From: support Date: Wed, 23 Nov 2022 16:47:34 +0000 (+0000) Subject: Built motion from commit d5e4af8c.|2.6.23 X-Git-Tag: 2.6.23 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22http:/google.github.io/material-design-icons?a=commitdiff_plain;h=b2ace134e5eb466deeb396f27c0c22876a7ffeae;p=motion2.git Built motion from commit d5e4af8c.|2.6.23 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index a07351d..4db650d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.22", + "version": "2.6.23", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-21T13:35:11.592Z", + "time": "2022-11-23T16:40:39.630Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 2b4864e..143485d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.22", + "version": "2.6.23", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-21T13:35:11.592Z", + "time": "2022-11-23T16:40:39.630Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e40c91e..b9ad350 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.22", + "version": "2.6.23", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index 2279703..da326f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.22", + "version": "2.6.23", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 2a86d18..d024ad2 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 _0x6618=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x299027,_0x5d2e4f){var _0x1bc622=function(_0x281430){while(--_0x281430){_0x299027['push'](_0x299027['shift']());}};_0x1bc622(++_0x5d2e4f);}(_0x6618,0xb8));var _0x8661=function(_0x2f99f9,_0x5208ca){_0x2f99f9=_0x2f99f9-0x0;var _0x3494c2=_0x6618[_0x2f99f9];return _0x3494c2;};'use strict';var Sequelize=require(_0x8661('0x0'));module[_0x8661('0x1')]={'name':{'type':Sequelize[_0x8661('0x2')],'get':function(_0xd67b07){return this[_0x8661('0x3')](_0x8661('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8661('0x5'),'integration','motionbar','jscripty','urlForward','browser','bot',_0x8661('0x6')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x8661('0x7')},'data1':{'type':Sequelize[_0x8661('0x8')](0x1000),'comment':_0x8661('0x9')},'data2':{'type':Sequelize[_0x8661('0x8')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x8661('0x8')](0x1000),'comment':_0x8661('0xa')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x8661('0xb')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x8661('0xc')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8661('0xd')],'comments':_0x8661('0xe')}}; \ No newline at end of file +var _0x5845=['bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','STRING','integration','jscripty','browser'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5845,0x80));var _0x5584=function(_0x557cc0,_0x581d23){_0x557cc0=_0x557cc0-0x0;var _0x48a33e=_0x5845[_0x557cc0];return _0x48a33e;};'use strict';var Sequelize=require(_0x5584('0x0'));module[_0x5584('0x1')]={'name':{'type':Sequelize[_0x5584('0x2')],'get':function(_0x16e3cb){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x5584('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5584('0x4'),'motionbar',_0x5584('0x5'),'urlForward',_0x5584('0x6'),_0x5584('0x7'),'script']],'msg':_0x5584('0x8')}},'comment':_0x5584('0x8')},'data1':{'type':Sequelize[_0x5584('0x3')](0x1000),'comment':_0x5584('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x5584('0xa')},'data3':{'type':Sequelize[_0x5584('0x3')](0x1000),'comment':_0x5584('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5584('0xc')},'data5':{'type':Sequelize[_0x5584('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5584('0x3')],'comments':_0x5584('0xd')},'data7':{'type':Sequelize[_0x5584('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c33d4dd..bee383b 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 _0x6515=['stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error'];(function(_0x194b5c,_0x3e4893){var _0x2badf6=function(_0x28433a){while(--_0x28433a){_0x194b5c['push'](_0x194b5c['shift']());}};_0x2badf6(++_0x3e4893);}(_0x6515,0xee));var _0x5651=function(_0x5cfc34,_0x7eed93){_0x5cfc34=_0x5cfc34-0x0;var _0x13dcf3=_0x6515[_0x5cfc34];return _0x13dcf3;};'use strict';var emlformat=require(_0x5651('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5651('0x1'));var jsonpatch=require(_0x5651('0x2'));var rp=require(_0x5651('0x3'));var moment=require('moment');var BPromise=require(_0x5651('0x4'));var Mustache=require(_0x5651('0x5'));var util=require('util');var path=require(_0x5651('0x6'));var sox=require('sox');var csv=require(_0x5651('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5651('0x8'));var _=require(_0x5651('0x9'));var squel=require(_0x5651('0xa'));var crypto=require(_0x5651('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5651('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5651('0xd'));var Redis=require(_0x5651('0xe'));var authService=require(_0x5651('0xf'));var qs=require(_0x5651('0x10'));var as=require(_0x5651('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5651('0x12'))(_0x5651('0x13'));var utils=require(_0x5651('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5651('0x15'));var db=require(_0x5651('0x16'))['db'];function respondWithStatusCode(_0x4a926d,_0x211afb){_0x211afb=_0x211afb||0xcc;return function(_0x54a407){if(_0x54a407){return _0x4a926d[_0x5651('0x17')](_0x211afb);}return _0x4a926d[_0x5651('0x18')](_0x211afb)[_0x5651('0x19')]();};}function respondWithResult(_0x5be770,_0x30245b){_0x30245b=_0x30245b||0xc8;return function(_0x42faca){if(_0x42faca){return _0x5be770[_0x5651('0x18')](_0x30245b)['json'](_0x42faca);}};}function respondWithFilteredResult(_0x6dd7b,_0x2d857e){return function(_0x52bf5f){if(_0x52bf5f){var _0x1d5e8c=typeof _0x2d857e[_0x5651('0x1a')]===_0x5651('0x1b')&&typeof _0x2d857e[_0x5651('0x1c')]===_0x5651('0x1b');var _0xadd448=_0x52bf5f['count'];var _0x6babe6=_0x1d5e8c?0x0:_0x2d857e[_0x5651('0x1a')];var _0x5dcada=_0x1d5e8c?_0x52bf5f[_0x5651('0x1d')]:_0x2d857e[_0x5651('0x1a')]+_0x2d857e['limit'];var _0x4cbbf5;if(_0x5dcada>=_0xadd448){_0x5dcada=_0xadd448;_0x4cbbf5=0xc8;}else{_0x4cbbf5=0xce;}_0x6dd7b[_0x5651('0x18')](_0x4cbbf5);return _0x6dd7b[_0x5651('0x1e')]('Content-Range',_0x6babe6+'-'+_0x5dcada+'/'+_0xadd448)[_0x5651('0x1f')](_0x52bf5f);}return null;};}function patchUpdates(_0x10c5a0){return function(_0x49636c){try{jsonpatch['apply'](_0x49636c,_0x10c5a0,!![]);}catch(_0x16ecde){return BPromise[_0x5651('0x20')](_0x16ecde);}return _0x49636c[_0x5651('0x21')]();};}function saveUpdates(_0x3c9c56,_0x81ee23){return function(_0x481c7b){if(_0x481c7b){return _0x481c7b[_0x5651('0x22')](_0x3c9c56)[_0x5651('0x23')](function(_0x379112){return _0x379112;});}return null;};}function removeEntity(_0x2df28f,_0x41b733){return function(_0xec7b7a){if(_0xec7b7a){return _0xec7b7a[_0x5651('0x24')]()['then'](function(){_0x2df28f['status'](0xcc)[_0x5651('0x19')]();});}};}function handleEntityNotFound(_0x431f33,_0x2d4f0d){return function(_0x3d47db){if(!_0x3d47db){_0x431f33['sendStatus'](0x194);}return _0x3d47db;};}function handleError(_0x41de1a,_0x3f17f9){_0x3f17f9=_0x3f17f9||0x1f4;return function(_0x391027){logger[_0x5651('0x25')](_0x391027[_0x5651('0x26')]);if(_0x391027[_0x5651('0x27')]){delete _0x391027[_0x5651('0x27')];}_0x41de1a[_0x5651('0x18')](_0x3f17f9)[_0x5651('0x28')](_0x391027);};}exports[_0x5651('0x22')]=function(_0x562e4f,_0xf3b28){if(_0x562e4f[_0x5651('0x29')]['id']){delete _0x562e4f[_0x5651('0x29')]['id'];}return db[_0x5651('0x2a')][_0x5651('0x2b')]({'where':{'id':_0x562e4f[_0x5651('0x2c')]['id']}})[_0x5651('0x23')](handleEntityNotFound(_0xf3b28,null))[_0x5651('0x23')](saveUpdates(_0x562e4f[_0x5651('0x29')],null))['then'](respondWithResult(_0xf3b28,null))[_0x5651('0x2d')](handleError(_0xf3b28,null));};exports['destroy']=function(_0x36c961,_0x204f4c){return db['Action']['find']({'where':{'id':_0x36c961[_0x5651('0x2c')]['id']}})[_0x5651('0x23')](handleEntityNotFound(_0x204f4c,null))[_0x5651('0x23')](removeEntity(_0x204f4c,null))[_0x5651('0x2d')](handleError(_0x204f4c,null));}; \ No newline at end of file +var _0x3d87=['mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x3d87,0x82));var _0x73d8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3d87[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0x73d8('0x0'));var rimraf=require(_0x73d8('0x1'));var zipdir=require(_0x73d8('0x2'));var jsonpatch=require(_0x73d8('0x3'));var rp=require('request-promise');var moment=require(_0x73d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73d8('0x5'));var util=require('util');var path=require('path');var sox=require(_0x73d8('0x6'));var csv=require(_0x73d8('0x7'));var ejs=require(_0x73d8('0x8'));var fs=require('fs');var fs_extra=require(_0x73d8('0x9'));var _=require(_0x73d8('0xa'));var squel=require('squel');var crypto=require(_0x73d8('0xb'));var jsforce=require(_0x73d8('0xc'));var deskjs=require(_0x73d8('0xd'));var toCsv=require(_0x73d8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73d8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x73d8('0xf'));var as=require(_0x73d8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73d8('0x11'))(_0x73d8('0x12'));var utils=require(_0x73d8('0x13'));var config=require(_0x73d8('0x14'));var licenseUtil=require(_0x73d8('0x15'));var db=require(_0x73d8('0x16'))['db'];function respondWithStatusCode(_0x5713f2,_0x20248c){_0x20248c=_0x20248c||0xcc;return function(_0x2d7bf1){if(_0x2d7bf1){return _0x5713f2[_0x73d8('0x17')](_0x20248c);}return _0x5713f2[_0x73d8('0x18')](_0x20248c)[_0x73d8('0x19')]();};}function respondWithResult(_0x3c0d07,_0x26faa1){_0x26faa1=_0x26faa1||0xc8;return function(_0x32a5c1){if(_0x32a5c1){return _0x3c0d07[_0x73d8('0x18')](_0x26faa1)[_0x73d8('0x1a')](_0x32a5c1);}};}function respondWithFilteredResult(_0x514d4b,_0x5b8249){return function(_0x35c8e3){if(_0x35c8e3){var _0x55f9f5=typeof _0x5b8249[_0x73d8('0x1b')]===_0x73d8('0x1c')&&typeof _0x5b8249['limit']===_0x73d8('0x1c');var _0x473ebf=_0x35c8e3[_0x73d8('0x1d')];var _0x37a9c8=_0x55f9f5?0x0:_0x5b8249[_0x73d8('0x1b')];var _0x4cae5d=_0x55f9f5?_0x35c8e3[_0x73d8('0x1d')]:_0x5b8249['offset']+_0x5b8249['limit'];var _0x2fc206;if(_0x4cae5d>=_0x473ebf){_0x4cae5d=_0x473ebf;_0x2fc206=0xc8;}else{_0x2fc206=0xce;}_0x514d4b['status'](_0x2fc206);return _0x514d4b['set'](_0x73d8('0x1e'),_0x37a9c8+'-'+_0x4cae5d+'/'+_0x473ebf)[_0x73d8('0x1a')](_0x35c8e3);}return null;};}function patchUpdates(_0x280619){return function(_0x1f7a36){try{jsonpatch[_0x73d8('0x1f')](_0x1f7a36,_0x280619,!![]);}catch(_0x4f7741){return BPromise[_0x73d8('0x20')](_0x4f7741);}return _0x1f7a36[_0x73d8('0x21')]();};}function saveUpdates(_0x25e36a,_0x5096b6){return function(_0x53014e){if(_0x53014e){return _0x53014e[_0x73d8('0x22')](_0x25e36a)[_0x73d8('0x23')](function(_0x3c0fa3){return _0x3c0fa3;});}return null;};}function removeEntity(_0x443ab9,_0x51c8a0){return function(_0x881aab){if(_0x881aab){return _0x881aab[_0x73d8('0x24')]()[_0x73d8('0x23')](function(){_0x443ab9['status'](0xcc)[_0x73d8('0x19')]();});}};}function handleEntityNotFound(_0x5a1c1b,_0x20040b){return function(_0x3e9157){if(!_0x3e9157){_0x5a1c1b[_0x73d8('0x17')](0x194);}return _0x3e9157;};}function handleError(_0x43135f,_0x37a44f){_0x37a44f=_0x37a44f||0x1f4;return function(_0x3aa69e){logger[_0x73d8('0x25')](_0x3aa69e[_0x73d8('0x26')]);if(_0x3aa69e[_0x73d8('0x27')]){delete _0x3aa69e[_0x73d8('0x27')];}_0x43135f[_0x73d8('0x18')](_0x37a44f)[_0x73d8('0x28')](_0x3aa69e);};}exports[_0x73d8('0x22')]=function(_0x2f9f89,_0x1cef07){if(_0x2f9f89[_0x73d8('0x29')]['id']){delete _0x2f9f89['body']['id'];}return db[_0x73d8('0x2a')][_0x73d8('0x2b')]({'where':{'id':_0x2f9f89[_0x73d8('0x2c')]['id']}})[_0x73d8('0x23')](handleEntityNotFound(_0x1cef07,null))[_0x73d8('0x23')](saveUpdates(_0x2f9f89[_0x73d8('0x29')],null))['then'](respondWithResult(_0x1cef07,null))['catch'](handleError(_0x1cef07,null));};exports[_0x73d8('0x24')]=function(_0x400380,_0x3dad6c){return db[_0x73d8('0x2a')][_0x73d8('0x2b')]({'where':{'id':_0x400380[_0x73d8('0x2c')]['id']}})[_0x73d8('0x23')](handleEntityNotFound(_0x3dad6c,null))[_0x73d8('0x23')](removeEntity(_0x3dad6c,null))['catch'](handleError(_0x3dad6c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 29c7554..4d7dcce 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 _0xd0a3=['../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x4921db,_0x56f74a){var _0x1ec833=function(_0x3cd803){while(--_0x3cd803){_0x4921db['push'](_0x4921db['shift']());}};_0x1ec833(++_0x56f74a);}(_0xd0a3,0x1e5));var _0x3d0a=function(_0x50d486,_0x2248a4){_0x50d486=_0x50d486-0x0;var _0x3b97a1=_0xd0a3[_0x50d486];return _0x3b97a1;};'use strict';var _=require(_0x3d0a('0x0'));var util=require(_0x3d0a('0x1'));var logger=require('../../config/logger')(_0x3d0a('0x2'));var moment=require(_0x3d0a('0x3'));var BPromise=require(_0x3d0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d0a('0x5'));var rimraf=require(_0x3d0a('0x6'));var config=require(_0x3d0a('0x7'));var attributes=require(_0x3d0a('0x8'));module['exports']=function(_0x1b926d,_0x30a2b7){return _0x1b926d[_0x3d0a('0x9')](_0x3d0a('0xa'),attributes,{'tableName':_0x3d0a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91b6=['util','api','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x5414e9,_0x2c64f9){var _0x836198=function(_0x37f65f){while(--_0x37f65f){_0x5414e9['push'](_0x5414e9['shift']());}};_0x836198(++_0x2c64f9);}(_0x91b6,0x18b));var _0x691b=function(_0x6cf760,_0x1616c8){_0x6cf760=_0x6cf760-0x0;var _0x2c0ff0=_0x91b6[_0x6cf760];return _0x2c0ff0;};'use strict';var _=require(_0x691b('0x0'));var util=require(_0x691b('0x1'));var logger=require('../../config/logger')(_0x691b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x691b('0x3'));var fs=require('fs');var path=require(_0x691b('0x4'));var rimraf=require(_0x691b('0x5'));var config=require(_0x691b('0x6'));var attributes=require(_0x691b('0x7'));module[_0x691b('0x8')]=function(_0x585420,_0x5586b9){return _0x585420[_0x691b('0x9')](_0x691b('0xa'),attributes,{'tableName':'tools_actions','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 f264b98..37eaa84 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3ce43b,_0x1fa95d){var _0x53dbcf=function(_0x58c030){while(--_0x58c030){_0x3ce43b['push'](_0x3ce43b['shift']());}};_0x53dbcf(++_0x1fa95d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1648d9,_0x48957b){var _0x4dd649=function(_0xcdfc77){while(--_0xcdfc77){_0x1648d9['push'](_0x1648d9['shift']());}};_0x4dd649(++_0x48957b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 8c7ecba..f66413e 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 _0x7086=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id','exports'];(function(_0x45e384,_0xf4fedc){var _0xc38891=function(_0x2793d4){while(--_0x2793d4){_0x45e384['push'](_0x45e384['shift']());}};_0xc38891(++_0xf4fedc);}(_0x7086,0x11d));var _0x6708=function(_0xc195d7,_0x5d109b){_0xc195d7=_0xc195d7-0x0;var _0x4758b9=_0x7086[_0xc195d7];return _0x4758b9;};'use strict';var multer=require(_0x6708('0x0'));var util=require(_0x6708('0x1'));var path=require(_0x6708('0x2'));var timeout=require('connect-timeout');var express=require(_0x6708('0x3'));var router=express[_0x6708('0x4')]();var fs_extra=require(_0x6708('0x5'));var auth=require(_0x6708('0x6'));var interaction=require(_0x6708('0x7'));var config=require(_0x6708('0x8'));var controller=require(_0x6708('0x9'));router[_0x6708('0xa')]('/:id',auth[_0x6708('0xb')](),controller[_0x6708('0xc')]);router['delete'](_0x6708('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x6708('0xe')]=router; \ No newline at end of file +var _0x7163=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30000b,_0xa62fbc){var _0x23da32=function(_0x228798){while(--_0x228798){_0x30000b['push'](_0x30000b['shift']());}};_0x23da32(++_0xa62fbc);}(_0x7163,0x104));var _0x3716=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x7163[_0x2ff762];return _0x158b02;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3716('0x0'));var timeout=require(_0x3716('0x1'));var express=require(_0x3716('0x2'));var router=express['Router']();var fs_extra=require(_0x3716('0x3'));var auth=require(_0x3716('0x4'));var interaction=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var controller=require(_0x3716('0x7'));router[_0x3716('0x8')](_0x3716('0x9'),auth['isAuthenticated'](),controller[_0x3716('0xa')]);router[_0x3716('0xb')]('/:id',auth[_0x3716('0xc')](),controller['destroy']);module[_0x3716('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 5418356..65b9367 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x1323c0,_0x3bb817){var _0x4e0e88=function(_0x43a431){while(--_0x43a431){_0x1323c0['push'](_0x1323c0['shift']());}};_0x4e0e88(++_0x3bb817);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x11de26,_0x39b52b){_0x11de26=_0x11de26-0x0;var _0x57feaf=_0x9c5a[_0x11de26];return _0x57feaf;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x8dd1be,_0x18e210){var _0x1216d2=function(_0xa57c03){while(--_0xa57c03){_0x8dd1be['push'](_0x8dd1be['shift']());}};_0x1216d2(++_0x18e210);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3cdaf4,_0x505e4f){_0x3cdaf4=_0x3cdaf4-0x0;var _0x20d430=_0x9c5a[_0x3cdaf4];return _0x20d430;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'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 9a14b40..ec40e8d 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 _0x3fef=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','autoAssociation','error','find','preview','join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','cross_join','MAX(%s)','AVG(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','AnalyticMetric','DESC','output','web','fullPath','%s-%s.%s','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','run','runReport','ROUND(%s)','select','groupBy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','CustomReports','UserProfileResource','destroy','then','stack','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1e9182,_0x4965de){var _0x560bb9=function(_0x3484da){while(--_0x3484da){_0x1e9182['push'](_0x1e9182['shift']());}};_0x560bb9(++_0x4965de);}(_0x3fef,0x1a5));var _0xf3fe=function(_0x47cd62,_0x562de6){_0x47cd62=_0x47cd62-0x0;var _0x50ff9c=_0x3fef[_0x47cd62];return _0x50ff9c;};'use strict';var emlformat=require(_0xf3fe('0x0'));var rimraf=require(_0xf3fe('0x1'));var zipdir=require(_0xf3fe('0x2'));var jsonpatch=require(_0xf3fe('0x3'));var rp=require('request-promise');var moment=require(_0xf3fe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf3fe('0x5'));var util=require('util');var path=require(_0xf3fe('0x6'));var sox=require('sox');var csv=require(_0xf3fe('0x7'));var ejs=require(_0xf3fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3fe('0x9'));var squel=require(_0xf3fe('0xa'));var crypto=require('crypto');var jsforce=require(_0xf3fe('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf3fe('0x7'));var querystring=require('querystring');var Papa=require(_0xf3fe('0xc'));var Redis=require(_0xf3fe('0xd'));var authService=require(_0xf3fe('0xe'));var qs=require(_0xf3fe('0xf'));var as=require(_0xf3fe('0x10'));var hardwareService=require(_0xf3fe('0x11'));var logger=require(_0xf3fe('0x12'))('api');var utils=require(_0xf3fe('0x13'));var config=require(_0xf3fe('0x14'));var licenseUtil=require(_0xf3fe('0x15'));var db=require(_0xf3fe('0x16'))['db'];var dbH=require(_0xf3fe('0x16'))[_0xf3fe('0x17')];function respondWithStatusCode(_0xecda5a,_0x39ff57){_0x39ff57=_0x39ff57||0xcc;return function(_0xf51f98){if(_0xf51f98){return _0xecda5a[_0xf3fe('0x18')](_0x39ff57);}return _0xecda5a[_0xf3fe('0x19')](_0x39ff57)[_0xf3fe('0x1a')]();};}function respondWithResult(_0x107db7,_0x2b6ca1){_0x2b6ca1=_0x2b6ca1||0xc8;return function(_0x20135a){if(_0x20135a){return _0x107db7['status'](_0x2b6ca1)[_0xf3fe('0x1b')](_0x20135a);}};}function respondWithFilteredResult(_0x1d3620,_0x4f4cb6){return function(_0x52c84c){if(_0x52c84c){var _0x54e015=typeof _0x4f4cb6[_0xf3fe('0x1c')]===_0xf3fe('0x1d')&&typeof _0x4f4cb6[_0xf3fe('0x1e')]===_0xf3fe('0x1d');var _0x195168=_0x52c84c[_0xf3fe('0x1f')];var _0xc40181=_0x54e015?0x0:_0x4f4cb6[_0xf3fe('0x1c')];var _0x3383f7=_0x54e015?_0x52c84c[_0xf3fe('0x1f')]:_0x4f4cb6[_0xf3fe('0x1c')]+_0x4f4cb6['limit'];var _0x2ea147;if(_0x3383f7>=_0x195168){_0x3383f7=_0x195168;_0x2ea147=0xc8;}else{_0x2ea147=0xce;}_0x1d3620[_0xf3fe('0x19')](_0x2ea147);return _0x1d3620[_0xf3fe('0x20')](_0xf3fe('0x21'),_0xc40181+'-'+_0x3383f7+'/'+_0x195168)[_0xf3fe('0x1b')](_0x52c84c);}return null;};}function patchUpdates(_0x359af2){return function(_0x2915d6){try{jsonpatch['apply'](_0x2915d6,_0x359af2,!![]);}catch(_0x1b6589){return BPromise[_0xf3fe('0x22')](_0x1b6589);}return _0x2915d6[_0xf3fe('0x23')]();};}function saveUpdates(_0x4fd043,_0x352c51){return function(_0x3d28ec){if(_0x3d28ec){return _0x3d28ec[_0xf3fe('0x24')](_0x4fd043)['then'](function(_0x5133f6){return _0x5133f6;});}return null;};}function removeEntity(_0x2a6396,_0x2940c3){return function(_0x3b6cf3){if(_0x3b6cf3){return _0x3b6cf3['destroy']()['then'](function(){var _0x30cd5d=_0x3b6cf3['get']({'plain':!![]});var _0x121760=_0xf3fe('0x25');return db[_0xf3fe('0x26')][_0xf3fe('0x27')]({'where':{'type':_0x121760,'resourceId':_0x30cd5d['id']}})[_0xf3fe('0x28')](function(){return _0x3b6cf3;});})[_0xf3fe('0x28')](function(){_0x2a6396[_0xf3fe('0x19')](0xcc)[_0xf3fe('0x1a')]();});}};}function handleEntityNotFound(_0x68c2eb,_0x21a61d){return function(_0x1e2252){if(!_0x1e2252){_0x68c2eb[_0xf3fe('0x18')](0x194);}return _0x1e2252;};}function handleError(_0x27b8f8,_0x1ea586){_0x1ea586=_0x1ea586||0x1f4;return function(_0xeb2c18){logger['error'](_0xeb2c18[_0xf3fe('0x29')]);if(_0xeb2c18['name']){delete _0xeb2c18['name'];}_0x27b8f8['status'](_0x1ea586)['send'](_0xeb2c18);};}exports['index']=function(_0x3c3706,_0xf6f9ec){var _0x1f5ef2={},_0x469acc={},_0x3cae4f={'count':0x0,'rows':[]};var _0x4d6fa8=_[_0xf3fe('0x2a')](db[_0xf3fe('0x2b')][_0xf3fe('0x2c')],function(_0x12cb0d){return{'name':_0x12cb0d[_0xf3fe('0x2d')],'type':_0x12cb0d[_0xf3fe('0x2e')][_0xf3fe('0x2f')]};});_0x469acc[_0xf3fe('0x30')]=_[_0xf3fe('0x2a')](_0x4d6fa8,_0xf3fe('0x31'));_0x469acc[_0xf3fe('0x32')]=_[_0xf3fe('0x33')](_0x3c3706['query']);_0x469acc[_0xf3fe('0x34')]=_[_0xf3fe('0x35')](_0x469acc[_0xf3fe('0x30')],_0x469acc['query']);_0x1f5ef2['attributes']=_[_0xf3fe('0x35')](_0x469acc[_0xf3fe('0x30')],qs[_0xf3fe('0x36')](_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x36')]));_0x1f5ef2[_0xf3fe('0x37')]=_0x1f5ef2[_0xf3fe('0x37')][_0xf3fe('0x38')]?_0x1f5ef2[_0xf3fe('0x37')]:_0x469acc[_0xf3fe('0x30')];if(!_0x3c3706['query'][_0xf3fe('0x39')](_0xf3fe('0x3a'))){_0x1f5ef2['limit']=qs[_0xf3fe('0x1e')](_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x1e')]);_0x1f5ef2[_0xf3fe('0x1c')]=qs['offset'](_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x1c')]);}_0x1f5ef2[_0xf3fe('0x3b')]=qs[_0xf3fe('0x3c')](_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x3c')]);_0x1f5ef2[_0xf3fe('0x3d')]=qs[_0xf3fe('0x34')](_[_0xf3fe('0x3e')](_0x3c3706['query'],_0x469acc[_0xf3fe('0x34')]),_0x4d6fa8);if(_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x3f')]){_0x1f5ef2[_0xf3fe('0x3d')]=_[_0xf3fe('0x40')](_0x1f5ef2[_0xf3fe('0x3d')],{'$or':_[_0xf3fe('0x2a')](_0x4d6fa8,function(_0x34d5e9){if(_0x34d5e9[_0xf3fe('0x2e')]!==_0xf3fe('0x41')){var _0x15dc16={};_0x15dc16[_0x34d5e9[_0xf3fe('0x31')]]={'$like':'%'+_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x3f')]+'%'};return _0x15dc16;}})});}_0x1f5ef2=_['merge']({},_0x1f5ef2,_0x3c3706['options']);var _0x2be4b1={'where':_0x1f5ef2[_0xf3fe('0x3d')]};return db[_0xf3fe('0x2b')][_0xf3fe('0x1f')](_0x2be4b1)[_0xf3fe('0x28')](function(_0x3e6ac6){_0x3cae4f[_0xf3fe('0x1f')]=_0x3e6ac6;if(_0x3c3706[_0xf3fe('0x32')][_0xf3fe('0x42')]){_0x1f5ef2[_0xf3fe('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xf3fe('0x44')](_0x1f5ef2);})[_0xf3fe('0x28')](function(_0x5919a2){_0x3cae4f[_0xf3fe('0x45')]=_0x5919a2;return _0x3cae4f;})['then'](respondWithFilteredResult(_0xf6f9ec,_0x1f5ef2))[_0xf3fe('0x46')](handleError(_0xf6f9ec,null));};exports['show']=function(_0x503d52,_0x1cfb2f){var _0x2f342b={'raw':![],'where':{'id':_0x503d52[_0xf3fe('0x47')]['id']}},_0xb8a9d1={};_0xb8a9d1[_0xf3fe('0x30')]=_[_0xf3fe('0x33')](db[_0xf3fe('0x2b')][_0xf3fe('0x2c')]);_0xb8a9d1[_0xf3fe('0x32')]=_[_0xf3fe('0x33')](_0x503d52['query']);_0xb8a9d1[_0xf3fe('0x34')]=_[_0xf3fe('0x35')](_0xb8a9d1[_0xf3fe('0x30')],_0xb8a9d1['query']);_0x2f342b[_0xf3fe('0x37')]=_[_0xf3fe('0x35')](_0xb8a9d1['model'],qs[_0xf3fe('0x36')](_0x503d52['query'][_0xf3fe('0x36')]));_0x2f342b[_0xf3fe('0x37')]=_0x2f342b[_0xf3fe('0x37')][_0xf3fe('0x38')]?_0x2f342b[_0xf3fe('0x37')]:_0xb8a9d1[_0xf3fe('0x30')];if(_0x503d52[_0xf3fe('0x32')][_0xf3fe('0x42')]){_0x2f342b['include']=[{'all':!![]}];}_0x2f342b=_['merge']({},_0x2f342b,_0x503d52[_0xf3fe('0x48')]);return db[_0xf3fe('0x2b')]['find'](_0x2f342b)[_0xf3fe('0x28')](handleEntityNotFound(_0x1cfb2f,null))[_0xf3fe('0x28')](respondWithResult(_0x1cfb2f,null))[_0xf3fe('0x46')](handleError(_0x1cfb2f,null));};exports['create']=function(_0x3c5867,_0x3a9925){return db[_0xf3fe('0x2b')][_0xf3fe('0x49')](_0x3c5867[_0xf3fe('0x4a')],{})[_0xf3fe('0x28')](function(_0x2dad15){var _0x40f517=_0x3c5867['user']['get']({'plain':!![]});if(!_0x40f517)throw new Error(_0xf3fe('0x4b'));if(_0x40f517['role']==='user'){var _0x1930af=_0x2dad15['get']({'plain':!![]});var _0x20ba3=_0xf3fe('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x20ba3,'userProfileId':_0x40f517['userProfileId']},'raw':!![]})['then'](function(_0x5003cd){if(_0x5003cd&&_0x5003cd[_0xf3fe('0x4d')]===0x0){return db[_0xf3fe('0x26')][_0xf3fe('0x49')]({'name':_0x1930af['name'],'resourceId':_0x1930af['id'],'type':_0xf3fe('0x25'),'sectionId':_0x5003cd['id']},{})[_0xf3fe('0x28')](function(){return _0x2dad15;});}else{return _0x2dad15;}})[_0xf3fe('0x46')](function(_0x11d695){logger[_0xf3fe('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11d695);throw _0x11d695;});}return _0x2dad15;})['then'](respondWithResult(_0x3a9925,0xc9))[_0xf3fe('0x46')](handleError(_0x3a9925,null));};exports['update']=function(_0x580a3e,_0x18d6b8){if(_0x580a3e[_0xf3fe('0x4a')]['id']){delete _0x580a3e[_0xf3fe('0x4a')]['id'];}return db[_0xf3fe('0x2b')][_0xf3fe('0x4f')]({'where':{'id':_0x580a3e[_0xf3fe('0x47')]['id']}})[_0xf3fe('0x28')](handleEntityNotFound(_0x18d6b8,null))[_0xf3fe('0x28')](saveUpdates(_0x580a3e[_0xf3fe('0x4a')],null))[_0xf3fe('0x28')](respondWithResult(_0x18d6b8,null))[_0xf3fe('0x46')](handleError(_0x18d6b8,null));};exports[_0xf3fe('0x27')]=function(_0x437d8f,_0x304b2b){return db['AnalyticCustomReport'][_0xf3fe('0x4f')]({'where':{'id':_0x437d8f[_0xf3fe('0x47')]['id']}})[_0xf3fe('0x28')](handleEntityNotFound(_0x304b2b,null))[_0xf3fe('0x28')](removeEntity(_0x304b2b,null))[_0xf3fe('0x46')](handleError(_0x304b2b,null));};exports[_0xf3fe('0x50')]=function(_0x5e1135,_0x18ec59){var _0x593362=0xa;var _0x52271f=[_0xf3fe('0x51'),'left_join','right_join','cross_join'];var _0x4df53c={'SUM':_0xf3fe('0x52'),'COUNT':_0xf3fe('0x53'),'COUNT DISTINCT':_0xf3fe('0x54'),'MAX':'MAX(%s)','MIN':_0xf3fe('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf3fe('0x56'),'GROUP_CONCAT ASC':_0xf3fe('0x57'),'GROUP_CONCAT DESC':_0xf3fe('0x58')};var _0x5a886c={'SEC_TO_TIME':_0xf3fe('0x59'),'DATE':_0xf3fe('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf3fe('0x5b')};var _0x5ec3b3=function(_0x4df864){return!_[_0xf3fe('0x5c')]([_0xf3fe('0x5d'),_0xf3fe('0x5e'),_0xf3fe('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4df864);};var _0x4580c3=function(_0x22ede5){if(!_0x22ede5||!_0x22ede5[_0xf3fe('0x60')][_0xf3fe('0x38')]){return'';}for(var _0x5173f7='(',_0x2d3050=0x0;_0x2d3050<_0x22ede5['rules']['length'];_0x2d3050+=0x1){_0x2d3050>0x0&&(_0x5173f7+='\x20'+_0x22ede5['operator']+'\x20');_0x5173f7+=_0x22ede5[_0xf3fe('0x60')][_0x2d3050][_0xf3fe('0x61')]?_0x4580c3(_0x22ede5[_0xf3fe('0x60')][_0x2d3050][_0xf3fe('0x61')]):_0x22ede5[_0xf3fe('0x60')][_0x2d3050][_0xf3fe('0x62')]+'\x20'+_0x22ede5[_0xf3fe('0x60')][_0x2d3050]['condition']+(_0x5ec3b3(_0x22ede5[_0xf3fe('0x60')][_0x2d3050][_0xf3fe('0x63')])?'\x20'+_0x22ede5[_0xf3fe('0x60')][_0x2d3050][_0xf3fe('0x64')]:'');}return _0x5173f7+')';};var _0x4edd56={'where':{'id':_0x5e1135[_0xf3fe('0x47')]['id']}},_0x230118,_0x57d686,_0x51e67a,_0xdc3245,_0x18f93a;_0x4edd56=_[_0xf3fe('0x40')]({},_0x4edd56,_0x5e1135[_0xf3fe('0x48')]);return db[_0xf3fe('0x2b')][_0xf3fe('0x4f')](_0x4edd56)['then'](function(_0x407994){if(_0x407994){_0x230118=_0x407994;return _0x407994[_0xf3fe('0x65')]();}return null;})[_0xf3fe('0x28')](function(_0x1706b5){if(_0x1706b5){if(!_0x1706b5[_0xf3fe('0x38')]){throw new db['Sequelize'][(_0xf3fe('0x66'))](_0xf3fe('0x67'),0x193);}_0x57d686=_0x1706b5;return db['AnalyticMetric'][_0xf3fe('0x44')]({'raw':!![]});}return null;})['then'](function(_0x1c0f7a){if(_0x1c0f7a){_0x51e67a=_[_0xf3fe('0x68')](_0x1c0f7a,'id');var _0x27a866;var _0x5cbc5d=squel['select']();_0x5cbc5d[_0xf3fe('0x69')](_0x230118[_0xf3fe('0x6a')]);for(var _0x10d483=0x0;_0x10d483<_0x57d686['length'];_0x10d483+=0x1){_0x27a866=_0x57d686[_0x10d483][_0xf3fe('0x6b')]?_0x51e67a[_0x57d686[_0x10d483][_0xf3fe('0x6b')]][_0xf3fe('0x6c')]:_0x57d686[_0x10d483]['field'];_0x27a866=_0x57d686[_0x10d483][_0xf3fe('0x6d')]?_[_0xf3fe('0x6e')](_0x4df53c[_0x57d686[_0x10d483][_0xf3fe('0x6d')]],'%s',_0x27a866):_0x27a866;_0x27a866=_0x57d686[_0x10d483]['format']?_[_0xf3fe('0x6e')](_0x5a886c[_0x57d686[_0x10d483][_0xf3fe('0x6f')]],'%s',_0x27a866):_0x27a866;if(_0x57d686[_0x10d483]['groupBy']){_0x5cbc5d['group'](_0x27a866);}_0x57d686[_0x10d483][_0xf3fe('0x70')]&&_0x5cbc5d[_0xf3fe('0x3b')](_0x27a866,_0x57d686[_0x10d483][_0xf3fe('0x70')]==='DESC'?![]:!![]);_0x5cbc5d[_0xf3fe('0x62')](_0x27a866,_0x57d686[_0x10d483][_0xf3fe('0x71')]||_0x27a866);}if(_0x230118[_0xf3fe('0x72')]){_0x230118[_0xf3fe('0x72')]=JSON[_0xf3fe('0x73')](_0x230118['joins']);for(var _0x3280e2=0x0;_0x3280e2<_0x230118[_0xf3fe('0x72')][_0xf3fe('0x38')];_0x3280e2+=0x1){if(_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x2e')]&&_['includes'](_0x52271f,_0x230118['joins'][_0x3280e2][_0xf3fe('0x2e')])&&_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x74')]&&_0x230118['joins'][_0x3280e2][_0xf3fe('0x75')]&&_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x76')]){_0x5cbc5d[_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x2e')]](_0x230118[_0xf3fe('0x72')][_0x3280e2]['foreignTable'],null,util[_0xf3fe('0x6f')](_0xf3fe('0x77'),_0x230118['table'],_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x74')],_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x75')],_0x230118[_0xf3fe('0x72')][_0x3280e2][_0xf3fe('0x76')]));}}}if(_0x230118[_0xf3fe('0x78')]){_0x230118[_0xf3fe('0x78')]=JSON[_0xf3fe('0x73')](_0x230118['conditions']);_0x5cbc5d[_0xf3fe('0x3d')](_0x4580c3(_0x230118['conditions'][_0xf3fe('0x61')]));}_0x18f93a=_0x5cbc5d[_0xf3fe('0x79')]();_0x5cbc5d['limit'](_0x593362);_0x5cbc5d[_0xf3fe('0x1c')](0x0);logger[_0xf3fe('0x7a')](_0xf3fe('0x7b'),_0x5cbc5d[_0xf3fe('0x7c')]());return dbH['sequelize'][_0xf3fe('0x32')](_0x5cbc5d['toString'](),{'type':dbH[_0xf3fe('0x7d')][_0xf3fe('0x7e')][_0xf3fe('0x7f')]});}})[_0xf3fe('0x28')](respondWithResult(_0x18ec59,null))[_0xf3fe('0x46')](handleError(_0x18ec59,null));};function runReport(_0x3e6959,_0x3fc3a4,_0x109d97){var _0x3d951a=_0x3fc3a4['name'];var _0x241257=0xa;var _0x3dd511=[_0xf3fe('0x51'),_0xf3fe('0x80'),_0xf3fe('0x81'),_0xf3fe('0x82')];var _0x519e59={'SUM':_0xf3fe('0x52'),'COUNT':_0xf3fe('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf3fe('0x83'),'MIN':'MIN(%s)','AVG':_0xf3fe('0x84'),'GROUP_CONCAT':_0xf3fe('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf3fe('0x58')};var _0x191113={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xf3fe('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x12ccdb=function(_0x52519a){return!_['includes']([_0xf3fe('0x5d'),'IS\x20NOT\x20NULL',_0xf3fe('0x5f'),_0xf3fe('0x86')],_0x52519a);};var _0xfffce9=function(_0x38ef60){if(!_0x38ef60||!_0x38ef60[_0xf3fe('0x60')][_0xf3fe('0x38')]){return'';}for(var _0x86dc1f='(',_0x208e39=0x0;_0x208e39<_0x38ef60[_0xf3fe('0x60')][_0xf3fe('0x38')];_0x208e39+=0x1){_0x208e39>0x0&&(_0x86dc1f+='\x20'+_0x38ef60[_0xf3fe('0x87')]+'\x20');_0x86dc1f+=_0x38ef60['rules'][_0x208e39][_0xf3fe('0x61')]?_0xfffce9(_0x38ef60['rules'][_0x208e39][_0xf3fe('0x61')]):_0x38ef60['rules'][_0x208e39][_0xf3fe('0x62')]+'\x20'+_0x38ef60[_0xf3fe('0x60')][_0x208e39]['condition']+(_0x12ccdb(_0x38ef60['rules'][_0x208e39][_0xf3fe('0x63')])?'\x20'+_0x38ef60[_0xf3fe('0x60')][_0x208e39][_0xf3fe('0x64')]:'');}return _0x86dc1f+')';};var _0x32ae96={'where':{'id':_0x3e6959['id']}},_0xfbc24,_0xa5c394,_0xe3b2c7,_0xe6504a,_0x20053c;_0x32ae96=_['merge']({},_0x32ae96,_0x109d97);return db['AnalyticCustomReport'][_0xf3fe('0x4f')](_0x32ae96)[_0xf3fe('0x28')](function(_0x1e5bcc){if(_0x1e5bcc){_0xfbc24=_0x1e5bcc;return _0x1e5bcc['getFields']();}return null;})[_0xf3fe('0x28')](function(_0x40e743){if(_0x40e743){if(!_0x40e743[_0xf3fe('0x38')]){throw new db[(_0xf3fe('0x88'))][(_0xf3fe('0x66'))](_0xf3fe('0x67'),0x193);}_0xa5c394=_0x40e743;return db[_0xf3fe('0x89')]['findAll']({'raw':!![]});}return null;})[_0xf3fe('0x28')](function(_0x5c45eb){if(_0x5c45eb){_0xe3b2c7=_['keyBy'](_0x5c45eb,'id');var _0x2dceec;var _0x86b7a8=squel['select']();_0x86b7a8[_0xf3fe('0x69')](_0xfbc24[_0xf3fe('0x6a')]);for(var _0x4eb554=0x0;_0x4eb554<_0xa5c394[_0xf3fe('0x38')];_0x4eb554+=0x1){_0x2dceec=_0xa5c394[_0x4eb554][_0xf3fe('0x6b')]?_0xe3b2c7[_0xa5c394[_0x4eb554][_0xf3fe('0x6b')]][_0xf3fe('0x6c')]:_0xa5c394[_0x4eb554]['field'];_0x2dceec=_0xa5c394[_0x4eb554]['function']?_[_0xf3fe('0x6e')](_0x519e59[_0xa5c394[_0x4eb554][_0xf3fe('0x6d')]],'%s',_0x2dceec):_0x2dceec;_0x2dceec=_0xa5c394[_0x4eb554][_0xf3fe('0x6f')]?_['replace'](_0x191113[_0xa5c394[_0x4eb554]['format']],'%s',_0x2dceec):_0x2dceec;if(_0xa5c394[_0x4eb554]['groupBy']){_0x86b7a8[_0xf3fe('0x61')](_0x2dceec);}_0xa5c394[_0x4eb554]['orderBy']&&_0x86b7a8[_0xf3fe('0x3b')](_0x2dceec,_0xa5c394[_0x4eb554]['orderBy']===_0xf3fe('0x8a')?![]:!![]);_0x86b7a8[_0xf3fe('0x62')](_0x2dceec,_0xa5c394[_0x4eb554][_0xf3fe('0x71')]||_0x2dceec);}if(_0xfbc24[_0xf3fe('0x72')]){_0xfbc24[_0xf3fe('0x72')]=JSON[_0xf3fe('0x73')](_0xfbc24[_0xf3fe('0x72')]);for(var _0x39dda0=0x0;_0x39dda0<_0xfbc24[_0xf3fe('0x72')][_0xf3fe('0x38')];_0x39dda0+=0x1){if(_0xfbc24[_0xf3fe('0x72')][_0x39dda0][_0xf3fe('0x2e')]&&_['includes'](_0x3dd511,_0xfbc24[_0xf3fe('0x72')][_0x39dda0][_0xf3fe('0x2e')])&&_0xfbc24[_0xf3fe('0x72')][_0x39dda0]['parentKey']&&_0xfbc24['joins'][_0x39dda0][_0xf3fe('0x75')]&&_0xfbc24[_0xf3fe('0x72')][_0x39dda0][_0xf3fe('0x76')]){_0x86b7a8[_0xfbc24[_0xf3fe('0x72')][_0x39dda0]['type']](_0xfbc24[_0xf3fe('0x72')][_0x39dda0]['foreignTable'],null,util[_0xf3fe('0x6f')]('%s.%s\x20=\x20%s.%s',_0xfbc24[_0xf3fe('0x6a')],_0xfbc24[_0xf3fe('0x72')][_0x39dda0]['parentKey'],_0xfbc24[_0xf3fe('0x72')][_0x39dda0][_0xf3fe('0x75')],_0xfbc24['joins'][_0x39dda0]['foreignKey']));}}}if(_0xfbc24[_0xf3fe('0x78')]){_0xfbc24[_0xf3fe('0x78')]=JSON['parse'](_0xfbc24[_0xf3fe('0x78')]);_0x86b7a8[_0xf3fe('0x3d')](_0xfffce9(_0xfbc24[_0xf3fe('0x78')][_0xf3fe('0x61')]));}_0x20053c=_0x86b7a8[_0xf3fe('0x79')]();_0x86b7a8[_0xf3fe('0x1e')](_0x241257);_0x86b7a8[_0xf3fe('0x1c')](0x0);return;}})[_0xf3fe('0x28')](function(){if(_0x3fc3a4[_0xf3fe('0x8b')]===_0xf3fe('0x8c')){return null;}var _0x27465d=_['merge'](_0x3fc3a4,{'name':_0x3fc3a4[_0xf3fe('0x8d')]||_0x3fc3a4['name']||_0xfbc24[_0xf3fe('0x31')],'basename':_0x3d951a,'savename':util[_0xf3fe('0x6f')](_0xf3fe('0x8e'),_0x3fc3a4['name']||_0xfbc24[_0xf3fe('0x31')],require('randomstring')[_0xf3fe('0x8f')](0x4),_0x3fc3a4[_0xf3fe('0x8b')]||_0xf3fe('0x90')),'reportId':_0xfbc24['id'],'reportType':_0xf3fe('0x91')});return db['AnalyticExtractedReport']['create'](_0x27465d,{'raw':!![]});})[_0xf3fe('0x28')](function(_0x353a12){if(_0xfbc24['table']===_0xf3fe('0x92')){_0x20053c[_0xf3fe('0x3d')](_0xfbc24[_0xf3fe('0x6a')]+_0xf3fe('0x93'),_0x3fc3a4['startDate'],_0x3fc3a4[_0xf3fe('0x94')]);}else{_0x20053c['where'](_0xfbc24[_0xf3fe('0x6a')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3fc3a4[_0xf3fe('0x95')],_0x3fc3a4[_0xf3fe('0x94')]);}if(_0x353a12){logger[_0xf3fe('0x96')](_0xf3fe('0x97'),_0x20053c[_0xf3fe('0x7c')]());require(_0xf3fe('0x98'))[_0xf3fe('0x99')](path['join'](__dirname,_0xf3fe('0x9a'),_0x353a12[_0xf3fe('0x8b')]),[_0x353a12['id'],_0x20053c[_0xf3fe('0x7c')](),path['join'](__dirname,_0xf3fe('0x9b'),_0x353a12['savename']),_0x3d951a]);return _0x353a12;}else{var _0xbff876=squel['select']();_0xbff876[_0xf3fe('0x69')]('('+_0x20053c['toString']()+')','countTable');_0xbff876[_0xf3fe('0x62')]('COUNT(*)',_0xf3fe('0x1f'));_0x20053c[_0xf3fe('0x1e')](_0x3fc3a4[_0xf3fe('0x1e')]||_0x241257);_0x20053c[_0xf3fe('0x1c')](_0x3fc3a4[_0xf3fe('0x1c')]||0x0);return dbH[_0xf3fe('0x7d')][_0xf3fe('0x32')](_0xbff876['toString'](),{'type':dbH[_0xf3fe('0x7d')][_0xf3fe('0x7e')][_0xf3fe('0x7f')]})['then'](function(_0x5224e9){if(!_0x5224e9['length']){_0xe6504a=0x0;}else{_0xe6504a=_0x5224e9[0x0]['count']||0x0;}return dbH[_0xf3fe('0x7d')][_0xf3fe('0x32')](_0x20053c[_0xf3fe('0x7c')](),{'type':dbH[_0xf3fe('0x7d')][_0xf3fe('0x7e')][_0xf3fe('0x7f')]});})[_0xf3fe('0x28')](function(_0x21eb07){return{'rows':_0x21eb07||[],'count':_0xe6504a};});}});}exports[_0xf3fe('0x9c')]=function(_0x2867a4,_0x18d530){return runReport(_0x2867a4[_0xf3fe('0x47')],_0x2867a4[_0xf3fe('0x32')],_0x2867a4['options'])['then'](respondWithResult(_0x18d530,null))['catch'](handleError(_0x18d530,null));};exports[_0xf3fe('0x9d')]=runReport;exports[_0xf3fe('0x32')]=function(_0x190940,_0x52e129){var _0x349007=0xa;var _0x15b699=[_0xf3fe('0x51'),'left_join',_0xf3fe('0x81'),_0xf3fe('0x82')];var _0x197102={'SUM':_0xf3fe('0x52'),'COUNT':_0xf3fe('0x53'),'COUNT DISTINCT':_0xf3fe('0x54'),'MAX':'MAX(%s)','MIN':_0xf3fe('0x55'),'AVG':_0xf3fe('0x84'),'GROUP_CONCAT':_0xf3fe('0x56'),'GROUP_CONCAT ASC':_0xf3fe('0x57'),'GROUP_CONCAT DESC':_0xf3fe('0x58')};var _0x5f539c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xf3fe('0x85'),'ROUND':_0xf3fe('0x9e'),'UNIX_TIMESTAMP':_0xf3fe('0x5b')};var _0x74b998=function(_0x229df1){return!_[_0xf3fe('0x5c')]([_0xf3fe('0x5d'),_0xf3fe('0x5e'),_0xf3fe('0x5f'),_0xf3fe('0x86')],_0x229df1);};var _0x1e367a=function(_0x54270a){if(!_0x54270a||!_0x54270a['rules'][_0xf3fe('0x38')]){return'';}for(var _0x33cedf='(',_0x22f718=0x0;_0x22f718<_0x54270a[_0xf3fe('0x60')]['length'];_0x22f718+=0x1){_0x22f718>0x0&&(_0x33cedf+='\x20'+_0x54270a[_0xf3fe('0x87')]+'\x20');_0x33cedf+=_0x54270a[_0xf3fe('0x60')][_0x22f718][_0xf3fe('0x61')]?_0x1e367a(_0x54270a[_0xf3fe('0x60')][_0x22f718][_0xf3fe('0x61')]):_0x54270a['rules'][_0x22f718][_0xf3fe('0x62')]+'\x20'+_0x54270a[_0xf3fe('0x60')][_0x22f718][_0xf3fe('0x63')]+(_0x74b998(_0x54270a[_0xf3fe('0x60')][_0x22f718][_0xf3fe('0x63')])?'\x20'+_0x54270a[_0xf3fe('0x60')][_0x22f718][_0xf3fe('0x64')]:'');}return _0x33cedf+')';};var _0x130158={'where':{'id':_0x190940[_0xf3fe('0x47')]['id']}},_0x32dc75,_0x32b612,_0x57dc20,_0x208cda,_0x4aa929;_0x130158=_['merge']({},_0x130158,_0x190940[_0xf3fe('0x48')]);return db[_0xf3fe('0x2b')][_0xf3fe('0x4f')](_0x130158)[_0xf3fe('0x28')](function(_0x8fe241){if(_0x8fe241){_0x32dc75=_0x8fe241;return _0x8fe241['getFields']();}return null;})[_0xf3fe('0x28')](function(_0x4e1fee){if(_0x4e1fee){if(!_0x4e1fee[_0xf3fe('0x38')]){throw new db[(_0xf3fe('0x88'))]['ValidationErrorItem'](_0xf3fe('0x67'),0x193);}_0x32b612=_0x4e1fee;return db[_0xf3fe('0x89')][_0xf3fe('0x44')]({'raw':!![]});}return null;})[_0xf3fe('0x28')](function(_0x2c7940){if(_0x2c7940){_0x57dc20=_['keyBy'](_0x2c7940,'id');var _0x4bce9b;var _0x4fa809=squel[_0xf3fe('0x9f')]();_0x4fa809[_0xf3fe('0x69')](_0x32dc75[_0xf3fe('0x6a')]);for(var _0xdc74d4=0x0;_0xdc74d4<_0x32b612[_0xf3fe('0x38')];_0xdc74d4+=0x1){_0x4bce9b=_0x32b612[_0xdc74d4][_0xf3fe('0x6b')]?_0x57dc20[_0x32b612[_0xdc74d4]['MetricId']][_0xf3fe('0x6c')]:_0x32b612[_0xdc74d4][_0xf3fe('0x62')];_0x4bce9b=_0x32b612[_0xdc74d4]['function']?_[_0xf3fe('0x6e')](_0x197102[_0x32b612[_0xdc74d4]['function']],'%s',_0x4bce9b):_0x4bce9b;_0x4bce9b=_0x32b612[_0xdc74d4][_0xf3fe('0x6f')]?_[_0xf3fe('0x6e')](_0x5f539c[_0x32b612[_0xdc74d4]['format']],'%s',_0x4bce9b):_0x4bce9b;if(_0x32b612[_0xdc74d4][_0xf3fe('0xa0')]){_0x4fa809[_0xf3fe('0x61')](_0x4bce9b);}_0x32b612[_0xdc74d4]['orderBy']&&_0x4fa809[_0xf3fe('0x3b')](_0x4bce9b,_0x32b612[_0xdc74d4][_0xf3fe('0x70')]===_0xf3fe('0x8a')?![]:!![]);_0x4fa809[_0xf3fe('0x62')](_0x4bce9b,_0x32b612[_0xdc74d4][_0xf3fe('0x71')]||_0x4bce9b);}if(_0x32dc75[_0xf3fe('0x72')]){_0x32dc75[_0xf3fe('0x72')]=JSON['parse'](_0x32dc75['joins']);for(var _0x5f0e0a=0x0;_0x5f0e0a<_0x32dc75[_0xf3fe('0x72')][_0xf3fe('0x38')];_0x5f0e0a+=0x1){if(_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a]['type']&&_['includes'](_0x15b699,_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a][_0xf3fe('0x2e')])&&_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a]['parentKey']&&_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a]['foreignTable']&&_0x32dc75['joins'][_0x5f0e0a][_0xf3fe('0x76')]){_0x4fa809[_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a][_0xf3fe('0x2e')]](_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a][_0xf3fe('0x75')],null,util[_0xf3fe('0x6f')]('%s.%s\x20=\x20%s.%s',_0x32dc75[_0xf3fe('0x6a')],_0x32dc75['joins'][_0x5f0e0a][_0xf3fe('0x74')],_0x32dc75[_0xf3fe('0x72')][_0x5f0e0a]['foreignTable'],_0x32dc75['joins'][_0x5f0e0a]['foreignKey']));}}}if(_0x32dc75[_0xf3fe('0x78')]){_0x32dc75[_0xf3fe('0x78')]=JSON[_0xf3fe('0x73')](_0x32dc75[_0xf3fe('0x78')]);_0x4fa809[_0xf3fe('0x3d')](_0x1e367a(_0x32dc75[_0xf3fe('0x78')][_0xf3fe('0x61')]));}_0x4aa929=_0x4fa809[_0xf3fe('0x79')]();_0x4fa809[_0xf3fe('0x1e')](_0x349007);_0x4fa809['offset'](0x0);logger[_0xf3fe('0x7a')]('Limited\x20Query:',_0x4fa809[_0xf3fe('0x7c')]());return dbH[_0xf3fe('0x7d')][_0xf3fe('0x32')](_0x4fa809[_0xf3fe('0x7c')](),{'type':dbH[_0xf3fe('0x7d')][_0xf3fe('0x7e')][_0xf3fe('0x7f')]});}})[_0xf3fe('0x28')](function(){return{'sql':_0x4aa929['toString']()};})['then'](respondWithResult(_0x52e129,null))[_0xf3fe('0x46')](handleError(_0x52e129,null));}; \ No newline at end of file +var _0x12b8=['includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%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','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','operator','Please\x20insert\x20at\x20least\x20one\x20field','select','metric','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','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','dbH','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','send','index','map','AnalyticCustomReport','fieldName','type','key','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','name','merge','options'];(function(_0x4906c8,_0x41119e){var _0x1a0b9d=function(_0x124f3e){while(--_0x124f3e){_0x4906c8['push'](_0x4906c8['shift']());}};_0x1a0b9d(++_0x41119e);}(_0x12b8,0x1b5));var _0x812b=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x12b8[_0x15fe68];return _0x1d144c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x812b('0x0'));var jsonpatch=require(_0x812b('0x1'));var rp=require(_0x812b('0x2'));var moment=require(_0x812b('0x3'));var BPromise=require(_0x812b('0x4'));var Mustache=require(_0x812b('0x5'));var util=require(_0x812b('0x6'));var path=require(_0x812b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x812b('0x8'));var fs=require('fs');var fs_extra=require(_0x812b('0x9'));var _=require(_0x812b('0xa'));var squel=require(_0x812b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x812b('0xc'));var querystring=require(_0x812b('0xd'));var Papa=require(_0x812b('0xe'));var Redis=require(_0x812b('0xf'));var authService=require(_0x812b('0x10'));var qs=require(_0x812b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x812b('0x12'));var logger=require(_0x812b('0x13'))(_0x812b('0x14'));var utils=require(_0x812b('0x15'));var config=require(_0x812b('0x16'));var licenseUtil=require(_0x812b('0x17'));var db=require(_0x812b('0x18'))['db'];var dbH=require(_0x812b('0x18'))[_0x812b('0x19')];function respondWithStatusCode(_0x4708d7,_0x3a893e){_0x3a893e=_0x3a893e||0xcc;return function(_0xc4d62){if(_0xc4d62){return _0x4708d7[_0x812b('0x1a')](_0x3a893e);}return _0x4708d7[_0x812b('0x1b')](_0x3a893e)[_0x812b('0x1c')]();};}function respondWithResult(_0x3d3eff,_0x18ba01){_0x18ba01=_0x18ba01||0xc8;return function(_0x592a83){if(_0x592a83){return _0x3d3eff[_0x812b('0x1b')](_0x18ba01)[_0x812b('0x1d')](_0x592a83);}};}function respondWithFilteredResult(_0x161f62,_0x3303b2){return function(_0xef9f3f){if(_0xef9f3f){var _0x13faf9=typeof _0x3303b2['offset']===_0x812b('0x1e')&&typeof _0x3303b2['limit']===_0x812b('0x1e');var _0x26d85f=_0xef9f3f[_0x812b('0x1f')];var _0x257aee=_0x13faf9?0x0:_0x3303b2[_0x812b('0x20')];var _0x2a042f=_0x13faf9?_0xef9f3f[_0x812b('0x1f')]:_0x3303b2[_0x812b('0x20')]+_0x3303b2[_0x812b('0x21')];var _0x2489b6;if(_0x2a042f>=_0x26d85f){_0x2a042f=_0x26d85f;_0x2489b6=0xc8;}else{_0x2489b6=0xce;}_0x161f62['status'](_0x2489b6);return _0x161f62[_0x812b('0x22')](_0x812b('0x23'),_0x257aee+'-'+_0x2a042f+'/'+_0x26d85f)[_0x812b('0x1d')](_0xef9f3f);}return null;};}function patchUpdates(_0x1f574f){return function(_0x1e1ffc){try{jsonpatch[_0x812b('0x24')](_0x1e1ffc,_0x1f574f,!![]);}catch(_0x45ee2d){return BPromise[_0x812b('0x25')](_0x45ee2d);}return _0x1e1ffc[_0x812b('0x26')]();};}function saveUpdates(_0xbb9bac,_0x39601b){return function(_0x586fe3){if(_0x586fe3){return _0x586fe3[_0x812b('0x27')](_0xbb9bac)[_0x812b('0x28')](function(_0x44edc5){return _0x44edc5;});}return null;};}function removeEntity(_0x3ad4a9,_0x5be22f){return function(_0x234178){if(_0x234178){return _0x234178[_0x812b('0x29')]()['then'](function(){var _0x4c3610=_0x234178[_0x812b('0x2a')]({'plain':!![]});var _0x417fed=_0x812b('0x2b');return db['UserProfileResource'][_0x812b('0x29')]({'where':{'type':_0x417fed,'resourceId':_0x4c3610['id']}})[_0x812b('0x28')](function(){return _0x234178;});})[_0x812b('0x28')](function(){_0x3ad4a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x354038,_0x160a37){return function(_0x1c9dea){if(!_0x1c9dea){_0x354038[_0x812b('0x1a')](0x194);}return _0x1c9dea;};}function handleError(_0x297b77,_0x171585){_0x171585=_0x171585||0x1f4;return function(_0x1fd2f2){logger[_0x812b('0x2c')](_0x1fd2f2[_0x812b('0x2d')]);if(_0x1fd2f2['name']){delete _0x1fd2f2['name'];}_0x297b77[_0x812b('0x1b')](_0x171585)[_0x812b('0x2e')](_0x1fd2f2);};}exports[_0x812b('0x2f')]=function(_0x31adce,_0xe359be){var _0x1690ce={},_0x16a0fd={},_0x156fef={'count':0x0,'rows':[]};var _0x42e44a=_[_0x812b('0x30')](db[_0x812b('0x31')]['rawAttributes'],function(_0x1b7194){return{'name':_0x1b7194[_0x812b('0x32')],'type':_0x1b7194[_0x812b('0x33')][_0x812b('0x34')]};});_0x16a0fd['model']=_[_0x812b('0x30')](_0x42e44a,'name');_0x16a0fd['query']=_[_0x812b('0x35')](_0x31adce['query']);_0x16a0fd['filters']=_[_0x812b('0x36')](_0x16a0fd[_0x812b('0x37')],_0x16a0fd[_0x812b('0x38')]);_0x1690ce['attributes']=_[_0x812b('0x36')](_0x16a0fd[_0x812b('0x37')],qs[_0x812b('0x39')](_0x31adce[_0x812b('0x38')][_0x812b('0x39')]));_0x1690ce[_0x812b('0x3a')]=_0x1690ce[_0x812b('0x3a')][_0x812b('0x3b')]?_0x1690ce[_0x812b('0x3a')]:_0x16a0fd[_0x812b('0x37')];if(!_0x31adce[_0x812b('0x38')][_0x812b('0x3c')](_0x812b('0x3d'))){_0x1690ce[_0x812b('0x21')]=qs['limit'](_0x31adce[_0x812b('0x38')][_0x812b('0x21')]);_0x1690ce['offset']=qs['offset'](_0x31adce[_0x812b('0x38')][_0x812b('0x20')]);}_0x1690ce[_0x812b('0x3e')]=qs[_0x812b('0x3f')](_0x31adce[_0x812b('0x38')]['sort']);_0x1690ce[_0x812b('0x40')]=qs[_0x812b('0x41')](_[_0x812b('0x42')](_0x31adce[_0x812b('0x38')],_0x16a0fd[_0x812b('0x41')]),_0x42e44a);if(_0x31adce[_0x812b('0x38')]['filter']){_0x1690ce[_0x812b('0x40')]=_['merge'](_0x1690ce[_0x812b('0x40')],{'$or':_[_0x812b('0x30')](_0x42e44a,function(_0x17a50a){if(_0x17a50a[_0x812b('0x33')]!=='VIRTUAL'){var _0x4debad={};_0x4debad[_0x17a50a[_0x812b('0x43')]]={'$like':'%'+_0x31adce[_0x812b('0x38')]['filter']+'%'};return _0x4debad;}})});}_0x1690ce=_[_0x812b('0x44')]({},_0x1690ce,_0x31adce[_0x812b('0x45')]);var _0x21723b={'where':_0x1690ce['where']};return db[_0x812b('0x31')][_0x812b('0x1f')](_0x21723b)[_0x812b('0x28')](function(_0x40c6fe){_0x156fef[_0x812b('0x1f')]=_0x40c6fe;if(_0x31adce['query'][_0x812b('0x46')]){_0x1690ce[_0x812b('0x47')]=[{'all':!![]}];}return db[_0x812b('0x31')][_0x812b('0x48')](_0x1690ce);})['then'](function(_0x20d429){_0x156fef['rows']=_0x20d429;return _0x156fef;})[_0x812b('0x28')](respondWithFilteredResult(_0xe359be,_0x1690ce))['catch'](handleError(_0xe359be,null));};exports['show']=function(_0x2713a0,_0x5b2cb2){var _0x482723={'raw':![],'where':{'id':_0x2713a0[_0x812b('0x49')]['id']}},_0x2087b5={};_0x2087b5[_0x812b('0x37')]=_[_0x812b('0x35')](db['AnalyticCustomReport'][_0x812b('0x4a')]);_0x2087b5[_0x812b('0x38')]=_[_0x812b('0x35')](_0x2713a0[_0x812b('0x38')]);_0x2087b5[_0x812b('0x41')]=_['intersection'](_0x2087b5[_0x812b('0x37')],_0x2087b5['query']);_0x482723[_0x812b('0x3a')]=_[_0x812b('0x36')](_0x2087b5[_0x812b('0x37')],qs[_0x812b('0x39')](_0x2713a0['query'][_0x812b('0x39')]));_0x482723[_0x812b('0x3a')]=_0x482723[_0x812b('0x3a')]['length']?_0x482723[_0x812b('0x3a')]:_0x2087b5[_0x812b('0x37')];if(_0x2713a0[_0x812b('0x38')]['includeAll']){_0x482723[_0x812b('0x47')]=[{'all':!![]}];}_0x482723=_['merge']({},_0x482723,_0x2713a0[_0x812b('0x45')]);return db['AnalyticCustomReport'][_0x812b('0x4b')](_0x482723)[_0x812b('0x28')](handleEntityNotFound(_0x5b2cb2,null))[_0x812b('0x28')](respondWithResult(_0x5b2cb2,null))[_0x812b('0x4c')](handleError(_0x5b2cb2,null));};exports[_0x812b('0x4d')]=function(_0x3bd80f,_0x12badf){return db[_0x812b('0x31')][_0x812b('0x4d')](_0x3bd80f[_0x812b('0x4e')],{})[_0x812b('0x28')](function(_0x5eae6f){var _0x2fce5b=_0x3bd80f[_0x812b('0x4f')]['get']({'plain':!![]});if(!_0x2fce5b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fce5b[_0x812b('0x50')]===_0x812b('0x4f')){var _0x36e362=_0x5eae6f[_0x812b('0x2a')]({'plain':!![]});var _0x59620b=_0x812b('0x51');return db[_0x812b('0x52')][_0x812b('0x4b')]({'where':{'name':_0x59620b,'userProfileId':_0x2fce5b[_0x812b('0x53')]},'raw':!![]})[_0x812b('0x28')](function(_0x40fd8b){if(_0x40fd8b&&_0x40fd8b[_0x812b('0x54')]===0x0){return db[_0x812b('0x55')][_0x812b('0x4d')]({'name':_0x36e362[_0x812b('0x43')],'resourceId':_0x36e362['id'],'type':_0x812b('0x2b'),'sectionId':_0x40fd8b['id']},{})['then'](function(){return _0x5eae6f;});}else{return _0x5eae6f;}})['catch'](function(_0x1097cb){logger[_0x812b('0x2c')](_0x812b('0x56'),_0x1097cb);throw _0x1097cb;});}return _0x5eae6f;})[_0x812b('0x28')](respondWithResult(_0x12badf,0xc9))[_0x812b('0x4c')](handleError(_0x12badf,null));};exports[_0x812b('0x27')]=function(_0xf7b6fe,_0x5ad721){if(_0xf7b6fe[_0x812b('0x4e')]['id']){delete _0xf7b6fe[_0x812b('0x4e')]['id'];}return db[_0x812b('0x31')]['find']({'where':{'id':_0xf7b6fe['params']['id']}})[_0x812b('0x28')](handleEntityNotFound(_0x5ad721,null))['then'](saveUpdates(_0xf7b6fe[_0x812b('0x4e')],null))[_0x812b('0x28')](respondWithResult(_0x5ad721,null))[_0x812b('0x4c')](handleError(_0x5ad721,null));};exports[_0x812b('0x29')]=function(_0x1c98ed,_0x244158){return db['AnalyticCustomReport'][_0x812b('0x4b')]({'where':{'id':_0x1c98ed[_0x812b('0x49')]['id']}})[_0x812b('0x28')](handleEntityNotFound(_0x244158,null))['then'](removeEntity(_0x244158,null))[_0x812b('0x4c')](handleError(_0x244158,null));};exports[_0x812b('0x57')]=function(_0x21fef8,_0x48b815){var _0x91f3d0=0xa;var _0x783dbd=[_0x812b('0x58'),_0x812b('0x59'),_0x812b('0x5a'),_0x812b('0x5b')];var _0x5ad34c={'SUM':_0x812b('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x812b('0x5d'),'MIN':_0x812b('0x5e'),'AVG':_0x812b('0x5f'),'GROUP_CONCAT':_0x812b('0x60'),'GROUP_CONCAT ASC':_0x812b('0x61'),'GROUP_CONCAT DESC':_0x812b('0x62')};var _0x2a2f72={'SEC_TO_TIME':_0x812b('0x63'),'DATE':_0x812b('0x64'),'HOUR':_0x812b('0x65'),'ROUND':_0x812b('0x66'),'UNIX_TIMESTAMP':_0x812b('0x67')};var _0x25702b=function(_0x40b81b){return!_[_0x812b('0x68')]([_0x812b('0x69'),_0x812b('0x6a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x40b81b);};var _0x177e66=function(_0x30eac3){if(!_0x30eac3||!_0x30eac3[_0x812b('0x6b')]['length']){return'';}for(var _0x527cc1='(',_0x5bdbb9=0x0;_0x5bdbb9<_0x30eac3[_0x812b('0x6b')][_0x812b('0x3b')];_0x5bdbb9+=0x1){_0x5bdbb9>0x0&&(_0x527cc1+='\x20'+_0x30eac3['operator']+'\x20');_0x527cc1+=_0x30eac3[_0x812b('0x6b')][_0x5bdbb9]['group']?_0x177e66(_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6c')]):_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6d')]+'\x20'+_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6e')]+(_0x25702b(_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6e')])?'\x20'+_0x30eac3[_0x812b('0x6b')][_0x5bdbb9][_0x812b('0x6f')]:'');}return _0x527cc1+')';};var _0x478a10={'where':{'id':_0x21fef8['params']['id']}},_0x45da53,_0x4d6b9a,_0x355059,_0x50bf86,_0x1c3603;_0x478a10=_[_0x812b('0x44')]({},_0x478a10,_0x21fef8[_0x812b('0x45')]);return db['AnalyticCustomReport'][_0x812b('0x4b')](_0x478a10)[_0x812b('0x28')](function(_0x50ab03){if(_0x50ab03){_0x45da53=_0x50ab03;return _0x50ab03[_0x812b('0x70')]();}return null;})[_0x812b('0x28')](function(_0x1e86cd){if(_0x1e86cd){if(!_0x1e86cd['length']){throw new db[(_0x812b('0x71'))][(_0x812b('0x72'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4d6b9a=_0x1e86cd;return db[_0x812b('0x73')][_0x812b('0x48')]({'raw':!![]});}return null;})[_0x812b('0x28')](function(_0x14219a){if(_0x14219a){_0x355059=_[_0x812b('0x74')](_0x14219a,'id');var _0x2db249;var _0xc83017=squel['select']();_0xc83017[_0x812b('0x75')](_0x45da53[_0x812b('0x76')]);for(var _0x27dc79=0x0;_0x27dc79<_0x4d6b9a[_0x812b('0x3b')];_0x27dc79+=0x1){_0x2db249=_0x4d6b9a[_0x27dc79][_0x812b('0x77')]?_0x355059[_0x4d6b9a[_0x27dc79][_0x812b('0x77')]]['metric']:_0x4d6b9a[_0x27dc79][_0x812b('0x6d')];_0x2db249=_0x4d6b9a[_0x27dc79][_0x812b('0x78')]?_[_0x812b('0x79')](_0x5ad34c[_0x4d6b9a[_0x27dc79][_0x812b('0x78')]],'%s',_0x2db249):_0x2db249;_0x2db249=_0x4d6b9a[_0x27dc79][_0x812b('0x7a')]?_['replace'](_0x2a2f72[_0x4d6b9a[_0x27dc79][_0x812b('0x7a')]],'%s',_0x2db249):_0x2db249;if(_0x4d6b9a[_0x27dc79][_0x812b('0x7b')]){_0xc83017[_0x812b('0x6c')](_0x2db249);}_0x4d6b9a[_0x27dc79][_0x812b('0x7c')]&&_0xc83017[_0x812b('0x3e')](_0x2db249,_0x4d6b9a[_0x27dc79][_0x812b('0x7c')]===_0x812b('0x7d')?![]:!![]);_0xc83017[_0x812b('0x6d')](_0x2db249,_0x4d6b9a[_0x27dc79][_0x812b('0x7e')]||_0x2db249);}if(_0x45da53['joins']){_0x45da53[_0x812b('0x7f')]=JSON['parse'](_0x45da53['joins']);for(var _0x1ae25b=0x0;_0x1ae25b<_0x45da53[_0x812b('0x7f')][_0x812b('0x3b')];_0x1ae25b+=0x1){if(_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x33')]&&_[_0x812b('0x68')](_0x783dbd,_0x45da53['joins'][_0x1ae25b][_0x812b('0x33')])&&_0x45da53[_0x812b('0x7f')][_0x1ae25b]['parentKey']&&_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x80')]&&_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x81')]){_0xc83017[_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x33')]](_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x80')],null,util[_0x812b('0x7a')](_0x812b('0x82'),_0x45da53[_0x812b('0x76')],_0x45da53['joins'][_0x1ae25b][_0x812b('0x83')],_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x80')],_0x45da53[_0x812b('0x7f')][_0x1ae25b][_0x812b('0x81')]));}}}if(_0x45da53[_0x812b('0x84')]){_0x45da53[_0x812b('0x84')]=JSON[_0x812b('0x85')](_0x45da53['conditions']);_0xc83017[_0x812b('0x40')](_0x177e66(_0x45da53[_0x812b('0x84')][_0x812b('0x6c')]));}_0x1c3603=_0xc83017[_0x812b('0x86')]();_0xc83017[_0x812b('0x21')](_0x91f3d0);_0xc83017['offset'](0x0);logger[_0x812b('0x87')](_0x812b('0x88'),_0xc83017[_0x812b('0x89')]());return dbH['sequelize']['query'](_0xc83017[_0x812b('0x89')](),{'type':dbH[_0x812b('0x8a')][_0x812b('0x8b')][_0x812b('0x8c')]});}})['then'](respondWithResult(_0x48b815,null))[_0x812b('0x4c')](handleError(_0x48b815,null));};function runReport(_0x5b4566,_0x50147b,_0x40aab8){var _0xa92f01=_0x50147b['name'];var _0x486085=0xa;var _0x283f2b=[_0x812b('0x58'),_0x812b('0x59'),'right_join',_0x812b('0x5b')];var _0x2c1ed6={'SUM':_0x812b('0x5c'),'COUNT':_0x812b('0x8d'),'COUNT DISTINCT':_0x812b('0x8e'),'MAX':_0x812b('0x5d'),'MIN':_0x812b('0x5e'),'AVG':_0x812b('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x812b('0x62')};var _0x4423ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x812b('0x64'),'HOUR':_0x812b('0x65'),'ROUND':_0x812b('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27bc53=function(_0x21538d){return!_[_0x812b('0x68')]([_0x812b('0x69'),_0x812b('0x6a'),'IS\x20EMPTY',_0x812b('0x8f')],_0x21538d);};var _0x5a08f1=function(_0xadf92d){if(!_0xadf92d||!_0xadf92d[_0x812b('0x6b')][_0x812b('0x3b')]){return'';}for(var _0x5d82d0='(',_0x5f4809=0x0;_0x5f4809<_0xadf92d[_0x812b('0x6b')][_0x812b('0x3b')];_0x5f4809+=0x1){_0x5f4809>0x0&&(_0x5d82d0+='\x20'+_0xadf92d[_0x812b('0x90')]+'\x20');_0x5d82d0+=_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6c')]?_0x5a08f1(_0xadf92d[_0x812b('0x6b')][_0x5f4809]['group']):_0xadf92d['rules'][_0x5f4809]['field']+'\x20'+_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6e')]+(_0x27bc53(_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6e')])?'\x20'+_0xadf92d[_0x812b('0x6b')][_0x5f4809][_0x812b('0x6f')]:'');}return _0x5d82d0+')';};var _0x463d2f={'where':{'id':_0x5b4566['id']}},_0x11c862,_0xea9a7c,_0x34b880,_0x3b5a60,_0x1ce63d;_0x463d2f=_[_0x812b('0x44')]({},_0x463d2f,_0x40aab8);return db['AnalyticCustomReport'][_0x812b('0x4b')](_0x463d2f)[_0x812b('0x28')](function(_0x590f5f){if(_0x590f5f){_0x11c862=_0x590f5f;return _0x590f5f['getFields']();}return null;})[_0x812b('0x28')](function(_0x43c90c){if(_0x43c90c){if(!_0x43c90c[_0x812b('0x3b')]){throw new db[(_0x812b('0x71'))]['ValidationErrorItem'](_0x812b('0x91'),0x193);}_0xea9a7c=_0x43c90c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0xd53787){if(_0xd53787){_0x34b880=_[_0x812b('0x74')](_0xd53787,'id');var _0x23ebd7;var _0x5ebdbc=squel[_0x812b('0x92')]();_0x5ebdbc[_0x812b('0x75')](_0x11c862[_0x812b('0x76')]);for(var _0x44da79=0x0;_0x44da79<_0xea9a7c[_0x812b('0x3b')];_0x44da79+=0x1){_0x23ebd7=_0xea9a7c[_0x44da79]['MetricId']?_0x34b880[_0xea9a7c[_0x44da79]['MetricId']][_0x812b('0x93')]:_0xea9a7c[_0x44da79]['field'];_0x23ebd7=_0xea9a7c[_0x44da79][_0x812b('0x78')]?_[_0x812b('0x79')](_0x2c1ed6[_0xea9a7c[_0x44da79][_0x812b('0x78')]],'%s',_0x23ebd7):_0x23ebd7;_0x23ebd7=_0xea9a7c[_0x44da79][_0x812b('0x7a')]?_[_0x812b('0x79')](_0x4423ed[_0xea9a7c[_0x44da79][_0x812b('0x7a')]],'%s',_0x23ebd7):_0x23ebd7;if(_0xea9a7c[_0x44da79][_0x812b('0x7b')]){_0x5ebdbc['group'](_0x23ebd7);}_0xea9a7c[_0x44da79][_0x812b('0x7c')]&&_0x5ebdbc['order'](_0x23ebd7,_0xea9a7c[_0x44da79][_0x812b('0x7c')]==='DESC'?![]:!![]);_0x5ebdbc['field'](_0x23ebd7,_0xea9a7c[_0x44da79]['alias']||_0x23ebd7);}if(_0x11c862['joins']){_0x11c862[_0x812b('0x7f')]=JSON[_0x812b('0x85')](_0x11c862[_0x812b('0x7f')]);for(var _0xcbac4d=0x0;_0xcbac4d<_0x11c862['joins'][_0x812b('0x3b')];_0xcbac4d+=0x1){if(_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x33')]&&_[_0x812b('0x68')](_0x283f2b,_0x11c862['joins'][_0xcbac4d][_0x812b('0x33')])&&_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x83')]&&_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x80')]&&_0x11c862['joins'][_0xcbac4d][_0x812b('0x81')]){_0x5ebdbc[_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x33')]](_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x80')],null,util[_0x812b('0x7a')]('%s.%s\x20=\x20%s.%s',_0x11c862[_0x812b('0x76')],_0x11c862[_0x812b('0x7f')][_0xcbac4d][_0x812b('0x83')],_0x11c862['joins'][_0xcbac4d][_0x812b('0x80')],_0x11c862[_0x812b('0x7f')][_0xcbac4d]['foreignKey']));}}}if(_0x11c862[_0x812b('0x84')]){_0x11c862[_0x812b('0x84')]=JSON[_0x812b('0x85')](_0x11c862[_0x812b('0x84')]);_0x5ebdbc[_0x812b('0x40')](_0x5a08f1(_0x11c862[_0x812b('0x84')][_0x812b('0x6c')]));}_0x1ce63d=_0x5ebdbc['clone']();_0x5ebdbc[_0x812b('0x21')](_0x486085);_0x5ebdbc[_0x812b('0x20')](0x0);return;}})[_0x812b('0x28')](function(){if(_0x50147b[_0x812b('0x94')]===_0x812b('0x95')){return null;}var _0x4cae2a=_['merge'](_0x50147b,{'name':_0x50147b[_0x812b('0x96')]||_0x50147b[_0x812b('0x43')]||_0x11c862['name'],'basename':_0xa92f01,'savename':util[_0x812b('0x7a')](_0x812b('0x97'),_0x50147b[_0x812b('0x43')]||_0x11c862['name'],require('randomstring')[_0x812b('0x98')](0x4),_0x50147b[_0x812b('0x94')]||_0x812b('0x99')),'reportId':_0x11c862['id'],'reportType':_0x812b('0x9a')});return db[_0x812b('0x9b')][_0x812b('0x4d')](_0x4cae2a,{'raw':!![]});})[_0x812b('0x28')](function(_0x4e897e){if(_0x11c862[_0x812b('0x76')]===_0x812b('0x9c')){_0x1ce63d['where'](_0x11c862[_0x812b('0x76')]+_0x812b('0x9d'),_0x50147b['startDate'],_0x50147b['endDate']);}else{_0x1ce63d[_0x812b('0x40')](_0x11c862[_0x812b('0x76')]+_0x812b('0x9e'),_0x50147b[_0x812b('0x9f')],_0x50147b[_0x812b('0xa0')]);}if(_0x4e897e){logger[_0x812b('0xa1')]('Run\x20Query:',_0x1ce63d[_0x812b('0x89')]());require(_0x812b('0xa2'))['fork'](path[_0x812b('0x58')](__dirname,_0x812b('0xa3'),_0x4e897e[_0x812b('0x94')]),[_0x4e897e['id'],_0x1ce63d[_0x812b('0x89')](),path[_0x812b('0x58')](__dirname,'../../files/reports',_0x4e897e[_0x812b('0xa4')]),_0xa92f01]);return _0x4e897e;}else{var _0x217bcf=squel['select']();_0x217bcf[_0x812b('0x75')]('('+_0x1ce63d[_0x812b('0x89')]()+')',_0x812b('0xa5'));_0x217bcf[_0x812b('0x6d')](_0x812b('0xa6'),'count');_0x1ce63d[_0x812b('0x21')](_0x50147b[_0x812b('0x21')]||_0x486085);_0x1ce63d[_0x812b('0x20')](_0x50147b[_0x812b('0x20')]||0x0);return dbH[_0x812b('0x8a')]['query'](_0x217bcf[_0x812b('0x89')](),{'type':dbH['sequelize']['QueryTypes'][_0x812b('0x8c')]})[_0x812b('0x28')](function(_0x1408d2){if(!_0x1408d2[_0x812b('0x3b')]){_0x3b5a60=0x0;}else{_0x3b5a60=_0x1408d2[0x0]['count']||0x0;}return dbH[_0x812b('0x8a')]['query'](_0x1ce63d[_0x812b('0x89')](),{'type':dbH[_0x812b('0x8a')]['QueryTypes']['SELECT']});})['then'](function(_0xc5bad5){return{'rows':_0xc5bad5||[],'count':_0x3b5a60};});}});}exports[_0x812b('0xa7')]=function(_0x2d02d9,_0x51e3b3){return runReport(_0x2d02d9[_0x812b('0x49')],_0x2d02d9['query'],_0x2d02d9[_0x812b('0x45')])['then'](respondWithResult(_0x51e3b3,null))[_0x812b('0x4c')](handleError(_0x51e3b3,null));};exports[_0x812b('0xa8')]=runReport;exports[_0x812b('0x38')]=function(_0x39f1d9,_0x49bd36){var _0xd7ea2b=0xa;var _0x5a35b9=[_0x812b('0x58'),_0x812b('0x59'),'right_join',_0x812b('0x5b')];var _0x246607={'SUM':_0x812b('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x812b('0x8e'),'MAX':_0x812b('0x5d'),'MIN':_0x812b('0x5e'),'AVG':_0x812b('0x5f'),'GROUP_CONCAT':_0x812b('0x60'),'GROUP_CONCAT ASC':_0x812b('0x61'),'GROUP_CONCAT DESC':_0x812b('0x62')};var _0x22499c={'SEC_TO_TIME':_0x812b('0x63'),'DATE':_0x812b('0x64'),'HOUR':_0x812b('0x65'),'ROUND':_0x812b('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10e3ee=function(_0xd615d1){return!_[_0x812b('0x68')]([_0x812b('0x69'),_0x812b('0x6a'),'IS\x20EMPTY',_0x812b('0x8f')],_0xd615d1);};var _0x5a14a=function(_0x3d9395){if(!_0x3d9395||!_0x3d9395[_0x812b('0x6b')][_0x812b('0x3b')]){return'';}for(var _0x46344e='(',_0x344ccd=0x0;_0x344ccd<_0x3d9395[_0x812b('0x6b')]['length'];_0x344ccd+=0x1){_0x344ccd>0x0&&(_0x46344e+='\x20'+_0x3d9395[_0x812b('0x90')]+'\x20');_0x46344e+=_0x3d9395[_0x812b('0x6b')][_0x344ccd][_0x812b('0x6c')]?_0x5a14a(_0x3d9395['rules'][_0x344ccd][_0x812b('0x6c')]):_0x3d9395[_0x812b('0x6b')][_0x344ccd]['field']+'\x20'+_0x3d9395[_0x812b('0x6b')][_0x344ccd][_0x812b('0x6e')]+(_0x10e3ee(_0x3d9395[_0x812b('0x6b')][_0x344ccd][_0x812b('0x6e')])?'\x20'+_0x3d9395['rules'][_0x344ccd]['value']:'');}return _0x46344e+')';};var _0x3a4716={'where':{'id':_0x39f1d9[_0x812b('0x49')]['id']}},_0xa33dc4,_0x38f83e,_0x40d578,_0x40e680,_0x19f3e5;_0x3a4716=_[_0x812b('0x44')]({},_0x3a4716,_0x39f1d9['options']);return db[_0x812b('0x31')][_0x812b('0x4b')](_0x3a4716)['then'](function(_0x4f66ad){if(_0x4f66ad){_0xa33dc4=_0x4f66ad;return _0x4f66ad[_0x812b('0x70')]();}return null;})[_0x812b('0x28')](function(_0x264210){if(_0x264210){if(!_0x264210[_0x812b('0x3b')]){throw new db[(_0x812b('0x71'))][(_0x812b('0x72'))](_0x812b('0x91'),0x193);}_0x38f83e=_0x264210;return db[_0x812b('0x73')][_0x812b('0x48')]({'raw':!![]});}return null;})[_0x812b('0x28')](function(_0xd4b59){if(_0xd4b59){_0x40d578=_[_0x812b('0x74')](_0xd4b59,'id');var _0x4d4aff;var _0xbc476f=squel[_0x812b('0x92')]();_0xbc476f[_0x812b('0x75')](_0xa33dc4['table']);for(var _0xd2c36d=0x0;_0xd2c36d<_0x38f83e[_0x812b('0x3b')];_0xd2c36d+=0x1){_0x4d4aff=_0x38f83e[_0xd2c36d][_0x812b('0x77')]?_0x40d578[_0x38f83e[_0xd2c36d]['MetricId']][_0x812b('0x93')]:_0x38f83e[_0xd2c36d]['field'];_0x4d4aff=_0x38f83e[_0xd2c36d][_0x812b('0x78')]?_[_0x812b('0x79')](_0x246607[_0x38f83e[_0xd2c36d][_0x812b('0x78')]],'%s',_0x4d4aff):_0x4d4aff;_0x4d4aff=_0x38f83e[_0xd2c36d][_0x812b('0x7a')]?_['replace'](_0x22499c[_0x38f83e[_0xd2c36d]['format']],'%s',_0x4d4aff):_0x4d4aff;if(_0x38f83e[_0xd2c36d][_0x812b('0x7b')]){_0xbc476f[_0x812b('0x6c')](_0x4d4aff);}_0x38f83e[_0xd2c36d]['orderBy']&&_0xbc476f['order'](_0x4d4aff,_0x38f83e[_0xd2c36d][_0x812b('0x7c')]===_0x812b('0x7d')?![]:!![]);_0xbc476f['field'](_0x4d4aff,_0x38f83e[_0xd2c36d][_0x812b('0x7e')]||_0x4d4aff);}if(_0xa33dc4[_0x812b('0x7f')]){_0xa33dc4[_0x812b('0x7f')]=JSON[_0x812b('0x85')](_0xa33dc4[_0x812b('0x7f')]);for(var _0xa73c82=0x0;_0xa73c82<_0xa33dc4[_0x812b('0x7f')][_0x812b('0x3b')];_0xa73c82+=0x1){if(_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x33')]&&_['includes'](_0x5a35b9,_0xa33dc4['joins'][_0xa73c82][_0x812b('0x33')])&&_0xa33dc4[_0x812b('0x7f')][_0xa73c82]['parentKey']&&_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x80')]&&_0xa33dc4['joins'][_0xa73c82][_0x812b('0x81')]){_0xbc476f[_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x33')]](_0xa33dc4[_0x812b('0x7f')][_0xa73c82]['foreignTable'],null,util[_0x812b('0x7a')](_0x812b('0x82'),_0xa33dc4[_0x812b('0x76')],_0xa33dc4['joins'][_0xa73c82][_0x812b('0x83')],_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x80')],_0xa33dc4[_0x812b('0x7f')][_0xa73c82][_0x812b('0x81')]));}}}if(_0xa33dc4['conditions']){_0xa33dc4['conditions']=JSON[_0x812b('0x85')](_0xa33dc4[_0x812b('0x84')]);_0xbc476f[_0x812b('0x40')](_0x5a14a(_0xa33dc4[_0x812b('0x84')][_0x812b('0x6c')]));}_0x19f3e5=_0xbc476f['clone']();_0xbc476f[_0x812b('0x21')](_0xd7ea2b);_0xbc476f[_0x812b('0x20')](0x0);logger['debug'](_0x812b('0x88'),_0xbc476f['toString']());return dbH[_0x812b('0x8a')][_0x812b('0x38')](_0xbc476f[_0x812b('0x89')](),{'type':dbH[_0x812b('0x8a')][_0x812b('0x8b')][_0x812b('0x8c')]});}})[_0x812b('0x28')](function(){return{'sql':_0x19f3e5['toString']()};})['then'](respondWithResult(_0x49bd36,null))['catch'](handleError(_0x49bd36,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 1e68dd8..a388af1 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 _0x9a7f=['AnalyticCustomReport','analytics_custom_reports','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x49045f,_0x27b647){var _0x223d1e=function(_0x2debea){while(--_0x2debea){_0x49045f['push'](_0x49045f['shift']());}};_0x223d1e(++_0x27b647);}(_0x9a7f,0x6e));var _0xf9a7=function(_0x319aa4,_0x1184ef){_0x319aa4=_0x319aa4-0x0;var _0x505846=_0x9a7f[_0x319aa4];return _0x505846;};'use strict';var _=require('lodash');var util=require(_0xf9a7('0x0'));var logger=require('../../config/logger')(_0xf9a7('0x1'));var moment=require(_0xf9a7('0x2'));var BPromise=require(_0xf9a7('0x3'));var rp=require(_0xf9a7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9a7('0x5'));var config=require(_0xf9a7('0x6'));var attributes=require(_0xf9a7('0x7'));module[_0xf9a7('0x8')]=function(_0x1a3c0e,_0x4d20ee){return _0x1a3c0e[_0xf9a7('0x9')](_0xf9a7('0xa'),attributes,{'tableName':_0xf9a7('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1be8=['../../config/logger','moment','rimraf','exports','define','AnalyticCustomReport','lodash','util'];(function(_0x2cd26d,_0x1b6142){var _0x113d9d=function(_0x44172d){while(--_0x44172d){_0x2cd26d['push'](_0x2cd26d['shift']());}};_0x113d9d(++_0x1b6142);}(_0x1be8,0x196));var _0x81be=function(_0x5bf7bd,_0x52d967){_0x5bf7bd=_0x5bf7bd-0x0;var _0x4d3227=_0x1be8[_0x5bf7bd];return _0x4d3227;};'use strict';var _=require(_0x81be('0x0'));var util=require(_0x81be('0x1'));var logger=require(_0x81be('0x2'))('api');var moment=require(_0x81be('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81be('0x4'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x81be('0x5')]=function(_0x35579c,_0x218929){return _0x35579c[_0x81be('0x6')](_0x81be('0x7'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index b5062b8..5d47e0c 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 _0xf942=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3a2f2c,_0x361e0d){var _0x5ae7a8=function(_0x34f70d){while(--_0x34f70d){_0x3a2f2c['push'](_0x3a2f2c['shift']());}};_0x5ae7a8(++_0x361e0d);}(_0xf942,0x10b));var _0x2f94=function(_0x42a78a,_0xa1a2ef){_0x42a78a=_0x42a78a-0x0;var _0x1fb3e8=_0xf942[_0x42a78a];return _0x1fb3e8;};'use strict';var _=require('lodash');var util=require(_0x2f94('0x0'));var moment=require(_0x2f94('0x1'));var BPromise=require(_0x2f94('0x2'));var rs=require(_0x2f94('0x3'));var fs=require('fs');var Redis=require(_0x2f94('0x4'));var db=require(_0x2f94('0x5'))['db'];var utils=require(_0x2f94('0x6'));var logger=require(_0x2f94('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2f94('0x8'));var client=jayson[_0x2f94('0x9')][_0x2f94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x704f1a,_0x1088f0,_0x9bdeaa){return new BPromise(function(_0x4fe476,_0x3ec1db){return client[_0x2f94('0xb')](_0x704f1a,_0x9bdeaa)[_0x2f94('0xc')](function(_0x1df23b){logger[_0x2f94('0xd')](_0x2f94('0xe'),_0x1088f0,'request\x20sent');logger[_0x2f94('0xf')](_0x2f94('0x10'),_0x1088f0,_0x2f94('0x11'),JSON[_0x2f94('0x12')](_0x1df23b));if(_0x1df23b['error']){if(_0x1df23b[_0x2f94('0x13')][_0x2f94('0x14')]===0x1f4){logger[_0x2f94('0x13')](_0x2f94('0xe'),_0x1088f0,_0x1df23b[_0x2f94('0x13')][_0x2f94('0x15')]);return _0x3ec1db(_0x1df23b[_0x2f94('0x13')][_0x2f94('0x15')]);}logger[_0x2f94('0x13')](_0x2f94('0xe'),_0x1088f0,_0x1df23b['error'][_0x2f94('0x15')]);return _0x4fe476(_0x1df23b[_0x2f94('0x13')][_0x2f94('0x15')]);}else{logger[_0x2f94('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1088f0,_0x2f94('0x11'));_0x4fe476(_0x1df23b[_0x2f94('0x16')][_0x2f94('0x15')]);}})[_0x2f94('0x17')](function(_0x47f3e5){logger[_0x2f94('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1088f0,_0x47f3e5);_0x3ec1db(_0x47f3e5);});});} \ No newline at end of file +var _0xda73=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x12ccce,_0x17661b){var _0x53cb19=function(_0x53daf4){while(--_0x53daf4){_0x12ccce['push'](_0x12ccce['shift']());}};_0x53cb19(++_0x17661b);}(_0xda73,0xb5));var _0x3da7=function(_0x57d24d,_0x1e2554){_0x57d24d=_0x57d24d-0x0;var _0xacd5eb=_0xda73[_0x57d24d];return _0xacd5eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3da7('0x0'));var BPromise=require(_0x3da7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3da7('0x2'));var db=require(_0x3da7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3da7('0x4'));var client=jayson[_0x3da7('0x5')][_0x3da7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x538939,_0x2e58ef,_0x1815a4){return new BPromise(function(_0x10064d,_0x62e806){return client['request'](_0x538939,_0x1815a4)[_0x3da7('0x7')](function(_0x3ff85e){logger['info'](_0x3da7('0x8'),_0x2e58ef,_0x3da7('0x9'));logger[_0x3da7('0xa')](_0x3da7('0xb'),_0x2e58ef,_0x3da7('0x9'),JSON[_0x3da7('0xc')](_0x3ff85e));if(_0x3ff85e[_0x3da7('0xd')]){if(_0x3ff85e['error'][_0x3da7('0xe')]===0x1f4){logger['error'](_0x3da7('0x8'),_0x2e58ef,_0x3ff85e[_0x3da7('0xd')]['message']);return _0x62e806(_0x3ff85e[_0x3da7('0xd')][_0x3da7('0xf')]);}logger[_0x3da7('0xd')](_0x3da7('0x8'),_0x2e58ef,_0x3ff85e[_0x3da7('0xd')][_0x3da7('0xf')]);return _0x10064d(_0x3ff85e['error'][_0x3da7('0xf')]);}else{logger[_0x3da7('0x10')](_0x3da7('0x8'),_0x2e58ef,_0x3da7('0x9'));_0x10064d(_0x3ff85e[_0x3da7('0x11')][_0x3da7('0xf')]);}})[_0x3da7('0x12')](function(_0x55f209){logger[_0x3da7('0xd')](_0x3da7('0x8'),_0x2e58ef,_0x55f209);_0x62e806(_0x55f209);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2f864ff..7750a3a 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 _0x306b=['preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x306b,0x19f));var _0xb306=function(_0x1ce7d8,_0x1b1c3b){_0x1ce7d8=_0x1ce7d8-0x0;var _0x36ecea=_0x306b[_0x1ce7d8];return _0x36ecea;};'use strict';var multer=require(_0xb306('0x0'));var util=require(_0xb306('0x1'));var path=require(_0xb306('0x2'));var timeout=require(_0xb306('0x3'));var express=require(_0xb306('0x4'));var router=express[_0xb306('0x5')]();var fs_extra=require(_0xb306('0x6'));var auth=require(_0xb306('0x7'));var interaction=require(_0xb306('0x8'));var config=require(_0xb306('0x9'));var controller=require(_0xb306('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xb306('0xb')]);router[_0xb306('0xc')](_0xb306('0xd'),auth[_0xb306('0xe')](),controller[_0xb306('0xf')]);router[_0xb306('0xc')](_0xb306('0x10'),auth['isAuthenticated'](),controller[_0xb306('0x11')]);router[_0xb306('0xc')](_0xb306('0x12'),auth[_0xb306('0xe')](),controller[_0xb306('0x13')]);router[_0xb306('0xc')](_0xb306('0x14'),auth[_0xb306('0xe')](),controller['query']);router[_0xb306('0x15')]('/',auth[_0xb306('0xe')](),controller[_0xb306('0x16')]);router[_0xb306('0x17')](_0xb306('0xd'),auth[_0xb306('0xe')](),controller[_0xb306('0x18')]);router[_0xb306('0x19')](_0xb306('0xd'),auth[_0xb306('0xe')](),controller[_0xb306('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x2d6a=['run','/:id/query','post','create','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x227b69,_0x4c56d6){var _0x5a3595=function(_0x625eb3){while(--_0x625eb3){_0x227b69['push'](_0x227b69['shift']());}};_0x5a3595(++_0x4c56d6);}(_0x2d6a,0xa8));var _0xa2d6=function(_0x322532,_0xd88c57){_0x322532=_0x322532-0x0;var _0x57c8b9=_0x2d6a[_0x322532];return _0x57c8b9;};'use strict';var multer=require('multer');var util=require(_0xa2d6('0x0'));var path=require(_0xa2d6('0x1'));var timeout=require(_0xa2d6('0x2'));var express=require(_0xa2d6('0x3'));var router=express['Router']();var fs_extra=require(_0xa2d6('0x4'));var auth=require(_0xa2d6('0x5'));var interaction=require(_0xa2d6('0x6'));var config=require('../../config/environment');var controller=require(_0xa2d6('0x7'));router[_0xa2d6('0x8')]('/',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0xa')]);router[_0xa2d6('0x8')](_0xa2d6('0xb'),auth[_0xa2d6('0x9')](),controller[_0xa2d6('0xc')]);router[_0xa2d6('0x8')](_0xa2d6('0xd'),auth[_0xa2d6('0x9')](),controller[_0xa2d6('0xe')]);router['get'](_0xa2d6('0xf'),auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x10')]);router[_0xa2d6('0x8')](_0xa2d6('0x11'),auth[_0xa2d6('0x9')](),controller['query']);router[_0xa2d6('0x12')]('/',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x13')]);router[_0xa2d6('0x14')]('/:id',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x15')]);router['delete']('/:id',auth[_0xa2d6('0x9')](),controller[_0xa2d6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 9018ad2..0eafec0 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x214536,_0x4ec040){var _0x71d243=function(_0x533ef0){while(--_0x533ef0){_0x214536['push'](_0x214536['shift']());}};_0x71d243(++_0x4ec040);}(_0xeff8,0x186));var _0x8eff=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xeff8[_0x55821d];return _0x58ea8a;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file +var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x4669b9,_0xae07ab){var _0x31cf78=function(_0x5cabb1){while(--_0x5cabb1){_0x4669b9['push'](_0x4669b9['shift']());}};_0x31cf78(++_0xae07ab);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2e06d1,_0x408878){_0x2e06d1=_0x2e06d1-0x0;var _0x36e3e9=_0xd8fb[_0x2e06d1];return _0x36e3e9;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 970f2e7..87fac6c 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba34,0x119));var _0x4ba3=function(_0x3576c7,_0x8b9c82){_0x3576c7=_0x3576c7-0x0;var _0x364245=_0xba34[_0x3576c7];return _0x364245;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file +var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x427006,_0x5889d9){var _0x49b183=function(_0x5526b9){while(--_0x5526b9){_0x427006['push'](_0x427006['shift']());}};_0x49b183(++_0x5889d9);}(_0x1261,0x144));var _0x1126=function(_0x75e866,_0x30b4de){_0x75e866=_0x75e866-0x0;var _0x5e4b64=_0x1261[_0x75e866];return _0x5e4b64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4fd8306..4c806f6 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 _0x0834=['api','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x2e6be7,_0x4d70d3){var _0xb8ef72=function(_0x29abd1){while(--_0x29abd1){_0x2e6be7['push'](_0x2e6be7['shift']());}};_0xb8ef72(++_0x4d70d3);}(_0x0834,0x1b6));var _0x4083=function(_0x4cbad5,_0x4772d2){_0x4cbad5=_0x4cbad5-0x0;var _0x51ffe1=_0x0834[_0x4cbad5];return _0x51ffe1;};'use strict';var _=require(_0x4083('0x0'));var util=require(_0x4083('0x1'));var logger=require('../../config/logger')(_0x4083('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4083('0x3'));var fs=require('fs');var path=require(_0x4083('0x4'));var rimraf=require(_0x4083('0x5'));var config=require(_0x4083('0x6'));var attributes=require(_0x4083('0x7'));module[_0x4083('0x8')]=function(_0x16f362,_0xd60356){return _0x16f362['define'](_0x4083('0x9'),attributes,{'tableName':_0x4083('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecbf=['request-promise','path','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x24cf2e,_0x141f1d){var _0xb81932=function(_0x10fa0e){while(--_0x10fa0e){_0x24cf2e['push'](_0x24cf2e['shift']());}};_0xb81932(++_0x141f1d);}(_0xecbf,0xa3));var _0xfecb=function(_0x47bea2,_0x5e25db){_0x47bea2=_0x47bea2-0x0;var _0x7e1b08=_0xecbf[_0x47bea2];return _0x7e1b08;};'use strict';var _=require(_0xfecb('0x0'));var util=require('util');var logger=require(_0xfecb('0x1'))(_0xfecb('0x2'));var moment=require(_0xfecb('0x3'));var BPromise=require(_0xfecb('0x4'));var rp=require(_0xfecb('0x5'));var fs=require('fs');var path=require(_0xfecb('0x6'));var rimraf=require('rimraf');var config=require(_0xfecb('0x7'));var attributes=require(_0xfecb('0x8'));module['exports']=function(_0x468755,_0x2bdcaf){return _0x468755[_0xfecb('0x9')](_0xfecb('0xa'),attributes,{'tableName':_0xfecb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 4e2cf4f..c5228a5 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 _0xd510=['result','catch','lodash','moment','randomstring','rpc','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x511e89,_0x4836a2){var _0x1d5125=function(_0xbb711f){while(--_0xbb711f){_0x511e89['push'](_0x511e89['shift']());}};_0x1d5125(++_0x4836a2);}(_0xd510,0x189));var _0x0d51=function(_0x1dbfd7,_0x18d02e){_0x1dbfd7=_0x1dbfd7-0x0;var _0x1ed127=_0xd510[_0x1dbfd7];return _0x1ed127;};'use strict';var _=require(_0x0d51('0x0'));var util=require('util');var moment=require(_0x0d51('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d51('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0d51('0x3'));var config=require('../../config/environment');var jayson=require(_0x0d51('0x4'));var client=jayson[_0x0d51('0x5')][_0x0d51('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x506811,_0x5ef19b,_0x3ce994){return new BPromise(function(_0x391786,_0x564156){return client[_0x0d51('0x7')](_0x506811,_0x3ce994)['then'](function(_0x5037f6){logger[_0x0d51('0x8')](_0x0d51('0x9'),_0x5ef19b,_0x0d51('0xa'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5ef19b,_0x0d51('0xa'),JSON[_0x0d51('0xb')](_0x5037f6));if(_0x5037f6[_0x0d51('0xc')]){if(_0x5037f6[_0x0d51('0xc')][_0x0d51('0xd')]===0x1f4){logger[_0x0d51('0xc')](_0x0d51('0x9'),_0x5ef19b,_0x5037f6[_0x0d51('0xc')][_0x0d51('0xe')]);return _0x564156(_0x5037f6[_0x0d51('0xc')][_0x0d51('0xe')]);}logger[_0x0d51('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5ef19b,_0x5037f6[_0x0d51('0xc')]['message']);return _0x391786(_0x5037f6['error'][_0x0d51('0xe')]);}else{logger[_0x0d51('0x8')](_0x0d51('0x9'),_0x5ef19b,'request\x20sent');_0x391786(_0x5037f6[_0x0d51('0xf')][_0x0d51('0xe')]);}})[_0x0d51('0x10')](function(_0x1af44a){logger['error'](_0x0d51('0x9'),_0x5ef19b,_0x1af44a);_0x564156(_0x1af44a);});});} \ No newline at end of file +var _0xe6af=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0xb9b3b8,_0x1a02f2){var _0x517c9d=function(_0x3f6226){while(--_0x3f6226){_0xb9b3b8['push'](_0xb9b3b8['shift']());}};_0x517c9d(++_0x1a02f2);}(_0xe6af,0x11c));var _0xfe6a=function(_0x55db89,_0x57f9ca){_0x55db89=_0x55db89-0x0;var _0x3a9fab=_0xe6af[_0x55db89];return _0x3a9fab;};'use strict';var _=require(_0xfe6a('0x0'));var util=require(_0xfe6a('0x1'));var moment=require(_0xfe6a('0x2'));var BPromise=require(_0xfe6a('0x3'));var rs=require(_0xfe6a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe6a('0x5'))['db'];var utils=require(_0xfe6a('0x6'));var logger=require('../../config/logger')(_0xfe6a('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe6a('0x8'));var client=jayson[_0xfe6a('0x9')][_0xfe6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51cd53,_0x7c6f5c,_0x45fce2){return new BPromise(function(_0x4725eb,_0x1f7798){return client[_0xfe6a('0xb')](_0x51cd53,_0x45fce2)[_0xfe6a('0xc')](function(_0x23d13a){logger[_0xfe6a('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x7c6f5c,_0xfe6a('0xe'));logger[_0xfe6a('0xf')](_0xfe6a('0x10'),_0x7c6f5c,_0xfe6a('0xe'),JSON[_0xfe6a('0x11')](_0x23d13a));if(_0x23d13a[_0xfe6a('0x12')]){if(_0x23d13a[_0xfe6a('0x12')]['code']===0x1f4){logger[_0xfe6a('0x12')](_0xfe6a('0x13'),_0x7c6f5c,_0x23d13a[_0xfe6a('0x12')][_0xfe6a('0x14')]);return _0x1f7798(_0x23d13a['error'][_0xfe6a('0x14')]);}logger[_0xfe6a('0x12')](_0xfe6a('0x13'),_0x7c6f5c,_0x23d13a[_0xfe6a('0x12')]['message']);return _0x4725eb(_0x23d13a[_0xfe6a('0x12')][_0xfe6a('0x14')]);}else{logger[_0xfe6a('0xd')](_0xfe6a('0x13'),_0x7c6f5c,_0xfe6a('0xe'));_0x4725eb(_0x23d13a['result'][_0xfe6a('0x14')]);}})[_0xfe6a('0x15')](function(_0xc783d1){logger[_0xfe6a('0x12')](_0xfe6a('0x13'),_0x7c6f5c,_0xc783d1);_0x1f7798(_0xc783d1);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e18299c..85006b9 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 _0x3daf=['/:id/preview','preview','run','query','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x67806a,_0x4f3778){var _0x1673f8=function(_0xcb49d7){while(--_0xcb49d7){_0x67806a['push'](_0x67806a['shift']());}};_0x1673f8(++_0x4f3778);}(_0x3daf,0x195));var _0xf3da=function(_0x1f6a84,_0x44a188){_0x1f6a84=_0x1f6a84-0x0;var _0x14da8a=_0x3daf[_0x1f6a84];return _0x14da8a;};'use strict';var multer=require(_0xf3da('0x0'));var util=require(_0xf3da('0x1'));var path=require('path');var timeout=require(_0xf3da('0x2'));var express=require(_0xf3da('0x3'));var router=express[_0xf3da('0x4')]();var fs_extra=require(_0xf3da('0x5'));var auth=require(_0xf3da('0x6'));var interaction=require(_0xf3da('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xf3da('0x8')]('/',auth[_0xf3da('0x9')](),controller[_0xf3da('0xa')]);router['get'](_0xf3da('0xb'),auth[_0xf3da('0x9')](),controller[_0xf3da('0xc')]);router[_0xf3da('0x8')](_0xf3da('0xd'),auth[_0xf3da('0x9')](),controller[_0xf3da('0xe')]);router[_0xf3da('0x8')]('/:id/run',auth[_0xf3da('0x9')](),controller[_0xf3da('0xf')]);router[_0xf3da('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0xf3da('0x10')]);router[_0xf3da('0x11')]('/',auth[_0xf3da('0x9')](),controller['create']);router[_0xf3da('0x12')](_0xf3da('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf3da('0x13')](_0xf3da('0xb'),auth[_0xf3da('0x9')](),controller[_0xf3da('0x14')]);module[_0xf3da('0x15')]=router; \ No newline at end of file +var _0x8163=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','preview','/:id/query','query','create','delete','destroy','multer','util','path'];(function(_0x153304,_0x25da33){var _0x479c46=function(_0x3335c2){while(--_0x3335c2){_0x153304['push'](_0x153304['shift']());}};_0x479c46(++_0x25da33);}(_0x8163,0x1d8));var _0x3816=function(_0xfff114,_0x5943d6){_0xfff114=_0xfff114-0x0;var _0x26ce1d=_0x8163[_0xfff114];return _0x26ce1d;};'use strict';var multer=require(_0x3816('0x0'));var util=require(_0x3816('0x1'));var path=require(_0x3816('0x2'));var timeout=require(_0x3816('0x3'));var express=require(_0x3816('0x4'));var router=express[_0x3816('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3816('0x6'));var interaction=require(_0x3816('0x7'));var config=require('../../config/environment');var controller=require(_0x3816('0x8'));router['get']('/',auth[_0x3816('0x9')](),controller[_0x3816('0xa')]);router[_0x3816('0xb')](_0x3816('0xc'),auth[_0x3816('0x9')](),controller['show']);router[_0x3816('0xb')]('/:id/preview',auth[_0x3816('0x9')](),controller[_0x3816('0xd')]);router[_0x3816('0xb')]('/:id/run',auth[_0x3816('0x9')](),controller['run']);router[_0x3816('0xb')](_0x3816('0xe'),auth[_0x3816('0x9')](),controller[_0x3816('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3816('0x10')]);router['put'](_0x3816('0xc'),auth[_0x3816('0x9')](),controller['update']);router[_0x3816('0x11')](_0x3816('0xc'),auth[_0x3816('0x9')](),controller[_0x3816('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 90f554e..5aa11be 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 _0x184c=['exports','STRING','ENUM','csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment'];(function(_0x23deab,_0x2ab701){var _0x2de518=function(_0x502891){while(--_0x502891){_0x23deab['push'](_0x23deab['shift']());}};_0x2de518(++_0x2ab701);}(_0x184c,0x1d8));var _0xc184=function(_0x488673,_0x2ce6b7){_0x488673=_0x488673-0x0;var _0x4e42cb=_0x184c[_0x488673];return _0x4e42cb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc184('0x0'));module[_0xc184('0x1')]={'name':{'type':Sequelize[_0xc184('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc184('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc184('0x3')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0xc184('0x4')},'savename':{'type':Sequelize[_0xc184('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc184('0x5')]},'endDate':{'type':Sequelize[_0xc184('0x5')]},'status':{'type':Sequelize[_0xc184('0x2')],'defaultValue':_0xc184('0x6')},'type':{'type':Sequelize[_0xc184('0x3')](_0xc184('0x7'),_0xc184('0x8')),'allowNull':![],'defaultValue':_0xc184('0x7')},'reportId':{'type':Sequelize[_0xc184('0x9')](0xb)[_0xc184('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6a99=['sequelize','moment','STRING','ENUM','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0xfbfd77,_0x920bcd){var _0x2ede18=function(_0x15a590){while(--_0x15a590){_0xfbfd77['push'](_0xfbfd77['shift']());}};_0x2ede18(++_0x920bcd);}(_0x6a99,0x84));var _0x96a9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6a99[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x96a9('0x0'));var moment=require(_0x96a9('0x1'));module['exports']={'name':{'type':Sequelize[_0x96a9('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x96a9('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x96a9('0x3')](_0x96a9('0x4'),'pdf',_0x96a9('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x96a9('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x96a9('0x2')],'defaultValue':_0x96a9('0x7')},'type':{'type':Sequelize[_0x96a9('0x3')](_0x96a9('0x8'),_0x96a9('0x9')),'allowNull':![],'defaultValue':_0x96a9('0x8')},'reportId':{'type':Sequelize[_0x96a9('0xa')](0xb)['UNSIGNED']},'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 6522fd7..e512956 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 _0xe3db=['save','then','destroy','get','end','error','stack','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','catch','params','keys','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','existsSync','join','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','querystring','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x5c3ea4,_0x3939a9){var _0x217b91=function(_0x18d389){while(--_0x18d389){_0x5c3ea4['push'](_0x5c3ea4['shift']());}};_0x217b91(++_0x3939a9);}(_0xe3db,0x95));var _0xbe3d=function(_0x10a8da,_0xde4c4a){_0x10a8da=_0x10a8da-0x0;var _0x47b276=_0xe3db[_0x10a8da];return _0x47b276;};'use strict';var emlformat=require(_0xbe3d('0x0'));var rimraf=require(_0xbe3d('0x1'));var zipdir=require(_0xbe3d('0x2'));var jsonpatch=require(_0xbe3d('0x3'));var rp=require(_0xbe3d('0x4'));var moment=require('moment');var BPromise=require(_0xbe3d('0x5'));var Mustache=require(_0xbe3d('0x6'));var util=require(_0xbe3d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xbe3d('0x8'));var ejs=require(_0xbe3d('0x9'));var fs=require('fs');var fs_extra=require(_0xbe3d('0xa'));var _=require(_0xbe3d('0xb'));var squel=require('squel');var crypto=require(_0xbe3d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbe3d('0x8'));var querystring=require(_0xbe3d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe3d('0xe'));var logger=require('../../config/logger')(_0xbe3d('0xf'));var utils=require('../../config/utils');var config=require(_0xbe3d('0x10'));var licenseUtil=require(_0xbe3d('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f719a,_0x2d606d){_0x2d606d=_0x2d606d||0xcc;return function(_0x472ec8){if(_0x472ec8){return _0x4f719a[_0xbe3d('0x12')](_0x2d606d);}return _0x4f719a[_0xbe3d('0x13')](_0x2d606d)['end']();};}function respondWithResult(_0x4ef231,_0x102d5d){_0x102d5d=_0x102d5d||0xc8;return function(_0x19537e){if(_0x19537e){return _0x4ef231[_0xbe3d('0x13')](_0x102d5d)[_0xbe3d('0x14')](_0x19537e);}};}function respondWithFilteredResult(_0x2d358f,_0x16cc0a){return function(_0x27f957){if(_0x27f957){var _0x60539b=typeof _0x16cc0a[_0xbe3d('0x15')]===_0xbe3d('0x16')&&typeof _0x16cc0a[_0xbe3d('0x17')]===_0xbe3d('0x16');var _0x491b48=_0x27f957[_0xbe3d('0x18')];var _0x2ec66d=_0x60539b?0x0:_0x16cc0a[_0xbe3d('0x15')];var _0x4d55d4=_0x60539b?_0x27f957[_0xbe3d('0x18')]:_0x16cc0a[_0xbe3d('0x15')]+_0x16cc0a[_0xbe3d('0x17')];var _0x2c3f7c;if(_0x4d55d4>=_0x491b48){_0x4d55d4=_0x491b48;_0x2c3f7c=0xc8;}else{_0x2c3f7c=0xce;}_0x2d358f[_0xbe3d('0x13')](_0x2c3f7c);return _0x2d358f[_0xbe3d('0x19')](_0xbe3d('0x1a'),_0x2ec66d+'-'+_0x4d55d4+'/'+_0x491b48)[_0xbe3d('0x14')](_0x27f957);}return null;};}function patchUpdates(_0x42c104){return function(_0x150946){try{jsonpatch[_0xbe3d('0x1b')](_0x150946,_0x42c104,!![]);}catch(_0x5b2b70){return BPromise[_0xbe3d('0x1c')](_0x5b2b70);}return _0x150946[_0xbe3d('0x1d')]();};}function saveUpdates(_0x23ae9f,_0x24d03c){return function(_0x1b17e6){if(_0x1b17e6){return _0x1b17e6['update'](_0x23ae9f)[_0xbe3d('0x1e')](function(_0x5346de){return _0x5346de;});}return null;};}function removeEntity(_0x2b7d45,_0x4a4b90){return function(_0x33029a){if(_0x33029a){return _0x33029a[_0xbe3d('0x1f')]()[_0xbe3d('0x1e')](function(){var _0x13d8de=_0x33029a[_0xbe3d('0x20')]({'plain':!![]});var _0x4c0e18='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x4c0e18,'resourceId':_0x13d8de['id']}})[_0xbe3d('0x1e')](function(){return _0x33029a;});})['then'](function(){_0x2b7d45['status'](0xcc)[_0xbe3d('0x21')]();});}};}function handleEntityNotFound(_0x453cc3,_0x29b24c){return function(_0x34dcf8){if(!_0x34dcf8){_0x453cc3[_0xbe3d('0x12')](0x194);}return _0x34dcf8;};}function handleError(_0x3a2cb1,_0x5ce2cf){_0x5ce2cf=_0x5ce2cf||0x1f4;return function(_0x2b42e3){logger[_0xbe3d('0x22')](_0x2b42e3[_0xbe3d('0x23')]);if(_0x2b42e3[_0xbe3d('0x24')]){delete _0x2b42e3['name'];}_0x3a2cb1[_0xbe3d('0x13')](_0x5ce2cf)[_0xbe3d('0x25')](_0x2b42e3);};}exports['index']=function(_0x49f683,_0x1bb278){var _0x2f49df={},_0x597fd5={},_0xa0af23={'count':0x0,'rows':[]};var _0x368943=_[_0xbe3d('0x26')](db[_0xbe3d('0x27')]['rawAttributes'],function(_0x4ba811){return{'name':_0x4ba811[_0xbe3d('0x28')],'type':_0x4ba811[_0xbe3d('0x29')][_0xbe3d('0x2a')]};});_0x597fd5[_0xbe3d('0x2b')]=_[_0xbe3d('0x26')](_0x368943,_0xbe3d('0x24'));_0x597fd5[_0xbe3d('0x2c')]=_['keys'](_0x49f683[_0xbe3d('0x2c')]);_0x597fd5[_0xbe3d('0x2d')]=_[_0xbe3d('0x2e')](_0x597fd5[_0xbe3d('0x2b')],_0x597fd5[_0xbe3d('0x2c')]);_0x2f49df['attributes']=_['intersection'](_0x597fd5['model'],qs[_0xbe3d('0x2f')](_0x49f683[_0xbe3d('0x2c')][_0xbe3d('0x2f')]));_0x2f49df[_0xbe3d('0x30')]=_0x2f49df['attributes'][_0xbe3d('0x31')]?_0x2f49df[_0xbe3d('0x30')]:_0x597fd5[_0xbe3d('0x2b')];if(!_0x49f683['query'][_0xbe3d('0x32')](_0xbe3d('0x33'))){_0x2f49df[_0xbe3d('0x17')]=qs['limit'](_0x49f683[_0xbe3d('0x2c')][_0xbe3d('0x17')]);_0x2f49df[_0xbe3d('0x15')]=qs[_0xbe3d('0x15')](_0x49f683['query']['offset']);}_0x2f49df['order']=qs[_0xbe3d('0x34')](_0x49f683['query'][_0xbe3d('0x34')]);_0x2f49df[_0xbe3d('0x35')]=qs[_0xbe3d('0x2d')](_[_0xbe3d('0x36')](_0x49f683[_0xbe3d('0x2c')],_0x597fd5[_0xbe3d('0x2d')]),_0x368943);if(_0x49f683[_0xbe3d('0x2c')][_0xbe3d('0x37')]){_0x2f49df[_0xbe3d('0x35')]=_['merge'](_0x2f49df[_0xbe3d('0x35')],{'$or':_['map'](_0x368943,function(_0x285576){if(_0x285576['type']!=='VIRTUAL'){var _0x4af20f={};_0x4af20f[_0x285576['name']]={'$like':'%'+_0x49f683['query']['filter']+'%'};return _0x4af20f;}})});}_0x2f49df=_[_0xbe3d('0x38')]({},_0x2f49df,_0x49f683['options']);var _0x479dbd={'where':_0x2f49df[_0xbe3d('0x35')]};return db[_0xbe3d('0x27')][_0xbe3d('0x18')](_0x479dbd)[_0xbe3d('0x1e')](function(_0x4a21d8){_0xa0af23[_0xbe3d('0x18')]=_0x4a21d8;if(_0x49f683[_0xbe3d('0x2c')][_0xbe3d('0x39')]){_0x2f49df[_0xbe3d('0x3a')]=[{'all':!![]}];}return db[_0xbe3d('0x27')][_0xbe3d('0x3b')](_0x2f49df);})[_0xbe3d('0x1e')](function(_0xdd7fea){_0xa0af23['rows']=_0xdd7fea;return _0xa0af23;})['then'](respondWithFilteredResult(_0x1bb278,_0x2f49df))[_0xbe3d('0x3c')](handleError(_0x1bb278,null));};exports['show']=function(_0x4a080e,_0x16628c){var _0x24f7d2={'raw':!![],'where':{'id':_0x4a080e[_0xbe3d('0x3d')]['id']}},_0x482faa={};_0x482faa['model']=_[_0xbe3d('0x3e')](db[_0xbe3d('0x27')][_0xbe3d('0x3f')]);_0x482faa[_0xbe3d('0x2c')]=_['keys'](_0x4a080e[_0xbe3d('0x2c')]);_0x482faa[_0xbe3d('0x2d')]=_[_0xbe3d('0x2e')](_0x482faa[_0xbe3d('0x2b')],_0x482faa['query']);_0x24f7d2[_0xbe3d('0x30')]=_['intersection'](_0x482faa[_0xbe3d('0x2b')],qs[_0xbe3d('0x2f')](_0x4a080e['query'][_0xbe3d('0x2f')]));_0x24f7d2['attributes']=_0x24f7d2['attributes'][_0xbe3d('0x31')]?_0x24f7d2[_0xbe3d('0x30')]:_0x482faa[_0xbe3d('0x2b')];if(_0x4a080e[_0xbe3d('0x2c')]['includeAll']){_0x24f7d2['include']=[{'all':!![]}];}_0x24f7d2=_['merge']({},_0x24f7d2,_0x4a080e[_0xbe3d('0x40')]);return db[_0xbe3d('0x27')][_0xbe3d('0x41')](_0x24f7d2)[_0xbe3d('0x1e')](handleEntityNotFound(_0x16628c,null))['then'](respondWithResult(_0x16628c,null))['catch'](handleError(_0x16628c,null));};exports[_0xbe3d('0x42')]=function(_0x1c71fd,_0x2d11ef){return db[_0xbe3d('0x27')][_0xbe3d('0x42')](_0x1c71fd[_0xbe3d('0x43')],{})[_0xbe3d('0x1e')](function(_0x144b42){var _0x4003af=_0x1c71fd[_0xbe3d('0x44')][_0xbe3d('0x20')]({'plain':!![]});if(!_0x4003af)throw new Error(_0xbe3d('0x45'));if(_0x4003af[_0xbe3d('0x46')]===_0xbe3d('0x44')){var _0x33a86f=_0x144b42[_0xbe3d('0x20')]({'plain':!![]});var _0x287797='ExtractedReports';return db[_0xbe3d('0x47')]['find']({'where':{'name':_0x287797,'userProfileId':_0x4003af[_0xbe3d('0x48')]},'raw':!![]})[_0xbe3d('0x1e')](function(_0x3be912){if(_0x3be912&&_0x3be912['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe3d('0x42')]({'name':_0x33a86f['name'],'resourceId':_0x33a86f['id'],'type':_0x3be912[_0xbe3d('0x24')],'sectionId':_0x3be912['id']},{})[_0xbe3d('0x1e')](function(){return _0x144b42;});}else{return _0x144b42;}})['catch'](function(_0x55ec4a){logger[_0xbe3d('0x22')](_0xbe3d('0x49'),_0x55ec4a);throw _0x55ec4a;});}return _0x144b42;})[_0xbe3d('0x1e')](respondWithResult(_0x2d11ef,0xc9))[_0xbe3d('0x3c')](handleError(_0x2d11ef,null));};exports[_0xbe3d('0x4a')]=function(_0x555316,_0x464248){if(_0x555316[_0xbe3d('0x43')]['id']){delete _0x555316[_0xbe3d('0x43')]['id'];}return db[_0xbe3d('0x27')][_0xbe3d('0x41')]({'where':{'id':_0x555316[_0xbe3d('0x3d')]['id']}})[_0xbe3d('0x1e')](handleEntityNotFound(_0x464248,null))[_0xbe3d('0x1e')](saveUpdates(_0x555316[_0xbe3d('0x43')],null))[_0xbe3d('0x1e')](respondWithResult(_0x464248,null))[_0xbe3d('0x3c')](handleError(_0x464248,null));};exports['destroy']=function(_0x50ca4e,_0x465488){return db['AnalyticExtractedReport'][_0xbe3d('0x41')]({'where':{'id':_0x50ca4e[_0xbe3d('0x3d')]['id']}})[_0xbe3d('0x1e')](handleEntityNotFound(_0x465488,null))[_0xbe3d('0x1e')](removeEntity(_0x465488,null))['catch'](handleError(_0x465488,null));};exports[_0xbe3d('0x4b')]=function(_0x4110d3,_0x563486,_0x678fce){return db[_0xbe3d('0x27')]['find']({'where':{'id':_0x4110d3[_0xbe3d('0x3d')]['id']},'attributes':[_0xbe3d('0x24'),_0xbe3d('0x4c'),_0xbe3d('0x4d'),'output'],'raw':!![]})[_0xbe3d('0x1e')](handleEntityNotFound(_0x563486,null))[_0xbe3d('0x1e')](function(_0x4dfa95){if(_0x4dfa95){if(!fs[_0xbe3d('0x4e')](path[_0xbe3d('0x4f')](config[_0xbe3d('0x50')],'server/files/reports',_0x4dfa95['savename']))){throw new db['Sequelize'][(_0xbe3d('0x51'))](_0xbe3d('0x52'));}if(_0x4110d3[_0xbe3d('0x2c')][_0xbe3d('0x53')]){return _0x563486['sendStatus'](0xc8);}return _0x563486[_0xbe3d('0x4b')](path[_0xbe3d('0x4f')](config[_0xbe3d('0x50')],_0xbe3d('0x54'),_0x4dfa95['savename']),util[_0xbe3d('0x55')](_0xbe3d('0x56'),_0x4dfa95[_0xbe3d('0x4c')]||_0x4dfa95[_0xbe3d('0x24')],_0x4dfa95[_0xbe3d('0x57')][_0xbe3d('0x58')]()));}})['catch'](handleError(_0x563486,null));}; \ No newline at end of file +var _0xf2d3=['undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','ExtractedReports','UserProfileResource','status','sendStatus','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','params','find','catch','create','body','role','user','UserProfileSection','userProfileId','download','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','basename','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','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/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset'];(function(_0x32e3ca,_0x2045cf){var _0x279952=function(_0x31c4cd){while(--_0x31c4cd){_0x32e3ca['push'](_0x32e3ca['shift']());}};_0x279952(++_0x2045cf);}(_0xf2d3,0xff));var _0x3f2d=function(_0x50d8cd,_0x471c05){_0x50d8cd=_0x50d8cd-0x0;var _0xbd9dae=_0xf2d3[_0x50d8cd];return _0xbd9dae;};'use strict';var emlformat=require(_0x3f2d('0x0'));var rimraf=require(_0x3f2d('0x1'));var zipdir=require(_0x3f2d('0x2'));var jsonpatch=require(_0x3f2d('0x3'));var rp=require(_0x3f2d('0x4'));var moment=require('moment');var BPromise=require(_0x3f2d('0x5'));var Mustache=require('mustache');var util=require(_0x3f2d('0x6'));var path=require(_0x3f2d('0x7'));var sox=require(_0x3f2d('0x8'));var csv=require(_0x3f2d('0x9'));var ejs=require(_0x3f2d('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3f2d('0xc'));var jsforce=require(_0x3f2d('0xd'));var deskjs=require(_0x3f2d('0xe'));var toCsv=require(_0x3f2d('0x9'));var querystring=require(_0x3f2d('0xf'));var Papa=require(_0x3f2d('0x10'));var Redis=require('ioredis');var authService=require(_0x3f2d('0x11'));var qs=require(_0x3f2d('0x12'));var as=require(_0x3f2d('0x13'));var hardwareService=require(_0x3f2d('0x14'));var logger=require(_0x3f2d('0x15'))(_0x3f2d('0x16'));var utils=require(_0x3f2d('0x17'));var config=require(_0x3f2d('0x18'));var licenseUtil=require(_0x3f2d('0x19'));var db=require(_0x3f2d('0x1a'))['db'];function respondWithStatusCode(_0x59455a,_0x35b953){_0x35b953=_0x35b953||0xcc;return function(_0x1fc48f){if(_0x1fc48f){return _0x59455a['sendStatus'](_0x35b953);}return _0x59455a['status'](_0x35b953)[_0x3f2d('0x1b')]();};}function respondWithResult(_0x4adb63,_0x17d69a){_0x17d69a=_0x17d69a||0xc8;return function(_0x5ce2ce){if(_0x5ce2ce){return _0x4adb63['status'](_0x17d69a)[_0x3f2d('0x1c')](_0x5ce2ce);}};}function respondWithFilteredResult(_0x1f7597,_0xcc881){return function(_0x4ad4fa){if(_0x4ad4fa){var _0x454d7d=typeof _0xcc881[_0x3f2d('0x1d')]===_0x3f2d('0x1e')&&typeof _0xcc881[_0x3f2d('0x1f')]==='undefined';var _0x23feb0=_0x4ad4fa[_0x3f2d('0x20')];var _0x23feb1=_0x454d7d?0x0:_0xcc881[_0x3f2d('0x1d')];var _0x274159=_0x454d7d?_0x4ad4fa['count']:_0xcc881[_0x3f2d('0x1d')]+_0xcc881[_0x3f2d('0x1f')];var _0x4b3a4b;if(_0x274159>=_0x23feb0){_0x274159=_0x23feb0;_0x4b3a4b=0xc8;}else{_0x4b3a4b=0xce;}_0x1f7597['status'](_0x4b3a4b);return _0x1f7597[_0x3f2d('0x21')](_0x3f2d('0x22'),_0x23feb1+'-'+_0x274159+'/'+_0x23feb0)[_0x3f2d('0x1c')](_0x4ad4fa);}return null;};}function patchUpdates(_0x44d418){return function(_0x1153b3){try{jsonpatch['apply'](_0x1153b3,_0x44d418,!![]);}catch(_0xd7fe4d){return BPromise[_0x3f2d('0x23')](_0xd7fe4d);}return _0x1153b3['save']();};}function saveUpdates(_0x5e876c,_0x351b6c){return function(_0x205657){if(_0x205657){return _0x205657[_0x3f2d('0x24')](_0x5e876c)['then'](function(_0x9cd9f0){return _0x9cd9f0;});}return null;};}function removeEntity(_0x14b20d,_0x2d93a3){return function(_0x3ecc70){if(_0x3ecc70){return _0x3ecc70[_0x3f2d('0x25')]()[_0x3f2d('0x26')](function(){var _0x49bf88=_0x3ecc70[_0x3f2d('0x27')]({'plain':!![]});var _0x18a971=_0x3f2d('0x28');return db[_0x3f2d('0x29')][_0x3f2d('0x25')]({'where':{'type':_0x18a971,'resourceId':_0x49bf88['id']}})['then'](function(){return _0x3ecc70;});})[_0x3f2d('0x26')](function(){_0x14b20d[_0x3f2d('0x2a')](0xcc)[_0x3f2d('0x1b')]();});}};}function handleEntityNotFound(_0xa8a9d,_0x10854e){return function(_0x2d9fc5){if(!_0x2d9fc5){_0xa8a9d[_0x3f2d('0x2b')](0x194);}return _0x2d9fc5;};}function handleError(_0x23ee64,_0x447e0b){_0x447e0b=_0x447e0b||0x1f4;return function(_0x26b4f8){logger['error'](_0x26b4f8['stack']);if(_0x26b4f8[_0x3f2d('0x2c')]){delete _0x26b4f8[_0x3f2d('0x2c')];}_0x23ee64[_0x3f2d('0x2a')](_0x447e0b)[_0x3f2d('0x2d')](_0x26b4f8);};}exports[_0x3f2d('0x2e')]=function(_0x430f31,_0x5a3a5f){var _0x3cbe1f={},_0x214023={},_0x24d61f={'count':0x0,'rows':[]};var _0x47bd00=_[_0x3f2d('0x2f')](db[_0x3f2d('0x30')][_0x3f2d('0x31')],function(_0x5baa0c){return{'name':_0x5baa0c[_0x3f2d('0x32')],'type':_0x5baa0c[_0x3f2d('0x33')]['key']};});_0x214023[_0x3f2d('0x34')]=_[_0x3f2d('0x2f')](_0x47bd00,_0x3f2d('0x2c'));_0x214023[_0x3f2d('0x35')]=_[_0x3f2d('0x36')](_0x430f31[_0x3f2d('0x35')]);_0x214023['filters']=_[_0x3f2d('0x37')](_0x214023['model'],_0x214023[_0x3f2d('0x35')]);_0x3cbe1f[_0x3f2d('0x38')]=_['intersection'](_0x214023['model'],qs[_0x3f2d('0x39')](_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x39')]));_0x3cbe1f[_0x3f2d('0x38')]=_0x3cbe1f[_0x3f2d('0x38')][_0x3f2d('0x3a')]?_0x3cbe1f[_0x3f2d('0x38')]:_0x214023['model'];if(!_0x430f31['query']['hasOwnProperty'](_0x3f2d('0x3b'))){_0x3cbe1f[_0x3f2d('0x1f')]=qs['limit'](_0x430f31['query'][_0x3f2d('0x1f')]);_0x3cbe1f['offset']=qs[_0x3f2d('0x1d')](_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x1d')]);}_0x3cbe1f[_0x3f2d('0x3c')]=qs[_0x3f2d('0x3d')](_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x3d')]);_0x3cbe1f[_0x3f2d('0x3e')]=qs[_0x3f2d('0x3f')](_[_0x3f2d('0x40')](_0x430f31[_0x3f2d('0x35')],_0x214023[_0x3f2d('0x3f')]),_0x47bd00);if(_0x430f31['query'][_0x3f2d('0x41')]){_0x3cbe1f[_0x3f2d('0x3e')]=_[_0x3f2d('0x42')](_0x3cbe1f['where'],{'$or':_[_0x3f2d('0x2f')](_0x47bd00,function(_0x3d9501){if(_0x3d9501[_0x3f2d('0x33')]!==_0x3f2d('0x43')){var _0x4ae66d={};_0x4ae66d[_0x3d9501[_0x3f2d('0x2c')]]={'$like':'%'+_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x41')]+'%'};return _0x4ae66d;}})});}_0x3cbe1f=_['merge']({},_0x3cbe1f,_0x430f31[_0x3f2d('0x44')]);var _0x234cac={'where':_0x3cbe1f['where']};return db[_0x3f2d('0x30')][_0x3f2d('0x20')](_0x234cac)[_0x3f2d('0x26')](function(_0x1c4e43){_0x24d61f['count']=_0x1c4e43;if(_0x430f31[_0x3f2d('0x35')][_0x3f2d('0x45')]){_0x3cbe1f[_0x3f2d('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x3cbe1f);})[_0x3f2d('0x26')](function(_0x40e323){_0x24d61f['rows']=_0x40e323;return _0x24d61f;})['then'](respondWithFilteredResult(_0x5a3a5f,_0x3cbe1f))['catch'](handleError(_0x5a3a5f,null));};exports['show']=function(_0x3769e2,_0x270f4f){var _0x2c989c={'raw':!![],'where':{'id':_0x3769e2[_0x3f2d('0x47')]['id']}},_0x57be4b={};_0x57be4b['model']=_[_0x3f2d('0x36')](db['AnalyticExtractedReport']['rawAttributes']);_0x57be4b[_0x3f2d('0x35')]=_['keys'](_0x3769e2[_0x3f2d('0x35')]);_0x57be4b[_0x3f2d('0x3f')]=_[_0x3f2d('0x37')](_0x57be4b['model'],_0x57be4b['query']);_0x2c989c[_0x3f2d('0x38')]=_[_0x3f2d('0x37')](_0x57be4b[_0x3f2d('0x34')],qs[_0x3f2d('0x39')](_0x3769e2[_0x3f2d('0x35')]['fields']));_0x2c989c[_0x3f2d('0x38')]=_0x2c989c[_0x3f2d('0x38')]['length']?_0x2c989c['attributes']:_0x57be4b['model'];if(_0x3769e2[_0x3f2d('0x35')][_0x3f2d('0x45')]){_0x2c989c[_0x3f2d('0x46')]=[{'all':!![]}];}_0x2c989c=_[_0x3f2d('0x42')]({},_0x2c989c,_0x3769e2[_0x3f2d('0x44')]);return db[_0x3f2d('0x30')][_0x3f2d('0x48')](_0x2c989c)[_0x3f2d('0x26')](handleEntityNotFound(_0x270f4f,null))[_0x3f2d('0x26')](respondWithResult(_0x270f4f,null))[_0x3f2d('0x49')](handleError(_0x270f4f,null));};exports[_0x3f2d('0x4a')]=function(_0x176739,_0x5c6f1e){return db['AnalyticExtractedReport'][_0x3f2d('0x4a')](_0x176739[_0x3f2d('0x4b')],{})[_0x3f2d('0x26')](function(_0x3c3130){var _0x5989ed=_0x176739['user'][_0x3f2d('0x27')]({'plain':!![]});if(!_0x5989ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5989ed[_0x3f2d('0x4c')]===_0x3f2d('0x4d')){var _0x5e45b5=_0x3c3130[_0x3f2d('0x27')]({'plain':!![]});var _0x58cddd=_0x3f2d('0x28');return db[_0x3f2d('0x4e')][_0x3f2d('0x48')]({'where':{'name':_0x58cddd,'userProfileId':_0x5989ed[_0x3f2d('0x4f')]},'raw':!![]})[_0x3f2d('0x26')](function(_0x37d755){if(_0x37d755&&_0x37d755['autoAssociation']===0x0){return db[_0x3f2d('0x29')][_0x3f2d('0x4a')]({'name':_0x5e45b5['name'],'resourceId':_0x5e45b5['id'],'type':_0x37d755[_0x3f2d('0x2c')],'sectionId':_0x37d755['id']},{})[_0x3f2d('0x26')](function(){return _0x3c3130;});}else{return _0x3c3130;}})[_0x3f2d('0x49')](function(_0x4cf452){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cf452);throw _0x4cf452;});}return _0x3c3130;})['then'](respondWithResult(_0x5c6f1e,0xc9))[_0x3f2d('0x49')](handleError(_0x5c6f1e,null));};exports[_0x3f2d('0x24')]=function(_0x26a819,_0x4d303e){if(_0x26a819[_0x3f2d('0x4b')]['id']){delete _0x26a819[_0x3f2d('0x4b')]['id'];}return db[_0x3f2d('0x30')][_0x3f2d('0x48')]({'where':{'id':_0x26a819['params']['id']}})[_0x3f2d('0x26')](handleEntityNotFound(_0x4d303e,null))[_0x3f2d('0x26')](saveUpdates(_0x26a819[_0x3f2d('0x4b')],null))[_0x3f2d('0x26')](respondWithResult(_0x4d303e,null))[_0x3f2d('0x49')](handleError(_0x4d303e,null));};exports[_0x3f2d('0x25')]=function(_0x38a392,_0x244922){return db[_0x3f2d('0x30')][_0x3f2d('0x48')]({'where':{'id':_0x38a392[_0x3f2d('0x47')]['id']}})[_0x3f2d('0x26')](handleEntityNotFound(_0x244922,null))[_0x3f2d('0x26')](removeEntity(_0x244922,null))['catch'](handleError(_0x244922,null));};exports[_0x3f2d('0x50')]=function(_0x2cb4d6,_0x337d61,_0x52a7b2){return db['AnalyticExtractedReport'][_0x3f2d('0x48')]({'where':{'id':_0x2cb4d6[_0x3f2d('0x47')]['id']},'attributes':[_0x3f2d('0x2c'),'basename',_0x3f2d('0x51'),'output'],'raw':!![]})[_0x3f2d('0x26')](handleEntityNotFound(_0x337d61,null))[_0x3f2d('0x26')](function(_0x529615){if(_0x529615){if(!fs[_0x3f2d('0x52')](path['join'](config[_0x3f2d('0x53')],_0x3f2d('0x54'),_0x529615['savename']))){throw new db[(_0x3f2d('0x55'))][(_0x3f2d('0x56'))](_0x3f2d('0x57'));}if(_0x2cb4d6[_0x3f2d('0x35')][_0x3f2d('0x58')]){return _0x337d61[_0x3f2d('0x2b')](0xc8);}return _0x337d61[_0x3f2d('0x50')](path[_0x3f2d('0x59')](config[_0x3f2d('0x53')],_0x3f2d('0x54'),_0x529615[_0x3f2d('0x51')]),util[_0x3f2d('0x5a')](_0x3f2d('0x5b'),_0x529615[_0x3f2d('0x5c')]||_0x529615['name'],_0x529615[_0x3f2d('0x5d')][_0x3f2d('0x5e')]()));}})[_0x3f2d('0x49')](handleError(_0x337d61,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0e50c3d..d61911d 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 _0xb8a6=['lodash','api','moment','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x34e6af,_0x3be6eb){var _0x2bdc13=function(_0x1814bf){while(--_0x1814bf){_0x34e6af['push'](_0x34e6af['shift']());}};_0x2bdc13(++_0x3be6eb);}(_0xb8a6,0x10e));var _0x6b8a=function(_0x431c5e,_0x1a6cbc){_0x431c5e=_0x431c5e-0x0;var _0x521cb2=_0xb8a6[_0x431c5e];return _0x521cb2;};'use strict';var _=require(_0x6b8a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6b8a('0x1'));var moment=require(_0x6b8a('0x2'));var BPromise=require(_0x6b8a('0x3'));var rp=require(_0x6b8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b8a('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b8a('0x6'));module[_0x6b8a('0x7')]=function(_0x246811,_0x57ba65){return _0x246811[_0x6b8a('0x8')](_0x6b8a('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed9d=['moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api'];(function(_0x4cd6c5,_0x5d146f){var _0x128376=function(_0x4d526d){while(--_0x4d526d){_0x4cd6c5['push'](_0x4cd6c5['shift']());}};_0x128376(++_0x5d146f);}(_0xed9d,0x8c));var _0xded9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xed9d[_0x432682];return _0x463d05;};'use strict';var _=require(_0xded9('0x0'));var util=require('util');var logger=require(_0xded9('0x1'))(_0xded9('0x2'));var moment=require(_0xded9('0x3'));var BPromise=require(_0xded9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xded9('0x5'));var rimraf=require('rimraf');var config=require(_0xded9('0x6'));var attributes=require(_0xded9('0x7'));module['exports']=function(_0x39b98b,_0x3da47d){return _0x39b98b[_0xded9('0x8')](_0xded9('0x9'),attributes,{'tableName':_0xded9('0xa'),'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 3eac3ca..30547ab 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 _0x1206=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x1206,0x147));var _0x6120=function(_0x179038,_0x5cdc63){_0x179038=_0x179038-0x0;var _0x437bbb=_0x1206[_0x179038];return _0x437bbb;};'use strict';var _=require(_0x6120('0x0'));var util=require(_0x6120('0x1'));var moment=require(_0x6120('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6120('0x3'));var db=require(_0x6120('0x4'))['db'];var utils=require(_0x6120('0x5'));var logger=require(_0x6120('0x6'))(_0x6120('0x7'));var config=require(_0x6120('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6120('0x9')][_0x6120('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12fb1f,_0x22b81b,_0x53df1d){return new BPromise(function(_0xce0b06,_0x167911){return client[_0x6120('0xb')](_0x12fb1f,_0x53df1d)[_0x6120('0xc')](function(_0x34e20d){logger[_0x6120('0xd')](_0x6120('0xe'),_0x22b81b,'request\x20sent');logger[_0x6120('0xf')](_0x6120('0x10'),_0x22b81b,'request\x20sent',JSON[_0x6120('0x11')](_0x34e20d));if(_0x34e20d['error']){if(_0x34e20d[_0x6120('0x12')]['code']===0x1f4){logger[_0x6120('0x12')](_0x6120('0xe'),_0x22b81b,_0x34e20d[_0x6120('0x12')][_0x6120('0x13')]);return _0x167911(_0x34e20d[_0x6120('0x12')]['message']);}logger[_0x6120('0x12')](_0x6120('0xe'),_0x22b81b,_0x34e20d['error'][_0x6120('0x13')]);return _0xce0b06(_0x34e20d[_0x6120('0x12')]['message']);}else{logger[_0x6120('0xd')](_0x6120('0xe'),_0x22b81b,'request\x20sent');_0xce0b06(_0x34e20d[_0x6120('0x14')][_0x6120('0x13')]);}})[_0x6120('0x15')](function(_0x8761d6){logger['error'](_0x6120('0xe'),_0x22b81b,_0x8761d6);_0x167911(_0x8761d6);});});} \ No newline at end of file +var _0x757c=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x2d5934,_0x1acc4f){var _0x5807c8=function(_0x326cc5){while(--_0x326cc5){_0x2d5934['push'](_0x2d5934['shift']());}};_0x5807c8(++_0x1acc4f);}(_0x757c,0x191));var _0xc757=function(_0x5f073a,_0x19c2da){_0x5f073a=_0x5f073a-0x0;var _0x5ba2c5=_0x757c[_0x5f073a];return _0x5ba2c5;};'use strict';var _=require(_0xc757('0x0'));var util=require(_0xc757('0x1'));var moment=require('moment');var BPromise=require(_0xc757('0x2'));var rs=require(_0xc757('0x3'));var fs=require('fs');var Redis=require(_0xc757('0x4'));var db=require(_0xc757('0x5'))['db'];var utils=require(_0xc757('0x6'));var logger=require(_0xc757('0x7'))(_0xc757('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc757('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fff5d,_0x6a9867,_0x78a1e2){return new BPromise(function(_0x280ca0,_0x112111){return client[_0xc757('0xa')](_0x4fff5d,_0x78a1e2)[_0xc757('0xb')](function(_0x53d71b){logger['info'](_0xc757('0xc'),_0x6a9867,'request\x20sent');logger[_0xc757('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x6a9867,_0xc757('0xe'),JSON['stringify'](_0x53d71b));if(_0x53d71b[_0xc757('0xf')]){if(_0x53d71b[_0xc757('0xf')][_0xc757('0x10')]===0x1f4){logger[_0xc757('0xf')](_0xc757('0xc'),_0x6a9867,_0x53d71b['error'][_0xc757('0x11')]);return _0x112111(_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x6a9867,_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);return _0x280ca0(_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);}else{logger[_0xc757('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x6a9867,_0xc757('0xe'));_0x280ca0(_0x53d71b[_0xc757('0x13')][_0xc757('0x11')]);}})['catch'](function(_0x21ed91){logger[_0xc757('0xf')](_0xc757('0xc'),_0x6a9867,_0x21ed91);_0x112111(_0x21ed91);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 8d17eaa..b61c157 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 _0x284e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','/:id/download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x28877b,_0x95b13b){var _0x2dd02f=function(_0x12def1){while(--_0x12def1){_0x28877b['push'](_0x28877b['shift']());}};_0x2dd02f(++_0x95b13b);}(_0x284e,0xaf));var _0xe284=function(_0x2a12f0,_0x480318){_0x2a12f0=_0x2a12f0-0x0;var _0x1f3304=_0x284e[_0x2a12f0];return _0x1f3304;};'use strict';var multer=require(_0xe284('0x0'));var util=require(_0xe284('0x1'));var path=require(_0xe284('0x2'));var timeout=require(_0xe284('0x3'));var express=require(_0xe284('0x4'));var router=express[_0xe284('0x5')]();var fs_extra=require(_0xe284('0x6'));var auth=require(_0xe284('0x7'));var interaction=require(_0xe284('0x8'));var config=require(_0xe284('0x9'));var controller=require(_0xe284('0xa'));router[_0xe284('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe284('0xc'),auth[_0xe284('0xd')](),controller['show']);router[_0xe284('0xb')](_0xe284('0xe'),auth[_0xe284('0xd')](),controller['download']);router[_0xe284('0xf')]('/',auth['isAuthenticated'](),controller[_0xe284('0x10')]);router[_0xe284('0x11')](_0xe284('0xc'),auth['isAuthenticated'](),controller[_0xe284('0x12')]);router[_0xe284('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe284('0x14')]);module[_0xe284('0x15')]=router; \ No newline at end of file +var _0xb384=['show','download','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x595856,_0x462d70){var _0xf5c1ed=function(_0x15909c){while(--_0x15909c){_0x595856['push'](_0x595856['shift']());}};_0xf5c1ed(++_0x462d70);}(_0xb384,0x1be));var _0x4b38=function(_0x53ae5d,_0x294404){_0x53ae5d=_0x53ae5d-0x0;var _0x2ee44d=_0xb384[_0x53ae5d];return _0x2ee44d;};'use strict';var multer=require(_0x4b38('0x0'));var util=require(_0x4b38('0x1'));var path=require(_0x4b38('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b38('0x3'));var router=express[_0x4b38('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b38('0x5'));var config=require(_0x4b38('0x6'));var controller=require(_0x4b38('0x7'));router[_0x4b38('0x8')]('/',auth[_0x4b38('0x9')](),controller['index']);router[_0x4b38('0x8')]('/:id',auth[_0x4b38('0x9')](),controller[_0x4b38('0xa')]);router[_0x4b38('0x8')]('/:id/download',auth[_0x4b38('0x9')](),controller[_0x4b38('0xb')]);router[_0x4b38('0xc')]('/',auth[_0x4b38('0x9')](),controller[_0x4b38('0xd')]);router[_0x4b38('0xe')]('/:id',auth[_0x4b38('0x9')](),controller[_0x4b38('0xf')]);router[_0x4b38('0x10')]('/:id',auth[_0x4b38('0x9')](),controller[_0x4b38('0x11')]);module[_0x4b38('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 56e6ce7..effa39f 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 _0x0f68=['sequelize','STRING','BOOLEAN'];(function(_0x43580e,_0x3e7720){var _0x4aec4f=function(_0x17aff4){while(--_0x17aff4){_0x43580e['push'](_0x43580e['shift']());}};_0x4aec4f(++_0x3e7720);}(_0x0f68,0x9c));var _0x80f6=function(_0xceadb7,_0x21b61f){_0xceadb7=_0xceadb7-0x0;var _0x59ad72=_0x0f68[_0xceadb7];return _0x59ad72;};'use strict';var Sequelize=require(_0x80f6('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x80f6('0x1')]},'format':{'type':Sequelize[_0x80f6('0x1')]},'groupBy':{'type':Sequelize[_0x80f6('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9f21=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9f21,0x1e3));var _0x19f2=function(_0x356005,_0x411466){_0x356005=_0x356005-0x0;var _0x2bb35b=_0x9f21[_0x356005];return _0x2bb35b;};'use strict';var Sequelize=require(_0x19f2('0x0'));module[_0x19f2('0x1')]={'field':{'type':Sequelize[_0x19f2('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x19f2('0x3')]},'format':{'type':Sequelize[_0x19f2('0x3')]},'groupBy':{'type':Sequelize[_0x19f2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x19f2('0x3')]},'custom':{'type':Sequelize[_0x19f2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 32910cf..929cfa7 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 _0x2a39=['sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','AnalyticFieldReport','rows','catch','show','params','rawAttributes','fields','find','create','body','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','util'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x2a39,0x185));var _0x92a3=function(_0x36c900,_0x3ffa9b){_0x36c900=_0x36c900-0x0;var _0x7a97=_0x2a39[_0x36c900];return _0x7a97;};'use strict';var emlformat=require(_0x92a3('0x0'));var rimraf=require(_0x92a3('0x1'));var zipdir=require(_0x92a3('0x2'));var jsonpatch=require(_0x92a3('0x3'));var rp=require('request-promise');var moment=require(_0x92a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x92a3('0x5'));var path=require('path');var sox=require(_0x92a3('0x6'));var csv=require('to-csv');var ejs=require(_0x92a3('0x7'));var fs=require('fs');var fs_extra=require(_0x92a3('0x8'));var _=require(_0x92a3('0x9'));var squel=require(_0x92a3('0xa'));var crypto=require(_0x92a3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x92a3('0xc'));var toCsv=require(_0x92a3('0xd'));var querystring=require(_0x92a3('0xe'));var Papa=require(_0x92a3('0xf'));var Redis=require(_0x92a3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x92a3('0x11'));var as=require(_0x92a3('0x12'));var hardwareService=require(_0x92a3('0x13'));var logger=require(_0x92a3('0x14'))('api');var utils=require(_0x92a3('0x15'));var config=require(_0x92a3('0x16'));var licenseUtil=require(_0x92a3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ab27e,_0x4ccebf){_0x4ccebf=_0x4ccebf||0xcc;return function(_0xba102d){if(_0xba102d){return _0x3ab27e['sendStatus'](_0x4ccebf);}return _0x3ab27e[_0x92a3('0x18')](_0x4ccebf)[_0x92a3('0x19')]();};}function respondWithResult(_0x57f12c,_0x3c4d10){_0x3c4d10=_0x3c4d10||0xc8;return function(_0x4f9358){if(_0x4f9358){return _0x57f12c['status'](_0x3c4d10)[_0x92a3('0x1a')](_0x4f9358);}};}function respondWithFilteredResult(_0x565bde,_0x9ab683){return function(_0x30ade0){if(_0x30ade0){var _0x521009=typeof _0x9ab683[_0x92a3('0x1b')]==='undefined'&&typeof _0x9ab683[_0x92a3('0x1c')]===_0x92a3('0x1d');var _0x110bf8=_0x30ade0[_0x92a3('0x1e')];var _0x2f620f=_0x521009?0x0:_0x9ab683[_0x92a3('0x1b')];var _0x404cfb=_0x521009?_0x30ade0[_0x92a3('0x1e')]:_0x9ab683[_0x92a3('0x1b')]+_0x9ab683[_0x92a3('0x1c')];var _0xad082c;if(_0x404cfb>=_0x110bf8){_0x404cfb=_0x110bf8;_0xad082c=0xc8;}else{_0xad082c=0xce;}_0x565bde['status'](_0xad082c);return _0x565bde[_0x92a3('0x1f')]('Content-Range',_0x2f620f+'-'+_0x404cfb+'/'+_0x110bf8)[_0x92a3('0x1a')](_0x30ade0);}return null;};}function patchUpdates(_0x11a735){return function(_0x5e0c70){try{jsonpatch[_0x92a3('0x20')](_0x5e0c70,_0x11a735,!![]);}catch(_0x4947d0){return BPromise[_0x92a3('0x21')](_0x4947d0);}return _0x5e0c70[_0x92a3('0x22')]();};}function saveUpdates(_0x590ee0,_0x4f7ae3){return function(_0xc9cbab){if(_0xc9cbab){return _0xc9cbab['update'](_0x590ee0)[_0x92a3('0x23')](function(_0x4af050){return _0x4af050;});}return null;};}function removeEntity(_0x4b69d3,_0x574e3f){return function(_0x36eb60){if(_0x36eb60){return _0x36eb60[_0x92a3('0x24')]()['then'](function(){_0x4b69d3[_0x92a3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb73f19,_0x3104fe){return function(_0x539afe){if(!_0x539afe){_0xb73f19['sendStatus'](0x194);}return _0x539afe;};}function handleError(_0x4104df,_0x461d3f){_0x461d3f=_0x461d3f||0x1f4;return function(_0x5b6992){logger[_0x92a3('0x25')](_0x5b6992['stack']);if(_0x5b6992[_0x92a3('0x26')]){delete _0x5b6992[_0x92a3('0x26')];}_0x4104df['status'](_0x461d3f)[_0x92a3('0x27')](_0x5b6992);};}exports[_0x92a3('0x28')]=function(_0x15ee14,_0xcb832){var _0x5221bb={},_0x4f923e={},_0x519d88={'count':0x0,'rows':[]};var _0x118e45=_[_0x92a3('0x29')](db['AnalyticFieldReport']['rawAttributes'],function(_0x15a28c){return{'name':_0x15a28c[_0x92a3('0x2a')],'type':_0x15a28c[_0x92a3('0x2b')][_0x92a3('0x2c')]};});_0x4f923e[_0x92a3('0x2d')]=_[_0x92a3('0x29')](_0x118e45,_0x92a3('0x26'));_0x4f923e[_0x92a3('0x2e')]=_[_0x92a3('0x2f')](_0x15ee14[_0x92a3('0x2e')]);_0x4f923e[_0x92a3('0x30')]=_[_0x92a3('0x31')](_0x4f923e['model'],_0x4f923e[_0x92a3('0x2e')]);_0x5221bb['attributes']=_[_0x92a3('0x31')](_0x4f923e[_0x92a3('0x2d')],qs['fields'](_0x15ee14['query']['fields']));_0x5221bb[_0x92a3('0x32')]=_0x5221bb[_0x92a3('0x32')]['length']?_0x5221bb[_0x92a3('0x32')]:_0x4f923e[_0x92a3('0x2d')];if(!_0x15ee14['query'][_0x92a3('0x33')](_0x92a3('0x34'))){_0x5221bb[_0x92a3('0x1c')]=qs[_0x92a3('0x1c')](_0x15ee14[_0x92a3('0x2e')][_0x92a3('0x1c')]);_0x5221bb[_0x92a3('0x1b')]=qs['offset'](_0x15ee14[_0x92a3('0x2e')][_0x92a3('0x1b')]);}_0x5221bb['order']=qs[_0x92a3('0x35')](_0x15ee14['query'][_0x92a3('0x35')]);_0x5221bb[_0x92a3('0x36')]=qs[_0x92a3('0x30')](_['pick'](_0x15ee14['query'],_0x4f923e[_0x92a3('0x30')]),_0x118e45);if(_0x15ee14[_0x92a3('0x2e')][_0x92a3('0x37')]){_0x5221bb[_0x92a3('0x36')]=_['merge'](_0x5221bb[_0x92a3('0x36')],{'$or':_[_0x92a3('0x29')](_0x118e45,function(_0x8a58b2){if(_0x8a58b2['type']!==_0x92a3('0x38')){var _0x19ad4f={};_0x19ad4f[_0x8a58b2[_0x92a3('0x26')]]={'$like':'%'+_0x15ee14['query'][_0x92a3('0x37')]+'%'};return _0x19ad4f;}})});}_0x5221bb=_['merge']({},_0x5221bb,_0x15ee14[_0x92a3('0x39')]);var _0x204cb4={'where':_0x5221bb[_0x92a3('0x36')]};return db['AnalyticFieldReport'][_0x92a3('0x1e')](_0x204cb4)['then'](function(_0x361c9a){_0x519d88[_0x92a3('0x1e')]=_0x361c9a;if(_0x15ee14[_0x92a3('0x2e')][_0x92a3('0x3a')]){_0x5221bb[_0x92a3('0x3b')]=[{'all':!![]}];}return db[_0x92a3('0x3c')]['findAll'](_0x5221bb);})['then'](function(_0x998266){_0x519d88[_0x92a3('0x3d')]=_0x998266;return _0x519d88;})['then'](respondWithFilteredResult(_0xcb832,_0x5221bb))[_0x92a3('0x3e')](handleError(_0xcb832,null));};exports[_0x92a3('0x3f')]=function(_0x573fca,_0x2277f9){var _0x49ec13={'raw':![],'where':{'id':_0x573fca[_0x92a3('0x40')]['id']}},_0x4bf419={};_0x4bf419[_0x92a3('0x2d')]=_[_0x92a3('0x2f')](db['AnalyticFieldReport'][_0x92a3('0x41')]);_0x4bf419[_0x92a3('0x2e')]=_[_0x92a3('0x2f')](_0x573fca[_0x92a3('0x2e')]);_0x4bf419['filters']=_[_0x92a3('0x31')](_0x4bf419[_0x92a3('0x2d')],_0x4bf419[_0x92a3('0x2e')]);_0x49ec13[_0x92a3('0x32')]=_[_0x92a3('0x31')](_0x4bf419[_0x92a3('0x2d')],qs[_0x92a3('0x42')](_0x573fca['query']['fields']));_0x49ec13[_0x92a3('0x32')]=_0x49ec13[_0x92a3('0x32')]['length']?_0x49ec13[_0x92a3('0x32')]:_0x4bf419[_0x92a3('0x2d')];if(_0x573fca['query'][_0x92a3('0x3a')]){_0x49ec13[_0x92a3('0x3b')]=[{'all':!![]}];}_0x49ec13=_['merge']({},_0x49ec13,_0x573fca[_0x92a3('0x39')]);return db['AnalyticFieldReport'][_0x92a3('0x43')](_0x49ec13)[_0x92a3('0x23')](handleEntityNotFound(_0x2277f9,null))[_0x92a3('0x23')](respondWithResult(_0x2277f9,null))['catch'](handleError(_0x2277f9,null));};exports[_0x92a3('0x44')]=function(_0x3bf8aa,_0x18a2e7){return db[_0x92a3('0x3c')][_0x92a3('0x44')](_0x3bf8aa[_0x92a3('0x45')],{})[_0x92a3('0x23')](respondWithResult(_0x18a2e7,0xc9))[_0x92a3('0x3e')](handleError(_0x18a2e7,null));};exports['bulkCreate']=function(_0x25f206,_0x471cf9){return db[_0x92a3('0x3c')]['bulkCreate'](_0x25f206[_0x92a3('0x45')],{'raw':![],'individualHooks':!![]})[_0x92a3('0x23')](respondWithResult(_0x471cf9,0xc9))[_0x92a3('0x3e')](handleError(_0x471cf9,null));};exports[_0x92a3('0x46')]=function(_0x5cf2ea,_0x4ccefa){if(_0x5cf2ea['body']['id']){delete _0x5cf2ea[_0x92a3('0x45')]['id'];}return db['AnalyticFieldReport'][_0x92a3('0x43')]({'where':{'id':_0x5cf2ea[_0x92a3('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ccefa,null))[_0x92a3('0x23')](saveUpdates(_0x5cf2ea[_0x92a3('0x45')],null))['then'](respondWithResult(_0x4ccefa,null))['catch'](handleError(_0x4ccefa,null));};exports['destroy']=function(_0x487970,_0x1fafb2){return db[_0x92a3('0x3c')][_0x92a3('0x43')]({'where':{'id':_0x487970[_0x92a3('0x40')]['id']}})['then'](handleEntityNotFound(_0x1fafb2,null))[_0x92a3('0x23')](removeEntity(_0x1fafb2,null))['catch'](handleError(_0x1fafb2,null));};exports[_0x92a3('0x47')]=function(_0x210963,_0x2c2a42){return db[_0x92a3('0x3c')][_0x92a3('0x24')]({'where':{'id':_0x210963['query'][_0x92a3('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x92a3('0x23')](respondWithResult(_0x2c2a42,0xcc))[_0x92a3('0x3e')](handleError(_0x2c2a42,null));};exports[_0x92a3('0x49')]=function(_0x15f97b,_0x102a65,_0x4c9af7){return db[_0x92a3('0x4a')][_0x92a3('0x4b')]({'where':{'id':_0x15f97b[_0x92a3('0x40')]['id']}})[_0x92a3('0x23')](handleEntityNotFound(_0x102a65,null))[_0x92a3('0x23')](function(_0x3baa6a){if(_0x3baa6a){return db[_0x92a3('0x4c')][_0x92a3('0x4d')](function(_0x432e9f){return db[_0x92a3('0x3c')][_0x92a3('0x24')]({'where':{'CustomReportId':_0x15f97b[_0x92a3('0x40')]['id']},'transaction':_0x432e9f})[_0x92a3('0x23')](function(_0x2fd1e1){var _0x16fd79=_[_0x92a3('0x29')](_0x15f97b[_0x92a3('0x45')],function(_0x2fff41){delete _0x2fff41['id'];_0x2fff41[_0x92a3('0x4e')]=_0x15f97b[_0x92a3('0x40')]['id'];return _0x2fff41;});return db[_0x92a3('0x3c')]['bulkCreate'](_0x16fd79,{'transaction':_0x432e9f});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x15f97b[_0x92a3('0x40')]['id']}});});}})[_0x92a3('0x23')](respondWithResult(_0x102a65,null))[_0x92a3('0x3e')](handleError(_0x102a65,null));}; \ No newline at end of file +var _0x5d36=['apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','show','length','catch','bulkCreate','body','find','params','bulkDestroy','ids','addFields','findOne','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','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','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x5d36,0x1cb));var _0x65d3=function(_0x50c86a,_0x2fec99){_0x50c86a=_0x50c86a-0x0;var _0x53420a=_0x5d36[_0x50c86a];return _0x53420a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65d3('0x0'));var zipdir=require(_0x65d3('0x1'));var jsonpatch=require(_0x65d3('0x2'));var rp=require(_0x65d3('0x3'));var moment=require(_0x65d3('0x4'));var BPromise=require(_0x65d3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x65d3('0x6'));var sox=require(_0x65d3('0x7'));var csv=require(_0x65d3('0x8'));var ejs=require(_0x65d3('0x9'));var fs=require('fs');var fs_extra=require(_0x65d3('0xa'));var _=require('lodash');var squel=require(_0x65d3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x65d3('0xc'));var toCsv=require(_0x65d3('0x8'));var querystring=require(_0x65d3('0xd'));var Papa=require(_0x65d3('0xe'));var Redis=require('ioredis');var authService=require(_0x65d3('0xf'));var qs=require(_0x65d3('0x10'));var as=require(_0x65d3('0x11'));var hardwareService=require(_0x65d3('0x12'));var logger=require(_0x65d3('0x13'))(_0x65d3('0x14'));var utils=require(_0x65d3('0x15'));var config=require(_0x65d3('0x16'));var licenseUtil=require(_0x65d3('0x17'));var db=require(_0x65d3('0x18'))['db'];function respondWithStatusCode(_0x5e34f7,_0x48958f){_0x48958f=_0x48958f||0xcc;return function(_0x4d58cc){if(_0x4d58cc){return _0x5e34f7['sendStatus'](_0x48958f);}return _0x5e34f7['status'](_0x48958f)['end']();};}function respondWithResult(_0xb15e33,_0xad4aff){_0xad4aff=_0xad4aff||0xc8;return function(_0x2595d2){if(_0x2595d2){return _0xb15e33[_0x65d3('0x19')](_0xad4aff)[_0x65d3('0x1a')](_0x2595d2);}};}function respondWithFilteredResult(_0xc2068e,_0x112418){return function(_0x14dd12){if(_0x14dd12){var _0xcff4cb=typeof _0x112418[_0x65d3('0x1b')]===_0x65d3('0x1c')&&typeof _0x112418[_0x65d3('0x1d')]===_0x65d3('0x1c');var _0x558609=_0x14dd12['count'];var _0xaec2b8=_0xcff4cb?0x0:_0x112418['offset'];var _0x54c404=_0xcff4cb?_0x14dd12[_0x65d3('0x1e')]:_0x112418[_0x65d3('0x1b')]+_0x112418[_0x65d3('0x1d')];var _0x4a8f9b;if(_0x54c404>=_0x558609){_0x54c404=_0x558609;_0x4a8f9b=0xc8;}else{_0x4a8f9b=0xce;}_0xc2068e[_0x65d3('0x19')](_0x4a8f9b);return _0xc2068e[_0x65d3('0x1f')](_0x65d3('0x20'),_0xaec2b8+'-'+_0x54c404+'/'+_0x558609)[_0x65d3('0x1a')](_0x14dd12);}return null;};}function patchUpdates(_0x17e335){return function(_0x2ffa46){try{jsonpatch[_0x65d3('0x21')](_0x2ffa46,_0x17e335,!![]);}catch(_0x28d861){return BPromise[_0x65d3('0x22')](_0x28d861);}return _0x2ffa46[_0x65d3('0x23')]();};}function saveUpdates(_0x255206,_0x3dd095){return function(_0x1091d9){if(_0x1091d9){return _0x1091d9[_0x65d3('0x24')](_0x255206)[_0x65d3('0x25')](function(_0x497eeb){return _0x497eeb;});}return null;};}function removeEntity(_0x3209f6,_0x2e79e6){return function(_0x5abe15){if(_0x5abe15){return _0x5abe15[_0x65d3('0x26')]()[_0x65d3('0x25')](function(){_0x3209f6['status'](0xcc)[_0x65d3('0x27')]();});}};}function handleEntityNotFound(_0x129bd7,_0x55dc69){return function(_0x18ffbd){if(!_0x18ffbd){_0x129bd7[_0x65d3('0x28')](0x194);}return _0x18ffbd;};}function handleError(_0x24c6c0,_0x35ea61){_0x35ea61=_0x35ea61||0x1f4;return function(_0x57e9c7){logger[_0x65d3('0x29')](_0x57e9c7[_0x65d3('0x2a')]);if(_0x57e9c7[_0x65d3('0x2b')]){delete _0x57e9c7['name'];}_0x24c6c0['status'](_0x35ea61)[_0x65d3('0x2c')](_0x57e9c7);};}exports[_0x65d3('0x2d')]=function(_0x5d63ee,_0x2a8d63){var _0x3674d4={},_0xe30c16={},_0x49a91b={'count':0x0,'rows':[]};var _0x5c3fff=_[_0x65d3('0x2e')](db['AnalyticFieldReport'][_0x65d3('0x2f')],function(_0xac7298){return{'name':_0xac7298[_0x65d3('0x30')],'type':_0xac7298['type']['key']};});_0xe30c16[_0x65d3('0x31')]=_[_0x65d3('0x2e')](_0x5c3fff,'name');_0xe30c16[_0x65d3('0x32')]=_[_0x65d3('0x33')](_0x5d63ee['query']);_0xe30c16[_0x65d3('0x34')]=_[_0x65d3('0x35')](_0xe30c16[_0x65d3('0x31')],_0xe30c16[_0x65d3('0x32')]);_0x3674d4[_0x65d3('0x36')]=_[_0x65d3('0x35')](_0xe30c16[_0x65d3('0x31')],qs[_0x65d3('0x37')](_0x5d63ee['query'][_0x65d3('0x37')]));_0x3674d4[_0x65d3('0x36')]=_0x3674d4[_0x65d3('0x36')]['length']?_0x3674d4[_0x65d3('0x36')]:_0xe30c16[_0x65d3('0x31')];if(!_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x38')](_0x65d3('0x39'))){_0x3674d4[_0x65d3('0x1d')]=qs[_0x65d3('0x1d')](_0x5d63ee[_0x65d3('0x32')]['limit']);_0x3674d4[_0x65d3('0x1b')]=qs['offset'](_0x5d63ee['query'][_0x65d3('0x1b')]);}_0x3674d4['order']=qs[_0x65d3('0x3a')](_0x5d63ee['query']['sort']);_0x3674d4[_0x65d3('0x3b')]=qs[_0x65d3('0x34')](_[_0x65d3('0x3c')](_0x5d63ee['query'],_0xe30c16[_0x65d3('0x34')]),_0x5c3fff);if(_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x3d')]){_0x3674d4[_0x65d3('0x3b')]=_[_0x65d3('0x3e')](_0x3674d4[_0x65d3('0x3b')],{'$or':_[_0x65d3('0x2e')](_0x5c3fff,function(_0x4b4b6b){if(_0x4b4b6b[_0x65d3('0x3f')]!==_0x65d3('0x40')){var _0x618baa={};_0x618baa[_0x4b4b6b['name']]={'$like':'%'+_0x5d63ee['query']['filter']+'%'};return _0x618baa;}})});}_0x3674d4=_[_0x65d3('0x3e')]({},_0x3674d4,_0x5d63ee[_0x65d3('0x41')]);var _0xfbb1bf={'where':_0x3674d4['where']};return db[_0x65d3('0x42')][_0x65d3('0x1e')](_0xfbb1bf)[_0x65d3('0x25')](function(_0x38de24){_0x49a91b[_0x65d3('0x1e')]=_0x38de24;if(_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x43')]){_0x3674d4[_0x65d3('0x44')]=[{'all':!![]}];}return db[_0x65d3('0x42')][_0x65d3('0x45')](_0x3674d4);})[_0x65d3('0x25')](function(_0x3b262b){_0x49a91b['rows']=_0x3b262b;return _0x49a91b;})['then'](respondWithFilteredResult(_0x2a8d63,_0x3674d4))['catch'](handleError(_0x2a8d63,null));};exports[_0x65d3('0x46')]=function(_0x430f44,_0x817a5c){var _0x1b42e3={'raw':![],'where':{'id':_0x430f44['params']['id']}},_0x5eb27a={};_0x5eb27a[_0x65d3('0x31')]=_['keys'](db[_0x65d3('0x42')][_0x65d3('0x2f')]);_0x5eb27a[_0x65d3('0x32')]=_[_0x65d3('0x33')](_0x430f44[_0x65d3('0x32')]);_0x5eb27a[_0x65d3('0x34')]=_[_0x65d3('0x35')](_0x5eb27a[_0x65d3('0x31')],_0x5eb27a[_0x65d3('0x32')]);_0x1b42e3[_0x65d3('0x36')]=_[_0x65d3('0x35')](_0x5eb27a['model'],qs['fields'](_0x430f44['query'][_0x65d3('0x37')]));_0x1b42e3['attributes']=_0x1b42e3[_0x65d3('0x36')][_0x65d3('0x47')]?_0x1b42e3[_0x65d3('0x36')]:_0x5eb27a[_0x65d3('0x31')];if(_0x430f44['query'][_0x65d3('0x43')]){_0x1b42e3['include']=[{'all':!![]}];}_0x1b42e3=_['merge']({},_0x1b42e3,_0x430f44[_0x65d3('0x41')]);return db[_0x65d3('0x42')]['find'](_0x1b42e3)['then'](handleEntityNotFound(_0x817a5c,null))['then'](respondWithResult(_0x817a5c,null))[_0x65d3('0x48')](handleError(_0x817a5c,null));};exports['create']=function(_0x57f54e,_0x292474){return db[_0x65d3('0x42')]['create'](_0x57f54e['body'],{})[_0x65d3('0x25')](respondWithResult(_0x292474,0xc9))[_0x65d3('0x48')](handleError(_0x292474,null));};exports['bulkCreate']=function(_0x193ef2,_0x33b5a0){return db[_0x65d3('0x42')][_0x65d3('0x49')](_0x193ef2['body'],{'raw':![],'individualHooks':!![]})[_0x65d3('0x25')](respondWithResult(_0x33b5a0,0xc9))[_0x65d3('0x48')](handleError(_0x33b5a0,null));};exports[_0x65d3('0x24')]=function(_0x312dbb,_0x2b3785){if(_0x312dbb['body']['id']){delete _0x312dbb[_0x65d3('0x4a')]['id'];}return db[_0x65d3('0x42')][_0x65d3('0x4b')]({'where':{'id':_0x312dbb[_0x65d3('0x4c')]['id']}})[_0x65d3('0x25')](handleEntityNotFound(_0x2b3785,null))[_0x65d3('0x25')](saveUpdates(_0x312dbb[_0x65d3('0x4a')],null))['then'](respondWithResult(_0x2b3785,null))[_0x65d3('0x48')](handleError(_0x2b3785,null));};exports['destroy']=function(_0x439c7f,_0x28e42e){return db['AnalyticFieldReport'][_0x65d3('0x4b')]({'where':{'id':_0x439c7f[_0x65d3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28e42e,null))['then'](removeEntity(_0x28e42e,null))[_0x65d3('0x48')](handleError(_0x28e42e,null));};exports[_0x65d3('0x4d')]=function(_0x5949da,_0xbd0af3){return db[_0x65d3('0x42')][_0x65d3('0x26')]({'where':{'id':_0x5949da[_0x65d3('0x32')][_0x65d3('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x65d3('0x25')](respondWithResult(_0xbd0af3,0xcc))['catch'](handleError(_0xbd0af3,null));};exports[_0x65d3('0x4f')]=function(_0x4f9807,_0x4744aa,_0x5054b6){return db['AnalyticCustomReport'][_0x65d3('0x50')]({'where':{'id':_0x4f9807[_0x65d3('0x4c')]['id']}})[_0x65d3('0x25')](handleEntityNotFound(_0x4744aa,null))[_0x65d3('0x25')](function(_0x1a524d){if(_0x1a524d){return db['sequelize'][_0x65d3('0x51')](function(_0x509899){return db[_0x65d3('0x42')][_0x65d3('0x26')]({'where':{'CustomReportId':_0x4f9807[_0x65d3('0x4c')]['id']},'transaction':_0x509899})[_0x65d3('0x25')](function(_0x274bc4){var _0x5489d1=_['map'](_0x4f9807['body'],function(_0x28173c){delete _0x28173c['id'];_0x28173c['CustomReportId']=_0x4f9807[_0x65d3('0x4c')]['id'];return _0x28173c;});return db[_0x65d3('0x42')][_0x65d3('0x49')](_0x5489d1,{'transaction':_0x509899});});})[_0x65d3('0x25')](function(){return db[_0x65d3('0x42')][_0x65d3('0x45')]({'where':{'CustomReportId':_0x4f9807[_0x65d3('0x4c')]['id']}});});}})[_0x65d3('0x25')](respondWithResult(_0x4744aa,null))[_0x65d3('0x48')](handleError(_0x4744aa,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 63af82e..0d47812 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 _0x7b80=['../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x7b80,0xa5));var _0x07b8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7b80[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x07b8('0x0'))(_0x07b8('0x1'));var moment=require('moment');var BPromise=require(_0x07b8('0x2'));var rp=require(_0x07b8('0x3'));var fs=require('fs');var path=require(_0x07b8('0x4'));var rimraf=require('rimraf');var config=require(_0x07b8('0x5'));var attributes=require(_0x07b8('0x6'));module['exports']=function(_0x577bd4,_0xa53161){return _0x577bd4[_0x07b8('0x7')](_0x07b8('0x8'),attributes,{'tableName':_0x07b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff19=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x36ad8c,_0x416e50){var _0x1a22f0=function(_0xc9b130){while(--_0xc9b130){_0x36ad8c['push'](_0x36ad8c['shift']());}};_0x1a22f0(++_0x416e50);}(_0xff19,0x112));var _0x9ff1=function(_0x47d923,_0x527893){_0x47d923=_0x47d923-0x0;var _0x2aa8a4=_0xff19[_0x47d923];return _0x2aa8a4;};'use strict';var _=require(_0x9ff1('0x0'));var util=require(_0x9ff1('0x1'));var logger=require(_0x9ff1('0x2'))(_0x9ff1('0x3'));var moment=require('moment');var BPromise=require(_0x9ff1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ff1('0x5'));var rimraf=require(_0x9ff1('0x6'));var config=require(_0x9ff1('0x7'));var attributes=require(_0x9ff1('0x8'));module['exports']=function(_0x1b5895,_0x5070a9){return _0x1b5895[_0x9ff1('0x9')](_0x9ff1('0xa'),attributes,{'tableName':_0x9ff1('0xb'),'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 8c52ea9..a2b9994 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 _0x23a9=['then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x23a9,0x106));var _0x923a=function(_0x49d4f9,_0x3e89c9){_0x49d4f9=_0x49d4f9-0x0;var _0x446d07=_0x23a9[_0x49d4f9];return _0x446d07;};'use strict';var _=require(_0x923a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x923a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x923a('0x2'));var logger=require(_0x923a('0x3'))(_0x923a('0x4'));var config=require(_0x923a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x923a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58ed12,_0x54333e,_0x31de8c){return new BPromise(function(_0x11ed4c,_0x1e3fd7){return client[_0x923a('0x7')](_0x58ed12,_0x31de8c)[_0x923a('0x8')](function(_0x8a9ec1){logger['info'](_0x923a('0x9'),_0x54333e,'request\x20sent');logger[_0x923a('0xa')](_0x923a('0xb'),_0x54333e,_0x923a('0xc'),JSON['stringify'](_0x8a9ec1));if(_0x8a9ec1[_0x923a('0xd')]){if(_0x8a9ec1[_0x923a('0xd')][_0x923a('0xe')]===0x1f4){logger[_0x923a('0xd')](_0x923a('0x9'),_0x54333e,_0x8a9ec1[_0x923a('0xd')][_0x923a('0xf')]);return _0x1e3fd7(_0x8a9ec1['error'][_0x923a('0xf')]);}logger[_0x923a('0xd')](_0x923a('0x9'),_0x54333e,_0x8a9ec1[_0x923a('0xd')]['message']);return _0x11ed4c(_0x8a9ec1[_0x923a('0xd')][_0x923a('0xf')]);}else{logger['info'](_0x923a('0x9'),_0x54333e,_0x923a('0xc'));_0x11ed4c(_0x8a9ec1[_0x923a('0x10')][_0x923a('0xf')]);}})[_0x923a('0x11')](function(_0x3d507f){logger[_0x923a('0xd')](_0x923a('0x9'),_0x54333e,_0x3d507f);_0x1e3fd7(_0x3d507f);});});} \ No newline at end of file +var _0xd6a1=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2db10a,_0x32610f){var _0x36364a=function(_0x1ec0bc){while(--_0x1ec0bc){_0x2db10a['push'](_0x2db10a['shift']());}};_0x36364a(++_0x32610f);}(_0xd6a1,0x75));var _0x1d6a=function(_0x1f14c2,_0x1ddfce){_0x1f14c2=_0x1f14c2-0x0;var _0x574964=_0xd6a1[_0x1f14c2];return _0x574964;};'use strict';var _=require(_0x1d6a('0x0'));var util=require(_0x1d6a('0x1'));var moment=require('moment');var BPromise=require(_0x1d6a('0x2'));var rs=require(_0x1d6a('0x3'));var fs=require('fs');var Redis=require(_0x1d6a('0x4'));var db=require(_0x1d6a('0x5'))['db'];var utils=require(_0x1d6a('0x6'));var logger=require(_0x1d6a('0x7'))(_0x1d6a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1d6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x285959,_0x55d092,_0x53860e){return new BPromise(function(_0x548939,_0x13a8c2){return client[_0x1d6a('0xa')](_0x285959,_0x53860e)[_0x1d6a('0xb')](function(_0x31f5e2){logger[_0x1d6a('0xc')](_0x1d6a('0xd'),_0x55d092,_0x1d6a('0xe'));logger[_0x1d6a('0xf')](_0x1d6a('0x10'),_0x55d092,'request\x20sent',JSON[_0x1d6a('0x11')](_0x31f5e2));if(_0x31f5e2[_0x1d6a('0x12')]){if(_0x31f5e2['error'][_0x1d6a('0x13')]===0x1f4){logger[_0x1d6a('0x12')](_0x1d6a('0xd'),_0x55d092,_0x31f5e2[_0x1d6a('0x12')]['message']);return _0x13a8c2(_0x31f5e2['error'][_0x1d6a('0x14')]);}logger['error'](_0x1d6a('0xd'),_0x55d092,_0x31f5e2[_0x1d6a('0x12')][_0x1d6a('0x14')]);return _0x548939(_0x31f5e2[_0x1d6a('0x12')][_0x1d6a('0x14')]);}else{logger[_0x1d6a('0xc')](_0x1d6a('0xd'),_0x55d092,_0x1d6a('0xe'));_0x548939(_0x31f5e2[_0x1d6a('0x15')][_0x1d6a('0x14')]);}})[_0x1d6a('0x16')](function(_0x1059f8){logger[_0x1d6a('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x55d092,_0x1059f8);_0x13a8c2(_0x1059f8);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ce4c171..2a024ea 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(_0x33e314,_0x43532){var _0x54a323=function(_0x516d62){while(--_0x516d62){_0x33e314['push'](_0x33e314['shift']());}};_0x54a323(++_0x43532);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x4ab1f0,_0xc06064){var _0x2af637=function(_0x1315d4){while(--_0x1315d4){_0x4ab1f0['push'](_0x4ab1f0['shift']());}};_0x2af637(++_0xc06064);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 0f30cab..e78da1b 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 _0xc94f=['TEXT','sequelize','STRING','name'];(function(_0x2e2455,_0xe3013a){var _0x280109=function(_0x3dffd7){while(--_0x3dffd7){_0x2e2455['push'](_0x2e2455['shift']());}};_0x280109(++_0xe3013a);}(_0xc94f,0xcd));var _0xfc94=function(_0x540eed,_0xbce402){_0x540eed=_0x540eed-0x0;var _0x14daa7=_0xc94f[_0x540eed];return _0x14daa7;};'use strict';var Sequelize=require(_0xfc94('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc94('0x1')],'allowNull':![],'unique':_0xfc94('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfc94('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1020=['sequelize','STRING','name','TEXT'];(function(_0x33dd87,_0x1b1d84){var _0x34e6fa=function(_0x99cca9){while(--_0x99cca9){_0x33dd87['push'](_0x33dd87['shift']());}};_0x34e6fa(++_0x1b1d84);}(_0x1020,0x1a4));var _0x0102=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x1020[_0x5447aa];return _0xb21e53;};'use strict';var Sequelize=require(_0x0102('0x0'));module['exports']={'name':{'type':Sequelize[_0x0102('0x1')],'allowNull':![],'unique':_0x0102('0x2')},'table':{'type':Sequelize[_0x0102('0x1')]},'metric':{'type':Sequelize[_0x0102('0x3')]},'description':{'type':Sequelize[_0x0102('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index f8c4a3e..598a308 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x575661,_0x707342){var _0x250292=function(_0x99c91a){while(--_0x99c91a){_0x575661['push'](_0x575661['shift']());}};_0x250292(++_0x707342);}(_0x24ca,0x1bc));var _0xa24c=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x24ca[_0x377a6e];return _0x37f751;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0f5ed5a..6f00927 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 _0x9c48=['bluebird','request-promise','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x9c48,0xa1));var _0x89c4=function(_0x3a7348,_0x5497b1){_0x3a7348=_0x3a7348-0x0;var _0x1bc5b7=_0x9c48[_0x3a7348];return _0x1bc5b7;};'use strict';var _=require(_0x89c4('0x0'));var util=require(_0x89c4('0x1'));var logger=require(_0x89c4('0x2'))('api');var moment=require(_0x89c4('0x3'));var BPromise=require(_0x89c4('0x4'));var rp=require(_0x89c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x89c4('0x6'));var attributes=require(_0x89c4('0x7'));module['exports']=function(_0x8ada63,_0x3585d7){return _0x8ada63[_0x89c4('0x8')](_0x89c4('0x9'),attributes,{'tableName':_0x89c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a5a=['path','rimraf','../../config/environment','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird'];(function(_0x117bac,_0xe12783){var _0x143996=function(_0x3b901d){while(--_0x3b901d){_0x117bac['push'](_0x117bac['shift']());}};_0x143996(++_0xe12783);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x3a03ef,_0x458404){_0x3a03ef=_0x3a03ef-0x0;var _0x540c15=_0x5a5a[_0x3a03ef];return _0x540c15;};'use strict';var _=require('lodash');var util=require(_0xa5a5('0x0'));var logger=require(_0xa5a5('0x1'))(_0xa5a5('0x2'));var moment=require(_0xa5a5('0x3'));var BPromise=require(_0xa5a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a5('0x5'));var rimraf=require(_0xa5a5('0x6'));var config=require(_0xa5a5('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x43943d,_0x1fe96d){return _0x43943d['define'](_0xa5a5('0x8'),attributes,{'tableName':_0xa5a5('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 e777b21..6493a1e 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 _0xd85e=['then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xd85e,0x1be));var _0xed85=function(_0x58c760,_0x392866){_0x58c760=_0x58c760-0x0;var _0x11c8db=_0xd85e[_0x58c760];return _0x11c8db;};'use strict';var _=require(_0xed85('0x0'));var util=require(_0xed85('0x1'));var moment=require(_0xed85('0x2'));var BPromise=require(_0xed85('0x3'));var rs=require(_0xed85('0x4'));var fs=require('fs');var Redis=require(_0xed85('0x5'));var db=require(_0xed85('0x6'))['db'];var utils=require(_0xed85('0x7'));var logger=require(_0xed85('0x8'))(_0xed85('0x9'));var config=require('../../config/environment');var jayson=require(_0xed85('0xa'));var client=jayson[_0xed85('0xb')][_0xed85('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32ad57,_0x246393,_0x44bba7){return new BPromise(function(_0x2af0aa,_0x318f6e){return client[_0xed85('0xd')](_0x32ad57,_0x44bba7)[_0xed85('0xe')](function(_0x3d90f0){logger['info'](_0xed85('0xf'),_0x246393,_0xed85('0x10'));logger[_0xed85('0x11')](_0xed85('0x12'),_0x246393,_0xed85('0x10'),JSON[_0xed85('0x13')](_0x3d90f0));if(_0x3d90f0[_0xed85('0x14')]){if(_0x3d90f0[_0xed85('0x14')][_0xed85('0x15')]===0x1f4){logger[_0xed85('0x14')](_0xed85('0xf'),_0x246393,_0x3d90f0[_0xed85('0x14')]['message']);return _0x318f6e(_0x3d90f0[_0xed85('0x14')]['message']);}logger[_0xed85('0x14')](_0xed85('0xf'),_0x246393,_0x3d90f0[_0xed85('0x14')][_0xed85('0x16')]);return _0x2af0aa(_0x3d90f0[_0xed85('0x14')][_0xed85('0x16')]);}else{logger['info'](_0xed85('0xf'),_0x246393,'request\x20sent');_0x2af0aa(_0x3d90f0['result'][_0xed85('0x16')]);}})['catch'](function(_0x227d99){logger[_0xed85('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x246393,_0x227d99);_0x318f6e(_0x227d99);});});} \ No newline at end of file +var _0x5bda=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug'];(function(_0x101fe8,_0x20df0){var _0x2f5451=function(_0x2eb634){while(--_0x2eb634){_0x101fe8['push'](_0x101fe8['shift']());}};_0x2f5451(++_0x20df0);}(_0x5bda,0x1a9));var _0xa5bd=function(_0x389adb,_0x166f1c){_0x389adb=_0x389adb-0x0;var _0x59768e=_0x5bda[_0x389adb];return _0x59768e;};'use strict';var _=require(_0xa5bd('0x0'));var util=require(_0xa5bd('0x1'));var moment=require(_0xa5bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa5bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5bd('0x4'))['db'];var utils=require(_0xa5bd('0x5'));var logger=require(_0xa5bd('0x6'))(_0xa5bd('0x7'));var config=require(_0xa5bd('0x8'));var jayson=require(_0xa5bd('0x9'));var client=jayson['client'][_0xa5bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x179378,_0x4d2274,_0x13cf13){return new BPromise(function(_0x14ea9c,_0x2f3015){return client['request'](_0x179378,_0x13cf13)[_0xa5bd('0xb')](function(_0x11df57){logger[_0xa5bd('0xc')](_0xa5bd('0xd'),_0x4d2274,'request\x20sent');logger[_0xa5bd('0xe')](_0xa5bd('0xf'),_0x4d2274,_0xa5bd('0x10'),JSON[_0xa5bd('0x11')](_0x11df57));if(_0x11df57[_0xa5bd('0x12')]){if(_0x11df57[_0xa5bd('0x12')][_0xa5bd('0x13')]===0x1f4){logger[_0xa5bd('0x12')](_0xa5bd('0xd'),_0x4d2274,_0x11df57['error'][_0xa5bd('0x14')]);return _0x2f3015(_0x11df57[_0xa5bd('0x12')][_0xa5bd('0x14')]);}logger[_0xa5bd('0x12')](_0xa5bd('0xd'),_0x4d2274,_0x11df57[_0xa5bd('0x12')][_0xa5bd('0x14')]);return _0x14ea9c(_0x11df57[_0xa5bd('0x12')]['message']);}else{logger[_0xa5bd('0xc')](_0xa5bd('0xd'),_0x4d2274,_0xa5bd('0x10'));_0x14ea9c(_0x11df57[_0xa5bd('0x15')][_0xa5bd('0x14')]);}})['catch'](function(_0x1e1f9b){logger[_0xa5bd('0x12')](_0xa5bd('0xd'),_0x4d2274,_0x1e1f9b);_0x2f3015(_0x1e1f9b);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 89cca84..c4527c8 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 _0x4d61=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','post'];(function(_0x16b311,_0x4b9fc4){var _0x3b6ed6=function(_0x7ef815){while(--_0x7ef815){_0x16b311['push'](_0x16b311['shift']());}};_0x3b6ed6(++_0x4b9fc4);}(_0x4d61,0x147));var _0x14d6=function(_0x1e1f17,_0x4bd574){_0x1e1f17=_0x1e1f17-0x0;var _0x465b52=_0x4d61[_0x1e1f17];return _0x465b52;};'use strict';var multer=require(_0x14d6('0x0'));var util=require(_0x14d6('0x1'));var path=require(_0x14d6('0x2'));var timeout=require(_0x14d6('0x3'));var express=require(_0x14d6('0x4'));var router=express[_0x14d6('0x5')]();var fs_extra=require(_0x14d6('0x6'));var auth=require(_0x14d6('0x7'));var interaction=require(_0x14d6('0x8'));var config=require('../../config/environment');var controller=require(_0x14d6('0x9'));router[_0x14d6('0xa')]('/',auth[_0x14d6('0xb')](),controller[_0x14d6('0xc')]);router[_0x14d6('0xa')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller['show']);router[_0x14d6('0xe')]('/',auth['isAuthenticated'](),controller[_0x14d6('0xf')]);router['put'](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller['update']);router[_0x14d6('0x10')](_0x14d6('0xd'),auth[_0x14d6('0xb')](),controller[_0x14d6('0x11')]);module[_0x14d6('0x12')]=router; \ No newline at end of file +var _0xf2cf=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x184031,_0x20f2d9){var _0x1454f5=function(_0x2a094b){while(--_0x2a094b){_0x184031['push'](_0x184031['shift']());}};_0x1454f5(++_0x20f2d9);}(_0xf2cf,0xf5));var _0xff2c=function(_0x26dc33,_0x23c483){_0x26dc33=_0x26dc33-0x0;var _0x1bbee3=_0xf2cf[_0x26dc33];return _0x1bbee3;};'use strict';var multer=require('multer');var util=require(_0xff2c('0x0'));var path=require(_0xff2c('0x1'));var timeout=require(_0xff2c('0x2'));var express=require('express');var router=express[_0xff2c('0x3')]();var fs_extra=require(_0xff2c('0x4'));var auth=require(_0xff2c('0x5'));var interaction=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var controller=require(_0xff2c('0x8'));router['get']('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xa')]);router['get'](_0xff2c('0xb'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xc')]);router[_0xff2c('0xd')]('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xe')]);router[_0xff2c('0xf')]('/:id',auth[_0xff2c('0x9')](),controller[_0xff2c('0x10')]);router[_0xff2c('0x11')]('/:id',auth[_0xff2c('0x9')](),controller[_0xff2c('0x12')]);module[_0xff2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 70d8e79..af16b36 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 _0xaee8=['sequelize','TEXT'];(function(_0x5dd14e,_0xcc71c7){var _0x3a2cb5=function(_0x4e07b4){while(--_0x4e07b4){_0x5dd14e['push'](_0x5dd14e['shift']());}};_0x3a2cb5(++_0xcc71c7);}(_0xaee8,0xa0));var _0x8aee=function(_0x3300c7,_0x45a0b2){_0x3300c7=_0x3300c7-0x0;var _0x593d52=_0xaee8[_0x3300c7];return _0x593d52;};'use strict';var Sequelize=require(_0x8aee('0x0'));module['exports']={'tree':{'type':Sequelize[_0x8aee('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5169=['exports','TEXT'];(function(_0x17183b,_0x248dfb){var _0x2f6554=function(_0x374b57){while(--_0x374b57){_0x17183b['push'](_0x17183b['shift']());}};_0x2f6554(++_0x248dfb);}(_0x5169,0x180));var _0x9516=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x5169[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require('sequelize');module[_0x9516('0x0')]={'tree':{'type':Sequelize[_0x9516('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 86b1c43..dff2f18 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 _0x4fc7=['rows','params','rawAttributes','options','find','catch','create','body','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','includeAll','include','findAll'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x4fc7,0x1b2));var _0x74fc=function(_0xc83db2,_0x1ed130){_0xc83db2=_0xc83db2-0x0;var _0x384c3d=_0x4fc7[_0xc83db2];return _0x384c3d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x74fc('0x0'));var rp=require(_0x74fc('0x1'));var moment=require(_0x74fc('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x74fc('0x3'));var sox=require(_0x74fc('0x4'));var csv=require(_0x74fc('0x5'));var ejs=require(_0x74fc('0x6'));var fs=require('fs');var fs_extra=require(_0x74fc('0x7'));var _=require(_0x74fc('0x8'));var squel=require(_0x74fc('0x9'));var crypto=require(_0x74fc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x74fc('0xb'));var toCsv=require(_0x74fc('0x5'));var querystring=require(_0x74fc('0xc'));var Papa=require(_0x74fc('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x74fc('0xe'));var hardwareService=require(_0x74fc('0xf'));var logger=require(_0x74fc('0x10'))(_0x74fc('0x11'));var utils=require('../../config/utils');var config=require(_0x74fc('0x12'));var licenseUtil=require(_0x74fc('0x13'));var db=require(_0x74fc('0x14'))['db'];function respondWithStatusCode(_0x345b0d,_0x5b3579){_0x5b3579=_0x5b3579||0xcc;return function(_0x3eb275){if(_0x3eb275){return _0x345b0d[_0x74fc('0x15')](_0x5b3579);}return _0x345b0d[_0x74fc('0x16')](_0x5b3579)[_0x74fc('0x17')]();};}function respondWithResult(_0x7342be,_0x19618b){_0x19618b=_0x19618b||0xc8;return function(_0x3f7514){if(_0x3f7514){return _0x7342be['status'](_0x19618b)['json'](_0x3f7514);}};}function respondWithFilteredResult(_0x5755ee,_0x1382e3){return function(_0x5e0e34){if(_0x5e0e34){var _0x39392a=typeof _0x1382e3[_0x74fc('0x18')]==='undefined'&&typeof _0x1382e3[_0x74fc('0x19')]==='undefined';var _0x1f3e8f=_0x5e0e34[_0x74fc('0x1a')];var _0x443f42=_0x39392a?0x0:_0x1382e3['offset'];var _0x4ef92d=_0x39392a?_0x5e0e34[_0x74fc('0x1a')]:_0x1382e3[_0x74fc('0x18')]+_0x1382e3[_0x74fc('0x19')];var _0x140d20;if(_0x4ef92d>=_0x1f3e8f){_0x4ef92d=_0x1f3e8f;_0x140d20=0xc8;}else{_0x140d20=0xce;}_0x5755ee[_0x74fc('0x16')](_0x140d20);return _0x5755ee[_0x74fc('0x1b')]('Content-Range',_0x443f42+'-'+_0x4ef92d+'/'+_0x1f3e8f)['json'](_0x5e0e34);}return null;};}function patchUpdates(_0x2f0a6b){return function(_0x1a1650){try{jsonpatch[_0x74fc('0x1c')](_0x1a1650,_0x2f0a6b,!![]);}catch(_0x246d60){return BPromise[_0x74fc('0x1d')](_0x246d60);}return _0x1a1650[_0x74fc('0x1e')]();};}function saveUpdates(_0x3f0e5c,_0xb368be){return function(_0x16cb67){if(_0x16cb67){return _0x16cb67[_0x74fc('0x1f')](_0x3f0e5c)[_0x74fc('0x20')](function(_0x2c9783){return _0x2c9783;});}return null;};}function removeEntity(_0x251ffe,_0x412342){return function(_0xc48703){if(_0xc48703){return _0xc48703[_0x74fc('0x21')]()[_0x74fc('0x20')](function(){_0x251ffe['status'](0xcc)[_0x74fc('0x17')]();});}};}function handleEntityNotFound(_0x20d7cd,_0x12cdf4){return function(_0x138637){if(!_0x138637){_0x20d7cd[_0x74fc('0x15')](0x194);}return _0x138637;};}function handleError(_0x252230,_0x1fc2f8){_0x1fc2f8=_0x1fc2f8||0x1f4;return function(_0x3fb78b){logger[_0x74fc('0x22')](_0x3fb78b[_0x74fc('0x23')]);if(_0x3fb78b[_0x74fc('0x24')]){delete _0x3fb78b[_0x74fc('0x24')];}_0x252230[_0x74fc('0x16')](_0x1fc2f8)[_0x74fc('0x25')](_0x3fb78b);};}exports[_0x74fc('0x26')]=function(_0x5c096d,_0x23e566){var _0x28224d={},_0x4ba3a1={},_0x2c930a={'count':0x0,'rows':[]};var _0x219c75=_[_0x74fc('0x27')](db[_0x74fc('0x28')]['rawAttributes'],function(_0xde062a){return{'name':_0xde062a[_0x74fc('0x29')],'type':_0xde062a[_0x74fc('0x2a')][_0x74fc('0x2b')]};});_0x4ba3a1[_0x74fc('0x2c')]=_[_0x74fc('0x27')](_0x219c75,_0x74fc('0x24'));_0x4ba3a1[_0x74fc('0x2d')]=_[_0x74fc('0x2e')](_0x5c096d[_0x74fc('0x2d')]);_0x4ba3a1['filters']=_['intersection'](_0x4ba3a1[_0x74fc('0x2c')],_0x4ba3a1[_0x74fc('0x2d')]);_0x28224d[_0x74fc('0x2f')]=_[_0x74fc('0x30')](_0x4ba3a1[_0x74fc('0x2c')],qs['fields'](_0x5c096d[_0x74fc('0x2d')][_0x74fc('0x31')]));_0x28224d[_0x74fc('0x2f')]=_0x28224d[_0x74fc('0x2f')][_0x74fc('0x32')]?_0x28224d[_0x74fc('0x2f')]:_0x4ba3a1['model'];if(!_0x5c096d[_0x74fc('0x2d')][_0x74fc('0x33')](_0x74fc('0x34'))){_0x28224d['limit']=qs[_0x74fc('0x19')](_0x5c096d['query'][_0x74fc('0x19')]);_0x28224d['offset']=qs['offset'](_0x5c096d['query'][_0x74fc('0x18')]);}_0x28224d[_0x74fc('0x35')]=qs['sort'](_0x5c096d[_0x74fc('0x2d')][_0x74fc('0x36')]);_0x28224d[_0x74fc('0x37')]=qs[_0x74fc('0x38')](_[_0x74fc('0x39')](_0x5c096d[_0x74fc('0x2d')],_0x4ba3a1[_0x74fc('0x38')]),_0x219c75);if(_0x5c096d[_0x74fc('0x2d')]['filter']){_0x28224d[_0x74fc('0x37')]=_[_0x74fc('0x3a')](_0x28224d[_0x74fc('0x37')],{'$or':_[_0x74fc('0x27')](_0x219c75,function(_0x27b358){if(_0x27b358['type']!=='VIRTUAL'){var _0xdfefff={};_0xdfefff[_0x27b358['name']]={'$like':'%'+_0x5c096d[_0x74fc('0x2d')][_0x74fc('0x3b')]+'%'};return _0xdfefff;}})});}_0x28224d=_[_0x74fc('0x3a')]({},_0x28224d,_0x5c096d['options']);var _0x10a82b={'where':_0x28224d[_0x74fc('0x37')]};return db[_0x74fc('0x28')][_0x74fc('0x1a')](_0x10a82b)[_0x74fc('0x20')](function(_0x51a096){_0x2c930a['count']=_0x51a096;if(_0x5c096d[_0x74fc('0x2d')][_0x74fc('0x3c')]){_0x28224d[_0x74fc('0x3d')]=[{'all':!![]}];}return db[_0x74fc('0x28')][_0x74fc('0x3e')](_0x28224d);})[_0x74fc('0x20')](function(_0x16d869){_0x2c930a[_0x74fc('0x3f')]=_0x16d869;return _0x2c930a;})[_0x74fc('0x20')](respondWithFilteredResult(_0x23e566,_0x28224d))['catch'](handleError(_0x23e566,null));};exports['show']=function(_0x12066b,_0x4d6629){var _0x42e22b={'raw':!![],'where':{'id':_0x12066b[_0x74fc('0x40')]['id']}},_0x59c7f1={};_0x59c7f1[_0x74fc('0x2c')]=_[_0x74fc('0x2e')](db[_0x74fc('0x28')][_0x74fc('0x41')]);_0x59c7f1[_0x74fc('0x2d')]=_[_0x74fc('0x2e')](_0x12066b[_0x74fc('0x2d')]);_0x59c7f1[_0x74fc('0x38')]=_[_0x74fc('0x30')](_0x59c7f1[_0x74fc('0x2c')],_0x59c7f1['query']);_0x42e22b[_0x74fc('0x2f')]=_[_0x74fc('0x30')](_0x59c7f1[_0x74fc('0x2c')],qs[_0x74fc('0x31')](_0x12066b['query']['fields']));_0x42e22b[_0x74fc('0x2f')]=_0x42e22b['attributes']['length']?_0x42e22b[_0x74fc('0x2f')]:_0x59c7f1[_0x74fc('0x2c')];if(_0x12066b[_0x74fc('0x2d')][_0x74fc('0x3c')]){_0x42e22b[_0x74fc('0x3d')]=[{'all':!![]}];}_0x42e22b=_[_0x74fc('0x3a')]({},_0x42e22b,_0x12066b[_0x74fc('0x42')]);return db[_0x74fc('0x28')][_0x74fc('0x43')](_0x42e22b)[_0x74fc('0x20')](handleEntityNotFound(_0x4d6629,null))['then'](respondWithResult(_0x4d6629,null))[_0x74fc('0x44')](handleError(_0x4d6629,null));};exports[_0x74fc('0x45')]=function(_0x461bc5,_0x17547d){return db['AnalyticTreeReport'][_0x74fc('0x45')](_0x461bc5[_0x74fc('0x46')],{})['then'](respondWithResult(_0x17547d,0xc9))[_0x74fc('0x44')](handleError(_0x17547d,null));};exports[_0x74fc('0x1f')]=function(_0xe46099,_0x3f978b){if(_0xe46099[_0x74fc('0x46')]['id']){delete _0xe46099['body']['id'];}return db[_0x74fc('0x28')][_0x74fc('0x43')]({'where':{'id':_0xe46099[_0x74fc('0x40')]['id']}})[_0x74fc('0x20')](handleEntityNotFound(_0x3f978b,null))[_0x74fc('0x20')](saveUpdates(_0xe46099[_0x74fc('0x46')],null))[_0x74fc('0x20')](respondWithResult(_0x3f978b,null))['catch'](handleError(_0x3f978b,null));};exports[_0x74fc('0x21')]=function(_0x217465,_0x3f2e38){return db[_0x74fc('0x28')][_0x74fc('0x43')]({'where':{'id':_0x217465[_0x74fc('0x40')]['id']}})[_0x74fc('0x20')](handleEntityNotFound(_0x3f2e38,null))['then'](removeEntity(_0x3f2e38,null))[_0x74fc('0x44')](handleError(_0x3f2e38,null));}; \ No newline at end of file +var _0x67ca=['desk.js','to-csv','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','map','AnalyticTreeReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce'];(function(_0x199b64,_0x5d1120){var _0x42b220=function(_0x26d4e6){while(--_0x26d4e6){_0x199b64['push'](_0x199b64['shift']());}};_0x42b220(++_0x5d1120);}(_0x67ca,0x7b));var _0xa67c=function(_0x2694bb,_0x5602f7){_0x2694bb=_0x2694bb-0x0;var _0x4ea59f=_0x67ca[_0x2694bb];return _0x4ea59f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67c('0x0'));var zipdir=require(_0xa67c('0x1'));var jsonpatch=require(_0xa67c('0x2'));var rp=require(_0xa67c('0x3'));var moment=require('moment');var BPromise=require(_0xa67c('0x4'));var Mustache=require('mustache');var util=require(_0xa67c('0x5'));var path=require(_0xa67c('0x6'));var sox=require(_0xa67c('0x7'));var csv=require('to-csv');var ejs=require(_0xa67c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa67c('0x9'));var squel=require(_0xa67c('0xa'));var crypto=require(_0xa67c('0xb'));var jsforce=require(_0xa67c('0xc'));var deskjs=require(_0xa67c('0xd'));var toCsv=require(_0xa67c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa67c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa67c('0x10'))('api');var utils=require(_0xa67c('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa67c('0x12'));var db=require(_0xa67c('0x13'))['db'];function respondWithStatusCode(_0x5d8f4b,_0x9faf0a){_0x9faf0a=_0x9faf0a||0xcc;return function(_0x45c0bb){if(_0x45c0bb){return _0x5d8f4b[_0xa67c('0x14')](_0x9faf0a);}return _0x5d8f4b[_0xa67c('0x15')](_0x9faf0a)[_0xa67c('0x16')]();};}function respondWithResult(_0x16a73d,_0x671945){_0x671945=_0x671945||0xc8;return function(_0x3e7464){if(_0x3e7464){return _0x16a73d['status'](_0x671945)['json'](_0x3e7464);}};}function respondWithFilteredResult(_0x5aa28f,_0x4bdef4){return function(_0x26e818){if(_0x26e818){var _0x6ff018=typeof _0x4bdef4[_0xa67c('0x17')]===_0xa67c('0x18')&&typeof _0x4bdef4[_0xa67c('0x19')]==='undefined';var _0x1e0887=_0x26e818['count'];var _0x34f590=_0x6ff018?0x0:_0x4bdef4['offset'];var _0x5a3188=_0x6ff018?_0x26e818[_0xa67c('0x1a')]:_0x4bdef4[_0xa67c('0x17')]+_0x4bdef4[_0xa67c('0x19')];var _0x5409df;if(_0x5a3188>=_0x1e0887){_0x5a3188=_0x1e0887;_0x5409df=0xc8;}else{_0x5409df=0xce;}_0x5aa28f[_0xa67c('0x15')](_0x5409df);return _0x5aa28f[_0xa67c('0x1b')](_0xa67c('0x1c'),_0x34f590+'-'+_0x5a3188+'/'+_0x1e0887)[_0xa67c('0x1d')](_0x26e818);}return null;};}function patchUpdates(_0x2a3c71){return function(_0x5a9e48){try{jsonpatch[_0xa67c('0x1e')](_0x5a9e48,_0x2a3c71,!![]);}catch(_0x39621e){return BPromise[_0xa67c('0x1f')](_0x39621e);}return _0x5a9e48['save']();};}function saveUpdates(_0x427936,_0x5e2230){return function(_0x143dbd){if(_0x143dbd){return _0x143dbd['update'](_0x427936)[_0xa67c('0x20')](function(_0x11f813){return _0x11f813;});}return null;};}function removeEntity(_0xfefd64,_0x2e6fb5){return function(_0x358192){if(_0x358192){return _0x358192[_0xa67c('0x21')]()[_0xa67c('0x20')](function(){_0xfefd64[_0xa67c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b13b5,_0x356626){return function(_0x516893){if(!_0x516893){_0x5b13b5['sendStatus'](0x194);}return _0x516893;};}function handleError(_0x541cf9,_0xec104f){_0xec104f=_0xec104f||0x1f4;return function(_0x15c04a){logger['error'](_0x15c04a[_0xa67c('0x22')]);if(_0x15c04a[_0xa67c('0x23')]){delete _0x15c04a[_0xa67c('0x23')];}_0x541cf9[_0xa67c('0x15')](_0xec104f)['send'](_0x15c04a);};}exports[_0xa67c('0x24')]=function(_0x17a900,_0x36b7c1){var _0x3f31f1={},_0x184f30={},_0x24a734={'count':0x0,'rows':[]};var _0x286a5c=_[_0xa67c('0x25')](db[_0xa67c('0x26')]['rawAttributes'],function(_0x38904c){return{'name':_0x38904c['fieldName'],'type':_0x38904c[_0xa67c('0x27')][_0xa67c('0x28')]};});_0x184f30['model']=_['map'](_0x286a5c,_0xa67c('0x23'));_0x184f30[_0xa67c('0x29')]=_[_0xa67c('0x2a')](_0x17a900[_0xa67c('0x29')]);_0x184f30[_0xa67c('0x2b')]=_[_0xa67c('0x2c')](_0x184f30[_0xa67c('0x2d')],_0x184f30[_0xa67c('0x29')]);_0x3f31f1[_0xa67c('0x2e')]=_['intersection'](_0x184f30[_0xa67c('0x2d')],qs[_0xa67c('0x2f')](_0x17a900[_0xa67c('0x29')]['fields']));_0x3f31f1[_0xa67c('0x2e')]=_0x3f31f1[_0xa67c('0x2e')][_0xa67c('0x30')]?_0x3f31f1[_0xa67c('0x2e')]:_0x184f30[_0xa67c('0x2d')];if(!_0x17a900[_0xa67c('0x29')][_0xa67c('0x31')](_0xa67c('0x32'))){_0x3f31f1[_0xa67c('0x19')]=qs['limit'](_0x17a900['query']['limit']);_0x3f31f1['offset']=qs[_0xa67c('0x17')](_0x17a900['query'][_0xa67c('0x17')]);}_0x3f31f1['order']=qs[_0xa67c('0x33')](_0x17a900[_0xa67c('0x29')][_0xa67c('0x33')]);_0x3f31f1['where']=qs['filters'](_[_0xa67c('0x34')](_0x17a900[_0xa67c('0x29')],_0x184f30[_0xa67c('0x2b')]),_0x286a5c);if(_0x17a900[_0xa67c('0x29')][_0xa67c('0x35')]){_0x3f31f1[_0xa67c('0x36')]=_['merge'](_0x3f31f1['where'],{'$or':_['map'](_0x286a5c,function(_0x53d571){if(_0x53d571[_0xa67c('0x27')]!=='VIRTUAL'){var _0x4af30e={};_0x4af30e[_0x53d571[_0xa67c('0x23')]]={'$like':'%'+_0x17a900['query'][_0xa67c('0x35')]+'%'};return _0x4af30e;}})});}_0x3f31f1=_[_0xa67c('0x37')]({},_0x3f31f1,_0x17a900['options']);var _0xc1dae2={'where':_0x3f31f1[_0xa67c('0x36')]};return db[_0xa67c('0x26')]['count'](_0xc1dae2)[_0xa67c('0x20')](function(_0x1843a8){_0x24a734[_0xa67c('0x1a')]=_0x1843a8;if(_0x17a900[_0xa67c('0x29')][_0xa67c('0x38')]){_0x3f31f1[_0xa67c('0x39')]=[{'all':!![]}];}return db[_0xa67c('0x26')][_0xa67c('0x3a')](_0x3f31f1);})[_0xa67c('0x20')](function(_0x55135e){_0x24a734[_0xa67c('0x3b')]=_0x55135e;return _0x24a734;})['then'](respondWithFilteredResult(_0x36b7c1,_0x3f31f1))[_0xa67c('0x3c')](handleError(_0x36b7c1,null));};exports[_0xa67c('0x3d')]=function(_0x428dc0,_0x3f9915){var _0x5f5c42={'raw':!![],'where':{'id':_0x428dc0[_0xa67c('0x3e')]['id']}},_0x1f0f3={};_0x1f0f3[_0xa67c('0x2d')]=_['keys'](db[_0xa67c('0x26')]['rawAttributes']);_0x1f0f3[_0xa67c('0x29')]=_[_0xa67c('0x2a')](_0x428dc0[_0xa67c('0x29')]);_0x1f0f3['filters']=_['intersection'](_0x1f0f3[_0xa67c('0x2d')],_0x1f0f3[_0xa67c('0x29')]);_0x5f5c42['attributes']=_[_0xa67c('0x2c')](_0x1f0f3[_0xa67c('0x2d')],qs[_0xa67c('0x2f')](_0x428dc0[_0xa67c('0x29')]['fields']));_0x5f5c42['attributes']=_0x5f5c42['attributes'][_0xa67c('0x30')]?_0x5f5c42['attributes']:_0x1f0f3['model'];if(_0x428dc0['query'][_0xa67c('0x38')]){_0x5f5c42['include']=[{'all':!![]}];}_0x5f5c42=_['merge']({},_0x5f5c42,_0x428dc0[_0xa67c('0x3f')]);return db[_0xa67c('0x26')][_0xa67c('0x40')](_0x5f5c42)[_0xa67c('0x20')](handleEntityNotFound(_0x3f9915,null))[_0xa67c('0x20')](respondWithResult(_0x3f9915,null))[_0xa67c('0x3c')](handleError(_0x3f9915,null));};exports[_0xa67c('0x41')]=function(_0x47776a,_0x4e4792){return db[_0xa67c('0x26')][_0xa67c('0x41')](_0x47776a[_0xa67c('0x42')],{})['then'](respondWithResult(_0x4e4792,0xc9))[_0xa67c('0x3c')](handleError(_0x4e4792,null));};exports[_0xa67c('0x43')]=function(_0x822651,_0x4fb8b7){if(_0x822651[_0xa67c('0x42')]['id']){delete _0x822651[_0xa67c('0x42')]['id'];}return db[_0xa67c('0x26')][_0xa67c('0x40')]({'where':{'id':_0x822651[_0xa67c('0x3e')]['id']}})[_0xa67c('0x20')](handleEntityNotFound(_0x4fb8b7,null))['then'](saveUpdates(_0x822651[_0xa67c('0x42')],null))['then'](respondWithResult(_0x4fb8b7,null))['catch'](handleError(_0x4fb8b7,null));};exports[_0xa67c('0x21')]=function(_0x4558cd,_0x4e559a){return db[_0xa67c('0x26')][_0xa67c('0x40')]({'where':{'id':_0x4558cd[_0xa67c('0x3e')]['id']}})[_0xa67c('0x20')](handleEntityNotFound(_0x4e559a,null))[_0xa67c('0x20')](removeEntity(_0x4e559a,null))[_0xa67c('0x3c')](handleError(_0x4e559a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index a1dd028..4698cb1 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 _0xfbcb=['api','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util'];(function(_0x263965,_0x1167b8){var _0x50ecac=function(_0x4ff360){while(--_0x4ff360){_0x263965['push'](_0x263965['shift']());}};_0x50ecac(++_0x1167b8);}(_0xfbcb,0xf1));var _0xbfbc=function(_0xa14da4,_0x5344a0){_0xa14da4=_0xa14da4-0x0;var _0x4dc5f1=_0xfbcb[_0xa14da4];return _0x4dc5f1;};'use strict';var _=require('lodash');var util=require(_0xbfbc('0x0'));var logger=require('../../config/logger')(_0xbfbc('0x1'));var moment=require('moment');var BPromise=require(_0xbfbc('0x2'));var rp=require(_0xbfbc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfbc('0x4'));var config=require(_0xbfbc('0x5'));var attributes=require(_0xbfbc('0x6'));module[_0xbfbc('0x7')]=function(_0x504fdb,_0x208850){return _0x504fdb[_0xbfbc('0x8')](_0xbfbc('0x9'),attributes,{'tableName':_0xbfbc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda30=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xda30,0x185));var _0x0da3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xda30[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x0da3('0x0'));var util=require(_0x0da3('0x1'));var logger=require(_0x0da3('0x2'))(_0x0da3('0x3'));var moment=require(_0x0da3('0x4'));var BPromise=require(_0x0da3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0da3('0x6'));var config=require(_0x0da3('0x7'));var attributes=require(_0x0da3('0x8'));module[_0x0da3('0x9')]=function(_0x420487,_0x453412){return _0x420487[_0x0da3('0xa')](_0x0da3('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 9ba9e30..2c2d23b 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5a5dc6,_0x1ad6dd){var _0x4c47b9=function(_0x550e62){while(--_0x550e62){_0x5a5dc6['push'](_0x5a5dc6['shift']());}};_0x4c47b9(++_0x1ad6dd);}(_0xadb5,0xad));var _0x5adb=function(_0x5e0ecc,_0x9323b3){_0x5e0ecc=_0x5e0ecc-0x0;var _0x569650=_0xadb5[_0x5e0ecc];return _0x569650;};'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']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x58b335,_0x3ab857){var _0x397f5c=function(_0x2f2d96){while(--_0x2f2d96){_0x58b335['push'](_0x58b335['shift']());}};_0x397f5c(++_0x3ab857);}(_0xdb28,0x106));var _0x8db2=function(_0x1fc614,_0x1001cf){_0x1fc614=_0x1fc614-0x0;var _0x44f2c6=_0xdb28[_0x1fc614];return _0x44f2c6;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e90dd9c..f966ffe 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 _0x9167=['show','create','update','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0x9167,0x1b8));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7916('0x0'));var timeout=require('connect-timeout');var express=require(_0x7916('0x1'));var router=express[_0x7916('0x2')]();var fs_extra=require(_0x7916('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7916('0x4'));var config=require(_0x7916('0x5'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7916('0x6')]);router[_0x7916('0x7')](_0x7916('0x8'),auth[_0x7916('0x9')](),controller[_0x7916('0xa')]);router['post']('/',auth[_0x7916('0x9')](),controller[_0x7916('0xb')]);router['put']('/:id',auth[_0x7916('0x9')](),controller[_0x7916('0xc')]);router['delete']('/:id',auth[_0x7916('0x9')](),controller[_0x7916('0xd')]);module[_0x7916('0xe')]=router; \ No newline at end of file +var _0x7192=['Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x491884,_0x3bc8d5){var _0x45c4ae=function(_0x3ccf86){while(--_0x3ccf86){_0x491884['push'](_0x491884['shift']());}};_0x45c4ae(++_0x3bc8d5);}(_0x7192,0xcd));var _0x2719=function(_0x5eecba,_0xf00f05){_0x5eecba=_0x5eecba-0x0;var _0x4cd68e=_0x7192[_0x5eecba];return _0x4cd68e;};'use strict';var multer=require(_0x2719('0x0'));var util=require(_0x2719('0x1'));var path=require('path');var timeout=require(_0x2719('0x2'));var express=require(_0x2719('0x3'));var router=express[_0x2719('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2719('0x5'));var interaction=require(_0x2719('0x6'));var config=require('../../config/environment');var controller=require(_0x2719('0x7'));router[_0x2719('0x8')]('/',auth[_0x2719('0x9')](),controller[_0x2719('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2719('0xb')]);router[_0x2719('0xc')]('/',auth['isAuthenticated'](),controller[_0x2719('0xd')]);router[_0x2719('0xe')](_0x2719('0xf'),auth['isAuthenticated'](),controller[_0x2719('0x10')]);router[_0x2719('0x11')](_0x2719('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x2719('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c0fbfc7..5136e3a 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 _0xd691=['exports','STRING','sequelize'];(function(_0x326c48,_0x31eee6){var _0xf71bc5=function(_0x391b95){while(--_0x391b95){_0x326c48['push'](_0x326c48['shift']());}};_0xf71bc5(++_0x31eee6);}(_0xd691,0xe6));var _0x1d69=function(_0x280438,_0x1a2b94){_0x280438=_0x280438-0x0;var _0x26c9d6=_0xd691[_0x280438];return _0x26c9d6;};'use strict';var Sequelize=require(_0x1d69('0x0'));module[_0x1d69('0x1')]={'name':{'type':Sequelize[_0x1d69('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1d69('0x2')]}}; \ No newline at end of file +var _0x6ec9=['sequelize','STRING'];(function(_0x3938f5,_0x5e3784){var _0x539996=function(_0x5ee4da){while(--_0x5ee4da){_0x3938f5['push'](_0x3938f5['shift']());}};_0x539996(++_0x5e3784);}(_0x6ec9,0x174));var _0x96ec=function(_0x2b6f99,_0x31128e){_0x2b6f99=_0x2b6f99-0x0;var _0x2c55c2=_0x6ec9[_0x2b6f99];return _0x2c55c2;};'use strict';var Sequelize=require(_0x96ec('0x0'));module['exports']={'name':{'type':Sequelize[_0x96ec('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x96ec('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index ea9fd3c..f3dbbbf 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 _0xa2e0=['send','Attachment','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','rows','catch','show','params','keys','includeAll','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','filename','file','mimetype','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','name'];(function(_0x2bfc73,_0x4b5079){var _0x4c88a9=function(_0x5e87d5){while(--_0x5e87d5){_0x2bfc73['push'](_0x2bfc73['shift']());}};_0x4c88a9(++_0x4b5079);}(_0xa2e0,0xde));var _0x0a2e=function(_0x2ae0ec,_0x1c8bea){_0x2ae0ec=_0x2ae0ec-0x0;var _0x5f1592=_0xa2e0[_0x2ae0ec];return _0x5f1592;};'use strict';var emlformat=require(_0x0a2e('0x0'));var rimraf=require(_0x0a2e('0x1'));var zipdir=require(_0x0a2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a2e('0x3'));var moment=require(_0x0a2e('0x4'));var BPromise=require(_0x0a2e('0x5'));var Mustache=require(_0x0a2e('0x6'));var util=require(_0x0a2e('0x7'));var path=require(_0x0a2e('0x8'));var sox=require('sox');var csv=require(_0x0a2e('0x9'));var ejs=require(_0x0a2e('0xa'));var fs=require('fs');var fs_extra=require(_0x0a2e('0xb'));var _=require('lodash');var squel=require(_0x0a2e('0xc'));var crypto=require(_0x0a2e('0xd'));var jsforce=require(_0x0a2e('0xe'));var deskjs=require(_0x0a2e('0xf'));var toCsv=require(_0x0a2e('0x9'));var querystring=require(_0x0a2e('0x10'));var Papa=require(_0x0a2e('0x11'));var Redis=require('ioredis');var authService=require(_0x0a2e('0x12'));var qs=require(_0x0a2e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a2e('0x14'));var logger=require(_0x0a2e('0x15'))(_0x0a2e('0x16'));var utils=require(_0x0a2e('0x17'));var config=require(_0x0a2e('0x18'));var licenseUtil=require(_0x0a2e('0x19'));var db=require(_0x0a2e('0x1a'))['db'];function respondWithStatusCode(_0x216316,_0x3985bc){_0x3985bc=_0x3985bc||0xcc;return function(_0x573a4f){if(_0x573a4f){return _0x216316[_0x0a2e('0x1b')](_0x3985bc);}return _0x216316['status'](_0x3985bc)['end']();};}function respondWithResult(_0x3a5b59,_0x4003b7){_0x4003b7=_0x4003b7||0xc8;return function(_0x3da0fc){if(_0x3da0fc){return _0x3a5b59[_0x0a2e('0x1c')](_0x4003b7)[_0x0a2e('0x1d')](_0x3da0fc);}};}function respondWithFilteredResult(_0x3ff605,_0x51319f){return function(_0x30d625){if(_0x30d625){var _0x48eaf7=typeof _0x51319f[_0x0a2e('0x1e')]===_0x0a2e('0x1f')&&typeof _0x51319f['limit']==='undefined';var _0x48c2d4=_0x30d625['count'];var _0x3b8867=_0x48eaf7?0x0:_0x51319f[_0x0a2e('0x1e')];var _0x204895=_0x48eaf7?_0x30d625[_0x0a2e('0x20')]:_0x51319f[_0x0a2e('0x1e')]+_0x51319f[_0x0a2e('0x21')];var _0x56b613;if(_0x204895>=_0x48c2d4){_0x204895=_0x48c2d4;_0x56b613=0xc8;}else{_0x56b613=0xce;}_0x3ff605['status'](_0x56b613);return _0x3ff605['set']('Content-Range',_0x3b8867+'-'+_0x204895+'/'+_0x48c2d4)[_0x0a2e('0x1d')](_0x30d625);}return null;};}function patchUpdates(_0x3e5dd9){return function(_0x3ae22b){try{jsonpatch[_0x0a2e('0x22')](_0x3ae22b,_0x3e5dd9,!![]);}catch(_0x24f86e){return BPromise[_0x0a2e('0x23')](_0x24f86e);}return _0x3ae22b[_0x0a2e('0x24')]();};}function saveUpdates(_0x3d2a87,_0x12c1ac){return function(_0x2b713f){if(_0x2b713f){return _0x2b713f[_0x0a2e('0x25')](_0x3d2a87)[_0x0a2e('0x26')](function(_0x1a2ff4){return _0x1a2ff4;});}return null;};}function removeEntity(_0x10a284,_0x4c78e7){return function(_0x5d9e1c){if(_0x5d9e1c){return _0x5d9e1c[_0x0a2e('0x27')]()[_0x0a2e('0x26')](function(){_0x10a284[_0x0a2e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x526b19,_0x3814f5){return function(_0x568edc){if(!_0x568edc){_0x526b19[_0x0a2e('0x1b')](0x194);}return _0x568edc;};}function handleError(_0x1d8d41,_0x247539){_0x247539=_0x247539||0x1f4;return function(_0x501381){logger[_0x0a2e('0x28')](_0x501381['stack']);if(_0x501381[_0x0a2e('0x29')]){delete _0x501381[_0x0a2e('0x29')];}_0x1d8d41['status'](_0x247539)[_0x0a2e('0x2a')](_0x501381);};}exports['index']=function(_0x5994e2,_0x294735){var _0x2172fc={},_0x4ff44c={},_0x570174={'count':0x0,'rows':[]};var _0x40a72e=_['map'](db[_0x0a2e('0x2b')][_0x0a2e('0x2c')],function(_0x22107b){return{'name':_0x22107b['fieldName'],'type':_0x22107b[_0x0a2e('0x2d')][_0x0a2e('0x2e')]};});_0x4ff44c['model']=_['map'](_0x40a72e,_0x0a2e('0x29'));_0x4ff44c[_0x0a2e('0x2f')]=_['keys'](_0x5994e2['query']);_0x4ff44c[_0x0a2e('0x30')]=_['intersection'](_0x4ff44c[_0x0a2e('0x31')],_0x4ff44c[_0x0a2e('0x2f')]);_0x2172fc[_0x0a2e('0x32')]=_[_0x0a2e('0x33')](_0x4ff44c[_0x0a2e('0x31')],qs['fields'](_0x5994e2[_0x0a2e('0x2f')][_0x0a2e('0x34')]));_0x2172fc[_0x0a2e('0x32')]=_0x2172fc[_0x0a2e('0x32')][_0x0a2e('0x35')]?_0x2172fc[_0x0a2e('0x32')]:_0x4ff44c[_0x0a2e('0x31')];if(!_0x5994e2[_0x0a2e('0x2f')]['hasOwnProperty']('nolimit')){_0x2172fc[_0x0a2e('0x21')]=qs['limit'](_0x5994e2[_0x0a2e('0x2f')][_0x0a2e('0x21')]);_0x2172fc[_0x0a2e('0x1e')]=qs['offset'](_0x5994e2[_0x0a2e('0x2f')][_0x0a2e('0x1e')]);}_0x2172fc[_0x0a2e('0x36')]=qs['sort'](_0x5994e2[_0x0a2e('0x2f')][_0x0a2e('0x37')]);_0x2172fc[_0x0a2e('0x38')]=qs[_0x0a2e('0x30')](_[_0x0a2e('0x39')](_0x5994e2[_0x0a2e('0x2f')],_0x4ff44c[_0x0a2e('0x30')]),_0x40a72e);if(_0x5994e2[_0x0a2e('0x2f')][_0x0a2e('0x3a')]){_0x2172fc[_0x0a2e('0x38')]=_['merge'](_0x2172fc['where'],{'$or':_[_0x0a2e('0x3b')](_0x40a72e,function(_0x48f1ec){if(_0x48f1ec[_0x0a2e('0x2d')]!==_0x0a2e('0x3c')){var _0x185fae={};_0x185fae[_0x48f1ec[_0x0a2e('0x29')]]={'$like':'%'+_0x5994e2[_0x0a2e('0x2f')]['filter']+'%'};return _0x185fae;}})});}_0x2172fc=_[_0x0a2e('0x3d')]({},_0x2172fc,_0x5994e2[_0x0a2e('0x3e')]);var _0x500d56={'where':_0x2172fc['where']};return db[_0x0a2e('0x2b')][_0x0a2e('0x20')](_0x500d56)[_0x0a2e('0x26')](function(_0x9f37b0){_0x570174[_0x0a2e('0x20')]=_0x9f37b0;if(_0x5994e2[_0x0a2e('0x2f')]['includeAll']){_0x2172fc[_0x0a2e('0x3f')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x2172fc);})[_0x0a2e('0x26')](function(_0x10c025){_0x570174[_0x0a2e('0x40')]=_0x10c025;return _0x570174;})[_0x0a2e('0x26')](respondWithFilteredResult(_0x294735,_0x2172fc))[_0x0a2e('0x41')](handleError(_0x294735,null));};exports[_0x0a2e('0x42')]=function(_0x21b4eb,_0x335a5c){var _0x2baa5c={'raw':!![],'where':{'id':_0x21b4eb[_0x0a2e('0x43')]['id']}},_0x2ff1a1={};_0x2ff1a1['model']=_[_0x0a2e('0x44')](db[_0x0a2e('0x2b')][_0x0a2e('0x2c')]);_0x2ff1a1[_0x0a2e('0x2f')]=_[_0x0a2e('0x44')](_0x21b4eb[_0x0a2e('0x2f')]);_0x2ff1a1[_0x0a2e('0x30')]=_[_0x0a2e('0x33')](_0x2ff1a1['model'],_0x2ff1a1[_0x0a2e('0x2f')]);_0x2baa5c[_0x0a2e('0x32')]=_[_0x0a2e('0x33')](_0x2ff1a1[_0x0a2e('0x31')],qs[_0x0a2e('0x34')](_0x21b4eb[_0x0a2e('0x2f')][_0x0a2e('0x34')]));_0x2baa5c['attributes']=_0x2baa5c[_0x0a2e('0x32')][_0x0a2e('0x35')]?_0x2baa5c[_0x0a2e('0x32')]:_0x2ff1a1['model'];if(_0x21b4eb[_0x0a2e('0x2f')][_0x0a2e('0x45')]){_0x2baa5c[_0x0a2e('0x3f')]=[{'all':!![]}];}_0x2baa5c=_[_0x0a2e('0x3d')]({},_0x2baa5c,_0x21b4eb['options']);return db[_0x0a2e('0x2b')][_0x0a2e('0x46')](_0x2baa5c)[_0x0a2e('0x26')](handleEntityNotFound(_0x335a5c,null))['then'](respondWithResult(_0x335a5c,null))[_0x0a2e('0x41')](handleError(_0x335a5c,null));};exports[_0x0a2e('0x47')]=function(_0x5097cc,_0x3c1601){var _0x3ff6ad={'where':{'id':_0x5097cc[_0x0a2e('0x43')]['id']}},_0x5c8e3d={};_0x5c8e3d[_0x0a2e('0x31')]=_[_0x0a2e('0x44')](db[_0x0a2e('0x2b')]['rawAttributes']);_0x3ff6ad['attributes']=_['intersection'](_0x5c8e3d['model'],qs[_0x0a2e('0x34')](_0x5097cc[_0x0a2e('0x2f')][_0x0a2e('0x34')]));_0x3ff6ad[_0x0a2e('0x32')]=_0x3ff6ad[_0x0a2e('0x32')][_0x0a2e('0x35')]?_0x3ff6ad[_0x0a2e('0x32')]:_0x5c8e3d[_0x0a2e('0x31')];if(_0x5097cc[_0x0a2e('0x2f')][_0x0a2e('0x45')]){_0x3ff6ad[_0x0a2e('0x3f')]=[{'all':!![]}];}_0x3ff6ad=_[_0x0a2e('0x3d')]({},_0x3ff6ad,_0x5097cc[_0x0a2e('0x3e')]);return db[_0x0a2e('0x2b')][_0x0a2e('0x46')](_0x3ff6ad)[_0x0a2e('0x26')](handleEntityNotFound(_0x3c1601,null))[_0x0a2e('0x26')](function(_0x1ede7a){if(_0x1ede7a){var _0xeae078=_0x1ede7a[_0x0a2e('0x48')]({'plain':!![]});_0xeae078=qs[_0x0a2e('0x49')](_0xeae078,['id',_0x0a2e('0x4a'),_0x0a2e('0x4b')]);_0x5097cc[_0x0a2e('0x4c')]=_['omit'](_0x5097cc['body'],['id',_0x0a2e('0x4a'),_0x0a2e('0x4b')]);return db[_0x0a2e('0x2b')][_0x0a2e('0x4d')](_[_0x0a2e('0x3d')](_0xeae078,_0x5097cc['body']),{'include':_0x5097cc['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x0a2e('0x26')](respondWithResult(_0x3c1601,0xc9))[_0x0a2e('0x41')](handleError(_0x3c1601,null));};exports['update']=function(_0x5a1023,_0x19c62c){if(_0x5a1023['body']['id']){delete _0x5a1023[_0x0a2e('0x4c')]['id'];}return db[_0x0a2e('0x2b')][_0x0a2e('0x46')]({'where':{'id':_0x5a1023[_0x0a2e('0x43')]['id']}})[_0x0a2e('0x26')](handleEntityNotFound(_0x19c62c,null))[_0x0a2e('0x26')](saveUpdates(_0x5a1023[_0x0a2e('0x4c')],null))[_0x0a2e('0x26')](respondWithResult(_0x19c62c,null))['catch'](handleError(_0x19c62c,null));};exports['destroy']=function(_0xacf370,_0x16f789){return db[_0x0a2e('0x2b')]['find']({'where':{'id':_0xacf370[_0x0a2e('0x43')]['id']}})['then'](handleEntityNotFound(_0x16f789,null))[_0x0a2e('0x26')](removeEntity(_0x16f789,null))[_0x0a2e('0x41')](handleError(_0x16f789,null));};exports[_0x0a2e('0x4d')]=function(_0x55d1e2,_0x2a937c,_0x284687){_0x55d1e2[_0x0a2e('0x4c')][_0x0a2e('0x29')]=_0x55d1e2['file'][_0x0a2e('0x4e')];_0x55d1e2['body'][_0x0a2e('0x4f')]=_0x55d1e2['file'][_0x0a2e('0x50')];_0x55d1e2[_0x0a2e('0x4c')]['type']=_0x55d1e2[_0x0a2e('0x51')][_0x0a2e('0x52')];return db[_0x0a2e('0x2b')][_0x0a2e('0x4d')](_0x55d1e2[_0x0a2e('0x4c')])[_0x0a2e('0x26')](respondWithResult(_0x2a937c,0xc9))[_0x0a2e('0x41')](handleError(_0x2a937c,null));};exports[_0x0a2e('0x53')]=function(_0x5d7c31,_0xcf2c3a,_0x529533){return db['Attachment'][_0x0a2e('0x54')]({'where':{'id':_0x5d7c31['params']['id']},'raw':!![]})[_0x0a2e('0x26')](handleEntityNotFound(_0xcf2c3a,null))[_0x0a2e('0x26')](function(_0x40d9ad){if(_0x40d9ad){var _0x13f804=_0x40d9ad['ChatOfflineMessageId']!==null;var _0x11a713=path[_0x0a2e('0x55')](config[_0x0a2e('0x56')],_0x0a2e('0x57'));if(_0x13f804){_0x11a713=path['join'](_0x11a713,'offline-chat/');}var _0x5881d0=path['join'](_0x11a713,_0x40d9ad['basename']);return _0xcf2c3a[_0x0a2e('0x53')](_0x5881d0);}})[_0x0a2e('0x41')](handleError(_0xcf2c3a,null));}; \ No newline at end of file +var _0xc872=['order','sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','catch','clone','keys','Attachment','omit','updatedAt','body','create','update','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','root','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','name','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit'];(function(_0x4c99ee,_0x2d8768){var _0x24bc5f=function(_0x9b00c1){while(--_0x9b00c1){_0x4c99ee['push'](_0x4c99ee['shift']());}};_0x24bc5f(++_0x2d8768);}(_0xc872,0xcc));var _0x2c87=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0xc872[_0x5235a6];return _0x1cf37e;};'use strict';var emlformat=require(_0x2c87('0x0'));var rimraf=require(_0x2c87('0x1'));var zipdir=require(_0x2c87('0x2'));var jsonpatch=require(_0x2c87('0x3'));var rp=require(_0x2c87('0x4'));var moment=require('moment');var BPromise=require(_0x2c87('0x5'));var Mustache=require(_0x2c87('0x6'));var util=require(_0x2c87('0x7'));var path=require(_0x2c87('0x8'));var sox=require(_0x2c87('0x9'));var csv=require('to-csv');var ejs=require(_0x2c87('0xa'));var fs=require('fs');var fs_extra=require(_0x2c87('0xb'));var _=require('lodash');var squel=require(_0x2c87('0xc'));var crypto=require(_0x2c87('0xd'));var jsforce=require(_0x2c87('0xe'));var deskjs=require(_0x2c87('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2c87('0x10'));var Papa=require(_0x2c87('0x11'));var Redis=require(_0x2c87('0x12'));var authService=require(_0x2c87('0x13'));var qs=require(_0x2c87('0x14'));var as=require(_0x2c87('0x15'));var hardwareService=require(_0x2c87('0x16'));var logger=require(_0x2c87('0x17'))(_0x2c87('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c87('0x19'))['db'];function respondWithStatusCode(_0x33f50f,_0xdd4f89){_0xdd4f89=_0xdd4f89||0xcc;return function(_0x567bb4){if(_0x567bb4){return _0x33f50f[_0x2c87('0x1a')](_0xdd4f89);}return _0x33f50f[_0x2c87('0x1b')](_0xdd4f89)[_0x2c87('0x1c')]();};}function respondWithResult(_0x2d2745,_0x11efe0){_0x11efe0=_0x11efe0||0xc8;return function(_0x171c86){if(_0x171c86){return _0x2d2745[_0x2c87('0x1b')](_0x11efe0)[_0x2c87('0x1d')](_0x171c86);}};}function respondWithFilteredResult(_0x170f70,_0x164da8){return function(_0x2cee2c){if(_0x2cee2c){var _0x5922b0=typeof _0x164da8[_0x2c87('0x1e')]===_0x2c87('0x1f')&&typeof _0x164da8[_0x2c87('0x20')]===_0x2c87('0x1f');var _0x2ccebf=_0x2cee2c[_0x2c87('0x21')];var _0x204d61=_0x5922b0?0x0:_0x164da8[_0x2c87('0x1e')];var _0x323f17=_0x5922b0?_0x2cee2c[_0x2c87('0x21')]:_0x164da8['offset']+_0x164da8[_0x2c87('0x20')];var _0x211f1e;if(_0x323f17>=_0x2ccebf){_0x323f17=_0x2ccebf;_0x211f1e=0xc8;}else{_0x211f1e=0xce;}_0x170f70[_0x2c87('0x1b')](_0x211f1e);return _0x170f70[_0x2c87('0x22')]('Content-Range',_0x204d61+'-'+_0x323f17+'/'+_0x2ccebf)['json'](_0x2cee2c);}return null;};}function patchUpdates(_0x4225d9){return function(_0x40b2a7){try{jsonpatch['apply'](_0x40b2a7,_0x4225d9,!![]);}catch(_0x5e028b){return BPromise[_0x2c87('0x23')](_0x5e028b);}return _0x40b2a7[_0x2c87('0x24')]();};}function saveUpdates(_0x3086c5,_0x15ea79){return function(_0x28a3b5){if(_0x28a3b5){return _0x28a3b5['update'](_0x3086c5)[_0x2c87('0x25')](function(_0x476e6a){return _0x476e6a;});}return null;};}function removeEntity(_0x3ae760,_0x248555){return function(_0xa9c67c){if(_0xa9c67c){return _0xa9c67c[_0x2c87('0x26')]()[_0x2c87('0x25')](function(){_0x3ae760[_0x2c87('0x1b')](0xcc)[_0x2c87('0x1c')]();});}};}function handleEntityNotFound(_0x4d9236,_0x228ec9){return function(_0x8c2cd3){if(!_0x8c2cd3){_0x4d9236[_0x2c87('0x1a')](0x194);}return _0x8c2cd3;};}function handleError(_0xf9314d,_0x26b892){_0x26b892=_0x26b892||0x1f4;return function(_0x251bf3){logger[_0x2c87('0x27')](_0x251bf3['stack']);if(_0x251bf3['name']){delete _0x251bf3[_0x2c87('0x28')];}_0xf9314d[_0x2c87('0x1b')](_0x26b892)['send'](_0x251bf3);};}exports['index']=function(_0xbd1186,_0x57f118){var _0x1bfd5a={},_0x233ce9={},_0x4ac401={'count':0x0,'rows':[]};var _0x5dc069=_['map'](db['Attachment'][_0x2c87('0x29')],function(_0x34807d){return{'name':_0x34807d[_0x2c87('0x2a')],'type':_0x34807d[_0x2c87('0x2b')][_0x2c87('0x2c')]};});_0x233ce9[_0x2c87('0x2d')]=_[_0x2c87('0x2e')](_0x5dc069,_0x2c87('0x28'));_0x233ce9[_0x2c87('0x2f')]=_['keys'](_0xbd1186[_0x2c87('0x2f')]);_0x233ce9[_0x2c87('0x30')]=_['intersection'](_0x233ce9['model'],_0x233ce9[_0x2c87('0x2f')]);_0x1bfd5a[_0x2c87('0x31')]=_[_0x2c87('0x32')](_0x233ce9[_0x2c87('0x2d')],qs[_0x2c87('0x33')](_0xbd1186[_0x2c87('0x2f')]['fields']));_0x1bfd5a['attributes']=_0x1bfd5a[_0x2c87('0x31')][_0x2c87('0x34')]?_0x1bfd5a[_0x2c87('0x31')]:_0x233ce9[_0x2c87('0x2d')];if(!_0xbd1186[_0x2c87('0x2f')]['hasOwnProperty'](_0x2c87('0x35'))){_0x1bfd5a['limit']=qs[_0x2c87('0x20')](_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x20')]);_0x1bfd5a[_0x2c87('0x1e')]=qs[_0x2c87('0x1e')](_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x1e')]);}_0x1bfd5a[_0x2c87('0x36')]=qs['sort'](_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x37')]);_0x1bfd5a['where']=qs[_0x2c87('0x30')](_['pick'](_0xbd1186[_0x2c87('0x2f')],_0x233ce9[_0x2c87('0x30')]),_0x5dc069);if(_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x38')]){_0x1bfd5a[_0x2c87('0x39')]=_['merge'](_0x1bfd5a[_0x2c87('0x39')],{'$or':_[_0x2c87('0x2e')](_0x5dc069,function(_0x4ddc7d){if(_0x4ddc7d[_0x2c87('0x2b')]!==_0x2c87('0x3a')){var _0x4a6294={};_0x4a6294[_0x4ddc7d[_0x2c87('0x28')]]={'$like':'%'+_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x38')]+'%'};return _0x4a6294;}})});}_0x1bfd5a=_[_0x2c87('0x3b')]({},_0x1bfd5a,_0xbd1186['options']);var _0x4cd7fa={'where':_0x1bfd5a[_0x2c87('0x39')]};return db['Attachment'][_0x2c87('0x21')](_0x4cd7fa)[_0x2c87('0x25')](function(_0x2b8c4c){_0x4ac401[_0x2c87('0x21')]=_0x2b8c4c;if(_0xbd1186[_0x2c87('0x2f')][_0x2c87('0x3c')]){_0x1bfd5a[_0x2c87('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x2c87('0x3e')](_0x1bfd5a);})['then'](function(_0x395bd6){_0x4ac401['rows']=_0x395bd6;return _0x4ac401;})[_0x2c87('0x25')](respondWithFilteredResult(_0x57f118,_0x1bfd5a))['catch'](handleError(_0x57f118,null));};exports[_0x2c87('0x3f')]=function(_0x3ffa5a,_0x28606f){var _0x4849fd={'raw':!![],'where':{'id':_0x3ffa5a[_0x2c87('0x40')]['id']}},_0x50f5e9={};_0x50f5e9[_0x2c87('0x2d')]=_['keys'](db['Attachment'][_0x2c87('0x29')]);_0x50f5e9[_0x2c87('0x2f')]=_['keys'](_0x3ffa5a[_0x2c87('0x2f')]);_0x50f5e9[_0x2c87('0x30')]=_[_0x2c87('0x32')](_0x50f5e9[_0x2c87('0x2d')],_0x50f5e9[_0x2c87('0x2f')]);_0x4849fd[_0x2c87('0x31')]=_[_0x2c87('0x32')](_0x50f5e9['model'],qs['fields'](_0x3ffa5a[_0x2c87('0x2f')][_0x2c87('0x33')]));_0x4849fd[_0x2c87('0x31')]=_0x4849fd[_0x2c87('0x31')][_0x2c87('0x34')]?_0x4849fd[_0x2c87('0x31')]:_0x50f5e9[_0x2c87('0x2d')];if(_0x3ffa5a[_0x2c87('0x2f')][_0x2c87('0x3c')]){_0x4849fd[_0x2c87('0x3d')]=[{'all':!![]}];}_0x4849fd=_['merge']({},_0x4849fd,_0x3ffa5a[_0x2c87('0x41')]);return db['Attachment'][_0x2c87('0x42')](_0x4849fd)[_0x2c87('0x25')](handleEntityNotFound(_0x28606f,null))['then'](respondWithResult(_0x28606f,null))[_0x2c87('0x43')](handleError(_0x28606f,null));};exports[_0x2c87('0x44')]=function(_0x5eedc4,_0x162ff3){var _0x2a2ec2={'where':{'id':_0x5eedc4[_0x2c87('0x40')]['id']}},_0x5b0546={};_0x5b0546[_0x2c87('0x2d')]=_[_0x2c87('0x45')](db[_0x2c87('0x46')][_0x2c87('0x29')]);_0x2a2ec2[_0x2c87('0x31')]=_['intersection'](_0x5b0546[_0x2c87('0x2d')],qs['fields'](_0x5eedc4[_0x2c87('0x2f')][_0x2c87('0x33')]));_0x2a2ec2[_0x2c87('0x31')]=_0x2a2ec2[_0x2c87('0x31')][_0x2c87('0x34')]?_0x2a2ec2[_0x2c87('0x31')]:_0x5b0546[_0x2c87('0x2d')];if(_0x5eedc4[_0x2c87('0x2f')][_0x2c87('0x3c')]){_0x2a2ec2[_0x2c87('0x3d')]=[{'all':!![]}];}_0x2a2ec2=_[_0x2c87('0x3b')]({},_0x2a2ec2,_0x5eedc4['options']);return db[_0x2c87('0x46')][_0x2c87('0x42')](_0x2a2ec2)['then'](handleEntityNotFound(_0x162ff3,null))[_0x2c87('0x25')](function(_0x569d1d){if(_0x569d1d){var _0x3f4c35=_0x569d1d['get']({'plain':!![]});_0x3f4c35=qs[_0x2c87('0x47')](_0x3f4c35,['id','createdAt',_0x2c87('0x48')]);_0x5eedc4[_0x2c87('0x49')]=_[_0x2c87('0x47')](_0x5eedc4[_0x2c87('0x49')],['id','createdAt',_0x2c87('0x48')]);return db[_0x2c87('0x46')][_0x2c87('0x4a')](_[_0x2c87('0x3b')](_0x3f4c35,_0x5eedc4['body']),{'include':_0x5eedc4['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x2c87('0x25')](respondWithResult(_0x162ff3,0xc9))['catch'](handleError(_0x162ff3,null));};exports[_0x2c87('0x4b')]=function(_0x2b340c,_0x2ee8b4){if(_0x2b340c[_0x2c87('0x49')]['id']){delete _0x2b340c[_0x2c87('0x49')]['id'];}return db['Attachment'][_0x2c87('0x42')]({'where':{'id':_0x2b340c[_0x2c87('0x40')]['id']}})[_0x2c87('0x25')](handleEntityNotFound(_0x2ee8b4,null))[_0x2c87('0x25')](saveUpdates(_0x2b340c[_0x2c87('0x49')],null))['then'](respondWithResult(_0x2ee8b4,null))[_0x2c87('0x43')](handleError(_0x2ee8b4,null));};exports[_0x2c87('0x26')]=function(_0x45c544,_0x15f890){return db[_0x2c87('0x46')][_0x2c87('0x42')]({'where':{'id':_0x45c544[_0x2c87('0x40')]['id']}})[_0x2c87('0x25')](handleEntityNotFound(_0x15f890,null))[_0x2c87('0x25')](removeEntity(_0x15f890,null))[_0x2c87('0x43')](handleError(_0x15f890,null));};exports[_0x2c87('0x4a')]=function(_0x4a712b,_0x149c7f,_0x1e96d2){_0x4a712b[_0x2c87('0x49')][_0x2c87('0x28')]=_0x4a712b[_0x2c87('0x4c')][_0x2c87('0x4d')];_0x4a712b[_0x2c87('0x49')]['basename']=_0x4a712b[_0x2c87('0x4c')][_0x2c87('0x4e')];_0x4a712b['body']['type']=_0x4a712b[_0x2c87('0x4c')][_0x2c87('0x4f')];return db[_0x2c87('0x46')]['create'](_0x4a712b['body'])[_0x2c87('0x25')](respondWithResult(_0x149c7f,0xc9))[_0x2c87('0x43')](handleError(_0x149c7f,null));};exports[_0x2c87('0x50')]=function(_0x2f110c,_0x159892,_0x1206d7){return db[_0x2c87('0x46')][_0x2c87('0x51')]({'where':{'id':_0x2f110c[_0x2c87('0x40')]['id']},'raw':!![]})[_0x2c87('0x25')](handleEntityNotFound(_0x159892,null))['then'](function(_0x4c6084){if(_0x4c6084){var _0x1950cc=_0x4c6084[_0x2c87('0x52')]!==null;var _0x2cdda0=path['join'](config[_0x2c87('0x53')],'server/files/attachments/');if(_0x1950cc){_0x2cdda0=path[_0x2c87('0x54')](_0x2cdda0,'offline-chat/');}var _0x4576c7=path[_0x2c87('0x54')](_0x2cdda0,_0x4c6084[_0x2c87('0x55')]);return _0x159892['download'](_0x4576c7);}})['catch'](handleError(_0x159892,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 23431fe..c58b233 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 _0x47f7=['moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','util','../../config/logger'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x47f7,0x166));var _0x747f=function(_0x4dd540,_0x16013f){_0x4dd540=_0x4dd540-0x0;var _0x470e18=_0x47f7[_0x4dd540];return _0x470e18;};'use strict';var _=require('lodash');var util=require(_0x747f('0x0'));var logger=require(_0x747f('0x1'))('api');var moment=require(_0x747f('0x2'));var BPromise=require(_0x747f('0x3'));var rp=require(_0x747f('0x4'));var fs=require('fs');var path=require(_0x747f('0x5'));var rimraf=require(_0x747f('0x6'));var config=require('../../config/environment');var attributes=require(_0x747f('0x7'));module[_0x747f('0x8')]=function(_0x311bc2,_0x4bc55e){return _0x311bc2['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe677=['Attachment','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x44266a,_0x1a495e){var _0x10d89f=function(_0x55ce51){while(--_0x55ce51){_0x44266a['push'](_0x44266a['shift']());}};_0x10d89f(++_0x1a495e);}(_0xe677,0x123));var _0x7e67=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xe677[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0x7e67('0x0'));var logger=require(_0x7e67('0x1'))('api');var moment=require(_0x7e67('0x2'));var BPromise=require(_0x7e67('0x3'));var rp=require(_0x7e67('0x4'));var fs=require('fs');var path=require(_0x7e67('0x5'));var rimraf=require(_0x7e67('0x6'));var config=require(_0x7e67('0x7'));var attributes=require(_0x7e67('0x8'));module['exports']=function(_0x33220b,_0x21a758){return _0x33220b['define'](_0x7e67('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index a35c7cf..b477ea0 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 _0x7af2=['message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x3e3527,_0x4f9564){var _0x1465cb=function(_0x16031d){while(--_0x16031d){_0x3e3527['push'](_0x3e3527['shift']());}};_0x1465cb(++_0x4f9564);}(_0x7af2,0x119));var _0x27af=function(_0x5b3309,_0xee99e9){_0x5b3309=_0x5b3309-0x0;var _0x3d373e=_0x7af2[_0x5b3309];return _0x3d373e;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var moment=require(_0x27af('0x1'));var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27af('0x4'))['db'];var utils=require(_0x27af('0x5'));var logger=require(_0x27af('0x6'))(_0x27af('0x7'));var config=require(_0x27af('0x8'));var jayson=require(_0x27af('0x9'));var client=jayson[_0x27af('0xa')][_0x27af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2193c6,_0x572219,_0x1e2509){return new BPromise(function(_0x366868,_0x389e97){return client['request'](_0x2193c6,_0x1e2509)[_0x27af('0xc')](function(_0xfa1882){logger[_0x27af('0xd')]('Attachment,\x20%s,\x20%s',_0x572219,_0x27af('0xe'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x572219,_0x27af('0xe'),JSON['stringify'](_0xfa1882));if(_0xfa1882['error']){if(_0xfa1882[_0x27af('0xf')]['code']===0x1f4){logger[_0x27af('0xf')]('Attachment,\x20%s,\x20%s',_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x389e97(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}logger[_0x27af('0xf')](_0x27af('0x11'),_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x366868(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}else{logger[_0x27af('0xd')](_0x27af('0x11'),_0x572219,_0x27af('0xe'));_0x366868(_0xfa1882[_0x27af('0x12')][_0x27af('0x10')]);}})[_0x27af('0x13')](function(_0x13f8ed){logger[_0x27af('0xf')]('Attachment,\x20%s,\x20%s',_0x572219,_0x13f8ed);_0x389e97(_0x13f8ed);});});}exports[_0x27af('0x14')]=function(_0x31d702){var _0x5997ae=this;return new Promise(function(_0x4e6e2f,_0x20a6d7){return db[_0x27af('0x15')][_0x27af('0x16')](_0x31d702[_0x27af('0x17')],{'raw':_0x31d702[_0x27af('0x18')]?_0x31d702['options'][_0x27af('0x19')]===undefined?!![]:![]:!![]})[_0x27af('0xc')](function(_0xcb4b90){logger['info'](_0x27af('0x14'),_0x31d702);logger[_0x27af('0x1a')](_0x27af('0x14'),_0x31d702,JSON['stringify'](_0xcb4b90));_0x4e6e2f(_0xcb4b90);})[_0x27af('0x13')](function(_0x2460f4){logger[_0x27af('0xf')](_0x27af('0x14'),_0x2460f4[_0x27af('0x10')],_0x31d702);_0x20a6d7(_0x5997ae[_0x27af('0xf')](0x1f4,_0x2460f4[_0x27af('0x10')]));});});}; \ No newline at end of file +var _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0xb6ebda,_0xfb8708){var _0x45fb3b=function(_0x598b85){while(--_0x598b85){_0xb6ebda['push'](_0xb6ebda['shift']());}};_0x45fb3b(++_0xfb8708);}(_0xb201,0x1b1));var _0x1b20=function(_0x2c7261,_0x264bae){_0x2c7261=_0x2c7261-0x0;var _0x4b21d1=_0xb201[_0x2c7261];return _0x4b21d1;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index e2ebc92..86e6bbe 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xbf8949,_0x513a9f){var _0x47742b=function(_0x35ee54){while(--_0x35ee54){_0xbf8949['push'](_0xbf8949['shift']());}};_0x47742b(++_0x513a9f);}(_0x2032,0xd9));var _0x2203=function(_0x5c7f2c,_0x4cf256){_0x5c7f2c=_0x5c7f2c-0x0;var _0x3a8d44=_0x2032[_0x5c7f2c];return _0x3a8d44;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x4c6c12,_0x827b7c){var _0x36839a=function(_0x54bf73){while(--_0x54bf73){_0x4c6c12['push'](_0x4c6c12['shift']());}};_0x36839a(++_0x827b7c);}(_0xadb5,0xad));var _0x5adb=function(_0x17e401,_0x129eeb){_0x17e401=_0x17e401-0x0;var _0x48d168=_0xadb5[_0x17e401];return _0x48d168;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index fe1ef06..ec4cbee 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 _0x3021=['../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','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:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','blockedAt','admin','user','then','name','add','getLicense','catch','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','ad-login','passport','Strategy','activedirectory2','util','../../mysqldb'];(function(_0x2534a0,_0xda89db){var _0x3209c0=function(_0x1342c3){while(--_0x1342c3){_0x2534a0['push'](_0x2534a0['shift']());}};_0x3209c0(++_0xda89db);}(_0x3021,0xfd));var _0x1302=function(_0x4616ac,_0x586966){_0x4616ac=_0x4616ac-0x0;var _0x1e582a=_0x3021[_0x4616ac];return _0x1e582a;};'use strict';var passport=require(_0x1302('0x0'));var LocalStrategy=require('passport-local')[_0x1302('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x1302('0x2'));var BPromise=require('bluebird');var util=require(_0x1302('0x3'));var db=require(_0x1302('0x4'))['db'];var authService=require(_0x1302('0x5'));var utils=require(_0x1302('0x6'));var config=require(_0x1302('0x7'));var logger=require(_0x1302('0x8'))('api');function isActiveDirectoryConfigured(_0x587c9d){var _0x50900a=![];if(typeof _0x587c9d[_0x1302('0x9')]!==_0x1302('0xa')){_0x50900a=_0x587c9d[_0x1302('0x9')][_0x1302('0xb')]&&_0x587c9d['activedirectory'][_0x1302('0xc')]&&_0x587c9d['activedirectory'][_0x1302('0xd')];}return _0x50900a;}function adAuthenticate(_0x432891,_0x345b9d,_0x1e755a){return new BPromise(function(_0x1821ec,_0xab3a3d){try{var _0x115f90=new ActiveDirectory(_0x432891);_0x115f90[_0x1302('0xe')](_0x345b9d,_0x1e755a,function(_0x21d058,_0x48a0c6){if(_0x21d058){logger[_0x1302('0xf')](_0x1302('0x10'),_0x345b9d,util[_0x1302('0x11')](_0x21d058,{'showHidden':![],'depth':null}));_0xab3a3d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x48a0c6){logger[_0x1302('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x345b9d);_0xab3a3d(_0x1302('0x12'));}else{_0x1821ec(_0x48a0c6);}});}catch(_0x38291a){_0xab3a3d(_0x38291a);}});}function ActiveDirectoryAuthenticate(_0x248f9a,_0x5b06f7,_0x19145f,_0x1d8f0c){var _0x5d3939,_0x407fbb;if(!isActiveDirectoryConfigured(config)){logger[_0x1302('0xf')](_0x1302('0x13'),_0x5b06f7);return _0x1d8f0c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x1302('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x1302('0x15')],'raw':!![]})['then'](function(_0x563f2e){_0x5d3939=_0x563f2e;if(!_0x5d3939[_0x1302('0x16')]){logger['error'](_0x1302('0x17'),_0x5b06f7);throw new Error(_0x1302('0x12'));}return _0x248f9a[_0x1302('0x14')]({'attributes':['id','name',_0x1302('0x18'),_0x1302('0x19'),_0x1302('0x1a'),'disabled',_0x1302('0x1b'),_0x1302('0x1c'),'online'],'where':{'name':_0x5b06f7,'role':{'$or':[_0x1302('0x1d'),_0x1302('0x1e'),'agent']},'adSsoEnabled':!![]}});})[_0x1302('0x1f')](function(_0x4887d9){if(!_0x4887d9||_0x4887d9&&_0x4887d9[_0x1302('0x20')]!==_0x5b06f7){throw new Error(_0x1302('0x12'));}_0x407fbb=_0x4887d9;var _0x200866=_0x407fbb[_0x1302('0x20')]+'@'+config[_0x1302('0x9')][_0x1302('0xd')];return adAuthenticate(config[_0x1302('0x9')],_0x200866,_0x19145f);})['then'](function(_0x242b3c){if(_0x407fbb['disabled']){throw new Error(_0x1302('0x12'));}if(_0x5d3939[_0x1302('0x15')]>0x0){if(_0x407fbb[_0x1302('0x1b')]){if(moment(_0x407fbb[_0x1302('0x1c')])[_0x1302('0x21')](_0x5d3939['blockDuration'],'minutes')>moment()){throw new Error(_0x1302('0x12'));}return utils['clearBlockUser'](_0x407fbb,0x0,![],null)['then'](function(){return utils['getLicense'](_0x407fbb);})[_0x1302('0x1f')](function(){return _0x1d8f0c(null,_0x407fbb);});}else{return utils[_0x1302('0x22')](_0x407fbb)[_0x1302('0x1f')](function(){return _0x1d8f0c(null,_0x407fbb);});}}else{return utils[_0x1302('0x22')](_0x407fbb)[_0x1302('0x1f')](function(){return _0x1d8f0c(null,_0x407fbb);});}})[_0x1302('0x23')](function(_0x34aee2){return _0x1d8f0c(null,![],_0x34aee2);});}function handleError(_0x58728b,_0x41b1c4,_0x2a1a19){return _0x58728b[_0x1302('0x24')](_0x41b1c4||0x1f4)[_0x1302('0x25')]({'message':_0x2a1a19?_0x2a1a19['message']||_0x2a1a19:''});}exports[_0x1302('0x26')]=function(_0xa02f4e,_0x22670e,_0x153f16){passport['authenticate']('ad-login',function(_0x3b2c61,_0x35bbc8,_0x1c1b3d){var _0x5481a6=_0x3b2c61||_0x1c1b3d;if(_0x5481a6){return handleError(_0x22670e,0x191,_0x5481a6);}if(!_0x35bbc8){return handleError(_0x22670e,0x194,{'message':_0x1302('0x27')});}else{var _0x4ef9a6={'payload':{'id':_0x35bbc8['id'],'role':_0x35bbc8[_0x1302('0x1a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4ef9a6)[_0x1302('0x1f')](function(_0x3e6e63){_0x22670e[_0x1302('0x28')]({'id':_0x35bbc8['id'],'token':_0x3e6e63,'statusCall':'','isAlreadyLogged':_0x35bbc8[_0x1302('0x29')]});});}})(_0xa02f4e,_0x22670e,_0x153f16);};passport['use'](_0x1302('0x2a'),new LocalStrategy({'usernameField':_0x1302('0x20'),'passwordField':_0x1302('0x18')},function(_0x11340f,_0x3c9a33,_0xa92b23){return ActiveDirectoryAuthenticate(db['User'],_0x11340f,_0x3c9a33,_0xa92b23);})); \ No newline at end of file +var _0x1169=['disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','send','login','authenticate','ad-login','json','use','name','password','User','passport','passport-local','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role'];(function(_0x239b16,_0x51ce2b){var _0x5547e7=function(_0x4a5ef5){while(--_0x4a5ef5){_0x239b16['push'](_0x239b16['shift']());}};_0x5547e7(++_0x51ce2b);}(_0x1169,0x68));var _0x9116=function(_0x50780a,_0x226772){_0x50780a=_0x50780a-0x0;var _0x3cccf7=_0x1169[_0x50780a];return _0x3cccf7;};'use strict';var passport=require(_0x9116('0x0'));var LocalStrategy=require(_0x9116('0x1'))['Strategy'];var moment=require(_0x9116('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x9116('0x3'));var util=require(_0x9116('0x4'));var db=require(_0x9116('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x9116('0x6'));var config=require(_0x9116('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x278398){var _0xce8dec=![];if(typeof _0x278398[_0x9116('0x8')]!==_0x9116('0x9')){_0xce8dec=_0x278398[_0x9116('0x8')][_0x9116('0xa')]&&_0x278398['activedirectory'][_0x9116('0xb')]&&_0x278398['activedirectory'][_0x9116('0xc')];}return _0xce8dec;}function adAuthenticate(_0xa48a54,_0x5cd60f,_0x124f1a){return new BPromise(function(_0x37a11e,_0x2e1d5a){try{var _0x34b460=new ActiveDirectory(_0xa48a54);_0x34b460['authenticate'](_0x5cd60f,_0x124f1a,function(_0x29f732,_0x3c4e0c){if(_0x29f732){logger[_0x9116('0xd')](_0x9116('0xe'),_0x5cd60f,util['inspect'](_0x29f732,{'showHidden':![],'depth':null}));_0x2e1d5a(_0x9116('0xf'));}else if(!_0x3c4e0c){logger[_0x9116('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5cd60f);_0x2e1d5a(_0x9116('0xf'));}else{_0x37a11e(_0x3c4e0c);}});}catch(_0x4de9df){_0x2e1d5a(_0x4de9df);}});}function ActiveDirectoryAuthenticate(_0x255407,_0xa8880a,_0x4fa7b0,_0x5e5e49){var _0x410799,_0x3a623e;if(!isActiveDirectoryConfigured(config)){logger[_0x9116('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0xa8880a);return _0x5e5e49(null,![],{'message':_0x9116('0xf')});}return db['Setting'][_0x9116('0x10')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x9116('0x11')],'raw':!![]})[_0x9116('0x12')](function(_0x9066ac){_0x410799=_0x9066ac;if(!_0x410799['adSsoEnabled']){logger[_0x9116('0xd')](_0x9116('0x13'),_0xa8880a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x255407[_0x9116('0x10')]({'attributes':['id','name','password',_0x9116('0x14'),_0x9116('0x15'),_0x9116('0x16'),_0x9116('0x17'),_0x9116('0x18'),_0x9116('0x19')],'where':{'name':_0xa8880a,'role':{'$or':[_0x9116('0x1a'),_0x9116('0x1b'),_0x9116('0x1c')]},'adSsoEnabled':!![]}});})[_0x9116('0x12')](function(_0x4f49ef){if(!_0x4f49ef||_0x4f49ef&&_0x4f49ef['name']!==_0xa8880a){throw new Error(_0x9116('0xf'));}_0x3a623e=_0x4f49ef;var _0x511d9f=_0x3a623e['name']+'@'+config[_0x9116('0x8')][_0x9116('0xc')];return adAuthenticate(config['activedirectory'],_0x511d9f,_0x4fa7b0);})[_0x9116('0x12')](function(_0x3a472f){if(_0x3a623e[_0x9116('0x16')]){throw new Error(_0x9116('0xf'));}if(_0x410799['blockDuration']>0x0){if(_0x3a623e[_0x9116('0x17')]){if(moment(_0x3a623e[_0x9116('0x18')])[_0x9116('0x1d')](_0x410799[_0x9116('0x11')],_0x9116('0x1e'))>moment()){throw new Error(_0x9116('0xf'));}return utils[_0x9116('0x1f')](_0x3a623e,0x0,![],null)[_0x9116('0x12')](function(){return utils['getLicense'](_0x3a623e);})[_0x9116('0x12')](function(){return _0x5e5e49(null,_0x3a623e);});}else{return utils[_0x9116('0x20')](_0x3a623e)[_0x9116('0x12')](function(){return _0x5e5e49(null,_0x3a623e);});}}else{return utils['getLicense'](_0x3a623e)['then'](function(){return _0x5e5e49(null,_0x3a623e);});}})['catch'](function(_0x20299c){return _0x5e5e49(null,![],_0x20299c);});}function handleError(_0x257257,_0x51319f,_0x357b8f){return _0x257257['status'](_0x51319f||0x1f4)[_0x9116('0x21')]({'message':_0x357b8f?_0x357b8f['message']||_0x357b8f:''});}exports[_0x9116('0x22')]=function(_0x1036c1,_0xd94d2,_0xf3e514){passport[_0x9116('0x23')](_0x9116('0x24'),function(_0x4ee11a,_0x92c653,_0xd9abbe){var _0x40372a=_0x4ee11a||_0xd9abbe;if(_0x40372a){return handleError(_0xd94d2,0x191,_0x40372a);}if(!_0x92c653){return handleError(_0xd94d2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x45e45f={'payload':{'id':_0x92c653['id'],'role':_0x92c653['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x45e45f)[_0x9116('0x12')](function(_0x55af54){_0xd94d2[_0x9116('0x25')]({'id':_0x92c653['id'],'token':_0x55af54,'statusCall':'','isAlreadyLogged':_0x92c653[_0x9116('0x19')]});});}})(_0x1036c1,_0xd94d2,_0xf3e514);};passport[_0x9116('0x26')](_0x9116('0x24'),new LocalStrategy({'usernameField':_0x9116('0x27'),'passwordField':_0x9116('0x28')},function(_0x498eb2,_0x141172,_0x1f6b03){return ActiveDirectoryAuthenticate(db[_0x9116('0x29')],_0x498eb2,_0x141172,_0x1f6b03);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index b89034d..e40adaf 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 _0xfaa8=['express','Router','./authActiveDirectory.controller','login'];(function(_0x3f5294,_0x1c2543){var _0x2b552a=function(_0x9edf9a){while(--_0x9edf9a){_0x3f5294['push'](_0x3f5294['shift']());}};_0x2b552a(++_0x1c2543);}(_0xfaa8,0xa4));var _0x8faa=function(_0x55e272,_0x3a0dc5){_0x55e272=_0x55e272-0x0;var _0x2ee59b=_0xfaa8[_0x55e272];return _0x2ee59b;};'use strict';var express=require(_0x8faa('0x0'));var router=express[_0x8faa('0x1')]();var controller=require(_0x8faa('0x2'));router['post']('/',controller[_0x8faa('0x3')]);module['exports']=router; \ No newline at end of file +var _0x84b8=['Router','exports','express'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x84b8,0x1a3));var _0x884b=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x84b8[_0x494d1f];return _0x457b6e;};'use strict';var express=require(_0x884b('0x0'));var router=express[_0x884b('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x884b('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 110999d..abd842e 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(_0x42d8b3,_0x2517bf){var _0x222c0f=function(_0x457337){while(--_0x457337){_0x42d8b3['push'](_0x42d8b3['shift']());}};_0x222c0f(++_0x2517bf);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +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(_0x37c80b,_0x5b90a5){var _0x4ea485=function(_0x27520f){while(--_0x27520f){_0x37c80b['push'](_0x37c80b['shift']());}};_0x4ea485(++_0x5b90a5);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index a5fdd34..e9aafb6 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 _0x6a19=['login','get','callback','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x6a19,0x17f));var _0x96a1=function(_0x567097,_0x345516){_0x567097=_0x567097-0x0;var _0x5e84f8=_0x6a19[_0x567097];return _0x5e84f8;};'use strict';var express=require('express');var passport=require(_0x96a1('0x0'));var router=express['Router']();var controller=require(_0x96a1('0x1'));var userController=require(_0x96a1('0x2'));var authService=require(_0x96a1('0x3'));router['get']('/',controller[_0x96a1('0x4')]);router[_0x96a1('0x5')]('/callback',controller[_0x96a1('0x6')],authService['isMiddleware'],userController[_0x96a1('0x4')],authService[_0x96a1('0x7')]);module[_0x96a1('0x8')]=router; \ No newline at end of file +var _0x6ccb=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x6ccb,0x118));var _0xb6cc=function(_0x394694,_0x78036){_0x394694=_0x394694-0x0;var _0x3cd632=_0x6ccb[_0x394694];return _0x3cd632;};'use strict';var express=require('express');var passport=require(_0xb6cc('0x0'));var router=express['Router']();var controller=require(_0xb6cc('0x1'));var userController=require(_0xb6cc('0x2'));var authService=require(_0xb6cc('0x3'));router['get']('/',controller[_0xb6cc('0x4')]);router[_0xb6cc('0x5')](_0xb6cc('0x6'),controller[_0xb6cc('0x7')],authService[_0xb6cc('0x8')],userController[_0xb6cc('0x4')],authService[_0xb6cc('0x9')]);module[_0xb6cc('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 81f2a94..2749993 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 _0xb803=['/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blockedAt','user','agent','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host'];(function(_0x5ed260,_0x5b5c6e){var _0x3b011f=function(_0x8b690b){while(--_0x8b690b){_0x5ed260['push'](_0x5ed260['shift']());}};_0x3b011f(++_0x5b5c6e);}(_0xb803,0xb5));var _0x3b80=function(_0x12bbe7,_0x200f47){_0x12bbe7=_0x12bbe7-0x0;var _0x2e7990=_0xb803[_0x12bbe7];return _0x2e7990;};'use strict';var util=require(_0x3b80('0x0'));var passport=require(_0x3b80('0x1'));var LocalStrategy=require(_0x3b80('0x2'))[_0x3b80('0x3')];var jayson=require(_0x3b80('0x4'));var _=require(_0x3b80('0x5'));var rs=require(_0x3b80('0x6'));var moment=require(_0x3b80('0x7'));var db=require(_0x3b80('0x8'))['db'];var authService=require(_0x3b80('0x9'));var utils=require('../../config/utils');var client=jayson[_0x3b80('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x1d46b4,_0x437cfc,_0x2cf4e2,_0x519d1f){var _0xb6679d,_0x1bff82;return db[_0x3b80('0xb')][_0x3b80('0xc')]({'where':{'id':0x1},'attributes':[_0x3b80('0xd'),_0x3b80('0xe')],'raw':!![]})[_0x3b80('0xf')](function(_0xd2bad7){_0xb6679d=_0xd2bad7;return _0x1d46b4[_0x3b80('0xc')]({'attributes':['id','name',_0x3b80('0x10'),_0x3b80('0x11'),_0x3b80('0x12'),_0x3b80('0x13'),'blocked',_0x3b80('0x14'),'loginAttempts'],'where':{'name':_0x437cfc,'role':{'$or':['admin',_0x3b80('0x15'),_0x3b80('0x16')]}}});})[_0x3b80('0xf')](function(_0x1ae7d1){if(!_0x1ae7d1||_0x1ae7d1&&_0x1ae7d1[_0x3b80('0x17')]!==_0x437cfc){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1bff82=_0x1ae7d1;return _0x1bff82;}})[_0x3b80('0xf')](function(){_0x1bff82[_0x3b80('0x18')](_0x2cf4e2,function(_0x5af494,_0xaeb08){var _0xcc5030=_0x1bff82['loginAttempts']+0x1;if(_0x5af494){return _0x519d1f(_0x5af494);}else if(!_0xaeb08){if(_0x1bff82['disabled']){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});}else if(_0xb6679d[_0x3b80('0xd')]>0x0){if(_0x1bff82[_0x3b80('0x1a')]){if(_0xb6679d[_0x3b80('0xe')]>0x0){if(moment(_0x1bff82[_0x3b80('0x14')])[_0x3b80('0x1b')](_0xb6679d['blockDuration'],_0x3b80('0x1c'))>moment()){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});}else{return utils[_0x3b80('0x1d')](_0x1bff82,_0xcc5030,![],null)[_0x3b80('0xf')](function(){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});});}}else{return _0x519d1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xcc5030>=_0xb6679d[_0x3b80('0xd')]){return utils[_0x3b80('0x1d')](_0x1bff82,0x0,!![],moment())['then'](function(){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});});}else{return utils[_0x3b80('0x1d')](_0x1bff82,_0xcc5030,![],null)['then'](function(){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});});}}}else{return _0x519d1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1bff82[_0x3b80('0x13')]){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});}else if(_0xb6679d[_0x3b80('0xd')]>0x0){if(_0x1bff82[_0x3b80('0x1a')]){if(_0xb6679d[_0x3b80('0xe')]>0x0){if(moment(_0x1bff82['blockedAt'])['add'](_0xb6679d[_0x3b80('0xe')],_0x3b80('0x1c'))>moment()){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});}else{return utils['clearBlockUser'](_0x1bff82,0x0,![],null)[_0x3b80('0xf')](function(){return utils[_0x3b80('0x1e')](_0x1bff82);})[_0x3b80('0xf')](function(){return _0x519d1f(null,_0x1bff82);});}}else{return _0x519d1f(null,![],{'message':_0x3b80('0x19')});}}else{return utils[_0x3b80('0x1d')](_0x1bff82,0x0,![],null)[_0x3b80('0xf')](function(){return utils[_0x3b80('0x1e')](_0x1bff82);})[_0x3b80('0xf')](function(){return _0x519d1f(null,_0x1bff82);})['catch'](function(_0x4ce7ec){return _0x519d1f(null,![],_0x4ce7ec);});}}else{if(_0x1bff82[_0x3b80('0x1a')]){return _0x519d1f(null,![],{'message':_0x3b80('0x19')});}else{return utils[_0x3b80('0x1e')](_0x1bff82)[_0x3b80('0xf')](function(){return _0x519d1f(null,_0x1bff82);});}}}});})[_0x3b80('0x1f')](function(_0x46e513){return _0x519d1f(null,![],_0x46e513);});}function sendServiceMail(_0x797aa5){return db[_0x3b80('0x20')][_0x3b80('0x21')]({'where':{'service':!![]},'attributes':['id',_0x3b80('0x17'),_0x3b80('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x3b80('0x23'),'include':[{'model':db[_0x3b80('0x24')],'as':_0x3b80('0x24')}]}]})['then'](function(_0x225fd7){if(!_0x225fd7){throw new Error(_0x3b80('0x25'));}var _0x4d252c=_0x225fd7['getSmtpOptions']();var _0x57e4a2={'account':_0x4d252c,'message':_[_0x3b80('0x26')]({'from':util[_0x3b80('0x27')](_0x3b80('0x28'),_0x225fd7[_0x3b80('0x17')],_0x225fd7[_0x3b80('0x22')]||_0x225fd7[_0x3b80('0x23')][_0x3b80('0x15')])},_0x797aa5)};return client[_0x3b80('0x29')](_0x3b80('0x2a'),_0x57e4a2);})['then'](function(_0x3d810e){if(_0x3d810e['error']){throw new Error(util[_0x3b80('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3d810e[_0x3b80('0x2b')][_0x3b80('0x2c')]||JSON[_0x3b80('0x2d')](_0x3d810e[_0x3b80('0x2b')])));}return!![];});}function handleError(_0x2ab3bc,_0x27e100,_0x263542){return _0x2ab3bc[_0x3b80('0x2e')](_0x27e100||0x1f4)[_0x3b80('0x2f')]({'message':_0x263542?_0x263542['message']||_0x263542:''});}exports[_0x3b80('0x30')]=function(_0x4fd82f,_0x5a327a,_0x3b4aa9){passport[_0x3b80('0x18')](_0x3b80('0x31'),function(_0x2ef21d,_0xd60fcd,_0x2f7d92){var _0x340c55=_0x2ef21d||_0x2f7d92;if(_0x340c55){return handleError(_0x5a327a,0x191,_0x340c55);}if(!_0xd60fcd){return handleError(_0x5a327a,0x194,{'message':_0x3b80('0x32')});}else{var _0x31c8c6={'payload':{'id':_0xd60fcd['id'],'role':_0xd60fcd[_0x3b80('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x3b80('0x33')](_0x31c8c6)[_0x3b80('0xf')](function(_0x134c2b){_0x5a327a['json']({'id':_0xd60fcd['id'],'token':_0x134c2b,'statusCall':'','isAlreadyLogged':_0xd60fcd[_0x3b80('0x34')]});});}})(_0x4fd82f,_0x5a327a,_0x3b4aa9);};exports[_0x3b80('0x35')]=function(_0x548c0c,_0x2c3786){if(!_0x548c0c[_0x3b80('0x36')][_0x3b80('0x22')]){return handleError(_0x2c3786,0x1f4,{'message':_0x3b80('0x37')});}var _0x21ef31=rs['generate']();_0x548c0c[_0x3b80('0x36')]['email']=_0x548c0c['body'][_0x3b80('0x22')][_0x3b80('0x38')]()[_0x3b80('0x39')]();var _0x3286c6;return db[_0x3b80('0xb')][_0x3b80('0xc')]({'where':{'id':0x1},'attributes':[_0x3b80('0xd'),'blockDuration'],'raw':!![]})[_0x3b80('0xf')](function(_0x2c50f2){_0x3286c6=_0x2c50f2;return db[_0x3b80('0x3a')][_0x3b80('0x21')]({'where':{'email':_0x548c0c['body'][_0x3b80('0x22')]}});})[_0x3b80('0xf')](function(_0x40d547){if(!_0x40d547){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x40d547[_0x3b80('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x40d547['blocked']){if(moment(_0x40d547['blockedAt'])[_0x3b80('0x1b')](_0x3286c6[_0x3b80('0xe')],_0x3b80('0x1c'))>moment()){throw new Error(_0x3b80('0x3b'));}else{_0x40d547[_0x3b80('0x1a')]=![];_0x40d547[_0x3b80('0x14')]=null;}}_0x40d547[_0x3b80('0x3c')]=_0x21ef31;_0x40d547['resetPasswordExpires']=Date[_0x3b80('0x3d')]()+0x36ee80;return _0x40d547[_0x3b80('0x3e')]();})[_0x3b80('0xf')](function(){return sendServiceMail({'to':_0x548c0c['body'][_0x3b80('0x22')],'subject':_0x3b80('0x3f'),'text':_0x3b80('0x40')+_0x3b80('0x41')+'https://'+_0x548c0c[_0x3b80('0x42')][_0x3b80('0x43')]+_0x3b80('0x44')+_0x21ef31+'\x0a\x0a'+_0x3b80('0x45')});})[_0x3b80('0xf')](function(){_0x2c3786[_0x3b80('0x2e')](0xc8)[_0x3b80('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0x3b80('0x1f')](function(_0x2bdf48){return handleError(_0x2c3786,0x1f4,_0x2bdf48);});};exports[_0x3b80('0x46')]=function(_0x5e6996,_0x364b4a){return db[_0x3b80('0x3a')]['find']({'where':{'resetPasswordToken':_0x5e6996[_0x3b80('0x47')][_0x3b80('0x48')],'resetPasswordExpires':{'$gt':Date[_0x3b80('0x3d')]()}}})[_0x3b80('0xf')](function(_0x4f5203){if(!_0x4f5203){throw new Error(_0x3b80('0x49'));}return db[_0x3b80('0xb')][_0x3b80('0xc')]({'attributes':['id',_0x3b80('0x4a'),_0x3b80('0x4b'),_0x3b80('0x4c')]})[_0x3b80('0xf')](function(_0x4a9809){if(_0x4a9809[_0x3b80('0x4a')])authService[_0x3b80('0x4d')](_0x5e6996[_0x3b80('0x36')][_0x3b80('0x10')]);if(!_0x4a9809[_0x3b80('0x4b')]||!_0x4f5203[_0x3b80('0x4e')])return _0x4f5203;authService[_0x3b80('0x4f')](_0x5e6996[_0x3b80('0x36')][_0x3b80('0x10')],_0x4f5203['previousPasswords'],_0x4a9809['passwordHistoryLimit']);return _0x4f5203;})[_0x3b80('0xf')](function(){_0x4f5203[_0x3b80('0x10')]=_0x5e6996[_0x3b80('0x36')][_0x3b80('0x10')];_0x4f5203[_0x3b80('0x3c')]=null;_0x4f5203[_0x3b80('0x50')]=null;return _0x4f5203['save']();});})['then'](function(){_0x364b4a[_0x3b80('0x2e')](0xc8)[_0x3b80('0x2f')]({'message':_0x3b80('0x51')});})['catch'](function(_0x5974a9){return handleError(_0x364b4a,0x1f4,_0x5974a9);});};passport[_0x3b80('0x52')](_0x3b80('0x31'),new LocalStrategy({'usernameField':_0x3b80('0x17'),'passwordField':'password'},function(_0x5d5d39,_0x56a26c,_0x66075f){return localAuthenticate(db[_0x3b80('0x3a')],_0x5d5d39,_0x56a26c,_0x66075f);})); \ No newline at end of file +var _0xac01=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','User','params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','jayson/promise','lodash','randomstring','moment','../../components/auth/service','http','Setting','blockDuration','then','findOne','name','password','salt','disabled','blockedAt','loginAttempts','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','generate','body','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add'];(function(_0xf5fbb7,_0xdb7f69){var _0x330d55=function(_0x45fd85){while(--_0x45fd85){_0xf5fbb7['push'](_0xf5fbb7['shift']());}};_0x330d55(++_0xdb7f69);}(_0xac01,0x67));var _0x1ac0=function(_0x2166d1,_0x5ec8a6){_0x2166d1=_0x2166d1-0x0;var _0x554486=_0xac01[_0x2166d1];return _0x554486;};'use strict';var util=require(_0x1ac0('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x1ac0('0x1'));var _=require(_0x1ac0('0x2'));var rs=require(_0x1ac0('0x3'));var moment=require(_0x1ac0('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x1ac0('0x5'));var utils=require('../../config/utils');var client=jayson['client'][_0x1ac0('0x6')]({'port':0x232b});function localAuthenticate(_0x40840e,_0x5e12e2,_0x2dd220,_0x5d7bc0){var _0x2fcca7,_0x699e53;return db[_0x1ac0('0x7')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1ac0('0x8')],'raw':!![]})[_0x1ac0('0x9')](function(_0x18bb4c){_0x2fcca7=_0x18bb4c;return _0x40840e[_0x1ac0('0xa')]({'attributes':['id',_0x1ac0('0xb'),_0x1ac0('0xc'),_0x1ac0('0xd'),'role',_0x1ac0('0xe'),'blocked',_0x1ac0('0xf'),_0x1ac0('0x10')],'where':{'name':_0x5e12e2,'role':{'$or':['admin','user',_0x1ac0('0x11')]}}});})[_0x1ac0('0x9')](function(_0x1ba229){if(!_0x1ba229||_0x1ba229&&_0x1ba229['name']!==_0x5e12e2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x699e53=_0x1ba229;return _0x699e53;}})[_0x1ac0('0x9')](function(){_0x699e53[_0x1ac0('0x12')](_0x2dd220,function(_0x5a8245,_0x4e1e68){var _0x2cf0af=_0x699e53[_0x1ac0('0x10')]+0x1;if(_0x5a8245){return _0x5d7bc0(_0x5a8245);}else if(!_0x4e1e68){if(_0x699e53[_0x1ac0('0xe')]){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else if(_0x2fcca7['allowedLoginAttempts']>0x0){if(_0x699e53[_0x1ac0('0x14')]){if(_0x2fcca7['blockDuration']>0x0){if(moment(_0x699e53[_0x1ac0('0xf')])['add'](_0x2fcca7[_0x1ac0('0x8')],'minutes')>moment()){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else{return utils['clearBlockUser'](_0x699e53,_0x2cf0af,![],null)[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5d7bc0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2cf0af>=_0x2fcca7['allowedLoginAttempts']){return utils[_0x1ac0('0x15')](_0x699e53,0x0,!![],moment())[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});});}else{return utils['clearBlockUser'](_0x699e53,_0x2cf0af,![],null)[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});});}}}else{return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}}else{if(_0x699e53[_0x1ac0('0xe')]){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else if(_0x2fcca7[_0x1ac0('0x16')]>0x0){if(_0x699e53['blocked']){if(_0x2fcca7[_0x1ac0('0x8')]>0x0){if(moment(_0x699e53[_0x1ac0('0xf')])['add'](_0x2fcca7[_0x1ac0('0x8')],_0x1ac0('0x17'))>moment()){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else{return utils['clearBlockUser'](_0x699e53,0x0,![],null)[_0x1ac0('0x9')](function(){return utils[_0x1ac0('0x18')](_0x699e53);})[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,_0x699e53);});}}else{return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}}else{return utils[_0x1ac0('0x15')](_0x699e53,0x0,![],null)[_0x1ac0('0x9')](function(){return utils[_0x1ac0('0x18')](_0x699e53);})[_0x1ac0('0x9')](function(){return _0x5d7bc0(null,_0x699e53);})[_0x1ac0('0x19')](function(_0x3f7e15){return _0x5d7bc0(null,![],_0x3f7e15);});}}else{if(_0x699e53[_0x1ac0('0x14')]){return _0x5d7bc0(null,![],{'message':_0x1ac0('0x13')});}else{return utils[_0x1ac0('0x18')](_0x699e53)['then'](function(){return _0x5d7bc0(null,_0x699e53);});}}}});})[_0x1ac0('0x19')](function(_0x2896d1){return _0x5d7bc0(null,![],_0x2896d1);});}function sendServiceMail(_0x1d3f4e){return db[_0x1ac0('0x1a')][_0x1ac0('0x1b')]({'where':{'service':!![]},'attributes':['id',_0x1ac0('0xb'),_0x1ac0('0x1c')],'include':[{'model':db[_0x1ac0('0x1d')],'as':_0x1ac0('0x1e'),'include':[{'model':db[_0x1ac0('0x1f')],'as':_0x1ac0('0x1f')}]}]})[_0x1ac0('0x9')](function(_0x2f2ea8){if(!_0x2f2ea8){throw new Error(_0x1ac0('0x20'));}var _0x3cf86d=_0x2f2ea8[_0x1ac0('0x21')]();var _0x292b8a={'account':_0x3cf86d,'message':_[_0x1ac0('0x22')]({'from':util[_0x1ac0('0x23')](_0x1ac0('0x24'),_0x2f2ea8[_0x1ac0('0xb')],_0x2f2ea8[_0x1ac0('0x1c')]||_0x2f2ea8[_0x1ac0('0x1e')]['user'])},_0x1d3f4e)};return client[_0x1ac0('0x25')](_0x1ac0('0x26'),_0x292b8a);})[_0x1ac0('0x9')](function(_0x550105){if(_0x550105[_0x1ac0('0x27')]){throw new Error(util[_0x1ac0('0x23')](_0x1ac0('0x28'),_0x550105['error'][_0x1ac0('0x29')]||JSON[_0x1ac0('0x2a')](_0x550105[_0x1ac0('0x27')])));}return!![];});}function handleError(_0x3c573b,_0x5bd90a,_0x21f085){return _0x3c573b[_0x1ac0('0x2b')](_0x5bd90a||0x1f4)[_0x1ac0('0x2c')]({'message':_0x21f085?_0x21f085[_0x1ac0('0x29')]||_0x21f085:''});}exports[_0x1ac0('0x2d')]=function(_0x53c883,_0x117bac,_0x4932a9){passport[_0x1ac0('0x12')](_0x1ac0('0x2e'),function(_0xbbf6bc,_0x31b361,_0x129114){var _0x16d3b6=_0xbbf6bc||_0x129114;if(_0x16d3b6){return handleError(_0x117bac,0x191,_0x16d3b6);}if(!_0x31b361){return handleError(_0x117bac,0x194,{'message':_0x1ac0('0x2f')});}else{var _0x4c38d0={'payload':{'id':_0x31b361['id'],'role':_0x31b361[_0x1ac0('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x1ac0('0x31')](_0x4c38d0)['then'](function(_0x27b535){_0x117bac[_0x1ac0('0x32')]({'id':_0x31b361['id'],'token':_0x27b535,'statusCall':'','isAlreadyLogged':_0x31b361[_0x1ac0('0x33')]});});}})(_0x53c883,_0x117bac,_0x4932a9);};exports[_0x1ac0('0x34')]=function(_0x1448fd,_0x65ffd3){if(!_0x1448fd['body']['email']){return handleError(_0x65ffd3,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2a26eb=rs[_0x1ac0('0x35')]();_0x1448fd[_0x1ac0('0x36')][_0x1ac0('0x1c')]=_0x1448fd[_0x1ac0('0x36')]['email'][_0x1ac0('0x37')]()[_0x1ac0('0x38')]();var _0x2811a7;return db[_0x1ac0('0x7')][_0x1ac0('0xa')]({'where':{'id':0x1},'attributes':[_0x1ac0('0x16'),'blockDuration'],'raw':!![]})[_0x1ac0('0x9')](function(_0x219d0f){_0x2811a7=_0x219d0f;return db['User']['find']({'where':{'email':_0x1448fd['body'][_0x1ac0('0x1c')]}});})[_0x1ac0('0x9')](function(_0x87b56c){if(!_0x87b56c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x87b56c['disabled']){throw new Error(_0x1ac0('0x39'));}if(_0x87b56c[_0x1ac0('0x14')]){if(moment(_0x87b56c['blockedAt'])[_0x1ac0('0x3a')](_0x2811a7[_0x1ac0('0x8')],'minutes')>moment()){throw new Error(_0x1ac0('0x3b'));}else{_0x87b56c[_0x1ac0('0x14')]=![];_0x87b56c[_0x1ac0('0xf')]=null;}}_0x87b56c[_0x1ac0('0x3c')]=_0x2a26eb;_0x87b56c[_0x1ac0('0x3d')]=Date[_0x1ac0('0x3e')]()+0x36ee80;return _0x87b56c[_0x1ac0('0x3f')]();})[_0x1ac0('0x9')](function(){return sendServiceMail({'to':_0x1448fd['body'][_0x1ac0('0x1c')],'subject':_0x1ac0('0x40'),'text':_0x1ac0('0x41')+_0x1ac0('0x42')+_0x1ac0('0x43')+_0x1448fd[_0x1ac0('0x44')][_0x1ac0('0x45')]+'/reset/'+_0x2a26eb+'\x0a\x0a'+_0x1ac0('0x46')});})[_0x1ac0('0x9')](function(){_0x65ffd3[_0x1ac0('0x2b')](0xc8)[_0x1ac0('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0x1ac0('0x19')](function(_0x49d02f){return handleError(_0x65ffd3,0x1f4,_0x49d02f);});};exports['reset']=function(_0xd3e407,_0x2d04dd){return db[_0x1ac0('0x47')][_0x1ac0('0x1b')]({'where':{'resetPasswordToken':_0xd3e407[_0x1ac0('0x48')][_0x1ac0('0x49')],'resetPasswordExpires':{'$gt':Date[_0x1ac0('0x3e')]()}}})['then'](function(_0x53d077){if(!_0x53d077){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x1ac0('0x7')][_0x1ac0('0xa')]({'attributes':['id',_0x1ac0('0x4a'),'enforcePasswordHistory',_0x1ac0('0x4b')]})['then'](function(_0x5fb977){if(_0x5fb977[_0x1ac0('0x4a')])authService[_0x1ac0('0x4c')](_0xd3e407[_0x1ac0('0x36')][_0x1ac0('0xc')]);if(!_0x5fb977['enforcePasswordHistory']||!_0x53d077[_0x1ac0('0x4d')])return _0x53d077;authService[_0x1ac0('0x4e')](_0xd3e407[_0x1ac0('0x36')][_0x1ac0('0xc')],_0x53d077[_0x1ac0('0x4d')],_0x5fb977['passwordHistoryLimit']);return _0x53d077;})['then'](function(){_0x53d077['password']=_0xd3e407[_0x1ac0('0x36')][_0x1ac0('0xc')];_0x53d077[_0x1ac0('0x3c')]=null;_0x53d077[_0x1ac0('0x3d')]=null;return _0x53d077[_0x1ac0('0x3f')]();});})[_0x1ac0('0x9')](function(){_0x2d04dd[_0x1ac0('0x2b')](0xc8)[_0x1ac0('0x2c')]({'message':_0x1ac0('0x4f')});})[_0x1ac0('0x19')](function(_0xb38fa){return handleError(_0x2d04dd,0x1f4,_0xb38fa);});};passport[_0x1ac0('0x50')](_0x1ac0('0x2e'),new LocalStrategy({'usernameField':_0x1ac0('0xb'),'passwordField':_0x1ac0('0xc')},function(_0x409475,_0x65f92f,_0x444f4c){return localAuthenticate(db['User'],_0x409475,_0x65f92f,_0x444f4c);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7c34218..4a6b7c9 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 _0xb07f=['./authLocal.controller','login','post','/forgot','forgot','reset','exports','express','Router'];(function(_0x5241ba,_0x41a1d4){var _0x26e7c5=function(_0x2b85ec){while(--_0x2b85ec){_0x5241ba['push'](_0x5241ba['shift']());}};_0x26e7c5(++_0x41a1d4);}(_0xb07f,0xfa));var _0xfb07=function(_0x2cfdde,_0xbdb893){_0x2cfdde=_0x2cfdde-0x0;var _0x444163=_0xb07f[_0x2cfdde];return _0x444163;};'use strict';var express=require(_0xfb07('0x0'));var router=express[_0xfb07('0x1')]();var controller=require(_0xfb07('0x2'));router['post']('/',controller[_0xfb07('0x3')]);router[_0xfb07('0x4')](_0xfb07('0x5'),controller[_0xfb07('0x6')]);router[_0xfb07('0x4')]('/reset/:token',controller[_0xfb07('0x7')]);module[_0xfb07('0x8')]=router; \ No newline at end of file +var _0xb58f=['./authLocal.controller','login','post','reset','exports','Router'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0xb58f,0xd1));var _0xfb58=function(_0x55fbb4,_0x2f5794){_0x55fbb4=_0x55fbb4-0x0;var _0x33042d=_0xb58f[_0x55fbb4];return _0x33042d;};'use strict';var express=require('express');var router=express[_0xfb58('0x0')]();var controller=require(_0xfb58('0x1'));router['post']('/',controller[_0xfb58('0x2')]);router[_0xfb58('0x3')]('/forgot',controller['forgot']);router[_0xfb58('0x3')]('/reset/:token',controller[_0xfb58('0x4')]);module[_0xfb58('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 39cea2e..7c4701e 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 _0x3031=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1ab0c1,_0x102f9b){var _0x59e91c=function(_0x383567){while(--_0x383567){_0x1ab0c1['push'](_0x1ab0c1['shift']());}};_0x59e91c(++_0x102f9b);}(_0x3031,0x13d));var _0x1303=function(_0x2e0412,_0x3a6261){_0x2e0412=_0x2e0412-0x0;var _0x18a177=_0x3031[_0x2e0412];return _0x18a177;};'use strict';var Sequelize=require(_0x1303('0x0'));module[_0x1303('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x1303('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1303('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x0fec=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x115453,_0x5458f0){var _0x5a591a=function(_0x4fc58c){while(--_0x4fc58c){_0x115453['push'](_0x115453['shift']());}};_0x5a591a(++_0x5458f0);}(_0x0fec,0x142));var _0xc0fe=function(_0x16124d,_0x4afafa){_0x16124d=_0x16124d-0x0;var _0x56d3be=_0x0fec[_0x16124d];return _0x56d3be;};'use strict';var Sequelize=require(_0xc0fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0fe('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xc0fe('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xc0fe('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc0fe('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 ddf219d..d992e9c 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 _0x4d41=['includeAll','catch','create','body','find','params','Condition','addConditions','ids','findOne','rawAttributes','getConditions','addActions','Action','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','name','send','map','Automation','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys'];(function(_0x2ef197,_0x1786e0){var _0x2dc1a3=function(_0x3496f4){while(--_0x3496f4){_0x2ef197['push'](_0x2ef197['shift']());}};_0x2dc1a3(++_0x1786e0);}(_0x4d41,0x1f0));var _0x14d4=function(_0xcf807,_0x4c736b){_0xcf807=_0xcf807-0x0;var _0x2ef9e9=_0x4d41[_0xcf807];return _0x2ef9e9;};'use strict';var emlformat=require(_0x14d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14d4('0x1'));var jsonpatch=require(_0x14d4('0x2'));var rp=require(_0x14d4('0x3'));var moment=require(_0x14d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x14d4('0x5'));var util=require('util');var path=require(_0x14d4('0x6'));var sox=require('sox');var csv=require(_0x14d4('0x7'));var ejs=require(_0x14d4('0x8'));var fs=require('fs');var fs_extra=require(_0x14d4('0x9'));var _=require('lodash');var squel=require(_0x14d4('0xa'));var crypto=require('crypto');var jsforce=require(_0x14d4('0xb'));var deskjs=require(_0x14d4('0xc'));var toCsv=require(_0x14d4('0x7'));var querystring=require(_0x14d4('0xd'));var Papa=require('papaparse');var Redis=require(_0x14d4('0xe'));var authService=require(_0x14d4('0xf'));var qs=require(_0x14d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14d4('0x11'));var logger=require(_0x14d4('0x12'))(_0x14d4('0x13'));var utils=require('../../config/utils');var config=require(_0x14d4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x14d4('0x15'))['db'];function respondWithStatusCode(_0xf84a21,_0x463a15){_0x463a15=_0x463a15||0xcc;return function(_0x599ef){if(_0x599ef){return _0xf84a21[_0x14d4('0x16')](_0x463a15);}return _0xf84a21[_0x14d4('0x17')](_0x463a15)[_0x14d4('0x18')]();};}function respondWithResult(_0x29424b,_0x58ee06){_0x58ee06=_0x58ee06||0xc8;return function(_0x34ebb4){if(_0x34ebb4){return _0x29424b['status'](_0x58ee06)['json'](_0x34ebb4);}};}function respondWithFilteredResult(_0x2affab,_0x4dead0){return function(_0x1d53bc){if(_0x1d53bc){var _0x37b9ae=typeof _0x4dead0[_0x14d4('0x19')]===_0x14d4('0x1a')&&typeof _0x4dead0[_0x14d4('0x1b')]===_0x14d4('0x1a');var _0x328919=_0x1d53bc[_0x14d4('0x1c')];var _0x5dfcf7=_0x37b9ae?0x0:_0x4dead0[_0x14d4('0x19')];var _0x3ddb76=_0x37b9ae?_0x1d53bc[_0x14d4('0x1c')]:_0x4dead0[_0x14d4('0x19')]+_0x4dead0[_0x14d4('0x1b')];var _0x3a85f1;if(_0x3ddb76>=_0x328919){_0x3ddb76=_0x328919;_0x3a85f1=0xc8;}else{_0x3a85f1=0xce;}_0x2affab[_0x14d4('0x17')](_0x3a85f1);return _0x2affab[_0x14d4('0x1d')]('Content-Range',_0x5dfcf7+'-'+_0x3ddb76+'/'+_0x328919)[_0x14d4('0x1e')](_0x1d53bc);}return null;};}function patchUpdates(_0x37a82b){return function(_0x543c21){try{jsonpatch[_0x14d4('0x1f')](_0x543c21,_0x37a82b,!![]);}catch(_0x1b678c){return BPromise[_0x14d4('0x20')](_0x1b678c);}return _0x543c21[_0x14d4('0x21')]();};}function saveUpdates(_0x4db5c0,_0x551265){return function(_0x2c7b0f){if(_0x2c7b0f){return _0x2c7b0f['update'](_0x4db5c0)[_0x14d4('0x22')](function(_0x4d7ef0){return _0x4d7ef0;});}return null;};}function removeEntity(_0x15baaa,_0x40de8e){return function(_0x4ebf9a){if(_0x4ebf9a){return _0x4ebf9a[_0x14d4('0x23')]()[_0x14d4('0x22')](function(){_0x15baaa[_0x14d4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e8ff,_0x887898){return function(_0x27b2a8){if(!_0x27b2a8){_0x47e8ff[_0x14d4('0x16')](0x194);}return _0x27b2a8;};}function handleError(_0x495143,_0x39076f){_0x39076f=_0x39076f||0x1f4;return function(_0xedb02e){logger['error'](_0xedb02e['stack']);if(_0xedb02e['name']){delete _0xedb02e[_0x14d4('0x24')];}_0x495143[_0x14d4('0x17')](_0x39076f)[_0x14d4('0x25')](_0xedb02e);};}exports['index']=function(_0x1ad745,_0x2c40dd){var _0x2504a4={},_0x350be7={},_0x207d2b={'count':0x0,'rows':[]};var _0x5968ff=_[_0x14d4('0x26')](db[_0x14d4('0x27')]['rawAttributes'],function(_0x16a0d6){return{'name':_0x16a0d6['fieldName'],'type':_0x16a0d6[_0x14d4('0x28')][_0x14d4('0x29')]};});_0x350be7[_0x14d4('0x2a')]=_[_0x14d4('0x26')](_0x5968ff,_0x14d4('0x24'));_0x350be7[_0x14d4('0x2b')]=_['keys'](_0x1ad745[_0x14d4('0x2b')]);_0x350be7[_0x14d4('0x2c')]=_[_0x14d4('0x2d')](_0x350be7[_0x14d4('0x2a')],_0x350be7['query']);_0x2504a4['attributes']=_[_0x14d4('0x2d')](_0x350be7['model'],qs[_0x14d4('0x2e')](_0x1ad745[_0x14d4('0x2b')][_0x14d4('0x2e')]));_0x2504a4['attributes']=_0x2504a4[_0x14d4('0x2f')][_0x14d4('0x30')]?_0x2504a4[_0x14d4('0x2f')]:_0x350be7[_0x14d4('0x2a')];if(!_0x1ad745['query'][_0x14d4('0x31')](_0x14d4('0x32'))){_0x2504a4[_0x14d4('0x1b')]=qs[_0x14d4('0x1b')](_0x1ad745[_0x14d4('0x2b')][_0x14d4('0x1b')]);_0x2504a4[_0x14d4('0x19')]=qs['offset'](_0x1ad745['query'][_0x14d4('0x19')]);}_0x2504a4[_0x14d4('0x33')]=qs[_0x14d4('0x34')](_0x1ad745[_0x14d4('0x2b')][_0x14d4('0x34')]);_0x2504a4['where']=qs[_0x14d4('0x2c')](_[_0x14d4('0x35')](_0x1ad745[_0x14d4('0x2b')],_0x350be7[_0x14d4('0x2c')]),_0x5968ff);if(_0x1ad745[_0x14d4('0x2b')][_0x14d4('0x36')]){_0x2504a4[_0x14d4('0x37')]=_[_0x14d4('0x38')](_0x2504a4[_0x14d4('0x37')],{'$or':_[_0x14d4('0x26')](_0x5968ff,function(_0x531b84){if(_0x531b84[_0x14d4('0x28')]!==_0x14d4('0x39')){var _0x414648={};_0x414648[_0x531b84[_0x14d4('0x24')]]={'$like':'%'+_0x1ad745['query'][_0x14d4('0x36')]+'%'};return _0x414648;}})});}_0x2504a4=_[_0x14d4('0x38')]({},_0x2504a4,_0x1ad745[_0x14d4('0x3a')]);var _0x1d79d5={'where':_0x2504a4[_0x14d4('0x37')]};return db[_0x14d4('0x27')][_0x14d4('0x1c')](_0x1d79d5)[_0x14d4('0x22')](function(_0x3655d6){_0x207d2b['count']=_0x3655d6;if(_0x1ad745[_0x14d4('0x2b')]['includeAll']){_0x2504a4[_0x14d4('0x3b')]=[{'all':!![]}];}return db['Automation'][_0x14d4('0x3c')](_0x2504a4);})['then'](function(_0x5d0567){_0x207d2b[_0x14d4('0x3d')]=_0x5d0567;return _0x207d2b;})[_0x14d4('0x22')](respondWithFilteredResult(_0x2c40dd,_0x2504a4))['catch'](handleError(_0x2c40dd,null));};exports[_0x14d4('0x3e')]=function(_0x2953f8,_0x4afc60){var _0x5bd077={'raw':![],'where':{'id':_0x2953f8['params']['id']}},_0x5d250a={};_0x5d250a['model']=_[_0x14d4('0x3f')](db[_0x14d4('0x27')]['rawAttributes']);_0x5d250a[_0x14d4('0x2b')]=_[_0x14d4('0x3f')](_0x2953f8['query']);_0x5d250a[_0x14d4('0x2c')]=_[_0x14d4('0x2d')](_0x5d250a[_0x14d4('0x2a')],_0x5d250a[_0x14d4('0x2b')]);_0x5bd077['attributes']=_[_0x14d4('0x2d')](_0x5d250a[_0x14d4('0x2a')],qs[_0x14d4('0x2e')](_0x2953f8['query'][_0x14d4('0x2e')]));_0x5bd077[_0x14d4('0x2f')]=_0x5bd077[_0x14d4('0x2f')][_0x14d4('0x30')]?_0x5bd077['attributes']:_0x5d250a[_0x14d4('0x2a')];if(_0x2953f8[_0x14d4('0x2b')][_0x14d4('0x40')]){_0x5bd077[_0x14d4('0x3b')]=[{'all':!![]}];}_0x5bd077=_[_0x14d4('0x38')]({},_0x5bd077,_0x2953f8[_0x14d4('0x3a')]);return db[_0x14d4('0x27')]['find'](_0x5bd077)[_0x14d4('0x22')](handleEntityNotFound(_0x4afc60,null))[_0x14d4('0x22')](respondWithResult(_0x4afc60,null))[_0x14d4('0x41')](handleError(_0x4afc60,null));};exports[_0x14d4('0x42')]=function(_0x3be977,_0x448679){return db['Automation'][_0x14d4('0x42')](_0x3be977[_0x14d4('0x43')],{})[_0x14d4('0x22')](respondWithResult(_0x448679,0xc9))[_0x14d4('0x41')](handleError(_0x448679,null));};exports['update']=function(_0x1af073,_0x453431){if(_0x1af073['body']['id']){delete _0x1af073[_0x14d4('0x43')]['id'];}return db[_0x14d4('0x27')][_0x14d4('0x44')]({'where':{'id':_0x1af073[_0x14d4('0x45')]['id']}})[_0x14d4('0x22')](handleEntityNotFound(_0x453431,null))['then'](saveUpdates(_0x1af073[_0x14d4('0x43')],null))['then'](respondWithResult(_0x453431,null))[_0x14d4('0x41')](handleError(_0x453431,null));};exports[_0x14d4('0x23')]=function(_0x141213,_0x543de9){return db[_0x14d4('0x27')][_0x14d4('0x44')]({'where':{'id':_0x141213[_0x14d4('0x45')]['id']}})[_0x14d4('0x22')](handleEntityNotFound(_0x543de9,null))[_0x14d4('0x22')](removeEntity(_0x543de9,null))[_0x14d4('0x41')](handleError(_0x543de9,null));};exports['addConditions']=function(_0x1f9df0,_0x3fd1fc,_0x338c3b){return db[_0x14d4('0x46')][_0x14d4('0x44')]({'where':{'id':_0x1f9df0[_0x14d4('0x45')]['id']}})[_0x14d4('0x22')](handleEntityNotFound(_0x3fd1fc,null))[_0x14d4('0x22')](function(_0x481823){if(_0x481823){return _0x481823[_0x14d4('0x47')](_0x1f9df0[_0x14d4('0x43')][_0x14d4('0x48')],_['omit'](_0x1f9df0[_0x14d4('0x43')],[_0x14d4('0x48'),'id'])||{});}})[_0x14d4('0x22')](respondWithResult(_0x3fd1fc,null))[_0x14d4('0x41')](handleError(_0x3fd1fc,null));};exports['getConditions']=function(_0x5512ff,_0x48e7fd,_0x2042f0){var _0xacc71c={};var _0x28cfe8={};var _0x3d3ea1;var _0x3d27b0;return db[_0x14d4('0x27')][_0x14d4('0x49')]({'where':{'id':_0x5512ff[_0x14d4('0x45')]['id']}})['then'](handleEntityNotFound(_0x48e7fd,null))[_0x14d4('0x22')](function(_0x4e8614){if(_0x4e8614){_0x3d3ea1=_0x4e8614;_0x28cfe8[_0x14d4('0x2a')]=_[_0x14d4('0x3f')](db[_0x14d4('0x46')][_0x14d4('0x4a')]);_0x28cfe8['query']=_[_0x14d4('0x3f')](_0x5512ff['query']);_0x28cfe8[_0x14d4('0x2c')]=_['intersection'](_0x28cfe8['model'],_0x28cfe8[_0x14d4('0x2b')]);_0xacc71c[_0x14d4('0x2f')]=_[_0x14d4('0x2d')](_0x28cfe8[_0x14d4('0x2a')],qs[_0x14d4('0x2e')](_0x5512ff['query'][_0x14d4('0x2e')]));_0xacc71c[_0x14d4('0x2f')]=_0xacc71c[_0x14d4('0x2f')]['length']?_0xacc71c[_0x14d4('0x2f')]:_0x28cfe8[_0x14d4('0x2a')];_0xacc71c[_0x14d4('0x33')]=qs['sort'](_0x5512ff[_0x14d4('0x2b')][_0x14d4('0x34')]);_0xacc71c[_0x14d4('0x37')]=qs[_0x14d4('0x2c')](_['pick'](_0x5512ff[_0x14d4('0x2b')],_0x28cfe8[_0x14d4('0x2c')]));if(_0x5512ff[_0x14d4('0x2b')][_0x14d4('0x36')]){_0xacc71c[_0x14d4('0x37')]=_[_0x14d4('0x38')](_0xacc71c[_0x14d4('0x37')],{'$or':_[_0x14d4('0x26')](_0xacc71c['attributes'],function(_0x52d9da){var _0x87bc58={};_0x87bc58[_0x52d9da]={'$like':'%'+_0x5512ff['query'][_0x14d4('0x36')]+'%'};return _0x87bc58;})});}_0xacc71c=_[_0x14d4('0x38')]({},_0xacc71c,_0x5512ff[_0x14d4('0x3a')]);return _0x3d3ea1[_0x14d4('0x4b')](_0xacc71c);}})[_0x14d4('0x22')](function(_0x485c19){if(_0x485c19){_0x3d27b0=_0x485c19['length'];if(!_0x5512ff[_0x14d4('0x2b')][_0x14d4('0x31')]('nolimit')){_0xacc71c[_0x14d4('0x1b')]=qs[_0x14d4('0x1b')](_0x5512ff[_0x14d4('0x2b')][_0x14d4('0x1b')]);_0xacc71c[_0x14d4('0x19')]=qs[_0x14d4('0x19')](_0x5512ff[_0x14d4('0x2b')][_0x14d4('0x19')]);}return _0x3d3ea1[_0x14d4('0x4b')](_0xacc71c);}})[_0x14d4('0x22')](function(_0x2a82db){if(_0x2a82db){return _0x2a82db?{'count':_0x3d27b0,'rows':_0x2a82db}:null;}})['then'](respondWithResult(_0x48e7fd,null))[_0x14d4('0x41')](handleError(_0x48e7fd,null));};exports[_0x14d4('0x4c')]=function(_0x540769,_0x25c2e0,_0x41489e){return db[_0x14d4('0x4d')][_0x14d4('0x44')]({'where':{'id':_0x540769[_0x14d4('0x45')]['id']}})[_0x14d4('0x22')](handleEntityNotFound(_0x25c2e0,null))['then'](function(_0x53984a){if(_0x53984a){return _0x53984a['addActions'](_0x540769[_0x14d4('0x43')]['ids'],_[_0x14d4('0x4e')](_0x540769[_0x14d4('0x43')],[_0x14d4('0x48'),'id'])||{});}})[_0x14d4('0x22')](respondWithResult(_0x25c2e0,null))[_0x14d4('0x41')](handleError(_0x25c2e0,null));};exports[_0x14d4('0x4f')]=function(_0x205a83,_0x11df6d,_0x3c3756){var _0x6611a7={};var _0x407136={};var _0x1ee21c;var _0x4b799d;return db[_0x14d4('0x27')][_0x14d4('0x49')]({'where':{'id':_0x205a83[_0x14d4('0x45')]['id']}})['then'](handleEntityNotFound(_0x11df6d,null))['then'](function(_0x5bf422){if(_0x5bf422){_0x1ee21c=_0x5bf422;_0x407136['model']=_[_0x14d4('0x3f')](db[_0x14d4('0x4d')]['rawAttributes']);_0x407136[_0x14d4('0x2b')]=_['keys'](_0x205a83[_0x14d4('0x2b')]);_0x407136[_0x14d4('0x2c')]=_[_0x14d4('0x2d')](_0x407136[_0x14d4('0x2a')],_0x407136[_0x14d4('0x2b')]);_0x6611a7[_0x14d4('0x2f')]=_[_0x14d4('0x2d')](_0x407136['model'],qs['fields'](_0x205a83[_0x14d4('0x2b')][_0x14d4('0x2e')]));_0x6611a7[_0x14d4('0x2f')]=_0x6611a7['attributes']['length']?_0x6611a7[_0x14d4('0x2f')]:_0x407136['model'];_0x6611a7[_0x14d4('0x33')]=qs[_0x14d4('0x34')](_0x205a83[_0x14d4('0x2b')][_0x14d4('0x34')]);_0x6611a7[_0x14d4('0x37')]=qs[_0x14d4('0x2c')](_[_0x14d4('0x35')](_0x205a83[_0x14d4('0x2b')],_0x407136[_0x14d4('0x2c')]));if(_0x205a83['query'][_0x14d4('0x36')]){_0x6611a7['where']=_[_0x14d4('0x38')](_0x6611a7['where'],{'$or':_[_0x14d4('0x26')](_0x6611a7[_0x14d4('0x2f')],function(_0x4fca3a){var _0x247bd7={};_0x247bd7[_0x4fca3a]={'$like':'%'+_0x205a83[_0x14d4('0x2b')][_0x14d4('0x36')]+'%'};return _0x247bd7;})});}_0x6611a7=_['merge']({},_0x6611a7,_0x205a83[_0x14d4('0x3a')]);return _0x1ee21c['getActions'](_0x6611a7);}})[_0x14d4('0x22')](function(_0x22fff3){if(_0x22fff3){_0x4b799d=_0x22fff3[_0x14d4('0x30')];if(!_0x205a83[_0x14d4('0x2b')][_0x14d4('0x31')](_0x14d4('0x32'))){_0x6611a7[_0x14d4('0x1b')]=qs[_0x14d4('0x1b')](_0x205a83['query'][_0x14d4('0x1b')]);_0x6611a7['offset']=qs[_0x14d4('0x19')](_0x205a83['query'][_0x14d4('0x19')]);}return _0x1ee21c[_0x14d4('0x4f')](_0x6611a7);}})[_0x14d4('0x22')](function(_0x5d158d){if(_0x5d158d){return _0x5d158d?{'count':_0x4b799d,'rows':_0x5d158d}:null;}})['then'](respondWithResult(_0x11df6d,null))[_0x14d4('0x41')](handleError(_0x11df6d,null));}; \ No newline at end of file +var _0x856d=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Automation','findAll','rows','catch','show','params','filters','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2b8121,_0x128869){var _0xec2947=function(_0x424997){while(--_0x424997){_0x2b8121['push'](_0x2b8121['shift']());}};_0xec2947(++_0x128869);}(_0x856d,0x93));var _0xd856=function(_0x19f838,_0x5c3217){_0x19f838=_0x19f838-0x0;var _0x139ecc=_0x856d[_0x19f838];return _0x139ecc;};'use strict';var emlformat=require(_0xd856('0x0'));var rimraf=require(_0xd856('0x1'));var zipdir=require(_0xd856('0x2'));var jsonpatch=require(_0xd856('0x3'));var rp=require(_0xd856('0x4'));var moment=require(_0xd856('0x5'));var BPromise=require(_0xd856('0x6'));var Mustache=require(_0xd856('0x7'));var util=require(_0xd856('0x8'));var path=require(_0xd856('0x9'));var sox=require(_0xd856('0xa'));var csv=require(_0xd856('0xb'));var ejs=require(_0xd856('0xc'));var fs=require('fs');var fs_extra=require(_0xd856('0xd'));var _=require('lodash');var squel=require(_0xd856('0xe'));var crypto=require('crypto');var jsforce=require(_0xd856('0xf'));var deskjs=require(_0xd856('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd856('0x11'));var Redis=require(_0xd856('0x12'));var authService=require(_0xd856('0x13'));var qs=require(_0xd856('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd856('0x15'));var utils=require(_0xd856('0x16'));var config=require(_0xd856('0x17'));var licenseUtil=require(_0xd856('0x18'));var db=require(_0xd856('0x19'))['db'];function respondWithStatusCode(_0x326243,_0x23c161){_0x23c161=_0x23c161||0xcc;return function(_0x429628){if(_0x429628){return _0x326243[_0xd856('0x1a')](_0x23c161);}return _0x326243[_0xd856('0x1b')](_0x23c161)[_0xd856('0x1c')]();};}function respondWithResult(_0x4958a2,_0x1cad81){_0x1cad81=_0x1cad81||0xc8;return function(_0x4e6cf2){if(_0x4e6cf2){return _0x4958a2[_0xd856('0x1b')](_0x1cad81)[_0xd856('0x1d')](_0x4e6cf2);}};}function respondWithFilteredResult(_0xd0cf89,_0x2af87c){return function(_0x22d229){if(_0x22d229){var _0x383101=typeof _0x2af87c[_0xd856('0x1e')]===_0xd856('0x1f')&&typeof _0x2af87c[_0xd856('0x20')]===_0xd856('0x1f');var _0x2a2602=_0x22d229[_0xd856('0x21')];var _0x1d1201=_0x383101?0x0:_0x2af87c[_0xd856('0x1e')];var _0x33478b=_0x383101?_0x22d229['count']:_0x2af87c[_0xd856('0x1e')]+_0x2af87c[_0xd856('0x20')];var _0x1b7471;if(_0x33478b>=_0x2a2602){_0x33478b=_0x2a2602;_0x1b7471=0xc8;}else{_0x1b7471=0xce;}_0xd0cf89[_0xd856('0x1b')](_0x1b7471);return _0xd0cf89[_0xd856('0x22')](_0xd856('0x23'),_0x1d1201+'-'+_0x33478b+'/'+_0x2a2602)[_0xd856('0x1d')](_0x22d229);}return null;};}function patchUpdates(_0x5b8040){return function(_0x2f16c3){try{jsonpatch[_0xd856('0x24')](_0x2f16c3,_0x5b8040,!![]);}catch(_0x38c6a9){return BPromise[_0xd856('0x25')](_0x38c6a9);}return _0x2f16c3[_0xd856('0x26')]();};}function saveUpdates(_0x15bb9b,_0x5a2577){return function(_0x2d969e){if(_0x2d969e){return _0x2d969e[_0xd856('0x27')](_0x15bb9b)[_0xd856('0x28')](function(_0x26f230){return _0x26f230;});}return null;};}function removeEntity(_0x46f56c,_0xc57a70){return function(_0x81f125){if(_0x81f125){return _0x81f125[_0xd856('0x29')]()['then'](function(){_0x46f56c[_0xd856('0x1b')](0xcc)[_0xd856('0x1c')]();});}};}function handleEntityNotFound(_0x4198e4,_0xbbe50d){return function(_0x391619){if(!_0x391619){_0x4198e4['sendStatus'](0x194);}return _0x391619;};}function handleError(_0x1d0e2e,_0x46f5b5){_0x46f5b5=_0x46f5b5||0x1f4;return function(_0x1149d3){logger[_0xd856('0x2a')](_0x1149d3[_0xd856('0x2b')]);if(_0x1149d3[_0xd856('0x2c')]){delete _0x1149d3['name'];}_0x1d0e2e[_0xd856('0x1b')](_0x46f5b5)[_0xd856('0x2d')](_0x1149d3);};}exports[_0xd856('0x2e')]=function(_0x360c82,_0x55c19b){var _0x20bd65={},_0xabbe84={},_0x539474={'count':0x0,'rows':[]};var _0x4394d4=_[_0xd856('0x2f')](db['Automation'][_0xd856('0x30')],function(_0x8a01a7){return{'name':_0x8a01a7['fieldName'],'type':_0x8a01a7[_0xd856('0x31')][_0xd856('0x32')]};});_0xabbe84[_0xd856('0x33')]=_[_0xd856('0x2f')](_0x4394d4,_0xd856('0x2c'));_0xabbe84[_0xd856('0x34')]=_[_0xd856('0x35')](_0x360c82['query']);_0xabbe84['filters']=_[_0xd856('0x36')](_0xabbe84[_0xd856('0x33')],_0xabbe84[_0xd856('0x34')]);_0x20bd65[_0xd856('0x37')]=_[_0xd856('0x36')](_0xabbe84[_0xd856('0x33')],qs['fields'](_0x360c82['query'][_0xd856('0x38')]));_0x20bd65[_0xd856('0x37')]=_0x20bd65[_0xd856('0x37')][_0xd856('0x39')]?_0x20bd65[_0xd856('0x37')]:_0xabbe84['model'];if(!_0x360c82[_0xd856('0x34')]['hasOwnProperty'](_0xd856('0x3a'))){_0x20bd65[_0xd856('0x20')]=qs['limit'](_0x360c82[_0xd856('0x34')][_0xd856('0x20')]);_0x20bd65[_0xd856('0x1e')]=qs[_0xd856('0x1e')](_0x360c82[_0xd856('0x34')][_0xd856('0x1e')]);}_0x20bd65[_0xd856('0x3b')]=qs['sort'](_0x360c82[_0xd856('0x34')][_0xd856('0x3c')]);_0x20bd65[_0xd856('0x3d')]=qs['filters'](_[_0xd856('0x3e')](_0x360c82['query'],_0xabbe84['filters']),_0x4394d4);if(_0x360c82['query'][_0xd856('0x3f')]){_0x20bd65[_0xd856('0x3d')]=_[_0xd856('0x40')](_0x20bd65[_0xd856('0x3d')],{'$or':_[_0xd856('0x2f')](_0x4394d4,function(_0x560c7e){if(_0x560c7e['type']!==_0xd856('0x41')){var _0x4a6a56={};_0x4a6a56[_0x560c7e['name']]={'$like':'%'+_0x360c82[_0xd856('0x34')][_0xd856('0x3f')]+'%'};return _0x4a6a56;}})});}_0x20bd65=_[_0xd856('0x40')]({},_0x20bd65,_0x360c82[_0xd856('0x42')]);var _0x9df496={'where':_0x20bd65[_0xd856('0x3d')]};return db['Automation'][_0xd856('0x21')](_0x9df496)[_0xd856('0x28')](function(_0x22257b){_0x539474['count']=_0x22257b;if(_0x360c82[_0xd856('0x34')][_0xd856('0x43')]){_0x20bd65[_0xd856('0x44')]=[{'all':!![]}];}return db[_0xd856('0x45')][_0xd856('0x46')](_0x20bd65);})[_0xd856('0x28')](function(_0x2ff90c){_0x539474[_0xd856('0x47')]=_0x2ff90c;return _0x539474;})[_0xd856('0x28')](respondWithFilteredResult(_0x55c19b,_0x20bd65))[_0xd856('0x48')](handleError(_0x55c19b,null));};exports[_0xd856('0x49')]=function(_0x576032,_0x3faf16){var _0x28f39d={'raw':![],'where':{'id':_0x576032[_0xd856('0x4a')]['id']}},_0x5c875a={};_0x5c875a[_0xd856('0x33')]=_[_0xd856('0x35')](db[_0xd856('0x45')][_0xd856('0x30')]);_0x5c875a[_0xd856('0x34')]=_[_0xd856('0x35')](_0x576032[_0xd856('0x34')]);_0x5c875a[_0xd856('0x4b')]=_[_0xd856('0x36')](_0x5c875a['model'],_0x5c875a['query']);_0x28f39d['attributes']=_[_0xd856('0x36')](_0x5c875a[_0xd856('0x33')],qs['fields'](_0x576032[_0xd856('0x34')]['fields']));_0x28f39d[_0xd856('0x37')]=_0x28f39d[_0xd856('0x37')][_0xd856('0x39')]?_0x28f39d['attributes']:_0x5c875a[_0xd856('0x33')];if(_0x576032[_0xd856('0x34')][_0xd856('0x43')]){_0x28f39d[_0xd856('0x44')]=[{'all':!![]}];}_0x28f39d=_[_0xd856('0x40')]({},_0x28f39d,_0x576032[_0xd856('0x42')]);return db[_0xd856('0x45')][_0xd856('0x4c')](_0x28f39d)[_0xd856('0x28')](handleEntityNotFound(_0x3faf16,null))['then'](respondWithResult(_0x3faf16,null))[_0xd856('0x48')](handleError(_0x3faf16,null));};exports[_0xd856('0x4d')]=function(_0x3767b6,_0x8a7ad7){return db[_0xd856('0x45')][_0xd856('0x4d')](_0x3767b6[_0xd856('0x4e')],{})[_0xd856('0x28')](respondWithResult(_0x8a7ad7,0xc9))[_0xd856('0x48')](handleError(_0x8a7ad7,null));};exports[_0xd856('0x27')]=function(_0x24abe7,_0x592363){if(_0x24abe7[_0xd856('0x4e')]['id']){delete _0x24abe7[_0xd856('0x4e')]['id'];}return db[_0xd856('0x45')][_0xd856('0x4c')]({'where':{'id':_0x24abe7[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x592363,null))[_0xd856('0x28')](saveUpdates(_0x24abe7[_0xd856('0x4e')],null))['then'](respondWithResult(_0x592363,null))[_0xd856('0x48')](handleError(_0x592363,null));};exports[_0xd856('0x29')]=function(_0x227731,_0x5aaa64){return db[_0xd856('0x45')][_0xd856('0x4c')]({'where':{'id':_0x227731[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x5aaa64,null))[_0xd856('0x28')](removeEntity(_0x5aaa64,null))[_0xd856('0x48')](handleError(_0x5aaa64,null));};exports[_0xd856('0x4f')]=function(_0x9ef291,_0x37944e,_0x447544){return db[_0xd856('0x50')][_0xd856('0x4c')]({'where':{'id':_0x9ef291[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x37944e,null))[_0xd856('0x28')](function(_0x3ab4b6){if(_0x3ab4b6){return _0x3ab4b6[_0xd856('0x4f')](_0x9ef291['body'][_0xd856('0x51')],_[_0xd856('0x52')](_0x9ef291[_0xd856('0x4e')],[_0xd856('0x51'),'id'])||{});}})['then'](respondWithResult(_0x37944e,null))[_0xd856('0x48')](handleError(_0x37944e,null));};exports['getConditions']=function(_0x540124,_0x10905f,_0x592caf){var _0x45edb5={};var _0x1d146f={};var _0x79deab;var _0x43dd46;return db[_0xd856('0x45')][_0xd856('0x53')]({'where':{'id':_0x540124[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0x10905f,null))[_0xd856('0x28')](function(_0x53b189){if(_0x53b189){_0x79deab=_0x53b189;_0x1d146f[_0xd856('0x33')]=_[_0xd856('0x35')](db[_0xd856('0x50')][_0xd856('0x30')]);_0x1d146f[_0xd856('0x34')]=_[_0xd856('0x35')](_0x540124[_0xd856('0x34')]);_0x1d146f[_0xd856('0x4b')]=_[_0xd856('0x36')](_0x1d146f['model'],_0x1d146f[_0xd856('0x34')]);_0x45edb5[_0xd856('0x37')]=_['intersection'](_0x1d146f[_0xd856('0x33')],qs[_0xd856('0x38')](_0x540124[_0xd856('0x34')]['fields']));_0x45edb5['attributes']=_0x45edb5[_0xd856('0x37')][_0xd856('0x39')]?_0x45edb5[_0xd856('0x37')]:_0x1d146f[_0xd856('0x33')];_0x45edb5['order']=qs['sort'](_0x540124[_0xd856('0x34')][_0xd856('0x3c')]);_0x45edb5[_0xd856('0x3d')]=qs[_0xd856('0x4b')](_['pick'](_0x540124[_0xd856('0x34')],_0x1d146f[_0xd856('0x4b')]));if(_0x540124[_0xd856('0x34')][_0xd856('0x3f')]){_0x45edb5[_0xd856('0x3d')]=_['merge'](_0x45edb5['where'],{'$or':_[_0xd856('0x2f')](_0x45edb5[_0xd856('0x37')],function(_0x1dd32e){var _0x5812d6={};_0x5812d6[_0x1dd32e]={'$like':'%'+_0x540124[_0xd856('0x34')][_0xd856('0x3f')]+'%'};return _0x5812d6;})});}_0x45edb5=_[_0xd856('0x40')]({},_0x45edb5,_0x540124[_0xd856('0x42')]);return _0x79deab[_0xd856('0x54')](_0x45edb5);}})[_0xd856('0x28')](function(_0x5b66c7){if(_0x5b66c7){_0x43dd46=_0x5b66c7[_0xd856('0x39')];if(!_0x540124[_0xd856('0x34')][_0xd856('0x55')](_0xd856('0x3a'))){_0x45edb5[_0xd856('0x20')]=qs[_0xd856('0x20')](_0x540124[_0xd856('0x34')][_0xd856('0x20')]);_0x45edb5[_0xd856('0x1e')]=qs['offset'](_0x540124['query'][_0xd856('0x1e')]);}return _0x79deab[_0xd856('0x54')](_0x45edb5);}})[_0xd856('0x28')](function(_0x402566){if(_0x402566){return _0x402566?{'count':_0x43dd46,'rows':_0x402566}:null;}})[_0xd856('0x28')](respondWithResult(_0x10905f,null))[_0xd856('0x48')](handleError(_0x10905f,null));};exports[_0xd856('0x56')]=function(_0x4a26d2,_0x36e1e4,_0xc9195){return db[_0xd856('0x57')][_0xd856('0x4c')]({'where':{'id':_0x4a26d2[_0xd856('0x4a')]['id']}})['then'](handleEntityNotFound(_0x36e1e4,null))[_0xd856('0x28')](function(_0x320c3c){if(_0x320c3c){return _0x320c3c[_0xd856('0x56')](_0x4a26d2['body'][_0xd856('0x51')],_['omit'](_0x4a26d2[_0xd856('0x4e')],[_0xd856('0x51'),'id'])||{});}})['then'](respondWithResult(_0x36e1e4,null))[_0xd856('0x48')](handleError(_0x36e1e4,null));};exports[_0xd856('0x58')]=function(_0x5009af,_0xb94712,_0x26f185){var _0x579937={};var _0x4713d5={};var _0x1ecd88;var _0x44d8f6;return db[_0xd856('0x45')][_0xd856('0x53')]({'where':{'id':_0x5009af[_0xd856('0x4a')]['id']}})[_0xd856('0x28')](handleEntityNotFound(_0xb94712,null))[_0xd856('0x28')](function(_0x28a4fc){if(_0x28a4fc){_0x1ecd88=_0x28a4fc;_0x4713d5['model']=_[_0xd856('0x35')](db[_0xd856('0x57')]['rawAttributes']);_0x4713d5['query']=_[_0xd856('0x35')](_0x5009af[_0xd856('0x34')]);_0x4713d5[_0xd856('0x4b')]=_[_0xd856('0x36')](_0x4713d5[_0xd856('0x33')],_0x4713d5[_0xd856('0x34')]);_0x579937[_0xd856('0x37')]=_['intersection'](_0x4713d5[_0xd856('0x33')],qs[_0xd856('0x38')](_0x5009af[_0xd856('0x34')]['fields']));_0x579937[_0xd856('0x37')]=_0x579937['attributes']['length']?_0x579937[_0xd856('0x37')]:_0x4713d5['model'];_0x579937[_0xd856('0x3b')]=qs[_0xd856('0x3c')](_0x5009af[_0xd856('0x34')][_0xd856('0x3c')]);_0x579937['where']=qs['filters'](_[_0xd856('0x3e')](_0x5009af[_0xd856('0x34')],_0x4713d5[_0xd856('0x4b')]));if(_0x5009af[_0xd856('0x34')]['filter']){_0x579937[_0xd856('0x3d')]=_[_0xd856('0x40')](_0x579937[_0xd856('0x3d')],{'$or':_[_0xd856('0x2f')](_0x579937['attributes'],function(_0x344d0d){var _0x40a1e2={};_0x40a1e2[_0x344d0d]={'$like':'%'+_0x5009af[_0xd856('0x34')][_0xd856('0x3f')]+'%'};return _0x40a1e2;})});}_0x579937=_[_0xd856('0x40')]({},_0x579937,_0x5009af[_0xd856('0x42')]);return _0x1ecd88[_0xd856('0x58')](_0x579937);}})[_0xd856('0x28')](function(_0x926df3){if(_0x926df3){_0x44d8f6=_0x926df3[_0xd856('0x39')];if(!_0x5009af[_0xd856('0x34')][_0xd856('0x55')](_0xd856('0x3a'))){_0x579937[_0xd856('0x20')]=qs[_0xd856('0x20')](_0x5009af[_0xd856('0x34')]['limit']);_0x579937[_0xd856('0x1e')]=qs[_0xd856('0x1e')](_0x5009af['query'][_0xd856('0x1e')]);}return _0x1ecd88[_0xd856('0x58')](_0x579937);}})[_0xd856('0x28')](function(_0x5b7bb0){if(_0x5b7bb0){return _0x5b7bb0?{'count':_0x44d8f6,'rows':_0x5b7bb0}:null;}})[_0xd856('0x28')](respondWithResult(_0xb94712,null))['catch'](handleError(_0xb94712,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c1a6ba1..700b085 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 _0xab74=['moment','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api'];(function(_0x197a9f,_0x5ebc48){var _0x5b6c58=function(_0x1b8d53){while(--_0x1b8d53){_0x197a9f['push'](_0x197a9f['shift']());}};_0x5b6c58(++_0x5ebc48);}(_0xab74,0x14d));var _0x4ab7=function(_0x50e068,_0xc970a5){_0x50e068=_0x50e068-0x0;var _0x3f0700=_0xab74[_0x50e068];return _0x3f0700;};'use strict';var _=require(_0x4ab7('0x0'));var util=require(_0x4ab7('0x1'));var logger=require('../../config/logger')(_0x4ab7('0x2'));var moment=require(_0x4ab7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ab7('0x4'));var rimraf=require(_0x4ab7('0x5'));var config=require(_0x4ab7('0x6'));var attributes=require(_0x4ab7('0x7'));module[_0x4ab7('0x8')]=function(_0x543965,_0x1ffe3b){return _0x543965[_0x4ab7('0x9')](_0x4ab7('0xa'),attributes,{'tableName':_0x4ab7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9397=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x9397,0xaa));var _0x7939=function(_0x167015,_0xf06138){_0x167015=_0x167015-0x0;var _0x4e7da3=_0x9397[_0x167015];return _0x4e7da3;};'use strict';var _=require(_0x7939('0x0'));var util=require(_0x7939('0x1'));var logger=require(_0x7939('0x2'))(_0x7939('0x3'));var moment=require(_0x7939('0x4'));var BPromise=require(_0x7939('0x5'));var rp=require(_0x7939('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7939('0x7'));var attributes=require(_0x7939('0x8'));module[_0x7939('0x9')]=function(_0x32eb39,_0x33cdae){return _0x32eb39[_0x7939('0xa')](_0x7939('0xb'),attributes,{'tableName':_0x7939('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 c32b4f9..66bd54f 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 _0xa057=['debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x4e8810,_0x3d5c69){var _0x195ea0=function(_0x19bbec){while(--_0x19bbec){_0x4e8810['push'](_0x4e8810['shift']());}};_0x195ea0(++_0x3d5c69);}(_0xa057,0x123));var _0x7a05=function(_0x4df99d,_0xf02442){_0x4df99d=_0x4df99d-0x0;var _0x572b21=_0xa057[_0x4df99d];return _0x572b21;};'use strict';var _=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var moment=require('moment');var BPromise=require(_0x7a05('0x2'));var rs=require(_0x7a05('0x3'));var fs=require('fs');var Redis=require(_0x7a05('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a05('0x5'));var logger=require(_0x7a05('0x6'))('rpc');var config=require(_0x7a05('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a05('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19e056,_0x2572af,_0x560067){return new BPromise(function(_0x32d32f,_0x2135d2){return client[_0x7a05('0x9')](_0x19e056,_0x560067)['then'](function(_0x31841c){logger[_0x7a05('0xa')](_0x7a05('0xb'),_0x2572af,_0x7a05('0xc'));logger[_0x7a05('0xd')](_0x7a05('0xe'),_0x2572af,'request\x20sent',JSON[_0x7a05('0xf')](_0x31841c));if(_0x31841c[_0x7a05('0x10')]){if(_0x31841c['error']['code']===0x1f4){logger[_0x7a05('0x10')](_0x7a05('0xb'),_0x2572af,_0x31841c['error']['message']);return _0x2135d2(_0x31841c['error'][_0x7a05('0x11')]);}logger[_0x7a05('0x10')](_0x7a05('0xb'),_0x2572af,_0x31841c[_0x7a05('0x10')][_0x7a05('0x11')]);return _0x32d32f(_0x31841c[_0x7a05('0x10')][_0x7a05('0x11')]);}else{logger[_0x7a05('0xa')]('Automation,\x20%s,\x20%s',_0x2572af,'request\x20sent');_0x32d32f(_0x31841c[_0x7a05('0x12')][_0x7a05('0x11')]);}})['catch'](function(_0x5ad0e6){logger[_0x7a05('0x10')]('Automation,\x20%s,\x20%s',_0x2572af,_0x5ad0e6);_0x2135d2(_0x5ad0e6);});});} \ No newline at end of file +var _0xd8d7=['client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise'];(function(_0x5f2280,_0x202963){var _0xb2007c=function(_0x38b7c9){while(--_0x38b7c9){_0x5f2280['push'](_0x5f2280['shift']());}};_0xb2007c(++_0x202963);}(_0xd8d7,0x1d4));var _0x7d8d=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0xd8d7[_0xdbe2de];return _0x2facd7;};'use strict';var _=require(_0x7d8d('0x0'));var util=require(_0x7d8d('0x1'));var moment=require(_0x7d8d('0x2'));var BPromise=require(_0x7d8d('0x3'));var rs=require(_0x7d8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d8d('0x5'));var config=require('../../config/environment');var jayson=require(_0x7d8d('0x6'));var client=jayson[_0x7d8d('0x7')][_0x7d8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc39292,_0x2294c2,_0x3036a9){return new BPromise(function(_0x1bac2e,_0x506fcd){return client[_0x7d8d('0x9')](_0xc39292,_0x3036a9)[_0x7d8d('0xa')](function(_0x3e2f6e){logger[_0x7d8d('0xb')](_0x7d8d('0xc'),_0x2294c2,_0x7d8d('0xd'));logger[_0x7d8d('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'),JSON[_0x7d8d('0xf')](_0x3e2f6e));if(_0x3e2f6e[_0x7d8d('0x10')]){if(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x11')]===0x1f4){logger['error'](_0x7d8d('0xc'),_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x506fcd(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}logger[_0x7d8d('0x10')]('Automation,\x20%s,\x20%s',_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x1bac2e(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}else{logger[_0x7d8d('0xb')]('Automation,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'));_0x1bac2e(_0x3e2f6e['result'][_0x7d8d('0x12')]);}})['catch'](function(_0x12588c){logger[_0x7d8d('0x10')](_0x7d8d('0xc'),_0x2294c2,_0x12588c);_0x506fcd(_0x12588c);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f36489e..30930bb 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 _0x146a=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x146a,0x9d));var _0xa146=function(_0x40eec9,_0x817a67){_0x40eec9=_0x40eec9-0x0;var _0xfee890=_0x146a[_0x40eec9];return _0xfee890;};'use strict';var multer=require(_0xa146('0x0'));var util=require(_0xa146('0x1'));var path=require('path');var timeout=require(_0xa146('0x2'));var express=require(_0xa146('0x3'));var router=express[_0xa146('0x4')]();var fs_extra=require(_0xa146('0x5'));var auth=require(_0xa146('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa146('0x7'));var controller=require(_0xa146('0x8'));router[_0xa146('0x9')]('/',auth[_0xa146('0xa')](),controller[_0xa146('0xb')]);router['get'](_0xa146('0xc'),auth[_0xa146('0xa')](),controller[_0xa146('0xd')]);router[_0xa146('0x9')](_0xa146('0xe'),auth[_0xa146('0xa')](),controller[_0xa146('0xf')]);router[_0xa146('0x9')]('/:id/actions',auth[_0xa146('0xa')](),controller[_0xa146('0x10')]);router[_0xa146('0x11')]('/',auth[_0xa146('0xa')](),controller[_0xa146('0x12')]);router[_0xa146('0x11')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xa146('0x13')]);router[_0xa146('0x11')](_0xa146('0x14'),auth[_0xa146('0xa')](),controller[_0xa146('0x15')]);router[_0xa146('0x16')](_0xa146('0xc'),auth[_0xa146('0xa')](),controller[_0xa146('0x17')]);router[_0xa146('0x18')](_0xa146('0xc'),auth['isAuthenticated'](),controller[_0xa146('0x19')]);module['exports']=router; \ No newline at end of file +var _0xb790=['create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','util','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0xb790,0xe5));var _0x0b79=function(_0xa1dc2c,_0x6d230d){_0xa1dc2c=_0xa1dc2c-0x0;var _0x4caf06=_0xb790[_0xa1dc2c];return _0x4caf06;};'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('./automation.controller');router[_0x0b79('0x4')]('/',auth[_0x0b79('0x5')](),controller[_0x0b79('0x6')]);router[_0x0b79('0x4')](_0x0b79('0x7'),auth[_0x0b79('0x5')](),controller[_0x0b79('0x8')]);router[_0x0b79('0x4')](_0x0b79('0x9'),auth[_0x0b79('0x5')](),controller[_0x0b79('0xa')]);router[_0x0b79('0x4')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0b79('0xb')]);router[_0x0b79('0xc')]('/',auth[_0x0b79('0x5')](),controller[_0x0b79('0xd')]);router[_0x0b79('0xc')]('/:id/conditions',auth[_0x0b79('0x5')](),controller[_0x0b79('0xe')]);router['post'](_0x0b79('0xf'),auth[_0x0b79('0x5')](),controller[_0x0b79('0x10')]);router[_0x0b79('0x11')]('/:id',auth[_0x0b79('0x5')](),controller[_0x0b79('0x12')]);router[_0x0b79('0x13')](_0x0b79('0x7'),auth['isAuthenticated'](),controller[_0x0b79('0x14')]);module[_0x0b79('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 137006e..5d8e8b0 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 _0xbb48=['sequelize','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb48,0x1ee));var _0x8bb4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbb48[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x8bb4('0x0'));module[_0x8bb4('0x1')]={'name':{'type':Sequelize[_0x8bb4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x8bb4('0x3')),'allowNull':![],'defaultValue':_0x8bb4('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8bb4('0x4')],'defaultValue':0x0,'comment':_0x8bb4('0x5')},'limitCalls':{'type':Sequelize[_0x8bb4('0x6')](0x4)[_0x8bb4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8bb4('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8bb4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8bb4('0x6')](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8bb4('0x6')](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8bb4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8bb4('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'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['STRING'],'defaultValue':_0x8bb4('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8bb4('0xf'),'never',_0x8bb4('0x10')),'defaultValue':_0x8bb4('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8bb4('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8bb4('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8bb4('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x8bb4('0x6')](0x9)[_0x8bb4('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8bb4('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8bb4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8bb4('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8bb4('0x6')](0x9)[_0x8bb4('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bb4('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8bb4('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8bb4('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8bb4('0x6')](0x9)[_0x8bb4('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8bb4('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x8bb4('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8bb4('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8bb4('0x6')](0x5)[_0x8bb4('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8bb4('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8bb4('0x6')](0x9)[_0x8bb4('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bb4('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x8bb4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8bb4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bb4('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8bb4('0x6')](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x8bb4('0x6')](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8bb4('0x6')](0x3)[_0x8bb4('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bb4('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8bb4('0x6')](0x5)[_0x8bb4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bb4('0x25')}}; \ No newline at end of file +var _0xe25b=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xe25b,0x129));var _0xbe25=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xe25b[_0x1a124d];return _0x5f0830;};'use strict';var Sequelize=require(_0xbe25('0x0'));module[_0xbe25('0x1')]={'name':{'type':Sequelize[_0xbe25('0x2')],'unique':_0xbe25('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xbe25('0x4')](_0xbe25('0x5')),'allowNull':![],'defaultValue':_0xbe25('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xbe25('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xbe25('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbe25('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbe25('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xbe25('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbe25('0xf')},'dialTimezone':{'type':Sequelize[_0xbe25('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbe25('0x2')],'defaultValue':_0xbe25('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xbe25('0x4')](_0xbe25('0x11'),'never',_0xbe25('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbe25('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbe25('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xbe25('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbe25('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbe25('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbe25('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xbe25('0x7')](0x9)[_0xbe25('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbe25('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbe25('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbe25('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbe25('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xbe25('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbe25('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbe25('0x4')](_0xbe25('0x1c'),_0xbe25('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xbe25('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbe25('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbe25('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbe25('0x7')](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbe25('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)[_0xbe25('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbe25('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbe25('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbe25('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index a703451..67c7fdf 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 _0x152f=['phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.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','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','options','Campaign','count','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','getHoppers','findOne','nolimit','order','pick','CampaignId','filter','CmHopper','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL'];(function(_0x253da5,_0x5d3bff){var _0x381eb9=function(_0x3dd30f){while(--_0x3dd30f){_0x253da5['push'](_0x253da5['shift']());}};_0x381eb9(++_0x5d3bff);}(_0x152f,0x144));var _0xf152=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x152f[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0xf152('0x0'));var rimraf=require(_0xf152('0x1'));var zipdir=require(_0xf152('0x2'));var jsonpatch=require(_0xf152('0x3'));var rp=require(_0xf152('0x4'));var moment=require('moment');var BPromise=require(_0xf152('0x5'));var Mustache=require(_0xf152('0x6'));var util=require(_0xf152('0x7'));var path=require(_0xf152('0x8'));var sox=require('sox');var csv=require(_0xf152('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf152('0xa'));var _=require('lodash');var squel=require(_0xf152('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf152('0xc'));var toCsv=require(_0xf152('0x9'));var querystring=require('querystring');var Papa=require(_0xf152('0xd'));var Redis=require(_0xf152('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf152('0xf'));var as=require(_0xf152('0x10'));var hardwareService=require(_0xf152('0x11'));var logger=require(_0xf152('0x12'))(_0xf152('0x13'));var utils=require(_0xf152('0x14'));var config=require(_0xf152('0x15'));var licenseUtil=require(_0xf152('0x16'));var db=require(_0xf152('0x17'))['db'];function respondWithStatusCode(_0xca854f,_0x3424c7){_0x3424c7=_0x3424c7||0xcc;return function(_0x445e61){if(_0x445e61){return _0xca854f[_0xf152('0x18')](_0x3424c7);}return _0xca854f[_0xf152('0x19')](_0x3424c7)['end']();};}function respondWithResult(_0x321ef1,_0x26b0c2){_0x26b0c2=_0x26b0c2||0xc8;return function(_0x4cf355){if(_0x4cf355){return _0x321ef1[_0xf152('0x19')](_0x26b0c2)[_0xf152('0x1a')](_0x4cf355);}};}function respondWithFilteredResult(_0x428239,_0x5a6869){return function(_0x3bf2ab){if(_0x3bf2ab){var _0x286f0a=typeof _0x5a6869['offset']===_0xf152('0x1b')&&typeof _0x5a6869[_0xf152('0x1c')]===_0xf152('0x1b');var _0x3cb7c4=_0x3bf2ab['count'];var _0x3d732e=_0x286f0a?0x0:_0x5a6869['offset'];var _0x18bd0f=_0x286f0a?_0x3bf2ab['count']:_0x5a6869[_0xf152('0x1d')]+_0x5a6869[_0xf152('0x1c')];var _0x439f31;if(_0x18bd0f>=_0x3cb7c4){_0x18bd0f=_0x3cb7c4;_0x439f31=0xc8;}else{_0x439f31=0xce;}_0x428239[_0xf152('0x19')](_0x439f31);return _0x428239[_0xf152('0x1e')](_0xf152('0x1f'),_0x3d732e+'-'+_0x18bd0f+'/'+_0x3cb7c4)['json'](_0x3bf2ab);}return null;};}function patchUpdates(_0x2488a6){return function(_0x11c151){try{jsonpatch[_0xf152('0x20')](_0x11c151,_0x2488a6,!![]);}catch(_0x4a8990){return BPromise[_0xf152('0x21')](_0x4a8990);}return _0x11c151[_0xf152('0x22')]();};}function saveUpdates(_0x2cb87f,_0x35442a){return function(_0xc65d65){if(_0xc65d65){return _0xc65d65[_0xf152('0x23')](_0x2cb87f)['then'](function(_0x56d7ea){return _0x56d7ea;});}return null;};}function removeEntity(_0x39d904,_0x26a63f){return function(_0x201fcb){if(_0x201fcb){return _0x201fcb[_0xf152('0x24')]()['then'](function(){var _0x36d624=_0x201fcb[_0xf152('0x25')]({'plain':!![]});var _0x27ddaa='IvrCampaigns';return db[_0xf152('0x26')][_0xf152('0x24')]({'where':{'type':_0x27ddaa,'resourceId':_0x36d624['id']}})[_0xf152('0x27')](function(){return _0x201fcb;});})['then'](function(){_0x39d904[_0xf152('0x19')](0xcc)[_0xf152('0x28')]();});}};}function handleEntityNotFound(_0x3355f1,_0x1d1f9c){return function(_0x3d0644){if(!_0x3d0644){_0x3355f1[_0xf152('0x18')](0x194);}return _0x3d0644;};}function handleError(_0x14b21b,_0x7a8d0e){_0x7a8d0e=_0x7a8d0e||0x1f4;return function(_0x48930b){logger[_0xf152('0x29')](_0x48930b['stack']);if(_0x48930b[_0xf152('0x2a')]){delete _0x48930b['name'];}_0x14b21b[_0xf152('0x19')](_0x7a8d0e)[_0xf152('0x2b')](_0x48930b);};}exports[_0xf152('0x2c')]=function(_0x2bdf10,_0x37cfe5){var _0x29d79d={},_0x33c794={},_0x5a7a9d={'count':0x0,'rows':[]};var _0x469dff=_['map'](db['Campaign'][_0xf152('0x2d')],function(_0x5770ba){return{'name':_0x5770ba[_0xf152('0x2e')],'type':_0x5770ba[_0xf152('0x2f')][_0xf152('0x30')]};});_0x33c794[_0xf152('0x31')]=_[_0xf152('0x32')](_0x469dff,'name');_0x33c794['query']=_[_0xf152('0x33')](_0x2bdf10[_0xf152('0x34')]);_0x33c794[_0xf152('0x35')]=_[_0xf152('0x36')](_0x33c794[_0xf152('0x31')],_0x33c794[_0xf152('0x34')]);_0x29d79d[_0xf152('0x37')]=_['intersection'](_0x33c794[_0xf152('0x31')],qs[_0xf152('0x38')](_0x2bdf10['query'][_0xf152('0x38')]));_0x29d79d[_0xf152('0x37')]=_0x29d79d[_0xf152('0x37')]['length']?_0x29d79d[_0xf152('0x37')]:_0x33c794[_0xf152('0x31')];if(!_0x2bdf10['query'][_0xf152('0x39')]('nolimit')){_0x29d79d['limit']=qs[_0xf152('0x1c')](_0x2bdf10[_0xf152('0x34')]['limit']);_0x29d79d[_0xf152('0x1d')]=qs[_0xf152('0x1d')](_0x2bdf10[_0xf152('0x34')][_0xf152('0x1d')]);}_0x29d79d['order']=qs[_0xf152('0x3a')](_0x2bdf10[_0xf152('0x34')][_0xf152('0x3a')]);_0x29d79d[_0xf152('0x3b')]=qs[_0xf152('0x35')](_['pick'](_0x2bdf10[_0xf152('0x34')],_0x33c794['filters']),_0x469dff);if(_0x2bdf10[_0xf152('0x34')]['filter']){_0x29d79d[_0xf152('0x3b')]=_[_0xf152('0x3c')](_0x29d79d[_0xf152('0x3b')],{'$or':_[_0xf152('0x32')](_0x469dff,function(_0x1b42f1){if(_0x1b42f1[_0xf152('0x2f')]!=='VIRTUAL'){var _0x5a9e6b={};_0x5a9e6b[_0x1b42f1['name']]={'$like':'%'+_0x2bdf10['query']['filter']+'%'};return _0x5a9e6b;}})});}_0x29d79d=_[_0xf152('0x3c')]({},_0x29d79d,_0x2bdf10[_0xf152('0x3d')]);var _0x3a428f={'where':_0x29d79d['where']};return db[_0xf152('0x3e')][_0xf152('0x3f')](_0x3a428f)[_0xf152('0x27')](function(_0x4444e3){_0x5a7a9d['count']=_0x4444e3;if(_0x2bdf10[_0xf152('0x34')][_0xf152('0x40')]){_0x29d79d[_0xf152('0x41')]=[{'all':!![]}];}return db[_0xf152('0x3e')][_0xf152('0x42')](_0x29d79d);})[_0xf152('0x27')](function(_0x3fb2d1){_0x5a7a9d['rows']=_0x3fb2d1;return _0x5a7a9d;})['then'](respondWithFilteredResult(_0x37cfe5,_0x29d79d))[_0xf152('0x43')](handleError(_0x37cfe5,null));};exports[_0xf152('0x44')]=function(_0x5bf293,_0xa80b24){var _0x3b3db1={'raw':![],'where':{'id':_0x5bf293[_0xf152('0x45')]['id']}},_0x5ca89a={};_0x5ca89a[_0xf152('0x31')]=_['keys'](db[_0xf152('0x3e')]['rawAttributes']);_0x5ca89a[_0xf152('0x34')]=_[_0xf152('0x33')](_0x5bf293['query']);_0x5ca89a[_0xf152('0x35')]=_[_0xf152('0x36')](_0x5ca89a[_0xf152('0x31')],_0x5ca89a['query']);_0x3b3db1['attributes']=_[_0xf152('0x36')](_0x5ca89a[_0xf152('0x31')],qs['fields'](_0x5bf293[_0xf152('0x34')][_0xf152('0x38')]));_0x3b3db1['attributes']=_0x3b3db1[_0xf152('0x37')][_0xf152('0x46')]?_0x3b3db1[_0xf152('0x37')]:_0x5ca89a['model'];if(_0x5bf293['query'][_0xf152('0x40')]){_0x3b3db1['include']=[{'all':!![]}];}_0x3b3db1=_['merge']({},_0x3b3db1,_0x5bf293[_0xf152('0x3d')]);return db[_0xf152('0x3e')][_0xf152('0x47')](_0x3b3db1)['then'](handleEntityNotFound(_0xa80b24,null))[_0xf152('0x27')](respondWithResult(_0xa80b24,null))[_0xf152('0x43')](handleError(_0xa80b24,null));};exports[_0xf152('0x48')]=function(_0x4935f4,_0x313dc1){return db[_0xf152('0x3e')][_0xf152('0x48')](_0x4935f4[_0xf152('0x49')],{})[_0xf152('0x27')](function(_0x5c9937){var _0x4597f6=_0x4935f4[_0xf152('0x4a')][_0xf152('0x25')]({'plain':!![]});if(!_0x4597f6)throw new Error(_0xf152('0x4b'));if(_0x4597f6['role']==='user'){var _0x141896=_0x5c9937[_0xf152('0x25')]({'plain':!![]});var _0x96395f=_0xf152('0x4c');return db['UserProfileSection'][_0xf152('0x47')]({'where':{'name':_0x96395f,'userProfileId':_0x4597f6[_0xf152('0x4d')]},'raw':!![]})[_0xf152('0x27')](function(_0x7e6fcb){if(_0x7e6fcb&&_0x7e6fcb[_0xf152('0x4e')]===0x0){return db[_0xf152('0x26')][_0xf152('0x48')]({'name':_0x141896[_0xf152('0x2a')],'resourceId':_0x141896['id'],'type':_0x7e6fcb[_0xf152('0x2a')],'sectionId':_0x7e6fcb['id']},{})['then'](function(){return _0x5c9937;});}else{return _0x5c9937;}})['catch'](function(_0x245a9a){logger['error'](_0xf152('0x4f'),_0x245a9a);throw _0x245a9a;});}return _0x5c9937;})[_0xf152('0x27')](respondWithResult(_0x313dc1,0xc9))[_0xf152('0x43')](handleError(_0x313dc1,null));};exports[_0xf152('0x50')]=function(_0x5f444a,_0x11322b){var _0x25b81f={'where':{'id':_0x5f444a[_0xf152('0x45')]['id']}},_0x5d149c={};_0x5d149c['model']=_['keys'](db[_0xf152('0x3e')]['rawAttributes']);_0x25b81f[_0xf152('0x37')]=_[_0xf152('0x36')](_0x5d149c['model'],qs[_0xf152('0x38')](_0x5f444a[_0xf152('0x34')][_0xf152('0x38')]));_0x25b81f[_0xf152('0x37')]=_0x25b81f[_0xf152('0x37')][_0xf152('0x46')]?_0x25b81f[_0xf152('0x37')]:_0x5d149c[_0xf152('0x31')];if(_0x5f444a['query']['includeAll']){_0x25b81f['include']=[{'all':!![]}];}_0x25b81f=_[_0xf152('0x3c')]({},_0x25b81f,_0x5f444a[_0xf152('0x3d')]);return db[_0xf152('0x3e')][_0xf152('0x47')](_0x25b81f)[_0xf152('0x27')](handleEntityNotFound(_0x11322b,null))[_0xf152('0x27')](function(_0x4e89c5){if(_0x4e89c5){var _0x346591=_0x4e89c5[_0xf152('0x25')]({'plain':!![]});_0x346591=qs[_0xf152('0x51')](_0x346591,['id',_0xf152('0x52'),_0xf152('0x53')]);_0x5f444a[_0xf152('0x49')]=_[_0xf152('0x51')](_0x5f444a[_0xf152('0x49')],['id',_0xf152('0x52'),_0xf152('0x53')]);return db[_0xf152('0x3e')][_0xf152('0x48')](_[_0xf152('0x3c')](_0x346591,_0x5f444a['body']),{'include':_0x5f444a[_0xf152('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xf152('0x27')](function(_0x2457c4){var _0x4f2dca=_0x5f444a['user']['get']({'plain':!![]});if(!_0x4f2dca)throw new Error(_0xf152('0x4b'));if(_0x4f2dca[_0xf152('0x54')]===_0xf152('0x4a')){var _0x4a325d=_0x2457c4[_0xf152('0x25')]({'plain':!![]});var _0x827476=_0xf152('0x4c');return db[_0xf152('0x55')]['find']({'where':{'name':_0x827476,'userProfileId':_0x4f2dca['userProfileId']},'raw':!![]})['then'](function(_0x3148a1){if(_0x3148a1&&_0x3148a1['autoAssociation']===0x0){return db[_0xf152('0x26')][_0xf152('0x48')]({'name':_0x4a325d[_0xf152('0x2a')],'resourceId':_0x4a325d['id'],'type':_0x3148a1[_0xf152('0x2a')],'sectionId':_0x3148a1['id']},{})[_0xf152('0x27')](function(){return _0x2457c4;});}else{return _0x2457c4;}})[_0xf152('0x43')](function(_0xad0c59){logger[_0xf152('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad0c59);throw _0xad0c59;});}return _0x2457c4;});}})[_0xf152('0x27')](respondWithResult(_0x11322b,0xc9))[_0xf152('0x43')](handleError(_0x11322b,null));};exports[_0xf152('0x23')]=function(_0x2bfb03,_0x48db31){if(_0x2bfb03[_0xf152('0x49')]['id']){delete _0x2bfb03[_0xf152('0x49')]['id'];}return db['Campaign'][_0xf152('0x47')]({'where':{'id':_0x2bfb03[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x48db31,null))['then'](saveUpdates(_0x2bfb03[_0xf152('0x49')],null))['then'](respondWithResult(_0x48db31,null))[_0xf152('0x43')](handleError(_0x48db31,null));};exports[_0xf152('0x24')]=function(_0x5da101,_0x23bb47){return db['Campaign']['find']({'where':{'id':_0x5da101[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x23bb47,null))[_0xf152('0x27')](removeEntity(_0x23bb47,null))[_0xf152('0x43')](handleError(_0x23bb47,null));};exports[_0xf152('0x56')]=function(_0x47c5d0,_0x1b0de4,_0x16ef66){var _0x43ffd4={'raw':!![],'where':{}};var _0x685724={};var _0x4bff49={'count':0x0,'rows':[]};return db[_0xf152('0x3e')][_0xf152('0x57')]({'where':{'id':_0x47c5d0[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x1b0de4,null))[_0xf152('0x27')](function(_0x403891){if(_0x403891){_0x685724['model']=_[_0xf152('0x33')](db['CmHopper'][_0xf152('0x2d')]);_0x685724['query']=_[_0xf152('0x33')](_0x47c5d0['query']);_0x685724[_0xf152('0x35')]=_[_0xf152('0x36')](_0x685724[_0xf152('0x31')],_0x685724[_0xf152('0x34')]);_0x43ffd4['attributes']=_[_0xf152('0x36')](_0x685724[_0xf152('0x31')],qs[_0xf152('0x38')](_0x47c5d0[_0xf152('0x34')][_0xf152('0x38')]));_0x43ffd4['attributes']=_0x43ffd4[_0xf152('0x37')][_0xf152('0x46')]?_0x43ffd4['attributes']:_0x685724[_0xf152('0x31')];if(!_0x47c5d0[_0xf152('0x34')][_0xf152('0x39')](_0xf152('0x58'))){_0x43ffd4[_0xf152('0x1c')]=qs[_0xf152('0x1c')](_0x47c5d0[_0xf152('0x34')][_0xf152('0x1c')]);_0x43ffd4[_0xf152('0x1d')]=qs['offset'](_0x47c5d0[_0xf152('0x34')][_0xf152('0x1d')]);}_0x43ffd4[_0xf152('0x59')]=qs[_0xf152('0x3a')](_0x47c5d0[_0xf152('0x34')][_0xf152('0x3a')]);_0x43ffd4['where']=qs[_0xf152('0x35')](_[_0xf152('0x5a')](_0x47c5d0[_0xf152('0x34')],_0x685724[_0xf152('0x35')]));_0x43ffd4[_0xf152('0x3b')][_0xf152('0x5b')]=_0x403891['id'];if(_0x47c5d0[_0xf152('0x34')][_0xf152('0x5c')]){_0x43ffd4[_0xf152('0x3b')]=_['merge'](_0x43ffd4['where'],{'$or':_[_0xf152('0x32')](_0x43ffd4[_0xf152('0x37')],function(_0x1375f1){var _0x59edea={};_0x59edea[_0x1375f1]={'$like':'%'+_0x47c5d0[_0xf152('0x34')]['filter']+'%'};return _0x59edea;})});}_0x43ffd4=_[_0xf152('0x3c')]({},_0x43ffd4,_0x47c5d0['options']);return db['CmHopper'][_0xf152('0x3f')]({'where':_0x43ffd4['where']})[_0xf152('0x27')](function(_0x24a4e){_0x4bff49[_0xf152('0x3f')]=_0x24a4e;if(_0x47c5d0['query']['includeAll']){_0x43ffd4['include']=[{'all':!![]}];}return db[_0xf152('0x5d')]['findAll'](_0x43ffd4);})[_0xf152('0x27')](function(_0x3329b3){_0x4bff49[_0xf152('0x5e')]=_0x3329b3;return _0x4bff49;});}})[_0xf152('0x27')](respondWithFilteredResult(_0x1b0de4,_0x43ffd4))['catch'](handleError(_0x1b0de4,null));};exports[_0xf152('0x5f')]=function(_0x36a3c8,_0x55a10e,_0x276ccf){var _0x26c91c={'raw':!![],'where':{}};var _0x218e24={};var _0x2377ee={'count':0x0,'rows':[]};return db[_0xf152('0x3e')][_0xf152('0x57')]({'where':{'id':_0x36a3c8[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x55a10e,null))['then'](function(_0x15ea03){if(_0x15ea03){_0x218e24[_0xf152('0x31')]=_[_0xf152('0x33')](db['CmHopperHistory'][_0xf152('0x2d')]);_0x218e24[_0xf152('0x34')]=_[_0xf152('0x33')](_0x36a3c8[_0xf152('0x34')]);_0x218e24[_0xf152('0x35')]=_['intersection'](_0x218e24['model'],_0x218e24['query']);_0x26c91c[_0xf152('0x37')]=_['intersection'](_0x218e24[_0xf152('0x31')],qs[_0xf152('0x38')](_0x36a3c8[_0xf152('0x34')][_0xf152('0x38')]));_0x26c91c[_0xf152('0x37')]=_0x26c91c[_0xf152('0x37')][_0xf152('0x46')]?_0x26c91c[_0xf152('0x37')]:_0x218e24[_0xf152('0x31')];if(!_0x36a3c8[_0xf152('0x34')]['hasOwnProperty'](_0xf152('0x58'))){_0x26c91c[_0xf152('0x1c')]=qs['limit'](_0x36a3c8['query'][_0xf152('0x1c')]);_0x26c91c[_0xf152('0x1d')]=qs[_0xf152('0x1d')](_0x36a3c8[_0xf152('0x34')][_0xf152('0x1d')]);}_0x26c91c['order']=qs[_0xf152('0x3a')](_0x36a3c8[_0xf152('0x34')][_0xf152('0x3a')]);_0x26c91c[_0xf152('0x3b')]=qs['filters'](_[_0xf152('0x5a')](_0x36a3c8[_0xf152('0x34')],_0x218e24[_0xf152('0x35')]));_0x26c91c[_0xf152('0x3b')][_0xf152('0x5b')]=_0x15ea03['id'];if(_0x36a3c8[_0xf152('0x34')]['filter']){_0x26c91c[_0xf152('0x3b')]=_[_0xf152('0x3c')](_0x26c91c[_0xf152('0x3b')],{'$or':_['map'](_0x26c91c['attributes'],function(_0x322a0a){var _0x3c2dab={};_0x3c2dab[_0x322a0a]={'$like':'%'+_0x36a3c8[_0xf152('0x34')][_0xf152('0x5c')]+'%'};return _0x3c2dab;})});}_0x26c91c=_['merge']({},_0x26c91c,_0x36a3c8[_0xf152('0x3d')]);return db['CmHopperHistory'][_0xf152('0x3f')]({'where':_0x26c91c[_0xf152('0x3b')]})[_0xf152('0x27')](function(_0x2d0703){_0x2377ee['count']=_0x2d0703;if(_0x36a3c8[_0xf152('0x34')]['includeAll']){_0x26c91c[_0xf152('0x41')]=[{'all':!![]}];}return db[_0xf152('0x60')][_0xf152('0x42')](_0x26c91c);})['then'](function(_0x3ef9ea){_0x2377ee[_0xf152('0x5e')]=_0x3ef9ea;return _0x2377ee;});}})['then'](respondWithFilteredResult(_0x55a10e,_0x26c91c))['catch'](handleError(_0x55a10e,null));};exports['getHopperFinals']=function(_0x436869,_0x95d682,_0x210151){var _0x42a9e0={'raw':!![],'where':{}};var _0x3a19d7={};var _0x431e84={'count':0x0,'rows':[]};return db[_0xf152('0x3e')][_0xf152('0x57')]({'where':{'id':_0x436869[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x95d682,null))[_0xf152('0x27')](function(_0x19cc58){if(_0x19cc58){_0x3a19d7[_0xf152('0x31')]=_['keys'](db[_0xf152('0x61')][_0xf152('0x2d')]);_0x3a19d7[_0xf152('0x34')]=_[_0xf152('0x33')](_0x436869[_0xf152('0x34')]);_0x3a19d7[_0xf152('0x35')]=_[_0xf152('0x36')](_0x3a19d7[_0xf152('0x31')],_0x3a19d7[_0xf152('0x34')]);_0x42a9e0[_0xf152('0x37')]=_['intersection'](_0x3a19d7[_0xf152('0x31')],qs['fields'](_0x436869[_0xf152('0x34')][_0xf152('0x38')]));_0x42a9e0[_0xf152('0x37')]=_0x42a9e0[_0xf152('0x37')][_0xf152('0x46')]?_0x42a9e0[_0xf152('0x37')]:_0x3a19d7[_0xf152('0x31')];if(!_0x436869[_0xf152('0x34')]['hasOwnProperty'](_0xf152('0x58'))){_0x42a9e0[_0xf152('0x1c')]=qs[_0xf152('0x1c')](_0x436869[_0xf152('0x34')][_0xf152('0x1c')]);_0x42a9e0[_0xf152('0x1d')]=qs[_0xf152('0x1d')](_0x436869[_0xf152('0x34')][_0xf152('0x1d')]);}_0x42a9e0[_0xf152('0x59')]=qs[_0xf152('0x3a')](_0x436869[_0xf152('0x34')][_0xf152('0x3a')]);_0x42a9e0[_0xf152('0x3b')]=qs[_0xf152('0x35')](_[_0xf152('0x5a')](_0x436869[_0xf152('0x34')],_0x3a19d7['filters']));_0x42a9e0[_0xf152('0x3b')][_0xf152('0x5b')]=_0x19cc58['id'];if(_0x436869[_0xf152('0x34')][_0xf152('0x5c')]){_0x42a9e0['where']=_[_0xf152('0x3c')](_0x42a9e0[_0xf152('0x3b')],{'$or':_['map'](_0x42a9e0['attributes'],function(_0x417214){var _0x4ed50d={};_0x4ed50d[_0x417214]={'$like':'%'+_0x436869[_0xf152('0x34')][_0xf152('0x5c')]+'%'};return _0x4ed50d;})});}_0x42a9e0=_['merge']({},_0x42a9e0,_0x436869[_0xf152('0x3d')]);return db['CmHopperFinal'][_0xf152('0x3f')]({'where':_0x42a9e0[_0xf152('0x3b')]})['then'](function(_0xb1bc68){_0x431e84[_0xf152('0x3f')]=_0xb1bc68;if(_0x436869['query'][_0xf152('0x40')]){_0x42a9e0['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xf152('0x42')](_0x42a9e0);})[_0xf152('0x27')](function(_0x2364ca){_0x431e84[_0xf152('0x5e')]=_0x2364ca;return _0x431e84;});}})[_0xf152('0x27')](respondWithFilteredResult(_0x95d682,_0x42a9e0))[_0xf152('0x43')](handleError(_0x95d682,null));};exports[_0xf152('0x62')]=function(_0x384e37,_0x15c735,_0x53f763){var _0x1fc5e8={'raw':!![],'where':{}};var _0x29346c={};var _0x33a27a={'count':0x0,'rows':[]};return db[_0xf152('0x3e')][_0xf152('0x57')]({'where':{'id':_0x384e37[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x15c735,null))[_0xf152('0x27')](function(_0xc867de){if(_0xc867de){_0x29346c[_0xf152('0x31')]=_[_0xf152('0x33')](db[_0xf152('0x63')][_0xf152('0x2d')]);_0x29346c[_0xf152('0x34')]=_[_0xf152('0x33')](_0x384e37[_0xf152('0x34')]);_0x29346c[_0xf152('0x35')]=_[_0xf152('0x36')](_0x29346c['model'],_0x29346c[_0xf152('0x34')]);_0x1fc5e8[_0xf152('0x37')]=_[_0xf152('0x36')](_0x29346c['model'],qs[_0xf152('0x38')](_0x384e37[_0xf152('0x34')][_0xf152('0x38')]));_0x1fc5e8[_0xf152('0x37')]=_0x1fc5e8[_0xf152('0x37')][_0xf152('0x46')]?_0x1fc5e8[_0xf152('0x37')]:_0x29346c[_0xf152('0x31')];if(!_0x384e37[_0xf152('0x34')][_0xf152('0x39')](_0xf152('0x58'))){_0x1fc5e8[_0xf152('0x1c')]=qs[_0xf152('0x1c')](_0x384e37[_0xf152('0x34')][_0xf152('0x1c')]);_0x1fc5e8[_0xf152('0x1d')]=qs[_0xf152('0x1d')](_0x384e37[_0xf152('0x34')]['offset']);}_0x1fc5e8[_0xf152('0x59')]=qs['sort'](_0x384e37[_0xf152('0x34')]['sort']);_0x1fc5e8[_0xf152('0x3b')]=qs[_0xf152('0x35')](_['pick'](_0x384e37[_0xf152('0x34')],_0x29346c['filters']));_0x1fc5e8['where']['CampaignId']=_0xc867de['id'];if(_0x384e37[_0xf152('0x34')]['filter']){_0x1fc5e8[_0xf152('0x3b')]=_['merge'](_0x1fc5e8['where'],{'$or':_[_0xf152('0x32')](_0x1fc5e8[_0xf152('0x37')],function(_0x2bfe7e){var _0x1dd02d={};_0x1dd02d[_0x2bfe7e]={'$like':'%'+_0x384e37[_0xf152('0x34')][_0xf152('0x5c')]+'%'};return _0x1dd02d;})});}_0x1fc5e8=_[_0xf152('0x3c')]({},_0x1fc5e8,_0x384e37[_0xf152('0x3d')]);return db[_0xf152('0x63')][_0xf152('0x3f')]({'where':_0x1fc5e8[_0xf152('0x3b')]})[_0xf152('0x27')](function(_0x14f401){_0x33a27a[_0xf152('0x3f')]=_0x14f401;if(_0x384e37[_0xf152('0x34')]['includeAll']){_0x1fc5e8['include']=[{'all':!![]}];}return db[_0xf152('0x63')][_0xf152('0x42')](_0x1fc5e8);})['then'](function(_0x25e0a1){_0x33a27a[_0xf152('0x5e')]=_0x25e0a1;return _0x33a27a;});}})['then'](respondWithFilteredResult(_0x15c735,_0x1fc5e8))['catch'](handleError(_0x15c735,null));};exports['getLists']=function(_0x373d86,_0x329ef8,_0x2a822c){var _0x5d3a04={};var _0x4dc981={};var _0x71f925;var _0x5c6653;return db['Campaign'][_0xf152('0x57')]({'where':{'id':_0x373d86['params']['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x329ef8,null))[_0xf152('0x27')](function(_0x17000b){if(_0x17000b){_0x71f925=_0x17000b;_0x4dc981['model']=_[_0xf152('0x33')](db[_0xf152('0x64')][_0xf152('0x2d')]);_0x4dc981[_0xf152('0x34')]=_[_0xf152('0x33')](_0x373d86[_0xf152('0x34')]);_0x4dc981[_0xf152('0x35')]=_['intersection'](_0x4dc981[_0xf152('0x31')],_0x4dc981[_0xf152('0x34')]);_0x5d3a04[_0xf152('0x37')]=_['intersection'](_0x4dc981[_0xf152('0x31')],qs[_0xf152('0x38')](_0x373d86['query'][_0xf152('0x38')]));_0x5d3a04['attributes']=_0x5d3a04[_0xf152('0x37')][_0xf152('0x46')]?_0x5d3a04[_0xf152('0x37')]:_0x4dc981[_0xf152('0x31')];_0x5d3a04[_0xf152('0x59')]=qs['sort'](_0x373d86[_0xf152('0x34')][_0xf152('0x3a')]);_0x5d3a04['where']=qs['filters'](_[_0xf152('0x5a')](_0x373d86[_0xf152('0x34')],_0x4dc981[_0xf152('0x35')]));if(_0x373d86[_0xf152('0x34')][_0xf152('0x5c')]){_0x5d3a04['where']=_[_0xf152('0x3c')](_0x5d3a04[_0xf152('0x3b')],{'$or':_['map'](_0x5d3a04[_0xf152('0x37')],function(_0x4a9244){var _0x1730b1={};_0x1730b1[_0x4a9244]={'$like':'%'+_0x373d86[_0xf152('0x34')][_0xf152('0x5c')]+'%'};return _0x1730b1;})});}_0x5d3a04=_[_0xf152('0x3c')]({},_0x5d3a04,_0x373d86['options']);return _0x71f925['getLists'](_0x5d3a04);}})[_0xf152('0x27')](function(_0x2deb79){if(_0x2deb79){_0x5c6653=_0x2deb79[_0xf152('0x46')];if(!_0x373d86['query'][_0xf152('0x39')](_0xf152('0x58'))){_0x5d3a04['limit']=qs[_0xf152('0x1c')](_0x373d86['query'][_0xf152('0x1c')]);_0x5d3a04[_0xf152('0x1d')]=qs[_0xf152('0x1d')](_0x373d86['query'][_0xf152('0x1d')]);}return _0x71f925[_0xf152('0x65')](_0x5d3a04);}})['then'](function(_0x1c27de){if(_0x1c27de){return _0x1c27de?{'count':_0x5c6653,'rows':_0x1c27de}:null;}})[_0xf152('0x27')](respondWithResult(_0x329ef8,null))['catch'](handleError(_0x329ef8,null));};exports['addLists']=function(_0x8b077f,_0x5ae5c1,_0x5a6633){var _0x44fa6f,_0x516e1c;var _0x130783=[];var _0x5122cd=moment()[_0xf152('0x66')](_0xf152('0x67'));return db[_0xf152('0x3e')][_0xf152('0x47')]({'where':{'id':_0x8b077f[_0xf152('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ae5c1,null))['then'](function(_0x5a07b5){if(_0x5a07b5){_0x516e1c=_0x5a07b5;return _0x5a07b5[_0xf152('0x68')](_0x8b077f[_0xf152('0x49')]['ids'],_[_0xf152('0x51')](_0x8b077f['body'],[_0xf152('0x69'),'id'])||{});}return null;})['spread'](function(_0x412efa){var _0x2a6291;var _0x2a18d3;_0x44fa6f=_0x412efa||[];var _0x416227=[];if(_0x412efa){for(var _0x2ec286=0x0;_0x2ec286<_0x412efa['length'];_0x2ec286+=0x1){var _0x3d6f4e=_0x412efa[_0x2ec286][_0xf152('0x25')]({'plain':!![]});_0x516e1c['dialCheckDuplicateType']=_0x8b077f['body'][_0xf152('0x6a')]?_0x8b077f[_0xf152('0x49')][_0xf152('0x6a')]:_0x516e1c['dialCheckDuplicateType'];switch(_0x516e1c[_0xf152('0x6a')]){case'always':_0x2a6291=squel['insert']()[_0xf152('0x6b')]('cm_hopper')[_0xf152('0x6c')]([_0xf152('0x6d'),_0xf152('0x6e'),_0xf152('0x6f'),_0xf152('0x70'),_0xf152('0x5b'),_0xf152('0x52'),_0xf152('0x53')],squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x6d'),_0xf152('0x6d'))['field'](_0xf152('0x73'),_0xf152('0x6e'))[_0xf152('0x72')]('id',_0xf152('0x6f'))[_0xf152('0x72')](_0x3d6f4e[_0xf152('0x74')][_0xf152('0x75')](),_0xf152('0x70'))['field'](_0x8b077f[_0xf152('0x45')]['id'][_0xf152('0x75')](),'CampaignId')[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27','createdAt')[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27',_0xf152('0x53'))[_0xf152('0x76')](_0xf152('0x77'))['where'](_0xf152('0x78'))['where'](_0xf152('0x79'),_0x3d6f4e[_0xf152('0x74')][_0xf152('0x75')]())[_0xf152('0x3b')](_0xf152('0x7a'))[_0xf152('0x3b')](_0xf152('0x7b'),squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x7c'))[_0xf152('0x76')]('cm_hopper_final')[_0xf152('0x3b')](_0xf152('0x7d'),_0x8b077f[_0xf152('0x45')]['id']['toString']()))['where'](_0xf152('0x7b'),squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x7e'))['from'](_0xf152('0x7f'))['where'](_0xf152('0x7d'),_0x8b077f[_0xf152('0x45')]['id'][_0xf152('0x75')]())))[_0xf152('0x75')]();break;case _0xf152('0x80'):_0x2a6291=squel['insert']()[_0xf152('0x6b')](_0xf152('0x7f'))[_0xf152('0x6c')]([_0xf152('0x6d'),'scheduledAt',_0xf152('0x6f'),_0xf152('0x70'),_0xf152('0x5b'),'createdAt','updatedAt'],squel[_0xf152('0x71')]()['field'](_0xf152('0x6d'),_0xf152('0x6d'))[_0xf152('0x72')](_0xf152('0x73'),_0xf152('0x6e'))[_0xf152('0x72')]('id',_0xf152('0x6f'))[_0xf152('0x72')](_0x3d6f4e[_0xf152('0x74')]['toString'](),_0xf152('0x70'))['field'](_0x8b077f[_0xf152('0x45')]['id'][_0xf152('0x75')](),_0xf152('0x5b'))['field']('\x27'+_0x5122cd+'\x27',_0xf152('0x52'))[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27',_0xf152('0x53'))['from']('cm_contacts')[_0xf152('0x3b')](_0xf152('0x78'))[_0xf152('0x3b')](_0xf152('0x79'),_0x3d6f4e[_0xf152('0x74')][_0xf152('0x75')]())['where'](_0xf152('0x7a'))[_0xf152('0x3b')](_0xf152('0x7b'),squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x7e'))[_0xf152('0x76')](_0xf152('0x7f'))[_0xf152('0x3b')]('CampaignId\x20=\x20?',_0x8b077f['params']['id'][_0xf152('0x75')]())))[_0xf152('0x75')]();break;default:_0x2a6291=squel['insert']()[_0xf152('0x6b')](_0xf152('0x7f'))['fromQuery']([_0xf152('0x6d'),_0xf152('0x6e'),_0xf152('0x6f'),_0xf152('0x70'),'CampaignId',_0xf152('0x52'),_0xf152('0x53')],squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x6d'),_0xf152('0x6d'))[_0xf152('0x72')](_0xf152('0x73'),'scheduledAt')[_0xf152('0x72')]('id','ContactId')[_0xf152('0x72')](_0x3d6f4e[_0xf152('0x74')]['toString'](),_0xf152('0x70'))[_0xf152('0x72')](_0x8b077f[_0xf152('0x45')]['id'][_0xf152('0x75')](),_0xf152('0x5b'))[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27',_0xf152('0x52'))[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27','updatedAt')['from'](_0xf152('0x77'))['where'](_0xf152('0x78'))[_0xf152('0x3b')](_0xf152('0x79'),_0x3d6f4e[_0xf152('0x74')]['toString']())[_0xf152('0x3b')](_0xf152('0x7a')))['toString']();}_0x2a18d3=squel[_0xf152('0x81')]()[_0xf152('0x6b')](_0xf152('0x82'))[_0xf152('0x6c')](['cmHopperId',_0xf152('0x6e'),_0xf152('0x6d'),_0xf152('0x83'),_0xf152('0x52'),_0xf152('0x53')],squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x84'),'id')[_0xf152('0x72')](_0xf152('0x73'),_0xf152('0x6e'))['field'](_0xf152('0x85'),'phone')[_0xf152('0x72')](_0xf152('0x86'),_0xf152('0x83'))[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27','createdAt')[_0xf152('0x72')]('\x27'+_0x5122cd+'\x27',_0xf152('0x53'))['from'](_0xf152('0x87'),'ci')[_0xf152('0x88')](_0xf152('0x7f'),'h',_0xf152('0x89'))[_0xf152('0x3b')](_0xf152('0x8a'),_0x3d6f4e['CmListId'][_0xf152('0x75')]())['where'](_0xf152('0x8b'),_0x8b077f['params']['id'][_0xf152('0x75')]())[_0xf152('0x3b')](_0xf152('0x8c'),_0x5122cd))[_0xf152('0x75')]();_0x416227[_0xf152('0x8d')](db[_0xf152('0x8e')][_0xf152('0x34')](_0x2a6291));_0x130783[_0xf152('0x8d')](db[_0xf152('0x8e')][_0xf152('0x34')](_0x2a18d3));}return BPromise[_0xf152('0x8f')](_0x416227);}})['then'](function(){return BPromise[_0xf152('0x8f')](_0x130783);})[_0xf152('0x27')](function(){return _0x44fa6f;})[_0xf152('0x27')](respondWithResult(_0x5ae5c1,null))[_0xf152('0x43')](handleError(_0x5ae5c1,null));};exports['removeLists']=function(_0x1c6746,_0x4ec08b,_0x2e9bce){return db['Campaign'][_0xf152('0x47')]({'where':{'id':_0x1c6746[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x4ec08b,null))[_0xf152('0x27')](function(_0x26183a){if(_0x26183a){return _0x26183a[_0xf152('0x90')](_0x1c6746[_0xf152('0x34')][_0xf152('0x69')]);}})[_0xf152('0x27')](function(_0x64c29b){if(_0x64c29b){return db['CmHopper'][_0xf152('0x24')]({'where':{'ListId':_0x1c6746['query'][_0xf152('0x69')],'CampaignId':_0x1c6746[_0xf152('0x45')]['id']}})[_0xf152('0x27')](function(){return _0x64c29b;});}})[_0xf152('0x27')](respondWithStatusCode(_0x4ec08b,null))['catch'](handleError(_0x4ec08b,null));};exports[_0xf152('0x91')]=function(_0x5a1286,_0x4be10e,_0x448c92){var _0x2efeb2={};var _0xbed06c={};var _0x96379d;var _0x1aaf56;return db[_0xf152('0x3e')][_0xf152('0x57')]({'where':{'id':_0x5a1286[_0xf152('0x45')]['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x4be10e,null))['then'](function(_0x3aa814){if(_0x3aa814){_0x96379d=_0x3aa814;_0xbed06c['model']=_[_0xf152('0x33')](db[_0xf152('0x64')][_0xf152('0x2d')]);_0xbed06c[_0xf152('0x34')]=_[_0xf152('0x33')](_0x5a1286[_0xf152('0x34')]);_0xbed06c['filters']=_[_0xf152('0x36')](_0xbed06c[_0xf152('0x31')],_0xbed06c[_0xf152('0x34')]);_0x2efeb2['attributes']=_['intersection'](_0xbed06c[_0xf152('0x31')],qs[_0xf152('0x38')](_0x5a1286[_0xf152('0x34')]['fields']));_0x2efeb2[_0xf152('0x37')]=_0x2efeb2['attributes'][_0xf152('0x46')]?_0x2efeb2[_0xf152('0x37')]:_0xbed06c[_0xf152('0x31')];_0x2efeb2['order']=qs['sort'](_0x5a1286['query']['sort']);_0x2efeb2[_0xf152('0x3b')]=qs[_0xf152('0x35')](_['pick'](_0x5a1286['query'],_0xbed06c[_0xf152('0x35')]));if(_0x5a1286[_0xf152('0x34')]['filter']){_0x2efeb2[_0xf152('0x3b')]=_['merge'](_0x2efeb2[_0xf152('0x3b')],{'$or':_['map'](_0x2efeb2[_0xf152('0x37')],function(_0x114842){var _0x3aa1d0={};_0x3aa1d0[_0x114842]={'$like':'%'+_0x5a1286['query'][_0xf152('0x5c')]+'%'};return _0x3aa1d0;})});}_0x2efeb2=_[_0xf152('0x3c')]({},_0x2efeb2,_0x5a1286[_0xf152('0x3d')]);return _0x96379d[_0xf152('0x91')](_0x2efeb2);}})[_0xf152('0x27')](function(_0x583bdf){if(_0x583bdf){_0x1aaf56=_0x583bdf['length'];if(!_0x5a1286[_0xf152('0x34')]['hasOwnProperty'](_0xf152('0x58'))){_0x2efeb2[_0xf152('0x1c')]=qs[_0xf152('0x1c')](_0x5a1286[_0xf152('0x34')][_0xf152('0x1c')]);_0x2efeb2[_0xf152('0x1d')]=qs[_0xf152('0x1d')](_0x5a1286[_0xf152('0x34')][_0xf152('0x1d')]);}return _0x96379d[_0xf152('0x91')](_0x2efeb2);}})[_0xf152('0x27')](function(_0xcf2ce3){if(_0xcf2ce3){return _0xcf2ce3?{'count':_0x1aaf56,'rows':_0xcf2ce3}:null;}})[_0xf152('0x27')](respondWithResult(_0x4be10e,null))[_0xf152('0x43')](handleError(_0x4be10e,null));};exports[_0xf152('0x92')]=function(_0x327ba1,_0x3c59fe,_0x5bef90){var _0x112889,_0x1eaa5c;var _0x3e7eee=[];var _0x2c514e=moment()[_0xf152('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf152('0x3e')][_0xf152('0x47')]({'where':{'id':_0x327ba1['params']['id']}})[_0xf152('0x27')](handleEntityNotFound(_0x3c59fe,null))['then'](function(_0x26a4f3){if(_0x26a4f3){_0x1eaa5c=_0x26a4f3;return _0x26a4f3['addBlackLists'](_0x327ba1[_0xf152('0x49')][_0xf152('0x69')],_['omit'](_0x327ba1[_0xf152('0x49')],[_0xf152('0x69'),'id'])||{});}return null;})[_0xf152('0x93')](function(_0x490b82){var _0x2a7332;var _0x4d692e;_0x112889=_0x490b82||[];var _0x5bd363=[];if(_0x490b82){for(var _0xe6316f=0x0;_0xe6316f<_0x490b82[_0xf152('0x46')];_0xe6316f+=0x1){var _0x446e41=_0x490b82[_0xe6316f]['get']({'plain':!![]});_0x2a7332=squel[_0xf152('0x81')]()[_0xf152('0x6b')]('cm_hopper_black')[_0xf152('0x6c')]([_0xf152('0x6d'),_0xf152('0x6f'),_0xf152('0x70'),_0xf152('0x5b'),_0xf152('0x52'),_0xf152('0x53')],squel[_0xf152('0x71')]()[_0xf152('0x72')](_0xf152('0x6d'),_0xf152('0x6d'))[_0xf152('0x72')]('id',_0xf152('0x6f'))[_0xf152('0x72')](_0x446e41['CmListId'][_0xf152('0x75')](),_0xf152('0x70'))[_0xf152('0x72')](_0x327ba1[_0xf152('0x45')]['id'][_0xf152('0x75')](),'CampaignId')[_0xf152('0x72')](_0xf152('0x73'),_0xf152('0x52'))['field'](_0xf152('0x73'),_0xf152('0x53'))['from'](_0xf152('0x77'))[_0xf152('0x3b')](_0xf152('0x78'))[_0xf152('0x3b')]('ListId\x20=\x20?',_0x446e41['CmListId'][_0xf152('0x75')]())[_0xf152('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xf152('0x75')]();_0x5bd363[_0xf152('0x8d')](db['sequelize'][_0xf152('0x34')](_0x2a7332));}return BPromise['all'](_0x5bd363);}})['then'](function(){return _0x112889;})['then'](respondWithResult(_0x3c59fe,null))['catch'](handleError(_0x3c59fe,null));};exports[_0xf152('0x94')]=function(_0x2dd24b,_0x11b39d,_0x59461b){return db[_0xf152('0x3e')][_0xf152('0x47')]({'where':{'id':_0x2dd24b[_0xf152('0x45')]['id']}})['then'](handleEntityNotFound(_0x11b39d,null))[_0xf152('0x27')](function(_0x4b52d5){if(_0x4b52d5){return _0x4b52d5[_0xf152('0x94')](_0x2dd24b[_0xf152('0x34')][_0xf152('0x69')]);}})['then'](function(_0x3a84f2){if(_0x3a84f2){return db[_0xf152('0x63')]['destroy']({'where':{'ListId':_0x2dd24b[_0xf152('0x34')][_0xf152('0x69')],'CampaignId':_0x2dd24b[_0xf152('0x45')]['id']}})[_0xf152('0x27')](function(){return _0x3a84f2;});}})[_0xf152('0x27')](respondWithStatusCode(_0x11b39d,null))[_0xf152('0x43')](handleError(_0x11b39d,null));}; \ No newline at end of file +var _0xfa12=['format','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','UserProfileSection','findOne','CmHopper','CampaignId','getHopperHistories','sort','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x5098ce,_0x43425c){_0x5098ce=_0x5098ce-0x0;var _0x17a3ac=_0xfa12[_0x5098ce];return _0x17a3ac;};'use strict';var emlformat=require(_0x2fa1('0x0'));var rimraf=require(_0x2fa1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa1('0x2'));var rp=require(_0x2fa1('0x3'));var moment=require(_0x2fa1('0x4'));var BPromise=require(_0x2fa1('0x5'));var Mustache=require('mustache');var util=require(_0x2fa1('0x6'));var path=require(_0x2fa1('0x7'));var sox=require(_0x2fa1('0x8'));var csv=require(_0x2fa1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fa1('0xa'));var _=require(_0x2fa1('0xb'));var squel=require('squel');var crypto=require(_0x2fa1('0xc'));var jsforce=require(_0x2fa1('0xd'));var deskjs=require(_0x2fa1('0xe'));var toCsv=require(_0x2fa1('0x9'));var querystring=require('querystring');var Papa=require(_0x2fa1('0xf'));var Redis=require(_0x2fa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2fa1('0x11'));var as=require(_0x2fa1('0x12'));var hardwareService=require(_0x2fa1('0x13'));var logger=require(_0x2fa1('0x14'))(_0x2fa1('0x15'));var utils=require(_0x2fa1('0x16'));var config=require(_0x2fa1('0x17'));var licenseUtil=require(_0x2fa1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305bb3,_0x4198e1){_0x4198e1=_0x4198e1||0xcc;return function(_0x311441){if(_0x311441){return _0x305bb3[_0x2fa1('0x19')](_0x4198e1);}return _0x305bb3[_0x2fa1('0x1a')](_0x4198e1)[_0x2fa1('0x1b')]();};}function respondWithResult(_0x567bc5,_0xf81957){_0xf81957=_0xf81957||0xc8;return function(_0x409ea0){if(_0x409ea0){return _0x567bc5[_0x2fa1('0x1a')](_0xf81957)[_0x2fa1('0x1c')](_0x409ea0);}};}function respondWithFilteredResult(_0x5e7ed0,_0x3c79b6){return function(_0x3d6647){if(_0x3d6647){var _0x59aa4d=typeof _0x3c79b6[_0x2fa1('0x1d')]===_0x2fa1('0x1e')&&typeof _0x3c79b6[_0x2fa1('0x1f')]===_0x2fa1('0x1e');var _0xaf39c7=_0x3d6647[_0x2fa1('0x20')];var _0x21004a=_0x59aa4d?0x0:_0x3c79b6[_0x2fa1('0x1d')];var _0x4d16ac=_0x59aa4d?_0x3d6647[_0x2fa1('0x20')]:_0x3c79b6['offset']+_0x3c79b6['limit'];var _0x18d225;if(_0x4d16ac>=_0xaf39c7){_0x4d16ac=_0xaf39c7;_0x18d225=0xc8;}else{_0x18d225=0xce;}_0x5e7ed0[_0x2fa1('0x1a')](_0x18d225);return _0x5e7ed0[_0x2fa1('0x21')](_0x2fa1('0x22'),_0x21004a+'-'+_0x4d16ac+'/'+_0xaf39c7)[_0x2fa1('0x1c')](_0x3d6647);}return null;};}function patchUpdates(_0x5c451e){return function(_0x23f0d2){try{jsonpatch['apply'](_0x23f0d2,_0x5c451e,!![]);}catch(_0x22e15f){return BPromise[_0x2fa1('0x23')](_0x22e15f);}return _0x23f0d2[_0x2fa1('0x24')]();};}function saveUpdates(_0x245898,_0x24fe15){return function(_0x3fa70d){if(_0x3fa70d){return _0x3fa70d[_0x2fa1('0x25')](_0x245898)[_0x2fa1('0x26')](function(_0x2e95f0){return _0x2e95f0;});}return null;};}function removeEntity(_0x15037c,_0x5021fb){return function(_0x1eaa57){if(_0x1eaa57){return _0x1eaa57['destroy']()['then'](function(){var _0x5e255a=_0x1eaa57[_0x2fa1('0x27')]({'plain':!![]});var _0x5c89fc='IvrCampaigns';return db[_0x2fa1('0x28')][_0x2fa1('0x29')]({'where':{'type':_0x5c89fc,'resourceId':_0x5e255a['id']}})[_0x2fa1('0x26')](function(){return _0x1eaa57;});})[_0x2fa1('0x26')](function(){_0x15037c[_0x2fa1('0x1a')](0xcc)[_0x2fa1('0x1b')]();});}};}function handleEntityNotFound(_0x294c29,_0x39d083){return function(_0x255974){if(!_0x255974){_0x294c29[_0x2fa1('0x19')](0x194);}return _0x255974;};}function handleError(_0x28f35e,_0x28300d){_0x28300d=_0x28300d||0x1f4;return function(_0x16c050){logger[_0x2fa1('0x2a')](_0x16c050[_0x2fa1('0x2b')]);if(_0x16c050[_0x2fa1('0x2c')]){delete _0x16c050[_0x2fa1('0x2c')];}_0x28f35e[_0x2fa1('0x1a')](_0x28300d)['send'](_0x16c050);};}exports[_0x2fa1('0x2d')]=function(_0x1860a0,_0x4bf6b5){var _0x1bf81b={},_0x489cbe={},_0x33eff1={'count':0x0,'rows':[]};var _0x2da397=_[_0x2fa1('0x2e')](db['Campaign'][_0x2fa1('0x2f')],function(_0x345b81){return{'name':_0x345b81[_0x2fa1('0x30')],'type':_0x345b81[_0x2fa1('0x31')]['key']};});_0x489cbe[_0x2fa1('0x32')]=_[_0x2fa1('0x2e')](_0x2da397,'name');_0x489cbe[_0x2fa1('0x33')]=_['keys'](_0x1860a0[_0x2fa1('0x33')]);_0x489cbe[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],_0x489cbe[_0x2fa1('0x33')]);_0x1bf81b[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x489cbe[_0x2fa1('0x32')],qs['fields'](_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x1bf81b['attributes']=_0x1bf81b[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x1bf81b[_0x2fa1('0x36')]:_0x489cbe[_0x2fa1('0x32')];if(!_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x1bf81b[_0x2fa1('0x1f')]=qs['limit'](_0x1860a0['query']['limit']);_0x1bf81b[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1860a0['query']['offset']);}_0x1bf81b[_0x2fa1('0x3b')]=qs['sort'](_0x1860a0[_0x2fa1('0x33')]['sort']);_0x1bf81b[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x1860a0[_0x2fa1('0x33')],_0x489cbe['filters']),_0x2da397);if(_0x1860a0['query'][_0x2fa1('0x3e')]){_0x1bf81b[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x1bf81b[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x2da397,function(_0x119db6){if(_0x119db6[_0x2fa1('0x31')]!==_0x2fa1('0x40')){var _0x50a769={};_0x50a769[_0x119db6[_0x2fa1('0x2c')]]={'$like':'%'+_0x1860a0[_0x2fa1('0x33')]['filter']+'%'};return _0x50a769;}})});}_0x1bf81b=_[_0x2fa1('0x3f')]({},_0x1bf81b,_0x1860a0[_0x2fa1('0x41')]);var _0x2c2bcb={'where':_0x1bf81b[_0x2fa1('0x3c')]};return db[_0x2fa1('0x42')][_0x2fa1('0x20')](_0x2c2bcb)[_0x2fa1('0x26')](function(_0x5154b7){_0x33eff1[_0x2fa1('0x20')]=_0x5154b7;if(_0x1860a0[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x1bf81b[_0x2fa1('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x2fa1('0x45')](_0x1bf81b);})[_0x2fa1('0x26')](function(_0x1180eb){_0x33eff1[_0x2fa1('0x46')]=_0x1180eb;return _0x33eff1;})['then'](respondWithFilteredResult(_0x4bf6b5,_0x1bf81b))[_0x2fa1('0x47')](handleError(_0x4bf6b5,null));};exports[_0x2fa1('0x48')]=function(_0x8d92b6,_0x197dcf){var _0x422807={'raw':![],'where':{'id':_0x8d92b6[_0x2fa1('0x49')]['id']}},_0x2c4453={};_0x2c4453[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x42')]['rawAttributes']);_0x2c4453['query']=_['keys'](_0x8d92b6[_0x2fa1('0x33')]);_0x2c4453['filters']=_['intersection'](_0x2c4453['model'],_0x2c4453[_0x2fa1('0x33')]);_0x422807[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x2c4453[_0x2fa1('0x32')],qs['fields'](_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x422807[_0x2fa1('0x36')]=_0x422807[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x422807[_0x2fa1('0x36')]:_0x2c4453[_0x2fa1('0x32')];if(_0x8d92b6[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x422807[_0x2fa1('0x44')]=[{'all':!![]}];}_0x422807=_['merge']({},_0x422807,_0x8d92b6[_0x2fa1('0x41')]);return db[_0x2fa1('0x42')][_0x2fa1('0x4b')](_0x422807)[_0x2fa1('0x26')](handleEntityNotFound(_0x197dcf,null))[_0x2fa1('0x26')](respondWithResult(_0x197dcf,null))['catch'](handleError(_0x197dcf,null));};exports[_0x2fa1('0x4c')]=function(_0x2410e4,_0x1b8556){return db[_0x2fa1('0x42')]['create'](_0x2410e4['body'],{})[_0x2fa1('0x26')](function(_0x4c5562){var _0x2a4fc7=_0x2410e4[_0x2fa1('0x4d')][_0x2fa1('0x27')]({'plain':!![]});if(!_0x2a4fc7)throw new Error(_0x2fa1('0x4e'));if(_0x2a4fc7[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5198b1=_0x4c5562['get']({'plain':!![]});var _0x4ca733='IvrCampaigns';return db['UserProfileSection'][_0x2fa1('0x4b')]({'where':{'name':_0x4ca733,'userProfileId':_0x2a4fc7[_0x2fa1('0x50')]},'raw':!![]})[_0x2fa1('0x26')](function(_0x367c2e){if(_0x367c2e&&_0x367c2e[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5198b1['name'],'resourceId':_0x5198b1['id'],'type':_0x367c2e[_0x2fa1('0x2c')],'sectionId':_0x367c2e['id']},{})[_0x2fa1('0x26')](function(){return _0x4c5562;});}else{return _0x4c5562;}})['catch'](function(_0x129b9b){logger[_0x2fa1('0x2a')](_0x2fa1('0x52'),_0x129b9b);throw _0x129b9b;});}return _0x4c5562;})[_0x2fa1('0x26')](respondWithResult(_0x1b8556,0xc9))[_0x2fa1('0x47')](handleError(_0x1b8556,null));};exports['clone']=function(_0x3b1923,_0x38c5ac){var _0x4b78e2={'where':{'id':_0x3b1923[_0x2fa1('0x49')]['id']}},_0x499840={};_0x499840[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db['Campaign'][_0x2fa1('0x2f')]);_0x4b78e2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x499840[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x3b1923['query'][_0x2fa1('0x37')]));_0x4b78e2[_0x2fa1('0x36')]=_0x4b78e2['attributes'][_0x2fa1('0x38')]?_0x4b78e2[_0x2fa1('0x36')]:_0x499840[_0x2fa1('0x32')];if(_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x4b78e2[_0x2fa1('0x44')]=[{'all':!![]}];}_0x4b78e2=_['merge']({},_0x4b78e2,_0x3b1923[_0x2fa1('0x41')]);return db['Campaign']['find'](_0x4b78e2)['then'](handleEntityNotFound(_0x38c5ac,null))[_0x2fa1('0x26')](function(_0x54da3f){if(_0x54da3f){var _0x57f47c=_0x54da3f[_0x2fa1('0x27')]({'plain':!![]});_0x57f47c=qs[_0x2fa1('0x53')](_0x57f47c,['id',_0x2fa1('0x54'),_0x2fa1('0x55')]);_0x3b1923[_0x2fa1('0x56')]=_[_0x2fa1('0x53')](_0x3b1923['body'],['id','createdAt','updatedAt']);return db[_0x2fa1('0x42')]['create'](_[_0x2fa1('0x3f')](_0x57f47c,_0x3b1923[_0x2fa1('0x56')]),{'include':_0x3b1923[_0x2fa1('0x33')][_0x2fa1('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x31bfe1){var _0xfa7a69=_0x3b1923['user'][_0x2fa1('0x27')]({'plain':!![]});if(!_0xfa7a69)throw new Error(_0x2fa1('0x4e'));if(_0xfa7a69[_0x2fa1('0x4f')]===_0x2fa1('0x4d')){var _0x5e8938=_0x31bfe1[_0x2fa1('0x27')]({'plain':!![]});var _0x52694c='IvrCampaigns';return db[_0x2fa1('0x57')][_0x2fa1('0x4b')]({'where':{'name':_0x52694c,'userProfileId':_0xfa7a69['userProfileId']},'raw':!![]})['then'](function(_0x59d74f){if(_0x59d74f&&_0x59d74f[_0x2fa1('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e8938[_0x2fa1('0x2c')],'resourceId':_0x5e8938['id'],'type':_0x59d74f[_0x2fa1('0x2c')],'sectionId':_0x59d74f['id']},{})[_0x2fa1('0x26')](function(){return _0x31bfe1;});}else{return _0x31bfe1;}})[_0x2fa1('0x47')](function(_0x14c829){logger['error'](_0x2fa1('0x52'),_0x14c829);throw _0x14c829;});}return _0x31bfe1;});}})[_0x2fa1('0x26')](respondWithResult(_0x38c5ac,0xc9))[_0x2fa1('0x47')](handleError(_0x38c5ac,null));};exports[_0x2fa1('0x25')]=function(_0x4e8d81,_0x91bd89){if(_0x4e8d81[_0x2fa1('0x56')]['id']){delete _0x4e8d81[_0x2fa1('0x56')]['id'];}return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x4e8d81[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x91bd89,null))[_0x2fa1('0x26')](saveUpdates(_0x4e8d81[_0x2fa1('0x56')],null))[_0x2fa1('0x26')](respondWithResult(_0x91bd89,null))['catch'](handleError(_0x91bd89,null));};exports['destroy']=function(_0x859f00,_0x2de879){return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x859f00['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2de879,null))[_0x2fa1('0x26')](removeEntity(_0x2de879,null))[_0x2fa1('0x47')](handleError(_0x2de879,null));};exports['getHoppers']=function(_0x53c36e,_0x35b9a7,_0x4d292e){var _0x521fa9={'raw':!![],'where':{}};var _0x3e919e={};var _0x424ebc={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0x53c36e['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x35b9a7,null))['then'](function(_0x4df9d8){if(_0x4df9d8){_0x3e919e[_0x2fa1('0x32')]=_['keys'](db[_0x2fa1('0x59')][_0x2fa1('0x2f')]);_0x3e919e['query']=_[_0x2fa1('0x4a')](_0x53c36e[_0x2fa1('0x33')]);_0x3e919e[_0x2fa1('0x34')]=_['intersection'](_0x3e919e['model'],_0x3e919e[_0x2fa1('0x33')]);_0x521fa9['attributes']=_[_0x2fa1('0x35')](_0x3e919e[_0x2fa1('0x32')],qs['fields'](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x521fa9[_0x2fa1('0x36')]=_0x521fa9[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x521fa9[_0x2fa1('0x36')]:_0x3e919e[_0x2fa1('0x32')];if(!_0x53c36e['query'][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x521fa9[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x53c36e['query'][_0x2fa1('0x1f')]);_0x521fa9[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x521fa9[_0x2fa1('0x3b')]=qs['sort'](_0x53c36e[_0x2fa1('0x33')]['sort']);_0x521fa9[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_['pick'](_0x53c36e[_0x2fa1('0x33')],_0x3e919e[_0x2fa1('0x34')]));_0x521fa9[_0x2fa1('0x3c')][_0x2fa1('0x5a')]=_0x4df9d8['id'];if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x521fa9[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x521fa9['where'],{'$or':_[_0x2fa1('0x2e')](_0x521fa9[_0x2fa1('0x36')],function(_0x504759){var _0x31cc1c={};_0x31cc1c[_0x504759]={'$like':'%'+_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x31cc1c;})});}_0x521fa9=_[_0x2fa1('0x3f')]({},_0x521fa9,_0x53c36e[_0x2fa1('0x41')]);return db['CmHopper'][_0x2fa1('0x20')]({'where':_0x521fa9['where']})[_0x2fa1('0x26')](function(_0x73d040){_0x424ebc[_0x2fa1('0x20')]=_0x73d040;if(_0x53c36e[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x521fa9[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x2fa1('0x45')](_0x521fa9);})[_0x2fa1('0x26')](function(_0x2acb1e){_0x424ebc['rows']=_0x2acb1e;return _0x424ebc;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x35b9a7,_0x521fa9))[_0x2fa1('0x47')](handleError(_0x35b9a7,null));};exports[_0x2fa1('0x5b')]=function(_0x1eb73,_0x36dbbb,_0x29f6f5){var _0x100fc4={'raw':!![],'where':{}};var _0x77fa71={};var _0x57479b={'count':0x0,'rows':[]};return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x1eb73['params']['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x36dbbb,null))['then'](function(_0x2ba1f5){if(_0x2ba1f5){_0x77fa71[_0x2fa1('0x32')]=_['keys'](db['CmHopperHistory'][_0x2fa1('0x2f')]);_0x77fa71[_0x2fa1('0x33')]=_['keys'](_0x1eb73[_0x2fa1('0x33')]);_0x77fa71[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],_0x77fa71['query']);_0x100fc4['attributes']=_[_0x2fa1('0x35')](_0x77fa71[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x1eb73[_0x2fa1('0x33')]['fields']));_0x100fc4['attributes']=_0x100fc4['attributes'][_0x2fa1('0x38')]?_0x100fc4['attributes']:_0x77fa71[_0x2fa1('0x32')];if(!_0x1eb73[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0x100fc4[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x100fc4[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0x100fc4[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x100fc4[_0x2fa1('0x3c')]=qs['filters'](_[_0x2fa1('0x3d')](_0x1eb73[_0x2fa1('0x33')],_0x77fa71[_0x2fa1('0x34')]));_0x100fc4['where']['CampaignId']=_0x2ba1f5['id'];if(_0x1eb73[_0x2fa1('0x33')]['filter']){_0x100fc4[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x100fc4[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x100fc4['attributes'],function(_0x3fb815){var _0x42d027={};_0x42d027[_0x3fb815]={'$like':'%'+_0x1eb73['query']['filter']+'%'};return _0x42d027;})});}_0x100fc4=_[_0x2fa1('0x3f')]({},_0x100fc4,_0x1eb73['options']);return db[_0x2fa1('0x5d')]['count']({'where':_0x100fc4[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x4f446c){_0x57479b[_0x2fa1('0x20')]=_0x4f446c;if(_0x1eb73[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x100fc4[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x100fc4);})[_0x2fa1('0x26')](function(_0x3f02ef){_0x57479b[_0x2fa1('0x46')]=_0x3f02ef;return _0x57479b;});}})['then'](respondWithFilteredResult(_0x36dbbb,_0x100fc4))[_0x2fa1('0x47')](handleError(_0x36dbbb,null));};exports[_0x2fa1('0x5e')]=function(_0x4b2686,_0x33f181,_0x511aeb){var _0x268fea={'raw':!![],'where':{}};var _0x40021f={};var _0x56b98b={'count':0x0,'rows':[]};return db[_0x2fa1('0x42')]['findOne']({'where':{'id':_0x4b2686[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x33f181,null))[_0x2fa1('0x26')](function(_0x160733){if(_0x160733){_0x40021f['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x40021f['query']=_['keys'](_0x4b2686['query']);_0x40021f[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],_0x40021f[_0x2fa1('0x33')]);_0x268fea['attributes']=_[_0x2fa1('0x35')](_0x40021f[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x268fea['attributes']=_0x268fea[_0x2fa1('0x36')]['length']?_0x268fea[_0x2fa1('0x36')]:_0x40021f[_0x2fa1('0x32')];if(!_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x268fea['limit']=qs['limit'](_0x4b2686['query'][_0x2fa1('0x1f')]);_0x268fea[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x4b2686['query'][_0x2fa1('0x1d')]);}_0x268fea[_0x2fa1('0x3b')]=qs['sort'](_0x4b2686['query'][_0x2fa1('0x5c')]);_0x268fea[_0x2fa1('0x3c')]=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x4b2686['query'],_0x40021f[_0x2fa1('0x34')]));_0x268fea['where'][_0x2fa1('0x5a')]=_0x160733['id'];if(_0x4b2686['query'][_0x2fa1('0x3e')]){_0x268fea[_0x2fa1('0x3c')]=_['merge'](_0x268fea[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x268fea[_0x2fa1('0x36')],function(_0xfd138e){var _0x34084f={};_0x34084f[_0xfd138e]={'$like':'%'+_0x4b2686[_0x2fa1('0x33')]['filter']+'%'};return _0x34084f;})});}_0x268fea=_['merge']({},_0x268fea,_0x4b2686[_0x2fa1('0x41')]);return db[_0x2fa1('0x5f')]['count']({'where':_0x268fea[_0x2fa1('0x3c')]})[_0x2fa1('0x26')](function(_0x546c02){_0x56b98b[_0x2fa1('0x20')]=_0x546c02;if(_0x4b2686[_0x2fa1('0x33')][_0x2fa1('0x43')]){_0x268fea[_0x2fa1('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2fa1('0x45')](_0x268fea);})[_0x2fa1('0x26')](function(_0x4e6e0a){_0x56b98b[_0x2fa1('0x46')]=_0x4e6e0a;return _0x56b98b;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x33f181,_0x268fea))['catch'](handleError(_0x33f181,null));};exports[_0x2fa1('0x60')]=function(_0x281ab0,_0x41f5ad,_0x3f6dc6){var _0xbf35f2={'raw':!![],'where':{}};var _0xc1562c={};var _0x2e057e={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x281ab0[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x41f5ad,null))[_0x2fa1('0x26')](function(_0x3e8c84){if(_0x3e8c84){_0xc1562c[_0x2fa1('0x32')]=_[_0x2fa1('0x4a')](db[_0x2fa1('0x61')]['rawAttributes']);_0xc1562c[_0x2fa1('0x33')]=_[_0x2fa1('0x4a')](_0x281ab0[_0x2fa1('0x33')]);_0xc1562c['filters']=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],_0xc1562c['query']);_0xbf35f2[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0xc1562c[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0xbf35f2[_0x2fa1('0x36')]=_0xbf35f2[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0xbf35f2[_0x2fa1('0x36')]:_0xc1562c[_0x2fa1('0x32')];if(!_0x281ab0[_0x2fa1('0x33')]['hasOwnProperty'](_0x2fa1('0x3a'))){_0xbf35f2[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0xbf35f2[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x1d')]);}_0xbf35f2[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0xbf35f2[_0x2fa1('0x3c')]=qs['filters'](_['pick'](_0x281ab0[_0x2fa1('0x33')],_0xc1562c['filters']));_0xbf35f2[_0x2fa1('0x3c')]['CampaignId']=_0x3e8c84['id'];if(_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0xbf35f2['where']=_[_0x2fa1('0x3f')](_0xbf35f2[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0xbf35f2[_0x2fa1('0x36')],function(_0x4d46f6){var _0x534331={};_0x534331[_0x4d46f6]={'$like':'%'+_0x281ab0[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x534331;})});}_0xbf35f2=_[_0x2fa1('0x3f')]({},_0xbf35f2,_0x281ab0['options']);return db[_0x2fa1('0x61')][_0x2fa1('0x20')]({'where':_0xbf35f2['where']})[_0x2fa1('0x26')](function(_0xc761a1){_0x2e057e[_0x2fa1('0x20')]=_0xc761a1;if(_0x281ab0['query'][_0x2fa1('0x43')]){_0xbf35f2[_0x2fa1('0x44')]=[{'all':!![]}];}return db[_0x2fa1('0x61')][_0x2fa1('0x45')](_0xbf35f2);})[_0x2fa1('0x26')](function(_0x40f293){_0x2e057e[_0x2fa1('0x46')]=_0x40f293;return _0x2e057e;});}})[_0x2fa1('0x26')](respondWithFilteredResult(_0x41f5ad,_0xbf35f2))[_0x2fa1('0x47')](handleError(_0x41f5ad,null));};exports['getLists']=function(_0xec70d9,_0x58f7db,_0xdc7f5d){var _0x49c8d3={};var _0x3572f9={};var _0xd68af4;var _0x181772;return db[_0x2fa1('0x42')][_0x2fa1('0x58')]({'where':{'id':_0xec70d9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x58f7db,null))[_0x2fa1('0x26')](function(_0x357e19){if(_0x357e19){_0xd68af4=_0x357e19;_0x3572f9['model']=_[_0x2fa1('0x4a')](db[_0x2fa1('0x62')][_0x2fa1('0x2f')]);_0x3572f9[_0x2fa1('0x33')]=_['keys'](_0xec70d9[_0x2fa1('0x33')]);_0x3572f9[_0x2fa1('0x34')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],_0x3572f9[_0x2fa1('0x33')]);_0x49c8d3[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x3572f9[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x49c8d3[_0x2fa1('0x36')]=_0x49c8d3['attributes'][_0x2fa1('0x38')]?_0x49c8d3[_0x2fa1('0x36')]:_0x3572f9['model'];_0x49c8d3[_0x2fa1('0x3b')]=qs[_0x2fa1('0x5c')](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x5c')]);_0x49c8d3['where']=qs['filters'](_[_0x2fa1('0x3d')](_0xec70d9[_0x2fa1('0x33')],_0x3572f9[_0x2fa1('0x34')]));if(_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x49c8d3['where']=_[_0x2fa1('0x3f')](_0x49c8d3[_0x2fa1('0x3c')],{'$or':_[_0x2fa1('0x2e')](_0x49c8d3[_0x2fa1('0x36')],function(_0x28d67b){var _0x2697bd={};_0x2697bd[_0x28d67b]={'$like':'%'+_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x3e')]+'%'};return _0x2697bd;})});}_0x49c8d3=_[_0x2fa1('0x3f')]({},_0x49c8d3,_0xec70d9[_0x2fa1('0x41')]);return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})['then'](function(_0x3f178d){if(_0x3f178d){_0x181772=_0x3f178d['length'];if(!_0xec70d9['query']['hasOwnProperty'](_0x2fa1('0x3a'))){_0x49c8d3[_0x2fa1('0x1f')]=qs['limit'](_0xec70d9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x49c8d3[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0xec70d9[_0x2fa1('0x33')]['offset']);}return _0xd68af4[_0x2fa1('0x63')](_0x49c8d3);}})[_0x2fa1('0x26')](function(_0x1136da){if(_0x1136da){return _0x1136da?{'count':_0x181772,'rows':_0x1136da}:null;}})['then'](respondWithResult(_0x58f7db,null))[_0x2fa1('0x47')](handleError(_0x58f7db,null));};exports[_0x2fa1('0x64')]=function(_0x514c96,_0x50a1f0,_0x317e71){var _0x112ad6,_0x57d3e0;var _0x1a0a85=[];var _0x1a07b6=moment()['format'](_0x2fa1('0x65'));return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x514c96[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x50a1f0,null))['then'](function(_0x4b4a98){if(_0x4b4a98){_0x57d3e0=_0x4b4a98;return _0x4b4a98[_0x2fa1('0x64')](_0x514c96[_0x2fa1('0x56')]['ids'],_[_0x2fa1('0x53')](_0x514c96[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})[_0x2fa1('0x67')](function(_0x4c2f9b){var _0x420fe8;var _0x30fd19;_0x112ad6=_0x4c2f9b||[];var _0xf9d8d1=[];if(_0x4c2f9b){for(var _0x541964=0x0;_0x541964<_0x4c2f9b['length'];_0x541964+=0x1){var _0x227c57=_0x4c2f9b[_0x541964][_0x2fa1('0x27')]({'plain':!![]});_0x57d3e0['dialCheckDuplicateType']=_0x514c96[_0x2fa1('0x56')][_0x2fa1('0x68')]?_0x514c96[_0x2fa1('0x56')]['dialCheckDuplicateType']:_0x57d3e0[_0x2fa1('0x68')];switch(_0x57d3e0[_0x2fa1('0x68')]){case _0x2fa1('0x69'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper')[_0x2fa1('0x6c')](['phone',_0x2fa1('0x6d'),_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt','updatedAt'],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x72'),'phone')['field'](_0x2fa1('0x73'),'scheduledAt')[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')](_0x2fa1('0x7b'))['from']('cm_hopper_final')[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]()))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel[_0x2fa1('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x2fa1('0x76')](_0x2fa1('0x7d'))[_0x2fa1('0x3c')]('CampaignId\x20=\x20?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())))[_0x2fa1('0x75')]();break;case _0x2fa1('0x7e'):_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))['fromQuery'](['phone','scheduledAt',_0x2fa1('0x6e'),_0x2fa1('0x6f'),_0x2fa1('0x5a'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()['field'](_0x2fa1('0x72'),_0x2fa1('0x72'))[_0x2fa1('0x71')]('NOW()',_0x2fa1('0x6d'))[_0x2fa1('0x71')]('id',_0x2fa1('0x6e'))['field'](_0x227c57[_0x2fa1('0x74')]['toString'](),'ListId')[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))['from']('cm_contacts')['where'](_0x2fa1('0x78'))[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where'](_0x2fa1('0x7f'))[_0x2fa1('0x3c')](_0x2fa1('0x7a'),squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x80'))['from'](_0x2fa1('0x7d'))[_0x2fa1('0x3c')](_0x2fa1('0x7c'),_0x514c96[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')]())))[_0x2fa1('0x75')]();break;default:_0x420fe8=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')](_0x2fa1('0x7d'))[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'scheduledAt',_0x2fa1('0x6e'),'ListId','CampaignId',_0x2fa1('0x54'),_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('phone',_0x2fa1('0x72'))[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))['field']('id',_0x2fa1('0x6e'))[_0x2fa1('0x71')](_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))[_0x2fa1('0x71')](_0x514c96['params']['id']['toString'](),_0x2fa1('0x5a'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))[_0x2fa1('0x3c')]('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')](_0x2fa1('0x79'),_0x227c57[_0x2fa1('0x74')]['toString']())[_0x2fa1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x2fa1('0x75')]();}_0x30fd19=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_additional_phones')[_0x2fa1('0x6c')]([_0x2fa1('0x81'),_0x2fa1('0x6d'),_0x2fa1('0x72'),_0x2fa1('0x82'),'createdAt',_0x2fa1('0x55')],squel[_0x2fa1('0x70')]()[_0x2fa1('0x71')]('h.id','id')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x6d'))[_0x2fa1('0x71')](_0x2fa1('0x83'),_0x2fa1('0x72'))['field'](_0x2fa1('0x84'),'OrderBy')['field']('\x27'+_0x1a07b6+'\x27',_0x2fa1('0x54'))[_0x2fa1('0x71')]('\x27'+_0x1a07b6+'\x27','updatedAt')['from'](_0x2fa1('0x85'),'ci')[_0x2fa1('0x86')](_0x2fa1('0x7d'),'h',_0x2fa1('0x87'))[_0x2fa1('0x3c')]('h.ListId\x20=\x20?',_0x227c57[_0x2fa1('0x74')][_0x2fa1('0x75')]())['where']('h.CampaignId=?',_0x514c96[_0x2fa1('0x49')]['id']['toString']())[_0x2fa1('0x3c')](_0x2fa1('0x88'),_0x1a07b6))[_0x2fa1('0x75')]();_0xf9d8d1['push'](db['sequelize'][_0x2fa1('0x33')](_0x420fe8));_0x1a0a85['push'](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x30fd19));}return BPromise[_0x2fa1('0x8a')](_0xf9d8d1);}})[_0x2fa1('0x26')](function(){return BPromise[_0x2fa1('0x8a')](_0x1a0a85);})[_0x2fa1('0x26')](function(){return _0x112ad6;})[_0x2fa1('0x26')](respondWithResult(_0x50a1f0,null))['catch'](handleError(_0x50a1f0,null));};exports[_0x2fa1('0x8b')]=function(_0x51f490,_0xdabaa9,_0x56a7ae){return db['Campaign'][_0x2fa1('0x4b')]({'where':{'id':_0x51f490[_0x2fa1('0x49')]['id']}})['then'](handleEntityNotFound(_0xdabaa9,null))[_0x2fa1('0x26')](function(_0x3bc618){if(_0x3bc618){return _0x3bc618[_0x2fa1('0x8b')](_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')]);}})['then'](function(_0x217644){if(_0x217644){return db[_0x2fa1('0x59')][_0x2fa1('0x29')]({'where':{'ListId':_0x51f490[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x51f490['params']['id']}})['then'](function(){return _0x217644;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0xdabaa9,null))[_0x2fa1('0x47')](handleError(_0xdabaa9,null));};exports['getBlackLists']=function(_0x2588b9,_0x16aa12,_0x9f0835){var _0x10eb99={};var _0x39a45a={};var _0x398d4e;var _0x1abedd;return db['Campaign'][_0x2fa1('0x58')]({'where':{'id':_0x2588b9[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x16aa12,null))[_0x2fa1('0x26')](function(_0x4bdf1e){if(_0x4bdf1e){_0x398d4e=_0x4bdf1e;_0x39a45a['model']=_['keys'](db['CmList']['rawAttributes']);_0x39a45a[_0x2fa1('0x33')]=_['keys'](_0x2588b9[_0x2fa1('0x33')]);_0x39a45a['filters']=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],_0x39a45a[_0x2fa1('0x33')]);_0x10eb99[_0x2fa1('0x36')]=_[_0x2fa1('0x35')](_0x39a45a[_0x2fa1('0x32')],qs[_0x2fa1('0x37')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x37')]));_0x10eb99[_0x2fa1('0x36')]=_0x10eb99[_0x2fa1('0x36')][_0x2fa1('0x38')]?_0x10eb99[_0x2fa1('0x36')]:_0x39a45a[_0x2fa1('0x32')];_0x10eb99[_0x2fa1('0x3b')]=qs['sort'](_0x2588b9[_0x2fa1('0x33')]['sort']);_0x10eb99['where']=qs[_0x2fa1('0x34')](_[_0x2fa1('0x3d')](_0x2588b9[_0x2fa1('0x33')],_0x39a45a[_0x2fa1('0x34')]));if(_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x3e')]){_0x10eb99[_0x2fa1('0x3c')]=_[_0x2fa1('0x3f')](_0x10eb99['where'],{'$or':_[_0x2fa1('0x2e')](_0x10eb99[_0x2fa1('0x36')],function(_0x17ae92){var _0x942423={};_0x942423[_0x17ae92]={'$like':'%'+_0x2588b9[_0x2fa1('0x33')]['filter']+'%'};return _0x942423;})});}_0x10eb99=_[_0x2fa1('0x3f')]({},_0x10eb99,_0x2588b9[_0x2fa1('0x41')]);return _0x398d4e[_0x2fa1('0x8c')](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3eddf0){if(_0x3eddf0){_0x1abedd=_0x3eddf0['length'];if(!_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x39')](_0x2fa1('0x3a'))){_0x10eb99[_0x2fa1('0x1f')]=qs[_0x2fa1('0x1f')](_0x2588b9[_0x2fa1('0x33')][_0x2fa1('0x1f')]);_0x10eb99[_0x2fa1('0x1d')]=qs[_0x2fa1('0x1d')](_0x2588b9['query']['offset']);}return _0x398d4e['getBlackLists'](_0x10eb99);}})[_0x2fa1('0x26')](function(_0x3fdbf1){if(_0x3fdbf1){return _0x3fdbf1?{'count':_0x1abedd,'rows':_0x3fdbf1}:null;}})[_0x2fa1('0x26')](respondWithResult(_0x16aa12,null))[_0x2fa1('0x47')](handleError(_0x16aa12,null));};exports[_0x2fa1('0x8d')]=function(_0x388317,_0x413113,_0x2770fb){var _0x3e7dfd,_0x35e40b;var _0x53a5c7=[];var _0x10cbfb=moment()[_0x2fa1('0x8e')](_0x2fa1('0x65'));return db[_0x2fa1('0x42')][_0x2fa1('0x4b')]({'where':{'id':_0x388317[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x413113,null))['then'](function(_0x51b9e4){if(_0x51b9e4){_0x35e40b=_0x51b9e4;return _0x51b9e4[_0x2fa1('0x8d')](_0x388317['body']['ids'],_['omit'](_0x388317[_0x2fa1('0x56')],[_0x2fa1('0x66'),'id'])||{});}return null;})['spread'](function(_0x442806){var _0x3365a9;var _0xae739d;_0x3e7dfd=_0x442806||[];var _0x17fcaf=[];if(_0x442806){for(var _0xe3fa13=0x0;_0xe3fa13<_0x442806[_0x2fa1('0x38')];_0xe3fa13+=0x1){var _0x431f49=_0x442806[_0xe3fa13][_0x2fa1('0x27')]({'plain':!![]});_0x3365a9=squel[_0x2fa1('0x6a')]()[_0x2fa1('0x6b')]('cm_hopper_black')[_0x2fa1('0x6c')]([_0x2fa1('0x72'),'ContactId',_0x2fa1('0x6f'),_0x2fa1('0x5a'),_0x2fa1('0x54'),_0x2fa1('0x55')],squel['select']()[_0x2fa1('0x71')](_0x2fa1('0x72'),_0x2fa1('0x72'))['field']('id','ContactId')['field'](_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')](),_0x2fa1('0x6f'))['field'](_0x388317[_0x2fa1('0x49')]['id'][_0x2fa1('0x75')](),_0x2fa1('0x5a'))[_0x2fa1('0x71')](_0x2fa1('0x73'),'createdAt')[_0x2fa1('0x71')](_0x2fa1('0x73'),_0x2fa1('0x55'))[_0x2fa1('0x76')](_0x2fa1('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x2fa1('0x3c')]('ListId\x20=\x20?',_0x431f49[_0x2fa1('0x74')][_0x2fa1('0x75')]())[_0x2fa1('0x3c')](_0x2fa1('0x7f')))[_0x2fa1('0x75')]();_0x17fcaf[_0x2fa1('0x8f')](db[_0x2fa1('0x89')][_0x2fa1('0x33')](_0x3365a9));}return BPromise[_0x2fa1('0x8a')](_0x17fcaf);}})['then'](function(){return _0x3e7dfd;})[_0x2fa1('0x26')](respondWithResult(_0x413113,null))[_0x2fa1('0x47')](handleError(_0x413113,null));};exports['removeBlackLists']=function(_0x5e1947,_0x2f19c6,_0x379950){return db[_0x2fa1('0x42')]['find']({'where':{'id':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](handleEntityNotFound(_0x2f19c6,null))['then'](function(_0x3b7a83){if(_0x3b7a83){return _0x3b7a83['removeBlackLists'](_0x5e1947[_0x2fa1('0x33')]['ids']);}})['then'](function(_0x10c626){if(_0x10c626){return db[_0x2fa1('0x61')]['destroy']({'where':{'ListId':_0x5e1947[_0x2fa1('0x33')][_0x2fa1('0x66')],'CampaignId':_0x5e1947[_0x2fa1('0x49')]['id']}})[_0x2fa1('0x26')](function(){return _0x10c626;});}})[_0x2fa1('0x26')](respondWithStatusCode(_0x2f19c6,null))[_0x2fa1('0x47')](handleError(_0x2f19c6,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 93a679e..3023e71 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2bcf8c,_0x174465){var _0x46aa85=function(_0x5f06dc){while(--_0x5f06dc){_0x2bcf8c['push'](_0x2bcf8c['shift']());}};_0x46aa85(++_0x174465);}(_0x7a54,0x106));var _0x47a5=function(_0x3c19ee,_0x3acff8){_0x3c19ee=_0x3c19ee-0x0;var _0x412fde=_0x7a54[_0x3c19ee];return _0x412fde;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 7cdb09a..03cd534 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 _0x833b=['request\x20sent','stringify','code','error','message','catch','Campaign','findAll','options','raw','attributes','limit','include','model','map','info','GetCampaign','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x263f15,_0x2be132){var _0x27ee4f=function(_0x4dc2f4){while(--_0x4dc2f4){_0x263f15['push'](_0x263f15['shift']());}};_0x27ee4f(++_0x2be132);}(_0x833b,0x131));var _0xb833=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x833b[_0x725b8e];return _0x43ac45;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var moment=require('moment');var BPromise=require(_0xb833('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb833('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb833('0x3'));var logger=require(_0xb833('0x4'))(_0xb833('0x5'));var config=require(_0xb833('0x6'));var jayson=require(_0xb833('0x7'));var client=jayson[_0xb833('0x8')][_0xb833('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eaff4,_0x3afa71,_0xb60891){return new BPromise(function(_0x3922f5,_0x2525aa){return client[_0xb833('0xa')](_0x4eaff4,_0xb60891)[_0xb833('0xb')](function(_0x26cbf6){logger['info'](_0xb833('0xc'),_0x3afa71,'request\x20sent');logger[_0xb833('0xd')](_0xb833('0xe'),_0x3afa71,_0xb833('0xf'),JSON[_0xb833('0x10')](_0x26cbf6));if(_0x26cbf6['error']){if(_0x26cbf6['error'][_0xb833('0x11')]===0x1f4){logger[_0xb833('0x12')]('Campaign,\x20%s,\x20%s',_0x3afa71,_0x26cbf6[_0xb833('0x12')]['message']);return _0x2525aa(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);return _0x3922f5(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}else{logger['info'](_0xb833('0xc'),_0x3afa71,_0xb833('0xf'));_0x3922f5(_0x26cbf6['result']['message']);}})[_0xb833('0x14')](function(_0x59d65f){logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x59d65f);_0x2525aa(_0x59d65f);});});}exports['GetCampaign']=function(_0x36ce8f){var _0x174724=this;return new Promise(function(_0x5798e2,_0xa02eca){return db[_0xb833('0x15')][_0xb833('0x16')]({'raw':_0x36ce8f['options']?_0x36ce8f[_0xb833('0x17')][_0xb833('0x18')]===undefined?!![]:![]:!![],'where':_0x36ce8f[_0xb833('0x17')]?_0x36ce8f[_0xb833('0x17')]['where']||null:null,'attributes':_0x36ce8f['options']?_0x36ce8f[_0xb833('0x17')][_0xb833('0x19')]||null:null,'limit':_0x36ce8f[_0xb833('0x17')]?_0x36ce8f[_0xb833('0x17')][_0xb833('0x1a')]||null:null,'include':_0x36ce8f[_0xb833('0x17')]?_0x36ce8f['options'][_0xb833('0x1b')]?_['map'](_0x36ce8f['options']['include'],function(_0x2fa0d0){return{'model':db[_0x2fa0d0[_0xb833('0x1c')]],'as':_0x2fa0d0['as'],'attributes':_0x2fa0d0[_0xb833('0x19')],'include':_0x2fa0d0['include']?_[_0xb833('0x1d')](_0x2fa0d0[_0xb833('0x1b')],function(_0x48f3ad){return{'model':db[_0x48f3ad[_0xb833('0x1c')]],'as':_0x48f3ad['as'],'attributes':_0x48f3ad[_0xb833('0x19')],'include':_0x48f3ad['include']?_[_0xb833('0x1d')](_0x48f3ad['include'],function(_0xc7d7){return{'model':db[_0xc7d7[_0xb833('0x1c')]],'as':_0xc7d7['as'],'attributes':_0xc7d7[_0xb833('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ff6f9){logger[_0xb833('0x1e')](_0xb833('0x1f'),_0x36ce8f);logger['debug'](_0xb833('0x1f'),_0x36ce8f,JSON[_0xb833('0x10')](_0x3ff6f9));_0x5798e2(_0x3ff6f9);})[_0xb833('0x14')](function(_0x493fc8){logger['error'](_0xb833('0x1f'),_0x493fc8['message'],_0x36ce8f);_0xa02eca(_0x174724[_0xb833('0x12')](0x1f4,_0x493fc8[_0xb833('0x13')]));});});}; \ No newline at end of file +var _0xad36=['map','model','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCampaign','Campaign','findAll','options','where','attributes','limit','include'];(function(_0x115801,_0x506a72){var _0x4179c4=function(_0x46cb34){while(--_0x46cb34){_0x115801['push'](_0x115801['shift']());}};_0x4179c4(++_0x506a72);}(_0xad36,0x11c));var _0x6ad3=function(_0x14d38a,_0x57f85d){_0x14d38a=_0x14d38a-0x0;var _0x35e2c2=_0xad36[_0x14d38a];return _0x35e2c2;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var moment=require(_0x6ad3('0x1'));var BPromise=require(_0x6ad3('0x2'));var rs=require(_0x6ad3('0x3'));var fs=require('fs');var Redis=require(_0x6ad3('0x4'));var db=require(_0x6ad3('0x5'))['db'];var utils=require(_0x6ad3('0x6'));var logger=require(_0x6ad3('0x7'))(_0x6ad3('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ad3('0x9'));var client=jayson[_0x6ad3('0xa')][_0x6ad3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb38339,_0x4a4ad8,_0x5693c1){return new BPromise(function(_0x50913c,_0x563396){return client[_0x6ad3('0xc')](_0xb38339,_0x5693c1)[_0x6ad3('0xd')](function(_0x363032){logger[_0x6ad3('0xe')](_0x6ad3('0xf'),_0x4a4ad8,_0x6ad3('0x10'));logger[_0x6ad3('0x11')](_0x6ad3('0x12'),_0x4a4ad8,_0x6ad3('0x10'),JSON['stringify'](_0x363032));if(_0x363032[_0x6ad3('0x13')]){if(_0x363032[_0x6ad3('0x13')][_0x6ad3('0x14')]===0x1f4){logger[_0x6ad3('0x13')](_0x6ad3('0xf'),_0x4a4ad8,_0x363032[_0x6ad3('0x13')][_0x6ad3('0x15')]);return _0x563396(_0x363032[_0x6ad3('0x13')]['message']);}logger[_0x6ad3('0x13')]('Campaign,\x20%s,\x20%s',_0x4a4ad8,_0x363032[_0x6ad3('0x13')][_0x6ad3('0x15')]);return _0x50913c(_0x363032[_0x6ad3('0x13')][_0x6ad3('0x15')]);}else{logger[_0x6ad3('0xe')]('Campaign,\x20%s,\x20%s',_0x4a4ad8,_0x6ad3('0x10'));_0x50913c(_0x363032[_0x6ad3('0x16')][_0x6ad3('0x15')]);}})['catch'](function(_0x5479b8){logger['error']('Campaign,\x20%s,\x20%s',_0x4a4ad8,_0x5479b8);_0x563396(_0x5479b8);});});}exports[_0x6ad3('0x17')]=function(_0x4d031b){var _0x358243=this;return new Promise(function(_0x52d10c,_0x4239fe){return db[_0x6ad3('0x18')][_0x6ad3('0x19')]({'raw':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1b')]||null:null,'attributes':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1c')]||null:null,'limit':_0x4d031b[_0x6ad3('0x1a')]?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1d')]||null:null,'include':_0x4d031b['options']?_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1e')]?_[_0x6ad3('0x1f')](_0x4d031b[_0x6ad3('0x1a')][_0x6ad3('0x1e')],function(_0x244064){return{'model':db[_0x244064['model']],'as':_0x244064['as'],'attributes':_0x244064[_0x6ad3('0x1c')],'include':_0x244064[_0x6ad3('0x1e')]?_[_0x6ad3('0x1f')](_0x244064['include'],function(_0x50dbec){return{'model':db[_0x50dbec[_0x6ad3('0x20')]],'as':_0x50dbec['as'],'attributes':_0x50dbec[_0x6ad3('0x1c')],'include':_0x50dbec['include']?_['map'](_0x50dbec[_0x6ad3('0x1e')],function(_0x1892fd){return{'model':db[_0x1892fd[_0x6ad3('0x20')]],'as':_0x1892fd['as'],'attributes':_0x1892fd[_0x6ad3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6ad3('0xd')](function(_0x3a8774){logger['info']('GetCampaign',_0x4d031b);logger[_0x6ad3('0x11')](_0x6ad3('0x17'),_0x4d031b,JSON[_0x6ad3('0x21')](_0x3a8774));_0x52d10c(_0x3a8774);})[_0x6ad3('0x22')](function(_0x4ee707){logger[_0x6ad3('0x13')](_0x6ad3('0x17'),_0x4ee707[_0x6ad3('0x15')],_0x4d031b);_0x4239fe(_0x358243[_0x6ad3('0x13')](0x1f4,_0x4ee707[_0x6ad3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ec83350..5ebc419 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 _0x0082=['addBlackLists','update','delete','/:id','destroy','removeBlackLists','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','addLists'];(function(_0x4abb0b,_0x33f9f6){var _0x156bb4=function(_0x106e54){while(--_0x106e54){_0x4abb0b['push'](_0x4abb0b['shift']());}};_0x156bb4(++_0x33f9f6);}(_0x0082,0x73));var _0x2008=function(_0x2b1d56,_0x588443){_0x2b1d56=_0x2b1d56-0x0;var _0x8a5719=_0x0082[_0x2b1d56];return _0x8a5719;};'use strict';var multer=require(_0x2008('0x0'));var util=require('util');var path=require(_0x2008('0x1'));var timeout=require('connect-timeout');var express=require(_0x2008('0x2'));var router=express[_0x2008('0x3')]();var fs_extra=require(_0x2008('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2008('0x5'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0x2008('0x6')](),controller[_0x2008('0x7')]);router[_0x2008('0x8')]('/:id',auth[_0x2008('0x6')](),controller[_0x2008('0x9')]);router[_0x2008('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x2008('0xa')]);router[_0x2008('0x8')](_0x2008('0xb'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x2008('0x8')](_0x2008('0xc'),auth[_0x2008('0x6')](),controller['getHopperFinals']);router['get'](_0x2008('0xd'),auth['isAuthenticated'](),controller[_0x2008('0xe')]);router['get'](_0x2008('0xf'),auth[_0x2008('0x6')](),controller[_0x2008('0x10')]);router[_0x2008('0x8')]('/:id/blacklists',auth[_0x2008('0x6')](),controller[_0x2008('0x11')]);router[_0x2008('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2008('0x12')]('/:id/clone',auth[_0x2008('0x6')](),controller['clone']);router[_0x2008('0x12')]('/:id/lists',auth[_0x2008('0x6')](),controller[_0x2008('0x13')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x2008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2008('0x15')]);router[_0x2008('0x16')](_0x2008('0x17'),auth[_0x2008('0x6')](),controller[_0x2008('0x18')]);router[_0x2008('0x16')](_0x2008('0xf'),auth[_0x2008('0x6')](),controller['removeLists']);router[_0x2008('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x2008('0x19')]);module[_0x2008('0x1a')]=router; \ No newline at end of file +var _0x8d37=['addBlackLists','update','delete','/:id','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists'];(function(_0xa8dcce,_0x48ac8c){var _0x4baeec=function(_0x5dfb97){while(--_0x5dfb97){_0xa8dcce['push'](_0xa8dcce['shift']());}};_0x4baeec(++_0x48ac8c);}(_0x8d37,0xbc));var _0x78d3=function(_0x24d41c,_0x35c9aa){_0x24d41c=_0x24d41c-0x0;var _0xa7f164=_0x8d37[_0x24d41c];return _0xa7f164;};'use strict';var multer=require(_0x78d3('0x0'));var util=require('util');var path=require(_0x78d3('0x1'));var timeout=require(_0x78d3('0x2'));var express=require(_0x78d3('0x3'));var router=express[_0x78d3('0x4')]();var fs_extra=require(_0x78d3('0x5'));var auth=require(_0x78d3('0x6'));var interaction=require(_0x78d3('0x7'));var config=require('../../config/environment');var controller=require(_0x78d3('0x8'));router[_0x78d3('0x9')]('/',auth['isAuthenticated'](),controller[_0x78d3('0xa')]);router[_0x78d3('0x9')]('/:id',auth[_0x78d3('0xb')](),controller[_0x78d3('0xc')]);router[_0x78d3('0x9')](_0x78d3('0xd'),auth[_0x78d3('0xb')](),controller[_0x78d3('0xe')]);router['get'](_0x78d3('0xf'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x10')]);router[_0x78d3('0x9')](_0x78d3('0x11'),auth['isAuthenticated'](),controller[_0x78d3('0x12')]);router[_0x78d3('0x9')](_0x78d3('0x13'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x14')]);router[_0x78d3('0x9')](_0x78d3('0x15'),auth['isAuthenticated'](),controller[_0x78d3('0x16')]);router[_0x78d3('0x9')](_0x78d3('0x17'),auth['isAuthenticated'](),controller[_0x78d3('0x18')]);router['post']('/',auth[_0x78d3('0xb')](),controller['create']);router[_0x78d3('0x19')]('/:id/clone',auth[_0x78d3('0xb')](),controller[_0x78d3('0x1a')]);router['post']('/:id/lists',auth[_0x78d3('0xb')](),controller[_0x78d3('0x1b')]);router[_0x78d3('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x78d3('0x1c')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x78d3('0x1d')]);router[_0x78d3('0x1e')](_0x78d3('0x1f'),auth['isAuthenticated'](),controller[_0x78d3('0x20')]);router[_0x78d3('0x1e')]('/:id/lists',auth[_0x78d3('0xb')](),controller[_0x78d3('0x21')]);router[_0x78d3('0x1e')](_0x78d3('0x17'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x22')]);module[_0x78d3('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d736436..e5de132 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 _0x7eb0=['medium','STRING','VIRTUAL','key','sequelize'];(function(_0x39890b,_0x259768){var _0x227fec=function(_0x8973){while(--_0x8973){_0x39890b['push'](_0x39890b['shift']());}};_0x227fec(++_0x259768);}(_0x7eb0,0x176));var _0x07eb=function(_0x34d6ad,_0xc14f53){_0x34d6ad=_0x34d6ad-0x0;var _0xb412d=_0x7eb0[_0x34d6ad];return _0xb412d;};'use strict';var Sequelize=require(_0x07eb('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x07eb('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x07eb('0x2')]},'name':{'type':Sequelize[_0x07eb('0x3')],'get':function(){return this['getDataValue'](_0x07eb('0x4'));}}}; \ No newline at end of file +var _0xc1a1=['sequelize','exports','STRING','medium','VIRTUAL'];(function(_0x5706fb,_0xacfe3c){var _0x21799d=function(_0x9a813e){while(--_0x9a813e){_0x5706fb['push'](_0x5706fb['shift']());}};_0x21799d(++_0xacfe3c);}(_0xc1a1,0x154));var _0x1c1a=function(_0x2f6efc,_0x24a7f8){_0x2f6efc=_0x2f6efc-0x0;var _0x196611=_0xc1a1[_0x2f6efc];return _0x196611;};'use strict';var Sequelize=require(_0x1c1a('0x0'));module[_0x1c1a('0x1')]={'key':{'type':Sequelize[_0x1c1a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x1c1a('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x1c1a('0x4')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index faa62de..93add3b 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 _0xeada=['stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','filter','merge','options','includeAll','include','findAll','rows','show','params','catch','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xeada,0x17b));var _0xaead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeada[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xaead('0x0'));var rimraf=require(_0xaead('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaead('0x2'));var BPromise=require(_0xaead('0x3'));var Mustache=require(_0xaead('0x4'));var util=require(_0xaead('0x5'));var path=require('path');var sox=require(_0xaead('0x6'));var csv=require(_0xaead('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaead('0x8'));var _=require(_0xaead('0x9'));var squel=require(_0xaead('0xa'));var crypto=require('crypto');var jsforce=require(_0xaead('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaead('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaead('0xd'));var hardwareService=require(_0xaead('0xe'));var logger=require(_0xaead('0xf'))('api');var utils=require(_0xaead('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaead('0x11'))['db'];function respondWithStatusCode(_0x3fff40,_0x51fa61){_0x51fa61=_0x51fa61||0xcc;return function(_0x1d0c20){if(_0x1d0c20){return _0x3fff40[_0xaead('0x12')](_0x51fa61);}return _0x3fff40[_0xaead('0x13')](_0x51fa61)[_0xaead('0x14')]();};}function respondWithResult(_0x321d9f,_0x5a78b6){_0x5a78b6=_0x5a78b6||0xc8;return function(_0x3ac8fb){if(_0x3ac8fb){return _0x321d9f[_0xaead('0x13')](_0x5a78b6)[_0xaead('0x15')](_0x3ac8fb);}};}function respondWithFilteredResult(_0x436b61,_0xa9ba0f){return function(_0x334b42){if(_0x334b42){var _0x2a079e=typeof _0xa9ba0f[_0xaead('0x16')]===_0xaead('0x17')&&typeof _0xa9ba0f['limit']===_0xaead('0x17');var _0x1ca25f=_0x334b42[_0xaead('0x18')];var _0x436896=_0x2a079e?0x0:_0xa9ba0f['offset'];var _0xa284c6=_0x2a079e?_0x334b42['count']:_0xa9ba0f[_0xaead('0x16')]+_0xa9ba0f[_0xaead('0x19')];var _0x4c2c3b;if(_0xa284c6>=_0x1ca25f){_0xa284c6=_0x1ca25f;_0x4c2c3b=0xc8;}else{_0x4c2c3b=0xce;}_0x436b61[_0xaead('0x13')](_0x4c2c3b);return _0x436b61[_0xaead('0x1a')](_0xaead('0x1b'),_0x436896+'-'+_0xa284c6+'/'+_0x1ca25f)['json'](_0x334b42);}return null;};}function patchUpdates(_0x3b1995){return function(_0x56a2da){try{jsonpatch['apply'](_0x56a2da,_0x3b1995,!![]);}catch(_0x2d309e){return BPromise[_0xaead('0x1c')](_0x2d309e);}return _0x56a2da[_0xaead('0x1d')]();};}function saveUpdates(_0x524d73,_0x499e6e){return function(_0x32e58d){if(_0x32e58d){return _0x32e58d[_0xaead('0x1e')](_0x524d73)[_0xaead('0x1f')](function(_0x3c890b){return _0x3c890b;});}return null;};}function removeEntity(_0x414cd4,_0x4c0d4a){return function(_0x95584f){if(_0x95584f){return _0x95584f[_0xaead('0x20')]()[_0xaead('0x1f')](function(){var _0x54e1e8=_0x95584f['get']({'plain':!![]});var _0x150a15=_0xaead('0x21');return db[_0xaead('0x22')]['destroy']({'where':{'type':_0x150a15,'resourceId':_0x54e1e8['id']}})[_0xaead('0x1f')](function(){return _0x95584f;});})[_0xaead('0x1f')](function(){_0x414cd4[_0xaead('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2459e4,_0x19bcf1){return function(_0x1e1385){if(!_0x1e1385){_0x2459e4[_0xaead('0x12')](0x194);}return _0x1e1385;};}function handleError(_0x3e3ffb,_0x89096b){_0x89096b=_0x89096b||0x1f4;return function(_0x47f8fe){logger[_0xaead('0x23')](_0x47f8fe[_0xaead('0x24')]);if(_0x47f8fe[_0xaead('0x25')]){delete _0x47f8fe['name'];}_0x3e3ffb[_0xaead('0x13')](_0x89096b)[_0xaead('0x26')](_0x47f8fe);};}exports[_0xaead('0x27')]=function(_0xdc22f4,_0x543a94){var _0x2d143e={},_0x54ee95={},_0x277303={'count':0x0,'rows':[]};var _0x2f5392=_['map'](db[_0xaead('0x28')][_0xaead('0x29')],function(_0x1c54bf){return{'name':_0x1c54bf[_0xaead('0x2a')],'type':_0x1c54bf[_0xaead('0x2b')][_0xaead('0x2c')]};});_0x54ee95[_0xaead('0x2d')]=_[_0xaead('0x2e')](_0x2f5392,_0xaead('0x25'));_0x54ee95[_0xaead('0x2f')]=_[_0xaead('0x30')](_0xdc22f4[_0xaead('0x2f')]);_0x54ee95[_0xaead('0x31')]=_[_0xaead('0x32')](_0x54ee95[_0xaead('0x2d')],_0x54ee95[_0xaead('0x2f')]);_0x2d143e[_0xaead('0x33')]=_[_0xaead('0x32')](_0x54ee95['model'],qs[_0xaead('0x34')](_0xdc22f4[_0xaead('0x2f')][_0xaead('0x34')]));_0x2d143e[_0xaead('0x33')]=_0x2d143e['attributes'][_0xaead('0x35')]?_0x2d143e[_0xaead('0x33')]:_0x54ee95['model'];if(!_0xdc22f4['query'][_0xaead('0x36')]('nolimit')){_0x2d143e['limit']=qs[_0xaead('0x19')](_0xdc22f4[_0xaead('0x2f')]['limit']);_0x2d143e['offset']=qs['offset'](_0xdc22f4[_0xaead('0x2f')][_0xaead('0x16')]);}_0x2d143e['order']=qs['sort'](_0xdc22f4[_0xaead('0x2f')]['sort']);_0x2d143e[_0xaead('0x37')]=qs[_0xaead('0x31')](_['pick'](_0xdc22f4[_0xaead('0x2f')],_0x54ee95['filters']),_0x2f5392);if(_0xdc22f4[_0xaead('0x2f')][_0xaead('0x38')]){_0x2d143e[_0xaead('0x37')]=_[_0xaead('0x39')](_0x2d143e[_0xaead('0x37')],{'$or':[{'key':{'$like':'%'+_0xdc22f4['query'][_0xaead('0x38')]+'%'}},{'value':{'$like':'%'+_0xdc22f4[_0xaead('0x2f')][_0xaead('0x38')]+'%'}}]});}_0x2d143e=_[_0xaead('0x39')]({},_0x2d143e,_0xdc22f4[_0xaead('0x3a')]);var _0x5c4e8e={'where':_0x2d143e[_0xaead('0x37')]};return db[_0xaead('0x28')][_0xaead('0x18')](_0x5c4e8e)[_0xaead('0x1f')](function(_0x2126e5){_0x277303[_0xaead('0x18')]=_0x2126e5;if(_0xdc22f4[_0xaead('0x2f')][_0xaead('0x3b')]){_0x2d143e[_0xaead('0x3c')]=[{'all':!![]}];}return db[_0xaead('0x28')][_0xaead('0x3d')](_0x2d143e);})[_0xaead('0x1f')](function(_0xfa4dc9){_0x277303[_0xaead('0x3e')]=_0xfa4dc9;return _0x277303;})['then'](respondWithFilteredResult(_0x543a94,_0x2d143e))['catch'](handleError(_0x543a94,null));};exports[_0xaead('0x3f')]=function(_0x225565,_0x2c2161){var _0x322849={'raw':!![],'where':{'id':_0x225565[_0xaead('0x40')]['id']}},_0x52a408={};_0x52a408[_0xaead('0x2d')]=_[_0xaead('0x30')](db[_0xaead('0x28')][_0xaead('0x29')]);_0x52a408[_0xaead('0x2f')]=_[_0xaead('0x30')](_0x225565[_0xaead('0x2f')]);_0x52a408[_0xaead('0x31')]=_[_0xaead('0x32')](_0x52a408[_0xaead('0x2d')],_0x52a408[_0xaead('0x2f')]);_0x322849['attributes']=_[_0xaead('0x32')](_0x52a408[_0xaead('0x2d')],qs[_0xaead('0x34')](_0x225565[_0xaead('0x2f')][_0xaead('0x34')]));_0x322849['attributes']=_0x322849[_0xaead('0x33')][_0xaead('0x35')]?_0x322849['attributes']:_0x52a408[_0xaead('0x2d')];if(_0x225565[_0xaead('0x2f')]['includeAll']){_0x322849['include']=[{'all':!![]}];}_0x322849=_[_0xaead('0x39')]({},_0x322849,_0x225565['options']);return db[_0xaead('0x28')]['find'](_0x322849)['then'](handleEntityNotFound(_0x2c2161,null))[_0xaead('0x1f')](respondWithResult(_0x2c2161,null))[_0xaead('0x41')](handleError(_0x2c2161,null));};exports[_0xaead('0x1e')]=function(_0x4730c9,_0x3bc71d){if(_0x4730c9[_0xaead('0x42')]['id']){delete _0x4730c9['body']['id'];}return db[_0xaead('0x28')]['find']({'where':{'id':_0x4730c9[_0xaead('0x40')]['id']}})[_0xaead('0x1f')](handleEntityNotFound(_0x3bc71d,null))['then'](saveUpdates(_0x4730c9[_0xaead('0x42')],null))['then'](respondWithResult(_0x3bc71d,null))[_0xaead('0x41')](handleError(_0x3bc71d,null));};exports[_0xaead('0x20')]=function(_0x3b8bec,_0x231687){return db[_0xaead('0x28')][_0xaead('0x43')]({'where':{'id':_0x3b8bec['params']['id']}})[_0xaead('0x1f')](handleEntityNotFound(_0x231687,null))[_0xaead('0x1f')](removeEntity(_0x231687,null))['catch'](handleError(_0x231687,null));};exports['create']=function(_0x1c103a,_0x296f3e){var _0x1cfe9f={'key':_0x1c103a[_0xaead('0x42')][_0xaead('0x2c')]};if(_0x1c103a[_0xaead('0x42')][_0xaead('0x44')]){_0x1cfe9f['MailAccountId']=_0x1c103a[_0xaead('0x42')][_0xaead('0x44')];}else if(_0x1c103a[_0xaead('0x42')][_0xaead('0x45')]){_0x1cfe9f[_0xaead('0x45')]=_0x1c103a[_0xaead('0x42')][_0xaead('0x45')];}else if(_0x1c103a[_0xaead('0x42')][_0xaead('0x46')]){_0x1cfe9f[_0xaead('0x46')]=_0x1c103a[_0xaead('0x42')][_0xaead('0x46')];}else if(_0x1c103a[_0xaead('0x42')]['ChatWebsiteId']){_0x1cfe9f[_0xaead('0x47')]=_0x1c103a[_0xaead('0x42')][_0xaead('0x47')];}return db['CannedAnswer']['find']({'where':_0x1cfe9f})['then'](function(_0x2f8c76){if(_0x2f8c76){throw new db[(_0xaead('0x48'))][(_0xaead('0x49'))](_0xaead('0x4a'));}return db['CannedAnswer'][_0xaead('0x4b')](_0x1c103a[_0xaead('0x42')]);})[_0xaead('0x1f')](function(_0x84b37b){var _0xc984f9=_0x1c103a[_0xaead('0x4c')][_0xaead('0x4d')]({'plain':!![]});if(!_0xc984f9)throw new Error(_0xaead('0x4e'));if(_0xc984f9[_0xaead('0x4f')]===_0xaead('0x4c')){var _0x54b671=_0x84b37b[_0xaead('0x4d')]({'plain':!![]});return db[_0xaead('0x50')][_0xaead('0x43')]({'where':{'name':_0xaead('0x21'),'userProfileId':_0xc984f9[_0xaead('0x51')]},'raw':!![]})[_0xaead('0x1f')](function(_0x23ad9b){if(_0x23ad9b&&_0x23ad9b['autoAssociation']===0x0){return db[_0xaead('0x22')][_0xaead('0x4b')]({'name':_0x54b671[_0xaead('0x25')],'resourceId':_0x54b671['id'],'type':_0x23ad9b[_0xaead('0x25')],'sectionId':_0x23ad9b['id']},{})[_0xaead('0x1f')](function(){return _0x84b37b;});}else{return _0x84b37b;}})['catch'](function(_0x107487){logger[_0xaead('0x23')](_0xaead('0x52'),_0x107487);throw _0x107487;});}return _0x84b37b;})['then'](respondWithResult(_0x296f3e,0xc9))[_0xaead('0x41')](handleError(_0x296f3e,null));}; \ No newline at end of file +var _0x0cbb=['query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','options','count','includeAll','include','findAll','rows','catch','params','keys','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map'];(function(_0x50ba88,_0x44d9dd){var _0x155479=function(_0x2fa4c9){while(--_0x2fa4c9){_0x50ba88['push'](_0x50ba88['shift']());}};_0x155479(++_0x44d9dd);}(_0x0cbb,0x1ee));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb0cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0cb('0x1'));var jsonpatch=require(_0xb0cb('0x2'));var rp=require(_0xb0cb('0x3'));var moment=require(_0xb0cb('0x4'));var BPromise=require(_0xb0cb('0x5'));var Mustache=require(_0xb0cb('0x6'));var util=require(_0xb0cb('0x7'));var path=require('path');var sox=require(_0xb0cb('0x8'));var csv=require('to-csv');var ejs=require(_0xb0cb('0x9'));var fs=require('fs');var fs_extra=require(_0xb0cb('0xa'));var _=require(_0xb0cb('0xb'));var squel=require(_0xb0cb('0xc'));var crypto=require('crypto');var jsforce=require(_0xb0cb('0xd'));var deskjs=require(_0xb0cb('0xe'));var toCsv=require(_0xb0cb('0xf'));var querystring=require(_0xb0cb('0x10'));var Papa=require(_0xb0cb('0x11'));var Redis=require(_0xb0cb('0x12'));var authService=require(_0xb0cb('0x13'));var qs=require(_0xb0cb('0x14'));var as=require(_0xb0cb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0cb('0x16'))(_0xb0cb('0x17'));var utils=require(_0xb0cb('0x18'));var config=require(_0xb0cb('0x19'));var licenseUtil=require(_0xb0cb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b5ea,_0x447d46){_0x447d46=_0x447d46||0xcc;return function(_0x52fcf2){if(_0x52fcf2){return _0x33b5ea[_0xb0cb('0x1b')](_0x447d46);}return _0x33b5ea[_0xb0cb('0x1c')](_0x447d46)[_0xb0cb('0x1d')]();};}function respondWithResult(_0x402bcd,_0x365bd5){_0x365bd5=_0x365bd5||0xc8;return function(_0x19b04a){if(_0x19b04a){return _0x402bcd[_0xb0cb('0x1c')](_0x365bd5)[_0xb0cb('0x1e')](_0x19b04a);}};}function respondWithFilteredResult(_0x3d85ee,_0x197f14){return function(_0x30854b){if(_0x30854b){var _0x4b0a7c=typeof _0x197f14[_0xb0cb('0x1f')]==='undefined'&&typeof _0x197f14[_0xb0cb('0x20')]===_0xb0cb('0x21');var _0x55fd5a=_0x30854b['count'];var _0x214a7=_0x4b0a7c?0x0:_0x197f14['offset'];var _0x183f3d=_0x4b0a7c?_0x30854b['count']:_0x197f14[_0xb0cb('0x1f')]+_0x197f14['limit'];var _0x7c4b8b;if(_0x183f3d>=_0x55fd5a){_0x183f3d=_0x55fd5a;_0x7c4b8b=0xc8;}else{_0x7c4b8b=0xce;}_0x3d85ee['status'](_0x7c4b8b);return _0x3d85ee[_0xb0cb('0x22')]('Content-Range',_0x214a7+'-'+_0x183f3d+'/'+_0x55fd5a)[_0xb0cb('0x1e')](_0x30854b);}return null;};}function patchUpdates(_0x47351f){return function(_0x19991e){try{jsonpatch[_0xb0cb('0x23')](_0x19991e,_0x47351f,!![]);}catch(_0x4ee322){return BPromise[_0xb0cb('0x24')](_0x4ee322);}return _0x19991e[_0xb0cb('0x25')]();};}function saveUpdates(_0x420ecd,_0x20f469){return function(_0x73d6ea){if(_0x73d6ea){return _0x73d6ea[_0xb0cb('0x26')](_0x420ecd)[_0xb0cb('0x27')](function(_0x533f39){return _0x533f39;});}return null;};}function removeEntity(_0x4475c9,_0x540f17){return function(_0xe20a77){if(_0xe20a77){return _0xe20a77['destroy']()['then'](function(){var _0x2a6adb=_0xe20a77['get']({'plain':!![]});var _0x1a57ff='CannedAnswers';return db[_0xb0cb('0x28')]['destroy']({'where':{'type':_0x1a57ff,'resourceId':_0x2a6adb['id']}})[_0xb0cb('0x27')](function(){return _0xe20a77;});})['then'](function(){_0x4475c9[_0xb0cb('0x1c')](0xcc)[_0xb0cb('0x1d')]();});}};}function handleEntityNotFound(_0x56dbb7,_0x55f0cd){return function(_0x945449){if(!_0x945449){_0x56dbb7['sendStatus'](0x194);}return _0x945449;};}function handleError(_0x2879e6,_0x54f3bc){_0x54f3bc=_0x54f3bc||0x1f4;return function(_0x573415){logger[_0xb0cb('0x29')](_0x573415[_0xb0cb('0x2a')]);if(_0x573415[_0xb0cb('0x2b')]){delete _0x573415[_0xb0cb('0x2b')];}_0x2879e6[_0xb0cb('0x1c')](_0x54f3bc)['send'](_0x573415);};}exports[_0xb0cb('0x2c')]=function(_0x455632,_0x13ec92){var _0x1ccd21={},_0x1211e9={},_0x49f8bf={'count':0x0,'rows':[]};var _0x9f34e4=_['map'](db[_0xb0cb('0x2d')][_0xb0cb('0x2e')],function(_0x463764){return{'name':_0x463764[_0xb0cb('0x2f')],'type':_0x463764[_0xb0cb('0x30')][_0xb0cb('0x31')]};});_0x1211e9[_0xb0cb('0x32')]=_[_0xb0cb('0x33')](_0x9f34e4,_0xb0cb('0x2b'));_0x1211e9[_0xb0cb('0x34')]=_['keys'](_0x455632['query']);_0x1211e9['filters']=_[_0xb0cb('0x35')](_0x1211e9['model'],_0x1211e9[_0xb0cb('0x34')]);_0x1ccd21[_0xb0cb('0x36')]=_[_0xb0cb('0x35')](_0x1211e9[_0xb0cb('0x32')],qs['fields'](_0x455632[_0xb0cb('0x34')][_0xb0cb('0x37')]));_0x1ccd21[_0xb0cb('0x36')]=_0x1ccd21[_0xb0cb('0x36')][_0xb0cb('0x38')]?_0x1ccd21[_0xb0cb('0x36')]:_0x1211e9[_0xb0cb('0x32')];if(!_0x455632[_0xb0cb('0x34')][_0xb0cb('0x39')]('nolimit')){_0x1ccd21[_0xb0cb('0x20')]=qs[_0xb0cb('0x20')](_0x455632[_0xb0cb('0x34')][_0xb0cb('0x20')]);_0x1ccd21[_0xb0cb('0x1f')]=qs[_0xb0cb('0x1f')](_0x455632[_0xb0cb('0x34')]['offset']);}_0x1ccd21[_0xb0cb('0x3a')]=qs[_0xb0cb('0x3b')](_0x455632[_0xb0cb('0x34')][_0xb0cb('0x3b')]);_0x1ccd21['where']=qs['filters'](_[_0xb0cb('0x3c')](_0x455632[_0xb0cb('0x34')],_0x1211e9[_0xb0cb('0x3d')]),_0x9f34e4);if(_0x455632['query'][_0xb0cb('0x3e')]){_0x1ccd21[_0xb0cb('0x3f')]=_['merge'](_0x1ccd21[_0xb0cb('0x3f')],{'$or':[{'key':{'$like':'%'+_0x455632['query'][_0xb0cb('0x3e')]+'%'}},{'value':{'$like':'%'+_0x455632[_0xb0cb('0x34')][_0xb0cb('0x3e')]+'%'}}]});}_0x1ccd21=_[_0xb0cb('0x40')]({},_0x1ccd21,_0x455632[_0xb0cb('0x41')]);var _0x4e2827={'where':_0x1ccd21[_0xb0cb('0x3f')]};return db[_0xb0cb('0x2d')][_0xb0cb('0x42')](_0x4e2827)[_0xb0cb('0x27')](function(_0x143b51){_0x49f8bf[_0xb0cb('0x42')]=_0x143b51;if(_0x455632[_0xb0cb('0x34')][_0xb0cb('0x43')]){_0x1ccd21[_0xb0cb('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb0cb('0x45')](_0x1ccd21);})[_0xb0cb('0x27')](function(_0x5ed84a){_0x49f8bf[_0xb0cb('0x46')]=_0x5ed84a;return _0x49f8bf;})['then'](respondWithFilteredResult(_0x13ec92,_0x1ccd21))[_0xb0cb('0x47')](handleError(_0x13ec92,null));};exports['show']=function(_0x38e8c3,_0x51b1f0){var _0x417934={'raw':!![],'where':{'id':_0x38e8c3[_0xb0cb('0x48')]['id']}},_0x1b0a71={};_0x1b0a71[_0xb0cb('0x32')]=_[_0xb0cb('0x49')](db[_0xb0cb('0x2d')][_0xb0cb('0x2e')]);_0x1b0a71[_0xb0cb('0x34')]=_['keys'](_0x38e8c3['query']);_0x1b0a71[_0xb0cb('0x3d')]=_[_0xb0cb('0x35')](_0x1b0a71['model'],_0x1b0a71['query']);_0x417934[_0xb0cb('0x36')]=_[_0xb0cb('0x35')](_0x1b0a71[_0xb0cb('0x32')],qs[_0xb0cb('0x37')](_0x38e8c3[_0xb0cb('0x34')]['fields']));_0x417934[_0xb0cb('0x36')]=_0x417934[_0xb0cb('0x36')][_0xb0cb('0x38')]?_0x417934[_0xb0cb('0x36')]:_0x1b0a71[_0xb0cb('0x32')];if(_0x38e8c3[_0xb0cb('0x34')][_0xb0cb('0x43')]){_0x417934[_0xb0cb('0x44')]=[{'all':!![]}];}_0x417934=_[_0xb0cb('0x40')]({},_0x417934,_0x38e8c3[_0xb0cb('0x41')]);return db[_0xb0cb('0x2d')][_0xb0cb('0x4a')](_0x417934)[_0xb0cb('0x27')](handleEntityNotFound(_0x51b1f0,null))[_0xb0cb('0x27')](respondWithResult(_0x51b1f0,null))['catch'](handleError(_0x51b1f0,null));};exports[_0xb0cb('0x26')]=function(_0x205781,_0x5eaf7f){if(_0x205781[_0xb0cb('0x4b')]['id']){delete _0x205781[_0xb0cb('0x4b')]['id'];}return db['CannedAnswer'][_0xb0cb('0x4a')]({'where':{'id':_0x205781[_0xb0cb('0x48')]['id']}})[_0xb0cb('0x27')](handleEntityNotFound(_0x5eaf7f,null))['then'](saveUpdates(_0x205781[_0xb0cb('0x4b')],null))[_0xb0cb('0x27')](respondWithResult(_0x5eaf7f,null))[_0xb0cb('0x47')](handleError(_0x5eaf7f,null));};exports[_0xb0cb('0x4c')]=function(_0x590b13,_0x294932){return db['CannedAnswer'][_0xb0cb('0x4a')]({'where':{'id':_0x590b13['params']['id']}})[_0xb0cb('0x27')](handleEntityNotFound(_0x294932,null))[_0xb0cb('0x27')](removeEntity(_0x294932,null))[_0xb0cb('0x47')](handleError(_0x294932,null));};exports[_0xb0cb('0x4d')]=function(_0x4f5533,_0x25f4a5){var _0x4402a7={'key':_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x31')]};if(_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x4e')]){_0x4402a7[_0xb0cb('0x4e')]=_0x4f5533['body'][_0xb0cb('0x4e')];}else if(_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x4f')]){_0x4402a7['SmsAccountId']=_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x4f')];}else if(_0x4f5533[_0xb0cb('0x4b')]['OpenchannelAccountId']){_0x4402a7[_0xb0cb('0x50')]=_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x50')];}else if(_0x4f5533[_0xb0cb('0x4b')][_0xb0cb('0x51')]){_0x4402a7[_0xb0cb('0x51')]=_0x4f5533[_0xb0cb('0x4b')]['ChatWebsiteId'];}return db[_0xb0cb('0x2d')]['find']({'where':_0x4402a7})[_0xb0cb('0x27')](function(_0x171ce9){if(_0x171ce9){throw new db[(_0xb0cb('0x52'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xb0cb('0x2d')][_0xb0cb('0x4d')](_0x4f5533[_0xb0cb('0x4b')]);})[_0xb0cb('0x27')](function(_0x3d5688){var _0x295380=_0x4f5533[_0xb0cb('0x53')]['get']({'plain':!![]});if(!_0x295380)throw new Error(_0xb0cb('0x54'));if(_0x295380[_0xb0cb('0x55')]===_0xb0cb('0x53')){var _0x458045=_0x3d5688[_0xb0cb('0x56')]({'plain':!![]});return db[_0xb0cb('0x57')][_0xb0cb('0x4a')]({'where':{'name':_0xb0cb('0x58'),'userProfileId':_0x295380[_0xb0cb('0x59')]},'raw':!![]})[_0xb0cb('0x27')](function(_0x2194ba){if(_0x2194ba&&_0x2194ba['autoAssociation']===0x0){return db[_0xb0cb('0x28')][_0xb0cb('0x4d')]({'name':_0x458045[_0xb0cb('0x2b')],'resourceId':_0x458045['id'],'type':_0x2194ba['name'],'sectionId':_0x2194ba['id']},{})[_0xb0cb('0x27')](function(){return _0x3d5688;});}else{return _0x3d5688;}})[_0xb0cb('0x47')](function(_0x34360c){logger[_0xb0cb('0x29')](_0xb0cb('0x5a'),_0x34360c);throw _0x34360c;});}return _0x3d5688;})[_0xb0cb('0x27')](respondWithResult(_0x25f4a5,0xc9))[_0xb0cb('0x47')](handleError(_0x25f4a5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3c0f691..115b335 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 _0xe9e8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe9e8,0x7e));var _0x8e9e=function(_0x76a220,_0x529c0f){_0x76a220=_0x76a220-0x0;var _0xa5227=_0xe9e8[_0x76a220];return _0xa5227;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require('../../config/logger')(_0x8e9e('0x2'));var moment=require(_0x8e9e('0x3'));var BPromise=require(_0x8e9e('0x4'));var rp=require(_0x8e9e('0x5'));var fs=require('fs');var path=require(_0x8e9e('0x6'));var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x217e7e,_0xded6f7){return _0x217e7e['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e9e('0xc'),'collate':_0x8e9e('0xd')});}; \ No newline at end of file +var _0xb63a=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x33f764,_0x545987){var _0x491a5a=function(_0x107e44){while(--_0x107e44){_0x33f764['push'](_0x33f764['shift']());}};_0x491a5a(++_0x545987);}(_0xb63a,0x135));var _0xab63=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0xb63a[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0xab63('0x0'));var util=require(_0xab63('0x1'));var logger=require('../../config/logger')(_0xab63('0x2'));var moment=require(_0xab63('0x3'));var BPromise=require(_0xab63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab63('0x5'));var rimraf=require(_0xab63('0x6'));var config=require(_0xab63('0x7'));var attributes=require(_0xab63('0x8'));module['exports']=function(_0x127ccd,_0x881bbe){return _0x127ccd[_0xab63('0x9')](_0xab63('0xa'),attributes,{'tableName':_0xab63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab63('0xc'),'collate':_0xab63('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 531d649..a617eeb 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(_0x12941c,_0x1bdae8){var _0x13b903=function(_0x33d429){while(--_0x33d429){_0x12941c['push'](_0x12941c['shift']());}};_0x13b903(++_0x1bdae8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x1b8ffb,_0x2b6eeb){var _0x2f9c09=function(_0x2ae130){while(--_0x2ae130){_0x1b8ffb['push'](_0x1b8ffb['shift']());}};_0x2f9c09(++_0x2b6eeb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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 ec96189..4e90186 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 _0x1799=['../../config/environment','get','isAuthenticated','show','post','create','update','delete','/:id','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f1997,_0x339b45){var _0x2bf632=function(_0x267df2){while(--_0x267df2){_0x2f1997['push'](_0x2f1997['shift']());}};_0x2bf632(++_0x339b45);}(_0x1799,0x6b));var _0x9179=function(_0x43c2ae,_0x1371fb){_0x43c2ae=_0x43c2ae-0x0;var _0x1d23b9=_0x1799[_0x43c2ae];return _0x1d23b9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9179('0x0'));var express=require('express');var router=express[_0x9179('0x1')]();var fs_extra=require(_0x9179('0x2'));var auth=require(_0x9179('0x3'));var interaction=require(_0x9179('0x4'));var config=require(_0x9179('0x5'));var controller=require('./cannedAnswer.controller');router[_0x9179('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9179('0x6')]('/:id',auth[_0x9179('0x7')](),controller[_0x9179('0x8')]);router[_0x9179('0x9')]('/',auth[_0x9179('0x7')](),controller[_0x9179('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9179('0xb')]);router[_0x9179('0xc')](_0x9179('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b82=['util','express','fs-extra','./cannedAnswer.controller','get','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer'];(function(_0x566d9d,_0x1884f9){var _0x479385=function(_0x60f08f){while(--_0x60f08f){_0x566d9d['push'](_0x566d9d['shift']());}};_0x479385(++_0x1884f9);}(_0x2b82,0x1bf));var _0x22b8=function(_0x530525,_0x7e14ec){_0x530525=_0x530525-0x0;var _0x41a015=_0x2b82[_0x530525];return _0x41a015;};'use strict';var multer=require(_0x22b8('0x0'));var util=require(_0x22b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x22b8('0x2'));var router=express['Router']();var fs_extra=require(_0x22b8('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x22b8('0x4'));router[_0x22b8('0x5')]('/',auth[_0x22b8('0x6')](),controller['index']);router['get'](_0x22b8('0x7'),auth[_0x22b8('0x6')](),controller[_0x22b8('0x8')]);router['post']('/',auth[_0x22b8('0x6')](),controller[_0x22b8('0x9')]);router[_0x22b8('0xa')]('/:id',auth[_0x22b8('0x6')](),controller['update']);router[_0x22b8('0xb')]('/:id',auth[_0x22b8('0x6')](),controller[_0x22b8('0xc')]);module[_0x22b8('0xd')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index f132db7..b67e5cf 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 _0x7eee=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x7eee,0x1bb));var _0xe7ee=function(_0x1e544e,_0x2e83ac){_0x1e544e=_0x1e544e-0x0;var _0x30bff1=_0x7eee[_0x1e544e];return _0x30bff1;};'use strict';var Sequelize=require('sequelize');module[_0xe7ee('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xe7ee('0x1')},'clid':{'type':Sequelize[_0xe7ee('0x2')]},'src':{'type':Sequelize[_0xe7ee('0x2')]},'dst':{'type':Sequelize[_0xe7ee('0x2')]},'dcontext':{'type':Sequelize[_0xe7ee('0x2')]},'channel':{'type':Sequelize[_0xe7ee('0x2')]},'dstchannel':{'type':Sequelize[_0xe7ee('0x2')]},'lastapp':{'type':Sequelize[_0xe7ee('0x2')]},'lastdata':{'type':Sequelize[_0xe7ee('0x2')]},'duration':{'type':Sequelize[_0xe7ee('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe7ee('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe7ee('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe7ee('0x2')]},'userfield':{'type':Sequelize[_0xe7ee('0x2')]},'uniqueid':{'type':Sequelize[_0xe7ee('0x2')]},'linkedid':{'type':Sequelize[_0xe7ee('0x2')]},'sequence':{'type':Sequelize[_0xe7ee('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xe7ee('0x2')]}}; \ No newline at end of file +var _0x0f92=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x1918d9,_0x3fb09d){var _0xaa4f57=function(_0x5ee64b){while(--_0x5ee64b){_0x1918d9['push'](_0x1918d9['shift']());}};_0xaa4f57(++_0x3fb09d);}(_0x0f92,0xfd));var _0x20f9=function(_0xc3970b,_0xd82b5b){_0xc3970b=_0xc3970b-0x0;var _0xfd1d16=_0x0f92[_0xc3970b];return _0xfd1d16;};'use strict';var Sequelize=require(_0x20f9('0x0'));module[_0x20f9('0x1')]={'calldate':{'type':Sequelize[_0x20f9('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x20f9('0x3')]},'src':{'type':Sequelize[_0x20f9('0x3')]},'dst':{'type':Sequelize[_0x20f9('0x3')]},'dcontext':{'type':Sequelize[_0x20f9('0x3')]},'channel':{'type':Sequelize[_0x20f9('0x3')]},'dstchannel':{'type':Sequelize[_0x20f9('0x3')]},'lastapp':{'type':Sequelize[_0x20f9('0x3')]},'lastdata':{'type':Sequelize[_0x20f9('0x3')]},'duration':{'type':Sequelize[_0x20f9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x20f9('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x20f9('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x20f9('0x3')]},'userfield':{'type':Sequelize[_0x20f9('0x3')]},'uniqueid':{'type':Sequelize[_0x20f9('0x3')]},'linkedid':{'type':Sequelize[_0x20f9('0x3')]},'sequence':{'type':Sequelize[_0x20f9('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x20f9('0x3')]},'tag':{'type':Sequelize[_0x20f9('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 7ef15fa..3d2dc68 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 _0xfd7b=['stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','end','error'];(function(_0x4ca5b4,_0x4070a7){var _0x206d76=function(_0x35be33){while(--_0x35be33){_0x4ca5b4['push'](_0x4ca5b4['shift']());}};_0x206d76(++_0x4070a7);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xfd7b[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd7('0x0'));var zipdir=require(_0xbfd7('0x1'));var jsonpatch=require(_0xbfd7('0x2'));var rp=require(_0xbfd7('0x3'));var moment=require(_0xbfd7('0x4'));var BPromise=require(_0xbfd7('0x5'));var Mustache=require(_0xbfd7('0x6'));var util=require(_0xbfd7('0x7'));var path=require(_0xbfd7('0x8'));var sox=require(_0xbfd7('0x9'));var csv=require(_0xbfd7('0xa'));var ejs=require(_0xbfd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbfd7('0xc'));var _=require('lodash');var squel=require(_0xbfd7('0xd'));var crypto=require('crypto');var jsforce=require(_0xbfd7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfd7('0xa'));var querystring=require(_0xbfd7('0xf'));var Papa=require(_0xbfd7('0x10'));var Redis=require(_0xbfd7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfd7('0x12'));var as=require(_0xbfd7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbfd7('0x14'));var utils=require(_0xbfd7('0x15'));var config=require(_0xbfd7('0x16'));var licenseUtil=require(_0xbfd7('0x17'));var db=require(_0xbfd7('0x18'))['db'];function respondWithStatusCode(_0x559eca,_0x46feae){_0x46feae=_0x46feae||0xcc;return function(_0x534d66){if(_0x534d66){return _0x559eca[_0xbfd7('0x19')](_0x46feae);}return _0x559eca['status'](_0x46feae)['end']();};}function respondWithResult(_0x44847e,_0x4fec16){_0x4fec16=_0x4fec16||0xc8;return function(_0x3789b7){if(_0x3789b7){return _0x44847e[_0xbfd7('0x1a')](_0x4fec16)['json'](_0x3789b7);}};}function respondWithFilteredResult(_0x5efd54,_0x48f4a4){return function(_0x37e777){if(_0x37e777){var _0x115a34=typeof _0x48f4a4[_0xbfd7('0x1b')]===_0xbfd7('0x1c')&&typeof _0x48f4a4[_0xbfd7('0x1d')]===_0xbfd7('0x1c');var _0x137d50=_0x37e777[_0xbfd7('0x1e')];var _0x3053f3=_0x115a34?0x0:_0x48f4a4['offset'];var _0x5b718b=_0x115a34?_0x37e777[_0xbfd7('0x1e')]:_0x48f4a4[_0xbfd7('0x1b')]+_0x48f4a4['limit'];var _0x5ea27a;if(_0x5b718b>=_0x137d50){_0x5b718b=_0x137d50;_0x5ea27a=0xc8;}else{_0x5ea27a=0xce;}_0x5efd54[_0xbfd7('0x1a')](_0x5ea27a);return _0x5efd54['set']('Content-Range',_0x3053f3+'-'+_0x5b718b+'/'+_0x137d50)[_0xbfd7('0x1f')](_0x37e777);}return null;};}function patchUpdates(_0x5eab37){return function(_0x594792){try{jsonpatch[_0xbfd7('0x20')](_0x594792,_0x5eab37,!![]);}catch(_0x1db6de){return BPromise[_0xbfd7('0x21')](_0x1db6de);}return _0x594792['save']();};}function saveUpdates(_0xb38f6b,_0x32a489){return function(_0x152893){if(_0x152893){return _0x152893[_0xbfd7('0x22')](_0xb38f6b)[_0xbfd7('0x23')](function(_0x2639b6){return _0x2639b6;});}return null;};}function removeEntity(_0x51b13d,_0x2402fb){return function(_0x1c765b){if(_0x1c765b){return _0x1c765b[_0xbfd7('0x24')]()['then'](function(){_0x51b13d[_0xbfd7('0x1a')](0xcc)[_0xbfd7('0x25')]();});}};}function handleEntityNotFound(_0x18dd74,_0x2d0549){return function(_0x358549){if(!_0x358549){_0x18dd74['sendStatus'](0x194);}return _0x358549;};}function handleError(_0x2a7749,_0x6ef5aa){_0x6ef5aa=_0x6ef5aa||0x1f4;return function(_0x120e39){logger[_0xbfd7('0x26')](_0x120e39[_0xbfd7('0x27')]);if(_0x120e39[_0xbfd7('0x28')]){delete _0x120e39[_0xbfd7('0x28')];}_0x2a7749['status'](_0x6ef5aa)[_0xbfd7('0x29')](_0x120e39);};}exports[_0xbfd7('0x2a')]=function(_0x4d7ef4,_0x2971ea){var _0x33583b={},_0x2ec4a5={},_0x14c55d={'count':0x0,'rows':[]};var _0x510506=_[_0xbfd7('0x2b')](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')],function(_0x489365){return{'name':_0x489365[_0xbfd7('0x2e')],'type':_0x489365['type'][_0xbfd7('0x2f')]};});_0x2ec4a5['model']=_[_0xbfd7('0x2b')](_0x510506,_0xbfd7('0x28'));_0x2ec4a5['query']=_[_0xbfd7('0x30')](_0x4d7ef4[_0xbfd7('0x31')]);_0x2ec4a5['filters']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],_0x2ec4a5[_0xbfd7('0x31')]);_0x33583b['attributes']=_[_0xbfd7('0x32')](_0x2ec4a5[_0xbfd7('0x33')],qs[_0xbfd7('0x34')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x34')]));_0x33583b[_0xbfd7('0x35')]=_0x33583b[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x33583b[_0xbfd7('0x35')]:_0x2ec4a5[_0xbfd7('0x33')];if(!_0x4d7ef4[_0xbfd7('0x31')]['hasOwnProperty'](_0xbfd7('0x37'))){_0x33583b['limit']=qs['limit'](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1d')]);_0x33583b[_0xbfd7('0x1b')]=qs[_0xbfd7('0x1b')](_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x1b')]);}_0x33583b[_0xbfd7('0x38')]=qs[_0xbfd7('0x39')](_0x4d7ef4['query']['sort']);_0x33583b[_0xbfd7('0x3a')]=qs[_0xbfd7('0x3b')](_['pick'](_0x4d7ef4[_0xbfd7('0x31')],_0x2ec4a5[_0xbfd7('0x3b')]),_0x510506);if(_0x4d7ef4['query']['filter']){_0x33583b[_0xbfd7('0x3a')]=_[_0xbfd7('0x3c')](_0x33583b['where'],{'$or':_[_0xbfd7('0x2b')](_0x510506,function(_0xfee712){if(_0xfee712[_0xbfd7('0x3d')]!==_0xbfd7('0x3e')){var _0x68f13={};_0x68f13[_0xfee712['name']]={'$like':'%'+_0x4d7ef4[_0xbfd7('0x31')][_0xbfd7('0x3f')]+'%'};return _0x68f13;}})});}_0x33583b=_[_0xbfd7('0x3c')]({},_0x33583b,_0x4d7ef4[_0xbfd7('0x40')]);var _0x25ac4a={'where':_0x33583b[_0xbfd7('0x3a')]};return db[_0xbfd7('0x2c')][_0xbfd7('0x1e')](_0x25ac4a)['then'](function(_0x32df79){_0x14c55d['count']=_0x32df79;if(_0x4d7ef4['query'][_0xbfd7('0x41')]){_0x33583b[_0xbfd7('0x42')]=[{'all':!![]}];}return db[_0xbfd7('0x2c')][_0xbfd7('0x43')](_0x33583b);})[_0xbfd7('0x23')](function(_0x1236dd){_0x14c55d['rows']=_0x1236dd;return _0x14c55d;})[_0xbfd7('0x23')](respondWithFilteredResult(_0x2971ea,_0x33583b))['catch'](handleError(_0x2971ea,null));};exports[_0xbfd7('0x44')]=function(_0x3b7d7f,_0x12f99b){var _0x159c20={'raw':!![],'where':{'id':_0x3b7d7f[_0xbfd7('0x45')]['id']}},_0x1df6a3={};_0x1df6a3[_0xbfd7('0x33')]=_['keys'](db[_0xbfd7('0x2c')][_0xbfd7('0x2d')]);_0x1df6a3[_0xbfd7('0x31')]=_[_0xbfd7('0x30')](_0x3b7d7f[_0xbfd7('0x31')]);_0x1df6a3[_0xbfd7('0x3b')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],_0x1df6a3[_0xbfd7('0x31')]);_0x159c20[_0xbfd7('0x35')]=_[_0xbfd7('0x32')](_0x1df6a3['model'],qs['fields'](_0x3b7d7f['query'][_0xbfd7('0x34')]));_0x159c20[_0xbfd7('0x35')]=_0x159c20[_0xbfd7('0x35')][_0xbfd7('0x36')]?_0x159c20['attributes']:_0x1df6a3[_0xbfd7('0x33')];if(_0x3b7d7f['query'][_0xbfd7('0x41')]){_0x159c20[_0xbfd7('0x42')]=[{'all':!![]}];}_0x159c20=_['merge']({},_0x159c20,_0x3b7d7f[_0xbfd7('0x40')]);return db['Cdr'][_0xbfd7('0x46')](_0x159c20)[_0xbfd7('0x23')](handleEntityNotFound(_0x12f99b,null))[_0xbfd7('0x23')](respondWithResult(_0x12f99b,null))['catch'](handleError(_0x12f99b,null));};exports['create']=function(_0x356f58,_0xb8b319){return db['Cdr']['create'](_0x356f58[_0xbfd7('0x47')],{})[_0xbfd7('0x23')](respondWithResult(_0xb8b319,0xc9))[_0xbfd7('0x48')](handleError(_0xb8b319,null));};exports[_0xbfd7('0x22')]=function(_0x1cea7d,_0x14bc15){if(_0x1cea7d[_0xbfd7('0x47')]['id']){delete _0x1cea7d['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x1cea7d[_0xbfd7('0x45')]['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0x14bc15,null))[_0xbfd7('0x23')](saveUpdates(_0x1cea7d['body'],null))[_0xbfd7('0x23')](respondWithResult(_0x14bc15,null))[_0xbfd7('0x48')](handleError(_0x14bc15,null));};exports['destroy']=function(_0x4a7a72,_0xc89535){return db[_0xbfd7('0x2c')][_0xbfd7('0x46')]({'where':{'id':_0x4a7a72['params']['id']}})[_0xbfd7('0x23')](handleEntityNotFound(_0xc89535,null))[_0xbfd7('0x23')](removeEntity(_0xc89535,null))[_0xbfd7('0x48')](handleError(_0xc89535,null));};exports['describe']=function(_0x371d01,_0x15c0fe){return db[_0xbfd7('0x2c')][_0xbfd7('0x49')]()['then'](respondWithResult(_0x15c0fe,null))[_0xbfd7('0x48')](handleError(_0x15c0fe,null));}; \ No newline at end of file +var _0xf3cc=['then','destroy','end','stack','name','send','Cdr','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','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','count','limit','set','Content-Range','apply','reject','update'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x3221cd,_0x4a4a4a){_0x3221cd=_0x3221cd-0x0;var _0x21a689=_0xf3cc[_0x3221cd];return _0x21a689;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245b88,_0x389b0f){_0x389b0f=_0x389b0f||0xcc;return function(_0x59a8dc){if(_0x59a8dc){return _0x245b88[_0xcf3c('0x1b')](_0x389b0f);}return _0x245b88['status'](_0x389b0f)['end']();};}function respondWithResult(_0x56261f,_0x3fd714){_0x3fd714=_0x3fd714||0xc8;return function(_0x598576){if(_0x598576){return _0x56261f[_0xcf3c('0x1c')](_0x3fd714)[_0xcf3c('0x1d')](_0x598576);}};}function respondWithFilteredResult(_0x4e35fc,_0x3e759f){return function(_0x540046){if(_0x540046){var _0x30d023=typeof _0x3e759f[_0xcf3c('0x1e')]===_0xcf3c('0x1f')&&typeof _0x3e759f['limit']===_0xcf3c('0x1f');var _0x190c8c=_0x540046[_0xcf3c('0x20')];var _0x3f6cef=_0x30d023?0x0:_0x3e759f['offset'];var _0x3789b6=_0x30d023?_0x540046[_0xcf3c('0x20')]:_0x3e759f[_0xcf3c('0x1e')]+_0x3e759f[_0xcf3c('0x21')];var _0x3d0e0a;if(_0x3789b6>=_0x190c8c){_0x3789b6=_0x190c8c;_0x3d0e0a=0xc8;}else{_0x3d0e0a=0xce;}_0x4e35fc[_0xcf3c('0x1c')](_0x3d0e0a);return _0x4e35fc[_0xcf3c('0x22')](_0xcf3c('0x23'),_0x3f6cef+'-'+_0x3789b6+'/'+_0x190c8c)[_0xcf3c('0x1d')](_0x540046);}return null;};}function patchUpdates(_0x8e7738){return function(_0x26a26e){try{jsonpatch[_0xcf3c('0x24')](_0x26a26e,_0x8e7738,!![]);}catch(_0x4e80d4){return BPromise[_0xcf3c('0x25')](_0x4e80d4);}return _0x26a26e['save']();};}function saveUpdates(_0x3c9153,_0x1228c1){return function(_0x5dddc1){if(_0x5dddc1){return _0x5dddc1[_0xcf3c('0x26')](_0x3c9153)[_0xcf3c('0x27')](function(_0x328336){return _0x328336;});}return null;};}function removeEntity(_0x1d7e79,_0x32bbd5){return function(_0x3f1771){if(_0x3f1771){return _0x3f1771[_0xcf3c('0x28')]()[_0xcf3c('0x27')](function(){_0x1d7e79['status'](0xcc)[_0xcf3c('0x29')]();});}};}function handleEntityNotFound(_0x4ce43c,_0x2281b6){return function(_0x15b55c){if(!_0x15b55c){_0x4ce43c[_0xcf3c('0x1b')](0x194);}return _0x15b55c;};}function handleError(_0x35e546,_0x181c90){_0x181c90=_0x181c90||0x1f4;return function(_0x43c912){logger['error'](_0x43c912[_0xcf3c('0x2a')]);if(_0x43c912['name']){delete _0x43c912[_0xcf3c('0x2b')];}_0x35e546[_0xcf3c('0x1c')](_0x181c90)[_0xcf3c('0x2c')](_0x43c912);};}exports['index']=function(_0x397996,_0x54174a){var _0x1d8223={},_0xe22e99={},_0x21a329={'count':0x0,'rows':[]};var _0x5bdae3=_['map'](db[_0xcf3c('0x2d')][_0xcf3c('0x2e')],function(_0x1f53ee){return{'name':_0x1f53ee[_0xcf3c('0x2f')],'type':_0x1f53ee['type'][_0xcf3c('0x30')]};});_0xe22e99[_0xcf3c('0x31')]=_[_0xcf3c('0x32')](_0x5bdae3,'name');_0xe22e99[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x397996[_0xcf3c('0x33')]);_0xe22e99['filters']=_[_0xcf3c('0x35')](_0xe22e99[_0xcf3c('0x31')],_0xe22e99[_0xcf3c('0x33')]);_0x1d8223[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0xe22e99['model'],qs[_0xcf3c('0x37')](_0x397996['query'][_0xcf3c('0x37')]));_0x1d8223['attributes']=_0x1d8223[_0xcf3c('0x36')][_0xcf3c('0x38')]?_0x1d8223[_0xcf3c('0x36')]:_0xe22e99[_0xcf3c('0x31')];if(!_0x397996[_0xcf3c('0x33')][_0xcf3c('0x39')](_0xcf3c('0x3a'))){_0x1d8223[_0xcf3c('0x21')]=qs['limit'](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x21')]);_0x1d8223[_0xcf3c('0x1e')]=qs[_0xcf3c('0x1e')](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x1e')]);}_0x1d8223[_0xcf3c('0x3b')]=qs[_0xcf3c('0x3c')](_0x397996[_0xcf3c('0x33')][_0xcf3c('0x3c')]);_0x1d8223['where']=qs[_0xcf3c('0x3d')](_['pick'](_0x397996['query'],_0xe22e99['filters']),_0x5bdae3);if(_0x397996[_0xcf3c('0x33')][_0xcf3c('0x3e')]){_0x1d8223[_0xcf3c('0x3f')]=_[_0xcf3c('0x40')](_0x1d8223['where'],{'$or':_['map'](_0x5bdae3,function(_0x27e186){if(_0x27e186[_0xcf3c('0x41')]!==_0xcf3c('0x42')){var _0x9c753f={};_0x9c753f[_0x27e186[_0xcf3c('0x2b')]]={'$like':'%'+_0x397996[_0xcf3c('0x33')]['filter']+'%'};return _0x9c753f;}})});}_0x1d8223=_[_0xcf3c('0x40')]({},_0x1d8223,_0x397996[_0xcf3c('0x43')]);var _0x292c4d={'where':_0x1d8223['where']};return db[_0xcf3c('0x2d')]['count'](_0x292c4d)['then'](function(_0x43ba75){_0x21a329[_0xcf3c('0x20')]=_0x43ba75;if(_0x397996[_0xcf3c('0x33')][_0xcf3c('0x44')]){_0x1d8223[_0xcf3c('0x45')]=[{'all':!![]}];}return db[_0xcf3c('0x2d')][_0xcf3c('0x46')](_0x1d8223);})[_0xcf3c('0x27')](function(_0x245c77){_0x21a329['rows']=_0x245c77;return _0x21a329;})['then'](respondWithFilteredResult(_0x54174a,_0x1d8223))[_0xcf3c('0x47')](handleError(_0x54174a,null));};exports[_0xcf3c('0x48')]=function(_0x4f5b07,_0x3092e4){var _0x48e5f1={'raw':!![],'where':{'id':_0x4f5b07[_0xcf3c('0x49')]['id']}},_0x2831de={};_0x2831de[_0xcf3c('0x31')]=_[_0xcf3c('0x34')](db[_0xcf3c('0x2d')][_0xcf3c('0x2e')]);_0x2831de[_0xcf3c('0x33')]=_[_0xcf3c('0x34')](_0x4f5b07[_0xcf3c('0x33')]);_0x2831de[_0xcf3c('0x3d')]=_[_0xcf3c('0x35')](_0x2831de[_0xcf3c('0x31')],_0x2831de[_0xcf3c('0x33')]);_0x48e5f1[_0xcf3c('0x36')]=_[_0xcf3c('0x35')](_0x2831de[_0xcf3c('0x31')],qs[_0xcf3c('0x37')](_0x4f5b07[_0xcf3c('0x33')]['fields']));_0x48e5f1['attributes']=_0x48e5f1[_0xcf3c('0x36')]['length']?_0x48e5f1[_0xcf3c('0x36')]:_0x2831de[_0xcf3c('0x31')];if(_0x4f5b07[_0xcf3c('0x33')][_0xcf3c('0x44')]){_0x48e5f1[_0xcf3c('0x45')]=[{'all':!![]}];}_0x48e5f1=_['merge']({},_0x48e5f1,_0x4f5b07['options']);return db['Cdr'][_0xcf3c('0x4a')](_0x48e5f1)[_0xcf3c('0x27')](handleEntityNotFound(_0x3092e4,null))['then'](respondWithResult(_0x3092e4,null))[_0xcf3c('0x47')](handleError(_0x3092e4,null));};exports[_0xcf3c('0x4b')]=function(_0x1cfbc9,_0x2800d4){return db[_0xcf3c('0x2d')][_0xcf3c('0x4b')](_0x1cfbc9[_0xcf3c('0x4c')],{})[_0xcf3c('0x27')](respondWithResult(_0x2800d4,0xc9))[_0xcf3c('0x47')](handleError(_0x2800d4,null));};exports[_0xcf3c('0x26')]=function(_0x25d090,_0x2cfc0b){if(_0x25d090['body']['id']){delete _0x25d090[_0xcf3c('0x4c')]['id'];}return db[_0xcf3c('0x2d')][_0xcf3c('0x4a')]({'where':{'id':_0x25d090[_0xcf3c('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cfc0b,null))[_0xcf3c('0x27')](saveUpdates(_0x25d090['body'],null))[_0xcf3c('0x27')](respondWithResult(_0x2cfc0b,null))['catch'](handleError(_0x2cfc0b,null));};exports['destroy']=function(_0x4bba35,_0x5e3abc){return db[_0xcf3c('0x2d')][_0xcf3c('0x4a')]({'where':{'id':_0x4bba35['params']['id']}})[_0xcf3c('0x27')](handleEntityNotFound(_0x5e3abc,null))[_0xcf3c('0x27')](removeEntity(_0x5e3abc,null))[_0xcf3c('0x47')](handleError(_0x5e3abc,null));};exports['describe']=function(_0x5b5e6a,_0x43f2e1){return db[_0xcf3c('0x2d')]['describe']()['then'](respondWithResult(_0x43f2e1,null))['catch'](handleError(_0x43f2e1,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index f8ec4c7..c19e100 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(_0xb07f69,_0x4ee565){var _0x161a70=function(_0x3f39a6){while(--_0x3f39a6){_0xb07f69['push'](_0xb07f69['shift']());}};_0x161a70(++_0x4ee565);}(_0x7a54,0x106));var _0x47a5=function(_0x54975f,_0x1e439b){_0x54975f=_0x54975f-0x0;var _0x44860a=_0x7a54[_0x54975f];return _0x44860a;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x48b3ec,_0x21fe3d){var _0x7956cf=function(_0x12f5f7){while(--_0x12f5f7){_0x48b3ec['push'](_0x48b3ec['shift']());}};_0x7956cf(++_0x21fe3d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 18c3a26..2f2587a 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 _0xe33d=['lodash','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3e2219,_0x3a772d){var _0x174288=function(_0x41e836){while(--_0x41e836){_0x3e2219['push'](_0x3e2219['shift']());}};_0x174288(++_0x3a772d);}(_0xe33d,0x1a2));var _0xde33=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe33d[_0x432682];return _0x463d05;};'use strict';var _=require(_0xde33('0x0'));var util=require(_0xde33('0x1'));var moment=require('moment');var BPromise=require(_0xde33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde33('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xde33('0x4'))(_0xde33('0x5'));var config=require('../../config/environment');var jayson=require(_0xde33('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4585cb,_0x36941d,_0x3336fd){return new BPromise(function(_0x5c540a,_0xb1ea26){return client[_0xde33('0x7')](_0x4585cb,_0x3336fd)[_0xde33('0x8')](function(_0x359c49){logger[_0xde33('0x9')](_0xde33('0xa'),_0x36941d,_0xde33('0xb'));logger[_0xde33('0xc')](_0xde33('0xd'),_0x36941d,_0xde33('0xb'),JSON[_0xde33('0xe')](_0x359c49));if(_0x359c49[_0xde33('0xf')]){if(_0x359c49['error'][_0xde33('0x10')]===0x1f4){logger[_0xde33('0xf')]('Cdr,\x20%s,\x20%s',_0x36941d,_0x359c49['error'][_0xde33('0x11')]);return _0xb1ea26(_0x359c49['error'][_0xde33('0x11')]);}logger['error'](_0xde33('0xa'),_0x36941d,_0x359c49[_0xde33('0xf')][_0xde33('0x11')]);return _0x5c540a(_0x359c49['error'][_0xde33('0x11')]);}else{logger[_0xde33('0x9')](_0xde33('0xa'),_0x36941d,'request\x20sent');_0x5c540a(_0x359c49['result'][_0xde33('0x11')]);}})[_0xde33('0x12')](function(_0x3aa334){logger['error']('Cdr,\x20%s,\x20%s',_0x36941d,_0x3aa334);_0xb1ea26(_0x3aa334);});});} \ No newline at end of file +var _0x0dce=['request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc75912,_0x2bbbe){var _0x17fbe2=function(_0x37607d){while(--_0x37607d){_0xc75912['push'](_0xc75912['shift']());}};_0x17fbe2(++_0x2bbbe);}(_0x0dce,0x154));var _0xe0dc=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0dce[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xe0dc('0x0'));var util=require(_0xe0dc('0x1'));var moment=require(_0xe0dc('0x2'));var BPromise=require(_0xe0dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0dc('0x4'))['db'];var utils=require(_0xe0dc('0x5'));var logger=require(_0xe0dc('0x6'))(_0xe0dc('0x7'));var config=require(_0xe0dc('0x8'));var jayson=require(_0xe0dc('0x9'));var client=jayson[_0xe0dc('0xa')][_0xe0dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43857a,_0x50884e,_0x147b56){return new BPromise(function(_0xb7d8fb,_0x887aeb){return client['request'](_0x43857a,_0x147b56)['then'](function(_0x5ba68a){logger['info']('Cdr,\x20%s,\x20%s',_0x50884e,_0xe0dc('0xc'));logger['debug'](_0xe0dc('0xd'),_0x50884e,_0xe0dc('0xc'),JSON[_0xe0dc('0xe')](_0x5ba68a));if(_0x5ba68a[_0xe0dc('0xf')]){if(_0x5ba68a[_0xe0dc('0xf')][_0xe0dc('0x10')]===0x1f4){logger[_0xe0dc('0xf')](_0xe0dc('0x11'),_0x50884e,_0x5ba68a['error']['message']);return _0x887aeb(_0x5ba68a[_0xe0dc('0xf')][_0xe0dc('0x12')]);}logger[_0xe0dc('0xf')]('Cdr,\x20%s,\x20%s',_0x50884e,_0x5ba68a[_0xe0dc('0xf')]['message']);return _0xb7d8fb(_0x5ba68a['error']['message']);}else{logger[_0xe0dc('0x13')]('Cdr,\x20%s,\x20%s',_0x50884e,_0xe0dc('0xc'));_0xb7d8fb(_0x5ba68a[_0xe0dc('0x14')][_0xe0dc('0x12')]);}})[_0xe0dc('0x15')](function(_0x6da21a){logger[_0xe0dc('0xf')](_0xe0dc('0x11'),_0x50884e,_0x6da21a);_0x887aeb(_0x6da21a);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index bd71176..be427c2 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(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x212403,_0x285a0e){var _0xf76354=function(_0x31963e){while(--_0x31963e){_0x212403['push'](_0x212403['shift']());}};_0xf76354(++_0x285a0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xb10b[_0x151721];return _0x2deaa7;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 0956faf..efcd493 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 _0x6faa=['noop','TEXT','STRING','exports','INTEGER'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x6faa,0x8a));var _0xa6fa=function(_0x2dfb72,_0x31dc47){_0x2dfb72=_0x2dfb72-0x0;var _0x13a4b7=_0x6faa[_0x2dfb72];return _0x13a4b7;};'use strict';var Sequelize=require('sequelize');module[_0xa6fa('0x0')]={'priority':{'type':Sequelize[_0xa6fa('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa6fa('0x2')},'appdata':{'type':Sequelize[_0xa6fa('0x3')]()},'description':{'type':Sequelize[_0xa6fa('0x4')]},'interval':{'type':Sequelize[_0xa6fa('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x786f=['sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x299634,_0x5b67c4){var _0x4e0220=function(_0x23938a){while(--_0x23938a){_0x299634['push'](_0x299634['shift']());}};_0x4e0220(++_0x5b67c4);}(_0x786f,0x87));var _0xf786=function(_0x2cd8d0,_0x5ddefb){_0x2cd8d0=_0x2cd8d0-0x0;var _0x49a221=_0x786f[_0x2cd8d0];return _0x49a221;};'use strict';var Sequelize=require(_0xf786('0x0'));module[_0xf786('0x1')]={'priority':{'type':Sequelize[_0xf786('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf786('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf786('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c3f9118..8819b63 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 _0x5706=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x5706,0xb0));var _0x6570=function(_0x180c8f,_0x3915a2){_0x180c8f=_0x180c8f-0x0;var _0x6524ed=_0x5706[_0x180c8f];return _0x6524ed;};'use strict';var emlformat=require(_0x6570('0x0'));var rimraf=require(_0x6570('0x1'));var zipdir=require(_0x6570('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6570('0x3'));var moment=require('moment');var BPromise=require(_0x6570('0x4'));var Mustache=require(_0x6570('0x5'));var util=require(_0x6570('0x6'));var path=require(_0x6570('0x7'));var sox=require(_0x6570('0x8'));var csv=require(_0x6570('0x9'));var ejs=require(_0x6570('0xa'));var fs=require('fs');var fs_extra=require(_0x6570('0xb'));var _=require(_0x6570('0xc'));var squel=require(_0x6570('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6570('0xe'));var toCsv=require(_0x6570('0x9'));var querystring=require(_0x6570('0xf'));var Papa=require(_0x6570('0x10'));var Redis=require(_0x6570('0x11'));var authService=require(_0x6570('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6570('0x13'))(_0x6570('0x14'));var utils=require(_0x6570('0x15'));var config=require(_0x6570('0x16'));var licenseUtil=require(_0x6570('0x17'));var db=require(_0x6570('0x18'))['db'];function respondWithStatusCode(_0xc903eb,_0x3098d5){_0x3098d5=_0x3098d5||0xcc;return function(_0x90499d){if(_0x90499d){return _0xc903eb['sendStatus'](_0x3098d5);}return _0xc903eb[_0x6570('0x19')](_0x3098d5)[_0x6570('0x1a')]();};}function respondWithResult(_0x311474,_0x2ee764){_0x2ee764=_0x2ee764||0xc8;return function(_0x27c69b){if(_0x27c69b){return _0x311474[_0x6570('0x19')](_0x2ee764)[_0x6570('0x1b')](_0x27c69b);}};}function respondWithFilteredResult(_0x13d62c,_0x411e04){return function(_0x45c48c){if(_0x45c48c){var _0x1861c4=typeof _0x411e04[_0x6570('0x1c')]==='undefined'&&typeof _0x411e04[_0x6570('0x1d')]==='undefined';var _0x183e4e=_0x45c48c[_0x6570('0x1e')];var _0x40079d=_0x1861c4?0x0:_0x411e04[_0x6570('0x1c')];var _0x3c8c29=_0x1861c4?_0x45c48c[_0x6570('0x1e')]:_0x411e04[_0x6570('0x1c')]+_0x411e04[_0x6570('0x1d')];var _0x425ca0;if(_0x3c8c29>=_0x183e4e){_0x3c8c29=_0x183e4e;_0x425ca0=0xc8;}else{_0x425ca0=0xce;}_0x13d62c['status'](_0x425ca0);return _0x13d62c[_0x6570('0x1f')](_0x6570('0x20'),_0x40079d+'-'+_0x3c8c29+'/'+_0x183e4e)[_0x6570('0x1b')](_0x45c48c);}return null;};}function patchUpdates(_0x425a83){return function(_0x4f032c){try{jsonpatch[_0x6570('0x21')](_0x4f032c,_0x425a83,!![]);}catch(_0x3e0c08){return BPromise[_0x6570('0x22')](_0x3e0c08);}return _0x4f032c[_0x6570('0x23')]();};}function saveUpdates(_0x59c604,_0x58f5be){return function(_0x5c30ef){if(_0x5c30ef){return _0x5c30ef[_0x6570('0x24')](_0x59c604)['then'](function(_0x461641){return _0x461641;});}return null;};}function removeEntity(_0x4234ea,_0x2d4ba9){return function(_0x5c49df){if(_0x5c49df){return _0x5c49df['destroy']()[_0x6570('0x25')](function(){_0x4234ea['status'](0xcc)[_0x6570('0x1a')]();});}};}function handleEntityNotFound(_0x5743b6,_0x133c10){return function(_0x19dff7){if(!_0x19dff7){_0x5743b6['sendStatus'](0x194);}return _0x19dff7;};}function handleError(_0x4980a2,_0x210724){_0x210724=_0x210724||0x1f4;return function(_0x28fced){logger['error'](_0x28fced[_0x6570('0x26')]);if(_0x28fced[_0x6570('0x27')]){delete _0x28fced[_0x6570('0x27')];}_0x4980a2[_0x6570('0x19')](_0x210724)[_0x6570('0x28')](_0x28fced);};}exports[_0x6570('0x29')]=function(_0x137360,_0xf1dacb){var _0x297f24={'raw':!![],'where':{'id':_0x137360[_0x6570('0x2a')]['id']}},_0x5df80d={};_0x5df80d[_0x6570('0x2b')]=_[_0x6570('0x2c')](db[_0x6570('0x2d')][_0x6570('0x2e')]);_0x5df80d[_0x6570('0x2f')]=_[_0x6570('0x2c')](_0x137360['query']);_0x5df80d[_0x6570('0x30')]=_[_0x6570('0x31')](_0x5df80d[_0x6570('0x2b')],_0x5df80d['query']);_0x297f24['attributes']=_['intersection'](_0x5df80d[_0x6570('0x2b')],qs[_0x6570('0x32')](_0x137360[_0x6570('0x2f')][_0x6570('0x32')]));_0x297f24[_0x6570('0x33')]=_0x297f24[_0x6570('0x33')][_0x6570('0x34')]?_0x297f24[_0x6570('0x33')]:_0x5df80d[_0x6570('0x2b')];if(_0x137360[_0x6570('0x2f')][_0x6570('0x35')]){_0x297f24[_0x6570('0x36')]=[{'all':!![]}];}_0x297f24=_['merge']({},_0x297f24,_0x137360[_0x6570('0x37')]);return db[_0x6570('0x2d')][_0x6570('0x38')](_0x297f24)[_0x6570('0x25')](handleEntityNotFound(_0xf1dacb,null))[_0x6570('0x25')](respondWithResult(_0xf1dacb,null))['catch'](handleError(_0xf1dacb,null));};exports['update']=function(_0x1566c3,_0x4b178a){if(_0x1566c3['body']['id']){delete _0x1566c3[_0x6570('0x39')]['id'];}return db[_0x6570('0x2d')][_0x6570('0x38')]({'where':{'id':_0x1566c3[_0x6570('0x2a')]['id']}})[_0x6570('0x25')](handleEntityNotFound(_0x4b178a,null))[_0x6570('0x25')](saveUpdates(_0x1566c3[_0x6570('0x39')],null))[_0x6570('0x25')](respondWithResult(_0x4b178a,null))[_0x6570('0x3a')](handleError(_0x4b178a,null));};exports[_0x6570('0x3b')]=function(_0x25a2fe,_0x4076a0){return db[_0x6570('0x2d')][_0x6570('0x38')]({'where':{'id':_0x25a2fe[_0x6570('0x2a')]['id']}})[_0x6570('0x25')](handleEntityNotFound(_0x4076a0,null))[_0x6570('0x25')](removeEntity(_0x4076a0,null))['catch'](handleError(_0x4076a0,null));}; \ No newline at end of file +var _0x8868=['offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','keys','ChatApplication','rawAttributes','query','filters','model','attributes','fields','length','includeAll','include','options','find','catch','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x8868,0x1ca));var _0x8886=function(_0x3292ce,_0x3eb57b){_0x3292ce=_0x3292ce-0x0;var _0x4f4c2c=_0x8868[_0x3292ce];return _0x4f4c2c;};'use strict';var emlformat=require(_0x8886('0x0'));var rimraf=require(_0x8886('0x1'));var zipdir=require(_0x8886('0x2'));var jsonpatch=require(_0x8886('0x3'));var rp=require(_0x8886('0x4'));var moment=require(_0x8886('0x5'));var BPromise=require(_0x8886('0x6'));var Mustache=require(_0x8886('0x7'));var util=require(_0x8886('0x8'));var path=require(_0x8886('0x9'));var sox=require(_0x8886('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8886('0xb'));var _=require(_0x8886('0xc'));var squel=require('squel');var crypto=require(_0x8886('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8886('0xe'));var toCsv=require(_0x8886('0xf'));var querystring=require(_0x8886('0x10'));var Papa=require(_0x8886('0x11'));var Redis=require(_0x8886('0x12'));var authService=require(_0x8886('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8886('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8886('0x15'));var utils=require('../../config/utils');var config=require(_0x8886('0x16'));var licenseUtil=require(_0x8886('0x17'));var db=require(_0x8886('0x18'))['db'];function respondWithStatusCode(_0x2a154d,_0x54cbc9){_0x54cbc9=_0x54cbc9||0xcc;return function(_0x29fa59){if(_0x29fa59){return _0x2a154d[_0x8886('0x19')](_0x54cbc9);}return _0x2a154d['status'](_0x54cbc9)[_0x8886('0x1a')]();};}function respondWithResult(_0x5ef48a,_0x4a339){_0x4a339=_0x4a339||0xc8;return function(_0x1110fd){if(_0x1110fd){return _0x5ef48a[_0x8886('0x1b')](_0x4a339)[_0x8886('0x1c')](_0x1110fd);}};}function respondWithFilteredResult(_0x57e00c,_0x5b6f4b){return function(_0x31dad3){if(_0x31dad3){var _0x11905e=typeof _0x5b6f4b['offset']==='undefined'&&typeof _0x5b6f4b['limit']==='undefined';var _0x438f1a=_0x31dad3[_0x8886('0x1d')];var _0x1d47a6=_0x11905e?0x0:_0x5b6f4b[_0x8886('0x1e')];var _0xb13c62=_0x11905e?_0x31dad3[_0x8886('0x1d')]:_0x5b6f4b[_0x8886('0x1e')]+_0x5b6f4b[_0x8886('0x1f')];var _0xbf4367;if(_0xb13c62>=_0x438f1a){_0xb13c62=_0x438f1a;_0xbf4367=0xc8;}else{_0xbf4367=0xce;}_0x57e00c[_0x8886('0x1b')](_0xbf4367);return _0x57e00c[_0x8886('0x20')](_0x8886('0x21'),_0x1d47a6+'-'+_0xb13c62+'/'+_0x438f1a)[_0x8886('0x1c')](_0x31dad3);}return null;};}function patchUpdates(_0x19f0ef){return function(_0x5103f9){try{jsonpatch[_0x8886('0x22')](_0x5103f9,_0x19f0ef,!![]);}catch(_0x595f45){return BPromise[_0x8886('0x23')](_0x595f45);}return _0x5103f9[_0x8886('0x24')]();};}function saveUpdates(_0x48ec2e,_0x3894a0){return function(_0x17163e){if(_0x17163e){return _0x17163e[_0x8886('0x25')](_0x48ec2e)[_0x8886('0x26')](function(_0x19a78f){return _0x19a78f;});}return null;};}function removeEntity(_0x1c4485,_0x4d8d5e){return function(_0x3df299){if(_0x3df299){return _0x3df299['destroy']()[_0x8886('0x26')](function(){_0x1c4485[_0x8886('0x1b')](0xcc)[_0x8886('0x1a')]();});}};}function handleEntityNotFound(_0x48280f,_0x31e239){return function(_0x5b966b){if(!_0x5b966b){_0x48280f[_0x8886('0x19')](0x194);}return _0x5b966b;};}function handleError(_0x127fc9,_0x27ba7d){_0x27ba7d=_0x27ba7d||0x1f4;return function(_0x337007){logger[_0x8886('0x27')](_0x337007[_0x8886('0x28')]);if(_0x337007[_0x8886('0x29')]){delete _0x337007['name'];}_0x127fc9['status'](_0x27ba7d)[_0x8886('0x2a')](_0x337007);};}exports[_0x8886('0x2b')]=function(_0x4a37ca,_0xc02082){var _0x45b714={'raw':!![],'where':{'id':_0x4a37ca['params']['id']}},_0x15cc33={};_0x15cc33['model']=_[_0x8886('0x2c')](db[_0x8886('0x2d')][_0x8886('0x2e')]);_0x15cc33[_0x8886('0x2f')]=_[_0x8886('0x2c')](_0x4a37ca[_0x8886('0x2f')]);_0x15cc33[_0x8886('0x30')]=_['intersection'](_0x15cc33[_0x8886('0x31')],_0x15cc33[_0x8886('0x2f')]);_0x45b714[_0x8886('0x32')]=_['intersection'](_0x15cc33[_0x8886('0x31')],qs['fields'](_0x4a37ca[_0x8886('0x2f')][_0x8886('0x33')]));_0x45b714['attributes']=_0x45b714[_0x8886('0x32')][_0x8886('0x34')]?_0x45b714[_0x8886('0x32')]:_0x15cc33[_0x8886('0x31')];if(_0x4a37ca[_0x8886('0x2f')][_0x8886('0x35')]){_0x45b714[_0x8886('0x36')]=[{'all':!![]}];}_0x45b714=_['merge']({},_0x45b714,_0x4a37ca[_0x8886('0x37')]);return db[_0x8886('0x2d')][_0x8886('0x38')](_0x45b714)[_0x8886('0x26')](handleEntityNotFound(_0xc02082,null))[_0x8886('0x26')](respondWithResult(_0xc02082,null))[_0x8886('0x39')](handleError(_0xc02082,null));};exports['update']=function(_0x3bd743,_0x4298e8){if(_0x3bd743[_0x8886('0x3a')]['id']){delete _0x3bd743[_0x8886('0x3a')]['id'];}return db[_0x8886('0x2d')]['find']({'where':{'id':_0x3bd743[_0x8886('0x3b')]['id']}})[_0x8886('0x26')](handleEntityNotFound(_0x4298e8,null))[_0x8886('0x26')](saveUpdates(_0x3bd743[_0x8886('0x3a')],null))[_0x8886('0x26')](respondWithResult(_0x4298e8,null))[_0x8886('0x39')](handleError(_0x4298e8,null));};exports[_0x8886('0x3c')]=function(_0x487f30,_0x2f9531){return db[_0x8886('0x2d')]['find']({'where':{'id':_0x487f30['params']['id']}})[_0x8886('0x26')](handleEntityNotFound(_0x2f9531,null))[_0x8886('0x26')](removeEntity(_0x2f9531,null))['catch'](handleError(_0x2f9531,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index bca3b9b..34a14fc 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 _0x6166=['moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','../../config/logger'];(function(_0x454e00,_0x30ecef){var _0x16edfd=function(_0x53b788){while(--_0x53b788){_0x454e00['push'](_0x454e00['shift']());}};_0x16edfd(++_0x30ecef);}(_0x6166,0x1af));var _0x6616=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x6166[_0x231e16];return _0x570a7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6616('0x0'))('api');var moment=require(_0x6616('0x1'));var BPromise=require('bluebird');var rp=require(_0x6616('0x2'));var fs=require('fs');var path=require(_0x6616('0x3'));var rimraf=require(_0x6616('0x4'));var config=require(_0x6616('0x5'));var attributes=require(_0x6616('0x6'));module[_0x6616('0x7')]=function(_0x3418f4,_0x36cfb9){return _0x3418f4[_0x6616('0x8')](_0x6616('0x9'),attributes,{'tableName':_0x6616('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6616('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4112=['exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes'];(function(_0x3c600d,_0x4b5c85){var _0xd195e3=function(_0x2a2f5f){while(--_0x2a2f5f){_0x3c600d['push'](_0x3c600d['shift']());}};_0xd195e3(++_0x4b5c85);}(_0x4112,0x12b));var _0x2411=function(_0x122df5,_0x29caeb){_0x122df5=_0x122df5-0x0;var _0x4f5339=_0x4112[_0x122df5];return _0x4f5339;};'use strict';var _=require(_0x2411('0x0'));var util=require(_0x2411('0x1'));var logger=require(_0x2411('0x2'))(_0x2411('0x3'));var moment=require(_0x2411('0x4'));var BPromise=require(_0x2411('0x5'));var rp=require(_0x2411('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2411('0x7'));var config=require('../../config/environment');var attributes=require(_0x2411('0x8'));module[_0x2411('0x9')]=function(_0x418ac7,_0x40d44a){return _0x418ac7[_0x2411('0xa')]('ChatApplication',attributes,{'tableName':_0x2411('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2411('0xc'),'collate':_0x2411('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a7c1876..86d6f12 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 _0x92c2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','../../mysqldb'];(function(_0x1e0f48,_0x50829e){var _0x5dd59e=function(_0x177782){while(--_0x177782){_0x1e0f48['push'](_0x1e0f48['shift']());}};_0x5dd59e(++_0x50829e);}(_0x92c2,0x88));var _0x292c=function(_0x1065cc,_0x22cc35){_0x1065cc=_0x1065cc-0x0;var _0x4746f5=_0x92c2[_0x1065cc];return _0x4746f5;};'use strict';var _=require(_0x292c('0x0'));var util=require('util');var moment=require(_0x292c('0x1'));var BPromise=require(_0x292c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x292c('0x3'))['db'];var utils=require(_0x292c('0x4'));var logger=require(_0x292c('0x5'))(_0x292c('0x6'));var config=require(_0x292c('0x7'));var jayson=require(_0x292c('0x8'));var client=jayson[_0x292c('0x9')][_0x292c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58af00,_0x3415eb,_0x2458eb){return new BPromise(function(_0x11f1fd,_0x3959c0){return client[_0x292c('0xb')](_0x58af00,_0x2458eb)['then'](function(_0x4b9b6f){logger[_0x292c('0xc')](_0x292c('0xd'),_0x3415eb,_0x292c('0xe'));logger['debug'](_0x292c('0xf'),_0x3415eb,_0x292c('0xe'),JSON['stringify'](_0x4b9b6f));if(_0x4b9b6f[_0x292c('0x10')]){if(_0x4b9b6f[_0x292c('0x10')][_0x292c('0x11')]===0x1f4){logger[_0x292c('0x10')](_0x292c('0xd'),_0x3415eb,_0x4b9b6f['error'][_0x292c('0x12')]);return _0x3959c0(_0x4b9b6f['error'][_0x292c('0x12')]);}logger[_0x292c('0x10')](_0x292c('0xd'),_0x3415eb,_0x4b9b6f['error'][_0x292c('0x12')]);return _0x11f1fd(_0x4b9b6f['error']['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x3415eb,_0x292c('0xe'));_0x11f1fd(_0x4b9b6f[_0x292c('0x13')][_0x292c('0x12')]);}})['catch'](function(_0x4ecd26){logger['error'](_0x292c('0xd'),_0x3415eb,_0x4ecd26);_0x3959c0(_0x4ecd26);});});} \ No newline at end of file +var _0x86b2=['code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0x86b2,0x1c7));var _0x286b=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x86b2[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x286b('0x0'));var util=require(_0x286b('0x1'));var moment=require('moment');var BPromise=require(_0x286b('0x2'));var rs=require(_0x286b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x286b('0x4'))['db'];var utils=require(_0x286b('0x5'));var logger=require(_0x286b('0x6'))(_0x286b('0x7'));var config=require(_0x286b('0x8'));var jayson=require(_0x286b('0x9'));var client=jayson[_0x286b('0xa')][_0x286b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc60ad4,_0x43b84d,_0x233a96){return new BPromise(function(_0x348df6,_0x35eeb5){return client[_0x286b('0xc')](_0xc60ad4,_0x233a96)[_0x286b('0xd')](function(_0x42288f){logger[_0x286b('0xe')]('ChatApplication,\x20%s,\x20%s',_0x43b84d,'request\x20sent');logger[_0x286b('0xf')](_0x286b('0x10'),_0x43b84d,_0x286b('0x11'),JSON[_0x286b('0x12')](_0x42288f));if(_0x42288f['error']){if(_0x42288f[_0x286b('0x13')][_0x286b('0x14')]===0x1f4){logger[_0x286b('0x13')](_0x286b('0x15'),_0x43b84d,_0x42288f[_0x286b('0x13')][_0x286b('0x16')]);return _0x35eeb5(_0x42288f[_0x286b('0x13')]['message']);}logger[_0x286b('0x13')](_0x286b('0x15'),_0x43b84d,_0x42288f[_0x286b('0x13')][_0x286b('0x16')]);return _0x348df6(_0x42288f[_0x286b('0x13')]['message']);}else{logger['info'](_0x286b('0x15'),_0x43b84d,_0x286b('0x11'));_0x348df6(_0x42288f[_0x286b('0x17')][_0x286b('0x16')]);}})[_0x286b('0x18')](function(_0x495f19){logger[_0x286b('0x13')](_0x286b('0x15'),_0x43b84d,_0x495f19);_0x35eeb5(_0x495f19);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 1dc426a..39dde84 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 _0xea04=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','util'];(function(_0x4595ea,_0x8c2feb){var _0x4daad5=function(_0x504f02){while(--_0x504f02){_0x4595ea['push'](_0x4595ea['shift']());}};_0x4daad5(++_0x8c2feb);}(_0xea04,0x185));var _0x4ea0=function(_0x11c4b6,_0x572fdb){_0x11c4b6=_0x11c4b6-0x0;var _0x2cb405=_0xea04[_0x11c4b6];return _0x2cb405;};'use strict';var multer=require('multer');var util=require(_0x4ea0('0x0'));var path=require(_0x4ea0('0x1'));var timeout=require(_0x4ea0('0x2'));var express=require(_0x4ea0('0x3'));var router=express[_0x4ea0('0x4')]();var fs_extra=require(_0x4ea0('0x5'));var auth=require(_0x4ea0('0x6'));var interaction=require(_0x4ea0('0x7'));var config=require('../../config/environment');var controller=require(_0x4ea0('0x8'));router[_0x4ea0('0x9')](_0x4ea0('0xa'),auth[_0x4ea0('0xb')](),controller[_0x4ea0('0xc')]);router[_0x4ea0('0xd')](_0x4ea0('0xa'),auth[_0x4ea0('0xb')](),controller['update']);router[_0x4ea0('0xe')](_0x4ea0('0xa'),auth[_0x4ea0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb552=['show','put','isAuthenticated','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0xb552,0x8e));var _0x2b55=function(_0x4c8a02,_0x35a179){_0x4c8a02=_0x4c8a02-0x0;var _0x259314=_0xb552[_0x4c8a02];return _0x259314;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b55('0x0'));var timeout=require(_0x2b55('0x1'));var express=require(_0x2b55('0x2'));var router=express[_0x2b55('0x3')]();var fs_extra=require(_0x2b55('0x4'));var auth=require(_0x2b55('0x5'));var interaction=require(_0x2b55('0x6'));var config=require(_0x2b55('0x7'));var controller=require(_0x2b55('0x8'));router[_0x2b55('0x9')](_0x2b55('0xa'),auth['isAuthenticated'](),controller[_0x2b55('0xb')]);router[_0x2b55('0xc')](_0x2b55('0xa'),auth[_0x2b55('0xd')](),controller['update']);router[_0x2b55('0xe')](_0x2b55('0xa'),auth['isAuthenticated'](),controller[_0x2b55('0xf')]);module[_0x2b55('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 410d5a8..eb31419 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 _0x25d4=['sequelize','exports','STRING'];(function(_0x5224f6,_0x1611ad){var _0x40a8a2=function(_0x5521f8){while(--_0x5521f8){_0x5224f6['push'](_0x5224f6['shift']());}};_0x40a8a2(++_0x1611ad);}(_0x25d4,0xb1));var _0x425d=function(_0x4123b6,_0x50353c){_0x4123b6=_0x4123b6-0x0;var _0x2fb59d=_0x25d4[_0x4123b6];return _0x2fb59d;};'use strict';var Sequelize=require(_0x425d('0x0'));module[_0x425d('0x1')]={'name':{'type':Sequelize[_0x425d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x425d('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x8303=['STRING','BOOLEAN','sequelize'];(function(_0x2e6f86,_0x436c8b){var _0x5adcef=function(_0x39f035){while(--_0x39f035){_0x2e6f86['push'](_0x2e6f86['shift']());}};_0x5adcef(++_0x436c8b);}(_0x8303,0xaa));var _0x3830=function(_0xdb7ee3,_0x2274e9){_0xdb7ee3=_0xdb7ee3-0x0;var _0x42419f=_0x8303[_0xdb7ee3];return _0x42419f;};'use strict';var Sequelize=require(_0x3830('0x0'));module['exports']={'name':{'type':Sequelize[_0x3830('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3830('0x1')]},'write':{'type':Sequelize[_0x3830('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 6a004d4..96ed294 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 _0xa6c1=['toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','ChatGroupId','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','describe','ChatInternalMessage'];(function(_0x353171,_0x56d557){var _0x4a36ee=function(_0x58b837){while(--_0x58b837){_0x353171['push'](_0x353171['shift']());}};_0x4a36ee(++_0x56d557);}(_0xa6c1,0x6b));var _0x1a6c=function(_0x24a88e,_0x22a0b8){_0x24a88e=_0x24a88e-0x0;var _0x232cbb=_0xa6c1[_0x24a88e];return _0x232cbb;};'use strict';var emlformat=require(_0x1a6c('0x0'));var rimraf=require(_0x1a6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a6c('0x2'));var rp=require(_0x1a6c('0x3'));var moment=require(_0x1a6c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a6c('0x5'));var util=require(_0x1a6c('0x6'));var path=require(_0x1a6c('0x7'));var sox=require(_0x1a6c('0x8'));var csv=require('to-csv');var ejs=require(_0x1a6c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a6c('0xa'));var squel=require(_0x1a6c('0xb'));var crypto=require(_0x1a6c('0xc'));var jsforce=require(_0x1a6c('0xd'));var deskjs=require(_0x1a6c('0xe'));var toCsv=require(_0x1a6c('0xf'));var querystring=require(_0x1a6c('0x10'));var Papa=require(_0x1a6c('0x11'));var Redis=require(_0x1a6c('0x12'));var authService=require(_0x1a6c('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a6c('0x14'));var logger=require(_0x1a6c('0x15'))('api');var utils=require(_0x1a6c('0x16'));var config=require(_0x1a6c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x1a6c('0x18')](config[_0x1a6c('0x19')],{'host':_0x1a6c('0x1a'),'port':0x18eb});var socket=require(_0x1a6c('0x1b'))(new Redis(config[_0x1a6c('0x19')]));require(_0x1a6c('0x1c'))[_0x1a6c('0x1d')](socket);function respondWithStatusCode(_0x385828,_0x47d030){_0x47d030=_0x47d030||0xcc;return function(_0x4a8bd8){if(_0x4a8bd8){return _0x385828[_0x1a6c('0x1e')](_0x47d030);}return _0x385828[_0x1a6c('0x1f')](_0x47d030)[_0x1a6c('0x20')]();};}function respondWithResult(_0x509454,_0xbfbd17){_0xbfbd17=_0xbfbd17||0xc8;return function(_0x312496){if(_0x312496){return _0x509454[_0x1a6c('0x1f')](_0xbfbd17)[_0x1a6c('0x21')](_0x312496);}};}function respondWithFilteredResult(_0x48c11a,_0x26d80a){return function(_0xee038){if(_0xee038){var _0x4e94ea=typeof _0x26d80a[_0x1a6c('0x22')]===_0x1a6c('0x23')&&typeof _0x26d80a[_0x1a6c('0x24')]===_0x1a6c('0x23');var _0x5dac19=_0xee038[_0x1a6c('0x25')];var _0x2f753f=_0x4e94ea?0x0:_0x26d80a[_0x1a6c('0x22')];var _0x2df482=_0x4e94ea?_0xee038['count']:_0x26d80a[_0x1a6c('0x22')]+_0x26d80a[_0x1a6c('0x24')];var _0x4335ce;if(_0x2df482>=_0x5dac19){_0x2df482=_0x5dac19;_0x4335ce=0xc8;}else{_0x4335ce=0xce;}_0x48c11a[_0x1a6c('0x1f')](_0x4335ce);return _0x48c11a[_0x1a6c('0x26')]('Content-Range',_0x2f753f+'-'+_0x2df482+'/'+_0x5dac19)[_0x1a6c('0x21')](_0xee038);}return null;};}function patchUpdates(_0x1deb8f){return function(_0x12d166){try{jsonpatch[_0x1a6c('0x27')](_0x12d166,_0x1deb8f,!![]);}catch(_0x330efd){return BPromise['reject'](_0x330efd);}return _0x12d166[_0x1a6c('0x28')]();};}function saveUpdates(_0x355664,_0x44ecf1){return function(_0x43476a){if(_0x43476a){return _0x43476a[_0x1a6c('0x29')](_0x355664)[_0x1a6c('0x2a')](function(_0xe81ba8){return _0xe81ba8;});}return null;};}function removeEntity(_0x1e24fc,_0x609d98){return function(_0x1f32bb){if(_0x1f32bb){return _0x1f32bb[_0x1a6c('0x2b')]()[_0x1a6c('0x2a')](function(){_0x1e24fc[_0x1a6c('0x1f')](0xcc)[_0x1a6c('0x20')]();});}};}function handleEntityNotFound(_0x397eda,_0x1f59a1){return function(_0x29d1a1){if(!_0x29d1a1){_0x397eda[_0x1a6c('0x1e')](0x194);}return _0x29d1a1;};}function handleError(_0x4d33a5,_0x2c5fab){_0x2c5fab=_0x2c5fab||0x1f4;return function(_0x2d41a0){logger[_0x1a6c('0x2c')](_0x2d41a0['stack']);if(_0x2d41a0[_0x1a6c('0x2d')]){delete _0x2d41a0[_0x1a6c('0x2d')];}_0x4d33a5[_0x1a6c('0x1f')](_0x2c5fab)[_0x1a6c('0x2e')](_0x2d41a0);};}exports['index']=function(_0x892af5,_0x4a0086){var _0x181035={},_0x43c3f8={},_0x322872={'count':0x0,'rows':[]};var _0x5525f3=_[_0x1a6c('0x2f')](db[_0x1a6c('0x30')][_0x1a6c('0x31')],function(_0x257a8f){return{'name':_0x257a8f[_0x1a6c('0x32')],'type':_0x257a8f[_0x1a6c('0x33')][_0x1a6c('0x34')]};});_0x43c3f8[_0x1a6c('0x35')]=_['map'](_0x5525f3,'name');_0x43c3f8[_0x1a6c('0x36')]=_['keys'](_0x892af5[_0x1a6c('0x36')]);_0x43c3f8[_0x1a6c('0x37')]=_[_0x1a6c('0x38')](_0x43c3f8[_0x1a6c('0x35')],_0x43c3f8[_0x1a6c('0x36')]);_0x181035[_0x1a6c('0x39')]=_[_0x1a6c('0x38')](_0x43c3f8[_0x1a6c('0x35')],qs[_0x1a6c('0x3a')](_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x3a')]));_0x181035[_0x1a6c('0x39')]=_0x181035[_0x1a6c('0x39')][_0x1a6c('0x3b')]?_0x181035['attributes']:_0x43c3f8[_0x1a6c('0x35')];if(!_0x892af5[_0x1a6c('0x36')]['hasOwnProperty'](_0x1a6c('0x3c'))){_0x181035['limit']=qs[_0x1a6c('0x24')](_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x24')]);_0x181035['offset']=qs[_0x1a6c('0x22')](_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x22')]);}_0x181035[_0x1a6c('0x3d')]=qs[_0x1a6c('0x3e')](_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x3e')]);_0x181035[_0x1a6c('0x3f')]=qs['filters'](_['pick'](_0x892af5[_0x1a6c('0x36')],_0x43c3f8[_0x1a6c('0x37')]),_0x5525f3);if(_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x40')]){_0x181035[_0x1a6c('0x3f')]=_[_0x1a6c('0x41')](_0x181035[_0x1a6c('0x3f')],{'$or':_[_0x1a6c('0x2f')](_0x5525f3,function(_0x4acccf){if(_0x4acccf['type']!==_0x1a6c('0x42')){var _0x5425ca={};_0x5425ca[_0x4acccf[_0x1a6c('0x2d')]]={'$like':'%'+_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x40')]+'%'};return _0x5425ca;}})});}_0x181035=_['merge']({},_0x181035,_0x892af5[_0x1a6c('0x43')]);var _0x236035={'where':_0x181035[_0x1a6c('0x3f')]};return db['ChatGroup'][_0x1a6c('0x25')](_0x236035)[_0x1a6c('0x2a')](function(_0xc23a4e){_0x322872[_0x1a6c('0x25')]=_0xc23a4e;if(_0x892af5[_0x1a6c('0x36')][_0x1a6c('0x44')]){_0x181035[_0x1a6c('0x45')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x181035);})[_0x1a6c('0x2a')](function(_0x532942){_0x322872[_0x1a6c('0x46')]=_0x532942;return _0x322872;})[_0x1a6c('0x2a')](respondWithFilteredResult(_0x4a0086,_0x181035))[_0x1a6c('0x47')](handleError(_0x4a0086,null));};exports['show']=function(_0x38bc17,_0xffde1a){var _0xa08d94={'raw':!![],'where':{'id':_0x38bc17[_0x1a6c('0x48')]['id']}},_0x1171dd={};_0x1171dd[_0x1a6c('0x35')]=_[_0x1a6c('0x49')](db['ChatGroup'][_0x1a6c('0x31')]);_0x1171dd[_0x1a6c('0x36')]=_[_0x1a6c('0x49')](_0x38bc17['query']);_0x1171dd[_0x1a6c('0x37')]=_[_0x1a6c('0x38')](_0x1171dd[_0x1a6c('0x35')],_0x1171dd['query']);_0xa08d94['attributes']=_[_0x1a6c('0x38')](_0x1171dd[_0x1a6c('0x35')],qs['fields'](_0x38bc17[_0x1a6c('0x36')][_0x1a6c('0x3a')]));_0xa08d94[_0x1a6c('0x39')]=_0xa08d94[_0x1a6c('0x39')][_0x1a6c('0x3b')]?_0xa08d94[_0x1a6c('0x39')]:_0x1171dd[_0x1a6c('0x35')];if(_0x38bc17[_0x1a6c('0x36')][_0x1a6c('0x44')]){_0xa08d94['include']=[{'all':!![]}];}_0xa08d94=_[_0x1a6c('0x41')]({},_0xa08d94,_0x38bc17[_0x1a6c('0x43')]);return db['ChatGroup'][_0x1a6c('0x4a')](_0xa08d94)[_0x1a6c('0x2a')](handleEntityNotFound(_0xffde1a,null))[_0x1a6c('0x2a')](respondWithResult(_0xffde1a,null))[_0x1a6c('0x47')](handleError(_0xffde1a,null));};exports[_0x1a6c('0x4b')]=function(_0xb37fd1,_0x4c816e){return db[_0x1a6c('0x30')][_0x1a6c('0x4b')](_0xb37fd1[_0x1a6c('0x4c')],{})[_0x1a6c('0x2a')](respondWithResult(_0x4c816e,0xc9))['catch'](handleError(_0x4c816e,null));};exports['update']=function(_0x1b1b92,_0x6ca930){if(_0x1b1b92[_0x1a6c('0x4c')]['id']){delete _0x1b1b92[_0x1a6c('0x4c')]['id'];}return db[_0x1a6c('0x30')][_0x1a6c('0x4a')]({'where':{'id':_0x1b1b92[_0x1a6c('0x48')]['id']}})[_0x1a6c('0x2a')](handleEntityNotFound(_0x6ca930,null))[_0x1a6c('0x2a')](saveUpdates(_0x1b1b92[_0x1a6c('0x4c')],null))[_0x1a6c('0x2a')](respondWithResult(_0x6ca930,null))[_0x1a6c('0x47')](handleError(_0x6ca930,null));};exports['destroy']=function(_0x2ebd7c,_0x269702){return db[_0x1a6c('0x30')][_0x1a6c('0x4a')]({'where':{'id':_0x2ebd7c['params']['id']}})[_0x1a6c('0x2a')](handleEntityNotFound(_0x269702,null))['then'](removeEntity(_0x269702,null))[_0x1a6c('0x47')](handleError(_0x269702,null));};exports[_0x1a6c('0x4d')]=function(_0x591df9,_0x3d9d95){return db[_0x1a6c('0x30')][_0x1a6c('0x4d')]()['then'](respondWithResult(_0x3d9d95,null))[_0x1a6c('0x47')](handleError(_0x3d9d95,null));};exports['getUnread']=function(_0x577c28,_0x229fb4,_0x6a4863){return db[_0x1a6c('0x4e')][_0x1a6c('0x25')]({'where':{'ChatGroupId':_0x577c28[_0x1a6c('0x48')]['id'],'ToId':_0x577c28['user']['id'],'read':![]}})[_0x1a6c('0x2a')](function(_0x373d4b){return{'id':_[_0x1a6c('0x4f')](_0x577c28[_0x1a6c('0x48')]['id']),'count':_0x373d4b};})[_0x1a6c('0x2a')](respondWithResult(_0x229fb4,null))['catch'](handleError(_0x229fb4,null));};exports[_0x1a6c('0x50')]=function(_0x1ca724,_0x35d460,_0x1b0258){return db[_0x1a6c('0x30')][_0x1a6c('0x4a')]({'where':{'id':_0x1ca724[_0x1a6c('0x48')]['id']}})[_0x1a6c('0x2a')](handleEntityNotFound(_0x35d460,null))['then'](function(_0x21f806){if(_0x21f806){return _0x21f806['addMembers'](_0x1ca724['body'][_0x1a6c('0x51')],_[_0x1a6c('0x52')](_0x1ca724[_0x1a6c('0x4c')],[_0x1a6c('0x51'),'id'])||{});}})['then'](respondWithResult(_0x35d460,null))[_0x1a6c('0x47')](handleError(_0x35d460,null));};exports[_0x1a6c('0x53')]=function(_0x116318,_0x4efb91,_0x344a4b){var _0x928c21={};var _0x3b82f5={};var _0x3c88f0;var _0x5edadf;return db[_0x1a6c('0x30')][_0x1a6c('0x54')]({'where':{'id':_0x116318[_0x1a6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x4efb91,null))[_0x1a6c('0x2a')](function(_0x251076){if(_0x251076){_0x3c88f0=_0x251076;_0x3b82f5[_0x1a6c('0x35')]=_[_0x1a6c('0x49')](db[_0x1a6c('0x55')][_0x1a6c('0x31')]);_0x3b82f5[_0x1a6c('0x36')]=_[_0x1a6c('0x49')](_0x116318[_0x1a6c('0x36')]);_0x3b82f5[_0x1a6c('0x37')]=_[_0x1a6c('0x38')](_0x3b82f5[_0x1a6c('0x35')],_0x3b82f5[_0x1a6c('0x36')]);_0x928c21[_0x1a6c('0x39')]=_[_0x1a6c('0x38')](_0x3b82f5['model'],qs[_0x1a6c('0x3a')](_0x116318[_0x1a6c('0x36')][_0x1a6c('0x3a')]));_0x928c21[_0x1a6c('0x39')]=_0x928c21[_0x1a6c('0x39')][_0x1a6c('0x3b')]?_0x928c21[_0x1a6c('0x39')]:_0x3b82f5[_0x1a6c('0x35')];_0x928c21[_0x1a6c('0x3d')]=qs[_0x1a6c('0x3e')](_0x116318[_0x1a6c('0x36')][_0x1a6c('0x3e')]);_0x928c21[_0x1a6c('0x3f')]=qs[_0x1a6c('0x37')](_[_0x1a6c('0x56')](_0x116318['query'],_0x3b82f5[_0x1a6c('0x37')]));if(_0x116318[_0x1a6c('0x36')]['filter']){_0x928c21[_0x1a6c('0x3f')]=_[_0x1a6c('0x41')](_0x928c21[_0x1a6c('0x3f')],{'$or':_[_0x1a6c('0x2f')](_0x928c21[_0x1a6c('0x39')],function(_0x697889){var _0x1bb683={};_0x1bb683[_0x697889]={'$like':'%'+_0x116318[_0x1a6c('0x36')][_0x1a6c('0x40')]+'%'};return _0x1bb683;})});}_0x928c21=_[_0x1a6c('0x41')]({},_0x928c21,_0x116318[_0x1a6c('0x43')]);return _0x3c88f0[_0x1a6c('0x53')](_0x928c21);}})['then'](function(_0x4cbbf8){if(_0x4cbbf8){_0x5edadf=_0x4cbbf8[_0x1a6c('0x3b')];if(!_0x116318[_0x1a6c('0x36')]['hasOwnProperty']('nolimit')){_0x928c21[_0x1a6c('0x24')]=qs[_0x1a6c('0x24')](_0x116318[_0x1a6c('0x36')][_0x1a6c('0x24')]);_0x928c21[_0x1a6c('0x22')]=qs[_0x1a6c('0x22')](_0x116318[_0x1a6c('0x36')][_0x1a6c('0x22')]);}return _0x3c88f0[_0x1a6c('0x53')](_0x928c21);}})[_0x1a6c('0x2a')](function(_0xe879f0){if(_0xe879f0){return _0xe879f0?{'count':_0x5edadf,'rows':_0xe879f0}:null;}})['then'](respondWithResult(_0x4efb91,null))[_0x1a6c('0x47')](handleError(_0x4efb91,null));};exports[_0x1a6c('0x57')]=function(_0x2da57c,_0x6c5a54,_0x37891b){return db[_0x1a6c('0x30')][_0x1a6c('0x4a')]({'where':{'id':_0x2da57c[_0x1a6c('0x48')]['id']}})[_0x1a6c('0x2a')](handleEntityNotFound(_0x6c5a54,null))[_0x1a6c('0x2a')](function(_0x37a36b){if(_0x37a36b){return _0x37a36b[_0x1a6c('0x57')](_0x2da57c[_0x1a6c('0x36')][_0x1a6c('0x51')]);}})[_0x1a6c('0x2a')](respondWithStatusCode(_0x6c5a54,null))[_0x1a6c('0x47')](handleError(_0x6c5a54,null));};exports['addMessage']=function(_0x4f1449,_0x104c47,_0xd1750a){if(_0x4f1449[_0x1a6c('0x4c')]['id']){delete _0x4f1449[_0x1a6c('0x4c')]['id'];}return db[_0x1a6c('0x30')]['find']({'where':{'id':_0x4f1449[_0x1a6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x104c47,null))[_0x1a6c('0x2a')](function(_0x573f8d){if(_0x573f8d){_0x4f1449['body'][_0x1a6c('0x58')]=_0x573f8d['id'];return db['ChatInternalMessage'][_0x1a6c('0x4b')](_0x4f1449[_0x1a6c('0x4c')]);}})[_0x1a6c('0x2a')](respondWithResult(_0x104c47,null))[_0x1a6c('0x47')](handleError(_0x104c47,null));};exports['getMessages']=function(_0x1401cc,_0x2142f9,_0x2ab7d0){var _0x4f09dd={};var _0x39d940={};var _0x23ee12;var _0x55856a;return db['ChatGroup']['findOne']({'where':{'id':_0x1401cc[_0x1a6c('0x48')]['id']}})[_0x1a6c('0x2a')](handleEntityNotFound(_0x2142f9,null))[_0x1a6c('0x2a')](function(_0x316baa){if(_0x316baa){_0x23ee12=_0x316baa;_0x39d940[_0x1a6c('0x35')]=_[_0x1a6c('0x49')](db[_0x1a6c('0x4e')][_0x1a6c('0x31')]);_0x39d940['query']=_['keys'](_0x1401cc[_0x1a6c('0x36')]);_0x39d940[_0x1a6c('0x37')]=_[_0x1a6c('0x38')](_0x39d940['model'],_0x39d940[_0x1a6c('0x36')]);_0x4f09dd[_0x1a6c('0x39')]=_[_0x1a6c('0x38')](_0x39d940['model'],qs['fields'](_0x1401cc[_0x1a6c('0x36')][_0x1a6c('0x3a')]));_0x4f09dd[_0x1a6c('0x39')]=_0x4f09dd[_0x1a6c('0x39')]['length']?_0x4f09dd[_0x1a6c('0x39')]:_0x39d940[_0x1a6c('0x35')];_0x4f09dd[_0x1a6c('0x3d')]=qs[_0x1a6c('0x3e')](_0x1401cc[_0x1a6c('0x36')][_0x1a6c('0x3e')]);_0x4f09dd['where']=qs['filters'](_[_0x1a6c('0x56')](_0x1401cc[_0x1a6c('0x36')],_0x39d940[_0x1a6c('0x37')]));if(_0x1401cc[_0x1a6c('0x36')][_0x1a6c('0x40')]){_0x4f09dd[_0x1a6c('0x3f')]=_[_0x1a6c('0x41')](_0x4f09dd[_0x1a6c('0x3f')],{'$or':_['map'](_0x4f09dd[_0x1a6c('0x39')],function(_0x33dd63){var _0x32c85e={};_0x32c85e[_0x33dd63]={'$like':'%'+_0x1401cc[_0x1a6c('0x36')][_0x1a6c('0x40')]+'%'};return _0x32c85e;})});}if(_0x1401cc[_0x1a6c('0x36')]['$gte']){var _0xd7a643=_0x1401cc['query']['$gte']['split'](',');var _0x31ea91={};_0x31ea91[_0xd7a643[0x0]]={'$gte':moment(_0xd7a643[0x1])[_0x1a6c('0x59')](_0x1a6c('0x5a'))};_0x4f09dd[_0x1a6c('0x3f')]=_[_0x1a6c('0x41')](_0x4f09dd[_0x1a6c('0x3f')],_0x31ea91);}_0x4f09dd=_[_0x1a6c('0x41')]({},_0x4f09dd,_0x1401cc['options']);return _0x23ee12[_0x1a6c('0x5b')](_0x4f09dd);}})[_0x1a6c('0x2a')](function(_0x35f16e){if(_0x35f16e){_0x55856a=_0x35f16e[_0x1a6c('0x3b')];if(!_0x1401cc[_0x1a6c('0x36')][_0x1a6c('0x5c')](_0x1a6c('0x3c'))){_0x4f09dd[_0x1a6c('0x24')]=qs[_0x1a6c('0x24')](_0x1401cc[_0x1a6c('0x36')]['limit']);_0x4f09dd[_0x1a6c('0x22')]=qs[_0x1a6c('0x22')](_0x1401cc['query']['offset']);}return _0x23ee12[_0x1a6c('0x5b')](_0x4f09dd);}})['then'](function(_0x4fe0be){if(_0x4fe0be){return _0x4fe0be?{'count':_0x55856a,'rows':_0x4fe0be}:null;}})[_0x1a6c('0x2a')](respondWithResult(_0x2142f9,null))[_0x1a6c('0x47')](handleError(_0x2142f9,null));}; \ No newline at end of file +var _0x1fce=['removeMembers','addMessage','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','pick','nolimit'];(function(_0x23733d,_0x56f0a1){var _0x4a9cc4=function(_0x26f9ab){while(--_0x26f9ab){_0x23733d['push'](_0x23733d['shift']());}};_0x4a9cc4(++_0x56f0a1);}(_0x1fce,0x6a));var _0xe1fc=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x1fce[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require(_0xe1fc('0x0'));var rimraf=require(_0xe1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1fc('0x2'));var rp=require(_0xe1fc('0x3'));var moment=require(_0xe1fc('0x4'));var BPromise=require(_0xe1fc('0x5'));var Mustache=require(_0xe1fc('0x6'));var util=require(_0xe1fc('0x7'));var path=require(_0xe1fc('0x8'));var sox=require(_0xe1fc('0x9'));var csv=require(_0xe1fc('0xa'));var ejs=require(_0xe1fc('0xb'));var fs=require('fs');var fs_extra=require(_0xe1fc('0xc'));var _=require(_0xe1fc('0xd'));var squel=require(_0xe1fc('0xe'));var crypto=require(_0xe1fc('0xf'));var jsforce=require(_0xe1fc('0x10'));var deskjs=require(_0xe1fc('0x11'));var toCsv=require(_0xe1fc('0xa'));var querystring=require('querystring');var Papa=require(_0xe1fc('0x12'));var Redis=require(_0xe1fc('0x13'));var authService=require(_0xe1fc('0x14'));var qs=require(_0xe1fc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1fc('0x16'));var logger=require('../../config/logger')(_0xe1fc('0x17'));var utils=require(_0xe1fc('0x18'));var config=require(_0xe1fc('0x19'));var licenseUtil=require(_0xe1fc('0x1a'));var db=require(_0xe1fc('0x1b'))['db'];config[_0xe1fc('0x1c')]=_[_0xe1fc('0x1d')](config[_0xe1fc('0x1c')],{'host':_0xe1fc('0x1e'),'port':0x18eb});var socket=require(_0xe1fc('0x1f'))(new Redis(config[_0xe1fc('0x1c')]));require(_0xe1fc('0x20'))[_0xe1fc('0x21')](socket);function respondWithStatusCode(_0x43b144,_0x33d6ce){_0x33d6ce=_0x33d6ce||0xcc;return function(_0x36717c){if(_0x36717c){return _0x43b144['sendStatus'](_0x33d6ce);}return _0x43b144[_0xe1fc('0x22')](_0x33d6ce)['end']();};}function respondWithResult(_0x366310,_0x14883d){_0x14883d=_0x14883d||0xc8;return function(_0x138bdc){if(_0x138bdc){return _0x366310[_0xe1fc('0x22')](_0x14883d)[_0xe1fc('0x23')](_0x138bdc);}};}function respondWithFilteredResult(_0xe634b0,_0x49d578){return function(_0x641eaa){if(_0x641eaa){var _0xc8c62f=typeof _0x49d578[_0xe1fc('0x24')]==='undefined'&&typeof _0x49d578[_0xe1fc('0x25')]===_0xe1fc('0x26');var _0x132faf=_0x641eaa[_0xe1fc('0x27')];var _0x57645d=_0xc8c62f?0x0:_0x49d578[_0xe1fc('0x24')];var _0x4a062d=_0xc8c62f?_0x641eaa[_0xe1fc('0x27')]:_0x49d578[_0xe1fc('0x24')]+_0x49d578[_0xe1fc('0x25')];var _0x684671;if(_0x4a062d>=_0x132faf){_0x4a062d=_0x132faf;_0x684671=0xc8;}else{_0x684671=0xce;}_0xe634b0[_0xe1fc('0x22')](_0x684671);return _0xe634b0['set']('Content-Range',_0x57645d+'-'+_0x4a062d+'/'+_0x132faf)[_0xe1fc('0x23')](_0x641eaa);}return null;};}function patchUpdates(_0x107e11){return function(_0x7254ad){try{jsonpatch[_0xe1fc('0x28')](_0x7254ad,_0x107e11,!![]);}catch(_0x3099c0){return BPromise[_0xe1fc('0x29')](_0x3099c0);}return _0x7254ad[_0xe1fc('0x2a')]();};}function saveUpdates(_0x4dffbb,_0x2160d1){return function(_0x5eb3f0){if(_0x5eb3f0){return _0x5eb3f0[_0xe1fc('0x2b')](_0x4dffbb)[_0xe1fc('0x2c')](function(_0x5c9560){return _0x5c9560;});}return null;};}function removeEntity(_0x4230dd,_0x237e6c){return function(_0x11dc63){if(_0x11dc63){return _0x11dc63[_0xe1fc('0x2d')]()['then'](function(){_0x4230dd[_0xe1fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244013,_0x3a922c){return function(_0x4220dd){if(!_0x4220dd){_0x244013['sendStatus'](0x194);}return _0x4220dd;};}function handleError(_0x5b2191,_0x27674e){_0x27674e=_0x27674e||0x1f4;return function(_0x24fd39){logger[_0xe1fc('0x2e')](_0x24fd39[_0xe1fc('0x2f')]);if(_0x24fd39[_0xe1fc('0x30')]){delete _0x24fd39[_0xe1fc('0x30')];}_0x5b2191[_0xe1fc('0x22')](_0x27674e)[_0xe1fc('0x31')](_0x24fd39);};}exports[_0xe1fc('0x32')]=function(_0x44fd19,_0x447db6){var _0x45b3f0={},_0x5e2751={},_0x215afc={'count':0x0,'rows':[]};var _0x438943=_[_0xe1fc('0x33')](db[_0xe1fc('0x34')][_0xe1fc('0x35')],function(_0x195a83){return{'name':_0x195a83['fieldName'],'type':_0x195a83[_0xe1fc('0x36')][_0xe1fc('0x37')]};});_0x5e2751['model']=_[_0xe1fc('0x33')](_0x438943,_0xe1fc('0x30'));_0x5e2751[_0xe1fc('0x38')]=_[_0xe1fc('0x39')](_0x44fd19['query']);_0x5e2751['filters']=_[_0xe1fc('0x3a')](_0x5e2751[_0xe1fc('0x3b')],_0x5e2751[_0xe1fc('0x38')]);_0x45b3f0[_0xe1fc('0x3c')]=_[_0xe1fc('0x3a')](_0x5e2751[_0xe1fc('0x3b')],qs[_0xe1fc('0x3d')](_0x44fd19[_0xe1fc('0x38')]['fields']));_0x45b3f0['attributes']=_0x45b3f0['attributes']['length']?_0x45b3f0[_0xe1fc('0x3c')]:_0x5e2751[_0xe1fc('0x3b')];if(!_0x44fd19['query'][_0xe1fc('0x3e')]('nolimit')){_0x45b3f0['limit']=qs[_0xe1fc('0x25')](_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x25')]);_0x45b3f0[_0xe1fc('0x24')]=qs[_0xe1fc('0x24')](_0x44fd19['query'][_0xe1fc('0x24')]);}_0x45b3f0['order']=qs['sort'](_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x3f')]);_0x45b3f0['where']=qs[_0xe1fc('0x40')](_['pick'](_0x44fd19['query'],_0x5e2751['filters']),_0x438943);if(_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x41')]){_0x45b3f0[_0xe1fc('0x42')]=_['merge'](_0x45b3f0[_0xe1fc('0x42')],{'$or':_[_0xe1fc('0x33')](_0x438943,function(_0x534f99){if(_0x534f99['type']!==_0xe1fc('0x43')){var _0x293b6f={};_0x293b6f[_0x534f99['name']]={'$like':'%'+_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x41')]+'%'};return _0x293b6f;}})});}_0x45b3f0=_[_0xe1fc('0x44')]({},_0x45b3f0,_0x44fd19[_0xe1fc('0x45')]);var _0xbf003a={'where':_0x45b3f0[_0xe1fc('0x42')]};return db[_0xe1fc('0x34')][_0xe1fc('0x27')](_0xbf003a)[_0xe1fc('0x2c')](function(_0x3b1219){_0x215afc['count']=_0x3b1219;if(_0x44fd19[_0xe1fc('0x38')][_0xe1fc('0x46')]){_0x45b3f0[_0xe1fc('0x47')]=[{'all':!![]}];}return db[_0xe1fc('0x34')][_0xe1fc('0x48')](_0x45b3f0);})[_0xe1fc('0x2c')](function(_0x2ccd58){_0x215afc[_0xe1fc('0x49')]=_0x2ccd58;return _0x215afc;})[_0xe1fc('0x2c')](respondWithFilteredResult(_0x447db6,_0x45b3f0))[_0xe1fc('0x4a')](handleError(_0x447db6,null));};exports['show']=function(_0x602e0b,_0x279f10){var _0x3efc20={'raw':!![],'where':{'id':_0x602e0b[_0xe1fc('0x4b')]['id']}},_0x571290={};_0x571290[_0xe1fc('0x3b')]=_['keys'](db[_0xe1fc('0x34')][_0xe1fc('0x35')]);_0x571290[_0xe1fc('0x38')]=_['keys'](_0x602e0b['query']);_0x571290[_0xe1fc('0x40')]=_[_0xe1fc('0x3a')](_0x571290['model'],_0x571290[_0xe1fc('0x38')]);_0x3efc20['attributes']=_[_0xe1fc('0x3a')](_0x571290['model'],qs[_0xe1fc('0x3d')](_0x602e0b[_0xe1fc('0x38')][_0xe1fc('0x3d')]));_0x3efc20['attributes']=_0x3efc20[_0xe1fc('0x3c')][_0xe1fc('0x4c')]?_0x3efc20[_0xe1fc('0x3c')]:_0x571290[_0xe1fc('0x3b')];if(_0x602e0b[_0xe1fc('0x38')][_0xe1fc('0x46')]){_0x3efc20[_0xe1fc('0x47')]=[{'all':!![]}];}_0x3efc20=_[_0xe1fc('0x44')]({},_0x3efc20,_0x602e0b[_0xe1fc('0x45')]);return db[_0xe1fc('0x34')][_0xe1fc('0x4d')](_0x3efc20)[_0xe1fc('0x2c')](handleEntityNotFound(_0x279f10,null))[_0xe1fc('0x2c')](respondWithResult(_0x279f10,null))['catch'](handleError(_0x279f10,null));};exports[_0xe1fc('0x4e')]=function(_0x2be741,_0x293ac0){return db[_0xe1fc('0x34')][_0xe1fc('0x4e')](_0x2be741[_0xe1fc('0x4f')],{})[_0xe1fc('0x2c')](respondWithResult(_0x293ac0,0xc9))[_0xe1fc('0x4a')](handleError(_0x293ac0,null));};exports[_0xe1fc('0x2b')]=function(_0x1b7050,_0x1f02b3){if(_0x1b7050['body']['id']){delete _0x1b7050[_0xe1fc('0x4f')]['id'];}return db[_0xe1fc('0x34')][_0xe1fc('0x4d')]({'where':{'id':_0x1b7050[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x1f02b3,null))[_0xe1fc('0x2c')](saveUpdates(_0x1b7050[_0xe1fc('0x4f')],null))['then'](respondWithResult(_0x1f02b3,null))[_0xe1fc('0x4a')](handleError(_0x1f02b3,null));};exports[_0xe1fc('0x2d')]=function(_0x24d77e,_0x471bea){return db[_0xe1fc('0x34')]['find']({'where':{'id':_0x24d77e[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x471bea,null))[_0xe1fc('0x2c')](removeEntity(_0x471bea,null))[_0xe1fc('0x4a')](handleError(_0x471bea,null));};exports[_0xe1fc('0x50')]=function(_0x1f8315,_0x3f059e){return db[_0xe1fc('0x34')][_0xe1fc('0x50')]()[_0xe1fc('0x2c')](respondWithResult(_0x3f059e,null))['catch'](handleError(_0x3f059e,null));};exports[_0xe1fc('0x51')]=function(_0x9e974e,_0x341bc7,_0x305b46){return db[_0xe1fc('0x52')]['count']({'where':{'ChatGroupId':_0x9e974e[_0xe1fc('0x4b')]['id'],'ToId':_0x9e974e[_0xe1fc('0x53')]['id'],'read':![]}})['then'](function(_0x210b78){return{'id':_[_0xe1fc('0x54')](_0x9e974e[_0xe1fc('0x4b')]['id']),'count':_0x210b78};})['then'](respondWithResult(_0x341bc7,null))[_0xe1fc('0x4a')](handleError(_0x341bc7,null));};exports[_0xe1fc('0x55')]=function(_0xdb7a51,_0x30fd93,_0x1fd6a){return db['ChatGroup'][_0xe1fc('0x4d')]({'where':{'id':_0xdb7a51[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x30fd93,null))[_0xe1fc('0x2c')](function(_0x360d90){if(_0x360d90){return _0x360d90[_0xe1fc('0x55')](_0xdb7a51[_0xe1fc('0x4f')][_0xe1fc('0x56')],_['omit'](_0xdb7a51[_0xe1fc('0x4f')],[_0xe1fc('0x56'),'id'])||{});}})['then'](respondWithResult(_0x30fd93,null))[_0xe1fc('0x4a')](handleError(_0x30fd93,null));};exports[_0xe1fc('0x57')]=function(_0x64f62c,_0x1c0c91,_0x4d44b3){var _0x26214d={};var _0x29e30e={};var _0x1be5e7;var _0x5cbf3c;return db[_0xe1fc('0x34')][_0xe1fc('0x58')]({'where':{'id':_0x64f62c[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x1c0c91,null))[_0xe1fc('0x2c')](function(_0xed1acc){if(_0xed1acc){_0x1be5e7=_0xed1acc;_0x29e30e['model']=_['keys'](db[_0xe1fc('0x59')]['rawAttributes']);_0x29e30e['query']=_[_0xe1fc('0x39')](_0x64f62c[_0xe1fc('0x38')]);_0x29e30e[_0xe1fc('0x40')]=_[_0xe1fc('0x3a')](_0x29e30e[_0xe1fc('0x3b')],_0x29e30e[_0xe1fc('0x38')]);_0x26214d[_0xe1fc('0x3c')]=_['intersection'](_0x29e30e['model'],qs[_0xe1fc('0x3d')](_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x3d')]));_0x26214d[_0xe1fc('0x3c')]=_0x26214d[_0xe1fc('0x3c')][_0xe1fc('0x4c')]?_0x26214d[_0xe1fc('0x3c')]:_0x29e30e[_0xe1fc('0x3b')];_0x26214d['order']=qs[_0xe1fc('0x3f')](_0x64f62c['query']['sort']);_0x26214d[_0xe1fc('0x42')]=qs[_0xe1fc('0x40')](_[_0xe1fc('0x5a')](_0x64f62c[_0xe1fc('0x38')],_0x29e30e[_0xe1fc('0x40')]));if(_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x41')]){_0x26214d[_0xe1fc('0x42')]=_[_0xe1fc('0x44')](_0x26214d[_0xe1fc('0x42')],{'$or':_['map'](_0x26214d['attributes'],function(_0x197f53){var _0x586260={};_0x586260[_0x197f53]={'$like':'%'+_0x64f62c['query'][_0xe1fc('0x41')]+'%'};return _0x586260;})});}_0x26214d=_[_0xe1fc('0x44')]({},_0x26214d,_0x64f62c[_0xe1fc('0x45')]);return _0x1be5e7[_0xe1fc('0x57')](_0x26214d);}})['then'](function(_0x4bbce2){if(_0x4bbce2){_0x5cbf3c=_0x4bbce2['length'];if(!_0x64f62c[_0xe1fc('0x38')]['hasOwnProperty'](_0xe1fc('0x5b'))){_0x26214d[_0xe1fc('0x25')]=qs[_0xe1fc('0x25')](_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x25')]);_0x26214d[_0xe1fc('0x24')]=qs[_0xe1fc('0x24')](_0x64f62c[_0xe1fc('0x38')][_0xe1fc('0x24')]);}return _0x1be5e7[_0xe1fc('0x57')](_0x26214d);}})[_0xe1fc('0x2c')](function(_0x21437a){if(_0x21437a){return _0x21437a?{'count':_0x5cbf3c,'rows':_0x21437a}:null;}})[_0xe1fc('0x2c')](respondWithResult(_0x1c0c91,null))[_0xe1fc('0x4a')](handleError(_0x1c0c91,null));};exports['removeMembers']=function(_0x313ce2,_0x134bea,_0x2ac879){return db[_0xe1fc('0x34')]['find']({'where':{'id':_0x313ce2[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x134bea,null))[_0xe1fc('0x2c')](function(_0x46b923){if(_0x46b923){return _0x46b923[_0xe1fc('0x5c')](_0x313ce2[_0xe1fc('0x38')][_0xe1fc('0x56')]);}})[_0xe1fc('0x2c')](respondWithStatusCode(_0x134bea,null))['catch'](handleError(_0x134bea,null));};exports[_0xe1fc('0x5d')]=function(_0x5427db,_0x393d95,_0xa3d14){if(_0x5427db[_0xe1fc('0x4f')]['id']){delete _0x5427db[_0xe1fc('0x4f')]['id'];}return db[_0xe1fc('0x34')][_0xe1fc('0x4d')]({'where':{'id':_0x5427db['params']['id']}})['then'](handleEntityNotFound(_0x393d95,null))[_0xe1fc('0x2c')](function(_0x14d4d3){if(_0x14d4d3){_0x5427db[_0xe1fc('0x4f')]['ChatGroupId']=_0x14d4d3['id'];return db[_0xe1fc('0x52')][_0xe1fc('0x4e')](_0x5427db[_0xe1fc('0x4f')]);}})[_0xe1fc('0x2c')](respondWithResult(_0x393d95,null))['catch'](handleError(_0x393d95,null));};exports['getMessages']=function(_0x5a890d,_0x1a20c5,_0x506798){var _0x322467={};var _0x180c02={};var _0x4c3567;var _0x268186;return db[_0xe1fc('0x34')][_0xe1fc('0x58')]({'where':{'id':_0x5a890d[_0xe1fc('0x4b')]['id']}})[_0xe1fc('0x2c')](handleEntityNotFound(_0x1a20c5,null))[_0xe1fc('0x2c')](function(_0xc8cdfc){if(_0xc8cdfc){_0x4c3567=_0xc8cdfc;_0x180c02[_0xe1fc('0x3b')]=_[_0xe1fc('0x39')](db[_0xe1fc('0x52')][_0xe1fc('0x35')]);_0x180c02['query']=_[_0xe1fc('0x39')](_0x5a890d[_0xe1fc('0x38')]);_0x180c02[_0xe1fc('0x40')]=_[_0xe1fc('0x3a')](_0x180c02[_0xe1fc('0x3b')],_0x180c02[_0xe1fc('0x38')]);_0x322467[_0xe1fc('0x3c')]=_[_0xe1fc('0x3a')](_0x180c02[_0xe1fc('0x3b')],qs[_0xe1fc('0x3d')](_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x3d')]));_0x322467[_0xe1fc('0x3c')]=_0x322467[_0xe1fc('0x3c')][_0xe1fc('0x4c')]?_0x322467[_0xe1fc('0x3c')]:_0x180c02[_0xe1fc('0x3b')];_0x322467[_0xe1fc('0x5e')]=qs[_0xe1fc('0x3f')](_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x3f')]);_0x322467[_0xe1fc('0x42')]=qs['filters'](_[_0xe1fc('0x5a')](_0x5a890d[_0xe1fc('0x38')],_0x180c02[_0xe1fc('0x40')]));if(_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x41')]){_0x322467[_0xe1fc('0x42')]=_[_0xe1fc('0x44')](_0x322467[_0xe1fc('0x42')],{'$or':_[_0xe1fc('0x33')](_0x322467['attributes'],function(_0x5a20d){var _0x16deb1={};_0x16deb1[_0x5a20d]={'$like':'%'+_0x5a890d[_0xe1fc('0x38')]['filter']+'%'};return _0x16deb1;})});}if(_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x5f')]){var _0x59ae2c=_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x5f')]['split'](',');var _0x4f34bf={};_0x4f34bf[_0x59ae2c[0x0]]={'$gte':moment(_0x59ae2c[0x1])[_0xe1fc('0x60')](_0xe1fc('0x61'))};_0x322467['where']=_['merge'](_0x322467[_0xe1fc('0x42')],_0x4f34bf);}_0x322467=_[_0xe1fc('0x44')]({},_0x322467,_0x5a890d[_0xe1fc('0x45')]);return _0x4c3567['getMessages'](_0x322467);}})[_0xe1fc('0x2c')](function(_0x513b0f){if(_0x513b0f){_0x268186=_0x513b0f[_0xe1fc('0x4c')];if(!_0x5a890d[_0xe1fc('0x38')]['hasOwnProperty'](_0xe1fc('0x5b'))){_0x322467[_0xe1fc('0x25')]=qs['limit'](_0x5a890d['query'][_0xe1fc('0x25')]);_0x322467[_0xe1fc('0x24')]=qs[_0xe1fc('0x24')](_0x5a890d[_0xe1fc('0x38')][_0xe1fc('0x24')]);}return _0x4c3567[_0xe1fc('0x62')](_0x322467);}})['then'](function(_0xa446ae){if(_0xa446ae){return _0xa446ae?{'count':_0x268186,'rows':_0xa446ae}:null;}})['then'](respondWithResult(_0x1a20c5,null))[_0xe1fc('0x4a')](handleError(_0x1a20c5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ac5b1ee..3e029b5 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 _0xa3d5=['../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x55f562,_0x24a279){var _0x15691b=function(_0x54c1c9){while(--_0x54c1c9){_0x55f562['push'](_0x55f562['shift']());}};_0x15691b(++_0x24a279);}(_0xa3d5,0xc7));var _0x5a3d=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0xa3d5[_0x1f23b1];return _0x3c9197;};'use strict';var EventEmitter=require(_0x5a3d('0x0'));var ChatGroup=require(_0x5a3d('0x1'))['db'][_0x5a3d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5a3d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5a3d('0x4'),'afterDestroy':_0x5a3d('0x5')};function emitEvent(_0x21e829){return function(_0x177039,_0xd3ff2f,_0x1d4ad6){ChatGroupEvents[_0x5a3d('0x6')](_0x21e829+':'+_0x177039['id'],_0x177039);ChatGroupEvents[_0x5a3d('0x6')](_0x21e829,_0x177039);_0x1d4ad6(null);};}for(var e in events){if(events[_0x5a3d('0x7')](e)){var event=events[e];ChatGroup[_0x5a3d('0x8')](e,emitEvent(event));}}module[_0x5a3d('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x7cfe=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x33918e,_0x370d49){var _0x21ad27=function(_0xfb0948){while(--_0xfb0948){_0x33918e['push'](_0x33918e['shift']());}};_0x21ad27(++_0x370d49);}(_0x7cfe,0x94));var _0xe7cf=function(_0xbb9503,_0x4bd3e6){_0xbb9503=_0xbb9503-0x0;var _0x417628=_0x7cfe[_0xbb9503];return _0x417628;};'use strict';var EventEmitter=require(_0xe7cf('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe7cf('0x1')](0x0);var events={'afterCreate':_0xe7cf('0x2'),'afterUpdate':_0xe7cf('0x3'),'afterDestroy':_0xe7cf('0x4')};function emitEvent(_0x18f5cf){return function(_0x1a035b,_0x1b15b4,_0x485c23){ChatGroupEvents[_0xe7cf('0x5')](_0x18f5cf+':'+_0x1a035b['id'],_0x1a035b);ChatGroupEvents[_0xe7cf('0x5')](_0x18f5cf,_0x1a035b);_0x485c23(null);};}for(var e in events){if(events[_0xe7cf('0x6')](e)){var event=events[e];ChatGroup[_0xe7cf('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 3cb517e..d0f96e9 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 _0x4a91=['api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','chat_groups'];(function(_0xf78620,_0x4e6210){var _0x12f80c=function(_0x57cda2){while(--_0x57cda2){_0xf78620['push'](_0xf78620['shift']());}};_0x12f80c(++_0x4e6210);}(_0x4a91,0xa8));var _0x14a9=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x4a91[_0x22b68a];return _0x1ac67a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x14a9('0x0'));var moment=require(_0x14a9('0x1'));var BPromise=require(_0x14a9('0x2'));var rp=require(_0x14a9('0x3'));var fs=require('fs');var path=require(_0x14a9('0x4'));var rimraf=require(_0x14a9('0x5'));var config=require('../../config/environment');var attributes=require(_0x14a9('0x6'));module['exports']=function(_0x416b9e,_0xc25faf){return _0x416b9e['define']('ChatGroup',attributes,{'tableName':_0x14a9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x972f=['exports','define','ChatGroup','chat_groups','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x55edaa,_0x4a71e5){var _0x4abd20=function(_0x2ef079){while(--_0x2ef079){_0x55edaa['push'](_0x55edaa['shift']());}};_0x4abd20(++_0x4a71e5);}(_0x972f,0x149));var _0xf972=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x972f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf972('0x0'));var util=require(_0xf972('0x1'));var logger=require('../../config/logger')(_0xf972('0x2'));var moment=require(_0xf972('0x3'));var BPromise=require(_0xf972('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf972('0x5'));var rimraf=require(_0xf972('0x6'));var config=require(_0xf972('0x7'));var attributes=require(_0xf972('0x8'));module[_0xf972('0x9')]=function(_0x3e1e50,_0x2fb58f){return _0x3e1e50[_0xf972('0xa')](_0xf972('0xb'),attributes,{'tableName':_0xf972('0xc'),'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 67bc44e..42056b5 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 _0x3248=['http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0xd56af9,_0x28270d){var _0x5f0b6f=function(_0x178212){while(--_0x178212){_0xd56af9['push'](_0xd56af9['shift']());}};_0x5f0b6f(++_0x28270d);}(_0x3248,0x1b0));var _0x8324=function(_0x550256,_0x7a6c11){_0x550256=_0x550256-0x0;var _0x514b20=_0x3248[_0x550256];return _0x514b20;};'use strict';var _=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var moment=require(_0x8324('0x2'));var BPromise=require(_0x8324('0x3'));var rs=require(_0x8324('0x4'));var fs=require('fs');var Redis=require(_0x8324('0x5'));var db=require(_0x8324('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8324('0x7'));var config=require(_0x8324('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8324('0x9')][_0x8324('0xa')]({'port':0x232a});config[_0x8324('0xb')]=_[_0x8324('0xc')](config[_0x8324('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8324('0xd'))(new Redis(config[_0x8324('0xb')]));require(_0x8324('0xe'))['register'](socket);function respondWithRpcPromise(_0x55e1d2,_0x1722ae,_0x3ad4e9){return new BPromise(function(_0x3c1f41,_0x59797f){return client[_0x8324('0xf')](_0x55e1d2,_0x3ad4e9)[_0x8324('0x10')](function(_0x9191a4){logger[_0x8324('0x11')](_0x8324('0x12'),_0x1722ae,_0x8324('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1722ae,'request\x20sent',JSON[_0x8324('0x14')](_0x9191a4));if(_0x9191a4['error']){if(_0x9191a4['error'][_0x8324('0x15')]===0x1f4){logger[_0x8324('0x16')](_0x8324('0x12'),_0x1722ae,_0x9191a4['error'][_0x8324('0x17')]);return _0x59797f(_0x9191a4[_0x8324('0x16')][_0x8324('0x17')]);}logger['error'](_0x8324('0x12'),_0x1722ae,_0x9191a4[_0x8324('0x16')][_0x8324('0x17')]);return _0x3c1f41(_0x9191a4[_0x8324('0x16')][_0x8324('0x17')]);}else{logger[_0x8324('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1722ae,'request\x20sent');_0x3c1f41(_0x9191a4[_0x8324('0x18')][_0x8324('0x17')]);}})[_0x8324('0x19')](function(_0x5d0abc){logger[_0x8324('0x16')](_0x8324('0x12'),_0x1722ae,_0x5d0abc);_0x59797f(_0x5d0abc);});});} \ No newline at end of file +var _0x1b69=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x57bff1,_0x29ec45){var _0x8173d0=function(_0x427bf7){while(--_0x427bf7){_0x57bff1['push'](_0x57bff1['shift']());}};_0x8173d0(++_0x29ec45);}(_0x1b69,0x190));var _0x91b6=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1b69[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x91b6('0x0'));var rs=require(_0x91b6('0x1'));var fs=require('fs');var Redis=require(_0x91b6('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x91b6('0x3'));var logger=require(_0x91b6('0x4'))(_0x91b6('0x5'));var config=require(_0x91b6('0x6'));var jayson=require(_0x91b6('0x7'));var client=jayson[_0x91b6('0x8')][_0x91b6('0x9')]({'port':0x232a});config[_0x91b6('0xa')]=_[_0x91b6('0xb')](config[_0x91b6('0xa')],{'host':_0x91b6('0xc'),'port':0x18eb});var socket=require(_0x91b6('0xd'))(new Redis(config[_0x91b6('0xa')]));require(_0x91b6('0xe'))['register'](socket);function respondWithRpcPromise(_0x563f68,_0x579e5b,_0x3580be){return new BPromise(function(_0x416bdd,_0x59c9ea){return client[_0x91b6('0xf')](_0x563f68,_0x3580be)[_0x91b6('0x10')](function(_0x45b492){logger[_0x91b6('0x11')](_0x91b6('0x12'),_0x579e5b,_0x91b6('0x13'));logger['debug'](_0x91b6('0x14'),_0x579e5b,'request\x20sent',JSON[_0x91b6('0x15')](_0x45b492));if(_0x45b492[_0x91b6('0x16')]){if(_0x45b492[_0x91b6('0x16')][_0x91b6('0x17')]===0x1f4){logger['error'](_0x91b6('0x12'),_0x579e5b,_0x45b492[_0x91b6('0x16')][_0x91b6('0x18')]);return _0x59c9ea(_0x45b492[_0x91b6('0x16')][_0x91b6('0x18')]);}logger['error'](_0x91b6('0x12'),_0x579e5b,_0x45b492[_0x91b6('0x16')][_0x91b6('0x18')]);return _0x416bdd(_0x45b492[_0x91b6('0x16')]['message']);}else{logger['info'](_0x91b6('0x12'),_0x579e5b,_0x91b6('0x13'));_0x416bdd(_0x45b492[_0x91b6('0x19')][_0x91b6('0x18')]);}})[_0x91b6('0x1a')](function(_0x34f58b){logger['error'](_0x91b6('0x12'),_0x579e5b,_0x34f58b);_0x59c9ea(_0x34f58b);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c0c55cf..73f0640 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 _0x0e18=['save','update','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x1028c3,_0x32172e){var _0x242979=function(_0x49a1ea){while(--_0x49a1ea){_0x1028c3['push'](_0x1028c3['shift']());}};_0x242979(++_0x32172e);}(_0x0e18,0x1e5));var _0x80e1=function(_0x4a1258,_0x4e5ba7){_0x4a1258=_0x4a1258-0x0;var _0xf25829=_0x0e18[_0x4a1258];return _0xf25829;};'use strict';var ChatGroupEvents=require(_0x80e1('0x0'));var events=[_0x80e1('0x1'),'remove',_0x80e1('0x2')];function createListener(_0x42397f,_0x2eb5d8){return function(_0x37b7ba){_0x2eb5d8['emit'](_0x42397f,_0x37b7ba);};}function removeListener(_0xfd6456,_0x3192be){return function(){ChatGroupEvents[_0x80e1('0x3')](_0xfd6456,_0x3192be);};}exports[_0x80e1('0x4')]=function(_0x3320bd){for(var _0x3e7d44=0x0,_0x1f8be1=events['length'];_0x3e7d44<_0x1f8be1;_0x3e7d44++){var _0xb62944=events[_0x3e7d44];var _0x5d52c7=createListener(_0x80e1('0x5')+_0xb62944,_0x3320bd);ChatGroupEvents['on'](_0xb62944,_0x5d52c7);}}; \ No newline at end of file +var _0xf86e=['./chatGroup.events','save','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xf86e,0xf8));var _0xef86=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xf86e[_0x4953da];return _0x2d3780;};'use strict';var ChatGroupEvents=require(_0xef86('0x0'));var events=[_0xef86('0x1'),_0xef86('0x2'),'update'];function createListener(_0x3d9379,_0x353a79){return function(_0x37eeef){_0x353a79[_0xef86('0x3')](_0x3d9379,_0x37eeef);};}function removeListener(_0x2f13d1,_0x11a015){return function(){ChatGroupEvents[_0xef86('0x4')](_0x2f13d1,_0x11a015);};}exports[_0xef86('0x5')]=function(_0x2ca95f){for(var _0x1683f2=0x0,_0x3b8425=events[_0xef86('0x6')];_0x1683f2<_0x3b8425;_0x1683f2++){var _0x1ad76d=events[_0x1683f2];var _0x28d994=createListener(_0xef86('0x7')+_0x1ad76d,_0x2ca95f);ChatGroupEvents['on'](_0x1ad76d,_0x28d994);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5e8d15d..1694f0e 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 _0x6ef8=['post','addMembers','/:id','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','show','/:id/unread','/:id/members','getMembers','getMessages'];(function(_0x32e9de,_0x6939af){var _0x39b0ac=function(_0x43e087){while(--_0x43e087){_0x32e9de['push'](_0x32e9de['shift']());}};_0x39b0ac(++_0x6939af);}(_0x6ef8,0x183));var _0x86ef=function(_0x14ff14,_0x1b6b2e){_0x14ff14=_0x14ff14-0x0;var _0x45afdd=_0x6ef8[_0x14ff14];return _0x45afdd;};'use strict';var multer=require(_0x86ef('0x0'));var util=require(_0x86ef('0x1'));var path=require(_0x86ef('0x2'));var timeout=require(_0x86ef('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86ef('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x86ef('0x5'));router[_0x86ef('0x6')]('/',auth[_0x86ef('0x7')](),controller['index']);router['get']('/describe',auth[_0x86ef('0x7')](),controller['describe']);router[_0x86ef('0x6')]('/:id',auth[_0x86ef('0x7')](),controller[_0x86ef('0x8')]);router[_0x86ef('0x6')](_0x86ef('0x9'),auth[_0x86ef('0x7')](),controller['getUnread']);router[_0x86ef('0x6')](_0x86ef('0xa'),auth['isAuthenticated'](),controller[_0x86ef('0xb')]);router[_0x86ef('0x6')]('/:id/messages',auth[_0x86ef('0x7')](),controller[_0x86ef('0xc')]);router['post']('/',auth[_0x86ef('0x7')](),controller['create']);router[_0x86ef('0xd')](_0x86ef('0xa'),auth[_0x86ef('0x7')](),controller[_0x86ef('0xe')]);router[_0x86ef('0xd')]('/:id/messages',auth[_0x86ef('0x7')](),controller['addMessage']);router['put'](_0x86ef('0xf'),auth[_0x86ef('0x7')](),controller['update']);router[_0x86ef('0x10')]('/:id',auth[_0x86ef('0x7')](),controller[_0x86ef('0x11')]);router['delete']('/:id/members',auth[_0x86ef('0x7')](),controller[_0x86ef('0x12')]);module[_0x86ef('0x13')]=router; \ No newline at end of file +var _0x332a=['../../config/environment','./chatGroup.controller','isAuthenticated','index','get','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','addMessage','put','update','/:id','delete','removeMembers','exports','util','express','Router','../../components/interaction/service'];(function(_0x4cb9e8,_0x43ac2c){var _0x398212=function(_0x3a0b8f){while(--_0x3a0b8f){_0x4cb9e8['push'](_0x4cb9e8['shift']());}};_0x398212(++_0x43ac2c);}(_0x332a,0x96));var _0xa332=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x332a[_0x4ffa64];return _0x5da001;};'use strict';var multer=require('multer');var util=require(_0xa332('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa332('0x1'));var router=express[_0xa332('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa332('0x3'));var config=require(_0xa332('0x4'));var controller=require(_0xa332('0x5'));router['get']('/',auth[_0xa332('0x6')](),controller[_0xa332('0x7')]);router[_0xa332('0x8')]('/describe',auth[_0xa332('0x6')](),controller['describe']);router[_0xa332('0x8')]('/:id',auth[_0xa332('0x6')](),controller[_0xa332('0x9')]);router[_0xa332('0x8')](_0xa332('0xa'),auth[_0xa332('0x6')](),controller['getUnread']);router[_0xa332('0x8')](_0xa332('0xb'),auth[_0xa332('0x6')](),controller['getMembers']);router[_0xa332('0x8')](_0xa332('0xc'),auth[_0xa332('0x6')](),controller[_0xa332('0xd')]);router[_0xa332('0xe')]('/',auth[_0xa332('0x6')](),controller['create']);router[_0xa332('0xe')]('/:id/members',auth[_0xa332('0x6')](),controller['addMembers']);router[_0xa332('0xe')]('/:id/messages',auth[_0xa332('0x6')](),controller[_0xa332('0xf')]);router[_0xa332('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa332('0x11')]);router['delete'](_0xa332('0x12'),auth[_0xa332('0x6')](),controller['destroy']);router[_0xa332('0x13')](_0xa332('0xb'),auth[_0xa332('0x6')](),controller[_0xa332('0x14')]);module[_0xa332('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index d6d4765..aabfd3e 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 _0x7bd6=['star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x7bd6,0x1cf));var _0x67bd=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x7bd6[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0x67bd('0x0'));module[_0x67bd('0x1')]={'closed':{'type':Sequelize[_0x67bd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x67bd('0x3')]},'ratingType':{'type':Sequelize[_0x67bd('0x4')](_0x67bd('0x5'),_0x67bd('0x6')),'defaultValue':_0x67bd('0x5')},'ratingMessage':{'type':Sequelize[_0x67bd('0x7')]},'pathTranscript':{'type':Sequelize[_0x67bd('0x7')]},'mailTranscript':{'type':Sequelize[_0x67bd('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x67bd('0x9')]},'disposition':{'type':Sequelize[_0x67bd('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x67bd('0x8')]},'note':{'type':Sequelize[_0x67bd('0x8')]},'browserName':{'type':Sequelize[_0x67bd('0x8')]},'browserVersion':{'type':Sequelize[_0x67bd('0x8')]},'osName':{'type':Sequelize[_0x67bd('0x8')]},'osVersion':{'type':Sequelize[_0x67bd('0x8')]},'deviceModel':{'type':Sequelize[_0x67bd('0x8')]},'deviceVendor':{'type':Sequelize[_0x67bd('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x67bd('0x7')]},'customerIp':{'type':Sequelize[_0x67bd('0x8')]},'formData':{'type':Sequelize[_0x67bd('0x7')](_0x67bd('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x67bd('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x67bd('0x4')]('in',_0x67bd('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x67bd('0x8')]},'customerPort':{'type':Sequelize[_0x67bd('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x67bd('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x67bd('0x3')]}}; \ No newline at end of file +var _0xe1d0=['INTEGER','sequelize','BOOLEAN','ENUM','star','DATE','STRING','TEXT','long'];(function(_0x3e03f7,_0x5f3edd){var _0x4436f9=function(_0x20d6bd){while(--_0x20d6bd){_0x3e03f7['push'](_0x3e03f7['shift']());}};_0x4436f9(++_0x5f3edd);}(_0xe1d0,0x6d));var _0x0e1d=function(_0x51ba5f,_0x17923b){_0x51ba5f=_0x51ba5f-0x0;var _0x31d14a=_0xe1d0[_0x51ba5f];return _0x31d14a;};'use strict';var Sequelize=require(_0x0e1d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0e1d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x0e1d('0x2')](_0x0e1d('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0e1d('0x4')]},'disposition':{'type':Sequelize[_0x0e1d('0x5')]},'secondDisposition':{'type':Sequelize[_0x0e1d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0e1d('0x5')]},'note':{'type':Sequelize[_0x0e1d('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x0e1d('0x5')]},'osName':{'type':Sequelize[_0x0e1d('0x5')]},'osVersion':{'type':Sequelize[_0x0e1d('0x5')]},'deviceModel':{'type':Sequelize[_0x0e1d('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x0e1d('0x5')]},'referer':{'type':Sequelize[_0x0e1d('0x6')]},'customerIp':{'type':Sequelize[_0x0e1d('0x5')]},'formData':{'type':Sequelize[_0x0e1d('0x6')](_0x0e1d('0x7'))},'read1stAt':{'type':Sequelize[_0x0e1d('0x4')]},'lastMsgAt':{'type':Sequelize[_0x0e1d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0e1d('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0e1d('0x5')]},'customerPort':{'type':Sequelize[_0x0e1d('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x0e1d('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x0e1d('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0e1d('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2d2e25b..7822216 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 _0x645f=['find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','format','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','System','[%s]\x20%s:\x20%s\x0a','createdAt','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','ChatInteractionId','includeAgent','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','root','files','tmp','server','attachments','transcript-%d-%s.zip','CmContact','lastName','direction','secret','read','Account','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','value','views','transcript-','rimraf','zip-dir','moment','bluebird','mustache','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','fieldName','type','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','options'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x645f,0x8f));var _0xf645=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x645f[_0x122ef9];return _0x42fba0;};'use strict';var rimraf=require(_0xf645('0x0'));var zipdir=require(_0xf645('0x1'));var rp=require('request-promise');var moment=require(_0xf645('0x2'));var BPromise=require(_0xf645('0x3'));var Mustache=require(_0xf645('0x4'));var util=require('util');var path=require(_0xf645('0x5'));var ejs=require(_0xf645('0x6'));var fs=require('fs');var _=require(_0xf645('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xf645('0x8'));var pdf=require(_0xf645('0x9'));var logger=require(_0xf645('0xa'))('api');var config=require(_0xf645('0xb'));var db=require(_0xf645('0xc'))['db'];config[_0xf645('0xd')]=_['defaults'](config[_0xf645('0xd')],{'host':_0xf645('0xe'),'port':0x18eb});var socket=require(_0xf645('0xf'))(new Redis(config[_0xf645('0xd')]));require(_0xf645('0x10'))['register'](socket);var jayson=require(_0xf645('0x11'));var client=jayson[_0xf645('0x12')]['http']({'port':0x232b});var client9004=jayson['client'][_0xf645('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x2eea3d,_0x3555c5,_0x43313b,_0x19ade0){return new BPromise(function(_0x1ae5c6,_0x16a810){var _0x5f31af=_0x19ade0||client;return _0x5f31af[_0xf645('0x14')](_0x2eea3d,_0x43313b)[_0xf645('0x15')](function(_0x129414){logger[_0xf645('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3555c5,_0xf645('0x17'));logger[_0xf645('0x18')](_0xf645('0x19'),_0x3555c5,_0xf645('0x17'),JSON[_0xf645('0x1a')](_0x129414));if(_0x129414['error']){if(_0x129414[_0xf645('0x1b')][_0xf645('0x1c')]===0x1f4){logger['error'](_0xf645('0x1d'),_0x3555c5,_0x129414[_0xf645('0x1b')][_0xf645('0x1e')]);return _0x16a810(_0x129414[_0xf645('0x1b')][_0xf645('0x1e')]);}logger['error'](_0xf645('0x1d'),_0x3555c5,_0x129414[_0xf645('0x1b')][_0xf645('0x1e')]);return _0x1ae5c6(_0x129414[_0xf645('0x1b')]['message']);}else{logger[_0xf645('0x16')](_0xf645('0x1d'),_0x3555c5,_0xf645('0x17'));_0x1ae5c6(_0x129414[_0xf645('0x1f')][_0xf645('0x1e')]);}})[_0xf645('0x20')](function(_0x238c8b){logger[_0xf645('0x1b')](_0xf645('0x1d'),_0x3555c5,_0x238c8b);_0x16a810(_0x238c8b);});});}function respondWithStatusCode(_0xaebc3d,_0x2c6810){_0x2c6810=_0x2c6810||0xcc;return function(_0x48929){if(_0x48929){return _0xaebc3d[_0xf645('0x21')](_0x2c6810);}return _0xaebc3d['status'](_0x2c6810)['end']();};}function respondWithResult(_0x1520b5,_0x12298c){_0x12298c=_0x12298c||0xc8;return function(_0x3b7c2d){if(_0x3b7c2d){return _0x1520b5[_0xf645('0x22')](_0x12298c)['json'](_0x3b7c2d);}};}function respondWithFilteredResult(_0x258425,_0x65c09b){return function(_0x55fa31){if(_0x55fa31){var _0x4c54f6=typeof _0x65c09b[_0xf645('0x23')]===_0xf645('0x24')&&typeof _0x65c09b[_0xf645('0x25')]===_0xf645('0x24');var _0x42654e=_0x55fa31['count'];var _0xa4e6a9=_0x4c54f6?0x0:_0x65c09b[_0xf645('0x23')];var _0x348d9e=_0x4c54f6?_0x55fa31['count']:_0x65c09b[_0xf645('0x23')]+_0x65c09b[_0xf645('0x25')];var _0x4f7854;if(_0x348d9e>=_0x42654e){_0x348d9e=_0x42654e;_0x4f7854=0xc8;}else{_0x4f7854=0xce;}_0x258425[_0xf645('0x22')](_0x4f7854);return _0x258425['set'](_0xf645('0x26'),_0xa4e6a9+'-'+_0x348d9e+'/'+_0x42654e)['json'](_0x55fa31);}return null;};}function saveUpdates(_0x438d2f){return function(_0x304831){if(_0x304831){return _0x304831[_0xf645('0x27')](_0x438d2f)[_0xf645('0x15')](function(_0x54efa4){return _0x54efa4;});}return null;};}function removeEntity(_0x551faa){return function(_0x36cb6a){if(_0x36cb6a){return _0x36cb6a[_0xf645('0x28')]()[_0xf645('0x15')](function(){_0x551faa[_0xf645('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1086d2){return function(_0x46522e){if(!_0x46522e){_0x1086d2[_0xf645('0x21')](0x194);}return _0x46522e;};}function handleError(_0x423564,_0x4a92d0){_0x4a92d0=_0x4a92d0||0x1f4;return function(_0x2855c9){logger[_0xf645('0x1b')](_0x2855c9[_0xf645('0x29')]);if(_0x2855c9[_0xf645('0x2a')]){delete _0x2855c9[_0xf645('0x2a')];}_0x423564[_0xf645('0x22')](_0x4a92d0)[_0xf645('0x2b')](_0x2855c9);};}function getMustacheRender(_0x49313b,_0x4ab0a0){return Mustache[_0xf645('0x2c')](_0x49313b,_[_0xf645('0x2d')](_0x4ab0a0[_0xf645('0x2e')],{'contact':_0x4ab0a0[_0xf645('0x2f')],'message':_0x4ab0a0[_0xf645('0x1e')],'agent':_0x4ab0a0[_0xf645('0x30')],'interaction':_0x4ab0a0[_0xf645('0x31')],'account':_0x4ab0a0[_0xf645('0x32')]}))||'';}exports[_0xf645('0x33')]=function(_0x270a53,_0x3582e2){var _0x51925d={};var _0x107c5e=_[_0xf645('0x34')](db['ChatInteraction']['rawAttributes'],function(_0x50b3c5){return{'name':_0x50b3c5[_0xf645('0x35')],'type':_0x50b3c5[_0xf645('0x36')]['key']};});_0x51925d=qs[_0xf645('0x37')](_0x107c5e,_0x270a53);return interaction[_0xf645('0x38')](_0xf645('0x39'),_0x270a53[_0xf645('0x3a')],_0x270a53[_0xf645('0x3b')],_0x51925d,_0x107c5e)[_0xf645('0x15')](respondWithFilteredResult(_0x3582e2,_0x51925d))[_0xf645('0x20')](handleError(_0x3582e2,null));};exports[_0xf645('0x3c')]=function(_0xec563e,_0x6f290c){var _0x6ce810={'raw':![],'where':{'id':_0xec563e[_0xf645('0x3d')]['id']}},_0x173d30={};_0x173d30[_0xf645('0x3e')]=_[_0xf645('0x3f')](db[_0xf645('0x40')][_0xf645('0x41')]);_0x173d30[_0xf645('0x3a')]=_[_0xf645('0x3f')](_0xec563e[_0xf645('0x3a')]);_0x173d30[_0xf645('0x42')]=_[_0xf645('0x43')](_0x173d30[_0xf645('0x3e')],_0x173d30[_0xf645('0x3a')]);_0x6ce810[_0xf645('0x44')]=_[_0xf645('0x43')](_0x173d30[_0xf645('0x3e')],qs[_0xf645('0x45')](_0xec563e[_0xf645('0x3a')]['fields']));_0x6ce810[_0xf645('0x44')]=_0x6ce810[_0xf645('0x44')][_0xf645('0x46')]?_0x6ce810['attributes']:_0x173d30[_0xf645('0x3e')];if(_0xec563e[_0xf645('0x3a')][_0xf645('0x47')]){_0x6ce810[_0xf645('0x48')]=[{'all':!![]}];}_0x6ce810=_[_0xf645('0x2d')]({},_0x6ce810,_0xec563e[_0xf645('0x49')]);return db['ChatInteraction'][_0xf645('0x4a')](_0x6ce810)['then'](handleEntityNotFound(_0x6f290c,null))[_0xf645('0x15')](respondWithResult(_0x6f290c,null))[_0xf645('0x20')](handleError(_0x6f290c,null));};exports[_0xf645('0x4b')]=function(_0x14a771,_0x5e2190){return db[_0xf645('0x40')][_0xf645('0x4b')](_0x14a771['body'],{})['then'](respondWithResult(_0x5e2190,0xc9))[_0xf645('0x20')](handleError(_0x5e2190,null));};exports[_0xf645('0x27')]=function(_0x511b51,_0x5008b2){if(_0x511b51[_0xf645('0x2e')]['id']){delete _0x511b51[_0xf645('0x2e')]['id'];}return db['ChatInteraction'][_0xf645('0x4a')]({'where':{'id':_0x511b51[_0xf645('0x3d')]['id']}})[_0xf645('0x15')](handleEntityNotFound(_0x5008b2,null))['then'](saveUpdates(_0x511b51[_0xf645('0x2e')],null))[_0xf645('0x15')](respondWithResult(_0x5008b2,null))['catch'](handleError(_0x5008b2,null));};exports[_0xf645('0x28')]=function(_0x4280d4,_0x4a4b48){return db['ChatInteraction'][_0xf645('0x4a')]({'where':{'id':_0x4280d4[_0xf645('0x3d')]['id']}})[_0xf645('0x15')](handleEntityNotFound(_0x4a4b48,null))[_0xf645('0x15')](removeEntity(_0x4a4b48,null))[_0xf645('0x20')](handleError(_0x4a4b48,null));};exports[_0xf645('0x4c')]=function(_0x142518,_0x4fb3dd){return db[_0xf645('0x40')]['describe']()[_0xf645('0x15')](respondWithResult(_0x4fb3dd,null))['catch'](handleError(_0x4fb3dd,null));};exports[_0xf645('0x4d')]=function(_0x4063fe,_0x37c949){var _0x2e62c4=_0x4063fe[_0xf645('0x3d')]['id'];var _0x1bd333;var _0xb02d4c;var _0xdac084;return db[_0xf645('0x40')][_0xf645('0x4e')]({'where':{'id':_0x2e62c4}})[_0xf645('0x15')](function(_0x26b9ff){_0x1bd333=_0x26b9ff;return db[_0xf645('0x4f')][_0xf645('0x4e')]({'where':{'id':_0x26b9ff[_0xf645('0x50')]},'attributes':['id',_0xf645('0x51'),'vidaooEscalation','vidaooTopic',_0xf645('0x52'),'vidaooMetadata'],'raw':!![]});})[_0xf645('0x15')](function(_0xd691ed){if(_0xd691ed&&_0xd691ed['vidaooApiKey']&&_0xd691ed[_0xf645('0x53')]){_0xb02d4c=_0xd691ed;var _0x484db6={'interaction':{'id':_0x2e62c4},'agent':{'id':_0x4063fe[_0xf645('0x3b')]['id'],'name':_0x4063fe[_0xf645('0x3b')]['name'],'fullname':_0x4063fe[_0xf645('0x3b')][_0xf645('0x54')],'email':_0x4063fe[_0xf645('0x3b')][_0xf645('0x55')]},'contact':_0x4063fe['body'][_0xf645('0x2f')],'account':_0x4063fe[_0xf645('0x2e')][_0xf645('0x32')]};var _0x441a79={'rejectUnauthorized':![],'method':_0xf645('0x56'),'url':_0xf645('0x57'),'headers':{'X-APIKEY':_0xd691ed[_0xf645('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4063fe['user'][_0xf645('0x55')]],'buttons':null,'topic':_0xb02d4c[_0xf645('0x58')],'note':_[_0xf645('0x59')](_0xb02d4c[_0xf645('0x52')])?null:getMustacheRender(_0xb02d4c[_0xf645('0x52')],_0x484db6),'metadata':null},'redirect':_0xf645('0x5a'),'json':!![]};try{if(!_['isNull'](_0xb02d4c[_0xf645('0x5b')])){var _0x3d43b4=getMustacheRender(_0xb02d4c[_0xf645('0x5b')],_0x484db6);var _0x5ae207=JSON[_0xf645('0x5c')](_0x3d43b4);_0x441a79['body'][_0xf645('0x5d')]=_0x5ae207;}}catch(_0xa5a78d){throw new db[(_0xf645('0x5e'))]['ValidationError'](_0xf645('0x5f'));}return rp(_0x441a79);}else{throw new db['Sequelize'][(_0xf645('0x60'))](_0xf645('0x61'));}})[_0xf645('0x15')](function(_0x2c018a){_0xdac084=_0x2c018a;if(_0xdac084['id']){var _0x221e1b={'body':_0xdac084[_0xf645('0x62')],'ChatWebsiteId':_0xb02d4c['id'],'ChatInteractionId':_0x1bd333['id'],'direction':_0xf645('0x63'),'UserId':_0x4063fe[_0xf645('0x3b')]['id']};return db[_0xf645('0x64')][_0xf645('0x4b')](_0x221e1b,{});}else{throw new db[(_0xf645('0x5e'))][(_0xf645('0x60'))](_0xf645('0x65'));}})['then'](function(){return _0x1bd333['updateAttributes']({'vidaooSessionId':_0xdac084['id']});})[_0xf645('0x15')](respondWithResult(_0x37c949,null))[_0xf645('0x20')](handleError(_0x37c949,null));};exports[_0xf645('0x66')]=function(_0x15b4b5,_0x5a4247){if(_0x15b4b5[_0xf645('0x2e')]['id']){delete _0x15b4b5[_0xf645('0x2e')]['id'];}return db[_0xf645('0x40')][_0xf645('0x4a')]({'where':{'id':_0x15b4b5[_0xf645('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xf645('0x67')}]})['then'](handleEntityNotFound(_0x5a4247,null))[_0xf645('0x15')](saveUpdates(_0x15b4b5['body'],null))['then'](respondWithResult(_0x5a4247,null))['catch'](handleError(_0x5a4247,null));};exports[_0xf645('0x68')]=function(_0x3efb83,_0x50e28a){if(_0x3efb83[_0xf645('0x2e')]['id']){delete _0x3efb83['body']['id'];}return db[_0xf645('0x40')][_0xf645('0x4a')]({'where':{'id':_0x3efb83[_0xf645('0x3d')]['id']}})[_0xf645('0x15')](function(_0x2b4a69){if(!_0x2b4a69){logger[_0xf645('0x1b')](_0xf645('0x69'),_0xf645('0x68'),0x194,_0xf645('0x6a'));_0x50e28a[_0xf645('0x21')](0x194);}else{if(_0x2b4a69[_0xf645('0x6b')]){throw new db['Sequelize'][(_0xf645('0x60'))](_0xf645('0x6c'));}}return _0x2b4a69;})[_0xf645('0x15')](function(_0x5d607b){if(_0x5d607b){return _0x5d607b[_0xf645('0x27')]({'closed':_0x3efb83['body'][_0xf645('0x6d')],'disposition':_0x3efb83[_0xf645('0x2e')][_0xf645('0x6e')]})[_0xf645('0x15')](function(_0x4b2b2a){return _0x4b2b2a;});}})[_0xf645('0x15')](function(){return respondWithRpcPromise(_0xf645('0x6f'),'abandon',_0x3efb83[_0xf645('0x2e')],client9004);})[_0xf645('0x15')](respondWithResult(_0x50e28a,null))[_0xf645('0x20')](handleError(_0x50e28a,null));};exports[_0xf645('0x70')]=function(_0xde7024,_0x112ba9){_0xde7024['body'][_0xf645('0x2a')]=_0xde7024[_0xf645('0x71')][_0xf645('0x72')];_0xde7024[_0xf645('0x2e')]['basename']=_0xde7024['file'][_0xf645('0x73')];_0xde7024['body'][_0xf645('0x36')]=_0xde7024['file'][_0xf645('0x74')];return db[_0xf645('0x75')][_0xf645('0x4b')](_0xde7024['body'])[_0xf645('0x15')](respondWithResult(_0x112ba9,0xc9))[_0xf645('0x20')](handleError(_0x112ba9,null));};exports[_0xf645('0x76')]=function(_0x200a0e,_0x21fc34){return db['ChatInteraction'][_0xf645('0x4e')]({'where':{'id':_0x200a0e[_0xf645('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x21fc34,null))['then'](function(_0x4e9bd1){if(_0x4e9bd1){if(_0x4e9bd1[_0xf645('0x6d')]){return _0x21fc34['status'](0x193)[_0xf645('0x77')]({'status':0x193,'message':_0xf645('0x78')});}return db[_0xf645('0x75')][_0xf645('0x4e')]({'where':{'id':_0x200a0e[_0xf645('0x3a')][_0xf645('0x79')]},'raw':!![]})[_0xf645('0x15')](handleEntityNotFound(_0x21fc34,null));}})[_0xf645('0x15')](function(_0x574537){if(_0x574537){var _0x43d912=_0x574537['ChatOfflineMessageId']!==null;var _0xcd0df4=path[_0xf645('0x7a')](config['root'],_0xf645('0x7b'));if(_0x43d912){_0xcd0df4=path[_0xf645('0x7a')](_0xcd0df4,_0xf645('0x7c'));}var _0x44bc61=path['join'](_0xcd0df4,_0x574537[_0xf645('0x7d')]);return _0x21fc34[_0xf645('0x7e')](_0x44bc61);}})['catch'](handleError(_0x21fc34,null));};exports[_0xf645('0x7f')]=function(_0x7a472c,_0x18bb0a){var _0x5818c0=null;var _0x1d7ac7=null;var _0x4f9aa9=null;if(_0x7a472c[_0xf645('0x2e')]['id']){delete _0x7a472c[_0xf645('0x2e')]['id'];}if(_0x7a472c[_0xf645('0x2e')][_0xf645('0x80')]){_0x4f9aa9=path[_0xf645('0x7a')](config['root'],_0xf645('0x81'),util['format'](_0xf645('0x82'),Date[_0xf645('0x83')]()));_0x7a472c[_0xf645('0x2e')][_0xf645('0x84')]=_0x4f9aa9;}return db['ChatInteraction'][_0xf645('0x4a')]({'where':{'id':_0x7a472c[_0xf645('0x3d')]['id']},'include':[{'model':db[_0xf645('0x64')],'as':_0xf645('0x85'),'include':[{'model':db[_0xf645('0x86')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x18bb0a,null))['then'](saveUpdates(_0x7a472c[_0xf645('0x2e')],null))[_0xf645('0x15')](function(_0x2c7f53){if(_0x2c7f53){_0x5818c0=_0x2c7f53;return db[_0xf645('0x4f')]['find']({'where':{'id':_0x5818c0[_0xf645('0x50')]}});}})[_0xf645('0x15')](function(_0x37653c){if(_0x37653c){_0x1d7ac7=_0x37653c;return db['CmContact'][_0xf645('0x4a')]({'where':{'id':_0x5818c0[_0xf645('0x87')]}});}})['then'](function(_0x515cef){if(_0x515cef){if(_0x4f9aa9){var _0x12b369=null;for(var _0x2cd961=0x1;_0x2cd961<_0x5818c0['Messages'][_0xf645('0x46')];++_0x2cd961){_0x12b369=_0x5818c0['Messages'][_0x2cd961];var _0x1f8811=_0x12b369[_0xf645('0x6b')]?util[_0xf645('0x88')](_0xf645('0x89'),_0x1d7ac7[_0xf645('0x8a')],_0x12b369[_0xf645('0x6b')]):'System';var _0x27b53a=_0x7a472c['body'][_0xf645('0x8b')]||util[_0xf645('0x88')]('%s%d',_0xf645('0x8c'),_0x12b369[_0xf645('0x87')]);switch(_0x1d7ac7[_0xf645('0x8d')]){case _0xf645('0x8e'):_0x1f8811=_0x12b369['UserId']?util[_0xf645('0x88')](_0xf645('0x89'),_0x1d7ac7[_0xf645('0x8a')],_0x12b369[_0xf645('0x6b')]):'System';break;case _0xf645('0x8f'):_0x1f8811=_0x12b369[_0xf645('0x6b')]?_0x12b369[_0xf645('0x86')][_0xf645('0x90')]||_0x12b369[_0xf645('0x86')][_0xf645('0x54')]:'System';break;case _0xf645('0x91'):_0x1f8811=_0x12b369[_0xf645('0x6b')]?_0x12b369['User'][_0xf645('0x54')]:_0xf645('0x92');break;default:_0x1f8811=_0x12b369[_0xf645('0x6b')]?util[_0xf645('0x88')](_0xf645('0x89'),_0x1d7ac7[_0xf645('0x8a')],_0x12b369[_0xf645('0x6b')]):_0xf645('0x92');}var _0x50d808=util[_0xf645('0x88')](_0xf645('0x93'),moment(_0x12b369[_0xf645('0x94')])[_0xf645('0x88')]('MM/DD/YYYY\x20HH:mm:ss'),_0x12b369['direction']==='in'?_0x27b53a:_0x1f8811,_0x12b369[_0xf645('0x2e')]);if(!_0x12b369['secret']){fs[_0xf645('0x95')](_0x4f9aa9,_0x50d808);}}return db[_0xf645('0x96')][_0xf645('0x4e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf645('0x97'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf645('0x98'),'raw':!![]}]}]});}}})[_0xf645('0x15')](function(_0x2cb5d9){if(!_0x2cb5d9||!_0x2cb5d9[_0xf645('0x97')]||!_0x7a472c[_0xf645('0x2e')])return _0x5818c0;var _0x2298ae=_0x2cb5d9[_0xf645('0x99')]();return respondWithRpcPromise(_0xf645('0x9a'),_0xf645('0x9b'),{'account':_0x2298ae,'message':{'from':util[_0xf645('0x88')](_0xf645('0x9c'),_0x2cb5d9['name'],_0x2cb5d9['email']||_0x2cb5d9['Smtp'][_0xf645('0x3b')]),'to':_0x7a472c[_0xf645('0x2e')][_0xf645('0x80')],'subject':_0xf645('0x9d'),'text':util[_0xf645('0x88')](_0xf645('0x9e'),_0x7a472c[_0xf645('0x2e')][_0xf645('0x80')]),'attachments':[{'path':_0x4f9aa9}]}})['then'](function(){return _0x5818c0;})[_0xf645('0x20')](function(_0x36e053){logger[_0xf645('0x1b')](_0x36e053);});})[_0xf645('0x15')](respondWithStatusCode(_0x18bb0a,0xc8))[_0xf645('0x20')](handleError(_0x18bb0a,null));};exports[_0xf645('0x9f')]=function(_0xe4e6f7,_0x394c11){return db[_0xf645('0x64')][_0xf645('0x4a')]({'where':{'id':_0xe4e6f7['params']['id']}})[_0xf645('0x15')](handleEntityNotFound(_0x394c11,null))['then'](function(_0x1a0ba5){if(_0x1a0ba5){return _0x1a0ba5[_0xf645('0x9f')](_0xe4e6f7[_0xf645('0x2e')][_0xf645('0xa0')],_[_0xf645('0xa1')](_0xe4e6f7[_0xf645('0x2e')],[_0xf645('0xa0'),'id'])||{});}})[_0xf645('0x15')](respondWithResult(_0x394c11,null))[_0xf645('0x20')](handleError(_0x394c11,null));};exports[_0xf645('0xa2')]=function(_0x39ade1,_0x1c034b){var _0x410dba={'raw':![],'where':{}};var _0x24e6f={};var _0x5a6cb3={'count':0x0,'rows':[]};return db[_0xf645('0x40')][_0xf645('0x4e')]({'where':{'id':_0x39ade1[_0xf645('0x3d')]['id']}})[_0xf645('0x15')](handleEntityNotFound(_0x1c034b,null))[_0xf645('0x15')](function(_0x188057){if(_0x188057){_0x24e6f[_0xf645('0x3e')]=_[_0xf645('0x3f')](db[_0xf645('0x64')]['rawAttributes']);_0x24e6f[_0xf645('0x3a')]=_[_0xf645('0x3f')](_0x39ade1['query']);_0x24e6f[_0xf645('0x42')]=_[_0xf645('0x43')](_0x24e6f[_0xf645('0x3e')],_0x24e6f[_0xf645('0x3a')]);_0x410dba['attributes']=_['intersection'](_0x24e6f['model'],qs['fields'](_0x39ade1[_0xf645('0x3a')]['fields']));_0x410dba['attributes']=_0x410dba[_0xf645('0x44')][_0xf645('0x46')]?_0x410dba['attributes']:_0x24e6f[_0xf645('0x3e')];if(!_0x39ade1['query'][_0xf645('0xa3')](_0xf645('0xa4'))){_0x410dba[_0xf645('0x25')]=qs['limit'](_0x39ade1[_0xf645('0x3a')][_0xf645('0x25')]);_0x410dba[_0xf645('0x23')]=qs[_0xf645('0x23')](_0x39ade1[_0xf645('0x3a')]['offset']);}_0x410dba[_0xf645('0xa5')]=qs['sort'](_0x39ade1[_0xf645('0x3a')][_0xf645('0xa6')]);_0x410dba[_0xf645('0xa7')]=qs['filters'](_[_0xf645('0xa8')](_0x39ade1['query'],_0x24e6f[_0xf645('0x42')]));_0x410dba['where']['ChatInteractionId']=_0x188057['id'];if(_0x39ade1[_0xf645('0x3a')][_0xf645('0xa9')]){_0x410dba[_0xf645('0xa7')]=_['merge'](_0x410dba[_0xf645('0xa7')],{'$or':_['map'](_0x410dba[_0xf645('0x44')],function(_0x553a36){var _0x254e38={};_0x254e38[_0x553a36]={'$like':'%'+_0x39ade1[_0xf645('0x3a')][_0xf645('0xa9')]+'%'};return _0x254e38;})});}if(_0x39ade1[_0xf645('0x3a')][_0xf645('0xaa')]){var _0x2873ac=_0x39ade1[_0xf645('0x3a')]['$gte'][_0xf645('0xab')](',');var _0x1b34be={};_0x1b34be[_0x2873ac[0x0]]={'$gte':moment(_0x2873ac[0x1])[_0xf645('0x88')](_0xf645('0xac'))};_0x410dba['where']=_[_0xf645('0x2d')](_0x410dba[_0xf645('0xa7')],_0x1b34be);}_0x410dba=_['merge']({},_0x410dba,_0x39ade1[_0xf645('0x49')]);return db['ChatMessage'][_0xf645('0xad')]({'where':_0x410dba[_0xf645('0xa7')]})[_0xf645('0x15')](function(_0xeab5e1){_0x5a6cb3[_0xf645('0xad')]=_0xeab5e1;if(_0x39ade1[_0xf645('0x3a')]['includeAll']){_0x410dba['include']=[{'all':!![]}];}return db[_0xf645('0x64')][_0xf645('0x38')](_0x410dba);})[_0xf645('0x15')](function(_0x4f3707){_0x5a6cb3['rows']=_0x4f3707;return _0x5a6cb3;});}})[_0xf645('0x15')](respondWithFilteredResult(_0x1c034b,_0x410dba))[_0xf645('0x20')](handleError(_0x1c034b,null));};exports['getMyMessages']=function(_0x6339c4,_0x2f38a){var _0xfcd360={'where':{}},_0x13d53c={},_0x29b982={'count':0x0,'rows':[]};return db[_0xf645('0x40')][_0xf645('0x4e')]({'where':{'id':_0x6339c4['params']['id']}})[_0xf645('0x15')](handleEntityNotFound(_0x2f38a,null))['then'](function(_0xe440e5){if(_0xe440e5){_0x13d53c[_0xf645('0x3e')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x13d53c[_0xf645('0x3a')]=_[_0xf645('0x3f')](_0x6339c4[_0xf645('0x3a')]);_0x13d53c[_0xf645('0x42')]=_[_0xf645('0x43')](_0x13d53c[_0xf645('0x3e')],_0x13d53c[_0xf645('0x3a')]);_0xfcd360[_0xf645('0x44')]=_[_0xf645('0x43')](_0x13d53c[_0xf645('0x3e')],qs[_0xf645('0x45')](_0x6339c4[_0xf645('0x3a')][_0xf645('0x45')]));_0xfcd360[_0xf645('0x44')]=_0xfcd360[_0xf645('0x44')][_0xf645('0x46')]?_0xfcd360[_0xf645('0x44')]:_0x13d53c['model'];if(!_0x6339c4['query'][_0xf645('0xa3')](_0xf645('0xa4'))){_0xfcd360[_0xf645('0x25')]=qs['limit'](_0x6339c4['query']['limit']);_0xfcd360[_0xf645('0x23')]=qs['offset'](_0x6339c4[_0xf645('0x3a')][_0xf645('0x23')]);}_0xfcd360[_0xf645('0xa5')]=qs['sort'](_0x6339c4[_0xf645('0x3a')][_0xf645('0xa6')]);_0xfcd360[_0xf645('0xa7')]=qs[_0xf645('0x42')](_[_0xf645('0xa8')](_0x6339c4[_0xf645('0x3a')],_0x13d53c[_0xf645('0x42')]));_0xfcd360[_0xf645('0xa7')][_0xf645('0xae')]=_0xe440e5['id'];if(_0x6339c4[_0xf645('0x3a')][_0xf645('0xa9')]){_0xfcd360['where']=_[_0xf645('0x2d')](_0xfcd360[_0xf645('0xa7')],{'$or':_[_0xf645('0x34')](_0xfcd360['attributes'],function(_0x582fb7){var _0x3ba899={};_0x3ba899[_0x582fb7]={'$like':'%'+_0x6339c4['query'][_0xf645('0xa9')]+'%'};return _0x3ba899;})});}_0xfcd360[_0xf645('0xa7')]['secret']=![];if(_0x6339c4['query']['id']){_0xfcd360[_0xf645('0xa7')]['id']={'$gt':_0x6339c4[_0xf645('0x3a')]['id']};}_0xfcd360=_['merge']({},_0xfcd360,_0x6339c4[_0xf645('0x49')]);return db[_0xf645('0x64')][_0xf645('0xad')]({'where':_0xfcd360[_0xf645('0xa7')]})[_0xf645('0x15')](function(_0x4ac6d7){_0x29b982[_0xf645('0xad')]=_0x4ac6d7;_0xfcd360[_0xf645('0x48')]=[];if(_0x6339c4[_0xf645('0x3a')][_0xf645('0xaf')]){_0xfcd360[_0xf645('0x48')][_0xf645('0xb0')]({'model':db['User'],'as':_0xf645('0x86'),'attributes':['id','fullname',_0xf645('0x90')]});}if(_0x6339c4[_0xf645('0x3a')][_0xf645('0x47')]){_0xfcd360[_0xf645('0x48')]=[{'all':!![]}];}return db[_0xf645('0x64')]['findAll'](_0xfcd360);})[_0xf645('0x15')](function(_0x3b263c){_0x29b982['rows']=_0x3b263c;return _0x29b982;});}})[_0xf645('0x15')](respondWithFilteredResult(_0x2f38a,_0xfcd360))[_0xf645('0x20')](handleError(_0x2f38a,null));};exports[_0xf645('0xb1')]=function(_0x2e4714,_0x4e7d1c){return db[_0xf645('0x40')][_0xf645('0x4a')]({'where':{'id':_0x2e4714[_0xf645('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4e7d1c,null))[_0xf645('0x15')](function(_0x3301bc){if(_0x3301bc){return _0x3301bc[_0xf645('0xb2')](_0x2e4714[_0xf645('0x2e')][_0xf645('0xa0')],_[_0xf645('0xa1')](_0x2e4714[_0xf645('0x2e')],[_0xf645('0xa0'),'id'])||{})[_0xf645('0xb3')](function(){return db[_0xf645('0xb4')][_0xf645('0x38')]({'attributes':['id','name',_0xf645('0xb5')],'where':{'id':_0x2e4714[_0xf645('0x2e')][_0xf645('0xa0')]}});})['then'](function(_0xd3c69d){socket[_0xf645('0xb6')](_0xf645('0xb7'),{'id':Number(_0x2e4714['params']['id']),'tags':_0xd3c69d||[]});return{'id':Number(_0x2e4714[_0xf645('0x3d')]['id']),'tags':_0xd3c69d||[]};});}})[_0xf645('0x15')](respondWithResult(_0x4e7d1c,null))[_0xf645('0x20')](handleError(_0x4e7d1c,null));};exports[_0xf645('0xb8')]=function(_0x28937c,_0x5b4a46){return db[_0xf645('0x40')][_0xf645('0x4a')]({'where':{'id':_0x28937c[_0xf645('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b4a46,null))[_0xf645('0x15')](function(_0x212a60){if(_0x212a60){return _0x212a60[_0xf645('0xb8')](_0x28937c[_0xf645('0x3a')][_0xf645('0xa0')]);}})[_0xf645('0x15')](respondWithStatusCode(_0x5b4a46,null))[_0xf645('0x20')](handleError(_0x5b4a46,null));};exports[_0xf645('0x7e')]=function(_0x43eaea,_0x1ebf31){var _0x56720f=moment()[_0xf645('0xb9')]()[_0xf645('0xba')]();var _0x26c0d5=path[_0xf645('0x7a')](config[_0xf645('0xbb')],'server',_0xf645('0xbc'),_0xf645('0xbd'));var _0x5e1a42=path['join'](config[_0xf645('0xbb')],_0xf645('0xbe'),_0xf645('0xbc'),_0xf645('0xbf'));var _0x20910c=path['join'](_0x26c0d5,_0x56720f);var _0x483b07=util[_0xf645('0x88')](_0xf645('0xc0'),_0x43eaea['params']['id'],_0x56720f);var _0x53ed3a=path[_0xf645('0x7a')](_0x26c0d5,_0x483b07);var _0x280a9c=[];_0x280a9c[_0xf645('0xb0')]({'model':db[_0xf645('0x86')],'as':_0xf645('0x86'),'attributes':['id',_0xf645('0x54')],'raw':!![]});_0x280a9c['push']({'model':db[_0xf645('0xc1')],'as':_0xf645('0x67'),'attributes':['id','firstName',_0xf645('0xc2')],'raw':!![]});if(_0x43eaea[_0xf645('0x3a')][_0xf645('0xbf')]){_0x280a9c['push']({'model':db[_0xf645('0x75')],'as':_0xf645('0x75'),'raw':!![]});}var _0xa36008=[{'model':db[_0xf645('0x64')],'as':'Messages','attributes':['id',_0xf645('0x2e'),_0xf645('0x94'),_0xf645('0xc3'),_0xf645('0xc4'),_0xf645('0xc5')],'include':_0x280a9c}];_0xa36008[_0xf645('0xb0')]({'model':db[_0xf645('0x4f')],'as':_0xf645('0xc6'),'attributes':['id',_0xf645('0x2a')]});_0xa36008['push']({'model':db['User'],'as':'Owner','attributes':['id',_0xf645('0x54')]});return db['ChatInteraction'][_0xf645('0x4a')]({'where':{'id':_0x43eaea[_0xf645('0x3d')]['id']},'include':_0xa36008})[_0xf645('0x15')](handleEntityNotFound(_0x1ebf31,null))[_0xf645('0x15')](function(_0x327e88){if(_0x327e88){var _0x2bd3a8=_0x327e88[_0xf645('0xc7')]({'plain':!![]});fs[_0xf645('0xc8')](_0x20910c);var _0x1e31ff={'channel':_0xf645('0xc9'),'account':_0x2bd3a8['Account'][_0xf645('0x2a')],'agent':_0x2bd3a8['Owner']?_0x2bd3a8['Owner'][_0xf645('0x54')]:_0xf645('0xca'),'createdAt':moment(_0x2bd3a8[_0xf645('0x94')])['format'](_0xf645('0xac'))['toString'](),'closedAt':_0x2bd3a8[_0xf645('0x6d')]?moment(_0x2bd3a8['closedAt'])[_0xf645('0x88')](_0xf645('0xac'))[_0xf645('0xba')]():'','disposition':_0x2bd3a8[_0xf645('0x6e')],'chatInfo':{'browser':_0x2bd3a8[_0xf645('0xcb')],'os':_0x2bd3a8[_0xf645('0xcc')],'referer':_0x2bd3a8[_0xf645('0xcd')],'customerIp':_0x2bd3a8[_0xf645('0xce')],'customerPort':_0x2bd3a8['customerPort']?_0x2bd3a8[_0xf645('0xcf')]:_0xf645('0xca')},'messages':_(_0x2bd3a8['Messages'])[_0xf645('0xd0')]()['filter']({'secret':![]})[_0xf645('0x34')](function(_0x381f16){if(_0x381f16['Attachment']){var _0x507eaf=path[_0xf645('0x7a')](_0x5e1a42,_0x381f16[_0xf645('0x75')][_0xf645('0x7d')]);if(fs[_0xf645('0xd1')](_0x507eaf)){fs[_0xf645('0xd2')](_0x507eaf)[_0xf645('0xd3')](fs[_0xf645('0xd4')](path['join'](_0x20910c,_0x381f16[_0xf645('0x75')][_0xf645('0x7d')])));}}return{'date':moment(_0x381f16[_0xf645('0x94')])[_0xf645('0x88')](_0xf645('0xac'))[_0xf645('0xba')](),'sender':_0x381f16[_0xf645('0xc3')]===_0xf645('0x63')?_0x381f16[_0xf645('0x86')]?_0x381f16[_0xf645('0x86')][_0xf645('0x54')]:_0xf645('0x92'):_0x381f16[_0xf645('0x67')][_0xf645('0xd5')]+(_0x381f16['Contact'][_0xf645('0xc2')]?'\x20'+_0x381f16['Contact']['lastName']:''),'body':_0x381f16[_0xf645('0x75')]?_0x381f16['Attachment'][_0xf645('0x7d')]:_0x381f16[_0xf645('0x2e')],'direction':_0x381f16[_0xf645('0xc3')]==='out'?'A':'C','secret':_0x381f16[_0xf645('0xc4')],'read':_0x381f16[_0xf645('0xc5')],'attachment':_0x381f16[_0xf645('0x75')]};})[_0xf645('0xd6')]()};return ejs['renderFile'](path[_0xf645('0x7a')](config[_0xf645('0xbb')],_0xf645('0xbe'),_0xf645('0xd7'),'downloadInteraction.ejs'),{'interaction':_0x1e31ff})[_0xf645('0x15')](function(_0xf3db3){var _0x4160bd=path[_0xf645('0x7a')](_0x20910c,_0xf645('0xd8')+_0x2bd3a8['id']+'-'+_0x56720f+'.pdf');var _0x837093={'path':_0x4160bd,'channel':'Chat','interactionId':_0x2bd3a8['id']};return pdf['createPdfFromHTML'](_0xf3db3,_0x837093);})[_0xf645('0x15')](function(){return new Promise(function(_0x320b00,_0x15a839){zipdir(_0x20910c,{'saveTo':_0x53ed3a},function(_0x38a8d2,_0x48e3bf){if(_0x38a8d2)return _0x15a839(_0x38a8d2);return _0x320b00(_0x48e3bf);});})['then'](function(){return new BPromise(function(_0x5e9ddd,_0x4c7840){rimraf(_0x20910c,function(_0x557ba8){if(_0x557ba8)_0x4c7840(_0x557ba8);return _0x5e9ddd();});});})[_0xf645('0x15')](function(){return _0x1ebf31[_0xf645('0x7e')](_0x53ed3a,_0x483b07,function(_0x2cedbe){if(_0x2cedbe){logger[_0xf645('0x1b')]('err',_0x2cedbe);}else{fs['unlinkSync'](_0x53ed3a);}});});});}else{return _0x1ebf31[_0xf645('0x21')](0xc8);}})['catch'](handleError(_0x1ebf31,null));}; \ No newline at end of file +var _0x76f1=['vidaooTopic','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','find','CmContact','UserId','disposition','abandon','attachmentUpload','file','originalname','filename','mimetype','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','basename','download','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','User','ContactId','format','customer','%s%d','Visitor','agentIdentifier','agentAlias','System','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','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','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','count','rows','getMyMessages','includeAgent','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','push','firstName','lastName','attachments','read','Account','get','mkdirSync','Chat','Owner','N.A.','createdAt','closedAt','osName','customerIp','customerPort','existsSync','createReadStream','createWriteStream','Contact','secret','value','views','downloadInteraction.ejs','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','request','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','update','destroy','then','end','stack','name','render','merge','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','key','findAll','chat','query','show','model','keys','attributes','intersection','fields','length','includeAll','include','create','body','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooMetadata','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x76f1,0x7b));var _0x176f=function(_0x55103c,_0x453b56){_0x55103c=_0x55103c-0x0;var _0x5ab744=_0x76f1[_0x55103c];return _0x5ab744;};'use strict';var rimraf=require(_0x176f('0x0'));var zipdir=require(_0x176f('0x1'));var rp=require(_0x176f('0x2'));var moment=require(_0x176f('0x3'));var BPromise=require(_0x176f('0x4'));var Mustache=require(_0x176f('0x5'));var util=require('util');var path=require(_0x176f('0x6'));var ejs=require(_0x176f('0x7'));var fs=require('fs');var _=require(_0x176f('0x8'));var Redis=require(_0x176f('0x9'));var interaction=require(_0x176f('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x176f('0xb'));var logger=require('../../config/logger')(_0x176f('0xc'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x176f('0xd')]=_['defaults'](config[_0x176f('0xd')],{'host':_0x176f('0xe'),'port':0x18eb});var socket=require(_0x176f('0xf'))(new Redis(config[_0x176f('0xd')]));require(_0x176f('0x10'))['register'](socket);var jayson=require(_0x176f('0x11'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x176f('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x598b14,_0x16f2a6,_0x38b4d0,_0x3d2f6e){return new BPromise(function(_0x2f3065,_0x1bf783){var _0x3adef1=_0x3d2f6e||client;return _0x3adef1[_0x176f('0x13')](_0x598b14,_0x38b4d0)['then'](function(_0x4508f7){logger[_0x176f('0x14')](_0x176f('0x15'),_0x16f2a6,'request\x20sent');logger[_0x176f('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x16f2a6,_0x176f('0x17'),JSON[_0x176f('0x18')](_0x4508f7));if(_0x4508f7[_0x176f('0x19')]){if(_0x4508f7[_0x176f('0x19')][_0x176f('0x1a')]===0x1f4){logger['error'](_0x176f('0x15'),_0x16f2a6,_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);return _0x1bf783(_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);}logger['error'](_0x176f('0x15'),_0x16f2a6,_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);return _0x2f3065(_0x4508f7[_0x176f('0x19')][_0x176f('0x1b')]);}else{logger[_0x176f('0x14')](_0x176f('0x15'),_0x16f2a6,_0x176f('0x17'));_0x2f3065(_0x4508f7[_0x176f('0x1c')][_0x176f('0x1b')]);}})[_0x176f('0x1d')](function(_0x5caa3a){logger['error'](_0x176f('0x15'),_0x16f2a6,_0x5caa3a);_0x1bf783(_0x5caa3a);});});}function respondWithStatusCode(_0x248d35,_0x2e324a){_0x2e324a=_0x2e324a||0xcc;return function(_0x26e8ca){if(_0x26e8ca){return _0x248d35[_0x176f('0x1e')](_0x2e324a);}return _0x248d35[_0x176f('0x1f')](_0x2e324a)['end']();};}function respondWithResult(_0x1e27bd,_0x247eb1){_0x247eb1=_0x247eb1||0xc8;return function(_0xf5a011){if(_0xf5a011){return _0x1e27bd[_0x176f('0x1f')](_0x247eb1)[_0x176f('0x20')](_0xf5a011);}};}function respondWithFilteredResult(_0x40e944,_0x55b7a8){return function(_0x4030d8){if(_0x4030d8){var _0x2e92d1=typeof _0x55b7a8[_0x176f('0x21')]===_0x176f('0x22')&&typeof _0x55b7a8[_0x176f('0x23')]===_0x176f('0x22');var _0x4a2e1c=_0x4030d8['count'];var _0x41d73d=_0x2e92d1?0x0:_0x55b7a8[_0x176f('0x21')];var _0x2fa014=_0x2e92d1?_0x4030d8['count']:_0x55b7a8[_0x176f('0x21')]+_0x55b7a8[_0x176f('0x23')];var _0x4d4b84;if(_0x2fa014>=_0x4a2e1c){_0x2fa014=_0x4a2e1c;_0x4d4b84=0xc8;}else{_0x4d4b84=0xce;}_0x40e944['status'](_0x4d4b84);return _0x40e944[_0x176f('0x24')](_0x176f('0x25'),_0x41d73d+'-'+_0x2fa014+'/'+_0x4a2e1c)[_0x176f('0x20')](_0x4030d8);}return null;};}function saveUpdates(_0x130f3e){return function(_0x375b0d){if(_0x375b0d){return _0x375b0d[_0x176f('0x26')](_0x130f3e)['then'](function(_0x88cda4){return _0x88cda4;});}return null;};}function removeEntity(_0x33df47){return function(_0x311491){if(_0x311491){return _0x311491[_0x176f('0x27')]()[_0x176f('0x28')](function(){_0x33df47[_0x176f('0x1f')](0xcc)[_0x176f('0x29')]();});}};}function handleEntityNotFound(_0x490f22){return function(_0x275db1){if(!_0x275db1){_0x490f22[_0x176f('0x1e')](0x194);}return _0x275db1;};}function handleError(_0x19b9d7,_0x3e86af){_0x3e86af=_0x3e86af||0x1f4;return function(_0x270136){logger[_0x176f('0x19')](_0x270136[_0x176f('0x2a')]);if(_0x270136[_0x176f('0x2b')]){delete _0x270136[_0x176f('0x2b')];}_0x19b9d7['status'](_0x3e86af)['send'](_0x270136);};}function getMustacheRender(_0x46b4e8,_0x536955){return Mustache[_0x176f('0x2c')](_0x46b4e8,_[_0x176f('0x2d')](_0x536955['body'],{'contact':_0x536955[_0x176f('0x2e')],'message':_0x536955[_0x176f('0x1b')],'agent':_0x536955[_0x176f('0x2f')],'interaction':_0x536955[_0x176f('0x30')],'account':_0x536955[_0x176f('0x31')]}))||'';}exports['index']=function(_0x3ac02d,_0x3f8983){var _0x201a1b={};var _0x57e9a6=_[_0x176f('0x32')](db[_0x176f('0x33')][_0x176f('0x34')],function(_0x126794){return{'name':_0x126794['fieldName'],'type':_0x126794[_0x176f('0x35')][_0x176f('0x36')]};});_0x201a1b=qs['getOptions'](_0x57e9a6,_0x3ac02d);return interaction[_0x176f('0x37')](_0x176f('0x38'),_0x3ac02d[_0x176f('0x39')],_0x3ac02d['user'],_0x201a1b,_0x57e9a6)[_0x176f('0x28')](respondWithFilteredResult(_0x3f8983,_0x201a1b))[_0x176f('0x1d')](handleError(_0x3f8983,null));};exports[_0x176f('0x3a')]=function(_0x5b0118,_0xf6a64d){var _0x2862f1={'raw':![],'where':{'id':_0x5b0118['params']['id']}},_0x45a80a={};_0x45a80a[_0x176f('0x3b')]=_[_0x176f('0x3c')](db[_0x176f('0x33')][_0x176f('0x34')]);_0x45a80a[_0x176f('0x39')]=_[_0x176f('0x3c')](_0x5b0118[_0x176f('0x39')]);_0x45a80a['filters']=_['intersection'](_0x45a80a[_0x176f('0x3b')],_0x45a80a[_0x176f('0x39')]);_0x2862f1[_0x176f('0x3d')]=_[_0x176f('0x3e')](_0x45a80a[_0x176f('0x3b')],qs['fields'](_0x5b0118[_0x176f('0x39')][_0x176f('0x3f')]));_0x2862f1[_0x176f('0x3d')]=_0x2862f1['attributes'][_0x176f('0x40')]?_0x2862f1['attributes']:_0x45a80a['model'];if(_0x5b0118[_0x176f('0x39')][_0x176f('0x41')]){_0x2862f1[_0x176f('0x42')]=[{'all':!![]}];}_0x2862f1=_['merge']({},_0x2862f1,_0x5b0118['options']);return db[_0x176f('0x33')]['find'](_0x2862f1)[_0x176f('0x28')](handleEntityNotFound(_0xf6a64d,null))[_0x176f('0x28')](respondWithResult(_0xf6a64d,null))[_0x176f('0x1d')](handleError(_0xf6a64d,null));};exports[_0x176f('0x43')]=function(_0x3627fb,_0x2c1b1f){return db['ChatInteraction']['create'](_0x3627fb[_0x176f('0x44')],{})[_0x176f('0x28')](respondWithResult(_0x2c1b1f,0xc9))[_0x176f('0x1d')](handleError(_0x2c1b1f,null));};exports[_0x176f('0x26')]=function(_0x5a00de,_0x37723c){if(_0x5a00de[_0x176f('0x44')]['id']){delete _0x5a00de['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5a00de[_0x176f('0x45')]['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x37723c,null))['then'](saveUpdates(_0x5a00de['body'],null))[_0x176f('0x28')](respondWithResult(_0x37723c,null))['catch'](handleError(_0x37723c,null));};exports['destroy']=function(_0x40e214,_0x1ca2f0){return db[_0x176f('0x33')]['find']({'where':{'id':_0x40e214['params']['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x1ca2f0,null))['then'](removeEntity(_0x1ca2f0,null))[_0x176f('0x1d')](handleError(_0x1ca2f0,null));};exports[_0x176f('0x46')]=function(_0xbbc702,_0x2b4cc5){return db[_0x176f('0x33')]['describe']()[_0x176f('0x28')](respondWithResult(_0x2b4cc5,null))[_0x176f('0x1d')](handleError(_0x2b4cc5,null));};exports[_0x176f('0x47')]=function(_0x25146e,_0x48bb58){var _0x11eeec=_0x25146e[_0x176f('0x45')]['id'];var _0x55f2fe;var _0xf496ce;var _0x5bfa8d;return db[_0x176f('0x33')][_0x176f('0x48')]({'where':{'id':_0x11eeec}})[_0x176f('0x28')](function(_0x1e488f){_0x55f2fe=_0x1e488f;return db[_0x176f('0x49')][_0x176f('0x48')]({'where':{'id':_0x1e488f[_0x176f('0x4a')]},'attributes':['id',_0x176f('0x4b'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x176f('0x4c')],'raw':!![]});})[_0x176f('0x28')](function(_0x3984b8){if(_0x3984b8&&_0x3984b8[_0x176f('0x4b')]&&_0x3984b8['vidaooEscalation']){_0xf496ce=_0x3984b8;var _0x535826={'interaction':{'id':_0x11eeec},'agent':{'id':_0x25146e[_0x176f('0x4d')]['id'],'name':_0x25146e[_0x176f('0x4d')][_0x176f('0x2b')],'fullname':_0x25146e[_0x176f('0x4d')][_0x176f('0x4e')],'email':_0x25146e[_0x176f('0x4d')][_0x176f('0x4f')]},'contact':_0x25146e[_0x176f('0x44')]['contact'],'account':_0x25146e['body'][_0x176f('0x31')]};var _0x4fb2c2={'rejectUnauthorized':![],'method':'POST','url':_0x176f('0x50'),'headers':{'X-APIKEY':_0x3984b8[_0x176f('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x25146e[_0x176f('0x4d')]['email']],'buttons':null,'topic':_0xf496ce[_0x176f('0x51')],'note':_[_0x176f('0x52')](_0xf496ce['vidaooNote'])?null:getMustacheRender(_0xf496ce[_0x176f('0x53')],_0x535826),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x176f('0x52')](_0xf496ce['vidaooMetadata'])){var _0xd59369=getMustacheRender(_0xf496ce[_0x176f('0x4c')],_0x535826);var _0x51d59c=JSON['parse'](_0xd59369);_0x4fb2c2[_0x176f('0x44')][_0x176f('0x54')]=_0x51d59c;}}catch(_0x27afda){throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))](_0x176f('0x57'));}return rp(_0x4fb2c2);}else{throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))](_0x176f('0x58'));}})[_0x176f('0x28')](function(_0x4b324a){_0x5bfa8d=_0x4b324a;if(_0x5bfa8d['id']){var _0x4d49bb={'body':_0x5bfa8d[_0x176f('0x59')],'ChatWebsiteId':_0xf496ce['id'],'ChatInteractionId':_0x55f2fe['id'],'direction':_0x176f('0x5a'),'UserId':_0x25146e['user']['id']};return db[_0x176f('0x5b')]['create'](_0x4d49bb,{});}else{throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x176f('0x28')](function(){return _0x55f2fe[_0x176f('0x5c')]({'vidaooSessionId':_0x5bfa8d['id']});})['then'](respondWithResult(_0x48bb58,null))[_0x176f('0x1d')](handleError(_0x48bb58,null));};exports[_0x176f('0x5d')]=function(_0x33dcf4,_0x355254){if(_0x33dcf4['body']['id']){delete _0x33dcf4[_0x176f('0x44')]['id'];}return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x33dcf4[_0x176f('0x45')]['id']},'include':[{'model':db[_0x176f('0x5f')],'as':'Contact'}]})[_0x176f('0x28')](handleEntityNotFound(_0x355254,null))['then'](saveUpdates(_0x33dcf4[_0x176f('0x44')],null))[_0x176f('0x28')](respondWithResult(_0x355254,null))[_0x176f('0x1d')](handleError(_0x355254,null));};exports['abandon']=function(_0x3a190c,_0x2996ff){if(_0x3a190c[_0x176f('0x44')]['id']){delete _0x3a190c[_0x176f('0x44')]['id'];}return db['ChatInteraction'][_0x176f('0x5e')]({'where':{'id':_0x3a190c['params']['id']}})[_0x176f('0x28')](function(_0x147fb1){if(!_0x147fb1){logger[_0x176f('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x2996ff[_0x176f('0x1e')](0x194);}else{if(_0x147fb1[_0x176f('0x60')]){throw new db[(_0x176f('0x55'))][(_0x176f('0x56'))]('Interaction\x20already\x20assigned');}}return _0x147fb1;})[_0x176f('0x28')](function(_0xa6a63e){if(_0xa6a63e){return _0xa6a63e[_0x176f('0x26')]({'closed':_0x3a190c[_0x176f('0x44')]['closed'],'disposition':_0x3a190c['body'][_0x176f('0x61')]})[_0x176f('0x28')](function(_0x25f52c){return _0x25f52c;});}})[_0x176f('0x28')](function(){return respondWithRpcPromise('AbandonInteraction',_0x176f('0x62'),_0x3a190c[_0x176f('0x44')],client9004);})[_0x176f('0x28')](respondWithResult(_0x2996ff,null))[_0x176f('0x1d')](handleError(_0x2996ff,null));};exports[_0x176f('0x63')]=function(_0x5c14ba,_0x1e6d31){_0x5c14ba['body'][_0x176f('0x2b')]=_0x5c14ba[_0x176f('0x64')][_0x176f('0x65')];_0x5c14ba['body']['basename']=_0x5c14ba[_0x176f('0x64')][_0x176f('0x66')];_0x5c14ba['body'][_0x176f('0x35')]=_0x5c14ba[_0x176f('0x64')][_0x176f('0x67')];return db[_0x176f('0x68')][_0x176f('0x43')](_0x5c14ba['body'])[_0x176f('0x28')](respondWithResult(_0x1e6d31,0xc9))['catch'](handleError(_0x1e6d31,null));};exports['attachmentDownload']=function(_0x49e1af,_0x38e514){return db[_0x176f('0x33')][_0x176f('0x48')]({'where':{'id':_0x49e1af[_0x176f('0x45')]['id']},'raw':!![]})[_0x176f('0x28')](handleEntityNotFound(_0x38e514,null))['then'](function(_0x554793){if(_0x554793){if(_0x554793[_0x176f('0x69')]){return _0x38e514[_0x176f('0x1f')](0x193)['json']({'status':0x193,'message':_0x176f('0x6a')});}return db[_0x176f('0x68')][_0x176f('0x48')]({'where':{'id':_0x49e1af['query'][_0x176f('0x6b')]},'raw':!![]})[_0x176f('0x28')](handleEntityNotFound(_0x38e514,null));}})[_0x176f('0x28')](function(_0x259b04){if(_0x259b04){var _0x36a207=_0x259b04[_0x176f('0x6c')]!==null;var _0x510758=path['join'](config[_0x176f('0x6d')],_0x176f('0x6e'));if(_0x36a207){_0x510758=path['join'](_0x510758,_0x176f('0x6f'));}var _0xc5e8d9=path[_0x176f('0x70')](_0x510758,_0x259b04[_0x176f('0x71')]);return _0x38e514[_0x176f('0x72')](_0xc5e8d9);}})['catch'](handleError(_0x38e514,null));};exports[_0x176f('0x73')]=function(_0x56ada9,_0x1688b2){var _0x468d71=null;var _0x5bcf0f=null;var _0x337ec7=null;if(_0x56ada9[_0x176f('0x44')]['id']){delete _0x56ada9['body']['id'];}if(_0x56ada9['body'][_0x176f('0x74')]){_0x337ec7=path[_0x176f('0x70')](config['root'],_0x176f('0x75'),util['format']('transcript-%s.txt',Date['now']()));_0x56ada9['body'][_0x176f('0x76')]=_0x337ec7;}return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x56ada9[_0x176f('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x176f('0x77'),'include':[{'model':db['User'],'as':_0x176f('0x78')}]}]})[_0x176f('0x28')](handleEntityNotFound(_0x1688b2,null))[_0x176f('0x28')](saveUpdates(_0x56ada9[_0x176f('0x44')],null))[_0x176f('0x28')](function(_0x3c59ca){if(_0x3c59ca){_0x468d71=_0x3c59ca;return db[_0x176f('0x49')][_0x176f('0x5e')]({'where':{'id':_0x468d71['ChatWebsiteId']}});}})['then'](function(_0x34937c){if(_0x34937c){_0x5bcf0f=_0x34937c;return db[_0x176f('0x5f')]['find']({'where':{'id':_0x468d71[_0x176f('0x79')]}});}})['then'](function(_0x10e90b){if(_0x10e90b){if(_0x337ec7){var _0x365be7=null;for(var _0x8adc13=0x1;_0x8adc13<_0x468d71['Messages'][_0x176f('0x40')];++_0x8adc13){_0x365be7=_0x468d71['Messages'][_0x8adc13];var _0x235d40=_0x365be7['UserId']?util[_0x176f('0x7a')]('%s%d',_0x5bcf0f['agentAlias'],_0x365be7['UserId']):'System';var _0x5d8150=_0x56ada9['body'][_0x176f('0x7b')]||util[_0x176f('0x7a')](_0x176f('0x7c'),_0x176f('0x7d'),_0x365be7['ContactId']);switch(_0x5bcf0f[_0x176f('0x7e')]){case'website_alias':_0x235d40=_0x365be7[_0x176f('0x60')]?util[_0x176f('0x7a')](_0x176f('0x7c'),_0x5bcf0f[_0x176f('0x7f')],_0x365be7[_0x176f('0x60')]):_0x176f('0x80');break;case _0x176f('0x81'):_0x235d40=_0x365be7[_0x176f('0x60')]?_0x365be7[_0x176f('0x78')][_0x176f('0x82')]||_0x365be7[_0x176f('0x78')]['fullname']:_0x176f('0x80');break;case _0x176f('0x83'):_0x235d40=_0x365be7['UserId']?_0x365be7['User'][_0x176f('0x4e')]:_0x176f('0x80');break;default:_0x235d40=_0x365be7[_0x176f('0x60')]?util['format'](_0x176f('0x7c'),_0x5bcf0f['agentAlias'],_0x365be7['UserId']):'System';}var _0x4f4414=util[_0x176f('0x7a')]('[%s]\x20%s:\x20%s\x0a',moment(_0x365be7['createdAt'])['format'](_0x176f('0x84')),_0x365be7[_0x176f('0x85')]==='in'?_0x5d8150:_0x235d40,_0x365be7['body']);if(!_0x365be7['secret']){fs[_0x176f('0x86')](_0x337ec7,_0x4f4414);}}return db[_0x176f('0x87')][_0x176f('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x176f('0x88')],'as':_0x176f('0x89'),'raw':!![],'include':[{'model':db[_0x176f('0x8a')],'as':_0x176f('0x8a'),'raw':!![]}]}]});}}})['then'](function(_0x258475){if(!_0x258475||!_0x258475['Smtp']||!_0x56ada9[_0x176f('0x44')])return _0x468d71;var _0x30f84a=_0x258475[_0x176f('0x8b')]();return respondWithRpcPromise(_0x176f('0x8c'),_0x176f('0x8d'),{'account':_0x30f84a,'message':{'from':util[_0x176f('0x7a')]('\x22%s\x22\x20<%s>',_0x258475[_0x176f('0x2b')],_0x258475['email']||_0x258475[_0x176f('0x89')]['user']),'to':_0x56ada9['body'][_0x176f('0x74')],'subject':_0x176f('0x8e'),'text':util[_0x176f('0x7a')](_0x176f('0x8f'),_0x56ada9[_0x176f('0x44')][_0x176f('0x74')]),'attachments':[{'path':_0x337ec7}]}})[_0x176f('0x28')](function(){return _0x468d71;})[_0x176f('0x1d')](function(_0x5e8ea0){logger['error'](_0x5e8ea0);});})[_0x176f('0x28')](respondWithStatusCode(_0x1688b2,0xc8))['catch'](handleError(_0x1688b2,null));};exports[_0x176f('0x90')]=function(_0x57614e,_0x2f2306){return db[_0x176f('0x5b')][_0x176f('0x5e')]({'where':{'id':_0x57614e[_0x176f('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f2306,null))[_0x176f('0x28')](function(_0x402b3d){if(_0x402b3d){return _0x402b3d[_0x176f('0x90')](_0x57614e[_0x176f('0x44')][_0x176f('0x91')],_[_0x176f('0x92')](_0x57614e['body'],[_0x176f('0x91'),'id'])||{});}})['then'](respondWithResult(_0x2f2306,null))[_0x176f('0x1d')](handleError(_0x2f2306,null));};exports[_0x176f('0x93')]=function(_0x2b9b3c,_0x2b7691){var _0x515242={'raw':![],'where':{}};var _0x4089a2={};var _0x46ced3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x176f('0x48')]({'where':{'id':_0x2b9b3c['params']['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x2b7691,null))['then'](function(_0x59ec4f){if(_0x59ec4f){_0x4089a2['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x4089a2['query']=_['keys'](_0x2b9b3c['query']);_0x4089a2[_0x176f('0x94')]=_[_0x176f('0x3e')](_0x4089a2['model'],_0x4089a2['query']);_0x515242['attributes']=_['intersection'](_0x4089a2[_0x176f('0x3b')],qs['fields'](_0x2b9b3c[_0x176f('0x39')]['fields']));_0x515242['attributes']=_0x515242[_0x176f('0x3d')][_0x176f('0x40')]?_0x515242['attributes']:_0x4089a2[_0x176f('0x3b')];if(!_0x2b9b3c[_0x176f('0x39')][_0x176f('0x95')](_0x176f('0x96'))){_0x515242[_0x176f('0x23')]=qs[_0x176f('0x23')](_0x2b9b3c[_0x176f('0x39')][_0x176f('0x23')]);_0x515242[_0x176f('0x21')]=qs[_0x176f('0x21')](_0x2b9b3c['query'][_0x176f('0x21')]);}_0x515242[_0x176f('0x97')]=qs[_0x176f('0x98')](_0x2b9b3c[_0x176f('0x39')][_0x176f('0x98')]);_0x515242['where']=qs[_0x176f('0x94')](_[_0x176f('0x99')](_0x2b9b3c[_0x176f('0x39')],_0x4089a2[_0x176f('0x94')]));_0x515242[_0x176f('0x9a')][_0x176f('0x9b')]=_0x59ec4f['id'];if(_0x2b9b3c[_0x176f('0x39')]['filter']){_0x515242[_0x176f('0x9a')]=_[_0x176f('0x2d')](_0x515242[_0x176f('0x9a')],{'$or':_['map'](_0x515242['attributes'],function(_0x2f6ac6){var _0x1dca43={};_0x1dca43[_0x2f6ac6]={'$like':'%'+_0x2b9b3c[_0x176f('0x39')][_0x176f('0x9c')]+'%'};return _0x1dca43;})});}if(_0x2b9b3c[_0x176f('0x39')][_0x176f('0x9d')]){var _0x23c413=_0x2b9b3c[_0x176f('0x39')][_0x176f('0x9d')][_0x176f('0x9e')](',');var _0x367a31={};_0x367a31[_0x23c413[0x0]]={'$gte':moment(_0x23c413[0x1])[_0x176f('0x7a')](_0x176f('0x9f'))};_0x515242[_0x176f('0x9a')]=_[_0x176f('0x2d')](_0x515242['where'],_0x367a31);}_0x515242=_[_0x176f('0x2d')]({},_0x515242,_0x2b9b3c[_0x176f('0xa0')]);return db[_0x176f('0x5b')][_0x176f('0xa1')]({'where':_0x515242['where']})[_0x176f('0x28')](function(_0x3d5fd0){_0x46ced3[_0x176f('0xa1')]=_0x3d5fd0;if(_0x2b9b3c['query']['includeAll']){_0x515242[_0x176f('0x42')]=[{'all':!![]}];}return db[_0x176f('0x5b')]['findAll'](_0x515242);})['then'](function(_0xd3b6e0){_0x46ced3[_0x176f('0xa2')]=_0xd3b6e0;return _0x46ced3;});}})[_0x176f('0x28')](respondWithFilteredResult(_0x2b7691,_0x515242))['catch'](handleError(_0x2b7691,null));};exports[_0x176f('0xa3')]=function(_0xbebf62,_0x120943){var _0x3749a4={'where':{}},_0xc6716e={},_0x45f3bb={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x176f('0x48')]({'where':{'id':_0xbebf62['params']['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x120943,null))[_0x176f('0x28')](function(_0x455bf2){if(_0x455bf2){_0xc6716e[_0x176f('0x3b')]=_[_0x176f('0x3c')](db[_0x176f('0x5b')][_0x176f('0x34')]);_0xc6716e[_0x176f('0x39')]=_[_0x176f('0x3c')](_0xbebf62[_0x176f('0x39')]);_0xc6716e[_0x176f('0x94')]=_[_0x176f('0x3e')](_0xc6716e[_0x176f('0x3b')],_0xc6716e[_0x176f('0x39')]);_0x3749a4[_0x176f('0x3d')]=_[_0x176f('0x3e')](_0xc6716e[_0x176f('0x3b')],qs['fields'](_0xbebf62[_0x176f('0x39')][_0x176f('0x3f')]));_0x3749a4['attributes']=_0x3749a4[_0x176f('0x3d')][_0x176f('0x40')]?_0x3749a4[_0x176f('0x3d')]:_0xc6716e[_0x176f('0x3b')];if(!_0xbebf62[_0x176f('0x39')][_0x176f('0x95')]('nolimit')){_0x3749a4[_0x176f('0x23')]=qs['limit'](_0xbebf62['query']['limit']);_0x3749a4[_0x176f('0x21')]=qs['offset'](_0xbebf62[_0x176f('0x39')][_0x176f('0x21')]);}_0x3749a4[_0x176f('0x97')]=qs[_0x176f('0x98')](_0xbebf62[_0x176f('0x39')][_0x176f('0x98')]);_0x3749a4[_0x176f('0x9a')]=qs[_0x176f('0x94')](_[_0x176f('0x99')](_0xbebf62['query'],_0xc6716e[_0x176f('0x94')]));_0x3749a4['where'][_0x176f('0x9b')]=_0x455bf2['id'];if(_0xbebf62[_0x176f('0x39')][_0x176f('0x9c')]){_0x3749a4['where']=_[_0x176f('0x2d')](_0x3749a4[_0x176f('0x9a')],{'$or':_['map'](_0x3749a4[_0x176f('0x3d')],function(_0xd9baa6){var _0x2b9fb9={};_0x2b9fb9[_0xd9baa6]={'$like':'%'+_0xbebf62[_0x176f('0x39')][_0x176f('0x9c')]+'%'};return _0x2b9fb9;})});}_0x3749a4[_0x176f('0x9a')]['secret']=![];if(_0xbebf62[_0x176f('0x39')]['id']){_0x3749a4['where']['id']={'$gt':_0xbebf62[_0x176f('0x39')]['id']};}_0x3749a4=_[_0x176f('0x2d')]({},_0x3749a4,_0xbebf62[_0x176f('0xa0')]);return db[_0x176f('0x5b')][_0x176f('0xa1')]({'where':_0x3749a4['where']})[_0x176f('0x28')](function(_0x60b0ec){_0x45f3bb[_0x176f('0xa1')]=_0x60b0ec;_0x3749a4[_0x176f('0x42')]=[];if(_0xbebf62[_0x176f('0x39')][_0x176f('0xa4')]){_0x3749a4[_0x176f('0x42')]['push']({'model':db[_0x176f('0x78')],'as':_0x176f('0x78'),'attributes':['id',_0x176f('0x4e'),_0x176f('0x82')]});}if(_0xbebf62[_0x176f('0x39')][_0x176f('0x41')]){_0x3749a4[_0x176f('0x42')]=[{'all':!![]}];}return db[_0x176f('0x5b')][_0x176f('0x37')](_0x3749a4);})[_0x176f('0x28')](function(_0x112057){_0x45f3bb[_0x176f('0xa2')]=_0x112057;return _0x45f3bb;});}})[_0x176f('0x28')](respondWithFilteredResult(_0x120943,_0x3749a4))['catch'](handleError(_0x120943,null));};exports['addTags']=function(_0xdafc98,_0x221fec){return db[_0x176f('0x33')]['find']({'where':{'id':_0xdafc98[_0x176f('0x45')]['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x221fec,null))[_0x176f('0x28')](function(_0x567622){if(_0x567622){return _0x567622[_0x176f('0xa5')](_0xdafc98[_0x176f('0x44')][_0x176f('0x91')],_[_0x176f('0x92')](_0xdafc98['body'],['ids','id'])||{})[_0x176f('0xa6')](function(){return db[_0x176f('0xa7')][_0x176f('0x37')]({'attributes':['id','name',_0x176f('0xa8')],'where':{'id':_0xdafc98[_0x176f('0x44')][_0x176f('0x91')]}});})[_0x176f('0x28')](function(_0x1ce214){socket[_0x176f('0xa9')]('chatInteractionTags:save',{'id':Number(_0xdafc98[_0x176f('0x45')]['id']),'tags':_0x1ce214||[]});return{'id':Number(_0xdafc98[_0x176f('0x45')]['id']),'tags':_0x1ce214||[]};});}})[_0x176f('0x28')](respondWithResult(_0x221fec,null))[_0x176f('0x1d')](handleError(_0x221fec,null));};exports['removeTags']=function(_0x456a69,_0x2a2778){return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x456a69[_0x176f('0x45')]['id']}})[_0x176f('0x28')](handleEntityNotFound(_0x2a2778,null))['then'](function(_0x1849c5){if(_0x1849c5){return _0x1849c5[_0x176f('0xaa')](_0x456a69[_0x176f('0x39')][_0x176f('0x91')]);}})[_0x176f('0x28')](respondWithStatusCode(_0x2a2778,null))['catch'](handleError(_0x2a2778,null));};exports[_0x176f('0x72')]=function(_0x3a9341,_0x379b9c){var _0xb77f2b=moment()[_0x176f('0xab')]()[_0x176f('0xac')]();var _0x5582d2=path['join'](config['root'],_0x176f('0xad'),_0x176f('0xae'),_0x176f('0xaf'));var _0x5815dc=path[_0x176f('0x70')](config[_0x176f('0x6d')],_0x176f('0xad'),_0x176f('0xae'),'attachments');var _0x2eddc8=path[_0x176f('0x70')](_0x5582d2,_0xb77f2b);var _0x3ca787=util[_0x176f('0x7a')](_0x176f('0xb0'),_0x3a9341['params']['id'],_0xb77f2b);var _0x41ccd6=path[_0x176f('0x70')](_0x5582d2,_0x3ca787);var _0x5eff49=[];_0x5eff49[_0x176f('0xb1')]({'model':db[_0x176f('0x78')],'as':'User','attributes':['id',_0x176f('0x4e')],'raw':!![]});_0x5eff49[_0x176f('0xb1')]({'model':db[_0x176f('0x5f')],'as':'Contact','attributes':['id',_0x176f('0xb2'),_0x176f('0xb3')],'raw':!![]});if(_0x3a9341['query'][_0x176f('0xb4')]){_0x5eff49[_0x176f('0xb1')]({'model':db[_0x176f('0x68')],'as':_0x176f('0x68'),'raw':!![]});}var _0x265120=[{'model':db[_0x176f('0x5b')],'as':_0x176f('0x77'),'attributes':['id',_0x176f('0x44'),'createdAt','direction','secret',_0x176f('0xb5')],'include':_0x5eff49}];_0x265120[_0x176f('0xb1')]({'model':db[_0x176f('0x49')],'as':_0x176f('0xb6'),'attributes':['id',_0x176f('0x2b')]});_0x265120[_0x176f('0xb1')]({'model':db[_0x176f('0x78')],'as':'Owner','attributes':['id',_0x176f('0x4e')]});return db[_0x176f('0x33')][_0x176f('0x5e')]({'where':{'id':_0x3a9341[_0x176f('0x45')]['id']},'include':_0x265120})['then'](handleEntityNotFound(_0x379b9c,null))[_0x176f('0x28')](function(_0x58ee60){if(_0x58ee60){var _0x1ea63e=_0x58ee60[_0x176f('0xb7')]({'plain':!![]});fs[_0x176f('0xb8')](_0x2eddc8);var _0x5d1a54={'channel':_0x176f('0xb9'),'account':_0x1ea63e[_0x176f('0xb6')][_0x176f('0x2b')],'agent':_0x1ea63e['Owner']?_0x1ea63e[_0x176f('0xba')][_0x176f('0x4e')]:_0x176f('0xbb'),'createdAt':moment(_0x1ea63e[_0x176f('0xbc')])['format'](_0x176f('0x9f'))[_0x176f('0xac')](),'closedAt':_0x1ea63e[_0x176f('0x69')]?moment(_0x1ea63e[_0x176f('0xbd')])['format'](_0x176f('0x9f'))[_0x176f('0xac')]():'','disposition':_0x1ea63e[_0x176f('0x61')],'chatInfo':{'browser':_0x1ea63e['browserName'],'os':_0x1ea63e[_0x176f('0xbe')],'referer':_0x1ea63e['referer'],'customerIp':_0x1ea63e[_0x176f('0xbf')],'customerPort':_0x1ea63e[_0x176f('0xc0')]?_0x1ea63e[_0x176f('0xc0')]:_0x176f('0xbb')},'messages':_(_0x1ea63e[_0x176f('0x77')])['tail']()[_0x176f('0x9c')]({'secret':![]})[_0x176f('0x32')](function(_0x3d0afd){if(_0x3d0afd[_0x176f('0x68')]){var _0x519bdc=path[_0x176f('0x70')](_0x5815dc,_0x3d0afd[_0x176f('0x68')][_0x176f('0x71')]);if(fs[_0x176f('0xc1')](_0x519bdc)){fs[_0x176f('0xc2')](_0x519bdc)['pipe'](fs[_0x176f('0xc3')](path[_0x176f('0x70')](_0x2eddc8,_0x3d0afd[_0x176f('0x68')][_0x176f('0x71')])));}}return{'date':moment(_0x3d0afd['createdAt'])['format'](_0x176f('0x9f'))[_0x176f('0xac')](),'sender':_0x3d0afd[_0x176f('0x85')]===_0x176f('0x5a')?_0x3d0afd[_0x176f('0x78')]?_0x3d0afd[_0x176f('0x78')][_0x176f('0x4e')]:'System':_0x3d0afd[_0x176f('0xc4')]['firstName']+(_0x3d0afd[_0x176f('0xc4')][_0x176f('0xb3')]?'\x20'+_0x3d0afd[_0x176f('0xc4')][_0x176f('0xb3')]:''),'body':_0x3d0afd[_0x176f('0x68')]?_0x3d0afd[_0x176f('0x68')][_0x176f('0x71')]:_0x3d0afd['body'],'direction':_0x3d0afd['direction']==='out'?'A':'C','secret':_0x3d0afd[_0x176f('0xc5')],'read':_0x3d0afd[_0x176f('0xb5')],'attachment':_0x3d0afd[_0x176f('0x68')]};})[_0x176f('0xc6')]()};return ejs['renderFile'](path['join'](config[_0x176f('0x6d')],_0x176f('0xad'),_0x176f('0xc7'),_0x176f('0xc8')),{'interaction':_0x5d1a54})['then'](function(_0x3da4dd){var _0x39c327=path[_0x176f('0x70')](_0x2eddc8,_0x176f('0xc9')+_0x1ea63e['id']+'-'+_0xb77f2b+'.pdf');var _0x21b3fc={'path':_0x39c327,'channel':_0x176f('0xb9'),'interactionId':_0x1ea63e['id']};return pdf['createPdfFromHTML'](_0x3da4dd,_0x21b3fc);})['then'](function(){return new Promise(function(_0x579825,_0x155dc4){zipdir(_0x2eddc8,{'saveTo':_0x41ccd6},function(_0x3811bc,_0x3347bb){if(_0x3811bc)return _0x155dc4(_0x3811bc);return _0x579825(_0x3347bb);});})[_0x176f('0x28')](function(){return new BPromise(function(_0xda1211,_0x3cb35e){rimraf(_0x2eddc8,function(_0x5088fb){if(_0x5088fb)_0x3cb35e(_0x5088fb);return _0xda1211();});});})[_0x176f('0x28')](function(){return _0x379b9c[_0x176f('0x72')](_0x41ccd6,_0x3ca787,function(_0x4db946){if(_0x4db946){logger[_0x176f('0x19')](_0x176f('0xca'),_0x4db946);}else{fs[_0x176f('0xcb')](_0x41ccd6);}});});});}else{return _0x379b9c[_0x176f('0x1e')](0xc8);}})['catch'](handleError(_0x379b9c,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 67ff24f..4d59c89 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 _0x9353=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','getUsers','then'];(function(_0x574266,_0x52a8fb){var _0x24d5d7=function(_0x537e62){while(--_0x537e62){_0x574266['push'](_0x574266['shift']());}};_0x24d5d7(++_0x52a8fb);}(_0x9353,0x89));var _0x3935=function(_0x4e84e1,_0x229a88){_0x4e84e1=_0x4e84e1-0x0;var _0x235e2c=_0x9353[_0x4e84e1];return _0x235e2c;};'use strict';var EventEmitter=require(_0x3935('0x0'));var ChatInteraction=require(_0x3935('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x3935('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3935('0x2'),'afterUpdate':_0x3935('0x3'),'afterDestroy':_0x3935('0x4')};function emitEvent(_0x4326e9){return function(_0x3ecbdf,_0x89374c,_0x2704cf){_0x3ecbdf[_0x3935('0x5')]({'attributes':['id'],'raw':!![]})[_0x3935('0x6')](function(_0x499675){_0x3ecbdf[_0x3935('0x7')](_0x3935('0x8'),_0x499675[_0x3935('0x9')](function(_0x311c6e){return{'id':_0x311c6e['id']};}));return ChatMessage[_0x3935('0xa')]({'where':{'ChatInteractionId':_0x3ecbdf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3935('0x6')](function(_0x16af05){_0x3ecbdf[_0x3935('0x7')](_0x3935('0xb'),_0x16af05[_0x3935('0xc')]);ChatInteractionEvents['emit'](_0x4326e9+':'+_0x3ecbdf['id'],_0x3ecbdf);ChatInteractionEvents[_0x3935('0xd')](_0x4326e9,_0x3ecbdf);_0x2704cf(null);})[_0x3935('0xe')](_0x2704cf(null));};}for(var e in events){if(events[_0x3935('0xf')](e)){var event=events[e];ChatInteraction[_0x3935('0x10')](e,emitEvent(event));}}module[_0x3935('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xdd68=['then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers'];(function(_0x25c2a9,_0x26e068){var _0x434e1b=function(_0x58493e){while(--_0x58493e){_0x25c2a9['push'](_0x25c2a9['shift']());}};_0x434e1b(++_0x26e068);}(_0xdd68,0xdb));var _0x8dd6=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xdd68[_0x5c78d9];return _0x69ae1f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8dd6('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x8dd6('0x0'))['db'][_0x8dd6('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':'update','afterDestroy':_0x8dd6('0x4')};function emitEvent(_0x51c331){return function(_0x33a5ed,_0x295ad0,_0x36cad0){_0x33a5ed[_0x8dd6('0x5')]({'attributes':['id'],'raw':!![]})[_0x8dd6('0x6')](function(_0x17873e){_0x33a5ed['setDataValue']('Users',_0x17873e[_0x8dd6('0x7')](function(_0x6140ec){return{'id':_0x6140ec['id']};}));return ChatMessage[_0x8dd6('0x8')]({'where':{'ChatInteractionId':_0x33a5ed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8dd6('0x6')](function(_0xdeee3e){_0x33a5ed[_0x8dd6('0x9')](_0x8dd6('0xa'),_0xdeee3e['length']);ChatInteractionEvents[_0x8dd6('0xb')](_0x51c331+':'+_0x33a5ed['id'],_0x33a5ed);ChatInteractionEvents[_0x8dd6('0xb')](_0x51c331,_0x33a5ed);_0x36cad0(null);})[_0x8dd6('0xc')](_0x36cad0(null));};}for(var e in events){if(events[_0x8dd6('0xd')](e)){var event=events[e];ChatInteraction[_0x8dd6('0xe')](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 41184da..60d0b14 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 _0x20f8=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x52b0d3,_0x1383de){var _0x50f899=function(_0x4a71a7){while(--_0x4a71a7){_0x52b0d3['push'](_0x52b0d3['shift']());}};_0x50f899(++_0x1383de);}(_0x20f8,0x9b));var _0x820f=function(_0x43ae37,_0x3fb6a8){_0x43ae37=_0x43ae37-0x0;var _0x4c355a=_0x20f8[_0x43ae37];return _0x4c355a;};'use strict';var _=require(_0x820f('0x0'));var util=require(_0x820f('0x1'));var logger=require('../../config/logger')(_0x820f('0x2'));var moment=require(_0x820f('0x3'));var BPromise=require(_0x820f('0x4'));var rp=require(_0x820f('0x5'));var fs=require('fs');var path=require(_0x820f('0x6'));var rimraf=require(_0x820f('0x7'));var config=require('../../config/environment');var attributes=require(_0x820f('0x8'));module[_0x820f('0x9')]=function(_0x53bd56,_0x4f79d0){return _0x53bd56['define'](_0x820f('0xa'),attributes,{'tableName':_0x820f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19d813,_0x14653e,_0x78fbc7){if(_0x19d813[_0x820f('0xc')]('closed')){_0x19d813[_0x820f('0xd')]=moment()['format'](_0x820f('0xe'));}_0x78fbc7(null,_0x19d813);}},'charset':_0x820f('0xf'),'collate':_0x820f('0x10')});}; \ No newline at end of file +var _0x8b7b=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','ChatInteraction','chat_interactions'];(function(_0x2f5e81,_0x49c319){var _0x5e4f0e=function(_0x3343d8){while(--_0x3343d8){_0x2f5e81['push'](_0x2f5e81['shift']());}};_0x5e4f0e(++_0x49c319);}(_0x8b7b,0x95));var _0xb8b7=function(_0x36c396,_0x332431){_0x36c396=_0x36c396-0x0;var _0x201307=_0x8b7b[_0x36c396];return _0x201307;};'use strict';var _=require(_0xb8b7('0x0'));var util=require('util');var logger=require(_0xb8b7('0x1'))(_0xb8b7('0x2'));var moment=require(_0xb8b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8b7('0x4'));var fs=require('fs');var path=require(_0xb8b7('0x5'));var rimraf=require(_0xb8b7('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xb8b7('0x7')]=function(_0x19d25a,_0x2ff03d){return _0x19d25a[_0xb8b7('0x8')](_0xb8b7('0x9'),attributes,{'tableName':_0xb8b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57325f,_0x5ec27b,_0x14e43a){if(_0x57325f[_0xb8b7('0xb')]('closed')){_0x57325f[_0xb8b7('0xc')]=moment()[_0xb8b7('0xd')](_0xb8b7('0xe'));}_0x14e43a(null,_0x57325f);}},'charset':'utf8mb4','collate':_0xb8b7('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a14cb58..c253f37 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 _0xe81c=['rpc','../../config/environment','client','http','redis','localhost','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','update','options','raw','where','attributes','UpdateChatInteraction','AddTagsToChatInteraction','find','then','ids','omit','body','spread','AddTags','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d5a5e,_0x3e6054){var _0x35a912=function(_0x3d2ff3){while(--_0x3d2ff3){_0x5d5a5e['push'](_0x5d5a5e['shift']());}};_0x35a912(++_0x3e6054);}(_0xe81c,0xae));var _0xce81=function(_0x2d3d18,_0x475f4c){_0x2d3d18=_0x2d3d18-0x0;var _0x202f49=_0xe81c[_0x2d3d18];return _0x202f49;};'use strict';var _=require(_0xce81('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce81('0x1'));var rs=require(_0xce81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce81('0x3'))['db'];var utils=require(_0xce81('0x4'));var logger=require(_0xce81('0x5'))(_0xce81('0x6'));var config=require(_0xce81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce81('0x8')][_0xce81('0x9')]({'port':0x232a});config[_0xce81('0xa')]=_['defaults'](config['redis'],{'host':_0xce81('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce81('0xa')]));require(_0xce81('0xc'))['register'](socket);function respondWithRpcPromise(_0x394143,_0x1ebe1c,_0x1b4bd9){return new BPromise(function(_0x512cad,_0x444eae){return client['request'](_0x394143,_0x1b4bd9)['then'](function(_0x1eecdf){logger[_0xce81('0xd')](_0xce81('0xe'),_0x1ebe1c,_0xce81('0xf'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1ebe1c,_0xce81('0xf'),JSON[_0xce81('0x10')](_0x1eecdf));if(_0x1eecdf[_0xce81('0x11')]){if(_0x1eecdf[_0xce81('0x11')][_0xce81('0x12')]===0x1f4){logger['error'](_0xce81('0xe'),_0x1ebe1c,_0x1eecdf['error']['message']);return _0x444eae(_0x1eecdf[_0xce81('0x11')][_0xce81('0x13')]);}logger[_0xce81('0x11')](_0xce81('0xe'),_0x1ebe1c,_0x1eecdf[_0xce81('0x11')][_0xce81('0x13')]);return _0x512cad(_0x1eecdf['error'][_0xce81('0x13')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1ebe1c,_0xce81('0xf'));_0x512cad(_0x1eecdf['result']['message']);}})[_0xce81('0x14')](function(_0x54de4a){logger['error'](_0xce81('0xe'),_0x1ebe1c,_0x54de4a);_0x444eae(_0x54de4a);});});}exports['UpdateChatInteraction']=function(_0x17259f){var _0x488948=this;return new Promise(function(_0x8fdd37,_0x16ca9d){return db['ChatInteraction'][_0xce81('0x15')](_0x17259f['body'],{'raw':_0x17259f['options']?_0x17259f[_0xce81('0x16')][_0xce81('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17259f['options']?_0x17259f[_0xce81('0x16')][_0xce81('0x18')]||null:null,'attributes':_0x17259f[_0xce81('0x16')]?_0x17259f[_0xce81('0x16')][_0xce81('0x19')]||null:null,'limit':_0x17259f[_0xce81('0x16')]?_0x17259f[_0xce81('0x16')]['limit']||null:null})['then'](function(_0x1d1cd1){logger[_0xce81('0xd')](_0xce81('0x1a'),_0x17259f);logger['debug'](_0xce81('0x1a'),_0x17259f,JSON[_0xce81('0x10')](_0x1d1cd1));_0x8fdd37(_0x1d1cd1);})['catch'](function(_0x4d11b7){logger['error']('UpdateChatInteraction',_0x4d11b7[_0xce81('0x13')],_0x17259f);_0x16ca9d(_0x488948[_0xce81('0x11')](0x1f4,_0x4d11b7[_0xce81('0x13')]));});});};exports[_0xce81('0x1b')]=function(_0x93aec8){return new Promise(function(_0x2af77e,_0x2d2c23){return db['ChatInteraction'][_0xce81('0x1c')]({'where':_0x93aec8[_0xce81('0x16')]?_0x93aec8[_0xce81('0x16')][_0xce81('0x18')]||null:null})[_0xce81('0x1d')](function(_0x465665){if(_0x465665){return _0x465665['addTags'](_0x93aec8['body'][_0xce81('0x1e')],_[_0xce81('0x1f')](_0x93aec8[_0xce81('0x20')],[_0xce81('0x1e'),'id'])||{});}})[_0xce81('0x21')](function(_0x4556a6){logger[_0xce81('0xd')](_0xce81('0x22'),_0x93aec8);logger[_0xce81('0x23')](_0xce81('0x22'),_0x93aec8,JSON[_0xce81('0x10')](_0x4556a6));_0x2af77e(_0x4556a6);})[_0xce81('0x14')](function(_0x5baed4){logger[_0xce81('0x11')](_0xce81('0x22'),_0x5baed4[_0xce81('0x13')],_0x93aec8);_0x2d2c23(_this['error'](0x1f4,_0x5baed4[_0xce81('0x13')]));});});}; \ No newline at end of file +var _0x50bd=['ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatInteraction.socket','register','request','then','info','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50bd,0x113));var _0xd50b=function(_0x29fc91,_0x386185){_0x29fc91=_0x29fc91-0x0;var _0x2adbd1=_0x50bd[_0x29fc91];return _0x2adbd1;};'use strict';var _=require(_0xd50b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd50b('0x1'));var rs=require(_0xd50b('0x2'));var fs=require('fs');var Redis=require(_0xd50b('0x3'));var db=require(_0xd50b('0x4'))['db'];var utils=require(_0xd50b('0x5'));var logger=require(_0xd50b('0x6'))(_0xd50b('0x7'));var config=require(_0xd50b('0x8'));var jayson=require(_0xd50b('0x9'));var client=jayson[_0xd50b('0xa')][_0xd50b('0xb')]({'port':0x232a});config['redis']=_[_0xd50b('0xc')](config['redis'],{'host':_0xd50b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd50b('0xe')]));require(_0xd50b('0xf'))[_0xd50b('0x10')](socket);function respondWithRpcPromise(_0x3dd240,_0x51d32b,_0x4dbb3e){return new BPromise(function(_0x59beac,_0xa827a4){return client[_0xd50b('0x11')](_0x3dd240,_0x4dbb3e)[_0xd50b('0x12')](function(_0x40f15d){logger[_0xd50b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x51d32b,_0xd50b('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x51d32b,'request\x20sent',JSON['stringify'](_0x40f15d));if(_0x40f15d[_0xd50b('0x15')]){if(_0x40f15d['error'][_0xd50b('0x16')]===0x1f4){logger[_0xd50b('0x15')](_0xd50b('0x17'),_0x51d32b,_0x40f15d[_0xd50b('0x15')][_0xd50b('0x18')]);return _0xa827a4(_0x40f15d[_0xd50b('0x15')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x51d32b,_0x40f15d[_0xd50b('0x15')][_0xd50b('0x18')]);return _0x59beac(_0x40f15d['error'][_0xd50b('0x18')]);}else{logger[_0xd50b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x51d32b,_0xd50b('0x14'));_0x59beac(_0x40f15d['result']['message']);}})[_0xd50b('0x19')](function(_0x3ff86b){logger['error'](_0xd50b('0x17'),_0x51d32b,_0x3ff86b);_0xa827a4(_0x3ff86b);});});}exports['UpdateChatInteraction']=function(_0xe4f10b){var _0x8b5ac0=this;return new Promise(function(_0x315643,_0x1d75d7){return db[_0xd50b('0x1a')][_0xd50b('0x1b')](_0xe4f10b[_0xd50b('0x1c')],{'raw':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b[_0xd50b('0x1d')][_0xd50b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b['options'][_0xd50b('0x1f')]||null:null,'attributes':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b[_0xd50b('0x1d')][_0xd50b('0x20')]||null:null,'limit':_0xe4f10b[_0xd50b('0x1d')]?_0xe4f10b[_0xd50b('0x1d')]['limit']||null:null})[_0xd50b('0x12')](function(_0x2bd7d1){logger[_0xd50b('0x13')](_0xd50b('0x21'),_0xe4f10b);logger['debug'](_0xd50b('0x21'),_0xe4f10b,JSON[_0xd50b('0x22')](_0x2bd7d1));_0x315643(_0x2bd7d1);})[_0xd50b('0x19')](function(_0x268c80){logger[_0xd50b('0x15')](_0xd50b('0x21'),_0x268c80[_0xd50b('0x18')],_0xe4f10b);_0x1d75d7(_0x8b5ac0[_0xd50b('0x15')](0x1f4,_0x268c80['message']));});});};exports[_0xd50b('0x23')]=function(_0x33a9e6){return new Promise(function(_0x9d7477,_0x2c8644){return db[_0xd50b('0x1a')][_0xd50b('0x24')]({'where':_0x33a9e6[_0xd50b('0x1d')]?_0x33a9e6[_0xd50b('0x1d')][_0xd50b('0x1f')]||null:null})['then'](function(_0xa20e23){if(_0xa20e23){return _0xa20e23[_0xd50b('0x25')](_0x33a9e6[_0xd50b('0x1c')][_0xd50b('0x26')],_[_0xd50b('0x27')](_0x33a9e6['body'],['ids','id'])||{});}})[_0xd50b('0x28')](function(_0x29b0d4){logger[_0xd50b('0x13')](_0xd50b('0x29'),_0x33a9e6);logger[_0xd50b('0x2a')](_0xd50b('0x29'),_0x33a9e6,JSON['stringify'](_0x29b0d4));_0x9d7477(_0x29b0d4);})['catch'](function(_0x307a00){logger['error']('AddTags',_0x307a00['message'],_0x33a9e6);_0x2c8644(_this['error'](0x1f4,_0x307a00[_0xd50b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a4139eb..2ba5ee9 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 _0x3bcb=['./chatInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x3c08f7,_0xae80a8){var _0x32d001=function(_0x308fb5){while(--_0x308fb5){_0x3c08f7['push'](_0x3c08f7['shift']());}};_0x32d001(++_0xae80a8);}(_0x3bcb,0x1b2));var _0xb3bc=function(_0x24b00f,_0x5cb40c){_0x24b00f=_0x24b00f-0x0;var _0x2d816d=_0x3bcb[_0x24b00f];return _0x2d816d;};'use strict';var ChatInteractionEvents=require(_0xb3bc('0x0'));var events=[_0xb3bc('0x1'),_0xb3bc('0x2'),_0xb3bc('0x3')];function createListener(_0x4d8edf,_0x29c61e){return function(_0x5c786d){_0x29c61e['emit'](_0x4d8edf,_0x5c786d);};}function removeListener(_0x189fbb,_0x20a221){return function(){ChatInteractionEvents[_0xb3bc('0x4')](_0x189fbb,_0x20a221);};}exports[_0xb3bc('0x5')]=function(_0x1c6f9e){for(var _0x5af799=0x0,_0x3071eb=events[_0xb3bc('0x6')];_0x5af799<_0x3071eb;_0x5af799++){var _0x4b6ac5=events[_0x5af799];var _0xefd3af=createListener('chatInteraction:'+_0x4b6ac5,_0x1c6f9e);ChatInteractionEvents['on'](_0x4b6ac5,_0xefd3af);}}; \ No newline at end of file +var _0xf778=['update','emit','removeListener','register','length','./chatInteraction.events','save','remove'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0xf778,0x9d));var _0x8f77=function(_0x3f4c67,_0x1a5f87){_0x3f4c67=_0x3f4c67-0x0;var _0x5c3777=_0xf778[_0x3f4c67];return _0x5c3777;};'use strict';var ChatInteractionEvents=require(_0x8f77('0x0'));var events=[_0x8f77('0x1'),_0x8f77('0x2'),_0x8f77('0x3')];function createListener(_0x1320ba,_0x410562){return function(_0x6c5670){_0x410562[_0x8f77('0x4')](_0x1320ba,_0x6c5670);};}function removeListener(_0x3607b5,_0x4e63ec){return function(){ChatInteractionEvents[_0x8f77('0x5')](_0x3607b5,_0x4e63ec);};}exports[_0x8f77('0x6')]=function(_0x14537f){for(var _0x2fa72d=0x0,_0x3f309e=events[_0x8f77('0x7')];_0x2fa72d<_0x3f309e;_0x2fa72d++){var _0xb52b35=events[_0x2fa72d];var _0x34a97e=createListener('chatInteraction:'+_0xb52b35,_0x14537f);ChatInteractionEvents['on'](_0xb52b35,_0x34a97e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index bdd91a0..3e8b42d 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 _0x585d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','update','customUpdate','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer'];(function(_0x279872,_0x4d1435){var _0x5a9864=function(_0x211ce2){while(--_0x211ce2){_0x279872['push'](_0x279872['shift']());}};_0x5a9864(++_0x4d1435);}(_0x585d,0x1e9));var _0xd585=function(_0x4cf36a,_0x36af8a){_0x4cf36a=_0x4cf36a-0x0;var _0x3f50a3=_0x585d[_0x4cf36a];return _0x3f50a3;};'use strict';var multer=require(_0xd585('0x0'));var util=require(_0xd585('0x1'));var path=require(_0xd585('0x2'));var timeout=require(_0xd585('0x3'));var express=require(_0xd585('0x4'));var router=express[_0xd585('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd585('0x6'));var interaction=require(_0xd585('0x7'));var config=require(_0xd585('0x8'));var controller=require(_0xd585('0x9'));router['get']('/',auth[_0xd585('0xa')](),controller['index']);router['get'](_0xd585('0xb'),auth[_0xd585('0xa')](),controller[_0xd585('0xc')]);router[_0xd585('0xd')](_0xd585('0xe'),auth[_0xd585('0xf')](),controller['show']);router[_0xd585('0xd')](_0xd585('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xd585('0xd')]('/:id/messages',auth['isAuthenticated'](),controller[_0xd585('0x11')]);router['get']('/:id/my_messages',auth[_0xd585('0xf')](),controller[_0xd585('0x12')]);router[_0xd585('0xd')](_0xd585('0x13'),auth['isAuthenticated'](),controller[_0xd585('0x14')]);router[_0xd585('0x15')]('/',auth[_0xd585('0xa')](),controller[_0xd585('0x16')]);router[_0xd585('0x15')](_0xd585('0x17'),auth['isAuthenticated'](),controller[_0xd585('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4dcd1f,_0x174751,_0x8862fd){_0x8862fd(null,path[_0xd585('0x19')](config[_0xd585('0x1a')],'server/files/attachments/'));},'filename':function(_0x329cfd,_0x35dd6e,_0xbc4f8b){_0xbc4f8b(null,util[_0xd585('0x1b')](_0xd585('0x1c'),Date[_0xd585('0x1d')](),_0x35dd6e[_0xd585('0x1e')][_0xd585('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd585('0x15')](_0xd585('0x20'),upload[_0xd585('0x21')](_0xd585('0x22')),controller['attachmentUpload']);router['post']('/:id/messages',auth[_0xd585('0xf')](),controller[_0xd585('0x23')]);router['post'](_0xd585('0x24'),auth[_0xd585('0xa')](),interaction['tracked']('chat',_0xd585('0x25')),controller[_0xd585('0x26')]);router[_0xd585('0x27')](_0xd585('0xe'),auth['isAuthenticated'](),interaction[_0xd585('0x28')]('chat','chatinteraction:update'),controller[_0xd585('0x29')]);router[_0xd585('0x27')]('/:id/custom_update',controller[_0xd585('0x2a')]);router[_0xd585('0x27')]('/:id/abandon',auth[_0xd585('0xf')](),controller['abandon']);router[_0xd585('0x27')](_0xd585('0x2b'),controller[_0xd585('0x2c')]);router['delete'](_0xd585('0xe'),auth[_0xd585('0xa')](),interaction[_0xd585('0x28')]('chat',_0xd585('0x2d')),controller['destroy']);router[_0xd585('0x2e')](_0xd585('0x24'),auth[_0xd585('0xa')](),controller[_0xd585('0x2f')]);module[_0xd585('0x30')]=router; \ No newline at end of file +var _0x0362=['close','destroy','delete','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMyMessages','/:id/download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','abandon'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x0362,0x65));var _0x2036=function(_0x3fdb39,_0x45dace){_0x3fdb39=_0x3fdb39-0x0;var _0x154df5=_0x0362[_0x3fdb39];return _0x154df5;};'use strict';var multer=require('multer');var util=require(_0x2036('0x0'));var path=require('path');var timeout=require(_0x2036('0x1'));var express=require(_0x2036('0x2'));var router=express[_0x2036('0x3')]();var fs_extra=require(_0x2036('0x4'));var auth=require(_0x2036('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2036('0x6'));router[_0x2036('0x7')]('/',auth[_0x2036('0x8')](),controller['index']);router[_0x2036('0x7')](_0x2036('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2036('0xa'),auth[_0x2036('0xb')](),controller[_0x2036('0xc')]);router[_0x2036('0x7')]('/:id/attachment_download',auth[_0x2036('0xb')](),controller[_0x2036('0xd')]);router['get'](_0x2036('0xe'),auth[_0x2036('0x8')](),controller['getMessages']);router[_0x2036('0x7')]('/:id/my_messages',auth[_0x2036('0xb')](),controller[_0x2036('0xf')]);router[_0x2036('0x7')](_0x2036('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x2036('0x11')]('/',auth['isAuthenticated'](),controller[_0x2036('0x12')]);router[_0x2036('0x11')]('/:id/vidaoo',auth[_0x2036('0x8')](),controller[_0x2036('0x13')]);var upload=multer({'storage':multer[_0x2036('0x14')]({'destination':function(_0x1565a8,_0x28c74a,_0x26489a){_0x26489a(null,path[_0x2036('0x15')](config[_0x2036('0x16')],_0x2036('0x17')));},'filename':function(_0x3301d0,_0x790181,_0x26c14a){_0x26c14a(null,util[_0x2036('0x18')](_0x2036('0x19'),Date[_0x2036('0x1a')](),_0x790181[_0x2036('0x1b')][_0x2036('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2036('0x1d'),upload[_0x2036('0x1e')](_0x2036('0x1f')),controller[_0x2036('0x20')]);router[_0x2036('0x11')](_0x2036('0xe'),auth[_0x2036('0xb')](),controller['addMessage']);router[_0x2036('0x11')](_0x2036('0x21'),auth[_0x2036('0x8')](),interaction[_0x2036('0x22')](_0x2036('0x23'),_0x2036('0x24')),controller['addTags']);router['put'](_0x2036('0xa'),auth[_0x2036('0x8')](),interaction[_0x2036('0x22')](_0x2036('0x23'),_0x2036('0x25')),controller[_0x2036('0x26')]);router[_0x2036('0x27')](_0x2036('0x28'),controller[_0x2036('0x29')]);router['put']('/:id/abandon',auth[_0x2036('0xb')](),controller[_0x2036('0x2a')]);router['put']('/:id/close',controller[_0x2036('0x2b')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x2036('0x22')](_0x2036('0x23'),'chatinteraction:destroy'),controller[_0x2036('0x2c')]);router[_0x2036('0x2d')](_0x2036('0x21'),auth[_0x2036('0x8')](),controller[_0x2036('0x2e')]);module[_0x2036('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index edcf7f4..b5fc314 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 _0xbb68=['BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xbb68,0xb2));var _0x8bb6=function(_0x1c46e6,_0x1a918a){_0x1c46e6=_0x1c46e6-0x0;var _0x4767ee=_0xbb68[_0x1c46e6];return _0x4767ee;};'use strict';var Sequelize=require(_0x8bb6('0x0'));module['exports']={'body':{'type':Sequelize[_0x8bb6('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8bb6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8bb6('0x3')]}}; \ No newline at end of file +var _0xc085=['INTEGER','TEXT','BOOLEAN'];(function(_0x2e7188,_0x207fc3){var _0x265f52=function(_0x47a8d1){while(--_0x47a8d1){_0x2e7188['push'](_0x2e7188['shift']());}};_0x265f52(++_0x207fc3);}(_0xc085,0x109));var _0x5c08=function(_0xad0d4e,_0x20e0f6){_0xad0d4e=_0xad0d4e-0x0;var _0x87943c=_0xc085[_0xad0d4e];return _0x87943c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5c08('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5c08('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c08('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 586f5d6..1ad909c 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 _0xcd3a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','error','stack','name','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','ChatInternalMessage','findAll','rows','show','params','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','agent','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xcd3a,0xc8));var _0xacd3=function(_0x3a14ce,_0x32d2a9){_0x3a14ce=_0x3a14ce-0x0;var _0x3f52f3=_0xcd3a[_0x3a14ce];return _0x3f52f3;};'use strict';var emlformat=require(_0xacd3('0x0'));var rimraf=require(_0xacd3('0x1'));var zipdir=require(_0xacd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xacd3('0x3'));var moment=require(_0xacd3('0x4'));var BPromise=require(_0xacd3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xacd3('0x6'));var sox=require(_0xacd3('0x7'));var csv=require(_0xacd3('0x8'));var ejs=require(_0xacd3('0x9'));var fs=require('fs');var fs_extra=require(_0xacd3('0xa'));var _=require('lodash');var squel=require(_0xacd3('0xb'));var crypto=require('crypto');var jsforce=require(_0xacd3('0xc'));var deskjs=require(_0xacd3('0xd'));var toCsv=require(_0xacd3('0x8'));var querystring=require(_0xacd3('0xe'));var Papa=require(_0xacd3('0xf'));var Redis=require(_0xacd3('0x10'));var authService=require(_0xacd3('0x11'));var qs=require(_0xacd3('0x12'));var as=require(_0xacd3('0x13'));var hardwareService=require(_0xacd3('0x14'));var logger=require(_0xacd3('0x15'))('api');var utils=require(_0xacd3('0x16'));var config=require(_0xacd3('0x17'));var licenseUtil=require(_0xacd3('0x18'));var db=require('../../mysqldb')['db'];config[_0xacd3('0x19')]=_[_0xacd3('0x1a')](config[_0xacd3('0x19')],{'host':_0xacd3('0x1b'),'port':0x18eb});var socket=require(_0xacd3('0x1c'))(new Redis(config[_0xacd3('0x19')]));require(_0xacd3('0x1d'))['register'](socket);function respondWithStatusCode(_0x17706b,_0x51b1aa){_0x51b1aa=_0x51b1aa||0xcc;return function(_0x4daf95){if(_0x4daf95){return _0x17706b[_0xacd3('0x1e')](_0x51b1aa);}return _0x17706b[_0xacd3('0x1f')](_0x51b1aa)[_0xacd3('0x20')]();};}function respondWithResult(_0x446ad4,_0x3889b5){_0x3889b5=_0x3889b5||0xc8;return function(_0x3f3e88){if(_0x3f3e88){return _0x446ad4[_0xacd3('0x1f')](_0x3889b5)['json'](_0x3f3e88);}};}function respondWithFilteredResult(_0x310a57,_0x2ccc5b){return function(_0x4e1ebb){if(_0x4e1ebb){var _0x3fa3a2=typeof _0x2ccc5b[_0xacd3('0x21')]===_0xacd3('0x22')&&typeof _0x2ccc5b[_0xacd3('0x23')]===_0xacd3('0x22');var _0x149ccf=_0x4e1ebb[_0xacd3('0x24')];var _0x5ab224=_0x3fa3a2?0x0:_0x2ccc5b['offset'];var _0x2a0c04=_0x3fa3a2?_0x4e1ebb[_0xacd3('0x24')]:_0x2ccc5b['offset']+_0x2ccc5b['limit'];var _0x5f2b14;if(_0x2a0c04>=_0x149ccf){_0x2a0c04=_0x149ccf;_0x5f2b14=0xc8;}else{_0x5f2b14=0xce;}_0x310a57[_0xacd3('0x1f')](_0x5f2b14);return _0x310a57['set']('Content-Range',_0x5ab224+'-'+_0x2a0c04+'/'+_0x149ccf)[_0xacd3('0x25')](_0x4e1ebb);}return null;};}function patchUpdates(_0x56e454){return function(_0x58adb4){try{jsonpatch[_0xacd3('0x26')](_0x58adb4,_0x56e454,!![]);}catch(_0x39fe19){return BPromise[_0xacd3('0x27')](_0x39fe19);}return _0x58adb4['save']();};}function saveUpdates(_0x467fc8,_0x41d07b){return function(_0x42856d){if(_0x42856d){return _0x42856d[_0xacd3('0x28')](_0x467fc8)[_0xacd3('0x29')](function(_0x4e972b){return _0x4e972b;});}return null;};}function removeEntity(_0x5455ed,_0x23e728){return function(_0x59bd58){if(_0x59bd58){return _0x59bd58['destroy']()[_0xacd3('0x29')](function(){_0x5455ed[_0xacd3('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d359c,_0x415cc9){return function(_0x3e2333){if(!_0x3e2333){_0x1d359c[_0xacd3('0x1e')](0x194);}return _0x3e2333;};}function handleError(_0x24ce03,_0x5c5b5f){_0x5c5b5f=_0x5c5b5f||0x1f4;return function(_0x32ab38){logger[_0xacd3('0x2a')](_0x32ab38[_0xacd3('0x2b')]);if(_0x32ab38[_0xacd3('0x2c')]){delete _0x32ab38[_0xacd3('0x2c')];}_0x24ce03[_0xacd3('0x1f')](_0x5c5b5f)['send'](_0x32ab38);};}exports['index']=function(_0x5a1033,_0x154322){var _0x49b4c7={},_0x545aa0={},_0x490753={'count':0x0,'rows':[]};var _0x578694=_[_0xacd3('0x2d')](db['ChatInternalMessage'][_0xacd3('0x2e')],function(_0x252c86){return{'name':_0x252c86['fieldName'],'type':_0x252c86['type'][_0xacd3('0x2f')]};});_0x545aa0[_0xacd3('0x30')]=_[_0xacd3('0x2d')](_0x578694,_0xacd3('0x2c'));_0x545aa0[_0xacd3('0x31')]=_[_0xacd3('0x32')](_0x5a1033[_0xacd3('0x31')]);_0x545aa0[_0xacd3('0x33')]=_[_0xacd3('0x34')](_0x545aa0['model'],_0x545aa0[_0xacd3('0x31')]);_0x49b4c7[_0xacd3('0x35')]=_[_0xacd3('0x34')](_0x545aa0[_0xacd3('0x30')],qs['fields'](_0x5a1033[_0xacd3('0x31')][_0xacd3('0x36')]));_0x49b4c7['attributes']=_0x49b4c7[_0xacd3('0x35')][_0xacd3('0x37')]?_0x49b4c7[_0xacd3('0x35')]:_0x545aa0[_0xacd3('0x30')];if(!_0x5a1033[_0xacd3('0x31')][_0xacd3('0x38')](_0xacd3('0x39'))){_0x49b4c7[_0xacd3('0x23')]=qs[_0xacd3('0x23')](_0x5a1033[_0xacd3('0x31')][_0xacd3('0x23')]);_0x49b4c7[_0xacd3('0x21')]=qs['offset'](_0x5a1033['query'][_0xacd3('0x21')]);}_0x49b4c7['order']=qs[_0xacd3('0x3a')](_0x5a1033[_0xacd3('0x31')]['sort']);_0x49b4c7[_0xacd3('0x3b')]=qs[_0xacd3('0x33')](_[_0xacd3('0x3c')](_0x5a1033[_0xacd3('0x31')],_0x545aa0['filters']),_0x578694);if(_0x5a1033[_0xacd3('0x31')]['filter']){_0x49b4c7['where']=_[_0xacd3('0x3d')](_0x49b4c7[_0xacd3('0x3b')],{'$or':_[_0xacd3('0x2d')](_0x578694,function(_0x58486b){if(_0x58486b['type']!==_0xacd3('0x3e')){var _0x58b078={};_0x58b078[_0x58486b[_0xacd3('0x2c')]]={'$like':'%'+_0x5a1033[_0xacd3('0x31')][_0xacd3('0x3f')]+'%'};return _0x58b078;}})});}_0x49b4c7=_[_0xacd3('0x3d')]({},_0x49b4c7,_0x5a1033[_0xacd3('0x40')]);var _0x28f3ed={'where':_0x49b4c7[_0xacd3('0x3b')]};return db['ChatInternalMessage'][_0xacd3('0x24')](_0x28f3ed)[_0xacd3('0x29')](function(_0x3b578c){_0x490753[_0xacd3('0x24')]=_0x3b578c;if(_0x5a1033['query'][_0xacd3('0x41')]){_0x49b4c7[_0xacd3('0x42')]=[{'all':!![]}];}return db[_0xacd3('0x43')][_0xacd3('0x44')](_0x49b4c7);})[_0xacd3('0x29')](function(_0x1a2f82){_0x490753[_0xacd3('0x45')]=_0x1a2f82;return _0x490753;})[_0xacd3('0x29')](respondWithFilteredResult(_0x154322,_0x49b4c7))['catch'](handleError(_0x154322,null));};exports[_0xacd3('0x46')]=function(_0xc329f0,_0x32c8d5){var _0x2583c5={'raw':!![],'where':{'id':_0xc329f0[_0xacd3('0x47')]['id']}},_0x1ca9df={};_0x1ca9df[_0xacd3('0x30')]=_['keys'](db[_0xacd3('0x43')][_0xacd3('0x2e')]);_0x1ca9df[_0xacd3('0x31')]=_['keys'](_0xc329f0[_0xacd3('0x31')]);_0x1ca9df[_0xacd3('0x33')]=_['intersection'](_0x1ca9df[_0xacd3('0x30')],_0x1ca9df[_0xacd3('0x31')]);_0x2583c5['attributes']=_[_0xacd3('0x34')](_0x1ca9df[_0xacd3('0x30')],qs[_0xacd3('0x36')](_0xc329f0[_0xacd3('0x31')][_0xacd3('0x36')]));_0x2583c5['attributes']=_0x2583c5['attributes'][_0xacd3('0x37')]?_0x2583c5['attributes']:_0x1ca9df[_0xacd3('0x30')];if(_0xc329f0['query'][_0xacd3('0x41')]){_0x2583c5['include']=[{'all':!![]}];}_0x2583c5=_[_0xacd3('0x3d')]({},_0x2583c5,_0xc329f0['options']);return db[_0xacd3('0x43')][_0xacd3('0x48')](_0x2583c5)[_0xacd3('0x29')](handleEntityNotFound(_0x32c8d5,null))[_0xacd3('0x29')](respondWithResult(_0x32c8d5,null))[_0xacd3('0x49')](handleError(_0x32c8d5,null));};exports[_0xacd3('0x4a')]=function(_0x329c12,_0x52d641){return db[_0xacd3('0x43')]['create'](_0x329c12[_0xacd3('0x4b')],{})[_0xacd3('0x29')](respondWithResult(_0x52d641,0xc9))[_0xacd3('0x49')](handleError(_0x52d641,null));};exports[_0xacd3('0x28')]=function(_0x1e222a,_0x394a90){if(_0x1e222a[_0xacd3('0x4b')]['id']){delete _0x1e222a['body']['id'];}return db[_0xacd3('0x43')][_0xacd3('0x48')]({'where':{'id':_0x1e222a[_0xacd3('0x47')]['id']}})['then'](handleEntityNotFound(_0x394a90,null))['then'](saveUpdates(_0x1e222a['body'],null))[_0xacd3('0x29')](respondWithResult(_0x394a90,null))[_0xacd3('0x49')](handleError(_0x394a90,null));};exports[_0xacd3('0x4c')]=function(_0x3754e1,_0x2e0a7e){return db['ChatInternalMessage'][_0xacd3('0x48')]({'where':{'id':_0x3754e1['params']['id']}})[_0xacd3('0x29')](handleEntityNotFound(_0x2e0a7e,null))[_0xacd3('0x29')](removeEntity(_0x2e0a7e,null))[_0xacd3('0x49')](handleError(_0x2e0a7e,null));};exports['describe']=function(_0x58e527,_0x3d04dd){return db['ChatInternalMessage'][_0xacd3('0x4d')]()[_0xacd3('0x29')](respondWithResult(_0x3d04dd,null))['catch'](handleError(_0x3d04dd,null));};function wrapUser(_0xeb4ce6){return function(_0x5a0b3c){var _0x3b0d5a=_0xeb4ce6[_0xacd3('0x4e')]({'plain':!![]});_0x3b0d5a[_0xacd3('0x4f')]=[];if(_0x5a0b3c){_0x3b0d5a[_0xacd3('0x50')]=_0x5a0b3c[_0xacd3('0x51')];_0x3b0d5a[_0xacd3('0x52')]=_0x5a0b3c;}else{_0x3b0d5a[_0xacd3('0x50')]=moment(0x0)['format'](_0xacd3('0x53'));_0x3b0d5a['lastMessage']={};}return _0x3b0d5a;};}exports[_0xacd3('0x54')]=function(_0x36c70d,_0x5cfaa3,_0x56b232){var _0x5f0920=[];return db[_0xacd3('0x55')][_0xacd3('0x44')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0xacd3('0x56'),_0xacd3('0x2c'),_0xacd3('0x57'),_0xacd3('0x58'),_0xacd3('0x59'),_0xacd3('0x5a'),_0xacd3('0x5b'),_0xacd3('0x5c'),_0xacd3('0x5d')],'order':qs[_0xacd3('0x3a')](_0xacd3('0x5e')),'include':[{'model':db[_0xacd3('0x5f')],'as':'VoiceQueues','attributes':['id','name',_0xacd3('0x60')],'through':{'attributes':[]}}]})[_0xacd3('0x29')](function(_0x24a9fa){if(_0x24a9fa){var _0x54d616=_0x36c70d[_0xacd3('0x61')][_0xacd3('0x4e')]({'plain':!![]});if(!_0x54d616)throw new Error(_0xacd3('0x62'));if(_0x54d616['role']===_0xacd3('0x61')){return db['UserProfileSection'][_0xacd3('0x48')]({'where':{'name':_0xacd3('0x63'),'userProfileId':_0x54d616['userProfileId']},'raw':!![]})[_0xacd3('0x29')](function(_0x43e6c5){if(_0x43e6c5){if(_0x43e6c5[_0xacd3('0x64')]===0x0){return db['UserProfileResource'][_0xacd3('0x44')]({'where':{'sectionId':_0x43e6c5['id']},'raw':!![]})[_0xacd3('0x29')](function(_0x556a03){var _0x1ef156=[];if(_['isEmpty'](_0x556a03)){_0x1ef156=_[_0xacd3('0x3f')](_0x24a9fa,function(_0xda9671){if(_0xda9671['role']!==_0xacd3('0x65')){return _0xda9671;}});return _0x1ef156;}else{for(var _0x26c8c7=0x0;_0x26c8c7<_0x24a9fa['length'];_0x26c8c7++){var _0x31c04c=_0x24a9fa[_0x26c8c7];if(_0x31c04c['role']===_0xacd3('0x65')){var _0x53bb07=_[_0xacd3('0x48')](_0x556a03,function(_0x3a9a15){return _0x3a9a15[_0xacd3('0x66')]===_0x31c04c['id'];});if(_0x53bb07)_0x1ef156[_0xacd3('0x67')](_0x31c04c);}else{_0x1ef156[_0xacd3('0x67')](_0x31c04c);}}return _0x1ef156;}});}else{return _0x24a9fa;}}else{var _0x594188=_[_0xacd3('0x3f')](_0x24a9fa,function(_0x4e7244){if(_0x4e7244[_0xacd3('0x57')]!==_0xacd3('0x65')){return _0x4e7244;}});return _0x594188;}});}else{return _0x24a9fa;}}})['then'](function(_0x46eea2){var _0x792a28=[];if(_0x46eea2){_0x5f0920=_0x46eea2;for(var _0x1ec066=0x0;_0x1ec066<_0x46eea2[_0xacd3('0x37')];_0x1ec066+=0x1){_0x5f0920[_0x1ec066]['messages']=[];_0x792a28['push'](db[_0xacd3('0x43')]['find']({'where':{'FromId':[_0x36c70d[_0xacd3('0x61')]['id'],_0x46eea2[_0x1ec066]['id']],'ToId':[_0x36c70d[_0xacd3('0x61')]['id'],_0x46eea2[_0x1ec066]['id']],'ChatGroupId':null},'attributes':['id',_0xacd3('0x51'),'FromId','ToId',_0xacd3('0x68'),_0xacd3('0x4b')],'order':qs[_0xacd3('0x3a')](_0xacd3('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x46eea2[_0x1ec066])));}return BPromise[_0xacd3('0x6a')](_0x792a28);}return[];})[_0xacd3('0x29')](function(_0xd866cd){return{'rows':_0xd866cd,'count':_0xd866cd[_0xacd3('0x37')]};})[_0xacd3('0x29')](respondWithResult(_0x5cfaa3,null))[_0xacd3('0x49')](handleError(_0x5cfaa3,null));}; \ No newline at end of file +var _0xf2e2=['VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','order','sort','filters','filter','where','merge'];(function(_0x532a69,_0x1cd3f3){var _0x5def44=function(_0x581255){while(--_0x581255){_0x532a69['push'](_0x532a69['shift']());}};_0x5def44(++_0x1cd3f3);}(_0xf2e2,0xa0));var _0x2f2e=function(_0x1088ef,_0x6ce3e4){_0x1088ef=_0x1088ef-0x0;var _0x215cdd=_0xf2e2[_0x1088ef];return _0x215cdd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f2e('0x0'));var zipdir=require(_0x2f2e('0x1'));var jsonpatch=require(_0x2f2e('0x2'));var rp=require(_0x2f2e('0x3'));var moment=require(_0x2f2e('0x4'));var BPromise=require(_0x2f2e('0x5'));var Mustache=require(_0x2f2e('0x6'));var util=require('util');var path=require(_0x2f2e('0x7'));var sox=require(_0x2f2e('0x8'));var csv=require(_0x2f2e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f2e('0xa'));var _=require(_0x2f2e('0xb'));var squel=require(_0x2f2e('0xc'));var crypto=require(_0x2f2e('0xd'));var jsforce=require(_0x2f2e('0xe'));var deskjs=require(_0x2f2e('0xf'));var toCsv=require(_0x2f2e('0x9'));var querystring=require(_0x2f2e('0x10'));var Papa=require('papaparse');var Redis=require(_0x2f2e('0x11'));var authService=require(_0x2f2e('0x12'));var qs=require(_0x2f2e('0x13'));var as=require(_0x2f2e('0x14'));var hardwareService=require(_0x2f2e('0x15'));var logger=require(_0x2f2e('0x16'))(_0x2f2e('0x17'));var utils=require(_0x2f2e('0x18'));var config=require(_0x2f2e('0x19'));var licenseUtil=require(_0x2f2e('0x1a'));var db=require(_0x2f2e('0x1b'))['db'];config[_0x2f2e('0x1c')]=_[_0x2f2e('0x1d')](config[_0x2f2e('0x1c')],{'host':_0x2f2e('0x1e'),'port':0x18eb});var socket=require(_0x2f2e('0x1f'))(new Redis(config['redis']));require(_0x2f2e('0x20'))[_0x2f2e('0x21')](socket);function respondWithStatusCode(_0x10e789,_0x1ea1bd){_0x1ea1bd=_0x1ea1bd||0xcc;return function(_0x2e2487){if(_0x2e2487){return _0x10e789['sendStatus'](_0x1ea1bd);}return _0x10e789[_0x2f2e('0x22')](_0x1ea1bd)[_0x2f2e('0x23')]();};}function respondWithResult(_0x4437af,_0x4f613d){_0x4f613d=_0x4f613d||0xc8;return function(_0x23ca3b){if(_0x23ca3b){return _0x4437af['status'](_0x4f613d)['json'](_0x23ca3b);}};}function respondWithFilteredResult(_0x5db71c,_0x1bb9fb){return function(_0x4a8a4a){if(_0x4a8a4a){var _0x4ec9d5=typeof _0x1bb9fb[_0x2f2e('0x24')]===_0x2f2e('0x25')&&typeof _0x1bb9fb[_0x2f2e('0x26')]==='undefined';var _0x2835b1=_0x4a8a4a[_0x2f2e('0x27')];var _0x1f770e=_0x4ec9d5?0x0:_0x1bb9fb[_0x2f2e('0x24')];var _0x1a0150=_0x4ec9d5?_0x4a8a4a[_0x2f2e('0x27')]:_0x1bb9fb[_0x2f2e('0x24')]+_0x1bb9fb[_0x2f2e('0x26')];var _0x26d2d5;if(_0x1a0150>=_0x2835b1){_0x1a0150=_0x2835b1;_0x26d2d5=0xc8;}else{_0x26d2d5=0xce;}_0x5db71c[_0x2f2e('0x22')](_0x26d2d5);return _0x5db71c[_0x2f2e('0x28')](_0x2f2e('0x29'),_0x1f770e+'-'+_0x1a0150+'/'+_0x2835b1)[_0x2f2e('0x2a')](_0x4a8a4a);}return null;};}function patchUpdates(_0x4b24be){return function(_0x4783a8){try{jsonpatch[_0x2f2e('0x2b')](_0x4783a8,_0x4b24be,!![]);}catch(_0x20c61c){return BPromise[_0x2f2e('0x2c')](_0x20c61c);}return _0x4783a8[_0x2f2e('0x2d')]();};}function saveUpdates(_0x2522f1,_0x48c126){return function(_0x4702a8){if(_0x4702a8){return _0x4702a8[_0x2f2e('0x2e')](_0x2522f1)['then'](function(_0x1d6329){return _0x1d6329;});}return null;};}function removeEntity(_0x3fa074,_0x471677){return function(_0x548c77){if(_0x548c77){return _0x548c77[_0x2f2e('0x2f')]()[_0x2f2e('0x30')](function(){_0x3fa074['status'](0xcc)[_0x2f2e('0x23')]();});}};}function handleEntityNotFound(_0x2902b9,_0x36653f){return function(_0x2cc071){if(!_0x2cc071){_0x2902b9[_0x2f2e('0x31')](0x194);}return _0x2cc071;};}function handleError(_0x24271e,_0x4bb9d7){_0x4bb9d7=_0x4bb9d7||0x1f4;return function(_0x35a2ec){logger[_0x2f2e('0x32')](_0x35a2ec[_0x2f2e('0x33')]);if(_0x35a2ec[_0x2f2e('0x34')]){delete _0x35a2ec[_0x2f2e('0x34')];}_0x24271e[_0x2f2e('0x22')](_0x4bb9d7)[_0x2f2e('0x35')](_0x35a2ec);};}exports[_0x2f2e('0x36')]=function(_0x31ea6e,_0x1753ef){var _0x3987a5={},_0xc602b8={},_0x4cc065={'count':0x0,'rows':[]};var _0x52807c=_[_0x2f2e('0x37')](db[_0x2f2e('0x38')][_0x2f2e('0x39')],function(_0x3c6cb1){return{'name':_0x3c6cb1[_0x2f2e('0x3a')],'type':_0x3c6cb1[_0x2f2e('0x3b')][_0x2f2e('0x3c')]};});_0xc602b8['model']=_[_0x2f2e('0x37')](_0x52807c,'name');_0xc602b8['query']=_[_0x2f2e('0x3d')](_0x31ea6e[_0x2f2e('0x3e')]);_0xc602b8['filters']=_['intersection'](_0xc602b8[_0x2f2e('0x3f')],_0xc602b8[_0x2f2e('0x3e')]);_0x3987a5[_0x2f2e('0x40')]=_[_0x2f2e('0x41')](_0xc602b8[_0x2f2e('0x3f')],qs[_0x2f2e('0x42')](_0x31ea6e['query']['fields']));_0x3987a5['attributes']=_0x3987a5['attributes'][_0x2f2e('0x43')]?_0x3987a5[_0x2f2e('0x40')]:_0xc602b8[_0x2f2e('0x3f')];if(!_0x31ea6e[_0x2f2e('0x3e')]['hasOwnProperty']('nolimit')){_0x3987a5[_0x2f2e('0x26')]=qs[_0x2f2e('0x26')](_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x26')]);_0x3987a5[_0x2f2e('0x24')]=qs['offset'](_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x24')]);}_0x3987a5[_0x2f2e('0x44')]=qs[_0x2f2e('0x45')](_0x31ea6e['query'][_0x2f2e('0x45')]);_0x3987a5['where']=qs[_0x2f2e('0x46')](_['pick'](_0x31ea6e['query'],_0xc602b8['filters']),_0x52807c);if(_0x31ea6e['query'][_0x2f2e('0x47')]){_0x3987a5[_0x2f2e('0x48')]=_[_0x2f2e('0x49')](_0x3987a5[_0x2f2e('0x48')],{'$or':_[_0x2f2e('0x37')](_0x52807c,function(_0x1b2c69){if(_0x1b2c69[_0x2f2e('0x3b')]!==_0x2f2e('0x4a')){var _0x22aac5={};_0x22aac5[_0x1b2c69[_0x2f2e('0x34')]]={'$like':'%'+_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x47')]+'%'};return _0x22aac5;}})});}_0x3987a5=_[_0x2f2e('0x49')]({},_0x3987a5,_0x31ea6e[_0x2f2e('0x4b')]);var _0x2a68f2={'where':_0x3987a5[_0x2f2e('0x48')]};return db[_0x2f2e('0x38')]['count'](_0x2a68f2)[_0x2f2e('0x30')](function(_0x13f6d8){_0x4cc065[_0x2f2e('0x27')]=_0x13f6d8;if(_0x31ea6e[_0x2f2e('0x3e')][_0x2f2e('0x4c')]){_0x3987a5['include']=[{'all':!![]}];}return db[_0x2f2e('0x38')][_0x2f2e('0x4d')](_0x3987a5);})[_0x2f2e('0x30')](function(_0x11225f){_0x4cc065[_0x2f2e('0x4e')]=_0x11225f;return _0x4cc065;})[_0x2f2e('0x30')](respondWithFilteredResult(_0x1753ef,_0x3987a5))['catch'](handleError(_0x1753ef,null));};exports[_0x2f2e('0x4f')]=function(_0x3ffd88,_0x92a531){var _0x36b388={'raw':!![],'where':{'id':_0x3ffd88[_0x2f2e('0x50')]['id']}},_0x521d3f={};_0x521d3f[_0x2f2e('0x3f')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x521d3f[_0x2f2e('0x3e')]=_[_0x2f2e('0x3d')](_0x3ffd88[_0x2f2e('0x3e')]);_0x521d3f[_0x2f2e('0x46')]=_[_0x2f2e('0x41')](_0x521d3f[_0x2f2e('0x3f')],_0x521d3f[_0x2f2e('0x3e')]);_0x36b388[_0x2f2e('0x40')]=_[_0x2f2e('0x41')](_0x521d3f[_0x2f2e('0x3f')],qs[_0x2f2e('0x42')](_0x3ffd88[_0x2f2e('0x3e')][_0x2f2e('0x42')]));_0x36b388[_0x2f2e('0x40')]=_0x36b388[_0x2f2e('0x40')]['length']?_0x36b388[_0x2f2e('0x40')]:_0x521d3f['model'];if(_0x3ffd88[_0x2f2e('0x3e')]['includeAll']){_0x36b388[_0x2f2e('0x51')]=[{'all':!![]}];}_0x36b388=_['merge']({},_0x36b388,_0x3ffd88[_0x2f2e('0x4b')]);return db['ChatInternalMessage'][_0x2f2e('0x52')](_0x36b388)[_0x2f2e('0x30')](handleEntityNotFound(_0x92a531,null))[_0x2f2e('0x30')](respondWithResult(_0x92a531,null))['catch'](handleError(_0x92a531,null));};exports['create']=function(_0x4e1bea,_0x499e2e){return db[_0x2f2e('0x38')][_0x2f2e('0x53')](_0x4e1bea[_0x2f2e('0x54')],{})[_0x2f2e('0x30')](respondWithResult(_0x499e2e,0xc9))[_0x2f2e('0x55')](handleError(_0x499e2e,null));};exports[_0x2f2e('0x2e')]=function(_0xdc737a,_0x59fe8c){if(_0xdc737a[_0x2f2e('0x54')]['id']){delete _0xdc737a[_0x2f2e('0x54')]['id'];}return db[_0x2f2e('0x38')][_0x2f2e('0x52')]({'where':{'id':_0xdc737a[_0x2f2e('0x50')]['id']}})[_0x2f2e('0x30')](handleEntityNotFound(_0x59fe8c,null))[_0x2f2e('0x30')](saveUpdates(_0xdc737a['body'],null))['then'](respondWithResult(_0x59fe8c,null))[_0x2f2e('0x55')](handleError(_0x59fe8c,null));};exports[_0x2f2e('0x2f')]=function(_0x4c2a79,_0x26c61d){return db['ChatInternalMessage'][_0x2f2e('0x52')]({'where':{'id':_0x4c2a79[_0x2f2e('0x50')]['id']}})[_0x2f2e('0x30')](handleEntityNotFound(_0x26c61d,null))[_0x2f2e('0x30')](removeEntity(_0x26c61d,null))[_0x2f2e('0x55')](handleError(_0x26c61d,null));};exports[_0x2f2e('0x56')]=function(_0x1dbe4f,_0x461c3e){return db['ChatInternalMessage']['describe']()[_0x2f2e('0x30')](respondWithResult(_0x461c3e,null))[_0x2f2e('0x55')](handleError(_0x461c3e,null));};function wrapUser(_0x25a61e){return function(_0x5b628c){var _0x35482e=_0x25a61e[_0x2f2e('0x57')]({'plain':!![]});_0x35482e[_0x2f2e('0x58')]=[];if(_0x5b628c){_0x35482e[_0x2f2e('0x59')]=_0x5b628c[_0x2f2e('0x5a')];_0x35482e['lastMessage']=_0x5b628c;}else{_0x35482e['lastMessageAt']=moment(0x0)[_0x2f2e('0x5b')](_0x2f2e('0x5c'));_0x35482e[_0x2f2e('0x5d')]={};}return _0x35482e;};}exports[_0x2f2e('0x5e')]=function(_0xa8b70,_0x1d59d6,_0x4edf4d){var _0x2b363c=[];return db['User'][_0x2f2e('0x4d')]({'where':{'role':[_0x2f2e('0x5f'),_0x2f2e('0x60'),_0x2f2e('0x61')]},'attributes':['id',_0x2f2e('0x62'),_0x2f2e('0x34'),_0x2f2e('0x63'),_0x2f2e('0x64'),_0x2f2e('0x65'),_0x2f2e('0x66'),_0x2f2e('0x67'),_0x2f2e('0x68'),'showWebBar'],'order':qs[_0x2f2e('0x45')](_0x2f2e('0x69')),'include':[{'model':db[_0x2f2e('0x6a')],'as':_0x2f2e('0x6b'),'attributes':['id',_0x2f2e('0x34'),_0x2f2e('0x3b')],'through':{'attributes':[]}}]})[_0x2f2e('0x30')](function(_0x6c68e1){if(_0x6c68e1){var _0x240387=_0xa8b70[_0x2f2e('0x61')]['get']({'plain':!![]});if(!_0x240387)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x240387[_0x2f2e('0x63')]===_0x2f2e('0x61')){return db[_0x2f2e('0x6c')][_0x2f2e('0x52')]({'where':{'name':_0x2f2e('0x6d'),'userProfileId':_0x240387['userProfileId']},'raw':!![]})[_0x2f2e('0x30')](function(_0xb20c39){if(_0xb20c39){if(_0xb20c39[_0x2f2e('0x6e')]===0x0){return db['UserProfileResource'][_0x2f2e('0x4d')]({'where':{'sectionId':_0xb20c39['id']},'raw':!![]})[_0x2f2e('0x30')](function(_0xb75a22){var _0x48bcb4=[];if(_[_0x2f2e('0x6f')](_0xb75a22)){_0x48bcb4=_['filter'](_0x6c68e1,function(_0x1c6d84){if(_0x1c6d84[_0x2f2e('0x63')]!=='agent'){return _0x1c6d84;}});return _0x48bcb4;}else{for(var _0x54b6ae=0x0;_0x54b6ae<_0x6c68e1[_0x2f2e('0x43')];_0x54b6ae++){var _0x2874ba=_0x6c68e1[_0x54b6ae];if(_0x2874ba[_0x2f2e('0x63')]==='agent'){var _0x5af102=_[_0x2f2e('0x52')](_0xb75a22,function(_0x43f477){return _0x43f477[_0x2f2e('0x70')]===_0x2874ba['id'];});if(_0x5af102)_0x48bcb4[_0x2f2e('0x71')](_0x2874ba);}else{_0x48bcb4[_0x2f2e('0x71')](_0x2874ba);}}return _0x48bcb4;}});}else{return _0x6c68e1;}}else{var _0x4fcf5e=_[_0x2f2e('0x47')](_0x6c68e1,function(_0x281b5a){if(_0x281b5a['role']!=='agent'){return _0x281b5a;}});return _0x4fcf5e;}});}else{return _0x6c68e1;}}})[_0x2f2e('0x30')](function(_0x1bfd2b){var _0x50d3f7=[];if(_0x1bfd2b){_0x2b363c=_0x1bfd2b;for(var _0x127e39=0x0;_0x127e39<_0x1bfd2b[_0x2f2e('0x43')];_0x127e39+=0x1){_0x2b363c[_0x127e39][_0x2f2e('0x58')]=[];_0x50d3f7[_0x2f2e('0x71')](db[_0x2f2e('0x38')][_0x2f2e('0x52')]({'where':{'FromId':[_0xa8b70[_0x2f2e('0x61')]['id'],_0x1bfd2b[_0x127e39]['id']],'ToId':[_0xa8b70['user']['id'],_0x1bfd2b[_0x127e39]['id']],'ChatGroupId':null},'attributes':['id',_0x2f2e('0x5a'),'FromId',_0x2f2e('0x72'),_0x2f2e('0x73'),'body'],'order':qs[_0x2f2e('0x45')](_0x2f2e('0x74')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2f2e('0x30')](wrapUser(_0x1bfd2b[_0x127e39])));}return BPromise['all'](_0x50d3f7);}return[];})['then'](function(_0x2e5b27){return{'rows':_0x2e5b27,'count':_0x2e5b27[_0x2f2e('0x43')]};})[_0x2f2e('0x30')](respondWithResult(_0x1d59d6,null))[_0x2f2e('0x55')](handleError(_0x1d59d6,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 4855069..dec4e7c 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 _0x02b6=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3328b4,_0x403a24){var _0x530143=function(_0x53db2a){while(--_0x53db2a){_0x3328b4['push'](_0x3328b4['shift']());}};_0x530143(++_0x403a24);}(_0x02b6,0xf0));var _0x602b=function(_0x27ee53,_0x507b82){_0x27ee53=_0x27ee53-0x0;var _0x5b7c4c=_0x02b6[_0x27ee53];return _0x5b7c4c;};'use strict';var EventEmitter=require(_0x602b('0x0'));var ChatInternalMessage=require(_0x602b('0x1'))['db'][_0x602b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x602b('0x3')](0x0);var events={'afterCreate':_0x602b('0x4'),'afterUpdate':_0x602b('0x5'),'afterDestroy':_0x602b('0x6')};function emitEvent(_0x444118){return function(_0x4aa9b6,_0x5db393,_0x21b6b5){ChatInternalMessageEvents[_0x602b('0x7')](_0x444118+':'+_0x4aa9b6['id'],_0x4aa9b6);ChatInternalMessageEvents[_0x602b('0x7')](_0x444118,_0x4aa9b6);_0x21b6b5(null);};}for(var e in events){if(events[_0x602b('0x8')](e)){var event=events[e];ChatInternalMessage[_0x602b('0x9')](e,emitEvent(event));}}module[_0x602b('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x8fa1=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3e0816,_0x30bb29){var _0x2c48cf=function(_0x3940b1){while(--_0x3940b1){_0x3e0816['push'](_0x3e0816['shift']());}};_0x2c48cf(++_0x30bb29);}(_0x8fa1,0x15e));var _0x18fa=function(_0x49a548,_0x59bce0){_0x49a548=_0x49a548-0x0;var _0x385bfb=_0x8fa1[_0x49a548];return _0x385bfb;};'use strict';var EventEmitter=require(_0x18fa('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x18fa('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x18fa('0x2')](0x0);var events={'afterCreate':_0x18fa('0x3'),'afterUpdate':_0x18fa('0x4'),'afterDestroy':_0x18fa('0x5')};function emitEvent(_0x33e7be){return function(_0x279050,_0x23dd93,_0x487b7e){ChatInternalMessageEvents['emit'](_0x33e7be+':'+_0x279050['id'],_0x279050);ChatInternalMessageEvents[_0x18fa('0x6')](_0x33e7be,_0x279050);_0x487b7e(null);};}for(var e in events){if(events[_0x18fa('0x7')](e)){var event=events[e];ChatInternalMessage[_0x18fa('0x8')](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 4c93591..bf3c88e 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 _0xc4ec=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x24a520,_0x562a5c){var _0x2252be=function(_0x588a73){while(--_0x588a73){_0x24a520['push'](_0x24a520['shift']());}};_0x2252be(++_0x562a5c);}(_0xc4ec,0x18e));var _0xcc4e=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xc4ec[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0xcc4e('0x0'));var util=require(_0xcc4e('0x1'));var logger=require('../../config/logger')(_0xcc4e('0x2'));var moment=require(_0xcc4e('0x3'));var BPromise=require(_0xcc4e('0x4'));var rp=require(_0xcc4e('0x5'));var fs=require('fs');var path=require(_0xcc4e('0x6'));var rimraf=require(_0xcc4e('0x7'));var config=require(_0xcc4e('0x8'));var attributes=require(_0xcc4e('0x9'));module[_0xcc4e('0xa')]=function(_0x1f5705,_0x5d9aee){return _0x1f5705[_0xcc4e('0xb')]('ChatInternalMessage',attributes,{'tableName':_0xcc4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc4e('0xd'),'collate':_0xcc4e('0xe')});}; \ No newline at end of file +var _0xc093=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x279f32,_0x423fd3){var _0x3325a2=function(_0x551c02){while(--_0x551c02){_0x279f32['push'](_0x279f32['shift']());}};_0x3325a2(++_0x423fd3);}(_0xc093,0x6c));var _0x3c09=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xc093[_0x5756c6];return _0x4b5806;};'use strict';var _=require('lodash');var util=require(_0x3c09('0x0'));var logger=require(_0x3c09('0x1'))(_0x3c09('0x2'));var moment=require(_0x3c09('0x3'));var BPromise=require(_0x3c09('0x4'));var rp=require(_0x3c09('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c09('0x6'));var attributes=require(_0x3c09('0x7'));module[_0x3c09('0x8')]=function(_0x1accb2,_0x333525){return _0x1accb2[_0x3c09('0x9')](_0x3c09('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c09('0xb'),'collate':_0x3c09('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index d972269..b399fb9 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 _0xe41f=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xe41f,0x13e));var _0xfe41=function(_0x3d54a8,_0x1c547c){_0x3d54a8=_0x3d54a8-0x0;var _0x12be3d=_0xe41f[_0x3d54a8];return _0x12be3d;};'use strict';var _=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var moment=require(_0xfe41('0x2'));var BPromise=require(_0xfe41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe41('0x4'));var logger=require(_0xfe41('0x5'))(_0xfe41('0x6'));var config=require(_0xfe41('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe41('0x8')]({'port':0x232a});config['redis']=_[_0xfe41('0x9')](config[_0xfe41('0xa')],{'host':_0xfe41('0xb'),'port':0x18eb});var socket=require(_0xfe41('0xc'))(new Redis(config[_0xfe41('0xa')]));require(_0xfe41('0xd'))['register'](socket);function respondWithRpcPromise(_0x4f932d,_0x4a072c,_0x49fb1b){return new BPromise(function(_0x1c9d59,_0x293f2c){return client[_0xfe41('0xe')](_0x4f932d,_0x49fb1b)['then'](function(_0xa56f1a){logger[_0xfe41('0xf')](_0xfe41('0x10'),_0x4a072c,'request\x20sent');logger[_0xfe41('0x11')](_0xfe41('0x12'),_0x4a072c,'request\x20sent',JSON[_0xfe41('0x13')](_0xa56f1a));if(_0xa56f1a[_0xfe41('0x14')]){if(_0xa56f1a[_0xfe41('0x14')][_0xfe41('0x15')]===0x1f4){logger[_0xfe41('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4a072c,_0xa56f1a[_0xfe41('0x14')][_0xfe41('0x16')]);return _0x293f2c(_0xa56f1a[_0xfe41('0x14')]['message']);}logger['error'](_0xfe41('0x10'),_0x4a072c,_0xa56f1a[_0xfe41('0x14')][_0xfe41('0x16')]);return _0x1c9d59(_0xa56f1a[_0xfe41('0x14')]['message']);}else{logger[_0xfe41('0xf')](_0xfe41('0x10'),_0x4a072c,_0xfe41('0x17'));_0x1c9d59(_0xa56f1a[_0xfe41('0x18')][_0xfe41('0x16')]);}})[_0xfe41('0x19')](function(_0x3d3dc3){logger[_0xfe41('0x14')](_0xfe41('0x10'),_0x4a072c,_0x3d3dc3);_0x293f2c(_0x3d3dc3);});});} \ No newline at end of file +var _0x400b=['rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x320cf5,_0x4e437d){var _0xa77006=function(_0x854b9c){while(--_0x854b9c){_0x320cf5['push'](_0x320cf5['shift']());}};_0xa77006(++_0x4e437d);}(_0x400b,0x1e5));var _0xb400=function(_0x3098a7,_0x490909){_0x3098a7=_0x3098a7-0x0;var _0x530a7b=_0x400b[_0x3098a7];return _0x530a7b;};'use strict';var _=require(_0xb400('0x0'));var util=require(_0xb400('0x1'));var moment=require(_0xb400('0x2'));var BPromise=require(_0xb400('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb400('0x4'));var db=require(_0xb400('0x5'))['db'];var utils=require(_0xb400('0x6'));var logger=require(_0xb400('0x7'))(_0xb400('0x8'));var config=require(_0xb400('0x9'));var jayson=require(_0xb400('0xa'));var client=jayson['client'][_0xb400('0xb')]({'port':0x232a});config['redis']=_[_0xb400('0xc')](config[_0xb400('0xd')],{'host':_0xb400('0xe'),'port':0x18eb});var socket=require(_0xb400('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xb400('0x10')](socket);function respondWithRpcPromise(_0x1299ef,_0x2811ab,_0x4c7373){return new BPromise(function(_0x438f8c,_0xe35775){return client[_0xb400('0x11')](_0x1299ef,_0x4c7373)[_0xb400('0x12')](function(_0xa63c5){logger[_0xb400('0x13')](_0xb400('0x14'),_0x2811ab,'request\x20sent');logger[_0xb400('0x15')](_0xb400('0x16'),_0x2811ab,_0xb400('0x17'),JSON[_0xb400('0x18')](_0xa63c5));if(_0xa63c5['error']){if(_0xa63c5[_0xb400('0x19')]['code']===0x1f4){logger[_0xb400('0x19')](_0xb400('0x14'),_0x2811ab,_0xa63c5[_0xb400('0x19')][_0xb400('0x1a')]);return _0xe35775(_0xa63c5[_0xb400('0x19')]['message']);}logger[_0xb400('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x2811ab,_0xa63c5[_0xb400('0x19')][_0xb400('0x1a')]);return _0x438f8c(_0xa63c5[_0xb400('0x19')][_0xb400('0x1a')]);}else{logger[_0xb400('0x13')](_0xb400('0x14'),_0x2811ab,_0xb400('0x17'));_0x438f8c(_0xa63c5[_0xb400('0x1b')][_0xb400('0x1a')]);}})[_0xb400('0x1c')](function(_0x4251d7){logger[_0xb400('0x19')](_0xb400('0x14'),_0x2811ab,_0x4251d7);_0xe35775(_0x4251d7);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index e3d5931..0b6e397 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 _0x7ffa=['length','chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register'];(function(_0x3e4c06,_0x5c7b40){var _0x20595b=function(_0x5f4245){while(--_0x5f4245){_0x3e4c06['push'](_0x3e4c06['shift']());}};_0x20595b(++_0x5c7b40);}(_0x7ffa,0x1ad));var _0xa7ff=function(_0x5b83ef,_0x4ffa44){_0x5b83ef=_0x5b83ef-0x0;var _0x307f59=_0x7ffa[_0x5b83ef];return _0x307f59;};'use strict';var ChatInternalMessageEvents=require(_0xa7ff('0x0'));var events=[_0xa7ff('0x1'),'remove','update'];function createListener(_0x59b4b5,_0x543af3){return function(_0xdd4439){_0x543af3[_0xa7ff('0x2')](_0x59b4b5,_0xdd4439);};}function removeListener(_0x57660e,_0x17bd57){return function(){ChatInternalMessageEvents[_0xa7ff('0x3')](_0x57660e,_0x17bd57);};}exports[_0xa7ff('0x4')]=function(_0x3c8599){for(var _0x595189=0x0,_0x3552b5=events[_0xa7ff('0x5')];_0x595189<_0x3552b5;_0x595189++){var _0x76ec14=events[_0x595189];var _0x43ee14=createListener(_0xa7ff('0x6')+_0x76ec14,_0x3c8599);ChatInternalMessageEvents['on'](_0x76ec14,_0x43ee14);}}; \ No newline at end of file +var _0x1fad=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fad,0x154));var _0xd1fa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1fad[_0x4b369d];return _0x571a98;};'use strict';var ChatInternalMessageEvents=require(_0xd1fa('0x0'));var events=[_0xd1fa('0x1'),_0xd1fa('0x2'),_0xd1fa('0x3')];function createListener(_0xee3f03,_0x10186d){return function(_0x924a01){_0x10186d['emit'](_0xee3f03,_0x924a01);};}function removeListener(_0x1bfdf1,_0x5e9752){return function(){ChatInternalMessageEvents[_0xd1fa('0x4')](_0x1bfdf1,_0x5e9752);};}exports[_0xd1fa('0x5')]=function(_0x1ad55b){for(var _0xb8338f=0x0,_0x2f4b60=events[_0xd1fa('0x6')];_0xb8338f<_0x2f4b60;_0xb8338f++){var _0x1d8e49=events[_0xb8338f];var _0x1f5039=createListener(_0xd1fa('0x7')+_0x1d8e49,_0x1ad55b);ChatInternalMessageEvents['on'](_0x1d8e49,_0x1f5039);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 5f9cb2a..955e504 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 _0xd205=['getUsers','/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xdb50e1,_0x112a80){var _0x2a50fc=function(_0xd47d89){while(--_0xd47d89){_0xdb50e1['push'](_0xdb50e1['shift']());}};_0x2a50fc(++_0x112a80);}(_0xd205,0x12e));var _0x5d20=function(_0x5002b9,_0x13f480){_0x5002b9=_0x5002b9-0x0;var _0x5e82c4=_0xd205[_0x5002b9];return _0x5e82c4;};'use strict';var multer=require(_0x5d20('0x0'));var util=require('util');var path=require(_0x5d20('0x1'));var timeout=require(_0x5d20('0x2'));var express=require('express');var router=express[_0x5d20('0x3')]();var fs_extra=require(_0x5d20('0x4'));var auth=require(_0x5d20('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5d20('0x6'));var controller=require(_0x5d20('0x7'));router[_0x5d20('0x8')]('/',auth[_0x5d20('0x9')](),controller[_0x5d20('0xa')]);router[_0x5d20('0x8')](_0x5d20('0xb'),auth['isAuthenticated'](),controller[_0x5d20('0xc')]);router[_0x5d20('0x8')]('/users',auth[_0x5d20('0x9')](),controller[_0x5d20('0xd')]);router[_0x5d20('0x8')](_0x5d20('0xe'),auth[_0x5d20('0x9')](),controller['show']);router[_0x5d20('0xf')]('/',auth[_0x5d20('0x9')](),controller[_0x5d20('0x10')]);router['put'](_0x5d20('0xe'),controller[_0x5d20('0x11')]);router[_0x5d20('0x12')]('/:id',auth[_0x5d20('0x9')](),controller[_0x5d20('0x13')]);module[_0x5d20('0x14')]=router; \ No newline at end of file +var _0x6839=['index','/describe','getUsers','show','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x435666,_0x2b89a4){var _0x22b742=function(_0x161501){while(--_0x161501){_0x435666['push'](_0x435666['shift']());}};_0x22b742(++_0x2b89a4);}(_0x6839,0x11c));var _0x9683=function(_0x2a04df,_0x48f2de){_0x2a04df=_0x2a04df-0x0;var _0x1369a2=_0x6839[_0x2a04df];return _0x1369a2;};'use strict';var multer=require(_0x9683('0x0'));var util=require(_0x9683('0x1'));var path=require('path');var timeout=require(_0x9683('0x2'));var express=require(_0x9683('0x3'));var router=express[_0x9683('0x4')]();var fs_extra=require(_0x9683('0x5'));var auth=require(_0x9683('0x6'));var interaction=require(_0x9683('0x7'));var config=require(_0x9683('0x8'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x9683('0x9')](),controller[_0x9683('0xa')]);router['get'](_0x9683('0xb'),auth[_0x9683('0x9')](),controller['describe']);router['get']('/users',auth['isAuthenticated'](),controller[_0x9683('0xc')]);router['get']('/:id',auth[_0x9683('0x9')](),controller[_0x9683('0xd')]);router[_0x9683('0xe')]('/',auth[_0x9683('0x9')](),controller[_0x9683('0xf')]);router[_0x9683('0x10')](_0x9683('0x11'),controller[_0x9683('0x12')]);router[_0x9683('0x13')]('/:id',auth[_0x9683('0x9')](),controller['destroy']);module[_0x9683('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 68cd70a..c2bc174 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 _0x57f8=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x5bf015,_0x46df17){var _0x552ebc=function(_0x43c9d6){while(--_0x43c9d6){_0x5bf015['push'](_0x5bf015['shift']());}};_0x552ebc(++_0x46df17);}(_0x57f8,0x198));var _0x857f=function(_0x529870,_0x975245){_0x529870=_0x529870-0x0;var _0x39435f=_0x57f8[_0x529870];return _0x39435f;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'body':{'type':Sequelize[_0x857f('0x1')](_0x857f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x857f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x857f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x857f('0x4')]('in',_0x857f('0x5')),'defaultValue':_0x857f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x857f('0x6')]},'providerName':{'type':Sequelize[_0x857f('0x7')]},'providerResponse':{'type':Sequelize[_0x857f('0x1')]}}; \ No newline at end of file +var _0x152f=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x152f,0x144));var _0xf152=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x152f[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'body':{'type':Sequelize[_0xf152('0x2')](_0xf152('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf152('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf152('0x5')]('in',_0xf152('0x6')),'defaultValue':_0xf152('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf152('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf152('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 24b44ae..8863697 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 _0x2251=['contact','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','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','redis','defaults','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatMessage','includeAll','include','catch','show','params','length','find','create','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','get','ChatInteraction','ChatInteractionId','UserId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','reject','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT'];(function(_0x18cab8,_0x5dccbb){var _0x3d0e6c=function(_0x333a91){while(--_0x333a91){_0x18cab8['push'](_0x18cab8['shift']());}};_0x3d0e6c(++_0x5dccbb);}(_0x2251,0x18c));var _0x1225=function(_0x2f5ef9,_0x5e6b50){_0x2f5ef9=_0x2f5ef9-0x0;var _0x5e5744=_0x2251[_0x2f5ef9];return _0x5e5744;};'use strict';var emlformat=require(_0x1225('0x0'));var rimraf=require(_0x1225('0x1'));var zipdir=require(_0x1225('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1225('0x3'));var moment=require(_0x1225('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1225('0x5'));var util=require('util');var path=require(_0x1225('0x6'));var sox=require(_0x1225('0x7'));var csv=require(_0x1225('0x8'));var ejs=require(_0x1225('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1225('0xa'));var deskjs=require(_0x1225('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1225('0xc'));var Papa=require('papaparse');var Redis=require(_0x1225('0xd'));var authService=require(_0x1225('0xe'));var qs=require(_0x1225('0xf'));var as=require(_0x1225('0x10'));var hardwareService=require(_0x1225('0x11'));var logger=require(_0x1225('0x12'))(_0x1225('0x13'));var utils=require(_0x1225('0x14'));var config=require(_0x1225('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1225('0x16'))['db'];config[_0x1225('0x17')]=_[_0x1225('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1225('0x17')]));require(_0x1225('0x19'))['register'](socket);var jayson=require(_0x1225('0x1a'));var client=jayson[_0x1225('0x1b')][_0x1225('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x1225('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2f6bc6,_0x3cd0f5,_0x4a8b42,_0x12beca){return new BPromise(function(_0x154f65,_0x45da84){var _0x2a2814=_0x12beca||client;return _0x2a2814[_0x1225('0x1d')](_0x2f6bc6,_0x4a8b42)['then'](function(_0x479fd1){logger[_0x1225('0x1e')](_0x1225('0x1f'),_0x3cd0f5,'request\x20sent');logger['debug'](_0x1225('0x20'),_0x3cd0f5,_0x1225('0x21'),JSON[_0x1225('0x22')](_0x479fd1));if(_0x479fd1[_0x1225('0x23')]){if(_0x479fd1[_0x1225('0x23')][_0x1225('0x24')]===0x1f4){logger[_0x1225('0x23')](_0x1225('0x1f'),_0x3cd0f5,_0x479fd1[_0x1225('0x23')][_0x1225('0x25')]);return _0x45da84(_0x479fd1[_0x1225('0x23')][_0x1225('0x25')]);}logger[_0x1225('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3cd0f5,_0x479fd1[_0x1225('0x23')]['message']);return _0x154f65(_0x479fd1[_0x1225('0x23')][_0x1225('0x25')]);}else{logger[_0x1225('0x1e')](_0x1225('0x1f'),_0x3cd0f5,_0x1225('0x21'));_0x154f65(_0x479fd1['result']['message']);}})['catch'](function(_0x2bcb70){logger['error'](_0x1225('0x1f'),_0x3cd0f5,_0x2bcb70);_0x45da84(_0x2bcb70);});});}function respondWithStatusCode(_0x287c0f,_0x40b0c9){_0x40b0c9=_0x40b0c9||0xcc;return function(_0x5ac38d){if(_0x5ac38d){return _0x287c0f[_0x1225('0x26')](_0x40b0c9);}return _0x287c0f[_0x1225('0x27')](_0x40b0c9)[_0x1225('0x28')]();};}function respondWithResult(_0x3cb997,_0x230afe){_0x230afe=_0x230afe||0xc8;return function(_0x179bf9){if(_0x179bf9){return _0x3cb997['status'](_0x230afe)[_0x1225('0x29')](_0x179bf9);}};}function respondWithFilteredResult(_0x1f5103,_0x343cb5){return function(_0x2fe3da){if(_0x2fe3da){var _0x360057=typeof _0x343cb5[_0x1225('0x2a')]===_0x1225('0x2b')&&typeof _0x343cb5[_0x1225('0x2c')]===_0x1225('0x2b');var _0x15c5aa=_0x2fe3da[_0x1225('0x2d')];var _0x423173=_0x360057?0x0:_0x343cb5[_0x1225('0x2a')];var _0x294f29=_0x360057?_0x2fe3da[_0x1225('0x2d')]:_0x343cb5[_0x1225('0x2a')]+_0x343cb5[_0x1225('0x2c')];var _0x26fc4e;if(_0x294f29>=_0x15c5aa){_0x294f29=_0x15c5aa;_0x26fc4e=0xc8;}else{_0x26fc4e=0xce;}_0x1f5103[_0x1225('0x27')](_0x26fc4e);return _0x1f5103[_0x1225('0x2e')](_0x1225('0x2f'),_0x423173+'-'+_0x294f29+'/'+_0x15c5aa)[_0x1225('0x29')](_0x2fe3da);}return null;};}function patchUpdates(_0x57fb06){return function(_0x55d9d0){try{jsonpatch[_0x1225('0x30')](_0x55d9d0,_0x57fb06,!![]);}catch(_0x50f831){return BPromise['reject'](_0x50f831);}return _0x55d9d0['save']();};}function saveUpdates(_0x19296e,_0x4a2ef1){return function(_0xdd631d){if(_0xdd631d){return _0xdd631d[_0x1225('0x31')](_0x19296e)[_0x1225('0x32')](function(_0x205f60){return _0x205f60;});}return null;};}function removeEntity(_0x5ccb76,_0x50c067){return function(_0x10e441){if(_0x10e441){return _0x10e441['destroy']()[_0x1225('0x32')](function(){_0x5ccb76[_0x1225('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed56d,_0x2f90b8){return function(_0x25866d){if(!_0x25866d){_0x2ed56d[_0x1225('0x26')](0x194);}return _0x25866d;};}function handleError(_0x5771cc,_0x5987f7){_0x5987f7=_0x5987f7||0x1f4;return function(_0x57956c){logger[_0x1225('0x23')](_0x57956c[_0x1225('0x33')]);if(_0x57956c[_0x1225('0x34')]){delete _0x57956c[_0x1225('0x34')];}_0x5771cc['status'](_0x5987f7)[_0x1225('0x35')](_0x57956c);};}exports['index']=function(_0x12e592,_0xedbe05){var _0x49bb16={},_0x67fd18={},_0x152fa5={'count':0x0,'rows':[]};var _0x3f2f50=_[_0x1225('0x36')](db['ChatMessage'][_0x1225('0x37')],function(_0x134988){return{'name':_0x134988[_0x1225('0x38')],'type':_0x134988[_0x1225('0x39')][_0x1225('0x3a')]};});_0x67fd18[_0x1225('0x3b')]=_['map'](_0x3f2f50,'name');_0x67fd18[_0x1225('0x3c')]=_[_0x1225('0x3d')](_0x12e592['query']);_0x67fd18[_0x1225('0x3e')]=_['intersection'](_0x67fd18['model'],_0x67fd18[_0x1225('0x3c')]);_0x49bb16[_0x1225('0x3f')]=_[_0x1225('0x40')](_0x67fd18[_0x1225('0x3b')],qs[_0x1225('0x41')](_0x12e592[_0x1225('0x3c')][_0x1225('0x41')]));_0x49bb16[_0x1225('0x3f')]=_0x49bb16[_0x1225('0x3f')]['length']?_0x49bb16[_0x1225('0x3f')]:_0x67fd18[_0x1225('0x3b')];if(!_0x12e592[_0x1225('0x3c')][_0x1225('0x42')](_0x1225('0x43'))){_0x49bb16[_0x1225('0x2c')]=qs[_0x1225('0x2c')](_0x12e592['query']['limit']);_0x49bb16[_0x1225('0x2a')]=qs[_0x1225('0x2a')](_0x12e592[_0x1225('0x3c')]['offset']);}_0x49bb16[_0x1225('0x44')]=qs[_0x1225('0x45')](_0x12e592['query']['sort']);_0x49bb16['where']=qs[_0x1225('0x3e')](_[_0x1225('0x46')](_0x12e592['query'],_0x67fd18[_0x1225('0x3e')]),_0x3f2f50);if(_0x12e592['query'][_0x1225('0x47')]){_0x49bb16[_0x1225('0x48')]=_[_0x1225('0x49')](_0x49bb16['where'],{'$or':_[_0x1225('0x36')](_0x3f2f50,function(_0x567d1f){if(_0x567d1f['type']!==_0x1225('0x4a')){var _0x7d23fa={};_0x7d23fa[_0x567d1f[_0x1225('0x34')]]={'$like':'%'+_0x12e592[_0x1225('0x3c')][_0x1225('0x47')]+'%'};return _0x7d23fa;}})});}_0x49bb16=_[_0x1225('0x49')]({},_0x49bb16,_0x12e592[_0x1225('0x4b')]);var _0x177526={'where':_0x49bb16[_0x1225('0x48')]};return db[_0x1225('0x4c')][_0x1225('0x2d')](_0x177526)[_0x1225('0x32')](function(_0x2ac9cc){_0x152fa5['count']=_0x2ac9cc;if(_0x12e592[_0x1225('0x3c')][_0x1225('0x4d')]){_0x49bb16[_0x1225('0x4e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x49bb16);})[_0x1225('0x32')](function(_0x15278b){_0x152fa5['rows']=_0x15278b;return _0x152fa5;})['then'](respondWithFilteredResult(_0xedbe05,_0x49bb16))[_0x1225('0x4f')](handleError(_0xedbe05,null));};exports[_0x1225('0x50')]=function(_0x2a2020,_0x4dc94a){var _0x5a9cd4={'raw':!![],'where':{'id':_0x2a2020[_0x1225('0x51')]['id']}},_0x28e2c6={};_0x28e2c6[_0x1225('0x3b')]=_[_0x1225('0x3d')](db[_0x1225('0x4c')][_0x1225('0x37')]);_0x28e2c6[_0x1225('0x3c')]=_['keys'](_0x2a2020['query']);_0x28e2c6['filters']=_[_0x1225('0x40')](_0x28e2c6['model'],_0x28e2c6['query']);_0x5a9cd4['attributes']=_[_0x1225('0x40')](_0x28e2c6[_0x1225('0x3b')],qs['fields'](_0x2a2020[_0x1225('0x3c')][_0x1225('0x41')]));_0x5a9cd4[_0x1225('0x3f')]=_0x5a9cd4['attributes'][_0x1225('0x52')]?_0x5a9cd4['attributes']:_0x28e2c6[_0x1225('0x3b')];if(_0x2a2020[_0x1225('0x3c')][_0x1225('0x4d')]){_0x5a9cd4['include']=[{'all':!![]}];}_0x5a9cd4=_[_0x1225('0x49')]({},_0x5a9cd4,_0x2a2020[_0x1225('0x4b')]);return db[_0x1225('0x4c')][_0x1225('0x53')](_0x5a9cd4)[_0x1225('0x32')](handleEntityNotFound(_0x4dc94a,null))[_0x1225('0x32')](respondWithResult(_0x4dc94a,null))[_0x1225('0x4f')](handleError(_0x4dc94a,null));};exports[_0x1225('0x54')]=function(_0x2222a9,_0xfde993){return db[_0x1225('0x4c')][_0x1225('0x54')](_0x2222a9[_0x1225('0x55')],{})[_0x1225('0x32')](respondWithResult(_0xfde993,0xc9))[_0x1225('0x4f')](handleError(_0xfde993,null));};exports[_0x1225('0x31')]=function(_0x57b678,_0x20c373){if(_0x57b678[_0x1225('0x55')]['id']){delete _0x57b678[_0x1225('0x55')]['id'];}return db[_0x1225('0x4c')][_0x1225('0x53')]({'where':{'id':_0x57b678[_0x1225('0x51')]['id']}})[_0x1225('0x32')](handleEntityNotFound(_0x20c373,null))[_0x1225('0x32')](saveUpdates(_0x57b678[_0x1225('0x55')],null))[_0x1225('0x32')](respondWithResult(_0x20c373,null))[_0x1225('0x4f')](handleError(_0x20c373,null));};exports['destroy']=function(_0x4f9bad,_0x4d38f6){return db[_0x1225('0x4c')][_0x1225('0x53')]({'where':{'id':_0x4f9bad['params']['id']}})[_0x1225('0x32')](handleEntityNotFound(_0x4d38f6,null))[_0x1225('0x32')](removeEntity(_0x4d38f6,null))[_0x1225('0x4f')](handleError(_0x4d38f6,null));};exports[_0x1225('0x56')]=function(_0x497a49,_0x109717){return db[_0x1225('0x4c')][_0x1225('0x56')]()[_0x1225('0x32')](respondWithResult(_0x109717,null))['catch'](handleError(_0x109717,null));};var interaction_log=require(_0x1225('0x12'))(_0x1225('0x57'));exports[_0x1225('0x58')]=function(_0x1cfaaa,_0x2b663d,_0x47dde5){var _0xe2a932={'agent':{},'channel':_0x1225('0x59')};if(_0x1cfaaa[_0x1225('0x55')]['id']){delete _0x1cfaaa[_0x1225('0x55')]['id'];}_0x1cfaaa[_0x1225('0x55')]['read']=!![];_0x1cfaaa['body'][_0x1225('0x5a')]=moment()[_0x1225('0x5b')](_0x1225('0x5c'));_0x1cfaaa[_0x1225('0x55')]['UserId']=_0x1cfaaa['body']['UserId']||_0x1cfaaa['user']['id'];_0xe2a932[_0x1225('0x5d')]['id']=_0x1cfaaa[_0x1225('0x55')]['UserId'];return db[_0x1225('0x4c')][_0x1225('0x53')]({'where':{'id':_0x1cfaaa[_0x1225('0x51')]['id'],'UserId':null}})[_0x1225('0x32')](handleEntityNotFound(_0x2b663d,null))['then'](saveUpdates(_0x1cfaaa[_0x1225('0x55')],null))[_0x1225('0x32')](function(_0x1130e2){if(_0x1130e2){_0xe2a932[_0x1225('0x25')]=_0x1130e2[_0x1225('0x5e')]({'plain':!![]});return db[_0x1225('0x5f')]['find']({'where':{'id':_0x1130e2[_0x1225('0x60')]}});}return null;})[_0x1225('0x32')](handleEntityNotFound(_0x2b663d,null))['then'](function(_0x1dab94){if(_0x1dab94){return _0x1dab94['update']({'UserId':_0x1cfaaa[_0x1225('0x55')][_0x1225('0x61')],'read1stAt':_[_0x1225('0x62')](_0x1dab94[_0x1225('0x63')])?moment()['format'](_0x1225('0x5c')):undefined});}return null;})[_0x1225('0x32')](function(_0x43f6a3){if(_0x43f6a3){_0xe2a932['interaction']=_0x43f6a3[_0x1225('0x5e')]({'plain':!![]});interaction_log[_0x1225('0x1e')](_0x1225('0x64'),_0x1cfaaa[_0x1225('0x65')]['id'],_0x1cfaaa[_0x1225('0x65')]['name'],_0x1cfaaa[_0x1225('0x65')][_0x1225('0x66')],_0xe2a932[_0x1225('0x67')]['id'],_0x1cfaaa[_0x1225('0x55')]?JSON['stringify'](_0x1cfaaa[_0x1225('0x55')]):'null');return respondWithRpcPromise(_0x1225('0x68'),_0x1225('0x69'),_0xe2a932);}return null;})[_0x1225('0x32')](function(_0x2a567d){var _0x127317='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a567d[_0x1225('0x25')][_0x1225('0x6a')];return db[_0x1225('0x6b')][_0x1225('0x3c')](_0x127317,{'type':db[_0x1225('0x6c')][_0x1225('0x6d')]['SELECT'],'raw':!![]})[_0x1225('0x32')](function(_0x24d8b7){return _0x24d8b7;});})[_0x1225('0x32')](function(_0xe8b9e9){if(_0xe8b9e9){_0xe2a932[_0x1225('0x25')]['contact']=_0xe8b9e9[0x0];if(!_0x1cfaaa[_0x1225('0x55')][_0x1225('0x61')])return;return db['User'][_0x1225('0x53')]({'where':{'id':_0x1cfaaa[_0x1225('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x1225('0x34'),_0x1225('0x6e'),_0x1225('0x6f'),_0x1225('0x70')],'raw':!![]});}return null;})['then'](function(_0x2fd0bf){if(!_0x2fd0bf)return null;_0xe2a932[_0x1225('0x25')][_0x1225('0x5d')]=_0x2fd0bf;return _0xe2a932;})['then'](function(_0x60c9d4){if(_0x60c9d4){if(_0x1cfaaa[_0x1225('0x55')][_0x1225('0x71')]){_0xe2a932['message'][_0x1225('0x72')]=util[_0x1225('0x5b')](_0x1225('0x73'),_0x1cfaaa['user'][_0x1225('0x34')]);_0xe2a932[_0x1225('0x25')][_0x1225('0x74')]=_0xe2a932[_0x1225('0x74')];_0xe2a932['message'][_0x1225('0x75')]=_0xe2a932[_0x1225('0x74')];_0xe2a932[_0x1225('0x25')]['event']='accept';return respondWithRpcPromise(_0x1225('0x76'),_0x1225('0x76'),{'event':_0x1225('0x77'),'message':_['merge'](_0xe2a932['message'],JSON[_0x1225('0x78')](_0xe2a932[_0x1225('0x67')][_0x1225('0x79')]))},client9002)['then'](function(){return _0xe2a932;});}return _0xe2a932;}return null;})[_0x1225('0x32')](respondWithResult(_0x2b663d,null))[_0x1225('0x4f')](handleError(_0x2b663d,null));};var interaction_log=require(_0x1225('0x12'))('chat-interactions');exports[_0x1225('0x7a')]=function(_0x40ee21,_0xdf0692,_0x40c5e0){var _0x2ddf5e={'agent':{},'channel':'chat'};if(_0x40ee21[_0x1225('0x55')]['id']){delete _0x40ee21[_0x1225('0x55')]['id'];}_0x40ee21[_0x1225('0x55')][_0x1225('0x61')]=_0x40ee21[_0x1225('0x55')][_0x1225('0x61')]||_0x40ee21[_0x1225('0x65')]['id'];_0x2ddf5e[_0x1225('0x5d')]['id']=_0x40ee21[_0x1225('0x55')][_0x1225('0x61')];return db[_0x1225('0x4c')][_0x1225('0x53')]({'where':{'id':_0x40ee21[_0x1225('0x51')]['id'],'UserId':null}})[_0x1225('0x32')](handleEntityNotFound(_0xdf0692,null))[_0x1225('0x32')](function(_0x3a54a5){if(_0x3a54a5){_0x2ddf5e[_0x1225('0x25')]=_0x3a54a5['get']({'plain':!![]});return db[_0x1225('0x5f')][_0x1225('0x53')]({'where':{'id':_0x3a54a5[_0x1225('0x60')]}});}return null;})['then'](handleEntityNotFound(_0xdf0692,null))[_0x1225('0x32')](function(_0x338fd4){if(_0x338fd4){_0x2ddf5e['interaction']=_0x338fd4[_0x1225('0x5e')]({'plain':!![]});interaction_log[_0x1225('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x40ee21[_0x1225('0x65')]['id'],_0x40ee21[_0x1225('0x65')][_0x1225('0x34')],_0x40ee21[_0x1225('0x65')][_0x1225('0x66')],_0x2ddf5e[_0x1225('0x67')]['id'],_0x40ee21['body']?JSON[_0x1225('0x22')](_0x40ee21[_0x1225('0x55')]):_0x1225('0x7b'));return respondWithRpcPromise(_0x1225('0x7c'),_0x1225('0x7d'),_0x2ddf5e);}return null;})[_0x1225('0x32')](function(_0x1922e3){var _0x4f6f9e=_0x1225('0x7e')+_0x1922e3[_0x1225('0x25')]['ContactId'];return db[_0x1225('0x6b')][_0x1225('0x3c')](_0x4f6f9e,{'type':db['Sequelize'][_0x1225('0x6d')][_0x1225('0x7f')],'raw':!![]})[_0x1225('0x32')](function(_0x270ed4){return _0x270ed4;});})[_0x1225('0x32')](function(_0x5a5713){if(_0x5a5713){_0x2ddf5e[_0x1225('0x25')][_0x1225('0x80')]=_0x5a5713[0x0];if(!_0x40ee21[_0x1225('0x55')][_0x1225('0x61')])return;return db['User']['find']({'where':{'id':_0x40ee21[_0x1225('0x55')]['UserId'],'role':_0x1225('0x5d')},'attributes':['id',_0x1225('0x34'),'fullname',_0x1225('0x6f'),'internal'],'raw':!![]});}return null;})[_0x1225('0x32')](function(_0x2118fb){if(!_0x2118fb)return null;_0x2ddf5e[_0x1225('0x25')][_0x1225('0x5d')]=_0x2118fb;return _0x2ddf5e;})[_0x1225('0x32')](function(_0x52bd07){if(_0x52bd07){_0x52bd07[_0x1225('0x25')][_0x1225('0x72')]=util[_0x1225('0x5b')](_0x1225('0x73'),_0x40ee21[_0x1225('0x65')]['name']);_0x52bd07[_0x1225('0x25')][_0x1225('0x74')]=_0x2ddf5e['channel'];_0x52bd07[_0x1225('0x25')][_0x1225('0x75')]=_0x2ddf5e[_0x1225('0x74')];_0x52bd07['message'][_0x1225('0x81')]=_0x1225('0x7a');respondWithRpcPromise(_0x1225('0x76'),_0x1225('0x76'),{'event':_0x1225('0x82'),'message':_['merge'](_0x2ddf5e['message'],JSON[_0x1225('0x78')](_0x2ddf5e['interaction'][_0x1225('0x79')]))},client9002);return _0x2ddf5e;}return null;})[_0x1225('0x32')](respondWithResult(_0xdf0692,null))[_0x1225('0x4f')](handleError(_0xdf0692,null));}; \ No newline at end of file +var _0xd2eb=['merge','VIRTUAL','options','then','includeAll','include','findAll','rows','keys','find','catch','create','body','params','destroy','describe','chat-interactions','accept','read','format','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','email','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','ChatMessage','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter'];(function(_0x5401da,_0x572809){var _0x2e669e=function(_0x382b70){while(--_0x382b70){_0x5401da['push'](_0x5401da['shift']());}};_0x2e669e(++_0x572809);}(_0xd2eb,0x1cf));var _0xbd2e=function(_0x2f8b82,_0x62abcb){_0x2f8b82=_0x2f8b82-0x0;var _0x60afef=_0xd2eb[_0x2f8b82];return _0x60afef;};'use strict';var emlformat=require(_0xbd2e('0x0'));var rimraf=require(_0xbd2e('0x1'));var zipdir=require(_0xbd2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd2e('0x3'));var moment=require(_0xbd2e('0x4'));var BPromise=require(_0xbd2e('0x5'));var Mustache=require(_0xbd2e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbd2e('0x7'));var csv=require('to-csv');var ejs=require(_0xbd2e('0x8'));var fs=require('fs');var fs_extra=require(_0xbd2e('0x9'));var _=require(_0xbd2e('0xa'));var squel=require(_0xbd2e('0xb'));var crypto=require(_0xbd2e('0xc'));var jsforce=require(_0xbd2e('0xd'));var deskjs=require(_0xbd2e('0xe'));var toCsv=require(_0xbd2e('0xf'));var querystring=require(_0xbd2e('0x10'));var Papa=require(_0xbd2e('0x11'));var Redis=require(_0xbd2e('0x12'));var authService=require(_0xbd2e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd2e('0x14'));var logger=require(_0xbd2e('0x15'))(_0xbd2e('0x16'));var utils=require(_0xbd2e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbd2e('0x18'));var db=require(_0xbd2e('0x19'))['db'];config[_0xbd2e('0x1a')]=_['defaults'](config[_0xbd2e('0x1a')],{'host':_0xbd2e('0x1b'),'port':0x18eb});var socket=require(_0xbd2e('0x1c'))(new Redis(config[_0xbd2e('0x1a')]));require(_0xbd2e('0x1d'))[_0xbd2e('0x1e')](socket);var jayson=require(_0xbd2e('0x1f'));var client=jayson[_0xbd2e('0x20')][_0xbd2e('0x21')]({'port':0x232c});var client9002=jayson[_0xbd2e('0x20')][_0xbd2e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3f98c5,_0x21037c,_0x100d14,_0x3327e0){return new BPromise(function(_0x420e9b,_0x4096d9){var _0x2d9b39=_0x3327e0||client;return _0x2d9b39[_0xbd2e('0x22')](_0x3f98c5,_0x100d14)['then'](function(_0x4b2a27){logger[_0xbd2e('0x23')](_0xbd2e('0x24'),_0x21037c,_0xbd2e('0x25'));logger['debug'](_0xbd2e('0x26'),_0x21037c,_0xbd2e('0x25'),JSON[_0xbd2e('0x27')](_0x4b2a27));if(_0x4b2a27[_0xbd2e('0x28')]){if(_0x4b2a27[_0xbd2e('0x28')][_0xbd2e('0x29')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x21037c,_0x4b2a27[_0xbd2e('0x28')][_0xbd2e('0x2a')]);return _0x4096d9(_0x4b2a27['error'][_0xbd2e('0x2a')]);}logger[_0xbd2e('0x28')](_0xbd2e('0x24'),_0x21037c,_0x4b2a27[_0xbd2e('0x28')][_0xbd2e('0x2a')]);return _0x420e9b(_0x4b2a27[_0xbd2e('0x28')]['message']);}else{logger[_0xbd2e('0x23')](_0xbd2e('0x24'),_0x21037c,'request\x20sent');_0x420e9b(_0x4b2a27[_0xbd2e('0x2b')][_0xbd2e('0x2a')]);}})['catch'](function(_0xa7673){logger[_0xbd2e('0x28')](_0xbd2e('0x24'),_0x21037c,_0xa7673);_0x4096d9(_0xa7673);});});}function respondWithStatusCode(_0x3d7ec8,_0x443cb0){_0x443cb0=_0x443cb0||0xcc;return function(_0x253715){if(_0x253715){return _0x3d7ec8['sendStatus'](_0x443cb0);}return _0x3d7ec8[_0xbd2e('0x2c')](_0x443cb0)[_0xbd2e('0x2d')]();};}function respondWithResult(_0x5726f6,_0x11c6a3){_0x11c6a3=_0x11c6a3||0xc8;return function(_0x1e1db0){if(_0x1e1db0){return _0x5726f6[_0xbd2e('0x2c')](_0x11c6a3)['json'](_0x1e1db0);}};}function respondWithFilteredResult(_0x33d845,_0x2671c4){return function(_0x16cced){if(_0x16cced){var _0x52156a=typeof _0x2671c4['offset']===_0xbd2e('0x2e')&&typeof _0x2671c4[_0xbd2e('0x2f')]===_0xbd2e('0x2e');var _0x408cf5=_0x16cced[_0xbd2e('0x30')];var _0x470670=_0x52156a?0x0:_0x2671c4[_0xbd2e('0x31')];var _0x48c266=_0x52156a?_0x16cced[_0xbd2e('0x30')]:_0x2671c4[_0xbd2e('0x31')]+_0x2671c4[_0xbd2e('0x2f')];var _0x2af6a1;if(_0x48c266>=_0x408cf5){_0x48c266=_0x408cf5;_0x2af6a1=0xc8;}else{_0x2af6a1=0xce;}_0x33d845['status'](_0x2af6a1);return _0x33d845[_0xbd2e('0x32')](_0xbd2e('0x33'),_0x470670+'-'+_0x48c266+'/'+_0x408cf5)[_0xbd2e('0x34')](_0x16cced);}return null;};}function patchUpdates(_0x504fef){return function(_0x3d0b56){try{jsonpatch[_0xbd2e('0x35')](_0x3d0b56,_0x504fef,!![]);}catch(_0x49c254){return BPromise[_0xbd2e('0x36')](_0x49c254);}return _0x3d0b56[_0xbd2e('0x37')]();};}function saveUpdates(_0x24247f,_0x30904e){return function(_0x4526db){if(_0x4526db){return _0x4526db[_0xbd2e('0x38')](_0x24247f)['then'](function(_0x5596ec){return _0x5596ec;});}return null;};}function removeEntity(_0xa29ce6,_0x309321){return function(_0x1c8a51){if(_0x1c8a51){return _0x1c8a51['destroy']()['then'](function(){_0xa29ce6[_0xbd2e('0x2c')](0xcc)[_0xbd2e('0x2d')]();});}};}function handleEntityNotFound(_0xfae1f4,_0x242432){return function(_0x4dd636){if(!_0x4dd636){_0xfae1f4[_0xbd2e('0x39')](0x194);}return _0x4dd636;};}function handleError(_0x26e2ba,_0x574ce4){_0x574ce4=_0x574ce4||0x1f4;return function(_0xf2776d){logger[_0xbd2e('0x28')](_0xf2776d[_0xbd2e('0x3a')]);if(_0xf2776d[_0xbd2e('0x3b')]){delete _0xf2776d['name'];}_0x26e2ba[_0xbd2e('0x2c')](_0x574ce4)[_0xbd2e('0x3c')](_0xf2776d);};}exports['index']=function(_0x51443f,_0xbfce34){var _0x524d35={},_0x5b1103={},_0x1c91a2={'count':0x0,'rows':[]};var _0x1b3de6=_['map'](db[_0xbd2e('0x3d')][_0xbd2e('0x3e')],function(_0x36edfb){return{'name':_0x36edfb['fieldName'],'type':_0x36edfb['type'][_0xbd2e('0x3f')]};});_0x5b1103[_0xbd2e('0x40')]=_[_0xbd2e('0x41')](_0x1b3de6,'name');_0x5b1103[_0xbd2e('0x42')]=_['keys'](_0x51443f[_0xbd2e('0x42')]);_0x5b1103[_0xbd2e('0x43')]=_[_0xbd2e('0x44')](_0x5b1103[_0xbd2e('0x40')],_0x5b1103[_0xbd2e('0x42')]);_0x524d35[_0xbd2e('0x45')]=_[_0xbd2e('0x44')](_0x5b1103[_0xbd2e('0x40')],qs[_0xbd2e('0x46')](_0x51443f['query'][_0xbd2e('0x46')]));_0x524d35[_0xbd2e('0x45')]=_0x524d35[_0xbd2e('0x45')][_0xbd2e('0x47')]?_0x524d35[_0xbd2e('0x45')]:_0x5b1103[_0xbd2e('0x40')];if(!_0x51443f['query'][_0xbd2e('0x48')]('nolimit')){_0x524d35[_0xbd2e('0x2f')]=qs['limit'](_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x2f')]);_0x524d35['offset']=qs[_0xbd2e('0x31')](_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x31')]);}_0x524d35['order']=qs[_0xbd2e('0x49')](_0x51443f['query'][_0xbd2e('0x49')]);_0x524d35[_0xbd2e('0x4a')]=qs[_0xbd2e('0x43')](_[_0xbd2e('0x4b')](_0x51443f[_0xbd2e('0x42')],_0x5b1103['filters']),_0x1b3de6);if(_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x4c')]){_0x524d35['where']=_[_0xbd2e('0x4d')](_0x524d35['where'],{'$or':_[_0xbd2e('0x41')](_0x1b3de6,function(_0x4c09d1){if(_0x4c09d1['type']!==_0xbd2e('0x4e')){var _0x7a649e={};_0x7a649e[_0x4c09d1[_0xbd2e('0x3b')]]={'$like':'%'+_0x51443f[_0xbd2e('0x42')][_0xbd2e('0x4c')]+'%'};return _0x7a649e;}})});}_0x524d35=_[_0xbd2e('0x4d')]({},_0x524d35,_0x51443f[_0xbd2e('0x4f')]);var _0x50353a={'where':_0x524d35[_0xbd2e('0x4a')]};return db['ChatMessage']['count'](_0x50353a)[_0xbd2e('0x50')](function(_0x14f150){_0x1c91a2[_0xbd2e('0x30')]=_0x14f150;if(_0x51443f['query'][_0xbd2e('0x51')]){_0x524d35[_0xbd2e('0x52')]=[{'all':!![]}];}return db[_0xbd2e('0x3d')][_0xbd2e('0x53')](_0x524d35);})[_0xbd2e('0x50')](function(_0x390a08){_0x1c91a2[_0xbd2e('0x54')]=_0x390a08;return _0x1c91a2;})['then'](respondWithFilteredResult(_0xbfce34,_0x524d35))['catch'](handleError(_0xbfce34,null));};exports['show']=function(_0x54ff6c,_0x38302d){var _0x1d2f70={'raw':!![],'where':{'id':_0x54ff6c['params']['id']}},_0x41a5ad={};_0x41a5ad['model']=_[_0xbd2e('0x55')](db['ChatMessage'][_0xbd2e('0x3e')]);_0x41a5ad[_0xbd2e('0x42')]=_[_0xbd2e('0x55')](_0x54ff6c[_0xbd2e('0x42')]);_0x41a5ad[_0xbd2e('0x43')]=_[_0xbd2e('0x44')](_0x41a5ad[_0xbd2e('0x40')],_0x41a5ad[_0xbd2e('0x42')]);_0x1d2f70[_0xbd2e('0x45')]=_['intersection'](_0x41a5ad[_0xbd2e('0x40')],qs['fields'](_0x54ff6c[_0xbd2e('0x42')][_0xbd2e('0x46')]));_0x1d2f70[_0xbd2e('0x45')]=_0x1d2f70[_0xbd2e('0x45')]['length']?_0x1d2f70['attributes']:_0x41a5ad[_0xbd2e('0x40')];if(_0x54ff6c[_0xbd2e('0x42')]['includeAll']){_0x1d2f70[_0xbd2e('0x52')]=[{'all':!![]}];}_0x1d2f70=_[_0xbd2e('0x4d')]({},_0x1d2f70,_0x54ff6c['options']);return db['ChatMessage'][_0xbd2e('0x56')](_0x1d2f70)[_0xbd2e('0x50')](handleEntityNotFound(_0x38302d,null))[_0xbd2e('0x50')](respondWithResult(_0x38302d,null))[_0xbd2e('0x57')](handleError(_0x38302d,null));};exports[_0xbd2e('0x58')]=function(_0xb47842,_0x42a36f){return db[_0xbd2e('0x3d')][_0xbd2e('0x58')](_0xb47842['body'],{})[_0xbd2e('0x50')](respondWithResult(_0x42a36f,0xc9))[_0xbd2e('0x57')](handleError(_0x42a36f,null));};exports['update']=function(_0x4612b0,_0x288465){if(_0x4612b0[_0xbd2e('0x59')]['id']){delete _0x4612b0[_0xbd2e('0x59')]['id'];}return db[_0xbd2e('0x3d')][_0xbd2e('0x56')]({'where':{'id':_0x4612b0[_0xbd2e('0x5a')]['id']}})[_0xbd2e('0x50')](handleEntityNotFound(_0x288465,null))[_0xbd2e('0x50')](saveUpdates(_0x4612b0[_0xbd2e('0x59')],null))[_0xbd2e('0x50')](respondWithResult(_0x288465,null))[_0xbd2e('0x57')](handleError(_0x288465,null));};exports[_0xbd2e('0x5b')]=function(_0x175ae5,_0x1cb705){return db[_0xbd2e('0x3d')]['find']({'where':{'id':_0x175ae5[_0xbd2e('0x5a')]['id']}})[_0xbd2e('0x50')](handleEntityNotFound(_0x1cb705,null))[_0xbd2e('0x50')](removeEntity(_0x1cb705,null))['catch'](handleError(_0x1cb705,null));};exports[_0xbd2e('0x5c')]=function(_0x48eb7b,_0x545ad8){return db[_0xbd2e('0x3d')][_0xbd2e('0x5c')]()['then'](respondWithResult(_0x545ad8,null))[_0xbd2e('0x57')](handleError(_0x545ad8,null));};var interaction_log=require(_0xbd2e('0x15'))(_0xbd2e('0x5d'));exports[_0xbd2e('0x5e')]=function(_0x34739b,_0x2647fb,_0x3fe782){var _0x37ba0e={'agent':{},'channel':'chat'};if(_0x34739b[_0xbd2e('0x59')]['id']){delete _0x34739b[_0xbd2e('0x59')]['id'];}_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x5f')]=!![];_0x34739b[_0xbd2e('0x59')]['readAt']=moment()[_0xbd2e('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x61')]=_0x34739b['body'][_0xbd2e('0x61')]||_0x34739b[_0xbd2e('0x62')]['id'];_0x37ba0e['agent']['id']=_0x34739b[_0xbd2e('0x59')]['UserId'];return db[_0xbd2e('0x3d')]['find']({'where':{'id':_0x34739b[_0xbd2e('0x5a')]['id'],'UserId':null}})[_0xbd2e('0x50')](handleEntityNotFound(_0x2647fb,null))[_0xbd2e('0x50')](saveUpdates(_0x34739b['body'],null))[_0xbd2e('0x50')](function(_0x3a06db){if(_0x3a06db){_0x37ba0e[_0xbd2e('0x2a')]=_0x3a06db[_0xbd2e('0x63')]({'plain':!![]});return db[_0xbd2e('0x64')][_0xbd2e('0x56')]({'where':{'id':_0x3a06db[_0xbd2e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2647fb,null))[_0xbd2e('0x50')](function(_0x10f740){if(_0x10f740){return _0x10f740[_0xbd2e('0x38')]({'UserId':_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x61')],'read1stAt':_[_0xbd2e('0x66')](_0x10f740[_0xbd2e('0x67')])?moment()[_0xbd2e('0x60')](_0xbd2e('0x68')):undefined});}return null;})['then'](function(_0x30076a){if(_0x30076a){_0x37ba0e[_0xbd2e('0x69')]=_0x30076a[_0xbd2e('0x63')]({'plain':!![]});interaction_log[_0xbd2e('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34739b[_0xbd2e('0x62')]['id'],_0x34739b[_0xbd2e('0x62')]['name'],_0x34739b['user']['role'],_0x37ba0e[_0xbd2e('0x69')]['id'],_0x34739b['body']?JSON['stringify'](_0x34739b['body']):_0xbd2e('0x6a'));return respondWithRpcPromise('AcceptMessage',_0xbd2e('0x6b'),_0x37ba0e);}return null;})[_0xbd2e('0x50')](function(_0x3e485f){var _0x2be706=_0xbd2e('0x6c')+_0x3e485f[_0xbd2e('0x2a')][_0xbd2e('0x6d')];return db['sequelize'][_0xbd2e('0x42')](_0x2be706,{'type':db[_0xbd2e('0x6e')][_0xbd2e('0x6f')][_0xbd2e('0x70')],'raw':!![]})[_0xbd2e('0x50')](function(_0x3505e3){return _0x3505e3;});})[_0xbd2e('0x50')](function(_0x262041){if(_0x262041){_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x71')]=_0x262041[0x0];if(!_0x34739b[_0xbd2e('0x59')][_0xbd2e('0x61')])return;return db[_0xbd2e('0x72')][_0xbd2e('0x56')]({'where':{'id':_0x34739b['body']['UserId'],'role':_0xbd2e('0x73')},'attributes':['id','name',_0xbd2e('0x74'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x585116){if(!_0x585116)return null;_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x73')]=_0x585116;return _0x37ba0e;})['then'](function(_0x27cfb6){if(_0x27cfb6){if(_0x34739b['body'][_0xbd2e('0x75')]){_0x37ba0e['message'][_0xbd2e('0x76')]=util[_0xbd2e('0x60')](_0xbd2e('0x77'),_0x34739b[_0xbd2e('0x62')]['name']);_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x78')]=_0x37ba0e[_0xbd2e('0x78')];_0x37ba0e[_0xbd2e('0x2a')]['motionChannel']=_0x37ba0e[_0xbd2e('0x78')];_0x37ba0e[_0xbd2e('0x2a')][_0xbd2e('0x79')]=_0xbd2e('0x5e');return respondWithRpcPromise(_0xbd2e('0x7a'),_0xbd2e('0x7a'),{'event':_0xbd2e('0x7b'),'message':_[_0xbd2e('0x4d')](_0x37ba0e['message'],JSON[_0xbd2e('0x7c')](_0x37ba0e['interaction'][_0xbd2e('0x7d')]))},client9002)['then'](function(){return _0x37ba0e;});}return _0x37ba0e;}return null;})['then'](respondWithResult(_0x2647fb,null))['catch'](handleError(_0x2647fb,null));};var interaction_log=require('../../config/logger')(_0xbd2e('0x5d'));exports[_0xbd2e('0x36')]=function(_0xf7f935,_0x3770f9,_0x2ff52e){var _0x1104be={'agent':{},'channel':_0xbd2e('0x7e')};if(_0xf7f935[_0xbd2e('0x59')]['id']){delete _0xf7f935[_0xbd2e('0x59')]['id'];}_0xf7f935[_0xbd2e('0x59')][_0xbd2e('0x61')]=_0xf7f935[_0xbd2e('0x59')]['UserId']||_0xf7f935[_0xbd2e('0x62')]['id'];_0x1104be[_0xbd2e('0x73')]['id']=_0xf7f935[_0xbd2e('0x59')][_0xbd2e('0x61')];return db[_0xbd2e('0x3d')]['find']({'where':{'id':_0xf7f935[_0xbd2e('0x5a')]['id'],'UserId':null}})[_0xbd2e('0x50')](handleEntityNotFound(_0x3770f9,null))[_0xbd2e('0x50')](function(_0x355e61){if(_0x355e61){_0x1104be[_0xbd2e('0x2a')]=_0x355e61[_0xbd2e('0x63')]({'plain':!![]});return db[_0xbd2e('0x64')][_0xbd2e('0x56')]({'where':{'id':_0x355e61[_0xbd2e('0x65')]}});}return null;})[_0xbd2e('0x50')](handleEntityNotFound(_0x3770f9,null))['then'](function(_0x4a4343){if(_0x4a4343){_0x1104be[_0xbd2e('0x69')]=_0x4a4343[_0xbd2e('0x63')]({'plain':!![]});interaction_log['info'](_0xbd2e('0x7f'),_0xf7f935['user']['id'],_0xf7f935[_0xbd2e('0x62')][_0xbd2e('0x3b')],_0xf7f935[_0xbd2e('0x62')][_0xbd2e('0x80')],_0x1104be[_0xbd2e('0x69')]['id'],_0xf7f935[_0xbd2e('0x59')]?JSON[_0xbd2e('0x27')](_0xf7f935[_0xbd2e('0x59')]):_0xbd2e('0x6a'));return respondWithRpcPromise(_0xbd2e('0x81'),_0xbd2e('0x82'),_0x1104be);}return null;})[_0xbd2e('0x50')](function(_0x11dd41){var _0x40ffc5=_0xbd2e('0x6c')+_0x11dd41[_0xbd2e('0x2a')][_0xbd2e('0x6d')];return db[_0xbd2e('0x83')]['query'](_0x40ffc5,{'type':db['Sequelize'][_0xbd2e('0x6f')][_0xbd2e('0x70')],'raw':!![]})[_0xbd2e('0x50')](function(_0x2b7082){return _0x2b7082;});})['then'](function(_0x2763c7){if(_0x2763c7){_0x1104be[_0xbd2e('0x2a')][_0xbd2e('0x71')]=_0x2763c7[0x0];if(!_0xf7f935['body'][_0xbd2e('0x61')])return;return db[_0xbd2e('0x72')][_0xbd2e('0x56')]({'where':{'id':_0xf7f935[_0xbd2e('0x59')][_0xbd2e('0x61')],'role':_0xbd2e('0x73')},'attributes':['id',_0xbd2e('0x3b'),'fullname',_0xbd2e('0x84'),'internal'],'raw':!![]});}return null;})[_0xbd2e('0x50')](function(_0x1e3488){if(!_0x1e3488)return null;_0x1104be[_0xbd2e('0x2a')][_0xbd2e('0x73')]=_0x1e3488;return _0x1104be;})[_0xbd2e('0x50')](function(_0x261e07){if(_0x261e07){_0x261e07[_0xbd2e('0x2a')][_0xbd2e('0x76')]=util[_0xbd2e('0x60')](_0xbd2e('0x77'),_0xf7f935[_0xbd2e('0x62')][_0xbd2e('0x3b')]);_0x261e07[_0xbd2e('0x2a')]['channel']=_0x1104be[_0xbd2e('0x78')];_0x261e07['message'][_0xbd2e('0x85')]=_0x1104be[_0xbd2e('0x78')];_0x261e07[_0xbd2e('0x2a')][_0xbd2e('0x79')]=_0xbd2e('0x36');respondWithRpcPromise('EventManager',_0xbd2e('0x7a'),{'event':_0xbd2e('0x86'),'message':_['merge'](_0x1104be[_0xbd2e('0x2a')],JSON[_0xbd2e('0x7c')](_0x1104be[_0xbd2e('0x69')][_0xbd2e('0x7d')]))},client9002);return _0x1104be;}return null;})[_0xbd2e('0x50')](respondWithResult(_0x3770f9,null))[_0xbd2e('0x57')](handleError(_0x3770f9,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 6c0a7bb..633a00d 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 _0x3541=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3541,0x1ea));var _0x1354=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x3541[_0x3ff085];return _0x2b68c3;};'use strict';var EventEmitter=require(_0x1354('0x0'));var ChatMessage=require(_0x1354('0x1'))['db'][_0x1354('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1354('0x3'),'afterUpdate':_0x1354('0x4'),'afterDestroy':_0x1354('0x5')};function emitEvent(_0x1e5767){return function(_0x2fec68,_0x425f6d,_0x1f7011){ChatMessageEvents['emit'](_0x1e5767+':'+_0x2fec68['id'],_0x2fec68);ChatMessageEvents[_0x1354('0x6')](_0x1e5767,_0x2fec68);_0x1f7011(null);};}for(var e in events){if(events[_0x1354('0x7')](e)){var event=events[e];ChatMessage[_0x1354('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x3d9d=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3d9d,0x9c));var _0xd3d9=function(_0x11a6bb,_0x39c422){_0x11a6bb=_0x11a6bb-0x0;var _0x1492b1=_0x3d9d[_0x11a6bb];return _0x1492b1;};'use strict';var EventEmitter=require(_0xd3d9('0x0'));var ChatMessage=require(_0xd3d9('0x1'))['db'][_0xd3d9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd3d9('0x3')](0x0);var events={'afterCreate':_0xd3d9('0x4'),'afterUpdate':_0xd3d9('0x5'),'afterDestroy':_0xd3d9('0x6')};function emitEvent(_0x37cd45){return function(_0x20de98,_0x1c2606,_0x57574d){ChatMessageEvents[_0xd3d9('0x7')](_0x37cd45+':'+_0x20de98['id'],_0x20de98);ChatMessageEvents[_0xd3d9('0x7')](_0x37cd45,_0x20de98);_0x57574d(null);};}for(var e in events){if(events[_0xd3d9('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 dec854c..6363178 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 _0xe726=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','secret','isNil'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe726,0xc3));var _0x6e72=function(_0x16b161,_0x5231ba){_0x16b161=_0x16b161-0x0;var _0x5a2c8e=_0xe726[_0x16b161];return _0x5a2c8e;};'use strict';var _=require(_0x6e72('0x0'));var util=require(_0x6e72('0x1'));var logger=require(_0x6e72('0x2'))(_0x6e72('0x3'));var moment=require(_0x6e72('0x4'));var BPromise=require(_0x6e72('0x5'));var rp=require(_0x6e72('0x6'));var fs=require('fs');var path=require(_0x6e72('0x7'));var rimraf=require(_0x6e72('0x8'));var config=require(_0x6e72('0x9'));var attributes=require(_0x6e72('0xa'));module[_0x6e72('0xb')]=function(_0x359964,_0x17d0ee){return _0x359964[_0x6e72('0xc')](_0x6e72('0xd'),attributes,{'tableName':_0x6e72('0xe'),'paranoid':![],'indexes':[{'name':_0x6e72('0xf'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fc3d4,_0x5275b1,_0x252fbb){var _0x4c50a4=_0x359964[_0x6e72('0x10')];var _0x5d0897=_0x3fc3d4[_0x6e72('0x11')]({'plain':!![]});if(_0x5d0897[_0x6e72('0x12')][_0x6e72('0x13')]()==='in'||_0x5d0897[_0x6e72('0x12')]['toLowerCase']()==='out'&&!_0x5d0897[_0x6e72('0x14')]&&!_[_0x6e72('0x15')](_0x5d0897['UserId'])){_0x4c50a4[_0x6e72('0x16')][_0x6e72('0x17')]({'where':{'id':_0x5d0897[_0x6e72('0x18')]}})[_0x6e72('0x19')](function(_0x8bea8c){if(_0x8bea8c){_0x8bea8c[_0x6e72('0x1a')]({'lastMsgAt':_0x5d0897[_0x6e72('0x1b')],'lastMsgDirection':_0x5d0897[_0x6e72('0x12')]['toLowerCase']()});}})['catch'](function(_0x2bb6ec){console[_0x6e72('0x1c')](_0x2bb6ec);});}_0x252fbb();}},'charset':_0x6e72('0x1d'),'collate':_0x6e72('0x1e')});}; \ No newline at end of file +var _0x4a5e=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','error','lodash','util','../../config/logger','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4a5e,0x158));var _0xe4a5=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0x4a5e[_0xe6f4ef];return _0x4f3447;};'use strict';var _=require(_0xe4a5('0x0'));var util=require(_0xe4a5('0x1'));var logger=require(_0xe4a5('0x2'))('api');var moment=require(_0xe4a5('0x3'));var BPromise=require(_0xe4a5('0x4'));var rp=require(_0xe4a5('0x5'));var fs=require('fs');var path=require(_0xe4a5('0x6'));var rimraf=require(_0xe4a5('0x7'));var config=require(_0xe4a5('0x8'));var attributes=require(_0xe4a5('0x9'));module['exports']=function(_0x3781a3,_0x13640d){return _0x3781a3[_0xe4a5('0xa')](_0xe4a5('0xb'),attributes,{'tableName':_0xe4a5('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe4a5('0xd')],'type':_0xe4a5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5630f5,_0x398baa,_0x25773d){var _0x5dca12=_0x3781a3[_0xe4a5('0xf')];var _0x1a279c=_0x5630f5[_0xe4a5('0x10')]({'plain':!![]});if(_0x1a279c[_0xe4a5('0x11')][_0xe4a5('0x12')]()==='in'||_0x1a279c[_0xe4a5('0x11')]['toLowerCase']()===_0xe4a5('0x13')&&!_0x1a279c[_0xe4a5('0x14')]&&!_[_0xe4a5('0x15')](_0x1a279c[_0xe4a5('0x16')])){_0x5dca12['ChatInteraction'][_0xe4a5('0x17')]({'where':{'id':_0x1a279c[_0xe4a5('0x18')]}})[_0xe4a5('0x19')](function(_0x402b54){if(_0x402b54){_0x402b54[_0xe4a5('0x1a')]({'lastMsgAt':_0x1a279c[_0xe4a5('0x1b')],'lastMsgDirection':_0x1a279c[_0xe4a5('0x11')][_0xe4a5('0x12')]()});}})['catch'](function(_0x1ac77d){console[_0xe4a5('0x1c')](_0x1ac77d);});}_0x25773d();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 1ba8108..857c1ca 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 _0xa240=['jayson/promise','client','http','defaults','localhost','redis','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4c12fb,_0x3abf1a){var _0x40aeca=function(_0x151455){while(--_0x151455){_0x4c12fb['push'](_0x4c12fb['shift']());}};_0x40aeca(++_0x3abf1a);}(_0xa240,0xd7));var _0x0a24=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xa240[_0x3fe6df];return _0x372a0e;};'use strict';var _=require(_0x0a24('0x0'));var util=require('util');var moment=require(_0x0a24('0x1'));var BPromise=require(_0x0a24('0x2'));var rs=require(_0x0a24('0x3'));var fs=require('fs');var Redis=require(_0x0a24('0x4'));var db=require(_0x0a24('0x5'))['db'];var utils=require(_0x0a24('0x6'));var logger=require(_0x0a24('0x7'))('rpc');var config=require(_0x0a24('0x8'));var jayson=require(_0x0a24('0x9'));var client=jayson[_0x0a24('0xa')][_0x0a24('0xb')]({'port':0x232a});config['redis']=_[_0x0a24('0xc')](config['redis'],{'host':_0x0a24('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a24('0xe')]));require(_0x0a24('0xf'))['register'](socket);function respondWithRpcPromise(_0x3cada0,_0x5b36be,_0x4e47a8){return new BPromise(function(_0x4a8729,_0x2eb3a5){return client['request'](_0x3cada0,_0x4e47a8)[_0x0a24('0x10')](function(_0x4433f5){logger[_0x0a24('0x11')](_0x0a24('0x12'),_0x5b36be,_0x0a24('0x13'));logger[_0x0a24('0x14')](_0x0a24('0x15'),_0x5b36be,'request\x20sent',JSON[_0x0a24('0x16')](_0x4433f5));if(_0x4433f5[_0x0a24('0x17')]){if(_0x4433f5[_0x0a24('0x17')][_0x0a24('0x18')]===0x1f4){logger[_0x0a24('0x17')](_0x0a24('0x12'),_0x5b36be,_0x4433f5[_0x0a24('0x17')][_0x0a24('0x19')]);return _0x2eb3a5(_0x4433f5[_0x0a24('0x17')][_0x0a24('0x19')]);}logger[_0x0a24('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5b36be,_0x4433f5['error'][_0x0a24('0x19')]);return _0x4a8729(_0x4433f5[_0x0a24('0x17')][_0x0a24('0x19')]);}else{logger[_0x0a24('0x11')]('ChatMessage,\x20%s,\x20%s',_0x5b36be,'request\x20sent');_0x4a8729(_0x4433f5[_0x0a24('0x1a')][_0x0a24('0x19')]);}})[_0x0a24('0x1b')](function(_0x189762){logger['error'](_0x0a24('0x12'),_0x5b36be,_0x189762);_0x2eb3a5(_0x189762);});});}exports[_0x0a24('0x1c')]=function(_0x2a231d){var _0xacdebe=this;return new Promise(function(_0x24ba18,_0x5272fe){return db[_0x0a24('0x1d')]['create'](_0x2a231d[_0x0a24('0x1e')],{'raw':_0x2a231d[_0x0a24('0x1f')]?_0x2a231d[_0x0a24('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x0a24('0x10')](function(_0x46975e){logger[_0x0a24('0x11')]('CreateChatMessage',_0x2a231d);logger[_0x0a24('0x14')](_0x0a24('0x1c'),_0x2a231d,JSON[_0x0a24('0x16')](_0x46975e));_0x24ba18(_0x46975e);})[_0x0a24('0x1b')](function(_0x37136f){logger[_0x0a24('0x17')](_0x0a24('0x1c'),_0x37136f[_0x0a24('0x19')],_0x2a231d);_0x5272fe(_0xacdebe[_0x0a24('0x17')](0x1f4,_0x37136f[_0x0a24('0x19')]));});});}; \ No newline at end of file +var _0x1e6a=['ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x1e6a,0x135));var _0xa1e6=function(_0x518122,_0x293879){_0x518122=_0x518122-0x0;var _0x26eb6e=_0x1e6a[_0x518122];return _0x26eb6e;};'use strict';var _=require(_0xa1e6('0x0'));var util=require('util');var moment=require(_0xa1e6('0x1'));var BPromise=require(_0xa1e6('0x2'));var rs=require(_0xa1e6('0x3'));var fs=require('fs');var Redis=require(_0xa1e6('0x4'));var db=require(_0xa1e6('0x5'))['db'];var utils=require(_0xa1e6('0x6'));var logger=require(_0xa1e6('0x7'))(_0xa1e6('0x8'));var config=require(_0xa1e6('0x9'));var jayson=require(_0xa1e6('0xa'));var client=jayson[_0xa1e6('0xb')]['http']({'port':0x232a});config[_0xa1e6('0xc')]=_[_0xa1e6('0xd')](config[_0xa1e6('0xc')],{'host':_0xa1e6('0xe'),'port':0x18eb});var socket=require(_0xa1e6('0xf'))(new Redis(config['redis']));require(_0xa1e6('0x10'))[_0xa1e6('0x11')](socket);function respondWithRpcPromise(_0x28ca89,_0x43ed06,_0x42c51a){return new BPromise(function(_0x443db3,_0x241ac3){return client[_0xa1e6('0x12')](_0x28ca89,_0x42c51a)[_0xa1e6('0x13')](function(_0x553902){logger[_0xa1e6('0x14')](_0xa1e6('0x15'),_0x43ed06,'request\x20sent');logger[_0xa1e6('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x43ed06,_0xa1e6('0x17'),JSON[_0xa1e6('0x18')](_0x553902));if(_0x553902[_0xa1e6('0x19')]){if(_0x553902[_0xa1e6('0x19')]['code']===0x1f4){logger[_0xa1e6('0x19')](_0xa1e6('0x15'),_0x43ed06,_0x553902[_0xa1e6('0x19')][_0xa1e6('0x1a')]);return _0x241ac3(_0x553902[_0xa1e6('0x19')][_0xa1e6('0x1a')]);}logger[_0xa1e6('0x19')]('ChatMessage,\x20%s,\x20%s',_0x43ed06,_0x553902['error'][_0xa1e6('0x1a')]);return _0x443db3(_0x553902[_0xa1e6('0x19')][_0xa1e6('0x1a')]);}else{logger[_0xa1e6('0x14')](_0xa1e6('0x15'),_0x43ed06,_0xa1e6('0x17'));_0x443db3(_0x553902['result']['message']);}})[_0xa1e6('0x1b')](function(_0x1ce59e){logger[_0xa1e6('0x19')](_0xa1e6('0x15'),_0x43ed06,_0x1ce59e);_0x241ac3(_0x1ce59e);});});}exports[_0xa1e6('0x1c')]=function(_0x29aa6b){var _0x3d3ed3=this;return new Promise(function(_0x183440,_0x5da910){return db[_0xa1e6('0x1d')][_0xa1e6('0x1e')](_0x29aa6b['body'],{'raw':_0x29aa6b[_0xa1e6('0x1f')]?_0x29aa6b[_0xa1e6('0x1f')][_0xa1e6('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x6c8ebd){logger['info'](_0xa1e6('0x1c'),_0x29aa6b);logger['debug'](_0xa1e6('0x1c'),_0x29aa6b,JSON[_0xa1e6('0x18')](_0x6c8ebd));_0x183440(_0x6c8ebd);})[_0xa1e6('0x1b')](function(_0x2f2c9f){logger[_0xa1e6('0x19')](_0xa1e6('0x1c'),_0x2f2c9f[_0xa1e6('0x1a')],_0x29aa6b);_0x5da910(_0x3d3ed3[_0xa1e6('0x19')](0x1f4,_0x2f2c9f[_0xa1e6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f80c1ac..8f1eefa 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 _0xf776=['length','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x5023cb,_0x5ae9a6){var _0x52c5d6=function(_0x4fe596){while(--_0x4fe596){_0x5023cb['push'](_0x5023cb['shift']());}};_0x52c5d6(++_0x5ae9a6);}(_0xf776,0x169));var _0x6f77=function(_0x5d51d1,_0x3935ee){_0x5d51d1=_0x5d51d1-0x0;var _0x495bb6=_0xf776[_0x5d51d1];return _0x495bb6;};'use strict';var ChatMessageEvents=require(_0x6f77('0x0'));var events=['save',_0x6f77('0x1'),_0x6f77('0x2')];function createListener(_0x4e3b77,_0x43f2fd){return function(_0x2458e0){_0x43f2fd[_0x6f77('0x3')](_0x4e3b77,_0x2458e0);};}function removeListener(_0x16874b,_0x53ec9b){return function(){ChatMessageEvents[_0x6f77('0x4')](_0x16874b,_0x53ec9b);};}exports['register']=function(_0xf62e3e){for(var _0x21909a=0x0,_0x36ffd2=events[_0x6f77('0x5')];_0x21909a<_0x36ffd2;_0x21909a++){var _0x545ba9=events[_0x21909a];var _0x1dd52f=createListener('chatMessage:'+_0x545ba9,_0xf62e3e);ChatMessageEvents['on'](_0x545ba9,_0x1dd52f);}}; \ No newline at end of file +var _0x96aa=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x330665,_0x515789){var _0x53feef=function(_0x11ab8f){while(--_0x11ab8f){_0x330665['push'](_0x330665['shift']());}};_0x53feef(++_0x515789);}(_0x96aa,0x67));var _0xa96a=function(_0x4d00ef,_0x3087a2){_0x4d00ef=_0x4d00ef-0x0;var _0x1e67b3=_0x96aa[_0x4d00ef];return _0x1e67b3;};'use strict';var ChatMessageEvents=require(_0xa96a('0x0'));var events=[_0xa96a('0x1'),'remove',_0xa96a('0x2')];function createListener(_0x32bff8,_0x227d50){return function(_0x12bbb7){_0x227d50[_0xa96a('0x3')](_0x32bff8,_0x12bbb7);};}function removeListener(_0x4911c8,_0x1ce4a1){return function(){ChatMessageEvents[_0xa96a('0x4')](_0x4911c8,_0x1ce4a1);};}exports['register']=function(_0x464684){for(var _0x2e9a41=0x0,_0x282c8c=events[_0xa96a('0x5')];_0x2e9a41<_0x282c8c;_0x2e9a41++){var _0x44fb9d=events[_0x2e9a41];var _0x3c7329=createListener(_0xa96a('0x6')+_0x44fb9d,_0x464684);ChatMessageEvents['on'](_0x44fb9d,_0x3c7329);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3e6280a..1271a53 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 _0x576d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','chat','chatmessage:create','/:id/accept','accept','/:id/reject','reject','delete','multer'];(function(_0x326a2b,_0x50855f){var _0x177f23=function(_0x445fdf){while(--_0x445fdf){_0x326a2b['push'](_0x326a2b['shift']());}};_0x177f23(++_0x50855f);}(_0x576d,0x17f));var _0xd576=function(_0x5c3251,_0x27ef9c){_0x5c3251=_0x5c3251-0x0;var _0x449a88=_0x576d[_0x5c3251];return _0x449a88;};'use strict';var multer=require(_0xd576('0x0'));var util=require(_0xd576('0x1'));var path=require(_0xd576('0x2'));var timeout=require(_0xd576('0x3'));var express=require(_0xd576('0x4'));var router=express['Router']();var fs_extra=require(_0xd576('0x5'));var auth=require(_0xd576('0x6'));var interaction=require(_0xd576('0x7'));var config=require(_0xd576('0x8'));var controller=require(_0xd576('0x9'));router['get']('/',auth[_0xd576('0xa')](),controller[_0xd576('0xb')]);router[_0xd576('0xc')](_0xd576('0xd'),auth[_0xd576('0xa')](),controller[_0xd576('0xe')]);router[_0xd576('0xc')](_0xd576('0xf'),auth[_0xd576('0xa')](),controller['show']);router[_0xd576('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xd576('0x11'),_0xd576('0x12')),controller['create']);router['put'](_0xd576('0xf'),controller['update']);router['put'](_0xd576('0x13'),auth[_0xd576('0xa')](),controller[_0xd576('0x14')]);router['put'](_0xd576('0x15'),auth[_0xd576('0xa')](),controller[_0xd576('0x16')]);router[_0xd576('0x17')](_0xd576('0xf'),auth[_0xd576('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x40a1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','isAuthenticated','describe','/:id','show','tracked','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports'];(function(_0x6c4358,_0x17bcbb){var _0x7aa4ef=function(_0x3ddd15){while(--_0x3ddd15){_0x6c4358['push'](_0x6c4358['shift']());}};_0x7aa4ef(++_0x17bcbb);}(_0x40a1,0x10e));var _0x140a=function(_0x1e3572,_0x12a24b){_0x1e3572=_0x1e3572-0x0;var _0x9fafc=_0x40a1[_0x1e3572];return _0x9fafc;};'use strict';var multer=require(_0x140a('0x0'));var util=require(_0x140a('0x1'));var path=require(_0x140a('0x2'));var timeout=require(_0x140a('0x3'));var express=require(_0x140a('0x4'));var router=express[_0x140a('0x5')]();var fs_extra=require(_0x140a('0x6'));var auth=require(_0x140a('0x7'));var interaction=require(_0x140a('0x8'));var config=require(_0x140a('0x9'));var controller=require(_0x140a('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x140a('0xb')]);router[_0x140a('0xc')]('/describe',auth[_0x140a('0xd')](),controller[_0x140a('0xe')]);router[_0x140a('0xc')](_0x140a('0xf'),auth['isAuthenticated'](),controller[_0x140a('0x10')]);router['post']('/',auth[_0x140a('0xd')](),interaction[_0x140a('0x11')]('chat',_0x140a('0x12')),controller['create']);router[_0x140a('0x13')](_0x140a('0xf'),controller[_0x140a('0x14')]);router[_0x140a('0x13')](_0x140a('0x15'),auth[_0x140a('0xd')](),controller[_0x140a('0x16')]);router[_0x140a('0x13')](_0x140a('0x17'),auth[_0x140a('0xd')](),controller[_0x140a('0x18')]);router['delete'](_0x140a('0xf'),auth[_0x140a('0xd')](),controller[_0x140a('0x19')]);module[_0x140a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index c1d92f4..d194e8b 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['medium','exports','TEXT'];(function(_0x5e5059,_0x34b3b9){var _0x10923d=function(_0x36998b){while(--_0x36998b){_0x5e5059['push'](_0x5e5059['shift']());}};_0x10923d(++_0x34b3b9);}(_0x2032,0xd9));var _0x2203=function(_0x4d8ad1,_0x871373){_0x4d8ad1=_0x4d8ad1-0x0;var _0x59bb3a=_0x2032[_0x4d8ad1];return _0x59bb3a;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x2032,0xd9));var _0x2203=function(_0x2c31d3,_0x1323fc){_0x2c31d3=_0x2c31d3-0x0;var _0x22c330=_0x2032[_0x2c31d3];return _0x22c330;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 6e83331..85f80cb 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(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x7a54,0x106));var _0x47a5=function(_0x2c408a,_0x5a9fb9){_0x2c408a=_0x2c408a-0x0;var _0x8a805e=_0x7a54[_0x2c408a];return _0x8a805e;};'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(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x7a54,0x106));var _0x47a5=function(_0x45bf96,_0x5a4dd7){_0x45bf96=_0x45bf96-0x0;var _0x488a0c=_0x7a54[_0x45bf96];return _0x488a0c;};'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 1cb8bad..d9252c5 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 _0xdbef=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','save'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xdbef,0xc2));var _0xfdbe=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xdbef[_0x1c546c];return _0x2cc384;};'use strict';var EventEmitter=require(_0xfdbe('0x0'));var ChatOfflineMessage=require(_0xfdbe('0x1'))['db'][_0xfdbe('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfdbe('0x3'),'afterUpdate':'update','afterDestroy':_0xfdbe('0x4')};function emitEvent(_0x4dfc5e){return function(_0x4f7e6c,_0x58aa38,_0x48aaff){ChatOfflineMessageEvents[_0xfdbe('0x5')](_0x4dfc5e+':'+_0x4f7e6c['id'],_0x4f7e6c);ChatOfflineMessageEvents[_0xfdbe('0x5')](_0x4dfc5e,_0x4f7e6c);_0x48aaff(null);};}for(var e in events){if(events[_0xfdbe('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xfdbe('0x7')](e,emitEvent(event));}}module[_0xfdbe('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x9888=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x186d35,_0x2cdd9b){var _0x341737=function(_0x166719){while(--_0x166719){_0x186d35['push'](_0x186d35['shift']());}};_0x341737(++_0x2cdd9b);}(_0x9888,0xd0));var _0x8988=function(_0x2ba691,_0x1886f9){_0x2ba691=_0x2ba691-0x0;var _0x5f4202=_0x9888[_0x2ba691];return _0x5f4202;};'use strict';var EventEmitter=require(_0x8988('0x0'));var ChatOfflineMessage=require(_0x8988('0x1'))['db'][_0x8988('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8988('0x3')](0x0);var events={'afterCreate':_0x8988('0x4'),'afterUpdate':_0x8988('0x5'),'afterDestroy':_0x8988('0x6')};function emitEvent(_0xee07a5){return function(_0x24a255,_0x3e4d04,_0x25862f){ChatOfflineMessageEvents[_0x8988('0x7')](_0xee07a5+':'+_0x24a255['id'],_0x24a255);ChatOfflineMessageEvents[_0x8988('0x7')](_0xee07a5,_0x24a255);_0x25862f(null);};}for(var e in events){if(events[_0x8988('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x8988('0x9')](e,emitEvent(event));}}module[_0x8988('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 834bc3d..034f141 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 _0x820f=['ChatOfflineMessage','chat_offline_messages','exports'];(function(_0x82392f,_0x270ce2){var _0x575213=function(_0x2179f7){while(--_0x2179f7){_0x82392f['push'](_0x82392f['shift']());}};_0x575213(++_0x270ce2);}(_0x820f,0x68));var _0xf820=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x820f[_0x2af160];return _0x439d67;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xf820('0x0')]=function(_0x2fd52a){return _0x2fd52a['define'](_0xf820('0x1'),attributes,{'tableName':_0xf820('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x78c5=['exports','define','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0x78c5,0x130));var _0x578c=function(_0x18c618,_0x484959){_0x18c618=_0x18c618-0x0;var _0x4c1381=_0x78c5[_0x18c618];return _0x4c1381;};'use strict';var attributes=require(_0x578c('0x0'));module[_0x578c('0x1')]=function(_0x1455c8){return _0x1455c8[_0x578c('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x578c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x578c('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4f0749b..783a5b9 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 _0x1340=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1340,0x74));var _0x0134=function(_0x2a4145,_0x1596d1){_0x2a4145=_0x2a4145-0x0;var _0x591aad=_0x1340[_0x2a4145];return _0x591aad;};'use strict';var _=require('lodash');var util=require(_0x0134('0x0'));var moment=require(_0x0134('0x1'));var BPromise=require(_0x0134('0x2'));var rs=require(_0x0134('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0134('0x4'))['db'];var utils=require(_0x0134('0x5'));var logger=require(_0x0134('0x6'))(_0x0134('0x7'));var config=require(_0x0134('0x8'));var jayson=require(_0x0134('0x9'));var client=jayson[_0x0134('0xa')][_0x0134('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a250a,_0xb5af74,_0x2aef8e){return new BPromise(function(_0x54ce2e,_0x260ba4){return client['request'](_0x4a250a,_0x2aef8e)[_0x0134('0xc')](function(_0x8e09df){logger[_0x0134('0xd')](_0x0134('0xe'),_0xb5af74,_0x0134('0xf'));logger['debug'](_0x0134('0x10'),_0xb5af74,_0x0134('0xf'),JSON[_0x0134('0x11')](_0x8e09df));if(_0x8e09df[_0x0134('0x12')]){if(_0x8e09df[_0x0134('0x12')][_0x0134('0x13')]===0x1f4){logger['error'](_0x0134('0xe'),_0xb5af74,_0x8e09df['error']['message']);return _0x260ba4(_0x8e09df[_0x0134('0x12')][_0x0134('0x14')]);}logger[_0x0134('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xb5af74,_0x8e09df['error'][_0x0134('0x14')]);return _0x54ce2e(_0x8e09df[_0x0134('0x12')][_0x0134('0x14')]);}else{logger[_0x0134('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0xb5af74,_0x0134('0xf'));_0x54ce2e(_0x8e09df[_0x0134('0x15')]['message']);}})[_0x0134('0x16')](function(_0x528179){logger['error'](_0x0134('0xe'),_0xb5af74,_0x528179);_0x260ba4(_0x528179);});});} \ No newline at end of file +var _0x0d64=['then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3c4f4f,_0x4aa56f){var _0x3cb6cc=function(_0x379f5f){while(--_0x379f5f){_0x3c4f4f['push'](_0x3c4f4f['shift']());}};_0x3cb6cc(++_0x4aa56f);}(_0x0d64,0x1c4));var _0x40d6=function(_0x451655,_0x1be29f){_0x451655=_0x451655-0x0;var _0x2bdf91=_0x0d64[_0x451655];return _0x2bdf91;};'use strict';var _=require('lodash');var util=require(_0x40d6('0x0'));var moment=require(_0x40d6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d6('0x2'));var db=require(_0x40d6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x40d6('0x4'))(_0x40d6('0x5'));var config=require('../../config/environment');var jayson=require(_0x40d6('0x6'));var client=jayson[_0x40d6('0x7')][_0x40d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x483a47,_0x586a2e,_0x1edd89){return new BPromise(function(_0x448ce2,_0x2ac99f){return client[_0x40d6('0x9')](_0x483a47,_0x1edd89)[_0x40d6('0xa')](function(_0x1faf99){logger[_0x40d6('0xb')](_0x40d6('0xc'),_0x586a2e,'request\x20sent');logger[_0x40d6('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x586a2e,_0x40d6('0xe'),JSON[_0x40d6('0xf')](_0x1faf99));if(_0x1faf99['error']){if(_0x1faf99['error'][_0x40d6('0x10')]===0x1f4){logger[_0x40d6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x586a2e,_0x1faf99['error']['message']);return _0x2ac99f(_0x1faf99[_0x40d6('0x11')][_0x40d6('0x12')]);}logger[_0x40d6('0x11')](_0x40d6('0xc'),_0x586a2e,_0x1faf99[_0x40d6('0x11')][_0x40d6('0x12')]);return _0x448ce2(_0x1faf99[_0x40d6('0x11')][_0x40d6('0x12')]);}else{logger[_0x40d6('0xb')](_0x40d6('0xc'),_0x586a2e,_0x40d6('0xe'));_0x448ce2(_0x1faf99[_0x40d6('0x13')][_0x40d6('0x12')]);}})[_0x40d6('0x14')](function(_0x2b5000){logger[_0x40d6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x586a2e,_0x2b5000);_0x2ac99f(_0x2b5000);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index cc37743..82de335 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 _0x9aa7=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe','show','post','create','delete','/:id'];(function(_0x19f1d2,_0x43a870){var _0x491f84=function(_0x25610a){while(--_0x25610a){_0x19f1d2['push'](_0x19f1d2['shift']());}};_0x491f84(++_0x43a870);}(_0x9aa7,0xa2));var _0x79aa=function(_0x31399a,_0x1a5ec3){_0x31399a=_0x31399a-0x0;var _0x23d59f=_0x9aa7[_0x31399a];return _0x23d59f;};'use strict';var multer=require(_0x79aa('0x0'));var util=require('util');var path=require(_0x79aa('0x1'));var timeout=require(_0x79aa('0x2'));var express=require(_0x79aa('0x3'));var router=express[_0x79aa('0x4')]();var fs_extra=require(_0x79aa('0x5'));var auth=require(_0x79aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x79aa('0x7'));var controller=require(_0x79aa('0x8'));router[_0x79aa('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79aa('0x9')](_0x79aa('0xa'),auth[_0x79aa('0xb')](),controller[_0x79aa('0xc')]);router['get']('/:id',auth[_0x79aa('0xb')](),controller[_0x79aa('0xd')]);router[_0x79aa('0xe')]('/',auth['isAuthenticated'](),controller[_0x79aa('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x79aa('0x10')](_0x79aa('0x11'),auth[_0x79aa('0xb')](),controller[_0x79aa('0x12')]);module[_0x79aa('0x13')]=router; \ No newline at end of file +var _0xc0e9=['update','delete','/:id','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','index','/describe','isAuthenticated','describe','show','post','create','put'];(function(_0x5c0de0,_0x28b5e8){var _0x4242a7=function(_0x23a316){while(--_0x23a316){_0x5c0de0['push'](_0x5c0de0['shift']());}};_0x4242a7(++_0x28b5e8);}(_0xc0e9,0xb8));var _0x9c0e=function(_0xcb17a8,_0x12548e){_0xcb17a8=_0xcb17a8-0x0;var _0x9aa364=_0xc0e9[_0xcb17a8];return _0x9aa364;};'use strict';var multer=require(_0x9c0e('0x0'));var util=require('util');var path=require(_0x9c0e('0x1'));var timeout=require(_0x9c0e('0x2'));var express=require('express');var router=express[_0x9c0e('0x3')]();var fs_extra=require(_0x9c0e('0x4'));var auth=require(_0x9c0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c0e('0x6'));var controller=require(_0x9c0e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9c0e('0x8')]);router['get'](_0x9c0e('0x9'),auth[_0x9c0e('0xa')](),controller[_0x9c0e('0xb')]);router['get']('/:id',auth[_0x9c0e('0xa')](),controller[_0x9c0e('0xc')]);router[_0x9c0e('0xd')]('/',auth['isAuthenticated'](),controller[_0x9c0e('0xe')]);router[_0x9c0e('0xf')]('/:id',auth[_0x9c0e('0xa')](),controller[_0x9c0e('0x10')]);router[_0x9c0e('0x11')](_0x9c0e('0x12'),auth['isAuthenticated'](),controller[_0x9c0e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index bd7a11b..4259225 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 _0xfebe=['STRING','INTEGER','sequelize','ENUM','mouseOver','timeout'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfebe,0x104));var _0xefeb=function(_0x15833e,_0x58a046){_0x15833e=_0x15833e-0x0;var _0x5c4745=_0xfebe[_0x15833e];return _0x5c4745;};'use strict';var Sequelize=require(_0xefeb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xefeb('0x1')](_0xefeb('0x2'),_0xefeb('0x3')),'defaultValue':_0xefeb('0x2')},'selector':{'type':Sequelize[_0xefeb('0x4')]},'timeout':{'type':Sequelize[_0xefeb('0x5')]}}; \ No newline at end of file +var _0x5d4c=['sequelize','exports','STRING','mouseOver','INTEGER'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x5d4c,0xfa));var _0xc5d4=function(_0x23a44e,_0x1e5b0b){_0x23a44e=_0x23a44e-0x0;var _0x4cfb30=_0x5d4c[_0x23a44e];return _0x4cfb30;};'use strict';var Sequelize=require(_0xc5d4('0x0'));module[_0xc5d4('0x1')]={'name':{'type':Sequelize[_0xc5d4('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc5d4('0x3'),'timeout'),'defaultValue':_0xc5d4('0x3')},'selector':{'type':Sequelize[_0xc5d4('0x2')]},'timeout':{'type':Sequelize[_0xc5d4('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 29fea71..5846803 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 _0x7bae=['create','body','catch','params','destroy','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','options','find'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7bae[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={'raw':!![],'where':{'id':_0x48c869['params']['id']}},_0x369451={};_0x369451['model']=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')]);_0x369451[_0xe7ba('0x2e')]=_[_0xe7ba('0x2b')](_0x48c869['query']);_0x369451[_0xe7ba('0x2f')]=_[_0xe7ba('0x30')](_0x369451['model'],_0x369451[_0xe7ba('0x2e')]);_0x92fe7['attributes']=_['intersection'](_0x369451[_0xe7ba('0x31')],qs[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x2e')]['fields']));_0x92fe7[_0xe7ba('0x33')]=_0x92fe7['attributes'][_0xe7ba('0x34')]?_0x92fe7[_0xe7ba('0x33')]:_0x369451[_0xe7ba('0x31')];if(_0x48c869[_0xe7ba('0x2e')][_0xe7ba('0x35')]){_0x92fe7['include']=[{'all':!![]}];}_0x92fe7=_[_0xe7ba('0x36')]({},_0x92fe7,_0x48c869[_0xe7ba('0x37')]);return db['ChatProactiveAction'][_0xe7ba('0x38')](_0x92fe7)[_0xe7ba('0x26')](handleEntityNotFound(_0x102925,null))[_0xe7ba('0x26')](respondWithResult(_0x102925,null))['catch'](handleError(_0x102925,null));};exports[_0xe7ba('0x39')]=function(_0x23c36e,_0x5db8ab){return db[_0xe7ba('0x2c')][_0xe7ba('0x39')](_0x23c36e[_0xe7ba('0x3a')],{})['then'](respondWithResult(_0x5db8ab,0xc9))[_0xe7ba('0x3b')](handleError(_0x5db8ab,null));};exports[_0xe7ba('0x25')]=function(_0x575f4b,_0x330e98){if(_0x575f4b[_0xe7ba('0x3a')]['id']){delete _0x575f4b[_0xe7ba('0x3a')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x575f4b[_0xe7ba('0x3c')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x330e98,null))[_0xe7ba('0x26')](saveUpdates(_0x575f4b[_0xe7ba('0x3a')],null))[_0xe7ba('0x26')](respondWithResult(_0x330e98,null))['catch'](handleError(_0x330e98,null));};exports[_0xe7ba('0x3d')]=function(_0x2a6d2a,_0x3139a6){return db[_0xe7ba('0x2c')]['find']({'where':{'id':_0x2a6d2a[_0xe7ba('0x3c')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x3139a6,null))[_0xe7ba('0x26')](removeEntity(_0x3139a6,null))[_0xe7ba('0x3b')](handleError(_0x3139a6,null));}; \ No newline at end of file +var _0xb1a3=['limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x32189c,_0x4fa006){var _0x8da8f1=function(_0x239113){while(--_0x239113){_0x32189c['push'](_0x32189c['shift']());}};_0x8da8f1(++_0x4fa006);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xb1a3[_0xfcbcb8];return _0x1b1f97;};'use strict';var emlformat=require(_0x3b1a('0x0'));var rimraf=require(_0x3b1a('0x1'));var zipdir=require(_0x3b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b1a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b1a('0x4'));var util=require(_0x3b1a('0x5'));var path=require(_0x3b1a('0x6'));var sox=require(_0x3b1a('0x7'));var csv=require(_0x3b1a('0x8'));var ejs=require(_0x3b1a('0x9'));var fs=require('fs');var fs_extra=require(_0x3b1a('0xa'));var _=require('lodash');var squel=require(_0x3b1a('0xb'));var crypto=require(_0x3b1a('0xc'));var jsforce=require(_0x3b1a('0xd'));var deskjs=require(_0x3b1a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b1a('0xf'));var Redis=require(_0x3b1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b1a('0x12'));var logger=require('../../config/logger')(_0x3b1a('0x13'));var utils=require(_0x3b1a('0x14'));var config=require(_0x3b1a('0x15'));var licenseUtil=require(_0x3b1a('0x16'));var db=require(_0x3b1a('0x17'))['db'];function respondWithStatusCode(_0x1fea99,_0x2bd423){_0x2bd423=_0x2bd423||0xcc;return function(_0x32e77a){if(_0x32e77a){return _0x1fea99[_0x3b1a('0x18')](_0x2bd423);}return _0x1fea99['status'](_0x2bd423)['end']();};}function respondWithResult(_0x8aad4b,_0x3dfeda){_0x3dfeda=_0x3dfeda||0xc8;return function(_0x19c135){if(_0x19c135){return _0x8aad4b[_0x3b1a('0x19')](_0x3dfeda)['json'](_0x19c135);}};}function respondWithFilteredResult(_0x1b175e,_0x2f0674){return function(_0x55ac06){if(_0x55ac06){var _0x19bbc1=typeof _0x2f0674[_0x3b1a('0x1a')]===_0x3b1a('0x1b')&&typeof _0x2f0674[_0x3b1a('0x1c')]===_0x3b1a('0x1b');var _0xf10b60=_0x55ac06[_0x3b1a('0x1d')];var _0x220869=_0x19bbc1?0x0:_0x2f0674['offset'];var _0x14996f=_0x19bbc1?_0x55ac06[_0x3b1a('0x1d')]:_0x2f0674['offset']+_0x2f0674[_0x3b1a('0x1c')];var _0x5758fd;if(_0x14996f>=_0xf10b60){_0x14996f=_0xf10b60;_0x5758fd=0xc8;}else{_0x5758fd=0xce;}_0x1b175e[_0x3b1a('0x19')](_0x5758fd);return _0x1b175e[_0x3b1a('0x1e')](_0x3b1a('0x1f'),_0x220869+'-'+_0x14996f+'/'+_0xf10b60)[_0x3b1a('0x20')](_0x55ac06);}return null;};}function patchUpdates(_0xe1113d){return function(_0x13eeec){try{jsonpatch['apply'](_0x13eeec,_0xe1113d,!![]);}catch(_0x2c0a87){return BPromise[_0x3b1a('0x21')](_0x2c0a87);}return _0x13eeec[_0x3b1a('0x22')]();};}function saveUpdates(_0x1a09f1,_0x42bdf6){return function(_0x4f5f52){if(_0x4f5f52){return _0x4f5f52['update'](_0x1a09f1)[_0x3b1a('0x23')](function(_0x447d94){return _0x447d94;});}return null;};}function removeEntity(_0x5829ea,_0x3af980){return function(_0x1728df){if(_0x1728df){return _0x1728df[_0x3b1a('0x24')]()[_0x3b1a('0x23')](function(){_0x5829ea['status'](0xcc)[_0x3b1a('0x25')]();});}};}function handleEntityNotFound(_0x417c2e,_0x2fbac5){return function(_0x482484){if(!_0x482484){_0x417c2e[_0x3b1a('0x18')](0x194);}return _0x482484;};}function handleError(_0x3744f0,_0x155d77){_0x155d77=_0x155d77||0x1f4;return function(_0x45ebfc){logger[_0x3b1a('0x26')](_0x45ebfc[_0x3b1a('0x27')]);if(_0x45ebfc['name']){delete _0x45ebfc[_0x3b1a('0x28')];}_0x3744f0[_0x3b1a('0x19')](_0x155d77)[_0x3b1a('0x29')](_0x45ebfc);};}exports[_0x3b1a('0x2a')]=function(_0x2ff415,_0x1c6399){var _0x5cb4d0={'raw':!![],'where':{'id':_0x2ff415[_0x3b1a('0x2b')]['id']}},_0x58aec7={};_0x58aec7[_0x3b1a('0x2c')]=_[_0x3b1a('0x2d')](db[_0x3b1a('0x2e')][_0x3b1a('0x2f')]);_0x58aec7[_0x3b1a('0x30')]=_[_0x3b1a('0x2d')](_0x2ff415[_0x3b1a('0x30')]);_0x58aec7[_0x3b1a('0x31')]=_['intersection'](_0x58aec7[_0x3b1a('0x2c')],_0x58aec7[_0x3b1a('0x30')]);_0x5cb4d0[_0x3b1a('0x32')]=_[_0x3b1a('0x33')](_0x58aec7[_0x3b1a('0x2c')],qs[_0x3b1a('0x34')](_0x2ff415[_0x3b1a('0x30')][_0x3b1a('0x34')]));_0x5cb4d0[_0x3b1a('0x32')]=_0x5cb4d0['attributes'][_0x3b1a('0x35')]?_0x5cb4d0[_0x3b1a('0x32')]:_0x58aec7[_0x3b1a('0x2c')];if(_0x2ff415[_0x3b1a('0x30')]['includeAll']){_0x5cb4d0[_0x3b1a('0x36')]=[{'all':!![]}];}_0x5cb4d0=_[_0x3b1a('0x37')]({},_0x5cb4d0,_0x2ff415[_0x3b1a('0x38')]);return db[_0x3b1a('0x2e')][_0x3b1a('0x39')](_0x5cb4d0)[_0x3b1a('0x23')](handleEntityNotFound(_0x1c6399,null))[_0x3b1a('0x23')](respondWithResult(_0x1c6399,null))[_0x3b1a('0x3a')](handleError(_0x1c6399,null));};exports['create']=function(_0x189e00,_0x2be45d){return db[_0x3b1a('0x2e')][_0x3b1a('0x3b')](_0x189e00[_0x3b1a('0x3c')],{})[_0x3b1a('0x23')](respondWithResult(_0x2be45d,0xc9))[_0x3b1a('0x3a')](handleError(_0x2be45d,null));};exports['update']=function(_0x3c2108,_0x420d13){if(_0x3c2108[_0x3b1a('0x3c')]['id']){delete _0x3c2108[_0x3b1a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x3b1a('0x39')]({'where':{'id':_0x3c2108[_0x3b1a('0x2b')]['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x420d13,null))[_0x3b1a('0x23')](saveUpdates(_0x3c2108[_0x3b1a('0x3c')],null))[_0x3b1a('0x23')](respondWithResult(_0x420d13,null))[_0x3b1a('0x3a')](handleError(_0x420d13,null));};exports[_0x3b1a('0x24')]=function(_0x228667,_0x5277bb){return db[_0x3b1a('0x2e')][_0x3b1a('0x39')]({'where':{'id':_0x228667['params']['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x5277bb,null))[_0x3b1a('0x23')](removeEntity(_0x5277bb,null))[_0x3b1a('0x3a')](handleError(_0x5277bb,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index e1ff686..6f20255 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 _0x4e80=['request-promise','path','rimraf','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0x25af59,_0x27587e){var _0x2cf9ce=function(_0x28e5df){while(--_0x28e5df){_0x25af59['push'](_0x25af59['shift']());}};_0x2cf9ce(++_0x27587e);}(_0x4e80,0x6a));var _0x04e8=function(_0x2dc2bf,_0x445916){_0x2dc2bf=_0x2dc2bf-0x0;var _0x5d1be8=_0x4e80[_0x2dc2bf];return _0x5d1be8;};'use strict';var _=require(_0x04e8('0x0'));var util=require('util');var logger=require(_0x04e8('0x1'))(_0x04e8('0x2'));var moment=require(_0x04e8('0x3'));var BPromise=require('bluebird');var rp=require(_0x04e8('0x4'));var fs=require('fs');var path=require(_0x04e8('0x5'));var rimraf=require(_0x04e8('0x6'));var config=require('../../config/environment');var attributes=require(_0x04e8('0x7'));module['exports']=function(_0x572047,_0x3b97e3){return _0x572047['define'](_0x04e8('0x8'),attributes,{'tableName':_0x04e8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1544=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes'];(function(_0x2c1256,_0x3f5700){var _0x199a61=function(_0x14ce69){while(--_0x14ce69){_0x2c1256['push'](_0x2c1256['shift']());}};_0x199a61(++_0x3f5700);}(_0x1544,0x93));var _0x4154=function(_0x25c43c,_0x3a3aa3){_0x25c43c=_0x25c43c-0x0;var _0x28e108=_0x1544[_0x25c43c];return _0x28e108;};'use strict';var _=require(_0x4154('0x0'));var util=require(_0x4154('0x1'));var logger=require(_0x4154('0x2'))(_0x4154('0x3'));var moment=require(_0x4154('0x4'));var BPromise=require('bluebird');var rp=require(_0x4154('0x5'));var fs=require('fs');var path=require(_0x4154('0x6'));var rimraf=require('rimraf');var config=require(_0x4154('0x7'));var attributes=require(_0x4154('0x8'));module[_0x4154('0x9')]=function(_0x37c817,_0x1213a3){return _0x37c817[_0x4154('0xa')](_0x4154('0xb'),attributes,{'tableName':_0x4154('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 896a8a0..cc605a3 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 _0x0e86=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','info','result','lodash','util','moment'];(function(_0x19db45,_0x531c14){var _0x3a9367=function(_0x41ca8){while(--_0x41ca8){_0x19db45['push'](_0x19db45['shift']());}};_0x3a9367(++_0x531c14);}(_0x0e86,0x111));var _0x60e8=function(_0x3db464,_0x53fd4e){_0x3db464=_0x3db464-0x0;var _0x81faa2=_0x0e86[_0x3db464];return _0x81faa2;};'use strict';var _=require(_0x60e8('0x0'));var util=require(_0x60e8('0x1'));var moment=require(_0x60e8('0x2'));var BPromise=require(_0x60e8('0x3'));var rs=require(_0x60e8('0x4'));var fs=require('fs');var Redis=require(_0x60e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x60e8('0x6'));var logger=require(_0x60e8('0x7'))(_0x60e8('0x8'));var config=require(_0x60e8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x60e8('0xa')][_0x60e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf11014,_0x387313,_0x4e88e7){return new BPromise(function(_0x4b5642,_0x555f05){return client['request'](_0xf11014,_0x4e88e7)[_0x60e8('0xc')](function(_0x4d76e2){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x387313,_0x60e8('0xd'));logger[_0x60e8('0xe')](_0x60e8('0xf'),_0x387313,_0x60e8('0xd'),JSON[_0x60e8('0x10')](_0x4d76e2));if(_0x4d76e2[_0x60e8('0x11')]){if(_0x4d76e2['error'][_0x60e8('0x12')]===0x1f4){logger[_0x60e8('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x387313,_0x4d76e2['error'][_0x60e8('0x13')]);return _0x555f05(_0x4d76e2[_0x60e8('0x11')]['message']);}logger[_0x60e8('0x11')](_0x60e8('0x14'),_0x387313,_0x4d76e2[_0x60e8('0x11')][_0x60e8('0x13')]);return _0x4b5642(_0x4d76e2['error'][_0x60e8('0x13')]);}else{logger[_0x60e8('0x15')](_0x60e8('0x14'),_0x387313,'request\x20sent');_0x4b5642(_0x4d76e2[_0x60e8('0x16')][_0x60e8('0x13')]);}})['catch'](function(_0x91f3a1){logger[_0x60e8('0x11')](_0x60e8('0x14'),_0x387313,_0x91f3a1);_0x555f05(_0x91f3a1);});});} \ No newline at end of file +var _0x804e=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2dec67,_0x328cc3){var _0x1f4f47=function(_0x3f12d9){while(--_0x3f12d9){_0x2dec67['push'](_0x2dec67['shift']());}};_0x1f4f47(++_0x328cc3);}(_0x804e,0x1b4));var _0xe804=function(_0x5aab79,_0x2c285c){_0x5aab79=_0x5aab79-0x0;var _0x355002=_0x804e[_0x5aab79];return _0x355002;};'use strict';var _=require(_0xe804('0x0'));var util=require('util');var moment=require(_0xe804('0x1'));var BPromise=require(_0xe804('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe804('0x3'));var db=require(_0xe804('0x4'))['db'];var utils=require(_0xe804('0x5'));var logger=require(_0xe804('0x6'))(_0xe804('0x7'));var config=require(_0xe804('0x8'));var jayson=require(_0xe804('0x9'));var client=jayson[_0xe804('0xa')][_0xe804('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f1485,_0xad05e0,_0x17fb6f){return new BPromise(function(_0x1a50c0,_0x18cac3){return client[_0xe804('0xc')](_0x4f1485,_0x17fb6f)[_0xe804('0xd')](function(_0x1076b5){logger[_0xe804('0xe')](_0xe804('0xf'),_0xad05e0,_0xe804('0x10'));logger[_0xe804('0x11')](_0xe804('0x12'),_0xad05e0,'request\x20sent',JSON[_0xe804('0x13')](_0x1076b5));if(_0x1076b5['error']){if(_0x1076b5['error'][_0xe804('0x14')]===0x1f4){logger[_0xe804('0x15')](_0xe804('0xf'),_0xad05e0,_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);return _0x18cac3(_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);}logger[_0xe804('0x15')](_0xe804('0xf'),_0xad05e0,_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);return _0x1a50c0(_0x1076b5[_0xe804('0x15')][_0xe804('0x16')]);}else{logger[_0xe804('0xe')](_0xe804('0xf'),_0xad05e0,_0xe804('0x10'));_0x1a50c0(_0x1076b5[_0xe804('0x17')][_0xe804('0x16')]);}})[_0xe804('0x18')](function(_0x35a30b){logger[_0xe804('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0xad05e0,_0x35a30b);_0x18cac3(_0x35a30b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 2e23c2d..29a27d3 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 _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0xcfa2e0,_0x40dd3d){var _0x1dc2b1=function(_0x11eb89){while(--_0x11eb89){_0xcfa2e0['push'](_0xcfa2e0['shift']());}};_0x1dc2b1(++_0x40dd3d);}(_0xe14b,0x93));var _0xbe14=function(_0x1e2794,_0x167da4){_0x1e2794=_0x1e2794-0x0;var _0x4484b7=_0xe14b[_0x1e2794];return _0x4484b7;};'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')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router; \ No newline at end of file +var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x23deee,_0x135240){_0x23deee=_0x23deee-0x0;var _0x5ccb76=_0xb4c7[_0x23deee];return _0x5ccb76;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 8796e6d..bcfc969 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 _0xdd3d=['beepall','sequelize','name','STRING','INTEGER','rrmemory'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdd3d,0x1e7));var _0xddd3=function(_0x24e947,_0x15a4de){_0x24e947=_0x24e947-0x0;var _0x936322=_0xdd3d[_0x24e947];return _0x936322;};'use strict';var Sequelize=require(_0xddd3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xddd3('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xddd3('0x2')]},'timeout':{'type':Sequelize[_0xddd3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xddd3('0x4'),_0xddd3('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xc0fe=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x13b70c,_0x40be1c){var _0x2d0edd=function(_0x485ea4){while(--_0x485ea4){_0x13b70c['push'](_0x13b70c['shift']());}};_0x2d0edd(++_0x40be1c);}(_0xc0fe,0x18d));var _0xec0f=function(_0x528a13,_0x396b5b){_0x528a13=_0x528a13-0x0;var _0xba7822=_0xc0fe[_0x528a13];return _0xba7822;};'use strict';var Sequelize=require(_0xec0f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xec0f('0x1')]},'timeout':{'type':Sequelize[_0xec0f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xec0f('0x3')](_0xec0f('0x4'),_0xec0f('0x5'),_0xec0f('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f667863..8cc8990 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 _0x8bda=['merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','options','UserChatQueue','User','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','findOrCreate','emit','userChatQueue:save','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','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','getOptions','where','include','query','ChatQueue','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll'];(function(_0x28d1dc,_0x5a3d14){var _0x4ebcae=function(_0x48e8ec){while(--_0x48e8ec){_0x28d1dc['push'](_0x28d1dc['shift']());}};_0x4ebcae(++_0x5a3d14);}(_0x8bda,0x1b3));var _0xa8bd=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x8bda[_0x4d8dc3];return _0x9b03d9;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xa8bd('0x0'));var squel=require(_0xa8bd('0x1'));var Redis=require(_0xa8bd('0x2'));var qs=require(_0xa8bd('0x3'));var logger=require(_0xa8bd('0x4'))(_0xa8bd('0x5'));var config=require('../../config/environment');var db=require(_0xa8bd('0x6'))['db'];config[_0xa8bd('0x7')]=_['defaults'](config[_0xa8bd('0x7')],{'host':_0xa8bd('0x8'),'port':0x18eb});var socket=require(_0xa8bd('0x9'))(new Redis(config[_0xa8bd('0x7')]));require(_0xa8bd('0xa'))[_0xa8bd('0xb')](socket);function respondWithStatusCode(_0x10fc36,_0x50aa4f){_0x50aa4f=_0x50aa4f||0xcc;return function(_0x2f2e50){if(_0x2f2e50){return _0x10fc36[_0xa8bd('0xc')](_0x50aa4f);}return _0x10fc36[_0xa8bd('0xd')](_0x50aa4f)['end']();};}function respondWithResult(_0x42ba4c,_0x5d1383){_0x5d1383=_0x5d1383||0xc8;return function(_0x490585){if(_0x490585){return _0x42ba4c[_0xa8bd('0xd')](_0x5d1383)[_0xa8bd('0xe')](_0x490585);}};}function respondWithFilteredResult(_0x561655,_0x2042ea){return function(_0x35e6c9){if(_0x35e6c9){var _0x40d3ad=typeof _0x2042ea['offset']==='undefined'&&typeof _0x2042ea['limit']===_0xa8bd('0xf');var _0x2e4bef=_0x35e6c9[_0xa8bd('0x10')];var _0x231bf1=_0x40d3ad?0x0:_0x2042ea[_0xa8bd('0x11')];var _0x40ffc0=_0x40d3ad?_0x35e6c9[_0xa8bd('0x10')]:_0x2042ea['offset']+_0x2042ea[_0xa8bd('0x12')];var _0x51fa8e;if(_0x40ffc0>=_0x2e4bef){_0x40ffc0=_0x2e4bef;_0x51fa8e=0xc8;}else{_0x51fa8e=0xce;}_0x561655['status'](_0x51fa8e);return _0x561655[_0xa8bd('0x13')](_0xa8bd('0x14'),_0x231bf1+'-'+_0x40ffc0+'/'+_0x2e4bef)['json'](_0x35e6c9);}return null;};}function saveUpdates(_0x5f1622){return function(_0x4fc4d9){if(_0x4fc4d9){return _0x4fc4d9['update'](_0x5f1622)[_0xa8bd('0x15')](function(_0x5e5d70){return _0x5e5d70;});}return null;};}function removeEntity(_0x48788f){return function(_0x38b723){if(_0x38b723){return _0x38b723[_0xa8bd('0x16')]()['then'](function(){var _0x5397b2=_0x38b723[_0xa8bd('0x17')]({'plain':!![]});var _0x1729cc=_0xa8bd('0x18');return db[_0xa8bd('0x19')]['destroy']({'where':{'type':_0x1729cc,'resourceId':_0x5397b2['id']}})[_0xa8bd('0x15')](function(){return _0x38b723;});})['then'](function(){_0x48788f[_0xa8bd('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4efe59){return function(_0x50caf3){if(!_0x50caf3){_0x4efe59[_0xa8bd('0xc')](0x194);}return _0x50caf3;};}function handleError(_0x474071,_0x1596d5){_0x1596d5=_0x1596d5||0x1f4;return function(_0xaf6617){logger[_0xa8bd('0x1a')](_0xaf6617[_0xa8bd('0x1b')]);if(_0xaf6617[_0xa8bd('0x1c')]){delete _0xaf6617['name'];}_0x474071[_0xa8bd('0xd')](_0x1596d5)[_0xa8bd('0x1d')](_0xaf6617);};}exports['index']=function(_0x338bdb,_0x27020c){var _0x36fc92={};var _0x1a2968={'count':0x0,'rows':[]};var _0x287d4b=_[_0xa8bd('0x1e')](db['ChatQueue'][_0xa8bd('0x1f')],function(_0x204941){return{'name':_0x204941[_0xa8bd('0x20')],'type':_0x204941[_0xa8bd('0x21')][_0xa8bd('0x22')]};});_0x36fc92=qs[_0xa8bd('0x23')](_0x287d4b,_0x338bdb);var _0x1d513c={'where':_0x36fc92[_0xa8bd('0x24')]};return db['ChatQueue'][_0xa8bd('0x10')](_0x1d513c)['then'](function(_0x4b22eb){_0x1a2968['count']=_0x4b22eb;_0x36fc92[_0xa8bd('0x25')]=qs['include'](_0x338bdb[_0xa8bd('0x26')]);return db[_0xa8bd('0x27')][_0xa8bd('0x28')](_0x36fc92);})[_0xa8bd('0x15')](function(_0x23c5fb){_0x1a2968[_0xa8bd('0x29')]=_0x23c5fb;return _0x1a2968;})['then'](respondWithFilteredResult(_0x27020c,_0x36fc92))[_0xa8bd('0x2a')](handleError(_0x27020c,null));};exports[_0xa8bd('0x2b')]=function(_0x2024df,_0x2d2c73){var _0x141503={'raw':!![],'where':{'id':_0x2024df[_0xa8bd('0x2c')]['id']}},_0x3517de={};_0x3517de[_0xa8bd('0x2d')]=_['keys'](db['ChatQueue'][_0xa8bd('0x1f')]);_0x3517de[_0xa8bd('0x26')]=_[_0xa8bd('0x2e')](_0x2024df[_0xa8bd('0x26')]);_0x3517de[_0xa8bd('0x2f')]=_[_0xa8bd('0x30')](_0x3517de[_0xa8bd('0x2d')],_0x3517de['query']);_0x141503['attributes']=_[_0xa8bd('0x30')](_0x3517de[_0xa8bd('0x2d')],qs[_0xa8bd('0x31')](_0x2024df['query']['fields']));_0x141503[_0xa8bd('0x32')]=_0x141503['attributes'][_0xa8bd('0x33')]?_0x141503[_0xa8bd('0x32')]:_0x3517de['model'];if(_0x2024df[_0xa8bd('0x26')][_0xa8bd('0x34')]){_0x141503['include']=[{'all':!![]}];}_0x141503=_[_0xa8bd('0x35')]({},_0x141503,_0x2024df['options']);return db[_0xa8bd('0x27')]['find'](_0x141503)[_0xa8bd('0x15')](handleEntityNotFound(_0x2d2c73,null))[_0xa8bd('0x15')](respondWithResult(_0x2d2c73,null))[_0xa8bd('0x2a')](handleError(_0x2d2c73,null));};exports[_0xa8bd('0x36')]=function(_0x573b90,_0x40efa5){return db[_0xa8bd('0x27')][_0xa8bd('0x36')](_0x573b90[_0xa8bd('0x37')],{})['then'](function(_0xdfa0d){var _0x24668d=_0x573b90['user'][_0xa8bd('0x17')]({'plain':!![]});if(!_0x24668d)throw new Error(_0xa8bd('0x38'));if(_0x24668d[_0xa8bd('0x39')]===_0xa8bd('0x3a')){var _0x26c1db=_0xdfa0d[_0xa8bd('0x17')]({'plain':!![]});var _0x2e4c01=_0xa8bd('0x18');return db['UserProfileSection']['find']({'where':{'name':_0x2e4c01,'userProfileId':_0x24668d['userProfileId']},'raw':!![]})[_0xa8bd('0x15')](function(_0x325190){if(_0x325190&&_0x325190[_0xa8bd('0x3b')]===0x0){return db['UserProfileResource']['create']({'name':_0x26c1db[_0xa8bd('0x1c')],'resourceId':_0x26c1db['id'],'type':_0x325190['name'],'sectionId':_0x325190['id']},{})[_0xa8bd('0x15')](function(){return _0xdfa0d;});}else{return _0xdfa0d;}})['catch'](function(_0xaf9c88){logger['error'](_0xa8bd('0x3c'),_0xaf9c88);throw _0xaf9c88;});}return _0xdfa0d;})['then'](respondWithResult(_0x40efa5,0xc9))[_0xa8bd('0x2a')](handleError(_0x40efa5,null));};exports['update']=function(_0x4373dd,_0x1941ae){if(_0x4373dd[_0xa8bd('0x37')]['id']){delete _0x4373dd['body']['id'];}return db[_0xa8bd('0x27')][_0xa8bd('0x3d')]({'where':{'id':_0x4373dd[_0xa8bd('0x2c')]['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0x1941ae,null))[_0xa8bd('0x15')](saveUpdates(_0x4373dd['body'],null))['then'](respondWithResult(_0x1941ae,null))[_0xa8bd('0x2a')](handleError(_0x1941ae,null));};exports[_0xa8bd('0x16')]=function(_0x1added,_0x2b2a62){return db[_0xa8bd('0x27')][_0xa8bd('0x3d')]({'where':{'id':_0x1added[_0xa8bd('0x2c')]['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0x2b2a62,null))[_0xa8bd('0x15')](removeEntity(_0x2b2a62,null))['catch'](handleError(_0x2b2a62,null));};exports[_0xa8bd('0x3e')]=function(_0x562397,_0x2a29cb){return db['ChatQueue']['describe']()[_0xa8bd('0x15')](respondWithResult(_0x2a29cb,null))[_0xa8bd('0x2a')](handleError(_0x2a29cb,null));};exports['getMembers']=function(_0x121b73,_0x51bb01){var _0x4c50b0={'raw':!![],'where':{}},_0x5e3f59={},_0x5f12f8;return db[_0xa8bd('0x27')][_0xa8bd('0x3f')]({'where':{'id':_0x121b73[_0xa8bd('0x2c')]['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0x51bb01,null))[_0xa8bd('0x15')](function(_0x5d8fcb){if(_0x5d8fcb){_0x5f12f8=_0x5d8fcb[_0xa8bd('0x17')]({'plain':!![]});_0x5e3f59[_0xa8bd('0x2d')]=_[_0xa8bd('0x2e')](db['UserChatQueue'][_0xa8bd('0x1f')]);_0x5e3f59[_0xa8bd('0x26')]=_[_0xa8bd('0x2e')](_0x121b73[_0xa8bd('0x26')]);_0x5e3f59[_0xa8bd('0x2f')]=_[_0xa8bd('0x30')](_0x5e3f59['model'],_0x5e3f59[_0xa8bd('0x26')]);_0x4c50b0[_0xa8bd('0x32')]=_['intersection'](_0x5e3f59[_0xa8bd('0x2d')],qs[_0xa8bd('0x31')](_0x121b73[_0xa8bd('0x26')][_0xa8bd('0x31')]));_0x4c50b0['attributes']=_0x4c50b0[_0xa8bd('0x32')][_0xa8bd('0x33')]?_0x4c50b0[_0xa8bd('0x32')]:_0x5e3f59[_0xa8bd('0x2d')];if(!_0x121b73[_0xa8bd('0x26')][_0xa8bd('0x40')](_0xa8bd('0x41'))){_0x4c50b0['limit']=qs[_0xa8bd('0x12')](_0x121b73['query'][_0xa8bd('0x12')]);_0x4c50b0[_0xa8bd('0x11')]=qs[_0xa8bd('0x11')](_0x121b73['query'][_0xa8bd('0x11')]);}_0x4c50b0['order']=qs[_0xa8bd('0x42')](_0x121b73['query'][_0xa8bd('0x42')]);_0x4c50b0[_0xa8bd('0x24')]=qs['filters'](_[_0xa8bd('0x43')](_0x121b73[_0xa8bd('0x26')],_0x5e3f59['filters']));_0x4c50b0[_0xa8bd('0x24')][_0xa8bd('0x44')]=_0x5d8fcb['id'];if(_0x121b73['query']['filter']){_0x4c50b0[_0xa8bd('0x24')]=_[_0xa8bd('0x35')](_0x4c50b0[_0xa8bd('0x24')],{'$or':_['map'](_0x4c50b0[_0xa8bd('0x32')],function(_0x25b3d5){var _0xc81d3f={};_0xc81d3f[_0x25b3d5]={'$like':'%'+_0x121b73['query'][_0xa8bd('0x45')]+'%'};return _0xc81d3f;})});}_0x4c50b0=_['merge']({},_0x4c50b0,_0x121b73[_0xa8bd('0x46')]);return db[_0xa8bd('0x47')][_0xa8bd('0x28')](_0x4c50b0);}})['then'](function(_0x560da6){if(_0x560da6){return db[_0xa8bd('0x48')]['findAndCountAll']({'where':{'id':_[_0xa8bd('0x1e')](_0x560da6,'UserId'),'role':_0xa8bd('0x49')},'attributes':['id','name',_0xa8bd('0x4a'),'updatedAt',_0xa8bd('0x4b')]});}})[_0xa8bd('0x15')](function(_0x2b7fcc){if(_0x2b7fcc){return{'count':_0x2b7fcc[_0xa8bd('0x10')],'rows':_['map'](_0x2b7fcc[_0xa8bd('0x29')],function(_0x27c1cc){return{'membername':_0x27c1cc[_0xa8bd('0x1c')],'UserId':_0x27c1cc['id'],'queue_name':_0x5f12f8[_0xa8bd('0x1c')],'ChatQueueId':_0x5f12f8['id'],'interface':util['format'](_0xa8bd('0x4c'),_0xa8bd('0x4d'),_0x27c1cc[_0xa8bd('0x1c')]),'penalty':0x0,'paused':_0x27c1cc[_0xa8bd('0x4a')],'createdAt':_0x27c1cc[_0xa8bd('0x4b')],'updatedAt':_0x27c1cc[_0xa8bd('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa8bd('0x15')](respondWithFilteredResult(_0x51bb01,_0x4c50b0))[_0xa8bd('0x2a')](handleError(_0x51bb01,null));};exports['getTeams']=function(_0x960221,_0xce52c1){var _0x1fadbb={};var _0x53a0f1={};var _0x3804ad;var _0x6cab95;return db[_0xa8bd('0x27')]['findOne']({'where':{'id':_0x960221['params']['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0xce52c1,null))[_0xa8bd('0x15')](function(_0x19b207){if(_0x19b207){_0x3804ad=_0x19b207;_0x53a0f1[_0xa8bd('0x2d')]=_['keys'](db[_0xa8bd('0x4f')][_0xa8bd('0x1f')]);_0x53a0f1[_0xa8bd('0x26')]=_[_0xa8bd('0x2e')](_0x960221[_0xa8bd('0x26')]);_0x53a0f1['filters']=_['intersection'](_0x53a0f1[_0xa8bd('0x2d')],_0x53a0f1['query']);_0x1fadbb[_0xa8bd('0x32')]=_[_0xa8bd('0x30')](_0x53a0f1[_0xa8bd('0x2d')],qs[_0xa8bd('0x31')](_0x960221[_0xa8bd('0x26')]['fields']));_0x1fadbb[_0xa8bd('0x32')]=_0x1fadbb['attributes'][_0xa8bd('0x33')]?_0x1fadbb[_0xa8bd('0x32')]:_0x53a0f1[_0xa8bd('0x2d')];_0x1fadbb['order']=qs['sort'](_0x960221[_0xa8bd('0x26')]['sort']);_0x1fadbb[_0xa8bd('0x24')]=qs['filters'](_[_0xa8bd('0x43')](_0x960221['query'],_0x53a0f1[_0xa8bd('0x2f')]));if(_0x960221['query'][_0xa8bd('0x45')]){_0x1fadbb[_0xa8bd('0x24')]=_['merge'](_0x1fadbb[_0xa8bd('0x24')],{'$or':_['map'](_0x1fadbb['attributes'],function(_0x474881){var _0x5cad5d={};_0x5cad5d[_0x474881]={'$like':'%'+_0x960221[_0xa8bd('0x26')][_0xa8bd('0x45')]+'%'};return _0x5cad5d;})});}_0x1fadbb=_[_0xa8bd('0x35')]({},_0x1fadbb,_0x960221['options']);return _0x3804ad[_0xa8bd('0x50')](_0x1fadbb);}})[_0xa8bd('0x15')](function(_0x2c30a4){if(_0x2c30a4){_0x6cab95=_0x2c30a4[_0xa8bd('0x33')];if(!_0x960221[_0xa8bd('0x26')][_0xa8bd('0x40')]('nolimit')){_0x1fadbb[_0xa8bd('0x12')]=qs[_0xa8bd('0x12')](_0x960221['query']['limit']);_0x1fadbb[_0xa8bd('0x11')]=qs['offset'](_0x960221['query']['offset']);}return _0x3804ad['getTeams'](_0x1fadbb);}})[_0xa8bd('0x15')](function(_0x4b80ad){if(_0x4b80ad){return _0x4b80ad?{'count':_0x6cab95,'rows':_0x4b80ad}:null;}})[_0xa8bd('0x15')](respondWithResult(_0xce52c1,null))['catch'](handleError(_0xce52c1,null));};exports[_0xa8bd('0x51')]=function(_0x1bb5cf,_0x413d90){var _0x380577=_0x1bb5cf[_0xa8bd('0x37')][_0xa8bd('0x52')];return db[_0xa8bd('0x4f')][_0xa8bd('0x28')]({'where':{'id':_0x380577},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa8bd('0x53'),'attributes':['id','name','online',_0xa8bd('0x54'),_0xa8bd('0x55')],'raw':!![]}]})['then'](function(_0x1096d8){if(_0x1096d8){var _0x22b14e=_['flatMap'](_0x1096d8,function(_0xf6bc15){var _0x83ac75=_0xf6bc15[_0xa8bd('0x17')]({'plain':!![]});return _0x83ac75['Agents'];});return db[_0xa8bd('0x27')][_0xa8bd('0x3d')]({'where':{'id':_0x1bb5cf['params']['id']}})[_0xa8bd('0x15')](function(_0x4eb2eb){return db[_0xa8bd('0x56')][_0xa8bd('0x57')](function(_0x397c47){return _0x4eb2eb[_0xa8bd('0x51')](_0x380577,{'transaction':_0x397c47})['then'](function(){return BPromise['each'](_0x22b14e,function(_0x16ad7d){return db[_0xa8bd('0x47')][_0xa8bd('0x58')]({'where':{'UserId':_0x16ad7d['id'],'ChatQueueId':_0x1bb5cf[_0xa8bd('0x2c')]['id']},'transaction':_0x397c47});});})[_0xa8bd('0x15')](function(){_0x22b14e['forEach'](function(_0x246f34){socket[_0xa8bd('0x59')](_0xa8bd('0x5a'),{'UserId':_0x246f34['id'],'ChatQueueId':_0x4eb2eb['id']});});});});});}})['then'](respondWithStatusCode(_0x413d90,null))[_0xa8bd('0x2a')](handleError(_0x413d90,null));};exports[_0xa8bd('0x5b')]=function(_0x110cd2,_0x714565){return db['Team'][_0xa8bd('0x28')]({'where':{'id':_0x110cd2[_0xa8bd('0x26')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa8bd('0x48')],'as':_0xa8bd('0x53'),'attributes':['id'],'raw':!![]}]})[_0xa8bd('0x15')](handleEntityNotFound(_0x714565,null))[_0xa8bd('0x15')](function(_0x505d3b){var _0x1a76af=_[_0xa8bd('0x1e')](_0x505d3b,'id');var _0x4c9b6a=[];var _0x4c3a47=[];var _0x25d837=squel[_0xa8bd('0x5c')]();_0x25d837[_0xa8bd('0x5d')](_0xa8bd('0x5e'))[_0xa8bd('0x5f')](_0xa8bd('0x60'),'tq')[_0xa8bd('0x61')](_0xa8bd('0x62'),'ut',_0xa8bd('0x63'))[_0xa8bd('0x24')](_0xa8bd('0x64'),_0x110cd2[_0xa8bd('0x2c')]['id']);for(var _0x203a00=0x0;_0x203a00<_0x505d3b['length'];_0x203a00+=0x1){let _0x3777dc=_0x505d3b[_0x203a00];for(var _0xc76191=0x0;_0xc76191<_0x3777dc['Agents'][_0xa8bd('0x33')];_0xc76191+=0x1){let _0x364927=_0x3777dc[_0xa8bd('0x53')][_0xc76191];var _0x44195a=_0x25d837[_0xa8bd('0x65')]();_0x44195a['where'](_0xa8bd('0x66'),_0x364927['id']);_0x4c3a47[_0xa8bd('0x67')](db[_0xa8bd('0x56')][_0xa8bd('0x26')](_0x44195a[_0xa8bd('0x68')](),{'type':db[_0xa8bd('0x56')][_0xa8bd('0x69')][_0xa8bd('0x6a')]})[_0xa8bd('0x15')](function(_0x1ab6e5){if(_0x1ab6e5['length']===0x1){return _0x364927['id'];}else{var _0x11b83e=_[_0xa8bd('0x6b')](_['map'](_0x1ab6e5,'TeamId'),function(_0x42e38b){return _[_0xa8bd('0x6c')](_0x1a76af,_0x42e38b);});if(_0x11b83e){return _0x364927['id'];}}}));}}return BPromise[_0xa8bd('0x6d')](_0x4c3a47)[_0xa8bd('0x15')](function(_0x25b5ad){_0x4c9b6a=_(_0x4c9b6a)[_0xa8bd('0x6e')](_0x25b5ad)['compact']()[_0xa8bd('0x6f')]();return db[_0xa8bd('0x27')][_0xa8bd('0x3d')]({'where':{'id':_0x110cd2['params']['id']}})['then'](function(_0x3fbf5e){return db[_0xa8bd('0x56')][_0xa8bd('0x57')](function(_0x42eeb9){return _0x3fbf5e[_0xa8bd('0x5b')](_0x110cd2['query'][_0xa8bd('0x52')],{'transaction':_0x42eeb9})[_0xa8bd('0x15')](function(){if(!_[_0xa8bd('0x70')](_0x4c9b6a)){return _0x3fbf5e[_0xa8bd('0x71')](_0x4c9b6a,{'transaction':_0x42eeb9});}})['then'](function(){_0x4c9b6a[_0xa8bd('0x72')](function(_0x127436){socket[_0xa8bd('0x59')]('userChatQueue:remove',{'UserId':_0x127436,'ChatQueueId':_0x3fbf5e['id']});});});});});});})[_0xa8bd('0x15')](respondWithStatusCode(_0x714565,null))['catch'](handleError(_0x714565,null));};exports[_0xa8bd('0x73')]=function(_0x4a85c8,_0x276270){return db['ChatQueue'][_0xa8bd('0x3d')]({'where':{'id':_0x4a85c8[_0xa8bd('0x2c')]['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0x276270,null))[_0xa8bd('0x15')](function(_0x10e116){if(_0x10e116){return _0x10e116['addAgents'](_0x4a85c8[_0xa8bd('0x37')]['ids'],_[_0xa8bd('0x74')](_0x4a85c8[_0xa8bd('0x37')],[_0xa8bd('0x52'),'id'])||{})[_0xa8bd('0x75')](function(_0x3b87d9){for(var _0x31601d=0x0;_0x31601d<_0x4a85c8['body'][_0xa8bd('0x52')]['length'];_0x31601d+=0x1){socket[_0xa8bd('0x59')](_0xa8bd('0x5a'),{'UserId':Number(_0x4a85c8[_0xa8bd('0x37')][_0xa8bd('0x52')][_0x31601d]),'ChatQueueId':Number(_0x4a85c8[_0xa8bd('0x2c')]['id'])});}return _0x3b87d9;});}})[_0xa8bd('0x15')](respondWithResult(_0x276270,null))[_0xa8bd('0x2a')](handleError(_0x276270,null));};exports[_0xa8bd('0x71')]=function(_0x438226,_0x5b971b){return db[_0xa8bd('0x27')][_0xa8bd('0x3d')]({'where':{'id':_0x438226[_0xa8bd('0x2c')]['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0x5b971b,null))[_0xa8bd('0x15')](function(_0x7a720c){if(_0x7a720c){return _0x7a720c['removeAgents'](_0x438226[_0xa8bd('0x26')]['ids'])[_0xa8bd('0x15')](function(){if(_[_0xa8bd('0x76')](_0x438226[_0xa8bd('0x26')][_0xa8bd('0x52')])){for(var _0x36948d=0x0;_0x36948d<_0x438226['query'][_0xa8bd('0x52')][_0xa8bd('0x33')];_0x36948d+=0x1){socket[_0xa8bd('0x59')](_0xa8bd('0x77'),{'UserId':Number(_0x438226[_0xa8bd('0x26')][_0xa8bd('0x52')][_0x36948d]),'ChatQueueId':Number(_0x438226['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x438226['query'][_0xa8bd('0x52')]),'ChatQueueId':Number(_0x438226[_0xa8bd('0x2c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b971b,null))['catch'](handleError(_0x5b971b,null));};exports[_0xa8bd('0x78')]=function(_0x34161d,_0x5ce157){var _0x532a9c={};var _0x20c2b8={};var _0x51a8ef;var _0x12e446;return db['ChatQueue'][_0xa8bd('0x3f')]({'where':{'id':_0x34161d[_0xa8bd('0x2c')]['id']}})[_0xa8bd('0x15')](handleEntityNotFound(_0x5ce157,null))[_0xa8bd('0x15')](function(_0x431b2a){if(_0x431b2a){_0x51a8ef=_0x431b2a;_0x20c2b8[_0xa8bd('0x2d')]=_['keys'](db[_0xa8bd('0x48')][_0xa8bd('0x1f')]);_0x20c2b8[_0xa8bd('0x26')]=_[_0xa8bd('0x2e')](_0x34161d[_0xa8bd('0x26')]);_0x20c2b8[_0xa8bd('0x2f')]=_[_0xa8bd('0x30')](_0x20c2b8[_0xa8bd('0x2d')],_0x20c2b8[_0xa8bd('0x26')]);_0x532a9c[_0xa8bd('0x32')]=_[_0xa8bd('0x30')](_0x20c2b8[_0xa8bd('0x2d')],qs[_0xa8bd('0x31')](_0x34161d[_0xa8bd('0x26')][_0xa8bd('0x31')]));_0x532a9c[_0xa8bd('0x32')]=_0x532a9c[_0xa8bd('0x32')][_0xa8bd('0x33')]?_0x532a9c[_0xa8bd('0x32')]:_0x20c2b8[_0xa8bd('0x2d')];_0x532a9c[_0xa8bd('0x79')]=qs[_0xa8bd('0x42')](_0x34161d[_0xa8bd('0x26')][_0xa8bd('0x42')]);_0x532a9c[_0xa8bd('0x24')]=qs[_0xa8bd('0x2f')](_[_0xa8bd('0x43')](_0x34161d[_0xa8bd('0x26')],_0x20c2b8['filters']));if(_0x34161d[_0xa8bd('0x26')][_0xa8bd('0x45')]){_0x532a9c['where']=_['merge'](_0x532a9c[_0xa8bd('0x24')],{'$or':_[_0xa8bd('0x1e')](_0x532a9c[_0xa8bd('0x32')],function(_0x49cd57){var _0x28bee2={};_0x28bee2[_0x49cd57]={'$like':'%'+_0x34161d['query'][_0xa8bd('0x45')]+'%'};return _0x28bee2;})});}_0x532a9c=_['merge']({},_0x532a9c,_0x34161d['options']);return _0x51a8ef[_0xa8bd('0x78')](_0x532a9c);}})[_0xa8bd('0x15')](function(_0x8b0457){if(_0x8b0457){_0x12e446=_0x8b0457[_0xa8bd('0x33')];if(!_0x34161d[_0xa8bd('0x26')][_0xa8bd('0x40')](_0xa8bd('0x41'))){_0x532a9c[_0xa8bd('0x12')]=qs[_0xa8bd('0x12')](_0x34161d['query'][_0xa8bd('0x12')]);_0x532a9c[_0xa8bd('0x11')]=qs[_0xa8bd('0x11')](_0x34161d[_0xa8bd('0x26')]['offset']);}return _0x51a8ef[_0xa8bd('0x78')](_0x532a9c);}})['then'](function(_0x437741){if(_0x437741){return _0x437741?{'count':_0x12e446,'rows':_0x437741}:null;}})['then'](respondWithResult(_0x5ce157,null))[_0xa8bd('0x2a')](handleError(_0x5ce157,null));}; \ No newline at end of file +var _0x4312=['then','get','ChatQueues','UserProfileResource','end','error','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','catch','show','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','nolimit','limit','sort','where','ChatQueueId','map','filter','UserChatQueue','findAll','findAndCountAll','agent','chatPause','createdAt','format','updatedAt','getTeams','order','hasOwnProperty','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','User','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','destroy'];(function(_0x5730a9,_0x22d1a5){var _0x25b913=function(_0x559e35){while(--_0x559e35){_0x5730a9['push'](_0x5730a9['shift']());}};_0x25b913(++_0x22d1a5);}(_0x4312,0xdb));var _0x2431=function(_0x593576,_0x8629f2){_0x593576=_0x593576-0x0;var _0x2bcd63=_0x4312[_0x593576];return _0x2bcd63;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0x2431('0x0'));var qs=require(_0x2431('0x1'));var logger=require(_0x2431('0x2'))(_0x2431('0x3'));var config=require(_0x2431('0x4'));var db=require(_0x2431('0x5'))['db'];config[_0x2431('0x6')]=_['defaults'](config[_0x2431('0x6')],{'host':_0x2431('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2431('0x8'))[_0x2431('0x9')](socket);function respondWithStatusCode(_0x548402,_0xd5b9ef){_0xd5b9ef=_0xd5b9ef||0xcc;return function(_0x4a6c8f){if(_0x4a6c8f){return _0x548402[_0x2431('0xa')](_0xd5b9ef);}return _0x548402[_0x2431('0xb')](_0xd5b9ef)['end']();};}function respondWithResult(_0x530a67,_0x512e1c){_0x512e1c=_0x512e1c||0xc8;return function(_0x8526a7){if(_0x8526a7){return _0x530a67[_0x2431('0xb')](_0x512e1c)[_0x2431('0xc')](_0x8526a7);}};}function respondWithFilteredResult(_0x4e3f21,_0x4497b0){return function(_0x4e1392){if(_0x4e1392){var _0x82fc80=typeof _0x4497b0[_0x2431('0xd')]===_0x2431('0xe')&&typeof _0x4497b0['limit']===_0x2431('0xe');var _0x482fdb=_0x4e1392['count'];var _0x56e4ea=_0x82fc80?0x0:_0x4497b0[_0x2431('0xd')];var _0x557b9a=_0x82fc80?_0x4e1392[_0x2431('0xf')]:_0x4497b0[_0x2431('0xd')]+_0x4497b0['limit'];var _0x162dd6;if(_0x557b9a>=_0x482fdb){_0x557b9a=_0x482fdb;_0x162dd6=0xc8;}else{_0x162dd6=0xce;}_0x4e3f21[_0x2431('0xb')](_0x162dd6);return _0x4e3f21[_0x2431('0x10')](_0x2431('0x11'),_0x56e4ea+'-'+_0x557b9a+'/'+_0x482fdb)['json'](_0x4e1392);}return null;};}function saveUpdates(_0xc8d93e){return function(_0x212914){if(_0x212914){return _0x212914['update'](_0xc8d93e)['then'](function(_0x4d1029){return _0x4d1029;});}return null;};}function removeEntity(_0x1cc458){return function(_0x32ad63){if(_0x32ad63){return _0x32ad63[_0x2431('0x12')]()[_0x2431('0x13')](function(){var _0x59f8fc=_0x32ad63[_0x2431('0x14')]({'plain':!![]});var _0x30ee12=_0x2431('0x15');return db[_0x2431('0x16')]['destroy']({'where':{'type':_0x30ee12,'resourceId':_0x59f8fc['id']}})['then'](function(){return _0x32ad63;});})[_0x2431('0x13')](function(){_0x1cc458[_0x2431('0xb')](0xcc)[_0x2431('0x17')]();});}};}function handleEntityNotFound(_0xc8c754){return function(_0x569550){if(!_0x569550){_0xc8c754[_0x2431('0xa')](0x194);}return _0x569550;};}function handleError(_0x4aab56,_0x27b83f){_0x27b83f=_0x27b83f||0x1f4;return function(_0x4563dd){logger[_0x2431('0x18')](_0x4563dd[_0x2431('0x19')]);if(_0x4563dd[_0x2431('0x1a')]){delete _0x4563dd[_0x2431('0x1a')];}_0x4aab56[_0x2431('0xb')](_0x27b83f)[_0x2431('0x1b')](_0x4563dd);};}exports['index']=function(_0x1f5c8b,_0x5c6231){var _0x2fa64a={};var _0x32ea4d={'count':0x0,'rows':[]};var _0x181b34=_['map'](db[_0x2431('0x1c')][_0x2431('0x1d')],function(_0x3b4884){return{'name':_0x3b4884[_0x2431('0x1e')],'type':_0x3b4884[_0x2431('0x1f')][_0x2431('0x20')]};});_0x2fa64a=qs[_0x2431('0x21')](_0x181b34,_0x1f5c8b);var _0xaeb041={'where':_0x2fa64a['where']};return db[_0x2431('0x1c')]['count'](_0xaeb041)[_0x2431('0x13')](function(_0x4d40e9){_0x32ea4d[_0x2431('0xf')]=_0x4d40e9;_0x2fa64a['include']=qs[_0x2431('0x22')](_0x1f5c8b[_0x2431('0x23')]);return db['ChatQueue']['findAll'](_0x2fa64a);})[_0x2431('0x13')](function(_0x4d721f){_0x32ea4d[_0x2431('0x24')]=_0x4d721f;return _0x32ea4d;})[_0x2431('0x13')](respondWithFilteredResult(_0x5c6231,_0x2fa64a))[_0x2431('0x25')](handleError(_0x5c6231,null));};exports[_0x2431('0x26')]=function(_0x3812e5,_0xb3e3a5){var _0x583efe={'raw':!![],'where':{'id':_0x3812e5['params']['id']}},_0x36584a={};_0x36584a[_0x2431('0x27')]=_[_0x2431('0x28')](db[_0x2431('0x1c')][_0x2431('0x1d')]);_0x36584a[_0x2431('0x23')]=_[_0x2431('0x28')](_0x3812e5[_0x2431('0x23')]);_0x36584a[_0x2431('0x29')]=_['intersection'](_0x36584a[_0x2431('0x27')],_0x36584a[_0x2431('0x23')]);_0x583efe[_0x2431('0x2a')]=_[_0x2431('0x2b')](_0x36584a[_0x2431('0x27')],qs[_0x2431('0x2c')](_0x3812e5['query'][_0x2431('0x2c')]));_0x583efe[_0x2431('0x2a')]=_0x583efe['attributes'][_0x2431('0x2d')]?_0x583efe[_0x2431('0x2a')]:_0x36584a['model'];if(_0x3812e5['query'][_0x2431('0x2e')]){_0x583efe[_0x2431('0x22')]=[{'all':!![]}];}_0x583efe=_[_0x2431('0x2f')]({},_0x583efe,_0x3812e5[_0x2431('0x30')]);return db[_0x2431('0x1c')][_0x2431('0x31')](_0x583efe)[_0x2431('0x13')](handleEntityNotFound(_0xb3e3a5,null))['then'](respondWithResult(_0xb3e3a5,null))[_0x2431('0x25')](handleError(_0xb3e3a5,null));};exports[_0x2431('0x32')]=function(_0x4ed61c,_0x1d7bfc){return db[_0x2431('0x1c')]['create'](_0x4ed61c[_0x2431('0x33')],{})[_0x2431('0x13')](function(_0x31caed){var _0x15d14a=_0x4ed61c[_0x2431('0x34')][_0x2431('0x14')]({'plain':!![]});if(!_0x15d14a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15d14a[_0x2431('0x35')]==='user'){var _0x4aba06=_0x31caed[_0x2431('0x14')]({'plain':!![]});var _0x4a87ca='ChatQueues';return db[_0x2431('0x36')][_0x2431('0x31')]({'where':{'name':_0x4a87ca,'userProfileId':_0x15d14a[_0x2431('0x37')]},'raw':!![]})['then'](function(_0x169540){if(_0x169540&&_0x169540[_0x2431('0x38')]===0x0){return db['UserProfileResource'][_0x2431('0x32')]({'name':_0x4aba06[_0x2431('0x1a')],'resourceId':_0x4aba06['id'],'type':_0x169540[_0x2431('0x1a')],'sectionId':_0x169540['id']},{})[_0x2431('0x13')](function(){return _0x31caed;});}else{return _0x31caed;}})[_0x2431('0x25')](function(_0x347ed5){logger[_0x2431('0x18')](_0x2431('0x39'),_0x347ed5);throw _0x347ed5;});}return _0x31caed;})[_0x2431('0x13')](respondWithResult(_0x1d7bfc,0xc9))['catch'](handleError(_0x1d7bfc,null));};exports['update']=function(_0x51551f,_0x55f0c1){if(_0x51551f[_0x2431('0x33')]['id']){delete _0x51551f[_0x2431('0x33')]['id'];}return db[_0x2431('0x1c')]['find']({'where':{'id':_0x51551f[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x55f0c1,null))[_0x2431('0x13')](saveUpdates(_0x51551f[_0x2431('0x33')],null))[_0x2431('0x13')](respondWithResult(_0x55f0c1,null))[_0x2431('0x25')](handleError(_0x55f0c1,null));};exports[_0x2431('0x12')]=function(_0x32d3e3,_0x593cc8){return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x32d3e3['params']['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x593cc8,null))[_0x2431('0x13')](removeEntity(_0x593cc8,null))['catch'](handleError(_0x593cc8,null));};exports['describe']=function(_0x1682d4,_0x3c5872){return db['ChatQueue'][_0x2431('0x3b')]()['then'](respondWithResult(_0x3c5872,null))[_0x2431('0x25')](handleError(_0x3c5872,null));};exports['getMembers']=function(_0x2eb8cf,_0x29890f){var _0x3acba4={'raw':!![],'where':{}},_0x38ca00={},_0xca8677;return db[_0x2431('0x1c')][_0x2431('0x3c')]({'where':{'id':_0x2eb8cf['params']['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x29890f,null))['then'](function(_0x3757da){if(_0x3757da){_0xca8677=_0x3757da[_0x2431('0x14')]({'plain':!![]});_0x38ca00[_0x2431('0x27')]=_[_0x2431('0x28')](db['UserChatQueue']['rawAttributes']);_0x38ca00['query']=_[_0x2431('0x28')](_0x2eb8cf[_0x2431('0x23')]);_0x38ca00['filters']=_[_0x2431('0x2b')](_0x38ca00[_0x2431('0x27')],_0x38ca00['query']);_0x3acba4[_0x2431('0x2a')]=_[_0x2431('0x2b')](_0x38ca00[_0x2431('0x27')],qs['fields'](_0x2eb8cf[_0x2431('0x23')][_0x2431('0x2c')]));_0x3acba4['attributes']=_0x3acba4['attributes'][_0x2431('0x2d')]?_0x3acba4[_0x2431('0x2a')]:_0x38ca00[_0x2431('0x27')];if(!_0x2eb8cf[_0x2431('0x23')]['hasOwnProperty'](_0x2431('0x3d'))){_0x3acba4[_0x2431('0x3e')]=qs['limit'](_0x2eb8cf[_0x2431('0x23')][_0x2431('0x3e')]);_0x3acba4[_0x2431('0xd')]=qs[_0x2431('0xd')](_0x2eb8cf[_0x2431('0x23')][_0x2431('0xd')]);}_0x3acba4['order']=qs[_0x2431('0x3f')](_0x2eb8cf[_0x2431('0x23')]['sort']);_0x3acba4['where']=qs[_0x2431('0x29')](_['pick'](_0x2eb8cf[_0x2431('0x23')],_0x38ca00[_0x2431('0x29')]));_0x3acba4[_0x2431('0x40')][_0x2431('0x41')]=_0x3757da['id'];if(_0x2eb8cf[_0x2431('0x23')]['filter']){_0x3acba4[_0x2431('0x40')]=_[_0x2431('0x2f')](_0x3acba4['where'],{'$or':_[_0x2431('0x42')](_0x3acba4[_0x2431('0x2a')],function(_0x43f65f){var _0x271996={};_0x271996[_0x43f65f]={'$like':'%'+_0x2eb8cf['query'][_0x2431('0x43')]+'%'};return _0x271996;})});}_0x3acba4=_[_0x2431('0x2f')]({},_0x3acba4,_0x2eb8cf[_0x2431('0x30')]);return db[_0x2431('0x44')][_0x2431('0x45')](_0x3acba4);}})['then'](function(_0x4fc07b){if(_0x4fc07b){return db['User'][_0x2431('0x46')]({'where':{'id':_[_0x2431('0x42')](_0x4fc07b,'UserId'),'role':_0x2431('0x47')},'attributes':['id',_0x2431('0x1a'),_0x2431('0x48'),'updatedAt',_0x2431('0x49')]});}})[_0x2431('0x13')](function(_0x1ca705){if(_0x1ca705){return{'count':_0x1ca705[_0x2431('0xf')],'rows':_['map'](_0x1ca705[_0x2431('0x24')],function(_0x4ec19e){return{'membername':_0x4ec19e[_0x2431('0x1a')],'UserId':_0x4ec19e['id'],'queue_name':_0xca8677['name'],'ChatQueueId':_0xca8677['id'],'interface':util[_0x2431('0x4a')]('%s/%s','SIP',_0x4ec19e[_0x2431('0x1a')]),'penalty':0x0,'paused':_0x4ec19e[_0x2431('0x48')],'createdAt':_0x4ec19e['createdAt'],'updatedAt':_0x4ec19e[_0x2431('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2431('0x13')](respondWithFilteredResult(_0x29890f,_0x3acba4))[_0x2431('0x25')](handleError(_0x29890f,null));};exports[_0x2431('0x4c')]=function(_0x54ecd8,_0x2d9b61){var _0x396b9b={};var _0x130eb5={};var _0x2852d8;var _0x106ad1;return db['ChatQueue'][_0x2431('0x3c')]({'where':{'id':_0x54ecd8['params']['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x2d9b61,null))[_0x2431('0x13')](function(_0x7e5d33){if(_0x7e5d33){_0x2852d8=_0x7e5d33;_0x130eb5[_0x2431('0x27')]=_[_0x2431('0x28')](db['Team'][_0x2431('0x1d')]);_0x130eb5[_0x2431('0x23')]=_['keys'](_0x54ecd8[_0x2431('0x23')]);_0x130eb5['filters']=_['intersection'](_0x130eb5['model'],_0x130eb5['query']);_0x396b9b[_0x2431('0x2a')]=_[_0x2431('0x2b')](_0x130eb5['model'],qs[_0x2431('0x2c')](_0x54ecd8[_0x2431('0x23')][_0x2431('0x2c')]));_0x396b9b[_0x2431('0x2a')]=_0x396b9b[_0x2431('0x2a')]['length']?_0x396b9b[_0x2431('0x2a')]:_0x130eb5[_0x2431('0x27')];_0x396b9b[_0x2431('0x4d')]=qs[_0x2431('0x3f')](_0x54ecd8[_0x2431('0x23')][_0x2431('0x3f')]);_0x396b9b[_0x2431('0x40')]=qs[_0x2431('0x29')](_['pick'](_0x54ecd8[_0x2431('0x23')],_0x130eb5[_0x2431('0x29')]));if(_0x54ecd8[_0x2431('0x23')][_0x2431('0x43')]){_0x396b9b[_0x2431('0x40')]=_[_0x2431('0x2f')](_0x396b9b[_0x2431('0x40')],{'$or':_[_0x2431('0x42')](_0x396b9b[_0x2431('0x2a')],function(_0x570a19){var _0x3f564f={};_0x3f564f[_0x570a19]={'$like':'%'+_0x54ecd8[_0x2431('0x23')][_0x2431('0x43')]+'%'};return _0x3f564f;})});}_0x396b9b=_[_0x2431('0x2f')]({},_0x396b9b,_0x54ecd8[_0x2431('0x30')]);return _0x2852d8[_0x2431('0x4c')](_0x396b9b);}})[_0x2431('0x13')](function(_0x451b3c){if(_0x451b3c){_0x106ad1=_0x451b3c[_0x2431('0x2d')];if(!_0x54ecd8[_0x2431('0x23')][_0x2431('0x4e')](_0x2431('0x3d'))){_0x396b9b['limit']=qs['limit'](_0x54ecd8[_0x2431('0x23')][_0x2431('0x3e')]);_0x396b9b['offset']=qs[_0x2431('0xd')](_0x54ecd8[_0x2431('0x23')]['offset']);}return _0x2852d8[_0x2431('0x4c')](_0x396b9b);}})['then'](function(_0x2fa746){if(_0x2fa746){return _0x2fa746?{'count':_0x106ad1,'rows':_0x2fa746}:null;}})[_0x2431('0x13')](respondWithResult(_0x2d9b61,null))[_0x2431('0x25')](handleError(_0x2d9b61,null));};exports[_0x2431('0x4f')]=function(_0x989168,_0x49635d){var _0x1ad009=_0x989168[_0x2431('0x33')][_0x2431('0x50')];return db[_0x2431('0x51')][_0x2431('0x45')]({'where':{'id':_0x1ad009},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2431('0x52'),'attributes':['id','name','online',_0x2431('0x53'),_0x2431('0x54')],'raw':!![]}]})[_0x2431('0x13')](function(_0x2a61df){if(_0x2a61df){var _0x322db0=_[_0x2431('0x55')](_0x2a61df,function(_0x110c68){var _0x21a186=_0x110c68['get']({'plain':!![]});return _0x21a186['Agents'];});return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x989168[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](function(_0x48a7cc){return db[_0x2431('0x56')][_0x2431('0x57')](function(_0x286c8c){return _0x48a7cc[_0x2431('0x4f')](_0x1ad009,{'transaction':_0x286c8c})[_0x2431('0x13')](function(){return BPromise['each'](_0x322db0,function(_0x4bd7e5){return db[_0x2431('0x44')][_0x2431('0x58')]({'where':{'UserId':_0x4bd7e5['id'],'ChatQueueId':_0x989168[_0x2431('0x3a')]['id']},'transaction':_0x286c8c});});})[_0x2431('0x13')](function(){_0x322db0[_0x2431('0x59')](function(_0x556bed){socket[_0x2431('0x5a')](_0x2431('0x5b'),{'UserId':_0x556bed['id'],'ChatQueueId':_0x48a7cc['id']});});});});});}})['then'](respondWithStatusCode(_0x49635d,null))[_0x2431('0x25')](handleError(_0x49635d,null));};exports['removeTeams']=function(_0x105864,_0x16b883){return db[_0x2431('0x51')][_0x2431('0x45')]({'where':{'id':_0x105864['query'][_0x2431('0x50')]},'attributes':['id'],'include':[{'model':db[_0x2431('0x5c')],'as':_0x2431('0x52'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x16b883,null))[_0x2431('0x13')](function(_0x1dcbb7){var _0x32da14=_[_0x2431('0x42')](_0x1dcbb7,'id');var _0x1f3def=[];var _0x23ffc6=[];var _0x4bd2b8=squel[_0x2431('0x5d')]();_0x4bd2b8['field'](_0x2431('0x5e'))[_0x2431('0x5f')](_0x2431('0x60'),'tq')['join'](_0x2431('0x61'),'ut',_0x2431('0x62'))[_0x2431('0x40')](_0x2431('0x63'),_0x105864['params']['id']);for(var _0x1d58a3=0x0;_0x1d58a3<_0x1dcbb7[_0x2431('0x2d')];_0x1d58a3+=0x1){let _0x344a93=_0x1dcbb7[_0x1d58a3];for(var _0x2e0173=0x0;_0x2e0173<_0x344a93[_0x2431('0x52')][_0x2431('0x2d')];_0x2e0173+=0x1){let _0x2d6f3e=_0x344a93['Agents'][_0x2e0173];var _0x5578ab=_0x4bd2b8[_0x2431('0x64')]();_0x5578ab[_0x2431('0x40')](_0x2431('0x65'),_0x2d6f3e['id']);_0x23ffc6[_0x2431('0x66')](db[_0x2431('0x56')][_0x2431('0x23')](_0x5578ab[_0x2431('0x67')](),{'type':db[_0x2431('0x56')][_0x2431('0x68')][_0x2431('0x69')]})[_0x2431('0x13')](function(_0xc5cfa2){if(_0xc5cfa2['length']===0x1){return _0x2d6f3e['id'];}else{var _0x334d0c=_['every'](_[_0x2431('0x42')](_0xc5cfa2,'TeamId'),function(_0x2024ef){return _[_0x2431('0x6a')](_0x32da14,_0x2024ef);});if(_0x334d0c){return _0x2d6f3e['id'];}}}));}}return BPromise['all'](_0x23ffc6)['then'](function(_0x22dca8){_0x1f3def=_(_0x1f3def)[_0x2431('0x6b')](_0x22dca8)[_0x2431('0x6c')]()[_0x2431('0x6d')]();return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x105864[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](function(_0x55b15e){return db[_0x2431('0x56')]['transaction'](function(_0x4391f2){return _0x55b15e[_0x2431('0x6e')](_0x105864[_0x2431('0x23')]['ids'],{'transaction':_0x4391f2})[_0x2431('0x13')](function(){if(!_[_0x2431('0x6f')](_0x1f3def)){return _0x55b15e[_0x2431('0x70')](_0x1f3def,{'transaction':_0x4391f2});}})[_0x2431('0x13')](function(){_0x1f3def['forEach'](function(_0x2d2586){socket[_0x2431('0x5a')](_0x2431('0x71'),{'UserId':_0x2d2586,'ChatQueueId':_0x55b15e['id']});});});});});});})[_0x2431('0x13')](respondWithStatusCode(_0x16b883,null))[_0x2431('0x25')](handleError(_0x16b883,null));};exports[_0x2431('0x72')]=function(_0x5acfb3,_0x196fd8){return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x5acfb3[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x196fd8,null))[_0x2431('0x13')](function(_0x4196ac){if(_0x4196ac){return _0x4196ac[_0x2431('0x72')](_0x5acfb3[_0x2431('0x33')]['ids'],_[_0x2431('0x73')](_0x5acfb3[_0x2431('0x33')],[_0x2431('0x50'),'id'])||{})[_0x2431('0x74')](function(_0x228879){for(var _0x3ac587=0x0;_0x3ac587<_0x5acfb3['body'][_0x2431('0x50')][_0x2431('0x2d')];_0x3ac587+=0x1){socket[_0x2431('0x5a')](_0x2431('0x5b'),{'UserId':Number(_0x5acfb3['body'][_0x2431('0x50')][_0x3ac587]),'ChatQueueId':Number(_0x5acfb3[_0x2431('0x3a')]['id'])});}return _0x228879;});}})['then'](respondWithResult(_0x196fd8,null))[_0x2431('0x25')](handleError(_0x196fd8,null));};exports[_0x2431('0x70')]=function(_0x4d8a18,_0x4e7e47){return db[_0x2431('0x1c')][_0x2431('0x31')]({'where':{'id':_0x4d8a18[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x4e7e47,null))[_0x2431('0x13')](function(_0x370c38){if(_0x370c38){return _0x370c38[_0x2431('0x70')](_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')])['then'](function(){if(_[_0x2431('0x75')](_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')])){for(var _0x5cbb2d=0x0;_0x5cbb2d<_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')][_0x2431('0x2d')];_0x5cbb2d+=0x1){socket[_0x2431('0x5a')]('userChatQueue:remove',{'UserId':Number(_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')][_0x5cbb2d]),'ChatQueueId':Number(_0x4d8a18[_0x2431('0x3a')]['id'])});}}else{socket[_0x2431('0x5a')](_0x2431('0x71'),{'UserId':Number(_0x4d8a18[_0x2431('0x23')][_0x2431('0x50')]),'ChatQueueId':Number(_0x4d8a18[_0x2431('0x3a')]['id'])});}});}})[_0x2431('0x13')](respondWithStatusCode(_0x4e7e47,null))[_0x2431('0x25')](handleError(_0x4e7e47,null));};exports[_0x2431('0x76')]=function(_0x1d57a2,_0x5977d9){var _0x4998b8={};var _0x1f85fa={};var _0x2b510c;var _0x36e16a;return db[_0x2431('0x1c')][_0x2431('0x3c')]({'where':{'id':_0x1d57a2[_0x2431('0x3a')]['id']}})[_0x2431('0x13')](handleEntityNotFound(_0x5977d9,null))[_0x2431('0x13')](function(_0x1281d5){if(_0x1281d5){_0x2b510c=_0x1281d5;_0x1f85fa['model']=_[_0x2431('0x28')](db['User'][_0x2431('0x1d')]);_0x1f85fa['query']=_[_0x2431('0x28')](_0x1d57a2[_0x2431('0x23')]);_0x1f85fa[_0x2431('0x29')]=_[_0x2431('0x2b')](_0x1f85fa['model'],_0x1f85fa[_0x2431('0x23')]);_0x4998b8['attributes']=_[_0x2431('0x2b')](_0x1f85fa['model'],qs['fields'](_0x1d57a2[_0x2431('0x23')][_0x2431('0x2c')]));_0x4998b8[_0x2431('0x2a')]=_0x4998b8[_0x2431('0x2a')][_0x2431('0x2d')]?_0x4998b8[_0x2431('0x2a')]:_0x1f85fa['model'];_0x4998b8[_0x2431('0x4d')]=qs[_0x2431('0x3f')](_0x1d57a2[_0x2431('0x23')][_0x2431('0x3f')]);_0x4998b8[_0x2431('0x40')]=qs['filters'](_['pick'](_0x1d57a2['query'],_0x1f85fa[_0x2431('0x29')]));if(_0x1d57a2[_0x2431('0x23')]['filter']){_0x4998b8[_0x2431('0x40')]=_['merge'](_0x4998b8['where'],{'$or':_['map'](_0x4998b8[_0x2431('0x2a')],function(_0x7aeba9){var _0x8f9b5b={};_0x8f9b5b[_0x7aeba9]={'$like':'%'+_0x1d57a2[_0x2431('0x23')][_0x2431('0x43')]+'%'};return _0x8f9b5b;})});}_0x4998b8=_['merge']({},_0x4998b8,_0x1d57a2[_0x2431('0x30')]);return _0x2b510c[_0x2431('0x76')](_0x4998b8);}})[_0x2431('0x13')](function(_0x485b65){if(_0x485b65){_0x36e16a=_0x485b65['length'];if(!_0x1d57a2[_0x2431('0x23')][_0x2431('0x4e')](_0x2431('0x3d'))){_0x4998b8[_0x2431('0x3e')]=qs['limit'](_0x1d57a2['query'][_0x2431('0x3e')]);_0x4998b8['offset']=qs[_0x2431('0xd')](_0x1d57a2[_0x2431('0x23')][_0x2431('0xd')]);}return _0x2b510c['getAgents'](_0x4998b8);}})[_0x2431('0x13')](function(_0xb32e92){if(_0xb32e92){return _0xb32e92?{'count':_0x36e16a,'rows':_0xb32e92}:null;}})['then'](respondWithResult(_0x5977d9,null))[_0x2431('0x25')](handleError(_0x5977d9,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 0296652..037b5ef 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 _0xb467=['save','remove','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x41730d,_0xe768e0){var _0x381584=function(_0x90f4d8){while(--_0x90f4d8){_0x41730d['push'](_0x41730d['shift']());}};_0x381584(++_0xe768e0);}(_0xb467,0x111));var _0x7b46=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0xb467[_0xa28b1a];return _0x4c9b78;};'use strict';var EventEmitter=require(_0x7b46('0x0'));var ChatQueue=require(_0x7b46('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7b46('0x2')](0x0);var events={'afterCreate':_0x7b46('0x3'),'afterUpdate':'update','afterDestroy':_0x7b46('0x4')};function emitEvent(_0x3e7a86){return function(_0x5065a3,_0x1b531b,_0x19812f){ChatQueueEvents['emit'](_0x3e7a86+':'+_0x5065a3['id'],_0x5065a3);ChatQueueEvents['emit'](_0x3e7a86,_0x5065a3);_0x19812f(null);};}for(var e in events){if(events[_0x7b46('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xb0c3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x2a40ce,_0x1cebaa){var _0x134442=function(_0x43c8ab){while(--_0x43c8ab){_0x2a40ce['push'](_0x2a40ce['shift']());}};_0x134442(++_0x1cebaa);}(_0xb0c3,0x12e));var _0x3b0c=function(_0x44148f,_0x1d1769){_0x44148f=_0x44148f-0x0;var _0x28eef3=_0xb0c3[_0x44148f];return _0x28eef3;};'use strict';var EventEmitter=require(_0x3b0c('0x0'));var ChatQueue=require(_0x3b0c('0x1'))['db'][_0x3b0c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3b0c('0x3')](0x0);var events={'afterCreate':_0x3b0c('0x4'),'afterUpdate':_0x3b0c('0x5'),'afterDestroy':_0x3b0c('0x6')};function emitEvent(_0x4ef5c3){return function(_0x1d4b43,_0x4d1866,_0x212503){ChatQueueEvents[_0x3b0c('0x7')](_0x4ef5c3+':'+_0x1d4b43['id'],_0x1d4b43);ChatQueueEvents[_0x3b0c('0x7')](_0x4ef5c3,_0x1d4b43);_0x212503(null);};}for(var e in events){if(events[_0x3b0c('0x8')](e)){var event=events[e];ChatQueue[_0x3b0c('0x9')](e,emitEvent(event));}}module[_0x3b0c('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 1419929..3be88dd 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 _0x6349=['bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x288a78,_0x59624f){var _0x52fad2=function(_0x2f0121){while(--_0x2f0121){_0x288a78['push'](_0x288a78['shift']());}};_0x52fad2(++_0x59624f);}(_0x6349,0x133));var _0x9634=function(_0x28345f,_0x1c8be0){_0x28345f=_0x28345f-0x0;var _0x3c8786=_0x6349[_0x28345f];return _0x3c8786;};'use strict';var _=require(_0x9634('0x0'));var util=require(_0x9634('0x1'));var logger=require(_0x9634('0x2'))(_0x9634('0x3'));var moment=require(_0x9634('0x4'));var BPromise=require(_0x9634('0x5'));var rp=require(_0x9634('0x6'));var fs=require('fs');var path=require(_0x9634('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9634('0x8'));module[_0x9634('0x9')]=function(_0x137890,_0xebd2a5){return _0x137890[_0x9634('0xa')](_0x9634('0xb'),attributes,{'tableName':_0x9634('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e8c=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x9e8c,0x12f));var _0xc9e8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x9e8c[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xc9e8('0x0'));var util=require(_0xc9e8('0x1'));var logger=require(_0xc9e8('0x2'))(_0xc9e8('0x3'));var moment=require('moment');var BPromise=require(_0xc9e8('0x4'));var rp=require(_0xc9e8('0x5'));var fs=require('fs');var path=require(_0xc9e8('0x6'));var rimraf=require(_0xc9e8('0x7'));var config=require(_0xc9e8('0x8'));var attributes=require(_0xc9e8('0x9'));module[_0xc9e8('0xa')]=function(_0x56a5f7,_0x2e67f7){return _0x56a5f7[_0xc9e8('0xb')]('ChatQueue',attributes,{'tableName':_0xc9e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index c55d468..7d28195 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 _0x657e=['../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x203c52,_0x53390a){var _0x332ef0=function(_0x411deb){while(--_0x411deb){_0x203c52['push'](_0x203c52['shift']());}};_0x332ef0(++_0x53390a);}(_0x657e,0x1c2));var _0xe657=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x657e[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xe657('0x0'));var util=require(_0xe657('0x1'));var moment=require(_0xe657('0x2'));var BPromise=require(_0xe657('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe657('0x4'));var db=require(_0xe657('0x5'))['db'];var utils=require(_0xe657('0x6'));var logger=require(_0xe657('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe657('0x8'));var client=jayson[_0xe657('0x9')]['http']({'port':0x232a});config[_0xe657('0xa')]=_[_0xe657('0xb')](config[_0xe657('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe657('0xc'))(new Redis(config[_0xe657('0xa')]));require(_0xe657('0xd'))[_0xe657('0xe')](socket);function respondWithRpcPromise(_0x37f91d,_0x3e33c8,_0x4ab4f0){return new BPromise(function(_0xe04ba9,_0xf06a03){return client['request'](_0x37f91d,_0x4ab4f0)[_0xe657('0xf')](function(_0x2a66d9){logger[_0xe657('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3e33c8,_0xe657('0x11'));logger[_0xe657('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3e33c8,'request\x20sent',JSON[_0xe657('0x13')](_0x2a66d9));if(_0x2a66d9[_0xe657('0x14')]){if(_0x2a66d9[_0xe657('0x14')][_0xe657('0x15')]===0x1f4){logger[_0xe657('0x14')](_0xe657('0x16'),_0x3e33c8,_0x2a66d9['error']['message']);return _0xf06a03(_0x2a66d9[_0xe657('0x14')][_0xe657('0x17')]);}logger['error'](_0xe657('0x16'),_0x3e33c8,_0x2a66d9[_0xe657('0x14')]['message']);return _0xe04ba9(_0x2a66d9[_0xe657('0x14')][_0xe657('0x17')]);}else{logger[_0xe657('0x10')](_0xe657('0x16'),_0x3e33c8,_0xe657('0x11'));_0xe04ba9(_0x2a66d9['result'][_0xe657('0x17')]);}})[_0xe657('0x18')](function(_0x4c41df){logger[_0xe657('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3e33c8,_0x4c41df);_0xf06a03(_0x4c41df);});});}exports[_0xe657('0x19')]=function(_0x5c3a7d){var _0x163ae3=this;return new Promise(function(_0x1b8b2c,_0x1c563b){return db[_0xe657('0x1a')][_0xe657('0x1b')]({'raw':_0x5c3a7d['options']?_0x5c3a7d['options'][_0xe657('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c3a7d['options']?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x1e')]||null:null,'attributes':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x1f')]||null:null,'limit':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d['options'][_0xe657('0x20')]||null:null,'include':_0x5c3a7d[_0xe657('0x1d')]?_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x21')]?_[_0xe657('0x22')](_0x5c3a7d[_0xe657('0x1d')][_0xe657('0x21')],function(_0xb39831){return{'model':db[_0xb39831[_0xe657('0x23')]],'as':_0xb39831['as'],'attributes':_0xb39831['attributes'],'include':_0xb39831['include']?_[_0xe657('0x22')](_0xb39831['include'],function(_0x5ed298){return{'model':db[_0x5ed298[_0xe657('0x23')]],'as':_0x5ed298['as'],'attributes':_0x5ed298['attributes'],'include':_0x5ed298[_0xe657('0x21')]?_[_0xe657('0x22')](_0x5ed298[_0xe657('0x21')],function(_0x54ae2b){return{'model':db[_0x54ae2b[_0xe657('0x23')]],'as':_0x54ae2b['as'],'attributes':_0x54ae2b[_0xe657('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xf')](function(_0x343732){logger[_0xe657('0x10')](_0xe657('0x19'),_0x5c3a7d);logger[_0xe657('0x12')](_0xe657('0x19'),_0x5c3a7d,JSON['stringify'](_0x343732));_0x1b8b2c(_0x343732);})[_0xe657('0x18')](function(_0x11aea3){logger['error'](_0xe657('0x19'),_0x11aea3['message'],_0x5c3a7d);_0x1c563b(_0x163ae3[_0xe657('0x14')](0x1f4,_0x11aea3['message']));});});};exports['ShowChatQueue']=function(_0x46050c){var _0x46edbd=this;return new Promise(function(_0x449d25,_0x507e10){return db['ChatQueue'][_0xe657('0x24')]({'raw':_0x46050c['options']?_0x46050c[_0xe657('0x1d')][_0xe657('0x1c')]===undefined?!![]:![]:!![],'where':_0x46050c[_0xe657('0x1d')]?_0x46050c[_0xe657('0x1d')]['where']||null:null,'attributes':_0x46050c['options']?_0x46050c[_0xe657('0x1d')][_0xe657('0x1f')]||null:null,'include':_0x46050c[_0xe657('0x1d')]?_0x46050c['options'][_0xe657('0x21')]?_['map'](_0x46050c['options'][_0xe657('0x21')],function(_0x3fd030){return{'model':db[_0x3fd030['model']],'as':_0x3fd030['as'],'attributes':_0x3fd030[_0xe657('0x1f')],'include':_0x3fd030[_0xe657('0x21')]?_[_0xe657('0x22')](_0x3fd030[_0xe657('0x21')],function(_0x1b951c){return{'model':db[_0x1b951c[_0xe657('0x23')]],'as':_0x1b951c['as'],'attributes':_0x1b951c[_0xe657('0x1f')],'include':_0x1b951c[_0xe657('0x21')]?_[_0xe657('0x22')](_0x1b951c[_0xe657('0x21')],function(_0x57c028){return{'model':db[_0x57c028[_0xe657('0x23')]],'as':_0x57c028['as'],'attributes':_0x57c028[_0xe657('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe657('0xf')](function(_0x17380b){logger[_0xe657('0x10')](_0xe657('0x25'),_0x46050c);logger[_0xe657('0x12')](_0xe657('0x25'),_0x46050c,JSON[_0xe657('0x13')](_0x17380b));_0x449d25(_0x17380b);})[_0xe657('0x18')](function(_0x1f8f6e){logger[_0xe657('0x14')](_0xe657('0x25'),_0x1f8f6e[_0xe657('0x17')],_0x46050c);_0x507e10(_0x46edbd[_0xe657('0x14')](0x1f4,_0x1f8f6e['message']));});});}; \ No newline at end of file +var _0xbbbc=['model','include','then','debug','catch','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','map'];(function(_0x46734b,_0x5f0ce4){var _0x23a413=function(_0xa454f8){while(--_0xa454f8){_0x46734b['push'](_0x46734b['shift']());}};_0x23a413(++_0x5f0ce4);}(_0xbbbc,0xf6));var _0xcbbb=function(_0xc89c5f,_0x8032a7){_0xc89c5f=_0xc89c5f-0x0;var _0x2d1ab1=_0xbbbc[_0xc89c5f];return _0x2d1ab1;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('ChatQueue,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')]({'raw':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f['options'][_0xcbbb('0x1e')]===undefined?!![]:![]:!![],'where':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')][_0xcbbb('0x1f')]||null:null,'attributes':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')][_0xcbbb('0x20')]||null:null,'limit':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')]['limit']||null:null,'include':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')]['include']?_[_0xcbbb('0x21')](_0x25e92f['options']['include'],function(_0x575d56){return{'model':db[_0x575d56[_0xcbbb('0x22')]],'as':_0x575d56['as'],'attributes':_0x575d56['attributes'],'include':_0x575d56['include']?_['map'](_0x575d56[_0xcbbb('0x23')],function(_0x55e1d8){return{'model':db[_0x55e1d8['model']],'as':_0x55e1d8['as'],'attributes':_0x55e1d8[_0xcbbb('0x20')],'include':_0x55e1d8[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x55e1d8[_0xcbbb('0x23')],function(_0x372024){return{'model':db[_0x372024[_0xcbbb('0x22')]],'as':_0x372024['as'],'attributes':_0x372024[_0xcbbb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcbbb('0x24')](function(_0x2a023f){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x25')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x2a023f));_0x1cca90(_0x2a023f);})[_0xcbbb('0x26')](function(_0xcae72c){logger[_0xcbbb('0x16')](_0xcbbb('0x1a'),_0xcae72c['message'],_0x25e92f);_0x45de5f(_0x658337[_0xcbbb('0x16')](0x1f4,_0xcae72c[_0xcbbb('0x18')]));});});};exports['ShowChatQueue']=function(_0xec2761){var _0x539dcf=this;return new Promise(function(_0x2d37d3,_0x1fb05e){return db[_0xcbbb('0x1b')]['find']({'raw':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x1e')]===undefined?!![]:![]:!![],'where':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x1f')]||null:null,'attributes':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x20')]||null:null,'include':_0xec2761[_0xcbbb('0x1d')]?_0xec2761['options']['include']?_['map'](_0xec2761['options'][_0xcbbb('0x23')],function(_0x5ccc55){return{'model':db[_0x5ccc55[_0xcbbb('0x22')]],'as':_0x5ccc55['as'],'attributes':_0x5ccc55[_0xcbbb('0x20')],'include':_0x5ccc55[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x5ccc55[_0xcbbb('0x23')],function(_0x39a417){return{'model':db[_0x39a417[_0xcbbb('0x22')]],'as':_0x39a417['as'],'attributes':_0x39a417[_0xcbbb('0x20')],'include':_0x39a417[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x39a417['include'],function(_0x5f578f){return{'model':db[_0x5f578f[_0xcbbb('0x22')]],'as':_0x5f578f['as'],'attributes':_0x5f578f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dbd8d){logger[_0xcbbb('0x12')](_0xcbbb('0x27'),_0xec2761);logger[_0xcbbb('0x25')](_0xcbbb('0x27'),_0xec2761,JSON[_0xcbbb('0x15')](_0x5dbd8d));_0x2d37d3(_0x5dbd8d);})[_0xcbbb('0x26')](function(_0x18054f){logger[_0xcbbb('0x16')](_0xcbbb('0x27'),_0x18054f[_0xcbbb('0x18')],_0xec2761);_0x1fb05e(_0x539dcf[_0xcbbb('0x16')](0x1f4,_0x18054f['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3211d15..f258c79 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 _0xd2ea=['./chatQueue.events','save','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x4bb3d1,_0x1a668a){var _0x247662=function(_0x26cd7c){while(--_0x26cd7c){_0x4bb3d1['push'](_0x4bb3d1['shift']());}};_0x247662(++_0x1a668a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x3344f1,_0x54a676){_0x3344f1=_0x3344f1-0x0;var _0x50a21c=_0xd2ea[_0x3344f1];return _0x50a21c;};'use strict';var ChatQueueEvents=require(_0xad2e('0x0'));var events=[_0xad2e('0x1'),_0xad2e('0x2'),_0xad2e('0x3')];function createListener(_0x44b30d,_0x5c9fa9){return function(_0x3a9d11){_0x5c9fa9[_0xad2e('0x4')](_0x44b30d,_0x3a9d11);};}function removeListener(_0xcba7cb,_0x3e0741){return function(){ChatQueueEvents[_0xad2e('0x5')](_0xcba7cb,_0x3e0741);};}exports[_0xad2e('0x6')]=function(_0x29e97f){for(var _0x592e8b=0x0,_0x3b5170=events[_0xad2e('0x7')];_0x592e8b<_0x3b5170;_0x592e8b++){var _0x2ff7b2=events[_0x592e8b];var _0x5710ac=createListener(_0xad2e('0x8')+_0x2ff7b2,_0x29e97f);ChatQueueEvents['on'](_0x2ff7b2,_0x5710ac);}}; \ No newline at end of file +var _0x29d4=['removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x22bb7c,_0x4c17ab){var _0x53d6aa=function(_0x5a2e30){while(--_0x5a2e30){_0x22bb7c['push'](_0x22bb7c['shift']());}};_0x53d6aa(++_0x4c17ab);}(_0x29d4,0x1a1));var _0x429d=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x29d4[_0x29b609];return _0x54c952;};'use strict';var ChatQueueEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatQueueEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatQueue:'+_0x4befb9,_0x1c55aa);ChatQueueEvents['on'](_0x4befb9,_0x9fc337);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 845b0f3..b49d228 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x238a32,_0x596754){var _0x266ed5=function(_0x49c501){while(--_0x49c501){_0x238a32['push'](_0x238a32['shift']());}};_0x266ed5(++_0x596754);}(_0x55ca,0x126));var _0xa55c=function(_0x3895b7,_0xd4796b){_0x3895b7=_0x3895b7-0x0;var _0x3f3b8c=_0x55ca[_0x3895b7];return _0x3f3b8c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +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(_0x3a21c1,_0x1dcf73){var _0x5be9c6=function(_0x4fb58e){while(--_0x4fb58e){_0x3a21c1['push'](_0x3a21c1['shift']());}};_0x5be9c6(++_0x1dcf73);}(_0xe14b,0x93));var _0xbe14=function(_0x1fdd12,_0x2d92bb){_0x1fdd12=_0x1fdd12-0x0;var _0x2b7c26=_0xe14b[_0x1fdd12];return _0x2b7c26;};'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 3422140..51051bd 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 _0xcf09=['moment','exports','STRING','DATE'];(function(_0x5215cb,_0x3db75f){var _0x2d8357=function(_0x5e4896){while(--_0x5e4896){_0x5215cb['push'](_0x5215cb['shift']());}};_0x2d8357(++_0x3db75f);}(_0xcf09,0x8c));var _0x9cf0=function(_0x64cf01,_0x29e540){_0x64cf01=_0x64cf01-0x0;var _0x570c1d=_0xcf09[_0x64cf01];return _0x570c1d;};'use strict';var moment=require(_0x9cf0('0x0'));var Sequelize=require('sequelize');module[_0x9cf0('0x1')]={'uniqueid':{'type':Sequelize[_0x9cf0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9cf0('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9cf0('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9cf0('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3cf5=['sequelize','exports','STRING','DATE','moment'];(function(_0x17396e,_0x21cd31){var _0x3c1e80=function(_0x5e41d2){while(--_0x5e41d2){_0x17396e['push'](_0x17396e['shift']());}};_0x3c1e80(++_0x21cd31);}(_0x3cf5,0x1a3));var _0x53cf=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0x3cf5[_0x4c9d58];return _0x3ad22d;};'use strict';var moment=require(_0x53cf('0x0'));var Sequelize=require(_0x53cf('0x1'));module[_0x53cf('0x2')]={'uniqueid':{'type':Sequelize[_0x53cf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x53cf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x53cf('0x4')]},'exitAt':{'type':Sequelize[_0x53cf('0x4')]},'reason':{'type':Sequelize[_0x53cf('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 60fe860..2545d4a 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 _0x1228=['reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','offset','sort','pick','filter','where','merge','type','options','includeAll','rows','catch','params','length','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','limit'];(function(_0x569628,_0x443549){var _0x353683=function(_0x1c7698){while(--_0x1c7698){_0x569628['push'](_0x569628['shift']());}};_0x353683(++_0x443549);}(_0x1228,0x12f));var _0x8122=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x1228[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0x8122('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8122('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8122('0x2'));var moment=require(_0x8122('0x3'));var BPromise=require(_0x8122('0x4'));var Mustache=require('mustache');var util=require(_0x8122('0x5'));var path=require(_0x8122('0x6'));var sox=require('sox');var csv=require(_0x8122('0x7'));var ejs=require(_0x8122('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8122('0x9'));var squel=require(_0x8122('0xa'));var crypto=require('crypto');var jsforce=require(_0x8122('0xb'));var deskjs=require(_0x8122('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8122('0xd'));var Papa=require(_0x8122('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8122('0xf'));var logger=require('../../config/logger')(_0x8122('0x10'));var utils=require(_0x8122('0x11'));var config=require(_0x8122('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8122('0x13'))['db'];function respondWithStatusCode(_0x565f6e,_0x162ed4){_0x162ed4=_0x162ed4||0xcc;return function(_0x1ca828){if(_0x1ca828){return _0x565f6e[_0x8122('0x14')](_0x162ed4);}return _0x565f6e[_0x8122('0x15')](_0x162ed4)[_0x8122('0x16')]();};}function respondWithResult(_0x266feb,_0x1fa431){_0x1fa431=_0x1fa431||0xc8;return function(_0x1be8e2){if(_0x1be8e2){return _0x266feb[_0x8122('0x15')](_0x1fa431)[_0x8122('0x17')](_0x1be8e2);}};}function respondWithFilteredResult(_0xfa15a2,_0x6baf37){return function(_0x559256){if(_0x559256){var _0x3ed5d1=typeof _0x6baf37['offset']===_0x8122('0x18')&&typeof _0x6baf37['limit']===_0x8122('0x18');var _0x2acf8f=_0x559256[_0x8122('0x19')];var _0x4bfb9e=_0x3ed5d1?0x0:_0x6baf37['offset'];var _0x4f7277=_0x3ed5d1?_0x559256['count']:_0x6baf37['offset']+_0x6baf37[_0x8122('0x1a')];var _0x2511e9;if(_0x4f7277>=_0x2acf8f){_0x4f7277=_0x2acf8f;_0x2511e9=0xc8;}else{_0x2511e9=0xce;}_0xfa15a2[_0x8122('0x15')](_0x2511e9);return _0xfa15a2['set']('Content-Range',_0x4bfb9e+'-'+_0x4f7277+'/'+_0x2acf8f)[_0x8122('0x17')](_0x559256);}return null;};}function patchUpdates(_0x174321){return function(_0x68761a){try{jsonpatch['apply'](_0x68761a,_0x174321,!![]);}catch(_0x15e635){return BPromise[_0x8122('0x1b')](_0x15e635);}return _0x68761a[_0x8122('0x1c')]();};}function saveUpdates(_0x988c0c,_0x3c6226){return function(_0x130e1b){if(_0x130e1b){return _0x130e1b[_0x8122('0x1d')](_0x988c0c)[_0x8122('0x1e')](function(_0x4fc6af){return _0x4fc6af;});}return null;};}function removeEntity(_0x34c185,_0x5cfa77){return function(_0x732946){if(_0x732946){return _0x732946[_0x8122('0x1f')]()[_0x8122('0x1e')](function(){_0x34c185[_0x8122('0x15')](0xcc)[_0x8122('0x16')]();});}};}function handleEntityNotFound(_0x240a6d,_0x40e945){return function(_0x2708a5){if(!_0x2708a5){_0x240a6d[_0x8122('0x14')](0x194);}return _0x2708a5;};}function handleError(_0x4e67ab,_0x1258d7){_0x1258d7=_0x1258d7||0x1f4;return function(_0xa79602){logger[_0x8122('0x20')](_0xa79602[_0x8122('0x21')]);if(_0xa79602[_0x8122('0x22')]){delete _0xa79602[_0x8122('0x22')];}_0x4e67ab[_0x8122('0x15')](_0x1258d7)[_0x8122('0x23')](_0xa79602);};}exports[_0x8122('0x24')]=function(_0x4610b1,_0x4c70f4){var _0x49531a={},_0x2a0b63={},_0x264ccf={'count':0x0,'rows':[]};var _0x5263ca=_['map'](db[_0x8122('0x25')][_0x8122('0x26')],function(_0x367ada){return{'name':_0x367ada['fieldName'],'type':_0x367ada['type'][_0x8122('0x27')]};});_0x2a0b63[_0x8122('0x28')]=_[_0x8122('0x29')](_0x5263ca,_0x8122('0x22'));_0x2a0b63[_0x8122('0x2a')]=_[_0x8122('0x2b')](_0x4610b1[_0x8122('0x2a')]);_0x2a0b63[_0x8122('0x2c')]=_[_0x8122('0x2d')](_0x2a0b63[_0x8122('0x28')],_0x2a0b63['query']);_0x49531a[_0x8122('0x2e')]=_[_0x8122('0x2d')](_0x2a0b63[_0x8122('0x28')],qs[_0x8122('0x2f')](_0x4610b1[_0x8122('0x2a')][_0x8122('0x2f')]));_0x49531a[_0x8122('0x2e')]=_0x49531a[_0x8122('0x2e')]['length']?_0x49531a['attributes']:_0x2a0b63[_0x8122('0x28')];if(!_0x4610b1['query']['hasOwnProperty'](_0x8122('0x30'))){_0x49531a['limit']=qs['limit'](_0x4610b1[_0x8122('0x2a')][_0x8122('0x1a')]);_0x49531a['offset']=qs[_0x8122('0x31')](_0x4610b1['query'][_0x8122('0x31')]);}_0x49531a['order']=qs[_0x8122('0x32')](_0x4610b1[_0x8122('0x2a')]['sort']);_0x49531a['where']=qs['filters'](_[_0x8122('0x33')](_0x4610b1[_0x8122('0x2a')],_0x2a0b63['filters']),_0x5263ca);if(_0x4610b1[_0x8122('0x2a')][_0x8122('0x34')]){_0x49531a[_0x8122('0x35')]=_[_0x8122('0x36')](_0x49531a['where'],{'$or':_[_0x8122('0x29')](_0x5263ca,function(_0x1a1510){if(_0x1a1510[_0x8122('0x37')]!=='VIRTUAL'){var _0x3805ec={};_0x3805ec[_0x1a1510['name']]={'$like':'%'+_0x4610b1[_0x8122('0x2a')]['filter']+'%'};return _0x3805ec;}})});}_0x49531a=_[_0x8122('0x36')]({},_0x49531a,_0x4610b1[_0x8122('0x38')]);var _0x1e6c01={'where':_0x49531a[_0x8122('0x35')]};return db['ChatQueueReport'][_0x8122('0x19')](_0x1e6c01)[_0x8122('0x1e')](function(_0x565829){_0x264ccf[_0x8122('0x19')]=_0x565829;if(_0x4610b1[_0x8122('0x2a')][_0x8122('0x39')]){_0x49531a['include']=[{'all':!![]}];}return db[_0x8122('0x25')]['findAll'](_0x49531a);})[_0x8122('0x1e')](function(_0x3258e8){_0x264ccf[_0x8122('0x3a')]=_0x3258e8;return _0x264ccf;})[_0x8122('0x1e')](respondWithFilteredResult(_0x4c70f4,_0x49531a))[_0x8122('0x3b')](handleError(_0x4c70f4,null));};exports['show']=function(_0xbad19,_0x16ab8c){var _0x5bceb1={'raw':!![],'where':{'id':_0xbad19[_0x8122('0x3c')]['id']}},_0x3dbd77={};_0x3dbd77[_0x8122('0x28')]=_[_0x8122('0x2b')](db[_0x8122('0x25')][_0x8122('0x26')]);_0x3dbd77[_0x8122('0x2a')]=_['keys'](_0xbad19[_0x8122('0x2a')]);_0x3dbd77[_0x8122('0x2c')]=_[_0x8122('0x2d')](_0x3dbd77['model'],_0x3dbd77[_0x8122('0x2a')]);_0x5bceb1[_0x8122('0x2e')]=_[_0x8122('0x2d')](_0x3dbd77['model'],qs['fields'](_0xbad19[_0x8122('0x2a')]['fields']));_0x5bceb1['attributes']=_0x5bceb1[_0x8122('0x2e')][_0x8122('0x3d')]?_0x5bceb1[_0x8122('0x2e')]:_0x3dbd77['model'];if(_0xbad19[_0x8122('0x2a')][_0x8122('0x39')]){_0x5bceb1['include']=[{'all':!![]}];}_0x5bceb1=_[_0x8122('0x36')]({},_0x5bceb1,_0xbad19[_0x8122('0x38')]);return db[_0x8122('0x25')][_0x8122('0x3e')](_0x5bceb1)['then'](handleEntityNotFound(_0x16ab8c,null))[_0x8122('0x1e')](respondWithResult(_0x16ab8c,null))['catch'](handleError(_0x16ab8c,null));};exports[_0x8122('0x3f')]=function(_0x21860f,_0x5e6093){return db[_0x8122('0x25')][_0x8122('0x3f')](_0x21860f['body'],{})[_0x8122('0x1e')](respondWithResult(_0x5e6093,0xc9))[_0x8122('0x3b')](handleError(_0x5e6093,null));};exports[_0x8122('0x1d')]=function(_0x8c7e4f,_0x1d9ccf){if(_0x8c7e4f[_0x8122('0x40')]['id']){delete _0x8c7e4f[_0x8122('0x40')]['id'];}return db['ChatQueueReport'][_0x8122('0x3e')]({'where':{'id':_0x8c7e4f[_0x8122('0x3c')]['id']}})[_0x8122('0x1e')](handleEntityNotFound(_0x1d9ccf,null))[_0x8122('0x1e')](saveUpdates(_0x8c7e4f['body'],null))[_0x8122('0x1e')](respondWithResult(_0x1d9ccf,null))[_0x8122('0x3b')](handleError(_0x1d9ccf,null));};exports[_0x8122('0x1f')]=function(_0x4bac94,_0x3618cb){return db[_0x8122('0x25')][_0x8122('0x3e')]({'where':{'id':_0x4bac94[_0x8122('0x3c')]['id']}})[_0x8122('0x1e')](handleEntityNotFound(_0x3618cb,null))['then'](removeEntity(_0x3618cb,null))[_0x8122('0x3b')](handleError(_0x3618cb,null));};exports[_0x8122('0x41')]=function(_0x81f778,_0x3a1d62){return db[_0x8122('0x25')][_0x8122('0x41')]()[_0x8122('0x1e')](respondWithResult(_0x3a1d62,null))[_0x8122('0x3b')](handleError(_0x3a1d62,null));}; \ No newline at end of file +var _0x1c63=['merge','options','ChatQueueReport','findAll','rows','keys','includeAll','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x96c154,_0x2db1aa){var _0x43fb6d=function(_0x1d1417){while(--_0x1d1417){_0x96c154['push'](_0x96c154['shift']());}};_0x43fb6d(++_0x2db1aa);}(_0x1c63,0xdc));var _0x31c6=function(_0x349b8a,_0x35b021){_0x349b8a=_0x349b8a-0x0;var _0x1d5645=_0x1c63[_0x349b8a];return _0x1d5645;};'use strict';var emlformat=require(_0x31c6('0x0'));var rimraf=require(_0x31c6('0x1'));var zipdir=require(_0x31c6('0x2'));var jsonpatch=require(_0x31c6('0x3'));var rp=require('request-promise');var moment=require(_0x31c6('0x4'));var BPromise=require(_0x31c6('0x5'));var Mustache=require(_0x31c6('0x6'));var util=require('util');var path=require(_0x31c6('0x7'));var sox=require(_0x31c6('0x8'));var csv=require(_0x31c6('0x9'));var ejs=require(_0x31c6('0xa'));var fs=require('fs');var fs_extra=require(_0x31c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x31c6('0xc'));var jsforce=require(_0x31c6('0xd'));var deskjs=require(_0x31c6('0xe'));var toCsv=require(_0x31c6('0x9'));var querystring=require(_0x31c6('0xf'));var Papa=require('papaparse');var Redis=require(_0x31c6('0x10'));var authService=require(_0x31c6('0x11'));var qs=require(_0x31c6('0x12'));var as=require(_0x31c6('0x13'));var hardwareService=require(_0x31c6('0x14'));var logger=require('../../config/logger')(_0x31c6('0x15'));var utils=require('../../config/utils');var config=require(_0x31c6('0x16'));var licenseUtil=require(_0x31c6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53c23d,_0x3424f0){_0x3424f0=_0x3424f0||0xcc;return function(_0x12f99c){if(_0x12f99c){return _0x53c23d[_0x31c6('0x18')](_0x3424f0);}return _0x53c23d[_0x31c6('0x19')](_0x3424f0)[_0x31c6('0x1a')]();};}function respondWithResult(_0x4d1710,_0x11e6a4){_0x11e6a4=_0x11e6a4||0xc8;return function(_0x3995cc){if(_0x3995cc){return _0x4d1710[_0x31c6('0x19')](_0x11e6a4)[_0x31c6('0x1b')](_0x3995cc);}};}function respondWithFilteredResult(_0x7a8c46,_0x5f1d49){return function(_0x5f2c85){if(_0x5f2c85){var _0x497264=typeof _0x5f1d49['offset']===_0x31c6('0x1c')&&typeof _0x5f1d49['limit']===_0x31c6('0x1c');var _0x2a4780=_0x5f2c85[_0x31c6('0x1d')];var _0xf352af=_0x497264?0x0:_0x5f1d49[_0x31c6('0x1e')];var _0x4c7f34=_0x497264?_0x5f2c85[_0x31c6('0x1d')]:_0x5f1d49[_0x31c6('0x1e')]+_0x5f1d49['limit'];var _0x593d2b;if(_0x4c7f34>=_0x2a4780){_0x4c7f34=_0x2a4780;_0x593d2b=0xc8;}else{_0x593d2b=0xce;}_0x7a8c46['status'](_0x593d2b);return _0x7a8c46[_0x31c6('0x1f')](_0x31c6('0x20'),_0xf352af+'-'+_0x4c7f34+'/'+_0x2a4780)[_0x31c6('0x1b')](_0x5f2c85);}return null;};}function patchUpdates(_0x24602f){return function(_0x4f17e5){try{jsonpatch['apply'](_0x4f17e5,_0x24602f,!![]);}catch(_0x4070f6){return BPromise[_0x31c6('0x21')](_0x4070f6);}return _0x4f17e5['save']();};}function saveUpdates(_0x339588,_0x1c6fda){return function(_0x392723){if(_0x392723){return _0x392723[_0x31c6('0x22')](_0x339588)[_0x31c6('0x23')](function(_0x509bed){return _0x509bed;});}return null;};}function removeEntity(_0x287c59,_0x536e57){return function(_0x8773d4){if(_0x8773d4){return _0x8773d4[_0x31c6('0x24')]()['then'](function(){_0x287c59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412a8a,_0x250ab1){return function(_0x551291){if(!_0x551291){_0x412a8a[_0x31c6('0x18')](0x194);}return _0x551291;};}function handleError(_0x44bf50,_0x2c9d78){_0x2c9d78=_0x2c9d78||0x1f4;return function(_0x2fb5f3){logger['error'](_0x2fb5f3['stack']);if(_0x2fb5f3['name']){delete _0x2fb5f3['name'];}_0x44bf50[_0x31c6('0x19')](_0x2c9d78)['send'](_0x2fb5f3);};}exports['index']=function(_0x1e24fa,_0x2034cc){var _0x5e3ed0={},_0x41100c={},_0x47a0cd={'count':0x0,'rows':[]};var _0x1d5ab5=_[_0x31c6('0x25')](db['ChatQueueReport'][_0x31c6('0x26')],function(_0x3840de){return{'name':_0x3840de[_0x31c6('0x27')],'type':_0x3840de[_0x31c6('0x28')][_0x31c6('0x29')]};});_0x41100c[_0x31c6('0x2a')]=_['map'](_0x1d5ab5,_0x31c6('0x2b'));_0x41100c[_0x31c6('0x2c')]=_['keys'](_0x1e24fa[_0x31c6('0x2c')]);_0x41100c[_0x31c6('0x2d')]=_['intersection'](_0x41100c['model'],_0x41100c['query']);_0x5e3ed0[_0x31c6('0x2e')]=_[_0x31c6('0x2f')](_0x41100c['model'],qs[_0x31c6('0x30')](_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x30')]));_0x5e3ed0[_0x31c6('0x2e')]=_0x5e3ed0[_0x31c6('0x2e')]['length']?_0x5e3ed0[_0x31c6('0x2e')]:_0x41100c[_0x31c6('0x2a')];if(!_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x31')](_0x31c6('0x32'))){_0x5e3ed0[_0x31c6('0x33')]=qs[_0x31c6('0x33')](_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x33')]);_0x5e3ed0['offset']=qs[_0x31c6('0x1e')](_0x1e24fa[_0x31c6('0x2c')]['offset']);}_0x5e3ed0[_0x31c6('0x34')]=qs[_0x31c6('0x35')](_0x1e24fa['query'][_0x31c6('0x35')]);_0x5e3ed0[_0x31c6('0x36')]=qs[_0x31c6('0x2d')](_['pick'](_0x1e24fa[_0x31c6('0x2c')],_0x41100c['filters']),_0x1d5ab5);if(_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x37')]){_0x5e3ed0[_0x31c6('0x36')]=_['merge'](_0x5e3ed0[_0x31c6('0x36')],{'$or':_[_0x31c6('0x25')](_0x1d5ab5,function(_0xdf5348){if(_0xdf5348[_0x31c6('0x28')]!=='VIRTUAL'){var _0x506491={};_0x506491[_0xdf5348[_0x31c6('0x2b')]]={'$like':'%'+_0x1e24fa[_0x31c6('0x2c')][_0x31c6('0x37')]+'%'};return _0x506491;}})});}_0x5e3ed0=_[_0x31c6('0x38')]({},_0x5e3ed0,_0x1e24fa[_0x31c6('0x39')]);var _0xeed7d7={'where':_0x5e3ed0[_0x31c6('0x36')]};return db[_0x31c6('0x3a')][_0x31c6('0x1d')](_0xeed7d7)[_0x31c6('0x23')](function(_0x4dba99){_0x47a0cd[_0x31c6('0x1d')]=_0x4dba99;if(_0x1e24fa[_0x31c6('0x2c')]['includeAll']){_0x5e3ed0['include']=[{'all':!![]}];}return db[_0x31c6('0x3a')][_0x31c6('0x3b')](_0x5e3ed0);})[_0x31c6('0x23')](function(_0xd85393){_0x47a0cd[_0x31c6('0x3c')]=_0xd85393;return _0x47a0cd;})[_0x31c6('0x23')](respondWithFilteredResult(_0x2034cc,_0x5e3ed0))['catch'](handleError(_0x2034cc,null));};exports['show']=function(_0x31c919,_0x5195b0){var _0x2c2129={'raw':!![],'where':{'id':_0x31c919['params']['id']}},_0x1f0b73={};_0x1f0b73[_0x31c6('0x2a')]=_[_0x31c6('0x3d')](db[_0x31c6('0x3a')][_0x31c6('0x26')]);_0x1f0b73[_0x31c6('0x2c')]=_[_0x31c6('0x3d')](_0x31c919['query']);_0x1f0b73[_0x31c6('0x2d')]=_[_0x31c6('0x2f')](_0x1f0b73[_0x31c6('0x2a')],_0x1f0b73[_0x31c6('0x2c')]);_0x2c2129[_0x31c6('0x2e')]=_['intersection'](_0x1f0b73[_0x31c6('0x2a')],qs[_0x31c6('0x30')](_0x31c919[_0x31c6('0x2c')][_0x31c6('0x30')]));_0x2c2129['attributes']=_0x2c2129[_0x31c6('0x2e')]['length']?_0x2c2129[_0x31c6('0x2e')]:_0x1f0b73[_0x31c6('0x2a')];if(_0x31c919[_0x31c6('0x2c')][_0x31c6('0x3e')]){_0x2c2129[_0x31c6('0x3f')]=[{'all':!![]}];}_0x2c2129=_['merge']({},_0x2c2129,_0x31c919[_0x31c6('0x39')]);return db[_0x31c6('0x3a')][_0x31c6('0x40')](_0x2c2129)[_0x31c6('0x23')](handleEntityNotFound(_0x5195b0,null))[_0x31c6('0x23')](respondWithResult(_0x5195b0,null))[_0x31c6('0x41')](handleError(_0x5195b0,null));};exports['create']=function(_0x36fc66,_0x52d06d){return db[_0x31c6('0x3a')]['create'](_0x36fc66['body'],{})[_0x31c6('0x23')](respondWithResult(_0x52d06d,0xc9))[_0x31c6('0x41')](handleError(_0x52d06d,null));};exports['update']=function(_0xf33b6c,_0x129197){if(_0xf33b6c[_0x31c6('0x42')]['id']){delete _0xf33b6c['body']['id'];}return db['ChatQueueReport'][_0x31c6('0x40')]({'where':{'id':_0xf33b6c[_0x31c6('0x43')]['id']}})[_0x31c6('0x23')](handleEntityNotFound(_0x129197,null))[_0x31c6('0x23')](saveUpdates(_0xf33b6c[_0x31c6('0x42')],null))[_0x31c6('0x23')](respondWithResult(_0x129197,null))[_0x31c6('0x41')](handleError(_0x129197,null));};exports[_0x31c6('0x24')]=function(_0x21ead7,_0x10f5b1){return db[_0x31c6('0x3a')][_0x31c6('0x40')]({'where':{'id':_0x21ead7['params']['id']}})['then'](handleEntityNotFound(_0x10f5b1,null))['then'](removeEntity(_0x10f5b1,null))[_0x31c6('0x41')](handleError(_0x10f5b1,null));};exports[_0x31c6('0x44')]=function(_0x1b0999,_0x433a63){return db[_0x31c6('0x3a')][_0x31c6('0x44')]()[_0x31c6('0x23')](respondWithResult(_0x433a63,null))['catch'](handleError(_0x433a63,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 30b2a89..1ed06cb 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x1fc35c,_0x2c40a0){var _0x136564=function(_0x320502){while(--_0x320502){_0x1fc35c['push'](_0x1fc35c['shift']());}};_0x136564(++_0x2c40a0);}(_0x757a,0xde));var _0xa757=function(_0x17c135,_0x5075a7){_0x17c135=_0x17c135-0x0;var _0x513577=_0x757a[_0x17c135];return _0x513577;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e1f52,_0x4ecd26){var _0x7c84bb=function(_0x4bca4f){while(--_0x4bca4f){_0x5e1f52['push'](_0x5e1f52['shift']());}};_0x7c84bb(++_0x4ecd26);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c5295d5..91429fd 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 _0x6741=['jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateChatQueueReport','ChatQueueReport','options','catch','update','body','raw','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1c4797,_0x30e7fa){var _0x5db0a5=function(_0x482945){while(--_0x482945){_0x1c4797['push'](_0x1c4797['shift']());}};_0x5db0a5(++_0x30e7fa);}(_0x6741,0x1d6));var _0x1674=function(_0x4dfd90,_0x4bc9ad){_0x4dfd90=_0x4dfd90-0x0;var _0x46e27f=_0x6741[_0x4dfd90];return _0x46e27f;};'use strict';var _=require(_0x1674('0x0'));var util=require(_0x1674('0x1'));var moment=require(_0x1674('0x2'));var BPromise=require(_0x1674('0x3'));var rs=require(_0x1674('0x4'));var fs=require('fs');var Redis=require(_0x1674('0x5'));var db=require(_0x1674('0x6'))['db'];var utils=require(_0x1674('0x7'));var logger=require(_0x1674('0x8'))(_0x1674('0x9'));var config=require(_0x1674('0xa'));var jayson=require(_0x1674('0xb'));var client=jayson[_0x1674('0xc')][_0x1674('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ad0f5,_0x119c3f,_0x38a7f6){return new BPromise(function(_0x49b2ad,_0x36a1c7){return client[_0x1674('0xe')](_0x2ad0f5,_0x38a7f6)[_0x1674('0xf')](function(_0x1fa115){logger['info'](_0x1674('0x10'),_0x119c3f,_0x1674('0x11'));logger[_0x1674('0x12')](_0x1674('0x13'),_0x119c3f,_0x1674('0x11'),JSON[_0x1674('0x14')](_0x1fa115));if(_0x1fa115['error']){if(_0x1fa115[_0x1674('0x15')][_0x1674('0x16')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x119c3f,_0x1fa115[_0x1674('0x15')][_0x1674('0x17')]);return _0x36a1c7(_0x1fa115[_0x1674('0x15')][_0x1674('0x17')]);}logger[_0x1674('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x119c3f,_0x1fa115[_0x1674('0x15')][_0x1674('0x17')]);return _0x49b2ad(_0x1fa115[_0x1674('0x15')]['message']);}else{logger[_0x1674('0x18')](_0x1674('0x10'),_0x119c3f,_0x1674('0x11'));_0x49b2ad(_0x1fa115[_0x1674('0x19')]['message']);}})['catch'](function(_0x22d34e){logger[_0x1674('0x15')](_0x1674('0x10'),_0x119c3f,_0x22d34e);_0x36a1c7(_0x22d34e);});});}exports[_0x1674('0x1a')]=function(_0x2c7415){var _0x5d391f=this;return new Promise(function(_0x27a090,_0x2eab47){return db[_0x1674('0x1b')]['create'](_0x2c7415['body'],{'raw':_0x2c7415[_0x1674('0x1c')]?_0x2c7415[_0x1674('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2667ac){logger[_0x1674('0x18')]('CreateChatQueueReport',_0x2c7415);logger[_0x1674('0x12')](_0x1674('0x1a'),_0x2c7415,JSON[_0x1674('0x14')](_0x2667ac));_0x27a090(_0x2667ac);})[_0x1674('0x1d')](function(_0xc81b77){logger['error'](_0x1674('0x1a'),_0xc81b77['message'],_0x2c7415);_0x2eab47(_0x5d391f[_0x1674('0x15')](0x1f4,_0xc81b77[_0x1674('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0x7d4246){var _0x25f4ce=this;return new Promise(function(_0x1f3d82,_0x1a2e48){return db['ChatQueueReport'][_0x1674('0x1e')](_0x7d4246[_0x1674('0x1f')],{'raw':_0x7d4246[_0x1674('0x1c')]?_0x7d4246[_0x1674('0x1c')][_0x1674('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7d4246['options']?_0x7d4246['options'][_0x1674('0x21')]||null:null,'attributes':_0x7d4246[_0x1674('0x1c')]?_0x7d4246[_0x1674('0x1c')][_0x1674('0x22')]||null:null,'limit':_0x7d4246[_0x1674('0x1c')]?_0x7d4246[_0x1674('0x1c')][_0x1674('0x23')]||null:null})[_0x1674('0xf')](function(_0x1a476b){logger['info'](_0x1674('0x24'),_0x7d4246);logger[_0x1674('0x12')]('UpdateChatQueueReport',_0x7d4246,JSON[_0x1674('0x14')](_0x1a476b));_0x1f3d82(_0x1a476b);})[_0x1674('0x1d')](function(_0xb9047e){logger[_0x1674('0x15')](_0x1674('0x24'),_0xb9047e[_0x1674('0x17')],_0x7d4246);_0x1a2e48(_0x25f4ce[_0x1674('0x15')](0x1f4,_0xb9047e[_0x1674('0x17')]));});});}; \ No newline at end of file +var _0x2127=['raw','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options'];(function(_0x571852,_0x34ae1f){var _0x1ec365=function(_0x398fe5){while(--_0x398fe5){_0x571852['push'](_0x571852['shift']());}};_0x1ec365(++_0x34ae1f);}(_0x2127,0x8a));var _0x7212=function(_0x540934,_0x333150){_0x540934=_0x540934-0x0;var _0x1b3d31=_0x2127[_0x540934];return _0x1b3d31;};'use strict';var _=require(_0x7212('0x0'));var util=require(_0x7212('0x1'));var moment=require(_0x7212('0x2'));var BPromise=require(_0x7212('0x3'));var rs=require(_0x7212('0x4'));var fs=require('fs');var Redis=require(_0x7212('0x5'));var db=require(_0x7212('0x6'))['db'];var utils=require(_0x7212('0x7'));var logger=require(_0x7212('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7212('0x9'));var client=jayson[_0x7212('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3225fc,_0x40ce7f,_0x5183a7){return new BPromise(function(_0x419b8f,_0x5b54a9){return client[_0x7212('0xb')](_0x3225fc,_0x5183a7)[_0x7212('0xc')](function(_0x59923a){logger[_0x7212('0xd')](_0x7212('0xe'),_0x40ce7f,_0x7212('0xf'));logger[_0x7212('0x10')](_0x7212('0x11'),_0x40ce7f,'request\x20sent',JSON[_0x7212('0x12')](_0x59923a));if(_0x59923a[_0x7212('0x13')]){if(_0x59923a[_0x7212('0x13')]['code']===0x1f4){logger[_0x7212('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x40ce7f,_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);return _0x5b54a9(_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);}logger[_0x7212('0x13')](_0x7212('0xe'),_0x40ce7f,_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);return _0x419b8f(_0x59923a[_0x7212('0x13')][_0x7212('0x14')]);}else{logger[_0x7212('0xd')](_0x7212('0xe'),_0x40ce7f,_0x7212('0xf'));_0x419b8f(_0x59923a[_0x7212('0x15')]['message']);}})[_0x7212('0x16')](function(_0x2e67d){logger[_0x7212('0x13')](_0x7212('0xe'),_0x40ce7f,_0x2e67d);_0x5b54a9(_0x2e67d);});});}exports[_0x7212('0x17')]=function(_0x272757){var _0x2cf4f0=this;return new Promise(function(_0x395b48,_0x4ca5a1){return db[_0x7212('0x18')][_0x7212('0x19')](_0x272757['body'],{'raw':_0x272757[_0x7212('0x1a')]?_0x272757[_0x7212('0x1a')][_0x7212('0x1b')]===undefined?!![]:![]:!![]})[_0x7212('0xc')](function(_0x5c6fe1){logger[_0x7212('0xd')](_0x7212('0x17'),_0x272757);logger[_0x7212('0x10')]('CreateChatQueueReport',_0x272757,JSON[_0x7212('0x12')](_0x5c6fe1));_0x395b48(_0x5c6fe1);})[_0x7212('0x16')](function(_0x13f292){logger[_0x7212('0x13')](_0x7212('0x17'),_0x13f292[_0x7212('0x14')],_0x272757);_0x4ca5a1(_0x2cf4f0['error'](0x1f4,_0x13f292[_0x7212('0x14')]));});});};exports[_0x7212('0x1c')]=function(_0xc43c54){var _0x5ce4f9=this;return new Promise(function(_0x7d4bd1,_0x4af986){return db[_0x7212('0x18')][_0x7212('0x1d')](_0xc43c54[_0x7212('0x1e')],{'raw':_0xc43c54[_0x7212('0x1a')]?_0xc43c54[_0x7212('0x1a')][_0x7212('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc43c54[_0x7212('0x1a')]?_0xc43c54['options'][_0x7212('0x1f')]||null:null,'attributes':_0xc43c54[_0x7212('0x1a')]?_0xc43c54[_0x7212('0x1a')]['attributes']||null:null,'limit':_0xc43c54[_0x7212('0x1a')]?_0xc43c54['options'][_0x7212('0x20')]||null:null})[_0x7212('0xc')](function(_0x3b8957){logger[_0x7212('0xd')](_0x7212('0x1c'),_0xc43c54);logger[_0x7212('0x10')](_0x7212('0x1c'),_0xc43c54,JSON[_0x7212('0x12')](_0x3b8957));_0x7d4bd1(_0x3b8957);})[_0x7212('0x16')](function(_0x1d3441){logger['error'](_0x7212('0x1c'),_0x1d3441[_0x7212('0x14')],_0xc43c54);_0x4af986(_0x5ce4f9['error'](0x1f4,_0x1d3441[_0x7212('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fcf5aed..64c7e86 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 _0xaab8=['/describe','describe','show','post','create','put','/:id','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get'];(function(_0x670d1f,_0x11e072){var _0x2c77a3=function(_0xd0529f){while(--_0xd0529f){_0x670d1f['push'](_0x670d1f['shift']());}};_0x2c77a3(++_0x11e072);}(_0xaab8,0x14a));var _0x8aab=function(_0x4daaf2,_0x377b13){_0x4daaf2=_0x4daaf2-0x0;var _0x572015=_0xaab8[_0x4daaf2];return _0x572015;};'use strict';var multer=require('multer');var util=require(_0x8aab('0x0'));var path=require('path');var timeout=require(_0x8aab('0x1'));var express=require(_0x8aab('0x2'));var router=express[_0x8aab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8aab('0x4'));var interaction=require(_0x8aab('0x5'));var config=require(_0x8aab('0x6'));var controller=require(_0x8aab('0x7'));router['get']('/',auth[_0x8aab('0x8')](),controller['index']);router[_0x8aab('0x9')](_0x8aab('0xa'),auth['isAuthenticated'](),controller[_0x8aab('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8aab('0xc')]);router[_0x8aab('0xd')]('/',auth[_0x8aab('0x8')](),controller[_0x8aab('0xe')]);router[_0x8aab('0xf')](_0x8aab('0x10'),auth[_0x8aab('0x8')](),controller[_0x8aab('0x11')]);router[_0x8aab('0x12')](_0x8aab('0x10'),auth[_0x8aab('0x8')](),controller['destroy']);module[_0x8aab('0x13')]=router; \ No newline at end of file +var _0xe021=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x86ee9c,_0xb532e8){var _0x4a66b2=function(_0x15556e){while(--_0x15556e){_0x86ee9c['push'](_0x86ee9c['shift']());}};_0x4a66b2(++_0xb532e8);}(_0xe021,0x10e));var _0x1e02=function(_0x1aaed0,_0x5b97e5){_0x1aaed0=_0x1aaed0-0x0;var _0x42513e=_0xe021[_0x1aaed0];return _0x42513e;};'use strict';var multer=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var path=require(_0x1e02('0x2'));var timeout=require(_0x1e02('0x3'));var express=require(_0x1e02('0x4'));var router=express['Router']();var fs_extra=require(_0x1e02('0x5'));var auth=require(_0x1e02('0x6'));var interaction=require(_0x1e02('0x7'));var config=require('../../config/environment');var controller=require(_0x1e02('0x8'));router[_0x1e02('0x9')]('/',auth[_0x1e02('0xa')](),controller[_0x1e02('0xb')]);router[_0x1e02('0x9')](_0x1e02('0xc'),auth[_0x1e02('0xa')](),controller[_0x1e02('0xd')]);router[_0x1e02('0x9')]('/:id',auth[_0x1e02('0xa')](),controller[_0x1e02('0xe')]);router['post']('/',auth[_0x1e02('0xa')](),controller['create']);router[_0x1e02('0xf')](_0x1e02('0x10'),auth[_0x1e02('0xa')](),controller[_0x1e02('0x11')]);router[_0x1e02('0x12')]('/:id',auth[_0x1e02('0xa')](),controller['destroy']);module[_0x1e02('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 00605a6..6f28b96 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1dfcd1,_0x45c368){var _0x25a5ec=function(_0x2fdffa){while(--_0x2fdffa){_0x1dfcd1['push'](_0x1dfcd1['shift']());}};_0x25a5ec(++_0x45c368);}(_0x70e0,0x17b));var _0x070e=function(_0x538637,_0xe6881a){_0x538637=_0x538637-0x0;var _0x420b6e=_0x70e0[_0x538637];return _0x420b6e;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 7303ca3..9f8a687 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 _0xd90d=['count','offset','set','Content-Range','apply','reject','update','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit'];(function(_0x21f200,_0x462df1){var _0xa9d125=function(_0x232b28){while(--_0x232b28){_0x21f200['push'](_0x21f200['shift']());}};_0xa9d125(++_0x462df1);}(_0xd90d,0x1b4));var _0xdd90=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xd90d[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require(_0xdd90('0x0'));var rimraf=require(_0xdd90('0x1'));var zipdir=require(_0xdd90('0x2'));var jsonpatch=require(_0xdd90('0x3'));var rp=require(_0xdd90('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd90('0x5'));var util=require(_0xdd90('0x6'));var path=require(_0xdd90('0x7'));var sox=require('sox');var csv=require(_0xdd90('0x8'));var ejs=require(_0xdd90('0x9'));var fs=require('fs');var fs_extra=require(_0xdd90('0xa'));var _=require(_0xdd90('0xb'));var squel=require(_0xdd90('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd90('0xd'));var deskjs=require(_0xdd90('0xe'));var toCsv=require(_0xdd90('0x8'));var querystring=require(_0xdd90('0xf'));var Papa=require('papaparse');var Redis=require(_0xdd90('0x10'));var authService=require(_0xdd90('0x11'));var qs=require(_0xdd90('0x12'));var as=require(_0xdd90('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd90('0x14'))(_0xdd90('0x15'));var utils=require(_0xdd90('0x16'));var config=require(_0xdd90('0x17'));var licenseUtil=require(_0xdd90('0x18'));var db=require(_0xdd90('0x19'))['db'];function respondWithStatusCode(_0x52b4fd,_0x34d765){_0x34d765=_0x34d765||0xcc;return function(_0x268dfd){if(_0x268dfd){return _0x52b4fd[_0xdd90('0x1a')](_0x34d765);}return _0x52b4fd['status'](_0x34d765)[_0xdd90('0x1b')]();};}function respondWithResult(_0x4adfd0,_0x419624){_0x419624=_0x419624||0xc8;return function(_0x33ce77){if(_0x33ce77){return _0x4adfd0[_0xdd90('0x1c')](_0x419624)[_0xdd90('0x1d')](_0x33ce77);}};}function respondWithFilteredResult(_0x10c624,_0x5c0d0b){return function(_0x3f8ac2){if(_0x3f8ac2){var _0x456757=typeof _0x5c0d0b['offset']===_0xdd90('0x1e')&&typeof _0x5c0d0b[_0xdd90('0x1f')]==='undefined';var _0x4960e8=_0x3f8ac2[_0xdd90('0x20')];var _0x23073d=_0x456757?0x0:_0x5c0d0b[_0xdd90('0x21')];var _0x35a4f9=_0x456757?_0x3f8ac2[_0xdd90('0x20')]:_0x5c0d0b[_0xdd90('0x21')]+_0x5c0d0b[_0xdd90('0x1f')];var _0x3752d6;if(_0x35a4f9>=_0x4960e8){_0x35a4f9=_0x4960e8;_0x3752d6=0xc8;}else{_0x3752d6=0xce;}_0x10c624['status'](_0x3752d6);return _0x10c624[_0xdd90('0x22')](_0xdd90('0x23'),_0x23073d+'-'+_0x35a4f9+'/'+_0x4960e8)[_0xdd90('0x1d')](_0x3f8ac2);}return null;};}function patchUpdates(_0x4c1164){return function(_0x57197a){try{jsonpatch[_0xdd90('0x24')](_0x57197a,_0x4c1164,!![]);}catch(_0x2679d5){return BPromise[_0xdd90('0x25')](_0x2679d5);}return _0x57197a['save']();};}function saveUpdates(_0x3d820b,_0x23a839){return function(_0x279ccd){if(_0x279ccd){return _0x279ccd[_0xdd90('0x26')](_0x3d820b)['then'](function(_0x2d625a){return _0x2d625a;});}return null;};}function removeEntity(_0x4b1276,_0x7d3888){return function(_0x1cdb11){if(_0x1cdb11){return _0x1cdb11[_0xdd90('0x27')]()['then'](function(){_0x4b1276[_0xdd90('0x1c')](0xcc)[_0xdd90('0x1b')]();});}};}function handleEntityNotFound(_0x2c3375,_0x3de445){return function(_0x1b5a6e){if(!_0x1b5a6e){_0x2c3375[_0xdd90('0x1a')](0x194);}return _0x1b5a6e;};}function handleError(_0x4439d9,_0xa1bf51){_0xa1bf51=_0xa1bf51||0x1f4;return function(_0x52f121){logger[_0xdd90('0x28')](_0x52f121['stack']);if(_0x52f121[_0xdd90('0x29')]){delete _0x52f121[_0xdd90('0x29')];}_0x4439d9[_0xdd90('0x1c')](_0xa1bf51)[_0xdd90('0x2a')](_0x52f121);};}exports[_0xdd90('0x2b')]=function(_0x4553b5,_0x481ade){var _0x22169c={},_0x41f7eb={},_0x42abd2={'count':0x0,'rows':[]};var _0x4f7aab=_[_0xdd90('0x2c')](db[_0xdd90('0x2d')][_0xdd90('0x2e')],function(_0x33a4e2){return{'name':_0x33a4e2[_0xdd90('0x2f')],'type':_0x33a4e2['type'][_0xdd90('0x30')]};});_0x41f7eb[_0xdd90('0x31')]=_['map'](_0x4f7aab,_0xdd90('0x29'));_0x41f7eb['query']=_[_0xdd90('0x32')](_0x4553b5[_0xdd90('0x33')]);_0x41f7eb[_0xdd90('0x34')]=_[_0xdd90('0x35')](_0x41f7eb[_0xdd90('0x31')],_0x41f7eb[_0xdd90('0x33')]);_0x22169c[_0xdd90('0x36')]=_['intersection'](_0x41f7eb[_0xdd90('0x31')],qs[_0xdd90('0x37')](_0x4553b5['query'][_0xdd90('0x37')]));_0x22169c[_0xdd90('0x36')]=_0x22169c[_0xdd90('0x36')]['length']?_0x22169c['attributes']:_0x41f7eb['model'];if(!_0x4553b5['query'][_0xdd90('0x38')](_0xdd90('0x39'))){_0x22169c['limit']=qs[_0xdd90('0x1f')](_0x4553b5[_0xdd90('0x33')][_0xdd90('0x1f')]);_0x22169c['offset']=qs['offset'](_0x4553b5[_0xdd90('0x33')]['offset']);}_0x22169c['order']=qs['sort'](_0x4553b5[_0xdd90('0x33')][_0xdd90('0x3a')]);_0x22169c[_0xdd90('0x3b')]=qs[_0xdd90('0x34')](_['pick'](_0x4553b5[_0xdd90('0x33')],_0x41f7eb[_0xdd90('0x34')]),_0x4f7aab);if(_0x4553b5[_0xdd90('0x33')][_0xdd90('0x3c')]){_0x22169c[_0xdd90('0x3b')]=_[_0xdd90('0x3d')](_0x22169c[_0xdd90('0x3b')],{'$or':_[_0xdd90('0x2c')](_0x4f7aab,function(_0x29fb32){if(_0x29fb32[_0xdd90('0x3e')]!==_0xdd90('0x3f')){var _0x513702={};_0x513702[_0x29fb32[_0xdd90('0x29')]]={'$like':'%'+_0x4553b5[_0xdd90('0x33')][_0xdd90('0x3c')]+'%'};return _0x513702;}})});}_0x22169c=_[_0xdd90('0x3d')]({},_0x22169c,_0x4553b5[_0xdd90('0x40')]);var _0xfef63c={'where':_0x22169c['where']};return db[_0xdd90('0x2d')][_0xdd90('0x20')](_0xfef63c)['then'](function(_0x51a307){_0x42abd2[_0xdd90('0x20')]=_0x51a307;if(_0x4553b5[_0xdd90('0x33')][_0xdd90('0x41')]){_0x22169c[_0xdd90('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xdd90('0x43')](_0x22169c);})[_0xdd90('0x44')](function(_0x9cba7c){_0x42abd2[_0xdd90('0x45')]=_0x9cba7c;return _0x42abd2;})['then'](respondWithFilteredResult(_0x481ade,_0x22169c))['catch'](handleError(_0x481ade,null));};exports[_0xdd90('0x46')]=function(_0x4e4642,_0x56c806){var _0x29b14f={'raw':!![],'where':{'id':_0x4e4642[_0xdd90('0x47')]['id']}},_0xe63bc9={};_0xe63bc9[_0xdd90('0x31')]=_[_0xdd90('0x32')](db['ChatTransferReport'][_0xdd90('0x2e')]);_0xe63bc9['query']=_[_0xdd90('0x32')](_0x4e4642['query']);_0xe63bc9[_0xdd90('0x34')]=_[_0xdd90('0x35')](_0xe63bc9['model'],_0xe63bc9[_0xdd90('0x33')]);_0x29b14f[_0xdd90('0x36')]=_['intersection'](_0xe63bc9['model'],qs[_0xdd90('0x37')](_0x4e4642[_0xdd90('0x33')][_0xdd90('0x37')]));_0x29b14f[_0xdd90('0x36')]=_0x29b14f[_0xdd90('0x36')][_0xdd90('0x48')]?_0x29b14f[_0xdd90('0x36')]:_0xe63bc9[_0xdd90('0x31')];if(_0x4e4642['query']['includeAll']){_0x29b14f[_0xdd90('0x42')]=[{'all':!![]}];}_0x29b14f=_[_0xdd90('0x3d')]({},_0x29b14f,_0x4e4642['options']);return db[_0xdd90('0x2d')][_0xdd90('0x49')](_0x29b14f)[_0xdd90('0x44')](handleEntityNotFound(_0x56c806,null))['then'](respondWithResult(_0x56c806,null))[_0xdd90('0x4a')](handleError(_0x56c806,null));};exports[_0xdd90('0x4b')]=function(_0x3798c1,_0x27ce1d){return db['ChatTransferReport']['create'](_0x3798c1['body'],{})[_0xdd90('0x44')](respondWithResult(_0x27ce1d,0xc9))['catch'](handleError(_0x27ce1d,null));};exports[_0xdd90('0x26')]=function(_0x4517ca,_0x4015d6){if(_0x4517ca[_0xdd90('0x4c')]['id']){delete _0x4517ca['body']['id'];}return db['ChatTransferReport'][_0xdd90('0x49')]({'where':{'id':_0x4517ca['params']['id']}})[_0xdd90('0x44')](handleEntityNotFound(_0x4015d6,null))[_0xdd90('0x44')](saveUpdates(_0x4517ca[_0xdd90('0x4c')],null))[_0xdd90('0x44')](respondWithResult(_0x4015d6,null))[_0xdd90('0x4a')](handleError(_0x4015d6,null));};exports[_0xdd90('0x27')]=function(_0x9bc4c2,_0x12c26a){return db[_0xdd90('0x2d')]['find']({'where':{'id':_0x9bc4c2[_0xdd90('0x47')]['id']}})['then'](handleEntityNotFound(_0x12c26a,null))['then'](removeEntity(_0x12c26a,null))[_0xdd90('0x4a')](handleError(_0x12c26a,null));};exports[_0xdd90('0x4d')]=function(_0x24310f,_0x4ec41b){return db[_0xdd90('0x2d')]['describe']()[_0xdd90('0x44')](respondWithResult(_0x4ec41b,null))['catch'](handleError(_0x4ec41b,null));}; \ No newline at end of file +var _0xfaa3=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','index','ChatTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xfaa3,0x110));var _0x3faa=function(_0x210ba0,_0x48f352){_0x210ba0=_0x210ba0-0x0;var _0xacf2c9=_0xfaa3[_0x210ba0];return _0xacf2c9;};'use strict';var emlformat=require(_0x3faa('0x0'));var rimraf=require(_0x3faa('0x1'));var zipdir=require(_0x3faa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3faa('0x3'));var moment=require(_0x3faa('0x4'));var BPromise=require(_0x3faa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3faa('0x6'));var ejs=require(_0x3faa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3faa('0x8'));var squel=require(_0x3faa('0x9'));var crypto=require(_0x3faa('0xa'));var jsforce=require(_0x3faa('0xb'));var deskjs=require(_0x3faa('0xc'));var toCsv=require(_0x3faa('0x6'));var querystring=require(_0x3faa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3faa('0xe'));var qs=require(_0x3faa('0xf'));var as=require(_0x3faa('0x10'));var hardwareService=require(_0x3faa('0x11'));var logger=require('../../config/logger')(_0x3faa('0x12'));var utils=require(_0x3faa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3faa('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28fd2a,_0x35d492){_0x35d492=_0x35d492||0xcc;return function(_0x4cd8fd){if(_0x4cd8fd){return _0x28fd2a['sendStatus'](_0x35d492);}return _0x28fd2a['status'](_0x35d492)['end']();};}function respondWithResult(_0x11781f,_0x3b35a0){_0x3b35a0=_0x3b35a0||0xc8;return function(_0x4596a8){if(_0x4596a8){return _0x11781f[_0x3faa('0x15')](_0x3b35a0)[_0x3faa('0x16')](_0x4596a8);}};}function respondWithFilteredResult(_0x5cd6ff,_0x4e00da){return function(_0x287cad){if(_0x287cad){var _0x360c4f=typeof _0x4e00da[_0x3faa('0x17')]===_0x3faa('0x18')&&typeof _0x4e00da[_0x3faa('0x19')]==='undefined';var _0x4309cb=_0x287cad[_0x3faa('0x1a')];var _0x3a421f=_0x360c4f?0x0:_0x4e00da[_0x3faa('0x17')];var _0x4b875f=_0x360c4f?_0x287cad[_0x3faa('0x1a')]:_0x4e00da[_0x3faa('0x17')]+_0x4e00da['limit'];var _0x104e8c;if(_0x4b875f>=_0x4309cb){_0x4b875f=_0x4309cb;_0x104e8c=0xc8;}else{_0x104e8c=0xce;}_0x5cd6ff[_0x3faa('0x15')](_0x104e8c);return _0x5cd6ff[_0x3faa('0x1b')](_0x3faa('0x1c'),_0x3a421f+'-'+_0x4b875f+'/'+_0x4309cb)[_0x3faa('0x16')](_0x287cad);}return null;};}function patchUpdates(_0x40d01c){return function(_0x543706){try{jsonpatch['apply'](_0x543706,_0x40d01c,!![]);}catch(_0x33b1c6){return BPromise[_0x3faa('0x1d')](_0x33b1c6);}return _0x543706[_0x3faa('0x1e')]();};}function saveUpdates(_0x4379f9,_0x56c21c){return function(_0x489e4a){if(_0x489e4a){return _0x489e4a[_0x3faa('0x1f')](_0x4379f9)[_0x3faa('0x20')](function(_0x4b0f9a){return _0x4b0f9a;});}return null;};}function removeEntity(_0x30dc37,_0x6477b4){return function(_0x3c2ff6){if(_0x3c2ff6){return _0x3c2ff6[_0x3faa('0x21')]()[_0x3faa('0x20')](function(){_0x30dc37[_0x3faa('0x15')](0xcc)[_0x3faa('0x22')]();});}};}function handleEntityNotFound(_0x5c82cf,_0x441f32){return function(_0x1874ec){if(!_0x1874ec){_0x5c82cf['sendStatus'](0x194);}return _0x1874ec;};}function handleError(_0x55635b,_0x1b5c5d){_0x1b5c5d=_0x1b5c5d||0x1f4;return function(_0x4f164e){logger[_0x3faa('0x23')](_0x4f164e['stack']);if(_0x4f164e[_0x3faa('0x24')]){delete _0x4f164e['name'];}_0x55635b[_0x3faa('0x15')](_0x1b5c5d)['send'](_0x4f164e);};}exports[_0x3faa('0x25')]=function(_0x3f2deb,_0x5e5326){var _0x18fb8d={},_0x2ffdc7={},_0x172142={'count':0x0,'rows':[]};var _0x1ab681=_['map'](db[_0x3faa('0x26')][_0x3faa('0x27')],function(_0x2c4168){return{'name':_0x2c4168['fieldName'],'type':_0x2c4168[_0x3faa('0x28')][_0x3faa('0x29')]};});_0x2ffdc7[_0x3faa('0x2a')]=_[_0x3faa('0x2b')](_0x1ab681,_0x3faa('0x24'));_0x2ffdc7[_0x3faa('0x2c')]=_[_0x3faa('0x2d')](_0x3f2deb[_0x3faa('0x2c')]);_0x2ffdc7[_0x3faa('0x2e')]=_[_0x3faa('0x2f')](_0x2ffdc7[_0x3faa('0x2a')],_0x2ffdc7['query']);_0x18fb8d[_0x3faa('0x30')]=_['intersection'](_0x2ffdc7['model'],qs[_0x3faa('0x31')](_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x31')]));_0x18fb8d['attributes']=_0x18fb8d[_0x3faa('0x30')][_0x3faa('0x32')]?_0x18fb8d[_0x3faa('0x30')]:_0x2ffdc7['model'];if(!_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x33')](_0x3faa('0x34'))){_0x18fb8d[_0x3faa('0x19')]=qs['limit'](_0x3f2deb['query'][_0x3faa('0x19')]);_0x18fb8d['offset']=qs[_0x3faa('0x17')](_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x17')]);}_0x18fb8d[_0x3faa('0x35')]=qs[_0x3faa('0x36')](_0x3f2deb[_0x3faa('0x2c')]['sort']);_0x18fb8d[_0x3faa('0x37')]=qs[_0x3faa('0x2e')](_['pick'](_0x3f2deb[_0x3faa('0x2c')],_0x2ffdc7[_0x3faa('0x2e')]),_0x1ab681);if(_0x3f2deb['query']['filter']){_0x18fb8d[_0x3faa('0x37')]=_[_0x3faa('0x38')](_0x18fb8d[_0x3faa('0x37')],{'$or':_[_0x3faa('0x2b')](_0x1ab681,function(_0xe33657){if(_0xe33657['type']!==_0x3faa('0x39')){var _0x1bfd8e={};_0x1bfd8e[_0xe33657[_0x3faa('0x24')]]={'$like':'%'+_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x3a')]+'%'};return _0x1bfd8e;}})});}_0x18fb8d=_[_0x3faa('0x38')]({},_0x18fb8d,_0x3f2deb[_0x3faa('0x3b')]);var _0x1556ae={'where':_0x18fb8d[_0x3faa('0x37')]};return db[_0x3faa('0x26')][_0x3faa('0x1a')](_0x1556ae)[_0x3faa('0x20')](function(_0x351d91){_0x172142['count']=_0x351d91;if(_0x3f2deb[_0x3faa('0x2c')][_0x3faa('0x3c')]){_0x18fb8d[_0x3faa('0x3d')]=[{'all':!![]}];}return db[_0x3faa('0x26')][_0x3faa('0x3e')](_0x18fb8d);})[_0x3faa('0x20')](function(_0x32d294){_0x172142[_0x3faa('0x3f')]=_0x32d294;return _0x172142;})['then'](respondWithFilteredResult(_0x5e5326,_0x18fb8d))[_0x3faa('0x40')](handleError(_0x5e5326,null));};exports[_0x3faa('0x41')]=function(_0x4d4ca7,_0x4e5e74){var _0x200e9a={'raw':!![],'where':{'id':_0x4d4ca7['params']['id']}},_0x444227={};_0x444227[_0x3faa('0x2a')]=_['keys'](db['ChatTransferReport'][_0x3faa('0x27')]);_0x444227[_0x3faa('0x2c')]=_['keys'](_0x4d4ca7[_0x3faa('0x2c')]);_0x444227[_0x3faa('0x2e')]=_[_0x3faa('0x2f')](_0x444227['model'],_0x444227['query']);_0x200e9a[_0x3faa('0x30')]=_['intersection'](_0x444227[_0x3faa('0x2a')],qs[_0x3faa('0x31')](_0x4d4ca7[_0x3faa('0x2c')]['fields']));_0x200e9a[_0x3faa('0x30')]=_0x200e9a['attributes'][_0x3faa('0x32')]?_0x200e9a['attributes']:_0x444227['model'];if(_0x4d4ca7[_0x3faa('0x2c')]['includeAll']){_0x200e9a[_0x3faa('0x3d')]=[{'all':!![]}];}_0x200e9a=_[_0x3faa('0x38')]({},_0x200e9a,_0x4d4ca7[_0x3faa('0x3b')]);return db[_0x3faa('0x26')][_0x3faa('0x42')](_0x200e9a)['then'](handleEntityNotFound(_0x4e5e74,null))['then'](respondWithResult(_0x4e5e74,null))[_0x3faa('0x40')](handleError(_0x4e5e74,null));};exports[_0x3faa('0x43')]=function(_0x1064c3,_0x2d0bc8){return db[_0x3faa('0x26')][_0x3faa('0x43')](_0x1064c3[_0x3faa('0x44')],{})['then'](respondWithResult(_0x2d0bc8,0xc9))[_0x3faa('0x40')](handleError(_0x2d0bc8,null));};exports[_0x3faa('0x1f')]=function(_0x1319ea,_0x40e2b2){if(_0x1319ea[_0x3faa('0x44')]['id']){delete _0x1319ea['body']['id'];}return db[_0x3faa('0x26')][_0x3faa('0x42')]({'where':{'id':_0x1319ea[_0x3faa('0x45')]['id']}})[_0x3faa('0x20')](handleEntityNotFound(_0x40e2b2,null))[_0x3faa('0x20')](saveUpdates(_0x1319ea[_0x3faa('0x44')],null))['then'](respondWithResult(_0x40e2b2,null))[_0x3faa('0x40')](handleError(_0x40e2b2,null));};exports['destroy']=function(_0x1c0d42,_0x5a5dae){return db[_0x3faa('0x26')][_0x3faa('0x42')]({'where':{'id':_0x1c0d42['params']['id']}})[_0x3faa('0x20')](handleEntityNotFound(_0x5a5dae,null))['then'](removeEntity(_0x5a5dae,null))[_0x3faa('0x40')](handleError(_0x5a5dae,null));};exports[_0x3faa('0x46')]=function(_0xd7b425,_0xbb02c){return db['ChatTransferReport'][_0x3faa('0x46')]()[_0x3faa('0x20')](respondWithResult(_0xbb02c,null))[_0x3faa('0x40')](handleError(_0xbb02c,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2c0f8c1..3da91a8 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 _0x86c0=['./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x314377,_0x5eae6b){var _0x20093f=function(_0x39c7ef){while(--_0x39c7ef){_0x314377['push'](_0x314377['shift']());}};_0x20093f(++_0x5eae6b);}(_0x86c0,0x1d8));var _0x086c=function(_0x23d313,_0x4a9058){_0x23d313=_0x23d313-0x0;var _0x30aaa0=_0x86c0[_0x23d313];return _0x30aaa0;};'use strict';var _=require(_0x086c('0x0'));var util=require(_0x086c('0x1'));var logger=require(_0x086c('0x2'))(_0x086c('0x3'));var moment=require(_0x086c('0x4'));var BPromise=require('bluebird');var rp=require(_0x086c('0x5'));var fs=require('fs');var path=require(_0x086c('0x6'));var rimraf=require('rimraf');var config=require(_0x086c('0x7'));var attributes=require(_0x086c('0x8'));module['exports']=function(_0x25e15f,_0x592883){return _0x25e15f[_0x086c('0x9')](_0x086c('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x086c('0xb'),'fields':[_0x086c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef02=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','define','uniqueid'];(function(_0x544e2b,_0x10a25e){var _0x479085=function(_0x40a526){while(--_0x40a526){_0x544e2b['push'](_0x544e2b['shift']());}};_0x479085(++_0x10a25e);}(_0xef02,0x1cb));var _0x2ef0=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0xef02[_0xee2e7a];return _0x319dd3;};'use strict';var _=require(_0x2ef0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ef0('0x1'));var moment=require(_0x2ef0('0x2'));var BPromise=require(_0x2ef0('0x3'));var rp=require(_0x2ef0('0x4'));var fs=require('fs');var path=require(_0x2ef0('0x5'));var rimraf=require('rimraf');var config=require(_0x2ef0('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x349af5,_0x4c680b){return _0x349af5[_0x2ef0('0x7')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ef0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 86c336f..62b3a84 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 _0x19df=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x19df,0xb4));var _0xf19d=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x19df[_0x1a21ff];return _0x25afc1;};'use strict';var _=require(_0xf19d('0x0'));var util=require('util');var moment=require(_0xf19d('0x1'));var BPromise=require(_0xf19d('0x2'));var rs=require(_0xf19d('0x3'));var fs=require('fs');var Redis=require(_0xf19d('0x4'));var db=require(_0xf19d('0x5'))['db'];var utils=require(_0xf19d('0x6'));var logger=require(_0xf19d('0x7'))(_0xf19d('0x8'));var config=require('../../config/environment');var jayson=require(_0xf19d('0x9'));var client=jayson[_0xf19d('0xa')][_0xf19d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x345d8d,_0x56ee14,_0x30ccac){return new BPromise(function(_0x1a90b7,_0x5af20d){return client[_0xf19d('0xc')](_0x345d8d,_0x30ccac)[_0xf19d('0xd')](function(_0x3243cc){logger[_0xf19d('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x56ee14,_0xf19d('0xf'));logger['debug'](_0xf19d('0x10'),_0x56ee14,_0xf19d('0xf'),JSON['stringify'](_0x3243cc));if(_0x3243cc[_0xf19d('0x11')]){if(_0x3243cc[_0xf19d('0x11')][_0xf19d('0x12')]===0x1f4){logger['error'](_0xf19d('0x13'),_0x56ee14,_0x3243cc[_0xf19d('0x11')][_0xf19d('0x14')]);return _0x5af20d(_0x3243cc['error']['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x56ee14,_0x3243cc['error']['message']);return _0x1a90b7(_0x3243cc[_0xf19d('0x11')]['message']);}else{logger[_0xf19d('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x56ee14,_0xf19d('0xf'));_0x1a90b7(_0x3243cc[_0xf19d('0x15')][_0xf19d('0x14')]);}})[_0xf19d('0x16')](function(_0x28be91){logger[_0xf19d('0x11')](_0xf19d('0x13'),_0x56ee14,_0x28be91);_0x5af20d(_0x28be91);});});} \ No newline at end of file +var _0xdcbe=['http','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x32bb5e,_0x31d14e){var _0x228589=function(_0x57bc86){while(--_0x57bc86){_0x32bb5e['push'](_0x32bb5e['shift']());}};_0x228589(++_0x31d14e);}(_0xdcbe,0xdd));var _0xedcb=function(_0x5bb95e,_0x3c9bd7){_0x5bb95e=_0x5bb95e-0x0;var _0x3b1d93=_0xdcbe[_0x5bb95e];return _0x3b1d93;};'use strict';var _=require(_0xedcb('0x0'));var util=require('util');var moment=require(_0xedcb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedcb('0x2'));var db=require(_0xedcb('0x3'))['db'];var utils=require(_0xedcb('0x4'));var logger=require(_0xedcb('0x5'))(_0xedcb('0x6'));var config=require(_0xedcb('0x7'));var jayson=require(_0xedcb('0x8'));var client=jayson[_0xedcb('0x9')][_0xedcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aa072,_0x31a0f6,_0x746dc9){return new BPromise(function(_0x3b6ebd,_0x166d59){return client['request'](_0x2aa072,_0x746dc9)[_0xedcb('0xb')](function(_0x20783a){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x31a0f6,_0xedcb('0xc'));logger[_0xedcb('0xd')](_0xedcb('0xe'),_0x31a0f6,'request\x20sent',JSON[_0xedcb('0xf')](_0x20783a));if(_0x20783a[_0xedcb('0x10')]){if(_0x20783a[_0xedcb('0x10')][_0xedcb('0x11')]===0x1f4){logger[_0xedcb('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x31a0f6,_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);return _0x166d59(_0x20783a['error']['message']);}logger['error'](_0xedcb('0x13'),_0x31a0f6,_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);return _0x3b6ebd(_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);}else{logger[_0xedcb('0x14')](_0xedcb('0x13'),_0x31a0f6,_0xedcb('0xc'));_0x3b6ebd(_0x20783a['result']['message']);}})['catch'](function(_0x312f1d){logger[_0xedcb('0x10')](_0xedcb('0x13'),_0x31a0f6,_0x312f1d);_0x166d59(_0x312f1d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d467c8e..69dd361 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 _0x9f8d=['get','isAuthenticated','index','/describe','/:id','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x31f1ca,_0xebd80a){var _0x3232d1=function(_0x5212d2){while(--_0x5212d2){_0x31f1ca['push'](_0x31f1ca['shift']());}};_0x3232d1(++_0xebd80a);}(_0x9f8d,0x160));var _0xd9f8=function(_0x56a1a7,_0x3c6e93){_0x56a1a7=_0x56a1a7-0x0;var _0x4b6cd4=_0x9f8d[_0x56a1a7];return _0x4b6cd4;};'use strict';var multer=require(_0xd9f8('0x0'));var util=require(_0xd9f8('0x1'));var path=require(_0xd9f8('0x2'));var timeout=require(_0xd9f8('0x3'));var express=require(_0xd9f8('0x4'));var router=express[_0xd9f8('0x5')]();var fs_extra=require(_0xd9f8('0x6'));var auth=require(_0xd9f8('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xd9f8('0x8')]('/',auth[_0xd9f8('0x9')](),controller[_0xd9f8('0xa')]);router[_0xd9f8('0x8')](_0xd9f8('0xb'),auth[_0xd9f8('0x9')](),controller['describe']);router[_0xd9f8('0x8')](_0xd9f8('0xc'),auth[_0xd9f8('0x9')](),controller['show']);router['post']('/',auth[_0xd9f8('0x9')](),controller['create']);router[_0xd9f8('0xd')](_0xd9f8('0xc'),auth[_0xd9f8('0x9')](),controller['update']);router[_0xd9f8('0xe')]('/:id',auth[_0xd9f8('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfcfc=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x28bfba,_0x543076){var _0x1d6099=function(_0x2b3847){while(--_0x2b3847){_0x28bfba['push'](_0x28bfba['shift']());}};_0x1d6099(++_0x543076);}(_0xfcfc,0x1c7));var _0xcfcf=function(_0x2c2902,_0x75cdab){_0x2c2902=_0x2c2902-0x0;var _0x44ec3b=_0xfcfc[_0x2c2902];return _0x44ec3b;};'use strict';var multer=require(_0xcfcf('0x0'));var util=require(_0xcfcf('0x1'));var path=require('path');var timeout=require(_0xcfcf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfcf('0x3'));var auth=require(_0xcfcf('0x4'));var interaction=require(_0xcfcf('0x5'));var config=require(_0xcfcf('0x6'));var controller=require(_0xcfcf('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xcfcf('0x8')]);router[_0xcfcf('0x9')](_0xcfcf('0xa'),auth[_0xcfcf('0xb')](),controller[_0xcfcf('0xc')]);router[_0xcfcf('0x9')](_0xcfcf('0xd'),auth[_0xcfcf('0xb')](),controller['show']);router[_0xcfcf('0xe')]('/',auth[_0xcfcf('0xb')](),controller[_0xcfcf('0xf')]);router[_0xcfcf('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcfcf('0x11')](_0xcfcf('0xd'),auth[_0xcfcf('0xb')](),controller[_0xcfcf('0x12')]);module[_0xcfcf('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 2b95465..840be87 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 _0x51bd=['Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','star','thumb','TEXT','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','input','textarea'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0x51bd,0x198));var _0xd51b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x51bd[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xd51b('0x0'));var rs=require('randomstring');module[_0xd51b('0x1')]={'name':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'unique':_0xd51b('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xd51b('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x4')},'key':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x5')},'customerAlias':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'defaultValue':_0xd51b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'defaultValue':_0xd51b('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'defaultValue':_0xd51b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd51b('0x2')]},'animation':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xd51b('0x9'),'squared'),'defaultValue':_0xd51b('0x9')},'header_online':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0xa')},'start_chat_button':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd51b('0xc')},'download_transcript':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd51b('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd51b('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0xf')},'noteTitle':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x10')},'placeholderMessage':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x11')},'closingMessage':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0xb')},'skipMessageButton':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x12')},'conditionAgreement':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x13')},'ratingType':{'type':Sequelize[_0xd51b('0x14')](_0xd51b('0x15'),_0xd51b('0x16')),'defaultValue':_0xd51b('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xd51b('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd51b('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd51b('0x18'),'type':_0xd51b('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xd51b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd51b('0x4'),'type':_0xd51b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd51b('0x1a')](_0xd51b('0x1b'))?JSON[_0xd51b('0x1c')](this[_0xd51b('0x1a')]('onlineForm')):{};},'set':function(_0x41d5a6){return this[_0xd51b('0x1d')](_0xd51b('0x1b'),JSON[_0xd51b('0x1e')](_0x41d5a6));}},'offlineForm':{'type':Sequelize[_0xd51b('0x17')],'defaultValue':function(){return JSON[_0xd51b('0x1e')]({'items':[{'type':_0xd51b('0x1f'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd51b('0x4'),'type':'email'},'variable':null},{'type':_0xd51b('0x20'),'config':{'placeholder':_0xd51b('0x21')},'props':{'title':_0xd51b('0x21'),'helpText':_0xd51b('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xd51b('0x1a')](_0xd51b('0x23'))?JSON[_0xd51b('0x1c')](this['getDataValue'](_0xd51b('0x23'))):{};},'set':function(_0x307e22){return this[_0xd51b('0x1d')](_0xd51b('0x23'),JSON[_0xd51b('0x1e')](_0x307e22));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd51b('0x24')]();}},'autoclose':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd51b('0x25')},'waitingMessage':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'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[_0xd51b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x27')},'skipUnmanaged':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x12')},'sendUnmanaged':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0xb')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd51b('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd51b('0x17')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd51b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd51b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x28')},'verticalAlignment':{'type':Sequelize[_0xd51b('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x29')},'messagesAlignment':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xd51b('0x2')]},'customerAvatar':{'type':Sequelize[_0xd51b('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'defaultValue':_0xd51b('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd51b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd51b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':_0xd51b('0x2b')},'systemAvatar':{'type':Sequelize[_0xd51b('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![],'comment':_0xd51b('0x2c'),'set':function(_0x54f9c1){if(!_0x54f9c1)this[_0xd51b('0x1d')](_0xd51b('0x2d'),null);this[_0xd51b('0x1d')](_0xd51b('0x2e'),_0x54f9c1);}},'vidaooEscalation':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd51b('0x2')]},'vidaooTopic':{'type':Sequelize[_0xd51b('0x2')],'allowNull':![],'defaultValue':_0xd51b('0x2f')},'vidaooNote':{'type':Sequelize[_0xd51b('0x2')],'defaultValue':function(){return _0xd51b('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd51b('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xac3e=['ENUM','rounded','squared','Send','Contact\x20us','BOOLEAN','INTEGER','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!','Skip','thumb','star','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','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}}','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A'];(function(_0x1d1c05,_0xab4b54){var _0x2f802c=function(_0x5dc4b5){while(--_0x5dc4b5){_0x1d1c05['push'](_0x1d1c05['shift']());}};_0x2f802c(++_0xab4b54);}(_0xac3e,0x157));var _0xeac3=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xac3e[_0x50e593];return _0x3821d0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeac3('0x0'));module[_0xeac3('0x1')]={'name':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'unique':_0xeac3('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x4')},'mapKeyOffline':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x4')},'key':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x5')},'customerAlias':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':_0xeac3('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeac3('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeac3('0x7')](_0xeac3('0x8'),_0xeac3('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0xa')},'header_offline':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0xb')},'download_transcript':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xeac3('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xeac3('0xf')]},'closingQuestion':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x13')},'placeholderMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x16')},'conditionAgreement':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star',_0xeac3('0x17')),'defaultValue':_0xeac3('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':function(){return JSON[_0xeac3('0x19')]({'items':[{'type':_0xeac3('0x1a'),'variable':null,'config':{'placeholder':_0xeac3('0x1b'),'type':_0xeac3('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xeac3('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeac3('0x1d')]('onlineForm')?JSON[_0xeac3('0x1e')](this[_0xeac3('0x1d')](_0xeac3('0x1f'))):{};},'set':function(_0x3f3f29){return this[_0xeac3('0x20')](_0xeac3('0x1f'),JSON[_0xeac3('0x19')](_0x3f3f29));}},'offlineForm':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':function(){return JSON[_0xeac3('0x19')]({'items':[{'type':'input','props':{'title':_0xeac3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xeac3('0x4'),'type':'email'},'variable':null},{'type':_0xeac3('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0xeac3('0x22'),'helpText':_0xeac3('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xeac3('0x1d')]('offlineForm')?JSON[_0xeac3('0x1e')](this[_0xeac3('0x1d')]('offlineForm')):{};},'set':function(_0x443ca4){return this['setDataValue']('offlineForm',JSON[_0xeac3('0x19')](_0x443ca4));}},'token':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':function(){return rs[_0xeac3('0x24')]();}},'autoclose':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeac3('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeac3('0x2')]},'waitingTitle':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x25')},'waitingMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x26')},'offlineMessageBody':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x28')},'skipUnmanaged':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xeac3('0x2')]},'notificationTemplate':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':function(){return _0xeac3('0x29');}},'notificationSound':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xeac3('0x2a')},'verticalAlignment':{'type':Sequelize[_0xeac3('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x2b')},'messagesAlignment':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':_0xeac3('0x2c')},'defaultTitle':{'type':Sequelize[_0xeac3('0x2')]},'customerAvatar':{'type':Sequelize[_0xeac3('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xeac3('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':_0xeac3('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeac3('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xeac3('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeac3('0xd')],'comment':_0xeac3('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xd34c8d){if(!_0xd34c8d)this[_0xeac3('0x20')](_0xeac3('0x2f'),null);this[_0xeac3('0x20')](_0xeac3('0x30'),_0xd34c8d);}},'vidaooEscalation':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeac3('0x2')]},'vidaooTopic':{'type':Sequelize[_0xeac3('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xeac3('0x2')],'defaultValue':function(){return _0xeac3('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xeac3('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeac3('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeac3('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 67cd0d4..593197f 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 _0x88b3=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','ChatApplication','Applications','Interval','Intervals','account','applications','orderBy','priority','asc','ListId','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','originalname','toPairsIn','mapValues','subjectOffline','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','Tag','Tags','color','tag','findAll','getProactiveActions','../../config/license/util','chatLicenseExceeded','URL','3.5.0','remote','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','textButtonColor','hideWhenOffline','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','json','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','update','destroy','stack','name','send','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','catch','inspect','map','get','all','some','user-agent-parser','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','model','%s\x20%s\x20%s','vendor','type','index','Pause','mandatoryDispositionPause','ChatWebsite','fieldName','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','addAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','join','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','existsSync','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x1af07b,_0x1aa449){var _0x300ad6=function(_0x3b6cef){while(--_0x3b6cef){_0x1af07b['push'](_0x1af07b['shift']());}};_0x300ad6(++_0x1aa449);}(_0x88b3,0x86));var _0x388b=function(_0x591e93,_0x2cdfb6){_0x591e93=_0x591e93-0x0;var _0x369ab0=_0x88b3[_0x591e93];return _0x369ab0;};'use strict';var Mustache=require(_0x388b('0x0'));var util=require(_0x388b('0x1'));var path=require(_0x388b('0x2'));var ejs=require(_0x388b('0x3'));var fs=require('fs');var fs_extra=require(_0x388b('0x4'));var _=require(_0x388b('0x5'));var querystring=require('querystring');var htmlToText=require(_0x388b('0x6'));var Redis=require(_0x388b('0x7'));var jayson=require('jayson/promise');var url=require(_0x388b('0x8'));var qs=require(_0x388b('0x9'));var logger=require(_0x388b('0xa'))(_0x388b('0xb'));var config=require(_0x388b('0xc'));var APIOutOfIntervalError=require(_0x388b('0xd'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x388b('0xd'))[_0x388b('0xe')];var APIHandleError=require(_0x388b('0xd'))[_0x388b('0xf')];var db=require(_0x388b('0x10'))['db'];config[_0x388b('0x11')]=_[_0x388b('0x12')](config[_0x388b('0x11')],{'host':_0x388b('0x13'),'port':0x18eb});var socket=require(_0x388b('0x14'))(new Redis(config[_0x388b('0x11')]));require(_0x388b('0x15'))[_0x388b('0x16')](socket);var client=jayson['client'][_0x388b('0x17')]({'port':0x232c});var client9002=jayson['client'][_0x388b('0x17')]({'port':0x232a});var client9003=jayson[_0x388b('0x18')][_0x388b('0x17')]({'port':0x232b});var client9001=jayson['client'][_0x388b('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x363ed7,_0x123d77,_0x4a2850,_0x485ac6){return new Promise(function(_0x54d761,_0x1b3071){var _0x6c11a2=_0x485ac6||client;return _0x6c11a2['request'](_0x363ed7,_0x4a2850)[_0x388b('0x19')](function(_0x3afbe4){logger['info'](_0x388b('0x1a'),_0x123d77,_0x388b('0x1b'));logger[_0x388b('0x1c')](_0x388b('0x1d'),_0x123d77,_0x388b('0x1b'),JSON[_0x388b('0x1e')](_0x3afbe4));if(_0x3afbe4[_0x388b('0x1f')]){if(_0x3afbe4[_0x388b('0x1f')][_0x388b('0x20')]===0x1f4){logger[_0x388b('0x1f')](_0x388b('0x1a'),_0x123d77,_0x3afbe4[_0x388b('0x1f')][_0x388b('0x21')]);return _0x1b3071(_0x3afbe4[_0x388b('0x1f')][_0x388b('0x21')]);}logger[_0x388b('0x1f')](_0x388b('0x1a'),_0x123d77,_0x3afbe4[_0x388b('0x1f')][_0x388b('0x21')]);return _0x54d761(_0x3afbe4[_0x388b('0x1f')]['message']);}else{logger[_0x388b('0x22')](_0x388b('0x1a'),_0x123d77,'request\x20sent');_0x54d761(_0x3afbe4[_0x388b('0x23')][_0x388b('0x21')]);}})['catch'](function(_0x4aa28c){logger[_0x388b('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x123d77,_0x4aa28c);_0x1b3071(_0x4aa28c);});});}function respondWithStatusCode(_0x2c7b2d,_0x380f0f){_0x380f0f=_0x380f0f||0xcc;return function(_0x3c1e1f){if(_0x3c1e1f){return _0x2c7b2d[_0x388b('0x24')](_0x380f0f);}return _0x2c7b2d['status'](_0x380f0f)[_0x388b('0x25')]();};}function respondWithResult(_0x1d8d16,_0x168734){_0x168734=_0x168734||0xc8;return function(_0x2b1942){if(_0x2b1942){return _0x1d8d16[_0x388b('0x26')](_0x168734)['json'](_0x2b1942);}};}function respondWithFilteredResult(_0x111ed1,_0x4f2147){return function(_0x5d2284){if(_0x5d2284){var _0x4bd187=typeof _0x4f2147[_0x388b('0x27')]==='undefined'&&typeof _0x4f2147[_0x388b('0x28')]===_0x388b('0x29');var _0x31db60=_0x5d2284[_0x388b('0x2a')];var _0x36c0f3=_0x4bd187?0x0:_0x4f2147[_0x388b('0x27')];var _0x5855b4=_0x4bd187?_0x5d2284['count']:_0x4f2147[_0x388b('0x27')]+_0x4f2147[_0x388b('0x28')];var _0x56f7c2;if(_0x5855b4>=_0x31db60){_0x5855b4=_0x31db60;_0x56f7c2=0xc8;}else{_0x56f7c2=0xce;}_0x111ed1['status'](_0x56f7c2);return _0x111ed1[_0x388b('0x2b')](_0x388b('0x2c'),_0x36c0f3+'-'+_0x5855b4+'/'+_0x31db60)['json'](_0x5d2284);}return null;};}function saveUpdates(_0x544d27){return function(_0x3a6959){if(_0x3a6959){return _0x3a6959[_0x388b('0x2d')](_0x544d27)[_0x388b('0x19')](function(_0x3d55b3){return _0x3d55b3;});}return null;};}function removeEntity(_0xcf6463){return function(_0x28e6f6){if(_0x28e6f6){return _0x28e6f6[_0x388b('0x2e')]()[_0x388b('0x19')](function(){var _0x822ef2=_0x28e6f6['get']({'plain':!![]});var _0x7eaa1f='ChatWebsites';return db['UserProfileResource'][_0x388b('0x2e')]({'where':{'type':_0x7eaa1f,'resourceId':_0x822ef2['id']}})['then'](function(){return _0x28e6f6;});})[_0x388b('0x19')](function(){_0xcf6463[_0x388b('0x26')](0xcc)[_0x388b('0x25')]();});}};}function handleEntityNotFound(_0x56dd53){return function(_0xa1ae87){if(!_0xa1ae87){_0x56dd53[_0x388b('0x24')](0x194);}return _0xa1ae87;};}function handleError(_0x2a6bb5,_0x47b945){_0x47b945=_0x47b945||0x1f4;return function(_0x681863){logger[_0x388b('0x1f')](_0x681863[_0x388b('0x2f')]);if(_0x681863[_0x388b('0x30')]){delete _0x681863[_0x388b('0x30')];}_0x2a6bb5[_0x388b('0x26')](_0x47b945)[_0x388b('0x31')](_0x681863);};}function iftimePromise(_0x31727b,_0x35121e){return respondWithRpcPromise(_0x388b('0x32'),_0x388b('0x33'),{'command':_0x35121e[_0x388b('0x34')]?util['format'](_0x388b('0x35'),_0x31727b[_0x388b('0x36')],_0x35121e['timezone']):util['format']('iftime\x20%s',_0x31727b[_0x388b('0x36')])},client9002)[_0x388b('0x19')](function(_0x5260b0){var _0x21bbd2=_0x5260b0&&_0x5260b0[_0x388b('0x37')]('true')>=0x0?!![]:![];logger[_0x388b('0x22')](_0x388b('0x38'),_0x35121e['id'],_0x31727b['id'],_0x31727b[_0x388b('0x36')],_0x21bbd2?'ONLINE':'OFFLINE',_0x35121e['timezone']?_0x35121e[_0x388b('0x34')]:_0x388b('0x39'));return _0x21bbd2;})[_0x388b('0x3a')](function(_0x5bb798){logger[_0x388b('0x1f')](_0x388b('0x38'),_0x35121e['id'],_0x31727b['id'],_0x31727b[_0x388b('0x36')],util[_0x388b('0x3b')](_0x5bb798,{'showHidden':![],'depth':null}),_0x35121e[_0x388b('0x34')]?_0x35121e['timezone']:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x2b1d7b){var _0x2ae7f9=_[_0x388b('0x3c')](_0x2b1d7b['Interval']['Intervals'],function(_0x52dc0c){var _0x219fe9=_0x52dc0c[_0x388b('0x3d')]({'plain':!![]});return iftimePromise(_0x219fe9,_0x2b1d7b);});return Promise[_0x388b('0x3e')](_0x2ae7f9)[_0x388b('0x19')](function(_0x4352dd){return _[_0x388b('0x3f')](_0x4352dd);});}function createInteractionObject(_0xb0117b,_0x17be7a,_0x3b4dcd,_0x14fa62){var _0x4ac17a=require(_0x388b('0x40'));var _0x1555ca=new _0x4ac17a();var _0x1d39c1=_0x1555ca['setUA'](_0x3b4dcd[_0x388b('0x41')])['getResult']();var _0x5dcdc1=_0x17be7a[_0x388b('0x42')];if(_0x3b4dcd[_0x388b('0x43')]){_0x5dcdc1=_0x3b4dcd['cf-connecting-ip'];}else if(_0x3b4dcd[_0x388b('0x44')]){_0x5dcdc1=_['first'](_0x3b4dcd['x-forwarded-for'][_0x388b('0x45')](','));}return{'ContactId':_0x14fa62['id'],'ChatWebsiteId':_0xb0117b,'from':(_0x14fa62[_0x388b('0x46')]||'')+'\x20'+(_0x14fa62['lastName']||''),'customerIp':_0x5dcdc1,'customerPort':_0x3b4dcd[_0x388b('0x47')]?_0x3b4dcd['x-real-port']:null,'referer':_0x17be7a[_0x388b('0x48')],'browserName':_0x1d39c1[_0x388b('0x49')][_0x388b('0x30')]&&_0x1d39c1['browser'][_0x388b('0x4a')]?util['format'](_0x388b('0x4b'),_0x1d39c1['browser'][_0x388b('0x30')],_0x1d39c1[_0x388b('0x49')][_0x388b('0x4a')]):_0x388b('0x4c'),'browserVersion':_0x1d39c1[_0x388b('0x49')]['version']||_0x388b('0x4c'),'osName':util[_0x388b('0x4d')](_0x388b('0x4b'),_0x1d39c1['os'][_0x388b('0x30')],_0x1d39c1['os'][_0x388b('0x4a')]),'osVersion':_0x1d39c1['os'][_0x388b('0x4a')],'deviceModel':_0x1d39c1[_0x388b('0x4e')][_0x388b('0x4f')]&&_0x1d39c1[_0x388b('0x4e')]['vendor']?util[_0x388b('0x4d')](_0x388b('0x50'),_0x1d39c1[_0x388b('0x4e')][_0x388b('0x4f')],_0x1d39c1[_0x388b('0x4e')][_0x388b('0x51')],_0x1d39c1['device'][_0x388b('0x52')]):null,'deviceVendor':_0x1d39c1[_0x388b('0x4e')][_0x388b('0x51')],'deviceType':_0x1d39c1[_0x388b('0x4e')][_0x388b('0x52')],'formData':JSON[_0x388b('0x1e')](_0x17be7a)};}exports[_0x388b('0x53')]=function(_0x5948f9,_0x1d02f4){var _0xb2199d={'include':[{'model':db[_0x388b('0x54')],'as':_0x388b('0x55')}]},_0x35df25={},_0x723d3e={'count':0x0,'rows':[]};var _0x1e5cc2=_['map'](db[_0x388b('0x56')]['rawAttributes'],function(_0x22e318){return{'name':_0x22e318[_0x388b('0x57')],'type':_0x22e318['type']['key']};});_0x35df25[_0x388b('0x4f')]=_[_0x388b('0x3c')](_0x1e5cc2,_0x388b('0x30'));_0x35df25['query']=_[_0x388b('0x58')](_0x5948f9[_0x388b('0x59')]);_0x35df25[_0x388b('0x5a')]=_[_0x388b('0x5b')](_0x35df25['model'],_0x35df25[_0x388b('0x59')]);_0xb2199d[_0x388b('0x5c')]=_[_0x388b('0x5b')](_0x35df25[_0x388b('0x4f')],qs[_0x388b('0x5d')](_0x5948f9[_0x388b('0x59')][_0x388b('0x5d')]));_0xb2199d[_0x388b('0x5c')]=_0xb2199d[_0x388b('0x5c')][_0x388b('0x5e')]?_0xb2199d[_0x388b('0x5c')]:_0x35df25[_0x388b('0x4f')];if(!_0x5948f9[_0x388b('0x59')]['hasOwnProperty'](_0x388b('0x5f'))){_0xb2199d[_0x388b('0x28')]=qs['limit'](_0x5948f9[_0x388b('0x59')]['limit']);_0xb2199d[_0x388b('0x27')]=qs[_0x388b('0x27')](_0x5948f9['query'][_0x388b('0x27')]);}_0xb2199d[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x5948f9[_0x388b('0x59')][_0x388b('0x61')]);_0xb2199d[_0x388b('0x62')]=qs[_0x388b('0x5a')](_['pick'](_0x5948f9['query'],_0x35df25[_0x388b('0x5a')]),_0x1e5cc2);if(_0x5948f9['query'][_0x388b('0x63')]){_0xb2199d[_0x388b('0x62')]=_['merge'](_0xb2199d[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x1e5cc2,function(_0x96e162){if(_0x96e162[_0x388b('0x52')]!==_0x388b('0x64')){var _0x457c9a={};_0x457c9a[_0x96e162[_0x388b('0x30')]]={'$like':'%'+_0x5948f9[_0x388b('0x59')][_0x388b('0x63')]+'%'};return _0x457c9a;}})});}_0xb2199d=_[_0x388b('0x65')]({},_0xb2199d,_0x5948f9[_0x388b('0x66')]);var _0x1e7f89={'where':_0xb2199d[_0x388b('0x62')]};return db['ChatWebsite']['count'](_0x1e7f89)[_0x388b('0x19')](function(_0x550bfb){_0x723d3e[_0x388b('0x2a')]=_0x550bfb;if(_0x5948f9['query'][_0x388b('0x67')]){_0xb2199d[_0x388b('0x68')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0xb2199d);})[_0x388b('0x19')](function(_0x21f683){_0x723d3e[_0x388b('0x69')]=_0x21f683;return _0x723d3e;})[_0x388b('0x19')](respondWithFilteredResult(_0x1d02f4,_0xb2199d))[_0x388b('0x3a')](handleError(_0x1d02f4,null));};exports[_0x388b('0x6a')]=function(_0x56f72b,_0x4906ad){var _0x550ef5={'raw':![],'where':{'id':_0x56f72b[_0x388b('0x6b')]['id']},'include':[{'model':db[_0x388b('0x54')],'as':_0x388b('0x55')}]},_0x4f5b3b={};_0x4f5b3b['model']=_[_0x388b('0x58')](db['ChatWebsite'][_0x388b('0x6c')]);_0x4f5b3b[_0x388b('0x59')]=_[_0x388b('0x58')](_0x56f72b['query']);_0x4f5b3b[_0x388b('0x5a')]=_[_0x388b('0x5b')](_0x4f5b3b[_0x388b('0x4f')],_0x4f5b3b[_0x388b('0x59')]);_0x550ef5[_0x388b('0x5c')]=_[_0x388b('0x5b')](_0x4f5b3b[_0x388b('0x4f')],qs[_0x388b('0x5d')](_0x56f72b[_0x388b('0x59')][_0x388b('0x5d')]));_0x550ef5[_0x388b('0x5c')]=_0x550ef5[_0x388b('0x5c')]['length']?_0x550ef5[_0x388b('0x5c')]:_0x4f5b3b[_0x388b('0x4f')];if(_0x56f72b[_0x388b('0x59')][_0x388b('0x67')]){_0x550ef5['include']=[{'all':!![]}];}_0x550ef5=_[_0x388b('0x65')]({},_0x550ef5,_0x56f72b[_0x388b('0x66')]);return db[_0x388b('0x56')]['find'](_0x550ef5)[_0x388b('0x19')](handleEntityNotFound(_0x4906ad,null))[_0x388b('0x19')](respondWithResult(_0x4906ad,null))[_0x388b('0x3a')](handleError(_0x4906ad,null));};exports[_0x388b('0x6d')]=function(_0x37b9f9,_0x486d1e){return db[_0x388b('0x56')][_0x388b('0x6d')](_0x37b9f9[_0x388b('0x6e')],{})['then'](function(_0x5f14af){var _0xf9c306=_0x37b9f9[_0x388b('0x6f')]['get']({'plain':!![]});if(!_0xf9c306)throw new Error(_0x388b('0x70'));if(_0xf9c306[_0x388b('0x71')]===_0x388b('0x6f')){var _0x49432a=_0x5f14af[_0x388b('0x3d')]({'plain':!![]});var _0x8fbf00=_0x388b('0x72');return db['UserProfileSection'][_0x388b('0x73')]({'where':{'name':_0x8fbf00,'userProfileId':_0xf9c306['userProfileId']},'raw':!![]})['then'](function(_0x3dd818){if(_0x3dd818&&_0x3dd818[_0x388b('0x74')]===0x0){return db['UserProfileResource'][_0x388b('0x6d')]({'name':_0x49432a[_0x388b('0x30')],'resourceId':_0x49432a['id'],'type':_0x3dd818['name'],'sectionId':_0x3dd818['id']},{})['then'](function(){return _0x5f14af;});}else{return _0x5f14af;}})[_0x388b('0x3a')](function(_0x5449f7){logger[_0x388b('0x1f')](_0x388b('0x75'),_0x5449f7);throw _0x5449f7;});}return _0x5f14af;})[_0x388b('0x19')](respondWithResult(_0x486d1e,0xc9))['catch'](handleError(_0x486d1e,null));};exports[_0x388b('0x2d')]=function(_0x298185,_0x9fb867){if(_0x298185[_0x388b('0x6e')]['id']){delete _0x298185['body']['id'];}return db['ChatWebsite'][_0x388b('0x73')]({'where':{'id':_0x298185[_0x388b('0x6b')]['id']},'include':[{'model':db[_0x388b('0x54')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x9fb867,null))[_0x388b('0x19')](saveUpdates(_0x298185[_0x388b('0x6e')],null))[_0x388b('0x19')](respondWithResult(_0x9fb867,null))[_0x388b('0x3a')](handleError(_0x9fb867,null));};exports[_0x388b('0x2e')]=function(_0x2398ec,_0x454bd9){return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x2398ec['params']['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x454bd9,null))[_0x388b('0x19')](removeEntity(_0x454bd9,null))[_0x388b('0x3a')](handleError(_0x454bd9,null));};exports[_0x388b('0x76')]=function(_0x281776,_0x4c98dd){return db[_0x388b('0x56')]['describe']()[_0x388b('0x19')](respondWithResult(_0x4c98dd,null))[_0x388b('0x3a')](handleError(_0x4c98dd,null));};exports[_0x388b('0x77')]=function(_0x2091aa,_0x4a6856){if(_0x2091aa[_0x388b('0x6e')]['id']){delete _0x2091aa[_0x388b('0x6e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2091aa[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x4a6856,null))[_0x388b('0x19')](function(_0x55fdcf){if(_0x55fdcf){_0x2091aa[_0x388b('0x6e')][_0x388b('0x78')]=_0x55fdcf['id'];return db[_0x388b('0x79')][_0x388b('0x6d')](_0x2091aa[_0x388b('0x6e')]);}})[_0x388b('0x19')](respondWithResult(_0x4a6856,null))[_0x388b('0x3a')](handleError(_0x4a6856,null));};exports[_0x388b('0x7a')]=function(_0x27ec9e,_0x5e1d57){var _0x59b2be={'raw':![],'where':{}};var _0x2e0cbe={};var _0x556596={'count':0x0,'rows':[]};return db[_0x388b('0x56')][_0x388b('0x7b')]({'where':{'id':_0x27ec9e[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x5e1d57,null))[_0x388b('0x19')](function(_0x465818){if(_0x465818){_0x2e0cbe[_0x388b('0x4f')]=_['keys'](db[_0x388b('0x79')][_0x388b('0x6c')]);_0x2e0cbe[_0x388b('0x59')]=_[_0x388b('0x58')](_0x27ec9e[_0x388b('0x59')]);_0x2e0cbe[_0x388b('0x5a')]=_[_0x388b('0x5b')](_0x2e0cbe[_0x388b('0x4f')],_0x2e0cbe[_0x388b('0x59')]);_0x59b2be['attributes']=_[_0x388b('0x5b')](_0x2e0cbe[_0x388b('0x4f')],qs['fields'](_0x27ec9e[_0x388b('0x59')][_0x388b('0x5d')]));_0x59b2be['attributes']=_0x59b2be[_0x388b('0x5c')][_0x388b('0x5e')]?_0x59b2be[_0x388b('0x5c')]:_0x2e0cbe['model'];if(!_0x27ec9e[_0x388b('0x59')][_0x388b('0x7c')](_0x388b('0x5f'))){_0x59b2be[_0x388b('0x28')]=qs['limit'](_0x27ec9e[_0x388b('0x59')]['limit']);_0x59b2be[_0x388b('0x27')]=qs[_0x388b('0x27')](_0x27ec9e[_0x388b('0x59')]['offset']);}_0x59b2be[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x27ec9e['query'][_0x388b('0x61')]);_0x59b2be[_0x388b('0x62')]=qs[_0x388b('0x5a')](_[_0x388b('0x7d')](_0x27ec9e[_0x388b('0x59')],_0x2e0cbe[_0x388b('0x5a')]));_0x59b2be['where'][_0x388b('0x78')]=_0x465818['id'];if(_0x27ec9e[_0x388b('0x59')][_0x388b('0x63')]){_0x59b2be[_0x388b('0x62')]=_[_0x388b('0x65')](_0x59b2be[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x59b2be['attributes'],function(_0xc080a0){var _0x195cc1={};_0x195cc1[_0xc080a0]={'$like':'%'+_0x27ec9e[_0x388b('0x59')][_0x388b('0x63')]+'%'};return _0x195cc1;})});}_0x59b2be=_[_0x388b('0x65')]({},_0x59b2be,_0x27ec9e[_0x388b('0x66')]);return db['Disposition'][_0x388b('0x2a')]({'where':_0x59b2be[_0x388b('0x62')]})['then'](function(_0x525553){_0x556596['count']=_0x525553;if(_0x27ec9e[_0x388b('0x59')][_0x388b('0x67')]){_0x59b2be['include']=[{'all':!![]}];}return db[_0x388b('0x79')]['findAll'](_0x59b2be);})[_0x388b('0x19')](function(_0x2535fb){_0x556596[_0x388b('0x69')]=_0x2535fb;return _0x556596;});}})[_0x388b('0x19')](respondWithFilteredResult(_0x5e1d57,_0x59b2be))[_0x388b('0x3a')](handleError(_0x5e1d57,null));};exports['removeDispositions']=function(_0x9a674c,_0x106ef2){return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x9a674c['params']['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x106ef2,null))[_0x388b('0x19')](function(_0x62f2a4){if(_0x62f2a4){return _0x62f2a4[_0x388b('0x7e')](_0x9a674c['query']['ids']);}})[_0x388b('0x19')](respondWithStatusCode(_0x106ef2,null))[_0x388b('0x3a')](handleError(_0x106ef2,null));};exports['addAnswer']=function(_0x4bdd92,_0x399474){if(_0x4bdd92[_0x388b('0x6e')]['id']){delete _0x4bdd92[_0x388b('0x6e')]['id'];}return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x4bdd92[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x399474,null))[_0x388b('0x19')](function(_0x5867f0){if(_0x5867f0){_0x4bdd92[_0x388b('0x6e')]['ChatWebsiteId']=_0x5867f0['id'];return db[_0x388b('0x7f')]['create'](_0x4bdd92[_0x388b('0x6e')]);}})[_0x388b('0x19')](respondWithResult(_0x399474,null))[_0x388b('0x3a')](handleError(_0x399474,null));};exports[_0x388b('0x80')]=function(_0x207d0f,_0x538fe4){var _0x55f01f={'raw':![],'where':{}};var _0x1dbcfb={};var _0xf242f9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x207d0f[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x538fe4,null))[_0x388b('0x19')](function(_0x3bbb30){if(_0x3bbb30){_0x1dbcfb['model']=_[_0x388b('0x58')](db[_0x388b('0x7f')]['rawAttributes']);_0x1dbcfb[_0x388b('0x59')]=_[_0x388b('0x58')](_0x207d0f[_0x388b('0x59')]);_0x1dbcfb[_0x388b('0x5a')]=_[_0x388b('0x5b')](_0x1dbcfb[_0x388b('0x4f')],_0x1dbcfb['query']);_0x55f01f[_0x388b('0x5c')]=_[_0x388b('0x5b')](_0x1dbcfb[_0x388b('0x4f')],qs[_0x388b('0x5d')](_0x207d0f[_0x388b('0x59')][_0x388b('0x5d')]));_0x55f01f[_0x388b('0x5c')]=_0x55f01f[_0x388b('0x5c')][_0x388b('0x5e')]?_0x55f01f[_0x388b('0x5c')]:_0x1dbcfb[_0x388b('0x4f')];if(!_0x207d0f[_0x388b('0x59')][_0x388b('0x7c')](_0x388b('0x5f'))){_0x55f01f[_0x388b('0x28')]=qs[_0x388b('0x28')](_0x207d0f[_0x388b('0x59')]['limit']);_0x55f01f[_0x388b('0x27')]=qs[_0x388b('0x27')](_0x207d0f['query'][_0x388b('0x27')]);}_0x55f01f[_0x388b('0x60')]=qs['sort'](_0x207d0f[_0x388b('0x59')]['sort']);_0x55f01f[_0x388b('0x62')]=qs[_0x388b('0x5a')](_['pick'](_0x207d0f[_0x388b('0x59')],_0x1dbcfb[_0x388b('0x5a')]));_0x55f01f['where'][_0x388b('0x78')]=_0x3bbb30['id'];if(_0x207d0f[_0x388b('0x59')][_0x388b('0x63')]){_0x55f01f[_0x388b('0x62')]=_[_0x388b('0x65')](_0x55f01f[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x55f01f[_0x388b('0x5c')],function(_0x33744b){var _0x53f77e={};_0x53f77e[_0x33744b]={'$like':'%'+_0x207d0f[_0x388b('0x59')]['filter']+'%'};return _0x53f77e;})});}_0x55f01f=_[_0x388b('0x65')]({},_0x55f01f,_0x207d0f[_0x388b('0x66')]);return db[_0x388b('0x7f')]['count']({'where':_0x55f01f[_0x388b('0x62')]})[_0x388b('0x19')](function(_0x48c684){_0xf242f9['count']=_0x48c684;if(_0x207d0f[_0x388b('0x59')][_0x388b('0x67')]){_0x55f01f[_0x388b('0x68')]=[{'all':!![]}];}return db[_0x388b('0x7f')]['findAll'](_0x55f01f);})['then'](function(_0x45ba1c){_0xf242f9['rows']=_0x45ba1c;return _0xf242f9;});}})[_0x388b('0x19')](respondWithFilteredResult(_0x538fe4,_0x55f01f))[_0x388b('0x3a')](handleError(_0x538fe4,null));};exports['removeAnswers']=function(_0x10dcb5,_0x472fad){return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x10dcb5[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x472fad,null))['then'](function(_0x39806d){if(_0x39806d){return _0x39806d[_0x388b('0x81')](_0x10dcb5[_0x388b('0x59')][_0x388b('0x82')]);}})[_0x388b('0x19')](respondWithStatusCode(_0x472fad,null))[_0x388b('0x3a')](handleError(_0x472fad,null));};exports[_0x388b('0x83')]=function(_0x1fc73c,_0x4a4cb5){_0x1fc73c[_0x388b('0x6e')][_0x388b('0x84')]=_0x1fc73c[_0x388b('0x85')]['filename'];return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x1fc73c[_0x388b('0x6b')]['id']}})['then'](handleEntityNotFound(_0x4a4cb5,null))['then'](saveUpdates(_0x1fc73c[_0x388b('0x6e')],null))['then'](respondWithResult(_0x4a4cb5,null))['catch'](handleError(_0x4a4cb5,null));};exports[_0x388b('0x86')]=function(_0x13f5f0,_0x7ce16f){_0x13f5f0[_0x388b('0x6e')]['agentAvatar']=_0x13f5f0[_0x388b('0x85')]['filename'];return db['ChatWebsite'][_0x388b('0x73')]({'where':{'id':_0x13f5f0[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x7ce16f,null))[_0x388b('0x19')](saveUpdates(_0x13f5f0['body'],null))[_0x388b('0x19')](respondWithResult(_0x7ce16f,null))[_0x388b('0x3a')](handleError(_0x7ce16f,null));};exports[_0x388b('0x87')]=function(_0x21f142,_0x49b4a1){_0x21f142[_0x388b('0x6e')][_0x388b('0x88')]=_0x21f142[_0x388b('0x85')][_0x388b('0x89')];return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x21f142[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x49b4a1,null))[_0x388b('0x19')](saveUpdates(_0x21f142[_0x388b('0x6e')],null))['then'](respondWithResult(_0x49b4a1,null))['catch'](handleError(_0x49b4a1,null));};exports[_0x388b('0x8a')]=function(_0x5d95c5,_0x3faca0){_0x5d95c5[_0x388b('0x6e')][_0x388b('0x8b')]=_0x5d95c5[_0x388b('0x85')][_0x388b('0x89')];return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x5d95c5[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x3faca0,null))['then'](saveUpdates(_0x5d95c5[_0x388b('0x6e')],null))[_0x388b('0x19')](respondWithResult(_0x3faca0,null))[_0x388b('0x3a')](handleError(_0x3faca0,null));};exports[_0x388b('0x8c')]=function(_0x2cce99,_0x69d385){var _0x3c4b01=path['join'](config[_0x388b('0x8d')],_0x388b('0x8e'));var _0x26b421={'where':{'id':_0x2cce99['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x35fd42=![];return require('../../config/license/util')[_0x388b('0x8f')]()['then'](function(_0x2adb6b){if(_0x2adb6b){_0x35fd42=_0x2adb6b[_0x388b('0x90')];}})['then'](function(){return db[_0x388b('0x56')]['find'](_0x26b421);})[_0x388b('0x19')](handleEntityNotFound(_0x69d385,null))[_0x388b('0x19')](function(_0x5cb69e){if(_0x5cb69e){if(!_['isNil'](_0x5cb69e[_0x388b('0x84')])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/logos/',_0x5cb69e[_0x388b('0x84')]))&&_0x35fd42){_0x3c4b01=path[_0x388b('0x91')](config['root'],'server/files/images/logos/',_0x5cb69e[_0x388b('0x84')]);}}return _0x69d385[_0x388b('0x92')](_0x3c4b01);}})[_0x388b('0x3a')](handleError(_0x69d385,null));};exports[_0x388b('0x93')]=function(_0x275ffe,_0x188d4a){var _0x4b71aa=path[_0x388b('0x91')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x58552b={'where':{'id':_0x275ffe[_0x388b('0x6b')]['id']},'attributes':['id',_0x388b('0x94')],'raw':!![]};return db[_0x388b('0x56')]['find'](_0x58552b)[_0x388b('0x19')](handleEntityNotFound(_0x188d4a,null))['then'](function(_0x28d75e){if(_0x28d75e){if(!_['isNil'](_0x28d75e[_0x388b('0x94')])){if(fs['existsSync'](path[_0x388b('0x91')](config[_0x388b('0x8d')],'server/files/images/avatars/',_0x28d75e['agentAvatar']))){_0x4b71aa=path['join'](config['root'],_0x388b('0x95'),_0x28d75e[_0x388b('0x94')]);}}return _0x188d4a['download'](_0x4b71aa);}})['catch'](handleError(_0x188d4a,null));};exports[_0x388b('0x96')]=function(_0x54226f,_0x305b48){var _0x417ceb=path[_0x388b('0x91')](config[_0x388b('0x8d')],_0x388b('0x97'));var _0x4bb03b={'where':{'id':_0x54226f[_0x388b('0x6b')]['id']},'attributes':['id',_0x388b('0x88'),_0x388b('0x98')],'raw':!![]};return db[_0x388b('0x56')]['find'](_0x4bb03b)[_0x388b('0x19')](handleEntityNotFound(_0x305b48,null))['then'](function(_0x48d597){if(_0x48d597){if(!_[_0x388b('0x99')](_0x48d597[_0x388b('0x88')])){if(fs[_0x388b('0x9a')](path[_0x388b('0x91')](config[_0x388b('0x8d')],'server/files/images/avatars/',_0x48d597[_0x388b('0x88')]))&&_0x48d597[_0x388b('0x98')]){_0x417ceb=path[_0x388b('0x91')](config[_0x388b('0x8d')],_0x388b('0x95'),_0x48d597[_0x388b('0x88')]);}}return _0x305b48[_0x388b('0x92')](_0x417ceb);}})[_0x388b('0x3a')](handleError(_0x305b48,null));};exports['getSystemAvatar']=function(_0x29d1bc,_0x261038){var _0xac028c=path[_0x388b('0x91')](config['root'],_0x388b('0x9b'));var _0x40ac6f={'where':{'id':_0x29d1bc[_0x388b('0x6b')]['id']},'attributes':['id',_0x388b('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x388b('0x73')](_0x40ac6f)[_0x388b('0x19')](handleEntityNotFound(_0x261038,null))['then'](function(_0x2aaf95){if(_0x2aaf95){if(!_[_0x388b('0x99')](_0x2aaf95[_0x388b('0x8b')])){if(fs[_0x388b('0x9a')](path[_0x388b('0x91')](config['root'],_0x388b('0x95'),_0x2aaf95['systemAvatar']))){_0xac028c=path['join'](config['root'],'server/files/images/avatars/',_0x2aaf95[_0x388b('0x8b')]);}}return _0x261038[_0x388b('0x92')](_0xac028c);}})['catch'](handleError(_0x261038,null));};exports[_0x388b('0x9c')]=function(_0x459184,_0x22d3e6){var _0xbffb73={'body':_0x459184[_0x388b('0x6e')],'channel':_0x388b('0x9d')};var _0x32d7c4=[];var _0x178439=[];var _0x3a65d7={};var _0x596b4a=![];return db[_0x388b('0x9e')][_0x388b('0x76')]()[_0x388b('0x19')](function(_0x5480fb){if(!_0x5480fb){throw new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))]('no\x20available\x20attributes');}_0x32d7c4=_[_0x388b('0xa1')](_[_0x388b('0x58')](_0x5480fb),[_0x388b('0xa2'),'updatedAt']);_0x178439=_[_0x388b('0xa1')](_[_0x388b('0x58')](_0x5480fb),[_0x388b('0xa2'),_0x388b('0xa3'),'CompanyId','ListId']);if(_0x459184['body']['id']){delete _0x459184[_0x388b('0x6e')]['id'];}if(_[_0x388b('0x99')](_0x459184['body']['from'])){throw new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))](_0x388b('0xa4'));}if(_[_0x388b('0x99')](_0x459184[_0x388b('0x6e')][_0x388b('0x6e')])||_0x459184[_0x388b('0x6e')][_0x388b('0x6e')]===''){throw new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))](_0x388b('0xa5'));}if(_[_0x388b('0x99')](_0x459184[_0x388b('0x6e')][_0x388b('0xa6')])){throw new db['Sequelize'][(_0x388b('0xa0'))](_0x388b('0xa7')+_0x178439);}if(!_[_0x388b('0xa8')](_0x178439,_0x459184['body'][_0x388b('0xa6')])){throw new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))](_0x388b('0xa9')+_0x178439);}_0x3a65d7[_0x459184[_0x388b('0x6e')][_0x388b('0xa6')]]=_0x459184[_0x388b('0x6e')][_0x388b('0xaa')];})[_0x388b('0x19')](function(){return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0x459184['params']['id']},'include':[{'model':db[_0x388b('0xab')],'as':_0x388b('0xac'),'include':[{'model':db[_0x388b('0x9e')],'as':_0x388b('0xad'),'where':_0x3a65d7,'limit':0x1,'order':[[_0x388b('0xa3'),'DESC']]}]},{'model':db[_0x388b('0xae')],'as':_0x388b('0xaf')},{'model':db[_0x388b('0xb0')],'as':_0x388b('0xb0'),'include':[{'model':db[_0x388b('0xb0')],'as':_0x388b('0xb1'),'attributes':['id',_0x388b('0x36')],'raw':!![]}]}]});})['then'](function(_0x38fc8d){if(!_0x38fc8d)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x459184[_0x388b('0x6b')]['id']));if(!_0x38fc8d[_0x388b('0xb0')]||!_0x38fc8d[_0x388b('0xb0')][_0x388b('0xb1')])return[_0x38fc8d,!![]];return[_0x38fc8d,checkWebsiteIntervals(_0x38fc8d)];})['spread'](function(_0x4d0cc8,_0x22b2d6){if(!_0x22b2d6)throw new APIOutOfIntervalError();if(!_0x4d0cc8[_0x388b('0xac')])return;_0xbffb73[_0x388b('0xb2')]=_0x4d0cc8;_0xbffb73['list']=_0x4d0cc8['List'];_0xbffb73[_0x388b('0xb3')]=_[_0x388b('0xb4')](_0x4d0cc8[_0x388b('0xaf')],[_0x388b('0xb5')],[_0x388b('0xb6')]);if(_0xbffb73[_0x388b('0xb2')][_0x388b('0xaf')]){delete _0xbffb73[_0x388b('0xb2')][_0x388b('0xaf')];}if(_0xbffb73[_0x388b('0xb2')]['List']&&_0xbffb73[_0x388b('0xb2')]['List']['Contacts'][_0x388b('0x5e')]){return _0xbffb73[_0x388b('0xb2')][_0x388b('0xac')]['Contacts'][0x0];}var _0x5f4bbf=_[_0x388b('0x12')](_0x459184[_0x388b('0x6e')],{'firstName':_0x459184[_0x388b('0x6e')]['from'],'ListId':_0x4d0cc8[_0x388b('0xb7')]});_0x5f4bbf[_0x459184[_0x388b('0x6e')]['mapKey']]=_0x459184[_0x388b('0x6e')][_0x388b('0xaa')];return db[_0x388b('0x9e')][_0x388b('0x6d')](_0x5f4bbf,{'fields':_0x32d7c4,'raw':!![]});})[_0x388b('0x19')](function(_0x5c32c4){_0xbffb73[_0x388b('0xb8')]=_0x5c32c4;var _0x1ac952=createInteractionObject(_0x459184[_0x388b('0x6b')]['id'],_0x459184['body'],_0x459184[_0x388b('0xb9')],_0x5c32c4);var _0x330a30={'ChatWebsiteId':_0x459184[_0x388b('0x6b')]['id'],'closed':![]};if(_0x459184[_0x388b('0x6e')][_0x388b('0xba')]){_0x330a30[_0x388b('0xba')]=_0x459184[_0x388b('0x6e')][_0x388b('0xba')];return db[_0x388b('0xbb')][_0x388b('0x73')]({'where':_0x330a30})[_0x388b('0x19')](function(_0x14d0c1){if(_0x14d0c1){_0x596b4a=!![];return _0x14d0c1;}_0x1ac952[_0x388b('0xba')]=_0x459184[_0x388b('0x6e')]['threadId'];_0x1ac952[_0x388b('0xbc')]=_0x459184['body'][_0x388b('0xbc')];return db[_0x388b('0xbb')][_0x388b('0x6d')](_0x1ac952);});}_0x330a30[_0x388b('0xbd')]=_0x5c32c4['id'];if(_0x459184[_0x388b('0x6e')][_0x388b('0xbe')]&&_0x459184['body'][_0x388b('0xbe')]['id']){_0x330a30['id']=_0x459184[_0x388b('0x6e')][_0x388b('0xbe')]['id'];return db[_0x388b('0xbb')]['find']({'where':_0x330a30})['then'](function(_0x35454b){if(_0x35454b){_0x596b4a=!![];return _0x35454b;}return db[_0x388b('0xbb')][_0x388b('0x6d')](_0x1ac952);});}return db['ChatInteraction'][_0x388b('0x6d')](_0x1ac952);})['then'](function(_0x441c27){if(!_0x596b4a)return _0x441c27;var _0x46ec2b={'from':(_0xbffb73[_0x388b('0xb8')][_0x388b('0x46')]||'')+'\x20'+(_0xbffb73[_0x388b('0xb8')][_0x388b('0xbf')]||'')};if(_0x459184[_0x388b('0x6e')][_0x388b('0xba')]&&_0x459184[_0x388b('0x6e')][_0x388b('0xc0')]&&_0x459184[_0x388b('0x6e')][_0x388b('0xba')]!=_0x459184['body']['messageId']){_0x46ec2b[_0x388b('0xba')]=_0x459184[_0x388b('0x6e')][_0x388b('0xc0')];}return _0x441c27[_0x388b('0x2d')](_0x46ec2b);})[_0x388b('0x19')](function(_0x4a8a73){_0xbffb73[_0x388b('0xbe')]=_0x4a8a73[_0x388b('0x3d')]({'plain':!![]});_0xbffb73['interaction'][_0x388b('0xc1')]=!_0x596b4a;if(_0xbffb73[_0x388b('0xbe')][_0x388b('0xc1')]){if(_0xbffb73['account']['autoclose']){_0xbffb73[_0x388b('0xb3')]['push']({'id':0x0,'priority':_0xbffb73['applications'][_0x388b('0x5e')]+0x1,'app':_0x388b('0xc2'),'appdata':_0x388b('0xc3'),'interval':_0x388b('0xc4')});}}return db[_0x388b('0xc5')][_0x388b('0x6d')]({'body':_0x459184['body'][_0x388b('0x6e')],'ChatWebsiteId':_0x459184[_0x388b('0x6b')]['id'],'ChatInteractionId':_0x4a8a73['id'],'direction':'in','ContactId':_0xbffb73[_0x388b('0xb8')]['id'],'AttachmentId':_0x459184[_0x388b('0x6e')][_0x388b('0xc6')]});})['then'](function(_0x73c13b){_0xbffb73[_0x388b('0x21')]=_0x73c13b;if(!_0xbffb73[_0x388b('0xbe')][_0x388b('0xc7')]){return;}return db['User'][_0x388b('0x73')]({'attributes':['id',_0x388b('0x30')],'where':{'id':_0xbffb73[_0x388b('0xbe')][_0x388b('0xc7')]}});})[_0x388b('0x19')](function(_0x4c70e4){if(_0x4c70e4){_0xbffb73['applications'][_0x388b('0xc8')]({'id':0x0,'priority':0x0,'app':_0x388b('0xc9'),'appdata':_0x4c70e4['name']+','+(_0xbffb73['account'][_0x388b('0xca')]||0xa),'interval':_0x388b('0xc4')});_0xbffb73[_0x388b('0xcb')]=!![];}if(!_0xbffb73['interaction'][_0x388b('0xcc')]){return;}return db[_0x388b('0xcd')][_0x388b('0x73')]({'attributes':['id',_0x388b('0x30')],'where':{'id':_0xbffb73[_0x388b('0xbe')][_0x388b('0xcc')]}});})['then'](function(_0xf04731){if(_0xf04731){_0xbffb73['applications'][_0x388b('0xc8')]({'id':0x0,'priority':0x1,'app':_0x388b('0xce'),'appdata':_0xf04731[_0x388b('0x30')]+','+(_0xbffb73[_0x388b('0xb2')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x388b('0xcf'),_0xbffb73);})[_0x388b('0x19')](function(_0x32ecd1){respondWithRpcPromise('EventManager',_0x388b('0xd0'),{'event':_0x388b('0x9c'),'message':_0x32ecd1},client9002);return _0x32ecd1;})[_0x388b('0x19')](respondWithResult(_0x22d3e6,null))[_0x388b('0x3a')](APIHandleError(_0x22d3e6));};exports[_0x388b('0xd1')]=function(_0xe0da4e,_0x12b5b5){var _0x44260d,_0x30ceed,_0xdc7027;var _0x5cc823=[];var _0x45150f={};var _0x402c16=_0xe0da4e[_0x388b('0xd2')]||[];var _0xe485ee=[];var _0x2cd440;return db[_0x388b('0x9e')]['describe']()[_0x388b('0x19')](function(_0x1b087d){if(!_0x1b087d){throw new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))](_0x388b('0xd3'));}_0x5cc823=_[_0x388b('0xa1')](_[_0x388b('0x58')](_0x1b087d),['createdAt',_0x388b('0xa3'),'CompanyId',_0x388b('0xb7')]);if(_0xe0da4e[_0x388b('0x6e')]['id']){delete _0xe0da4e[_0x388b('0x6e')]['id'];}if(_[_0x388b('0x99')](_0xe0da4e[_0x388b('0x6e')][_0x388b('0xaa')])){throw _0x12b5b5[_0x388b('0x26')](0x1f4)[_0x388b('0x31')](new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))](_0x388b('0xa4')));}if(_[_0x388b('0x99')](_0xe0da4e[_0x388b('0x6e')][_0x388b('0x6e')])||_0xe0da4e[_0x388b('0x6e')][_0x388b('0x6e')]===''){throw _0x12b5b5[_0x388b('0x26')](0x1f4)[_0x388b('0x31')](new db[(_0x388b('0x9f'))]['ValidationError'](_0x388b('0xa5')));}if(_[_0x388b('0x99')](_0xe0da4e[_0x388b('0x6e')][_0x388b('0xd4')])){throw _0x12b5b5[_0x388b('0x26')](0x1f4)[_0x388b('0x31')](new db[(_0x388b('0x9f'))][(_0x388b('0xa0'))](_0x388b('0xd5')+_0x5cc823));}if(!_[_0x388b('0xa8')](_0x5cc823,_0xe0da4e[_0x388b('0x6e')][_0x388b('0xd4')])){throw _0x12b5b5['status'](0x1f4)[_0x388b('0x31')](new db[(_0x388b('0x9f'))]['ValidationError'](_0x388b('0xd6')+_0x5cc823));}_0x45150f[_0xe0da4e['body'][_0x388b('0xd4')]]=_0xe0da4e[_0x388b('0x6e')]['from'];})['then'](function(){return db[_0x388b('0x56')][_0x388b('0x73')]({'where':{'id':_0xe0da4e[_0x388b('0x6b')]['id']},'include':[{'model':db['CmList'],'as':_0x388b('0xac')},{'model':db['MailAccount'],'as':_0x388b('0xd7')}]});})[_0x388b('0x19')](handleEntityNotFound(_0x12b5b5,null))['then'](function(_0x5d4866){if(_0x5d4866&&_0x5d4866[_0x388b('0xac')]){_0x30ceed=_0x5d4866;var _0x3bb1ad=_[_0x388b('0x12')](_0xe0da4e[_0x388b('0x6e')],{'firstName':_0xe0da4e[_0x388b('0x6e')]['from'],'phone':_0xe0da4e['body']['from'],'ListId':_0x5d4866[_0x388b('0xb7')]});_0x3bb1ad[_0xe0da4e[_0x388b('0x6e')]['mapKeyOffline']]=_0xe0da4e[_0x388b('0x6e')][_0x388b('0xaa')];return db['CmContact'][_0x388b('0xd8')]({'where':_0x45150f,'defaults':_0x3bb1ad});}})[_0x388b('0xd9')](function(_0xb94cb9){if(_0xb94cb9){_0xdc7027=_0xb94cb9;var _0x4a29c5=fs[_0x388b('0xda')](path[_0x388b('0x91')](config[_0x388b('0x8d')],_0x388b('0xdb')),_0x388b('0xdc'));var _0x2498ae=ejs[_0x388b('0xdd')](_0x4a29c5,{'body':_[_0x388b('0xde')](_0xe0da4e['body'][_0x388b('0x6e')]),'bodyTitle':_0x30ceed[_0x388b('0xdf')]});return db[_0x388b('0xe0')][_0x388b('0x6d')]({'body':_0x2498ae,'plainBody':htmlToText['fromString'](_0x2498ae),'ContactId':_0xb94cb9['id'],'ChatWebsiteId':_0x30ceed['id']});}})[_0x388b('0x19')](function(_0x1f6d63){_0x2cd440=_0x1f6d63;if(_0x402c16['length']){var _0x3cc5e7=_0x402c16['map'](function(_0x5a856b){return{'name':_0x5a856b['originalname'],'basename':_0x5a856b[_0x388b('0x89')],'type':_0x5a856b[_0x388b('0xe1')],'ChatOfflineMessageId':_0x1f6d63['id']};});_0xe485ee=_0x3cc5e7[_0x388b('0x3c')](_0x58f2ed=>{var _0x1bd2b0={'filename':_0x58f2ed[_0x388b('0x30')],'path':path['join'](config[_0x388b('0x8d')],_0x388b('0xe2'),_0x388b('0xd2'),_0x388b('0xe3'),_0x388b('0xe4'),_0x58f2ed['basename'])};return _0x1bd2b0;});if(!_0x30ceed[_0x388b('0xe5')]){return db['sequelize'][_0x388b('0xe6')](function(_0x31d93b){return db[_0x388b('0xe7')][_0x388b('0xe8')](_0x3cc5e7,{'transaction':_0x31d93b});});}}})['then'](function(){if(_0x2cd440){_0x44260d=_0x2cd440;return db[_0x388b('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x388b('0xe9')],'as':_0x388b('0xea'),'raw':!![],'include':[{'model':db[_0x388b('0xeb')],'as':_0x388b('0xeb'),'raw':!![]}]}]});}})[_0x388b('0x19')](function(_0x2035a7){if(_0x2035a7&&_0x2035a7[_0x388b('0xea')]&&_0x30ceed[_0x388b('0xec')]&&_0x30ceed['forwardOfflineAddress']){var _0x50f465=_0x2035a7[_0x388b('0xed')]();return respondWithRpcPromise(_0x388b('0xee'),_0x388b('0xef'),{'account':_0x50f465,'message':{'from':util[_0x388b('0x4d')]('\x22%s\x22\x20<%s>',_0x2035a7[_0x388b('0x30')],_0x2035a7[_0x388b('0xf0')]||_0x2035a7[_0x388b('0xea')][_0x388b('0x6f')]),'to':_0x30ceed[_0x388b('0xf1')],'subject':_0x30ceed[_0x388b('0xf2')],'html':_0x44260d[_0x388b('0x6e')],'attachments':_0xe485ee}},client9003)[_0x388b('0x19')](function(){return _0x44260d;})[_0x388b('0x3a')](function(_0x25d497){logger[_0x388b('0x1f')](_0x25d497);});}})[_0x388b('0x19')](function(){if(_0x30ceed&&_0x30ceed[_0x388b('0xe5')]&&_0x30ceed['MailAccountId']){var _0x2d10fc=[];if(_0x402c16[_0x388b('0x5e')]){_0x2d10fc=_0x402c16[_0x388b('0x3c')](function(_0x2ce104){return{'name':_0x2ce104[_0x388b('0xf3')],'basename':_0x2ce104[_0x388b('0x89')],'type':_0x2ce104[_0x388b('0xe1')],'ChatOfflineMessageId':_0x2cd440['id']};});}var _0xcf242a;if(!_[_0x388b('0x99')](_0x30ceed['subjectOffline'])){var _0x50ecb4=_['map'](_0xe0da4e['body'],function(_0x559c30){return _0x559c30;});var _0x1d966f=_[_0x388b('0xf4')](_0x50ecb4)[0x0];var _0x3b34df=_[_0x388b('0xf5')](_0x1d966f,function(_0x5ac974){return _0x5ac974;});_0xcf242a=_0x3b34df[0x1][_0x30ceed[_0x388b('0xf6')]];}var _0x567532={'from':_0xdc7027[_0x388b('0xf0')],'firstName':_0xdc7027[_0x388b('0x46')],'lastName':_0xdc7027[_0x388b('0xbf')],'mapKey':'email','message':{'from':_0xdc7027[_0x388b('0xf0')],'to':_0x30ceed['MailAccount']['email'],'cc':'','subject':_[_0x388b('0x99')](_0xcf242a)?_0x30ceed[_0x388b('0xf2')]:_0xcf242a,'messageId':'','sentAt':new Date(),'attach':_0x2d10fc[_0x388b('0x5e')],'attachments':_0x2d10fc,'originChannel':'Chat','ChatWebsiteId':_0x30ceed['id'],'ChatOfflineMessageId':_0x44260d['id'],'originTo':_0x30ceed['MailAccount'][_0x388b('0xf0')]},'body':_0x44260d[_0x388b('0x6e')]};var _0x44fdab={'account':{'id':_0x30ceed[_0x388b('0xf7')]},'body':_0x567532,'log':_0x388b('0xf8')};return respondWithRpcPromise(_0x388b('0xf8'),_0x388b('0xf9'),_0x44fdab,client9001)[_0x388b('0x19')](function(){return _0x44260d;})[_0x388b('0x3a')](function(_0x3b3f8a){logger[_0x388b('0x1f')](_0x3b3f8a);});}return;})['then'](function(){if(_0x44260d){return _0x44260d;}})[_0x388b('0x19')](respondWithResult(_0x12b5b5,null))['catch'](function(){for(var _0x389e5c of _0x402c16){var _0x370b99=path[_0x388b('0x91')](config[_0x388b('0x8d')],_0x388b('0xe2'),_0x388b('0xd2'),_0x388b('0xe3'),'offline-chat',_0x389e5c[_0x388b('0x89')]);fs_extra[_0x388b('0xfa')](_0x370b99)[_0x388b('0x3a')](function(_0x4c74f7){logger[_0x388b('0x1f')](_0x388b('0xfb'),_0x370b99,_0x4c74f7);});}});};exports[_0x388b('0xfc')]=function(_0x1064f8,_0x2e070a){return db[_0x388b('0xbb')][_0x388b('0x73')]({'where':{'id':_0x1064f8[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x2e070a,null))[_0x388b('0x19')](function(_0x29039b){if(_0x29039b){return _0x29039b[_0x388b('0xfc')](_0x1064f8['body'][_0x388b('0x82')],_[_0x388b('0xfd')](_0x1064f8[_0x388b('0x6e')],[_0x388b('0x82'),'id'])||{});}})['then'](respondWithResult(_0x2e070a,null))['catch'](handleError(_0x2e070a,null));};exports[_0x388b('0xfe')]=function(_0x32f176,_0x257114){var _0x13bcf2={'raw':![],'where':{}};var _0x46aaf4={};var _0x9b3879={'count':0x0,'rows':[]};return db[_0x388b('0x56')][_0x388b('0x7b')]({'where':{'id':_0x32f176[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x257114,null))[_0x388b('0x19')](function(_0x4e7c9d){if(_0x4e7c9d){_0x46aaf4[_0x388b('0x4f')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x46aaf4['query']=_[_0x388b('0x58')](_0x32f176[_0x388b('0x59')]);_0x46aaf4['filters']=_[_0x388b('0x5b')](_0x46aaf4['model'],_0x46aaf4[_0x388b('0x59')]);_0x13bcf2['attributes']=_[_0x388b('0x5b')](_0x46aaf4['model'],qs[_0x388b('0x5d')](_0x32f176[_0x388b('0x59')]['fields']));_0x13bcf2[_0x388b('0x5c')]=_0x13bcf2[_0x388b('0x5c')]['length']?_0x13bcf2['attributes']:_0x46aaf4[_0x388b('0x4f')];if(!_0x32f176['query'][_0x388b('0x7c')](_0x388b('0x5f'))){_0x13bcf2[_0x388b('0x28')]=qs[_0x388b('0x28')](_0x32f176['query'][_0x388b('0x28')]);_0x13bcf2['offset']=qs[_0x388b('0x27')](_0x32f176[_0x388b('0x59')][_0x388b('0x27')]);}_0x13bcf2[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x32f176[_0x388b('0x59')][_0x388b('0x61')]);_0x13bcf2[_0x388b('0x62')]=qs[_0x388b('0x5a')](_[_0x388b('0x7d')](_0x32f176['query'],_0x46aaf4[_0x388b('0x5a')]));_0x13bcf2[_0x388b('0x62')][_0x388b('0x78')]=_0x4e7c9d['id'];if(_0x32f176[_0x388b('0x59')]['filter']){_0x13bcf2[_0x388b('0x62')]=_[_0x388b('0x65')](_0x13bcf2[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x13bcf2['attributes'],function(_0x4035d9){var _0x27b320={};_0x27b320[_0x4035d9]={'$like':'%'+_0x32f176[_0x388b('0x59')][_0x388b('0x63')]+'%'};return _0x27b320;})});}_0x13bcf2=_[_0x388b('0x65')]({},_0x13bcf2,_0x32f176['options']);return db[_0x388b('0xbb')][_0x388b('0x2a')]({'where':_0x13bcf2[_0x388b('0x62')]})['then'](function(_0x24ec04){_0x9b3879[_0x388b('0x2a')]=_0x24ec04;if(_0x32f176[_0x388b('0x59')][_0x388b('0x67')]){_0x13bcf2[_0x388b('0x68')]=[{'model':db['CmContact'],'as':_0x388b('0xff'),'required':![]},{'model':db[_0x388b('0x100')],'as':_0x388b('0x101'),'attributes':[_0x388b('0x30'),'fullname','internal'],'required':![]},{'model':db[_0x388b('0x102')],'as':_0x388b('0x103'),'attributes':['id',_0x388b('0x30'),_0x388b('0x104')],'where':_0x32f176[_0x388b('0x59')][_0x388b('0x105')]?{'id':_0x32f176[_0x388b('0x59')]['tag']}:undefined,'required':_0x32f176[_0x388b('0x59')][_0x388b('0x105')]?!![]:![]}];}return db[_0x388b('0xbb')][_0x388b('0x106')](_0x13bcf2);})['then'](function(_0x58151c){_0x9b3879[_0x388b('0x69')]=_0x58151c;return _0x9b3879;});}})[_0x388b('0x19')](respondWithFilteredResult(_0x257114,_0x13bcf2))['catch'](handleError(_0x257114,null));};exports[_0x388b('0x33')]=function(_0x1ccd61,_0x5dc0bc){var _0x3a96f5=0x0;var _0x553d6b=0x0;var _0x2b8ec9=![];var _0x363266;var _0x44a7fc;return db['ChatWebsite'][_0x388b('0x73')]({'where':{'id':_0x1ccd61['params']['id']},'include':[{'model':db[_0x388b('0xb0')],'as':'Interval','include':[{'model':db[_0x388b('0xb0')],'as':_0x388b('0xb1'),'attributes':['id',_0x388b('0x36')]}]}]})[_0x388b('0x19')](handleEntityNotFound(_0x5dc0bc,null))[_0x388b('0x19')](function(_0x3df634){if(_0x3df634){_0x363266=_0x3df634;return _0x3df634[_0x388b('0x107')]({'raw':!![]});}})[_0x388b('0x19')](function(_0x158b27){if(_0x363266){if(_0x158b27){_0x44a7fc=_0x158b27;}}return require(_0x388b('0x108'))[_0x388b('0x8f')]();})[_0x388b('0x19')](function(_0x4534ec){if(_0x4534ec){_0x553d6b=_0x4534ec['virtual'];_0x2b8ec9=_0x4534ec[_0x388b('0x90')];}})[_0x388b('0x19')](function(){return db[_0x388b('0xbb')][_0x388b('0x2a')]({'where':{'closed':![]}});})[_0x388b('0x19')](function(_0x8e8dc2){_0x3a96f5=_0x8e8dc2;if(_0x553d6b&&_0x8e8dc2>_0x553d6b){return db['License'][_0x388b('0x7b')]({'where':{'id':0x1}})[_0x388b('0x19')](function(_0x1569ca){if(_0x1569ca){_0x1569ca['increment'](_0x388b('0x109'));}});}})[_0x388b('0x19')](function(){if(!_0x363266['Interval']||!_0x363266['Interval'][_0x388b('0xb1')])return!![];return checkWebsiteIntervals(_0x363266);})[_0x388b('0x19')](function(_0x97cd3d){var _0x4955a7=fs[_0x388b('0xda')](path['join'](config[_0x388b('0x8d')],'server/files/chat/iframe.ejs'),'utf8');var _0x5ec9b4=new url[(_0x388b('0x10a'))](_0x363266['address'])['origin'];var _0x13a852=_0x388b('0x10b');var _0x2af9f3=![];var _0x42e41e={'chatVersion':_0x13a852,'chatWebsiteAddressOrigin':_0x5ec9b4,'remote':_0x363266[_0x388b('0x10c')],'query':querystring[_0x388b('0x1e')](_[_0x388b('0x65')](_0x363266[_0x388b('0x3d')]({'plain':!![]}),{'customerIp':_0x1ccd61['headers']['x-forwarded-for']||_0x1ccd61[_0x388b('0xb9')]['x-real-ip']||_0x1ccd61[_0x388b('0x10d')][_0x388b('0x10e')]||_0x1ccd61['ip'],'referer':_0x1ccd61[_0x388b('0xb9')][_0x388b('0x48')],'openedInteractions':_0x3a96f5,'maxInteractions':_0x553d6b,'virtual':_0x2b8ec9[_0x388b('0x10f')],'online':_0x97cd3d,'custom':_0x2b8ec9}))[_0x388b('0x110')](/'/g,'\x5c\x27')};_0x5dc0bc['send'](ejs['render'](Mustache['render'](_0x4955a7,_0x42e41e),{'proactiveActions':_0x44a7fc,'alignment':_0x363266[_0x388b('0x111')],'verticalAlignment':_0x363266[_0x388b('0x112')],'div_color':_0x363266['color'],'labelText':_0x363266['labelText'],'text_color':_0x363266['textColor'],'text_button_color':_0x363266[_0x388b('0x113')],'button_color':_0x363266['color_button'],'background_color':_0x363266['backgroundColor'],'hideWhenOffline':_0x363266[_0x388b('0x114')],'intervalId':_0x363266['IntervalId'],'isDevelopment':_0x2af9f3,'chatVersion':_0x13a852}));})[_0x388b('0x3a')](handleError(_0x5dc0bc,null));};exports['addApplications']=function(_0x77713c,_0x124b1c){var _0x3a4c17=_0x77713c[_0x388b('0x6b')]['id'];var _0x40bea8=_0x77713c[_0x388b('0x6e')];var _0x50bc31=0xc8;var _0xfacb86=null;return db[_0x388b('0x115')][_0x388b('0xe6')]({'isolationLevel':db[_0x388b('0x115')][_0x388b('0x116')][_0x388b('0x117')][_0x388b('0x118')]},function(_0x2f8733){return db[_0x388b('0x56')]['findOne']({'where':{'id':_0x3a4c17},'transaction':_0x2f8733})[_0x388b('0x19')](function(_0x299e01){if(_0x299e01){return db[_0x388b('0xae')][_0x388b('0x2e')]({'where':{'ChatWebsiteId':_0x3a4c17},'transaction':_0x2f8733})['then'](function(){var _0x73f86c=_[_0x388b('0x3c')](_0x40bea8,function(_0x58d159){_0x58d159[_0x388b('0x78')]=_0x3a4c17;return _0x58d159;});return db[_0x388b('0xae')][_0x388b('0xe8')](_0x73f86c,{'transaction':_0x2f8733});});}else{_0x50bc31=0x194;_0xfacb86=[];}});})[_0x388b('0x19')](function(){if(_0x50bc31!==0x194){return db[_0x388b('0xae')][_0x388b('0x119')]({'where':{'ChatWebsiteId':_0x3a4c17},'order':_0x388b('0xb5')})['then'](function(_0x2f58e9){_0xfacb86=_0x2f58e9;});}})['catch'](function(_0x45a287){_0x50bc31=0x1f4;logger[_0x388b('0x1f')](_0x45a287['stack']);if(_0x45a287[_0x388b('0x30')]){delete _0x45a287[_0x388b('0x30')];}_0xfacb86=_0x45a287;})[_0x388b('0x11a')](function(){if(_0xfacb86===null){_0x124b1c['sendStatus'](_0x50bc31);}else{if(_0x50bc31===0x1f4){_0x124b1c['status'](_0x50bc31)[_0x388b('0x31')](_0xfacb86);}else{_0x124b1c[_0x388b('0x26')](_0x50bc31)[_0x388b('0x11b')](_0xfacb86);}}});};exports[_0x388b('0x11c')]=function(_0x4fa514,_0x465321){var _0xc6a29={};var _0x833f89={};var _0x31c7cd;var _0x1f4269;return db[_0x388b('0x56')]['findOne']({'where':{'id':_0x4fa514['params']['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x465321,null))[_0x388b('0x19')](function(_0x1abbea){if(_0x1abbea){_0x31c7cd=_0x1abbea;_0x833f89[_0x388b('0x4f')]=_[_0x388b('0x58')](db[_0x388b('0xae')]['rawAttributes']);_0x833f89[_0x388b('0x59')]=_[_0x388b('0x58')](_0x4fa514[_0x388b('0x59')]);_0x833f89['filters']=_['intersection'](_0x833f89[_0x388b('0x4f')],_0x833f89[_0x388b('0x59')]);_0xc6a29[_0x388b('0x5c')]=_[_0x388b('0x5b')](_0x833f89['model'],qs[_0x388b('0x5d')](_0x4fa514[_0x388b('0x59')][_0x388b('0x5d')]));_0xc6a29[_0x388b('0x5c')]=_0xc6a29['attributes'][_0x388b('0x5e')]?_0xc6a29[_0x388b('0x5c')]:_0x833f89['model'];_0xc6a29[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x4fa514['query'][_0x388b('0x61')]);_0xc6a29[_0x388b('0x62')]=qs[_0x388b('0x5a')](_[_0x388b('0x7d')](_0x4fa514[_0x388b('0x59')],_0x833f89['filters']));if(_0x4fa514[_0x388b('0x59')][_0x388b('0x63')]){_0xc6a29[_0x388b('0x62')]=_[_0x388b('0x65')](_0xc6a29[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0xc6a29['attributes'],function(_0x531287){var _0xd4cd63={};_0xd4cd63[_0x531287]={'$like':'%'+_0x4fa514[_0x388b('0x59')]['filter']+'%'};return _0xd4cd63;})});}_0xc6a29=_[_0x388b('0x65')]({},_0xc6a29,_0x4fa514['options']);return _0x31c7cd[_0x388b('0x11c')](_0xc6a29);}})['then'](function(_0x536d0a){if(_0x536d0a){_0x1f4269=_0x536d0a['length'];if(!_0x4fa514[_0x388b('0x59')][_0x388b('0x7c')](_0x388b('0x5f'))){_0xc6a29[_0x388b('0x28')]=qs[_0x388b('0x28')](_0x4fa514['query']['limit']);_0xc6a29[_0x388b('0x27')]=qs['offset'](_0x4fa514[_0x388b('0x59')][_0x388b('0x27')]);}return _0x31c7cd[_0x388b('0x11c')](_0xc6a29);}})[_0x388b('0x19')](function(_0x3f6e08){if(_0x3f6e08){return _0x3f6e08?{'count':_0x1f4269,'rows':_0x3f6e08}:null;}})['then'](respondWithResult(_0x465321,null))[_0x388b('0x3a')](handleError(_0x465321,null));};exports['addProactiveActions']=function(_0x400049,_0x5d1ac2){return db[_0x388b('0x11d')][_0x388b('0x73')]({'where':{'id':_0x400049[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x5d1ac2,null))[_0x388b('0x19')](function(_0x46d778){if(_0x46d778){return _0x46d778[_0x388b('0x11e')](_0x400049[_0x388b('0x6e')][_0x388b('0x82')],_[_0x388b('0xfd')](_0x400049[_0x388b('0x6e')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d1ac2,null))[_0x388b('0x3a')](handleError(_0x5d1ac2,null));};exports[_0x388b('0x107')]=function(_0x28193b,_0x12da2e){var _0x48b713={};var _0x20a763={};var _0x5bdaff;var _0x4bd332;return db[_0x388b('0x56')][_0x388b('0x7b')]({'where':{'id':_0x28193b['params']['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x12da2e,null))[_0x388b('0x19')](function(_0x1acea7){if(_0x1acea7){_0x5bdaff=_0x1acea7;_0x20a763[_0x388b('0x4f')]=_[_0x388b('0x58')](db[_0x388b('0x11f')][_0x388b('0x6c')]);_0x20a763[_0x388b('0x59')]=_['keys'](_0x28193b[_0x388b('0x59')]);_0x20a763[_0x388b('0x5a')]=_[_0x388b('0x5b')](_0x20a763[_0x388b('0x4f')],_0x20a763[_0x388b('0x59')]);_0x48b713['attributes']=_['intersection'](_0x20a763[_0x388b('0x4f')],qs[_0x388b('0x5d')](_0x28193b[_0x388b('0x59')]['fields']));_0x48b713[_0x388b('0x5c')]=_0x48b713[_0x388b('0x5c')][_0x388b('0x5e')]?_0x48b713[_0x388b('0x5c')]:_0x20a763[_0x388b('0x4f')];_0x48b713[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x28193b[_0x388b('0x59')]['sort']);_0x48b713[_0x388b('0x62')]=qs['filters'](_[_0x388b('0x7d')](_0x28193b[_0x388b('0x59')],_0x20a763[_0x388b('0x5a')]));if(_0x28193b['query'][_0x388b('0x63')]){_0x48b713[_0x388b('0x62')]=_[_0x388b('0x65')](_0x48b713[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x48b713['attributes'],function(_0xe164d7){var _0x226344={};_0x226344[_0xe164d7]={'$like':'%'+_0x28193b[_0x388b('0x59')][_0x388b('0x63')]+'%'};return _0x226344;})});}_0x48b713=_[_0x388b('0x65')]({},_0x48b713,_0x28193b['options']);return _0x5bdaff['getProactiveActions'](_0x48b713);}})[_0x388b('0x19')](function(_0x186550){if(_0x186550){_0x4bd332=_0x186550[_0x388b('0x5e')];if(!_0x28193b[_0x388b('0x59')][_0x388b('0x7c')]('nolimit')){_0x48b713['limit']=qs[_0x388b('0x28')](_0x28193b['query'][_0x388b('0x28')]);_0x48b713['offset']=qs[_0x388b('0x27')](_0x28193b[_0x388b('0x59')][_0x388b('0x27')]);}return _0x5bdaff['getProactiveActions'](_0x48b713);}})[_0x388b('0x19')](function(_0x27a1bb){if(_0x27a1bb){return _0x27a1bb?{'count':_0x4bd332,'rows':_0x27a1bb}:null;}})[_0x388b('0x19')](respondWithResult(_0x12da2e,null))[_0x388b('0x3a')](handleError(_0x12da2e,null));};exports[_0x388b('0x120')]=function(_0x4ac00d,_0x2604d5){var _0x30cd98=_0x4ac00d[_0x388b('0x59')][_0x388b('0x121')]===_0x388b('0x122')?_0x388b('0x123'):_0x388b('0x124');return db[_0x388b('0x56')][_0x388b('0x73')]({'attributes':['id',_0x30cd98],'where':{'id':_0x4ac00d[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x2604d5,null))[_0x388b('0x19')](function(_0x241892){if(_0x241892){var _0xfa97f0=_0x241892[_0x30cd98];var _0x5bd2a9=_0xfa97f0&&_0xfa97f0[_0x388b('0x125')]?_0xfa97f0[_0x388b('0x125')]:[];_0x2604d5['send']({'fromKey':_['isNil'](_0xfa97f0[_0x388b('0x126')])?undefined:_0xfa97f0[_0x388b('0x126')],'count':_0x5bd2a9[_0x388b('0x5e')],'rows':_0x5bd2a9});}})[_0x388b('0x3a')](handleError(_0x2604d5,null));};exports[_0x388b('0x127')]=function(_0x4b9251,_0x336e62){var _0x4796fa={'raw':![],'where':{}};var _0x252891={};var _0x3389cf={'count':0x0,'rows':[]};return db[_0x388b('0x56')][_0x388b('0x7b')]({'where':{'id':_0x4b9251[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x336e62,null))[_0x388b('0x19')](function(_0x13d224){if(_0x13d224){_0x252891['model']=_[_0x388b('0x58')](db['ChatOfflineMessage'][_0x388b('0x6c')]);_0x252891[_0x388b('0x59')]=_[_0x388b('0x58')](_0x4b9251[_0x388b('0x59')]);_0x252891[_0x388b('0x5a')]=_['intersection'](_0x252891[_0x388b('0x4f')],_0x252891[_0x388b('0x59')]);_0x4796fa[_0x388b('0x5c')]=_[_0x388b('0x5b')](_0x252891[_0x388b('0x4f')],qs[_0x388b('0x5d')](_0x4b9251[_0x388b('0x59')]['fields']));_0x4796fa['attributes']=_0x4796fa['attributes'][_0x388b('0x5e')]?_0x4796fa[_0x388b('0x5c')]:_0x252891[_0x388b('0x4f')];if(!_0x4b9251[_0x388b('0x59')][_0x388b('0x7c')](_0x388b('0x5f'))){_0x4796fa[_0x388b('0x28')]=qs[_0x388b('0x28')](_0x4b9251['query']['limit']);_0x4796fa[_0x388b('0x27')]=qs['offset'](_0x4b9251[_0x388b('0x59')]['offset']);}_0x4796fa[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x4b9251[_0x388b('0x59')][_0x388b('0x61')]);_0x4796fa[_0x388b('0x62')]=qs[_0x388b('0x5a')](_[_0x388b('0x7d')](_0x4b9251[_0x388b('0x59')],_0x252891['filters']));_0x4796fa[_0x388b('0x62')][_0x388b('0x78')]=_0x13d224['id'];if(_0x4b9251[_0x388b('0x59')][_0x388b('0x63')]){_0x4796fa[_0x388b('0x62')]=_[_0x388b('0x65')](_0x4796fa[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x4796fa[_0x388b('0x5c')],function(_0x21cd83){var _0x377395={};_0x377395[_0x21cd83]={'$like':'%'+_0x4b9251[_0x388b('0x59')][_0x388b('0x63')]+'%'};return _0x377395;})});}_0x4796fa=_[_0x388b('0x65')]({},_0x4796fa,_0x4b9251[_0x388b('0x66')]);return db['ChatOfflineMessage']['count']({'where':_0x4796fa[_0x388b('0x62')]})[_0x388b('0x19')](function(_0x2b6dc3){_0x3389cf['count']=_0x2b6dc3;if(_0x4b9251[_0x388b('0x59')]['includeAll']){_0x4796fa[_0x388b('0x68')]=[{'all':!![]}];}else{_0x4796fa[_0x388b('0x68')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x388b('0xe7')],'as':'Attachments','required':![]}];}return db[_0x388b('0xe0')][_0x388b('0x106')](_0x4796fa);})[_0x388b('0x19')](function(_0xd1da65){_0x3389cf[_0x388b('0x69')]=_0xd1da65;return _0x3389cf;});}})[_0x388b('0x19')](respondWithFilteredResult(_0x336e62,_0x4796fa))[_0x388b('0x3a')](handleError(_0x336e62,null));};exports[_0x388b('0x128')]=function(_0x6b83f1,_0x5f85ce){return db[_0x388b('0x56')]['find']({'where':{'id':_0x6b83f1[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x5f85ce,null))[_0x388b('0x19')](function(_0x57872a){if(_0x57872a){return _0x57872a[_0x388b('0x128')](_0x6b83f1[_0x388b('0x6e')]['ids'],_[_0x388b('0xfd')](_0x6b83f1['body'],['ids','id'])||{})[_0x388b('0xd9')](function(_0x5a2faa){for(var _0x281aec=0x0;_0x281aec<_0x6b83f1['body']['ids'][_0x388b('0x5e')];_0x281aec+=0x1){socket[_0x388b('0x129')](_0x388b('0x12a'),{'UserId':Number(_0x6b83f1['body'][_0x388b('0x82')][_0x281aec]),'ChatWebsiteId':Number(_0x6b83f1[_0x388b('0x6b')]['id'])});}return _0x5a2faa;});}})[_0x388b('0x19')](respondWithResult(_0x5f85ce,null))[_0x388b('0x3a')](handleError(_0x5f85ce,null));};exports[_0x388b('0x12b')]=function(_0x3d4269,_0x5b51b4){return db['ChatWebsite'][_0x388b('0x73')]({'where':{'id':_0x3d4269[_0x388b('0x6b')]['id']}})['then'](handleEntityNotFound(_0x5b51b4,null))['then'](function(_0x5845ba){if(_0x5845ba){return _0x5845ba[_0x388b('0x12b')](_0x3d4269[_0x388b('0x59')][_0x388b('0x82')])['then'](function(){if(_[_0x388b('0x12c')](_0x3d4269['query'][_0x388b('0x82')])){for(var _0x6ea01f=0x0;_0x6ea01f<_0x3d4269[_0x388b('0x59')][_0x388b('0x82')][_0x388b('0x5e')];_0x6ea01f+=0x1){socket[_0x388b('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x3d4269['query'][_0x388b('0x82')][_0x6ea01f]),'ChatWebsiteId':Number(_0x3d4269[_0x388b('0x6b')]['id'])});}}else{socket['emit'](_0x388b('0x12d'),{'UserId':Number(_0x3d4269[_0x388b('0x59')][_0x388b('0x82')]),'ChatWebsiteId':Number(_0x3d4269[_0x388b('0x6b')]['id'])});}});}})[_0x388b('0x19')](respondWithStatusCode(_0x5b51b4,null))[_0x388b('0x3a')](handleError(_0x5b51b4,null));};exports[_0x388b('0x12e')]=function(_0x1597dc,_0x4ac9c9){var _0x32b996={};var _0x5ce35c={};var _0x1863dd;var _0x4dc0d4;return db[_0x388b('0x56')]['findOne']({'where':{'id':_0x1597dc[_0x388b('0x6b')]['id']}})[_0x388b('0x19')](handleEntityNotFound(_0x4ac9c9,null))['then'](function(_0x249523){if(_0x249523){_0x1863dd=_0x249523;_0x5ce35c[_0x388b('0x4f')]=_['keys'](db[_0x388b('0x100')]['rawAttributes']);_0x5ce35c[_0x388b('0x59')]=_['keys'](_0x1597dc[_0x388b('0x59')]);_0x5ce35c[_0x388b('0x5a')]=_[_0x388b('0x5b')](_0x5ce35c['model'],_0x5ce35c[_0x388b('0x59')]);_0x32b996[_0x388b('0x5c')]=_[_0x388b('0x5b')](_0x5ce35c[_0x388b('0x4f')],qs[_0x388b('0x5d')](_0x1597dc[_0x388b('0x59')][_0x388b('0x5d')]));_0x32b996[_0x388b('0x5c')]=_0x32b996[_0x388b('0x5c')][_0x388b('0x5e')]?_0x32b996[_0x388b('0x5c')]:_0x5ce35c['model'];_0x32b996[_0x388b('0x60')]=qs[_0x388b('0x61')](_0x1597dc[_0x388b('0x59')][_0x388b('0x61')]);_0x32b996[_0x388b('0x62')]=qs[_0x388b('0x5a')](_[_0x388b('0x7d')](_0x1597dc[_0x388b('0x59')],_0x5ce35c[_0x388b('0x5a')]));if(_0x1597dc[_0x388b('0x59')][_0x388b('0x63')]){_0x32b996[_0x388b('0x62')]=_[_0x388b('0x65')](_0x32b996[_0x388b('0x62')],{'$or':_[_0x388b('0x3c')](_0x32b996[_0x388b('0x5c')],function(_0x266ed7){var _0x479ac2={};_0x479ac2[_0x266ed7]={'$like':'%'+_0x1597dc[_0x388b('0x59')][_0x388b('0x63')]+'%'};return _0x479ac2;})});}_0x32b996=_[_0x388b('0x65')]({},_0x32b996,_0x1597dc[_0x388b('0x66')]);return _0x1863dd[_0x388b('0x12e')](_0x32b996);}})[_0x388b('0x19')](function(_0xfc7779){if(_0xfc7779){_0x4dc0d4=_0xfc7779[_0x388b('0x5e')];if(!_0x1597dc[_0x388b('0x59')][_0x388b('0x7c')](_0x388b('0x5f'))){_0x32b996[_0x388b('0x28')]=qs['limit'](_0x1597dc[_0x388b('0x59')][_0x388b('0x28')]);_0x32b996[_0x388b('0x27')]=qs[_0x388b('0x27')](_0x1597dc[_0x388b('0x59')]['offset']);}return _0x1863dd[_0x388b('0x12e')](_0x32b996);}})[_0x388b('0x19')](function(_0x51a574){if(_0x51a574){return _0x51a574?{'count':_0x4dc0d4,'rows':_0x51a574}:null;}})[_0x388b('0x19')](respondWithResult(_0x4ac9c9,null))[_0x388b('0x3a')](handleError(_0x4ac9c9,null));}; \ No newline at end of file +var _0x1139=['addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','chat','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','contact','headers','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','EventManager','files','no\x20available\x20attributes','CompanyId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','origin','3.5.0','remote','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','color','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','mustache','util','path','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIOutOfIntervalError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','end','status','offset','limit','undefined','count','set','json','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','Intervals','all','some','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','device','model','vendor','type','stringify','Pause','ChatWebsite','fieldName','key','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','mandatoryDispositionPause','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar'];(function(_0x501fe6,_0xb74e75){var _0x2262da=function(_0x5e8584){while(--_0x5e8584){_0x501fe6['push'](_0x501fe6['shift']());}};_0x2262da(++_0xb74e75);}(_0x1139,0x1e3));var _0x9113=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1139[_0x40a045];return _0x1a687c;};'use strict';var Mustache=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require(_0x9113('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9113('0x3'));var _=require(_0x9113('0x4'));var querystring=require(_0x9113('0x5'));var htmlToText=require(_0x9113('0x6'));var Redis=require(_0x9113('0x7'));var jayson=require(_0x9113('0x8'));var url=require(_0x9113('0x9'));var qs=require(_0x9113('0xa'));var logger=require(_0x9113('0xb'))(_0x9113('0xc'));var config=require(_0x9113('0xd'));var APIOutOfIntervalError=require('../../errors/api')[_0x9113('0xe')];var APINotFoundError=require(_0x9113('0xf'))[_0x9113('0x10')];var APIHandleError=require(_0x9113('0xf'))[_0x9113('0x11')];var db=require(_0x9113('0x12'))['db'];config[_0x9113('0x13')]=_[_0x9113('0x14')](config['redis'],{'host':_0x9113('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9113('0x13')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x232c});var client9002=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x232a});var client9003=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x232b});var client9001=jayson[_0x9113('0x16')][_0x9113('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2752df,_0x10d60c,_0x185e71,_0x2a9ba8){return new Promise(function(_0x2ba2e7,_0x162f85){var _0xeaeac2=_0x2a9ba8||client;return _0xeaeac2[_0x9113('0x18')](_0x2752df,_0x185e71)['then'](function(_0x221f0d){logger[_0x9113('0x19')](_0x9113('0x1a'),_0x10d60c,'request\x20sent');logger[_0x9113('0x1b')](_0x9113('0x1c'),_0x10d60c,_0x9113('0x1d'),JSON['stringify'](_0x221f0d));if(_0x221f0d[_0x9113('0x1e')]){if(_0x221f0d['error']['code']===0x1f4){logger[_0x9113('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x10d60c,_0x221f0d[_0x9113('0x1e')][_0x9113('0x1f')]);return _0x162f85(_0x221f0d[_0x9113('0x1e')][_0x9113('0x1f')]);}logger['error'](_0x9113('0x1a'),_0x10d60c,_0x221f0d['error'][_0x9113('0x1f')]);return _0x2ba2e7(_0x221f0d[_0x9113('0x1e')][_0x9113('0x1f')]);}else{logger['info'](_0x9113('0x1a'),_0x10d60c,_0x9113('0x1d'));_0x2ba2e7(_0x221f0d[_0x9113('0x20')][_0x9113('0x1f')]);}})['catch'](function(_0x524db4){logger[_0x9113('0x1e')](_0x9113('0x1a'),_0x10d60c,_0x524db4);_0x162f85(_0x524db4);});});}function respondWithStatusCode(_0x39e1bb,_0x4eca00){_0x4eca00=_0x4eca00||0xcc;return function(_0x2725dc){if(_0x2725dc){return _0x39e1bb[_0x9113('0x21')](_0x4eca00);}return _0x39e1bb['status'](_0x4eca00)[_0x9113('0x22')]();};}function respondWithResult(_0x236042,_0x3a8e4){_0x3a8e4=_0x3a8e4||0xc8;return function(_0x536ac0){if(_0x536ac0){return _0x236042[_0x9113('0x23')](_0x3a8e4)['json'](_0x536ac0);}};}function respondWithFilteredResult(_0x5def2c,_0xc8f3ae){return function(_0x240e68){if(_0x240e68){var _0x36b213=typeof _0xc8f3ae[_0x9113('0x24')]==='undefined'&&typeof _0xc8f3ae[_0x9113('0x25')]===_0x9113('0x26');var _0x35068b=_0x240e68[_0x9113('0x27')];var _0x9d098e=_0x36b213?0x0:_0xc8f3ae['offset'];var _0x2c63df=_0x36b213?_0x240e68[_0x9113('0x27')]:_0xc8f3ae['offset']+_0xc8f3ae[_0x9113('0x25')];var _0x2e6bcf;if(_0x2c63df>=_0x35068b){_0x2c63df=_0x35068b;_0x2e6bcf=0xc8;}else{_0x2e6bcf=0xce;}_0x5def2c[_0x9113('0x23')](_0x2e6bcf);return _0x5def2c[_0x9113('0x28')]('Content-Range',_0x9d098e+'-'+_0x2c63df+'/'+_0x35068b)[_0x9113('0x29')](_0x240e68);}return null;};}function saveUpdates(_0x21397b){return function(_0x565756){if(_0x565756){return _0x565756[_0x9113('0x2a')](_0x21397b)[_0x9113('0x2b')](function(_0xe1628d){return _0xe1628d;});}return null;};}function removeEntity(_0x49eeae){return function(_0x42ae8a){if(_0x42ae8a){return _0x42ae8a[_0x9113('0x2c')]()['then'](function(){var _0xdb9d01=_0x42ae8a[_0x9113('0x2d')]({'plain':!![]});var _0x4f08b6=_0x9113('0x2e');return db[_0x9113('0x2f')][_0x9113('0x2c')]({'where':{'type':_0x4f08b6,'resourceId':_0xdb9d01['id']}})['then'](function(){return _0x42ae8a;});})[_0x9113('0x2b')](function(){_0x49eeae[_0x9113('0x23')](0xcc)[_0x9113('0x22')]();});}};}function handleEntityNotFound(_0xb18fa6){return function(_0xfe4c85){if(!_0xfe4c85){_0xb18fa6['sendStatus'](0x194);}return _0xfe4c85;};}function handleError(_0x4d6c1c,_0x3703d8){_0x3703d8=_0x3703d8||0x1f4;return function(_0x43925e){logger['error'](_0x43925e[_0x9113('0x30')]);if(_0x43925e[_0x9113('0x31')]){delete _0x43925e[_0x9113('0x31')];}_0x4d6c1c['status'](_0x3703d8)[_0x9113('0x32')](_0x43925e);};}function iftimePromise(_0x1da9f5,_0xf81d34){return respondWithRpcPromise(_0x9113('0x33'),'getSnippet',{'command':_0xf81d34[_0x9113('0x34')]?util[_0x9113('0x35')](_0x9113('0x36'),_0x1da9f5[_0x9113('0x37')],_0xf81d34[_0x9113('0x34')]):util[_0x9113('0x35')](_0x9113('0x38'),_0x1da9f5[_0x9113('0x37')])},client9002)[_0x9113('0x2b')](function(_0x580652){var _0x3aa0dc=_0x580652&&_0x580652[_0x9113('0x39')](_0x9113('0x3a'))>=0x0?!![]:![];logger[_0x9113('0x19')](_0x9113('0x3b'),_0xf81d34['id'],_0x1da9f5['id'],_0x1da9f5[_0x9113('0x37')],_0x3aa0dc?_0x9113('0x3c'):_0x9113('0x3d'),_0xf81d34[_0x9113('0x34')]?_0xf81d34[_0x9113('0x34')]:_0x9113('0x3e'));return _0x3aa0dc;})['catch'](function(_0x8e1d14){logger[_0x9113('0x1e')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf81d34['id'],_0x1da9f5['id'],_0x1da9f5[_0x9113('0x37')],util[_0x9113('0x3f')](_0x8e1d14,{'showHidden':![],'depth':null}),_0xf81d34[_0x9113('0x34')]?_0xf81d34['timezone']:_0x9113('0x3e'));return![];});}function checkWebsiteIntervals(_0x1f762a){var _0x31f4b2=_[_0x9113('0x40')](_0x1f762a[_0x9113('0x41')][_0x9113('0x42')],function(_0x3e6cee){var _0x3a2175=_0x3e6cee[_0x9113('0x2d')]({'plain':!![]});return iftimePromise(_0x3a2175,_0x1f762a);});return Promise[_0x9113('0x43')](_0x31f4b2)[_0x9113('0x2b')](function(_0x3af062){return _[_0x9113('0x44')](_0x3af062);});}function createInteractionObject(_0x3e8be,_0x28c3d5,_0x4a3ca9,_0x3884c2){var _0x2a8682=require('user-agent-parser');var _0x1e1e52=new _0x2a8682();var _0x1c66ec=_0x1e1e52[_0x9113('0x45')](_0x4a3ca9[_0x9113('0x46')])[_0x9113('0x47')]();var _0x3807cb=_0x28c3d5[_0x9113('0x48')];if(_0x4a3ca9[_0x9113('0x49')]){_0x3807cb=_0x4a3ca9[_0x9113('0x49')];}else if(_0x4a3ca9[_0x9113('0x4a')]){_0x3807cb=_[_0x9113('0x4b')](_0x4a3ca9['x-forwarded-for'][_0x9113('0x4c')](','));}return{'ContactId':_0x3884c2['id'],'ChatWebsiteId':_0x3e8be,'from':(_0x3884c2[_0x9113('0x4d')]||'')+'\x20'+(_0x3884c2[_0x9113('0x4e')]||''),'customerIp':_0x3807cb,'customerPort':_0x4a3ca9[_0x9113('0x4f')]?_0x4a3ca9['x-real-port']:null,'referer':_0x28c3d5[_0x9113('0x50')],'browserName':_0x1c66ec[_0x9113('0x51')][_0x9113('0x31')]&&_0x1c66ec[_0x9113('0x51')]['version']?util[_0x9113('0x35')](_0x9113('0x52'),_0x1c66ec[_0x9113('0x51')][_0x9113('0x31')],_0x1c66ec[_0x9113('0x51')]['version']):'unknown','browserVersion':_0x1c66ec[_0x9113('0x51')]['version']||'unknown','osName':util[_0x9113('0x35')](_0x9113('0x52'),_0x1c66ec['os'][_0x9113('0x31')],_0x1c66ec['os'][_0x9113('0x53')]),'osVersion':_0x1c66ec['os'][_0x9113('0x53')],'deviceModel':_0x1c66ec[_0x9113('0x54')][_0x9113('0x55')]&&_0x1c66ec[_0x9113('0x54')][_0x9113('0x56')]?util[_0x9113('0x35')]('%s\x20%s\x20%s',_0x1c66ec[_0x9113('0x54')][_0x9113('0x55')],_0x1c66ec[_0x9113('0x54')][_0x9113('0x56')],_0x1c66ec[_0x9113('0x54')][_0x9113('0x57')]):null,'deviceVendor':_0x1c66ec[_0x9113('0x54')][_0x9113('0x56')],'deviceType':_0x1c66ec[_0x9113('0x54')]['type'],'formData':JSON[_0x9113('0x58')](_0x28c3d5)};}exports['index']=function(_0x4fc69b,_0x6b6635){var _0x39c66e={'include':[{'model':db[_0x9113('0x59')],'as':'mandatoryDispositionPause'}]},_0x312128={},_0x985afe={'count':0x0,'rows':[]};var _0x3f37a1=_['map'](db[_0x9113('0x5a')]['rawAttributes'],function(_0x263f6c){return{'name':_0x263f6c[_0x9113('0x5b')],'type':_0x263f6c['type'][_0x9113('0x5c')]};});_0x312128['model']=_[_0x9113('0x40')](_0x3f37a1,'name');_0x312128['query']=_[_0x9113('0x5d')](_0x4fc69b[_0x9113('0x5e')]);_0x312128[_0x9113('0x5f')]=_['intersection'](_0x312128[_0x9113('0x55')],_0x312128[_0x9113('0x5e')]);_0x39c66e[_0x9113('0x60')]=_[_0x9113('0x61')](_0x312128[_0x9113('0x55')],qs[_0x9113('0x62')](_0x4fc69b[_0x9113('0x5e')][_0x9113('0x62')]));_0x39c66e['attributes']=_0x39c66e['attributes'][_0x9113('0x63')]?_0x39c66e['attributes']:_0x312128[_0x9113('0x55')];if(!_0x4fc69b[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x39c66e[_0x9113('0x25')]=qs['limit'](_0x4fc69b[_0x9113('0x5e')]['limit']);_0x39c66e['offset']=qs['offset'](_0x4fc69b['query'][_0x9113('0x24')]);}_0x39c66e[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x4fc69b[_0x9113('0x5e')][_0x9113('0x67')]);_0x39c66e[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x4fc69b[_0x9113('0x5e')],_0x312128[_0x9113('0x5f')]),_0x3f37a1);if(_0x4fc69b[_0x9113('0x5e')][_0x9113('0x6a')]){_0x39c66e[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x39c66e[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x3f37a1,function(_0x4d0cfb){if(_0x4d0cfb[_0x9113('0x57')]!==_0x9113('0x6c')){var _0x399662={};_0x399662[_0x4d0cfb[_0x9113('0x31')]]={'$like':'%'+_0x4fc69b[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x399662;}})});}_0x39c66e=_[_0x9113('0x6b')]({},_0x39c66e,_0x4fc69b[_0x9113('0x6d')]);var _0x40996a={'where':_0x39c66e[_0x9113('0x68')]};return db[_0x9113('0x5a')][_0x9113('0x27')](_0x40996a)[_0x9113('0x2b')](function(_0x1541d6){_0x985afe[_0x9113('0x27')]=_0x1541d6;if(_0x4fc69b[_0x9113('0x5e')][_0x9113('0x6e')]){_0x39c66e['include']=[{'all':!![]}];}return db[_0x9113('0x5a')][_0x9113('0x6f')](_0x39c66e);})[_0x9113('0x2b')](function(_0x16d191){_0x985afe['rows']=_0x16d191;return _0x985afe;})[_0x9113('0x2b')](respondWithFilteredResult(_0x6b6635,_0x39c66e))[_0x9113('0x70')](handleError(_0x6b6635,null));};exports['show']=function(_0x556625,_0x52b409){var _0x263629={'raw':![],'where':{'id':_0x556625[_0x9113('0x71')]['id']},'include':[{'model':db[_0x9113('0x59')],'as':_0x9113('0x72')}]},_0x59f43b={};_0x59f43b[_0x9113('0x55')]=_['keys'](db[_0x9113('0x5a')]['rawAttributes']);_0x59f43b[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x556625['query']);_0x59f43b[_0x9113('0x5f')]=_['intersection'](_0x59f43b[_0x9113('0x55')],_0x59f43b[_0x9113('0x5e')]);_0x263629[_0x9113('0x60')]=_[_0x9113('0x61')](_0x59f43b['model'],qs[_0x9113('0x62')](_0x556625[_0x9113('0x5e')][_0x9113('0x62')]));_0x263629[_0x9113('0x60')]=_0x263629[_0x9113('0x60')][_0x9113('0x63')]?_0x263629[_0x9113('0x60')]:_0x59f43b['model'];if(_0x556625[_0x9113('0x5e')]['includeAll']){_0x263629['include']=[{'all':!![]}];}_0x263629=_[_0x9113('0x6b')]({},_0x263629,_0x556625[_0x9113('0x6d')]);return db[_0x9113('0x5a')][_0x9113('0x73')](_0x263629)['then'](handleEntityNotFound(_0x52b409,null))[_0x9113('0x2b')](respondWithResult(_0x52b409,null))[_0x9113('0x70')](handleError(_0x52b409,null));};exports['create']=function(_0x461988,_0xbe79a9){return db[_0x9113('0x5a')][_0x9113('0x74')](_0x461988['body'],{})[_0x9113('0x2b')](function(_0x31b444){var _0x3d4c07=_0x461988[_0x9113('0x75')][_0x9113('0x2d')]({'plain':!![]});if(!_0x3d4c07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d4c07['role']==='user'){var _0x1f49ea=_0x31b444[_0x9113('0x2d')]({'plain':!![]});var _0xa72a90=_0x9113('0x2e');return db[_0x9113('0x76')]['find']({'where':{'name':_0xa72a90,'userProfileId':_0x3d4c07[_0x9113('0x77')]},'raw':!![]})[_0x9113('0x2b')](function(_0x389438){if(_0x389438&&_0x389438[_0x9113('0x78')]===0x0){return db[_0x9113('0x2f')][_0x9113('0x74')]({'name':_0x1f49ea[_0x9113('0x31')],'resourceId':_0x1f49ea['id'],'type':_0x389438['name'],'sectionId':_0x389438['id']},{})[_0x9113('0x2b')](function(){return _0x31b444;});}else{return _0x31b444;}})[_0x9113('0x70')](function(_0x4e3b36){logger['error'](_0x9113('0x79'),_0x4e3b36);throw _0x4e3b36;});}return _0x31b444;})[_0x9113('0x2b')](respondWithResult(_0xbe79a9,0xc9))[_0x9113('0x70')](handleError(_0xbe79a9,null));};exports[_0x9113('0x2a')]=function(_0x3d08de,_0x59f63b){if(_0x3d08de[_0x9113('0x7a')]['id']){delete _0x3d08de[_0x9113('0x7a')]['id'];}return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x3d08de['params']['id']},'include':[{'model':db[_0x9113('0x59')],'as':_0x9113('0x72')}]})['then'](handleEntityNotFound(_0x59f63b,null))[_0x9113('0x2b')](saveUpdates(_0x3d08de[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x59f63b,null))[_0x9113('0x70')](handleError(_0x59f63b,null));};exports[_0x9113('0x2c')]=function(_0x2fbe28,_0x32c717){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x2fbe28[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x32c717,null))[_0x9113('0x2b')](removeEntity(_0x32c717,null))[_0x9113('0x70')](handleError(_0x32c717,null));};exports['describe']=function(_0x3b91ba,_0x4a6ef6){return db[_0x9113('0x5a')][_0x9113('0x7b')]()['then'](respondWithResult(_0x4a6ef6,null))[_0x9113('0x70')](handleError(_0x4a6ef6,null));};exports[_0x9113('0x7c')]=function(_0x5ad7e8,_0x446e0f){if(_0x5ad7e8[_0x9113('0x7a')]['id']){delete _0x5ad7e8['body']['id'];}return db[_0x9113('0x5a')]['find']({'where':{'id':_0x5ad7e8['params']['id']}})['then'](handleEntityNotFound(_0x446e0f,null))[_0x9113('0x2b')](function(_0x3a318a){if(_0x3a318a){_0x5ad7e8[_0x9113('0x7a')][_0x9113('0x7d')]=_0x3a318a['id'];return db[_0x9113('0x7e')][_0x9113('0x74')](_0x5ad7e8[_0x9113('0x7a')]);}})[_0x9113('0x2b')](respondWithResult(_0x446e0f,null))[_0x9113('0x70')](handleError(_0x446e0f,null));};exports[_0x9113('0x7f')]=function(_0x182b4b,_0x455ab8){var _0x5b0c0e={'raw':![],'where':{}};var _0x2074fc={};var _0x4144f8={'count':0x0,'rows':[]};return db[_0x9113('0x5a')]['findOne']({'where':{'id':_0x182b4b[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x455ab8,null))[_0x9113('0x2b')](function(_0x547ae8){if(_0x547ae8){_0x2074fc[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x7e')][_0x9113('0x80')]);_0x2074fc[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x182b4b[_0x9113('0x5e')]);_0x2074fc['filters']=_[_0x9113('0x61')](_0x2074fc['model'],_0x2074fc[_0x9113('0x5e')]);_0x5b0c0e['attributes']=_[_0x9113('0x61')](_0x2074fc[_0x9113('0x55')],qs[_0x9113('0x62')](_0x182b4b['query'][_0x9113('0x62')]));_0x5b0c0e[_0x9113('0x60')]=_0x5b0c0e[_0x9113('0x60')][_0x9113('0x63')]?_0x5b0c0e[_0x9113('0x60')]:_0x2074fc[_0x9113('0x55')];if(!_0x182b4b[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x5b0c0e[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x182b4b[_0x9113('0x5e')]['limit']);_0x5b0c0e['offset']=qs['offset'](_0x182b4b[_0x9113('0x5e')][_0x9113('0x24')]);}_0x5b0c0e[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x182b4b['query'][_0x9113('0x67')]);_0x5b0c0e['where']=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x182b4b[_0x9113('0x5e')],_0x2074fc['filters']));_0x5b0c0e[_0x9113('0x68')][_0x9113('0x7d')]=_0x547ae8['id'];if(_0x182b4b[_0x9113('0x5e')][_0x9113('0x6a')]){_0x5b0c0e['where']=_[_0x9113('0x6b')](_0x5b0c0e[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x5b0c0e[_0x9113('0x60')],function(_0x538ce9){var _0x54ead9={};_0x54ead9[_0x538ce9]={'$like':'%'+_0x182b4b[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x54ead9;})});}_0x5b0c0e=_[_0x9113('0x6b')]({},_0x5b0c0e,_0x182b4b[_0x9113('0x6d')]);return db[_0x9113('0x7e')]['count']({'where':_0x5b0c0e['where']})[_0x9113('0x2b')](function(_0x2bc75c){_0x4144f8[_0x9113('0x27')]=_0x2bc75c;if(_0x182b4b['query'][_0x9113('0x6e')]){_0x5b0c0e[_0x9113('0x81')]=[{'all':!![]}];}return db[_0x9113('0x7e')][_0x9113('0x6f')](_0x5b0c0e);})[_0x9113('0x2b')](function(_0x4ed7a1){_0x4144f8[_0x9113('0x82')]=_0x4ed7a1;return _0x4144f8;});}})[_0x9113('0x2b')](respondWithFilteredResult(_0x455ab8,_0x5b0c0e))[_0x9113('0x70')](handleError(_0x455ab8,null));};exports['removeDispositions']=function(_0x179ad5,_0x4429a0){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x179ad5[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x4429a0,null))['then'](function(_0x25eb89){if(_0x25eb89){return _0x25eb89[_0x9113('0x83')](_0x179ad5[_0x9113('0x5e')][_0x9113('0x84')]);}})[_0x9113('0x2b')](respondWithStatusCode(_0x4429a0,null))[_0x9113('0x70')](handleError(_0x4429a0,null));};exports[_0x9113('0x85')]=function(_0x1a57c9,_0x425c24){if(_0x1a57c9['body']['id']){delete _0x1a57c9['body']['id'];}return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x1a57c9[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x425c24,null))[_0x9113('0x2b')](function(_0x4996ee){if(_0x4996ee){_0x1a57c9['body'][_0x9113('0x7d')]=_0x4996ee['id'];return db[_0x9113('0x86')][_0x9113('0x74')](_0x1a57c9[_0x9113('0x7a')]);}})[_0x9113('0x2b')](respondWithResult(_0x425c24,null))[_0x9113('0x70')](handleError(_0x425c24,null));};exports['getAnswers']=function(_0x1afd6c,_0x266978){var _0x531f80={'raw':![],'where':{}};var _0x770a3e={};var _0x1a84d2={'count':0x0,'rows':[]};return db[_0x9113('0x5a')][_0x9113('0x87')]({'where':{'id':_0x1afd6c[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x266978,null))['then'](function(_0x5601aa){if(_0x5601aa){_0x770a3e[_0x9113('0x55')]=_[_0x9113('0x5d')](db['CannedAnswer'][_0x9113('0x80')]);_0x770a3e[_0x9113('0x5e')]=_['keys'](_0x1afd6c['query']);_0x770a3e['filters']=_['intersection'](_0x770a3e['model'],_0x770a3e[_0x9113('0x5e')]);_0x531f80[_0x9113('0x60')]=_[_0x9113('0x61')](_0x770a3e['model'],qs[_0x9113('0x62')](_0x1afd6c[_0x9113('0x5e')]['fields']));_0x531f80[_0x9113('0x60')]=_0x531f80['attributes'][_0x9113('0x63')]?_0x531f80['attributes']:_0x770a3e[_0x9113('0x55')];if(!_0x1afd6c[_0x9113('0x5e')][_0x9113('0x64')]('nolimit')){_0x531f80[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x1afd6c[_0x9113('0x5e')]['limit']);_0x531f80[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x1afd6c[_0x9113('0x5e')][_0x9113('0x24')]);}_0x531f80['order']=qs[_0x9113('0x67')](_0x1afd6c[_0x9113('0x5e')][_0x9113('0x67')]);_0x531f80[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x1afd6c[_0x9113('0x5e')],_0x770a3e[_0x9113('0x5f')]));_0x531f80[_0x9113('0x68')][_0x9113('0x7d')]=_0x5601aa['id'];if(_0x1afd6c[_0x9113('0x5e')][_0x9113('0x6a')]){_0x531f80[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x531f80[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x531f80['attributes'],function(_0x3c8f4c){var _0x475fd5={};_0x475fd5[_0x3c8f4c]={'$like':'%'+_0x1afd6c[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x475fd5;})});}_0x531f80=_['merge']({},_0x531f80,_0x1afd6c['options']);return db[_0x9113('0x86')]['count']({'where':_0x531f80[_0x9113('0x68')]})[_0x9113('0x2b')](function(_0x17813b){_0x1a84d2['count']=_0x17813b;if(_0x1afd6c['query'][_0x9113('0x6e')]){_0x531f80[_0x9113('0x81')]=[{'all':!![]}];}return db[_0x9113('0x86')][_0x9113('0x6f')](_0x531f80);})[_0x9113('0x2b')](function(_0x5c74f0){_0x1a84d2[_0x9113('0x82')]=_0x5c74f0;return _0x1a84d2;});}})['then'](respondWithFilteredResult(_0x266978,_0x531f80))[_0x9113('0x70')](handleError(_0x266978,null));};exports[_0x9113('0x88')]=function(_0x338141,_0x469b1b){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x338141[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x469b1b,null))[_0x9113('0x2b')](function(_0x255221){if(_0x255221){return _0x255221[_0x9113('0x88')](_0x338141[_0x9113('0x5e')]['ids']);}})[_0x9113('0x2b')](respondWithStatusCode(_0x469b1b,null))[_0x9113('0x70')](handleError(_0x469b1b,null));};exports[_0x9113('0x89')]=function(_0x3236fb,_0x15d1ef){_0x3236fb['body'][_0x9113('0x8a')]=_0x3236fb[_0x9113('0x8b')][_0x9113('0x8c')];return db['ChatWebsite'][_0x9113('0x73')]({'where':{'id':_0x3236fb[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x15d1ef,null))[_0x9113('0x2b')](saveUpdates(_0x3236fb[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x15d1ef,null))[_0x9113('0x70')](handleError(_0x15d1ef,null));};exports[_0x9113('0x8d')]=function(_0x1844fe,_0x1ef0e8){_0x1844fe['body'][_0x9113('0x8e')]=_0x1844fe[_0x9113('0x8b')]['filename'];return db[_0x9113('0x5a')]['find']({'where':{'id':_0x1844fe[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x1ef0e8,null))['then'](saveUpdates(_0x1844fe[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x1ef0e8,null))[_0x9113('0x70')](handleError(_0x1ef0e8,null));};exports[_0x9113('0x8f')]=function(_0x3cbaa9,_0x45d2f1){_0x3cbaa9[_0x9113('0x7a')][_0x9113('0x90')]=_0x3cbaa9[_0x9113('0x8b')][_0x9113('0x8c')];return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x3cbaa9[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x45d2f1,null))[_0x9113('0x2b')](saveUpdates(_0x3cbaa9[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x45d2f1,null))[_0x9113('0x70')](handleError(_0x45d2f1,null));};exports[_0x9113('0x91')]=function(_0x258ff7,_0x4bc870){_0x258ff7[_0x9113('0x7a')]['systemAvatar']=_0x258ff7[_0x9113('0x8b')]['filename'];return db['ChatWebsite'][_0x9113('0x73')]({'where':{'id':_0x258ff7['params']['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x4bc870,null))[_0x9113('0x2b')](saveUpdates(_0x258ff7[_0x9113('0x7a')],null))[_0x9113('0x2b')](respondWithResult(_0x4bc870,null))[_0x9113('0x70')](handleError(_0x4bc870,null));};exports[_0x9113('0x92')]=function(_0x26dd54,_0xa5fb10){var _0x16734e=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x95'));var _0x489205={'where':{'id':_0x26dd54[_0x9113('0x71')]['id']},'attributes':['id',_0x9113('0x8a')],'raw':!![]};var _0x5f5d7e=![];return require(_0x9113('0x96'))['getLicense']()[_0x9113('0x2b')](function(_0x380d0e){if(_0x380d0e){_0x5f5d7e=_0x380d0e[_0x9113('0x97')];}})[_0x9113('0x2b')](function(){return db['ChatWebsite'][_0x9113('0x73')](_0x489205);})['then'](handleEntityNotFound(_0xa5fb10,null))[_0x9113('0x2b')](function(_0x84c3a0){if(_0x84c3a0){if(!_[_0x9113('0x98')](_0x84c3a0[_0x9113('0x8a')])){if(fs[_0x9113('0x99')](path[_0x9113('0x93')](config[_0x9113('0x94')],'server/files/images/logos/',_0x84c3a0[_0x9113('0x8a')]))&&_0x5f5d7e){_0x16734e=path[_0x9113('0x93')](config[_0x9113('0x94')],'server/files/images/logos/',_0x84c3a0[_0x9113('0x8a')]);}}return _0xa5fb10[_0x9113('0x9a')](_0x16734e);}})[_0x9113('0x70')](handleError(_0xa5fb10,null));};exports[_0x9113('0x9b')]=function(_0x3e033e,_0x4485d5){var _0x53576d=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x9c'));var _0x1cba5b={'where':{'id':_0x3e033e[_0x9113('0x71')]['id']},'attributes':['id',_0x9113('0x8e')],'raw':!![]};return db[_0x9113('0x5a')][_0x9113('0x73')](_0x1cba5b)[_0x9113('0x2b')](handleEntityNotFound(_0x4485d5,null))['then'](function(_0x37b49e){if(_0x37b49e){if(!_[_0x9113('0x98')](_0x37b49e[_0x9113('0x8e')])){if(fs['existsSync'](path['join'](config[_0x9113('0x94')],_0x9113('0x9d'),_0x37b49e[_0x9113('0x8e')]))){_0x53576d=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x9d'),_0x37b49e['agentAvatar']);}}return _0x4485d5[_0x9113('0x9a')](_0x53576d);}})[_0x9113('0x70')](handleError(_0x4485d5,null));};exports[_0x9113('0x9e')]=function(_0x3dcf7e,_0x383e85){var _0x2b5f6=path['join'](config[_0x9113('0x94')],_0x9113('0x9f'));var _0x51a103={'where':{'id':_0x3dcf7e['params']['id']},'attributes':['id',_0x9113('0x90'),_0x9113('0xa0')],'raw':!![]};return db['ChatWebsite'][_0x9113('0x73')](_0x51a103)['then'](handleEntityNotFound(_0x383e85,null))[_0x9113('0x2b')](function(_0x181c10){if(_0x181c10){if(!_['isNil'](_0x181c10[_0x9113('0x90')])){if(fs[_0x9113('0x99')](path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0x9d'),_0x181c10[_0x9113('0x90')]))&&_0x181c10[_0x9113('0xa0')]){_0x2b5f6=path['join'](config[_0x9113('0x94')],_0x9113('0x9d'),_0x181c10[_0x9113('0x90')]);}}return _0x383e85[_0x9113('0x9a')](_0x2b5f6);}})[_0x9113('0x70')](handleError(_0x383e85,null));};exports[_0x9113('0xa1')]=function(_0x4fafa5,_0x3a2b17){var _0x34eebf=path[_0x9113('0x93')](config[_0x9113('0x94')],_0x9113('0xa2'));var _0x2485e2={'where':{'id':_0x4fafa5[_0x9113('0x71')]['id']},'attributes':['id',_0x9113('0xa3')],'raw':!![]};return db[_0x9113('0x5a')]['find'](_0x2485e2)[_0x9113('0x2b')](handleEntityNotFound(_0x3a2b17,null))['then'](function(_0x2c7d2c){if(_0x2c7d2c){if(!_[_0x9113('0x98')](_0x2c7d2c[_0x9113('0xa3')])){if(fs['existsSync'](path['join'](config[_0x9113('0x94')],_0x9113('0x9d'),_0x2c7d2c[_0x9113('0xa3')]))){_0x34eebf=path[_0x9113('0x93')](config[_0x9113('0x94')],'server/files/images/avatars/',_0x2c7d2c['systemAvatar']);}}return _0x3a2b17[_0x9113('0x9a')](_0x34eebf);}})['catch'](handleError(_0x3a2b17,null));};exports[_0x9113('0xa4')]=function(_0x459f94,_0x554f51){var _0x444ce8={'body':_0x459f94[_0x9113('0x7a')],'channel':_0x9113('0xa5')};var _0x4fed7f=[];var _0x57db2c=[];var _0x3b4a49={};var _0x42a65a=![];return db[_0x9113('0xa6')][_0x9113('0x7b')]()[_0x9113('0x2b')](function(_0x15c888){if(!_0x15c888){throw new db['Sequelize'][(_0x9113('0xa7'))]('no\x20available\x20attributes');}_0x4fed7f=_[_0x9113('0xa8')](_[_0x9113('0x5d')](_0x15c888),[_0x9113('0xa9'),'updatedAt']);_0x57db2c=_[_0x9113('0xa8')](_[_0x9113('0x5d')](_0x15c888),['createdAt',_0x9113('0xaa'),'CompanyId',_0x9113('0xab')]);if(_0x459f94[_0x9113('0x7a')]['id']){delete _0x459f94['body']['id'];}if(_[_0x9113('0x98')](_0x459f94['body'][_0x9113('0xac')])){throw new db[(_0x9113('0xad'))]['ValidationError'](_0x9113('0xae'));}if(_[_0x9113('0x98')](_0x459f94['body'][_0x9113('0x7a')])||_0x459f94[_0x9113('0x7a')]['body']===''){throw new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xaf'));}if(_[_0x9113('0x98')](_0x459f94[_0x9113('0x7a')]['mapKey'])){throw new db[(_0x9113('0xad'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57db2c);}if(!_[_0x9113('0xb0')](_0x57db2c,_0x459f94[_0x9113('0x7a')][_0x9113('0xb1')])){throw new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xb2')+_0x57db2c);}_0x3b4a49[_0x459f94['body'][_0x9113('0xb1')]]=_0x459f94['body']['from'];})[_0x9113('0x2b')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x459f94['params']['id']},'include':[{'model':db[_0x9113('0xb3')],'as':_0x9113('0xb4'),'include':[{'model':db[_0x9113('0xa6')],'as':_0x9113('0xb5'),'where':_0x3b4a49,'limit':0x1,'order':[[_0x9113('0xaa'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x9113('0xb6')},{'model':db[_0x9113('0x41')],'as':_0x9113('0x41'),'include':[{'model':db['Interval'],'as':_0x9113('0x42'),'attributes':['id',_0x9113('0x37')],'raw':!![]}]}]});})[_0x9113('0x2b')](function(_0x586c30){if(!_0x586c30)throw new APINotFoundError(util['format'](_0x9113('0xb7'),_0x459f94[_0x9113('0x71')]['id']));if(!_0x586c30['Interval']||!_0x586c30[_0x9113('0x41')][_0x9113('0x42')])return[_0x586c30,!![]];return[_0x586c30,checkWebsiteIntervals(_0x586c30)];})[_0x9113('0xb8')](function(_0x49d6ba,_0x5eb902){if(!_0x5eb902)throw new APIOutOfIntervalError();if(!_0x49d6ba[_0x9113('0xb4')])return;_0x444ce8[_0x9113('0xb9')]=_0x49d6ba;_0x444ce8[_0x9113('0xba')]=_0x49d6ba[_0x9113('0xb4')];_0x444ce8[_0x9113('0xbb')]=_[_0x9113('0xbc')](_0x49d6ba[_0x9113('0xb6')],[_0x9113('0xbd')],[_0x9113('0xbe')]);if(_0x444ce8[_0x9113('0xb9')][_0x9113('0xb6')]){delete _0x444ce8[_0x9113('0xb9')][_0x9113('0xb6')];}if(_0x444ce8[_0x9113('0xb9')]['List']&&_0x444ce8[_0x9113('0xb9')][_0x9113('0xb4')][_0x9113('0xb5')][_0x9113('0x63')]){return _0x444ce8[_0x9113('0xb9')][_0x9113('0xb4')][_0x9113('0xb5')][0x0];}var _0x198dc1=_[_0x9113('0x14')](_0x459f94[_0x9113('0x7a')],{'firstName':_0x459f94['body'][_0x9113('0xac')],'ListId':_0x49d6ba[_0x9113('0xab')]});_0x198dc1[_0x459f94['body'][_0x9113('0xb1')]]=_0x459f94[_0x9113('0x7a')][_0x9113('0xac')];return db[_0x9113('0xa6')]['create'](_0x198dc1,{'fields':_0x4fed7f,'raw':!![]});})[_0x9113('0x2b')](function(_0x4de2a7){_0x444ce8[_0x9113('0xbf')]=_0x4de2a7;var _0x34ff8b=createInteractionObject(_0x459f94[_0x9113('0x71')]['id'],_0x459f94[_0x9113('0x7a')],_0x459f94[_0x9113('0xc0')],_0x4de2a7);var _0x16405d={'ChatWebsiteId':_0x459f94['params']['id'],'closed':![]};if(_0x459f94['body']['threadId']){_0x16405d[_0x9113('0xc1')]=_0x459f94['body'][_0x9113('0xc1')];return db[_0x9113('0xc2')][_0x9113('0x73')]({'where':_0x16405d})[_0x9113('0x2b')](function(_0x2b7c5){if(_0x2b7c5){_0x42a65a=!![];return _0x2b7c5;}_0x34ff8b[_0x9113('0xc1')]=_0x459f94['body'][_0x9113('0xc1')];_0x34ff8b[_0x9113('0xc3')]=_0x459f94[_0x9113('0x7a')][_0x9113('0xc3')];return db[_0x9113('0xc2')][_0x9113('0x74')](_0x34ff8b);});}_0x16405d['ContactId']=_0x4de2a7['id'];if(_0x459f94['body'][_0x9113('0xc4')]&&_0x459f94[_0x9113('0x7a')][_0x9113('0xc4')]['id']){_0x16405d['id']=_0x459f94[_0x9113('0x7a')]['interaction']['id'];return db[_0x9113('0xc2')]['find']({'where':_0x16405d})['then'](function(_0x2f19da){if(_0x2f19da){_0x42a65a=!![];return _0x2f19da;}return db[_0x9113('0xc2')][_0x9113('0x74')](_0x34ff8b);});}return db[_0x9113('0xc2')]['create'](_0x34ff8b);})[_0x9113('0x2b')](function(_0x4df2a2){if(!_0x42a65a)return _0x4df2a2;var _0x4a2471={'from':(_0x444ce8[_0x9113('0xbf')][_0x9113('0x4d')]||'')+'\x20'+(_0x444ce8[_0x9113('0xbf')]['lastName']||'')};if(_0x459f94[_0x9113('0x7a')][_0x9113('0xc1')]&&_0x459f94[_0x9113('0x7a')][_0x9113('0xc5')]&&_0x459f94[_0x9113('0x7a')]['threadId']!=_0x459f94[_0x9113('0x7a')]['messageId']){_0x4a2471['threadId']=_0x459f94[_0x9113('0x7a')][_0x9113('0xc5')];}return _0x4df2a2[_0x9113('0x2a')](_0x4a2471);})[_0x9113('0x2b')](function(_0x1b3ef7){_0x444ce8[_0x9113('0xc4')]=_0x1b3ef7[_0x9113('0x2d')]({'plain':!![]});_0x444ce8[_0x9113('0xc4')][_0x9113('0xc6')]=!_0x42a65a;if(_0x444ce8[_0x9113('0xc4')]['created']){if(_0x444ce8[_0x9113('0xb9')][_0x9113('0xc7')]){_0x444ce8[_0x9113('0xbb')]['push']({'id':0x0,'priority':_0x444ce8['applications'][_0x9113('0x63')]+0x1,'app':'close','appdata':_0x9113('0xc8'),'interval':_0x9113('0xc9')});}}return db['ChatMessage']['create']({'body':_0x459f94['body']['body'],'ChatWebsiteId':_0x459f94[_0x9113('0x71')]['id'],'ChatInteractionId':_0x1b3ef7['id'],'direction':'in','ContactId':_0x444ce8['contact']['id'],'AttachmentId':_0x459f94[_0x9113('0x7a')][_0x9113('0xca')]});})[_0x9113('0x2b')](function(_0x2f31a8){_0x444ce8[_0x9113('0x1f')]=_0x2f31a8;if(!_0x444ce8[_0x9113('0xc4')]['UserId']){return;}return db['User'][_0x9113('0x73')]({'attributes':['id',_0x9113('0x31')],'where':{'id':_0x444ce8['interaction'][_0x9113('0xcb')]}});})[_0x9113('0x2b')](function(_0x5c5b3e){if(_0x5c5b3e){_0x444ce8[_0x9113('0xbb')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9113('0xcc'),'appdata':_0x5c5b3e[_0x9113('0x31')]+','+(_0x444ce8[_0x9113('0xb9')][_0x9113('0xcd')]||0xa),'interval':'*,*,*,*'});_0x444ce8['forcedOwnership']=!![];}if(!_0x444ce8['interaction'][_0x9113('0xce')]){return;}return db[_0x9113('0xcf')]['find']({'attributes':['id','name'],'where':{'id':_0x444ce8[_0x9113('0xc4')][_0x9113('0xce')]}});})[_0x9113('0x2b')](function(_0x356503){if(_0x356503){_0x444ce8['applications'][_0x9113('0xd0')]({'id':0x0,'priority':0x1,'app':_0x9113('0xd1'),'appdata':_0x356503[_0x9113('0x31')]+','+(_0x444ce8['account'][_0x9113('0xd2')]||0x12c),'interval':_0x9113('0xc9')});}return respondWithRpcPromise(_0x9113('0xd3'),'startRouting',_0x444ce8);})[_0x9113('0x2b')](function(_0x538efb){respondWithRpcPromise(_0x9113('0xd4'),_0x9113('0xd4'),{'event':'notify','message':_0x538efb},client9002);return _0x538efb;})[_0x9113('0x2b')](respondWithResult(_0x554f51,null))['catch'](APIHandleError(_0x554f51));};exports['offline']=function(_0x5ec7c1,_0x55a4c2){var _0x572fb1,_0x51801f,_0x2ad2ce;var _0x821a00=[];var _0x54400b={};var _0x504e3d=_0x5ec7c1[_0x9113('0xd5')]||[];var _0x39ca49=[];var _0x48cdcc;return db[_0x9113('0xa6')][_0x9113('0x7b')]()[_0x9113('0x2b')](function(_0x510078){if(!_0x510078){throw new db['Sequelize'][(_0x9113('0xa7'))](_0x9113('0xd6'));}_0x821a00=_['difference'](_['keys'](_0x510078),['createdAt',_0x9113('0xaa'),_0x9113('0xd7'),_0x9113('0xab')]);if(_0x5ec7c1[_0x9113('0x7a')]['id']){delete _0x5ec7c1['body']['id'];}if(_['isNil'](_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')])){throw _0x55a4c2[_0x9113('0x23')](0x1f4)['send'](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))]('from\x20is\x20mandatory'));}if(_[_0x9113('0x98')](_0x5ec7c1[_0x9113('0x7a')][_0x9113('0x7a')])||_0x5ec7c1[_0x9113('0x7a')][_0x9113('0x7a')]===''){throw _0x55a4c2[_0x9113('0x23')](0x1f4)[_0x9113('0x32')](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xaf')));}if(_['isNil'](_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xd8')])){throw _0x55a4c2[_0x9113('0x23')](0x1f4)[_0x9113('0x32')](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x821a00));}if(!_[_0x9113('0xb0')](_0x821a00,_0x5ec7c1['body']['mapKeyOffline'])){throw _0x55a4c2['status'](0x1f4)[_0x9113('0x32')](new db[(_0x9113('0xad'))][(_0x9113('0xa7'))](_0x9113('0xd9')+_0x821a00));}_0x54400b[_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xd8')]]=_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')];})[_0x9113('0x2b')](function(){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x5ec7c1[_0x9113('0x71')]['id']},'include':[{'model':db[_0x9113('0xb3')],'as':_0x9113('0xb4')},{'model':db['MailAccount'],'as':_0x9113('0xda')}]});})['then'](handleEntityNotFound(_0x55a4c2,null))[_0x9113('0x2b')](function(_0x7174fa){if(_0x7174fa&&_0x7174fa['List']){_0x51801f=_0x7174fa;var _0x41f322=_[_0x9113('0x14')](_0x5ec7c1[_0x9113('0x7a')],{'firstName':_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')],'phone':_0x5ec7c1['body'][_0x9113('0xac')],'ListId':_0x7174fa[_0x9113('0xab')]});_0x41f322[_0x5ec7c1[_0x9113('0x7a')]['mapKeyOffline']]=_0x5ec7c1[_0x9113('0x7a')][_0x9113('0xac')];return db[_0x9113('0xa6')][_0x9113('0xdb')]({'where':_0x54400b,'defaults':_0x41f322});}})['spread'](function(_0x1a5648){if(_0x1a5648){_0x2ad2ce=_0x1a5648;var _0x361012=fs[_0x9113('0xdc')](path[_0x9113('0x93')](config['root'],_0x9113('0xdd')),_0x9113('0xde'));var _0x262aca=ejs['render'](_0x361012,{'body':_[_0x9113('0xdf')](_0x5ec7c1['body'][_0x9113('0x7a')]),'bodyTitle':_0x51801f['offlineMessageBody']});return db['ChatOfflineMessage'][_0x9113('0x74')]({'body':_0x262aca,'plainBody':htmlToText[_0x9113('0xe0')](_0x262aca),'ContactId':_0x1a5648['id'],'ChatWebsiteId':_0x51801f['id']});}})[_0x9113('0x2b')](function(_0x1e4406){_0x48cdcc=_0x1e4406;if(_0x504e3d[_0x9113('0x63')]){var _0x4ea56c=_0x504e3d[_0x9113('0x40')](function(_0x4744af){return{'name':_0x4744af[_0x9113('0xe1')],'basename':_0x4744af['filename'],'type':_0x4744af[_0x9113('0xe2')],'ChatOfflineMessageId':_0x1e4406['id']};});_0x39ca49=_0x4ea56c[_0x9113('0x40')](_0x5169ad=>{var _0x5ce14d={'filename':_0x5169ad[_0x9113('0x31')],'path':path['join'](config[_0x9113('0x94')],_0x9113('0xe3'),_0x9113('0xd5'),_0x9113('0xe4'),_0x9113('0xe5'),_0x5169ad[_0x9113('0xe6')])};return _0x5ce14d;});if(!_0x51801f[_0x9113('0xe7')]){return db[_0x9113('0xe8')][_0x9113('0xe9')](function(_0x14f3d8){return db['Attachment'][_0x9113('0xea')](_0x4ea56c,{'transaction':_0x14f3d8});});}}})[_0x9113('0x2b')](function(){if(_0x48cdcc){_0x572fb1=_0x48cdcc;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x9113('0xeb'),'raw':!![],'include':[{'model':db[_0x9113('0xec')],'as':_0x9113('0xec'),'raw':!![]}]}]});}})[_0x9113('0x2b')](function(_0x46473d){if(_0x46473d&&_0x46473d['Smtp']&&_0x51801f[_0x9113('0xed')]&&_0x51801f['forwardOfflineAddress']){var _0x2fd0e2=_0x46473d[_0x9113('0xee')]();return respondWithRpcPromise(_0x9113('0xef'),_0x9113('0xf0'),{'account':_0x2fd0e2,'message':{'from':util[_0x9113('0x35')](_0x9113('0xf1'),_0x46473d[_0x9113('0x31')],_0x46473d[_0x9113('0xf2')]||_0x46473d[_0x9113('0xeb')][_0x9113('0x75')]),'to':_0x51801f[_0x9113('0xf3')],'subject':_0x51801f[_0x9113('0xf4')],'html':_0x572fb1[_0x9113('0x7a')],'attachments':_0x39ca49}},client9003)[_0x9113('0x2b')](function(){return _0x572fb1;})['catch'](function(_0xd65505){logger[_0x9113('0x1e')](_0xd65505);});}})[_0x9113('0x2b')](function(){if(_0x51801f&&_0x51801f[_0x9113('0xe7')]&&_0x51801f[_0x9113('0xf5')]){var _0x438850=[];if(_0x504e3d[_0x9113('0x63')]){_0x438850=_0x504e3d['map'](function(_0x4f7446){return{'name':_0x4f7446[_0x9113('0xe1')],'basename':_0x4f7446['filename'],'type':_0x4f7446['mimetype'],'ChatOfflineMessageId':_0x48cdcc['id']};});}var _0x22ac3f;if(!_['isNil'](_0x51801f[_0x9113('0xf6')])){var _0xfa8747=_[_0x9113('0x40')](_0x5ec7c1[_0x9113('0x7a')],function(_0x2d7fd1){return _0x2d7fd1;});var _0x519c86=_['toPairsIn'](_0xfa8747)[0x0];var _0x37ab18=_[_0x9113('0xf7')](_0x519c86,function(_0x229fdd){return _0x229fdd;});_0x22ac3f=_0x37ab18[0x1][_0x51801f[_0x9113('0xf6')]];}var _0x664e63={'from':_0x2ad2ce[_0x9113('0xf2')],'firstName':_0x2ad2ce[_0x9113('0x4d')],'lastName':_0x2ad2ce[_0x9113('0x4e')],'mapKey':_0x9113('0xf2'),'message':{'from':_0x2ad2ce[_0x9113('0xf2')],'to':_0x51801f[_0x9113('0xda')][_0x9113('0xf2')],'cc':'','subject':_['isNil'](_0x22ac3f)?_0x51801f[_0x9113('0xf4')]:_0x22ac3f,'messageId':'','sentAt':new Date(),'attach':_0x438850[_0x9113('0x63')],'attachments':_0x438850,'originChannel':_0x9113('0xf8'),'ChatWebsiteId':_0x51801f['id'],'ChatOfflineMessageId':_0x572fb1['id'],'originTo':_0x51801f[_0x9113('0xda')][_0x9113('0xf2')]},'body':_0x572fb1[_0x9113('0x7a')]};var _0x59b0af={'account':{'id':_0x51801f['MailAccountId']},'body':_0x664e63,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x9113('0xf9'),_0x9113('0xfa'),_0x59b0af,client9001)[_0x9113('0x2b')](function(){return _0x572fb1;})[_0x9113('0x70')](function(_0x239c5f){logger[_0x9113('0x1e')](_0x239c5f);});}return;})[_0x9113('0x2b')](function(){if(_0x572fb1){return _0x572fb1;}})['then'](respondWithResult(_0x55a4c2,null))['catch'](function(){for(var _0x52a9f4 of _0x504e3d){var _0x1d73f5=path['join'](config['root'],_0x9113('0xe3'),'files',_0x9113('0xe4'),'offline-chat',_0x52a9f4[_0x9113('0x8c')]);fs_extra[_0x9113('0xfb')](_0x1d73f5)[_0x9113('0x70')](function(_0x1ae839){logger[_0x9113('0x1e')](_0x9113('0xfc'),_0x1d73f5,_0x1ae839);});}});};exports[_0x9113('0xfd')]=function(_0x1f772b,_0x651dac){return db['ChatInteraction'][_0x9113('0x73')]({'where':{'id':_0x1f772b[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x651dac,null))[_0x9113('0x2b')](function(_0x4a011c){if(_0x4a011c){return _0x4a011c[_0x9113('0xfd')](_0x1f772b['body'][_0x9113('0x84')],_['omit'](_0x1f772b[_0x9113('0x7a')],['ids','id'])||{});}})[_0x9113('0x2b')](respondWithResult(_0x651dac,null))['catch'](handleError(_0x651dac,null));};exports[_0x9113('0xfe')]=function(_0x12fe46,_0x3e7821){var _0x2456b5={'raw':![],'where':{}};var _0x5be781={};var _0x1f7170={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9113('0x87')]({'where':{'id':_0x12fe46['params']['id']}})['then'](handleEntityNotFound(_0x3e7821,null))[_0x9113('0x2b')](function(_0x1f5295){if(_0x1f5295){_0x5be781[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0xc2')][_0x9113('0x80')]);_0x5be781['query']=_[_0x9113('0x5d')](_0x12fe46[_0x9113('0x5e')]);_0x5be781[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x5be781[_0x9113('0x55')],_0x5be781[_0x9113('0x5e')]);_0x2456b5[_0x9113('0x60')]=_['intersection'](_0x5be781[_0x9113('0x55')],qs[_0x9113('0x62')](_0x12fe46['query'][_0x9113('0x62')]));_0x2456b5[_0x9113('0x60')]=_0x2456b5[_0x9113('0x60')][_0x9113('0x63')]?_0x2456b5['attributes']:_0x5be781[_0x9113('0x55')];if(!_0x12fe46['query'][_0x9113('0x64')](_0x9113('0x65'))){_0x2456b5[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x12fe46[_0x9113('0x5e')][_0x9113('0x25')]);_0x2456b5[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x12fe46[_0x9113('0x5e')][_0x9113('0x24')]);}_0x2456b5[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x12fe46[_0x9113('0x5e')][_0x9113('0x67')]);_0x2456b5[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x12fe46['query'],_0x5be781[_0x9113('0x5f')]));_0x2456b5[_0x9113('0x68')]['ChatWebsiteId']=_0x1f5295['id'];if(_0x12fe46[_0x9113('0x5e')][_0x9113('0x6a')]){_0x2456b5[_0x9113('0x68')]=_['merge'](_0x2456b5[_0x9113('0x68')],{'$or':_['map'](_0x2456b5[_0x9113('0x60')],function(_0x5435dc){var _0x58b378={};_0x58b378[_0x5435dc]={'$like':'%'+_0x12fe46[_0x9113('0x5e')]['filter']+'%'};return _0x58b378;})});}_0x2456b5=_[_0x9113('0x6b')]({},_0x2456b5,_0x12fe46[_0x9113('0x6d')]);return db[_0x9113('0xc2')][_0x9113('0x27')]({'where':_0x2456b5['where']})['then'](function(_0x61e2b){_0x1f7170['count']=_0x61e2b;if(_0x12fe46[_0x9113('0x5e')]['includeAll']){_0x2456b5['include']=[{'model':db[_0x9113('0xa6')],'as':_0x9113('0xff'),'required':![]},{'model':db['User'],'as':_0x9113('0x100'),'attributes':[_0x9113('0x31'),_0x9113('0x101'),'internal'],'required':![]},{'model':db[_0x9113('0x102')],'as':_0x9113('0x103'),'attributes':['id',_0x9113('0x31'),'color'],'where':_0x12fe46[_0x9113('0x5e')][_0x9113('0x104')]?{'id':_0x12fe46[_0x9113('0x5e')][_0x9113('0x104')]}:undefined,'required':_0x12fe46[_0x9113('0x5e')][_0x9113('0x104')]?!![]:![]}];}return db[_0x9113('0xc2')][_0x9113('0x6f')](_0x2456b5);})['then'](function(_0x1586da){_0x1f7170[_0x9113('0x82')]=_0x1586da;return _0x1f7170;});}})[_0x9113('0x2b')](respondWithFilteredResult(_0x3e7821,_0x2456b5))[_0x9113('0x70')](handleError(_0x3e7821,null));};exports[_0x9113('0x105')]=function(_0x3696d0,_0x3d2a29){var _0x7337e4=0x0;var _0x1b9b08=0x0;var _0x347f9a=![];var _0x1a79bc;var _0x474e97;return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x3696d0['params']['id']},'include':[{'model':db['Interval'],'as':_0x9113('0x41'),'include':[{'model':db[_0x9113('0x41')],'as':_0x9113('0x42'),'attributes':['id',_0x9113('0x37')]}]}]})['then'](handleEntityNotFound(_0x3d2a29,null))[_0x9113('0x2b')](function(_0x32f7c7){if(_0x32f7c7){_0x1a79bc=_0x32f7c7;return _0x32f7c7['getProactiveActions']({'raw':!![]});}})['then'](function(_0xe8f1ed){if(_0x1a79bc){if(_0xe8f1ed){_0x474e97=_0xe8f1ed;}}return require(_0x9113('0x96'))[_0x9113('0x106')]();})[_0x9113('0x2b')](function(_0x43a949){if(_0x43a949){_0x1b9b08=_0x43a949[_0x9113('0x107')];_0x347f9a=_0x43a949['custom'];}})[_0x9113('0x2b')](function(){return db[_0x9113('0xc2')]['count']({'where':{'closed':![]}});})[_0x9113('0x2b')](function(_0x25d00d){_0x7337e4=_0x25d00d;if(_0x1b9b08&&_0x25d00d>_0x1b9b08){return db[_0x9113('0x108')][_0x9113('0x87')]({'where':{'id':0x1}})[_0x9113('0x2b')](function(_0x2e2d98){if(_0x2e2d98){_0x2e2d98[_0x9113('0x109')](_0x9113('0x10a'));}});}})[_0x9113('0x2b')](function(){if(!_0x1a79bc['Interval']||!_0x1a79bc[_0x9113('0x41')][_0x9113('0x42')])return!![];return checkWebsiteIntervals(_0x1a79bc);})['then'](function(_0x23c7d2){var _0x108bd4=fs[_0x9113('0xdc')](path[_0x9113('0x93')](config['root'],_0x9113('0x10b')),_0x9113('0xde'));var _0x12c852=new url[(_0x9113('0x10c'))](_0x1a79bc['address'])[_0x9113('0x10d')];var _0x1e6b43=_0x9113('0x10e');var _0x13907d=![];var _0x1666e9={'chatVersion':_0x1e6b43,'chatWebsiteAddressOrigin':_0x12c852,'remote':_0x1a79bc[_0x9113('0x10f')],'query':querystring[_0x9113('0x58')](_['merge'](_0x1a79bc[_0x9113('0x2d')]({'plain':!![]}),{'customerIp':_0x3696d0[_0x9113('0xc0')][_0x9113('0x4a')]||_0x3696d0[_0x9113('0xc0')][_0x9113('0x110')]||_0x3696d0['connection'][_0x9113('0x111')]||_0x3696d0['ip'],'referer':_0x3696d0[_0x9113('0xc0')]['referer'],'openedInteractions':_0x7337e4,'maxInteractions':_0x1b9b08,'virtual':_0x347f9a[_0x9113('0x107')],'online':_0x23c7d2,'custom':_0x347f9a}))[_0x9113('0x112')](/'/g,'\x5c\x27')};_0x3d2a29[_0x9113('0x32')](ejs['render'](Mustache[_0x9113('0x113')](_0x108bd4,_0x1666e9),{'proactiveActions':_0x474e97,'alignment':_0x1a79bc[_0x9113('0x114')],'verticalAlignment':_0x1a79bc[_0x9113('0x115')],'div_color':_0x1a79bc[_0x9113('0x116')],'labelText':_0x1a79bc[_0x9113('0x117')],'text_color':_0x1a79bc['textColor'],'text_button_color':_0x1a79bc['textButtonColor'],'button_color':_0x1a79bc[_0x9113('0x118')],'background_color':_0x1a79bc[_0x9113('0x119')],'hideWhenOffline':_0x1a79bc[_0x9113('0x11a')],'intervalId':_0x1a79bc[_0x9113('0x11b')],'isDevelopment':_0x13907d,'chatVersion':_0x1e6b43}));})[_0x9113('0x70')](handleError(_0x3d2a29,null));};exports[_0x9113('0x11c')]=function(_0x1789ff,_0x36368b){var _0xc317c5=_0x1789ff['params']['id'];var _0x566264=_0x1789ff['body'];var _0x78914c=0xc8;var _0x472ab2=null;return db[_0x9113('0xe8')][_0x9113('0xe9')]({'isolationLevel':db['sequelize'][_0x9113('0x11d')][_0x9113('0x11e')][_0x9113('0x11f')]},function(_0x4b7ba2){return db[_0x9113('0x5a')]['findOne']({'where':{'id':_0xc317c5},'transaction':_0x4b7ba2})[_0x9113('0x2b')](function(_0x390eb0){if(_0x390eb0){return db['ChatApplication'][_0x9113('0x2c')]({'where':{'ChatWebsiteId':_0xc317c5},'transaction':_0x4b7ba2})[_0x9113('0x2b')](function(){var _0x2cee19=_[_0x9113('0x40')](_0x566264,function(_0x2bbd92){_0x2bbd92['ChatWebsiteId']=_0xc317c5;return _0x2bbd92;});return db['ChatApplication']['bulkCreate'](_0x2cee19,{'transaction':_0x4b7ba2});});}else{_0x78914c=0x194;_0x472ab2=[];}});})['then'](function(){if(_0x78914c!==0x194){return db[_0x9113('0x120')][_0x9113('0x121')]({'where':{'ChatWebsiteId':_0xc317c5},'order':_0x9113('0xbd')})[_0x9113('0x2b')](function(_0x34b840){_0x472ab2=_0x34b840;});}})[_0x9113('0x70')](function(_0x4fcccd){_0x78914c=0x1f4;logger[_0x9113('0x1e')](_0x4fcccd['stack']);if(_0x4fcccd[_0x9113('0x31')]){delete _0x4fcccd[_0x9113('0x31')];}_0x472ab2=_0x4fcccd;})[_0x9113('0x122')](function(){if(_0x472ab2===null){_0x36368b[_0x9113('0x21')](_0x78914c);}else{if(_0x78914c===0x1f4){_0x36368b['status'](_0x78914c)[_0x9113('0x32')](_0x472ab2);}else{_0x36368b[_0x9113('0x23')](_0x78914c)['json'](_0x472ab2);}}});};exports[_0x9113('0x123')]=function(_0x5c3ad3,_0xe7382b){var _0x14d17c={};var _0x1ea370={};var _0x425deb;var _0x86a9d0;return db[_0x9113('0x5a')][_0x9113('0x87')]({'where':{'id':_0x5c3ad3['params']['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0xe7382b,null))[_0x9113('0x2b')](function(_0x9e019b){if(_0x9e019b){_0x425deb=_0x9e019b;_0x1ea370[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x120')]['rawAttributes']);_0x1ea370[_0x9113('0x5e')]=_['keys'](_0x5c3ad3[_0x9113('0x5e')]);_0x1ea370[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x1ea370[_0x9113('0x55')],_0x1ea370['query']);_0x14d17c['attributes']=_['intersection'](_0x1ea370[_0x9113('0x55')],qs['fields'](_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x62')]));_0x14d17c[_0x9113('0x60')]=_0x14d17c[_0x9113('0x60')]['length']?_0x14d17c[_0x9113('0x60')]:_0x1ea370[_0x9113('0x55')];_0x14d17c[_0x9113('0x66')]=qs['sort'](_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x67')]);_0x14d17c[_0x9113('0x68')]=qs[_0x9113('0x5f')](_['pick'](_0x5c3ad3[_0x9113('0x5e')],_0x1ea370[_0x9113('0x5f')]));if(_0x5c3ad3['query']['filter']){_0x14d17c[_0x9113('0x68')]=_['merge'](_0x14d17c['where'],{'$or':_[_0x9113('0x40')](_0x14d17c[_0x9113('0x60')],function(_0x23bf98){var _0x2189e2={};_0x2189e2[_0x23bf98]={'$like':'%'+_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x2189e2;})});}_0x14d17c=_[_0x9113('0x6b')]({},_0x14d17c,_0x5c3ad3[_0x9113('0x6d')]);return _0x425deb[_0x9113('0x123')](_0x14d17c);}})[_0x9113('0x2b')](function(_0x20beea){if(_0x20beea){_0x86a9d0=_0x20beea[_0x9113('0x63')];if(!_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x14d17c[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x5c3ad3['query']['limit']);_0x14d17c['offset']=qs[_0x9113('0x24')](_0x5c3ad3[_0x9113('0x5e')][_0x9113('0x24')]);}return _0x425deb[_0x9113('0x123')](_0x14d17c);}})[_0x9113('0x2b')](function(_0x102d5f){if(_0x102d5f){return _0x102d5f?{'count':_0x86a9d0,'rows':_0x102d5f}:null;}})[_0x9113('0x2b')](respondWithResult(_0xe7382b,null))[_0x9113('0x70')](handleError(_0xe7382b,null));};exports['addProactiveActions']=function(_0x52478e,_0x4d80bd){return db[_0x9113('0x124')][_0x9113('0x73')]({'where':{'id':_0x52478e[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x4d80bd,null))[_0x9113('0x2b')](function(_0x4840c8){if(_0x4840c8){return _0x4840c8[_0x9113('0x125')](_0x52478e[_0x9113('0x7a')][_0x9113('0x84')],_['omit'](_0x52478e[_0x9113('0x7a')],[_0x9113('0x84'),'id'])||{});}})[_0x9113('0x2b')](respondWithResult(_0x4d80bd,null))[_0x9113('0x70')](handleError(_0x4d80bd,null));};exports[_0x9113('0x126')]=function(_0x160e20,_0x43352a){var _0x23d6eb={};var _0x11b55c={};var _0x5b5ff7;var _0x4bf171;return db[_0x9113('0x5a')]['findOne']({'where':{'id':_0x160e20[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x43352a,null))[_0x9113('0x2b')](function(_0x42d3e9){if(_0x42d3e9){_0x5b5ff7=_0x42d3e9;_0x11b55c[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x127')][_0x9113('0x80')]);_0x11b55c[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x160e20[_0x9113('0x5e')]);_0x11b55c[_0x9113('0x5f')]=_['intersection'](_0x11b55c['model'],_0x11b55c[_0x9113('0x5e')]);_0x23d6eb['attributes']=_[_0x9113('0x61')](_0x11b55c[_0x9113('0x55')],qs[_0x9113('0x62')](_0x160e20['query'][_0x9113('0x62')]));_0x23d6eb[_0x9113('0x60')]=_0x23d6eb[_0x9113('0x60')][_0x9113('0x63')]?_0x23d6eb[_0x9113('0x60')]:_0x11b55c[_0x9113('0x55')];_0x23d6eb[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x160e20[_0x9113('0x5e')][_0x9113('0x67')]);_0x23d6eb[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x160e20[_0x9113('0x5e')],_0x11b55c[_0x9113('0x5f')]));if(_0x160e20[_0x9113('0x5e')][_0x9113('0x6a')]){_0x23d6eb[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x23d6eb[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x23d6eb[_0x9113('0x60')],function(_0x4193b1){var _0x286a5a={};_0x286a5a[_0x4193b1]={'$like':'%'+_0x160e20[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x286a5a;})});}_0x23d6eb=_[_0x9113('0x6b')]({},_0x23d6eb,_0x160e20[_0x9113('0x6d')]);return _0x5b5ff7[_0x9113('0x126')](_0x23d6eb);}})[_0x9113('0x2b')](function(_0x258933){if(_0x258933){_0x4bf171=_0x258933[_0x9113('0x63')];if(!_0x160e20[_0x9113('0x5e')][_0x9113('0x64')](_0x9113('0x65'))){_0x23d6eb[_0x9113('0x25')]=qs['limit'](_0x160e20['query'][_0x9113('0x25')]);_0x23d6eb['offset']=qs[_0x9113('0x24')](_0x160e20[_0x9113('0x5e')][_0x9113('0x24')]);}return _0x5b5ff7[_0x9113('0x126')](_0x23d6eb);}})['then'](function(_0x449861){if(_0x449861){return _0x449861?{'count':_0x4bf171,'rows':_0x449861}:null;}})['then'](respondWithResult(_0x43352a,null))[_0x9113('0x70')](handleError(_0x43352a,null));};exports[_0x9113('0x128')]=function(_0x35176d,_0x5d561a){var _0x2a7cbb=_0x35176d[_0x9113('0x5e')][_0x9113('0x129')]===_0x9113('0x12a')?_0x9113('0x12b'):_0x9113('0x12c');return db[_0x9113('0x5a')][_0x9113('0x73')]({'attributes':['id',_0x2a7cbb],'where':{'id':_0x35176d[_0x9113('0x71')]['id']}})['then'](handleEntityNotFound(_0x5d561a,null))['then'](function(_0x400c6e){if(_0x400c6e){var _0x50189d=_0x400c6e[_0x2a7cbb];var _0x5b7163=_0x50189d&&_0x50189d[_0x9113('0x12d')]?_0x50189d[_0x9113('0x12d')]:[];_0x5d561a[_0x9113('0x32')]({'fromKey':_[_0x9113('0x98')](_0x50189d['fromKey'])?undefined:_0x50189d[_0x9113('0x12e')],'count':_0x5b7163[_0x9113('0x63')],'rows':_0x5b7163});}})[_0x9113('0x70')](handleError(_0x5d561a,null));};exports['getOfflineMessages']=function(_0x29d20b,_0x233093){var _0xecd0ac={'raw':![],'where':{}};var _0x193361={};var _0x1c3e09={'count':0x0,'rows':[]};return db[_0x9113('0x5a')][_0x9113('0x87')]({'where':{'id':_0x29d20b[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x233093,null))[_0x9113('0x2b')](function(_0x2a3ccc){if(_0x2a3ccc){_0x193361['model']=_[_0x9113('0x5d')](db[_0x9113('0x12f')][_0x9113('0x80')]);_0x193361['query']=_[_0x9113('0x5d')](_0x29d20b[_0x9113('0x5e')]);_0x193361[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x193361[_0x9113('0x55')],_0x193361[_0x9113('0x5e')]);_0xecd0ac['attributes']=_[_0x9113('0x61')](_0x193361['model'],qs[_0x9113('0x62')](_0x29d20b['query'][_0x9113('0x62')]));_0xecd0ac['attributes']=_0xecd0ac[_0x9113('0x60')][_0x9113('0x63')]?_0xecd0ac[_0x9113('0x60')]:_0x193361['model'];if(!_0x29d20b[_0x9113('0x5e')]['hasOwnProperty']('nolimit')){_0xecd0ac[_0x9113('0x25')]=qs[_0x9113('0x25')](_0x29d20b['query'][_0x9113('0x25')]);_0xecd0ac[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x29d20b['query'][_0x9113('0x24')]);}_0xecd0ac[_0x9113('0x66')]=qs['sort'](_0x29d20b[_0x9113('0x5e')][_0x9113('0x67')]);_0xecd0ac[_0x9113('0x68')]=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x29d20b[_0x9113('0x5e')],_0x193361['filters']));_0xecd0ac[_0x9113('0x68')][_0x9113('0x7d')]=_0x2a3ccc['id'];if(_0x29d20b['query'][_0x9113('0x6a')]){_0xecd0ac[_0x9113('0x68')]=_[_0x9113('0x6b')](_0xecd0ac[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0xecd0ac[_0x9113('0x60')],function(_0x33659b){var _0x51dc75={};_0x51dc75[_0x33659b]={'$like':'%'+_0x29d20b[_0x9113('0x5e')][_0x9113('0x6a')]+'%'};return _0x51dc75;})});}_0xecd0ac=_[_0x9113('0x6b')]({},_0xecd0ac,_0x29d20b['options']);return db[_0x9113('0x12f')][_0x9113('0x27')]({'where':_0xecd0ac[_0x9113('0x68')]})[_0x9113('0x2b')](function(_0x23845f){_0x1c3e09['count']=_0x23845f;if(_0x29d20b[_0x9113('0x5e')]['includeAll']){_0xecd0ac[_0x9113('0x81')]=[{'all':!![]}];}else{_0xecd0ac['include']=[{'model':db['CmContact'],'as':_0x9113('0xff'),'required':![]},{'model':db['Attachment'],'as':_0x9113('0x130'),'required':![]}];}return db['ChatOfflineMessage'][_0x9113('0x6f')](_0xecd0ac);})['then'](function(_0x484c81){_0x1c3e09['rows']=_0x484c81;return _0x1c3e09;});}})[_0x9113('0x2b')](respondWithFilteredResult(_0x233093,_0xecd0ac))[_0x9113('0x70')](handleError(_0x233093,null));};exports[_0x9113('0x131')]=function(_0x34dc68,_0x5a84da){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x34dc68[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x5a84da,null))['then'](function(_0x191bbc){if(_0x191bbc){return _0x191bbc['addAgents'](_0x34dc68[_0x9113('0x7a')][_0x9113('0x84')],_[_0x9113('0x132')](_0x34dc68[_0x9113('0x7a')],[_0x9113('0x84'),'id'])||{})[_0x9113('0xb8')](function(_0x553cd4){for(var _0x8efd30=0x0;_0x8efd30<_0x34dc68[_0x9113('0x7a')]['ids'][_0x9113('0x63')];_0x8efd30+=0x1){socket[_0x9113('0x133')](_0x9113('0x134'),{'UserId':Number(_0x34dc68[_0x9113('0x7a')]['ids'][_0x8efd30]),'ChatWebsiteId':Number(_0x34dc68[_0x9113('0x71')]['id'])});}return _0x553cd4;});}})[_0x9113('0x2b')](respondWithResult(_0x5a84da,null))[_0x9113('0x70')](handleError(_0x5a84da,null));};exports[_0x9113('0x135')]=function(_0x17c258,_0x2d14a3){return db[_0x9113('0x5a')][_0x9113('0x73')]({'where':{'id':_0x17c258['params']['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x2d14a3,null))[_0x9113('0x2b')](function(_0x1f60d0){if(_0x1f60d0){return _0x1f60d0[_0x9113('0x135')](_0x17c258[_0x9113('0x5e')]['ids'])[_0x9113('0x2b')](function(){if(_[_0x9113('0x136')](_0x17c258[_0x9113('0x5e')][_0x9113('0x84')])){for(var _0x36b86b=0x0;_0x36b86b<_0x17c258['query']['ids']['length'];_0x36b86b+=0x1){socket[_0x9113('0x133')](_0x9113('0x137'),{'UserId':Number(_0x17c258[_0x9113('0x5e')][_0x9113('0x84')][_0x36b86b]),'ChatWebsiteId':Number(_0x17c258[_0x9113('0x71')]['id'])});}}else{socket[_0x9113('0x133')](_0x9113('0x137'),{'UserId':Number(_0x17c258[_0x9113('0x5e')][_0x9113('0x84')]),'ChatWebsiteId':Number(_0x17c258[_0x9113('0x71')]['id'])});}});}})['then'](respondWithStatusCode(_0x2d14a3,null))[_0x9113('0x70')](handleError(_0x2d14a3,null));};exports[_0x9113('0x138')]=function(_0x440969,_0x5c8653){var _0x553753={};var _0x28aa8b={};var _0x33e12a;var _0x1e929b;return db['ChatWebsite'][_0x9113('0x87')]({'where':{'id':_0x440969[_0x9113('0x71')]['id']}})[_0x9113('0x2b')](handleEntityNotFound(_0x5c8653,null))[_0x9113('0x2b')](function(_0xdeeda9){if(_0xdeeda9){_0x33e12a=_0xdeeda9;_0x28aa8b[_0x9113('0x55')]=_[_0x9113('0x5d')](db[_0x9113('0x139')][_0x9113('0x80')]);_0x28aa8b[_0x9113('0x5e')]=_[_0x9113('0x5d')](_0x440969[_0x9113('0x5e')]);_0x28aa8b[_0x9113('0x5f')]=_[_0x9113('0x61')](_0x28aa8b[_0x9113('0x55')],_0x28aa8b['query']);_0x553753[_0x9113('0x60')]=_[_0x9113('0x61')](_0x28aa8b[_0x9113('0x55')],qs[_0x9113('0x62')](_0x440969['query'][_0x9113('0x62')]));_0x553753[_0x9113('0x60')]=_0x553753[_0x9113('0x60')][_0x9113('0x63')]?_0x553753[_0x9113('0x60')]:_0x28aa8b['model'];_0x553753[_0x9113('0x66')]=qs[_0x9113('0x67')](_0x440969['query']['sort']);_0x553753['where']=qs[_0x9113('0x5f')](_[_0x9113('0x69')](_0x440969['query'],_0x28aa8b[_0x9113('0x5f')]));if(_0x440969[_0x9113('0x5e')]['filter']){_0x553753[_0x9113('0x68')]=_[_0x9113('0x6b')](_0x553753[_0x9113('0x68')],{'$or':_[_0x9113('0x40')](_0x553753[_0x9113('0x60')],function(_0x80d76c){var _0x42f795={};_0x42f795[_0x80d76c]={'$like':'%'+_0x440969[_0x9113('0x5e')]['filter']+'%'};return _0x42f795;})});}_0x553753=_[_0x9113('0x6b')]({},_0x553753,_0x440969[_0x9113('0x6d')]);return _0x33e12a['getAgents'](_0x553753);}})[_0x9113('0x2b')](function(_0x5a918c){if(_0x5a918c){_0x1e929b=_0x5a918c['length'];if(!_0x440969[_0x9113('0x5e')]['hasOwnProperty'](_0x9113('0x65'))){_0x553753['limit']=qs[_0x9113('0x25')](_0x440969[_0x9113('0x5e')][_0x9113('0x25')]);_0x553753[_0x9113('0x24')]=qs[_0x9113('0x24')](_0x440969[_0x9113('0x5e')][_0x9113('0x24')]);}return _0x33e12a['getAgents'](_0x553753);}})[_0x9113('0x2b')](function(_0x308fe3){if(_0x308fe3){return _0x308fe3?{'count':_0x1e929b,'rows':_0x308fe3}:null;}})[_0x9113('0x2b')](respondWithResult(_0x5c8653,null))[_0x9113('0x70')](handleError(_0x5c8653,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 64400c1..40c11cb 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 _0xb6f1=['events','ChatWebsite','save','update','remove','emit','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb6f1,0x118));var _0x1b6f=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xb6f1[_0x2211ed];return _0x4d78cc;};'use strict';var EventEmitter=require(_0x1b6f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x1b6f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1b6f('0x2'),'afterUpdate':_0x1b6f('0x3'),'afterDestroy':_0x1b6f('0x4')};function emitEvent(_0x4cd86b){return function(_0x2cd276,_0x58afbb,_0x3aa4e8){ChatWebsiteEvents[_0x1b6f('0x5')](_0x4cd86b+':'+_0x2cd276['id'],_0x2cd276);ChatWebsiteEvents[_0x1b6f('0x5')](_0x4cd86b,_0x2cd276);_0x3aa4e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x1b6f('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0xee39=['events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3e0f82,_0x3e431b){var _0x3723e3=function(_0x9b827a){while(--_0x9b827a){_0x3e0f82['push'](_0x3e0f82['shift']());}};_0x3723e3(++_0x3e431b);}(_0xee39,0x1e6));var _0x9ee3=function(_0x78ca23,_0x43c558){_0x78ca23=_0x78ca23-0x0;var _0x184831=_0xee39[_0x78ca23];return _0x184831;};'use strict';var EventEmitter=require(_0x9ee3('0x0'));var ChatWebsite=require(_0x9ee3('0x1'))['db'][_0x9ee3('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ee3('0x3'),'afterUpdate':_0x9ee3('0x4'),'afterDestroy':_0x9ee3('0x5')};function emitEvent(_0x3cdeaf){return function(_0x2724c7,_0x3a556a,_0x3398c6){ChatWebsiteEvents[_0x9ee3('0x6')](_0x3cdeaf+':'+_0x2724c7['id'],_0x2724c7);ChatWebsiteEvents[_0x9ee3('0x6')](_0x3cdeaf,_0x2724c7);_0x3398c6(null);};}for(var e in events){if(events[_0x9ee3('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9ee3('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 5b1d356..f5eb388 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 _0x72eb=['util','api','request-promise','path','rimraf','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x35b86c,_0x177411){var _0x1f150e=function(_0x133e36){while(--_0x133e36){_0x35b86c['push'](_0x35b86c['shift']());}};_0x1f150e(++_0x177411);}(_0x72eb,0x185));var _0xb72e=function(_0x20a7ab,_0x11af39){_0x20a7ab=_0x20a7ab-0x0;var _0x5977c2=_0x72eb[_0x20a7ab];return _0x5977c2;};'use strict';var _=require(_0xb72e('0x0'));var util=require(_0xb72e('0x1'));var logger=require('../../config/logger')(_0xb72e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb72e('0x3'));var fs=require('fs');var path=require(_0xb72e('0x4'));var rimraf=require(_0xb72e('0x5'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xb72e('0x6')]=function(_0x21e17f,_0x31e89b){return _0x21e17f[_0xb72e('0x7')](_0xb72e('0x8'),attributes,{'tableName':_0xb72e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f31=['api','moment','bluebird','request-promise','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3c59b7,_0x242aba){var _0x1a5e0=function(_0x32fc7f){while(--_0x32fc7f){_0x3c59b7['push'](_0x3c59b7['shift']());}};_0x1a5e0(++_0x242aba);}(_0x0f31,0x1cb));var _0x10f3=function(_0x4650fa,_0x32b710){_0x4650fa=_0x4650fa-0x0;var _0x196825=_0x0f31[_0x4650fa];return _0x196825;};'use strict';var _=require(_0x10f3('0x0'));var util=require(_0x10f3('0x1'));var logger=require(_0x10f3('0x2'))(_0x10f3('0x3'));var moment=require(_0x10f3('0x4'));var BPromise=require(_0x10f3('0x5'));var rp=require(_0x10f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x10f3('0x7'));module[_0x10f3('0x8')]=function(_0x24e094,_0x165b1b){return _0x24e094['define'](_0x10f3('0x9'),attributes,{'tableName':_0x10f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 247a6b9..69556bd 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 _0xe39e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xe39e,0x127));var _0xee39=function(_0x55f549,_0x4f90ac){_0x55f549=_0x55f549-0x0;var _0x589a78=_0xe39e[_0x55f549];return _0x589a78;};'use strict';var _=require(_0xee39('0x0'));var util=require('util');var moment=require(_0xee39('0x1'));var BPromise=require(_0xee39('0x2'));var rs=require(_0xee39('0x3'));var fs=require('fs');var Redis=require(_0xee39('0x4'));var db=require(_0xee39('0x5'))['db'];var utils=require(_0xee39('0x6'));var logger=require(_0xee39('0x7'))(_0xee39('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xee39('0x9')][_0xee39('0xa')]({'port':0x232a});config[_0xee39('0xb')]=_[_0xee39('0xc')](config[_0xee39('0xb')],{'host':_0xee39('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee39('0xb')]));require(_0xee39('0xe'))[_0xee39('0xf')](socket);function respondWithRpcPromise(_0x15eb1a,_0x373ade,_0x58842c){return new BPromise(function(_0x4c54dc,_0x3cdf81){return client[_0xee39('0x10')](_0x15eb1a,_0x58842c)['then'](function(_0x1a2dcd){logger[_0xee39('0x11')](_0xee39('0x12'),_0x373ade,_0xee39('0x13'));logger[_0xee39('0x14')](_0xee39('0x15'),_0x373ade,_0xee39('0x13'),JSON[_0xee39('0x16')](_0x1a2dcd));if(_0x1a2dcd[_0xee39('0x17')]){if(_0x1a2dcd[_0xee39('0x17')]['code']===0x1f4){logger[_0xee39('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x373ade,_0x1a2dcd['error'][_0xee39('0x18')]);return _0x3cdf81(_0x1a2dcd['error'][_0xee39('0x18')]);}logger[_0xee39('0x17')](_0xee39('0x12'),_0x373ade,_0x1a2dcd['error'][_0xee39('0x18')]);return _0x4c54dc(_0x1a2dcd[_0xee39('0x17')][_0xee39('0x18')]);}else{logger[_0xee39('0x11')](_0xee39('0x12'),_0x373ade,_0xee39('0x13'));_0x4c54dc(_0x1a2dcd[_0xee39('0x19')][_0xee39('0x18')]);}})[_0xee39('0x1a')](function(_0x104a73){logger['error'](_0xee39('0x12'),_0x373ade,_0x104a73);_0x3cdf81(_0x104a73);});});} \ No newline at end of file +var _0x86ee=['localhost','./chatWebsite.socket','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis'];(function(_0x4c639c,_0x2e1398){var _0x3c15b6=function(_0x116d9f){while(--_0x116d9f){_0x4c639c['push'](_0x4c639c['shift']());}};_0x3c15b6(++_0x2e1398);}(_0x86ee,0x66));var _0xe86e=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x86ee[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require(_0xe86e('0x0'));var util=require(_0xe86e('0x1'));var moment=require(_0xe86e('0x2'));var BPromise=require(_0xe86e('0x3'));var rs=require(_0xe86e('0x4'));var fs=require('fs');var Redis=require(_0xe86e('0x5'));var db=require(_0xe86e('0x6'))['db'];var utils=require(_0xe86e('0x7'));var logger=require(_0xe86e('0x8'))('rpc');var config=require(_0xe86e('0x9'));var jayson=require(_0xe86e('0xa'));var client=jayson[_0xe86e('0xb')]['http']({'port':0x232a});config[_0xe86e('0xc')]=_['defaults'](config[_0xe86e('0xc')],{'host':_0xe86e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe86e('0xc')]));require(_0xe86e('0xe'))['register'](socket);function respondWithRpcPromise(_0x558975,_0x1349aa,_0x5deaae){return new BPromise(function(_0xcb0890,_0x1e5a4a){return client['request'](_0x558975,_0x5deaae)['then'](function(_0x267ff8){logger[_0xe86e('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1349aa,_0xe86e('0x10'));logger['debug'](_0xe86e('0x11'),_0x1349aa,'request\x20sent',JSON[_0xe86e('0x12')](_0x267ff8));if(_0x267ff8[_0xe86e('0x13')]){if(_0x267ff8[_0xe86e('0x13')][_0xe86e('0x14')]===0x1f4){logger[_0xe86e('0x13')](_0xe86e('0x15'),_0x1349aa,_0x267ff8[_0xe86e('0x13')][_0xe86e('0x16')]);return _0x1e5a4a(_0x267ff8[_0xe86e('0x13')][_0xe86e('0x16')]);}logger[_0xe86e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1349aa,_0x267ff8[_0xe86e('0x13')]['message']);return _0xcb0890(_0x267ff8[_0xe86e('0x13')][_0xe86e('0x16')]);}else{logger[_0xe86e('0xf')](_0xe86e('0x15'),_0x1349aa,_0xe86e('0x10'));_0xcb0890(_0x267ff8['result'][_0xe86e('0x16')]);}})['catch'](function(_0x331016){logger['error'](_0xe86e('0x15'),_0x1349aa,_0x331016);_0x1e5a4a(_0x331016);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 497259e..3e0c329 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 _0xfd15=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x26d511,_0x26da13){var _0x3d17ea=function(_0x5004ca){while(--_0x5004ca){_0x26d511['push'](_0x26d511['shift']());}};_0x3d17ea(++_0x26da13);}(_0xfd15,0xeb));var _0x5fd1=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xfd15[_0x297fd3];return _0x2af381;};'use strict';var ChatWebsiteEvents=require(_0x5fd1('0x0'));var events=[_0x5fd1('0x1'),_0x5fd1('0x2'),_0x5fd1('0x3')];function createListener(_0x1d8e7f,_0x4c2cc2){return function(_0x1c179b){_0x4c2cc2[_0x5fd1('0x4')](_0x1d8e7f,_0x1c179b);};}function removeListener(_0x2d1607,_0x3399f6){return function(){ChatWebsiteEvents[_0x5fd1('0x5')](_0x2d1607,_0x3399f6);};}exports[_0x5fd1('0x6')]=function(_0x582190){for(var _0x56eb6c=0x0,_0x5ac8be=events[_0x5fd1('0x7')];_0x56eb6c<_0x5ac8be;_0x56eb6c++){var _0x2bf02a=events[_0x56eb6c];var _0x3c6ac9=createListener(_0x5fd1('0x8')+_0x2bf02a,_0x582190);ChatWebsiteEvents['on'](_0x2bf02a,_0x3c6ac9);}}; \ No newline at end of file +var _0xa278=['chatWebsite:','save','remove','update','removeListener','register','length'];(function(_0x324f7f,_0x34504f){var _0x56e96d=function(_0x37d6bb){while(--_0x37d6bb){_0x324f7f['push'](_0x324f7f['shift']());}};_0x56e96d(++_0x34504f);}(_0xa278,0xda));var _0x8a27=function(_0x29f31c,_0x46bbdf){_0x29f31c=_0x29f31c-0x0;var _0x3b6b8a=_0xa278[_0x29f31c];return _0x3b6b8a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x8a27('0x0'),_0x8a27('0x1'),_0x8a27('0x2')];function createListener(_0x4d195b,_0x126800){return function(_0x5b7197){_0x126800['emit'](_0x4d195b,_0x5b7197);};}function removeListener(_0x4138a6,_0x31b896){return function(){ChatWebsiteEvents[_0x8a27('0x3')](_0x4138a6,_0x31b896);};}exports[_0x8a27('0x4')]=function(_0x136e13){for(var _0xe0b746=0x0,_0x22969c=events[_0x8a27('0x5')];_0xe0b746<_0x22969c;_0xe0b746++){var _0x50dacb=events[_0xe0b746];var _0x268289=createListener(_0x8a27('0x6')+_0x50dacb,_0x136e13);ChatWebsiteEvents['on'](_0x50dacb,_0x268289);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index f604d70..43c62b2 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 _0x88f6=['/:id/proactive_actions','addProactiveActions','addAgents','put','update','destroy','delete','/:id/users','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','getFields','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','addLogo','server/files/images/avatars/','single','file','diskStorage','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','/:id/applications','addApplications'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x88f6,0x12a));var _0x688f=function(_0x1bc3c1,_0x400b0b){_0x1bc3c1=_0x1bc3c1-0x0;var _0x32b0d4=_0x88f6[_0x1bc3c1];return _0x32b0d4;};'use strict';var multer=require(_0x688f('0x0'));var util=require(_0x688f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x688f('0x2')]();var fs_extra=require(_0x688f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x688f('0x4'));var config=require(_0x688f('0x5'));var controller=require(_0x688f('0x6'));router['get']('/',auth[_0x688f('0x7')](),controller[_0x688f('0x8')]);router[_0x688f('0x9')](_0x688f('0xa'),auth[_0x688f('0x7')](),controller[_0x688f('0xb')]);router[_0x688f('0x9')](_0x688f('0xc'),auth[_0x688f('0x7')](),controller[_0x688f('0xd')]);router[_0x688f('0x9')](_0x688f('0xe'),auth['isAuthenticated'](),controller[_0x688f('0xf')]);router['get'](_0x688f('0x10'),auth[_0x688f('0x7')](),controller[_0x688f('0x11')]);router['get'](_0x688f('0x12'),controller[_0x688f('0x13')]);router['get'](_0x688f('0x14'),controller[_0x688f('0x15')]);router[_0x688f('0x9')](_0x688f('0x16'),controller[_0x688f('0x17')]);router[_0x688f('0x9')](_0x688f('0x18'),controller[_0x688f('0x19')]);router[_0x688f('0x9')](_0x688f('0x1a'),auth[_0x688f('0x7')](),controller[_0x688f('0x1b')]);router[_0x688f('0x9')](_0x688f('0x1c'),controller[_0x688f('0x1d')]);router[_0x688f('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x688f('0x1e')]);router[_0x688f('0x9')]('/:id/proactive_actions',auth[_0x688f('0x7')](),controller[_0x688f('0x1f')]);router[_0x688f('0x9')]('/:id/fields',controller[_0x688f('0x20')]);router[_0x688f('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0x688f('0x7')](),controller[_0x688f('0x21')]);router[_0x688f('0x22')]('/',auth[_0x688f('0x7')](),controller['create']);router[_0x688f('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x688f('0x23')]);router[_0x688f('0x22')](_0x688f('0x10'),auth['isAuthenticated'](),controller[_0x688f('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c3867,_0x5df163,_0x3566d5){_0x3566d5(null,path[_0x688f('0x25')](config[_0x688f('0x26')],_0x688f('0x27')));},'filename':function(_0x33c893,_0x208b4a,_0x37aeb5){_0x37aeb5(null,util[_0x688f('0x28')](_0x688f('0x29'),Date[_0x688f('0x2a')](),_0x208b4a[_0x688f('0x2b')]));}})});router[_0x688f('0x22')]('/:id/logo',upload['single']('file'),controller[_0x688f('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46289c,_0x5b9538,_0x1a8f8f){_0x1a8f8f(null,path[_0x688f('0x25')](config['root'],_0x688f('0x2d')));},'filename':function(_0x3d0779,_0x3ae260,_0x30eeb5){_0x30eeb5(null,util[_0x688f('0x28')](_0x688f('0x29'),Date[_0x688f('0x2a')](),_0x3ae260[_0x688f('0x2b')]));}})});router['post'](_0x688f('0x14'),upload[_0x688f('0x2e')](_0x688f('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0x688f('0x30')]({'destination':function(_0x181c1a,_0x5f73e4,_0xa0f21f){_0xa0f21f(null,path[_0x688f('0x25')](config[_0x688f('0x26')],_0x688f('0x2d')));},'filename':function(_0x1bb302,_0x43d7cf,_0x5ba7cf){_0x5ba7cf(null,util[_0x688f('0x28')]('%s-%s',Date[_0x688f('0x2a')](),_0x43d7cf[_0x688f('0x2b')]));}})});router[_0x688f('0x22')](_0x688f('0x16'),upload[_0x688f('0x2e')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x426164,_0x416b28,_0x4030ac){_0x4030ac(null,path[_0x688f('0x25')](config[_0x688f('0x26')],_0x688f('0x2d')));},'filename':function(_0x24aa1c,_0x440975,_0x3d3c89){_0x3d3c89(null,util[_0x688f('0x28')]('%s-%s',Date[_0x688f('0x2a')](),_0x440975[_0x688f('0x2b')]));}})});router[_0x688f('0x22')](_0x688f('0x18'),upload['single']('file'),controller[_0x688f('0x31')]);router[_0x688f('0x22')](_0x688f('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0xf4d78b,_0x5b37a0,_0x268156){const _0x2eb845=path[_0x688f('0x25')](config[_0x688f('0x26')],_0x688f('0x33'),_0x688f('0x34'),_0x688f('0x35'));fs_extra[_0x688f('0x36')](_0x2eb845,function(){_0x268156(null,_0x2eb845);});},'filename':function(_0x5e98c2,_0xca6992,_0x43ee36){const _0x4a7697=_0xca6992['originalname'][_0x688f('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4051ce=path[_0x688f('0x38')](_0x4a7697);const _0x434235=Date['now']()+'-'+_0x4a7697['replace'](_0x4051ce,'')+_0x4051ce;_0x43ee36(null,_0x434235);}})});router['post'](_0x688f('0x39'),offlineUploadMulter[_0x688f('0x3a')](),controller['offline']);router[_0x688f('0x22')](_0x688f('0x1a'),auth[_0x688f('0x7')](),controller[_0x688f('0x3b')]);router[_0x688f('0x22')](_0x688f('0x3c'),auth['isAuthenticated'](),controller[_0x688f('0x3d')]);router['post'](_0x688f('0x3e'),auth['isAuthenticated'](),controller[_0x688f('0x3f')]);router[_0x688f('0x22')]('/:id/users',auth[_0x688f('0x7')](),controller[_0x688f('0x40')]);router[_0x688f('0x41')](_0x688f('0xc'),auth[_0x688f('0x7')](),controller[_0x688f('0x42')]);router['delete'](_0x688f('0xc'),auth[_0x688f('0x7')](),controller[_0x688f('0x43')]);router['delete'](_0x688f('0xe'),auth[_0x688f('0x7')](),controller['removeDispositions']);router[_0x688f('0x44')](_0x688f('0x10'),auth[_0x688f('0x7')](),controller['removeAnswers']);router[_0x688f('0x44')](_0x688f('0x45'),auth[_0x688f('0x7')](),controller[_0x688f('0x46')]);module[_0x688f('0x47')]=router; \ No newline at end of file +var _0xf95b=['getOfflineMessages','/:id/users','create','addDisposition','post','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','root','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','extname','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/fields','getFields'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf95b,0x1d8));var _0xbf95=function(_0x3e75a1,_0x47051b){_0x3e75a1=_0x3e75a1-0x0;var _0x456c32=_0xf95b[_0x3e75a1];return _0x456c32;};'use strict';var multer=require('multer');var util=require(_0xbf95('0x0'));var path=require(_0xbf95('0x1'));var timeout=require(_0xbf95('0x2'));var express=require(_0xbf95('0x3'));var router=express[_0xbf95('0x4')]();var fs_extra=require(_0xbf95('0x5'));var auth=require(_0xbf95('0x6'));var interaction=require(_0xbf95('0x7'));var config=require(_0xbf95('0x8'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xbf95('0x9')](),controller[_0xbf95('0xa')]);router[_0xbf95('0xb')](_0xbf95('0xc'),auth[_0xbf95('0x9')](),controller[_0xbf95('0xd')]);router['get'](_0xbf95('0xe'),auth['isAuthenticated'](),controller[_0xbf95('0xf')]);router['get'](_0xbf95('0x10'),auth[_0xbf95('0x9')](),controller['getDispositions']);router[_0xbf95('0xb')](_0xbf95('0x11'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x12')]);router[_0xbf95('0xb')](_0xbf95('0x13'),controller[_0xbf95('0x14')]);router[_0xbf95('0xb')]('/:id/avatar',controller[_0xbf95('0x15')]);router['get'](_0xbf95('0x16'),controller['getCustomerAvatar']);router[_0xbf95('0xb')](_0xbf95('0x17'),controller[_0xbf95('0x18')]);router[_0xbf95('0xb')](_0xbf95('0x19'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x1a')]);router[_0xbf95('0xb')](_0xbf95('0x1b'),controller[_0xbf95('0x1c')]);router[_0xbf95('0xb')]('/:id/applications',auth[_0xbf95('0x9')](),controller[_0xbf95('0x1d')]);router[_0xbf95('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xbf95('0xb')](_0xbf95('0x1e'),controller[_0xbf95('0x1f')]);router[_0xbf95('0xb')]('/:id/offline_messages',auth[_0xbf95('0x9')](),controller[_0xbf95('0x20')]);router[_0xbf95('0xb')](_0xbf95('0x21'),auth[_0xbf95('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xbf95('0x22')]);router['post'](_0xbf95('0x10'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x23')]);router[_0xbf95('0x24')](_0xbf95('0x11'),auth['isAuthenticated'](),controller[_0xbf95('0x25')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x3c893f,_0x200765,_0x10fd29){_0x10fd29(null,path['join'](config['root'],_0xbf95('0x27')));},'filename':function(_0x5ad451,_0x1799ee,_0xd6e15a){_0xd6e15a(null,util[_0xbf95('0x28')](_0xbf95('0x29'),Date[_0xbf95('0x2a')](),_0x1799ee[_0xbf95('0x2b')]));}})});router[_0xbf95('0x24')](_0xbf95('0x13'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x2e')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x5c5e23,_0x2aaf62,_0x59b1f2){_0x59b1f2(null,path[_0xbf95('0x2f')](config[_0xbf95('0x30')],_0xbf95('0x31')));},'filename':function(_0x3090e3,_0x420c7b,_0x12a0d9){_0x12a0d9(null,util[_0xbf95('0x28')](_0xbf95('0x29'),Date['now'](),_0x420c7b[_0xbf95('0x2b')]));}})});router[_0xbf95('0x24')](_0xbf95('0x32'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x33')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x4ebd51,_0x31024b,_0x3771a2){_0x3771a2(null,path[_0xbf95('0x2f')](config[_0xbf95('0x30')],_0xbf95('0x31')));},'filename':function(_0x359e5b,_0x2b010a,_0x2af393){_0x2af393(null,util['format'](_0xbf95('0x29'),Date[_0xbf95('0x2a')](),_0x2b010a[_0xbf95('0x2b')]));}})});router[_0xbf95('0x24')](_0xbf95('0x16'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x34')]);var upload=multer({'storage':multer[_0xbf95('0x26')]({'destination':function(_0x2c4417,_0x39243d,_0x181b1a){_0x181b1a(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x900369,_0x6c82c7,_0xc14dbc){_0xc14dbc(null,util[_0xbf95('0x28')]('%s-%s',Date[_0xbf95('0x2a')](),_0x6c82c7['originalname']));}})});router['post'](_0xbf95('0x17'),upload[_0xbf95('0x2c')](_0xbf95('0x2d')),controller[_0xbf95('0x35')]);router[_0xbf95('0x24')](_0xbf95('0x36'),controller[_0xbf95('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x18aa5f,_0x290732,_0x10aaa2){const _0x5df2fb=path[_0xbf95('0x2f')](config['root'],_0xbf95('0x38'),'attachments','offline-chat');fs_extra[_0xbf95('0x39')](_0x5df2fb,function(){_0x10aaa2(null,_0x5df2fb);});},'filename':function(_0x22f530,_0x372b9c,_0x18c2b6){const _0x1ee5df=_0x372b9c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3292f3=path[_0xbf95('0x3a')](_0x1ee5df);const _0x55e49b=Date['now']()+'-'+_0x1ee5df['replace'](_0x3292f3,'')+_0x3292f3;_0x18c2b6(null,_0x55e49b);}})});router[_0xbf95('0x24')]('/:id/offline',offlineUploadMulter['any'](),controller[_0xbf95('0x3b')]);router[_0xbf95('0x24')](_0xbf95('0x19'),auth['isAuthenticated'](),controller[_0xbf95('0x3c')]);router[_0xbf95('0x24')](_0xbf95('0x3d'),auth['isAuthenticated'](),controller[_0xbf95('0x3e')]);router[_0xbf95('0x24')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xbf95('0x24')]('/:id/users',auth[_0xbf95('0x9')](),controller[_0xbf95('0x3f')]);router[_0xbf95('0x40')](_0xbf95('0xe'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x41')]);router['delete'](_0xbf95('0xe'),auth['isAuthenticated'](),controller[_0xbf95('0x42')]);router['delete'](_0xbf95('0x10'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x43')]);router[_0xbf95('0x44')](_0xbf95('0x11'),auth[_0xbf95('0x9')](),controller[_0xbf95('0x45')]);router[_0xbf95('0x44')](_0xbf95('0x21'),auth['isAuthenticated'](),controller[_0xbf95('0x46')]);module[_0xbf95('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index ff227d7..7f24053 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 _0x8be6=['app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','env','production'];(function(_0x372e2f,_0x3bfdc4){var _0x966e48=function(_0x528e4a){while(--_0x528e4a){_0x372e2f['push'](_0x372e2f['shift']());}};_0x966e48(++_0x3bfdc4);}(_0x8be6,0x158));var _0x68be=function(_0x35baa5,_0xa0c11c){_0x35baa5=_0x35baa5-0x0;var _0x1eb264=_0x8be6[_0x35baa5];return _0x1eb264;};var beaverLogger=require(_0x68be('0x0'));var express=require('express');var auth=require(_0x68be('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x68be('0x2')]===_0x68be('0x3')||![];function clientSideLogs(_0xe05d00,_0x59cd53,_0x4ea281){var _0x179e09=_0xe05d00[_0x68be('0x4')]['get'](_0x68be('0x5'));if(!_0x179e09){throw new Error(_0x68be('0x6'));}return beaverLogger[_0x68be('0x7')]({'uri':_0x68be('0x8'),'logger':_0x179e09,'enableCors':!isProduction})(_0xe05d00,_0x59cd53,_0x4ea281);}router[_0x68be('0x9')](auth[_0x68be('0xa')](),clientSideLogs);module[_0x68be('0xb')]=router; \ No newline at end of file +var _0x04cc=['production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x30eed8,_0x112840){var _0x410c92=function(_0x2eff26){while(--_0x2eff26){_0x30eed8['push'](_0x30eed8['shift']());}};_0x410c92(++_0x112840);}(_0x04cc,0x14b));var _0xc04c=function(_0x521378,_0x2f8004){_0x521378=_0x521378-0x0;var _0x4b2fc4=_0x04cc[_0x521378];return _0x4b2fc4;};var beaverLogger=require(_0xc04c('0x0'));var express=require(_0xc04c('0x1'));var auth=require('../components/auth/service');var config=require(_0xc04c('0x2'));var router=express[_0xc04c('0x3')]();var isProduction=config[_0xc04c('0x4')]===_0xc04c('0x5')||![];function clientSideLogs(_0x3ab21b,_0x22298b,_0x2a2622){var _0x38a3bf=_0x3ab21b['app'][_0xc04c('0x6')](_0xc04c('0x7'));if(!_0x38a3bf){throw new Error(_0xc04c('0x8'));}return beaverLogger[_0xc04c('0x9')]({'uri':_0xc04c('0xa'),'logger':_0x38a3bf,'enableCors':!isProduction})(_0x3ab21b,_0x22298b,_0x2a2622);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xc04c('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 3f5deed..6321f39 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 _0xa3fd=['Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','AmazonAWS'];(function(_0x5baf0c,_0x251fc4){var _0x1dbc27=function(_0x52a6d7){while(--_0x52a6d7){_0x5baf0c['push'](_0x5baf0c['shift']());}};_0x1dbc27(++_0x251fc4);}(_0xa3fd,0x74));var _0xda3f=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0xa3fd[_0x51d129];return _0x44c377;};'use strict';var Sequelize=require('sequelize');module[_0xda3f('0x0')]={'name':{'type':Sequelize[_0xda3f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xda3f('0x2')](_0xda3f('0x3'),_0xda3f('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xda3f('0x5'))},'data1':{'type':Sequelize[_0xda3f('0x1')],'comment':_0xda3f('0x6')},'data2':{'type':Sequelize[_0xda3f('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xda3f('0x1')],'comment':_0xda3f('0x7')},'data4':{'type':Sequelize['STRING'],'comment':_0xda3f('0x8')},'data5':{'type':Sequelize[_0xda3f('0x9')],'comment':_0xda3f('0xa')},'data6':{'type':Sequelize[_0xda3f('0x9')],'comment':_0xda3f('0xb')},'data7':{'type':Sequelize[_0xda3f('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x87d4=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x87d4,0x120));var _0x487d=function(_0x308d77,_0x47a8f3){_0x308d77=_0x308d77-0x0;var _0x54946d=_0x87d4[_0x308d77];return _0x54946d;};'use strict';var Sequelize=require(_0x487d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x487d('0x1'),_0x487d('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x487d('0x3'),_0x487d('0x4'))},'data1':{'type':Sequelize[_0x487d('0x5')],'comment':_0x487d('0x6')},'data2':{'type':Sequelize[_0x487d('0x5')],'comment':_0x487d('0x7')},'data3':{'type':Sequelize[_0x487d('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x487d('0x5')],'comment':_0x487d('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':_0x487d('0x9')},'data6':{'type':Sequelize[_0x487d('0xa')],'comment':_0x487d('0xb')},'data7':{'type':Sequelize[_0x487d('0xa')],'comment':_0x487d('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 1cb66c4..cb85d9e 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 _0x0f61=['error','name','slice','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','service','MicrosoftAzure','data3','catch','show','length','includeAll','include','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','find','params','destroy','oauth2MicrosoftAuthorize','findOne','user','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then'];(function(_0x2adb42,_0xed8b12){var _0x101363=function(_0x1a9d3d){while(--_0x1a9d3d){_0x2adb42['push'](_0x2adb42['shift']());}};_0x101363(++_0xed8b12);}(_0x0f61,0x1ac));var _0x10f6=function(_0x2132f9,_0x12bb36){_0x2132f9=_0x2132f9-0x0;var _0x21fe79=_0x0f61[_0x2132f9];return _0x21fe79;};'use strict';var _=require(_0x10f6('0x0'));var Redis=require(_0x10f6('0x1'));var qs=require(_0x10f6('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x10f6('0x3'));var logger=require(_0x10f6('0x4'))(_0x10f6('0x5'));var db=require(_0x10f6('0x6'))['db'];var oauth=require(_0x10f6('0x7'));config[_0x10f6('0x8')]=_[_0x10f6('0x9')](config[_0x10f6('0x8')],{'host':_0x10f6('0xa'),'port':0x18eb});var socket=require(_0x10f6('0xb'))(new Redis(config['redis']));var redis=new Redis(config[_0x10f6('0x8')]);function respondWithStatusCode(_0x56ba9b,_0x40dd2f){_0x40dd2f=_0x40dd2f||0xcc;return function(_0x340d53){if(_0x340d53){return _0x56ba9b[_0x10f6('0xc')](_0x40dd2f);}return _0x56ba9b[_0x10f6('0xd')](_0x40dd2f)[_0x10f6('0xe')]();};}function respondWithResult(_0x8c0760,_0x44b148){_0x44b148=_0x44b148||0xc8;return function(_0x202463){if(_0x202463){return _0x8c0760[_0x10f6('0xd')](_0x44b148)[_0x10f6('0xf')](_0x202463);}};}function respondWithFilteredResult(_0x411f63,_0x4c1dcf){return function(_0x4b5c51){if(_0x4b5c51){var _0x1cd1a0=typeof _0x4c1dcf[_0x10f6('0x10')]===_0x10f6('0x11')&&typeof _0x4c1dcf[_0x10f6('0x12')]===_0x10f6('0x11');var _0x351777=_0x4b5c51['count'];var _0x391004=_0x1cd1a0?0x0:_0x4c1dcf[_0x10f6('0x10')];var _0x1242e9=_0x1cd1a0?_0x4b5c51[_0x10f6('0x13')]:_0x4c1dcf[_0x10f6('0x10')]+_0x4c1dcf['limit'];var _0x8211f0;if(_0x1242e9>=_0x351777){_0x1242e9=_0x351777;_0x8211f0=0xc8;}else{_0x8211f0=0xce;}_0x411f63[_0x10f6('0xd')](_0x8211f0);return _0x411f63['set'](_0x10f6('0x14'),_0x391004+'-'+_0x1242e9+'/'+_0x351777)[_0x10f6('0xf')](_0x4b5c51);}return null;};}function saveUpdates(_0x1282b4){return function(_0x223c80){if(_0x223c80){return _0x223c80['update'](_0x1282b4)[_0x10f6('0x15')](function(_0x54fe05){return _0x54fe05;});}return null;};}function removeEntity(_0x108244){return function(_0xa337ee){if(_0xa337ee){return _0xa337ee['destroy']()[_0x10f6('0x15')](function(){_0x108244[_0x10f6('0xd')](0xcc)[_0x10f6('0xe')]();});}};}function handleEntityNotFound(_0x24cece){return function(_0x4177f4){if(!_0x4177f4){_0x24cece[_0x10f6('0xc')](0x194);}return _0x4177f4;};}function handleError(_0x2b5d39,_0x37b583){_0x37b583=_0x37b583||0x1f4;return function(_0x1d7985){logger[_0x10f6('0x16')](_0x1d7985['stack']);if(_0x1d7985['name']){delete _0x1d7985[_0x10f6('0x17')];}_0x2b5d39['status'](_0x37b583)['send'](_0x1d7985);};}function maskClientSecret(_0x389da3){return _['padEnd'](_0x389da3[_0x10f6('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x207c4b,_0x57dc90){var _0x6ebace={},_0x43c1b0={},_0x35cb9e={'count':0x0,'rows':[]};var _0x33a55e=_['map'](db[_0x10f6('0x19')][_0x10f6('0x1a')],function(_0x53b8cb){return{'name':_0x53b8cb[_0x10f6('0x1b')],'type':_0x53b8cb[_0x10f6('0x1c')][_0x10f6('0x1d')]};});_0x43c1b0[_0x10f6('0x1e')]=_[_0x10f6('0x1f')](_0x33a55e,'name');_0x43c1b0[_0x10f6('0x20')]=_[_0x10f6('0x21')](_0x207c4b[_0x10f6('0x20')]);_0x43c1b0[_0x10f6('0x22')]=_[_0x10f6('0x23')](_0x43c1b0[_0x10f6('0x1e')],_0x43c1b0[_0x10f6('0x20')]);_0x6ebace[_0x10f6('0x24')]=_[_0x10f6('0x23')](_0x43c1b0['model'],qs[_0x10f6('0x25')](_0x207c4b[_0x10f6('0x20')][_0x10f6('0x25')]));_0x6ebace[_0x10f6('0x24')]=_0x6ebace[_0x10f6('0x24')]['length']?_0x6ebace[_0x10f6('0x24')]:_0x43c1b0[_0x10f6('0x1e')];if(!_0x207c4b[_0x10f6('0x20')][_0x10f6('0x26')](_0x10f6('0x27'))){_0x6ebace[_0x10f6('0x12')]=qs[_0x10f6('0x12')](_0x207c4b['query']['limit']);_0x6ebace[_0x10f6('0x10')]=qs[_0x10f6('0x10')](_0x207c4b[_0x10f6('0x20')][_0x10f6('0x10')]);}_0x6ebace['order']=qs[_0x10f6('0x28')](_0x207c4b[_0x10f6('0x20')]['sort']);_0x6ebace[_0x10f6('0x29')]=qs[_0x10f6('0x22')](_[_0x10f6('0x2a')](_0x207c4b[_0x10f6('0x20')],_0x43c1b0[_0x10f6('0x22')]),_0x33a55e);if(_0x207c4b[_0x10f6('0x20')][_0x10f6('0x2b')]){_0x6ebace[_0x10f6('0x29')]=_[_0x10f6('0x2c')](_0x6ebace['where'],{'$or':_[_0x10f6('0x1f')](_0x33a55e,function(_0x42db5a){if(_0x42db5a[_0x10f6('0x1c')]!==_0x10f6('0x2d')){var _0x135e23={};_0x135e23[_0x42db5a['name']]={'$like':'%'+_0x207c4b[_0x10f6('0x20')][_0x10f6('0x2b')]+'%'};return _0x135e23;}})});}_0x6ebace=_[_0x10f6('0x2c')]({},_0x6ebace,_0x207c4b[_0x10f6('0x2e')]);var _0x21aae9={'where':_0x6ebace['where']};return db[_0x10f6('0x19')][_0x10f6('0x13')](_0x21aae9)['then'](function(_0x2ee416){_0x35cb9e['count']=_0x2ee416;if(_0x207c4b[_0x10f6('0x20')]['includeAll']){_0x6ebace['include']=[{'all':!![]}];}return db[_0x10f6('0x19')][_0x10f6('0x2f')](_0x6ebace);})[_0x10f6('0x15')](function(_0x22d293){_0x35cb9e[_0x10f6('0x30')]=_[_0x10f6('0x1f')](_0x22d293,function(_0x2a4e25){if(_0x2a4e25[_0x10f6('0x31')]===_0x10f6('0x32')){var _0x26bf85=encryptor['decryptString'](_0x2a4e25[_0x10f6('0x33')]);_0x2a4e25[_0x10f6('0x33')]=maskClientSecret(_0x26bf85);}return _0x2a4e25;});return _0x35cb9e;})[_0x10f6('0x15')](respondWithFilteredResult(_0x57dc90,_0x6ebace))[_0x10f6('0x34')](handleError(_0x57dc90,null));};exports[_0x10f6('0x35')]=function(_0x4c746e,_0x24d8e3){var _0xad069e={'raw':!![],'where':{'id':_0x4c746e['params']['id']}},_0x47af7f={};_0x47af7f['model']=_[_0x10f6('0x21')](db['CloudProvider']['rawAttributes']);_0x47af7f[_0x10f6('0x20')]=_['keys'](_0x4c746e[_0x10f6('0x20')]);_0x47af7f[_0x10f6('0x22')]=_['intersection'](_0x47af7f[_0x10f6('0x1e')],_0x47af7f[_0x10f6('0x20')]);_0xad069e[_0x10f6('0x24')]=_['intersection'](_0x47af7f['model'],qs['fields'](_0x4c746e[_0x10f6('0x20')][_0x10f6('0x25')]));_0xad069e[_0x10f6('0x24')]=_0xad069e[_0x10f6('0x24')][_0x10f6('0x36')]?_0xad069e[_0x10f6('0x24')]:_0x47af7f[_0x10f6('0x1e')];if(_0x4c746e[_0x10f6('0x20')][_0x10f6('0x37')]){_0xad069e[_0x10f6('0x38')]=[{'all':!![]}];}_0xad069e=_[_0x10f6('0x2c')]({},_0xad069e,_0x4c746e['options']);return db[_0x10f6('0x19')]['find'](_0xad069e)[_0x10f6('0x15')](handleEntityNotFound(_0x24d8e3,null))['then'](function(_0x3b92ae){if(_0x3b92ae[_0x10f6('0x31')]===_0x10f6('0x32')){var _0x218ba0=encryptor[_0x10f6('0x39')](_0x3b92ae[_0x10f6('0x33')]);_0x3b92ae[_0x10f6('0x33')]=maskClientSecret(_0x218ba0);}return _0x3b92ae;})['then'](respondWithResult(_0x24d8e3,null))[_0x10f6('0x34')](handleError(_0x24d8e3,null));};exports['create']=function(_0x468e5c,_0x35ec84){if(!_0x468e5c[_0x10f6('0x3a')][_0x10f6('0x17')])throw new Error(_0x10f6('0x3b'));if(!_0x468e5c[_0x10f6('0x3a')]['service'])throw new Error(_0x10f6('0x3c'));var _0x22ddea=db[_0x10f6('0x19')]['rawAttributes']['service'][_0x10f6('0x3d')];if(!_0x22ddea[_0x10f6('0x3e')](_0x468e5c[_0x10f6('0x3a')]['service']))throw new Error(_0x10f6('0x3f')+_0x22ddea[_0x10f6('0x40')](',\x20'));if(_0x468e5c[_0x10f6('0x3a')][_0x10f6('0x31')]===_0x10f6('0x32')&&_0x468e5c[_0x10f6('0x3a')]['data3']){_0x468e5c[_0x10f6('0x3a')][_0x10f6('0x33')]=encryptor[_0x10f6('0x41')](_0x468e5c['body'][_0x10f6('0x33')]);}return db[_0x10f6('0x19')]['create'](_0x468e5c['body'],{})[_0x10f6('0x15')](respondWithResult(_0x35ec84,0xc9))[_0x10f6('0x34')](handleError(_0x35ec84,null));};exports[_0x10f6('0x42')]=function(_0x18447b,_0x37f2f9){if(_0x18447b[_0x10f6('0x3a')]['id']){delete _0x18447b[_0x10f6('0x3a')]['id'];}return db[_0x10f6('0x19')][_0x10f6('0x43')]({'where':{'id':_0x18447b[_0x10f6('0x44')]['id']}})['then'](handleEntityNotFound(_0x37f2f9,null))[_0x10f6('0x15')](function(_0x51df38){if(_0x51df38[_0x10f6('0x31')]===_0x10f6('0x32')&&_0x18447b[_0x10f6('0x3a')][_0x10f6('0x33')]){_0x18447b[_0x10f6('0x3a')][_0x10f6('0x33')]=encryptor[_0x10f6('0x41')](_0x18447b[_0x10f6('0x3a')][_0x10f6('0x33')]);}return _0x51df38;})[_0x10f6('0x15')](saveUpdates(_0x18447b['body'],null))[_0x10f6('0x15')](respondWithResult(_0x37f2f9,null))[_0x10f6('0x34')](handleError(_0x37f2f9,null));};exports[_0x10f6('0x45')]=function(_0xb4100c,_0x1c1c2e){return db[_0x10f6('0x19')]['find']({'where':{'id':_0xb4100c['params']['id']}})[_0x10f6('0x15')](handleEntityNotFound(_0x1c1c2e,null))[_0x10f6('0x15')](removeEntity(_0x1c1c2e,null))[_0x10f6('0x34')](handleError(_0x1c1c2e,null));};exports[_0x10f6('0x46')]=function(_0x29204d,_0x5d5404){return db[_0x10f6('0x19')][_0x10f6('0x47')]({'where':{'id':_0x29204d[_0x10f6('0x44')]['id']},'raw':!![]})[_0x10f6('0x15')](function(_0x5a324e){if(!_0x5a324e)return _0x5d5404['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5a324e,_0x29204d[_0x10f6('0x48')]['id'])};})[_0x10f6('0x15')](respondWithResult(_0x5d5404,null))[_0x10f6('0x34')](handleError(_0x5d5404,null));};exports['oauth2MicrosoftCallback']=function(_0x13b317,_0x3ad42c){var _0x3fb6c9=_0x13b317[_0x10f6('0x3a')];var _0x3454aa;var _0x90cf29;if(_0x3fb6c9[_0x10f6('0x16')])throw _0x3fb6c9;redis[_0x10f6('0x49')](_0x3fb6c9[_0x10f6('0x4a')])[_0x10f6('0x15')](function(_0x30fad7){if(!_0x30fad7)throw new Error(_0x10f6('0x4b'));_0x3454aa=JSON[_0x10f6('0x4c')](_0x30fad7);var _0x49debe=Buffer['from'](_0x3fb6c9['state'],_0x10f6('0x4d'))[_0x10f6('0x4e')](_0x10f6('0x4f'));_0x90cf29=JSON[_0x10f6('0x4c')](_0x49debe);if(!oauth[_0x10f6('0x50')](_0x3fb6c9['id_token'],_0x3454aa[_0x10f6('0x51')]))throw new Error(_0x10f6('0x52'));redis['del'](_0x3fb6c9[_0x10f6('0x4a')]);return oauth[_0x10f6('0x53')](_0x3fb6c9[_0x10f6('0x54')],_0x3454aa);})[_0x10f6('0x15')](function(_0x69283c){_0x3454aa[_0x10f6('0x55')]=_0x69283c['access_token'];_0x3454aa[_0x10f6('0x56')]=_0x69283c[_0x10f6('0x57')];return db['CloudProvider']['update']({'data5':_0x3454aa[_0x10f6('0x55')],'data6':_0x3454aa[_0x10f6('0x56')]},{'where':{'id':_0x3454aa['id']}});})[_0x10f6('0x15')](function(){oauth[_0x10f6('0x58')](_0x3454aa);socket['emit']('microsoftAuthorization:success',{'id':_0x90cf29['id']});return;})[_0x10f6('0x15')](respondWithStatusCode(_0x3ad42c,null))['catch'](function(_0x4192a8){if(_0x90cf29){socket[_0x10f6('0x59')]('microsoftAuthorization:error',{'id':_0x90cf29['id']});}if(!_0x3454aa){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x4192a8);return _0x3ad42c[_0x10f6('0xd')](0x1f4)['send'](_0x4192a8['message']);}logger[_0x10f6('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3454aa['id'],JSON['stringify'](_0x4192a8));});}; \ No newline at end of file +var _0x8167=['stringify','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','status','end','offset','limit','count','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','merge','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','findOne','oauth2MicrosoftCallback','get','state','base64','toString','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x8167,0xab));var _0x7816=function(_0x2b1796,_0xcdb779){_0x2b1796=_0x2b1796-0x0;var _0x1e0f44=_0x8167[_0x2b1796];return _0x1e0f44;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x7816('0x0'));var encryptor=require(_0x7816('0x1'));var config=require(_0x7816('0x2'));var logger=require('../../config/logger')(_0x7816('0x3'));var db=require(_0x7816('0x4'))['db'];var oauth=require(_0x7816('0x5'));config[_0x7816('0x6')]=_[_0x7816('0x7')](config['redis'],{'host':_0x7816('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1f7bf7,_0x5f11ef){_0x5f11ef=_0x5f11ef||0xcc;return function(_0x107a14){if(_0x107a14){return _0x1f7bf7['sendStatus'](_0x5f11ef);}return _0x1f7bf7[_0x7816('0x9')](_0x5f11ef)[_0x7816('0xa')]();};}function respondWithResult(_0x3b5b99,_0x4518a6){_0x4518a6=_0x4518a6||0xc8;return function(_0x1ff5c5){if(_0x1ff5c5){return _0x3b5b99[_0x7816('0x9')](_0x4518a6)['json'](_0x1ff5c5);}};}function respondWithFilteredResult(_0x58b717,_0x2fb2f5){return function(_0x20fec3){if(_0x20fec3){var _0x531fb4=typeof _0x2fb2f5[_0x7816('0xb')]==='undefined'&&typeof _0x2fb2f5[_0x7816('0xc')]==='undefined';var _0x41aca0=_0x20fec3['count'];var _0x703620=_0x531fb4?0x0:_0x2fb2f5[_0x7816('0xb')];var _0x2ddbc8=_0x531fb4?_0x20fec3[_0x7816('0xd')]:_0x2fb2f5[_0x7816('0xb')]+_0x2fb2f5[_0x7816('0xc')];var _0x1863d7;if(_0x2ddbc8>=_0x41aca0){_0x2ddbc8=_0x41aca0;_0x1863d7=0xc8;}else{_0x1863d7=0xce;}_0x58b717['status'](_0x1863d7);return _0x58b717[_0x7816('0xe')](_0x7816('0xf'),_0x703620+'-'+_0x2ddbc8+'/'+_0x41aca0)['json'](_0x20fec3);}return null;};}function saveUpdates(_0x4b80f7){return function(_0x406aa6){if(_0x406aa6){return _0x406aa6[_0x7816('0x10')](_0x4b80f7)['then'](function(_0x1cf118){return _0x1cf118;});}return null;};}function removeEntity(_0x503fbe){return function(_0x411aa7){if(_0x411aa7){return _0x411aa7[_0x7816('0x11')]()[_0x7816('0x12')](function(){_0x503fbe[_0x7816('0x9')](0xcc)[_0x7816('0xa')]();});}};}function handleEntityNotFound(_0x50be36){return function(_0x21673f){if(!_0x21673f){_0x50be36[_0x7816('0x13')](0x194);}return _0x21673f;};}function handleError(_0xf12456,_0x427af6){_0x427af6=_0x427af6||0x1f4;return function(_0x2c095c){logger[_0x7816('0x14')](_0x2c095c[_0x7816('0x15')]);if(_0x2c095c[_0x7816('0x16')]){delete _0x2c095c[_0x7816('0x16')];}_0xf12456['status'](_0x427af6)[_0x7816('0x17')](_0x2c095c);};}function maskClientSecret(_0x4562cd){return _[_0x7816('0x18')](_0x4562cd[_0x7816('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x556459,_0x3f9b3f){var _0x18e8ba={},_0x4bbbf3={},_0x360b93={'count':0x0,'rows':[]};var _0x49013e=_[_0x7816('0x1a')](db[_0x7816('0x1b')][_0x7816('0x1c')],function(_0xd48657){return{'name':_0xd48657['fieldName'],'type':_0xd48657[_0x7816('0x1d')][_0x7816('0x1e')]};});_0x4bbbf3[_0x7816('0x1f')]=_[_0x7816('0x1a')](_0x49013e,'name');_0x4bbbf3[_0x7816('0x20')]=_[_0x7816('0x21')](_0x556459[_0x7816('0x20')]);_0x4bbbf3['filters']=_[_0x7816('0x22')](_0x4bbbf3['model'],_0x4bbbf3[_0x7816('0x20')]);_0x18e8ba[_0x7816('0x23')]=_[_0x7816('0x22')](_0x4bbbf3[_0x7816('0x1f')],qs[_0x7816('0x24')](_0x556459[_0x7816('0x20')][_0x7816('0x24')]));_0x18e8ba['attributes']=_0x18e8ba[_0x7816('0x23')][_0x7816('0x25')]?_0x18e8ba[_0x7816('0x23')]:_0x4bbbf3[_0x7816('0x1f')];if(!_0x556459[_0x7816('0x20')][_0x7816('0x26')](_0x7816('0x27'))){_0x18e8ba['limit']=qs[_0x7816('0xc')](_0x556459[_0x7816('0x20')][_0x7816('0xc')]);_0x18e8ba[_0x7816('0xb')]=qs[_0x7816('0xb')](_0x556459[_0x7816('0x20')]['offset']);}_0x18e8ba['order']=qs['sort'](_0x556459[_0x7816('0x20')]['sort']);_0x18e8ba['where']=qs[_0x7816('0x28')](_[_0x7816('0x29')](_0x556459[_0x7816('0x20')],_0x4bbbf3[_0x7816('0x28')]),_0x49013e);if(_0x556459[_0x7816('0x20')][_0x7816('0x2a')]){_0x18e8ba[_0x7816('0x2b')]=_['merge'](_0x18e8ba['where'],{'$or':_[_0x7816('0x1a')](_0x49013e,function(_0x581452){if(_0x581452[_0x7816('0x1d')]!==_0x7816('0x2c')){var _0x57e71e={};_0x57e71e[_0x581452[_0x7816('0x16')]]={'$like':'%'+_0x556459[_0x7816('0x20')][_0x7816('0x2a')]+'%'};return _0x57e71e;}})});}_0x18e8ba=_['merge']({},_0x18e8ba,_0x556459[_0x7816('0x2d')]);var _0x451a1d={'where':_0x18e8ba[_0x7816('0x2b')]};return db['CloudProvider'][_0x7816('0xd')](_0x451a1d)['then'](function(_0x5e3d3d){_0x360b93[_0x7816('0xd')]=_0x5e3d3d;if(_0x556459[_0x7816('0x20')][_0x7816('0x2e')]){_0x18e8ba[_0x7816('0x2f')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x18e8ba);})[_0x7816('0x12')](function(_0x1505c9){_0x360b93[_0x7816('0x30')]=_[_0x7816('0x1a')](_0x1505c9,function(_0x4083e8){if(_0x4083e8[_0x7816('0x31')]===_0x7816('0x32')){var _0x3b137f=encryptor[_0x7816('0x33')](_0x4083e8[_0x7816('0x34')]);_0x4083e8[_0x7816('0x34')]=maskClientSecret(_0x3b137f);}return _0x4083e8;});return _0x360b93;})[_0x7816('0x12')](respondWithFilteredResult(_0x3f9b3f,_0x18e8ba))[_0x7816('0x35')](handleError(_0x3f9b3f,null));};exports[_0x7816('0x36')]=function(_0x3135db,_0x5217a7){var _0x5af2ff={'raw':!![],'where':{'id':_0x3135db[_0x7816('0x37')]['id']}},_0x3afbdf={};_0x3afbdf['model']=_[_0x7816('0x21')](db[_0x7816('0x1b')]['rawAttributes']);_0x3afbdf[_0x7816('0x20')]=_[_0x7816('0x21')](_0x3135db[_0x7816('0x20')]);_0x3afbdf[_0x7816('0x28')]=_[_0x7816('0x22')](_0x3afbdf[_0x7816('0x1f')],_0x3afbdf[_0x7816('0x20')]);_0x5af2ff['attributes']=_[_0x7816('0x22')](_0x3afbdf[_0x7816('0x1f')],qs['fields'](_0x3135db['query'][_0x7816('0x24')]));_0x5af2ff[_0x7816('0x23')]=_0x5af2ff['attributes'][_0x7816('0x25')]?_0x5af2ff['attributes']:_0x3afbdf[_0x7816('0x1f')];if(_0x3135db[_0x7816('0x20')][_0x7816('0x2e')]){_0x5af2ff[_0x7816('0x2f')]=[{'all':!![]}];}_0x5af2ff=_[_0x7816('0x38')]({},_0x5af2ff,_0x3135db['options']);return db[_0x7816('0x1b')][_0x7816('0x39')](_0x5af2ff)[_0x7816('0x12')](handleEntityNotFound(_0x5217a7,null))['then'](function(_0x24d586){if(_0x24d586['service']===_0x7816('0x32')){var _0x367571=encryptor[_0x7816('0x33')](_0x24d586[_0x7816('0x34')]);_0x24d586['data3']=maskClientSecret(_0x367571);}return _0x24d586;})[_0x7816('0x12')](respondWithResult(_0x5217a7,null))[_0x7816('0x35')](handleError(_0x5217a7,null));};exports[_0x7816('0x3a')]=function(_0x191190,_0x40adb6){if(!_0x191190[_0x7816('0x3b')]['name'])throw new Error(_0x7816('0x3c'));if(!_0x191190['body'][_0x7816('0x31')])throw new Error(_0x7816('0x3d'));var _0x3570c8=db[_0x7816('0x1b')][_0x7816('0x1c')][_0x7816('0x31')]['values'];if(!_0x3570c8['includes'](_0x191190[_0x7816('0x3b')]['service']))throw new Error(_0x7816('0x3e')+_0x3570c8['join'](',\x20'));if(_0x191190['body']['service']==='MicrosoftAzure'&&_0x191190['body']['data3']){_0x191190['body'][_0x7816('0x34')]=encryptor[_0x7816('0x3f')](_0x191190['body'][_0x7816('0x34')]);}return db[_0x7816('0x1b')][_0x7816('0x3a')](_0x191190[_0x7816('0x3b')],{})['then'](respondWithResult(_0x40adb6,0xc9))[_0x7816('0x35')](handleError(_0x40adb6,null));};exports[_0x7816('0x10')]=function(_0x26e564,_0x10fafb){if(_0x26e564[_0x7816('0x3b')]['id']){delete _0x26e564[_0x7816('0x3b')]['id'];}return db[_0x7816('0x1b')][_0x7816('0x39')]({'where':{'id':_0x26e564['params']['id']}})[_0x7816('0x12')](handleEntityNotFound(_0x10fafb,null))[_0x7816('0x12')](function(_0x3d1434){if(_0x3d1434['service']===_0x7816('0x32')&&_0x26e564['body'][_0x7816('0x34')]){_0x26e564[_0x7816('0x3b')][_0x7816('0x34')]=encryptor[_0x7816('0x3f')](_0x26e564['body'][_0x7816('0x34')]);}return _0x3d1434;})[_0x7816('0x12')](saveUpdates(_0x26e564['body'],null))[_0x7816('0x12')](respondWithResult(_0x10fafb,null))[_0x7816('0x35')](handleError(_0x10fafb,null));};exports[_0x7816('0x11')]=function(_0x500f90,_0x2e0a77){return db[_0x7816('0x1b')][_0x7816('0x39')]({'where':{'id':_0x500f90[_0x7816('0x37')]['id']}})[_0x7816('0x12')](handleEntityNotFound(_0x2e0a77,null))[_0x7816('0x12')](removeEntity(_0x2e0a77,null))[_0x7816('0x35')](handleError(_0x2e0a77,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e39ed,_0x1d7955){return db[_0x7816('0x1b')][_0x7816('0x40')]({'where':{'id':_0x2e39ed[_0x7816('0x37')]['id']},'raw':!![]})[_0x7816('0x12')](function(_0x15be87){if(!_0x15be87)return _0x1d7955[_0x7816('0x13')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x15be87,_0x2e39ed['user']['id'])};})[_0x7816('0x12')](respondWithResult(_0x1d7955,null))[_0x7816('0x35')](handleError(_0x1d7955,null));};exports[_0x7816('0x41')]=function(_0x4c064f,_0x36c75c){var _0x48b006=_0x4c064f[_0x7816('0x3b')];var _0x474df3;var _0x13a28d;if(_0x48b006['error'])throw _0x48b006;redis[_0x7816('0x42')](_0x48b006[_0x7816('0x43')])['then'](function(_0xb56ca0){if(!_0xb56ca0)throw new Error('Invalid\x20state\x20parameter');_0x474df3=JSON['parse'](_0xb56ca0);var _0x4a78db=Buffer['from'](_0x48b006[_0x7816('0x43')],_0x7816('0x44'))[_0x7816('0x45')]('ascii');_0x13a28d=JSON['parse'](_0x4a78db);if(!oauth['isValidIdToken'](_0x48b006[_0x7816('0x46')],_0x474df3[_0x7816('0x47')]))throw new Error(_0x7816('0x48'));redis[_0x7816('0x49')](_0x48b006[_0x7816('0x43')]);return oauth[_0x7816('0x4a')](_0x48b006['code'],_0x474df3);})[_0x7816('0x12')](function(_0x2162cb){_0x474df3[_0x7816('0x4b')]=_0x2162cb[_0x7816('0x4c')];_0x474df3[_0x7816('0x4d')]=_0x2162cb[_0x7816('0x4e')];return db[_0x7816('0x1b')][_0x7816('0x10')]({'data5':_0x474df3['data5'],'data6':_0x474df3['data6']},{'where':{'id':_0x474df3['id']}});})['then'](function(){oauth[_0x7816('0x4f')](_0x474df3);socket[_0x7816('0x50')](_0x7816('0x51'),{'id':_0x13a28d['id']});return;})[_0x7816('0x12')](respondWithStatusCode(_0x36c75c,null))['catch'](function(_0x33eb2c){if(_0x13a28d){socket[_0x7816('0x50')](_0x7816('0x52'),{'id':_0x13a28d['id']});}if(!_0x474df3){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x33eb2c);return _0x36c75c[_0x7816('0x9')](0x1f4)[_0x7816('0x17')](_0x33eb2c['message']);}logger[_0x7816('0x14')](_0x7816('0x53'),_0x474df3['id'],JSON[_0x7816('0x54')](_0x33eb2c));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 70bc340..7774a25 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 _0x44c3=['api','moment','bluebird','request-promise','../../config/environment','exports','define','CloudProvider','cloud_providers','../../config/logger'];(function(_0xb3e841,_0x14b239){var _0x388801=function(_0x4d4d8f){while(--_0x4d4d8f){_0xb3e841['push'](_0xb3e841['shift']());}};_0x388801(++_0x14b239);}(_0x44c3,0x167));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x344c('0x0'))(_0x344c('0x1'));var moment=require(_0x344c('0x2'));var BPromise=require(_0x344c('0x3'));var rp=require(_0x344c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x344c('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x344c('0x6')]=function(_0x562627,_0x4e9be5){return _0x562627[_0x344c('0x7')](_0x344c('0x8'),attributes,{'tableName':_0x344c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefe3=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash'];(function(_0x552bd8,_0x4f6540){var _0x52fbce=function(_0x1c4cb1){while(--_0x1c4cb1){_0x552bd8['push'](_0x552bd8['shift']());}};_0x52fbce(++_0x4f6540);}(_0xefe3,0x192));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3efe('0x0'));var util=require(_0x3efe('0x1'));var logger=require(_0x3efe('0x2'))(_0x3efe('0x3'));var moment=require('moment');var BPromise=require(_0x3efe('0x4'));var rp=require(_0x3efe('0x5'));var fs=require('fs');var path=require(_0x3efe('0x6'));var rimraf=require(_0x3efe('0x7'));var config=require(_0x3efe('0x8'));var attributes=require(_0x3efe('0x9'));module[_0x3efe('0xa')]=function(_0x9e9697,_0x5404c0){return _0x9e9697[_0x3efe('0xb')](_0x3efe('0xc'),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 c51c18f..b529d51 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 _0xcfd4=['decode','iss','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','refresh_token','data6','decryptString','POST','then','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','map','all','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','api','../../config/schedule/cloud-provider','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','/token','type','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','replace','{TENANT_ID}','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','form_post','scope','state','nonce','prompt','key','value','set'];(function(_0xe4a312,_0x30ab51){var _0x8ef3e8=function(_0x46d92d){while(--_0x46d92d){_0xe4a312['push'](_0xe4a312['shift']());}};_0x8ef3e8(++_0x30ab51);}(_0xcfd4,0x138));var _0x4cfd=function(_0x479bc2,_0xc70b03){_0x479bc2=_0x479bc2-0x0;var _0x3aa11e=_0xcfd4[_0x479bc2];return _0x3aa11e;};'use strict';var _=require('lodash');var crypto=require(_0x4cfd('0x0'));var jwt=require(_0x4cfd('0x1'));var moment=require(_0x4cfd('0x2'));var Redis=require(_0x4cfd('0x3'));var rp=require(_0x4cfd('0x4'));var util=require('util');var encryptor=require(_0x4cfd('0x5'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x4cfd('0x6'));var schedule=require(_0x4cfd('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4cfd('0x8')](config[_0x4cfd('0x9')],{'host':_0x4cfd('0xa'),'port':0x18eb});var redis=new Redis(config[_0x4cfd('0x9')]);var MICROSOFT_AUTH_URL=_0x4cfd('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4cfd('0xc'),'profile','email',_0x4cfd('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x4cfd('0xc'),_0x4cfd('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x4cfd('0xe');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1d052f){var _0xdfdbcc=_['map'](AZURE_AUTH_SCOPES[_0x1d052f['type']]);if(_0x1d052f[_0x4cfd('0xf')]==='Dynamics365')_0xdfdbcc['push'](_0x1d052f[_0x4cfd('0x10')]+_0x4cfd('0x11'));return _0xdfdbcc[_0x4cfd('0x12')]('\x20');}function getAccessTokenScope(_0x338a7b){if(_0x338a7b[_0x4cfd('0xf')]===_0x4cfd('0x13'))return _0x4cfd('0x14');if(_0x338a7b[_0x4cfd('0xf')]===_0x4cfd('0x15'))return _0x338a7b[_0x4cfd('0x10')]+_0x4cfd('0x11');}function generateMicrosoftAuthorizationUrl(_0x4822df,_0x3d3a68){var _0x454bd7=MICROSOFT_AUTH_URL[_0x4cfd('0x16')](_0x4cfd('0x17'),_0x4822df[_0x4cfd('0x18')]);var _0x11e163=[_0x4cfd('0x19'),'id_token'];var _0x3d053e=Buffer[_0x4cfd('0x1a')](JSON[_0x4cfd('0x1b')]({'id':_0x3d3a68}))[_0x4cfd('0x1c')]('base64');var _0xd3ed36=crypto[_0x4cfd('0x1d')](0x10)[_0x4cfd('0x1c')](_0x4cfd('0x1e'));var _0x478562=getAuthorizationScopes(_0x4822df);var _0x1f8188=[{'key':_0x4cfd('0x1f'),'value':_0x4822df[_0x4cfd('0x20')]},{'key':_0x4cfd('0x21'),'value':encodeURIComponent(_0x11e163[_0x4cfd('0x12')]('\x20'))},{'key':_0x4cfd('0x22'),'value':_0x4822df['data4']},{'key':'response_mode','value':_0x4cfd('0x23')},{'key':_0x4cfd('0x24'),'value':encodeURIComponent(_0x478562)},{'key':_0x4cfd('0x25'),'value':_0x3d053e},{'key':_0x4cfd('0x26'),'value':_0xd3ed36},{'key':_0x4cfd('0x27'),'value':'login'}];var _0x15271a=_0x454bd7+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1f8188,function(_0x471573){return _0x471573[_0x4cfd('0x28')]+'='+_0x471573[_0x4cfd('0x29')];})[_0x4cfd('0x12')]('&');_0x4822df['oauth2Claims']={'issuer':_0x454bd7[_0x4cfd('0x16')]('oauth2/',''),'audience':_0x4822df['data1'],'state':_0x3d053e,'nonce':_0xd3ed36};redis[_0x4cfd('0x2a')](_0x3d053e,JSON[_0x4cfd('0x1b')](_0x4822df));return _0x15271a;}function isValidIdToken(_0x588f82,_0x193ca3){try{var _0xa40c08=jwt[_0x4cfd('0x2b')](_0x588f82,{'complete':!![]});var _0x2deb35=_0xa40c08['payload'];if(_0x2deb35[_0x4cfd('0x2c')]!==_0x193ca3[_0x4cfd('0x2d')])return![];if(_0x2deb35[_0x4cfd('0x2e')]!==_0x193ca3[_0x4cfd('0x2f')])return![];if(_0x2deb35['nonce']!==_0x193ca3[_0x4cfd('0x26')])return![];if(moment()[_0x4cfd('0x30')](moment[_0x4cfd('0x31')](_0x2deb35[_0x4cfd('0x32')])))return![];return!![];}catch(_0x861b89){throw _0x861b89;}}function refreshOauth2MicrosoftAccessToken(_0x1ec119){return Promise[_0x4cfd('0x33')]()['then'](function(){if(_0x1ec119[_0x4cfd('0x34')])return _0x1ec119;return db[_0x4cfd('0x35')]['findOne']({'where':{'id':_0x1ec119['id']},'raw':!![]});})['then'](function(_0x1898a9){var _0x2c15ed={'grant_type':_0x4cfd('0x36'),'refresh_token':_0x1898a9[_0x4cfd('0x37')],'scope':getAccessTokenScope(_0x1898a9),'redirect_uri':_0x1898a9['data4'],'client_id':_0x1898a9[_0x4cfd('0x20')],'client_secret':encryptor[_0x4cfd('0x38')](_0x1898a9[_0x4cfd('0x34')])};var _0x4a16ec={'method':_0x4cfd('0x39'),'uri':MICROSOFT_AUTH_URL[_0x4cfd('0x16')]('{TENANT_ID}',_0x1898a9[_0x4cfd('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2c15ed,'json':!![]};return rp(_0x4a16ec);})[_0x4cfd('0x3a')](function(_0x1bb89f){_0x1ec119[_0x4cfd('0x3b')]=_0x1bb89f['access_token'];_0x1ec119[_0x4cfd('0x37')]=_0x1bb89f['refresh_token'];return db['CloudProvider'][_0x4cfd('0x3c')]({'data5':_0x1ec119[_0x4cfd('0x3b')],'data6':_0x1ec119['data6']},{'where':{'id':_0x1ec119['id']}});})[_0x4cfd('0x3a')](function(){return _0x1ec119;})[_0x4cfd('0x3d')](function(_0x28f95f){logger[_0x4cfd('0x3e')](_0x4cfd('0x3f'),_0x1ec119['id'],_0x28f95f);});}function getOauth2MicrosoftAccessToken(_0x2aa030,_0xb6ed7a){var _0x1f1c9e={'grant_type':_0x4cfd('0x40'),'code':_0x2aa030,'scope':getAccessTokenScope(_0xb6ed7a),'redirect_uri':_0xb6ed7a['data4'],'client_id':_0xb6ed7a[_0x4cfd('0x20')],'client_secret':encryptor['decryptString'](_0xb6ed7a[_0x4cfd('0x34')])};var _0x22d72d={'method':_0x4cfd('0x39'),'uri':MICROSOFT_AUTH_URL[_0x4cfd('0x16')](_0x4cfd('0x17'),_0xb6ed7a[_0x4cfd('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f1c9e,'json':!![]};return rp(_0x22d72d);}function startRefreshInterval(_0xdb5313){var _0x28e57d=schedule[_0x4cfd('0x41')];if(_0x28e57d[_0xdb5313['id']])clearInterval(_0x28e57d[_0xdb5313['id']]);_0x28e57d[_0xdb5313['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4cfd('0x42')](this,{'id':_0xdb5313['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4cfd('0x41')]=_0x28e57d;}function startAllRefreshIntervals(){return db[_0x4cfd('0x35')][_0x4cfd('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4cfd('0x3a')](function(_0x345b12){var _0x3f7882=_0x345b12[_0x4cfd('0x44')](function(_0x3daf39){return refreshOauth2MicrosoftAccessToken(_0x3daf39)['then'](function(_0x47ba83){startRefreshInterval(_0x47ba83);});});return Promise[_0x4cfd('0x45')](_0x3f7882);})['catch'](function(_0x3bd862){var _0x4ed3af=_0x3bd862?util['inspect'](_0x3bd862,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4ed3af);});}module[_0x4cfd('0x46')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xbc8a=['resolve','data3','then','refresh_token','data6','POST','access_token','update','data5','catch','error','authorization_code','decryptString','intervals','bind','findAll','all','inspect','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','/.default','join','Outlook365','data7','replace','data2','id_token','stringify','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','exp'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xbc8a,0x193));var _0xabc8=function(_0x7d4593,_0xd66d60){_0x7d4593=_0x7d4593-0x0;var _0x440c23=_0xbc8a[_0x7d4593];return _0x440c23;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xabc8('0x0'));var moment=require(_0xabc8('0x1'));var Redis=require(_0xabc8('0x2'));var rp=require('request-promise');var util=require(_0xabc8('0x3'));var encryptor=require(_0xabc8('0x4'));var config=require(_0xabc8('0x5'));var logger=require(_0xabc8('0x6'))(_0xabc8('0x7'));var schedule=require(_0xabc8('0x8'));var db=require(_0xabc8('0x9'))['db'];config[_0xabc8('0xa')]=_[_0xabc8('0xb')](config[_0xabc8('0xa')],{'host':_0xabc8('0xc'),'port':0x18eb});var redis=new Redis(config[_0xabc8('0xa')]);var MICROSOFT_AUTH_URL=_0xabc8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xabc8('0xe'),_0xabc8('0xf'),_0xabc8('0x10'),_0xabc8('0x11'),_0xabc8('0x12'),_0xabc8('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xabc8('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xabc8('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0xabc8('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1b6925){var _0x5b2ba8=_[_0xabc8('0x16')](AZURE_AUTH_SCOPES[_0x1b6925[_0xabc8('0x17')]]);if(_0x1b6925[_0xabc8('0x17')]===_0xabc8('0x18'))_0x5b2ba8['push'](_0x1b6925['data7']+_0xabc8('0x19'));return _0x5b2ba8[_0xabc8('0x1a')]('\x20');}function getAccessTokenScope(_0x5ed373){if(_0x5ed373[_0xabc8('0x17')]===_0xabc8('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5ed373[_0xabc8('0x17')]==='Dynamics365')return _0x5ed373[_0xabc8('0x1c')]+_0xabc8('0x19');}function generateMicrosoftAuthorizationUrl(_0x2af3a5,_0x42f029){var _0x459ba9=MICROSOFT_AUTH_URL[_0xabc8('0x1d')]('{TENANT_ID}',_0x2af3a5[_0xabc8('0x1e')]);var _0x56ddc4=['code',_0xabc8('0x1f')];var _0x463bd=Buffer['from'](JSON[_0xabc8('0x20')]({'id':_0x42f029}))['toString'](_0xabc8('0x21'));var _0x47ba25=crypto[_0xabc8('0x22')](0x10)['toString'](_0xabc8('0x23'));var _0x218df9=getAuthorizationScopes(_0x2af3a5);var _0xf67b2c=[{'key':_0xabc8('0x24'),'value':_0x2af3a5[_0xabc8('0x25')]},{'key':_0xabc8('0x26'),'value':encodeURIComponent(_0x56ddc4[_0xabc8('0x1a')]('\x20'))},{'key':_0xabc8('0x27'),'value':_0x2af3a5[_0xabc8('0x28')]},{'key':_0xabc8('0x29'),'value':_0xabc8('0x2a')},{'key':_0xabc8('0x2b'),'value':encodeURIComponent(_0x218df9)},{'key':_0xabc8('0x2c'),'value':_0x463bd},{'key':_0xabc8('0x2d'),'value':_0x47ba25},{'key':_0xabc8('0x2e'),'value':_0xabc8('0x2f')}];var _0xcd4e94=_0x459ba9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xabc8('0x16')](_0xf67b2c,function(_0x370135){return _0x370135['key']+'='+_0x370135['value'];})[_0xabc8('0x1a')]('&');_0x2af3a5[_0xabc8('0x30')]={'issuer':_0x459ba9[_0xabc8('0x1d')](_0xabc8('0x31'),''),'audience':_0x2af3a5[_0xabc8('0x25')],'state':_0x463bd,'nonce':_0x47ba25};redis[_0xabc8('0x32')](_0x463bd,JSON[_0xabc8('0x20')](_0x2af3a5));return _0xcd4e94;}function isValidIdToken(_0x4a114f,_0x5e54dd){try{var _0x34a7c1=jwt[_0xabc8('0x33')](_0x4a114f,{'complete':!![]});var _0x3b3d8d=_0x34a7c1[_0xabc8('0x34')];if(_0x3b3d8d[_0xabc8('0x35')]!==_0x5e54dd[_0xabc8('0x36')])return![];if(_0x3b3d8d['aud']!==_0x5e54dd[_0xabc8('0x37')])return![];if(_0x3b3d8d[_0xabc8('0x2d')]!==_0x5e54dd[_0xabc8('0x2d')])return![];if(moment()[_0xabc8('0x38')](moment[_0xabc8('0x39')](_0x3b3d8d[_0xabc8('0x3a')])))return![];return!![];}catch(_0x4d2895){throw _0x4d2895;}}function refreshOauth2MicrosoftAccessToken(_0x2be4e0){return Promise[_0xabc8('0x3b')]()['then'](function(){if(_0x2be4e0[_0xabc8('0x3c')])return _0x2be4e0;return db['CloudProvider']['findOne']({'where':{'id':_0x2be4e0['id']},'raw':!![]});})[_0xabc8('0x3d')](function(_0x2e9813){var _0x2e8195={'grant_type':_0xabc8('0x3e'),'refresh_token':_0x2e9813[_0xabc8('0x3f')],'scope':getAccessTokenScope(_0x2e9813),'redirect_uri':_0x2e9813[_0xabc8('0x28')],'client_id':_0x2e9813[_0xabc8('0x25')],'client_secret':encryptor['decryptString'](_0x2e9813[_0xabc8('0x3c')])};var _0xf8a2d3={'method':_0xabc8('0x40'),'uri':MICROSOFT_AUTH_URL[_0xabc8('0x1d')]('{TENANT_ID}',_0x2e9813[_0xabc8('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e8195,'json':!![]};return rp(_0xf8a2d3);})['then'](function(_0x152451){_0x2be4e0['data5']=_0x152451[_0xabc8('0x41')];_0x2be4e0[_0xabc8('0x3f')]=_0x152451[_0xabc8('0x3e')];return db['CloudProvider'][_0xabc8('0x42')]({'data5':_0x2be4e0[_0xabc8('0x43')],'data6':_0x2be4e0['data6']},{'where':{'id':_0x2be4e0['id']}});})['then'](function(){return _0x2be4e0;})[_0xabc8('0x44')](function(_0x31bd6){logger[_0xabc8('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x2be4e0['id'],_0x31bd6);});}function getOauth2MicrosoftAccessToken(_0xd4cdd1,_0x428315){var _0x10b816={'grant_type':_0xabc8('0x46'),'code':_0xd4cdd1,'scope':getAccessTokenScope(_0x428315),'redirect_uri':_0x428315[_0xabc8('0x28')],'client_id':_0x428315[_0xabc8('0x25')],'client_secret':encryptor[_0xabc8('0x47')](_0x428315['data3'])};var _0x3d66b3={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xabc8('0x1d')]('{TENANT_ID}',_0x428315[_0xabc8('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10b816,'json':!![]};return rp(_0x3d66b3);}function startRefreshInterval(_0x326ce2){var _0x59c82d=schedule[_0xabc8('0x48')];if(_0x59c82d[_0x326ce2['id']])clearInterval(_0x59c82d[_0x326ce2['id']]);_0x59c82d[_0x326ce2['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xabc8('0x49')](this,{'id':_0x326ce2['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xabc8('0x48')]=_0x59c82d;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xabc8('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xabc8('0x3d')](function(_0x339fde){var _0x31932f=_0x339fde[_0xabc8('0x16')](function(_0x514ac7){return refreshOauth2MicrosoftAccessToken(_0x514ac7)[_0xabc8('0x3d')](function(_0x3d7891){startRefreshInterval(_0x3d7891);});});return Promise[_0xabc8('0x4b')](_0x31932f);})['catch'](function(_0x182680){var _0x4ce0d1=_0x182680?util[_0xabc8('0x4c')](_0x182680,{'showHidden':![],'depth':null}):'';logger[_0xabc8('0x45')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4ce0d1);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 7c05ab0..989f201 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 _0xd945=['debug','request\x20sent','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x58f936,_0x237902){var _0x396a6f=function(_0x4b86b8){while(--_0x4b86b8){_0x58f936['push'](_0x58f936['shift']());}};_0x396a6f(++_0x237902);}(_0xd945,0x84));var _0x5d94=function(_0x5e595d,_0x2cfacf){_0x5e595d=_0x5e595d-0x0;var _0x55c2c4=_0xd945[_0x5e595d];return _0x55c2c4;};'use strict';var _=require(_0x5d94('0x0'));var util=require(_0x5d94('0x1'));var moment=require(_0x5d94('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d94('0x3'));var fs=require('fs');var Redis=require(_0x5d94('0x4'));var db=require(_0x5d94('0x5'))['db'];var utils=require(_0x5d94('0x6'));var logger=require(_0x5d94('0x7'))('rpc');var config=require(_0x5d94('0x8'));var jayson=require(_0x5d94('0x9'));var client=jayson[_0x5d94('0xa')][_0x5d94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3635a6,_0x54af94,_0x430607){return new BPromise(function(_0x34fa30,_0x1117dc){return client['request'](_0x3635a6,_0x430607)[_0x5d94('0xc')](function(_0x3dd79e){logger[_0x5d94('0xd')](_0x5d94('0xe'),_0x54af94,'request\x20sent');logger[_0x5d94('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x54af94,_0x5d94('0x10'),JSON[_0x5d94('0x11')](_0x3dd79e));if(_0x3dd79e[_0x5d94('0x12')]){if(_0x3dd79e[_0x5d94('0x12')][_0x5d94('0x13')]===0x1f4){logger[_0x5d94('0x12')](_0x5d94('0xe'),_0x54af94,_0x3dd79e[_0x5d94('0x12')][_0x5d94('0x14')]);return _0x1117dc(_0x3dd79e[_0x5d94('0x12')]['message']);}logger[_0x5d94('0x12')](_0x5d94('0xe'),_0x54af94,_0x3dd79e['error'][_0x5d94('0x14')]);return _0x34fa30(_0x3dd79e[_0x5d94('0x12')][_0x5d94('0x14')]);}else{logger[_0x5d94('0xd')](_0x5d94('0xe'),_0x54af94,_0x5d94('0x10'));_0x34fa30(_0x3dd79e['result']['message']);}})['catch'](function(_0x38d3c7){logger[_0x5d94('0x12')](_0x5d94('0xe'),_0x54af94,_0x38d3c7);_0x1117dc(_0x38d3c7);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1b6db3,_0x26930b){var _0x38a71e=function(_0x21dddd){while(--_0x21dddd){_0x1b6db3['push'](_0x1b6db3['shift']());}};_0x38a71e(++_0x26930b);}(_0xadb5,0xad));var _0x5adb=function(_0x27f2f3,_0x8f117e){_0x27f2f3=_0x27f2f3-0x0;var _0x2890ba=_0xadb5[_0x27f2f3];return _0x2890ba;};'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']('CloudProvider,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 29992a3..779072b 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(_0xeb2ec,_0x3b6498){var _0x31478f=function(_0x5402d5){while(--_0x5402d5){_0xeb2ec['push'](_0xeb2ec['shift']());}};_0x31478f(++_0x3b6498);}(_0xadb5,0xad));var _0x5adb=function(_0x3776aa,_0x2536dc){_0x3776aa=_0x3776aa-0x0;var _0x594d5b=_0xadb5[_0x3776aa];return _0x594d5b;};'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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x271051,_0x4f5b43){var _0x245193=function(_0x54bc54){while(--_0x54bc54){_0x271051['push'](_0x271051['shift']());}};_0x245193(++_0x4f5b43);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index cc012a6..d0b9179 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 _0x6125=['name','sequelize','exports','STRING'];(function(_0x1a1878,_0x36ebd0){var _0x4f55c3=function(_0x1bface){while(--_0x1bface){_0x1a1878['push'](_0x1a1878['shift']());}};_0x4f55c3(++_0x36ebd0);}(_0x6125,0x1a5));var _0x5612=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6125[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5612('0x0'));module[_0x5612('0x1')]={'name':{'type':Sequelize[_0x5612('0x2')],'unique':_0x5612('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5612('0x2')]},'website':{'type':Sequelize[_0x5612('0x2')]},'phone':{'type':Sequelize[_0x5612('0x2')]},'fax':{'type':Sequelize[_0x5612('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5612('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5612('0x2')]},'country':{'type':Sequelize[_0x5612('0x2')]},'email':{'type':Sequelize[_0x5612('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x5612('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5612('0x2')]}}; \ No newline at end of file +var _0x4dc7=['STRING','name','sequelize','exports'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x4dc7,0x182));var _0x74dc=function(_0x55ce99,_0x158d8f){_0x55ce99=_0x55ce99-0x0;var _0x52bf95=_0x4dc7[_0x55ce99];return _0x52bf95;};'use strict';var Sequelize=require(_0x74dc('0x0'));module[_0x74dc('0x1')]={'name':{'type':Sequelize[_0x74dc('0x2')],'unique':_0x74dc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x74dc('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x74dc('0x2')]},'fax':{'type':Sequelize[_0x74dc('0x2')]},'type':{'type':Sequelize[_0x74dc('0x2')]},'street':{'type':Sequelize[_0x74dc('0x2')]},'postalCode':{'type':Sequelize[_0x74dc('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x74dc('0x2')]},'email':{'type':Sequelize[_0x74dc('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x74dc('0x2')]},'sPostalCode':{'type':Sequelize[_0x74dc('0x2')]},'sCity':{'type':Sequelize[_0x74dc('0x2')]},'sCountry':{'type':Sequelize[_0x74dc('0x2')]},'description':{'type':Sequelize[_0x74dc('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 7667dd4..70b45d8 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 _0x9a20=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','update','addContacts','CmContact','ids','getContacts','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','undefined','limit','offset','count','set','apply','reject','then','destroy','get','Companies','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0xad9d4d,_0x5bf432){var _0x195e72=function(_0x1d2e78){while(--_0x1d2e78){_0xad9d4d['push'](_0xad9d4d['shift']());}};_0x195e72(++_0x5bf432);}(_0x9a20,0x16f));var _0x09a2=function(_0x1b5855,_0xd30d2c){_0x1b5855=_0x1b5855-0x0;var _0x461e4d=_0x9a20[_0x1b5855];return _0x461e4d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09a2('0x0'));var zipdir=require(_0x09a2('0x1'));var jsonpatch=require(_0x09a2('0x2'));var rp=require(_0x09a2('0x3'));var moment=require(_0x09a2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x09a2('0x5'));var path=require('path');var sox=require(_0x09a2('0x6'));var csv=require(_0x09a2('0x7'));var ejs=require(_0x09a2('0x8'));var fs=require('fs');var fs_extra=require(_0x09a2('0x9'));var _=require(_0x09a2('0xa'));var squel=require(_0x09a2('0xb'));var crypto=require(_0x09a2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x09a2('0x7'));var querystring=require(_0x09a2('0xd'));var Papa=require(_0x09a2('0xe'));var Redis=require('ioredis');var authService=require(_0x09a2('0xf'));var qs=require(_0x09a2('0x10'));var as=require(_0x09a2('0x11'));var hardwareService=require(_0x09a2('0x12'));var logger=require(_0x09a2('0x13'))(_0x09a2('0x14'));var utils=require(_0x09a2('0x15'));var config=require(_0x09a2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x09a2('0x17'))['db'];function respondWithStatusCode(_0x4f8595,_0x340396){_0x340396=_0x340396||0xcc;return function(_0x344bbe){if(_0x344bbe){return _0x4f8595['sendStatus'](_0x340396);}return _0x4f8595[_0x09a2('0x18')](_0x340396)[_0x09a2('0x19')]();};}function respondWithResult(_0x2e4104,_0x32056c){_0x32056c=_0x32056c||0xc8;return function(_0x46bb40){if(_0x46bb40){return _0x2e4104[_0x09a2('0x18')](_0x32056c)[_0x09a2('0x1a')](_0x46bb40);}};}function respondWithFilteredResult(_0x17c530,_0x3ace99){return function(_0x4067e9){if(_0x4067e9){var _0x322339=typeof _0x3ace99['offset']===_0x09a2('0x1b')&&typeof _0x3ace99[_0x09a2('0x1c')]===_0x09a2('0x1b');var _0xbc956=_0x4067e9['count'];var _0x540ac7=_0x322339?0x0:_0x3ace99[_0x09a2('0x1d')];var _0x53d421=_0x322339?_0x4067e9[_0x09a2('0x1e')]:_0x3ace99[_0x09a2('0x1d')]+_0x3ace99['limit'];var _0x5adca8;if(_0x53d421>=_0xbc956){_0x53d421=_0xbc956;_0x5adca8=0xc8;}else{_0x5adca8=0xce;}_0x17c530[_0x09a2('0x18')](_0x5adca8);return _0x17c530[_0x09a2('0x1f')]('Content-Range',_0x540ac7+'-'+_0x53d421+'/'+_0xbc956)['json'](_0x4067e9);}return null;};}function patchUpdates(_0x107895){return function(_0x4f835e){try{jsonpatch[_0x09a2('0x20')](_0x4f835e,_0x107895,!![]);}catch(_0x55727f){return BPromise[_0x09a2('0x21')](_0x55727f);}return _0x4f835e['save']();};}function saveUpdates(_0x3eca0c,_0x388055){return function(_0x3d02b3){if(_0x3d02b3){return _0x3d02b3['update'](_0x3eca0c)[_0x09a2('0x22')](function(_0x114311){return _0x114311;});}return null;};}function removeEntity(_0x108938,_0x563642){return function(_0x440bdd){if(_0x440bdd){return _0x440bdd[_0x09a2('0x23')]()[_0x09a2('0x22')](function(){var _0x1d6abe=_0x440bdd[_0x09a2('0x24')]({'plain':!![]});var _0x6591b2=_0x09a2('0x25');return db['UserProfileResource'][_0x09a2('0x23')]({'where':{'type':_0x6591b2,'resourceId':_0x1d6abe['id']}})['then'](function(){return _0x440bdd;});})['then'](function(){_0x108938[_0x09a2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d0ae6,_0x3097cd){return function(_0x4c690f){if(!_0x4c690f){_0x1d0ae6[_0x09a2('0x26')](0x194);}return _0x4c690f;};}function handleError(_0x10192f,_0x6a5f05){_0x6a5f05=_0x6a5f05||0x1f4;return function(_0x399120){logger[_0x09a2('0x27')](_0x399120['stack']);if(_0x399120[_0x09a2('0x28')]){delete _0x399120[_0x09a2('0x28')];}_0x10192f[_0x09a2('0x18')](_0x6a5f05)[_0x09a2('0x29')](_0x399120);};}exports[_0x09a2('0x2a')]=function(_0x37a7e8,_0x509fcd){var _0x53743={},_0x6778d3={},_0x38cf1f={'count':0x0,'rows':[]};return db[_0x09a2('0x2b')][_0x09a2('0x2c')]()['then'](function(_0x5a97b7){_0x6778d3[_0x09a2('0x2d')]=_[_0x09a2('0x2e')](_0x5a97b7);_0x6778d3[_0x09a2('0x2f')]=_[_0x09a2('0x2e')](_0x37a7e8['query']);_0x6778d3[_0x09a2('0x30')]=_[_0x09a2('0x31')](_0x6778d3['model'],_0x6778d3[_0x09a2('0x2f')]);_0x53743[_0x09a2('0x32')]=_[_0x09a2('0x31')](_0x6778d3['model'],qs[_0x09a2('0x33')](_0x37a7e8['query'][_0x09a2('0x33')]));_0x53743['attributes']=_0x53743['attributes'][_0x09a2('0x34')]?_0x53743['attributes']:_0x6778d3['model'];if(!_0x37a7e8[_0x09a2('0x2f')][_0x09a2('0x35')](_0x09a2('0x36'))){_0x53743[_0x09a2('0x1c')]=qs[_0x09a2('0x1c')](_0x37a7e8['query'][_0x09a2('0x1c')]);_0x53743[_0x09a2('0x1d')]=qs[_0x09a2('0x1d')](_0x37a7e8[_0x09a2('0x2f')][_0x09a2('0x1d')]);}_0x53743[_0x09a2('0x37')]=qs[_0x09a2('0x38')](_0x37a7e8[_0x09a2('0x2f')][_0x09a2('0x38')]);_0x53743[_0x09a2('0x39')]=qs[_0x09a2('0x30')](_[_0x09a2('0x3a')](_0x37a7e8[_0x09a2('0x2f')],_0x6778d3['filters']),_0x5a97b7);if(_0x37a7e8[_0x09a2('0x2f')][_0x09a2('0x3b')]){_0x53743[_0x09a2('0x39')]=_[_0x09a2('0x3c')](_0x53743[_0x09a2('0x39')],{'$or':_[_0x09a2('0x3d')](_0x53743[_0x09a2('0x32')],function(_0xa2040e){var _0x2ad5cc={};_0x2ad5cc[_0xa2040e]={'$like':'%'+_0x37a7e8[_0x09a2('0x2f')][_0x09a2('0x3b')]+'%'};return _0x2ad5cc;})});}_0x53743=_['merge']({},_0x53743,_0x37a7e8['options']);var _0x44dfd8={'where':_0x53743[_0x09a2('0x39')]};return db[_0x09a2('0x2b')][_0x09a2('0x1e')](_0x44dfd8)['then'](function(_0x2a0199){_0x38cf1f['count']=_0x2a0199;if(_0x37a7e8[_0x09a2('0x2f')][_0x09a2('0x3e')]){_0x53743[_0x09a2('0x3f')]=[{'all':!![]}];}return db[_0x09a2('0x2b')][_0x09a2('0x40')](_0x53743);})[_0x09a2('0x22')](function(_0x33bcd6){_0x38cf1f['rows']=_0x33bcd6;return _0x38cf1f;})[_0x09a2('0x22')](respondWithFilteredResult(_0x509fcd,_0x53743))[_0x09a2('0x41')](handleError(_0x509fcd,null));})[_0x09a2('0x41')](handleError(_0x509fcd,null));};exports[_0x09a2('0x42')]=function(_0x37e039,_0x58eac9){var _0x3e4270={'raw':![],'where':{'id':_0x37e039[_0x09a2('0x43')]['id']}},_0x338d13={};_0x338d13[_0x09a2('0x2d')]=_[_0x09a2('0x2e')](db['CmCompany'][_0x09a2('0x44')]);_0x338d13[_0x09a2('0x2f')]=_[_0x09a2('0x2e')](_0x37e039[_0x09a2('0x2f')]);_0x338d13['filters']=_[_0x09a2('0x31')](_0x338d13[_0x09a2('0x2d')],_0x338d13[_0x09a2('0x2f')]);_0x3e4270[_0x09a2('0x32')]=_[_0x09a2('0x31')](_0x338d13[_0x09a2('0x2d')],qs[_0x09a2('0x33')](_0x37e039[_0x09a2('0x2f')][_0x09a2('0x33')]));_0x3e4270[_0x09a2('0x32')]=_0x3e4270[_0x09a2('0x32')][_0x09a2('0x34')]?_0x3e4270[_0x09a2('0x32')]:_0x338d13[_0x09a2('0x2d')];if(_0x37e039['query']['includeAll']){_0x3e4270[_0x09a2('0x3f')]=[{'all':!![]}];}_0x3e4270=_[_0x09a2('0x3c')]({},_0x3e4270,_0x37e039[_0x09a2('0x45')]);return db[_0x09a2('0x2b')][_0x09a2('0x46')](_0x3e4270)['then'](handleEntityNotFound(_0x58eac9,null))[_0x09a2('0x22')](respondWithResult(_0x58eac9,null))[_0x09a2('0x41')](handleError(_0x58eac9,null));};exports[_0x09a2('0x47')]=function(_0x167d05,_0x20f3cf){return db[_0x09a2('0x2b')]['create'](_0x167d05[_0x09a2('0x48')],{})[_0x09a2('0x22')](function(_0x568d1b){var _0x499f1c=_0x167d05['user'][_0x09a2('0x24')]({'plain':!![]});if(!_0x499f1c)throw new Error(_0x09a2('0x49'));if(_0x499f1c[_0x09a2('0x4a')]==='user'){var _0x3c1811=_0x568d1b[_0x09a2('0x24')]({'plain':!![]});var _0x53963d='Companies';return db[_0x09a2('0x4b')][_0x09a2('0x46')]({'where':{'name':_0x53963d,'userProfileId':_0x499f1c[_0x09a2('0x4c')]},'raw':!![]})[_0x09a2('0x22')](function(_0x891a48){if(_0x891a48&&_0x891a48['autoAssociation']===0x0){return db[_0x09a2('0x4d')]['create']({'name':_0x3c1811[_0x09a2('0x28')],'resourceId':_0x3c1811['id'],'type':_0x891a48[_0x09a2('0x28')],'sectionId':_0x891a48['id']},{})[_0x09a2('0x22')](function(){return _0x568d1b;});}else{return _0x568d1b;}})[_0x09a2('0x41')](function(_0x344746){logger[_0x09a2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x344746);throw _0x344746;});}return _0x568d1b;})['then'](respondWithResult(_0x20f3cf,0xc9))[_0x09a2('0x41')](handleError(_0x20f3cf,null));};exports[_0x09a2('0x4e')]=function(_0x22f9be,_0x3eaa02){if(_0x22f9be[_0x09a2('0x48')]['id']){delete _0x22f9be[_0x09a2('0x48')]['id'];}return db[_0x09a2('0x2b')][_0x09a2('0x46')]({'where':{'id':_0x22f9be[_0x09a2('0x43')]['id']}})[_0x09a2('0x22')](handleEntityNotFound(_0x3eaa02,null))[_0x09a2('0x22')](saveUpdates(_0x22f9be[_0x09a2('0x48')],null))['then'](respondWithResult(_0x3eaa02,null))[_0x09a2('0x41')](handleError(_0x3eaa02,null));};exports[_0x09a2('0x23')]=function(_0x1c67fc,_0x58ffcc){return db[_0x09a2('0x2b')][_0x09a2('0x46')]({'where':{'id':_0x1c67fc['params']['id']}})[_0x09a2('0x22')](handleEntityNotFound(_0x58ffcc,null))['then'](removeEntity(_0x58ffcc,null))[_0x09a2('0x41')](handleError(_0x58ffcc,null));};exports[_0x09a2('0x2c')]=function(_0x5f485c,_0x50454b){return db['CmCompany'][_0x09a2('0x2c')]()['then'](respondWithResult(_0x50454b,null))['catch'](handleError(_0x50454b,null));};exports[_0x09a2('0x4f')]=function(_0x2dc21d,_0x8c1b3,_0x5e1c9c){return db[_0x09a2('0x50')]['find']({'where':{'id':_0x2dc21d[_0x09a2('0x43')]['id']}})[_0x09a2('0x22')](handleEntityNotFound(_0x8c1b3,null))[_0x09a2('0x22')](function(_0x2b3203){if(_0x2b3203){return _0x2b3203['addContacts'](_0x2dc21d[_0x09a2('0x48')][_0x09a2('0x51')],_['omit'](_0x2dc21d[_0x09a2('0x48')],['ids','id'])||{});}})[_0x09a2('0x22')](respondWithResult(_0x8c1b3,null))['catch'](handleError(_0x8c1b3,null));};exports[_0x09a2('0x52')]=function(_0x718416,_0x443091,_0x5e97df){var _0x5f17f0={};var _0x5ec6c3={};var _0x50bd50;var _0x45256a;return db['CmCompany'][_0x09a2('0x53')]({'where':{'id':_0x718416[_0x09a2('0x43')]['id']}})[_0x09a2('0x22')](handleEntityNotFound(_0x443091,null))[_0x09a2('0x22')](function(_0x4bc797){if(_0x4bc797){_0x50bd50=_0x4bc797;_0x5ec6c3[_0x09a2('0x2d')]=_[_0x09a2('0x2e')](db[_0x09a2('0x50')][_0x09a2('0x44')]);_0x5ec6c3['query']=_[_0x09a2('0x2e')](_0x718416[_0x09a2('0x2f')]);_0x5ec6c3[_0x09a2('0x30')]=_['intersection'](_0x5ec6c3[_0x09a2('0x2d')],_0x5ec6c3[_0x09a2('0x2f')]);_0x5f17f0[_0x09a2('0x32')]=_[_0x09a2('0x31')](_0x5ec6c3[_0x09a2('0x2d')],qs[_0x09a2('0x33')](_0x718416[_0x09a2('0x2f')]['fields']));_0x5f17f0[_0x09a2('0x32')]=_0x5f17f0['attributes']['length']?_0x5f17f0[_0x09a2('0x32')]:_0x5ec6c3[_0x09a2('0x2d')];_0x5f17f0[_0x09a2('0x37')]=qs[_0x09a2('0x38')](_0x718416[_0x09a2('0x2f')][_0x09a2('0x38')]);_0x5f17f0[_0x09a2('0x39')]=qs[_0x09a2('0x30')](_['pick'](_0x718416[_0x09a2('0x2f')],_0x5ec6c3[_0x09a2('0x30')]));if(_0x718416[_0x09a2('0x2f')]['filter']){_0x5f17f0['where']=_[_0x09a2('0x3c')](_0x5f17f0['where'],{'$or':_[_0x09a2('0x3d')](_0x5f17f0['attributes'],function(_0x51f5f6){var _0x4d0cf4={};_0x4d0cf4[_0x51f5f6]={'$like':'%'+_0x718416[_0x09a2('0x2f')][_0x09a2('0x3b')]+'%'};return _0x4d0cf4;})});}_0x5f17f0=_['merge']({},_0x5f17f0,_0x718416[_0x09a2('0x45')]);return _0x50bd50['getContacts'](_0x5f17f0);}})[_0x09a2('0x22')](function(_0x4c7934){if(_0x4c7934){_0x45256a=_0x4c7934[_0x09a2('0x34')];if(!_0x718416['query'][_0x09a2('0x35')](_0x09a2('0x36'))){_0x5f17f0[_0x09a2('0x1c')]=qs[_0x09a2('0x1c')](_0x718416['query'][_0x09a2('0x1c')]);_0x5f17f0[_0x09a2('0x1d')]=qs[_0x09a2('0x1d')](_0x718416[_0x09a2('0x2f')][_0x09a2('0x1d')]);}return _0x50bd50[_0x09a2('0x52')](_0x5f17f0);}})['then'](function(_0xa1fa98){if(_0xa1fa98){return _0xa1fa98?{'count':_0x45256a,'rows':_0xa1fa98}:null;}})['then'](respondWithResult(_0x443091,null))['catch'](handleError(_0x443091,null));}; \ No newline at end of file +var _0xae32=['sort','where','filters','filter','merge','map','options','includeAll','include','CmCompany','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','ids','omit','getContacts','findOne','CmContact','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x1f7a7e,_0x3ac087){var _0x18f367=function(_0xd8ac2d){while(--_0xd8ac2d){_0x1f7a7e['push'](_0x1f7a7e['shift']());}};_0x18f367(++_0x3ac087);}(_0xae32,0x1e8));var _0x2ae3=function(_0x54c03a,_0x54f389){_0x54c03a=_0x54c03a-0x0;var _0x5c75d7=_0xae32[_0x54c03a];return _0x5c75d7;};'use strict';var emlformat=require(_0x2ae3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ae3('0x1'));var jsonpatch=require(_0x2ae3('0x2'));var rp=require(_0x2ae3('0x3'));var moment=require(_0x2ae3('0x4'));var BPromise=require(_0x2ae3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2ae3('0x6'));var sox=require(_0x2ae3('0x7'));var csv=require(_0x2ae3('0x8'));var ejs=require(_0x2ae3('0x9'));var fs=require('fs');var fs_extra=require(_0x2ae3('0xa'));var _=require(_0x2ae3('0xb'));var squel=require(_0x2ae3('0xc'));var crypto=require(_0x2ae3('0xd'));var jsforce=require(_0x2ae3('0xe'));var deskjs=require(_0x2ae3('0xf'));var toCsv=require(_0x2ae3('0x8'));var querystring=require('querystring');var Papa=require(_0x2ae3('0x10'));var Redis=require(_0x2ae3('0x11'));var authService=require(_0x2ae3('0x12'));var qs=require(_0x2ae3('0x13'));var as=require(_0x2ae3('0x14'));var hardwareService=require(_0x2ae3('0x15'));var logger=require(_0x2ae3('0x16'))(_0x2ae3('0x17'));var utils=require(_0x2ae3('0x18'));var config=require(_0x2ae3('0x19'));var licenseUtil=require(_0x2ae3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275b4c,_0x589cac){_0x589cac=_0x589cac||0xcc;return function(_0x201e30){if(_0x201e30){return _0x275b4c[_0x2ae3('0x1b')](_0x589cac);}return _0x275b4c[_0x2ae3('0x1c')](_0x589cac)[_0x2ae3('0x1d')]();};}function respondWithResult(_0x5d4f52,_0x5d7b05){_0x5d7b05=_0x5d7b05||0xc8;return function(_0x51894f){if(_0x51894f){return _0x5d4f52['status'](_0x5d7b05)['json'](_0x51894f);}};}function respondWithFilteredResult(_0x376289,_0x45542c){return function(_0x12e912){if(_0x12e912){var _0x4b9be2=typeof _0x45542c[_0x2ae3('0x1e')]==='undefined'&&typeof _0x45542c[_0x2ae3('0x1f')]===_0x2ae3('0x20');var _0x13ae89=_0x12e912[_0x2ae3('0x21')];var _0x37723d=_0x4b9be2?0x0:_0x45542c['offset'];var _0x55fcf4=_0x4b9be2?_0x12e912[_0x2ae3('0x21')]:_0x45542c[_0x2ae3('0x1e')]+_0x45542c['limit'];var _0x5763f1;if(_0x55fcf4>=_0x13ae89){_0x55fcf4=_0x13ae89;_0x5763f1=0xc8;}else{_0x5763f1=0xce;}_0x376289[_0x2ae3('0x1c')](_0x5763f1);return _0x376289[_0x2ae3('0x22')](_0x2ae3('0x23'),_0x37723d+'-'+_0x55fcf4+'/'+_0x13ae89)['json'](_0x12e912);}return null;};}function patchUpdates(_0x2a2a22){return function(_0x4ae332){try{jsonpatch[_0x2ae3('0x24')](_0x4ae332,_0x2a2a22,!![]);}catch(_0x213537){return BPromise[_0x2ae3('0x25')](_0x213537);}return _0x4ae332[_0x2ae3('0x26')]();};}function saveUpdates(_0x185abc,_0xe0e8d1){return function(_0x54cc9f){if(_0x54cc9f){return _0x54cc9f[_0x2ae3('0x27')](_0x185abc)[_0x2ae3('0x28')](function(_0x2241e8){return _0x2241e8;});}return null;};}function removeEntity(_0x37c522,_0x367cca){return function(_0x152533){if(_0x152533){return _0x152533[_0x2ae3('0x29')]()[_0x2ae3('0x28')](function(){var _0x3037c4=_0x152533[_0x2ae3('0x2a')]({'plain':!![]});var _0x3400ed=_0x2ae3('0x2b');return db[_0x2ae3('0x2c')][_0x2ae3('0x29')]({'where':{'type':_0x3400ed,'resourceId':_0x3037c4['id']}})[_0x2ae3('0x28')](function(){return _0x152533;});})[_0x2ae3('0x28')](function(){_0x37c522[_0x2ae3('0x1c')](0xcc)[_0x2ae3('0x1d')]();});}};}function handleEntityNotFound(_0x5407c8,_0x5d90f3){return function(_0x5451df){if(!_0x5451df){_0x5407c8['sendStatus'](0x194);}return _0x5451df;};}function handleError(_0x11badd,_0x2f632f){_0x2f632f=_0x2f632f||0x1f4;return function(_0x4661b7){logger['error'](_0x4661b7['stack']);if(_0x4661b7[_0x2ae3('0x2d')]){delete _0x4661b7['name'];}_0x11badd[_0x2ae3('0x1c')](_0x2f632f)[_0x2ae3('0x2e')](_0x4661b7);};}exports[_0x2ae3('0x2f')]=function(_0x23425f,_0x44dd04){var _0xedd19e={},_0x474db4={},_0x48edcf={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x2ae3('0x28')](function(_0x889036){_0x474db4[_0x2ae3('0x30')]=_[_0x2ae3('0x31')](_0x889036);_0x474db4[_0x2ae3('0x32')]=_[_0x2ae3('0x31')](_0x23425f[_0x2ae3('0x32')]);_0x474db4['filters']=_[_0x2ae3('0x33')](_0x474db4[_0x2ae3('0x30')],_0x474db4[_0x2ae3('0x32')]);_0xedd19e[_0x2ae3('0x34')]=_[_0x2ae3('0x33')](_0x474db4[_0x2ae3('0x30')],qs[_0x2ae3('0x35')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x35')]));_0xedd19e['attributes']=_0xedd19e[_0x2ae3('0x34')][_0x2ae3('0x36')]?_0xedd19e[_0x2ae3('0x34')]:_0x474db4[_0x2ae3('0x30')];if(!_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x37')](_0x2ae3('0x38'))){_0xedd19e['limit']=qs[_0x2ae3('0x1f')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x1f')]);_0xedd19e[_0x2ae3('0x1e')]=qs[_0x2ae3('0x1e')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x1e')]);}_0xedd19e[_0x2ae3('0x39')]=qs[_0x2ae3('0x3a')](_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x3a')]);_0xedd19e[_0x2ae3('0x3b')]=qs[_0x2ae3('0x3c')](_['pick'](_0x23425f['query'],_0x474db4[_0x2ae3('0x3c')]),_0x889036);if(_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x3d')]){_0xedd19e['where']=_[_0x2ae3('0x3e')](_0xedd19e[_0x2ae3('0x3b')],{'$or':_[_0x2ae3('0x3f')](_0xedd19e['attributes'],function(_0x178dd6){var _0x37efe8={};_0x37efe8[_0x178dd6]={'$like':'%'+_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x3d')]+'%'};return _0x37efe8;})});}_0xedd19e=_[_0x2ae3('0x3e')]({},_0xedd19e,_0x23425f[_0x2ae3('0x40')]);var _0x1b9232={'where':_0xedd19e[_0x2ae3('0x3b')]};return db['CmCompany'][_0x2ae3('0x21')](_0x1b9232)[_0x2ae3('0x28')](function(_0x1fbe73){_0x48edcf[_0x2ae3('0x21')]=_0x1fbe73;if(_0x23425f[_0x2ae3('0x32')][_0x2ae3('0x41')]){_0xedd19e[_0x2ae3('0x42')]=[{'all':!![]}];}return db[_0x2ae3('0x43')][_0x2ae3('0x44')](_0xedd19e);})[_0x2ae3('0x28')](function(_0x17e847){_0x48edcf[_0x2ae3('0x45')]=_0x17e847;return _0x48edcf;})['then'](respondWithFilteredResult(_0x44dd04,_0xedd19e))[_0x2ae3('0x46')](handleError(_0x44dd04,null));})[_0x2ae3('0x46')](handleError(_0x44dd04,null));};exports['show']=function(_0x3e6792,_0x1ac594){var _0xbebd28={'raw':![],'where':{'id':_0x3e6792[_0x2ae3('0x47')]['id']}},_0x4a694f={};_0x4a694f[_0x2ae3('0x30')]=_[_0x2ae3('0x31')](db[_0x2ae3('0x43')][_0x2ae3('0x48')]);_0x4a694f[_0x2ae3('0x32')]=_[_0x2ae3('0x31')](_0x3e6792['query']);_0x4a694f[_0x2ae3('0x3c')]=_[_0x2ae3('0x33')](_0x4a694f[_0x2ae3('0x30')],_0x4a694f[_0x2ae3('0x32')]);_0xbebd28[_0x2ae3('0x34')]=_[_0x2ae3('0x33')](_0x4a694f['model'],qs[_0x2ae3('0x35')](_0x3e6792['query'][_0x2ae3('0x35')]));_0xbebd28[_0x2ae3('0x34')]=_0xbebd28[_0x2ae3('0x34')][_0x2ae3('0x36')]?_0xbebd28[_0x2ae3('0x34')]:_0x4a694f[_0x2ae3('0x30')];if(_0x3e6792[_0x2ae3('0x32')][_0x2ae3('0x41')]){_0xbebd28['include']=[{'all':!![]}];}_0xbebd28=_[_0x2ae3('0x3e')]({},_0xbebd28,_0x3e6792[_0x2ae3('0x40')]);return db[_0x2ae3('0x43')][_0x2ae3('0x49')](_0xbebd28)[_0x2ae3('0x28')](handleEntityNotFound(_0x1ac594,null))[_0x2ae3('0x28')](respondWithResult(_0x1ac594,null))[_0x2ae3('0x46')](handleError(_0x1ac594,null));};exports[_0x2ae3('0x4a')]=function(_0x4dfcbe,_0x10cf5c){return db[_0x2ae3('0x43')][_0x2ae3('0x4a')](_0x4dfcbe[_0x2ae3('0x4b')],{})['then'](function(_0x41036d){var _0x5644d7=_0x4dfcbe[_0x2ae3('0x4c')][_0x2ae3('0x2a')]({'plain':!![]});if(!_0x5644d7)throw new Error(_0x2ae3('0x4d'));if(_0x5644d7[_0x2ae3('0x4e')]===_0x2ae3('0x4c')){var _0x4b6a37=_0x41036d[_0x2ae3('0x2a')]({'plain':!![]});var _0x2714f4=_0x2ae3('0x2b');return db[_0x2ae3('0x4f')]['find']({'where':{'name':_0x2714f4,'userProfileId':_0x5644d7[_0x2ae3('0x50')]},'raw':!![]})[_0x2ae3('0x28')](function(_0x207a84){if(_0x207a84&&_0x207a84['autoAssociation']===0x0){return db[_0x2ae3('0x2c')][_0x2ae3('0x4a')]({'name':_0x4b6a37[_0x2ae3('0x2d')],'resourceId':_0x4b6a37['id'],'type':_0x207a84[_0x2ae3('0x2d')],'sectionId':_0x207a84['id']},{})[_0x2ae3('0x28')](function(){return _0x41036d;});}else{return _0x41036d;}})['catch'](function(_0xfea3c6){logger[_0x2ae3('0x51')](_0x2ae3('0x52'),_0xfea3c6);throw _0xfea3c6;});}return _0x41036d;})[_0x2ae3('0x28')](respondWithResult(_0x10cf5c,0xc9))[_0x2ae3('0x46')](handleError(_0x10cf5c,null));};exports[_0x2ae3('0x27')]=function(_0x4b6d23,_0x2f3b7e){if(_0x4b6d23[_0x2ae3('0x4b')]['id']){delete _0x4b6d23[_0x2ae3('0x4b')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x4b6d23[_0x2ae3('0x47')]['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x2f3b7e,null))[_0x2ae3('0x28')](saveUpdates(_0x4b6d23[_0x2ae3('0x4b')],null))['then'](respondWithResult(_0x2f3b7e,null))[_0x2ae3('0x46')](handleError(_0x2f3b7e,null));};exports[_0x2ae3('0x29')]=function(_0x220088,_0x35d798){return db[_0x2ae3('0x43')][_0x2ae3('0x49')]({'where':{'id':_0x220088[_0x2ae3('0x47')]['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x35d798,null))[_0x2ae3('0x28')](removeEntity(_0x35d798,null))[_0x2ae3('0x46')](handleError(_0x35d798,null));};exports['describe']=function(_0x226ad8,_0x49d1e7){return db['CmCompany'][_0x2ae3('0x53')]()[_0x2ae3('0x28')](respondWithResult(_0x49d1e7,null))[_0x2ae3('0x46')](handleError(_0x49d1e7,null));};exports['addContacts']=function(_0x6c5e76,_0x14f93a,_0x580470){return db['CmContact'][_0x2ae3('0x49')]({'where':{'id':_0x6c5e76[_0x2ae3('0x47')]['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x14f93a,null))[_0x2ae3('0x28')](function(_0x50eeab){if(_0x50eeab){return _0x50eeab[_0x2ae3('0x54')](_0x6c5e76[_0x2ae3('0x4b')][_0x2ae3('0x55')],_[_0x2ae3('0x56')](_0x6c5e76[_0x2ae3('0x4b')],[_0x2ae3('0x55'),'id'])||{});}})[_0x2ae3('0x28')](respondWithResult(_0x14f93a,null))['catch'](handleError(_0x14f93a,null));};exports[_0x2ae3('0x57')]=function(_0x21cd11,_0x45ec91,_0x341f98){var _0x34646b={};var _0x5ab8ff={};var _0x593e0e;var _0x47f47a;return db[_0x2ae3('0x43')][_0x2ae3('0x58')]({'where':{'id':_0x21cd11['params']['id']}})[_0x2ae3('0x28')](handleEntityNotFound(_0x45ec91,null))['then'](function(_0x7a7ede){if(_0x7a7ede){_0x593e0e=_0x7a7ede;_0x5ab8ff[_0x2ae3('0x30')]=_[_0x2ae3('0x31')](db[_0x2ae3('0x59')][_0x2ae3('0x48')]);_0x5ab8ff[_0x2ae3('0x32')]=_[_0x2ae3('0x31')](_0x21cd11[_0x2ae3('0x32')]);_0x5ab8ff[_0x2ae3('0x3c')]=_['intersection'](_0x5ab8ff[_0x2ae3('0x30')],_0x5ab8ff[_0x2ae3('0x32')]);_0x34646b[_0x2ae3('0x34')]=_['intersection'](_0x5ab8ff[_0x2ae3('0x30')],qs[_0x2ae3('0x35')](_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x35')]));_0x34646b[_0x2ae3('0x34')]=_0x34646b[_0x2ae3('0x34')][_0x2ae3('0x36')]?_0x34646b[_0x2ae3('0x34')]:_0x5ab8ff[_0x2ae3('0x30')];_0x34646b['order']=qs[_0x2ae3('0x3a')](_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x3a')]);_0x34646b[_0x2ae3('0x3b')]=qs['filters'](_[_0x2ae3('0x5a')](_0x21cd11[_0x2ae3('0x32')],_0x5ab8ff[_0x2ae3('0x3c')]));if(_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x3d')]){_0x34646b[_0x2ae3('0x3b')]=_[_0x2ae3('0x3e')](_0x34646b[_0x2ae3('0x3b')],{'$or':_[_0x2ae3('0x3f')](_0x34646b[_0x2ae3('0x34')],function(_0x410f60){var _0x1079d0={};_0x1079d0[_0x410f60]={'$like':'%'+_0x21cd11[_0x2ae3('0x32')]['filter']+'%'};return _0x1079d0;})});}_0x34646b=_[_0x2ae3('0x3e')]({},_0x34646b,_0x21cd11[_0x2ae3('0x40')]);return _0x593e0e['getContacts'](_0x34646b);}})['then'](function(_0x40df5b){if(_0x40df5b){_0x47f47a=_0x40df5b[_0x2ae3('0x36')];if(!_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x37')](_0x2ae3('0x38'))){_0x34646b[_0x2ae3('0x1f')]=qs[_0x2ae3('0x1f')](_0x21cd11['query']['limit']);_0x34646b[_0x2ae3('0x1e')]=qs['offset'](_0x21cd11[_0x2ae3('0x32')][_0x2ae3('0x1e')]);}return _0x593e0e[_0x2ae3('0x57')](_0x34646b);}})['then'](function(_0x3bf098){if(_0x3bf098){return _0x3bf098?{'count':_0x47f47a,'rows':_0x3bf098}:null;}})['then'](respondWithResult(_0x45ec91,null))['catch'](handleError(_0x45ec91,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e5d986a..9f8af9b 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 _0x4af0=['bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','util','../../config/logger','api','moment'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x4af0,0x1b8));var _0x04af=function(_0x4c45f1,_0x2765ad){_0x4c45f1=_0x4c45f1-0x0;var _0x49ac1e=_0x4af0[_0x4c45f1];return _0x49ac1e;};'use strict';var _=require('lodash');var util=require(_0x04af('0x0'));var logger=require(_0x04af('0x1'))(_0x04af('0x2'));var moment=require(_0x04af('0x3'));var BPromise=require(_0x04af('0x4'));var rp=require(_0x04af('0x5'));var fs=require('fs');var path=require(_0x04af('0x6'));var rimraf=require('rimraf');var config=require(_0x04af('0x7'));var attributes=require('./cmCompany.attributes');module[_0x04af('0x8')]=function(_0x2f0806,_0x31eb8d){return _0x2f0806[_0x04af('0x9')](_0x04af('0xa'),attributes,{'tableName':_0x04af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce4=['rimraf','exports','define','CmCompany','lodash','api','moment','request-promise'];(function(_0x1b51f9,_0x46240e){var _0x46cf16=function(_0x3034c3){while(--_0x3034c3){_0x1b51f9['push'](_0x1b51f9['shift']());}};_0x46cf16(++_0x46240e);}(_0x2ce4,0x16c));var _0x42ce=function(_0x190134,_0x366609){_0x190134=_0x190134-0x0;var _0x2a654=_0x2ce4[_0x190134];return _0x2a654;};'use strict';var _=require(_0x42ce('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x42ce('0x1'));var moment=require(_0x42ce('0x2'));var BPromise=require('bluebird');var rp=require(_0x42ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42ce('0x4'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x42ce('0x5')]=function(_0x1f8e71,_0x12c2f1){return _0x1f8e71[_0x42ce('0x6')](_0x42ce('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index bc17ba8..cfa9112 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 _0x0f5a=['moment','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0x0f5a,0x109));var _0xa0f5=function(_0x52017c,_0x393604){_0x52017c=_0x52017c-0x0;var _0xada67d=_0x0f5a[_0x52017c];return _0xada67d;};'use strict';var _=require(_0xa0f5('0x0'));var util=require('util');var moment=require(_0xa0f5('0x1'));var BPromise=require('bluebird');var rs=require(_0xa0f5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0f5('0x3'));var logger=require(_0xa0f5('0x4'))(_0xa0f5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa0f5('0x6')][_0xa0f5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52d1c8,_0x314ab2,_0x1658af){return new BPromise(function(_0x448a5b,_0x56a33f){return client[_0xa0f5('0x8')](_0x52d1c8,_0x1658af)[_0xa0f5('0x9')](function(_0x136028){logger[_0xa0f5('0xa')](_0xa0f5('0xb'),_0x314ab2,_0xa0f5('0xc'));logger[_0xa0f5('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x314ab2,'request\x20sent',JSON[_0xa0f5('0xe')](_0x136028));if(_0x136028[_0xa0f5('0xf')]){if(_0x136028[_0xa0f5('0xf')]['code']===0x1f4){logger[_0xa0f5('0xf')](_0xa0f5('0xb'),_0x314ab2,_0x136028[_0xa0f5('0xf')][_0xa0f5('0x10')]);return _0x56a33f(_0x136028[_0xa0f5('0xf')]['message']);}logger[_0xa0f5('0xf')]('CmCompany,\x20%s,\x20%s',_0x314ab2,_0x136028[_0xa0f5('0xf')][_0xa0f5('0x10')]);return _0x448a5b(_0x136028[_0xa0f5('0xf')][_0xa0f5('0x10')]);}else{logger[_0xa0f5('0xa')](_0xa0f5('0xb'),_0x314ab2,_0xa0f5('0xc'));_0x448a5b(_0x136028[_0xa0f5('0x11')]['message']);}})[_0xa0f5('0x12')](function(_0x1de160){logger['error'](_0xa0f5('0xb'),_0x314ab2,_0x1de160);_0x56a33f(_0x1de160);});});} \ No newline at end of file +var _0x50a0=['request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x31328b,_0x35150c){var _0x5e23cf=function(_0x5cb686){while(--_0x5cb686){_0x31328b['push'](_0x31328b['shift']());}};_0x5e23cf(++_0x35150c);}(_0x50a0,0x115));var _0x050a=function(_0x5c54b7,_0x5693d3){_0x5c54b7=_0x5c54b7-0x0;var _0x146b07=_0x50a0[_0x5c54b7];return _0x146b07;};'use strict';var _=require(_0x050a('0x0'));var util=require(_0x050a('0x1'));var moment=require(_0x050a('0x2'));var BPromise=require(_0x050a('0x3'));var rs=require(_0x050a('0x4'));var fs=require('fs');var Redis=require(_0x050a('0x5'));var db=require(_0x050a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x050a('0x7'));var jayson=require(_0x050a('0x8'));var client=jayson[_0x050a('0x9')][_0x050a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ab180,_0x1286f3,_0x518a8d){return new BPromise(function(_0x5d4171,_0x279e72){return client[_0x050a('0xb')](_0x2ab180,_0x518a8d)[_0x050a('0xc')](function(_0x26749d){logger['info'](_0x050a('0xd'),_0x1286f3,_0x050a('0xe'));logger[_0x050a('0xf')](_0x050a('0x10'),_0x1286f3,_0x050a('0xe'),JSON[_0x050a('0x11')](_0x26749d));if(_0x26749d[_0x050a('0x12')]){if(_0x26749d[_0x050a('0x12')][_0x050a('0x13')]===0x1f4){logger[_0x050a('0x12')](_0x050a('0xd'),_0x1286f3,_0x26749d[_0x050a('0x12')]['message']);return _0x279e72(_0x26749d[_0x050a('0x12')]['message']);}logger[_0x050a('0x12')](_0x050a('0xd'),_0x1286f3,_0x26749d['error']['message']);return _0x5d4171(_0x26749d['error'][_0x050a('0x14')]);}else{logger[_0x050a('0x15')](_0x050a('0xd'),_0x1286f3,_0x050a('0xe'));_0x5d4171(_0x26749d[_0x050a('0x16')][_0x050a('0x14')]);}})[_0x050a('0x17')](function(_0x47cb4e){logger[_0x050a('0x12')]('CmCompany,\x20%s,\x20%s',_0x1286f3,_0x47cb4e);_0x279e72(_0x47cb4e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index fb8dca2..941b6e6 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 _0xe4b2=['post','create','addContacts','put','update','delete','/:id','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','show','/:id/contacts','getContacts'];(function(_0x18e3a1,_0xd51faa){var _0x69b4a1=function(_0x2509a8){while(--_0x2509a8){_0x18e3a1['push'](_0x18e3a1['shift']());}};_0x69b4a1(++_0xd51faa);}(_0xe4b2,0x1d6));var _0x2e4b=function(_0x1a398d,_0x5609c1){_0x1a398d=_0x1a398d-0x0;var _0x4314b6=_0xe4b2[_0x1a398d];return _0x4314b6;};'use strict';var multer=require('multer');var util=require(_0x2e4b('0x0'));var path=require('path');var timeout=require(_0x2e4b('0x1'));var express=require(_0x2e4b('0x2'));var router=express[_0x2e4b('0x3')]();var fs_extra=require(_0x2e4b('0x4'));var auth=require(_0x2e4b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2e4b('0x6'));var controller=require(_0x2e4b('0x7'));router[_0x2e4b('0x8')]('/',auth['isAuthenticated'](),controller[_0x2e4b('0x9')]);router[_0x2e4b('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x2e4b('0xa')](),controller[_0x2e4b('0xb')]);router[_0x2e4b('0x8')](_0x2e4b('0xc'),auth[_0x2e4b('0xa')](),controller[_0x2e4b('0xd')]);router[_0x2e4b('0xe')]('/',auth[_0x2e4b('0xa')](),controller[_0x2e4b('0xf')]);router[_0x2e4b('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x2e4b('0x10')]);router[_0x2e4b('0x11')]('/:id',auth[_0x2e4b('0xa')](),controller[_0x2e4b('0x12')]);router[_0x2e4b('0x13')](_0x2e4b('0x14'),auth[_0x2e4b('0xa')](),controller[_0x2e4b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcd96=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/contacts','post','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x152c9a,_0x15db16){var _0x43a214=function(_0x29ce5e){while(--_0x29ce5e){_0x152c9a['push'](_0x152c9a['shift']());}};_0x43a214(++_0x15db16);}(_0xcd96,0x163));var _0x6cd9=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xcd96[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0x6cd9('0x0'));var util=require(_0x6cd9('0x1'));var path=require(_0x6cd9('0x2'));var timeout=require(_0x6cd9('0x3'));var express=require(_0x6cd9('0x4'));var router=express[_0x6cd9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6cd9('0x6'));var interaction=require(_0x6cd9('0x7'));var config=require(_0x6cd9('0x8'));var controller=require(_0x6cd9('0x9'));router['get']('/',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0xb')]);router[_0x6cd9('0xc')](_0x6cd9('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x6cd9('0xc')](_0x6cd9('0xe'),auth['isAuthenticated'](),controller[_0x6cd9('0xf')]);router['get'](_0x6cd9('0x10'),auth[_0x6cd9('0xa')](),controller['getContacts']);router[_0x6cd9('0x11')]('/',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0x12')]);router[_0x6cd9('0x11')]('/:id/contacts',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0x13')]);router[_0x6cd9('0x14')](_0x6cd9('0xe'),auth[_0x6cd9('0xa')](),controller['update']);router[_0x6cd9('0x15')]('/:id',auth[_0x6cd9('0xa')](),controller[_0x6cd9('0x16')]);module[_0x6cd9('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4761584..eb3dbbd 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 _0x77b0=['STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize'];(function(_0x2f302b,_0x5ba45e){var _0x35b264=function(_0x219de8){while(--_0x219de8){_0x2f302b['push'](_0x2f302b['shift']());}};_0x35b264(++_0x5ba45e);}(_0x77b0,0xad));var _0x077b=function(_0x524541,_0xb6f8c6){_0x524541=_0x524541-0x0;var _0x4c9355=_0x77b0[_0x524541];return _0x4c9355;};'use strict';var _=require(_0x077b('0x0'));var Sequelize=require(_0x077b('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x077b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x077b('0x2')]},'street':{'type':Sequelize[_0x077b('0x2')]},'postalCode':{'type':Sequelize[_0x077b('0x2')]},'city':{'type':Sequelize[_0x077b('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x077b('0x2')]},'description':{'type':Sequelize[_0x077b('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x077b('0x2')]},'url':{'type':Sequelize[_0x077b('0x2')]},'facebook':{'type':Sequelize[_0x077b('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x077b('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x077b('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x077b('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x077b('0x2')]},'priority':{'type':Sequelize[_0x077b('0x4')](0x2)[_0x077b('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x077b('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x077b('0x2')]},'utcOffset':{'type':Sequelize[_0x077b('0x4')]}}; \ No newline at end of file +var _0x560b=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0x560b,0x79));var _0xb560=function(_0x5e4792,_0x1d0c51){_0x5e4792=_0x5e4792-0x0;var _0x16c150=_0x560b[_0x5e4792];return _0x16c150;};'use strict';var _=require(_0xb560('0x0'));var Sequelize=require(_0xb560('0x1'));module[_0xb560('0x2')]={'firstName':{'type':Sequelize[_0xb560('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb560('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb560('0x3')]},'country':{'type':Sequelize[_0xb560('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb560('0x3')]},'description':{'type':Sequelize[_0xb560('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb560('0x3')]},'email':{'type':Sequelize[_0xb560('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xb560('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xb560('0x3')]},'teams':{'type':Sequelize[_0xb560('0x3')]},'viber':{'type':Sequelize[_0xb560('0x3')]},'line':{'type':Sequelize[_0xb560('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xb560('0x3')]},'UserId':{'type':Sequelize[_0xb560('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xb560('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb560('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb560('0x7')]},'dialTimezone':{'type':Sequelize[_0xb560('0x3')]},'utcOffset':{'type':Sequelize[_0xb560('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 120f2e7..e11f43e 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 _0xdcba=['cf_','columnName','analytics','CmCustomField','findAll','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','ListId','findOrCreate','push','all','show','Tag','Tags','color','tag','ContactItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','isEmpty','setFields','id\x20=\x20?','text','phone','getTags','findOne','model','intersection','attributes','fields','order','sort','filters','pick','filter','options','nolimit','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','create','PHONE','CmHopperAdditionalPhone','ItemType','`ItemType`.OrderBy','CmHopperId','item','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','rawAttributes','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','createReadStream','path','parse','meta','User','agent','No\x20ListId\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','binding','child_process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','Website','Account','closed','closedAt','disposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','threadId','startCase','Interaction','sortBy','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','json','offset','undefined','limit','count','Content-Range','update','then','destroy','status','sendStatus','error','stack','name','describe','getOptions','query','user','catch','CmContact','find','params','tags','keys','length','startsWith'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xdcba,0xd5));var _0xadcb=function(_0x189ea9,_0x2bfa00){_0x189ea9=_0x189ea9-0x0;var _0x22de2e=_0xdcba[_0x189ea9];return _0x22de2e;};'use strict';var moment=require(_0xadcb('0x0'));var BPromise=require(_0xadcb('0x1'));var util=require(_0xadcb('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xadcb('0x3'));var Papa=require('papaparse');var Redis=require(_0xadcb('0x4'));var contacts=require(_0xadcb('0x5'));var qs=require(_0xadcb('0x6'));var logger=require(_0xadcb('0x7'))(_0xadcb('0x8'));var config=require(_0xadcb('0x9'));var shared=require(_0xadcb('0xa'));var db=require(_0xadcb('0xb'))['db'];config[_0xadcb('0xc')]=_[_0xadcb('0xd')](config[_0xadcb('0xc')],{'host':_0xadcb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadcb('0xc')]));require(_0xadcb('0xf'))[_0xadcb('0x10')](socket);function respondWithResult(_0x3037b4,_0xd96787){_0xd96787=_0xd96787||0xc8;return function(_0x5b9167){if(_0x5b9167){return _0x3037b4['status'](_0xd96787)[_0xadcb('0x11')](_0x5b9167);}};}function respondWithFilteredResult(_0x1598af,_0x3e6b3f){return function(_0x250cff){if(_0x250cff){var _0x13e6bc=typeof _0x3e6b3f[_0xadcb('0x12')]===_0xadcb('0x13')&&typeof _0x3e6b3f[_0xadcb('0x14')]===_0xadcb('0x13');var _0x419316=_0x250cff['count'];var _0xf6a50c=_0x13e6bc?0x0:_0x3e6b3f[_0xadcb('0x12')];var _0x59504d=_0x13e6bc?_0x250cff[_0xadcb('0x15')]:_0x3e6b3f[_0xadcb('0x12')]+_0x3e6b3f['limit'];var _0xd04b8a;if(_0x59504d>=_0x419316){_0x59504d=_0x419316;_0xd04b8a=0xc8;}else{_0xd04b8a=0xce;}_0x1598af['status'](_0xd04b8a);return _0x1598af['set'](_0xadcb('0x16'),_0xf6a50c+'-'+_0x59504d+'/'+_0x419316)[_0xadcb('0x11')](_0x250cff);}return null;};}function saveUpdates(_0x52f240){return function(_0x4d9826){if(_0x4d9826){return _0x4d9826[_0xadcb('0x17')](_0x52f240)[_0xadcb('0x18')](function(_0x202121){return _0x202121;});}return null;};}function removeEntity(_0x3b52a6){return function(_0xd761e1){if(_0xd761e1){return _0xd761e1[_0xadcb('0x19')]()[_0xadcb('0x18')](function(){_0x3b52a6[_0xadcb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x744fc8){return function(_0x451305){if(!_0x451305){_0x744fc8[_0xadcb('0x1b')](0x194);}return _0x451305;};}function handleError(_0x4c320e,_0x186faf){_0x186faf=_0x186faf||0x1f4;return function(_0x5711f3){logger[_0xadcb('0x1c')](_0x5711f3[_0xadcb('0x1d')]);if(_0x5711f3[_0xadcb('0x1e')]){delete _0x5711f3[_0xadcb('0x1e')];}_0x4c320e['status'](_0x186faf)['send'](_0x5711f3);};}exports['index']=function(_0x56c8a4,_0x5122a1){var _0x129184={};return contacts[_0xadcb('0x1f')]()[_0xadcb('0x18')](function(_0x33f888){_0x129184=qs[_0xadcb('0x20')](_0x33f888,_0x56c8a4);return contacts['findAll'](_0x56c8a4[_0xadcb('0x21')],_0x56c8a4[_0xadcb('0x22')],_0x129184,_0x33f888);})[_0xadcb('0x18')](respondWithFilteredResult(_0x5122a1,_0x129184))[_0xadcb('0x23')](handleError(_0x5122a1,null));};exports[_0xadcb('0x19')]=function(_0x2a6762,_0x41f8c9){return db[_0xadcb('0x24')][_0xadcb('0x25')]({'where':{'id':_0x2a6762[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x41f8c9,null))[_0xadcb('0x18')](removeEntity(_0x41f8c9,null))[_0xadcb('0x23')](handleError(_0x41f8c9,null));};exports['describe']=function(_0x5ac9a6,_0x2ef163){return db[_0xadcb('0x24')][_0xadcb('0x1f')]()['then'](function(_0x56d84e){delete _0x56d84e[_0xadcb('0x27')];for(var _0x51d39c=0x0;_0x51d39c0x0){return new Promise(function(_0x2c6d93){var _0x44c85a=[];for(var _0x41f8af=0x0;_0x41f8af<_0x50cf8b[_0xadcb('0x29')];_0x41f8af++){_0x44c85a[_0xadcb('0x60')](insertAdditionalPhones(_0x50cf8b[_0x41f8af]['contact'],_0x50cf8b[_0x41f8af][_0xadcb('0x59')]));}Promise[_0xadcb('0x61')](_0x44c85a)[_0xadcb('0x18')](function(){_0x2c6d93(0x1);});})[_0xadcb('0x18')](function(){return{'success':_0x182907,'failure':_0x243368,'duplicates':_0x1c3e4e};});}else{return{'success':_0x182907,'failure':_0x243368,'duplicates':_0x1c3e4e};}}})[_0xadcb('0x18')](respondWithResult(_0x412eee,0xc9))[_0xadcb('0x23')](handleError(_0x412eee,null));};exports[_0xadcb('0x62')]=function(_0x1ed318,_0x137141){var _0x5251de;return db[_0xadcb('0x24')]['describe']()[_0xadcb('0x18')](function(_0x160022){return db['CmContact'][_0xadcb('0x25')]({'where':{'id':_0x1ed318[_0xadcb('0x26')]['id']},'include':[{'model':db[_0xadcb('0x63')],'as':_0xadcb('0x64'),'attributes':['id',_0xadcb('0x1e'),_0xadcb('0x65')],'required':_0x1ed318['query'][_0xadcb('0x66')]?!![]:![]},{'model':db[_0xadcb('0x4b')],'as':'Phones','where':{'CmContactId':_0x1ed318['params']['id']},'required':![],'include':[{'model':db[_0xadcb('0x67')],'as':'ItemType'}]}],'order':[db[_0xadcb('0x68')][_0xadcb('0x69')](_0xadcb('0x6a'))],'attributes':_[_0xadcb('0x28')](_0x160022)});})[_0xadcb('0x18')](function(_0xbaeed7){if(!_[_0xadcb('0x55')](_0xbaeed7)){_0x5251de=_0xbaeed7['get']({'plain':!![]});var _0x327511={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xbaeed7&&_0xbaeed7[_0xadcb('0x5e')]){if(_0xbaeed7[_0xadcb('0x5e')]){_0x327511[_0xadcb('0x5d')][_0xadcb('0x6b')][_0xadcb('0x60')]({'ListId':{'$ne':_0xbaeed7[_0xadcb('0x5e')]}});}}return db[_0xadcb('0x2e')][_0xadcb('0x2f')](_0x327511);}})['then'](function(_0x4aa64e){if(!_[_0xadcb('0x55')](_0x4aa64e)){return _[_0xadcb('0x6c')](_0x5251de,_[_0xadcb('0x6d')](_0x4aa64e,function(_0x10a07f){return util[_0xadcb('0x6e')]('cf_%d',_0x10a07f['id']);}));}})['then'](handleEntityNotFound(_0x137141,null))['then'](respondWithResult(_0x137141,null))[_0xadcb('0x23')](handleError(_0x137141,null));};exports[_0xadcb('0x17')]=function(_0xe64cbb,_0x572af4){var _0x3a18bb;if(_0xe64cbb[_0xadcb('0x37')]['id']){delete _0xe64cbb[_0xadcb('0x37')]['id'];}if(!_['isNil'](_0xe64cbb[_0xadcb('0x37')]['dialTimezone'])){var _0x5ce93c=_0xe64cbb[_0xadcb('0x37')][_0xadcb('0x56')];if(!_[_0xadcb('0x55')](shared[_0xadcb('0x57')][_0x5ce93c]))_0xe64cbb['body'][_0xadcb('0x58')]=shared['timezones'][_0x5ce93c]['utcOffset'];}return db[_0xadcb('0x24')]['find']({'where':{'id':_0xe64cbb[_0xadcb('0x26')]['id']}})['then'](handleEntityNotFound(_0x572af4,null))['then'](saveUpdates(_0xe64cbb['body'],null))[_0xadcb('0x18')](function(_0x3e4f93){_0x3a18bb=_0x3e4f93;var _0x4823c4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3e4f93&&_0x3e4f93[_0xadcb('0x5e')]){if(_0x3e4f93['ListId']){_0x4823c4['where'][_0xadcb('0x6b')][_0xadcb('0x60')]({'ListId':{'$ne':_0x3e4f93['ListId']}});}}return db[_0xadcb('0x2e')]['findAll'](_0x4823c4);})['then'](function(_0x245505){if(_0x245505){return _[_0xadcb('0x6c')](_['pickBy'](_0xe64cbb[_0xadcb('0x37')],function(_0xfa8bce,_0x1385bf){return _[_0xadcb('0x2a')](_0x1385bf,'cf_');}),_['map'](_0x245505,function(_0x520dc3){return util[_0xadcb('0x6e')]('cf_%d',_0x520dc3['id']);}));}})['then'](function(_0x14ca9a){if(_0x14ca9a&&!_[_0xadcb('0x6f')](_0x14ca9a)){var _0x4f5070=squel['update']()['table']('cm_contacts')[_0xadcb('0x70')](_0x14ca9a)[_0xadcb('0x5d')](_0xadcb('0x71'),_0xe64cbb[_0xadcb('0x26')]['id'])['toParam']();return db['sequelize'][_0xadcb('0x21')](_0x4f5070[_0xadcb('0x72')],{'replacements':_0x4f5070['values']});}})[_0xadcb('0x18')](function(){if(_0xe64cbb[_0xadcb('0x37')]['phone']&&_0x3a18bb){return db[_0xadcb('0x3e')]['update']({'phone':_0xe64cbb[_0xadcb('0x37')][_0xadcb('0x73')],'OrderBy':0x0},{'where':{'ContactId':_0x3a18bb['id']}});}})[_0xadcb('0x18')](function(){return _0x3a18bb;})[_0xadcb('0x18')](respondWithResult(_0x572af4,null))['catch'](handleError(_0x572af4,null));};exports[_0xadcb('0x74')]=function(_0x382e0e,_0x4177f1){var _0x572100={};var _0x2ad0db={};var _0x486c32;var _0x53eda4;return db[_0xadcb('0x24')][_0xadcb('0x75')]({'where':{'id':_0x382e0e[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x4177f1,null))[_0xadcb('0x18')](function(_0xdb56c8){if(_0xdb56c8){_0x486c32=_0xdb56c8;_0x2ad0db[_0xadcb('0x76')]=_[_0xadcb('0x28')](db[_0xadcb('0x63')]['rawAttributes']);_0x2ad0db[_0xadcb('0x21')]=_['keys'](_0x382e0e[_0xadcb('0x21')]);_0x2ad0db['filters']=_[_0xadcb('0x77')](_0x2ad0db['model'],_0x2ad0db['query']);_0x572100[_0xadcb('0x78')]=_[_0xadcb('0x77')](_0x2ad0db[_0xadcb('0x76')],qs[_0xadcb('0x79')](_0x382e0e[_0xadcb('0x21')]['fields']));_0x572100[_0xadcb('0x78')]=_0x572100[_0xadcb('0x78')][_0xadcb('0x29')]?_0x572100[_0xadcb('0x78')]:_0x2ad0db[_0xadcb('0x76')];_0x572100[_0xadcb('0x7a')]=qs[_0xadcb('0x7b')](_0x382e0e[_0xadcb('0x21')][_0xadcb('0x7b')]);_0x572100[_0xadcb('0x5d')]=qs[_0xadcb('0x7c')](_[_0xadcb('0x7d')](_0x382e0e['query'],_0x2ad0db[_0xadcb('0x7c')]));if(_0x382e0e[_0xadcb('0x21')]['filter']){_0x572100[_0xadcb('0x5d')]=_[_0xadcb('0x36')](_0x572100[_0xadcb('0x5d')],{'$or':_[_0xadcb('0x6d')](_0x572100['attributes'],function(_0x1cd3ea){var _0x3dabef={};_0x3dabef[_0x1cd3ea]={'$like':'%'+_0x382e0e[_0xadcb('0x21')][_0xadcb('0x7e')]+'%'};return _0x3dabef;})});}_0x572100=_[_0xadcb('0x36')]({},_0x572100,_0x382e0e[_0xadcb('0x7f')]);return _0x486c32[_0xadcb('0x74')](_0x572100);}})[_0xadcb('0x18')](function(_0x10c646){if(_0x10c646){_0x53eda4=_0x10c646[_0xadcb('0x29')];if(!_0x382e0e['query'][_0xadcb('0x35')](_0xadcb('0x80'))){_0x572100[_0xadcb('0x14')]=qs[_0xadcb('0x14')](_0x382e0e[_0xadcb('0x21')][_0xadcb('0x14')]);_0x572100['offset']=qs[_0xadcb('0x12')](_0x382e0e[_0xadcb('0x21')][_0xadcb('0x12')]);}return _0x486c32[_0xadcb('0x74')](_0x572100);}})[_0xadcb('0x18')](function(_0x582976){if(_0x582976){return _0x582976?{'count':_0x53eda4,'rows':_0x582976}:null;}})[_0xadcb('0x18')](respondWithResult(_0x4177f1,null))[_0xadcb('0x23')](handleError(_0x4177f1,null));};exports[_0xadcb('0x81')]=function(_0x50f0c1,_0x4be2d1){if(_0x50f0c1['body']['id']){delete _0x50f0c1[_0xadcb('0x37')]['id'];}return db[_0xadcb('0x24')][_0xadcb('0x75')]({'where':{'id':_0x50f0c1[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x4be2d1,null))[_0xadcb('0x18')](function(_0x16d67c){if(_0x16d67c){return _0x16d67c[_0xadcb('0x81')](_0x50f0c1['body'][_0xadcb('0x82')]||[]);}return null;})['then'](respondWithResult(_0x4be2d1,null))['catch'](handleError(_0x4be2d1,null));};exports['setAdditionalPhones']=function(_0x94b12b,_0x3a67d8){var _0x2c0711=[];_0x2c0711['push'](addAdditionalPhones(_0x94b12b[_0xadcb('0x37')]));Promise['all'](_0x2c0711)['then'](function(){_0x2c0711=[];_0x2c0711['push'](deleteCmHopperPhones(_0x94b12b['body']['id']));_0x2c0711['push'](addCmHopperPhones(_0x94b12b[_0xadcb('0x37')]['id']));Promise[_0xadcb('0x61')](_0x2c0711)['then'](function(){return[0x1];})[_0xadcb('0x18')](respondWithResult(_0x3a67d8,null));});};function addAdditionalPhones(_0x526c3f){var _0xbb13cf;return new Promise(function(_0xe63947){return db[_0xadcb('0x4b')][_0xadcb('0x19')]({'where':{'CmContactId':_0x526c3f['id']}})['then'](function(){db[_0xadcb('0x67')][_0xadcb('0x2f')]({'raw':!![],'attributes':['id',_0xadcb('0x83')]})[_0xadcb('0x18')](function(_0x49bfb9){var _0x21cf9e=[];for(var _0x31e8ac=0x0;_0x31e8ac<_0x526c3f[_0xadcb('0x84')]['length'];_0x31e8ac++){var _0x37da69=_0x526c3f[_0xadcb('0x85')]?_['isNil'](_0x526c3f['item_types'][_0x31e8ac])?'':_0x526c3f['item_types'][_0x31e8ac]:_0x526c3f[_0xadcb('0x84')][_0x31e8ac][_0xadcb('0x86')]?_0x526c3f[_0xadcb('0x84')][_0x31e8ac]['ItemTypeId']:'';var _0x2686d2=_[_0xadcb('0x55')](_0x526c3f['items'][_0x31e8ac][_0xadcb('0x87')])?'':_0x526c3f['items'][_0x31e8ac][_0xadcb('0x87')];var _0x5eaf56=_0x37da69+':'+_0x526c3f[_0xadcb('0x84')][_0x31e8ac]['phone']+'§'+_0x2686d2;if(_[_0xadcb('0x55')](_0xbb13cf))_0xbb13cf=_0x5eaf56;else _0xbb13cf+=';'+_0x5eaf56;var _0x2b2f4b=null;var _0x59bbf3=null;if(_0x526c3f[_0xadcb('0x85')]){if(!_['isNil'](_0x526c3f[_0xadcb('0x85')][_0x31e8ac])){_0x59bbf3=_['find'](_0x49bfb9,function(_0x186dff){return _0x186dff['id']===_0x526c3f[_0xadcb('0x85')][_0x31e8ac];});if(!_[_0xadcb('0x55')](_0x59bbf3)){_0x2b2f4b=_0x59bbf3[_0xadcb('0x83')];}}}else{if(!_['isNil'](_0x526c3f['items'][_0x31e8ac])){_0x59bbf3=_[_0xadcb('0x25')](_0x49bfb9,function(_0x30ea7a){return _0x30ea7a['id']===_0x526c3f[_0xadcb('0x84')][_0x31e8ac][_0xadcb('0x86')];});if(!_[_0xadcb('0x55')](_0x59bbf3)){_0x2b2f4b=_0x31e8ac;}}}if(_['isNil'](_0x2b2f4b)){_0x2b2f4b=0x64;}_0x21cf9e[_0xadcb('0x60')](addAdditionalPhone(_0x526c3f['id'],_0x526c3f['items'][_0x31e8ac][_0xadcb('0x73')],_0x526c3f[_0xadcb('0x85')]?_[_0xadcb('0x55')](_0x526c3f['item_types'][_0x31e8ac])?null:_0x526c3f[_0xadcb('0x85')][_0x31e8ac]:_0x526c3f[_0xadcb('0x84')][_0x31e8ac][_0xadcb('0x86')]?_0x526c3f[_0xadcb('0x84')][_0x31e8ac][_0xadcb('0x86')]:null,_0x2b2f4b,_0x2686d2));}Promise[_0xadcb('0x61')](_0x21cf9e)[_0xadcb('0x18')](function(){db[_0xadcb('0x24')]['update']({'AdditionalPhones':_0xbb13cf},{'where':{'id':_0x526c3f['id']}})[_0xadcb('0x18')](function(){_0xe63947(0x1);});});});});});}function addAdditionalPhone(_0x1822b2,_0x8456ec,_0x1944df,_0x5e40d0,_0x3c43a3){return db[_0xadcb('0x4b')]['find']({'where':{'CmContactId':_0x1822b2,'item':_0x8456ec}})[_0xadcb('0x18')](function(_0x11cf98){if(_0x11cf98)logger[_0xadcb('0x33')](_0xadcb('0x88'),_0x11cf98);else{db['CmContactHasItem'][_0xadcb('0x89')]({'CmContactId':_0x1822b2,'item':_0x8456ec,'ItemTypeId':_0x1944df,'OrderBy':_0x5e40d0,'ItemClass':_0xadcb('0x8a'),'description':_0x3c43a3});}});}function deleteCmHopperPhones(_0x1b7104){return new Promise(function(_0x520340){return db['CmHopper'][_0xadcb('0x2f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1b7104}})[_0xadcb('0x18')](function(_0x4ac4d2){db[_0xadcb('0x8b')][_0xadcb('0x19')]({'where':{'CmHopperId':{'$in':_[_0xadcb('0x6d')](_0x4ac4d2,'id')}}});})[_0xadcb('0x18')](function(){_0x520340(0x1);});});}function addCmHopperPhones(_0x55a686){return new Promise(function(_0x1c6f65){return db[_0xadcb('0x3e')][_0xadcb('0x2f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x55a686}})[_0xadcb('0x18')](function(_0x28dd50){var _0x4a6ea4=[];_['map'](_0x28dd50,function(_0x2c99f6){_0x4a6ea4[_0xadcb('0x60')](createCmHopperPhone(_0x55a686,_0x2c99f6['id']));});Promise['all'](_0x4a6ea4)['then'](function(){_0x1c6f65(0x1);});});});}function createCmHopperPhone(_0x4a391e,_0x442971){return new Promise(function(_0x2fb432){db[_0xadcb('0x4b')]['findAll']({'raw':!![],'attributes':['item',_0xadcb('0x83')],'where':{'CmContactId':_0x4a391e,'ItemClass':_0xadcb('0x8a')},'include':[{'model':db[_0xadcb('0x67')],'attributes':[_0xadcb('0x83')],'as':_0xadcb('0x8c')}],'order':['OrderBy',db[_0xadcb('0x68')]['literal'](_0xadcb('0x8d'))]})[_0xadcb('0x18')](function(_0x4c06c5){var _0xed6527=0x1;var _0x1c318d=_['map'](_0x4c06c5,function(_0x52eb76){_0x52eb76[_0xadcb('0x8e')]=_0x442971;_0x52eb76[_0xadcb('0x73')]=_0x52eb76[_0xadcb('0x8f')];_0x52eb76[_0xadcb('0x83')]=_0xed6527;delete _0x52eb76['ItemType.OrderBy'];_0xed6527=_0xed6527+0x1;return _0x52eb76;});return db[_0xadcb('0x8b')][_0xadcb('0x5a')](_0x1c318d,{});})[_0xadcb('0x18')](function(){_0x2fb432(0x1);});});}function insertAdditionalPhones(_0x19ebf3,_0x23afba){return new Promise(function(_0x395df3){var _0x4a78a0=[];for(var _0x44fcf1=0x0;_0x44fcf1<_0x23afba[_0xadcb('0x29')];_0x44fcf1++){var _0x111043=_0x23afba[_0x44fcf1];_0x4a78a0['push'](parseContactItemType(_0x111043));}Promise[_0xadcb('0x61')](_0x4a78a0)[_0xadcb('0x18')](function(){var _0x1c5bc7={'id':_0x19ebf3['id'],'items':_0x23afba};return addAdditionalPhones(_0x1c5bc7)[_0xadcb('0x18')](function(){return addCmHopperPhones(_0x19ebf3['id']);});})[_0xadcb('0x18')](function(){_0x395df3(_0x19ebf3);});});}function parseContactItemType(_0x4a7dc9){return new Promise(function(_0x128065){if(_0x4a7dc9[_0xadcb('0x35')]('ItemTypeId')){_0x128065(_0x4a7dc9);}else{return db['ContactItemType'][_0xadcb('0x25')]({'where':{'name':_0x4a7dc9[_0xadcb('0x8c')]}})[_0xadcb('0x18')](function(_0xe1713a){if(_[_0xadcb('0x55')](_0xe1713a))_0x4a7dc9['ItemTypeId']=null;else _0x4a7dc9[_0xadcb('0x86')]=_0xe1713a['id'];_0x128065(_0x4a7dc9);});}});}exports['getAdditionalPhones']=function(_0x26561c,_0x21f09e){return db[_0xadcb('0x4b')][_0xadcb('0x2f')]({'raw':!![],'where':{'CmContactId':_0x26561c[_0xadcb('0x26')]['id'],'ItemClass':_0xadcb('0x8a')},'include':[{'model':db[_0xadcb('0x67')],'as':_0xadcb('0x8c')}],'order':[[_0xadcb('0x83')],[db['sequelize'][_0xadcb('0x69')](_0xadcb('0x8d'))]]})[_0xadcb('0x18')](function(_0x3e9021){return _0x3e9021;})[_0xadcb('0x18')](respondWithResult(_0x21f09e,null))[_0xadcb('0x23')](handleError(_0x21f09e,null));};exports[_0xadcb('0x90')]=function(_0x1e98d7,_0x3e1606){return db[_0xadcb('0x4b')][_0xadcb('0x2f')]({'raw':!![],'where':{'CmContactId':_0x1e98d7[_0xadcb('0x37')][_0xadcb('0x91')]}})[_0xadcb('0x18')](function(_0x3d17c1){var _0x2ad57f=_['map'](_0x3d17c1,function(_0x285a65){_0x285a65[_0xadcb('0x92')]=_0x1e98d7[_0xadcb('0x37')][_0xadcb('0x93')];return _0x285a65;});return db[_0xadcb('0x4b')][_0xadcb('0x5a')](_0x2ad57f,{});})[_0xadcb('0x18')](function(){return addCmHopperPhones(_0x1e98d7['body']['toContactId']);})['then'](function(){return['ok'];})[_0xadcb('0x18')](respondWithResult(_0x3e1606,null))[_0xadcb('0x23')](handleError(_0x3e1606,null));};exports['rescheduleAdditionalPhones']=function(_0xe14984,_0x250428){var _0x26924d=[];_0x26924d[_0xadcb('0x60')](createCmHopperPhone(_0xe14984[_0xadcb('0x37')]['id'],_0xe14984['body'][_0xadcb('0x94')]));Promise['all'](_0x26924d)[_0xadcb('0x18')](function(){return[0x1];})[_0xadcb('0x18')](respondWithResult(_0x250428,null));};exports['getHoppers']=function(_0xf3ec7e,_0x4bd3b3){var _0x1efdc5={'raw':![],'where':{}};var _0x2300be={};var _0x59ba9b={'count':0x0,'rows':[]};return db[_0xadcb('0x24')][_0xadcb('0x75')]({'where':{'id':_0xf3ec7e[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x4bd3b3,null))[_0xadcb('0x18')](function(_0x40e34c){if(_0x40e34c){_0x2300be[_0xadcb('0x76')]=_['keys'](db['CmHopper'][_0xadcb('0x95')]);_0x2300be[_0xadcb('0x21')]=_[_0xadcb('0x28')](_0xf3ec7e[_0xadcb('0x21')]);_0x2300be[_0xadcb('0x7c')]=_[_0xadcb('0x77')](_0x2300be['model'],_0x2300be['query']);_0x1efdc5[_0xadcb('0x78')]=_[_0xadcb('0x77')](_0x2300be[_0xadcb('0x76')],qs[_0xadcb('0x79')](_0xf3ec7e[_0xadcb('0x21')]['fields']));_0x1efdc5[_0xadcb('0x78')]=_0x1efdc5['attributes'][_0xadcb('0x29')]?_0x1efdc5[_0xadcb('0x78')]:_0x2300be[_0xadcb('0x76')];if(!_0xf3ec7e[_0xadcb('0x21')]['hasOwnProperty'](_0xadcb('0x80'))){_0x1efdc5[_0xadcb('0x14')]=qs[_0xadcb('0x14')](_0xf3ec7e[_0xadcb('0x21')]['limit']);_0x1efdc5['offset']=qs[_0xadcb('0x12')](_0xf3ec7e[_0xadcb('0x21')][_0xadcb('0x12')]);}_0x1efdc5[_0xadcb('0x7a')]=qs['sort'](_0xf3ec7e['query'][_0xadcb('0x7b')]);_0x1efdc5['where']=qs[_0xadcb('0x7c')](_['pick'](_0xf3ec7e['query'],_0x2300be[_0xadcb('0x7c')]));_0x1efdc5[_0xadcb('0x5d')][_0xadcb('0x96')]=_0x40e34c['id'];if(_0xf3ec7e[_0xadcb('0x21')][_0xadcb('0x7e')]){_0x1efdc5[_0xadcb('0x5d')]=_[_0xadcb('0x36')](_0x1efdc5['where'],{'$or':_[_0xadcb('0x6d')](_0x1efdc5['attributes'],function(_0x328a43){var _0x38afd8={};_0x38afd8[_0x328a43]={'$like':'%'+_0xf3ec7e['query'][_0xadcb('0x7e')]+'%'};return _0x38afd8;})});}_0x1efdc5=_[_0xadcb('0x36')]({},_0x1efdc5,_0xf3ec7e[_0xadcb('0x7f')]);return db[_0xadcb('0x3e')][_0xadcb('0x15')]({'where':_0x1efdc5[_0xadcb('0x5d')]})[_0xadcb('0x18')](function(_0x1428ae){_0x59ba9b[_0xadcb('0x15')]=_0x1428ae;if(_0xf3ec7e[_0xadcb('0x21')][_0xadcb('0x97')]){_0x1efdc5[_0xadcb('0x98')]=[{'all':!![]}];}return db[_0xadcb('0x3e')][_0xadcb('0x2f')](_0x1efdc5);})['then'](function(_0x46b120){_0x59ba9b[_0xadcb('0x99')]=_0x46b120;return _0x59ba9b;});}})[_0xadcb('0x18')](respondWithFilteredResult(_0x4bd3b3,_0x1efdc5))[_0xadcb('0x23')](handleError(_0x4bd3b3,null));};exports[_0xadcb('0x9a')]=function(_0x531877,_0x47e0c8){var _0x25b120={'raw':!![],'where':{}};var _0x36e749={};var _0x39033b={'count':0x0,'rows':[]};return db['CmContact'][_0xadcb('0x75')]({'where':{'id':_0x531877[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x47e0c8,null))[_0xadcb('0x18')](function(_0xe4fe6c){if(_0xe4fe6c){_0x36e749[_0xadcb('0x76')]=_[_0xadcb('0x28')](db[_0xadcb('0x4d')][_0xadcb('0x95')]);_0x36e749['query']=_[_0xadcb('0x28')](_0x531877[_0xadcb('0x21')]);_0x36e749[_0xadcb('0x7c')]=_[_0xadcb('0x77')](_0x36e749[_0xadcb('0x76')],_0x36e749[_0xadcb('0x21')]);_0x25b120[_0xadcb('0x78')]=_[_0xadcb('0x77')](_0x36e749[_0xadcb('0x76')],qs[_0xadcb('0x79')](_0x531877[_0xadcb('0x21')][_0xadcb('0x79')]));_0x25b120[_0xadcb('0x78')]=_0x25b120['attributes'][_0xadcb('0x29')]?_0x25b120[_0xadcb('0x78')]:_0x36e749['model'];if(!_0x531877[_0xadcb('0x21')][_0xadcb('0x35')](_0xadcb('0x80'))){_0x25b120[_0xadcb('0x14')]=qs[_0xadcb('0x14')](_0x531877[_0xadcb('0x21')][_0xadcb('0x14')]);_0x25b120['offset']=qs[_0xadcb('0x12')](_0x531877['query'][_0xadcb('0x12')]);}_0x25b120[_0xadcb('0x7a')]=qs[_0xadcb('0x7b')](_0x531877[_0xadcb('0x21')][_0xadcb('0x7b')]);_0x25b120[_0xadcb('0x5d')]=qs['filters'](_[_0xadcb('0x7d')](_0x531877[_0xadcb('0x21')],_0x36e749[_0xadcb('0x7c')]));_0x25b120[_0xadcb('0x5d')][_0xadcb('0x96')]=_0xe4fe6c['id'];if(_0x531877[_0xadcb('0x21')]['filter']){_0x25b120['where']=_[_0xadcb('0x36')](_0x25b120[_0xadcb('0x5d')],{'$or':_[_0xadcb('0x6d')](_0x25b120[_0xadcb('0x78')],function(_0x264f89){var _0x56d80b={};_0x56d80b[_0x264f89]={'$like':'%'+_0x531877[_0xadcb('0x21')][_0xadcb('0x7e')]+'%'};return _0x56d80b;})});}_0x25b120=_['merge']({},_0x25b120,_0x531877['options']);return db[_0xadcb('0x4d')][_0xadcb('0x15')]({'where':_0x25b120[_0xadcb('0x5d')]})[_0xadcb('0x18')](function(_0x351a73){_0x39033b[_0xadcb('0x15')]=_0x351a73;if(_0x531877[_0xadcb('0x21')][_0xadcb('0x97')]){_0x25b120['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xadcb('0x2f')](_0x25b120);})['then'](function(_0x4067cb){_0x39033b[_0xadcb('0x99')]=_0x4067cb;return _0x39033b;});}})[_0xadcb('0x18')](respondWithFilteredResult(_0x47e0c8,_0x25b120))[_0xadcb('0x23')](handleError(_0x47e0c8,null));};exports[_0xadcb('0x9b')]=function(_0x5b7d0a,_0x57057b){var _0x1124dc={'raw':!![],'where':{}};var _0x528542={};var _0x265919={'count':0x0,'rows':[]};return db[_0xadcb('0x24')]['findOne']({'where':{'id':_0x5b7d0a[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x57057b,null))[_0xadcb('0x18')](function(_0x324a66){if(_0x324a66){_0x528542[_0xadcb('0x76')]=_[_0xadcb('0x28')](db[_0xadcb('0x4c')][_0xadcb('0x95')]);_0x528542[_0xadcb('0x21')]=_['keys'](_0x5b7d0a['query']);_0x528542[_0xadcb('0x7c')]=_[_0xadcb('0x77')](_0x528542[_0xadcb('0x76')],_0x528542['query']);_0x1124dc[_0xadcb('0x78')]=_[_0xadcb('0x77')](_0x528542[_0xadcb('0x76')],qs[_0xadcb('0x79')](_0x5b7d0a[_0xadcb('0x21')][_0xadcb('0x79')]));_0x1124dc[_0xadcb('0x78')]=_0x1124dc['attributes']['length']?_0x1124dc[_0xadcb('0x78')]:_0x528542['model'];if(!_0x5b7d0a[_0xadcb('0x21')][_0xadcb('0x35')]('nolimit')){_0x1124dc[_0xadcb('0x14')]=qs[_0xadcb('0x14')](_0x5b7d0a['query'][_0xadcb('0x14')]);_0x1124dc[_0xadcb('0x12')]=qs['offset'](_0x5b7d0a['query'][_0xadcb('0x12')]);}_0x1124dc[_0xadcb('0x7a')]=qs[_0xadcb('0x7b')](_0x5b7d0a[_0xadcb('0x21')]['sort']);_0x1124dc['where']=qs[_0xadcb('0x7c')](_[_0xadcb('0x7d')](_0x5b7d0a[_0xadcb('0x21')],_0x528542[_0xadcb('0x7c')]));_0x1124dc[_0xadcb('0x5d')]['ContactId']=_0x324a66['id'];if(_0x5b7d0a[_0xadcb('0x21')]['filter']){_0x1124dc[_0xadcb('0x5d')]=_[_0xadcb('0x36')](_0x1124dc[_0xadcb('0x5d')],{'$or':_[_0xadcb('0x6d')](_0x1124dc[_0xadcb('0x78')],function(_0x2d48e0){var _0x15cd56={};_0x15cd56[_0x2d48e0]={'$like':'%'+_0x5b7d0a[_0xadcb('0x21')]['filter']+'%'};return _0x15cd56;})});}_0x1124dc=_[_0xadcb('0x36')]({},_0x1124dc,_0x5b7d0a[_0xadcb('0x7f')]);return db['CmHopperFinal'][_0xadcb('0x15')]({'where':_0x1124dc[_0xadcb('0x5d')]})[_0xadcb('0x18')](function(_0x36e5e4){_0x265919[_0xadcb('0x15')]=_0x36e5e4;if(_0x5b7d0a[_0xadcb('0x21')]['includeAll']){_0x1124dc[_0xadcb('0x98')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x1124dc);})[_0xadcb('0x18')](function(_0x425314){_0x265919[_0xadcb('0x99')]=_0x425314;return _0x265919;});}})[_0xadcb('0x18')](respondWithFilteredResult(_0x57057b,_0x1124dc))['catch'](handleError(_0x57057b,null));};exports[_0xadcb('0x9c')]=function(_0x3ff025,_0x1a0a12){var _0x2a8f4a={'raw':!![],'where':{}};var _0x356e01={};var _0x1cc80b={'count':0x0,'rows':[]};return db[_0xadcb('0x24')][_0xadcb('0x75')]({'where':{'id':_0x3ff025[_0xadcb('0x26')]['id']}})[_0xadcb('0x18')](handleEntityNotFound(_0x1a0a12,null))[_0xadcb('0x18')](function(_0x1419f7){if(_0x1419f7){_0x356e01[_0xadcb('0x76')]=_['keys'](db[_0xadcb('0x52')]['rawAttributes']);_0x356e01[_0xadcb('0x21')]=_[_0xadcb('0x28')](_0x3ff025[_0xadcb('0x21')]);_0x356e01[_0xadcb('0x7c')]=_[_0xadcb('0x77')](_0x356e01[_0xadcb('0x76')],_0x356e01[_0xadcb('0x21')]);_0x2a8f4a[_0xadcb('0x78')]=_[_0xadcb('0x77')](_0x356e01['model'],qs[_0xadcb('0x79')](_0x3ff025[_0xadcb('0x21')][_0xadcb('0x79')]));_0x2a8f4a[_0xadcb('0x78')]=_0x2a8f4a['attributes']['length']?_0x2a8f4a[_0xadcb('0x78')]:_0x356e01[_0xadcb('0x76')];if(!_0x3ff025[_0xadcb('0x21')][_0xadcb('0x35')](_0xadcb('0x80'))){_0x2a8f4a[_0xadcb('0x14')]=qs[_0xadcb('0x14')](_0x3ff025['query'][_0xadcb('0x14')]);_0x2a8f4a[_0xadcb('0x12')]=qs['offset'](_0x3ff025['query'][_0xadcb('0x12')]);}_0x2a8f4a[_0xadcb('0x7a')]=qs[_0xadcb('0x7b')](_0x3ff025[_0xadcb('0x21')][_0xadcb('0x7b')]);_0x2a8f4a[_0xadcb('0x5d')]=qs[_0xadcb('0x7c')](_[_0xadcb('0x7d')](_0x3ff025[_0xadcb('0x21')],_0x356e01[_0xadcb('0x7c')]));_0x2a8f4a[_0xadcb('0x5d')][_0xadcb('0x96')]=_0x1419f7['id'];if(_0x3ff025[_0xadcb('0x21')][_0xadcb('0x7e')]){_0x2a8f4a[_0xadcb('0x5d')]=_[_0xadcb('0x36')](_0x2a8f4a[_0xadcb('0x5d')],{'$or':_[_0xadcb('0x6d')](_0x2a8f4a[_0xadcb('0x78')],function(_0x3e1f6d){var _0x142db7={};_0x142db7[_0x3e1f6d]={'$like':'%'+_0x3ff025[_0xadcb('0x21')][_0xadcb('0x7e')]+'%'};return _0x142db7;})});}_0x2a8f4a=_[_0xadcb('0x36')]({},_0x2a8f4a,_0x3ff025[_0xadcb('0x7f')]);return db[_0xadcb('0x52')]['count']({'where':_0x2a8f4a['where']})['then'](function(_0x435133){_0x1cc80b[_0xadcb('0x15')]=_0x435133;if(_0x3ff025[_0xadcb('0x21')][_0xadcb('0x97')]){_0x2a8f4a['include']=[{'all':!![]}];}return db[_0xadcb('0x52')]['findAll'](_0x2a8f4a);})['then'](function(_0x58be46){_0x1cc80b[_0xadcb('0x99')]=_0x58be46;return _0x1cc80b;});}})['then'](respondWithFilteredResult(_0x1a0a12,_0x2a8f4a))['catch'](handleError(_0x1a0a12,null));};exports[_0xadcb('0x9d')]=function(_0x5863d3,_0x278f17){try{if(!_0x5863d3[_0xadcb('0x37')][_0xadcb('0x5e')]){throw new Error('No\x20ListId\x20specified');}if(!_0x5863d3[_0xadcb('0x37')][_0xadcb('0x9e')]){throw new Error(_0xadcb('0x9f'));}if(!_0x5863d3[_0xadcb('0x37')]['binding_values']){throw new Error(_0xadcb('0xa0'));}if(!_0x5863d3[_0xadcb('0x37')][_0xadcb('0xa1')]){throw new Error(_0xadcb('0xa2'));}var _0x394cf1=_0x5863d3[_0xadcb('0x37')][_0xadcb('0x9e')][_0xadcb('0xa3')](',');var _0x3ff0f7=_0x5863d3[_0xadcb('0x37')][_0xadcb('0xa4')]['split'](',');if(!_0x394cf1[_0xadcb('0x29')]||!_0x3ff0f7[_0xadcb('0x29')]||_0x394cf1[_0xadcb('0x29')]!==_0x3ff0f7[_0xadcb('0x29')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x5863d3[_0xadcb('0x37')][_0xadcb('0x79')]=_[_0xadcb('0xa5')](_0x394cf1,_0x3ff0f7);if(!_0x5863d3['body'][_0xadcb('0x79')][_0xadcb('0x73')]){throw new Error(_0xadcb('0xa6'));}if(!_0x5863d3['body'][_0xadcb('0x79')][_0xadcb('0xa7')]){throw new Error(_0xadcb('0xa8'));}var _0x4878a2=path[_0xadcb('0x3c')](config[_0xadcb('0xa9')],_0xadcb('0xaa'),_0x5863d3[_0xadcb('0xab')]['filename']);fs[_0xadcb('0xac')](_0x4878a2,parseInt(_0xadcb('0xad'),0x8));var _0x496f45=require('child_process')[_0xadcb('0xae')](path[_0xadcb('0x3c')](__dirname,_0xadcb('0xaf')),[_0x4878a2,_0x5863d3[_0xadcb('0x37')]['binding_keys'],_0x5863d3[_0xadcb('0x37')][_0xadcb('0xa4')],_0x5863d3[_0xadcb('0x37')][_0xadcb('0x5e')],_0x5863d3[_0xadcb('0x37')]['CompanyId'],_0x5863d3['body'][_0xadcb('0x5c')],_0x5863d3['body'][_0xadcb('0xa1')]]);return _0x278f17[_0xadcb('0x1a')](0xc8)[_0xadcb('0x11')]({'message':_0xadcb('0xb0'),'pid':_0x496f45[_0xadcb('0xb1')]});}catch(_0x2c1bf7){return _0x278f17[_0xadcb('0x1a')](0x1f4)[_0xadcb('0xb2')](_0x2c1bf7);}};exports['upload']=function(_0xc74a1a,_0x3f2c89){var _0x10ce5a=fs[_0xadcb('0xb3')](_0xc74a1a['file'][_0xadcb('0xb4')]);Papa[_0xadcb('0xb5')](_0x10ce5a,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x6141fb){return _0x3f2c89[_0xadcb('0x1a')](0xc8)[_0xadcb('0x11')]({'file':_0xc74a1a[_0xadcb('0xab')],'fields':_0x6141fb[_0xadcb('0xb6')]['fields']});}});};exports['import']=function(_0x8c9508,_0x3367e4){return db[_0xadcb('0xb7')][_0xadcb('0x2f')]({'raw':!![],'attributes':['id'],'where':{'role':_0xadcb('0xb8')}})['then'](function(_0x122de5){var _0x3549cd=![];if(!_0x8c9508[_0xadcb('0x37')][_0xadcb('0x5e')]){throw new Error(_0xadcb('0xb9'));}if(!_0x8c9508[_0xadcb('0x37')]['binding'][_0xadcb('0x73')]){throw new Error(_0xadcb('0xa6'));}if(!_0x8c9508[_0xadcb('0x37')]['binding'][_0xadcb('0xa7')]){throw new Error(_0xadcb('0xa8'));}if(!_0x8c9508['body'][_0xadcb('0xa1')]){throw new Error(_0xadcb('0xa2'));}var _0x7c8b26=require('child_process')[_0xadcb('0xae')](path[_0xadcb('0x3c')](__dirname,_0xadcb('0xba')),[_0x8c9508[_0xadcb('0x26')]['id'],JSON[_0xadcb('0xbb')](_0x8c9508[_0xadcb('0x37')]),JSON[_0xadcb('0xbb')](_0x122de5)]);_0x7c8b26['on'](_0xadcb('0xbc'),function(){_0x3549cd=!![];return _0x3367e4[_0xadcb('0x1a')](0xc8)['json']({'message':_0xadcb('0xbd'),'pid':_0x7c8b26['pid']});});_0x7c8b26['on'](_0xadcb('0xbe'),function(_0x3ae9ce){if(_0x3ae9ce&&!_0x3549cd){return _0x3367e4[_0xadcb('0x1a')](0x1f4)[_0xadcb('0x11')]({'message':_0xadcb('0xbf'),'pid':_0x7c8b26[_0xadcb('0xb1')]});}});})[_0xadcb('0x23')](handleError(_0x3367e4,null));};exports[_0xadcb('0xc0')]=function(_0xcaafca,_0x557e64){return db[_0xadcb('0xb7')][_0xadcb('0x2f')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xadcb('0x18')](function(_0x1ea190){var _0x566505=![];if(!_0xcaafca['body'][_0xadcb('0x5e')]){throw new Error(_0xadcb('0xb9'));}if(!_0xcaafca[_0xadcb('0x37')][_0xadcb('0xc1')][_0xadcb('0x73')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xcaafca[_0xadcb('0x37')][_0xadcb('0xc1')][_0xadcb('0xa7')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0xcaafca[_0xadcb('0x37')][_0xadcb('0xa1')]){throw new Error(_0xadcb('0xa2'));}var _0x1dff16=require(_0xadcb('0xc2'))[_0xadcb('0xae')](path[_0xadcb('0x3c')](__dirname,_0xadcb('0xc3')),[_0xcaafca['params']['id'],JSON[_0xadcb('0xbb')](_0xcaafca[_0xadcb('0x37')]),JSON[_0xadcb('0xbb')](_0x1ea190)]);_0x1dff16['on'](_0xadcb('0xbc'),function(){_0x566505=!![];return _0x557e64[_0xadcb('0x1a')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x1dff16[_0xadcb('0xb1')]});});_0x1dff16['on'](_0xadcb('0xbe'),function(_0x1d7ddf){if(_0x1d7ddf&&!_0x566505){return _0x557e64[_0xadcb('0x1a')](0x1f4)[_0xadcb('0x11')]({'message':_0xadcb('0xbf'),'pid':_0x1dff16['pid']});}});})[_0xadcb('0x23')](handleError(_0x557e64,null));};exports[_0xadcb('0xc4')]=function(_0x405f1e,_0x13c123){var _0x55554e=[_0xadcb('0xc5'),_0xadcb('0xc6'),_0xadcb('0xc7'),'openchannel',_0xadcb('0xc8'),'whatsapp',_0xadcb('0xc9')];var _0x2ed6d5={'offset':0x0,'order':qs[_0xadcb('0x7b')](_0xadcb('0xca'))},_0x2fcf21={'count':0x0,'rows':[]};Promise[_0xadcb('0xcb')]()[_0xadcb('0x18')](function(){if(_0x405f1e[_0xadcb('0x21')][_0xadcb('0xcc')]){if(!_[_0xadcb('0xcd')](_0x55554e,_0x405f1e[_0xadcb('0x21')][_0xadcb('0xcc')]['toLowerCase']())){throw new Error(_0xadcb('0xce'));}_0x55554e=[_0x405f1e[_0xadcb('0x21')]['channel'][_0xadcb('0xcf')]()];}if(_0x405f1e[_0xadcb('0x21')][_0xadcb('0xd0')]){try{var _0x38f4d1=JSON[_0xadcb('0xb5')](_0x405f1e[_0xadcb('0x21')]['range']);if(!moment(_0x38f4d1['from'])[_0xadcb('0xd1')]()){throw new Error(_0xadcb('0xd2'));}if(!moment(_0x38f4d1['to'])[_0xadcb('0xd1')]()){throw new Error(_0xadcb('0xd3'));}}catch(_0x549324){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x405f1e[_0xadcb('0x21')][_0xadcb('0x35')]('nolimit')){_0x2ed6d5['limit']=qs[_0xadcb('0x14')](_0x405f1e[_0xadcb('0x21')][_0xadcb('0x14')]||0xa);_0x2ed6d5['offset']=qs[_0xadcb('0x12')](_0x405f1e[_0xadcb('0x21')]['offset']);}var _0xd7fc99=_0x55554e['map'](function(_0x38eace){if(_0x38eace==='voice'){var _0x1b871e={'attributes':['id',_0xadcb('0xd4'),_0xadcb('0x31'),_0xadcb('0xd5'),_0xadcb('0xd6'),_0xadcb('0xd7'),_0xadcb('0xd8'),_0xadcb('0xd9'),_0xadcb('0xda'),_0xadcb('0xdb'),_0xadcb('0xdc'),_0xadcb('0xdd'),_0xadcb('0xde'),_0xadcb('0xdf'),_0xadcb('0xe0')],'where':{'ContactId':_0x405f1e['params']['id']},'include':[{'model':db[_0xadcb('0xb7')],'as':_0xadcb('0xb7'),'attributes':['id',_0xadcb('0x1e'),_0xadcb('0xe1'),_0xadcb('0xe2')]}],'order':[[_0xadcb('0xdc'),_0xadcb('0xe3')]]};if(_0x405f1e['query'][_0xadcb('0xd0')]){_0x1b871e[_0xadcb('0x5d')][_0xadcb('0xdc')]={'$gte':_0x38f4d1[_0xadcb('0x38')],'$lte':_0x38f4d1['to']};}return db['VoiceCallReport'][_0xadcb('0xe4')](_0x1b871e)[_0xadcb('0x18')](function(_0x5dcc4f){_0x2fcf21['count']+=_0x5dcc4f[_0xadcb('0x15')];return _[_0xadcb('0x6d')](_0x5dcc4f['rows'],function(_0x2d0b4f){var _0x521cfc=_0x2d0b4f[_0xadcb('0x39')]({'plain':!![]});_0x521cfc[_0xadcb('0xcc')]=_0x38eace;if(_0x521cfc[_0xadcb('0xb7')]){_0x521cfc[_0xadcb('0xb7')]={'id':_0x521cfc[_0xadcb('0xb7')]['id'],'name':_0x521cfc[_0xadcb('0xb7')]['name'],'fullname':_0x521cfc[_0xadcb('0xb7')]['fullname'],'alias':_0x521cfc['User'][_0xadcb('0xe2')]};}return _0x521cfc;});});}else{var _0x29be9e=_['startCase'](_0x38eace)+(_0x38eace==='chat'?_0xadcb('0xe5'):_0xadcb('0xe6'));var _0x2db5ad={'attributes':['id',_0xadcb('0xe7'),_0xadcb('0xe8'),'createdAt',_0xadcb('0xdb'),_0xadcb('0xe9'),'secondDisposition',_0xadcb('0xea'),_0xadcb('0xe0'),_0x29be9e+'Id'],'where':{'ContactId':_0x405f1e[_0xadcb('0x26')]['id']},'include':[{'model':db[_0x29be9e],'as':'Account','attributes':['id','name',_0xadcb('0xeb')]},{'model':db[_0xadcb('0xb7')],'as':_0xadcb('0xec'),'attributes':['id',_0xadcb('0x1e'),'fullname']},{'model':db[_0xadcb('0x63')],'as':_0xadcb('0x64'),'attributes':['id',_0xadcb('0x1e'),_0xadcb('0x65')],'through':{'attributes':[]}}],'order':[[_0xadcb('0xdc'),_0xadcb('0xe3')]]};if(_0x405f1e['query']['range']){_0x2db5ad[_0xadcb('0x5d')][_0xadcb('0xdc')]={'$gte':_0x38f4d1[_0xadcb('0x38')],'$lte':_0x38f4d1['to']};}switch(_0x38eace){case'chat':_0x2db5ad[_0xadcb('0x78')][_0xadcb('0x60')](_0xadcb('0xed'),_0xadcb('0xee'),_0xadcb('0xef'),_0xadcb('0xf0'),_0xadcb('0xf1'),_0xadcb('0xf2'),_0xadcb('0xf3'),_0xadcb('0xf4'),_0xadcb('0xf5'));break;case _0xadcb('0xc5'):_0x2db5ad[_0xadcb('0x78')][_0xadcb('0x60')](_0xadcb('0xf6'),_0xadcb('0xf7'));break;case _0xadcb('0xf8'):_0x2db5ad[_0xadcb('0x78')]['push']('externalUrl',_0xadcb('0xf9'));break;}return db[_[_0xadcb('0xfa')](_0x38eace)+_0xadcb('0xfb')]['findAndCountAll'](_0x2db5ad)[_0xadcb('0x18')](function(_0x29e286){_0x2fcf21[_0xadcb('0x15')]+=_0x29e286[_0xadcb('0x15')];return _[_0xadcb('0x6d')](_0x29e286[_0xadcb('0x99')],function(_0x279b42){var _0x5eaf9d=_0x279b42[_0xadcb('0x39')]({'plain':!![]});_0x5eaf9d[_0xadcb('0xcc')]=_0x38eace;if(_0x5eaf9d[_0xadcb('0xec')]){_0x5eaf9d[_0xadcb('0xec')]={'id':_0x5eaf9d[_0xadcb('0xec')]['id'],'name':_0x5eaf9d[_0xadcb('0xec')][_0xadcb('0x1e')],'fullname':_0x5eaf9d['Owner'][_0xadcb('0xe1')]};}return _0x5eaf9d;});});}});return Promise[_0xadcb('0x61')](_0xd7fc99);})[_0xadcb('0x18')](function(_0x48f9f8){return _(_0x48f9f8)['flatten']()[_0xadcb('0xfc')](_0xadcb('0xdc'))[_0xadcb('0xfd')]()[_0xadcb('0xfe')]();})['then'](function(_0x4eb446){_0x2fcf21[_0xadcb('0x99')]=_0x2ed6d5[_0xadcb('0x14')]?_0x4eb446[_0xadcb('0xff')](_0x2ed6d5[_0xadcb('0x12')],_0x2ed6d5[_0xadcb('0x12')]+_0x2ed6d5[_0xadcb('0x14')]):_0x4eb446;return _0x2fcf21;})[_0xadcb('0x18')](respondWithFilteredResult(_0x13c123,_0x2ed6d5))[_0xadcb('0x23')](handleError(_0x13c123,null));}; \ No newline at end of file +var _0x3889=['Invalid\x20createdAt\x20filter','uniqueid','type','source','callerid','endtime','note','createdAt','UserId','fullname','DESC','findAndCountAll','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','startCase','flatten','sortBy','value','moment','bluebird','util','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','set','then','destroy','end','sendStatus','error','name','send','index','describe','getOptions','findAll','user','catch','CmContact','find','params','tags','keys','length','startsWith','displayName','query','analytics','cf_','columnName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','get','mergeWith','isArray','join','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','isNil','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','Tags','color','Phones','ItemType','sequelize','literal','Phones.OrderBy','$and','CmCustomField','omit','map','cf_%d','dialTimezone','format','table','cm_contacts','setFields','toParam','text','phone','getTags','Tag','intersection','model','attributes','fields','sort','filters','pick','filter','options','nolimit','findOne','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','order','ContactId','includeAll','include','rows','getHopperHistories','rawAttributes','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','json','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter'];(function(_0x5854a6,_0x4111dd){var _0x32c7ee=function(_0x4a28dd){while(--_0x4a28dd){_0x5854a6['push'](_0x5854a6['shift']());}};_0x32c7ee(++_0x4111dd);}(_0x3889,0x12a));var _0x9388=function(_0x461fa1,_0x5aa2cb){_0x461fa1=_0x461fa1-0x0;var _0x585156=_0x3889[_0x461fa1];return _0x585156;};'use strict';var moment=require(_0x9388('0x0'));var BPromise=require(_0x9388('0x1'));var util=require(_0x9388('0x2'));var path=require(_0x9388('0x3'));var fs=require('fs');var _=require(_0x9388('0x4'));var squel=require(_0x9388('0x5'));var Papa=require(_0x9388('0x6'));var Redis=require('ioredis');var contacts=require(_0x9388('0x7'));var qs=require(_0x9388('0x8'));var logger=require(_0x9388('0x9'))(_0x9388('0xa'));var config=require(_0x9388('0xb'));var shared=require('../../config/environment/shared');var db=require(_0x9388('0xc'))['db'];config[_0x9388('0xd')]=_[_0x9388('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9388('0xf'))(new Redis(config[_0x9388('0xd')]));require(_0x9388('0x10'))[_0x9388('0x11')](socket);function respondWithResult(_0x5c8994,_0x54ab43){_0x54ab43=_0x54ab43||0xc8;return function(_0x472bd7){if(_0x472bd7){return _0x5c8994[_0x9388('0x12')](_0x54ab43)['json'](_0x472bd7);}};}function respondWithFilteredResult(_0x18c447,_0x4e2c7e){return function(_0x8851eb){if(_0x8851eb){var _0x215816=typeof _0x4e2c7e[_0x9388('0x13')]===_0x9388('0x14')&&typeof _0x4e2c7e[_0x9388('0x15')]===_0x9388('0x14');var _0x3308bd=_0x8851eb['count'];var _0x1fd462=_0x215816?0x0:_0x4e2c7e[_0x9388('0x13')];var _0x13c79c=_0x215816?_0x8851eb[_0x9388('0x16')]:_0x4e2c7e['offset']+_0x4e2c7e[_0x9388('0x15')];var _0x382028;if(_0x13c79c>=_0x3308bd){_0x13c79c=_0x3308bd;_0x382028=0xc8;}else{_0x382028=0xce;}_0x18c447[_0x9388('0x12')](_0x382028);return _0x18c447[_0x9388('0x17')]('Content-Range',_0x1fd462+'-'+_0x13c79c+'/'+_0x3308bd)['json'](_0x8851eb);}return null;};}function saveUpdates(_0x354781){return function(_0x56652d){if(_0x56652d){return _0x56652d['update'](_0x354781)[_0x9388('0x18')](function(_0x22ab7a){return _0x22ab7a;});}return null;};}function removeEntity(_0x57b03d){return function(_0x2c8090){if(_0x2c8090){return _0x2c8090[_0x9388('0x19')]()[_0x9388('0x18')](function(){_0x57b03d[_0x9388('0x12')](0xcc)[_0x9388('0x1a')]();});}};}function handleEntityNotFound(_0x53ef31){return function(_0x444451){if(!_0x444451){_0x53ef31[_0x9388('0x1b')](0x194);}return _0x444451;};}function handleError(_0x41a761,_0x753b5e){_0x753b5e=_0x753b5e||0x1f4;return function(_0x42d18c){logger[_0x9388('0x1c')](_0x42d18c['stack']);if(_0x42d18c['name']){delete _0x42d18c[_0x9388('0x1d')];}_0x41a761[_0x9388('0x12')](_0x753b5e)[_0x9388('0x1e')](_0x42d18c);};}exports[_0x9388('0x1f')]=function(_0x393005,_0xb87b4b){var _0xd964ec={};return contacts[_0x9388('0x20')]()[_0x9388('0x18')](function(_0x1d02de){_0xd964ec=qs[_0x9388('0x21')](_0x1d02de,_0x393005);return contacts[_0x9388('0x22')](_0x393005['query'],_0x393005[_0x9388('0x23')],_0xd964ec,_0x1d02de);})[_0x9388('0x18')](respondWithFilteredResult(_0xb87b4b,_0xd964ec))[_0x9388('0x24')](handleError(_0xb87b4b,null));};exports['destroy']=function(_0x5da19b,_0x3f8fc6){return db[_0x9388('0x25')][_0x9388('0x26')]({'where':{'id':_0x5da19b[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x3f8fc6,null))[_0x9388('0x18')](removeEntity(_0x3f8fc6,null))[_0x9388('0x24')](handleError(_0x3f8fc6,null));};exports['describe']=function(_0x4e3477,_0x25264d){return db['CmContact'][_0x9388('0x20')]()['then'](function(_0x1af056){delete _0x1af056[_0x9388('0x28')];for(var _0x5bb429=0x0;_0x5bb4290x0){return new Promise(function(_0xe2b9dd){var _0xd7337f=[];for(var _0x22bc50=0x0;_0x22bc50<_0x2d4f39['length'];_0x22bc50++){_0xd7337f[_0x9388('0x5f')](insertAdditionalPhones(_0x2d4f39[_0x22bc50][_0x9388('0x63')],_0x2d4f39[_0x22bc50][_0x9388('0x5a')]));}Promise[_0x9388('0x64')](_0xd7337f)['then'](function(){_0xe2b9dd(0x1);});})[_0x9388('0x18')](function(){return{'success':_0x4f07ef,'failure':_0x409019,'duplicates':_0x1b9a11};});}else{return{'success':_0x4f07ef,'failure':_0x409019,'duplicates':_0x1b9a11};}}})['then'](respondWithResult(_0x48c82e,0xc9))[_0x9388('0x24')](handleError(_0x48c82e,null));};exports[_0x9388('0x65')]=function(_0x184fa3,_0x40c187){var _0xb93b76;return db[_0x9388('0x25')]['describe']()['then'](function(_0x93f006){return db['CmContact'][_0x9388('0x26')]({'where':{'id':_0x184fa3[_0x9388('0x27')]['id']},'include':[{'model':db['Tag'],'as':_0x9388('0x66'),'attributes':['id',_0x9388('0x1d'),_0x9388('0x67')],'required':_0x184fa3[_0x9388('0x2d')]['tag']?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x9388('0x68'),'where':{'CmContactId':_0x184fa3[_0x9388('0x27')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x9388('0x69')}]}],'order':[db[_0x9388('0x6a')][_0x9388('0x6b')](_0x9388('0x6c'))],'attributes':_[_0x9388('0x29')](_0x93f006)});})[_0x9388('0x18')](function(_0x209104){if(!_['isNil'](_0x209104)){_0xb93b76=_0x209104[_0x9388('0x3a')]({'plain':!![]});var _0x54cb7d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x209104&&_0x209104[_0x9388('0x60')]){if(_0x209104['ListId']){_0x54cb7d[_0x9388('0x5d')][_0x9388('0x6d')][_0x9388('0x5f')]({'ListId':{'$ne':_0x209104[_0x9388('0x60')]}});}}return db[_0x9388('0x6e')][_0x9388('0x22')](_0x54cb7d);}})['then'](function(_0x38e73f){if(!_[_0x9388('0x57')](_0x38e73f)){return _[_0x9388('0x6f')](_0xb93b76,_[_0x9388('0x70')](_0x38e73f,function(_0x187c09){return util['format'](_0x9388('0x71'),_0x187c09['id']);}));}})[_0x9388('0x18')](handleEntityNotFound(_0x40c187,null))[_0x9388('0x18')](respondWithResult(_0x40c187,null))[_0x9388('0x24')](handleError(_0x40c187,null));};exports[_0x9388('0x44')]=function(_0x30d16c,_0x26a5c4){var _0x42abaf;if(_0x30d16c[_0x9388('0x39')]['id']){delete _0x30d16c[_0x9388('0x39')]['id'];}if(!_[_0x9388('0x57')](_0x30d16c[_0x9388('0x39')]['dialTimezone'])){var _0x2b5765=_0x30d16c[_0x9388('0x39')][_0x9388('0x72')];if(!_['isNil'](shared[_0x9388('0x58')][_0x2b5765]))_0x30d16c[_0x9388('0x39')]['utcOffset']=shared[_0x9388('0x58')][_0x2b5765][_0x9388('0x59')];}return db[_0x9388('0x25')][_0x9388('0x26')]({'where':{'id':_0x30d16c['params']['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x26a5c4,null))[_0x9388('0x18')](saveUpdates(_0x30d16c[_0x9388('0x39')],null))[_0x9388('0x18')](function(_0x1918a4){_0x42abaf=_0x1918a4;var _0x59282b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1918a4&&_0x1918a4[_0x9388('0x60')]){if(_0x1918a4[_0x9388('0x60')]){_0x59282b[_0x9388('0x5d')][_0x9388('0x6d')][_0x9388('0x5f')]({'ListId':{'$ne':_0x1918a4[_0x9388('0x60')]}});}}return db[_0x9388('0x6e')][_0x9388('0x22')](_0x59282b);})[_0x9388('0x18')](function(_0x43d92e){if(_0x43d92e){return _[_0x9388('0x6f')](_['pickBy'](_0x30d16c[_0x9388('0x39')],function(_0x4be75f,_0x380444){return _[_0x9388('0x2b')](_0x380444,'cf_');}),_[_0x9388('0x70')](_0x43d92e,function(_0x45f2eb){return util[_0x9388('0x73')](_0x9388('0x71'),_0x45f2eb['id']);}));}})[_0x9388('0x18')](function(_0xf73096){if(_0xf73096&&!_['isEmpty'](_0xf73096)){var _0x2f1906=squel[_0x9388('0x44')]()[_0x9388('0x74')](_0x9388('0x75'))[_0x9388('0x76')](_0xf73096)[_0x9388('0x5d')]('id\x20=\x20?',_0x30d16c[_0x9388('0x27')]['id'])[_0x9388('0x77')]();return db[_0x9388('0x6a')][_0x9388('0x2d')](_0x2f1906[_0x9388('0x78')],{'replacements':_0x2f1906[_0x9388('0x33')]});}})[_0x9388('0x18')](function(){if(_0x30d16c[_0x9388('0x39')][_0x9388('0x79')]&&_0x42abaf){return db[_0x9388('0x3f')]['update']({'phone':_0x30d16c[_0x9388('0x39')][_0x9388('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x42abaf['id']}});}})[_0x9388('0x18')](function(){return _0x42abaf;})[_0x9388('0x18')](respondWithResult(_0x26a5c4,null))[_0x9388('0x24')](handleError(_0x26a5c4,null));};exports[_0x9388('0x7a')]=function(_0x2fdd1e,_0xfa9822){var _0x17053a={};var _0xb054f8={};var _0xbf11db;var _0x58d9a3;return db[_0x9388('0x25')]['findOne']({'where':{'id':_0x2fdd1e[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0xfa9822,null))[_0x9388('0x18')](function(_0x321bc9){if(_0x321bc9){_0xbf11db=_0x321bc9;_0xb054f8['model']=_[_0x9388('0x29')](db[_0x9388('0x7b')]['rawAttributes']);_0xb054f8['query']=_[_0x9388('0x29')](_0x2fdd1e[_0x9388('0x2d')]);_0xb054f8['filters']=_[_0x9388('0x7c')](_0xb054f8[_0x9388('0x7d')],_0xb054f8[_0x9388('0x2d')]);_0x17053a[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0xb054f8[_0x9388('0x7d')],qs[_0x9388('0x7f')](_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x7f')]));_0x17053a['attributes']=_0x17053a['attributes'][_0x9388('0x2a')]?_0x17053a[_0x9388('0x7e')]:_0xb054f8[_0x9388('0x7d')];_0x17053a['order']=qs[_0x9388('0x80')](_0x2fdd1e[_0x9388('0x2d')]['sort']);_0x17053a[_0x9388('0x5d')]=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x2fdd1e[_0x9388('0x2d')],_0xb054f8['filters']));if(_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x83')]){_0x17053a[_0x9388('0x5d')]=_[_0x9388('0x38')](_0x17053a[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0x17053a[_0x9388('0x7e')],function(_0x1598f4){var _0x30b519={};_0x30b519[_0x1598f4]={'$like':'%'+_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x30b519;})});}_0x17053a=_['merge']({},_0x17053a,_0x2fdd1e[_0x9388('0x84')]);return _0xbf11db['getTags'](_0x17053a);}})[_0x9388('0x18')](function(_0x2b9cf3){if(_0x2b9cf3){_0x58d9a3=_0x2b9cf3[_0x9388('0x2a')];if(!_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0x17053a[_0x9388('0x15')]=qs[_0x9388('0x15')](_0x2fdd1e[_0x9388('0x2d')]['limit']);_0x17053a[_0x9388('0x13')]=qs[_0x9388('0x13')](_0x2fdd1e[_0x9388('0x2d')][_0x9388('0x13')]);}return _0xbf11db[_0x9388('0x7a')](_0x17053a);}})[_0x9388('0x18')](function(_0x389bf0){if(_0x389bf0){return _0x389bf0?{'count':_0x58d9a3,'rows':_0x389bf0}:null;}})[_0x9388('0x18')](respondWithResult(_0xfa9822,null))[_0x9388('0x24')](handleError(_0xfa9822,null));};exports['setTags']=function(_0xeae772,_0x95b872){if(_0xeae772[_0x9388('0x39')]['id']){delete _0xeae772[_0x9388('0x39')]['id'];}return db[_0x9388('0x25')][_0x9388('0x86')]({'where':{'id':_0xeae772['params']['id']}})['then'](handleEntityNotFound(_0x95b872,null))[_0x9388('0x18')](function(_0x434961){if(_0x434961){return _0x434961['setTags'](_0xeae772[_0x9388('0x39')][_0x9388('0x87')]||[]);}return null;})['then'](respondWithResult(_0x95b872,null))[_0x9388('0x24')](handleError(_0x95b872,null));};exports[_0x9388('0x88')]=function(_0x1c5a05,_0x322c11){var _0x2495f5=[];_0x2495f5[_0x9388('0x5f')](addAdditionalPhones(_0x1c5a05[_0x9388('0x39')]));Promise[_0x9388('0x64')](_0x2495f5)[_0x9388('0x18')](function(){_0x2495f5=[];_0x2495f5[_0x9388('0x5f')](deleteCmHopperPhones(_0x1c5a05[_0x9388('0x39')]['id']));_0x2495f5['push'](addCmHopperPhones(_0x1c5a05['body']['id']));Promise[_0x9388('0x64')](_0x2495f5)[_0x9388('0x18')](function(){return[0x1];})[_0x9388('0x18')](respondWithResult(_0x322c11,null));});};function addAdditionalPhones(_0x221b75){var _0xf4eb17;return new Promise(function(_0x2ed224){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x221b75['id']}})[_0x9388('0x18')](function(){db[_0x9388('0x89')][_0x9388('0x22')]({'raw':!![],'attributes':['id',_0x9388('0x8a')]})[_0x9388('0x18')](function(_0x2e66a7){var _0x17b060=[];for(var _0x2c1b98=0x0;_0x2c1b98<_0x221b75[_0x9388('0x8b')]['length'];_0x2c1b98++){var _0x4ede82=_0x221b75[_0x9388('0x8c')]?_[_0x9388('0x57')](_0x221b75['item_types'][_0x2c1b98])?'':_0x221b75[_0x9388('0x8c')][_0x2c1b98]:_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x8d')]?_0x221b75['items'][_0x2c1b98][_0x9388('0x8d')]:'';var _0xdfeb0=_[_0x9388('0x57')](_0x221b75[_0x9388('0x8b')][_0x2c1b98]['description'])?'':_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x8e')];var _0x1ebb38=_0x4ede82+':'+_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x79')]+'§'+_0xdfeb0;if(_['isNil'](_0xf4eb17))_0xf4eb17=_0x1ebb38;else _0xf4eb17+=';'+_0x1ebb38;var _0x10738f=null;var _0x2b7aa1=null;if(_0x221b75[_0x9388('0x8c')]){if(!_[_0x9388('0x57')](_0x221b75[_0x9388('0x8c')][_0x2c1b98])){_0x2b7aa1=_[_0x9388('0x26')](_0x2e66a7,function(_0x51bb21){return _0x51bb21['id']===_0x221b75[_0x9388('0x8c')][_0x2c1b98];});if(!_[_0x9388('0x57')](_0x2b7aa1)){_0x10738f=_0x2b7aa1[_0x9388('0x8a')];}}}else{if(!_[_0x9388('0x57')](_0x221b75[_0x9388('0x8b')][_0x2c1b98])){_0x2b7aa1=_[_0x9388('0x26')](_0x2e66a7,function(_0x36a3cd){return _0x36a3cd['id']===_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x8d')];});if(!_[_0x9388('0x57')](_0x2b7aa1)){_0x10738f=_0x2c1b98;}}}if(_[_0x9388('0x57')](_0x10738f)){_0x10738f=0x64;}_0x17b060['push'](addAdditionalPhone(_0x221b75['id'],_0x221b75[_0x9388('0x8b')][_0x2c1b98][_0x9388('0x79')],_0x221b75[_0x9388('0x8c')]?_[_0x9388('0x57')](_0x221b75[_0x9388('0x8c')][_0x2c1b98])?null:_0x221b75[_0x9388('0x8c')][_0x2c1b98]:_0x221b75['items'][_0x2c1b98][_0x9388('0x8d')]?_0x221b75[_0x9388('0x8b')][_0x2c1b98]['ItemTypeId']:null,_0x10738f,_0xdfeb0));}Promise['all'](_0x17b060)[_0x9388('0x18')](function(){db[_0x9388('0x25')]['update']({'AdditionalPhones':_0xf4eb17},{'where':{'id':_0x221b75['id']}})[_0x9388('0x18')](function(){_0x2ed224(0x1);});});});});});}function addAdditionalPhone(_0x273d04,_0x1a7deb,_0x18e6e3,_0x48455a,_0x23b8c9){return db['CmContactHasItem'][_0x9388('0x26')]({'where':{'CmContactId':_0x273d04,'item':_0x1a7deb}})[_0x9388('0x18')](function(_0x2457cc){if(_0x2457cc)logger['info']('contact\x20phone\x20exists',_0x2457cc);else{db[_0x9388('0x4b')][_0x9388('0x56')]({'CmContactId':_0x273d04,'item':_0x1a7deb,'ItemTypeId':_0x18e6e3,'OrderBy':_0x48455a,'ItemClass':_0x9388('0x8f'),'description':_0x23b8c9});}});}function deleteCmHopperPhones(_0x1df0b6){return new Promise(function(_0x39fc96){return db[_0x9388('0x3f')][_0x9388('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1df0b6}})[_0x9388('0x18')](function(_0x37c785){db[_0x9388('0x90')][_0x9388('0x19')]({'where':{'CmHopperId':{'$in':_['map'](_0x37c785,'id')}}});})['then'](function(){_0x39fc96(0x1);});});}function addCmHopperPhones(_0x29d42f){return new Promise(function(_0x514578){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x29d42f}})[_0x9388('0x18')](function(_0x356eaa){var _0xd72ca5=[];_[_0x9388('0x70')](_0x356eaa,function(_0x4ba2cd){_0xd72ca5[_0x9388('0x5f')](createCmHopperPhone(_0x29d42f,_0x4ba2cd['id']));});Promise[_0x9388('0x64')](_0xd72ca5)[_0x9388('0x18')](function(){_0x514578(0x1);});});});}function createCmHopperPhone(_0x25f4b2,_0x3c1124){return new Promise(function(_0x436f54){db[_0x9388('0x4b')][_0x9388('0x22')]({'raw':!![],'attributes':[_0x9388('0x91'),_0x9388('0x8a')],'where':{'CmContactId':_0x25f4b2,'ItemClass':'PHONE'},'include':[{'model':db[_0x9388('0x89')],'attributes':[_0x9388('0x8a')],'as':_0x9388('0x69')}],'order':[_0x9388('0x8a'),db[_0x9388('0x6a')][_0x9388('0x6b')](_0x9388('0x92'))]})['then'](function(_0xf1e348){var _0x1dadee=0x1;var _0x3bf2fb=_[_0x9388('0x70')](_0xf1e348,function(_0x58c2b8){_0x58c2b8[_0x9388('0x93')]=_0x3c1124;_0x58c2b8[_0x9388('0x79')]=_0x58c2b8[_0x9388('0x91')];_0x58c2b8[_0x9388('0x8a')]=_0x1dadee;delete _0x58c2b8[_0x9388('0x94')];_0x1dadee=_0x1dadee+0x1;return _0x58c2b8;});return db[_0x9388('0x90')]['bulkCreate'](_0x3bf2fb,{});})['then'](function(){_0x436f54(0x1);});});}function insertAdditionalPhones(_0x250400,_0x57e1a7){return new Promise(function(_0x330d58){var _0x49834=[];for(var _0x4944c8=0x0;_0x4944c8<_0x57e1a7[_0x9388('0x2a')];_0x4944c8++){var _0x42a153=_0x57e1a7[_0x4944c8];_0x49834['push'](parseContactItemType(_0x42a153));}Promise[_0x9388('0x64')](_0x49834)[_0x9388('0x18')](function(){var _0x520d90={'id':_0x250400['id'],'items':_0x57e1a7};return addAdditionalPhones(_0x520d90)[_0x9388('0x18')](function(){return addCmHopperPhones(_0x250400['id']);});})[_0x9388('0x18')](function(){_0x330d58(_0x250400);});});}function parseContactItemType(_0x3e9af5){return new Promise(function(_0x4c4a89){if(_0x3e9af5[_0x9388('0x37')](_0x9388('0x8d'))){_0x4c4a89(_0x3e9af5);}else{return db[_0x9388('0x89')][_0x9388('0x26')]({'where':{'name':_0x3e9af5[_0x9388('0x69')]}})[_0x9388('0x18')](function(_0x2fe205){if(_[_0x9388('0x57')](_0x2fe205))_0x3e9af5[_0x9388('0x8d')]=null;else _0x3e9af5[_0x9388('0x8d')]=_0x2fe205['id'];_0x4c4a89(_0x3e9af5);});}});}exports[_0x9388('0x95')]=function(_0xa6ab0f,_0x11457a){return db['CmContactHasItem'][_0x9388('0x22')]({'raw':!![],'where':{'CmContactId':_0xa6ab0f[_0x9388('0x27')]['id'],'ItemClass':_0x9388('0x8f')},'include':[{'model':db[_0x9388('0x89')],'as':_0x9388('0x69')}],'order':[[_0x9388('0x8a')],[db[_0x9388('0x6a')]['literal']('`ItemType`.OrderBy')]]})[_0x9388('0x18')](function(_0x46ad4f){return _0x46ad4f;})['then'](respondWithResult(_0x11457a,null))[_0x9388('0x24')](handleError(_0x11457a,null));};exports[_0x9388('0x96')]=function(_0x23a1fe,_0x432407){return db[_0x9388('0x4b')][_0x9388('0x22')]({'raw':!![],'where':{'CmContactId':_0x23a1fe[_0x9388('0x39')][_0x9388('0x97')]}})['then'](function(_0x45a310){var _0x4d51f9=_[_0x9388('0x70')](_0x45a310,function(_0x3235de){_0x3235de['CmContactId']=_0x23a1fe['body'][_0x9388('0x98')];return _0x3235de;});return db[_0x9388('0x4b')]['bulkCreate'](_0x4d51f9,{});})[_0x9388('0x18')](function(){return addCmHopperPhones(_0x23a1fe['body']['toContactId']);})[_0x9388('0x18')](function(){return['ok'];})[_0x9388('0x18')](respondWithResult(_0x432407,null))[_0x9388('0x24')](handleError(_0x432407,null));};exports[_0x9388('0x99')]=function(_0x59edfa,_0x3afcbb){var _0x4c1b39=[];_0x4c1b39['push'](createCmHopperPhone(_0x59edfa[_0x9388('0x39')]['id'],_0x59edfa['body'][_0x9388('0x9a')]));Promise['all'](_0x4c1b39)[_0x9388('0x18')](function(){return[0x1];})['then'](respondWithResult(_0x3afcbb,null));};exports[_0x9388('0x9b')]=function(_0x458b37,_0xd5d06e){var _0xe7e7c9={'raw':![],'where':{}};var _0x4ced15={};var _0x1639f3={'count':0x0,'rows':[]};return db[_0x9388('0x25')][_0x9388('0x86')]({'where':{'id':_0x458b37['params']['id']}})[_0x9388('0x18')](handleEntityNotFound(_0xd5d06e,null))[_0x9388('0x18')](function(_0x49b6fa){if(_0x49b6fa){_0x4ced15[_0x9388('0x7d')]=_['keys'](db['CmHopper']['rawAttributes']);_0x4ced15[_0x9388('0x2d')]=_['keys'](_0x458b37[_0x9388('0x2d')]);_0x4ced15[_0x9388('0x81')]=_[_0x9388('0x7c')](_0x4ced15[_0x9388('0x7d')],_0x4ced15[_0x9388('0x2d')]);_0xe7e7c9[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0x4ced15['model'],qs['fields'](_0x458b37[_0x9388('0x2d')][_0x9388('0x7f')]));_0xe7e7c9['attributes']=_0xe7e7c9['attributes']['length']?_0xe7e7c9[_0x9388('0x7e')]:_0x4ced15[_0x9388('0x7d')];if(!_0x458b37[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0xe7e7c9['limit']=qs[_0x9388('0x15')](_0x458b37[_0x9388('0x2d')][_0x9388('0x15')]);_0xe7e7c9['offset']=qs[_0x9388('0x13')](_0x458b37[_0x9388('0x2d')]['offset']);}_0xe7e7c9[_0x9388('0x9c')]=qs[_0x9388('0x80')](_0x458b37[_0x9388('0x2d')]['sort']);_0xe7e7c9['where']=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x458b37[_0x9388('0x2d')],_0x4ced15['filters']));_0xe7e7c9['where'][_0x9388('0x9d')]=_0x49b6fa['id'];if(_0x458b37[_0x9388('0x2d')][_0x9388('0x83')]){_0xe7e7c9[_0x9388('0x5d')]=_[_0x9388('0x38')](_0xe7e7c9[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0xe7e7c9[_0x9388('0x7e')],function(_0x487abe){var _0x103793={};_0x103793[_0x487abe]={'$like':'%'+_0x458b37[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x103793;})});}_0xe7e7c9=_[_0x9388('0x38')]({},_0xe7e7c9,_0x458b37[_0x9388('0x84')]);return db[_0x9388('0x3f')][_0x9388('0x16')]({'where':_0xe7e7c9['where']})[_0x9388('0x18')](function(_0x18d077){_0x1639f3[_0x9388('0x16')]=_0x18d077;if(_0x458b37[_0x9388('0x2d')][_0x9388('0x9e')]){_0xe7e7c9[_0x9388('0x9f')]=[{'all':!![]}];}return db[_0x9388('0x3f')][_0x9388('0x22')](_0xe7e7c9);})[_0x9388('0x18')](function(_0x47f324){_0x1639f3[_0x9388('0xa0')]=_0x47f324;return _0x1639f3;});}})[_0x9388('0x18')](respondWithFilteredResult(_0xd5d06e,_0xe7e7c9))[_0x9388('0x24')](handleError(_0xd5d06e,null));};exports[_0x9388('0xa1')]=function(_0x3593ae,_0x57667b){var _0x470571={'raw':!![],'where':{}};var _0x4e0475={};var _0xac6cc={'count':0x0,'rows':[]};return db[_0x9388('0x25')]['findOne']({'where':{'id':_0x3593ae[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x57667b,null))[_0x9388('0x18')](function(_0x5ec3dd){if(_0x5ec3dd){_0x4e0475[_0x9388('0x7d')]=_['keys'](db['CmHopperHistory'][_0x9388('0xa2')]);_0x4e0475['query']=_[_0x9388('0x29')](_0x3593ae[_0x9388('0x2d')]);_0x4e0475[_0x9388('0x81')]=_[_0x9388('0x7c')](_0x4e0475[_0x9388('0x7d')],_0x4e0475['query']);_0x470571['attributes']=_['intersection'](_0x4e0475[_0x9388('0x7d')],qs[_0x9388('0x7f')](_0x3593ae[_0x9388('0x2d')]['fields']));_0x470571[_0x9388('0x7e')]=_0x470571[_0x9388('0x7e')][_0x9388('0x2a')]?_0x470571['attributes']:_0x4e0475[_0x9388('0x7d')];if(!_0x3593ae[_0x9388('0x2d')][_0x9388('0x37')]('nolimit')){_0x470571[_0x9388('0x15')]=qs[_0x9388('0x15')](_0x3593ae[_0x9388('0x2d')]['limit']);_0x470571[_0x9388('0x13')]=qs['offset'](_0x3593ae[_0x9388('0x2d')][_0x9388('0x13')]);}_0x470571[_0x9388('0x9c')]=qs[_0x9388('0x80')](_0x3593ae[_0x9388('0x2d')][_0x9388('0x80')]);_0x470571['where']=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x3593ae['query'],_0x4e0475[_0x9388('0x81')]));_0x470571['where'][_0x9388('0x9d')]=_0x5ec3dd['id'];if(_0x3593ae[_0x9388('0x2d')]['filter']){_0x470571['where']=_['merge'](_0x470571[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0x470571[_0x9388('0x7e')],function(_0x42d93b){var _0x4cdebf={};_0x4cdebf[_0x42d93b]={'$like':'%'+_0x3593ae[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x4cdebf;})});}_0x470571=_[_0x9388('0x38')]({},_0x470571,_0x3593ae[_0x9388('0x84')]);return db[_0x9388('0x4d')][_0x9388('0x16')]({'where':_0x470571[_0x9388('0x5d')]})[_0x9388('0x18')](function(_0x21de6c){_0xac6cc[_0x9388('0x16')]=_0x21de6c;if(_0x3593ae[_0x9388('0x2d')][_0x9388('0x9e')]){_0x470571[_0x9388('0x9f')]=[{'all':!![]}];}return db[_0x9388('0x4d')][_0x9388('0x22')](_0x470571);})[_0x9388('0x18')](function(_0x48ce0e){_0xac6cc[_0x9388('0xa0')]=_0x48ce0e;return _0xac6cc;});}})[_0x9388('0x18')](respondWithFilteredResult(_0x57667b,_0x470571))['catch'](handleError(_0x57667b,null));};exports[_0x9388('0xa3')]=function(_0x44117f,_0x21bad2){var _0x271a60={'raw':!![],'where':{}};var _0x25827b={};var _0x42ed44={'count':0x0,'rows':[]};return db['CmContact'][_0x9388('0x86')]({'where':{'id':_0x44117f[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x21bad2,null))[_0x9388('0x18')](function(_0x4cee3d){if(_0x4cee3d){_0x25827b[_0x9388('0x7d')]=_[_0x9388('0x29')](db[_0x9388('0x4c')]['rawAttributes']);_0x25827b[_0x9388('0x2d')]=_[_0x9388('0x29')](_0x44117f[_0x9388('0x2d')]);_0x25827b['filters']=_[_0x9388('0x7c')](_0x25827b[_0x9388('0x7d')],_0x25827b['query']);_0x271a60[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0x25827b['model'],qs[_0x9388('0x7f')](_0x44117f[_0x9388('0x2d')][_0x9388('0x7f')]));_0x271a60['attributes']=_0x271a60['attributes'][_0x9388('0x2a')]?_0x271a60[_0x9388('0x7e')]:_0x25827b[_0x9388('0x7d')];if(!_0x44117f['query']['hasOwnProperty']('nolimit')){_0x271a60['limit']=qs[_0x9388('0x15')](_0x44117f[_0x9388('0x2d')][_0x9388('0x15')]);_0x271a60['offset']=qs[_0x9388('0x13')](_0x44117f[_0x9388('0x2d')][_0x9388('0x13')]);}_0x271a60['order']=qs['sort'](_0x44117f['query']['sort']);_0x271a60[_0x9388('0x5d')]=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0x44117f['query'],_0x25827b[_0x9388('0x81')]));_0x271a60['where']['ContactId']=_0x4cee3d['id'];if(_0x44117f[_0x9388('0x2d')][_0x9388('0x83')]){_0x271a60['where']=_[_0x9388('0x38')](_0x271a60[_0x9388('0x5d')],{'$or':_[_0x9388('0x70')](_0x271a60[_0x9388('0x7e')],function(_0x1a6900){var _0x5e582b={};_0x5e582b[_0x1a6900]={'$like':'%'+_0x44117f[_0x9388('0x2d')]['filter']+'%'};return _0x5e582b;})});}_0x271a60=_['merge']({},_0x271a60,_0x44117f[_0x9388('0x84')]);return db['CmHopperFinal']['count']({'where':_0x271a60[_0x9388('0x5d')]})[_0x9388('0x18')](function(_0x43f900){_0x42ed44['count']=_0x43f900;if(_0x44117f['query'][_0x9388('0x9e')]){_0x271a60[_0x9388('0x9f')]=[{'all':!![]}];}return db[_0x9388('0x4c')][_0x9388('0x22')](_0x271a60);})[_0x9388('0x18')](function(_0x4f8483){_0x42ed44[_0x9388('0xa0')]=_0x4f8483;return _0x42ed44;});}})[_0x9388('0x18')](respondWithFilteredResult(_0x21bad2,_0x271a60))[_0x9388('0x24')](handleError(_0x21bad2,null));};exports[_0x9388('0xa4')]=function(_0xb0792d,_0x16b53f){var _0x3bf2ab={'raw':!![],'where':{}};var _0x38a1b9={};var _0x5a9aa2={'count':0x0,'rows':[]};return db[_0x9388('0x25')][_0x9388('0x86')]({'where':{'id':_0xb0792d[_0x9388('0x27')]['id']}})[_0x9388('0x18')](handleEntityNotFound(_0x16b53f,null))['then'](function(_0x3b38bf){if(_0x3b38bf){_0x38a1b9[_0x9388('0x7d')]=_['keys'](db['JscriptySessionReport'][_0x9388('0xa2')]);_0x38a1b9[_0x9388('0x2d')]=_[_0x9388('0x29')](_0xb0792d[_0x9388('0x2d')]);_0x38a1b9[_0x9388('0x81')]=_[_0x9388('0x7c')](_0x38a1b9[_0x9388('0x7d')],_0x38a1b9[_0x9388('0x2d')]);_0x3bf2ab[_0x9388('0x7e')]=_[_0x9388('0x7c')](_0x38a1b9[_0x9388('0x7d')],qs['fields'](_0xb0792d[_0x9388('0x2d')][_0x9388('0x7f')]));_0x3bf2ab['attributes']=_0x3bf2ab[_0x9388('0x7e')][_0x9388('0x2a')]?_0x3bf2ab[_0x9388('0x7e')]:_0x38a1b9[_0x9388('0x7d')];if(!_0xb0792d[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0x3bf2ab[_0x9388('0x15')]=qs[_0x9388('0x15')](_0xb0792d[_0x9388('0x2d')][_0x9388('0x15')]);_0x3bf2ab[_0x9388('0x13')]=qs[_0x9388('0x13')](_0xb0792d[_0x9388('0x2d')][_0x9388('0x13')]);}_0x3bf2ab['order']=qs['sort'](_0xb0792d[_0x9388('0x2d')][_0x9388('0x80')]);_0x3bf2ab[_0x9388('0x5d')]=qs[_0x9388('0x81')](_[_0x9388('0x82')](_0xb0792d[_0x9388('0x2d')],_0x38a1b9[_0x9388('0x81')]));_0x3bf2ab[_0x9388('0x5d')][_0x9388('0x9d')]=_0x3b38bf['id'];if(_0xb0792d['query'][_0x9388('0x83')]){_0x3bf2ab[_0x9388('0x5d')]=_[_0x9388('0x38')](_0x3bf2ab[_0x9388('0x5d')],{'$or':_['map'](_0x3bf2ab['attributes'],function(_0x204047){var _0x13d813={};_0x13d813[_0x204047]={'$like':'%'+_0xb0792d[_0x9388('0x2d')][_0x9388('0x83')]+'%'};return _0x13d813;})});}_0x3bf2ab=_[_0x9388('0x38')]({},_0x3bf2ab,_0xb0792d[_0x9388('0x84')]);return db[_0x9388('0x53')]['count']({'where':_0x3bf2ab[_0x9388('0x5d')]})[_0x9388('0x18')](function(_0x5472e5){_0x5a9aa2[_0x9388('0x16')]=_0x5472e5;if(_0xb0792d[_0x9388('0x2d')][_0x9388('0x9e')]){_0x3bf2ab['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9388('0x22')](_0x3bf2ab);})['then'](function(_0xe16379){_0x5a9aa2[_0x9388('0xa0')]=_0xe16379;return _0x5a9aa2;});}})[_0x9388('0x18')](respondWithFilteredResult(_0x16b53f,_0x3bf2ab))['catch'](handleError(_0x16b53f,null));};exports[_0x9388('0xa5')]=function(_0xe603a5,_0x244fa6){try{if(!_0xe603a5[_0x9388('0x39')][_0x9388('0x60')]){throw new Error(_0x9388('0xa6'));}if(!_0xe603a5[_0x9388('0x39')][_0x9388('0xa7')]){throw new Error(_0x9388('0xa8'));}if(!_0xe603a5['body'][_0x9388('0xa9')]){throw new Error(_0x9388('0xaa'));}if(!_0xe603a5['body']['socket_timestamp']){throw new Error(_0x9388('0xab'));}var _0x2aa5b6=_0xe603a5[_0x9388('0x39')]['binding_keys'][_0x9388('0xac')](',');var _0x1a993c=_0xe603a5[_0x9388('0x39')][_0x9388('0xa9')]['split'](',');if(!_0x2aa5b6['length']||!_0x1a993c[_0x9388('0x2a')]||_0x2aa5b6['length']!==_0x1a993c[_0x9388('0x2a')]){throw new Error(_0x9388('0xad'));}_0xe603a5[_0x9388('0x39')][_0x9388('0x7f')]=_[_0x9388('0xae')](_0x2aa5b6,_0x1a993c);if(!_0xe603a5['body'][_0x9388('0x7f')][_0x9388('0x79')]){throw new Error(_0x9388('0xaf'));}if(!_0xe603a5[_0x9388('0x39')]['fields'][_0x9388('0xb0')]){throw new Error(_0x9388('0xb1'));}var _0x558ac4=path[_0x9388('0x3d')](config[_0x9388('0xb2')],_0x9388('0xb3'),_0xe603a5[_0x9388('0xb4')][_0x9388('0xb5')]);fs[_0x9388('0xb6')](_0x558ac4,parseInt(_0x9388('0xb7'),0x8));var _0x14dc1f=require(_0x9388('0xb8'))[_0x9388('0xb9')](path[_0x9388('0x3d')](__dirname,_0x9388('0xba')),[_0x558ac4,_0xe603a5[_0x9388('0x39')][_0x9388('0xa7')],_0xe603a5[_0x9388('0x39')][_0x9388('0xa9')],_0xe603a5[_0x9388('0x39')]['ListId'],_0xe603a5[_0x9388('0x39')][_0x9388('0xbb')],_0xe603a5[_0x9388('0x39')]['duplicates'],_0xe603a5['body'][_0x9388('0xbc')]]);return _0x244fa6['status'](0xc8)[_0x9388('0xbd')]({'message':_0x9388('0xbe'),'pid':_0x14dc1f[_0x9388('0xbf')]});}catch(_0x1457c8){return _0x244fa6[_0x9388('0x12')](0x1f4)[_0x9388('0x1e')](_0x1457c8);}};exports[_0x9388('0xc0')]=function(_0x4506e0,_0x1cf9bc){var _0x2bf282=fs[_0x9388('0xc1')](_0x4506e0[_0x9388('0xb4')][_0x9388('0x3')]);Papa[_0x9388('0xc2')](_0x2bf282,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x512aee){return _0x1cf9bc[_0x9388('0x12')](0xc8)[_0x9388('0xbd')]({'file':_0x4506e0['file'],'fields':_0x512aee[_0x9388('0xc3')][_0x9388('0x7f')]});}});};exports['import']=function(_0x33c645,_0x2ffda4){return db[_0x9388('0xc4')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9388('0xc5')}})[_0x9388('0x18')](function(_0x6991b9){var _0x28f093=![];if(!_0x33c645[_0x9388('0x39')]['ListId']){throw new Error(_0x9388('0xa6'));}if(!_0x33c645[_0x9388('0x39')][_0x9388('0xc6')][_0x9388('0x79')]){throw new Error(_0x9388('0xaf'));}if(!_0x33c645[_0x9388('0x39')][_0x9388('0xc6')][_0x9388('0xb0')]){throw new Error(_0x9388('0xb1'));}if(!_0x33c645[_0x9388('0x39')][_0x9388('0xbc')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3c4144=require(_0x9388('0xb8'))[_0x9388('0xb9')](path[_0x9388('0x3d')](__dirname,_0x9388('0xc7')),[_0x33c645[_0x9388('0x27')]['id'],JSON[_0x9388('0xc8')](_0x33c645[_0x9388('0x39')]),JSON[_0x9388('0xc8')](_0x6991b9)]);_0x3c4144['on'](_0x9388('0xc9'),function(){_0x28f093=!![];return _0x2ffda4[_0x9388('0x12')](0xc8)[_0x9388('0xbd')]({'message':_0x9388('0xca'),'pid':_0x3c4144[_0x9388('0xbf')]});});_0x3c4144['on'](_0x9388('0xcb'),function(_0xf1dfc3){if(_0xf1dfc3&&!_0x28f093){return _0x2ffda4[_0x9388('0x12')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x3c4144[_0x9388('0xbf')]});}});})[_0x9388('0x24')](handleError(_0x2ffda4,null));};exports[_0x9388('0xcc')]=function(_0x80e0a7,_0x4edf8c){return db[_0x9388('0xc4')][_0x9388('0x22')]({'raw':!![],'attributes':['id'],'where':{'role':_0x9388('0xc5')}})[_0x9388('0x18')](function(_0x2e0f38){var _0x30d2c7=![];if(!_0x80e0a7['body'][_0x9388('0x60')]){throw new Error(_0x9388('0xa6'));}if(!_0x80e0a7[_0x9388('0x39')][_0x9388('0xc6')]['phone']){throw new Error(_0x9388('0xaf'));}if(!_0x80e0a7[_0x9388('0x39')][_0x9388('0xc6')]['firstName']){throw new Error(_0x9388('0xb1'));}if(!_0x80e0a7[_0x9388('0x39')][_0x9388('0xbc')]){throw new Error(_0x9388('0xab'));}var _0x1f2daa=require('child_process')[_0x9388('0xb9')](path['join'](__dirname,_0x9388('0xcd')),[_0x80e0a7['params']['id'],JSON[_0x9388('0xc8')](_0x80e0a7[_0x9388('0x39')]),JSON[_0x9388('0xc8')](_0x2e0f38)]);_0x1f2daa['on'](_0x9388('0xc9'),function(){_0x30d2c7=!![];return _0x4edf8c['status'](0xc8)['json']({'message':_0x9388('0xca'),'pid':_0x1f2daa[_0x9388('0xbf')]});});_0x1f2daa['on']('exit',function(_0x31e143){if(_0x31e143&&!_0x30d2c7){return _0x4edf8c[_0x9388('0x12')](0x1f4)['json']({'message':_0x9388('0xce'),'pid':_0x1f2daa[_0x9388('0xbf')]});}});})[_0x9388('0x24')](handleError(_0x4edf8c,null));};exports[_0x9388('0xcf')]=function(_0xd9fd1b,_0x311739){var _0xbbcd65=[_0x9388('0xd0'),_0x9388('0xd1'),_0x9388('0xd2'),_0x9388('0xd3'),_0x9388('0xd4'),_0x9388('0xd5'),_0x9388('0xd6')];var _0x4d6fb1={'offset':0x0,'order':qs[_0x9388('0x80')](_0x9388('0xd7'))},_0x35807d={'count':0x0,'rows':[]};Promise['resolve']()[_0x9388('0x18')](function(){if(_0xd9fd1b[_0x9388('0x2d')]['channel']){if(!_[_0x9388('0xd8')](_0xbbcd65,_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xd9')][_0x9388('0xda')]())){throw new Error(_0x9388('0xdb'));}_0xbbcd65=[_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xd9')][_0x9388('0xda')]()];}if(_0xd9fd1b['query'][_0x9388('0xdc')]){try{var _0x3f6605=JSON[_0x9388('0xc2')](_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xdc')]);if(!moment(_0x3f6605[_0x9388('0x3e')])[_0x9388('0xdd')]()){throw new Error(_0x9388('0xde'));}if(!moment(_0x3f6605['to'])['isValid']()){throw new Error(_0x9388('0xdf'));}}catch(_0x20f103){throw new Error(_0x9388('0xe0'));}}if(!_0xd9fd1b[_0x9388('0x2d')][_0x9388('0x37')](_0x9388('0x85'))){_0x4d6fb1[_0x9388('0x15')]=qs[_0x9388('0x15')](_0xd9fd1b[_0x9388('0x2d')][_0x9388('0x15')]||0xa);_0x4d6fb1['offset']=qs[_0x9388('0x13')](_0xd9fd1b['query']['offset']);}var _0x1a1d05=_0xbbcd65[_0x9388('0x70')](function(_0x364815){if(_0x364815===_0x9388('0xd6')){var _0x5d92cf={'attributes':['id',_0x9388('0xe1'),_0x9388('0xe2'),_0x9388('0xe3'),'destination',_0x9388('0xe4'),'starttime',_0x9388('0xe5'),'duration',_0x9388('0xe6'),_0x9388('0xe7'),'userDisposition','userSecondDisposition','userThirdDisposition',_0x9388('0xe8')],'where':{'ContactId':_0xd9fd1b[_0x9388('0x27')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0x9388('0x1d'),_0x9388('0xe9'),_0x9388('0x31')]}],'order':[[_0x9388('0xe7'),_0x9388('0xea')]]};if(_0xd9fd1b[_0x9388('0x2d')][_0x9388('0xdc')]){_0x5d92cf[_0x9388('0x5d')][_0x9388('0xe7')]={'$gte':_0x3f6605[_0x9388('0x3e')],'$lte':_0x3f6605['to']};}return db['VoiceCallReport'][_0x9388('0xeb')](_0x5d92cf)[_0x9388('0x18')](function(_0x115529){_0x35807d[_0x9388('0x16')]+=_0x115529['count'];return _[_0x9388('0x70')](_0x115529[_0x9388('0xa0')],function(_0x58da11){var _0x16c082=_0x58da11[_0x9388('0x3a')]({'plain':!![]});_0x16c082[_0x9388('0xd9')]=_0x364815;if(_0x16c082[_0x9388('0xc4')]){_0x16c082[_0x9388('0xc4')]={'id':_0x16c082[_0x9388('0xc4')]['id'],'name':_0x16c082[_0x9388('0xc4')][_0x9388('0x1d')],'fullname':_0x16c082['User']['fullname'],'alias':_0x16c082['User'][_0x9388('0x31')]};}return _0x16c082;});});}else{var _0x588c1e=_['startCase'](_0x364815)+(_0x364815===_0x9388('0xd1')?_0x9388('0xec'):_0x9388('0xed'));var _0x520fe5={'attributes':['id',_0x9388('0xee'),'closedAt',_0x9388('0xe7'),_0x9388('0xe6'),_0x9388('0xef'),_0x9388('0xf0'),_0x9388('0xf1'),_0x9388('0xe8'),_0x588c1e+'Id'],'where':{'ContactId':_0xd9fd1b[_0x9388('0x27')]['id']},'include':[{'model':db[_0x588c1e],'as':_0x9388('0xed'),'attributes':['id','name',_0x9388('0xf2')]},{'model':db[_0x9388('0xc4')],'as':_0x9388('0xf3'),'attributes':['id','name',_0x9388('0xe9')]},{'model':db[_0x9388('0x7b')],'as':_0x9388('0x66'),'attributes':['id',_0x9388('0x1d'),_0x9388('0x67')],'through':{'attributes':[]}}],'order':[[_0x9388('0xe7'),_0x9388('0xea')]]};if(_0xd9fd1b['query']['range']){_0x520fe5[_0x9388('0x5d')]['createdAt']={'$gte':_0x3f6605[_0x9388('0x3e')],'$lte':_0x3f6605['to']};}switch(_0x364815){case _0x9388('0xd1'):_0x520fe5[_0x9388('0x7e')][_0x9388('0x5f')](_0x9388('0xf4'),_0x9388('0xf5'),_0x9388('0xf6'),_0x9388('0xf7'),_0x9388('0xf8'),_0x9388('0xf9'),_0x9388('0xfa'),_0x9388('0xfb'),_0x9388('0xfc'));break;case _0x9388('0xd0'):_0x520fe5[_0x9388('0x7e')][_0x9388('0x5f')](_0x9388('0xfd'),_0x9388('0xfe'));break;case _0x9388('0xd3'):_0x520fe5[_0x9388('0x7e')][_0x9388('0x5f')](_0x9388('0xff'),_0x9388('0x100'));break;}return db[_[_0x9388('0x101')](_0x364815)+'Interaction'][_0x9388('0xeb')](_0x520fe5)[_0x9388('0x18')](function(_0x4c866b){_0x35807d[_0x9388('0x16')]+=_0x4c866b[_0x9388('0x16')];return _[_0x9388('0x70')](_0x4c866b['rows'],function(_0x1c9c72){var _0x3a065d=_0x1c9c72[_0x9388('0x3a')]({'plain':!![]});_0x3a065d[_0x9388('0xd9')]=_0x364815;if(_0x3a065d[_0x9388('0xf3')]){_0x3a065d[_0x9388('0xf3')]={'id':_0x3a065d[_0x9388('0xf3')]['id'],'name':_0x3a065d[_0x9388('0xf3')][_0x9388('0x1d')],'fullname':_0x3a065d[_0x9388('0xf3')][_0x9388('0xe9')]};}return _0x3a065d;});});}});return Promise[_0x9388('0x64')](_0x1a1d05);})[_0x9388('0x18')](function(_0x3a254d){return _(_0x3a254d)[_0x9388('0x102')]()[_0x9388('0x103')](_0x9388('0xe7'))['reverse']()[_0x9388('0x104')]();})[_0x9388('0x18')](function(_0x5e3bc7){_0x35807d[_0x9388('0xa0')]=_0x4d6fb1[_0x9388('0x15')]?_0x5e3bc7['slice'](_0x4d6fb1[_0x9388('0x13')],_0x4d6fb1[_0x9388('0x13')]+_0x4d6fb1[_0x9388('0x15')]):_0x5e3bc7;return _0x35807d;})[_0x9388('0x18')](respondWithFilteredResult(_0x311739,_0x4d6fb1))[_0x9388('0x24')](handleError(_0x311739,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index aa8b78e..09d495a 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 _0x40d0=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x76b00b,_0x26e939){var _0xc8e4a=function(_0xb16025){while(--_0xb16025){_0x76b00b['push'](_0x76b00b['shift']());}};_0xc8e4a(++_0x26e939);}(_0x40d0,0x158));var _0x040d=function(_0x2dd651,_0x3770da){_0x2dd651=_0x2dd651-0x0;var _0x2627f0=_0x40d0[_0x2dd651];return _0x2627f0;};'use strict';var EventEmitter=require(_0x040d('0x0'));var CmContact=require(_0x040d('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x040d('0x2')](0x0);var events={'afterCreate':_0x040d('0x3'),'afterUpdate':'update','afterDestroy':_0x040d('0x4')};function emitEvent(_0x3e7834){return function(_0x56cb8f,_0xe596f5,_0x367fdb){CmContactEvents[_0x040d('0x5')](_0x3e7834+':'+_0x56cb8f['id'],_0x56cb8f);CmContactEvents[_0x040d('0x5')](_0x3e7834,_0x56cb8f);_0x367fdb(null);};}for(var e in events){if(events[_0x040d('0x6')](e)){var event=events[e];CmContact[_0x040d('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x5e6d=['events','../../mysqldb','CmContact','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x6b0451,_0x266f96){var _0x1eb6d5=function(_0x3c2d53){while(--_0x3c2d53){_0x6b0451['push'](_0x6b0451['shift']());}};_0x1eb6d5(++_0x266f96);}(_0x5e6d,0x12c));var _0xd5e6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x5e6d[_0x5834bc];return _0x3e183a;};'use strict';var EventEmitter=require(_0xd5e6('0x0'));var CmContact=require(_0xd5e6('0x1'))['db'][_0xd5e6('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xd5e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd5e6('0x4'),'afterDestroy':_0xd5e6('0x5')};function emitEvent(_0x2ff856){return function(_0x5853f7,_0x45876b,_0x373841){CmContactEvents[_0xd5e6('0x6')](_0x2ff856+':'+_0x5853f7['id'],_0x5853f7);CmContactEvents[_0xd5e6('0x6')](_0x2ff856,_0x5853f7);_0x373841(null);};}for(var e in events){if(events[_0xd5e6('0x7')](e)){var event=events[e];CmContact[_0xd5e6('0x8')](e,emitEvent(event));}}module[_0xd5e6('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 3624b58..d1af724 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 _0x0c44=['error','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','VoiceQueue','BlackLists','CmHopperBlack','onlyIfOpen','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','info','inspect','[CmContact][afterDestroy][Error]','lodash','util','api','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','cmContact','afterCreate','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','then','utcOffset','add','minutes','format','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','priority'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x0c44,0x68));var _0x40c4=function(_0x1bdc53,_0x236ace){_0x1bdc53=_0x1bdc53-0x0;var _0x109bd0=_0x0c44[_0x1bdc53];return _0x109bd0;};'use strict';var _=require(_0x40c4('0x0'));var util=require(_0x40c4('0x1'));var logger=require('../../config/logger')(_0x40c4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x40c4('0x3'));var fs=require('fs');var path=require(_0x40c4('0x4'));var rimraf=require(_0x40c4('0x5'));var config=require(_0x40c4('0x6'));var shared=require(_0x40c4('0x7'));var attributes=require(_0x40c4('0x8'));module[_0x40c4('0x9')]=function(_0x1bd5dd,_0x4c08b9){return _0x1bd5dd[_0x40c4('0xa')](_0x40c4('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x40c4('0xc')]},{'name':_0x40c4('0xd'),'fields':[_0x40c4('0xe'),_0x40c4('0xf'),_0x40c4('0xc'),_0x40c4('0x10'),_0x40c4('0x11'),_0x40c4('0x12')],'type':_0x40c4('0x13')}],'timestamps':!![],'charset':_0x40c4('0x14'),'collate':_0x40c4('0x15'),'hooks':{'afterCreate':function(_0x3a7377,_0xb3084b,_0x31b401){var _0x53e8c0=_0x1bd5dd['models'];var _0x1f8243=_0x3a7377[_0x40c4('0x16')]({'plain':!![]});function _0x44dbe(){return function(_0x9f1b41){logger['error'](_0x40c4('0x17'),_0x40c4('0x18'),util['inspect'](_0x9f1b41,{'showHidden':![],'depth':null}));};}function _0x1d2d20(_0x450811,_0x4a47e7){var _0x25ef60=_0x4a47e7[_0x40c4('0x19')]?_0x4a47e7[_0x40c4('0x19')]:moment()['format'](_0x40c4('0x1a'));return new BPromise(function(_0x465089,_0x1c2098){if(_[_0x40c4('0x1b')](_0x4a47e7[_0x40c4('0x1c')])){_0x465089({'ret':_0x25ef60});}else{_0x53e8c0['VoiceQueue']['findOne']({'where':{'id':_0x450811['id']}})[_0x40c4('0x1d')](function(_0x1a3990){if(!_[_0x40c4('0x1b')](_0x1a3990)){var _0xaab405=_0x1a3990[_0x40c4('0x1c')];if(!_[_0x40c4('0x1b')](_0xaab405)){var _0x5ad866=shared['timezones'];var _0x2ae41d=_0x5ad866[_0xaab405];var _0x1e8f6e=_0x5ad866[_0x4a47e7[_0x40c4('0x1c')]];if(!_['isNil'](_0x2ae41d)&&!_[_0x40c4('0x1b')](_0x1e8f6e)){var _0x39766b=_0x2ae41d['utcOffset']-_0x1e8f6e[_0x40c4('0x1e')];_0x25ef60=_0x4a47e7['scheduledat']?_0x4a47e7[_0x40c4('0x19')]:moment();var _0x39c4bc=moment(_0x25ef60)[_0x40c4('0x1f')](_0x39766b,_0x40c4('0x20'));_0x465089({'ret':_0x39c4bc[_0x40c4('0x21')](_0x40c4('0x1a'))});}else _0x465089({'ret':_0x25ef60});}else _0x465089({'ret':_0x25ef60});}else{_0x465089({'ret':_0x25ef60});}});}});return 0xa;}var _0x5954d3=function(_0x470ae8){return new BPromise(function(_0x2e97ee,_0x3e2d3f){_0x1d2d20(_0x470ae8,_0x1f8243)[_0x40c4('0x1d')](function(_0x93ccbe){_0x1f8243[_0x40c4('0x19')]=_0x93ccbe[_0x40c4('0x22')];_0x53e8c0[_0x40c4('0x23')]['findOne']({'where':{'phone':_0x1f8243[_0x40c4('0xc')],'VoiceQueueId':_0x470ae8['id']}})[_0x40c4('0x1d')](function(_0x28fdd3){if(!_[_0x40c4('0x1b')](_0x28fdd3)){throw new Error(_0x40c4('0x24')+_0x1f8243['phone']+_0x40c4('0x25')+_0x470ae8['id']);}return _0x53e8c0[_0x40c4('0x23')][_0x40c4('0x26')]({'phone':_0x1f8243[_0x40c4('0xc')],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243[_0x40c4('0x27')],'priority':_0x1f8243['priority']?_0x1f8243['priority']:0x2,'scheduledat':_0x1f8243[_0x40c4('0x19')]?_0x1f8243[_0x40c4('0x19')]:moment()[_0x40c4('0x21')](_0x40c4('0x1a')),'callback':_0x1f8243[_0x40c4('0x28')]?!![]:![],'callbackuniqueid':_0x1f8243[_0x40c4('0x28')]?_0x1f8243[_0x40c4('0x28')]:undefined,'callbackat':_0x1f8243[_0x40c4('0x28')]?moment()[_0x40c4('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x470ae8['id']});})[_0x40c4('0x29')](function(_0x1ef605){_0x3e2d3f(_0x1ef605);});});});};var _0x353d03=function(_0x1d0110){return new BPromise(function(_0x45ce11,_0x27262a){_0x1d2d20(_0x1d0110,_0x1f8243)[_0x40c4('0x1d')](function(_0x19ceaf){_0x1f8243['scheduledat']=_0x19ceaf[_0x40c4('0x22')];_0x53e8c0['CmHopper'][_0x40c4('0x2a')]({'where':{'phone':_0x1f8243[_0x40c4('0xc')],'VoiceQueueId':_0x1d0110['id']}})[_0x40c4('0x1d')](function(_0x3611f0){if(!_['isNil'](_0x3611f0)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1f8243[_0x40c4('0xc')]+_0x40c4('0x2b')+_0x1d0110['id']);}return _0x53e8c0[_0x40c4('0x2c')]['findOne']({'where':{'calleridnum':_0x1f8243[_0x40c4('0xc')],'VoiceQueueId':_0x1d0110['id']}});})[_0x40c4('0x1d')](function(_0x1fd976){if(!_[_0x40c4('0x1b')](_0x1fd976)){throw new Error(_0x40c4('0x2d')+_0x1f8243[_0x40c4('0xc')]+_0x40c4('0x2e')+_0x1d0110['id']);}return _0x53e8c0[_0x40c4('0x23')][_0x40c4('0x26')]({'phone':_0x1f8243[_0x40c4('0xc')],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243['ListId'],'priority':_0x1f8243[_0x40c4('0x2f')]?_0x1f8243[_0x40c4('0x2f')]:0x2,'scheduledat':_0x1f8243['scheduledat']?_0x1f8243[_0x40c4('0x19')]:moment()[_0x40c4('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1f8243[_0x40c4('0x28')]?!![]:![],'callbackuniqueid':_0x1f8243['callbackUniqueid']?_0x1f8243[_0x40c4('0x28')]:undefined,'callbackat':_0x1f8243[_0x40c4('0x28')]?moment()[_0x40c4('0x21')](_0x40c4('0x1a')):undefined,'VoiceQueueId':_0x1d0110['id']});})[_0x40c4('0x29')](function(_0x3f8c49){_0x27262a(_0x3f8c49);});});});};function _0x41b1e0(){return function(_0xd220f7){logger[_0x40c4('0x30')](_0x40c4('0x17'),'afterCreate',util['inspect'](_0xd220f7,{'showHidden':![],'depth':null}));};}function _0x307f30(_0x5098c2,_0x5c1742){var _0xa6df1=_0x5c1742['scheduledat']?_0x5c1742[_0x40c4('0x19')]:moment()[_0x40c4('0x21')](_0x40c4('0x1a'));return new BPromise(function(_0x49d662,_0x27f17b){if(_['isNil'](_0x5c1742[_0x40c4('0x1c')])){_0x49d662({'ret':_0xa6df1});}else{_0x53e8c0[_0x40c4('0x31')]['findOne']({'where':{'id':_0x5098c2['id']}})['then'](function(_0x15c80e){if(!_[_0x40c4('0x1b')](_0x15c80e)){var _0x290b21=_0x15c80e[_0x40c4('0x1c')];if(!_[_0x40c4('0x1b')](_0x290b21)){var _0x369130=shared[_0x40c4('0x32')];var _0xc0e0e4=_0x369130[_0x290b21];var _0x547932=_0x369130[_0x5c1742['dialTimezone']];if(!_[_0x40c4('0x1b')](_0xc0e0e4)&&!_['isNil'](_0x547932)){var _0x5ba089=_0xc0e0e4[_0x40c4('0x1e')]-_0x547932[_0x40c4('0x1e')];_0xa6df1=_0x5c1742[_0x40c4('0x19')]?_0x5c1742['scheduledat']:moment();var _0x5ba76a=moment(_0xa6df1)[_0x40c4('0x1f')](_0x5ba089,_0x40c4('0x20'));_0x49d662({'ret':_0x5ba76a[_0x40c4('0x21')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x49d662({'ret':_0xa6df1});}else _0x49d662({'ret':_0xa6df1});}else{_0x49d662({'ret':_0xa6df1});}});}});return 0xa;}var _0x306170=function(_0x20e6c8){return new BPromise(function(_0x43ac7d,_0xa9cddc){_0x307f30(_0x20e6c8,_0x1f8243)[_0x40c4('0x1d')](function(_0x487ec8){_0x1f8243['scheduledat']=_0x487ec8[_0x40c4('0x22')];_0x53e8c0['CmHopper'][_0x40c4('0x2a')]({'where':{'phone':_0x1f8243[_0x40c4('0xc')],'CampaignId':_0x20e6c8['id']}})['then'](function(_0x312782){if(!_[_0x40c4('0x1b')](_0x312782)){throw new Error(_0x40c4('0x24')+_0x1f8243[_0x40c4('0xc')]+_0x40c4('0x33')+_0x20e6c8['id']);}return _0x53e8c0['CmHopper'][_0x40c4('0x26')]({'phone':_0x1f8243[_0x40c4('0xc')],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243[_0x40c4('0x27')],'priority':_0x1f8243[_0x40c4('0x2f')]?_0x1f8243[_0x40c4('0x2f')]:0x2,'scheduledat':_0x1f8243['scheduledat']?_0x1f8243[_0x40c4('0x19')]:moment()[_0x40c4('0x21')](_0x40c4('0x1a')),'callback':_0x1f8243[_0x40c4('0x28')]?!![]:![],'callbackuniqueid':_0x1f8243['callbackUniqueid']?_0x1f8243['callbackUniqueid']:undefined,'callbackat':_0x1f8243[_0x40c4('0x28')]?moment()[_0x40c4('0x21')](_0x40c4('0x1a')):undefined,'CampaignId':_0x20e6c8['id']});})[_0x40c4('0x29')](function(_0x6d8557){_0xa9cddc(_0x6d8557);});});});};var _0x4f847f=function(_0x126d44){return new BPromise(function(_0x5141d4,_0x45433e){_0x307f30(_0x126d44,_0x1f8243)[_0x40c4('0x1d')](function(_0x5bd6e8){_0x1f8243[_0x40c4('0x19')]=_0x5bd6e8['ret'];_0x53e8c0[_0x40c4('0x23')][_0x40c4('0x2a')]({'where':{'phone':_0x1f8243[_0x40c4('0xc')],'CampaignId':_0x126d44['id']}})[_0x40c4('0x1d')](function(_0x1be40f){if(!_[_0x40c4('0x1b')](_0x1be40f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1f8243[_0x40c4('0xc')]+_0x40c4('0x34')+_0x126d44['id']);}return _0x53e8c0['CmHopperFinal'][_0x40c4('0x2a')]({'where':{'calleridnum':_0x1f8243[_0x40c4('0xc')],'CampaignId':_0x126d44['id']}});})[_0x40c4('0x1d')](function(_0x2a68a5){if(!_[_0x40c4('0x1b')](_0x2a68a5)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1f8243[_0x40c4('0xc')]+_0x40c4('0x35')+_0x126d44['id']);}return _0x53e8c0[_0x40c4('0x23')][_0x40c4('0x26')]({'phone':_0x1f8243[_0x40c4('0xc')],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243[_0x40c4('0x27')],'priority':_0x1f8243[_0x40c4('0x2f')]?_0x1f8243[_0x40c4('0x2f')]:0x2,'scheduledat':_0x1f8243[_0x40c4('0x19')]?_0x1f8243[_0x40c4('0x19')]:moment()['format'](_0x40c4('0x1a')),'callback':_0x1f8243[_0x40c4('0x28')]?!![]:![],'callbackuniqueid':_0x1f8243['callbackUniqueid']?_0x1f8243[_0x40c4('0x28')]:undefined,'callbackat':_0x1f8243[_0x40c4('0x28')]?moment()[_0x40c4('0x21')](_0x40c4('0x1a')):undefined,'CampaignId':_0x126d44['id']});})['catch'](function(_0x21809a){_0x45433e(_0x21809a);});});});};if(_0x1f8243[_0x40c4('0x27')]){_0x53e8c0['VoiceQueue'][_0x40c4('0x36')]({'where':{'type':_0x40c4('0x37')},'attributes':['id',_0x40c4('0x38'),_0x40c4('0x1c')],'include':[{'model':_0x53e8c0[_0x40c4('0x39')],'as':_0x40c4('0x3a'),'where':{'id':_0x1f8243[_0x40c4('0x27')]}}]})['then'](function(_0x30ae49){if(_0x30ae49){var _0x4f1191=[];for(var _0x153ae2=0x0,_0x59bea5;_0x153ae2<_0x30ae49[_0x40c4('0x3b')];_0x153ae2+=0x1){_0x59bea5=_0x30ae49[_0x153ae2][_0x40c4('0x16')]({'plain':!![]});switch(_0x59bea5[_0x40c4('0x38')]){case _0x40c4('0x3c'):_0x353d03(_0x59bea5)[_0x40c4('0x29')](_0x44dbe());break;case'onlyIfOpen':_0x5954d3(_0x59bea5)[_0x40c4('0x29')](_0x44dbe());break;default:_0x307f30(_0x59bea5,_0x1f8243)['then'](function(_0x414cb7){_0x1f8243['scheduledat']=_0x414cb7[_0x40c4('0x22')];_0x53e8c0[_0x40c4('0x23')][_0x40c4('0x26')]({'phone':_0x1f8243['phone'],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243[_0x40c4('0x27')],'scheduledat':_0x1f8243[_0x40c4('0x19')]?_0x1f8243['scheduledat']:moment()[_0x40c4('0x21')](_0x40c4('0x1a')),'priority':_0x1f8243['priority']?_0x1f8243[_0x40c4('0x2f')]:0x2,'callback':_0x1f8243[_0x40c4('0x28')]?!![]:![],'callbackuniqueid':_0x1f8243[_0x40c4('0x28')]?_0x1f8243[_0x40c4('0x28')]:undefined,'callbackat':_0x1f8243[_0x40c4('0x28')]?moment()[_0x40c4('0x21')](_0x40c4('0x1a')):undefined,'VoiceQueueId':_0x59bea5['id']})[_0x40c4('0x29')](_0x44dbe());});}}}})['then'](function(){return _0x53e8c0[_0x40c4('0x3d')][_0x40c4('0x36')]({'where':{'type':_0x40c4('0x37')},'attributes':['id'],'include':[{'model':_0x53e8c0[_0x40c4('0x39')],'as':_0x40c4('0x3e'),'where':{'id':_0x1f8243[_0x40c4('0x27')]}}]})[_0x40c4('0x1d')](function(_0x33fe17){if(_0x33fe17){var _0x2f47c8=[];for(var _0x5474a1=0x0,_0x3b108d;_0x5474a1<_0x33fe17['length'];_0x5474a1+=0x1){_0x3b108d=_0x33fe17[_0x5474a1][_0x40c4('0x16')]({'plain':!![]});_0x53e8c0[_0x40c4('0x3f')]['create']({'phone':_0x1f8243['phone'],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243['ListId'],'VoiceQueueId':_0x3b108d['id']})['catch'](function(_0x156507){logger[_0x40c4('0x30')]('cmContact,\x20%s,\x20%s',_0x40c4('0x18'),_0x156507['message']);});}}});})[_0x40c4('0x1d')](function(){return _0x53e8c0['Campaign'][_0x40c4('0x36')]({'attributes':['id',_0x40c4('0x38'),'dialTimezone'],'include':[{'model':_0x53e8c0['CmList'],'as':_0x40c4('0x3a'),'where':{'id':_0x1f8243[_0x40c4('0x27')]}}]})['then'](function(_0x2da048){if(_0x2da048){var _0x151736=[];for(var _0x2e7436=0x0,_0x3701b1;_0x2e7436<_0x2da048['length'];_0x2e7436+=0x1){_0x3701b1=_0x2da048[_0x2e7436][_0x40c4('0x16')]({'plain':!![]});switch(_0x3701b1[_0x40c4('0x38')]){case'always':_0x4f847f(_0x3701b1)[_0x40c4('0x29')](_0x41b1e0());break;case _0x40c4('0x40'):_0x306170(_0x3701b1)[_0x40c4('0x29')](_0x41b1e0());break;default:_0x53e8c0['CmHopper'][_0x40c4('0x26')]({'phone':_0x1f8243[_0x40c4('0xc')],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243[_0x40c4('0x27')],'scheduledat':_0x1f8243['scheduledat']?_0x1f8243[_0x40c4('0x19')]:moment()[_0x40c4('0x21')](_0x40c4('0x1a')),'priority':_0x1f8243['priority']?_0x1f8243[_0x40c4('0x2f')]:0x2,'callback':_0x1f8243[_0x40c4('0x28')]?!![]:![],'callbackuniqueid':_0x1f8243['callbackUniqueid']?_0x1f8243['callbackUniqueid']:undefined,'callbackat':_0x1f8243['callbackUniqueid']?moment()[_0x40c4('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3701b1['id']})[_0x40c4('0x29')](_0x41b1e0());}}}});})[_0x40c4('0x1d')](function(){return _0x53e8c0[_0x40c4('0x31')][_0x40c4('0x36')]({'attributes':['id'],'include':[{'model':_0x53e8c0[_0x40c4('0x39')],'as':_0x40c4('0x3e'),'where':{'id':_0x1f8243[_0x40c4('0x27')]}}]})['then'](function(_0x1434f2){if(_0x1434f2){var _0x528292=[];for(var _0x19dda8=0x0,_0x5aad09;_0x19dda8<_0x1434f2['length'];_0x19dda8+=0x1){_0x5aad09=_0x1434f2[_0x19dda8][_0x40c4('0x16')]({'plain':!![]});_0x53e8c0['CmHopperBlack'][_0x40c4('0x26')]({'phone':_0x1f8243[_0x40c4('0xc')],'ContactId':_0x1f8243['id'],'ListId':_0x1f8243[_0x40c4('0x27')],'CampaignId':_0x5aad09['id']})['catch'](function(_0x4d2908){logger['error'](_0x40c4('0x41'),_0x40c4('0x18'),_0x4d2908['message']);});}}});})[_0x40c4('0x1d')](function(){_0x31b401();})[_0x40c4('0x29')](function(_0x5d6cf8){logger[_0x40c4('0x30')](_0x40c4('0x41'),_0x40c4('0x18'),_0x5d6cf8[_0x40c4('0x42')]);_0x31b401(_0x5d6cf8);});}else{_0x31b401(new Error(_0x40c4('0x43')));}},'afterDestroy':function(_0x52ffd6,_0x297cca,_0x2912ba){var _0x19f0e8=_0x1bd5dd['models'];var _0x1bd513=_0x52ffd6['get']({'plain':!![]});return _0x19f0e8[_0x40c4('0x23')][_0x40c4('0x36')]({'raw':!![],'where':{'ListId':_0x1bd513[_0x40c4('0x27')],'ContactId':_0x1bd513['id']}})[_0x40c4('0x1d')](function(_0x3f963f){if(!_[_0x40c4('0x44')](_0x3f963f)){var _0x38f632=[];for(var _0x9b4731=0x0;_0x9b4731<_0x3f963f[_0x40c4('0x3b')];_0x9b4731+=0x1){var _0x4bee65=_0x19f0e8[_0x40c4('0x23')][_0x40c4('0x45')]({'where':{'ListId':_0x3f963f[_0x9b4731]['ListId'],'ContactId':_0x3f963f[_0x9b4731][_0x40c4('0x46')],'VoiceQueueId':_0x3f963f[_0x9b4731][_0x40c4('0x47')],'CampaignId':_0x3f963f[_0x9b4731]['CampaignId']}});_0x38f632[_0x40c4('0x48')](_0x4bee65);}return BPromise['all'](_0x38f632);}})[_0x40c4('0x1d')](function(_0x424a36){logger[_0x40c4('0x49')]('[CmContact][afterDestroy][Succesfull]',util[_0x40c4('0x4a')](_0x424a36,{'showHidden':![],'depth':null}));_0x2912ba();})[_0x40c4('0x29')](function(_0x43921c){logger[_0x40c4('0x30')](_0x40c4('0x4b'),util[_0x40c4('0x4a')](_0x43921c,{'showHidden':![],'depth':null}));_0x2912ba(_0x43921c);});}}});}; \ No newline at end of file +var _0x669d=['afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','dialTimezone','timezones','utcOffset','minutes','then','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','ret','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','catch','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','get','onlyIfOpen','outbound','BlackLists','length','cmContact,\x20%s,\x20%s','always','CmHopperBlack','message','ContactId','VoiceQueueId','all','info','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','CmContact','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x669d,0x138));var _0xd669=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x669d[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xd669('0x0'));var util=require(_0xd669('0x1'));var logger=require(_0xd669('0x2'))(_0xd669('0x3'));var moment=require(_0xd669('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd669('0x5'));var rimraf=require(_0xd669('0x6'));var config=require(_0xd669('0x7'));var shared=require(_0xd669('0x8'));var attributes=require('./cmContact.attributes');module[_0xd669('0x9')]=function(_0x469798,_0x127a3f){return _0x469798[_0xd669('0xa')](_0xd669('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xd669('0xc'),'fields':[_0xd669('0xc')]},{'name':'fti_cm_contacts','fields':[_0xd669('0xd'),_0xd669('0xe'),'phone',_0xd669('0xf'),_0xd669('0x10'),_0xd669('0x11')],'type':_0xd669('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xd669('0x13'),'hooks':{'afterCreate':function(_0x2b8423,_0xd7df7,_0x4eb628){var _0x3d0c09=_0x469798[_0xd669('0x14')];var _0x271185=_0x2b8423['get']({'plain':!![]});function _0x20a693(){return function(_0x231e0f){logger[_0xd669('0x15')](_0xd669('0x16'),_0xd669('0x17'),util[_0xd669('0x18')](_0x231e0f,{'showHidden':![],'depth':null}));};}function _0x4d7e99(_0x40d196,_0x4d7efa){var _0x420940=_0x4d7efa[_0xd669('0x19')]?_0x4d7efa[_0xd669('0x19')]:moment()[_0xd669('0x1a')](_0xd669('0x1b'));return new BPromise(function(_0x110731,_0x2a20c1){if(_[_0xd669('0x1c')](_0x4d7efa['dialTimezone'])){_0x110731({'ret':_0x420940});}else{_0x3d0c09[_0xd669('0x1d')][_0xd669('0x1e')]({'where':{'id':_0x40d196['id']}})['then'](function(_0x3719d9){if(!_['isNil'](_0x3719d9)){var _0x333662=_0x3719d9[_0xd669('0x1f')];if(!_[_0xd669('0x1c')](_0x333662)){var _0x4a688c=shared[_0xd669('0x20')];var _0x18359b=_0x4a688c[_0x333662];var _0x256cdc=_0x4a688c[_0x4d7efa[_0xd669('0x1f')]];if(!_[_0xd669('0x1c')](_0x18359b)&&!_[_0xd669('0x1c')](_0x256cdc)){var _0x59d78e=_0x18359b[_0xd669('0x21')]-_0x256cdc[_0xd669('0x21')];_0x420940=_0x4d7efa['scheduledat']?_0x4d7efa[_0xd669('0x19')]:moment();var _0x23fad0=moment(_0x420940)['add'](_0x59d78e,_0xd669('0x22'));_0x110731({'ret':_0x23fad0[_0xd669('0x1a')](_0xd669('0x1b'))});}else _0x110731({'ret':_0x420940});}else _0x110731({'ret':_0x420940});}else{_0x110731({'ret':_0x420940});}});}});return 0xa;}var _0x11b171=function(_0x37370d){return new BPromise(function(_0x3e715b,_0x248b88){_0x4d7e99(_0x37370d,_0x271185)[_0xd669('0x23')](function(_0x47a657){_0x271185[_0xd669('0x19')]=_0x47a657['ret'];_0x3d0c09[_0xd669('0x24')][_0xd669('0x1e')]({'where':{'phone':_0x271185[_0xd669('0xc')],'VoiceQueueId':_0x37370d['id']}})[_0xd669('0x23')](function(_0x2756ec){if(!_['isNil'](_0x2756ec)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+_0xd669('0x26')+_0x37370d['id']);}return _0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185[_0xd669('0x28')]?_0x271185[_0xd669('0x28')]:0x2,'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185[_0xd669('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x271185['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x271185['callbackUniqueid']?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'VoiceQueueId':_0x37370d['id']});})['catch'](function(_0x3b9de1){_0x248b88(_0x3b9de1);});});});};var _0x3178c8=function(_0x52ad86){return new BPromise(function(_0x2078ed,_0x358d85){_0x4d7e99(_0x52ad86,_0x271185)[_0xd669('0x23')](function(_0x11bbbf){_0x271185[_0xd669('0x19')]=_0x11bbbf[_0xd669('0x2a')];_0x3d0c09[_0xd669('0x24')][_0xd669('0x1e')]({'where':{'phone':_0x271185[_0xd669('0xc')],'VoiceQueueId':_0x52ad86['id']}})[_0xd669('0x23')](function(_0x34b568){if(!_[_0xd669('0x1c')](_0x34b568)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x52ad86['id']);}return _0x3d0c09[_0xd669('0x2b')][_0xd669('0x1e')]({'where':{'calleridnum':_0x271185['phone'],'VoiceQueueId':_0x52ad86['id']}});})['then'](function(_0x37cb20){if(!_['isNil'](_0x37cb20)){throw new Error(_0xd669('0x2c')+_0x271185[_0xd669('0xc')]+_0xd669('0x2d')+_0x52ad86['id']);}return _0x3d0c09[_0xd669('0x24')][_0xd669('0x2e')]({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185['priority']?_0x271185[_0xd669('0x28')]:0x2,'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185['scheduledat']:moment()[_0xd669('0x1a')](_0xd669('0x1b')),'callback':_0x271185[_0xd669('0x29')]?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185['callbackUniqueid']:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x52ad86['id']});})[_0xd669('0x2f')](function(_0x2f116d){_0x358d85(_0x2f116d);});});});};function _0x245d7b(){return function(_0xf14fd5){logger['error']('cmContact',_0xd669('0x17'),util[_0xd669('0x18')](_0xf14fd5,{'showHidden':![],'depth':null}));};}function _0x2e4254(_0xb1fd26,_0x521a72){var _0x3f4636=_0x521a72[_0xd669('0x19')]?_0x521a72['scheduledat']:moment()[_0xd669('0x1a')](_0xd669('0x1b'));return new BPromise(function(_0x40b9ed,_0x398b23){if(_[_0xd669('0x1c')](_0x521a72['dialTimezone'])){_0x40b9ed({'ret':_0x3f4636});}else{_0x3d0c09[_0xd669('0x30')]['findOne']({'where':{'id':_0xb1fd26['id']}})[_0xd669('0x23')](function(_0x4a85d0){if(!_[_0xd669('0x1c')](_0x4a85d0)){var _0x301db9=_0x4a85d0['dialTimezone'];if(!_['isNil'](_0x301db9)){var _0x517fb5=shared['timezones'];var _0x57183e=_0x517fb5[_0x301db9];var _0x2eb21f=_0x517fb5[_0x521a72[_0xd669('0x1f')]];if(!_['isNil'](_0x57183e)&&!_[_0xd669('0x1c')](_0x2eb21f)){var _0x4421ba=_0x57183e['utcOffset']-_0x2eb21f[_0xd669('0x21')];_0x3f4636=_0x521a72[_0xd669('0x19')]?_0x521a72[_0xd669('0x19')]:moment();var _0x4f1d4a=moment(_0x3f4636)['add'](_0x4421ba,_0xd669('0x22'));_0x40b9ed({'ret':_0x4f1d4a[_0xd669('0x1a')](_0xd669('0x1b'))});}else _0x40b9ed({'ret':_0x3f4636});}else _0x40b9ed({'ret':_0x3f4636});}else{_0x40b9ed({'ret':_0x3f4636});}});}});return 0xa;}var _0x286b90=function(_0x227ad8){return new BPromise(function(_0x5b0883,_0x49daf8){_0x2e4254(_0x227ad8,_0x271185)['then'](function(_0x4f0ac5){_0x271185['scheduledat']=_0x4f0ac5[_0xd669('0x2a')];_0x3d0c09['CmHopper'][_0xd669('0x1e')]({'where':{'phone':_0x271185[_0xd669('0xc')],'CampaignId':_0x227ad8['id']}})[_0xd669('0x23')](function(_0x4dbf1b){if(!_[_0xd669('0x1c')](_0x4dbf1b)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x227ad8['id']);}return _0x3d0c09['CmHopper'][_0xd669('0x2e')]({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185['priority']?_0x271185[_0xd669('0x28')]:0x2,'scheduledat':_0x271185['scheduledat']?_0x271185['scheduledat']:moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x271185['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'CampaignId':_0x227ad8['id']});})[_0xd669('0x2f')](function(_0x2da876){_0x49daf8(_0x2da876);});});});};var _0xab9cc0=function(_0x4c1de1){return new BPromise(function(_0x50d585,_0x4bf5b9){_0x2e4254(_0x4c1de1,_0x271185)['then'](function(_0x1bb27b){_0x271185[_0xd669('0x19')]=_0x1bb27b[_0xd669('0x2a')];_0x3d0c09[_0xd669('0x24')]['findOne']({'where':{'phone':_0x271185[_0xd669('0xc')],'CampaignId':_0x4c1de1['id']}})['then'](function(_0x3fedc9){if(!_[_0xd669('0x1c')](_0x3fedc9)){throw new Error(_0xd669('0x25')+_0x271185[_0xd669('0xc')]+_0xd669('0x31')+_0x4c1de1['id']);}return _0x3d0c09[_0xd669('0x2b')][_0xd669('0x1e')]({'where':{'calleridnum':_0x271185[_0xd669('0xc')],'CampaignId':_0x4c1de1['id']}});})[_0xd669('0x23')](function(_0xcd60b6){if(!_[_0xd669('0x1c')](_0xcd60b6)){throw new Error(_0xd669('0x2c')+_0x271185[_0xd669('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x4c1de1['id']);}return _0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'priority':_0x271185['priority']?_0x271185['priority']:0x2,'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185['scheduledat']:moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x271185[_0xd669('0x29')]?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'CampaignId':_0x4c1de1['id']});})['catch'](function(_0x20d762){_0x4bf5b9(_0x20d762);});});});};if(_0x271185[_0xd669('0x27')]){_0x3d0c09['VoiceQueue'][_0xd669('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0xd669('0x33'),'dialTimezone'],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x35'),'where':{'id':_0x271185[_0xd669('0x27')]}}]})['then'](function(_0x29067a){if(_0x29067a){var _0x13840a=[];for(var _0x2fc52f=0x0,_0xee199c;_0x2fc52f<_0x29067a['length'];_0x2fc52f+=0x1){_0xee199c=_0x29067a[_0x2fc52f][_0xd669('0x36')]({'plain':!![]});switch(_0xee199c['dialCheckDuplicateType']){case'always':_0x3178c8(_0xee199c)[_0xd669('0x2f')](_0x20a693());break;case _0xd669('0x37'):_0x11b171(_0xee199c)[_0xd669('0x2f')](_0x20a693());break;default:_0x2e4254(_0xee199c,_0x271185)[_0xd669('0x23')](function(_0x2d3018){_0x271185[_0xd669('0x19')]=_0x2d3018[_0xd669('0x2a')];_0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'scheduledat':_0x271185[_0xd669('0x19')]?_0x271185[_0xd669('0x19')]:moment()[_0xd669('0x1a')](_0xd669('0x1b')),'priority':_0x271185[_0xd669('0x28')]?_0x271185['priority']:0x2,'callback':_0x271185[_0xd669('0x29')]?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185[_0xd669('0x29')]?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'VoiceQueueId':_0xee199c['id']})[_0xd669('0x2f')](_0x20a693());});}}}})[_0xd669('0x23')](function(){return _0x3d0c09[_0xd669('0x1d')][_0xd669('0x32')]({'where':{'type':_0xd669('0x38')},'attributes':['id'],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x39'),'where':{'id':_0x271185['ListId']}}]})[_0xd669('0x23')](function(_0x171d7a){if(_0x171d7a){var _0x4cb57a=[];for(var _0x2c99b0=0x0,_0x36582f;_0x2c99b0<_0x171d7a[_0xd669('0x3a')];_0x2c99b0+=0x1){_0x36582f=_0x171d7a[_0x2c99b0][_0xd669('0x36')]({'plain':!![]});_0x3d0c09['CmHopperBlack'][_0xd669('0x2e')]({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'VoiceQueueId':_0x36582f['id']})['catch'](function(_0x2b9868){logger['error'](_0xd669('0x3b'),_0xd669('0x17'),_0x2b9868['message']);});}}});})[_0xd669('0x23')](function(){return _0x3d0c09['Campaign']['findAll']({'attributes':['id',_0xd669('0x33'),_0xd669('0x1f')],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x35'),'where':{'id':_0x271185[_0xd669('0x27')]}}]})['then'](function(_0x27ae7b){if(_0x27ae7b){var _0x2570fb=[];for(var _0x32247e=0x0,_0x13399b;_0x32247e<_0x27ae7b[_0xd669('0x3a')];_0x32247e+=0x1){_0x13399b=_0x27ae7b[_0x32247e][_0xd669('0x36')]({'plain':!![]});switch(_0x13399b[_0xd669('0x33')]){case _0xd669('0x3c'):_0xab9cc0(_0x13399b)[_0xd669('0x2f')](_0x245d7b());break;case _0xd669('0x37'):_0x286b90(_0x13399b)[_0xd669('0x2f')](_0x245d7b());break;default:_0x3d0c09[_0xd669('0x24')]['create']({'phone':_0x271185['phone'],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'scheduledat':_0x271185['scheduledat']?_0x271185[_0xd669('0x19')]:moment()[_0xd669('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x271185[_0xd669('0x28')]?_0x271185[_0xd669('0x28')]:0x2,'callback':_0x271185['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x271185[_0xd669('0x29')]?_0x271185[_0xd669('0x29')]:undefined,'callbackat':_0x271185['callbackUniqueid']?moment()[_0xd669('0x1a')](_0xd669('0x1b')):undefined,'CampaignId':_0x13399b['id']})['catch'](_0x245d7b());}}}});})[_0xd669('0x23')](function(){return _0x3d0c09[_0xd669('0x30')]['findAll']({'attributes':['id'],'include':[{'model':_0x3d0c09[_0xd669('0x34')],'as':_0xd669('0x39'),'where':{'id':_0x271185[_0xd669('0x27')]}}]})[_0xd669('0x23')](function(_0x3f01fd){if(_0x3f01fd){var _0x4ac8ae=[];for(var _0x2b3407=0x0,_0x280b2b;_0x2b3407<_0x3f01fd[_0xd669('0x3a')];_0x2b3407+=0x1){_0x280b2b=_0x3f01fd[_0x2b3407]['get']({'plain':!![]});_0x3d0c09[_0xd669('0x3d')]['create']({'phone':_0x271185[_0xd669('0xc')],'ContactId':_0x271185['id'],'ListId':_0x271185[_0xd669('0x27')],'CampaignId':_0x280b2b['id']})[_0xd669('0x2f')](function(_0x109eaa){logger['error'](_0xd669('0x3b'),_0xd669('0x17'),_0x109eaa[_0xd669('0x3e')]);});}}});})[_0xd669('0x23')](function(){_0x4eb628();})[_0xd669('0x2f')](function(_0x533e11){logger[_0xd669('0x15')]('cmContact,\x20%s,\x20%s',_0xd669('0x17'),_0x533e11['message']);_0x4eb628(_0x533e11);});}else{_0x4eb628(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x42db17,_0x1b0231,_0x157f16){var _0x316b3a=_0x469798[_0xd669('0x14')];var _0x42cc74=_0x42db17[_0xd669('0x36')]({'plain':!![]});return _0x316b3a[_0xd669('0x24')][_0xd669('0x32')]({'raw':!![],'where':{'ListId':_0x42cc74['ListId'],'ContactId':_0x42cc74['id']}})[_0xd669('0x23')](function(_0x2226dc){if(!_['isEmpty'](_0x2226dc)){var _0x3ab11a=[];for(var _0x19833e=0x0;_0x19833e<_0x2226dc[_0xd669('0x3a')];_0x19833e+=0x1){var _0x543981=_0x316b3a[_0xd669('0x24')]['destroy']({'where':{'ListId':_0x2226dc[_0x19833e]['ListId'],'ContactId':_0x2226dc[_0x19833e][_0xd669('0x3f')],'VoiceQueueId':_0x2226dc[_0x19833e][_0xd669('0x40')],'CampaignId':_0x2226dc[_0x19833e]['CampaignId']}});_0x3ab11a['push'](_0x543981);}return BPromise[_0xd669('0x41')](_0x3ab11a);}})[_0xd669('0x23')](function(_0x1fb038){logger[_0xd669('0x42')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x1fb038,{'showHidden':![],'depth':null}));_0x157f16();})[_0xd669('0x2f')](function(_0x26830e){logger[_0xd669('0x15')]('[CmContact][afterDestroy][Error]',util[_0xd669('0x18')](_0x26830e,{'showHidden':![],'depth':null}));_0x157f16(_0x26830e);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index f3b9de4..8c3da05 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x2e244f,_0x3ea966){var _0x4dce0f=function(_0x53f6a2){while(--_0x53f6a2){_0x2e244f['push'](_0x2e244f['shift']());}};_0x4dce0f(++_0x3ea966);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 49597d6..27374fa 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 _0x83d3=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x42e013,_0x4e1584){var _0x3e951b=function(_0x5fb964){while(--_0x5fb964){_0x42e013['push'](_0x42e013['shift']());}};_0x3e951b(++_0x4e1584);}(_0x83d3,0x17c));var _0x383d=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x83d3[_0x4d521e];return _0x3beb42;};'use strict';var Sequelize=require(_0x383d('0x0'));module[_0x383d('0x1')]={'CmContactId':{'type':Sequelize[_0x383d('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x383d('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x383d('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x383d('0x4')},'OrderBy':{'type':Sequelize[_0x383d('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x383d('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x90ae=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x1d8fd7,_0xbda2e6){var _0xf30dbc=function(_0x1509a7){while(--_0x1509a7){_0x1d8fd7['push'](_0x1d8fd7['shift']());}};_0xf30dbc(++_0xbda2e6);}(_0x90ae,0x195));var _0xe90a=function(_0x3bf72d,_0x2d6468){_0x3bf72d=_0x3bf72d-0x0;var _0x2950d3=_0x90ae[_0x3bf72d];return _0x2950d3;};'use strict';var Sequelize=require(_0xe90a('0x0'));module[_0xe90a('0x1')]={'CmContactId':{'type':Sequelize[_0xe90a('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xe90a('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xe90a('0x3')],'defaultValue':_0xe90a('0x4')},'OrderBy':{'type':Sequelize[_0xe90a('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xe90a('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 9fe1fe0..3f97a43 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 _0xdc5c=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','CmContactHasItems','error','name','send','index','fieldName','type','key','map','query','keys','filters','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmContactHasItem','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','fields','create','body'];(function(_0x3d9680,_0x16eb93){var _0x39753e=function(_0x10e458){while(--_0x10e458){_0x3d9680['push'](_0x3d9680['shift']());}};_0x39753e(++_0x16eb93);}(_0xdc5c,0x1c0));var _0xcdc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcdc5('0x0'));var rimraf=require(_0xcdc5('0x1'));var zipdir=require(_0xcdc5('0x2'));var jsonpatch=require(_0xcdc5('0x3'));var rp=require('request-promise');var moment=require(_0xcdc5('0x4'));var BPromise=require(_0xcdc5('0x5'));var Mustache=require(_0xcdc5('0x6'));var util=require(_0xcdc5('0x7'));var path=require('path');var sox=require(_0xcdc5('0x8'));var csv=require(_0xcdc5('0x9'));var ejs=require(_0xcdc5('0xa'));var fs=require('fs');var fs_extra=require(_0xcdc5('0xb'));var _=require(_0xcdc5('0xc'));var squel=require(_0xcdc5('0xd'));var crypto=require(_0xcdc5('0xe'));var jsforce=require(_0xcdc5('0xf'));var deskjs=require(_0xcdc5('0x10'));var toCsv=require(_0xcdc5('0x9'));var querystring=require(_0xcdc5('0x11'));var Papa=require(_0xcdc5('0x12'));var Redis=require(_0xcdc5('0x13'));var authService=require(_0xcdc5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcdc5('0x15'));var hardwareService=require(_0xcdc5('0x16'));var logger=require(_0xcdc5('0x17'))(_0xcdc5('0x18'));var utils=require(_0xcdc5('0x19'));var config=require(_0xcdc5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdc5('0x1b'))['db'];function respondWithStatusCode(_0x1ca1c7,_0x2df6bf){_0x2df6bf=_0x2df6bf||0xcc;return function(_0x1f1a14){if(_0x1f1a14){return _0x1ca1c7[_0xcdc5('0x1c')](_0x2df6bf);}return _0x1ca1c7['status'](_0x2df6bf)[_0xcdc5('0x1d')]();};}function respondWithResult(_0x2bb90f,_0x1a3e9f){_0x1a3e9f=_0x1a3e9f||0xc8;return function(_0x86424c){if(_0x86424c){return _0x2bb90f[_0xcdc5('0x1e')](_0x1a3e9f)[_0xcdc5('0x1f')](_0x86424c);}};}function respondWithFilteredResult(_0x251697,_0x2ed03d){return function(_0xbbebf1){if(_0xbbebf1){var _0x361053=typeof _0x2ed03d[_0xcdc5('0x20')]===_0xcdc5('0x21')&&typeof _0x2ed03d[_0xcdc5('0x22')]==='undefined';var _0x36fff7=_0xbbebf1[_0xcdc5('0x23')];var _0x4d6007=_0x361053?0x0:_0x2ed03d[_0xcdc5('0x20')];var _0x27aa02=_0x361053?_0xbbebf1['count']:_0x2ed03d['offset']+_0x2ed03d[_0xcdc5('0x22')];var _0xe9555b;if(_0x27aa02>=_0x36fff7){_0x27aa02=_0x36fff7;_0xe9555b=0xc8;}else{_0xe9555b=0xce;}_0x251697[_0xcdc5('0x1e')](_0xe9555b);return _0x251697[_0xcdc5('0x24')](_0xcdc5('0x25'),_0x4d6007+'-'+_0x27aa02+'/'+_0x36fff7)[_0xcdc5('0x1f')](_0xbbebf1);}return null;};}function patchUpdates(_0x31c555){return function(_0xb1fb23){try{jsonpatch['apply'](_0xb1fb23,_0x31c555,!![]);}catch(_0x53c42f){return BPromise[_0xcdc5('0x26')](_0x53c42f);}return _0xb1fb23[_0xcdc5('0x27')]();};}function saveUpdates(_0x277aba,_0x3ac6fd){return function(_0x534c1a){if(_0x534c1a){return _0x534c1a['update'](_0x277aba)[_0xcdc5('0x28')](function(_0x14dcf0){return _0x14dcf0;});}return null;};}function removeEntity(_0x47e762,_0x2166aa){return function(_0x3a4a1d){if(_0x3a4a1d){return _0x3a4a1d[_0xcdc5('0x29')]()[_0xcdc5('0x28')](function(){var _0x5f55b3=_0x3a4a1d[_0xcdc5('0x2a')]({'plain':!![]});var _0x3eff52=_0xcdc5('0x2b');return db['UserProfileResource'][_0xcdc5('0x29')]({'where':{'type':_0x3eff52,'resourceId':_0x5f55b3['id']}})[_0xcdc5('0x28')](function(){return _0x3a4a1d;});})['then'](function(){_0x47e762[_0xcdc5('0x1e')](0xcc)[_0xcdc5('0x1d')]();});}};}function handleEntityNotFound(_0x563ff8,_0x1b4130){return function(_0x2c786c){if(!_0x2c786c){_0x563ff8[_0xcdc5('0x1c')](0x194);}return _0x2c786c;};}function handleError(_0x389057,_0x45ccdd){_0x45ccdd=_0x45ccdd||0x1f4;return function(_0x5f2490){logger[_0xcdc5('0x2c')](_0x5f2490['stack']);if(_0x5f2490[_0xcdc5('0x2d')]){delete _0x5f2490['name'];}_0x389057['status'](_0x45ccdd)[_0xcdc5('0x2e')](_0x5f2490);};}exports[_0xcdc5('0x2f')]=function(_0x451ff2,_0x4c98aa){var _0x405eae={},_0x267aa8={},_0x344124={'count':0x0,'rows':[]};var _0x4925c8=_['map'](db['CmContactHasItem']['rawAttributes'],function(_0x5c4f87){return{'name':_0x5c4f87[_0xcdc5('0x30')],'type':_0x5c4f87[_0xcdc5('0x31')][_0xcdc5('0x32')]};});_0x267aa8['model']=_[_0xcdc5('0x33')](_0x4925c8,'name');_0x267aa8[_0xcdc5('0x34')]=_[_0xcdc5('0x35')](_0x451ff2['query']);_0x267aa8[_0xcdc5('0x36')]=_['intersection'](_0x267aa8['model'],_0x267aa8[_0xcdc5('0x34')]);_0x405eae['attributes']=_['intersection'](_0x267aa8[_0xcdc5('0x37')],qs['fields'](_0x451ff2[_0xcdc5('0x34')]['fields']));_0x405eae['attributes']=_0x405eae[_0xcdc5('0x38')][_0xcdc5('0x39')]?_0x405eae[_0xcdc5('0x38')]:_0x267aa8[_0xcdc5('0x37')];if(!_0x451ff2['query']['hasOwnProperty'](_0xcdc5('0x3a'))){_0x405eae[_0xcdc5('0x22')]=qs[_0xcdc5('0x22')](_0x451ff2[_0xcdc5('0x34')][_0xcdc5('0x22')]);_0x405eae[_0xcdc5('0x20')]=qs[_0xcdc5('0x20')](_0x451ff2[_0xcdc5('0x34')][_0xcdc5('0x20')]);}_0x405eae[_0xcdc5('0x3b')]=qs[_0xcdc5('0x3c')](_0x451ff2[_0xcdc5('0x34')][_0xcdc5('0x3c')]);_0x405eae[_0xcdc5('0x3d')]=qs[_0xcdc5('0x36')](_[_0xcdc5('0x3e')](_0x451ff2[_0xcdc5('0x34')],_0x267aa8['filters']),_0x4925c8);if(_0x451ff2[_0xcdc5('0x34')][_0xcdc5('0x3f')]){_0x405eae[_0xcdc5('0x3d')]=_[_0xcdc5('0x40')](_0x405eae[_0xcdc5('0x3d')],{'$or':_['map'](_0x4925c8,function(_0x2ab59e){if(_0x2ab59e[_0xcdc5('0x31')]!==_0xcdc5('0x41')){var _0x18feb1={};_0x18feb1[_0x2ab59e[_0xcdc5('0x2d')]]={'$like':'%'+_0x451ff2[_0xcdc5('0x34')][_0xcdc5('0x3f')]+'%'};return _0x18feb1;}})});}_0x405eae=_[_0xcdc5('0x40')]({},_0x405eae,_0x451ff2[_0xcdc5('0x42')]);var _0x5755f4={'where':_0x405eae['where']};return db[_0xcdc5('0x43')][_0xcdc5('0x23')](_0x5755f4)[_0xcdc5('0x28')](function(_0x3b3424){_0x344124[_0xcdc5('0x23')]=_0x3b3424;if(_0x451ff2[_0xcdc5('0x34')][_0xcdc5('0x44')]){_0x405eae[_0xcdc5('0x45')]=[{'all':!![]}];}return db[_0xcdc5('0x43')][_0xcdc5('0x46')](_0x405eae);})['then'](function(_0x2e2860){_0x344124[_0xcdc5('0x47')]=_0x2e2860;return _0x344124;})[_0xcdc5('0x28')](respondWithFilteredResult(_0x4c98aa,_0x405eae))[_0xcdc5('0x48')](handleError(_0x4c98aa,null));};exports[_0xcdc5('0x49')]=function(_0x1b0caf,_0x5d3cc4){var _0x5f408f={'raw':!![],'where':{'id':_0x1b0caf[_0xcdc5('0x4a')]['id']}},_0x2b20e1={};_0x2b20e1['model']=_[_0xcdc5('0x35')](db['CmContactHasItem'][_0xcdc5('0x4b')]);_0x2b20e1['query']=_[_0xcdc5('0x35')](_0x1b0caf[_0xcdc5('0x34')]);_0x2b20e1[_0xcdc5('0x36')]=_[_0xcdc5('0x4c')](_0x2b20e1[_0xcdc5('0x37')],_0x2b20e1[_0xcdc5('0x34')]);_0x5f408f['attributes']=_['intersection'](_0x2b20e1[_0xcdc5('0x37')],qs['fields'](_0x1b0caf[_0xcdc5('0x34')][_0xcdc5('0x4d')]));_0x5f408f[_0xcdc5('0x38')]=_0x5f408f[_0xcdc5('0x38')][_0xcdc5('0x39')]?_0x5f408f[_0xcdc5('0x38')]:_0x2b20e1['model'];if(_0x1b0caf[_0xcdc5('0x34')][_0xcdc5('0x44')]){_0x5f408f[_0xcdc5('0x45')]=[{'all':!![]}];}_0x5f408f=_['merge']({},_0x5f408f,_0x1b0caf['options']);return db['CmContactHasItem']['find'](_0x5f408f)[_0xcdc5('0x28')](handleEntityNotFound(_0x5d3cc4,null))['then'](respondWithResult(_0x5d3cc4,null))[_0xcdc5('0x48')](handleError(_0x5d3cc4,null));};exports[_0xcdc5('0x4e')]=function(_0x181eb0,_0x4d0e54){return db[_0xcdc5('0x43')][_0xcdc5('0x4e')](_0x181eb0[_0xcdc5('0x4f')],{})[_0xcdc5('0x28')](function(_0x19bd2d){var _0x2b78ae=_0x181eb0[_0xcdc5('0x50')][_0xcdc5('0x2a')]({'plain':!![]});if(!_0x2b78ae)throw new Error(_0xcdc5('0x51'));if(_0x2b78ae['role']===_0xcdc5('0x50')){var _0x2f0c52=_0x19bd2d[_0xcdc5('0x2a')]({'plain':!![]});var _0x16ef83='CmContactHasItems';return db[_0xcdc5('0x52')][_0xcdc5('0x53')]({'where':{'name':_0x16ef83,'userProfileId':_0x2b78ae[_0xcdc5('0x54')]},'raw':!![]})[_0xcdc5('0x28')](function(_0x236352){if(_0x236352&&_0x236352['autoAssociation']===0x0){return db[_0xcdc5('0x55')][_0xcdc5('0x4e')]({'name':_0x2f0c52['name'],'resourceId':_0x2f0c52['id'],'type':_0x236352[_0xcdc5('0x2d')],'sectionId':_0x236352['id']},{})[_0xcdc5('0x28')](function(){return _0x19bd2d;});}else{return _0x19bd2d;}})[_0xcdc5('0x48')](function(_0x1cb5bd){logger['error'](_0xcdc5('0x56'),_0x1cb5bd);throw _0x1cb5bd;});}return _0x19bd2d;})['then'](respondWithResult(_0x4d0e54,0xc9))[_0xcdc5('0x48')](handleError(_0x4d0e54,null));};exports[_0xcdc5('0x57')]=function(_0x5d05fa,_0xc144c2){if(_0x5d05fa[_0xcdc5('0x4f')]['id']){delete _0x5d05fa['body']['id'];}return db[_0xcdc5('0x43')][_0xcdc5('0x53')]({'where':{'id':_0x5d05fa[_0xcdc5('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc144c2,null))[_0xcdc5('0x28')](saveUpdates(_0x5d05fa['body'],null))[_0xcdc5('0x28')](respondWithResult(_0xc144c2,null))['catch'](handleError(_0xc144c2,null));};exports[_0xcdc5('0x29')]=function(_0x25634a,_0x3db286){return db[_0xcdc5('0x43')][_0xcdc5('0x53')]({'where':{'id':_0x25634a[_0xcdc5('0x4a')]['id']}})[_0xcdc5('0x28')](handleEntityNotFound(_0x3db286,null))['then'](removeEntity(_0x3db286,null))[_0xcdc5('0x48')](handleError(_0x3db286,null));}; \ No newline at end of file +var _0x194e=['map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','fields','length','model','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','index'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x194e,0x7c));var _0xe194=function(_0xe009b5,_0x45b4b4){_0xe009b5=_0xe009b5-0x0;var _0x4c1d04=_0x194e[_0xe009b5];return _0x4c1d04;};'use strict';var emlformat=require(_0xe194('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe194('0x1'));var jsonpatch=require(_0xe194('0x2'));var rp=require(_0xe194('0x3'));var moment=require('moment');var BPromise=require(_0xe194('0x4'));var Mustache=require(_0xe194('0x5'));var util=require(_0xe194('0x6'));var path=require(_0xe194('0x7'));var sox=require(_0xe194('0x8'));var csv=require(_0xe194('0x9'));var ejs=require(_0xe194('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe194('0xb'));var squel=require(_0xe194('0xc'));var crypto=require('crypto');var jsforce=require(_0xe194('0xd'));var deskjs=require(_0xe194('0xe'));var toCsv=require(_0xe194('0x9'));var querystring=require(_0xe194('0xf'));var Papa=require(_0xe194('0x10'));var Redis=require('ioredis');var authService=require(_0xe194('0x11'));var qs=require(_0xe194('0x12'));var as=require(_0xe194('0x13'));var hardwareService=require(_0xe194('0x14'));var logger=require('../../config/logger')(_0xe194('0x15'));var utils=require(_0xe194('0x16'));var config=require(_0xe194('0x17'));var licenseUtil=require(_0xe194('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f43b2,_0x492861){_0x492861=_0x492861||0xcc;return function(_0x280d1a){if(_0x280d1a){return _0x4f43b2[_0xe194('0x19')](_0x492861);}return _0x4f43b2[_0xe194('0x1a')](_0x492861)['end']();};}function respondWithResult(_0x22611b,_0x2e4403){_0x2e4403=_0x2e4403||0xc8;return function(_0x9159d3){if(_0x9159d3){return _0x22611b[_0xe194('0x1a')](_0x2e4403)[_0xe194('0x1b')](_0x9159d3);}};}function respondWithFilteredResult(_0x56b7e2,_0x35f2a1){return function(_0x47b432){if(_0x47b432){var _0x3ddbd6=typeof _0x35f2a1[_0xe194('0x1c')]==='undefined'&&typeof _0x35f2a1[_0xe194('0x1d')]===_0xe194('0x1e');var _0x54c443=_0x47b432[_0xe194('0x1f')];var _0x2e55f0=_0x3ddbd6?0x0:_0x35f2a1[_0xe194('0x1c')];var _0x4895e5=_0x3ddbd6?_0x47b432[_0xe194('0x1f')]:_0x35f2a1[_0xe194('0x1c')]+_0x35f2a1['limit'];var _0x384b0e;if(_0x4895e5>=_0x54c443){_0x4895e5=_0x54c443;_0x384b0e=0xc8;}else{_0x384b0e=0xce;}_0x56b7e2[_0xe194('0x1a')](_0x384b0e);return _0x56b7e2[_0xe194('0x20')](_0xe194('0x21'),_0x2e55f0+'-'+_0x4895e5+'/'+_0x54c443)[_0xe194('0x1b')](_0x47b432);}return null;};}function patchUpdates(_0x23f4bd){return function(_0x345b17){try{jsonpatch['apply'](_0x345b17,_0x23f4bd,!![]);}catch(_0x3b740b){return BPromise[_0xe194('0x22')](_0x3b740b);}return _0x345b17[_0xe194('0x23')]();};}function saveUpdates(_0xb81222,_0x5a5ee5){return function(_0xec1be3){if(_0xec1be3){return _0xec1be3[_0xe194('0x24')](_0xb81222)[_0xe194('0x25')](function(_0x29923f){return _0x29923f;});}return null;};}function removeEntity(_0x45e61e,_0xdf7161){return function(_0x26858f){if(_0x26858f){return _0x26858f['destroy']()['then'](function(){var _0xfcd2e9=_0x26858f[_0xe194('0x26')]({'plain':!![]});var _0x436c='CmContactHasItems';return db[_0xe194('0x27')][_0xe194('0x28')]({'where':{'type':_0x436c,'resourceId':_0xfcd2e9['id']}})[_0xe194('0x25')](function(){return _0x26858f;});})[_0xe194('0x25')](function(){_0x45e61e[_0xe194('0x1a')](0xcc)[_0xe194('0x29')]();});}};}function handleEntityNotFound(_0x8749,_0x3f8ab9){return function(_0x316ae4){if(!_0x316ae4){_0x8749[_0xe194('0x19')](0x194);}return _0x316ae4;};}function handleError(_0x3635b8,_0x6e5534){_0x6e5534=_0x6e5534||0x1f4;return function(_0x51ff33){logger[_0xe194('0x2a')](_0x51ff33[_0xe194('0x2b')]);if(_0x51ff33[_0xe194('0x2c')]){delete _0x51ff33['name'];}_0x3635b8[_0xe194('0x1a')](_0x6e5534)['send'](_0x51ff33);};}exports[_0xe194('0x2d')]=function(_0x31572e,_0x47a3c7){var _0x228703={},_0x4b310c={},_0x2588f3={'count':0x0,'rows':[]};var _0x34bda2=_[_0xe194('0x2e')](db[_0xe194('0x2f')][_0xe194('0x30')],function(_0x14d913){return{'name':_0x14d913[_0xe194('0x31')],'type':_0x14d913[_0xe194('0x32')][_0xe194('0x33')]};});_0x4b310c['model']=_[_0xe194('0x2e')](_0x34bda2,_0xe194('0x2c'));_0x4b310c[_0xe194('0x34')]=_[_0xe194('0x35')](_0x31572e[_0xe194('0x34')]);_0x4b310c['filters']=_['intersection'](_0x4b310c['model'],_0x4b310c['query']);_0x228703[_0xe194('0x36')]=_[_0xe194('0x37')](_0x4b310c['model'],qs[_0xe194('0x38')](_0x31572e[_0xe194('0x34')][_0xe194('0x38')]));_0x228703[_0xe194('0x36')]=_0x228703[_0xe194('0x36')][_0xe194('0x39')]?_0x228703[_0xe194('0x36')]:_0x4b310c[_0xe194('0x3a')];if(!_0x31572e[_0xe194('0x34')]['hasOwnProperty'](_0xe194('0x3b'))){_0x228703[_0xe194('0x1d')]=qs[_0xe194('0x1d')](_0x31572e['query'][_0xe194('0x1d')]);_0x228703[_0xe194('0x1c')]=qs[_0xe194('0x1c')](_0x31572e[_0xe194('0x34')][_0xe194('0x1c')]);}_0x228703[_0xe194('0x3c')]=qs[_0xe194('0x3d')](_0x31572e[_0xe194('0x34')][_0xe194('0x3d')]);_0x228703[_0xe194('0x3e')]=qs[_0xe194('0x3f')](_[_0xe194('0x40')](_0x31572e[_0xe194('0x34')],_0x4b310c[_0xe194('0x3f')]),_0x34bda2);if(_0x31572e[_0xe194('0x34')][_0xe194('0x41')]){_0x228703[_0xe194('0x3e')]=_[_0xe194('0x42')](_0x228703['where'],{'$or':_[_0xe194('0x2e')](_0x34bda2,function(_0x1993d2){if(_0x1993d2[_0xe194('0x32')]!==_0xe194('0x43')){var _0x370c77={};_0x370c77[_0x1993d2['name']]={'$like':'%'+_0x31572e[_0xe194('0x34')]['filter']+'%'};return _0x370c77;}})});}_0x228703=_[_0xe194('0x42')]({},_0x228703,_0x31572e[_0xe194('0x44')]);var _0x58f317={'where':_0x228703[_0xe194('0x3e')]};return db[_0xe194('0x2f')]['count'](_0x58f317)['then'](function(_0x443b84){_0x2588f3[_0xe194('0x1f')]=_0x443b84;if(_0x31572e[_0xe194('0x34')][_0xe194('0x45')]){_0x228703['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0xe194('0x46')](_0x228703);})[_0xe194('0x25')](function(_0x131472){_0x2588f3[_0xe194('0x47')]=_0x131472;return _0x2588f3;})[_0xe194('0x25')](respondWithFilteredResult(_0x47a3c7,_0x228703))[_0xe194('0x48')](handleError(_0x47a3c7,null));};exports[_0xe194('0x49')]=function(_0x1550fc,_0x5c4093){var _0x30bc17={'raw':!![],'where':{'id':_0x1550fc[_0xe194('0x4a')]['id']}},_0x52d59f={};_0x52d59f[_0xe194('0x3a')]=_[_0xe194('0x35')](db[_0xe194('0x2f')][_0xe194('0x30')]);_0x52d59f['query']=_[_0xe194('0x35')](_0x1550fc[_0xe194('0x34')]);_0x52d59f[_0xe194('0x3f')]=_[_0xe194('0x37')](_0x52d59f[_0xe194('0x3a')],_0x52d59f['query']);_0x30bc17['attributes']=_[_0xe194('0x37')](_0x52d59f[_0xe194('0x3a')],qs['fields'](_0x1550fc['query'][_0xe194('0x38')]));_0x30bc17[_0xe194('0x36')]=_0x30bc17[_0xe194('0x36')][_0xe194('0x39')]?_0x30bc17[_0xe194('0x36')]:_0x52d59f['model'];if(_0x1550fc[_0xe194('0x34')]['includeAll']){_0x30bc17[_0xe194('0x4b')]=[{'all':!![]}];}_0x30bc17=_['merge']({},_0x30bc17,_0x1550fc[_0xe194('0x44')]);return db[_0xe194('0x2f')][_0xe194('0x4c')](_0x30bc17)[_0xe194('0x25')](handleEntityNotFound(_0x5c4093,null))[_0xe194('0x25')](respondWithResult(_0x5c4093,null))[_0xe194('0x48')](handleError(_0x5c4093,null));};exports[_0xe194('0x4d')]=function(_0x38e6d9,_0x1777a9){return db[_0xe194('0x2f')]['create'](_0x38e6d9[_0xe194('0x4e')],{})[_0xe194('0x25')](function(_0x4dd732){var _0x516df6=_0x38e6d9[_0xe194('0x4f')][_0xe194('0x26')]({'plain':!![]});if(!_0x516df6)throw new Error(_0xe194('0x50'));if(_0x516df6['role']===_0xe194('0x4f')){var _0x45981f=_0x4dd732[_0xe194('0x26')]({'plain':!![]});var _0x139dbc=_0xe194('0x51');return db[_0xe194('0x52')][_0xe194('0x4c')]({'where':{'name':_0x139dbc,'userProfileId':_0x516df6['userProfileId']},'raw':!![]})[_0xe194('0x25')](function(_0xef27ed){if(_0xef27ed&&_0xef27ed[_0xe194('0x53')]===0x0){return db[_0xe194('0x27')]['create']({'name':_0x45981f[_0xe194('0x2c')],'resourceId':_0x45981f['id'],'type':_0xef27ed['name'],'sectionId':_0xef27ed['id']},{})[_0xe194('0x25')](function(){return _0x4dd732;});}else{return _0x4dd732;}})[_0xe194('0x48')](function(_0x3c358a){logger[_0xe194('0x2a')](_0xe194('0x54'),_0x3c358a);throw _0x3c358a;});}return _0x4dd732;})[_0xe194('0x25')](respondWithResult(_0x1777a9,0xc9))['catch'](handleError(_0x1777a9,null));};exports['update']=function(_0x51194a,_0x113354){if(_0x51194a[_0xe194('0x4e')]['id']){delete _0x51194a[_0xe194('0x4e')]['id'];}return db[_0xe194('0x2f')][_0xe194('0x4c')]({'where':{'id':_0x51194a[_0xe194('0x4a')]['id']}})['then'](handleEntityNotFound(_0x113354,null))[_0xe194('0x25')](saveUpdates(_0x51194a['body'],null))['then'](respondWithResult(_0x113354,null))[_0xe194('0x48')](handleError(_0x113354,null));};exports[_0xe194('0x28')]=function(_0x26b5be,_0x5d0bcb){return db[_0xe194('0x2f')][_0xe194('0x4c')]({'where':{'id':_0x26b5be[_0xe194('0x4a')]['id']}})[_0xe194('0x25')](handleEntityNotFound(_0x5d0bcb,null))[_0xe194('0x25')](removeEntity(_0x5d0bcb,null))[_0xe194('0x48')](handleError(_0x5d0bcb,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 3428d7f..8fc7042 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 _0x44b2=['cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x44b2,0xb7));var _0x244b=function(_0xc9ce73,_0x551b77){_0xc9ce73=_0xc9ce73-0x0;var _0x28890c=_0x44b2[_0xc9ce73];return _0x28890c;};'use strict';var _=require(_0x244b('0x0'));var util=require(_0x244b('0x1'));var logger=require(_0x244b('0x2'))(_0x244b('0x3'));var moment=require(_0x244b('0x4'));var BPromise=require(_0x244b('0x5'));var rp=require(_0x244b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x244b('0x7'));var config=require(_0x244b('0x8'));var attributes=require(_0x244b('0x9'));module[_0x244b('0xa')]=function(_0x5a86d6,_0x293d52){return _0x5a86d6[_0x244b('0xb')](_0x244b('0xc'),attributes,{'tableName':_0x244b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0000=['api','moment','bluebird','path','rimraf','../../config/environment','exports','CmContactHasItem','cm_contact_has_items','util'];(function(_0x17a852,_0x25e880){var _0x21d525=function(_0x3ba57f){while(--_0x3ba57f){_0x17a852['push'](_0x17a852['shift']());}};_0x21d525(++_0x25e880);}(_0x0000,0x17b));var _0x0000=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0000[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x0000('0x0'));var logger=require('../../config/logger')(_0x0000('0x1'));var moment=require(_0x0000('0x2'));var BPromise=require(_0x0000('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0000('0x4'));var rimraf=require(_0x0000('0x5'));var config=require(_0x0000('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0x0000('0x7')]=function(_0x220eb2,_0x20f572){return _0x220eb2['define'](_0x0000('0x8'),attributes,{'tableName':_0x0000('0x9'),'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 949deaa..879f4ad 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 _0xd94c=['then','info','CmContactHasItem,\x20%s,\x20%s','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x46fb64,_0x191649){var _0x5ee0ad=function(_0x25be78){while(--_0x25be78){_0x46fb64['push'](_0x46fb64['shift']());}};_0x5ee0ad(++_0x191649);}(_0xd94c,0x15a));var _0xcd94=function(_0x589f31,_0xc29bf5){_0x589f31=_0x589f31-0x0;var _0x33d9c3=_0xd94c[_0x589f31];return _0x33d9c3;};'use strict';var _=require('lodash');var util=require(_0xcd94('0x0'));var moment=require('moment');var BPromise=require(_0xcd94('0x1'));var rs=require(_0xcd94('0x2'));var fs=require('fs');var Redis=require(_0xcd94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd94('0x4'));var logger=require(_0xcd94('0x5'))(_0xcd94('0x6'));var config=require(_0xcd94('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd94('0x8')][_0xcd94('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbbe41,_0x517973,_0x54d527){return new BPromise(function(_0xa9138d,_0x14b9cc){return client[_0xcd94('0xa')](_0xbbe41,_0x54d527)[_0xcd94('0xb')](function(_0x42d21f){logger[_0xcd94('0xc')](_0xcd94('0xd'),_0x517973,'request\x20sent');logger['debug'](_0xcd94('0xe'),_0x517973,_0xcd94('0xf'),JSON[_0xcd94('0x10')](_0x42d21f));if(_0x42d21f['error']){if(_0x42d21f[_0xcd94('0x11')][_0xcd94('0x12')]===0x1f4){logger[_0xcd94('0x11')](_0xcd94('0xd'),_0x517973,_0x42d21f[_0xcd94('0x11')][_0xcd94('0x13')]);return _0x14b9cc(_0x42d21f['error'][_0xcd94('0x13')]);}logger[_0xcd94('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x517973,_0x42d21f[_0xcd94('0x11')][_0xcd94('0x13')]);return _0xa9138d(_0x42d21f[_0xcd94('0x11')][_0xcd94('0x13')]);}else{logger[_0xcd94('0xc')](_0xcd94('0xd'),_0x517973,_0xcd94('0xf'));_0xa9138d(_0x42d21f['result'][_0xcd94('0x13')]);}})[_0xcd94('0x14')](function(_0x73f2d5){logger[_0xcd94('0x11')](_0xcd94('0xd'),_0x517973,_0x73f2d5);_0x14b9cc(_0x73f2d5);});});} \ No newline at end of file +var _0x2c3d=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x3dbb16,_0x881a4a){var _0x47afd9=function(_0x1db85e){while(--_0x1db85e){_0x3dbb16['push'](_0x3dbb16['shift']());}};_0x47afd9(++_0x881a4a);}(_0x2c3d,0xdd));var _0xd2c3=function(_0x434c53,_0x5dd162){_0x434c53=_0x434c53-0x0;var _0x4c5fc9=_0x2c3d[_0x434c53];return _0x4c5fc9;};'use strict';var _=require(_0xd2c3('0x0'));var util=require('util');var moment=require(_0xd2c3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2c3('0x2'));var fs=require('fs');var Redis=require(_0xd2c3('0x3'));var db=require(_0xd2c3('0x4'))['db'];var utils=require(_0xd2c3('0x5'));var logger=require(_0xd2c3('0x6'))(_0xd2c3('0x7'));var config=require(_0xd2c3('0x8'));var jayson=require(_0xd2c3('0x9'));var client=jayson[_0xd2c3('0xa')][_0xd2c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6a2e,_0x4c5f69,_0x5c6cc8){return new BPromise(function(_0x3f6b42,_0xc80eee){return client[_0xd2c3('0xc')](_0x1a6a2e,_0x5c6cc8)[_0xd2c3('0xd')](function(_0x149a8b){logger[_0xd2c3('0xe')](_0xd2c3('0xf'),_0x4c5f69,_0xd2c3('0x10'));logger[_0xd2c3('0x11')](_0xd2c3('0x12'),_0x4c5f69,_0xd2c3('0x10'),JSON['stringify'](_0x149a8b));if(_0x149a8b[_0xd2c3('0x13')]){if(_0x149a8b[_0xd2c3('0x13')][_0xd2c3('0x14')]===0x1f4){logger[_0xd2c3('0x13')](_0xd2c3('0xf'),_0x4c5f69,_0x149a8b[_0xd2c3('0x13')][_0xd2c3('0x15')]);return _0xc80eee(_0x149a8b[_0xd2c3('0x13')]['message']);}logger[_0xd2c3('0x13')](_0xd2c3('0xf'),_0x4c5f69,_0x149a8b['error'][_0xd2c3('0x15')]);return _0x3f6b42(_0x149a8b[_0xd2c3('0x13')][_0xd2c3('0x15')]);}else{logger[_0xd2c3('0xe')](_0xd2c3('0xf'),_0x4c5f69,_0xd2c3('0x10'));_0x3f6b42(_0x149a8b[_0xd2c3('0x16')][_0xd2c3('0x15')]);}})[_0xd2c3('0x17')](function(_0x534c52){logger[_0xd2c3('0x13')](_0xd2c3('0xf'),_0x4c5f69,_0x534c52);_0xc80eee(_0x534c52);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 73582c6..3c6c3e9 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 _0xfe29=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','create','delete','destroy','exports','multer'];(function(_0x540c20,_0x196525){var _0x304213=function(_0x172b5e){while(--_0x172b5e){_0x540c20['push'](_0x540c20['shift']());}};_0x304213(++_0x196525);}(_0xfe29,0x1ed));var _0x9fe2=function(_0x145555,_0x12efae){_0x145555=_0x145555-0x0;var _0x2b9e60=_0xfe29[_0x145555];return _0x2b9e60;};'use strict';var multer=require(_0x9fe2('0x0'));var util=require(_0x9fe2('0x1'));var path=require(_0x9fe2('0x2'));var timeout=require(_0x9fe2('0x3'));var express=require(_0x9fe2('0x4'));var router=express[_0x9fe2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9fe2('0x6'));var interaction=require(_0x9fe2('0x7'));var config=require(_0x9fe2('0x8'));var controller=require(_0x9fe2('0x9'));router[_0x9fe2('0xa')]('/',auth['isAuthenticated'](),controller[_0x9fe2('0xb')]);router[_0x9fe2('0xa')](_0x9fe2('0xc'),auth[_0x9fe2('0xd')](),controller[_0x9fe2('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9fe2('0xf')]);router['put'](_0x9fe2('0xc'),auth[_0x9fe2('0xd')](),controller['update']);router[_0x9fe2('0x10')](_0x9fe2('0xc'),auth['isAuthenticated'](),controller[_0x9fe2('0x11')]);module[_0x9fe2('0x12')]=router; \ No newline at end of file +var _0x4281=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','put','delete'];(function(_0x116b20,_0x2c0e55){var _0x143ca2=function(_0x3bd2d4){while(--_0x3bd2d4){_0x116b20['push'](_0x116b20['shift']());}};_0x143ca2(++_0x2c0e55);}(_0x4281,0x1a4));var _0x1428=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x4281[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0x1428('0x0'));var util=require(_0x1428('0x1'));var path=require(_0x1428('0x2'));var timeout=require(_0x1428('0x3'));var express=require(_0x1428('0x4'));var router=express[_0x1428('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1428('0x6'));var interaction=require(_0x1428('0x7'));var config=require('../../config/environment');var controller=require(_0x1428('0x8'));router[_0x1428('0x9')]('/',auth[_0x1428('0xa')](),controller[_0x1428('0xb')]);router[_0x1428('0x9')](_0x1428('0xc'),auth['isAuthenticated'](),controller[_0x1428('0xd')]);router[_0x1428('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1428('0xf')](_0x1428('0xc'),auth[_0x1428('0xa')](),controller['update']);router[_0x1428('0x10')](_0x1428('0xc'),auth[_0x1428('0xa')](),controller[_0x1428('0x11')]);module[_0x1428('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 3277b0e..db9c5ff 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 _0x02a8=['STRING','alias','name','TEXT','long','select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','getDataValue'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x02a8,0x1a4));var _0x802a=function(_0x43894b,_0x39b3c3){_0x43894b=_0x43894b-0x0;var _0x10da5f=_0x02a8[_0x43894b];return _0x10da5f;};'use strict';var Sequelize=require(_0x802a('0x0'));var _=require(_0x802a('0x1'));module[_0x802a('0x2')]={'name':{'type':Sequelize[_0x802a('0x3')],'get':function(_0x3965be){return this[_0x802a('0x4')]('alias');}},'alias':{'type':Sequelize[_0x802a('0x5')],'allowNull':![],'set':function(_0x343da1){this['setDataValue'](_0x802a('0x6'),_0x343da1?_0x343da1:this[_0x802a('0x4')](_0x802a('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x802a('0x8')](_0x802a('0x9')),'get':function(){if(this[_0x802a('0x4')]('type')===_0x802a('0xa')){return JSON[_0x802a('0xb')](this[_0x802a('0x4')](_0x802a('0xc')));}else{return this[_0x802a('0x4')](_0x802a('0xc'));}},'set':function(_0x4921d6){if(Array[_0x802a('0xd')](_0x4921d6)){this[_0x802a('0xe')](_0x802a('0xc'),JSON['stringify'](_0x4921d6));}else{this['setDataValue'](_0x802a('0xc'),_0x4921d6);}}},'required':{'type':Sequelize[_0x802a('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x802a('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x802a('0x10')]('voice')}}; \ No newline at end of file +var _0xf437=['long','type','select','parse','values','BOOLEAN','ENUM','voice','lodash','exports','alias','STRING','setDataValue','getDataValue','TEXT'];(function(_0xf1b134,_0xb399dd){var _0x139dbb=function(_0xe7a88d){while(--_0xe7a88d){_0xf1b134['push'](_0xf1b134['shift']());}};_0x139dbb(++_0xb399dd);}(_0xf437,0x1e8));var _0x7f43=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0xf437[_0x42e25e];return _0x1ed3a6;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7f43('0x0'));module[_0x7f43('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x131bb7){return this['getDataValue'](_0x7f43('0x2'));}},'alias':{'type':Sequelize[_0x7f43('0x3')],'allowNull':![],'set':function(_0x588f6c){this[_0x7f43('0x4')](_0x7f43('0x2'),_0x588f6c?_0x588f6c:this[_0x7f43('0x5')]('name'));}},'type':{'type':Sequelize[_0x7f43('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x7f43('0x6')](_0x7f43('0x7')),'get':function(){if(this[_0x7f43('0x5')](_0x7f43('0x8'))===_0x7f43('0x9')){return JSON[_0x7f43('0xa')](this[_0x7f43('0x5')](_0x7f43('0xb')));}else{return this[_0x7f43('0x5')](_0x7f43('0xb'));}},'set':function(_0x3933b0){if(Array['isArray'](_0x3933b0)){this[_0x7f43('0x4')](_0x7f43('0xb'),JSON['stringify'](_0x3933b0));}else{this[_0x7f43('0x4')](_0x7f43('0xb'),_0x3933b0);}}},'required':{'type':Sequelize[_0x7f43('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7f43('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7f43('0xd')](_0x7f43('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index da1da74..4bd5df8 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 _0xe49f=['create','sequelize','transaction','TEXT','text','number','Sequelize','switch','defaultValue','queryInterface','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','apply','reject','then','destroy','error','stack','name','send','index','map','CmCustomField','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','rawAttributes','length','includeAll','include','find','catch','update','body'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe49f,0xbe));var _0xfe49=function(_0x113195,_0x22905b){_0x113195=_0x113195-0x0;var _0x527728=_0xe49f[_0x113195];return _0x527728;};'use strict';var emlformat=require(_0xfe49('0x0'));var rimraf=require(_0xfe49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe49('0x2'));var rp=require(_0xfe49('0x3'));var moment=require(_0xfe49('0x4'));var BPromise=require(_0xfe49('0x5'));var Mustache=require('mustache');var util=require(_0xfe49('0x6'));var path=require(_0xfe49('0x7'));var sox=require(_0xfe49('0x8'));var csv=require(_0xfe49('0x9'));var ejs=require(_0xfe49('0xa'));var fs=require('fs');var fs_extra=require(_0xfe49('0xb'));var _=require(_0xfe49('0xc'));var squel=require(_0xfe49('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe49('0xe'));var deskjs=require(_0xfe49('0xf'));var toCsv=require(_0xfe49('0x9'));var querystring=require(_0xfe49('0x10'));var Papa=require(_0xfe49('0x11'));var Redis=require(_0xfe49('0x12'));var authService=require(_0xfe49('0x13'));var qs=require(_0xfe49('0x14'));var as=require(_0xfe49('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe49('0x16'))(_0xfe49('0x17'));var utils=require('../../config/utils');var config=require(_0xfe49('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe49('0x19'))['db'];function respondWithStatusCode(_0x39cb26,_0x1cff19){_0x1cff19=_0x1cff19||0xcc;return function(_0xec14f2){if(_0xec14f2){return _0x39cb26[_0xfe49('0x1a')](_0x1cff19);}return _0x39cb26['status'](_0x1cff19)[_0xfe49('0x1b')]();};}function respondWithResult(_0x5d8e86,_0x953a42){_0x953a42=_0x953a42||0xc8;return function(_0x1a1e62){if(_0x1a1e62){return _0x5d8e86['status'](_0x953a42)[_0xfe49('0x1c')](_0x1a1e62);}};}function respondWithFilteredResult(_0x167c2a,_0x5df83b){return function(_0x5d7ed7){if(_0x5d7ed7){var _0x464810=typeof _0x5df83b['offset']==='undefined'&&typeof _0x5df83b['limit']===_0xfe49('0x1d');var _0x45080f=_0x5d7ed7[_0xfe49('0x1e')];var _0x223aa5=_0x464810?0x0:_0x5df83b[_0xfe49('0x1f')];var _0x46aa71=_0x464810?_0x5d7ed7[_0xfe49('0x1e')]:_0x5df83b[_0xfe49('0x1f')]+_0x5df83b[_0xfe49('0x20')];var _0x523fcd;if(_0x46aa71>=_0x45080f){_0x46aa71=_0x45080f;_0x523fcd=0xc8;}else{_0x523fcd=0xce;}_0x167c2a[_0xfe49('0x21')](_0x523fcd);return _0x167c2a[_0xfe49('0x22')]('Content-Range',_0x223aa5+'-'+_0x46aa71+'/'+_0x45080f)['json'](_0x5d7ed7);}return null;};}function patchUpdates(_0x334bda){return function(_0x5057b5){try{jsonpatch[_0xfe49('0x23')](_0x5057b5,_0x334bda,!![]);}catch(_0x1db5ae){return BPromise[_0xfe49('0x24')](_0x1db5ae);}return _0x5057b5['save']();};}function saveUpdates(_0x559b55,_0x38cbff){return function(_0x598f3c){if(_0x598f3c){return _0x598f3c['update'](_0x559b55)[_0xfe49('0x25')](function(_0x34a436){return _0x34a436;});}return null;};}function removeEntity(_0xeddce9,_0x35f3e2){return function(_0x279958){if(_0x279958){return _0x279958[_0xfe49('0x26')]()['then'](function(){_0xeddce9[_0xfe49('0x21')](0xcc)[_0xfe49('0x1b')]();});}};}function handleEntityNotFound(_0x337e35,_0x58b3a8){return function(_0x4ae424){if(!_0x4ae424){_0x337e35[_0xfe49('0x1a')](0x194);}return _0x4ae424;};}function handleError(_0x3198b8,_0x27c82c){_0x27c82c=_0x27c82c||0x1f4;return function(_0xb31d82){logger[_0xfe49('0x27')](_0xb31d82[_0xfe49('0x28')]);if(_0xb31d82[_0xfe49('0x29')]){delete _0xb31d82[_0xfe49('0x29')];}_0x3198b8[_0xfe49('0x21')](_0x27c82c)[_0xfe49('0x2a')](_0xb31d82);};}exports[_0xfe49('0x2b')]=function(_0x1c9b6f,_0x268c39){var _0xa929a7={},_0x1c7543={},_0x4340ef={'count':0x0,'rows':[]};var _0x4da325=_[_0xfe49('0x2c')](db[_0xfe49('0x2d')]['rawAttributes'],function(_0x2ef374){return{'name':_0x2ef374['fieldName'],'type':_0x2ef374[_0xfe49('0x2e')][_0xfe49('0x2f')]};});_0x1c7543[_0xfe49('0x30')]=_[_0xfe49('0x31')](_[_0xfe49('0x2c')](_0x4da325,_0xfe49('0x29')),[_0xfe49('0x29')]);_0x1c7543['query']=_[_0xfe49('0x32')](_0x1c9b6f[_0xfe49('0x33')]);_0x1c7543[_0xfe49('0x34')]=_['intersection'](_0x1c7543['model'],_0x1c7543['query']);_0xa929a7['attributes']=_[_0xfe49('0x35')](_0x1c7543['model'],qs[_0xfe49('0x36')](_0x1c9b6f['query'][_0xfe49('0x36')]));_0xa929a7[_0xfe49('0x37')]=_0xa929a7[_0xfe49('0x37')]['length']?_0xa929a7[_0xfe49('0x37')]:_0x1c7543['model'];if(!_0x1c9b6f['query'][_0xfe49('0x38')](_0xfe49('0x39'))){_0xa929a7[_0xfe49('0x20')]=qs[_0xfe49('0x20')](_0x1c9b6f[_0xfe49('0x33')][_0xfe49('0x20')]);_0xa929a7[_0xfe49('0x1f')]=qs['offset'](_0x1c9b6f['query'][_0xfe49('0x1f')]);}_0xa929a7[_0xfe49('0x3a')]=qs[_0xfe49('0x3b')](_0x1c9b6f['query'][_0xfe49('0x3b')]);_0xa929a7[_0xfe49('0x3c')]=qs[_0xfe49('0x34')](_[_0xfe49('0x3d')](_0x1c9b6f['query'],_0x1c7543['filters']),_0x4da325);if(_0x1c9b6f[_0xfe49('0x33')][_0xfe49('0x3e')]){_0xa929a7[_0xfe49('0x3c')]=_[_0xfe49('0x3f')](_0xa929a7['where'],{'$or':_[_0xfe49('0x2c')](_0x4da325,function(_0x443f0d){if(_0x443f0d[_0xfe49('0x2e')]!==_0xfe49('0x40')){var _0x1fca43={};_0x1fca43[_0x443f0d['name']]={'$like':'%'+_0x1c9b6f[_0xfe49('0x33')][_0xfe49('0x3e')]+'%'};return _0x1fca43;}})});}_0xa929a7=_[_0xfe49('0x3f')]({},_0xa929a7,_0x1c9b6f[_0xfe49('0x41')]);var _0x4ca529={'where':_0xa929a7[_0xfe49('0x3c')]};return db[_0xfe49('0x2d')]['count'](_0x4ca529)[_0xfe49('0x25')](function(_0x427bee){_0x4340ef[_0xfe49('0x1e')]=_0x427bee;if(_0x1c9b6f[_0xfe49('0x33')]['includeAll']){_0xa929a7['include']=[{'all':!![]}];}return db[_0xfe49('0x2d')][_0xfe49('0x42')](_0xa929a7);})['then'](function(_0xc3fd43){_0x4340ef['rows']=_0xc3fd43;return _0x4340ef;})[_0xfe49('0x25')](respondWithFilteredResult(_0x268c39,_0xa929a7))['catch'](handleError(_0x268c39,null));};exports[_0xfe49('0x43')]=function(_0x43d77d,_0x55d3c8){var _0x5a87bd={'raw':!![],'where':{'id':_0x43d77d[_0xfe49('0x44')]['id']}},_0x286575={};_0x286575[_0xfe49('0x30')]=_['keys'](db[_0xfe49('0x2d')][_0xfe49('0x45')]);_0x286575[_0xfe49('0x33')]=_[_0xfe49('0x32')](_0x43d77d[_0xfe49('0x33')]);_0x286575['filters']=_[_0xfe49('0x35')](_0x286575[_0xfe49('0x30')],_0x286575[_0xfe49('0x33')]);_0x5a87bd[_0xfe49('0x37')]=_[_0xfe49('0x35')](_0x286575[_0xfe49('0x30')],qs[_0xfe49('0x36')](_0x43d77d[_0xfe49('0x33')][_0xfe49('0x36')]));_0x5a87bd[_0xfe49('0x37')]=_0x5a87bd[_0xfe49('0x37')][_0xfe49('0x46')]?_0x5a87bd['attributes']:_0x286575['model'];if(_0x43d77d[_0xfe49('0x33')][_0xfe49('0x47')]){_0x5a87bd[_0xfe49('0x48')]=[{'all':!![]}];}_0x5a87bd=_['merge']({},_0x5a87bd,_0x43d77d[_0xfe49('0x41')]);return db[_0xfe49('0x2d')][_0xfe49('0x49')](_0x5a87bd)[_0xfe49('0x25')](handleEntityNotFound(_0x55d3c8,null))[_0xfe49('0x25')](respondWithResult(_0x55d3c8,null))[_0xfe49('0x4a')](handleError(_0x55d3c8,null));};exports[_0xfe49('0x4b')]=function(_0x1850ef,_0x439259){if(_0x1850ef[_0xfe49('0x4c')]['id']){delete _0x1850ef[_0xfe49('0x4c')]['id'];}return db[_0xfe49('0x2d')]['find']({'where':{'id':_0x1850ef[_0xfe49('0x44')]['id']}})[_0xfe49('0x25')](handleEntityNotFound(_0x439259,null))[_0xfe49('0x25')](saveUpdates(_0x1850ef['body'],null))['then'](respondWithResult(_0x439259,null))[_0xfe49('0x4a')](handleError(_0x439259,null));};exports[_0xfe49('0x26')]=function(_0x60b12c,_0x3bdbef){return db[_0xfe49('0x2d')][_0xfe49('0x49')]({'where':{'id':_0x60b12c[_0xfe49('0x44')]['id']}})['then'](handleEntityNotFound(_0x3bdbef,null))[_0xfe49('0x25')](removeEntity(_0x3bdbef,null))[_0xfe49('0x4a')](handleError(_0x3bdbef,null));};exports[_0xfe49('0x4d')]=function(_0x2f55a5,_0x2a5464){var _0x2dc3a8;return db[_0xfe49('0x4e')][_0xfe49('0x4f')](function(_0x3ebe24){return db['CmCustomField'][_0xfe49('0x4d')](_0x2f55a5[_0xfe49('0x4c')],{'transaction':_0x3ebe24})[_0xfe49('0x25')](function(_0x3ffcac){_0x2dc3a8=_0x3ffcac;var _0x1418eb={'type':db['Sequelize'][_0xfe49('0x50')],'transaction':_0x3ebe24};switch(_0x2f55a5[_0xfe49('0x4c')][_0xfe49('0x2e')]){case _0xfe49('0x51'):_0x1418eb[_0xfe49('0x2e')]=db['Sequelize'][_0xfe49('0x50')];break;case _0xfe49('0x52'):_0x1418eb[_0xfe49('0x2e')]=db[_0xfe49('0x53')]['INTEGER'];break;case _0xfe49('0x54'):_0x1418eb[_0xfe49('0x2e')]=db[_0xfe49('0x53')]['BOOLEAN'];_0x1418eb[_0xfe49('0x55')]=![];break;default:}return db[_0xfe49('0x4e')][_0xfe49('0x56')]['addColumn'](_0xfe49('0x57'),util['format'](_0xfe49('0x58'),_0x2dc3a8['id']),_0x1418eb);})[_0xfe49('0x25')](function(){return _0x2dc3a8;});})[_0xfe49('0x25')](respondWithResult(_0x2a5464,0xc9))['catch'](handleError(_0x2a5464,null));}; \ No newline at end of file +var _0x21c0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','then','include','findAll','rows','show','params','keys','includeAll','options','find','catch','body','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','defaultValue','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x491082,_0x28f78b){var _0x5797d9=function(_0x20d0ba){while(--_0x20d0ba){_0x491082['push'](_0x491082['shift']());}};_0x5797d9(++_0x28f78b);}(_0x21c0,0x1a8));var _0x021c=function(_0x360ce8,_0x2be87b){_0x360ce8=_0x360ce8-0x0;var _0x5a6cd4=_0x21c0[_0x360ce8];return _0x5a6cd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x021c('0x0'));var zipdir=require(_0x021c('0x1'));var jsonpatch=require(_0x021c('0x2'));var rp=require(_0x021c('0x3'));var moment=require('moment');var BPromise=require(_0x021c('0x4'));var Mustache=require(_0x021c('0x5'));var util=require('util');var path=require(_0x021c('0x6'));var sox=require(_0x021c('0x7'));var csv=require(_0x021c('0x8'));var ejs=require(_0x021c('0x9'));var fs=require('fs');var fs_extra=require(_0x021c('0xa'));var _=require(_0x021c('0xb'));var squel=require(_0x021c('0xc'));var crypto=require('crypto');var jsforce=require(_0x021c('0xd'));var deskjs=require(_0x021c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x021c('0xf'));var Redis=require(_0x021c('0x10'));var authService=require(_0x021c('0x11'));var qs=require(_0x021c('0x12'));var as=require(_0x021c('0x13'));var hardwareService=require(_0x021c('0x14'));var logger=require(_0x021c('0x15'))('api');var utils=require(_0x021c('0x16'));var config=require(_0x021c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x021c('0x18'))['db'];function respondWithStatusCode(_0xf36938,_0x1b839c){_0x1b839c=_0x1b839c||0xcc;return function(_0x5f4e95){if(_0x5f4e95){return _0xf36938[_0x021c('0x19')](_0x1b839c);}return _0xf36938[_0x021c('0x1a')](_0x1b839c)[_0x021c('0x1b')]();};}function respondWithResult(_0x546640,_0x51189a){_0x51189a=_0x51189a||0xc8;return function(_0x538cde){if(_0x538cde){return _0x546640[_0x021c('0x1a')](_0x51189a)[_0x021c('0x1c')](_0x538cde);}};}function respondWithFilteredResult(_0x51eae3,_0x6fd198){return function(_0x34016d){if(_0x34016d){var _0x2b292f=typeof _0x6fd198[_0x021c('0x1d')]===_0x021c('0x1e')&&typeof _0x6fd198[_0x021c('0x1f')]==='undefined';var _0x3ec056=_0x34016d['count'];var _0x5880fe=_0x2b292f?0x0:_0x6fd198[_0x021c('0x1d')];var _0x307d5b=_0x2b292f?_0x34016d[_0x021c('0x20')]:_0x6fd198[_0x021c('0x1d')]+_0x6fd198['limit'];var _0x41e659;if(_0x307d5b>=_0x3ec056){_0x307d5b=_0x3ec056;_0x41e659=0xc8;}else{_0x41e659=0xce;}_0x51eae3['status'](_0x41e659);return _0x51eae3[_0x021c('0x21')](_0x021c('0x22'),_0x5880fe+'-'+_0x307d5b+'/'+_0x3ec056)[_0x021c('0x1c')](_0x34016d);}return null;};}function patchUpdates(_0x5ca29a){return function(_0x206149){try{jsonpatch[_0x021c('0x23')](_0x206149,_0x5ca29a,!![]);}catch(_0x293645){return BPromise[_0x021c('0x24')](_0x293645);}return _0x206149['save']();};}function saveUpdates(_0x35c2a3,_0xc60219){return function(_0x44f5f7){if(_0x44f5f7){return _0x44f5f7[_0x021c('0x25')](_0x35c2a3)['then'](function(_0x274b6d){return _0x274b6d;});}return null;};}function removeEntity(_0x3afe90,_0x218527){return function(_0xf25a86){if(_0xf25a86){return _0xf25a86[_0x021c('0x26')]()['then'](function(){_0x3afe90[_0x021c('0x1a')](0xcc)[_0x021c('0x1b')]();});}};}function handleEntityNotFound(_0x249567,_0x402f10){return function(_0xaf19dd){if(!_0xaf19dd){_0x249567[_0x021c('0x19')](0x194);}return _0xaf19dd;};}function handleError(_0xab7a87,_0x5031c5){_0x5031c5=_0x5031c5||0x1f4;return function(_0x4a2dbd){logger[_0x021c('0x27')](_0x4a2dbd['stack']);if(_0x4a2dbd[_0x021c('0x28')]){delete _0x4a2dbd[_0x021c('0x28')];}_0xab7a87[_0x021c('0x1a')](_0x5031c5)[_0x021c('0x29')](_0x4a2dbd);};}exports[_0x021c('0x2a')]=function(_0x5c39ad,_0x1487e1){var _0x20a3be={},_0x439430={},_0x53d36d={'count':0x0,'rows':[]};var _0x4f7187=_[_0x021c('0x2b')](db[_0x021c('0x2c')][_0x021c('0x2d')],function(_0x2679a1){return{'name':_0x2679a1[_0x021c('0x2e')],'type':_0x2679a1['type'][_0x021c('0x2f')]};});_0x439430[_0x021c('0x30')]=_['differenceBy'](_[_0x021c('0x2b')](_0x4f7187,'name'),['name']);_0x439430[_0x021c('0x31')]=_['keys'](_0x5c39ad[_0x021c('0x31')]);_0x439430[_0x021c('0x32')]=_[_0x021c('0x33')](_0x439430[_0x021c('0x30')],_0x439430[_0x021c('0x31')]);_0x20a3be[_0x021c('0x34')]=_[_0x021c('0x33')](_0x439430[_0x021c('0x30')],qs[_0x021c('0x35')](_0x5c39ad[_0x021c('0x31')][_0x021c('0x35')]));_0x20a3be[_0x021c('0x34')]=_0x20a3be[_0x021c('0x34')][_0x021c('0x36')]?_0x20a3be[_0x021c('0x34')]:_0x439430[_0x021c('0x30')];if(!_0x5c39ad[_0x021c('0x31')][_0x021c('0x37')](_0x021c('0x38'))){_0x20a3be[_0x021c('0x1f')]=qs['limit'](_0x5c39ad[_0x021c('0x31')][_0x021c('0x1f')]);_0x20a3be[_0x021c('0x1d')]=qs['offset'](_0x5c39ad['query'][_0x021c('0x1d')]);}_0x20a3be[_0x021c('0x39')]=qs['sort'](_0x5c39ad[_0x021c('0x31')][_0x021c('0x3a')]);_0x20a3be['where']=qs[_0x021c('0x32')](_[_0x021c('0x3b')](_0x5c39ad[_0x021c('0x31')],_0x439430['filters']),_0x4f7187);if(_0x5c39ad[_0x021c('0x31')][_0x021c('0x3c')]){_0x20a3be[_0x021c('0x3d')]=_[_0x021c('0x3e')](_0x20a3be[_0x021c('0x3d')],{'$or':_[_0x021c('0x2b')](_0x4f7187,function(_0x5f13f7){if(_0x5f13f7[_0x021c('0x3f')]!==_0x021c('0x40')){var _0xfdd77b={};_0xfdd77b[_0x5f13f7['name']]={'$like':'%'+_0x5c39ad[_0x021c('0x31')]['filter']+'%'};return _0xfdd77b;}})});}_0x20a3be=_[_0x021c('0x3e')]({},_0x20a3be,_0x5c39ad['options']);var _0x35cbf3={'where':_0x20a3be[_0x021c('0x3d')]};return db['CmCustomField']['count'](_0x35cbf3)[_0x021c('0x41')](function(_0x52e689){_0x53d36d[_0x021c('0x20')]=_0x52e689;if(_0x5c39ad[_0x021c('0x31')]['includeAll']){_0x20a3be[_0x021c('0x42')]=[{'all':!![]}];}return db[_0x021c('0x2c')][_0x021c('0x43')](_0x20a3be);})[_0x021c('0x41')](function(_0x290190){_0x53d36d[_0x021c('0x44')]=_0x290190;return _0x53d36d;})[_0x021c('0x41')](respondWithFilteredResult(_0x1487e1,_0x20a3be))['catch'](handleError(_0x1487e1,null));};exports[_0x021c('0x45')]=function(_0x4bde17,_0x172d9c){var _0x2c93de={'raw':!![],'where':{'id':_0x4bde17[_0x021c('0x46')]['id']}},_0x3ec243={};_0x3ec243['model']=_[_0x021c('0x47')](db['CmCustomField'][_0x021c('0x2d')]);_0x3ec243[_0x021c('0x31')]=_['keys'](_0x4bde17[_0x021c('0x31')]);_0x3ec243[_0x021c('0x32')]=_[_0x021c('0x33')](_0x3ec243['model'],_0x3ec243[_0x021c('0x31')]);_0x2c93de[_0x021c('0x34')]=_[_0x021c('0x33')](_0x3ec243[_0x021c('0x30')],qs[_0x021c('0x35')](_0x4bde17[_0x021c('0x31')]['fields']));_0x2c93de['attributes']=_0x2c93de[_0x021c('0x34')][_0x021c('0x36')]?_0x2c93de[_0x021c('0x34')]:_0x3ec243['model'];if(_0x4bde17[_0x021c('0x31')][_0x021c('0x48')]){_0x2c93de['include']=[{'all':!![]}];}_0x2c93de=_['merge']({},_0x2c93de,_0x4bde17[_0x021c('0x49')]);return db[_0x021c('0x2c')][_0x021c('0x4a')](_0x2c93de)[_0x021c('0x41')](handleEntityNotFound(_0x172d9c,null))[_0x021c('0x41')](respondWithResult(_0x172d9c,null))[_0x021c('0x4b')](handleError(_0x172d9c,null));};exports[_0x021c('0x25')]=function(_0x114b79,_0x22abb4){if(_0x114b79[_0x021c('0x4c')]['id']){delete _0x114b79[_0x021c('0x4c')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x114b79['params']['id']}})[_0x021c('0x41')](handleEntityNotFound(_0x22abb4,null))[_0x021c('0x41')](saveUpdates(_0x114b79[_0x021c('0x4c')],null))['then'](respondWithResult(_0x22abb4,null))[_0x021c('0x4b')](handleError(_0x22abb4,null));};exports[_0x021c('0x26')]=function(_0x24a001,_0x30e134){return db['CmCustomField'][_0x021c('0x4a')]({'where':{'id':_0x24a001['params']['id']}})[_0x021c('0x41')](handleEntityNotFound(_0x30e134,null))[_0x021c('0x41')](removeEntity(_0x30e134,null))['catch'](handleError(_0x30e134,null));};exports[_0x021c('0x4d')]=function(_0x57855c,_0x31b146){var _0x3c2a0c;return db[_0x021c('0x4e')][_0x021c('0x4f')](function(_0x339708){return db[_0x021c('0x2c')][_0x021c('0x4d')](_0x57855c[_0x021c('0x4c')],{'transaction':_0x339708})[_0x021c('0x41')](function(_0x411eaa){_0x3c2a0c=_0x411eaa;var _0x62cc0={'type':db[_0x021c('0x50')]['TEXT'],'transaction':_0x339708};switch(_0x57855c[_0x021c('0x4c')][_0x021c('0x3f')]){case _0x021c('0x51'):_0x62cc0['type']=db[_0x021c('0x50')][_0x021c('0x52')];break;case'number':_0x62cc0[_0x021c('0x3f')]=db[_0x021c('0x50')][_0x021c('0x53')];break;case _0x021c('0x54'):_0x62cc0['type']=db[_0x021c('0x50')]['BOOLEAN'];_0x62cc0[_0x021c('0x55')]=![];break;default:}return db[_0x021c('0x4e')]['queryInterface']['addColumn']('cm_contacts',util[_0x021c('0x56')](_0x021c('0x57'),_0x3c2a0c['id']),_0x62cc0);})[_0x021c('0x41')](function(){return _0x3c2a0c;});})[_0x021c('0x41')](respondWithResult(_0x31b146,0xc9))[_0x021c('0x4b')](handleError(_0x31b146,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 614ea73..c2bfcc0 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 _0x1b57=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b57,0x14a));var _0x71b5=function(_0x2c81c9,_0x568fe8){_0x2c81c9=_0x2c81c9-0x0;var _0x5c9c64=_0x1b57[_0x2c81c9];return _0x5c9c64;};'use strict';var _=require(_0x71b5('0x0'));var util=require(_0x71b5('0x1'));var logger=require(_0x71b5('0x2'))(_0x71b5('0x3'));var moment=require(_0x71b5('0x4'));var BPromise=require(_0x71b5('0x5'));var rp=require(_0x71b5('0x6'));var fs=require('fs');var path=require(_0x71b5('0x7'));var rimraf=require(_0x71b5('0x8'));var config=require(_0x71b5('0x9'));var attributes=require(_0x71b5('0xa'));module[_0x71b5('0xb')]=function(_0x4aa1b8,_0x347541){return _0x4aa1b8[_0x71b5('0xc')]('CmCustomField',attributes,{'tableName':_0x71b5('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4f3=['moment','path','rimraf','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x4c3025,_0x556f28){var _0x31fb41=function(_0x585620){while(--_0x585620){_0x4c3025['push'](_0x4c3025['shift']());}};_0x31fb41(++_0x556f28);}(_0xa4f3,0xc4));var _0x3a4f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa4f3[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x3a4f('0x0'));var util=require(_0x3a4f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3a4f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a4f('0x3'));var rimraf=require(_0x3a4f('0x4'));var config=require('../../config/environment');var attributes=require(_0x3a4f('0x5'));module[_0x3a4f('0x6')]=function(_0x44f53a,_0x51c57c){return _0x44f53a['define'](_0x3a4f('0x7'),attributes,{'tableName':_0x3a4f('0x8'),'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 ea35dc7..3dc8c0d 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 _0xf8fa=['../../config/environment','client','request','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x550ae0,_0x394e05){var _0x1271d1=function(_0x2a267e){while(--_0x2a267e){_0x550ae0['push'](_0x550ae0['shift']());}};_0x1271d1(++_0x394e05);}(_0xf8fa,0x176));var _0xaf8f=function(_0x28053c,_0x30d230){_0x28053c=_0x28053c-0x0;var _0x34dfef=_0xf8fa[_0x28053c];return _0x34dfef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaf8f('0x0'));var BPromise=require(_0xaf8f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf8f('0x2'));var db=require(_0xaf8f('0x3'))['db'];var utils=require(_0xaf8f('0x4'));var logger=require(_0xaf8f('0x5'))('rpc');var config=require(_0xaf8f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaf8f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254238,_0x599b64,_0x4709f1){return new BPromise(function(_0x296884,_0x67d7e){return client[_0xaf8f('0x8')](_0x254238,_0x4709f1)['then'](function(_0x523923){logger['info'](_0xaf8f('0x9'),_0x599b64,'request\x20sent');logger[_0xaf8f('0xa')](_0xaf8f('0xb'),_0x599b64,'request\x20sent',JSON[_0xaf8f('0xc')](_0x523923));if(_0x523923['error']){if(_0x523923[_0xaf8f('0xd')][_0xaf8f('0xe')]===0x1f4){logger[_0xaf8f('0xd')](_0xaf8f('0x9'),_0x599b64,_0x523923[_0xaf8f('0xd')]['message']);return _0x67d7e(_0x523923[_0xaf8f('0xd')][_0xaf8f('0xf')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x599b64,_0x523923[_0xaf8f('0xd')][_0xaf8f('0xf')]);return _0x296884(_0x523923[_0xaf8f('0xd')][_0xaf8f('0xf')]);}else{logger[_0xaf8f('0x10')](_0xaf8f('0x9'),_0x599b64,_0xaf8f('0x11'));_0x296884(_0x523923[_0xaf8f('0x12')][_0xaf8f('0xf')]);}})[_0xaf8f('0x13')](function(_0x426263){logger[_0xaf8f('0xd')]('CmCustomField,\x20%s,\x20%s',_0x599b64,_0x426263);_0x67d7e(_0x426263);});});} \ No newline at end of file +var _0x0570=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result'];(function(_0x56ebd0,_0x41689d){var _0x147469=function(_0x26162c){while(--_0x26162c){_0x56ebd0['push'](_0x56ebd0['shift']());}};_0x147469(++_0x41689d);}(_0x0570,0x115));var _0x0057=function(_0xa4dbe9,_0x514594){_0xa4dbe9=_0xa4dbe9-0x0;var _0x340919=_0x0570[_0xa4dbe9];return _0x340919;};'use strict';var _=require(_0x0057('0x0'));var util=require(_0x0057('0x1'));var moment=require(_0x0057('0x2'));var BPromise=require('bluebird');var rs=require(_0x0057('0x3'));var fs=require('fs');var Redis=require(_0x0057('0x4'));var db=require(_0x0057('0x5'))['db'];var utils=require(_0x0057('0x6'));var logger=require('../../config/logger')(_0x0057('0x7'));var config=require('../../config/environment');var jayson=require(_0x0057('0x8'));var client=jayson[_0x0057('0x9')][_0x0057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45da9d,_0x254fb2,_0x32929d){return new BPromise(function(_0x540350,_0x30beb4){return client[_0x0057('0xb')](_0x45da9d,_0x32929d)['then'](function(_0x327450){logger[_0x0057('0xc')]('CmCustomField,\x20%s,\x20%s',_0x254fb2,_0x0057('0xd'));logger[_0x0057('0xe')](_0x0057('0xf'),_0x254fb2,_0x0057('0xd'),JSON[_0x0057('0x10')](_0x327450));if(_0x327450[_0x0057('0x11')]){if(_0x327450['error'][_0x0057('0x12')]===0x1f4){logger['error'](_0x0057('0x13'),_0x254fb2,_0x327450[_0x0057('0x11')]['message']);return _0x30beb4(_0x327450[_0x0057('0x11')]['message']);}logger['error'](_0x0057('0x13'),_0x254fb2,_0x327450[_0x0057('0x11')][_0x0057('0x14')]);return _0x540350(_0x327450[_0x0057('0x11')]['message']);}else{logger[_0x0057('0xc')](_0x0057('0x13'),_0x254fb2,_0x0057('0xd'));_0x540350(_0x327450[_0x0057('0x15')][_0x0057('0x14')]);}})[_0x0057('0x16')](function(_0x1c791c){logger[_0x0057('0x11')]('CmCustomField,\x20%s,\x20%s',_0x254fb2,_0x1c791c);_0x30beb4(_0x1c791c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 97fc64b..ba86328 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 _0x18c9=['/:id','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x18c9,0x1bf));var _0x918c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x18c9[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x918c('0x0'));var util=require(_0x918c('0x1'));var path=require(_0x918c('0x2'));var timeout=require(_0x918c('0x3'));var express=require(_0x918c('0x4'));var router=express[_0x918c('0x5')]();var fs_extra=require(_0x918c('0x6'));var auth=require(_0x918c('0x7'));var interaction=require(_0x918c('0x8'));var config=require(_0x918c('0x9'));var controller=require(_0x918c('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x918c('0xb')]);router[_0x918c('0xc')](_0x918c('0xd'),auth[_0x918c('0xe')](),controller['show']);router['post']('/',auth[_0x918c('0xe')](),controller[_0x918c('0xf')]);router[_0x918c('0x10')](_0x918c('0xd'),auth[_0x918c('0xe')](),controller[_0x918c('0x11')]);router[_0x918c('0x12')]('/:id',auth[_0x918c('0xe')](),controller[_0x918c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xaf1b=['isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x5e8398,_0x1b4120){var _0x192dc6=function(_0x346f6d){while(--_0x346f6d){_0x5e8398['push'](_0x5e8398['shift']());}};_0x192dc6(++_0x1b4120);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x17fe67,_0x4b169c){_0x17fe67=_0x17fe67-0x0;var _0x4aab6a=_0xaf1b[_0x17fe67];return _0x4aab6a;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['post']('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x10')]);router[_0xbaf1('0x11')]('/:id',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x12')]);router['delete'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0x13')]);module[_0xbaf1('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 6f809fa..099d235 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 _0xb637=['exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize'];(function(_0xed0e8d,_0x1ac7b7){var _0x1c3bf7=function(_0xe9976e){while(--_0xe9976e){_0xed0e8d['push'](_0xed0e8d['shift']());}};_0x1c3bf7(++_0x1ac7b7);}(_0xb637,0x10d));var _0x7b63=function(_0xed118a,_0xcdc4b6){_0xed118a=_0xed118a-0x0;var _0xa7c266=_0xb637[_0xed118a];return _0xa7c266;};'use strict';var moment=require('moment');var Sequelize=require(_0x7b63('0x0'));module[_0x7b63('0x1')]={'phone':{'type':Sequelize[_0x7b63('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x7b63('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7b63('0x4')],'defaultValue':moment()['format'](_0x7b63('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7b63('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7b63('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7b63('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7b63('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x7b63('0x6')](0x2)[_0x7b63('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7b63('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7b63('0x6')],'unique':_0x7b63('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7b63('0x8')},'UserId':{'type':Sequelize[_0x7b63('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x7b63('0x6')],'unique':_0x7b63('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x7b63('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7b63('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7b63('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7b63('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7b63('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x7b63('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa343=['contactListQueue','moment','sequelize','STRING','DATE','format','INTEGER','BOOLEAN'];(function(_0x551b1c,_0x3584f9){var _0x131273=function(_0x553185){while(--_0x553185){_0x551b1c['push'](_0x551b1c['shift']());}};_0x131273(++_0x3584f9);}(_0xa343,0x79));var _0x3a34=function(_0x39753c,_0x2824ad){_0x39753c=_0x39753c-0x0;var _0x194f8d=_0xa343[_0x39753c];return _0x194f8d;};'use strict';var moment=require(_0x3a34('0x0'));var Sequelize=require(_0x3a34('0x1'));module['exports']={'phone':{'type':Sequelize[_0x3a34('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3a34('0x3')],'defaultValue':moment()[_0x3a34('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3a34('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3a34('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3a34('0x3')]},'priority':{'type':Sequelize[_0x3a34('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3a34('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3a34('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3a34('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x3a34('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3a34('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3a34('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3a34('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3a34('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3a34('0x3')],'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 f984608..fd877ea 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 _0x2caf=['$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','show','params','find','create','body','describe','destroy','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','CmContact','getVoiceQueues','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','VoiceQueue','Queue','dialActive','update','getPreviewRecall','Company','getOpenContacts','outbound','isNumber','entity\x20not\x20found','timezones','push','utcOffset','getTimezone','../../config/logger','../../config/environment','../../mysqldb','status','json','limit','undefined','count','offset','Content-Range','sendStatus','error','name','index','map','CmHopper','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','concat','$and','$or','$gt'];(function(_0x93b675,_0x9f4d81){var _0x53d795=function(_0x2e1337){while(--_0x2e1337){_0x93b675['push'](_0x93b675['shift']());}};_0x53d795(++_0x9f4d81);}(_0x2caf,0x6a));var _0xf2ca=function(_0x22d53f,_0x15720d){_0x22d53f=_0x22d53f-0x0;var _0x3fa7a0=_0x2caf[_0x22d53f];return _0x3fa7a0;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xf2ca('0x0'))('api');var shared=require(_0xf2ca('0x1'));var db=require(_0xf2ca('0x2'))['db'];function respondWithResult(_0x43b96c,_0x375e8b){_0x375e8b=_0x375e8b||0xc8;return function(_0x137501){if(_0x137501){return _0x43b96c[_0xf2ca('0x3')](_0x375e8b)[_0xf2ca('0x4')](_0x137501);}};}function respondWithFilteredResult(_0x51372a,_0x8ce770){return function(_0x4292b4){if(_0x4292b4){var _0x16cabd=typeof _0x8ce770['offset']==='undefined'&&typeof _0x8ce770[_0xf2ca('0x5')]===_0xf2ca('0x6');var _0x1177f0=_0x4292b4[_0xf2ca('0x7')];var _0x1c1afd=_0x16cabd?0x0:_0x8ce770['offset'];var _0x1ecd50=_0x16cabd?_0x4292b4[_0xf2ca('0x7')]:_0x8ce770[_0xf2ca('0x8')]+_0x8ce770[_0xf2ca('0x5')];var _0x1ff621;if(_0x1ecd50>=_0x1177f0){_0x1ecd50=_0x1177f0;_0x1ff621=0xc8;}else{_0x1ff621=0xce;}_0x51372a[_0xf2ca('0x3')](_0x1ff621);return _0x51372a['set'](_0xf2ca('0x9'),_0x1c1afd+'-'+_0x1ecd50+'/'+_0x1177f0)[_0xf2ca('0x4')](_0x4292b4);}return null;};}function saveUpdates(_0x54a3cb,_0x88529f){return function(_0x383112){if(_0x383112){return _0x383112['update'](_0x54a3cb)['then'](function(_0xa4e5b1){return _0xa4e5b1;});}return null;};}function handleEntityNotFound(_0x52a278,_0x284484){return function(_0x3123fe){if(!_0x3123fe){_0x52a278[_0xf2ca('0xa')](0x194);}return _0x3123fe;};}function handleError(_0x1e9227,_0x410997){_0x410997=_0x410997||0x1f4;return function(_0x2057a2){logger[_0xf2ca('0xb')](_0x2057a2['stack']);if(_0x2057a2[_0xf2ca('0xc')]){delete _0x2057a2['name'];}_0x1e9227[_0xf2ca('0x3')](_0x410997)['send'](_0x2057a2);};}exports[_0xf2ca('0xd')]=function(_0x6a2b25,_0x59ea3c){var _0x3c0055={},_0x160230={},_0x1b3a36={'count':0x0,'rows':[]};var _0x310504=_[_0xf2ca('0xe')](db[_0xf2ca('0xf')][_0xf2ca('0x10')],function(_0x1548a4){return{'name':_0x1548a4[_0xf2ca('0x11')],'type':_0x1548a4[_0xf2ca('0x12')][_0xf2ca('0x13')]};});_0x160230['model']=_[_0xf2ca('0xe')](_0x310504,_0xf2ca('0xc'));_0x160230[_0xf2ca('0x14')]=_[_0xf2ca('0x15')](_0x6a2b25[_0xf2ca('0x14')]);_0x160230[_0xf2ca('0x16')]=_[_0xf2ca('0x17')](_0x160230[_0xf2ca('0x18')],_0x160230['query']);_0x160230[_0xf2ca('0x16')]=_[_0xf2ca('0x19')](_0x160230['filters'],[_0xf2ca('0x1a'),_0xf2ca('0x1b'),_0xf2ca('0x1c'),'$gte','$lt',_0xf2ca('0x1d'),_0xf2ca('0x1e'),_0xf2ca('0x1f'),_0xf2ca('0x20'),_0xf2ca('0x21'),_0xf2ca('0x22'),_0xf2ca('0x23'),_0xf2ca('0x24'),'$like',_0xf2ca('0x25'),_0xf2ca('0x26'),_0xf2ca('0x27'),_0xf2ca('0x28'),_0xf2ca('0x29'),_0xf2ca('0x2a'),_0xf2ca('0x2b'),_0xf2ca('0x2c')]);_0x3c0055[_0xf2ca('0x2d')]=_[_0xf2ca('0x17')](_0x160230[_0xf2ca('0x18')],qs[_0xf2ca('0x2e')](_0x6a2b25[_0xf2ca('0x14')][_0xf2ca('0x2e')]));_0x3c0055[_0xf2ca('0x2d')]=_0x3c0055[_0xf2ca('0x2d')][_0xf2ca('0x2f')]?_0x3c0055[_0xf2ca('0x2d')]:_0x160230[_0xf2ca('0x18')];if(!_0x6a2b25['query'][_0xf2ca('0x30')](_0xf2ca('0x31'))){_0x3c0055[_0xf2ca('0x5')]=qs[_0xf2ca('0x5')](_0x6a2b25[_0xf2ca('0x14')][_0xf2ca('0x5')]);_0x3c0055[_0xf2ca('0x8')]=qs[_0xf2ca('0x8')](_0x6a2b25[_0xf2ca('0x14')]['offset']);}_0x3c0055[_0xf2ca('0x32')]=qs[_0xf2ca('0x33')](_0x6a2b25[_0xf2ca('0x14')]['sort']);_0x3c0055[_0xf2ca('0x34')]=qs['filters'](_[_0xf2ca('0x35')](_0x6a2b25[_0xf2ca('0x14')],_0x160230[_0xf2ca('0x16')]),_0x310504);if(_0x6a2b25[_0xf2ca('0x14')][_0xf2ca('0x36')]){_0x3c0055['where']=_['merge'](_0x3c0055[_0xf2ca('0x34')],{'$or':_['map'](_0x310504,function(_0x3caa5d){if(_0x3caa5d[_0xf2ca('0x12')]!==_0xf2ca('0x37')){var _0x3152eb={};_0x3152eb[_0x3caa5d[_0xf2ca('0xc')]]={'$like':'%'+_0x6a2b25[_0xf2ca('0x14')][_0xf2ca('0x36')]+'%'};return _0x3152eb;}})});}_0x3c0055=_[_0xf2ca('0x38')]({},_0x3c0055,_0x6a2b25[_0xf2ca('0x39')]);var _0x1ad216={'where':_0x3c0055[_0xf2ca('0x34')]};return db[_0xf2ca('0xf')][_0xf2ca('0x7')](_0x1ad216)[_0xf2ca('0x3a')](function(_0x211f00){_0x1b3a36[_0xf2ca('0x7')]=_0x211f00;if(_0x6a2b25['query'][_0xf2ca('0x3b')]){_0x3c0055[_0xf2ca('0x3c')]=[{'all':!![]}];}return db[_0xf2ca('0xf')][_0xf2ca('0x3d')](_0x3c0055);})['then'](function(_0x46643e){_0x1b3a36['rows']=_0x46643e;return _0x1b3a36;})[_0xf2ca('0x3a')](respondWithFilteredResult(_0x59ea3c,_0x3c0055))[_0xf2ca('0x3e')](handleError(_0x59ea3c,null));};exports[_0xf2ca('0x3f')]=function(_0x2c196d,_0x385904){var _0x4fbaec={'raw':!![],'where':{'id':_0x2c196d[_0xf2ca('0x40')]['id']}},_0x37e50e={};_0x37e50e['model']=_[_0xf2ca('0x15')](db[_0xf2ca('0xf')][_0xf2ca('0x10')]);_0x37e50e['query']=_[_0xf2ca('0x15')](_0x2c196d['query']);_0x37e50e[_0xf2ca('0x16')]=_[_0xf2ca('0x17')](_0x37e50e[_0xf2ca('0x18')],_0x37e50e[_0xf2ca('0x14')]);_0x4fbaec[_0xf2ca('0x2d')]=_[_0xf2ca('0x17')](_0x37e50e[_0xf2ca('0x18')],qs[_0xf2ca('0x2e')](_0x2c196d[_0xf2ca('0x14')][_0xf2ca('0x2e')]));_0x4fbaec[_0xf2ca('0x2d')]=_0x4fbaec[_0xf2ca('0x2d')][_0xf2ca('0x2f')]?_0x4fbaec[_0xf2ca('0x2d')]:_0x37e50e[_0xf2ca('0x18')];if(_0x2c196d['query'][_0xf2ca('0x3b')]){_0x4fbaec[_0xf2ca('0x3c')]=[{'all':!![]}];}_0x4fbaec=_[_0xf2ca('0x38')]({},_0x4fbaec,_0x2c196d[_0xf2ca('0x39')]);return db[_0xf2ca('0xf')][_0xf2ca('0x41')](_0x4fbaec)[_0xf2ca('0x3a')](handleEntityNotFound(_0x385904,null))[_0xf2ca('0x3a')](respondWithResult(_0x385904,null))[_0xf2ca('0x3e')](handleError(_0x385904,null));};exports[_0xf2ca('0x42')]=function(_0x20f215,_0x142789){return db[_0xf2ca('0xf')]['create'](_0x20f215['body'],{})[_0xf2ca('0x3a')](respondWithResult(_0x142789,0xc9))[_0xf2ca('0x3e')](handleError(_0x142789,null));};exports['update']=function(_0x102c3c,_0x4c5125){if(_0x102c3c[_0xf2ca('0x43')]['id']){delete _0x102c3c[_0xf2ca('0x43')]['id'];}return db[_0xf2ca('0xf')]['find']({'where':{'id':_0x102c3c[_0xf2ca('0x40')]['id']}})[_0xf2ca('0x3a')](handleEntityNotFound(_0x4c5125,null))['then'](saveUpdates(_0x102c3c[_0xf2ca('0x43')],null))[_0xf2ca('0x3a')](respondWithResult(_0x4c5125,null))[_0xf2ca('0x3e')](handleError(_0x4c5125,null));};exports[_0xf2ca('0x44')]=function(_0x4a6439,_0x3d67fe){return db[_0xf2ca('0xf')][_0xf2ca('0x44')]()['then'](respondWithResult(_0x3d67fe,null))['catch'](handleError(_0x3d67fe,null));};exports[_0xf2ca('0x45')]=function(_0x2f7596,_0x1a65c6){var _0x718ee1;var _0x3f31de=_0x2f7596[_0xf2ca('0x40')]['id'];return db['CmHopper']['find']({'where':{'id':_0x2f7596[_0xf2ca('0x40')]['id']}})[_0xf2ca('0x3a')](handleEntityNotFound(_0x1a65c6,null))['then'](function(_0x2f8ba0){if(_0x2f8ba0){return _0x2f8ba0['destroy']()[_0xf2ca('0x3a')](function(_0x59bbb8){return _0x59bbb8;});}})[_0xf2ca('0x3a')](function(_0x5f3fc7){_0x718ee1=_0x5f3fc7;if(_0x5f3fc7){if(_0x5f3fc7['VoiceQueueId']||_0x5f3fc7[_0xf2ca('0x46')]){return db[_0x5f3fc7[_0xf2ca('0x47')]?'VoiceQueue':_0xf2ca('0x48')][_0xf2ca('0x41')]({'where':{'id':_0x5f3fc7[_0xf2ca('0x47')]?_0x5f3fc7[_0xf2ca('0x47')]:_0x5f3fc7[_0xf2ca('0x46')]},'attributes':['id',_0xf2ca('0xc')],'raw':!![]});}}})['then'](function(_0x223cb1){var _0x3ac6ec={};if(_0x223cb1){_['merge'](_0x3ac6ec,_[_0xf2ca('0x49')](_0x718ee1[_0xf2ca('0x4a')],[_0xf2ca('0x4b'),_0xf2ca('0x4c'),'id']));_0x3ac6ec[_0xf2ca('0x4d')]=0x15;_0x3ac6ec['statedesc']='deleted';_0x3ac6ec['campaign']=_0x223cb1[_0xf2ca('0xc')];_0x3ac6ec[_0xf2ca('0x4e')]=_0x2f7596[_0xf2ca('0x4f')][_0xf2ca('0xc')];_0x3ac6ec['UserId']=_0x2f7596[_0xf2ca('0x4f')]['id'];_0x3ac6ec[_0xf2ca('0x50')]=!![];_0x3ac6ec[_0xf2ca('0x51')]=moment()[_0xf2ca('0x52')](_0xf2ca('0x53'));_0x3ac6ec[_0xf2ca('0x54')]=_0x718ee1[_0xf2ca('0x55')];_0x3ac6ec['campaigntype']=_0x718ee1[_0xf2ca('0x47')]?_0xf2ca('0x56'):_0xf2ca('0x57');return db['CmContact'][_0xf2ca('0x41')]({'where':{'id':_0x3ac6ec[_0xf2ca('0x58')]},'attributes':['firstName',_0xf2ca('0x59')]})[_0xf2ca('0x3a')](function(_0x381448){if(!_['isNil'](_0x1a65c6)&&!_[_0xf2ca('0x5a')](_0x381448[_0xf2ca('0x5b')])){_0x3ac6ec[_0xf2ca('0x5c')]=_0x381448[_0xf2ca('0x5b')];if(!_['isNil'](_0x381448['lastName'])){_0x3ac6ec[_0xf2ca('0x5c')]+='\x20'+_0x381448[_0xf2ca('0x59')];}}})[_0xf2ca('0x5d')](function(){return db[_0xf2ca('0x5e')]['create'](_0x3ac6ec);});}})[_0xf2ca('0x3a')](function(_0x4e1f9d){return db[_0xf2ca('0x5f')][_0xf2ca('0x45')]({'where':{'CmHopperId':_0x3f31de}});})[_0xf2ca('0x3a')](function(){return _0x1a65c6[_0xf2ca('0x3')](0xcc)['end']();})[_0xf2ca('0x3e')](handleError(_0x1a65c6,null));};exports[_0xf2ca('0x60')]=function(_0x2a7a70,_0x359eef){var _0x40364c=[];return db[_0xf2ca('0x61')]['describe']()[_0xf2ca('0x3a')](function(_0x588363){_0x40364c=_[_0xf2ca('0x15')](_0x588363);return _0x2a7a70[_0xf2ca('0x4f')][_0xf2ca('0x62')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf2ca('0x63')},'attributes':['id',_0xf2ca('0x64'),_0xf2ca('0x65')],'raw':!![]});})['then'](function(_0x19c73b){if(_0x19c73b&&_0x19c73b[_0xf2ca('0x2f')]){return db[_0xf2ca('0x66')][_0xf2ca('0x67')](function(_0x315420){var _0x219854={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf2ca('0x52')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x19c73b,'id')},'$or':[{'UserId':null},{'UserId':_0x2a7a70['user']['id']}]};var _0x470603={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x19c73b)[_0xf2ca('0x36')]([_0xf2ca('0x65'),0x0])[_0xf2ca('0xe')]('id')[_0xf2ca('0x68')]()},'$or':[{'UserId':null},{'UserId':_0x2a7a70['user']['id']}]};var _0x4c6f28={'$or':[_0x219854,_0x470603]};var _0xbd933=[];if(_0x2a7a70['body'][_0xf2ca('0x69')]&&_0x2a7a70['body']['direction']==='prev'){if(!_[_0xf2ca('0x6a')](_0x2a7a70[_0xf2ca('0x43')][_0xf2ca('0x6b')])){_0x4c6f28['id']={'$in':_0x2a7a70[_0xf2ca('0x43')][_0xf2ca('0x6b')]};}_0xbd933=[[_0xf2ca('0x6c'),_0xf2ca('0x6d')],[_0xf2ca('0x6e'),_0x19c73b[0x0]['dialOrderByScheduledAt']===_0xf2ca('0x6d')?_0xf2ca('0x6f'):_0xf2ca('0x6d')],db[_0xf2ca('0x66')]['literal'](_0xf2ca('0x70')),['id',_0xf2ca('0x6f')]];}else{if(!_['isEmpty'](_0x2a7a70[_0xf2ca('0x43')]['hopperIds'])){_0x4c6f28['id']={'$notIn':_0x2a7a70[_0xf2ca('0x43')]['hopperIds']};}_0xbd933=[[_0xf2ca('0x6c'),_0xf2ca('0x6f')],[_0xf2ca('0x6e'),_0x19c73b[0x0]['dialOrderByScheduledAt']],db[_0xf2ca('0x66')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xf2ca('0xf')][_0xf2ca('0x71')]({'attributes':['id',_0xf2ca('0x72'),_0xf2ca('0x55'),'recallme'],'where':_0x4c6f28,'order':_0xbd933,'transaction':_0x315420,'lock':_0x315420[_0xf2ca('0x73')][_0xf2ca('0x74')],'include':[{'model':db['CmContact'],'as':_0xf2ca('0x75'),'attributes':_0x40364c,'include':[{'model':db[_0xf2ca('0x76')],'as':'Company','attributes':['id',_0xf2ca('0xc')]}]},{'model':db[_0xf2ca('0x77')],'as':_0xf2ca('0x78'),'attributes':['id',_0xf2ca('0xc')]},{'model':db[_0xf2ca('0x79')],'as':_0xf2ca('0x7a'),'attributes':['id','name',_0xf2ca('0x7b')]}]})[_0xf2ca('0x3a')](function(_0x3c9e50){if(_0x3c9e50){return _0x3c9e50[_0xf2ca('0x7c')]({'UserId':_0x2a7a70[_0xf2ca('0x4f')]['id']},{'transaction':_0x315420});}});});}})[_0xf2ca('0x3a')](handleEntityNotFound(_0x359eef,null))[_0xf2ca('0x3a')](respondWithResult(_0x359eef,null))['catch'](handleError(_0x359eef,null));};exports[_0xf2ca('0x7d')]=function(_0x877d77,_0x1d7e23,_0x424dad){var _0x5bea6e=[];var _0x581886=_0x877d77[_0xf2ca('0x40')]['id'];var _0x53f005=_0x877d77['user']['id'];return db[_0xf2ca('0x61')][_0xf2ca('0x44')]()[_0xf2ca('0x3a')](function(_0x482877){_0x5bea6e=_[_0xf2ca('0x15')](_0x482877);return db[_0xf2ca('0x66')][_0xf2ca('0x67')](function(_0x294d6f){const _0xdbcb3={'id':_0x581886};return db['CmHopper'][_0xf2ca('0x71')]({'attributes':['id',_0xf2ca('0x72'),'recallme'],'where':_0xdbcb3,'transaction':_0x294d6f,'lock':_0x294d6f[_0xf2ca('0x73')][_0xf2ca('0x74')],'include':[{'model':db[_0xf2ca('0x61')],'as':_0xf2ca('0x75'),'attributes':_0x5bea6e,'include':[{'model':db[_0xf2ca('0x76')],'as':_0xf2ca('0x7e'),'attributes':['id',_0xf2ca('0xc')]}]},{'model':db[_0xf2ca('0x77')],'as':_0xf2ca('0x78'),'attributes':['id','name']},{'model':db[_0xf2ca('0x79')],'as':_0xf2ca('0x7a'),'attributes':['id',_0xf2ca('0xc'),_0xf2ca('0x7b')]}]})[_0xf2ca('0x3a')](function(_0x2f7b82){if(_0x2f7b82){return _0x2f7b82['update']({'UserId':_0x53f005},{'transaction':_0x294d6f});}});});})['then'](handleEntityNotFound(_0x1d7e23,null))[_0xf2ca('0x3a')](respondWithResult(_0x1d7e23,null))[_0xf2ca('0x3e')](handleError(_0x1d7e23,null));};exports[_0xf2ca('0x7f')]=function(_0xda8883,_0x1d11f8){return _0xda8883[_0xf2ca('0x4f')][_0xf2ca('0x62')]({'where':{'type':_0xf2ca('0x80'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xf2ca('0x3a')](function(_0x1b16b1){if(_0x1b16b1&&_0x1b16b1[_0xf2ca('0x2f')]){return db['CmHopper'][_0xf2ca('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf2ca('0x52')](_0xf2ca('0x53'))},'VoiceQueueId':{'$in':_[_0xf2ca('0xe')](_0x1b16b1,'id')},'$or':[{'UserId':null},{'UserId':_0xda8883['user']['id']}]}});}return 0x0;})[_0xf2ca('0x3a')](function(_0x271ec6){if(!_[_0xf2ca('0x5a')](_0x271ec6)&&_[_0xf2ca('0x81')](_0x271ec6)){return _0x1d11f8[_0xf2ca('0x3')](0xc8)['json']({'contacts':_0x271ec6});}else{logger[_0xf2ca('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xf2ca('0x7f'),0x194,_0xf2ca('0x82'));_0x1d11f8[_0xf2ca('0xa')](0x194);}})[_0xf2ca('0x3e')](handleError(_0x1d11f8,null));};exports['getTimezones']=function(_0x532684,_0x1bb147){var _0x1d3e6f=shared[_0xf2ca('0x83')];var _0x28ee05=[];_[_0xf2ca('0xe')](_0x1d3e6f,function(_0x2dc994){_0x28ee05[_0xf2ca('0x84')]({'id':_0x2dc994[_0xf2ca('0xc')],'name':_0x2dc994['name'],'utcOffset':_0x2dc994[_0xf2ca('0x85')]});});return _0x1bb147[_0xf2ca('0x3')](0xc8)[_0xf2ca('0x4')]({'tz':_0x28ee05});};exports[_0xf2ca('0x86')]=function(_0x59d3d4,_0x494761){var _0x23f9cf=shared['timezones'];var _0x3412fc={};if(!_[_0xf2ca('0x5a')](_0x23f9cf[_0x59d3d4[_0xf2ca('0x43')]['id']]))_0x3412fc=_0x23f9cf[_0x59d3d4[_0xf2ca('0x43')]['id']];return _0x494761['status'](0xc8)[_0xf2ca('0x4')](_0x3412fc);}; \ No newline at end of file +var _0xa990=['describe','destroy','find','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','dialOrderByScheduledAt','findOne','scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','transaction','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','update','then','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','type','model','keys','query','filters','intersection','concat','$gt','$gte','$lt','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$any','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','rows','catch','show','include','create','body','params'];(function(_0xc39e82,_0x43e999){var _0x35e900=function(_0x5e6e94){while(--_0x5e6e94){_0xc39e82['push'](_0xc39e82['shift']());}};_0x35e900(++_0x43e999);}(_0xa990,0xc9));var _0x0a99=function(_0x474b1c,_0x26b7ee){_0x474b1c=_0x474b1c-0x0;var _0x31618a=_0xa990[_0x474b1c];return _0x31618a;};'use strict';var moment=require(_0x0a99('0x0'));var _=require(_0x0a99('0x1'));var qs=require(_0x0a99('0x2'));var logger=require(_0x0a99('0x3'))(_0x0a99('0x4'));var shared=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];function respondWithResult(_0x394f1c,_0x4d4992){_0x4d4992=_0x4d4992||0xc8;return function(_0x4d1781){if(_0x4d1781){return _0x394f1c[_0x0a99('0x7')](_0x4d4992)[_0x0a99('0x8')](_0x4d1781);}};}function respondWithFilteredResult(_0xfdb594,_0x320560){return function(_0x45b195){if(_0x45b195){var _0x398d95=typeof _0x320560[_0x0a99('0x9')]===_0x0a99('0xa')&&typeof _0x320560[_0x0a99('0xb')]===_0x0a99('0xa');var _0x1eaa2a=_0x45b195['count'];var _0x813e91=_0x398d95?0x0:_0x320560[_0x0a99('0x9')];var _0x5b5ec3=_0x398d95?_0x45b195['count']:_0x320560[_0x0a99('0x9')]+_0x320560[_0x0a99('0xb')];var _0x1eb2bd;if(_0x5b5ec3>=_0x1eaa2a){_0x5b5ec3=_0x1eaa2a;_0x1eb2bd=0xc8;}else{_0x1eb2bd=0xce;}_0xfdb594[_0x0a99('0x7')](_0x1eb2bd);return _0xfdb594[_0x0a99('0xc')]('Content-Range',_0x813e91+'-'+_0x5b5ec3+'/'+_0x1eaa2a)[_0x0a99('0x8')](_0x45b195);}return null;};}function saveUpdates(_0x3aaaad,_0x57ab88){return function(_0xb6a34d){if(_0xb6a34d){return _0xb6a34d[_0x0a99('0xd')](_0x3aaaad)[_0x0a99('0xe')](function(_0x2bbf1a){return _0x2bbf1a;});}return null;};}function handleEntityNotFound(_0x346061,_0x23d018){return function(_0x18c124){if(!_0x18c124){_0x346061[_0x0a99('0xf')](0x194);}return _0x18c124;};}function handleError(_0x4b6946,_0x5a17e1){_0x5a17e1=_0x5a17e1||0x1f4;return function(_0x2c40db){logger[_0x0a99('0x10')](_0x2c40db[_0x0a99('0x11')]);if(_0x2c40db['name']){delete _0x2c40db[_0x0a99('0x12')];}_0x4b6946['status'](_0x5a17e1)['send'](_0x2c40db);};}exports[_0x0a99('0x13')]=function(_0x3bab16,_0x3de006){var _0x544c2={},_0x572ce5={},_0x564ae9={'count':0x0,'rows':[]};var _0x27a14f=_[_0x0a99('0x14')](db[_0x0a99('0x15')][_0x0a99('0x16')],function(_0x5e6c7e){return{'name':_0x5e6c7e['fieldName'],'type':_0x5e6c7e[_0x0a99('0x17')]['key']};});_0x572ce5[_0x0a99('0x18')]=_['map'](_0x27a14f,_0x0a99('0x12'));_0x572ce5['query']=_[_0x0a99('0x19')](_0x3bab16[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],_0x572ce5[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1d')](_0x572ce5[_0x0a99('0x1b')],['$and','$or',_0x0a99('0x1e'),_0x0a99('0x1f'),_0x0a99('0x20'),'$lte','$ne',_0x0a99('0x21'),_0x0a99('0x22'),_0x0a99('0x23'),_0x0a99('0x24'),_0x0a99('0x25'),_0x0a99('0x26'),_0x0a99('0x27'),_0x0a99('0x28'),_0x0a99('0x29'),'$notILike',_0x0a99('0x27'),'$overlap','$contains','$contained',_0x0a99('0x2a')]);_0x544c2[_0x0a99('0x2b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x2c')]));_0x544c2['attributes']=_0x544c2[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x544c2[_0x0a99('0x2b')]:_0x572ce5[_0x0a99('0x18')];if(!_0x3bab16['query']['hasOwnProperty']('nolimit')){_0x544c2[_0x0a99('0xb')]=qs[_0x0a99('0xb')](_0x3bab16[_0x0a99('0x1a')]['limit']);_0x544c2[_0x0a99('0x9')]=qs[_0x0a99('0x9')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x9')]);}_0x544c2[_0x0a99('0x2e')]=qs[_0x0a99('0x2f')](_0x3bab16[_0x0a99('0x1a')]['sort']);_0x544c2[_0x0a99('0x30')]=qs[_0x0a99('0x1b')](_[_0x0a99('0x31')](_0x3bab16[_0x0a99('0x1a')],_0x572ce5[_0x0a99('0x1b')]),_0x27a14f);if(_0x3bab16['query'][_0x0a99('0x32')]){_0x544c2['where']=_['merge'](_0x544c2['where'],{'$or':_['map'](_0x27a14f,function(_0x155a14){if(_0x155a14['type']!==_0x0a99('0x33')){var _0x3d5e0f={};_0x3d5e0f[_0x155a14[_0x0a99('0x12')]]={'$like':'%'+_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x32')]+'%'};return _0x3d5e0f;}})});}_0x544c2=_[_0x0a99('0x34')]({},_0x544c2,_0x3bab16[_0x0a99('0x35')]);var _0x3bc3fc={'where':_0x544c2[_0x0a99('0x30')]};return db[_0x0a99('0x15')][_0x0a99('0x36')](_0x3bc3fc)[_0x0a99('0xe')](function(_0x472850){_0x564ae9['count']=_0x472850;if(_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x37')]){_0x544c2['include']=[{'all':!![]}];}return db[_0x0a99('0x15')]['findAll'](_0x544c2);})[_0x0a99('0xe')](function(_0x563fbc){_0x564ae9[_0x0a99('0x38')]=_0x563fbc;return _0x564ae9;})[_0x0a99('0xe')](respondWithFilteredResult(_0x3de006,_0x544c2))[_0x0a99('0x39')](handleError(_0x3de006,null));};exports[_0x0a99('0x3a')]=function(_0x4a5c58,_0x19774f){var _0x11e046={'raw':!![],'where':{'id':_0x4a5c58['params']['id']}},_0x3b7efc={};_0x3b7efc[_0x0a99('0x18')]=_[_0x0a99('0x19')](db[_0x0a99('0x15')][_0x0a99('0x16')]);_0x3b7efc['query']=_[_0x0a99('0x19')](_0x4a5c58['query']);_0x3b7efc['filters']=_[_0x0a99('0x1c')](_0x3b7efc['model'],_0x3b7efc[_0x0a99('0x1a')]);_0x11e046['attributes']=_[_0x0a99('0x1c')](_0x3b7efc[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x4a5c58[_0x0a99('0x1a')]['fields']));_0x11e046[_0x0a99('0x2b')]=_0x11e046[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x11e046[_0x0a99('0x2b')]:_0x3b7efc['model'];if(_0x4a5c58['query']['includeAll']){_0x11e046[_0x0a99('0x3b')]=[{'all':!![]}];}_0x11e046=_['merge']({},_0x11e046,_0x4a5c58[_0x0a99('0x35')]);return db['CmHopper']['find'](_0x11e046)['then'](handleEntityNotFound(_0x19774f,null))['then'](respondWithResult(_0x19774f,null))[_0x0a99('0x39')](handleError(_0x19774f,null));};exports['create']=function(_0x3e6213,_0x78cd0c){return db['CmHopper'][_0x0a99('0x3c')](_0x3e6213[_0x0a99('0x3d')],{})['then'](respondWithResult(_0x78cd0c,0xc9))[_0x0a99('0x39')](handleError(_0x78cd0c,null));};exports['update']=function(_0x3107bc,_0x278454){if(_0x3107bc['body']['id']){delete _0x3107bc[_0x0a99('0x3d')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x3107bc[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x278454,null))[_0x0a99('0xe')](saveUpdates(_0x3107bc[_0x0a99('0x3d')],null))[_0x0a99('0xe')](respondWithResult(_0x278454,null))['catch'](handleError(_0x278454,null));};exports[_0x0a99('0x3f')]=function(_0x174298,_0x4525d1){return db[_0x0a99('0x15')][_0x0a99('0x3f')]()[_0x0a99('0xe')](respondWithResult(_0x4525d1,null))[_0x0a99('0x39')](handleError(_0x4525d1,null));};exports[_0x0a99('0x40')]=function(_0x1cd328,_0x1621d9){var _0x52c754;var _0x50e04f=_0x1cd328[_0x0a99('0x3e')]['id'];return db[_0x0a99('0x15')][_0x0a99('0x41')]({'where':{'id':_0x1cd328[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x1621d9,null))[_0x0a99('0xe')](function(_0x5cda7d){if(_0x5cda7d){return _0x5cda7d[_0x0a99('0x40')]()[_0x0a99('0xe')](function(_0x55fee0){return _0x55fee0;});}})[_0x0a99('0xe')](function(_0x474e8b){_0x52c754=_0x474e8b;if(_0x474e8b){if(_0x474e8b['VoiceQueueId']||_0x474e8b[_0x0a99('0x42')]){return db[_0x474e8b[_0x0a99('0x43')]?_0x0a99('0x44'):_0x0a99('0x45')][_0x0a99('0x41')]({'where':{'id':_0x474e8b[_0x0a99('0x43')]?_0x474e8b[_0x0a99('0x43')]:_0x474e8b['CampaignId']},'attributes':['id',_0x0a99('0x12')],'raw':!![]});}}})[_0x0a99('0xe')](function(_0x1e9e9d){var _0x5a6762={};if(_0x1e9e9d){_[_0x0a99('0x34')](_0x5a6762,_[_0x0a99('0x46')](_0x52c754[_0x0a99('0x47')],['createdAt',_0x0a99('0x48'),'id']));_0x5a6762[_0x0a99('0x49')]=0x15;_0x5a6762[_0x0a99('0x4a')]=_0x0a99('0x4b');_0x5a6762[_0x0a99('0x4c')]=_0x1e9e9d[_0x0a99('0x12')];_0x5a6762['membername']=_0x1cd328[_0x0a99('0x4d')]['name'];_0x5a6762[_0x0a99('0x4e')]=_0x1cd328[_0x0a99('0x4d')]['id'];_0x5a6762[_0x0a99('0x4b')]=!![];_0x5a6762[_0x0a99('0x4f')]=moment()['format'](_0x0a99('0x50'));_0x5a6762['calleridnum']=_0x52c754[_0x0a99('0x51')];_0x5a6762[_0x0a99('0x52')]=_0x52c754[_0x0a99('0x43')]?_0x0a99('0x53'):_0x0a99('0x54');return db[_0x0a99('0x55')][_0x0a99('0x41')]({'where':{'id':_0x5a6762[_0x0a99('0x56')]},'attributes':[_0x0a99('0x57'),_0x0a99('0x58')]})[_0x0a99('0xe')](function(_0x3f2e09){if(!_[_0x0a99('0x59')](_0x1621d9)&&!_['isNil'](_0x3f2e09[_0x0a99('0x57')])){_0x5a6762[_0x0a99('0x5a')]=_0x3f2e09[_0x0a99('0x57')];if(!_['isNil'](_0x3f2e09[_0x0a99('0x58')])){_0x5a6762[_0x0a99('0x5a')]+='\x20'+_0x3f2e09[_0x0a99('0x58')];}}})['finally'](function(){return db[_0x0a99('0x5b')][_0x0a99('0x3c')](_0x5a6762);});}})[_0x0a99('0xe')](function(_0x144032){return db['CmHopperAdditionalPhone'][_0x0a99('0x40')]({'where':{'CmHopperId':_0x50e04f}});})[_0x0a99('0xe')](function(){return _0x1621d9[_0x0a99('0x7')](0xcc)['end']();})['catch'](handleError(_0x1621d9,null));};exports[_0x0a99('0x5c')]=function(_0x528a5d,_0x53b1f4){var _0x5406a7=[];return db[_0x0a99('0x55')]['describe']()[_0x0a99('0xe')](function(_0x436942){_0x5406a7=_[_0x0a99('0x19')](_0x436942);return _0x528a5d[_0x0a99('0x4d')][_0x0a99('0x5d')]({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id','dialOrderByScheduledAt',_0x0a99('0x60')],'raw':!![]});})[_0x0a99('0xe')](function(_0x2d3b63){if(_0x2d3b63&&_0x2d3b63['length']){return db[_0x0a99('0x61')]['transaction'](function(_0x2109db){var _0x51d18a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')](_0x0a99('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x2d3b63,'id')},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x4ce300={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2d3b63)[_0x0a99('0x32')]([_0x0a99('0x60'),0x0])[_0x0a99('0x14')]('id')[_0x0a99('0x63')]()},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x9b52c7={'$or':[_0x51d18a,_0x4ce300]};var _0x44aa5d=[];if(_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]&&_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]===_0x0a99('0x65')){if(!_[_0x0a99('0x66')](_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')])){_0x9b52c7['id']={'$in':_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')]};}_0x44aa5d=[[_0x0a99('0x68'),'ASC'],['scheduledAt',_0x2d3b63[0x0]['dialOrderByScheduledAt']===_0x0a99('0x69')?_0x0a99('0x6a'):_0x0a99('0x69')],db['sequelize'][_0x0a99('0x6b')](_0x0a99('0x6c')),['id',_0x0a99('0x6a')]];}else{if(!_[_0x0a99('0x66')](_0x528a5d['body'][_0x0a99('0x67')])){_0x9b52c7['id']={'$notIn':_0x528a5d[_0x0a99('0x3d')]['hopperIds']};}_0x44aa5d=[['priority',_0x0a99('0x6a')],[_0x0a99('0x6d'),_0x2d3b63[0x0][_0x0a99('0x6e')]],db[_0x0a99('0x61')][_0x0a99('0x6b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x0a99('0x15')][_0x0a99('0x6f')]({'attributes':['id',_0x0a99('0x70'),_0x0a99('0x51'),_0x0a99('0x71')],'where':_0x9b52c7,'order':_0x44aa5d,'transaction':_0x2109db,'lock':_0x2109db[_0x0a99('0x72')][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x5406a7,'include':[{'model':db[_0x0a99('0x74')],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db['CmList'],'as':_0x0a99('0x76'),'attributes':['id','name']},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x3435e3){if(_0x3435e3){return _0x3435e3[_0x0a99('0xd')]({'UserId':_0x528a5d[_0x0a99('0x4d')]['id']},{'transaction':_0x2109db});}});});}})[_0x0a99('0xe')](handleEntityNotFound(_0x53b1f4,null))[_0x0a99('0xe')](respondWithResult(_0x53b1f4,null))[_0x0a99('0x39')](handleError(_0x53b1f4,null));};exports[_0x0a99('0x79')]=function(_0x4c6a12,_0x656dd,_0x31950f){var _0x436163=[];var _0x2bae3d=_0x4c6a12['params']['id'];var _0x1a40e9=_0x4c6a12['user']['id'];return db['CmContact'][_0x0a99('0x3f')]()[_0x0a99('0xe')](function(_0x3bed6e){_0x436163=_[_0x0a99('0x19')](_0x3bed6e);return db[_0x0a99('0x61')][_0x0a99('0x7a')](function(_0x24a389){const _0x353660={'id':_0x2bae3d};return db['CmHopper'][_0x0a99('0x6f')]({'attributes':['id','scheduledat','recallme'],'where':_0x353660,'transaction':_0x24a389,'lock':_0x24a389['LOCK'][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x436163,'include':[{'model':db['CmCompany'],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db[_0x0a99('0x7b')],'as':_0x0a99('0x76'),'attributes':['id',_0x0a99('0x12')]},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x51627a){if(_0x51627a){return _0x51627a[_0x0a99('0xd')]({'UserId':_0x1a40e9},{'transaction':_0x24a389});}});});})[_0x0a99('0xe')](handleEntityNotFound(_0x656dd,null))[_0x0a99('0xe')](respondWithResult(_0x656dd,null))[_0x0a99('0x39')](handleError(_0x656dd,null));};exports[_0x0a99('0x7c')]=function(_0x22b737,_0x3a6773){return _0x22b737['user']['getVoiceQueues']({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id'],'raw':!![]})['then'](function(_0x587442){if(_0x587442&&_0x587442[_0x0a99('0x2d')]){return db['CmHopper'][_0x0a99('0x36')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x587442,'id')},'$or':[{'UserId':null},{'UserId':_0x22b737[_0x0a99('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x17436d){if(!_['isNil'](_0x17436d)&&_[_0x0a99('0x7d')](_0x17436d)){return _0x3a6773[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'contacts':_0x17436d});}else{logger[_0x0a99('0x10')](_0x0a99('0x7e'),_0x0a99('0x7c'),0x194,_0x0a99('0x7f'));_0x3a6773[_0x0a99('0xf')](0x194);}})[_0x0a99('0x39')](handleError(_0x3a6773,null));};exports[_0x0a99('0x80')]=function(_0x2d3efa,_0xe18018){var _0x51df2a=shared[_0x0a99('0x81')];var _0x2f4d34=[];_[_0x0a99('0x14')](_0x51df2a,function(_0x25c31b){_0x2f4d34[_0x0a99('0x82')]({'id':_0x25c31b[_0x0a99('0x12')],'name':_0x25c31b[_0x0a99('0x12')],'utcOffset':_0x25c31b[_0x0a99('0x83')]});});return _0xe18018[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'tz':_0x2f4d34});};exports['getTimezone']=function(_0x5607f1,_0x505a2c){var _0x59228e=shared[_0x0a99('0x81')];var _0x38932f={};if(!_[_0x0a99('0x59')](_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']]))_0x38932f=_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']];return _0x505a2c[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')](_0x38932f);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6707f56..6532c82 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 _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x277543,_0x1a9b14){var _0x2406cb=function(_0x3adf9b){while(--_0x3adf9b){_0x277543['push'](_0x277543['shift']());}};_0x2406cb(++_0x1a9b14);}(_0x524e,0x15e));var _0xe524=function(_0x2078b7,_0x2b291f){_0x2078b7=_0x2078b7-0x0;var _0x1945a6=_0x524e[_0x2078b7];return _0x1945a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x26edfc,_0x18bee9){var _0x52a7c1=function(_0x59e008){while(--_0x59e008){_0x26edfc['push'](_0x26edfc['shift']());}};_0x52a7c1(++_0x18bee9);}(_0x2542,0x169));var _0x2254=function(_0x186957,_0x4083df){_0x186957=_0x186957-0x0;var _0x560b7c=_0x2542[_0x186957];return _0x560b7c;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c0a8e01..633b853 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 _0xfe99=['message','ShowCmHopper','find','then','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','transaction','limit','order','LOCK','keys','User','Agent','name','voicePause','UserId','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','ContactId','dataValues','MoveContactManagedDialer','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','sequelize','COUNT','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','UPDATE','GetCmHopperPreview','Contact','GetContactByPhone','findOne','dialTimezone','getContactByPhone','ResetActiveCalls','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','info','debug','stringify','catch','error'];(function(_0x3550b4,_0x59b309){var _0x237bca=function(_0x9624f9){while(--_0x9624f9){_0x3550b4['push'](_0x3550b4['shift']());}};_0x237bca(++_0x59b309);}(_0xfe99,0x11f));var _0x9fe9=function(_0x390936,_0x4ae10e){_0x390936=_0x390936-0x0;var _0x249fc2=_0xfe99[_0x390936];return _0x249fc2;};'use strict';var _=require('lodash');var util=require(_0x9fe9('0x0'));var moment=require(_0x9fe9('0x1'));var BPromise=require(_0x9fe9('0x2'));var db=require(_0x9fe9('0x3'))['db'];var logger=require(_0x9fe9('0x4'))(_0x9fe9('0x5'));exports[_0x9fe9('0x6')]=function(_0x491bd7){var _0x2dbfae=this;return new Promise(function(_0x225984,_0x2b043f){return db[_0x9fe9('0x7')][_0x9fe9('0x8')]({'raw':_0x491bd7[_0x9fe9('0x9')]?_0x491bd7[_0x9fe9('0x9')][_0x9fe9('0xa')]===undefined?!![]:![]:!![],'where':_0x491bd7[_0x9fe9('0x9')]?_0x491bd7[_0x9fe9('0x9')][_0x9fe9('0xb')]||null:null,'attributes':_0x491bd7['options']?_0x491bd7[_0x9fe9('0x9')][_0x9fe9('0xc')]||null:null,'limit':_0x491bd7[_0x9fe9('0x9')]?_0x491bd7[_0x9fe9('0x9')]['limit']||null:null,'include':_0x491bd7[_0x9fe9('0x9')]?_0x491bd7[_0x9fe9('0x9')][_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x491bd7['options'][_0x9fe9('0xd')],function(_0x59edf5){return{'model':db[_0x59edf5['model']],'as':_0x59edf5['as'],'attributes':_0x59edf5[_0x9fe9('0xc')],'include':_0x59edf5['include']?_['map'](_0x59edf5['include'],function(_0x202fa9){return{'model':db[_0x202fa9['model']],'as':_0x202fa9['as'],'attributes':_0x202fa9[_0x9fe9('0xc')],'include':_0x202fa9[_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x202fa9['include'],function(_0x5b54da){return{'model':db[_0x5b54da[_0x9fe9('0xf')]],'as':_0x5b54da['as'],'attributes':_0x5b54da['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1efae5){logger[_0x9fe9('0x10')](_0x9fe9('0x6'),_0x491bd7);logger[_0x9fe9('0x11')]('GetCmHopper',_0x491bd7,JSON[_0x9fe9('0x12')](_0x1efae5));_0x225984(_0x1efae5);})[_0x9fe9('0x13')](function(_0x4d5d93){logger[_0x9fe9('0x14')](_0x9fe9('0x6'),_0x4d5d93[_0x9fe9('0x15')],_0x491bd7);_0x2b043f(_0x2dbfae[_0x9fe9('0x14')](0x1f4,_0x4d5d93['message']));});});};exports[_0x9fe9('0x16')]=function(_0x2cc797){var _0x1c2733=this;return new Promise(function(_0x4aaeea,_0x6e117c){return db[_0x9fe9('0x7')][_0x9fe9('0x17')]({'raw':_0x2cc797[_0x9fe9('0x9')]?_0x2cc797[_0x9fe9('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x2cc797['options']?_0x2cc797[_0x9fe9('0x9')][_0x9fe9('0xb')]||null:null,'attributes':_0x2cc797[_0x9fe9('0x9')]?_0x2cc797['options']['attributes']||null:null,'include':_0x2cc797[_0x9fe9('0x9')]?_0x2cc797[_0x9fe9('0x9')][_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x2cc797[_0x9fe9('0x9')][_0x9fe9('0xd')],function(_0x39c91f){return{'model':db[_0x39c91f[_0x9fe9('0xf')]],'as':_0x39c91f['as'],'attributes':_0x39c91f[_0x9fe9('0xc')],'include':_0x39c91f[_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x39c91f['include'],function(_0x149b30){return{'model':db[_0x149b30[_0x9fe9('0xf')]],'as':_0x149b30['as'],'attributes':_0x149b30[_0x9fe9('0xc')],'include':_0x149b30[_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x149b30[_0x9fe9('0xd')],function(_0x5c5dc8){return{'model':db[_0x5c5dc8[_0x9fe9('0xf')]],'as':_0x5c5dc8['as'],'attributes':_0x5c5dc8[_0x9fe9('0xc')]};}):[]};}):[]};}):[]:[]})[_0x9fe9('0x18')](function(_0x3958ea){logger['info']('ShowCmHopper',_0x2cc797);logger['debug'](_0x9fe9('0x16'),_0x2cc797,JSON[_0x9fe9('0x12')](_0x3958ea));_0x4aaeea(_0x3958ea);})['catch'](function(_0x382631){logger[_0x9fe9('0x14')](_0x9fe9('0x16'),_0x382631[_0x9fe9('0x15')],_0x2cc797);_0x6e117c(_0x1c2733[_0x9fe9('0x14')](0x1f4,_0x382631[_0x9fe9('0x15')]));});});};exports['CreateCmHopper']=function(_0x32a9d3){var _0xd0de6b=this;return new Promise(function(_0x3619e9,_0x1aedf6){return db['CmHopper']['create'](_0x32a9d3['body'],{'raw':_0x32a9d3[_0x9fe9('0x9')]?_0x32a9d3[_0x9fe9('0x9')]['raw']===undefined?!![]:![]:!![]})[_0x9fe9('0x18')](function(_0x388623){logger[_0x9fe9('0x10')]('CreateCmHopper',_0x32a9d3);logger[_0x9fe9('0x11')](_0x9fe9('0x19'),_0x32a9d3,JSON[_0x9fe9('0x12')](_0x388623));_0x3619e9(_0x388623);})[_0x9fe9('0x13')](function(_0x5def50){logger[_0x9fe9('0x14')]('CreateCmHopper',_0x5def50[_0x9fe9('0x15')],_0x32a9d3);_0x1aedf6(_0xd0de6b[_0x9fe9('0x14')](0x1f4,_0x5def50['message']));});});};exports[_0x9fe9('0x1a')]=function(_0x281bd8){var _0x111faa=this;return new Promise(function(_0x6d2f7e,_0x415e24){return db[_0x9fe9('0x7')][_0x9fe9('0x1b')](_0x281bd8['body'],{'raw':_0x281bd8[_0x9fe9('0x9')]?_0x281bd8[_0x9fe9('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x281bd8[_0x9fe9('0x9')]?_0x281bd8['options'][_0x9fe9('0xb')]||null:null,'attributes':_0x281bd8['options']?_0x281bd8[_0x9fe9('0x9')][_0x9fe9('0xc')]||null:null,'limit':_0x281bd8['options']?_0x281bd8[_0x9fe9('0x9')]['limit']||null:null})[_0x9fe9('0x18')](function(_0x346a5a){logger[_0x9fe9('0x10')]('UpdateCmHopper',_0x281bd8);logger[_0x9fe9('0x10')](_0x9fe9('0x1c'),JSON[_0x9fe9('0x12')](_0x281bd8[_0x9fe9('0x9')][_0x9fe9('0xb')]),_0x281bd8[_0x9fe9('0x1d')][_0x9fe9('0x1e')]);logger['debug'](_0x9fe9('0x1a'),_0x281bd8,JSON['stringify'](_0x346a5a));_0x6d2f7e(_0x346a5a);})[_0x9fe9('0x13')](function(_0x1d95a1){logger[_0x9fe9('0x14')]('UpdateCmHopper',_0x1d95a1[_0x9fe9('0x15')],_0x281bd8);_0x415e24(_0x111faa[_0x9fe9('0x14')](0x1f4,_0x1d95a1[_0x9fe9('0x15')]));});});};exports[_0x9fe9('0x1f')]=function(_0x554891){var _0x39932a=this;return new Promise(function(_0x502f7d,_0x1adec9){return db[_0x9fe9('0x7')][_0x9fe9('0x20')]({'where':_0x554891[_0x9fe9('0x9')]?_0x554891[_0x9fe9('0x9')][_0x9fe9('0xb')]||null:null})[_0x9fe9('0x18')](function(_0x219075){logger['info'](_0x9fe9('0x1f'),_0x554891);logger[_0x9fe9('0x11')](_0x9fe9('0x1f'),_0x554891,JSON[_0x9fe9('0x12')](_0x219075));_0x502f7d(_0x219075);})[_0x9fe9('0x13')](function(_0x34ca97){logger[_0x9fe9('0x14')](_0x9fe9('0x1f'),_0x34ca97[_0x9fe9('0x15')],_0x554891);_0x1adec9(_0x39932a[_0x9fe9('0x14')](0x1f4,_0x34ca97[_0x9fe9('0x15')]));});});};exports[_0x9fe9('0x21')]=function(_0x58e080){var _0x5f4513=this;return new Promise(function(_0x16c27d,_0x18d75f){return db[_0x9fe9('0x22')]['describe']()['then'](function(_0x2128f2){return db['sequelize'][_0x9fe9('0x23')](function(_0x46b397){return db['CmHopper'][_0x9fe9('0x8')]({'where':_0x58e080[_0x9fe9('0x9')]?_0x58e080['options']['where']||null:null,'attributes':_0x58e080[_0x9fe9('0x9')]?_0x58e080[_0x9fe9('0x9')][_0x9fe9('0xc')]||null:null,'limit':_0x58e080[_0x9fe9('0x9')]?_0x58e080[_0x9fe9('0x9')][_0x9fe9('0x24')]||null:null,'order':_0x58e080['options']?_0x58e080[_0x9fe9('0x9')][_0x9fe9('0x25')]||null:null,'transaction':_0x46b397,'lock':_0x46b397[_0x9fe9('0x26')]['UPDATE'],'include':[{'model':db[_0x9fe9('0x22')],'as':'Contact','attributes':_[_0x9fe9('0x27')](_0x2128f2)},{'model':db[_0x9fe9('0x28')],'as':_0x9fe9('0x29'),'attributes':['id',_0x9fe9('0x2a'),_0x9fe9('0x2b')]}]})[_0x9fe9('0x18')](function(_0x5806e1){var _0x16d89f=[];var _0x575cf3=[];for(var _0x42a947=0x0;_0x42a947<_0x5806e1['length'];_0x42a947+=0x1){var _0x542ae6=_0x5806e1[_0x42a947][_0x9fe9('0x2c')];if(_0x542ae6===null){_0x16d89f[_0x9fe9('0x2d')](_0x5806e1[_0x42a947][_0x9fe9('0x1b')](_0x58e080[_0x9fe9('0x1d')],{'transaction':_0x46b397}));}else if(!_0x575cf3['includes'](_0x542ae6)){_0x575cf3['push'](_0x542ae6);_0x16d89f[_0x9fe9('0x2d')](_0x5806e1[_0x42a947]['update'](_0x58e080[_0x9fe9('0x1d')],{'transaction':_0x46b397}));}}return BPromise[_0x9fe9('0x2e')](_0x16d89f);});})['then'](function(_0x3244af){logger[_0x9fe9('0x10')](_0x9fe9('0x21'),_0x58e080);if(_0x3244af[_0x9fe9('0x2f')]>0x0){logger['info'](_0x9fe9('0x30'),_0x3244af[0x0]['dataValues']['id'],_0x3244af[0x0]['dataValues'][_0x9fe9('0x31')],_0x3244af[0x0][_0x9fe9('0x32')][_0x9fe9('0x1e')]);}logger[_0x9fe9('0x11')](_0x9fe9('0x21'),_0x58e080,JSON['stringify'](_0x3244af));_0x16c27d(_0x3244af);})['catch'](function(_0x214699){logger[_0x9fe9('0x14')](_0x9fe9('0x21'),_0x214699[_0x9fe9('0x15')],_0x58e080);_0x18d75f(_0x5f4513[_0x9fe9('0x14')](0x1f4,_0x214699['message']));});});});};exports[_0x9fe9('0x33')]=function(_0xc4479a){var _0xbd1130=this;return new Promise(function(_0x1483ab,_0x43d9e8){return db['sequelize'][_0x9fe9('0x23')](function(_0x509a1a){return db['CmHopperFinal'][_0x9fe9('0x34')](_0xc4479a[_0x9fe9('0x1d')],{'raw':_0xc4479a['options']?_0xc4479a[_0x9fe9('0x9')][_0x9fe9('0xa')]===undefined?!![]:![]:!![],'transaction':_0x509a1a})['then'](function(){logger[_0x9fe9('0x10')](_0x9fe9('0x35'),JSON[_0x9fe9('0x12')](_0xc4479a[_0x9fe9('0x9')]['where']),_0xc4479a[_0x9fe9('0x9')][_0x9fe9('0xb')][_0x9fe9('0x1e')]);return db['CmHopper'][_0x9fe9('0x20')]({'where':_0xc4479a[_0x9fe9('0x9')]?_0xc4479a[_0x9fe9('0x9')]['where']||null:null,'transaction':_0x509a1a});});})[_0x9fe9('0x18')](function(_0x3e0df0){logger[_0x9fe9('0x10')](_0x9fe9('0x33'),_0xc4479a);logger[_0x9fe9('0x11')](_0x9fe9('0x33'),_0xc4479a,JSON['stringify'](_0x3e0df0));_0x1483ab(_0x3e0df0);})[_0x9fe9('0x13')](function(_0x3c11cb){logger[_0x9fe9('0x14')](_0x9fe9('0x33'),_0x3c11cb[_0x9fe9('0x15')],_0xc4479a);_0x43d9e8(_0xbd1130['error'](0x1f4,_0x3c11cb[_0x9fe9('0x15')]));});});};exports[_0x9fe9('0x36')]=function(_0x2f170d){var _0xf7ca17=this;return new Promise(function(_0x4f3b76,_0x22f9aa){return db[_0x9fe9('0x7')][_0x9fe9('0x8')]({'raw':_0x2f170d[_0x9fe9('0x9')]?_0x2f170d[_0x9fe9('0x9')][_0x9fe9('0xa')]===undefined?!![]:![]:!![],'where':_0x2f170d[_0x9fe9('0x9')]?_0x2f170d[_0x9fe9('0x9')]['where']||null:null,'attributes':[[db[_0x9fe9('0x37')]['fn'](_0x9fe9('0x38'),db['sequelize']['fn']('IF',db[_0x9fe9('0x37')]['literal']('`scheduledat`\x20>=\x20'+util[_0x9fe9('0x39')](_0x9fe9('0x3a'),moment()[_0x9fe9('0x39')](_0x9fe9('0x3b')))+'\x20,\x201,\x20null'))),_0x9fe9('0x3c')]]})[_0x9fe9('0x18')](function(_0x5cc31e){logger['info'](_0x9fe9('0x36'),_0x2f170d);logger[_0x9fe9('0x11')](_0x9fe9('0x36'),_0x2f170d,JSON[_0x9fe9('0x12')](_0x5cc31e));_0x4f3b76(_0x5cc31e);})[_0x9fe9('0x13')](function(_0x10a9b1){logger[_0x9fe9('0x14')](_0x9fe9('0x36'),_0x10a9b1[_0x9fe9('0x15')],_0x2f170d);_0x22f9aa(_0xf7ca17['error'](0x1f4,_0x10a9b1['message']));});});};exports[_0x9fe9('0x3d')]=function(_0x2ef570){var _0x15600c=this;return new Promise(function(_0x23fc41,_0x265c53){return db[_0x9fe9('0x22')][_0x9fe9('0x3e')]()[_0x9fe9('0x18')](function(){return db['sequelize'][_0x9fe9('0x23')](function(_0x3c3e8e){return db[_0x9fe9('0x7')][_0x9fe9('0x8')]({'where':_0x2ef570[_0x9fe9('0x9')]?_0x2ef570[_0x9fe9('0x9')][_0x9fe9('0xb')]||null:null,'attributes':_0x2ef570[_0x9fe9('0x9')]?_0x2ef570[_0x9fe9('0x9')][_0x9fe9('0xc')]||null:null,'limit':0x1,'order':_0x2ef570['options']?_0x2ef570[_0x9fe9('0x9')][_0x9fe9('0x25')]||null:null,'group':db[_0x9fe9('0x7')][_0x9fe9('0x2c')],'transaction':_0x3c3e8e,'lock':_0x3c3e8e['LOCK'][_0x9fe9('0x3f')],'include':_0x2ef570[_0x9fe9('0x9')]?_0x2ef570[_0x9fe9('0x9')][_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x2ef570[_0x9fe9('0x9')][_0x9fe9('0xd')],function(_0x435444){return{'model':db[_0x435444['model']],'as':_0x435444['as'],'attributes':_0x435444[_0x9fe9('0xc')],'include':_0x435444[_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x435444[_0x9fe9('0xd')],function(_0x53742c){return{'model':db[_0x53742c[_0x9fe9('0xf')]],'as':_0x53742c['as'],'attributes':_0x53742c[_0x9fe9('0xc')],'include':_0x53742c[_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x53742c['include'],function(_0x5e4e7b){return{'model':db[_0x5e4e7b[_0x9fe9('0xf')]],'as':_0x5e4e7b['as'],'attributes':_0x5e4e7b[_0x9fe9('0xc')]};}):[]};}):[]};}):[]:[]})[_0x9fe9('0x18')](function(_0x211fce){var _0xcd8f13=[];for(var _0x16fb90=0x0;_0x16fb90<_0x211fce[_0x9fe9('0x2f')];_0x16fb90+=0x1){_0xcd8f13[_0x9fe9('0x2d')](_0x211fce[_0x16fb90]['update'](_0x2ef570[_0x9fe9('0x1d')],{'transaction':_0x3c3e8e}));}return BPromise[_0x9fe9('0x2e')](_0xcd8f13);});})['then'](function(_0x1af56d){logger[_0x9fe9('0x10')](_0x9fe9('0x3d'),_0x2ef570);logger[_0x9fe9('0x11')](_0x9fe9('0x3d'),_0x2ef570,JSON[_0x9fe9('0x12')](_0x1af56d));_0x23fc41(_0x1af56d);})[_0x9fe9('0x13')](function(_0x5eaf51){logger[_0x9fe9('0x14')](_0x9fe9('0x3d'),_0x5eaf51['message'],_0x2ef570);_0x265c53(_0x15600c[_0x9fe9('0x14')](0x1f4,_0x5eaf51[_0x9fe9('0x15')]));});});});};exports[_0x9fe9('0x40')]=function(_0xe9e65){var _0x32269a=this;return new Promise(function(_0x2a6732,_0x35821d){db[_0x9fe9('0x22')][_0x9fe9('0x3e')]()['then'](function(_0x5ea749){return db[_0x9fe9('0x7')][_0x9fe9('0x8')]({'raw':_0xe9e65[_0x9fe9('0x9')]?_0xe9e65['options'][_0x9fe9('0xa')]===undefined?!![]:![]:!![],'where':_0xe9e65[_0x9fe9('0x9')]?_0xe9e65[_0x9fe9('0x9')][_0x9fe9('0xb')]||null:null,'attributes':_0xe9e65[_0x9fe9('0x9')]?_0xe9e65[_0x9fe9('0x9')][_0x9fe9('0xc')]||null:null,'limit':_0xe9e65['options']?_0xe9e65[_0x9fe9('0x9')]['limit']||null:null,'include':_0xe9e65['options']?_0xe9e65[_0x9fe9('0x9')][_0x9fe9('0xd')]?_['map'](_0xe9e65[_0x9fe9('0x9')][_0x9fe9('0xd')],function(_0x212600){return{'model':db[_0x212600[_0x9fe9('0xf')]],'as':_0x212600['as'],'attributes':_0x212600['as']===_0x9fe9('0x41')?_[_0x9fe9('0x27')](_0x5ea749):_0x212600[_0x9fe9('0xc')],'include':_0x212600[_0x9fe9('0xd')]?_[_0x9fe9('0xe')](_0x212600[_0x9fe9('0xd')],function(_0x2ff767){return{'model':db[_0x2ff767['model']],'as':_0x2ff767['as'],'attributes':_0x2ff767['attributes'],'include':_0x2ff767['include']?_[_0x9fe9('0xe')](_0x2ff767[_0x9fe9('0xd')],function(_0x2f6120){return{'model':db[_0x2f6120['model']],'as':_0x2f6120['as'],'attributes':_0x2f6120[_0x9fe9('0xc')]};}):[]};}):[]};}):[]:[]})[_0x9fe9('0x18')](function(_0x2d138d){logger[_0x9fe9('0x10')](_0x9fe9('0x6'),_0xe9e65);logger[_0x9fe9('0x11')](_0x9fe9('0x6'),_0xe9e65,JSON['stringify'](_0x2d138d));_0x2a6732(_0x2d138d);})[_0x9fe9('0x13')](function(_0x5a6b90){logger[_0x9fe9('0x14')](_0x9fe9('0x6'),_0x5a6b90[_0x9fe9('0x15')],_0xe9e65);_0x35821d(_0x32269a[_0x9fe9('0x14')](0x1f4,_0x5a6b90['message']));});});});};exports[_0x9fe9('0x42')]=function(_0x1a733d){var _0x3c6d22=this;return new Promise(function(_0x1009d0,_0x3388aa){return db['CmContact'][_0x9fe9('0x43')]({'raw':!![],'where':{'phone':_0x1a733d[_0x9fe9('0x9')]['where']['phone']},'attributes':['id',_0x9fe9('0x44')],'order':[['id','DESC']]})['then'](function(_0x5b9527){logger['info'](_0x9fe9('0x45'),_0x1a733d);logger['debug'](_0x9fe9('0x45'),_0x1a733d,JSON[_0x9fe9('0x12')](_0x5b9527));_0x1009d0(_0x5b9527);})['catch'](function(_0x2f3ce4){logger[_0x9fe9('0x14')](_0x9fe9('0x45'),_0x2f3ce4['message'],_0x1a733d);_0x3388aa(_0x3c6d22['error'](0x1f4,_0x2f3ce4[_0x9fe9('0x15')]));});});};exports[_0x9fe9('0x46')]=function(_0x3acaea){var _0x1f923f=this;return new Promise(function(_0x403f32,_0x39e9c7){return db[_0x9fe9('0x37')][_0x9fe9('0x23')](function(_0x388673){var _0x4ad916=_0x3acaea['options']&&_0x3acaea[_0x9fe9('0x9')][_0x9fe9('0xb')]?_0x3acaea[_0x9fe9('0x9')][_0x9fe9('0xb')]:{};return db[_0x9fe9('0x7')]['update'](_0x3acaea[_0x9fe9('0x1d')],{'where':_0x4ad916,'transaction':_0x388673})['then'](function(_0xe9ce02){logger[_0x9fe9('0x10')](_0x9fe9('0x46'),_0x3acaea);logger[_0x9fe9('0x11')]('ResetActiveCalls',_0x3acaea,JSON['stringify'](_0xe9ce02));_0x403f32(_0xe9ce02);})[_0x9fe9('0x13')](function(_0x4da6e9){logger['error']('ResetActiveCalls',_0x4da6e9[_0x9fe9('0x15')],_0x3acaea);_0x39e9c7(_0x1f923f[_0x9fe9('0x14')](0x1f4,_0x4da6e9[_0x9fe9('0x15')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x508062){var _0x2f218d=this;var _0x5069ae=_0x508062['body'][_0x9fe9('0xb')]['voiceQueueIds'];var _0x1de732=_0x508062[_0x9fe9('0x1d')]['where']['interval'];var _0x2ba235=_0x508062[_0x9fe9('0x1d')][_0x9fe9('0xb')]['availableAgentsIds'];return new Promise(function(_0x5f4a61,_0x2c366d){return db['CmHopper'][_0x9fe9('0x8')]({'where':{'voiceQueueId':{'$in':_0x5069ae},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x9fe9('0x47')](_0x9fe9('0x48')+_0x1de732+'\x20MINUTE'),'$gt':db[_0x9fe9('0x37')][_0x9fe9('0x47')](_0x9fe9('0x49'))}},'UserId':{'$in':_0x2ba235}},'include':[{'model':db[_0x9fe9('0x22')],'as':'Contact'},{'model':db[_0x9fe9('0x28')],'as':_0x9fe9('0x29'),'attributes':['id',_0x9fe9('0x2a'),_0x9fe9('0x2b')]},{'model':db[_0x9fe9('0x4a')],'as':_0x9fe9('0x4b')}]})[_0x9fe9('0x18')](function(_0x599451){if(_0x599451[_0x9fe9('0x2f')]>0x0){return db[_0x9fe9('0x37')]['transaction'](function(_0x2c74c5){return db[_0x9fe9('0x7')][_0x9fe9('0x1b')]({'recallmeNotifiedDate':db[_0x9fe9('0x37')][_0x9fe9('0x47')](_0x9fe9('0x49'))},{'where':{'id':{'$in':_[_0x9fe9('0xe')](_0x599451,'id')}},'transaction':_0x2c74c5})[_0x9fe9('0x18')](function(){_0x5f4a61(_0x599451);})[_0x9fe9('0x13')](function(_0x48cbb9){logger[_0x9fe9('0x14')](_0x9fe9('0x4c'),_0x48cbb9[_0x9fe9('0x15')],_0x508062);_0x2c366d(_0x2f218d['error'](0x1f4,_0x48cbb9[_0x9fe9('0x15')]));});})[_0x9fe9('0x13')](function(_0x31f9a0){logger[_0x9fe9('0x14')](_0x9fe9('0x4c'),_0x31f9a0[_0x9fe9('0x15')],_0x508062);_0x2c366d(_0x2f218d[_0x9fe9('0x14')](0x1f4,_0x31f9a0[_0x9fe9('0x15')]));});}else{_0x5f4a61(_0x599451);}});});}; \ No newline at end of file +var _0x4f34=['List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','model','include','then','info','debug','stringify','error','message','ShowCmHopper','find','catch','CreateCmHopper','create','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','UserId','update','includes','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','voicePause','CmList'];(function(_0x470d13,_0x3f22fa){var _0x18cc32=function(_0x58b827){while(--_0x58b827){_0x470d13['push'](_0x470d13['shift']());}};_0x18cc32(++_0x3f22fa);}(_0x4f34,0xae));var _0x44f3=function(_0x2dee81,_0x58c3df){_0x2dee81=_0x2dee81-0x0;var _0xa3a214=_0x4f34[_0x2dee81];return _0xa3a214;};'use strict';var _=require(_0x44f3('0x0'));var util=require(_0x44f3('0x1'));var moment=require(_0x44f3('0x2'));var BPromise=require(_0x44f3('0x3'));var db=require(_0x44f3('0x4'))['db'];var logger=require(_0x44f3('0x5'))(_0x44f3('0x6'));exports[_0x44f3('0x7')]=function(_0x485752){var _0x3c5e88=this;return new Promise(function(_0x33b6ac,_0xfd29d7){return db[_0x44f3('0x8')][_0x44f3('0x9')]({'raw':_0x485752[_0x44f3('0xa')]?_0x485752['options'][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0x485752['options']?_0x485752[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'attributes':_0x485752[_0x44f3('0xa')]?_0x485752[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':_0x485752[_0x44f3('0xa')]?_0x485752[_0x44f3('0xa')][_0x44f3('0xe')]||null:null,'include':_0x485752['options']?_0x485752['options']['include']?_[_0x44f3('0xf')](_0x485752[_0x44f3('0xa')]['include'],function(_0x17f25a){return{'model':db[_0x17f25a[_0x44f3('0x10')]],'as':_0x17f25a['as'],'attributes':_0x17f25a[_0x44f3('0xd')],'include':_0x17f25a[_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x17f25a[_0x44f3('0x11')],function(_0x41d4ee){return{'model':db[_0x41d4ee['model']],'as':_0x41d4ee['as'],'attributes':_0x41d4ee[_0x44f3('0xd')],'include':_0x41d4ee[_0x44f3('0x11')]?_['map'](_0x41d4ee[_0x44f3('0x11')],function(_0x3de4df){return{'model':db[_0x3de4df[_0x44f3('0x10')]],'as':_0x3de4df['as'],'attributes':_0x3de4df[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x12')](function(_0x4fd26d){logger[_0x44f3('0x13')](_0x44f3('0x7'),_0x485752);logger[_0x44f3('0x14')](_0x44f3('0x7'),_0x485752,JSON[_0x44f3('0x15')](_0x4fd26d));_0x33b6ac(_0x4fd26d);})['catch'](function(_0x147495){logger[_0x44f3('0x16')](_0x44f3('0x7'),_0x147495[_0x44f3('0x17')],_0x485752);_0xfd29d7(_0x3c5e88[_0x44f3('0x16')](0x1f4,_0x147495[_0x44f3('0x17')]));});});};exports[_0x44f3('0x18')]=function(_0x4cf4dd){var _0x2c8514=this;return new Promise(function(_0x316693,_0x52d04c){return db[_0x44f3('0x8')][_0x44f3('0x19')]({'raw':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd['options'][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'attributes':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'include':_0x4cf4dd[_0x44f3('0xa')]?_0x4cf4dd['options']['include']?_[_0x44f3('0xf')](_0x4cf4dd[_0x44f3('0xa')][_0x44f3('0x11')],function(_0x332663){return{'model':db[_0x332663[_0x44f3('0x10')]],'as':_0x332663['as'],'attributes':_0x332663[_0x44f3('0xd')],'include':_0x332663[_0x44f3('0x11')]?_['map'](_0x332663['include'],function(_0x2414bb){return{'model':db[_0x2414bb['model']],'as':_0x2414bb['as'],'attributes':_0x2414bb['attributes'],'include':_0x2414bb['include']?_[_0x44f3('0xf')](_0x2414bb[_0x44f3('0x11')],function(_0x421531){return{'model':db[_0x421531[_0x44f3('0x10')]],'as':_0x421531['as'],'attributes':_0x421531[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x12')](function(_0x8f8d04){logger[_0x44f3('0x13')](_0x44f3('0x18'),_0x4cf4dd);logger[_0x44f3('0x14')](_0x44f3('0x18'),_0x4cf4dd,JSON[_0x44f3('0x15')](_0x8f8d04));_0x316693(_0x8f8d04);})[_0x44f3('0x1a')](function(_0x170e48){logger[_0x44f3('0x16')](_0x44f3('0x18'),_0x170e48[_0x44f3('0x17')],_0x4cf4dd);_0x52d04c(_0x2c8514[_0x44f3('0x16')](0x1f4,_0x170e48[_0x44f3('0x17')]));});});};exports[_0x44f3('0x1b')]=function(_0x513677){var _0x3bf583=this;return new Promise(function(_0x39b091,_0x7ec595){return db['CmHopper'][_0x44f3('0x1c')](_0x513677[_0x44f3('0x1d')],{'raw':_0x513677[_0x44f3('0xa')]?_0x513677[_0x44f3('0xa')][_0x44f3('0xb')]===undefined?!![]:![]:!![]})['then'](function(_0x282de0){logger['info'](_0x44f3('0x1b'),_0x513677);logger[_0x44f3('0x14')]('CreateCmHopper',_0x513677,JSON[_0x44f3('0x15')](_0x282de0));_0x39b091(_0x282de0);})[_0x44f3('0x1a')](function(_0x5d4e43){logger[_0x44f3('0x16')]('CreateCmHopper',_0x5d4e43['message'],_0x513677);_0x7ec595(_0x3bf583['error'](0x1f4,_0x5d4e43[_0x44f3('0x17')]));});});};exports['UpdateCmHopper']=function(_0x496b07){var _0x161afb=this;return new Promise(function(_0x5a6c5b,_0x4572f5){return db[_0x44f3('0x8')]['update'](_0x496b07[_0x44f3('0x1d')],{'raw':_0x496b07[_0x44f3('0xa')]?_0x496b07['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496b07['options']?_0x496b07['options'][_0x44f3('0xc')]||null:null,'attributes':_0x496b07[_0x44f3('0xa')]?_0x496b07[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':_0x496b07[_0x44f3('0xa')]?_0x496b07['options'][_0x44f3('0xe')]||null:null})['then'](function(_0x4f3d9){logger[_0x44f3('0x13')]('UpdateCmHopper',_0x496b07);logger[_0x44f3('0x13')](_0x44f3('0x1e'),JSON['stringify'](_0x496b07[_0x44f3('0xa')][_0x44f3('0xc')]),_0x496b07['body']['active']);logger[_0x44f3('0x14')]('UpdateCmHopper',_0x496b07,JSON[_0x44f3('0x15')](_0x4f3d9));_0x5a6c5b(_0x4f3d9);})['catch'](function(_0x48345d){logger[_0x44f3('0x16')](_0x44f3('0x1f'),_0x48345d[_0x44f3('0x17')],_0x496b07);_0x4572f5(_0x161afb[_0x44f3('0x16')](0x1f4,_0x48345d['message']));});});};exports['DestroyCmHopper']=function(_0x595d9d){var _0x377cdb=this;return new Promise(function(_0x21aa64,_0x518ce9){return db[_0x44f3('0x8')][_0x44f3('0x20')]({'where':_0x595d9d[_0x44f3('0xa')]?_0x595d9d[_0x44f3('0xa')]['where']||null:null})['then'](function(_0x58d6ef){logger['info'](_0x44f3('0x21'),_0x595d9d);logger[_0x44f3('0x14')](_0x44f3('0x21'),_0x595d9d,JSON[_0x44f3('0x15')](_0x58d6ef));_0x21aa64(_0x58d6ef);})[_0x44f3('0x1a')](function(_0x809476){logger[_0x44f3('0x16')]('DestroyCmHopper',_0x809476['message'],_0x595d9d);_0x518ce9(_0x377cdb['error'](0x1f4,_0x809476[_0x44f3('0x17')]));});});};exports[_0x44f3('0x22')]=function(_0xb511a3){var _0x298f00=this;return new Promise(function(_0x2e2724,_0xcb9b19){return db['CmContact'][_0x44f3('0x23')]()[_0x44f3('0x12')](function(_0x2ce287){return db[_0x44f3('0x24')][_0x44f3('0x25')](function(_0xf13466){return db[_0x44f3('0x8')]['findAll']({'where':_0xb511a3['options']?_0xb511a3['options'][_0x44f3('0xc')]||null:null,'attributes':_0xb511a3['options']?_0xb511a3[_0x44f3('0xa')]['attributes']||null:null,'limit':_0xb511a3[_0x44f3('0xa')]?_0xb511a3[_0x44f3('0xa')][_0x44f3('0xe')]||null:null,'order':_0xb511a3[_0x44f3('0xa')]?_0xb511a3['options'][_0x44f3('0x26')]||null:null,'transaction':_0xf13466,'lock':_0xf13466[_0x44f3('0x27')][_0x44f3('0x28')],'include':[{'model':db[_0x44f3('0x29')],'as':_0x44f3('0x2a'),'attributes':_[_0x44f3('0x2b')](_0x2ce287)},{'model':db[_0x44f3('0x2c')],'as':_0x44f3('0x2d'),'attributes':['id',_0x44f3('0x2e'),'voicePause']}]})['then'](function(_0x53da11){var _0x3b3076=[];var _0x54a690=[];for(var _0x34f90f=0x0;_0x34f90f<_0x53da11['length'];_0x34f90f+=0x1){var _0x5a189e=_0x53da11[_0x34f90f][_0x44f3('0x2f')];if(_0x5a189e===null){_0x3b3076['push'](_0x53da11[_0x34f90f][_0x44f3('0x30')](_0xb511a3[_0x44f3('0x1d')],{'transaction':_0xf13466}));}else if(!_0x54a690[_0x44f3('0x31')](_0x5a189e)){_0x54a690[_0x44f3('0x32')](_0x5a189e);_0x3b3076['push'](_0x53da11[_0x34f90f][_0x44f3('0x30')](_0xb511a3[_0x44f3('0x1d')],{'transaction':_0xf13466}));}}return BPromise[_0x44f3('0x33')](_0x3b3076);});})[_0x44f3('0x12')](function(_0x18bdea){logger['info'](_0x44f3('0x22'),_0xb511a3);if(_0x18bdea[_0x44f3('0x34')]>0x0){logger['info'](_0x44f3('0x35'),_0x18bdea[0x0][_0x44f3('0x36')]['id'],_0x18bdea[0x0][_0x44f3('0x36')][_0x44f3('0x37')],_0x18bdea[0x0][_0x44f3('0x36')][_0x44f3('0x38')]);}logger[_0x44f3('0x14')](_0x44f3('0x22'),_0xb511a3,JSON['stringify'](_0x18bdea));_0x2e2724(_0x18bdea);})[_0x44f3('0x1a')](function(_0x5cd1cb){logger['error'](_0x44f3('0x22'),_0x5cd1cb[_0x44f3('0x17')],_0xb511a3);_0xcb9b19(_0x298f00[_0x44f3('0x16')](0x1f4,_0x5cd1cb['message']));});});});};exports[_0x44f3('0x39')]=function(_0x278d72){var _0x46d8af=this;return new Promise(function(_0x490dbb,_0x379fb7){return db[_0x44f3('0x24')][_0x44f3('0x25')](function(_0x26641f){return db[_0x44f3('0x3a')]['create'](_0x278d72[_0x44f3('0x1d')],{'raw':_0x278d72[_0x44f3('0xa')]?_0x278d72[_0x44f3('0xa')]['raw']===undefined?!![]:![]:!![],'transaction':_0x26641f})['then'](function(){logger['info'](_0x44f3('0x3b'),JSON['stringify'](_0x278d72[_0x44f3('0xa')][_0x44f3('0xc')]),_0x278d72['options']['where']['active']);return db['CmHopper'][_0x44f3('0x20')]({'where':_0x278d72[_0x44f3('0xa')]?_0x278d72[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'transaction':_0x26641f});});})[_0x44f3('0x12')](function(_0x234c24){logger[_0x44f3('0x13')]('MoveContactManagedDialer',_0x278d72);logger[_0x44f3('0x14')]('MoveContactManagedDialer',_0x278d72,JSON[_0x44f3('0x15')](_0x234c24));_0x490dbb(_0x234c24);})[_0x44f3('0x1a')](function(_0x28f438){logger[_0x44f3('0x16')]('MoveContactManagedDialer',_0x28f438[_0x44f3('0x17')],_0x278d72);_0x379fb7(_0x46d8af[_0x44f3('0x16')](0x1f4,_0x28f438[_0x44f3('0x17')]));});});};exports[_0x44f3('0x3c')]=function(_0xd5897a){var _0x115f47=this;return new Promise(function(_0x21e300,_0x4e2c8c){return db[_0x44f3('0x8')][_0x44f3('0x9')]({'raw':_0xd5897a['options']?_0xd5897a[_0x44f3('0xa')][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0xd5897a[_0x44f3('0xa')]?_0xd5897a[_0x44f3('0xa')][_0x44f3('0xc')]||null:null,'attributes':[[db[_0x44f3('0x24')]['fn'](_0x44f3('0x3d'),db[_0x44f3('0x24')]['fn']('IF',db[_0x44f3('0x24')][_0x44f3('0x3e')](_0x44f3('0x3f')+util[_0x44f3('0x40')](_0x44f3('0x41'),moment()[_0x44f3('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x44f3('0x42')))),_0x44f3('0x43')]]})[_0x44f3('0x12')](function(_0x1d47a4){logger['info'](_0x44f3('0x3c'),_0xd5897a);logger['debug']('CountReScheduled',_0xd5897a,JSON['stringify'](_0x1d47a4));_0x21e300(_0x1d47a4);})[_0x44f3('0x1a')](function(_0x391d59){logger[_0x44f3('0x16')]('CountReScheduled',_0x391d59[_0x44f3('0x17')],_0xd5897a);_0x4e2c8c(_0x115f47[_0x44f3('0x16')](0x1f4,_0x391d59[_0x44f3('0x17')]));});});};exports[_0x44f3('0x44')]=function(_0x4b97cd){var _0x4363f1=this;return new Promise(function(_0x3ac196,_0x2d7622){return db[_0x44f3('0x29')][_0x44f3('0x23')]()[_0x44f3('0x12')](function(){return db[_0x44f3('0x24')]['transaction'](function(_0xdb672e){return db['CmHopper'][_0x44f3('0x9')]({'where':_0x4b97cd[_0x44f3('0xa')]?_0x4b97cd[_0x44f3('0xa')]['where']||null:null,'attributes':_0x4b97cd[_0x44f3('0xa')]?_0x4b97cd[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':0x1,'order':_0x4b97cd[_0x44f3('0xa')]?_0x4b97cd['options'][_0x44f3('0x26')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0xdb672e,'lock':_0xdb672e[_0x44f3('0x27')][_0x44f3('0x28')],'include':_0x4b97cd['options']?_0x4b97cd[_0x44f3('0xa')][_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x4b97cd[_0x44f3('0xa')]['include'],function(_0x5f2c24){return{'model':db[_0x5f2c24[_0x44f3('0x10')]],'as':_0x5f2c24['as'],'attributes':_0x5f2c24['attributes'],'include':_0x5f2c24['include']?_[_0x44f3('0xf')](_0x5f2c24[_0x44f3('0x11')],function(_0x278be9){return{'model':db[_0x278be9[_0x44f3('0x10')]],'as':_0x278be9['as'],'attributes':_0x278be9[_0x44f3('0xd')],'include':_0x278be9['include']?_[_0x44f3('0xf')](_0x278be9[_0x44f3('0x11')],function(_0x2f6fd7){return{'model':db[_0x2f6fd7['model']],'as':_0x2f6fd7['as'],'attributes':_0x2f6fd7[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})[_0x44f3('0x12')](function(_0x348294){var _0x2276a8=[];for(var _0x1a9396=0x0;_0x1a9396<_0x348294[_0x44f3('0x34')];_0x1a9396+=0x1){_0x2276a8['push'](_0x348294[_0x1a9396][_0x44f3('0x30')](_0x4b97cd[_0x44f3('0x1d')],{'transaction':_0xdb672e}));}return BPromise[_0x44f3('0x33')](_0x2276a8);});})['then'](function(_0xab74a5){logger['info']('GetContactRecallMe',_0x4b97cd);logger['debug']('GetContactRecallMe',_0x4b97cd,JSON['stringify'](_0xab74a5));_0x3ac196(_0xab74a5);})['catch'](function(_0x493163){logger[_0x44f3('0x16')](_0x44f3('0x44'),_0x493163[_0x44f3('0x17')],_0x4b97cd);_0x2d7622(_0x4363f1[_0x44f3('0x16')](0x1f4,_0x493163[_0x44f3('0x17')]));});});});};exports[_0x44f3('0x45')]=function(_0x328abb){var _0x26df8d=this;return new Promise(function(_0x2c5515,_0x39b1cf){db['CmContact'][_0x44f3('0x23')]()['then'](function(_0x5a5b33){return db[_0x44f3('0x8')][_0x44f3('0x9')]({'raw':_0x328abb[_0x44f3('0xa')]?_0x328abb['options'][_0x44f3('0xb')]===undefined?!![]:![]:!![],'where':_0x328abb['options']?_0x328abb[_0x44f3('0xa')]['where']||null:null,'attributes':_0x328abb[_0x44f3('0xa')]?_0x328abb[_0x44f3('0xa')][_0x44f3('0xd')]||null:null,'limit':_0x328abb[_0x44f3('0xa')]?_0x328abb[_0x44f3('0xa')][_0x44f3('0xe')]||null:null,'include':_0x328abb[_0x44f3('0xa')]?_0x328abb[_0x44f3('0xa')]['include']?_['map'](_0x328abb[_0x44f3('0xa')][_0x44f3('0x11')],function(_0x1d1745){return{'model':db[_0x1d1745[_0x44f3('0x10')]],'as':_0x1d1745['as'],'attributes':_0x1d1745['as']===_0x44f3('0x2a')?_[_0x44f3('0x2b')](_0x5a5b33):_0x1d1745[_0x44f3('0xd')],'include':_0x1d1745[_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x1d1745['include'],function(_0x45d91e){return{'model':db[_0x45d91e[_0x44f3('0x10')]],'as':_0x45d91e['as'],'attributes':_0x45d91e[_0x44f3('0xd')],'include':_0x45d91e[_0x44f3('0x11')]?_[_0x44f3('0xf')](_0x45d91e[_0x44f3('0x11')],function(_0xa96f8d){return{'model':db[_0xa96f8d['model']],'as':_0xa96f8d['as'],'attributes':_0xa96f8d[_0x44f3('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa911f8){logger[_0x44f3('0x13')](_0x44f3('0x7'),_0x328abb);logger['debug'](_0x44f3('0x7'),_0x328abb,JSON[_0x44f3('0x15')](_0xa911f8));_0x2c5515(_0xa911f8);})['catch'](function(_0x2a22bf){logger['error'](_0x44f3('0x7'),_0x2a22bf[_0x44f3('0x17')],_0x328abb);_0x39b1cf(_0x26df8d[_0x44f3('0x16')](0x1f4,_0x2a22bf['message']));});});});};exports[_0x44f3('0x46')]=function(_0x124255){var _0xe4a24b=this;return new Promise(function(_0x2a6512,_0x297def){return db[_0x44f3('0x29')][_0x44f3('0x47')]({'raw':!![],'where':{'phone':_0x124255[_0x44f3('0xa')][_0x44f3('0xc')][_0x44f3('0x48')]},'attributes':['id',_0x44f3('0x49')],'order':[['id',_0x44f3('0x4a')]]})[_0x44f3('0x12')](function(_0x25eae3){logger[_0x44f3('0x13')](_0x44f3('0x4b'),_0x124255);logger[_0x44f3('0x14')]('getContactByPhone',_0x124255,JSON[_0x44f3('0x15')](_0x25eae3));_0x2a6512(_0x25eae3);})[_0x44f3('0x1a')](function(_0x4bc8b9){logger[_0x44f3('0x16')](_0x44f3('0x4b'),_0x4bc8b9[_0x44f3('0x17')],_0x124255);_0x297def(_0xe4a24b[_0x44f3('0x16')](0x1f4,_0x4bc8b9['message']));});});};exports[_0x44f3('0x4c')]=function(_0x55f443){var _0x14dd45=this;return new Promise(function(_0x1c3ef0,_0x202477){return db['sequelize']['transaction'](function(_0x5c1f49){var _0x50baf3=_0x55f443[_0x44f3('0xa')]&&_0x55f443[_0x44f3('0xa')][_0x44f3('0xc')]?_0x55f443[_0x44f3('0xa')][_0x44f3('0xc')]:{};return db[_0x44f3('0x8')][_0x44f3('0x30')](_0x55f443['body'],{'where':_0x50baf3,'transaction':_0x5c1f49})['then'](function(_0x13c1b4){logger[_0x44f3('0x13')](_0x44f3('0x4c'),_0x55f443);logger['debug'](_0x44f3('0x4c'),_0x55f443,JSON['stringify'](_0x13c1b4));_0x1c3ef0(_0x13c1b4);})[_0x44f3('0x1a')](function(_0x5ef058){logger[_0x44f3('0x16')](_0x44f3('0x4c'),_0x5ef058[_0x44f3('0x17')],_0x55f443);_0x202477(_0x14dd45[_0x44f3('0x16')](0x1f4,_0x5ef058[_0x44f3('0x17')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x12b1cb){var _0x2e645a=this;var _0x10e38d=_0x12b1cb['body'][_0x44f3('0xc')][_0x44f3('0x4d')];var _0x421b6c=_0x12b1cb[_0x44f3('0x1d')][_0x44f3('0xc')][_0x44f3('0x4e')];var _0x5c5056=_0x12b1cb[_0x44f3('0x1d')]['where'][_0x44f3('0x4f')];return new Promise(function(_0x3565ad,_0x2d0e3b){return db['CmHopper'][_0x44f3('0x9')]({'where':{'voiceQueueId':{'$in':_0x10e38d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x44f3('0x24')]['literal'](_0x44f3('0x50')+_0x421b6c+'\x20MINUTE'),'$gt':db[_0x44f3('0x24')]['literal'](_0x44f3('0x51'))}},'UserId':{'$in':_0x5c5056}},'include':[{'model':db[_0x44f3('0x29')],'as':_0x44f3('0x2a')},{'model':db[_0x44f3('0x2c')],'as':'Agent','attributes':['id',_0x44f3('0x2e'),_0x44f3('0x52')]},{'model':db[_0x44f3('0x53')],'as':_0x44f3('0x54')}]})[_0x44f3('0x12')](function(_0x8596f9){if(_0x8596f9['length']>0x0){return db[_0x44f3('0x24')][_0x44f3('0x25')](function(_0x5302ed){return db[_0x44f3('0x8')][_0x44f3('0x30')]({'recallmeNotifiedDate':db['sequelize'][_0x44f3('0x3e')](_0x44f3('0x51'))},{'where':{'id':{'$in':_[_0x44f3('0xf')](_0x8596f9,'id')}},'transaction':_0x5302ed})[_0x44f3('0x12')](function(){_0x3565ad(_0x8596f9);})[_0x44f3('0x1a')](function(_0x4e7f0e){logger[_0x44f3('0x16')](_0x44f3('0x55'),_0x4e7f0e[_0x44f3('0x17')],_0x12b1cb);_0x2d0e3b(_0x2e645a[_0x44f3('0x16')](0x1f4,_0x4e7f0e['message']));});})[_0x44f3('0x1a')](function(_0x2aba5d){logger[_0x44f3('0x16')](_0x44f3('0x55'),_0x2aba5d[_0x44f3('0x17')],_0x12b1cb);_0x2d0e3b(_0x2e645a[_0x44f3('0x16')](0x1f4,_0x2aba5d[_0x44f3('0x17')]));});}else{_0x3565ad(_0x8596f9);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3aeb83f..f95faab 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 _0x52ba=['/preview','getPreview','/timezone','getTimezone','put','/:id','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','getTimezones','show','getPreviewRecall','post'];(function(_0x1db4e7,_0x4c0fc5){var _0x4b0e2a=function(_0x346310){while(--_0x346310){_0x1db4e7['push'](_0x1db4e7['shift']());}};_0x4b0e2a(++_0x4c0fc5);}(_0x52ba,0x1d2));var _0xa52b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x52ba[_0x4a9fb1];return _0x348672;};'use strict';var express=require('express');var router=express[_0xa52b('0x0')]();var auth=require(_0xa52b('0x1'));var controller=require(_0xa52b('0x2'));router[_0xa52b('0x3')]('/',auth[_0xa52b('0x4')](),controller[_0xa52b('0x5')]);router['get'](_0xa52b('0x6'),auth[_0xa52b('0x4')](),controller[_0xa52b('0x7')]);router[_0xa52b('0x3')](_0xa52b('0x8'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xa52b('0x3')](_0xa52b('0x9'),auth['isAuthenticated'](),controller[_0xa52b('0xa')]);router[_0xa52b('0x3')]('/:id',auth[_0xa52b('0x4')](),controller[_0xa52b('0xb')]);router[_0xa52b('0x3')]('/:id/previewrecall',auth[_0xa52b('0x4')](),controller[_0xa52b('0xc')]);router[_0xa52b('0xd')]('/',auth[_0xa52b('0x4')](),controller['create']);router[_0xa52b('0xd')](_0xa52b('0xe'),auth['isAuthenticated'](),controller[_0xa52b('0xf')]);router[_0xa52b('0xd')](_0xa52b('0x10'),auth[_0xa52b('0x4')](),controller[_0xa52b('0x11')]);router[_0xa52b('0x12')](_0xa52b('0x13'),auth[_0xa52b('0x4')](),controller[_0xa52b('0x14')]);router[_0xa52b('0x15')](_0xa52b('0x13'),auth[_0xa52b('0x4')](),controller[_0xa52b('0x16')]);module[_0xa52b('0x17')]=router; \ No newline at end of file +var _0x7f4b=['../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','getOpenContacts','/timezones','/:id','getPreviewRecall','post','/preview','getPreview','getTimezone','update','destroy','exports','express','Router'];(function(_0x19017b,_0x56d52c){var _0x3becdc=function(_0x1e0fde){while(--_0x1e0fde){_0x19017b['push'](_0x19017b['shift']());}};_0x3becdc(++_0x56d52c);}(_0x7f4b,0x17a));var _0xb7f4=function(_0x15dafa,_0x3bd9b2){_0x15dafa=_0x15dafa-0x0;var _0x390812=_0x7f4b[_0x15dafa];return _0x390812;};'use strict';var express=require(_0xb7f4('0x0'));var router=express[_0xb7f4('0x1')]();var auth=require(_0xb7f4('0x2'));var controller=require(_0xb7f4('0x3'));router[_0xb7f4('0x4')]('/',auth[_0xb7f4('0x5')](),controller[_0xb7f4('0x6')]);router[_0xb7f4('0x4')]('/describe',auth['isAuthenticated'](),controller[_0xb7f4('0x7')]);router['get']('/opencontacts',auth[_0xb7f4('0x5')](),controller[_0xb7f4('0x8')]);router[_0xb7f4('0x4')](_0xb7f4('0x9'),auth[_0xb7f4('0x5')](),controller['getTimezones']);router['get'](_0xb7f4('0xa'),auth[_0xb7f4('0x5')](),controller['show']);router[_0xb7f4('0x4')]('/:id/previewrecall',auth['isAuthenticated'](),controller[_0xb7f4('0xb')]);router[_0xb7f4('0xc')]('/',auth[_0xb7f4('0x5')](),controller['create']);router[_0xb7f4('0xc')](_0xb7f4('0xd'),auth[_0xb7f4('0x5')](),controller[_0xb7f4('0xe')]);router['post']('/timezone',auth[_0xb7f4('0x5')](),controller[_0xb7f4('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb7f4('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb7f4('0x11')]);module[_0xb7f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index bf2b0c0..9f2897a 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 _0x8072=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE','format'];(function(_0x4466d4,_0x3294ca){var _0x336397=function(_0x5da776){while(--_0x5da776){_0x4466d4['push'](_0x4466d4['shift']());}};_0x336397(++_0x3294ca);}(_0x8072,0xc9));var _0x2807=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8072[_0x56482c];return _0x5aae7a;};'use strict';var moment=require(_0x2807('0x0'));var Sequelize=require(_0x2807('0x1'));module[_0x2807('0x2')]={'CmHopperId':{'type':Sequelize[_0x2807('0x3')]},'phone':{'type':Sequelize[_0x2807('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2807('0x5')],'defaultValue':moment()[_0x2807('0x6')](_0x2807('0x7'))},'countbusyretry':{'type':Sequelize[_0x2807('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2807('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2807('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2807('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2807('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ce6=['INTEGER','moment','sequelize','exports','STRING','format'];(function(_0x55c050,_0x25a3f5){var _0x1b1ca1=function(_0x5837f5){while(--_0x5837f5){_0x55c050['push'](_0x55c050['shift']());}};_0x1b1ca1(++_0x25a3f5);}(_0x7ce6,0xaf));var _0x67ce=function(_0x3f06b2,_0x535a4d){_0x3f06b2=_0x3f06b2-0x0;var _0x1eb0f0=_0x7ce6[_0x3f06b2];return _0x1eb0f0;};'use strict';var moment=require(_0x67ce('0x0'));var Sequelize=require(_0x67ce('0x1'));module[_0x67ce('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x67ce('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x67ce('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x67ce('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x67ce('0x5')],'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 118c5eb..fe30e6d 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 _0xa44b=['rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','mustache','util','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','CmHopperAdditionalPhones','destroy','error','name','index','map','CmHopperAdditionalPhone'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa44b,0x157));var _0xba44=function(_0x47fd17,_0x4f7037){_0x47fd17=_0x47fd17-0x0;var _0x353a4b=_0xa44b[_0x47fd17];return _0x353a4b;};'use strict';var emlformat=require(_0xba44('0x0'));var rimraf=require(_0xba44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xba44('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xba44('0x3'));var util=require(_0xba44('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xba44('0x5'));var fs=require('fs');var fs_extra=require(_0xba44('0x6'));var _=require(_0xba44('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba44('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xba44('0x9'));var Papa=require(_0xba44('0xa'));var Redis=require(_0xba44('0xb'));var authService=require(_0xba44('0xc'));var qs=require(_0xba44('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba44('0xe'))(_0xba44('0xf'));var utils=require('../../config/utils');var config=require(_0xba44('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x268d4d,_0x34b120){_0x34b120=_0x34b120||0xcc;return function(_0x40ea5b){if(_0x40ea5b){return _0x268d4d[_0xba44('0x11')](_0x34b120);}return _0x268d4d[_0xba44('0x12')](_0x34b120)['end']();};}function respondWithResult(_0xbeafc8,_0x5a7dd){_0x5a7dd=_0x5a7dd||0xc8;return function(_0x432842){if(_0x432842){return _0xbeafc8[_0xba44('0x12')](_0x5a7dd)[_0xba44('0x13')](_0x432842);}};}function respondWithFilteredResult(_0x202edf,_0x3fb421){return function(_0x191b87){if(_0x191b87){var _0x462943=typeof _0x3fb421[_0xba44('0x14')]===_0xba44('0x15')&&typeof _0x3fb421[_0xba44('0x16')]===_0xba44('0x15');var _0x4de92e=_0x191b87[_0xba44('0x17')];var _0xe00b9=_0x462943?0x0:_0x3fb421[_0xba44('0x14')];var _0x3d9e07=_0x462943?_0x191b87['count']:_0x3fb421['offset']+_0x3fb421[_0xba44('0x16')];var _0x20eef1;if(_0x3d9e07>=_0x4de92e){_0x3d9e07=_0x4de92e;_0x20eef1=0xc8;}else{_0x20eef1=0xce;}_0x202edf[_0xba44('0x12')](_0x20eef1);return _0x202edf['set'](_0xba44('0x18'),_0xe00b9+'-'+_0x3d9e07+'/'+_0x4de92e)[_0xba44('0x13')](_0x191b87);}return null;};}function patchUpdates(_0x5495bf){return function(_0x30383d){try{jsonpatch[_0xba44('0x19')](_0x30383d,_0x5495bf,!![]);}catch(_0x418345){return BPromise['reject'](_0x418345);}return _0x30383d[_0xba44('0x1a')]();};}function saveUpdates(_0xf9194e,_0x57c93f){return function(_0x21427e){if(_0x21427e){return _0x21427e[_0xba44('0x1b')](_0xf9194e)[_0xba44('0x1c')](function(_0x29c982){return _0x29c982;});}return null;};}function removeEntity(_0x20aa43,_0x54e470){return function(_0x73e3c8){if(_0x73e3c8){return _0x73e3c8['destroy']()[_0xba44('0x1c')](function(){var _0x235d3c=_0x73e3c8[_0xba44('0x1d')]({'plain':!![]});var _0x555471=_0xba44('0x1e');return db['UserProfileResource'][_0xba44('0x1f')]({'where':{'type':_0x555471,'resourceId':_0x235d3c['id']}})[_0xba44('0x1c')](function(){return _0x73e3c8;});})[_0xba44('0x1c')](function(){_0x20aa43[_0xba44('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389ad9,_0x442de0){return function(_0x5af0ef){if(!_0x5af0ef){_0x389ad9[_0xba44('0x11')](0x194);}return _0x5af0ef;};}function handleError(_0x320727,_0xd23fd5){_0xd23fd5=_0xd23fd5||0x1f4;return function(_0xba4d00){logger[_0xba44('0x20')](_0xba4d00['stack']);if(_0xba4d00[_0xba44('0x21')]){delete _0xba4d00['name'];}_0x320727[_0xba44('0x12')](_0xd23fd5)['send'](_0xba4d00);};}exports[_0xba44('0x22')]=function(_0x3e10c7,_0x383e61){var _0x3adc4e={},_0x32e6fd={},_0x4bdaee={'count':0x0,'rows':[]};var _0x48f624=_[_0xba44('0x23')](db[_0xba44('0x24')][_0xba44('0x25')],function(_0x35ed57){return{'name':_0x35ed57[_0xba44('0x26')],'type':_0x35ed57[_0xba44('0x27')]['key']};});_0x32e6fd[_0xba44('0x28')]=_[_0xba44('0x23')](_0x48f624,_0xba44('0x21'));_0x32e6fd[_0xba44('0x29')]=_[_0xba44('0x2a')](_0x3e10c7[_0xba44('0x29')]);_0x32e6fd['filters']=_[_0xba44('0x2b')](_0x32e6fd['model'],_0x32e6fd[_0xba44('0x29')]);_0x3adc4e[_0xba44('0x2c')]=_['intersection'](_0x32e6fd[_0xba44('0x28')],qs[_0xba44('0x2d')](_0x3e10c7[_0xba44('0x29')]['fields']));_0x3adc4e[_0xba44('0x2c')]=_0x3adc4e[_0xba44('0x2c')][_0xba44('0x2e')]?_0x3adc4e[_0xba44('0x2c')]:_0x32e6fd[_0xba44('0x28')];if(!_0x3e10c7[_0xba44('0x29')][_0xba44('0x2f')](_0xba44('0x30'))){_0x3adc4e['limit']=qs['limit'](_0x3e10c7[_0xba44('0x29')][_0xba44('0x16')]);_0x3adc4e[_0xba44('0x14')]=qs['offset'](_0x3e10c7[_0xba44('0x29')][_0xba44('0x14')]);}_0x3adc4e[_0xba44('0x31')]=qs['sort'](_0x3e10c7[_0xba44('0x29')][_0xba44('0x32')]);_0x3adc4e[_0xba44('0x33')]=qs[_0xba44('0x34')](_[_0xba44('0x35')](_0x3e10c7['query'],_0x32e6fd[_0xba44('0x34')]),_0x48f624);if(_0x3e10c7[_0xba44('0x29')][_0xba44('0x36')]){_0x3adc4e[_0xba44('0x33')]=_[_0xba44('0x37')](_0x3adc4e[_0xba44('0x33')],{'$or':_[_0xba44('0x23')](_0x48f624,function(_0x464d40){if(_0x464d40[_0xba44('0x27')]!==_0xba44('0x38')){var _0xb149ba={};_0xb149ba[_0x464d40['name']]={'$like':'%'+_0x3e10c7[_0xba44('0x29')][_0xba44('0x36')]+'%'};return _0xb149ba;}})});}_0x3adc4e=_[_0xba44('0x37')]({},_0x3adc4e,_0x3e10c7[_0xba44('0x39')]);var _0x1ea179={'where':_0x3adc4e[_0xba44('0x33')]};return db[_0xba44('0x24')][_0xba44('0x17')](_0x1ea179)[_0xba44('0x1c')](function(_0xac979){_0x4bdaee[_0xba44('0x17')]=_0xac979;if(_0x3e10c7['query']['includeAll']){_0x3adc4e[_0xba44('0x3a')]=[{'all':!![]}];}return db[_0xba44('0x24')][_0xba44('0x3b')](_0x3adc4e);})[_0xba44('0x1c')](function(_0x4e588e){_0x4bdaee[_0xba44('0x3c')]=_0x4e588e;return _0x4bdaee;})[_0xba44('0x1c')](respondWithFilteredResult(_0x383e61,_0x3adc4e))[_0xba44('0x3d')](handleError(_0x383e61,null));};exports[_0xba44('0x3e')]=function(_0x5ca274,_0x2c32a6){var _0x39804e={'raw':!![],'where':{'id':_0x5ca274[_0xba44('0x3f')]['id']}},_0x523835={};_0x523835['model']=_[_0xba44('0x2a')](db[_0xba44('0x24')][_0xba44('0x25')]);_0x523835[_0xba44('0x29')]=_['keys'](_0x5ca274['query']);_0x523835['filters']=_[_0xba44('0x2b')](_0x523835[_0xba44('0x28')],_0x523835[_0xba44('0x29')]);_0x39804e[_0xba44('0x2c')]=_[_0xba44('0x2b')](_0x523835[_0xba44('0x28')],qs['fields'](_0x5ca274[_0xba44('0x29')]['fields']));_0x39804e[_0xba44('0x2c')]=_0x39804e[_0xba44('0x2c')][_0xba44('0x2e')]?_0x39804e[_0xba44('0x2c')]:_0x523835[_0xba44('0x28')];if(_0x5ca274['query'][_0xba44('0x40')]){_0x39804e[_0xba44('0x3a')]=[{'all':!![]}];}_0x39804e=_[_0xba44('0x37')]({},_0x39804e,_0x5ca274['options']);return db[_0xba44('0x24')][_0xba44('0x41')](_0x39804e)[_0xba44('0x1c')](handleEntityNotFound(_0x2c32a6,null))[_0xba44('0x1c')](respondWithResult(_0x2c32a6,null))[_0xba44('0x3d')](handleError(_0x2c32a6,null));};exports[_0xba44('0x42')]=function(_0x599be2,_0x31e6a6){return db[_0xba44('0x24')][_0xba44('0x42')](_0x599be2[_0xba44('0x43')],{})[_0xba44('0x1c')](function(_0x3a2e06){var _0x4cd210=_0x599be2[_0xba44('0x44')][_0xba44('0x1d')]({'plain':!![]});if(!_0x4cd210)throw new Error(_0xba44('0x45'));if(_0x4cd210[_0xba44('0x46')]==='user'){var _0x20b835=_0x3a2e06[_0xba44('0x1d')]({'plain':!![]});var _0x2dc9b5=_0xba44('0x1e');return db[_0xba44('0x47')][_0xba44('0x41')]({'where':{'name':_0x2dc9b5,'userProfileId':_0x4cd210[_0xba44('0x48')]},'raw':!![]})[_0xba44('0x1c')](function(_0x2f2d1b){if(_0x2f2d1b&&_0x2f2d1b[_0xba44('0x49')]===0x0){return db[_0xba44('0x4a')]['create']({'name':_0x20b835[_0xba44('0x21')],'resourceId':_0x20b835['id'],'type':_0x2f2d1b[_0xba44('0x21')],'sectionId':_0x2f2d1b['id']},{})[_0xba44('0x1c')](function(){return _0x3a2e06;});}else{return _0x3a2e06;}})[_0xba44('0x3d')](function(_0x118966){logger[_0xba44('0x20')](_0xba44('0x4b'),_0x118966);throw _0x118966;});}return _0x3a2e06;})[_0xba44('0x1c')](respondWithResult(_0x31e6a6,0xc9))['catch'](handleError(_0x31e6a6,null));};exports[_0xba44('0x1b')]=function(_0x2fbb38,_0x5ae78f){if(_0x2fbb38[_0xba44('0x43')]['id']){delete _0x2fbb38[_0xba44('0x43')]['id'];}return db['CmHopperAdditionalPhone'][_0xba44('0x41')]({'where':{'id':_0x2fbb38[_0xba44('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5ae78f,null))[_0xba44('0x1c')](saveUpdates(_0x2fbb38[_0xba44('0x43')],null))[_0xba44('0x1c')](respondWithResult(_0x5ae78f,null))[_0xba44('0x3d')](handleError(_0x5ae78f,null));};exports[_0xba44('0x1f')]=function(_0x3d89ac,_0x240224){return db[_0xba44('0x24')][_0xba44('0x41')]({'where':{'id':_0x3d89ac[_0xba44('0x3f')]['id']}})['then'](handleEntityNotFound(_0x240224,null))[_0xba44('0x1c')](removeEntity(_0x240224,null))['catch'](handleError(_0x240224,null));}; \ No newline at end of file +var _0xaa50=['filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','CmHopperAdditionalPhones','destroy','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaa50,0x68));var _0x0aa5=function(_0x6ce39b,_0x4e3ca9){_0x6ce39b=_0x6ce39b-0x0;var _0x3587db=_0xaa50[_0x6ce39b];return _0x3587db;};'use strict';var emlformat=require(_0x0aa5('0x0'));var rimraf=require(_0x0aa5('0x1'));var zipdir=require(_0x0aa5('0x2'));var jsonpatch=require(_0x0aa5('0x3'));var rp=require(_0x0aa5('0x4'));var moment=require(_0x0aa5('0x5'));var BPromise=require(_0x0aa5('0x6'));var Mustache=require(_0x0aa5('0x7'));var util=require(_0x0aa5('0x8'));var path=require(_0x0aa5('0x9'));var sox=require(_0x0aa5('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0aa5('0xb'));var _=require(_0x0aa5('0xc'));var squel=require(_0x0aa5('0xd'));var crypto=require(_0x0aa5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0aa5('0xf'));var toCsv=require(_0x0aa5('0x10'));var querystring=require(_0x0aa5('0x11'));var Papa=require('papaparse');var Redis=require(_0x0aa5('0x12'));var authService=require(_0x0aa5('0x13'));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(_0x0aa5('0x14'));var licenseUtil=require(_0x0aa5('0x15'));var db=require(_0x0aa5('0x16'))['db'];function respondWithStatusCode(_0x1dd571,_0x34e060){_0x34e060=_0x34e060||0xcc;return function(_0x5b80b9){if(_0x5b80b9){return _0x1dd571[_0x0aa5('0x17')](_0x34e060);}return _0x1dd571[_0x0aa5('0x18')](_0x34e060)[_0x0aa5('0x19')]();};}function respondWithResult(_0x256f20,_0x26eb95){_0x26eb95=_0x26eb95||0xc8;return function(_0x5db81c){if(_0x5db81c){return _0x256f20[_0x0aa5('0x18')](_0x26eb95)[_0x0aa5('0x1a')](_0x5db81c);}};}function respondWithFilteredResult(_0x231e2b,_0x4e561c){return function(_0x44c645){if(_0x44c645){var _0x1f776e=typeof _0x4e561c[_0x0aa5('0x1b')]===_0x0aa5('0x1c')&&typeof _0x4e561c[_0x0aa5('0x1d')]==='undefined';var _0x4d216f=_0x44c645[_0x0aa5('0x1e')];var _0x60573=_0x1f776e?0x0:_0x4e561c[_0x0aa5('0x1b')];var _0x2b5976=_0x1f776e?_0x44c645[_0x0aa5('0x1e')]:_0x4e561c[_0x0aa5('0x1b')]+_0x4e561c[_0x0aa5('0x1d')];var _0xa01b35;if(_0x2b5976>=_0x4d216f){_0x2b5976=_0x4d216f;_0xa01b35=0xc8;}else{_0xa01b35=0xce;}_0x231e2b[_0x0aa5('0x18')](_0xa01b35);return _0x231e2b['set'](_0x0aa5('0x1f'),_0x60573+'-'+_0x2b5976+'/'+_0x4d216f)['json'](_0x44c645);}return null;};}function patchUpdates(_0x28de2a){return function(_0x492be9){try{jsonpatch[_0x0aa5('0x20')](_0x492be9,_0x28de2a,!![]);}catch(_0x5e0b37){return BPromise[_0x0aa5('0x21')](_0x5e0b37);}return _0x492be9['save']();};}function saveUpdates(_0x5b7038,_0x451d92){return function(_0x50f82b){if(_0x50f82b){return _0x50f82b[_0x0aa5('0x22')](_0x5b7038)[_0x0aa5('0x23')](function(_0x1ee277){return _0x1ee277;});}return null;};}function removeEntity(_0x4c3964,_0x5083db){return function(_0x13a2d5){if(_0x13a2d5){return _0x13a2d5['destroy']()['then'](function(){var _0xf39661=_0x13a2d5[_0x0aa5('0x24')]({'plain':!![]});var _0x9c81b8=_0x0aa5('0x25');return db['UserProfileResource'][_0x0aa5('0x26')]({'where':{'type':_0x9c81b8,'resourceId':_0xf39661['id']}})[_0x0aa5('0x23')](function(){return _0x13a2d5;});})['then'](function(){_0x4c3964[_0x0aa5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x993190,_0x2501af){return function(_0x49302f){if(!_0x49302f){_0x993190[_0x0aa5('0x17')](0x194);}return _0x49302f;};}function handleError(_0x5d3c3c,_0x3d7014){_0x3d7014=_0x3d7014||0x1f4;return function(_0x2319ff){logger[_0x0aa5('0x27')](_0x2319ff[_0x0aa5('0x28')]);if(_0x2319ff['name']){delete _0x2319ff[_0x0aa5('0x29')];}_0x5d3c3c[_0x0aa5('0x18')](_0x3d7014)[_0x0aa5('0x2a')](_0x2319ff);};}exports[_0x0aa5('0x2b')]=function(_0x1c6b54,_0x4e11c9){var _0x57202c={},_0x36ad84={},_0x2ef1ae={'count':0x0,'rows':[]};var _0x1c3cb6=_[_0x0aa5('0x2c')](db[_0x0aa5('0x2d')][_0x0aa5('0x2e')],function(_0xd8469d){return{'name':_0xd8469d[_0x0aa5('0x2f')],'type':_0xd8469d['type']['key']};});_0x36ad84['model']=_[_0x0aa5('0x2c')](_0x1c3cb6,_0x0aa5('0x29'));_0x36ad84[_0x0aa5('0x30')]=_[_0x0aa5('0x31')](_0x1c6b54[_0x0aa5('0x30')]);_0x36ad84['filters']=_[_0x0aa5('0x32')](_0x36ad84[_0x0aa5('0x33')],_0x36ad84[_0x0aa5('0x30')]);_0x57202c[_0x0aa5('0x34')]=_['intersection'](_0x36ad84['model'],qs[_0x0aa5('0x35')](_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x35')]));_0x57202c['attributes']=_0x57202c[_0x0aa5('0x34')][_0x0aa5('0x36')]?_0x57202c['attributes']:_0x36ad84['model'];if(!_0x1c6b54[_0x0aa5('0x30')]['hasOwnProperty'](_0x0aa5('0x37'))){_0x57202c[_0x0aa5('0x1d')]=qs[_0x0aa5('0x1d')](_0x1c6b54[_0x0aa5('0x30')]['limit']);_0x57202c[_0x0aa5('0x1b')]=qs[_0x0aa5('0x1b')](_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x1b')]);}_0x57202c['order']=qs[_0x0aa5('0x38')](_0x1c6b54[_0x0aa5('0x30')]['sort']);_0x57202c[_0x0aa5('0x39')]=qs[_0x0aa5('0x3a')](_[_0x0aa5('0x3b')](_0x1c6b54[_0x0aa5('0x30')],_0x36ad84[_0x0aa5('0x3a')]),_0x1c3cb6);if(_0x1c6b54['query']['filter']){_0x57202c[_0x0aa5('0x39')]=_[_0x0aa5('0x3c')](_0x57202c[_0x0aa5('0x39')],{'$or':_[_0x0aa5('0x2c')](_0x1c3cb6,function(_0x153ffe){if(_0x153ffe[_0x0aa5('0x3d')]!=='VIRTUAL'){var _0x280a6d={};_0x280a6d[_0x153ffe[_0x0aa5('0x29')]]={'$like':'%'+_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x3e')]+'%'};return _0x280a6d;}})});}_0x57202c=_[_0x0aa5('0x3c')]({},_0x57202c,_0x1c6b54[_0x0aa5('0x3f')]);var _0x525579={'where':_0x57202c['where']};return db['CmHopperAdditionalPhone']['count'](_0x525579)[_0x0aa5('0x23')](function(_0x577a30){_0x2ef1ae['count']=_0x577a30;if(_0x1c6b54[_0x0aa5('0x30')][_0x0aa5('0x40')]){_0x57202c['include']=[{'all':!![]}];}return db[_0x0aa5('0x2d')][_0x0aa5('0x41')](_0x57202c);})[_0x0aa5('0x23')](function(_0x4f8150){_0x2ef1ae[_0x0aa5('0x42')]=_0x4f8150;return _0x2ef1ae;})['then'](respondWithFilteredResult(_0x4e11c9,_0x57202c))[_0x0aa5('0x43')](handleError(_0x4e11c9,null));};exports[_0x0aa5('0x44')]=function(_0x3ecb86,_0x349b75){var _0x1c87ec={'raw':!![],'where':{'id':_0x3ecb86[_0x0aa5('0x45')]['id']}},_0x5c895={};_0x5c895[_0x0aa5('0x33')]=_[_0x0aa5('0x31')](db[_0x0aa5('0x2d')][_0x0aa5('0x2e')]);_0x5c895[_0x0aa5('0x30')]=_[_0x0aa5('0x31')](_0x3ecb86[_0x0aa5('0x30')]);_0x5c895['filters']=_[_0x0aa5('0x32')](_0x5c895[_0x0aa5('0x33')],_0x5c895[_0x0aa5('0x30')]);_0x1c87ec[_0x0aa5('0x34')]=_['intersection'](_0x5c895[_0x0aa5('0x33')],qs['fields'](_0x3ecb86['query'][_0x0aa5('0x35')]));_0x1c87ec[_0x0aa5('0x34')]=_0x1c87ec[_0x0aa5('0x34')][_0x0aa5('0x36')]?_0x1c87ec[_0x0aa5('0x34')]:_0x5c895[_0x0aa5('0x33')];if(_0x3ecb86[_0x0aa5('0x30')][_0x0aa5('0x40')]){_0x1c87ec[_0x0aa5('0x46')]=[{'all':!![]}];}_0x1c87ec=_[_0x0aa5('0x3c')]({},_0x1c87ec,_0x3ecb86[_0x0aa5('0x3f')]);return db[_0x0aa5('0x2d')][_0x0aa5('0x47')](_0x1c87ec)['then'](handleEntityNotFound(_0x349b75,null))['then'](respondWithResult(_0x349b75,null))[_0x0aa5('0x43')](handleError(_0x349b75,null));};exports['create']=function(_0x356aff,_0x3d02a9){return db[_0x0aa5('0x2d')][_0x0aa5('0x48')](_0x356aff[_0x0aa5('0x49')],{})[_0x0aa5('0x23')](function(_0x1d8a5c){var _0x4e3315=_0x356aff['user']['get']({'plain':!![]});if(!_0x4e3315)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e3315[_0x0aa5('0x4a')]===_0x0aa5('0x4b')){var _0x268659=_0x1d8a5c[_0x0aa5('0x24')]({'plain':!![]});var _0x408412=_0x0aa5('0x25');return db[_0x0aa5('0x4c')][_0x0aa5('0x47')]({'where':{'name':_0x408412,'userProfileId':_0x4e3315[_0x0aa5('0x4d')]},'raw':!![]})[_0x0aa5('0x23')](function(_0x4583e3){if(_0x4583e3&&_0x4583e3[_0x0aa5('0x4e')]===0x0){return db[_0x0aa5('0x4f')][_0x0aa5('0x48')]({'name':_0x268659['name'],'resourceId':_0x268659['id'],'type':_0x4583e3[_0x0aa5('0x29')],'sectionId':_0x4583e3['id']},{})[_0x0aa5('0x23')](function(){return _0x1d8a5c;});}else{return _0x1d8a5c;}})[_0x0aa5('0x43')](function(_0x29ce40){logger[_0x0aa5('0x27')](_0x0aa5('0x50'),_0x29ce40);throw _0x29ce40;});}return _0x1d8a5c;})[_0x0aa5('0x23')](respondWithResult(_0x3d02a9,0xc9))['catch'](handleError(_0x3d02a9,null));};exports['update']=function(_0x1254cd,_0x957897){if(_0x1254cd[_0x0aa5('0x49')]['id']){delete _0x1254cd['body']['id'];}return db['CmHopperAdditionalPhone'][_0x0aa5('0x47')]({'where':{'id':_0x1254cd['params']['id']}})[_0x0aa5('0x23')](handleEntityNotFound(_0x957897,null))[_0x0aa5('0x23')](saveUpdates(_0x1254cd['body'],null))[_0x0aa5('0x23')](respondWithResult(_0x957897,null))[_0x0aa5('0x43')](handleError(_0x957897,null));};exports[_0x0aa5('0x26')]=function(_0x49813c,_0x1e481b){return db[_0x0aa5('0x2d')][_0x0aa5('0x47')]({'where':{'id':_0x49813c[_0x0aa5('0x45')]['id']}})[_0x0aa5('0x23')](handleEntityNotFound(_0x1e481b,null))[_0x0aa5('0x23')](removeEntity(_0x1e481b,null))[_0x0aa5('0x43')](handleError(_0x1e481b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index e9d887b..1938d9d 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 _0xed20=['lodash','api','moment','bluebird','rimraf','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x5cd54f,_0x2254a0){var _0x4c660d=function(_0x30c996){while(--_0x30c996){_0x5cd54f['push'](_0x5cd54f['shift']());}};_0x4c660d(++_0x2254a0);}(_0xed20,0x1b9));var _0x0ed2=function(_0x2341ea,_0x59b7d5){_0x2341ea=_0x2341ea-0x0;var _0x3b86bd=_0xed20[_0x2341ea];return _0x3b86bd;};'use strict';var _=require(_0x0ed2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ed2('0x1'));var moment=require(_0x0ed2('0x2'));var BPromise=require(_0x0ed2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ed2('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x0ed2('0x5')]=function(_0x21f74a,_0x5ee21e){return _0x21f74a[_0x0ed2('0x6')](_0x0ed2('0x7'),attributes,{'tableName':_0x0ed2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79a1=['./cmHopperAdditionalPhone.attributes','exports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79a1,0x1e2));var _0x179a=function(_0x307829,_0x45d1ad){_0x307829=_0x307829-0x0;var _0xaa0073=_0x79a1[_0x307829];return _0xaa0073;};'use strict';var _=require('lodash');var util=require(_0x179a('0x0'));var logger=require('../../config/logger')(_0x179a('0x1'));var moment=require(_0x179a('0x2'));var BPromise=require(_0x179a('0x3'));var rp=require(_0x179a('0x4'));var fs=require('fs');var path=require(_0x179a('0x5'));var rimraf=require(_0x179a('0x6'));var config=require(_0x179a('0x7'));var attributes=require(_0x179a('0x8'));module[_0x179a('0x9')]=function(_0x318555,_0x573b65){return _0x318555['define']('CmHopperAdditionalPhone',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 cd317ad..a0b0971 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 _0xc1c6=['phone','countmachineretry','createdAt','updatedAt','sequelize','transaction','update','CmHopper','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch','VerifyAdditionalPhones','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','entity','dialGlobalMaxRetry','countdropretry','countabandonedretry','countagentrejectretry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add'];(function(_0x1dca26,_0x36f303){var _0x46dcfd=function(_0x140ade){while(--_0x140ade){_0x1dca26['push'](_0x1dca26['shift']());}};_0x46dcfd(++_0x36f303);}(_0xc1c6,0x166));var _0x6c1c=function(_0x1aaca6,_0x107e9e){_0x1aaca6=_0x1aaca6-0x0;var _0x502fb9=_0xc1c6[_0x1aaca6];return _0x502fb9;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require(_0x6c1c('0x3'));var rs=require(_0x6c1c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c1c('0x6'))(_0x6c1c('0x7'));var config=require(_0x6c1c('0x8'));var jayson=require(_0x6c1c('0x9'));var client=jayson['client'][_0x6c1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36583c,_0x327a3e,_0x3a2c67){return new BPromise(function(_0x135e23,_0x39ebf6){return client['request'](_0x36583c,_0x3a2c67)[_0x6c1c('0xb')](function(_0xc4f16c){logger[_0x6c1c('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x327a3e,_0x6c1c('0xd'));logger[_0x6c1c('0xe')](_0x6c1c('0xf'),_0x327a3e,'request\x20sent',JSON[_0x6c1c('0x10')](_0xc4f16c));if(_0xc4f16c[_0x6c1c('0x11')]){if(_0xc4f16c['error'][_0x6c1c('0x12')]===0x1f4){logger['error'](_0x6c1c('0x13'),_0x327a3e,_0xc4f16c[_0x6c1c('0x11')][_0x6c1c('0x14')]);return _0x39ebf6(_0xc4f16c[_0x6c1c('0x11')]['message']);}logger['error'](_0x6c1c('0x13'),_0x327a3e,_0xc4f16c[_0x6c1c('0x11')][_0x6c1c('0x14')]);return _0x135e23(_0xc4f16c['error']['message']);}else{logger[_0x6c1c('0xc')](_0x6c1c('0x13'),_0x327a3e,_0x6c1c('0xd'));_0x135e23(_0xc4f16c['result'][_0x6c1c('0x14')]);}})[_0x6c1c('0x15')](function(_0x399190){logger[_0x6c1c('0x11')](_0x6c1c('0x13'),_0x327a3e,_0x399190);_0x39ebf6(_0x399190);});});}exports[_0x6c1c('0x16')]=function(_0x3d6f45){var _0xfa1893=this;return new Promise(function(_0x56baa5,_0x2f89bd){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x3d6f45[_0x6c1c('0x17')][_0x6c1c('0x18')],'ListId':_0x3d6f45[_0x6c1c('0x17')][_0x6c1c('0x19')],'VoiceQueueId':_0x3d6f45['body'][_0x6c1c('0x1a')]===undefined?null:_0x3d6f45[_0x6c1c('0x17')][_0x6c1c('0x1a')],'CampaignId':_0x3d6f45[_0x6c1c('0x17')]['CampaignId']===undefined?null:_0x3d6f45['body'][_0x6c1c('0x1b')]}})['then'](function(_0xfca82f){if(_0xfca82f!=null){return db[_0x6c1c('0x1c')][_0x6c1c('0x1d')]({'raw':!![],'where':{'CmHopperId':_0xfca82f['id'],'OrderBy':{'$gt':_0xfca82f[_0x6c1c('0x1e')]}},'order':[[_0x6c1c('0x1e'),_0x6c1c('0x1f')]]})[_0x6c1c('0xb')](function(_0x5e9376){var _0x13f9f8=0x0;if(_0x5e9376){if(_0x5e9376[_0x6c1c('0x20')]+_0x5e9376[_0x6c1c('0x21')]+_0x5e9376[_0x6c1c('0x22')]+_0x5e9376[_0x6c1c('0x23')]+_0x5e9376['countdropretry']+_0x5e9376['countabandonedretry']+_0x5e9376['countmachineretry']+_0x5e9376['countagentrejectretry']<_0x3d6f45[_0x6c1c('0x24')][_0x6c1c('0x25')])_0x13f9f8=0x1;_0x56baa5({'additional':_0x13f9f8});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xfca82f['id']},'order':[[_0x6c1c('0x1e'),'ASC']]})['then'](function(_0x3d4782){var _0x59dbda=0x0;if(_0x3d4782){if(_0x3d4782[_0x6c1c('0x20')]+_0x3d4782['countcongestionretry']+_0x3d4782[_0x6c1c('0x22')]+_0x3d4782['countnosuchnumberretry']+_0x3d4782[_0x6c1c('0x26')]+_0x3d4782[_0x6c1c('0x27')]+_0x3d4782['countmachineretry']+_0x3d4782[_0x6c1c('0x28')]<_0x3d6f45[_0x6c1c('0x24')]['dialGlobalMaxRetry'])_0x59dbda=0x1;_0x56baa5({'additional':_0x59dbda});}else{_0x56baa5({'additional':0x0});}})[_0x6c1c('0x15')](function(_0x55b9ee){logger[_0x6c1c('0x11')]('VerifyAdditionalPhones',_0x55b9ee[_0x6c1c('0x14')]);_0x2f89bd(_0xfa1893['error'](0x1f4,_0x55b9ee[_0x6c1c('0x14')]));});}})[_0x6c1c('0x15')](function(_0x161341){logger[_0x6c1c('0x11')](_0x6c1c('0x16'),_0x161341[_0x6c1c('0x14')]);_0x2f89bd(_0xfa1893['error'](0x1f4,_0x161341['message']));});}else _0x56baa5({'additional':0x0});});});};exports[_0x6c1c('0x29')]=function(_0xb128f6){var _0x2c79aa=this;return new Promise(function(_0x5275f7,_0x274655){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0xb128f6[_0x6c1c('0x17')][_0x6c1c('0x18')],'ListId':_0xb128f6['body']['ListId'],'VoiceQueueId':_0xb128f6['body'][_0x6c1c('0x1a')]===undefined?null:_0xb128f6[_0x6c1c('0x17')]['VoiceQueueId'],'CampaignId':_0xb128f6['body'][_0x6c1c('0x1b')]===undefined?null:_0xb128f6[_0x6c1c('0x17')][_0x6c1c('0x1b')]}})[_0x6c1c('0xb')](function(_0x530c3){if(_0x530c3!=null){return db[_0x6c1c('0x1c')][_0x6c1c('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x530c3['id'],'OrderBy':{'$gte':_0x530c3[_0x6c1c('0x1e')]}},'order':[[_0x6c1c('0x1e'),_0x6c1c('0x1f')]]})[_0x6c1c('0xb')](function(_0x294329){if(_0x294329)return activateAdditionalPhone(_0x530c3,_0xb128f6[_0x6c1c('0x17')],_0x294329,_0xb128f6[_0x6c1c('0x2a')],_0xb128f6[_0x6c1c('0x2b')])[_0x6c1c('0xb')](function(_0x189f09){_0x5275f7(_0x189f09);});else{return db[_0x6c1c('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x530c3['id']},'order':[['OrderBy','ASC']]})[_0x6c1c('0xb')](function(_0x51a937){if(_0x51a937)return activateAdditionalPhone(_0x530c3,_0xb128f6[_0x6c1c('0x17')],_0x51a937,_0xb128f6[_0x6c1c('0x2a')],_0xb128f6[_0x6c1c('0x2b')])[_0x6c1c('0xb')](function(_0x253fd4){_0x5275f7(_0x253fd4);});else{_0x5275f7({'id':_0x530c3['id'],'phone':''});}})[_0x6c1c('0x15')](function(_0x3f9256){logger[_0x6c1c('0x11')](_0x6c1c('0x16'),_0x3f9256[_0x6c1c('0x14')]);_0x274655(_0x2c79aa[_0x6c1c('0x11')](0x1f4,_0x3f9256[_0x6c1c('0x14')]));});}})[_0x6c1c('0x15')](function(_0x1bf799){logger[_0x6c1c('0x11')](_0x6c1c('0x16'),_0x1bf799[_0x6c1c('0x14')]);_0x274655(_0x2c79aa[_0x6c1c('0x11')](0x1f4,_0x1bf799[_0x6c1c('0x14')]));});}else _0x5275f7(0x1);});});};function activateAdditionalPhone(_0x5e7897,_0x177821,_0xbb7e7,_0x212454,_0x44c541){return new Promise(function(_0x10da18,_0x12181d){var _0x5a1db9;if(_[_0x6c1c('0x2c')](_0xbb7e7[_0x6c1c('0x2d')])){_0xbb7e7[_0x6c1c('0x2d')]=moment();}if(moment()>moment(_0xbb7e7[_0x6c1c('0x2d')])){_0x5a1db9=moment()['add'](_0x44c541||0x3,_0x6c1c('0x2e'));}else{if(_0xbb7e7['OrderBy']==0x0){_0x5a1db9=moment(_0xbb7e7[_0x6c1c('0x2d')]);}else{_0x5a1db9=moment()[_0x6c1c('0x2f')](_0x44c541||0x3,_0x6c1c('0x2e'));}}if(_[_0x6c1c('0x2c')](_0x5a1db9)){_0x5a1db9=moment()['add'](_0x44c541||0x3,_0x6c1c('0x2e'));}var _0x23a15a={'phone':_0x5e7897[_0x6c1c('0x30')],'active':0x0,'OrderBy':_[_0x6c1c('0x2c')](_0x5e7897[_0x6c1c('0x1e')])?0x0:_0x5e7897[_0x6c1c('0x1e')],'scheduledat':moment()[_0x6c1c('0x2f')](_0x212454||0x1,_0x6c1c('0x2e')),'countbusyretry':_0x177821[_0x6c1c('0x20')],'countcongestionretry':_0x177821['countcongestionretry'],'countnoanswerretry':_0x177821[_0x6c1c('0x22')],'countnosuchnumberretry':_0x177821[_0x6c1c('0x23')],'countdropretry':_0x177821[_0x6c1c('0x26')],'countabandonedretry':_0x177821[_0x6c1c('0x27')],'countmachineretry':_0x177821[_0x6c1c('0x31')],'countagentrejectretry':_0x177821[_0x6c1c('0x28')],'createdAt':_0x177821[_0x6c1c('0x32')],'updatedAt':_0x177821[_0x6c1c('0x33')]};var _0x3c9eaa={'CmHopperId':_0x5e7897['id'],'phone':_0xbb7e7[_0x6c1c('0x30')],'active':0x0,'OrderBy':_['isNil'](_0xbb7e7[_0x6c1c('0x1e')])?0x0:_0xbb7e7[_0x6c1c('0x1e')],'scheduledat':_0x5a1db9,'countbusyretry':_0xbb7e7[_0x6c1c('0x20')],'countcongestionretry':_0xbb7e7['countcongestionretry'],'countnoanswerretry':_0xbb7e7[_0x6c1c('0x22')],'countnosuchnumberretry':_0xbb7e7[_0x6c1c('0x23')],'countdropretry':_0xbb7e7[_0x6c1c('0x26')],'countabandonedretry':_0xbb7e7[_0x6c1c('0x27')],'countmachineretry':_0xbb7e7['countmachineretry'],'countagentrejectretry':_0xbb7e7['countagentrejectretry'],'createdAt':_0xbb7e7[_0x6c1c('0x32')],'updatedAt':_0xbb7e7[_0x6c1c('0x33')]};return db[_0x6c1c('0x34')][_0x6c1c('0x35')](function(_0x36a438){return db[_0x6c1c('0x1c')][_0x6c1c('0x36')](_0x23a15a,{'where':{'id':_0xbb7e7['id']}},{'transaction':_0x36a438})[_0x6c1c('0xb')](function(){return db[_0x6c1c('0x37')][_0x6c1c('0x36')](_0x3c9eaa,{'where':{'id':_0x5e7897['id']}},{'transaction':_0x36a438});});})[_0x6c1c('0xb')](function(_0x387dae){_0x10da18({'id':_0x5e7897['id'],'phone':_0xbb7e7[_0x6c1c('0x30')]});})[_0x6c1c('0x15')](function(_0x35f2f0){logger[_0x6c1c('0x11')]('activateAdditionalPhone',_0x35f2f0[_0x6c1c('0x14')]);_0x12181d({'error':_0x35f2f0[_0x6c1c('0x14')]});});});}exports[_0x6c1c('0x38')]=function(_0x2ef199){var _0x153939=this;return new Promise(function(_0x448572,_0x1c0ef6){return db[_0x6c1c('0x37')][_0x6c1c('0x36')](_0x2ef199[_0x6c1c('0x17')][_0x6c1c('0x39')],{'where':{'id':_0x2ef199['body']['id']}})[_0x6c1c('0xb')](function(_0x4a3f2a){_0x448572(_0x4a3f2a);})[_0x6c1c('0x15')](function(_0x24010b){logger[_0x6c1c('0x11')](_0x6c1c('0x38'),_0x24010b[_0x6c1c('0x14')]);_0x1c0ef6(_0x153939['error'](0x1f4,_0x24010b[_0x6c1c('0x14')]));});});}; \ No newline at end of file +var _0x8a78=['phone','isNil','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countdropretry','SwapAdditionalPhones','ListId','duration','waitTime','scheduledat','add','minutes'];(function(_0x409f9f,_0x365478){var _0x107f83=function(_0x61b4c4){while(--_0x61b4c4){_0x409f9f['push'](_0x409f9f['shift']());}};_0x107f83(++_0x365478);}(_0x8a78,0x158));var _0x88a7=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x8a78[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0x88a7('0x0'));var util=require(_0x88a7('0x1'));var moment=require(_0x88a7('0x2'));var BPromise=require(_0x88a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88a7('0x4'));var db=require(_0x88a7('0x5'))['db'];var utils=require(_0x88a7('0x6'));var logger=require(_0x88a7('0x7'))(_0x88a7('0x8'));var config=require('../../config/environment');var jayson=require(_0x88a7('0x9'));var client=jayson['client'][_0x88a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443560,_0x118b71,_0x38201b){return new BPromise(function(_0x585571,_0xd25e66){return client[_0x88a7('0xb')](_0x443560,_0x38201b)[_0x88a7('0xc')](function(_0x2ef7f8){logger[_0x88a7('0xd')](_0x88a7('0xe'),_0x118b71,_0x88a7('0xf'));logger[_0x88a7('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x118b71,_0x88a7('0xf'),JSON[_0x88a7('0x11')](_0x2ef7f8));if(_0x2ef7f8['error']){if(_0x2ef7f8[_0x88a7('0x12')]['code']===0x1f4){logger[_0x88a7('0x12')](_0x88a7('0xe'),_0x118b71,_0x2ef7f8[_0x88a7('0x12')]['message']);return _0xd25e66(_0x2ef7f8[_0x88a7('0x12')][_0x88a7('0x13')]);}logger[_0x88a7('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x118b71,_0x2ef7f8[_0x88a7('0x12')][_0x88a7('0x13')]);return _0x585571(_0x2ef7f8['error'][_0x88a7('0x13')]);}else{logger['info'](_0x88a7('0xe'),_0x118b71,_0x88a7('0xf'));_0x585571(_0x2ef7f8[_0x88a7('0x14')][_0x88a7('0x13')]);}})[_0x88a7('0x15')](function(_0x38f265){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x118b71,_0x38f265);_0xd25e66(_0x38f265);});});}exports[_0x88a7('0x16')]=function(_0x27da04){var _0x49a061=this;return new Promise(function(_0x28c99f,_0x3086fd){return db[_0x88a7('0x17')][_0x88a7('0x18')]({'raw':!![],'where':{'ContactId':_0x27da04['body']['ContactId'],'ListId':_0x27da04[_0x88a7('0x19')]['ListId'],'VoiceQueueId':_0x27da04[_0x88a7('0x19')][_0x88a7('0x1a')]===undefined?null:_0x27da04['body']['VoiceQueueId'],'CampaignId':_0x27da04['body'][_0x88a7('0x1b')]===undefined?null:_0x27da04[_0x88a7('0x19')][_0x88a7('0x1b')]}})[_0x88a7('0xc')](function(_0x127e73){if(_0x127e73!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x127e73['id'],'OrderBy':{'$gt':_0x127e73['OrderBy']}},'order':[[_0x88a7('0x1c'),_0x88a7('0x1d')]]})[_0x88a7('0xc')](function(_0x2f1c0a){var _0x2b0194=0x0;if(_0x2f1c0a){if(_0x2f1c0a[_0x88a7('0x1e')]+_0x2f1c0a[_0x88a7('0x1f')]+_0x2f1c0a[_0x88a7('0x20')]+_0x2f1c0a[_0x88a7('0x21')]+_0x2f1c0a['countdropretry']+_0x2f1c0a[_0x88a7('0x22')]+_0x2f1c0a[_0x88a7('0x23')]+_0x2f1c0a[_0x88a7('0x24')]<_0x27da04[_0x88a7('0x25')][_0x88a7('0x26')])_0x2b0194=0x1;_0x28c99f({'additional':_0x2b0194});}else{return db[_0x88a7('0x27')][_0x88a7('0x18')]({'raw':!![],'where':{'CmHopperId':_0x127e73['id']},'order':[['OrderBy','ASC']]})[_0x88a7('0xc')](function(_0x919f87){var _0x20809e=0x0;if(_0x919f87){if(_0x919f87[_0x88a7('0x1e')]+_0x919f87['countcongestionretry']+_0x919f87[_0x88a7('0x20')]+_0x919f87[_0x88a7('0x21')]+_0x919f87[_0x88a7('0x28')]+_0x919f87[_0x88a7('0x22')]+_0x919f87[_0x88a7('0x23')]+_0x919f87[_0x88a7('0x24')]<_0x27da04[_0x88a7('0x25')][_0x88a7('0x26')])_0x20809e=0x1;_0x28c99f({'additional':_0x20809e});}else{_0x28c99f({'additional':0x0});}})[_0x88a7('0x15')](function(_0x34b0a2){logger[_0x88a7('0x12')](_0x88a7('0x16'),_0x34b0a2[_0x88a7('0x13')]);_0x3086fd(_0x49a061[_0x88a7('0x12')](0x1f4,_0x34b0a2[_0x88a7('0x13')]));});}})['catch'](function(_0x13583d){logger['error'](_0x88a7('0x16'),_0x13583d[_0x88a7('0x13')]);_0x3086fd(_0x49a061[_0x88a7('0x12')](0x1f4,_0x13583d[_0x88a7('0x13')]));});}else _0x28c99f({'additional':0x0});});});};exports[_0x88a7('0x29')]=function(_0x4de659){var _0x3867ec=this;return new Promise(function(_0x44a7d9,_0xf15103){return db[_0x88a7('0x17')][_0x88a7('0x18')]({'raw':!![],'where':{'ContactId':_0x4de659[_0x88a7('0x19')]['ContactId'],'ListId':_0x4de659['body'][_0x88a7('0x2a')],'VoiceQueueId':_0x4de659[_0x88a7('0x19')][_0x88a7('0x1a')]===undefined?null:_0x4de659[_0x88a7('0x19')][_0x88a7('0x1a')],'CampaignId':_0x4de659['body'][_0x88a7('0x1b')]===undefined?null:_0x4de659[_0x88a7('0x19')]['CampaignId']}})['then'](function(_0x4cefa8){if(_0x4cefa8!=null){return db[_0x88a7('0x27')][_0x88a7('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4cefa8['id'],'OrderBy':{'$gte':_0x4cefa8[_0x88a7('0x1c')]}},'order':[[_0x88a7('0x1c'),'ASC']]})[_0x88a7('0xc')](function(_0x36a7a8){if(_0x36a7a8)return activateAdditionalPhone(_0x4cefa8,_0x4de659[_0x88a7('0x19')],_0x36a7a8,_0x4de659[_0x88a7('0x2b')],_0x4de659[_0x88a7('0x2c')])['then'](function(_0x6d886c){_0x44a7d9(_0x6d886c);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4cefa8['id']},'order':[[_0x88a7('0x1c'),_0x88a7('0x1d')]]})[_0x88a7('0xc')](function(_0x3f36d7){if(_0x3f36d7)return activateAdditionalPhone(_0x4cefa8,_0x4de659[_0x88a7('0x19')],_0x3f36d7,_0x4de659[_0x88a7('0x2b')],_0x4de659[_0x88a7('0x2c')])[_0x88a7('0xc')](function(_0x1f4089){_0x44a7d9(_0x1f4089);});else{_0x44a7d9({'id':_0x4cefa8['id'],'phone':''});}})[_0x88a7('0x15')](function(_0x1ee504){logger[_0x88a7('0x12')]('VerifyAdditionalPhones',_0x1ee504[_0x88a7('0x13')]);_0xf15103(_0x3867ec[_0x88a7('0x12')](0x1f4,_0x1ee504[_0x88a7('0x13')]));});}})[_0x88a7('0x15')](function(_0x28b301){logger[_0x88a7('0x12')](_0x88a7('0x16'),_0x28b301[_0x88a7('0x13')]);_0xf15103(_0x3867ec[_0x88a7('0x12')](0x1f4,_0x28b301[_0x88a7('0x13')]));});}else _0x44a7d9(0x1);});});};function activateAdditionalPhone(_0x2eba50,_0x2777e9,_0x6114ad,_0x5afa23,_0x4896c1){return new Promise(function(_0x57b4df,_0x232894){var _0x2d8655;if(_['isNil'](_0x6114ad[_0x88a7('0x2d')])){_0x6114ad[_0x88a7('0x2d')]=moment();}if(moment()>moment(_0x6114ad['scheduledat'])){_0x2d8655=moment()[_0x88a7('0x2e')](_0x4896c1||0x3,'minutes');}else{if(_0x6114ad['OrderBy']==0x0){_0x2d8655=moment(_0x6114ad[_0x88a7('0x2d')]);}else{_0x2d8655=moment()['add'](_0x4896c1||0x3,_0x88a7('0x2f'));}}if(_['isNil'](_0x2d8655)){_0x2d8655=moment()[_0x88a7('0x2e')](_0x4896c1||0x3,_0x88a7('0x2f'));}var _0x210373={'phone':_0x2eba50[_0x88a7('0x30')],'active':0x0,'OrderBy':_[_0x88a7('0x31')](_0x2eba50[_0x88a7('0x1c')])?0x0:_0x2eba50[_0x88a7('0x1c')],'scheduledat':moment()[_0x88a7('0x2e')](_0x5afa23||0x1,_0x88a7('0x2f')),'countbusyretry':_0x2777e9[_0x88a7('0x1e')],'countcongestionretry':_0x2777e9['countcongestionretry'],'countnoanswerretry':_0x2777e9[_0x88a7('0x20')],'countnosuchnumberretry':_0x2777e9[_0x88a7('0x21')],'countdropretry':_0x2777e9[_0x88a7('0x28')],'countabandonedretry':_0x2777e9['countabandonedretry'],'countmachineretry':_0x2777e9[_0x88a7('0x23')],'countagentrejectretry':_0x2777e9[_0x88a7('0x24')],'createdAt':_0x2777e9[_0x88a7('0x32')],'updatedAt':_0x2777e9[_0x88a7('0x33')]};var _0x438ca6={'CmHopperId':_0x2eba50['id'],'phone':_0x6114ad['phone'],'active':0x0,'OrderBy':_[_0x88a7('0x31')](_0x6114ad[_0x88a7('0x1c')])?0x0:_0x6114ad[_0x88a7('0x1c')],'scheduledat':_0x2d8655,'countbusyretry':_0x6114ad['countbusyretry'],'countcongestionretry':_0x6114ad[_0x88a7('0x1f')],'countnoanswerretry':_0x6114ad[_0x88a7('0x20')],'countnosuchnumberretry':_0x6114ad[_0x88a7('0x21')],'countdropretry':_0x6114ad['countdropretry'],'countabandonedretry':_0x6114ad['countabandonedretry'],'countmachineretry':_0x6114ad['countmachineretry'],'countagentrejectretry':_0x6114ad[_0x88a7('0x24')],'createdAt':_0x6114ad[_0x88a7('0x32')],'updatedAt':_0x6114ad['updatedAt']};return db['sequelize'][_0x88a7('0x34')](function(_0x127f0f){return db[_0x88a7('0x27')][_0x88a7('0x35')](_0x210373,{'where':{'id':_0x6114ad['id']}},{'transaction':_0x127f0f})[_0x88a7('0xc')](function(){return db['CmHopper'][_0x88a7('0x35')](_0x438ca6,{'where':{'id':_0x2eba50['id']}},{'transaction':_0x127f0f});});})[_0x88a7('0xc')](function(_0x59eacd){_0x57b4df({'id':_0x2eba50['id'],'phone':_0x6114ad[_0x88a7('0x30')]});})[_0x88a7('0x15')](function(_0x44f07c){logger[_0x88a7('0x12')](_0x88a7('0x36'),_0x44f07c[_0x88a7('0x13')]);_0x232894({'error':_0x44f07c[_0x88a7('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x44f1c2){var _0x47b188=this;return new Promise(function(_0x26c8fa,_0x3dd32d){return db['CmHopper']['update'](_0x44f1c2[_0x88a7('0x19')]['field'],{'where':{'id':_0x44f1c2['body']['id']}})['then'](function(_0x3ac732){_0x26c8fa(_0x3ac732);})[_0x88a7('0x15')](function(_0xa8c475){logger[_0x88a7('0x12')](_0x88a7('0x37'),_0xa8c475[_0x88a7('0x13')]);_0x3dd32d(_0x47b188[_0x88a7('0x12')](0x1f4,_0xa8c475[_0x88a7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 789f78d..65dfa7e 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 _0x974f=['put','delete','exports','util','path','connect-timeout','express','get','isAuthenticated','index','/:id','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x974f,0x85));var _0xf974=function(_0x398f67,_0x3983db){_0x398f67=_0x398f67-0x0;var _0x5cfd44=_0x974f[_0x398f67];return _0x5cfd44;};'use strict';var multer=require('multer');var util=require(_0xf974('0x0'));var path=require(_0xf974('0x1'));var timeout=require(_0xf974('0x2'));var express=require(_0xf974('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0xf974('0x4')]('/',auth[_0xf974('0x5')](),controller[_0xf974('0x6')]);router[_0xf974('0x4')](_0xf974('0x7'),auth[_0xf974('0x5')](),controller['show']);router[_0xf974('0x8')]('/',auth[_0xf974('0x5')](),controller[_0xf974('0x9')]);router[_0xf974('0xa')](_0xf974('0x7'),auth[_0xf974('0x5')](),controller['update']);router[_0xf974('0xb')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf974('0xc')]=router; \ No newline at end of file +var _0x065f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','path','express','fs-extra'];(function(_0x14d507,_0x583185){var _0x14f333=function(_0x50e26f){while(--_0x50e26f){_0x14d507['push'](_0x14d507['shift']());}};_0x14f333(++_0x583185);}(_0x065f,0xac));var _0xf065=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x065f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xf065('0x0'));var util=require('util');var path=require(_0xf065('0x1'));var timeout=require('connect-timeout');var express=require(_0xf065('0x2'));var router=express['Router']();var fs_extra=require(_0xf065('0x3'));var auth=require(_0xf065('0x4'));var interaction=require(_0xf065('0x5'));var config=require(_0xf065('0x6'));var controller=require(_0xf065('0x7'));router['get']('/',auth[_0xf065('0x8')](),controller['index']);router['get'](_0xf065('0x9'),auth[_0xf065('0x8')](),controller[_0xf065('0xa')]);router['post']('/',auth[_0xf065('0x8')](),controller[_0xf065('0xb')]);router[_0xf065('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xf065('0xd')]);router[_0xf065('0xe')](_0xf065('0x9'),auth[_0xf065('0x8')](),controller[_0xf065('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a720cff..0f6d1f3 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 _0xa014=['sequelize','contactListQueue','INTEGER','moment'];(function(_0xe07b5,_0x3c457f){var _0xa5f676=function(_0x2edb04){while(--_0x2edb04){_0xe07b5['push'](_0xe07b5['shift']());}};_0xa5f676(++_0x3c457f);}(_0xa014,0xeb));var _0x4a01=function(_0x516ae4,_0x2ccb3e){_0x516ae4=_0x516ae4-0x0;var _0x5cb2ac=_0xa014[_0x516ae4];return _0x5cb2ac;};'use strict';var moment=require(_0x4a01('0x0'));var Sequelize=require(_0x4a01('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x4a01('0x2')},'ListId':{'type':Sequelize[_0x4a01('0x3')],'unique':_0x4a01('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4a01('0x2')}}; \ No newline at end of file +var _0xcf62=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x5bb761,_0x27a790){var _0x3fe5dd=function(_0x453fdc){while(--_0x453fdc){_0x5bb761['push'](_0x5bb761['shift']());}};_0x3fe5dd(++_0x27a790);}(_0xcf62,0x102));var _0x2cf6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xcf62[_0x4fbfd9];return _0x31dc94;};'use strict';var moment=require(_0x2cf6('0x0'));var Sequelize=require(_0x2cf6('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2cf6('0x2')],'unique':_0x2cf6('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x2cf6('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2cf6('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b2b09a6..21eede3 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 _0xfbbc=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce'];(function(_0x4aee28,_0x2beefc){var _0x696b01=function(_0x2b132e){while(--_0x2b132e){_0x4aee28['push'](_0x4aee28['shift']());}};_0x696b01(++_0x2beefc);}(_0xfbbc,0x86));var _0xcfbb=function(_0x1ba24d,_0xcf7475){_0x1ba24d=_0x1ba24d-0x0;var _0x3ae9d0=_0xfbbc[_0x1ba24d];return _0x3ae9d0;};'use strict';var emlformat=require(_0xcfbb('0x0'));var rimraf=require(_0xcfbb('0x1'));var zipdir=require(_0xcfbb('0x2'));var jsonpatch=require(_0xcfbb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfbb('0x4'));var Mustache=require('mustache');var util=require(_0xcfbb('0x5'));var path=require('path');var sox=require(_0xcfbb('0x6'));var csv=require(_0xcfbb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfbb('0x8'));var _=require('lodash');var squel=require(_0xcfbb('0x9'));var crypto=require(_0xcfbb('0xa'));var jsforce=require(_0xcfbb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcfbb('0x7'));var querystring=require(_0xcfbb('0xc'));var Papa=require(_0xcfbb('0xd'));var Redis=require(_0xcfbb('0xe'));var authService=require(_0xcfbb('0xf'));var qs=require(_0xcfbb('0x10'));var as=require(_0xcfbb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcfbb('0x12'));var utils=require(_0xcfbb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcfbb('0x14'));var db=require(_0xcfbb('0x15'))['db'];function respondWithStatusCode(_0x28bbf0,_0x52edb9){_0x52edb9=_0x52edb9||0xcc;return function(_0xf6a21){if(_0xf6a21){return _0x28bbf0[_0xcfbb('0x16')](_0x52edb9);}return _0x28bbf0[_0xcfbb('0x17')](_0x52edb9)['end']();};}function respondWithResult(_0x684c84,_0x3542bb){_0x3542bb=_0x3542bb||0xc8;return function(_0xdb5e68){if(_0xdb5e68){return _0x684c84[_0xcfbb('0x17')](_0x3542bb)['json'](_0xdb5e68);}};}function respondWithFilteredResult(_0x3fdf65,_0x3c3e6e){return function(_0x3d0e9e){if(_0x3d0e9e){var _0x529df2=typeof _0x3c3e6e[_0xcfbb('0x18')]==='undefined'&&typeof _0x3c3e6e[_0xcfbb('0x19')]==='undefined';var _0x47fe32=_0x3d0e9e['count'];var _0x7537b4=_0x529df2?0x0:_0x3c3e6e[_0xcfbb('0x18')];var _0x43846f=_0x529df2?_0x3d0e9e[_0xcfbb('0x1a')]:_0x3c3e6e[_0xcfbb('0x18')]+_0x3c3e6e['limit'];var _0xfb2f9;if(_0x43846f>=_0x47fe32){_0x43846f=_0x47fe32;_0xfb2f9=0xc8;}else{_0xfb2f9=0xce;}_0x3fdf65['status'](_0xfb2f9);return _0x3fdf65[_0xcfbb('0x1b')](_0xcfbb('0x1c'),_0x7537b4+'-'+_0x43846f+'/'+_0x47fe32)[_0xcfbb('0x1d')](_0x3d0e9e);}return null;};}function patchUpdates(_0x2a63c5){return function(_0x292036){try{jsonpatch[_0xcfbb('0x1e')](_0x292036,_0x2a63c5,!![]);}catch(_0x1d907b){return BPromise[_0xcfbb('0x1f')](_0x1d907b);}return _0x292036[_0xcfbb('0x20')]();};}function saveUpdates(_0x3d361b,_0x571f32){return function(_0x283aed){if(_0x283aed){return _0x283aed[_0xcfbb('0x21')](_0x3d361b)[_0xcfbb('0x22')](function(_0x93215d){return _0x93215d;});}return null;};}function removeEntity(_0x2b94e6,_0x224345){return function(_0x1d8161){if(_0x1d8161){return _0x1d8161[_0xcfbb('0x23')]()[_0xcfbb('0x22')](function(){_0x2b94e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x432490,_0x1a0cae){return function(_0x234a9a){if(!_0x234a9a){_0x432490[_0xcfbb('0x16')](0x194);}return _0x234a9a;};}function handleError(_0x3a6a4f,_0x3aa4cc){_0x3aa4cc=_0x3aa4cc||0x1f4;return function(_0x574ff5){logger[_0xcfbb('0x24')](_0x574ff5[_0xcfbb('0x25')]);if(_0x574ff5['name']){delete _0x574ff5[_0xcfbb('0x26')];}_0x3a6a4f[_0xcfbb('0x17')](_0x3aa4cc)[_0xcfbb('0x27')](_0x574ff5);};}exports[_0xcfbb('0x28')]=function(_0x1c0323,_0x235aa1){var _0x5a6165={},_0x2130f9={},_0x102cc4={'count':0x0,'rows':[]};var _0x593e5d=_[_0xcfbb('0x29')](db[_0xcfbb('0x2a')][_0xcfbb('0x2b')],function(_0x2bc190){return{'name':_0x2bc190[_0xcfbb('0x2c')],'type':_0x2bc190[_0xcfbb('0x2d')][_0xcfbb('0x2e')]};});_0x2130f9[_0xcfbb('0x2f')]=_[_0xcfbb('0x29')](_0x593e5d,'name');_0x2130f9[_0xcfbb('0x30')]=_['keys'](_0x1c0323[_0xcfbb('0x30')]);_0x2130f9['filters']=_[_0xcfbb('0x31')](_0x2130f9[_0xcfbb('0x2f')],_0x2130f9['query']);_0x5a6165['attributes']=_[_0xcfbb('0x31')](_0x2130f9[_0xcfbb('0x2f')],qs[_0xcfbb('0x32')](_0x1c0323[_0xcfbb('0x30')][_0xcfbb('0x32')]));_0x5a6165[_0xcfbb('0x33')]=_0x5a6165['attributes'][_0xcfbb('0x34')]?_0x5a6165[_0xcfbb('0x33')]:_0x2130f9[_0xcfbb('0x2f')];if(!_0x1c0323[_0xcfbb('0x30')]['hasOwnProperty'](_0xcfbb('0x35'))){_0x5a6165[_0xcfbb('0x19')]=qs[_0xcfbb('0x19')](_0x1c0323[_0xcfbb('0x30')]['limit']);_0x5a6165['offset']=qs['offset'](_0x1c0323['query'][_0xcfbb('0x18')]);}_0x5a6165[_0xcfbb('0x36')]=qs[_0xcfbb('0x37')](_0x1c0323[_0xcfbb('0x30')][_0xcfbb('0x37')]);_0x5a6165[_0xcfbb('0x38')]=qs[_0xcfbb('0x39')](_[_0xcfbb('0x3a')](_0x1c0323['query'],_0x2130f9[_0xcfbb('0x39')]),_0x593e5d);if(_0x1c0323[_0xcfbb('0x30')][_0xcfbb('0x3b')]){_0x5a6165['where']=_[_0xcfbb('0x3c')](_0x5a6165['where'],{'$or':_['map'](_0x593e5d,function(_0x4ef9f6){if(_0x4ef9f6[_0xcfbb('0x2d')]!==_0xcfbb('0x3d')){var _0x5c8591={};_0x5c8591[_0x4ef9f6['name']]={'$like':'%'+_0x1c0323['query'][_0xcfbb('0x3b')]+'%'};return _0x5c8591;}})});}_0x5a6165=_[_0xcfbb('0x3c')]({},_0x5a6165,_0x1c0323[_0xcfbb('0x3e')]);var _0x3570f7={'where':_0x5a6165['where']};return db[_0xcfbb('0x2a')][_0xcfbb('0x1a')](_0x3570f7)['then'](function(_0x3e2052){_0x102cc4[_0xcfbb('0x1a')]=_0x3e2052;if(_0x1c0323[_0xcfbb('0x30')][_0xcfbb('0x3f')]){_0x5a6165['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x5a6165);})[_0xcfbb('0x22')](function(_0x61bb58){_0x102cc4[_0xcfbb('0x40')]=_0x61bb58;return _0x102cc4;})[_0xcfbb('0x22')](respondWithFilteredResult(_0x235aa1,_0x5a6165))[_0xcfbb('0x41')](handleError(_0x235aa1,null));};exports[_0xcfbb('0x42')]=function(_0x726189,_0x4d418a){var _0x4dba0e={'raw':!![],'where':{'id':_0x726189[_0xcfbb('0x43')]['id']}},_0x1efc27={};_0x1efc27['model']=_[_0xcfbb('0x44')](db[_0xcfbb('0x2a')][_0xcfbb('0x2b')]);_0x1efc27[_0xcfbb('0x30')]=_[_0xcfbb('0x44')](_0x726189['query']);_0x1efc27['filters']=_['intersection'](_0x1efc27[_0xcfbb('0x2f')],_0x1efc27[_0xcfbb('0x30')]);_0x4dba0e[_0xcfbb('0x33')]=_['intersection'](_0x1efc27[_0xcfbb('0x2f')],qs['fields'](_0x726189['query'][_0xcfbb('0x32')]));_0x4dba0e[_0xcfbb('0x33')]=_0x4dba0e[_0xcfbb('0x33')]['length']?_0x4dba0e[_0xcfbb('0x33')]:_0x1efc27[_0xcfbb('0x2f')];if(_0x726189[_0xcfbb('0x30')]['includeAll']){_0x4dba0e[_0xcfbb('0x45')]=[{'all':!![]}];}_0x4dba0e=_[_0xcfbb('0x3c')]({},_0x4dba0e,_0x726189[_0xcfbb('0x3e')]);return db[_0xcfbb('0x2a')][_0xcfbb('0x46')](_0x4dba0e)[_0xcfbb('0x22')](handleEntityNotFound(_0x4d418a,null))[_0xcfbb('0x22')](respondWithResult(_0x4d418a,null))[_0xcfbb('0x41')](handleError(_0x4d418a,null));};exports[_0xcfbb('0x21')]=function(_0x16d251,_0x4123e9){if(_0x16d251['body']['id']){delete _0x16d251[_0xcfbb('0x47')]['id'];}return db[_0xcfbb('0x2a')][_0xcfbb('0x46')]({'where':{'id':_0x16d251[_0xcfbb('0x43')]['id']}})[_0xcfbb('0x22')](handleEntityNotFound(_0x4123e9,null))[_0xcfbb('0x22')](saveUpdates(_0x16d251[_0xcfbb('0x47')],null))[_0xcfbb('0x22')](respondWithResult(_0x4123e9,null))[_0xcfbb('0x41')](handleError(_0x4123e9,null));};exports[_0xcfbb('0x23')]=function(_0x3a8f12,_0x4de618){return db[_0xcfbb('0x2a')][_0xcfbb('0x46')]({'where':{'id':_0x3a8f12[_0xcfbb('0x43')]['id']}})[_0xcfbb('0x22')](handleEntityNotFound(_0x4de618,null))[_0xcfbb('0x22')](removeEntity(_0x4de618,null))[_0xcfbb('0x41')](handleError(_0x4de618,null));};exports['describe']=function(_0x3aa7a6,_0x71e3f5){return db['CmHopperBlack'][_0xcfbb('0x48')]()[_0xcfbb('0x22')](respondWithResult(_0x71e3f5,null))[_0xcfbb('0x41')](handleError(_0x71e3f5,null));}; \ No newline at end of file +var _0x01d9=['map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x4091b0,_0x521b1c){var _0x46be1c=function(_0x18b19a){while(--_0x18b19a){_0x4091b0['push'](_0x4091b0['shift']());}};_0x46be1c(++_0x521b1c);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['CmHopperBlack'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x27')]=function(_0x24b6fa,_0x27459b){if(_0x24b6fa[_0x901d('0x4b')]['id']){delete _0x24b6fa[_0x901d('0x4b')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x24b6fa[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x27459b,null))[_0x901d('0x28')](saveUpdates(_0x24b6fa['body'],null))['then'](respondWithResult(_0x27459b,null))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x29')]=function(_0x1040af,_0x6b6b9c){return db[_0x901d('0x2f')]['find']({'where':{'id':_0x1040af['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x6b6b9c,null))[_0x901d('0x28')](removeEntity(_0x6b6b9c,null))['catch'](handleError(_0x6b6b9c,null));};exports[_0x901d('0x4c')]=function(_0x165207,_0x4d2b2d){return db[_0x901d('0x2f')]['describe']()[_0x901d('0x28')](respondWithResult(_0x4d2b2d,null))[_0x901d('0x46')](handleError(_0x4d2b2d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 51fe946..771c038 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 _0x9179=['request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','util','../../config/logger','moment'];(function(_0xcdc5a7,_0x44ecc8){var _0x116b93=function(_0x232c59){while(--_0x232c59){_0xcdc5a7['push'](_0xcdc5a7['shift']());}};_0x116b93(++_0x44ecc8);}(_0x9179,0x1e7));var _0x9917=function(_0x33120e,_0xf12920){_0x33120e=_0x33120e-0x0;var _0x4abc61=_0x9179[_0x33120e];return _0x4abc61;};'use strict';var _=require('lodash');var util=require(_0x9917('0x0'));var logger=require(_0x9917('0x1'))('api');var moment=require(_0x9917('0x2'));var BPromise=require('bluebird');var rp=require(_0x9917('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9917('0x4'));var config=require(_0x9917('0x5'));var attributes=require(_0x9917('0x6'));module[_0x9917('0x7')]=function(_0x53dd5a,_0x2df954){return _0x53dd5a['define'](_0x9917('0x8'),attributes,{'tableName':_0x9917('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77cc=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4615c7,_0x6d6e6d){var _0x3a3635=function(_0x16886b){while(--_0x16886b){_0x4615c7['push'](_0x4615c7['shift']());}};_0x3a3635(++_0x6d6e6d);}(_0x77cc,0x1ac));var _0xc77c=function(_0x437aa2,_0x48d508){_0x437aa2=_0x437aa2-0x0;var _0x28ac4d=_0x77cc[_0x437aa2];return _0x28ac4d;};'use strict';var _=require(_0xc77c('0x0'));var util=require(_0xc77c('0x1'));var logger=require(_0xc77c('0x2'))(_0xc77c('0x3'));var moment=require('moment');var BPromise=require(_0xc77c('0x4'));var rp=require(_0xc77c('0x5'));var fs=require('fs');var path=require(_0xc77c('0x6'));var rimraf=require(_0xc77c('0x7'));var config=require(_0xc77c('0x8'));var attributes=require(_0xc77c('0x9'));module[_0xc77c('0xa')]=function(_0x88b735,_0x5a97ac){return _0x88b735[_0xc77c('0xb')](_0xc77c('0xc'),attributes,{'tableName':_0xc77c('0xd'),'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 7dd4a57..90c0f42 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 _0xb0bd=['limit','include','model','map','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetCmHopperBlack','findAll','options','raw','where','attributes'];(function(_0x2061fc,_0x292cd4){var _0xc89bd5=function(_0x5c9cc1){while(--_0x5c9cc1){_0x2061fc['push'](_0x2061fc['shift']());}};_0xc89bd5(++_0x292cd4);}(_0xb0bd,0x17d));var _0xdb0b=function(_0x10f66e,_0x64907e){_0x10f66e=_0x10f66e-0x0;var _0x5693ce=_0xb0bd[_0x10f66e];return _0x5693ce;};'use strict';var _=require('lodash');var util=require(_0xdb0b('0x0'));var moment=require(_0xdb0b('0x1'));var BPromise=require(_0xdb0b('0x2'));var rs=require(_0xdb0b('0x3'));var fs=require('fs');var Redis=require(_0xdb0b('0x4'));var db=require(_0xdb0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdb0b('0x6'));var config=require(_0xdb0b('0x7'));var jayson=require(_0xdb0b('0x8'));var client=jayson[_0xdb0b('0x9')][_0xdb0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30469b,_0x4389bf,_0x2ad72f){return new BPromise(function(_0x1db705,_0x17a74c){return client['request'](_0x30469b,_0x2ad72f)[_0xdb0b('0xb')](function(_0x3329ae){logger[_0xdb0b('0xc')](_0xdb0b('0xd'),_0x4389bf,'request\x20sent');logger[_0xdb0b('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4389bf,_0xdb0b('0xf'),JSON[_0xdb0b('0x10')](_0x3329ae));if(_0x3329ae[_0xdb0b('0x11')]){if(_0x3329ae['error'][_0xdb0b('0x12')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x4389bf,_0x3329ae[_0xdb0b('0x11')][_0xdb0b('0x13')]);return _0x17a74c(_0x3329ae['error'][_0xdb0b('0x13')]);}logger['error'](_0xdb0b('0xd'),_0x4389bf,_0x3329ae[_0xdb0b('0x11')][_0xdb0b('0x13')]);return _0x1db705(_0x3329ae['error']['message']);}else{logger[_0xdb0b('0xc')](_0xdb0b('0xd'),_0x4389bf,_0xdb0b('0xf'));_0x1db705(_0x3329ae['result']['message']);}})[_0xdb0b('0x14')](function(_0x57ac41){logger['error'](_0xdb0b('0xd'),_0x4389bf,_0x57ac41);_0x17a74c(_0x57ac41);});});}exports[_0xdb0b('0x15')]=function(_0x417161){var _0x4a5be3=this;return new Promise(function(_0x302ce1,_0x26c784){return db['CmHopperBlack'][_0xdb0b('0x16')]({'raw':_0x417161[_0xdb0b('0x17')]?_0x417161[_0xdb0b('0x17')][_0xdb0b('0x18')]===undefined?!![]:![]:!![],'where':_0x417161['options']?_0x417161[_0xdb0b('0x17')][_0xdb0b('0x19')]||null:null,'attributes':_0x417161[_0xdb0b('0x17')]?_0x417161['options'][_0xdb0b('0x1a')]||null:null,'limit':_0x417161['options']?_0x417161[_0xdb0b('0x17')][_0xdb0b('0x1b')]||null:null,'include':_0x417161['options']?_0x417161[_0xdb0b('0x17')][_0xdb0b('0x1c')]?_['map'](_0x417161[_0xdb0b('0x17')][_0xdb0b('0x1c')],function(_0x54c355){return{'model':db[_0x54c355[_0xdb0b('0x1d')]],'as':_0x54c355['as'],'attributes':_0x54c355[_0xdb0b('0x1a')],'include':_0x54c355['include']?_[_0xdb0b('0x1e')](_0x54c355[_0xdb0b('0x1c')],function(_0x56b1a5){return{'model':db[_0x56b1a5['model']],'as':_0x56b1a5['as'],'attributes':_0x56b1a5[_0xdb0b('0x1a')],'include':_0x56b1a5[_0xdb0b('0x1c')]?_[_0xdb0b('0x1e')](_0x56b1a5[_0xdb0b('0x1c')],function(_0x8a387e){return{'model':db[_0x8a387e[_0xdb0b('0x1d')]],'as':_0x8a387e['as'],'attributes':_0x8a387e['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb0b('0xb')](function(_0x1df43d){logger[_0xdb0b('0xc')](_0xdb0b('0x15'),_0x417161);logger['debug'](_0xdb0b('0x15'),_0x417161,JSON[_0xdb0b('0x10')](_0x1df43d));_0x302ce1(_0x1df43d);})[_0xdb0b('0x14')](function(_0x1e02a8){logger['error'](_0xdb0b('0x15'),_0x1e02a8[_0xdb0b('0x13')],_0x417161);_0x26c784(_0x4a5be3[_0xdb0b('0x11')](0x1f4,_0x1e02a8[_0xdb0b('0x13')]));});});};exports[_0xdb0b('0x1f')]=function(_0x3ea3e8){var _0x18364b=this;return new Promise(function(_0x9290f8,_0x543d01){return db['CmHopperBlack']['update'](_0x3ea3e8['body'],{'raw':_0x3ea3e8[_0xdb0b('0x17')]?_0x3ea3e8[_0xdb0b('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ea3e8[_0xdb0b('0x17')]?_0x3ea3e8['options'][_0xdb0b('0x19')]||null:null,'attributes':_0x3ea3e8['options']?_0x3ea3e8['options'][_0xdb0b('0x1a')]||null:null,'limit':_0x3ea3e8[_0xdb0b('0x17')]?_0x3ea3e8[_0xdb0b('0x17')][_0xdb0b('0x1b')]||null:null})[_0xdb0b('0xb')](function(_0x157271){logger['info'](_0xdb0b('0x1f'),_0x3ea3e8);logger[_0xdb0b('0xe')]('UpdateCmHopperBlack',_0x3ea3e8,JSON['stringify'](_0x157271));_0x9290f8(_0x157271);})[_0xdb0b('0x14')](function(_0xefa772){logger[_0xdb0b('0x11')](_0xdb0b('0x1f'),_0xefa772[_0xdb0b('0x13')],_0x3ea3e8);_0x543d01(_0x18364b['error'](0x1f4,_0xefa772[_0xdb0b('0x13')]));});});};exports[_0xdb0b('0x20')]=function(_0x401776){var _0x2c5f7e=this;return new Promise(function(_0x419c76,_0x57e021){return db['CmHopperBlack'][_0xdb0b('0x21')]({'where':_0x401776[_0xdb0b('0x17')]?_0x401776[_0xdb0b('0x17')]['where']||null:null})[_0xdb0b('0xb')](function(_0x35de0a){logger['info'](_0xdb0b('0x20'),_0x401776);logger[_0xdb0b('0xe')](_0xdb0b('0x20'),_0x401776,JSON[_0xdb0b('0x10')](_0x35de0a));_0x419c76(_0x35de0a);})[_0xdb0b('0x14')](function(_0x33d3ab){logger[_0xdb0b('0x11')]('DestroyCmHopperBlack',_0x33d3ab[_0xdb0b('0x13')],_0x401776);_0x57e021(_0x2c5f7e[_0xdb0b('0x11')](0x1f4,_0x33d3ab[_0xdb0b('0x13')]));});});}; \ No newline at end of file +var _0x2466=['../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','limit','include','map','model','attributes','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xb1cbf9,_0x1aef47){var _0x42ffcf=function(_0x53a93e){while(--_0x53a93e){_0xb1cbf9['push'](_0xb1cbf9['shift']());}};_0x42ffcf(++_0x1aef47);}(_0x2466,0x6a));var _0x6246=function(_0x3d4787,_0x4dc553){_0x3d4787=_0x3d4787-0x0;var _0x450480=_0x2466[_0x3d4787];return _0x450480;};'use strict';var _=require(_0x6246('0x0'));var util=require(_0x6246('0x1'));var moment=require(_0x6246('0x2'));var BPromise=require('bluebird');var rs=require(_0x6246('0x3'));var fs=require('fs');var Redis=require(_0x6246('0x4'));var db=require(_0x6246('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6246('0x6'))(_0x6246('0x7'));var config=require(_0x6246('0x8'));var jayson=require(_0x6246('0x9'));var client=jayson[_0x6246('0xa')][_0x6246('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x209ef5,_0x2467d4,_0x3a50f9){return new BPromise(function(_0x1e331f,_0x39cfe9){return client[_0x6246('0xc')](_0x209ef5,_0x3a50f9)[_0x6246('0xd')](function(_0x368c83){logger[_0x6246('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x2467d4,'request\x20sent');logger['debug'](_0x6246('0xf'),_0x2467d4,'request\x20sent',JSON[_0x6246('0x10')](_0x368c83));if(_0x368c83[_0x6246('0x11')]){if(_0x368c83['error']['code']===0x1f4){logger[_0x6246('0x11')](_0x6246('0x12'),_0x2467d4,_0x368c83[_0x6246('0x11')][_0x6246('0x13')]);return _0x39cfe9(_0x368c83['error'][_0x6246('0x13')]);}logger[_0x6246('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x2467d4,_0x368c83['error'][_0x6246('0x13')]);return _0x1e331f(_0x368c83[_0x6246('0x11')][_0x6246('0x13')]);}else{logger[_0x6246('0xe')](_0x6246('0x12'),_0x2467d4,'request\x20sent');_0x1e331f(_0x368c83[_0x6246('0x14')]['message']);}})[_0x6246('0x15')](function(_0x2df66c){logger[_0x6246('0x11')](_0x6246('0x12'),_0x2467d4,_0x2df66c);_0x39cfe9(_0x2df66c);});});}exports[_0x6246('0x16')]=function(_0x12b023){var _0xaaf8d1=this;return new Promise(function(_0x3040a7,_0x505cdb){return db[_0x6246('0x17')][_0x6246('0x18')]({'raw':_0x12b023['options']?_0x12b023[_0x6246('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x12b023[_0x6246('0x19')]?_0x12b023[_0x6246('0x19')][_0x6246('0x1a')]||null:null,'attributes':_0x12b023['options']?_0x12b023['options']['attributes']||null:null,'limit':_0x12b023[_0x6246('0x19')]?_0x12b023[_0x6246('0x19')][_0x6246('0x1b')]||null:null,'include':_0x12b023[_0x6246('0x19')]?_0x12b023[_0x6246('0x19')][_0x6246('0x1c')]?_[_0x6246('0x1d')](_0x12b023['options'][_0x6246('0x1c')],function(_0x5113ca){return{'model':db[_0x5113ca[_0x6246('0x1e')]],'as':_0x5113ca['as'],'attributes':_0x5113ca['attributes'],'include':_0x5113ca['include']?_['map'](_0x5113ca[_0x6246('0x1c')],function(_0x52bce9){return{'model':db[_0x52bce9[_0x6246('0x1e')]],'as':_0x52bce9['as'],'attributes':_0x52bce9[_0x6246('0x1f')],'include':_0x52bce9[_0x6246('0x1c')]?_[_0x6246('0x1d')](_0x52bce9[_0x6246('0x1c')],function(_0x4b3fd6){return{'model':db[_0x4b3fd6[_0x6246('0x1e')]],'as':_0x4b3fd6['as'],'attributes':_0x4b3fd6[_0x6246('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6246('0xd')](function(_0x3fe106){logger[_0x6246('0xe')](_0x6246('0x16'),_0x12b023);logger[_0x6246('0x20')]('GetCmHopperBlack',_0x12b023,JSON[_0x6246('0x10')](_0x3fe106));_0x3040a7(_0x3fe106);})[_0x6246('0x15')](function(_0x1a6061){logger[_0x6246('0x11')](_0x6246('0x16'),_0x1a6061[_0x6246('0x13')],_0x12b023);_0x505cdb(_0xaaf8d1['error'](0x1f4,_0x1a6061['message']));});});};exports[_0x6246('0x21')]=function(_0x5e5263){var _0x26199b=this;return new Promise(function(_0x580707,_0x50b81e){return db[_0x6246('0x17')][_0x6246('0x22')](_0x5e5263[_0x6246('0x23')],{'raw':_0x5e5263[_0x6246('0x19')]?_0x5e5263[_0x6246('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5263['options']?_0x5e5263[_0x6246('0x19')]['where']||null:null,'attributes':_0x5e5263[_0x6246('0x19')]?_0x5e5263['options'][_0x6246('0x1f')]||null:null,'limit':_0x5e5263['options']?_0x5e5263['options'][_0x6246('0x1b')]||null:null})[_0x6246('0xd')](function(_0x537ca7){logger['info']('UpdateCmHopperBlack',_0x5e5263);logger[_0x6246('0x20')](_0x6246('0x21'),_0x5e5263,JSON[_0x6246('0x10')](_0x537ca7));_0x580707(_0x537ca7);})[_0x6246('0x15')](function(_0x21398d){logger[_0x6246('0x11')](_0x6246('0x21'),_0x21398d[_0x6246('0x13')],_0x5e5263);_0x50b81e(_0x26199b[_0x6246('0x11')](0x1f4,_0x21398d[_0x6246('0x13')]));});});};exports[_0x6246('0x24')]=function(_0x2e4ccb){var _0x42b4cc=this;return new Promise(function(_0xeb86fd,_0x49acf2){return db[_0x6246('0x17')][_0x6246('0x25')]({'where':_0x2e4ccb[_0x6246('0x19')]?_0x2e4ccb[_0x6246('0x19')][_0x6246('0x1a')]||null:null})['then'](function(_0x55ffa5){logger[_0x6246('0xe')]('DestroyCmHopperBlack',_0x2e4ccb);logger['debug'](_0x6246('0x24'),_0x2e4ccb,JSON[_0x6246('0x10')](_0x55ffa5));_0xeb86fd(_0x55ffa5);})[_0x6246('0x15')](function(_0x114d12){logger[_0x6246('0x11')](_0x6246('0x24'),_0x114d12[_0x6246('0x13')],_0x2e4ccb);_0x49acf2(_0x42b4cc['error'](0x1f4,_0x114d12[_0x6246('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1825340..90badf2 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 _0x4975=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x4975,0x86));var _0x5497=function(_0x2f6d9a,_0x5df79d){_0x2f6d9a=_0x2f6d9a-0x0;var _0x793ca4=_0x4975[_0x2f6d9a];return _0x793ca4;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xafb9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x49c002,_0xc95790){var _0x550cc6=function(_0x136c2b){while(--_0x136c2b){_0x49c002['push'](_0x49c002['shift']());}};_0x550cc6(++_0xc95790);}(_0xafb9,0x68));var _0x9afb=function(_0x1d2bea,_0x5e06f7){_0x1d2bea=_0x1d2bea-0x0;var _0x1b4f88=_0xafb9[_0x1d2bea];return _0x1b4f88;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0xe')](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller['update']);router['delete'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);module[_0x9afb('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5703655..298b31d 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 _0x8a77=['INTEGER','STRING','DATE','endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment'];(function(_0x27a290,_0x16efbf){var _0x1c8298=function(_0x431c6a){while(--_0x431c6a){_0x27a290['push'](_0x27a290['shift']());}};_0x1c8298(++_0x16efbf);}(_0x8a77,0xe4));var _0x78a7=function(_0x4833b0,_0x384caf){_0x4833b0=_0x4833b0-0x0;var _0x1a7ad3=_0x8a77[_0x4833b0];return _0x1a7ad3;};'use strict';var Sequelize=require(_0x78a7('0x0'));var moment=require(_0x78a7('0x1'));module['exports']={'state':{'type':Sequelize[_0x78a7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x78a7('0x3')]},'scheduledat':{'type':Sequelize[_0x78a7('0x4')]},'countbusyretry':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x78a7('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x78a7('0x3')]},'calleridnum':{'type':Sequelize[_0x78a7('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x78a7('0x4')]},'responsetime':{'type':Sequelize[_0x78a7('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x78a7('0x4')]},'endtime':{'type':Sequelize[_0x78a7('0x4')]},'ringtime':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x78a7('0x3')]},'campaign':{'type':Sequelize[_0x78a7('0x3')]},'campaigntype':{'type':Sequelize[_0x78a7('0x3')]},'membername':{'type':Sequelize[_0x78a7('0x3')]},'reason':{'type':Sequelize[_0x78a7('0x3')]},'disposition':{'type':Sequelize[_0x78a7('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x78a7('0x4')],'set':function(_0x34a68d){var _0x9d9776=this['getDataValue'](_0x78a7('0x5'));if(_0x9d9776&&_0x34a68d){this[_0x78a7('0x6')](_0x78a7('0x7'),moment(_0x34a68d)['diff'](moment(_0x9d9776),_0x78a7('0x8')));}}},'amd':{'type':Sequelize[_0x78a7('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x78a7('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x78a7('0x4')]},'callback':{'type':Sequelize[_0x78a7('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x78a7('0x4')]},'deleted':{'type':Sequelize[_0x78a7('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x78a7('0x4')]},'recallme':{'type':Sequelize[_0x78a7('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x78a7('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x78a7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb58=['exports','STRING','DATE','INTEGER','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize'];(function(_0xf248da,_0x51dbd2){var _0x3dd20e=function(_0x3506a7){while(--_0x3506a7){_0xf248da['push'](_0xf248da['shift']());}};_0x3dd20e(++_0x51dbd2);}(_0xcb58,0x1a3));var _0x8cb5=function(_0x139016,_0xffbd4e){_0x139016=_0x139016-0x0;var _0x36da7c=_0xcb58[_0x139016];return _0x36da7c;};'use strict';var Sequelize=require(_0x8cb5('0x0'));var moment=require('moment');module[_0x8cb5('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8cb5('0x2')]},'scheduledat':{'type':Sequelize[_0x8cb5('0x3')]},'countbusyretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8cb5('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x8cb5('0x2')]},'originatecalleridname':{'type':Sequelize[_0x8cb5('0x2')]},'calleridnum':{'type':Sequelize[_0x8cb5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8cb5('0x3')]},'responsetime':{'type':Sequelize[_0x8cb5('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8cb5('0x3')]},'endtime':{'type':Sequelize[_0x8cb5('0x3')]},'ringtime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8cb5('0x2')]},'campaign':{'type':Sequelize[_0x8cb5('0x2')]},'campaigntype':{'type':Sequelize[_0x8cb5('0x2')]},'membername':{'type':Sequelize[_0x8cb5('0x2')]},'reason':{'type':Sequelize[_0x8cb5('0x2')]},'disposition':{'type':Sequelize[_0x8cb5('0x2')]},'secondDisposition':{'type':Sequelize[_0x8cb5('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8cb5('0x2')]},'dispositionat':{'type':Sequelize[_0x8cb5('0x3')],'set':function(_0x5d4f29){var _0x4be419=this['getDataValue'](_0x8cb5('0x5'));if(_0x4be419&&_0x5d4f29){this[_0x8cb5('0x6')]('followuptime',moment(_0x5d4f29)[_0x8cb5('0x7')](moment(_0x4be419),_0x8cb5('0x8')));}}},'amd':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x8cb5('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8cb5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8cb5('0x3')]},'deleted':{'type':Sequelize[_0x8cb5('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8cb5('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8cb5('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8cb5('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 62b7cab..6cb4be4 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 _0xf494=['find','describe','body','uniqueid','params','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','COUNT','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','reCallContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','ANY_VALUE(calleridnum)','field','NOW()','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperFinal','includeAll','include','findAll','rows','catch','length'];(function(_0x47da57,_0x2f6d23){var _0x2c69b7=function(_0x2cd383){while(--_0x2cd383){_0x47da57['push'](_0x47da57['shift']());}};_0x2c69b7(++_0x2f6d23);}(_0xf494,0x1c6));var _0x4f49=function(_0x40adae,_0xc2be0c){_0x40adae=_0x40adae-0x0;var _0x22fd95=_0xf494[_0x40adae];return _0x22fd95;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}exports[_0x4f49('0x29')]=function(_0x2c00ee,_0x605c91){var _0x560050={},_0x3cbfbd={},_0x206203={'count':0x0,'rows':[]};var _0x43d8e3=_['map'](db['CmHopperFinal'][_0x4f49('0x2a')],function(_0x27d004){return{'name':_0x27d004[_0x4f49('0x2b')],'type':_0x27d004['type'][_0x4f49('0x2c')]};});_0x3cbfbd[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x43d8e3,_0x4f49('0x28'));_0x3cbfbd[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x2c00ee[_0x4f49('0x2f')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],_0x3cbfbd[_0x4f49('0x2f')]);_0x560050[_0x4f49('0x33')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x34')]));_0x560050[_0x4f49('0x33')]=_0x560050[_0x4f49('0x33')]['length']?_0x560050[_0x4f49('0x33')]:_0x3cbfbd[_0x4f49('0x2d')];if(!_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x35')](_0x4f49('0x36'))){_0x560050[_0x4f49('0x1f')]=qs[_0x4f49('0x1f')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1f')]);_0x560050[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1d')]);}_0x560050['order']=qs[_0x4f49('0x37')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x37')]);_0x560050[_0x4f49('0x38')]=qs[_0x4f49('0x31')](_[_0x4f49('0x39')](_0x2c00ee[_0x4f49('0x2f')],_0x3cbfbd[_0x4f49('0x31')]),_0x43d8e3);if(_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x3a')]){_0x560050[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0x560050[_0x4f49('0x38')],{'$or':_[_0x4f49('0x2e')](_0x43d8e3,function(_0x4e3f72){if(_0x4e3f72[_0x4f49('0x3c')]!==_0x4f49('0x3d')){var _0x543605={};_0x543605[_0x4e3f72[_0x4f49('0x28')]]={'$like':'%'+_0x2c00ee[_0x4f49('0x2f')]['filter']+'%'};return _0x543605;}})});}_0x560050=_[_0x4f49('0x3b')]({},_0x560050,_0x2c00ee[_0x4f49('0x3e')]);var _0x2548ad={'where':_0x560050[_0x4f49('0x38')]};return db[_0x4f49('0x3f')][_0x4f49('0x20')](_0x2548ad)[_0x4f49('0x25')](function(_0x5d464e){_0x206203['count']=_0x5d464e;if(_0x2c00ee['query'][_0x4f49('0x40')]){_0x560050[_0x4f49('0x41')]=[{'all':!![]}];}return db[_0x4f49('0x3f')][_0x4f49('0x42')](_0x560050);})[_0x4f49('0x25')](function(_0x1ecf6c){_0x206203[_0x4f49('0x43')]=_0x1ecf6c;return _0x206203;})[_0x4f49('0x25')](respondWithFilteredResult(_0x605c91,_0x560050))[_0x4f49('0x44')](handleError(_0x605c91,null));};exports['show']=function(_0x5238a3,_0x412395){var _0x432b5d={'raw':!![],'where':{'id':_0x5238a3['params']['id']}},_0x159642={};_0x159642[_0x4f49('0x2d')]=_['keys'](db['CmHopperFinal'][_0x4f49('0x2a')]);_0x159642[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x5238a3['query']);_0x159642[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x159642['model'],_0x159642[_0x4f49('0x2f')]);_0x432b5d['attributes']=_[_0x4f49('0x32')](_0x159642[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x5238a3['query'][_0x4f49('0x34')]));_0x432b5d[_0x4f49('0x33')]=_0x432b5d[_0x4f49('0x33')][_0x4f49('0x45')]?_0x432b5d[_0x4f49('0x33')]:_0x159642[_0x4f49('0x2d')];if(_0x5238a3[_0x4f49('0x2f')][_0x4f49('0x40')]){_0x432b5d[_0x4f49('0x41')]=[{'all':!![]}];}_0x432b5d=_[_0x4f49('0x3b')]({},_0x432b5d,_0x5238a3['options']);return db[_0x4f49('0x3f')][_0x4f49('0x46')](_0x432b5d)['then'](handleEntityNotFound(_0x412395,null))[_0x4f49('0x25')](respondWithResult(_0x412395,null))['catch'](handleError(_0x412395,null));};exports[_0x4f49('0x47')]=function(_0x41c580,_0x2d3dcd){return db[_0x4f49('0x3f')]['describe']()[_0x4f49('0x25')](respondWithResult(_0x2d3dcd,null))[_0x4f49('0x44')](handleError(_0x2d3dcd,null));};exports[_0x4f49('0x24')]=function(_0x973099,_0x3ec266){if(_0x973099[_0x4f49('0x48')][_0x4f49('0x49')]){delete _0x973099[_0x4f49('0x48')][_0x4f49('0x49')];}return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'uniqueid':_0x973099[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x3ec266,null))[_0x4f49('0x25')](saveUpdates(_0x973099[_0x4f49('0x48')],null))[_0x4f49('0x25')](respondWithResult(_0x3ec266,null))['catch'](handleError(_0x3ec266,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xce5121,_0x197670,_0x36bcc2){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'VoiceQueueId':_0xce5121[_0x4f49('0x4a')]['id']},'attributes':[[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x4f')))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f49('0x4b')]['literal'](_0x4f49('0x53')))),'congestionContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x54')))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x56')))),_0x4f49('0x57')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),'answeringMachine']]})[_0x4f49('0x25')](handleEntityNotFound(_0x197670,null))['then'](respondWithResult(_0x197670,null))[_0x4f49('0x44')](handleError(_0x197670,null));};exports[_0x4f49('0x5a')]=function(_0x2a2b0d,_0x4aae7c,_0x1dade6){return db[_0x4f49('0x3f')][_0x4f49('0x42')]({'raw':![],'where':{'CampaignId':_0x2a2b0d[_0x4f49('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize'][_0x4f49('0x4c')](_0x4f49('0x4d')))),_0x4f49('0x4e')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x203,\x201,\x20null'))),_0x4f49('0x50')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x52')))),'busyContacts'],[db[_0x4f49('0x4b')]['fn']('COUNT',db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x53')))),_0x4f49('0x5b')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4f49('0x55')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x4f49('0x56')))),'abandonedContacts'],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x58')))),_0x4f49('0x5c')],[db[_0x4f49('0x4b')]['fn'](_0x4f49('0x51'),db[_0x4f49('0x4b')]['fn']('IF',db[_0x4f49('0x4b')][_0x4f49('0x4c')](_0x4f49('0x59')))),_0x4f49('0x5d')]]})[_0x4f49('0x25')](handleEntityNotFound(_0x4aae7c,null))[_0x4f49('0x25')](respondWithResult(_0x4aae7c,null))[_0x4f49('0x44')](handleError(_0x4aae7c,null));};exports[_0x4f49('0x5e')]=function(_0x1f9161,_0x1434ea,_0x2c3962){return db[_0x4f49('0x5f')][_0x4f49('0x46')]({'where':{'id':_0x1f9161[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x1434ea,null))['then'](function(_0x3e9460){var _0x4ff0c1;if(_0x3e9460){_0x4ff0c1=squel[_0x4f49('0x60')]()[_0x4f49('0x61')](_0x4f49('0x62'))[_0x4f49('0x63')]([_0x4f49('0x64'),_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x68'),'createdAt','updatedAt'],squel[_0x4f49('0x69')]()['field'](_0x4f49('0x6a'),_0x4f49('0x64'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x65'))['field']('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')]('ANY_VALUE(ListId)',_0x4f49('0x67'))[_0x4f49('0x6b')]('ANY_VALUE(VoiceQueueId)',_0x4f49('0x68'))['field'](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x71'),_0x1f9161['params']['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x73'),_0x1f9161['body'][_0x4f49('0x74')]['toString']())[_0x4f49('0x38')](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')]('phone')[_0x4f49('0x6f')]('cm_hopper')[_0x4f49('0x38')]('VoiceQueueId\x20=\x20?',_0x1f9161['params']['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel['select']()[_0x4f49('0x6b')](_0x4f49('0x77'))['from']('cm_hopper_final')['where'](_0x4f49('0x71'),_0x1f9161[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x78')))['group'](_0x4f49('0x66')))[_0x4f49('0x72')]();return db[_0x4f49('0x4b')]['query'](_0x4ff0c1);}return[];})[_0x4f49('0x25')](respondWithResult(_0x1434ea,null))[_0x4f49('0x44')](handleError(_0x1434ea,null));};exports[_0x4f49('0x79')]=function(_0x2902a1,_0x5ea6b4,_0x249799){return db[_0x4f49('0x7a')][_0x4f49('0x46')]({'where':{'id':_0x2902a1[_0x4f49('0x4a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x5ea6b4,null))['then'](function(_0x2409a8){var _0x32539c;if(_0x2409a8){_0x32539c=squel['insert']()[_0x4f49('0x61')]('cm_hopper')[_0x4f49('0x63')](['phone',_0x4f49('0x65'),_0x4f49('0x66'),_0x4f49('0x67'),_0x4f49('0x7b'),_0x4f49('0x6d'),'updatedAt'],squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x6a'),_0x4f49('0x64'))['field'](_0x4f49('0x6c'),'scheduledAt')[_0x4f49('0x6b')]('ANY_VALUE(ContactId)',_0x4f49('0x66'))[_0x4f49('0x6b')](_0x4f49('0x7c'),_0x4f49('0x67'))[_0x4f49('0x6b')](_0x4f49('0x7d'),_0x4f49('0x7b'))[_0x4f49('0x6b')](_0x4f49('0x6c'),_0x4f49('0x6d'))['field'](_0x4f49('0x6c'),_0x4f49('0x6e'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1['params']['id'][_0x4f49('0x72')]())[_0x4f49('0x38')](_0x4f49('0x73'),_0x2902a1[_0x4f49('0x48')]['state'][_0x4f49('0x72')]())['where'](_0x4f49('0x75'))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()['field'](_0x4f49('0x64'))[_0x4f49('0x6f')](_0x4f49('0x62'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]()))[_0x4f49('0x38')](_0x4f49('0x76'),squel[_0x4f49('0x69')]()[_0x4f49('0x6b')](_0x4f49('0x77'))[_0x4f49('0x6f')](_0x4f49('0x70'))[_0x4f49('0x38')](_0x4f49('0x7e'),_0x2902a1[_0x4f49('0x4a')]['id'][_0x4f49('0x72')]())['where'](_0x4f49('0x78')))[_0x4f49('0x7f')](_0x4f49('0x66')))[_0x4f49('0x72')]();return db['sequelize'][_0x4f49('0x2f')](_0x32539c);}return[];})[_0x4f49('0x25')](respondWithResult(_0x5ea6b4,null))['catch'](handleError(_0x5ea6b4,null));};exports[_0x4f49('0x80')]=function(_0x57c86c,_0xf6bc4c,_0x3bc245){return db[_0x4f49('0x81')][_0x4f49('0x82')]({'where':{'VoiceQueueId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x68')],'CampaignId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x7b')],'ContactId':_0x57c86c[_0x4f49('0x48')][_0x4f49('0x66')]}})['then'](handleEntityNotFound(_0xf6bc4c,null))['then'](function(_0x32b4b4){if(_0x32b4b4){return _0x32b4b4;}return null;})['then'](respondWithResult(_0xf6bc4c,null))[_0x4f49('0x44')](handleError(_0xf6bc4c,null));}; \ No newline at end of file +var _0xd117=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','CmHopperFinal','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format'];(function(_0x5397fe,_0x430598){var _0x289fff=function(_0x4f0bde){while(--_0x4f0bde){_0x5397fe['push'](_0x5397fe['shift']());}};_0x289fff(++_0x430598);}(_0xd117,0x182));var _0x7d11=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0xd117[_0x4a563b];return _0x2935ef;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':!![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['describe']()['then'](respondWithResult(_0x193631,null))['catch'](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x1e5bb5,_0x20297a){if(_0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')]){delete _0x1e5bb5[_0x7d11('0x48')][_0x7d11('0x49')];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'uniqueid':_0x1e5bb5[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x20297a,null))[_0x7d11('0x22')](saveUpdates(_0x1e5bb5['body'],null))[_0x7d11('0x22')](respondWithResult(_0x20297a,null))[_0x7d11('0x40')](handleError(_0x20297a,null));};exports[_0x7d11('0x4a')]=function(_0x553a03,_0x503ebc,_0x14db1c){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x553a03['params']['id']},'attributes':[[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x4e')))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),_0x7d11('0x50')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db['sequelize']['literal'](_0x7d11('0x51')))),_0x7d11('0x52')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x57')))),_0x7d11('0x58')],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x503ebc,null))[_0x7d11('0x22')](respondWithResult(_0x503ebc,null))['catch'](handleError(_0x503ebc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x52d62d,_0x32c551,_0x12f05b){return db[_0x7d11('0x28')][_0x7d11('0x3e')]({'raw':![],'where':{'CampaignId':_0x52d62d[_0x7d11('0x42')]['id']},'attributes':[[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db['sequelize'][_0x7d11('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x7d11('0x4f')],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x59')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x5a')))),'busyContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x51')))),'congestionContacts'],[db[_0x7d11('0x4c')]['fn']('COUNT',db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x53')))),_0x7d11('0x54')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')][_0x7d11('0x4d')](_0x7d11('0x55')))),_0x7d11('0x56')],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db['sequelize']['fn']('IF',db[_0x7d11('0x4c')]['literal'](_0x7d11('0x57')))),'reCallContacts'],[db[_0x7d11('0x4c')]['fn'](_0x7d11('0x4b'),db[_0x7d11('0x4c')]['fn']('IF',db[_0x7d11('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x7d11('0x5b')]]})[_0x7d11('0x22')](handleEntityNotFound(_0x32c551,null))[_0x7d11('0x22')](respondWithResult(_0x32c551,null))['catch'](handleError(_0x32c551,null));};exports[_0x7d11('0x5c')]=function(_0x3c656b,_0x31cb39,_0x1b89de){return db[_0x7d11('0x5d')][_0x7d11('0x45')]({'where':{'id':_0x3c656b['params']['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x31cb39,null))['then'](function(_0x1fd598){var _0x4c88c6;if(_0x1fd598){_0x4c88c6=squel['insert']()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')]([_0x7d11('0x61'),_0x7d11('0x62'),_0x7d11('0x63'),_0x7d11('0x64'),_0x7d11('0x65'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field'](_0x7d11('0x69'),'phone')[_0x7d11('0x6a')](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')]('ANY_VALUE(ListId)','ListId')[_0x7d11('0x6a')](_0x7d11('0x6d'),_0x7d11('0x65'))[_0x7d11('0x6a')](_0x7d11('0x6b'),'createdAt')[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())[_0x7d11('0x38')]('state\x20=\x20?',_0x3c656b['body'][_0x7d11('0x72')][_0x7d11('0x71')]())[_0x7d11('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel['select']()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))['where'](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))[_0x7d11('0x38')](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x74'))['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x70'),_0x3c656b[_0x7d11('0x42')]['id'][_0x7d11('0x71')]())['where'](_0x7d11('0x75')))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db[_0x7d11('0x4c')]['query'](_0x4c88c6);}return[];})['then'](respondWithResult(_0x31cb39,null))['catch'](handleError(_0x31cb39,null));};exports[_0x7d11('0x77')]=function(_0x4c15e9,_0x2a9e92,_0x5459d1){return db['Campaign'][_0x7d11('0x45')]({'where':{'id':_0x4c15e9[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x2a9e92,null))[_0x7d11('0x22')](function(_0x345fb3){var _0x32a17a;if(_0x345fb3){_0x32a17a=squel[_0x7d11('0x78')]()[_0x7d11('0x5e')](_0x7d11('0x5f'))[_0x7d11('0x60')](['phone',_0x7d11('0x62'),_0x7d11('0x63'),'ListId',_0x7d11('0x79'),_0x7d11('0x66'),_0x7d11('0x67')],squel[_0x7d11('0x68')]()['field']('ANY_VALUE(calleridnum)',_0x7d11('0x61'))['field'](_0x7d11('0x6b'),_0x7d11('0x62'))[_0x7d11('0x6a')](_0x7d11('0x6c'),_0x7d11('0x63'))[_0x7d11('0x6a')](_0x7d11('0x7a'),'ListId')[_0x7d11('0x6a')](_0x7d11('0x7b'),_0x7d11('0x79'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x66'))[_0x7d11('0x6a')]('NOW()',_0x7d11('0x67'))[_0x7d11('0x6e')](_0x7d11('0x6f'))['where'](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())[_0x7d11('0x38')](_0x7d11('0x7d'),_0x4c15e9['body'][_0x7d11('0x72')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x7d11('0x73'),squel[_0x7d11('0x68')]()[_0x7d11('0x6a')](_0x7d11('0x61'))[_0x7d11('0x6e')](_0x7d11('0x5f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id'][_0x7d11('0x71')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7d11('0x68')]()[_0x7d11('0x6a')]('calleridnum')['from'](_0x7d11('0x6f'))[_0x7d11('0x38')](_0x7d11('0x7c'),_0x4c15e9[_0x7d11('0x42')]['id']['toString']())['where']('state\x20=\x204'))[_0x7d11('0x76')](_0x7d11('0x63')))[_0x7d11('0x71')]();return db['sequelize'][_0x7d11('0x2d')](_0x32a17a);}return[];})[_0x7d11('0x22')](respondWithResult(_0x2a9e92,null))['catch'](handleError(_0x2a9e92,null));};exports[_0x7d11('0x7e')]=function(_0x1cb457,_0x59f0db,_0x5e5faf){return db[_0x7d11('0x7f')][_0x7d11('0x80')]({'where':{'VoiceQueueId':_0x1cb457['body']['VoiceQueueId'],'CampaignId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x79')],'ContactId':_0x1cb457[_0x7d11('0x48')][_0x7d11('0x63')]}})['then'](handleEntityNotFound(_0x59f0db,null))[_0x7d11('0x22')](function(_0x2cfa77){if(_0x2cfa77){return _0x2cfa77;}return null;})[_0x7d11('0x22')](respondWithResult(_0x59f0db,null))[_0x7d11('0x40')](handleError(_0x59f0db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 728e0a9..a5da2ef 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 _0xfe5e=['exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x134cc0,_0x525e9d){var _0x623b69=function(_0x51f903){while(--_0x51f903){_0x134cc0['push'](_0x134cc0['shift']());}};_0x623b69(++_0x525e9d);}(_0xfe5e,0x130));var _0xefe5=function(_0x192772,_0x100b16){_0x192772=_0x192772-0x0;var _0x2b50bd=_0xfe5e[_0x192772];return _0x2b50bd;};'use strict';var _=require(_0xefe5('0x0'));var util=require(_0xefe5('0x1'));var logger=require('../../config/logger')(_0xefe5('0x2'));var moment=require(_0xefe5('0x3'));var BPromise=require('bluebird');var rp=require(_0xefe5('0x4'));var fs=require('fs');var path=require(_0xefe5('0x5'));var rimraf=require('rimraf');var config=require(_0xefe5('0x6'));var attributes=require(_0xefe5('0x7'));module[_0xefe5('0x8')]=function(_0x22f21a,_0x57933a){return _0x22f21a[_0xefe5('0x9')]('CmHopperFinal',attributes,{'tableName':_0xefe5('0xa'),'paranoid':![],'indexes':[{'name':_0xefe5('0xb'),'fields':[_0xefe5('0xb')]},{'name':'uniqueid','fields':[_0xefe5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x15e8=['exports','define','cm_hopper_final','calleridnum','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x2a92fc,_0x34d1e6){var _0x236359=function(_0x4845e3){while(--_0x4845e3){_0x2a92fc['push'](_0x2a92fc['shift']());}};_0x236359(++_0x34d1e6);}(_0x15e8,0x1e5));var _0x815e=function(_0x120da5,_0x35e37c){_0x120da5=_0x120da5-0x0;var _0x2564ab=_0x15e8[_0x120da5];return _0x2564ab;};'use strict';var _=require(_0x815e('0x0'));var util=require(_0x815e('0x1'));var logger=require('../../config/logger')(_0x815e('0x2'));var moment=require(_0x815e('0x3'));var BPromise=require(_0x815e('0x4'));var rp=require(_0x815e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x815e('0x6'));var config=require(_0x815e('0x7'));var attributes=require(_0x815e('0x8'));module[_0x815e('0x9')]=function(_0x2eaf6d,_0x4e3286){return _0x2eaf6d[_0x815e('0xa')]('CmHopperFinal',attributes,{'tableName':_0x815e('0xb'),'paranoid':![],'indexes':[{'name':_0x815e('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index a222b4a..ec8d32e 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(_0x3da310,_0x2fb2cc){var _0x4754e8=function(_0xa9c398){while(--_0xa9c398){_0x3da310['push'](_0x3da310['shift']());}};_0x4754e8(++_0x2fb2cc);}(_0xb10b,0x12a));var _0xbb10=function(_0x330ff0,_0x146528){_0x330ff0=_0x330ff0-0x0;var _0x215472=_0xb10b[_0x330ff0];return _0x215472;};'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(_0x5c2219,_0x15ef42){var _0x4d9944=function(_0x4eee87){while(--_0x4eee87){_0x5c2219['push'](_0x5c2219['shift']());}};_0x4d9944(++_0x15ef42);}(_0x7a54,0x106));var _0x47a5=function(_0x4e8bbe,_0x157092){_0x4e8bbe=_0x4e8bbe-0x0;var _0x54b8e4=_0x7a54[_0x4e8bbe];return _0x54b8e4;};'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 59c407e..d018051 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 _0x7079=['post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7079,0x14e));var _0x9707=function(_0x4387a6,_0x37be1b){_0x4387a6=_0x4387a6-0x0;var _0x42a993=_0x7079[_0x4387a6];return _0x42a993;};'use strict';var multer=require(_0x9707('0x0'));var util=require('util');var path=require(_0x9707('0x1'));var timeout=require(_0x9707('0x2'));var express=require(_0x9707('0x3'));var router=express[_0x9707('0x4')]();var fs_extra=require(_0x9707('0x5'));var auth=require(_0x9707('0x6'));var interaction=require(_0x9707('0x7'));var config=require(_0x9707('0x8'));var controller=require('./cmHopperFinal.controller');router[_0x9707('0x9')]('/',auth[_0x9707('0xa')](),controller['index']);router[_0x9707('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9707('0xb')]);router['get'](_0x9707('0xc'),auth[_0x9707('0xa')](),controller[_0x9707('0xd')]);router[_0x9707('0x9')](_0x9707('0xe'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x9707('0xf'),auth[_0x9707('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x9707('0x10')](_0x9707('0x11'),auth[_0x9707('0xa')](),controller[_0x9707('0x12')]);router[_0x9707('0x10')](_0x9707('0x13'),auth[_0x9707('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x9707('0x10')](_0x9707('0x14'),auth['isAuthenticated'](),controller[_0x9707('0x15')]);router[_0x9707('0x16')](_0x9707('0xc'),auth['isAuthenticated'](),controller[_0x9707('0x17')]);module[_0x9707('0x18')]=router; \ No newline at end of file +var _0x28ce=['update','exports','multer','path','express','fs-extra','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put'];(function(_0x305a0f,_0x34b1d9){var _0x109a91=function(_0x50688b){while(--_0x50688b){_0x305a0f['push'](_0x305a0f['shift']());}};_0x109a91(++_0x34b1d9);}(_0x28ce,0xf2));var _0xe28c=function(_0x1711b3,_0x417d1f){_0x1711b3=_0x1711b3-0x0;var _0x227c40=_0x28ce[_0x1711b3];return _0x227c40;};'use strict';var multer=require(_0xe28c('0x0'));var util=require('util');var path=require(_0xe28c('0x1'));var timeout=require('connect-timeout');var express=require(_0xe28c('0x2'));var router=express['Router']();var fs_extra=require(_0xe28c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe28c('0x4'));var controller=require(_0xe28c('0x5'));router[_0xe28c('0x6')]('/',auth[_0xe28c('0x7')](),controller['index']);router[_0xe28c('0x6')](_0xe28c('0x8'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x9')]);router[_0xe28c('0x6')](_0xe28c('0xa'),auth[_0xe28c('0x7')](),controller['show']);router[_0xe28c('0x6')]('/voice/queue/countAttributes/:id',auth[_0xe28c('0x7')](),controller[_0xe28c('0xb')]);router[_0xe28c('0x6')](_0xe28c('0xc'),auth[_0xe28c('0x7')](),controller[_0xe28c('0xd')]);router[_0xe28c('0xe')](_0xe28c('0xf'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x10')]);router['post'](_0xe28c('0x11'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x12')]);router[_0xe28c('0xe')](_0xe28c('0x13'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x14')]);router[_0xe28c('0x15')](_0xe28c('0xa'),auth[_0xe28c('0x7')](),controller[_0xe28c('0x16')]);module[_0xe28c('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ae2c711..e7af2eb 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 _0x5bd2=['DATE','INTEGER','STRING','BOOLEAN','sequelize','exports'];(function(_0x2db7a1,_0x59c5e8){var _0x40996c=function(_0x56d72c){while(--_0x56d72c){_0x2db7a1['push'](_0x2db7a1['shift']());}};_0x40996c(++_0x59c5e8);}(_0x5bd2,0x1a2));var _0x25bd=function(_0x35f19d,_0x40921c){_0x35f19d=_0x35f19d-0x0;var _0x6bf100=_0x5bd2[_0x35f19d];return _0x6bf100;};'use strict';var Sequelize=require(_0x25bd('0x0'));module[_0x25bd('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x25bd('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x25bd('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x25bd('0x4')]},'originatecalleridname':{'type':Sequelize[_0x25bd('0x4')]},'calleridnum':{'type':Sequelize[_0x25bd('0x4')]},'calleridname':{'type':Sequelize[_0x25bd('0x4')]},'starttime':{'type':Sequelize[_0x25bd('0x2')]},'responsetime':{'type':Sequelize[_0x25bd('0x2')]},'answertime':{'type':Sequelize[_0x25bd('0x2')]},'droptime':{'type':Sequelize[_0x25bd('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x25bd('0x4')]},'campaign':{'type':Sequelize[_0x25bd('0x4')]},'campaigntype':{'type':Sequelize[_0x25bd('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x25bd('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x25bd('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x25bd('0x2')]},'recallme':{'type':Sequelize[_0x25bd('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x25bd('0x2')]},'edited':{'type':Sequelize[_0x25bd('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x25bd('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x25bd('0x4')]}}; \ No newline at end of file +var _0xb50f=['DATE','BOOLEAN','INTEGER','STRING'];(function(_0x3bdf9d,_0x551f5d){var _0x2dca38=function(_0x2eadec){while(--_0x2eadec){_0x3bdf9d['push'](_0x3bdf9d['shift']());}};_0x2dca38(++_0x551f5d);}(_0xb50f,0x66));var _0xfb50=function(_0x28a5eb,_0x513eac){_0x28a5eb=_0x28a5eb-0x0;var _0xb4d010=_0xb50f[_0x28a5eb];return _0xb4d010;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xfb50('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xfb50('0x1')]},'scheduledat':{'type':Sequelize[_0xfb50('0x2')]},'countbusyretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xfb50('0x1')]},'originatecalleridname':{'type':Sequelize[_0xfb50('0x1')]},'calleridnum':{'type':Sequelize[_0xfb50('0x1')]},'calleridname':{'type':Sequelize[_0xfb50('0x1')]},'starttime':{'type':Sequelize[_0xfb50('0x2')]},'responsetime':{'type':Sequelize[_0xfb50('0x2')]},'answertime':{'type':Sequelize[_0xfb50('0x2')]},'droptime':{'type':Sequelize[_0xfb50('0x2')]},'endtime':{'type':Sequelize[_0xfb50('0x2')]},'ringtime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfb50('0x1')]},'campaign':{'type':Sequelize[_0xfb50('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfb50('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfb50('0x2')]},'recallme':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xfb50('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfb50('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xfb50('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3db1fbe..d010de2 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 _0x59f1=['send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','describe','uniqueid','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name'];(function(_0x3b8e2c,_0x11a1b8){var _0x432178=function(_0x524669){while(--_0x524669){_0x3b8e2c['push'](_0x3b8e2c['shift']());}};_0x432178(++_0x11a1b8);}(_0x59f1,0x153));var _0x159f=function(_0x41052c,_0x20035c){_0x41052c=_0x41052c-0x0;var _0x4dc096=_0x59f1[_0x41052c];return _0x4dc096;};'use strict';var emlformat=require(_0x159f('0x0'));var rimraf=require(_0x159f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x159f('0x2'));var moment=require(_0x159f('0x3'));var BPromise=require(_0x159f('0x4'));var Mustache=require(_0x159f('0x5'));var util=require(_0x159f('0x6'));var path=require(_0x159f('0x7'));var sox=require(_0x159f('0x8'));var csv=require('to-csv');var ejs=require(_0x159f('0x9'));var fs=require('fs');var fs_extra=require(_0x159f('0xa'));var _=require(_0x159f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x159f('0xc'));var deskjs=require(_0x159f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x159f('0xe'));var Papa=require(_0x159f('0xf'));var Redis=require(_0x159f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x159f('0x11'));var as=require(_0x159f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x159f('0x13'))(_0x159f('0x14'));var utils=require('../../config/utils');var config=require(_0x159f('0x15'));var licenseUtil=require(_0x159f('0x16'));var db=require(_0x159f('0x17'))['db'];function respondWithStatusCode(_0x1ec1c9,_0x58b6c1){_0x58b6c1=_0x58b6c1||0xcc;return function(_0x168eb3){if(_0x168eb3){return _0x1ec1c9[_0x159f('0x18')](_0x58b6c1);}return _0x1ec1c9[_0x159f('0x19')](_0x58b6c1)[_0x159f('0x1a')]();};}function respondWithResult(_0x2ddb72,_0x26fa74){_0x26fa74=_0x26fa74||0xc8;return function(_0x96f5d){if(_0x96f5d){return _0x2ddb72[_0x159f('0x19')](_0x26fa74)[_0x159f('0x1b')](_0x96f5d);}};}function respondWithFilteredResult(_0x599c14,_0x3d5f66){return function(_0x335c5e){if(_0x335c5e){var _0x20323f=typeof _0x3d5f66[_0x159f('0x1c')]===_0x159f('0x1d')&&typeof _0x3d5f66[_0x159f('0x1e')]===_0x159f('0x1d');var _0x4dd1db=_0x335c5e[_0x159f('0x1f')];var _0x239fad=_0x20323f?0x0:_0x3d5f66[_0x159f('0x1c')];var _0x3d2273=_0x20323f?_0x335c5e[_0x159f('0x1f')]:_0x3d5f66[_0x159f('0x1c')]+_0x3d5f66['limit'];var _0x27d7c6;if(_0x3d2273>=_0x4dd1db){_0x3d2273=_0x4dd1db;_0x27d7c6=0xc8;}else{_0x27d7c6=0xce;}_0x599c14[_0x159f('0x19')](_0x27d7c6);return _0x599c14[_0x159f('0x20')](_0x159f('0x21'),_0x239fad+'-'+_0x3d2273+'/'+_0x4dd1db)[_0x159f('0x1b')](_0x335c5e);}return null;};}function patchUpdates(_0x2c5866){return function(_0x390751){try{jsonpatch[_0x159f('0x22')](_0x390751,_0x2c5866,!![]);}catch(_0x12f4e5){return BPromise[_0x159f('0x23')](_0x12f4e5);}return _0x390751[_0x159f('0x24')]();};}function saveUpdates(_0x397e11,_0x3fbacc){return function(_0x2d1987){if(_0x2d1987){return _0x2d1987[_0x159f('0x25')](_0x397e11)[_0x159f('0x26')](function(_0x171eb9){return _0x171eb9;});}return null;};}function removeEntity(_0x216d20,_0x208a37){return function(_0x40e345){if(_0x40e345){return _0x40e345['destroy']()['then'](function(){_0x216d20[_0x159f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e018,_0xec80b1){return function(_0x503fca){if(!_0x503fca){_0x24e018['sendStatus'](0x194);}return _0x503fca;};}function handleError(_0x1db057,_0x5f2053){_0x5f2053=_0x5f2053||0x1f4;return function(_0x1b69f2){logger['error'](_0x1b69f2[_0x159f('0x27')]);if(_0x1b69f2['name']){delete _0x1b69f2[_0x159f('0x28')];}_0x1db057['status'](_0x5f2053)[_0x159f('0x29')](_0x1b69f2);};}exports['index']=function(_0x31283b,_0x6d3599){var _0x4a8d91={},_0x16b63a={},_0x4869d9={'count':0x0,'rows':[]};var _0x58a625=_[_0x159f('0x2a')](db[_0x159f('0x2b')][_0x159f('0x2c')],function(_0x57ac16){return{'name':_0x57ac16[_0x159f('0x2d')],'type':_0x57ac16[_0x159f('0x2e')][_0x159f('0x2f')]};});_0x16b63a[_0x159f('0x30')]=_[_0x159f('0x2a')](_0x58a625,'name');_0x16b63a['query']=_[_0x159f('0x31')](_0x31283b[_0x159f('0x32')]);_0x16b63a[_0x159f('0x33')]=_[_0x159f('0x34')](_0x16b63a[_0x159f('0x30')],_0x16b63a[_0x159f('0x32')]);_0x4a8d91[_0x159f('0x35')]=_[_0x159f('0x34')](_0x16b63a[_0x159f('0x30')],qs[_0x159f('0x36')](_0x31283b[_0x159f('0x32')]['fields']));_0x4a8d91[_0x159f('0x35')]=_0x4a8d91[_0x159f('0x35')][_0x159f('0x37')]?_0x4a8d91[_0x159f('0x35')]:_0x16b63a[_0x159f('0x30')];if(!_0x31283b['query']['hasOwnProperty'](_0x159f('0x38'))){_0x4a8d91[_0x159f('0x1e')]=qs[_0x159f('0x1e')](_0x31283b[_0x159f('0x32')][_0x159f('0x1e')]);_0x4a8d91[_0x159f('0x1c')]=qs[_0x159f('0x1c')](_0x31283b[_0x159f('0x32')][_0x159f('0x1c')]);}_0x4a8d91[_0x159f('0x39')]=qs[_0x159f('0x3a')](_0x31283b['query'][_0x159f('0x3a')]);_0x4a8d91['where']=qs[_0x159f('0x33')](_['pick'](_0x31283b[_0x159f('0x32')],_0x16b63a['filters']),_0x58a625);if(_0x31283b[_0x159f('0x32')][_0x159f('0x3b')]){_0x4a8d91[_0x159f('0x3c')]=_[_0x159f('0x3d')](_0x4a8d91[_0x159f('0x3c')],{'$or':_['map'](_0x58a625,function(_0x569388){if(_0x569388[_0x159f('0x2e')]!==_0x159f('0x3e')){var _0x6d41bf={};_0x6d41bf[_0x569388[_0x159f('0x28')]]={'$like':'%'+_0x31283b['query'][_0x159f('0x3b')]+'%'};return _0x6d41bf;}})});}_0x4a8d91=_['merge']({},_0x4a8d91,_0x31283b[_0x159f('0x3f')]);var _0x1be51e={'where':_0x4a8d91[_0x159f('0x3c')]};return db[_0x159f('0x2b')][_0x159f('0x1f')](_0x1be51e)[_0x159f('0x26')](function(_0x1f6837){_0x4869d9[_0x159f('0x1f')]=_0x1f6837;if(_0x31283b[_0x159f('0x32')][_0x159f('0x40')]){_0x4a8d91['include']=[{'all':!![]}];}return db[_0x159f('0x2b')][_0x159f('0x41')](_0x4a8d91);})['then'](function(_0x331853){_0x4869d9[_0x159f('0x42')]=_0x331853;return _0x4869d9;})[_0x159f('0x26')](respondWithFilteredResult(_0x6d3599,_0x4a8d91))[_0x159f('0x43')](handleError(_0x6d3599,null));};exports[_0x159f('0x44')]=function(_0x4f2d07,_0x5d636d){var _0x39b6b0={'raw':!![],'where':{'id':_0x4f2d07['params']['id']}},_0x4cc490={};_0x4cc490[_0x159f('0x30')]=_['keys'](db['CmHopperHistory'][_0x159f('0x2c')]);_0x4cc490[_0x159f('0x32')]=_[_0x159f('0x31')](_0x4f2d07['query']);_0x4cc490[_0x159f('0x33')]=_[_0x159f('0x34')](_0x4cc490[_0x159f('0x30')],_0x4cc490[_0x159f('0x32')]);_0x39b6b0[_0x159f('0x35')]=_[_0x159f('0x34')](_0x4cc490['model'],qs[_0x159f('0x36')](_0x4f2d07[_0x159f('0x32')][_0x159f('0x36')]));_0x39b6b0[_0x159f('0x35')]=_0x39b6b0[_0x159f('0x35')][_0x159f('0x37')]?_0x39b6b0[_0x159f('0x35')]:_0x4cc490[_0x159f('0x30')];if(_0x4f2d07[_0x159f('0x32')][_0x159f('0x40')]){_0x39b6b0[_0x159f('0x45')]=[{'all':!![]}];}_0x39b6b0=_[_0x159f('0x3d')]({},_0x39b6b0,_0x4f2d07[_0x159f('0x3f')]);return db[_0x159f('0x2b')]['find'](_0x39b6b0)['then'](handleEntityNotFound(_0x5d636d,null))[_0x159f('0x26')](respondWithResult(_0x5d636d,null))[_0x159f('0x43')](handleError(_0x5d636d,null));};exports[_0x159f('0x46')]=function(_0x1a7b44,_0x452834){return db[_0x159f('0x2b')][_0x159f('0x46')](_0x1a7b44[_0x159f('0x47')],{})[_0x159f('0x26')](respondWithResult(_0x452834,0xc9))[_0x159f('0x43')](handleError(_0x452834,null));};exports['describe']=function(_0x50a77d,_0x1b983e){return db[_0x159f('0x2b')][_0x159f('0x48')]()[_0x159f('0x26')](respondWithResult(_0x1b983e,null))[_0x159f('0x43')](handleError(_0x1b983e,null));};exports[_0x159f('0x25')]=function(_0x1f53cb,_0x443515){if(_0x1f53cb[_0x159f('0x47')][_0x159f('0x49')]){delete _0x1f53cb[_0x159f('0x47')]['uniqueid'];}return db[_0x159f('0x2b')][_0x159f('0x4a')]({'where':{'uniqueid':_0x1f53cb[_0x159f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x443515,null))['then'](saveUpdates(_0x1f53cb[_0x159f('0x47')],null))[_0x159f('0x26')](respondWithResult(_0x443515,null))[_0x159f('0x43')](handleError(_0x443515,null));}; \ No newline at end of file +var _0x5626=['filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','rawAttributes','keys','length','include','find','create','body','describe','uniqueid','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','CmHopperHistory','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x15fa90,_0x1189ff){var _0x91c2f7=function(_0x4151c7){while(--_0x4151c7){_0x15fa90['push'](_0x15fa90['shift']());}};_0x91c2f7(++_0x1189ff);}(_0x5626,0x1da));var _0x6562=function(_0x2bf1cc,_0x32742f){_0x2bf1cc=_0x2bf1cc-0x0;var _0x15e663=_0x5626[_0x2bf1cc];return _0x15e663;};'use strict';var emlformat=require(_0x6562('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6562('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6562('0x2'));var moment=require(_0x6562('0x3'));var BPromise=require(_0x6562('0x4'));var Mustache=require(_0x6562('0x5'));var util=require(_0x6562('0x6'));var path=require(_0x6562('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6562('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6562('0x9'));var jsforce=require(_0x6562('0xa'));var deskjs=require(_0x6562('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6562('0xc'));var Papa=require(_0x6562('0xd'));var Redis=require(_0x6562('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6562('0xf'));var as=require(_0x6562('0x10'));var hardwareService=require(_0x6562('0x11'));var logger=require(_0x6562('0x12'))(_0x6562('0x13'));var utils=require(_0x6562('0x14'));var config=require(_0x6562('0x15'));var licenseUtil=require(_0x6562('0x16'));var db=require(_0x6562('0x17'))['db'];function respondWithStatusCode(_0x5e82fd,_0x293e77){_0x293e77=_0x293e77||0xcc;return function(_0x20ac12){if(_0x20ac12){return _0x5e82fd[_0x6562('0x18')](_0x293e77);}return _0x5e82fd['status'](_0x293e77)[_0x6562('0x19')]();};}function respondWithResult(_0x1ee64d,_0x12e67e){_0x12e67e=_0x12e67e||0xc8;return function(_0x11b7f8){if(_0x11b7f8){return _0x1ee64d[_0x6562('0x1a')](_0x12e67e)[_0x6562('0x1b')](_0x11b7f8);}};}function respondWithFilteredResult(_0x5f3088,_0x3b4c11){return function(_0x8f6c6){if(_0x8f6c6){var _0x3132f9=typeof _0x3b4c11['offset']===_0x6562('0x1c')&&typeof _0x3b4c11[_0x6562('0x1d')]==='undefined';var _0x5bfce1=_0x8f6c6[_0x6562('0x1e')];var _0x413159=_0x3132f9?0x0:_0x3b4c11[_0x6562('0x1f')];var _0x10bd05=_0x3132f9?_0x8f6c6['count']:_0x3b4c11['offset']+_0x3b4c11[_0x6562('0x1d')];var _0x23160b;if(_0x10bd05>=_0x5bfce1){_0x10bd05=_0x5bfce1;_0x23160b=0xc8;}else{_0x23160b=0xce;}_0x5f3088['status'](_0x23160b);return _0x5f3088[_0x6562('0x20')](_0x6562('0x21'),_0x413159+'-'+_0x10bd05+'/'+_0x5bfce1)[_0x6562('0x1b')](_0x8f6c6);}return null;};}function patchUpdates(_0x5c5b2e){return function(_0x494b39){try{jsonpatch[_0x6562('0x22')](_0x494b39,_0x5c5b2e,!![]);}catch(_0x22c3c9){return BPromise['reject'](_0x22c3c9);}return _0x494b39['save']();};}function saveUpdates(_0x14fac1,_0x343f2e){return function(_0x1e522){if(_0x1e522){return _0x1e522[_0x6562('0x23')](_0x14fac1)[_0x6562('0x24')](function(_0x177929){return _0x177929;});}return null;};}function removeEntity(_0x581b4f,_0x31191b){return function(_0x299b39){if(_0x299b39){return _0x299b39[_0x6562('0x25')]()[_0x6562('0x24')](function(){_0x581b4f[_0x6562('0x1a')](0xcc)[_0x6562('0x19')]();});}};}function handleEntityNotFound(_0x6d1579,_0x54bd1c){return function(_0x18b032){if(!_0x18b032){_0x6d1579[_0x6562('0x18')](0x194);}return _0x18b032;};}function handleError(_0x120547,_0x198848){_0x198848=_0x198848||0x1f4;return function(_0x4ec3c1){logger['error'](_0x4ec3c1[_0x6562('0x26')]);if(_0x4ec3c1[_0x6562('0x27')]){delete _0x4ec3c1['name'];}_0x120547[_0x6562('0x1a')](_0x198848)[_0x6562('0x28')](_0x4ec3c1);};}exports[_0x6562('0x29')]=function(_0x57154d,_0x326e29){var _0x510981={},_0x213be5={},_0x2af0f9={'count':0x0,'rows':[]};var _0x3c2ec5=_['map'](db[_0x6562('0x2a')]['rawAttributes'],function(_0x1b340b){return{'name':_0x1b340b[_0x6562('0x2b')],'type':_0x1b340b[_0x6562('0x2c')]['key']};});_0x213be5[_0x6562('0x2d')]=_[_0x6562('0x2e')](_0x3c2ec5,'name');_0x213be5[_0x6562('0x2f')]=_['keys'](_0x57154d[_0x6562('0x2f')]);_0x213be5[_0x6562('0x30')]=_[_0x6562('0x31')](_0x213be5[_0x6562('0x2d')],_0x213be5[_0x6562('0x2f')]);_0x510981[_0x6562('0x32')]=_['intersection'](_0x213be5[_0x6562('0x2d')],qs[_0x6562('0x33')](_0x57154d[_0x6562('0x2f')][_0x6562('0x33')]));_0x510981[_0x6562('0x32')]=_0x510981[_0x6562('0x32')]['length']?_0x510981[_0x6562('0x32')]:_0x213be5['model'];if(!_0x57154d['query'][_0x6562('0x34')](_0x6562('0x35'))){_0x510981[_0x6562('0x1d')]=qs[_0x6562('0x1d')](_0x57154d[_0x6562('0x2f')][_0x6562('0x1d')]);_0x510981[_0x6562('0x1f')]=qs['offset'](_0x57154d[_0x6562('0x2f')][_0x6562('0x1f')]);}_0x510981[_0x6562('0x36')]=qs[_0x6562('0x37')](_0x57154d['query'][_0x6562('0x37')]);_0x510981[_0x6562('0x38')]=qs[_0x6562('0x30')](_[_0x6562('0x39')](_0x57154d['query'],_0x213be5[_0x6562('0x30')]),_0x3c2ec5);if(_0x57154d['query'][_0x6562('0x3a')]){_0x510981[_0x6562('0x38')]=_['merge'](_0x510981['where'],{'$or':_['map'](_0x3c2ec5,function(_0x4c386d){if(_0x4c386d[_0x6562('0x2c')]!==_0x6562('0x3b')){var _0x1b076f={};_0x1b076f[_0x4c386d[_0x6562('0x27')]]={'$like':'%'+_0x57154d[_0x6562('0x2f')][_0x6562('0x3a')]+'%'};return _0x1b076f;}})});}_0x510981=_[_0x6562('0x3c')]({},_0x510981,_0x57154d['options']);var _0x22390d={'where':_0x510981[_0x6562('0x38')]};return db['CmHopperHistory']['count'](_0x22390d)[_0x6562('0x24')](function(_0x25ebf3){_0x2af0f9[_0x6562('0x1e')]=_0x25ebf3;if(_0x57154d[_0x6562('0x2f')][_0x6562('0x3d')]){_0x510981['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x6562('0x3e')](_0x510981);})[_0x6562('0x24')](function(_0x34a3b4){_0x2af0f9[_0x6562('0x3f')]=_0x34a3b4;return _0x2af0f9;})['then'](respondWithFilteredResult(_0x326e29,_0x510981))[_0x6562('0x40')](handleError(_0x326e29,null));};exports[_0x6562('0x41')]=function(_0x2d5af6,_0x194b39){var _0x521069={'raw':!![],'where':{'id':_0x2d5af6['params']['id']}},_0x12f389={};_0x12f389[_0x6562('0x2d')]=_['keys'](db[_0x6562('0x2a')][_0x6562('0x42')]);_0x12f389[_0x6562('0x2f')]=_[_0x6562('0x43')](_0x2d5af6[_0x6562('0x2f')]);_0x12f389[_0x6562('0x30')]=_[_0x6562('0x31')](_0x12f389['model'],_0x12f389[_0x6562('0x2f')]);_0x521069[_0x6562('0x32')]=_[_0x6562('0x31')](_0x12f389[_0x6562('0x2d')],qs[_0x6562('0x33')](_0x2d5af6[_0x6562('0x2f')][_0x6562('0x33')]));_0x521069[_0x6562('0x32')]=_0x521069[_0x6562('0x32')][_0x6562('0x44')]?_0x521069['attributes']:_0x12f389[_0x6562('0x2d')];if(_0x2d5af6['query']['includeAll']){_0x521069[_0x6562('0x45')]=[{'all':!![]}];}_0x521069=_[_0x6562('0x3c')]({},_0x521069,_0x2d5af6['options']);return db[_0x6562('0x2a')][_0x6562('0x46')](_0x521069)[_0x6562('0x24')](handleEntityNotFound(_0x194b39,null))[_0x6562('0x24')](respondWithResult(_0x194b39,null))['catch'](handleError(_0x194b39,null));};exports['create']=function(_0x24afbc,_0x47c7c5){return db['CmHopperHistory'][_0x6562('0x47')](_0x24afbc[_0x6562('0x48')],{})[_0x6562('0x24')](respondWithResult(_0x47c7c5,0xc9))[_0x6562('0x40')](handleError(_0x47c7c5,null));};exports[_0x6562('0x49')]=function(_0x334029,_0x256e32){return db[_0x6562('0x2a')][_0x6562('0x49')]()[_0x6562('0x24')](respondWithResult(_0x256e32,null))[_0x6562('0x40')](handleError(_0x256e32,null));};exports[_0x6562('0x23')]=function(_0x2d448d,_0x266c86){if(_0x2d448d['body'][_0x6562('0x4a')]){delete _0x2d448d[_0x6562('0x48')][_0x6562('0x4a')];}return db['CmHopperHistory'][_0x6562('0x46')]({'where':{'uniqueid':_0x2d448d[_0x6562('0x4b')]['id']}})[_0x6562('0x24')](handleEntityNotFound(_0x266c86,null))['then'](saveUpdates(_0x2d448d[_0x6562('0x48')],null))[_0x6562('0x24')](respondWithResult(_0x266c86,null))[_0x6562('0x40')](handleError(_0x266c86,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index f89a83d..ad7debf 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 _0x6691=['define','endtime','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x6691,0x12d));var _0x1669=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6691[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var logger=require(_0x1669('0x2'))(_0x1669('0x3'));var moment=require(_0x1669('0x4'));var BPromise=require(_0x1669('0x5'));var rp=require(_0x1669('0x6'));var fs=require('fs');var path=require(_0x1669('0x7'));var rimraf=require(_0x1669('0x8'));var config=require(_0x1669('0x9'));var attributes=require('./cmHopperHistory.attributes');module[_0x1669('0xa')]=function(_0x1bf2c8,_0x30f92c){return _0x1bf2c8[_0x1669('0xb')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x1669('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaafc=['endtime','uniqueid','util','../../config/logger','api','moment','request-promise','path','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xaafc,0x176));var _0xcaaf=function(_0x2acda9,_0x58bb23){_0x2acda9=_0x2acda9-0x0;var _0x425922=_0xaafc[_0x2acda9];return _0x425922;};'use strict';var _=require('lodash');var util=require(_0xcaaf('0x0'));var logger=require(_0xcaaf('0x1'))(_0xcaaf('0x2'));var moment=require(_0xcaaf('0x3'));var BPromise=require('bluebird');var rp=require(_0xcaaf('0x4'));var fs=require('fs');var path=require(_0xcaaf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcaaf('0x6'));module['exports']=function(_0x291f15,_0x54757a){return _0x291f15[_0xcaaf('0x7')](_0xcaaf('0x8'),attributes,{'tableName':_0xcaaf('0x9'),'paranoid':![],'indexes':[{'name':_0xcaaf('0xa'),'fields':['endtime']},{'name':_0xcaaf('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index ab7f9bc..7917fce 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 _0x1db3=['error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','options','then','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','literal','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','where','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','raw','name','ivrTotalCallsDays','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1db3,0x1e5));var _0x31db=function(_0x48aad7,_0x3de8d7){_0x48aad7=_0x48aad7-0x0;var _0xf68618=_0x1db3[_0x48aad7];return _0xf68618;};'use strict';var _=require('lodash');var util=require(_0x31db('0x0'));var moment=require(_0x31db('0x1'));var BPromise=require(_0x31db('0x2'));var rs=require(_0x31db('0x3'));var fs=require('fs');var Redis=require(_0x31db('0x4'));var db=require(_0x31db('0x5'))['db'];var utils=require(_0x31db('0x6'));var logger=require(_0x31db('0x7'))(_0x31db('0x8'));var config=require(_0x31db('0x9'));var jayson=require(_0x31db('0xa'));var client=jayson[_0x31db('0xb')][_0x31db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x156381,_0xa4f685,_0x44e204){return new BPromise(function(_0x3a431e,_0x3881c8){return client[_0x31db('0xd')](_0x156381,_0x44e204)['then'](function(_0x19d1a9){logger[_0x31db('0xe')](_0x31db('0xf'),_0xa4f685,_0x31db('0x10'));logger[_0x31db('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0xa4f685,_0x31db('0x10'),JSON[_0x31db('0x12')](_0x19d1a9));if(_0x19d1a9[_0x31db('0x13')]){if(_0x19d1a9['error'][_0x31db('0x14')]===0x1f4){logger[_0x31db('0x13')](_0x31db('0xf'),_0xa4f685,_0x19d1a9[_0x31db('0x13')][_0x31db('0x15')]);return _0x3881c8(_0x19d1a9[_0x31db('0x13')]['message']);}logger['error'](_0x31db('0xf'),_0xa4f685,_0x19d1a9['error'][_0x31db('0x15')]);return _0x3a431e(_0x19d1a9[_0x31db('0x13')][_0x31db('0x15')]);}else{logger[_0x31db('0xe')](_0x31db('0xf'),_0xa4f685,'request\x20sent');_0x3a431e(_0x19d1a9['result']['message']);}})[_0x31db('0x16')](function(_0x22aa89){logger[_0x31db('0x13')](_0x31db('0xf'),_0xa4f685,_0x22aa89);_0x3881c8(_0x22aa89);});});}exports[_0x31db('0x17')]=function(_0x1d3218){var _0x9f2780=this;return new Promise(function(_0x3df86e,_0x2d9dd7){return db[_0x31db('0x18')][_0x31db('0x19')](_0x1d3218['body'],{'raw':_0x1d3218[_0x31db('0x1a')]?_0x1d3218['options']['raw']===undefined?!![]:![]:!![]})[_0x31db('0x1b')](function(_0x1915ec){logger[_0x31db('0xe')](_0x31db('0x17'),_0x1d3218);logger[_0x31db('0x11')](_0x31db('0x17'),_0x1d3218,JSON[_0x31db('0x12')](_0x1915ec));_0x3df86e(_0x1915ec);})[_0x31db('0x16')](function(_0x204781){logger[_0x31db('0x13')](_0x31db('0x17'),_0x204781[_0x31db('0x15')],_0x1d3218);_0x2d9dd7(_0x9f2780['error'](0x1f4,_0x204781[_0x31db('0x15')]));});});};exports[_0x31db('0x1c')]=function(_0x303cf4){var _0x5e44b8=this;return new Promise(function(_0x1b393e,_0x54d623){return db['CmHopperHistory'][_0x31db('0x1d')]({'raw':_0x303cf4[_0x31db('0x1a')]?_0x303cf4['options']['raw']===undefined?!![]:![]:!![],'where':_0x303cf4['options']?_0x303cf4[_0x31db('0x1a')]['where']||null:null,'attributes':[[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')][_0x31db('0x20')]('id')),_0x31db('0x21')],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')]['literal'](_0x31db('0x22')))),_0x31db('0x23')],[db['sequelize']['fn']('COUNT',db[_0x31db('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x31db('0x24')],[db[_0x31db('0x1e')]['fn']('COUNT',db[_0x31db('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x31db('0x25')))),_0x31db('0x26')],[db[_0x31db('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x28')))),_0x31db('0x29')],[db[_0x31db('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x31db('0x1e')]['literal'](_0x31db('0x2a')))),'predictiveIntervalAvgTalktime']]})[_0x31db('0x1b')](function(_0x3204f6){logger[_0x31db('0xe')](_0x31db('0x1c'),_0x303cf4);logger['debug'](_0x31db('0x1c'),_0x303cf4,JSON[_0x31db('0x12')](_0x3204f6));_0x1b393e(_0x3204f6);})['catch'](function(_0x572b3f){logger[_0x31db('0x13')](_0x31db('0x1c'),_0x572b3f['message'],_0x303cf4);_0x54d623(_0x5e44b8['error'](0x1f4,_0x572b3f[_0x31db('0x15')]));});});};exports[_0x31db('0x2b')]=function(_0x35e0da){var _0x1242ed=this;return new Promise(function(_0x5dee13,_0x414201){return db[_0x31db('0x18')][_0x31db('0x1d')]({'raw':_0x35e0da['options']?_0x35e0da[_0x31db('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x35e0da[_0x31db('0x1a')]?_0x35e0da[_0x31db('0x1a')][_0x31db('0x2c')]||null:null,'attributes':[[_0x31db('0x2d'),'name'],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')]['literal'](_0x31db('0x2e')))),_0x31db('0x2f')],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db['sequelize']['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x30')))),_0x31db('0x31')],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x22')))),_0x31db('0x32')],[db['sequelize']['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x33')))),_0x31db('0x34')],[db[_0x31db('0x1e')]['fn']('COUNT',db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')]['literal'](_0x31db('0x35')))),'outboundCongestionCallsDay'],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db['sequelize'][_0x31db('0x27')](_0x31db('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x37')))),_0x31db('0x38')],[db[_0x31db('0x1e')]['fn']('COUNT',db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x39')))),_0x31db('0x3a')],[db['sequelize']['fn']('COUNT',db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x3b')))),_0x31db('0x3c')],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')]('`state`\x20=\x2014,\x201,\x20null'))),_0x31db('0x3d')],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x3e')))),_0x31db('0x3f')],[db['sequelize']['fn'](_0x31db('0x1f'),db['sequelize']['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x40')))),_0x31db('0x41')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x42')))),_0x31db('0x3f')],[db['sequelize']['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')]['literal'](_0x31db('0x43')))),'outboundReCallsDay']],'group':[_0x31db('0x2d')]})[_0x31db('0x1b')](function(_0x51fe21){logger[_0x31db('0xe')](_0x31db('0x2b'),_0x35e0da);logger['debug'](_0x31db('0x2b'),_0x35e0da,JSON['stringify'](_0x51fe21));_0x5dee13(_0x51fe21);})[_0x31db('0x16')](function(_0x31a1a8){logger['error'](_0x31db('0x2b'),_0x31a1a8['message'],_0x35e0da);_0x414201(_0x1242ed[_0x31db('0x13')](0x1f4,_0x31a1a8[_0x31db('0x15')]));});});};exports[_0x31db('0x44')]=function(_0x28388f){var _0xe73ed4=this;return new Promise(function(_0x12176c,_0x15bbf3){return db[_0x31db('0x18')]['findAll']({'raw':_0x28388f[_0x31db('0x1a')]?_0x28388f[_0x31db('0x1a')][_0x31db('0x45')]===undefined?!![]:![]:!![],'where':_0x28388f[_0x31db('0x1a')]?_0x28388f[_0x31db('0x1a')][_0x31db('0x2c')]||null:null,'attributes':[[_0x31db('0x2d'),_0x31db('0x46')],[db['sequelize']['fn'](_0x31db('0x1f'),db['sequelize'][_0x31db('0x20')]('id')),_0x31db('0x47')],[db[_0x31db('0x1e')]['fn'](_0x31db('0x1f'),db[_0x31db('0x1e')]['fn']('IF',db[_0x31db('0x1e')][_0x31db('0x27')](_0x31db('0x22')))),'ivrAnswerCallsDay']],'group':[_0x31db('0x2d')]})['then'](function(_0x308e3d){logger[_0x31db('0xe')](_0x31db('0x44'),_0x28388f);logger[_0x31db('0x11')](_0x31db('0x44'),_0x28388f,JSON[_0x31db('0x12')](_0x308e3d));_0x12176c(_0x308e3d);})[_0x31db('0x16')](function(_0x200553){logger[_0x31db('0x13')](_0x31db('0x44'),_0x200553[_0x31db('0x15')],_0x28388f);_0x15bbf3(_0xe73ed4['error'](0x1f4,_0x200553[_0x31db('0x15')]));});});}; \ No newline at end of file +var _0xe706=['GetCampaignHopperHistory','findAll','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','CmHopperHistory','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','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','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe706,0xa3));var _0x6e70=function(_0x3e6aed,_0x97a2f1){_0x3e6aed=_0x3e6aed-0x0;var _0x3220dd=_0xe706[_0x3e6aed];return _0x3220dd;};'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']('CmHopperHistory,\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']('CmHopperHistory,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['CmHopperHistory'][_0x6e70('0x1a')](_0x5ea7a5[_0x6e70('0x1b')],{'raw':_0x5ea7a5[_0x6e70('0x1c')]?_0x5ea7a5[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![]})[_0x6e70('0xe')](function(_0x1b2453){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('CreateCmHopperHistory',_0x5ea7a5,JSON[_0x6e70('0x1e')](_0x1b2453));_0x173afe(_0x1b2453);})[_0x6e70('0x18')](function(_0x27b294){logger['error'](_0x6e70('0x19'),_0x27b294[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0x27b294['message']));});});};exports[_0x6e70('0x1f')]=function(_0x538b9c){var _0x50aec2=this;return new Promise(function(_0x4e97c7,_0x41e352){return db[_0x6e70('0x20')]['findAll']({'raw':_0x538b9c[_0x6e70('0x1c')]?_0x538b9c[_0x6e70('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x538b9c[_0x6e70('0x1c')]?_0x538b9c[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')][_0x6e70('0x23')]('id')),_0x6e70('0x24')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x27')))),_0x6e70('0x28')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x29')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x2a')))),_0x6e70('0x2b')],[db['sequelize']['fn'](_0x6e70('0x2c'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x2d')))),'predictiveIntervalAvgHoldtime'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x2c'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x2e')))),_0x6e70('0x2f')]]})[_0x6e70('0xe')](function(_0xf146fd){logger[_0x6e70('0xf')]('AvgHandleTime',_0x538b9c);logger[_0x6e70('0x12')]('AvgHandleTime',_0x538b9c,JSON[_0x6e70('0x1e')](_0xf146fd));_0x4e97c7(_0xf146fd);})[_0x6e70('0x18')](function(_0x98c683){logger[_0x6e70('0x14')](_0x6e70('0x1f'),_0x98c683[_0x6e70('0x16')],_0x538b9c);_0x41e352(_0x50aec2[_0x6e70('0x14')](0x1f4,_0x98c683[_0x6e70('0x16')]));});});};exports[_0x6e70('0x30')]=function(_0x198dd1){var _0x2a5444=this;return new Promise(function(_0x23d5e2,_0x5594d3){return db['CmHopperHistory']['findAll']({'raw':_0x198dd1['options']?_0x198dd1[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![],'where':_0x198dd1[_0x6e70('0x1c')]?_0x198dd1[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[_0x6e70('0x31'),'name'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x32')))),_0x6e70('0x33')],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x34')))),_0x6e70('0x35')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6e70('0x27')))),_0x6e70('0x36')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x37')))),_0x6e70('0x38')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x39')))),_0x6e70('0x3a')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x3b')))),_0x6e70('0x3c')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x3d')))),_0x6e70('0x3e')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x3f')))),_0x6e70('0x40')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x41')))),'outboundBlacklistCallsDay'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x42')))),_0x6e70('0x43')],[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x44')))),_0x6e70('0x45')],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x46')))),_0x6e70('0x47')],[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x48')))),_0x6e70('0x45')],[db['sequelize']['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x49')))),'outboundReCallsDay']],'group':[_0x6e70('0x31')]})[_0x6e70('0xe')](function(_0x2c20d3){logger[_0x6e70('0xf')](_0x6e70('0x30'),_0x198dd1);logger[_0x6e70('0x12')]('GetVoiceQueueHopperHistory',_0x198dd1,JSON[_0x6e70('0x1e')](_0x2c20d3));_0x23d5e2(_0x2c20d3);})[_0x6e70('0x18')](function(_0x5c2396){logger[_0x6e70('0x14')](_0x6e70('0x30'),_0x5c2396['message'],_0x198dd1);_0x5594d3(_0x2a5444[_0x6e70('0x14')](0x1f4,_0x5c2396[_0x6e70('0x16')]));});});};exports[_0x6e70('0x4a')]=function(_0x46d536){var _0xfcadfe=this;return new Promise(function(_0x53f8fc,_0x385825){return db[_0x6e70('0x20')][_0x6e70('0x4b')]({'raw':_0x46d536[_0x6e70('0x1c')]?_0x46d536[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![],'where':_0x46d536[_0x6e70('0x1c')]?_0x46d536[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[_0x6e70('0x31'),_0x6e70('0x4c')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')][_0x6e70('0x23')]('id')),_0x6e70('0x4d')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x27')))),_0x6e70('0x4e')]],'group':[_0x6e70('0x31')]})[_0x6e70('0xe')](function(_0x36757e){logger[_0x6e70('0xf')]('GetCampaignHopperHistory',_0x46d536);logger[_0x6e70('0x12')](_0x6e70('0x4a'),_0x46d536,JSON['stringify'](_0x36757e));_0x53f8fc(_0x36757e);})[_0x6e70('0x18')](function(_0x692205){logger[_0x6e70('0x14')]('GetCampaignHopperHistory',_0x692205['message'],_0x46d536);_0x385825(_0xfcadfe[_0x6e70('0x14')](0x1f4,_0x692205[_0x6e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 93ea8f4..352e023 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 _0x1f7f=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put','exports','multer','path','connect-timeout','Router'];(function(_0x281235,_0x13b50f){var _0x1f97e5=function(_0x163696){while(--_0x163696){_0x281235['push'](_0x281235['shift']());}};_0x1f97e5(++_0x13b50f);}(_0x1f7f,0xc0));var _0xf1f7=function(_0x37a1e6,_0x536b85){_0x37a1e6=_0x37a1e6-0x0;var _0x115a59=_0x1f7f[_0x37a1e6];return _0x115a59;};'use strict';var multer=require(_0xf1f7('0x0'));var util=require('util');var path=require(_0xf1f7('0x1'));var timeout=require(_0xf1f7('0x2'));var express=require('express');var router=express[_0xf1f7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1f7('0x4'));var interaction=require(_0xf1f7('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0xf1f7('0x6')]('/',auth[_0xf1f7('0x7')](),controller['index']);router[_0xf1f7('0x6')]('/describe',auth[_0xf1f7('0x7')](),controller['describe']);router[_0xf1f7('0x6')](_0xf1f7('0x8'),auth[_0xf1f7('0x7')](),controller[_0xf1f7('0x9')]);router[_0xf1f7('0xa')]('/',auth[_0xf1f7('0x7')](),controller[_0xf1f7('0xb')]);router[_0xf1f7('0xc')](_0xf1f7('0x8'),auth['isAuthenticated'](),controller['update']);module[_0xf1f7('0xd')]=router; \ No newline at end of file +var _0xbf89=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','/:id','show','put','update'];(function(_0x44d52b,_0x450552){var _0xc022f1=function(_0x246fd9){while(--_0x246fd9){_0x44d52b['push'](_0x44d52b['shift']());}};_0xc022f1(++_0x450552);}(_0xbf89,0xa3));var _0x9bf8=function(_0xd5709b,_0x101823){_0xd5709b=_0xd5709b-0x0;var _0x3dc484=_0xbf89[_0xd5709b];return _0x3dc484;};'use strict';var multer=require(_0x9bf8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9bf8('0x1'));var express=require(_0x9bf8('0x2'));var router=express[_0x9bf8('0x3')]();var fs_extra=require(_0x9bf8('0x4'));var auth=require(_0x9bf8('0x5'));var interaction=require(_0x9bf8('0x6'));var config=require(_0x9bf8('0x7'));var controller=require(_0x9bf8('0x8'));router['get']('/',auth[_0x9bf8('0x9')](),controller['index']);router[_0x9bf8('0xa')](_0x9bf8('0xb'),auth[_0x9bf8('0x9')](),controller[_0x9bf8('0xc')]);router[_0x9bf8('0xa')](_0x9bf8('0xd'),auth[_0x9bf8('0x9')](),controller[_0x9bf8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9bf8('0xf')](_0x9bf8('0xd'),auth[_0x9bf8('0x9')](),controller[_0x9bf8('0x10')]);module[_0x9bf8('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 4d3b38b..8830fdc 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 _0xe41f=['STRING','name','sequelize','exports'];(function(_0x5578a5,_0x363a37){var _0x4471c6=function(_0x5dc1aa){while(--_0x5dc1aa){_0x5578a5['push'](_0x5578a5['shift']());}};_0x4471c6(++_0x363a37);}(_0xe41f,0x13e));var _0xfe41=function(_0x3e5f3f,_0x3cd882){_0x3e5f3f=_0x3e5f3f-0x0;var _0xee7f1a=_0xe41f[_0x3e5f3f];return _0xee7f1a;};'use strict';var Sequelize=require(_0xfe41('0x0'));module[_0xfe41('0x1')]={'name':{'type':Sequelize[_0xfe41('0x2')],'unique':_0xfe41('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xafe6=['STRING','sequelize','exports'];(function(_0x3e540c,_0x504924){var _0xe0faa4=function(_0x987813){while(--_0x987813){_0x3e540c['push'](_0x3e540c['shift']());}};_0xe0faa4(++_0x504924);}(_0xafe6,0xac));var _0x6afe=function(_0x3dd027,_0xe45609){_0x3dd027=_0x3dd027-0x0;var _0x177e67=_0xafe6[_0x3dd027];return _0x177e67;};'use strict';var Sequelize=require(_0x6afe('0x0'));module[_0x6afe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6afe('0x2')]},'dialPrefix':{'type':Sequelize[_0x6afe('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d1912e2..98a3c73 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 _0x65da=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','ids','addContacts','CmContact','tags','isArray','join','push','each','success','dataValues','message','Malformed\x20request\x20syntax','CustomFields','format','cf_%d','getContacts','getContactsCsv','ContactItemType','rawAttributes','CmCustomField','alias','select','from','cm_contacts','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','switch','BOOLEAN','queryInterface','addColumn','getCustomFields','addAgents','omit','spread','emit','userCmList:save','userCmList:remove','getAgents','User','info','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','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','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','error','name','index','CmList','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x65da,0x1a4));var _0xa65d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x65da[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa65d('0x0'));var zipdir=require(_0xa65d('0x1'));var jsonpatch=require(_0xa65d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa65d('0x3'));var Mustache=require('mustache');var util=require(_0xa65d('0x4'));var path=require(_0xa65d('0x5'));var sox=require(_0xa65d('0x6'));var csv=require(_0xa65d('0x7'));var ejs=require(_0xa65d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa65d('0x9'));var jsforce=require(_0xa65d('0xa'));var deskjs=require(_0xa65d('0xb'));var toCsv=require(_0xa65d('0x7'));var querystring=require(_0xa65d('0xc'));var Papa=require(_0xa65d('0xd'));var Redis=require('ioredis');var authService=require(_0xa65d('0xe'));var qs=require(_0xa65d('0xf'));var as=require(_0xa65d('0x10'));var hardwareService=require(_0xa65d('0x11'));var logger=require('../../config/logger')(_0xa65d('0x12'));var utils=require(_0xa65d('0x13'));var config=require(_0xa65d('0x14'));var licenseUtil=require(_0xa65d('0x15'));var db=require(_0xa65d('0x16'))['db'];var csv_results;config[_0xa65d('0x17')]=_[_0xa65d('0x18')](config[_0xa65d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xa65d('0x19'))(new Redis(config['redis']));require('./cmList.socket')[_0xa65d('0x1a')](socket);function respondWithStatusCode(_0x37efd4,_0x12d1a8){_0x12d1a8=_0x12d1a8||0xcc;return function(_0x1fcbf1){if(_0x1fcbf1){return _0x37efd4[_0xa65d('0x1b')](_0x12d1a8);}return _0x37efd4[_0xa65d('0x1c')](_0x12d1a8)[_0xa65d('0x1d')]();};}function respondWithResult(_0x337aaf,_0x4af64a){_0x4af64a=_0x4af64a||0xc8;return function(_0x4c3c6c){if(_0x4c3c6c){return _0x337aaf[_0xa65d('0x1c')](_0x4af64a)[_0xa65d('0x1e')](_0x4c3c6c);}};}function respondWithFilteredResult(_0x6d1feb,_0x2a26d0){return function(_0x551ef2){if(_0x551ef2){var _0x2eedc=typeof _0x2a26d0[_0xa65d('0x1f')]===_0xa65d('0x20')&&typeof _0x2a26d0[_0xa65d('0x21')]==='undefined';var _0x8502a5=_0x551ef2[_0xa65d('0x22')];var _0x4580c9=_0x2eedc?0x0:_0x2a26d0[_0xa65d('0x1f')];var _0x21e739=_0x2eedc?_0x551ef2[_0xa65d('0x22')]:_0x2a26d0[_0xa65d('0x1f')]+_0x2a26d0[_0xa65d('0x21')];var _0xa6eb3e;if(_0x21e739>=_0x8502a5){_0x21e739=_0x8502a5;_0xa6eb3e=0xc8;}else{_0xa6eb3e=0xce;}_0x6d1feb[_0xa65d('0x1c')](_0xa6eb3e);return _0x6d1feb[_0xa65d('0x23')](_0xa65d('0x24'),_0x4580c9+'-'+_0x21e739+'/'+_0x8502a5)[_0xa65d('0x1e')](_0x551ef2);}return null;};}function patchUpdates(_0x510663){return function(_0x5831cf){try{jsonpatch[_0xa65d('0x25')](_0x5831cf,_0x510663,!![]);}catch(_0x5bf1fc){return BPromise[_0xa65d('0x26')](_0x5bf1fc);}return _0x5831cf[_0xa65d('0x27')]();};}function saveUpdates(_0x33e066,_0x192113){return function(_0x2c9f51){if(_0x2c9f51){return _0x2c9f51[_0xa65d('0x28')](_0x33e066)[_0xa65d('0x29')](function(_0xfbd9bd){return _0xfbd9bd;});}return null;};}function removeEntity(_0x497b39,_0x389e3a){return function(_0x44084c){if(_0x44084c){return _0x44084c[_0xa65d('0x2a')]()[_0xa65d('0x29')](function(){var _0x939dd8=_0x44084c['get']({'plain':!![]});var _0x13cfa4=_0xa65d('0x2b');return db[_0xa65d('0x2c')][_0xa65d('0x2a')]({'where':{'type':_0x13cfa4,'resourceId':_0x939dd8['id']}})['then'](function(){return _0x44084c;});})[_0xa65d('0x29')](function(){_0x497b39[_0xa65d('0x1c')](0xcc)[_0xa65d('0x1d')]();});}};}function handleEntityNotFound(_0x400da9,_0x435126){return function(_0xa3df0c){if(!_0xa3df0c){_0x400da9[_0xa65d('0x1b')](0x194);}return _0xa3df0c;};}function handleError(_0x33b154,_0x5d4cc0){_0x5d4cc0=_0x5d4cc0||0x1f4;return function(_0x4730f4){logger[_0xa65d('0x2d')](_0x4730f4['stack']);if(_0x4730f4['name']){delete _0x4730f4[_0xa65d('0x2e')];}_0x33b154[_0xa65d('0x1c')](_0x5d4cc0)['send'](_0x4730f4);};}exports[_0xa65d('0x2f')]=function(_0x4d85de,_0x3aefa8){var _0x17f3e3={},_0x458ae0={},_0x21f297={'count':0x0,'rows':[]};var _0x18b393=_['map'](db[_0xa65d('0x30')]['rawAttributes'],function(_0xa41686){return{'name':_0xa41686[_0xa65d('0x31')],'type':_0xa41686[_0xa65d('0x32')][_0xa65d('0x33')]};});_0x458ae0[_0xa65d('0x34')]=_[_0xa65d('0x35')](_0x18b393,_0xa65d('0x2e'));_0x458ae0[_0xa65d('0x36')]=_[_0xa65d('0x37')](_0x4d85de['query']);_0x458ae0['filters']=_[_0xa65d('0x38')](_0x458ae0[_0xa65d('0x34')],_0x458ae0['query']);_0x17f3e3[_0xa65d('0x39')]=_['intersection'](_0x458ae0[_0xa65d('0x34')],qs[_0xa65d('0x3a')](_0x4d85de[_0xa65d('0x36')][_0xa65d('0x3a')]));_0x17f3e3['attributes']=_0x17f3e3[_0xa65d('0x39')][_0xa65d('0x3b')]?_0x17f3e3[_0xa65d('0x39')]:_0x458ae0[_0xa65d('0x34')];if(!_0x4d85de[_0xa65d('0x36')][_0xa65d('0x3c')](_0xa65d('0x3d'))){_0x17f3e3['limit']=qs[_0xa65d('0x21')](_0x4d85de[_0xa65d('0x36')][_0xa65d('0x21')]);_0x17f3e3[_0xa65d('0x1f')]=qs[_0xa65d('0x1f')](_0x4d85de[_0xa65d('0x36')][_0xa65d('0x1f')]);}_0x17f3e3[_0xa65d('0x3e')]=qs[_0xa65d('0x3f')](_0x4d85de['query'][_0xa65d('0x3f')]);_0x17f3e3[_0xa65d('0x40')]=qs[_0xa65d('0x41')](_[_0xa65d('0x42')](_0x4d85de[_0xa65d('0x36')],_0x458ae0['filters']),_0x18b393);if(_0x4d85de['query'][_0xa65d('0x43')]){_0x17f3e3[_0xa65d('0x40')]=_[_0xa65d('0x44')](_0x17f3e3['where'],{'$or':_[_0xa65d('0x35')](_0x18b393,function(_0x440d14){if(_0x440d14[_0xa65d('0x32')]!==_0xa65d('0x45')){var _0x14d11e={};_0x14d11e[_0x440d14[_0xa65d('0x2e')]]={'$like':'%'+_0x4d85de[_0xa65d('0x36')][_0xa65d('0x43')]+'%'};return _0x14d11e;}})});}_0x17f3e3=_[_0xa65d('0x44')]({},_0x17f3e3,_0x4d85de[_0xa65d('0x46')]);var _0x140701={'where':_0x17f3e3['where']};return db['CmList'][_0xa65d('0x22')](_0x140701)[_0xa65d('0x29')](function(_0xdc7aa8){_0x21f297[_0xa65d('0x22')]=_0xdc7aa8;if(_0x4d85de[_0xa65d('0x36')][_0xa65d('0x47')]){_0x17f3e3[_0xa65d('0x48')]=[{'all':!![]}];}return db[_0xa65d('0x30')]['findAll'](_0x17f3e3);})[_0xa65d('0x29')](function(_0x467022){_0x21f297[_0xa65d('0x49')]=_0x467022;return _0x21f297;})[_0xa65d('0x29')](respondWithFilteredResult(_0x3aefa8,_0x17f3e3))[_0xa65d('0x4a')](handleError(_0x3aefa8,null));};exports[_0xa65d('0x4b')]=function(_0x1e8fc2,_0xc2de36){var _0x277057={'raw':![],'where':{'id':_0x1e8fc2[_0xa65d('0x4c')]['id']}},_0x2480ee={};_0x2480ee[_0xa65d('0x34')]=_[_0xa65d('0x37')](db[_0xa65d('0x30')]['rawAttributes']);_0x2480ee[_0xa65d('0x36')]=_[_0xa65d('0x37')](_0x1e8fc2[_0xa65d('0x36')]);_0x2480ee[_0xa65d('0x41')]=_[_0xa65d('0x38')](_0x2480ee['model'],_0x2480ee[_0xa65d('0x36')]);_0x277057['attributes']=_['intersection'](_0x2480ee[_0xa65d('0x34')],qs[_0xa65d('0x3a')](_0x1e8fc2[_0xa65d('0x36')][_0xa65d('0x3a')]));_0x277057['attributes']=_0x277057[_0xa65d('0x39')][_0xa65d('0x3b')]?_0x277057[_0xa65d('0x39')]:_0x2480ee[_0xa65d('0x34')];if(_0x1e8fc2[_0xa65d('0x36')][_0xa65d('0x47')]){_0x277057[_0xa65d('0x48')]=[{'all':!![]}];}_0x277057=_[_0xa65d('0x44')]({},_0x277057,_0x1e8fc2[_0xa65d('0x46')]);return db[_0xa65d('0x30')][_0xa65d('0x4d')](_0x277057)['then'](handleEntityNotFound(_0xc2de36,null))[_0xa65d('0x29')](respondWithResult(_0xc2de36,null))[_0xa65d('0x4a')](handleError(_0xc2de36,null));};exports[_0xa65d('0x4e')]=function(_0x1642a3,_0x150cbc){return db['CmList'][_0xa65d('0x4e')](_0x1642a3[_0xa65d('0x4f')],{})['then'](function(_0x49b286){var _0x435cf6=_0x1642a3[_0xa65d('0x50')][_0xa65d('0x51')]({'plain':!![]});if(!_0x435cf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x435cf6[_0xa65d('0x52')]===_0xa65d('0x50')){var _0x17ee0e=_0x49b286[_0xa65d('0x51')]({'plain':!![]});var _0x19bac2='Lists';return db['UserProfileSection'][_0xa65d('0x4d')]({'where':{'name':_0x19bac2,'userProfileId':_0x435cf6[_0xa65d('0x53')]},'raw':!![]})[_0xa65d('0x29')](function(_0x69e0a6){if(_0x69e0a6&&_0x69e0a6[_0xa65d('0x54')]===0x0){return db[_0xa65d('0x2c')][_0xa65d('0x4e')]({'name':_0x17ee0e['name'],'resourceId':_0x17ee0e['id'],'type':_0x69e0a6['name'],'sectionId':_0x69e0a6['id']},{})[_0xa65d('0x29')](function(){return _0x49b286;});}else{return _0x49b286;}})[_0xa65d('0x4a')](function(_0x1ca5c6){logger['error'](_0xa65d('0x55'),_0x1ca5c6);throw _0x1ca5c6;});}return _0x49b286;})[_0xa65d('0x29')](respondWithResult(_0x150cbc,0xc9))[_0xa65d('0x4a')](handleError(_0x150cbc,null));};exports[_0xa65d('0x28')]=function(_0x702216,_0x27898d){if(_0x702216[_0xa65d('0x4f')]['id']){delete _0x702216[_0xa65d('0x4f')]['id'];}return db[_0xa65d('0x30')]['find']({'where':{'id':_0x702216[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x27898d,null))[_0xa65d('0x29')](saveUpdates(_0x702216['body'],null))[_0xa65d('0x29')](respondWithResult(_0x27898d,null))['catch'](handleError(_0x27898d,null));};exports[_0xa65d('0x2a')]=function(_0x56446b,_0x5a405c){return db[_0xa65d('0x30')]['find']({'where':{'id':_0x56446b[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x5a405c,null))['then'](removeEntity(_0x5a405c,null))[_0xa65d('0x4a')](handleError(_0x5a405c,null));};exports[_0xa65d('0x56')]=function(_0x2ab551,_0xe86fb1){return db[_0xa65d('0x30')]['describe']()[_0xa65d('0x29')](respondWithResult(_0xe86fb1,null))['catch'](handleError(_0xe86fb1,null));};exports[_0xa65d('0x57')]=function(_0x647080,_0x5044b7,_0x346d6f){if(_0x647080[_0xa65d('0x4f')]['id']){delete _0x647080[_0xa65d('0x4f')]['id'];}return db[_0xa65d('0x30')][_0xa65d('0x4d')]({'where':{'id':_0x647080[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x5044b7,null))['then'](function(_0x38326c){if(_0x38326c){_0x647080[_0xa65d('0x4f')][_0xa65d('0x58')]=_0x38326c['id'];return db[_0xa65d('0x59')][_0xa65d('0x4e')](_0x647080[_0xa65d('0x4f')]);}})[_0xa65d('0x29')](respondWithResult(_0x5044b7,null))[_0xa65d('0x4a')](handleError(_0x5044b7,null));};exports[_0xa65d('0x5a')]=function(_0x449670,_0x19575c,_0x23681e){var _0x26871a={'raw':![],'where':{}};var _0x5c5b8e={};var _0x530e06={'count':0x0,'rows':[]};return db[_0xa65d('0x30')][_0xa65d('0x5b')]({'where':{'id':_0x449670[_0xa65d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x19575c,null))['then'](function(_0x1ea936){if(_0x1ea936){_0x5c5b8e[_0xa65d('0x34')]=_[_0xa65d('0x37')](db[_0xa65d('0x59')]['rawAttributes']);_0x5c5b8e[_0xa65d('0x36')]=_[_0xa65d('0x37')](_0x449670[_0xa65d('0x36')]);_0x5c5b8e[_0xa65d('0x41')]=_[_0xa65d('0x38')](_0x5c5b8e[_0xa65d('0x34')],_0x5c5b8e[_0xa65d('0x36')]);_0x26871a[_0xa65d('0x39')]=_[_0xa65d('0x38')](_0x5c5b8e['model'],qs['fields'](_0x449670[_0xa65d('0x36')]['fields']));_0x26871a[_0xa65d('0x39')]=_0x26871a['attributes']['length']?_0x26871a[_0xa65d('0x39')]:_0x5c5b8e[_0xa65d('0x34')];if(!_0x449670[_0xa65d('0x36')][_0xa65d('0x3c')](_0xa65d('0x3d'))){_0x26871a[_0xa65d('0x21')]=qs[_0xa65d('0x21')](_0x449670[_0xa65d('0x36')][_0xa65d('0x21')]);_0x26871a[_0xa65d('0x1f')]=qs[_0xa65d('0x1f')](_0x449670[_0xa65d('0x36')][_0xa65d('0x1f')]);}_0x26871a[_0xa65d('0x3e')]=qs[_0xa65d('0x3f')](_0x449670[_0xa65d('0x36')][_0xa65d('0x3f')]);_0x26871a[_0xa65d('0x40')]=qs[_0xa65d('0x41')](_[_0xa65d('0x42')](_0x449670['query'],_0x5c5b8e['filters']));_0x26871a[_0xa65d('0x40')][_0xa65d('0x58')]=_0x1ea936['id'];if(_0x449670[_0xa65d('0x36')]['filter']){_0x26871a[_0xa65d('0x40')]=_[_0xa65d('0x44')](_0x26871a[_0xa65d('0x40')],{'$or':_[_0xa65d('0x35')](_0x26871a['attributes'],function(_0x5dd23e){var _0x50ac3d={};_0x50ac3d[_0x5dd23e]={'$like':'%'+_0x449670[_0xa65d('0x36')][_0xa65d('0x43')]+'%'};return _0x50ac3d;})});}_0x26871a=_['merge']({},_0x26871a,_0x449670['options']);return db['Disposition'][_0xa65d('0x22')]({'where':_0x26871a[_0xa65d('0x40')]})['then'](function(_0x2b363f){_0x530e06[_0xa65d('0x22')]=_0x2b363f;if(_0x449670[_0xa65d('0x36')]['includeAll']){_0x26871a['include']=[{'all':!![]}];}return db[_0xa65d('0x59')][_0xa65d('0x5c')](_0x26871a);})[_0xa65d('0x29')](function(_0x16ab9c){_0x530e06[_0xa65d('0x49')]=_0x16ab9c;return _0x530e06;});}})[_0xa65d('0x29')](respondWithFilteredResult(_0x19575c,_0x26871a))['catch'](handleError(_0x19575c,null));};exports['removeDispositions']=function(_0x455c79,_0x333e3e,_0x49448a){return db[_0xa65d('0x30')][_0xa65d('0x4d')]({'where':{'id':_0x455c79['params']['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x333e3e,null))['then'](function(_0x28d2a4){if(_0x28d2a4){return _0x28d2a4['removeDispositions'](_0x455c79['query'][_0xa65d('0x5d')]);}})['then'](respondWithStatusCode(_0x333e3e,null))['catch'](handleError(_0x333e3e,null));};exports[_0xa65d('0x5e')]=function(_0x5df657,_0x1878e8,_0x1cc800){return db[_0xa65d('0x30')][_0xa65d('0x4d')]({'where':{'id':_0x5df657[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x1878e8,null))[_0xa65d('0x29')](function(_0x506a93){if(_0x506a93){var _0x102a7c=[];var _0x4f56b9={'success':[],'errors':[]};return db[_0xa65d('0x5f')]['describe']()[_0xa65d('0x29')](function(_0x70d4ce){if(_0x5df657[_0xa65d('0x4f')][_0xa65d('0x60')]&&_[_0xa65d('0x61')](_0x5df657[_0xa65d('0x4f')]['tags'])){if(_0x5df657[_0xa65d('0x4f')][_0xa65d('0x60')][_0xa65d('0x3b')]){_0x5df657[_0xa65d('0x4f')][_0xa65d('0x60')]=_0x5df657['body'][_0xa65d('0x60')][_0xa65d('0x62')](';')+';';}else{_0x5df657[_0xa65d('0x4f')][_0xa65d('0x60')]=null;}}else{_0x5df657['body'][_0xa65d('0x60')]=null;}if(_0x5df657[_0xa65d('0x4f')]&&_[_0xa65d('0x61')](_0x5df657[_0xa65d('0x4f')])){for(var _0x502ca0=0x0;_0x502ca0<_0x5df657[_0xa65d('0x4f')][_0xa65d('0x3b')];_0x502ca0+=0x1){_0x5df657[_0xa65d('0x4f')][_0x502ca0][_0xa65d('0x58')]=_0x5df657[_0xa65d('0x4c')]['id'];_0x102a7c[_0xa65d('0x63')](_0x5df657[_0xa65d('0x4f')][_0x502ca0]);}return BPromise[_0xa65d('0x64')](_0x102a7c,function(_0xfb607b){return db[_0xa65d('0x5f')][_0xa65d('0x4e')](_['omit'](_0xfb607b,[_0xa65d('0x5d'),'id'])||{},{'fields':_[_0xa65d('0x37')](_0x70d4ce),'raw':!![]})['then'](function(_0x3e87f2){_0x4f56b9[_0xa65d('0x65')][_0xa65d('0x63')](_0x3e87f2[_0xa65d('0x66')]);})['catch'](function(_0x42dadd){_0x4f56b9['errors'][_0xa65d('0x63')]({'data':_0xfb607b,'error':_0x42dadd[_0xa65d('0x67')]});});})[_0xa65d('0x29')](function(_0x52754e){return _0x4f56b9;})[_0xa65d('0x4a')](function(_0x55ff49){return _0x55ff49;});}else{_0x1878e8[_0xa65d('0x1c')](0x190)[_0xa65d('0x1e')]({'message':_0xa65d('0x68')});}});}})[_0xa65d('0x29')](respondWithResult(_0x1878e8,null))['catch'](handleError(_0x1878e8,null));};exports['getContacts']=function(_0x2ee5a8,_0x5444ae,_0x54697e){var _0x58b3ff;return db['CmList'][_0xa65d('0x4d')]({'where':{'id':_0x2ee5a8[_0xa65d('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xa65d('0x69')}]})[_0xa65d('0x29')](handleEntityNotFound(_0x5444ae,null))[_0xa65d('0x29')](function(_0x40cc34){if(_0x40cc34){_0x58b3ff=_0x40cc34;return db['CmContact']['rawAttributes'];}})['then'](function(_0x196e28){if(_0x196e28){var _0x2bc652={};var _0x52cc67={};_0x52cc67[_0xa65d('0x34')]=_['concat'](_[_0xa65d('0x37')](_0x196e28),_[_0xa65d('0x35')](_0x58b3ff[_0xa65d('0x69')],function(_0xcbdecf){return util[_0xa65d('0x6a')](_0xa65d('0x6b'),_0xcbdecf['id']);}));_0x52cc67['query']=_[_0xa65d('0x37')](_0x2ee5a8[_0xa65d('0x36')]);_0x52cc67[_0xa65d('0x41')]=_['intersection'](_0x52cc67[_0xa65d('0x34')],_0x52cc67['query']);_0x2bc652[_0xa65d('0x39')]=_[_0xa65d('0x38')](_0x52cc67[_0xa65d('0x34')],qs['fields'](_0x2ee5a8['query'][_0xa65d('0x3a')]));_0x2bc652[_0xa65d('0x39')]=_0x2bc652['attributes']['length']?_0x2bc652['attributes']:_0x52cc67[_0xa65d('0x34')];if(!_0x2ee5a8[_0xa65d('0x36')]['hasOwnProperty'](_0xa65d('0x3d'))){_0x2bc652[_0xa65d('0x21')]=qs['limit'](_0x2ee5a8['query'][_0xa65d('0x21')]);_0x2bc652[_0xa65d('0x1f')]=qs['offset'](_0x2ee5a8[_0xa65d('0x36')]['offset']);}_0x2bc652[_0xa65d('0x3e')]=qs[_0xa65d('0x3f')](_0x2ee5a8[_0xa65d('0x36')][_0xa65d('0x3f')]);_0x2bc652['where']=qs['filters'](_[_0xa65d('0x42')](_0x2ee5a8[_0xa65d('0x36')],_0x52cc67[_0xa65d('0x41')]));_0x2bc652['raw']=!![];if(_0x2ee5a8[_0xa65d('0x36')][_0xa65d('0x43')]){_0x2bc652[_0xa65d('0x40')]=_['merge'](_0x2bc652['where'],{'$or':_[_0xa65d('0x35')](_0x2bc652[_0xa65d('0x39')],function(_0x154ae3){var _0x49f4ab={};_0x49f4ab[_0x154ae3]={'$like':'%'+_0x2ee5a8[_0xa65d('0x36')]['filter']+'%'};return _0x49f4ab;})});}_0x2bc652=_[_0xa65d('0x44')]({},_0x2bc652,_0x2ee5a8['options']);return _0x58b3ff[_0xa65d('0x6c')](_0x2bc652);}})[_0xa65d('0x29')](respondWithResult(_0x5444ae,null))[_0xa65d('0x4a')](handleError(_0x5444ae,null));};exports[_0xa65d('0x6d')]=function(_0x3707ed,_0x561b79,_0x48c4f5){var _0x3be870;var _0x27ee6d;var _0x3e6927;var _0x37b24a=_0x3707ed[_0xa65d('0x4c')]['id'];csv_results=[];return db[_0xa65d('0x6e')][_0xa65d('0x5c')]({'attributes':['id',_0xa65d('0x2e')],'raw':!![],'order':['OrderBy']})[_0xa65d('0x29')](function(_0x1df617){_0x3be870=_0x1df617;var _0x495642=_[_0xa65d('0x37')](db[_0xa65d('0x5f')][_0xa65d('0x6f')]);return db[_0xa65d('0x70')][_0xa65d('0x5c')]({'raw':!![],'attributes':['id',_0xa65d('0x71')]})[_0xa65d('0x29')](function(_0x59a80d){_0x27ee6d=_0x59a80d;var _0x1e7fee=squel[_0xa65d('0x72')]()[_0xa65d('0x3a')](_0x495642)[_0xa65d('0x73')](_0xa65d('0x74'),'c')['where']('c.ListId\x20=\x20?',_0x37b24a)['where']('c.deletedAt\x20is\x20null')[_0xa65d('0x75')]();for(var _0x226158=0x0;_0x226158<_0x27ee6d['length'];_0x226158++){_0x1e7fee[_0xa65d('0x76')](_0xa65d('0x77')+_0x27ee6d[_0x226158]['id'],_0xa65d('0x78')+_0x27ee6d[_0x226158][_0xa65d('0x71')]);}for(var _0x226158=0x0;_0x226158<_0x3be870[_0xa65d('0x3b')];_0x226158++){_0x1e7fee['field'](squel[_0xa65d('0x72')]()[_0xa65d('0x76')](_0xa65d('0x79'))[_0xa65d('0x73')](_0xa65d('0x7a'))[_0xa65d('0x40')](_0xa65d('0x7b'),_0x3be870[_0x226158]['id'])['where'](_0xa65d('0x7c')),_0xa65d('0x7d')+_0x3be870[_0x226158]['name']);_0x1e7fee['field'](squel[_0xa65d('0x72')]()[_0xa65d('0x76')](_0xa65d('0x7e'))[_0xa65d('0x73')](_0xa65d('0x7a'))[_0xa65d('0x40')](_0xa65d('0x7b'),_0x3be870[_0x226158]['id'])[_0xa65d('0x40')]('CmContactId\x20=\x20c.id'),_0xa65d('0x7f')+_0x3be870[_0x226158]['name']);}var _0x261ece=[];_0x261ece[_0xa65d('0x63')](_0x1e7fee[_0xa65d('0x80')]());BPromise[_0xa65d('0x64')](_0x261ece,handleQuery)['then'](function(_0x202e32){handleQuery(_0x1e7fee[_0xa65d('0x80')]());var _0x309df8=csv_results[0x0];if(!_[_0xa65d('0x81')](_0x309df8)){var _0x3d54ae=toCsv(_0x309df8);var _0x48448d=Date[_0xa65d('0x82')]();fs[_0xa65d('0x83')](util[_0xa65d('0x6a')](_0xa65d('0x84'),_0x37b24a,_0x48448d),_0x3d54ae);_0x561b79[_0xa65d('0x85')](_0xa65d('0x86'),_0xa65d('0x87')+util[_0xa65d('0x6a')](_0xa65d('0x88'),_0x37b24a,_0x48448d));_0x561b79[_0xa65d('0x85')](_0xa65d('0x89'),_0xa65d('0x8a'));return _0x561b79[_0xa65d('0x8b')](util[_0xa65d('0x6a')](_0xa65d('0x84'),_0x37b24a,_0x48448d));}else{return _0x561b79['sendStatus'](0xcc);}});});});};exports[_0xa65d('0x8c')]=function(_0xe8a31d,_0x19af82,_0x39f4ed){var _0x4ee1fc;delete _0xe8a31d['body']['id'];return db['CmList']['findOne']({'where':{'id':_0xe8a31d[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x19af82,null))[_0xa65d('0x29')](function(_0x33ee1e){if(_0x33ee1e){return db[_0xa65d('0x8d')][_0xa65d('0x8e')](function(_0x1bbcf3){return db['CmCustomField']['create'](_0xe8a31d['body'],{'transaction':_0x1bbcf3})[_0xa65d('0x29')](function(_0x1bf2ec){_0x4ee1fc=_0x1bf2ec;return _0x33ee1e[_0xa65d('0x8f')](_0x1bf2ec,{'transaction':_0x1bbcf3});})[_0xa65d('0x29')](function(){var _0x5cd1a1={'type':db[_0xa65d('0x90')][_0xa65d('0x91')],'transaction':_0x1bbcf3};switch(_0xe8a31d[_0xa65d('0x4f')][_0xa65d('0x32')]){case _0xa65d('0x92'):_0x5cd1a1[_0xa65d('0x32')]=db[_0xa65d('0x90')][_0xa65d('0x91')];break;case _0xa65d('0x93'):_0x5cd1a1[_0xa65d('0x32')]=db[_0xa65d('0x90')]['INTEGER'];break;case _0xa65d('0x94'):_0x5cd1a1[_0xa65d('0x32')]=db[_0xa65d('0x90')][_0xa65d('0x95')];_0x5cd1a1['defaultValue']=![];break;default:}return db['sequelize'][_0xa65d('0x96')][_0xa65d('0x97')]('cm_contacts',util[_0xa65d('0x6a')]('cf_%s',_0x4ee1fc['id']),_0x5cd1a1);})[_0xa65d('0x29')](function(){return _0x4ee1fc;});});}})[_0xa65d('0x29')](respondWithResult(_0x19af82,null))[_0xa65d('0x4a')](handleError(_0x19af82,null));};exports[_0xa65d('0x98')]=function(_0x5a63ea,_0x3d9825,_0x3a82e6){var _0x2aa03c={};var _0xd36c2f={};var _0x583a05;var _0x7d5534;return db[_0xa65d('0x30')]['findOne']({'where':{'id':_0x5a63ea[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x3d9825,null))[_0xa65d('0x29')](function(_0x45ff41){if(_0x45ff41){_0x583a05=_0x45ff41;_0xd36c2f[_0xa65d('0x34')]=_['keys'](db[_0xa65d('0x70')][_0xa65d('0x6f')]);_0xd36c2f[_0xa65d('0x36')]=_[_0xa65d('0x37')](_0x5a63ea['query']);_0xd36c2f[_0xa65d('0x41')]=_[_0xa65d('0x38')](_0xd36c2f[_0xa65d('0x34')],_0xd36c2f['query']);_0x2aa03c[_0xa65d('0x39')]=_[_0xa65d('0x38')](_0xd36c2f[_0xa65d('0x34')],qs['fields'](_0x5a63ea[_0xa65d('0x36')][_0xa65d('0x3a')]));_0x2aa03c[_0xa65d('0x39')]=_0x2aa03c[_0xa65d('0x39')][_0xa65d('0x3b')]?_0x2aa03c[_0xa65d('0x39')]:_0xd36c2f['model'];_0x2aa03c[_0xa65d('0x3e')]=qs['sort'](_0x5a63ea[_0xa65d('0x36')][_0xa65d('0x3f')]);_0x2aa03c[_0xa65d('0x40')]=qs[_0xa65d('0x41')](_['pick'](_0x5a63ea[_0xa65d('0x36')],_0xd36c2f[_0xa65d('0x41')]));_0x2aa03c[_0xa65d('0x40')]=_[_0xa65d('0x44')](_0x2aa03c[_0xa65d('0x40')],{'$or':[{'ListId':_0x45ff41['id']},{'ListId':null}]});if(_0x5a63ea[_0xa65d('0x36')][_0xa65d('0x43')]){_0x2aa03c[_0xa65d('0x40')]=_[_0xa65d('0x44')](_0x2aa03c[_0xa65d('0x40')],{'$or':_[_0xa65d('0x35')](_0x2aa03c[_0xa65d('0x39')],function(_0x496cd1){var _0x429fa6={};_0x429fa6[_0x496cd1]={'$like':'%'+_0x5a63ea[_0xa65d('0x36')][_0xa65d('0x43')]+'%'};return _0x429fa6;})});}_0x2aa03c=_[_0xa65d('0x44')]({},_0x2aa03c,_0x5a63ea[_0xa65d('0x46')]);return db['CmCustomField']['findAndCountAll'](_0x2aa03c);}})[_0xa65d('0x29')](respondWithResult(_0x3d9825,null))['catch'](handleError(_0x3d9825,null));};exports['getGlobalCustomFields']=function(_0xb16b48,_0xb7ce27){return db[_0xa65d('0x70')]['findAndCountAll']({'where':{'ListId':null}})[_0xa65d('0x29')](handleEntityNotFound(_0xb7ce27,null))[_0xa65d('0x29')](function(_0xd6649b){return _0xd6649b;})['then'](respondWithResult(_0xb7ce27,null))[_0xa65d('0x4a')](handleError(_0xb7ce27,null));};exports[_0xa65d('0x99')]=function(_0x2e113f,_0x57fedb,_0x4af634){return db[_0xa65d('0x30')][_0xa65d('0x4d')]({'where':{'id':_0x2e113f[_0xa65d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57fedb,null))['then'](function(_0x2bf3cb){if(_0x2bf3cb){return _0x2bf3cb[_0xa65d('0x99')](_0x2e113f['body']['ids'],_[_0xa65d('0x9a')](_0x2e113f[_0xa65d('0x4f')],['ids','id'])||{})[_0xa65d('0x9b')](function(_0x185f23){for(var _0x3ca823=0x0;_0x3ca823<_0x2e113f[_0xa65d('0x4f')][_0xa65d('0x5d')][_0xa65d('0x3b')];_0x3ca823+=0x1){socket[_0xa65d('0x9c')](_0xa65d('0x9d'),{'UserId':Number(_0x2e113f['body'][_0xa65d('0x5d')][_0x3ca823]),'CmListId':Number(_0x2e113f[_0xa65d('0x4c')]['id'])});}return _0x185f23;});}})[_0xa65d('0x29')](respondWithResult(_0x57fedb,null))[_0xa65d('0x4a')](handleError(_0x57fedb,null));};exports['removeAgents']=function(_0x22bcc3,_0x259534,_0xb39ee3){return db[_0xa65d('0x30')][_0xa65d('0x4d')]({'where':{'id':_0x22bcc3[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0x259534,null))['then'](function(_0x4f92a0){if(_0x4f92a0){return _0x4f92a0['removeAgents'](_0x22bcc3[_0xa65d('0x36')][_0xa65d('0x5d')])['then'](function(){if(_[_0xa65d('0x61')](_0x22bcc3['query']['ids'])){for(var _0x43a266=0x0;_0x43a266<_0x22bcc3[_0xa65d('0x36')][_0xa65d('0x5d')]['length'];_0x43a266+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x22bcc3[_0xa65d('0x36')][_0xa65d('0x5d')][_0x43a266]),'CmListId':Number(_0x22bcc3[_0xa65d('0x4c')]['id'])});}}else{socket[_0xa65d('0x9c')](_0xa65d('0x9e'),{'UserId':Number(_0x22bcc3[_0xa65d('0x36')][_0xa65d('0x5d')]),'CmListId':Number(_0x22bcc3[_0xa65d('0x4c')]['id'])});}});}})[_0xa65d('0x29')](respondWithStatusCode(_0x259534,null))['catch'](handleError(_0x259534,null));};exports[_0xa65d('0x9f')]=function(_0x4a48a6,_0xba4010,_0x2275f7){var _0x4701bd={};var _0x5e0d70={};var _0x102cc6;var _0x2013c4;return db[_0xa65d('0x30')][_0xa65d('0x5b')]({'where':{'id':_0x4a48a6[_0xa65d('0x4c')]['id']}})[_0xa65d('0x29')](handleEntityNotFound(_0xba4010,null))[_0xa65d('0x29')](function(_0x209c65){if(_0x209c65){_0x102cc6=_0x209c65;_0x5e0d70[_0xa65d('0x34')]=_[_0xa65d('0x37')](db[_0xa65d('0xa0')]['rawAttributes']);_0x5e0d70[_0xa65d('0x36')]=_[_0xa65d('0x37')](_0x4a48a6['query']);_0x5e0d70[_0xa65d('0x41')]=_['intersection'](_0x5e0d70[_0xa65d('0x34')],_0x5e0d70[_0xa65d('0x36')]);_0x4701bd[_0xa65d('0x39')]=_[_0xa65d('0x38')](_0x5e0d70[_0xa65d('0x34')],qs['fields'](_0x4a48a6[_0xa65d('0x36')]['fields']));_0x4701bd[_0xa65d('0x39')]=_0x4701bd[_0xa65d('0x39')][_0xa65d('0x3b')]?_0x4701bd[_0xa65d('0x39')]:_0x5e0d70['model'];_0x4701bd[_0xa65d('0x3e')]=qs[_0xa65d('0x3f')](_0x4a48a6[_0xa65d('0x36')][_0xa65d('0x3f')]);_0x4701bd[_0xa65d('0x40')]=qs[_0xa65d('0x41')](_[_0xa65d('0x42')](_0x4a48a6[_0xa65d('0x36')],_0x5e0d70[_0xa65d('0x41')]));if(_0x4a48a6['query'][_0xa65d('0x43')]){_0x4701bd['where']=_[_0xa65d('0x44')](_0x4701bd[_0xa65d('0x40')],{'$or':_[_0xa65d('0x35')](_0x4701bd['attributes'],function(_0x201da5){var _0x5304d7={};_0x5304d7[_0x201da5]={'$like':'%'+_0x4a48a6['query'][_0xa65d('0x43')]+'%'};return _0x5304d7;})});}_0x4701bd=_[_0xa65d('0x44')]({},_0x4701bd,_0x4a48a6[_0xa65d('0x46')]);return _0x102cc6[_0xa65d('0x9f')](_0x4701bd);}})['then'](function(_0x48c958){if(_0x48c958){_0x2013c4=_0x48c958[_0xa65d('0x3b')];if(!_0x4a48a6['query'][_0xa65d('0x3c')](_0xa65d('0x3d'))){_0x4701bd[_0xa65d('0x21')]=qs[_0xa65d('0x21')](_0x4a48a6[_0xa65d('0x36')][_0xa65d('0x21')]);_0x4701bd[_0xa65d('0x1f')]=qs['offset'](_0x4a48a6[_0xa65d('0x36')][_0xa65d('0x1f')]);}return _0x102cc6[_0xa65d('0x9f')](_0x4701bd);}})[_0xa65d('0x29')](function(_0x8e9041){if(_0x8e9041){return _0x8e9041?{'count':_0x2013c4,'rows':_0x8e9041}:null;}})[_0xa65d('0x29')](respondWithResult(_0xba4010,null))[_0xa65d('0x4a')](handleError(_0xba4010,null));};function handleQuery(_0x471dcd){logger[_0xa65d('0xa1')](_0x471dcd);return db['sequelize'][_0xa65d('0x36')](_0x471dcd)[_0xa65d('0x9b')](function(_0x2c8ef5){csv_results['push'](_0x2c8ef5);})[_0xa65d('0x4a')](function(_0x338484){logger[_0xa65d('0x2d')](_0x338484['message']);});} \ No newline at end of file +var _0x03de=['addContacts','CmContact','tags','isArray','each','omit','ids','push','errors','message','json','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','from','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','defaultValue','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','limit','count','offset','set','apply','update','then','destroy','Lists','name','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','body','ListId','Disposition','findOne','length','options','findAll','removeDispositions'];(function(_0x1d793b,_0x30138e){var _0x69586a=function(_0x2b439c){while(--_0x2b439c){_0x1d793b['push'](_0x1d793b['shift']());}};_0x69586a(++_0x30138e);}(_0x03de,0xde));var _0xe03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03de[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe03d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe03d('0x1'));var jsonpatch=require(_0xe03d('0x2'));var rp=require('request-promise');var moment=require(_0xe03d('0x3'));var BPromise=require(_0xe03d('0x4'));var Mustache=require(_0xe03d('0x5'));var util=require(_0xe03d('0x6'));var path=require(_0xe03d('0x7'));var sox=require('sox');var csv=require(_0xe03d('0x8'));var ejs=require(_0xe03d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe03d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe03d('0xb'));var deskjs=require(_0xe03d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe03d('0xd'));var Papa=require(_0xe03d('0xe'));var Redis=require(_0xe03d('0xf'));var authService=require(_0xe03d('0x10'));var qs=require(_0xe03d('0x11'));var as=require(_0xe03d('0x12'));var hardwareService=require(_0xe03d('0x13'));var logger=require(_0xe03d('0x14'))(_0xe03d('0x15'));var utils=require(_0xe03d('0x16'));var config=require(_0xe03d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe03d('0x18'))['db'];var csv_results;config[_0xe03d('0x19')]=_[_0xe03d('0x1a')](config[_0xe03d('0x19')],{'host':_0xe03d('0x1b'),'port':0x18eb});var socket=require(_0xe03d('0x1c'))(new Redis(config[_0xe03d('0x19')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0xe9663d,_0x296367){_0x296367=_0x296367||0xcc;return function(_0x2c7e8c){if(_0x2c7e8c){return _0xe9663d[_0xe03d('0x1d')](_0x296367);}return _0xe9663d[_0xe03d('0x1e')](_0x296367)[_0xe03d('0x1f')]();};}function respondWithResult(_0x4e062a,_0x2045d4){_0x2045d4=_0x2045d4||0xc8;return function(_0xe089c){if(_0xe089c){return _0x4e062a[_0xe03d('0x1e')](_0x2045d4)['json'](_0xe089c);}};}function respondWithFilteredResult(_0x213cc1,_0x3deee1){return function(_0x3abdec){if(_0x3abdec){var _0x3c4f08=typeof _0x3deee1['offset']==='undefined'&&typeof _0x3deee1[_0xe03d('0x20')]==='undefined';var _0x3676de=_0x3abdec[_0xe03d('0x21')];var _0x5dac64=_0x3c4f08?0x0:_0x3deee1[_0xe03d('0x22')];var _0x41ac6f=_0x3c4f08?_0x3abdec[_0xe03d('0x21')]:_0x3deee1[_0xe03d('0x22')]+_0x3deee1[_0xe03d('0x20')];var _0x23a3dc;if(_0x41ac6f>=_0x3676de){_0x41ac6f=_0x3676de;_0x23a3dc=0xc8;}else{_0x23a3dc=0xce;}_0x213cc1[_0xe03d('0x1e')](_0x23a3dc);return _0x213cc1[_0xe03d('0x23')]('Content-Range',_0x5dac64+'-'+_0x41ac6f+'/'+_0x3676de)['json'](_0x3abdec);}return null;};}function patchUpdates(_0x5cc28d){return function(_0x5091ac){try{jsonpatch[_0xe03d('0x24')](_0x5091ac,_0x5cc28d,!![]);}catch(_0x399a9c){return BPromise['reject'](_0x399a9c);}return _0x5091ac['save']();};}function saveUpdates(_0x40b043,_0x5bcebe){return function(_0x37867e){if(_0x37867e){return _0x37867e[_0xe03d('0x25')](_0x40b043)[_0xe03d('0x26')](function(_0x30accf){return _0x30accf;});}return null;};}function removeEntity(_0x32a598,_0x5a1af7){return function(_0x2d9e7f){if(_0x2d9e7f){return _0x2d9e7f[_0xe03d('0x27')]()[_0xe03d('0x26')](function(){var _0xfed4e9=_0x2d9e7f['get']({'plain':!![]});var _0x5bbd26=_0xe03d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x5bbd26,'resourceId':_0xfed4e9['id']}})[_0xe03d('0x26')](function(){return _0x2d9e7f;});})['then'](function(){_0x32a598[_0xe03d('0x1e')](0xcc)[_0xe03d('0x1f')]();});}};}function handleEntityNotFound(_0x2d96b1,_0x5e418d){return function(_0x162506){if(!_0x162506){_0x2d96b1[_0xe03d('0x1d')](0x194);}return _0x162506;};}function handleError(_0x22eba2,_0x54079f){_0x54079f=_0x54079f||0x1f4;return function(_0x4bcd7a){logger['error'](_0x4bcd7a['stack']);if(_0x4bcd7a['name']){delete _0x4bcd7a[_0xe03d('0x29')];}_0x22eba2[_0xe03d('0x1e')](_0x54079f)['send'](_0x4bcd7a);};}exports[_0xe03d('0x2a')]=function(_0x5c6cd2,_0x582fe3){var _0x559fa4={},_0x258108={},_0x1b0e29={'count':0x0,'rows':[]};var _0xa153c8=_[_0xe03d('0x2b')](db[_0xe03d('0x2c')][_0xe03d('0x2d')],function(_0x3d8aab){return{'name':_0x3d8aab[_0xe03d('0x2e')],'type':_0x3d8aab[_0xe03d('0x2f')][_0xe03d('0x30')]};});_0x258108['model']=_[_0xe03d('0x2b')](_0xa153c8,_0xe03d('0x29'));_0x258108[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0x5c6cd2[_0xe03d('0x31')]);_0x258108['filters']=_[_0xe03d('0x33')](_0x258108[_0xe03d('0x34')],_0x258108[_0xe03d('0x31')]);_0x559fa4['attributes']=_[_0xe03d('0x33')](_0x258108[_0xe03d('0x34')],qs[_0xe03d('0x35')](_0x5c6cd2['query'][_0xe03d('0x35')]));_0x559fa4[_0xe03d('0x36')]=_0x559fa4['attributes']['length']?_0x559fa4[_0xe03d('0x36')]:_0x258108[_0xe03d('0x34')];if(!_0x5c6cd2['query'][_0xe03d('0x37')](_0xe03d('0x38'))){_0x559fa4[_0xe03d('0x20')]=qs[_0xe03d('0x20')](_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x20')]);_0x559fa4[_0xe03d('0x22')]=qs[_0xe03d('0x22')](_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x22')]);}_0x559fa4[_0xe03d('0x39')]=qs[_0xe03d('0x3a')](_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x559fa4[_0xe03d('0x3b')]=qs[_0xe03d('0x3c')](_[_0xe03d('0x3d')](_0x5c6cd2[_0xe03d('0x31')],_0x258108[_0xe03d('0x3c')]),_0xa153c8);if(_0x5c6cd2['query'][_0xe03d('0x3e')]){_0x559fa4[_0xe03d('0x3b')]=_['merge'](_0x559fa4['where'],{'$or':_[_0xe03d('0x2b')](_0xa153c8,function(_0x34357c){if(_0x34357c['type']!==_0xe03d('0x3f')){var _0x4b7f30={};_0x4b7f30[_0x34357c[_0xe03d('0x29')]]={'$like':'%'+_0x5c6cd2['query']['filter']+'%'};return _0x4b7f30;}})});}_0x559fa4=_[_0xe03d('0x40')]({},_0x559fa4,_0x5c6cd2['options']);var _0x4ede1f={'where':_0x559fa4['where']};return db[_0xe03d('0x2c')][_0xe03d('0x21')](_0x4ede1f)[_0xe03d('0x26')](function(_0x7d01bb){_0x1b0e29['count']=_0x7d01bb;if(_0x5c6cd2[_0xe03d('0x31')][_0xe03d('0x41')]){_0x559fa4[_0xe03d('0x42')]=[{'all':!![]}];}return db[_0xe03d('0x2c')]['findAll'](_0x559fa4);})[_0xe03d('0x26')](function(_0x6e3c24){_0x1b0e29[_0xe03d('0x43')]=_0x6e3c24;return _0x1b0e29;})['then'](respondWithFilteredResult(_0x582fe3,_0x559fa4))[_0xe03d('0x44')](handleError(_0x582fe3,null));};exports[_0xe03d('0x45')]=function(_0x131640,_0x158dfb){var _0x3c4292={'raw':![],'where':{'id':_0x131640['params']['id']}},_0x2e1711={};_0x2e1711[_0xe03d('0x34')]=_[_0xe03d('0x32')](db['CmList']['rawAttributes']);_0x2e1711[_0xe03d('0x31')]=_['keys'](_0x131640['query']);_0x2e1711[_0xe03d('0x3c')]=_[_0xe03d('0x33')](_0x2e1711['model'],_0x2e1711[_0xe03d('0x31')]);_0x3c4292[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x2e1711[_0xe03d('0x34')],qs['fields'](_0x131640[_0xe03d('0x31')][_0xe03d('0x35')]));_0x3c4292[_0xe03d('0x36')]=_0x3c4292['attributes']['length']?_0x3c4292[_0xe03d('0x36')]:_0x2e1711[_0xe03d('0x34')];if(_0x131640[_0xe03d('0x31')][_0xe03d('0x41')]){_0x3c4292['include']=[{'all':!![]}];}_0x3c4292=_['merge']({},_0x3c4292,_0x131640['options']);return db['CmList'][_0xe03d('0x46')](_0x3c4292)[_0xe03d('0x26')](handleEntityNotFound(_0x158dfb,null))['then'](respondWithResult(_0x158dfb,null))['catch'](handleError(_0x158dfb,null));};exports[_0xe03d('0x47')]=function(_0x233bb7,_0x375f26){return db[_0xe03d('0x2c')][_0xe03d('0x47')](_0x233bb7['body'],{})[_0xe03d('0x26')](function(_0x16fef4){var _0x592f3b=_0x233bb7[_0xe03d('0x48')][_0xe03d('0x49')]({'plain':!![]});if(!_0x592f3b)throw new Error(_0xe03d('0x4a'));if(_0x592f3b[_0xe03d('0x4b')]===_0xe03d('0x48')){var _0x1cbfc9=_0x16fef4[_0xe03d('0x49')]({'plain':!![]});var _0x4b3f7d='Lists';return db['UserProfileSection'][_0xe03d('0x46')]({'where':{'name':_0x4b3f7d,'userProfileId':_0x592f3b[_0xe03d('0x4c')]},'raw':!![]})[_0xe03d('0x26')](function(_0x5bf438){if(_0x5bf438&&_0x5bf438['autoAssociation']===0x0){return db[_0xe03d('0x4d')][_0xe03d('0x47')]({'name':_0x1cbfc9[_0xe03d('0x29')],'resourceId':_0x1cbfc9['id'],'type':_0x5bf438[_0xe03d('0x29')],'sectionId':_0x5bf438['id']},{})[_0xe03d('0x26')](function(){return _0x16fef4;});}else{return _0x16fef4;}})[_0xe03d('0x44')](function(_0x402ab3){logger[_0xe03d('0x4e')](_0xe03d('0x4f'),_0x402ab3);throw _0x402ab3;});}return _0x16fef4;})[_0xe03d('0x26')](respondWithResult(_0x375f26,0xc9))['catch'](handleError(_0x375f26,null));};exports['update']=function(_0x719ff0,_0x3d56ce){if(_0x719ff0['body']['id']){delete _0x719ff0['body']['id'];}return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x719ff0[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x3d56ce,null))['then'](saveUpdates(_0x719ff0['body'],null))[_0xe03d('0x26')](respondWithResult(_0x3d56ce,null))[_0xe03d('0x44')](handleError(_0x3d56ce,null));};exports['destroy']=function(_0xe6cbb5,_0x4f431a){return db[_0xe03d('0x2c')]['find']({'where':{'id':_0xe6cbb5[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x4f431a,null))[_0xe03d('0x26')](removeEntity(_0x4f431a,null))['catch'](handleError(_0x4f431a,null));};exports[_0xe03d('0x51')]=function(_0x810ac,_0x1ba8a2){return db[_0xe03d('0x2c')][_0xe03d('0x51')]()[_0xe03d('0x26')](respondWithResult(_0x1ba8a2,null))[_0xe03d('0x44')](handleError(_0x1ba8a2,null));};exports['addDisposition']=function(_0xf0e622,_0x500896,_0x90f5fc){if(_0xf0e622[_0xe03d('0x52')]['id']){delete _0xf0e622['body']['id'];}return db['CmList'][_0xe03d('0x46')]({'where':{'id':_0xf0e622[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x500896,null))[_0xe03d('0x26')](function(_0x547409){if(_0x547409){_0xf0e622[_0xe03d('0x52')][_0xe03d('0x53')]=_0x547409['id'];return db[_0xe03d('0x54')][_0xe03d('0x47')](_0xf0e622[_0xe03d('0x52')]);}})[_0xe03d('0x26')](respondWithResult(_0x500896,null))[_0xe03d('0x44')](handleError(_0x500896,null));};exports['getDispositions']=function(_0x52a78a,_0x28595f,_0x9de0fa){var _0x5f5026={'raw':![],'where':{}};var _0x3f3927={};var _0x54339c={'count':0x0,'rows':[]};return db[_0xe03d('0x2c')][_0xe03d('0x55')]({'where':{'id':_0x52a78a[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x28595f,null))[_0xe03d('0x26')](function(_0x4288d1){if(_0x4288d1){_0x3f3927[_0xe03d('0x34')]=_[_0xe03d('0x32')](db['Disposition'][_0xe03d('0x2d')]);_0x3f3927[_0xe03d('0x31')]=_['keys'](_0x52a78a[_0xe03d('0x31')]);_0x3f3927['filters']=_[_0xe03d('0x33')](_0x3f3927[_0xe03d('0x34')],_0x3f3927['query']);_0x5f5026[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x3f3927['model'],qs[_0xe03d('0x35')](_0x52a78a[_0xe03d('0x31')]['fields']));_0x5f5026['attributes']=_0x5f5026['attributes'][_0xe03d('0x56')]?_0x5f5026['attributes']:_0x3f3927[_0xe03d('0x34')];if(!_0x52a78a[_0xe03d('0x31')][_0xe03d('0x37')]('nolimit')){_0x5f5026[_0xe03d('0x20')]=qs['limit'](_0x52a78a[_0xe03d('0x31')][_0xe03d('0x20')]);_0x5f5026[_0xe03d('0x22')]=qs[_0xe03d('0x22')](_0x52a78a[_0xe03d('0x31')]['offset']);}_0x5f5026[_0xe03d('0x39')]=qs[_0xe03d('0x3a')](_0x52a78a[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x5f5026['where']=qs['filters'](_[_0xe03d('0x3d')](_0x52a78a[_0xe03d('0x31')],_0x3f3927[_0xe03d('0x3c')]));_0x5f5026[_0xe03d('0x3b')][_0xe03d('0x53')]=_0x4288d1['id'];if(_0x52a78a[_0xe03d('0x31')][_0xe03d('0x3e')]){_0x5f5026['where']=_[_0xe03d('0x40')](_0x5f5026['where'],{'$or':_[_0xe03d('0x2b')](_0x5f5026[_0xe03d('0x36')],function(_0x4c226f){var _0x4d1280={};_0x4d1280[_0x4c226f]={'$like':'%'+_0x52a78a[_0xe03d('0x31')][_0xe03d('0x3e')]+'%'};return _0x4d1280;})});}_0x5f5026=_[_0xe03d('0x40')]({},_0x5f5026,_0x52a78a[_0xe03d('0x57')]);return db['Disposition']['count']({'where':_0x5f5026['where']})[_0xe03d('0x26')](function(_0x184da6){_0x54339c[_0xe03d('0x21')]=_0x184da6;if(_0x52a78a['query'][_0xe03d('0x41')]){_0x5f5026['include']=[{'all':!![]}];}return db[_0xe03d('0x54')][_0xe03d('0x58')](_0x5f5026);})[_0xe03d('0x26')](function(_0x2fe98e){_0x54339c[_0xe03d('0x43')]=_0x2fe98e;return _0x54339c;});}})[_0xe03d('0x26')](respondWithFilteredResult(_0x28595f,_0x5f5026))['catch'](handleError(_0x28595f,null));};exports[_0xe03d('0x59')]=function(_0x1ec7a7,_0x7d029f,_0x478a8a){return db['CmList'][_0xe03d('0x46')]({'where':{'id':_0x1ec7a7[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x7d029f,null))[_0xe03d('0x26')](function(_0x3b5f1d){if(_0x3b5f1d){return _0x3b5f1d[_0xe03d('0x59')](_0x1ec7a7['query']['ids']);}})[_0xe03d('0x26')](respondWithStatusCode(_0x7d029f,null))['catch'](handleError(_0x7d029f,null));};exports[_0xe03d('0x5a')]=function(_0x50798a,_0x391e66,_0x49b983){return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x50798a[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x391e66,null))[_0xe03d('0x26')](function(_0x4c45b9){if(_0x4c45b9){var _0x8f213f=[];var _0x12023c={'success':[],'errors':[]};return db[_0xe03d('0x5b')][_0xe03d('0x51')]()[_0xe03d('0x26')](function(_0xa9c77f){if(_0x50798a[_0xe03d('0x52')]['tags']&&_['isArray'](_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')])){if(_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')][_0xe03d('0x56')]){_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')]=_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')]['join'](';')+';';}else{_0x50798a[_0xe03d('0x52')][_0xe03d('0x5c')]=null;}}else{_0x50798a['body'][_0xe03d('0x5c')]=null;}if(_0x50798a[_0xe03d('0x52')]&&_[_0xe03d('0x5d')](_0x50798a['body'])){for(var _0x3e995c=0x0;_0x3e995c<_0x50798a[_0xe03d('0x52')][_0xe03d('0x56')];_0x3e995c+=0x1){_0x50798a['body'][_0x3e995c][_0xe03d('0x53')]=_0x50798a[_0xe03d('0x50')]['id'];_0x8f213f['push'](_0x50798a[_0xe03d('0x52')][_0x3e995c]);}return BPromise[_0xe03d('0x5e')](_0x8f213f,function(_0x5d3fdd){return db[_0xe03d('0x5b')]['create'](_[_0xe03d('0x5f')](_0x5d3fdd,[_0xe03d('0x60'),'id'])||{},{'fields':_['keys'](_0xa9c77f),'raw':!![]})['then'](function(_0x3d4482){_0x12023c['success'][_0xe03d('0x61')](_0x3d4482['dataValues']);})[_0xe03d('0x44')](function(_0x5b407c){_0x12023c[_0xe03d('0x62')][_0xe03d('0x61')]({'data':_0x5d3fdd,'error':_0x5b407c[_0xe03d('0x63')]});});})[_0xe03d('0x26')](function(_0x26a944){return _0x12023c;})[_0xe03d('0x44')](function(_0x237113){return _0x237113;});}else{_0x391e66[_0xe03d('0x1e')](0x190)[_0xe03d('0x64')]({'message':_0xe03d('0x65')});}});}})[_0xe03d('0x26')](respondWithResult(_0x391e66,null))['catch'](handleError(_0x391e66,null));};exports[_0xe03d('0x66')]=function(_0x22d6ad,_0x2bbcbe,_0x7cd9f){var _0x30894b;return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x22d6ad[_0xe03d('0x50')]['id']},'include':[{'model':db[_0xe03d('0x67')],'as':_0xe03d('0x68')}]})[_0xe03d('0x26')](handleEntityNotFound(_0x2bbcbe,null))[_0xe03d('0x26')](function(_0x149255){if(_0x149255){_0x30894b=_0x149255;return db[_0xe03d('0x5b')][_0xe03d('0x2d')];}})[_0xe03d('0x26')](function(_0x4b6f01){if(_0x4b6f01){var _0x244245={};var _0x2ded2f={};_0x2ded2f[_0xe03d('0x34')]=_['concat'](_[_0xe03d('0x32')](_0x4b6f01),_[_0xe03d('0x2b')](_0x30894b['CustomFields'],function(_0x435d0e){return util[_0xe03d('0x69')](_0xe03d('0x6a'),_0x435d0e['id']);}));_0x2ded2f[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0x22d6ad[_0xe03d('0x31')]);_0x2ded2f[_0xe03d('0x3c')]=_['intersection'](_0x2ded2f[_0xe03d('0x34')],_0x2ded2f['query']);_0x244245[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x2ded2f[_0xe03d('0x34')],qs[_0xe03d('0x35')](_0x22d6ad[_0xe03d('0x31')]['fields']));_0x244245[_0xe03d('0x36')]=_0x244245[_0xe03d('0x36')][_0xe03d('0x56')]?_0x244245['attributes']:_0x2ded2f[_0xe03d('0x34')];if(!_0x22d6ad[_0xe03d('0x31')][_0xe03d('0x37')](_0xe03d('0x38'))){_0x244245[_0xe03d('0x20')]=qs['limit'](_0x22d6ad['query'][_0xe03d('0x20')]);_0x244245['offset']=qs['offset'](_0x22d6ad['query'][_0xe03d('0x22')]);}_0x244245[_0xe03d('0x39')]=qs['sort'](_0x22d6ad[_0xe03d('0x31')]['sort']);_0x244245[_0xe03d('0x3b')]=qs['filters'](_['pick'](_0x22d6ad[_0xe03d('0x31')],_0x2ded2f[_0xe03d('0x3c')]));_0x244245[_0xe03d('0x6b')]=!![];if(_0x22d6ad[_0xe03d('0x31')]['filter']){_0x244245[_0xe03d('0x3b')]=_[_0xe03d('0x40')](_0x244245[_0xe03d('0x3b')],{'$or':_[_0xe03d('0x2b')](_0x244245[_0xe03d('0x36')],function(_0x2c64e5){var _0x4bf15b={};_0x4bf15b[_0x2c64e5]={'$like':'%'+_0x22d6ad['query'][_0xe03d('0x3e')]+'%'};return _0x4bf15b;})});}_0x244245=_[_0xe03d('0x40')]({},_0x244245,_0x22d6ad[_0xe03d('0x57')]);return _0x30894b[_0xe03d('0x66')](_0x244245);}})[_0xe03d('0x26')](respondWithResult(_0x2bbcbe,null))[_0xe03d('0x44')](handleError(_0x2bbcbe,null));};exports[_0xe03d('0x6c')]=function(_0x46196f,_0x431bff,_0x448e92){var _0x287e24;var _0x3ae1b6;var _0x2eaeb5;var _0x465494=_0x46196f[_0xe03d('0x50')]['id'];csv_results=[];return db[_0xe03d('0x6d')][_0xe03d('0x58')]({'attributes':['id',_0xe03d('0x29')],'raw':!![],'order':[_0xe03d('0x6e')]})[_0xe03d('0x26')](function(_0x3a7d42){_0x287e24=_0x3a7d42;var _0x574880=_['keys'](db[_0xe03d('0x5b')][_0xe03d('0x2d')]);return db[_0xe03d('0x67')][_0xe03d('0x58')]({'raw':!![],'attributes':['id','alias']})[_0xe03d('0x26')](function(_0x4acce6){_0x3ae1b6=_0x4acce6;var _0x2d5d63=squel[_0xe03d('0x6f')]()[_0xe03d('0x35')](_0x574880)['from'](_0xe03d('0x70'),'c')['where'](_0xe03d('0x71'),_0x465494)[_0xe03d('0x3b')]('c.deletedAt\x20is\x20null')[_0xe03d('0x72')]();for(var _0xdb6334=0x0;_0xdb6334<_0x3ae1b6[_0xe03d('0x56')];_0xdb6334++){_0x2d5d63[_0xe03d('0x73')](_0xe03d('0x74')+_0x3ae1b6[_0xdb6334]['id'],_0xe03d('0x75')+_0x3ae1b6[_0xdb6334][_0xe03d('0x76')]);}for(var _0xdb6334=0x0;_0xdb6334<_0x287e24[_0xe03d('0x56')];_0xdb6334++){_0x2d5d63[_0xe03d('0x73')](squel[_0xe03d('0x6f')]()['field'](_0xe03d('0x77'))['from'](_0xe03d('0x78'))[_0xe03d('0x3b')]('ItemTypeId\x20=\x20?',_0x287e24[_0xdb6334]['id'])[_0xe03d('0x3b')](_0xe03d('0x79')),_0xe03d('0x7a')+_0x287e24[_0xdb6334][_0xe03d('0x29')]);_0x2d5d63[_0xe03d('0x73')](squel[_0xe03d('0x6f')]()['field'](_0xe03d('0x7b'))[_0xe03d('0x7c')](_0xe03d('0x78'))[_0xe03d('0x3b')](_0xe03d('0x7d'),_0x287e24[_0xdb6334]['id'])[_0xe03d('0x3b')]('CmContactId\x20=\x20c.id'),_0xe03d('0x7e')+_0x287e24[_0xdb6334]['name']);}var _0x205b69=[];_0x205b69[_0xe03d('0x61')](_0x2d5d63[_0xe03d('0x7f')]());BPromise['each'](_0x205b69,handleQuery)[_0xe03d('0x26')](function(_0x378401){handleQuery(_0x2d5d63[_0xe03d('0x7f')]());var _0x32b800=csv_results[0x0];if(!_[_0xe03d('0x80')](_0x32b800)){var _0x21e873=toCsv(_0x32b800);var _0xd43937=Date['now']();fs[_0xe03d('0x81')](util[_0xe03d('0x69')](_0xe03d('0x82'),_0x465494,_0xd43937),_0x21e873);_0x431bff['setHeader'](_0xe03d('0x83'),_0xe03d('0x84')+util[_0xe03d('0x69')](_0xe03d('0x85'),_0x465494,_0xd43937));_0x431bff[_0xe03d('0x86')]('Content-type',_0xe03d('0x87'));return _0x431bff['download'](util['format'](_0xe03d('0x82'),_0x465494,_0xd43937));}else{return _0x431bff[_0xe03d('0x1d')](0xcc);}});});});};exports[_0xe03d('0x88')]=function(_0x4ac148,_0x48656f,_0x1fac86){var _0x431391;delete _0x4ac148[_0xe03d('0x52')]['id'];return db[_0xe03d('0x2c')]['findOne']({'where':{'id':_0x4ac148[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x48656f,null))[_0xe03d('0x26')](function(_0x7ace1d){if(_0x7ace1d){return db[_0xe03d('0x89')][_0xe03d('0x8a')](function(_0x4f0530){return db[_0xe03d('0x67')][_0xe03d('0x47')](_0x4ac148[_0xe03d('0x52')],{'transaction':_0x4f0530})['then'](function(_0x28fa9b){_0x431391=_0x28fa9b;return _0x7ace1d[_0xe03d('0x8b')](_0x28fa9b,{'transaction':_0x4f0530});})[_0xe03d('0x26')](function(){var _0x2187fc={'type':db['Sequelize'][_0xe03d('0x8c')],'transaction':_0x4f0530};switch(_0x4ac148[_0xe03d('0x52')][_0xe03d('0x2f')]){case _0xe03d('0x8d'):_0x2187fc[_0xe03d('0x2f')]=db[_0xe03d('0x8e')]['TEXT'];break;case _0xe03d('0x8f'):_0x2187fc[_0xe03d('0x2f')]=db[_0xe03d('0x8e')][_0xe03d('0x90')];break;case'switch':_0x2187fc[_0xe03d('0x2f')]=db[_0xe03d('0x8e')]['BOOLEAN'];_0x2187fc[_0xe03d('0x91')]=![];break;default:}return db[_0xe03d('0x89')]['queryInterface']['addColumn']('cm_contacts',util[_0xe03d('0x69')]('cf_%s',_0x431391['id']),_0x2187fc);})[_0xe03d('0x26')](function(){return _0x431391;});});}})[_0xe03d('0x26')](respondWithResult(_0x48656f,null))[_0xe03d('0x44')](handleError(_0x48656f,null));};exports['getCustomFields']=function(_0xbad843,_0x1737a4,_0x24d54c){var _0x279872={};var _0x4b4ff7={};var _0x1214d0;var _0x3d06a0;return db[_0xe03d('0x2c')][_0xe03d('0x55')]({'where':{'id':_0xbad843[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x1737a4,null))['then'](function(_0x55a115){if(_0x55a115){_0x1214d0=_0x55a115;_0x4b4ff7['model']=_[_0xe03d('0x32')](db[_0xe03d('0x67')][_0xe03d('0x2d')]);_0x4b4ff7[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0xbad843[_0xe03d('0x31')]);_0x4b4ff7[_0xe03d('0x3c')]=_[_0xe03d('0x33')](_0x4b4ff7[_0xe03d('0x34')],_0x4b4ff7['query']);_0x279872[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x4b4ff7[_0xe03d('0x34')],qs[_0xe03d('0x35')](_0xbad843[_0xe03d('0x31')][_0xe03d('0x35')]));_0x279872[_0xe03d('0x36')]=_0x279872[_0xe03d('0x36')][_0xe03d('0x56')]?_0x279872[_0xe03d('0x36')]:_0x4b4ff7[_0xe03d('0x34')];_0x279872[_0xe03d('0x39')]=qs[_0xe03d('0x3a')](_0xbad843[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x279872[_0xe03d('0x3b')]=qs[_0xe03d('0x3c')](_[_0xe03d('0x3d')](_0xbad843[_0xe03d('0x31')],_0x4b4ff7[_0xe03d('0x3c')]));_0x279872[_0xe03d('0x3b')]=_['merge'](_0x279872[_0xe03d('0x3b')],{'$or':[{'ListId':_0x55a115['id']},{'ListId':null}]});if(_0xbad843[_0xe03d('0x31')][_0xe03d('0x3e')]){_0x279872['where']=_[_0xe03d('0x40')](_0x279872[_0xe03d('0x3b')],{'$or':_[_0xe03d('0x2b')](_0x279872[_0xe03d('0x36')],function(_0x58468e){var _0x470bf3={};_0x470bf3[_0x58468e]={'$like':'%'+_0xbad843['query'][_0xe03d('0x3e')]+'%'};return _0x470bf3;})});}_0x279872=_[_0xe03d('0x40')]({},_0x279872,_0xbad843['options']);return db[_0xe03d('0x67')][_0xe03d('0x92')](_0x279872);}})[_0xe03d('0x26')](respondWithResult(_0x1737a4,null))['catch'](handleError(_0x1737a4,null));};exports[_0xe03d('0x93')]=function(_0x91ce9,_0x51a705){return db[_0xe03d('0x67')][_0xe03d('0x92')]({'where':{'ListId':null}})[_0xe03d('0x26')](handleEntityNotFound(_0x51a705,null))[_0xe03d('0x26')](function(_0x4282d5){return _0x4282d5;})[_0xe03d('0x26')](respondWithResult(_0x51a705,null))[_0xe03d('0x44')](handleError(_0x51a705,null));};exports[_0xe03d('0x94')]=function(_0x2d5fcb,_0x3e3ec8,_0x3c43d5){return db[_0xe03d('0x2c')][_0xe03d('0x46')]({'where':{'id':_0x2d5fcb[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x3e3ec8,null))['then'](function(_0x194e9a){if(_0x194e9a){return _0x194e9a[_0xe03d('0x94')](_0x2d5fcb[_0xe03d('0x52')][_0xe03d('0x60')],_[_0xe03d('0x5f')](_0x2d5fcb[_0xe03d('0x52')],[_0xe03d('0x60'),'id'])||{})[_0xe03d('0x95')](function(_0x25c0c7){for(var _0x17cb94=0x0;_0x17cb94<_0x2d5fcb[_0xe03d('0x52')]['ids']['length'];_0x17cb94+=0x1){socket[_0xe03d('0x96')](_0xe03d('0x97'),{'UserId':Number(_0x2d5fcb[_0xe03d('0x52')][_0xe03d('0x60')][_0x17cb94]),'CmListId':Number(_0x2d5fcb[_0xe03d('0x50')]['id'])});}return _0x25c0c7;});}})[_0xe03d('0x26')](respondWithResult(_0x3e3ec8,null))[_0xe03d('0x44')](handleError(_0x3e3ec8,null));};exports[_0xe03d('0x98')]=function(_0x4a1dd1,_0x3075dc,_0x482cac){return db['CmList'][_0xe03d('0x46')]({'where':{'id':_0x4a1dd1[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x3075dc,null))['then'](function(_0x568c9b){if(_0x568c9b){return _0x568c9b['removeAgents'](_0x4a1dd1[_0xe03d('0x31')]['ids'])[_0xe03d('0x26')](function(){if(_[_0xe03d('0x5d')](_0x4a1dd1[_0xe03d('0x31')][_0xe03d('0x60')])){for(var _0x107332=0x0;_0x107332<_0x4a1dd1[_0xe03d('0x31')]['ids'][_0xe03d('0x56')];_0x107332+=0x1){socket[_0xe03d('0x96')](_0xe03d('0x99'),{'UserId':Number(_0x4a1dd1['query'][_0xe03d('0x60')][_0x107332]),'CmListId':Number(_0x4a1dd1['params']['id'])});}}else{socket[_0xe03d('0x96')](_0xe03d('0x99'),{'UserId':Number(_0x4a1dd1[_0xe03d('0x31')]['ids']),'CmListId':Number(_0x4a1dd1[_0xe03d('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x3075dc,null))['catch'](handleError(_0x3075dc,null));};exports['getAgents']=function(_0x538340,_0x2b289b,_0x4e2fd7){var _0x3dcc34={};var _0x129006={};var _0x3bf415;var _0x475453;return db[_0xe03d('0x2c')][_0xe03d('0x55')]({'where':{'id':_0x538340[_0xe03d('0x50')]['id']}})[_0xe03d('0x26')](handleEntityNotFound(_0x2b289b,null))['then'](function(_0x3a2392){if(_0x3a2392){_0x3bf415=_0x3a2392;_0x129006[_0xe03d('0x34')]=_[_0xe03d('0x32')](db[_0xe03d('0x9a')][_0xe03d('0x2d')]);_0x129006[_0xe03d('0x31')]=_[_0xe03d('0x32')](_0x538340[_0xe03d('0x31')]);_0x129006[_0xe03d('0x3c')]=_['intersection'](_0x129006[_0xe03d('0x34')],_0x129006['query']);_0x3dcc34[_0xe03d('0x36')]=_[_0xe03d('0x33')](_0x129006['model'],qs['fields'](_0x538340[_0xe03d('0x31')][_0xe03d('0x35')]));_0x3dcc34[_0xe03d('0x36')]=_0x3dcc34[_0xe03d('0x36')]['length']?_0x3dcc34[_0xe03d('0x36')]:_0x129006['model'];_0x3dcc34[_0xe03d('0x39')]=qs['sort'](_0x538340[_0xe03d('0x31')][_0xe03d('0x3a')]);_0x3dcc34[_0xe03d('0x3b')]=qs[_0xe03d('0x3c')](_[_0xe03d('0x3d')](_0x538340[_0xe03d('0x31')],_0x129006[_0xe03d('0x3c')]));if(_0x538340['query'][_0xe03d('0x3e')]){_0x3dcc34[_0xe03d('0x3b')]=_[_0xe03d('0x40')](_0x3dcc34[_0xe03d('0x3b')],{'$or':_[_0xe03d('0x2b')](_0x3dcc34[_0xe03d('0x36')],function(_0x440204){var _0x1f1a3c={};_0x1f1a3c[_0x440204]={'$like':'%'+_0x538340[_0xe03d('0x31')][_0xe03d('0x3e')]+'%'};return _0x1f1a3c;})});}_0x3dcc34=_['merge']({},_0x3dcc34,_0x538340[_0xe03d('0x57')]);return _0x3bf415['getAgents'](_0x3dcc34);}})['then'](function(_0x2e4be9){if(_0x2e4be9){_0x475453=_0x2e4be9[_0xe03d('0x56')];if(!_0x538340['query'][_0xe03d('0x37')](_0xe03d('0x38'))){_0x3dcc34[_0xe03d('0x20')]=qs[_0xe03d('0x20')](_0x538340['query'][_0xe03d('0x20')]);_0x3dcc34[_0xe03d('0x22')]=qs['offset'](_0x538340[_0xe03d('0x31')][_0xe03d('0x22')]);}return _0x3bf415[_0xe03d('0x9b')](_0x3dcc34);}})[_0xe03d('0x26')](function(_0x52e167){if(_0x52e167){return _0x52e167?{'count':_0x475453,'rows':_0x52e167}:null;}})[_0xe03d('0x26')](respondWithResult(_0x2b289b,null))['catch'](handleError(_0x2b289b,null));};function handleQuery(_0x246f2a){logger['info'](_0x246f2a);return db['sequelize']['query'](_0x246f2a)[_0xe03d('0x95')](function(_0x3d4144){csv_results[_0xe03d('0x61')](_0x3d4144);})[_0xe03d('0x44')](function(_0x2863fb){logger[_0xe03d('0x4e')](_0x2863fb[_0xe03d('0x63')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d53f637..e3fdb6d 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x1c6b23,_0x361a9f){_0x1c6b23=_0x1c6b23-0x0;var _0x1edee7=_0x3e74[_0x1c6b23];return _0x1edee7;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x231351,_0x302a2b){var _0x37766c=function(_0x32dd68){while(--_0x32dd68){_0x231351['push'](_0x231351['shift']());}};_0x37766c(++_0x302a2b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index db6d828..4788dec 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 _0x0bb5=['define','CmList','cm_lists','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0x0bb5,0x148));var _0x50bb=function(_0x4d867a,_0x19e636){_0x4d867a=_0x4d867a-0x0;var _0x33bd2d=_0x0bb5[_0x4d867a];return _0x33bd2d;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50bb('0x2'));var BPromise=require(_0x50bb('0x3'));var rp=require(_0x50bb('0x4'));var fs=require('fs');var path=require(_0x50bb('0x5'));var rimraf=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var attributes=require(_0x50bb('0x8'));module[_0x50bb('0x9')]=function(_0x4e6093,_0x4a105c){return _0x4e6093[_0x50bb('0xa')](_0x50bb('0xb'),attributes,{'tableName':_0x50bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x48d999,_0x522309){var _0x33f0ab=function(_0x53c8ed){while(--_0x53c8ed){_0x48d999['push'](_0x48d999['shift']());}};_0x33f0ab(++_0x522309);}(_0x22fb,0x192));var _0xb22f=function(_0x510ab8,_0x23db33){_0x510ab8=_0x510ab8-0x0;var _0x55cb43=_0x22fb[_0x510ab8];return _0x55cb43;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 85f9749..3bf96e1 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 _0x7c47=['CmList,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','request\x20sent'];(function(_0x1f5324,_0x139885){var _0x2ce03d=function(_0x4be8ad){while(--_0x4be8ad){_0x1f5324['push'](_0x1f5324['shift']());}};_0x2ce03d(++_0x139885);}(_0x7c47,0xeb));var _0x77c4=function(_0xf9f84b,_0x47cdf){_0xf9f84b=_0xf9f84b-0x0;var _0x50b98a=_0x7c47[_0xf9f84b];return _0x50b98a;};'use strict';var _=require(_0x77c4('0x0'));var util=require(_0x77c4('0x1'));var moment=require('moment');var BPromise=require(_0x77c4('0x2'));var rs=require(_0x77c4('0x3'));var fs=require('fs');var Redis=require(_0x77c4('0x4'));var db=require(_0x77c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77c4('0x6'))('rpc');var config=require(_0x77c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x77c4('0x8')]['http']({'port':0x232a});config[_0x77c4('0x9')]=_[_0x77c4('0xa')](config[_0x77c4('0x9')],{'host':_0x77c4('0xb'),'port':0x18eb});var socket=require(_0x77c4('0xc'))(new Redis(config[_0x77c4('0x9')]));require(_0x77c4('0xd'))['register'](socket);function respondWithRpcPromise(_0x494c38,_0x4efa69,_0x2e2675){return new BPromise(function(_0x317f19,_0x1175ac){return client[_0x77c4('0xe')](_0x494c38,_0x2e2675)['then'](function(_0x35e16e){logger[_0x77c4('0xf')](_0x77c4('0x10'),_0x4efa69,_0x77c4('0x11'));logger['debug'](_0x77c4('0x12'),_0x4efa69,_0x77c4('0x11'),JSON['stringify'](_0x35e16e));if(_0x35e16e[_0x77c4('0x13')]){if(_0x35e16e[_0x77c4('0x13')][_0x77c4('0x14')]===0x1f4){logger[_0x77c4('0x13')](_0x77c4('0x10'),_0x4efa69,_0x35e16e['error'][_0x77c4('0x15')]);return _0x1175ac(_0x35e16e[_0x77c4('0x13')][_0x77c4('0x15')]);}logger['error'](_0x77c4('0x10'),_0x4efa69,_0x35e16e[_0x77c4('0x13')]['message']);return _0x317f19(_0x35e16e[_0x77c4('0x13')][_0x77c4('0x15')]);}else{logger[_0x77c4('0xf')](_0x77c4('0x10'),_0x4efa69,_0x77c4('0x11'));_0x317f19(_0x35e16e['result']['message']);}})[_0x77c4('0x16')](function(_0x28240d){logger[_0x77c4('0x13')]('CmList,\x20%s,\x20%s',_0x4efa69,_0x28240d);_0x1175ac(_0x28240d);});});} \ No newline at end of file +var _0xaab0=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49ce5d,_0x4eb106){var _0x43f4f7=function(_0x21b881){while(--_0x21b881){_0x49ce5d['push'](_0x49ce5d['shift']());}};_0x43f4f7(++_0x4eb106);}(_0xaab0,0x1b6));var _0x0aab=function(_0x4114dd,_0x2ad862){_0x4114dd=_0x4114dd-0x0;var _0x26f44c=_0xaab0[_0x4114dd];return _0x26f44c;};'use strict';var _=require(_0x0aab('0x0'));var util=require(_0x0aab('0x1'));var moment=require(_0x0aab('0x2'));var BPromise=require('bluebird');var rs=require(_0x0aab('0x3'));var fs=require('fs');var Redis=require(_0x0aab('0x4'));var db=require(_0x0aab('0x5'))['db'];var utils=require(_0x0aab('0x6'));var logger=require(_0x0aab('0x7'))(_0x0aab('0x8'));var config=require(_0x0aab('0x9'));var jayson=require(_0x0aab('0xa'));var client=jayson[_0x0aab('0xb')]['http']({'port':0x232a});config[_0x0aab('0xc')]=_[_0x0aab('0xd')](config['redis'],{'host':_0x0aab('0xe'),'port':0x18eb});var socket=require(_0x0aab('0xf'))(new Redis(config[_0x0aab('0xc')]));require('./cmList.socket')[_0x0aab('0x10')](socket);function respondWithRpcPromise(_0x6fbbe1,_0x3684e7,_0x2ca118){return new BPromise(function(_0x1249d8,_0x81b958){return client[_0x0aab('0x11')](_0x6fbbe1,_0x2ca118)[_0x0aab('0x12')](function(_0x4aaa6a){logger['info']('CmList,\x20%s,\x20%s',_0x3684e7,_0x0aab('0x13'));logger['debug'](_0x0aab('0x14'),_0x3684e7,'request\x20sent',JSON[_0x0aab('0x15')](_0x4aaa6a));if(_0x4aaa6a[_0x0aab('0x16')]){if(_0x4aaa6a['error'][_0x0aab('0x17')]===0x1f4){logger[_0x0aab('0x16')](_0x0aab('0x18'),_0x3684e7,_0x4aaa6a[_0x0aab('0x16')][_0x0aab('0x19')]);return _0x81b958(_0x4aaa6a['error'][_0x0aab('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x3684e7,_0x4aaa6a['error'][_0x0aab('0x19')]);return _0x1249d8(_0x4aaa6a[_0x0aab('0x16')]['message']);}else{logger['info'](_0x0aab('0x18'),_0x3684e7,_0x0aab('0x13'));_0x1249d8(_0x4aaa6a[_0x0aab('0x1a')]['message']);}})[_0x0aab('0x1b')](function(_0x539dd4){logger[_0x0aab('0x16')](_0x0aab('0x18'),_0x3684e7,_0x539dd4);_0x81b958(_0x539dd4);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1e553c0..2b3d0a3 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 _0xe921=['save','remove','update','emit','removeListener','register','length','cmList:','./cmList.events'];(function(_0x593e61,_0x46dd2c){var _0x4eb6f4=function(_0x2d7408){while(--_0x2d7408){_0x593e61['push'](_0x593e61['shift']());}};_0x4eb6f4(++_0x46dd2c);}(_0xe921,0xa1));var _0x1e92=function(_0xdb760,_0x54eb5){_0xdb760=_0xdb760-0x0;var _0x439657=_0xe921[_0xdb760];return _0x439657;};'use strict';var CmListEvents=require(_0x1e92('0x0'));var events=[_0x1e92('0x1'),_0x1e92('0x2'),_0x1e92('0x3')];function createListener(_0x493267,_0x5c83d7){return function(_0x23f3d1){_0x5c83d7[_0x1e92('0x4')](_0x493267,_0x23f3d1);};}function removeListener(_0x1ff4e2,_0x1c9959){return function(){CmListEvents[_0x1e92('0x5')](_0x1ff4e2,_0x1c9959);};}exports[_0x1e92('0x6')]=function(_0x15c072){for(var _0x8d3879=0x0,_0x4ba182=events[_0x1e92('0x7')];_0x8d3879<_0x4ba182;_0x8d3879++){var _0xe74dec=events[_0x8d3879];var _0x390221=createListener(_0x1e92('0x8')+_0xe74dec,_0x15c072);CmListEvents['on'](_0xe74dec,_0x390221);}}; \ No newline at end of file +var _0x4551=['length','cmList:','save','remove','update','emit','removeListener','register'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x4551,0x1a2));var _0x1455=function(_0x51a09f,_0x333271){_0x51a09f=_0x51a09f-0x0;var _0x38df4f=_0x4551[_0x51a09f];return _0x38df4f;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x1455('0x0'),_0x1455('0x1'),_0x1455('0x2')];function createListener(_0x29966,_0x4fa192){return function(_0x3bdd8d){_0x4fa192[_0x1455('0x3')](_0x29966,_0x3bdd8d);};}function removeListener(_0x2c5b97,_0x22d36c){return function(){CmListEvents[_0x1455('0x4')](_0x2c5b97,_0x22d36c);};}exports[_0x1455('0x5')]=function(_0x5077bc){for(var _0x2f030f=0x0,_0x1c9835=events[_0x1455('0x6')];_0x2f030f<_0x1c9835;_0x2f030f++){var _0x173594=events[_0x2f030f];var _0x4f4616=createListener(_0x1455('0x7')+_0x173594,_0x5077bc);CmListEvents['on'](_0x173594,_0x4f4616);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index c3e7223..cf32caa 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 _0x518b=['addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','/global_fields','getGlobalCustomFields','/:id','show','getContacts','/:id/contacts/csv','/:id/users','getAgents','post','/:id/dispositions'];(function(_0x211c7b,_0x1c03ee){var _0x57b12=function(_0x284c5e){while(--_0x284c5e){_0x211c7b['push'](_0x211c7b['shift']());}};_0x57b12(++_0x1c03ee);}(_0x518b,0x6e));var _0xb518=function(_0x29b634,_0x369836){_0x29b634=_0x29b634-0x0;var _0x4c1074=_0x518b[_0x29b634];return _0x4c1074;};'use strict';var multer=require(_0xb518('0x0'));var util=require(_0xb518('0x1'));var path=require(_0xb518('0x2'));var timeout=require(_0xb518('0x3'));var express=require('express');var router=express[_0xb518('0x4')]();var fs_extra=require(_0xb518('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb518('0x6'));var config=require('../../config/environment');var controller=require(_0xb518('0x7'));router[_0xb518('0x8')]('/',auth['isAuthenticated'](),controller[_0xb518('0x9')]);router['get'](_0xb518('0xa'),auth[_0xb518('0xb')](),controller['describe']);router[_0xb518('0x8')](_0xb518('0xc'),auth[_0xb518('0xb')](),controller[_0xb518('0xd')]);router[_0xb518('0x8')](_0xb518('0xe'),auth[_0xb518('0xb')](),controller[_0xb518('0xf')]);router[_0xb518('0x8')]('/:id/dispositions',auth[_0xb518('0xb')](),controller['getDispositions']);router[_0xb518('0x8')]('/:id/contacts',auth[_0xb518('0xb')](),controller[_0xb518('0x10')]);router[_0xb518('0x8')](_0xb518('0x11'),auth[_0xb518('0xb')](),controller['getContactsCsv']);router[_0xb518('0x8')]('/:id/fields',auth[_0xb518('0xb')](),controller['getCustomFields']);router[_0xb518('0x8')](_0xb518('0x12'),auth[_0xb518('0xb')](),controller[_0xb518('0x13')]);router[_0xb518('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb518('0x14')](_0xb518('0x15'),auth[_0xb518('0xb')](),controller[_0xb518('0x16')]);router[_0xb518('0x14')](_0xb518('0x17'),auth['isAuthenticated'](),controller[_0xb518('0x18')]);router[_0xb518('0x14')]('/:id/fields',auth[_0xb518('0xb')](),controller[_0xb518('0x19')]);router[_0xb518('0x14')](_0xb518('0x12'),auth[_0xb518('0xb')](),controller[_0xb518('0x1a')]);router[_0xb518('0x1b')](_0xb518('0xe'),auth[_0xb518('0xb')](),controller['update']);router[_0xb518('0x1c')](_0xb518('0xe'),auth[_0xb518('0xb')](),controller[_0xb518('0x1d')]);router['delete']('/:id/dispositions',auth[_0xb518('0xb')](),controller[_0xb518('0x1e')]);router[_0xb518('0x1c')](_0xb518('0x12'),auth['isAuthenticated'](),controller[_0xb518('0x1f')]);module[_0xb518('0x20')]=router; \ No newline at end of file +var _0x073c=['/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','create','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','/:id','show','/:id/dispositions','getDispositions'];(function(_0x115f84,_0x414879){var _0x2467df=function(_0x177ab2){while(--_0x177ab2){_0x115f84['push'](_0x115f84['shift']());}};_0x2467df(++_0x414879);}(_0x073c,0x118));var _0xc073=function(_0x4549ee,_0x2d3817){_0x4549ee=_0x4549ee-0x0;var _0x18a540=_0x073c[_0x4549ee];return _0x18a540;};'use strict';var multer=require('multer');var util=require(_0xc073('0x0'));var path=require(_0xc073('0x1'));var timeout=require(_0xc073('0x2'));var express=require(_0xc073('0x3'));var router=express[_0xc073('0x4')]();var fs_extra=require(_0xc073('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc073('0x6'));var config=require('../../config/environment');var controller=require(_0xc073('0x7'));router[_0xc073('0x8')]('/',auth[_0xc073('0x9')](),controller[_0xc073('0xa')]);router[_0xc073('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc073('0xb')]);router['get'](_0xc073('0xc'),auth[_0xc073('0x9')](),controller['getGlobalCustomFields']);router[_0xc073('0x8')](_0xc073('0xd'),auth[_0xc073('0x9')](),controller[_0xc073('0xe')]);router['get'](_0xc073('0xf'),auth[_0xc073('0x9')](),controller[_0xc073('0x10')]);router[_0xc073('0x8')](_0xc073('0x11'),auth[_0xc073('0x9')](),controller[_0xc073('0x12')]);router['get'](_0xc073('0x13'),auth[_0xc073('0x9')](),controller[_0xc073('0x14')]);router[_0xc073('0x8')](_0xc073('0x15'),auth[_0xc073('0x9')](),controller[_0xc073('0x16')]);router[_0xc073('0x8')](_0xc073('0x17'),auth[_0xc073('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xc073('0x18')]);router[_0xc073('0x19')](_0xc073('0xf'),auth['isAuthenticated'](),controller[_0xc073('0x1a')]);router['post']('/:id/contacts',auth[_0xc073('0x9')](),controller[_0xc073('0x1b')]);router[_0xc073('0x19')](_0xc073('0x15'),auth[_0xc073('0x9')](),controller[_0xc073('0x1c')]);router['post'](_0xc073('0x17'),auth[_0xc073('0x9')](),controller[_0xc073('0x1d')]);router[_0xc073('0x1e')](_0xc073('0xd'),auth[_0xc073('0x9')](),controller[_0xc073('0x1f')]);router[_0xc073('0x20')](_0xc073('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc073('0x20')](_0xc073('0xf'),auth[_0xc073('0x9')](),controller['removeDispositions']);router['delete'](_0xc073('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 5deaf5a..1e9cb5d 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 _0xbde9=['STRING','VIRTUAL','getDataValue'];(function(_0x43e46e,_0x5f2c9d){var _0x3e10e3=function(_0x51bd55){while(--_0x51bd55){_0x43e46e['push'](_0x43e46e['shift']());}};_0x3e10e3(++_0x5f2c9d);}(_0xbde9,0x1a8));var _0x9bde=function(_0x3f06ae,_0x58a01f){_0x3f06ae=_0x3f06ae-0x0;var _0x5e2808=_0xbde9[_0x3f06ae];return _0x5e2808;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9bde('0x0')],'get':function(_0x326bcc){return this[_0x9bde('0x1')]('field');}},'field':{'type':Sequelize[_0x9bde('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x9bde('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9bde('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xca6e=['VIRTUAL','getDataValue','field','STRING','sequelize','exports'];(function(_0x243fd3,_0x25e8d3){var _0x1575b7=function(_0x44d893){while(--_0x44d893){_0x243fd3['push'](_0x243fd3['shift']());}};_0x1575b7(++_0x25e8d3);}(_0xca6e,0x166));var _0xeca6=function(_0x39bf30,_0x165a71){_0x39bf30=_0x39bf30-0x0;var _0x3268d0=_0xca6e[_0x39bf30];return _0x3268d0;};'use strict';var Sequelize=require(_0xeca6('0x0'));module[_0xeca6('0x1')]={'name':{'type':Sequelize[_0xeca6('0x2')],'get':function(_0x33a58a){return this[_0xeca6('0x3')](_0xeca6('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xeca6('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xeca6('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index af5ff38..92c0543 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(_0x59caef,_0x175d22){var _0x2044d6=function(_0x144859){while(--_0x144859){_0x59caef['push'](_0x59caef['shift']());}};_0x2044d6(++_0x175d22);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x2cd6b7,_0x45a398){var _0x30fc99=function(_0x156b06){while(--_0x156b06){_0x2cd6b7['push'](_0x2cd6b7['shift']());}};_0x30fc99(++_0x45a398);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 b2664b9..e5812b0 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 _0xa537=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa537,0x1c9));var _0x7a53=function(_0x2eccc2,_0x458210){_0x2eccc2=_0x2eccc2-0x0;var _0x3ecd1f=_0xa537[_0x2eccc2];return _0x3ecd1f;};'use strict';var _=require(_0x7a53('0x0'));var util=require(_0x7a53('0x1'));var logger=require(_0x7a53('0x2'))(_0x7a53('0x3'));var moment=require(_0x7a53('0x4'));var BPromise=require(_0x7a53('0x5'));var rp=require(_0x7a53('0x6'));var fs=require('fs');var path=require(_0x7a53('0x7'));var rimraf=require(_0x7a53('0x8'));var config=require(_0x7a53('0x9'));var attributes=require(_0x7a53('0xa'));module[_0x7a53('0xb')]=function(_0x3654b5,_0x3c4f9d){return _0x3654b5[_0x7a53('0xc')](_0x7a53('0xd'),attributes,{'tableName':_0x7a53('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e33=['api','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x5be092,_0x150a2e){var _0x114300=function(_0x5d7465){while(--_0x5d7465){_0x5be092['push'](_0x5be092['shift']());}};_0x114300(++_0x150a2e);}(_0x8e33,0xcf));var _0x38e3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x8e33[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x38e3('0x0'));var util=require(_0x38e3('0x1'));var logger=require(_0x38e3('0x2'))(_0x38e3('0x3'));var moment=require(_0x38e3('0x4'));var BPromise=require(_0x38e3('0x5'));var rp=require(_0x38e3('0x6'));var fs=require('fs');var path=require(_0x38e3('0x7'));var rimraf=require(_0x38e3('0x8'));var config=require('../../config/environment');var attributes=require(_0x38e3('0x9'));module[_0x38e3('0xa')]=function(_0x3d02a8,_0x4ff946){return _0x3d02a8[_0x38e3('0xb')](_0x38e3('0xc'),attributes,{'tableName':_0x38e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index ea35e30..61cfb1b 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 _0xdcb6=['client','http','request','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Condition,\x20%s,\x20%s','message','info','catch','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x118305,_0x1f0f7e){var _0x4f2e28=function(_0xbaff78){while(--_0xbaff78){_0x118305['push'](_0x118305['shift']());}};_0x4f2e28(++_0x1f0f7e);}(_0xdcb6,0x1a3));var _0x6dcb=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xdcb6[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require(_0x6dcb('0x0'));var moment=require('moment');var BPromise=require(_0x6dcb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6dcb('0x2'));var logger=require(_0x6dcb('0x3'))(_0x6dcb('0x4'));var config=require(_0x6dcb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6dcb('0x6')][_0x6dcb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d25d2,_0x4c674f,_0x13f9f9){return new BPromise(function(_0x4b3de7,_0x101bf1){return client[_0x6dcb('0x8')](_0x3d25d2,_0x13f9f9)['then'](function(_0x4375b5){logger['info']('Condition,\x20%s,\x20%s',_0x4c674f,'request\x20sent');logger['debug'](_0x6dcb('0x9'),_0x4c674f,_0x6dcb('0xa'),JSON['stringify'](_0x4375b5));if(_0x4375b5[_0x6dcb('0xb')]){if(_0x4375b5[_0x6dcb('0xb')][_0x6dcb('0xc')]===0x1f4){logger['error'](_0x6dcb('0xd'),_0x4c674f,_0x4375b5[_0x6dcb('0xb')][_0x6dcb('0xe')]);return _0x101bf1(_0x4375b5[_0x6dcb('0xb')][_0x6dcb('0xe')]);}logger[_0x6dcb('0xb')](_0x6dcb('0xd'),_0x4c674f,_0x4375b5[_0x6dcb('0xb')][_0x6dcb('0xe')]);return _0x4b3de7(_0x4375b5[_0x6dcb('0xb')]['message']);}else{logger[_0x6dcb('0xf')]('Condition,\x20%s,\x20%s',_0x4c674f,'request\x20sent');_0x4b3de7(_0x4375b5['result']['message']);}})[_0x6dcb('0x10')](function(_0x428445){logger['error']('Condition,\x20%s,\x20%s',_0x4c674f,_0x428445);_0x101bf1(_0x428445);});});} \ No newline at end of file +var _0x403e=['debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x44a573,_0x1e6efc){var _0x4babc6=function(_0x5495aa){while(--_0x5495aa){_0x44a573['push'](_0x44a573['shift']());}};_0x4babc6(++_0x1e6efc);}(_0x403e,0xa7));var _0xe403=function(_0x2906dd,_0xd7dc72){_0x2906dd=_0x2906dd-0x0;var _0xe9e2f0=_0x403e[_0x2906dd];return _0xe9e2f0;};'use strict';var _=require(_0xe403('0x0'));var util=require(_0xe403('0x1'));var moment=require(_0xe403('0x2'));var BPromise=require(_0xe403('0x3'));var rs=require(_0xe403('0x4'));var fs=require('fs');var Redis=require(_0xe403('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe403('0x6'));var logger=require(_0xe403('0x7'))(_0xe403('0x8'));var config=require(_0xe403('0x9'));var jayson=require(_0xe403('0xa'));var client=jayson[_0xe403('0xb')][_0xe403('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x261f8f,_0x117bc9,_0x4cbb69){return new BPromise(function(_0x4ee264,_0x14d79d){return client['request'](_0x261f8f,_0x4cbb69)[_0xe403('0xd')](function(_0x4105dc){logger[_0xe403('0xe')](_0xe403('0xf'),_0x117bc9,_0xe403('0x10'));logger[_0xe403('0x11')](_0xe403('0x12'),_0x117bc9,_0xe403('0x10'),JSON[_0xe403('0x13')](_0x4105dc));if(_0x4105dc[_0xe403('0x14')]){if(_0x4105dc[_0xe403('0x14')]['code']===0x1f4){logger[_0xe403('0x14')]('Condition,\x20%s,\x20%s',_0x117bc9,_0x4105dc['error'][_0xe403('0x15')]);return _0x14d79d(_0x4105dc[_0xe403('0x14')][_0xe403('0x15')]);}logger[_0xe403('0x14')](_0xe403('0xf'),_0x117bc9,_0x4105dc['error'][_0xe403('0x15')]);return _0x4ee264(_0x4105dc[_0xe403('0x14')][_0xe403('0x15')]);}else{logger[_0xe403('0xe')](_0xe403('0xf'),_0x117bc9,'request\x20sent');_0x4ee264(_0x4105dc[_0xe403('0x16')]['message']);}})['catch'](function(_0x3debd6){logger['error'](_0xe403('0xf'),_0x117bc9,_0x3debd6);_0x14d79d(_0x3debd6);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index cf3f6ae..7c2d304 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 _0x514f=['/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./condition.controller','put'];(function(_0x24cbbb,_0x28db37){var _0x123f2f=function(_0x11735a){while(--_0x11735a){_0x24cbbb['push'](_0x24cbbb['shift']());}};_0x123f2f(++_0x28db37);}(_0x514f,0x64));var _0xf514=function(_0x39e591,_0x410f2c){_0x39e591=_0x39e591-0x0;var _0x28312e=_0x514f[_0x39e591];return _0x28312e;};'use strict';var multer=require(_0xf514('0x0'));var util=require(_0xf514('0x1'));var path=require(_0xf514('0x2'));var timeout=require(_0xf514('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf514('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf514('0x5'));var config=require('../../config/environment');var controller=require(_0xf514('0x6'));router[_0xf514('0x7')](_0xf514('0x8'),auth[_0xf514('0x9')](),controller[_0xf514('0xa')]);router['delete'](_0xf514('0x8'),auth[_0xf514('0x9')](),controller['destroy']);module[_0xf514('0xb')]=router; \ No newline at end of file +var _0x5ce5=['./condition.controller','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xa8dcea,_0x1315c4){var _0x1f381f=function(_0x381e29){while(--_0x381e29){_0xa8dcea['push'](_0xa8dcea['shift']());}};_0x1f381f(++_0x1315c4);}(_0x5ce5,0xa0));var _0x55ce=function(_0x54f6f7,_0x192530){_0x54f6f7=_0x54f6f7-0x0;var _0x264e49=_0x5ce5[_0x54f6f7];return _0x264e49;};'use strict';var multer=require(_0x55ce('0x0'));var util=require(_0x55ce('0x1'));var path=require(_0x55ce('0x2'));var timeout=require(_0x55ce('0x3'));var express=require(_0x55ce('0x4'));var router=express[_0x55ce('0x5')]();var fs_extra=require(_0x55ce('0x6'));var auth=require(_0x55ce('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x55ce('0x8'));router['put'](_0x55ce('0x9'),auth[_0x55ce('0xa')](),controller[_0x55ce('0xb')]);router['delete'](_0x55ce('0x9'),auth[_0x55ce('0xa')](),controller[_0x55ce('0xc')]);module[_0x55ce('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 3dcdc46..0c3175e 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 _0xa25d=['exports','STRING','name','INTEGER','sequelize'];(function(_0x191c7a,_0x5191cd){var _0x2efed2=function(_0x4f9a58){while(--_0x4f9a58){_0x191c7a['push'](_0x191c7a['shift']());}};_0x2efed2(++_0x5191cd);}(_0xa25d,0x194));var _0xda25=function(_0x2eb898,_0x43c47b){_0x2eb898=_0x2eb898-0x0;var _0x58974f=_0xa25d[_0x2eb898];return _0x58974f;};'use strict';var Sequelize=require(_0xda25('0x0'));module[_0xda25('0x1')]={'name':{'type':Sequelize[_0xda25('0x2')],'allowNull':![],'unique':_0xda25('0x3')},'OrderBy':{'type':Sequelize[_0xda25('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xda25('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8dd5=['STRING','INTEGER','sequelize','exports'];(function(_0x501f3d,_0x236061){var _0x1431ef=function(_0x4c3580){while(--_0x4c3580){_0x501f3d['push'](_0x501f3d['shift']());}};_0x1431ef(++_0x236061);}(_0x8dd5,0x196));var _0x58dd=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x8dd5[_0x4d82ea];return _0x257f4a;};'use strict';var Sequelize=require(_0x58dd('0x0'));module[_0x58dd('0x1')]={'name':{'type':Sequelize[_0x58dd('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x58dd('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x58dd('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 1c768d1..9b4a36f 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 _0x3266=['options','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','get','error','stack','name','send','index','ContactItemType','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2644dd,_0x39d79e){var _0x4dad81=function(_0x4acbef){while(--_0x4acbef){_0x2644dd['push'](_0x2644dd['shift']());}};_0x4dad81(++_0x39d79e);}(_0x3266,0x6a));var _0x6326=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x3266[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){var _0x72d020=_0x2d0d00[_0x6326('0x27')]({'plain':!![]});var _0x575701='ContactItemTypes';return db['UserProfileResource'][_0x6326('0x26')]({'where':{'type':_0x575701,'resourceId':_0x72d020['id']}})['then'](function(){return _0x2d0d00;});})[_0x6326('0x25')](function(){_0x429bb0[_0x6326('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e33d,_0x21ec69){return function(_0xb68fec){if(!_0xb68fec){_0x15e33d[_0x6326('0x1c')](0x194);}return _0xb68fec;};}function handleError(_0x2d2180,_0x45d037){_0x45d037=_0x45d037||0x1f4;return function(_0x40e036){logger[_0x6326('0x28')](_0x40e036[_0x6326('0x29')]);if(_0x40e036[_0x6326('0x2a')]){delete _0x40e036[_0x6326('0x2a')];}_0x2d2180[_0x6326('0x1d')](_0x45d037)[_0x6326('0x2b')](_0x40e036);};}exports[_0x6326('0x2c')]=function(_0x2e0445,_0x20c5ab){var _0x520e57={},_0x2bf5ef={},_0x47303c={'count':0x0,'rows':[]};var _0x1f8982=_['map'](db[_0x6326('0x2d')]['rawAttributes'],function(_0x4e703a){return{'name':_0x4e703a[_0x6326('0x2e')],'type':_0x4e703a[_0x6326('0x2f')][_0x6326('0x30')]};});_0x2bf5ef[_0x6326('0x31')]=_[_0x6326('0x32')](_0x1f8982,_0x6326('0x2a'));_0x2bf5ef[_0x6326('0x33')]=_[_0x6326('0x34')](_0x2e0445[_0x6326('0x33')]);_0x2bf5ef[_0x6326('0x35')]=_[_0x6326('0x36')](_0x2bf5ef[_0x6326('0x31')],_0x2bf5ef['query']);_0x520e57[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2bf5ef['model'],qs[_0x6326('0x38')](_0x2e0445[_0x6326('0x33')][_0x6326('0x38')]));_0x520e57['attributes']=_0x520e57[_0x6326('0x37')]['length']?_0x520e57['attributes']:_0x2bf5ef[_0x6326('0x31')];if(!_0x2e0445[_0x6326('0x33')][_0x6326('0x39')]('nolimit')){_0x520e57[_0x6326('0x3a')]=qs['limit'](_0x2e0445[_0x6326('0x33')]['limit']);_0x520e57[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x2e0445[_0x6326('0x33')][_0x6326('0x1f')]);}_0x520e57[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x2e0445['query'][_0x6326('0x3c')]);_0x520e57[_0x6326('0x3d')]=qs['filters'](_[_0x6326('0x3e')](_0x2e0445['query'],_0x2bf5ef['filters']),_0x1f8982);if(_0x2e0445[_0x6326('0x33')][_0x6326('0x3f')]){_0x520e57[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x520e57[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x1f8982,function(_0x5de1c3){if(_0x5de1c3['type']!==_0x6326('0x41')){var _0x5b68af={};_0x5b68af[_0x5de1c3[_0x6326('0x2a')]]={'$like':'%'+_0x2e0445['query'][_0x6326('0x3f')]+'%'};return _0x5b68af;}})});}_0x520e57=_[_0x6326('0x40')]({},_0x520e57,_0x2e0445[_0x6326('0x42')]);var _0x1da798={'where':_0x520e57[_0x6326('0x3d')]};return db[_0x6326('0x2d')][_0x6326('0x20')](_0x1da798)[_0x6326('0x25')](function(_0x3b089b){_0x47303c[_0x6326('0x20')]=_0x3b089b;if(_0x2e0445[_0x6326('0x33')]['includeAll']){_0x520e57[_0x6326('0x43')]=[{'all':!![]}];}return db['ContactItemType'][_0x6326('0x44')](_0x520e57);})[_0x6326('0x25')](function(_0x16fc33){_0x47303c[_0x6326('0x45')]=_0x16fc33;return _0x47303c;})['then'](respondWithFilteredResult(_0x20c5ab,_0x520e57))[_0x6326('0x46')](handleError(_0x20c5ab,null));};exports[_0x6326('0x47')]=function(_0x562d5f,_0x12703d){var _0xe6a992={'raw':!![],'where':{'id':_0x562d5f[_0x6326('0x48')]['id']}},_0x7a5057={};_0x7a5057['model']=_[_0x6326('0x34')](db[_0x6326('0x2d')][_0x6326('0x49')]);_0x7a5057[_0x6326('0x33')]=_[_0x6326('0x34')](_0x562d5f[_0x6326('0x33')]);_0x7a5057[_0x6326('0x35')]=_['intersection'](_0x7a5057[_0x6326('0x31')],_0x7a5057[_0x6326('0x33')]);_0xe6a992[_0x6326('0x37')]=_[_0x6326('0x36')](_0x7a5057['model'],qs[_0x6326('0x38')](_0x562d5f['query'][_0x6326('0x38')]));_0xe6a992[_0x6326('0x37')]=_0xe6a992[_0x6326('0x37')][_0x6326('0x4a')]?_0xe6a992[_0x6326('0x37')]:_0x7a5057['model'];if(_0x562d5f[_0x6326('0x33')]['includeAll']){_0xe6a992['include']=[{'all':!![]}];}_0xe6a992=_[_0x6326('0x40')]({},_0xe6a992,_0x562d5f[_0x6326('0x42')]);return db['ContactItemType'][_0x6326('0x4b')](_0xe6a992)[_0x6326('0x25')](handleEntityNotFound(_0x12703d,null))[_0x6326('0x25')](respondWithResult(_0x12703d,null))[_0x6326('0x46')](handleError(_0x12703d,null));};exports[_0x6326('0x4c')]=function(_0x4f8dc0,_0x4af0ee){return db[_0x6326('0x2d')][_0x6326('0x4c')](_0x4f8dc0[_0x6326('0x4d')],{})[_0x6326('0x25')](function(_0x210a1b){var _0x318d19=_0x4f8dc0[_0x6326('0x4e')]['get']({'plain':!![]});if(!_0x318d19)throw new Error(_0x6326('0x4f'));if(_0x318d19[_0x6326('0x50')]===_0x6326('0x4e')){var _0x3e7674=_0x210a1b[_0x6326('0x27')]({'plain':!![]});var _0x4ff8e6=_0x6326('0x51');return db['UserProfileSection'][_0x6326('0x4b')]({'where':{'name':_0x4ff8e6,'userProfileId':_0x318d19[_0x6326('0x52')]},'raw':!![]})['then'](function(_0x37b045){if(_0x37b045&&_0x37b045['autoAssociation']===0x0){return db[_0x6326('0x53')][_0x6326('0x4c')]({'name':_0x3e7674[_0x6326('0x2a')],'resourceId':_0x3e7674['id'],'type':_0x37b045[_0x6326('0x2a')],'sectionId':_0x37b045['id']},{})['then'](function(){return _0x210a1b;});}else{return _0x210a1b;}})[_0x6326('0x46')](function(_0xbe6b3e){logger['error'](_0x6326('0x54'),_0xbe6b3e);throw _0xbe6b3e;});}return _0x210a1b;})[_0x6326('0x25')](respondWithResult(_0x4af0ee,0xc9))[_0x6326('0x46')](handleError(_0x4af0ee,null));};exports['update']=function(_0x2bece1,_0x2ac64b){if(_0x2bece1['body']['id']){delete _0x2bece1[_0x6326('0x4d')]['id'];}return db['ContactItemType'][_0x6326('0x4b')]({'where':{'id':_0x2bece1[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x2ac64b,null))[_0x6326('0x25')](saveUpdates(_0x2bece1[_0x6326('0x4d')],null))[_0x6326('0x25')](respondWithResult(_0x2ac64b,null))[_0x6326('0x46')](handleError(_0x2ac64b,null));};exports['destroy']=function(_0x51adce,_0x4d4de7){return db[_0x6326('0x2d')]['find']({'where':{'id':_0x51adce[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4d4de7,null))[_0x6326('0x25')](db[_0x6326('0x55')][_0x6326('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x51adce['params']['id']}}))[_0x6326('0x25')](removeEntity(_0x4d4de7,null))[_0x6326('0x46')](handleError(_0x4d4de7,null));}; \ No newline at end of file +var _0x4b17=['sort','pick','filters','filter','where','merge','options','ContactItemType','include','findAll','rows','show','length','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','params','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query'];(function(_0x3239f5,_0x50e77c){var _0x3559c8=function(_0x4f9f83){while(--_0x4f9f83){_0x3239f5['push'](_0x3239f5['shift']());}};_0x3559c8(++_0x50e77c);}(_0x4b17,0x10f));var _0x74b1=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x4b17[_0x4a8bad];return _0x30cf32;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];function respondWithStatusCode(_0x5cfe85,_0x5f2865){_0x5f2865=_0x5f2865||0xcc;return function(_0x239d04){if(_0x239d04){return _0x5cfe85[_0x74b1('0x17')](_0x5f2865);}return _0x5cfe85['status'](_0x5f2865)['end']();};}function respondWithResult(_0x500ce2,_0x86390){_0x86390=_0x86390||0xc8;return function(_0x5c12eb){if(_0x5c12eb){return _0x500ce2['status'](_0x86390)[_0x74b1('0x18')](_0x5c12eb);}};}function respondWithFilteredResult(_0x12a2c0,_0x3779c5){return function(_0x420662){if(_0x420662){var _0x16b147=typeof _0x3779c5[_0x74b1('0x19')]==='undefined'&&typeof _0x3779c5[_0x74b1('0x1a')]===_0x74b1('0x1b');var _0x1a0851=_0x420662[_0x74b1('0x1c')];var _0xde2736=_0x16b147?0x0:_0x3779c5[_0x74b1('0x19')];var _0x1ab838=_0x16b147?_0x420662['count']:_0x3779c5[_0x74b1('0x19')]+_0x3779c5[_0x74b1('0x1a')];var _0x524ece;if(_0x1ab838>=_0x1a0851){_0x1ab838=_0x1a0851;_0x524ece=0xc8;}else{_0x524ece=0xce;}_0x12a2c0[_0x74b1('0x1d')](_0x524ece);return _0x12a2c0[_0x74b1('0x1e')](_0x74b1('0x1f'),_0xde2736+'-'+_0x1ab838+'/'+_0x1a0851)[_0x74b1('0x18')](_0x420662);}return null;};}function patchUpdates(_0x13bb44){return function(_0x33fee9){try{jsonpatch[_0x74b1('0x20')](_0x33fee9,_0x13bb44,!![]);}catch(_0xaac5f7){return BPromise['reject'](_0xaac5f7);}return _0x33fee9[_0x74b1('0x21')]();};}function saveUpdates(_0x4f1ec9,_0x5da0f7){return function(_0x481bf2){if(_0x481bf2){return _0x481bf2[_0x74b1('0x22')](_0x4f1ec9)[_0x74b1('0x23')](function(_0x405a22){return _0x405a22;});}return null;};}function removeEntity(_0x44bf7e,_0x563781){return function(_0x4ee88b){if(_0x4ee88b){return _0x4ee88b[_0x74b1('0x24')]()['then'](function(){var _0x3a7ef9=_0x4ee88b[_0x74b1('0x25')]({'plain':!![]});var _0xb5af0=_0x74b1('0x26');return db[_0x74b1('0x27')][_0x74b1('0x24')]({'where':{'type':_0xb5af0,'resourceId':_0x3a7ef9['id']}})[_0x74b1('0x23')](function(){return _0x4ee88b;});})[_0x74b1('0x23')](function(){_0x44bf7e['status'](0xcc)[_0x74b1('0x28')]();});}};}function handleEntityNotFound(_0x42b69d,_0x4099af){return function(_0x5c32d2){if(!_0x5c32d2){_0x42b69d[_0x74b1('0x17')](0x194);}return _0x5c32d2;};}function handleError(_0x351392,_0x94b1f8){_0x94b1f8=_0x94b1f8||0x1f4;return function(_0x1b011a){logger[_0x74b1('0x29')](_0x1b011a[_0x74b1('0x2a')]);if(_0x1b011a[_0x74b1('0x2b')]){delete _0x1b011a[_0x74b1('0x2b')];}_0x351392['status'](_0x94b1f8)[_0x74b1('0x2c')](_0x1b011a);};}exports[_0x74b1('0x2d')]=function(_0x51ce6d,_0x543b5){var _0x45404f={},_0x1ac433={},_0x5f4d1b={'count':0x0,'rows':[]};var _0x113300=_[_0x74b1('0x2e')](db['ContactItemType'][_0x74b1('0x2f')],function(_0x33ec7c){return{'name':_0x33ec7c[_0x74b1('0x30')],'type':_0x33ec7c[_0x74b1('0x31')][_0x74b1('0x32')]};});_0x1ac433[_0x74b1('0x33')]=_[_0x74b1('0x2e')](_0x113300,_0x74b1('0x2b'));_0x1ac433['query']=_[_0x74b1('0x34')](_0x51ce6d['query']);_0x1ac433['filters']=_[_0x74b1('0x35')](_0x1ac433['model'],_0x1ac433['query']);_0x45404f[_0x74b1('0x36')]=_[_0x74b1('0x35')](_0x1ac433[_0x74b1('0x33')],qs[_0x74b1('0x37')](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x37')]));_0x45404f[_0x74b1('0x36')]=_0x45404f[_0x74b1('0x36')]['length']?_0x45404f['attributes']:_0x1ac433['model'];if(!_0x51ce6d[_0x74b1('0x38')]['hasOwnProperty']('nolimit')){_0x45404f[_0x74b1('0x1a')]=qs[_0x74b1('0x1a')](_0x51ce6d[_0x74b1('0x38')]['limit']);_0x45404f[_0x74b1('0x19')]=qs['offset'](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x19')]);}_0x45404f['order']=qs['sort'](_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x39')]);_0x45404f['where']=qs['filters'](_[_0x74b1('0x3a')](_0x51ce6d['query'],_0x1ac433[_0x74b1('0x3b')]),_0x113300);if(_0x51ce6d[_0x74b1('0x38')][_0x74b1('0x3c')]){_0x45404f[_0x74b1('0x3d')]=_[_0x74b1('0x3e')](_0x45404f['where'],{'$or':_[_0x74b1('0x2e')](_0x113300,function(_0x5a981b){if(_0x5a981b[_0x74b1('0x31')]!=='VIRTUAL'){var _0x23cac2={};_0x23cac2[_0x5a981b['name']]={'$like':'%'+_0x51ce6d['query'][_0x74b1('0x3c')]+'%'};return _0x23cac2;}})});}_0x45404f=_[_0x74b1('0x3e')]({},_0x45404f,_0x51ce6d[_0x74b1('0x3f')]);var _0x49f7da={'where':_0x45404f[_0x74b1('0x3d')]};return db[_0x74b1('0x40')][_0x74b1('0x1c')](_0x49f7da)['then'](function(_0xfecdc){_0x5f4d1b[_0x74b1('0x1c')]=_0xfecdc;if(_0x51ce6d['query']['includeAll']){_0x45404f[_0x74b1('0x41')]=[{'all':!![]}];}return db[_0x74b1('0x40')][_0x74b1('0x42')](_0x45404f);})[_0x74b1('0x23')](function(_0x1d9f5b){_0x5f4d1b[_0x74b1('0x43')]=_0x1d9f5b;return _0x5f4d1b;})[_0x74b1('0x23')](respondWithFilteredResult(_0x543b5,_0x45404f))['catch'](handleError(_0x543b5,null));};exports[_0x74b1('0x44')]=function(_0x118623,_0x456c6e){var _0x452fa0={'raw':!![],'where':{'id':_0x118623['params']['id']}},_0x17a44f={};_0x17a44f[_0x74b1('0x33')]=_[_0x74b1('0x34')](db['ContactItemType']['rawAttributes']);_0x17a44f[_0x74b1('0x38')]=_[_0x74b1('0x34')](_0x118623['query']);_0x17a44f[_0x74b1('0x3b')]=_[_0x74b1('0x35')](_0x17a44f[_0x74b1('0x33')],_0x17a44f[_0x74b1('0x38')]);_0x452fa0[_0x74b1('0x36')]=_[_0x74b1('0x35')](_0x17a44f[_0x74b1('0x33')],qs['fields'](_0x118623['query']['fields']));_0x452fa0[_0x74b1('0x36')]=_0x452fa0[_0x74b1('0x36')][_0x74b1('0x45')]?_0x452fa0[_0x74b1('0x36')]:_0x17a44f[_0x74b1('0x33')];if(_0x118623['query'][_0x74b1('0x46')]){_0x452fa0[_0x74b1('0x41')]=[{'all':!![]}];}_0x452fa0=_[_0x74b1('0x3e')]({},_0x452fa0,_0x118623[_0x74b1('0x3f')]);return db[_0x74b1('0x40')][_0x74b1('0x47')](_0x452fa0)[_0x74b1('0x23')](handleEntityNotFound(_0x456c6e,null))[_0x74b1('0x23')](respondWithResult(_0x456c6e,null))[_0x74b1('0x48')](handleError(_0x456c6e,null));};exports[_0x74b1('0x49')]=function(_0x186516,_0x3038f9){return db['ContactItemType'][_0x74b1('0x49')](_0x186516[_0x74b1('0x4a')],{})['then'](function(_0xf3735e){var _0x4923d2=_0x186516[_0x74b1('0x4b')][_0x74b1('0x25')]({'plain':!![]});if(!_0x4923d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4923d2[_0x74b1('0x4c')]===_0x74b1('0x4b')){var _0x326b98=_0xf3735e['get']({'plain':!![]});var _0x497006=_0x74b1('0x26');return db[_0x74b1('0x4d')][_0x74b1('0x47')]({'where':{'name':_0x497006,'userProfileId':_0x4923d2[_0x74b1('0x4e')]},'raw':!![]})['then'](function(_0x1e7507){if(_0x1e7507&&_0x1e7507['autoAssociation']===0x0){return db[_0x74b1('0x27')][_0x74b1('0x49')]({'name':_0x326b98['name'],'resourceId':_0x326b98['id'],'type':_0x1e7507[_0x74b1('0x2b')],'sectionId':_0x1e7507['id']},{})[_0x74b1('0x23')](function(){return _0xf3735e;});}else{return _0xf3735e;}})[_0x74b1('0x48')](function(_0x54a221){logger[_0x74b1('0x29')](_0x74b1('0x4f'),_0x54a221);throw _0x54a221;});}return _0xf3735e;})['then'](respondWithResult(_0x3038f9,0xc9))[_0x74b1('0x48')](handleError(_0x3038f9,null));};exports['update']=function(_0x4ba250,_0x18cd64){if(_0x4ba250[_0x74b1('0x4a')]['id']){delete _0x4ba250[_0x74b1('0x4a')]['id'];}return db[_0x74b1('0x40')][_0x74b1('0x47')]({'where':{'id':_0x4ba250['params']['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x18cd64,null))[_0x74b1('0x23')](saveUpdates(_0x4ba250['body'],null))[_0x74b1('0x23')](respondWithResult(_0x18cd64,null))[_0x74b1('0x48')](handleError(_0x18cd64,null));};exports[_0x74b1('0x24')]=function(_0x5634d1,_0x2fac5d){return db[_0x74b1('0x40')][_0x74b1('0x47')]({'where':{'id':_0x5634d1['params']['id']}})[_0x74b1('0x23')](handleEntityNotFound(_0x2fac5d,null))[_0x74b1('0x23')](db[_0x74b1('0x50')][_0x74b1('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5634d1[_0x74b1('0x51')]['id']}}))[_0x74b1('0x23')](removeEntity(_0x2fac5d,null))['catch'](handleError(_0x2fac5d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 90021bb..9e917ae 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 _0x7ab8=['exports','ContactItemType','tools_contact_item_types','lodash','../../config/logger','api','moment','request-promise','./contactItemType.attributes'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7ab8,0xdb));var _0x87ab=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7ab8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x87ab('0x0'));var util=require('util');var logger=require(_0x87ab('0x1'))(_0x87ab('0x2'));var moment=require(_0x87ab('0x3'));var BPromise=require('bluebird');var rp=require(_0x87ab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87ab('0x5'));module[_0x87ab('0x6')]=function(_0x398939,_0x58ca95){return _0x398939['define'](_0x87ab('0x7'),attributes,{'tableName':_0x87ab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa88e=['path','rimraf','./contactItemType.attributes','exports','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0xa88e,0x1bd));var _0xea88=function(_0x431dca,_0x4c1359){_0x431dca=_0x431dca-0x0;var _0x40f13d=_0xa88e[_0x431dca];return _0x40f13d;};'use strict';var _=require(_0xea88('0x0'));var util=require('util');var logger=require(_0xea88('0x1'))(_0xea88('0x2'));var moment=require(_0xea88('0x3'));var BPromise=require(_0xea88('0x4'));var rp=require(_0xea88('0x5'));var fs=require('fs');var path=require(_0xea88('0x6'));var rimraf=require(_0xea88('0x7'));var config=require('../../config/environment');var attributes=require(_0xea88('0x8'));module[_0xea88('0x9')]=function(_0xf4416c,_0x35de82){return _0xf4416c['define']('ContactItemType',attributes,{'tableName':_0xea88('0xa'),'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 099454d..fdb34a6 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 _0x8a91=['debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x2fc68e,_0xb2b35a){var _0x3a5870=function(_0x27f126){while(--_0x27f126){_0x2fc68e['push'](_0x2fc68e['shift']());}};_0x3a5870(++_0xb2b35a);}(_0x8a91,0xb7));var _0x18a9=function(_0xf71b79,_0x23f70c){_0xf71b79=_0xf71b79-0x0;var _0x415b27=_0x8a91[_0xf71b79];return _0x415b27;};'use strict';var _=require(_0x18a9('0x0'));var util=require(_0x18a9('0x1'));var moment=require(_0x18a9('0x2'));var BPromise=require(_0x18a9('0x3'));var rs=require(_0x18a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18a9('0x5'))['db'];var utils=require(_0x18a9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x18a9('0x7'));var jayson=require(_0x18a9('0x8'));var client=jayson[_0x18a9('0x9')][_0x18a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x483c3a,_0x36bb1f,_0x47b5fd){return new BPromise(function(_0x423f9f,_0x59e385){return client['request'](_0x483c3a,_0x47b5fd)[_0x18a9('0xb')](function(_0x324d9f){logger[_0x18a9('0xc')](_0x18a9('0xd'),_0x36bb1f,_0x18a9('0xe'));logger[_0x18a9('0xf')](_0x18a9('0x10'),_0x36bb1f,'request\x20sent',JSON['stringify'](_0x324d9f));if(_0x324d9f[_0x18a9('0x11')]){if(_0x324d9f['error'][_0x18a9('0x12')]===0x1f4){logger[_0x18a9('0x11')](_0x18a9('0xd'),_0x36bb1f,_0x324d9f['error']['message']);return _0x59e385(_0x324d9f[_0x18a9('0x11')][_0x18a9('0x13')]);}logger['error'](_0x18a9('0xd'),_0x36bb1f,_0x324d9f[_0x18a9('0x11')][_0x18a9('0x13')]);return _0x423f9f(_0x324d9f['error'][_0x18a9('0x13')]);}else{logger[_0x18a9('0xc')](_0x18a9('0xd'),_0x36bb1f,_0x18a9('0xe'));_0x423f9f(_0x324d9f[_0x18a9('0x14')][_0x18a9('0x13')]);}})[_0x18a9('0x15')](function(_0x4c5d71){logger[_0x18a9('0x11')](_0x18a9('0xd'),_0x36bb1f,_0x4c5d71);_0x59e385(_0x4c5d71);});});} \ No newline at end of file +var _0xab06=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f2b44,_0xb210ed){var _0x3d64fe=function(_0x382d61){while(--_0x382d61){_0x4f2b44['push'](_0x4f2b44['shift']());}};_0x3d64fe(++_0xb210ed);}(_0xab06,0x1e7));var _0x6ab0=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xab06[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x6ab0('0x0'));var moment=require('moment');var BPromise=require(_0x6ab0('0x1'));var rs=require(_0x6ab0('0x2'));var fs=require('fs');var Redis=require(_0x6ab0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ab0('0x4'))(_0x6ab0('0x5'));var config=require(_0x6ab0('0x6'));var jayson=require(_0x6ab0('0x7'));var client=jayson[_0x6ab0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xddfd86,_0x2cd8a2,_0x966c46){return new BPromise(function(_0x1f9514,_0x1fc9d8){return client[_0x6ab0('0x9')](_0xddfd86,_0x966c46)[_0x6ab0('0xa')](function(_0x4ec2db){logger[_0x6ab0('0xb')](_0x6ab0('0xc'),_0x2cd8a2,_0x6ab0('0xd'));logger[_0x6ab0('0xe')](_0x6ab0('0xf'),_0x2cd8a2,'request\x20sent',JSON[_0x6ab0('0x10')](_0x4ec2db));if(_0x4ec2db['error']){if(_0x4ec2db[_0x6ab0('0x11')][_0x6ab0('0x12')]===0x1f4){logger[_0x6ab0('0x11')](_0x6ab0('0xc'),_0x2cd8a2,_0x4ec2db['error'][_0x6ab0('0x13')]);return _0x1fc9d8(_0x4ec2db[_0x6ab0('0x11')][_0x6ab0('0x13')]);}logger[_0x6ab0('0x11')](_0x6ab0('0xc'),_0x2cd8a2,_0x4ec2db['error'][_0x6ab0('0x13')]);return _0x1f9514(_0x4ec2db[_0x6ab0('0x11')][_0x6ab0('0x13')]);}else{logger[_0x6ab0('0xb')](_0x6ab0('0xc'),_0x2cd8a2,'request\x20sent');_0x1f9514(_0x4ec2db[_0x6ab0('0x14')][_0x6ab0('0x13')]);}})[_0x6ab0('0x15')](function(_0x43edb5){logger[_0x6ab0('0x11')](_0x6ab0('0xc'),_0x2cd8a2,_0x43edb5);_0x1fc9d8(_0x43edb5);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index b505a9d..58d303a 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 _0xcb75=['put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5bc306,_0x2b79a2){var _0x2f6fe2=function(_0x512a4d){while(--_0x512a4d){_0x5bc306['push'](_0x5bc306['shift']());}};_0x2f6fe2(++_0x2b79a2);}(_0xcb75,0x122));var _0x5cb7=function(_0x3e1dbd,_0x4bff38){_0x3e1dbd=_0x3e1dbd-0x0;var _0x1a0414=_0xcb75[_0x3e1dbd];return _0x1a0414;};'use strict';var multer=require(_0x5cb7('0x0'));var util=require('util');var path=require(_0x5cb7('0x1'));var timeout=require(_0x5cb7('0x2'));var express=require(_0x5cb7('0x3'));var router=express[_0x5cb7('0x4')]();var fs_extra=require(_0x5cb7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5cb7('0x6'));var config=require(_0x5cb7('0x7'));var controller=require(_0x5cb7('0x8'));router[_0x5cb7('0x9')]('/',auth[_0x5cb7('0xa')](),controller[_0x5cb7('0xb')]);router[_0x5cb7('0x9')](_0x5cb7('0xc'),auth[_0x5cb7('0xa')](),controller[_0x5cb7('0xd')]);router[_0x5cb7('0xe')]('/',auth['isAuthenticated'](),controller[_0x5cb7('0xf')]);router[_0x5cb7('0x10')](_0x5cb7('0xc'),auth[_0x5cb7('0xa')](),controller[_0x5cb7('0x11')]);router['delete'](_0x5cb7('0xc'),auth[_0x5cb7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x05f0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1c74d2,_0x5b1c47){var _0x1187b7=function(_0x5043c7){while(--_0x5043c7){_0x1c74d2['push'](_0x1c74d2['shift']());}};_0x1187b7(++_0x5b1c47);}(_0x05f0,0x165));var _0x005f=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x05f0[_0x38b2d9];return _0x23a3e1;};'use strict';var multer=require(_0x005f('0x0'));var util=require(_0x005f('0x1'));var path=require(_0x005f('0x2'));var timeout=require(_0x005f('0x3'));var express=require(_0x005f('0x4'));var router=express[_0x005f('0x5')]();var fs_extra=require(_0x005f('0x6'));var auth=require(_0x005f('0x7'));var interaction=require(_0x005f('0x8'));var config=require('../../config/environment');var controller=require(_0x005f('0x9'));router[_0x005f('0xa')]('/',auth[_0x005f('0xb')](),controller['index']);router[_0x005f('0xa')](_0x005f('0xc'),auth[_0x005f('0xb')](),controller[_0x005f('0xd')]);router[_0x005f('0xe')]('/',auth[_0x005f('0xb')](),controller[_0x005f('0xf')]);router[_0x005f('0x10')](_0x005f('0xc'),auth['isAuthenticated'](),controller[_0x005f('0x11')]);router[_0x005f('0x12')](_0x005f('0xc'),auth[_0x005f('0xb')](),controller[_0x005f('0x13')]);module[_0x005f('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 56ca0c9..b4ed4f1 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xb7e7[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x141c9c,_0x498319){var _0x3ba4b4=function(_0x185faa){while(--_0x185faa){_0x141c9c['push'](_0x141c9c['shift']());}};_0x3ba4b4(++_0x498319);}(_0x757a,0xde));var _0xa757=function(_0x2e8ed0,_0x88ca87){_0x2e8ed0=_0x2e8ed0-0x0;var _0x24de36=_0x757a[_0x2e8ed0];return _0x24de36;};'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/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 3f3503e..6f9b582 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 _0x6426=['getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','UserProfileResource','end','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','includeAll','include','Dashboard','rows','catch','show','params','options','find','body','user','role','CustomDashboards','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','UserProfileSection','autoAssociation','create','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','addItem','DashboardItem','sort'];(function(_0xeea277,_0x56ce7b){var _0x4a84cb=function(_0x3acad0){while(--_0x3acad0){_0xeea277['push'](_0xeea277['shift']());}};_0x4a84cb(++_0x56ce7b);}(_0x6426,0x16c));var _0x6642=function(_0x281be1,_0x56f638){_0x281be1=_0x281be1-0x0;var _0x7b6fe5=_0x6426[_0x281be1];return _0x7b6fe5;};'use strict';var emlformat=require(_0x6642('0x0'));var rimraf=require(_0x6642('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6642('0x2'));var rp=require(_0x6642('0x3'));var moment=require(_0x6642('0x4'));var BPromise=require(_0x6642('0x5'));var Mustache=require(_0x6642('0x6'));var util=require(_0x6642('0x7'));var path=require(_0x6642('0x8'));var sox=require(_0x6642('0x9'));var csv=require(_0x6642('0xa'));var ejs=require(_0x6642('0xb'));var fs=require('fs');var fs_extra=require(_0x6642('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6642('0xd'));var jsforce=require(_0x6642('0xe'));var deskjs=require(_0x6642('0xf'));var toCsv=require(_0x6642('0xa'));var querystring=require(_0x6642('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6642('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6642('0x12'));var logger=require('../../config/logger')(_0x6642('0x13'));var utils=require(_0x6642('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6642('0x15'))['db'];config['redis']=_[_0x6642('0x16')](config[_0x6642('0x17')],{'host':_0x6642('0x18'),'port':0x18eb});var socket=require(_0x6642('0x19'))(new Redis(config[_0x6642('0x17')]));require(_0x6642('0x1a'))['register'](socket);function respondWithStatusCode(_0x2d198a,_0xec7826){_0xec7826=_0xec7826||0xcc;return function(_0x4c4ff7){if(_0x4c4ff7){return _0x2d198a[_0x6642('0x1b')](_0xec7826);}return _0x2d198a[_0x6642('0x1c')](_0xec7826)['end']();};}function respondWithResult(_0x2a5a6a,_0x26d6e9){_0x26d6e9=_0x26d6e9||0xc8;return function(_0x49f91d){if(_0x49f91d){return _0x2a5a6a[_0x6642('0x1c')](_0x26d6e9)[_0x6642('0x1d')](_0x49f91d);}};}function respondWithFilteredResult(_0x57ea20,_0x2151e2){return function(_0x1c6791){if(_0x1c6791){var _0x375d4c=typeof _0x2151e2[_0x6642('0x1e')]===_0x6642('0x1f')&&typeof _0x2151e2[_0x6642('0x20')]===_0x6642('0x1f');var _0x1d234b=_0x1c6791[_0x6642('0x21')];var _0x5025d3=_0x375d4c?0x0:_0x2151e2[_0x6642('0x1e')];var _0x224a6b=_0x375d4c?_0x1c6791[_0x6642('0x21')]:_0x2151e2[_0x6642('0x1e')]+_0x2151e2['limit'];var _0x29bde9;if(_0x224a6b>=_0x1d234b){_0x224a6b=_0x1d234b;_0x29bde9=0xc8;}else{_0x29bde9=0xce;}_0x57ea20[_0x6642('0x1c')](_0x29bde9);return _0x57ea20[_0x6642('0x22')](_0x6642('0x23'),_0x5025d3+'-'+_0x224a6b+'/'+_0x1d234b)[_0x6642('0x1d')](_0x1c6791);}return null;};}function patchUpdates(_0x4351a4){return function(_0x4e2c74){try{jsonpatch['apply'](_0x4e2c74,_0x4351a4,!![]);}catch(_0x3d4839){return BPromise['reject'](_0x3d4839);}return _0x4e2c74['save']();};}function saveUpdates(_0x28f584,_0x12f9f0){return function(_0x731df0){if(_0x731df0){return _0x731df0['update'](_0x28f584)[_0x6642('0x24')](function(_0x5642a5){return _0x5642a5;});}return null;};}function removeEntity(_0x3f5d63,_0x1b12fd){return function(_0x32bee6){if(_0x32bee6){return _0x32bee6[_0x6642('0x25')]()[_0x6642('0x24')](function(){var _0x3e2596=_0x32bee6[_0x6642('0x26')]({'plain':!![]});var _0x4f7f33='CustomDashboards';return db[_0x6642('0x27')][_0x6642('0x25')]({'where':{'type':_0x4f7f33,'resourceId':_0x3e2596['id']}})[_0x6642('0x24')](function(){return _0x32bee6;});})[_0x6642('0x24')](function(){_0x3f5d63['status'](0xcc)[_0x6642('0x28')]();});}};}function handleEntityNotFound(_0x5f381a,_0x5299a7){return function(_0x3d65f0){if(!_0x3d65f0){_0x5f381a[_0x6642('0x1b')](0x194);}return _0x3d65f0;};}function handleError(_0x5f28b8,_0x15152d){_0x15152d=_0x15152d||0x1f4;return function(_0x1cb37b){logger[_0x6642('0x29')](_0x1cb37b['stack']);if(_0x1cb37b['name']){delete _0x1cb37b[_0x6642('0x2a')];}_0x5f28b8[_0x6642('0x1c')](_0x15152d)[_0x6642('0x2b')](_0x1cb37b);};}exports[_0x6642('0x2c')]=function(_0x5081d6,_0xb418cb){var _0x43bba8={},_0xaf8ba4={},_0x1d2d7a={'count':0x0,'rows':[]};var _0x599ccd=_[_0x6642('0x2d')](db['Dashboard'][_0x6642('0x2e')],function(_0x578879){return{'name':_0x578879['fieldName'],'type':_0x578879[_0x6642('0x2f')]['key']};});_0xaf8ba4[_0x6642('0x30')]=_[_0x6642('0x2d')](_0x599ccd,_0x6642('0x2a'));_0xaf8ba4[_0x6642('0x31')]=_[_0x6642('0x32')](_0x5081d6['query']);_0xaf8ba4[_0x6642('0x33')]=_[_0x6642('0x34')](_0xaf8ba4[_0x6642('0x30')],_0xaf8ba4[_0x6642('0x31')]);_0x43bba8[_0x6642('0x35')]=_[_0x6642('0x34')](_0xaf8ba4[_0x6642('0x30')],qs[_0x6642('0x36')](_0x5081d6[_0x6642('0x31')][_0x6642('0x36')]));_0x43bba8[_0x6642('0x35')]=_0x43bba8[_0x6642('0x35')][_0x6642('0x37')]?_0x43bba8['attributes']:_0xaf8ba4[_0x6642('0x30')];if(!_0x5081d6[_0x6642('0x31')][_0x6642('0x38')](_0x6642('0x39'))){_0x43bba8['limit']=qs[_0x6642('0x20')](_0x5081d6[_0x6642('0x31')]['limit']);_0x43bba8[_0x6642('0x1e')]=qs['offset'](_0x5081d6[_0x6642('0x31')][_0x6642('0x1e')]);}_0x43bba8[_0x6642('0x3a')]=qs['sort'](_0x5081d6['query']['sort']);_0x43bba8['where']=qs[_0x6642('0x33')](_[_0x6642('0x3b')](_0x5081d6[_0x6642('0x31')],_0xaf8ba4[_0x6642('0x33')]),_0x599ccd);if(_0x5081d6[_0x6642('0x31')][_0x6642('0x3c')]){_0x43bba8['where']=_[_0x6642('0x3d')](_0x43bba8[_0x6642('0x3e')],{'$or':_[_0x6642('0x2d')](_0x599ccd,function(_0x499806){if(_0x499806[_0x6642('0x2f')]!==_0x6642('0x3f')){var _0xfcf4a5={};_0xfcf4a5[_0x499806[_0x6642('0x2a')]]={'$like':'%'+_0x5081d6[_0x6642('0x31')][_0x6642('0x3c')]+'%'};return _0xfcf4a5;}})});}_0x43bba8=_[_0x6642('0x3d')]({},_0x43bba8,_0x5081d6['options']);var _0x3b6401={'where':_0x43bba8[_0x6642('0x3e')]};return db['Dashboard'][_0x6642('0x21')](_0x3b6401)[_0x6642('0x24')](function(_0x168941){_0x1d2d7a[_0x6642('0x21')]=_0x168941;if(_0x5081d6['query'][_0x6642('0x40')]){_0x43bba8[_0x6642('0x41')]=[{'all':!![]}];}return db[_0x6642('0x42')]['findAll'](_0x43bba8);})[_0x6642('0x24')](function(_0x6aeec){_0x1d2d7a[_0x6642('0x43')]=_0x6aeec;return _0x1d2d7a;})[_0x6642('0x24')](respondWithFilteredResult(_0xb418cb,_0x43bba8))[_0x6642('0x44')](handleError(_0xb418cb,null));};exports[_0x6642('0x45')]=function(_0x4b474f,_0x1651ad){var _0x2563c4={'raw':![],'where':{'id':_0x4b474f[_0x6642('0x46')]['id']}},_0x57b541={};_0x57b541[_0x6642('0x30')]=_[_0x6642('0x32')](db['Dashboard'][_0x6642('0x2e')]);_0x57b541[_0x6642('0x31')]=_[_0x6642('0x32')](_0x4b474f[_0x6642('0x31')]);_0x57b541[_0x6642('0x33')]=_[_0x6642('0x34')](_0x57b541[_0x6642('0x30')],_0x57b541[_0x6642('0x31')]);_0x2563c4[_0x6642('0x35')]=_[_0x6642('0x34')](_0x57b541[_0x6642('0x30')],qs[_0x6642('0x36')](_0x4b474f[_0x6642('0x31')][_0x6642('0x36')]));_0x2563c4[_0x6642('0x35')]=_0x2563c4[_0x6642('0x35')][_0x6642('0x37')]?_0x2563c4[_0x6642('0x35')]:_0x57b541[_0x6642('0x30')];if(_0x4b474f[_0x6642('0x31')]['includeAll']){_0x2563c4[_0x6642('0x41')]=[{'all':!![]}];}_0x2563c4=_['merge']({},_0x2563c4,_0x4b474f[_0x6642('0x47')]);return db[_0x6642('0x42')][_0x6642('0x48')](_0x2563c4)[_0x6642('0x24')](handleEntityNotFound(_0x1651ad,null))['then'](respondWithResult(_0x1651ad,null))[_0x6642('0x44')](handleError(_0x1651ad,null));};exports['create']=function(_0x5ac1c8,_0x9edaaa){return db[_0x6642('0x42')]['create'](_0x5ac1c8[_0x6642('0x49')],{})[_0x6642('0x24')](function(_0x24458d){var _0x2085ec=_0x5ac1c8[_0x6642('0x4a')]['get']({'plain':!![]});if(!_0x2085ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2085ec[_0x6642('0x4b')]===_0x6642('0x4a')){var _0x4c57c9=_0x24458d['get']({'plain':!![]});var _0x3a2299=_0x6642('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x3a2299,'userProfileId':_0x2085ec[_0x6642('0x4d')]},'raw':!![]})[_0x6642('0x24')](function(_0x947bcf){if(_0x947bcf&&_0x947bcf['autoAssociation']===0x0){return db[_0x6642('0x27')]['create']({'name':_0x4c57c9[_0x6642('0x2a')],'resourceId':_0x4c57c9['id'],'type':_0x947bcf[_0x6642('0x2a')],'sectionId':_0x947bcf['id']},{})['then'](function(){return _0x24458d;});}else{return _0x24458d;}})['catch'](function(_0x31353b){logger[_0x6642('0x29')](_0x6642('0x4e'),_0x31353b);throw _0x31353b;});}return _0x24458d;})[_0x6642('0x24')](respondWithResult(_0x9edaaa,0xc9))[_0x6642('0x44')](handleError(_0x9edaaa,null));};exports[_0x6642('0x4f')]=function(_0x1aadf2,_0x18a8b5){var _0x394af0={'where':{'id':_0x1aadf2[_0x6642('0x46')]['id']}},_0x32a5d4={};_0x32a5d4[_0x6642('0x30')]=_[_0x6642('0x32')](db[_0x6642('0x42')]['rawAttributes']);_0x394af0[_0x6642('0x35')]=_[_0x6642('0x34')](_0x32a5d4[_0x6642('0x30')],qs[_0x6642('0x36')](_0x1aadf2[_0x6642('0x31')]['fields']));_0x394af0[_0x6642('0x35')]=_0x394af0['attributes'][_0x6642('0x37')]?_0x394af0[_0x6642('0x35')]:_0x32a5d4[_0x6642('0x30')];if(_0x1aadf2['query'][_0x6642('0x40')]){_0x394af0[_0x6642('0x41')]=[{'all':!![]}];}_0x394af0=_[_0x6642('0x3d')]({},_0x394af0,_0x1aadf2[_0x6642('0x47')]);return db[_0x6642('0x42')]['find'](_0x394af0)[_0x6642('0x24')](handleEntityNotFound(_0x18a8b5,null))[_0x6642('0x24')](function(_0x27a535){if(_0x27a535){var _0x12b4ec=_0x27a535[_0x6642('0x26')]({'plain':!![]});_0x12b4ec=qs[_0x6642('0x50')](_0x12b4ec,['id','createdAt',_0x6642('0x51')]);_0x1aadf2[_0x6642('0x49')]=_[_0x6642('0x50')](_0x1aadf2[_0x6642('0x49')],['id','createdAt',_0x6642('0x51')]);return db[_0x6642('0x42')]['create'](_[_0x6642('0x3d')](_0x12b4ec,_0x1aadf2[_0x6642('0x49')]),{'include':_0x1aadf2['query'][_0x6642('0x40')]?[{'all':!![]}]:undefined})[_0x6642('0x24')](function(_0x1f248b){var _0x546937=_0x1aadf2[_0x6642('0x4a')]['get']({'plain':!![]});if(!_0x546937)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x546937[_0x6642('0x4b')]===_0x6642('0x4a')){var _0x2e00d6=_0x1f248b[_0x6642('0x26')]({'plain':!![]});var _0x31b1bc=_0x6642('0x4c');return db[_0x6642('0x52')][_0x6642('0x48')]({'where':{'name':_0x31b1bc,'userProfileId':_0x546937[_0x6642('0x4d')]},'raw':!![]})[_0x6642('0x24')](function(_0xc09891){if(_0xc09891&&_0xc09891[_0x6642('0x53')]===0x0){return db['UserProfileResource'][_0x6642('0x54')]({'name':_0x2e00d6[_0x6642('0x2a')],'resourceId':_0x2e00d6['id'],'type':_0xc09891[_0x6642('0x2a')],'sectionId':_0xc09891['id']},{})[_0x6642('0x24')](function(){return _0x1f248b;});}else{return _0x1f248b;}})[_0x6642('0x44')](function(_0x1ed745){logger[_0x6642('0x29')](_0x6642('0x4e'),_0x1ed745);throw _0x1ed745;});}return _0x1f248b;});}})[_0x6642('0x24')](respondWithResult(_0x18a8b5,0xc9))[_0x6642('0x44')](handleError(_0x18a8b5,null));};exports[_0x6642('0x55')]=function(_0x37af25,_0x5601c9){if(_0x37af25[_0x6642('0x49')]['id']){delete _0x37af25[_0x6642('0x49')]['id'];}return db[_0x6642('0x42')][_0x6642('0x48')]({'where':{'id':_0x37af25['params']['id']}})[_0x6642('0x24')](handleEntityNotFound(_0x5601c9,null))[_0x6642('0x24')](saveUpdates(_0x37af25[_0x6642('0x49')],null))['then'](respondWithResult(_0x5601c9,null))[_0x6642('0x44')](handleError(_0x5601c9,null));};exports[_0x6642('0x25')]=function(_0x226a72,_0x1b8829){return db[_0x6642('0x42')]['find']({'where':{'id':_0x226a72[_0x6642('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b8829,null))[_0x6642('0x24')](removeEntity(_0x1b8829,null))[_0x6642('0x44')](handleError(_0x1b8829,null));};function widgetAttributes(_0x3791b9){try{switch(_0x3791b9[_0x6642('0x2f')]){case _0x6642('0x56'):return[{'name':_0x6642('0x57'),'value':_0x3791b9[_0x6642('0x57')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9['attrs'][0x0]?_0x3791b9[_0x6642('0x58')][0x0][_0x6642('0x59')]:undefined)||_0x6642('0x5a')}];case _0x6642('0x5b'):return[{'name':_0x6642('0x5c'),'value':_0x3791b9[_0x6642('0x5c')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x0]?_0x3791b9['attrs'][0x0][_0x6642('0x59')]:undefined)||''}];case _0x6642('0x5d'):return[{'name':'attrHourFormat','value':_0x3791b9[_0x6642('0x5e')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x0]?_0x3791b9[_0x6642('0x58')][0x0][_0x6642('0x59')]:undefined)||'HH:mm:ss'},{'name':_0x6642('0x5f'),'value':_0x3791b9[_0x6642('0x5f')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x1]?_0x3791b9[_0x6642('0x58')][0x1][_0x6642('0x59')]:undefined)||_0x6642('0x60')},{'name':_0x6642('0x61'),'value':_0x3791b9['attrFontSize']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x2]?_0x3791b9[_0x6642('0x58')][0x2][_0x6642('0x59')]:undefined)||0xc}];case _0x6642('0x62'):return[{'name':_0x6642('0x63'),'value':_0x3791b9['attrMetric']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x0]?_0x3791b9['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x6642('0x64'),'value':_0x3791b9[_0x6642('0x64')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x1]?_0x3791b9[_0x6642('0x58')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x3791b9['attrFontSize']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x2]?_0x3791b9[_0x6642('0x58')][0x2]['value']:undefined)||0x14},{'name':_0x6642('0x65'),'value':_0x3791b9[_0x6642('0x65')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x3]?_0x3791b9['attrs'][0x3][_0x6642('0x59')]:undefined)||_0x6642('0x66')},{'name':_0x6642('0x67'),'value':_0x3791b9[_0x6642('0x67')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x4]?_0x3791b9[_0x6642('0x58')][0x4][_0x6642('0x59')]:undefined)||''},{'name':_0x6642('0x68'),'value':_0x3791b9[_0x6642('0x68')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x5]?_0x3791b9[_0x6642('0x58')][0x5][_0x6642('0x59')]:undefined)||''},{'name':_0x6642('0x69'),'value':_0x3791b9[_0x6642('0x69')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x6]?_0x3791b9[_0x6642('0x58')][0x6][_0x6642('0x59')]:undefined)||''},{'name':_0x6642('0x6a'),'value':_0x3791b9[_0x6642('0x6a')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9['attrs'][0x7]?_0x3791b9['attrs'][0x7]['value']:undefined)||''},{'name':_0x6642('0x6b'),'value':_0x3791b9[_0x6642('0x6b')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x8]?_0x3791b9[_0x6642('0x58')][0x8][_0x6642('0x59')]:undefined)||''},{'name':_0x6642('0x6c'),'value':_0x3791b9['attrChatWebsites']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x9]?_0x3791b9[_0x6642('0x58')][0x9]['value']:undefined)||''}];case _0x6642('0x6d'):case'pie-chart':return[{'name':_0x6642('0x6e'),'value':_0x3791b9[_0x6642('0x6e')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x0]?_0x3791b9['attrs'][0x0][_0x6642('0x59')]:undefined)||_0x6642('0x6f')},{'name':_0x6642('0x70'),'value':_0x3791b9[_0x6642('0x70')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9['attrs'][0x1]?_0x3791b9[_0x6642('0x58')][0x1][_0x6642('0x59')]:undefined)||null},{'name':_0x6642('0x71'),'value':_0x3791b9[_0x6642('0x71')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x2]?_0x3791b9[_0x6642('0x58')][0x2][_0x6642('0x59')]:undefined)||null},{'name':_0x6642('0x64'),'value':_0x3791b9['attrVoiceQueues']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9['attrs'][0x3]?_0x3791b9['attrs'][0x3][_0x6642('0x59')]:undefined)||[]},{'name':_0x6642('0x65'),'value':_0x3791b9[_0x6642('0x65')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x4]?_0x3791b9[_0x6642('0x58')][0x4]['value']:undefined)||_0x6642('0x66')},{'name':_0x6642('0x67'),'value':_0x3791b9[_0x6642('0x67')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x5]?_0x3791b9[_0x6642('0x58')][0x5][_0x6642('0x59')]:undefined)||''},{'name':_0x6642('0x68'),'value':_0x3791b9[_0x6642('0x68')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x6]?_0x3791b9[_0x6642('0x58')][0x6][_0x6642('0x59')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3791b9[_0x6642('0x69')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x7]?_0x3791b9['attrs'][0x7]['value']:undefined)||''},{'name':_0x6642('0x6a'),'value':_0x3791b9[_0x6642('0x6a')]||(_0x3791b9['attrs']&&_0x3791b9['attrs'][0x8]?_0x3791b9[_0x6642('0x58')][0x8][_0x6642('0x59')]:undefined)||''},{'name':_0x6642('0x6b'),'value':_0x3791b9['attrWhatsappAccounts']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9['attrs'][0x9]?_0x3791b9['attrs'][0x9][_0x6642('0x59')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3791b9[_0x6642('0x6c')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0xa]?_0x3791b9['attrs'][0xa][_0x6642('0x59')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x3791b9['reportType']||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x0]?_0x3791b9[_0x6642('0x58')][0x0][_0x6642('0x2f')]:undefined)||null,'value':_0x3791b9[_0x6642('0x72')]||(_0x3791b9['attrs']&&_0x3791b9[_0x6642('0x58')][0x0]?_0x3791b9[_0x6642('0x58')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x3791b9[_0x6642('0x73')]||(_0x3791b9[_0x6642('0x58')]&&_0x3791b9[_0x6642('0x58')][0x1]?_0x3791b9[_0x6642('0x58')][0x1][_0x6642('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x19a6f5){logger['error']('widgetAttributes:\x20%s',JSON[_0x6642('0x74')](_0x19a6f5));return[];}}exports[_0x6642('0x75')]=function(_0x1452bb,_0x3b6b39,_0x415ccb){if(_0x1452bb['body']['id']){delete _0x1452bb['body']['id'];}return db[_0x6642('0x42')][_0x6642('0x48')]({'where':{'id':_0x1452bb[_0x6642('0x46')]['id']}})[_0x6642('0x24')](handleEntityNotFound(_0x3b6b39,null))[_0x6642('0x24')](function(_0x313011){if(_0x313011){_0x1452bb['body']['DashboardId']=_0x313011['id'];_0x1452bb[_0x6642('0x49')][_0x6642('0x58')]=widgetAttributes(_0x1452bb[_0x6642('0x49')]);return db[_0x6642('0x76')]['create'](_0x1452bb[_0x6642('0x49')]);}})['then'](respondWithResult(_0x3b6b39,null))[_0x6642('0x44')](handleError(_0x3b6b39,null));};exports['getItems']=function(_0x1cfcad,_0xe67a5c,_0x3385fb){var _0x53c7c4={};var _0x11b44e={};var _0xd7933e;var _0x150cbd;return db['Dashboard']['findOne']({'where':{'id':_0x1cfcad[_0x6642('0x46')]['id']}})[_0x6642('0x24')](handleEntityNotFound(_0xe67a5c,null))[_0x6642('0x24')](function(_0x5257ae){if(_0x5257ae){_0xd7933e=_0x5257ae;_0x11b44e[_0x6642('0x30')]=_[_0x6642('0x32')](db[_0x6642('0x76')]['rawAttributes']);_0x11b44e[_0x6642('0x31')]=_[_0x6642('0x32')](_0x1cfcad[_0x6642('0x31')]);_0x11b44e[_0x6642('0x33')]=_[_0x6642('0x34')](_0x11b44e['model'],_0x11b44e[_0x6642('0x31')]);_0x53c7c4[_0x6642('0x35')]=_[_0x6642('0x34')](_0x11b44e[_0x6642('0x30')],qs[_0x6642('0x36')](_0x1cfcad[_0x6642('0x31')][_0x6642('0x36')]));_0x53c7c4[_0x6642('0x35')]=_0x53c7c4[_0x6642('0x35')]['length']?_0x53c7c4[_0x6642('0x35')]:_0x11b44e['model'];_0x53c7c4[_0x6642('0x3a')]=qs['sort'](_0x1cfcad[_0x6642('0x31')][_0x6642('0x77')]);_0x53c7c4[_0x6642('0x3e')]=qs['filters'](_[_0x6642('0x3b')](_0x1cfcad['query'],_0x11b44e[_0x6642('0x33')]));if(_0x1cfcad['query'][_0x6642('0x3c')]){_0x53c7c4[_0x6642('0x3e')]=_[_0x6642('0x3d')](_0x53c7c4[_0x6642('0x3e')],{'$or':_[_0x6642('0x2d')](_0x53c7c4[_0x6642('0x35')],function(_0x5b6a30){var _0x140007={};_0x140007[_0x5b6a30]={'$like':'%'+_0x1cfcad[_0x6642('0x31')]['filter']+'%'};return _0x140007;})});}_0x53c7c4=_['merge']({},_0x53c7c4,_0x1cfcad[_0x6642('0x47')]);return _0xd7933e[_0x6642('0x78')](_0x53c7c4);}})[_0x6642('0x24')](function(_0x50e279){if(_0x50e279){_0x150cbd=_0x50e279[_0x6642('0x37')];if(!_0x1cfcad['query'][_0x6642('0x38')](_0x6642('0x39'))){_0x53c7c4[_0x6642('0x20')]=qs['limit'](_0x1cfcad[_0x6642('0x31')][_0x6642('0x20')]);_0x53c7c4[_0x6642('0x1e')]=qs[_0x6642('0x1e')](_0x1cfcad['query']['offset']);}return _0xd7933e['getItems'](_0x53c7c4);}})[_0x6642('0x24')](function(_0x3d8f22){if(_0x3d8f22){return _0x3d8f22?{'count':_0x150cbd,'rows':_0x3d8f22}:null;}})[_0x6642('0x24')](respondWithResult(_0xe67a5c,null))[_0x6642('0x44')](handleError(_0xe67a5c,null));}; \ No newline at end of file +var _0x4724=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','get','CustomDashboards','UserProfileResource','stack','name','send','index','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','eml-format','rimraf','request-promise','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api'];(function(_0xcc86ba,_0x1adb0b){var _0x15f863=function(_0x353598){while(--_0x353598){_0xcc86ba['push'](_0xcc86ba['shift']());}};_0x15f863(++_0x1adb0b);}(_0x4724,0x15e));var _0x4472=function(_0x895ad0,_0xf67203){_0x895ad0=_0x895ad0-0x0;var _0x3d32f9=_0x4724[_0x895ad0];return _0x3d32f9;};'use strict';var emlformat=require(_0x4472('0x0'));var rimraf=require(_0x4472('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4472('0x2'));var moment=require('moment');var BPromise=require(_0x4472('0x3'));var Mustache=require(_0x4472('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4472('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4472('0x6'));var squel=require(_0x4472('0x7'));var crypto=require(_0x4472('0x8'));var jsforce=require(_0x4472('0x9'));var deskjs=require(_0x4472('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4472('0xb'));var Papa=require(_0x4472('0xc'));var Redis=require(_0x4472('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4472('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4472('0xf'));var utils=require('../../config/utils');var config=require(_0x4472('0x10'));var licenseUtil=require(_0x4472('0x11'));var db=require('../../mysqldb')['db'];config[_0x4472('0x12')]=_[_0x4472('0x13')](config[_0x4472('0x12')],{'host':_0x4472('0x14'),'port':0x18eb});var socket=require(_0x4472('0x15'))(new Redis(config[_0x4472('0x12')]));require(_0x4472('0x16'))[_0x4472('0x17')](socket);function respondWithStatusCode(_0x20a93d,_0x59828c){_0x59828c=_0x59828c||0xcc;return function(_0x3be893){if(_0x3be893){return _0x20a93d[_0x4472('0x18')](_0x59828c);}return _0x20a93d[_0x4472('0x19')](_0x59828c)[_0x4472('0x1a')]();};}function respondWithResult(_0x4db7a3,_0x36d00b){_0x36d00b=_0x36d00b||0xc8;return function(_0x1bc728){if(_0x1bc728){return _0x4db7a3[_0x4472('0x19')](_0x36d00b)[_0x4472('0x1b')](_0x1bc728);}};}function respondWithFilteredResult(_0x282306,_0x33772c){return function(_0x1b5d59){if(_0x1b5d59){var _0x353de0=typeof _0x33772c[_0x4472('0x1c')]===_0x4472('0x1d')&&typeof _0x33772c['limit']===_0x4472('0x1d');var _0x48d21e=_0x1b5d59[_0x4472('0x1e')];var _0x8d28bd=_0x353de0?0x0:_0x33772c[_0x4472('0x1c')];var _0x2c43f9=_0x353de0?_0x1b5d59[_0x4472('0x1e')]:_0x33772c[_0x4472('0x1c')]+_0x33772c[_0x4472('0x1f')];var _0x169689;if(_0x2c43f9>=_0x48d21e){_0x2c43f9=_0x48d21e;_0x169689=0xc8;}else{_0x169689=0xce;}_0x282306[_0x4472('0x19')](_0x169689);return _0x282306[_0x4472('0x20')](_0x4472('0x21'),_0x8d28bd+'-'+_0x2c43f9+'/'+_0x48d21e)[_0x4472('0x1b')](_0x1b5d59);}return null;};}function patchUpdates(_0x5f3b2f){return function(_0x1924c1){try{jsonpatch[_0x4472('0x22')](_0x1924c1,_0x5f3b2f,!![]);}catch(_0x323764){return BPromise['reject'](_0x323764);}return _0x1924c1['save']();};}function saveUpdates(_0x55e4fc,_0x4e4b62){return function(_0x5b5fd7){if(_0x5b5fd7){return _0x5b5fd7[_0x4472('0x23')](_0x55e4fc)['then'](function(_0x30a824){return _0x30a824;});}return null;};}function removeEntity(_0x30667c,_0x6d9828){return function(_0x33e1fa){if(_0x33e1fa){return _0x33e1fa[_0x4472('0x24')]()[_0x4472('0x25')](function(){var _0x8eb4bf=_0x33e1fa[_0x4472('0x26')]({'plain':!![]});var _0x88e805=_0x4472('0x27');return db[_0x4472('0x28')][_0x4472('0x24')]({'where':{'type':_0x88e805,'resourceId':_0x8eb4bf['id']}})['then'](function(){return _0x33e1fa;});})['then'](function(){_0x30667c['status'](0xcc)[_0x4472('0x1a')]();});}};}function handleEntityNotFound(_0x135f23,_0x1d13d6){return function(_0x538ea1){if(!_0x538ea1){_0x135f23[_0x4472('0x18')](0x194);}return _0x538ea1;};}function handleError(_0x1db8e9,_0x3a8a14){_0x3a8a14=_0x3a8a14||0x1f4;return function(_0x32a945){logger['error'](_0x32a945[_0x4472('0x29')]);if(_0x32a945[_0x4472('0x2a')]){delete _0x32a945[_0x4472('0x2a')];}_0x1db8e9[_0x4472('0x19')](_0x3a8a14)[_0x4472('0x2b')](_0x32a945);};}exports[_0x4472('0x2c')]=function(_0x2f9183,_0x57d352){var _0x40a8fb={},_0x1b4c7f={},_0x55d710={'count':0x0,'rows':[]};var _0x4e7991=_['map'](db['Dashboard'][_0x4472('0x2d')],function(_0x9e0cbd){return{'name':_0x9e0cbd['fieldName'],'type':_0x9e0cbd[_0x4472('0x2e')]['key']};});_0x1b4c7f[_0x4472('0x2f')]=_['map'](_0x4e7991,_0x4472('0x2a'));_0x1b4c7f[_0x4472('0x30')]=_[_0x4472('0x31')](_0x2f9183[_0x4472('0x30')]);_0x1b4c7f[_0x4472('0x32')]=_[_0x4472('0x33')](_0x1b4c7f[_0x4472('0x2f')],_0x1b4c7f[_0x4472('0x30')]);_0x40a8fb[_0x4472('0x34')]=_[_0x4472('0x33')](_0x1b4c7f['model'],qs['fields'](_0x2f9183['query'][_0x4472('0x35')]));_0x40a8fb[_0x4472('0x34')]=_0x40a8fb['attributes']['length']?_0x40a8fb[_0x4472('0x34')]:_0x1b4c7f[_0x4472('0x2f')];if(!_0x2f9183[_0x4472('0x30')][_0x4472('0x36')]('nolimit')){_0x40a8fb['limit']=qs[_0x4472('0x1f')](_0x2f9183['query'][_0x4472('0x1f')]);_0x40a8fb['offset']=qs[_0x4472('0x1c')](_0x2f9183[_0x4472('0x30')][_0x4472('0x1c')]);}_0x40a8fb[_0x4472('0x37')]=qs[_0x4472('0x38')](_0x2f9183['query'][_0x4472('0x38')]);_0x40a8fb[_0x4472('0x39')]=qs[_0x4472('0x32')](_[_0x4472('0x3a')](_0x2f9183[_0x4472('0x30')],_0x1b4c7f[_0x4472('0x32')]),_0x4e7991);if(_0x2f9183[_0x4472('0x30')][_0x4472('0x3b')]){_0x40a8fb['where']=_['merge'](_0x40a8fb[_0x4472('0x39')],{'$or':_[_0x4472('0x3c')](_0x4e7991,function(_0x31602f){if(_0x31602f[_0x4472('0x2e')]!==_0x4472('0x3d')){var _0x4dccec={};_0x4dccec[_0x31602f[_0x4472('0x2a')]]={'$like':'%'+_0x2f9183['query']['filter']+'%'};return _0x4dccec;}})});}_0x40a8fb=_[_0x4472('0x3e')]({},_0x40a8fb,_0x2f9183[_0x4472('0x3f')]);var _0x3f6e28={'where':_0x40a8fb[_0x4472('0x39')]};return db[_0x4472('0x40')]['count'](_0x3f6e28)[_0x4472('0x25')](function(_0x158800){_0x55d710[_0x4472('0x1e')]=_0x158800;if(_0x2f9183[_0x4472('0x30')][_0x4472('0x41')]){_0x40a8fb[_0x4472('0x42')]=[{'all':!![]}];}return db['Dashboard'][_0x4472('0x43')](_0x40a8fb);})[_0x4472('0x25')](function(_0x44d94d){_0x55d710[_0x4472('0x44')]=_0x44d94d;return _0x55d710;})[_0x4472('0x25')](respondWithFilteredResult(_0x57d352,_0x40a8fb))[_0x4472('0x45')](handleError(_0x57d352,null));};exports[_0x4472('0x46')]=function(_0x1619aa,_0x140dcc){var _0x524f74={'raw':![],'where':{'id':_0x1619aa[_0x4472('0x47')]['id']}},_0x34a1d1={};_0x34a1d1['model']=_['keys'](db[_0x4472('0x40')][_0x4472('0x2d')]);_0x34a1d1['query']=_['keys'](_0x1619aa[_0x4472('0x30')]);_0x34a1d1[_0x4472('0x32')]=_[_0x4472('0x33')](_0x34a1d1['model'],_0x34a1d1['query']);_0x524f74['attributes']=_[_0x4472('0x33')](_0x34a1d1[_0x4472('0x2f')],qs['fields'](_0x1619aa[_0x4472('0x30')][_0x4472('0x35')]));_0x524f74[_0x4472('0x34')]=_0x524f74[_0x4472('0x34')][_0x4472('0x48')]?_0x524f74['attributes']:_0x34a1d1[_0x4472('0x2f')];if(_0x1619aa[_0x4472('0x30')][_0x4472('0x41')]){_0x524f74[_0x4472('0x42')]=[{'all':!![]}];}_0x524f74=_[_0x4472('0x3e')]({},_0x524f74,_0x1619aa['options']);return db['Dashboard'][_0x4472('0x49')](_0x524f74)[_0x4472('0x25')](handleEntityNotFound(_0x140dcc,null))[_0x4472('0x25')](respondWithResult(_0x140dcc,null))[_0x4472('0x45')](handleError(_0x140dcc,null));};exports['create']=function(_0x5904e4,_0x471452){return db['Dashboard'][_0x4472('0x4a')](_0x5904e4['body'],{})['then'](function(_0x4b9f50){var _0x5d852a=_0x5904e4[_0x4472('0x4b')][_0x4472('0x26')]({'plain':!![]});if(!_0x5d852a)throw new Error(_0x4472('0x4c'));if(_0x5d852a[_0x4472('0x4d')]===_0x4472('0x4b')){var _0x3a2af7=_0x4b9f50[_0x4472('0x26')]({'plain':!![]});var _0x18d175=_0x4472('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x18d175,'userProfileId':_0x5d852a[_0x4472('0x4e')]},'raw':!![]})[_0x4472('0x25')](function(_0x30c189){if(_0x30c189&&_0x30c189['autoAssociation']===0x0){return db[_0x4472('0x28')]['create']({'name':_0x3a2af7[_0x4472('0x2a')],'resourceId':_0x3a2af7['id'],'type':_0x30c189['name'],'sectionId':_0x30c189['id']},{})[_0x4472('0x25')](function(){return _0x4b9f50;});}else{return _0x4b9f50;}})['catch'](function(_0xd04054){logger[_0x4472('0x4f')](_0x4472('0x50'),_0xd04054);throw _0xd04054;});}return _0x4b9f50;})[_0x4472('0x25')](respondWithResult(_0x471452,0xc9))['catch'](handleError(_0x471452,null));};exports['clone']=function(_0x20fc44,_0x3c35a7){var _0x59f27c={'where':{'id':_0x20fc44[_0x4472('0x47')]['id']}},_0x4cc4be={};_0x4cc4be[_0x4472('0x2f')]=_[_0x4472('0x31')](db['Dashboard']['rawAttributes']);_0x59f27c[_0x4472('0x34')]=_[_0x4472('0x33')](_0x4cc4be['model'],qs[_0x4472('0x35')](_0x20fc44[_0x4472('0x30')][_0x4472('0x35')]));_0x59f27c[_0x4472('0x34')]=_0x59f27c[_0x4472('0x34')][_0x4472('0x48')]?_0x59f27c[_0x4472('0x34')]:_0x4cc4be[_0x4472('0x2f')];if(_0x20fc44[_0x4472('0x30')][_0x4472('0x41')]){_0x59f27c[_0x4472('0x42')]=[{'all':!![]}];}_0x59f27c=_['merge']({},_0x59f27c,_0x20fc44[_0x4472('0x3f')]);return db['Dashboard'][_0x4472('0x49')](_0x59f27c)[_0x4472('0x25')](handleEntityNotFound(_0x3c35a7,null))[_0x4472('0x25')](function(_0x4806b8){if(_0x4806b8){var _0x5be669=_0x4806b8['get']({'plain':!![]});_0x5be669=qs[_0x4472('0x51')](_0x5be669,['id',_0x4472('0x52'),'updatedAt']);_0x20fc44[_0x4472('0x53')]=_[_0x4472('0x51')](_0x20fc44[_0x4472('0x53')],['id','createdAt',_0x4472('0x54')]);return db[_0x4472('0x40')]['create'](_['merge'](_0x5be669,_0x20fc44['body']),{'include':_0x20fc44[_0x4472('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x4472('0x25')](function(_0x3cbf61){var _0x54564b=_0x20fc44[_0x4472('0x4b')][_0x4472('0x26')]({'plain':!![]});if(!_0x54564b)throw new Error(_0x4472('0x4c'));if(_0x54564b[_0x4472('0x4d')]===_0x4472('0x4b')){var _0x5610bf=_0x3cbf61['get']({'plain':!![]});var _0x485fff='CustomDashboards';return db['UserProfileSection'][_0x4472('0x49')]({'where':{'name':_0x485fff,'userProfileId':_0x54564b['userProfileId']},'raw':!![]})['then'](function(_0x6ea8aa){if(_0x6ea8aa&&_0x6ea8aa['autoAssociation']===0x0){return db['UserProfileResource'][_0x4472('0x4a')]({'name':_0x5610bf[_0x4472('0x2a')],'resourceId':_0x5610bf['id'],'type':_0x6ea8aa[_0x4472('0x2a')],'sectionId':_0x6ea8aa['id']},{})[_0x4472('0x25')](function(){return _0x3cbf61;});}else{return _0x3cbf61;}})[_0x4472('0x45')](function(_0x50611d){logger[_0x4472('0x4f')](_0x4472('0x50'),_0x50611d);throw _0x50611d;});}return _0x3cbf61;});}})[_0x4472('0x25')](respondWithResult(_0x3c35a7,0xc9))[_0x4472('0x45')](handleError(_0x3c35a7,null));};exports[_0x4472('0x23')]=function(_0x2fa0b2,_0x18af90){if(_0x2fa0b2[_0x4472('0x53')]['id']){delete _0x2fa0b2[_0x4472('0x53')]['id'];}return db[_0x4472('0x40')]['find']({'where':{'id':_0x2fa0b2[_0x4472('0x47')]['id']}})[_0x4472('0x25')](handleEntityNotFound(_0x18af90,null))[_0x4472('0x25')](saveUpdates(_0x2fa0b2[_0x4472('0x53')],null))[_0x4472('0x25')](respondWithResult(_0x18af90,null))[_0x4472('0x45')](handleError(_0x18af90,null));};exports[_0x4472('0x24')]=function(_0x5b7c97,_0x2f73a6){return db['Dashboard'][_0x4472('0x49')]({'where':{'id':_0x5b7c97[_0x4472('0x47')]['id']}})[_0x4472('0x25')](handleEntityNotFound(_0x2f73a6,null))[_0x4472('0x25')](removeEntity(_0x2f73a6,null))['catch'](handleError(_0x2f73a6,null));};function widgetAttributes(_0x8f6339){try{switch(_0x8f6339[_0x4472('0x2e')]){case _0x4472('0x55'):return[{'name':_0x4472('0x56'),'value':_0x8f6339[_0x4472('0x56')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||_0x4472('0x59')}];case'custom':return[{'name':'attrPath','value':_0x8f6339[_0x4472('0x5a')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||''}];case'clock':return[{'name':_0x4472('0x5b'),'value':_0x8f6339[_0x4472('0x5b')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||_0x4472('0x5c')},{'name':_0x4472('0x5d'),'value':_0x8f6339[_0x4472('0x5d')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||_0x4472('0x5e')},{'name':_0x4472('0x5f'),'value':_0x8f6339[_0x4472('0x5f')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x2]?_0x8f6339[_0x4472('0x57')][0x2][_0x4472('0x58')]:undefined)||0xc}];case _0x4472('0x60'):return[{'name':_0x4472('0x61'),'value':_0x8f6339[_0x4472('0x61')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||'total'},{'name':_0x4472('0x62'),'value':_0x8f6339[_0x4472('0x62')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||[]},{'name':_0x4472('0x5f'),'value':_0x8f6339[_0x4472('0x5f')]||(_0x8f6339['attrs']&&_0x8f6339['attrs'][0x2]?_0x8f6339['attrs'][0x2][_0x4472('0x58')]:undefined)||0x14},{'name':_0x4472('0x63'),'value':_0x8f6339['attrChannel']||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x3]?_0x8f6339[_0x4472('0x57')][0x3][_0x4472('0x58')]:undefined)||_0x4472('0x64')},{'name':_0x4472('0x65'),'value':_0x8f6339[_0x4472('0x65')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x4]?_0x8f6339['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x8f6339[_0x4472('0x66')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x5]?_0x8f6339[_0x4472('0x57')][0x5][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x67'),'value':_0x8f6339[_0x4472('0x67')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x6]?_0x8f6339[_0x4472('0x57')][0x6][_0x4472('0x58')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x8f6339[_0x4472('0x68')]||(_0x8f6339['attrs']&&_0x8f6339['attrs'][0x7]?_0x8f6339[_0x4472('0x57')][0x7][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x69'),'value':_0x8f6339['attrWhatsappAccounts']||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x8]?_0x8f6339['attrs'][0x8][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x6a'),'value':_0x8f6339[_0x4472('0x6a')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x9]?_0x8f6339[_0x4472('0x57')][0x9][_0x4472('0x58')]:undefined)||''}];case _0x4472('0x6b'):case'pie-chart':return[{'name':_0x4472('0x6c'),'value':_0x8f6339[_0x4472('0x6c')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x4472('0x6d'),'value':_0x8f6339[_0x4472('0x6d')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||null},{'name':_0x4472('0x6e'),'value':_0x8f6339[_0x4472('0x6e')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0x2]?_0x8f6339['attrs'][0x2][_0x4472('0x58')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x8f6339[_0x4472('0x62')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0x3]?_0x8f6339[_0x4472('0x57')][0x3][_0x4472('0x58')]:undefined)||[]},{'name':_0x4472('0x63'),'value':_0x8f6339[_0x4472('0x63')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x4]?_0x8f6339[_0x4472('0x57')][0x4][_0x4472('0x58')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x8f6339[_0x4472('0x65')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x5]?_0x8f6339[_0x4472('0x57')][0x5][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x66'),'value':_0x8f6339[_0x4472('0x66')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x6]?_0x8f6339[_0x4472('0x57')][0x6][_0x4472('0x58')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x8f6339['attrSmsAccounts']||(_0x8f6339['attrs']&&_0x8f6339['attrs'][0x7]?_0x8f6339['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x8f6339[_0x4472('0x68')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x8]?_0x8f6339[_0x4472('0x57')][0x8][_0x4472('0x58')]:undefined)||''},{'name':_0x4472('0x69'),'value':_0x8f6339[_0x4472('0x69')]||(_0x8f6339['attrs']&&_0x8f6339[_0x4472('0x57')][0x9]?_0x8f6339['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x8f6339[_0x4472('0x6a')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0xa]?_0x8f6339[_0x4472('0x57')][0xa][_0x4472('0x58')]:undefined)||''}];case _0x4472('0x6f'):return[{'name':_0x4472('0x70'),'type':_0x8f6339['reportType']||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x2e')]:undefined)||null,'value':_0x8f6339[_0x4472('0x70')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339['attrs'][0x0]?_0x8f6339[_0x4472('0x57')][0x0][_0x4472('0x58')]:undefined)||null},{'name':_0x4472('0x71'),'value':_0x8f6339[_0x4472('0x71')]||(_0x8f6339[_0x4472('0x57')]&&_0x8f6339[_0x4472('0x57')][0x1]?_0x8f6339[_0x4472('0x57')][0x1][_0x4472('0x58')]:undefined)||0x0}];default:return[];}}catch(_0x40e54c){logger[_0x4472('0x4f')](_0x4472('0x72'),JSON[_0x4472('0x73')](_0x40e54c));return[];}}exports[_0x4472('0x74')]=function(_0x34f06e,_0x4565c5,_0x36ce1c){if(_0x34f06e[_0x4472('0x53')]['id']){delete _0x34f06e[_0x4472('0x53')]['id'];}return db[_0x4472('0x40')][_0x4472('0x49')]({'where':{'id':_0x34f06e['params']['id']}})['then'](handleEntityNotFound(_0x4565c5,null))[_0x4472('0x25')](function(_0x4c2109){if(_0x4c2109){_0x34f06e[_0x4472('0x53')][_0x4472('0x75')]=_0x4c2109['id'];_0x34f06e[_0x4472('0x53')][_0x4472('0x57')]=widgetAttributes(_0x34f06e['body']);return db[_0x4472('0x76')]['create'](_0x34f06e[_0x4472('0x53')]);}})[_0x4472('0x25')](respondWithResult(_0x4565c5,null))[_0x4472('0x45')](handleError(_0x4565c5,null));};exports[_0x4472('0x77')]=function(_0x160e36,_0x5ec5e8,_0x3027a6){var _0x4eff99={};var _0x482dbc={};var _0x4d1e20;var _0x5320ad;return db[_0x4472('0x40')][_0x4472('0x78')]({'where':{'id':_0x160e36[_0x4472('0x47')]['id']}})[_0x4472('0x25')](handleEntityNotFound(_0x5ec5e8,null))[_0x4472('0x25')](function(_0x51d991){if(_0x51d991){_0x4d1e20=_0x51d991;_0x482dbc[_0x4472('0x2f')]=_[_0x4472('0x31')](db[_0x4472('0x76')][_0x4472('0x2d')]);_0x482dbc[_0x4472('0x30')]=_[_0x4472('0x31')](_0x160e36[_0x4472('0x30')]);_0x482dbc[_0x4472('0x32')]=_['intersection'](_0x482dbc[_0x4472('0x2f')],_0x482dbc[_0x4472('0x30')]);_0x4eff99[_0x4472('0x34')]=_[_0x4472('0x33')](_0x482dbc[_0x4472('0x2f')],qs['fields'](_0x160e36[_0x4472('0x30')]['fields']));_0x4eff99[_0x4472('0x34')]=_0x4eff99[_0x4472('0x34')][_0x4472('0x48')]?_0x4eff99[_0x4472('0x34')]:_0x482dbc[_0x4472('0x2f')];_0x4eff99[_0x4472('0x37')]=qs[_0x4472('0x38')](_0x160e36[_0x4472('0x30')]['sort']);_0x4eff99['where']=qs[_0x4472('0x32')](_['pick'](_0x160e36['query'],_0x482dbc[_0x4472('0x32')]));if(_0x160e36['query']['filter']){_0x4eff99[_0x4472('0x39')]=_[_0x4472('0x3e')](_0x4eff99[_0x4472('0x39')],{'$or':_['map'](_0x4eff99[_0x4472('0x34')],function(_0xc3e2e9){var _0x3476c0={};_0x3476c0[_0xc3e2e9]={'$like':'%'+_0x160e36['query']['filter']+'%'};return _0x3476c0;})});}_0x4eff99=_[_0x4472('0x3e')]({},_0x4eff99,_0x160e36['options']);return _0x4d1e20[_0x4472('0x77')](_0x4eff99);}})[_0x4472('0x25')](function(_0x42d773){if(_0x42d773){_0x5320ad=_0x42d773[_0x4472('0x48')];if(!_0x160e36['query']['hasOwnProperty'](_0x4472('0x79'))){_0x4eff99[_0x4472('0x1f')]=qs['limit'](_0x160e36[_0x4472('0x30')][_0x4472('0x1f')]);_0x4eff99[_0x4472('0x1c')]=qs[_0x4472('0x1c')](_0x160e36[_0x4472('0x30')]['offset']);}return _0x4d1e20['getItems'](_0x4eff99);}})[_0x4472('0x25')](function(_0xd93a8d){if(_0xd93a8d){return _0xd93a8d?{'count':_0x5320ad,'rows':_0xd93a8d}:null;}})['then'](respondWithResult(_0x5ec5e8,null))[_0x4472('0x45')](handleError(_0x5ec5e8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 49e2c7d..7a94023 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 _0x7948=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','Dashboard'];(function(_0xdcea5e,_0xacd227){var _0x5423f5=function(_0x2de7ad){while(--_0x2de7ad){_0xdcea5e['push'](_0xdcea5e['shift']());}};_0x5423f5(++_0xacd227);}(_0x7948,0xc7));var _0x8794=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x7948[_0x4c7935];return _0x30651d;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x8794('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8794('0x1')](0x0);var events={'afterCreate':_0x8794('0x2'),'afterUpdate':'update','afterDestroy':_0x8794('0x3')};function emitEvent(_0x5d5535){return function(_0x16d06d,_0x245a04,_0x5dde41){DashboardEvents[_0x8794('0x4')](_0x5d5535+':'+_0x16d06d['id'],_0x16d06d);DashboardEvents[_0x8794('0x4')](_0x5d5535,_0x16d06d);_0x5dde41(null);};}for(var e in events){if(events[_0x8794('0x5')](e)){var event=events[e];Dashboard[_0x8794('0x6')](e,emitEvent(event));}}module[_0x8794('0x7')]=DashboardEvents; \ No newline at end of file +var _0x2bfa=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x45cc12,_0x1f4c9d){var _0x3c6386=function(_0x9074ed){while(--_0x9074ed){_0x45cc12['push'](_0x45cc12['shift']());}};_0x3c6386(++_0x1f4c9d);}(_0x2bfa,0x188));var _0xa2bf=function(_0x372cc5,_0x52471d){_0x372cc5=_0x372cc5-0x0;var _0x301ca6=_0x2bfa[_0x372cc5];return _0x301ca6;};'use strict';var EventEmitter=require(_0xa2bf('0x0'));var Dashboard=require(_0xa2bf('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa2bf('0x2')](0x0);var events={'afterCreate':_0xa2bf('0x3'),'afterUpdate':_0xa2bf('0x4'),'afterDestroy':_0xa2bf('0x5')};function emitEvent(_0x4f6e6a){return function(_0x3ffb84,_0x1a976f,_0x1476dd){DashboardEvents[_0xa2bf('0x6')](_0x4f6e6a+':'+_0x3ffb84['id'],_0x3ffb84);DashboardEvents[_0xa2bf('0x6')](_0x4f6e6a,_0x3ffb84);_0x1476dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xa2bf('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 8fb194d..20996bd 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 _0x8342=['path','rimraf','../../config/environment','exports','Dashboard','../../config/logger','api'];(function(_0x35a592,_0x9c8aa3){var _0x426039=function(_0x18a61d){while(--_0x18a61d){_0x35a592['push'](_0x35a592['shift']());}};_0x426039(++_0x9c8aa3);}(_0x8342,0x1da));var _0x2834=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0x8342[_0x134448];return _0x2d52a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2834('0x0'))(_0x2834('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2834('0x2'));var rimraf=require(_0x2834('0x3'));var config=require(_0x2834('0x4'));var attributes=require('./dashboard.attributes');module[_0x2834('0x5')]=function(_0x8df483,_0x3ca27d){return _0x8df483['define'](_0x2834('0x6'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x165f=['bluebird','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','../../config/logger','moment'];(function(_0x467cec,_0x47b1af){var _0xea5dbd=function(_0xe0eeb9){while(--_0xe0eeb9){_0x467cec['push'](_0x467cec['shift']());}};_0xea5dbd(++_0x47b1af);}(_0x165f,0x6b));var _0xf165=function(_0x27b283,_0x5505bf){_0x27b283=_0x27b283-0x0;var _0xcacb64=_0x165f[_0x27b283];return _0xcacb64;};'use strict';var _=require(_0xf165('0x0'));var util=require('util');var logger=require(_0xf165('0x1'))('api');var moment=require(_0xf165('0x2'));var BPromise=require(_0xf165('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf165('0x4'));var rimraf=require(_0xf165('0x5'));var config=require(_0xf165('0x6'));var attributes=require(_0xf165('0x7'));module['exports']=function(_0x413e24,_0x1764ae){return _0x413e24[_0xf165('0x8')](_0xf165('0x9'),attributes,{'tableName':_0xf165('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 93814c8..9a7a831 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 _0x7217=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x7217,0x134));var _0x7721=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7217[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7721('0x0'));var util=require(_0x7721('0x1'));var moment=require(_0x7721('0x2'));var BPromise=require(_0x7721('0x3'));var rs=require(_0x7721('0x4'));var fs=require('fs');var Redis=require(_0x7721('0x5'));var db=require(_0x7721('0x6'))['db'];var utils=require(_0x7721('0x7'));var logger=require(_0x7721('0x8'))(_0x7721('0x9'));var config=require(_0x7721('0xa'));var jayson=require(_0x7721('0xb'));var client=jayson[_0x7721('0xc')][_0x7721('0xd')]({'port':0x232a});config['redis']=_[_0x7721('0xe')](config['redis'],{'host':_0x7721('0xf'),'port':0x18eb});var socket=require(_0x7721('0x10'))(new Redis(config['redis']));require(_0x7721('0x11'))[_0x7721('0x12')](socket);function respondWithRpcPromise(_0x1a7bd2,_0x14573d,_0x2ef2b6){return new BPromise(function(_0x467acb,_0x31d7f4){return client[_0x7721('0x13')](_0x1a7bd2,_0x2ef2b6)[_0x7721('0x14')](function(_0xabd834){logger['info'](_0x7721('0x15'),_0x14573d,_0x7721('0x16'));logger[_0x7721('0x17')](_0x7721('0x18'),_0x14573d,_0x7721('0x16'),JSON[_0x7721('0x19')](_0xabd834));if(_0xabd834[_0x7721('0x1a')]){if(_0xabd834[_0x7721('0x1a')][_0x7721('0x1b')]===0x1f4){logger['error'](_0x7721('0x15'),_0x14573d,_0xabd834['error'][_0x7721('0x1c')]);return _0x31d7f4(_0xabd834[_0x7721('0x1a')][_0x7721('0x1c')]);}logger[_0x7721('0x1a')](_0x7721('0x15'),_0x14573d,_0xabd834[_0x7721('0x1a')]['message']);return _0x467acb(_0xabd834[_0x7721('0x1a')][_0x7721('0x1c')]);}else{logger[_0x7721('0x1d')](_0x7721('0x15'),_0x14573d,'request\x20sent');_0x467acb(_0xabd834['result'][_0x7721('0x1c')]);}})['catch'](function(_0x369b34){logger[_0x7721('0x1a')](_0x7721('0x15'),_0x14573d,_0x369b34);_0x31d7f4(_0x369b34);});});} \ No newline at end of file +var _0x9e63=['./dashboard.socket','register','request','info','request\x20sent','debug','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x48fddb,_0x37a2d3){var _0x22dad1=function(_0x4d32d6){while(--_0x4d32d6){_0x48fddb['push'](_0x48fddb['shift']());}};_0x22dad1(++_0x37a2d3);}(_0x9e63,0xec));var _0x39e6=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9e63[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var moment=require(_0x39e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39e6('0x5'))('rpc');var config=require(_0x39e6('0x6'));var jayson=require(_0x39e6('0x7'));var client=jayson[_0x39e6('0x8')][_0x39e6('0x9')]({'port':0x232a});config[_0x39e6('0xa')]=_[_0x39e6('0xb')](config[_0x39e6('0xa')],{'host':_0x39e6('0xc'),'port':0x18eb});var socket=require(_0x39e6('0xd'))(new Redis(config[_0x39e6('0xa')]));require(_0x39e6('0xe'))[_0x39e6('0xf')](socket);function respondWithRpcPromise(_0x22aa11,_0x46fb0d,_0x451640){return new BPromise(function(_0x2f6417,_0xa2f8fa){return client[_0x39e6('0x10')](_0x22aa11,_0x451640)['then'](function(_0x46e6f0){logger[_0x39e6('0x11')]('Dashboard,\x20%s,\x20%s',_0x46fb0d,_0x39e6('0x12'));logger[_0x39e6('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x46fb0d,_0x39e6('0x12'),JSON['stringify'](_0x46e6f0));if(_0x46e6f0[_0x39e6('0x14')]){if(_0x46e6f0[_0x39e6('0x14')][_0x39e6('0x15')]===0x1f4){logger['error'](_0x39e6('0x16'),_0x46fb0d,_0x46e6f0['error']['message']);return _0xa2f8fa(_0x46e6f0[_0x39e6('0x14')]['message']);}logger['error'](_0x39e6('0x16'),_0x46fb0d,_0x46e6f0['error']['message']);return _0x2f6417(_0x46e6f0[_0x39e6('0x14')][_0x39e6('0x17')]);}else{logger[_0x39e6('0x11')]('Dashboard,\x20%s,\x20%s',_0x46fb0d,_0x39e6('0x12'));_0x2f6417(_0x46e6f0['result'][_0x39e6('0x17')]);}})[_0x39e6('0x18')](function(_0x443e3f){logger[_0x39e6('0x14')]('Dashboard,\x20%s,\x20%s',_0x46fb0d,_0x443e3f);_0xa2f8fa(_0x443e3f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 2d00e83..3eb4a7f 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 _0x2fb5=['length','dashboard:','save'];(function(_0xfa40d4,_0x46ddfd){var _0x4ec33e=function(_0x5ebd2d){while(--_0x5ebd2d){_0xfa40d4['push'](_0xfa40d4['shift']());}};_0x4ec33e(++_0x46ddfd);}(_0x2fb5,0xf8));var _0x52fb=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x2fb5[_0x40ac5e];return _0x2839d6;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x52fb('0x0'),'remove','update'];function createListener(_0x35a8fc,_0x230dda){return function(_0x149e79){_0x230dda['emit'](_0x35a8fc,_0x149e79);};}function removeListener(_0x3722ad,_0x4bdcb8){return function(){DashboardEvents['removeListener'](_0x3722ad,_0x4bdcb8);};}exports['register']=function(_0x3fcda6){for(var _0x5889cf=0x0,_0x3d3078=events[_0x52fb('0x1')];_0x5889cf<_0x3d3078;_0x5889cf++){var _0x390c21=events[_0x5889cf];var _0x396db9=createListener(_0x52fb('0x2')+_0x390c21,_0x3fcda6);DashboardEvents['on'](_0x390c21,_0x396db9);}}; \ No newline at end of file +var _0x55f9=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x8980,_0x3e943b){var _0x3491a6=function(_0x1acbf3){while(--_0x1acbf3){_0x8980['push'](_0x8980['shift']());}};_0x3491a6(++_0x3e943b);}(_0x55f9,0xa3));var _0x955f=function(_0x5a2e46,_0x3b4094){_0x5a2e46=_0x5a2e46-0x0;var _0x33bdbf=_0x55f9[_0x5a2e46];return _0x33bdbf;};'use strict';var DashboardEvents=require(_0x955f('0x0'));var events=[_0x955f('0x1'),_0x955f('0x2'),_0x955f('0x3')];function createListener(_0x100857,_0x15f2c1){return function(_0x26560f){_0x15f2c1[_0x955f('0x4')](_0x100857,_0x26560f);};}function removeListener(_0x1cab26,_0x10b31a){return function(){DashboardEvents[_0x955f('0x5')](_0x1cab26,_0x10b31a);};}exports[_0x955f('0x6')]=function(_0x237bf7){for(var _0x1305d1=0x0,_0x480037=events[_0x955f('0x7')];_0x1305d1<_0x480037;_0x1305d1++){var _0xf813a8=events[_0x1305d1];var _0x19777c=createListener(_0x955f('0x8')+_0xf813a8,_0x237bf7);DashboardEvents['on'](_0xf813a8,_0x19777c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index cf6b413..abdaf1a 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 _0xef40=['post','/:id/clone','clone','/:id/items','addItem','put','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show'];(function(_0x2adcd4,_0x52fce3){var _0x25377c=function(_0x16b5ba){while(--_0x16b5ba){_0x2adcd4['push'](_0x2adcd4['shift']());}};_0x25377c(++_0x52fce3);}(_0xef40,0x193));var _0x0ef4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xef40[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x0ef4('0x0'));var util=require('util');var path=require(_0x0ef4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ef4('0x2')]();var fs_extra=require(_0x0ef4('0x3'));var auth=require(_0x0ef4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0ef4('0x5'));var controller=require(_0x0ef4('0x6'));router[_0x0ef4('0x7')]('/',auth[_0x0ef4('0x8')](),controller['index']);router['get'](_0x0ef4('0x9'),auth[_0x0ef4('0x8')](),controller[_0x0ef4('0xa')]);router['get']('/:id/items',auth[_0x0ef4('0x8')](),controller['getItems']);router[_0x0ef4('0xb')]('/',auth[_0x0ef4('0x8')](),controller['create']);router[_0x0ef4('0xb')](_0x0ef4('0xc'),auth[_0x0ef4('0x8')](),controller[_0x0ef4('0xd')]);router[_0x0ef4('0xb')](_0x0ef4('0xe'),auth[_0x0ef4('0x8')](),controller[_0x0ef4('0xf')]);router[_0x0ef4('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0ef4('0x8')](),controller['destroy']);module[_0x0ef4('0x11')]=router; \ No newline at end of file +var _0x83dc=['path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','create','post','/:id/items','addItem','put','update','delete','destroy','exports','multer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x83dc,0x97));var _0xc83d=function(_0x22062d,_0x4a7dcd){_0x22062d=_0x22062d-0x0;var _0x173a35=_0x83dc[_0x22062d];return _0x173a35;};'use strict';var multer=require(_0xc83d('0x0'));var util=require('util');var path=require(_0xc83d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc83d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc83d('0x3'));var config=require(_0xc83d('0x4'));var controller=require(_0xc83d('0x5'));router[_0xc83d('0x6')]('/',auth[_0xc83d('0x7')](),controller[_0xc83d('0x8')]);router[_0xc83d('0x6')](_0xc83d('0x9'),auth[_0xc83d('0x7')](),controller['show']);router['get']('/:id/items',auth['isAuthenticated'](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0xc83d('0xa')]);router['post']('/:id/clone',auth[_0xc83d('0x7')](),controller['clone']);router[_0xc83d('0xb')](_0xc83d('0xc'),auth[_0xc83d('0x7')](),controller[_0xc83d('0xd')]);router[_0xc83d('0xe')](_0xc83d('0x9'),auth[_0xc83d('0x7')](),controller[_0xc83d('0xf')]);router[_0xc83d('0x10')](_0xc83d('0x9'),auth[_0xc83d('0x7')](),controller[_0xc83d('0x11')]);module[_0xc83d('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 71f740f..703a3d0 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 _0x4819=['long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','squel','lodash','exports','STRING','TEXT'];(function(_0x52023f,_0x464e77){var _0x4d55f7=function(_0x3e46c5){while(--_0x3e46c5){_0x52023f['push'](_0x52023f['shift']());}};_0x4d55f7(++_0x464e77);}(_0x4819,0xcd));var _0x9481=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x4819[_0x274dd7];return _0x148829;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9481('0x0'));var _=require(_0x9481('0x1'));module[_0x9481('0x2')]={'title':{'type':Sequelize[_0x9481('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9481('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9481('0x4')](_0x9481('0x5')),'get':function(){try{return JSON[_0x9481('0x6')](this[_0x9481('0x7')](_0x9481('0x8')));}catch(_0x5ac51c){return[];}},'set':function(_0x4d9e3a){try{this['setDataValue']('attrs',JSON[_0x9481('0x9')](_0x4d9e3a));}catch(_0x6c6a08){this[_0x9481('0xa')](_0x9481('0x8'),JSON[_0x9481('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9481('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9481('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9481('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9481('0x3')],'allowNull':![],'defaultValue':_0x9481('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9481('0x3')]},'titleFontSize':{'type':Sequelize[_0x9481('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2675=['parse','attrs','setDataValue','stringify','INTEGER','sequelize','STRING','long'];(function(_0x2663a7,_0x164a83){var _0x8f02cd=function(_0x119e42){while(--_0x119e42){_0x2663a7['push'](_0x2663a7['shift']());}};_0x8f02cd(++_0x164a83);}(_0x2675,0x75));var _0x5267=function(_0x41c3d5,_0x1ae06e){_0x41c3d5=_0x41c3d5-0x0;var _0x347671=_0x2675[_0x41c3d5];return _0x347671;};'use strict';var Sequelize=require(_0x5267('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5267('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5267('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x5267('0x2')),'get':function(){try{return JSON[_0x5267('0x3')](this['getDataValue'](_0x5267('0x4')));}catch(_0xf2b350){return[];}},'set':function(_0x4bd042){try{this[_0x5267('0x5')](_0x5267('0x4'),JSON[_0x5267('0x6')](_0x4bd042));}catch(_0x527c16){this[_0x5267('0x5')](_0x5267('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5267('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5267('0x7')]},'col':{'type':Sequelize[_0x5267('0x7')]},'background':{'type':Sequelize[_0x5267('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5267('0x1')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5267('0x1')]},'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 2efc3a2..8806f54 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 _0x2b29=['count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','model','rawAttributes','query','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','DashboardItem','catch','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x51360f,_0x55ecff){var _0x381786=function(_0x11f562){while(--_0x11f562){_0x51360f['push'](_0x51360f['shift']());}};_0x381786(++_0x55ecff);}(_0x2b29,0x163));var _0x92b2=function(_0x5b473a,_0x39bf7b){_0x5b473a=_0x5b473a-0x0;var _0x47fe6a=_0x2b29[_0x5b473a];return _0x47fe6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92b2('0x0'));var zipdir=require(_0x92b2('0x1'));var jsonpatch=require(_0x92b2('0x2'));var rp=require(_0x92b2('0x3'));var moment=require('moment');var BPromise=require(_0x92b2('0x4'));var Mustache=require(_0x92b2('0x5'));var util=require(_0x92b2('0x6'));var path=require(_0x92b2('0x7'));var sox=require(_0x92b2('0x8'));var csv=require(_0x92b2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x92b2('0xa'));var _=require('lodash');var squel=require(_0x92b2('0xb'));var crypto=require(_0x92b2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x92b2('0xd'));var toCsv=require(_0x92b2('0x9'));var querystring=require(_0x92b2('0xe'));var Papa=require(_0x92b2('0xf'));var Redis=require('ioredis');var authService=require(_0x92b2('0x10'));var qs=require(_0x92b2('0x11'));var as=require(_0x92b2('0x12'));var hardwareService=require(_0x92b2('0x13'));var logger=require(_0x92b2('0x14'))(_0x92b2('0x15'));var utils=require(_0x92b2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x92b2('0x17'));var db=require(_0x92b2('0x18'))['db'];config[_0x92b2('0x19')]=_['defaults'](config[_0x92b2('0x19')],{'host':_0x92b2('0x1a'),'port':0x18eb});var socket=require(_0x92b2('0x1b'))(new Redis(config[_0x92b2('0x19')]));require(_0x92b2('0x1c'))[_0x92b2('0x1d')](socket);function respondWithStatusCode(_0x52ef07,_0x11e175){_0x11e175=_0x11e175||0xcc;return function(_0x5c42b5){if(_0x5c42b5){return _0x52ef07[_0x92b2('0x1e')](_0x11e175);}return _0x52ef07[_0x92b2('0x1f')](_0x11e175)[_0x92b2('0x20')]();};}function respondWithResult(_0x4899fa,_0x5cbb30){_0x5cbb30=_0x5cbb30||0xc8;return function(_0xbb9cef){if(_0xbb9cef){return _0x4899fa['status'](_0x5cbb30)[_0x92b2('0x21')](_0xbb9cef);}};}function respondWithFilteredResult(_0x4d51db,_0x42872b){return function(_0x1a7866){if(_0x1a7866){var _0x39d811=typeof _0x42872b[_0x92b2('0x22')]===_0x92b2('0x23')&&typeof _0x42872b[_0x92b2('0x24')]===_0x92b2('0x23');var _0x692704=_0x1a7866[_0x92b2('0x25')];var _0xa08831=_0x39d811?0x0:_0x42872b[_0x92b2('0x22')];var _0x3bdda8=_0x39d811?_0x1a7866[_0x92b2('0x25')]:_0x42872b[_0x92b2('0x22')]+_0x42872b[_0x92b2('0x24')];var _0x4d2850;if(_0x3bdda8>=_0x692704){_0x3bdda8=_0x692704;_0x4d2850=0xc8;}else{_0x4d2850=0xce;}_0x4d51db[_0x92b2('0x1f')](_0x4d2850);return _0x4d51db['set'](_0x92b2('0x26'),_0xa08831+'-'+_0x3bdda8+'/'+_0x692704)[_0x92b2('0x21')](_0x1a7866);}return null;};}function patchUpdates(_0x2b372c){return function(_0x1e09b6){try{jsonpatch[_0x92b2('0x27')](_0x1e09b6,_0x2b372c,!![]);}catch(_0x574c3e){return BPromise['reject'](_0x574c3e);}return _0x1e09b6[_0x92b2('0x28')]();};}function saveUpdates(_0x31567c,_0x8ed58d){return function(_0x386a80){if(_0x386a80){return _0x386a80[_0x92b2('0x29')](_0x31567c)[_0x92b2('0x2a')](function(_0x15faf5){return _0x15faf5;});}return null;};}function removeEntity(_0x49b81e,_0xbbbfa7){return function(_0x573df3){if(_0x573df3){return _0x573df3[_0x92b2('0x2b')]()['then'](function(){_0x49b81e[_0x92b2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9688,_0x105270){return function(_0x2d707f){if(!_0x2d707f){_0x5e9688[_0x92b2('0x1e')](0x194);}return _0x2d707f;};}function handleError(_0x5a874e,_0x9314e3){_0x9314e3=_0x9314e3||0x1f4;return function(_0x482706){logger[_0x92b2('0x2c')](_0x482706[_0x92b2('0x2d')]);if(_0x482706[_0x92b2('0x2e')]){delete _0x482706[_0x92b2('0x2e')];}_0x5a874e[_0x92b2('0x1f')](_0x9314e3)[_0x92b2('0x2f')](_0x482706);};}exports[_0x92b2('0x30')]=function(_0x515a62,_0x4dda21){var _0x5efa2b={'raw':![],'where':{'id':_0x515a62[_0x92b2('0x31')]['id']}},_0xd240ec={};_0xd240ec[_0x92b2('0x32')]=_['keys'](db['DashboardItem'][_0x92b2('0x33')]);_0xd240ec[_0x92b2('0x34')]=_[_0x92b2('0x35')](_0x515a62[_0x92b2('0x34')]);_0xd240ec[_0x92b2('0x36')]=_['intersection'](_0xd240ec['model'],_0xd240ec['query']);_0x5efa2b[_0x92b2('0x37')]=_[_0x92b2('0x38')](_0xd240ec['model'],qs[_0x92b2('0x39')](_0x515a62[_0x92b2('0x34')][_0x92b2('0x39')]));_0x5efa2b[_0x92b2('0x37')]=_0x5efa2b[_0x92b2('0x37')][_0x92b2('0x3a')]?_0x5efa2b[_0x92b2('0x37')]:_0xd240ec[_0x92b2('0x32')];if(_0x515a62['query'][_0x92b2('0x3b')]){_0x5efa2b[_0x92b2('0x3c')]=[{'all':!![]}];}_0x5efa2b=_[_0x92b2('0x3d')]({},_0x5efa2b,_0x515a62['options']);return db[_0x92b2('0x3e')]['find'](_0x5efa2b)[_0x92b2('0x2a')](handleEntityNotFound(_0x4dda21,null))[_0x92b2('0x2a')](respondWithResult(_0x4dda21,null))['catch'](handleError(_0x4dda21,null));};exports['destroy']=function(_0x119d4c,_0xc6730b){return db['DashboardItem']['find']({'where':{'id':_0x119d4c[_0x92b2('0x31')]['id']}})[_0x92b2('0x2a')](handleEntityNotFound(_0xc6730b,null))['then'](removeEntity(_0xc6730b,null))[_0x92b2('0x3f')](handleError(_0xc6730b,null));};function widgetAttributes(_0x111eca){try{switch(_0x111eca[_0x92b2('0x40')]){case'iframe':return[{'name':_0x92b2('0x41'),'value':_0x111eca['attrUrl']||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x0]?_0x111eca[_0x92b2('0x42')][0x0][_0x92b2('0x43')]:undefined)||_0x92b2('0x44')}];case _0x92b2('0x45'):return[{'name':'attrPath','value':_0x111eca[_0x92b2('0x46')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca['attrs'][0x0]?_0x111eca[_0x92b2('0x42')][0x0][_0x92b2('0x43')]:undefined)||''}];case _0x92b2('0x47'):return[{'name':_0x92b2('0x48'),'value':_0x111eca[_0x92b2('0x48')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x0]?_0x111eca['attrs'][0x0][_0x92b2('0x43')]:undefined)||'HH:mm:ss'},{'name':_0x92b2('0x49'),'value':_0x111eca['attrTimezone']||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x1]?_0x111eca[_0x92b2('0x42')][0x1]['value']:undefined)||_0x92b2('0x4a')},{'name':_0x92b2('0x4b'),'value':_0x111eca[_0x92b2('0x4b')]||(_0x111eca['attrs']&&_0x111eca[_0x92b2('0x42')][0x2]?_0x111eca[_0x92b2('0x42')][0x2][_0x92b2('0x43')]:undefined)||0xc}];case _0x92b2('0x4c'):return[{'name':'attrMetric','value':_0x111eca['attrMetric']||(_0x111eca['attrs']&&_0x111eca[_0x92b2('0x42')][0x0]?_0x111eca[_0x92b2('0x42')][0x0][_0x92b2('0x43')]:undefined)||'total'},{'name':_0x92b2('0x4d'),'value':_0x111eca['attrVoiceQueues']||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x1]?_0x111eca[_0x92b2('0x42')][0x1][_0x92b2('0x43')]:undefined)||[]},{'name':_0x92b2('0x4b'),'value':_0x111eca[_0x92b2('0x4b')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x2]?_0x111eca[_0x92b2('0x42')][0x2][_0x92b2('0x43')]:undefined)||0x14},{'name':_0x92b2('0x4e'),'value':_0x111eca[_0x92b2('0x4e')]||(_0x111eca['attrs']&&_0x111eca[_0x92b2('0x42')][0x3]?_0x111eca['attrs'][0x3][_0x92b2('0x43')]:undefined)||'voice'},{'name':_0x92b2('0x4f'),'value':_0x111eca[_0x92b2('0x4f')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca['attrs'][0x4]?_0x111eca[_0x92b2('0x42')][0x4]['value']:undefined)||''},{'name':_0x92b2('0x50'),'value':_0x111eca[_0x92b2('0x50')]||(_0x111eca['attrs']&&_0x111eca[_0x92b2('0x42')][0x5]?_0x111eca[_0x92b2('0x42')][0x5][_0x92b2('0x43')]:undefined)||''},{'name':_0x92b2('0x51'),'value':_0x111eca[_0x92b2('0x51')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x6]?_0x111eca[_0x92b2('0x42')][0x6][_0x92b2('0x43')]:undefined)||''},{'name':_0x92b2('0x52'),'value':_0x111eca[_0x92b2('0x52')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x7]?_0x111eca[_0x92b2('0x42')][0x7]['value']:undefined)||''},{'name':_0x92b2('0x53'),'value':_0x111eca[_0x92b2('0x53')]||(_0x111eca['attrs']&&_0x111eca['attrs'][0x8]?_0x111eca['attrs'][0x8][_0x92b2('0x43')]:undefined)||''},{'name':_0x92b2('0x54'),'value':_0x111eca['attrChatWebsites']||(_0x111eca['attrs']&&_0x111eca['attrs'][0x9]?_0x111eca[_0x92b2('0x42')][0x9][_0x92b2('0x43')]:undefined)||''}];case _0x92b2('0x55'):case _0x92b2('0x56'):return[{'name':_0x92b2('0x57'),'value':_0x111eca[_0x92b2('0x57')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x0]?_0x111eca['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x92b2('0x58'),'value':_0x111eca['attrSerie2']||(_0x111eca[_0x92b2('0x42')]&&_0x111eca['attrs'][0x1]?_0x111eca[_0x92b2('0x42')][0x1][_0x92b2('0x43')]:undefined)||null},{'name':_0x92b2('0x59'),'value':_0x111eca[_0x92b2('0x59')]||(_0x111eca['attrs']&&_0x111eca[_0x92b2('0x42')][0x2]?_0x111eca[_0x92b2('0x42')][0x2][_0x92b2('0x43')]:undefined)||null},{'name':_0x92b2('0x4d'),'value':_0x111eca[_0x92b2('0x4d')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x3]?_0x111eca[_0x92b2('0x42')][0x3][_0x92b2('0x43')]:undefined)||[]},{'name':_0x92b2('0x4e'),'value':_0x111eca[_0x92b2('0x4e')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x4]?_0x111eca[_0x92b2('0x42')][0x4][_0x92b2('0x43')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x111eca[_0x92b2('0x4f')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x5]?_0x111eca['attrs'][0x5][_0x92b2('0x43')]:undefined)||''},{'name':_0x92b2('0x50'),'value':_0x111eca[_0x92b2('0x50')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x6]?_0x111eca[_0x92b2('0x42')][0x6][_0x92b2('0x43')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x111eca[_0x92b2('0x51')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x7]?_0x111eca['attrs'][0x7][_0x92b2('0x43')]:undefined)||''},{'name':_0x92b2('0x52'),'value':_0x111eca['attrOpenchannelAccounts']||(_0x111eca['attrs']&&_0x111eca[_0x92b2('0x42')][0x8]?_0x111eca[_0x92b2('0x42')][0x8]['value']:undefined)||''},{'name':_0x92b2('0x53'),'value':_0x111eca[_0x92b2('0x53')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x9]?_0x111eca[_0x92b2('0x42')][0x9][_0x92b2('0x43')]:undefined)||''},{'name':_0x92b2('0x54'),'value':_0x111eca[_0x92b2('0x54')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0xa]?_0x111eca['attrs'][0xa][_0x92b2('0x43')]:undefined)||''}];case _0x92b2('0x5a'):return[{'name':_0x92b2('0x5b'),'type':_0x111eca[_0x92b2('0x5c')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca['attrs'][0x0]?_0x111eca['attrs'][0x0][_0x92b2('0x40')]:undefined)||null,'value':_0x111eca[_0x92b2('0x5b')]||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x0]?_0x111eca[_0x92b2('0x42')][0x0][_0x92b2('0x43')]:undefined)||null},{'name':_0x92b2('0x5d'),'value':_0x111eca['attrRefresh']||(_0x111eca[_0x92b2('0x42')]&&_0x111eca[_0x92b2('0x42')][0x1]?_0x111eca['attrs'][0x1][_0x92b2('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x545872){logger[_0x92b2('0x2c')](_0x92b2('0x5e'),JSON[_0x92b2('0x5f')](_0x545872));return[];}}exports['create']=function(_0x4b2036,_0x1fa5cb){if(_0x4b2036['body']){_0x4b2036['body'][_0x92b2('0x42')]=widgetAttributes(_0x4b2036[_0x92b2('0x60')]);}return db[_0x92b2('0x3e')][_0x92b2('0x61')](_0x4b2036[_0x92b2('0x60')],{})[_0x92b2('0x2a')](respondWithResult(_0x1fa5cb,0xc9))[_0x92b2('0x3f')](handleError(_0x1fa5cb,null));};exports['update']=function(_0x3ba3ca,_0x407b80){if(_0x3ba3ca['body']['id']){delete _0x3ba3ca[_0x92b2('0x60')]['id'];}_0x3ba3ca[_0x92b2('0x60')][_0x92b2('0x42')]=widgetAttributes(_0x3ba3ca[_0x92b2('0x60')]);return db[_0x92b2('0x3e')]['find']({'where':{'id':_0x3ba3ca[_0x92b2('0x31')]['id']}})[_0x92b2('0x2a')](handleEntityNotFound(_0x407b80,null))['then'](saveUpdates(_0x3ba3ca[_0x92b2('0x60')],null))[_0x92b2('0x2a')](respondWithResult(_0x407b80,null))[_0x92b2('0x3f')](handleError(_0x407b80,null));}; \ No newline at end of file +var _0x9bb8=['attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','pie-chart','total','attrSerie3','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','catch','find','eml-format','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','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','merge','options','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts'];(function(_0x3bab18,_0x53d735){var _0x12585f=function(_0x6cb5c4){while(--_0x6cb5c4){_0x3bab18['push'](_0x3bab18['shift']());}};_0x12585f(++_0x53d735);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x89bb('0x0'));var rimraf=require(_0x89bb('0x1'));var zipdir=require(_0x89bb('0x2'));var jsonpatch=require(_0x89bb('0x3'));var rp=require(_0x89bb('0x4'));var moment=require(_0x89bb('0x5'));var BPromise=require(_0x89bb('0x6'));var Mustache=require(_0x89bb('0x7'));var util=require(_0x89bb('0x8'));var path=require(_0x89bb('0x9'));var sox=require(_0x89bb('0xa'));var csv=require(_0x89bb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89bb('0xc'));var _=require(_0x89bb('0xd'));var squel=require(_0x89bb('0xe'));var crypto=require(_0x89bb('0xf'));var jsforce=require(_0x89bb('0x10'));var deskjs=require(_0x89bb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x89bb('0x12'));var Papa=require(_0x89bb('0x13'));var Redis=require('ioredis');var authService=require(_0x89bb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x89bb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x89bb('0x16'))('api');var utils=require(_0x89bb('0x17'));var config=require(_0x89bb('0x18'));var licenseUtil=require(_0x89bb('0x19'));var db=require(_0x89bb('0x1a'))['db'];config['redis']=_[_0x89bb('0x1b')](config[_0x89bb('0x1c')],{'host':_0x89bb('0x1d'),'port':0x18eb});var socket=require(_0x89bb('0x1e'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x89bb('0x1f')](socket);function respondWithStatusCode(_0x2de474,_0x25cbb9){_0x25cbb9=_0x25cbb9||0xcc;return function(_0x228056){if(_0x228056){return _0x2de474[_0x89bb('0x20')](_0x25cbb9);}return _0x2de474[_0x89bb('0x21')](_0x25cbb9)['end']();};}function respondWithResult(_0x8b96d,_0x14def2){_0x14def2=_0x14def2||0xc8;return function(_0x5a45c8){if(_0x5a45c8){return _0x8b96d[_0x89bb('0x21')](_0x14def2)[_0x89bb('0x22')](_0x5a45c8);}};}function respondWithFilteredResult(_0x1ff3b5,_0x39fac5){return function(_0x310e3d){if(_0x310e3d){var _0x58f826=typeof _0x39fac5[_0x89bb('0x23')]===_0x89bb('0x24')&&typeof _0x39fac5[_0x89bb('0x25')]===_0x89bb('0x24');var _0x6dd873=_0x310e3d[_0x89bb('0x26')];var _0x41880f=_0x58f826?0x0:_0x39fac5[_0x89bb('0x23')];var _0x239657=_0x58f826?_0x310e3d[_0x89bb('0x26')]:_0x39fac5['offset']+_0x39fac5[_0x89bb('0x25')];var _0x3b8dc4;if(_0x239657>=_0x6dd873){_0x239657=_0x6dd873;_0x3b8dc4=0xc8;}else{_0x3b8dc4=0xce;}_0x1ff3b5[_0x89bb('0x21')](_0x3b8dc4);return _0x1ff3b5[_0x89bb('0x27')](_0x89bb('0x28'),_0x41880f+'-'+_0x239657+'/'+_0x6dd873)[_0x89bb('0x22')](_0x310e3d);}return null;};}function patchUpdates(_0x4f2f49){return function(_0x38d1f7){try{jsonpatch[_0x89bb('0x29')](_0x38d1f7,_0x4f2f49,!![]);}catch(_0x3e6f3d){return BPromise[_0x89bb('0x2a')](_0x3e6f3d);}return _0x38d1f7[_0x89bb('0x2b')]();};}function saveUpdates(_0x7fec2c,_0x141e70){return function(_0x308726){if(_0x308726){return _0x308726[_0x89bb('0x2c')](_0x7fec2c)[_0x89bb('0x2d')](function(_0x4c25f6){return _0x4c25f6;});}return null;};}function removeEntity(_0x59fac8,_0x22ef81){return function(_0x1597b2){if(_0x1597b2){return _0x1597b2[_0x89bb('0x2e')]()[_0x89bb('0x2d')](function(){_0x59fac8[_0x89bb('0x21')](0xcc)[_0x89bb('0x2f')]();});}};}function handleEntityNotFound(_0x5082af,_0x8ef56d){return function(_0x34b852){if(!_0x34b852){_0x5082af[_0x89bb('0x20')](0x194);}return _0x34b852;};}function handleError(_0x372103,_0x26403f){_0x26403f=_0x26403f||0x1f4;return function(_0x4fc489){logger[_0x89bb('0x30')](_0x4fc489[_0x89bb('0x31')]);if(_0x4fc489[_0x89bb('0x32')]){delete _0x4fc489['name'];}_0x372103[_0x89bb('0x21')](_0x26403f)[_0x89bb('0x33')](_0x4fc489);};}exports[_0x89bb('0x34')]=function(_0x1f2a2e,_0x56284d){var _0x40c0d2={'raw':![],'where':{'id':_0x1f2a2e[_0x89bb('0x35')]['id']}},_0x577515={};_0x577515[_0x89bb('0x36')]=_['keys'](db[_0x89bb('0x37')][_0x89bb('0x38')]);_0x577515[_0x89bb('0x39')]=_[_0x89bb('0x3a')](_0x1f2a2e[_0x89bb('0x39')]);_0x577515['filters']=_[_0x89bb('0x3b')](_0x577515[_0x89bb('0x36')],_0x577515[_0x89bb('0x39')]);_0x40c0d2[_0x89bb('0x3c')]=_['intersection'](_0x577515[_0x89bb('0x36')],qs[_0x89bb('0x3d')](_0x1f2a2e[_0x89bb('0x39')]['fields']));_0x40c0d2[_0x89bb('0x3c')]=_0x40c0d2[_0x89bb('0x3c')][_0x89bb('0x3e')]?_0x40c0d2[_0x89bb('0x3c')]:_0x577515[_0x89bb('0x36')];if(_0x1f2a2e[_0x89bb('0x39')][_0x89bb('0x3f')]){_0x40c0d2[_0x89bb('0x40')]=[{'all':!![]}];}_0x40c0d2=_[_0x89bb('0x41')]({},_0x40c0d2,_0x1f2a2e[_0x89bb('0x42')]);return db[_0x89bb('0x37')]['find'](_0x40c0d2)[_0x89bb('0x2d')](handleEntityNotFound(_0x56284d,null))[_0x89bb('0x2d')](respondWithResult(_0x56284d,null))['catch'](handleError(_0x56284d,null));};exports[_0x89bb('0x2e')]=function(_0x1c6f7f,_0x5761b3){return db['DashboardItem']['find']({'where':{'id':_0x1c6f7f[_0x89bb('0x35')]['id']}})['then'](handleEntityNotFound(_0x5761b3,null))['then'](removeEntity(_0x5761b3,null))['catch'](handleError(_0x5761b3,null));};function widgetAttributes(_0x3a75e1){try{switch(_0x3a75e1[_0x89bb('0x43')]){case _0x89bb('0x44'):return[{'name':'attrUrl','value':_0x3a75e1[_0x89bb('0x45')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x47')]:undefined)||_0x89bb('0x48')}];case'custom':return[{'name':_0x89bb('0x49'),'value':_0x3a75e1[_0x89bb('0x49')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x47')]:undefined)||''}];case _0x89bb('0x4a'):return[{'name':_0x89bb('0x4b'),'value':_0x3a75e1[_0x89bb('0x4b')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x89bb('0x4c'),'value':_0x3a75e1[_0x89bb('0x4c')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1]['value']:undefined)||_0x89bb('0x4d')},{'name':_0x89bb('0x4e'),'value':_0x3a75e1[_0x89bb('0x4e')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x2]?_0x3a75e1['attrs'][0x2]['value']:undefined)||0xc}];case _0x89bb('0x4f'):return[{'name':_0x89bb('0x50'),'value':_0x3a75e1[_0x89bb('0x50')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x47')]:undefined)||'total'},{'name':_0x89bb('0x51'),'value':_0x3a75e1['attrVoiceQueues']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1][_0x89bb('0x47')]:undefined)||[]},{'name':_0x89bb('0x4e'),'value':_0x3a75e1[_0x89bb('0x4e')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x2]?_0x3a75e1[_0x89bb('0x46')][0x2]['value']:undefined)||0x14},{'name':_0x89bb('0x52'),'value':_0x3a75e1[_0x89bb('0x52')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x3]?_0x3a75e1['attrs'][0x3]['value']:undefined)||_0x89bb('0x53')},{'name':'attrEmailAccounts','value':_0x3a75e1[_0x89bb('0x54')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x4]?_0x3a75e1[_0x89bb('0x46')][0x4]['value']:undefined)||''},{'name':_0x89bb('0x55'),'value':_0x3a75e1[_0x89bb('0x55')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x5]?_0x3a75e1[_0x89bb('0x46')][0x5][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x56'),'value':_0x3a75e1[_0x89bb('0x56')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x6]?_0x3a75e1[_0x89bb('0x46')][0x6][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x57'),'value':_0x3a75e1['attrOpenchannelAccounts']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x7]?_0x3a75e1['attrs'][0x7][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x58'),'value':_0x3a75e1[_0x89bb('0x58')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x8]?_0x3a75e1[_0x89bb('0x46')][0x8][_0x89bb('0x47')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3a75e1['attrChatWebsites']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x9]?_0x3a75e1['attrs'][0x9][_0x89bb('0x47')]:undefined)||''}];case'multibar-chart':case _0x89bb('0x59'):return[{'name':'attrSerie1','value':_0x3a75e1['attrSerie1']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x0]?_0x3a75e1['attrs'][0x0][_0x89bb('0x47')]:undefined)||_0x89bb('0x5a')},{'name':'attrSerie2','value':_0x3a75e1['attrSerie2']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x3a75e1[_0x89bb('0x5b')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x2]?_0x3a75e1[_0x89bb('0x46')][0x2][_0x89bb('0x47')]:undefined)||null},{'name':_0x89bb('0x51'),'value':_0x3a75e1[_0x89bb('0x51')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x3]?_0x3a75e1[_0x89bb('0x46')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x3a75e1[_0x89bb('0x52')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x4]?_0x3a75e1[_0x89bb('0x46')][0x4]['value']:undefined)||'voice'},{'name':_0x89bb('0x54'),'value':_0x3a75e1[_0x89bb('0x54')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x5]?_0x3a75e1[_0x89bb('0x46')][0x5]['value']:undefined)||''},{'name':_0x89bb('0x55'),'value':_0x3a75e1['attrFaxAccounts']||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1[_0x89bb('0x46')][0x6]?_0x3a75e1['attrs'][0x6][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x56'),'value':_0x3a75e1[_0x89bb('0x56')]||(_0x3a75e1['attrs']&&_0x3a75e1['attrs'][0x7]?_0x3a75e1[_0x89bb('0x46')][0x7]['value']:undefined)||''},{'name':_0x89bb('0x57'),'value':_0x3a75e1[_0x89bb('0x57')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x8]?_0x3a75e1[_0x89bb('0x46')][0x8]['value']:undefined)||''},{'name':_0x89bb('0x58'),'value':_0x3a75e1[_0x89bb('0x58')]||(_0x3a75e1['attrs']&&_0x3a75e1['attrs'][0x9]?_0x3a75e1[_0x89bb('0x46')][0x9][_0x89bb('0x47')]:undefined)||''},{'name':_0x89bb('0x5c'),'value':_0x3a75e1[_0x89bb('0x5c')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0xa]?_0x3a75e1[_0x89bb('0x46')][0xa][_0x89bb('0x47')]:undefined)||''}];case _0x89bb('0x5d'):return[{'name':_0x89bb('0x5e'),'type':_0x3a75e1[_0x89bb('0x5f')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x0]?_0x3a75e1[_0x89bb('0x46')][0x0][_0x89bb('0x43')]:undefined)||null,'value':_0x3a75e1[_0x89bb('0x5e')]||(_0x3a75e1[_0x89bb('0x46')]&&_0x3a75e1['attrs'][0x0]?_0x3a75e1['attrs'][0x0][_0x89bb('0x47')]:undefined)||null},{'name':'attrRefresh','value':_0x3a75e1[_0x89bb('0x60')]||(_0x3a75e1['attrs']&&_0x3a75e1[_0x89bb('0x46')][0x1]?_0x3a75e1[_0x89bb('0x46')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1529a8){logger[_0x89bb('0x30')](_0x89bb('0x61'),JSON[_0x89bb('0x62')](_0x1529a8));return[];}}exports[_0x89bb('0x63')]=function(_0x2a186e,_0x110345){if(_0x2a186e[_0x89bb('0x64')]){_0x2a186e[_0x89bb('0x64')][_0x89bb('0x46')]=widgetAttributes(_0x2a186e[_0x89bb('0x64')]);}return db[_0x89bb('0x37')][_0x89bb('0x63')](_0x2a186e[_0x89bb('0x64')],{})[_0x89bb('0x2d')](respondWithResult(_0x110345,0xc9))[_0x89bb('0x65')](handleError(_0x110345,null));};exports['update']=function(_0x2e3373,_0x3a5187){if(_0x2e3373[_0x89bb('0x64')]['id']){delete _0x2e3373[_0x89bb('0x64')]['id'];}_0x2e3373[_0x89bb('0x64')][_0x89bb('0x46')]=widgetAttributes(_0x2e3373[_0x89bb('0x64')]);return db[_0x89bb('0x37')][_0x89bb('0x66')]({'where':{'id':_0x2e3373[_0x89bb('0x35')]['id']}})['then'](handleEntityNotFound(_0x3a5187,null))[_0x89bb('0x2d')](saveUpdates(_0x2e3373[_0x89bb('0x64')],null))[_0x89bb('0x2d')](respondWithResult(_0x3a5187,null))[_0x89bb('0x65')](handleError(_0x3a5187,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index b561bf5..3bb8843 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 _0x6512=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x6512,0x141));var _0x2651=function(_0x1559d8,_0x45db02){_0x1559d8=_0x1559d8-0x0;var _0x138d93=_0x6512[_0x1559d8];return _0x138d93;};'use strict';var EventEmitter=require(_0x2651('0x0'));var DashboardItem=require(_0x2651('0x1'))['db'][_0x2651('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2651('0x3')](0x0);var events={'afterCreate':_0x2651('0x4'),'afterUpdate':'update','afterDestroy':_0x2651('0x5')};function emitEvent(_0x4352a7){return function(_0x4cb043,_0x439401,_0x95d401){DashboardItemEvents['emit'](_0x4352a7+':'+_0x4cb043['id'],_0x4cb043);DashboardItemEvents[_0x2651('0x6')](_0x4352a7,_0x4cb043);_0x95d401(null);};}for(var e in events){if(events[_0x2651('0x7')](e)){var event=events[e];DashboardItem[_0x2651('0x8')](e,emitEvent(event));}}module[_0x2651('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x7764=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5c854f,_0x557516){var _0x5e1f97=function(_0x524ecc){while(--_0x524ecc){_0x5c854f['push'](_0x5c854f['shift']());}};_0x5e1f97(++_0x557516);}(_0x7764,0x120));var _0x4776=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7764[_0x40bffc];return _0x3007e9;};'use strict';var EventEmitter=require(_0x4776('0x0'));var DashboardItem=require(_0x4776('0x1'))['db'][_0x4776('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4776('0x3')](0x0);var events={'afterCreate':_0x4776('0x4'),'afterUpdate':_0x4776('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5c4442){return function(_0x54c34c,_0x37c97a,_0x4150fa){DashboardItemEvents[_0x4776('0x6')](_0x5c4442+':'+_0x54c34c['id'],_0x54c34c);DashboardItemEvents[_0x4776('0x6')](_0x5c4442,_0x54c34c);_0x4150fa(null);};}for(var e in events){if(events[_0x4776('0x7')](e)){var event=events[e];DashboardItem[_0x4776('0x8')](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 2d22f97..4dce35d 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 _0x6e82=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c0ea7,_0x9485d3){var _0x52c6bb=function(_0x45b130){while(--_0x45b130){_0x3c0ea7['push'](_0x3c0ea7['shift']());}};_0x52c6bb(++_0x9485d3);}(_0x6e82,0x1a7));var _0x26e8=function(_0x2e1aa2,_0x72bfb2){_0x2e1aa2=_0x2e1aa2-0x0;var _0x13188a=_0x6e82[_0x2e1aa2];return _0x13188a;};'use strict';var _=require('lodash');var util=require(_0x26e8('0x0'));var logger=require(_0x26e8('0x1'))(_0x26e8('0x2'));var moment=require(_0x26e8('0x3'));var BPromise=require(_0x26e8('0x4'));var rp=require(_0x26e8('0x5'));var fs=require('fs');var path=require(_0x26e8('0x6'));var rimraf=require(_0x26e8('0x7'));var config=require(_0x26e8('0x8'));var attributes=require(_0x26e8('0x9'));module[_0x26e8('0xa')]=function(_0x56a7e3,_0x4c287a){return _0x56a7e3[_0x26e8('0xb')](_0x26e8('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d86=['dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0xc81ca7,_0xb90d5){var _0x366401=function(_0x181f0a){while(--_0x181f0a){_0xc81ca7['push'](_0xc81ca7['shift']());}};_0x366401(++_0xb90d5);}(_0x9d86,0x1a5));var _0x69d8=function(_0xc8fdb7,_0x161dc0){_0xc8fdb7=_0xc8fdb7-0x0;var _0x29632b=_0x9d86[_0xc8fdb7];return _0x29632b;};'use strict';var _=require(_0x69d8('0x0'));var util=require(_0x69d8('0x1'));var logger=require(_0x69d8('0x2'))(_0x69d8('0x3'));var moment=require(_0x69d8('0x4'));var BPromise=require(_0x69d8('0x5'));var rp=require(_0x69d8('0x6'));var fs=require('fs');var path=require(_0x69d8('0x7'));var rimraf=require(_0x69d8('0x8'));var config=require(_0x69d8('0x9'));var attributes=require(_0x69d8('0xa'));module[_0x69d8('0xb')]=function(_0x148ceb,_0xd5bb14){return _0x148ceb[_0x69d8('0xc')]('DashboardItem',attributes,{'tableName':_0x69d8('0xd'),'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 8616bf9..7ef7e06 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 _0xca32=['error','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xca32,0x81));var _0x2ca3=function(_0x413ac5,_0x3d68ae){_0x413ac5=_0x413ac5-0x0;var _0x4ef88e=_0xca32[_0x413ac5];return _0x4ef88e;};'use strict';var _=require(_0x2ca3('0x0'));var util=require(_0x2ca3('0x1'));var moment=require(_0x2ca3('0x2'));var BPromise=require(_0x2ca3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ca3('0x4'))['db'];var utils=require(_0x2ca3('0x5'));var logger=require(_0x2ca3('0x6'))(_0x2ca3('0x7'));var config=require(_0x2ca3('0x8'));var jayson=require(_0x2ca3('0x9'));var client=jayson[_0x2ca3('0xa')][_0x2ca3('0xb')]({'port':0x232a});config[_0x2ca3('0xc')]=_['defaults'](config[_0x2ca3('0xc')],{'host':_0x2ca3('0xd'),'port':0x18eb});var socket=require(_0x2ca3('0xe'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x2ca3('0xf')](socket);function respondWithRpcPromise(_0x1f0f64,_0x24f2f1,_0x2cfe99){return new BPromise(function(_0x15f4b5,_0x14394c){return client[_0x2ca3('0x10')](_0x1f0f64,_0x2cfe99)['then'](function(_0x53ff46){logger[_0x2ca3('0x11')]('DashboardItem,\x20%s,\x20%s',_0x24f2f1,_0x2ca3('0x12'));logger[_0x2ca3('0x13')](_0x2ca3('0x14'),_0x24f2f1,'request\x20sent',JSON['stringify'](_0x53ff46));if(_0x53ff46[_0x2ca3('0x15')]){if(_0x53ff46[_0x2ca3('0x15')]['code']===0x1f4){logger['error'](_0x2ca3('0x16'),_0x24f2f1,_0x53ff46['error'][_0x2ca3('0x17')]);return _0x14394c(_0x53ff46['error'][_0x2ca3('0x17')]);}logger[_0x2ca3('0x15')]('DashboardItem,\x20%s,\x20%s',_0x24f2f1,_0x53ff46[_0x2ca3('0x15')][_0x2ca3('0x17')]);return _0x15f4b5(_0x53ff46['error'][_0x2ca3('0x17')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x24f2f1,'request\x20sent');_0x15f4b5(_0x53ff46['result'][_0x2ca3('0x17')]);}})[_0x2ca3('0x18')](function(_0x3dc32f){logger[_0x2ca3('0x15')](_0x2ca3('0x16'),_0x24f2f1,_0x3dc32f);_0x14394c(_0x3dc32f);});});} \ No newline at end of file +var _0x7672=['DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7672,0x13a));var _0x2767=function(_0x15fc69,_0x3e63c7){_0x15fc69=_0x15fc69-0x0;var _0x8f2ff7=_0x7672[_0x15fc69];return _0x8f2ff7;};'use strict';var _=require(_0x2767('0x0'));var util=require(_0x2767('0x1'));var moment=require('moment');var BPromise=require(_0x2767('0x2'));var rs=require(_0x2767('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2767('0x4'))['db'];var utils=require(_0x2767('0x5'));var logger=require(_0x2767('0x6'))(_0x2767('0x7'));var config=require(_0x2767('0x8'));var jayson=require(_0x2767('0x9'));var client=jayson[_0x2767('0xa')][_0x2767('0xb')]({'port':0x232a});config[_0x2767('0xc')]=_[_0x2767('0xd')](config['redis'],{'host':_0x2767('0xe'),'port':0x18eb});var socket=require(_0x2767('0xf'))(new Redis(config[_0x2767('0xc')]));require(_0x2767('0x10'))[_0x2767('0x11')](socket);function respondWithRpcPromise(_0x11a3ba,_0x3e8885,_0x573389){return new BPromise(function(_0x4f700a,_0x17c38a){return client[_0x2767('0x12')](_0x11a3ba,_0x573389)[_0x2767('0x13')](function(_0x25d2f9){logger[_0x2767('0x14')](_0x2767('0x15'),_0x3e8885,'request\x20sent');logger['debug'](_0x2767('0x16'),_0x3e8885,'request\x20sent',JSON['stringify'](_0x25d2f9));if(_0x25d2f9[_0x2767('0x17')]){if(_0x25d2f9[_0x2767('0x17')][_0x2767('0x18')]===0x1f4){logger[_0x2767('0x17')](_0x2767('0x15'),_0x3e8885,_0x25d2f9[_0x2767('0x17')][_0x2767('0x19')]);return _0x17c38a(_0x25d2f9['error'][_0x2767('0x19')]);}logger[_0x2767('0x17')]('DashboardItem,\x20%s,\x20%s',_0x3e8885,_0x25d2f9[_0x2767('0x17')][_0x2767('0x19')]);return _0x4f700a(_0x25d2f9[_0x2767('0x17')]['message']);}else{logger[_0x2767('0x14')](_0x2767('0x15'),_0x3e8885,'request\x20sent');_0x4f700a(_0x25d2f9[_0x2767('0x1a')][_0x2767('0x19')]);}})[_0x2767('0x1b')](function(_0x24e1e7){logger[_0x2767('0x17')](_0x2767('0x15'),_0x3e8885,_0x24e1e7);_0x17c38a(_0x24e1e7);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3e61f38..69512c3 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 _0x6e64=['remove','update','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6e64,0x126));var _0x46e6=function(_0x4926de,_0x1c2783){_0x4926de=_0x4926de-0x0;var _0x364f8e=_0x6e64[_0x4926de];return _0x364f8e;};'use strict';var DashboardItemEvents=require(_0x46e6('0x0'));var events=[_0x46e6('0x1'),_0x46e6('0x2'),_0x46e6('0x3')];function createListener(_0x43c98a,_0x402de6){return function(_0x27d458){_0x402de6['emit'](_0x43c98a,_0x27d458);};}function removeListener(_0x2fec3d,_0x2c35b8){return function(){DashboardItemEvents[_0x46e6('0x4')](_0x2fec3d,_0x2c35b8);};}exports[_0x46e6('0x5')]=function(_0xddff7c){for(var _0x1ae66a=0x0,_0x53c1a5=events[_0x46e6('0x6')];_0x1ae66a<_0x53c1a5;_0x1ae66a++){var _0x599fe1=events[_0x1ae66a];var _0x3fe9cc=createListener(_0x46e6('0x7')+_0x599fe1,_0xddff7c);DashboardItemEvents['on'](_0x599fe1,_0x3fe9cc);}}; \ No newline at end of file +var _0x8931=['removeListener','register','length','save','remove','update','emit'];(function(_0x4b634f,_0x4c0372){var _0x302e3c=function(_0x1e3e3f){while(--_0x1e3e3f){_0x4b634f['push'](_0x4b634f['shift']());}};_0x302e3c(++_0x4c0372);}(_0x8931,0xab));var _0x1893=function(_0x5c9d27,_0x62a242){_0x5c9d27=_0x5c9d27-0x0;var _0x2841fa=_0x8931[_0x5c9d27];return _0x2841fa;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x1893('0x0'),_0x1893('0x1'),_0x1893('0x2')];function createListener(_0xa131e7,_0x5aa25e){return function(_0x466233){_0x5aa25e[_0x1893('0x3')](_0xa131e7,_0x466233);};}function removeListener(_0x349fc2,_0x5b2fd0){return function(){DashboardItemEvents[_0x1893('0x4')](_0x349fc2,_0x5b2fd0);};}exports[_0x1893('0x5')]=function(_0x2d7175){for(var _0x429f8e=0x0,_0x34bdc8=events[_0x1893('0x6')];_0x429f8e<_0x34bdc8;_0x429f8e++){var _0x52eea3=events[_0x429f8e];var _0x2417df=createListener('dashboardItem:'+_0x52eea3,_0x2d7175);DashboardItemEvents['on'](_0x52eea3,_0x2417df);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 03a52cc..f3cf545 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 _0xe4aa=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4a688a,_0x21e1e1){var _0x244150=function(_0x4f9c5b){while(--_0x4f9c5b){_0x4a688a['push'](_0x4a688a['shift']());}};_0x244150(++_0x21e1e1);}(_0xe4aa,0x12a));var _0xae4a=function(_0x11bb33,_0x22a80e){_0x11bb33=_0x11bb33-0x0;var _0x127372=_0xe4aa[_0x11bb33];return _0x127372;};'use strict';var multer=require('multer');var util=require(_0xae4a('0x0'));var path=require(_0xae4a('0x1'));var timeout=require(_0xae4a('0x2'));var express=require(_0xae4a('0x3'));var router=express['Router']();var fs_extra=require(_0xae4a('0x4'));var auth=require(_0xae4a('0x5'));var interaction=require(_0xae4a('0x6'));var config=require(_0xae4a('0x7'));var controller=require(_0xae4a('0x8'));router['get'](_0xae4a('0x9'),auth[_0xae4a('0xa')](),controller['show']);router['post']('/',auth[_0xae4a('0xa')](),controller[_0xae4a('0xb')]);router[_0xae4a('0xc')](_0xae4a('0x9'),auth[_0xae4a('0xa')](),controller[_0xae4a('0xd')]);router[_0xae4a('0xe')]('/:id',auth[_0xae4a('0xa')](),controller['destroy']);module[_0xae4a('0xf')]=router; \ No newline at end of file +var _0x9222=['get','/:id','show','post','create','isAuthenticated','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1254e9,_0x30c989){var _0x5226fc=function(_0x1148b){while(--_0x1148b){_0x1254e9['push'](_0x1254e9['shift']());}};_0x5226fc(++_0x30c989);}(_0x9222,0x128));var _0x2922=function(_0x43d064,_0x3c6490){_0x43d064=_0x43d064-0x0;var _0x5c4de3=_0x9222[_0x43d064];return _0x5c4de3;};'use strict';var multer=require(_0x2922('0x0'));var util=require(_0x2922('0x1'));var path=require('path');var timeout=require(_0x2922('0x2'));var express=require(_0x2922('0x3'));var router=express[_0x2922('0x4')]();var fs_extra=require(_0x2922('0x5'));var auth=require(_0x2922('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2922('0x7'));var controller=require('./dashboardItem.controller');router[_0x2922('0x8')](_0x2922('0x9'),auth['isAuthenticated'](),controller[_0x2922('0xa')]);router[_0x2922('0xb')]('/',auth['isAuthenticated'](),controller[_0x2922('0xc')]);router['put'](_0x2922('0x9'),auth[_0x2922('0xd')](),controller['update']);router[_0x2922('0xe')](_0x2922('0x9'),auth[_0x2922('0xd')](),controller['destroy']);module[_0x2922('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 39d2975..21bebbd 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 _0x0f28=['ENUM','second','third','first'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0x0f28,0x198));var _0x80f2=function(_0x1c443f,_0x51319d){_0x1c443f=_0x1c443f-0x0;var _0x4a4a71=_0x0f28[_0x1c443f];return _0x4a4a71;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x80f2('0x0')]('first',_0x80f2('0x1'),_0x80f2('0x2')),'allowNull':![],'defaultValue':_0x80f2('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x25fe=['third','sequelize','STRING','first'];(function(_0x11686f,_0x33dceb){var _0x1866ec=function(_0x1a9f7d){while(--_0x1a9f7d){_0x11686f['push'](_0x11686f['shift']());}};_0x1866ec(++_0x33dceb);}(_0x25fe,0x1c1));var _0xe25f=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x25fe[_0x4a6cf8];return _0x22205e;};'use strict';var Sequelize=require(_0xe25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xe25f('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xe25f('0x2'),'second',_0xe25f('0x3')),'allowNull':![],'defaultValue':_0xe25f('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 9374ca0..b957d3c 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 _0x7278=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0x7278,0x161));var _0x8727=function(_0x3e4191,_0x38323a){_0x3e4191=_0x3e4191-0x0;var _0x4d54d2=_0x7278[_0x3e4191];return _0x4d54d2;};'use strict';var emlformat=require(_0x8727('0x0'));var rimraf=require(_0x8727('0x1'));var zipdir=require(_0x8727('0x2'));var jsonpatch=require(_0x8727('0x3'));var rp=require(_0x8727('0x4'));var moment=require('moment');var BPromise=require(_0x8727('0x5'));var Mustache=require(_0x8727('0x6'));var util=require(_0x8727('0x7'));var path=require(_0x8727('0x8'));var sox=require(_0x8727('0x9'));var csv=require(_0x8727('0xa'));var ejs=require(_0x8727('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8727('0xc'));var squel=require(_0x8727('0xd'));var crypto=require(_0x8727('0xe'));var jsforce=require(_0x8727('0xf'));var deskjs=require(_0x8727('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8727('0x11'));var authService=require(_0x8727('0x12'));var qs=require(_0x8727('0x13'));var as=require(_0x8727('0x14'));var hardwareService=require(_0x8727('0x15'));var logger=require(_0x8727('0x16'))(_0x8727('0x17'));var utils=require(_0x8727('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8727('0x19'));var db=require(_0x8727('0x1a'))['db'];function respondWithStatusCode(_0x176389,_0x518e56){_0x518e56=_0x518e56||0xcc;return function(_0x22d03d){if(_0x22d03d){return _0x176389[_0x8727('0x1b')](_0x518e56);}return _0x176389['status'](_0x518e56)[_0x8727('0x1c')]();};}function respondWithResult(_0x3aa1b,_0x47c29d){_0x47c29d=_0x47c29d||0xc8;return function(_0x2185e5){if(_0x2185e5){return _0x3aa1b[_0x8727('0x1d')](_0x47c29d)[_0x8727('0x1e')](_0x2185e5);}};}function respondWithFilteredResult(_0x3865e9,_0x1916f7){return function(_0x11c828){if(_0x11c828){var _0x88857c=typeof _0x1916f7['offset']===_0x8727('0x1f')&&typeof _0x1916f7[_0x8727('0x20')]===_0x8727('0x1f');var _0x2f6e1d=_0x11c828[_0x8727('0x21')];var _0xba0af5=_0x88857c?0x0:_0x1916f7['offset'];var _0x575d29=_0x88857c?_0x11c828[_0x8727('0x21')]:_0x1916f7['offset']+_0x1916f7[_0x8727('0x20')];var _0xfd266f;if(_0x575d29>=_0x2f6e1d){_0x575d29=_0x2f6e1d;_0xfd266f=0xc8;}else{_0xfd266f=0xce;}_0x3865e9[_0x8727('0x1d')](_0xfd266f);return _0x3865e9[_0x8727('0x22')](_0x8727('0x23'),_0xba0af5+'-'+_0x575d29+'/'+_0x2f6e1d)['json'](_0x11c828);}return null;};}function patchUpdates(_0x6e552f){return function(_0x286856){try{jsonpatch[_0x8727('0x24')](_0x286856,_0x6e552f,!![]);}catch(_0x1d78df){return BPromise[_0x8727('0x25')](_0x1d78df);}return _0x286856[_0x8727('0x26')]();};}function saveUpdates(_0x46d43e,_0x441cc0){return function(_0x117f58){if(_0x117f58){return _0x117f58[_0x8727('0x27')](_0x46d43e)[_0x8727('0x28')](function(_0x1a69d5){return _0x1a69d5;});}return null;};}function removeEntity(_0x4c699b,_0x464a32){return function(_0x3d3592){if(_0x3d3592){return _0x3d3592['destroy']()['then'](function(){var _0x3df7f2=_0x3d3592[_0x8727('0x29')]({'plain':!![]});var _0x15e8bf='Dispositions';return db[_0x8727('0x2a')][_0x8727('0x2b')]({'where':{'type':_0x15e8bf,'resourceId':_0x3df7f2['id']}})[_0x8727('0x28')](function(){return _0x3d3592;});})[_0x8727('0x28')](function(){_0x4c699b[_0x8727('0x1d')](0xcc)[_0x8727('0x1c')]();});}};}function handleEntityNotFound(_0x262f36,_0xd92f77){return function(_0x5d03f2){if(!_0x5d03f2){_0x262f36[_0x8727('0x1b')](0x194);}return _0x5d03f2;};}function handleError(_0x307055,_0x54034d){_0x54034d=_0x54034d||0x1f4;return function(_0x23325f){logger[_0x8727('0x2c')](_0x23325f[_0x8727('0x2d')]);if(_0x23325f[_0x8727('0x2e')]){delete _0x23325f[_0x8727('0x2e')];}_0x307055[_0x8727('0x1d')](_0x54034d)['send'](_0x23325f);};}exports[_0x8727('0x2f')]=function(_0x563201,_0x34c58e){var _0x47e9f9={},_0x44ed83={},_0x391d60={'count':0x0,'rows':[]};var _0x152a53=_[_0x8727('0x30')](db[_0x8727('0x31')][_0x8727('0x32')],function(_0x382be3){return{'name':_0x382be3['fieldName'],'type':_0x382be3[_0x8727('0x33')][_0x8727('0x34')]};});_0x44ed83[_0x8727('0x35')]=_[_0x8727('0x30')](_0x152a53,_0x8727('0x2e'));_0x44ed83[_0x8727('0x36')]=_[_0x8727('0x37')](_0x563201[_0x8727('0x36')]);_0x44ed83[_0x8727('0x38')]=_[_0x8727('0x39')](_0x44ed83[_0x8727('0x35')],_0x44ed83[_0x8727('0x36')]);_0x47e9f9['attributes']=_['intersection'](_0x44ed83[_0x8727('0x35')],qs[_0x8727('0x3a')](_0x563201[_0x8727('0x36')][_0x8727('0x3a')]));_0x47e9f9['attributes']=_0x47e9f9[_0x8727('0x3b')][_0x8727('0x3c')]?_0x47e9f9[_0x8727('0x3b')]:_0x44ed83[_0x8727('0x35')];if(!_0x563201[_0x8727('0x36')]['hasOwnProperty'](_0x8727('0x3d'))){_0x47e9f9[_0x8727('0x20')]=qs[_0x8727('0x20')](_0x563201[_0x8727('0x36')][_0x8727('0x20')]);_0x47e9f9[_0x8727('0x3e')]=qs[_0x8727('0x3e')](_0x563201[_0x8727('0x36')][_0x8727('0x3e')]);}_0x47e9f9[_0x8727('0x3f')]=qs[_0x8727('0x40')](_0x563201[_0x8727('0x36')]['sort']);_0x47e9f9[_0x8727('0x41')]=qs[_0x8727('0x38')](_[_0x8727('0x42')](_0x563201[_0x8727('0x36')],_0x44ed83[_0x8727('0x38')]),_0x152a53);if(_0x563201[_0x8727('0x36')][_0x8727('0x43')]){_0x47e9f9[_0x8727('0x41')]=_[_0x8727('0x44')](_0x47e9f9[_0x8727('0x41')],{'$or':_[_0x8727('0x30')](_0x152a53,function(_0x1f719e){if(_0x1f719e[_0x8727('0x33')]!==_0x8727('0x45')){var _0x4bb688={};_0x4bb688[_0x1f719e[_0x8727('0x2e')]]={'$like':'%'+_0x563201[_0x8727('0x36')][_0x8727('0x43')]+'%'};return _0x4bb688;}})});}_0x47e9f9=_['merge']({},_0x47e9f9,_0x563201[_0x8727('0x46')]);var _0x1a4563={'where':_0x47e9f9[_0x8727('0x41')]};return db[_0x8727('0x31')]['count'](_0x1a4563)[_0x8727('0x28')](function(_0x37e87c){_0x391d60[_0x8727('0x21')]=_0x37e87c;if(_0x563201[_0x8727('0x36')][_0x8727('0x47')]){_0x47e9f9[_0x8727('0x48')]=[{'all':!![]}];}return db[_0x8727('0x31')][_0x8727('0x49')](_0x47e9f9);})[_0x8727('0x28')](function(_0x2b5ba7){_0x391d60['rows']=_0x2b5ba7;return _0x391d60;})[_0x8727('0x28')](respondWithFilteredResult(_0x34c58e,_0x47e9f9))[_0x8727('0x4a')](handleError(_0x34c58e,null));};exports[_0x8727('0x4b')]=function(_0x338f43,_0x125de2){var _0x55aa6d={'raw':!![],'where':{'id':_0x338f43[_0x8727('0x4c')]['id']}},_0x161200={};_0x161200[_0x8727('0x35')]=_['keys'](db[_0x8727('0x31')][_0x8727('0x32')]);_0x161200[_0x8727('0x36')]=_[_0x8727('0x37')](_0x338f43[_0x8727('0x36')]);_0x161200[_0x8727('0x38')]=_['intersection'](_0x161200[_0x8727('0x35')],_0x161200[_0x8727('0x36')]);_0x55aa6d[_0x8727('0x3b')]=_['intersection'](_0x161200[_0x8727('0x35')],qs[_0x8727('0x3a')](_0x338f43[_0x8727('0x36')][_0x8727('0x3a')]));_0x55aa6d[_0x8727('0x3b')]=_0x55aa6d[_0x8727('0x3b')][_0x8727('0x3c')]?_0x55aa6d['attributes']:_0x161200[_0x8727('0x35')];if(_0x338f43[_0x8727('0x36')][_0x8727('0x47')]){_0x55aa6d[_0x8727('0x48')]=[{'all':!![]}];}_0x55aa6d=_[_0x8727('0x44')]({},_0x55aa6d,_0x338f43[_0x8727('0x46')]);return db[_0x8727('0x31')]['find'](_0x55aa6d)[_0x8727('0x28')](handleEntityNotFound(_0x125de2,null))[_0x8727('0x28')](respondWithResult(_0x125de2,null))[_0x8727('0x4a')](handleError(_0x125de2,null));};exports['create']=function(_0x30e656,_0x22cd31){return db[_0x8727('0x31')][_0x8727('0x4d')](_0x30e656[_0x8727('0x4e')],{})[_0x8727('0x28')](function(_0x417d4c){var _0x53f6c2=_0x30e656[_0x8727('0x4f')]['get']({'plain':!![]});if(!_0x53f6c2)throw new Error(_0x8727('0x50'));if(_0x53f6c2[_0x8727('0x51')]==='user'){var _0x133973=_0x417d4c[_0x8727('0x29')]({'plain':!![]});var _0xd86c46='Dispositions';return db['UserProfileSection'][_0x8727('0x52')]({'where':{'name':_0xd86c46,'userProfileId':_0x53f6c2[_0x8727('0x53')]},'raw':!![]})[_0x8727('0x28')](function(_0x527223){if(_0x527223&&_0x527223[_0x8727('0x54')]===0x0){return db[_0x8727('0x2a')][_0x8727('0x4d')]({'name':_0x133973[_0x8727('0x2e')],'resourceId':_0x133973['id'],'type':_0x527223[_0x8727('0x2e')],'sectionId':_0x527223['id']},{})[_0x8727('0x28')](function(){return _0x417d4c;});}else{return _0x417d4c;}})[_0x8727('0x4a')](function(_0x20ef63){logger['error'](_0x8727('0x55'),_0x20ef63);throw _0x20ef63;});}return _0x417d4c;})[_0x8727('0x28')](respondWithResult(_0x22cd31,0xc9))[_0x8727('0x4a')](handleError(_0x22cd31,null));};exports[_0x8727('0x27')]=function(_0x4a19a6,_0x35a086){if(_0x4a19a6[_0x8727('0x4e')]['id']){delete _0x4a19a6[_0x8727('0x4e')]['id'];}return db[_0x8727('0x31')][_0x8727('0x52')]({'where':{'id':_0x4a19a6[_0x8727('0x4c')]['id']}})[_0x8727('0x28')](handleEntityNotFound(_0x35a086,null))[_0x8727('0x28')](saveUpdates(_0x4a19a6['body'],null))[_0x8727('0x28')](respondWithResult(_0x35a086,null))[_0x8727('0x4a')](handleError(_0x35a086,null));};exports[_0x8727('0x2b')]=function(_0x47a9f0,_0x2b440d){return db['Disposition'][_0x8727('0x52')]({'where':{'id':_0x47a9f0['params']['id']}})[_0x8727('0x28')](handleEntityNotFound(_0x2b440d,null))[_0x8727('0x28')](removeEntity(_0x2b440d,null))['catch'](handleError(_0x2b440d,null));}; \ No newline at end of file +var _0x114b=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','Disposition','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2f59e3,_0x1209b3){var _0x393520=function(_0xf93809){while(--_0xf93809){_0x2f59e3['push'](_0x2f59e3['shift']());}};_0x393520(++_0x1209b3);}(_0x114b,0x1e9));var _0xb114=function(_0x123013,_0x5568d3){_0x123013=_0x123013-0x0;var _0x1caf78=_0x114b[_0x123013];return _0x1caf78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb114('0x0'));var zipdir=require(_0xb114('0x1'));var jsonpatch=require(_0xb114('0x2'));var rp=require(_0xb114('0x3'));var moment=require(_0xb114('0x4'));var BPromise=require(_0xb114('0x5'));var Mustache=require(_0xb114('0x6'));var util=require('util');var path=require(_0xb114('0x7'));var sox=require(_0xb114('0x8'));var csv=require(_0xb114('0x9'));var ejs=require(_0xb114('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb114('0xb'));var crypto=require(_0xb114('0xc'));var jsforce=require(_0xb114('0xd'));var deskjs=require(_0xb114('0xe'));var toCsv=require(_0xb114('0x9'));var querystring=require(_0xb114('0xf'));var Papa=require(_0xb114('0x10'));var Redis=require(_0xb114('0x11'));var authService=require(_0xb114('0x12'));var qs=require(_0xb114('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb114('0x14'));var logger=require(_0xb114('0x15'))(_0xb114('0x16'));var utils=require('../../config/utils');var config=require(_0xb114('0x17'));var licenseUtil=require(_0xb114('0x18'));var db=require(_0xb114('0x19'))['db'];function respondWithStatusCode(_0x23d40e,_0x4a8410){_0x4a8410=_0x4a8410||0xcc;return function(_0x5a32c1){if(_0x5a32c1){return _0x23d40e[_0xb114('0x1a')](_0x4a8410);}return _0x23d40e[_0xb114('0x1b')](_0x4a8410)[_0xb114('0x1c')]();};}function respondWithResult(_0x514efe,_0x6f587a){_0x6f587a=_0x6f587a||0xc8;return function(_0x5836aa){if(_0x5836aa){return _0x514efe['status'](_0x6f587a)[_0xb114('0x1d')](_0x5836aa);}};}function respondWithFilteredResult(_0x15db33,_0xeaab75){return function(_0x1e3238){if(_0x1e3238){var _0x7508ee=typeof _0xeaab75[_0xb114('0x1e')]===_0xb114('0x1f')&&typeof _0xeaab75[_0xb114('0x20')]===_0xb114('0x1f');var _0x29f58c=_0x1e3238[_0xb114('0x21')];var _0x152f7d=_0x7508ee?0x0:_0xeaab75[_0xb114('0x1e')];var _0x5b8062=_0x7508ee?_0x1e3238[_0xb114('0x21')]:_0xeaab75[_0xb114('0x1e')]+_0xeaab75[_0xb114('0x20')];var _0xf76fa7;if(_0x5b8062>=_0x29f58c){_0x5b8062=_0x29f58c;_0xf76fa7=0xc8;}else{_0xf76fa7=0xce;}_0x15db33[_0xb114('0x1b')](_0xf76fa7);return _0x15db33[_0xb114('0x22')](_0xb114('0x23'),_0x152f7d+'-'+_0x5b8062+'/'+_0x29f58c)[_0xb114('0x1d')](_0x1e3238);}return null;};}function patchUpdates(_0x1f83ee){return function(_0x12d66d){try{jsonpatch[_0xb114('0x24')](_0x12d66d,_0x1f83ee,!![]);}catch(_0x2c036d){return BPromise[_0xb114('0x25')](_0x2c036d);}return _0x12d66d[_0xb114('0x26')]();};}function saveUpdates(_0x41ae5a,_0x1e0e32){return function(_0x1c30a1){if(_0x1c30a1){return _0x1c30a1[_0xb114('0x27')](_0x41ae5a)[_0xb114('0x28')](function(_0x35395f){return _0x35395f;});}return null;};}function removeEntity(_0xe2ac2c,_0x5ead94){return function(_0x54032b){if(_0x54032b){return _0x54032b[_0xb114('0x29')]()[_0xb114('0x28')](function(){var _0x3a2bf2=_0x54032b[_0xb114('0x2a')]({'plain':!![]});var _0x26a203=_0xb114('0x2b');return db[_0xb114('0x2c')]['destroy']({'where':{'type':_0x26a203,'resourceId':_0x3a2bf2['id']}})[_0xb114('0x28')](function(){return _0x54032b;});})[_0xb114('0x28')](function(){_0xe2ac2c[_0xb114('0x1b')](0xcc)[_0xb114('0x1c')]();});}};}function handleEntityNotFound(_0x2a74e7,_0x21776f){return function(_0x48631c){if(!_0x48631c){_0x2a74e7[_0xb114('0x1a')](0x194);}return _0x48631c;};}function handleError(_0x4e66de,_0x5ac5eb){_0x5ac5eb=_0x5ac5eb||0x1f4;return function(_0x5cae5c){logger[_0xb114('0x2d')](_0x5cae5c[_0xb114('0x2e')]);if(_0x5cae5c[_0xb114('0x2f')]){delete _0x5cae5c[_0xb114('0x2f')];}_0x4e66de[_0xb114('0x1b')](_0x5ac5eb)[_0xb114('0x30')](_0x5cae5c);};}exports[_0xb114('0x31')]=function(_0x3f5f95,_0x234926){var _0x3cee8b={},_0x3c480f={},_0x49c4a3={'count':0x0,'rows':[]};var _0x2cf9b4=_['map'](db['Disposition'][_0xb114('0x32')],function(_0x5c8688){return{'name':_0x5c8688[_0xb114('0x33')],'type':_0x5c8688[_0xb114('0x34')][_0xb114('0x35')]};});_0x3c480f[_0xb114('0x36')]=_[_0xb114('0x37')](_0x2cf9b4,'name');_0x3c480f['query']=_[_0xb114('0x38')](_0x3f5f95[_0xb114('0x39')]);_0x3c480f[_0xb114('0x3a')]=_[_0xb114('0x3b')](_0x3c480f[_0xb114('0x36')],_0x3c480f['query']);_0x3cee8b[_0xb114('0x3c')]=_[_0xb114('0x3b')](_0x3c480f['model'],qs[_0xb114('0x3d')](_0x3f5f95['query'][_0xb114('0x3d')]));_0x3cee8b['attributes']=_0x3cee8b[_0xb114('0x3c')][_0xb114('0x3e')]?_0x3cee8b[_0xb114('0x3c')]:_0x3c480f['model'];if(!_0x3f5f95[_0xb114('0x39')]['hasOwnProperty']('nolimit')){_0x3cee8b[_0xb114('0x20')]=qs['limit'](_0x3f5f95[_0xb114('0x39')][_0xb114('0x20')]);_0x3cee8b[_0xb114('0x1e')]=qs[_0xb114('0x1e')](_0x3f5f95[_0xb114('0x39')][_0xb114('0x1e')]);}_0x3cee8b[_0xb114('0x3f')]=qs[_0xb114('0x40')](_0x3f5f95[_0xb114('0x39')][_0xb114('0x40')]);_0x3cee8b[_0xb114('0x41')]=qs['filters'](_[_0xb114('0x42')](_0x3f5f95[_0xb114('0x39')],_0x3c480f[_0xb114('0x3a')]),_0x2cf9b4);if(_0x3f5f95[_0xb114('0x39')][_0xb114('0x43')]){_0x3cee8b[_0xb114('0x41')]=_['merge'](_0x3cee8b[_0xb114('0x41')],{'$or':_[_0xb114('0x37')](_0x2cf9b4,function(_0x18d0f5){if(_0x18d0f5[_0xb114('0x34')]!=='VIRTUAL'){var _0x4fb73a={};_0x4fb73a[_0x18d0f5['name']]={'$like':'%'+_0x3f5f95['query'][_0xb114('0x43')]+'%'};return _0x4fb73a;}})});}_0x3cee8b=_[_0xb114('0x44')]({},_0x3cee8b,_0x3f5f95[_0xb114('0x45')]);var _0x5d8824={'where':_0x3cee8b[_0xb114('0x41')]};return db['Disposition'][_0xb114('0x21')](_0x5d8824)[_0xb114('0x28')](function(_0x2e0a0e){_0x49c4a3[_0xb114('0x21')]=_0x2e0a0e;if(_0x3f5f95[_0xb114('0x39')][_0xb114('0x46')]){_0x3cee8b['include']=[{'all':!![]}];}return db[_0xb114('0x47')][_0xb114('0x48')](_0x3cee8b);})[_0xb114('0x28')](function(_0x14134b){_0x49c4a3[_0xb114('0x49')]=_0x14134b;return _0x49c4a3;})[_0xb114('0x28')](respondWithFilteredResult(_0x234926,_0x3cee8b))[_0xb114('0x4a')](handleError(_0x234926,null));};exports[_0xb114('0x4b')]=function(_0x309beb,_0x2bc2ff){var _0x119127={'raw':!![],'where':{'id':_0x309beb[_0xb114('0x4c')]['id']}},_0x1f2572={};_0x1f2572['model']=_[_0xb114('0x38')](db['Disposition'][_0xb114('0x32')]);_0x1f2572[_0xb114('0x39')]=_[_0xb114('0x38')](_0x309beb[_0xb114('0x39')]);_0x1f2572[_0xb114('0x3a')]=_[_0xb114('0x3b')](_0x1f2572[_0xb114('0x36')],_0x1f2572['query']);_0x119127[_0xb114('0x3c')]=_[_0xb114('0x3b')](_0x1f2572[_0xb114('0x36')],qs[_0xb114('0x3d')](_0x309beb[_0xb114('0x39')]['fields']));_0x119127[_0xb114('0x3c')]=_0x119127['attributes']['length']?_0x119127[_0xb114('0x3c')]:_0x1f2572[_0xb114('0x36')];if(_0x309beb[_0xb114('0x39')][_0xb114('0x46')]){_0x119127[_0xb114('0x4d')]=[{'all':!![]}];}_0x119127=_[_0xb114('0x44')]({},_0x119127,_0x309beb[_0xb114('0x45')]);return db[_0xb114('0x47')][_0xb114('0x4e')](_0x119127)[_0xb114('0x28')](handleEntityNotFound(_0x2bc2ff,null))[_0xb114('0x28')](respondWithResult(_0x2bc2ff,null))[_0xb114('0x4a')](handleError(_0x2bc2ff,null));};exports[_0xb114('0x4f')]=function(_0x3e8ad1,_0x4f3a18){return db[_0xb114('0x47')][_0xb114('0x4f')](_0x3e8ad1[_0xb114('0x50')],{})[_0xb114('0x28')](function(_0x132ab9){var _0x3ca7a6=_0x3e8ad1[_0xb114('0x51')]['get']({'plain':!![]});if(!_0x3ca7a6)throw new Error(_0xb114('0x52'));if(_0x3ca7a6['role']==='user'){var _0x3947eb=_0x132ab9['get']({'plain':!![]});var _0x59da66=_0xb114('0x2b');return db[_0xb114('0x53')][_0xb114('0x4e')]({'where':{'name':_0x59da66,'userProfileId':_0x3ca7a6[_0xb114('0x54')]},'raw':!![]})[_0xb114('0x28')](function(_0x3e8cf8){if(_0x3e8cf8&&_0x3e8cf8[_0xb114('0x55')]===0x0){return db[_0xb114('0x2c')][_0xb114('0x4f')]({'name':_0x3947eb['name'],'resourceId':_0x3947eb['id'],'type':_0x3e8cf8[_0xb114('0x2f')],'sectionId':_0x3e8cf8['id']},{})['then'](function(){return _0x132ab9;});}else{return _0x132ab9;}})['catch'](function(_0x360f0a){logger['error'](_0xb114('0x56'),_0x360f0a);throw _0x360f0a;});}return _0x132ab9;})['then'](respondWithResult(_0x4f3a18,0xc9))[_0xb114('0x4a')](handleError(_0x4f3a18,null));};exports['update']=function(_0x72d60f,_0x2c893a){if(_0x72d60f['body']['id']){delete _0x72d60f[_0xb114('0x50')]['id'];}return db[_0xb114('0x47')][_0xb114('0x4e')]({'where':{'id':_0x72d60f['params']['id']}})[_0xb114('0x28')](handleEntityNotFound(_0x2c893a,null))[_0xb114('0x28')](saveUpdates(_0x72d60f[_0xb114('0x50')],null))[_0xb114('0x28')](respondWithResult(_0x2c893a,null))[_0xb114('0x4a')](handleError(_0x2c893a,null));};exports[_0xb114('0x29')]=function(_0x19533a,_0x15a7a8){return db[_0xb114('0x47')][_0xb114('0x4e')]({'where':{'id':_0x19533a[_0xb114('0x4c')]['id']}})[_0xb114('0x28')](handleEntityNotFound(_0x15a7a8,null))[_0xb114('0x28')](removeEntity(_0x15a7a8,null))[_0xb114('0x4a')](handleError(_0x15a7a8,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 5965795..b8928a1 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 _0xfd4c=['request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','WhatsappAccountId','lodash','util','api','moment','bluebird'];(function(_0x435ded,_0x1b9602){var _0x4635ec=function(_0xd4c6ec){while(--_0xd4c6ec){_0x435ded['push'](_0x435ded['shift']());}};_0x4635ec(++_0x1b9602);}(_0xfd4c,0x17b));var _0xcfd4=function(_0x5b4868,_0x5bf76e){_0x5b4868=_0x5b4868-0x0;var _0x98aff4=_0xfd4c[_0x5b4868];return _0x98aff4;};'use strict';var _=require(_0xcfd4('0x0'));var util=require(_0xcfd4('0x1'));var logger=require('../../config/logger')(_0xcfd4('0x2'));var moment=require(_0xcfd4('0x3'));var BPromise=require(_0xcfd4('0x4'));var rp=require(_0xcfd4('0x5'));var fs=require('fs');var path=require(_0xcfd4('0x6'));var rimraf=require('rimraf');var config=require(_0xcfd4('0x7'));var attributes=require(_0xcfd4('0x8'));module[_0xcfd4('0x9')]=function(_0xd1c181,_0x2fddeb){return _0xd1c181[_0xcfd4('0xa')](_0xcfd4('0xb'),attributes,{'tableName':_0xcfd4('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xcfd4('0xd'),'fields':['name',_0xcfd4('0xe')]},{'unique':!![],'name':_0xcfd4('0xf'),'fields':[_0xcfd4('0x10'),_0xcfd4('0x11')]},{'unique':!![],'name':'name_mail','fields':['name',_0xcfd4('0x12')]},{'unique':!![],'name':_0xcfd4('0x13'),'fields':[_0xcfd4('0x10'),_0xcfd4('0x14')]},{'unique':!![],'name':_0xcfd4('0x15'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xcfd4('0x16'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0xcfd4('0x10'),_0xcfd4('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4df9=['ListId','name_chat','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','tools_dispositions','name'];(function(_0x2eab2d,_0x23b7d6){var _0x1d503e=function(_0x4c6ed4){while(--_0x4c6ed4){_0x2eab2d['push'](_0x2eab2d['shift']());}};_0x1d503e(++_0x23b7d6);}(_0x4df9,0x19a));var _0x94df=function(_0x23f496,_0x9d8d75){_0x23f496=_0x23f496-0x0;var _0x5e063f=_0x4df9[_0x23f496];return _0x5e063f;};'use strict';var _=require('lodash');var util=require(_0x94df('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x94df('0x1'));var BPromise=require('bluebird');var rp=require(_0x94df('0x2'));var fs=require('fs');var path=require(_0x94df('0x3'));var rimraf=require(_0x94df('0x4'));var config=require(_0x94df('0x5'));var attributes=require(_0x94df('0x6'));module[_0x94df('0x7')]=function(_0x3a7718,_0x5bd414){return _0x3a7718['define']('Disposition',attributes,{'tableName':_0x94df('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x94df('0x9'),_0x94df('0xa')]},{'unique':!![],'name':_0x94df('0xb'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x94df('0xc'),'fields':[_0x94df('0x9'),_0x94df('0xd')]},{'unique':!![],'name':'name_sms','fields':['name',_0x94df('0xe')]},{'unique':!![],'name':_0x94df('0xf'),'fields':[_0x94df('0x9'),_0x94df('0x10')]},{'unique':!![],'name':_0x94df('0x11'),'fields':['name',_0x94df('0x12')]},{'unique':!![],'name':_0x94df('0x13'),'fields':[_0x94df('0x9'),_0x94df('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8267608..46c0787 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(_0x1cf5f6,_0x6586fc){var _0x274671=function(_0x3737db){while(--_0x3737db){_0x1cf5f6['push'](_0x1cf5f6['shift']());}};_0x274671(++_0x6586fc);}(_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 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(_0x266f01,_0x437a19){var _0x504f30=function(_0x486a55){while(--_0x486a55){_0x266f01['push'](_0x266f01['shift']());}};_0x504f30(++_0x437a19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 2f5192e..9966075 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 _0xd86d=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd86d,0xc2));var _0xdd86=function(_0x17fcbb,_0x2df7dd){_0x17fcbb=_0x17fcbb-0x0;var _0x5db25a=_0xd86d[_0x17fcbb];return _0x5db25a;};'use strict';var multer=require('multer');var util=require(_0xdd86('0x0'));var path=require(_0xdd86('0x1'));var timeout=require(_0xdd86('0x2'));var express=require(_0xdd86('0x3'));var router=express[_0xdd86('0x4')]();var fs_extra=require(_0xdd86('0x5'));var auth=require(_0xdd86('0x6'));var interaction=require(_0xdd86('0x7'));var config=require(_0xdd86('0x8'));var controller=require('./disposition.controller');router[_0xdd86('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd86('0xa')]);router['get'](_0xdd86('0xb'),auth[_0xdd86('0xc')](),controller[_0xdd86('0xd')]);router[_0xdd86('0xe')]('/',auth[_0xdd86('0xc')](),controller[_0xdd86('0xf')]);router[_0xdd86('0x10')]('/:id',auth[_0xdd86('0xc')](),controller[_0xdd86('0x11')]);router[_0xdd86('0x12')](_0xdd86('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdd86('0x13')]=router; \ No newline at end of file +var _0x9345=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5cffea,_0x44c4bf){var _0x3ce1ca=function(_0x62be98){while(--_0x62be98){_0x5cffea['push'](_0x5cffea['shift']());}};_0x3ce1ca(++_0x44c4bf);}(_0x9345,0x90));var _0x5934=function(_0xc5e02a,_0xd9da3c){_0xc5e02a=_0xc5e02a-0x0;var _0xbeca77=_0x9345[_0xc5e02a];return _0xbeca77;};'use strict';var multer=require(_0x5934('0x0'));var util=require(_0x5934('0x1'));var path=require(_0x5934('0x2'));var timeout=require(_0x5934('0x3'));var express=require(_0x5934('0x4'));var router=express[_0x5934('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5934('0x6'));var interaction=require(_0x5934('0x7'));var config=require(_0x5934('0x8'));var controller=require('./disposition.controller');router[_0x5934('0x9')]('/',auth['isAuthenticated'](),controller[_0x5934('0xa')]);router[_0x5934('0x9')](_0x5934('0xb'),auth[_0x5934('0xc')](),controller[_0x5934('0xd')]);router[_0x5934('0xe')]('/',auth[_0x5934('0xc')](),controller[_0x5934('0xf')]);router[_0x5934('0x10')]('/:id',auth[_0x5934('0xc')](),controller[_0x5934('0x11')]);router[_0x5934('0x12')]('/:id',auth[_0x5934('0xc')](),controller[_0x5934('0x13')]);module[_0x5934('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index e9f07f7..20d958f 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 _0x199c=['SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','9600','12000','14400','4800','7200','v17,v27,v29','INTEGER'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0x199c,0x1d8));var _0xc199=function(_0x1772e7,_0x3be1fa){_0x1772e7=_0x1772e7-0x0;var _0x1c475e=_0x199c[_0x1772e7];return _0x1c475e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc199('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc199('0x0')]},'ecm':{'type':Sequelize[_0xc199('0x1')](_0xc199('0x2'),'no'),'defaultValue':_0xc199('0x2')},'headerinfo':{'type':Sequelize[_0xc199('0x0')],'defaultValue':_0xc199('0x3')},'localstationid':{'type':Sequelize[_0xc199('0x0')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xc199('0x1')](_0xc199('0x4'),'4800','7200',_0xc199('0x5'),_0xc199('0x6'),_0xc199('0x7')),'defaultValue':_0xc199('0x8')},'maxrate':{'type':Sequelize[_0xc199('0x1')](_0xc199('0x4'),_0xc199('0x8'),_0xc199('0x9'),'9600',_0xc199('0x6'),_0xc199('0x7')),'defaultValue':_0xc199('0x7')},'modem':{'type':Sequelize[_0xc199('0x0')],'defaultValue':_0xc199('0xa')},'gateway':{'type':Sequelize[_0xc199('0x0')],'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[_0xc199('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc199('0x1')](_0xc199('0xc'),_0xc199('0xd'),_0xc199('0xe'),'KHOMP'),'defaultValue':_0xc199('0xc')},'key':{'type':Sequelize[_0xc199('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc199('0xf')],'defaultValue':function(){return _0xc199('0x10');}},'notificationSound':{'type':Sequelize[_0xc199('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc199('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc199('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc199('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc199('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc199('0x11')],'defaultValue':![],'comment':_0xc199('0x12'),'set':function(_0x5ee3f8){if(!_0x5ee3f8)this[_0xc199('0x13')](_0xc199('0x14'),null);this[_0xc199('0x13')](_0xc199('0x15'),_0x5ee3f8);}}}; \ No newline at end of file +var _0x8958=['7200','9600','12000','ENUM','14400','INTEGER','SIP','IAX','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','yes','xCALLY\x20Motion\x20Fax','STRING','localstationid','2400','4800'];(function(_0x2de55d,_0xef404b){var _0x391470=function(_0x2f81c3){while(--_0x2f81c3){_0x2de55d['push'](_0x2de55d['shift']());}};_0x391470(++_0xef404b);}(_0x8958,0x93));var _0x8895=function(_0x518d89,_0x206af3){_0x518d89=_0x518d89-0x0;var _0x502df8=_0x8958[_0x518d89];return _0x502df8;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8895('0x1')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x8895('0x2')},'localstationid':{'type':Sequelize[_0x8895('0x3')],'unique':_0x8895('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),'14400'),'defaultValue':_0x8895('0x6')},'maxrate':{'type':Sequelize[_0x8895('0xa')](_0x8895('0x5'),_0x8895('0x6'),_0x8895('0x7'),_0x8895('0x8'),_0x8895('0x9'),_0x8895('0xb')),'defaultValue':_0x8895('0xb')},'modem':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8895('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x8895('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x8895('0xa')](_0x8895('0xd'),_0x8895('0xe'),'DADHI',_0x8895('0xf')),'defaultValue':_0x8895('0xd')},'key':{'type':Sequelize[_0x8895('0x3')],'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[_0x8895('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8895('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8895('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x8895('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x8895('0x10')],'defaultValue':![],'comment':_0x8895('0x12'),'set':function(_0x2848b7){if(!_0x2848b7)this[_0x8895('0x13')](_0x8895('0x14'),null);this[_0x8895('0x13')](_0x8895('0x15'),_0x2848b7);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index da434e4..20fd3ad 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 _0xfe5f=['modem','t38timeout','FAXOPT(','push','/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','VoiceExtension','updateAccountApplications','tech','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join','basename','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/license/util','redis','defaults','./faxAccount.socket','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','keys','attributes','intersection','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rawAttributes','rows','removeDispositions','ids','CannedAnswer','getAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','Answer','CDR(type)=inbound-fax','Set','faxdetect','minrate'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xfe5f,0x1af));var _0xffe5=function(_0x74734e,_0xb85faf){_0x74734e=_0x74734e-0x0;var _0x16b360=_0xfe5f[_0x74734e];return _0x16b360;};'use strict';var emlformat=require(_0xffe5('0x0'));var rimraf=require(_0xffe5('0x1'));var zipdir=require(_0xffe5('0x2'));var jsonpatch=require(_0xffe5('0x3'));var rp=require(_0xffe5('0x4'));var moment=require(_0xffe5('0x5'));var BPromise=require(_0xffe5('0x6'));var Mustache=require(_0xffe5('0x7'));var util=require(_0xffe5('0x8'));var path=require(_0xffe5('0x9'));var sox=require(_0xffe5('0xa'));var csv=require(_0xffe5('0xb'));var ejs=require(_0xffe5('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffe5('0xd'));var crypto=require(_0xffe5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xffe5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xffe5('0x10'));var Papa=require(_0xffe5('0x11'));var Redis=require('ioredis');var authService=require(_0xffe5('0x12'));var qs=require(_0xffe5('0x13'));var as=require(_0xffe5('0x14'));var hardwareService=require(_0xffe5('0x15'));var logger=require(_0xffe5('0x16'))(_0xffe5('0x17'));var utils=require(_0xffe5('0x18'));var config=require(_0xffe5('0x19'));var licenseUtil=require(_0xffe5('0x1a'));var db=require('../../mysqldb')['db'];config[_0xffe5('0x1b')]=_[_0xffe5('0x1c')](config[_0xffe5('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffe5('0x1b')]));require(_0xffe5('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xffe5('0x1e')]({'port':0x232c});var client9002=jayson[_0xffe5('0x1f')][_0xffe5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3be566,_0x186224,_0x54a485,_0x3909c3){return new BPromise(function(_0x33e7d9,_0x5249b6){var _0xb731ff=_0x3909c3||client;return _0xb731ff[_0xffe5('0x20')](_0x3be566,_0x54a485)[_0xffe5('0x21')](function(_0xdc67f5){logger[_0xffe5('0x22')](_0xffe5('0x23'),_0x186224,'request\x20sent');logger[_0xffe5('0x24')](_0xffe5('0x25'),_0x186224,'request\x20sent',JSON[_0xffe5('0x26')](_0xdc67f5));if(_0xdc67f5[_0xffe5('0x27')]){if(_0xdc67f5[_0xffe5('0x27')]['code']===0x1f4){logger[_0xffe5('0x27')](_0xffe5('0x23'),_0x186224,_0xdc67f5[_0xffe5('0x27')]['message']);return _0x5249b6(_0xdc67f5[_0xffe5('0x27')][_0xffe5('0x28')]);}logger[_0xffe5('0x27')]('FaxAccount,\x20%s,\x20%s',_0x186224,_0xdc67f5[_0xffe5('0x27')][_0xffe5('0x28')]);return _0x33e7d9(_0xdc67f5['error'][_0xffe5('0x28')]);}else{logger[_0xffe5('0x22')]('FaxAccount,\x20%s,\x20%s',_0x186224,'request\x20sent');_0x33e7d9(_0xdc67f5[_0xffe5('0x29')][_0xffe5('0x28')]);}})[_0xffe5('0x2a')](function(_0x59a978){logger['error'](_0xffe5('0x23'),_0x186224,_0x59a978);_0x5249b6(_0x59a978);});});}function respondWithStatusCode(_0x561ffd,_0x31a587){_0x31a587=_0x31a587||0xcc;return function(_0xb47a8f){if(_0xb47a8f){return _0x561ffd['sendStatus'](_0x31a587);}return _0x561ffd['status'](_0x31a587)[_0xffe5('0x2b')]();};}function respondWithResult(_0x38b6cd,_0x61e71d){_0x61e71d=_0x61e71d||0xc8;return function(_0x2fae36){if(_0x2fae36){return _0x38b6cd[_0xffe5('0x2c')](_0x61e71d)[_0xffe5('0x2d')](_0x2fae36);}};}function respondWithFilteredResult(_0x5ee63e,_0x1ea4ee){return function(_0xe4266a){if(_0xe4266a){var _0x3f2319=typeof _0x1ea4ee['offset']===_0xffe5('0x2e')&&typeof _0x1ea4ee[_0xffe5('0x2f')]===_0xffe5('0x2e');var _0x5e0af9=_0xe4266a[_0xffe5('0x30')];var _0x3f7c2e=_0x3f2319?0x0:_0x1ea4ee[_0xffe5('0x31')];var _0x2bb777=_0x3f2319?_0xe4266a['count']:_0x1ea4ee[_0xffe5('0x31')]+_0x1ea4ee['limit'];var _0x14e80e;if(_0x2bb777>=_0x5e0af9){_0x2bb777=_0x5e0af9;_0x14e80e=0xc8;}else{_0x14e80e=0xce;}_0x5ee63e[_0xffe5('0x2c')](_0x14e80e);return _0x5ee63e['set'](_0xffe5('0x32'),_0x3f7c2e+'-'+_0x2bb777+'/'+_0x5e0af9)[_0xffe5('0x2d')](_0xe4266a);}return null;};}function patchUpdates(_0x194f3e){return function(_0x55430e){try{jsonpatch['apply'](_0x55430e,_0x194f3e,!![]);}catch(_0x2433a7){return BPromise[_0xffe5('0x33')](_0x2433a7);}return _0x55430e[_0xffe5('0x34')]();};}function saveUpdates(_0x29ab8a,_0x564831){return function(_0x33858){if(_0x33858){return _0x33858[_0xffe5('0x35')](_0x29ab8a)['then'](function(_0x2a4b37){return _0x2a4b37;});}return null;};}function removeEntity(_0x1c15b9,_0x4eb055){return function(_0x4191d6){if(_0x4191d6){return _0x4191d6[_0xffe5('0x36')]()[_0xffe5('0x21')](function(){var _0x4ab7eb=_0x4191d6[_0xffe5('0x37')]({'plain':!![]});var _0x576a1b=_0xffe5('0x38');return db[_0xffe5('0x39')]['destroy']({'where':{'type':_0x576a1b,'resourceId':_0x4ab7eb['id']}})[_0xffe5('0x21')](function(){return _0x4191d6;});})[_0xffe5('0x21')](function(){_0x1c15b9[_0xffe5('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ab30,_0x27edf2){return function(_0x3c429f){if(!_0x3c429f){_0x38ab30[_0xffe5('0x3a')](0x194);}return _0x3c429f;};}function handleError(_0x5829a8,_0x260a43){_0x260a43=_0x260a43||0x1f4;return function(_0x129a88){logger[_0xffe5('0x27')](_0x129a88[_0xffe5('0x3b')]);if(_0x129a88[_0xffe5('0x3c')]){delete _0x129a88['name'];}_0x5829a8[_0xffe5('0x2c')](_0x260a43)[_0xffe5('0x3d')](_0x129a88);};}exports[_0xffe5('0x3e')]=function(_0x555e16,_0x2fd62b){var _0x24f9fe={'include':[{'model':db[_0xffe5('0x3f')],'as':_0xffe5('0x40')}]},_0xe9cec5={},_0x3039fc={'count':0x0,'rows':[]};var _0x13fa24=_[_0xffe5('0x41')](db[_0xffe5('0x42')]['rawAttributes'],function(_0x23a67c){return{'name':_0x23a67c[_0xffe5('0x43')],'type':_0x23a67c[_0xffe5('0x44')][_0xffe5('0x45')]};});_0xe9cec5[_0xffe5('0x46')]=_['map'](_0x13fa24,_0xffe5('0x3c'));_0xe9cec5[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x555e16[_0xffe5('0x47')]);_0xe9cec5['filters']=_['intersection'](_0xe9cec5[_0xffe5('0x46')],_0xe9cec5[_0xffe5('0x47')]);_0x24f9fe[_0xffe5('0x49')]=_[_0xffe5('0x4a')](_0xe9cec5[_0xffe5('0x46')],qs['fields'](_0x555e16[_0xffe5('0x47')]['fields']));_0x24f9fe['attributes']=_0x24f9fe[_0xffe5('0x49')]['length']?_0x24f9fe[_0xffe5('0x49')]:_0xe9cec5[_0xffe5('0x46')];if(!_0x555e16[_0xffe5('0x47')][_0xffe5('0x4b')](_0xffe5('0x4c'))){_0x24f9fe['limit']=qs[_0xffe5('0x2f')](_0x555e16[_0xffe5('0x47')][_0xffe5('0x2f')]);_0x24f9fe['offset']=qs['offset'](_0x555e16[_0xffe5('0x47')][_0xffe5('0x31')]);}_0x24f9fe[_0xffe5('0x4d')]=qs[_0xffe5('0x4e')](_0x555e16[_0xffe5('0x47')][_0xffe5('0x4e')]);_0x24f9fe['where']=qs[_0xffe5('0x4f')](_[_0xffe5('0x50')](_0x555e16[_0xffe5('0x47')],_0xe9cec5['filters']),_0x13fa24);if(_0x555e16[_0xffe5('0x47')][_0xffe5('0x51')]){_0x24f9fe[_0xffe5('0x52')]=_[_0xffe5('0x53')](_0x24f9fe[_0xffe5('0x52')],{'$or':_[_0xffe5('0x41')](_0x13fa24,function(_0x1a40be){if(_0x1a40be[_0xffe5('0x44')]!==_0xffe5('0x54')){var _0x43d273={};_0x43d273[_0x1a40be[_0xffe5('0x3c')]]={'$like':'%'+_0x555e16[_0xffe5('0x47')][_0xffe5('0x51')]+'%'};return _0x43d273;}})});}_0x24f9fe=_[_0xffe5('0x53')]({},_0x24f9fe,_0x555e16['options']);var _0x2105e2={'where':_0x24f9fe[_0xffe5('0x52')]};return db[_0xffe5('0x42')]['count'](_0x2105e2)[_0xffe5('0x21')](function(_0x50a2ee){_0x3039fc['count']=_0x50a2ee;if(_0x555e16['query'][_0xffe5('0x55')]){_0x24f9fe[_0xffe5('0x56')]=[{'all':!![]}];}return db[_0xffe5('0x42')][_0xffe5('0x57')](_0x24f9fe);})[_0xffe5('0x21')](function(_0x34173f){_0x3039fc['rows']=_0x34173f;return _0x3039fc;})[_0xffe5('0x21')](respondWithFilteredResult(_0x2fd62b,_0x24f9fe))['catch'](handleError(_0x2fd62b,null));};exports[_0xffe5('0x58')]=function(_0x595d85,_0x436783){var _0x4726={'raw':![],'where':{'id':_0x595d85[_0xffe5('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4b9849={};_0x4b9849[_0xffe5('0x46')]=_[_0xffe5('0x48')](db[_0xffe5('0x42')]['rawAttributes']);_0x4b9849[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x595d85[_0xffe5('0x47')]);_0x4b9849[_0xffe5('0x4f')]=_[_0xffe5('0x4a')](_0x4b9849['model'],_0x4b9849['query']);_0x4726['attributes']=_[_0xffe5('0x4a')](_0x4b9849[_0xffe5('0x46')],qs[_0xffe5('0x5a')](_0x595d85[_0xffe5('0x47')][_0xffe5('0x5a')]));_0x4726[_0xffe5('0x49')]=_0x4726[_0xffe5('0x49')][_0xffe5('0x5b')]?_0x4726[_0xffe5('0x49')]:_0x4b9849[_0xffe5('0x46')];if(_0x595d85['query'][_0xffe5('0x55')]){_0x4726['include']=[{'all':!![]}];}_0x4726=_[_0xffe5('0x53')]({},_0x4726,_0x595d85[_0xffe5('0x5c')]);return db[_0xffe5('0x42')][_0xffe5('0x5d')](_0x4726)[_0xffe5('0x21')](handleEntityNotFound(_0x436783,null))['then'](respondWithResult(_0x436783,null))[_0xffe5('0x2a')](handleError(_0x436783,null));};exports[_0xffe5('0x5e')]=function(_0x35032f,_0xe29e96){return db['FaxAccount']['create'](_0x35032f[_0xffe5('0x5f')],{})[_0xffe5('0x21')](function(_0x137d8a){var _0x17267b=_0x35032f[_0xffe5('0x60')][_0xffe5('0x37')]({'plain':!![]});if(!_0x17267b)throw new Error(_0xffe5('0x61'));if(_0x17267b[_0xffe5('0x62')]===_0xffe5('0x60')){var _0x2d448e=_0x137d8a[_0xffe5('0x37')]({'plain':!![]});var _0x5642d3='FaxAccounts';return db[_0xffe5('0x63')]['find']({'where':{'name':_0x5642d3,'userProfileId':_0x17267b['userProfileId']},'raw':!![]})[_0xffe5('0x21')](function(_0x4506f6){if(_0x4506f6&&_0x4506f6[_0xffe5('0x64')]===0x0){return db[_0xffe5('0x39')][_0xffe5('0x5e')]({'name':_0x2d448e[_0xffe5('0x3c')],'resourceId':_0x2d448e['id'],'type':_0x4506f6['name'],'sectionId':_0x4506f6['id']},{})[_0xffe5('0x21')](function(){return _0x137d8a;});}else{return _0x137d8a;}})['catch'](function(_0x537a8e){logger[_0xffe5('0x27')](_0xffe5('0x65'),_0x537a8e);throw _0x537a8e;});}return _0x137d8a;})[_0xffe5('0x21')](respondWithResult(_0xe29e96,0xc9))[_0xffe5('0x2a')](handleError(_0xe29e96,null));};exports[_0xffe5('0x35')]=function(_0x36768d,_0x24266f){if(_0x36768d['body']['id']){delete _0x36768d[_0xffe5('0x5f')]['id'];}return db[_0xffe5('0x42')][_0xffe5('0x5d')]({'where':{'id':_0x36768d[_0xffe5('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xffe5('0x40')}]})['then'](handleEntityNotFound(_0x24266f,null))[_0xffe5('0x21')](saveUpdates(_0x36768d[_0xffe5('0x5f')],null))[_0xffe5('0x21')](respondWithResult(_0x24266f,null))[_0xffe5('0x2a')](handleError(_0x24266f,null));};exports[_0xffe5('0x36')]=function(_0x40789b,_0x362cae){return db[_0xffe5('0x42')][_0xffe5('0x5d')]({'where':{'id':_0x40789b[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x362cae,null))['then'](removeEntity(_0x362cae,null))['catch'](handleError(_0x362cae,null));};exports[_0xffe5('0x66')]=function(_0x21899f,_0x3c9d2e){return db[_0xffe5('0x42')][_0xffe5('0x66')]()[_0xffe5('0x21')](respondWithResult(_0x3c9d2e,null))[_0xffe5('0x2a')](handleError(_0x3c9d2e,null));};exports[_0xffe5('0x67')]=function(_0x1b71f3,_0x55c418,_0x25a563){if(_0x1b71f3[_0xffe5('0x5f')]['id']){delete _0x1b71f3['body']['id'];}return db[_0xffe5('0x42')]['find']({'where':{'id':_0x1b71f3[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x55c418,null))[_0xffe5('0x21')](function(_0x50ce2d){if(_0x50ce2d){_0x1b71f3[_0xffe5('0x5f')][_0xffe5('0x68')]=_0x50ce2d['id'];return db[_0xffe5('0x69')][_0xffe5('0x5e')](_0x1b71f3[_0xffe5('0x5f')]);}})[_0xffe5('0x21')](respondWithResult(_0x55c418,null))[_0xffe5('0x2a')](handleError(_0x55c418,null));};exports[_0xffe5('0x6a')]=function(_0x81f04c,_0x4ad918,_0x1404c7){var _0xf34dc9={'raw':![],'where':{}};var _0x33a21a={};var _0x1a7f08={'count':0x0,'rows':[]};return db[_0xffe5('0x42')][_0xffe5('0x6b')]({'where':{'id':_0x81f04c['params']['id']}})['then'](handleEntityNotFound(_0x4ad918,null))[_0xffe5('0x21')](function(_0x20557c){if(_0x20557c){_0x33a21a[_0xffe5('0x46')]=_['keys'](db['Disposition'][_0xffe5('0x6c')]);_0x33a21a[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x81f04c[_0xffe5('0x47')]);_0x33a21a[_0xffe5('0x4f')]=_[_0xffe5('0x4a')](_0x33a21a['model'],_0x33a21a['query']);_0xf34dc9[_0xffe5('0x49')]=_[_0xffe5('0x4a')](_0x33a21a['model'],qs[_0xffe5('0x5a')](_0x81f04c[_0xffe5('0x47')][_0xffe5('0x5a')]));_0xf34dc9[_0xffe5('0x49')]=_0xf34dc9[_0xffe5('0x49')]['length']?_0xf34dc9[_0xffe5('0x49')]:_0x33a21a[_0xffe5('0x46')];if(!_0x81f04c[_0xffe5('0x47')][_0xffe5('0x4b')](_0xffe5('0x4c'))){_0xf34dc9[_0xffe5('0x2f')]=qs[_0xffe5('0x2f')](_0x81f04c[_0xffe5('0x47')][_0xffe5('0x2f')]);_0xf34dc9[_0xffe5('0x31')]=qs['offset'](_0x81f04c[_0xffe5('0x47')][_0xffe5('0x31')]);}_0xf34dc9[_0xffe5('0x4d')]=qs[_0xffe5('0x4e')](_0x81f04c[_0xffe5('0x47')][_0xffe5('0x4e')]);_0xf34dc9['where']=qs['filters'](_['pick'](_0x81f04c[_0xffe5('0x47')],_0x33a21a[_0xffe5('0x4f')]));_0xf34dc9[_0xffe5('0x52')][_0xffe5('0x68')]=_0x20557c['id'];if(_0x81f04c['query']['filter']){_0xf34dc9[_0xffe5('0x52')]=_[_0xffe5('0x53')](_0xf34dc9[_0xffe5('0x52')],{'$or':_['map'](_0xf34dc9['attributes'],function(_0x4c15f2){var _0x1a8933={};_0x1a8933[_0x4c15f2]={'$like':'%'+_0x81f04c[_0xffe5('0x47')][_0xffe5('0x51')]+'%'};return _0x1a8933;})});}_0xf34dc9=_[_0xffe5('0x53')]({},_0xf34dc9,_0x81f04c[_0xffe5('0x5c')]);return db['Disposition']['count']({'where':_0xf34dc9[_0xffe5('0x52')]})['then'](function(_0x2b3ba6){_0x1a7f08['count']=_0x2b3ba6;if(_0x81f04c[_0xffe5('0x47')]['includeAll']){_0xf34dc9[_0xffe5('0x56')]=[{'all':!![]}];}return db[_0xffe5('0x69')][_0xffe5('0x57')](_0xf34dc9);})[_0xffe5('0x21')](function(_0x543446){_0x1a7f08[_0xffe5('0x6d')]=_0x543446;return _0x1a7f08;});}})[_0xffe5('0x21')](respondWithFilteredResult(_0x4ad918,_0xf34dc9))['catch'](handleError(_0x4ad918,null));};exports[_0xffe5('0x6e')]=function(_0x9c7f01,_0x2de8f0,_0xc5a560){return db[_0xffe5('0x42')][_0xffe5('0x5d')]({'where':{'id':_0x9c7f01['params']['id']}})['then'](handleEntityNotFound(_0x2de8f0,null))[_0xffe5('0x21')](function(_0x51b0ee){if(_0x51b0ee){return _0x51b0ee[_0xffe5('0x6e')](_0x9c7f01[_0xffe5('0x47')][_0xffe5('0x6f')]);}})['then'](respondWithStatusCode(_0x2de8f0,null))['catch'](handleError(_0x2de8f0,null));};exports['addAnswer']=function(_0x365a80,_0x4ea21f,_0x4c27a1){if(_0x365a80[_0xffe5('0x5f')]['id']){delete _0x365a80[_0xffe5('0x5f')]['id'];}return db[_0xffe5('0x42')][_0xffe5('0x5d')]({'where':{'id':_0x365a80[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x4ea21f,null))[_0xffe5('0x21')](function(_0x225650){if(_0x225650){_0x365a80['body'][_0xffe5('0x68')]=_0x225650['id'];return db[_0xffe5('0x70')][_0xffe5('0x5e')](_0x365a80[_0xffe5('0x5f')]);}})[_0xffe5('0x21')](respondWithResult(_0x4ea21f,null))[_0xffe5('0x2a')](handleError(_0x4ea21f,null));};exports[_0xffe5('0x71')]=function(_0x396978,_0x1048e3,_0x246766){var _0x5b8492={'raw':![],'where':{}};var _0x20f978={};var _0x461624={'count':0x0,'rows':[]};return db[_0xffe5('0x42')]['findOne']({'where':{'id':_0x396978[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x1048e3,null))['then'](function(_0x4cb24a){if(_0x4cb24a){_0x20f978[_0xffe5('0x46')]=_[_0xffe5('0x48')](db['CannedAnswer'][_0xffe5('0x6c')]);_0x20f978[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x396978['query']);_0x20f978[_0xffe5('0x4f')]=_[_0xffe5('0x4a')](_0x20f978['model'],_0x20f978[_0xffe5('0x47')]);_0x5b8492['attributes']=_[_0xffe5('0x4a')](_0x20f978[_0xffe5('0x46')],qs['fields'](_0x396978[_0xffe5('0x47')][_0xffe5('0x5a')]));_0x5b8492[_0xffe5('0x49')]=_0x5b8492[_0xffe5('0x49')]['length']?_0x5b8492[_0xffe5('0x49')]:_0x20f978[_0xffe5('0x46')];if(!_0x396978[_0xffe5('0x47')]['hasOwnProperty'](_0xffe5('0x4c'))){_0x5b8492[_0xffe5('0x2f')]=qs[_0xffe5('0x2f')](_0x396978['query']['limit']);_0x5b8492['offset']=qs[_0xffe5('0x31')](_0x396978[_0xffe5('0x47')][_0xffe5('0x31')]);}_0x5b8492[_0xffe5('0x4d')]=qs[_0xffe5('0x4e')](_0x396978[_0xffe5('0x47')][_0xffe5('0x4e')]);_0x5b8492[_0xffe5('0x52')]=qs[_0xffe5('0x4f')](_['pick'](_0x396978[_0xffe5('0x47')],_0x20f978[_0xffe5('0x4f')]));_0x5b8492[_0xffe5('0x52')]['FaxAccountId']=_0x4cb24a['id'];if(_0x396978['query'][_0xffe5('0x51')]){_0x5b8492[_0xffe5('0x52')]=_['merge'](_0x5b8492[_0xffe5('0x52')],{'$or':_[_0xffe5('0x41')](_0x5b8492[_0xffe5('0x49')],function(_0x3d8aaa){var _0x2a90d3={};_0x2a90d3[_0x3d8aaa]={'$like':'%'+_0x396978['query'][_0xffe5('0x51')]+'%'};return _0x2a90d3;})});}_0x5b8492=_[_0xffe5('0x53')]({},_0x5b8492,_0x396978[_0xffe5('0x5c')]);return db[_0xffe5('0x70')][_0xffe5('0x30')]({'where':_0x5b8492['where']})[_0xffe5('0x21')](function(_0x55e48f){_0x461624['count']=_0x55e48f;if(_0x396978['query'][_0xffe5('0x55')]){_0x5b8492[_0xffe5('0x56')]=[{'all':!![]}];}return db[_0xffe5('0x70')][_0xffe5('0x57')](_0x5b8492);})[_0xffe5('0x21')](function(_0xd67c18){_0x461624['rows']=_0xd67c18;return _0x461624;});}})[_0xffe5('0x21')](respondWithFilteredResult(_0x1048e3,_0x5b8492))['catch'](handleError(_0x1048e3,null));};exports['removeAnswers']=function(_0x1cefb6,_0x24d92c,_0x466745){return db['FaxAccount'][_0xffe5('0x5d')]({'where':{'id':_0x1cefb6[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x24d92c,null))[_0xffe5('0x21')](function(_0x5f031e){if(_0x5f031e){return _0x5f031e['removeAnswers'](_0x1cefb6[_0xffe5('0x47')][_0xffe5('0x6f')]);}})[_0xffe5('0x21')](respondWithStatusCode(_0x24d92c,null))['catch'](handleError(_0x24d92c,null));};exports[_0xffe5('0x72')]=function(_0x5266a8,_0x14d33c,_0x399f4b){return db[_0xffe5('0x73')]['find']({'where':{'id':_0x5266a8[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x14d33c,null))['then'](function(_0x3c79f7){if(_0x3c79f7){return _0x3c79f7[_0xffe5('0x72')](_0x5266a8[_0xffe5('0x5f')]['ids'],_[_0xffe5('0x74')](_0x5266a8[_0xffe5('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x14d33c,null))[_0xffe5('0x2a')](handleError(_0x14d33c,null));};exports[_0xffe5('0x75')]=function(_0x595e07,_0x45f90b,_0x232641){var _0x6aa768={'raw':![],'where':{}};var _0x1316a4={};var _0x543d55={'count':0x0,'rows':[]};return db['FaxAccount'][_0xffe5('0x6b')]({'where':{'id':_0x595e07[_0xffe5('0x59')]['id']}})['then'](handleEntityNotFound(_0x45f90b,null))['then'](function(_0x20103a){if(_0x20103a){_0x1316a4[_0xffe5('0x46')]=_[_0xffe5('0x48')](db['FaxInteraction'][_0xffe5('0x6c')]);_0x1316a4[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x595e07['query']);_0x1316a4['filters']=_[_0xffe5('0x4a')](_0x1316a4['model'],_0x1316a4[_0xffe5('0x47')]);_0x6aa768[_0xffe5('0x49')]=_[_0xffe5('0x4a')](_0x1316a4[_0xffe5('0x46')],qs[_0xffe5('0x5a')](_0x595e07['query'][_0xffe5('0x5a')]));_0x6aa768['attributes']=_0x6aa768[_0xffe5('0x49')][_0xffe5('0x5b')]?_0x6aa768[_0xffe5('0x49')]:_0x1316a4[_0xffe5('0x46')];if(!_0x595e07[_0xffe5('0x47')][_0xffe5('0x4b')](_0xffe5('0x4c'))){_0x6aa768[_0xffe5('0x2f')]=qs[_0xffe5('0x2f')](_0x595e07[_0xffe5('0x47')][_0xffe5('0x2f')]);_0x6aa768['offset']=qs[_0xffe5('0x31')](_0x595e07[_0xffe5('0x47')][_0xffe5('0x31')]);}_0x6aa768['order']=qs[_0xffe5('0x4e')](_0x595e07[_0xffe5('0x47')][_0xffe5('0x4e')]);_0x6aa768[_0xffe5('0x52')]=qs[_0xffe5('0x4f')](_[_0xffe5('0x50')](_0x595e07[_0xffe5('0x47')],_0x1316a4['filters']));_0x6aa768[_0xffe5('0x52')][_0xffe5('0x68')]=_0x20103a['id'];if(_0x595e07['query'][_0xffe5('0x51')]){_0x6aa768[_0xffe5('0x52')]=_['merge'](_0x6aa768['where'],{'$or':_[_0xffe5('0x41')](_0x6aa768['attributes'],function(_0x283241){var _0x31343f={};_0x31343f[_0x283241]={'$like':'%'+_0x595e07[_0xffe5('0x47')][_0xffe5('0x51')]+'%'};return _0x31343f;})});}_0x6aa768=_[_0xffe5('0x53')]({},_0x6aa768,_0x595e07['options']);return db[_0xffe5('0x73')][_0xffe5('0x30')]({'where':_0x6aa768[_0xffe5('0x52')]})['then'](function(_0x2b38ec){_0x543d55[_0xffe5('0x30')]=_0x2b38ec;if(_0x595e07['query'][_0xffe5('0x55')]){_0x6aa768[_0xffe5('0x56')]=[{'model':db[_0xffe5('0x76')],'as':_0xffe5('0x77'),'required':![]},{'model':db[_0xffe5('0x78')],'as':_0xffe5('0x79'),'attributes':[_0xffe5('0x3c'),'fullname',_0xffe5('0x7a')],'required':![]},{'model':db[_0xffe5('0x7b')],'as':_0xffe5('0x7c'),'attributes':['id',_0xffe5('0x3c'),_0xffe5('0x7d')],'where':_0x595e07[_0xffe5('0x47')]['tag']?{'id':_0x595e07['query'][_0xffe5('0x7e')]}:undefined,'required':_0x595e07['query'][_0xffe5('0x7e')]?!![]:![]}];}return db[_0xffe5('0x73')][_0xffe5('0x57')](_0x6aa768);})[_0xffe5('0x21')](function(_0x446b0e){_0x543d55[_0xffe5('0x6d')]=_0x446b0e;return _0x543d55;});}})[_0xffe5('0x21')](respondWithFilteredResult(_0x45f90b,_0x6aa768))[_0xffe5('0x2a')](handleError(_0x45f90b,null));};exports['addApplications']=function(_0x461386,_0x552c38){var _0x15a814=_0x461386['params']['id'];var _0x20a2ac=_0x461386[_0xffe5('0x5f')];var _0x573a6a=0xc8;var _0x26b788=null;return db[_0xffe5('0x7f')][_0xffe5('0x80')]({'isolationLevel':db[_0xffe5('0x7f')][_0xffe5('0x81')][_0xffe5('0x82')][_0xffe5('0x83')]},function(_0x4d2d7b){return db[_0xffe5('0x42')][_0xffe5('0x6b')]({'where':{'id':_0x15a814},'transaction':_0x4d2d7b})[_0xffe5('0x21')](function(_0x19b2f2){if(_0x19b2f2){return db[_0xffe5('0x84')][_0xffe5('0x36')]({'where':{'FaxAccountId':_0x15a814},'transaction':_0x4d2d7b})[_0xffe5('0x21')](function(){var _0x34037e=_[_0xffe5('0x41')](_0x20a2ac,function(_0x203393){_0x203393[_0xffe5('0x68')]=_0x15a814;return _0x203393;});return db[_0xffe5('0x84')][_0xffe5('0x85')](_0x34037e,{'transaction':_0x4d2d7b});});}else{_0x573a6a=0x194;_0x26b788=[];}});})[_0xffe5('0x21')](function(){if(_0x573a6a!==0x194){return db[_0xffe5('0x84')]['findAndCountAll']({'where':{'FaxAccountId':_0x15a814},'order':'priority'})[_0xffe5('0x21')](function(_0x5e8546){_0x26b788=_0x5e8546;});}})[_0xffe5('0x2a')](function(_0x1b08a0){_0x573a6a=0x1f4;logger[_0xffe5('0x27')](_0x1b08a0['stack']);if(_0x1b08a0[_0xffe5('0x3c')]){delete _0x1b08a0['name'];}_0x26b788=_0x1b08a0;})[_0xffe5('0x86')](function(){if(_0x26b788===null){_0x552c38['sendStatus'](_0x573a6a);}else{if(_0x573a6a===0x1f4){_0x552c38[_0xffe5('0x2c')](_0x573a6a)['send'](_0x26b788);}else{_0x552c38['status'](_0x573a6a)['json'](_0x26b788);}}});};exports[_0xffe5('0x87')]=function(_0x1c3dd4,_0x1ff5ff,_0x31561c){var _0x4e5f19={};var _0x1f81c8={};var _0x1ce74b;var _0x14f017;return db[_0xffe5('0x42')][_0xffe5('0x6b')]({'where':{'id':_0x1c3dd4[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x1ff5ff,null))[_0xffe5('0x21')](function(_0x56b129){if(_0x56b129){_0x1ce74b=_0x56b129;_0x1f81c8[_0xffe5('0x46')]=_['keys'](db[_0xffe5('0x84')][_0xffe5('0x6c')]);_0x1f81c8[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x1c3dd4['query']);_0x1f81c8[_0xffe5('0x4f')]=_[_0xffe5('0x4a')](_0x1f81c8[_0xffe5('0x46')],_0x1f81c8[_0xffe5('0x47')]);_0x4e5f19[_0xffe5('0x49')]=_[_0xffe5('0x4a')](_0x1f81c8['model'],qs[_0xffe5('0x5a')](_0x1c3dd4[_0xffe5('0x47')][_0xffe5('0x5a')]));_0x4e5f19[_0xffe5('0x49')]=_0x4e5f19['attributes']['length']?_0x4e5f19['attributes']:_0x1f81c8['model'];_0x4e5f19[_0xffe5('0x4d')]=qs[_0xffe5('0x4e')](_0x1c3dd4[_0xffe5('0x47')]['sort']);_0x4e5f19['where']=qs['filters'](_['pick'](_0x1c3dd4['query'],_0x1f81c8['filters']));if(_0x1c3dd4[_0xffe5('0x47')][_0xffe5('0x51')]){_0x4e5f19['where']=_[_0xffe5('0x53')](_0x4e5f19[_0xffe5('0x52')],{'$or':_[_0xffe5('0x41')](_0x4e5f19['attributes'],function(_0x4ffae1){var _0x4234e4={};_0x4234e4[_0x4ffae1]={'$like':'%'+_0x1c3dd4['query'][_0xffe5('0x51')]+'%'};return _0x4234e4;})});}_0x4e5f19=_[_0xffe5('0x53')]({},_0x4e5f19,_0x1c3dd4['options']);return _0x1ce74b['getApplications'](_0x4e5f19);}})[_0xffe5('0x21')](function(_0x3eeff7){if(_0x3eeff7){_0x14f017=_0x3eeff7['length'];if(!_0x1c3dd4['query']['hasOwnProperty'](_0xffe5('0x4c'))){_0x4e5f19[_0xffe5('0x2f')]=qs['limit'](_0x1c3dd4['query'][_0xffe5('0x2f')]);_0x4e5f19[_0xffe5('0x31')]=qs[_0xffe5('0x31')](_0x1c3dd4[_0xffe5('0x47')]['offset']);}return _0x1ce74b[_0xffe5('0x87')](_0x4e5f19);}})[_0xffe5('0x21')](function(_0x36b425){if(_0x36b425){return _0x36b425?{'count':_0x14f017,'rows':_0x36b425}:null;}})['then'](respondWithResult(_0x1ff5ff,null))[_0xffe5('0x2a')](handleError(_0x1ff5ff,null));};function Extension(_0x867918,_0x4b8973,_0x4f0a2e,_0x258a24){this[_0xffe5('0x88')]=_0xffe5('0x89');this[_0xffe5('0x8a')]=_0x867918[_0xffe5('0x8b')];this[_0xffe5('0x8c')]=_0x258a24;this['type']=_0xffe5('0x8d');this[_0xffe5('0x8e')]=_0xffe5('0x8f');this[_0xffe5('0x68')]=_0x867918['id'];this[_0xffe5('0x90')]=_0x4b8973;this[_0xffe5('0x91')]=_0x4f0a2e;}function createExtensionsReciveFax(_0x500626){var _0x2e035f=0x1;var _0x26be56=[];_0x26be56['push'](new Extension(_0x500626,_0x2e035f,'',_0xffe5('0x92')));_0x2e035f+=0x1;_0x26be56['push'](new Extension(_0x500626,_0x2e035f,_0xffe5('0x93'),_0xffe5('0x94')));_0x2e035f+=0x1;for(var _0x40f99d in _0x500626){if(_0x500626['hasOwnProperty'](_0x40f99d)&&(_0x40f99d==='ecm'||_0x40f99d==='localstationid'||_0x40f99d==='gateway'||_0x40f99d===_0xffe5('0x95')||_0x40f99d==='headerinfo'||_0x40f99d==='maxrate'||_0x40f99d===_0xffe5('0x96')||_0x40f99d===_0xffe5('0x97')||_0x40f99d===_0xffe5('0x98'))){_0x26be56['push'](new Extension(_0x500626,_0x2e035f,_0xffe5('0x99')+_0x40f99d+')='+_0x500626[_0x40f99d],_0xffe5('0x94')));_0x2e035f+=0x1;}}_0x26be56[_0xffe5('0x9a')](new Extension(_0x500626,_0x2e035f,'6','Wait'));_0x2e035f+=0x1;_0x26be56[_0xffe5('0x9a')](new Extension(_0x500626,_0x2e035f,_0xffe5('0x9b'),_0xffe5('0x9c')));_0x2e035f=0x0;return _0x26be56;}exports['addAccountApplications']=function(_0x291b38,_0x1f09f3,_0x204322){var _0x307bfe;return db[_0xffe5('0x7f')][_0xffe5('0x80')](function(_0x21a9a3){return db[_0xffe5('0x42')]['create'](_0x291b38['body'],{'transaction':_0x21a9a3})['then'](function(_0x139205){_0x307bfe=_0x139205[_0xffe5('0x37')]({'plain':!![]});return db[_0xffe5('0x9d')][_0xffe5('0x85')](createExtensionsReciveFax(_0x307bfe),{'transaction':_0x21a9a3});});})['then'](function(){return _0x307bfe;})['then'](respondWithResult(_0x1f09f3,null))[_0xffe5('0x2a')](handleError(_0x1f09f3,null));};exports[_0xffe5('0x9e')]=function(_0x33ba38,_0x5b1916,_0x550ecb){var _0x384e2f;return db['sequelize']['transaction'](function(_0x473404){return db['FaxAccount'][_0xffe5('0x35')](_0x33ba38[_0xffe5('0x5f')],{'where':{'id':_0x33ba38[_0xffe5('0x5f')]['id']},'transaction':_0x473404})[_0xffe5('0x21')](function(_0x2deca2){return db[_0xffe5('0x9d')][_0xffe5('0x36')]({'where':{'FaxAccountId':_0x33ba38[_0xffe5('0x5f')]['id']},'transaction':_0x473404})['then'](function(_0x1ee026){return db[_0xffe5('0x9d')][_0xffe5('0x85')](createExtensionsReciveFax(_['omit'](_0x33ba38[_0xffe5('0x5f')],[_0xffe5('0x9f'),_0xffe5('0x45'),'createdAt',_0xffe5('0xa0'),'TrunkId',_0xffe5('0xa1')])),{'transaction':_0x473404});});});})['then'](function(){return db['FaxAccount'][_0xffe5('0xa2')](_0x33ba38[_0xffe5('0x5f')]['id']);})['then'](respondWithResult(_0x5b1916,null))[_0xffe5('0x2a')](handleError(_0x5b1916,null));};exports[_0xffe5('0xa3')]=function(_0x14b0c7,_0x18e1bc,_0x21d05a){var _0x4ed9df={'raw':!![],'where':{}};var _0x370730={};var _0x54eb1e={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x14b0c7[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x18e1bc,null))[_0xffe5('0x21')](function(_0x45a673){if(_0x45a673){_0x370730[_0xffe5('0x46')]=_[_0xffe5('0x48')](db[_0xffe5('0xa4')][_0xffe5('0x6c')]);_0x370730[_0xffe5('0x47')]=_[_0xffe5('0x48')](_0x14b0c7[_0xffe5('0x47')]);_0x370730['filters']=_['intersection'](_0x370730[_0xffe5('0x46')],_0x370730[_0xffe5('0x47')]);_0x4ed9df[_0xffe5('0x49')]=_[_0xffe5('0x4a')](_0x370730[_0xffe5('0x46')],qs['fields'](_0x14b0c7[_0xffe5('0x47')][_0xffe5('0x5a')]));_0x4ed9df[_0xffe5('0x49')]=_0x4ed9df[_0xffe5('0x49')][_0xffe5('0x5b')]?_0x4ed9df['attributes']:_0x370730['model'];if(!_0x14b0c7[_0xffe5('0x47')][_0xffe5('0x4b')](_0xffe5('0x4c'))){_0x4ed9df['limit']=qs['limit'](_0x14b0c7[_0xffe5('0x47')][_0xffe5('0x2f')]);_0x4ed9df[_0xffe5('0x31')]=qs[_0xffe5('0x31')](_0x14b0c7[_0xffe5('0x47')][_0xffe5('0x31')]);}_0x4ed9df[_0xffe5('0x4d')]=qs[_0xffe5('0x4e')](_0x14b0c7[_0xffe5('0x47')][_0xffe5('0x4e')]);_0x4ed9df['where']=qs[_0xffe5('0x4f')](_[_0xffe5('0x50')](_0x14b0c7[_0xffe5('0x47')],_0x370730[_0xffe5('0x4f')]));_0x4ed9df[_0xffe5('0x52')][_0xffe5('0x68')]=_0x45a673['id'];if(_0x14b0c7[_0xffe5('0x47')]['filter']){_0x4ed9df['where']=_[_0xffe5('0x53')](_0x4ed9df[_0xffe5('0x52')],{'$or':_[_0xffe5('0x41')](_0x4ed9df['attributes'],function(_0x3bd19f){var _0xdf15d5={};_0xdf15d5[_0x3bd19f]={'$like':'%'+_0x14b0c7[_0xffe5('0x47')][_0xffe5('0x51')]+'%'};return _0xdf15d5;})});}if(_0x14b0c7[_0xffe5('0x47')][_0xffe5('0xa5')]){var _0x4a4cd3=_0x14b0c7[_0xffe5('0x47')][_0xffe5('0xa5')][_0xffe5('0xa6')](',');var _0x3c453e={};_0x3c453e[_0x4a4cd3[0x0]]={'$gte':moment(_0x4a4cd3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4ed9df[_0xffe5('0x52')]=_[_0xffe5('0x53')](_0x4ed9df[_0xffe5('0x52')],_0x3c453e);}_0x4ed9df=_['merge']({},_0x4ed9df,_0x14b0c7[_0xffe5('0x5c')]);return db[_0xffe5('0xa4')][_0xffe5('0x30')]({'where':_0x4ed9df[_0xffe5('0x52')]})[_0xffe5('0x21')](function(_0x140eae){_0x54eb1e['count']=_0x140eae;if(_0x14b0c7[_0xffe5('0x47')]['includeAll']){_0x4ed9df[_0xffe5('0x56')]=[{'all':!![]}];}return db[_0xffe5('0xa4')]['findAll'](_0x4ed9df);})[_0xffe5('0x21')](function(_0x3e9d6a){_0x54eb1e[_0xffe5('0x6d')]=_0x3e9d6a;return _0x54eb1e;});}})[_0xffe5('0x21')](respondWithFilteredResult(_0x18e1bc,_0x4ed9df))[_0xffe5('0x2a')](handleError(_0x18e1bc,null));};exports[_0xffe5('0x3d')]=function(_0x52d6a6,_0x48bd3f,_0x1c4dcc){var _0x8ef85b,_0x5f0656={},_0x470fcd;if(_0x52d6a6['body']['to']){_0x470fcd=_0x52d6a6[_0xffe5('0x5f')]['to'][0x0];}return db[_0xffe5('0x42')]['find']({'where':{'id':_0x52d6a6[_0xffe5('0x59')]['id']},'include':[{'model':db[_0xffe5('0xa7')],'as':_0xffe5('0xa8'),'include':[{'model':db['CmContact'],'as':_0xffe5('0xa9'),'where':{'fax':_0x470fcd},'limit':0x1,'order':[['updatedAt',_0xffe5('0xaa')]]}]}]})[_0xffe5('0x21')](handleEntityNotFound(_0x48bd3f,null))[_0xffe5('0x21')](function(_0x343d3b){_0x8ef85b=_0x343d3b;if(_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')]&&_0x52d6a6['body'][_0xffe5('0xab')]['length']){for(var _0x460942=0x0;_0x460942<_0x52d6a6['body'][_0xffe5('0xab')]['length'];_0x460942+=0x1){_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')][_0x460942]={'filename':_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')][_0x460942][_0xffe5('0x3c')],'id':_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')][_0x460942]['id'],'path':path[_0xffe5('0xac')](config['root'],'server/files/attachments',_0x52d6a6[_0xffe5('0x5f')]['attachments'][_0x460942][_0xffe5('0xad')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0xffe5('0xae')](_0x52d6a6[_0xffe5('0x59')]['id'])?undefined:_0x52d6a6[_0xffe5('0x59')]['id'],'path':_[_0xffe5('0xae')](_0x52d6a6[_0xffe5('0x5f')]['attachments'][0x0][_0xffe5('0x9')])?undefined:_0x52d6a6['body'][_0xffe5('0xab')][0x0]['path'],'fax':_[_0xffe5('0xae')](_0x52d6a6[_0xffe5('0x5f')]['to'][0x0])?undefined:_0x52d6a6[_0xffe5('0x5f')]['to'][0x0]},client9002);})[_0xffe5('0x21')](function(){if(_0x8ef85b){if(_[_0xffe5('0xae')](_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xaf')])){_0x52d6a6['body']['from']=util['format']('\x22%s\x22\x20<%s>',_0x8ef85b[_0xffe5('0x3c')],_0x8ef85b[_0xffe5('0xb0')]);}if(_0x8ef85b[_0xffe5('0xa8')]){if(_0x8ef85b[_0xffe5('0xa8')][_0xffe5('0xa9')][_0xffe5('0x5b')]){return _0x8ef85b[_0xffe5('0xa8')][_0xffe5('0xa9')][0x0];}else{return db[_0xffe5('0x76')][_0xffe5('0x5e')](_[_0xffe5('0x1c')](_0x52d6a6[_0xffe5('0x5f')],{'firstName':_0x52d6a6[_0xffe5('0x5f')]['to'][0x0],'phone':_0x52d6a6['body']['to'][0x0],'fax':_0x52d6a6[_0xffe5('0x5f')]['to'][0x0],'ListId':_0x8ef85b[_0xffe5('0xa1')]}));}}else{throw new Error(_0xffe5('0xb1'));}}else{throw new Error(_0xffe5('0xb2'));}})[_0xffe5('0x21')](function(_0x10df7d){if(_0x10df7d){return db[_0xffe5('0x73')][_0xffe5('0x5d')]({'where':{'ContactId':_0x10df7d['id'],'closed':![],'FaxAccountId':_0x8ef85b['id']}})[_0xffe5('0x21')](function(_0x233b64){if(_0x233b64){return[_0x233b64,![]];}return db['FaxInteraction'][_0xffe5('0x5e')]({'UserId':_0x52d6a6[_0xffe5('0x60')]['id'],'ContactId':_0x10df7d['id'],'FaxAccountId':_0x8ef85b['id'],'fax':_0x52d6a6[_0xffe5('0x5f')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x52d6a6[_0xffe5('0x5f')],{'read':![],'body':_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')][0x0][_0xffe5('0xb3')],'FaxAccountId':_0x8ef85b['id'],'UserId':_0x52d6a6[_0xffe5('0x60')]['id'],'ContactId':_0x10df7d['id'],'AttachmentId':_0x52d6a6['body'][_0xffe5('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xffe5('0xa4')],'as':_0xffe5('0xb4')}]})[_0xffe5('0x21')](function(_0x4c9c51){return[_0x4c9c51,!![]];});});}else{throw new Error(_0xffe5('0xb5'));}})[_0xffe5('0xb6')](function(_0x98b6c7,_0x2784a3){if(_0x2784a3){return _0x98b6c7;}return db[_0xffe5('0xa4')][_0xffe5('0x5e')]({'direction':_0xffe5('0xb7'),'read':![],'body':_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')][0x0][_0xffe5('0xb3')],'FaxAccountId':_0x8ef85b['id'],'FaxInteractionId':_0x98b6c7['id'],'UserId':_0x52d6a6['user']['id'],'ContactId':_0x98b6c7[_0xffe5('0xb8')],'AttachmentId':_0x52d6a6['body']['attachments'][0x0]['id']})['then'](function(_0x3b5f5f){_0x98b6c7[_0xffe5('0xb9')][_0xffe5('0xb4')]=[];_0x98b6c7[_0xffe5('0xb9')][_0xffe5('0xb4')][_0xffe5('0x9a')](_0x3b5f5f[_0xffe5('0xb9')]);return _0x98b6c7;});})[_0xffe5('0x21')](function(_0x507a06){respondWithRpcPromise(_0xffe5('0xba'),_0xffe5('0xba'),{'FaxAccountId':_[_0xffe5('0xae')](_0x52d6a6[_0xffe5('0x59')]['id'])?undefined:_0x52d6a6[_0xffe5('0x59')]['id'],'path':_['isNil'](_0x52d6a6[_0xffe5('0x5f')][_0xffe5('0xab')][0x0][_0xffe5('0x9')])?undefined:_0x52d6a6['body'][_0xffe5('0xab')][0x0]['path'],'fax':_[_0xffe5('0xae')](_0x52d6a6[_0xffe5('0x5f')]['to'][0x0])?undefined:_0x52d6a6['body']['to'][0x0],'AttachmentId':_0x52d6a6['body'][_0xffe5('0xab')][0x0]['id']},client9002)[_0xffe5('0x21')](function(_0x2330b7){logger['info'](_0xffe5('0xbb'),_0x2330b7);})['catch'](function(_0x3a9e81){logger['info'](_0xffe5('0xbb'),_0x3a9e81);});return _0x507a06;})[_0xffe5('0x21')](respondWithResult(_0x48bd3f,null))[_0xffe5('0x2a')](handleError(_0x48bd3f,null));};exports[_0xffe5('0xbc')]=function(_0x5b8001,_0xc2c227,_0x5dc05a){return db[_0xffe5('0x42')]['find']({'where':{'id':_0x5b8001[_0xffe5('0x59')]['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0xc2c227,null))[_0xffe5('0x21')](function(_0x1c7695){if(_0x1c7695){return _0x1c7695[_0xffe5('0xbc')](_0x5b8001[_0xffe5('0x5f')]['ids'],_[_0xffe5('0x74')](_0x5b8001['body'],[_0xffe5('0x6f'),'id'])||{})[_0xffe5('0xb6')](function(_0x1d60cf){for(var _0xb375ad=0x0;_0xb375ad<_0x5b8001[_0xffe5('0x5f')][_0xffe5('0x6f')][_0xffe5('0x5b')];_0xb375ad+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x5b8001[_0xffe5('0x5f')][_0xffe5('0x6f')][_0xb375ad]),'FaxAccountId':Number(_0x5b8001[_0xffe5('0x59')]['id'])});}return _0x1d60cf;});}})[_0xffe5('0x21')](respondWithResult(_0xc2c227,null))['catch'](handleError(_0xc2c227,null));};exports[_0xffe5('0xbd')]=function(_0x23957e,_0x3aeab8,_0x1ddf7e){return db[_0xffe5('0x42')][_0xffe5('0x5d')]({'where':{'id':_0x23957e['params']['id']}})[_0xffe5('0x21')](handleEntityNotFound(_0x3aeab8,null))['then'](function(_0x3a4565){if(_0x3a4565){return _0x3a4565[_0xffe5('0xbd')](_0x23957e['query'][_0xffe5('0x6f')])['then'](function(){if(_[_0xffe5('0xbe')](_0x23957e[_0xffe5('0x47')][_0xffe5('0x6f')])){for(var _0x4e6244=0x0;_0x4e6244<_0x23957e[_0xffe5('0x47')]['ids'][_0xffe5('0x5b')];_0x4e6244+=0x1){socket[_0xffe5('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x23957e[_0xffe5('0x47')][_0xffe5('0x6f')][_0x4e6244]),'FaxAccountId':Number(_0x23957e[_0xffe5('0x59')]['id'])});}}else{socket[_0xffe5('0xbf')](_0xffe5('0xc0'),{'UserId':Number(_0x23957e[_0xffe5('0x47')][_0xffe5('0x6f')]),'FaxAccountId':Number(_0x23957e[_0xffe5('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x3aeab8,null))[_0xffe5('0x2a')](handleError(_0x3aeab8,null));};exports[_0xffe5('0xc1')]=function(_0x34cf5b,_0x230f75,_0xa7049f){var _0x5ee1fa={};var _0x5ef7ea={};var _0x425b96;var _0x124b86;return db[_0xffe5('0x42')][_0xffe5('0x6b')]({'where':{'id':_0x34cf5b['params']['id']}})['then'](handleEntityNotFound(_0x230f75,null))[_0xffe5('0x21')](function(_0x49a131){if(_0x49a131){_0x425b96=_0x49a131;_0x5ef7ea[_0xffe5('0x46')]=_[_0xffe5('0x48')](db[_0xffe5('0x78')]['rawAttributes']);_0x5ef7ea['query']=_[_0xffe5('0x48')](_0x34cf5b[_0xffe5('0x47')]);_0x5ef7ea[_0xffe5('0x4f')]=_[_0xffe5('0x4a')](_0x5ef7ea['model'],_0x5ef7ea[_0xffe5('0x47')]);_0x5ee1fa['attributes']=_[_0xffe5('0x4a')](_0x5ef7ea[_0xffe5('0x46')],qs[_0xffe5('0x5a')](_0x34cf5b[_0xffe5('0x47')][_0xffe5('0x5a')]));_0x5ee1fa[_0xffe5('0x49')]=_0x5ee1fa[_0xffe5('0x49')][_0xffe5('0x5b')]?_0x5ee1fa['attributes']:_0x5ef7ea[_0xffe5('0x46')];_0x5ee1fa[_0xffe5('0x4d')]=qs[_0xffe5('0x4e')](_0x34cf5b[_0xffe5('0x47')][_0xffe5('0x4e')]);_0x5ee1fa[_0xffe5('0x52')]=qs['filters'](_[_0xffe5('0x50')](_0x34cf5b[_0xffe5('0x47')],_0x5ef7ea[_0xffe5('0x4f')]));if(_0x34cf5b[_0xffe5('0x47')][_0xffe5('0x51')]){_0x5ee1fa[_0xffe5('0x52')]=_[_0xffe5('0x53')](_0x5ee1fa['where'],{'$or':_['map'](_0x5ee1fa[_0xffe5('0x49')],function(_0x4554a4){var _0x51819b={};_0x51819b[_0x4554a4]={'$like':'%'+_0x34cf5b[_0xffe5('0x47')][_0xffe5('0x51')]+'%'};return _0x51819b;})});}_0x5ee1fa=_['merge']({},_0x5ee1fa,_0x34cf5b[_0xffe5('0x5c')]);return _0x425b96[_0xffe5('0xc1')](_0x5ee1fa);}})['then'](function(_0x5ba3e1){if(_0x5ba3e1){_0x124b86=_0x5ba3e1[_0xffe5('0x5b')];if(!_0x34cf5b[_0xffe5('0x47')][_0xffe5('0x4b')](_0xffe5('0x4c'))){_0x5ee1fa[_0xffe5('0x2f')]=qs['limit'](_0x34cf5b[_0xffe5('0x47')][_0xffe5('0x2f')]);_0x5ee1fa['offset']=qs['offset'](_0x34cf5b[_0xffe5('0x47')]['offset']);}return _0x425b96['getAgents'](_0x5ee1fa);}})['then'](function(_0x1318a0){if(_0x1318a0){return _0x1318a0?{'count':_0x124b86,'rows':_0x1318a0}:null;}})['then'](respondWithResult(_0x230f75,null))['catch'](handleError(_0x230f75,null));}; \ No newline at end of file +var _0x6739=['merge','includeAll','include','findAll','catch','show','Pause','keys','rawAttributes','options','find','create','user','get','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','intersection','pick','rows','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','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','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','root','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','FaxAccounts','UserProfileResource','stack','send','mandatoryDispositionPause','FaxAccount','type','key','model','map','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL'];(function(_0x51baef,_0x15ab1a){var _0x593586=function(_0x3ea835){while(--_0x3ea835){_0x51baef['push'](_0x51baef['shift']());}};_0x593586(++_0x15ab1a);}(_0x6739,0x141));var _0x9673=function(_0x24dd66,_0x3af898){_0x24dd66=_0x24dd66-0x0;var _0x3b994a=_0x6739[_0x24dd66];return _0x3b994a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9673('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9673('0x1'));var moment=require('moment');var BPromise=require(_0x9673('0x2'));var Mustache=require(_0x9673('0x3'));var util=require(_0x9673('0x4'));var path=require(_0x9673('0x5'));var sox=require(_0x9673('0x6'));var csv=require(_0x9673('0x7'));var ejs=require(_0x9673('0x8'));var fs=require('fs');var fs_extra=require(_0x9673('0x9'));var _=require(_0x9673('0xa'));var squel=require(_0x9673('0xb'));var crypto=require(_0x9673('0xc'));var jsforce=require(_0x9673('0xd'));var deskjs=require(_0x9673('0xe'));var toCsv=require(_0x9673('0x7'));var querystring=require(_0x9673('0xf'));var Papa=require(_0x9673('0x10'));var Redis=require(_0x9673('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9673('0x12'));var hardwareService=require(_0x9673('0x13'));var logger=require(_0x9673('0x14'))(_0x9673('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9673('0x16'));var db=require(_0x9673('0x17'))['db'];config[_0x9673('0x18')]=_['defaults'](config[_0x9673('0x18')],{'host':_0x9673('0x19'),'port':0x18eb});var socket=require(_0x9673('0x1a'))(new Redis(config[_0x9673('0x18')]));require(_0x9673('0x1b'))[_0x9673('0x1c')](socket);var jayson=require(_0x9673('0x1d'));var client=jayson[_0x9673('0x1e')][_0x9673('0x1f')]({'port':0x232c});var client9002=jayson[_0x9673('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43fd64,_0x1aed05,_0x4e900a,_0x496f47){return new BPromise(function(_0x2368b9,_0x5da677){var _0x51185e=_0x496f47||client;return _0x51185e[_0x9673('0x20')](_0x43fd64,_0x4e900a)[_0x9673('0x21')](function(_0x18a5d5){logger['info'](_0x9673('0x22'),_0x1aed05,_0x9673('0x23'));logger[_0x9673('0x24')](_0x9673('0x25'),_0x1aed05,_0x9673('0x23'),JSON[_0x9673('0x26')](_0x18a5d5));if(_0x18a5d5['error']){if(_0x18a5d5[_0x9673('0x27')][_0x9673('0x28')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1aed05,_0x18a5d5[_0x9673('0x27')][_0x9673('0x29')]);return _0x5da677(_0x18a5d5['error'][_0x9673('0x29')]);}logger[_0x9673('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1aed05,_0x18a5d5[_0x9673('0x27')][_0x9673('0x29')]);return _0x2368b9(_0x18a5d5[_0x9673('0x27')][_0x9673('0x29')]);}else{logger[_0x9673('0x2a')](_0x9673('0x22'),_0x1aed05,'request\x20sent');_0x2368b9(_0x18a5d5[_0x9673('0x2b')][_0x9673('0x29')]);}})['catch'](function(_0x39d876){logger['error'](_0x9673('0x22'),_0x1aed05,_0x39d876);_0x5da677(_0x39d876);});});}function respondWithStatusCode(_0x382e47,_0x5ec1f9){_0x5ec1f9=_0x5ec1f9||0xcc;return function(_0x5ed424){if(_0x5ed424){return _0x382e47[_0x9673('0x2c')](_0x5ec1f9);}return _0x382e47['status'](_0x5ec1f9)['end']();};}function respondWithResult(_0x5b3c65,_0x35ef4e){_0x35ef4e=_0x35ef4e||0xc8;return function(_0xbf5400){if(_0xbf5400){return _0x5b3c65[_0x9673('0x2d')](_0x35ef4e)[_0x9673('0x2e')](_0xbf5400);}};}function respondWithFilteredResult(_0xf8964,_0xf75b50){return function(_0x3d0e86){if(_0x3d0e86){var _0x17fa2b=typeof _0xf75b50[_0x9673('0x2f')]===_0x9673('0x30')&&typeof _0xf75b50['limit']==='undefined';var _0x186bcc=_0x3d0e86['count'];var _0x5af24d=_0x17fa2b?0x0:_0xf75b50[_0x9673('0x2f')];var _0x35a990=_0x17fa2b?_0x3d0e86[_0x9673('0x31')]:_0xf75b50[_0x9673('0x2f')]+_0xf75b50[_0x9673('0x32')];var _0x40cce7;if(_0x35a990>=_0x186bcc){_0x35a990=_0x186bcc;_0x40cce7=0xc8;}else{_0x40cce7=0xce;}_0xf8964[_0x9673('0x2d')](_0x40cce7);return _0xf8964[_0x9673('0x33')](_0x9673('0x34'),_0x5af24d+'-'+_0x35a990+'/'+_0x186bcc)['json'](_0x3d0e86);}return null;};}function patchUpdates(_0x5c6fe0){return function(_0xf864fb){try{jsonpatch[_0x9673('0x35')](_0xf864fb,_0x5c6fe0,!![]);}catch(_0x2be483){return BPromise[_0x9673('0x36')](_0x2be483);}return _0xf864fb[_0x9673('0x37')]();};}function saveUpdates(_0x2697bb,_0x164a71){return function(_0x18edae){if(_0x18edae){return _0x18edae['update'](_0x2697bb)[_0x9673('0x21')](function(_0x59dd3f){return _0x59dd3f;});}return null;};}function removeEntity(_0x3d42b2,_0x2ec826){return function(_0x2d59cc){if(_0x2d59cc){return _0x2d59cc[_0x9673('0x38')]()[_0x9673('0x21')](function(){var _0x196877=_0x2d59cc['get']({'plain':!![]});var _0x5e2ab7=_0x9673('0x39');return db[_0x9673('0x3a')]['destroy']({'where':{'type':_0x5e2ab7,'resourceId':_0x196877['id']}})[_0x9673('0x21')](function(){return _0x2d59cc;});})[_0x9673('0x21')](function(){_0x3d42b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eb5e7,_0x55fcfc){return function(_0x1ee02f){if(!_0x1ee02f){_0x3eb5e7[_0x9673('0x2c')](0x194);}return _0x1ee02f;};}function handleError(_0x593b08,_0x7cc8f9){_0x7cc8f9=_0x7cc8f9||0x1f4;return function(_0x55a7db){logger['error'](_0x55a7db[_0x9673('0x3b')]);if(_0x55a7db['name']){delete _0x55a7db['name'];}_0x593b08['status'](_0x7cc8f9)[_0x9673('0x3c')](_0x55a7db);};}exports['index']=function(_0x38ec96,_0x5e8792){var _0x35ba98={'include':[{'model':db['Pause'],'as':_0x9673('0x3d')}]},_0x52fb30={},_0xb71e1b={'count':0x0,'rows':[]};var _0x1b4412=_['map'](db[_0x9673('0x3e')]['rawAttributes'],function(_0x3402f5){return{'name':_0x3402f5['fieldName'],'type':_0x3402f5[_0x9673('0x3f')][_0x9673('0x40')]};});_0x52fb30[_0x9673('0x41')]=_[_0x9673('0x42')](_0x1b4412,_0x9673('0x43'));_0x52fb30[_0x9673('0x44')]=_['keys'](_0x38ec96['query']);_0x52fb30[_0x9673('0x45')]=_['intersection'](_0x52fb30['model'],_0x52fb30[_0x9673('0x44')]);_0x35ba98[_0x9673('0x46')]=_['intersection'](_0x52fb30[_0x9673('0x41')],qs[_0x9673('0x47')](_0x38ec96[_0x9673('0x44')]['fields']));_0x35ba98[_0x9673('0x46')]=_0x35ba98[_0x9673('0x46')][_0x9673('0x48')]?_0x35ba98['attributes']:_0x52fb30['model'];if(!_0x38ec96['query'][_0x9673('0x49')]('nolimit')){_0x35ba98['limit']=qs[_0x9673('0x32')](_0x38ec96[_0x9673('0x44')]['limit']);_0x35ba98[_0x9673('0x2f')]=qs['offset'](_0x38ec96[_0x9673('0x44')]['offset']);}_0x35ba98[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x38ec96[_0x9673('0x44')][_0x9673('0x4b')]);_0x35ba98['where']=qs['filters'](_['pick'](_0x38ec96[_0x9673('0x44')],_0x52fb30[_0x9673('0x45')]),_0x1b4412);if(_0x38ec96[_0x9673('0x44')][_0x9673('0x4c')]){_0x35ba98[_0x9673('0x4d')]=_['merge'](_0x35ba98[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x1b4412,function(_0x37eab3){if(_0x37eab3[_0x9673('0x3f')]!==_0x9673('0x4e')){var _0x416ce9={};_0x416ce9[_0x37eab3[_0x9673('0x43')]]={'$like':'%'+_0x38ec96['query'][_0x9673('0x4c')]+'%'};return _0x416ce9;}})});}_0x35ba98=_[_0x9673('0x4f')]({},_0x35ba98,_0x38ec96['options']);var _0x52a0b9={'where':_0x35ba98[_0x9673('0x4d')]};return db[_0x9673('0x3e')][_0x9673('0x31')](_0x52a0b9)[_0x9673('0x21')](function(_0x31555d){_0xb71e1b[_0x9673('0x31')]=_0x31555d;if(_0x38ec96[_0x9673('0x44')][_0x9673('0x50')]){_0x35ba98[_0x9673('0x51')]=[{'all':!![]}];}return db[_0x9673('0x3e')][_0x9673('0x52')](_0x35ba98);})[_0x9673('0x21')](function(_0x48ea86){_0xb71e1b['rows']=_0x48ea86;return _0xb71e1b;})[_0x9673('0x21')](respondWithFilteredResult(_0x5e8792,_0x35ba98))[_0x9673('0x53')](handleError(_0x5e8792,null));};exports[_0x9673('0x54')]=function(_0x51c586,_0x8c693){var _0x3a02c0={'raw':![],'where':{'id':_0x51c586['params']['id']},'include':[{'model':db[_0x9673('0x55')],'as':_0x9673('0x3d')}]},_0x48bc86={};_0x48bc86[_0x9673('0x41')]=_[_0x9673('0x56')](db['FaxAccount'][_0x9673('0x57')]);_0x48bc86[_0x9673('0x44')]=_[_0x9673('0x56')](_0x51c586[_0x9673('0x44')]);_0x48bc86[_0x9673('0x45')]=_['intersection'](_0x48bc86[_0x9673('0x41')],_0x48bc86[_0x9673('0x44')]);_0x3a02c0['attributes']=_['intersection'](_0x48bc86[_0x9673('0x41')],qs[_0x9673('0x47')](_0x51c586[_0x9673('0x44')][_0x9673('0x47')]));_0x3a02c0[_0x9673('0x46')]=_0x3a02c0[_0x9673('0x46')][_0x9673('0x48')]?_0x3a02c0[_0x9673('0x46')]:_0x48bc86[_0x9673('0x41')];if(_0x51c586[_0x9673('0x44')]['includeAll']){_0x3a02c0['include']=[{'all':!![]}];}_0x3a02c0=_[_0x9673('0x4f')]({},_0x3a02c0,_0x51c586[_0x9673('0x58')]);return db[_0x9673('0x3e')][_0x9673('0x59')](_0x3a02c0)['then'](handleEntityNotFound(_0x8c693,null))[_0x9673('0x21')](respondWithResult(_0x8c693,null))[_0x9673('0x53')](handleError(_0x8c693,null));};exports[_0x9673('0x5a')]=function(_0x15380e,_0x7defcc){return db['FaxAccount']['create'](_0x15380e['body'],{})[_0x9673('0x21')](function(_0x385bca){var _0x2a4d2b=_0x15380e[_0x9673('0x5b')][_0x9673('0x5c')]({'plain':!![]});if(!_0x2a4d2b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a4d2b[_0x9673('0x5d')]==='user'){var _0x30e237=_0x385bca[_0x9673('0x5c')]({'plain':!![]});var _0x2c7a1c=_0x9673('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x2c7a1c,'userProfileId':_0x2a4d2b['userProfileId']},'raw':!![]})[_0x9673('0x21')](function(_0x2046d5){if(_0x2046d5&&_0x2046d5['autoAssociation']===0x0){return db[_0x9673('0x3a')][_0x9673('0x5a')]({'name':_0x30e237['name'],'resourceId':_0x30e237['id'],'type':_0x2046d5[_0x9673('0x43')],'sectionId':_0x2046d5['id']},{})[_0x9673('0x21')](function(){return _0x385bca;});}else{return _0x385bca;}})[_0x9673('0x53')](function(_0x5e2892){logger[_0x9673('0x27')](_0x9673('0x5e'),_0x5e2892);throw _0x5e2892;});}return _0x385bca;})[_0x9673('0x21')](respondWithResult(_0x7defcc,0xc9))[_0x9673('0x53')](handleError(_0x7defcc,null));};exports[_0x9673('0x5f')]=function(_0x5b4da8,_0x5d0229){if(_0x5b4da8[_0x9673('0x60')]['id']){delete _0x5b4da8[_0x9673('0x60')]['id'];}return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x5b4da8['params']['id']},'include':[{'model':db[_0x9673('0x55')],'as':_0x9673('0x3d')}]})['then'](handleEntityNotFound(_0x5d0229,null))[_0x9673('0x21')](saveUpdates(_0x5b4da8[_0x9673('0x60')],null))[_0x9673('0x21')](respondWithResult(_0x5d0229,null))['catch'](handleError(_0x5d0229,null));};exports['destroy']=function(_0x54a16b,_0x3e4fa1){return db['FaxAccount']['find']({'where':{'id':_0x54a16b[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x3e4fa1,null))[_0x9673('0x21')](removeEntity(_0x3e4fa1,null))['catch'](handleError(_0x3e4fa1,null));};exports[_0x9673('0x62')]=function(_0x38d2d2,_0x43ba1a){return db[_0x9673('0x3e')][_0x9673('0x62')]()['then'](respondWithResult(_0x43ba1a,null))[_0x9673('0x53')](handleError(_0x43ba1a,null));};exports[_0x9673('0x63')]=function(_0x322127,_0x41c6f8,_0x534f14){if(_0x322127[_0x9673('0x60')]['id']){delete _0x322127[_0x9673('0x60')]['id'];}return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x322127['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x41c6f8,null))[_0x9673('0x21')](function(_0x5e0d1a){if(_0x5e0d1a){_0x322127[_0x9673('0x60')][_0x9673('0x64')]=_0x5e0d1a['id'];return db[_0x9673('0x65')][_0x9673('0x5a')](_0x322127[_0x9673('0x60')]);}})[_0x9673('0x21')](respondWithResult(_0x41c6f8,null))['catch'](handleError(_0x41c6f8,null));};exports[_0x9673('0x66')]=function(_0x1d872e,_0x8f42a0,_0x2e3ee0){var _0x54751c={'raw':![],'where':{}};var _0xedc3dd={};var _0x418ec7={'count':0x0,'rows':[]};return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x1d872e[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x8f42a0,null))[_0x9673('0x21')](function(_0x526f33){if(_0x526f33){_0xedc3dd[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x65')][_0x9673('0x57')]);_0xedc3dd[_0x9673('0x44')]=_['keys'](_0x1d872e[_0x9673('0x44')]);_0xedc3dd[_0x9673('0x45')]=_[_0x9673('0x68')](_0xedc3dd['model'],_0xedc3dd[_0x9673('0x44')]);_0x54751c[_0x9673('0x46')]=_['intersection'](_0xedc3dd[_0x9673('0x41')],qs[_0x9673('0x47')](_0x1d872e[_0x9673('0x44')][_0x9673('0x47')]));_0x54751c[_0x9673('0x46')]=_0x54751c[_0x9673('0x46')]['length']?_0x54751c[_0x9673('0x46')]:_0xedc3dd[_0x9673('0x41')];if(!_0x1d872e[_0x9673('0x44')][_0x9673('0x49')]('nolimit')){_0x54751c[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x1d872e['query']['limit']);_0x54751c[_0x9673('0x2f')]=qs[_0x9673('0x2f')](_0x1d872e[_0x9673('0x44')]['offset']);}_0x54751c[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x1d872e[_0x9673('0x44')][_0x9673('0x4b')]);_0x54751c[_0x9673('0x4d')]=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x1d872e[_0x9673('0x44')],_0xedc3dd[_0x9673('0x45')]));_0x54751c[_0x9673('0x4d')][_0x9673('0x64')]=_0x526f33['id'];if(_0x1d872e[_0x9673('0x44')][_0x9673('0x4c')]){_0x54751c[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x54751c[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x54751c[_0x9673('0x46')],function(_0x5a5b0c){var _0x3ee61f={};_0x3ee61f[_0x5a5b0c]={'$like':'%'+_0x1d872e['query'][_0x9673('0x4c')]+'%'};return _0x3ee61f;})});}_0x54751c=_['merge']({},_0x54751c,_0x1d872e[_0x9673('0x58')]);return db[_0x9673('0x65')][_0x9673('0x31')]({'where':_0x54751c[_0x9673('0x4d')]})[_0x9673('0x21')](function(_0x4e3b99){_0x418ec7[_0x9673('0x31')]=_0x4e3b99;if(_0x1d872e[_0x9673('0x44')][_0x9673('0x50')]){_0x54751c[_0x9673('0x51')]=[{'all':!![]}];}return db['Disposition'][_0x9673('0x52')](_0x54751c);})[_0x9673('0x21')](function(_0x5c9c86){_0x418ec7[_0x9673('0x6a')]=_0x5c9c86;return _0x418ec7;});}})[_0x9673('0x21')](respondWithFilteredResult(_0x8f42a0,_0x54751c))[_0x9673('0x53')](handleError(_0x8f42a0,null));};exports['removeDispositions']=function(_0x563944,_0x468411,_0x214ad4){return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x563944['params']['id']}})['then'](handleEntityNotFound(_0x468411,null))[_0x9673('0x21')](function(_0x5493e0){if(_0x5493e0){return _0x5493e0['removeDispositions'](_0x563944['query']['ids']);}})[_0x9673('0x21')](respondWithStatusCode(_0x468411,null))[_0x9673('0x53')](handleError(_0x468411,null));};exports[_0x9673('0x6b')]=function(_0x541e27,_0x29a025,_0x16fb54){if(_0x541e27[_0x9673('0x60')]['id']){delete _0x541e27[_0x9673('0x60')]['id'];}return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x541e27[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x29a025,null))[_0x9673('0x21')](function(_0x1e75d2){if(_0x1e75d2){_0x541e27['body']['FaxAccountId']=_0x1e75d2['id'];return db[_0x9673('0x6c')][_0x9673('0x5a')](_0x541e27['body']);}})[_0x9673('0x21')](respondWithResult(_0x29a025,null))[_0x9673('0x53')](handleError(_0x29a025,null));};exports[_0x9673('0x6d')]=function(_0x2d7488,_0xa93a97,_0x36d2c7){var _0x39e20e={'raw':![],'where':{}};var _0x2f5ad1={};var _0x3679e8={'count':0x0,'rows':[]};return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x2d7488[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0xa93a97,null))['then'](function(_0x1c2f84){if(_0x1c2f84){_0x2f5ad1[_0x9673('0x41')]=_['keys'](db['CannedAnswer'][_0x9673('0x57')]);_0x2f5ad1['query']=_['keys'](_0x2d7488[_0x9673('0x44')]);_0x2f5ad1[_0x9673('0x45')]=_[_0x9673('0x68')](_0x2f5ad1[_0x9673('0x41')],_0x2f5ad1['query']);_0x39e20e[_0x9673('0x46')]=_['intersection'](_0x2f5ad1['model'],qs[_0x9673('0x47')](_0x2d7488['query'][_0x9673('0x47')]));_0x39e20e[_0x9673('0x46')]=_0x39e20e[_0x9673('0x46')]['length']?_0x39e20e['attributes']:_0x2f5ad1['model'];if(!_0x2d7488[_0x9673('0x44')][_0x9673('0x49')](_0x9673('0x6e'))){_0x39e20e[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x2d7488[_0x9673('0x44')][_0x9673('0x32')]);_0x39e20e[_0x9673('0x2f')]=qs[_0x9673('0x2f')](_0x2d7488[_0x9673('0x44')][_0x9673('0x2f')]);}_0x39e20e[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x2d7488[_0x9673('0x44')][_0x9673('0x4b')]);_0x39e20e[_0x9673('0x4d')]=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x2d7488['query'],_0x2f5ad1['filters']));_0x39e20e[_0x9673('0x4d')][_0x9673('0x64')]=_0x1c2f84['id'];if(_0x2d7488[_0x9673('0x44')]['filter']){_0x39e20e['where']=_[_0x9673('0x4f')](_0x39e20e[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x39e20e['attributes'],function(_0x3a3fbd){var _0x35a21d={};_0x35a21d[_0x3a3fbd]={'$like':'%'+_0x2d7488[_0x9673('0x44')]['filter']+'%'};return _0x35a21d;})});}_0x39e20e=_[_0x9673('0x4f')]({},_0x39e20e,_0x2d7488[_0x9673('0x58')]);return db[_0x9673('0x6c')]['count']({'where':_0x39e20e[_0x9673('0x4d')]})['then'](function(_0x2f7904){_0x3679e8[_0x9673('0x31')]=_0x2f7904;if(_0x2d7488[_0x9673('0x44')][_0x9673('0x50')]){_0x39e20e[_0x9673('0x51')]=[{'all':!![]}];}return db[_0x9673('0x6c')][_0x9673('0x52')](_0x39e20e);})[_0x9673('0x21')](function(_0xfef522){_0x3679e8[_0x9673('0x6a')]=_0xfef522;return _0x3679e8;});}})[_0x9673('0x21')](respondWithFilteredResult(_0xa93a97,_0x39e20e))[_0x9673('0x53')](handleError(_0xa93a97,null));};exports[_0x9673('0x6f')]=function(_0x1d9aa4,_0x2f9b67,_0x37b233){return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x1d9aa4['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x2f9b67,null))['then'](function(_0x2186cc){if(_0x2186cc){return _0x2186cc['removeAnswers'](_0x1d9aa4['query'][_0x9673('0x70')]);}})[_0x9673('0x21')](respondWithStatusCode(_0x2f9b67,null))[_0x9673('0x53')](handleError(_0x2f9b67,null));};exports[_0x9673('0x71')]=function(_0xd73cd1,_0x380a33,_0x3e3890){return db[_0x9673('0x72')]['find']({'where':{'id':_0xd73cd1[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x380a33,null))[_0x9673('0x21')](function(_0x28a4d2){if(_0x28a4d2){return _0x28a4d2[_0x9673('0x71')](_0xd73cd1['body'][_0x9673('0x70')],_[_0x9673('0x73')](_0xd73cd1[_0x9673('0x60')],[_0x9673('0x70'),'id'])||{});}})[_0x9673('0x21')](respondWithResult(_0x380a33,null))['catch'](handleError(_0x380a33,null));};exports[_0x9673('0x74')]=function(_0x253c40,_0x379b59,_0x40fc90){var _0x17b47f={'raw':![],'where':{}};var _0x4ed828={};var _0x2ec904={'count':0x0,'rows':[]};return db[_0x9673('0x3e')]['findOne']({'where':{'id':_0x253c40['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x379b59,null))[_0x9673('0x21')](function(_0x50fc1b){if(_0x50fc1b){_0x4ed828[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x72')]['rawAttributes']);_0x4ed828[_0x9673('0x44')]=_['keys'](_0x253c40[_0x9673('0x44')]);_0x4ed828[_0x9673('0x45')]=_[_0x9673('0x68')](_0x4ed828[_0x9673('0x41')],_0x4ed828[_0x9673('0x44')]);_0x17b47f[_0x9673('0x46')]=_[_0x9673('0x68')](_0x4ed828['model'],qs[_0x9673('0x47')](_0x253c40[_0x9673('0x44')][_0x9673('0x47')]));_0x17b47f['attributes']=_0x17b47f['attributes'][_0x9673('0x48')]?_0x17b47f['attributes']:_0x4ed828[_0x9673('0x41')];if(!_0x253c40[_0x9673('0x44')][_0x9673('0x49')](_0x9673('0x6e'))){_0x17b47f[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x253c40[_0x9673('0x44')][_0x9673('0x32')]);_0x17b47f[_0x9673('0x2f')]=qs[_0x9673('0x2f')](_0x253c40[_0x9673('0x44')]['offset']);}_0x17b47f['order']=qs['sort'](_0x253c40[_0x9673('0x44')]['sort']);_0x17b47f['where']=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x253c40[_0x9673('0x44')],_0x4ed828[_0x9673('0x45')]));_0x17b47f['where'][_0x9673('0x64')]=_0x50fc1b['id'];if(_0x253c40['query'][_0x9673('0x4c')]){_0x17b47f[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x17b47f[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x17b47f[_0x9673('0x46')],function(_0x13d255){var _0x32561f={};_0x32561f[_0x13d255]={'$like':'%'+_0x253c40['query'][_0x9673('0x4c')]+'%'};return _0x32561f;})});}_0x17b47f=_[_0x9673('0x4f')]({},_0x17b47f,_0x253c40[_0x9673('0x58')]);return db[_0x9673('0x72')]['count']({'where':_0x17b47f[_0x9673('0x4d')]})[_0x9673('0x21')](function(_0x3dfff4){_0x2ec904[_0x9673('0x31')]=_0x3dfff4;if(_0x253c40[_0x9673('0x44')]['includeAll']){_0x17b47f[_0x9673('0x51')]=[{'model':db[_0x9673('0x75')],'as':_0x9673('0x76'),'required':![]},{'model':db[_0x9673('0x77')],'as':_0x9673('0x78'),'attributes':[_0x9673('0x43'),_0x9673('0x79'),_0x9673('0x7a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9673('0x43'),_0x9673('0x7b')],'where':_0x253c40[_0x9673('0x44')][_0x9673('0x7c')]?{'id':_0x253c40[_0x9673('0x44')][_0x9673('0x7c')]}:undefined,'required':_0x253c40['query'][_0x9673('0x7c')]?!![]:![]}];}return db[_0x9673('0x72')][_0x9673('0x52')](_0x17b47f);})[_0x9673('0x21')](function(_0xfc4dd4){_0x2ec904[_0x9673('0x6a')]=_0xfc4dd4;return _0x2ec904;});}})[_0x9673('0x21')](respondWithFilteredResult(_0x379b59,_0x17b47f))['catch'](handleError(_0x379b59,null));};exports[_0x9673('0x7d')]=function(_0x202df0,_0x370f86){var _0x385b43=_0x202df0['params']['id'];var _0x5b3c0e=_0x202df0[_0x9673('0x60')];var _0x41fb46=0xc8;var _0x1addaf=null;return db[_0x9673('0x7e')]['transaction']({'isolationLevel':db[_0x9673('0x7e')][_0x9673('0x7f')][_0x9673('0x80')][_0x9673('0x81')]},function(_0x1edb7f){return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x385b43},'transaction':_0x1edb7f})[_0x9673('0x21')](function(_0x2f95da){if(_0x2f95da){return db[_0x9673('0x82')]['destroy']({'where':{'FaxAccountId':_0x385b43},'transaction':_0x1edb7f})[_0x9673('0x21')](function(){var _0x179e04=_[_0x9673('0x42')](_0x5b3c0e,function(_0x6e3f06){_0x6e3f06['FaxAccountId']=_0x385b43;return _0x6e3f06;});return db[_0x9673('0x82')][_0x9673('0x83')](_0x179e04,{'transaction':_0x1edb7f});});}else{_0x41fb46=0x194;_0x1addaf=[];}});})['then'](function(){if(_0x41fb46!==0x194){return db[_0x9673('0x82')][_0x9673('0x84')]({'where':{'FaxAccountId':_0x385b43},'order':_0x9673('0x85')})[_0x9673('0x21')](function(_0x20da35){_0x1addaf=_0x20da35;});}})[_0x9673('0x53')](function(_0x1f4086){_0x41fb46=0x1f4;logger[_0x9673('0x27')](_0x1f4086[_0x9673('0x3b')]);if(_0x1f4086[_0x9673('0x43')]){delete _0x1f4086[_0x9673('0x43')];}_0x1addaf=_0x1f4086;})[_0x9673('0x86')](function(){if(_0x1addaf===null){_0x370f86['sendStatus'](_0x41fb46);}else{if(_0x41fb46===0x1f4){_0x370f86[_0x9673('0x2d')](_0x41fb46)[_0x9673('0x3c')](_0x1addaf);}else{_0x370f86[_0x9673('0x2d')](_0x41fb46)[_0x9673('0x2e')](_0x1addaf);}}});};exports[_0x9673('0x87')]=function(_0x799005,_0x5519b0,_0x42addf){var _0x56e244={};var _0x2fa300={};var _0x1da689;var _0x4a1c96;return db['FaxAccount'][_0x9673('0x67')]({'where':{'id':_0x799005[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x5519b0,null))[_0x9673('0x21')](function(_0x5d63b9){if(_0x5d63b9){_0x1da689=_0x5d63b9;_0x2fa300[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x82')][_0x9673('0x57')]);_0x2fa300[_0x9673('0x44')]=_['keys'](_0x799005[_0x9673('0x44')]);_0x2fa300[_0x9673('0x45')]=_[_0x9673('0x68')](_0x2fa300[_0x9673('0x41')],_0x2fa300[_0x9673('0x44')]);_0x56e244[_0x9673('0x46')]=_['intersection'](_0x2fa300[_0x9673('0x41')],qs[_0x9673('0x47')](_0x799005['query'][_0x9673('0x47')]));_0x56e244[_0x9673('0x46')]=_0x56e244[_0x9673('0x46')][_0x9673('0x48')]?_0x56e244[_0x9673('0x46')]:_0x2fa300[_0x9673('0x41')];_0x56e244[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x799005[_0x9673('0x44')][_0x9673('0x4b')]);_0x56e244[_0x9673('0x4d')]=qs['filters'](_['pick'](_0x799005[_0x9673('0x44')],_0x2fa300[_0x9673('0x45')]));if(_0x799005[_0x9673('0x44')][_0x9673('0x4c')]){_0x56e244[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x56e244['where'],{'$or':_[_0x9673('0x42')](_0x56e244[_0x9673('0x46')],function(_0x57abc1){var _0x419301={};_0x419301[_0x57abc1]={'$like':'%'+_0x799005[_0x9673('0x44')][_0x9673('0x4c')]+'%'};return _0x419301;})});}_0x56e244=_[_0x9673('0x4f')]({},_0x56e244,_0x799005[_0x9673('0x58')]);return _0x1da689[_0x9673('0x87')](_0x56e244);}})[_0x9673('0x21')](function(_0xd2f52d){if(_0xd2f52d){_0x4a1c96=_0xd2f52d['length'];if(!_0x799005[_0x9673('0x44')]['hasOwnProperty'](_0x9673('0x6e'))){_0x56e244[_0x9673('0x32')]=qs['limit'](_0x799005['query'][_0x9673('0x32')]);_0x56e244['offset']=qs[_0x9673('0x2f')](_0x799005[_0x9673('0x44')][_0x9673('0x2f')]);}return _0x1da689[_0x9673('0x87')](_0x56e244);}})[_0x9673('0x21')](function(_0x3f17a7){if(_0x3f17a7){return _0x3f17a7?{'count':_0x4a1c96,'rows':_0x3f17a7}:null;}})[_0x9673('0x21')](respondWithResult(_0x5519b0,null))['catch'](handleError(_0x5519b0,null));};function Extension(_0x229c4f,_0x169ad3,_0x3dc618,_0x5d05ff){this[_0x9673('0x88')]='from-voip-provider';this[_0x9673('0x89')]=_0x229c4f[_0x9673('0x8a')];this[_0x9673('0x8b')]=_0x5d05ff;this[_0x9673('0x3f')]='system';this[_0x9673('0x8c')]=_0x9673('0x8d');this[_0x9673('0x64')]=_0x229c4f['id'];this['priority']=_0x169ad3;this[_0x9673('0x8e')]=_0x3dc618;}function createExtensionsReciveFax(_0x2442ca){var _0x370cf5=0x1;var _0x5eed9b=[];_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,'',_0x9673('0x90')));_0x370cf5+=0x1;_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,_0x9673('0x91'),_0x9673('0x92')));_0x370cf5+=0x1;for(var _0x2f1ad6 in _0x2442ca){if(_0x2442ca[_0x9673('0x49')](_0x2f1ad6)&&(_0x2f1ad6===_0x9673('0x93')||_0x2f1ad6===_0x9673('0x8a')||_0x2f1ad6===_0x9673('0x94')||_0x2f1ad6===_0x9673('0x95')||_0x2f1ad6==='headerinfo'||_0x2f1ad6===_0x9673('0x96')||_0x2f1ad6==='minrate'||_0x2f1ad6===_0x9673('0x97')||_0x2f1ad6===_0x9673('0x98'))){_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,_0x9673('0x99')+_0x2f1ad6+')='+_0x2442ca[_0x2f1ad6],_0x9673('0x92')));_0x370cf5+=0x1;}}_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,'6','Wait'));_0x370cf5+=0x1;_0x5eed9b[_0x9673('0x8f')](new Extension(_0x2442ca,_0x370cf5,_0x9673('0x9a'),_0x9673('0x9b')));_0x370cf5=0x0;return _0x5eed9b;}exports[_0x9673('0x9c')]=function(_0x1747e6,_0x34241d,_0x245eda){var _0x5c68d7;return db[_0x9673('0x7e')][_0x9673('0x9d')](function(_0xd7e5a3){return db[_0x9673('0x3e')][_0x9673('0x5a')](_0x1747e6[_0x9673('0x60')],{'transaction':_0xd7e5a3})[_0x9673('0x21')](function(_0x27a1c8){_0x5c68d7=_0x27a1c8['get']({'plain':!![]});return db[_0x9673('0x9e')][_0x9673('0x83')](createExtensionsReciveFax(_0x5c68d7),{'transaction':_0xd7e5a3});});})[_0x9673('0x21')](function(){return _0x5c68d7;})[_0x9673('0x21')](respondWithResult(_0x34241d,null))[_0x9673('0x53')](handleError(_0x34241d,null));};exports[_0x9673('0x9f')]=function(_0x39e9e0,_0x1a88a2,_0x30c6e5){var _0x2eb75f;return db[_0x9673('0x7e')][_0x9673('0x9d')](function(_0x28ac47){return db[_0x9673('0x3e')]['update'](_0x39e9e0[_0x9673('0x60')],{'where':{'id':_0x39e9e0[_0x9673('0x60')]['id']},'transaction':_0x28ac47})[_0x9673('0x21')](function(_0x2855a2){return db[_0x9673('0x9e')][_0x9673('0x38')]({'where':{'FaxAccountId':_0x39e9e0[_0x9673('0x60')]['id']},'transaction':_0x28ac47})[_0x9673('0x21')](function(_0x54806f){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x9673('0x73')](_0x39e9e0[_0x9673('0x60')],[_0x9673('0xa0'),_0x9673('0x40'),_0x9673('0xa1'),_0x9673('0xa2'),_0x9673('0xa3'),'ListId'])),{'transaction':_0x28ac47});});});})[_0x9673('0x21')](function(){return db['FaxAccount'][_0x9673('0xa4')](_0x39e9e0[_0x9673('0x60')]['id']);})[_0x9673('0x21')](respondWithResult(_0x1a88a2,null))['catch'](handleError(_0x1a88a2,null));};exports['getMessages']=function(_0x3cff70,_0x3d54a7,_0x4bb283){var _0x2caf40={'raw':!![],'where':{}};var _0x47c050={};var _0x5090f0={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9673('0x67')]({'where':{'id':_0x3cff70['params']['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x3d54a7,null))[_0x9673('0x21')](function(_0x5717f7){if(_0x5717f7){_0x47c050['model']=_[_0x9673('0x56')](db[_0x9673('0xa5')][_0x9673('0x57')]);_0x47c050[_0x9673('0x44')]=_[_0x9673('0x56')](_0x3cff70['query']);_0x47c050[_0x9673('0x45')]=_[_0x9673('0x68')](_0x47c050['model'],_0x47c050[_0x9673('0x44')]);_0x2caf40['attributes']=_[_0x9673('0x68')](_0x47c050[_0x9673('0x41')],qs[_0x9673('0x47')](_0x3cff70['query']['fields']));_0x2caf40['attributes']=_0x2caf40['attributes'][_0x9673('0x48')]?_0x2caf40[_0x9673('0x46')]:_0x47c050[_0x9673('0x41')];if(!_0x3cff70['query'][_0x9673('0x49')]('nolimit')){_0x2caf40[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x3cff70[_0x9673('0x44')]['limit']);_0x2caf40['offset']=qs[_0x9673('0x2f')](_0x3cff70[_0x9673('0x44')]['offset']);}_0x2caf40[_0x9673('0x4a')]=qs[_0x9673('0x4b')](_0x3cff70[_0x9673('0x44')][_0x9673('0x4b')]);_0x2caf40[_0x9673('0x4d')]=qs[_0x9673('0x45')](_[_0x9673('0x69')](_0x3cff70[_0x9673('0x44')],_0x47c050[_0x9673('0x45')]));_0x2caf40['where'][_0x9673('0x64')]=_0x5717f7['id'];if(_0x3cff70[_0x9673('0x44')]['filter']){_0x2caf40['where']=_['merge'](_0x2caf40[_0x9673('0x4d')],{'$or':_[_0x9673('0x42')](_0x2caf40[_0x9673('0x46')],function(_0x41a7a7){var _0x2ad2c4={};_0x2ad2c4[_0x41a7a7]={'$like':'%'+_0x3cff70[_0x9673('0x44')][_0x9673('0x4c')]+'%'};return _0x2ad2c4;})});}if(_0x3cff70[_0x9673('0x44')][_0x9673('0xa6')]){var _0x42bee1=_0x3cff70[_0x9673('0x44')][_0x9673('0xa6')][_0x9673('0xa7')](',');var _0x53f701={};_0x53f701[_0x42bee1[0x0]]={'$gte':moment(_0x42bee1[0x1])[_0x9673('0xa8')](_0x9673('0xa9'))};_0x2caf40[_0x9673('0x4d')]=_[_0x9673('0x4f')](_0x2caf40[_0x9673('0x4d')],_0x53f701);}_0x2caf40=_[_0x9673('0x4f')]({},_0x2caf40,_0x3cff70[_0x9673('0x58')]);return db[_0x9673('0xa5')][_0x9673('0x31')]({'where':_0x2caf40[_0x9673('0x4d')]})[_0x9673('0x21')](function(_0xce966d){_0x5090f0[_0x9673('0x31')]=_0xce966d;if(_0x3cff70[_0x9673('0x44')][_0x9673('0x50')]){_0x2caf40['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x2caf40);})['then'](function(_0x3f4135){_0x5090f0[_0x9673('0x6a')]=_0x3f4135;return _0x5090f0;});}})[_0x9673('0x21')](respondWithFilteredResult(_0x3d54a7,_0x2caf40))[_0x9673('0x53')](handleError(_0x3d54a7,null));};exports[_0x9673('0x3c')]=function(_0x5b6ae5,_0x5a2a65,_0x315317){var _0x28c154,_0x301b09={},_0x33243d;if(_0x5b6ae5[_0x9673('0x60')]['to']){_0x33243d=_0x5b6ae5[_0x9673('0x60')]['to'][0x0];}return db[_0x9673('0x3e')][_0x9673('0x59')]({'where':{'id':_0x5b6ae5['params']['id']},'include':[{'model':db[_0x9673('0xaa')],'as':_0x9673('0xab'),'include':[{'model':db[_0x9673('0x75')],'as':_0x9673('0xac'),'where':{'fax':_0x33243d},'limit':0x1,'order':[[_0x9673('0xa2'),_0x9673('0xad')]]}]}]})['then'](handleEntityNotFound(_0x5a2a65,null))['then'](function(_0xf2abc7){_0x28c154=_0xf2abc7;if(_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')]&&_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0x9673('0x48')]){for(var _0xbcca6b=0x0;_0xbcca6b<_0x5b6ae5[_0x9673('0x60')]['attachments'][_0x9673('0x48')];_0xbcca6b+=0x1){_0x5b6ae5['body'][_0x9673('0xae')][_0xbcca6b]={'filename':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0xbcca6b][_0x9673('0x43')],'id':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0xbcca6b]['id'],'path':path['join'](config[_0x9673('0xaf')],'server/files/attachments',_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][_0xbcca6b][_0x9673('0xb0')])};}}return respondWithRpcPromise(_0x9673('0xb1'),_0x9673('0xb1'),{'FaxAccountId':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x61')]['id'])?undefined:_0x5b6ae5[_0x9673('0x61')]['id'],'path':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0][_0x9673('0x5')])?undefined:_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0][_0x9673('0x5')],'fax':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')]['to'][0x0])?undefined:_0x5b6ae5[_0x9673('0x60')]['to'][0x0]},client9002);})[_0x9673('0x21')](function(){if(_0x28c154){if(_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')]['from'])){_0x5b6ae5['body']['from']=util[_0x9673('0xa8')](_0x9673('0xb3'),_0x28c154[_0x9673('0x43')],_0x28c154[_0x9673('0xb4')]);}if(_0x28c154[_0x9673('0xab')]){if(_0x28c154[_0x9673('0xab')][_0x9673('0xac')][_0x9673('0x48')]){return _0x28c154['List'][_0x9673('0xac')][0x0];}else{return db['CmContact']['create'](_[_0x9673('0xb5')](_0x5b6ae5[_0x9673('0x60')],{'firstName':_0x5b6ae5['body']['to'][0x0],'phone':_0x5b6ae5[_0x9673('0x60')]['to'][0x0],'fax':_0x5b6ae5['body']['to'][0x0],'ListId':_0x28c154[_0x9673('0xb6')]}));}}else{throw new Error(_0x9673('0xb7'));}}else{throw new Error(_0x9673('0xb8'));}})[_0x9673('0x21')](function(_0x110368){if(_0x110368){return db[_0x9673('0x72')][_0x9673('0x59')]({'where':{'ContactId':_0x110368['id'],'closed':![],'FaxAccountId':_0x28c154['id']}})['then'](function(_0x158698){if(_0x158698){return[_0x158698,![]];}return db[_0x9673('0x72')]['create']({'UserId':_0x5b6ae5[_0x9673('0x5b')]['id'],'ContactId':_0x110368['id'],'FaxAccountId':_0x28c154['id'],'fax':_0x5b6ae5[_0x9673('0x60')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x9673('0x4f')](_0x5b6ae5['body'],{'read':![],'body':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0]['filename'],'FaxAccountId':_0x28c154['id'],'UserId':_0x5b6ae5[_0x9673('0x5b')]['id'],'ContactId':_0x110368['id'],'AttachmentId':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x9673('0xb9')}]})['then'](function(_0x21ebf0){return[_0x21ebf0,!![]];});});}else{throw new Error(_0x9673('0xba'));}})[_0x9673('0xbb')](function(_0xdea74a,_0x29858d){if(_0x29858d){return _0xdea74a;}return db['FaxMessage'][_0x9673('0x5a')]({'direction':_0x9673('0xbc'),'read':![],'body':_0x5b6ae5[_0x9673('0x60')]['attachments'][0x0][_0x9673('0xbd')],'FaxAccountId':_0x28c154['id'],'FaxInteractionId':_0xdea74a['id'],'UserId':_0x5b6ae5[_0x9673('0x5b')]['id'],'ContactId':_0xdea74a[_0x9673('0xbe')],'AttachmentId':_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0]['id']})[_0x9673('0x21')](function(_0x472beb){_0xdea74a['dataValues'][_0x9673('0xb9')]=[];_0xdea74a[_0x9673('0xbf')][_0x9673('0xb9')]['push'](_0x472beb[_0x9673('0xbf')]);return _0xdea74a;});})[_0x9673('0x21')](function(_0x474b2b){respondWithRpcPromise(_0x9673('0xc0'),'SendFax',{'FaxAccountId':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x61')]['id'])?undefined:_0x5b6ae5[_0x9673('0x61')]['id'],'path':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')][_0x9673('0xae')][0x0][_0x9673('0x5')])?undefined:_0x5b6ae5['body'][_0x9673('0xae')][0x0]['path'],'fax':_[_0x9673('0xb2')](_0x5b6ae5[_0x9673('0x60')]['to'][0x0])?undefined:_0x5b6ae5['body']['to'][0x0],'AttachmentId':_0x5b6ae5[_0x9673('0x60')]['attachments'][0x0]['id']},client9002)['then'](function(_0xb13376){logger[_0x9673('0x2a')](_0x9673('0xc1'),_0xb13376);})['catch'](function(_0x3ca4fd){logger[_0x9673('0x2a')]('SendFaxRpc,\x20%s',_0x3ca4fd);});return _0x474b2b;})['then'](respondWithResult(_0x5a2a65,null))[_0x9673('0x53')](handleError(_0x5a2a65,null));};exports[_0x9673('0xc2')]=function(_0x3f88b7,_0x2417a9,_0x2057fc){return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x3f88b7[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x2417a9,null))[_0x9673('0x21')](function(_0x45734d){if(_0x45734d){return _0x45734d[_0x9673('0xc2')](_0x3f88b7[_0x9673('0x60')][_0x9673('0x70')],_[_0x9673('0x73')](_0x3f88b7[_0x9673('0x60')],[_0x9673('0x70'),'id'])||{})[_0x9673('0xbb')](function(_0x4fb16d){for(var _0x116f6d=0x0;_0x116f6d<_0x3f88b7[_0x9673('0x60')][_0x9673('0x70')][_0x9673('0x48')];_0x116f6d+=0x1){socket['emit'](_0x9673('0xc3'),{'UserId':Number(_0x3f88b7[_0x9673('0x60')]['ids'][_0x116f6d]),'FaxAccountId':Number(_0x3f88b7['params']['id'])});}return _0x4fb16d;});}})['then'](respondWithResult(_0x2417a9,null))[_0x9673('0x53')](handleError(_0x2417a9,null));};exports['removeAgents']=function(_0x588d54,_0x37fcf4,_0x32ad53){return db['FaxAccount'][_0x9673('0x59')]({'where':{'id':_0x588d54[_0x9673('0x61')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x37fcf4,null))[_0x9673('0x21')](function(_0x119a81){if(_0x119a81){return _0x119a81[_0x9673('0xc4')](_0x588d54['query'][_0x9673('0x70')])[_0x9673('0x21')](function(){if(_[_0x9673('0xc5')](_0x588d54['query'][_0x9673('0x70')])){for(var _0x2ca301=0x0;_0x2ca301<_0x588d54[_0x9673('0x44')]['ids'][_0x9673('0x48')];_0x2ca301+=0x1){socket['emit'](_0x9673('0xc6'),{'UserId':Number(_0x588d54[_0x9673('0x44')]['ids'][_0x2ca301]),'FaxAccountId':Number(_0x588d54[_0x9673('0x61')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x588d54[_0x9673('0x44')][_0x9673('0x70')]),'FaxAccountId':Number(_0x588d54[_0x9673('0x61')]['id'])});}});}})[_0x9673('0x21')](respondWithStatusCode(_0x37fcf4,null))['catch'](handleError(_0x37fcf4,null));};exports[_0x9673('0xc7')]=function(_0x1bb7dd,_0x53f9b8,_0x389e3e){var _0x406a0d={};var _0x24851f={};var _0xabd656;var _0x497cf4;return db[_0x9673('0x3e')][_0x9673('0x67')]({'where':{'id':_0x1bb7dd[_0x9673('0x61')]['id']}})['then'](handleEntityNotFound(_0x53f9b8,null))[_0x9673('0x21')](function(_0x2a8ce0){if(_0x2a8ce0){_0xabd656=_0x2a8ce0;_0x24851f[_0x9673('0x41')]=_[_0x9673('0x56')](db[_0x9673('0x77')][_0x9673('0x57')]);_0x24851f[_0x9673('0x44')]=_[_0x9673('0x56')](_0x1bb7dd[_0x9673('0x44')]);_0x24851f[_0x9673('0x45')]=_[_0x9673('0x68')](_0x24851f[_0x9673('0x41')],_0x24851f['query']);_0x406a0d['attributes']=_[_0x9673('0x68')](_0x24851f[_0x9673('0x41')],qs[_0x9673('0x47')](_0x1bb7dd[_0x9673('0x44')][_0x9673('0x47')]));_0x406a0d[_0x9673('0x46')]=_0x406a0d[_0x9673('0x46')]['length']?_0x406a0d[_0x9673('0x46')]:_0x24851f[_0x9673('0x41')];_0x406a0d[_0x9673('0x4a')]=qs['sort'](_0x1bb7dd['query'][_0x9673('0x4b')]);_0x406a0d[_0x9673('0x4d')]=qs['filters'](_[_0x9673('0x69')](_0x1bb7dd[_0x9673('0x44')],_0x24851f[_0x9673('0x45')]));if(_0x1bb7dd['query'][_0x9673('0x4c')]){_0x406a0d[_0x9673('0x4d')]=_['merge'](_0x406a0d['where'],{'$or':_[_0x9673('0x42')](_0x406a0d[_0x9673('0x46')],function(_0x272765){var _0x1c6a1f={};_0x1c6a1f[_0x272765]={'$like':'%'+_0x1bb7dd[_0x9673('0x44')][_0x9673('0x4c')]+'%'};return _0x1c6a1f;})});}_0x406a0d=_[_0x9673('0x4f')]({},_0x406a0d,_0x1bb7dd[_0x9673('0x58')]);return _0xabd656[_0x9673('0xc7')](_0x406a0d);}})[_0x9673('0x21')](function(_0x4010c8){if(_0x4010c8){_0x497cf4=_0x4010c8[_0x9673('0x48')];if(!_0x1bb7dd[_0x9673('0x44')][_0x9673('0x49')](_0x9673('0x6e'))){_0x406a0d[_0x9673('0x32')]=qs[_0x9673('0x32')](_0x1bb7dd[_0x9673('0x44')][_0x9673('0x32')]);_0x406a0d['offset']=qs[_0x9673('0x2f')](_0x1bb7dd[_0x9673('0x44')][_0x9673('0x2f')]);}return _0xabd656[_0x9673('0xc7')](_0x406a0d);}})['then'](function(_0x47402f){if(_0x47402f){return _0x47402f?{'count':_0x497cf4,'rows':_0x47402f}:null;}})[_0x9673('0x21')](respondWithResult(_0x53f9b8,null))['catch'](handleError(_0x53f9b8,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4b5691d..5ae86ba 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 _0xeb54=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x361c3c,_0x34e495){var _0x1a68e7=function(_0x1eeba5){while(--_0x1eeba5){_0x361c3c['push'](_0x361c3c['shift']());}};_0x1a68e7(++_0x34e495);}(_0xeb54,0xb7));var _0x4eb5=function(_0x236570,_0x25aabf){_0x236570=_0x236570-0x0;var _0x24266b=_0xeb54[_0x236570];return _0x24266b;};'use strict';var EventEmitter=require(_0x4eb5('0x0'));var FaxAccount=require(_0x4eb5('0x1'))['db'][_0x4eb5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4eb5('0x3')](0x0);var events={'afterCreate':_0x4eb5('0x4'),'afterUpdate':_0x4eb5('0x5'),'afterDestroy':_0x4eb5('0x6')};function emitEvent(_0x4b1538){return function(_0x4eb456,_0x2b8c34,_0xb9897){FaxAccountEvents['emit'](_0x4b1538+':'+_0x4eb456['id'],_0x4eb456);FaxAccountEvents[_0x4eb5('0x7')](_0x4b1538,_0x4eb456);_0xb9897(null);};}for(var e in events){if(events[_0x4eb5('0x8')](e)){var event=events[e];FaxAccount[_0x4eb5('0x9')](e,emitEvent(event));}}module[_0x4eb5('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x646e=['hasOwnProperty','exports','../../mysqldb','FaxAccount','save','emit'];(function(_0x2d123d,_0x33d75c){var _0x59e4f8=function(_0x52e357){while(--_0x52e357){_0x2d123d['push'](_0x2d123d['shift']());}};_0x59e4f8(++_0x33d75c);}(_0x646e,0xc2));var _0xe646=function(_0x45b2fc,_0x2bc1f5){_0x45b2fc=_0x45b2fc-0x0;var _0x44ccfd=_0x646e[_0x45b2fc];return _0x44ccfd;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xe646('0x0'))['db'][_0xe646('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe646('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2d32c1){return function(_0x4e9938,_0x31495d,_0x4d98db){FaxAccountEvents[_0xe646('0x3')](_0x2d32c1+':'+_0x4e9938['id'],_0x4e9938);FaxAccountEvents[_0xe646('0x3')](_0x2d32c1,_0x4e9938);_0x4d98db(null);};}for(var e in events){if(events[_0xe646('0x4')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xe646('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f4fdd4c..a0138b2 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 _0x8c2f=['lodash','util','api','moment','path','rimraf','./faxAccount.attributes','exports','FaxAccount','fax_accounts'];(function(_0x3a62a3,_0x1abdd5){var _0x3ca823=function(_0x1d3639){while(--_0x1d3639){_0x3a62a3['push'](_0x3a62a3['shift']());}};_0x3ca823(++_0x1abdd5);}(_0x8c2f,0xf0));var _0xf8c2=function(_0x4b9b78,_0x1dc74a){_0x4b9b78=_0x4b9b78-0x0;var _0x330388=_0x8c2f[_0x4b9b78];return _0x330388;};'use strict';var _=require(_0xf8c2('0x0'));var util=require(_0xf8c2('0x1'));var logger=require('../../config/logger')(_0xf8c2('0x2'));var moment=require(_0xf8c2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8c2('0x4'));var rimraf=require(_0xf8c2('0x5'));var config=require('../../config/environment');var attributes=require(_0xf8c2('0x6'));module[_0xf8c2('0x7')]=function(_0x5a82f5,_0x3028dc){return _0x5a82f5['define'](_0xf8c2('0x8'),attributes,{'tableName':_0xf8c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6966=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount'];(function(_0x5575e9,_0x3619ca){var _0x58d2cf=function(_0x1c4ebf){while(--_0x1c4ebf){_0x5575e9['push'](_0x5575e9['shift']());}};_0x58d2cf(++_0x3619ca);}(_0x6966,0x1e0));var _0x6696=function(_0x4c0629,_0xc61b41){_0x4c0629=_0x4c0629-0x0;var _0xe34b2a=_0x6966[_0x4c0629];return _0xe34b2a;};'use strict';var _=require(_0x6696('0x0'));var util=require(_0x6696('0x1'));var logger=require(_0x6696('0x2'))(_0x6696('0x3'));var moment=require(_0x6696('0x4'));var BPromise=require(_0x6696('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6696('0x6'));var rimraf=require(_0x6696('0x7'));var config=require(_0x6696('0x8'));var attributes=require(_0x6696('0x9'));module[_0x6696('0xa')]=function(_0x1a72d8,_0x4b3096){return _0x1a72d8['define'](_0x6696('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 15522a7..e8ad90d 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 _0x4db8=['error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','FaxApplication','Applications','applications','list','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x4db8,0x156));var _0x84db=function(_0xa0aba3,_0x904fb1){_0xa0aba3=_0xa0aba3-0x0;var _0x2486f0=_0x4db8[_0xa0aba3];return _0x2486f0;};'use strict';var _=require(_0x84db('0x0'));var util=require(_0x84db('0x1'));var moment=require(_0x84db('0x2'));var BPromise=require(_0x84db('0x3'));var rs=require(_0x84db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84db('0x5'));var logger=require('../../config/logger')(_0x84db('0x6'));var config=require('../../config/environment');var jayson=require(_0x84db('0x7'));var client=jayson[_0x84db('0x8')]['http']({'port':0x232c});config[_0x84db('0x9')]=_[_0x84db('0xa')](config[_0x84db('0x9')],{'host':_0x84db('0xb'),'port':0x18eb});var socket=require(_0x84db('0xc'))(new Redis(config[_0x84db('0x9')]));require(_0x84db('0xd'))['register'](socket);function respondWithRpcPromise(_0x343437,_0xccb61c,_0x34bd8a){return new BPromise(function(_0xf264d,_0x539482){return client[_0x84db('0xe')](_0x343437,_0x34bd8a)[_0x84db('0xf')](function(_0x221ff8){logger[_0x84db('0x10')](_0x84db('0x11'),_0xccb61c,_0x84db('0x12'));logger[_0x84db('0x13')](_0x84db('0x14'),_0xccb61c,_0x84db('0x12'),JSON[_0x84db('0x15')](_0x221ff8));if(_0x221ff8[_0x84db('0x16')]){if(_0x221ff8[_0x84db('0x16')][_0x84db('0x17')]===0x1f4){logger[_0x84db('0x16')](_0x84db('0x11'),_0xccb61c,_0x221ff8['error'][_0x84db('0x18')]);return _0x539482(_0x221ff8['error'][_0x84db('0x18')]);}logger[_0x84db('0x16')](_0x84db('0x11'),_0xccb61c,_0x221ff8[_0x84db('0x16')][_0x84db('0x18')]);return _0xf264d(_0x221ff8[_0x84db('0x16')][_0x84db('0x18')]);}else{logger[_0x84db('0x10')](_0x84db('0x11'),_0xccb61c,_0x84db('0x12'));_0xf264d(_0x221ff8[_0x84db('0x19')][_0x84db('0x18')]);}})[_0x84db('0x1a')](function(_0x16abf6){logger['error']('FaxAccount,\x20%s,\x20%s',_0xccb61c,_0x16abf6);_0x539482(_0x16abf6);});});}exports[_0x84db('0x1b')]=function(_0xedb846){var _0x2fa1df=this;return new Promise(function(_0xf3a98b,_0x4fe4d8){return db[_0x84db('0x1c')][_0x84db('0x1d')]({'raw':_0xedb846[_0x84db('0x1e')]?_0xedb846[_0x84db('0x1e')][_0x84db('0x1f')]===undefined?!![]:![]:!![],'where':_0xedb846[_0x84db('0x1e')]?_0xedb846[_0x84db('0x1e')][_0x84db('0x20')]||null:null,'attributes':_0xedb846[_0x84db('0x1e')]?_0xedb846['options'][_0x84db('0x21')]||null:null,'limit':_0xedb846[_0x84db('0x1e')]?_0xedb846[_0x84db('0x1e')][_0x84db('0x22')]||null:null,'include':_0xedb846[_0x84db('0x1e')]?_0xedb846['options'][_0x84db('0x23')]?_[_0x84db('0x24')](_0xedb846[_0x84db('0x1e')]['include'],function(_0x2252d3){return{'model':db[_0x2252d3[_0x84db('0x25')]],'as':_0x2252d3['as'],'attributes':_0x2252d3[_0x84db('0x21')],'include':_0x2252d3[_0x84db('0x23')]?_['map'](_0x2252d3[_0x84db('0x23')],function(_0x56ff68){return{'model':db[_0x56ff68['model']],'as':_0x56ff68['as'],'attributes':_0x56ff68[_0x84db('0x21')],'include':_0x56ff68[_0x84db('0x23')]?_['map'](_0x56ff68['include'],function(_0x3a0e00){return{'model':db[_0x3a0e00[_0x84db('0x25')]],'as':_0x3a0e00['as'],'attributes':_0x3a0e00[_0x84db('0x21')]};}):[]};}):[]};}):[]:[]})[_0x84db('0xf')](function(_0x559857){logger[_0x84db('0x10')](_0x84db('0x1b'),_0xedb846);logger['debug']('GetFaxAccount',_0xedb846,JSON[_0x84db('0x15')](_0x559857));_0xf3a98b(_0x559857);})['catch'](function(_0x400eea){logger[_0x84db('0x16')](_0x84db('0x1b'),_0x400eea[_0x84db('0x18')],_0xedb846);_0x4fe4d8(_0x2fa1df[_0x84db('0x16')](0x1f4,_0x400eea[_0x84db('0x18')]));});});};exports[_0x84db('0x26')]=function(_0xd0a4c4,_0x353b98,_0x3a330e){var _0x3e10c3=this;return new Promise(function(_0x1b1352,_0x1309c2){var _0x15839b={'body':_0xd0a4c4[_0x84db('0x27')],'channel':_0x84db('0x28')};var _0x187ed8=[];var _0x55e58f=[];var _0x59fb95={};return db[_0x84db('0x29')]['describe']()['then'](function(_0x44475d){if(!_0x44475d){throw new db[(_0x84db('0x2a'))][(_0x84db('0x2b'))](_0x84db('0x2c'));}_0x187ed8=_[_0x84db('0x2d')](_[_0x84db('0x2e')](_0x44475d),[_0x84db('0x2f'),_0x84db('0x30')]);_0x55e58f=_['difference'](_[_0x84db('0x2e')](_0x44475d),[_0x84db('0x2f'),_0x84db('0x30'),_0x84db('0x31'),_0x84db('0x32')]);if(_0xd0a4c4[_0x84db('0x27')]['id']){delete _0xd0a4c4[_0x84db('0x27')]['id'];}if(_[_0x84db('0x33')](_0xd0a4c4['body'][_0x84db('0x34')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x84db('0x33')](_0xd0a4c4[_0x84db('0x27')][_0x84db('0x27')])||_0xd0a4c4[_0x84db('0x27')][_0x84db('0x27')]===''){throw new db[(_0x84db('0x2a'))][(_0x84db('0x2b'))](_0x84db('0x35'));}if(_[_0x84db('0x33')](_0xd0a4c4[_0x84db('0x27')]['mapKey'])){throw new db[(_0x84db('0x2a'))][(_0x84db('0x2b'))](_0x84db('0x36')+_0x55e58f);}if(!_[_0x84db('0x37')](_0x55e58f,_0xd0a4c4[_0x84db('0x27')][_0x84db('0x38')])){throw new db[(_0x84db('0x2a'))]['ValidationError'](_0x84db('0x39')+_0x55e58f);}_0x59fb95[_0xd0a4c4[_0x84db('0x27')][_0x84db('0x38')]]=_0xd0a4c4['body'][_0x84db('0x34')];})['then'](function(){return db[_0x84db('0x1c')][_0x84db('0x3a')]({'where':{'id':_0xd0a4c4[_0x84db('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x84db('0x3c'),'include':[{'model':db[_0x84db('0x29')],'as':_0x84db('0x3d'),'where':_0x59fb95,'limit':0x1,'order':[[_0x84db('0x30'),'DESC']]}]},{'model':db[_0x84db('0x3e')],'as':_0x84db('0x3f')}]});})[_0x84db('0xf')](function(_0x2de6f9){if(_0x2de6f9&&_0x2de6f9[_0x84db('0x3c')]){var _0xdb1cad=_0x2de6f9['get']({'plain':!![]});_0x15839b[_0x84db('0x3b')]=_0xdb1cad;_0x15839b[_0x84db('0x40')]=_0xdb1cad[_0x84db('0x3f')];_0x15839b[_0x84db('0x41')]=_0xdb1cad['List'];_0x15839b[_0x84db('0x40')]=_['orderBy'](_0x15839b[_0x84db('0x40')],[_0x84db('0x42')],[_0x84db('0x43')]);if(_0x15839b['account']['Applications']){delete _0x15839b[_0x84db('0x3b')][_0x84db('0x3f')];}if(_0x15839b[_0x84db('0x3b')]['List']&&_0x15839b[_0x84db('0x3b')][_0x84db('0x3c')]['Contacts']['length']){return _0x15839b[_0x84db('0x3b')][_0x84db('0x3c')][_0x84db('0x3d')][0x0];}var _0x3ff9b9=_[_0x84db('0xa')](_0xd0a4c4[_0x84db('0x27')],{'firstName':_0xd0a4c4[_0x84db('0x27')][_0x84db('0x34')],'ListId':_0xdb1cad[_0x84db('0x32')]});_0x3ff9b9[_0xd0a4c4[_0x84db('0x27')][_0x84db('0x38')]]=_0xd0a4c4[_0x84db('0x27')][_0x84db('0x34')];return db['CmContact'][_0x84db('0x44')](_0x3ff9b9,{'fields':_0x187ed8,'raw':!![]});}})[_0x84db('0xf')](function(_0x213c12){_0x15839b[_0x84db('0x45')]=_0x213c12;if(_0x213c12){var _0x26a046={'ContactId':_0x213c12['id'],'FaxAccountId':_0xd0a4c4[_0x84db('0x3b')]['id'],'fax':_0x213c12[_0x84db('0x28')]};return db[_0x84db('0x46')][_0x84db('0x3a')]({'where':{'ContactId':_0x213c12['id'],'closed':![],'FaxAccountId':_0xd0a4c4[_0x84db('0x3b')]['id']}})[_0x84db('0xf')](function(_0x1bf9f0){if(_0x1bf9f0){return[_0x1bf9f0,![]];}return db['FaxInteraction'][_0x84db('0x44')](_0x26a046)[_0x84db('0xf')](function(_0x22ea42){return[_0x22ea42,!![]];});});}else{throw new Error(_0x84db('0x47'));}})['spread'](function(_0x46c268,_0x57cbe1){var _0x22198e=_0x46c268['get']({'plain':!![]});if(_0x57cbe1){if(_0x15839b[_0x84db('0x3b')][_0x84db('0x48')]){_0x15839b[_0x84db('0x40')][_0x84db('0x49')]({'id':0x0,'priority':_0x15839b[_0x84db('0x40')][_0x84db('0x4a')]+0x1,'app':_0x84db('0x4b'),'appdata':_0x84db('0x4c'),'interval':_0x84db('0x4d')});}_0x22198e[_0x84db('0x4e')]=!![];}else{_0x22198e['created']=![];}_0x15839b[_0x84db('0x4f')]=_0x22198e;return db[_0x84db('0x50')][_0x84db('0x44')]({'body':_0xd0a4c4[_0x84db('0x27')][_0x84db('0x27')],'FaxAccountId':_0xd0a4c4[_0x84db('0x3b')]['id'],'FaxInteractionId':_0x46c268['id'],'direction':'in','ContactId':_0x46c268[_0x84db('0x51')],'AttachmentId':_0xd0a4c4[_0x84db('0x27')]['AttachmentId']});})[_0x84db('0xf')](function(_0x3cedfa){_0x15839b[_0x84db('0x18')]=_0x3cedfa;if(!_0x15839b[_0x84db('0x4f')][_0x84db('0x52')])return;return db[_0x84db('0x53')][_0x84db('0x3a')]({'attributes':['id',_0x84db('0x54')],'where':{'id':_0x15839b[_0x84db('0x4f')][_0x84db('0x52')]}});})[_0x84db('0xf')](function(_0x2859f8){if(_0x2859f8){_0x15839b[_0x84db('0x40')][_0x84db('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2859f8[_0x84db('0x54')]+','+(_0x15839b[_0x84db('0x3b')][_0x84db('0x56')]||0xa),'interval':_0x84db('0x4d')});}if(!_0x15839b[_0x84db('0x4f')][_0x84db('0x57')])return;return db['FaxQueue'][_0x84db('0x3a')]({'attributes':['id',_0x84db('0x54')],'where':{'id':_0x15839b[_0x84db('0x4f')][_0x84db('0x57')]}});})[_0x84db('0xf')](function(_0x18620e){if(_0x18620e){_0x15839b['applications'][_0x84db('0x55')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x18620e[_0x84db('0x54')]+','+(_0x15839b[_0x84db('0x3b')][_0x84db('0x58')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x84db('0x59'),_0x84db('0x5a'),_0x15839b);})[_0x84db('0xf')](function(_0x3136b6){_0x1b1352(_0x3136b6);})[_0x84db('0x1a')](function(_0x2002fe){_0x1309c2(_0x3e10c3['error'](0x1f4,_0x2002fe[_0x84db('0x18')]));});});}; \ No newline at end of file +var _0xc86d=['attributes','NotifyFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','FaxQueue','queueId','queue','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','map','model'];(function(_0x20d615,_0x1e10d2){var _0x4aede2=function(_0x4fe09b){while(--_0x4fe09b){_0x20d615['push'](_0x20d615['shift']());}};_0x4aede2(++_0x1e10d2);}(_0xc86d,0x149));var _0xdc86=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xc86d[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xdc86('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdc86('0x1'));var rs=require(_0xdc86('0x2'));var fs=require('fs');var Redis=require(_0xdc86('0x3'));var db=require(_0xdc86('0x4'))['db'];var utils=require(_0xdc86('0x5'));var logger=require(_0xdc86('0x6'))('rpc');var config=require(_0xdc86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdc86('0x8')][_0xdc86('0x9')]({'port':0x232c});config[_0xdc86('0xa')]=_[_0xdc86('0xb')](config[_0xdc86('0xa')],{'host':_0xdc86('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc86('0xa')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2f4b3e,_0x249151,_0x4e71cc){return new BPromise(function(_0x114a70,_0x2e7924){return client[_0xdc86('0xd')](_0x2f4b3e,_0x4e71cc)[_0xdc86('0xe')](function(_0x5c303b){logger[_0xdc86('0xf')](_0xdc86('0x10'),_0x249151,_0xdc86('0x11'));logger[_0xdc86('0x12')](_0xdc86('0x13'),_0x249151,_0xdc86('0x11'),JSON[_0xdc86('0x14')](_0x5c303b));if(_0x5c303b[_0xdc86('0x15')]){if(_0x5c303b[_0xdc86('0x15')][_0xdc86('0x16')]===0x1f4){logger[_0xdc86('0x15')](_0xdc86('0x10'),_0x249151,_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);return _0x2e7924(_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);}logger['error'](_0xdc86('0x10'),_0x249151,_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);return _0x114a70(_0x5c303b[_0xdc86('0x15')][_0xdc86('0x17')]);}else{logger['info'](_0xdc86('0x10'),_0x249151,_0xdc86('0x11'));_0x114a70(_0x5c303b[_0xdc86('0x18')][_0xdc86('0x17')]);}})[_0xdc86('0x19')](function(_0x55f678){logger['error'](_0xdc86('0x10'),_0x249151,_0x55f678);_0x2e7924(_0x55f678);});});}exports[_0xdc86('0x1a')]=function(_0x592d66){var _0x8a1699=this;return new Promise(function(_0x4d5b15,_0x490de8){return db[_0xdc86('0x1b')]['findAll']({'raw':_0x592d66[_0xdc86('0x1c')]?_0x592d66[_0xdc86('0x1c')][_0xdc86('0x1d')]===undefined?!![]:![]:!![],'where':_0x592d66['options']?_0x592d66[_0xdc86('0x1c')][_0xdc86('0x1e')]||null:null,'attributes':_0x592d66['options']?_0x592d66[_0xdc86('0x1c')]['attributes']||null:null,'limit':_0x592d66[_0xdc86('0x1c')]?_0x592d66['options'][_0xdc86('0x1f')]||null:null,'include':_0x592d66[_0xdc86('0x1c')]?_0x592d66[_0xdc86('0x1c')][_0xdc86('0x20')]?_[_0xdc86('0x21')](_0x592d66[_0xdc86('0x1c')][_0xdc86('0x20')],function(_0x9d6e48){return{'model':db[_0x9d6e48[_0xdc86('0x22')]],'as':_0x9d6e48['as'],'attributes':_0x9d6e48['attributes'],'include':_0x9d6e48['include']?_[_0xdc86('0x21')](_0x9d6e48[_0xdc86('0x20')],function(_0x42b242){return{'model':db[_0x42b242[_0xdc86('0x22')]],'as':_0x42b242['as'],'attributes':_0x42b242[_0xdc86('0x23')],'include':_0x42b242['include']?_[_0xdc86('0x21')](_0x42b242[_0xdc86('0x20')],function(_0x5ad350){return{'model':db[_0x5ad350['model']],'as':_0x5ad350['as'],'attributes':_0x5ad350[_0xdc86('0x23')]};}):[]};}):[]};}):[]:[]})[_0xdc86('0xe')](function(_0x244063){logger[_0xdc86('0xf')](_0xdc86('0x1a'),_0x592d66);logger[_0xdc86('0x12')](_0xdc86('0x1a'),_0x592d66,JSON[_0xdc86('0x14')](_0x244063));_0x4d5b15(_0x244063);})[_0xdc86('0x19')](function(_0x3dff59){logger[_0xdc86('0x15')]('GetFaxAccount',_0x3dff59['message'],_0x592d66);_0x490de8(_0x8a1699[_0xdc86('0x15')](0x1f4,_0x3dff59[_0xdc86('0x17')]));});});};exports[_0xdc86('0x24')]=function(_0x4a5525,_0x82f00d,_0x480282){var _0x46a128=this;return new Promise(function(_0x3112f1,_0x3e2758){var _0x48bcd1={'body':_0x4a5525[_0xdc86('0x25')],'channel':_0xdc86('0x26')};var _0x28b0f1=[];var _0x36448a=[];var _0x258796={};return db[_0xdc86('0x27')]['describe']()[_0xdc86('0xe')](function(_0x1908ab){if(!_0x1908ab){throw new db['Sequelize'][(_0xdc86('0x28'))](_0xdc86('0x29'));}_0x28b0f1=_[_0xdc86('0x2a')](_[_0xdc86('0x2b')](_0x1908ab),[_0xdc86('0x2c'),_0xdc86('0x2d')]);_0x36448a=_['difference'](_[_0xdc86('0x2b')](_0x1908ab),[_0xdc86('0x2c'),_0xdc86('0x2d'),_0xdc86('0x2e'),_0xdc86('0x2f')]);if(_0x4a5525[_0xdc86('0x25')]['id']){delete _0x4a5525[_0xdc86('0x25')]['id'];}if(_[_0xdc86('0x30')](_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')])){throw new db[(_0xdc86('0x32'))][(_0xdc86('0x28'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x4a5525['body']['body'])||_0x4a5525['body']['body']===''){throw new db[(_0xdc86('0x32'))][(_0xdc86('0x28'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdc86('0x30')](_0x4a5525['body']['mapKey'])){throw new db['Sequelize'][(_0xdc86('0x28'))](_0xdc86('0x33')+_0x36448a);}if(!_['includes'](_0x36448a,_0x4a5525[_0xdc86('0x25')]['mapKey'])){throw new db['Sequelize'][(_0xdc86('0x28'))](_0xdc86('0x34')+_0x36448a);}_0x258796[_0x4a5525[_0xdc86('0x25')][_0xdc86('0x35')]]=_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')];})['then'](function(){return db[_0xdc86('0x1b')][_0xdc86('0x36')]({'where':{'id':_0x4a5525[_0xdc86('0x37')]['id']},'include':[{'model':db[_0xdc86('0x38')],'as':_0xdc86('0x39'),'include':[{'model':db[_0xdc86('0x27')],'as':_0xdc86('0x3a'),'where':_0x258796,'limit':0x1,'order':[['updatedAt',_0xdc86('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0xdc86('0x3c')}]});})['then'](function(_0x33d269){if(_0x33d269&&_0x33d269[_0xdc86('0x39')]){var _0x112fff=_0x33d269[_0xdc86('0x3d')]({'plain':!![]});_0x48bcd1[_0xdc86('0x37')]=_0x112fff;_0x48bcd1[_0xdc86('0x3e')]=_0x112fff[_0xdc86('0x3c')];_0x48bcd1[_0xdc86('0x3f')]=_0x112fff[_0xdc86('0x39')];_0x48bcd1['applications']=_[_0xdc86('0x40')](_0x48bcd1[_0xdc86('0x3e')],['priority'],[_0xdc86('0x41')]);if(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x3c')]){delete _0x48bcd1[_0xdc86('0x37')][_0xdc86('0x3c')];}if(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x39')]&&_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x39')]['Contacts'][_0xdc86('0x42')]){return _0x48bcd1['account'][_0xdc86('0x39')][_0xdc86('0x3a')][0x0];}var _0x385a04=_[_0xdc86('0xb')](_0x4a5525['body'],{'firstName':_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')],'ListId':_0x112fff[_0xdc86('0x2f')]});_0x385a04[_0x4a5525[_0xdc86('0x25')][_0xdc86('0x35')]]=_0x4a5525[_0xdc86('0x25')][_0xdc86('0x31')];return db[_0xdc86('0x27')][_0xdc86('0x43')](_0x385a04,{'fields':_0x28b0f1,'raw':!![]});}})['then'](function(_0x3c92c8){_0x48bcd1[_0xdc86('0x44')]=_0x3c92c8;if(_0x3c92c8){var _0x143af3={'ContactId':_0x3c92c8['id'],'FaxAccountId':_0x4a5525[_0xdc86('0x37')]['id'],'fax':_0x3c92c8[_0xdc86('0x26')]};return db[_0xdc86('0x45')]['find']({'where':{'ContactId':_0x3c92c8['id'],'closed':![],'FaxAccountId':_0x4a5525[_0xdc86('0x37')]['id']}})[_0xdc86('0xe')](function(_0xd0f9b9){if(_0xd0f9b9){return[_0xd0f9b9,![]];}return db[_0xdc86('0x45')][_0xdc86('0x43')](_0x143af3)['then'](function(_0x1fb782){return[_0x1fb782,!![]];});});}else{throw new Error(_0xdc86('0x46'));}})[_0xdc86('0x47')](function(_0x245faa,_0x38ea23){var _0x31aecd=_0x245faa[_0xdc86('0x3d')]({'plain':!![]});if(_0x38ea23){if(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x48')]){_0x48bcd1['applications'][_0xdc86('0x49')]({'id':0x0,'priority':_0x48bcd1[_0xdc86('0x3e')]['length']+0x1,'app':'close','appdata':_0xdc86('0x4a'),'interval':_0xdc86('0x4b')});}_0x31aecd[_0xdc86('0x4c')]=!![];}else{_0x31aecd['created']=![];}_0x48bcd1[_0xdc86('0x4d')]=_0x31aecd;return db[_0xdc86('0x4e')][_0xdc86('0x43')]({'body':_0x4a5525[_0xdc86('0x25')][_0xdc86('0x25')],'FaxAccountId':_0x4a5525['account']['id'],'FaxInteractionId':_0x245faa['id'],'direction':'in','ContactId':_0x245faa[_0xdc86('0x4f')],'AttachmentId':_0x4a5525[_0xdc86('0x25')][_0xdc86('0x50')]});})[_0xdc86('0xe')](function(_0x56cff1){_0x48bcd1[_0xdc86('0x17')]=_0x56cff1;if(!_0x48bcd1['interaction'][_0xdc86('0x51')])return;return db['User'][_0xdc86('0x36')]({'attributes':['id','name'],'where':{'id':_0x48bcd1['interaction'][_0xdc86('0x51')]}});})[_0xdc86('0xe')](function(_0x6bec5e){if(_0x6bec5e){_0x48bcd1[_0xdc86('0x3e')][_0xdc86('0x52')]({'id':0x0,'priority':0x0,'app':_0xdc86('0x53'),'appdata':_0x6bec5e[_0xdc86('0x54')]+','+(_0x48bcd1[_0xdc86('0x37')][_0xdc86('0x55')]||0xa),'interval':'*,*,*,*'});}if(!_0x48bcd1[_0xdc86('0x4d')]['queueId'])return;return db[_0xdc86('0x56')]['find']({'attributes':['id',_0xdc86('0x54')],'where':{'id':_0x48bcd1['interaction'][_0xdc86('0x57')]}});})[_0xdc86('0xe')](function(_0x5b6534){if(_0x5b6534){_0x48bcd1[_0xdc86('0x3e')][_0xdc86('0x52')]({'id':0x0,'priority':0x1,'app':_0xdc86('0x58'),'appdata':_0x5b6534[_0xdc86('0x54')]+','+(_0x48bcd1[_0xdc86('0x37')]['waitForTheAssignedQueue']||0x12c),'interval':_0xdc86('0x4b')});}return respondWithRpcPromise(_0xdc86('0x59'),_0xdc86('0x5a'),_0x48bcd1);})[_0xdc86('0xe')](function(_0x4dd2fc){_0x3112f1(_0x4dd2fc);})[_0xdc86('0x19')](function(_0x5afdae){_0x3e2758(_0x46a128[_0xdc86('0x15')](0x1f4,_0x5afdae[_0xdc86('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 35d8781..d51154f 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 _0x7010=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x141632,_0x3e0c7c){var _0x27b03e=function(_0xadeded){while(--_0xadeded){_0x141632['push'](_0x141632['shift']());}};_0x27b03e(++_0x3e0c7c);}(_0x7010,0x10a));var _0x0701=function(_0x375d79,_0x53be3d){_0x375d79=_0x375d79-0x0;var _0x2a07d4=_0x7010[_0x375d79];return _0x2a07d4;};'use strict';var FaxAccountEvents=require(_0x0701('0x0'));var events=[_0x0701('0x1'),_0x0701('0x2'),_0x0701('0x3')];function createListener(_0x22f915,_0x2669ed){return function(_0x3111d8){_0x2669ed[_0x0701('0x4')](_0x22f915,_0x3111d8);};}function removeListener(_0x5cdca0,_0x19478e){return function(){FaxAccountEvents[_0x0701('0x5')](_0x5cdca0,_0x19478e);};}exports[_0x0701('0x6')]=function(_0x558d9c){for(var _0xbf3ac0=0x0,_0x19f9d3=events[_0x0701('0x7')];_0xbf3ac0<_0x19f9d3;_0xbf3ac0++){var _0x1a1c9c=events[_0xbf3ac0];var _0x56bb58=createListener(_0x0701('0x8')+_0x1a1c9c,_0x558d9c);FaxAccountEvents['on'](_0x1a1c9c,_0x56bb58);}}; \ No newline at end of file +var _0x5ae1=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x36fef0,_0x16711c){var _0xb36b84=function(_0x442947){while(--_0x442947){_0x36fef0['push'](_0x36fef0['shift']());}};_0xb36b84(++_0x16711c);}(_0x5ae1,0xc6));var _0x15ae=function(_0x3f1c5c,_0x4acff6){_0x3f1c5c=_0x3f1c5c-0x0;var _0x1e0133=_0x5ae1[_0x3f1c5c];return _0x1e0133;};'use strict';var FaxAccountEvents=require(_0x15ae('0x0'));var events=[_0x15ae('0x1'),_0x15ae('0x2'),_0x15ae('0x3')];function createListener(_0x2b5522,_0x3e2882){return function(_0x4219fd){_0x3e2882[_0x15ae('0x4')](_0x2b5522,_0x4219fd);};}function removeListener(_0x5ed2fe,_0x5c045a){return function(){FaxAccountEvents[_0x15ae('0x5')](_0x5ed2fe,_0x5c045a);};}exports[_0x15ae('0x6')]=function(_0x3fa0e8){for(var _0x4b0b38=0x0,_0x152c3d=events[_0x15ae('0x7')];_0x4b0b38<_0x152c3d;_0x4b0b38++){var _0x363566=events[_0x4b0b38];var _0x97a044=createListener(_0x15ae('0x8')+_0x363566,_0x3fa0e8);FaxAccountEvents['on'](_0x363566,_0x97a044);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 57db1a6..764f1ea 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 _0x55e3=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','create','addDisposition','post','addAnswer','addInteraction','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x55e3,0x1a5));var _0x355e=function(_0x31b8c7,_0x5d3095){_0x31b8c7=_0x31b8c7-0x0;var _0x2af248=_0x55e3[_0x31b8c7];return _0x2af248;};'use strict';var multer=require(_0x355e('0x0'));var util=require('util');var path=require(_0x355e('0x1'));var timeout=require(_0x355e('0x2'));var express=require(_0x355e('0x3'));var router=express[_0x355e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x355e('0x5'));var interaction=require(_0x355e('0x6'));var config=require(_0x355e('0x7'));var controller=require(_0x355e('0x8'));router[_0x355e('0x9')]('/',auth[_0x355e('0xa')](),controller[_0x355e('0xb')]);router['get'](_0x355e('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x355e('0x9')](_0x355e('0xd'),auth['isAuthenticated'](),controller[_0x355e('0xe')]);router['get'](_0x355e('0xf'),auth[_0x355e('0xa')](),controller[_0x355e('0x10')]);router['get'](_0x355e('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x355e('0x9')]('/:id/interactions',auth[_0x355e('0xa')](),controller[_0x355e('0x12')]);router[_0x355e('0x9')](_0x355e('0x13'),auth[_0x355e('0xa')](),controller[_0x355e('0x14')]);router[_0x355e('0x9')](_0x355e('0x15'),auth[_0x355e('0xa')](),controller['getMessages']);router['get'](_0x355e('0x16'),auth[_0x355e('0xa')](),controller[_0x355e('0x17')]);router['post']('/',auth[_0x355e('0xa')](),controller[_0x355e('0x18')]);router['post'](_0x355e('0xf'),auth['isAuthenticated'](),controller[_0x355e('0x19')]);router[_0x355e('0x1a')]('/:id/canned_answers',auth[_0x355e('0xa')](),controller[_0x355e('0x1b')]);router[_0x355e('0x1a')]('/:id/interactions',auth[_0x355e('0xa')](),controller[_0x355e('0x1c')]);router[_0x355e('0x1a')](_0x355e('0x13'),auth[_0x355e('0xa')](),controller['addApplications']);router[_0x355e('0x1a')](_0x355e('0x1d'),auth[_0x355e('0xa')](),controller['addAccountApplications']);router[_0x355e('0x1a')](_0x355e('0x1e'),auth['isAuthenticated'](),controller[_0x355e('0x1f')]);router[_0x355e('0x1a')](_0x355e('0x20'),auth[_0x355e('0xa')](),controller[_0x355e('0x21')]);router[_0x355e('0x1a')]('/:id/users',auth[_0x355e('0xa')](),controller[_0x355e('0x22')]);router[_0x355e('0x23')](_0x355e('0xd'),auth[_0x355e('0xa')](),controller[_0x355e('0x24')]);router['delete']('/:id',auth[_0x355e('0xa')](),controller['destroy']);router[_0x355e('0x25')](_0x355e('0xf'),auth['isAuthenticated'](),controller[_0x355e('0x26')]);router[_0x355e('0x25')](_0x355e('0x11'),auth['isAuthenticated'](),controller[_0x355e('0x27')]);router[_0x355e('0x25')](_0x355e('0x16'),auth['isAuthenticated'](),controller[_0x355e('0x28')]);module[_0x355e('0x29')]=router; \ No newline at end of file +var _0x604c=['create','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post'];(function(_0x4add67,_0x5a57c3){var _0x336e8d=function(_0x111030){while(--_0x111030){_0x4add67['push'](_0x4add67['shift']());}};_0x336e8d(++_0x5a57c3);}(_0x604c,0x65));var _0xc604=function(_0x3d814e,_0x5f2ff4){_0x3d814e=_0x3d814e-0x0;var _0x2eb125=_0x604c[_0x3d814e];return _0x2eb125;};'use strict';var multer=require(_0xc604('0x0'));var util=require(_0xc604('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc604('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc604('0x3'));var interaction=require(_0xc604('0x4'));var config=require('../../config/environment');var controller=require(_0xc604('0x5'));router[_0xc604('0x6')]('/',auth[_0xc604('0x7')](),controller['index']);router[_0xc604('0x6')]('/describe',auth[_0xc604('0x7')](),controller[_0xc604('0x8')]);router[_0xc604('0x6')](_0xc604('0x9'),auth[_0xc604('0x7')](),controller[_0xc604('0xa')]);router['get'](_0xc604('0xb'),auth[_0xc604('0x7')](),controller[_0xc604('0xc')]);router[_0xc604('0x6')]('/:id/canned_answers',auth[_0xc604('0x7')](),controller[_0xc604('0xd')]);router[_0xc604('0x6')](_0xc604('0xe'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xc604('0x6')](_0xc604('0xf'),auth[_0xc604('0x7')](),controller[_0xc604('0x10')]);router['get'](_0xc604('0x11'),auth[_0xc604('0x7')](),controller[_0xc604('0x12')]);router[_0xc604('0x6')](_0xc604('0x13'),auth['isAuthenticated'](),controller[_0xc604('0x14')]);router[_0xc604('0x15')]('/',auth[_0xc604('0x7')](),controller[_0xc604('0x16')]);router[_0xc604('0x15')](_0xc604('0xb'),auth[_0xc604('0x7')](),controller[_0xc604('0x17')]);router[_0xc604('0x15')](_0xc604('0x18'),auth[_0xc604('0x7')](),controller[_0xc604('0x19')]);router[_0xc604('0x15')](_0xc604('0xe'),auth[_0xc604('0x7')](),controller[_0xc604('0x1a')]);router[_0xc604('0x15')]('/:id/applications',auth[_0xc604('0x7')](),controller[_0xc604('0x1b')]);router[_0xc604('0x15')](_0xc604('0x1c'),auth[_0xc604('0x7')](),controller['addAccountApplications']);router['post'](_0xc604('0x1d'),auth[_0xc604('0x7')](),controller[_0xc604('0x1e')]);router[_0xc604('0x15')](_0xc604('0x1f'),auth['isAuthenticated'](),controller[_0xc604('0x20')]);router['post'](_0xc604('0x13'),auth[_0xc604('0x7')](),controller[_0xc604('0x21')]);router[_0xc604('0x22')]('/:id',auth[_0xc604('0x7')](),controller[_0xc604('0x23')]);router[_0xc604('0x24')]('/:id',auth[_0xc604('0x7')](),controller[_0xc604('0x25')]);router[_0xc604('0x24')](_0xc604('0xb'),auth['isAuthenticated'](),controller[_0xc604('0x26')]);router[_0xc604('0x24')]('/:id/canned_answers',auth[_0xc604('0x7')](),controller[_0xc604('0x27')]);router[_0xc604('0x24')]('/:id/users',auth[_0xc604('0x7')](),controller['removeAgents']);module[_0xc604('0x28')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 957641e..10dbd2f 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 _0xc165=['TEXT','INTEGER','STRING','noop'];(function(_0x4eae8b,_0x295319){var _0x9d778a=function(_0x4c54eb){while(--_0x4c54eb){_0x4eae8b['push'](_0x4eae8b['shift']());}};_0x9d778a(++_0x295319);}(_0xc165,0x1c5));var _0x5c16=function(_0xc41594,_0x3ff4a4){_0xc41594=_0xc41594-0x0;var _0x2b803b=_0xc165[_0xc41594];return _0x2b803b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x5c16('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x5c16('0x1')],'allowNull':![],'defaultValue':_0x5c16('0x2')},'appdata':{'type':Sequelize[_0x5c16('0x3')]()},'description':{'type':Sequelize[_0x5c16('0x1')]},'interval':{'type':Sequelize[_0x5c16('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x775e=['INTEGER','STRING','sequelize'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x775e,0x1be));var _0xe775=function(_0x367699,_0x4b9a13){_0x367699=_0x367699-0x0;var _0x583bd3=_0x775e[_0x367699];return _0x583bd3;};'use strict';var Sequelize=require(_0xe775('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe775('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe775('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe775('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 20aaf0b..1d47af2 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 _0xb76f=['json','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','offset','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','intersection','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x2c9272,_0x4def68){var _0x4a3b40=function(_0x4bbd85){while(--_0x4bbd85){_0x2c9272['push'](_0x2c9272['shift']());}};_0x4a3b40(++_0x4def68);}(_0xb76f,0xc1));var _0xfb76=function(_0x43e4d5,_0x1d9430){_0x43e4d5=_0x43e4d5-0x0;var _0x5b7fee=_0xb76f[_0x43e4d5];return _0x5b7fee;};'use strict';var emlformat=require(_0xfb76('0x0'));var rimraf=require(_0xfb76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb76('0x2'));var rp=require(_0xfb76('0x3'));var moment=require(_0xfb76('0x4'));var BPromise=require(_0xfb76('0x5'));var Mustache=require(_0xfb76('0x6'));var util=require(_0xfb76('0x7'));var path=require(_0xfb76('0x8'));var sox=require(_0xfb76('0x9'));var csv=require(_0xfb76('0xa'));var ejs=require(_0xfb76('0xb'));var fs=require('fs');var fs_extra=require(_0xfb76('0xc'));var _=require(_0xfb76('0xd'));var squel=require(_0xfb76('0xe'));var crypto=require(_0xfb76('0xf'));var jsforce=require(_0xfb76('0x10'));var deskjs=require(_0xfb76('0x11'));var toCsv=require('to-csv');var querystring=require(_0xfb76('0x12'));var Papa=require(_0xfb76('0x13'));var Redis=require(_0xfb76('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xfb76('0x15'));var as=require(_0xfb76('0x16'));var hardwareService=require(_0xfb76('0x17'));var logger=require(_0xfb76('0x18'))(_0xfb76('0x19'));var utils=require(_0xfb76('0x1a'));var config=require(_0xfb76('0x1b'));var licenseUtil=require(_0xfb76('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f624b,_0x2e5a06){_0x2e5a06=_0x2e5a06||0xcc;return function(_0x37b134){if(_0x37b134){return _0x2f624b[_0xfb76('0x1d')](_0x2e5a06);}return _0x2f624b[_0xfb76('0x1e')](_0x2e5a06)[_0xfb76('0x1f')]();};}function respondWithResult(_0x395780,_0x45b3ac){_0x45b3ac=_0x45b3ac||0xc8;return function(_0x507352){if(_0x507352){return _0x395780[_0xfb76('0x1e')](_0x45b3ac)[_0xfb76('0x20')](_0x507352);}};}function respondWithFilteredResult(_0x4db1a2,_0x2cc41c){return function(_0x3f0fb4){if(_0x3f0fb4){var _0x37e356=typeof _0x2cc41c['offset']===_0xfb76('0x21')&&typeof _0x2cc41c[_0xfb76('0x22')]==='undefined';var _0x7b3d78=_0x3f0fb4[_0xfb76('0x23')];var _0x2e793=_0x37e356?0x0:_0x2cc41c['offset'];var _0x38a45d=_0x37e356?_0x3f0fb4[_0xfb76('0x23')]:_0x2cc41c['offset']+_0x2cc41c[_0xfb76('0x22')];var _0x100eaa;if(_0x38a45d>=_0x7b3d78){_0x38a45d=_0x7b3d78;_0x100eaa=0xc8;}else{_0x100eaa=0xce;}_0x4db1a2[_0xfb76('0x1e')](_0x100eaa);return _0x4db1a2[_0xfb76('0x24')]('Content-Range',_0x2e793+'-'+_0x38a45d+'/'+_0x7b3d78)[_0xfb76('0x20')](_0x3f0fb4);}return null;};}function patchUpdates(_0x36c922){return function(_0x212cb6){try{jsonpatch[_0xfb76('0x25')](_0x212cb6,_0x36c922,!![]);}catch(_0x461b94){return BPromise['reject'](_0x461b94);}return _0x212cb6[_0xfb76('0x26')]();};}function saveUpdates(_0x442f81,_0x43afb6){return function(_0x3ca207){if(_0x3ca207){return _0x3ca207[_0xfb76('0x27')](_0x442f81)[_0xfb76('0x28')](function(_0x147a85){return _0x147a85;});}return null;};}function removeEntity(_0x5d565c,_0x2d9be4){return function(_0x239e47){if(_0x239e47){return _0x239e47['destroy']()[_0xfb76('0x28')](function(){_0x5d565c[_0xfb76('0x1e')](0xcc)[_0xfb76('0x1f')]();});}};}function handleEntityNotFound(_0x442592,_0x3fca44){return function(_0x579c2f){if(!_0x579c2f){_0x442592['sendStatus'](0x194);}return _0x579c2f;};}function handleError(_0x4b860c,_0x2cdf8f){_0x2cdf8f=_0x2cdf8f||0x1f4;return function(_0x54168e){logger[_0xfb76('0x29')](_0x54168e[_0xfb76('0x2a')]);if(_0x54168e[_0xfb76('0x2b')]){delete _0x54168e['name'];}_0x4b860c['status'](_0x2cdf8f)[_0xfb76('0x2c')](_0x54168e);};}exports[_0xfb76('0x2d')]=function(_0x804501,_0x4b0818){var _0x59ceb9={},_0xe6e21d={},_0x27409a={'count':0x0,'rows':[]};var _0xf60e7a=_[_0xfb76('0x2e')](db[_0xfb76('0x2f')][_0xfb76('0x30')],function(_0x34e9e4){return{'name':_0x34e9e4['fieldName'],'type':_0x34e9e4['type']['key']};});_0xe6e21d[_0xfb76('0x31')]=_[_0xfb76('0x2e')](_0xf60e7a,_0xfb76('0x2b'));_0xe6e21d[_0xfb76('0x32')]=_[_0xfb76('0x33')](_0x804501[_0xfb76('0x32')]);_0xe6e21d[_0xfb76('0x34')]=_['intersection'](_0xe6e21d[_0xfb76('0x31')],_0xe6e21d['query']);_0x59ceb9[_0xfb76('0x35')]=_['intersection'](_0xe6e21d[_0xfb76('0x31')],qs['fields'](_0x804501['query'][_0xfb76('0x36')]));_0x59ceb9[_0xfb76('0x35')]=_0x59ceb9[_0xfb76('0x35')][_0xfb76('0x37')]?_0x59ceb9[_0xfb76('0x35')]:_0xe6e21d[_0xfb76('0x31')];if(!_0x804501[_0xfb76('0x32')][_0xfb76('0x38')]('nolimit')){_0x59ceb9['limit']=qs[_0xfb76('0x22')](_0x804501[_0xfb76('0x32')][_0xfb76('0x22')]);_0x59ceb9[_0xfb76('0x39')]=qs[_0xfb76('0x39')](_0x804501[_0xfb76('0x32')]['offset']);}_0x59ceb9[_0xfb76('0x3a')]=qs[_0xfb76('0x3b')](_0x804501[_0xfb76('0x32')]['sort']);_0x59ceb9[_0xfb76('0x3c')]=qs[_0xfb76('0x34')](_['pick'](_0x804501[_0xfb76('0x32')],_0xe6e21d['filters']),_0xf60e7a);if(_0x804501['query']['filter']){_0x59ceb9[_0xfb76('0x3c')]=_[_0xfb76('0x3d')](_0x59ceb9[_0xfb76('0x3c')],{'$or':_[_0xfb76('0x2e')](_0xf60e7a,function(_0x4e2f71){if(_0x4e2f71['type']!==_0xfb76('0x3e')){var _0x4dd09a={};_0x4dd09a[_0x4e2f71[_0xfb76('0x2b')]]={'$like':'%'+_0x804501[_0xfb76('0x32')][_0xfb76('0x3f')]+'%'};return _0x4dd09a;}})});}_0x59ceb9=_[_0xfb76('0x3d')]({},_0x59ceb9,_0x804501[_0xfb76('0x40')]);var _0x3ab3a4={'where':_0x59ceb9['where']};return db[_0xfb76('0x2f')][_0xfb76('0x23')](_0x3ab3a4)[_0xfb76('0x28')](function(_0x5c6ddb){_0x27409a[_0xfb76('0x23')]=_0x5c6ddb;if(_0x804501[_0xfb76('0x32')][_0xfb76('0x41')]){_0x59ceb9[_0xfb76('0x42')]=[{'all':!![]}];}return db[_0xfb76('0x2f')][_0xfb76('0x43')](_0x59ceb9);})[_0xfb76('0x28')](function(_0x7ef6c5){_0x27409a[_0xfb76('0x44')]=_0x7ef6c5;return _0x27409a;})[_0xfb76('0x28')](respondWithFilteredResult(_0x4b0818,_0x59ceb9))['catch'](handleError(_0x4b0818,null));};exports['show']=function(_0x7f6fe7,_0x11b5e7){var _0x192979={'raw':!![],'where':{'id':_0x7f6fe7['params']['id']}},_0xb33f98={};_0xb33f98[_0xfb76('0x31')]=_[_0xfb76('0x33')](db['FaxApplication'][_0xfb76('0x30')]);_0xb33f98['query']=_[_0xfb76('0x33')](_0x7f6fe7[_0xfb76('0x32')]);_0xb33f98[_0xfb76('0x34')]=_[_0xfb76('0x45')](_0xb33f98[_0xfb76('0x31')],_0xb33f98['query']);_0x192979[_0xfb76('0x35')]=_[_0xfb76('0x45')](_0xb33f98[_0xfb76('0x31')],qs[_0xfb76('0x36')](_0x7f6fe7['query'][_0xfb76('0x36')]));_0x192979['attributes']=_0x192979['attributes'][_0xfb76('0x37')]?_0x192979['attributes']:_0xb33f98[_0xfb76('0x31')];if(_0x7f6fe7[_0xfb76('0x32')][_0xfb76('0x41')]){_0x192979[_0xfb76('0x42')]=[{'all':!![]}];}_0x192979=_[_0xfb76('0x3d')]({},_0x192979,_0x7f6fe7[_0xfb76('0x40')]);return db[_0xfb76('0x2f')][_0xfb76('0x46')](_0x192979)['then'](handleEntityNotFound(_0x11b5e7,null))['then'](respondWithResult(_0x11b5e7,null))[_0xfb76('0x47')](handleError(_0x11b5e7,null));};exports[_0xfb76('0x48')]=function(_0x3e0778,_0x4f3d4b){return db[_0xfb76('0x2f')][_0xfb76('0x48')](_0x3e0778[_0xfb76('0x49')],{})[_0xfb76('0x28')](respondWithResult(_0x4f3d4b,0xc9))[_0xfb76('0x47')](handleError(_0x4f3d4b,null));};exports['update']=function(_0x3ccdb1,_0x2f65ce){if(_0x3ccdb1[_0xfb76('0x49')]['id']){delete _0x3ccdb1[_0xfb76('0x49')]['id'];}return db[_0xfb76('0x2f')][_0xfb76('0x46')]({'where':{'id':_0x3ccdb1['params']['id']}})[_0xfb76('0x28')](handleEntityNotFound(_0x2f65ce,null))[_0xfb76('0x28')](saveUpdates(_0x3ccdb1['body'],null))[_0xfb76('0x28')](respondWithResult(_0x2f65ce,null))[_0xfb76('0x47')](handleError(_0x2f65ce,null));};exports[_0xfb76('0x4a')]=function(_0x52f39e,_0x3f4f54){return db[_0xfb76('0x2f')][_0xfb76('0x46')]({'where':{'id':_0x52f39e['params']['id']}})[_0xfb76('0x28')](handleEntityNotFound(_0x3f4f54,null))[_0xfb76('0x28')](removeEntity(_0x3f4f54,null))['catch'](handleError(_0x3f4f54,null));}; \ No newline at end of file +var _0x030d=['util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','nolimit','limit','order','sort','pick','filter','where','merge','options','FaxApplication','includeAll','include','findAll','show','params','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x56c497,_0x4d812e){var _0xc8dd8e=function(_0x44110e){while(--_0x44110e){_0x56c497['push'](_0x56c497['shift']());}};_0xc8dd8e(++_0x4d812e);}(_0x030d,0x93));var _0xd030=function(_0x46a4a5,_0x1799e9){_0x46a4a5=_0x46a4a5-0x0;var _0xcef2c5=_0x030d[_0x46a4a5];return _0xcef2c5;};'use strict';var emlformat=require(_0xd030('0x0'));var rimraf=require(_0xd030('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd030('0x2'));var rp=require(_0xd030('0x3'));var moment=require(_0xd030('0x4'));var BPromise=require(_0xd030('0x5'));var Mustache=require(_0xd030('0x6'));var util=require(_0xd030('0x7'));var path=require(_0xd030('0x8'));var sox=require(_0xd030('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd030('0xa'));var _=require(_0xd030('0xb'));var squel=require(_0xd030('0xc'));var crypto=require(_0xd030('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd030('0xe'));var toCsv=require(_0xd030('0xf'));var querystring=require('querystring');var Papa=require(_0xd030('0x10'));var Redis=require(_0xd030('0x11'));var authService=require(_0xd030('0x12'));var qs=require(_0xd030('0x13'));var as=require(_0xd030('0x14'));var hardwareService=require(_0xd030('0x15'));var logger=require(_0xd030('0x16'))(_0xd030('0x17'));var utils=require(_0xd030('0x18'));var config=require(_0xd030('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd030('0x1a'))['db'];function respondWithStatusCode(_0x521c8b,_0x584196){_0x584196=_0x584196||0xcc;return function(_0x3dd3fb){if(_0x3dd3fb){return _0x521c8b['sendStatus'](_0x584196);}return _0x521c8b[_0xd030('0x1b')](_0x584196)[_0xd030('0x1c')]();};}function respondWithResult(_0x537939,_0x2744d6){_0x2744d6=_0x2744d6||0xc8;return function(_0x151dc5){if(_0x151dc5){return _0x537939[_0xd030('0x1b')](_0x2744d6)['json'](_0x151dc5);}};}function respondWithFilteredResult(_0x22b332,_0x21e8c2){return function(_0x22fbd6){if(_0x22fbd6){var _0x2ed1b9=typeof _0x21e8c2[_0xd030('0x1d')]===_0xd030('0x1e')&&typeof _0x21e8c2['limit']===_0xd030('0x1e');var _0x48cb0d=_0x22fbd6[_0xd030('0x1f')];var _0xfcdaa3=_0x2ed1b9?0x0:_0x21e8c2[_0xd030('0x1d')];var _0x3defe1=_0x2ed1b9?_0x22fbd6[_0xd030('0x1f')]:_0x21e8c2['offset']+_0x21e8c2['limit'];var _0x164a46;if(_0x3defe1>=_0x48cb0d){_0x3defe1=_0x48cb0d;_0x164a46=0xc8;}else{_0x164a46=0xce;}_0x22b332[_0xd030('0x1b')](_0x164a46);return _0x22b332[_0xd030('0x20')](_0xd030('0x21'),_0xfcdaa3+'-'+_0x3defe1+'/'+_0x48cb0d)['json'](_0x22fbd6);}return null;};}function patchUpdates(_0x570d0a){return function(_0x28ae70){try{jsonpatch[_0xd030('0x22')](_0x28ae70,_0x570d0a,!![]);}catch(_0x5578d9){return BPromise[_0xd030('0x23')](_0x5578d9);}return _0x28ae70[_0xd030('0x24')]();};}function saveUpdates(_0x48b810,_0x433dd7){return function(_0x57d833){if(_0x57d833){return _0x57d833['update'](_0x48b810)[_0xd030('0x25')](function(_0x31ee1e){return _0x31ee1e;});}return null;};}function removeEntity(_0x5afd12,_0x5d3dc7){return function(_0x40796d){if(_0x40796d){return _0x40796d[_0xd030('0x26')]()['then'](function(){_0x5afd12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8133,_0x241a8a){return function(_0x4e05f6){if(!_0x4e05f6){_0x4a8133[_0xd030('0x27')](0x194);}return _0x4e05f6;};}function handleError(_0x224150,_0x380850){_0x380850=_0x380850||0x1f4;return function(_0x405939){logger[_0xd030('0x28')](_0x405939[_0xd030('0x29')]);if(_0x405939[_0xd030('0x2a')]){delete _0x405939[_0xd030('0x2a')];}_0x224150['status'](_0x380850)[_0xd030('0x2b')](_0x405939);};}exports[_0xd030('0x2c')]=function(_0x59c487,_0x1e59f8){var _0x1ab09b={},_0x5d3635={},_0x562ddc={'count':0x0,'rows':[]};var _0x4bb0b6=_[_0xd030('0x2d')](db['FaxApplication'][_0xd030('0x2e')],function(_0x3da84d){return{'name':_0x3da84d[_0xd030('0x2f')],'type':_0x3da84d[_0xd030('0x30')][_0xd030('0x31')]};});_0x5d3635[_0xd030('0x32')]=_[_0xd030('0x2d')](_0x4bb0b6,_0xd030('0x2a'));_0x5d3635['query']=_[_0xd030('0x33')](_0x59c487['query']);_0x5d3635[_0xd030('0x34')]=_[_0xd030('0x35')](_0x5d3635[_0xd030('0x32')],_0x5d3635[_0xd030('0x36')]);_0x1ab09b['attributes']=_[_0xd030('0x35')](_0x5d3635[_0xd030('0x32')],qs[_0xd030('0x37')](_0x59c487[_0xd030('0x36')][_0xd030('0x37')]));_0x1ab09b[_0xd030('0x38')]=_0x1ab09b['attributes']['length']?_0x1ab09b[_0xd030('0x38')]:_0x5d3635[_0xd030('0x32')];if(!_0x59c487[_0xd030('0x36')]['hasOwnProperty'](_0xd030('0x39'))){_0x1ab09b[_0xd030('0x3a')]=qs[_0xd030('0x3a')](_0x59c487[_0xd030('0x36')][_0xd030('0x3a')]);_0x1ab09b[_0xd030('0x1d')]=qs[_0xd030('0x1d')](_0x59c487['query']['offset']);}_0x1ab09b[_0xd030('0x3b')]=qs[_0xd030('0x3c')](_0x59c487[_0xd030('0x36')][_0xd030('0x3c')]);_0x1ab09b['where']=qs[_0xd030('0x34')](_[_0xd030('0x3d')](_0x59c487[_0xd030('0x36')],_0x5d3635[_0xd030('0x34')]),_0x4bb0b6);if(_0x59c487[_0xd030('0x36')][_0xd030('0x3e')]){_0x1ab09b[_0xd030('0x3f')]=_[_0xd030('0x40')](_0x1ab09b['where'],{'$or':_[_0xd030('0x2d')](_0x4bb0b6,function(_0x2dd533){if(_0x2dd533[_0xd030('0x30')]!=='VIRTUAL'){var _0x159e92={};_0x159e92[_0x2dd533[_0xd030('0x2a')]]={'$like':'%'+_0x59c487[_0xd030('0x36')][_0xd030('0x3e')]+'%'};return _0x159e92;}})});}_0x1ab09b=_[_0xd030('0x40')]({},_0x1ab09b,_0x59c487[_0xd030('0x41')]);var _0x38fcac={'where':_0x1ab09b[_0xd030('0x3f')]};return db[_0xd030('0x42')]['count'](_0x38fcac)[_0xd030('0x25')](function(_0x2eca32){_0x562ddc['count']=_0x2eca32;if(_0x59c487[_0xd030('0x36')][_0xd030('0x43')]){_0x1ab09b[_0xd030('0x44')]=[{'all':!![]}];}return db[_0xd030('0x42')][_0xd030('0x45')](_0x1ab09b);})[_0xd030('0x25')](function(_0x535ef0){_0x562ddc['rows']=_0x535ef0;return _0x562ddc;})[_0xd030('0x25')](respondWithFilteredResult(_0x1e59f8,_0x1ab09b))['catch'](handleError(_0x1e59f8,null));};exports[_0xd030('0x46')]=function(_0x35edf8,_0x414b66){var _0x31aff3={'raw':!![],'where':{'id':_0x35edf8[_0xd030('0x47')]['id']}},_0x5703cb={};_0x5703cb[_0xd030('0x32')]=_[_0xd030('0x33')](db[_0xd030('0x42')][_0xd030('0x2e')]);_0x5703cb['query']=_[_0xd030('0x33')](_0x35edf8[_0xd030('0x36')]);_0x5703cb[_0xd030('0x34')]=_[_0xd030('0x35')](_0x5703cb[_0xd030('0x32')],_0x5703cb[_0xd030('0x36')]);_0x31aff3[_0xd030('0x38')]=_[_0xd030('0x35')](_0x5703cb[_0xd030('0x32')],qs[_0xd030('0x37')](_0x35edf8[_0xd030('0x36')][_0xd030('0x37')]));_0x31aff3[_0xd030('0x38')]=_0x31aff3['attributes']['length']?_0x31aff3[_0xd030('0x38')]:_0x5703cb['model'];if(_0x35edf8[_0xd030('0x36')][_0xd030('0x43')]){_0x31aff3[_0xd030('0x44')]=[{'all':!![]}];}_0x31aff3=_[_0xd030('0x40')]({},_0x31aff3,_0x35edf8[_0xd030('0x41')]);return db[_0xd030('0x42')][_0xd030('0x48')](_0x31aff3)[_0xd030('0x25')](handleEntityNotFound(_0x414b66,null))[_0xd030('0x25')](respondWithResult(_0x414b66,null))[_0xd030('0x49')](handleError(_0x414b66,null));};exports[_0xd030('0x4a')]=function(_0x2056cf,_0x180f91){return db['FaxApplication']['create'](_0x2056cf[_0xd030('0x4b')],{})['then'](respondWithResult(_0x180f91,0xc9))[_0xd030('0x49')](handleError(_0x180f91,null));};exports[_0xd030('0x4c')]=function(_0x4b7109,_0x397462){if(_0x4b7109['body']['id']){delete _0x4b7109[_0xd030('0x4b')]['id'];}return db[_0xd030('0x42')][_0xd030('0x48')]({'where':{'id':_0x4b7109[_0xd030('0x47')]['id']}})[_0xd030('0x25')](handleEntityNotFound(_0x397462,null))[_0xd030('0x25')](saveUpdates(_0x4b7109['body'],null))[_0xd030('0x25')](respondWithResult(_0x397462,null))[_0xd030('0x49')](handleError(_0x397462,null));};exports[_0xd030('0x26')]=function(_0x4e78d6,_0x3505a2){return db[_0xd030('0x42')][_0xd030('0x48')]({'where':{'id':_0x4e78d6[_0xd030('0x47')]['id']}})['then'](handleEntityNotFound(_0x3505a2,null))[_0xd030('0x25')](removeEntity(_0x3505a2,null))[_0xd030('0x49')](handleError(_0x3505a2,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index aa3fd34..ac242e0 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 _0xc67c=['utf8mb4_unicode_ci','lodash','util','api','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4'];(function(_0x547d00,_0x5a857f){var _0x1b5aef=function(_0x167a68){while(--_0x167a68){_0x547d00['push'](_0x547d00['shift']());}};_0x1b5aef(++_0x5a857f);}(_0xc67c,0x181));var _0xcc67=function(_0x51957b,_0x190787){_0x51957b=_0x51957b-0x0;var _0x46cb22=_0xc67c[_0x51957b];return _0x46cb22;};'use strict';var _=require(_0xcc67('0x0'));var util=require(_0xcc67('0x1'));var logger=require('../../config/logger')(_0xcc67('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc67('0x3'));var fs=require('fs');var path=require(_0xcc67('0x4'));var rimraf=require('rimraf');var config=require(_0xcc67('0x5'));var attributes=require(_0xcc67('0x6'));module[_0xcc67('0x7')]=function(_0x6248a9,_0x2ac914){return _0x6248a9[_0xcc67('0x8')](_0xcc67('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc67('0xa'),'collate':_0xcc67('0xb')});}; \ No newline at end of file +var _0x9caf=['rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x58a4bd,_0x54aa48){var _0x56fc89=function(_0xbb1887){while(--_0xbb1887){_0x58a4bd['push'](_0x58a4bd['shift']());}};_0x56fc89(++_0x54aa48);}(_0x9caf,0x1ab));var _0xf9ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9caf[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf9ca('0x0'));var util=require(_0xf9ca('0x1'));var logger=require(_0xf9ca('0x2'))(_0xf9ca('0x3'));var moment=require(_0xf9ca('0x4'));var BPromise=require(_0xf9ca('0x5'));var rp=require(_0xf9ca('0x6'));var fs=require('fs');var path=require(_0xf9ca('0x7'));var rimraf=require(_0xf9ca('0x8'));var config=require(_0xf9ca('0x9'));var attributes=require(_0xf9ca('0xa'));module['exports']=function(_0x53cda1,_0x917e6d){return _0x53cda1[_0xf9ca('0xb')](_0xf9ca('0xc'),attributes,{'tableName':_0xf9ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf9ca('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d97f880..6ff40a9 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 _0x9709=['request\x20sent','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','update','body','options','raw','where','attributes','limit','then','info','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9709,0x91));var _0x9970=function(_0x4706c6,_0x23d052){_0x4706c6=_0x4706c6-0x0;var _0x2d7a25=_0x9709[_0x4706c6];return _0x2d7a25;};'use strict';var _=require(_0x9970('0x0'));var util=require(_0x9970('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9970('0x2'));var fs=require('fs');var Redis=require(_0x9970('0x3'));var db=require(_0x9970('0x4'))['db'];var utils=require(_0x9970('0x5'));var logger=require(_0x9970('0x6'))(_0x9970('0x7'));var config=require(_0x9970('0x8'));var jayson=require(_0x9970('0x9'));var client=jayson[_0x9970('0xa')][_0x9970('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15783f,_0x1e9899,_0x4e8401){return new BPromise(function(_0xdcde4a,_0x12c297){return client[_0x9970('0xc')](_0x15783f,_0x4e8401)['then'](function(_0x35682c){logger['info']('FaxApplication,\x20%s,\x20%s',_0x1e9899,'request\x20sent');logger[_0x9970('0xd')](_0x9970('0xe'),_0x1e9899,_0x9970('0xf'),JSON[_0x9970('0x10')](_0x35682c));if(_0x35682c[_0x9970('0x11')]){if(_0x35682c[_0x9970('0x11')]['code']===0x1f4){logger[_0x9970('0x11')](_0x9970('0x12'),_0x1e9899,_0x35682c[_0x9970('0x11')][_0x9970('0x13')]);return _0x12c297(_0x35682c[_0x9970('0x11')]['message']);}logger[_0x9970('0x11')]('FaxApplication,\x20%s,\x20%s',_0x1e9899,_0x35682c['error'][_0x9970('0x13')]);return _0xdcde4a(_0x35682c[_0x9970('0x11')][_0x9970('0x13')]);}else{logger['info'](_0x9970('0x12'),_0x1e9899,_0x9970('0xf'));_0xdcde4a(_0x35682c[_0x9970('0x14')][_0x9970('0x13')]);}})['catch'](function(_0x2cd139){logger[_0x9970('0x11')](_0x9970('0x12'),_0x1e9899,_0x2cd139);_0x12c297(_0x2cd139);});});}exports[_0x9970('0x15')]=function(_0x4cc5c9){var _0x20f9d7=this;return new Promise(function(_0x6e4a4d,_0x3b8ad9){return db['FaxApplication'][_0x9970('0x16')](_0x4cc5c9[_0x9970('0x17')],{'raw':_0x4cc5c9[_0x9970('0x18')]?_0x4cc5c9[_0x9970('0x18')][_0x9970('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cc5c9['options']?_0x4cc5c9[_0x9970('0x18')][_0x9970('0x1a')]||null:null,'attributes':_0x4cc5c9[_0x9970('0x18')]?_0x4cc5c9[_0x9970('0x18')][_0x9970('0x1b')]||null:null,'limit':_0x4cc5c9[_0x9970('0x18')]?_0x4cc5c9[_0x9970('0x18')][_0x9970('0x1c')]||null:null})[_0x9970('0x1d')](function(_0x416ac1){logger[_0x9970('0x1e')]('UpdateFaxApplication',_0x4cc5c9);logger[_0x9970('0xd')]('UpdateFaxApplication',_0x4cc5c9,JSON[_0x9970('0x10')](_0x416ac1));_0x6e4a4d(_0x416ac1);})[_0x9970('0x1f')](function(_0x328ad8){logger[_0x9970('0x11')](_0x9970('0x15'),_0x328ad8[_0x9970('0x13')],_0x4cc5c9);_0x3b8ad9(_0x20f9d7[_0x9970('0x11')](0x1f4,_0x328ad8[_0x9970('0x13')]));});});}; \ No newline at end of file +var _0x9055=['options','raw','where','attributes','UpdateFaxApplication','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','update','body'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9055,0x1eb));var _0x5905=function(_0x2b857c,_0x220756){_0x2b857c=_0x2b857c-0x0;var _0x43e2af=_0x9055[_0x2b857c];return _0x43e2af;};'use strict';var _=require(_0x5905('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5905('0x1'));var db=require(_0x5905('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5905('0x3'))(_0x5905('0x4'));var config=require(_0x5905('0x5'));var jayson=require(_0x5905('0x6'));var client=jayson[_0x5905('0x7')][_0x5905('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x275cea,_0x412c90,_0x59d027){return new BPromise(function(_0x551d85,_0x24b89f){return client['request'](_0x275cea,_0x59d027)[_0x5905('0x9')](function(_0x530680){logger[_0x5905('0xa')]('FaxApplication,\x20%s,\x20%s',_0x412c90,_0x5905('0xb'));logger[_0x5905('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x412c90,'request\x20sent',JSON[_0x5905('0xd')](_0x530680));if(_0x530680[_0x5905('0xe')]){if(_0x530680[_0x5905('0xe')]['code']===0x1f4){logger[_0x5905('0xe')](_0x5905('0xf'),_0x412c90,_0x530680['error'][_0x5905('0x10')]);return _0x24b89f(_0x530680[_0x5905('0xe')]['message']);}logger[_0x5905('0xe')](_0x5905('0xf'),_0x412c90,_0x530680[_0x5905('0xe')][_0x5905('0x10')]);return _0x551d85(_0x530680[_0x5905('0xe')][_0x5905('0x10')]);}else{logger[_0x5905('0xa')](_0x5905('0xf'),_0x412c90,_0x5905('0xb'));_0x551d85(_0x530680[_0x5905('0x11')][_0x5905('0x10')]);}})[_0x5905('0x12')](function(_0x374e70){logger['error'](_0x5905('0xf'),_0x412c90,_0x374e70);_0x24b89f(_0x374e70);});});}exports['UpdateFaxApplication']=function(_0xa4e4fb){var _0x594aba=this;return new Promise(function(_0x234d36,_0x73b880){return db[_0x5905('0x13')][_0x5905('0x14')](_0xa4e4fb[_0x5905('0x15')],{'raw':_0xa4e4fb[_0x5905('0x16')]?_0xa4e4fb[_0x5905('0x16')][_0x5905('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa4e4fb[_0x5905('0x16')]?_0xa4e4fb[_0x5905('0x16')][_0x5905('0x18')]||null:null,'attributes':_0xa4e4fb['options']?_0xa4e4fb[_0x5905('0x16')][_0x5905('0x19')]||null:null,'limit':_0xa4e4fb['options']?_0xa4e4fb[_0x5905('0x16')]['limit']||null:null})[_0x5905('0x9')](function(_0x23abec){logger[_0x5905('0xa')](_0x5905('0x1a'),_0xa4e4fb);logger['debug'](_0x5905('0x1a'),_0xa4e4fb,JSON[_0x5905('0xd')](_0x23abec));_0x234d36(_0x23abec);})[_0x5905('0x12')](function(_0x18ac01){logger['error']('UpdateFaxApplication',_0x18ac01[_0x5905('0x10')],_0xa4e4fb);_0x73b880(_0x594aba[_0x5905('0xe')](0x1f4,_0x18ac01['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 04e1c0b..117c2d5 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 _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x955f,0x1eb));var _0xf955=function(_0x41537c,_0x10998a){_0x41537c=_0x41537c-0x0;var _0x401632=_0x955f[_0x41537c];return _0x401632;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./faxApplication.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file +var _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x12badd,_0x15f22f){var _0x272e27=function(_0x49080b){while(--_0x49080b){_0x12badd['push'](_0x12badd['shift']());}};_0x272e27(++_0x15f22f);}(_0xd4a2,0x173));var _0x2d4a=function(_0x386428,_0x1a68a4){_0x386428=_0x386428-0x0;var _0x23e840=_0xd4a2[_0x386428];return _0x23e840;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 12219b9..237ee50 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 _0x8f4c=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x4bc2d2,_0x40ea2a){var _0x3f3a48=function(_0x73f615){while(--_0x73f615){_0x4bc2d2['push'](_0x4bc2d2['shift']());}};_0x3f3a48(++_0x40ea2a);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5c7773,_0x2ef8c2){_0x5c7773=_0x5c7773-0x0;var _0x536bf0=_0x8f4c[_0x5c7773];return _0x536bf0;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'closed':{'type':Sequelize[_0xc8f4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc8f4('0x3')]},'disposition':{'type':Sequelize[_0xc8f4('0x4')]},'secondDisposition':{'type':Sequelize[_0xc8f4('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc8f4('0x4')]},'read1stAt':{'type':Sequelize[_0xc8f4('0x3')]},'fax':{'type':Sequelize[_0xc8f4('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc8f4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xc8f4('0x6')]}}; \ No newline at end of file +var _0xeb3b=['BOOLEAN','DATE','STRING','out','ENUM','INTEGER','sequelize','exports'];(function(_0x3106bb,_0xf00fb0){var _0x1c5b0b=function(_0xdb838c){while(--_0xdb838c){_0x3106bb['push'](_0x3106bb['shift']());}};_0x1c5b0b(++_0xf00fb0);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1f4e09,_0x1fc591){_0x1f4e09=_0x1f4e09-0x0;var _0x10deec=_0xeb3b[_0x1f4e09];return _0x10deec;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'closed':{'type':Sequelize[_0xbeb3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbeb3('0x3')]},'disposition':{'type':Sequelize[_0xbeb3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbeb3('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xbeb3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbeb3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbeb3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbeb3('0x6')]('in',_0xbeb3('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xbeb3('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 3faf12e..477287b 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 _0xea11=['order','sort','where','pick','FaxInteractionId','filter','$gte','format','count','rows','addTags','setTags','omit','Tag','color','faxInteractionTags:save','removeTags','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','name','FaxInteraction','fieldName','type','key','getOptions','findAll','fax','user','catch','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','create','body','find','describe','addMessage','FaxMessage','ids','getMessages','findOne','length','hasOwnProperty','nolimit'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xea11,0x161));var _0x1ea1=function(_0x230c15,_0x11f71c){_0x230c15=_0x230c15-0x0;var _0x50ce5d=_0xea11[_0x230c15];return _0x50ce5d;};'use strict';var rimraf=require(_0x1ea1('0x0'));var zipdir=require(_0x1ea1('0x1'));var moment=require(_0x1ea1('0x2'));var BPromise=require(_0x1ea1('0x3'));var util=require(_0x1ea1('0x4'));var path=require(_0x1ea1('0x5'));var fs=require('fs');var _=require(_0x1ea1('0x6'));var Redis=require('ioredis');var interaction=require(_0x1ea1('0x7'));var qs=require(_0x1ea1('0x8'));var logger=require(_0x1ea1('0x9'))('api');var config=require(_0x1ea1('0xa'));var db=require('../../mysqldb')['db'];config[_0x1ea1('0xb')]=_[_0x1ea1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1ea1('0xd'))(new Redis(config[_0x1ea1('0xb')]));require('./faxInteraction.socket')[_0x1ea1('0xe')](socket);function respondWithStatusCode(_0x3aa197,_0x544fd8){_0x544fd8=_0x544fd8||0xcc;return function(_0x17e0e4){if(_0x17e0e4){return _0x3aa197[_0x1ea1('0xf')](_0x544fd8);}return _0x3aa197[_0x1ea1('0x10')](_0x544fd8)[_0x1ea1('0x11')]();};}function respondWithResult(_0x1a467f,_0x236153){_0x236153=_0x236153||0xc8;return function(_0x3c5d39){if(_0x3c5d39){return _0x1a467f[_0x1ea1('0x10')](_0x236153)[_0x1ea1('0x12')](_0x3c5d39);}};}function respondWithFilteredResult(_0x41f0af,_0x24abd4){return function(_0x429e08){if(_0x429e08){var _0x4ec3c6=typeof _0x24abd4[_0x1ea1('0x13')]===_0x1ea1('0x14')&&typeof _0x24abd4[_0x1ea1('0x15')]===_0x1ea1('0x14');var _0x33c656=_0x429e08['count'];var _0x1a9a3f=_0x4ec3c6?0x0:_0x24abd4[_0x1ea1('0x13')];var _0x1cbe82=_0x4ec3c6?_0x429e08['count']:_0x24abd4[_0x1ea1('0x13')]+_0x24abd4[_0x1ea1('0x15')];var _0x25a61f;if(_0x1cbe82>=_0x33c656){_0x1cbe82=_0x33c656;_0x25a61f=0xc8;}else{_0x25a61f=0xce;}_0x41f0af['status'](_0x25a61f);return _0x41f0af[_0x1ea1('0x16')](_0x1ea1('0x17'),_0x1a9a3f+'-'+_0x1cbe82+'/'+_0x33c656)['json'](_0x429e08);}return null;};}function saveUpdates(_0xf4fd3){return function(_0x5d78b1){if(_0x5d78b1){return _0x5d78b1[_0x1ea1('0x18')](_0xf4fd3)[_0x1ea1('0x19')](function(_0x3b81d0){return _0x3b81d0;});}return null;};}function removeEntity(_0x3a0d3d){return function(_0x4a521b){if(_0x4a521b){return _0x4a521b[_0x1ea1('0x1a')]()[_0x1ea1('0x19')](function(){_0x3a0d3d['status'](0xcc)[_0x1ea1('0x11')]();});}};}function handleEntityNotFound(_0x3e6c5b){return function(_0x3c3da8){if(!_0x3c3da8){_0x3e6c5b[_0x1ea1('0xf')](0x194);}return _0x3c3da8;};}function handleError(_0x5ef848,_0x341900){_0x341900=_0x341900||0x1f4;return function(_0x2a63fe){logger['error'](_0x2a63fe['stack']);if(_0x2a63fe['name']){delete _0x2a63fe[_0x1ea1('0x1b')];}_0x5ef848[_0x1ea1('0x10')](_0x341900)['send'](_0x2a63fe);};}exports['index']=function(_0x5e570d,_0x4d731b){var _0x4894a3={};var _0x4bc8e0=_['map'](db[_0x1ea1('0x1c')]['rawAttributes'],function(_0x55c23f){return{'name':_0x55c23f[_0x1ea1('0x1d')],'type':_0x55c23f[_0x1ea1('0x1e')][_0x1ea1('0x1f')]};});_0x4894a3=qs[_0x1ea1('0x20')](_0x4bc8e0,_0x5e570d);return interaction[_0x1ea1('0x21')](_0x1ea1('0x22'),_0x5e570d['query'],_0x5e570d[_0x1ea1('0x23')],_0x4894a3,_0x4bc8e0)[_0x1ea1('0x19')](respondWithFilteredResult(_0x4d731b,_0x4894a3))[_0x1ea1('0x24')](handleError(_0x4d731b,null));};exports[_0x1ea1('0x25')]=function(_0x3523fd,_0x32da68){var _0x35d408={'raw':![],'where':{'id':_0x3523fd[_0x1ea1('0x26')]['id']}},_0x5c88cd={};_0x5c88cd[_0x1ea1('0x27')]=_[_0x1ea1('0x28')](db[_0x1ea1('0x1c')][_0x1ea1('0x29')]);_0x5c88cd['query']=_[_0x1ea1('0x28')](_0x3523fd[_0x1ea1('0x2a')]);_0x5c88cd[_0x1ea1('0x2b')]=_['intersection'](_0x5c88cd['model'],_0x5c88cd[_0x1ea1('0x2a')]);_0x35d408['attributes']=_[_0x1ea1('0x2c')](_0x5c88cd['model'],qs[_0x1ea1('0x2d')](_0x3523fd[_0x1ea1('0x2a')][_0x1ea1('0x2d')]));_0x35d408[_0x1ea1('0x2e')]=_0x35d408[_0x1ea1('0x2e')]['length']?_0x35d408[_0x1ea1('0x2e')]:_0x5c88cd['model'];if(_0x3523fd[_0x1ea1('0x2a')][_0x1ea1('0x2f')]){_0x35d408[_0x1ea1('0x30')]=[{'all':!![]}];}_0x35d408=_[_0x1ea1('0x31')]({},_0x35d408,_0x3523fd[_0x1ea1('0x32')]);return db[_0x1ea1('0x1c')]['find'](_0x35d408)[_0x1ea1('0x19')](handleEntityNotFound(_0x32da68,null))[_0x1ea1('0x19')](respondWithResult(_0x32da68,null))[_0x1ea1('0x24')](handleError(_0x32da68,null));};exports[_0x1ea1('0x33')]=function(_0x3d26dc,_0x5d8a0b){return db[_0x1ea1('0x1c')][_0x1ea1('0x33')](_0x3d26dc[_0x1ea1('0x34')],{})['then'](respondWithResult(_0x5d8a0b,0xc9))[_0x1ea1('0x24')](handleError(_0x5d8a0b,null));};exports[_0x1ea1('0x18')]=function(_0x694056,_0x1eb91d){if(_0x694056[_0x1ea1('0x34')]['id']){delete _0x694056['body']['id'];}return db[_0x1ea1('0x1c')][_0x1ea1('0x35')]({'where':{'id':_0x694056[_0x1ea1('0x26')]['id']}})[_0x1ea1('0x19')](handleEntityNotFound(_0x1eb91d,null))['then'](saveUpdates(_0x694056['body'],null))[_0x1ea1('0x19')](respondWithResult(_0x1eb91d,null))[_0x1ea1('0x24')](handleError(_0x1eb91d,null));};exports[_0x1ea1('0x1a')]=function(_0x1ebead,_0x48f5e9){return db[_0x1ea1('0x1c')][_0x1ea1('0x35')]({'where':{'id':_0x1ebead[_0x1ea1('0x26')]['id']}})[_0x1ea1('0x19')](handleEntityNotFound(_0x48f5e9,null))['then'](removeEntity(_0x48f5e9,null))['catch'](handleError(_0x48f5e9,null));};exports[_0x1ea1('0x36')]=function(_0x2ec6bf,_0x3cc455){return db[_0x1ea1('0x1c')]['describe']()[_0x1ea1('0x19')](respondWithResult(_0x3cc455,null))[_0x1ea1('0x24')](handleError(_0x3cc455,null));};exports[_0x1ea1('0x37')]=function(_0x14772c,_0x5857e4){return db[_0x1ea1('0x38')]['find']({'where':{'id':_0x14772c[_0x1ea1('0x26')]['id']}})[_0x1ea1('0x19')](handleEntityNotFound(_0x5857e4,null))[_0x1ea1('0x19')](function(_0x35659e){if(_0x35659e){return _0x35659e[_0x1ea1('0x37')](_0x14772c['body'][_0x1ea1('0x39')],_['omit'](_0x14772c[_0x1ea1('0x34')],['ids','id'])||{});}})[_0x1ea1('0x19')](respondWithResult(_0x5857e4,null))[_0x1ea1('0x24')](handleError(_0x5857e4,null));};exports[_0x1ea1('0x3a')]=function(_0x226be6,_0x2c6b7e){var _0xadadc={'raw':![],'where':{}};var _0x51be7b={};var _0x206ae1={'count':0x0,'rows':[]};return db[_0x1ea1('0x1c')][_0x1ea1('0x3b')]({'where':{'id':_0x226be6[_0x1ea1('0x26')]['id']}})[_0x1ea1('0x19')](handleEntityNotFound(_0x2c6b7e,null))[_0x1ea1('0x19')](function(_0x3da50a){if(_0x3da50a){_0x51be7b[_0x1ea1('0x27')]=_[_0x1ea1('0x28')](db[_0x1ea1('0x38')]['rawAttributes']);_0x51be7b[_0x1ea1('0x2a')]=_[_0x1ea1('0x28')](_0x226be6['query']);_0x51be7b['filters']=_[_0x1ea1('0x2c')](_0x51be7b['model'],_0x51be7b[_0x1ea1('0x2a')]);_0xadadc[_0x1ea1('0x2e')]=_[_0x1ea1('0x2c')](_0x51be7b[_0x1ea1('0x27')],qs[_0x1ea1('0x2d')](_0x226be6['query'][_0x1ea1('0x2d')]));_0xadadc[_0x1ea1('0x2e')]=_0xadadc[_0x1ea1('0x2e')][_0x1ea1('0x3c')]?_0xadadc['attributes']:_0x51be7b[_0x1ea1('0x27')];if(!_0x226be6['query'][_0x1ea1('0x3d')](_0x1ea1('0x3e'))){_0xadadc[_0x1ea1('0x15')]=qs['limit'](_0x226be6['query'][_0x1ea1('0x15')]);_0xadadc[_0x1ea1('0x13')]=qs[_0x1ea1('0x13')](_0x226be6[_0x1ea1('0x2a')][_0x1ea1('0x13')]);}_0xadadc[_0x1ea1('0x3f')]=qs[_0x1ea1('0x40')](_0x226be6['query']['sort']);_0xadadc[_0x1ea1('0x41')]=qs[_0x1ea1('0x2b')](_[_0x1ea1('0x42')](_0x226be6['query'],_0x51be7b[_0x1ea1('0x2b')]));_0xadadc[_0x1ea1('0x41')][_0x1ea1('0x43')]=_0x3da50a['id'];if(_0x226be6[_0x1ea1('0x2a')][_0x1ea1('0x44')]){_0xadadc[_0x1ea1('0x41')]=_['merge'](_0xadadc[_0x1ea1('0x41')],{'$or':_['map'](_0xadadc[_0x1ea1('0x2e')],function(_0x4f2685){var _0x3b7131={};_0x3b7131[_0x4f2685]={'$like':'%'+_0x226be6[_0x1ea1('0x2a')][_0x1ea1('0x44')]+'%'};return _0x3b7131;})});}if(_0x226be6[_0x1ea1('0x2a')][_0x1ea1('0x45')]){var _0x2c75f8=_0x226be6[_0x1ea1('0x2a')][_0x1ea1('0x45')]['split'](',');var _0x11540d={};_0x11540d[_0x2c75f8[0x0]]={'$gte':moment(_0x2c75f8[0x1])[_0x1ea1('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0xadadc[_0x1ea1('0x41')]=_['merge'](_0xadadc[_0x1ea1('0x41')],_0x11540d);}_0xadadc=_[_0x1ea1('0x31')]({},_0xadadc,_0x226be6[_0x1ea1('0x32')]);return db['FaxMessage']['count']({'where':_0xadadc['where']})[_0x1ea1('0x19')](function(_0x3abbe1){_0x206ae1[_0x1ea1('0x47')]=_0x3abbe1;if(_0x226be6['query'][_0x1ea1('0x2f')]){_0xadadc[_0x1ea1('0x30')]=[{'all':!![]}];}return db['FaxMessage'][_0x1ea1('0x21')](_0xadadc);})[_0x1ea1('0x19')](function(_0x1435aa){_0x206ae1[_0x1ea1('0x48')]=_0x1435aa;return _0x206ae1;});}})[_0x1ea1('0x19')](respondWithFilteredResult(_0x2c6b7e,_0xadadc))['catch'](handleError(_0x2c6b7e,null));};exports[_0x1ea1('0x49')]=function(_0x432982,_0x50a728){return db['FaxInteraction'][_0x1ea1('0x35')]({'where':{'id':_0x432982[_0x1ea1('0x26')]['id']}})['then'](handleEntityNotFound(_0x50a728,null))[_0x1ea1('0x19')](function(_0x3b5412){if(_0x3b5412){return _0x3b5412[_0x1ea1('0x4a')](_0x432982['body'][_0x1ea1('0x39')],_[_0x1ea1('0x4b')](_0x432982[_0x1ea1('0x34')],[_0x1ea1('0x39'),'id'])||{})['spread'](function(){return db[_0x1ea1('0x4c')][_0x1ea1('0x21')]({'attributes':['id',_0x1ea1('0x1b'),_0x1ea1('0x4d')],'where':{'id':_0x432982[_0x1ea1('0x34')][_0x1ea1('0x39')]}});})[_0x1ea1('0x19')](function(_0x59928b){socket['emit'](_0x1ea1('0x4e'),{'id':Number(_0x432982[_0x1ea1('0x26')]['id']),'tags':_0x59928b||[]});return{'id':Number(_0x432982['params']['id']),'tags':_0x59928b||[]};});}})['then'](respondWithResult(_0x50a728,null))[_0x1ea1('0x24')](handleError(_0x50a728,null));};exports[_0x1ea1('0x4f')]=function(_0x4176a3,_0x185559){return db[_0x1ea1('0x1c')]['find']({'where':{'id':_0x4176a3[_0x1ea1('0x26')]['id']}})[_0x1ea1('0x19')](handleEntityNotFound(_0x185559,null))[_0x1ea1('0x19')](function(_0x7d2310){if(_0x7d2310){return _0x7d2310[_0x1ea1('0x4f')](_0x4176a3['query'][_0x1ea1('0x39')]);}})[_0x1ea1('0x19')](respondWithStatusCode(_0x185559,null))['catch'](handleError(_0x185559,null));};exports['download']=function(_0x1e151e,_0x3f9978){var _0x21697b=moment()['unix']()[_0x1ea1('0x50')]();var _0x4287de=path[_0x1ea1('0x51')](config[_0x1ea1('0x52')],_0x1ea1('0x53'),_0x1ea1('0x54'),_0x1ea1('0x55'));var _0x45de8d=path[_0x1ea1('0x51')](config[_0x1ea1('0x52')],_0x1ea1('0x53'),_0x1ea1('0x54'),_0x1ea1('0x56'));var _0x537831=path[_0x1ea1('0x51')](_0x4287de,_0x21697b);var _0x3be483=util['format'](_0x1ea1('0x57'),_0x1e151e['params']['id'],_0x21697b);var _0x54f2f2=path['join'](_0x4287de,_0x3be483);var _0x3a6969=[];_0x3a6969[_0x1ea1('0x58')]({'model':db[_0x1ea1('0x59')],'as':_0x1ea1('0x59'),'raw':!![]});var _0x519fc9=[{'model':db[_0x1ea1('0x38')],'as':_0x1ea1('0x5a'),'attributes':['id',_0x1ea1('0x34'),_0x1ea1('0x5b')],'include':_0x3a6969}];return db['FaxInteraction']['find']({'where':{'id':_0x1e151e[_0x1ea1('0x26')]['id']},'include':_0x519fc9})[_0x1ea1('0x19')](handleEntityNotFound(_0x3f9978,null))[_0x1ea1('0x19')](function(_0x4a9392){if(_0x4a9392&&_0x4a9392[_0x1ea1('0x5a')]){var _0x52d6b4=_0x4a9392[_0x1ea1('0x5c')]({'plain':!![]});fs[_0x1ea1('0x5d')](_0x537831);for(var _0x13416a=0x0;_0x13416a<_0x52d6b4['Messages'][_0x1ea1('0x3c')];_0x13416a++){var _0x4f392d=_0x52d6b4[_0x1ea1('0x5a')][_0x13416a][_0x1ea1('0x59')];if(_0x4f392d){var _0x25fb07=path[_0x1ea1('0x51')](_0x45de8d,_0x4f392d[_0x1ea1('0x5e')]);if(fs[_0x1ea1('0x5f')](_0x25fb07)){fs[_0x1ea1('0x60')](_0x25fb07)[_0x1ea1('0x61')](fs[_0x1ea1('0x62')](path[_0x1ea1('0x51')](_0x537831,_0x4f392d[_0x1ea1('0x5e')])));}}}return BPromise[_0x1ea1('0x63')]()[_0x1ea1('0x19')](function(){return new BPromise(function(_0x2fd9ed,_0x188bc2){zipdir(_0x537831,{'saveTo':_0x54f2f2},function(_0x16e268,_0x197865){if(_0x16e268)return _0x188bc2(_0x16e268);return _0x2fd9ed(_0x197865);});})['then'](function(){return new BPromise(function(_0x32de92,_0x38bd88){rimraf(_0x537831,function(_0x27560d){if(_0x27560d)_0x38bd88(_0x27560d);return _0x32de92();});});})[_0x1ea1('0x19')](function(){return _0x3f9978[_0x1ea1('0x64')](_0x54f2f2,_0x3be483,function(_0x747e66){if(_0x747e66){console[_0x1ea1('0x65')](_0x1ea1('0x66'),_0x747e66);}else{fs[_0x1ea1('0x67')](_0x54f2f2);}});});});}else{return _0x3f9978[_0x1ea1('0xf')](0xc8);}})[_0x1ea1('0x24')](handleError(_0x3f9978,null));}; \ No newline at end of file +var _0x9d23=['sort','where','FaxInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','omit','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','server','tmp','join','root','files','attachments','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','basename','resolve','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','error','name','index','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','fax','query','user','catch','show','keys','filters','model','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','update','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','length','nolimit'];(function(_0x87f37f,_0x295180){var _0x302610=function(_0x1bc70d){while(--_0x1bc70d){_0x87f37f['push'](_0x87f37f['shift']());}};_0x302610(++_0x295180);}(_0x9d23,0x8f));var _0x39d2=function(_0x2db67e,_0x5b30d0){_0x2db67e=_0x2db67e-0x0;var _0x1871b8=_0x9d23[_0x2db67e];return _0x1871b8;};'use strict';var rimraf=require(_0x39d2('0x0'));var zipdir=require(_0x39d2('0x1'));var moment=require('moment');var BPromise=require(_0x39d2('0x2'));var util=require(_0x39d2('0x3'));var path=require(_0x39d2('0x4'));var fs=require('fs');var _=require(_0x39d2('0x5'));var Redis=require('ioredis');var interaction=require(_0x39d2('0x6'));var qs=require(_0x39d2('0x7'));var logger=require(_0x39d2('0x8'))('api');var config=require(_0x39d2('0x9'));var db=require(_0x39d2('0xa'))['db'];config[_0x39d2('0xb')]=_[_0x39d2('0xc')](config[_0x39d2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x39d2('0xd'))(new Redis(config[_0x39d2('0xb')]));require(_0x39d2('0xe'))[_0x39d2('0xf')](socket);function respondWithStatusCode(_0x15f6d4,_0x2d5515){_0x2d5515=_0x2d5515||0xcc;return function(_0x49ad08){if(_0x49ad08){return _0x15f6d4[_0x39d2('0x10')](_0x2d5515);}return _0x15f6d4['status'](_0x2d5515)[_0x39d2('0x11')]();};}function respondWithResult(_0x147627,_0x18cc32){_0x18cc32=_0x18cc32||0xc8;return function(_0xa0b650){if(_0xa0b650){return _0x147627[_0x39d2('0x12')](_0x18cc32)[_0x39d2('0x13')](_0xa0b650);}};}function respondWithFilteredResult(_0x2c5c8f,_0x96dae3){return function(_0x41a347){if(_0x41a347){var _0x8b6b3e=typeof _0x96dae3[_0x39d2('0x14')]==='undefined'&&typeof _0x96dae3['limit']===_0x39d2('0x15');var _0x495a8c=_0x41a347['count'];var _0x2627fd=_0x8b6b3e?0x0:_0x96dae3[_0x39d2('0x14')];var _0x195f05=_0x8b6b3e?_0x41a347[_0x39d2('0x16')]:_0x96dae3[_0x39d2('0x14')]+_0x96dae3[_0x39d2('0x17')];var _0x284935;if(_0x195f05>=_0x495a8c){_0x195f05=_0x495a8c;_0x284935=0xc8;}else{_0x284935=0xce;}_0x2c5c8f['status'](_0x284935);return _0x2c5c8f[_0x39d2('0x18')](_0x39d2('0x19'),_0x2627fd+'-'+_0x195f05+'/'+_0x495a8c)[_0x39d2('0x13')](_0x41a347);}return null;};}function saveUpdates(_0x1b0d1e){return function(_0xc65311){if(_0xc65311){return _0xc65311['update'](_0x1b0d1e)['then'](function(_0xd12343){return _0xd12343;});}return null;};}function removeEntity(_0x85bcd){return function(_0x415c81){if(_0x415c81){return _0x415c81[_0x39d2('0x1a')]()[_0x39d2('0x1b')](function(){_0x85bcd[_0x39d2('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x375f74){return function(_0x31ef05){if(!_0x31ef05){_0x375f74[_0x39d2('0x10')](0x194);}return _0x31ef05;};}function handleError(_0x2efdc0,_0x2b9c71){_0x2b9c71=_0x2b9c71||0x1f4;return function(_0x16323c){logger[_0x39d2('0x1c')](_0x16323c['stack']);if(_0x16323c[_0x39d2('0x1d')]){delete _0x16323c[_0x39d2('0x1d')];}_0x2efdc0[_0x39d2('0x12')](_0x2b9c71)['send'](_0x16323c);};}exports[_0x39d2('0x1e')]=function(_0xccf30c,_0x93aa7b){var _0x29a07e={};var _0x4c99b9=_['map'](db[_0x39d2('0x1f')][_0x39d2('0x20')],function(_0xd5197d){return{'name':_0xd5197d[_0x39d2('0x21')],'type':_0xd5197d[_0x39d2('0x22')][_0x39d2('0x23')]};});_0x29a07e=qs[_0x39d2('0x24')](_0x4c99b9,_0xccf30c);return interaction['findAll'](_0x39d2('0x25'),_0xccf30c[_0x39d2('0x26')],_0xccf30c[_0x39d2('0x27')],_0x29a07e,_0x4c99b9)[_0x39d2('0x1b')](respondWithFilteredResult(_0x93aa7b,_0x29a07e))[_0x39d2('0x28')](handleError(_0x93aa7b,null));};exports[_0x39d2('0x29')]=function(_0xe46662,_0x2d43a7){var _0x457475={'raw':![],'where':{'id':_0xe46662['params']['id']}},_0x48bdc6={};_0x48bdc6['model']=_[_0x39d2('0x2a')](db['FaxInteraction'][_0x39d2('0x20')]);_0x48bdc6['query']=_[_0x39d2('0x2a')](_0xe46662[_0x39d2('0x26')]);_0x48bdc6[_0x39d2('0x2b')]=_['intersection'](_0x48bdc6[_0x39d2('0x2c')],_0x48bdc6['query']);_0x457475['attributes']=_[_0x39d2('0x2d')](_0x48bdc6[_0x39d2('0x2c')],qs['fields'](_0xe46662[_0x39d2('0x26')][_0x39d2('0x2e')]));_0x457475['attributes']=_0x457475[_0x39d2('0x2f')]['length']?_0x457475[_0x39d2('0x2f')]:_0x48bdc6[_0x39d2('0x2c')];if(_0xe46662[_0x39d2('0x26')][_0x39d2('0x30')]){_0x457475[_0x39d2('0x31')]=[{'all':!![]}];}_0x457475=_[_0x39d2('0x32')]({},_0x457475,_0xe46662[_0x39d2('0x33')]);return db['FaxInteraction'][_0x39d2('0x34')](_0x457475)['then'](handleEntityNotFound(_0x2d43a7,null))[_0x39d2('0x1b')](respondWithResult(_0x2d43a7,null))[_0x39d2('0x28')](handleError(_0x2d43a7,null));};exports[_0x39d2('0x35')]=function(_0x1b3f47,_0x592fdb){return db[_0x39d2('0x1f')][_0x39d2('0x35')](_0x1b3f47[_0x39d2('0x36')],{})[_0x39d2('0x1b')](respondWithResult(_0x592fdb,0xc9))[_0x39d2('0x28')](handleError(_0x592fdb,null));};exports[_0x39d2('0x37')]=function(_0x2fa205,_0x56510c){if(_0x2fa205['body']['id']){delete _0x2fa205[_0x39d2('0x36')]['id'];}return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x2fa205['params']['id']}})[_0x39d2('0x1b')](handleEntityNotFound(_0x56510c,null))['then'](saveUpdates(_0x2fa205[_0x39d2('0x36')],null))[_0x39d2('0x1b')](respondWithResult(_0x56510c,null))[_0x39d2('0x28')](handleError(_0x56510c,null));};exports['destroy']=function(_0x229394,_0x49aac4){return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x229394[_0x39d2('0x38')]['id']}})['then'](handleEntityNotFound(_0x49aac4,null))[_0x39d2('0x1b')](removeEntity(_0x49aac4,null))[_0x39d2('0x28')](handleError(_0x49aac4,null));};exports[_0x39d2('0x39')]=function(_0x59dffb,_0x1e8436){return db[_0x39d2('0x1f')][_0x39d2('0x39')]()['then'](respondWithResult(_0x1e8436,null))[_0x39d2('0x28')](handleError(_0x1e8436,null));};exports[_0x39d2('0x3a')]=function(_0x1709f5,_0x363d4c){return db[_0x39d2('0x3b')]['find']({'where':{'id':_0x1709f5[_0x39d2('0x38')]['id']}})['then'](handleEntityNotFound(_0x363d4c,null))['then'](function(_0x94a429){if(_0x94a429){return _0x94a429[_0x39d2('0x3a')](_0x1709f5[_0x39d2('0x36')][_0x39d2('0x3c')],_['omit'](_0x1709f5['body'],[_0x39d2('0x3c'),'id'])||{});}})[_0x39d2('0x1b')](respondWithResult(_0x363d4c,null))[_0x39d2('0x28')](handleError(_0x363d4c,null));};exports[_0x39d2('0x3d')]=function(_0x2b4f0d,_0x1bc246){var _0x526171={'raw':![],'where':{}};var _0x567082={};var _0x2c455c={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x39d2('0x3e')]({'where':{'id':_0x2b4f0d[_0x39d2('0x38')]['id']}})['then'](handleEntityNotFound(_0x1bc246,null))[_0x39d2('0x1b')](function(_0x168618){if(_0x168618){_0x567082[_0x39d2('0x2c')]=_[_0x39d2('0x2a')](db[_0x39d2('0x3b')]['rawAttributes']);_0x567082[_0x39d2('0x26')]=_[_0x39d2('0x2a')](_0x2b4f0d[_0x39d2('0x26')]);_0x567082[_0x39d2('0x2b')]=_['intersection'](_0x567082['model'],_0x567082[_0x39d2('0x26')]);_0x526171[_0x39d2('0x2f')]=_['intersection'](_0x567082['model'],qs[_0x39d2('0x2e')](_0x2b4f0d['query'][_0x39d2('0x2e')]));_0x526171[_0x39d2('0x2f')]=_0x526171[_0x39d2('0x2f')][_0x39d2('0x3f')]?_0x526171[_0x39d2('0x2f')]:_0x567082[_0x39d2('0x2c')];if(!_0x2b4f0d['query']['hasOwnProperty'](_0x39d2('0x40'))){_0x526171[_0x39d2('0x17')]=qs[_0x39d2('0x17')](_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x17')]);_0x526171[_0x39d2('0x14')]=qs[_0x39d2('0x14')](_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x14')]);}_0x526171['order']=qs[_0x39d2('0x41')](_0x2b4f0d[_0x39d2('0x26')]['sort']);_0x526171['where']=qs[_0x39d2('0x2b')](_['pick'](_0x2b4f0d['query'],_0x567082[_0x39d2('0x2b')]));_0x526171[_0x39d2('0x42')][_0x39d2('0x43')]=_0x168618['id'];if(_0x2b4f0d['query'][_0x39d2('0x44')]){_0x526171['where']=_[_0x39d2('0x32')](_0x526171[_0x39d2('0x42')],{'$or':_[_0x39d2('0x45')](_0x526171[_0x39d2('0x2f')],function(_0x1392c2){var _0x4fde8a={};_0x4fde8a[_0x1392c2]={'$like':'%'+_0x2b4f0d['query'][_0x39d2('0x44')]+'%'};return _0x4fde8a;})});}if(_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x46')]){var _0x4ea633=_0x2b4f0d[_0x39d2('0x26')][_0x39d2('0x46')][_0x39d2('0x47')](',');var _0x1d74bd={};_0x1d74bd[_0x4ea633[0x0]]={'$gte':moment(_0x4ea633[0x1])[_0x39d2('0x48')](_0x39d2('0x49'))};_0x526171[_0x39d2('0x42')]=_[_0x39d2('0x32')](_0x526171[_0x39d2('0x42')],_0x1d74bd);}_0x526171=_[_0x39d2('0x32')]({},_0x526171,_0x2b4f0d['options']);return db[_0x39d2('0x3b')][_0x39d2('0x16')]({'where':_0x526171[_0x39d2('0x42')]})[_0x39d2('0x1b')](function(_0x351615){_0x2c455c[_0x39d2('0x16')]=_0x351615;if(_0x2b4f0d['query'][_0x39d2('0x30')]){_0x526171[_0x39d2('0x31')]=[{'all':!![]}];}return db[_0x39d2('0x3b')][_0x39d2('0x4a')](_0x526171);})[_0x39d2('0x1b')](function(_0x43d569){_0x2c455c[_0x39d2('0x4b')]=_0x43d569;return _0x2c455c;});}})[_0x39d2('0x1b')](respondWithFilteredResult(_0x1bc246,_0x526171))[_0x39d2('0x28')](handleError(_0x1bc246,null));};exports[_0x39d2('0x4c')]=function(_0x83ddcc,_0xfed317){return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x83ddcc[_0x39d2('0x38')]['id']}})[_0x39d2('0x1b')](handleEntityNotFound(_0xfed317,null))[_0x39d2('0x1b')](function(_0x55d1b5){if(_0x55d1b5){return _0x55d1b5['setTags'](_0x83ddcc[_0x39d2('0x36')][_0x39d2('0x3c')],_[_0x39d2('0x4d')](_0x83ddcc['body'],['ids','id'])||{})['spread'](function(){return db[_0x39d2('0x4e')][_0x39d2('0x4a')]({'attributes':['id','name',_0x39d2('0x4f')],'where':{'id':_0x83ddcc[_0x39d2('0x36')][_0x39d2('0x3c')]}});})['then'](function(_0x150b2e){socket[_0x39d2('0x50')](_0x39d2('0x51'),{'id':Number(_0x83ddcc[_0x39d2('0x38')]['id']),'tags':_0x150b2e||[]});return{'id':Number(_0x83ddcc[_0x39d2('0x38')]['id']),'tags':_0x150b2e||[]};});}})[_0x39d2('0x1b')](respondWithResult(_0xfed317,null))[_0x39d2('0x28')](handleError(_0xfed317,null));};exports[_0x39d2('0x52')]=function(_0x133f3e,_0x4c979a){return db[_0x39d2('0x1f')][_0x39d2('0x34')]({'where':{'id':_0x133f3e[_0x39d2('0x38')]['id']}})[_0x39d2('0x1b')](handleEntityNotFound(_0x4c979a,null))[_0x39d2('0x1b')](function(_0x186ea3){if(_0x186ea3){return _0x186ea3[_0x39d2('0x52')](_0x133f3e[_0x39d2('0x26')][_0x39d2('0x3c')]);}})['then'](respondWithStatusCode(_0x4c979a,null))[_0x39d2('0x28')](handleError(_0x4c979a,null));};exports[_0x39d2('0x53')]=function(_0x21a637,_0x6222b8){var _0x1813ae=moment()[_0x39d2('0x54')]()[_0x39d2('0x55')]();var _0x1c8a88=path['join'](config['root'],_0x39d2('0x56'),'files',_0x39d2('0x57'));var _0x50683c=path[_0x39d2('0x58')](config[_0x39d2('0x59')],'server',_0x39d2('0x5a'),_0x39d2('0x5b'));var _0x2d215e=path[_0x39d2('0x58')](_0x1c8a88,_0x1813ae);var _0x5219ed=util['format']('transcript-%d-%s.zip',_0x21a637[_0x39d2('0x38')]['id'],_0x1813ae);var _0x3c69d9=path[_0x39d2('0x58')](_0x1c8a88,_0x5219ed);var _0x24ab14=[];_0x24ab14['push']({'model':db[_0x39d2('0x5c')],'as':_0x39d2('0x5c'),'raw':!![]});var _0x7d13f0=[{'model':db['FaxMessage'],'as':_0x39d2('0x5d'),'attributes':['id',_0x39d2('0x36'),_0x39d2('0x5e')],'include':_0x24ab14}];return db['FaxInteraction']['find']({'where':{'id':_0x21a637['params']['id']},'include':_0x7d13f0})['then'](handleEntityNotFound(_0x6222b8,null))['then'](function(_0x277ec2){if(_0x277ec2&&_0x277ec2['Messages']){var _0xcaf08f=_0x277ec2[_0x39d2('0x5f')]({'plain':!![]});fs[_0x39d2('0x60')](_0x2d215e);for(var _0x5bae66=0x0;_0x5bae66<_0xcaf08f['Messages'][_0x39d2('0x3f')];_0x5bae66++){var _0x57ff7f=_0xcaf08f[_0x39d2('0x5d')][_0x5bae66]['Attachment'];if(_0x57ff7f){var _0x19d445=path[_0x39d2('0x58')](_0x50683c,_0x57ff7f['basename']);if(fs['existsSync'](_0x19d445)){fs[_0x39d2('0x61')](_0x19d445)[_0x39d2('0x62')](fs['createWriteStream'](path[_0x39d2('0x58')](_0x2d215e,_0x57ff7f[_0x39d2('0x63')])));}}}return BPromise[_0x39d2('0x64')]()['then'](function(){return new BPromise(function(_0x157581,_0xfc5803){zipdir(_0x2d215e,{'saveTo':_0x3c69d9},function(_0x3ea948,_0xedcb17){if(_0x3ea948)return _0xfc5803(_0x3ea948);return _0x157581(_0xedcb17);});})[_0x39d2('0x1b')](function(){return new BPromise(function(_0x52589f,_0x366094){rimraf(_0x2d215e,function(_0x55e0d8){if(_0x55e0d8)_0x366094(_0x55e0d8);return _0x52589f();});});})[_0x39d2('0x1b')](function(){return _0x6222b8['download'](_0x3c69d9,_0x5219ed,function(_0x380c57){if(_0x380c57){console[_0x39d2('0x65')](_0x39d2('0x66'),_0x380c57);}else{fs[_0x39d2('0x67')](_0x3c69d9);}});});});}else{return _0x6222b8[_0x39d2('0x10')](0xc8);}})[_0x39d2('0x28')](handleError(_0x6222b8,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 5415e3d..c90b901 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 _0x9a0c=['setMaxListeners','save','update','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9a0c,0x10e));var _0xc9a0=function(_0x462175,_0x7aac7c){_0x462175=_0x462175-0x0;var _0x405126=_0x9a0c[_0x462175];return _0x405126;};'use strict';var EventEmitter=require(_0xc9a0('0x0'));var FaxInteraction=require(_0xc9a0('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xc9a0('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc9a0('0x2')](0x0);var events={'afterCreate':_0xc9a0('0x3'),'afterUpdate':_0xc9a0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43c5ce){return function(_0x54aacf,_0x2c986b,_0x3eb148){_0x54aacf[_0xc9a0('0x5')]({'attributes':['id'],'raw':!![]})[_0xc9a0('0x6')](function(_0x12fd5){_0x54aacf[_0xc9a0('0x7')]('Users',_0x12fd5['map'](function(_0x43dc1f){return{'id':_0x43dc1f['id']};}));return FaxMessage[_0xc9a0('0x8')]({'where':{'FaxInteractionId':_0x54aacf['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x378b13){_0x54aacf[_0xc9a0('0x7')](_0xc9a0('0x9'),_0x378b13[_0xc9a0('0xa')]);FaxInteractionEvents[_0xc9a0('0xb')](_0x43c5ce+':'+_0x54aacf['id'],_0x54aacf);FaxInteractionEvents['emit'](_0x43c5ce,_0x54aacf);_0x3eb148(null);})[_0xc9a0('0xc')](_0x3eb148(null));};}for(var e in events){if(events[_0xc9a0('0xd')](e)){var event=events[e];FaxInteraction[_0xc9a0('0xe')](e,emitEvent(event));}}module[_0xc9a0('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x8286=['findAll','length','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map'];(function(_0x2c6c98,_0x1f5be7){var _0x430633=function(_0x35ead4){while(--_0x35ead4){_0x2c6c98['push'](_0x2c6c98['shift']());}};_0x430633(++_0x1f5be7);}(_0x8286,0x127));var _0x6828=function(_0x5e10ba,_0x47c29d){_0x5e10ba=_0x5e10ba-0x0;var _0x4b447b=_0x8286[_0x5e10ba];return _0x4b447b;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x6828('0x0'))['db'][_0x6828('0x1')];var FaxMessage=require(_0x6828('0x0'))['db'][_0x6828('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6828('0x3')](0x0);var events={'afterCreate':_0x6828('0x4'),'afterUpdate':_0x6828('0x5'),'afterDestroy':_0x6828('0x6')};function emitEvent(_0x23fa40){return function(_0x1f8846,_0x54a075,_0x2487bd){_0x1f8846[_0x6828('0x7')]({'attributes':['id'],'raw':!![]})[_0x6828('0x8')](function(_0x4e91f2){_0x1f8846['setDataValue'](_0x6828('0x9'),_0x4e91f2[_0x6828('0xa')](function(_0x1f9604){return{'id':_0x1f9604['id']};}));return FaxMessage[_0x6828('0xb')]({'where':{'FaxInteractionId':_0x1f8846['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6828('0x8')](function(_0x445d8b){_0x1f8846['setDataValue']('unreadMessages',_0x445d8b[_0x6828('0xc')]);FaxInteractionEvents[_0x6828('0xd')](_0x23fa40+':'+_0x1f8846['id'],_0x1f8846);FaxInteractionEvents[_0x6828('0xd')](_0x23fa40,_0x1f8846);_0x2487bd(null);})['catch'](_0x2487bd(null));};}for(var e in events){if(events[_0x6828('0xe')](e)){var event=events[e];FaxInteraction[_0x6828('0xf')](e,emitEvent(event));}}module[_0x6828('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d65e8b0..d39ad21 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 _0x5c96=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','changed','closed','closedAt','format'];(function(_0x4300d4,_0x46689c){var _0x1c06ae=function(_0xcdbf7){while(--_0xcdbf7){_0x4300d4['push'](_0x4300d4['shift']());}};_0x1c06ae(++_0x46689c);}(_0x5c96,0x133));var _0x65c9=function(_0x10e7b3,_0x5a1898){_0x10e7b3=_0x10e7b3-0x0;var _0x2c9611=_0x5c96[_0x10e7b3];return _0x2c9611;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var logger=require(_0x65c9('0x2'))(_0x65c9('0x3'));var moment=require('moment');var BPromise=require(_0x65c9('0x4'));var rp=require(_0x65c9('0x5'));var fs=require('fs');var path=require(_0x65c9('0x6'));var rimraf=require(_0x65c9('0x7'));var config=require(_0x65c9('0x8'));var attributes=require(_0x65c9('0x9'));module[_0x65c9('0xa')]=function(_0x5144b3,_0x5de640){return _0x5144b3['define']('FaxInteraction',attributes,{'tableName':_0x65c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10a355,_0x1c679d,_0x4f3ed7){if(_0x10a355[_0x65c9('0xc')](_0x65c9('0xd'))){_0x10a355[_0x65c9('0xe')]=moment()[_0x65c9('0xf')](_0x65c9('0x10'));}_0x4f3ed7(null,_0x10a355);}}});}; \ No newline at end of file +var _0x03fa=['closed','closedAt','format','lodash','api','moment','bluebird','request-promise','rimraf','define','FaxInteraction','changed'];(function(_0x442030,_0x5f363e){var _0x569fed=function(_0x50f88d){while(--_0x50f88d){_0x442030['push'](_0x442030['shift']());}};_0x569fed(++_0x5f363e);}(_0x03fa,0x117));var _0xa03f=function(_0x8c0251,_0x5b79bc){_0x8c0251=_0x8c0251-0x0;var _0x83108b=_0x03fa[_0x8c0251];return _0x83108b;};'use strict';var _=require(_0xa03f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa03f('0x1'));var moment=require(_0xa03f('0x2'));var BPromise=require(_0xa03f('0x3'));var rp=require(_0xa03f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa03f('0x5'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x40108a,_0x1bb9e6){return _0x40108a[_0xa03f('0x6')](_0xa03f('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a1050,_0x104f42,_0x42f4ca){if(_0x1a1050[_0xa03f('0x8')](_0xa03f('0x9'))){_0x1a1050[_0xa03f('0xa')]=moment()[_0xa03f('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x42f4ca(null,_0x1a1050);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 89ecd4d..3ea3077 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 _0xc234=['message','result','catch','FaxInteraction','body','options','raw','where','attributes','limit','UpdateFaxInteraction','debug','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s'];(function(_0x560e51,_0xf58516){var _0x3e64c4=function(_0x430edd){while(--_0x430edd){_0x560e51['push'](_0x560e51['shift']());}};_0x3e64c4(++_0xf58516);}(_0xc234,0x1ed));var _0x4c23=function(_0x27ed67,_0x322aea){_0x27ed67=_0x27ed67-0x0;var _0x536185=_0xc234[_0x27ed67];return _0x536185;};'use strict';var _=require(_0x4c23('0x0'));var util=require(_0x4c23('0x1'));var moment=require(_0x4c23('0x2'));var BPromise=require(_0x4c23('0x3'));var rs=require(_0x4c23('0x4'));var fs=require('fs');var Redis=require(_0x4c23('0x5'));var db=require(_0x4c23('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4c23('0x7'));var config=require(_0x4c23('0x8'));var jayson=require(_0x4c23('0x9'));var client=jayson['client'][_0x4c23('0xa')]({'port':0x232a});config[_0x4c23('0xb')]=_[_0x4c23('0xc')](config[_0x4c23('0xb')],{'host':_0x4c23('0xd'),'port':0x18eb});var socket=require(_0x4c23('0xe'))(new Redis(config[_0x4c23('0xb')]));require('./faxInteraction.socket')[_0x4c23('0xf')](socket);function respondWithRpcPromise(_0xa826d7,_0x3f0f3b,_0x55237c){return new BPromise(function(_0x4b9ebd,_0x449082){return client[_0x4c23('0x10')](_0xa826d7,_0x55237c)[_0x4c23('0x11')](function(_0x1f462d){logger[_0x4c23('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x3f0f3b,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3f0f3b,_0x4c23('0x13'),JSON['stringify'](_0x1f462d));if(_0x1f462d['error']){if(_0x1f462d[_0x4c23('0x14')][_0x4c23('0x15')]===0x1f4){logger['error'](_0x4c23('0x16'),_0x3f0f3b,_0x1f462d[_0x4c23('0x14')][_0x4c23('0x17')]);return _0x449082(_0x1f462d[_0x4c23('0x14')][_0x4c23('0x17')]);}logger[_0x4c23('0x14')](_0x4c23('0x16'),_0x3f0f3b,_0x1f462d[_0x4c23('0x14')]['message']);return _0x4b9ebd(_0x1f462d[_0x4c23('0x14')][_0x4c23('0x17')]);}else{logger[_0x4c23('0x12')](_0x4c23('0x16'),_0x3f0f3b,_0x4c23('0x13'));_0x4b9ebd(_0x1f462d[_0x4c23('0x18')][_0x4c23('0x17')]);}})[_0x4c23('0x19')](function(_0x3025bd){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3f0f3b,_0x3025bd);_0x449082(_0x3025bd);});});}exports['UpdateFaxInteraction']=function(_0x433a0b){var _0x1982cd=this;return new Promise(function(_0x3b8766,_0x235964){return db[_0x4c23('0x1a')]['update'](_0x433a0b[_0x4c23('0x1b')],{'raw':_0x433a0b[_0x4c23('0x1c')]?_0x433a0b[_0x4c23('0x1c')][_0x4c23('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x433a0b['options']?_0x433a0b[_0x4c23('0x1c')][_0x4c23('0x1e')]||null:null,'attributes':_0x433a0b[_0x4c23('0x1c')]?_0x433a0b[_0x4c23('0x1c')][_0x4c23('0x1f')]||null:null,'limit':_0x433a0b[_0x4c23('0x1c')]?_0x433a0b['options'][_0x4c23('0x20')]||null:null})[_0x4c23('0x11')](function(_0x148524){logger[_0x4c23('0x12')](_0x4c23('0x21'),_0x433a0b);logger[_0x4c23('0x22')]('UpdateFaxInteraction',_0x433a0b,JSON[_0x4c23('0x23')](_0x148524));_0x3b8766(_0x148524);})['catch'](function(_0x10c2ab){logger['error'](_0x4c23('0x21'),_0x10c2ab[_0x4c23('0x17')],_0x433a0b);_0x235964(_0x1982cd[_0x4c23('0x14')](0x1f4,_0x10c2ab['message']));});});};exports[_0x4c23('0x24')]=function(_0x1f7ea7){return new Promise(function(_0x6d503,_0x4e370d){return db[_0x4c23('0x1a')][_0x4c23('0x25')]({'where':_0x1f7ea7[_0x4c23('0x1c')]?_0x1f7ea7[_0x4c23('0x1c')]['where']||null:null})[_0x4c23('0x11')](function(_0xce272b){if(_0xce272b){return _0xce272b[_0x4c23('0x26')](_0x1f7ea7['body'][_0x4c23('0x27')],_[_0x4c23('0x28')](_0x1f7ea7['body'],[_0x4c23('0x27'),'id'])||{});}})[_0x4c23('0x29')](function(_0x2538e7){logger[_0x4c23('0x12')]('AddTags',_0x1f7ea7);logger[_0x4c23('0x22')](_0x4c23('0x2a'),_0x1f7ea7,JSON[_0x4c23('0x23')](_0x2538e7));_0x6d503(_0x2538e7);})[_0x4c23('0x19')](function(_0x25754b){logger[_0x4c23('0x14')](_0x4c23('0x2a'),_0x25754b[_0x4c23('0x17')],_0x1f7ea7);_0x4e370d(_this[_0x4c23('0x14')](0x1f4,_0x25754b[_0x4c23('0x17')]));});});}; \ No newline at end of file +var _0x2856=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxInteraction','update','body','options','where','limit','debug','stringify','catch','FaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x112411,_0x5b32a2){var _0x4ccd23=function(_0x19471f){while(--_0x19471f){_0x112411['push'](_0x112411['shift']());}};_0x4ccd23(++_0x5b32a2);}(_0x2856,0x1ce));var _0x6285=function(_0x78a8f4,_0x259809){_0x78a8f4=_0x78a8f4-0x0;var _0x2b3291=_0x2856[_0x78a8f4];return _0x2b3291;};'use strict';var _=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var moment=require(_0x6285('0x2'));var BPromise=require(_0x6285('0x3'));var rs=require(_0x6285('0x4'));var fs=require('fs');var Redis=require(_0x6285('0x5'));var db=require(_0x6285('0x6'))['db'];var utils=require(_0x6285('0x7'));var logger=require(_0x6285('0x8'))(_0x6285('0x9'));var config=require(_0x6285('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6285('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6285('0xc'),'port':0x18eb});var socket=require(_0x6285('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x6285('0xe')](socket);function respondWithRpcPromise(_0x589e1b,_0x3d49d7,_0x4e35e2){return new BPromise(function(_0x521358,_0x2dddad){return client[_0x6285('0xf')](_0x589e1b,_0x4e35e2)[_0x6285('0x10')](function(_0x158116){logger[_0x6285('0x11')](_0x6285('0x12'),_0x3d49d7,_0x6285('0x13'));logger['debug'](_0x6285('0x14'),_0x3d49d7,_0x6285('0x13'),JSON['stringify'](_0x158116));if(_0x158116['error']){if(_0x158116[_0x6285('0x15')][_0x6285('0x16')]===0x1f4){logger['error'](_0x6285('0x12'),_0x3d49d7,_0x158116[_0x6285('0x15')][_0x6285('0x17')]);return _0x2dddad(_0x158116['error'][_0x6285('0x17')]);}logger[_0x6285('0x15')](_0x6285('0x12'),_0x3d49d7,_0x158116['error'][_0x6285('0x17')]);return _0x521358(_0x158116[_0x6285('0x15')]['message']);}else{logger[_0x6285('0x11')](_0x6285('0x12'),_0x3d49d7,'request\x20sent');_0x521358(_0x158116['result'][_0x6285('0x17')]);}})['catch'](function(_0x3ee0ee){logger[_0x6285('0x15')](_0x6285('0x12'),_0x3d49d7,_0x3ee0ee);_0x2dddad(_0x3ee0ee);});});}exports[_0x6285('0x18')]=function(_0x197252){var _0xcbcddd=this;return new Promise(function(_0x4d60df,_0x5ef08c){return db['FaxInteraction'][_0x6285('0x19')](_0x197252[_0x6285('0x1a')],{'raw':_0x197252['options']?_0x197252[_0x6285('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197252['options']?_0x197252[_0x6285('0x1b')][_0x6285('0x1c')]||null:null,'attributes':_0x197252['options']?_0x197252[_0x6285('0x1b')]['attributes']||null:null,'limit':_0x197252[_0x6285('0x1b')]?_0x197252[_0x6285('0x1b')][_0x6285('0x1d')]||null:null})[_0x6285('0x10')](function(_0x2eae68){logger[_0x6285('0x11')](_0x6285('0x18'),_0x197252);logger[_0x6285('0x1e')](_0x6285('0x18'),_0x197252,JSON[_0x6285('0x1f')](_0x2eae68));_0x4d60df(_0x2eae68);})[_0x6285('0x20')](function(_0x469118){logger[_0x6285('0x15')](_0x6285('0x18'),_0x469118[_0x6285('0x17')],_0x197252);_0x5ef08c(_0xcbcddd[_0x6285('0x15')](0x1f4,_0x469118[_0x6285('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x470e2b){return new Promise(function(_0x31d6f5,_0x539393){return db[_0x6285('0x21')][_0x6285('0x22')]({'where':_0x470e2b[_0x6285('0x1b')]?_0x470e2b[_0x6285('0x1b')][_0x6285('0x1c')]||null:null})[_0x6285('0x10')](function(_0x5bbf9c){if(_0x5bbf9c){return _0x5bbf9c[_0x6285('0x23')](_0x470e2b[_0x6285('0x1a')][_0x6285('0x24')],_[_0x6285('0x25')](_0x470e2b[_0x6285('0x1a')],[_0x6285('0x24'),'id'])||{});}})['spread'](function(_0x397435){logger[_0x6285('0x11')](_0x6285('0x26'),_0x470e2b);logger[_0x6285('0x1e')]('AddTags',_0x470e2b,JSON[_0x6285('0x1f')](_0x397435));_0x31d6f5(_0x397435);})[_0x6285('0x20')](function(_0x3cc37e){logger[_0x6285('0x15')]('AddTags',_0x3cc37e[_0x6285('0x17')],_0x470e2b);_0x539393(_this[_0x6285('0x15')](0x1f4,_0x3cc37e[_0x6285('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index afc9ee6..a071992 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 _0xf44d=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xf44d,0x103));var _0xdf44=function(_0x15f13e,_0x51c1a3){_0x15f13e=_0x15f13e-0x0;var _0xff6a71=_0xf44d[_0x15f13e];return _0xff6a71;};'use strict';var FaxInteractionEvents=require(_0xdf44('0x0'));var events=[_0xdf44('0x1'),_0xdf44('0x2'),_0xdf44('0x3')];function createListener(_0x12d7b8,_0x25baf4){return function(_0xcddc){_0x25baf4[_0xdf44('0x4')](_0x12d7b8,_0xcddc);};}function removeListener(_0xb2e7ac,_0xf7233f){return function(){FaxInteractionEvents[_0xdf44('0x5')](_0xb2e7ac,_0xf7233f);};}exports[_0xdf44('0x6')]=function(_0x504625){for(var _0xfc87c5=0x0,_0x4014ba=events['length'];_0xfc87c5<_0x4014ba;_0xfc87c5++){var _0x489350=events[_0xfc87c5];var _0x4e2efb=createListener(_0xdf44('0x7')+_0x489350,_0x504625);FaxInteractionEvents['on'](_0x489350,_0x4e2efb);}}; \ No newline at end of file +var _0xce6e=['register','save','remove','update','emit'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0xce6e,0x114));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xece6('0x0'),_0xece6('0x1'),_0xece6('0x2')];function createListener(_0x26b042,_0x84057e){return function(_0x86d314){_0x84057e[_0xece6('0x3')](_0x26b042,_0x86d314);};}function removeListener(_0x3620ff,_0x28ad5d){return function(){FaxInteractionEvents['removeListener'](_0x3620ff,_0x28ad5d);};}exports[_0xece6('0x4')]=function(_0x499d39){for(var _0x276984=0x0,_0xc95104=events['length'];_0x276984<_0xc95104;_0x276984++){var _0x524794=events[_0x276984];var _0x393567=createListener('faxInteraction:'+_0x524794,_0x499d39);FaxInteractionEvents['on'](_0x524794,_0x393567);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index dd2a694..23c2af5 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 _0x1f49=['removeTags','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete'];(function(_0x5d2828,_0x109d0b){var _0x113a65=function(_0x5199a5){while(--_0x5199a5){_0x5d2828['push'](_0x5d2828['shift']());}};_0x113a65(++_0x109d0b);}(_0x1f49,0x1f1));var _0x91f4=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x1f49[_0x4017b0];return _0x5ed4f7;};'use strict';var multer=require(_0x91f4('0x0'));var util=require(_0x91f4('0x1'));var path=require(_0x91f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x91f4('0x3'));var router=express[_0x91f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91f4('0x5'));var interaction=require(_0x91f4('0x6'));var config=require('../../config/environment');var controller=require(_0x91f4('0x7'));router[_0x91f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x91f4('0x9')]);router[_0x91f4('0x8')](_0x91f4('0xa'),auth[_0x91f4('0xb')](),controller[_0x91f4('0xc')]);router[_0x91f4('0x8')](_0x91f4('0xd'),auth[_0x91f4('0xb')](),controller['show']);router[_0x91f4('0x8')]('/:id/messages',auth[_0x91f4('0xb')](),controller[_0x91f4('0xe')]);router[_0x91f4('0x8')](_0x91f4('0xf'),auth[_0x91f4('0xb')](),controller[_0x91f4('0x10')]);router[_0x91f4('0x11')]('/',auth[_0x91f4('0xb')](),controller[_0x91f4('0x12')]);router[_0x91f4('0x11')](_0x91f4('0x13'),auth[_0x91f4('0xb')](),controller[_0x91f4('0x14')]);router[_0x91f4('0x11')](_0x91f4('0x15'),auth[_0x91f4('0xb')](),interaction[_0x91f4('0x16')](_0x91f4('0x17'),_0x91f4('0x18')),controller[_0x91f4('0x19')]);router[_0x91f4('0x1a')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x91f4('0x17'),_0x91f4('0x1b')),controller[_0x91f4('0x1c')]);router[_0x91f4('0x1d')](_0x91f4('0xd'),auth[_0x91f4('0xb')](),interaction[_0x91f4('0x16')](_0x91f4('0x17'),'faxinteraction:destroy'),controller['destroy']);router[_0x91f4('0x1d')](_0x91f4('0x15'),auth[_0x91f4('0xb')](),controller[_0x91f4('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xc8e0=['destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','addMessage','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','delete','faxinteraction:destroy'];(function(_0x24a2da,_0x1e81f9){var _0x2eb574=function(_0x164eb1){while(--_0x164eb1){_0x24a2da['push'](_0x24a2da['shift']());}};_0x2eb574(++_0x1e81f9);}(_0xc8e0,0xb7));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x0c8e('0x0'));var util=require(_0x0c8e('0x1'));var path=require(_0x0c8e('0x2'));var timeout=require(_0x0c8e('0x3'));var express=require(_0x0c8e('0x4'));var router=express[_0x0c8e('0x5')]();var fs_extra=require(_0x0c8e('0x6'));var auth=require(_0x0c8e('0x7'));var interaction=require(_0x0c8e('0x8'));var config=require(_0x0c8e('0x9'));var controller=require('./faxInteraction.controller');router[_0x0c8e('0xa')]('/',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0xc')]);router[_0x0c8e('0xa')](_0x0c8e('0xd'),auth['isAuthenticated'](),controller[_0x0c8e('0xe')]);router[_0x0c8e('0xa')](_0x0c8e('0xf'),auth['isAuthenticated'](),controller[_0x0c8e('0x10')]);router[_0x0c8e('0xa')]('/:id/messages',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x0c8e('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c8e('0x12')]('/:id/messages',auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x13')]);router[_0x0c8e('0x12')]('/:id/tags',auth[_0x0c8e('0xb')](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x16')),controller['addTags']);router[_0x0c8e('0x17')]('/:id',auth[_0x0c8e('0xb')](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x18')),controller['update']);router[_0x0c8e('0x19')](_0x0c8e('0xf'),auth['isAuthenticated'](),interaction[_0x0c8e('0x14')](_0x0c8e('0x15'),_0x0c8e('0x1a')),controller[_0x0c8e('0x1b')]);router[_0x0c8e('0x19')](_0x0c8e('0x1c'),auth[_0x0c8e('0xb')](),controller[_0x0c8e('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index f67c7ba..7ee6296 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 _0x8cfd=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x524a33,_0x3c8438){var _0x3edcc0=function(_0x4dea82){while(--_0x4dea82){_0x524a33['push'](_0x524a33['shift']());}};_0x3edcc0(++_0x3c8438);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x521e8d,_0x23a290){_0x521e8d=_0x521e8d-0x0;var _0x518bbd=_0x8cfd[_0x521e8d];return _0x518bbd;};'use strict';var Sequelize=require(_0xd8cf('0x0'));module[_0xd8cf('0x1')]={'body':{'type':Sequelize[_0xd8cf('0x2')](_0xd8cf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd8cf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd8cf('0x5')]('in','out'),'defaultValue':_0xd8cf('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd8cf('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd8cf('0x7')]}}; \ No newline at end of file +var _0xc112=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0xbc3484,_0x236cad){var _0x1c0096=function(_0x5710cb){while(--_0x5710cb){_0xbc3484['push'](_0xbc3484['shift']());}};_0x1c0096(++_0x236cad);}(_0xc112,0xec));var _0x2c11=function(_0x1ff9bb,_0x29f13e){_0x1ff9bb=_0x1ff9bb-0x0;var _0x1ed027=_0xc112[_0x1ff9bb];return _0x1ed027;};'use strict';var Sequelize=require(_0x2c11('0x0'));module[_0x2c11('0x1')]={'body':{'type':Sequelize[_0x2c11('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2c11('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c11('0x4')]('in',_0x2c11('0x5')),'defaultValue':_0x2c11('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2c11('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2c11('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 96c5cb6..ffe1668 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 _0x76e1=['code','message','info','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','update','body','describe','../../config/logger','fax-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','SIP/%s','channel','event','EventManager','acceptmessage','reject','fax','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','User','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x76e1,0xf8));var _0x176e=function(_0x251342,_0x14ac35){_0x251342=_0x251342-0x0;var _0xeee61=_0x76e1[_0x251342];return _0xeee61;};'use strict';var emlformat=require(_0x176e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x176e('0x1'));var rp=require('request-promise');var moment=require(_0x176e('0x2'));var BPromise=require(_0x176e('0x3'));var Mustache=require('mustache');var util=require(_0x176e('0x4'));var path=require(_0x176e('0x5'));var sox=require(_0x176e('0x6'));var csv=require(_0x176e('0x7'));var ejs=require(_0x176e('0x8'));var fs=require('fs');var fs_extra=require(_0x176e('0x9'));var _=require(_0x176e('0xa'));var squel=require(_0x176e('0xb'));var crypto=require(_0x176e('0xc'));var jsforce=require(_0x176e('0xd'));var deskjs=require(_0x176e('0xe'));var toCsv=require(_0x176e('0x7'));var querystring=require(_0x176e('0xf'));var Papa=require(_0x176e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x176e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x176e('0x12'));var utils=require(_0x176e('0x13'));var config=require(_0x176e('0x14'));var licenseUtil=require(_0x176e('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x176e('0x16')](config[_0x176e('0x17')],{'host':_0x176e('0x18'),'port':0x18eb});var socket=require(_0x176e('0x19'))(new Redis(config[_0x176e('0x17')]));require('./faxMessage.socket')[_0x176e('0x1a')](socket);var jayson=require(_0x176e('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x176e('0x1c')][_0x176e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2365fe,_0x1c8396,_0x2872de,_0x4b249a){return new BPromise(function(_0x347768,_0x2acd75){var _0xc18a0c=_0x4b249a||client;return _0xc18a0c[_0x176e('0x1e')](_0x2365fe,_0x2872de)[_0x176e('0x1f')](function(_0x26e914){logger['info'](_0x176e('0x20'),_0x1c8396,'request\x20sent');logger['debug'](_0x176e('0x21'),_0x1c8396,_0x176e('0x22'),JSON['stringify'](_0x26e914));if(_0x26e914[_0x176e('0x23')]){if(_0x26e914[_0x176e('0x23')][_0x176e('0x24')]===0x1f4){logger[_0x176e('0x23')](_0x176e('0x20'),_0x1c8396,_0x26e914[_0x176e('0x23')][_0x176e('0x25')]);return _0x2acd75(_0x26e914['error'][_0x176e('0x25')]);}logger[_0x176e('0x23')](_0x176e('0x20'),_0x1c8396,_0x26e914['error'][_0x176e('0x25')]);return _0x347768(_0x26e914[_0x176e('0x23')]['message']);}else{logger[_0x176e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x1c8396,_0x176e('0x22'));_0x347768(_0x26e914['result'][_0x176e('0x25')]);}})[_0x176e('0x27')](function(_0x45fa6f){logger[_0x176e('0x23')]('FaxMessage,\x20%s,\x20%s',_0x1c8396,_0x45fa6f);_0x2acd75(_0x45fa6f);});});}function respondWithStatusCode(_0x10689c,_0x2acbc4){_0x2acbc4=_0x2acbc4||0xcc;return function(_0x5eac24){if(_0x5eac24){return _0x10689c[_0x176e('0x28')](_0x2acbc4);}return _0x10689c['status'](_0x2acbc4)[_0x176e('0x29')]();};}function respondWithResult(_0x1aa462,_0x33f9b7){_0x33f9b7=_0x33f9b7||0xc8;return function(_0x52a1ed){if(_0x52a1ed){return _0x1aa462[_0x176e('0x2a')](_0x33f9b7)[_0x176e('0x2b')](_0x52a1ed);}};}function respondWithFilteredResult(_0x28555f,_0x95f0a9){return function(_0x3ea358){if(_0x3ea358){var _0x400c03=typeof _0x95f0a9[_0x176e('0x2c')]===_0x176e('0x2d')&&typeof _0x95f0a9[_0x176e('0x2e')]===_0x176e('0x2d');var _0x12eb07=_0x3ea358[_0x176e('0x2f')];var _0x1668ae=_0x400c03?0x0:_0x95f0a9[_0x176e('0x2c')];var _0x17a8f0=_0x400c03?_0x3ea358[_0x176e('0x2f')]:_0x95f0a9[_0x176e('0x2c')]+_0x95f0a9[_0x176e('0x2e')];var _0x1cae96;if(_0x17a8f0>=_0x12eb07){_0x17a8f0=_0x12eb07;_0x1cae96=0xc8;}else{_0x1cae96=0xce;}_0x28555f[_0x176e('0x2a')](_0x1cae96);return _0x28555f[_0x176e('0x30')](_0x176e('0x31'),_0x1668ae+'-'+_0x17a8f0+'/'+_0x12eb07)[_0x176e('0x2b')](_0x3ea358);}return null;};}function patchUpdates(_0x911ff0){return function(_0x1d6e49){try{jsonpatch['apply'](_0x1d6e49,_0x911ff0,!![]);}catch(_0x305f75){return BPromise['reject'](_0x305f75);}return _0x1d6e49[_0x176e('0x32')]();};}function saveUpdates(_0xba271d,_0x409bd0){return function(_0x15366f){if(_0x15366f){return _0x15366f['update'](_0xba271d)[_0x176e('0x1f')](function(_0xbbca21){return _0xbbca21;});}return null;};}function removeEntity(_0x2d84af,_0x4f3157){return function(_0x261ab3){if(_0x261ab3){return _0x261ab3[_0x176e('0x33')]()[_0x176e('0x1f')](function(){_0x2d84af[_0x176e('0x2a')](0xcc)[_0x176e('0x29')]();});}};}function handleEntityNotFound(_0x17158f,_0x185fba){return function(_0x455752){if(!_0x455752){_0x17158f[_0x176e('0x28')](0x194);}return _0x455752;};}function handleError(_0x2678bd,_0x43a65a){_0x43a65a=_0x43a65a||0x1f4;return function(_0x3fe7f2){logger[_0x176e('0x23')](_0x3fe7f2[_0x176e('0x34')]);if(_0x3fe7f2[_0x176e('0x35')]){delete _0x3fe7f2[_0x176e('0x35')];}_0x2678bd['status'](_0x43a65a)[_0x176e('0x36')](_0x3fe7f2);};}exports[_0x176e('0x37')]=function(_0x2732b3,_0x43b68b){var _0x593fb5={},_0x53f077={},_0x31394c={'count':0x0,'rows':[]};var _0xd269ac=_[_0x176e('0x38')](db[_0x176e('0x39')][_0x176e('0x3a')],function(_0x3c4c91){return{'name':_0x3c4c91[_0x176e('0x3b')],'type':_0x3c4c91[_0x176e('0x3c')][_0x176e('0x3d')]};});_0x53f077[_0x176e('0x3e')]=_[_0x176e('0x38')](_0xd269ac,_0x176e('0x35'));_0x53f077[_0x176e('0x3f')]=_[_0x176e('0x40')](_0x2732b3['query']);_0x53f077['filters']=_[_0x176e('0x41')](_0x53f077[_0x176e('0x3e')],_0x53f077[_0x176e('0x3f')]);_0x593fb5[_0x176e('0x42')]=_[_0x176e('0x41')](_0x53f077[_0x176e('0x3e')],qs[_0x176e('0x43')](_0x2732b3[_0x176e('0x3f')][_0x176e('0x43')]));_0x593fb5[_0x176e('0x42')]=_0x593fb5[_0x176e('0x42')][_0x176e('0x44')]?_0x593fb5[_0x176e('0x42')]:_0x53f077[_0x176e('0x3e')];if(!_0x2732b3[_0x176e('0x3f')]['hasOwnProperty']('nolimit')){_0x593fb5[_0x176e('0x2e')]=qs[_0x176e('0x2e')](_0x2732b3[_0x176e('0x3f')][_0x176e('0x2e')]);_0x593fb5[_0x176e('0x2c')]=qs[_0x176e('0x2c')](_0x2732b3[_0x176e('0x3f')][_0x176e('0x2c')]);}_0x593fb5[_0x176e('0x45')]=qs[_0x176e('0x46')](_0x2732b3['query'][_0x176e('0x46')]);_0x593fb5[_0x176e('0x47')]=qs[_0x176e('0x48')](_[_0x176e('0x49')](_0x2732b3[_0x176e('0x3f')],_0x53f077[_0x176e('0x48')]),_0xd269ac);if(_0x2732b3[_0x176e('0x3f')][_0x176e('0x4a')]){_0x593fb5[_0x176e('0x47')]=_[_0x176e('0x4b')](_0x593fb5['where'],{'$or':_[_0x176e('0x38')](_0xd269ac,function(_0x43a9ee){if(_0x43a9ee[_0x176e('0x3c')]!==_0x176e('0x4c')){var _0xf8e64b={};_0xf8e64b[_0x43a9ee[_0x176e('0x35')]]={'$like':'%'+_0x2732b3[_0x176e('0x3f')][_0x176e('0x4a')]+'%'};return _0xf8e64b;}})});}_0x593fb5=_['merge']({},_0x593fb5,_0x2732b3['options']);var _0x1a8cda={'where':_0x593fb5[_0x176e('0x47')]};return db[_0x176e('0x39')][_0x176e('0x2f')](_0x1a8cda)[_0x176e('0x1f')](function(_0xd0e649){_0x31394c[_0x176e('0x2f')]=_0xd0e649;if(_0x2732b3[_0x176e('0x3f')][_0x176e('0x4d')]){_0x593fb5[_0x176e('0x4e')]=[{'all':!![]}];}return db[_0x176e('0x39')]['findAll'](_0x593fb5);})['then'](function(_0x262efc){_0x31394c[_0x176e('0x4f')]=_0x262efc;return _0x31394c;})[_0x176e('0x1f')](respondWithFilteredResult(_0x43b68b,_0x593fb5))['catch'](handleError(_0x43b68b,null));};exports[_0x176e('0x50')]=function(_0x32d769,_0x425add){var _0x315763={'raw':!![],'where':{'id':_0x32d769[_0x176e('0x51')]['id']}},_0x321357={};_0x321357[_0x176e('0x3e')]=_[_0x176e('0x40')](db['FaxMessage']['rawAttributes']);_0x321357[_0x176e('0x3f')]=_['keys'](_0x32d769[_0x176e('0x3f')]);_0x321357[_0x176e('0x48')]=_[_0x176e('0x41')](_0x321357[_0x176e('0x3e')],_0x321357[_0x176e('0x3f')]);_0x315763['attributes']=_[_0x176e('0x41')](_0x321357[_0x176e('0x3e')],qs[_0x176e('0x43')](_0x32d769['query']['fields']));_0x315763[_0x176e('0x42')]=_0x315763[_0x176e('0x42')]['length']?_0x315763[_0x176e('0x42')]:_0x321357[_0x176e('0x3e')];if(_0x32d769[_0x176e('0x3f')][_0x176e('0x4d')]){_0x315763[_0x176e('0x4e')]=[{'all':!![]}];}_0x315763=_[_0x176e('0x4b')]({},_0x315763,_0x32d769[_0x176e('0x52')]);return db[_0x176e('0x39')][_0x176e('0x53')](_0x315763)[_0x176e('0x1f')](handleEntityNotFound(_0x425add,null))[_0x176e('0x1f')](respondWithResult(_0x425add,null))['catch'](handleError(_0x425add,null));};exports[_0x176e('0x54')]=function(_0x1788e7,_0x352088){if(_0x1788e7[_0x176e('0x55')]['id']){delete _0x1788e7[_0x176e('0x55')]['id'];}return db[_0x176e('0x39')][_0x176e('0x53')]({'where':{'id':_0x1788e7[_0x176e('0x51')]['id']}})[_0x176e('0x1f')](handleEntityNotFound(_0x352088,null))[_0x176e('0x1f')](saveUpdates(_0x1788e7[_0x176e('0x55')],null))[_0x176e('0x1f')](respondWithResult(_0x352088,null))[_0x176e('0x27')](handleError(_0x352088,null));};exports[_0x176e('0x33')]=function(_0xc26183,_0x1022a2){return db[_0x176e('0x39')][_0x176e('0x53')]({'where':{'id':_0xc26183[_0x176e('0x51')]['id']}})[_0x176e('0x1f')](handleEntityNotFound(_0x1022a2,null))[_0x176e('0x1f')](removeEntity(_0x1022a2,null))[_0x176e('0x27')](handleError(_0x1022a2,null));};exports[_0x176e('0x56')]=function(_0x4110c1,_0x586af5){return db[_0x176e('0x39')][_0x176e('0x56')]()[_0x176e('0x1f')](respondWithResult(_0x586af5,null))['catch'](handleError(_0x586af5,null));};var interaction_log=require(_0x176e('0x57'))(_0x176e('0x58'));exports['accept']=function(_0x16f3f4,_0x3701cc,_0x39e360){var _0x43b5ad={'agent':{},'channel':'fax'};if(_0x16f3f4['body']['id']){delete _0x16f3f4['body']['id'];}_0x16f3f4[_0x176e('0x55')][_0x176e('0x59')]=!![];_0x16f3f4['body'][_0x176e('0x5a')]=moment()[_0x176e('0x5b')](_0x176e('0x5c'));_0x16f3f4[_0x176e('0x55')]['UserId']=_0x16f3f4[_0x176e('0x55')][_0x176e('0x5d')]||_0x16f3f4[_0x176e('0x5e')]['id'];_0x43b5ad[_0x176e('0x5f')]['id']=_0x16f3f4[_0x176e('0x55')][_0x176e('0x5d')];return db['FaxMessage'][_0x176e('0x53')]({'where':{'id':_0x16f3f4[_0x176e('0x51')]['id'],'UserId':null}})[_0x176e('0x1f')](handleEntityNotFound(_0x3701cc,null))[_0x176e('0x1f')](saveUpdates(_0x16f3f4[_0x176e('0x55')],null))['then'](function(_0x1befa9){if(_0x1befa9){_0x43b5ad[_0x176e('0x25')]=_0x1befa9[_0x176e('0x60')]({'plain':!![]});return db[_0x176e('0x61')][_0x176e('0x53')]({'where':{'id':_0x1befa9['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3701cc,null))[_0x176e('0x1f')](function(_0x3c4237){if(_0x3c4237){return _0x3c4237[_0x176e('0x54')]({'UserId':_0x16f3f4[_0x176e('0x55')][_0x176e('0x5d')],'read1stAt':_[_0x176e('0x62')](_0x3c4237[_0x176e('0x63')])?moment()['format'](_0x176e('0x5c')):undefined});}return null;})[_0x176e('0x1f')](function(_0x1816a4){if(_0x1816a4){_0x43b5ad['interaction']=_0x1816a4['get']({'plain':!![]});interaction_log[_0x176e('0x26')](_0x176e('0x64'),_0x16f3f4[_0x176e('0x5e')]['id'],_0x16f3f4['user'][_0x176e('0x35')],_0x16f3f4['user'][_0x176e('0x65')],_0x43b5ad[_0x176e('0x66')]['id'],_0x16f3f4[_0x176e('0x55')]?JSON['stringify'](_0x16f3f4[_0x176e('0x55')]):_0x176e('0x67'));return respondWithRpcPromise('AcceptMessage',_0x176e('0x68'),_0x43b5ad);}return null;})['then'](function(_0xd0724e){var _0x405c9e=_0x176e('0x69')+_0xd0724e[_0x176e('0x25')][_0x176e('0x6a')];return db[_0x176e('0x6b')][_0x176e('0x3f')](_0x405c9e,{'type':db[_0x176e('0x6c')][_0x176e('0x6d')][_0x176e('0x6e')],'raw':!![]})['then'](function(_0x1e086a){return _0x1e086a;});})[_0x176e('0x1f')](function(_0x530a01){if(_0x530a01){_0x43b5ad['message'][_0x176e('0x6f')]=_0x530a01[0x0];if(!_0x16f3f4[_0x176e('0x55')]['UserId'])return;return db['User']['find']({'where':{'id':_0x16f3f4[_0x176e('0x55')][_0x176e('0x5d')],'role':'agent'},'attributes':['id',_0x176e('0x35'),_0x176e('0x70'),_0x176e('0x71'),_0x176e('0x72')],'raw':!![]});}return null;})[_0x176e('0x1f')](function(_0x5e1f4b){if(!_0x5e1f4b)return null;_0x43b5ad[_0x176e('0x25')][_0x176e('0x5f')]=_0x5e1f4b;return _0x43b5ad;})['then'](function(_0x3a57a9){if(_0x3a57a9){if(_0x16f3f4[_0x176e('0x55')]['manual']){_0x43b5ad[_0x176e('0x25')]['interface']=util['format'](_0x176e('0x73'),_0x16f3f4['user'][_0x176e('0x35')]);_0x43b5ad[_0x176e('0x25')][_0x176e('0x74')]=_0x43b5ad[_0x176e('0x74')];_0x43b5ad['message']['motionChannel']=_0x43b5ad['channel'];_0x43b5ad['message'][_0x176e('0x75')]='accept';return respondWithRpcPromise(_0x176e('0x76'),_0x176e('0x76'),{'event':_0x176e('0x77'),'message':_0x43b5ad[_0x176e('0x25')]},client9002)['then'](function(){return _0x43b5ad;});}return _0x43b5ad;}return null;})[_0x176e('0x1f')](respondWithResult(_0x3701cc,null))[_0x176e('0x27')](handleError(_0x3701cc,null));};var interaction_log=require(_0x176e('0x57'))(_0x176e('0x58'));exports[_0x176e('0x78')]=function(_0x5f4d88,_0x370886,_0x237b3f){var _0x3ba0e9={'agent':{},'channel':_0x176e('0x79')};if(_0x5f4d88[_0x176e('0x55')]['id']){delete _0x5f4d88[_0x176e('0x55')]['id'];}_0x5f4d88['body'][_0x176e('0x5d')]=_0x5f4d88[_0x176e('0x55')][_0x176e('0x5d')]||_0x5f4d88[_0x176e('0x5e')]['id'];_0x3ba0e9['agent']['id']=_0x5f4d88[_0x176e('0x55')]['UserId'];return db[_0x176e('0x39')]['find']({'where':{'id':_0x5f4d88['params']['id'],'UserId':null}})[_0x176e('0x1f')](handleEntityNotFound(_0x370886,null))['then'](function(_0x3277de){if(_0x3277de){_0x3ba0e9[_0x176e('0x25')]=_0x3277de[_0x176e('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x176e('0x53')]({'where':{'id':_0x3277de[_0x176e('0x7a')]}});}return null;})[_0x176e('0x1f')](handleEntityNotFound(_0x370886,null))['then'](function(_0xf5c801){if(_0xf5c801){_0x3ba0e9[_0x176e('0x66')]=_0xf5c801['get']({'plain':!![]});interaction_log['info'](_0x176e('0x7b'),_0x5f4d88['user']['id'],_0x5f4d88[_0x176e('0x5e')]['name'],_0x5f4d88['user']['role'],_0x3ba0e9[_0x176e('0x66')]['id'],_0x5f4d88[_0x176e('0x55')]?JSON[_0x176e('0x7c')](_0x5f4d88[_0x176e('0x55')]):_0x176e('0x67'));return respondWithRpcPromise(_0x176e('0x7d'),_0x176e('0x7e'),_0x3ba0e9);}return null;})[_0x176e('0x1f')](function(_0x4756df){var _0x181e0b=_0x176e('0x69')+_0x4756df[_0x176e('0x25')]['ContactId'];return db[_0x176e('0x6b')]['query'](_0x181e0b,{'type':db[_0x176e('0x6c')][_0x176e('0x6d')][_0x176e('0x6e')],'raw':!![]})[_0x176e('0x1f')](function(_0x26b5a9){return _0x26b5a9;});})['then'](function(_0x14cc41){if(_0x14cc41){_0x3ba0e9[_0x176e('0x25')][_0x176e('0x6f')]=_0x14cc41[0x0];if(!_0x5f4d88[_0x176e('0x55')][_0x176e('0x5d')])return;return db[_0x176e('0x7f')]['find']({'where':{'id':_0x5f4d88[_0x176e('0x55')][_0x176e('0x5d')],'role':_0x176e('0x5f')},'attributes':['id',_0x176e('0x35'),_0x176e('0x70'),_0x176e('0x71'),_0x176e('0x72')],'raw':!![]});}return null;})[_0x176e('0x1f')](function(_0x33e81f){if(!_0x33e81f)return null;_0x3ba0e9[_0x176e('0x25')][_0x176e('0x5f')]=_0x33e81f;return _0x3ba0e9;})[_0x176e('0x1f')](function(_0x518047){if(_0x518047){_0x518047[_0x176e('0x25')]['interface']=util[_0x176e('0x5b')](_0x176e('0x73'),_0x5f4d88[_0x176e('0x5e')][_0x176e('0x35')]);_0x518047[_0x176e('0x25')][_0x176e('0x74')]=_0x3ba0e9['channel'];_0x518047[_0x176e('0x25')][_0x176e('0x80')]=_0x3ba0e9[_0x176e('0x74')];_0x518047[_0x176e('0x25')][_0x176e('0x75')]=_0x176e('0x78');respondWithRpcPromise(_0x176e('0x76'),_0x176e('0x76'),{'event':_0x176e('0x81'),'message':_0x518047[_0x176e('0x25')]},client9002);return _0x3ba0e9;}return null;})[_0x176e('0x1f')](respondWithResult(_0x370886,null))[_0x176e('0x27')](handleError(_0x370886,null));};exports[_0x176e('0x82')]=function(_0x22692b,_0x531200){var _0x4679b1;return db[_0x176e('0x39')][_0x176e('0x82')](_0x22692b[_0x176e('0x55')],{})[_0x176e('0x1f')](function(_0x20a8aa){_0x4679b1=_0x20a8aa;return db[_0x176e('0x83')][_0x176e('0x84')]({'where':{'id':_0x4679b1[_0x176e('0x6a')]}});})[_0x176e('0x1f')](function(_0x285990){if(_[_0x176e('0x62')](_0x285990)){return;}else{_0x4679b1[_0x176e('0x79')]=_0x285990[_0x176e('0x79')];return db[_0x176e('0x85')][_0x176e('0x84')]({'where':{'id':_0x4679b1[_0x176e('0x86')]}});}})[_0x176e('0x1f')](function(_0xa7eca5){return respondWithRpcPromise(_0x176e('0x87'),_0x176e('0x87'),{'FaxAccountId':_[_0x176e('0x62')](_0x22692b[_0x176e('0x55')])?undefined:_0x22692b[_0x176e('0x55')][_0x176e('0x88')],'path':_['isNil'](_0xa7eca5)?undefined:util[_0x176e('0x5b')]('/var/opt/motion2/server/files/attachments/%s',_0xa7eca5[_0x176e('0x89')]),'fax':_[_0x176e('0x62')](_0x4679b1[_0x176e('0x79')])?undefined:_0x4679b1[_0x176e('0x79')],'AttachmentId':_0x4679b1[_0x176e('0x86')]},client9002);})[_0x176e('0x1f')](respondWithResult(_0x531200,0xc9))[_0x176e('0x27')](handleError(_0x531200,null));};exports[_0x176e('0x8a')]=function(_0x2ec536,_0x40bf2f){var _0x3ef88e=path[_0x176e('0x8b')](config[_0x176e('0x8c')],_0x176e('0x8d'),'files','attachments');return db[_0x176e('0x39')][_0x176e('0x53')]({'where':{'id':_0x2ec536['params']['id']},'include':[{'model':db[_0x176e('0x85')],'as':_0x176e('0x85')}]})[_0x176e('0x1f')](handleEntityNotFound(_0x40bf2f,null))['then'](function(_0x5a5d04){if(_0x5a5d04){return _0x40bf2f['download'](path[_0x176e('0x8b')](_0x3ef88e,_0x5a5d04['Attachment'][_0x176e('0x89')]));}})[_0x176e('0x27')](handleError(_0x40bf2f,null));}; \ No newline at end of file +var _0x10c4=['RejectMessage','rejectMessage','Sequelize','QueryTypes','agent','channel','rejectmessage','create','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','AttachmentId','join','root','files','attachments','download','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','FaxMessage','includeAll','findAll','rows','show','params','rawAttributes','length','include','body','find','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','../../config/logger','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x995166,_0x2501b9){var _0x4910be=function(_0x1abb92){while(--_0x1abb92){_0x995166['push'](_0x995166['shift']());}};_0x4910be(++_0x2501b9);}(_0x10c4,0xa1));var _0x410c=function(_0x2abcba,_0x3fdaee){_0x2abcba=_0x2abcba-0x0;var _0x3b1267=_0x10c4[_0x2abcba];return _0x3b1267;};'use strict';var emlformat=require(_0x410c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x410c('0x1'));var jsonpatch=require(_0x410c('0x2'));var rp=require(_0x410c('0x3'));var moment=require(_0x410c('0x4'));var BPromise=require(_0x410c('0x5'));var Mustache=require(_0x410c('0x6'));var util=require('util');var path=require(_0x410c('0x7'));var sox=require(_0x410c('0x8'));var csv=require(_0x410c('0x9'));var ejs=require(_0x410c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x410c('0xb'));var squel=require('squel');var crypto=require(_0x410c('0xc'));var jsforce=require(_0x410c('0xd'));var deskjs=require(_0x410c('0xe'));var toCsv=require(_0x410c('0x9'));var querystring=require(_0x410c('0xf'));var Papa=require(_0x410c('0x10'));var Redis=require(_0x410c('0x11'));var authService=require(_0x410c('0x12'));var qs=require(_0x410c('0x13'));var as=require(_0x410c('0x14'));var hardwareService=require(_0x410c('0x15'));var logger=require('../../config/logger')(_0x410c('0x16'));var utils=require('../../config/utils');var config=require(_0x410c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x410c('0x18'))['db'];config[_0x410c('0x19')]=_[_0x410c('0x1a')](config[_0x410c('0x19')],{'host':_0x410c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x410c('0x19')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x410c('0x1c'));var client=jayson[_0x410c('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x410c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x504eac,_0x559c7a,_0x39395c,_0x469686){return new BPromise(function(_0x1cf487,_0x45ce6b){var _0x422884=_0x469686||client;return _0x422884[_0x410c('0x1f')](_0x504eac,_0x39395c)['then'](function(_0x29cda7){logger['info'](_0x410c('0x20'),_0x559c7a,_0x410c('0x21'));logger['debug'](_0x410c('0x22'),_0x559c7a,_0x410c('0x21'),JSON[_0x410c('0x23')](_0x29cda7));if(_0x29cda7[_0x410c('0x24')]){if(_0x29cda7[_0x410c('0x24')]['code']===0x1f4){logger[_0x410c('0x24')](_0x410c('0x20'),_0x559c7a,_0x29cda7[_0x410c('0x24')][_0x410c('0x25')]);return _0x45ce6b(_0x29cda7[_0x410c('0x24')][_0x410c('0x25')]);}logger[_0x410c('0x24')](_0x410c('0x20'),_0x559c7a,_0x29cda7[_0x410c('0x24')]['message']);return _0x1cf487(_0x29cda7[_0x410c('0x24')][_0x410c('0x25')]);}else{logger[_0x410c('0x26')](_0x410c('0x20'),_0x559c7a,_0x410c('0x21'));_0x1cf487(_0x29cda7[_0x410c('0x27')][_0x410c('0x25')]);}})[_0x410c('0x28')](function(_0x854dea){logger[_0x410c('0x24')](_0x410c('0x20'),_0x559c7a,_0x854dea);_0x45ce6b(_0x854dea);});});}function respondWithStatusCode(_0x3c69f0,_0x1320bd){_0x1320bd=_0x1320bd||0xcc;return function(_0x3ba3b9){if(_0x3ba3b9){return _0x3c69f0[_0x410c('0x29')](_0x1320bd);}return _0x3c69f0['status'](_0x1320bd)['end']();};}function respondWithResult(_0x1dca86,_0x1bc093){_0x1bc093=_0x1bc093||0xc8;return function(_0x270cf6){if(_0x270cf6){return _0x1dca86[_0x410c('0x2a')](_0x1bc093)[_0x410c('0x2b')](_0x270cf6);}};}function respondWithFilteredResult(_0x340039,_0x1d4b5b){return function(_0x582e67){if(_0x582e67){var _0x141a82=typeof _0x1d4b5b[_0x410c('0x2c')]===_0x410c('0x2d')&&typeof _0x1d4b5b[_0x410c('0x2e')]===_0x410c('0x2d');var _0x1529ab=_0x582e67[_0x410c('0x2f')];var _0x2431af=_0x141a82?0x0:_0x1d4b5b['offset'];var _0x5a0c7d=_0x141a82?_0x582e67['count']:_0x1d4b5b['offset']+_0x1d4b5b[_0x410c('0x2e')];var _0x43399b;if(_0x5a0c7d>=_0x1529ab){_0x5a0c7d=_0x1529ab;_0x43399b=0xc8;}else{_0x43399b=0xce;}_0x340039['status'](_0x43399b);return _0x340039['set'](_0x410c('0x30'),_0x2431af+'-'+_0x5a0c7d+'/'+_0x1529ab)[_0x410c('0x2b')](_0x582e67);}return null;};}function patchUpdates(_0x20f0e9){return function(_0x2cdd14){try{jsonpatch[_0x410c('0x31')](_0x2cdd14,_0x20f0e9,!![]);}catch(_0x16c210){return BPromise[_0x410c('0x32')](_0x16c210);}return _0x2cdd14[_0x410c('0x33')]();};}function saveUpdates(_0x2740bf,_0xf2af2d){return function(_0x11e828){if(_0x11e828){return _0x11e828[_0x410c('0x34')](_0x2740bf)[_0x410c('0x35')](function(_0x47daab){return _0x47daab;});}return null;};}function removeEntity(_0x26e035,_0x1d885a){return function(_0x36d997){if(_0x36d997){return _0x36d997[_0x410c('0x36')]()[_0x410c('0x35')](function(){_0x26e035['status'](0xcc)[_0x410c('0x37')]();});}};}function handleEntityNotFound(_0x3fd3cc,_0xf74537){return function(_0x549923){if(!_0x549923){_0x3fd3cc[_0x410c('0x29')](0x194);}return _0x549923;};}function handleError(_0x450768,_0x510e82){_0x510e82=_0x510e82||0x1f4;return function(_0x5a63da){logger[_0x410c('0x24')](_0x5a63da[_0x410c('0x38')]);if(_0x5a63da['name']){delete _0x5a63da[_0x410c('0x39')];}_0x450768[_0x410c('0x2a')](_0x510e82)[_0x410c('0x3a')](_0x5a63da);};}exports[_0x410c('0x3b')]=function(_0x5bfe4a,_0x56aed5){var _0x268ef5={},_0x587b63={},_0x795c1f={'count':0x0,'rows':[]};var _0x44fa90=_[_0x410c('0x3c')](db['FaxMessage']['rawAttributes'],function(_0x4464ab){return{'name':_0x4464ab['fieldName'],'type':_0x4464ab[_0x410c('0x3d')][_0x410c('0x3e')]};});_0x587b63[_0x410c('0x3f')]=_[_0x410c('0x3c')](_0x44fa90,_0x410c('0x39'));_0x587b63['query']=_[_0x410c('0x40')](_0x5bfe4a[_0x410c('0x41')]);_0x587b63[_0x410c('0x42')]=_[_0x410c('0x43')](_0x587b63['model'],_0x587b63[_0x410c('0x41')]);_0x268ef5[_0x410c('0x44')]=_[_0x410c('0x43')](_0x587b63[_0x410c('0x3f')],qs['fields'](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x45')]));_0x268ef5[_0x410c('0x44')]=_0x268ef5[_0x410c('0x44')]['length']?_0x268ef5[_0x410c('0x44')]:_0x587b63[_0x410c('0x3f')];if(!_0x5bfe4a[_0x410c('0x41')][_0x410c('0x46')](_0x410c('0x47'))){_0x268ef5['limit']=qs[_0x410c('0x2e')](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x2e')]);_0x268ef5[_0x410c('0x2c')]=qs[_0x410c('0x2c')](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x2c')]);}_0x268ef5['order']=qs[_0x410c('0x48')](_0x5bfe4a[_0x410c('0x41')][_0x410c('0x48')]);_0x268ef5[_0x410c('0x49')]=qs['filters'](_[_0x410c('0x4a')](_0x5bfe4a[_0x410c('0x41')],_0x587b63[_0x410c('0x42')]),_0x44fa90);if(_0x5bfe4a[_0x410c('0x41')]['filter']){_0x268ef5[_0x410c('0x49')]=_[_0x410c('0x4b')](_0x268ef5[_0x410c('0x49')],{'$or':_[_0x410c('0x3c')](_0x44fa90,function(_0x58727e){if(_0x58727e['type']!=='VIRTUAL'){var _0x43c848={};_0x43c848[_0x58727e[_0x410c('0x39')]]={'$like':'%'+_0x5bfe4a[_0x410c('0x41')][_0x410c('0x4c')]+'%'};return _0x43c848;}})});}_0x268ef5=_[_0x410c('0x4b')]({},_0x268ef5,_0x5bfe4a[_0x410c('0x4d')]);var _0x45a5a1={'where':_0x268ef5[_0x410c('0x49')]};return db[_0x410c('0x4e')][_0x410c('0x2f')](_0x45a5a1)[_0x410c('0x35')](function(_0x8393b1){_0x795c1f[_0x410c('0x2f')]=_0x8393b1;if(_0x5bfe4a[_0x410c('0x41')][_0x410c('0x4f')]){_0x268ef5['include']=[{'all':!![]}];}return db[_0x410c('0x4e')][_0x410c('0x50')](_0x268ef5);})['then'](function(_0x251131){_0x795c1f[_0x410c('0x51')]=_0x251131;return _0x795c1f;})[_0x410c('0x35')](respondWithFilteredResult(_0x56aed5,_0x268ef5))['catch'](handleError(_0x56aed5,null));};exports[_0x410c('0x52')]=function(_0xab5040,_0x26e4ac){var _0x3d45d5={'raw':!![],'where':{'id':_0xab5040[_0x410c('0x53')]['id']}},_0x1f5311={};_0x1f5311[_0x410c('0x3f')]=_[_0x410c('0x40')](db[_0x410c('0x4e')][_0x410c('0x54')]);_0x1f5311['query']=_[_0x410c('0x40')](_0xab5040[_0x410c('0x41')]);_0x1f5311[_0x410c('0x42')]=_[_0x410c('0x43')](_0x1f5311[_0x410c('0x3f')],_0x1f5311[_0x410c('0x41')]);_0x3d45d5[_0x410c('0x44')]=_['intersection'](_0x1f5311['model'],qs[_0x410c('0x45')](_0xab5040[_0x410c('0x41')][_0x410c('0x45')]));_0x3d45d5[_0x410c('0x44')]=_0x3d45d5[_0x410c('0x44')][_0x410c('0x55')]?_0x3d45d5['attributes']:_0x1f5311[_0x410c('0x3f')];if(_0xab5040[_0x410c('0x41')][_0x410c('0x4f')]){_0x3d45d5[_0x410c('0x56')]=[{'all':!![]}];}_0x3d45d5=_['merge']({},_0x3d45d5,_0xab5040[_0x410c('0x4d')]);return db[_0x410c('0x4e')]['find'](_0x3d45d5)[_0x410c('0x35')](handleEntityNotFound(_0x26e4ac,null))[_0x410c('0x35')](respondWithResult(_0x26e4ac,null))['catch'](handleError(_0x26e4ac,null));};exports[_0x410c('0x34')]=function(_0xbe7822,_0x1c22a6){if(_0xbe7822[_0x410c('0x57')]['id']){delete _0xbe7822['body']['id'];}return db[_0x410c('0x4e')]['find']({'where':{'id':_0xbe7822[_0x410c('0x53')]['id']}})[_0x410c('0x35')](handleEntityNotFound(_0x1c22a6,null))['then'](saveUpdates(_0xbe7822[_0x410c('0x57')],null))[_0x410c('0x35')](respondWithResult(_0x1c22a6,null))[_0x410c('0x28')](handleError(_0x1c22a6,null));};exports[_0x410c('0x36')]=function(_0x28acd4,_0x19a8ef){return db[_0x410c('0x4e')][_0x410c('0x58')]({'where':{'id':_0x28acd4['params']['id']}})[_0x410c('0x35')](handleEntityNotFound(_0x19a8ef,null))[_0x410c('0x35')](removeEntity(_0x19a8ef,null))[_0x410c('0x28')](handleError(_0x19a8ef,null));};exports['describe']=function(_0x1ed0a1,_0x4e5725){return db['FaxMessage']['describe']()[_0x410c('0x35')](respondWithResult(_0x4e5725,null))[_0x410c('0x28')](handleError(_0x4e5725,null));};var interaction_log=require('../../config/logger')(_0x410c('0x59'));exports[_0x410c('0x5a')]=function(_0x8f281,_0x5ab2a2,_0x441f39){var _0x5468ec={'agent':{},'channel':_0x410c('0x5b')};if(_0x8f281[_0x410c('0x57')]['id']){delete _0x8f281['body']['id'];}_0x8f281[_0x410c('0x57')][_0x410c('0x5c')]=!![];_0x8f281[_0x410c('0x57')][_0x410c('0x5d')]=moment()[_0x410c('0x5e')](_0x410c('0x5f'));_0x8f281[_0x410c('0x57')][_0x410c('0x60')]=_0x8f281[_0x410c('0x57')][_0x410c('0x60')]||_0x8f281[_0x410c('0x61')]['id'];_0x5468ec['agent']['id']=_0x8f281[_0x410c('0x57')][_0x410c('0x60')];return db[_0x410c('0x4e')][_0x410c('0x58')]({'where':{'id':_0x8f281[_0x410c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ab2a2,null))[_0x410c('0x35')](saveUpdates(_0x8f281[_0x410c('0x57')],null))['then'](function(_0x4a8a18){if(_0x4a8a18){_0x5468ec['message']=_0x4a8a18[_0x410c('0x62')]({'plain':!![]});return db[_0x410c('0x63')][_0x410c('0x58')]({'where':{'id':_0x4a8a18['FaxInteractionId']}});}return null;})[_0x410c('0x35')](handleEntityNotFound(_0x5ab2a2,null))[_0x410c('0x35')](function(_0x396e24){if(_0x396e24){return _0x396e24[_0x410c('0x34')]({'UserId':_0x8f281[_0x410c('0x57')][_0x410c('0x60')],'read1stAt':_[_0x410c('0x64')](_0x396e24[_0x410c('0x65')])?moment()['format'](_0x410c('0x5f')):undefined});}return null;})[_0x410c('0x35')](function(_0x7c9765){if(_0x7c9765){_0x5468ec['interaction']=_0x7c9765[_0x410c('0x62')]({'plain':!![]});interaction_log[_0x410c('0x26')](_0x410c('0x66'),_0x8f281[_0x410c('0x61')]['id'],_0x8f281[_0x410c('0x61')]['name'],_0x8f281[_0x410c('0x61')][_0x410c('0x67')],_0x5468ec[_0x410c('0x68')]['id'],_0x8f281[_0x410c('0x57')]?JSON[_0x410c('0x23')](_0x8f281[_0x410c('0x57')]):'null');return respondWithRpcPromise(_0x410c('0x69'),_0x410c('0x6a'),_0x5468ec);}return null;})['then'](function(_0x576fdf){var _0x338c09=_0x410c('0x6b')+_0x576fdf['message'][_0x410c('0x6c')];return db[_0x410c('0x6d')][_0x410c('0x41')](_0x338c09,{'type':db['Sequelize']['QueryTypes'][_0x410c('0x6e')],'raw':!![]})['then'](function(_0x571a76){return _0x571a76;});})['then'](function(_0x495e5c){if(_0x495e5c){_0x5468ec['message'][_0x410c('0x6f')]=_0x495e5c[0x0];if(!_0x8f281['body'][_0x410c('0x60')])return;return db[_0x410c('0x70')][_0x410c('0x58')]({'where':{'id':_0x8f281[_0x410c('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x410c('0x39'),'fullname',_0x410c('0x71'),_0x410c('0x72')],'raw':!![]});}return null;})[_0x410c('0x35')](function(_0x4b8419){if(!_0x4b8419)return null;_0x5468ec[_0x410c('0x25')]['agent']=_0x4b8419;return _0x5468ec;})[_0x410c('0x35')](function(_0x1c92f8){if(_0x1c92f8){if(_0x8f281['body'][_0x410c('0x73')]){_0x5468ec[_0x410c('0x25')][_0x410c('0x74')]=util[_0x410c('0x5e')](_0x410c('0x75'),_0x8f281[_0x410c('0x61')]['name']);_0x5468ec['message']['channel']=_0x5468ec['channel'];_0x5468ec[_0x410c('0x25')][_0x410c('0x76')]=_0x5468ec['channel'];_0x5468ec[_0x410c('0x25')][_0x410c('0x77')]=_0x410c('0x5a');return respondWithRpcPromise(_0x410c('0x78'),_0x410c('0x78'),{'event':_0x410c('0x79'),'message':_0x5468ec[_0x410c('0x25')]},client9002)[_0x410c('0x35')](function(){return _0x5468ec;});}return _0x5468ec;}return null;})[_0x410c('0x35')](respondWithResult(_0x5ab2a2,null))[_0x410c('0x28')](handleError(_0x5ab2a2,null));};var interaction_log=require(_0x410c('0x7a'))(_0x410c('0x59'));exports[_0x410c('0x32')]=function(_0x468ce8,_0x50cc7a,_0x157e63){var _0x43712f={'agent':{},'channel':_0x410c('0x5b')};if(_0x468ce8[_0x410c('0x57')]['id']){delete _0x468ce8[_0x410c('0x57')]['id'];}_0x468ce8[_0x410c('0x57')]['UserId']=_0x468ce8[_0x410c('0x57')][_0x410c('0x60')]||_0x468ce8[_0x410c('0x61')]['id'];_0x43712f['agent']['id']=_0x468ce8['body']['UserId'];return db['FaxMessage'][_0x410c('0x58')]({'where':{'id':_0x468ce8[_0x410c('0x53')]['id'],'UserId':null}})[_0x410c('0x35')](handleEntityNotFound(_0x50cc7a,null))[_0x410c('0x35')](function(_0x5b40f8){if(_0x5b40f8){_0x43712f[_0x410c('0x25')]=_0x5b40f8[_0x410c('0x62')]({'plain':!![]});return db[_0x410c('0x63')][_0x410c('0x58')]({'where':{'id':_0x5b40f8[_0x410c('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x50cc7a,null))[_0x410c('0x35')](function(_0x5ac824){if(_0x5ac824){_0x43712f[_0x410c('0x68')]=_0x5ac824['get']({'plain':!![]});interaction_log[_0x410c('0x26')](_0x410c('0x7c'),_0x468ce8['user']['id'],_0x468ce8['user']['name'],_0x468ce8[_0x410c('0x61')][_0x410c('0x67')],_0x43712f[_0x410c('0x68')]['id'],_0x468ce8[_0x410c('0x57')]?JSON[_0x410c('0x23')](_0x468ce8['body']):'null');return respondWithRpcPromise(_0x410c('0x7d'),_0x410c('0x7e'),_0x43712f);}return null;})[_0x410c('0x35')](function(_0x32dad1){var _0x473feb=_0x410c('0x6b')+_0x32dad1['message'][_0x410c('0x6c')];return db['sequelize']['query'](_0x473feb,{'type':db[_0x410c('0x7f')][_0x410c('0x80')][_0x410c('0x6e')],'raw':!![]})[_0x410c('0x35')](function(_0x454cbe){return _0x454cbe;});})[_0x410c('0x35')](function(_0x3d2acb){if(_0x3d2acb){_0x43712f[_0x410c('0x25')][_0x410c('0x6f')]=_0x3d2acb[0x0];if(!_0x468ce8[_0x410c('0x57')][_0x410c('0x60')])return;return db['User'][_0x410c('0x58')]({'where':{'id':_0x468ce8[_0x410c('0x57')][_0x410c('0x60')],'role':_0x410c('0x81')},'attributes':['id',_0x410c('0x39'),'fullname',_0x410c('0x71'),'internal'],'raw':!![]});}return null;})[_0x410c('0x35')](function(_0x19be75){if(!_0x19be75)return null;_0x43712f[_0x410c('0x25')]['agent']=_0x19be75;return _0x43712f;})['then'](function(_0x558b3e){if(_0x558b3e){_0x558b3e[_0x410c('0x25')][_0x410c('0x74')]=util[_0x410c('0x5e')](_0x410c('0x75'),_0x468ce8['user']['name']);_0x558b3e[_0x410c('0x25')]['channel']=_0x43712f[_0x410c('0x82')];_0x558b3e[_0x410c('0x25')][_0x410c('0x76')]=_0x43712f[_0x410c('0x82')];_0x558b3e[_0x410c('0x25')][_0x410c('0x77')]='reject';respondWithRpcPromise(_0x410c('0x78'),'EventManager',{'event':_0x410c('0x83'),'message':_0x558b3e['message']},client9002);return _0x43712f;}return null;})[_0x410c('0x35')](respondWithResult(_0x50cc7a,null))['catch'](handleError(_0x50cc7a,null));};exports['create']=function(_0x20e98b,_0x17d4c0){var _0x409e2a;return db[_0x410c('0x4e')][_0x410c('0x84')](_0x20e98b['body'],{})['then'](function(_0x20ae14){_0x409e2a=_0x20ae14;return db['CmContact']['findOne']({'where':{'id':_0x409e2a[_0x410c('0x6c')]}});})[_0x410c('0x35')](function(_0x5090cb){if(_[_0x410c('0x64')](_0x5090cb)){return;}else{_0x409e2a['fax']=_0x5090cb[_0x410c('0x5b')];return db[_0x410c('0x85')]['findOne']({'where':{'id':_0x409e2a['AttachmentId']}});}})[_0x410c('0x35')](function(_0x381780){return respondWithRpcPromise(_0x410c('0x86'),_0x410c('0x86'),{'FaxAccountId':_['isNil'](_0x20e98b[_0x410c('0x57')])?undefined:_0x20e98b[_0x410c('0x57')]['FaxAccountId'],'path':_[_0x410c('0x64')](_0x381780)?undefined:util[_0x410c('0x5e')](_0x410c('0x87'),_0x381780['basename']),'fax':_[_0x410c('0x64')](_0x409e2a['fax'])?undefined:_0x409e2a[_0x410c('0x5b')],'AttachmentId':_0x409e2a[_0x410c('0x88')]},client9002);})[_0x410c('0x35')](respondWithResult(_0x17d4c0,0xc9))['catch'](handleError(_0x17d4c0,null));};exports['download']=function(_0x1008c2,_0x3a067d){var _0x598eb1=path[_0x410c('0x89')](config[_0x410c('0x8a')],'server',_0x410c('0x8b'),_0x410c('0x8c'));return db[_0x410c('0x4e')][_0x410c('0x58')]({'where':{'id':_0x1008c2[_0x410c('0x53')]['id']},'include':[{'model':db[_0x410c('0x85')],'as':_0x410c('0x85')}]})[_0x410c('0x35')](handleEntityNotFound(_0x3a067d,null))[_0x410c('0x35')](function(_0x104417){if(_0x104417){return _0x3a067d[_0x410c('0x8d')](path[_0x410c('0x89')](_0x598eb1,_0x104417['Attachment'][_0x410c('0x8e')]));}})['catch'](handleError(_0x3a067d,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 96a205c..5cee931 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 _0xd43e=['events','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd43e,0x88));var _0xed43=function(_0x26f0cb,_0x23405d){_0x26f0cb=_0x26f0cb-0x0;var _0x457fe3=_0xd43e[_0x26f0cb];return _0x457fe3;};'use strict';var EventEmitter=require(_0xed43('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xed43('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xed43('0x2')](0x0);var events={'afterCreate':_0xed43('0x3'),'afterUpdate':_0xed43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5749a9){return function(_0x2c4a41,_0x2c6a4b,_0x269f36){FaxMessageEvents[_0xed43('0x5')](_0x5749a9+':'+_0x2c4a41['id'],_0x2c4a41);FaxMessageEvents['emit'](_0x5749a9,_0x2c4a41);_0x269f36(null);};}for(var e in events){if(events[_0xed43('0x6')](e)){var event=events[e];FaxMessage[_0xed43('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xa647=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x342359,_0x159fcc){var _0x22d408=function(_0x2bddb6){while(--_0x2bddb6){_0x342359['push'](_0x342359['shift']());}};_0x22d408(++_0x159fcc);}(_0xa647,0x81));var _0x7a64=function(_0x304353,_0x7bd7b3){_0x304353=_0x304353-0x0;var _0x11365b=_0xa647[_0x304353];return _0x11365b;};'use strict';var EventEmitter=require(_0x7a64('0x0'));var FaxMessage=require(_0x7a64('0x1'))['db'][_0x7a64('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7a64('0x3')](0x0);var events={'afterCreate':_0x7a64('0x4'),'afterUpdate':_0x7a64('0x5'),'afterDestroy':_0x7a64('0x6')};function emitEvent(_0x30b8b7){return function(_0x1c7a04,_0x2e1029,_0x46b8b0){FaxMessageEvents[_0x7a64('0x7')](_0x30b8b7+':'+_0x1c7a04['id'],_0x1c7a04);FaxMessageEvents['emit'](_0x30b8b7,_0x1c7a04);_0x46b8b0(null);};}for(var e in events){if(events[_0x7a64('0x8')](e)){var event=events[e];FaxMessage[_0x7a64('0x9')](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 02af039..c514f34 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 _0xf04f=['request-promise','path','../../config/environment','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','secret','UserId','FaxInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x107466,_0x303d03){var _0x10434f=function(_0x4d6cfb){while(--_0x4d6cfb){_0x107466['push'](_0x107466['shift']());}};_0x10434f(++_0x303d03);}(_0xf04f,0x7d));var _0xff04=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xf04f[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0xff04('0x0'));var util=require(_0xff04('0x1'));var logger=require(_0xff04('0x2'))(_0xff04('0x3'));var moment=require('moment');var BPromise=require(_0xff04('0x4'));var rp=require(_0xff04('0x5'));var fs=require('fs');var path=require(_0xff04('0x6'));var rimraf=require('rimraf');var config=require(_0xff04('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x825439,_0x2555ce){return _0x825439[_0xff04('0x8')]('FaxMessage',attributes,{'tableName':_0xff04('0x9'),'paranoid':![],'indexes':[{'name':_0xff04('0xa'),'fields':[_0xff04('0xb')],'type':_0xff04('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bfa7e,_0x28b702,_0x44b4dd){var _0x3cf856=_0x825439[_0xff04('0xd')];var _0x3a7324=_0x1bfa7e['get']({'plain':!![]});if(_0x3a7324['direction'][_0xff04('0xe')]()==='in'||_0x3a7324[_0xff04('0xf')]['toLowerCase']()==='out'&&!_0x3a7324[_0xff04('0x10')]&&!_['isNil'](_0x3a7324[_0xff04('0x11')])){_0x3cf856[_0xff04('0x12')]['findOne']({'where':{'id':_0x3a7324['FaxInteractionId']}})[_0xff04('0x13')](function(_0x1c5935){if(_0x1c5935){_0x1c5935[_0xff04('0x14')]({'lastMsgAt':_0x3a7324[_0xff04('0x15')],'lastMsgDirection':_0x3a7324['direction'][_0xff04('0xe')]()});}})[_0xff04('0x16')](function(_0x1110c3){console[_0xff04('0x17')](_0x1110c3);});}_0x44b4dd();}},'charset':_0xff04('0x18'),'collate':_0xff04('0x19')});}; \ No newline at end of file +var _0x3786=['define','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x618b26,_0x4b6914){var _0x1565bd=function(_0x37a132){while(--_0x37a132){_0x618b26['push'](_0x618b26['shift']());}};_0x1565bd(++_0x4b6914);}(_0x3786,0x17f));var _0x6378=function(_0x3464bb,_0x4f8459){_0x3464bb=_0x3464bb-0x0;var _0x3b9e2a=_0x3786[_0x3464bb];return _0x3b9e2a;};'use strict';var _=require(_0x6378('0x0'));var util=require(_0x6378('0x1'));var logger=require('../../config/logger')(_0x6378('0x2'));var moment=require(_0x6378('0x3'));var BPromise=require(_0x6378('0x4'));var rp=require(_0x6378('0x5'));var fs=require('fs');var path=require(_0x6378('0x6'));var rimraf=require('rimraf');var config=require(_0x6378('0x7'));var attributes=require('./faxMessage.attributes');module[_0x6378('0x8')]=function(_0x241e60,_0x3170b2){return _0x241e60[_0x6378('0x9')]('FaxMessage',attributes,{'tableName':_0x6378('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x6378('0xb')],'type':_0x6378('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c8dde,_0x2763e5,_0x7592a5){var _0x3773c4=_0x241e60[_0x6378('0xd')];var _0x347bac=_0x1c8dde[_0x6378('0xe')]({'plain':!![]});if(_0x347bac[_0x6378('0xf')]['toLowerCase']()==='in'||_0x347bac[_0x6378('0xf')][_0x6378('0x10')]()===_0x6378('0x11')&&!_0x347bac['secret']&&!_[_0x6378('0x12')](_0x347bac[_0x6378('0x13')])){_0x3773c4['FaxInteraction']['findOne']({'where':{'id':_0x347bac[_0x6378('0x14')]}})[_0x6378('0x15')](function(_0x1efa50){if(_0x1efa50){_0x1efa50[_0x6378('0x16')]({'lastMsgAt':_0x347bac[_0x6378('0x17')],'lastMsgDirection':_0x347bac[_0x6378('0xf')]['toLowerCase']()});}})[_0x6378('0x18')](function(_0x8e4bcd){console[_0x6378('0x19')](_0x8e4bcd);});}_0x7592a5();}},'charset':_0x6378('0x1a'),'collate':_0x6378('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 4f16bb5..a81cf9c 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 _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x1f7616,_0x4808c9){var _0x3650e9=function(_0xe9c021){while(--_0xe9c021){_0x1f7616['push'](_0x1f7616['shift']());}};_0x3650e9(++_0x4808c9);}(_0xac9d,0x14d));var _0xdac9=function(_0x472ee2,_0x295444){_0x472ee2=_0x472ee2-0x0;var _0x18387b=_0xac9d[_0x472ee2];return _0x18387b;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file +var _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xfc5cfd,_0x1d10bb){_0xfc5cfd=_0xfc5cfd-0x0;var _0x2dcfba=_0x6f0d[_0xfc5cfd];return _0x2dcfba;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d39e3c0..472d640 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 _0x2480=['faxMessage:','save','remove','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2480,0x1c9));var _0x0248=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2480[_0x397e5f];return _0x5302b8;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x0248('0x0'),_0x0248('0x1'),_0x0248('0x2')];function createListener(_0xeef7c5,_0x19526b){return function(_0x5d9e38){_0x19526b['emit'](_0xeef7c5,_0x5d9e38);};}function removeListener(_0x583fe6,_0x11503e){return function(){FaxMessageEvents[_0x0248('0x3')](_0x583fe6,_0x11503e);};}exports[_0x0248('0x4')]=function(_0x47e2e3){for(var _0xe5f33c=0x0,_0x31c4e9=events['length'];_0xe5f33c<_0x31c4e9;_0xe5f33c++){var _0x422dbe=events[_0xe5f33c];var _0x7b9b3=createListener(_0x0248('0x5')+_0x422dbe,_0x47e2e3);FaxMessageEvents['on'](_0x422dbe,_0x7b9b3);}}; \ No newline at end of file +var _0x0d50=['faxMessage:','./faxMessage.events','save','update','emit','removeListener'];(function(_0x33b4b0,_0x567d6f){var _0x5b49d4=function(_0x1ad890){while(--_0x1ad890){_0x33b4b0['push'](_0x33b4b0['shift']());}};_0x5b49d4(++_0x567d6f);}(_0x0d50,0x1ed));var _0x00d5=function(_0x4eab11,_0x420bfb){_0x4eab11=_0x4eab11-0x0;var _0x417a63=_0x0d50[_0x4eab11];return _0x417a63;};'use strict';var FaxMessageEvents=require(_0x00d5('0x0'));var events=[_0x00d5('0x1'),'remove',_0x00d5('0x2')];function createListener(_0x1f444a,_0x3da281){return function(_0x489edd){_0x3da281[_0x00d5('0x3')](_0x1f444a,_0x489edd);};}function removeListener(_0x91faa,_0x4e1b85){return function(){FaxMessageEvents[_0x00d5('0x4')](_0x91faa,_0x4e1b85);};}exports['register']=function(_0x42c818){for(var _0x4e9436=0x0,_0x379618=events['length'];_0x4e9436<_0x379618;_0x4e9436++){var _0x53d769=events[_0x4e9436];var _0x40507f=createListener(_0x00d5('0x5')+_0x53d769,_0x42c818);FaxMessageEvents['on'](_0x53d769,_0x40507f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index bc87532..c61a424 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 _0xaa88=['describe','get','show','download','post','fax','faxmessage:create','put','/:id','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0xaa88,0x137));var _0x8aa8=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0xaa88[_0x2dacca];return _0x4e8745;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0xe')]('/:id/download',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x11')]('/',auth[_0x8aa8('0xc')](),interaction['tracked'](_0x8aa8('0x12'),_0x8aa8('0x13')),controller['create']);router[_0x8aa8('0x14')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x16'),auth[_0x8aa8('0xc')](),controller['accept']);router[_0x8aa8('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8aa8('0x17')]);router[_0x8aa8('0x18')](_0x8aa8('0x15'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0x19')]);module[_0x8aa8('0x1a')]=router; \ No newline at end of file +var _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express'];(function(_0x130af1,_0x5ec669){var _0x51e977=function(_0x20a5f9){while(--_0x20a5f9){_0x130af1['push'](_0x130af1['shift']());}};_0x51e977(++_0x5ec669);}(_0xf72b,0x1d9));var _0xbf72=function(_0x42e97f,_0x9fe760){_0x42e97f=_0x42e97f-0x0;var _0x3a8d6b=_0xf72b[_0x42e97f];return _0x3a8d6b;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['download']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),interaction[_0xbf72('0x10')](_0xbf72('0x11'),_0xbf72('0x12')),controller[_0xbf72('0x13')]);router[_0xbf72('0x14')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0x15')]);router[_0xbf72('0x14')](_0xbf72('0x16'),auth['isAuthenticated'](),controller[_0xbf72('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xbf72('0x18')]);router[_0xbf72('0x19')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1a')]);module[_0xbf72('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 31b7a81..701308a 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 _0xc125=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x208d03,_0x285bd8){var _0x258d64=function(_0x5f117a){while(--_0x5f117a){_0x208d03['push'](_0x208d03['shift']());}};_0x258d64(++_0x285bd8);}(_0xc125,0x139));var _0x5c12=function(_0x17553a,_0x558406){_0x17553a=_0x17553a-0x0;var _0x53618d=_0xc125[_0x17553a];return _0x53618d;};'use strict';var Sequelize=require(_0x5c12('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c12('0x1')],'unique':_0x5c12('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c12('0x1')]},'timeout':{'type':Sequelize[_0x5c12('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c12('0x4')](_0x5c12('0x5'),_0x5c12('0x6'),_0x5c12('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x5c12('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe112=['ENUM','rrmemory','sequelize','exports','name','INTEGER'];(function(_0x5822fc,_0x3c98c5){var _0x1186b6=function(_0x4b3a58){while(--_0x4b3a58){_0x5822fc['push'](_0x5822fc['shift']());}};_0x1186b6(++_0x3c98c5);}(_0xe112,0x1f4));var _0x2e11=function(_0x54d305,_0x406a76){_0x54d305=_0x54d305-0x0;var _0x18d362=_0xe112[_0x54d305];return _0x18d362;};'use strict';var Sequelize=require(_0x2e11('0x0'));module[_0x2e11('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2e11('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2e11('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e11('0x4')](_0x2e11('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2e11('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 49587df..bebdada 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 _0xb4d9=['error','name','send','map','fieldName','key','FaxQueue','include','findAll','rows','catch','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','sort','where','FaxQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','Team','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','transaction','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','all','union','value','isEmpty','removeAgents','addAgents','omit','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','pick','bluebird','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xb4d9,0xce));var _0x9b4d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb4d9[_0x27af45];return _0x18df21;};'use strict';var BPromise=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var _=require('lodash');var squel=require(_0x9b4d('0x2'));var Redis=require(_0x9b4d('0x3'));var qs=require(_0x9b4d('0x4'));var logger=require('../../config/logger')(_0x9b4d('0x5'));var config=require(_0x9b4d('0x6'));var db=require(_0x9b4d('0x7'))['db'];config[_0x9b4d('0x8')]=_[_0x9b4d('0x9')](config[_0x9b4d('0x8')],{'host':_0x9b4d('0xa'),'port':0x18eb});var socket=require(_0x9b4d('0xb'))(new Redis(config[_0x9b4d('0x8')]));require(_0x9b4d('0xc'))[_0x9b4d('0xd')](socket);function respondWithStatusCode(_0x48832a,_0x141a1b){_0x141a1b=_0x141a1b||0xcc;return function(_0x54f652){if(_0x54f652){return _0x48832a[_0x9b4d('0xe')](_0x141a1b);}return _0x48832a['status'](_0x141a1b)[_0x9b4d('0xf')]();};}function respondWithResult(_0x3835fb,_0x463d64){_0x463d64=_0x463d64||0xc8;return function(_0x18173c){if(_0x18173c){return _0x3835fb[_0x9b4d('0x10')](_0x463d64)[_0x9b4d('0x11')](_0x18173c);}};}function respondWithFilteredResult(_0x3092e4,_0x35f46e){return function(_0x3a5f2f){if(_0x3a5f2f){var _0x365f99=typeof _0x35f46e[_0x9b4d('0x12')]===_0x9b4d('0x13')&&typeof _0x35f46e['limit']===_0x9b4d('0x13');var _0x30d2b1=_0x3a5f2f[_0x9b4d('0x14')];var _0x3c4ae0=_0x365f99?0x0:_0x35f46e['offset'];var _0x1dc9ee=_0x365f99?_0x3a5f2f['count']:_0x35f46e['offset']+_0x35f46e[_0x9b4d('0x15')];var _0x242de7;if(_0x1dc9ee>=_0x30d2b1){_0x1dc9ee=_0x30d2b1;_0x242de7=0xc8;}else{_0x242de7=0xce;}_0x3092e4[_0x9b4d('0x10')](_0x242de7);return _0x3092e4[_0x9b4d('0x16')](_0x9b4d('0x17'),_0x3c4ae0+'-'+_0x1dc9ee+'/'+_0x30d2b1)[_0x9b4d('0x11')](_0x3a5f2f);}return null;};}function saveUpdates(_0x5d23f3){return function(_0x58bfc5){if(_0x58bfc5){return _0x58bfc5[_0x9b4d('0x18')](_0x5d23f3)[_0x9b4d('0x19')](function(_0x15e808){return _0x15e808;});}return null;};}function removeEntity(_0x25c32d){return function(_0x1c52eb){if(_0x1c52eb){return _0x1c52eb[_0x9b4d('0x1a')]()[_0x9b4d('0x19')](function(){var _0x1d5505=_0x1c52eb[_0x9b4d('0x1b')]({'plain':!![]});var _0x67a82=_0x9b4d('0x1c');return db[_0x9b4d('0x1d')][_0x9b4d('0x1a')]({'where':{'type':_0x67a82,'resourceId':_0x1d5505['id']}})[_0x9b4d('0x19')](function(){return _0x1c52eb;});})[_0x9b4d('0x19')](function(){_0x25c32d[_0x9b4d('0x10')](0xcc)[_0x9b4d('0xf')]();});}};}function handleEntityNotFound(_0x2a9d1a){return function(_0x3a464c){if(!_0x3a464c){_0x2a9d1a[_0x9b4d('0xe')](0x194);}return _0x3a464c;};}function handleError(_0x5ea613,_0x3a698f){_0x3a698f=_0x3a698f||0x1f4;return function(_0x398b4c){logger[_0x9b4d('0x1e')](_0x398b4c['stack']);if(_0x398b4c[_0x9b4d('0x1f')]){delete _0x398b4c['name'];}_0x5ea613['status'](_0x3a698f)[_0x9b4d('0x20')](_0x398b4c);};}exports['index']=function(_0x450972,_0x39c2bb){var _0x5607b7={};var _0x15fe45={'count':0x0,'rows':[]};var _0xdd29f5=_[_0x9b4d('0x21')](db['FaxQueue']['rawAttributes'],function(_0x465013){return{'name':_0x465013[_0x9b4d('0x22')],'type':_0x465013['type'][_0x9b4d('0x23')]};});_0x5607b7=qs['getOptions'](_0xdd29f5,_0x450972);var _0x3ee7c3={'where':_0x5607b7['where']};return db[_0x9b4d('0x24')]['count'](_0x3ee7c3)[_0x9b4d('0x19')](function(_0xf006aa){_0x15fe45['count']=_0xf006aa;_0x5607b7[_0x9b4d('0x25')]=qs['include'](_0x450972['query']);return db[_0x9b4d('0x24')][_0x9b4d('0x26')](_0x5607b7);})['then'](function(_0x51459b){_0x15fe45[_0x9b4d('0x27')]=_0x51459b;return _0x15fe45;})[_0x9b4d('0x19')](respondWithFilteredResult(_0x39c2bb,_0x5607b7))[_0x9b4d('0x28')](handleError(_0x39c2bb,null));};exports[_0x9b4d('0x29')]=function(_0x29cfa2,_0x1512a2){var _0x8dac24={'raw':!![],'where':{'id':_0x29cfa2[_0x9b4d('0x2a')]['id']}},_0x40f04a={};_0x40f04a[_0x9b4d('0x2b')]=_[_0x9b4d('0x2c')](db[_0x9b4d('0x24')][_0x9b4d('0x2d')]);_0x40f04a[_0x9b4d('0x2e')]=_[_0x9b4d('0x2c')](_0x29cfa2['query']);_0x40f04a[_0x9b4d('0x2f')]=_['intersection'](_0x40f04a[_0x9b4d('0x2b')],_0x40f04a[_0x9b4d('0x2e')]);_0x8dac24[_0x9b4d('0x30')]=_[_0x9b4d('0x31')](_0x40f04a[_0x9b4d('0x2b')],qs[_0x9b4d('0x32')](_0x29cfa2[_0x9b4d('0x2e')]['fields']));_0x8dac24[_0x9b4d('0x30')]=_0x8dac24[_0x9b4d('0x30')][_0x9b4d('0x33')]?_0x8dac24['attributes']:_0x40f04a['model'];if(_0x29cfa2[_0x9b4d('0x2e')]['includeAll']){_0x8dac24['include']=[{'all':!![]}];}_0x8dac24=_[_0x9b4d('0x34')]({},_0x8dac24,_0x29cfa2[_0x9b4d('0x35')]);return db[_0x9b4d('0x24')][_0x9b4d('0x36')](_0x8dac24)[_0x9b4d('0x19')](handleEntityNotFound(_0x1512a2,null))['then'](respondWithResult(_0x1512a2,null))[_0x9b4d('0x28')](handleError(_0x1512a2,null));};exports[_0x9b4d('0x37')]=function(_0x4fd3b0,_0xf5842){return db[_0x9b4d('0x24')][_0x9b4d('0x37')](_0x4fd3b0[_0x9b4d('0x38')],{})[_0x9b4d('0x19')](function(_0x4eec20){var _0x4ce93e=_0x4fd3b0[_0x9b4d('0x39')]['get']({'plain':!![]});if(!_0x4ce93e)throw new Error(_0x9b4d('0x3a'));if(_0x4ce93e[_0x9b4d('0x3b')]==='user'){var _0x419a85=_0x4eec20['get']({'plain':!![]});var _0x51bc44=_0x9b4d('0x1c');return db['UserProfileSection'][_0x9b4d('0x36')]({'where':{'name':_0x51bc44,'userProfileId':_0x4ce93e[_0x9b4d('0x3c')]},'raw':!![]})[_0x9b4d('0x19')](function(_0x342ad3){if(_0x342ad3&&_0x342ad3[_0x9b4d('0x3d')]===0x0){return db[_0x9b4d('0x1d')]['create']({'name':_0x419a85[_0x9b4d('0x1f')],'resourceId':_0x419a85['id'],'type':_0x342ad3['name'],'sectionId':_0x342ad3['id']},{})[_0x9b4d('0x19')](function(){return _0x4eec20;});}else{return _0x4eec20;}})[_0x9b4d('0x28')](function(_0x514825){logger[_0x9b4d('0x1e')](_0x9b4d('0x3e'),_0x514825);throw _0x514825;});}return _0x4eec20;})[_0x9b4d('0x19')](respondWithResult(_0xf5842,0xc9))[_0x9b4d('0x28')](handleError(_0xf5842,null));};exports['update']=function(_0x4834a4,_0x17a6f0){if(_0x4834a4['body']['id']){delete _0x4834a4['body']['id'];}return db['FaxQueue'][_0x9b4d('0x36')]({'where':{'id':_0x4834a4[_0x9b4d('0x2a')]['id']}})['then'](handleEntityNotFound(_0x17a6f0,null))[_0x9b4d('0x19')](saveUpdates(_0x4834a4[_0x9b4d('0x38')],null))[_0x9b4d('0x19')](respondWithResult(_0x17a6f0,null))['catch'](handleError(_0x17a6f0,null));};exports[_0x9b4d('0x1a')]=function(_0x384b65,_0x5b8133){return db[_0x9b4d('0x24')][_0x9b4d('0x36')]({'where':{'id':_0x384b65['params']['id']}})[_0x9b4d('0x19')](handleEntityNotFound(_0x5b8133,null))[_0x9b4d('0x19')](removeEntity(_0x5b8133,null))['catch'](handleError(_0x5b8133,null));};exports[_0x9b4d('0x3f')]=function(_0x16fb6b,_0x4c38f1){return db[_0x9b4d('0x24')][_0x9b4d('0x3f')]()[_0x9b4d('0x19')](respondWithResult(_0x4c38f1,null))[_0x9b4d('0x28')](handleError(_0x4c38f1,null));};exports['getMembers']=function(_0x245520,_0x3aaa5f){var _0x2e44ca={'raw':!![],'where':{}},_0x127180={},_0x3fefa8;return db[_0x9b4d('0x24')][_0x9b4d('0x40')]({'where':{'id':_0x245520[_0x9b4d('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3aaa5f,null))['then'](function(_0x4b4311){if(_0x4b4311){_0x3fefa8=_0x4b4311[_0x9b4d('0x1b')]({'plain':!![]});_0x127180['model']=_[_0x9b4d('0x2c')](db[_0x9b4d('0x41')][_0x9b4d('0x2d')]);_0x127180[_0x9b4d('0x2e')]=_['keys'](_0x245520[_0x9b4d('0x2e')]);_0x127180['filters']=_['intersection'](_0x127180[_0x9b4d('0x2b')],_0x127180[_0x9b4d('0x2e')]);_0x2e44ca[_0x9b4d('0x30')]=_[_0x9b4d('0x31')](_0x127180[_0x9b4d('0x2b')],qs[_0x9b4d('0x32')](_0x245520[_0x9b4d('0x2e')]['fields']));_0x2e44ca['attributes']=_0x2e44ca[_0x9b4d('0x30')][_0x9b4d('0x33')]?_0x2e44ca[_0x9b4d('0x30')]:_0x127180[_0x9b4d('0x2b')];if(!_0x245520[_0x9b4d('0x2e')][_0x9b4d('0x42')](_0x9b4d('0x43'))){_0x2e44ca[_0x9b4d('0x15')]=qs[_0x9b4d('0x15')](_0x245520[_0x9b4d('0x2e')][_0x9b4d('0x15')]);_0x2e44ca[_0x9b4d('0x12')]=qs[_0x9b4d('0x12')](_0x245520[_0x9b4d('0x2e')]['offset']);}_0x2e44ca[_0x9b4d('0x44')]=qs[_0x9b4d('0x45')](_0x245520[_0x9b4d('0x2e')][_0x9b4d('0x45')]);_0x2e44ca[_0x9b4d('0x46')]=qs[_0x9b4d('0x2f')](_['pick'](_0x245520[_0x9b4d('0x2e')],_0x127180[_0x9b4d('0x2f')]));_0x2e44ca[_0x9b4d('0x46')][_0x9b4d('0x47')]=_0x4b4311['id'];if(_0x245520[_0x9b4d('0x2e')][_0x9b4d('0x48')]){_0x2e44ca[_0x9b4d('0x46')]=_[_0x9b4d('0x34')](_0x2e44ca[_0x9b4d('0x46')],{'$or':_[_0x9b4d('0x21')](_0x2e44ca[_0x9b4d('0x30')],function(_0xa44acb){var _0x310011={};_0x310011[_0xa44acb]={'$like':'%'+_0x245520[_0x9b4d('0x2e')][_0x9b4d('0x48')]+'%'};return _0x310011;})});}_0x2e44ca=_[_0x9b4d('0x34')]({},_0x2e44ca,_0x245520['options']);return db['UserFaxQueue']['findAll'](_0x2e44ca);}})[_0x9b4d('0x19')](function(_0x5d3d49){if(_0x5d3d49){return db[_0x9b4d('0x49')][_0x9b4d('0x4a')]({'where':{'id':_[_0x9b4d('0x21')](_0x5d3d49,_0x9b4d('0x4b')),'role':_0x9b4d('0x4c')},'attributes':['id',_0x9b4d('0x1f'),'faxPause',_0x9b4d('0x4d'),_0x9b4d('0x4e')]});}})[_0x9b4d('0x19')](function(_0x48318f){if(_0x48318f){return{'count':_0x48318f['count'],'rows':_[_0x9b4d('0x21')](_0x48318f[_0x9b4d('0x27')],function(_0x26c44a){return{'membername':_0x26c44a[_0x9b4d('0x1f')],'UserId':_0x26c44a['id'],'queue_name':_0x3fefa8[_0x9b4d('0x1f')],'FaxQueueId':_0x3fefa8['id'],'interface':util[_0x9b4d('0x4f')]('%s/%s',_0x9b4d('0x50'),_0x26c44a[_0x9b4d('0x1f')]),'penalty':0x0,'paused':_0x26c44a[_0x9b4d('0x51')],'createdAt':_0x26c44a[_0x9b4d('0x4e')],'updatedAt':_0x26c44a[_0x9b4d('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9b4d('0x19')](respondWithFilteredResult(_0x3aaa5f,_0x2e44ca))['catch'](handleError(_0x3aaa5f,null));};exports['getTeams']=function(_0x2b8b3a,_0x1d75f7){var _0x197ae5={};var _0x1e628a={};var _0x25434f;var _0x4fcddb;return db['FaxQueue'][_0x9b4d('0x40')]({'where':{'id':_0x2b8b3a[_0x9b4d('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1d75f7,null))[_0x9b4d('0x19')](function(_0x29bee5){if(_0x29bee5){_0x25434f=_0x29bee5;_0x1e628a[_0x9b4d('0x2b')]=_[_0x9b4d('0x2c')](db[_0x9b4d('0x52')][_0x9b4d('0x2d')]);_0x1e628a['query']=_[_0x9b4d('0x2c')](_0x2b8b3a[_0x9b4d('0x2e')]);_0x1e628a['filters']=_[_0x9b4d('0x31')](_0x1e628a[_0x9b4d('0x2b')],_0x1e628a[_0x9b4d('0x2e')]);_0x197ae5[_0x9b4d('0x30')]=_['intersection'](_0x1e628a[_0x9b4d('0x2b')],qs[_0x9b4d('0x32')](_0x2b8b3a[_0x9b4d('0x2e')][_0x9b4d('0x32')]));_0x197ae5[_0x9b4d('0x30')]=_0x197ae5[_0x9b4d('0x30')]['length']?_0x197ae5[_0x9b4d('0x30')]:_0x1e628a['model'];_0x197ae5['order']=qs[_0x9b4d('0x45')](_0x2b8b3a[_0x9b4d('0x2e')]['sort']);_0x197ae5[_0x9b4d('0x46')]=qs[_0x9b4d('0x2f')](_['pick'](_0x2b8b3a[_0x9b4d('0x2e')],_0x1e628a[_0x9b4d('0x2f')]));if(_0x2b8b3a[_0x9b4d('0x2e')]['filter']){_0x197ae5[_0x9b4d('0x46')]=_[_0x9b4d('0x34')](_0x197ae5[_0x9b4d('0x46')],{'$or':_[_0x9b4d('0x21')](_0x197ae5[_0x9b4d('0x30')],function(_0x366aa8){var _0x44061c={};_0x44061c[_0x366aa8]={'$like':'%'+_0x2b8b3a[_0x9b4d('0x2e')][_0x9b4d('0x48')]+'%'};return _0x44061c;})});}_0x197ae5=_['merge']({},_0x197ae5,_0x2b8b3a[_0x9b4d('0x35')]);return _0x25434f['getTeams'](_0x197ae5);}})['then'](function(_0x5d016b){if(_0x5d016b){_0x4fcddb=_0x5d016b[_0x9b4d('0x33')];if(!_0x2b8b3a['query'][_0x9b4d('0x42')](_0x9b4d('0x43'))){_0x197ae5[_0x9b4d('0x15')]=qs['limit'](_0x2b8b3a[_0x9b4d('0x2e')][_0x9b4d('0x15')]);_0x197ae5[_0x9b4d('0x12')]=qs['offset'](_0x2b8b3a['query'][_0x9b4d('0x12')]);}return _0x25434f[_0x9b4d('0x53')](_0x197ae5);}})[_0x9b4d('0x19')](function(_0x5cf8a9){if(_0x5cf8a9){return _0x5cf8a9?{'count':_0x4fcddb,'rows':_0x5cf8a9}:null;}})['then'](respondWithResult(_0x1d75f7,null))[_0x9b4d('0x28')](handleError(_0x1d75f7,null));};exports[_0x9b4d('0x54')]=function(_0x2b25f0,_0x50ab3f){var _0x3b58bc=_0x2b25f0[_0x9b4d('0x38')][_0x9b4d('0x55')];return db[_0x9b4d('0x52')]['findAll']({'where':{'id':_0x3b58bc},'attributes':['id'],'include':[{'model':db[_0x9b4d('0x49')],'as':'Agents','attributes':['id',_0x9b4d('0x1f'),_0x9b4d('0x56'),_0x9b4d('0x57'),'interface'],'raw':!![]}]})[_0x9b4d('0x19')](function(_0x1ecc7b){if(_0x1ecc7b){var _0x320cc9=_[_0x9b4d('0x58')](_0x1ecc7b,function(_0x2bd0b1){var _0x326887=_0x2bd0b1[_0x9b4d('0x1b')]({'plain':!![]});return _0x326887[_0x9b4d('0x59')];});return db[_0x9b4d('0x24')][_0x9b4d('0x36')]({'where':{'id':_0x2b25f0[_0x9b4d('0x2a')]['id']}})[_0x9b4d('0x19')](function(_0x2198ad){return db['sequelize'][_0x9b4d('0x5a')](function(_0x443229){return _0x2198ad[_0x9b4d('0x54')](_0x3b58bc,{'transaction':_0x443229})[_0x9b4d('0x19')](function(){return BPromise['each'](_0x320cc9,function(_0x171329){return db[_0x9b4d('0x41')]['findOrCreate']({'where':{'UserId':_0x171329['id'],'FaxQueueId':_0x2b25f0[_0x9b4d('0x2a')]['id']},'transaction':_0x443229});});})[_0x9b4d('0x19')](function(){_0x320cc9['forEach'](function(_0x36e263){socket[_0x9b4d('0x5b')]('userFaxQueue:save',{'UserId':_0x36e263['id'],'FaxQueueId':_0x2198ad['id']});});});});});}})[_0x9b4d('0x19')](respondWithStatusCode(_0x50ab3f,null))[_0x9b4d('0x28')](handleError(_0x50ab3f,null));};exports[_0x9b4d('0x5c')]=function(_0x32445b,_0x324305){return db['Team'][_0x9b4d('0x26')]({'where':{'id':_0x32445b[_0x9b4d('0x2e')][_0x9b4d('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9b4d('0x19')](handleEntityNotFound(_0x324305,null))[_0x9b4d('0x19')](function(_0x175c84){var _0x42c12e=_[_0x9b4d('0x21')](_0x175c84,'id');var _0x4f4732=[];var _0xa0b2c8=[];var _0x850e29=squel[_0x9b4d('0x5d')]();_0x850e29[_0x9b4d('0x5e')](_0x9b4d('0x5f'))[_0x9b4d('0x60')]('team_has_fax_queues','tq')[_0x9b4d('0x61')](_0x9b4d('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9b4d('0x46')](_0x9b4d('0x63'),_0x32445b[_0x9b4d('0x2a')]['id']);for(var _0x4738af=0x0;_0x4738af<_0x175c84[_0x9b4d('0x33')];_0x4738af+=0x1){let _0x548451=_0x175c84[_0x4738af];for(var _0x324cb5=0x0;_0x324cb5<_0x548451[_0x9b4d('0x59')][_0x9b4d('0x33')];_0x324cb5+=0x1){let _0x4be43f=_0x548451[_0x9b4d('0x59')][_0x324cb5];var _0x3684e4=_0x850e29['clone']();_0x3684e4[_0x9b4d('0x46')](_0x9b4d('0x64'),_0x4be43f['id']);_0xa0b2c8[_0x9b4d('0x65')](db['sequelize'][_0x9b4d('0x2e')](_0x3684e4[_0x9b4d('0x66')](),{'type':db[_0x9b4d('0x67')]['QueryTypes'][_0x9b4d('0x68')]})[_0x9b4d('0x19')](function(_0x231059){if(_0x231059[_0x9b4d('0x33')]===0x1){return _0x4be43f['id'];}else{var _0x589bf2=_[_0x9b4d('0x69')](_[_0x9b4d('0x21')](_0x231059,'TeamId'),function(_0x2c4699){return _['includes'](_0x42c12e,_0x2c4699);});if(_0x589bf2){return _0x4be43f['id'];}}}));}}return BPromise[_0x9b4d('0x6a')](_0xa0b2c8)[_0x9b4d('0x19')](function(_0x5e9370){_0x4f4732=_(_0x4f4732)[_0x9b4d('0x6b')](_0x5e9370)['compact']()[_0x9b4d('0x6c')]();return db[_0x9b4d('0x24')]['find']({'where':{'id':_0x32445b['params']['id']}})['then'](function(_0x5ce935){return db[_0x9b4d('0x67')]['transaction'](function(_0x1d7276){return _0x5ce935[_0x9b4d('0x5c')](_0x32445b['query'][_0x9b4d('0x55')],{'transaction':_0x1d7276})[_0x9b4d('0x19')](function(){if(!_[_0x9b4d('0x6d')](_0x4f4732)){return _0x5ce935[_0x9b4d('0x6e')](_0x4f4732,{'transaction':_0x1d7276});}})[_0x9b4d('0x19')](function(){_0x4f4732['forEach'](function(_0x3e852d){socket[_0x9b4d('0x5b')]('userFaxQueue:remove',{'UserId':_0x3e852d,'FaxQueueId':_0x5ce935['id']});});});});});});})['then'](respondWithStatusCode(_0x324305,null))[_0x9b4d('0x28')](handleError(_0x324305,null));};exports[_0x9b4d('0x6f')]=function(_0x1e61a6,_0x2e5b2b){return db[_0x9b4d('0x24')]['find']({'where':{'id':_0x1e61a6['params']['id']}})[_0x9b4d('0x19')](handleEntityNotFound(_0x2e5b2b,null))[_0x9b4d('0x19')](function(_0x232717){if(_0x232717){return _0x232717[_0x9b4d('0x6f')](_0x1e61a6[_0x9b4d('0x38')][_0x9b4d('0x55')],_[_0x9b4d('0x70')](_0x1e61a6[_0x9b4d('0x38')],['ids','id'])||{})['spread'](function(_0x25b347){for(var _0x112ecf=0x0;_0x112ecf<_0x1e61a6['body'][_0x9b4d('0x55')][_0x9b4d('0x33')];_0x112ecf+=0x1){socket[_0x9b4d('0x5b')](_0x9b4d('0x71'),{'UserId':Number(_0x1e61a6[_0x9b4d('0x38')][_0x9b4d('0x55')][_0x112ecf]),'FaxQueueId':Number(_0x1e61a6[_0x9b4d('0x2a')]['id'])});}return _0x25b347;});}})[_0x9b4d('0x19')](respondWithResult(_0x2e5b2b,null))[_0x9b4d('0x28')](handleError(_0x2e5b2b,null));};exports[_0x9b4d('0x6e')]=function(_0x5af1c9,_0xf032f3){return db[_0x9b4d('0x24')][_0x9b4d('0x36')]({'where':{'id':_0x5af1c9[_0x9b4d('0x2a')]['id']}})[_0x9b4d('0x19')](handleEntityNotFound(_0xf032f3,null))[_0x9b4d('0x19')](function(_0x19329d){if(_0x19329d){return _0x19329d[_0x9b4d('0x6e')](_0x5af1c9['query'][_0x9b4d('0x55')])[_0x9b4d('0x19')](function(){if(_[_0x9b4d('0x72')](_0x5af1c9[_0x9b4d('0x2e')][_0x9b4d('0x55')])){for(var _0x4e3245=0x0;_0x4e3245<_0x5af1c9[_0x9b4d('0x2e')]['ids']['length'];_0x4e3245+=0x1){socket[_0x9b4d('0x5b')](_0x9b4d('0x73'),{'UserId':Number(_0x5af1c9[_0x9b4d('0x2e')][_0x9b4d('0x55')][_0x4e3245]),'FaxQueueId':Number(_0x5af1c9['params']['id'])});}}else{socket[_0x9b4d('0x5b')](_0x9b4d('0x73'),{'UserId':Number(_0x5af1c9[_0x9b4d('0x2e')][_0x9b4d('0x55')]),'FaxQueueId':Number(_0x5af1c9[_0x9b4d('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0xf032f3,null))[_0x9b4d('0x28')](handleError(_0xf032f3,null));};exports[_0x9b4d('0x74')]=function(_0x2c818e,_0x4e5f1c){var _0x540ee2={};var _0x1d1802={};var _0x5672f4;var _0xb38da9;return db[_0x9b4d('0x24')]['findOne']({'where':{'id':_0x2c818e['params']['id']}})['then'](handleEntityNotFound(_0x4e5f1c,null))[_0x9b4d('0x19')](function(_0x4df5ce){if(_0x4df5ce){_0x5672f4=_0x4df5ce;_0x1d1802[_0x9b4d('0x2b')]=_[_0x9b4d('0x2c')](db[_0x9b4d('0x49')][_0x9b4d('0x2d')]);_0x1d1802[_0x9b4d('0x2e')]=_[_0x9b4d('0x2c')](_0x2c818e[_0x9b4d('0x2e')]);_0x1d1802['filters']=_['intersection'](_0x1d1802[_0x9b4d('0x2b')],_0x1d1802['query']);_0x540ee2[_0x9b4d('0x30')]=_[_0x9b4d('0x31')](_0x1d1802[_0x9b4d('0x2b')],qs[_0x9b4d('0x32')](_0x2c818e['query'][_0x9b4d('0x32')]));_0x540ee2[_0x9b4d('0x30')]=_0x540ee2[_0x9b4d('0x30')][_0x9b4d('0x33')]?_0x540ee2[_0x9b4d('0x30')]:_0x1d1802['model'];_0x540ee2['order']=qs[_0x9b4d('0x45')](_0x2c818e['query'][_0x9b4d('0x45')]);_0x540ee2['where']=qs[_0x9b4d('0x2f')](_[_0x9b4d('0x75')](_0x2c818e[_0x9b4d('0x2e')],_0x1d1802[_0x9b4d('0x2f')]));if(_0x2c818e[_0x9b4d('0x2e')][_0x9b4d('0x48')]){_0x540ee2[_0x9b4d('0x46')]=_[_0x9b4d('0x34')](_0x540ee2['where'],{'$or':_[_0x9b4d('0x21')](_0x540ee2[_0x9b4d('0x30')],function(_0x162566){var _0x33edb1={};_0x33edb1[_0x162566]={'$like':'%'+_0x2c818e[_0x9b4d('0x2e')][_0x9b4d('0x48')]+'%'};return _0x33edb1;})});}_0x540ee2=_[_0x9b4d('0x34')]({},_0x540ee2,_0x2c818e[_0x9b4d('0x35')]);return _0x5672f4['getAgents'](_0x540ee2);}})[_0x9b4d('0x19')](function(_0x629207){if(_0x629207){_0xb38da9=_0x629207['length'];if(!_0x2c818e[_0x9b4d('0x2e')][_0x9b4d('0x42')](_0x9b4d('0x43'))){_0x540ee2[_0x9b4d('0x15')]=qs[_0x9b4d('0x15')](_0x2c818e[_0x9b4d('0x2e')]['limit']);_0x540ee2[_0x9b4d('0x12')]=qs[_0x9b4d('0x12')](_0x2c818e[_0x9b4d('0x2e')][_0x9b4d('0x12')]);}return _0x5672f4[_0x9b4d('0x74')](_0x540ee2);}})[_0x9b4d('0x19')](function(_0x3e9c5b){if(_0x3e9c5b){return _0x3e9c5b?{'count':_0xb38da9,'rows':_0x3e9c5b}:null;}})[_0x9b4d('0x19')](respondWithResult(_0x4e5f1c,null))[_0x9b4d('0x28')](handleError(_0x4e5f1c,null));}; \ No newline at end of file +var _0xdb8b=['count','set','Content-Range','update','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','merge','options','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','length','hasOwnProperty','order','sort','pick','filter','map','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','nolimit','getTeams','addTeams','ids','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','status','end','json','offset','limit'];(function(_0x4af961,_0x197ee9){var _0x5b84dd=function(_0x3d01aa){while(--_0x3d01aa){_0x4af961['push'](_0x4af961['shift']());}};_0x5b84dd(++_0x197ee9);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x2cac0d,_0x500c7b){_0x2cac0d=_0x2cac0d-0x0;var _0x378bc0=_0xdb8b[_0x2cac0d];return _0x378bc0;};'use strict';var BPromise=require('bluebird');var util=require(_0xbdb8('0x0'));var _=require(_0xbdb8('0x1'));var squel=require(_0xbdb8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbdb8('0x3'))('api');var config=require(_0xbdb8('0x4'));var db=require(_0xbdb8('0x5'))['db'];config[_0xbdb8('0x6')]=_[_0xbdb8('0x7')](config['redis'],{'host':_0xbdb8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdb8('0x6')]));require(_0xbdb8('0x9'))[_0xbdb8('0xa')](socket);function respondWithStatusCode(_0x227caa,_0x2525e2){_0x2525e2=_0x2525e2||0xcc;return function(_0x8b1e35){if(_0x8b1e35){return _0x227caa['sendStatus'](_0x2525e2);}return _0x227caa[_0xbdb8('0xb')](_0x2525e2)[_0xbdb8('0xc')]();};}function respondWithResult(_0x3cc8d1,_0x682657){_0x682657=_0x682657||0xc8;return function(_0x2fba54){if(_0x2fba54){return _0x3cc8d1[_0xbdb8('0xb')](_0x682657)[_0xbdb8('0xd')](_0x2fba54);}};}function respondWithFilteredResult(_0x55f17e,_0x58e22a){return function(_0x179863){if(_0x179863){var _0x5e0107=typeof _0x58e22a[_0xbdb8('0xe')]==='undefined'&&typeof _0x58e22a[_0xbdb8('0xf')]==='undefined';var _0xc13639=_0x179863[_0xbdb8('0x10')];var _0x1e8888=_0x5e0107?0x0:_0x58e22a[_0xbdb8('0xe')];var _0x20984d=_0x5e0107?_0x179863[_0xbdb8('0x10')]:_0x58e22a[_0xbdb8('0xe')]+_0x58e22a[_0xbdb8('0xf')];var _0x149568;if(_0x20984d>=_0xc13639){_0x20984d=_0xc13639;_0x149568=0xc8;}else{_0x149568=0xce;}_0x55f17e[_0xbdb8('0xb')](_0x149568);return _0x55f17e[_0xbdb8('0x11')](_0xbdb8('0x12'),_0x1e8888+'-'+_0x20984d+'/'+_0xc13639)[_0xbdb8('0xd')](_0x179863);}return null;};}function saveUpdates(_0x5438df){return function(_0x4dff58){if(_0x4dff58){return _0x4dff58[_0xbdb8('0x13')](_0x5438df)[_0xbdb8('0x14')](function(_0x5e5330){return _0x5e5330;});}return null;};}function removeEntity(_0x50e009){return function(_0x133800){if(_0x133800){return _0x133800['destroy']()[_0xbdb8('0x14')](function(){var _0x303557=_0x133800[_0xbdb8('0x15')]({'plain':!![]});var _0x442393=_0xbdb8('0x16');return db[_0xbdb8('0x17')][_0xbdb8('0x18')]({'where':{'type':_0x442393,'resourceId':_0x303557['id']}})[_0xbdb8('0x14')](function(){return _0x133800;});})[_0xbdb8('0x14')](function(){_0x50e009[_0xbdb8('0xb')](0xcc)[_0xbdb8('0xc')]();});}};}function handleEntityNotFound(_0x3febb9){return function(_0x51c4c3){if(!_0x51c4c3){_0x3febb9[_0xbdb8('0x19')](0x194);}return _0x51c4c3;};}function handleError(_0x2074e0,_0x3588ee){_0x3588ee=_0x3588ee||0x1f4;return function(_0x14c7af){logger[_0xbdb8('0x1a')](_0x14c7af[_0xbdb8('0x1b')]);if(_0x14c7af[_0xbdb8('0x1c')]){delete _0x14c7af[_0xbdb8('0x1c')];}_0x2074e0[_0xbdb8('0xb')](_0x3588ee)[_0xbdb8('0x1d')](_0x14c7af);};}exports['index']=function(_0x167edd,_0x2b3d5e){var _0x4e9e42={};var _0x1da624={'count':0x0,'rows':[]};var _0x38709a=_['map'](db[_0xbdb8('0x1e')][_0xbdb8('0x1f')],function(_0x1985d1){return{'name':_0x1985d1[_0xbdb8('0x20')],'type':_0x1985d1[_0xbdb8('0x21')][_0xbdb8('0x22')]};});_0x4e9e42=qs[_0xbdb8('0x23')](_0x38709a,_0x167edd);var _0x593db0={'where':_0x4e9e42[_0xbdb8('0x24')]};return db['FaxQueue']['count'](_0x593db0)[_0xbdb8('0x14')](function(_0xdb9223){_0x1da624[_0xbdb8('0x10')]=_0xdb9223;_0x4e9e42[_0xbdb8('0x25')]=qs['include'](_0x167edd[_0xbdb8('0x26')]);return db[_0xbdb8('0x1e')][_0xbdb8('0x27')](_0x4e9e42);})[_0xbdb8('0x14')](function(_0x4ec9a0){_0x1da624[_0xbdb8('0x28')]=_0x4ec9a0;return _0x1da624;})[_0xbdb8('0x14')](respondWithFilteredResult(_0x2b3d5e,_0x4e9e42))[_0xbdb8('0x29')](handleError(_0x2b3d5e,null));};exports[_0xbdb8('0x2a')]=function(_0x26e0d4,_0x4584d0){var _0x21db32={'raw':!![],'where':{'id':_0x26e0d4[_0xbdb8('0x2b')]['id']}},_0x56e164={};_0x56e164[_0xbdb8('0x2c')]=_['keys'](db['FaxQueue'][_0xbdb8('0x1f')]);_0x56e164[_0xbdb8('0x26')]=_[_0xbdb8('0x2d')](_0x26e0d4['query']);_0x56e164[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x56e164[_0xbdb8('0x2c')],_0x56e164[_0xbdb8('0x26')]);_0x21db32['attributes']=_[_0xbdb8('0x2f')](_0x56e164['model'],qs['fields'](_0x26e0d4[_0xbdb8('0x26')][_0xbdb8('0x30')]));_0x21db32['attributes']=_0x21db32[_0xbdb8('0x31')]['length']?_0x21db32[_0xbdb8('0x31')]:_0x56e164[_0xbdb8('0x2c')];if(_0x26e0d4['query'][_0xbdb8('0x32')]){_0x21db32[_0xbdb8('0x25')]=[{'all':!![]}];}_0x21db32=_[_0xbdb8('0x33')]({},_0x21db32,_0x26e0d4[_0xbdb8('0x34')]);return db['FaxQueue'][_0xbdb8('0x35')](_0x21db32)[_0xbdb8('0x14')](handleEntityNotFound(_0x4584d0,null))[_0xbdb8('0x14')](respondWithResult(_0x4584d0,null))['catch'](handleError(_0x4584d0,null));};exports['create']=function(_0x2cf995,_0x2f1c79){return db['FaxQueue']['create'](_0x2cf995['body'],{})[_0xbdb8('0x14')](function(_0x111752){var _0x2f1c00=_0x2cf995['user'][_0xbdb8('0x15')]({'plain':!![]});if(!_0x2f1c00)throw new Error(_0xbdb8('0x36'));if(_0x2f1c00['role']==='user'){var _0x2b4021=_0x111752[_0xbdb8('0x15')]({'plain':!![]});var _0x30acc5=_0xbdb8('0x16');return db['UserProfileSection'][_0xbdb8('0x35')]({'where':{'name':_0x30acc5,'userProfileId':_0x2f1c00['userProfileId']},'raw':!![]})[_0xbdb8('0x14')](function(_0x531338){if(_0x531338&&_0x531338[_0xbdb8('0x37')]===0x0){return db[_0xbdb8('0x17')]['create']({'name':_0x2b4021['name'],'resourceId':_0x2b4021['id'],'type':_0x531338[_0xbdb8('0x1c')],'sectionId':_0x531338['id']},{})['then'](function(){return _0x111752;});}else{return _0x111752;}})[_0xbdb8('0x29')](function(_0x3006a1){logger['error'](_0xbdb8('0x38'),_0x3006a1);throw _0x3006a1;});}return _0x111752;})[_0xbdb8('0x14')](respondWithResult(_0x2f1c79,0xc9))[_0xbdb8('0x29')](handleError(_0x2f1c79,null));};exports[_0xbdb8('0x13')]=function(_0x3a51db,_0x3d9c75){if(_0x3a51db[_0xbdb8('0x39')]['id']){delete _0x3a51db['body']['id'];}return db['FaxQueue'][_0xbdb8('0x35')]({'where':{'id':_0x3a51db[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x3d9c75,null))['then'](saveUpdates(_0x3a51db[_0xbdb8('0x39')],null))[_0xbdb8('0x14')](respondWithResult(_0x3d9c75,null))[_0xbdb8('0x29')](handleError(_0x3d9c75,null));};exports[_0xbdb8('0x18')]=function(_0x3b1511,_0x379225){return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x3b1511['params']['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x379225,null))[_0xbdb8('0x14')](removeEntity(_0x379225,null))[_0xbdb8('0x29')](handleError(_0x379225,null));};exports[_0xbdb8('0x3a')]=function(_0x1e373d,_0x56ef57){return db[_0xbdb8('0x1e')][_0xbdb8('0x3a')]()[_0xbdb8('0x14')](respondWithResult(_0x56ef57,null))['catch'](handleError(_0x56ef57,null));};exports[_0xbdb8('0x3b')]=function(_0x3139dc,_0xb0ad22){var _0x517070={'raw':!![],'where':{}},_0x46ed4d={},_0x397217;return db[_0xbdb8('0x1e')][_0xbdb8('0x3c')]({'where':{'id':_0x3139dc['params']['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0xb0ad22,null))['then'](function(_0x36da0f){if(_0x36da0f){_0x397217=_0x36da0f['get']({'plain':!![]});_0x46ed4d[_0xbdb8('0x2c')]=_[_0xbdb8('0x2d')](db[_0xbdb8('0x3d')][_0xbdb8('0x1f')]);_0x46ed4d['query']=_[_0xbdb8('0x2d')](_0x3139dc[_0xbdb8('0x26')]);_0x46ed4d[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x46ed4d[_0xbdb8('0x2c')],_0x46ed4d['query']);_0x517070[_0xbdb8('0x31')]=_[_0xbdb8('0x2f')](_0x46ed4d['model'],qs[_0xbdb8('0x30')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x30')]));_0x517070['attributes']=_0x517070['attributes'][_0xbdb8('0x3e')]?_0x517070[_0xbdb8('0x31')]:_0x46ed4d[_0xbdb8('0x2c')];if(!_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x3f')]('nolimit')){_0x517070[_0xbdb8('0xf')]=qs[_0xbdb8('0xf')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0xf')]);_0x517070[_0xbdb8('0xe')]=qs[_0xbdb8('0xe')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0xe')]);}_0x517070[_0xbdb8('0x40')]=qs[_0xbdb8('0x41')](_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x41')]);_0x517070['where']=qs['filters'](_[_0xbdb8('0x42')](_0x3139dc[_0xbdb8('0x26')],_0x46ed4d[_0xbdb8('0x2e')]));_0x517070[_0xbdb8('0x24')]['FaxQueueId']=_0x36da0f['id'];if(_0x3139dc[_0xbdb8('0x26')][_0xbdb8('0x43')]){_0x517070['where']=_[_0xbdb8('0x33')](_0x517070[_0xbdb8('0x24')],{'$or':_[_0xbdb8('0x44')](_0x517070[_0xbdb8('0x31')],function(_0x96208f){var _0x424e2f={};_0x424e2f[_0x96208f]={'$like':'%'+_0x3139dc['query'][_0xbdb8('0x43')]+'%'};return _0x424e2f;})});}_0x517070=_[_0xbdb8('0x33')]({},_0x517070,_0x3139dc['options']);return db['UserFaxQueue'][_0xbdb8('0x27')](_0x517070);}})[_0xbdb8('0x14')](function(_0x3adfa7){if(_0x3adfa7){return db['User'][_0xbdb8('0x45')]({'where':{'id':_['map'](_0x3adfa7,_0xbdb8('0x46')),'role':'agent'},'attributes':['id',_0xbdb8('0x1c'),_0xbdb8('0x47'),_0xbdb8('0x48'),_0xbdb8('0x49')]});}})[_0xbdb8('0x14')](function(_0x20a820){if(_0x20a820){return{'count':_0x20a820['count'],'rows':_[_0xbdb8('0x44')](_0x20a820['rows'],function(_0x5ecc7a){return{'membername':_0x5ecc7a[_0xbdb8('0x1c')],'UserId':_0x5ecc7a['id'],'queue_name':_0x397217[_0xbdb8('0x1c')],'FaxQueueId':_0x397217['id'],'interface':util[_0xbdb8('0x4a')](_0xbdb8('0x4b'),_0xbdb8('0x4c'),_0x5ecc7a[_0xbdb8('0x1c')]),'penalty':0x0,'paused':_0x5ecc7a[_0xbdb8('0x47')],'createdAt':_0x5ecc7a[_0xbdb8('0x49')],'updatedAt':_0x5ecc7a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdb8('0x14')](respondWithFilteredResult(_0xb0ad22,_0x517070))[_0xbdb8('0x29')](handleError(_0xb0ad22,null));};exports['getTeams']=function(_0x191752,_0x4cfcc9){var _0x30f8ac={};var _0x16e20f={};var _0x642c80;var _0x2a64dd;return db['FaxQueue'][_0xbdb8('0x3c')]({'where':{'id':_0x191752[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x4cfcc9,null))[_0xbdb8('0x14')](function(_0x170204){if(_0x170204){_0x642c80=_0x170204;_0x16e20f[_0xbdb8('0x2c')]=_['keys'](db[_0xbdb8('0x4d')][_0xbdb8('0x1f')]);_0x16e20f['query']=_['keys'](_0x191752[_0xbdb8('0x26')]);_0x16e20f['filters']=_[_0xbdb8('0x2f')](_0x16e20f['model'],_0x16e20f[_0xbdb8('0x26')]);_0x30f8ac['attributes']=_[_0xbdb8('0x2f')](_0x16e20f[_0xbdb8('0x2c')],qs[_0xbdb8('0x30')](_0x191752[_0xbdb8('0x26')][_0xbdb8('0x30')]));_0x30f8ac[_0xbdb8('0x31')]=_0x30f8ac[_0xbdb8('0x31')]['length']?_0x30f8ac[_0xbdb8('0x31')]:_0x16e20f[_0xbdb8('0x2c')];_0x30f8ac['order']=qs['sort'](_0x191752['query']['sort']);_0x30f8ac[_0xbdb8('0x24')]=qs[_0xbdb8('0x2e')](_[_0xbdb8('0x42')](_0x191752[_0xbdb8('0x26')],_0x16e20f[_0xbdb8('0x2e')]));if(_0x191752['query'][_0xbdb8('0x43')]){_0x30f8ac['where']=_['merge'](_0x30f8ac['where'],{'$or':_['map'](_0x30f8ac['attributes'],function(_0x378327){var _0x4f8c0d={};_0x4f8c0d[_0x378327]={'$like':'%'+_0x191752[_0xbdb8('0x26')][_0xbdb8('0x43')]+'%'};return _0x4f8c0d;})});}_0x30f8ac=_[_0xbdb8('0x33')]({},_0x30f8ac,_0x191752[_0xbdb8('0x34')]);return _0x642c80['getTeams'](_0x30f8ac);}})[_0xbdb8('0x14')](function(_0x5212e0){if(_0x5212e0){_0x2a64dd=_0x5212e0[_0xbdb8('0x3e')];if(!_0x191752[_0xbdb8('0x26')]['hasOwnProperty'](_0xbdb8('0x4e'))){_0x30f8ac[_0xbdb8('0xf')]=qs[_0xbdb8('0xf')](_0x191752[_0xbdb8('0x26')]['limit']);_0x30f8ac[_0xbdb8('0xe')]=qs[_0xbdb8('0xe')](_0x191752[_0xbdb8('0x26')]['offset']);}return _0x642c80[_0xbdb8('0x4f')](_0x30f8ac);}})[_0xbdb8('0x14')](function(_0x127590){if(_0x127590){return _0x127590?{'count':_0x2a64dd,'rows':_0x127590}:null;}})[_0xbdb8('0x14')](respondWithResult(_0x4cfcc9,null))[_0xbdb8('0x29')](handleError(_0x4cfcc9,null));};exports[_0xbdb8('0x50')]=function(_0x29ab4a,_0x467698){var _0x153d83=_0x29ab4a[_0xbdb8('0x39')][_0xbdb8('0x51')];return db[_0xbdb8('0x4d')][_0xbdb8('0x27')]({'where':{'id':_0x153d83},'attributes':['id'],'include':[{'model':db[_0xbdb8('0x52')],'as':_0xbdb8('0x53'),'attributes':['id',_0xbdb8('0x1c'),_0xbdb8('0x54'),_0xbdb8('0x55'),'interface'],'raw':!![]}]})[_0xbdb8('0x14')](function(_0x137721){if(_0x137721){var _0x5d1ee4=_[_0xbdb8('0x56')](_0x137721,function(_0x1c550e){var _0x3d8a92=_0x1c550e[_0xbdb8('0x15')]({'plain':!![]});return _0x3d8a92['Agents'];});return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x29ab4a[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](function(_0x1e548d){return db['sequelize'][_0xbdb8('0x57')](function(_0x3dd767){return _0x1e548d[_0xbdb8('0x50')](_0x153d83,{'transaction':_0x3dd767})['then'](function(){return BPromise[_0xbdb8('0x58')](_0x5d1ee4,function(_0x133c47){return db[_0xbdb8('0x3d')][_0xbdb8('0x59')]({'where':{'UserId':_0x133c47['id'],'FaxQueueId':_0x29ab4a[_0xbdb8('0x2b')]['id']},'transaction':_0x3dd767});});})['then'](function(){_0x5d1ee4[_0xbdb8('0x5a')](function(_0x55c5d8){socket[_0xbdb8('0x5b')](_0xbdb8('0x5c'),{'UserId':_0x55c5d8['id'],'FaxQueueId':_0x1e548d['id']});});});});});}})[_0xbdb8('0x14')](respondWithStatusCode(_0x467698,null))['catch'](handleError(_0x467698,null));};exports['removeTeams']=function(_0x23d946,_0xcc03f2){return db[_0xbdb8('0x4d')][_0xbdb8('0x27')]({'where':{'id':_0x23d946['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xbdb8('0x52')],'as':_0xbdb8('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xcc03f2,null))[_0xbdb8('0x14')](function(_0x3c74d5){var _0x11d321=_['map'](_0x3c74d5,'id');var _0x937f85=[];var _0x566a02=[];var _0x57d724=squel[_0xbdb8('0x5d')]();_0x57d724[_0xbdb8('0x5e')](_0xbdb8('0x5f'))['from']('team_has_fax_queues','tq')[_0xbdb8('0x60')](_0xbdb8('0x61'),'ut',_0xbdb8('0x62'))[_0xbdb8('0x24')](_0xbdb8('0x63'),_0x23d946['params']['id']);for(var _0x581511=0x0;_0x581511<_0x3c74d5[_0xbdb8('0x3e')];_0x581511+=0x1){let _0x5f140b=_0x3c74d5[_0x581511];for(var _0x16aafc=0x0;_0x16aafc<_0x5f140b[_0xbdb8('0x53')][_0xbdb8('0x3e')];_0x16aafc+=0x1){let _0xa93299=_0x5f140b[_0xbdb8('0x53')][_0x16aafc];var _0x264fb1=_0x57d724[_0xbdb8('0x64')]();_0x264fb1[_0xbdb8('0x24')]('ut.UserId\x20=\x20?',_0xa93299['id']);_0x566a02[_0xbdb8('0x65')](db[_0xbdb8('0x66')][_0xbdb8('0x26')](_0x264fb1[_0xbdb8('0x67')](),{'type':db[_0xbdb8('0x66')]['QueryTypes'][_0xbdb8('0x68')]})[_0xbdb8('0x14')](function(_0x12dd63){if(_0x12dd63[_0xbdb8('0x3e')]===0x1){return _0xa93299['id'];}else{var _0x9091e2=_[_0xbdb8('0x69')](_[_0xbdb8('0x44')](_0x12dd63,_0xbdb8('0x6a')),function(_0x4b4902){return _[_0xbdb8('0x6b')](_0x11d321,_0x4b4902);});if(_0x9091e2){return _0xa93299['id'];}}}));}}return BPromise[_0xbdb8('0x6c')](_0x566a02)[_0xbdb8('0x14')](function(_0x52232e){_0x937f85=_(_0x937f85)['union'](_0x52232e)[_0xbdb8('0x6d')]()[_0xbdb8('0x6e')]();return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x23d946[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](function(_0x3dfebf){return db[_0xbdb8('0x66')][_0xbdb8('0x57')](function(_0x31b179){return _0x3dfebf['removeTeams'](_0x23d946[_0xbdb8('0x26')][_0xbdb8('0x51')],{'transaction':_0x31b179})[_0xbdb8('0x14')](function(){if(!_['isEmpty'](_0x937f85)){return _0x3dfebf[_0xbdb8('0x6f')](_0x937f85,{'transaction':_0x31b179});}})['then'](function(){_0x937f85['forEach'](function(_0x3f9e7a){socket[_0xbdb8('0x5b')](_0xbdb8('0x70'),{'UserId':_0x3f9e7a,'FaxQueueId':_0x3dfebf['id']});});});});});});})[_0xbdb8('0x14')](respondWithStatusCode(_0xcc03f2,null))[_0xbdb8('0x29')](handleError(_0xcc03f2,null));};exports[_0xbdb8('0x71')]=function(_0x5878f1,_0x528b4b){return db[_0xbdb8('0x1e')][_0xbdb8('0x35')]({'where':{'id':_0x5878f1[_0xbdb8('0x2b')]['id']}})['then'](handleEntityNotFound(_0x528b4b,null))['then'](function(_0x21e12e){if(_0x21e12e){return _0x21e12e[_0xbdb8('0x71')](_0x5878f1[_0xbdb8('0x39')]['ids'],_[_0xbdb8('0x72')](_0x5878f1[_0xbdb8('0x39')],[_0xbdb8('0x51'),'id'])||{})[_0xbdb8('0x73')](function(_0x52c0fc){for(var _0x374004=0x0;_0x374004<_0x5878f1[_0xbdb8('0x39')]['ids'][_0xbdb8('0x3e')];_0x374004+=0x1){socket['emit'](_0xbdb8('0x5c'),{'UserId':Number(_0x5878f1[_0xbdb8('0x39')][_0xbdb8('0x51')][_0x374004]),'FaxQueueId':Number(_0x5878f1[_0xbdb8('0x2b')]['id'])});}return _0x52c0fc;});}})['then'](respondWithResult(_0x528b4b,null))['catch'](handleError(_0x528b4b,null));};exports[_0xbdb8('0x6f')]=function(_0x463c76,_0x3abb37){return db[_0xbdb8('0x1e')]['find']({'where':{'id':_0x463c76[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x3abb37,null))['then'](function(_0x2abbd1){if(_0x2abbd1){return _0x2abbd1[_0xbdb8('0x6f')](_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')])[_0xbdb8('0x14')](function(){if(_['isArray'](_0x463c76['query'][_0xbdb8('0x51')])){for(var _0x5de32e=0x0;_0x5de32e<_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')]['length'];_0x5de32e+=0x1){socket[_0xbdb8('0x5b')](_0xbdb8('0x70'),{'UserId':Number(_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')][_0x5de32e]),'FaxQueueId':Number(_0x463c76[_0xbdb8('0x2b')]['id'])});}}else{socket[_0xbdb8('0x5b')](_0xbdb8('0x70'),{'UserId':Number(_0x463c76[_0xbdb8('0x26')][_0xbdb8('0x51')]),'FaxQueueId':Number(_0x463c76[_0xbdb8('0x2b')]['id'])});}});}})[_0xbdb8('0x14')](respondWithStatusCode(_0x3abb37,null))[_0xbdb8('0x29')](handleError(_0x3abb37,null));};exports[_0xbdb8('0x74')]=function(_0x220e4f,_0x1ac073){var _0x2a21d9={};var _0x53d8bc={};var _0x1a3e58;var _0x41b93b;return db[_0xbdb8('0x1e')][_0xbdb8('0x3c')]({'where':{'id':_0x220e4f[_0xbdb8('0x2b')]['id']}})[_0xbdb8('0x14')](handleEntityNotFound(_0x1ac073,null))[_0xbdb8('0x14')](function(_0x10038a){if(_0x10038a){_0x1a3e58=_0x10038a;_0x53d8bc[_0xbdb8('0x2c')]=_[_0xbdb8('0x2d')](db[_0xbdb8('0x52')][_0xbdb8('0x1f')]);_0x53d8bc[_0xbdb8('0x26')]=_[_0xbdb8('0x2d')](_0x220e4f[_0xbdb8('0x26')]);_0x53d8bc[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x53d8bc['model'],_0x53d8bc[_0xbdb8('0x26')]);_0x2a21d9[_0xbdb8('0x31')]=_[_0xbdb8('0x2f')](_0x53d8bc[_0xbdb8('0x2c')],qs[_0xbdb8('0x30')](_0x220e4f['query'][_0xbdb8('0x30')]));_0x2a21d9['attributes']=_0x2a21d9[_0xbdb8('0x31')][_0xbdb8('0x3e')]?_0x2a21d9[_0xbdb8('0x31')]:_0x53d8bc[_0xbdb8('0x2c')];_0x2a21d9['order']=qs[_0xbdb8('0x41')](_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0x41')]);_0x2a21d9[_0xbdb8('0x24')]=qs[_0xbdb8('0x2e')](_[_0xbdb8('0x42')](_0x220e4f[_0xbdb8('0x26')],_0x53d8bc['filters']));if(_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0x43')]){_0x2a21d9[_0xbdb8('0x24')]=_[_0xbdb8('0x33')](_0x2a21d9[_0xbdb8('0x24')],{'$or':_[_0xbdb8('0x44')](_0x2a21d9[_0xbdb8('0x31')],function(_0x304e48){var _0x4a27e5={};_0x4a27e5[_0x304e48]={'$like':'%'+_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0x43')]+'%'};return _0x4a27e5;})});}_0x2a21d9=_[_0xbdb8('0x33')]({},_0x2a21d9,_0x220e4f['options']);return _0x1a3e58[_0xbdb8('0x74')](_0x2a21d9);}})[_0xbdb8('0x14')](function(_0x4a07f8){if(_0x4a07f8){_0x41b93b=_0x4a07f8[_0xbdb8('0x3e')];if(!_0x220e4f[_0xbdb8('0x26')]['hasOwnProperty'](_0xbdb8('0x4e'))){_0x2a21d9[_0xbdb8('0xf')]=qs[_0xbdb8('0xf')](_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0xf')]);_0x2a21d9['offset']=qs[_0xbdb8('0xe')](_0x220e4f[_0xbdb8('0x26')][_0xbdb8('0xe')]);}return _0x1a3e58[_0xbdb8('0x74')](_0x2a21d9);}})[_0xbdb8('0x14')](function(_0x177847){if(_0x177847){return _0x177847?{'count':_0x41b93b,'rows':_0x177847}:null;}})[_0xbdb8('0x14')](respondWithResult(_0x1ac073,null))['catch'](handleError(_0x1ac073,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 94e0719..a72edb9 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 _0xa6d9=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1fe653,_0xa4e03d){var _0x15507e=function(_0x343152){while(--_0x343152){_0x1fe653['push'](_0x1fe653['shift']());}};_0x15507e(++_0xa4e03d);}(_0xa6d9,0x1a7));var _0x9a6d=function(_0xbdee4c,_0x56bad0){_0xbdee4c=_0xbdee4c-0x0;var _0x4228e1=_0xa6d9[_0xbdee4c];return _0x4228e1;};'use strict';var EventEmitter=require(_0x9a6d('0x0'));var FaxQueue=require(_0x9a6d('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9a6d('0x2')](0x0);var events={'afterCreate':_0x9a6d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x55f62d){return function(_0x1c4dda,_0x3b34db,_0xa06d96){FaxQueueEvents[_0x9a6d('0x4')](_0x55f62d+':'+_0x1c4dda['id'],_0x1c4dda);FaxQueueEvents[_0x9a6d('0x4')](_0x55f62d,_0x1c4dda);_0xa06d96(null);};}for(var e in events){if(events[_0x9a6d('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x9a6d('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x06d1=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x06d1,0x161));var _0x106d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x06d1[_0x334841];return _0x5beb4b;};'use strict';var EventEmitter=require(_0x106d('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x106d('0x1')](0x0);var events={'afterCreate':_0x106d('0x2'),'afterUpdate':_0x106d('0x3'),'afterDestroy':_0x106d('0x4')};function emitEvent(_0xf5192d){return function(_0x4d432e,_0x47083d,_0x2baea4){FaxQueueEvents[_0x106d('0x5')](_0xf5192d+':'+_0x4d432e['id'],_0x4d432e);FaxQueueEvents[_0x106d('0x5')](_0xf5192d,_0x4d432e);_0x2baea4(null);};}for(var e in events){if(events[_0x106d('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x106d('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 968cd31..fe5121f 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 _0x3254=['define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x3e7804,_0x121853){var _0x56efda=function(_0x1996f3){while(--_0x1996f3){_0x3e7804['push'](_0x3e7804['shift']());}};_0x56efda(++_0x121853);}(_0x3254,0xf1));var _0x4325=function(_0x269e84,_0x50a154){_0x269e84=_0x269e84-0x0;var _0x17360a=_0x3254[_0x269e84];return _0x17360a;};'use strict';var _=require(_0x4325('0x0'));var util=require(_0x4325('0x1'));var logger=require(_0x4325('0x2'))(_0x4325('0x3'));var moment=require(_0x4325('0x4'));var BPromise=require(_0x4325('0x5'));var rp=require(_0x4325('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4325('0x7'));var config=require(_0x4325('0x8'));var attributes=require(_0x4325('0x9'));module[_0x4325('0xa')]=function(_0x113e12,_0x545a12){return _0x113e12[_0x4325('0xb')](_0x4325('0xc'),attributes,{'tableName':_0x4325('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe0b=['rimraf','../../config/environment','exports','define','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x14b555,_0xa1805c){var _0x5c5f38=function(_0x1d74db){while(--_0x1d74db){_0x14b555['push'](_0x14b555['shift']());}};_0x5c5f38(++_0xa1805c);}(_0xfe0b,0x89));var _0xbfe0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe0b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbfe0('0x0'));var util=require(_0xbfe0('0x1'));var logger=require(_0xbfe0('0x2'))(_0xbfe0('0x3'));var moment=require('moment');var BPromise=require(_0xbfe0('0x4'));var rp=require(_0xbfe0('0x5'));var fs=require('fs');var path=require(_0xbfe0('0x6'));var rimraf=require(_0xbfe0('0x7'));var config=require(_0xbfe0('0x8'));var attributes=require('./faxQueue.attributes');module[_0xbfe0('0x9')]=function(_0x30213b,_0x188a90){return _0x30213b[_0xbfe0('0xa')]('FaxQueue',attributes,{'tableName':_0xbfe0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 0ee7db7..c9cb373 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 _0xa722=['raw','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','findAll','options','where','limit','include','map','model','attributes','then','FaxQueue','find'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa722,0x7d));var _0x2a72=function(_0x366ce0,_0x4c3fad){_0x366ce0=_0x366ce0-0x0;var _0x5ae1c0=_0xa722[_0x366ce0];return _0x5ae1c0;};'use strict';var _=require(_0x2a72('0x0'));var util=require('util');var moment=require(_0x2a72('0x1'));var BPromise=require(_0x2a72('0x2'));var rs=require(_0x2a72('0x3'));var fs=require('fs');var Redis=require(_0x2a72('0x4'));var db=require(_0x2a72('0x5'))['db'];var utils=require(_0x2a72('0x6'));var logger=require(_0x2a72('0x7'))('rpc');var config=require(_0x2a72('0x8'));var jayson=require(_0x2a72('0x9'));var client=jayson[_0x2a72('0xa')][_0x2a72('0xb')]({'port':0x232a});config[_0x2a72('0xc')]=_[_0x2a72('0xd')](config[_0x2a72('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2a72('0xe'))(new Redis(config[_0x2a72('0xc')]));require('./faxQueue.socket')[_0x2a72('0xf')](socket);function respondWithRpcPromise(_0x31bfe1,_0x4d2912,_0x29bcc8){return new BPromise(function(_0x1bc06f,_0x58bf54){return client[_0x2a72('0x10')](_0x31bfe1,_0x29bcc8)['then'](function(_0x3d960e){logger[_0x2a72('0x11')](_0x2a72('0x12'),_0x4d2912,_0x2a72('0x13'));logger[_0x2a72('0x14')](_0x2a72('0x15'),_0x4d2912,_0x2a72('0x13'),JSON[_0x2a72('0x16')](_0x3d960e));if(_0x3d960e[_0x2a72('0x17')]){if(_0x3d960e[_0x2a72('0x17')][_0x2a72('0x18')]===0x1f4){logger['error'](_0x2a72('0x12'),_0x4d2912,_0x3d960e['error'][_0x2a72('0x19')]);return _0x58bf54(_0x3d960e['error'][_0x2a72('0x19')]);}logger[_0x2a72('0x17')](_0x2a72('0x12'),_0x4d2912,_0x3d960e[_0x2a72('0x17')][_0x2a72('0x19')]);return _0x1bc06f(_0x3d960e[_0x2a72('0x17')]['message']);}else{logger['info'](_0x2a72('0x12'),_0x4d2912,_0x2a72('0x13'));_0x1bc06f(_0x3d960e['result']['message']);}})[_0x2a72('0x1a')](function(_0x4f99e0){logger[_0x2a72('0x17')]('FaxQueue,\x20%s,\x20%s',_0x4d2912,_0x4f99e0);_0x58bf54(_0x4f99e0);});});}exports[_0x2a72('0x1b')]=function(_0x2a2c47){var _0x305a59=this;return new Promise(function(_0x3cace7,_0x1214df){return db['FaxQueue'][_0x2a72('0x1c')]({'raw':_0x2a2c47[_0x2a72('0x1d')]?_0x2a2c47[_0x2a72('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2a2c47[_0x2a72('0x1d')]?_0x2a2c47[_0x2a72('0x1d')][_0x2a72('0x1e')]||null:null,'attributes':_0x2a2c47[_0x2a72('0x1d')]?_0x2a2c47[_0x2a72('0x1d')]['attributes']||null:null,'limit':_0x2a2c47[_0x2a72('0x1d')]?_0x2a2c47[_0x2a72('0x1d')][_0x2a72('0x1f')]||null:null,'include':_0x2a2c47['options']?_0x2a2c47[_0x2a72('0x1d')][_0x2a72('0x20')]?_[_0x2a72('0x21')](_0x2a2c47[_0x2a72('0x1d')][_0x2a72('0x20')],function(_0x585f82){return{'model':db[_0x585f82[_0x2a72('0x22')]],'as':_0x585f82['as'],'attributes':_0x585f82[_0x2a72('0x23')],'include':_0x585f82[_0x2a72('0x20')]?_['map'](_0x585f82[_0x2a72('0x20')],function(_0x464226){return{'model':db[_0x464226[_0x2a72('0x22')]],'as':_0x464226['as'],'attributes':_0x464226[_0x2a72('0x23')],'include':_0x464226['include']?_[_0x2a72('0x21')](_0x464226['include'],function(_0x4d05d7){return{'model':db[_0x4d05d7[_0x2a72('0x22')]],'as':_0x4d05d7['as'],'attributes':_0x4d05d7[_0x2a72('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2a72('0x24')](function(_0x4b967b){logger[_0x2a72('0x11')]('GetFaxQueue',_0x2a2c47);logger['debug']('GetFaxQueue',_0x2a2c47,JSON[_0x2a72('0x16')](_0x4b967b));_0x3cace7(_0x4b967b);})[_0x2a72('0x1a')](function(_0xe60070){logger['error']('GetFaxQueue',_0xe60070[_0x2a72('0x19')],_0x2a2c47);_0x1214df(_0x305a59[_0x2a72('0x17')](0x1f4,_0xe60070[_0x2a72('0x19')]));});});};exports['ShowFaxQueue']=function(_0x574654){var _0x52df0e=this;return new Promise(function(_0x4fecaa,_0x1d73ef){return db[_0x2a72('0x25')][_0x2a72('0x26')]({'raw':_0x574654[_0x2a72('0x1d')]?_0x574654[_0x2a72('0x1d')][_0x2a72('0x27')]===undefined?!![]:![]:!![],'where':_0x574654[_0x2a72('0x1d')]?_0x574654['options'][_0x2a72('0x1e')]||null:null,'attributes':_0x574654[_0x2a72('0x1d')]?_0x574654[_0x2a72('0x1d')][_0x2a72('0x23')]||null:null,'include':_0x574654[_0x2a72('0x1d')]?_0x574654[_0x2a72('0x1d')][_0x2a72('0x20')]?_[_0x2a72('0x21')](_0x574654['options'][_0x2a72('0x20')],function(_0x2a8b1e){return{'model':db[_0x2a8b1e[_0x2a72('0x22')]],'as':_0x2a8b1e['as'],'attributes':_0x2a8b1e[_0x2a72('0x23')],'include':_0x2a8b1e['include']?_['map'](_0x2a8b1e[_0x2a72('0x20')],function(_0x4b6817){return{'model':db[_0x4b6817[_0x2a72('0x22')]],'as':_0x4b6817['as'],'attributes':_0x4b6817['attributes'],'include':_0x4b6817[_0x2a72('0x20')]?_[_0x2a72('0x21')](_0x4b6817[_0x2a72('0x20')],function(_0x54058e){return{'model':db[_0x54058e[_0x2a72('0x22')]],'as':_0x54058e['as'],'attributes':_0x54058e[_0x2a72('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2a72('0x24')](function(_0x1c86bd){logger[_0x2a72('0x11')](_0x2a72('0x28'),_0x574654);logger[_0x2a72('0x14')](_0x2a72('0x28'),_0x574654,JSON['stringify'](_0x1c86bd));_0x4fecaa(_0x1c86bd);})[_0x2a72('0x1a')](function(_0x204dd8){logger[_0x2a72('0x17')]('ShowFaxQueue',_0x204dd8[_0x2a72('0x19')],_0x574654);_0x1d73ef(_0x52df0e['error'](0x1f4,_0x204dd8[_0x2a72('0x19')]));});});}; \ No newline at end of file +var _0x6602=['then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','map','include','model','attributes','info','ShowFaxQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','request'];(function(_0x551ae9,_0x539204){var _0xb0e09c=function(_0x348c04){while(--_0x348c04){_0x551ae9['push'](_0x551ae9['shift']());}};_0xb0e09c(++_0x539204);}(_0x6602,0xf5));var _0x2660=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x6602[_0x307d86];return _0x361745;};'use strict';var _=require(_0x2660('0x0'));var util=require(_0x2660('0x1'));var moment=require(_0x2660('0x2'));var BPromise=require(_0x2660('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2660('0x4'));var db=require(_0x2660('0x5'))['db'];var utils=require(_0x2660('0x6'));var logger=require(_0x2660('0x7'))(_0x2660('0x8'));var config=require(_0x2660('0x9'));var jayson=require(_0x2660('0xa'));var client=jayson[_0x2660('0xb')][_0x2660('0xc')]({'port':0x232a});config['redis']=_[_0x2660('0xd')](config['redis'],{'host':_0x2660('0xe'),'port':0x18eb});var socket=require(_0x2660('0xf'))(new Redis(config[_0x2660('0x10')]));require(_0x2660('0x11'))['register'](socket);function respondWithRpcPromise(_0x109cef,_0x52b00d,_0x2f0309){return new BPromise(function(_0x3769b1,_0x19d1f5){return client[_0x2660('0x12')](_0x109cef,_0x2f0309)[_0x2660('0x13')](function(_0x2a5b4a){logger['info'](_0x2660('0x14'),_0x52b00d,_0x2660('0x15'));logger[_0x2660('0x16')](_0x2660('0x17'),_0x52b00d,_0x2660('0x15'),JSON[_0x2660('0x18')](_0x2a5b4a));if(_0x2a5b4a[_0x2660('0x19')]){if(_0x2a5b4a['error'][_0x2660('0x1a')]===0x1f4){logger[_0x2660('0x19')]('FaxQueue,\x20%s,\x20%s',_0x52b00d,_0x2a5b4a[_0x2660('0x19')]['message']);return _0x19d1f5(_0x2a5b4a[_0x2660('0x19')][_0x2660('0x1b')]);}logger['error'](_0x2660('0x14'),_0x52b00d,_0x2a5b4a[_0x2660('0x19')][_0x2660('0x1b')]);return _0x3769b1(_0x2a5b4a['error'][_0x2660('0x1b')]);}else{logger['info'](_0x2660('0x14'),_0x52b00d,'request\x20sent');_0x3769b1(_0x2a5b4a[_0x2660('0x1c')]['message']);}})[_0x2660('0x1d')](function(_0x390f1a){logger['error'](_0x2660('0x14'),_0x52b00d,_0x390f1a);_0x19d1f5(_0x390f1a);});});}exports[_0x2660('0x1e')]=function(_0x302680){var _0x3661ab=this;return new Promise(function(_0x3b362e,_0x7994c6){return db[_0x2660('0x1f')][_0x2660('0x20')]({'raw':_0x302680[_0x2660('0x21')]?_0x302680[_0x2660('0x21')][_0x2660('0x22')]===undefined?!![]:![]:!![],'where':_0x302680['options']?_0x302680[_0x2660('0x21')][_0x2660('0x23')]||null:null,'attributes':_0x302680[_0x2660('0x21')]?_0x302680[_0x2660('0x21')]['attributes']||null:null,'limit':_0x302680[_0x2660('0x21')]?_0x302680['options'][_0x2660('0x24')]||null:null,'include':_0x302680[_0x2660('0x21')]?_0x302680['options']['include']?_[_0x2660('0x25')](_0x302680['options'][_0x2660('0x26')],function(_0x13b35b){return{'model':db[_0x13b35b[_0x2660('0x27')]],'as':_0x13b35b['as'],'attributes':_0x13b35b[_0x2660('0x28')],'include':_0x13b35b[_0x2660('0x26')]?_[_0x2660('0x25')](_0x13b35b[_0x2660('0x26')],function(_0x3e62b5){return{'model':db[_0x3e62b5[_0x2660('0x27')]],'as':_0x3e62b5['as'],'attributes':_0x3e62b5[_0x2660('0x28')],'include':_0x3e62b5['include']?_[_0x2660('0x25')](_0x3e62b5[_0x2660('0x26')],function(_0x1a325e){return{'model':db[_0x1a325e['model']],'as':_0x1a325e['as'],'attributes':_0x1a325e['attributes']};}):[]};}):[]};}):[]:[]})[_0x2660('0x13')](function(_0x37b064){logger[_0x2660('0x29')](_0x2660('0x1e'),_0x302680);logger['debug']('GetFaxQueue',_0x302680,JSON['stringify'](_0x37b064));_0x3b362e(_0x37b064);})[_0x2660('0x1d')](function(_0x479b0c){logger['error'](_0x2660('0x1e'),_0x479b0c[_0x2660('0x1b')],_0x302680);_0x7994c6(_0x3661ab[_0x2660('0x19')](0x1f4,_0x479b0c[_0x2660('0x1b')]));});});};exports[_0x2660('0x2a')]=function(_0x33a9d6){var _0x283ed6=this;return new Promise(function(_0x58ac04,_0x24bf34){return db['FaxQueue'][_0x2660('0x2b')]({'raw':_0x33a9d6[_0x2660('0x21')]?_0x33a9d6[_0x2660('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x33a9d6[_0x2660('0x21')]?_0x33a9d6[_0x2660('0x21')][_0x2660('0x23')]||null:null,'attributes':_0x33a9d6['options']?_0x33a9d6[_0x2660('0x21')][_0x2660('0x28')]||null:null,'include':_0x33a9d6[_0x2660('0x21')]?_0x33a9d6[_0x2660('0x21')][_0x2660('0x26')]?_[_0x2660('0x25')](_0x33a9d6[_0x2660('0x21')][_0x2660('0x26')],function(_0x13b622){return{'model':db[_0x13b622[_0x2660('0x27')]],'as':_0x13b622['as'],'attributes':_0x13b622['attributes'],'include':_0x13b622[_0x2660('0x26')]?_[_0x2660('0x25')](_0x13b622['include'],function(_0x40da4d){return{'model':db[_0x40da4d[_0x2660('0x27')]],'as':_0x40da4d['as'],'attributes':_0x40da4d[_0x2660('0x28')],'include':_0x40da4d[_0x2660('0x26')]?_['map'](_0x40da4d[_0x2660('0x26')],function(_0x2bf121){return{'model':db[_0x2bf121['model']],'as':_0x2bf121['as'],'attributes':_0x2bf121[_0x2660('0x28')]};}):[]};}):[]};}):[]:[]})[_0x2660('0x13')](function(_0x5630da){logger['info'](_0x2660('0x2a'),_0x33a9d6);logger['debug'](_0x2660('0x2a'),_0x33a9d6,JSON[_0x2660('0x18')](_0x5630da));_0x58ac04(_0x5630da);})[_0x2660('0x1d')](function(_0x19a2a8){logger[_0x2660('0x19')](_0x2660('0x2a'),_0x19a2a8[_0x2660('0x1b')],_0x33a9d6);_0x24bf34(_0x283ed6[_0x2660('0x19')](0x1f4,_0x19a2a8[_0x2660('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 7e63803..cdf3789 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 _0xea81=['emit','removeListener','length','./faxQueue.events','save','remove','update'];(function(_0x4766b7,_0x22d6ea){var _0x570070=function(_0x538546){while(--_0x538546){_0x4766b7['push'](_0x4766b7['shift']());}};_0x570070(++_0x22d6ea);}(_0xea81,0x1ed));var _0x1ea8=function(_0x4fc448,_0x330c23){_0x4fc448=_0x4fc448-0x0;var _0x2018ed=_0xea81[_0x4fc448];return _0x2018ed;};'use strict';var FaxQueueEvents=require(_0x1ea8('0x0'));var events=[_0x1ea8('0x1'),_0x1ea8('0x2'),_0x1ea8('0x3')];function createListener(_0x4dad1f,_0x483fce){return function(_0x3ca664){_0x483fce[_0x1ea8('0x4')](_0x4dad1f,_0x3ca664);};}function removeListener(_0x2e6a47,_0x298375){return function(){FaxQueueEvents[_0x1ea8('0x5')](_0x2e6a47,_0x298375);};}exports['register']=function(_0x486b32){for(var _0x5f4538=0x0,_0x28192b=events[_0x1ea8('0x6')];_0x5f4538<_0x28192b;_0x5f4538++){var _0x43404b=events[_0x5f4538];var _0x2140e8=createListener('faxQueue:'+_0x43404b,_0x486b32);FaxQueueEvents['on'](_0x43404b,_0x2140e8);}}; \ No newline at end of file +var _0xa9f6=['./faxQueue.events','save','remove','update','emit','removeListener','length','faxQueue:'];(function(_0x472c4e,_0x889f6a){var _0x5ab82e=function(_0x11b003){while(--_0x11b003){_0x472c4e['push'](_0x472c4e['shift']());}};_0x5ab82e(++_0x889f6a);}(_0xa9f6,0x198));var _0x6a9f=function(_0x4e6df7,_0x4483fe){_0x4e6df7=_0x4e6df7-0x0;var _0x41cc0a=_0xa9f6[_0x4e6df7];return _0x41cc0a;};'use strict';var FaxQueueEvents=require(_0x6a9f('0x0'));var events=[_0x6a9f('0x1'),_0x6a9f('0x2'),_0x6a9f('0x3')];function createListener(_0x3c9a47,_0x3f0b07){return function(_0x32d6d){_0x3f0b07[_0x6a9f('0x4')](_0x3c9a47,_0x32d6d);};}function removeListener(_0xb04c46,_0x371c90){return function(){FaxQueueEvents[_0x6a9f('0x5')](_0xb04c46,_0x371c90);};}exports['register']=function(_0x4afc54){for(var _0x257a41=0x0,_0x2108ab=events[_0x6a9f('0x6')];_0x257a41<_0x2108ab;_0x257a41++){var _0x134f9c=events[_0x257a41];var _0x59292a=createListener(_0x6a9f('0x7')+_0x134f9c,_0x4afc54);FaxQueueEvents['on'](_0x134f9c,_0x59292a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4ff1908..8926b75 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 _0x4c60=['destroy','multer','util','path','connect-timeout','Router','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete'];(function(_0x5796d1,_0x135f9f){var _0x343f42=function(_0x5b1c1e){while(--_0x5b1c1e){_0x5796d1['push'](_0x5796d1['shift']());}};_0x343f42(++_0x135f9f);}(_0x4c60,0xc1));var _0x04c6=function(_0x3e63bd,_0x35bfd5){_0x3e63bd=_0x3e63bd-0x0;var _0x3ff03e=_0x4c60[_0x3e63bd];return _0x3ff03e;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['describe']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x04c6('0xc')]);router['get'](_0x04c6('0xd'),auth[_0x04c6('0x7')](),controller['getTeams']);router[_0x04c6('0x6')](_0x04c6('0xe'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xf')]);router['post']('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x10')]);router[_0x04c6('0x11')]('/:id/teams',auth[_0x04c6('0x7')](),controller[_0x04c6('0x12')]);router[_0x04c6('0x11')](_0x04c6('0xe'),auth[_0x04c6('0x7')](),controller[_0x04c6('0x13')]);router[_0x04c6('0x14')](_0x04c6('0xa'),auth['isAuthenticated'](),controller[_0x04c6('0x15')]);router[_0x04c6('0x16')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0x17')]);router[_0x04c6('0x16')](_0x04c6('0xd'),auth[_0x04c6('0x7')](),controller['removeTeams']);router[_0x04c6('0x16')](_0x04c6('0xe'),auth[_0x04c6('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6b1b=['../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','/:id','destroy','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x6b1b[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require('multer');var util=require(_0xb6b1('0x0'));var path=require(_0xb6b1('0x1'));var timeout=require(_0xb6b1('0x2'));var express=require('express');var router=express[_0xb6b1('0x3')]();var fs_extra=require(_0xb6b1('0x4'));var auth=require(_0xb6b1('0x5'));var interaction=require(_0xb6b1('0x6'));var config=require(_0xb6b1('0x7'));var controller=require(_0xb6b1('0x8'));router[_0xb6b1('0x9')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0xb')]);router[_0xb6b1('0x9')](_0xb6b1('0xc'),auth['isAuthenticated'](),controller[_0xb6b1('0xd')]);router['get']('/:id',auth[_0xb6b1('0xa')](),controller['show']);router[_0xb6b1('0x9')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get'](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller['getTeams']);router[_0xb6b1('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xb6b1('0xf')]);router[_0xb6b1('0x10')]('/',auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x11')]);router[_0xb6b1('0x10')](_0xb6b1('0xe'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x12')]);router[_0xb6b1('0x10')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb6b1('0x15')](_0xb6b1('0x16'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x17')]);router[_0xb6b1('0x15')](_0xb6b1('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xb6b1('0x15')](_0xb6b1('0x13'),auth[_0xb6b1('0xa')](),controller[_0xb6b1('0x18')]);module[_0xb6b1('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index ce114e9..0aff256 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 _0xa647=['sequelize','exports','STRING','DATE','moment'];(function(_0xc7eea8,_0x594de2){var _0x2314ca=function(_0x1a7f00){while(--_0x1a7f00){_0xc7eea8['push'](_0xc7eea8['shift']());}};_0x2314ca(++_0x594de2);}(_0xa647,0x81));var _0x7a64=function(_0x56d416,_0x4cb657){_0x56d416=_0x56d416-0x0;var _0xfefa2c=_0xa647[_0x56d416];return _0xfefa2c;};'use strict';var moment=require(_0x7a64('0x0'));var Sequelize=require(_0x7a64('0x1'));module[_0x7a64('0x2')]={'uniqueid':{'type':Sequelize[_0x7a64('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7a64('0x3')]},'joinAt':{'type':Sequelize[_0x7a64('0x4')]},'leaveAt':{'type':Sequelize[_0x7a64('0x4')]},'acceptAt':{'type':Sequelize[_0x7a64('0x4')]},'exitAt':{'type':Sequelize[_0x7a64('0x4')]},'reason':{'type':Sequelize[_0x7a64('0x3')]}}; \ No newline at end of file +var _0x8d56=['DATE','moment','sequelize','exports','STRING'];(function(_0x41b29e,_0x34b288){var _0xacd517=function(_0x3318df){while(--_0x3318df){_0x41b29e['push'](_0x41b29e['shift']());}};_0xacd517(++_0x34b288);}(_0x8d56,0x1c3));var _0x68d5=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x8d56[_0x4f34d8];return _0xc97536;};'use strict';var moment=require(_0x68d5('0x0'));var Sequelize=require(_0x68d5('0x1'));module[_0x68d5('0x2')]={'uniqueid':{'type':Sequelize[_0x68d5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x68d5('0x3')]},'joinAt':{'type':Sequelize[_0x68d5('0x4')]},'leaveAt':{'type':Sequelize[_0x68d5('0x4')]},'acceptAt':{'type':Sequelize[_0x68d5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x68d5('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e1cf404..4a8187d 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 _0x4ea3=['Content-Range','reject','save','update','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','fields','query','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','FaxQueueReport','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x450b40,_0x171b2f){var _0x2ae896=function(_0x49f753){while(--_0x49f753){_0x450b40['push'](_0x450b40['shift']());}};_0x2ae896(++_0x171b2f);}(_0x4ea3,0x70));var _0x34ea=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4ea3[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x34ea('0x0'));var rimraf=require(_0x34ea('0x1'));var zipdir=require(_0x34ea('0x2'));var jsonpatch=require(_0x34ea('0x3'));var rp=require('request-promise');var moment=require(_0x34ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x34ea('0x5'));var util=require('util');var path=require('path');var sox=require(_0x34ea('0x6'));var csv=require(_0x34ea('0x7'));var ejs=require(_0x34ea('0x8'));var fs=require('fs');var fs_extra=require(_0x34ea('0x9'));var _=require(_0x34ea('0xa'));var squel=require(_0x34ea('0xb'));var crypto=require(_0x34ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x34ea('0xd'));var toCsv=require(_0x34ea('0x7'));var querystring=require(_0x34ea('0xe'));var Papa=require('papaparse');var Redis=require(_0x34ea('0xf'));var authService=require(_0x34ea('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34ea('0x11'));var logger=require(_0x34ea('0x12'))(_0x34ea('0x13'));var utils=require('../../config/utils');var config=require(_0x34ea('0x14'));var licenseUtil=require(_0x34ea('0x15'));var db=require(_0x34ea('0x16'))['db'];function respondWithStatusCode(_0x233b11,_0x60725f){_0x60725f=_0x60725f||0xcc;return function(_0xc56a7d){if(_0xc56a7d){return _0x233b11[_0x34ea('0x17')](_0x60725f);}return _0x233b11[_0x34ea('0x18')](_0x60725f)[_0x34ea('0x19')]();};}function respondWithResult(_0x2a19c6,_0x36a4c6){_0x36a4c6=_0x36a4c6||0xc8;return function(_0x5ef9ae){if(_0x5ef9ae){return _0x2a19c6[_0x34ea('0x18')](_0x36a4c6)[_0x34ea('0x1a')](_0x5ef9ae);}};}function respondWithFilteredResult(_0x14ebb9,_0x3f9ffe){return function(_0x44e44e){if(_0x44e44e){var _0x56b2d7=typeof _0x3f9ffe[_0x34ea('0x1b')]===_0x34ea('0x1c')&&typeof _0x3f9ffe[_0x34ea('0x1d')]===_0x34ea('0x1c');var _0x5f420f=_0x44e44e[_0x34ea('0x1e')];var _0x34caea=_0x56b2d7?0x0:_0x3f9ffe[_0x34ea('0x1b')];var _0x5340a4=_0x56b2d7?_0x44e44e[_0x34ea('0x1e')]:_0x3f9ffe[_0x34ea('0x1b')]+_0x3f9ffe[_0x34ea('0x1d')];var _0x127308;if(_0x5340a4>=_0x5f420f){_0x5340a4=_0x5f420f;_0x127308=0xc8;}else{_0x127308=0xce;}_0x14ebb9['status'](_0x127308);return _0x14ebb9[_0x34ea('0x1f')](_0x34ea('0x20'),_0x34caea+'-'+_0x5340a4+'/'+_0x5f420f)[_0x34ea('0x1a')](_0x44e44e);}return null;};}function patchUpdates(_0x247ee7){return function(_0x4fc1a2){try{jsonpatch['apply'](_0x4fc1a2,_0x247ee7,!![]);}catch(_0xe3b292){return BPromise[_0x34ea('0x21')](_0xe3b292);}return _0x4fc1a2[_0x34ea('0x22')]();};}function saveUpdates(_0x51022f,_0x5197a2){return function(_0x2eafc6){if(_0x2eafc6){return _0x2eafc6[_0x34ea('0x23')](_0x51022f)[_0x34ea('0x24')](function(_0x30c4b0){return _0x30c4b0;});}return null;};}function removeEntity(_0x12e7e9,_0x697475){return function(_0x5ade46){if(_0x5ade46){return _0x5ade46[_0x34ea('0x25')]()[_0x34ea('0x24')](function(){_0x12e7e9[_0x34ea('0x18')](0xcc)[_0x34ea('0x19')]();});}};}function handleEntityNotFound(_0x5b5885,_0x56f320){return function(_0x564d1b){if(!_0x564d1b){_0x5b5885[_0x34ea('0x17')](0x194);}return _0x564d1b;};}function handleError(_0x187306,_0x37c214){_0x37c214=_0x37c214||0x1f4;return function(_0x4204d7){logger['error'](_0x4204d7[_0x34ea('0x26')]);if(_0x4204d7[_0x34ea('0x27')]){delete _0x4204d7[_0x34ea('0x27')];}_0x187306['status'](_0x37c214)['send'](_0x4204d7);};}exports['index']=function(_0x4d4360,_0x2942ce){var _0x6227db={},_0x859b7e={},_0x162081={'count':0x0,'rows':[]};var _0x56c9dd=_[_0x34ea('0x28')](db['FaxQueueReport'][_0x34ea('0x29')],function(_0x4f2b77){return{'name':_0x4f2b77[_0x34ea('0x2a')],'type':_0x4f2b77[_0x34ea('0x2b')][_0x34ea('0x2c')]};});_0x859b7e['model']=_[_0x34ea('0x28')](_0x56c9dd,_0x34ea('0x27'));_0x859b7e['query']=_[_0x34ea('0x2d')](_0x4d4360['query']);_0x859b7e[_0x34ea('0x2e')]=_[_0x34ea('0x2f')](_0x859b7e[_0x34ea('0x30')],_0x859b7e['query']);_0x6227db['attributes']=_[_0x34ea('0x2f')](_0x859b7e['model'],qs[_0x34ea('0x31')](_0x4d4360[_0x34ea('0x32')]['fields']));_0x6227db[_0x34ea('0x33')]=_0x6227db[_0x34ea('0x33')][_0x34ea('0x34')]?_0x6227db[_0x34ea('0x33')]:_0x859b7e['model'];if(!_0x4d4360['query']['hasOwnProperty'](_0x34ea('0x35'))){_0x6227db[_0x34ea('0x1d')]=qs[_0x34ea('0x1d')](_0x4d4360['query']['limit']);_0x6227db['offset']=qs[_0x34ea('0x1b')](_0x4d4360[_0x34ea('0x32')]['offset']);}_0x6227db[_0x34ea('0x36')]=qs[_0x34ea('0x37')](_0x4d4360[_0x34ea('0x32')][_0x34ea('0x37')]);_0x6227db[_0x34ea('0x38')]=qs[_0x34ea('0x2e')](_['pick'](_0x4d4360[_0x34ea('0x32')],_0x859b7e[_0x34ea('0x2e')]),_0x56c9dd);if(_0x4d4360[_0x34ea('0x32')][_0x34ea('0x39')]){_0x6227db['where']=_['merge'](_0x6227db[_0x34ea('0x38')],{'$or':_[_0x34ea('0x28')](_0x56c9dd,function(_0xf39615){if(_0xf39615[_0x34ea('0x2b')]!==_0x34ea('0x3a')){var _0x4c696f={};_0x4c696f[_0xf39615[_0x34ea('0x27')]]={'$like':'%'+_0x4d4360[_0x34ea('0x32')][_0x34ea('0x39')]+'%'};return _0x4c696f;}})});}_0x6227db=_[_0x34ea('0x3b')]({},_0x6227db,_0x4d4360[_0x34ea('0x3c')]);var _0x4743f1={'where':_0x6227db[_0x34ea('0x38')]};return db[_0x34ea('0x3d')][_0x34ea('0x1e')](_0x4743f1)[_0x34ea('0x24')](function(_0x448bc0){_0x162081[_0x34ea('0x1e')]=_0x448bc0;if(_0x4d4360[_0x34ea('0x32')][_0x34ea('0x3e')]){_0x6227db[_0x34ea('0x3f')]=[{'all':!![]}];}return db[_0x34ea('0x3d')]['findAll'](_0x6227db);})[_0x34ea('0x24')](function(_0x4ae353){_0x162081[_0x34ea('0x40')]=_0x4ae353;return _0x162081;})[_0x34ea('0x24')](respondWithFilteredResult(_0x2942ce,_0x6227db))[_0x34ea('0x41')](handleError(_0x2942ce,null));};exports[_0x34ea('0x42')]=function(_0x2a57b5,_0x1b785b){var _0x35d81d={'raw':!![],'where':{'id':_0x2a57b5[_0x34ea('0x43')]['id']}},_0x17ba01={};_0x17ba01['model']=_[_0x34ea('0x2d')](db['FaxQueueReport'][_0x34ea('0x29')]);_0x17ba01[_0x34ea('0x32')]=_[_0x34ea('0x2d')](_0x2a57b5[_0x34ea('0x32')]);_0x17ba01[_0x34ea('0x2e')]=_[_0x34ea('0x2f')](_0x17ba01['model'],_0x17ba01[_0x34ea('0x32')]);_0x35d81d[_0x34ea('0x33')]=_['intersection'](_0x17ba01[_0x34ea('0x30')],qs[_0x34ea('0x31')](_0x2a57b5[_0x34ea('0x32')][_0x34ea('0x31')]));_0x35d81d[_0x34ea('0x33')]=_0x35d81d['attributes'][_0x34ea('0x34')]?_0x35d81d[_0x34ea('0x33')]:_0x17ba01[_0x34ea('0x30')];if(_0x2a57b5[_0x34ea('0x32')][_0x34ea('0x3e')]){_0x35d81d[_0x34ea('0x3f')]=[{'all':!![]}];}_0x35d81d=_['merge']({},_0x35d81d,_0x2a57b5['options']);return db[_0x34ea('0x3d')][_0x34ea('0x44')](_0x35d81d)[_0x34ea('0x24')](handleEntityNotFound(_0x1b785b,null))['then'](respondWithResult(_0x1b785b,null))[_0x34ea('0x41')](handleError(_0x1b785b,null));};exports['create']=function(_0x16e9b7,_0x4cc586){return db[_0x34ea('0x3d')][_0x34ea('0x45')](_0x16e9b7[_0x34ea('0x46')],{})['then'](respondWithResult(_0x4cc586,0xc9))[_0x34ea('0x41')](handleError(_0x4cc586,null));};exports['update']=function(_0x404a59,_0x3fb739){if(_0x404a59[_0x34ea('0x46')]['id']){delete _0x404a59[_0x34ea('0x46')]['id'];}return db['FaxQueueReport'][_0x34ea('0x44')]({'where':{'id':_0x404a59[_0x34ea('0x43')]['id']}})[_0x34ea('0x24')](handleEntityNotFound(_0x3fb739,null))[_0x34ea('0x24')](saveUpdates(_0x404a59[_0x34ea('0x46')],null))[_0x34ea('0x24')](respondWithResult(_0x3fb739,null))[_0x34ea('0x41')](handleError(_0x3fb739,null));};exports['destroy']=function(_0x1059dc,_0x224c53){return db[_0x34ea('0x3d')][_0x34ea('0x44')]({'where':{'id':_0x1059dc[_0x34ea('0x43')]['id']}})[_0x34ea('0x24')](handleEntityNotFound(_0x224c53,null))[_0x34ea('0x24')](removeEntity(_0x224c53,null))[_0x34ea('0x41')](handleError(_0x224c53,null));};exports[_0x34ea('0x47')]=function(_0x3a1546,_0x2b8990){return db[_0x34ea('0x3d')][_0x34ea('0x47')]()['then'](respondWithResult(_0x2b8990,null))[_0x34ea('0x41')](handleError(_0x2b8990,null));}; \ No newline at end of file +var _0x22dd=['findAll','catch','params','attributes','include','find','create','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','FaxQueueReport','count','includeAll'];(function(_0x67143c,_0x433024){var _0x1dbbc3=function(_0x35a77f){while(--_0x35a77f){_0x67143c['push'](_0x67143c['shift']());}};_0x1dbbc3(++_0x433024);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd22d('0x0'));var rimraf=require(_0xd22d('0x1'));var zipdir=require(_0xd22d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd22d('0x3'));var BPromise=require(_0xd22d('0x4'));var Mustache=require(_0xd22d('0x5'));var util=require(_0xd22d('0x6'));var path=require(_0xd22d('0x7'));var sox=require(_0xd22d('0x8'));var csv=require(_0xd22d('0x9'));var ejs=require(_0xd22d('0xa'));var fs=require('fs');var fs_extra=require(_0xd22d('0xb'));var _=require(_0xd22d('0xc'));var squel=require('squel');var crypto=require(_0xd22d('0xd'));var jsforce=require(_0xd22d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd22d('0x9'));var querystring=require('querystring');var Papa=require(_0xd22d('0xf'));var Redis=require('ioredis');var authService=require(_0xd22d('0x10'));var qs=require(_0xd22d('0x11'));var as=require(_0xd22d('0x12'));var hardwareService=require(_0xd22d('0x13'));var logger=require(_0xd22d('0x14'))(_0xd22d('0x15'));var utils=require(_0xd22d('0x16'));var config=require(_0xd22d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd22d('0x18'))['db'];function respondWithStatusCode(_0x46f164,_0x51a8ea){_0x51a8ea=_0x51a8ea||0xcc;return function(_0x38978b){if(_0x38978b){return _0x46f164[_0xd22d('0x19')](_0x51a8ea);}return _0x46f164['status'](_0x51a8ea)['end']();};}function respondWithResult(_0x5994fe,_0x156546){_0x156546=_0x156546||0xc8;return function(_0x5dc338){if(_0x5dc338){return _0x5994fe[_0xd22d('0x1a')](_0x156546)['json'](_0x5dc338);}};}function respondWithFilteredResult(_0x78d93e,_0x5b91bd){return function(_0x5027d){if(_0x5027d){var _0x377e75=typeof _0x5b91bd['offset']===_0xd22d('0x1b')&&typeof _0x5b91bd[_0xd22d('0x1c')]===_0xd22d('0x1b');var _0x11c410=_0x5027d['count'];var _0x5c516a=_0x377e75?0x0:_0x5b91bd[_0xd22d('0x1d')];var _0x5a0a0b=_0x377e75?_0x5027d['count']:_0x5b91bd['offset']+_0x5b91bd[_0xd22d('0x1c')];var _0x46f8b6;if(_0x5a0a0b>=_0x11c410){_0x5a0a0b=_0x11c410;_0x46f8b6=0xc8;}else{_0x46f8b6=0xce;}_0x78d93e[_0xd22d('0x1a')](_0x46f8b6);return _0x78d93e[_0xd22d('0x1e')](_0xd22d('0x1f'),_0x5c516a+'-'+_0x5a0a0b+'/'+_0x11c410)['json'](_0x5027d);}return null;};}function patchUpdates(_0x2bfc84){return function(_0x4e18f5){try{jsonpatch['apply'](_0x4e18f5,_0x2bfc84,!![]);}catch(_0x478c1f){return BPromise[_0xd22d('0x20')](_0x478c1f);}return _0x4e18f5[_0xd22d('0x21')]();};}function saveUpdates(_0x1ecab6,_0x420836){return function(_0x1be46f){if(_0x1be46f){return _0x1be46f[_0xd22d('0x22')](_0x1ecab6)[_0xd22d('0x23')](function(_0x52039a){return _0x52039a;});}return null;};}function removeEntity(_0x3b07b3,_0x8340e5){return function(_0x55bce9){if(_0x55bce9){return _0x55bce9['destroy']()[_0xd22d('0x23')](function(){_0x3b07b3[_0xd22d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0959,_0x370902){return function(_0xee8f2){if(!_0xee8f2){_0x2b0959[_0xd22d('0x19')](0x194);}return _0xee8f2;};}function handleError(_0x2b47c2,_0x2c7b5a){_0x2c7b5a=_0x2c7b5a||0x1f4;return function(_0x2d45ab){logger[_0xd22d('0x24')](_0x2d45ab[_0xd22d('0x25')]);if(_0x2d45ab['name']){delete _0x2d45ab[_0xd22d('0x26')];}_0x2b47c2[_0xd22d('0x1a')](_0x2c7b5a)['send'](_0x2d45ab);};}exports[_0xd22d('0x27')]=function(_0x5f00f9,_0x5381a8){var _0x2d377d={},_0x96a17e={},_0xb3e1f2={'count':0x0,'rows':[]};var _0x16b1c7=_[_0xd22d('0x28')](db['FaxQueueReport'][_0xd22d('0x29')],function(_0x5b47f9){return{'name':_0x5b47f9[_0xd22d('0x2a')],'type':_0x5b47f9[_0xd22d('0x2b')][_0xd22d('0x2c')]};});_0x96a17e[_0xd22d('0x2d')]=_[_0xd22d('0x28')](_0x16b1c7,'name');_0x96a17e[_0xd22d('0x2e')]=_[_0xd22d('0x2f')](_0x5f00f9['query']);_0x96a17e[_0xd22d('0x30')]=_['intersection'](_0x96a17e[_0xd22d('0x2d')],_0x96a17e[_0xd22d('0x2e')]);_0x2d377d['attributes']=_[_0xd22d('0x31')](_0x96a17e[_0xd22d('0x2d')],qs[_0xd22d('0x32')](_0x5f00f9['query'][_0xd22d('0x32')]));_0x2d377d['attributes']=_0x2d377d['attributes'][_0xd22d('0x33')]?_0x2d377d['attributes']:_0x96a17e[_0xd22d('0x2d')];if(!_0x5f00f9['query'][_0xd22d('0x34')](_0xd22d('0x35'))){_0x2d377d['limit']=qs['limit'](_0x5f00f9[_0xd22d('0x2e')][_0xd22d('0x1c')]);_0x2d377d[_0xd22d('0x1d')]=qs[_0xd22d('0x1d')](_0x5f00f9[_0xd22d('0x2e')][_0xd22d('0x1d')]);}_0x2d377d[_0xd22d('0x36')]=qs['sort'](_0x5f00f9['query'][_0xd22d('0x37')]);_0x2d377d[_0xd22d('0x38')]=qs['filters'](_[_0xd22d('0x39')](_0x5f00f9[_0xd22d('0x2e')],_0x96a17e['filters']),_0x16b1c7);if(_0x5f00f9['query']['filter']){_0x2d377d[_0xd22d('0x38')]=_[_0xd22d('0x3a')](_0x2d377d[_0xd22d('0x38')],{'$or':_['map'](_0x16b1c7,function(_0x3d9dfa){if(_0x3d9dfa['type']!=='VIRTUAL'){var _0x1ad490={};_0x1ad490[_0x3d9dfa[_0xd22d('0x26')]]={'$like':'%'+_0x5f00f9['query'][_0xd22d('0x3b')]+'%'};return _0x1ad490;}})});}_0x2d377d=_[_0xd22d('0x3a')]({},_0x2d377d,_0x5f00f9[_0xd22d('0x3c')]);var _0x5c1876={'where':_0x2d377d[_0xd22d('0x38')]};return db[_0xd22d('0x3d')][_0xd22d('0x3e')](_0x5c1876)[_0xd22d('0x23')](function(_0x332830){_0xb3e1f2[_0xd22d('0x3e')]=_0x332830;if(_0x5f00f9[_0xd22d('0x2e')][_0xd22d('0x3f')]){_0x2d377d['include']=[{'all':!![]}];}return db[_0xd22d('0x3d')][_0xd22d('0x40')](_0x2d377d);})[_0xd22d('0x23')](function(_0x1c5007){_0xb3e1f2['rows']=_0x1c5007;return _0xb3e1f2;})[_0xd22d('0x23')](respondWithFilteredResult(_0x5381a8,_0x2d377d))[_0xd22d('0x41')](handleError(_0x5381a8,null));};exports['show']=function(_0x1dea34,_0x360026){var _0x111e84={'raw':!![],'where':{'id':_0x1dea34[_0xd22d('0x42')]['id']}},_0x9ecd41={};_0x9ecd41[_0xd22d('0x2d')]=_[_0xd22d('0x2f')](db['FaxQueueReport'][_0xd22d('0x29')]);_0x9ecd41['query']=_[_0xd22d('0x2f')](_0x1dea34[_0xd22d('0x2e')]);_0x9ecd41[_0xd22d('0x30')]=_[_0xd22d('0x31')](_0x9ecd41['model'],_0x9ecd41[_0xd22d('0x2e')]);_0x111e84[_0xd22d('0x43')]=_['intersection'](_0x9ecd41[_0xd22d('0x2d')],qs[_0xd22d('0x32')](_0x1dea34[_0xd22d('0x2e')]['fields']));_0x111e84[_0xd22d('0x43')]=_0x111e84[_0xd22d('0x43')][_0xd22d('0x33')]?_0x111e84[_0xd22d('0x43')]:_0x9ecd41[_0xd22d('0x2d')];if(_0x1dea34['query'][_0xd22d('0x3f')]){_0x111e84[_0xd22d('0x44')]=[{'all':!![]}];}_0x111e84=_[_0xd22d('0x3a')]({},_0x111e84,_0x1dea34[_0xd22d('0x3c')]);return db[_0xd22d('0x3d')][_0xd22d('0x45')](_0x111e84)[_0xd22d('0x23')](handleEntityNotFound(_0x360026,null))['then'](respondWithResult(_0x360026,null))[_0xd22d('0x41')](handleError(_0x360026,null));};exports[_0xd22d('0x46')]=function(_0x2cbd41,_0x1ec1ec){return db[_0xd22d('0x3d')]['create'](_0x2cbd41[_0xd22d('0x47')],{})[_0xd22d('0x23')](respondWithResult(_0x1ec1ec,0xc9))[_0xd22d('0x41')](handleError(_0x1ec1ec,null));};exports[_0xd22d('0x22')]=function(_0x1ac8e9,_0x1330c1){if(_0x1ac8e9[_0xd22d('0x47')]['id']){delete _0x1ac8e9['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x1ac8e9[_0xd22d('0x42')]['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x1330c1,null))['then'](saveUpdates(_0x1ac8e9[_0xd22d('0x47')],null))[_0xd22d('0x23')](respondWithResult(_0x1330c1,null))[_0xd22d('0x41')](handleError(_0x1330c1,null));};exports[_0xd22d('0x48')]=function(_0x125b86,_0x463384){return db['FaxQueueReport'][_0xd22d('0x45')]({'where':{'id':_0x125b86['params']['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x463384,null))[_0xd22d('0x23')](removeEntity(_0x463384,null))[_0xd22d('0x41')](handleError(_0x463384,null));};exports['describe']=function(_0x2f0375,_0x43df58){return db['FaxQueueReport']['describe']()[_0xd22d('0x23')](respondWithResult(_0x43df58,null))[_0xd22d('0x41')](handleError(_0x43df58,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 6aa7400..6f3b77f 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x1cb9,0x14e));var _0x91cb=function(_0x509d1a,_0x31efda){_0x509d1a=_0x509d1a-0x0;var _0x4f7d7b=_0x1cb9[_0x509d1a];return _0x4f7d7b;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0x49c824,_0x18e9be){var _0x29dc99=function(_0x1b1080){while(--_0x1b1080){_0x49c824['push'](_0x49c824['shift']());}};_0x29dc99(++_0x18e9be);}(_0x7217,0x19e));var _0x7721=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x7217[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[{'name':_0x7721('0xc'),'fields':[_0x7721('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 9191dd9..2dfbe9a 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 _0x6fde=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0xc47f48,_0x57254a){var _0x5e4f71=function(_0x252225){while(--_0x252225){_0xc47f48['push'](_0xc47f48['shift']());}};_0x5e4f71(++_0x57254a);}(_0x6fde,0x1d6));var _0xe6fd=function(_0x458dcc,_0x2c3c3b){_0x458dcc=_0x458dcc-0x0;var _0x510bcf=_0x6fde[_0x458dcc];return _0x510bcf;};'use strict';var _=require(_0xe6fd('0x0'));var util=require(_0xe6fd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6fd('0x2'))['db'];var utils=require(_0xe6fd('0x3'));var logger=require(_0xe6fd('0x4'))(_0xe6fd('0x5'));var config=require('../../config/environment');var jayson=require(_0xe6fd('0x6'));var client=jayson[_0xe6fd('0x7')][_0xe6fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4795e2,_0x22bf0d,_0x419b6d){return new BPromise(function(_0x4a0798,_0x29905b){return client['request'](_0x4795e2,_0x419b6d)[_0xe6fd('0x9')](function(_0x2b7857){logger[_0xe6fd('0xa')](_0xe6fd('0xb'),_0x22bf0d,_0xe6fd('0xc'));logger[_0xe6fd('0xd')](_0xe6fd('0xe'),_0x22bf0d,_0xe6fd('0xc'),JSON[_0xe6fd('0xf')](_0x2b7857));if(_0x2b7857[_0xe6fd('0x10')]){if(_0x2b7857[_0xe6fd('0x10')]['code']===0x1f4){logger['error'](_0xe6fd('0xb'),_0x22bf0d,_0x2b7857[_0xe6fd('0x10')][_0xe6fd('0x11')]);return _0x29905b(_0x2b7857[_0xe6fd('0x10')][_0xe6fd('0x11')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x22bf0d,_0x2b7857[_0xe6fd('0x10')][_0xe6fd('0x11')]);return _0x4a0798(_0x2b7857[_0xe6fd('0x10')]['message']);}else{logger['info'](_0xe6fd('0xb'),_0x22bf0d,_0xe6fd('0xc'));_0x4a0798(_0x2b7857[_0xe6fd('0x12')][_0xe6fd('0x11')]);}})[_0xe6fd('0x13')](function(_0x2466ef){logger[_0xe6fd('0x10')](_0xe6fd('0xb'),_0x22bf0d,_0x2466ef);_0x29905b(_0x2466ef);});});}exports[_0xe6fd('0x14')]=function(_0x366485){var _0x122b7e=this;return new Promise(function(_0x58dc62,_0x24ea1b){return db[_0xe6fd('0x15')]['create'](_0x366485[_0xe6fd('0x16')],{'raw':_0x366485[_0xe6fd('0x17')]?_0x366485[_0xe6fd('0x17')][_0xe6fd('0x18')]===undefined?!![]:![]:!![]})[_0xe6fd('0x9')](function(_0x2a3f7e){logger[_0xe6fd('0xa')](_0xe6fd('0x14'),_0x366485);logger[_0xe6fd('0xd')]('CreateFaxQueueReport',_0x366485,JSON[_0xe6fd('0xf')](_0x2a3f7e));_0x58dc62(_0x2a3f7e);})[_0xe6fd('0x13')](function(_0x87d8f3){logger['error'](_0xe6fd('0x14'),_0x87d8f3['message'],_0x366485);_0x24ea1b(_0x122b7e['error'](0x1f4,_0x87d8f3[_0xe6fd('0x11')]));});});};exports[_0xe6fd('0x19')]=function(_0xec6bf3){var _0x5912bc=this;return new Promise(function(_0x2f8e05,_0x598b72){return db[_0xe6fd('0x15')][_0xe6fd('0x1a')](_0xec6bf3[_0xe6fd('0x16')],{'raw':_0xec6bf3[_0xe6fd('0x17')]?_0xec6bf3[_0xe6fd('0x17')][_0xe6fd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xec6bf3[_0xe6fd('0x17')]?_0xec6bf3[_0xe6fd('0x17')][_0xe6fd('0x1b')]||null:null,'attributes':_0xec6bf3[_0xe6fd('0x17')]?_0xec6bf3['options'][_0xe6fd('0x1c')]||null:null,'limit':_0xec6bf3[_0xe6fd('0x17')]?_0xec6bf3['options'][_0xe6fd('0x1d')]||null:null})[_0xe6fd('0x9')](function(_0x3ab1a1){logger[_0xe6fd('0xa')](_0xe6fd('0x19'),_0xec6bf3);logger[_0xe6fd('0xd')](_0xe6fd('0x19'),_0xec6bf3,JSON[_0xe6fd('0xf')](_0x3ab1a1));_0x2f8e05(_0x3ab1a1);})['catch'](function(_0x3ba65b){logger[_0xe6fd('0x10')]('UpdateFaxQueueReport',_0x3ba65b[_0xe6fd('0x11')],_0xec6bf3);_0x598b72(_0x5912bc[_0xe6fd('0x10')](0x1f4,_0x3ba65b[_0xe6fd('0x11')]));});});}; \ No newline at end of file +var _0xdfb5=['request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','FaxQueueReport','create','options','CreateFaxQueueReport','update','body','raw','where','attributes','limit','UpdateFaxQueueReport','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x40216e,_0x50106c){var _0x46aa0d=function(_0x1f8e4d){while(--_0x1f8e4d){_0x40216e['push'](_0x40216e['shift']());}};_0x46aa0d(++_0x50106c);}(_0xdfb5,0xfe));var _0x5dfb=function(_0x7d62b0,_0x1cada3){_0x7d62b0=_0x7d62b0-0x0;var _0x22d8be=_0xdfb5[_0x7d62b0];return _0x22d8be;};'use strict';var _=require(_0x5dfb('0x0'));var util=require(_0x5dfb('0x1'));var moment=require('moment');var BPromise=require(_0x5dfb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dfb('0x3'));var db=require(_0x5dfb('0x4'))['db'];var utils=require(_0x5dfb('0x5'));var logger=require('../../config/logger')(_0x5dfb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5dfb('0x7'));var client=jayson[_0x5dfb('0x8')][_0x5dfb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d8cc3,_0x486883,_0x12d49c){return new BPromise(function(_0x2cdcb6,_0x31ca3d){return client[_0x5dfb('0xa')](_0x4d8cc3,_0x12d49c)[_0x5dfb('0xb')](function(_0x4f6c61){logger[_0x5dfb('0xc')](_0x5dfb('0xd'),_0x486883,'request\x20sent');logger[_0x5dfb('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x486883,_0x5dfb('0xf'),JSON['stringify'](_0x4f6c61));if(_0x4f6c61[_0x5dfb('0x10')]){if(_0x4f6c61[_0x5dfb('0x10')][_0x5dfb('0x11')]===0x1f4){logger[_0x5dfb('0x10')](_0x5dfb('0xd'),_0x486883,_0x4f6c61[_0x5dfb('0x10')][_0x5dfb('0x12')]);return _0x31ca3d(_0x4f6c61[_0x5dfb('0x10')]['message']);}logger[_0x5dfb('0x10')](_0x5dfb('0xd'),_0x486883,_0x4f6c61['error'][_0x5dfb('0x12')]);return _0x2cdcb6(_0x4f6c61[_0x5dfb('0x10')]['message']);}else{logger[_0x5dfb('0xc')](_0x5dfb('0xd'),_0x486883,_0x5dfb('0xf'));_0x2cdcb6(_0x4f6c61[_0x5dfb('0x13')]['message']);}})[_0x5dfb('0x14')](function(_0x524130){logger[_0x5dfb('0x10')](_0x5dfb('0xd'),_0x486883,_0x524130);_0x31ca3d(_0x524130);});});}exports['CreateFaxQueueReport']=function(_0xe46c1a){var _0x328d52=this;return new Promise(function(_0x413f9c,_0x440be2){return db[_0x5dfb('0x15')][_0x5dfb('0x16')](_0xe46c1a['body'],{'raw':_0xe46c1a[_0x5dfb('0x17')]?_0xe46c1a[_0x5dfb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x5dfb('0xb')](function(_0x2309b1){logger[_0x5dfb('0xc')](_0x5dfb('0x18'),_0xe46c1a);logger['debug'](_0x5dfb('0x18'),_0xe46c1a,JSON['stringify'](_0x2309b1));_0x413f9c(_0x2309b1);})[_0x5dfb('0x14')](function(_0x8b5d4a){logger['error'](_0x5dfb('0x18'),_0x8b5d4a['message'],_0xe46c1a);_0x440be2(_0x328d52[_0x5dfb('0x10')](0x1f4,_0x8b5d4a[_0x5dfb('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x2ab3d6){var _0x203320=this;return new Promise(function(_0xcef2de,_0x38e051){return db[_0x5dfb('0x15')][_0x5dfb('0x19')](_0x2ab3d6[_0x5dfb('0x1a')],{'raw':_0x2ab3d6['options']?_0x2ab3d6['options'][_0x5dfb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab3d6[_0x5dfb('0x17')]?_0x2ab3d6[_0x5dfb('0x17')][_0x5dfb('0x1c')]||null:null,'attributes':_0x2ab3d6[_0x5dfb('0x17')]?_0x2ab3d6['options'][_0x5dfb('0x1d')]||null:null,'limit':_0x2ab3d6['options']?_0x2ab3d6[_0x5dfb('0x17')][_0x5dfb('0x1e')]||null:null})['then'](function(_0x15e85d){logger['info'](_0x5dfb('0x1f'),_0x2ab3d6);logger[_0x5dfb('0xe')](_0x5dfb('0x1f'),_0x2ab3d6,JSON[_0x5dfb('0x20')](_0x15e85d));_0xcef2de(_0x15e85d);})[_0x5dfb('0x14')](function(_0x1a331a){logger[_0x5dfb('0x10')]('UpdateFaxQueueReport',_0x1a331a['message'],_0x2ab3d6);_0x38e051(_0x203320[_0x5dfb('0x10')](0x1f4,_0x1a331a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 1288239..3d1c75c 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 _0xf652=['destroy','multer','path','Router','../../config/environment','isAuthenticated','get','describe','/:id','show','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf652,0xb1));var _0x2f65=function(_0x2b9ee2,_0x1f5489){_0x2b9ee2=_0x2b9ee2-0x0;var _0x1ce866=_0xf652[_0x2b9ee2];return _0x1ce866;};'use strict';var multer=require(_0x2f65('0x0'));var util=require('util');var path=require(_0x2f65('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2f65('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2f65('0x3'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x2f65('0x4')](),controller['index']);router[_0x2f65('0x5')]('/describe',auth[_0x2f65('0x4')](),controller[_0x2f65('0x6')]);router[_0x2f65('0x5')](_0x2f65('0x7'),auth[_0x2f65('0x4')](),controller[_0x2f65('0x8')]);router['post']('/',auth[_0x2f65('0x4')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2f65('0x9')]);router['delete']('/:id',auth[_0x2f65('0x4')](),controller[_0x2f65('0xa')]);module['exports']=router; \ No newline at end of file +var _0x0a58=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','put','update','delete','destroy','exports','multer','path'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x0a58,0x141));var _0x80a5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0a58[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x80a5('0x0'));var util=require('util');var path=require(_0x80a5('0x1'));var timeout=require(_0x80a5('0x2'));var express=require(_0x80a5('0x3'));var router=express[_0x80a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x80a5('0x5'));var interaction=require(_0x80a5('0x6'));var config=require(_0x80a5('0x7'));var controller=require(_0x80a5('0x8'));router[_0x80a5('0x9')]('/',auth[_0x80a5('0xa')](),controller[_0x80a5('0xb')]);router[_0x80a5('0x9')](_0x80a5('0xc'),auth[_0x80a5('0xa')](),controller['describe']);router[_0x80a5('0x9')](_0x80a5('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x80a5('0xa')](),controller['create']);router[_0x80a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x80a5('0xf')]);router[_0x80a5('0x10')](_0x80a5('0xd'),auth[_0x80a5('0xa')](),controller[_0x80a5('0x11')]);module[_0x80a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 0b43165..cf431f1 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x40f467,_0x544d10){var _0x749420=function(_0x53a842){while(--_0x53a842){_0x40f467['push'](_0x40f467['shift']());}};_0x749420(++_0x544d10);}(_0x00bb,0x1d8));var _0xb00b=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x00bb[_0x484e36];return _0xafc85d;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1f6040,_0x3cafe5){var _0x502b86=function(_0x301f03){while(--_0x301f03){_0x1f6040['push'](_0x1f6040['shift']());}};_0x502b86(++_0x3cafe5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0xf3cd[_0xbebf50];return _0xce1496;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 110b858..ce495a2 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 _0xf8ad=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','FaxTransferReport','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0xa965f0,_0x4d5a76){var _0x1a1b62=function(_0x126ace){while(--_0x126ace){_0xa965f0['push'](_0xa965f0['shift']());}};_0x1a1b62(++_0x4d5a76);}(_0xf8ad,0x1bd));var _0xdf8a=function(_0x35c1c4,_0x5f0062){_0x35c1c4=_0x35c1c4-0x0;var _0xc53f72=_0xf8ad[_0x35c1c4];return _0xc53f72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf8a('0x0'));var zipdir=require(_0xdf8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf8a('0x2'));var moment=require(_0xdf8a('0x3'));var BPromise=require(_0xdf8a('0x4'));var Mustache=require('mustache');var util=require(_0xdf8a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xdf8a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf8a('0x7'));var _=require('lodash');var squel=require(_0xdf8a('0x8'));var crypto=require(_0xdf8a('0x9'));var jsforce=require(_0xdf8a('0xa'));var deskjs=require(_0xdf8a('0xb'));var toCsv=require(_0xdf8a('0x6'));var querystring=require(_0xdf8a('0xc'));var Papa=require(_0xdf8a('0xd'));var Redis=require(_0xdf8a('0xe'));var authService=require(_0xdf8a('0xf'));var qs=require(_0xdf8a('0x10'));var as=require(_0xdf8a('0x11'));var hardwareService=require(_0xdf8a('0x12'));var logger=require('../../config/logger')(_0xdf8a('0x13'));var utils=require(_0xdf8a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf8a('0x15'))['db'];function respondWithStatusCode(_0x279751,_0x31eebf){_0x31eebf=_0x31eebf||0xcc;return function(_0x3e8d83){if(_0x3e8d83){return _0x279751[_0xdf8a('0x16')](_0x31eebf);}return _0x279751[_0xdf8a('0x17')](_0x31eebf)[_0xdf8a('0x18')]();};}function respondWithResult(_0x5c8773,_0x3896f1){_0x3896f1=_0x3896f1||0xc8;return function(_0x32b819){if(_0x32b819){return _0x5c8773[_0xdf8a('0x17')](_0x3896f1)[_0xdf8a('0x19')](_0x32b819);}};}function respondWithFilteredResult(_0x20380c,_0xd75e49){return function(_0x1d42ec){if(_0x1d42ec){var _0x5283b2=typeof _0xd75e49[_0xdf8a('0x1a')]==='undefined'&&typeof _0xd75e49[_0xdf8a('0x1b')]==='undefined';var _0x33b6a9=_0x1d42ec[_0xdf8a('0x1c')];var _0x9dde25=_0x5283b2?0x0:_0xd75e49['offset'];var _0x154202=_0x5283b2?_0x1d42ec[_0xdf8a('0x1c')]:_0xd75e49[_0xdf8a('0x1a')]+_0xd75e49['limit'];var _0x3d6563;if(_0x154202>=_0x33b6a9){_0x154202=_0x33b6a9;_0x3d6563=0xc8;}else{_0x3d6563=0xce;}_0x20380c['status'](_0x3d6563);return _0x20380c[_0xdf8a('0x1d')]('Content-Range',_0x9dde25+'-'+_0x154202+'/'+_0x33b6a9)[_0xdf8a('0x19')](_0x1d42ec);}return null;};}function patchUpdates(_0x1ab2b8){return function(_0x54ea6e){try{jsonpatch[_0xdf8a('0x1e')](_0x54ea6e,_0x1ab2b8,!![]);}catch(_0x17ddfb){return BPromise[_0xdf8a('0x1f')](_0x17ddfb);}return _0x54ea6e['save']();};}function saveUpdates(_0x2b2c25,_0x28632c){return function(_0x19f4d7){if(_0x19f4d7){return _0x19f4d7[_0xdf8a('0x20')](_0x2b2c25)[_0xdf8a('0x21')](function(_0x2e8528){return _0x2e8528;});}return null;};}function removeEntity(_0x1f6c46,_0x5d4531){return function(_0x477f1d){if(_0x477f1d){return _0x477f1d[_0xdf8a('0x22')]()[_0xdf8a('0x21')](function(){_0x1f6c46['status'](0xcc)[_0xdf8a('0x18')]();});}};}function handleEntityNotFound(_0x3a99ff,_0x5977c5){return function(_0x3e7ce0){if(!_0x3e7ce0){_0x3a99ff[_0xdf8a('0x16')](0x194);}return _0x3e7ce0;};}function handleError(_0xbc36a6,_0x45f9f6){_0x45f9f6=_0x45f9f6||0x1f4;return function(_0xb3b412){logger['error'](_0xb3b412[_0xdf8a('0x23')]);if(_0xb3b412['name']){delete _0xb3b412[_0xdf8a('0x24')];}_0xbc36a6['status'](_0x45f9f6)[_0xdf8a('0x25')](_0xb3b412);};}exports[_0xdf8a('0x26')]=function(_0x342c90,_0x9682f3){var _0xeae572={},_0x20fff4={},_0x4bf7e9={'count':0x0,'rows':[]};var _0x5b6dd6=_[_0xdf8a('0x27')](db['FaxTransferReport'][_0xdf8a('0x28')],function(_0x176e4b){return{'name':_0x176e4b[_0xdf8a('0x29')],'type':_0x176e4b[_0xdf8a('0x2a')][_0xdf8a('0x2b')]};});_0x20fff4[_0xdf8a('0x2c')]=_[_0xdf8a('0x27')](_0x5b6dd6,_0xdf8a('0x24'));_0x20fff4[_0xdf8a('0x2d')]=_[_0xdf8a('0x2e')](_0x342c90[_0xdf8a('0x2d')]);_0x20fff4[_0xdf8a('0x2f')]=_[_0xdf8a('0x30')](_0x20fff4[_0xdf8a('0x2c')],_0x20fff4[_0xdf8a('0x2d')]);_0xeae572[_0xdf8a('0x31')]=_['intersection'](_0x20fff4[_0xdf8a('0x2c')],qs[_0xdf8a('0x32')](_0x342c90['query']['fields']));_0xeae572[_0xdf8a('0x31')]=_0xeae572['attributes'][_0xdf8a('0x33')]?_0xeae572[_0xdf8a('0x31')]:_0x20fff4[_0xdf8a('0x2c')];if(!_0x342c90['query'][_0xdf8a('0x34')]('nolimit')){_0xeae572['limit']=qs['limit'](_0x342c90[_0xdf8a('0x2d')][_0xdf8a('0x1b')]);_0xeae572['offset']=qs[_0xdf8a('0x1a')](_0x342c90['query'][_0xdf8a('0x1a')]);}_0xeae572['order']=qs[_0xdf8a('0x35')](_0x342c90['query']['sort']);_0xeae572[_0xdf8a('0x36')]=qs['filters'](_[_0xdf8a('0x37')](_0x342c90[_0xdf8a('0x2d')],_0x20fff4[_0xdf8a('0x2f')]),_0x5b6dd6);if(_0x342c90[_0xdf8a('0x2d')][_0xdf8a('0x38')]){_0xeae572['where']=_[_0xdf8a('0x39')](_0xeae572[_0xdf8a('0x36')],{'$or':_[_0xdf8a('0x27')](_0x5b6dd6,function(_0x2ff459){if(_0x2ff459[_0xdf8a('0x2a')]!==_0xdf8a('0x3a')){var _0x526385={};_0x526385[_0x2ff459['name']]={'$like':'%'+_0x342c90['query'][_0xdf8a('0x38')]+'%'};return _0x526385;}})});}_0xeae572=_[_0xdf8a('0x39')]({},_0xeae572,_0x342c90['options']);var _0x441037={'where':_0xeae572[_0xdf8a('0x36')]};return db[_0xdf8a('0x3b')]['count'](_0x441037)[_0xdf8a('0x21')](function(_0x3ac6be){_0x4bf7e9['count']=_0x3ac6be;if(_0x342c90['query'][_0xdf8a('0x3c')]){_0xeae572[_0xdf8a('0x3d')]=[{'all':!![]}];}return db[_0xdf8a('0x3b')]['findAll'](_0xeae572);})['then'](function(_0x1110f2){_0x4bf7e9[_0xdf8a('0x3e')]=_0x1110f2;return _0x4bf7e9;})[_0xdf8a('0x21')](respondWithFilteredResult(_0x9682f3,_0xeae572))[_0xdf8a('0x3f')](handleError(_0x9682f3,null));};exports[_0xdf8a('0x40')]=function(_0x15e58d,_0x2a1eff){var _0x2064e7={'raw':!![],'where':{'id':_0x15e58d[_0xdf8a('0x41')]['id']}},_0x185baa={};_0x185baa[_0xdf8a('0x2c')]=_[_0xdf8a('0x2e')](db[_0xdf8a('0x3b')][_0xdf8a('0x28')]);_0x185baa[_0xdf8a('0x2d')]=_[_0xdf8a('0x2e')](_0x15e58d[_0xdf8a('0x2d')]);_0x185baa[_0xdf8a('0x2f')]=_['intersection'](_0x185baa[_0xdf8a('0x2c')],_0x185baa[_0xdf8a('0x2d')]);_0x2064e7['attributes']=_[_0xdf8a('0x30')](_0x185baa[_0xdf8a('0x2c')],qs['fields'](_0x15e58d[_0xdf8a('0x2d')][_0xdf8a('0x32')]));_0x2064e7[_0xdf8a('0x31')]=_0x2064e7[_0xdf8a('0x31')][_0xdf8a('0x33')]?_0x2064e7[_0xdf8a('0x31')]:_0x185baa[_0xdf8a('0x2c')];if(_0x15e58d[_0xdf8a('0x2d')][_0xdf8a('0x3c')]){_0x2064e7[_0xdf8a('0x3d')]=[{'all':!![]}];}_0x2064e7=_[_0xdf8a('0x39')]({},_0x2064e7,_0x15e58d['options']);return db[_0xdf8a('0x3b')][_0xdf8a('0x42')](_0x2064e7)[_0xdf8a('0x21')](handleEntityNotFound(_0x2a1eff,null))[_0xdf8a('0x21')](respondWithResult(_0x2a1eff,null))[_0xdf8a('0x3f')](handleError(_0x2a1eff,null));};exports[_0xdf8a('0x43')]=function(_0xfdfda7,_0x4a8460){return db[_0xdf8a('0x3b')][_0xdf8a('0x43')](_0xfdfda7[_0xdf8a('0x44')],{})[_0xdf8a('0x21')](respondWithResult(_0x4a8460,0xc9))['catch'](handleError(_0x4a8460,null));};exports[_0xdf8a('0x20')]=function(_0x14fd11,_0x2311b9){if(_0x14fd11['body']['id']){delete _0x14fd11[_0xdf8a('0x44')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x14fd11[_0xdf8a('0x41')]['id']}})[_0xdf8a('0x21')](handleEntityNotFound(_0x2311b9,null))[_0xdf8a('0x21')](saveUpdates(_0x14fd11['body'],null))[_0xdf8a('0x21')](respondWithResult(_0x2311b9,null))[_0xdf8a('0x3f')](handleError(_0x2311b9,null));};exports[_0xdf8a('0x22')]=function(_0x15a048,_0x1b7276){return db[_0xdf8a('0x3b')][_0xdf8a('0x42')]({'where':{'id':_0x15a048[_0xdf8a('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b7276,null))['then'](removeEntity(_0x1b7276,null))[_0xdf8a('0x3f')](handleError(_0x1b7276,null));};exports[_0xdf8a('0x45')]=function(_0x957031,_0x30d3e4){return db['FaxTransferReport'][_0xdf8a('0x45')]()[_0xdf8a('0x21')](respondWithResult(_0x30d3e4,null))[_0xdf8a('0x3f')](handleError(_0x30d3e4,null));}; \ No newline at end of file +var _0xc6c5=['intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FaxTransferReport','includeAll','include','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6c5,0x64));var _0x5c6c=function(_0x466c17,_0x68fc5b){_0x466c17=_0x466c17-0x0;var _0x158a6a=_0xc6c5[_0x466c17];return _0x158a6a;};'use strict';var emlformat=require(_0x5c6c('0x0'));var rimraf=require(_0x5c6c('0x1'));var zipdir=require(_0x5c6c('0x2'));var jsonpatch=require(_0x5c6c('0x3'));var rp=require(_0x5c6c('0x4'));var moment=require(_0x5c6c('0x5'));var BPromise=require(_0x5c6c('0x6'));var Mustache=require(_0x5c6c('0x7'));var util=require(_0x5c6c('0x8'));var path=require(_0x5c6c('0x9'));var sox=require(_0x5c6c('0xa'));var csv=require(_0x5c6c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c6c('0xc'));var _=require(_0x5c6c('0xd'));var squel=require(_0x5c6c('0xe'));var crypto=require(_0x5c6c('0xf'));var jsforce=require(_0x5c6c('0x10'));var deskjs=require(_0x5c6c('0x11'));var toCsv=require(_0x5c6c('0xb'));var querystring=require('querystring');var Papa=require(_0x5c6c('0x12'));var Redis=require(_0x5c6c('0x13'));var authService=require(_0x5c6c('0x14'));var qs=require(_0x5c6c('0x15'));var as=require(_0x5c6c('0x16'));var hardwareService=require(_0x5c6c('0x17'));var logger=require(_0x5c6c('0x18'))(_0x5c6c('0x19'));var utils=require('../../config/utils');var config=require(_0x5c6c('0x1a'));var licenseUtil=require(_0x5c6c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21ef9d,_0x3f0ee4){_0x3f0ee4=_0x3f0ee4||0xcc;return function(_0x518a11){if(_0x518a11){return _0x21ef9d[_0x5c6c('0x1c')](_0x3f0ee4);}return _0x21ef9d[_0x5c6c('0x1d')](_0x3f0ee4)[_0x5c6c('0x1e')]();};}function respondWithResult(_0x2f77a4,_0x6f2de1){_0x6f2de1=_0x6f2de1||0xc8;return function(_0xb4c5ad){if(_0xb4c5ad){return _0x2f77a4[_0x5c6c('0x1d')](_0x6f2de1)[_0x5c6c('0x1f')](_0xb4c5ad);}};}function respondWithFilteredResult(_0xf09c52,_0x26bd0f){return function(_0x1814fb){if(_0x1814fb){var _0x3ef155=typeof _0x26bd0f[_0x5c6c('0x20')]===_0x5c6c('0x21')&&typeof _0x26bd0f[_0x5c6c('0x22')]===_0x5c6c('0x21');var _0x339baf=_0x1814fb[_0x5c6c('0x23')];var _0x3e872d=_0x3ef155?0x0:_0x26bd0f[_0x5c6c('0x20')];var _0xbd22ba=_0x3ef155?_0x1814fb[_0x5c6c('0x23')]:_0x26bd0f[_0x5c6c('0x20')]+_0x26bd0f[_0x5c6c('0x22')];var _0x273122;if(_0xbd22ba>=_0x339baf){_0xbd22ba=_0x339baf;_0x273122=0xc8;}else{_0x273122=0xce;}_0xf09c52[_0x5c6c('0x1d')](_0x273122);return _0xf09c52[_0x5c6c('0x24')](_0x5c6c('0x25'),_0x3e872d+'-'+_0xbd22ba+'/'+_0x339baf)[_0x5c6c('0x1f')](_0x1814fb);}return null;};}function patchUpdates(_0x4019e1){return function(_0x3739b5){try{jsonpatch[_0x5c6c('0x26')](_0x3739b5,_0x4019e1,!![]);}catch(_0x1b1082){return BPromise[_0x5c6c('0x27')](_0x1b1082);}return _0x3739b5[_0x5c6c('0x28')]();};}function saveUpdates(_0x5455cb,_0x1ed81c){return function(_0x5181f3){if(_0x5181f3){return _0x5181f3['update'](_0x5455cb)['then'](function(_0x10e7e8){return _0x10e7e8;});}return null;};}function removeEntity(_0x148726,_0x43567c){return function(_0x3a5a48){if(_0x3a5a48){return _0x3a5a48['destroy']()[_0x5c6c('0x29')](function(){_0x148726['status'](0xcc)[_0x5c6c('0x1e')]();});}};}function handleEntityNotFound(_0x3eb35d,_0x49f180){return function(_0x152984){if(!_0x152984){_0x3eb35d[_0x5c6c('0x1c')](0x194);}return _0x152984;};}function handleError(_0x10a4bd,_0x18812c){_0x18812c=_0x18812c||0x1f4;return function(_0x45b551){logger['error'](_0x45b551['stack']);if(_0x45b551['name']){delete _0x45b551[_0x5c6c('0x2a')];}_0x10a4bd['status'](_0x18812c)[_0x5c6c('0x2b')](_0x45b551);};}exports[_0x5c6c('0x2c')]=function(_0x188883,_0x17c284){var _0x1cd5c9={},_0x1fbac9={},_0x1cc5fd={'count':0x0,'rows':[]};var _0xcd4daa=_[_0x5c6c('0x2d')](db['FaxTransferReport'][_0x5c6c('0x2e')],function(_0x4dd62c){return{'name':_0x4dd62c[_0x5c6c('0x2f')],'type':_0x4dd62c['type']['key']};});_0x1fbac9['model']=_[_0x5c6c('0x2d')](_0xcd4daa,'name');_0x1fbac9[_0x5c6c('0x30')]=_[_0x5c6c('0x31')](_0x188883[_0x5c6c('0x30')]);_0x1fbac9['filters']=_[_0x5c6c('0x32')](_0x1fbac9[_0x5c6c('0x33')],_0x1fbac9[_0x5c6c('0x30')]);_0x1cd5c9[_0x5c6c('0x34')]=_[_0x5c6c('0x32')](_0x1fbac9[_0x5c6c('0x33')],qs[_0x5c6c('0x35')](_0x188883[_0x5c6c('0x30')][_0x5c6c('0x35')]));_0x1cd5c9[_0x5c6c('0x34')]=_0x1cd5c9[_0x5c6c('0x34')][_0x5c6c('0x36')]?_0x1cd5c9[_0x5c6c('0x34')]:_0x1fbac9[_0x5c6c('0x33')];if(!_0x188883[_0x5c6c('0x30')][_0x5c6c('0x37')]('nolimit')){_0x1cd5c9['limit']=qs[_0x5c6c('0x22')](_0x188883[_0x5c6c('0x30')]['limit']);_0x1cd5c9['offset']=qs['offset'](_0x188883[_0x5c6c('0x30')]['offset']);}_0x1cd5c9['order']=qs[_0x5c6c('0x38')](_0x188883[_0x5c6c('0x30')]['sort']);_0x1cd5c9[_0x5c6c('0x39')]=qs[_0x5c6c('0x3a')](_[_0x5c6c('0x3b')](_0x188883['query'],_0x1fbac9[_0x5c6c('0x3a')]),_0xcd4daa);if(_0x188883['query'][_0x5c6c('0x3c')]){_0x1cd5c9[_0x5c6c('0x39')]=_[_0x5c6c('0x3d')](_0x1cd5c9[_0x5c6c('0x39')],{'$or':_[_0x5c6c('0x2d')](_0xcd4daa,function(_0x37f35b){if(_0x37f35b[_0x5c6c('0x3e')]!==_0x5c6c('0x3f')){var _0x26913c={};_0x26913c[_0x37f35b['name']]={'$like':'%'+_0x188883[_0x5c6c('0x30')][_0x5c6c('0x3c')]+'%'};return _0x26913c;}})});}_0x1cd5c9=_[_0x5c6c('0x3d')]({},_0x1cd5c9,_0x188883[_0x5c6c('0x40')]);var _0x3ba4ff={'where':_0x1cd5c9[_0x5c6c('0x39')]};return db[_0x5c6c('0x41')][_0x5c6c('0x23')](_0x3ba4ff)[_0x5c6c('0x29')](function(_0x416456){_0x1cc5fd[_0x5c6c('0x23')]=_0x416456;if(_0x188883[_0x5c6c('0x30')][_0x5c6c('0x42')]){_0x1cd5c9[_0x5c6c('0x43')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x1cd5c9);})[_0x5c6c('0x29')](function(_0x25b35e){_0x1cc5fd[_0x5c6c('0x44')]=_0x25b35e;return _0x1cc5fd;})[_0x5c6c('0x29')](respondWithFilteredResult(_0x17c284,_0x1cd5c9))[_0x5c6c('0x45')](handleError(_0x17c284,null));};exports[_0x5c6c('0x46')]=function(_0x5884cf,_0x198277){var _0x5437c5={'raw':!![],'where':{'id':_0x5884cf[_0x5c6c('0x47')]['id']}},_0x334eef={};_0x334eef[_0x5c6c('0x33')]=_[_0x5c6c('0x31')](db[_0x5c6c('0x41')][_0x5c6c('0x2e')]);_0x334eef['query']=_[_0x5c6c('0x31')](_0x5884cf[_0x5c6c('0x30')]);_0x334eef['filters']=_['intersection'](_0x334eef['model'],_0x334eef[_0x5c6c('0x30')]);_0x5437c5[_0x5c6c('0x34')]=_['intersection'](_0x334eef[_0x5c6c('0x33')],qs[_0x5c6c('0x35')](_0x5884cf[_0x5c6c('0x30')][_0x5c6c('0x35')]));_0x5437c5[_0x5c6c('0x34')]=_0x5437c5['attributes'][_0x5c6c('0x36')]?_0x5437c5['attributes']:_0x334eef[_0x5c6c('0x33')];if(_0x5884cf[_0x5c6c('0x30')]['includeAll']){_0x5437c5['include']=[{'all':!![]}];}_0x5437c5=_[_0x5c6c('0x3d')]({},_0x5437c5,_0x5884cf[_0x5c6c('0x40')]);return db[_0x5c6c('0x41')]['find'](_0x5437c5)[_0x5c6c('0x29')](handleEntityNotFound(_0x198277,null))[_0x5c6c('0x29')](respondWithResult(_0x198277,null))['catch'](handleError(_0x198277,null));};exports[_0x5c6c('0x48')]=function(_0x1de0df,_0x5bd09e){return db[_0x5c6c('0x41')][_0x5c6c('0x48')](_0x1de0df['body'],{})[_0x5c6c('0x29')](respondWithResult(_0x5bd09e,0xc9))[_0x5c6c('0x45')](handleError(_0x5bd09e,null));};exports['update']=function(_0x143ffb,_0x42f8d4){if(_0x143ffb[_0x5c6c('0x49')]['id']){delete _0x143ffb[_0x5c6c('0x49')]['id'];}return db[_0x5c6c('0x41')][_0x5c6c('0x4a')]({'where':{'id':_0x143ffb[_0x5c6c('0x47')]['id']}})[_0x5c6c('0x29')](handleEntityNotFound(_0x42f8d4,null))['then'](saveUpdates(_0x143ffb['body'],null))[_0x5c6c('0x29')](respondWithResult(_0x42f8d4,null))[_0x5c6c('0x45')](handleError(_0x42f8d4,null));};exports['destroy']=function(_0x48feb0,_0x27e471){return db[_0x5c6c('0x41')][_0x5c6c('0x4a')]({'where':{'id':_0x48feb0['params']['id']}})[_0x5c6c('0x29')](handleEntityNotFound(_0x27e471,null))[_0x5c6c('0x29')](removeEntity(_0x27e471,null))[_0x5c6c('0x45')](handleError(_0x27e471,null));};exports['describe']=function(_0x3f9264,_0x133b69){return db[_0x5c6c('0x41')]['describe']()[_0x5c6c('0x29')](respondWithResult(_0x133b69,null))[_0x5c6c('0x45')](handleError(_0x133b69,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 558d685..1f467d4 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 _0xcfba=['path','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xcfba,0x1b4));var _0xacfb=function(_0x59cebe,_0x4a9630){_0x59cebe=_0x59cebe-0x0;var _0x5ba141=_0xcfba[_0x59cebe];return _0x5ba141;};'use strict';var _=require(_0xacfb('0x0'));var util=require('util');var logger=require(_0xacfb('0x1'))(_0xacfb('0x2'));var moment=require(_0xacfb('0x3'));var BPromise=require(_0xacfb('0x4'));var rp=require(_0xacfb('0x5'));var fs=require('fs');var path=require(_0xacfb('0x6'));var rimraf=require('rimraf');var config=require(_0xacfb('0x7'));var attributes=require(_0xacfb('0x8'));module['exports']=function(_0x2a7622,_0x5cbe68){return _0x2a7622[_0xacfb('0x9')](_0xacfb('0xa'),attributes,{'tableName':_0xacfb('0xb'),'paranoid':![],'indexes':[{'name':_0xacfb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ef1=['./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x6ef1,0xac));var _0x16ef=function(_0x10668a,_0x234880){_0x10668a=_0x10668a-0x0;var _0xa44d3=_0x6ef1[_0x10668a];return _0xa44d3;};'use strict';var _=require(_0x16ef('0x0'));var util=require(_0x16ef('0x1'));var logger=require(_0x16ef('0x2'))(_0x16ef('0x3'));var moment=require(_0x16ef('0x4'));var BPromise=require(_0x16ef('0x5'));var rp=require(_0x16ef('0x6'));var fs=require('fs');var path=require(_0x16ef('0x7'));var rimraf=require(_0x16ef('0x8'));var config=require(_0x16ef('0x9'));var attributes=require(_0x16ef('0xa'));module['exports']=function(_0xf1f5bd,_0x198926){return _0xf1f5bd[_0x16ef('0xb')](_0x16ef('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x16ef('0xd'),'fields':[_0x16ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2bef3d2..a1c7dd4 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 _0xafef=['code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xafef,0x13e));var _0xfafe=function(_0x1e7db3,_0x5a447f){_0x1e7db3=_0x1e7db3-0x0;var _0x13238c=_0xafef[_0x1e7db3];return _0x13238c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfafe('0x0'));var BPromise=require(_0xfafe('0x1'));var rs=require(_0xfafe('0x2'));var fs=require('fs');var Redis=require(_0xfafe('0x3'));var db=require(_0xfafe('0x4'))['db'];var utils=require(_0xfafe('0x5'));var logger=require(_0xfafe('0x6'))('rpc');var config=require(_0xfafe('0x7'));var jayson=require(_0xfafe('0x8'));var client=jayson[_0xfafe('0x9')][_0xfafe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f798d,_0x531c8c,_0x454056){return new BPromise(function(_0xe8e5c5,_0x2670fc){return client[_0xfafe('0xb')](_0x3f798d,_0x454056)[_0xfafe('0xc')](function(_0x342885){logger[_0xfafe('0xd')](_0xfafe('0xe'),_0x531c8c,'request\x20sent');logger[_0xfafe('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x531c8c,_0xfafe('0x10'),JSON['stringify'](_0x342885));if(_0x342885[_0xfafe('0x11')]){if(_0x342885[_0xfafe('0x11')][_0xfafe('0x12')]===0x1f4){logger[_0xfafe('0x11')](_0xfafe('0xe'),_0x531c8c,_0x342885[_0xfafe('0x11')]['message']);return _0x2670fc(_0x342885[_0xfafe('0x11')][_0xfafe('0x13')]);}logger['error'](_0xfafe('0xe'),_0x531c8c,_0x342885[_0xfafe('0x11')]['message']);return _0xe8e5c5(_0x342885['error'][_0xfafe('0x13')]);}else{logger[_0xfafe('0xd')](_0xfafe('0xe'),_0x531c8c,_0xfafe('0x10'));_0xe8e5c5(_0x342885[_0xfafe('0x14')][_0xfafe('0x13')]);}})['catch'](function(_0x4d5d70){logger[_0xfafe('0x11')](_0xfafe('0xe'),_0x531c8c,_0x4d5d70);_0x2670fc(_0x4d5d70);});});} \ No newline at end of file +var _0xa7a1=['rpc','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0xa7a1,0x8a));var _0x1a7a=function(_0x31cac2,_0x560126){_0x31cac2=_0x31cac2-0x0;var _0x4da10c=_0xa7a1[_0x31cac2];return _0x4da10c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1a7a('0x0'));var BPromise=require(_0x1a7a('0x1'));var rs=require(_0x1a7a('0x2'));var fs=require('fs');var Redis=require(_0x1a7a('0x3'));var db=require(_0x1a7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a7a('0x5'))(_0x1a7a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15d023,_0x2fd96f,_0x26dd64){return new BPromise(function(_0x455666,_0x4639b1){return client[_0x1a7a('0x7')](_0x15d023,_0x26dd64)['then'](function(_0x4eb68a){logger[_0x1a7a('0x8')](_0x1a7a('0x9'),_0x2fd96f,_0x1a7a('0xa'));logger[_0x1a7a('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2fd96f,_0x1a7a('0xa'),JSON[_0x1a7a('0xc')](_0x4eb68a));if(_0x4eb68a[_0x1a7a('0xd')]){if(_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xe')]===0x1f4){logger[_0x1a7a('0xd')](_0x1a7a('0x9'),_0x2fd96f,_0x4eb68a[_0x1a7a('0xd')]['message']);return _0x4639b1(_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xf')]);}logger[_0x1a7a('0xd')](_0x1a7a('0x9'),_0x2fd96f,_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xf')]);return _0x455666(_0x4eb68a[_0x1a7a('0xd')][_0x1a7a('0xf')]);}else{logger[_0x1a7a('0x8')]('FaxTransferReport,\x20%s,\x20%s',_0x2fd96f,_0x1a7a('0xa'));_0x455666(_0x4eb68a[_0x1a7a('0x10')][_0x1a7a('0xf')]);}})[_0x1a7a('0x11')](function(_0x2ed4cc){logger[_0x1a7a('0xd')](_0x1a7a('0x9'),_0x2fd96f,_0x2ed4cc);_0x4639b1(_0x2ed4cc);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f76cae2..ad883bd 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 _0xef8c=['post','create','put','/:id','update','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','show'];(function(_0x17053e,_0x3c0ee7){var _0x96ff45=function(_0x5b0e44){while(--_0x5b0e44){_0x17053e['push'](_0x17053e['shift']());}};_0x96ff45(++_0x3c0ee7);}(_0xef8c,0x10b));var _0xcef8=function(_0x378a48,_0x5b012f){_0x378a48=_0x378a48-0x0;var _0x1538c5=_0xef8c[_0x378a48];return _0x1538c5;};'use strict';var multer=require(_0xcef8('0x0'));var util=require(_0xcef8('0x1'));var path=require(_0xcef8('0x2'));var timeout=require('connect-timeout');var express=require(_0xcef8('0x3'));var router=express['Router']();var fs_extra=require(_0xcef8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcef8('0x5'));var config=require(_0xcef8('0x6'));var controller=require(_0xcef8('0x7'));router[_0xcef8('0x8')]('/',auth[_0xcef8('0x9')](),controller[_0xcef8('0xa')]);router[_0xcef8('0x8')](_0xcef8('0xb'),auth[_0xcef8('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcef8('0xc')]);router[_0xcef8('0xd')]('/',auth[_0xcef8('0x9')](),controller[_0xcef8('0xe')]);router[_0xcef8('0xf')](_0xcef8('0x10'),auth[_0xcef8('0x9')](),controller[_0xcef8('0x11')]);router['delete']('/:id',auth[_0xcef8('0x9')](),controller[_0xcef8('0x12')]);module[_0xcef8('0x13')]=router; \ No newline at end of file +var _0x48c8=['index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated'];(function(_0x454cfb,_0x3246d4){var _0x5b7654=function(_0x8055dc){while(--_0x8055dc){_0x454cfb['push'](_0x454cfb['shift']());}};_0x5b7654(++_0x3246d4);}(_0x48c8,0x131));var _0x848c=function(_0x4a782b,_0x55584a){_0x4a782b=_0x4a782b-0x0;var _0x5cb5a0=_0x48c8[_0x4a782b];return _0x5cb5a0;};'use strict';var multer=require(_0x848c('0x0'));var util=require(_0x848c('0x1'));var path=require('path');var timeout=require(_0x848c('0x2'));var express=require(_0x848c('0x3'));var router=express[_0x848c('0x4')]();var fs_extra=require(_0x848c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x848c('0x6'));var config=require(_0x848c('0x7'));var controller=require(_0x848c('0x8'));router['get']('/',auth[_0x848c('0x9')](),controller[_0x848c('0xa')]);router['get'](_0x848c('0xb'),auth[_0x848c('0x9')](),controller['describe']);router['get'](_0x848c('0xc'),auth['isAuthenticated'](),controller[_0x848c('0xd')]);router[_0x848c('0xe')]('/',auth[_0x848c('0x9')](),controller[_0x848c('0xf')]);router[_0x848c('0x10')](_0x848c('0xc'),auth['isAuthenticated'](),controller[_0x848c('0x11')]);router[_0x848c('0x12')](_0x848c('0xc'),auth[_0x848c('0x9')](),controller[_0x848c('0x13')]);module[_0x848c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 07b8b77..42b1360 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 _0xfb1f=['getFields','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0xe72e1b,_0x1ad97a){var _0x17f85c=function(_0x14fc5a){while(--_0x14fc5a){_0xe72e1b['push'](_0xe72e1b['shift']());}};_0x17f85c(++_0x1ad97a);}(_0xfb1f,0x104));var _0xffb1=function(_0x5601e7,_0x1ac673){_0x5601e7=_0x5601e7-0x0;var _0x58a60=_0xfb1f[_0x5601e7];return _0x58a60;};'use strict';var multer=require(_0xffb1('0x0'));var util=require(_0xffb1('0x1'));var path=require(_0xffb1('0x2'));var timeout=require(_0xffb1('0x3'));var express=require(_0xffb1('0x4'));var router=express[_0xffb1('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xffb1('0x6'));var controller=require('./intDeskAccount.controller');router[_0xffb1('0x7')]('/',auth['isAuthenticated'](),controller[_0xffb1('0x8')]);router[_0xffb1('0x7')]('/:id',auth[_0xffb1('0x9')](),controller['show']);router[_0xffb1('0x7')](_0xffb1('0xa'),auth[_0xffb1('0x9')](),controller[_0xffb1('0xb')]);router[_0xffb1('0x7')](_0xffb1('0xc'),auth['isAuthenticated'](),controller[_0xffb1('0xd')]);router['post']('/',auth[_0xffb1('0x9')](),controller['create']);router[_0xffb1('0xe')](_0xffb1('0xa'),auth[_0xffb1('0x9')](),controller[_0xffb1('0xf')]);router[_0xffb1('0x10')](_0xffb1('0x11'),auth[_0xffb1('0x9')](),controller[_0xffb1('0x12')]);router[_0xffb1('0x13')]('/:id',auth[_0xffb1('0x9')](),controller['destroy']);module[_0xffb1('0x14')]=router; \ No newline at end of file +var _0x6074=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6074,0xd6));var _0x4607=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x6074[_0x35ba71];return _0x5f04f4;};'use strict';var multer=require(_0x4607('0x0'));var util=require('util');var path=require(_0x4607('0x1'));var timeout=require(_0x4607('0x2'));var express=require(_0x4607('0x3'));var router=express['Router']();var fs_extra=require(_0x4607('0x4'));var auth=require(_0x4607('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4607('0x6'));router[_0x4607('0x7')]('/',auth[_0x4607('0x8')](),controller[_0x4607('0x9')]);router[_0x4607('0x7')](_0x4607('0xa'),auth['isAuthenticated'](),controller[_0x4607('0xb')]);router['get'](_0x4607('0xc'),auth[_0x4607('0x8')](),controller[_0x4607('0xd')]);router[_0x4607('0x7')](_0x4607('0xe'),auth[_0x4607('0x8')](),controller['getFields']);router[_0x4607('0xf')]('/',auth[_0x4607('0x8')](),controller[_0x4607('0x10')]);router[_0x4607('0xf')](_0x4607('0xc'),auth[_0x4607('0x8')](),controller['addConfiguration']);router[_0x4607('0x11')](_0x4607('0xa'),auth[_0x4607('0x8')](),controller[_0x4607('0x12')]);router['delete'](_0x4607('0xa'),auth[_0x4607('0x8')](),controller['destroy']);module[_0x4607('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index fea6f46..9588e06 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 _0xa374=['basic','integrationTab','newTab','exports','STRING','ENUM'];(function(_0x21704a,_0x850b54){var _0xa8af09=function(_0xefa7a3){while(--_0xefa7a3){_0x21704a['push'](_0x21704a['shift']());}};_0xa8af09(++_0x850b54);}(_0xa374,0x1ad));var _0x4a37=function(_0x422eef,_0x584ac2){_0x422eef=_0x422eef-0x0;var _0x2e53fe=_0xa374[_0x422eef];return _0x2e53fe;};'use strict';var Sequelize=require('sequelize');module[_0x4a37('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4a37('0x1')]},'username':{'type':Sequelize[_0x4a37('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x4a37('0x2')](_0x4a37('0x3')),'defaultValue':_0x4a37('0x3')},'password':{'type':Sequelize[_0x4a37('0x1')]},'consumerKey':{'type':Sequelize[_0x4a37('0x1')]},'consumerSecret':{'type':Sequelize[_0x4a37('0x1')]},'token':{'type':Sequelize[_0x4a37('0x1')]},'tokenSecret':{'type':Sequelize[_0x4a37('0x1')]},'serverUrl':{'type':Sequelize[_0x4a37('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4a37('0x2')](_0x4a37('0x4'),_0x4a37('0x5')),'defaultValue':_0x4a37('0x4')}}; \ No newline at end of file +var _0xbd8b=['ENUM','integrationTab','newTab','sequelize','STRING','basic'];(function(_0x567cca,_0x2d643d){var _0x338a5e=function(_0x377f10){while(--_0x377f10){_0x567cca['push'](_0x567cca['shift']());}};_0x338a5e(++_0x2d643d);}(_0xbd8b,0xc9));var _0xbbd8=function(_0x1dee97,_0x292954){_0x1dee97=_0x1dee97-0x0;var _0x54af5c=_0xbd8b[_0x1dee97];return _0x54af5c;};'use strict';var Sequelize=require(_0xbbd8('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbd8('0x1')]},'description':{'type':Sequelize[_0xbbd8('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbbd8('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xbbd8('0x2')),'defaultValue':_0xbbd8('0x2')},'password':{'type':Sequelize[_0xbbd8('0x1')]},'consumerKey':{'type':Sequelize[_0xbbd8('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xbbd8('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xbbd8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbbd8('0x3')](_0xbbd8('0x4'),_0xbbd8('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 666d004..ee792ca 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 _0xf20a=['../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','DeskAccount','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','getConfigurations','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf20a,0x145));var _0xaf20=function(_0x27b3c0,_0x3283eb){_0x27b3c0=_0x27b3c0-0x0;var _0x20f7ab=_0xf20a[_0x27b3c0];return _0x20f7ab;};'use strict';var emlformat=require(_0xaf20('0x0'));var rimraf=require(_0xaf20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf20('0x2'));var rp=require(_0xaf20('0x3'));var moment=require(_0xaf20('0x4'));var BPromise=require(_0xaf20('0x5'));var Mustache=require(_0xaf20('0x6'));var util=require(_0xaf20('0x7'));var path=require(_0xaf20('0x8'));var sox=require(_0xaf20('0x9'));var csv=require(_0xaf20('0xa'));var ejs=require(_0xaf20('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf20('0xc'));var squel=require(_0xaf20('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf20('0xe'));var toCsv=require(_0xaf20('0xa'));var querystring=require(_0xaf20('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaf20('0x10'));var qs=require(_0xaf20('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf20('0x12'))(_0xaf20('0x13'));var utils=require(_0xaf20('0x14'));var config=require(_0xaf20('0x15'));var licenseUtil=require(_0xaf20('0x16'));var db=require(_0xaf20('0x17'))['db'];var integrations=require(_0xaf20('0x18'));function respondWithStatusCode(_0xce324b,_0x32754f){_0x32754f=_0x32754f||0xcc;return function(_0x345aa6){if(_0x345aa6){return _0xce324b['sendStatus'](_0x32754f);}return _0xce324b[_0xaf20('0x19')](_0x32754f)[_0xaf20('0x1a')]();};}function respondWithResult(_0x3aa0e3,_0x176b1b){_0x176b1b=_0x176b1b||0xc8;return function(_0x1c54f1){if(_0x1c54f1){return _0x3aa0e3[_0xaf20('0x19')](_0x176b1b)['json'](_0x1c54f1);}};}function respondWithFilteredResult(_0x671261,_0x1ee258){return function(_0x3a0b9f){if(_0x3a0b9f){var _0x164b56=typeof _0x1ee258[_0xaf20('0x1b')]===_0xaf20('0x1c')&&typeof _0x1ee258[_0xaf20('0x1d')]===_0xaf20('0x1c');var _0x239845=_0x3a0b9f[_0xaf20('0x1e')];var _0x334d30=_0x164b56?0x0:_0x1ee258[_0xaf20('0x1b')];var _0x13eaa6=_0x164b56?_0x3a0b9f['count']:_0x1ee258[_0xaf20('0x1b')]+_0x1ee258['limit'];var _0x405b61;if(_0x13eaa6>=_0x239845){_0x13eaa6=_0x239845;_0x405b61=0xc8;}else{_0x405b61=0xce;}_0x671261[_0xaf20('0x19')](_0x405b61);return _0x671261[_0xaf20('0x1f')]('Content-Range',_0x334d30+'-'+_0x13eaa6+'/'+_0x239845)[_0xaf20('0x20')](_0x3a0b9f);}return null;};}function patchUpdates(_0x527b7d){return function(_0x183966){try{jsonpatch[_0xaf20('0x21')](_0x183966,_0x527b7d,!![]);}catch(_0xd1b717){return BPromise[_0xaf20('0x22')](_0xd1b717);}return _0x183966[_0xaf20('0x23')]();};}function saveUpdates(_0x509874,_0x3b142d){return function(_0x388a1c){if(_0x388a1c){return _0x388a1c['update'](_0x509874)[_0xaf20('0x24')](function(_0x5bdd08){return _0x5bdd08;});}return null;};}function removeEntity(_0x26d2d3,_0x28fbd4){return function(_0x5ec3d7){if(_0x5ec3d7){return _0x5ec3d7[_0xaf20('0x25')]()[_0xaf20('0x24')](function(){_0x26d2d3[_0xaf20('0x19')](0xcc)[_0xaf20('0x1a')]();});}};}function handleEntityNotFound(_0x2bfe78,_0x3a3243){return function(_0x38be5d){if(!_0x38be5d){_0x2bfe78[_0xaf20('0x26')](0x194);}return _0x38be5d;};}function handleError(_0x4b4e3f,_0x282cbf){_0x282cbf=_0x282cbf||0x1f4;return function(_0xb81ab1){logger['error'](_0xb81ab1[_0xaf20('0x27')]);if(_0xb81ab1[_0xaf20('0x28')]){delete _0xb81ab1[_0xaf20('0x28')];}_0x4b4e3f[_0xaf20('0x19')](_0x282cbf)[_0xaf20('0x29')](_0xb81ab1);};}exports[_0xaf20('0x2a')]=function(_0x13ccff,_0x3e36e9){var _0x478e22={},_0x25106d={},_0xc9bad3={'count':0x0,'rows':[]};var _0x2a131d=_[_0xaf20('0x2b')](db[_0xaf20('0x2c')][_0xaf20('0x2d')],function(_0x2db282){return{'name':_0x2db282['fieldName'],'type':_0x2db282[_0xaf20('0x2e')][_0xaf20('0x2f')]};});_0x25106d[_0xaf20('0x30')]=_[_0xaf20('0x2b')](_0x2a131d,_0xaf20('0x28'));_0x25106d['query']=_[_0xaf20('0x31')](_0x13ccff['query']);_0x25106d[_0xaf20('0x32')]=_[_0xaf20('0x33')](_0x25106d[_0xaf20('0x30')],_0x25106d[_0xaf20('0x34')]);_0x478e22['attributes']=_[_0xaf20('0x33')](_0x25106d[_0xaf20('0x30')],qs[_0xaf20('0x35')](_0x13ccff['query'][_0xaf20('0x35')]));_0x478e22[_0xaf20('0x36')]=_0x478e22[_0xaf20('0x36')][_0xaf20('0x37')]?_0x478e22['attributes']:_0x25106d[_0xaf20('0x30')];if(!_0x13ccff[_0xaf20('0x34')][_0xaf20('0x38')]('nolimit')){_0x478e22['limit']=qs[_0xaf20('0x1d')](_0x13ccff[_0xaf20('0x34')][_0xaf20('0x1d')]);_0x478e22[_0xaf20('0x1b')]=qs[_0xaf20('0x1b')](_0x13ccff[_0xaf20('0x34')][_0xaf20('0x1b')]);}_0x478e22[_0xaf20('0x39')]=qs[_0xaf20('0x3a')](_0x13ccff[_0xaf20('0x34')][_0xaf20('0x3a')]);_0x478e22[_0xaf20('0x3b')]=qs[_0xaf20('0x32')](_[_0xaf20('0x3c')](_0x13ccff[_0xaf20('0x34')],_0x25106d[_0xaf20('0x32')]),_0x2a131d);if(_0x13ccff[_0xaf20('0x34')][_0xaf20('0x3d')]){_0x478e22[_0xaf20('0x3b')]=_[_0xaf20('0x3e')](_0x478e22['where'],{'$or':_[_0xaf20('0x2b')](_0x2a131d,function(_0x481be6){if(_0x481be6['type']!==_0xaf20('0x3f')){var _0xb2f057={};_0xb2f057[_0x481be6[_0xaf20('0x28')]]={'$like':'%'+_0x13ccff[_0xaf20('0x34')][_0xaf20('0x3d')]+'%'};return _0xb2f057;}})});}_0x478e22=_[_0xaf20('0x3e')]({},_0x478e22,_0x13ccff[_0xaf20('0x40')]);var _0x3e38d6={'where':_0x478e22[_0xaf20('0x3b')]};return db[_0xaf20('0x2c')]['count'](_0x3e38d6)['then'](function(_0x1aa5d6){_0xc9bad3[_0xaf20('0x1e')]=_0x1aa5d6;if(_0x13ccff['query'][_0xaf20('0x41')]){_0x478e22[_0xaf20('0x42')]=[{'all':!![]}];}return db[_0xaf20('0x2c')][_0xaf20('0x43')](_0x478e22);})[_0xaf20('0x24')](function(_0x149542){_0xc9bad3[_0xaf20('0x44')]=_0x149542;return _0xc9bad3;})[_0xaf20('0x24')](respondWithFilteredResult(_0x3e36e9,_0x478e22))[_0xaf20('0x45')](handleError(_0x3e36e9,null));};exports['show']=function(_0x274c26,_0x52e246){var _0x53896b={'raw':![],'where':{'id':_0x274c26[_0xaf20('0x46')]['id']}},_0x5d2f69={};_0x5d2f69[_0xaf20('0x30')]=_[_0xaf20('0x31')](db[_0xaf20('0x2c')][_0xaf20('0x2d')]);_0x5d2f69[_0xaf20('0x34')]=_[_0xaf20('0x31')](_0x274c26[_0xaf20('0x34')]);_0x5d2f69[_0xaf20('0x32')]=_[_0xaf20('0x33')](_0x5d2f69[_0xaf20('0x30')],_0x5d2f69[_0xaf20('0x34')]);_0x53896b[_0xaf20('0x36')]=_['intersection'](_0x5d2f69['model'],qs[_0xaf20('0x35')](_0x274c26['query'][_0xaf20('0x35')]));_0x53896b[_0xaf20('0x36')]=_0x53896b[_0xaf20('0x36')][_0xaf20('0x37')]?_0x53896b['attributes']:_0x5d2f69[_0xaf20('0x30')];if(_0x274c26[_0xaf20('0x34')]['includeAll']){_0x53896b[_0xaf20('0x42')]=[{'all':!![]}];}_0x53896b=_[_0xaf20('0x3e')]({},_0x53896b,_0x274c26['options']);return db[_0xaf20('0x2c')]['find'](_0x53896b)[_0xaf20('0x24')](handleEntityNotFound(_0x52e246,null))['then'](respondWithResult(_0x52e246,null))[_0xaf20('0x45')](handleError(_0x52e246,null));};exports[_0xaf20('0x47')]=function(_0x1fb001,_0x14fd73){return db[_0xaf20('0x2c')]['create'](_0x1fb001[_0xaf20('0x48')],{})[_0xaf20('0x24')](respondWithResult(_0x14fd73,0xc9))[_0xaf20('0x45')](handleError(_0x14fd73,null));};exports[_0xaf20('0x49')]=function(_0x21271c,_0x4f43a6){if(_0x21271c[_0xaf20('0x48')]['id']){delete _0x21271c[_0xaf20('0x48')]['id'];}return db[_0xaf20('0x2c')][_0xaf20('0x4a')]({'where':{'id':_0x21271c[_0xaf20('0x46')]['id']}})[_0xaf20('0x24')](handleEntityNotFound(_0x4f43a6,null))['then'](saveUpdates(_0x21271c[_0xaf20('0x48')],null))[_0xaf20('0x24')](respondWithResult(_0x4f43a6,null))[_0xaf20('0x45')](handleError(_0x4f43a6,null));};exports[_0xaf20('0x25')]=function(_0x3c8fc8,_0x4303fb){return db[_0xaf20('0x2c')][_0xaf20('0x4a')]({'where':{'id':_0x3c8fc8[_0xaf20('0x46')]['id']}})[_0xaf20('0x24')](handleEntityNotFound(_0x4303fb,null))['then'](removeEntity(_0x4303fb,null))[_0xaf20('0x45')](handleError(_0x4303fb,null));};exports[_0xaf20('0x4b')]=function(_0x4c6397,_0x1e80c5,_0x4ca0a1){var _0x1dbb95={};var _0x1cb544={};var _0x148a02;var _0x2a280a;return db[_0xaf20('0x2c')][_0xaf20('0x4c')]({'where':{'id':_0x4c6397[_0xaf20('0x46')]['id']}})[_0xaf20('0x24')](handleEntityNotFound(_0x1e80c5,null))['then'](function(_0x396fe5){if(_0x396fe5){_0x148a02=_0x396fe5;_0x1cb544['model']=_['keys'](db['DeskConfiguration'][_0xaf20('0x2d')]);_0x1cb544[_0xaf20('0x34')]=_[_0xaf20('0x31')](_0x4c6397['query']);_0x1cb544[_0xaf20('0x32')]=_[_0xaf20('0x33')](_0x1cb544['model'],_0x1cb544['query']);_0x1dbb95[_0xaf20('0x36')]=_['intersection'](_0x1cb544[_0xaf20('0x30')],qs[_0xaf20('0x35')](_0x4c6397[_0xaf20('0x34')]['fields']));_0x1dbb95[_0xaf20('0x36')]=_0x1dbb95[_0xaf20('0x36')]['length']?_0x1dbb95[_0xaf20('0x36')]:_0x1cb544[_0xaf20('0x30')];_0x1dbb95[_0xaf20('0x39')]=qs[_0xaf20('0x3a')](_0x4c6397[_0xaf20('0x34')][_0xaf20('0x3a')]);_0x1dbb95['where']=qs[_0xaf20('0x32')](_[_0xaf20('0x3c')](_0x4c6397[_0xaf20('0x34')],_0x1cb544[_0xaf20('0x32')]));if(_0x4c6397[_0xaf20('0x34')][_0xaf20('0x3d')]){_0x1dbb95[_0xaf20('0x3b')]=_['merge'](_0x1dbb95[_0xaf20('0x3b')],{'$or':_[_0xaf20('0x2b')](_0x1dbb95[_0xaf20('0x36')],function(_0x49c2c5){var _0x13e953={};_0x13e953[_0x49c2c5]={'$like':'%'+_0x4c6397['query'][_0xaf20('0x3d')]+'%'};return _0x13e953;})});}_0x1dbb95=_['merge']({},_0x1dbb95,_0x4c6397[_0xaf20('0x40')]);return _0x148a02[_0xaf20('0x4b')](_0x1dbb95);}})['then'](function(_0x29b158){if(_0x29b158){_0x2a280a=_0x29b158['length'];if(!_0x4c6397[_0xaf20('0x34')][_0xaf20('0x38')]('nolimit')){_0x1dbb95[_0xaf20('0x1d')]=qs[_0xaf20('0x1d')](_0x4c6397[_0xaf20('0x34')][_0xaf20('0x1d')]);_0x1dbb95[_0xaf20('0x1b')]=qs['offset'](_0x4c6397[_0xaf20('0x34')]['offset']);}return _0x148a02[_0xaf20('0x4b')](_0x1dbb95);}})[_0xaf20('0x24')](function(_0x50727a){if(_0x50727a){return _0x50727a?{'count':_0x2a280a,'rows':_0x50727a}:null;}})[_0xaf20('0x24')](respondWithResult(_0x1e80c5,null))[_0xaf20('0x45')](handleError(_0x1e80c5,null));};exports['addConfiguration']=function(_0x4fe7d2,_0x2a0f21,_0x1bce89){if(_0x4fe7d2[_0xaf20('0x48')]['id']){delete _0x4fe7d2[_0xaf20('0x48')]['id'];}return db[_0xaf20('0x2c')]['findOne']({'where':{'id':_0x4fe7d2[_0xaf20('0x46')]['id']}})[_0xaf20('0x24')](handleEntityNotFound(_0x2a0f21,null))[_0xaf20('0x24')](function(_0x400742){if(_0x400742){_0x4fe7d2[_0xaf20('0x48')][_0xaf20('0x4d')]=_0x400742['id'];_0x4fe7d2['body']['Subjects']=integrations[_0xaf20('0x4e')](_0x4fe7d2['body'][_0xaf20('0x4f')],_0x4fe7d2[_0xaf20('0x48')][_0xaf20('0x2e')]);_0x4fe7d2[_0xaf20('0x48')][_0xaf20('0x50')]=integrations[_0xaf20('0x51')](_0x4fe7d2[_0xaf20('0x48')][_0xaf20('0x4f')],_0x4fe7d2[_0xaf20('0x48')][_0xaf20('0x2e')]);return db['DeskConfiguration'][_0xaf20('0x47')](_0x4fe7d2[_0xaf20('0x48')],{'include':[{'model':db[_0xaf20('0x52')],'as':_0xaf20('0x53')},{'model':db[_0xaf20('0x52')],'as':'Descriptions'}]});}return null;})[_0xaf20('0x24')](respondWithResult(_0x2a0f21,null))[_0xaf20('0x45')](handleError(_0x2a0f21,null));};exports[_0xaf20('0x54')]=function(_0x747c91,_0x3b5df5,_0x3a2b85){var _0x4f4c98=[{'name':'priority','label':_0xaf20('0x55'),'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 _0x4fe232='';return db[_0xaf20('0x2c')][_0xaf20('0x4c')]({'where':{'id':_0x747c91[_0xaf20('0x46')]['id']},'attributes':['id','remoteUri','authType',_0xaf20('0x56'),_0xaf20('0x57'),_0xaf20('0x58'),_0xaf20('0x59'),_0xaf20('0x5a'),_0xaf20('0x5b')]})[_0xaf20('0x24')](handleEntityNotFound(_0x3b5df5,null))['then'](function(_0x361ca7){if(_0x361ca7){_0x4fe232=_0x361ca7[_0xaf20('0x5c')];var _0x597af3=_0x4fe232[_0xaf20('0x5d')](-0x1);if(_0x597af3==='/'){_0x4fe232=_0x4fe232[_0xaf20('0x5e')](0x0,_0x4fe232[_0xaf20('0x5f')](_0x597af3));}var _0x494073={'method':'GET','uri':util[_0xaf20('0x60')]('%s/custom_fields',_0x4fe232),'headers':{'Content-Type':_0xaf20('0x61'),'Accept':_0xaf20('0x61')},'json':!![]};if(_0x361ca7[_0xaf20('0x62')]===_0xaf20('0x63')){_0x494073[_0xaf20('0x64')][_0xaf20('0x65')]=util[_0xaf20('0x60')](_0xaf20('0x66'),new Buffer(util[_0xaf20('0x60')](_0xaf20('0x67'),_0x361ca7[_0xaf20('0x56')],_0x361ca7[_0xaf20('0x57')]))[_0xaf20('0x68')](_0xaf20('0x69')));}return rp(_0x494073)['then'](function(_0x55a0cd){return _0x4f4c98[_0xaf20('0x6a')](_['map'](_0x55a0cd[_0xaf20('0x6b')][_0xaf20('0x6c')],function(_0x337834){return{'id':_0x337834[_0xaf20('0x28')],'name':_0x337834[_0xaf20('0x28')],'type':_0x337834[_0xaf20('0x2e')],'active':_0x337834[_0xaf20('0x6d')],'label':_0x337834[_0xaf20('0x6e')],'custom':!![]};}));});}})[_0xaf20('0x24')](function(_0x2cca73){return{'count':_0x2cca73[_0xaf20('0x37')],'rows':_0x2cca73};})[_0xaf20('0x24')](respondWithResult(_0x3b5df5,null))[_0xaf20('0x45')](function(_0x2a22a2){var _0x4dde19=_0x747c91[_0xaf20('0x34')]['test']?0x1f4:_0x2a22a2['statusCode']||0x1f4;logger[_0xaf20('0x6f')](_0xaf20('0x70'),_0xaf20('0x54'),_0x4dde19,JSON[_0xaf20('0x71')](_0x2a22a2));delete _0x2a22a2[_0xaf20('0x28')];if(_0x4dde19===0x191){_0x4dde19=0x190;}_0x3b5df5[_0xaf20('0x19')](_0x4dde19)[_0xaf20('0x29')](_0x747c91[_0xaf20('0x34')]['test']?{'message':_0xaf20('0x72'),'statusCode':_0x2a22a2[_0xaf20('0x73')]}:_0x2a22a2);});}; \ No newline at end of file +var _0x554c=['DeskAccount','rawAttributes','type','key','keys','query','filters','intersection','fields','attributes','length','model','sort','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','DeskConfiguration','order','where','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','basic','headers','Authorization','toString','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','map'];(function(_0x3743e5,_0x4b6bb9){var _0x370603=function(_0x1d8df1){while(--_0x1d8df1){_0x3743e5['push'](_0x3743e5['shift']());}};_0x370603(++_0x4b6bb9);}(_0x554c,0x127));var _0xc554=function(_0x2dbae6,_0x424afb){_0x2dbae6=_0x2dbae6-0x0;var _0x37f9ae=_0x554c[_0x2dbae6];return _0x37f9ae;};'use strict';var emlformat=require(_0xc554('0x0'));var rimraf=require(_0xc554('0x1'));var zipdir=require(_0xc554('0x2'));var jsonpatch=require(_0xc554('0x3'));var rp=require('request-promise');var moment=require(_0xc554('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc554('0x5'));var util=require(_0xc554('0x6'));var path=require(_0xc554('0x7'));var sox=require('sox');var csv=require(_0xc554('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc554('0x9'));var squel=require(_0xc554('0xa'));var crypto=require(_0xc554('0xb'));var jsforce=require(_0xc554('0xc'));var deskjs=require(_0xc554('0xd'));var toCsv=require(_0xc554('0x8'));var querystring=require(_0xc554('0xe'));var Papa=require(_0xc554('0xf'));var Redis=require(_0xc554('0x10'));var authService=require(_0xc554('0x11'));var qs=require(_0xc554('0x12'));var as=require(_0xc554('0x13'));var hardwareService=require(_0xc554('0x14'));var logger=require(_0xc554('0x15'))(_0xc554('0x16'));var utils=require(_0xc554('0x17'));var config=require(_0xc554('0x18'));var licenseUtil=require(_0xc554('0x19'));var db=require(_0xc554('0x1a'))['db'];var integrations=require(_0xc554('0x1b'));function respondWithStatusCode(_0x11ac26,_0x7ff077){_0x7ff077=_0x7ff077||0xcc;return function(_0x493c68){if(_0x493c68){return _0x11ac26[_0xc554('0x1c')](_0x7ff077);}return _0x11ac26[_0xc554('0x1d')](_0x7ff077)[_0xc554('0x1e')]();};}function respondWithResult(_0x1fc61c,_0x44df8){_0x44df8=_0x44df8||0xc8;return function(_0x4937bb){if(_0x4937bb){return _0x1fc61c[_0xc554('0x1d')](_0x44df8)[_0xc554('0x1f')](_0x4937bb);}};}function respondWithFilteredResult(_0x173f63,_0x2e99c5){return function(_0x54a34b){if(_0x54a34b){var _0x5b98d6=typeof _0x2e99c5[_0xc554('0x20')]===_0xc554('0x21')&&typeof _0x2e99c5[_0xc554('0x22')]===_0xc554('0x21');var _0x51c89b=_0x54a34b['count'];var _0x5009df=_0x5b98d6?0x0:_0x2e99c5[_0xc554('0x20')];var _0x6b2cf5=_0x5b98d6?_0x54a34b[_0xc554('0x23')]:_0x2e99c5[_0xc554('0x20')]+_0x2e99c5[_0xc554('0x22')];var _0x35bf8a;if(_0x6b2cf5>=_0x51c89b){_0x6b2cf5=_0x51c89b;_0x35bf8a=0xc8;}else{_0x35bf8a=0xce;}_0x173f63[_0xc554('0x1d')](_0x35bf8a);return _0x173f63[_0xc554('0x24')](_0xc554('0x25'),_0x5009df+'-'+_0x6b2cf5+'/'+_0x51c89b)[_0xc554('0x1f')](_0x54a34b);}return null;};}function patchUpdates(_0x3197e3){return function(_0x351f54){try{jsonpatch[_0xc554('0x26')](_0x351f54,_0x3197e3,!![]);}catch(_0x5633e1){return BPromise[_0xc554('0x27')](_0x5633e1);}return _0x351f54['save']();};}function saveUpdates(_0x1506ef,_0x4c9b3b){return function(_0x45624b){if(_0x45624b){return _0x45624b[_0xc554('0x28')](_0x1506ef)['then'](function(_0x433e9b){return _0x433e9b;});}return null;};}function removeEntity(_0x32a1fd,_0x1c80fb){return function(_0xb171bb){if(_0xb171bb){return _0xb171bb[_0xc554('0x29')]()[_0xc554('0x2a')](function(){_0x32a1fd[_0xc554('0x1d')](0xcc)[_0xc554('0x1e')]();});}};}function handleEntityNotFound(_0x4a6384,_0x176efe){return function(_0x53edcc){if(!_0x53edcc){_0x4a6384[_0xc554('0x1c')](0x194);}return _0x53edcc;};}function handleError(_0x5e636d,_0x7ed7ca){_0x7ed7ca=_0x7ed7ca||0x1f4;return function(_0x7f1ebc){logger[_0xc554('0x2b')](_0x7f1ebc['stack']);if(_0x7f1ebc[_0xc554('0x2c')]){delete _0x7f1ebc[_0xc554('0x2c')];}_0x5e636d[_0xc554('0x1d')](_0x7ed7ca)[_0xc554('0x2d')](_0x7f1ebc);};}exports['index']=function(_0x1287f4,_0x58cde9){var _0x6fef5a={},_0x4fc458={},_0x22fd71={'count':0x0,'rows':[]};var _0x50d3f3=_[_0xc554('0x2e')](db[_0xc554('0x2f')][_0xc554('0x30')],function(_0xe05459){return{'name':_0xe05459['fieldName'],'type':_0xe05459[_0xc554('0x31')][_0xc554('0x32')]};});_0x4fc458['model']=_['map'](_0x50d3f3,_0xc554('0x2c'));_0x4fc458['query']=_[_0xc554('0x33')](_0x1287f4[_0xc554('0x34')]);_0x4fc458[_0xc554('0x35')]=_[_0xc554('0x36')](_0x4fc458['model'],_0x4fc458['query']);_0x6fef5a['attributes']=_[_0xc554('0x36')](_0x4fc458['model'],qs['fields'](_0x1287f4[_0xc554('0x34')][_0xc554('0x37')]));_0x6fef5a[_0xc554('0x38')]=_0x6fef5a[_0xc554('0x38')][_0xc554('0x39')]?_0x6fef5a[_0xc554('0x38')]:_0x4fc458[_0xc554('0x3a')];if(!_0x1287f4[_0xc554('0x34')]['hasOwnProperty']('nolimit')){_0x6fef5a[_0xc554('0x22')]=qs[_0xc554('0x22')](_0x1287f4[_0xc554('0x34')][_0xc554('0x22')]);_0x6fef5a[_0xc554('0x20')]=qs[_0xc554('0x20')](_0x1287f4[_0xc554('0x34')]['offset']);}_0x6fef5a['order']=qs[_0xc554('0x3b')](_0x1287f4[_0xc554('0x34')][_0xc554('0x3b')]);_0x6fef5a['where']=qs[_0xc554('0x35')](_['pick'](_0x1287f4[_0xc554('0x34')],_0x4fc458[_0xc554('0x35')]),_0x50d3f3);if(_0x1287f4[_0xc554('0x34')]['filter']){_0x6fef5a['where']=_[_0xc554('0x3c')](_0x6fef5a['where'],{'$or':_[_0xc554('0x2e')](_0x50d3f3,function(_0x2cdcb0){if(_0x2cdcb0['type']!=='VIRTUAL'){var _0x3902fb={};_0x3902fb[_0x2cdcb0[_0xc554('0x2c')]]={'$like':'%'+_0x1287f4[_0xc554('0x34')]['filter']+'%'};return _0x3902fb;}})});}_0x6fef5a=_[_0xc554('0x3c')]({},_0x6fef5a,_0x1287f4[_0xc554('0x3d')]);var _0x4e26c4={'where':_0x6fef5a['where']};return db[_0xc554('0x2f')][_0xc554('0x23')](_0x4e26c4)[_0xc554('0x2a')](function(_0x5c33ea){_0x22fd71[_0xc554('0x23')]=_0x5c33ea;if(_0x1287f4[_0xc554('0x34')][_0xc554('0x3e')]){_0x6fef5a['include']=[{'all':!![]}];}return db[_0xc554('0x2f')][_0xc554('0x3f')](_0x6fef5a);})['then'](function(_0x5c2b57){_0x22fd71[_0xc554('0x40')]=_0x5c2b57;return _0x22fd71;})[_0xc554('0x2a')](respondWithFilteredResult(_0x58cde9,_0x6fef5a))[_0xc554('0x41')](handleError(_0x58cde9,null));};exports[_0xc554('0x42')]=function(_0x5168e5,_0x3d49fd){var _0x23e5f3={'raw':![],'where':{'id':_0x5168e5[_0xc554('0x43')]['id']}},_0x53bdff={};_0x53bdff[_0xc554('0x3a')]=_[_0xc554('0x33')](db[_0xc554('0x2f')][_0xc554('0x30')]);_0x53bdff['query']=_['keys'](_0x5168e5[_0xc554('0x34')]);_0x53bdff[_0xc554('0x35')]=_[_0xc554('0x36')](_0x53bdff[_0xc554('0x3a')],_0x53bdff[_0xc554('0x34')]);_0x23e5f3[_0xc554('0x38')]=_[_0xc554('0x36')](_0x53bdff['model'],qs[_0xc554('0x37')](_0x5168e5[_0xc554('0x34')][_0xc554('0x37')]));_0x23e5f3['attributes']=_0x23e5f3['attributes'][_0xc554('0x39')]?_0x23e5f3[_0xc554('0x38')]:_0x53bdff[_0xc554('0x3a')];if(_0x5168e5['query']['includeAll']){_0x23e5f3[_0xc554('0x44')]=[{'all':!![]}];}_0x23e5f3=_['merge']({},_0x23e5f3,_0x5168e5[_0xc554('0x3d')]);return db[_0xc554('0x2f')][_0xc554('0x45')](_0x23e5f3)[_0xc554('0x2a')](handleEntityNotFound(_0x3d49fd,null))[_0xc554('0x2a')](respondWithResult(_0x3d49fd,null))[_0xc554('0x41')](handleError(_0x3d49fd,null));};exports[_0xc554('0x46')]=function(_0x3173b8,_0x241f68){return db[_0xc554('0x2f')]['create'](_0x3173b8[_0xc554('0x47')],{})[_0xc554('0x2a')](respondWithResult(_0x241f68,0xc9))[_0xc554('0x41')](handleError(_0x241f68,null));};exports['update']=function(_0x3592aa,_0x130126){if(_0x3592aa[_0xc554('0x47')]['id']){delete _0x3592aa[_0xc554('0x47')]['id'];}return db[_0xc554('0x2f')][_0xc554('0x45')]({'where':{'id':_0x3592aa['params']['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x130126,null))[_0xc554('0x2a')](saveUpdates(_0x3592aa[_0xc554('0x47')],null))[_0xc554('0x2a')](respondWithResult(_0x130126,null))[_0xc554('0x41')](handleError(_0x130126,null));};exports['destroy']=function(_0x4c2b14,_0x4c7603){return db['DeskAccount'][_0xc554('0x45')]({'where':{'id':_0x4c2b14[_0xc554('0x43')]['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x4c7603,null))[_0xc554('0x2a')](removeEntity(_0x4c7603,null))[_0xc554('0x41')](handleError(_0x4c7603,null));};exports[_0xc554('0x48')]=function(_0x276161,_0x4e77aa,_0x31cc47){var _0x1214d6={};var _0x1f1309={};var _0xb95fb1;var _0x2595aa;return db[_0xc554('0x2f')][_0xc554('0x49')]({'where':{'id':_0x276161[_0xc554('0x43')]['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x4e77aa,null))[_0xc554('0x2a')](function(_0xc33439){if(_0xc33439){_0xb95fb1=_0xc33439;_0x1f1309[_0xc554('0x3a')]=_[_0xc554('0x33')](db[_0xc554('0x4a')]['rawAttributes']);_0x1f1309[_0xc554('0x34')]=_[_0xc554('0x33')](_0x276161['query']);_0x1f1309[_0xc554('0x35')]=_[_0xc554('0x36')](_0x1f1309[_0xc554('0x3a')],_0x1f1309['query']);_0x1214d6['attributes']=_[_0xc554('0x36')](_0x1f1309[_0xc554('0x3a')],qs[_0xc554('0x37')](_0x276161[_0xc554('0x34')][_0xc554('0x37')]));_0x1214d6[_0xc554('0x38')]=_0x1214d6[_0xc554('0x38')][_0xc554('0x39')]?_0x1214d6[_0xc554('0x38')]:_0x1f1309[_0xc554('0x3a')];_0x1214d6[_0xc554('0x4b')]=qs[_0xc554('0x3b')](_0x276161[_0xc554('0x34')][_0xc554('0x3b')]);_0x1214d6[_0xc554('0x4c')]=qs[_0xc554('0x35')](_[_0xc554('0x4d')](_0x276161[_0xc554('0x34')],_0x1f1309[_0xc554('0x35')]));if(_0x276161[_0xc554('0x34')]['filter']){_0x1214d6[_0xc554('0x4c')]=_[_0xc554('0x3c')](_0x1214d6['where'],{'$or':_[_0xc554('0x2e')](_0x1214d6[_0xc554('0x38')],function(_0x60abe9){var _0xfbf9fd={};_0xfbf9fd[_0x60abe9]={'$like':'%'+_0x276161[_0xc554('0x34')]['filter']+'%'};return _0xfbf9fd;})});}_0x1214d6=_[_0xc554('0x3c')]({},_0x1214d6,_0x276161['options']);return _0xb95fb1['getConfigurations'](_0x1214d6);}})[_0xc554('0x2a')](function(_0x363ca0){if(_0x363ca0){_0x2595aa=_0x363ca0[_0xc554('0x39')];if(!_0x276161['query'][_0xc554('0x4e')](_0xc554('0x4f'))){_0x1214d6[_0xc554('0x22')]=qs[_0xc554('0x22')](_0x276161[_0xc554('0x34')][_0xc554('0x22')]);_0x1214d6[_0xc554('0x20')]=qs[_0xc554('0x20')](_0x276161[_0xc554('0x34')][_0xc554('0x20')]);}return _0xb95fb1[_0xc554('0x48')](_0x1214d6);}})[_0xc554('0x2a')](function(_0x5c27b0){if(_0x5c27b0){return _0x5c27b0?{'count':_0x2595aa,'rows':_0x5c27b0}:null;}})[_0xc554('0x2a')](respondWithResult(_0x4e77aa,null))[_0xc554('0x41')](handleError(_0x4e77aa,null));};exports[_0xc554('0x50')]=function(_0x2e5a49,_0x35e61c,_0x3904b3){if(_0x2e5a49[_0xc554('0x47')]['id']){delete _0x2e5a49['body']['id'];}return db[_0xc554('0x2f')][_0xc554('0x49')]({'where':{'id':_0x2e5a49[_0xc554('0x43')]['id']}})[_0xc554('0x2a')](handleEntityNotFound(_0x35e61c,null))[_0xc554('0x2a')](function(_0x52d12c){if(_0x52d12c){_0x2e5a49[_0xc554('0x47')][_0xc554('0x51')]=_0x52d12c['id'];_0x2e5a49[_0xc554('0x47')][_0xc554('0x52')]=integrations['getSubjects'](_0x2e5a49[_0xc554('0x47')][_0xc554('0x53')],_0x2e5a49[_0xc554('0x47')][_0xc554('0x31')]);_0x2e5a49[_0xc554('0x47')][_0xc554('0x54')]=integrations[_0xc554('0x55')](_0x2e5a49['body'][_0xc554('0x53')],_0x2e5a49['body'][_0xc554('0x31')]);return db[_0xc554('0x4a')][_0xc554('0x46')](_0x2e5a49[_0xc554('0x47')],{'include':[{'model':db['DeskField'],'as':_0xc554('0x52')},{'model':db[_0xc554('0x56')],'as':_0xc554('0x54')}]});}return null;})[_0xc554('0x2a')](respondWithResult(_0x35e61c,null))[_0xc554('0x41')](handleError(_0x35e61c,null));};exports[_0xc554('0x57')]=function(_0x2ea0d5,_0x3f4cfb,_0x293da1){var _0x2af638=[{'name':_0xc554('0x58'),'label':_0xc554('0x58'),'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 _0x301584='';return db[_0xc554('0x2f')][_0xc554('0x49')]({'where':{'id':_0x2ea0d5[_0xc554('0x43')]['id']},'attributes':['id','remoteUri',_0xc554('0x59'),_0xc554('0x5a'),_0xc554('0x5b'),_0xc554('0x5c'),_0xc554('0x5d'),_0xc554('0x5e'),_0xc554('0x5f')]})['then'](handleEntityNotFound(_0x3f4cfb,null))[_0xc554('0x2a')](function(_0x479575){if(_0x479575){_0x301584=_0x479575['remoteUri'];var _0xf23b3f=_0x301584['slice'](-0x1);if(_0xf23b3f==='/'){_0x301584=_0x301584[_0xc554('0x60')](0x0,_0x301584[_0xc554('0x61')](_0xf23b3f));}var _0x14c837={'method':_0xc554('0x62'),'uri':util[_0xc554('0x63')]('%s/custom_fields',_0x301584),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x479575['authType']===_0xc554('0x64')){_0x14c837[_0xc554('0x65')][_0xc554('0x66')]=util[_0xc554('0x63')]('Basic\x20%s',new Buffer(util[_0xc554('0x63')]('%s:%s',_0x479575[_0xc554('0x5a')],_0x479575[_0xc554('0x5b')]))[_0xc554('0x67')]('base64'));}return rp(_0x14c837)[_0xc554('0x2a')](function(_0x1d6bf4){return _0x2af638[_0xc554('0x68')](_[_0xc554('0x2e')](_0x1d6bf4[_0xc554('0x69')][_0xc554('0x6a')],function(_0x1ffd01){return{'id':_0x1ffd01['name'],'name':_0x1ffd01[_0xc554('0x2c')],'type':_0x1ffd01[_0xc554('0x31')],'active':_0x1ffd01[_0xc554('0x6b')],'label':_0x1ffd01[_0xc554('0x6c')],'custom':!![]};}));});}})[_0xc554('0x2a')](function(_0x4ea1d5){return{'count':_0x4ea1d5[_0xc554('0x39')],'rows':_0x4ea1d5};})[_0xc554('0x2a')](respondWithResult(_0x3f4cfb,null))[_0xc554('0x41')](function(_0x22f1da){var _0x5285ba=_0x2ea0d5[_0xc554('0x34')]['test']?0x1f4:_0x22f1da[_0xc554('0x6d')]||0x1f4;logger[_0xc554('0x2b')](_0xc554('0x6e'),_0xc554('0x57'),_0x5285ba,JSON[_0xc554('0x6f')](_0x22f1da));delete _0x22f1da['name'];if(_0x5285ba===0x191){_0x5285ba=0x190;}_0x3f4cfb['status'](_0x5285ba)[_0xc554('0x2d')](_0x2ea0d5[_0xc554('0x34')][_0xc554('0x70')]?{'message':_0xc554('0x71'),'statusCode':_0x22f1da[_0xc554('0x6d')]}:_0x22f1da);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 457ef31..d1a1724 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 _0x85cb=['api','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','define','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x2eb2ae,_0x171846){var _0x2b7eb6=function(_0x26e88c){while(--_0x26e88c){_0x2eb2ae['push'](_0x2eb2ae['shift']());}};_0x2b7eb6(++_0x171846);}(_0x85cb,0xa2));var _0xb85c=function(_0x19b908,_0x29a9d3){_0x19b908=_0x19b908-0x0;var _0x390a02=_0x85cb[_0x19b908];return _0x390a02;};'use strict';var _=require(_0xb85c('0x0'));var util=require(_0xb85c('0x1'));var logger=require(_0xb85c('0x2'))(_0xb85c('0x3'));var moment=require('moment');var BPromise=require(_0xb85c('0x4'));var rp=require(_0xb85c('0x5'));var fs=require('fs');var path=require(_0xb85c('0x6'));var rimraf=require(_0xb85c('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xb85c('0x8'));module['exports']=function(_0x5c4869,_0x338d1d){return _0x5c4869[_0xb85c('0x9')]('DeskAccount',attributes,{'tableName':_0xb85c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7587=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x212072,_0x4586d3){var _0x35db9e=function(_0x4312b8){while(--_0x4312b8){_0x212072['push'](_0x212072['shift']());}};_0x35db9e(++_0x4586d3);}(_0x7587,0x1b1));var _0x7758=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7587[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7758('0x0'))('api');var moment=require(_0x7758('0x1'));var BPromise=require(_0x7758('0x2'));var rp=require(_0x7758('0x3'));var fs=require('fs');var path=require(_0x7758('0x4'));var rimraf=require('rimraf');var config=require(_0x7758('0x5'));var attributes=require(_0x7758('0x6'));var integrations=require(_0x7758('0x7'));module['exports']=function(_0x10d056,_0x4e0a04){return _0x10d056[_0x7758('0x8')](_0x7758('0x9'),attributes,{'tableName':_0x7758('0xa'),'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 b8485c2..3653362 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 _0xa49b=['message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','limit','include','attributes','map','model','ShowDeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s'];(function(_0x399084,_0x4680aa){var _0x353684=function(_0x1cef84){while(--_0x1cef84){_0x399084['push'](_0x399084['shift']());}};_0x353684(++_0x4680aa);}(_0xa49b,0x104));var _0xba49=function(_0x5044c4,_0x407550){_0x5044c4=_0x5044c4-0x0;var _0x1fcca8=_0xa49b[_0x5044c4];return _0x1fcca8;};'use strict';var _=require(_0xba49('0x0'));var util=require(_0xba49('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xba49('0x2'));var fs=require('fs');var Redis=require(_0xba49('0x3'));var db=require(_0xba49('0x4'))['db'];var utils=require(_0xba49('0x5'));var logger=require(_0xba49('0x6'))('rpc');var config=require(_0xba49('0x7'));var jayson=require(_0xba49('0x8'));var client=jayson['client'][_0xba49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x565dd1,_0x44ae57,_0xb4f6c){return new BPromise(function(_0x489939,_0x1bbc93){return client[_0xba49('0xa')](_0x565dd1,_0xb4f6c)[_0xba49('0xb')](function(_0x17a65c){logger[_0xba49('0xc')]('DeskAccount,\x20%s,\x20%s',_0x44ae57,_0xba49('0xd'));logger[_0xba49('0xe')](_0xba49('0xf'),_0x44ae57,_0xba49('0xd'),JSON[_0xba49('0x10')](_0x17a65c));if(_0x17a65c[_0xba49('0x11')]){if(_0x17a65c[_0xba49('0x11')][_0xba49('0x12')]===0x1f4){logger[_0xba49('0x11')](_0xba49('0x13'),_0x44ae57,_0x17a65c['error']['message']);return _0x1bbc93(_0x17a65c[_0xba49('0x11')][_0xba49('0x14')]);}logger['error'](_0xba49('0x13'),_0x44ae57,_0x17a65c[_0xba49('0x11')]['message']);return _0x489939(_0x17a65c[_0xba49('0x11')][_0xba49('0x14')]);}else{logger[_0xba49('0xc')](_0xba49('0x13'),_0x44ae57,'request\x20sent');_0x489939(_0x17a65c[_0xba49('0x15')]['message']);}})[_0xba49('0x16')](function(_0x174c19){logger[_0xba49('0x11')](_0xba49('0x13'),_0x44ae57,_0x174c19);_0x1bbc93(_0x174c19);});});}exports[_0xba49('0x17')]=function(_0x243364){var _0x212c90=this;return new Promise(function(_0x1bc970,_0x15f3d9){return db[_0xba49('0x18')]['findAll']({'raw':_0x243364[_0xba49('0x19')]?_0x243364['options'][_0xba49('0x1a')]===undefined?!![]:![]:!![],'where':_0x243364[_0xba49('0x19')]?_0x243364[_0xba49('0x19')][_0xba49('0x1b')]||null:null,'attributes':_0x243364['options']?_0x243364[_0xba49('0x19')]['attributes']||null:null,'limit':_0x243364[_0xba49('0x19')]?_0x243364[_0xba49('0x19')][_0xba49('0x1c')]||null:null,'include':_0x243364['options']?_0x243364[_0xba49('0x19')][_0xba49('0x1d')]?_['map'](_0x243364[_0xba49('0x19')][_0xba49('0x1d')],function(_0x565d04){return{'model':db[_0x565d04['model']],'as':_0x565d04['as'],'attributes':_0x565d04[_0xba49('0x1e')],'include':_0x565d04[_0xba49('0x1d')]?_[_0xba49('0x1f')](_0x565d04[_0xba49('0x1d')],function(_0x5a63e9){return{'model':db[_0x5a63e9['model']],'as':_0x5a63e9['as'],'attributes':_0x5a63e9[_0xba49('0x1e')],'include':_0x5a63e9[_0xba49('0x1d')]?_['map'](_0x5a63e9[_0xba49('0x1d')],function(_0x4cc84c){return{'model':db[_0x4cc84c[_0xba49('0x20')]],'as':_0x4cc84c['as'],'attributes':_0x4cc84c[_0xba49('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13d2c8){logger['info'](_0xba49('0x17'),_0x243364);logger[_0xba49('0xe')](_0xba49('0x17'),_0x243364,JSON[_0xba49('0x10')](_0x13d2c8));_0x1bc970(_0x13d2c8);})[_0xba49('0x16')](function(_0x33ecb3){logger[_0xba49('0x11')]('GetDeskAccount',_0x33ecb3[_0xba49('0x14')],_0x243364);_0x15f3d9(_0x212c90['error'](0x1f4,_0x33ecb3[_0xba49('0x14')]));});});};exports[_0xba49('0x21')]=function(_0x170c51){var _0x407d26=this;return new Promise(function(_0x445881,_0xbfe50c){return db[_0xba49('0x18')][_0xba49('0x22')]({'raw':_0x170c51[_0xba49('0x19')]?_0x170c51[_0xba49('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x170c51['options']?_0x170c51[_0xba49('0x19')]['where']||null:null,'attributes':_0x170c51[_0xba49('0x19')]?_0x170c51[_0xba49('0x19')][_0xba49('0x1e')]||null:null,'include':_0x170c51['options']?_0x170c51[_0xba49('0x19')][_0xba49('0x1d')]?_['map'](_0x170c51[_0xba49('0x19')][_0xba49('0x1d')],function(_0x3c1686){return{'model':db[_0x3c1686[_0xba49('0x20')]],'as':_0x3c1686['as'],'attributes':_0x3c1686[_0xba49('0x1e')],'include':_0x3c1686['include']?_[_0xba49('0x1f')](_0x3c1686[_0xba49('0x1d')],function(_0x33685f){return{'model':db[_0x33685f[_0xba49('0x20')]],'as':_0x33685f['as'],'attributes':_0x33685f['attributes'],'include':_0x33685f[_0xba49('0x1d')]?_['map'](_0x33685f['include'],function(_0x337057){return{'model':db[_0x337057['model']],'as':_0x337057['as'],'attributes':_0x337057[_0xba49('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b9203){logger[_0xba49('0xc')]('ShowDeskAccount',_0x170c51);logger[_0xba49('0xe')](_0xba49('0x21'),_0x170c51,JSON[_0xba49('0x10')](_0x5b9203));_0x445881(_0x5b9203);})[_0xba49('0x16')](function(_0x307260){logger[_0xba49('0x11')](_0xba49('0x21'),_0x307260['message'],_0x170c51);_0xbfe50c(_0x407d26[_0xba49('0x11')](0x1f4,_0x307260['message']));});});}; \ No newline at end of file +var _0x7aee=['stringify','ShowDeskAccount','DeskAccount','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7aee,0x14e));var _0xe7ae=function(_0x1b6308,_0x26cedc){_0x1b6308=_0x1b6308-0x0;var _0x55dffd=_0x7aee[_0x1b6308];return _0x55dffd;};'use strict';var _=require('lodash');var util=require(_0xe7ae('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe7ae('0x1'));var fs=require('fs');var Redis=require(_0xe7ae('0x2'));var db=require(_0xe7ae('0x3'))['db'];var utils=require(_0xe7ae('0x4'));var logger=require(_0xe7ae('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe7ae('0x6'));var client=jayson[_0xe7ae('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17de9a,_0x315635,_0x21e269){return new BPromise(function(_0x4544b1,_0x4b7990){return client['request'](_0x17de9a,_0x21e269)[_0xe7ae('0x8')](function(_0x57d2fa){logger['info'](_0xe7ae('0x9'),_0x315635,_0xe7ae('0xa'));logger[_0xe7ae('0xb')](_0xe7ae('0xc'),_0x315635,_0xe7ae('0xa'),JSON['stringify'](_0x57d2fa));if(_0x57d2fa[_0xe7ae('0xd')]){if(_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xe')]===0x1f4){logger[_0xe7ae('0xd')](_0xe7ae('0x9'),_0x315635,_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xf')]);return _0x4b7990(_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xf')]);}logger[_0xe7ae('0xd')](_0xe7ae('0x9'),_0x315635,_0x57d2fa['error']['message']);return _0x4544b1(_0x57d2fa[_0xe7ae('0xd')][_0xe7ae('0xf')]);}else{logger['info'](_0xe7ae('0x9'),_0x315635,'request\x20sent');_0x4544b1(_0x57d2fa['result'][_0xe7ae('0xf')]);}})[_0xe7ae('0x10')](function(_0x3468c0){logger[_0xe7ae('0xd')](_0xe7ae('0x9'),_0x315635,_0x3468c0);_0x4b7990(_0x3468c0);});});}exports[_0xe7ae('0x11')]=function(_0x44c7ee){var _0x57f33f=this;return new Promise(function(_0x209174,_0x4d8a18){return db['DeskAccount'][_0xe7ae('0x12')]({'raw':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee['options']['raw']===undefined?!![]:![]:!![],'where':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee['options'][_0xe7ae('0x14')]||null:null,'attributes':_0x44c7ee['options']?_0x44c7ee['options'][_0xe7ae('0x15')]||null:null,'limit':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee[_0xe7ae('0x13')][_0xe7ae('0x16')]||null:null,'include':_0x44c7ee[_0xe7ae('0x13')]?_0x44c7ee[_0xe7ae('0x13')][_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x44c7ee[_0xe7ae('0x13')]['include'],function(_0x284915){return{'model':db[_0x284915[_0xe7ae('0x19')]],'as':_0x284915['as'],'attributes':_0x284915[_0xe7ae('0x15')],'include':_0x284915[_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x284915['include'],function(_0x5d145a){return{'model':db[_0x5d145a[_0xe7ae('0x19')]],'as':_0x5d145a['as'],'attributes':_0x5d145a[_0xe7ae('0x15')],'include':_0x5d145a[_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x5d145a[_0xe7ae('0x17')],function(_0x3defbb){return{'model':db[_0x3defbb['model']],'as':_0x3defbb['as'],'attributes':_0x3defbb[_0xe7ae('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b5d8){logger['info'](_0xe7ae('0x11'),_0x44c7ee);logger[_0xe7ae('0xb')](_0xe7ae('0x11'),_0x44c7ee,JSON[_0xe7ae('0x1a')](_0x29b5d8));_0x209174(_0x29b5d8);})[_0xe7ae('0x10')](function(_0xb9b137){logger[_0xe7ae('0xd')](_0xe7ae('0x11'),_0xb9b137[_0xe7ae('0xf')],_0x44c7ee);_0x4d8a18(_0x57f33f['error'](0x1f4,_0xb9b137[_0xe7ae('0xf')]));});});};exports[_0xe7ae('0x1b')]=function(_0x3fd668){var _0x1861d2=this;return new Promise(function(_0x181f6a,_0x5f00e8){return db[_0xe7ae('0x1c')][_0xe7ae('0x1d')]({'raw':_0x3fd668[_0xe7ae('0x13')]?_0x3fd668[_0xe7ae('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3fd668[_0xe7ae('0x13')]?_0x3fd668[_0xe7ae('0x13')]['where']||null:null,'attributes':_0x3fd668[_0xe7ae('0x13')]?_0x3fd668['options'][_0xe7ae('0x15')]||null:null,'include':_0x3fd668['options']?_0x3fd668[_0xe7ae('0x13')][_0xe7ae('0x17')]?_[_0xe7ae('0x18')](_0x3fd668['options'][_0xe7ae('0x17')],function(_0x32fdc6){return{'model':db[_0x32fdc6[_0xe7ae('0x19')]],'as':_0x32fdc6['as'],'attributes':_0x32fdc6[_0xe7ae('0x15')],'include':_0x32fdc6['include']?_[_0xe7ae('0x18')](_0x32fdc6[_0xe7ae('0x17')],function(_0x3fd4ec){return{'model':db[_0x3fd4ec['model']],'as':_0x3fd4ec['as'],'attributes':_0x3fd4ec[_0xe7ae('0x15')],'include':_0x3fd4ec[_0xe7ae('0x17')]?_['map'](_0x3fd4ec[_0xe7ae('0x17')],function(_0x12c651){return{'model':db[_0x12c651['model']],'as':_0x12c651['as'],'attributes':_0x12c651['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32b92c){logger['info'](_0xe7ae('0x1b'),_0x3fd668);logger[_0xe7ae('0xb')](_0xe7ae('0x1b'),_0x3fd668,JSON[_0xe7ae('0x1a')](_0x32b92c));_0x181f6a(_0x32b92c);})['catch'](function(_0x11ea81){logger['error'](_0xe7ae('0x1b'),_0x11ea81[_0xe7ae('0xf')],_0x3fd668);_0x5f00e8(_0x1861d2[_0xe7ae('0xd')](0x1f4,_0x11ea81[_0xe7ae('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 00d0830..5d79ab8 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x395b80,_0x3ae7e8){var _0x571654=function(_0x3bfaa9){while(--_0x3bfaa9){_0x395b80['push'](_0x395b80['shift']());}};_0x571654(++_0x3ae7e8);}(_0xedd9,0xfc));var _0x9edd=function(_0x57ee47,_0x157eec){_0x57ee47=_0x57ee47-0x0;var _0x1017b5=_0xedd9[_0x57ee47];return _0x1017b5;};'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['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x328f3b,_0x449c71){var _0x326d7b=function(_0xbc39c3){while(--_0xbc39c3){_0x328f3b['push'](_0x328f3b['shift']());}};_0x326d7b(++_0x449c71);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 0496caf..f27b114 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 _0x14e9=['sequelize','exports'];(function(_0x5c2eac,_0x566843){var _0x7f47f9=function(_0x19612c){while(--_0x19612c){_0x5c2eac['push'](_0x5c2eac['shift']());}};_0x7f47f9(++_0x566843);}(_0x14e9,0xca));var _0x914e=function(_0x2d4e41,_0x1f1b7f){_0x2d4e41=_0x2d4e41-0x0;var _0x31f398=_0x14e9[_0x2d4e41];return _0x31f398;};'use strict';var Sequelize=require(_0x914e('0x0'));module[_0x914e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x12c2=['STRING','sequelize'];(function(_0x523a68,_0x149c08){var _0x2e1b0d=function(_0x3e5d8e){while(--_0x3e5d8e){_0x523a68['push'](_0x523a68['shift']());}};_0x2e1b0d(++_0x149c08);}(_0x12c2,0xd3));var _0x212c=function(_0x1a7ab0,_0x10e9b8){_0x1a7ab0=_0x1a7ab0-0x0;var _0x2fc724=_0x12c2[_0x1a7ab0];return _0x2fc724;};'use strict';var Sequelize=require(_0x212c('0x0'));module['exports']={'name':{'type':Sequelize[_0x212c('0x1')]},'description':{'type':Sequelize[_0x212c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 5f74995..5a5575a 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 _0xabd6=['body','find','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','intersection','options','catch','create'];(function(_0x4db5db,_0x3fdeea){var _0x91d7e9=function(_0x4b29aa){while(--_0x4b29aa){_0x4db5db['push'](_0x4db5db['shift']());}};_0x91d7e9(++_0x3fdeea);}(_0xabd6,0x104));var _0x6abd=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xabd6[_0x424a9a];return _0xa7831c;};'use strict';var emlformat=require(_0x6abd('0x0'));var rimraf=require(_0x6abd('0x1'));var zipdir=require(_0x6abd('0x2'));var jsonpatch=require(_0x6abd('0x3'));var rp=require(_0x6abd('0x4'));var moment=require(_0x6abd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6abd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6abd('0x7'));var csv=require(_0x6abd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6abd('0x9'));var squel=require('squel');var crypto=require(_0x6abd('0xa'));var jsforce=require(_0x6abd('0xb'));var deskjs=require(_0x6abd('0xc'));var toCsv=require(_0x6abd('0x8'));var querystring=require(_0x6abd('0xd'));var Papa=require('papaparse');var Redis=require(_0x6abd('0xe'));var authService=require(_0x6abd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6abd('0x10'));var hardwareService=require(_0x6abd('0x11'));var logger=require(_0x6abd('0x12'))(_0x6abd('0x13'));var utils=require(_0x6abd('0x14'));var config=require(_0x6abd('0x15'));var licenseUtil=require(_0x6abd('0x16'));var db=require(_0x6abd('0x17'))['db'];function respondWithStatusCode(_0x40610b,_0x571182){_0x571182=_0x571182||0xcc;return function(_0x196bf4){if(_0x196bf4){return _0x40610b[_0x6abd('0x18')](_0x571182);}return _0x40610b['status'](_0x571182)[_0x6abd('0x19')]();};}function respondWithResult(_0x5c01d8,_0xb6e254){_0xb6e254=_0xb6e254||0xc8;return function(_0x2552c5){if(_0x2552c5){return _0x5c01d8[_0x6abd('0x1a')](_0xb6e254)['json'](_0x2552c5);}};}function respondWithFilteredResult(_0x487190,_0x6f744d){return function(_0x142083){if(_0x142083){var _0x39b952=typeof _0x6f744d[_0x6abd('0x1b')]===_0x6abd('0x1c')&&typeof _0x6f744d[_0x6abd('0x1d')]===_0x6abd('0x1c');var _0x2cc9e5=_0x142083[_0x6abd('0x1e')];var _0x19218a=_0x39b952?0x0:_0x6f744d['offset'];var _0x5020cd=_0x39b952?_0x142083['count']:_0x6f744d[_0x6abd('0x1b')]+_0x6f744d['limit'];var _0x416cb5;if(_0x5020cd>=_0x2cc9e5){_0x5020cd=_0x2cc9e5;_0x416cb5=0xc8;}else{_0x416cb5=0xce;}_0x487190[_0x6abd('0x1a')](_0x416cb5);return _0x487190['set'](_0x6abd('0x1f'),_0x19218a+'-'+_0x5020cd+'/'+_0x2cc9e5)[_0x6abd('0x20')](_0x142083);}return null;};}function patchUpdates(_0x1b8947){return function(_0x1d9c11){try{jsonpatch['apply'](_0x1d9c11,_0x1b8947,!![]);}catch(_0x27b7ed){return BPromise[_0x6abd('0x21')](_0x27b7ed);}return _0x1d9c11['save']();};}function saveUpdates(_0x805a18,_0x35d4a3){return function(_0x5e3c44){if(_0x5e3c44){return _0x5e3c44[_0x6abd('0x22')](_0x805a18)[_0x6abd('0x23')](function(_0x3900bf){return _0x3900bf;});}return null;};}function removeEntity(_0x57ae94,_0x45495a){return function(_0x43139e){if(_0x43139e){return _0x43139e[_0x6abd('0x24')]()[_0x6abd('0x23')](function(){_0x57ae94[_0x6abd('0x1a')](0xcc)[_0x6abd('0x19')]();});}};}function handleEntityNotFound(_0x136721,_0x3a7035){return function(_0x3bc13d){if(!_0x3bc13d){_0x136721['sendStatus'](0x194);}return _0x3bc13d;};}function handleError(_0x5f33d5,_0x24ec2e){_0x24ec2e=_0x24ec2e||0x1f4;return function(_0x33e560){logger['error'](_0x33e560[_0x6abd('0x25')]);if(_0x33e560[_0x6abd('0x26')]){delete _0x33e560[_0x6abd('0x26')];}_0x5f33d5[_0x6abd('0x1a')](_0x24ec2e)[_0x6abd('0x27')](_0x33e560);};}exports[_0x6abd('0x28')]=function(_0x40e2ea,_0x169707){var _0x6a05b={},_0x386650={},_0x5ef8d2={'count':0x0,'rows':[]};var _0x5e6611=_['map'](db[_0x6abd('0x29')][_0x6abd('0x2a')],function(_0x3dbade){return{'name':_0x3dbade[_0x6abd('0x2b')],'type':_0x3dbade[_0x6abd('0x2c')][_0x6abd('0x2d')]};});_0x386650[_0x6abd('0x2e')]=_[_0x6abd('0x2f')](_0x5e6611,_0x6abd('0x26'));_0x386650[_0x6abd('0x30')]=_[_0x6abd('0x31')](_0x40e2ea[_0x6abd('0x30')]);_0x386650[_0x6abd('0x32')]=_['intersection'](_0x386650[_0x6abd('0x2e')],_0x386650[_0x6abd('0x30')]);_0x6a05b[_0x6abd('0x33')]=_['intersection'](_0x386650[_0x6abd('0x2e')],qs[_0x6abd('0x34')](_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x34')]));_0x6a05b[_0x6abd('0x33')]=_0x6a05b[_0x6abd('0x33')][_0x6abd('0x35')]?_0x6a05b['attributes']:_0x386650[_0x6abd('0x2e')];if(!_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x36')](_0x6abd('0x37'))){_0x6a05b[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x1d')]);_0x6a05b[_0x6abd('0x1b')]=qs['offset'](_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x1b')]);}_0x6a05b[_0x6abd('0x38')]=qs[_0x6abd('0x39')](_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x39')]);_0x6a05b[_0x6abd('0x3a')]=qs['filters'](_[_0x6abd('0x3b')](_0x40e2ea[_0x6abd('0x30')],_0x386650[_0x6abd('0x32')]),_0x5e6611);if(_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x3c')]){_0x6a05b[_0x6abd('0x3a')]=_[_0x6abd('0x3d')](_0x6a05b[_0x6abd('0x3a')],{'$or':_[_0x6abd('0x2f')](_0x5e6611,function(_0x112f15){if(_0x112f15['type']!==_0x6abd('0x3e')){var _0x1da721={};_0x1da721[_0x112f15[_0x6abd('0x26')]]={'$like':'%'+_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x3c')]+'%'};return _0x1da721;}})});}_0x6a05b=_[_0x6abd('0x3d')]({},_0x6a05b,_0x40e2ea['options']);var _0x1bd2e8={'where':_0x6a05b[_0x6abd('0x3a')]};return db[_0x6abd('0x29')][_0x6abd('0x1e')](_0x1bd2e8)[_0x6abd('0x23')](function(_0x1ca3d2){_0x5ef8d2[_0x6abd('0x1e')]=_0x1ca3d2;if(_0x40e2ea[_0x6abd('0x30')][_0x6abd('0x3f')]){_0x6a05b[_0x6abd('0x40')]=[{'all':!![]}];}return db[_0x6abd('0x29')][_0x6abd('0x41')](_0x6a05b);})['then'](function(_0x3cfcfa){_0x5ef8d2[_0x6abd('0x42')]=_0x3cfcfa;return _0x5ef8d2;})['then'](respondWithFilteredResult(_0x169707,_0x6a05b))['catch'](handleError(_0x169707,null));};exports['show']=function(_0x51414e,_0xd353db){var _0x28b1f9={'raw':![],'where':{'id':_0x51414e[_0x6abd('0x43')]['id']}},_0x26398c={};_0x26398c['model']=_['keys'](db['DeskConfiguration'][_0x6abd('0x2a')]);_0x26398c[_0x6abd('0x30')]=_[_0x6abd('0x31')](_0x51414e['query']);_0x26398c[_0x6abd('0x32')]=_[_0x6abd('0x44')](_0x26398c[_0x6abd('0x2e')],_0x26398c['query']);_0x28b1f9[_0x6abd('0x33')]=_[_0x6abd('0x44')](_0x26398c['model'],qs['fields'](_0x51414e[_0x6abd('0x30')][_0x6abd('0x34')]));_0x28b1f9['attributes']=_0x28b1f9['attributes'][_0x6abd('0x35')]?_0x28b1f9['attributes']:_0x26398c['model'];if(_0x51414e[_0x6abd('0x30')][_0x6abd('0x3f')]){_0x28b1f9[_0x6abd('0x40')]=[{'all':!![]}];}_0x28b1f9=_[_0x6abd('0x3d')]({},_0x28b1f9,_0x51414e[_0x6abd('0x45')]);return db[_0x6abd('0x29')]['find'](_0x28b1f9)[_0x6abd('0x23')](handleEntityNotFound(_0xd353db,null))[_0x6abd('0x23')](respondWithResult(_0xd353db,null))[_0x6abd('0x46')](handleError(_0xd353db,null));};exports[_0x6abd('0x47')]=function(_0x4f61da,_0x5daa19){return db[_0x6abd('0x29')][_0x6abd('0x47')](_0x4f61da['body'],{})[_0x6abd('0x23')](respondWithResult(_0x5daa19,0xc9))[_0x6abd('0x46')](handleError(_0x5daa19,null));};exports[_0x6abd('0x22')]=function(_0x2da116,_0x52a772){if(_0x2da116[_0x6abd('0x48')]['id']){delete _0x2da116[_0x6abd('0x48')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x2da116['params']['id']}})[_0x6abd('0x23')](handleEntityNotFound(_0x52a772,null))[_0x6abd('0x23')](saveUpdates(_0x2da116['body'],null))[_0x6abd('0x23')](respondWithResult(_0x52a772,null))['catch'](handleError(_0x52a772,null));};exports[_0x6abd('0x24')]=function(_0x11fab6,_0x53b24c){return db[_0x6abd('0x29')][_0x6abd('0x49')]({'where':{'id':_0x11fab6['params']['id']}})[_0x6abd('0x23')](handleEntityNotFound(_0x53b24c,null))[_0x6abd('0x23')](removeEntity(_0x53b24c,null))['catch'](handleError(_0x53b24c,null));};exports[_0x6abd('0x4a')]=function(_0x49dfa1,_0x2c1e13,_0x1f7499){var _0x145888={};var _0x47a16a={};var _0x4a41ad;var _0x25b2de;return db[_0x6abd('0x29')][_0x6abd('0x4b')]({'where':{'id':_0x49dfa1[_0x6abd('0x43')]['id']}})[_0x6abd('0x23')](handleEntityNotFound(_0x2c1e13,null))[_0x6abd('0x23')](function(_0x2e327b){if(_0x2e327b){_0x4a41ad=_0x2e327b;_0x47a16a[_0x6abd('0x2e')]=_[_0x6abd('0x31')](db[_0x6abd('0x4c')][_0x6abd('0x2a')]);_0x47a16a[_0x6abd('0x30')]=_[_0x6abd('0x31')](_0x49dfa1['query']);_0x47a16a[_0x6abd('0x32')]=_[_0x6abd('0x44')](_0x47a16a['model'],_0x47a16a[_0x6abd('0x30')]);_0x145888[_0x6abd('0x33')]=_[_0x6abd('0x44')](_0x47a16a['model'],qs[_0x6abd('0x34')](_0x49dfa1['query'][_0x6abd('0x34')]));_0x145888['attributes']=_0x145888[_0x6abd('0x33')][_0x6abd('0x35')]?_0x145888[_0x6abd('0x33')]:_0x47a16a[_0x6abd('0x2e')];_0x145888[_0x6abd('0x38')]=qs[_0x6abd('0x39')](_0x49dfa1[_0x6abd('0x30')][_0x6abd('0x39')]);_0x145888['where']=qs[_0x6abd('0x32')](_[_0x6abd('0x3b')](_0x49dfa1['query'],_0x47a16a['filters']));if(_0x49dfa1['query'][_0x6abd('0x3c')]){_0x145888['where']=_[_0x6abd('0x3d')](_0x145888['where'],{'$or':_[_0x6abd('0x2f')](_0x145888[_0x6abd('0x33')],function(_0x2949af){var _0x964497={};_0x964497[_0x2949af]={'$like':'%'+_0x49dfa1['query'][_0x6abd('0x3c')]+'%'};return _0x964497;})});}_0x145888=_[_0x6abd('0x3d')]({},_0x145888,_0x49dfa1[_0x6abd('0x45')]);return _0x4a41ad[_0x6abd('0x4a')](_0x145888);}})[_0x6abd('0x23')](function(_0x4440bf){if(_0x4440bf){_0x25b2de=_0x4440bf[_0x6abd('0x35')];if(!_0x49dfa1['query']['hasOwnProperty']('nolimit')){_0x145888[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x49dfa1[_0x6abd('0x30')][_0x6abd('0x1d')]);_0x145888[_0x6abd('0x1b')]=qs[_0x6abd('0x1b')](_0x49dfa1[_0x6abd('0x30')]['offset']);}return _0x4a41ad[_0x6abd('0x4a')](_0x145888);}})[_0x6abd('0x23')](function(_0x3df9f5){if(_0x3df9f5){return _0x3df9f5?{'count':_0x25b2de,'rows':_0x3df9f5}:null;}})[_0x6abd('0x23')](respondWithResult(_0x2c1e13,null))[_0x6abd('0x46')](handleError(_0x2c1e13,null));};exports['getSubjects']=function(_0x2196a3,_0x1ff39b,_0xdd91b5){var _0x2f210f={};var _0x1aab32={};var _0x44e8c3;var _0x52c554;return db['DeskConfiguration'][_0x6abd('0x4b')]({'where':{'id':_0x2196a3[_0x6abd('0x43')]['id']}})[_0x6abd('0x23')](handleEntityNotFound(_0x1ff39b,null))[_0x6abd('0x23')](function(_0x151a9d){if(_0x151a9d){_0x44e8c3=_0x151a9d;_0x1aab32[_0x6abd('0x2e')]=_[_0x6abd('0x31')](db[_0x6abd('0x4c')][_0x6abd('0x2a')]);_0x1aab32[_0x6abd('0x30')]=_[_0x6abd('0x31')](_0x2196a3['query']);_0x1aab32[_0x6abd('0x32')]=_[_0x6abd('0x44')](_0x1aab32['model'],_0x1aab32[_0x6abd('0x30')]);_0x2f210f[_0x6abd('0x33')]=_[_0x6abd('0x44')](_0x1aab32[_0x6abd('0x2e')],qs['fields'](_0x2196a3['query'][_0x6abd('0x34')]));_0x2f210f[_0x6abd('0x33')]=_0x2f210f['attributes'][_0x6abd('0x35')]?_0x2f210f[_0x6abd('0x33')]:_0x1aab32[_0x6abd('0x2e')];_0x2f210f[_0x6abd('0x38')]=qs[_0x6abd('0x39')](_0x2196a3[_0x6abd('0x30')][_0x6abd('0x39')]);_0x2f210f['where']=qs['filters'](_['pick'](_0x2196a3[_0x6abd('0x30')],_0x1aab32[_0x6abd('0x32')]));if(_0x2196a3[_0x6abd('0x30')][_0x6abd('0x3c')]){_0x2f210f[_0x6abd('0x3a')]=_[_0x6abd('0x3d')](_0x2f210f[_0x6abd('0x3a')],{'$or':_[_0x6abd('0x2f')](_0x2f210f[_0x6abd('0x33')],function(_0x27996){var _0x4a2267={};_0x4a2267[_0x27996]={'$like':'%'+_0x2196a3['query'][_0x6abd('0x3c')]+'%'};return _0x4a2267;})});}_0x2f210f=_[_0x6abd('0x3d')]({},_0x2f210f,_0x2196a3[_0x6abd('0x45')]);return _0x44e8c3[_0x6abd('0x4d')](_0x2f210f);}})[_0x6abd('0x23')](function(_0x49fa92){if(_0x49fa92){_0x52c554=_0x49fa92[_0x6abd('0x35')];if(!_0x2196a3['query'][_0x6abd('0x36')]('nolimit')){_0x2f210f[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x2196a3[_0x6abd('0x30')][_0x6abd('0x1d')]);_0x2f210f[_0x6abd('0x1b')]=qs[_0x6abd('0x1b')](_0x2196a3[_0x6abd('0x30')]['offset']);}return _0x44e8c3[_0x6abd('0x4d')](_0x2f210f);}})[_0x6abd('0x23')](function(_0xed23c5){if(_0xed23c5){return _0xed23c5?{'count':_0x52c554,'rows':_0xed23c5}:null;}})[_0x6abd('0x23')](respondWithResult(_0x1ff39b,null))[_0x6abd('0x46')](handleError(_0x1ff39b,null));};exports[_0x6abd('0x4e')]=function(_0x42a201,_0x22af8f,_0x5a9688){var _0x3f2bd2={};var _0x474071={};var _0x5e17f6;var _0x22c627;return db['DeskConfiguration'][_0x6abd('0x4b')]({'where':{'id':_0x42a201[_0x6abd('0x43')]['id']}})['then'](handleEntityNotFound(_0x22af8f,null))[_0x6abd('0x23')](function(_0x504d7a){if(_0x504d7a){_0x5e17f6=_0x504d7a;_0x474071[_0x6abd('0x2e')]=_[_0x6abd('0x31')](db[_0x6abd('0x4c')][_0x6abd('0x2a')]);_0x474071['query']=_['keys'](_0x42a201['query']);_0x474071[_0x6abd('0x32')]=_[_0x6abd('0x44')](_0x474071['model'],_0x474071['query']);_0x3f2bd2[_0x6abd('0x33')]=_[_0x6abd('0x44')](_0x474071[_0x6abd('0x2e')],qs['fields'](_0x42a201['query'][_0x6abd('0x34')]));_0x3f2bd2[_0x6abd('0x33')]=_0x3f2bd2[_0x6abd('0x33')]['length']?_0x3f2bd2[_0x6abd('0x33')]:_0x474071['model'];_0x3f2bd2['order']=qs[_0x6abd('0x39')](_0x42a201[_0x6abd('0x30')]['sort']);_0x3f2bd2['where']=qs[_0x6abd('0x32')](_[_0x6abd('0x3b')](_0x42a201['query'],_0x474071[_0x6abd('0x32')]));if(_0x42a201['query'][_0x6abd('0x3c')]){_0x3f2bd2[_0x6abd('0x3a')]=_[_0x6abd('0x3d')](_0x3f2bd2[_0x6abd('0x3a')],{'$or':_[_0x6abd('0x2f')](_0x3f2bd2[_0x6abd('0x33')],function(_0x45d5c3){var _0x45ea6d={};_0x45ea6d[_0x45d5c3]={'$like':'%'+_0x42a201[_0x6abd('0x30')][_0x6abd('0x3c')]+'%'};return _0x45ea6d;})});}_0x3f2bd2=_['merge']({},_0x3f2bd2,_0x42a201[_0x6abd('0x45')]);return _0x5e17f6[_0x6abd('0x4e')](_0x3f2bd2);}})[_0x6abd('0x23')](function(_0x540ab2){if(_0x540ab2){_0x22c627=_0x540ab2['length'];if(!_0x42a201[_0x6abd('0x30')][_0x6abd('0x36')](_0x6abd('0x37'))){_0x3f2bd2[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x42a201[_0x6abd('0x30')][_0x6abd('0x1d')]);_0x3f2bd2[_0x6abd('0x1b')]=qs[_0x6abd('0x1b')](_0x42a201['query'][_0x6abd('0x1b')]);}return _0x5e17f6[_0x6abd('0x4e')](_0x3f2bd2);}})['then'](function(_0x528954){if(_0x528954){return _0x528954?{'count':_0x22c627,'rows':_0x528954}:null;}})[_0x6abd('0x23')](respondWithResult(_0x22af8f,null))[_0x6abd('0x46')](handleError(_0x22af8f,null));};exports[_0x6abd('0x4f')]=function(_0x230ff0,_0x2b95c0,_0xd21646){var _0x1550ed={};var _0x1d558f={};var _0x10968c;var _0x446eff;return db[_0x6abd('0x29')][_0x6abd('0x4b')]({'where':{'id':_0x230ff0['params']['id']}})[_0x6abd('0x23')](handleEntityNotFound(_0x2b95c0,null))[_0x6abd('0x23')](function(_0x1a913e){if(_0x1a913e){_0x10968c=_0x1a913e;_0x1d558f['model']=_[_0x6abd('0x31')](db[_0x6abd('0x50')][_0x6abd('0x2a')]);_0x1d558f[_0x6abd('0x30')]=_[_0x6abd('0x31')](_0x230ff0[_0x6abd('0x30')]);_0x1d558f[_0x6abd('0x32')]=_['intersection'](_0x1d558f[_0x6abd('0x2e')],_0x1d558f['query']);_0x1550ed[_0x6abd('0x33')]=_[_0x6abd('0x44')](_0x1d558f['model'],qs[_0x6abd('0x34')](_0x230ff0['query']['fields']));_0x1550ed[_0x6abd('0x33')]=_0x1550ed[_0x6abd('0x33')][_0x6abd('0x35')]?_0x1550ed['attributes']:_0x1d558f[_0x6abd('0x2e')];_0x1550ed[_0x6abd('0x38')]=qs[_0x6abd('0x39')](_0x230ff0[_0x6abd('0x30')][_0x6abd('0x39')]);_0x1550ed['where']=qs[_0x6abd('0x32')](_['pick'](_0x230ff0['query'],_0x1d558f[_0x6abd('0x32')]));if(_0x230ff0[_0x6abd('0x30')][_0x6abd('0x3c')]){_0x1550ed[_0x6abd('0x3a')]=_[_0x6abd('0x3d')](_0x1550ed['where'],{'$or':_['map'](_0x1550ed['attributes'],function(_0x2b0f47){var _0x406c12={};_0x406c12[_0x2b0f47]={'$like':'%'+_0x230ff0[_0x6abd('0x30')][_0x6abd('0x3c')]+'%'};return _0x406c12;})});}_0x1550ed=_[_0x6abd('0x3d')]({},_0x1550ed,_0x230ff0[_0x6abd('0x45')]);return _0x10968c[_0x6abd('0x4f')](_0x1550ed);}})[_0x6abd('0x23')](function(_0x4ee421){if(_0x4ee421){_0x446eff=_0x4ee421['length'];if(!_0x230ff0[_0x6abd('0x30')]['hasOwnProperty'](_0x6abd('0x37'))){_0x1550ed[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x230ff0[_0x6abd('0x30')]['limit']);_0x1550ed[_0x6abd('0x1b')]=qs[_0x6abd('0x1b')](_0x230ff0['query'][_0x6abd('0x1b')]);}return _0x10968c[_0x6abd('0x4f')](_0x1550ed);}})[_0x6abd('0x23')](function(_0x230163){if(_0x230163){return _0x230163?{'count':_0x446eff,'rows':_0x230163}:null;}})[_0x6abd('0x23')](respondWithResult(_0x2b95c0,null))[_0x6abd('0x46')](handleError(_0x2b95c0,null));};exports[_0x6abd('0x51')]=function(_0x26f603,_0x3c2500,_0x22e9b8){if(_0x26f603['body']['id']){delete _0x26f603[_0x6abd('0x48')]['id'];}return db[_0x6abd('0x29')][_0x6abd('0x4b')]({'where':{'id':_0x26f603['params']['id']}})[_0x6abd('0x23')](handleEntityNotFound(_0x3c2500,null))['then'](function(_0x537607){if(_0x537607){return _0x537607[_0x6abd('0x51')](_0x26f603[_0x6abd('0x48')][_0x6abd('0x52')]||[]);}return null;})['then'](respondWithResult(_0x3c2500,null))['catch'](handleError(_0x3c2500,null));}; \ No newline at end of file +var _0xd69a=['getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','DeskConfiguration','includeAll','catch','include','options','find','create','body','params','destroy','findOne','DeskField','getFields','nolimit','getSubjects','getDescriptions'];(function(_0x11524b,_0x1884a4){var _0x20c8e1=function(_0x21a15e){while(--_0x21a15e){_0x11524b['push'](_0x11524b['shift']());}};_0x20c8e1(++_0x1884a4);}(_0xd69a,0xa5));var _0xad69=function(_0x3c8fcc,_0x27cdf2){_0x3c8fcc=_0x3c8fcc-0x0;var _0x622b9b=_0xd69a[_0x3c8fcc];return _0x622b9b;};'use strict';var emlformat=require(_0xad69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad69('0x1'));var jsonpatch=require(_0xad69('0x2'));var rp=require(_0xad69('0x3'));var moment=require(_0xad69('0x4'));var BPromise=require(_0xad69('0x5'));var Mustache=require(_0xad69('0x6'));var util=require(_0xad69('0x7'));var path=require(_0xad69('0x8'));var sox=require(_0xad69('0x9'));var csv=require(_0xad69('0xa'));var ejs=require(_0xad69('0xb'));var fs=require('fs');var fs_extra=require(_0xad69('0xc'));var _=require(_0xad69('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad69('0xe'));var authService=require(_0xad69('0xf'));var qs=require(_0xad69('0x10'));var as=require(_0xad69('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad69('0x12'))(_0xad69('0x13'));var utils=require(_0xad69('0x14'));var config=require(_0xad69('0x15'));var licenseUtil=require(_0xad69('0x16'));var db=require(_0xad69('0x17'))['db'];function respondWithStatusCode(_0x264223,_0x161141){_0x161141=_0x161141||0xcc;return function(_0xc756ae){if(_0xc756ae){return _0x264223[_0xad69('0x18')](_0x161141);}return _0x264223['status'](_0x161141)[_0xad69('0x19')]();};}function respondWithResult(_0x45602d,_0x19560f){_0x19560f=_0x19560f||0xc8;return function(_0x4d868b){if(_0x4d868b){return _0x45602d[_0xad69('0x1a')](_0x19560f)['json'](_0x4d868b);}};}function respondWithFilteredResult(_0x51aa6f,_0x5ebdd0){return function(_0x48b9da){if(_0x48b9da){var _0x5c92ec=typeof _0x5ebdd0[_0xad69('0x1b')]===_0xad69('0x1c')&&typeof _0x5ebdd0[_0xad69('0x1d')]==='undefined';var _0x32840d=_0x48b9da[_0xad69('0x1e')];var _0x549c56=_0x5c92ec?0x0:_0x5ebdd0[_0xad69('0x1b')];var _0x5bf8a3=_0x5c92ec?_0x48b9da[_0xad69('0x1e')]:_0x5ebdd0['offset']+_0x5ebdd0[_0xad69('0x1d')];var _0x39fb80;if(_0x5bf8a3>=_0x32840d){_0x5bf8a3=_0x32840d;_0x39fb80=0xc8;}else{_0x39fb80=0xce;}_0x51aa6f['status'](_0x39fb80);return _0x51aa6f['set'](_0xad69('0x1f'),_0x549c56+'-'+_0x5bf8a3+'/'+_0x32840d)[_0xad69('0x20')](_0x48b9da);}return null;};}function patchUpdates(_0x11aef6){return function(_0x2dee43){try{jsonpatch[_0xad69('0x21')](_0x2dee43,_0x11aef6,!![]);}catch(_0x48ca70){return BPromise[_0xad69('0x22')](_0x48ca70);}return _0x2dee43[_0xad69('0x23')]();};}function saveUpdates(_0x511e6c,_0x4e26e4){return function(_0x111033){if(_0x111033){return _0x111033[_0xad69('0x24')](_0x511e6c)[_0xad69('0x25')](function(_0x3da05e){return _0x3da05e;});}return null;};}function removeEntity(_0x2ca6aa,_0x150ce2){return function(_0x166f19){if(_0x166f19){return _0x166f19['destroy']()['then'](function(){_0x2ca6aa[_0xad69('0x1a')](0xcc)[_0xad69('0x19')]();});}};}function handleEntityNotFound(_0x2de583,_0x2a52a2){return function(_0xc6621){if(!_0xc6621){_0x2de583[_0xad69('0x18')](0x194);}return _0xc6621;};}function handleError(_0x4fbe87,_0x21468c){_0x21468c=_0x21468c||0x1f4;return function(_0x1a338e){logger['error'](_0x1a338e['stack']);if(_0x1a338e[_0xad69('0x26')]){delete _0x1a338e[_0xad69('0x26')];}_0x4fbe87[_0xad69('0x1a')](_0x21468c)[_0xad69('0x27')](_0x1a338e);};}exports[_0xad69('0x28')]=function(_0x16283d,_0x1d6387){var _0x286113={},_0x555c2a={},_0x41cf75={'count':0x0,'rows':[]};var _0x2e6214=_[_0xad69('0x29')](db['DeskConfiguration'][_0xad69('0x2a')],function(_0x42da3d){return{'name':_0x42da3d[_0xad69('0x2b')],'type':_0x42da3d[_0xad69('0x2c')][_0xad69('0x2d')]};});_0x555c2a[_0xad69('0x2e')]=_[_0xad69('0x29')](_0x2e6214,_0xad69('0x26'));_0x555c2a[_0xad69('0x2f')]=_[_0xad69('0x30')](_0x16283d[_0xad69('0x2f')]);_0x555c2a[_0xad69('0x31')]=_[_0xad69('0x32')](_0x555c2a['model'],_0x555c2a[_0xad69('0x2f')]);_0x286113[_0xad69('0x33')]=_[_0xad69('0x32')](_0x555c2a[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x16283d['query']['fields']));_0x286113[_0xad69('0x33')]=_0x286113['attributes'][_0xad69('0x35')]?_0x286113[_0xad69('0x33')]:_0x555c2a['model'];if(!_0x16283d[_0xad69('0x2f')][_0xad69('0x36')]('nolimit')){_0x286113[_0xad69('0x1d')]=qs['limit'](_0x16283d[_0xad69('0x2f')][_0xad69('0x1d')]);_0x286113['offset']=qs[_0xad69('0x1b')](_0x16283d[_0xad69('0x2f')][_0xad69('0x1b')]);}_0x286113[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x16283d[_0xad69('0x2f')][_0xad69('0x38')]);_0x286113[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x16283d['query'],_0x555c2a[_0xad69('0x31')]),_0x2e6214);if(_0x16283d[_0xad69('0x2f')][_0xad69('0x3b')]){_0x286113[_0xad69('0x39')]=_['merge'](_0x286113[_0xad69('0x39')],{'$or':_[_0xad69('0x29')](_0x2e6214,function(_0x2dba43){if(_0x2dba43[_0xad69('0x2c')]!==_0xad69('0x3c')){var _0xcf4c24={};_0xcf4c24[_0x2dba43[_0xad69('0x26')]]={'$like':'%'+_0x16283d['query'][_0xad69('0x3b')]+'%'};return _0xcf4c24;}})});}_0x286113=_[_0xad69('0x3d')]({},_0x286113,_0x16283d['options']);var _0xee81f2={'where':_0x286113[_0xad69('0x39')]};return db[_0xad69('0x3e')][_0xad69('0x1e')](_0xee81f2)[_0xad69('0x25')](function(_0x3ab881){_0x41cf75[_0xad69('0x1e')]=_0x3ab881;if(_0x16283d['query'][_0xad69('0x3f')]){_0x286113['include']=[{'all':!![]}];}return db[_0xad69('0x3e')]['findAll'](_0x286113);})[_0xad69('0x25')](function(_0x21673f){_0x41cf75['rows']=_0x21673f;return _0x41cf75;})[_0xad69('0x25')](respondWithFilteredResult(_0x1d6387,_0x286113))[_0xad69('0x40')](handleError(_0x1d6387,null));};exports['show']=function(_0x45bcaa,_0x4d007d){var _0x280bab={'raw':![],'where':{'id':_0x45bcaa['params']['id']}},_0x4b9b51={};_0x4b9b51[_0xad69('0x2e')]=_[_0xad69('0x30')](db['DeskConfiguration'][_0xad69('0x2a')]);_0x4b9b51[_0xad69('0x2f')]=_[_0xad69('0x30')](_0x45bcaa[_0xad69('0x2f')]);_0x4b9b51[_0xad69('0x31')]=_[_0xad69('0x32')](_0x4b9b51['model'],_0x4b9b51[_0xad69('0x2f')]);_0x280bab[_0xad69('0x33')]=_[_0xad69('0x32')](_0x4b9b51['model'],qs['fields'](_0x45bcaa[_0xad69('0x2f')][_0xad69('0x34')]));_0x280bab[_0xad69('0x33')]=_0x280bab[_0xad69('0x33')][_0xad69('0x35')]?_0x280bab[_0xad69('0x33')]:_0x4b9b51[_0xad69('0x2e')];if(_0x45bcaa[_0xad69('0x2f')]['includeAll']){_0x280bab[_0xad69('0x41')]=[{'all':!![]}];}_0x280bab=_[_0xad69('0x3d')]({},_0x280bab,_0x45bcaa[_0xad69('0x42')]);return db[_0xad69('0x3e')][_0xad69('0x43')](_0x280bab)[_0xad69('0x25')](handleEntityNotFound(_0x4d007d,null))['then'](respondWithResult(_0x4d007d,null))['catch'](handleError(_0x4d007d,null));};exports[_0xad69('0x44')]=function(_0x52c028,_0x448029){return db[_0xad69('0x3e')][_0xad69('0x44')](_0x52c028[_0xad69('0x45')],{})[_0xad69('0x25')](respondWithResult(_0x448029,0xc9))[_0xad69('0x40')](handleError(_0x448029,null));};exports[_0xad69('0x24')]=function(_0x56bb3b,_0x199fd6){if(_0x56bb3b[_0xad69('0x45')]['id']){delete _0x56bb3b[_0xad69('0x45')]['id'];}return db[_0xad69('0x3e')]['find']({'where':{'id':_0x56bb3b[_0xad69('0x46')]['id']}})['then'](handleEntityNotFound(_0x199fd6,null))[_0xad69('0x25')](saveUpdates(_0x56bb3b['body'],null))[_0xad69('0x25')](respondWithResult(_0x199fd6,null))[_0xad69('0x40')](handleError(_0x199fd6,null));};exports[_0xad69('0x47')]=function(_0x2b4df3,_0x1a95c4){return db[_0xad69('0x3e')][_0xad69('0x43')]({'where':{'id':_0x2b4df3[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0x1a95c4,null))['then'](removeEntity(_0x1a95c4,null))[_0xad69('0x40')](handleError(_0x1a95c4,null));};exports['getFields']=function(_0x1d0583,_0x5234f8,_0x2e3507){var _0x41d912={};var _0x1b77ab={};var _0x179a0c;var _0x239c68;return db['DeskConfiguration'][_0xad69('0x48')]({'where':{'id':_0x1d0583[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0x5234f8,null))[_0xad69('0x25')](function(_0x3a54b8){if(_0x3a54b8){_0x179a0c=_0x3a54b8;_0x1b77ab[_0xad69('0x2e')]=_[_0xad69('0x30')](db[_0xad69('0x49')][_0xad69('0x2a')]);_0x1b77ab[_0xad69('0x2f')]=_['keys'](_0x1d0583[_0xad69('0x2f')]);_0x1b77ab[_0xad69('0x31')]=_[_0xad69('0x32')](_0x1b77ab[_0xad69('0x2e')],_0x1b77ab[_0xad69('0x2f')]);_0x41d912[_0xad69('0x33')]=_[_0xad69('0x32')](_0x1b77ab[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x1d0583[_0xad69('0x2f')][_0xad69('0x34')]));_0x41d912[_0xad69('0x33')]=_0x41d912['attributes'][_0xad69('0x35')]?_0x41d912[_0xad69('0x33')]:_0x1b77ab[_0xad69('0x2e')];_0x41d912[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x1d0583['query'][_0xad69('0x38')]);_0x41d912[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x1d0583[_0xad69('0x2f')],_0x1b77ab[_0xad69('0x31')]));if(_0x1d0583[_0xad69('0x2f')][_0xad69('0x3b')]){_0x41d912[_0xad69('0x39')]=_[_0xad69('0x3d')](_0x41d912[_0xad69('0x39')],{'$or':_['map'](_0x41d912[_0xad69('0x33')],function(_0x5f189b){var _0x2e0507={};_0x2e0507[_0x5f189b]={'$like':'%'+_0x1d0583[_0xad69('0x2f')][_0xad69('0x3b')]+'%'};return _0x2e0507;})});}_0x41d912=_[_0xad69('0x3d')]({},_0x41d912,_0x1d0583[_0xad69('0x42')]);return _0x179a0c[_0xad69('0x4a')](_0x41d912);}})[_0xad69('0x25')](function(_0x576b5d){if(_0x576b5d){_0x239c68=_0x576b5d['length'];if(!_0x1d0583['query'][_0xad69('0x36')](_0xad69('0x4b'))){_0x41d912[_0xad69('0x1d')]=qs[_0xad69('0x1d')](_0x1d0583['query'][_0xad69('0x1d')]);_0x41d912[_0xad69('0x1b')]=qs['offset'](_0x1d0583[_0xad69('0x2f')][_0xad69('0x1b')]);}return _0x179a0c[_0xad69('0x4a')](_0x41d912);}})[_0xad69('0x25')](function(_0x46d1dc){if(_0x46d1dc){return _0x46d1dc?{'count':_0x239c68,'rows':_0x46d1dc}:null;}})[_0xad69('0x25')](respondWithResult(_0x5234f8,null))['catch'](handleError(_0x5234f8,null));};exports['getSubjects']=function(_0x344354,_0x9a45dc,_0x568627){var _0xefe739={};var _0x1f49e3={};var _0x36139e;var _0x2c54bc;return db['DeskConfiguration']['findOne']({'where':{'id':_0x344354[_0xad69('0x46')]['id']}})['then'](handleEntityNotFound(_0x9a45dc,null))[_0xad69('0x25')](function(_0x4ed2bb){if(_0x4ed2bb){_0x36139e=_0x4ed2bb;_0x1f49e3[_0xad69('0x2e')]=_[_0xad69('0x30')](db[_0xad69('0x49')]['rawAttributes']);_0x1f49e3[_0xad69('0x2f')]=_[_0xad69('0x30')](_0x344354[_0xad69('0x2f')]);_0x1f49e3[_0xad69('0x31')]=_['intersection'](_0x1f49e3[_0xad69('0x2e')],_0x1f49e3[_0xad69('0x2f')]);_0xefe739[_0xad69('0x33')]=_[_0xad69('0x32')](_0x1f49e3[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x344354[_0xad69('0x2f')][_0xad69('0x34')]));_0xefe739[_0xad69('0x33')]=_0xefe739[_0xad69('0x33')][_0xad69('0x35')]?_0xefe739[_0xad69('0x33')]:_0x1f49e3[_0xad69('0x2e')];_0xefe739[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x344354[_0xad69('0x2f')]['sort']);_0xefe739[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x344354[_0xad69('0x2f')],_0x1f49e3['filters']));if(_0x344354[_0xad69('0x2f')][_0xad69('0x3b')]){_0xefe739[_0xad69('0x39')]=_['merge'](_0xefe739[_0xad69('0x39')],{'$or':_[_0xad69('0x29')](_0xefe739[_0xad69('0x33')],function(_0x4a17fe){var _0x398a64={};_0x398a64[_0x4a17fe]={'$like':'%'+_0x344354[_0xad69('0x2f')][_0xad69('0x3b')]+'%'};return _0x398a64;})});}_0xefe739=_[_0xad69('0x3d')]({},_0xefe739,_0x344354[_0xad69('0x42')]);return _0x36139e[_0xad69('0x4c')](_0xefe739);}})[_0xad69('0x25')](function(_0x38ffde){if(_0x38ffde){_0x2c54bc=_0x38ffde[_0xad69('0x35')];if(!_0x344354[_0xad69('0x2f')][_0xad69('0x36')](_0xad69('0x4b'))){_0xefe739['limit']=qs[_0xad69('0x1d')](_0x344354[_0xad69('0x2f')][_0xad69('0x1d')]);_0xefe739['offset']=qs['offset'](_0x344354[_0xad69('0x2f')]['offset']);}return _0x36139e[_0xad69('0x4c')](_0xefe739);}})[_0xad69('0x25')](function(_0x11c036){if(_0x11c036){return _0x11c036?{'count':_0x2c54bc,'rows':_0x11c036}:null;}})['then'](respondWithResult(_0x9a45dc,null))[_0xad69('0x40')](handleError(_0x9a45dc,null));};exports[_0xad69('0x4d')]=function(_0x4ee2b1,_0xaef3a0,_0x23046a){var _0x4c4899={};var _0x302c2c={};var _0x1338d7;var _0x32567a;return db[_0xad69('0x3e')][_0xad69('0x48')]({'where':{'id':_0x4ee2b1[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0xaef3a0,null))[_0xad69('0x25')](function(_0x248291){if(_0x248291){_0x1338d7=_0x248291;_0x302c2c[_0xad69('0x2e')]=_[_0xad69('0x30')](db[_0xad69('0x49')][_0xad69('0x2a')]);_0x302c2c[_0xad69('0x2f')]=_['keys'](_0x4ee2b1[_0xad69('0x2f')]);_0x302c2c[_0xad69('0x31')]=_[_0xad69('0x32')](_0x302c2c[_0xad69('0x2e')],_0x302c2c[_0xad69('0x2f')]);_0x4c4899[_0xad69('0x33')]=_['intersection'](_0x302c2c[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x4ee2b1['query'][_0xad69('0x34')]));_0x4c4899[_0xad69('0x33')]=_0x4c4899[_0xad69('0x33')][_0xad69('0x35')]?_0x4c4899[_0xad69('0x33')]:_0x302c2c[_0xad69('0x2e')];_0x4c4899['order']=qs[_0xad69('0x38')](_0x4ee2b1['query']['sort']);_0x4c4899[_0xad69('0x39')]=qs['filters'](_[_0xad69('0x3a')](_0x4ee2b1['query'],_0x302c2c[_0xad69('0x31')]));if(_0x4ee2b1[_0xad69('0x2f')]['filter']){_0x4c4899[_0xad69('0x39')]=_[_0xad69('0x3d')](_0x4c4899[_0xad69('0x39')],{'$or':_['map'](_0x4c4899[_0xad69('0x33')],function(_0x2d88cc){var _0x1b0c16={};_0x1b0c16[_0x2d88cc]={'$like':'%'+_0x4ee2b1['query']['filter']+'%'};return _0x1b0c16;})});}_0x4c4899=_[_0xad69('0x3d')]({},_0x4c4899,_0x4ee2b1[_0xad69('0x42')]);return _0x1338d7[_0xad69('0x4d')](_0x4c4899);}})[_0xad69('0x25')](function(_0x1b518b){if(_0x1b518b){_0x32567a=_0x1b518b[_0xad69('0x35')];if(!_0x4ee2b1[_0xad69('0x2f')][_0xad69('0x36')]('nolimit')){_0x4c4899['limit']=qs['limit'](_0x4ee2b1[_0xad69('0x2f')][_0xad69('0x1d')]);_0x4c4899[_0xad69('0x1b')]=qs[_0xad69('0x1b')](_0x4ee2b1[_0xad69('0x2f')]['offset']);}return _0x1338d7[_0xad69('0x4d')](_0x4c4899);}})[_0xad69('0x25')](function(_0x183e77){if(_0x183e77){return _0x183e77?{'count':_0x32567a,'rows':_0x183e77}:null;}})['then'](respondWithResult(_0xaef3a0,null))[_0xad69('0x40')](handleError(_0xaef3a0,null));};exports[_0xad69('0x4e')]=function(_0x826fda,_0x57c474,_0x66ce0c){var _0x34682d={};var _0x57143d={};var _0x1b9bd9;var _0x241d78;return db[_0xad69('0x3e')][_0xad69('0x48')]({'where':{'id':_0x826fda[_0xad69('0x46')]['id']}})['then'](handleEntityNotFound(_0x57c474,null))[_0xad69('0x25')](function(_0x31f21f){if(_0x31f21f){_0x1b9bd9=_0x31f21f;_0x57143d['model']=_[_0xad69('0x30')](db[_0xad69('0x4f')][_0xad69('0x2a')]);_0x57143d[_0xad69('0x2f')]=_['keys'](_0x826fda[_0xad69('0x2f')]);_0x57143d[_0xad69('0x31')]=_['intersection'](_0x57143d['model'],_0x57143d[_0xad69('0x2f')]);_0x34682d[_0xad69('0x33')]=_[_0xad69('0x32')](_0x57143d[_0xad69('0x2e')],qs[_0xad69('0x34')](_0x826fda[_0xad69('0x2f')][_0xad69('0x34')]));_0x34682d[_0xad69('0x33')]=_0x34682d['attributes'][_0xad69('0x35')]?_0x34682d[_0xad69('0x33')]:_0x57143d[_0xad69('0x2e')];_0x34682d[_0xad69('0x37')]=qs[_0xad69('0x38')](_0x826fda[_0xad69('0x2f')][_0xad69('0x38')]);_0x34682d[_0xad69('0x39')]=qs[_0xad69('0x31')](_[_0xad69('0x3a')](_0x826fda[_0xad69('0x2f')],_0x57143d['filters']));if(_0x826fda[_0xad69('0x2f')][_0xad69('0x3b')]){_0x34682d[_0xad69('0x39')]=_[_0xad69('0x3d')](_0x34682d[_0xad69('0x39')],{'$or':_['map'](_0x34682d[_0xad69('0x33')],function(_0x4767e6){var _0x75c3a9={};_0x75c3a9[_0x4767e6]={'$like':'%'+_0x826fda['query']['filter']+'%'};return _0x75c3a9;})});}_0x34682d=_[_0xad69('0x3d')]({},_0x34682d,_0x826fda['options']);return _0x1b9bd9[_0xad69('0x4e')](_0x34682d);}})[_0xad69('0x25')](function(_0x27bdbf){if(_0x27bdbf){_0x241d78=_0x27bdbf['length'];if(!_0x826fda[_0xad69('0x2f')]['hasOwnProperty'](_0xad69('0x4b'))){_0x34682d['limit']=qs[_0xad69('0x1d')](_0x826fda['query']['limit']);_0x34682d[_0xad69('0x1b')]=qs[_0xad69('0x1b')](_0x826fda[_0xad69('0x2f')]['offset']);}return _0x1b9bd9[_0xad69('0x4e')](_0x34682d);}})[_0xad69('0x25')](function(_0x18ad04){if(_0x18ad04){return _0x18ad04?{'count':_0x241d78,'rows':_0x18ad04}:null;}})['then'](respondWithResult(_0x57c474,null))[_0xad69('0x40')](handleError(_0x57c474,null));};exports['setTags']=function(_0x27e197,_0x20855f,_0x59f3e4){if(_0x27e197[_0xad69('0x45')]['id']){delete _0x27e197[_0xad69('0x45')]['id'];}return db[_0xad69('0x3e')][_0xad69('0x48')]({'where':{'id':_0x27e197[_0xad69('0x46')]['id']}})[_0xad69('0x25')](handleEntityNotFound(_0x20855f,null))[_0xad69('0x25')](function(_0x2ccfb9){if(_0x2ccfb9){return _0x2ccfb9[_0xad69('0x50')](_0x27e197[_0xad69('0x45')]['ids']||[]);}return null;})[_0xad69('0x25')](respondWithResult(_0x20855f,null))[_0xad69('0x40')](handleError(_0x20855f,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0c33ad7..cd4a500 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 _0x336d=['path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x336d,0xae));var _0xd336=function(_0xfe4e8b,_0x1cfdd8){_0xfe4e8b=_0xfe4e8b-0x0;var _0x5a061a=_0x336d[_0xfe4e8b];return _0x5a061a;};'use strict';var _=require('lodash');var util=require(_0xd336('0x0'));var logger=require(_0xd336('0x1'))(_0xd336('0x2'));var moment=require(_0xd336('0x3'));var BPromise=require(_0xd336('0x4'));var rp=require(_0xd336('0x5'));var fs=require('fs');var path=require(_0xd336('0x6'));var rimraf=require(_0xd336('0x7'));var config=require(_0xd336('0x8'));var attributes=require(_0xd336('0x9'));module['exports']=function(_0x5e202d,_0x176983){return _0x5e202d[_0xd336('0xa')](_0xd336('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe8c=['moment','bluebird','path','rimraf','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api'];(function(_0x12156d,_0x189f41){var _0x584b56=function(_0x1beec9){while(--_0x1beec9){_0x12156d['push'](_0x12156d['shift']());}};_0x584b56(++_0x189f41);}(_0xfe8c,0x1b5));var _0xcfe8=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xfe8c[_0x377a6e];return _0x37f751;};'use strict';var _=require(_0xcfe8('0x0'));var util=require('util');var logger=require(_0xcfe8('0x1'))(_0xcfe8('0x2'));var moment=require(_0xcfe8('0x3'));var BPromise=require(_0xcfe8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfe8('0x5'));var rimraf=require(_0xcfe8('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0xcfe8('0x7')]=function(_0x5c52e8,_0x301401){return _0x5c52e8[_0xcfe8('0x8')](_0xcfe8('0x9'),attributes,{'tableName':_0xcfe8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 9266aa4..98b3969 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 _0x14a0=['jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3b2806,_0x329a73){var _0x3c10bb=function(_0x4464f4){while(--_0x4464f4){_0x3b2806['push'](_0x3b2806['shift']());}};_0x3c10bb(++_0x329a73);}(_0x14a0,0x109));var _0x014a=function(_0x1bc66f,_0x3a5eb6){_0x1bc66f=_0x1bc66f-0x0;var _0x535c1b=_0x14a0[_0x1bc66f];return _0x535c1b;};'use strict';var _=require(_0x014a('0x0'));var util=require(_0x014a('0x1'));var moment=require(_0x014a('0x2'));var BPromise=require(_0x014a('0x3'));var rs=require(_0x014a('0x4'));var fs=require('fs');var Redis=require(_0x014a('0x5'));var db=require(_0x014a('0x6'))['db'];var utils=require(_0x014a('0x7'));var logger=require(_0x014a('0x8'))('rpc');var config=require(_0x014a('0x9'));var jayson=require(_0x014a('0xa'));var client=jayson['client'][_0x014a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7f2dc6,_0x290270,_0x1b9b0e){return new BPromise(function(_0x1b3caa,_0x4e9ed6){return client[_0x014a('0xc')](_0x7f2dc6,_0x1b9b0e)[_0x014a('0xd')](function(_0x1cb4e5){logger[_0x014a('0xe')](_0x014a('0xf'),_0x290270,_0x014a('0x10'));logger[_0x014a('0x11')](_0x014a('0x12'),_0x290270,_0x014a('0x10'),JSON[_0x014a('0x13')](_0x1cb4e5));if(_0x1cb4e5[_0x014a('0x14')]){if(_0x1cb4e5[_0x014a('0x14')][_0x014a('0x15')]===0x1f4){logger[_0x014a('0x14')](_0x014a('0xf'),_0x290270,_0x1cb4e5[_0x014a('0x14')][_0x014a('0x16')]);return _0x4e9ed6(_0x1cb4e5[_0x014a('0x14')][_0x014a('0x16')]);}logger[_0x014a('0x14')](_0x014a('0xf'),_0x290270,_0x1cb4e5['error'][_0x014a('0x16')]);return _0x1b3caa(_0x1cb4e5['error'][_0x014a('0x16')]);}else{logger['info'](_0x014a('0xf'),_0x290270,_0x014a('0x10'));_0x1b3caa(_0x1cb4e5[_0x014a('0x17')][_0x014a('0x16')]);}})[_0x014a('0x18')](function(_0x476d3e){logger[_0x014a('0x14')](_0x014a('0xf'),_0x290270,_0x476d3e);_0x4e9ed6(_0x476d3e);});});} \ No newline at end of file +var _0x09e4=['code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31b813,_0x3792c3){var _0x3d6737=function(_0x163a79){while(--_0x163a79){_0x31b813['push'](_0x31b813['shift']());}};_0x3d6737(++_0x3792c3);}(_0x09e4,0x1ce));var _0x409e=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x09e4[_0x1b5080];return _0x195c87;};'use strict';var _=require(_0x409e('0x0'));var util=require(_0x409e('0x1'));var moment=require(_0x409e('0x2'));var BPromise=require(_0x409e('0x3'));var rs=require(_0x409e('0x4'));var fs=require('fs');var Redis=require(_0x409e('0x5'));var db=require(_0x409e('0x6'))['db'];var utils=require(_0x409e('0x7'));var logger=require('../../config/logger')(_0x409e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x409e('0x9')][_0x409e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcb9d17,_0x3f124e,_0x5d718e){return new BPromise(function(_0x21255d,_0x420144){return client[_0x409e('0xb')](_0xcb9d17,_0x5d718e)[_0x409e('0xc')](function(_0x5305d4){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3f124e,_0x409e('0xd'));logger[_0x409e('0xe')](_0x409e('0xf'),_0x3f124e,'request\x20sent',JSON[_0x409e('0x10')](_0x5305d4));if(_0x5305d4[_0x409e('0x11')]){if(_0x5305d4[_0x409e('0x11')][_0x409e('0x12')]===0x1f4){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);return _0x420144(_0x5305d4['error']['message']);}logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4['error'][_0x409e('0x14')]);return _0x21255d(_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);}else{logger[_0x409e('0x15')](_0x409e('0x13'),_0x3f124e,_0x409e('0xd'));_0x21255d(_0x5305d4[_0x409e('0x16')][_0x409e('0x14')]);}})[_0x409e('0x17')](function(_0x59fd27){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x59fd27);_0x420144(_0x59fd27);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 9055bbf..770ed5b 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 _0x0699=['/:id','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x0699,0x1db));var _0x9069=function(_0x2f5000,_0x8c6730){_0x2f5000=_0x2f5000-0x0;var _0x1dacc6=_0x0699[_0x2f5000];return _0x1dacc6;};'use strict';var multer=require(_0x9069('0x0'));var util=require('util');var path=require(_0x9069('0x1'));var timeout=require('connect-timeout');var express=require(_0x9069('0x2'));var router=express[_0x9069('0x3')]();var fs_extra=require(_0x9069('0x4'));var auth=require(_0x9069('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9069('0x6'));var controller=require(_0x9069('0x7'));router[_0x9069('0x8')]('/',auth[_0x9069('0x9')](),controller[_0x9069('0xa')]);router[_0x9069('0x8')](_0x9069('0xb'),auth[_0x9069('0x9')](),controller['show']);router['post']('/',auth[_0x9069('0x9')](),controller[_0x9069('0xc')]);router[_0x9069('0xd')](_0x9069('0xb'),auth['isAuthenticated'](),controller[_0x9069('0xe')]);router[_0x9069('0xf')](_0x9069('0xb'),auth[_0x9069('0x9')](),controller[_0x9069('0x10')]);module[_0x9069('0x11')]=router; \ No newline at end of file +var _0xc88f=['create','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x35199d,_0x3e120e){var _0x1a75e5=function(_0x49581f){while(--_0x49581f){_0x35199d['push'](_0x35199d['shift']());}};_0x1a75e5(++_0x3e120e);}(_0xc88f,0x19b));var _0xfc88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc88f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfc88('0x0'));var util=require(_0xfc88('0x1'));var path=require(_0xfc88('0x2'));var timeout=require(_0xfc88('0x3'));var express=require(_0xfc88('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfc88('0x5'));var interaction=require(_0xfc88('0x6'));var config=require('../../config/environment');var controller=require(_0xfc88('0x7'));router['get']('/',auth[_0xfc88('0x8')](),controller[_0xfc88('0x9')]);router[_0xfc88('0xa')](_0xfc88('0xb'),auth[_0xfc88('0x8')](),controller[_0xfc88('0xc')]);router[_0xfc88('0xd')]('/',auth[_0xfc88('0x8')](),controller[_0xfc88('0xe')]);router['put'](_0xfc88('0xb'),auth[_0xfc88('0x8')](),controller[_0xfc88('0xf')]);router['delete'](_0xfc88('0xb'),auth['isAuthenticated'](),controller[_0xfc88('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2abe401..f9b1fb6 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 _0x04df=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x528209,_0x12dc26){var _0x2e1045=function(_0x15c470){while(--_0x15c470){_0x528209['push'](_0x528209['shift']());}};_0x2e1045(++_0x12dc26);}(_0x04df,0x1a9));var _0xf04d=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x04df[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0xf04d('0x0'));module[_0xf04d('0x1')]={'type':{'type':Sequelize[_0xf04d('0x2')](_0xf04d('0x3'),_0xf04d('0x4'),_0xf04d('0x5'),_0xf04d('0x6'),'picklist'),'defaultValue':_0xf04d('0x3')},'content':{'type':Sequelize[_0xf04d('0x7')]},'key':{'type':Sequelize[_0xf04d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf04d('0x3'),_0xf04d('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf04d('0x7')]},'nameField':{'type':Sequelize[_0xf04d('0x7')]},'customField':{'type':Sequelize[_0xf04d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf04d('0x7')]}}; \ No newline at end of file +var _0xbc13=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x46404d,_0x1e7bc2){var _0x4d81b3=function(_0x5c272c){while(--_0x5c272c){_0x46404d['push'](_0x46404d['shift']());}};_0x4d81b3(++_0x1e7bc2);}(_0xbc13,0xf4));var _0x3bc1=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0xbc13[_0x539533];return _0x3942f3;};'use strict';var Sequelize=require(_0x3bc1('0x0'));module[_0x3bc1('0x1')]={'type':{'type':Sequelize[_0x3bc1('0x2')]('string',_0x3bc1('0x3'),_0x3bc1('0x4'),_0x3bc1('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x3bc1('0x6')]},'key':{'type':Sequelize[_0x3bc1('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3bc1('0x3'),_0x3bc1('0x4'))},'keyContent':{'type':Sequelize[_0x3bc1('0x6')]},'idField':{'type':Sequelize[_0x3bc1('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3bc1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3bc1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e9b327b..ee9a483 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 _0xcf71=['type','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','DeskField','rawAttributes','fieldName'];(function(_0xe9b37e,_0x3bd2a7){var _0xce95d8=function(_0x431700){while(--_0x431700){_0xe9b37e['push'](_0xe9b37e['shift']());}};_0xce95d8(++_0x3bd2a7);}(_0xcf71,0xba));var _0x1cf7=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0xcf71[_0x1221e8];return _0x3f3041;};'use strict';var emlformat=require(_0x1cf7('0x0'));var rimraf=require(_0x1cf7('0x1'));var zipdir=require(_0x1cf7('0x2'));var jsonpatch=require(_0x1cf7('0x3'));var rp=require('request-promise');var moment=require(_0x1cf7('0x4'));var BPromise=require(_0x1cf7('0x5'));var Mustache=require(_0x1cf7('0x6'));var util=require(_0x1cf7('0x7'));var path=require(_0x1cf7('0x8'));var sox=require(_0x1cf7('0x9'));var csv=require(_0x1cf7('0xa'));var ejs=require(_0x1cf7('0xb'));var fs=require('fs');var fs_extra=require(_0x1cf7('0xc'));var _=require(_0x1cf7('0xd'));var squel=require(_0x1cf7('0xe'));var crypto=require(_0x1cf7('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1cf7('0xa'));var querystring=require(_0x1cf7('0x10'));var Papa=require(_0x1cf7('0x11'));var Redis=require('ioredis');var authService=require(_0x1cf7('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cf7('0x13'));var logger=require(_0x1cf7('0x14'))(_0x1cf7('0x15'));var utils=require(_0x1cf7('0x16'));var config=require(_0x1cf7('0x17'));var licenseUtil=require(_0x1cf7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18dc3b,_0x58c99f){_0x58c99f=_0x58c99f||0xcc;return function(_0x1ad008){if(_0x1ad008){return _0x18dc3b['sendStatus'](_0x58c99f);}return _0x18dc3b[_0x1cf7('0x19')](_0x58c99f)[_0x1cf7('0x1a')]();};}function respondWithResult(_0x5a1b77,_0x33d5b2){_0x33d5b2=_0x33d5b2||0xc8;return function(_0x328d2c){if(_0x328d2c){return _0x5a1b77[_0x1cf7('0x19')](_0x33d5b2)[_0x1cf7('0x1b')](_0x328d2c);}};}function respondWithFilteredResult(_0x1bab03,_0x43d6e){return function(_0x769ee3){if(_0x769ee3){var _0x172915=typeof _0x43d6e[_0x1cf7('0x1c')]===_0x1cf7('0x1d')&&typeof _0x43d6e[_0x1cf7('0x1e')]===_0x1cf7('0x1d');var _0x3f762b=_0x769ee3['count'];var _0x391553=_0x172915?0x0:_0x43d6e[_0x1cf7('0x1c')];var _0x13875c=_0x172915?_0x769ee3['count']:_0x43d6e[_0x1cf7('0x1c')]+_0x43d6e[_0x1cf7('0x1e')];var _0xf1a5ba;if(_0x13875c>=_0x3f762b){_0x13875c=_0x3f762b;_0xf1a5ba=0xc8;}else{_0xf1a5ba=0xce;}_0x1bab03['status'](_0xf1a5ba);return _0x1bab03[_0x1cf7('0x1f')](_0x1cf7('0x20'),_0x391553+'-'+_0x13875c+'/'+_0x3f762b)[_0x1cf7('0x1b')](_0x769ee3);}return null;};}function patchUpdates(_0x37fc26){return function(_0x2c20c4){try{jsonpatch[_0x1cf7('0x21')](_0x2c20c4,_0x37fc26,!![]);}catch(_0x3ad138){return BPromise[_0x1cf7('0x22')](_0x3ad138);}return _0x2c20c4[_0x1cf7('0x23')]();};}function saveUpdates(_0x256151,_0x4ec792){return function(_0x345997){if(_0x345997){return _0x345997[_0x1cf7('0x24')](_0x256151)[_0x1cf7('0x25')](function(_0x1f293c){return _0x1f293c;});}return null;};}function removeEntity(_0x7baff3,_0x1c9100){return function(_0x31b4e9){if(_0x31b4e9){return _0x31b4e9[_0x1cf7('0x26')]()['then'](function(){_0x7baff3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af3e8,_0x489d1f){return function(_0x42046b){if(!_0x42046b){_0x3af3e8[_0x1cf7('0x27')](0x194);}return _0x42046b;};}function handleError(_0x3db370,_0x1ce3ae){_0x1ce3ae=_0x1ce3ae||0x1f4;return function(_0x4dcf35){logger['error'](_0x4dcf35[_0x1cf7('0x28')]);if(_0x4dcf35[_0x1cf7('0x29')]){delete _0x4dcf35[_0x1cf7('0x29')];}_0x3db370[_0x1cf7('0x19')](_0x1ce3ae)[_0x1cf7('0x2a')](_0x4dcf35);};}exports[_0x1cf7('0x2b')]=function(_0x131e8b,_0x5e2047){var _0x125c48={},_0x5c6fee={},_0x4719fe={'count':0x0,'rows':[]};var _0x3d2f45=_[_0x1cf7('0x2c')](db[_0x1cf7('0x2d')][_0x1cf7('0x2e')],function(_0x3efa9c){return{'name':_0x3efa9c[_0x1cf7('0x2f')],'type':_0x3efa9c[_0x1cf7('0x30')]['key']};});_0x5c6fee['model']=_[_0x1cf7('0x2c')](_0x3d2f45,_0x1cf7('0x29'));_0x5c6fee[_0x1cf7('0x31')]=_[_0x1cf7('0x32')](_0x131e8b[_0x1cf7('0x31')]);_0x5c6fee['filters']=_[_0x1cf7('0x33')](_0x5c6fee['model'],_0x5c6fee[_0x1cf7('0x31')]);_0x125c48[_0x1cf7('0x34')]=_['intersection'](_0x5c6fee[_0x1cf7('0x35')],qs[_0x1cf7('0x36')](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x36')]));_0x125c48[_0x1cf7('0x34')]=_0x125c48[_0x1cf7('0x34')]['length']?_0x125c48[_0x1cf7('0x34')]:_0x5c6fee['model'];if(!_0x131e8b['query'][_0x1cf7('0x37')](_0x1cf7('0x38'))){_0x125c48[_0x1cf7('0x1e')]=qs[_0x1cf7('0x1e')](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x1e')]);_0x125c48['offset']=qs['offset'](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x1c')]);}_0x125c48[_0x1cf7('0x39')]=qs[_0x1cf7('0x3a')](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x3a')]);_0x125c48[_0x1cf7('0x3b')]=qs[_0x1cf7('0x3c')](_[_0x1cf7('0x3d')](_0x131e8b[_0x1cf7('0x31')],_0x5c6fee['filters']),_0x3d2f45);if(_0x131e8b[_0x1cf7('0x31')]['filter']){_0x125c48[_0x1cf7('0x3b')]=_[_0x1cf7('0x3e')](_0x125c48['where'],{'$or':_['map'](_0x3d2f45,function(_0x5a0a7c){if(_0x5a0a7c['type']!==_0x1cf7('0x3f')){var _0x197497={};_0x197497[_0x5a0a7c[_0x1cf7('0x29')]]={'$like':'%'+_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x40')]+'%'};return _0x197497;}})});}_0x125c48=_[_0x1cf7('0x3e')]({},_0x125c48,_0x131e8b[_0x1cf7('0x41')]);var _0x7cfd70={'where':_0x125c48['where']};return db[_0x1cf7('0x2d')][_0x1cf7('0x42')](_0x7cfd70)[_0x1cf7('0x25')](function(_0x35a4e2){_0x4719fe[_0x1cf7('0x42')]=_0x35a4e2;if(_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x43')]){_0x125c48[_0x1cf7('0x44')]=[{'all':!![]}];}return db[_0x1cf7('0x2d')][_0x1cf7('0x45')](_0x125c48);})[_0x1cf7('0x25')](function(_0x359486){_0x4719fe[_0x1cf7('0x46')]=_0x359486;return _0x4719fe;})['then'](respondWithFilteredResult(_0x5e2047,_0x125c48))[_0x1cf7('0x47')](handleError(_0x5e2047,null));};exports[_0x1cf7('0x48')]=function(_0x16bf17,_0xb9d92f){var _0x5aa0a3={'raw':!![],'where':{'id':_0x16bf17['params']['id']}},_0x3307b4={};_0x3307b4[_0x1cf7('0x35')]=_[_0x1cf7('0x32')](db[_0x1cf7('0x2d')][_0x1cf7('0x2e')]);_0x3307b4[_0x1cf7('0x31')]=_[_0x1cf7('0x32')](_0x16bf17[_0x1cf7('0x31')]);_0x3307b4[_0x1cf7('0x3c')]=_['intersection'](_0x3307b4[_0x1cf7('0x35')],_0x3307b4[_0x1cf7('0x31')]);_0x5aa0a3[_0x1cf7('0x34')]=_[_0x1cf7('0x33')](_0x3307b4[_0x1cf7('0x35')],qs[_0x1cf7('0x36')](_0x16bf17[_0x1cf7('0x31')][_0x1cf7('0x36')]));_0x5aa0a3[_0x1cf7('0x34')]=_0x5aa0a3['attributes'][_0x1cf7('0x49')]?_0x5aa0a3[_0x1cf7('0x34')]:_0x3307b4[_0x1cf7('0x35')];if(_0x16bf17['query'][_0x1cf7('0x43')]){_0x5aa0a3[_0x1cf7('0x44')]=[{'all':!![]}];}_0x5aa0a3=_[_0x1cf7('0x3e')]({},_0x5aa0a3,_0x16bf17[_0x1cf7('0x41')]);return db[_0x1cf7('0x2d')][_0x1cf7('0x4a')](_0x5aa0a3)[_0x1cf7('0x25')](handleEntityNotFound(_0xb9d92f,null))[_0x1cf7('0x25')](respondWithResult(_0xb9d92f,null))['catch'](handleError(_0xb9d92f,null));};exports[_0x1cf7('0x4b')]=function(_0x218b58,_0x3828d0){return db[_0x1cf7('0x2d')][_0x1cf7('0x4b')](_0x218b58[_0x1cf7('0x4c')],{})[_0x1cf7('0x25')](respondWithResult(_0x3828d0,0xc9))[_0x1cf7('0x47')](handleError(_0x3828d0,null));};exports[_0x1cf7('0x24')]=function(_0x4f27fc,_0xa608b6){if(_0x4f27fc[_0x1cf7('0x4c')]['id']){delete _0x4f27fc['body']['id'];}return db[_0x1cf7('0x2d')][_0x1cf7('0x4a')]({'where':{'id':_0x4f27fc[_0x1cf7('0x4d')]['id']}})[_0x1cf7('0x25')](handleEntityNotFound(_0xa608b6,null))[_0x1cf7('0x25')](saveUpdates(_0x4f27fc[_0x1cf7('0x4c')],null))[_0x1cf7('0x25')](respondWithResult(_0xa608b6,null))[_0x1cf7('0x47')](handleError(_0xa608b6,null));};exports['destroy']=function(_0x4c291c,_0x1004cf){return db[_0x1cf7('0x2d')][_0x1cf7('0x4a')]({'where':{'id':_0x4c291c[_0x1cf7('0x4d')]['id']}})[_0x1cf7('0x25')](handleEntityNotFound(_0x1004cf,null))[_0x1cf7('0x25')](removeEntity(_0x1004cf,null))[_0x1cf7('0x47')](handleError(_0x1004cf,null));}; \ No newline at end of file +var _0x0e6a=['name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','keys','includeAll','include','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error'];(function(_0x3e4a61,_0x59a7c0){var _0x2361b5=function(_0x218adf){while(--_0x218adf){_0x3e4a61['push'](_0x3e4a61['shift']());}};_0x2361b5(++_0x59a7c0);}(_0x0e6a,0x100));var _0xa0e6=function(_0x59e444,_0x2ff6cd){_0x59e444=_0x59e444-0x0;var _0x4924fb=_0x0e6a[_0x59e444];return _0x4924fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0e6('0x0'));var zipdir=require(_0xa0e6('0x1'));var jsonpatch=require(_0xa0e6('0x2'));var rp=require(_0xa0e6('0x3'));var moment=require(_0xa0e6('0x4'));var BPromise=require(_0xa0e6('0x5'));var Mustache=require('mustache');var util=require(_0xa0e6('0x6'));var path=require(_0xa0e6('0x7'));var sox=require(_0xa0e6('0x8'));var csv=require(_0xa0e6('0x9'));var ejs=require(_0xa0e6('0xa'));var fs=require('fs');var fs_extra=require(_0xa0e6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0e6('0xc'));var jsforce=require(_0xa0e6('0xd'));var deskjs=require(_0xa0e6('0xe'));var toCsv=require(_0xa0e6('0x9'));var querystring=require(_0xa0e6('0xf'));var Papa=require(_0xa0e6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa0e6('0x11'));var as=require(_0xa0e6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0e6('0x13'))('api');var utils=require(_0xa0e6('0x14'));var config=require(_0xa0e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1854b2,_0xb8b194){_0xb8b194=_0xb8b194||0xcc;return function(_0x27118c){if(_0x27118c){return _0x1854b2[_0xa0e6('0x16')](_0xb8b194);}return _0x1854b2[_0xa0e6('0x17')](_0xb8b194)['end']();};}function respondWithResult(_0x1165bf,_0x558c9d){_0x558c9d=_0x558c9d||0xc8;return function(_0x14d99c){if(_0x14d99c){return _0x1165bf[_0xa0e6('0x17')](_0x558c9d)['json'](_0x14d99c);}};}function respondWithFilteredResult(_0x197e8b,_0x2da5c7){return function(_0x1bfdb1){if(_0x1bfdb1){var _0x301a37=typeof _0x2da5c7[_0xa0e6('0x18')]===_0xa0e6('0x19')&&typeof _0x2da5c7[_0xa0e6('0x1a')]==='undefined';var _0x5b4294=_0x1bfdb1['count'];var _0x3cc453=_0x301a37?0x0:_0x2da5c7[_0xa0e6('0x18')];var _0x5b9aa6=_0x301a37?_0x1bfdb1[_0xa0e6('0x1b')]:_0x2da5c7[_0xa0e6('0x18')]+_0x2da5c7[_0xa0e6('0x1a')];var _0x5c0718;if(_0x5b9aa6>=_0x5b4294){_0x5b9aa6=_0x5b4294;_0x5c0718=0xc8;}else{_0x5c0718=0xce;}_0x197e8b['status'](_0x5c0718);return _0x197e8b[_0xa0e6('0x1c')](_0xa0e6('0x1d'),_0x3cc453+'-'+_0x5b9aa6+'/'+_0x5b4294)['json'](_0x1bfdb1);}return null;};}function patchUpdates(_0x2dc797){return function(_0x290a58){try{jsonpatch['apply'](_0x290a58,_0x2dc797,!![]);}catch(_0x200849){return BPromise[_0xa0e6('0x1e')](_0x200849);}return _0x290a58['save']();};}function saveUpdates(_0x2eddca,_0x582ee5){return function(_0x2361ad){if(_0x2361ad){return _0x2361ad[_0xa0e6('0x1f')](_0x2eddca)[_0xa0e6('0x20')](function(_0x2e3224){return _0x2e3224;});}return null;};}function removeEntity(_0x421503,_0x1182ee){return function(_0x4683ad){if(_0x4683ad){return _0x4683ad[_0xa0e6('0x21')]()[_0xa0e6('0x20')](function(){_0x421503[_0xa0e6('0x17')](0xcc)[_0xa0e6('0x22')]();});}};}function handleEntityNotFound(_0x275269,_0xf35c98){return function(_0x144b7c){if(!_0x144b7c){_0x275269[_0xa0e6('0x16')](0x194);}return _0x144b7c;};}function handleError(_0x301854,_0x12b46f){_0x12b46f=_0x12b46f||0x1f4;return function(_0x35aa2a){logger[_0xa0e6('0x23')](_0x35aa2a['stack']);if(_0x35aa2a[_0xa0e6('0x24')]){delete _0x35aa2a[_0xa0e6('0x24')];}_0x301854[_0xa0e6('0x17')](_0x12b46f)[_0xa0e6('0x25')](_0x35aa2a);};}exports[_0xa0e6('0x26')]=function(_0x17c0a5,_0x2a5d3c){var _0x51c173={},_0x500a3d={},_0x12185c={'count':0x0,'rows':[]};var _0x2f4c57=_[_0xa0e6('0x27')](db[_0xa0e6('0x28')][_0xa0e6('0x29')],function(_0x1dc830){return{'name':_0x1dc830[_0xa0e6('0x2a')],'type':_0x1dc830[_0xa0e6('0x2b')][_0xa0e6('0x2c')]};});_0x500a3d[_0xa0e6('0x2d')]=_[_0xa0e6('0x27')](_0x2f4c57,'name');_0x500a3d['query']=_['keys'](_0x17c0a5[_0xa0e6('0x2e')]);_0x500a3d[_0xa0e6('0x2f')]=_[_0xa0e6('0x30')](_0x500a3d[_0xa0e6('0x2d')],_0x500a3d['query']);_0x51c173[_0xa0e6('0x31')]=_['intersection'](_0x500a3d[_0xa0e6('0x2d')],qs[_0xa0e6('0x32')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x32')]));_0x51c173['attributes']=_0x51c173['attributes'][_0xa0e6('0x33')]?_0x51c173[_0xa0e6('0x31')]:_0x500a3d[_0xa0e6('0x2d')];if(!_0x17c0a5['query'][_0xa0e6('0x34')](_0xa0e6('0x35'))){_0x51c173[_0xa0e6('0x1a')]=qs[_0xa0e6('0x1a')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x1a')]);_0x51c173[_0xa0e6('0x18')]=qs[_0xa0e6('0x18')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x18')]);}_0x51c173[_0xa0e6('0x36')]=qs[_0xa0e6('0x37')](_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x37')]);_0x51c173[_0xa0e6('0x38')]=qs[_0xa0e6('0x2f')](_[_0xa0e6('0x39')](_0x17c0a5[_0xa0e6('0x2e')],_0x500a3d[_0xa0e6('0x2f')]),_0x2f4c57);if(_0x17c0a5[_0xa0e6('0x2e')]['filter']){_0x51c173[_0xa0e6('0x38')]=_[_0xa0e6('0x3a')](_0x51c173[_0xa0e6('0x38')],{'$or':_[_0xa0e6('0x27')](_0x2f4c57,function(_0x41aa76){if(_0x41aa76[_0xa0e6('0x2b')]!==_0xa0e6('0x3b')){var _0x541e0d={};_0x541e0d[_0x41aa76[_0xa0e6('0x24')]]={'$like':'%'+_0x17c0a5[_0xa0e6('0x2e')][_0xa0e6('0x3c')]+'%'};return _0x541e0d;}})});}_0x51c173=_[_0xa0e6('0x3a')]({},_0x51c173,_0x17c0a5[_0xa0e6('0x3d')]);var _0x3127a8={'where':_0x51c173[_0xa0e6('0x38')]};return db[_0xa0e6('0x28')]['count'](_0x3127a8)[_0xa0e6('0x20')](function(_0x10964d){_0x12185c[_0xa0e6('0x1b')]=_0x10964d;if(_0x17c0a5[_0xa0e6('0x2e')]['includeAll']){_0x51c173['include']=[{'all':!![]}];}return db[_0xa0e6('0x28')][_0xa0e6('0x3e')](_0x51c173);})[_0xa0e6('0x20')](function(_0x11b884){_0x12185c[_0xa0e6('0x3f')]=_0x11b884;return _0x12185c;})[_0xa0e6('0x20')](respondWithFilteredResult(_0x2a5d3c,_0x51c173))['catch'](handleError(_0x2a5d3c,null));};exports[_0xa0e6('0x40')]=function(_0x5db983,_0x3bebb2){var _0x3c3dc7={'raw':!![],'where':{'id':_0x5db983[_0xa0e6('0x41')]['id']}},_0x1b2195={};_0x1b2195[_0xa0e6('0x2d')]=_[_0xa0e6('0x42')](db[_0xa0e6('0x28')][_0xa0e6('0x29')]);_0x1b2195[_0xa0e6('0x2e')]=_[_0xa0e6('0x42')](_0x5db983[_0xa0e6('0x2e')]);_0x1b2195[_0xa0e6('0x2f')]=_['intersection'](_0x1b2195[_0xa0e6('0x2d')],_0x1b2195[_0xa0e6('0x2e')]);_0x3c3dc7[_0xa0e6('0x31')]=_[_0xa0e6('0x30')](_0x1b2195[_0xa0e6('0x2d')],qs['fields'](_0x5db983[_0xa0e6('0x2e')][_0xa0e6('0x32')]));_0x3c3dc7[_0xa0e6('0x31')]=_0x3c3dc7[_0xa0e6('0x31')][_0xa0e6('0x33')]?_0x3c3dc7[_0xa0e6('0x31')]:_0x1b2195[_0xa0e6('0x2d')];if(_0x5db983[_0xa0e6('0x2e')][_0xa0e6('0x43')]){_0x3c3dc7[_0xa0e6('0x44')]=[{'all':!![]}];}_0x3c3dc7=_[_0xa0e6('0x3a')]({},_0x3c3dc7,_0x5db983['options']);return db['DeskField'][_0xa0e6('0x45')](_0x3c3dc7)[_0xa0e6('0x20')](handleEntityNotFound(_0x3bebb2,null))[_0xa0e6('0x20')](respondWithResult(_0x3bebb2,null))[_0xa0e6('0x46')](handleError(_0x3bebb2,null));};exports['create']=function(_0x8987a0,_0x3cf8d1){return db[_0xa0e6('0x28')][_0xa0e6('0x47')](_0x8987a0['body'],{})['then'](respondWithResult(_0x3cf8d1,0xc9))[_0xa0e6('0x46')](handleError(_0x3cf8d1,null));};exports['update']=function(_0x356a2d,_0x3e2a28){if(_0x356a2d['body']['id']){delete _0x356a2d[_0xa0e6('0x48')]['id'];}return db['DeskField'][_0xa0e6('0x45')]({'where':{'id':_0x356a2d[_0xa0e6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e2a28,null))[_0xa0e6('0x20')](saveUpdates(_0x356a2d[_0xa0e6('0x48')],null))[_0xa0e6('0x20')](respondWithResult(_0x3e2a28,null))[_0xa0e6('0x46')](handleError(_0x3e2a28,null));};exports[_0xa0e6('0x21')]=function(_0x11a924,_0x1745ea){return db[_0xa0e6('0x28')][_0xa0e6('0x45')]({'where':{'id':_0x11a924[_0xa0e6('0x41')]['id']}})[_0xa0e6('0x20')](handleEntityNotFound(_0x1745ea,null))[_0xa0e6('0x20')](removeEntity(_0x1745ea,null))['catch'](handleError(_0x1745ea,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d62902d..0803eb4 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 _0x1d19=['bluebird','path','rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api','moment'];(function(_0x5b6988,_0x67e002){var _0x4e2cc9=function(_0x1f3a40){while(--_0x1f3a40){_0x5b6988['push'](_0x5b6988['shift']());}};_0x4e2cc9(++_0x67e002);}(_0x1d19,0xdc));var _0x91d1=function(_0x271575,_0x181a21){_0x271575=_0x271575-0x0;var _0x1cd7d2=_0x1d19[_0x271575];return _0x1cd7d2;};'use strict';var _=require(_0x91d1('0x0'));var util=require(_0x91d1('0x1'));var logger=require('../../config/logger')(_0x91d1('0x2'));var moment=require(_0x91d1('0x3'));var BPromise=require(_0x91d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91d1('0x5'));var rimraf=require(_0x91d1('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x91d1('0x7')]=function(_0x198c3f,_0x5b8c2a){return _0x198c3f[_0x91d1('0x8')](_0x91d1('0x9'),attributes,{'tableName':_0x91d1('0xa'),'paranoid':![],'indexes':[{'name':_0x91d1('0xb'),'fields':[_0x91d1('0xc'),_0x91d1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00ef=['request-promise','path','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','../../config/logger','moment'];(function(_0x55498a,_0x1ee0e4){var _0x27b7f4=function(_0x32cefb){while(--_0x32cefb){_0x55498a['push'](_0x55498a['shift']());}};_0x27b7f4(++_0x1ee0e4);}(_0x00ef,0x1e1));var _0xf00e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x00ef[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf00e('0x0'));var util=require('util');var logger=require(_0xf00e('0x1'))('api');var moment=require(_0xf00e('0x2'));var BPromise=require('bluebird');var rp=require(_0xf00e('0x3'));var fs=require('fs');var path=require(_0xf00e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf00e('0x5'));module['exports']=function(_0x565b58,_0x625d26){return _0x565b58[_0xf00e('0x6')](_0xf00e('0x7'),attributes,{'tableName':_0xf00e('0x8'),'paranoid':![],'indexes':[{'name':_0xf00e('0x9'),'fields':['idField',_0xf00e('0xa')],'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 8c54815..77ae952 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 _0x260c=['DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f1438,_0x2fb615){var _0x2d209f=function(_0x2e5b0e){while(--_0x2e5b0e){_0x3f1438['push'](_0x3f1438['shift']());}};_0x2d209f(++_0x2fb615);}(_0x260c,0x1d2));var _0xc260=function(_0x4d1f59,_0x4483ec){_0x4d1f59=_0x4d1f59-0x0;var _0x468441=_0x260c[_0x4d1f59];return _0x468441;};'use strict';var _=require(_0xc260('0x0'));var util=require('util');var moment=require(_0xc260('0x1'));var BPromise=require(_0xc260('0x2'));var rs=require(_0xc260('0x3'));var fs=require('fs');var Redis=require(_0xc260('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc260('0x5'));var logger=require(_0xc260('0x6'))(_0xc260('0x7'));var config=require(_0xc260('0x8'));var jayson=require(_0xc260('0x9'));var client=jayson[_0xc260('0xa')][_0xc260('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22cf87,_0x4a557b,_0x157c24){return new BPromise(function(_0xe1d2a5,_0x129165){return client[_0xc260('0xc')](_0x22cf87,_0x157c24)['then'](function(_0x2b7f5c){logger[_0xc260('0xd')](_0xc260('0xe'),_0x4a557b,_0xc260('0xf'));logger[_0xc260('0x10')](_0xc260('0x11'),_0x4a557b,'request\x20sent',JSON['stringify'](_0x2b7f5c));if(_0x2b7f5c['error']){if(_0x2b7f5c[_0xc260('0x12')][_0xc260('0x13')]===0x1f4){logger[_0xc260('0x12')]('DeskField,\x20%s,\x20%s',_0x4a557b,_0x2b7f5c[_0xc260('0x12')][_0xc260('0x14')]);return _0x129165(_0x2b7f5c[_0xc260('0x12')][_0xc260('0x14')]);}logger[_0xc260('0x12')]('DeskField,\x20%s,\x20%s',_0x4a557b,_0x2b7f5c[_0xc260('0x12')]['message']);return _0xe1d2a5(_0x2b7f5c['error'][_0xc260('0x14')]);}else{logger['info'](_0xc260('0xe'),_0x4a557b,_0xc260('0xf'));_0xe1d2a5(_0x2b7f5c[_0xc260('0x15')][_0xc260('0x14')]);}})[_0xc260('0x16')](function(_0x43b531){logger['error'](_0xc260('0xe'),_0x4a557b,_0x43b531);_0x129165(_0x43b531);});});} \ No newline at end of file +var _0x7173=['request\x20sent','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x5dc650,_0x5d3864){var _0x4161df=function(_0x285079){while(--_0x285079){_0x5dc650['push'](_0x5dc650['shift']());}};_0x4161df(++_0x5d3864);}(_0x7173,0x6f));var _0x3717=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x7173[_0x367e5b];return _0x4b909e;};'use strict';var _=require('lodash');var util=require(_0x3717('0x0'));var moment=require(_0x3717('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3717('0x2'));var db=require(_0x3717('0x3'))['db'];var utils=require(_0x3717('0x4'));var logger=require(_0x3717('0x5'))('rpc');var config=require(_0x3717('0x6'));var jayson=require(_0x3717('0x7'));var client=jayson[_0x3717('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x244a74,_0x6b2b64,_0x55ed74){return new BPromise(function(_0x1cff08,_0x3f2cda){return client[_0x3717('0x9')](_0x244a74,_0x55ed74)[_0x3717('0xa')](function(_0xedb150){logger[_0x3717('0xb')](_0x3717('0xc'),_0x6b2b64,'request\x20sent');logger[_0x3717('0xd')](_0x3717('0xe'),_0x6b2b64,_0x3717('0xf'),JSON[_0x3717('0x10')](_0xedb150));if(_0xedb150[_0x3717('0x11')]){if(_0xedb150[_0x3717('0x11')][_0x3717('0x12')]===0x1f4){logger[_0x3717('0x11')]('DeskField,\x20%s,\x20%s',_0x6b2b64,_0xedb150[_0x3717('0x11')]['message']);return _0x3f2cda(_0xedb150['error']['message']);}logger['error'](_0x3717('0xc'),_0x6b2b64,_0xedb150['error']['message']);return _0x1cff08(_0xedb150[_0x3717('0x11')][_0x3717('0x13')]);}else{logger[_0x3717('0xb')]('DeskField,\x20%s,\x20%s',_0x6b2b64,'request\x20sent');_0x1cff08(_0xedb150[_0x3717('0x14')][_0x3717('0x13')]);}})['catch'](function(_0x4d944f){logger[_0x3717('0x11')](_0x3717('0xc'),_0x6b2b64,_0x4d944f);_0x3f2cda(_0x4d944f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6e4ae53..142e30c 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 _0x9e3f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','multer'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9e3f,0x1cd));var _0xf9e3=function(_0x470e5f,_0x35e00c){_0x470e5f=_0x470e5f-0x0;var _0x5a9679=_0x9e3f[_0x470e5f];return _0x5a9679;};'use strict';var multer=require(_0xf9e3('0x0'));var util=require('util');var path=require(_0xf9e3('0x1'));var timeout=require(_0xf9e3('0x2'));var express=require('express');var router=express[_0xf9e3('0x3')]();var fs_extra=require(_0xf9e3('0x4'));var auth=require(_0xf9e3('0x5'));var interaction=require(_0xf9e3('0x6'));var config=require(_0xf9e3('0x7'));var controller=require(_0xf9e3('0x8'));router[_0xf9e3('0x9')]('/',auth[_0xf9e3('0xa')](),controller['index']);router[_0xf9e3('0x9')](_0xf9e3('0xb'),auth[_0xf9e3('0xa')](),controller[_0xf9e3('0xc')]);router[_0xf9e3('0x9')](_0xf9e3('0xd'),auth[_0xf9e3('0xa')](),controller[_0xf9e3('0xe')]);router[_0xf9e3('0x9')]('/:id/fields',auth[_0xf9e3('0xa')](),controller['getFields']);router[_0xf9e3('0xf')]('/',auth[_0xf9e3('0xa')](),controller[_0xf9e3('0x10')]);router[_0xf9e3('0xf')](_0xf9e3('0xd'),auth[_0xf9e3('0xa')](),controller[_0xf9e3('0x11')]);router[_0xf9e3('0x12')]('/:id',auth[_0xf9e3('0xa')](),controller[_0xf9e3('0x13')]);router[_0xf9e3('0x14')](_0xf9e3('0xb'),auth[_0xf9e3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4b83=['isAuthenticated','/:id/configurations','getConfigurations','post','put','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id'];(function(_0x48aade,_0x70232){var _0x2ae465=function(_0x523c4d){while(--_0x523c4d){_0x48aade['push'](_0x48aade['shift']());}};_0x2ae465(++_0x70232);}(_0x4b83,0x76));var _0x34b8=function(_0x5aeea8,_0x1a5245){_0x5aeea8=_0x5aeea8-0x0;var _0x23c4ba=_0x4b83[_0x5aeea8];return _0x23c4ba;};'use strict';var multer=require(_0x34b8('0x0'));var util=require(_0x34b8('0x1'));var path=require(_0x34b8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x34b8('0x3')]();var fs_extra=require(_0x34b8('0x4'));var auth=require(_0x34b8('0x5'));var interaction=require(_0x34b8('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x34b8('0x7')]);router[_0x34b8('0x8')](_0x34b8('0x9'),auth[_0x34b8('0xa')](),controller['show']);router[_0x34b8('0x8')](_0x34b8('0xb'),auth[_0x34b8('0xa')](),controller[_0x34b8('0xc')]);router['get']('/:id/fields',auth[_0x34b8('0xa')](),controller['getFields']);router['post']('/',auth[_0x34b8('0xa')](),controller['create']);router[_0x34b8('0xd')](_0x34b8('0xb'),auth[_0x34b8('0xa')](),controller['addConfiguration']);router[_0x34b8('0xe')](_0x34b8('0x9'),auth[_0x34b8('0xa')](),controller['update']);router[_0x34b8('0xf')](_0x34b8('0x9'),auth[_0x34b8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index b206776..c11c5b8 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 _0x0686=['exports','STRING','BOOLEAN','sequelize'];(function(_0x47a99d,_0x40c671){var _0x2ed433=function(_0x46be47){while(--_0x46be47){_0x47a99d['push'](_0x47a99d['shift']());}};_0x2ed433(++_0x40c671);}(_0x0686,0x123));var _0x6068=function(_0x194d67,_0x4f7c7b){_0x194d67=_0x194d67-0x0;var _0x4d31f0=_0x0686[_0x194d67];return _0x4d31f0;};'use strict';var Sequelize=require(_0x6068('0x0'));module[_0x6068('0x1')]={'name':{'type':Sequelize[_0x6068('0x2')]},'username':{'type':Sequelize[_0x6068('0x2')]},'password':{'type':Sequelize[_0x6068('0x2')]},'remoteUri':{'type':Sequelize[_0x6068('0x2')]},'tenantId':{'type':Sequelize[_0x6068('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x6068('0x2')]},'serverUrl':{'type':Sequelize[_0x6068('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6068('0x2')]},'modernAuthentication':{'type':Sequelize[_0x6068('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x535f=['exports','STRING','BOOLEAN'];(function(_0xda4ac2,_0x55a808){var _0x5a234d=function(_0x44258d){while(--_0x44258d){_0xda4ac2['push'](_0xda4ac2['shift']());}};_0x5a234d(++_0x55a808);}(_0x535f,0x111));var _0xf535=function(_0x14397a,_0x3491e8){_0x14397a=_0x14397a-0x0;var _0x125527=_0x535f[_0x14397a];return _0x125527;};'use strict';var Sequelize=require('sequelize');module[_0xf535('0x0')]={'name':{'type':Sequelize[_0xf535('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf535('0x1')]},'remoteUri':{'type':Sequelize[_0xf535('0x1')]},'tenantId':{'type':Sequelize[_0xf535('0x1')]},'clientId':{'type':Sequelize[_0xf535('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf535('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf535('0x1')]},'modernAuthentication':{'type':Sequelize[_0xf535('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 436f527..a81b262 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 _0x8769=['modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','parentcaseidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','remoteUri','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','BooleanAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','TrueOption','UserLocalizedLabel','true','FalseOption','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.','request-promise','util','../../components/parsers/qs','api','../../mysqldb','json','offset','undefined','limit','count','set','then','destroy','end','sendStatus','error','stack','name','status','send','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','getConfigurations','findOne','order','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','Incident','title','description','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname'];(function(_0x77dd68,_0x418d0c){var _0x28106c=function(_0xc445b8){while(--_0xc445b8){_0x77dd68['push'](_0x77dd68['shift']());}};_0x28106c(++_0x418d0c);}(_0x8769,0x110));var _0x9876=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x8769[_0x2b9b7f];return _0x4ed19a;};'use strict';var rp=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var _=require('lodash');var qs=require(_0x9876('0x2'));var logger=require('../../config/logger')(_0x9876('0x3'));var db=require(_0x9876('0x4'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x4f7b6b,_0x2a6a2b){_0x2a6a2b=_0x2a6a2b||0xc8;return function(_0x34f712){if(_0x34f712){return _0x4f7b6b['status'](_0x2a6a2b)[_0x9876('0x5')](_0x34f712);}};}function respondWithFilteredResult(_0x5a4149,_0x4e1b47){return function(_0x1474a9){if(_0x1474a9){var _0x22fbbd=typeof _0x4e1b47[_0x9876('0x6')]===_0x9876('0x7')&&typeof _0x4e1b47[_0x9876('0x8')]===_0x9876('0x7');var _0xe97c24=_0x1474a9[_0x9876('0x9')];var _0x3c6568=_0x22fbbd?0x0:_0x4e1b47[_0x9876('0x6')];var _0x1cac6c=_0x22fbbd?_0x1474a9[_0x9876('0x9')]:_0x4e1b47[_0x9876('0x6')]+_0x4e1b47[_0x9876('0x8')];var _0x2ef152;if(_0x1cac6c>=_0xe97c24){_0x1cac6c=_0xe97c24;_0x2ef152=0xc8;}else{_0x2ef152=0xce;}_0x5a4149['status'](_0x2ef152);return _0x5a4149[_0x9876('0xa')]('Content-Range',_0x3c6568+'-'+_0x1cac6c+'/'+_0xe97c24)[_0x9876('0x5')](_0x1474a9);}return null;};}function saveUpdates(_0x34a45a){return function(_0x5485f7){if(_0x5485f7){return _0x5485f7['update'](_0x34a45a)[_0x9876('0xb')](function(_0x5b04d2){return _0x5b04d2;});}return null;};}function removeEntity(_0x427cce){return function(_0x39644e){if(_0x39644e){return _0x39644e[_0x9876('0xc')]()[_0x9876('0xb')](function(){_0x427cce['status'](0xcc)[_0x9876('0xd')]();});}};}function handleEntityNotFound(_0x3152a1){return function(_0x2ccd1a){if(!_0x2ccd1a){_0x3152a1[_0x9876('0xe')](0x194);}return _0x2ccd1a;};}function handleError(_0x42ae88,_0x321e48){_0x321e48=_0x321e48||0x1f4;return function(_0x8e4f50){logger[_0x9876('0xf')](_0x8e4f50[_0x9876('0x10')]);if(_0x8e4f50[_0x9876('0x11')]){delete _0x8e4f50['name'];}_0x42ae88[_0x9876('0x12')](_0x321e48)[_0x9876('0x13')](_0x8e4f50);};}exports['index']=function(_0x43cd0f,_0x40582d){var _0x6d7c94={},_0x2d8969={},_0x264445={'count':0x0,'rows':[]};var _0x73a9f7=_['map'](db[_0x9876('0x14')][_0x9876('0x15')],function(_0x71d13e){return{'name':_0x71d13e[_0x9876('0x16')],'type':_0x71d13e[_0x9876('0x17')][_0x9876('0x18')]};});_0x2d8969[_0x9876('0x19')]=_[_0x9876('0x1a')](_0x73a9f7,_0x9876('0x11'));_0x2d8969[_0x9876('0x1b')]=_[_0x9876('0x1c')](_0x43cd0f['query']);_0x2d8969[_0x9876('0x1d')]=_[_0x9876('0x1e')](_0x2d8969['model'],_0x2d8969[_0x9876('0x1b')]);_0x6d7c94[_0x9876('0x1f')]=_[_0x9876('0x1e')](_0x2d8969[_0x9876('0x19')],qs[_0x9876('0x20')](_0x43cd0f[_0x9876('0x1b')][_0x9876('0x20')]));_0x6d7c94[_0x9876('0x1f')]=_0x6d7c94[_0x9876('0x1f')][_0x9876('0x21')]?_0x6d7c94[_0x9876('0x1f')]:_0x2d8969['model'];if(!_0x43cd0f[_0x9876('0x1b')][_0x9876('0x22')]('nolimit')){_0x6d7c94[_0x9876('0x8')]=qs['limit'](_0x43cd0f['query'][_0x9876('0x8')]);_0x6d7c94[_0x9876('0x6')]=qs[_0x9876('0x6')](_0x43cd0f['query'][_0x9876('0x6')]);}_0x6d7c94['order']=qs[_0x9876('0x23')](_0x43cd0f['query'][_0x9876('0x23')]);_0x6d7c94['where']=qs[_0x9876('0x1d')](_[_0x9876('0x24')](_0x43cd0f[_0x9876('0x1b')],_0x2d8969['filters']),_0x73a9f7);if(_0x43cd0f[_0x9876('0x1b')][_0x9876('0x25')]){_0x6d7c94[_0x9876('0x26')]=_['merge'](_0x6d7c94[_0x9876('0x26')],{'$or':_['map'](_0x73a9f7,function(_0x2b34bd){if(_0x2b34bd['type']!=='VIRTUAL'){var _0x5786e9={};_0x5786e9[_0x2b34bd[_0x9876('0x11')]]={'$like':'%'+_0x43cd0f[_0x9876('0x1b')]['filter']+'%'};return _0x5786e9;}})});}_0x6d7c94=_[_0x9876('0x27')]({},_0x6d7c94,_0x43cd0f[_0x9876('0x28')]);var _0x4faf4f={'where':_0x6d7c94[_0x9876('0x26')]};return db[_0x9876('0x14')][_0x9876('0x9')](_0x4faf4f)[_0x9876('0xb')](function(_0x4ddeb9){_0x264445[_0x9876('0x9')]=_0x4ddeb9;if(_0x43cd0f['query'][_0x9876('0x29')]){_0x6d7c94[_0x9876('0x2a')]=[{'all':!![]}];}return db[_0x9876('0x14')][_0x9876('0x2b')](_0x6d7c94);})[_0x9876('0xb')](function(_0x537327){_0x264445[_0x9876('0x2c')]=_0x537327;return _0x264445;})[_0x9876('0xb')](respondWithFilteredResult(_0x40582d,_0x6d7c94))[_0x9876('0x2d')](handleError(_0x40582d,null));};exports['show']=function(_0xf2a278,_0x5c8d9d){var _0x1aa8af={'raw':![],'where':{'id':_0xf2a278['params']['id']}},_0x4873a1={};_0x4873a1[_0x9876('0x19')]=_['keys'](db[_0x9876('0x14')][_0x9876('0x15')]);_0x4873a1['query']=_[_0x9876('0x1c')](_0xf2a278[_0x9876('0x1b')]);_0x4873a1[_0x9876('0x1d')]=_[_0x9876('0x1e')](_0x4873a1[_0x9876('0x19')],_0x4873a1[_0x9876('0x1b')]);_0x1aa8af[_0x9876('0x1f')]=_[_0x9876('0x1e')](_0x4873a1[_0x9876('0x19')],qs[_0x9876('0x20')](_0xf2a278[_0x9876('0x1b')][_0x9876('0x20')]));_0x1aa8af[_0x9876('0x1f')]=_0x1aa8af[_0x9876('0x1f')][_0x9876('0x21')]?_0x1aa8af[_0x9876('0x1f')]:_0x4873a1[_0x9876('0x19')];if(_0xf2a278[_0x9876('0x1b')][_0x9876('0x29')]){_0x1aa8af[_0x9876('0x2a')]=[{'all':!![]}];}_0x1aa8af=_[_0x9876('0x27')]({},_0x1aa8af,_0xf2a278['options']);return db[_0x9876('0x14')][_0x9876('0x2e')](_0x1aa8af)[_0x9876('0xb')](handleEntityNotFound(_0x5c8d9d,null))[_0x9876('0xb')](respondWithResult(_0x5c8d9d,null))[_0x9876('0x2d')](handleError(_0x5c8d9d,null));};exports['create']=function(_0x4bd1b5,_0xf60848){return db['Dynamics365Account'][_0x9876('0x2f')](_0x4bd1b5[_0x9876('0x30')],{})[_0x9876('0xb')](respondWithResult(_0xf60848,0xc9))['catch'](handleError(_0xf60848,null));};exports[_0x9876('0x31')]=function(_0x1c6324,_0x36d3ce){if(_0x1c6324[_0x9876('0x30')]['id']){delete _0x1c6324[_0x9876('0x30')]['id'];}return db['Dynamics365Account'][_0x9876('0x2e')]({'where':{'id':_0x1c6324[_0x9876('0x32')]['id']}})[_0x9876('0xb')](handleEntityNotFound(_0x36d3ce,null))['then'](saveUpdates(_0x1c6324[_0x9876('0x30')],null))[_0x9876('0xb')](respondWithResult(_0x36d3ce,null))[_0x9876('0x2d')](handleError(_0x36d3ce,null));};exports[_0x9876('0xc')]=function(_0xa1e1b8,_0x1fcfe4){return db[_0x9876('0x14')][_0x9876('0x2e')]({'where':{'id':_0xa1e1b8[_0x9876('0x32')]['id']}})['then'](handleEntityNotFound(_0x1fcfe4,null))[_0x9876('0xb')](removeEntity(_0x1fcfe4,null))[_0x9876('0x2d')](handleError(_0x1fcfe4,null));};exports[_0x9876('0x33')]=function(_0x32533a,_0x43170d){var _0x87a957={};var _0x3e3bb2={};var _0x19d1ce;var _0x43b201;return db[_0x9876('0x14')][_0x9876('0x34')]({'where':{'id':_0x32533a[_0x9876('0x32')]['id']}})[_0x9876('0xb')](handleEntityNotFound(_0x43170d,null))['then'](function(_0x2f6c32){if(_0x2f6c32){_0x19d1ce=_0x2f6c32;_0x3e3bb2['model']=_['keys'](db['Dynamics365Configuration'][_0x9876('0x15')]);_0x3e3bb2[_0x9876('0x1b')]=_['keys'](_0x32533a[_0x9876('0x1b')]);_0x3e3bb2[_0x9876('0x1d')]=_[_0x9876('0x1e')](_0x3e3bb2['model'],_0x3e3bb2['query']);_0x87a957[_0x9876('0x1f')]=_[_0x9876('0x1e')](_0x3e3bb2[_0x9876('0x19')],qs['fields'](_0x32533a[_0x9876('0x1b')]['fields']));_0x87a957[_0x9876('0x1f')]=_0x87a957[_0x9876('0x1f')][_0x9876('0x21')]?_0x87a957[_0x9876('0x1f')]:_0x3e3bb2[_0x9876('0x19')];_0x87a957[_0x9876('0x35')]=qs['sort'](_0x32533a[_0x9876('0x1b')]['sort']);_0x87a957[_0x9876('0x26')]=qs['filters'](_[_0x9876('0x24')](_0x32533a[_0x9876('0x1b')],_0x3e3bb2[_0x9876('0x1d')]));if(_0x32533a[_0x9876('0x1b')][_0x9876('0x25')]){_0x87a957[_0x9876('0x26')]=_[_0x9876('0x27')](_0x87a957[_0x9876('0x26')],{'$or':_[_0x9876('0x1a')](_0x87a957[_0x9876('0x1f')],function(_0x17b7df){var _0xdba3aa={};_0xdba3aa[_0x17b7df]={'$like':'%'+_0x32533a[_0x9876('0x1b')][_0x9876('0x25')]+'%'};return _0xdba3aa;})});}_0x87a957=_[_0x9876('0x27')]({},_0x87a957,_0x32533a[_0x9876('0x28')]);return _0x19d1ce[_0x9876('0x33')](_0x87a957);}})[_0x9876('0xb')](function(_0x418f45){if(_0x418f45){_0x43b201=_0x418f45[_0x9876('0x21')];if(!_0x32533a[_0x9876('0x1b')][_0x9876('0x22')](_0x9876('0x36'))){_0x87a957[_0x9876('0x8')]=qs[_0x9876('0x8')](_0x32533a['query']['limit']);_0x87a957[_0x9876('0x6')]=qs['offset'](_0x32533a[_0x9876('0x1b')]['offset']);}return _0x19d1ce[_0x9876('0x33')](_0x87a957);}})['then'](function(_0xa3f842){if(_0xa3f842){return _0xa3f842?{'count':_0x43b201,'rows':_0xa3f842}:null;}})['then'](respondWithResult(_0x43170d,null))['catch'](handleError(_0x43170d,null));};exports['addConfiguration']=function(_0x59cb7c,_0x229d75){if(_0x59cb7c[_0x9876('0x30')]['id']){delete _0x59cb7c['body']['id'];}return db[_0x9876('0x14')][_0x9876('0x34')]({'where':{'id':_0x59cb7c[_0x9876('0x32')]['id']}})[_0x9876('0xb')](handleEntityNotFound(_0x229d75,null))[_0x9876('0xb')](function(_0x18b397){if(_0x18b397){_0x59cb7c[_0x9876('0x30')][_0x9876('0x37')]=_0x18b397['id'];_0x59cb7c[_0x9876('0x30')][_0x9876('0x38')]=integrations['getSubjects'](_0x59cb7c[_0x9876('0x30')][_0x9876('0x39')],_0x59cb7c[_0x9876('0x30')][_0x9876('0x17')]);_0x59cb7c[_0x9876('0x30')][_0x9876('0x3a')]=integrations[_0x9876('0x3b')](_0x59cb7c['body'][_0x9876('0x39')],_0x59cb7c[_0x9876('0x30')][_0x9876('0x17')]);return db[_0x9876('0x3c')]['create'](_0x59cb7c[_0x9876('0x30')],{'include':[{'model':db[_0x9876('0x3d')],'as':_0x9876('0x38')},{'model':db['Dynamics365Field'],'as':_0x9876('0x3a')}]});}return null;})[_0x9876('0xb')](respondWithResult(_0x229d75,null))[_0x9876('0x2d')](handleError(_0x229d75,null));};function sanitizeRemoteUri(_0xd49eee){var _0x45158a=_0xd49eee[_0x9876('0x3e')](-0x1);if(_0x45158a==='/')return _0xd49eee['substring'](0x0,_0xd49eee[_0x9876('0x3f')](_0x45158a));return _0xd49eee;}function getWebApiUrl(_0x22808f){return util[_0x9876('0x40')](_0x9876('0x41'),_0x22808f);}exports[_0x9876('0x42')]=function(_0x45fa0b,_0x271315){var _0x421cd5=_0x45fa0b[_0x9876('0x1b')]['ticketType'];var _0x5c302c=_0x421cd5===_0x9876('0x43')?_0x9876('0x44'):'PhoneCall';var _0x3a892f='';var _0x2558a3='';var _0x1fb6b7='';var _0x5b4d14='';var _0x3531f8='';var _0x3257ba='';var _0x4462f7='';var _0x283af7='';var _0x5e901e=[_0x9876('0x45'),_0x9876('0x46'),'customerid',_0x9876('0x47'),'caseorigincode',_0x9876('0x48'),_0x9876('0x49'),_0x9876('0x4a'),_0x9876('0x4b'),_0x9876('0x4c')];var _0x5f5dba=[_0x9876('0x4d'),_0x9876('0x4e'),'actualserviceunits',_0x9876('0x4f'),'contactidname',_0x9876('0x50'),_0x9876('0x51'),_0x9876('0x52'),_0x9876('0x53'),_0x9876('0x54'),_0x9876('0x55'),'createdbyyominame',_0x9876('0x56'),_0x9876('0x57'),_0x9876('0x58'),_0x9876('0x59'),_0x9876('0x5a'),_0x9876('0x5b'),_0x9876('0x5c'),_0x9876('0x5d'),_0x9876('0x5e'),'entityimage_url',_0x9876('0x5f'),_0x9876('0x60'),_0x9876('0x61'),_0x9876('0x62'),_0x9876('0x63'),_0x9876('0x64'),_0x9876('0x65'),_0x9876('0x66'),_0x9876('0x67'),'modifiedbyexternalpartyname',_0x9876('0x68'),_0x9876('0x69'),_0x9876('0x6a'),'modifiedon',_0x9876('0x6b'),_0x9876('0x6c'),_0x9876('0x6d'),_0x9876('0x6e'),_0x9876('0x6f'),'onholdtime','overriddencreatedon',_0x9876('0x70'),_0x9876('0x71'),'owneridyominame',_0x9876('0x72'),'primarycontactidname','primarycontactidyominame','prioritycodename',_0x9876('0x73'),_0x9876('0x74'),_0x9876('0x75'),_0x9876('0x76'),_0x9876('0x77'),_0x9876('0x78'),_0x9876('0x79'),'sentimentvalue',_0x9876('0x7a'),_0x9876('0x7b'),_0x9876('0x7c'),_0x9876('0x7d'),_0x9876('0x7e'),_0x9876('0x7f'),'ticketnumber',_0x9876('0x80'),_0x9876('0x81'),_0x9876('0x82'),_0x9876('0x83'),'versionnumber'];var _0x4d90a2=_0x5e901e[_0x9876('0x84')](_0x5f5dba);return db[_0x9876('0x14')][_0x9876('0x34')]({'where':{'id':_0x45fa0b[_0x9876('0x32')]['id']},'attributes':['id',_0x9876('0x85'),_0x9876('0x86'),'remoteUri',_0x9876('0x87'),_0x9876('0x88'),_0x9876('0x89'),_0x9876('0x8a')],'include':[{'model':db[_0x9876('0x8b')],'as':_0x9876('0x8b'),'attributes':['id','data5',_0x9876('0x8c')]}]})[_0x9876('0xb')](handleEntityNotFound(_0x271315,null))[_0x9876('0xb')](function(_0x46c39e){if(_0x46c39e){if(_0x46c39e[_0x9876('0x8a')]){_0x46c39e[_0x9876('0x8d')]=_0x46c39e[_0x9876('0x8b')][_0x9876('0x8e')];_0x283af7=sanitizeRemoteUri(_0x46c39e[_0x9876('0x8b')][_0x9876('0x8c')]);_0x4462f7=getWebApiUrl(_0x283af7);return _0x46c39e;}_0x283af7=sanitizeRemoteUri(_0x46c39e[_0x9876('0x8f')]);_0x4462f7=getWebApiUrl(_0x283af7);var _0x532729={'method':_0x9876('0x90'),'uri':'https://login.microsoftonline.com/'+_0x46c39e[_0x9876('0x87')]+_0x9876('0x91'),'form':{'client_id':_0x46c39e['clientId'],'resource':_0x283af7,'username':_0x46c39e['username'],'password':_0x46c39e[_0x9876('0x86')],'grant_type':_0x9876('0x86'),'client_secret':_0x46c39e['clientSecret']},'json':!![]};return rp(_0x532729);}})[_0x9876('0xb')](function(_0x3dceda){_0x3257ba=_0x3dceda[_0x9876('0x8d')];var _0x56b7e7={'method':_0x9876('0x92'),'uri':encodeURI(_0x4462f7+_0x9876('0x93')+_0x5c302c+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3257ba,'If-None-Match':null,'OData-Version':_0x9876('0x94')},'json':!![]};return rp(_0x56b7e7);})[_0x9876('0xb')](function(_0x956708){var _0x229787=_0x956708[_0x9876('0x95')][0x0];var _0x5b91e7=_0x229787[_0x9876('0x96')];var _0x52ff0a={'method':_0x9876('0x92'),'uri':_0x4462f7+'EntityDefinitions('+_0x5b91e7+_0x9876('0x97'),'headers':{'Authorization':_0x9876('0x98')+_0x3257ba,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x52ff0a);})[_0x9876('0xb')](function(_0x437dc1){_0x3a892f=_0x437dc1;_0x2558a3=_0x3a892f[_0x9876('0x99')];_0x2558a3=_[_0x9876('0x9a')](_0x2558a3,function(_0x57f7e4){return!_0x4d90a2['includes'](_0x57f7e4[_0x9876('0x9b')]);});var _0x382bff=[];var _0x211fcb=[];_0x2558a3[_0x9876('0x9c')](function(_0x32486b){if(_0x32486b[_0x9876('0x9d')]){var _0x37c9b3=_0x32486b['@odata.type'][_0x9876('0x9e')](_0x32486b[_0x9876('0x9d')][_0x9876('0x3f')]('.')+0x1);if(_0x37c9b3===_0x9876('0x9f')){_0x382bff['push'](getSelectList(_0x4462f7,_0x421cd5,_0x211fcb,_0x3a892f[_0x9876('0x96')],_0x32486b['MetadataId'],_0x3257ba));}}});return Promise['all'](_0x382bff);})[_0x9876('0xb')](function(_0x2ceaa8){_0x1fb6b7=_0x2ceaa8[0x0];var _0x6f876=[];var _0x51e9bd=[];_0x2558a3[_0x9876('0x9c')](function(_0x2e08af){if(!_['isNil'](_0x2e08af['@odata.type'])){var _0x16081a=_0x2e08af[_0x9876('0x9d')][_0x9876('0x9e')](_0x2e08af['@odata.type']['lastIndexOf']('.')+0x1);if(_0x16081a===_0x9876('0xa0')){_0x6f876[_0x9876('0xa1')](getBooleanList(_0x4462f7,_0x421cd5,_0x51e9bd,_0x3a892f[_0x9876('0x96')],_0x2e08af['MetadataId'],_0x3257ba));}}});return Promise[_0x9876('0xa2')](_0x6f876);})[_0x9876('0xb')](function(_0x58e630){_0x5b4d14=_0x58e630[0x0];var _0x59b3c6=[];var _0x1fa836=[];_0x2558a3[_0x9876('0x9c')](function(_0x191c2d){if(_0x191c2d['@odata.type']){var _0x1d4a51=_0x191c2d[_0x9876('0x9d')][_0x9876('0x9e')](_0x191c2d[_0x9876('0x9d')][_0x9876('0x3f')]('.')+0x1);if(_0x1d4a51===_0x9876('0xa3')||_0x1d4a51===_0x9876('0xa4')||_0x1d4a51===_0x9876('0xa5')||_0x1d4a51==='IntegerAttributeMetadata'||_0x1d4a51===_0x9876('0xa6')||_0x1d4a51===_0x9876('0xa7')||_0x1d4a51===_0x9876('0xa8')||_0x1d4a51===_0x9876('0xa9')||_0x1d4a51===_0x9876('0xaa')||_0x1d4a51==='DecimalAttributeMetadata'){_0x59b3c6[_0x9876('0xa1')](getInputList(_0x4462f7,_0x421cd5,_0x1d4a51,_0x1fa836,_0x3a892f[_0x9876('0x96')],_0x191c2d[_0x9876('0x96')],_0x3257ba));}}});return Promise[_0x9876('0xa2')](_0x59b3c6);})[_0x9876('0xb')](function(_0x58dce9){_0x3531f8=_0x58dce9[0x0];var _0x49ab4a=_0x1fb6b7[_0x9876('0x84')](_0x5b4d14)[_0x9876('0x84')](_0x3531f8);var _0x39858a={'count':_0x49ab4a['length'],'rows':_0x49ab4a};return _0x39858a;})[_0x9876('0xb')](respondWithResult(_0x271315,null))['catch'](function(_0x32a10b){var _0x32a98c=_0x45fa0b[_0x9876('0x1b')][_0x9876('0xab')]?0x1f4:_0x32a10b['statusCode']||0x1f4;logger[_0x9876('0xf')](_0x32a10b[_0x9876('0x10')]);delete _0x32a10b[_0x9876('0x11')];if(_0x32a98c===0x191){_0x32a98c=0x190;}_0x271315[_0x9876('0x12')](_0x32a98c)[_0x9876('0x13')](_0x45fa0b['query'][_0x9876('0xab')]?{'message':_0x9876('0xac'),'statusCode':_0x32a10b[_0x9876('0xad')]}:_0x32a10b);});};function getSelectList(_0x3e5f31,_0x2355e0,_0x288f0c,_0x556c67,_0x32b8d2,_0x5624e9){var _0x3da74b={'method':_0x9876('0x92'),'uri':_0x3e5f31+'EntityDefinitions('+_0x556c67+')/Attributes('+_0x32b8d2+_0x9876('0xae')+_0x9876('0xaf'),'headers':{'Authorization':_0x9876('0x98')+_0x5624e9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3da74b)[_0x9876('0xb')](function(_0x25f069){var _0x442ed8=[];var _0x2d9cb1=_0x25f069[_0x9876('0xb0')][_0x9876('0xb1')];_0x2d9cb1[_0x9876('0x9c')](function(_0x5cf767){_0x442ed8[_0x9876('0xa1')]({'name':_0x5cf767[_0x9876('0xb2')]['UserLocalizedLabel'][_0x9876('0xb2')],'value':String(_0x5cf767[_0x9876('0xb3')])});});var _0x581913={'id':_0x2355e0+'_'+_0x25f069[_0x9876('0x9b')],'name':_0x25f069[_0x9876('0xb4')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x442ed8};_0x288f0c[_0x9876('0xa1')](_0x581913);return _0x288f0c;});}function getBooleanList(_0x4d61ad,_0x216d71,_0x411cf5,_0x38b82d,_0x6c4323,_0x40e0f5){var _0x969619={'method':'GET','uri':_0x4d61ad+'EntityDefinitions('+_0x38b82d+')/Attributes('+_0x6c4323+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x9876('0x98')+_0x40e0f5,'If-None-Match':null,'OData-Version':_0x9876('0x94')},'json':!![]};return rp(_0x969619)[_0x9876('0xb')](function(_0x28e3a0){var _0x3ce785=[];_0x3ce785[_0x9876('0xa1')]({'name':_0x28e3a0[_0x9876('0xb0')][_0x9876('0xb5')][_0x9876('0xb2')][_0x9876('0xb6')][_0x9876('0xb2')],'value':_0x9876('0xb7')},{'name':_0x28e3a0[_0x9876('0xb0')][_0x9876('0xb8')][_0x9876('0xb2')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x4d586c={'id':_0x216d71+'_'+_0x28e3a0[_0x9876('0x9b')],'name':_0x28e3a0['DisplayName'][_0x9876('0xb6')][_0x9876('0xb2')],'custom':![],'options':_0x3ce785};_0x411cf5['push'](_0x4d586c);return _0x411cf5;});}function getInputList(_0x4739e0,_0x5f49c6,_0x352a5d,_0x414e3f,_0xa9789d,_0x10783b,_0x591ef3){var _0x54b6d9={'method':_0x9876('0x92'),'uri':_0x4739e0+_0x9876('0xb9')+_0xa9789d+_0x9876('0xba')+_0x10783b+_0x9876('0xbb')+_0x352a5d+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x591ef3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x54b6d9)[_0x9876('0xb')](function(_0x206e44){var _0x19cfa7={'id':_0x5f49c6+'_'+_0x206e44[_0x9876('0x9b')],'name':_0x206e44[_0x9876('0xb4')][_0x9876('0xb6')]?_0x206e44[_0x9876('0xb4')][_0x9876('0xb6')]['Label']:_0x206e44[_0x9876('0x9b')],'custom':![],'options':[]};_0x414e3f['push'](_0x19cfa7);return _0x414e3f;});} \ No newline at end of file +var _0x59d5=['contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','error','stack','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','Dynamics365Account','then','includeAll','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','PhoneCall','title','description','customerid','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits'];(function(_0x450605,_0x29ba61){var _0xf9d26d=function(_0x49d90b){while(--_0x49d90b){_0x450605['push'](_0x450605['shift']());}};_0xf9d26d(++_0x29ba61);}(_0x59d5,0x67));var _0x559d=function(_0x42b9bb,_0x3f7741){_0x42b9bb=_0x42b9bb-0x0;var _0x3058fb=_0x59d5[_0x42b9bb];return _0x3058fb;};'use strict';var rp=require(_0x559d('0x0'));var util=require(_0x559d('0x1'));var _=require('lodash');var qs=require(_0x559d('0x2'));var logger=require(_0x559d('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x559d('0x4'));function respondWithResult(_0x1864ba,_0x2c75b5){_0x2c75b5=_0x2c75b5||0xc8;return function(_0x4159c2){if(_0x4159c2){return _0x1864ba[_0x559d('0x5')](_0x2c75b5)[_0x559d('0x6')](_0x4159c2);}};}function respondWithFilteredResult(_0x425dc9,_0x26583f){return function(_0x1f7bb7){if(_0x1f7bb7){var _0x2bb172=typeof _0x26583f[_0x559d('0x7')]==='undefined'&&typeof _0x26583f[_0x559d('0x8')]===_0x559d('0x9');var _0x1b4401=_0x1f7bb7[_0x559d('0xa')];var _0x4d528a=_0x2bb172?0x0:_0x26583f['offset'];var _0x3110fa=_0x2bb172?_0x1f7bb7[_0x559d('0xa')]:_0x26583f[_0x559d('0x7')]+_0x26583f[_0x559d('0x8')];var _0x3e1b6e;if(_0x3110fa>=_0x1b4401){_0x3110fa=_0x1b4401;_0x3e1b6e=0xc8;}else{_0x3e1b6e=0xce;}_0x425dc9['status'](_0x3e1b6e);return _0x425dc9[_0x559d('0xb')](_0x559d('0xc'),_0x4d528a+'-'+_0x3110fa+'/'+_0x1b4401)['json'](_0x1f7bb7);}return null;};}function saveUpdates(_0x2a166e){return function(_0x593281){if(_0x593281){return _0x593281[_0x559d('0xd')](_0x2a166e)['then'](function(_0x122d89){return _0x122d89;});}return null;};}function removeEntity(_0xd6b4dc){return function(_0x24d74b){if(_0x24d74b){return _0x24d74b[_0x559d('0xe')]()['then'](function(){_0xd6b4dc[_0x559d('0x5')](0xcc)[_0x559d('0xf')]();});}};}function handleEntityNotFound(_0x21ad10){return function(_0x383c4d){if(!_0x383c4d){_0x21ad10[_0x559d('0x10')](0x194);}return _0x383c4d;};}function handleError(_0xfb7cbd,_0x203db1){_0x203db1=_0x203db1||0x1f4;return function(_0x3c5073){logger['error'](_0x3c5073['stack']);if(_0x3c5073[_0x559d('0x11')]){delete _0x3c5073['name'];}_0xfb7cbd[_0x559d('0x5')](_0x203db1)[_0x559d('0x12')](_0x3c5073);};}exports[_0x559d('0x13')]=function(_0x28d6ae,_0x4262b8){var _0x124b0a={},_0x3225b3={},_0x585252={'count':0x0,'rows':[]};var _0x29d855=_[_0x559d('0x14')](db['Dynamics365Account']['rawAttributes'],function(_0x1d9e31){return{'name':_0x1d9e31['fieldName'],'type':_0x1d9e31['type'][_0x559d('0x15')]};});_0x3225b3[_0x559d('0x16')]=_[_0x559d('0x14')](_0x29d855,_0x559d('0x11'));_0x3225b3[_0x559d('0x17')]=_['keys'](_0x28d6ae[_0x559d('0x17')]);_0x3225b3['filters']=_[_0x559d('0x18')](_0x3225b3['model'],_0x3225b3['query']);_0x124b0a[_0x559d('0x19')]=_['intersection'](_0x3225b3['model'],qs[_0x559d('0x1a')](_0x28d6ae['query'][_0x559d('0x1a')]));_0x124b0a[_0x559d('0x19')]=_0x124b0a['attributes'][_0x559d('0x1b')]?_0x124b0a[_0x559d('0x19')]:_0x3225b3[_0x559d('0x16')];if(!_0x28d6ae['query']['hasOwnProperty'](_0x559d('0x1c'))){_0x124b0a[_0x559d('0x8')]=qs[_0x559d('0x8')](_0x28d6ae['query'][_0x559d('0x8')]);_0x124b0a[_0x559d('0x7')]=qs[_0x559d('0x7')](_0x28d6ae[_0x559d('0x17')][_0x559d('0x7')]);}_0x124b0a['order']=qs['sort'](_0x28d6ae['query'][_0x559d('0x1d')]);_0x124b0a[_0x559d('0x1e')]=qs['filters'](_[_0x559d('0x1f')](_0x28d6ae[_0x559d('0x17')],_0x3225b3[_0x559d('0x20')]),_0x29d855);if(_0x28d6ae[_0x559d('0x17')][_0x559d('0x21')]){_0x124b0a['where']=_[_0x559d('0x22')](_0x124b0a['where'],{'$or':_[_0x559d('0x14')](_0x29d855,function(_0x406b1c){if(_0x406b1c[_0x559d('0x23')]!==_0x559d('0x24')){var _0x3d1e0a={};_0x3d1e0a[_0x406b1c[_0x559d('0x11')]]={'$like':'%'+_0x28d6ae[_0x559d('0x17')]['filter']+'%'};return _0x3d1e0a;}})});}_0x124b0a=_[_0x559d('0x22')]({},_0x124b0a,_0x28d6ae[_0x559d('0x25')]);var _0x9db3ba={'where':_0x124b0a[_0x559d('0x1e')]};return db[_0x559d('0x26')][_0x559d('0xa')](_0x9db3ba)[_0x559d('0x27')](function(_0x39a5db){_0x585252['count']=_0x39a5db;if(_0x28d6ae[_0x559d('0x17')][_0x559d('0x28')]){_0x124b0a['include']=[{'all':!![]}];}return db[_0x559d('0x26')][_0x559d('0x29')](_0x124b0a);})[_0x559d('0x27')](function(_0x4be5d2){_0x585252[_0x559d('0x2a')]=_0x4be5d2;return _0x585252;})[_0x559d('0x27')](respondWithFilteredResult(_0x4262b8,_0x124b0a))[_0x559d('0x2b')](handleError(_0x4262b8,null));};exports[_0x559d('0x2c')]=function(_0x5ad548,_0x466df8){var _0xe9d0d6={'raw':![],'where':{'id':_0x5ad548['params']['id']}},_0x72e191={};_0x72e191['model']=_[_0x559d('0x2d')](db['Dynamics365Account'][_0x559d('0x2e')]);_0x72e191['query']=_[_0x559d('0x2d')](_0x5ad548[_0x559d('0x17')]);_0x72e191[_0x559d('0x20')]=_[_0x559d('0x18')](_0x72e191[_0x559d('0x16')],_0x72e191['query']);_0xe9d0d6[_0x559d('0x19')]=_['intersection'](_0x72e191[_0x559d('0x16')],qs[_0x559d('0x1a')](_0x5ad548[_0x559d('0x17')][_0x559d('0x1a')]));_0xe9d0d6[_0x559d('0x19')]=_0xe9d0d6['attributes'][_0x559d('0x1b')]?_0xe9d0d6[_0x559d('0x19')]:_0x72e191[_0x559d('0x16')];if(_0x5ad548[_0x559d('0x17')][_0x559d('0x28')]){_0xe9d0d6['include']=[{'all':!![]}];}_0xe9d0d6=_['merge']({},_0xe9d0d6,_0x5ad548[_0x559d('0x25')]);return db[_0x559d('0x26')][_0x559d('0x2f')](_0xe9d0d6)['then'](handleEntityNotFound(_0x466df8,null))[_0x559d('0x27')](respondWithResult(_0x466df8,null))['catch'](handleError(_0x466df8,null));};exports[_0x559d('0x30')]=function(_0x58a78f,_0x3d2c3f){return db['Dynamics365Account'][_0x559d('0x30')](_0x58a78f[_0x559d('0x31')],{})['then'](respondWithResult(_0x3d2c3f,0xc9))[_0x559d('0x2b')](handleError(_0x3d2c3f,null));};exports['update']=function(_0x19b02d,_0x40ff18){if(_0x19b02d['body']['id']){delete _0x19b02d[_0x559d('0x31')]['id'];}return db[_0x559d('0x26')][_0x559d('0x2f')]({'where':{'id':_0x19b02d['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x40ff18,null))['then'](saveUpdates(_0x19b02d[_0x559d('0x31')],null))[_0x559d('0x27')](respondWithResult(_0x40ff18,null))[_0x559d('0x2b')](handleError(_0x40ff18,null));};exports[_0x559d('0xe')]=function(_0x197518,_0x1ebaa4){return db[_0x559d('0x26')][_0x559d('0x2f')]({'where':{'id':_0x197518[_0x559d('0x32')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x1ebaa4,null))['then'](removeEntity(_0x1ebaa4,null))[_0x559d('0x2b')](handleError(_0x1ebaa4,null));};exports[_0x559d('0x33')]=function(_0x58a7aa,_0x5c9449){var _0x2f1a40={};var _0x2b5ad9={};var _0x586dcd;var _0x4db7d1;return db['Dynamics365Account'][_0x559d('0x34')]({'where':{'id':_0x58a7aa[_0x559d('0x32')]['id']}})['then'](handleEntityNotFound(_0x5c9449,null))[_0x559d('0x27')](function(_0x31a6ef){if(_0x31a6ef){_0x586dcd=_0x31a6ef;_0x2b5ad9[_0x559d('0x16')]=_[_0x559d('0x2d')](db[_0x559d('0x35')][_0x559d('0x2e')]);_0x2b5ad9[_0x559d('0x17')]=_[_0x559d('0x2d')](_0x58a7aa['query']);_0x2b5ad9[_0x559d('0x20')]=_[_0x559d('0x18')](_0x2b5ad9[_0x559d('0x16')],_0x2b5ad9[_0x559d('0x17')]);_0x2f1a40[_0x559d('0x19')]=_[_0x559d('0x18')](_0x2b5ad9['model'],qs[_0x559d('0x1a')](_0x58a7aa[_0x559d('0x17')][_0x559d('0x1a')]));_0x2f1a40[_0x559d('0x19')]=_0x2f1a40[_0x559d('0x19')][_0x559d('0x1b')]?_0x2f1a40['attributes']:_0x2b5ad9[_0x559d('0x16')];_0x2f1a40[_0x559d('0x36')]=qs[_0x559d('0x1d')](_0x58a7aa['query'][_0x559d('0x1d')]);_0x2f1a40['where']=qs[_0x559d('0x20')](_[_0x559d('0x1f')](_0x58a7aa['query'],_0x2b5ad9['filters']));if(_0x58a7aa[_0x559d('0x17')][_0x559d('0x21')]){_0x2f1a40[_0x559d('0x1e')]=_['merge'](_0x2f1a40['where'],{'$or':_[_0x559d('0x14')](_0x2f1a40[_0x559d('0x19')],function(_0x55290e){var _0x31dcf3={};_0x31dcf3[_0x55290e]={'$like':'%'+_0x58a7aa[_0x559d('0x17')][_0x559d('0x21')]+'%'};return _0x31dcf3;})});}_0x2f1a40=_[_0x559d('0x22')]({},_0x2f1a40,_0x58a7aa[_0x559d('0x25')]);return _0x586dcd['getConfigurations'](_0x2f1a40);}})[_0x559d('0x27')](function(_0x49f58a){if(_0x49f58a){_0x4db7d1=_0x49f58a['length'];if(!_0x58a7aa['query'][_0x559d('0x37')](_0x559d('0x1c'))){_0x2f1a40[_0x559d('0x8')]=qs[_0x559d('0x8')](_0x58a7aa[_0x559d('0x17')]['limit']);_0x2f1a40['offset']=qs[_0x559d('0x7')](_0x58a7aa[_0x559d('0x17')]['offset']);}return _0x586dcd[_0x559d('0x33')](_0x2f1a40);}})[_0x559d('0x27')](function(_0x5799e2){if(_0x5799e2){return _0x5799e2?{'count':_0x4db7d1,'rows':_0x5799e2}:null;}})[_0x559d('0x27')](respondWithResult(_0x5c9449,null))[_0x559d('0x2b')](handleError(_0x5c9449,null));};exports[_0x559d('0x38')]=function(_0x3e76d6,_0x80512f){if(_0x3e76d6['body']['id']){delete _0x3e76d6[_0x559d('0x31')]['id'];}return db[_0x559d('0x26')][_0x559d('0x34')]({'where':{'id':_0x3e76d6['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x80512f,null))[_0x559d('0x27')](function(_0x4a449d){if(_0x4a449d){_0x3e76d6[_0x559d('0x31')][_0x559d('0x39')]=_0x4a449d['id'];_0x3e76d6['body'][_0x559d('0x3a')]=integrations[_0x559d('0x3b')](_0x3e76d6['body']['channel'],_0x3e76d6[_0x559d('0x31')]['type']);_0x3e76d6[_0x559d('0x31')][_0x559d('0x3c')]=integrations[_0x559d('0x3d')](_0x3e76d6['body']['channel'],_0x3e76d6[_0x559d('0x31')]['type']);return db[_0x559d('0x35')][_0x559d('0x30')](_0x3e76d6[_0x559d('0x31')],{'include':[{'model':db[_0x559d('0x3e')],'as':_0x559d('0x3a')},{'model':db[_0x559d('0x3e')],'as':_0x559d('0x3c')}]});}return null;})[_0x559d('0x27')](respondWithResult(_0x80512f,null))['catch'](handleError(_0x80512f,null));};function sanitizeRemoteUri(_0x363c3){var _0x39fe6a=_0x363c3[_0x559d('0x3f')](-0x1);if(_0x39fe6a==='/')return _0x363c3[_0x559d('0x40')](0x0,_0x363c3[_0x559d('0x41')](_0x39fe6a));return _0x363c3;}function getWebApiUrl(_0x157851){return util[_0x559d('0x42')](_0x559d('0x43'),_0x157851);}exports[_0x559d('0x44')]=function(_0x199dfc,_0x1e327f){var _0x24c6b9=_0x199dfc[_0x559d('0x17')]['ticketType'];var _0x206613=_0x24c6b9===_0x559d('0x45')?'Incident':_0x559d('0x46');var _0x75a0ad='';var _0x1c9348='';var _0x45a90f='';var _0x3dc18b='';var _0x1170e2='';var _0x3feffc='';var _0x10a78='';var _0xdfd64e='';var _0x17434b=[_0x559d('0x47'),_0x559d('0x48'),_0x559d('0x49'),'ownerid','caseorigincode',_0x559d('0x4a'),_0x559d('0x4b'),_0x559d('0x4c'),'directioncode',_0x559d('0x4d')];var _0x450ad8=[_0x559d('0x4e'),_0x559d('0x4f'),_0x559d('0x50'),'billedserviceunits',_0x559d('0x51'),_0x559d('0x52'),_0x559d('0x53'),_0x559d('0x54'),'createdbyexternalpartyname',_0x559d('0x55'),'createdbyname',_0x559d('0x56'),_0x559d('0x57'),_0x559d('0x58'),_0x559d('0x59'),_0x559d('0x5a'),_0x559d('0x5b'),_0x559d('0x5c'),'emailaddress',_0x559d('0x5d'),_0x559d('0x5e'),_0x559d('0x5f'),_0x559d('0x60'),'exchangerate','firstresponsebykpiidname',_0x559d('0x61'),_0x559d('0x62'),_0x559d('0x63'),_0x559d('0x64'),_0x559d('0x65'),'masteridname',_0x559d('0x66'),_0x559d('0x67'),_0x559d('0x68'),'modifiedbyyominame','modifiedon',_0x559d('0x69'),'modifiedonbehalfbyyominame',_0x559d('0x6a'),'msdyn_iotalertname',_0x559d('0x6b'),_0x559d('0x6c'),'overriddencreatedon','owneridname','owneridtype',_0x559d('0x6d'),_0x559d('0x6e'),_0x559d('0x6f'),'primarycontactidyominame',_0x559d('0x70'),_0x559d('0x71'),'productserialnumber',_0x559d('0x72'),_0x559d('0x73'),_0x559d('0x74'),_0x559d('0x75'),'responsiblecontactidyominame','sentimentvalue',_0x559d('0x76'),'slaname',_0x559d('0x77'),_0x559d('0x78'),_0x559d('0x79'),_0x559d('0x7a'),_0x559d('0x7b'),_0x559d('0x7c'),_0x559d('0x7d'),_0x559d('0x7e'),_0x559d('0x7f'),'versionnumber'];var _0x54106b=_0x17434b['concat'](_0x450ad8);return db[_0x559d('0x26')][_0x559d('0x34')]({'where':{'id':_0x199dfc[_0x559d('0x32')]['id']},'attributes':['id',_0x559d('0x80'),_0x559d('0x81'),_0x559d('0x82'),_0x559d('0x83'),_0x559d('0x84'),_0x559d('0x85'),_0x559d('0x86')],'include':[{'model':db['CloudProvider'],'as':_0x559d('0x87'),'attributes':['id','data5','data7']}]})[_0x559d('0x27')](handleEntityNotFound(_0x1e327f,null))[_0x559d('0x27')](function(_0x3145b1){if(_0x3145b1){if(_0x3145b1[_0x559d('0x86')]){_0x3145b1['access_token']=_0x3145b1[_0x559d('0x87')]['data5'];_0xdfd64e=sanitizeRemoteUri(_0x3145b1[_0x559d('0x87')][_0x559d('0x88')]);_0x10a78=getWebApiUrl(_0xdfd64e);return _0x3145b1;}_0xdfd64e=sanitizeRemoteUri(_0x3145b1[_0x559d('0x82')]);_0x10a78=getWebApiUrl(_0xdfd64e);var _0x2275bd={'method':_0x559d('0x89'),'uri':_0x559d('0x8a')+_0x3145b1['tenantId']+_0x559d('0x8b'),'form':{'client_id':_0x3145b1['clientId'],'resource':_0xdfd64e,'username':_0x3145b1['username'],'password':_0x3145b1[_0x559d('0x81')],'grant_type':_0x559d('0x81'),'client_secret':_0x3145b1[_0x559d('0x85')]},'json':!![]};return rp(_0x2275bd);}})[_0x559d('0x27')](function(_0x137657){_0x3feffc=_0x137657['access_token'];var _0x6f8b1c={'method':_0x559d('0x8c'),'uri':encodeURI(_0x10a78+_0x559d('0x8d')+_0x206613+'\x27'),'headers':{'Authorization':_0x559d('0x8e')+_0x3feffc,'If-None-Match':null,'OData-Version':_0x559d('0x8f')},'json':!![]};return rp(_0x6f8b1c);})[_0x559d('0x27')](function(_0x2a2dfc){var _0x1f21ea=_0x2a2dfc[_0x559d('0x90')][0x0];var _0x5e9a66=_0x1f21ea[_0x559d('0x91')];var _0x223261={'method':'GET','uri':_0x10a78+'EntityDefinitions('+_0x5e9a66+_0x559d('0x92'),'headers':{'Authorization':'Bearer\x20'+_0x3feffc,'If-None-Match':null,'OData-Version':_0x559d('0x8f')},'json':!![]};return rp(_0x223261);})[_0x559d('0x27')](function(_0x2107dc){_0x75a0ad=_0x2107dc;_0x1c9348=_0x75a0ad['Attributes'];_0x1c9348=_['remove'](_0x1c9348,function(_0x37b200){return!_0x54106b[_0x559d('0x93')](_0x37b200[_0x559d('0x94')]);});var _0x4022d6=[];var _0x3f4270=[];_0x1c9348[_0x559d('0x95')](function(_0x105461){if(_0x105461['@odata.type']){var _0x169ad4=_0x105461[_0x559d('0x96')][_0x559d('0x40')](_0x105461[_0x559d('0x96')][_0x559d('0x41')]('.')+0x1);if(_0x169ad4===_0x559d('0x97')){_0x4022d6[_0x559d('0x98')](getSelectList(_0x10a78,_0x24c6b9,_0x3f4270,_0x75a0ad['MetadataId'],_0x105461[_0x559d('0x91')],_0x3feffc));}}});return Promise[_0x559d('0x99')](_0x4022d6);})[_0x559d('0x27')](function(_0x5c1353){_0x45a90f=_0x5c1353[0x0];var _0x47e280=[];var _0x4ea974=[];_0x1c9348[_0x559d('0x95')](function(_0x3b4beb){if(!_[_0x559d('0x9a')](_0x3b4beb[_0x559d('0x96')])){var _0x3580f4=_0x3b4beb['@odata.type']['substring'](_0x3b4beb[_0x559d('0x96')][_0x559d('0x41')]('.')+0x1);if(_0x3580f4===_0x559d('0x9b')){_0x47e280[_0x559d('0x98')](getBooleanList(_0x10a78,_0x24c6b9,_0x4ea974,_0x75a0ad['MetadataId'],_0x3b4beb['MetadataId'],_0x3feffc));}}});return Promise[_0x559d('0x99')](_0x47e280);})[_0x559d('0x27')](function(_0x281a3c){_0x3dc18b=_0x281a3c[0x0];var _0x32796d=[];var _0x25f4b6=[];_0x1c9348[_0x559d('0x95')](function(_0x5a6eab){if(_0x5a6eab[_0x559d('0x96')]){var _0x407437=_0x5a6eab['@odata.type'][_0x559d('0x40')](_0x5a6eab[_0x559d('0x96')][_0x559d('0x41')]('.')+0x1);if(_0x407437===_0x559d('0x9c')||_0x407437===_0x559d('0x9d')||_0x407437===_0x559d('0x9e')||_0x407437===_0x559d('0x9f')||_0x407437===_0x559d('0xa0')||_0x407437==='DateTimeAttributeMetadata'||_0x407437===_0x559d('0xa1')||_0x407437===_0x559d('0xa2')||_0x407437==='StateAttributeMetadata'||_0x407437===_0x559d('0xa3')){_0x32796d['push'](getInputList(_0x10a78,_0x24c6b9,_0x407437,_0x25f4b6,_0x75a0ad[_0x559d('0x91')],_0x5a6eab['MetadataId'],_0x3feffc));}}});return Promise[_0x559d('0x99')](_0x32796d);})[_0x559d('0x27')](function(_0x29bfbb){_0x1170e2=_0x29bfbb[0x0];var _0x3a1788=_0x45a90f['concat'](_0x3dc18b)[_0x559d('0xa4')](_0x1170e2);var _0x2b42c5={'count':_0x3a1788[_0x559d('0x1b')],'rows':_0x3a1788};return _0x2b42c5;})[_0x559d('0x27')](respondWithResult(_0x1e327f,null))['catch'](function(_0x2e7dca){var _0x45c343=_0x199dfc[_0x559d('0x17')]['test']?0x1f4:_0x2e7dca[_0x559d('0xa5')]||0x1f4;logger[_0x559d('0xa6')](_0x2e7dca[_0x559d('0xa7')]);delete _0x2e7dca[_0x559d('0x11')];if(_0x45c343===0x191){_0x45c343=0x190;}_0x1e327f[_0x559d('0x5')](_0x45c343)[_0x559d('0x12')](_0x199dfc['query'][_0x559d('0xa8')]?{'message':_0x559d('0xa9'),'statusCode':_0x2e7dca[_0x559d('0xa5')]}:_0x2e7dca);});};function getSelectList(_0x1d59f7,_0x595386,_0x542ffe,_0x274d2b,_0x45d289,_0x3619cd){var _0x43d70f={'method':_0x559d('0x8c'),'uri':_0x1d59f7+'EntityDefinitions('+_0x274d2b+_0x559d('0xaa')+_0x45d289+_0x559d('0xab')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x559d('0x8e')+_0x3619cd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x43d70f)['then'](function(_0x3d0c4e){var _0x5cd822=[];var _0x53f15d=_0x3d0c4e[_0x559d('0xac')][_0x559d('0xad')];_0x53f15d['forEach'](function(_0x1421df){_0x5cd822['push']({'name':_0x1421df[_0x559d('0xae')][_0x559d('0xaf')][_0x559d('0xae')],'value':String(_0x1421df[_0x559d('0xb0')])});});var _0xe52bdb={'id':_0x595386+'_'+_0x3d0c4e['LogicalName'],'name':_0x3d0c4e[_0x559d('0xb1')][_0x559d('0xaf')][_0x559d('0xae')],'custom':![],'options':_0x5cd822};_0x542ffe[_0x559d('0x98')](_0xe52bdb);return _0x542ffe;});}function getBooleanList(_0x51793e,_0xaa5401,_0x22ec5e,_0x38aa7a,_0x5e70b9,_0x174068){var _0x541b28={'method':_0x559d('0x8c'),'uri':_0x51793e+_0x559d('0xb2')+_0x38aa7a+_0x559d('0xaa')+_0x5e70b9+_0x559d('0xb3'),'headers':{'Authorization':_0x559d('0x8e')+_0x174068,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x541b28)[_0x559d('0x27')](function(_0x12b8cf){var _0x827a1=[];_0x827a1[_0x559d('0x98')]({'name':_0x12b8cf[_0x559d('0xac')]['TrueOption'][_0x559d('0xae')][_0x559d('0xaf')][_0x559d('0xae')],'value':_0x559d('0xb4')},{'name':_0x12b8cf[_0x559d('0xac')]['FalseOption']['Label'][_0x559d('0xaf')][_0x559d('0xae')],'value':_0x559d('0xb5')});var _0x6fedac={'id':_0xaa5401+'_'+_0x12b8cf[_0x559d('0x94')],'name':_0x12b8cf[_0x559d('0xb1')][_0x559d('0xaf')][_0x559d('0xae')],'custom':![],'options':_0x827a1};_0x22ec5e[_0x559d('0x98')](_0x6fedac);return _0x22ec5e;});}function getInputList(_0x46a40d,_0x4d96cd,_0x5de23a,_0x2794bc,_0x1173ac,_0x2c8731,_0x27afb8){var _0x1bead4={'method':'GET','uri':_0x46a40d+_0x559d('0xb2')+_0x1173ac+_0x559d('0xaa')+_0x2c8731+_0x559d('0xb6')+_0x5de23a+_0x559d('0xb7'),'headers':{'Authorization':'Bearer\x20'+_0x27afb8,'If-None-Match':null,'OData-Version':_0x559d('0x8f')},'json':!![]};return rp(_0x1bead4)['then'](function(_0x3ea161){var _0x422f73={'id':_0x4d96cd+'_'+_0x3ea161[_0x559d('0x94')],'name':_0x3ea161['DisplayName']['UserLocalizedLabel']?_0x3ea161[_0x559d('0xb1')][_0x559d('0xaf')][_0x559d('0xae')]:_0x3ea161[_0x559d('0x94')],'custom':![],'options':[]};_0x2794bc[_0x559d('0x98')](_0x422f73);return _0x2794bc;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index d618838..647c349 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x5c51aa,_0x53cc6d){var _0x5074fa=function(_0x801c45){while(--_0x801c45){_0x5c51aa['push'](_0x5c51aa['shift']());}};_0x5074fa(++_0x53cc6d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 3a7a045..b45f505 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 _0x7866=['Dynamics365Account','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x7866,0x6c));var _0x6786=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x7866[_0x32b542];return _0x554d54;};'use strict';var _=require('lodash');var util=require(_0x6786('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6786('0x1'));var fs=require('fs');var Redis=require(_0x6786('0x2'));var db=require(_0x6786('0x3'))['db'];var utils=require(_0x6786('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6786('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6786('0x6')][_0x6786('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28fb97,_0x2b1da7,_0x728c22){return new BPromise(function(_0x511120,_0x3301dd){return client[_0x6786('0x8')](_0x28fb97,_0x728c22)[_0x6786('0x9')](function(_0x59fa0b){logger[_0x6786('0xa')](_0x6786('0xb'),_0x2b1da7,_0x6786('0xc'));logger[_0x6786('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x2b1da7,_0x6786('0xc'),JSON[_0x6786('0xe')](_0x59fa0b));if(_0x59fa0b[_0x6786('0xf')]){if(_0x59fa0b[_0x6786('0xf')][_0x6786('0x10')]===0x1f4){logger[_0x6786('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x2b1da7,_0x59fa0b[_0x6786('0xf')][_0x6786('0x11')]);return _0x3301dd(_0x59fa0b[_0x6786('0xf')]['message']);}logger[_0x6786('0xf')](_0x6786('0xb'),_0x2b1da7,_0x59fa0b[_0x6786('0xf')][_0x6786('0x11')]);return _0x511120(_0x59fa0b[_0x6786('0xf')][_0x6786('0x11')]);}else{logger[_0x6786('0xa')](_0x6786('0xb'),_0x2b1da7,_0x6786('0xc'));_0x511120(_0x59fa0b[_0x6786('0x12')][_0x6786('0x11')]);}})[_0x6786('0x13')](function(_0x317b96){logger[_0x6786('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x2b1da7,_0x317b96);_0x3301dd(_0x317b96);});});}exports['GetDynamics365Account']=function(_0x2c05ce){var _0x17240e=this;return new Promise(function(_0x196690,_0x33585e){return db[_0x6786('0x14')]['findAll']({'raw':_0x2c05ce['options']?_0x2c05ce[_0x6786('0x15')][_0x6786('0x16')]===undefined?!![]:![]:!![],'where':_0x2c05ce['options']?_0x2c05ce[_0x6786('0x15')][_0x6786('0x17')]||null:null,'attributes':_0x2c05ce[_0x6786('0x15')]?_0x2c05ce[_0x6786('0x15')][_0x6786('0x18')]||null:null,'limit':_0x2c05ce[_0x6786('0x15')]?_0x2c05ce['options'][_0x6786('0x19')]||null:null,'include':_0x2c05ce['options']?_0x2c05ce[_0x6786('0x15')][_0x6786('0x1a')]?_[_0x6786('0x1b')](_0x2c05ce[_0x6786('0x15')][_0x6786('0x1a')],function(_0x1adfb0){return{'model':db[_0x1adfb0['model']],'as':_0x1adfb0['as'],'attributes':_0x1adfb0[_0x6786('0x18')],'include':_0x1adfb0[_0x6786('0x1a')]?_[_0x6786('0x1b')](_0x1adfb0[_0x6786('0x1a')],function(_0x3b9db6){return{'model':db[_0x3b9db6[_0x6786('0x1c')]],'as':_0x3b9db6['as'],'attributes':_0x3b9db6[_0x6786('0x18')],'include':_0x3b9db6[_0x6786('0x1a')]?_['map'](_0x3b9db6['include'],function(_0x13574a){return{'model':db[_0x13574a['model']],'as':_0x13574a['as'],'attributes':_0x13574a[_0x6786('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6786('0x9')](function(_0x108844){logger['info'](_0x6786('0x1d'),_0x2c05ce);logger[_0x6786('0xd')](_0x6786('0x1d'),_0x2c05ce,JSON[_0x6786('0xe')](_0x108844));_0x196690(_0x108844);})[_0x6786('0x13')](function(_0x30e569){logger['error'](_0x6786('0x1d'),_0x30e569[_0x6786('0x11')],_0x2c05ce);_0x33585e(_0x17240e[_0x6786('0xf')](0x1f4,_0x30e569['message']));});});};exports[_0x6786('0x1e')]=function(_0x340858){var _0x771dbf=this;return new Promise(function(_0xe99060,_0x391dbf){return db[_0x6786('0x14')][_0x6786('0x1f')]({'raw':_0x340858[_0x6786('0x15')]?_0x340858[_0x6786('0x15')][_0x6786('0x16')]===undefined?!![]:![]:!![],'where':_0x340858[_0x6786('0x15')]?_0x340858[_0x6786('0x15')][_0x6786('0x17')]||null:null,'attributes':_0x340858[_0x6786('0x15')]?_0x340858['options'][_0x6786('0x18')]||null:null,'include':_0x340858['options']?_0x340858[_0x6786('0x15')][_0x6786('0x1a')]?_[_0x6786('0x1b')](_0x340858[_0x6786('0x15')][_0x6786('0x1a')],function(_0x865ace){return{'model':db[_0x865ace['model']],'as':_0x865ace['as'],'attributes':_0x865ace[_0x6786('0x18')],'include':_0x865ace[_0x6786('0x1a')]?_[_0x6786('0x1b')](_0x865ace[_0x6786('0x1a')],function(_0x4341be){return{'model':db[_0x4341be[_0x6786('0x1c')]],'as':_0x4341be['as'],'attributes':_0x4341be['attributes'],'include':_0x4341be['include']?_[_0x6786('0x1b')](_0x4341be[_0x6786('0x1a')],function(_0x81cdac){return{'model':db[_0x81cdac[_0x6786('0x1c')]],'as':_0x81cdac['as'],'attributes':_0x81cdac[_0x6786('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6786('0x9')](function(_0xb81bb){logger[_0x6786('0xa')]('ShowDynamics365Account',_0x340858);logger[_0x6786('0xd')](_0x6786('0x1e'),_0x340858,JSON[_0x6786('0xe')](_0xb81bb));_0xe99060(_0xb81bb);})[_0x6786('0x13')](function(_0x19b123){logger[_0x6786('0xf')](_0x6786('0x1e'),_0x19b123[_0x6786('0x11')],_0x340858);_0x391dbf(_0x771dbf[_0x6786('0xf')](0x1f4,_0x19b123['message']));});});}; \ No newline at end of file +var _0xb135=['find','map','ShowDynamics365Account','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','include','model'];(function(_0x380058,_0x48f651){var _0x5860a=function(_0x4a0ffb){while(--_0x4a0ffb){_0x380058['push'](_0x380058['shift']());}};_0x5860a(++_0x48f651);}(_0xb135,0x1b0));var _0x5b13=function(_0x172b2c,_0x7a963a){_0x172b2c=_0x172b2c-0x0;var _0x5631c2=_0xb135[_0x172b2c];return _0x5631c2;};'use strict';var _=require(_0x5b13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b13('0x1'));var rs=require(_0x5b13('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b13('0x3'))['db'];var utils=require(_0x5b13('0x4'));var logger=require(_0x5b13('0x5'))(_0x5b13('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b13('0x7'));var client=jayson['client'][_0x5b13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x340727,_0x7e9569,_0x1391c1){return new BPromise(function(_0x96181a,_0x574655){return client[_0x5b13('0x9')](_0x340727,_0x1391c1)[_0x5b13('0xa')](function(_0x368843){logger[_0x5b13('0xb')](_0x5b13('0xc'),_0x7e9569,_0x5b13('0xd'));logger[_0x5b13('0xe')](_0x5b13('0xf'),_0x7e9569,'request\x20sent',JSON[_0x5b13('0x10')](_0x368843));if(_0x368843[_0x5b13('0x11')]){if(_0x368843[_0x5b13('0x11')][_0x5b13('0x12')]===0x1f4){logger['error'](_0x5b13('0xc'),_0x7e9569,_0x368843[_0x5b13('0x11')]['message']);return _0x574655(_0x368843[_0x5b13('0x11')][_0x5b13('0x13')]);}logger[_0x5b13('0x11')](_0x5b13('0xc'),_0x7e9569,_0x368843[_0x5b13('0x11')][_0x5b13('0x13')]);return _0x96181a(_0x368843['error'][_0x5b13('0x13')]);}else{logger[_0x5b13('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x7e9569,_0x5b13('0xd'));_0x96181a(_0x368843[_0x5b13('0x14')]['message']);}})[_0x5b13('0x15')](function(_0x3bec61){logger[_0x5b13('0x11')](_0x5b13('0xc'),_0x7e9569,_0x3bec61);_0x574655(_0x3bec61);});});}exports[_0x5b13('0x16')]=function(_0x45e7ad){var _0x5bbfdc=this;return new Promise(function(_0x462d10,_0x3271b7){return db[_0x5b13('0x17')][_0x5b13('0x18')]({'raw':_0x45e7ad['options']?_0x45e7ad[_0x5b13('0x19')][_0x5b13('0x1a')]===undefined?!![]:![]:!![],'where':_0x45e7ad[_0x5b13('0x19')]?_0x45e7ad[_0x5b13('0x19')]['where']||null:null,'attributes':_0x45e7ad[_0x5b13('0x19')]?_0x45e7ad['options'][_0x5b13('0x1b')]||null:null,'limit':_0x45e7ad['options']?_0x45e7ad[_0x5b13('0x19')]['limit']||null:null,'include':_0x45e7ad[_0x5b13('0x19')]?_0x45e7ad[_0x5b13('0x19')]['include']?_['map'](_0x45e7ad[_0x5b13('0x19')][_0x5b13('0x1c')],function(_0x2087a5){return{'model':db[_0x2087a5[_0x5b13('0x1d')]],'as':_0x2087a5['as'],'attributes':_0x2087a5[_0x5b13('0x1b')],'include':_0x2087a5[_0x5b13('0x1c')]?_['map'](_0x2087a5[_0x5b13('0x1c')],function(_0x38f620){return{'model':db[_0x38f620[_0x5b13('0x1d')]],'as':_0x38f620['as'],'attributes':_0x38f620[_0x5b13('0x1b')],'include':_0x38f620[_0x5b13('0x1c')]?_['map'](_0x38f620[_0x5b13('0x1c')],function(_0x17f181){return{'model':db[_0x17f181[_0x5b13('0x1d')]],'as':_0x17f181['as'],'attributes':_0x17f181[_0x5b13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5b13('0xa')](function(_0x64ae8a){logger['info']('GetDynamics365Account',_0x45e7ad);logger['debug'](_0x5b13('0x16'),_0x45e7ad,JSON[_0x5b13('0x10')](_0x64ae8a));_0x462d10(_0x64ae8a);})[_0x5b13('0x15')](function(_0x4c7816){logger[_0x5b13('0x11')](_0x5b13('0x16'),_0x4c7816[_0x5b13('0x13')],_0x45e7ad);_0x3271b7(_0x5bbfdc[_0x5b13('0x11')](0x1f4,_0x4c7816['message']));});});};exports['ShowDynamics365Account']=function(_0x56a77f){var _0x5e316d=this;return new Promise(function(_0x2f3e90,_0x2867a8){return db[_0x5b13('0x17')][_0x5b13('0x1e')]({'raw':_0x56a77f[_0x5b13('0x19')]?_0x56a77f[_0x5b13('0x19')][_0x5b13('0x1a')]===undefined?!![]:![]:!![],'where':_0x56a77f[_0x5b13('0x19')]?_0x56a77f[_0x5b13('0x19')]['where']||null:null,'attributes':_0x56a77f['options']?_0x56a77f[_0x5b13('0x19')]['attributes']||null:null,'include':_0x56a77f[_0x5b13('0x19')]?_0x56a77f['options']['include']?_[_0x5b13('0x1f')](_0x56a77f[_0x5b13('0x19')]['include'],function(_0x19d9df){return{'model':db[_0x19d9df[_0x5b13('0x1d')]],'as':_0x19d9df['as'],'attributes':_0x19d9df['attributes'],'include':_0x19d9df['include']?_['map'](_0x19d9df[_0x5b13('0x1c')],function(_0x5f1dc2){return{'model':db[_0x5f1dc2['model']],'as':_0x5f1dc2['as'],'attributes':_0x5f1dc2['attributes'],'include':_0x5f1dc2[_0x5b13('0x1c')]?_[_0x5b13('0x1f')](_0x5f1dc2[_0x5b13('0x1c')],function(_0x38b3ff){return{'model':db[_0x38b3ff[_0x5b13('0x1d')]],'as':_0x38b3ff['as'],'attributes':_0x38b3ff['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b13('0xa')](function(_0x8f9476){logger[_0x5b13('0xb')]('ShowDynamics365Account',_0x56a77f);logger[_0x5b13('0xe')](_0x5b13('0x20'),_0x56a77f,JSON[_0x5b13('0x10')](_0x8f9476));_0x2f3e90(_0x8f9476);})['catch'](function(_0x32b8af){logger[_0x5b13('0x11')]('ShowDynamics365Account',_0x32b8af['message'],_0x56a77f);_0x2867a8(_0x5e316d[_0x5b13('0x11')](0x1f4,_0x32b8af[_0x5b13('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 32e834e..b51bdbf 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 _0x6606=['post','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id/fields','getFields','getDescriptions'];(function(_0x1b4a6a,_0x389f97){var _0x2473ee=function(_0x1e6a4b){while(--_0x1e6a4b){_0x1b4a6a['push'](_0x1b4a6a['shift']());}};_0x2473ee(++_0x389f97);}(_0x6606,0x6a));var _0x6660=function(_0x13dfe6,_0x19c98c){_0x13dfe6=_0x13dfe6-0x0;var _0x4d95fe=_0x6606[_0x13dfe6];return _0x4d95fe;};'use strict';var multer=require(_0x6660('0x0'));var util=require(_0x6660('0x1'));var path=require(_0x6660('0x2'));var timeout=require(_0x6660('0x3'));var express=require(_0x6660('0x4'));var router=express[_0x6660('0x5')]();var fs_extra=require(_0x6660('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6660('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x6660('0x8')]('/',auth[_0x6660('0x9')](),controller[_0x6660('0xa')]);router[_0x6660('0x8')]('/:id',auth[_0x6660('0x9')](),controller['show']);router['get'](_0x6660('0xb'),auth[_0x6660('0x9')](),controller[_0x6660('0xc')]);router[_0x6660('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x6660('0x8')]('/:id/descriptions',auth[_0x6660('0x9')](),controller[_0x6660('0xd')]);router[_0x6660('0xe')]('/',auth[_0x6660('0x9')](),controller['create']);router[_0x6660('0xf')]('/:id',auth[_0x6660('0x9')](),controller[_0x6660('0x10')]);router[_0x6660('0x11')](_0x6660('0x12'),auth[_0x6660('0x9')](),controller['destroy']);module[_0x6660('0x13')]=router; \ No newline at end of file +var _0xdf8d=['getSubjects','getDescriptions','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x24ec40,_0x375368){var _0x517d60=function(_0x2016de){while(--_0x2016de){_0x24ec40['push'](_0x24ec40['shift']());}};_0x517d60(++_0x375368);}(_0xdf8d,0x1bf));var _0xddf8=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xdf8d[_0x2afbb0];return _0x411ff2;};'use strict';var multer=require(_0xddf8('0x0'));var util=require('util');var path=require(_0xddf8('0x1'));var timeout=require('connect-timeout');var express=require(_0xddf8('0x2'));var router=express[_0xddf8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddf8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xddf8('0x5'));var controller=require('./intDynamics365Configuration.controller');router[_0xddf8('0x6')]('/',auth[_0xddf8('0x7')](),controller['index']);router[_0xddf8('0x6')](_0xddf8('0x8'),auth[_0xddf8('0x7')](),controller[_0xddf8('0x9')]);router[_0xddf8('0x6')](_0xddf8('0xa'),auth['isAuthenticated'](),controller[_0xddf8('0xb')]);router[_0xddf8('0x6')](_0xddf8('0xc'),auth[_0xddf8('0x7')](),controller[_0xddf8('0xd')]);router[_0xddf8('0x6')]('/:id/descriptions',auth[_0xddf8('0x7')](),controller[_0xddf8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddf8('0xf')]);router[_0xddf8('0x10')](_0xddf8('0x8'),auth[_0xddf8('0x7')](),controller[_0xddf8('0x11')]);router['delete'](_0xddf8('0x8'),auth[_0xddf8('0x7')](),controller[_0xddf8('0x12')]);module[_0xddf8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index c852e6c..a7e16c6 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 _0xca01=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x308d3f,_0x3605dd){var _0x18575d=function(_0x394deb){while(--_0x394deb){_0x308d3f['push'](_0x308d3f['shift']());}};_0x18575d(++_0x3605dd);}(_0xca01,0xe9));var _0x1ca0=function(_0x37fbdc,_0x5e614c){_0x37fbdc=_0x37fbdc-0x0;var _0x2a5e6f=_0xca01[_0x37fbdc];return _0x2a5e6f;};'use strict';var Sequelize=require(_0x1ca0('0x0'));module[_0x1ca0('0x1')]={'name':{'type':Sequelize[_0x1ca0('0x2')]},'description':{'type':Sequelize[_0x1ca0('0x2')]},'ticketType':{'type':Sequelize[_0x1ca0('0x3')]('incident','phonecall'),'defaultValue':_0x1ca0('0x4')},'moduleCreate':{'type':Sequelize[_0x1ca0('0x3')](_0x1ca0('0x5'),'nothing'),'defaultValue':_0x1ca0('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1ca0('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3bc4=['contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x30d24e,_0x5be7d3){var _0x4e4069=function(_0x4382db){while(--_0x4382db){_0x30d24e['push'](_0x30d24e['shift']());}};_0x4e4069(++_0x5be7d3);}(_0x3bc4,0x153));var _0x43bc=function(_0x3d91fd,_0x3a768b){_0x3d91fd=_0x3d91fd-0x0;var _0x137a3a=_0x3bc4[_0x3d91fd];return _0x137a3a;};'use strict';var Sequelize=require(_0x43bc('0x0'));module[_0x43bc('0x1')]={'name':{'type':Sequelize[_0x43bc('0x2')]},'description':{'type':Sequelize[_0x43bc('0x2')]},'ticketType':{'type':Sequelize[_0x43bc('0x3')](_0x43bc('0x4'),'phonecall'),'defaultValue':_0x43bc('0x4')},'moduleCreate':{'type':Sequelize[_0x43bc('0x3')](_0x43bc('0x5'),_0x43bc('0x6')),'defaultValue':_0x43bc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x43bc('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x43bc('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e6a9613..bcd5066 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 _0x6eba=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','keys','includeAll','options','find','create','body','params','destroy','getFields','Dynamics365Field','getSubjects','findOne','map','getDescriptions','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse'];(function(_0x14bd81,_0x24c09a){var _0x20a096=function(_0x13c0cb){while(--_0x13c0cb){_0x14bd81['push'](_0x14bd81['shift']());}};_0x20a096(++_0x24c09a);}(_0x6eba,0x139));var _0xa6eb=function(_0x301e70,_0x15afd9){_0x301e70=_0x301e70-0x0;var _0x5466b9=_0x6eba[_0x301e70];return _0x5466b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6eb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6eb('0x1'));var BPromise=require(_0xa6eb('0x2'));var Mustache=require(_0xa6eb('0x3'));var util=require(_0xa6eb('0x4'));var path=require(_0xa6eb('0x5'));var sox=require(_0xa6eb('0x6'));var csv=require(_0xa6eb('0x7'));var ejs=require(_0xa6eb('0x8'));var fs=require('fs');var fs_extra=require(_0xa6eb('0x9'));var _=require(_0xa6eb('0xa'));var squel=require(_0xa6eb('0xb'));var crypto=require(_0xa6eb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa6eb('0xd'));var toCsv=require(_0xa6eb('0x7'));var querystring=require('querystring');var Papa=require(_0xa6eb('0xe'));var Redis=require(_0xa6eb('0xf'));var authService=require(_0xa6eb('0x10'));var qs=require(_0xa6eb('0x11'));var as=require(_0xa6eb('0x12'));var hardwareService=require(_0xa6eb('0x13'));var logger=require(_0xa6eb('0x14'))(_0xa6eb('0x15'));var utils=require(_0xa6eb('0x16'));var config=require(_0xa6eb('0x17'));var licenseUtil=require(_0xa6eb('0x18'));var db=require(_0xa6eb('0x19'))['db'];function respondWithStatusCode(_0x4d8acb,_0x3e5ca1){_0x3e5ca1=_0x3e5ca1||0xcc;return function(_0x450b76){if(_0x450b76){return _0x4d8acb[_0xa6eb('0x1a')](_0x3e5ca1);}return _0x4d8acb[_0xa6eb('0x1b')](_0x3e5ca1)[_0xa6eb('0x1c')]();};}function respondWithResult(_0x1a780b,_0x12bb4a){_0x12bb4a=_0x12bb4a||0xc8;return function(_0x3ce2f0){if(_0x3ce2f0){return _0x1a780b[_0xa6eb('0x1b')](_0x12bb4a)['json'](_0x3ce2f0);}};}function respondWithFilteredResult(_0x50e6bb,_0x52aff0){return function(_0x1e8fb8){if(_0x1e8fb8){var _0x3ba3f2=typeof _0x52aff0[_0xa6eb('0x1d')]==='undefined'&&typeof _0x52aff0[_0xa6eb('0x1e')]===_0xa6eb('0x1f');var _0x58443a=_0x1e8fb8[_0xa6eb('0x20')];var _0x1a9651=_0x3ba3f2?0x0:_0x52aff0['offset'];var _0x4b80a2=_0x3ba3f2?_0x1e8fb8[_0xa6eb('0x20')]:_0x52aff0['offset']+_0x52aff0[_0xa6eb('0x1e')];var _0x4ceade;if(_0x4b80a2>=_0x58443a){_0x4b80a2=_0x58443a;_0x4ceade=0xc8;}else{_0x4ceade=0xce;}_0x50e6bb[_0xa6eb('0x1b')](_0x4ceade);return _0x50e6bb[_0xa6eb('0x21')](_0xa6eb('0x22'),_0x1a9651+'-'+_0x4b80a2+'/'+_0x58443a)[_0xa6eb('0x23')](_0x1e8fb8);}return null;};}function patchUpdates(_0x4fc683){return function(_0x43a75d){try{jsonpatch[_0xa6eb('0x24')](_0x43a75d,_0x4fc683,!![]);}catch(_0x2adbd1){return BPromise[_0xa6eb('0x25')](_0x2adbd1);}return _0x43a75d[_0xa6eb('0x26')]();};}function saveUpdates(_0x75e41b,_0x166371){return function(_0x843eed){if(_0x843eed){return _0x843eed[_0xa6eb('0x27')](_0x75e41b)[_0xa6eb('0x28')](function(_0x5b8fcc){return _0x5b8fcc;});}return null;};}function removeEntity(_0x453bab,_0x529581){return function(_0x566f17){if(_0x566f17){return _0x566f17['destroy']()[_0xa6eb('0x28')](function(){_0x453bab['status'](0xcc)[_0xa6eb('0x1c')]();});}};}function handleEntityNotFound(_0x38476e,_0x238951){return function(_0x3cc878){if(!_0x3cc878){_0x38476e[_0xa6eb('0x1a')](0x194);}return _0x3cc878;};}function handleError(_0x8c494f,_0x42d02a){_0x42d02a=_0x42d02a||0x1f4;return function(_0x3af96d){logger[_0xa6eb('0x29')](_0x3af96d[_0xa6eb('0x2a')]);if(_0x3af96d[_0xa6eb('0x2b')]){delete _0x3af96d[_0xa6eb('0x2b')];}_0x8c494f[_0xa6eb('0x1b')](_0x42d02a)[_0xa6eb('0x2c')](_0x3af96d);};}exports['index']=function(_0x229ea2,_0x276b79){var _0x48af9c={},_0x259b9d={},_0xb3bb02={'count':0x0,'rows':[]};var _0x2a1a70=_['map'](db[_0xa6eb('0x2d')][_0xa6eb('0x2e')],function(_0x19a241){return{'name':_0x19a241[_0xa6eb('0x2f')],'type':_0x19a241[_0xa6eb('0x30')][_0xa6eb('0x31')]};});_0x259b9d[_0xa6eb('0x32')]=_['map'](_0x2a1a70,'name');_0x259b9d['query']=_['keys'](_0x229ea2[_0xa6eb('0x33')]);_0x259b9d[_0xa6eb('0x34')]=_[_0xa6eb('0x35')](_0x259b9d[_0xa6eb('0x32')],_0x259b9d['query']);_0x48af9c[_0xa6eb('0x36')]=_[_0xa6eb('0x35')](_0x259b9d[_0xa6eb('0x32')],qs[_0xa6eb('0x37')](_0x229ea2[_0xa6eb('0x33')][_0xa6eb('0x37')]));_0x48af9c[_0xa6eb('0x36')]=_0x48af9c[_0xa6eb('0x36')][_0xa6eb('0x38')]?_0x48af9c[_0xa6eb('0x36')]:_0x259b9d['model'];if(!_0x229ea2['query'][_0xa6eb('0x39')](_0xa6eb('0x3a'))){_0x48af9c[_0xa6eb('0x1e')]=qs[_0xa6eb('0x1e')](_0x229ea2[_0xa6eb('0x33')]['limit']);_0x48af9c[_0xa6eb('0x1d')]=qs[_0xa6eb('0x1d')](_0x229ea2[_0xa6eb('0x33')][_0xa6eb('0x1d')]);}_0x48af9c[_0xa6eb('0x3b')]=qs[_0xa6eb('0x3c')](_0x229ea2[_0xa6eb('0x33')][_0xa6eb('0x3c')]);_0x48af9c[_0xa6eb('0x3d')]=qs[_0xa6eb('0x34')](_[_0xa6eb('0x3e')](_0x229ea2[_0xa6eb('0x33')],_0x259b9d[_0xa6eb('0x34')]),_0x2a1a70);if(_0x229ea2[_0xa6eb('0x33')][_0xa6eb('0x3f')]){_0x48af9c[_0xa6eb('0x3d')]=_[_0xa6eb('0x40')](_0x48af9c['where'],{'$or':_['map'](_0x2a1a70,function(_0x5d5116){if(_0x5d5116['type']!=='VIRTUAL'){var _0x1af9a8={};_0x1af9a8[_0x5d5116['name']]={'$like':'%'+_0x229ea2['query'][_0xa6eb('0x3f')]+'%'};return _0x1af9a8;}})});}_0x48af9c=_[_0xa6eb('0x40')]({},_0x48af9c,_0x229ea2['options']);var _0x24f6f8={'where':_0x48af9c['where']};return db[_0xa6eb('0x2d')][_0xa6eb('0x20')](_0x24f6f8)[_0xa6eb('0x28')](function(_0x549ff5){_0xb3bb02[_0xa6eb('0x20')]=_0x549ff5;if(_0x229ea2[_0xa6eb('0x33')]['includeAll']){_0x48af9c[_0xa6eb('0x41')]=[{'all':!![]}];}return db[_0xa6eb('0x2d')][_0xa6eb('0x42')](_0x48af9c);})['then'](function(_0x438d3d){_0xb3bb02['rows']=_0x438d3d;return _0xb3bb02;})['then'](respondWithFilteredResult(_0x276b79,_0x48af9c))[_0xa6eb('0x43')](handleError(_0x276b79,null));};exports['show']=function(_0x3c6ab7,_0x24e210){var _0x299774={'raw':![],'where':{'id':_0x3c6ab7['params']['id']}},_0x2d7089={};_0x2d7089[_0xa6eb('0x32')]=_[_0xa6eb('0x44')](db[_0xa6eb('0x2d')][_0xa6eb('0x2e')]);_0x2d7089[_0xa6eb('0x33')]=_[_0xa6eb('0x44')](_0x3c6ab7[_0xa6eb('0x33')]);_0x2d7089['filters']=_[_0xa6eb('0x35')](_0x2d7089[_0xa6eb('0x32')],_0x2d7089['query']);_0x299774['attributes']=_[_0xa6eb('0x35')](_0x2d7089['model'],qs['fields'](_0x3c6ab7[_0xa6eb('0x33')]['fields']));_0x299774[_0xa6eb('0x36')]=_0x299774['attributes'][_0xa6eb('0x38')]?_0x299774[_0xa6eb('0x36')]:_0x2d7089[_0xa6eb('0x32')];if(_0x3c6ab7[_0xa6eb('0x33')][_0xa6eb('0x45')]){_0x299774[_0xa6eb('0x41')]=[{'all':!![]}];}_0x299774=_['merge']({},_0x299774,_0x3c6ab7[_0xa6eb('0x46')]);return db[_0xa6eb('0x2d')][_0xa6eb('0x47')](_0x299774)[_0xa6eb('0x28')](handleEntityNotFound(_0x24e210,null))[_0xa6eb('0x28')](respondWithResult(_0x24e210,null))[_0xa6eb('0x43')](handleError(_0x24e210,null));};exports[_0xa6eb('0x48')]=function(_0x31cc8f,_0x6cd0fc){return db['Dynamics365Configuration'][_0xa6eb('0x48')](_0x31cc8f[_0xa6eb('0x49')],{})[_0xa6eb('0x28')](respondWithResult(_0x6cd0fc,0xc9))[_0xa6eb('0x43')](handleError(_0x6cd0fc,null));};exports[_0xa6eb('0x27')]=function(_0xcc0d7c,_0x4e9547){if(_0xcc0d7c[_0xa6eb('0x49')]['id']){delete _0xcc0d7c[_0xa6eb('0x49')]['id'];}return db[_0xa6eb('0x2d')][_0xa6eb('0x47')]({'where':{'id':_0xcc0d7c[_0xa6eb('0x4a')]['id']}})[_0xa6eb('0x28')](handleEntityNotFound(_0x4e9547,null))[_0xa6eb('0x28')](saveUpdates(_0xcc0d7c[_0xa6eb('0x49')],null))['then'](respondWithResult(_0x4e9547,null))[_0xa6eb('0x43')](handleError(_0x4e9547,null));};exports[_0xa6eb('0x4b')]=function(_0x3acf1a,_0xb5bb4a){return db['Dynamics365Configuration']['find']({'where':{'id':_0x3acf1a[_0xa6eb('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb5bb4a,null))['then'](removeEntity(_0xb5bb4a,null))[_0xa6eb('0x43')](handleError(_0xb5bb4a,null));};exports[_0xa6eb('0x4c')]=function(_0x1d1cf1,_0x371679,_0x5c09cf){var _0x4eb995={};var _0x1b6d13={};var _0x3a9de8;var _0x41cbf3;return db[_0xa6eb('0x2d')]['findOne']({'where':{'id':_0x1d1cf1[_0xa6eb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x371679,null))[_0xa6eb('0x28')](function(_0x53dc28){if(_0x53dc28){_0x3a9de8=_0x53dc28;_0x1b6d13[_0xa6eb('0x32')]=_[_0xa6eb('0x44')](db[_0xa6eb('0x4d')][_0xa6eb('0x2e')]);_0x1b6d13['query']=_[_0xa6eb('0x44')](_0x1d1cf1[_0xa6eb('0x33')]);_0x1b6d13[_0xa6eb('0x34')]=_['intersection'](_0x1b6d13[_0xa6eb('0x32')],_0x1b6d13['query']);_0x4eb995[_0xa6eb('0x36')]=_[_0xa6eb('0x35')](_0x1b6d13[_0xa6eb('0x32')],qs[_0xa6eb('0x37')](_0x1d1cf1[_0xa6eb('0x33')][_0xa6eb('0x37')]));_0x4eb995[_0xa6eb('0x36')]=_0x4eb995['attributes']['length']?_0x4eb995[_0xa6eb('0x36')]:_0x1b6d13[_0xa6eb('0x32')];_0x4eb995[_0xa6eb('0x3b')]=qs['sort'](_0x1d1cf1['query'][_0xa6eb('0x3c')]);_0x4eb995[_0xa6eb('0x3d')]=qs[_0xa6eb('0x34')](_[_0xa6eb('0x3e')](_0x1d1cf1['query'],_0x1b6d13[_0xa6eb('0x34')]));if(_0x1d1cf1['query'][_0xa6eb('0x3f')]){_0x4eb995['where']=_[_0xa6eb('0x40')](_0x4eb995[_0xa6eb('0x3d')],{'$or':_['map'](_0x4eb995[_0xa6eb('0x36')],function(_0x44b4a4){var _0x45a503={};_0x45a503[_0x44b4a4]={'$like':'%'+_0x1d1cf1[_0xa6eb('0x33')][_0xa6eb('0x3f')]+'%'};return _0x45a503;})});}_0x4eb995=_[_0xa6eb('0x40')]({},_0x4eb995,_0x1d1cf1[_0xa6eb('0x46')]);return _0x3a9de8[_0xa6eb('0x4c')](_0x4eb995);}})[_0xa6eb('0x28')](function(_0xb914da){if(_0xb914da){_0x41cbf3=_0xb914da[_0xa6eb('0x38')];if(!_0x1d1cf1[_0xa6eb('0x33')]['hasOwnProperty'](_0xa6eb('0x3a'))){_0x4eb995[_0xa6eb('0x1e')]=qs[_0xa6eb('0x1e')](_0x1d1cf1[_0xa6eb('0x33')][_0xa6eb('0x1e')]);_0x4eb995[_0xa6eb('0x1d')]=qs[_0xa6eb('0x1d')](_0x1d1cf1[_0xa6eb('0x33')][_0xa6eb('0x1d')]);}return _0x3a9de8['getFields'](_0x4eb995);}})['then'](function(_0x12d15c){if(_0x12d15c){return _0x12d15c?{'count':_0x41cbf3,'rows':_0x12d15c}:null;}})[_0xa6eb('0x28')](respondWithResult(_0x371679,null))['catch'](handleError(_0x371679,null));};exports[_0xa6eb('0x4e')]=function(_0x4fd4b7,_0x4652dc,_0x29f3d8){var _0x2a62c6={};var _0x52533e={};var _0x498586;var _0x49b189;return db[_0xa6eb('0x2d')][_0xa6eb('0x4f')]({'where':{'id':_0x4fd4b7[_0xa6eb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4652dc,null))[_0xa6eb('0x28')](function(_0x5df408){if(_0x5df408){_0x498586=_0x5df408;_0x52533e[_0xa6eb('0x32')]=_[_0xa6eb('0x44')](db[_0xa6eb('0x4d')][_0xa6eb('0x2e')]);_0x52533e[_0xa6eb('0x33')]=_['keys'](_0x4fd4b7[_0xa6eb('0x33')]);_0x52533e[_0xa6eb('0x34')]=_[_0xa6eb('0x35')](_0x52533e[_0xa6eb('0x32')],_0x52533e['query']);_0x2a62c6[_0xa6eb('0x36')]=_[_0xa6eb('0x35')](_0x52533e[_0xa6eb('0x32')],qs[_0xa6eb('0x37')](_0x4fd4b7[_0xa6eb('0x33')][_0xa6eb('0x37')]));_0x2a62c6[_0xa6eb('0x36')]=_0x2a62c6[_0xa6eb('0x36')]['length']?_0x2a62c6[_0xa6eb('0x36')]:_0x52533e[_0xa6eb('0x32')];_0x2a62c6[_0xa6eb('0x3b')]=qs[_0xa6eb('0x3c')](_0x4fd4b7[_0xa6eb('0x33')]['sort']);_0x2a62c6['where']=qs['filters'](_[_0xa6eb('0x3e')](_0x4fd4b7[_0xa6eb('0x33')],_0x52533e['filters']));if(_0x4fd4b7[_0xa6eb('0x33')][_0xa6eb('0x3f')]){_0x2a62c6['where']=_['merge'](_0x2a62c6[_0xa6eb('0x3d')],{'$or':_[_0xa6eb('0x50')](_0x2a62c6['attributes'],function(_0x4c48b3){var _0x269224={};_0x269224[_0x4c48b3]={'$like':'%'+_0x4fd4b7[_0xa6eb('0x33')][_0xa6eb('0x3f')]+'%'};return _0x269224;})});}_0x2a62c6=_['merge']({},_0x2a62c6,_0x4fd4b7[_0xa6eb('0x46')]);return _0x498586[_0xa6eb('0x4e')](_0x2a62c6);}})[_0xa6eb('0x28')](function(_0x3513e2){if(_0x3513e2){_0x49b189=_0x3513e2[_0xa6eb('0x38')];if(!_0x4fd4b7[_0xa6eb('0x33')][_0xa6eb('0x39')](_0xa6eb('0x3a'))){_0x2a62c6[_0xa6eb('0x1e')]=qs[_0xa6eb('0x1e')](_0x4fd4b7[_0xa6eb('0x33')][_0xa6eb('0x1e')]);_0x2a62c6[_0xa6eb('0x1d')]=qs[_0xa6eb('0x1d')](_0x4fd4b7['query'][_0xa6eb('0x1d')]);}return _0x498586[_0xa6eb('0x4e')](_0x2a62c6);}})[_0xa6eb('0x28')](function(_0x344b3d){if(_0x344b3d){return _0x344b3d?{'count':_0x49b189,'rows':_0x344b3d}:null;}})[_0xa6eb('0x28')](respondWithResult(_0x4652dc,null))[_0xa6eb('0x43')](handleError(_0x4652dc,null));};exports['getDescriptions']=function(_0xaaf493,_0x2fa64b,_0x1a793f){var _0x41749b={};var _0x25da51={};var _0x1f492a;var _0x3abcb3;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0xaaf493['params']['id']}})[_0xa6eb('0x28')](handleEntityNotFound(_0x2fa64b,null))[_0xa6eb('0x28')](function(_0x24aa59){if(_0x24aa59){_0x1f492a=_0x24aa59;_0x25da51[_0xa6eb('0x32')]=_[_0xa6eb('0x44')](db[_0xa6eb('0x4d')]['rawAttributes']);_0x25da51[_0xa6eb('0x33')]=_['keys'](_0xaaf493[_0xa6eb('0x33')]);_0x25da51[_0xa6eb('0x34')]=_[_0xa6eb('0x35')](_0x25da51['model'],_0x25da51[_0xa6eb('0x33')]);_0x41749b[_0xa6eb('0x36')]=_[_0xa6eb('0x35')](_0x25da51[_0xa6eb('0x32')],qs['fields'](_0xaaf493[_0xa6eb('0x33')][_0xa6eb('0x37')]));_0x41749b[_0xa6eb('0x36')]=_0x41749b[_0xa6eb('0x36')][_0xa6eb('0x38')]?_0x41749b[_0xa6eb('0x36')]:_0x25da51[_0xa6eb('0x32')];_0x41749b[_0xa6eb('0x3b')]=qs[_0xa6eb('0x3c')](_0xaaf493[_0xa6eb('0x33')][_0xa6eb('0x3c')]);_0x41749b[_0xa6eb('0x3d')]=qs[_0xa6eb('0x34')](_[_0xa6eb('0x3e')](_0xaaf493[_0xa6eb('0x33')],_0x25da51[_0xa6eb('0x34')]));if(_0xaaf493[_0xa6eb('0x33')]['filter']){_0x41749b[_0xa6eb('0x3d')]=_[_0xa6eb('0x40')](_0x41749b[_0xa6eb('0x3d')],{'$or':_['map'](_0x41749b[_0xa6eb('0x36')],function(_0x90440e){var _0x4bef61={};_0x4bef61[_0x90440e]={'$like':'%'+_0xaaf493[_0xa6eb('0x33')][_0xa6eb('0x3f')]+'%'};return _0x4bef61;})});}_0x41749b=_[_0xa6eb('0x40')]({},_0x41749b,_0xaaf493[_0xa6eb('0x46')]);return _0x1f492a['getDescriptions'](_0x41749b);}})[_0xa6eb('0x28')](function(_0x576ce2){if(_0x576ce2){_0x3abcb3=_0x576ce2[_0xa6eb('0x38')];if(!_0xaaf493['query'][_0xa6eb('0x39')](_0xa6eb('0x3a'))){_0x41749b[_0xa6eb('0x1e')]=qs[_0xa6eb('0x1e')](_0xaaf493[_0xa6eb('0x33')]['limit']);_0x41749b[_0xa6eb('0x1d')]=qs[_0xa6eb('0x1d')](_0xaaf493[_0xa6eb('0x33')][_0xa6eb('0x1d')]);}return _0x1f492a[_0xa6eb('0x51')](_0x41749b);}})[_0xa6eb('0x28')](function(_0x4d15a7){if(_0x4d15a7){return _0x4d15a7?{'count':_0x3abcb3,'rows':_0x4d15a7}:null;}})['then'](respondWithResult(_0x2fa64b,null))[_0xa6eb('0x43')](handleError(_0x2fa64b,null));}; \ No newline at end of file +var _0x2178=['request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','keys','find','create','body','update','params','getFields','Dynamics365Field','hasOwnProperty','getSubjects','order','getDescriptions','findOne','eml-format','rimraf','fast-json-patch'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x2178,0x131));var _0x8217=function(_0x192136,_0x434d09){_0x192136=_0x192136-0x0;var _0x2524a5=_0x2178[_0x192136];return _0x2524a5;};'use strict';var emlformat=require(_0x8217('0x0'));var rimraf=require(_0x8217('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8217('0x2'));var rp=require(_0x8217('0x3'));var moment=require(_0x8217('0x4'));var BPromise=require(_0x8217('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8217('0x6'));var csv=require(_0x8217('0x7'));var ejs=require(_0x8217('0x8'));var fs=require('fs');var fs_extra=require(_0x8217('0x9'));var _=require('lodash');var squel=require(_0x8217('0xa'));var crypto=require(_0x8217('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8217('0x7'));var querystring=require('querystring');var Papa=require(_0x8217('0xc'));var Redis=require(_0x8217('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8217('0xe'));var as=require(_0x8217('0xf'));var hardwareService=require(_0x8217('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x8217('0x11'));var config=require(_0x8217('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8217('0x13'))['db'];function respondWithStatusCode(_0x5a787a,_0x41b092){_0x41b092=_0x41b092||0xcc;return function(_0x36fa50){if(_0x36fa50){return _0x5a787a[_0x8217('0x14')](_0x41b092);}return _0x5a787a[_0x8217('0x15')](_0x41b092)[_0x8217('0x16')]();};}function respondWithResult(_0x24cc93,_0x5ae8cb){_0x5ae8cb=_0x5ae8cb||0xc8;return function(_0x3d8eba){if(_0x3d8eba){return _0x24cc93['status'](_0x5ae8cb)[_0x8217('0x17')](_0x3d8eba);}};}function respondWithFilteredResult(_0x7ccfd4,_0x1a1bfa){return function(_0x29a264){if(_0x29a264){var _0x62e2c0=typeof _0x1a1bfa[_0x8217('0x18')]===_0x8217('0x19')&&typeof _0x1a1bfa[_0x8217('0x1a')]===_0x8217('0x19');var _0x122f7b=_0x29a264['count'];var _0x241a34=_0x62e2c0?0x0:_0x1a1bfa[_0x8217('0x18')];var _0x195250=_0x62e2c0?_0x29a264[_0x8217('0x1b')]:_0x1a1bfa[_0x8217('0x18')]+_0x1a1bfa[_0x8217('0x1a')];var _0x509d35;if(_0x195250>=_0x122f7b){_0x195250=_0x122f7b;_0x509d35=0xc8;}else{_0x509d35=0xce;}_0x7ccfd4['status'](_0x509d35);return _0x7ccfd4[_0x8217('0x1c')](_0x8217('0x1d'),_0x241a34+'-'+_0x195250+'/'+_0x122f7b)[_0x8217('0x17')](_0x29a264);}return null;};}function patchUpdates(_0x4225d0){return function(_0x36f999){try{jsonpatch[_0x8217('0x1e')](_0x36f999,_0x4225d0,!![]);}catch(_0x3d7766){return BPromise[_0x8217('0x1f')](_0x3d7766);}return _0x36f999[_0x8217('0x20')]();};}function saveUpdates(_0x1ca81a,_0x5b3c3b){return function(_0x55ee67){if(_0x55ee67){return _0x55ee67['update'](_0x1ca81a)[_0x8217('0x21')](function(_0x126dbc){return _0x126dbc;});}return null;};}function removeEntity(_0x46fd3c,_0x43a686){return function(_0x35987b){if(_0x35987b){return _0x35987b[_0x8217('0x22')]()[_0x8217('0x21')](function(){_0x46fd3c['status'](0xcc)[_0x8217('0x16')]();});}};}function handleEntityNotFound(_0x569421,_0x248582){return function(_0x1d1562){if(!_0x1d1562){_0x569421[_0x8217('0x14')](0x194);}return _0x1d1562;};}function handleError(_0x528e64,_0x5cec74){_0x5cec74=_0x5cec74||0x1f4;return function(_0x2f6fee){logger[_0x8217('0x23')](_0x2f6fee[_0x8217('0x24')]);if(_0x2f6fee[_0x8217('0x25')]){delete _0x2f6fee[_0x8217('0x25')];}_0x528e64['status'](_0x5cec74)[_0x8217('0x26')](_0x2f6fee);};}exports['index']=function(_0x1bf9c7,_0x2fe551){var _0x4babcb={},_0x401475={},_0x3a8990={'count':0x0,'rows':[]};var _0x70110=_[_0x8217('0x27')](db[_0x8217('0x28')][_0x8217('0x29')],function(_0x515935){return{'name':_0x515935[_0x8217('0x2a')],'type':_0x515935[_0x8217('0x2b')][_0x8217('0x2c')]};});_0x401475[_0x8217('0x2d')]=_[_0x8217('0x27')](_0x70110,_0x8217('0x25'));_0x401475[_0x8217('0x2e')]=_['keys'](_0x1bf9c7['query']);_0x401475[_0x8217('0x2f')]=_[_0x8217('0x30')](_0x401475[_0x8217('0x2d')],_0x401475['query']);_0x4babcb[_0x8217('0x31')]=_['intersection'](_0x401475['model'],qs[_0x8217('0x32')](_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x32')]));_0x4babcb[_0x8217('0x31')]=_0x4babcb['attributes'][_0x8217('0x33')]?_0x4babcb['attributes']:_0x401475[_0x8217('0x2d')];if(!_0x1bf9c7[_0x8217('0x2e')]['hasOwnProperty'](_0x8217('0x34'))){_0x4babcb['limit']=qs[_0x8217('0x1a')](_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x1a')]);_0x4babcb[_0x8217('0x18')]=qs[_0x8217('0x18')](_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x18')]);}_0x4babcb['order']=qs[_0x8217('0x35')](_0x1bf9c7[_0x8217('0x2e')]['sort']);_0x4babcb[_0x8217('0x36')]=qs['filters'](_[_0x8217('0x37')](_0x1bf9c7['query'],_0x401475['filters']),_0x70110);if(_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x38')]){_0x4babcb[_0x8217('0x36')]=_['merge'](_0x4babcb['where'],{'$or':_[_0x8217('0x27')](_0x70110,function(_0xab8687){if(_0xab8687[_0x8217('0x2b')]!==_0x8217('0x39')){var _0x1dfb7d={};_0x1dfb7d[_0xab8687['name']]={'$like':'%'+_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x38')]+'%'};return _0x1dfb7d;}})});}_0x4babcb=_[_0x8217('0x3a')]({},_0x4babcb,_0x1bf9c7[_0x8217('0x3b')]);var _0x29b589={'where':_0x4babcb['where']};return db[_0x8217('0x28')][_0x8217('0x1b')](_0x29b589)[_0x8217('0x21')](function(_0x10985b){_0x3a8990[_0x8217('0x1b')]=_0x10985b;if(_0x1bf9c7[_0x8217('0x2e')][_0x8217('0x3c')]){_0x4babcb[_0x8217('0x3d')]=[{'all':!![]}];}return db[_0x8217('0x28')]['findAll'](_0x4babcb);})[_0x8217('0x21')](function(_0x4a15d3){_0x3a8990['rows']=_0x4a15d3;return _0x3a8990;})[_0x8217('0x21')](respondWithFilteredResult(_0x2fe551,_0x4babcb))[_0x8217('0x3e')](handleError(_0x2fe551,null));};exports[_0x8217('0x3f')]=function(_0x2a3853,_0x1fa8af){var _0x3c5c9e={'raw':![],'where':{'id':_0x2a3853['params']['id']}},_0x4b4367={};_0x4b4367[_0x8217('0x2d')]=_[_0x8217('0x40')](db[_0x8217('0x28')][_0x8217('0x29')]);_0x4b4367['query']=_[_0x8217('0x40')](_0x2a3853[_0x8217('0x2e')]);_0x4b4367[_0x8217('0x2f')]=_['intersection'](_0x4b4367[_0x8217('0x2d')],_0x4b4367[_0x8217('0x2e')]);_0x3c5c9e[_0x8217('0x31')]=_[_0x8217('0x30')](_0x4b4367[_0x8217('0x2d')],qs['fields'](_0x2a3853['query'][_0x8217('0x32')]));_0x3c5c9e[_0x8217('0x31')]=_0x3c5c9e[_0x8217('0x31')]['length']?_0x3c5c9e[_0x8217('0x31')]:_0x4b4367['model'];if(_0x2a3853[_0x8217('0x2e')][_0x8217('0x3c')]){_0x3c5c9e['include']=[{'all':!![]}];}_0x3c5c9e=_['merge']({},_0x3c5c9e,_0x2a3853[_0x8217('0x3b')]);return db[_0x8217('0x28')][_0x8217('0x41')](_0x3c5c9e)['then'](handleEntityNotFound(_0x1fa8af,null))[_0x8217('0x21')](respondWithResult(_0x1fa8af,null))[_0x8217('0x3e')](handleError(_0x1fa8af,null));};exports[_0x8217('0x42')]=function(_0x288304,_0x49cfb4){return db[_0x8217('0x28')][_0x8217('0x42')](_0x288304[_0x8217('0x43')],{})[_0x8217('0x21')](respondWithResult(_0x49cfb4,0xc9))[_0x8217('0x3e')](handleError(_0x49cfb4,null));};exports[_0x8217('0x44')]=function(_0x127fb4,_0x2240cb){if(_0x127fb4[_0x8217('0x43')]['id']){delete _0x127fb4['body']['id'];}return db[_0x8217('0x28')]['find']({'where':{'id':_0x127fb4[_0x8217('0x45')]['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x2240cb,null))['then'](saveUpdates(_0x127fb4[_0x8217('0x43')],null))[_0x8217('0x21')](respondWithResult(_0x2240cb,null))[_0x8217('0x3e')](handleError(_0x2240cb,null));};exports['destroy']=function(_0x30508f,_0x16b6d7){return db[_0x8217('0x28')][_0x8217('0x41')]({'where':{'id':_0x30508f[_0x8217('0x45')]['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x16b6d7,null))['then'](removeEntity(_0x16b6d7,null))[_0x8217('0x3e')](handleError(_0x16b6d7,null));};exports[_0x8217('0x46')]=function(_0x2fd2d3,_0x8c67de,_0x368634){var _0xf0f388={};var _0x4e3325={};var _0x1f12a2;var _0x2767c0;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2fd2d3[_0x8217('0x45')]['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x8c67de,null))[_0x8217('0x21')](function(_0x2a29af){if(_0x2a29af){_0x1f12a2=_0x2a29af;_0x4e3325[_0x8217('0x2d')]=_[_0x8217('0x40')](db[_0x8217('0x47')]['rawAttributes']);_0x4e3325[_0x8217('0x2e')]=_[_0x8217('0x40')](_0x2fd2d3[_0x8217('0x2e')]);_0x4e3325[_0x8217('0x2f')]=_[_0x8217('0x30')](_0x4e3325[_0x8217('0x2d')],_0x4e3325[_0x8217('0x2e')]);_0xf0f388[_0x8217('0x31')]=_['intersection'](_0x4e3325['model'],qs['fields'](_0x2fd2d3[_0x8217('0x2e')]['fields']));_0xf0f388[_0x8217('0x31')]=_0xf0f388[_0x8217('0x31')][_0x8217('0x33')]?_0xf0f388['attributes']:_0x4e3325[_0x8217('0x2d')];_0xf0f388['order']=qs['sort'](_0x2fd2d3[_0x8217('0x2e')][_0x8217('0x35')]);_0xf0f388[_0x8217('0x36')]=qs[_0x8217('0x2f')](_[_0x8217('0x37')](_0x2fd2d3[_0x8217('0x2e')],_0x4e3325[_0x8217('0x2f')]));if(_0x2fd2d3[_0x8217('0x2e')]['filter']){_0xf0f388['where']=_[_0x8217('0x3a')](_0xf0f388['where'],{'$or':_[_0x8217('0x27')](_0xf0f388['attributes'],function(_0x14295a){var _0x25799e={};_0x25799e[_0x14295a]={'$like':'%'+_0x2fd2d3['query'][_0x8217('0x38')]+'%'};return _0x25799e;})});}_0xf0f388=_[_0x8217('0x3a')]({},_0xf0f388,_0x2fd2d3[_0x8217('0x3b')]);return _0x1f12a2[_0x8217('0x46')](_0xf0f388);}})[_0x8217('0x21')](function(_0x392ff0){if(_0x392ff0){_0x2767c0=_0x392ff0[_0x8217('0x33')];if(!_0x2fd2d3[_0x8217('0x2e')][_0x8217('0x48')](_0x8217('0x34'))){_0xf0f388[_0x8217('0x1a')]=qs['limit'](_0x2fd2d3[_0x8217('0x2e')]['limit']);_0xf0f388['offset']=qs[_0x8217('0x18')](_0x2fd2d3[_0x8217('0x2e')][_0x8217('0x18')]);}return _0x1f12a2['getFields'](_0xf0f388);}})[_0x8217('0x21')](function(_0x1751cd){if(_0x1751cd){return _0x1751cd?{'count':_0x2767c0,'rows':_0x1751cd}:null;}})[_0x8217('0x21')](respondWithResult(_0x8c67de,null))[_0x8217('0x3e')](handleError(_0x8c67de,null));};exports[_0x8217('0x49')]=function(_0xa1fea8,_0x224ffc,_0x1a1c12){var _0x159eab={};var _0x138aa4={};var _0xc1b466;var _0x361a4b;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0xa1fea8['params']['id']}})[_0x8217('0x21')](handleEntityNotFound(_0x224ffc,null))[_0x8217('0x21')](function(_0x1f906b){if(_0x1f906b){_0xc1b466=_0x1f906b;_0x138aa4['model']=_[_0x8217('0x40')](db[_0x8217('0x47')]['rawAttributes']);_0x138aa4[_0x8217('0x2e')]=_['keys'](_0xa1fea8['query']);_0x138aa4[_0x8217('0x2f')]=_[_0x8217('0x30')](_0x138aa4[_0x8217('0x2d')],_0x138aa4[_0x8217('0x2e')]);_0x159eab['attributes']=_[_0x8217('0x30')](_0x138aa4[_0x8217('0x2d')],qs[_0x8217('0x32')](_0xa1fea8[_0x8217('0x2e')][_0x8217('0x32')]));_0x159eab['attributes']=_0x159eab[_0x8217('0x31')][_0x8217('0x33')]?_0x159eab[_0x8217('0x31')]:_0x138aa4[_0x8217('0x2d')];_0x159eab[_0x8217('0x4a')]=qs[_0x8217('0x35')](_0xa1fea8[_0x8217('0x2e')]['sort']);_0x159eab[_0x8217('0x36')]=qs[_0x8217('0x2f')](_['pick'](_0xa1fea8[_0x8217('0x2e')],_0x138aa4[_0x8217('0x2f')]));if(_0xa1fea8[_0x8217('0x2e')][_0x8217('0x38')]){_0x159eab['where']=_['merge'](_0x159eab['where'],{'$or':_[_0x8217('0x27')](_0x159eab[_0x8217('0x31')],function(_0x5587d9){var _0x9443c4={};_0x9443c4[_0x5587d9]={'$like':'%'+_0xa1fea8['query'][_0x8217('0x38')]+'%'};return _0x9443c4;})});}_0x159eab=_[_0x8217('0x3a')]({},_0x159eab,_0xa1fea8[_0x8217('0x3b')]);return _0xc1b466[_0x8217('0x49')](_0x159eab);}})['then'](function(_0x41c28c){if(_0x41c28c){_0x361a4b=_0x41c28c[_0x8217('0x33')];if(!_0xa1fea8[_0x8217('0x2e')][_0x8217('0x48')]('nolimit')){_0x159eab[_0x8217('0x1a')]=qs[_0x8217('0x1a')](_0xa1fea8[_0x8217('0x2e')][_0x8217('0x1a')]);_0x159eab[_0x8217('0x18')]=qs['offset'](_0xa1fea8[_0x8217('0x2e')][_0x8217('0x18')]);}return _0xc1b466[_0x8217('0x49')](_0x159eab);}})[_0x8217('0x21')](function(_0x136550){if(_0x136550){return _0x136550?{'count':_0x361a4b,'rows':_0x136550}:null;}})[_0x8217('0x21')](respondWithResult(_0x224ffc,null))[_0x8217('0x3e')](handleError(_0x224ffc,null));};exports[_0x8217('0x4b')]=function(_0x471f1b,_0x313a00,_0xaa8859){var _0x1bc89d={};var _0xf5f6d0={};var _0x586792;var _0x43e1f2;return db[_0x8217('0x28')][_0x8217('0x4c')]({'where':{'id':_0x471f1b[_0x8217('0x45')]['id']}})['then'](handleEntityNotFound(_0x313a00,null))['then'](function(_0x30731a){if(_0x30731a){_0x586792=_0x30731a;_0xf5f6d0[_0x8217('0x2d')]=_[_0x8217('0x40')](db[_0x8217('0x47')][_0x8217('0x29')]);_0xf5f6d0[_0x8217('0x2e')]=_[_0x8217('0x40')](_0x471f1b['query']);_0xf5f6d0[_0x8217('0x2f')]=_[_0x8217('0x30')](_0xf5f6d0[_0x8217('0x2d')],_0xf5f6d0[_0x8217('0x2e')]);_0x1bc89d[_0x8217('0x31')]=_[_0x8217('0x30')](_0xf5f6d0[_0x8217('0x2d')],qs['fields'](_0x471f1b['query'][_0x8217('0x32')]));_0x1bc89d[_0x8217('0x31')]=_0x1bc89d[_0x8217('0x31')][_0x8217('0x33')]?_0x1bc89d[_0x8217('0x31')]:_0xf5f6d0[_0x8217('0x2d')];_0x1bc89d[_0x8217('0x4a')]=qs[_0x8217('0x35')](_0x471f1b[_0x8217('0x2e')]['sort']);_0x1bc89d[_0x8217('0x36')]=qs['filters'](_['pick'](_0x471f1b[_0x8217('0x2e')],_0xf5f6d0[_0x8217('0x2f')]));if(_0x471f1b[_0x8217('0x2e')][_0x8217('0x38')]){_0x1bc89d[_0x8217('0x36')]=_[_0x8217('0x3a')](_0x1bc89d[_0x8217('0x36')],{'$or':_['map'](_0x1bc89d[_0x8217('0x31')],function(_0x5bc565){var _0x43c3e1={};_0x43c3e1[_0x5bc565]={'$like':'%'+_0x471f1b[_0x8217('0x2e')][_0x8217('0x38')]+'%'};return _0x43c3e1;})});}_0x1bc89d=_[_0x8217('0x3a')]({},_0x1bc89d,_0x471f1b[_0x8217('0x3b')]);return _0x586792[_0x8217('0x4b')](_0x1bc89d);}})[_0x8217('0x21')](function(_0x2430d7){if(_0x2430d7){_0x43e1f2=_0x2430d7[_0x8217('0x33')];if(!_0x471f1b['query']['hasOwnProperty'](_0x8217('0x34'))){_0x1bc89d[_0x8217('0x1a')]=qs['limit'](_0x471f1b[_0x8217('0x2e')]['limit']);_0x1bc89d[_0x8217('0x18')]=qs[_0x8217('0x18')](_0x471f1b[_0x8217('0x2e')][_0x8217('0x18')]);}return _0x586792['getDescriptions'](_0x1bc89d);}})[_0x8217('0x21')](function(_0xd683cd){if(_0xd683cd){return _0xd683cd?{'count':_0x43e1f2,'rows':_0xd683cd}:null;}})[_0x8217('0x21')](respondWithResult(_0x313a00,null))[_0x8217('0x3e')](handleError(_0x313a00,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index b694295..a6feec2 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 _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xc492a3,_0x2b42ee){_0xc492a3=_0xc492a3-0x0;var _0x414593=_0x6f0d[_0xc492a3];return _0x414593;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x14dc4a,_0x4ebb82){var _0x11db59=function(_0x50a776){while(--_0x50a776){_0x14dc4a['push'](_0x14dc4a['shift']());}};_0x11db59(++_0x4ebb82);}(_0x9f62,0x154));var _0x29f6=function(_0x539a5e,_0x4ba728){_0x539a5e=_0x539a5e-0x0;var _0x5821e7=_0x9f62[_0x539a5e];return _0x5821e7;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 359c207..03abf6e 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 _0xd29d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x16255a,_0x5782ae){var _0x407788=function(_0x16ae42){while(--_0x16ae42){_0x16255a['push'](_0x16255a['shift']());}};_0x407788(++_0x5782ae);}(_0xd29d,0x124));var _0xdd29=function(_0x2e9443,_0x1bd92d){_0x2e9443=_0x2e9443-0x0;var _0x56851b=_0xd29d[_0x2e9443];return _0x56851b;};'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'))(_0xdd29('0x8'));var config=require(_0xdd29('0x9'));var jayson=require(_0xdd29('0xa'));var client=jayson[_0xdd29('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57dd44,_0x457e52,_0x5ca71c){return new BPromise(function(_0x461dc9,_0x3b225c){return client['request'](_0x57dd44,_0x5ca71c)[_0xdd29('0xc')](function(_0x50e842){logger[_0xdd29('0xd')](_0xdd29('0xe'),_0x457e52,_0xdd29('0xf'));logger[_0xdd29('0x10')](_0xdd29('0x11'),_0x457e52,_0xdd29('0xf'),JSON['stringify'](_0x50e842));if(_0x50e842[_0xdd29('0x12')]){if(_0x50e842['error'][_0xdd29('0x13')]===0x1f4){logger[_0xdd29('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x457e52,_0x50e842['error']['message']);return _0x3b225c(_0x50e842[_0xdd29('0x12')]['message']);}logger[_0xdd29('0x12')](_0xdd29('0xe'),_0x457e52,_0x50e842['error']['message']);return _0x461dc9(_0x50e842[_0xdd29('0x12')][_0xdd29('0x14')]);}else{logger[_0xdd29('0xd')](_0xdd29('0xe'),_0x457e52,_0xdd29('0xf'));_0x461dc9(_0x50e842[_0xdd29('0x15')][_0xdd29('0x14')]);}})[_0xdd29('0x16')](function(_0x4f2dc9){logger['error'](_0xdd29('0xe'),_0x457e52,_0x4f2dc9);_0x3b225c(_0x4f2dc9);});});} \ No newline at end of file +var _0xf8ee=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xc4a935,_0x343a56){var _0x5724c3=function(_0xfbf1c0){while(--_0xfbf1c0){_0xc4a935['push'](_0xc4a935['shift']());}};_0x5724c3(++_0x343a56);}(_0xf8ee,0x80));var _0xef8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf8ee[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xef8e('0x0'));var util=require(_0xef8e('0x1'));var moment=require(_0xef8e('0x2'));var BPromise=require(_0xef8e('0x3'));var rs=require(_0xef8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef8e('0x5'));var logger=require(_0xef8e('0x6'))(_0xef8e('0x7'));var config=require('../../config/environment');var jayson=require(_0xef8e('0x8'));var client=jayson['client'][_0xef8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfeea55,_0x40bbc3,_0x564af8){return new BPromise(function(_0x2e9332,_0x3d41c9){return client[_0xef8e('0xa')](_0xfeea55,_0x564af8)['then'](function(_0x2d9505){logger[_0xef8e('0xb')](_0xef8e('0xc'),_0x40bbc3,_0xef8e('0xd'));logger[_0xef8e('0xe')](_0xef8e('0xf'),_0x40bbc3,_0xef8e('0xd'),JSON[_0xef8e('0x10')](_0x2d9505));if(_0x2d9505['error']){if(_0x2d9505[_0xef8e('0x11')]['code']===0x1f4){logger[_0xef8e('0x11')](_0xef8e('0xc'),_0x40bbc3,_0x2d9505[_0xef8e('0x11')]['message']);return _0x3d41c9(_0x2d9505[_0xef8e('0x11')][_0xef8e('0x12')]);}logger[_0xef8e('0x11')](_0xef8e('0xc'),_0x40bbc3,_0x2d9505[_0xef8e('0x11')][_0xef8e('0x12')]);return _0x2e9332(_0x2d9505[_0xef8e('0x11')][_0xef8e('0x12')]);}else{logger['info'](_0xef8e('0xc'),_0x40bbc3,_0xef8e('0xd'));_0x2e9332(_0x2d9505[_0xef8e('0x13')][_0xef8e('0x12')]);}})[_0xef8e('0x14')](function(_0x19a7c8){logger[_0xef8e('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40bbc3,_0x19a7c8);_0x3d41c9(_0x19a7c8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index b2f1eac..e43ceff 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 _0x0fa0=['update','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','get','show','post','isAuthenticated','create','/:id'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0fa0,0x1d1));var _0x00fa=function(_0x3457c0,_0xb2f8ba){_0x3457c0=_0x3457c0-0x0;var _0x3de9b9=_0x0fa0[_0x3457c0];return _0x3de9b9;};'use strict';var multer=require(_0x00fa('0x0'));var util=require(_0x00fa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x00fa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x00fa('0x3'));var interaction=require(_0x00fa('0x4'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x00fa('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x00fa('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x00fa('0x6')]);router[_0x00fa('0x7')]('/',auth[_0x00fa('0x8')](),controller[_0x00fa('0x9')]);router['put'](_0x00fa('0xa'),auth['isAuthenticated'](),controller[_0x00fa('0xb')]);router['delete'](_0x00fa('0xa'),auth[_0x00fa('0x8')](),controller[_0x00fa('0xc')]);module[_0x00fa('0xd')]=router; \ No newline at end of file +var _0xb026=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','create','put','/:id'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0xb026,0x12a));var _0x6b02=function(_0x527a20,_0x347399){_0x527a20=_0x527a20-0x0;var _0x21f5e0=_0xb026[_0x527a20];return _0x21f5e0;};'use strict';var multer=require(_0x6b02('0x0'));var util=require(_0x6b02('0x1'));var path=require(_0x6b02('0x2'));var timeout=require(_0x6b02('0x3'));var express=require(_0x6b02('0x4'));var router=express[_0x6b02('0x5')]();var fs_extra=require(_0x6b02('0x6'));var auth=require(_0x6b02('0x7'));var interaction=require(_0x6b02('0x8'));var config=require(_0x6b02('0x9'));var controller=require(_0x6b02('0xa'));router[_0x6b02('0xb')]('/',auth[_0x6b02('0xc')](),controller[_0x6b02('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6b02('0xc')](),controller[_0x6b02('0xe')]);router[_0x6b02('0xf')](_0x6b02('0x10'),auth['isAuthenticated'](),controller[_0x6b02('0x11')]);router[_0x6b02('0x12')](_0x6b02('0x10'),auth['isAuthenticated'](),controller[_0x6b02('0x13')]);module[_0x6b02('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 62d78aa..bb458d3 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 _0x9211=['string','STRING','ENUM','variable','customVariable','exports','picklist'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x9211,0x91));var _0x1921=function(_0x1debbd,_0x4bd739){_0x1debbd=_0x1debbd-0x0;var _0x40c66d=_0x9211[_0x1debbd];return _0x40c66d;};'use strict';var Sequelize=require('sequelize');module[_0x1921('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue',_0x1921('0x1')),'defaultValue':_0x1921('0x2')},'content':{'type':Sequelize[_0x1921('0x3')]},'key':{'type':Sequelize[_0x1921('0x3')]},'keyType':{'type':Sequelize[_0x1921('0x4')](_0x1921('0x2'),_0x1921('0x5'),_0x1921('0x6'))},'keyContent':{'type':Sequelize[_0x1921('0x3')]},'idField':{'type':Sequelize[_0x1921('0x3')]},'nameField':{'type':Sequelize[_0x1921('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1921('0x3')]}}; \ No newline at end of file +var _0x62f5=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0xf55250,_0x288fca){var _0x379237=function(_0x5cd0d7){while(--_0x5cd0d7){_0xf55250['push'](_0xf55250['shift']());}};_0x379237(++_0x288fca);}(_0x62f5,0x1df));var _0x562f=function(_0x5bbcce,_0x5b3d0f){_0x5bbcce=_0x5bbcce-0x0;var _0x3d955b=_0x62f5[_0x5bbcce];return _0x3d955b;};'use strict';var Sequelize=require(_0x562f('0x0'));module[_0x562f('0x1')]={'type':{'type':Sequelize[_0x562f('0x2')](_0x562f('0x3'),_0x562f('0x4'),_0x562f('0x5'),_0x562f('0x6'),_0x562f('0x7')),'defaultValue':_0x562f('0x3')},'content':{'type':Sequelize[_0x562f('0x8')]},'key':{'type':Sequelize[_0x562f('0x8')]},'keyType':{'type':Sequelize[_0x562f('0x2')](_0x562f('0x3'),_0x562f('0x4'),_0x562f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x562f('0x8')]},'customField':{'type':Sequelize[_0x562f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x562f('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 1e887fb..32fe30c 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 _0xf757=['options','includeAll','findAll','rows','catch','show','include','find','create','body','update','params','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','reject','save','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','pick','filters','filter','where','merge'];(function(_0x422e6d,_0x14a384){var _0xbf291c=function(_0xb67019){while(--_0xb67019){_0x422e6d['push'](_0x422e6d['shift']());}};_0xbf291c(++_0x14a384);}(_0xf757,0x160));var _0x7f75=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0xf757[_0x1857c6];return _0x51011c;};'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(_0x7f75('0x0'));var moment=require(_0x7f75('0x1'));var BPromise=require(_0x7f75('0x2'));var Mustache=require(_0x7f75('0x3'));var util=require('util');var path=require('path');var sox=require(_0x7f75('0x4'));var csv=require('to-csv');var ejs=require(_0x7f75('0x5'));var fs=require('fs');var fs_extra=require(_0x7f75('0x6'));var _=require('lodash');var squel=require(_0x7f75('0x7'));var crypto=require('crypto');var jsforce=require(_0x7f75('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x7f75('0x9'));var querystring=require(_0x7f75('0xa'));var Papa=require(_0x7f75('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7f75('0xc'));var as=require(_0x7f75('0xd'));var hardwareService=require(_0x7f75('0xe'));var logger=require(_0x7f75('0xf'))(_0x7f75('0x10'));var utils=require(_0x7f75('0x11'));var config=require(_0x7f75('0x12'));var licenseUtil=require(_0x7f75('0x13'));var db=require(_0x7f75('0x14'))['db'];function respondWithStatusCode(_0x359de0,_0x42fe72){_0x42fe72=_0x42fe72||0xcc;return function(_0x2a003f){if(_0x2a003f){return _0x359de0[_0x7f75('0x15')](_0x42fe72);}return _0x359de0['status'](_0x42fe72)[_0x7f75('0x16')]();};}function respondWithResult(_0x5f4ad8,_0x1e9768){_0x1e9768=_0x1e9768||0xc8;return function(_0x3850d0){if(_0x3850d0){return _0x5f4ad8[_0x7f75('0x17')](_0x1e9768)[_0x7f75('0x18')](_0x3850d0);}};}function respondWithFilteredResult(_0x5732b4,_0x136e03){return function(_0x4fac72){if(_0x4fac72){var _0x40d690=typeof _0x136e03[_0x7f75('0x19')]===_0x7f75('0x1a')&&typeof _0x136e03['limit']==='undefined';var _0x2bec76=_0x4fac72['count'];var _0x210875=_0x40d690?0x0:_0x136e03['offset'];var _0x564374=_0x40d690?_0x4fac72[_0x7f75('0x1b')]:_0x136e03['offset']+_0x136e03[_0x7f75('0x1c')];var _0x262cee;if(_0x564374>=_0x2bec76){_0x564374=_0x2bec76;_0x262cee=0xc8;}else{_0x262cee=0xce;}_0x5732b4[_0x7f75('0x17')](_0x262cee);return _0x5732b4['set']('Content-Range',_0x210875+'-'+_0x564374+'/'+_0x2bec76)[_0x7f75('0x18')](_0x4fac72);}return null;};}function patchUpdates(_0x5abf87){return function(_0x2c3fc7){try{jsonpatch['apply'](_0x2c3fc7,_0x5abf87,!![]);}catch(_0x5c9998){return BPromise[_0x7f75('0x1d')](_0x5c9998);}return _0x2c3fc7[_0x7f75('0x1e')]();};}function saveUpdates(_0x19a1bb,_0x1f1624){return function(_0x2a6c92){if(_0x2a6c92){return _0x2a6c92['update'](_0x19a1bb)[_0x7f75('0x1f')](function(_0x46ffda){return _0x46ffda;});}return null;};}function removeEntity(_0x177052,_0x4e9b38){return function(_0x4e5e34){if(_0x4e5e34){return _0x4e5e34[_0x7f75('0x20')]()[_0x7f75('0x1f')](function(){_0x177052[_0x7f75('0x17')](0xcc)[_0x7f75('0x16')]();});}};}function handleEntityNotFound(_0x1e6294,_0x265481){return function(_0x3ee825){if(!_0x3ee825){_0x1e6294[_0x7f75('0x15')](0x194);}return _0x3ee825;};}function handleError(_0x1c6063,_0xaa3a51){_0xaa3a51=_0xaa3a51||0x1f4;return function(_0x4289af){logger[_0x7f75('0x21')](_0x4289af['stack']);if(_0x4289af['name']){delete _0x4289af[_0x7f75('0x22')];}_0x1c6063[_0x7f75('0x17')](_0xaa3a51)[_0x7f75('0x23')](_0x4289af);};}exports[_0x7f75('0x24')]=function(_0x5b17a7,_0x3cded0){var _0x49c759={},_0x1318aa={},_0x25417f={'count':0x0,'rows':[]};var _0xd7fcbf=_[_0x7f75('0x25')](db[_0x7f75('0x26')][_0x7f75('0x27')],function(_0x19e7ac){return{'name':_0x19e7ac['fieldName'],'type':_0x19e7ac[_0x7f75('0x28')][_0x7f75('0x29')]};});_0x1318aa[_0x7f75('0x2a')]=_[_0x7f75('0x25')](_0xd7fcbf,_0x7f75('0x22'));_0x1318aa[_0x7f75('0x2b')]=_[_0x7f75('0x2c')](_0x5b17a7[_0x7f75('0x2b')]);_0x1318aa['filters']=_[_0x7f75('0x2d')](_0x1318aa[_0x7f75('0x2a')],_0x1318aa[_0x7f75('0x2b')]);_0x49c759[_0x7f75('0x2e')]=_['intersection'](_0x1318aa[_0x7f75('0x2a')],qs[_0x7f75('0x2f')](_0x5b17a7['query'][_0x7f75('0x2f')]));_0x49c759[_0x7f75('0x2e')]=_0x49c759['attributes'][_0x7f75('0x30')]?_0x49c759[_0x7f75('0x2e')]:_0x1318aa['model'];if(!_0x5b17a7[_0x7f75('0x2b')]['hasOwnProperty'](_0x7f75('0x31'))){_0x49c759[_0x7f75('0x1c')]=qs[_0x7f75('0x1c')](_0x5b17a7[_0x7f75('0x2b')][_0x7f75('0x1c')]);_0x49c759[_0x7f75('0x19')]=qs[_0x7f75('0x19')](_0x5b17a7[_0x7f75('0x2b')]['offset']);}_0x49c759['order']=qs[_0x7f75('0x32')](_0x5b17a7[_0x7f75('0x2b')][_0x7f75('0x32')]);_0x49c759['where']=qs['filters'](_[_0x7f75('0x33')](_0x5b17a7[_0x7f75('0x2b')],_0x1318aa[_0x7f75('0x34')]),_0xd7fcbf);if(_0x5b17a7[_0x7f75('0x2b')][_0x7f75('0x35')]){_0x49c759[_0x7f75('0x36')]=_[_0x7f75('0x37')](_0x49c759['where'],{'$or':_[_0x7f75('0x25')](_0xd7fcbf,function(_0x2dcf39){if(_0x2dcf39[_0x7f75('0x28')]!=='VIRTUAL'){var _0x446739={};_0x446739[_0x2dcf39[_0x7f75('0x22')]]={'$like':'%'+_0x5b17a7[_0x7f75('0x2b')][_0x7f75('0x35')]+'%'};return _0x446739;}})});}_0x49c759=_['merge']({},_0x49c759,_0x5b17a7[_0x7f75('0x38')]);var _0x5f5556={'where':_0x49c759['where']};return db[_0x7f75('0x26')][_0x7f75('0x1b')](_0x5f5556)[_0x7f75('0x1f')](function(_0x5b382b){_0x25417f[_0x7f75('0x1b')]=_0x5b382b;if(_0x5b17a7[_0x7f75('0x2b')][_0x7f75('0x39')]){_0x49c759['include']=[{'all':!![]}];}return db[_0x7f75('0x26')][_0x7f75('0x3a')](_0x49c759);})[_0x7f75('0x1f')](function(_0x57c4d1){_0x25417f[_0x7f75('0x3b')]=_0x57c4d1;return _0x25417f;})[_0x7f75('0x1f')](respondWithFilteredResult(_0x3cded0,_0x49c759))[_0x7f75('0x3c')](handleError(_0x3cded0,null));};exports[_0x7f75('0x3d')]=function(_0xc7fa3b,_0x3eddf2){var _0x263b07={'raw':!![],'where':{'id':_0xc7fa3b['params']['id']}},_0x2cc584={};_0x2cc584[_0x7f75('0x2a')]=_[_0x7f75('0x2c')](db[_0x7f75('0x26')][_0x7f75('0x27')]);_0x2cc584[_0x7f75('0x2b')]=_[_0x7f75('0x2c')](_0xc7fa3b[_0x7f75('0x2b')]);_0x2cc584[_0x7f75('0x34')]=_[_0x7f75('0x2d')](_0x2cc584[_0x7f75('0x2a')],_0x2cc584[_0x7f75('0x2b')]);_0x263b07[_0x7f75('0x2e')]=_[_0x7f75('0x2d')](_0x2cc584['model'],qs[_0x7f75('0x2f')](_0xc7fa3b[_0x7f75('0x2b')][_0x7f75('0x2f')]));_0x263b07[_0x7f75('0x2e')]=_0x263b07['attributes'][_0x7f75('0x30')]?_0x263b07['attributes']:_0x2cc584['model'];if(_0xc7fa3b[_0x7f75('0x2b')][_0x7f75('0x39')]){_0x263b07[_0x7f75('0x3e')]=[{'all':!![]}];}_0x263b07=_[_0x7f75('0x37')]({},_0x263b07,_0xc7fa3b[_0x7f75('0x38')]);return db[_0x7f75('0x26')][_0x7f75('0x3f')](_0x263b07)[_0x7f75('0x1f')](handleEntityNotFound(_0x3eddf2,null))['then'](respondWithResult(_0x3eddf2,null))[_0x7f75('0x3c')](handleError(_0x3eddf2,null));};exports[_0x7f75('0x40')]=function(_0x5916ab,_0x5eef1d){return db['Dynamics365Field'][_0x7f75('0x40')](_0x5916ab[_0x7f75('0x41')],{})[_0x7f75('0x1f')](respondWithResult(_0x5eef1d,0xc9))[_0x7f75('0x3c')](handleError(_0x5eef1d,null));};exports[_0x7f75('0x42')]=function(_0x5df5f6,_0x4a119b){if(_0x5df5f6['body']['id']){delete _0x5df5f6[_0x7f75('0x41')]['id'];}return db['Dynamics365Field'][_0x7f75('0x3f')]({'where':{'id':_0x5df5f6[_0x7f75('0x43')]['id']}})[_0x7f75('0x1f')](handleEntityNotFound(_0x4a119b,null))['then'](saveUpdates(_0x5df5f6['body'],null))[_0x7f75('0x1f')](respondWithResult(_0x4a119b,null))[_0x7f75('0x3c')](handleError(_0x4a119b,null));};exports[_0x7f75('0x20')]=function(_0x300e80,_0x1effbc){return db[_0x7f75('0x26')]['find']({'where':{'id':_0x300e80[_0x7f75('0x43')]['id']}})[_0x7f75('0x1f')](handleEntityNotFound(_0x1effbc,null))[_0x7f75('0x1f')](removeEntity(_0x1effbc,null))[_0x7f75('0x3c')](handleError(_0x1effbc,null));}; \ No newline at end of file +var _0xd766=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x541ebd,_0x594de1){var _0x312623=function(_0x2ff4c1){while(--_0x2ff4c1){_0x541ebd['push'](_0x541ebd['shift']());}};_0x312623(++_0x594de1);}(_0xd766,0x1b2));var _0x6d76=function(_0x53417c,_0x126dee){_0x53417c=_0x53417c-0x0;var _0x49407d=_0xd766[_0x53417c];return _0x49407d;};'use strict';var emlformat=require(_0x6d76('0x0'));var rimraf=require(_0x6d76('0x1'));var zipdir=require(_0x6d76('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d76('0x3'));var moment=require(_0x6d76('0x4'));var BPromise=require(_0x6d76('0x5'));var Mustache=require(_0x6d76('0x6'));var util=require('util');var path=require(_0x6d76('0x7'));var sox=require('sox');var csv=require(_0x6d76('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d76('0x9'));var _=require(_0x6d76('0xa'));var squel=require(_0x6d76('0xb'));var crypto=require(_0x6d76('0xc'));var jsforce=require(_0x6d76('0xd'));var deskjs=require(_0x6d76('0xe'));var toCsv=require(_0x6d76('0x8'));var querystring=require(_0x6d76('0xf'));var Papa=require(_0x6d76('0x10'));var Redis=require(_0x6d76('0x11'));var authService=require(_0x6d76('0x12'));var qs=require(_0x6d76('0x13'));var as=require(_0x6d76('0x14'));var hardwareService=require(_0x6d76('0x15'));var logger=require(_0x6d76('0x16'))(_0x6d76('0x17'));var utils=require(_0x6d76('0x18'));var config=require(_0x6d76('0x19'));var licenseUtil=require(_0x6d76('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e3528,_0x426eae){_0x426eae=_0x426eae||0xcc;return function(_0x400010){if(_0x400010){return _0x3e3528[_0x6d76('0x1b')](_0x426eae);}return _0x3e3528[_0x6d76('0x1c')](_0x426eae)['end']();};}function respondWithResult(_0x32b8d1,_0x1a309e){_0x1a309e=_0x1a309e||0xc8;return function(_0x34b974){if(_0x34b974){return _0x32b8d1['status'](_0x1a309e)[_0x6d76('0x1d')](_0x34b974);}};}function respondWithFilteredResult(_0x54f681,_0x2d9a4c){return function(_0x1c716e){if(_0x1c716e){var _0x171254=typeof _0x2d9a4c[_0x6d76('0x1e')]===_0x6d76('0x1f')&&typeof _0x2d9a4c[_0x6d76('0x20')]===_0x6d76('0x1f');var _0x535ef2=_0x1c716e[_0x6d76('0x21')];var _0x460529=_0x171254?0x0:_0x2d9a4c[_0x6d76('0x1e')];var _0x2a1345=_0x171254?_0x1c716e[_0x6d76('0x21')]:_0x2d9a4c[_0x6d76('0x1e')]+_0x2d9a4c['limit'];var _0x2fcd02;if(_0x2a1345>=_0x535ef2){_0x2a1345=_0x535ef2;_0x2fcd02=0xc8;}else{_0x2fcd02=0xce;}_0x54f681[_0x6d76('0x1c')](_0x2fcd02);return _0x54f681[_0x6d76('0x22')](_0x6d76('0x23'),_0x460529+'-'+_0x2a1345+'/'+_0x535ef2)[_0x6d76('0x1d')](_0x1c716e);}return null;};}function patchUpdates(_0x16fa68){return function(_0x104926){try{jsonpatch[_0x6d76('0x24')](_0x104926,_0x16fa68,!![]);}catch(_0x43c55f){return BPromise[_0x6d76('0x25')](_0x43c55f);}return _0x104926[_0x6d76('0x26')]();};}function saveUpdates(_0x33e76e,_0x51ac17){return function(_0x38f167){if(_0x38f167){return _0x38f167[_0x6d76('0x27')](_0x33e76e)[_0x6d76('0x28')](function(_0x46d5e4){return _0x46d5e4;});}return null;};}function removeEntity(_0x174356,_0x5f3ce5){return function(_0x516602){if(_0x516602){return _0x516602[_0x6d76('0x29')]()[_0x6d76('0x28')](function(){_0x174356['status'](0xcc)[_0x6d76('0x2a')]();});}};}function handleEntityNotFound(_0x10334c,_0x4a6427){return function(_0x118df7){if(!_0x118df7){_0x10334c[_0x6d76('0x1b')](0x194);}return _0x118df7;};}function handleError(_0x56003,_0x3480b7){_0x3480b7=_0x3480b7||0x1f4;return function(_0xb5e0e0){logger['error'](_0xb5e0e0[_0x6d76('0x2b')]);if(_0xb5e0e0[_0x6d76('0x2c')]){delete _0xb5e0e0[_0x6d76('0x2c')];}_0x56003[_0x6d76('0x1c')](_0x3480b7)[_0x6d76('0x2d')](_0xb5e0e0);};}exports[_0x6d76('0x2e')]=function(_0x146e7e,_0x509147){var _0x3a6b2d={},_0x1ff433={},_0x599df5={'count':0x0,'rows':[]};var _0x212a9d=_[_0x6d76('0x2f')](db[_0x6d76('0x30')][_0x6d76('0x31')],function(_0x8bfb93){return{'name':_0x8bfb93['fieldName'],'type':_0x8bfb93[_0x6d76('0x32')]['key']};});_0x1ff433['model']=_[_0x6d76('0x2f')](_0x212a9d,_0x6d76('0x2c'));_0x1ff433[_0x6d76('0x33')]=_[_0x6d76('0x34')](_0x146e7e[_0x6d76('0x33')]);_0x1ff433[_0x6d76('0x35')]=_[_0x6d76('0x36')](_0x1ff433['model'],_0x1ff433[_0x6d76('0x33')]);_0x3a6b2d[_0x6d76('0x37')]=_['intersection'](_0x1ff433['model'],qs[_0x6d76('0x38')](_0x146e7e[_0x6d76('0x33')][_0x6d76('0x38')]));_0x3a6b2d[_0x6d76('0x37')]=_0x3a6b2d[_0x6d76('0x37')][_0x6d76('0x39')]?_0x3a6b2d[_0x6d76('0x37')]:_0x1ff433[_0x6d76('0x3a')];if(!_0x146e7e[_0x6d76('0x33')][_0x6d76('0x3b')](_0x6d76('0x3c'))){_0x3a6b2d['limit']=qs[_0x6d76('0x20')](_0x146e7e[_0x6d76('0x33')]['limit']);_0x3a6b2d[_0x6d76('0x1e')]=qs[_0x6d76('0x1e')](_0x146e7e['query']['offset']);}_0x3a6b2d[_0x6d76('0x3d')]=qs['sort'](_0x146e7e[_0x6d76('0x33')]['sort']);_0x3a6b2d[_0x6d76('0x3e')]=qs[_0x6d76('0x35')](_[_0x6d76('0x3f')](_0x146e7e[_0x6d76('0x33')],_0x1ff433[_0x6d76('0x35')]),_0x212a9d);if(_0x146e7e[_0x6d76('0x33')][_0x6d76('0x40')]){_0x3a6b2d[_0x6d76('0x3e')]=_[_0x6d76('0x41')](_0x3a6b2d['where'],{'$or':_['map'](_0x212a9d,function(_0x170d6d){if(_0x170d6d[_0x6d76('0x32')]!==_0x6d76('0x42')){var _0x5ef65e={};_0x5ef65e[_0x170d6d[_0x6d76('0x2c')]]={'$like':'%'+_0x146e7e['query']['filter']+'%'};return _0x5ef65e;}})});}_0x3a6b2d=_[_0x6d76('0x41')]({},_0x3a6b2d,_0x146e7e[_0x6d76('0x43')]);var _0x8522dd={'where':_0x3a6b2d[_0x6d76('0x3e')]};return db[_0x6d76('0x30')]['count'](_0x8522dd)['then'](function(_0x3d5a27){_0x599df5[_0x6d76('0x21')]=_0x3d5a27;if(_0x146e7e['query'][_0x6d76('0x44')]){_0x3a6b2d[_0x6d76('0x45')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x3a6b2d);})[_0x6d76('0x28')](function(_0x1084af){_0x599df5[_0x6d76('0x46')]=_0x1084af;return _0x599df5;})[_0x6d76('0x28')](respondWithFilteredResult(_0x509147,_0x3a6b2d))[_0x6d76('0x47')](handleError(_0x509147,null));};exports[_0x6d76('0x48')]=function(_0xc7fe07,_0x1a6bc){var _0x1ebff7={'raw':!![],'where':{'id':_0xc7fe07[_0x6d76('0x49')]['id']}},_0x4ee7be={};_0x4ee7be[_0x6d76('0x3a')]=_[_0x6d76('0x34')](db['Dynamics365Field']['rawAttributes']);_0x4ee7be['query']=_[_0x6d76('0x34')](_0xc7fe07['query']);_0x4ee7be['filters']=_[_0x6d76('0x36')](_0x4ee7be[_0x6d76('0x3a')],_0x4ee7be[_0x6d76('0x33')]);_0x1ebff7[_0x6d76('0x37')]=_['intersection'](_0x4ee7be[_0x6d76('0x3a')],qs[_0x6d76('0x38')](_0xc7fe07[_0x6d76('0x33')][_0x6d76('0x38')]));_0x1ebff7[_0x6d76('0x37')]=_0x1ebff7[_0x6d76('0x37')][_0x6d76('0x39')]?_0x1ebff7[_0x6d76('0x37')]:_0x4ee7be['model'];if(_0xc7fe07[_0x6d76('0x33')][_0x6d76('0x44')]){_0x1ebff7[_0x6d76('0x45')]=[{'all':!![]}];}_0x1ebff7=_[_0x6d76('0x41')]({},_0x1ebff7,_0xc7fe07[_0x6d76('0x43')]);return db[_0x6d76('0x30')][_0x6d76('0x4a')](_0x1ebff7)['then'](handleEntityNotFound(_0x1a6bc,null))[_0x6d76('0x28')](respondWithResult(_0x1a6bc,null))['catch'](handleError(_0x1a6bc,null));};exports[_0x6d76('0x4b')]=function(_0xf138b5,_0x485727){return db[_0x6d76('0x30')][_0x6d76('0x4b')](_0xf138b5[_0x6d76('0x4c')],{})[_0x6d76('0x28')](respondWithResult(_0x485727,0xc9))[_0x6d76('0x47')](handleError(_0x485727,null));};exports[_0x6d76('0x27')]=function(_0x16a564,_0x50bcdd){if(_0x16a564[_0x6d76('0x4c')]['id']){delete _0x16a564['body']['id'];}return db[_0x6d76('0x30')][_0x6d76('0x4a')]({'where':{'id':_0x16a564[_0x6d76('0x49')]['id']}})[_0x6d76('0x28')](handleEntityNotFound(_0x50bcdd,null))[_0x6d76('0x28')](saveUpdates(_0x16a564[_0x6d76('0x4c')],null))[_0x6d76('0x28')](respondWithResult(_0x50bcdd,null))[_0x6d76('0x47')](handleError(_0x50bcdd,null));};exports[_0x6d76('0x29')]=function(_0x25b6f0,_0x2f1efb){return db[_0x6d76('0x30')]['find']({'where':{'id':_0x25b6f0[_0x6d76('0x49')]['id']}})[_0x6d76('0x28')](handleEntityNotFound(_0x2f1efb,null))[_0x6d76('0x28')](removeEntity(_0x2f1efb,null))[_0x6d76('0x47')](handleError(_0x2f1efb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2c94196..844804a 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 _0xa1b3=['exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes'];(function(_0x36eb54,_0x13bac4){var _0xc12872=function(_0x186e6e){while(--_0x186e6e){_0x36eb54['push'](_0x36eb54['shift']());}};_0xc12872(++_0x13bac4);}(_0xa1b3,0x13a));var _0x3a1b=function(_0x29623b,_0x3c9021){_0x29623b=_0x29623b-0x0;var _0x1dde62=_0xa1b3[_0x29623b];return _0x1dde62;};'use strict';var _=require('lodash');var util=require(_0x3a1b('0x0'));var logger=require(_0x3a1b('0x1'))(_0x3a1b('0x2'));var moment=require('moment');var BPromise=require(_0x3a1b('0x3'));var rp=require(_0x3a1b('0x4'));var fs=require('fs');var path=require(_0x3a1b('0x5'));var rimraf=require('rimraf');var config=require(_0x3a1b('0x6'));var attributes=require(_0x3a1b('0x7'));module[_0x3a1b('0x8')]=function(_0x143f0b,_0x40df67){return _0x143f0b['define'](_0x3a1b('0x9'),attributes,{'tableName':_0x3a1b('0xa'),'paranoid':![],'indexes':[{'name':_0x3a1b('0xb'),'fields':[_0x3a1b('0xc'),_0x3a1b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x65e2=['../../config/environment','./intDynamics365Field.attributes','exports','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6b1b0e,_0x1123b5){var _0x3967ce=function(_0x465bba){while(--_0x465bba){_0x6b1b0e['push'](_0x6b1b0e['shift']());}};_0x3967ce(++_0x1123b5);}(_0x65e2,0xad));var _0x265e=function(_0x23103a,_0x444e3f){_0x23103a=_0x23103a-0x0;var _0x56bcc6=_0x65e2[_0x23103a];return _0x56bcc6;};'use strict';var _=require(_0x265e('0x0'));var util=require(_0x265e('0x1'));var logger=require(_0x265e('0x2'))(_0x265e('0x3'));var moment=require(_0x265e('0x4'));var BPromise=require(_0x265e('0x5'));var rp=require(_0x265e('0x6'));var fs=require('fs');var path=require(_0x265e('0x7'));var rimraf=require(_0x265e('0x8'));var config=require(_0x265e('0x9'));var attributes=require(_0x265e('0xa'));module[_0x265e('0xb')]=function(_0x44a00f,_0x1e9307){return _0x44a00f['define']('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x265e('0xc'),'fields':['idField',_0x265e('0xd')],'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 c550da3..87cc4da 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 _0x0a59=['../../config/environment','http','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x11fd38,_0x4fd787){var _0x4abe68=function(_0x5245df){while(--_0x5245df){_0x11fd38['push'](_0x11fd38['shift']());}};_0x4abe68(++_0x4fd787);}(_0x0a59,0xe4));var _0x90a5=function(_0x233fa3,_0x482e48){_0x233fa3=_0x233fa3-0x0;var _0x4d80d2=_0x0a59[_0x233fa3];return _0x4d80d2;};'use strict';var _=require(_0x90a5('0x0'));var util=require('util');var moment=require(_0x90a5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90a5('0x3'));var logger=require(_0x90a5('0x4'))(_0x90a5('0x5'));var config=require(_0x90a5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x90a5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6eebfe,_0x470f75,_0x47fab0){return new BPromise(function(_0x3d0790,_0xb267b1){return client['request'](_0x6eebfe,_0x47fab0)[_0x90a5('0x8')](function(_0x1ca2d0){logger[_0x90a5('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x470f75,_0x90a5('0xa'));logger['debug'](_0x90a5('0xb'),_0x470f75,_0x90a5('0xa'),JSON['stringify'](_0x1ca2d0));if(_0x1ca2d0[_0x90a5('0xc')]){if(_0x1ca2d0['error'][_0x90a5('0xd')]===0x1f4){logger[_0x90a5('0xc')](_0x90a5('0xe'),_0x470f75,_0x1ca2d0[_0x90a5('0xc')][_0x90a5('0xf')]);return _0xb267b1(_0x1ca2d0[_0x90a5('0xc')][_0x90a5('0xf')]);}logger[_0x90a5('0xc')](_0x90a5('0xe'),_0x470f75,_0x1ca2d0[_0x90a5('0xc')][_0x90a5('0xf')]);return _0x3d0790(_0x1ca2d0[_0x90a5('0xc')][_0x90a5('0xf')]);}else{logger[_0x90a5('0x9')](_0x90a5('0xe'),_0x470f75,_0x90a5('0xa'));_0x3d0790(_0x1ca2d0[_0x90a5('0x10')][_0x90a5('0xf')]);}})[_0x90a5('0x11')](function(_0x3d0381){logger[_0x90a5('0xc')](_0x90a5('0xe'),_0x470f75,_0x3d0381);_0xb267b1(_0x3d0381);});});} \ No newline at end of file +var _0x29cb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x29cb,0x199));var _0xb29c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x29cb[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0xb29c('0x0'));var moment=require(_0xb29c('0x1'));var BPromise=require(_0xb29c('0x2'));var rs=require(_0xb29c('0x3'));var fs=require('fs');var Redis=require(_0xb29c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb29c('0x5'));var logger=require(_0xb29c('0x6'))('rpc');var config=require(_0xb29c('0x7'));var jayson=require(_0xb29c('0x8'));var client=jayson[_0xb29c('0x9')][_0xb29c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3427e1,_0x24ecdc,_0x15c749){return new BPromise(function(_0x3747a3,_0x387dc5){return client[_0xb29c('0xb')](_0x3427e1,_0x15c749)[_0xb29c('0xc')](function(_0x1ade98){logger[_0xb29c('0xd')](_0xb29c('0xe'),_0x24ecdc,_0xb29c('0xf'));logger[_0xb29c('0x10')](_0xb29c('0x11'),_0x24ecdc,'request\x20sent',JSON[_0xb29c('0x12')](_0x1ade98));if(_0x1ade98[_0xb29c('0x13')]){if(_0x1ade98['error']['code']===0x1f4){logger[_0xb29c('0x13')](_0xb29c('0xe'),_0x24ecdc,_0x1ade98[_0xb29c('0x13')][_0xb29c('0x14')]);return _0x387dc5(_0x1ade98[_0xb29c('0x13')][_0xb29c('0x14')]);}logger[_0xb29c('0x13')](_0xb29c('0xe'),_0x24ecdc,_0x1ade98[_0xb29c('0x13')][_0xb29c('0x14')]);return _0x3747a3(_0x1ade98[_0xb29c('0x13')]['message']);}else{logger[_0xb29c('0xd')](_0xb29c('0xe'),_0x24ecdc,_0xb29c('0xf'));_0x3747a3(_0x1ade98[_0xb29c('0x15')][_0xb29c('0x14')]);}})[_0xb29c('0x16')](function(_0xd94272){logger['error'](_0xb29c('0xe'),_0x24ecdc,_0xd94272);_0x387dc5(_0xd94272);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 61cb4bc..768bafd 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 _0xcc03=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','create','post','addConfiguration','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b2ce1,_0x4c23dd){var _0x24209f=function(_0x471c11){while(--_0x471c11){_0x4b2ce1['push'](_0x4b2ce1['shift']());}};_0x24209f(++_0x4c23dd);}(_0xcc03,0x131));var _0x3cc0=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xcc03[_0x5e6cb8];return _0x3faeb3;};'use strict';var multer=require(_0x3cc0('0x0'));var util=require(_0x3cc0('0x1'));var path=require(_0x3cc0('0x2'));var timeout=require('connect-timeout');var express=require(_0x3cc0('0x3'));var router=express[_0x3cc0('0x4')]();var fs_extra=require(_0x3cc0('0x5'));var auth=require(_0x3cc0('0x6'));var interaction=require(_0x3cc0('0x7'));var config=require(_0x3cc0('0x8'));var controller=require(_0x3cc0('0x9'));router[_0x3cc0('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3cc0('0xa')](_0x3cc0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3cc0('0xa')](_0x3cc0('0xc'),auth['isAuthenticated'](),controller[_0x3cc0('0xd')]);router[_0x3cc0('0xa')](_0x3cc0('0xe'),auth[_0x3cc0('0xf')](),controller[_0x3cc0('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3cc0('0x11')]);router[_0x3cc0('0x12')]('/:id/configurations',auth[_0x3cc0('0xf')](),controller[_0x3cc0('0x13')]);router[_0x3cc0('0x14')]('/:id',auth[_0x3cc0('0xf')](),controller[_0x3cc0('0x15')]);router[_0x3cc0('0x16')](_0x3cc0('0xb'),auth[_0x3cc0('0xf')](),controller['destroy']);module[_0x3cc0('0x17')]=router; \ No newline at end of file +var _0xd41a=['index','/:id/configurations','getConfigurations','isAuthenticated','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x3a826f,_0x47b9a1){var _0x14d1b0=function(_0x51e878){while(--_0x51e878){_0x3a826f['push'](_0x3a826f['shift']());}};_0x14d1b0(++_0x47b9a1);}(_0xd41a,0x1c2));var _0xad41=function(_0x3f0b15,_0x29a0c6){_0x3f0b15=_0x3f0b15-0x0;var _0x371196=_0xd41a[_0x3f0b15];return _0x371196;};'use strict';var multer=require('multer');var util=require(_0xad41('0x0'));var path=require(_0xad41('0x1'));var timeout=require(_0xad41('0x2'));var express=require(_0xad41('0x3'));var router=express[_0xad41('0x4')]();var fs_extra=require(_0xad41('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xad41('0x6'));var config=require(_0xad41('0x7'));var controller=require(_0xad41('0x8'));router[_0xad41('0x9')]('/',auth['isAuthenticated'](),controller[_0xad41('0xa')]);router[_0xad41('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xad41('0x9')](_0xad41('0xb'),auth['isAuthenticated'](),controller[_0xad41('0xc')]);router['get']('/:id/fields',auth[_0xad41('0xd')](),controller[_0xad41('0xe')]);router[_0xad41('0xf')]('/',auth[_0xad41('0xd')](),controller['create']);router[_0xad41('0xf')](_0xad41('0xb'),auth[_0xad41('0xd')](),controller[_0xad41('0x10')]);router[_0xad41('0x11')](_0xad41('0x12'),auth[_0xad41('0xd')](),controller[_0xad41('0x13')]);router[_0xad41('0x14')](_0xad41('0x12'),auth[_0xad41('0xd')](),controller[_0xad41('0x15')]);module[_0xad41('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 73500d7..3cf0aa1 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 _0x6a95=['exports','STRING','username','sequelize'];(function(_0x47faad,_0x230b04){var _0x4c449a=function(_0x426c7e){while(--_0x426c7e){_0x47faad['push'](_0x47faad['shift']());}};_0x4c449a(++_0x230b04);}(_0x6a95,0x1db));var _0x56a9=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x6a95[_0x53cf8e];return _0x459197;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'name':{'type':Sequelize[_0x56a9('0x2')]},'description':{'type':Sequelize[_0x56a9('0x2')]},'username':{'type':Sequelize[_0x56a9('0x2')],'unique':_0x56a9('0x3')},'apiKey':{'type':Sequelize[_0x56a9('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a9('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd824=['exports','STRING','username','remoteUri','sequelize'];(function(_0x20448a,_0x23db6b){var _0x10f231=function(_0x16c0fb){while(--_0x16c0fb){_0x20448a['push'](_0x20448a['shift']());}};_0x10f231(++_0x23db6b);}(_0xd824,0xc2));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4d82('0x0'));module[_0x4d82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x3')},'apiKey':{'type':Sequelize[_0x4d82('0x2')]},'remoteUri':{'type':Sequelize[_0x4d82('0x2')],'unique':_0x4d82('0x4')},'serverUrl':{'type':Sequelize[_0x4d82('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ce2046f..ab5dfb0 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 _0x6146=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','find','catch','create','body','params','destroy','findOne','FreshdeskConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','apiKey','slice','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','requester','agent','description','priority','group','ticket_type','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query'];(function(_0x1c8885,_0x504445){var _0x413090=function(_0x2bb5ea){while(--_0x2bb5ea){_0x1c8885['push'](_0x1c8885['shift']());}};_0x413090(++_0x504445);}(_0x6146,0xba));var _0x6614=function(_0x3aa685,_0x575665){_0x3aa685=_0x3aa685-0x0;var _0x15d571=_0x6146[_0x3aa685];return _0x15d571;};'use strict';var emlformat=require(_0x6614('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6614('0x1'));var jsonpatch=require(_0x6614('0x2'));var rp=require(_0x6614('0x3'));var moment=require(_0x6614('0x4'));var BPromise=require(_0x6614('0x5'));var Mustache=require(_0x6614('0x6'));var util=require(_0x6614('0x7'));var path=require('path');var sox=require(_0x6614('0x8'));var csv=require(_0x6614('0x9'));var ejs=require(_0x6614('0xa'));var fs=require('fs');var fs_extra=require(_0x6614('0xb'));var _=require(_0x6614('0xc'));var squel=require(_0x6614('0xd'));var crypto=require(_0x6614('0xe'));var jsforce=require(_0x6614('0xf'));var deskjs=require(_0x6614('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6614('0x11'));var Papa=require(_0x6614('0x12'));var Redis=require(_0x6614('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6614('0x14'));var as=require(_0x6614('0x15'));var hardwareService=require(_0x6614('0x16'));var logger=require(_0x6614('0x17'))(_0x6614('0x18'));var utils=require(_0x6614('0x19'));var config=require(_0x6614('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6614('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3550a7,_0x11b16b){_0x11b16b=_0x11b16b||0xcc;return function(_0x167486){if(_0x167486){return _0x3550a7[_0x6614('0x1c')](_0x11b16b);}return _0x3550a7[_0x6614('0x1d')](_0x11b16b)[_0x6614('0x1e')]();};}function respondWithResult(_0x1bae1d,_0x288cd7){_0x288cd7=_0x288cd7||0xc8;return function(_0x156281){if(_0x156281){return _0x1bae1d['status'](_0x288cd7)['json'](_0x156281);}};}function respondWithFilteredResult(_0x219365,_0x40a008){return function(_0x5e933f){if(_0x5e933f){var _0x15a983=typeof _0x40a008[_0x6614('0x1f')]===_0x6614('0x20')&&typeof _0x40a008['limit']===_0x6614('0x20');var _0x37fa8f=_0x5e933f[_0x6614('0x21')];var _0x5f1f8e=_0x15a983?0x0:_0x40a008['offset'];var _0x2e843e=_0x15a983?_0x5e933f[_0x6614('0x21')]:_0x40a008[_0x6614('0x1f')]+_0x40a008[_0x6614('0x22')];var _0x491d88;if(_0x2e843e>=_0x37fa8f){_0x2e843e=_0x37fa8f;_0x491d88=0xc8;}else{_0x491d88=0xce;}_0x219365[_0x6614('0x1d')](_0x491d88);return _0x219365[_0x6614('0x23')](_0x6614('0x24'),_0x5f1f8e+'-'+_0x2e843e+'/'+_0x37fa8f)[_0x6614('0x25')](_0x5e933f);}return null;};}function patchUpdates(_0x15c667){return function(_0x323d8f){try{jsonpatch[_0x6614('0x26')](_0x323d8f,_0x15c667,!![]);}catch(_0x40ce2c){return BPromise[_0x6614('0x27')](_0x40ce2c);}return _0x323d8f[_0x6614('0x28')]();};}function saveUpdates(_0x18889c,_0x3275ee){return function(_0x5da2c1){if(_0x5da2c1){return _0x5da2c1[_0x6614('0x29')](_0x18889c)['then'](function(_0x13ad7a){return _0x13ad7a;});}return null;};}function removeEntity(_0x30205e,_0x332fca){return function(_0x478fe6){if(_0x478fe6){return _0x478fe6['destroy']()[_0x6614('0x2a')](function(){_0x30205e['status'](0xcc)[_0x6614('0x1e')]();});}};}function handleEntityNotFound(_0x5c8651,_0x3c82e5){return function(_0x20fd50){if(!_0x20fd50){_0x5c8651['sendStatus'](0x194);}return _0x20fd50;};}function handleError(_0x119e53,_0x4e9450){_0x4e9450=_0x4e9450||0x1f4;return function(_0x184857){logger[_0x6614('0x2b')](_0x184857[_0x6614('0x2c')]);if(_0x184857[_0x6614('0x2d')]){delete _0x184857[_0x6614('0x2d')];}_0x119e53[_0x6614('0x1d')](_0x4e9450)[_0x6614('0x2e')](_0x184857);};}exports[_0x6614('0x2f')]=function(_0x1fef5f,_0x32ee73){var _0x153b8e={},_0x30811a={},_0x14db81={'count':0x0,'rows':[]};var _0x546c0e=_[_0x6614('0x30')](db[_0x6614('0x31')][_0x6614('0x32')],function(_0x13380e){return{'name':_0x13380e[_0x6614('0x33')],'type':_0x13380e[_0x6614('0x34')][_0x6614('0x35')]};});_0x30811a[_0x6614('0x36')]=_['map'](_0x546c0e,_0x6614('0x2d'));_0x30811a[_0x6614('0x37')]=_[_0x6614('0x38')](_0x1fef5f['query']);_0x30811a['filters']=_[_0x6614('0x39')](_0x30811a['model'],_0x30811a[_0x6614('0x37')]);_0x153b8e[_0x6614('0x3a')]=_['intersection'](_0x30811a[_0x6614('0x36')],qs[_0x6614('0x3b')](_0x1fef5f[_0x6614('0x37')]['fields']));_0x153b8e[_0x6614('0x3a')]=_0x153b8e[_0x6614('0x3a')][_0x6614('0x3c')]?_0x153b8e[_0x6614('0x3a')]:_0x30811a[_0x6614('0x36')];if(!_0x1fef5f[_0x6614('0x37')][_0x6614('0x3d')](_0x6614('0x3e'))){_0x153b8e[_0x6614('0x22')]=qs[_0x6614('0x22')](_0x1fef5f[_0x6614('0x37')][_0x6614('0x22')]);_0x153b8e[_0x6614('0x1f')]=qs[_0x6614('0x1f')](_0x1fef5f[_0x6614('0x37')][_0x6614('0x1f')]);}_0x153b8e[_0x6614('0x3f')]=qs[_0x6614('0x40')](_0x1fef5f[_0x6614('0x37')][_0x6614('0x40')]);_0x153b8e['where']=qs[_0x6614('0x41')](_[_0x6614('0x42')](_0x1fef5f[_0x6614('0x37')],_0x30811a[_0x6614('0x41')]),_0x546c0e);if(_0x1fef5f[_0x6614('0x37')][_0x6614('0x43')]){_0x153b8e[_0x6614('0x44')]=_[_0x6614('0x45')](_0x153b8e[_0x6614('0x44')],{'$or':_[_0x6614('0x30')](_0x546c0e,function(_0x2fc58a){if(_0x2fc58a[_0x6614('0x34')]!==_0x6614('0x46')){var _0x3f87b5={};_0x3f87b5[_0x2fc58a[_0x6614('0x2d')]]={'$like':'%'+_0x1fef5f[_0x6614('0x37')][_0x6614('0x43')]+'%'};return _0x3f87b5;}})});}_0x153b8e=_[_0x6614('0x45')]({},_0x153b8e,_0x1fef5f[_0x6614('0x47')]);var _0x4b2fbe={'where':_0x153b8e[_0x6614('0x44')]};return db[_0x6614('0x31')][_0x6614('0x21')](_0x4b2fbe)[_0x6614('0x2a')](function(_0x52244d){_0x14db81['count']=_0x52244d;if(_0x1fef5f[_0x6614('0x37')][_0x6614('0x48')]){_0x153b8e['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x6614('0x49')](_0x153b8e);})['then'](function(_0x14bd38){_0x14db81['rows']=_0x14bd38;return _0x14db81;})[_0x6614('0x2a')](respondWithFilteredResult(_0x32ee73,_0x153b8e))['catch'](handleError(_0x32ee73,null));};exports[_0x6614('0x4a')]=function(_0xc0250a,_0x1c3145){var _0x31ea45={'raw':![],'where':{'id':_0xc0250a['params']['id']}},_0x74eb0d={};_0x74eb0d['model']=_[_0x6614('0x38')](db[_0x6614('0x31')][_0x6614('0x32')]);_0x74eb0d[_0x6614('0x37')]=_[_0x6614('0x38')](_0xc0250a['query']);_0x74eb0d[_0x6614('0x41')]=_[_0x6614('0x39')](_0x74eb0d[_0x6614('0x36')],_0x74eb0d[_0x6614('0x37')]);_0x31ea45[_0x6614('0x3a')]=_[_0x6614('0x39')](_0x74eb0d['model'],qs[_0x6614('0x3b')](_0xc0250a['query'][_0x6614('0x3b')]));_0x31ea45['attributes']=_0x31ea45[_0x6614('0x3a')]['length']?_0x31ea45['attributes']:_0x74eb0d[_0x6614('0x36')];if(_0xc0250a[_0x6614('0x37')][_0x6614('0x48')]){_0x31ea45['include']=[{'all':!![]}];}_0x31ea45=_[_0x6614('0x45')]({},_0x31ea45,_0xc0250a['options']);return db[_0x6614('0x31')][_0x6614('0x4b')](_0x31ea45)[_0x6614('0x2a')](handleEntityNotFound(_0x1c3145,null))[_0x6614('0x2a')](respondWithResult(_0x1c3145,null))[_0x6614('0x4c')](handleError(_0x1c3145,null));};exports[_0x6614('0x4d')]=function(_0x54b8c3,_0x138637){return db[_0x6614('0x31')]['create'](_0x54b8c3[_0x6614('0x4e')],{})[_0x6614('0x2a')](respondWithResult(_0x138637,0xc9))[_0x6614('0x4c')](handleError(_0x138637,null));};exports['update']=function(_0x416ba2,_0x3fb42e){if(_0x416ba2[_0x6614('0x4e')]['id']){delete _0x416ba2[_0x6614('0x4e')]['id'];}return db[_0x6614('0x31')]['find']({'where':{'id':_0x416ba2[_0x6614('0x4f')]['id']}})[_0x6614('0x2a')](handleEntityNotFound(_0x3fb42e,null))[_0x6614('0x2a')](saveUpdates(_0x416ba2[_0x6614('0x4e')],null))[_0x6614('0x2a')](respondWithResult(_0x3fb42e,null))[_0x6614('0x4c')](handleError(_0x3fb42e,null));};exports[_0x6614('0x50')]=function(_0x372e79,_0x1ef01c){return db['FreshdeskAccount'][_0x6614('0x4b')]({'where':{'id':_0x372e79[_0x6614('0x4f')]['id']}})[_0x6614('0x2a')](handleEntityNotFound(_0x1ef01c,null))[_0x6614('0x2a')](removeEntity(_0x1ef01c,null))['catch'](handleError(_0x1ef01c,null));};exports['getConfigurations']=function(_0x3a11af,_0x5c590e,_0x104815){var _0x37dd7c={};var _0x154ae4={};var _0x402d34;var _0x513eaf;return db[_0x6614('0x31')][_0x6614('0x51')]({'where':{'id':_0x3a11af['params']['id']}})[_0x6614('0x2a')](handleEntityNotFound(_0x5c590e,null))[_0x6614('0x2a')](function(_0x518266){if(_0x518266){_0x402d34=_0x518266;_0x154ae4['model']=_[_0x6614('0x38')](db[_0x6614('0x52')][_0x6614('0x32')]);_0x154ae4['query']=_['keys'](_0x3a11af[_0x6614('0x37')]);_0x154ae4[_0x6614('0x41')]=_[_0x6614('0x39')](_0x154ae4[_0x6614('0x36')],_0x154ae4[_0x6614('0x37')]);_0x37dd7c['attributes']=_[_0x6614('0x39')](_0x154ae4[_0x6614('0x36')],qs[_0x6614('0x3b')](_0x3a11af[_0x6614('0x37')][_0x6614('0x3b')]));_0x37dd7c[_0x6614('0x3a')]=_0x37dd7c[_0x6614('0x3a')][_0x6614('0x3c')]?_0x37dd7c['attributes']:_0x154ae4[_0x6614('0x36')];_0x37dd7c[_0x6614('0x3f')]=qs[_0x6614('0x40')](_0x3a11af[_0x6614('0x37')]['sort']);_0x37dd7c['where']=qs[_0x6614('0x41')](_[_0x6614('0x42')](_0x3a11af[_0x6614('0x37')],_0x154ae4[_0x6614('0x41')]));if(_0x3a11af[_0x6614('0x37')][_0x6614('0x43')]){_0x37dd7c[_0x6614('0x44')]=_[_0x6614('0x45')](_0x37dd7c[_0x6614('0x44')],{'$or':_[_0x6614('0x30')](_0x37dd7c[_0x6614('0x3a')],function(_0x2865b2){var _0x5ab579={};_0x5ab579[_0x2865b2]={'$like':'%'+_0x3a11af['query'][_0x6614('0x43')]+'%'};return _0x5ab579;})});}_0x37dd7c=_[_0x6614('0x45')]({},_0x37dd7c,_0x3a11af[_0x6614('0x47')]);return _0x402d34['getConfigurations'](_0x37dd7c);}})['then'](function(_0x2abbb6){if(_0x2abbb6){_0x513eaf=_0x2abbb6[_0x6614('0x3c')];if(!_0x3a11af[_0x6614('0x37')]['hasOwnProperty']('nolimit')){_0x37dd7c[_0x6614('0x22')]=qs['limit'](_0x3a11af[_0x6614('0x37')][_0x6614('0x22')]);_0x37dd7c[_0x6614('0x1f')]=qs[_0x6614('0x1f')](_0x3a11af[_0x6614('0x37')][_0x6614('0x1f')]);}return _0x402d34['getConfigurations'](_0x37dd7c);}})[_0x6614('0x2a')](function(_0x5d4964){if(_0x5d4964){return _0x5d4964?{'count':_0x513eaf,'rows':_0x5d4964}:null;}})[_0x6614('0x2a')](respondWithResult(_0x5c590e,null))[_0x6614('0x4c')](handleError(_0x5c590e,null));};exports[_0x6614('0x53')]=function(_0x188f13,_0x10736d,_0x2381b2){if(_0x188f13[_0x6614('0x4e')]['id']){delete _0x188f13[_0x6614('0x4e')]['id'];}return db[_0x6614('0x31')][_0x6614('0x51')]({'where':{'id':_0x188f13['params']['id']}})['then'](handleEntityNotFound(_0x10736d,null))[_0x6614('0x2a')](function(_0x29357b){if(_0x29357b){_0x188f13[_0x6614('0x4e')][_0x6614('0x54')]=_0x29357b['id'];_0x188f13[_0x6614('0x4e')]['Subjects']=integrations[_0x6614('0x55')](_0x188f13[_0x6614('0x4e')][_0x6614('0x56')],_0x188f13[_0x6614('0x4e')][_0x6614('0x34')]);_0x188f13[_0x6614('0x4e')]['Descriptions']=integrations[_0x6614('0x57')](_0x188f13[_0x6614('0x4e')]['channel'],_0x188f13[_0x6614('0x4e')][_0x6614('0x34')]);return db[_0x6614('0x52')][_0x6614('0x4d')](_0x188f13[_0x6614('0x4e')],{'include':[{'model':db[_0x6614('0x58')],'as':_0x6614('0x59')},{'model':db[_0x6614('0x58')],'as':_0x6614('0x5a')}]});}return null;})[_0x6614('0x2a')](respondWithResult(_0x10736d,null))['catch'](handleError(_0x10736d,null));};exports[_0x6614('0x5b')]=function(_0x33c3e8,_0x4d49ea,_0x45bdce){var _0x1dfe26='';return db[_0x6614('0x31')][_0x6614('0x51')]({'where':{'id':_0x33c3e8[_0x6614('0x4f')]['id']},'attributes':['id',_0x6614('0x5c'),_0x6614('0x5d')]})[_0x6614('0x2a')](handleEntityNotFound(_0x4d49ea,null))[_0x6614('0x2a')](function(_0x5c70be){if(_0x5c70be){_0x1dfe26=_0x5c70be['remoteUri'];var _0x2f3544=_0x1dfe26[_0x6614('0x5e')](-0x1);if(_0x2f3544==='/'){_0x1dfe26=_0x1dfe26['substring'](0x0,_0x1dfe26['lastIndexOf'](_0x2f3544));}return rp({'method':_0x6614('0x5f'),'uri':util['format'](_0x6614('0x60'),_0x1dfe26,_0x6614('0x61')),'headers':{'Authorization':util[_0x6614('0x62')](_0x6614('0x63'),new Buffer(util[_0x6614('0x62')](_0x6614('0x64'),_0x5c70be[_0x6614('0x5d')]))[_0x6614('0x65')]('base64'))},'json':!![]});}})[_0x6614('0x2a')](function(_0x30b168){if(_0x30b168){var _0x1fa300=[_0x6614('0x66'),'subject',_0x6614('0x67'),_0x6614('0x68'),_0x6614('0x1d'),_0x6614('0x69'),_0x6614('0x6a'),'source',_0x6614('0x6b'),_0x6614('0x6a'),_0x6614('0x6c')];_[_0x6614('0x6d')](_0x30b168,function(_0x35db05){return _0x1fa300['includes'](_0x35db05[_0x6614('0x2d')])||!_0x35db05[_0x6614('0x6e')]&&_0x35db05[_0x6614('0x34')]!==_0x6614('0x6f')&&_0x35db05[_0x6614('0x34')]!==_0x6614('0x70');});return{'count':_0x30b168[_0x6614('0x3c')],'rows':_['map'](_0x30b168,function(_0x4f109c){return{'id':_0x4f109c[_0x6614('0x2d')],'name':_0x4f109c[_0x6614('0x71')],'custom':!_0x4f109c[_0x6614('0x6e')],'options':_0x4f109c['choices']?_[_0x6614('0x30')](_0x4f109c[_0x6614('0x72')],function(_0x4e0611){return{'name':_[_0x6614('0x73')](_0x4e0611),'value':_0x4e0611};}):[]};})};}})[_0x6614('0x2a')](respondWithResult(_0x4d49ea,null))['catch'](function(_0x880010){var _0x457fd6=_0x33c3e8[_0x6614('0x37')][_0x6614('0x74')]?0x1f4:_0x880010[_0x6614('0x75')]||0x1f4;logger['error'](_0x6614('0x76'),_0x6614('0x5b'),_0x457fd6,JSON[_0x6614('0x77')](_0x880010));delete _0x880010[_0x6614('0x2d')];if(_0x457fd6===0x191){_0x457fd6=0x190;}_0x4d49ea[_0x6614('0x1d')](_0x457fd6)['send'](_0x33c3e8[_0x6614('0x37')]['test']?{'message':_0x6614('0x78'),'statusCode':_0x880010['statusCode']}:_0x880010);});}; \ No newline at end of file +var _0x765b=['path','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','name','index','FreshdeskAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','catch','show','find','create','body','update','getConfigurations','findOne','params','hasOwnProperty','addConfiguration','Subjects','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s:X','toString','requester','subject','agent','priority','group','source','ticket_type','remove','includes','custom_text','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','fast-json-patch','moment','mustache','util'];(function(_0x2e6069,_0x17642f){var _0x47627e=function(_0x172877){while(--_0x172877){_0x2e6069['push'](_0x2e6069['shift']());}};_0x47627e(++_0x17642f);}(_0x765b,0x18c));var _0xb765=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x765b[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb765('0x0'));var rp=require('request-promise');var moment=require(_0xb765('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xb765('0x2'));var util=require(_0xb765('0x3'));var path=require(_0xb765('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb765('0x5'));var squel=require('squel');var crypto=require(_0xb765('0x6'));var jsforce=require(_0xb765('0x7'));var deskjs=require(_0xb765('0x8'));var toCsv=require('to-csv');var querystring=require(_0xb765('0x9'));var Papa=require(_0xb765('0xa'));var Redis=require(_0xb765('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb765('0xc'));var logger=require(_0xb765('0xd'))(_0xb765('0xe'));var utils=require(_0xb765('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xb765('0x10'));var db=require(_0xb765('0x11'))['db'];var integrations=require(_0xb765('0x12'));function respondWithStatusCode(_0x3f9acb,_0x38ee06){_0x38ee06=_0x38ee06||0xcc;return function(_0xadac12){if(_0xadac12){return _0x3f9acb[_0xb765('0x13')](_0x38ee06);}return _0x3f9acb[_0xb765('0x14')](_0x38ee06)[_0xb765('0x15')]();};}function respondWithResult(_0x4d8eff,_0x2aebdb){_0x2aebdb=_0x2aebdb||0xc8;return function(_0x5d8852){if(_0x5d8852){return _0x4d8eff[_0xb765('0x14')](_0x2aebdb)[_0xb765('0x16')](_0x5d8852);}};}function respondWithFilteredResult(_0x4cecc1,_0x4b8e26){return function(_0x3f73f4){if(_0x3f73f4){var _0x2ab6b8=typeof _0x4b8e26[_0xb765('0x17')]===_0xb765('0x18')&&typeof _0x4b8e26[_0xb765('0x19')]===_0xb765('0x18');var _0x9bd542=_0x3f73f4[_0xb765('0x1a')];var _0x5c182f=_0x2ab6b8?0x0:_0x4b8e26[_0xb765('0x17')];var _0x132aab=_0x2ab6b8?_0x3f73f4[_0xb765('0x1a')]:_0x4b8e26[_0xb765('0x17')]+_0x4b8e26[_0xb765('0x19')];var _0x360b9e;if(_0x132aab>=_0x9bd542){_0x132aab=_0x9bd542;_0x360b9e=0xc8;}else{_0x360b9e=0xce;}_0x4cecc1[_0xb765('0x14')](_0x360b9e);return _0x4cecc1[_0xb765('0x1b')](_0xb765('0x1c'),_0x5c182f+'-'+_0x132aab+'/'+_0x9bd542)[_0xb765('0x16')](_0x3f73f4);}return null;};}function patchUpdates(_0x44936d){return function(_0x1b1184){try{jsonpatch['apply'](_0x1b1184,_0x44936d,!![]);}catch(_0x5d72a1){return BPromise[_0xb765('0x1d')](_0x5d72a1);}return _0x1b1184['save']();};}function saveUpdates(_0x3d69c7,_0x2e0196){return function(_0x461da8){if(_0x461da8){return _0x461da8['update'](_0x3d69c7)[_0xb765('0x1e')](function(_0x1a740c){return _0x1a740c;});}return null;};}function removeEntity(_0x5d1ea0,_0x3a05b1){return function(_0x3684e8){if(_0x3684e8){return _0x3684e8[_0xb765('0x1f')]()[_0xb765('0x1e')](function(){_0x5d1ea0['status'](0xcc)[_0xb765('0x15')]();});}};}function handleEntityNotFound(_0x6a5457,_0x4e12b8){return function(_0x4dc7d1){if(!_0x4dc7d1){_0x6a5457[_0xb765('0x13')](0x194);}return _0x4dc7d1;};}function handleError(_0x4715d7,_0x1c561a){_0x1c561a=_0x1c561a||0x1f4;return function(_0x562bd3){logger['error'](_0x562bd3['stack']);if(_0x562bd3[_0xb765('0x20')]){delete _0x562bd3[_0xb765('0x20')];}_0x4715d7[_0xb765('0x14')](_0x1c561a)['send'](_0x562bd3);};}exports[_0xb765('0x21')]=function(_0x3c7206,_0x48a84a){var _0x2842c2={},_0xe9f0b9={},_0x439162={'count':0x0,'rows':[]};var _0x5ce321=_['map'](db[_0xb765('0x22')][_0xb765('0x23')],function(_0x1d8970){return{'name':_0x1d8970['fieldName'],'type':_0x1d8970[_0xb765('0x24')][_0xb765('0x25')]};});_0xe9f0b9['model']=_['map'](_0x5ce321,_0xb765('0x20'));_0xe9f0b9[_0xb765('0x26')]=_[_0xb765('0x27')](_0x3c7206[_0xb765('0x26')]);_0xe9f0b9[_0xb765('0x28')]=_[_0xb765('0x29')](_0xe9f0b9[_0xb765('0x2a')],_0xe9f0b9['query']);_0x2842c2[_0xb765('0x2b')]=_[_0xb765('0x29')](_0xe9f0b9[_0xb765('0x2a')],qs[_0xb765('0x2c')](_0x3c7206['query']['fields']));_0x2842c2['attributes']=_0x2842c2[_0xb765('0x2b')][_0xb765('0x2d')]?_0x2842c2['attributes']:_0xe9f0b9[_0xb765('0x2a')];if(!_0x3c7206['query']['hasOwnProperty'](_0xb765('0x2e'))){_0x2842c2[_0xb765('0x19')]=qs['limit'](_0x3c7206[_0xb765('0x26')][_0xb765('0x19')]);_0x2842c2['offset']=qs[_0xb765('0x17')](_0x3c7206[_0xb765('0x26')][_0xb765('0x17')]);}_0x2842c2[_0xb765('0x2f')]=qs[_0xb765('0x30')](_0x3c7206[_0xb765('0x26')][_0xb765('0x30')]);_0x2842c2[_0xb765('0x31')]=qs['filters'](_[_0xb765('0x32')](_0x3c7206[_0xb765('0x26')],_0xe9f0b9['filters']),_0x5ce321);if(_0x3c7206[_0xb765('0x26')]['filter']){_0x2842c2[_0xb765('0x31')]=_[_0xb765('0x33')](_0x2842c2['where'],{'$or':_[_0xb765('0x34')](_0x5ce321,function(_0x19dbf4){if(_0x19dbf4['type']!=='VIRTUAL'){var _0x21c90e={};_0x21c90e[_0x19dbf4[_0xb765('0x20')]]={'$like':'%'+_0x3c7206[_0xb765('0x26')][_0xb765('0x35')]+'%'};return _0x21c90e;}})});}_0x2842c2=_['merge']({},_0x2842c2,_0x3c7206[_0xb765('0x36')]);var _0x25a243={'where':_0x2842c2[_0xb765('0x31')]};return db['FreshdeskAccount'][_0xb765('0x1a')](_0x25a243)[_0xb765('0x1e')](function(_0x3a46d9){_0x439162[_0xb765('0x1a')]=_0x3a46d9;if(_0x3c7206['query'][_0xb765('0x37')]){_0x2842c2[_0xb765('0x38')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xb765('0x39')](_0x2842c2);})[_0xb765('0x1e')](function(_0x29a469){_0x439162['rows']=_0x29a469;return _0x439162;})['then'](respondWithFilteredResult(_0x48a84a,_0x2842c2))[_0xb765('0x3a')](handleError(_0x48a84a,null));};exports[_0xb765('0x3b')]=function(_0x542372,_0x42a715){var _0x516b98={'raw':![],'where':{'id':_0x542372['params']['id']}},_0x4a0bd5={};_0x4a0bd5['model']=_[_0xb765('0x27')](db[_0xb765('0x22')][_0xb765('0x23')]);_0x4a0bd5[_0xb765('0x26')]=_[_0xb765('0x27')](_0x542372['query']);_0x4a0bd5[_0xb765('0x28')]=_[_0xb765('0x29')](_0x4a0bd5['model'],_0x4a0bd5[_0xb765('0x26')]);_0x516b98[_0xb765('0x2b')]=_['intersection'](_0x4a0bd5[_0xb765('0x2a')],qs[_0xb765('0x2c')](_0x542372[_0xb765('0x26')][_0xb765('0x2c')]));_0x516b98[_0xb765('0x2b')]=_0x516b98[_0xb765('0x2b')][_0xb765('0x2d')]?_0x516b98[_0xb765('0x2b')]:_0x4a0bd5[_0xb765('0x2a')];if(_0x542372['query'][_0xb765('0x37')]){_0x516b98[_0xb765('0x38')]=[{'all':!![]}];}_0x516b98=_[_0xb765('0x33')]({},_0x516b98,_0x542372['options']);return db['FreshdeskAccount'][_0xb765('0x3c')](_0x516b98)['then'](handleEntityNotFound(_0x42a715,null))[_0xb765('0x1e')](respondWithResult(_0x42a715,null))[_0xb765('0x3a')](handleError(_0x42a715,null));};exports['create']=function(_0x12eff7,_0x164dc9){return db[_0xb765('0x22')][_0xb765('0x3d')](_0x12eff7[_0xb765('0x3e')],{})[_0xb765('0x1e')](respondWithResult(_0x164dc9,0xc9))['catch'](handleError(_0x164dc9,null));};exports[_0xb765('0x3f')]=function(_0x2540fc,_0x7ae096){if(_0x2540fc[_0xb765('0x3e')]['id']){delete _0x2540fc[_0xb765('0x3e')]['id'];}return db[_0xb765('0x22')][_0xb765('0x3c')]({'where':{'id':_0x2540fc['params']['id']}})[_0xb765('0x1e')](handleEntityNotFound(_0x7ae096,null))['then'](saveUpdates(_0x2540fc[_0xb765('0x3e')],null))[_0xb765('0x1e')](respondWithResult(_0x7ae096,null))[_0xb765('0x3a')](handleError(_0x7ae096,null));};exports[_0xb765('0x1f')]=function(_0x5f37de,_0x41d67e){return db['FreshdeskAccount'][_0xb765('0x3c')]({'where':{'id':_0x5f37de['params']['id']}})[_0xb765('0x1e')](handleEntityNotFound(_0x41d67e,null))['then'](removeEntity(_0x41d67e,null))['catch'](handleError(_0x41d67e,null));};exports[_0xb765('0x40')]=function(_0x580a3d,_0x46a585,_0x405be7){var _0x39c4ca={};var _0x27cd8f={};var _0x14c3b0;var _0x3c9ace;return db['FreshdeskAccount'][_0xb765('0x41')]({'where':{'id':_0x580a3d[_0xb765('0x42')]['id']}})[_0xb765('0x1e')](handleEntityNotFound(_0x46a585,null))[_0xb765('0x1e')](function(_0x334e43){if(_0x334e43){_0x14c3b0=_0x334e43;_0x27cd8f[_0xb765('0x2a')]=_[_0xb765('0x27')](db['FreshdeskConfiguration'][_0xb765('0x23')]);_0x27cd8f[_0xb765('0x26')]=_['keys'](_0x580a3d['query']);_0x27cd8f[_0xb765('0x28')]=_[_0xb765('0x29')](_0x27cd8f[_0xb765('0x2a')],_0x27cd8f[_0xb765('0x26')]);_0x39c4ca[_0xb765('0x2b')]=_[_0xb765('0x29')](_0x27cd8f['model'],qs['fields'](_0x580a3d['query'][_0xb765('0x2c')]));_0x39c4ca[_0xb765('0x2b')]=_0x39c4ca['attributes'][_0xb765('0x2d')]?_0x39c4ca['attributes']:_0x27cd8f[_0xb765('0x2a')];_0x39c4ca[_0xb765('0x2f')]=qs[_0xb765('0x30')](_0x580a3d[_0xb765('0x26')][_0xb765('0x30')]);_0x39c4ca['where']=qs[_0xb765('0x28')](_[_0xb765('0x32')](_0x580a3d[_0xb765('0x26')],_0x27cd8f[_0xb765('0x28')]));if(_0x580a3d[_0xb765('0x26')][_0xb765('0x35')]){_0x39c4ca[_0xb765('0x31')]=_[_0xb765('0x33')](_0x39c4ca[_0xb765('0x31')],{'$or':_['map'](_0x39c4ca[_0xb765('0x2b')],function(_0x40a98a){var _0x3e76e2={};_0x3e76e2[_0x40a98a]={'$like':'%'+_0x580a3d[_0xb765('0x26')]['filter']+'%'};return _0x3e76e2;})});}_0x39c4ca=_[_0xb765('0x33')]({},_0x39c4ca,_0x580a3d[_0xb765('0x36')]);return _0x14c3b0['getConfigurations'](_0x39c4ca);}})[_0xb765('0x1e')](function(_0xd589c5){if(_0xd589c5){_0x3c9ace=_0xd589c5[_0xb765('0x2d')];if(!_0x580a3d[_0xb765('0x26')][_0xb765('0x43')]('nolimit')){_0x39c4ca[_0xb765('0x19')]=qs[_0xb765('0x19')](_0x580a3d[_0xb765('0x26')]['limit']);_0x39c4ca['offset']=qs[_0xb765('0x17')](_0x580a3d[_0xb765('0x26')][_0xb765('0x17')]);}return _0x14c3b0['getConfigurations'](_0x39c4ca);}})[_0xb765('0x1e')](function(_0x1e6b28){if(_0x1e6b28){return _0x1e6b28?{'count':_0x3c9ace,'rows':_0x1e6b28}:null;}})[_0xb765('0x1e')](respondWithResult(_0x46a585,null))[_0xb765('0x3a')](handleError(_0x46a585,null));};exports[_0xb765('0x44')]=function(_0x4a5a24,_0x1b3d82,_0x2a7296){if(_0x4a5a24[_0xb765('0x3e')]['id']){delete _0x4a5a24['body']['id'];}return db[_0xb765('0x22')][_0xb765('0x41')]({'where':{'id':_0x4a5a24[_0xb765('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b3d82,null))[_0xb765('0x1e')](function(_0xf8ed84){if(_0xf8ed84){_0x4a5a24[_0xb765('0x3e')]['AccountId']=_0xf8ed84['id'];_0x4a5a24['body'][_0xb765('0x45')]=integrations['getSubjects'](_0x4a5a24['body']['channel'],_0x4a5a24[_0xb765('0x3e')]['type']);_0x4a5a24[_0xb765('0x3e')][_0xb765('0x46')]=integrations['getDescriptions'](_0x4a5a24[_0xb765('0x3e')][_0xb765('0x47')],_0x4a5a24['body'][_0xb765('0x24')]);return db[_0xb765('0x48')][_0xb765('0x3d')](_0x4a5a24[_0xb765('0x3e')],{'include':[{'model':db[_0xb765('0x49')],'as':_0xb765('0x45')},{'model':db['FreshdeskField'],'as':_0xb765('0x46')}]});}return null;})['then'](respondWithResult(_0x1b3d82,null))[_0xb765('0x3a')](handleError(_0x1b3d82,null));};exports[_0xb765('0x4a')]=function(_0x457bc9,_0x58be22,_0x35dc72){var _0x497d66='';return db[_0xb765('0x22')][_0xb765('0x41')]({'where':{'id':_0x457bc9['params']['id']},'attributes':['id',_0xb765('0x4b'),_0xb765('0x4c')]})[_0xb765('0x1e')](handleEntityNotFound(_0x58be22,null))['then'](function(_0x2b15b9){if(_0x2b15b9){_0x497d66=_0x2b15b9['remoteUri'];var _0x35735d=_0x497d66[_0xb765('0x4d')](-0x1);if(_0x35735d==='/'){_0x497d66=_0x497d66[_0xb765('0x4e')](0x0,_0x497d66[_0xb765('0x4f')](_0x35735d));}return rp({'method':_0xb765('0x50'),'uri':util['format']('%s/%s',_0x497d66,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xb765('0x51')]('Basic\x20%s',new Buffer(util[_0xb765('0x51')](_0xb765('0x52'),_0x2b15b9[_0xb765('0x4c')]))[_0xb765('0x53')]('base64'))},'json':!![]});}})['then'](function(_0x16b20c){if(_0x16b20c){var _0x2654cd=[_0xb765('0x54'),_0xb765('0x55'),_0xb765('0x56'),'description',_0xb765('0x14'),_0xb765('0x57'),_0xb765('0x58'),_0xb765('0x59'),_0xb765('0x5a'),_0xb765('0x58'),'company'];_[_0xb765('0x5b')](_0x16b20c,function(_0x3a152a){return _0x2654cd[_0xb765('0x5c')](_0x3a152a[_0xb765('0x20')])||!_0x3a152a['default']&&_0x3a152a['type']!==_0xb765('0x5d')&&_0x3a152a[_0xb765('0x24')]!==_0xb765('0x5e');});return{'count':_0x16b20c[_0xb765('0x2d')],'rows':_['map'](_0x16b20c,function(_0x46a5e6){return{'id':_0x46a5e6['name'],'name':_0x46a5e6['label'],'custom':!_0x46a5e6['default'],'options':_0x46a5e6[_0xb765('0x5f')]?_[_0xb765('0x34')](_0x46a5e6['choices'],function(_0x10e9cb){return{'name':_['capitalize'](_0x10e9cb),'value':_0x10e9cb};}):[]};})};}})[_0xb765('0x1e')](respondWithResult(_0x58be22,null))['catch'](function(_0x3da051){var _0x375223=_0x457bc9[_0xb765('0x26')][_0xb765('0x60')]?0x1f4:_0x3da051[_0xb765('0x61')]||0x1f4;logger['error'](_0xb765('0x62'),_0xb765('0x4a'),_0x375223,JSON['stringify'](_0x3da051));delete _0x3da051[_0xb765('0x20')];if(_0x375223===0x191){_0x375223=0x190;}_0x58be22[_0xb765('0x14')](_0x375223)['send'](_0x457bc9['query'][_0xb765('0x60')]?{'message':_0xb765('0x63'),'statusCode':_0x3da051[_0xb765('0x61')]}:_0x3da051);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6714c47..ed40670 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 _0x2aac=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','util','api','bluebird','path','rimraf'];(function(_0xe4d35a,_0x4bd94d){var _0x249363=function(_0x3da3fe){while(--_0x3da3fe){_0xe4d35a['push'](_0xe4d35a['shift']());}};_0x249363(++_0x4bd94d);}(_0x2aac,0x1d4));var _0xc2aa=function(_0x10f2fc,_0x4bab4d){_0x10f2fc=_0x10f2fc-0x0;var _0x27a40a=_0x2aac[_0x10f2fc];return _0x27a40a;};'use strict';var _=require('lodash');var util=require(_0xc2aa('0x0'));var logger=require('../../config/logger')(_0xc2aa('0x1'));var moment=require('moment');var BPromise=require(_0xc2aa('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2aa('0x3'));var rimraf=require(_0xc2aa('0x4'));var config=require(_0xc2aa('0x5'));var attributes=require(_0xc2aa('0x6'));var integrations=require(_0xc2aa('0x7'));module['exports']=function(_0x3625b9,_0x21f333){return _0x3625b9[_0xc2aa('0x8')](_0xc2aa('0x9'),attributes,{'tableName':_0xc2aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x837b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x837b,0x1b6));var _0xb837=function(_0x3b83ad,_0x51290d){_0x3b83ad=_0x3b83ad-0x0;var _0x20e6fd=_0x837b[_0x3b83ad];return _0x20e6fd;};'use strict';var _=require(_0xb837('0x0'));var util=require(_0xb837('0x1'));var logger=require(_0xb837('0x2'))(_0xb837('0x3'));var moment=require(_0xb837('0x4'));var BPromise=require(_0xb837('0x5'));var rp=require(_0xb837('0x6'));var fs=require('fs');var path=require(_0xb837('0x7'));var rimraf=require(_0xb837('0x8'));var config=require(_0xb837('0x9'));var attributes=require(_0xb837('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xb837('0xb')]=function(_0x4344fa,_0x41b1cd){return _0x4344fa[_0xb837('0xc')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 14fcab9..aaf1788 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 _0xcb0f=['result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1543b0,_0x22de65){var _0xaa76b1=function(_0x17741a){while(--_0x17741a){_0x1543b0['push'](_0x1543b0['shift']());}};_0xaa76b1(++_0x22de65);}(_0xcb0f,0x7d));var _0xfcb0=function(_0x14ed2f,_0x439945){_0x14ed2f=_0x14ed2f-0x0;var _0x5e29f9=_0xcb0f[_0x14ed2f];return _0x5e29f9;};'use strict';var _=require(_0xfcb0('0x0'));var util=require(_0xfcb0('0x1'));var moment=require(_0xfcb0('0x2'));var BPromise=require('bluebird');var rs=require(_0xfcb0('0x3'));var fs=require('fs');var Redis=require(_0xfcb0('0x4'));var db=require(_0xfcb0('0x5'))['db'];var utils=require(_0xfcb0('0x6'));var logger=require(_0xfcb0('0x7'))(_0xfcb0('0x8'));var config=require(_0xfcb0('0x9'));var jayson=require(_0xfcb0('0xa'));var client=jayson[_0xfcb0('0xb')][_0xfcb0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c53d2,_0x50995c,_0x3c0b5c){return new BPromise(function(_0x3ac1e6,_0x5c291c){return client[_0xfcb0('0xd')](_0x1c53d2,_0x3c0b5c)[_0xfcb0('0xe')](function(_0xd25efb){logger[_0xfcb0('0xf')](_0xfcb0('0x10'),_0x50995c,_0xfcb0('0x11'));logger[_0xfcb0('0x12')](_0xfcb0('0x13'),_0x50995c,_0xfcb0('0x11'),JSON[_0xfcb0('0x14')](_0xd25efb));if(_0xd25efb['error']){if(_0xd25efb[_0xfcb0('0x15')]['code']===0x1f4){logger[_0xfcb0('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x50995c,_0xd25efb[_0xfcb0('0x15')][_0xfcb0('0x16')]);return _0x5c291c(_0xd25efb[_0xfcb0('0x15')][_0xfcb0('0x16')]);}logger['error'](_0xfcb0('0x10'),_0x50995c,_0xd25efb[_0xfcb0('0x15')][_0xfcb0('0x16')]);return _0x3ac1e6(_0xd25efb[_0xfcb0('0x15')]['message']);}else{logger[_0xfcb0('0xf')](_0xfcb0('0x10'),_0x50995c,'request\x20sent');_0x3ac1e6(_0xd25efb[_0xfcb0('0x17')][_0xfcb0('0x16')]);}})['catch'](function(_0x45fa37){logger['error'](_0xfcb0('0x10'),_0x50995c,_0x45fa37);_0x5c291c(_0x45fa37);});});}exports[_0xfcb0('0x18')]=function(_0x387ca4){var _0x3a9a04=this;return new Promise(function(_0x594872,_0x28c96d){return db[_0xfcb0('0x19')][_0xfcb0('0x1a')]({'raw':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4[_0xfcb0('0x1b')][_0xfcb0('0x1c')]===undefined?!![]:![]:!![],'where':_0x387ca4['options']?_0x387ca4[_0xfcb0('0x1b')]['where']||null:null,'attributes':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4[_0xfcb0('0x1b')][_0xfcb0('0x1d')]||null:null,'limit':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4[_0xfcb0('0x1b')][_0xfcb0('0x1e')]||null:null,'include':_0x387ca4[_0xfcb0('0x1b')]?_0x387ca4['options'][_0xfcb0('0x1f')]?_[_0xfcb0('0x20')](_0x387ca4['options']['include'],function(_0x434460){return{'model':db[_0x434460[_0xfcb0('0x21')]],'as':_0x434460['as'],'attributes':_0x434460[_0xfcb0('0x1d')],'include':_0x434460['include']?_[_0xfcb0('0x20')](_0x434460[_0xfcb0('0x1f')],function(_0x163ccd){return{'model':db[_0x163ccd['model']],'as':_0x163ccd['as'],'attributes':_0x163ccd[_0xfcb0('0x1d')],'include':_0x163ccd['include']?_[_0xfcb0('0x20')](_0x163ccd[_0xfcb0('0x1f')],function(_0x1ab398){return{'model':db[_0x1ab398['model']],'as':_0x1ab398['as'],'attributes':_0x1ab398[_0xfcb0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcb0('0xe')](function(_0x14f53a){logger['info'](_0xfcb0('0x18'),_0x387ca4);logger[_0xfcb0('0x12')](_0xfcb0('0x18'),_0x387ca4,JSON[_0xfcb0('0x14')](_0x14f53a));_0x594872(_0x14f53a);})[_0xfcb0('0x22')](function(_0x1b1287){logger[_0xfcb0('0x15')](_0xfcb0('0x18'),_0x1b1287[_0xfcb0('0x16')],_0x387ca4);_0x28c96d(_0x3a9a04['error'](0x1f4,_0x1b1287[_0xfcb0('0x16')]));});});};exports[_0xfcb0('0x23')]=function(_0x5285ea){var _0x158f9e=this;return new Promise(function(_0x36cdd7,_0x41debf){return db[_0xfcb0('0x19')]['find']({'raw':_0x5285ea[_0xfcb0('0x1b')]?_0x5285ea[_0xfcb0('0x1b')][_0xfcb0('0x1c')]===undefined?!![]:![]:!![],'where':_0x5285ea['options']?_0x5285ea['options'][_0xfcb0('0x24')]||null:null,'attributes':_0x5285ea[_0xfcb0('0x1b')]?_0x5285ea[_0xfcb0('0x1b')][_0xfcb0('0x1d')]||null:null,'include':_0x5285ea[_0xfcb0('0x1b')]?_0x5285ea[_0xfcb0('0x1b')][_0xfcb0('0x1f')]?_['map'](_0x5285ea[_0xfcb0('0x1b')]['include'],function(_0x3b3e21){return{'model':db[_0x3b3e21[_0xfcb0('0x21')]],'as':_0x3b3e21['as'],'attributes':_0x3b3e21[_0xfcb0('0x1d')],'include':_0x3b3e21['include']?_['map'](_0x3b3e21[_0xfcb0('0x1f')],function(_0x126ac7){return{'model':db[_0x126ac7[_0xfcb0('0x21')]],'as':_0x126ac7['as'],'attributes':_0x126ac7['attributes'],'include':_0x126ac7[_0xfcb0('0x1f')]?_[_0xfcb0('0x20')](_0x126ac7[_0xfcb0('0x1f')],function(_0x480fbc){return{'model':db[_0x480fbc['model']],'as':_0x480fbc['as'],'attributes':_0x480fbc[_0xfcb0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcb0('0xe')](function(_0x4dffeb){logger['info']('ShowFreshdeskAccount',_0x5285ea);logger[_0xfcb0('0x12')](_0xfcb0('0x23'),_0x5285ea,JSON[_0xfcb0('0x14')](_0x4dffeb));_0x36cdd7(_0x4dffeb);})[_0xfcb0('0x22')](function(_0x47383c){logger[_0xfcb0('0x15')]('ShowFreshdeskAccount',_0x47383c['message'],_0x5285ea);_0x41debf(_0x158f9e['error'](0x1f4,_0x47383c[_0xfcb0('0x16')]));});});}; \ No newline at end of file +var _0xa1fb=['options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount'];(function(_0x357979,_0x56feef){var _0xabb42f=function(_0x447f9d){while(--_0x447f9d){_0x357979['push'](_0x357979['shift']());}};_0xabb42f(++_0x56feef);}(_0xa1fb,0x1c9));var _0xba1f=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xa1fb[_0x35da42];return _0x370035;};'use strict';var _=require('lodash');var util=require(_0xba1f('0x0'));var moment=require(_0xba1f('0x1'));var BPromise=require(_0xba1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba1f('0x4'));var logger=require(_0xba1f('0x5'))(_0xba1f('0x6'));var config=require(_0xba1f('0x7'));var jayson=require(_0xba1f('0x8'));var client=jayson['client'][_0xba1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d4d4,_0x365af2,_0x13749d){return new BPromise(function(_0x44a462,_0x62c9e8){return client['request'](_0x31d4d4,_0x13749d)[_0xba1f('0xa')](function(_0x4c44a7){logger[_0xba1f('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x365af2,_0xba1f('0xc'));logger[_0xba1f('0xd')](_0xba1f('0xe'),_0x365af2,_0xba1f('0xc'),JSON[_0xba1f('0xf')](_0x4c44a7));if(_0x4c44a7['error']){if(_0x4c44a7[_0xba1f('0x10')]['code']===0x1f4){logger['error'](_0xba1f('0x11'),_0x365af2,_0x4c44a7[_0xba1f('0x10')][_0xba1f('0x12')]);return _0x62c9e8(_0x4c44a7['error'][_0xba1f('0x12')]);}logger[_0xba1f('0x10')](_0xba1f('0x11'),_0x365af2,_0x4c44a7['error'][_0xba1f('0x12')]);return _0x44a462(_0x4c44a7[_0xba1f('0x10')][_0xba1f('0x12')]);}else{logger['info'](_0xba1f('0x11'),_0x365af2,_0xba1f('0xc'));_0x44a462(_0x4c44a7[_0xba1f('0x13')][_0xba1f('0x12')]);}})[_0xba1f('0x14')](function(_0x25e152){logger[_0xba1f('0x10')](_0xba1f('0x11'),_0x365af2,_0x25e152);_0x62c9e8(_0x25e152);});});}exports[_0xba1f('0x15')]=function(_0x55aeba){var _0x41e81a=this;return new Promise(function(_0x295a24,_0xfeffe){return db[_0xba1f('0x16')]['findAll']({'raw':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x18')]===undefined?!![]:![]:!![],'where':_0x55aeba['options']?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x19')]||null:null,'attributes':_0x55aeba['options']?_0x55aeba[_0xba1f('0x17')]['attributes']||null:null,'limit':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1a')]||null:null,'include':_0x55aeba[_0xba1f('0x17')]?_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x55aeba[_0xba1f('0x17')][_0xba1f('0x1b')],function(_0x179a18){return{'model':db[_0x179a18[_0xba1f('0x1d')]],'as':_0x179a18['as'],'attributes':_0x179a18[_0xba1f('0x1e')],'include':_0x179a18[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x179a18[_0xba1f('0x1b')],function(_0x22b038){return{'model':db[_0x22b038['model']],'as':_0x22b038['as'],'attributes':_0x22b038[_0xba1f('0x1e')],'include':_0x22b038[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x22b038[_0xba1f('0x1b')],function(_0x524073){return{'model':db[_0x524073[_0xba1f('0x1d')]],'as':_0x524073['as'],'attributes':_0x524073[_0xba1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xba1f('0xa')](function(_0x17d02e){logger[_0xba1f('0xb')]('GetFreshdeskAccount',_0x55aeba);logger[_0xba1f('0xd')](_0xba1f('0x15'),_0x55aeba,JSON[_0xba1f('0xf')](_0x17d02e));_0x295a24(_0x17d02e);})[_0xba1f('0x14')](function(_0x485805){logger[_0xba1f('0x10')](_0xba1f('0x15'),_0x485805[_0xba1f('0x12')],_0x55aeba);_0xfeffe(_0x41e81a[_0xba1f('0x10')](0x1f4,_0x485805[_0xba1f('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x405ea0){var _0x56866b=this;return new Promise(function(_0x497c95,_0xde539e){return db[_0xba1f('0x16')]['find']({'raw':_0x405ea0['options']?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x18')]===undefined?!![]:![]:!![],'where':_0x405ea0['options']?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x19')]||null:null,'attributes':_0x405ea0[_0xba1f('0x17')]?_0x405ea0[_0xba1f('0x17')][_0xba1f('0x1e')]||null:null,'include':_0x405ea0['options']?_0x405ea0['options'][_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x405ea0[_0xba1f('0x17')]['include'],function(_0x363279){return{'model':db[_0x363279[_0xba1f('0x1d')]],'as':_0x363279['as'],'attributes':_0x363279['attributes'],'include':_0x363279[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x363279[_0xba1f('0x1b')],function(_0x1bfe99){return{'model':db[_0x1bfe99['model']],'as':_0x1bfe99['as'],'attributes':_0x1bfe99[_0xba1f('0x1e')],'include':_0x1bfe99[_0xba1f('0x1b')]?_[_0xba1f('0x1c')](_0x1bfe99[_0xba1f('0x1b')],function(_0x55b692){return{'model':db[_0x55b692[_0xba1f('0x1d')]],'as':_0x55b692['as'],'attributes':_0x55b692[_0xba1f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x527b79){logger[_0xba1f('0xb')](_0xba1f('0x1f'),_0x405ea0);logger[_0xba1f('0xd')](_0xba1f('0x1f'),_0x405ea0,JSON[_0xba1f('0xf')](_0x527b79));_0x497c95(_0x527b79);})[_0xba1f('0x14')](function(_0x22787f){logger[_0xba1f('0x10')](_0xba1f('0x1f'),_0x22787f[_0xba1f('0x12')],_0x405ea0);_0xde539e(_0x56866b[_0xba1f('0x10')](0x1f4,_0x22787f['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 70a0824..17e0966 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 _0x81ac=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','update','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x81ac,0x124));var _0xc81a=function(_0x249bb5,_0x3f4c6c){_0x249bb5=_0x249bb5-0x0;var _0x317225=_0x81ac[_0x249bb5];return _0x317225;};'use strict';var multer=require(_0xc81a('0x0'));var util=require(_0xc81a('0x1'));var path=require(_0xc81a('0x2'));var timeout=require(_0xc81a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc81a('0x4'));var interaction=require(_0xc81a('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xc81a('0x6')]('/',auth[_0xc81a('0x7')](),controller['index']);router[_0xc81a('0x6')](_0xc81a('0x8'),auth[_0xc81a('0x7')](),controller[_0xc81a('0x9')]);router[_0xc81a('0x6')](_0xc81a('0xa'),auth[_0xc81a('0x7')](),controller['getFields']);router['get'](_0xc81a('0xb'),auth['isAuthenticated'](),controller[_0xc81a('0xc')]);router[_0xc81a('0x6')](_0xc81a('0xd'),auth[_0xc81a('0x7')](),controller[_0xc81a('0xe')]);router[_0xc81a('0x6')]('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xc81a('0xf')]('/',auth['isAuthenticated'](),controller[_0xc81a('0x10')]);router[_0xc81a('0xf')](_0xc81a('0x11'),auth[_0xc81a('0x7')](),controller[_0xc81a('0x12')]);router['put'](_0xc81a('0x8'),auth[_0xc81a('0x7')](),controller[_0xc81a('0x13')]);router['delete'](_0xc81a('0x8'),auth[_0xc81a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3317=['./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d24ee,_0x5dad4b){var _0x58c363=function(_0x52b267){while(--_0x52b267){_0x5d24ee['push'](_0x5d24ee['shift']());}};_0x58c363(++_0x5dad4b);}(_0x3317,0xd0));var _0x7331=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x3317[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require(_0x7331('0x0'));var util=require(_0x7331('0x1'));var path=require(_0x7331('0x2'));var timeout=require(_0x7331('0x3'));var express=require(_0x7331('0x4'));var router=express['Router']();var fs_extra=require(_0x7331('0x5'));var auth=require(_0x7331('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7331('0x7'));var controller=require(_0x7331('0x8'));router[_0x7331('0x9')]('/',auth[_0x7331('0xa')](),controller['index']);router['get'](_0x7331('0xb'),auth['isAuthenticated'](),controller[_0x7331('0xc')]);router[_0x7331('0x9')](_0x7331('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x7331('0x9')](_0x7331('0xe'),auth[_0x7331('0xa')](),controller['getSubjects']);router['get'](_0x7331('0xf'),auth[_0x7331('0xa')](),controller[_0x7331('0x10')]);router['get'](_0x7331('0x11'),auth[_0x7331('0xa')](),controller[_0x7331('0x12')]);router['post']('/',auth[_0x7331('0xa')](),controller['create']);router[_0x7331('0x13')]('/:id/tags',auth[_0x7331('0xa')](),controller[_0x7331('0x14')]);router[_0x7331('0x15')](_0x7331('0xb'),auth[_0x7331('0xa')](),controller['update']);router[_0x7331('0x16')]('/:id',auth[_0x7331('0xa')](),controller['destroy']);module[_0x7331('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 581e4e7..68e9d70 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 _0x7329=['STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7329,0x10f));var _0x9732=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0x7329[_0x3c487b];return _0x1d65f6;};'use strict';var Sequelize=require(_0x9732('0x0'));module[_0x9732('0x1')]={'name':{'type':Sequelize[_0x9732('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6a11=['exports','STRING','sequelize'];(function(_0x1944a2,_0x236286){var _0x36596c=function(_0x5d5c01){while(--_0x5d5c01){_0x1944a2['push'](_0x1944a2['shift']());}};_0x36596c(++_0x236286);}(_0x6a11,0xda));var _0x16a1=function(_0x37a5cd,_0xb8014d){_0x37a5cd=_0x37a5cd-0x0;var _0x2ecb34=_0x6a11[_0x37a5cd];return _0x2ecb34;};'use strict';var Sequelize=require(_0x16a1('0x0'));module[_0x16a1('0x1')]={'name':{'type':Sequelize[_0x16a1('0x2')]},'description':{'type':Sequelize[_0x16a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c7c728f..da3543e 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 _0xdb8a=['set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','merge','find','catch','create','body','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x51b1bd,_0x47495d){var _0x491aba=function(_0x5ad179){while(--_0x5ad179){_0x51b1bd['push'](_0x51b1bd['shift']());}};_0x491aba(++_0x47495d);}(_0xdb8a,0x18a));var _0xadb8=function(_0x4af3c6,_0x5e72ff){_0x4af3c6=_0x4af3c6-0x0;var _0x2c8a73=_0xdb8a[_0x4af3c6];return _0x2c8a73;};'use strict';var emlformat=require(_0xadb8('0x0'));var rimraf=require(_0xadb8('0x1'));var zipdir=require(_0xadb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadb8('0x3'));var moment=require(_0xadb8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xadb8('0x5'));var path=require(_0xadb8('0x6'));var sox=require(_0xadb8('0x7'));var csv=require(_0xadb8('0x8'));var ejs=require(_0xadb8('0x9'));var fs=require('fs');var fs_extra=require(_0xadb8('0xa'));var _=require(_0xadb8('0xb'));var squel=require(_0xadb8('0xc'));var crypto=require(_0xadb8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xadb8('0xe'));var Redis=require(_0xadb8('0xf'));var authService=require(_0xadb8('0x10'));var qs=require(_0xadb8('0x11'));var as=require(_0xadb8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadb8('0x13'))(_0xadb8('0x14'));var utils=require(_0xadb8('0x15'));var config=require(_0xadb8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xadb8('0x17'))['db'];function respondWithStatusCode(_0x445ecd,_0x11869c){_0x11869c=_0x11869c||0xcc;return function(_0x30da6c){if(_0x30da6c){return _0x445ecd[_0xadb8('0x18')](_0x11869c);}return _0x445ecd[_0xadb8('0x19')](_0x11869c)[_0xadb8('0x1a')]();};}function respondWithResult(_0x2b1510,_0x2b9c44){_0x2b9c44=_0x2b9c44||0xc8;return function(_0x19ffab){if(_0x19ffab){return _0x2b1510[_0xadb8('0x19')](_0x2b9c44)['json'](_0x19ffab);}};}function respondWithFilteredResult(_0x40e0cd,_0x122e8b){return function(_0x2bbe60){if(_0x2bbe60){var _0x3e0c51=typeof _0x122e8b[_0xadb8('0x1b')]===_0xadb8('0x1c')&&typeof _0x122e8b[_0xadb8('0x1d')]===_0xadb8('0x1c');var _0x27d166=_0x2bbe60[_0xadb8('0x1e')];var _0xe98f03=_0x3e0c51?0x0:_0x122e8b[_0xadb8('0x1b')];var _0x27ae6c=_0x3e0c51?_0x2bbe60[_0xadb8('0x1e')]:_0x122e8b[_0xadb8('0x1b')]+_0x122e8b['limit'];var _0x892d7e;if(_0x27ae6c>=_0x27d166){_0x27ae6c=_0x27d166;_0x892d7e=0xc8;}else{_0x892d7e=0xce;}_0x40e0cd[_0xadb8('0x19')](_0x892d7e);return _0x40e0cd[_0xadb8('0x1f')](_0xadb8('0x20'),_0xe98f03+'-'+_0x27ae6c+'/'+_0x27d166)[_0xadb8('0x21')](_0x2bbe60);}return null;};}function patchUpdates(_0x178c44){return function(_0x3fc65b){try{jsonpatch['apply'](_0x3fc65b,_0x178c44,!![]);}catch(_0x3dbdaf){return BPromise[_0xadb8('0x22')](_0x3dbdaf);}return _0x3fc65b['save']();};}function saveUpdates(_0x9d1340,_0x3e9654){return function(_0x2e4acd){if(_0x2e4acd){return _0x2e4acd[_0xadb8('0x23')](_0x9d1340)[_0xadb8('0x24')](function(_0x5881e5){return _0x5881e5;});}return null;};}function removeEntity(_0x425ab3,_0x554df4){return function(_0xa7c4f8){if(_0xa7c4f8){return _0xa7c4f8[_0xadb8('0x25')]()[_0xadb8('0x24')](function(){_0x425ab3[_0xadb8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d19b,_0x19d75f){return function(_0x42fa4a){if(!_0x42fa4a){_0x42d19b[_0xadb8('0x18')](0x194);}return _0x42fa4a;};}function handleError(_0x4cfa91,_0x1c89a6){_0x1c89a6=_0x1c89a6||0x1f4;return function(_0x4e91b3){logger[_0xadb8('0x26')](_0x4e91b3[_0xadb8('0x27')]);if(_0x4e91b3[_0xadb8('0x28')]){delete _0x4e91b3[_0xadb8('0x28')];}_0x4cfa91['status'](_0x1c89a6)[_0xadb8('0x29')](_0x4e91b3);};}exports[_0xadb8('0x2a')]=function(_0x37a16f,_0x3a8ca3){var _0x5795b3={},_0x2c620b={},_0xede5af={'count':0x0,'rows':[]};var _0xeb6dbc=_[_0xadb8('0x2b')](db[_0xadb8('0x2c')]['rawAttributes'],function(_0x7409eb){return{'name':_0x7409eb[_0xadb8('0x2d')],'type':_0x7409eb[_0xadb8('0x2e')][_0xadb8('0x2f')]};});_0x2c620b[_0xadb8('0x30')]=_['map'](_0xeb6dbc,_0xadb8('0x28'));_0x2c620b[_0xadb8('0x31')]=_['keys'](_0x37a16f[_0xadb8('0x31')]);_0x2c620b[_0xadb8('0x32')]=_[_0xadb8('0x33')](_0x2c620b[_0xadb8('0x30')],_0x2c620b[_0xadb8('0x31')]);_0x5795b3[_0xadb8('0x34')]=_['intersection'](_0x2c620b[_0xadb8('0x30')],qs[_0xadb8('0x35')](_0x37a16f[_0xadb8('0x31')][_0xadb8('0x35')]));_0x5795b3[_0xadb8('0x34')]=_0x5795b3[_0xadb8('0x34')][_0xadb8('0x36')]?_0x5795b3[_0xadb8('0x34')]:_0x2c620b['model'];if(!_0x37a16f[_0xadb8('0x31')][_0xadb8('0x37')](_0xadb8('0x38'))){_0x5795b3[_0xadb8('0x1d')]=qs[_0xadb8('0x1d')](_0x37a16f[_0xadb8('0x31')][_0xadb8('0x1d')]);_0x5795b3[_0xadb8('0x1b')]=qs[_0xadb8('0x1b')](_0x37a16f['query']['offset']);}_0x5795b3[_0xadb8('0x39')]=qs['sort'](_0x37a16f[_0xadb8('0x31')][_0xadb8('0x3a')]);_0x5795b3[_0xadb8('0x3b')]=qs[_0xadb8('0x32')](_[_0xadb8('0x3c')](_0x37a16f[_0xadb8('0x31')],_0x2c620b[_0xadb8('0x32')]),_0xeb6dbc);if(_0x37a16f[_0xadb8('0x31')][_0xadb8('0x3d')]){_0x5795b3['where']=_['merge'](_0x5795b3['where'],{'$or':_[_0xadb8('0x2b')](_0xeb6dbc,function(_0xb5af66){if(_0xb5af66['type']!==_0xadb8('0x3e')){var _0x3b4e77={};_0x3b4e77[_0xb5af66[_0xadb8('0x28')]]={'$like':'%'+_0x37a16f[_0xadb8('0x31')][_0xadb8('0x3d')]+'%'};return _0x3b4e77;}})});}_0x5795b3=_['merge']({},_0x5795b3,_0x37a16f[_0xadb8('0x3f')]);var _0x294b47={'where':_0x5795b3[_0xadb8('0x3b')]};return db[_0xadb8('0x2c')][_0xadb8('0x1e')](_0x294b47)['then'](function(_0x53993f){_0xede5af[_0xadb8('0x1e')]=_0x53993f;if(_0x37a16f['query'][_0xadb8('0x40')]){_0x5795b3[_0xadb8('0x41')]=[{'all':!![]}];}return db[_0xadb8('0x2c')]['findAll'](_0x5795b3);})['then'](function(_0x228ca2){_0xede5af[_0xadb8('0x42')]=_0x228ca2;return _0xede5af;})['then'](respondWithFilteredResult(_0x3a8ca3,_0x5795b3))['catch'](handleError(_0x3a8ca3,null));};exports[_0xadb8('0x43')]=function(_0x2db238,_0x1782da){var _0x3334f1={'raw':![],'where':{'id':_0x2db238[_0xadb8('0x44')]['id']}},_0x1394f5={};_0x1394f5['model']=_[_0xadb8('0x45')](db[_0xadb8('0x2c')][_0xadb8('0x46')]);_0x1394f5[_0xadb8('0x31')]=_[_0xadb8('0x45')](_0x2db238['query']);_0x1394f5[_0xadb8('0x32')]=_[_0xadb8('0x33')](_0x1394f5[_0xadb8('0x30')],_0x1394f5[_0xadb8('0x31')]);_0x3334f1['attributes']=_[_0xadb8('0x33')](_0x1394f5[_0xadb8('0x30')],qs['fields'](_0x2db238[_0xadb8('0x31')][_0xadb8('0x35')]));_0x3334f1[_0xadb8('0x34')]=_0x3334f1[_0xadb8('0x34')][_0xadb8('0x36')]?_0x3334f1[_0xadb8('0x34')]:_0x1394f5['model'];if(_0x2db238[_0xadb8('0x31')]['includeAll']){_0x3334f1[_0xadb8('0x41')]=[{'all':!![]}];}_0x3334f1=_[_0xadb8('0x47')]({},_0x3334f1,_0x2db238[_0xadb8('0x3f')]);return db[_0xadb8('0x2c')][_0xadb8('0x48')](_0x3334f1)[_0xadb8('0x24')](handleEntityNotFound(_0x1782da,null))[_0xadb8('0x24')](respondWithResult(_0x1782da,null))[_0xadb8('0x49')](handleError(_0x1782da,null));};exports[_0xadb8('0x4a')]=function(_0x34d621,_0x4535ea){return db['FreshdeskConfiguration'][_0xadb8('0x4a')](_0x34d621[_0xadb8('0x4b')],{})['then'](respondWithResult(_0x4535ea,0xc9))[_0xadb8('0x49')](handleError(_0x4535ea,null));};exports[_0xadb8('0x23')]=function(_0x2397de,_0x3e90a0){if(_0x2397de[_0xadb8('0x4b')]['id']){delete _0x2397de[_0xadb8('0x4b')]['id'];}return db[_0xadb8('0x2c')][_0xadb8('0x48')]({'where':{'id':_0x2397de[_0xadb8('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e90a0,null))['then'](saveUpdates(_0x2397de['body'],null))['then'](respondWithResult(_0x3e90a0,null))[_0xadb8('0x49')](handleError(_0x3e90a0,null));};exports['destroy']=function(_0x1bf768,_0x1986ed){return db[_0xadb8('0x2c')][_0xadb8('0x48')]({'where':{'id':_0x1bf768[_0xadb8('0x44')]['id']}})['then'](handleEntityNotFound(_0x1986ed,null))[_0xadb8('0x24')](removeEntity(_0x1986ed,null))['catch'](handleError(_0x1986ed,null));};exports['getFields']=function(_0x2e5fed,_0x2dd91c,_0x559ec4){var _0x325c0c={};var _0x372100={};var _0x26ff0f;var _0x48e653;return db[_0xadb8('0x2c')][_0xadb8('0x4c')]({'where':{'id':_0x2e5fed[_0xadb8('0x44')]['id']}})[_0xadb8('0x24')](handleEntityNotFound(_0x2dd91c,null))[_0xadb8('0x24')](function(_0x102a40){if(_0x102a40){_0x26ff0f=_0x102a40;_0x372100[_0xadb8('0x30')]=_[_0xadb8('0x45')](db[_0xadb8('0x4d')][_0xadb8('0x46')]);_0x372100[_0xadb8('0x31')]=_[_0xadb8('0x45')](_0x2e5fed[_0xadb8('0x31')]);_0x372100[_0xadb8('0x32')]=_[_0xadb8('0x33')](_0x372100[_0xadb8('0x30')],_0x372100[_0xadb8('0x31')]);_0x325c0c[_0xadb8('0x34')]=_[_0xadb8('0x33')](_0x372100['model'],qs['fields'](_0x2e5fed[_0xadb8('0x31')][_0xadb8('0x35')]));_0x325c0c[_0xadb8('0x34')]=_0x325c0c[_0xadb8('0x34')][_0xadb8('0x36')]?_0x325c0c['attributes']:_0x372100['model'];_0x325c0c[_0xadb8('0x39')]=qs[_0xadb8('0x3a')](_0x2e5fed['query'][_0xadb8('0x3a')]);_0x325c0c[_0xadb8('0x3b')]=qs[_0xadb8('0x32')](_[_0xadb8('0x3c')](_0x2e5fed[_0xadb8('0x31')],_0x372100['filters']));if(_0x2e5fed['query']['filter']){_0x325c0c[_0xadb8('0x3b')]=_[_0xadb8('0x47')](_0x325c0c[_0xadb8('0x3b')],{'$or':_[_0xadb8('0x2b')](_0x325c0c[_0xadb8('0x34')],function(_0x3b55f9){var _0x5e87d0={};_0x5e87d0[_0x3b55f9]={'$like':'%'+_0x2e5fed[_0xadb8('0x31')][_0xadb8('0x3d')]+'%'};return _0x5e87d0;})});}_0x325c0c=_[_0xadb8('0x47')]({},_0x325c0c,_0x2e5fed['options']);return _0x26ff0f['getFields'](_0x325c0c);}})[_0xadb8('0x24')](function(_0x80b686){if(_0x80b686){_0x48e653=_0x80b686[_0xadb8('0x36')];if(!_0x2e5fed['query'][_0xadb8('0x37')](_0xadb8('0x38'))){_0x325c0c[_0xadb8('0x1d')]=qs[_0xadb8('0x1d')](_0x2e5fed[_0xadb8('0x31')][_0xadb8('0x1d')]);_0x325c0c[_0xadb8('0x1b')]=qs['offset'](_0x2e5fed[_0xadb8('0x31')]['offset']);}return _0x26ff0f[_0xadb8('0x4e')](_0x325c0c);}})[_0xadb8('0x24')](function(_0x87a8da){if(_0x87a8da){return _0x87a8da?{'count':_0x48e653,'rows':_0x87a8da}:null;}})[_0xadb8('0x24')](respondWithResult(_0x2dd91c,null))[_0xadb8('0x49')](handleError(_0x2dd91c,null));};exports[_0xadb8('0x4f')]=function(_0xc1dff4,_0x1facb4,_0x518e98){var _0x137983={};var _0x2c75b6={};var _0x57d7da;var _0xcbb833;return db[_0xadb8('0x2c')][_0xadb8('0x4c')]({'where':{'id':_0xc1dff4['params']['id']}})[_0xadb8('0x24')](handleEntityNotFound(_0x1facb4,null))[_0xadb8('0x24')](function(_0x3923c7){if(_0x3923c7){_0x57d7da=_0x3923c7;_0x2c75b6[_0xadb8('0x30')]=_[_0xadb8('0x45')](db[_0xadb8('0x4d')][_0xadb8('0x46')]);_0x2c75b6[_0xadb8('0x31')]=_[_0xadb8('0x45')](_0xc1dff4['query']);_0x2c75b6['filters']=_[_0xadb8('0x33')](_0x2c75b6[_0xadb8('0x30')],_0x2c75b6[_0xadb8('0x31')]);_0x137983[_0xadb8('0x34')]=_[_0xadb8('0x33')](_0x2c75b6[_0xadb8('0x30')],qs['fields'](_0xc1dff4[_0xadb8('0x31')][_0xadb8('0x35')]));_0x137983[_0xadb8('0x34')]=_0x137983[_0xadb8('0x34')][_0xadb8('0x36')]?_0x137983[_0xadb8('0x34')]:_0x2c75b6[_0xadb8('0x30')];_0x137983[_0xadb8('0x39')]=qs[_0xadb8('0x3a')](_0xc1dff4[_0xadb8('0x31')][_0xadb8('0x3a')]);_0x137983['where']=qs['filters'](_[_0xadb8('0x3c')](_0xc1dff4[_0xadb8('0x31')],_0x2c75b6['filters']));if(_0xc1dff4[_0xadb8('0x31')][_0xadb8('0x3d')]){_0x137983[_0xadb8('0x3b')]=_[_0xadb8('0x47')](_0x137983[_0xadb8('0x3b')],{'$or':_[_0xadb8('0x2b')](_0x137983[_0xadb8('0x34')],function(_0x2b9b08){var _0x1d4858={};_0x1d4858[_0x2b9b08]={'$like':'%'+_0xc1dff4['query'][_0xadb8('0x3d')]+'%'};return _0x1d4858;})});}_0x137983=_[_0xadb8('0x47')]({},_0x137983,_0xc1dff4[_0xadb8('0x3f')]);return _0x57d7da[_0xadb8('0x4f')](_0x137983);}})[_0xadb8('0x24')](function(_0x349c72){if(_0x349c72){_0xcbb833=_0x349c72[_0xadb8('0x36')];if(!_0xc1dff4[_0xadb8('0x31')][_0xadb8('0x37')](_0xadb8('0x38'))){_0x137983[_0xadb8('0x1d')]=qs['limit'](_0xc1dff4[_0xadb8('0x31')][_0xadb8('0x1d')]);_0x137983[_0xadb8('0x1b')]=qs[_0xadb8('0x1b')](_0xc1dff4[_0xadb8('0x31')][_0xadb8('0x1b')]);}return _0x57d7da[_0xadb8('0x4f')](_0x137983);}})[_0xadb8('0x24')](function(_0x34ee58){if(_0x34ee58){return _0x34ee58?{'count':_0xcbb833,'rows':_0x34ee58}:null;}})[_0xadb8('0x24')](respondWithResult(_0x1facb4,null))[_0xadb8('0x49')](handleError(_0x1facb4,null));};exports[_0xadb8('0x50')]=function(_0x5845b6,_0x1c90d0,_0x1faa3c){var _0x5ec0e0={};var _0x9aae94={};var _0x117d7e;var _0x127a55;return db['FreshdeskConfiguration'][_0xadb8('0x4c')]({'where':{'id':_0x5845b6['params']['id']}})['then'](handleEntityNotFound(_0x1c90d0,null))[_0xadb8('0x24')](function(_0x2a27bd){if(_0x2a27bd){_0x117d7e=_0x2a27bd;_0x9aae94[_0xadb8('0x30')]=_[_0xadb8('0x45')](db[_0xadb8('0x4d')][_0xadb8('0x46')]);_0x9aae94[_0xadb8('0x31')]=_[_0xadb8('0x45')](_0x5845b6['query']);_0x9aae94[_0xadb8('0x32')]=_[_0xadb8('0x33')](_0x9aae94[_0xadb8('0x30')],_0x9aae94[_0xadb8('0x31')]);_0x5ec0e0[_0xadb8('0x34')]=_[_0xadb8('0x33')](_0x9aae94[_0xadb8('0x30')],qs[_0xadb8('0x35')](_0x5845b6[_0xadb8('0x31')]['fields']));_0x5ec0e0['attributes']=_0x5ec0e0[_0xadb8('0x34')]['length']?_0x5ec0e0[_0xadb8('0x34')]:_0x9aae94[_0xadb8('0x30')];_0x5ec0e0['order']=qs[_0xadb8('0x3a')](_0x5845b6['query'][_0xadb8('0x3a')]);_0x5ec0e0[_0xadb8('0x3b')]=qs['filters'](_['pick'](_0x5845b6[_0xadb8('0x31')],_0x9aae94['filters']));if(_0x5845b6[_0xadb8('0x31')][_0xadb8('0x3d')]){_0x5ec0e0[_0xadb8('0x3b')]=_[_0xadb8('0x47')](_0x5ec0e0[_0xadb8('0x3b')],{'$or':_[_0xadb8('0x2b')](_0x5ec0e0[_0xadb8('0x34')],function(_0x2367b1){var _0x564901={};_0x564901[_0x2367b1]={'$like':'%'+_0x5845b6[_0xadb8('0x31')][_0xadb8('0x3d')]+'%'};return _0x564901;})});}_0x5ec0e0=_[_0xadb8('0x47')]({},_0x5ec0e0,_0x5845b6[_0xadb8('0x3f')]);return _0x117d7e['getDescriptions'](_0x5ec0e0);}})[_0xadb8('0x24')](function(_0x237d2a){if(_0x237d2a){_0x127a55=_0x237d2a[_0xadb8('0x36')];if(!_0x5845b6['query'][_0xadb8('0x37')]('nolimit')){_0x5ec0e0[_0xadb8('0x1d')]=qs[_0xadb8('0x1d')](_0x5845b6['query'][_0xadb8('0x1d')]);_0x5ec0e0[_0xadb8('0x1b')]=qs[_0xadb8('0x1b')](_0x5845b6['query'][_0xadb8('0x1b')]);}return _0x117d7e[_0xadb8('0x50')](_0x5ec0e0);}})[_0xadb8('0x24')](function(_0x57a2de){if(_0x57a2de){return _0x57a2de?{'count':_0x127a55,'rows':_0x57a2de}:null;}})[_0xadb8('0x24')](respondWithResult(_0x1c90d0,null))[_0xadb8('0x49')](handleError(_0x1c90d0,null));};exports[_0xadb8('0x51')]=function(_0x498115,_0x3988c1,_0x58a85e){var _0x521029={};var _0x41b429={};var _0x1e4b1c;var _0x11192d;return db[_0xadb8('0x2c')][_0xadb8('0x4c')]({'where':{'id':_0x498115['params']['id']}})[_0xadb8('0x24')](handleEntityNotFound(_0x3988c1,null))['then'](function(_0x470b80){if(_0x470b80){_0x1e4b1c=_0x470b80;_0x41b429[_0xadb8('0x30')]=_[_0xadb8('0x45')](db[_0xadb8('0x52')]['rawAttributes']);_0x41b429[_0xadb8('0x31')]=_[_0xadb8('0x45')](_0x498115[_0xadb8('0x31')]);_0x41b429[_0xadb8('0x32')]=_[_0xadb8('0x33')](_0x41b429[_0xadb8('0x30')],_0x41b429['query']);_0x521029[_0xadb8('0x34')]=_[_0xadb8('0x33')](_0x41b429[_0xadb8('0x30')],qs['fields'](_0x498115[_0xadb8('0x31')][_0xadb8('0x35')]));_0x521029['attributes']=_0x521029[_0xadb8('0x34')][_0xadb8('0x36')]?_0x521029['attributes']:_0x41b429[_0xadb8('0x30')];_0x521029['order']=qs['sort'](_0x498115[_0xadb8('0x31')][_0xadb8('0x3a')]);_0x521029[_0xadb8('0x3b')]=qs['filters'](_['pick'](_0x498115[_0xadb8('0x31')],_0x41b429[_0xadb8('0x32')]));if(_0x498115[_0xadb8('0x31')][_0xadb8('0x3d')]){_0x521029[_0xadb8('0x3b')]=_[_0xadb8('0x47')](_0x521029[_0xadb8('0x3b')],{'$or':_[_0xadb8('0x2b')](_0x521029[_0xadb8('0x34')],function(_0x21868a){var _0x4a8407={};_0x4a8407[_0x21868a]={'$like':'%'+_0x498115[_0xadb8('0x31')]['filter']+'%'};return _0x4a8407;})});}_0x521029=_[_0xadb8('0x47')]({},_0x521029,_0x498115[_0xadb8('0x3f')]);return _0x1e4b1c[_0xadb8('0x51')](_0x521029);}})[_0xadb8('0x24')](function(_0x5e7180){if(_0x5e7180){_0x11192d=_0x5e7180['length'];if(!_0x498115['query'][_0xadb8('0x37')]('nolimit')){_0x521029[_0xadb8('0x1d')]=qs[_0xadb8('0x1d')](_0x498115['query'][_0xadb8('0x1d')]);_0x521029['offset']=qs[_0xadb8('0x1b')](_0x498115[_0xadb8('0x31')]['offset']);}return _0x1e4b1c[_0xadb8('0x51')](_0x521029);}})[_0xadb8('0x24')](function(_0x2a010e){if(_0x2a010e){return _0x2a010e?{'count':_0x11192d,'rows':_0x2a010e}:null;}})[_0xadb8('0x24')](respondWithResult(_0x3988c1,null))['catch'](handleError(_0x3988c1,null));};exports[_0xadb8('0x53')]=function(_0x34104e,_0x4e50d6,_0x1ee58e){if(_0x34104e['body']['id']){delete _0x34104e['body']['id'];}return db[_0xadb8('0x2c')]['findOne']({'where':{'id':_0x34104e[_0xadb8('0x44')]['id']}})[_0xadb8('0x24')](handleEntityNotFound(_0x4e50d6,null))[_0xadb8('0x24')](function(_0x1e686e){if(_0x1e686e){return _0x1e686e[_0xadb8('0x53')](_0x34104e[_0xadb8('0x4b')][_0xadb8('0x54')]||[]);}return null;})['then'](respondWithResult(_0x4e50d6,null))[_0xadb8('0x49')](handleError(_0x4e50d6,null));}; \ No newline at end of file +var _0xdd64=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','findAll','catch','params','includeAll','include','find','create','body','update','getFields','FreshdeskField','options','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x25c1f6,_0x4a75bc){var _0x20247b=function(_0x5c9757){while(--_0x5c9757){_0x25c1f6['push'](_0x25c1f6['shift']());}};_0x20247b(++_0x4a75bc);}(_0xdd64,0xaf));var _0x4dd6=function(_0xd85ded,_0x5bc576){_0xd85ded=_0xd85ded-0x0;var _0x19c544=_0xdd64[_0xd85ded];return _0x19c544;};'use strict';var emlformat=require(_0x4dd6('0x0'));var rimraf=require(_0x4dd6('0x1'));var zipdir=require(_0x4dd6('0x2'));var jsonpatch=require(_0x4dd6('0x3'));var rp=require(_0x4dd6('0x4'));var moment=require(_0x4dd6('0x5'));var BPromise=require(_0x4dd6('0x6'));var Mustache=require(_0x4dd6('0x7'));var util=require(_0x4dd6('0x8'));var path=require(_0x4dd6('0x9'));var sox=require('sox');var csv=require(_0x4dd6('0xa'));var ejs=require(_0x4dd6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4dd6('0xc'));var crypto=require(_0x4dd6('0xd'));var jsforce=require(_0x4dd6('0xe'));var deskjs=require(_0x4dd6('0xf'));var toCsv=require(_0x4dd6('0xa'));var querystring=require(_0x4dd6('0x10'));var Papa=require(_0x4dd6('0x11'));var Redis=require(_0x4dd6('0x12'));var authService=require(_0x4dd6('0x13'));var qs=require(_0x4dd6('0x14'));var as=require(_0x4dd6('0x15'));var hardwareService=require(_0x4dd6('0x16'));var logger=require(_0x4dd6('0x17'))(_0x4dd6('0x18'));var utils=require('../../config/utils');var config=require(_0x4dd6('0x19'));var licenseUtil=require(_0x4dd6('0x1a'));var db=require(_0x4dd6('0x1b'))['db'];function respondWithStatusCode(_0x1a9f2e,_0x2ed6dc){_0x2ed6dc=_0x2ed6dc||0xcc;return function(_0x1af144){if(_0x1af144){return _0x1a9f2e[_0x4dd6('0x1c')](_0x2ed6dc);}return _0x1a9f2e[_0x4dd6('0x1d')](_0x2ed6dc)[_0x4dd6('0x1e')]();};}function respondWithResult(_0x5f3f14,_0x4eb8d1){_0x4eb8d1=_0x4eb8d1||0xc8;return function(_0x314a55){if(_0x314a55){return _0x5f3f14[_0x4dd6('0x1d')](_0x4eb8d1)[_0x4dd6('0x1f')](_0x314a55);}};}function respondWithFilteredResult(_0x2bb203,_0x4644e2){return function(_0x8e1337){if(_0x8e1337){var _0xcd286e=typeof _0x4644e2['offset']===_0x4dd6('0x20')&&typeof _0x4644e2[_0x4dd6('0x21')]===_0x4dd6('0x20');var _0x477ec1=_0x8e1337[_0x4dd6('0x22')];var _0x287168=_0xcd286e?0x0:_0x4644e2[_0x4dd6('0x23')];var _0x317150=_0xcd286e?_0x8e1337['count']:_0x4644e2[_0x4dd6('0x23')]+_0x4644e2[_0x4dd6('0x21')];var _0x1674f5;if(_0x317150>=_0x477ec1){_0x317150=_0x477ec1;_0x1674f5=0xc8;}else{_0x1674f5=0xce;}_0x2bb203[_0x4dd6('0x1d')](_0x1674f5);return _0x2bb203[_0x4dd6('0x24')](_0x4dd6('0x25'),_0x287168+'-'+_0x317150+'/'+_0x477ec1)['json'](_0x8e1337);}return null;};}function patchUpdates(_0x62f8b2){return function(_0x2f663f){try{jsonpatch[_0x4dd6('0x26')](_0x2f663f,_0x62f8b2,!![]);}catch(_0x5cd66a){return BPromise[_0x4dd6('0x27')](_0x5cd66a);}return _0x2f663f['save']();};}function saveUpdates(_0x30077f,_0x122fa6){return function(_0x4f4f51){if(_0x4f4f51){return _0x4f4f51['update'](_0x30077f)[_0x4dd6('0x28')](function(_0x1791b4){return _0x1791b4;});}return null;};}function removeEntity(_0xcefea8,_0x284269){return function(_0x43932d){if(_0x43932d){return _0x43932d[_0x4dd6('0x29')]()['then'](function(){_0xcefea8['status'](0xcc)[_0x4dd6('0x1e')]();});}};}function handleEntityNotFound(_0x3b90d9,_0x513804){return function(_0x5149ad){if(!_0x5149ad){_0x3b90d9[_0x4dd6('0x1c')](0x194);}return _0x5149ad;};}function handleError(_0x4c94f4,_0x54fd5f){_0x54fd5f=_0x54fd5f||0x1f4;return function(_0x532988){logger['error'](_0x532988[_0x4dd6('0x2a')]);if(_0x532988[_0x4dd6('0x2b')]){delete _0x532988[_0x4dd6('0x2b')];}_0x4c94f4['status'](_0x54fd5f)[_0x4dd6('0x2c')](_0x532988);};}exports[_0x4dd6('0x2d')]=function(_0x1abb82,_0x11103e){var _0x3ae962={},_0x340b0e={},_0x4e7b7a={'count':0x0,'rows':[]};var _0x18a327=_[_0x4dd6('0x2e')](db[_0x4dd6('0x2f')][_0x4dd6('0x30')],function(_0x547f8a){return{'name':_0x547f8a[_0x4dd6('0x31')],'type':_0x547f8a[_0x4dd6('0x32')][_0x4dd6('0x33')]};});_0x340b0e[_0x4dd6('0x34')]=_[_0x4dd6('0x2e')](_0x18a327,'name');_0x340b0e[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x1abb82[_0x4dd6('0x35')]);_0x340b0e['filters']=_[_0x4dd6('0x37')](_0x340b0e[_0x4dd6('0x34')],_0x340b0e[_0x4dd6('0x35')]);_0x3ae962[_0x4dd6('0x38')]=_[_0x4dd6('0x37')](_0x340b0e[_0x4dd6('0x34')],qs[_0x4dd6('0x39')](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x39')]));_0x3ae962['attributes']=_0x3ae962[_0x4dd6('0x38')][_0x4dd6('0x3a')]?_0x3ae962[_0x4dd6('0x38')]:_0x340b0e[_0x4dd6('0x34')];if(!_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x3ae962[_0x4dd6('0x21')]=qs[_0x4dd6('0x21')](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x21')]);_0x3ae962['offset']=qs[_0x4dd6('0x23')](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x23')]);}_0x3ae962[_0x4dd6('0x3d')]=qs['sort'](_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x3e')]);_0x3ae962[_0x4dd6('0x3f')]=qs[_0x4dd6('0x40')](_[_0x4dd6('0x41')](_0x1abb82[_0x4dd6('0x35')],_0x340b0e[_0x4dd6('0x40')]),_0x18a327);if(_0x1abb82[_0x4dd6('0x35')]['filter']){_0x3ae962[_0x4dd6('0x3f')]=_['merge'](_0x3ae962['where'],{'$or':_[_0x4dd6('0x2e')](_0x18a327,function(_0x47bbbe){if(_0x47bbbe[_0x4dd6('0x32')]!==_0x4dd6('0x42')){var _0x38258e={};_0x38258e[_0x47bbbe[_0x4dd6('0x2b')]]={'$like':'%'+_0x1abb82[_0x4dd6('0x35')][_0x4dd6('0x43')]+'%'};return _0x38258e;}})});}_0x3ae962=_[_0x4dd6('0x44')]({},_0x3ae962,_0x1abb82['options']);var _0x1aac6c={'where':_0x3ae962[_0x4dd6('0x3f')]};return db[_0x4dd6('0x2f')][_0x4dd6('0x22')](_0x1aac6c)[_0x4dd6('0x28')](function(_0x4c5f8b){_0x4e7b7a['count']=_0x4c5f8b;if(_0x1abb82['query']['includeAll']){_0x3ae962['include']=[{'all':!![]}];}return db[_0x4dd6('0x2f')][_0x4dd6('0x45')](_0x3ae962);})[_0x4dd6('0x28')](function(_0x5e67dc){_0x4e7b7a['rows']=_0x5e67dc;return _0x4e7b7a;})[_0x4dd6('0x28')](respondWithFilteredResult(_0x11103e,_0x3ae962))[_0x4dd6('0x46')](handleError(_0x11103e,null));};exports['show']=function(_0x1923a2,_0x2cbdcb){var _0x465ad4={'raw':![],'where':{'id':_0x1923a2[_0x4dd6('0x47')]['id']}},_0x28c53c={};_0x28c53c['model']=_[_0x4dd6('0x36')](db['FreshdeskConfiguration']['rawAttributes']);_0x28c53c['query']=_['keys'](_0x1923a2[_0x4dd6('0x35')]);_0x28c53c[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x28c53c['model'],_0x28c53c[_0x4dd6('0x35')]);_0x465ad4[_0x4dd6('0x38')]=_['intersection'](_0x28c53c['model'],qs[_0x4dd6('0x39')](_0x1923a2[_0x4dd6('0x35')][_0x4dd6('0x39')]));_0x465ad4[_0x4dd6('0x38')]=_0x465ad4['attributes']['length']?_0x465ad4[_0x4dd6('0x38')]:_0x28c53c[_0x4dd6('0x34')];if(_0x1923a2[_0x4dd6('0x35')][_0x4dd6('0x48')]){_0x465ad4[_0x4dd6('0x49')]=[{'all':!![]}];}_0x465ad4=_[_0x4dd6('0x44')]({},_0x465ad4,_0x1923a2['options']);return db[_0x4dd6('0x2f')][_0x4dd6('0x4a')](_0x465ad4)[_0x4dd6('0x28')](handleEntityNotFound(_0x2cbdcb,null))['then'](respondWithResult(_0x2cbdcb,null))[_0x4dd6('0x46')](handleError(_0x2cbdcb,null));};exports[_0x4dd6('0x4b')]=function(_0x1d01e7,_0x519077){return db[_0x4dd6('0x2f')]['create'](_0x1d01e7[_0x4dd6('0x4c')],{})[_0x4dd6('0x28')](respondWithResult(_0x519077,0xc9))[_0x4dd6('0x46')](handleError(_0x519077,null));};exports[_0x4dd6('0x4d')]=function(_0x43c42f,_0x2551df){if(_0x43c42f[_0x4dd6('0x4c')]['id']){delete _0x43c42f[_0x4dd6('0x4c')]['id'];}return db[_0x4dd6('0x2f')][_0x4dd6('0x4a')]({'where':{'id':_0x43c42f[_0x4dd6('0x47')]['id']}})['then'](handleEntityNotFound(_0x2551df,null))[_0x4dd6('0x28')](saveUpdates(_0x43c42f[_0x4dd6('0x4c')],null))[_0x4dd6('0x28')](respondWithResult(_0x2551df,null))[_0x4dd6('0x46')](handleError(_0x2551df,null));};exports[_0x4dd6('0x29')]=function(_0x25aff9,_0xb55f88){return db[_0x4dd6('0x2f')][_0x4dd6('0x4a')]({'where':{'id':_0x25aff9['params']['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0xb55f88,null))[_0x4dd6('0x28')](removeEntity(_0xb55f88,null))['catch'](handleError(_0xb55f88,null));};exports[_0x4dd6('0x4e')]=function(_0x276817,_0x7b6513,_0x5df4ff){var _0x130c6b={};var _0x11ca09={};var _0x5c9e75;var _0x4ef5d3;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x276817[_0x4dd6('0x47')]['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0x7b6513,null))[_0x4dd6('0x28')](function(_0x3d5528){if(_0x3d5528){_0x5c9e75=_0x3d5528;_0x11ca09['model']=_[_0x4dd6('0x36')](db[_0x4dd6('0x4f')][_0x4dd6('0x30')]);_0x11ca09[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x276817[_0x4dd6('0x35')]);_0x11ca09[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x11ca09['model'],_0x11ca09[_0x4dd6('0x35')]);_0x130c6b[_0x4dd6('0x38')]=_['intersection'](_0x11ca09['model'],qs[_0x4dd6('0x39')](_0x276817['query'][_0x4dd6('0x39')]));_0x130c6b[_0x4dd6('0x38')]=_0x130c6b['attributes'][_0x4dd6('0x3a')]?_0x130c6b[_0x4dd6('0x38')]:_0x11ca09['model'];_0x130c6b[_0x4dd6('0x3d')]=qs['sort'](_0x276817['query']['sort']);_0x130c6b[_0x4dd6('0x3f')]=qs['filters'](_[_0x4dd6('0x41')](_0x276817[_0x4dd6('0x35')],_0x11ca09[_0x4dd6('0x40')]));if(_0x276817['query'][_0x4dd6('0x43')]){_0x130c6b['where']=_[_0x4dd6('0x44')](_0x130c6b['where'],{'$or':_[_0x4dd6('0x2e')](_0x130c6b[_0x4dd6('0x38')],function(_0x53d9d2){var _0x491e8b={};_0x491e8b[_0x53d9d2]={'$like':'%'+_0x276817['query']['filter']+'%'};return _0x491e8b;})});}_0x130c6b=_[_0x4dd6('0x44')]({},_0x130c6b,_0x276817[_0x4dd6('0x50')]);return _0x5c9e75['getFields'](_0x130c6b);}})[_0x4dd6('0x28')](function(_0x5e6a83){if(_0x5e6a83){_0x4ef5d3=_0x5e6a83[_0x4dd6('0x3a')];if(!_0x276817[_0x4dd6('0x35')][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x130c6b['limit']=qs[_0x4dd6('0x21')](_0x276817[_0x4dd6('0x35')]['limit']);_0x130c6b[_0x4dd6('0x23')]=qs[_0x4dd6('0x23')](_0x276817['query'][_0x4dd6('0x23')]);}return _0x5c9e75[_0x4dd6('0x4e')](_0x130c6b);}})[_0x4dd6('0x28')](function(_0x2be5ad){if(_0x2be5ad){return _0x2be5ad?{'count':_0x4ef5d3,'rows':_0x2be5ad}:null;}})[_0x4dd6('0x28')](respondWithResult(_0x7b6513,null))[_0x4dd6('0x46')](handleError(_0x7b6513,null));};exports[_0x4dd6('0x51')]=function(_0x4d5c86,_0x25cd90,_0x5e3487){var _0x1f5709={};var _0x33db64={};var _0x5e141e;var _0x914e06;return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x4d5c86['params']['id']}})['then'](handleEntityNotFound(_0x25cd90,null))[_0x4dd6('0x28')](function(_0x1249bc){if(_0x1249bc){_0x5e141e=_0x1249bc;_0x33db64[_0x4dd6('0x34')]=_['keys'](db[_0x4dd6('0x4f')][_0x4dd6('0x30')]);_0x33db64[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x4d5c86[_0x4dd6('0x35')]);_0x33db64[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x33db64['model'],_0x33db64['query']);_0x1f5709[_0x4dd6('0x38')]=_[_0x4dd6('0x37')](_0x33db64[_0x4dd6('0x34')],qs[_0x4dd6('0x39')](_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x39')]));_0x1f5709['attributes']=_0x1f5709['attributes'][_0x4dd6('0x3a')]?_0x1f5709[_0x4dd6('0x38')]:_0x33db64[_0x4dd6('0x34')];_0x1f5709['order']=qs[_0x4dd6('0x3e')](_0x4d5c86['query'][_0x4dd6('0x3e')]);_0x1f5709[_0x4dd6('0x3f')]=qs['filters'](_['pick'](_0x4d5c86[_0x4dd6('0x35')],_0x33db64['filters']));if(_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x43')]){_0x1f5709[_0x4dd6('0x3f')]=_[_0x4dd6('0x44')](_0x1f5709[_0x4dd6('0x3f')],{'$or':_[_0x4dd6('0x2e')](_0x1f5709['attributes'],function(_0x2477e7){var _0x20c0b5={};_0x20c0b5[_0x2477e7]={'$like':'%'+_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x43')]+'%'};return _0x20c0b5;})});}_0x1f5709=_[_0x4dd6('0x44')]({},_0x1f5709,_0x4d5c86[_0x4dd6('0x50')]);return _0x5e141e['getSubjects'](_0x1f5709);}})[_0x4dd6('0x28')](function(_0x29ad30){if(_0x29ad30){_0x914e06=_0x29ad30[_0x4dd6('0x3a')];if(!_0x4d5c86[_0x4dd6('0x35')]['hasOwnProperty'](_0x4dd6('0x3c'))){_0x1f5709['limit']=qs[_0x4dd6('0x21')](_0x4d5c86[_0x4dd6('0x35')][_0x4dd6('0x21')]);_0x1f5709['offset']=qs[_0x4dd6('0x23')](_0x4d5c86['query'][_0x4dd6('0x23')]);}return _0x5e141e['getSubjects'](_0x1f5709);}})[_0x4dd6('0x28')](function(_0x4fc214){if(_0x4fc214){return _0x4fc214?{'count':_0x914e06,'rows':_0x4fc214}:null;}})[_0x4dd6('0x28')](respondWithResult(_0x25cd90,null))[_0x4dd6('0x46')](handleError(_0x25cd90,null));};exports['getDescriptions']=function(_0x429267,_0xef97bf,_0x3e8229){var _0x39b254={};var _0x5c2dc5={};var _0xdb1d8e;var _0x5497f2;return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x429267['params']['id']}})['then'](handleEntityNotFound(_0xef97bf,null))[_0x4dd6('0x28')](function(_0x3350f0){if(_0x3350f0){_0xdb1d8e=_0x3350f0;_0x5c2dc5['model']=_[_0x4dd6('0x36')](db['FreshdeskField'][_0x4dd6('0x30')]);_0x5c2dc5[_0x4dd6('0x35')]=_[_0x4dd6('0x36')](_0x429267[_0x4dd6('0x35')]);_0x5c2dc5[_0x4dd6('0x40')]=_['intersection'](_0x5c2dc5[_0x4dd6('0x34')],_0x5c2dc5[_0x4dd6('0x35')]);_0x39b254[_0x4dd6('0x38')]=_['intersection'](_0x5c2dc5[_0x4dd6('0x34')],qs[_0x4dd6('0x39')](_0x429267['query']['fields']));_0x39b254[_0x4dd6('0x38')]=_0x39b254[_0x4dd6('0x38')][_0x4dd6('0x3a')]?_0x39b254[_0x4dd6('0x38')]:_0x5c2dc5['model'];_0x39b254[_0x4dd6('0x3d')]=qs[_0x4dd6('0x3e')](_0x429267['query'][_0x4dd6('0x3e')]);_0x39b254['where']=qs[_0x4dd6('0x40')](_[_0x4dd6('0x41')](_0x429267[_0x4dd6('0x35')],_0x5c2dc5[_0x4dd6('0x40')]));if(_0x429267[_0x4dd6('0x35')][_0x4dd6('0x43')]){_0x39b254[_0x4dd6('0x3f')]=_[_0x4dd6('0x44')](_0x39b254[_0x4dd6('0x3f')],{'$or':_[_0x4dd6('0x2e')](_0x39b254[_0x4dd6('0x38')],function(_0x46dba9){var _0x135337={};_0x135337[_0x46dba9]={'$like':'%'+_0x429267['query'][_0x4dd6('0x43')]+'%'};return _0x135337;})});}_0x39b254=_[_0x4dd6('0x44')]({},_0x39b254,_0x429267[_0x4dd6('0x50')]);return _0xdb1d8e[_0x4dd6('0x53')](_0x39b254);}})[_0x4dd6('0x28')](function(_0x18c4df){if(_0x18c4df){_0x5497f2=_0x18c4df['length'];if(!_0x429267[_0x4dd6('0x35')][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x39b254[_0x4dd6('0x21')]=qs[_0x4dd6('0x21')](_0x429267['query'][_0x4dd6('0x21')]);_0x39b254[_0x4dd6('0x23')]=qs[_0x4dd6('0x23')](_0x429267[_0x4dd6('0x35')][_0x4dd6('0x23')]);}return _0xdb1d8e[_0x4dd6('0x53')](_0x39b254);}})[_0x4dd6('0x28')](function(_0x19d1f7){if(_0x19d1f7){return _0x19d1f7?{'count':_0x5497f2,'rows':_0x19d1f7}:null;}})['then'](respondWithResult(_0xef97bf,null))[_0x4dd6('0x46')](handleError(_0xef97bf,null));};exports[_0x4dd6('0x54')]=function(_0x23a9d6,_0x3b6d65,_0x4de604){var _0x366a57={};var _0x15cd97={};var _0x2f8d1b;var _0xa18d8f;return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x23a9d6['params']['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0x3b6d65,null))[_0x4dd6('0x28')](function(_0x2b3fee){if(_0x2b3fee){_0x2f8d1b=_0x2b3fee;_0x15cd97[_0x4dd6('0x34')]=_[_0x4dd6('0x36')](db[_0x4dd6('0x55')][_0x4dd6('0x30')]);_0x15cd97['query']=_['keys'](_0x23a9d6[_0x4dd6('0x35')]);_0x15cd97[_0x4dd6('0x40')]=_[_0x4dd6('0x37')](_0x15cd97[_0x4dd6('0x34')],_0x15cd97[_0x4dd6('0x35')]);_0x366a57[_0x4dd6('0x38')]=_[_0x4dd6('0x37')](_0x15cd97['model'],qs['fields'](_0x23a9d6['query'][_0x4dd6('0x39')]));_0x366a57['attributes']=_0x366a57[_0x4dd6('0x38')][_0x4dd6('0x3a')]?_0x366a57[_0x4dd6('0x38')]:_0x15cd97[_0x4dd6('0x34')];_0x366a57[_0x4dd6('0x3d')]=qs[_0x4dd6('0x3e')](_0x23a9d6['query'][_0x4dd6('0x3e')]);_0x366a57[_0x4dd6('0x3f')]=qs[_0x4dd6('0x40')](_[_0x4dd6('0x41')](_0x23a9d6[_0x4dd6('0x35')],_0x15cd97[_0x4dd6('0x40')]));if(_0x23a9d6[_0x4dd6('0x35')]['filter']){_0x366a57[_0x4dd6('0x3f')]=_['merge'](_0x366a57['where'],{'$or':_[_0x4dd6('0x2e')](_0x366a57[_0x4dd6('0x38')],function(_0x20c015){var _0x4769ef={};_0x4769ef[_0x20c015]={'$like':'%'+_0x23a9d6[_0x4dd6('0x35')]['filter']+'%'};return _0x4769ef;})});}_0x366a57=_['merge']({},_0x366a57,_0x23a9d6[_0x4dd6('0x50')]);return _0x2f8d1b[_0x4dd6('0x54')](_0x366a57);}})['then'](function(_0x1939ca){if(_0x1939ca){_0xa18d8f=_0x1939ca['length'];if(!_0x23a9d6['query'][_0x4dd6('0x3b')](_0x4dd6('0x3c'))){_0x366a57[_0x4dd6('0x21')]=qs[_0x4dd6('0x21')](_0x23a9d6[_0x4dd6('0x35')][_0x4dd6('0x21')]);_0x366a57[_0x4dd6('0x23')]=qs[_0x4dd6('0x23')](_0x23a9d6['query'][_0x4dd6('0x23')]);}return _0x2f8d1b[_0x4dd6('0x54')](_0x366a57);}})[_0x4dd6('0x28')](function(_0xdaea6){if(_0xdaea6){return _0xdaea6?{'count':_0xa18d8f,'rows':_0xdaea6}:null;}})[_0x4dd6('0x28')](respondWithResult(_0x3b6d65,null))[_0x4dd6('0x46')](handleError(_0x3b6d65,null));};exports[_0x4dd6('0x56')]=function(_0x1a106f,_0x15e837,_0x2b6300){if(_0x1a106f[_0x4dd6('0x4c')]['id']){delete _0x1a106f['body']['id'];}return db[_0x4dd6('0x2f')][_0x4dd6('0x52')]({'where':{'id':_0x1a106f[_0x4dd6('0x47')]['id']}})[_0x4dd6('0x28')](handleEntityNotFound(_0x15e837,null))[_0x4dd6('0x28')](function(_0x365c51){if(_0x365c51){return _0x365c51['setTags'](_0x1a106f[_0x4dd6('0x4c')][_0x4dd6('0x57')]||[]);}return null;})['then'](respondWithResult(_0x15e837,null))['catch'](handleError(_0x15e837,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 40f1743..19d9898 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 _0x8fb1=['./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8fb1,0x10c));var _0x18fb=function(_0x635bc2,_0x1c3ad9){_0x635bc2=_0x635bc2-0x0;var _0x59372c=_0x8fb1[_0x635bc2];return _0x59372c;};'use strict';var _=require(_0x18fb('0x0'));var util=require(_0x18fb('0x1'));var logger=require('../../config/logger')(_0x18fb('0x2'));var moment=require(_0x18fb('0x3'));var BPromise=require(_0x18fb('0x4'));var rp=require(_0x18fb('0x5'));var fs=require('fs');var path=require(_0x18fb('0x6'));var rimraf=require('rimraf');var config=require(_0x18fb('0x7'));var attributes=require(_0x18fb('0x8'));module[_0x18fb('0x9')]=function(_0x1a90c5,_0x30c1f7){return _0x1a90c5['define'](_0x18fb('0xa'),attributes,{'tableName':_0x18fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb008=['exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0xb008,0xdf));var _0x8b00=function(_0x1b5689,_0x36d5b6){_0x1b5689=_0x1b5689-0x0;var _0x53295d=_0xb008[_0x1b5689];return _0x53295d;};'use strict';var _=require(_0x8b00('0x0'));var util=require(_0x8b00('0x1'));var logger=require('../../config/logger')(_0x8b00('0x2'));var moment=require(_0x8b00('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b00('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b00('0x5'));var config=require(_0x8b00('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x8b00('0x7')]=function(_0x49c38b,_0x24bccc){return _0x49c38b['define'](_0x8b00('0x8'),attributes,{'tableName':_0x8b00('0x9'),'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 d2110d2..808126e 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 _0x3253=['code','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1fef50,_0x13d9b7){var _0x158f36=function(_0x3953d8){while(--_0x3953d8){_0x1fef50['push'](_0x1fef50['shift']());}};_0x158f36(++_0x13d9b7);}(_0x3253,0xcd));var _0x3325=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x3253[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0x3325('0x0'));var util=require(_0x3325('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3325('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3325('0x3'))['db'];var utils=require(_0x3325('0x4'));var logger=require('../../config/logger')(_0x3325('0x5'));var config=require('../../config/environment');var jayson=require(_0x3325('0x6'));var client=jayson[_0x3325('0x7')][_0x3325('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x588690,_0x119e77,_0x3ea61b){return new BPromise(function(_0x517b32,_0x430ee8){return client['request'](_0x588690,_0x3ea61b)['then'](function(_0x20c193){logger['info'](_0x3325('0x9'),_0x119e77,_0x3325('0xa'));logger[_0x3325('0xb')](_0x3325('0xc'),_0x119e77,_0x3325('0xa'),JSON[_0x3325('0xd')](_0x20c193));if(_0x20c193[_0x3325('0xe')]){if(_0x20c193[_0x3325('0xe')][_0x3325('0xf')]===0x1f4){logger[_0x3325('0xe')](_0x3325('0x9'),_0x119e77,_0x20c193[_0x3325('0xe')][_0x3325('0x10')]);return _0x430ee8(_0x20c193['error'][_0x3325('0x10')]);}logger[_0x3325('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x119e77,_0x20c193[_0x3325('0xe')]['message']);return _0x517b32(_0x20c193[_0x3325('0xe')][_0x3325('0x10')]);}else{logger[_0x3325('0x11')](_0x3325('0x9'),_0x119e77,_0x3325('0xa'));_0x517b32(_0x20c193[_0x3325('0x12')]['message']);}})[_0x3325('0x13')](function(_0x4a29a0){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x119e77,_0x4a29a0);_0x430ee8(_0x4a29a0);});});} \ No newline at end of file +var _0xf4ce=['error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x47b409,_0x4fb731){var _0x2fdefb=function(_0x2f61ae){while(--_0x2f61ae){_0x47b409['push'](_0x47b409['shift']());}};_0x2fdefb(++_0x4fb731);}(_0xf4ce,0x16a));var _0xef4c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf4ce[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xef4c('0x0'));var util=require(_0xef4c('0x1'));var moment=require(_0xef4c('0x2'));var BPromise=require(_0xef4c('0x3'));var rs=require(_0xef4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef4c('0x5'))['db'];var utils=require(_0xef4c('0x6'));var logger=require(_0xef4c('0x7'))(_0xef4c('0x8'));var config=require(_0xef4c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xef4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39e75c,_0x10a6ad,_0x46a3b0){return new BPromise(function(_0x5639b3,_0x4a1ac1){return client['request'](_0x39e75c,_0x46a3b0)[_0xef4c('0xb')](function(_0x5ad9b6){logger[_0xef4c('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x10a6ad,'request\x20sent');logger['debug'](_0xef4c('0xd'),_0x10a6ad,_0xef4c('0xe'),JSON[_0xef4c('0xf')](_0x5ad9b6));if(_0x5ad9b6[_0xef4c('0x10')]){if(_0x5ad9b6['error']['code']===0x1f4){logger['error'](_0xef4c('0x11'),_0x10a6ad,_0x5ad9b6[_0xef4c('0x10')][_0xef4c('0x12')]);return _0x4a1ac1(_0x5ad9b6[_0xef4c('0x10')]['message']);}logger[_0xef4c('0x10')](_0xef4c('0x11'),_0x10a6ad,_0x5ad9b6[_0xef4c('0x10')][_0xef4c('0x12')]);return _0x5639b3(_0x5ad9b6['error'][_0xef4c('0x12')]);}else{logger[_0xef4c('0xc')](_0xef4c('0x11'),_0x10a6ad,_0xef4c('0xe'));_0x5639b3(_0x5ad9b6[_0xef4c('0x13')][_0xef4c('0x12')]);}})[_0xef4c('0x14')](function(_0x17dd6e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x10a6ad,_0x17dd6e);_0x4a1ac1(_0x17dd6e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3241343..652fbc9 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 _0x3e3a=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete'];(function(_0x1158e1,_0x31b137){var _0x22ff3d=function(_0x4bf2ed){while(--_0x4bf2ed){_0x1158e1['push'](_0x1158e1['shift']());}};_0x22ff3d(++_0x31b137);}(_0x3e3a,0x1dc));var _0xa3e3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3e3a[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xa3e3('0x0'));var util=require('util');var path=require(_0xa3e3('0x1'));var timeout=require(_0xa3e3('0x2'));var express=require(_0xa3e3('0x3'));var router=express['Router']();var fs_extra=require(_0xa3e3('0x4'));var auth=require(_0xa3e3('0x5'));var interaction=require(_0xa3e3('0x6'));var config=require(_0xa3e3('0x7'));var controller=require(_0xa3e3('0x8'));router[_0xa3e3('0x9')]('/',auth[_0xa3e3('0xa')](),controller[_0xa3e3('0xb')]);router[_0xa3e3('0x9')]('/:id',auth[_0xa3e3('0xa')](),controller[_0xa3e3('0xc')]);router[_0xa3e3('0xd')]('/',auth['isAuthenticated'](),controller[_0xa3e3('0xe')]);router[_0xa3e3('0xf')](_0xa3e3('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xa3e3('0x11')](_0xa3e3('0x10'),auth[_0xa3e3('0xa')](),controller['destroy']);module[_0xa3e3('0x12')]=router; \ No newline at end of file +var _0xcc58=['fs-extra','../../components/interaction/service','../../config/environment','get','index','post','create','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4ded61,_0x133b6b){var _0x2dcbea=function(_0x4804ab){while(--_0x4804ab){_0x4ded61['push'](_0x4ded61['shift']());}};_0x2dcbea(++_0x133b6b);}(_0xcc58,0x1e8));var _0x8cc5=function(_0x18c743,_0x58c7dc){_0x18c743=_0x18c743-0x0;var _0x391638=_0xcc58[_0x18c743];return _0x391638;};'use strict';var multer=require(_0x8cc5('0x0'));var util=require(_0x8cc5('0x1'));var path=require('path');var timeout=require(_0x8cc5('0x2'));var express=require(_0x8cc5('0x3'));var router=express[_0x8cc5('0x4')]();var fs_extra=require(_0x8cc5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8cc5('0x6'));var config=require(_0x8cc5('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x8cc5('0x8')]('/',auth['isAuthenticated'](),controller[_0x8cc5('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8cc5('0xa')]('/',auth['isAuthenticated'](),controller[_0x8cc5('0xb')]);router['put'](_0x8cc5('0xc'),auth[_0x8cc5('0xd')](),controller['update']);router[_0x8cc5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8cc5('0xf')]);module[_0x8cc5('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 65968ae..14aa618 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 _0xc711=['picklist','string','STRING','BOOLEAN','exports','variable','customVariable','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc711,0xbc));var _0x1c71=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0xc711[_0x378b4];return _0x11d07b;};'use strict';var Sequelize=require('sequelize');module[_0x1c71('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x1c71('0x1'),_0x1c71('0x2'),_0x1c71('0x3'),_0x1c71('0x4')),'defaultValue':_0x1c71('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1c71('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1c71('0x5'),_0x1c71('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x1c71('0x6')]},'idField':{'type':Sequelize[_0x1c71('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1c71('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c71('0x6')]}}; \ No newline at end of file +var _0xa246=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa246,0x182));var _0x6a24=function(_0x54621d,_0x46e154){_0x54621d=_0x54621d-0x0;var _0x19c48c=_0xa246[_0x54621d];return _0x19c48c;};'use strict';var Sequelize=require(_0x6a24('0x0'));module[_0x6a24('0x1')]={'type':{'type':Sequelize[_0x6a24('0x2')](_0x6a24('0x3'),_0x6a24('0x4'),_0x6a24('0x5'),_0x6a24('0x6'),_0x6a24('0x7')),'defaultValue':_0x6a24('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6a24('0x3'),'variable',_0x6a24('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6a24('0x8')]},'nameField':{'type':Sequelize[_0x6a24('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a24('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e9e59ab..d1eafb6 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 _0xda3f=['keys','filters','intersection','attributes','fields','nolimit','sort','filter','where','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','map','key','model','query'];(function(_0x1cf9b6,_0x209cc3){var _0x27ff1c=function(_0x9535f6){while(--_0x9535f6){_0x1cf9b6['push'](_0x1cf9b6['shift']());}};_0x27ff1c(++_0x209cc3);}(_0xda3f,0xec));var _0xfda3=function(_0x46fc1d,_0x1550ad){_0x46fc1d=_0x46fc1d-0x0;var _0x587b3f=_0xda3f[_0x46fc1d];return _0x587b3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['index']=function(_0x3c1549,_0x4101b1){var _0x301509={},_0x474992={},_0xe21ec6={'count':0x0,'rows':[]};var _0x3cfeb2=_[_0xfda3('0x28')](db['FreshdeskField']['rawAttributes'],function(_0x3aef3c){return{'name':_0x3aef3c['fieldName'],'type':_0x3aef3c['type'][_0xfda3('0x29')]};});_0x474992[_0xfda3('0x2a')]=_[_0xfda3('0x28')](_0x3cfeb2,_0xfda3('0x26'));_0x474992[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x3c1549[_0xfda3('0x2b')]);_0x474992[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x474992['model'],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2f')]=_[_0xfda3('0x2e')](_0x474992[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x301509[_0xfda3('0x2f')]=_0x301509[_0xfda3('0x2f')]['length']?_0x301509['attributes']:_0x474992[_0xfda3('0x2a')];if(!_0x3c1549[_0xfda3('0x2b')]['hasOwnProperty'](_0xfda3('0x31'))){_0x301509[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3c1549['query'][_0xfda3('0x1b')]);_0x301509[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x19')]);}_0x301509['order']=qs[_0xfda3('0x32')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x32')]);_0x301509['where']=qs[_0xfda3('0x2d')](_['pick'](_0x3c1549[_0xfda3('0x2b')],_0x474992[_0xfda3('0x2d')]),_0x3cfeb2);if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x33')]){_0x301509[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x301509[_0xfda3('0x34')],{'$or':_[_0xfda3('0x28')](_0x3cfeb2,function(_0x577be8){if(_0x577be8[_0xfda3('0x36')]!==_0xfda3('0x37')){var _0xd2dde0={};_0xd2dde0[_0x577be8[_0xfda3('0x26')]]={'$like':'%'+_0x3c1549['query'][_0xfda3('0x33')]+'%'};return _0xd2dde0;}})});}_0x301509=_[_0xfda3('0x35')]({},_0x301509,_0x3c1549[_0xfda3('0x38')]);var _0x5bad90={'where':_0x301509['where']};return db[_0xfda3('0x39')][_0xfda3('0x1c')](_0x5bad90)[_0xfda3('0x23')](function(_0x1aaa6c){_0xe21ec6[_0xfda3('0x1c')]=_0x1aaa6c;if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x301509[_0xfda3('0x3b')]=[{'all':!![]}];}return db[_0xfda3('0x39')][_0xfda3('0x3c')](_0x301509);})['then'](function(_0x27200f){_0xe21ec6[_0xfda3('0x3d')]=_0x27200f;return _0xe21ec6;})['then'](respondWithFilteredResult(_0x4101b1,_0x301509))[_0xfda3('0x3e')](handleError(_0x4101b1,null));};exports['show']=function(_0x51a314,_0x4e6886){var _0x2208bc={'raw':!![],'where':{'id':_0x51a314[_0xfda3('0x3f')]['id']}},_0x107fb1={};_0x107fb1[_0xfda3('0x2a')]=_['keys'](db[_0xfda3('0x39')][_0xfda3('0x40')]);_0x107fb1[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x51a314['query']);_0x107fb1[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],_0x107fb1['query']);_0x2208bc['attributes']=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x51a314[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x2208bc[_0xfda3('0x2f')]=_0x2208bc[_0xfda3('0x2f')][_0xfda3('0x41')]?_0x2208bc[_0xfda3('0x2f')]:_0x107fb1[_0xfda3('0x2a')];if(_0x51a314[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x2208bc[_0xfda3('0x3b')]=[{'all':!![]}];}_0x2208bc=_[_0xfda3('0x35')]({},_0x2208bc,_0x51a314['options']);return db['FreshdeskField'][_0xfda3('0x42')](_0x2208bc)[_0xfda3('0x23')](handleEntityNotFound(_0x4e6886,null))[_0xfda3('0x23')](respondWithResult(_0x4e6886,null))[_0xfda3('0x3e')](handleError(_0x4e6886,null));};exports[_0xfda3('0x43')]=function(_0x60a89d,_0x192133){return db[_0xfda3('0x39')][_0xfda3('0x43')](_0x60a89d[_0xfda3('0x44')],{})['then'](respondWithResult(_0x192133,0xc9))[_0xfda3('0x3e')](handleError(_0x192133,null));};exports[_0xfda3('0x22')]=function(_0x481356,_0x36aa3a){if(_0x481356[_0xfda3('0x44')]['id']){delete _0x481356['body']['id'];}return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x481356[_0xfda3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x23')](saveUpdates(_0x481356[_0xfda3('0x44')],null))[_0xfda3('0x23')](respondWithResult(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));};exports[_0xfda3('0x45')]=function(_0x33565d,_0x2f54eb){return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x33565d['params']['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2f54eb,null))['then'](removeEntity(_0x2f54eb,null))[_0xfda3('0x3e')](handleError(_0x2f54eb,null));}; \ No newline at end of file +var _0x593e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','map','FreshdeskField','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x5151e8,_0x4cc286){var _0x39a3bd=function(_0x2fb213){while(--_0x2fb213){_0x5151e8['push'](_0x5151e8['shift']());}};_0x39a3bd(++_0x4cc286);}(_0x593e,0xcb));var _0xe593=function(_0x14e5a4,_0x46699d){_0x14e5a4=_0x14e5a4-0x0;var _0x859da8=_0x593e[_0x14e5a4];return _0x859da8;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];function respondWithStatusCode(_0x8ee313,_0x31dad0){_0x31dad0=_0x31dad0||0xcc;return function(_0x24c9fd){if(_0x24c9fd){return _0x8ee313[_0xe593('0x1c')](_0x31dad0);}return _0x8ee313[_0xe593('0x1d')](_0x31dad0)[_0xe593('0x1e')]();};}function respondWithResult(_0x499819,_0x2907e4){_0x2907e4=_0x2907e4||0xc8;return function(_0x1de391){if(_0x1de391){return _0x499819['status'](_0x2907e4)[_0xe593('0x1f')](_0x1de391);}};}function respondWithFilteredResult(_0x44837b,_0x5d4c6a){return function(_0x2ae9b6){if(_0x2ae9b6){var _0x40416c=typeof _0x5d4c6a[_0xe593('0x20')]===_0xe593('0x21')&&typeof _0x5d4c6a[_0xe593('0x22')]===_0xe593('0x21');var _0x48f3b4=_0x2ae9b6[_0xe593('0x23')];var _0x470d07=_0x40416c?0x0:_0x5d4c6a['offset'];var _0xd1020e=_0x40416c?_0x2ae9b6[_0xe593('0x23')]:_0x5d4c6a['offset']+_0x5d4c6a[_0xe593('0x22')];var _0x3dba1b;if(_0xd1020e>=_0x48f3b4){_0xd1020e=_0x48f3b4;_0x3dba1b=0xc8;}else{_0x3dba1b=0xce;}_0x44837b[_0xe593('0x1d')](_0x3dba1b);return _0x44837b[_0xe593('0x24')](_0xe593('0x25'),_0x470d07+'-'+_0xd1020e+'/'+_0x48f3b4)[_0xe593('0x1f')](_0x2ae9b6);}return null;};}function patchUpdates(_0x3d2a51){return function(_0x4ea53f){try{jsonpatch['apply'](_0x4ea53f,_0x3d2a51,!![]);}catch(_0x1634d4){return BPromise['reject'](_0x1634d4);}return _0x4ea53f['save']();};}function saveUpdates(_0x1bb8e8,_0x3c65b5){return function(_0x57379d){if(_0x57379d){return _0x57379d[_0xe593('0x26')](_0x1bb8e8)['then'](function(_0x1672bf){return _0x1672bf;});}return null;};}function removeEntity(_0x2c191f,_0x185cea){return function(_0x44d997){if(_0x44d997){return _0x44d997[_0xe593('0x27')]()[_0xe593('0x28')](function(){_0x2c191f[_0xe593('0x1d')](0xcc)[_0xe593('0x1e')]();});}};}function handleEntityNotFound(_0x4fc483,_0x47aea){return function(_0x347d7d){if(!_0x347d7d){_0x4fc483['sendStatus'](0x194);}return _0x347d7d;};}function handleError(_0x59bd4c,_0xf8d492){_0xf8d492=_0xf8d492||0x1f4;return function(_0x25238f){logger[_0xe593('0x29')](_0x25238f[_0xe593('0x2a')]);if(_0x25238f[_0xe593('0x2b')]){delete _0x25238f[_0xe593('0x2b')];}_0x59bd4c['status'](_0xf8d492)[_0xe593('0x2c')](_0x25238f);};}exports['index']=function(_0x1dacf6,_0xda61a7){var _0x4a2eaa={},_0x337ee0={},_0x561a01={'count':0x0,'rows':[]};var _0x44a68c=_[_0xe593('0x2d')](db[_0xe593('0x2e')]['rawAttributes'],function(_0x1ae8d9){return{'name':_0x1ae8d9[_0xe593('0x2f')],'type':_0x1ae8d9[_0xe593('0x30')][_0xe593('0x31')]};});_0x337ee0[_0xe593('0x32')]=_[_0xe593('0x2d')](_0x44a68c,_0xe593('0x2b'));_0x337ee0['query']=_[_0xe593('0x33')](_0x1dacf6[_0xe593('0x34')]);_0x337ee0['filters']=_[_0xe593('0x35')](_0x337ee0['model'],_0x337ee0[_0xe593('0x34')]);_0x4a2eaa[_0xe593('0x36')]=_[_0xe593('0x35')](_0x337ee0[_0xe593('0x32')],qs[_0xe593('0x37')](_0x1dacf6[_0xe593('0x34')][_0xe593('0x37')]));_0x4a2eaa[_0xe593('0x36')]=_0x4a2eaa[_0xe593('0x36')][_0xe593('0x38')]?_0x4a2eaa['attributes']:_0x337ee0[_0xe593('0x32')];if(!_0x1dacf6[_0xe593('0x34')][_0xe593('0x39')]('nolimit')){_0x4a2eaa['limit']=qs[_0xe593('0x22')](_0x1dacf6['query'][_0xe593('0x22')]);_0x4a2eaa[_0xe593('0x20')]=qs[_0xe593('0x20')](_0x1dacf6[_0xe593('0x34')][_0xe593('0x20')]);}_0x4a2eaa[_0xe593('0x3a')]=qs[_0xe593('0x3b')](_0x1dacf6['query']['sort']);_0x4a2eaa[_0xe593('0x3c')]=qs['filters'](_[_0xe593('0x3d')](_0x1dacf6['query'],_0x337ee0[_0xe593('0x3e')]),_0x44a68c);if(_0x1dacf6['query']['filter']){_0x4a2eaa[_0xe593('0x3c')]=_[_0xe593('0x3f')](_0x4a2eaa[_0xe593('0x3c')],{'$or':_['map'](_0x44a68c,function(_0x55d902){if(_0x55d902['type']!==_0xe593('0x40')){var _0x584945={};_0x584945[_0x55d902[_0xe593('0x2b')]]={'$like':'%'+_0x1dacf6[_0xe593('0x34')][_0xe593('0x41')]+'%'};return _0x584945;}})});}_0x4a2eaa=_[_0xe593('0x3f')]({},_0x4a2eaa,_0x1dacf6['options']);var _0x196325={'where':_0x4a2eaa['where']};return db[_0xe593('0x2e')]['count'](_0x196325)['then'](function(_0x590d34){_0x561a01[_0xe593('0x23')]=_0x590d34;if(_0x1dacf6['query'][_0xe593('0x42')]){_0x4a2eaa[_0xe593('0x43')]=[{'all':!![]}];}return db[_0xe593('0x2e')]['findAll'](_0x4a2eaa);})[_0xe593('0x28')](function(_0x3f9784){_0x561a01[_0xe593('0x44')]=_0x3f9784;return _0x561a01;})[_0xe593('0x28')](respondWithFilteredResult(_0xda61a7,_0x4a2eaa))[_0xe593('0x45')](handleError(_0xda61a7,null));};exports[_0xe593('0x46')]=function(_0x1236bb,_0x2e14d3){var _0x4b36e1={'raw':!![],'where':{'id':_0x1236bb[_0xe593('0x47')]['id']}},_0x211065={};_0x211065[_0xe593('0x32')]=_[_0xe593('0x33')](db[_0xe593('0x2e')]['rawAttributes']);_0x211065['query']=_[_0xe593('0x33')](_0x1236bb[_0xe593('0x34')]);_0x211065[_0xe593('0x3e')]=_['intersection'](_0x211065[_0xe593('0x32')],_0x211065[_0xe593('0x34')]);_0x4b36e1['attributes']=_['intersection'](_0x211065[_0xe593('0x32')],qs[_0xe593('0x37')](_0x1236bb[_0xe593('0x34')]['fields']));_0x4b36e1[_0xe593('0x36')]=_0x4b36e1[_0xe593('0x36')][_0xe593('0x38')]?_0x4b36e1[_0xe593('0x36')]:_0x211065['model'];if(_0x1236bb['query']['includeAll']){_0x4b36e1['include']=[{'all':!![]}];}_0x4b36e1=_[_0xe593('0x3f')]({},_0x4b36e1,_0x1236bb['options']);return db[_0xe593('0x2e')][_0xe593('0x48')](_0x4b36e1)[_0xe593('0x28')](handleEntityNotFound(_0x2e14d3,null))[_0xe593('0x28')](respondWithResult(_0x2e14d3,null))[_0xe593('0x45')](handleError(_0x2e14d3,null));};exports[_0xe593('0x49')]=function(_0x7b6f77,_0x297c3e){return db['FreshdeskField'][_0xe593('0x49')](_0x7b6f77[_0xe593('0x4a')],{})[_0xe593('0x28')](respondWithResult(_0x297c3e,0xc9))['catch'](handleError(_0x297c3e,null));};exports[_0xe593('0x26')]=function(_0x5dfdb1,_0x39ec9e){if(_0x5dfdb1[_0xe593('0x4a')]['id']){delete _0x5dfdb1[_0xe593('0x4a')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x5dfdb1[_0xe593('0x47')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x39ec9e,null))['then'](saveUpdates(_0x5dfdb1['body'],null))['then'](respondWithResult(_0x39ec9e,null))['catch'](handleError(_0x39ec9e,null));};exports['destroy']=function(_0x383645,_0x1e48d8){return db[_0xe593('0x2e')][_0xe593('0x48')]({'where':{'id':_0x383645[_0xe593('0x47')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x1e48d8,null))[_0xe593('0x28')](removeEntity(_0x1e48d8,null))[_0xe593('0x45')](handleError(_0x1e48d8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2b77e57..f6c55b0 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 _0x6f6b=['rimraf','../../config/environment','exports','define','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x58b650,_0x5027a8){var _0x3f158b=function(_0xe0d8da){while(--_0xe0d8da){_0x58b650['push'](_0x58b650['shift']());}};_0x3f158b(++_0x5027a8);}(_0x6f6b,0x77));var _0xb6f6=function(_0x2c1b1c,_0x5e9c8e){_0x2c1b1c=_0x2c1b1c-0x0;var _0x1520fb=_0x6f6b[_0x2c1b1c];return _0x1520fb;};'use strict';var _=require(_0xb6f6('0x0'));var util=require(_0xb6f6('0x1'));var logger=require('../../config/logger')(_0xb6f6('0x2'));var moment=require(_0xb6f6('0x3'));var BPromise=require(_0xb6f6('0x4'));var rp=require(_0xb6f6('0x5'));var fs=require('fs');var path=require(_0xb6f6('0x6'));var rimraf=require(_0xb6f6('0x7'));var config=require(_0xb6f6('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0xb6f6('0x9')]=function(_0x877188,_0x5226b8){return _0x877188[_0xb6f6('0xa')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xb6f6('0xb'),'fields':[_0xb6f6('0xc'),_0xb6f6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b19=['FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','freshdesk_unique_index'];(function(_0x5c8614,_0x126dca){var _0x4ca884=function(_0x28543d){while(--_0x28543d){_0x5c8614['push'](_0x5c8614['shift']());}};_0x4ca884(++_0x126dca);}(_0x6b19,0xe8));var _0x96b1=function(_0x1736be,_0x3061d2){_0x1736be=_0x1736be-0x0;var _0x44f4f4=_0x6b19[_0x1736be];return _0x44f4f4;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var logger=require('../../config/logger')(_0x96b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96b1('0x3'));var fs=require('fs');var path=require(_0x96b1('0x4'));var rimraf=require(_0x96b1('0x5'));var config=require(_0x96b1('0x6'));var attributes=require(_0x96b1('0x7'));module['exports']=function(_0x8b5ab8,_0x546193){return _0x8b5ab8[_0x96b1('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x96b1('0x9'),'fields':['idField',_0x96b1('0xa')],'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 c6049bd..ed55904 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 _0x4bc6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x48fa41,_0x511025){var _0x1eaa99=function(_0x549e85){while(--_0x549e85){_0x48fa41['push'](_0x48fa41['shift']());}};_0x1eaa99(++_0x511025);}(_0x4bc6,0xe3));var _0x64bc=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x4bc6[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x64bc('0x0'));var util=require('util');var moment=require(_0x64bc('0x1'));var BPromise=require(_0x64bc('0x2'));var rs=require(_0x64bc('0x3'));var fs=require('fs');var Redis=require(_0x64bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x64bc('0x5'));var logger=require(_0x64bc('0x6'))(_0x64bc('0x7'));var config=require(_0x64bc('0x8'));var jayson=require(_0x64bc('0x9'));var client=jayson[_0x64bc('0xa')][_0x64bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5115f7,_0x2621d9,_0xbe1233){return new BPromise(function(_0x55ad22,_0x4687a6){return client[_0x64bc('0xc')](_0x5115f7,_0xbe1233)[_0x64bc('0xd')](function(_0x314d84){logger[_0x64bc('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x2621d9,_0x64bc('0xf'));logger['debug'](_0x64bc('0x10'),_0x2621d9,_0x64bc('0xf'),JSON[_0x64bc('0x11')](_0x314d84));if(_0x314d84[_0x64bc('0x12')]){if(_0x314d84[_0x64bc('0x12')]['code']===0x1f4){logger[_0x64bc('0x12')](_0x64bc('0x13'),_0x2621d9,_0x314d84[_0x64bc('0x12')][_0x64bc('0x14')]);return _0x4687a6(_0x314d84[_0x64bc('0x12')][_0x64bc('0x14')]);}logger['error'](_0x64bc('0x13'),_0x2621d9,_0x314d84[_0x64bc('0x12')][_0x64bc('0x14')]);return _0x55ad22(_0x314d84['error'][_0x64bc('0x14')]);}else{logger[_0x64bc('0xe')](_0x64bc('0x13'),_0x2621d9,'request\x20sent');_0x55ad22(_0x314d84[_0x64bc('0x15')][_0x64bc('0x14')]);}})[_0x64bc('0x16')](function(_0x424851){logger[_0x64bc('0x12')](_0x64bc('0x13'),_0x2621d9,_0x424851);_0x4687a6(_0x424851);});});} \ No newline at end of file +var _0x898e=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x31c949,_0x3203cb){var _0x584fb5=function(_0x4bd390){while(--_0x4bd390){_0x31c949['push'](_0x31c949['shift']());}};_0x584fb5(++_0x3203cb);}(_0x898e,0x8a));var _0xe898=function(_0x2537a2,_0x26f290){_0x2537a2=_0x2537a2-0x0;var _0xb761ac=_0x898e[_0x2537a2];return _0xb761ac;};'use strict';var _=require(_0xe898('0x0'));var util=require(_0xe898('0x1'));var moment=require(_0xe898('0x2'));var BPromise=require(_0xe898('0x3'));var rs=require(_0xe898('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe898('0x5'))['db'];var utils=require(_0xe898('0x6'));var logger=require('../../config/logger')(_0xe898('0x7'));var config=require(_0xe898('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe898('0x9')][_0xe898('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d7cf8,_0x11fb0d,_0x10629f){return new BPromise(function(_0x56be92,_0x1580ae){return client[_0xe898('0xb')](_0x5d7cf8,_0x10629f)[_0xe898('0xc')](function(_0x55b6ca){logger[_0xe898('0xd')](_0xe898('0xe'),_0x11fb0d,_0xe898('0xf'));logger[_0xe898('0x10')](_0xe898('0x11'),_0x11fb0d,_0xe898('0xf'),JSON[_0xe898('0x12')](_0x55b6ca));if(_0x55b6ca[_0xe898('0x13')]){if(_0x55b6ca[_0xe898('0x13')][_0xe898('0x14')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x11fb0d,_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);return _0x1580ae(_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);}logger[_0xe898('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x11fb0d,_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);return _0x56be92(_0x55b6ca[_0xe898('0x13')][_0xe898('0x15')]);}else{logger[_0xe898('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x11fb0d,_0xe898('0xf'));_0x56be92(_0x55b6ca[_0xe898('0x16')]['message']);}})[_0xe898('0x17')](function(_0x5b867d){logger['error'](_0xe898('0xe'),_0x11fb0d,_0x5b867d);_0x1580ae(_0x5b867d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a21ac7f..5bff6d4 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 _0xea28=['index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get'];(function(_0x37c336,_0x4fb8f1){var _0x1e8775=function(_0x39835d){while(--_0x39835d){_0x37c336['push'](_0x37c336['shift']());}};_0x1e8775(++_0x4fb8f1);}(_0xea28,0x13a));var _0x8ea2=function(_0x9e1f88,_0x1bce88){_0x9e1f88=_0x9e1f88-0x0;var _0x41dd0c=_0xea28[_0x9e1f88];return _0x41dd0c;};'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['getFields']);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router[_0x8ea2('0x13')]('/:id/configurations',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller['update']);router[_0x8ea2('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);module[_0x8ea2('0x18')]=router; \ No newline at end of file +var _0x0972=['create','addConfiguration','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x0972,0x64));var _0x2097=function(_0x2b610e,_0x5bc192){_0x2b610e=_0x2b610e-0x0;var _0x4b7611=_0x0972[_0x2b610e];return _0x4b7611;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['getConfigurations']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0xe')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0xe')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);router[_0x2097('0x11')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x13')]);router[_0x2097('0x14')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x15')]);module[_0x2097('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 90fd593..250fd5b 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 _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x51ce27,_0x526a47){var _0x11e068=function(_0x27e2cd){while(--_0x27e2cd){_0x51ce27['push'](_0x51ce27['shift']());}};_0x11e068(++_0x526a47);}(_0x4991,0xf7));var _0x1499=function(_0xc90da7,_0x145cdd){_0xc90da7=_0xc90da7-0x0;var _0x5db878=_0x4991[_0xc90da7];return _0x5db878;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7880=['exports','STRING','username','remoteUri'];(function(_0x1a58cf,_0x7ce26c){var _0x4b30cd=function(_0x56fc85){while(--_0x56fc85){_0x1a58cf['push'](_0x1a58cf['shift']());}};_0x4b30cd(++_0x7ce26c);}(_0x7880,0x1f4));var _0x0788=function(_0x34651f,_0x1b07dd){_0x34651f=_0x34651f-0x0;var _0x2d88fe=_0x7880[_0x34651f];return _0x2d88fe;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 45dd56c..df85f11 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 _0x6951=['error','stack','name','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','destroy','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6951,0x180));var _0x1695=function(_0x4bf904,_0xa8c8a2){_0x4bf904=_0x4bf904-0x0;var _0x3fea03=_0x6951[_0x4bf904];return _0x3fea03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1695('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1695('0x1'));var rp=require(_0x1695('0x2'));var moment=require(_0x1695('0x3'));var BPromise=require(_0x1695('0x4'));var Mustache=require(_0x1695('0x5'));var util=require('util');var path=require(_0x1695('0x6'));var sox=require(_0x1695('0x7'));var csv=require(_0x1695('0x8'));var ejs=require(_0x1695('0x9'));var fs=require('fs');var fs_extra=require(_0x1695('0xa'));var _=require(_0x1695('0xb'));var squel=require(_0x1695('0xc'));var crypto=require(_0x1695('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1695('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1695('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1695('0xf'));var hardwareService=require(_0x1695('0x10'));var logger=require(_0x1695('0x11'))(_0x1695('0x12'));var utils=require(_0x1695('0x13'));var config=require(_0x1695('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1695('0x15'))['db'];var integrations=require(_0x1695('0x16'));function respondWithStatusCode(_0x58d64d,_0x137fdd){_0x137fdd=_0x137fdd||0xcc;return function(_0x47dcbd){if(_0x47dcbd){return _0x58d64d[_0x1695('0x17')](_0x137fdd);}return _0x58d64d[_0x1695('0x18')](_0x137fdd)[_0x1695('0x19')]();};}function respondWithResult(_0x38981f,_0x184ff3){_0x184ff3=_0x184ff3||0xc8;return function(_0x99a46b){if(_0x99a46b){return _0x38981f['status'](_0x184ff3)[_0x1695('0x1a')](_0x99a46b);}};}function respondWithFilteredResult(_0xb19135,_0x158bce){return function(_0x525985){if(_0x525985){var _0x41c98c=typeof _0x158bce[_0x1695('0x1b')]===_0x1695('0x1c')&&typeof _0x158bce['limit']===_0x1695('0x1c');var _0x553d13=_0x525985['count'];var _0x1d8912=_0x41c98c?0x0:_0x158bce[_0x1695('0x1b')];var _0xe0b97a=_0x41c98c?_0x525985[_0x1695('0x1d')]:_0x158bce[_0x1695('0x1b')]+_0x158bce[_0x1695('0x1e')];var _0x11678c;if(_0xe0b97a>=_0x553d13){_0xe0b97a=_0x553d13;_0x11678c=0xc8;}else{_0x11678c=0xce;}_0xb19135[_0x1695('0x18')](_0x11678c);return _0xb19135[_0x1695('0x1f')](_0x1695('0x20'),_0x1d8912+'-'+_0xe0b97a+'/'+_0x553d13)[_0x1695('0x1a')](_0x525985);}return null;};}function patchUpdates(_0xe07d19){return function(_0xa3a920){try{jsonpatch[_0x1695('0x21')](_0xa3a920,_0xe07d19,!![]);}catch(_0x573c2a){return BPromise[_0x1695('0x22')](_0x573c2a);}return _0xa3a920['save']();};}function saveUpdates(_0x123903,_0x2950b9){return function(_0x1f117d){if(_0x1f117d){return _0x1f117d['update'](_0x123903)[_0x1695('0x23')](function(_0x373002){return _0x373002;});}return null;};}function removeEntity(_0x13c4ec,_0xc53c75){return function(_0x5f3a43){if(_0x5f3a43){return _0x5f3a43['destroy']()[_0x1695('0x23')](function(){_0x13c4ec[_0x1695('0x18')](0xcc)[_0x1695('0x19')]();});}};}function handleEntityNotFound(_0x53adeb,_0x30f078){return function(_0x3e6637){if(!_0x3e6637){_0x53adeb[_0x1695('0x17')](0x194);}return _0x3e6637;};}function handleError(_0x158549,_0x2390fc){_0x2390fc=_0x2390fc||0x1f4;return function(_0x5cdac8){logger[_0x1695('0x24')](_0x5cdac8[_0x1695('0x25')]);if(_0x5cdac8[_0x1695('0x26')]){delete _0x5cdac8[_0x1695('0x26')];}_0x158549[_0x1695('0x18')](_0x2390fc)['send'](_0x5cdac8);};}exports['index']=function(_0x53a698,_0xce43b5){var _0x624ecf={},_0x4a0a5e={},_0x380202={'count':0x0,'rows':[]};var _0x8133a8=_[_0x1695('0x27')](db[_0x1695('0x28')][_0x1695('0x29')],function(_0x50d125){return{'name':_0x50d125[_0x1695('0x2a')],'type':_0x50d125[_0x1695('0x2b')][_0x1695('0x2c')]};});_0x4a0a5e[_0x1695('0x2d')]=_[_0x1695('0x27')](_0x8133a8,_0x1695('0x26'));_0x4a0a5e[_0x1695('0x2e')]=_['keys'](_0x53a698[_0x1695('0x2e')]);_0x4a0a5e['filters']=_[_0x1695('0x2f')](_0x4a0a5e[_0x1695('0x2d')],_0x4a0a5e[_0x1695('0x2e')]);_0x624ecf[_0x1695('0x30')]=_['intersection'](_0x4a0a5e[_0x1695('0x2d')],qs[_0x1695('0x31')](_0x53a698['query'][_0x1695('0x31')]));_0x624ecf[_0x1695('0x30')]=_0x624ecf[_0x1695('0x30')][_0x1695('0x32')]?_0x624ecf['attributes']:_0x4a0a5e['model'];if(!_0x53a698['query'][_0x1695('0x33')](_0x1695('0x34'))){_0x624ecf[_0x1695('0x1e')]=qs[_0x1695('0x1e')](_0x53a698[_0x1695('0x2e')]['limit']);_0x624ecf['offset']=qs[_0x1695('0x1b')](_0x53a698[_0x1695('0x2e')][_0x1695('0x1b')]);}_0x624ecf[_0x1695('0x35')]=qs[_0x1695('0x36')](_0x53a698[_0x1695('0x2e')][_0x1695('0x36')]);_0x624ecf[_0x1695('0x37')]=qs[_0x1695('0x38')](_[_0x1695('0x39')](_0x53a698[_0x1695('0x2e')],_0x4a0a5e[_0x1695('0x38')]),_0x8133a8);if(_0x53a698['query'][_0x1695('0x3a')]){_0x624ecf[_0x1695('0x37')]=_[_0x1695('0x3b')](_0x624ecf['where'],{'$or':_['map'](_0x8133a8,function(_0x28d096){if(_0x28d096[_0x1695('0x2b')]!==_0x1695('0x3c')){var _0x329fcc={};_0x329fcc[_0x28d096[_0x1695('0x26')]]={'$like':'%'+_0x53a698[_0x1695('0x2e')][_0x1695('0x3a')]+'%'};return _0x329fcc;}})});}_0x624ecf=_['merge']({},_0x624ecf,_0x53a698[_0x1695('0x3d')]);var _0x422a20={'where':_0x624ecf['where']};return db['FreshsalesAccount']['count'](_0x422a20)[_0x1695('0x23')](function(_0x2c0cbb){_0x380202[_0x1695('0x1d')]=_0x2c0cbb;if(_0x53a698[_0x1695('0x2e')][_0x1695('0x3e')]){_0x624ecf[_0x1695('0x3f')]=[{'all':!![]}];}return db[_0x1695('0x28')]['findAll'](_0x624ecf);})[_0x1695('0x23')](function(_0x110810){_0x380202[_0x1695('0x40')]=_0x110810;return _0x380202;})[_0x1695('0x23')](respondWithFilteredResult(_0xce43b5,_0x624ecf))[_0x1695('0x41')](handleError(_0xce43b5,null));};exports[_0x1695('0x42')]=function(_0x706b71,_0x2af3c7){var _0x11b66b={'raw':![],'where':{'id':_0x706b71[_0x1695('0x43')]['id']}},_0x42d0e0={};_0x42d0e0[_0x1695('0x2d')]=_['keys'](db[_0x1695('0x28')][_0x1695('0x29')]);_0x42d0e0[_0x1695('0x2e')]=_[_0x1695('0x44')](_0x706b71[_0x1695('0x2e')]);_0x42d0e0[_0x1695('0x38')]=_[_0x1695('0x2f')](_0x42d0e0['model'],_0x42d0e0[_0x1695('0x2e')]);_0x11b66b[_0x1695('0x30')]=_[_0x1695('0x2f')](_0x42d0e0[_0x1695('0x2d')],qs[_0x1695('0x31')](_0x706b71[_0x1695('0x2e')][_0x1695('0x31')]));_0x11b66b[_0x1695('0x30')]=_0x11b66b[_0x1695('0x30')]['length']?_0x11b66b[_0x1695('0x30')]:_0x42d0e0[_0x1695('0x2d')];if(_0x706b71['query'][_0x1695('0x3e')]){_0x11b66b['include']=[{'all':!![]}];}_0x11b66b=_[_0x1695('0x3b')]({},_0x11b66b,_0x706b71[_0x1695('0x3d')]);return db[_0x1695('0x28')][_0x1695('0x45')](_0x11b66b)['then'](handleEntityNotFound(_0x2af3c7,null))['then'](respondWithResult(_0x2af3c7,null))[_0x1695('0x41')](handleError(_0x2af3c7,null));};exports[_0x1695('0x46')]=function(_0x2d9fa1,_0x2850bb){return db[_0x1695('0x28')][_0x1695('0x46')](_0x2d9fa1[_0x1695('0x47')],{})[_0x1695('0x23')](respondWithResult(_0x2850bb,0xc9))[_0x1695('0x41')](handleError(_0x2850bb,null));};exports[_0x1695('0x48')]=function(_0x563d9d,_0x331177){if(_0x563d9d[_0x1695('0x47')]['id']){delete _0x563d9d[_0x1695('0x47')]['id'];}return db[_0x1695('0x28')]['find']({'where':{'id':_0x563d9d['params']['id']}})[_0x1695('0x23')](handleEntityNotFound(_0x331177,null))[_0x1695('0x23')](saveUpdates(_0x563d9d[_0x1695('0x47')],null))[_0x1695('0x23')](respondWithResult(_0x331177,null))['catch'](handleError(_0x331177,null));};exports[_0x1695('0x49')]=function(_0x43ec8c,_0x4397d2){return db[_0x1695('0x28')][_0x1695('0x45')]({'where':{'id':_0x43ec8c['params']['id']}})[_0x1695('0x23')](handleEntityNotFound(_0x4397d2,null))[_0x1695('0x23')](removeEntity(_0x4397d2,null))[_0x1695('0x41')](handleError(_0x4397d2,null));};exports[_0x1695('0x4a')]=function(_0x30241a,_0x1fbc35,_0x4bdd8c){var _0x2869eb={};var _0xed5f6e={};var _0x2d34d8;var _0x4f6c1a;return db[_0x1695('0x28')][_0x1695('0x4b')]({'where':{'id':_0x30241a[_0x1695('0x43')]['id']}})[_0x1695('0x23')](handleEntityNotFound(_0x1fbc35,null))[_0x1695('0x23')](function(_0x544702){if(_0x544702){_0x2d34d8=_0x544702;_0xed5f6e[_0x1695('0x2d')]=_[_0x1695('0x44')](db[_0x1695('0x4c')][_0x1695('0x29')]);_0xed5f6e[_0x1695('0x2e')]=_[_0x1695('0x44')](_0x30241a[_0x1695('0x2e')]);_0xed5f6e['filters']=_[_0x1695('0x2f')](_0xed5f6e['model'],_0xed5f6e[_0x1695('0x2e')]);_0x2869eb[_0x1695('0x30')]=_[_0x1695('0x2f')](_0xed5f6e[_0x1695('0x2d')],qs[_0x1695('0x31')](_0x30241a[_0x1695('0x2e')][_0x1695('0x31')]));_0x2869eb['attributes']=_0x2869eb[_0x1695('0x30')]['length']?_0x2869eb[_0x1695('0x30')]:_0xed5f6e['model'];_0x2869eb[_0x1695('0x35')]=qs['sort'](_0x30241a[_0x1695('0x2e')][_0x1695('0x36')]);_0x2869eb['where']=qs[_0x1695('0x38')](_[_0x1695('0x39')](_0x30241a[_0x1695('0x2e')],_0xed5f6e[_0x1695('0x38')]));if(_0x30241a[_0x1695('0x2e')][_0x1695('0x3a')]){_0x2869eb[_0x1695('0x37')]=_[_0x1695('0x3b')](_0x2869eb[_0x1695('0x37')],{'$or':_[_0x1695('0x27')](_0x2869eb[_0x1695('0x30')],function(_0x1f526b){var _0x25387a={};_0x25387a[_0x1f526b]={'$like':'%'+_0x30241a['query'][_0x1695('0x3a')]+'%'};return _0x25387a;})});}_0x2869eb=_[_0x1695('0x3b')]({},_0x2869eb,_0x30241a['options']);return _0x2d34d8[_0x1695('0x4a')](_0x2869eb);}})['then'](function(_0xdea330){if(_0xdea330){_0x4f6c1a=_0xdea330['length'];if(!_0x30241a[_0x1695('0x2e')][_0x1695('0x33')](_0x1695('0x34'))){_0x2869eb[_0x1695('0x1e')]=qs[_0x1695('0x1e')](_0x30241a[_0x1695('0x2e')]['limit']);_0x2869eb[_0x1695('0x1b')]=qs[_0x1695('0x1b')](_0x30241a['query'][_0x1695('0x1b')]);}return _0x2d34d8[_0x1695('0x4a')](_0x2869eb);}})[_0x1695('0x23')](function(_0x74dde7){if(_0x74dde7){return _0x74dde7?{'count':_0x4f6c1a,'rows':_0x74dde7}:null;}})[_0x1695('0x23')](respondWithResult(_0x1fbc35,null))[_0x1695('0x41')](handleError(_0x1fbc35,null));};exports[_0x1695('0x4d')]=function(_0x196e67,_0x3f6f26,_0x3d1314){if(_0x196e67[_0x1695('0x47')]['id']){delete _0x196e67['body']['id'];}return db[_0x1695('0x28')][_0x1695('0x4b')]({'where':{'id':_0x196e67[_0x1695('0x43')]['id']}})[_0x1695('0x23')](handleEntityNotFound(_0x3f6f26,null))[_0x1695('0x23')](function(_0x2af780){if(_0x2af780){_0x196e67[_0x1695('0x47')][_0x1695('0x4e')]=_0x2af780['id'];_0x196e67[_0x1695('0x47')][_0x1695('0x4f')]=integrations[_0x1695('0x50')](_0x196e67[_0x1695('0x47')][_0x1695('0x51')],_0x196e67['body'][_0x1695('0x2b')]);_0x196e67[_0x1695('0x47')][_0x1695('0x52')]=integrations[_0x1695('0x53')](_0x196e67['body'][_0x1695('0x51')],_0x196e67[_0x1695('0x47')][_0x1695('0x2b')]);return db[_0x1695('0x4c')][_0x1695('0x46')](_0x196e67[_0x1695('0x47')],{'include':[{'model':db[_0x1695('0x54')],'as':_0x1695('0x4f')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x1695('0x23')](respondWithResult(_0x3f6f26,null))[_0x1695('0x41')](handleError(_0x3f6f26,null));};exports[_0x1695('0x55')]=function(_0x2092b5,_0x389ab3,_0x2893e1){var _0x2e5f7c='';var _0x597b26='';return db[_0x1695('0x28')][_0x1695('0x4b')]({'where':{'id':_0x2092b5[_0x1695('0x43')]['id']},'attributes':['id',_0x1695('0x56'),_0x1695('0x57'),'apiKey']})[_0x1695('0x23')](handleEntityNotFound(_0x389ab3,null))[_0x1695('0x23')](function(_0x14d357){if(_0x14d357){_0x597b26=_0x14d357[_0x1695('0x56')];_0x2e5f7c=_0x14d357[_0x1695('0x57')];var _0x365a15=_0x14d357['remoteUri'][_0x1695('0x58')](-0x1);if(_0x365a15==='/'){_0x2e5f7c=_0x2e5f7c[_0x1695('0x59')](0x0,_0x2e5f7c[_0x1695('0x5a')](_0x365a15));}return rp({'method':_0x1695('0x5b'),'uri':util[_0x1695('0x5c')](_0x1695('0x5d'),_0x2e5f7c,_0x1695('0x5e')),'headers':{'Authorization':_0x1695('0x5f')+_0x14d357[_0x1695('0x60')]},'json':!![]});}})['then'](function(_0xdedf5d){if(_0xdedf5d){var _0x3bb246=_0xdedf5d[_0x1695('0x61')];var _0x58dcf6=![];var _0xa16906=null;for(_0xa16906=0x0;_0xa16906<_0x3bb246['length'];_0xa16906++){if(_0x3bb246[_0xa16906][_0x1695('0x62')]===_0x597b26){_0x58dcf6=!![];}}if(_0x58dcf6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1695('0x63')});}}})[_0x1695('0x23')](respondWithResult(_0x389ab3,null))[_0x1695('0x41')](function(_0x2159b9){var _0x389236=_0x2092b5[_0x1695('0x2e')][_0x1695('0x64')]?0x1f4:_0x2159b9[_0x1695('0x65')]||0x1f4;logger['error'](_0x1695('0x66'),_0x1695('0x55'),_0x389236,JSON[_0x1695('0x67')](_0x2159b9));delete _0x2159b9[_0x1695('0x26')];if(_0x389236===0x191){_0x389236=0x190;}_0x389ab3[_0x1695('0x18')](_0x389236)['send'](_0x2092b5[_0x1695('0x2e')][_0x1695('0x64')]?{'message':_0x1695('0x68'),'statusCode':_0x2159b9[_0x1695('0x65')]}:_0x2159b9);});}; \ No newline at end of file +var _0x5c91=['../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','%s%s','/api/selector/owners','Token\x20token=','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1d6e70,_0x19134f){var _0x42d627=function(_0x18c993){while(--_0x18c993){_0x1d6e70['push'](_0x1d6e70['shift']());}};_0x42d627(++_0x19134f);}(_0x5c91,0x110));var _0x15c9=function(_0x448ec7,_0x5c3f72){_0x448ec7=_0x448ec7-0x0;var _0x234108=_0x5c91[_0x448ec7];return _0x234108;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x15c9('0x0'));var rp=require(_0x15c9('0x1'));var moment=require(_0x15c9('0x2'));var BPromise=require(_0x15c9('0x3'));var Mustache=require(_0x15c9('0x4'));var util=require(_0x15c9('0x5'));var path=require('path');var sox=require(_0x15c9('0x6'));var csv=require(_0x15c9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15c9('0x8'));var squel=require('squel');var crypto=require(_0x15c9('0x9'));var jsforce=require(_0x15c9('0xa'));var deskjs=require(_0x15c9('0xb'));var toCsv=require(_0x15c9('0x7'));var querystring=require(_0x15c9('0xc'));var Papa=require('papaparse');var Redis=require(_0x15c9('0xd'));var authService=require(_0x15c9('0xe'));var qs=require(_0x15c9('0xf'));var as=require(_0x15c9('0x10'));var hardwareService=require(_0x15c9('0x11'));var logger=require(_0x15c9('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x15c9('0x13'));var licenseUtil=require(_0x15c9('0x14'));var db=require(_0x15c9('0x15'))['db'];var integrations=require(_0x15c9('0x16'));function respondWithStatusCode(_0x4fc27a,_0x51c8d4){_0x51c8d4=_0x51c8d4||0xcc;return function(_0x2a681b){if(_0x2a681b){return _0x4fc27a['sendStatus'](_0x51c8d4);}return _0x4fc27a[_0x15c9('0x17')](_0x51c8d4)[_0x15c9('0x18')]();};}function respondWithResult(_0x32d0ae,_0x35223c){_0x35223c=_0x35223c||0xc8;return function(_0x3bd4bd){if(_0x3bd4bd){return _0x32d0ae[_0x15c9('0x17')](_0x35223c)[_0x15c9('0x19')](_0x3bd4bd);}};}function respondWithFilteredResult(_0xd8cd52,_0x3eae5a){return function(_0x1d8a0c){if(_0x1d8a0c){var _0x2b7f5b=typeof _0x3eae5a['offset']===_0x15c9('0x1a')&&typeof _0x3eae5a[_0x15c9('0x1b')]===_0x15c9('0x1a');var _0x156a26=_0x1d8a0c[_0x15c9('0x1c')];var _0x50ff64=_0x2b7f5b?0x0:_0x3eae5a['offset'];var _0x284597=_0x2b7f5b?_0x1d8a0c[_0x15c9('0x1c')]:_0x3eae5a['offset']+_0x3eae5a[_0x15c9('0x1b')];var _0x3888b8;if(_0x284597>=_0x156a26){_0x284597=_0x156a26;_0x3888b8=0xc8;}else{_0x3888b8=0xce;}_0xd8cd52[_0x15c9('0x17')](_0x3888b8);return _0xd8cd52['set'](_0x15c9('0x1d'),_0x50ff64+'-'+_0x284597+'/'+_0x156a26)[_0x15c9('0x19')](_0x1d8a0c);}return null;};}function patchUpdates(_0x4dfdd5){return function(_0x10e6d8){try{jsonpatch[_0x15c9('0x1e')](_0x10e6d8,_0x4dfdd5,!![]);}catch(_0x512352){return BPromise[_0x15c9('0x1f')](_0x512352);}return _0x10e6d8[_0x15c9('0x20')]();};}function saveUpdates(_0xa01119,_0x1afde){return function(_0x48564d){if(_0x48564d){return _0x48564d[_0x15c9('0x21')](_0xa01119)[_0x15c9('0x22')](function(_0x54f739){return _0x54f739;});}return null;};}function removeEntity(_0x5114fe,_0x4fb2e1){return function(_0x15c59d){if(_0x15c59d){return _0x15c59d[_0x15c9('0x23')]()[_0x15c9('0x22')](function(){_0x5114fe[_0x15c9('0x17')](0xcc)[_0x15c9('0x18')]();});}};}function handleEntityNotFound(_0x50954a,_0x57b5c5){return function(_0x3c04e6){if(!_0x3c04e6){_0x50954a[_0x15c9('0x24')](0x194);}return _0x3c04e6;};}function handleError(_0x4a7576,_0x3c0728){_0x3c0728=_0x3c0728||0x1f4;return function(_0x59c851){logger['error'](_0x59c851[_0x15c9('0x25')]);if(_0x59c851['name']){delete _0x59c851['name'];}_0x4a7576['status'](_0x3c0728)[_0x15c9('0x26')](_0x59c851);};}exports[_0x15c9('0x27')]=function(_0x430a02,_0xd56d86){var _0x18cb7b={},_0x35a5c9={},_0x472d04={'count':0x0,'rows':[]};var _0x2137b9=_[_0x15c9('0x28')](db[_0x15c9('0x29')][_0x15c9('0x2a')],function(_0x1a82b){return{'name':_0x1a82b['fieldName'],'type':_0x1a82b[_0x15c9('0x2b')][_0x15c9('0x2c')]};});_0x35a5c9[_0x15c9('0x2d')]=_[_0x15c9('0x28')](_0x2137b9,_0x15c9('0x2e'));_0x35a5c9[_0x15c9('0x2f')]=_['keys'](_0x430a02[_0x15c9('0x2f')]);_0x35a5c9[_0x15c9('0x30')]=_[_0x15c9('0x31')](_0x35a5c9[_0x15c9('0x2d')],_0x35a5c9[_0x15c9('0x2f')]);_0x18cb7b[_0x15c9('0x32')]=_[_0x15c9('0x31')](_0x35a5c9[_0x15c9('0x2d')],qs['fields'](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x33')]));_0x18cb7b[_0x15c9('0x32')]=_0x18cb7b[_0x15c9('0x32')][_0x15c9('0x34')]?_0x18cb7b[_0x15c9('0x32')]:_0x35a5c9[_0x15c9('0x2d')];if(!_0x430a02[_0x15c9('0x2f')][_0x15c9('0x35')](_0x15c9('0x36'))){_0x18cb7b[_0x15c9('0x1b')]=qs[_0x15c9('0x1b')](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x1b')]);_0x18cb7b[_0x15c9('0x37')]=qs['offset'](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x37')]);}_0x18cb7b[_0x15c9('0x38')]=qs[_0x15c9('0x39')](_0x430a02[_0x15c9('0x2f')][_0x15c9('0x39')]);_0x18cb7b['where']=qs[_0x15c9('0x30')](_[_0x15c9('0x3a')](_0x430a02['query'],_0x35a5c9[_0x15c9('0x30')]),_0x2137b9);if(_0x430a02['query'][_0x15c9('0x3b')]){_0x18cb7b['where']=_[_0x15c9('0x3c')](_0x18cb7b[_0x15c9('0x3d')],{'$or':_[_0x15c9('0x28')](_0x2137b9,function(_0x243c53){if(_0x243c53[_0x15c9('0x2b')]!==_0x15c9('0x3e')){var _0xedabf6={};_0xedabf6[_0x243c53[_0x15c9('0x2e')]]={'$like':'%'+_0x430a02[_0x15c9('0x2f')][_0x15c9('0x3b')]+'%'};return _0xedabf6;}})});}_0x18cb7b=_[_0x15c9('0x3c')]({},_0x18cb7b,_0x430a02['options']);var _0x4e418c={'where':_0x18cb7b[_0x15c9('0x3d')]};return db[_0x15c9('0x29')]['count'](_0x4e418c)['then'](function(_0x183924){_0x472d04['count']=_0x183924;if(_0x430a02[_0x15c9('0x2f')][_0x15c9('0x3f')]){_0x18cb7b['include']=[{'all':!![]}];}return db[_0x15c9('0x29')][_0x15c9('0x40')](_0x18cb7b);})[_0x15c9('0x22')](function(_0x356e6e){_0x472d04[_0x15c9('0x41')]=_0x356e6e;return _0x472d04;})['then'](respondWithFilteredResult(_0xd56d86,_0x18cb7b))[_0x15c9('0x42')](handleError(_0xd56d86,null));};exports[_0x15c9('0x43')]=function(_0x4c1ffe,_0x391ddb){var _0x1c1535={'raw':![],'where':{'id':_0x4c1ffe[_0x15c9('0x44')]['id']}},_0x44ac7e={};_0x44ac7e['model']=_[_0x15c9('0x45')](db[_0x15c9('0x29')]['rawAttributes']);_0x44ac7e[_0x15c9('0x2f')]=_[_0x15c9('0x45')](_0x4c1ffe[_0x15c9('0x2f')]);_0x44ac7e[_0x15c9('0x30')]=_[_0x15c9('0x31')](_0x44ac7e[_0x15c9('0x2d')],_0x44ac7e[_0x15c9('0x2f')]);_0x1c1535[_0x15c9('0x32')]=_['intersection'](_0x44ac7e[_0x15c9('0x2d')],qs[_0x15c9('0x33')](_0x4c1ffe[_0x15c9('0x2f')][_0x15c9('0x33')]));_0x1c1535[_0x15c9('0x32')]=_0x1c1535['attributes'][_0x15c9('0x34')]?_0x1c1535[_0x15c9('0x32')]:_0x44ac7e[_0x15c9('0x2d')];if(_0x4c1ffe[_0x15c9('0x2f')][_0x15c9('0x3f')]){_0x1c1535[_0x15c9('0x46')]=[{'all':!![]}];}_0x1c1535=_[_0x15c9('0x3c')]({},_0x1c1535,_0x4c1ffe[_0x15c9('0x47')]);return db[_0x15c9('0x29')][_0x15c9('0x48')](_0x1c1535)[_0x15c9('0x22')](handleEntityNotFound(_0x391ddb,null))[_0x15c9('0x22')](respondWithResult(_0x391ddb,null))['catch'](handleError(_0x391ddb,null));};exports['create']=function(_0x26d9df,_0x351b6c){return db[_0x15c9('0x29')][_0x15c9('0x49')](_0x26d9df['body'],{})['then'](respondWithResult(_0x351b6c,0xc9))['catch'](handleError(_0x351b6c,null));};exports[_0x15c9('0x21')]=function(_0x1aee88,_0x31c9d2){if(_0x1aee88[_0x15c9('0x4a')]['id']){delete _0x1aee88[_0x15c9('0x4a')]['id'];}return db[_0x15c9('0x29')][_0x15c9('0x48')]({'where':{'id':_0x1aee88['params']['id']}})['then'](handleEntityNotFound(_0x31c9d2,null))['then'](saveUpdates(_0x1aee88[_0x15c9('0x4a')],null))[_0x15c9('0x22')](respondWithResult(_0x31c9d2,null))[_0x15c9('0x42')](handleError(_0x31c9d2,null));};exports['destroy']=function(_0x216dba,_0x3cf68f){return db[_0x15c9('0x29')][_0x15c9('0x48')]({'where':{'id':_0x216dba['params']['id']}})[_0x15c9('0x22')](handleEntityNotFound(_0x3cf68f,null))[_0x15c9('0x22')](removeEntity(_0x3cf68f,null))[_0x15c9('0x42')](handleError(_0x3cf68f,null));};exports[_0x15c9('0x4b')]=function(_0x412c25,_0x58411d,_0x34fe7e){var _0x56b5e7={};var _0x26f39b={};var _0x429fb7;var _0x154b81;return db[_0x15c9('0x29')][_0x15c9('0x4c')]({'where':{'id':_0x412c25['params']['id']}})['then'](handleEntityNotFound(_0x58411d,null))[_0x15c9('0x22')](function(_0x1724e5){if(_0x1724e5){_0x429fb7=_0x1724e5;_0x26f39b['model']=_[_0x15c9('0x45')](db['FreshsalesConfiguration']['rawAttributes']);_0x26f39b['query']=_[_0x15c9('0x45')](_0x412c25[_0x15c9('0x2f')]);_0x26f39b[_0x15c9('0x30')]=_[_0x15c9('0x31')](_0x26f39b['model'],_0x26f39b[_0x15c9('0x2f')]);_0x56b5e7[_0x15c9('0x32')]=_[_0x15c9('0x31')](_0x26f39b[_0x15c9('0x2d')],qs[_0x15c9('0x33')](_0x412c25[_0x15c9('0x2f')]['fields']));_0x56b5e7['attributes']=_0x56b5e7[_0x15c9('0x32')]['length']?_0x56b5e7[_0x15c9('0x32')]:_0x26f39b[_0x15c9('0x2d')];_0x56b5e7[_0x15c9('0x38')]=qs[_0x15c9('0x39')](_0x412c25['query'][_0x15c9('0x39')]);_0x56b5e7[_0x15c9('0x3d')]=qs[_0x15c9('0x30')](_['pick'](_0x412c25[_0x15c9('0x2f')],_0x26f39b[_0x15c9('0x30')]));if(_0x412c25[_0x15c9('0x2f')][_0x15c9('0x3b')]){_0x56b5e7[_0x15c9('0x3d')]=_[_0x15c9('0x3c')](_0x56b5e7[_0x15c9('0x3d')],{'$or':_[_0x15c9('0x28')](_0x56b5e7[_0x15c9('0x32')],function(_0x1e76cd){var _0x177a6a={};_0x177a6a[_0x1e76cd]={'$like':'%'+_0x412c25[_0x15c9('0x2f')][_0x15c9('0x3b')]+'%'};return _0x177a6a;})});}_0x56b5e7=_[_0x15c9('0x3c')]({},_0x56b5e7,_0x412c25[_0x15c9('0x47')]);return _0x429fb7[_0x15c9('0x4b')](_0x56b5e7);}})[_0x15c9('0x22')](function(_0x4e294d){if(_0x4e294d){_0x154b81=_0x4e294d[_0x15c9('0x34')];if(!_0x412c25['query'][_0x15c9('0x35')]('nolimit')){_0x56b5e7[_0x15c9('0x1b')]=qs[_0x15c9('0x1b')](_0x412c25[_0x15c9('0x2f')][_0x15c9('0x1b')]);_0x56b5e7['offset']=qs[_0x15c9('0x37')](_0x412c25['query'][_0x15c9('0x37')]);}return _0x429fb7[_0x15c9('0x4b')](_0x56b5e7);}})[_0x15c9('0x22')](function(_0x4e348e){if(_0x4e348e){return _0x4e348e?{'count':_0x154b81,'rows':_0x4e348e}:null;}})[_0x15c9('0x22')](respondWithResult(_0x58411d,null))[_0x15c9('0x42')](handleError(_0x58411d,null));};exports[_0x15c9('0x4d')]=function(_0x440037,_0x13e2b1,_0x7e4423){if(_0x440037[_0x15c9('0x4a')]['id']){delete _0x440037[_0x15c9('0x4a')]['id'];}return db[_0x15c9('0x29')][_0x15c9('0x4c')]({'where':{'id':_0x440037[_0x15c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x13e2b1,null))[_0x15c9('0x22')](function(_0x26ff45){if(_0x26ff45){_0x440037['body'][_0x15c9('0x4e')]=_0x26ff45['id'];_0x440037[_0x15c9('0x4a')][_0x15c9('0x4f')]=integrations['getSubjects'](_0x440037[_0x15c9('0x4a')]['channel'],_0x440037[_0x15c9('0x4a')][_0x15c9('0x2b')]);_0x440037[_0x15c9('0x4a')][_0x15c9('0x50')]=integrations[_0x15c9('0x51')](_0x440037[_0x15c9('0x4a')]['channel'],_0x440037[_0x15c9('0x4a')][_0x15c9('0x2b')]);return db[_0x15c9('0x52')][_0x15c9('0x49')](_0x440037[_0x15c9('0x4a')],{'include':[{'model':db[_0x15c9('0x53')],'as':_0x15c9('0x4f')},{'model':db['FreshsalesField'],'as':_0x15c9('0x50')}]});}return null;})['then'](respondWithResult(_0x13e2b1,null))['catch'](handleError(_0x13e2b1,null));};exports[_0x15c9('0x54')]=function(_0x511d22,_0x52ce25,_0x3968a1){var _0x31b9c7='';var _0x50c8ba='';return db[_0x15c9('0x29')][_0x15c9('0x4c')]({'where':{'id':_0x511d22[_0x15c9('0x44')]['id']},'attributes':['id',_0x15c9('0x55'),_0x15c9('0x56'),_0x15c9('0x57')]})[_0x15c9('0x22')](handleEntityNotFound(_0x52ce25,null))[_0x15c9('0x22')](function(_0x189fb6){if(_0x189fb6){_0x50c8ba=_0x189fb6[_0x15c9('0x55')];_0x31b9c7=_0x189fb6[_0x15c9('0x56')];var _0x446859=_0x189fb6[_0x15c9('0x56')][_0x15c9('0x58')](-0x1);if(_0x446859==='/'){_0x31b9c7=_0x31b9c7['substring'](0x0,_0x31b9c7['lastIndexOf'](_0x446859));}return rp({'method':'GET','uri':util['format'](_0x15c9('0x59'),_0x31b9c7,_0x15c9('0x5a')),'headers':{'Authorization':_0x15c9('0x5b')+_0x189fb6[_0x15c9('0x57')]},'json':!![]});}})[_0x15c9('0x22')](function(_0x549152){if(_0x549152){var _0x151c8e=_0x549152['users'];var _0x5a62be=![];var _0x39d9ce=null;for(_0x39d9ce=0x0;_0x39d9ce<_0x151c8e[_0x15c9('0x34')];_0x39d9ce++){if(_0x151c8e[_0x39d9ce]['email']===_0x50c8ba){_0x5a62be=!![];}}if(_0x5a62be){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x15c9('0x22')](respondWithResult(_0x52ce25,null))[_0x15c9('0x42')](function(_0x1151b8){var _0x11136b=_0x511d22['query']['test']?0x1f4:_0x1151b8[_0x15c9('0x5c')]||0x1f4;logger['error'](_0x15c9('0x5d'),_0x15c9('0x54'),_0x11136b,JSON[_0x15c9('0x5e')](_0x1151b8));delete _0x1151b8[_0x15c9('0x2e')];if(_0x11136b===0x191){_0x11136b=0x190;}_0x52ce25['status'](_0x11136b)[_0x15c9('0x26')](_0x511d22[_0x15c9('0x2f')][_0x15c9('0x5f')]?{'message':_0x15c9('0x60'),'statusCode':_0x1151b8[_0x15c9('0x5c')]}:_0x1151b8);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d7082d1..82fc961 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 _0xafc4=['path','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1a1d6c,_0x9818df){var _0x562102=function(_0x393f05){while(--_0x393f05){_0x1a1d6c['push'](_0x1a1d6c['shift']());}};_0x562102(++_0x9818df);}(_0xafc4,0x69));var _0x4afc=function(_0x5a3712,_0x306b4a){_0x5a3712=_0x5a3712-0x0;var _0x1a3964=_0xafc4[_0x5a3712];return _0x1a3964;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x4afc('0x6'));module[_0x4afc('0x7')]=function(_0x16953b,_0x1bb281){return _0x16953b[_0x4afc('0x8')](_0x4afc('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','int_freshsales_accounts'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4be79b,_0x1d1f5f){_0x4be79b=_0x4be79b-0x0;var _0x293f58=_0xc2c7[_0x4be79b];return _0x293f58;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x7c2c('0x8'));module[_0x7c2c('0x9')]=function(_0x23c038,_0x54f027){return _0x23c038['define']('FreshsalesAccount',attributes,{'tableName':_0x7c2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index bfb7771..8097a99 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(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'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 _0x82c4=['findAll','options','raw','attributes','include','map','model','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x82c4,0x1ca));var _0x482c=function(_0x13b593,_0x85a736){_0x13b593=_0x13b593-0x0;var _0x1d2958=_0x82c4[_0x13b593];return _0x1d2958;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});}exports[_0x482c('0x15')]=function(_0x5b6f7e){var _0x3aed45=this;return new Promise(function(_0x258148,_0x4af05a){return db['FreshsalesAccount'][_0x482c('0x16')]({'raw':_0x5b6f7e['options']?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'where':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')]['where']||null:null,'attributes':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x19')]||null:null,'limit':_0x5b6f7e[_0x482c('0x17')]?_0x5b6f7e[_0x482c('0x17')]['limit']||null:null,'include':_0x5b6f7e['options']?_0x5b6f7e[_0x482c('0x17')][_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x5b6f7e['options'][_0x482c('0x1a')],function(_0x579d2f){return{'model':db[_0x579d2f[_0x482c('0x1c')]],'as':_0x579d2f['as'],'attributes':_0x579d2f[_0x482c('0x19')],'include':_0x579d2f['include']?_[_0x482c('0x1b')](_0x579d2f['include'],function(_0x589bc6){return{'model':db[_0x589bc6[_0x482c('0x1c')]],'as':_0x589bc6['as'],'attributes':_0x589bc6[_0x482c('0x19')],'include':_0x589bc6[_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x589bc6[_0x482c('0x1a')],function(_0x215826){return{'model':db[_0x215826[_0x482c('0x1c')]],'as':_0x215826['as'],'attributes':_0x215826['attributes']};}):[]};}):[]};}):[]:[]})[_0x482c('0xa')](function(_0x255417){logger['info'](_0x482c('0x15'),_0x5b6f7e);logger['debug']('GetFreshsalesAccount',_0x5b6f7e,JSON[_0x482c('0xf')](_0x255417));_0x258148(_0x255417);})['catch'](function(_0x1ac1c4){logger[_0x482c('0x10')](_0x482c('0x15'),_0x1ac1c4[_0x482c('0x12')],_0x5b6f7e);_0x4af05a(_0x3aed45[_0x482c('0x10')](0x1f4,_0x1ac1c4[_0x482c('0x12')]));});});};exports[_0x482c('0x1d')]=function(_0x3e9b22){var _0x24b4df=this;return new Promise(function(_0x2d3800,_0x3135a7){return db[_0x482c('0x1e')][_0x482c('0x1f')]({'raw':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')][_0x482c('0x18')]===undefined?!![]:![]:!![],'where':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')]['where']||null:null,'attributes':_0x3e9b22['options']?_0x3e9b22['options'][_0x482c('0x19')]||null:null,'include':_0x3e9b22[_0x482c('0x17')]?_0x3e9b22[_0x482c('0x17')][_0x482c('0x1a')]?_['map'](_0x3e9b22[_0x482c('0x17')]['include'],function(_0x31428c){return{'model':db[_0x31428c[_0x482c('0x1c')]],'as':_0x31428c['as'],'attributes':_0x31428c[_0x482c('0x19')],'include':_0x31428c[_0x482c('0x1a')]?_[_0x482c('0x1b')](_0x31428c[_0x482c('0x1a')],function(_0x129a31){return{'model':db[_0x129a31[_0x482c('0x1c')]],'as':_0x129a31['as'],'attributes':_0x129a31['attributes'],'include':_0x129a31['include']?_[_0x482c('0x1b')](_0x129a31['include'],function(_0xe62a02){return{'model':db[_0xe62a02[_0x482c('0x1c')]],'as':_0xe62a02['as'],'attributes':_0xe62a02[_0x482c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29cbaa){logger[_0x482c('0xb')](_0x482c('0x1d'),_0x3e9b22);logger[_0x482c('0xe')]('ShowFreshsalesAccount',_0x3e9b22,JSON[_0x482c('0xf')](_0x29cbaa));_0x2d3800(_0x29cbaa);})['catch'](function(_0x1de7f4){logger['error'](_0x482c('0x1d'),_0x1de7f4['message'],_0x3e9b22);_0x3135a7(_0x24b4df[_0x482c('0x10')](0x1f4,_0x1de7f4[_0x482c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 2f58676..f1d3f5d 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 _0x310c=['/:id/descriptions','/:id/fields','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x310c,0xda));var _0xc310=function(_0x3f9e5e,_0x3149e1){_0x3f9e5e=_0x3f9e5e-0x0;var _0x4ef4fa=_0x310c[_0x3f9e5e];return _0x4ef4fa;};'use strict';var multer=require(_0xc310('0x0'));var util=require(_0xc310('0x1'));var path=require(_0xc310('0x2'));var timeout=require(_0xc310('0x3'));var express=require(_0xc310('0x4'));var router=express[_0xc310('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc310('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc310('0x7'));router[_0xc310('0x8')]('/',auth[_0xc310('0x9')](),controller[_0xc310('0xa')]);router['get'](_0xc310('0xb'),auth[_0xc310('0x9')](),controller[_0xc310('0xc')]);router['get']('/:id/subjects',auth[_0xc310('0x9')](),controller['getSubjects']);router[_0xc310('0x8')](_0xc310('0xd'),auth[_0xc310('0x9')](),controller['getDescriptions']);router['get'](_0xc310('0xe'),auth[_0xc310('0x9')](),controller['getFields']);router[_0xc310('0xf')]('/',auth[_0xc310('0x9')](),controller[_0xc310('0x10')]);router[_0xc310('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc310('0x12')]);router['delete'](_0xc310('0xb'),auth[_0xc310('0x9')](),controller[_0xc310('0x13')]);module[_0xc310('0x14')]=router; \ No newline at end of file +var _0x23d2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x17348b,_0x1a42ba){var _0x3a9762=function(_0x654285){while(--_0x654285){_0x17348b['push'](_0x17348b['shift']());}};_0x3a9762(++_0x1a42ba);}(_0x23d2,0x11e));var _0x223d=function(_0x780fe0,_0x284a0b){_0x780fe0=_0x780fe0-0x0;var _0x21c4d6=_0x23d2[_0x780fe0];return _0x21c4d6;};'use strict';var multer=require(_0x223d('0x0'));var util=require('util');var path=require(_0x223d('0x1'));var timeout=require(_0x223d('0x2'));var express=require(_0x223d('0x3'));var router=express[_0x223d('0x4')]();var fs_extra=require(_0x223d('0x5'));var auth=require(_0x223d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x223d('0x7'));router['get']('/',auth[_0x223d('0x8')](),controller[_0x223d('0x9')]);router[_0x223d('0xa')]('/:id',auth[_0x223d('0x8')](),controller['show']);router[_0x223d('0xa')](_0x223d('0xb'),auth['isAuthenticated'](),controller[_0x223d('0xc')]);router['get']('/:id/descriptions',auth[_0x223d('0x8')](),controller[_0x223d('0xd')]);router['get'](_0x223d('0xe'),auth[_0x223d('0x8')](),controller[_0x223d('0xf')]);router[_0x223d('0x10')]('/',auth['isAuthenticated'](),controller[_0x223d('0x11')]);router[_0x223d('0x12')](_0x223d('0x13'),auth[_0x223d('0x8')](),controller[_0x223d('0x14')]);router[_0x223d('0x15')](_0x223d('0x13'),auth[_0x223d('0x8')](),controller[_0x223d('0x16')]);module[_0x223d('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index c854137..684a2c3 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 _0xc234=['exports','STRING','sequelize'];(function(_0xcf5aa8,_0x54ad02){var _0x5edbde=function(_0x54d95e){while(--_0x54d95e){_0xcf5aa8['push'](_0xcf5aa8['shift']());}};_0x5edbde(++_0x54ad02);}(_0xc234,0x137));var _0x4c23=function(_0x260a89,_0x46ee58){_0x260a89=_0x260a89-0x0;var _0x283fc2=_0xc234[_0x260a89];return _0x283fc2;};'use strict';var Sequelize=require(_0x4c23('0x0'));module[_0x4c23('0x1')]={'name':{'type':Sequelize[_0x4c23('0x2')]},'description':{'type':Sequelize[_0x4c23('0x2')]}}; \ No newline at end of file +var _0xd6c3=['sequelize','exports','STRING'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xd6c3,0xd2));var _0x3d6c=function(_0x15ed08,_0x259c24){_0x15ed08=_0x15ed08-0x0;var _0x4cafd3=_0xd6c3[_0x15ed08];return _0x4cafd3;};'use strict';var Sequelize=require(_0x3d6c('0x0'));module[_0x3d6c('0x1')]={'name':{'type':Sequelize[_0x3d6c('0x2')]},'description':{'type':Sequelize[_0x3d6c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ebe68bd..2d807f5 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 _0xc936=['sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','filter','where','merge','VIRTUAL','FreshsalesConfiguration','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','getSubjects','findOne','FreshsalesField','order','sort','pick','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0xc936,0x123));var _0x6c93=function(_0x26d06a,_0x4ee921){_0x26d06a=_0x26d06a-0x0;var _0x33f1b5=_0xc936[_0x26d06a];return _0x33f1b5;};'use strict';var emlformat=require(_0x6c93('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c93('0x1'));var rp=require(_0x6c93('0x2'));var moment=require(_0x6c93('0x3'));var BPromise=require(_0x6c93('0x4'));var Mustache=require(_0x6c93('0x5'));var util=require('util');var path=require(_0x6c93('0x6'));var sox=require(_0x6c93('0x7'));var csv=require('to-csv');var ejs=require(_0x6c93('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6c93('0x9'));var crypto=require(_0x6c93('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6c93('0xb'));var toCsv=require(_0x6c93('0xc'));var querystring=require(_0x6c93('0xd'));var Papa=require(_0x6c93('0xe'));var Redis=require('ioredis');var authService=require(_0x6c93('0xf'));var qs=require(_0x6c93('0x10'));var as=require(_0x6c93('0x11'));var hardwareService=require(_0x6c93('0x12'));var logger=require(_0x6c93('0x13'))(_0x6c93('0x14'));var utils=require(_0x6c93('0x15'));var config=require(_0x6c93('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c93('0x17'))['db'];function respondWithStatusCode(_0x1e1ebd,_0x383b5f){_0x383b5f=_0x383b5f||0xcc;return function(_0x5cd23a){if(_0x5cd23a){return _0x1e1ebd['sendStatus'](_0x383b5f);}return _0x1e1ebd[_0x6c93('0x18')](_0x383b5f)[_0x6c93('0x19')]();};}function respondWithResult(_0x358a9c,_0x58d1ba){_0x58d1ba=_0x58d1ba||0xc8;return function(_0x245fb5){if(_0x245fb5){return _0x358a9c['status'](_0x58d1ba)[_0x6c93('0x1a')](_0x245fb5);}};}function respondWithFilteredResult(_0x510352,_0x3df436){return function(_0x18afa5){if(_0x18afa5){var _0xd20684=typeof _0x3df436[_0x6c93('0x1b')]===_0x6c93('0x1c')&&typeof _0x3df436[_0x6c93('0x1d')]===_0x6c93('0x1c');var _0x53ef39=_0x18afa5[_0x6c93('0x1e')];var _0x5475af=_0xd20684?0x0:_0x3df436[_0x6c93('0x1b')];var _0x34665a=_0xd20684?_0x18afa5[_0x6c93('0x1e')]:_0x3df436['offset']+_0x3df436[_0x6c93('0x1d')];var _0x481a60;if(_0x34665a>=_0x53ef39){_0x34665a=_0x53ef39;_0x481a60=0xc8;}else{_0x481a60=0xce;}_0x510352[_0x6c93('0x18')](_0x481a60);return _0x510352['set'](_0x6c93('0x1f'),_0x5475af+'-'+_0x34665a+'/'+_0x53ef39)[_0x6c93('0x1a')](_0x18afa5);}return null;};}function patchUpdates(_0xfcfdb3){return function(_0x2b5d4c){try{jsonpatch[_0x6c93('0x20')](_0x2b5d4c,_0xfcfdb3,!![]);}catch(_0x4eaf2b){return BPromise[_0x6c93('0x21')](_0x4eaf2b);}return _0x2b5d4c[_0x6c93('0x22')]();};}function saveUpdates(_0x3ecf3c,_0x2d1a47){return function(_0x1f22d0){if(_0x1f22d0){return _0x1f22d0['update'](_0x3ecf3c)['then'](function(_0x266152){return _0x266152;});}return null;};}function removeEntity(_0x580248,_0x577efe){return function(_0x13b844){if(_0x13b844){return _0x13b844[_0x6c93('0x23')]()[_0x6c93('0x24')](function(){_0x580248[_0x6c93('0x18')](0xcc)[_0x6c93('0x19')]();});}};}function handleEntityNotFound(_0x56e1c7,_0x45cefd){return function(_0x3bee25){if(!_0x3bee25){_0x56e1c7[_0x6c93('0x25')](0x194);}return _0x3bee25;};}function handleError(_0x10fb82,_0x1fb55c){_0x1fb55c=_0x1fb55c||0x1f4;return function(_0x4c2906){logger[_0x6c93('0x26')](_0x4c2906['stack']);if(_0x4c2906[_0x6c93('0x27')]){delete _0x4c2906[_0x6c93('0x27')];}_0x10fb82[_0x6c93('0x18')](_0x1fb55c)[_0x6c93('0x28')](_0x4c2906);};}exports[_0x6c93('0x29')]=function(_0x17c573,_0xb8e1d3){var _0x25ba26={},_0x47dbcb={},_0x2a09ad={'count':0x0,'rows':[]};var _0x43a7d8=_[_0x6c93('0x2a')](db['FreshsalesConfiguration'][_0x6c93('0x2b')],function(_0xa26303){return{'name':_0xa26303[_0x6c93('0x2c')],'type':_0xa26303[_0x6c93('0x2d')][_0x6c93('0x2e')]};});_0x47dbcb[_0x6c93('0x2f')]=_[_0x6c93('0x2a')](_0x43a7d8,_0x6c93('0x27'));_0x47dbcb['query']=_[_0x6c93('0x30')](_0x17c573[_0x6c93('0x31')]);_0x47dbcb[_0x6c93('0x32')]=_[_0x6c93('0x33')](_0x47dbcb[_0x6c93('0x2f')],_0x47dbcb[_0x6c93('0x31')]);_0x25ba26[_0x6c93('0x34')]=_['intersection'](_0x47dbcb['model'],qs[_0x6c93('0x35')](_0x17c573[_0x6c93('0x31')]['fields']));_0x25ba26[_0x6c93('0x34')]=_0x25ba26[_0x6c93('0x34')][_0x6c93('0x36')]?_0x25ba26[_0x6c93('0x34')]:_0x47dbcb[_0x6c93('0x2f')];if(!_0x17c573[_0x6c93('0x31')][_0x6c93('0x37')](_0x6c93('0x38'))){_0x25ba26[_0x6c93('0x1d')]=qs['limit'](_0x17c573[_0x6c93('0x31')][_0x6c93('0x1d')]);_0x25ba26['offset']=qs[_0x6c93('0x1b')](_0x17c573[_0x6c93('0x31')][_0x6c93('0x1b')]);}_0x25ba26['order']=qs['sort'](_0x17c573[_0x6c93('0x31')]['sort']);_0x25ba26['where']=qs[_0x6c93('0x32')](_['pick'](_0x17c573[_0x6c93('0x31')],_0x47dbcb[_0x6c93('0x32')]),_0x43a7d8);if(_0x17c573[_0x6c93('0x31')][_0x6c93('0x39')]){_0x25ba26[_0x6c93('0x3a')]=_[_0x6c93('0x3b')](_0x25ba26[_0x6c93('0x3a')],{'$or':_[_0x6c93('0x2a')](_0x43a7d8,function(_0x3a21d7){if(_0x3a21d7[_0x6c93('0x2d')]!==_0x6c93('0x3c')){var _0x13c70f={};_0x13c70f[_0x3a21d7[_0x6c93('0x27')]]={'$like':'%'+_0x17c573['query'][_0x6c93('0x39')]+'%'};return _0x13c70f;}})});}_0x25ba26=_[_0x6c93('0x3b')]({},_0x25ba26,_0x17c573['options']);var _0x243596={'where':_0x25ba26['where']};return db[_0x6c93('0x3d')][_0x6c93('0x1e')](_0x243596)['then'](function(_0x1291d5){_0x2a09ad[_0x6c93('0x1e')]=_0x1291d5;if(_0x17c573['query'][_0x6c93('0x3e')]){_0x25ba26[_0x6c93('0x3f')]=[{'all':!![]}];}return db[_0x6c93('0x3d')][_0x6c93('0x40')](_0x25ba26);})[_0x6c93('0x24')](function(_0x5c25c6){_0x2a09ad[_0x6c93('0x41')]=_0x5c25c6;return _0x2a09ad;})[_0x6c93('0x24')](respondWithFilteredResult(_0xb8e1d3,_0x25ba26))['catch'](handleError(_0xb8e1d3,null));};exports[_0x6c93('0x42')]=function(_0x3063d2,_0x441f1d){var _0x8e28b8={'raw':![],'where':{'id':_0x3063d2[_0x6c93('0x43')]['id']}},_0x21731b={};_0x21731b[_0x6c93('0x2f')]=_[_0x6c93('0x30')](db[_0x6c93('0x3d')][_0x6c93('0x2b')]);_0x21731b['query']=_['keys'](_0x3063d2[_0x6c93('0x31')]);_0x21731b[_0x6c93('0x32')]=_[_0x6c93('0x33')](_0x21731b[_0x6c93('0x2f')],_0x21731b[_0x6c93('0x31')]);_0x8e28b8[_0x6c93('0x34')]=_[_0x6c93('0x33')](_0x21731b[_0x6c93('0x2f')],qs[_0x6c93('0x35')](_0x3063d2[_0x6c93('0x31')]['fields']));_0x8e28b8[_0x6c93('0x34')]=_0x8e28b8[_0x6c93('0x34')][_0x6c93('0x36')]?_0x8e28b8[_0x6c93('0x34')]:_0x21731b['model'];if(_0x3063d2[_0x6c93('0x31')]['includeAll']){_0x8e28b8[_0x6c93('0x3f')]=[{'all':!![]}];}_0x8e28b8=_[_0x6c93('0x3b')]({},_0x8e28b8,_0x3063d2[_0x6c93('0x44')]);return db[_0x6c93('0x3d')][_0x6c93('0x45')](_0x8e28b8)[_0x6c93('0x24')](handleEntityNotFound(_0x441f1d,null))[_0x6c93('0x24')](respondWithResult(_0x441f1d,null))[_0x6c93('0x46')](handleError(_0x441f1d,null));};exports['create']=function(_0x1c219f,_0x30ce31){return db[_0x6c93('0x3d')][_0x6c93('0x47')](_0x1c219f[_0x6c93('0x48')],{})[_0x6c93('0x24')](respondWithResult(_0x30ce31,0xc9))[_0x6c93('0x46')](handleError(_0x30ce31,null));};exports[_0x6c93('0x49')]=function(_0x2ea943,_0x212487){if(_0x2ea943[_0x6c93('0x48')]['id']){delete _0x2ea943[_0x6c93('0x48')]['id'];}return db[_0x6c93('0x3d')]['find']({'where':{'id':_0x2ea943['params']['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x212487,null))[_0x6c93('0x24')](saveUpdates(_0x2ea943[_0x6c93('0x48')],null))['then'](respondWithResult(_0x212487,null))['catch'](handleError(_0x212487,null));};exports['destroy']=function(_0x4a1d25,_0x1c235){return db[_0x6c93('0x3d')]['find']({'where':{'id':_0x4a1d25['params']['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x1c235,null))['then'](removeEntity(_0x1c235,null))[_0x6c93('0x46')](handleError(_0x1c235,null));};exports[_0x6c93('0x4a')]=function(_0x4af339,_0x4488cc,_0x17c80c){var _0x2f9a9c={};var _0xb8982b={};var _0x2fbccc;var _0x19e863;return db[_0x6c93('0x3d')][_0x6c93('0x4b')]({'where':{'id':_0x4af339['params']['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x4488cc,null))[_0x6c93('0x24')](function(_0x11c81e){if(_0x11c81e){_0x2fbccc=_0x11c81e;_0xb8982b[_0x6c93('0x2f')]=_[_0x6c93('0x30')](db[_0x6c93('0x4c')][_0x6c93('0x2b')]);_0xb8982b[_0x6c93('0x31')]=_['keys'](_0x4af339[_0x6c93('0x31')]);_0xb8982b['filters']=_[_0x6c93('0x33')](_0xb8982b['model'],_0xb8982b[_0x6c93('0x31')]);_0x2f9a9c['attributes']=_[_0x6c93('0x33')](_0xb8982b[_0x6c93('0x2f')],qs['fields'](_0x4af339['query'][_0x6c93('0x35')]));_0x2f9a9c[_0x6c93('0x34')]=_0x2f9a9c[_0x6c93('0x34')][_0x6c93('0x36')]?_0x2f9a9c['attributes']:_0xb8982b[_0x6c93('0x2f')];_0x2f9a9c[_0x6c93('0x4d')]=qs[_0x6c93('0x4e')](_0x4af339[_0x6c93('0x31')][_0x6c93('0x4e')]);_0x2f9a9c['where']=qs[_0x6c93('0x32')](_[_0x6c93('0x4f')](_0x4af339[_0x6c93('0x31')],_0xb8982b[_0x6c93('0x32')]));if(_0x4af339['query'][_0x6c93('0x39')]){_0x2f9a9c[_0x6c93('0x3a')]=_[_0x6c93('0x3b')](_0x2f9a9c[_0x6c93('0x3a')],{'$or':_[_0x6c93('0x2a')](_0x2f9a9c[_0x6c93('0x34')],function(_0x514d47){var _0x3eaa66={};_0x3eaa66[_0x514d47]={'$like':'%'+_0x4af339[_0x6c93('0x31')]['filter']+'%'};return _0x3eaa66;})});}_0x2f9a9c=_[_0x6c93('0x3b')]({},_0x2f9a9c,_0x4af339[_0x6c93('0x44')]);return _0x2fbccc[_0x6c93('0x4a')](_0x2f9a9c);}})[_0x6c93('0x24')](function(_0x452a7a){if(_0x452a7a){_0x19e863=_0x452a7a[_0x6c93('0x36')];if(!_0x4af339[_0x6c93('0x31')][_0x6c93('0x37')]('nolimit')){_0x2f9a9c[_0x6c93('0x1d')]=qs[_0x6c93('0x1d')](_0x4af339[_0x6c93('0x31')][_0x6c93('0x1d')]);_0x2f9a9c[_0x6c93('0x1b')]=qs[_0x6c93('0x1b')](_0x4af339[_0x6c93('0x31')][_0x6c93('0x1b')]);}return _0x2fbccc['getSubjects'](_0x2f9a9c);}})[_0x6c93('0x24')](function(_0x518ae8){if(_0x518ae8){return _0x518ae8?{'count':_0x19e863,'rows':_0x518ae8}:null;}})[_0x6c93('0x24')](respondWithResult(_0x4488cc,null))['catch'](handleError(_0x4488cc,null));};exports[_0x6c93('0x50')]=function(_0x5578b0,_0x3b89f1,_0x271222){var _0x408985={};var _0x3c89fc={};var _0x5f5644;var _0x1c79a0;return db['FreshsalesConfiguration'][_0x6c93('0x4b')]({'where':{'id':_0x5578b0[_0x6c93('0x43')]['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x3b89f1,null))[_0x6c93('0x24')](function(_0x2c5e2c){if(_0x2c5e2c){_0x5f5644=_0x2c5e2c;_0x3c89fc[_0x6c93('0x2f')]=_['keys'](db[_0x6c93('0x4c')]['rawAttributes']);_0x3c89fc[_0x6c93('0x31')]=_['keys'](_0x5578b0[_0x6c93('0x31')]);_0x3c89fc[_0x6c93('0x32')]=_[_0x6c93('0x33')](_0x3c89fc[_0x6c93('0x2f')],_0x3c89fc[_0x6c93('0x31')]);_0x408985[_0x6c93('0x34')]=_[_0x6c93('0x33')](_0x3c89fc['model'],qs[_0x6c93('0x35')](_0x5578b0[_0x6c93('0x31')][_0x6c93('0x35')]));_0x408985[_0x6c93('0x34')]=_0x408985[_0x6c93('0x34')][_0x6c93('0x36')]?_0x408985[_0x6c93('0x34')]:_0x3c89fc[_0x6c93('0x2f')];_0x408985['order']=qs[_0x6c93('0x4e')](_0x5578b0[_0x6c93('0x31')][_0x6c93('0x4e')]);_0x408985[_0x6c93('0x3a')]=qs['filters'](_['pick'](_0x5578b0[_0x6c93('0x31')],_0x3c89fc[_0x6c93('0x32')]));if(_0x5578b0['query'][_0x6c93('0x39')]){_0x408985[_0x6c93('0x3a')]=_['merge'](_0x408985[_0x6c93('0x3a')],{'$or':_[_0x6c93('0x2a')](_0x408985['attributes'],function(_0xfb37fd){var _0x55c9c2={};_0x55c9c2[_0xfb37fd]={'$like':'%'+_0x5578b0[_0x6c93('0x31')][_0x6c93('0x39')]+'%'};return _0x55c9c2;})});}_0x408985=_['merge']({},_0x408985,_0x5578b0[_0x6c93('0x44')]);return _0x5f5644[_0x6c93('0x50')](_0x408985);}})[_0x6c93('0x24')](function(_0x7121bb){if(_0x7121bb){_0x1c79a0=_0x7121bb[_0x6c93('0x36')];if(!_0x5578b0[_0x6c93('0x31')][_0x6c93('0x37')](_0x6c93('0x38'))){_0x408985[_0x6c93('0x1d')]=qs['limit'](_0x5578b0['query'][_0x6c93('0x1d')]);_0x408985[_0x6c93('0x1b')]=qs[_0x6c93('0x1b')](_0x5578b0[_0x6c93('0x31')][_0x6c93('0x1b')]);}return _0x5f5644[_0x6c93('0x50')](_0x408985);}})[_0x6c93('0x24')](function(_0x52fdc2){if(_0x52fdc2){return _0x52fdc2?{'count':_0x1c79a0,'rows':_0x52fdc2}:null;}})[_0x6c93('0x24')](respondWithResult(_0x3b89f1,null))[_0x6c93('0x46')](handleError(_0x3b89f1,null));};exports['getFields']=function(_0x77bc83,_0x6f43be,_0x190af4){var _0x580ccb={};var _0x2574eb={};var _0x4bb971;var _0x35efef;return db['FreshsalesConfiguration'][_0x6c93('0x4b')]({'where':{'id':_0x77bc83['params']['id']}})[_0x6c93('0x24')](handleEntityNotFound(_0x6f43be,null))[_0x6c93('0x24')](function(_0x11f9c0){if(_0x11f9c0){_0x4bb971=_0x11f9c0;_0x2574eb['model']=_[_0x6c93('0x30')](db['FreshsalesField'][_0x6c93('0x2b')]);_0x2574eb[_0x6c93('0x31')]=_[_0x6c93('0x30')](_0x77bc83['query']);_0x2574eb['filters']=_[_0x6c93('0x33')](_0x2574eb[_0x6c93('0x2f')],_0x2574eb[_0x6c93('0x31')]);_0x580ccb[_0x6c93('0x34')]=_[_0x6c93('0x33')](_0x2574eb[_0x6c93('0x2f')],qs[_0x6c93('0x35')](_0x77bc83[_0x6c93('0x31')]['fields']));_0x580ccb[_0x6c93('0x34')]=_0x580ccb[_0x6c93('0x34')]['length']?_0x580ccb[_0x6c93('0x34')]:_0x2574eb['model'];_0x580ccb['order']=qs[_0x6c93('0x4e')](_0x77bc83[_0x6c93('0x31')][_0x6c93('0x4e')]);_0x580ccb['where']=qs[_0x6c93('0x32')](_[_0x6c93('0x4f')](_0x77bc83[_0x6c93('0x31')],_0x2574eb[_0x6c93('0x32')]));if(_0x77bc83['query']['filter']){_0x580ccb[_0x6c93('0x3a')]=_['merge'](_0x580ccb[_0x6c93('0x3a')],{'$or':_[_0x6c93('0x2a')](_0x580ccb[_0x6c93('0x34')],function(_0xf93e5c){var _0x53a6e3={};_0x53a6e3[_0xf93e5c]={'$like':'%'+_0x77bc83[_0x6c93('0x31')][_0x6c93('0x39')]+'%'};return _0x53a6e3;})});}_0x580ccb=_['merge']({},_0x580ccb,_0x77bc83[_0x6c93('0x44')]);return _0x4bb971[_0x6c93('0x51')](_0x580ccb);}})[_0x6c93('0x24')](function(_0x544e5f){if(_0x544e5f){_0x35efef=_0x544e5f['length'];if(!_0x77bc83[_0x6c93('0x31')]['hasOwnProperty']('nolimit')){_0x580ccb[_0x6c93('0x1d')]=qs[_0x6c93('0x1d')](_0x77bc83[_0x6c93('0x31')]['limit']);_0x580ccb[_0x6c93('0x1b')]=qs[_0x6c93('0x1b')](_0x77bc83[_0x6c93('0x31')][_0x6c93('0x1b')]);}return _0x4bb971[_0x6c93('0x51')](_0x580ccb);}})['then'](function(_0x4ee197){if(_0x4ee197){return _0x4ee197?{'count':_0x35efef,'rows':_0x4ee197}:null;}})[_0x6c93('0x24')](respondWithResult(_0x6f43be,null))[_0x6c93('0x46')](handleError(_0x6f43be,null));}; \ No newline at end of file +var _0x9483=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getSubjects','findOne','order','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x112891,_0x52380a){var _0x20e441=function(_0x27f6d0){while(--_0x27f6d0){_0x112891['push'](_0x112891['shift']());}};_0x20e441(++_0x52380a);}(_0x9483,0x12e));var _0x3948=function(_0x50ef00,_0x38fd75){_0x50ef00=_0x50ef00-0x0;var _0x347fc1=_0x9483[_0x50ef00];return _0x347fc1;};'use strict';var emlformat=require(_0x3948('0x0'));var rimraf=require(_0x3948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3948('0x2'));var rp=require(_0x3948('0x3'));var moment=require(_0x3948('0x4'));var BPromise=require(_0x3948('0x5'));var Mustache=require('mustache');var util=require(_0x3948('0x6'));var path=require(_0x3948('0x7'));var sox=require('sox');var csv=require(_0x3948('0x8'));var ejs=require(_0x3948('0x9'));var fs=require('fs');var fs_extra=require(_0x3948('0xa'));var _=require(_0x3948('0xb'));var squel=require(_0x3948('0xc'));var crypto=require(_0x3948('0xd'));var jsforce=require(_0x3948('0xe'));var deskjs=require(_0x3948('0xf'));var toCsv=require(_0x3948('0x8'));var querystring=require(_0x3948('0x10'));var Papa=require(_0x3948('0x11'));var Redis=require(_0x3948('0x12'));var authService=require(_0x3948('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3948('0x14'));var hardwareService=require(_0x3948('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3948('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485d92,_0x227c19){_0x227c19=_0x227c19||0xcc;return function(_0x1004f2){if(_0x1004f2){return _0x485d92[_0x3948('0x17')](_0x227c19);}return _0x485d92[_0x3948('0x18')](_0x227c19)[_0x3948('0x19')]();};}function respondWithResult(_0x3b2cc4,_0xf0c470){_0xf0c470=_0xf0c470||0xc8;return function(_0x56dd18){if(_0x56dd18){return _0x3b2cc4[_0x3948('0x18')](_0xf0c470)[_0x3948('0x1a')](_0x56dd18);}};}function respondWithFilteredResult(_0x4309b1,_0x1f0e90){return function(_0x16ec7f){if(_0x16ec7f){var _0x3aa26f=typeof _0x1f0e90[_0x3948('0x1b')]==='undefined'&&typeof _0x1f0e90[_0x3948('0x1c')]==='undefined';var _0x1bee8e=_0x16ec7f['count'];var _0x47d732=_0x3aa26f?0x0:_0x1f0e90[_0x3948('0x1b')];var _0x49f85c=_0x3aa26f?_0x16ec7f[_0x3948('0x1d')]:_0x1f0e90['offset']+_0x1f0e90[_0x3948('0x1c')];var _0x2acc56;if(_0x49f85c>=_0x1bee8e){_0x49f85c=_0x1bee8e;_0x2acc56=0xc8;}else{_0x2acc56=0xce;}_0x4309b1[_0x3948('0x18')](_0x2acc56);return _0x4309b1[_0x3948('0x1e')](_0x3948('0x1f'),_0x47d732+'-'+_0x49f85c+'/'+_0x1bee8e)[_0x3948('0x1a')](_0x16ec7f);}return null;};}function patchUpdates(_0x3d9177){return function(_0x390ef0){try{jsonpatch['apply'](_0x390ef0,_0x3d9177,!![]);}catch(_0x23402e){return BPromise[_0x3948('0x20')](_0x23402e);}return _0x390ef0[_0x3948('0x21')]();};}function saveUpdates(_0x2af58b,_0x2734b8){return function(_0x30a0b2){if(_0x30a0b2){return _0x30a0b2[_0x3948('0x22')](_0x2af58b)[_0x3948('0x23')](function(_0x41602d){return _0x41602d;});}return null;};}function removeEntity(_0x59d526,_0x595277){return function(_0x2adc0a){if(_0x2adc0a){return _0x2adc0a[_0x3948('0x24')]()['then'](function(){_0x59d526[_0x3948('0x18')](0xcc)[_0x3948('0x19')]();});}};}function handleEntityNotFound(_0x29b8e6,_0x2b246b){return function(_0x1e0eba){if(!_0x1e0eba){_0x29b8e6[_0x3948('0x17')](0x194);}return _0x1e0eba;};}function handleError(_0x6360c5,_0x1ae121){_0x1ae121=_0x1ae121||0x1f4;return function(_0x50258e){logger[_0x3948('0x25')](_0x50258e['stack']);if(_0x50258e[_0x3948('0x26')]){delete _0x50258e[_0x3948('0x26')];}_0x6360c5[_0x3948('0x18')](_0x1ae121)[_0x3948('0x27')](_0x50258e);};}exports[_0x3948('0x28')]=function(_0x3e1f11,_0x41f0a2){var _0x2d7ee0={},_0x302bd2={},_0x5888d4={'count':0x0,'rows':[]};var _0x208709=_[_0x3948('0x29')](db[_0x3948('0x2a')][_0x3948('0x2b')],function(_0x123038){return{'name':_0x123038['fieldName'],'type':_0x123038['type'][_0x3948('0x2c')]};});_0x302bd2[_0x3948('0x2d')]=_[_0x3948('0x29')](_0x208709,_0x3948('0x26'));_0x302bd2['query']=_['keys'](_0x3e1f11[_0x3948('0x2e')]);_0x302bd2[_0x3948('0x2f')]=_[_0x3948('0x30')](_0x302bd2['model'],_0x302bd2[_0x3948('0x2e')]);_0x2d7ee0[_0x3948('0x31')]=_[_0x3948('0x30')](_0x302bd2[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x3e1f11['query'][_0x3948('0x32')]));_0x2d7ee0[_0x3948('0x31')]=_0x2d7ee0[_0x3948('0x31')][_0x3948('0x33')]?_0x2d7ee0['attributes']:_0x302bd2['model'];if(!_0x3e1f11[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x2d7ee0[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x3e1f11[_0x3948('0x2e')]['limit']);_0x2d7ee0['offset']=qs['offset'](_0x3e1f11[_0x3948('0x2e')][_0x3948('0x1b')]);}_0x2d7ee0['order']=qs[_0x3948('0x36')](_0x3e1f11['query'][_0x3948('0x36')]);_0x2d7ee0['where']=qs[_0x3948('0x2f')](_[_0x3948('0x37')](_0x3e1f11[_0x3948('0x2e')],_0x302bd2[_0x3948('0x2f')]),_0x208709);if(_0x3e1f11[_0x3948('0x2e')][_0x3948('0x38')]){_0x2d7ee0[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x2d7ee0[_0x3948('0x39')],{'$or':_['map'](_0x208709,function(_0x1096cb){if(_0x1096cb['type']!=='VIRTUAL'){var _0x2ef665={};_0x2ef665[_0x1096cb[_0x3948('0x26')]]={'$like':'%'+_0x3e1f11['query'][_0x3948('0x38')]+'%'};return _0x2ef665;}})});}_0x2d7ee0=_[_0x3948('0x3a')]({},_0x2d7ee0,_0x3e1f11[_0x3948('0x3b')]);var _0x4052f7={'where':_0x2d7ee0[_0x3948('0x39')]};return db[_0x3948('0x2a')][_0x3948('0x1d')](_0x4052f7)[_0x3948('0x23')](function(_0x2600eb){_0x5888d4[_0x3948('0x1d')]=_0x2600eb;if(_0x3e1f11['query']['includeAll']){_0x2d7ee0[_0x3948('0x3c')]=[{'all':!![]}];}return db[_0x3948('0x2a')][_0x3948('0x3d')](_0x2d7ee0);})[_0x3948('0x23')](function(_0x5266f0){_0x5888d4[_0x3948('0x3e')]=_0x5266f0;return _0x5888d4;})[_0x3948('0x23')](respondWithFilteredResult(_0x41f0a2,_0x2d7ee0))[_0x3948('0x3f')](handleError(_0x41f0a2,null));};exports[_0x3948('0x40')]=function(_0x5a528c,_0x190f9e){var _0x2aff13={'raw':![],'where':{'id':_0x5a528c[_0x3948('0x41')]['id']}},_0x149b98={};_0x149b98['model']=_[_0x3948('0x42')](db[_0x3948('0x2a')][_0x3948('0x2b')]);_0x149b98['query']=_['keys'](_0x5a528c[_0x3948('0x2e')]);_0x149b98[_0x3948('0x2f')]=_['intersection'](_0x149b98[_0x3948('0x2d')],_0x149b98[_0x3948('0x2e')]);_0x2aff13[_0x3948('0x31')]=_[_0x3948('0x30')](_0x149b98[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x5a528c[_0x3948('0x2e')]['fields']));_0x2aff13['attributes']=_0x2aff13['attributes'][_0x3948('0x33')]?_0x2aff13[_0x3948('0x31')]:_0x149b98[_0x3948('0x2d')];if(_0x5a528c['query'][_0x3948('0x43')]){_0x2aff13[_0x3948('0x3c')]=[{'all':!![]}];}_0x2aff13=_[_0x3948('0x3a')]({},_0x2aff13,_0x5a528c[_0x3948('0x3b')]);return db['FreshsalesConfiguration'][_0x3948('0x44')](_0x2aff13)[_0x3948('0x23')](handleEntityNotFound(_0x190f9e,null))[_0x3948('0x23')](respondWithResult(_0x190f9e,null))[_0x3948('0x3f')](handleError(_0x190f9e,null));};exports[_0x3948('0x45')]=function(_0x2c5130,_0x4fe2a3){return db['FreshsalesConfiguration'][_0x3948('0x45')](_0x2c5130['body'],{})[_0x3948('0x23')](respondWithResult(_0x4fe2a3,0xc9))['catch'](handleError(_0x4fe2a3,null));};exports[_0x3948('0x22')]=function(_0x5543ed,_0x5ddfbc){if(_0x5543ed['body']['id']){delete _0x5543ed['body']['id'];}return db['FreshsalesConfiguration'][_0x3948('0x44')]({'where':{'id':_0x5543ed[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x5ddfbc,null))[_0x3948('0x23')](saveUpdates(_0x5543ed[_0x3948('0x46')],null))['then'](respondWithResult(_0x5ddfbc,null))[_0x3948('0x3f')](handleError(_0x5ddfbc,null));};exports['destroy']=function(_0x23d8e7,_0x612cd){return db[_0x3948('0x2a')]['find']({'where':{'id':_0x23d8e7[_0x3948('0x41')]['id']}})['then'](handleEntityNotFound(_0x612cd,null))[_0x3948('0x23')](removeEntity(_0x612cd,null))[_0x3948('0x3f')](handleError(_0x612cd,null));};exports[_0x3948('0x47')]=function(_0x447b54,_0x3a6bd4,_0xfcf558){var _0xb38802={};var _0x1afa30={};var _0x4905cf;var _0x4c4424;return db['FreshsalesConfiguration'][_0x3948('0x48')]({'where':{'id':_0x447b54['params']['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x3a6bd4,null))['then'](function(_0x484cf6){if(_0x484cf6){_0x4905cf=_0x484cf6;_0x1afa30['model']=_[_0x3948('0x42')](db['FreshsalesField'][_0x3948('0x2b')]);_0x1afa30[_0x3948('0x2e')]=_['keys'](_0x447b54[_0x3948('0x2e')]);_0x1afa30[_0x3948('0x2f')]=_[_0x3948('0x30')](_0x1afa30[_0x3948('0x2d')],_0x1afa30[_0x3948('0x2e')]);_0xb38802[_0x3948('0x31')]=_[_0x3948('0x30')](_0x1afa30[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x447b54[_0x3948('0x2e')]['fields']));_0xb38802[_0x3948('0x31')]=_0xb38802[_0x3948('0x31')]['length']?_0xb38802['attributes']:_0x1afa30[_0x3948('0x2d')];_0xb38802[_0x3948('0x49')]=qs[_0x3948('0x36')](_0x447b54['query'][_0x3948('0x36')]);_0xb38802[_0x3948('0x39')]=qs[_0x3948('0x2f')](_[_0x3948('0x37')](_0x447b54['query'],_0x1afa30[_0x3948('0x2f')]));if(_0x447b54[_0x3948('0x2e')]['filter']){_0xb38802[_0x3948('0x39')]=_['merge'](_0xb38802[_0x3948('0x39')],{'$or':_['map'](_0xb38802['attributes'],function(_0x33b37e){var _0x13a855={};_0x13a855[_0x33b37e]={'$like':'%'+_0x447b54['query'][_0x3948('0x38')]+'%'};return _0x13a855;})});}_0xb38802=_[_0x3948('0x3a')]({},_0xb38802,_0x447b54['options']);return _0x4905cf[_0x3948('0x47')](_0xb38802);}})[_0x3948('0x23')](function(_0x476560){if(_0x476560){_0x4c4424=_0x476560['length'];if(!_0x447b54[_0x3948('0x2e')]['hasOwnProperty']('nolimit')){_0xb38802[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x447b54[_0x3948('0x2e')][_0x3948('0x1c')]);_0xb38802['offset']=qs[_0x3948('0x1b')](_0x447b54[_0x3948('0x2e')][_0x3948('0x1b')]);}return _0x4905cf[_0x3948('0x47')](_0xb38802);}})[_0x3948('0x23')](function(_0x2449d9){if(_0x2449d9){return _0x2449d9?{'count':_0x4c4424,'rows':_0x2449d9}:null;}})[_0x3948('0x23')](respondWithResult(_0x3a6bd4,null))[_0x3948('0x3f')](handleError(_0x3a6bd4,null));};exports['getDescriptions']=function(_0x3d0ed4,_0x13f386,_0x124131){var _0x13aedb={};var _0x509638={};var _0x5ebd0a;var _0x4a6296;return db[_0x3948('0x2a')][_0x3948('0x48')]({'where':{'id':_0x3d0ed4[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x13f386,null))[_0x3948('0x23')](function(_0x155583){if(_0x155583){_0x5ebd0a=_0x155583;_0x509638[_0x3948('0x2d')]=_[_0x3948('0x42')](db[_0x3948('0x4a')][_0x3948('0x2b')]);_0x509638[_0x3948('0x2e')]=_[_0x3948('0x42')](_0x3d0ed4['query']);_0x509638[_0x3948('0x2f')]=_['intersection'](_0x509638['model'],_0x509638[_0x3948('0x2e')]);_0x13aedb[_0x3948('0x31')]=_[_0x3948('0x30')](_0x509638[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x32')]));_0x13aedb['attributes']=_0x13aedb[_0x3948('0x31')][_0x3948('0x33')]?_0x13aedb[_0x3948('0x31')]:_0x509638[_0x3948('0x2d')];_0x13aedb['order']=qs[_0x3948('0x36')](_0x3d0ed4['query'][_0x3948('0x36')]);_0x13aedb[_0x3948('0x39')]=qs[_0x3948('0x2f')](_['pick'](_0x3d0ed4[_0x3948('0x2e')],_0x509638[_0x3948('0x2f')]));if(_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x38')]){_0x13aedb[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x13aedb[_0x3948('0x39')],{'$or':_[_0x3948('0x29')](_0x13aedb[_0x3948('0x31')],function(_0xf77c8){var _0x506f0b={};_0x506f0b[_0xf77c8]={'$like':'%'+_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x38')]+'%'};return _0x506f0b;})});}_0x13aedb=_['merge']({},_0x13aedb,_0x3d0ed4['options']);return _0x5ebd0a['getDescriptions'](_0x13aedb);}})[_0x3948('0x23')](function(_0x5c4016){if(_0x5c4016){_0x4a6296=_0x5c4016[_0x3948('0x33')];if(!_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x13aedb[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x1c')]);_0x13aedb[_0x3948('0x1b')]=qs[_0x3948('0x1b')](_0x3d0ed4[_0x3948('0x2e')][_0x3948('0x1b')]);}return _0x5ebd0a[_0x3948('0x4b')](_0x13aedb);}})[_0x3948('0x23')](function(_0x293c7a){if(_0x293c7a){return _0x293c7a?{'count':_0x4a6296,'rows':_0x293c7a}:null;}})[_0x3948('0x23')](respondWithResult(_0x13f386,null))[_0x3948('0x3f')](handleError(_0x13f386,null));};exports['getFields']=function(_0x1c1074,_0x469208,_0x18b8e0){var _0x3867f5={};var _0x344a89={};var _0x368703;var _0x562229;return db[_0x3948('0x2a')][_0x3948('0x48')]({'where':{'id':_0x1c1074[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x469208,null))[_0x3948('0x23')](function(_0x9bb8c0){if(_0x9bb8c0){_0x368703=_0x9bb8c0;_0x344a89[_0x3948('0x2d')]=_[_0x3948('0x42')](db[_0x3948('0x4a')][_0x3948('0x2b')]);_0x344a89[_0x3948('0x2e')]=_[_0x3948('0x42')](_0x1c1074['query']);_0x344a89[_0x3948('0x2f')]=_['intersection'](_0x344a89[_0x3948('0x2d')],_0x344a89[_0x3948('0x2e')]);_0x3867f5[_0x3948('0x31')]=_[_0x3948('0x30')](_0x344a89[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x1c1074[_0x3948('0x2e')][_0x3948('0x32')]));_0x3867f5[_0x3948('0x31')]=_0x3867f5['attributes'][_0x3948('0x33')]?_0x3867f5[_0x3948('0x31')]:_0x344a89[_0x3948('0x2d')];_0x3867f5[_0x3948('0x49')]=qs[_0x3948('0x36')](_0x1c1074[_0x3948('0x2e')][_0x3948('0x36')]);_0x3867f5[_0x3948('0x39')]=qs[_0x3948('0x2f')](_['pick'](_0x1c1074['query'],_0x344a89[_0x3948('0x2f')]));if(_0x1c1074['query']['filter']){_0x3867f5[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x3867f5[_0x3948('0x39')],{'$or':_['map'](_0x3867f5['attributes'],function(_0x36ce97){var _0x1a5056={};_0x1a5056[_0x36ce97]={'$like':'%'+_0x1c1074[_0x3948('0x2e')][_0x3948('0x38')]+'%'};return _0x1a5056;})});}_0x3867f5=_['merge']({},_0x3867f5,_0x1c1074[_0x3948('0x3b')]);return _0x368703[_0x3948('0x4c')](_0x3867f5);}})['then'](function(_0x9a4fc0){if(_0x9a4fc0){_0x562229=_0x9a4fc0[_0x3948('0x33')];if(!_0x1c1074[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x3867f5[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x1c1074[_0x3948('0x2e')][_0x3948('0x1c')]);_0x3867f5['offset']=qs[_0x3948('0x1b')](_0x1c1074['query']['offset']);}return _0x368703[_0x3948('0x4c')](_0x3867f5);}})['then'](function(_0x32d60f){if(_0x32d60f){return _0x32d60f?{'count':_0x562229,'rows':_0x32d60f}:null;}})[_0x3948('0x23')](respondWithResult(_0x469208,null))[_0x3948('0x3f')](handleError(_0x469208,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 6efaae7..b40d1be 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 _0x5176=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','../../config/logger'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x5176,0x12a));var _0x6517=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5176[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x6517('0x0'));var util=require('util');var logger=require(_0x6517('0x1'))(_0x6517('0x2'));var moment=require(_0x6517('0x3'));var BPromise=require(_0x6517('0x4'));var rp=require(_0x6517('0x5'));var fs=require('fs');var path=require(_0x6517('0x6'));var rimraf=require('rimraf');var config=require(_0x6517('0x7'));var attributes=require(_0x6517('0x8'));module[_0x6517('0x9')]=function(_0x44fdd2,_0x3352f0){return _0x44fdd2[_0x6517('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x6517('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60d4=['../../config/logger','api','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x60d4,0xee));var _0x460d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x460d('0x0'));var util=require(_0x460d('0x1'));var logger=require(_0x460d('0x2'))(_0x460d('0x3'));var moment=require('moment');var BPromise=require(_0x460d('0x4'));var rp=require(_0x460d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x460d('0x6'));var config=require('../../config/environment');var attributes=require(_0x460d('0x7'));module[_0x460d('0x8')]=function(_0x5010e7,_0x1c04c9){return _0x5010e7[_0x460d('0x9')](_0x460d('0xa'),attributes,{'tableName':_0x460d('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 c036cf9..9f904b9 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 _0x80df=['jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x10bc13,_0x33e345){var _0x21f48a=function(_0x5603e5){while(--_0x5603e5){_0x10bc13['push'](_0x10bc13['shift']());}};_0x21f48a(++_0x33e345);}(_0x80df,0xa0));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require('util');var moment=require(_0xf80d('0x1'));var BPromise=require(_0xf80d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x3'));var db=require(_0xf80d('0x4'))['db'];var utils=require(_0xf80d('0x5'));var logger=require(_0xf80d('0x6'))('rpc');var config=require(_0xf80d('0x7'));var jayson=require(_0xf80d('0x8'));var client=jayson[_0xf80d('0x9')][_0xf80d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x920a55,_0x6a88e7,_0x53f8e0){return new BPromise(function(_0x3fb50a,_0x5163c2){return client[_0xf80d('0xb')](_0x920a55,_0x53f8e0)[_0xf80d('0xc')](function(_0x305bf3){logger['info'](_0xf80d('0xd'),_0x6a88e7,'request\x20sent');logger[_0xf80d('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x6a88e7,_0xf80d('0xf'),JSON['stringify'](_0x305bf3));if(_0x305bf3[_0xf80d('0x10')]){if(_0x305bf3[_0xf80d('0x10')][_0xf80d('0x11')]===0x1f4){logger[_0xf80d('0x10')](_0xf80d('0xd'),_0x6a88e7,_0x305bf3[_0xf80d('0x10')][_0xf80d('0x12')]);return _0x5163c2(_0x305bf3[_0xf80d('0x10')][_0xf80d('0x12')]);}logger[_0xf80d('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x6a88e7,_0x305bf3[_0xf80d('0x10')][_0xf80d('0x12')]);return _0x3fb50a(_0x305bf3['error'][_0xf80d('0x12')]);}else{logger[_0xf80d('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x6a88e7,'request\x20sent');_0x3fb50a(_0x305bf3['result']['message']);}})[_0xf80d('0x14')](function(_0x2b3f33){logger[_0xf80d('0x10')](_0xf80d('0xd'),_0x6a88e7,_0x2b3f33);_0x5163c2(_0x2b3f33);});});} \ No newline at end of file +var _0xf599=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf599,0x160));var _0x9f59=function(_0xf6f160,_0x20915a){_0xf6f160=_0xf6f160-0x0;var _0xd6aa49=_0xf599[_0xf6f160];return _0xd6aa49;};'use strict';var _=require(_0x9f59('0x0'));var util=require(_0x9f59('0x1'));var moment=require('moment');var BPromise=require(_0x9f59('0x2'));var rs=require(_0x9f59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f59('0x4'))['db'];var utils=require(_0x9f59('0x5'));var logger=require('../../config/logger')(_0x9f59('0x6'));var config=require(_0x9f59('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f59('0x8')][_0x9f59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bdb2d,_0x5e8084,_0x59cf54){return new BPromise(function(_0x1e37a6,_0x3e6bce){return client[_0x9f59('0xa')](_0x2bdb2d,_0x59cf54)[_0x9f59('0xb')](function(_0x301232){logger[_0x9f59('0xc')](_0x9f59('0xd'),_0x5e8084,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5e8084,_0x9f59('0xe'),JSON[_0x9f59('0xf')](_0x301232));if(_0x301232['error']){if(_0x301232[_0x9f59('0x10')][_0x9f59('0x11')]===0x1f4){logger[_0x9f59('0x10')](_0x9f59('0xd'),_0x5e8084,_0x301232['error']['message']);return _0x3e6bce(_0x301232['error']['message']);}logger[_0x9f59('0x10')](_0x9f59('0xd'),_0x5e8084,_0x301232[_0x9f59('0x10')][_0x9f59('0x12')]);return _0x1e37a6(_0x301232[_0x9f59('0x10')]['message']);}else{logger[_0x9f59('0xc')](_0x9f59('0xd'),_0x5e8084,_0x9f59('0xe'));_0x1e37a6(_0x301232['result'][_0x9f59('0x12')]);}})[_0x9f59('0x13')](function(_0x2abae6){logger['error'](_0x9f59('0xd'),_0x5e8084,_0x2abae6);_0x3e6bce(_0x2abae6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index be9cc19..cfc9317 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 _0xeea4=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x26b292,_0x499678){var _0xc857e=function(_0x3650c4){while(--_0x3650c4){_0x26b292['push'](_0x26b292['shift']());}};_0xc857e(++_0x499678);}(_0xeea4,0x19e));var _0x4eea=function(_0x227c9b,_0x34d983){_0x227c9b=_0x227c9b-0x0;var _0x37f247=_0xeea4[_0x227c9b];return _0x37f247;};'use strict';var multer=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var path=require(_0x4eea('0x2'));var timeout=require(_0x4eea('0x3'));var express=require(_0x4eea('0x4'));var router=express[_0x4eea('0x5')]();var fs_extra=require(_0x4eea('0x6'));var auth=require(_0x4eea('0x7'));var interaction=require(_0x4eea('0x8'));var config=require('../../config/environment');var controller=require(_0x4eea('0x9'));router['get']('/',auth[_0x4eea('0xa')](),controller[_0x4eea('0xb')]);router[_0x4eea('0xc')]('/:id',auth[_0x4eea('0xa')](),controller[_0x4eea('0xd')]);router['post']('/',auth[_0x4eea('0xa')](),controller[_0x4eea('0xe')]);router[_0x4eea('0xf')](_0x4eea('0x10'),auth['isAuthenticated'](),controller[_0x4eea('0x11')]);router[_0x4eea('0x12')](_0x4eea('0x10'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x13')]);module[_0x4eea('0x14')]=router; \ No newline at end of file +var _0x9990=['get','isAuthenticated','/:id','show','post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller'];(function(_0x3d4a27,_0x2929c2){var _0x30df43=function(_0x19475e){while(--_0x19475e){_0x3d4a27['push'](_0x3d4a27['shift']());}};_0x30df43(++_0x2929c2);}(_0x9990,0xf6));var _0x0999=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x9990[_0x3a6e4b];return _0x36572d;};'use strict';var multer=require('multer');var util=require(_0x0999('0x0'));var path=require(_0x0999('0x1'));var timeout=require(_0x0999('0x2'));var express=require(_0x0999('0x3'));var router=express[_0x0999('0x4')]();var fs_extra=require(_0x0999('0x5'));var auth=require(_0x0999('0x6'));var interaction=require(_0x0999('0x7'));var config=require('../../config/environment');var controller=require(_0x0999('0x8'));router[_0x0999('0x9')]('/',auth[_0x0999('0xa')](),controller['index']);router[_0x0999('0x9')](_0x0999('0xb'),auth[_0x0999('0xa')](),controller[_0x0999('0xc')]);router[_0x0999('0xd')]('/',auth[_0x0999('0xa')](),controller[_0x0999('0xe')]);router['put'](_0x0999('0xb'),auth[_0x0999('0xa')](),controller[_0x0999('0xf')]);router['delete'](_0x0999('0xb'),auth[_0x0999('0xa')](),controller[_0x0999('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index b1e3de9..e02f5f0 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 _0x977f=['keyValue','picklist','STRING','BOOLEAN','sequelize','string','variable','customVariable'];(function(_0x1e4a6f,_0x28fa3f){var _0x567ad2=function(_0x1b6784){while(--_0x1b6784){_0x1e4a6f['push'](_0x1e4a6f['shift']());}};_0x567ad2(++_0x28fa3f);}(_0x977f,0x124));var _0xf977=function(_0x25881d,_0x2fc6b8){_0x25881d=_0x25881d-0x0;var _0x45c724=_0x977f[_0x25881d];return _0x45c724;};'use strict';var Sequelize=require(_0xf977('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf977('0x1'),_0xf977('0x2'),_0xf977('0x3'),_0xf977('0x4'),_0xf977('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf977('0x6')]},'key':{'type':Sequelize[_0xf977('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf977('0x1'),'variable',_0xf977('0x3'))},'keyContent':{'type':Sequelize[_0xf977('0x6')]},'idField':{'type':Sequelize[_0xf977('0x6')]},'nameField':{'type':Sequelize[_0xf977('0x6')]},'customField':{'type':Sequelize[_0xf977('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf977('0x6')]}}; \ No newline at end of file +var _0x7711=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x59ac70,_0x3a4be3){var _0xf38123=function(_0x2035a8){while(--_0x2035a8){_0x59ac70['push'](_0x59ac70['shift']());}};_0xf38123(++_0x3a4be3);}(_0x7711,0x102));var _0x1771=function(_0x27e469,_0x1fc5e){_0x27e469=_0x27e469-0x0;var _0x563bad=_0x7711[_0x27e469];return _0x563bad;};'use strict';var Sequelize=require(_0x1771('0x0'));module[_0x1771('0x1')]={'type':{'type':Sequelize[_0x1771('0x2')](_0x1771('0x3'),_0x1771('0x4'),'customVariable',_0x1771('0x5'),_0x1771('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1771('0x7')]},'key':{'type':Sequelize[_0x1771('0x7')]},'keyType':{'type':Sequelize[_0x1771('0x2')](_0x1771('0x3'),_0x1771('0x4'),_0x1771('0x8'))},'keyContent':{'type':Sequelize[_0x1771('0x7')]},'idField':{'type':Sequelize[_0x1771('0x7')]},'nameField':{'type':Sequelize[_0x1771('0x7')]},'customField':{'type':Sequelize[_0x1771('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1771('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index d645426..278766f 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 _0xc480=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','undefined','limit','offset','count','status','set','Content-Range','json','reject','save','then','destroy','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','update','find','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0xc480,0xd2));var _0x0c48=function(_0x12771f,_0x4f203e){_0x12771f=_0x12771f-0x0;var _0xef2dc1=_0xc480[_0x12771f];return _0xef2dc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c48('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c48('0x1'));var rp=require(_0x0c48('0x2'));var moment=require('moment');var BPromise=require(_0x0c48('0x3'));var Mustache=require('mustache');var util=require(_0x0c48('0x4'));var path=require(_0x0c48('0x5'));var sox=require(_0x0c48('0x6'));var csv=require(_0x0c48('0x7'));var ejs=require(_0x0c48('0x8'));var fs=require('fs');var fs_extra=require(_0x0c48('0x9'));var _=require(_0x0c48('0xa'));var squel=require(_0x0c48('0xb'));var crypto=require(_0x0c48('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0c48('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0c48('0xe'));var Papa=require(_0x0c48('0xf'));var Redis=require(_0x0c48('0x10'));var authService=require(_0x0c48('0x11'));var qs=require(_0x0c48('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c48('0x13'));var logger=require('../../config/logger')(_0x0c48('0x14'));var utils=require(_0x0c48('0x15'));var config=require(_0x0c48('0x16'));var licenseUtil=require(_0x0c48('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c84ec,_0x521c02){_0x521c02=_0x521c02||0xcc;return function(_0xb9ec20){if(_0xb9ec20){return _0x2c84ec[_0x0c48('0x18')](_0x521c02);}return _0x2c84ec['status'](_0x521c02)[_0x0c48('0x19')]();};}function respondWithResult(_0x412ba5,_0x16e67f){_0x16e67f=_0x16e67f||0xc8;return function(_0x1705bf){if(_0x1705bf){return _0x412ba5['status'](_0x16e67f)['json'](_0x1705bf);}};}function respondWithFilteredResult(_0x46bf39,_0x5cd666){return function(_0x2a0856){if(_0x2a0856){var _0x575e34=typeof _0x5cd666['offset']===_0x0c48('0x1a')&&typeof _0x5cd666[_0x0c48('0x1b')]===_0x0c48('0x1a');var _0x31f117=_0x2a0856['count'];var _0xe8b73b=_0x575e34?0x0:_0x5cd666[_0x0c48('0x1c')];var _0x2116c6=_0x575e34?_0x2a0856[_0x0c48('0x1d')]:_0x5cd666[_0x0c48('0x1c')]+_0x5cd666[_0x0c48('0x1b')];var _0x42a5a7;if(_0x2116c6>=_0x31f117){_0x2116c6=_0x31f117;_0x42a5a7=0xc8;}else{_0x42a5a7=0xce;}_0x46bf39[_0x0c48('0x1e')](_0x42a5a7);return _0x46bf39[_0x0c48('0x1f')](_0x0c48('0x20'),_0xe8b73b+'-'+_0x2116c6+'/'+_0x31f117)[_0x0c48('0x21')](_0x2a0856);}return null;};}function patchUpdates(_0x19d0a1){return function(_0x369b3c){try{jsonpatch['apply'](_0x369b3c,_0x19d0a1,!![]);}catch(_0xe44c97){return BPromise[_0x0c48('0x22')](_0xe44c97);}return _0x369b3c[_0x0c48('0x23')]();};}function saveUpdates(_0x9422e8,_0x5c9a1e){return function(_0x496610){if(_0x496610){return _0x496610['update'](_0x9422e8)[_0x0c48('0x24')](function(_0x29769b){return _0x29769b;});}return null;};}function removeEntity(_0x268e1b,_0x424e43){return function(_0x4ec52c){if(_0x4ec52c){return _0x4ec52c[_0x0c48('0x25')]()['then'](function(){_0x268e1b[_0x0c48('0x1e')](0xcc)[_0x0c48('0x19')]();});}};}function handleEntityNotFound(_0x522fc2,_0x52a333){return function(_0xc0bec9){if(!_0xc0bec9){_0x522fc2[_0x0c48('0x18')](0x194);}return _0xc0bec9;};}function handleError(_0x427a1d,_0x5320b4){_0x5320b4=_0x5320b4||0x1f4;return function(_0x16bf5d){logger['error'](_0x16bf5d[_0x0c48('0x26')]);if(_0x16bf5d['name']){delete _0x16bf5d[_0x0c48('0x27')];}_0x427a1d[_0x0c48('0x1e')](_0x5320b4)[_0x0c48('0x28')](_0x16bf5d);};}exports[_0x0c48('0x29')]=function(_0x5cf7ae,_0x38a1b5){var _0x219605={},_0x13b6ac={},_0x28a123={'count':0x0,'rows':[]};var _0x35e9e8=_[_0x0c48('0x2a')](db[_0x0c48('0x2b')][_0x0c48('0x2c')],function(_0x44790a){return{'name':_0x44790a[_0x0c48('0x2d')],'type':_0x44790a[_0x0c48('0x2e')][_0x0c48('0x2f')]};});_0x13b6ac[_0x0c48('0x30')]=_[_0x0c48('0x2a')](_0x35e9e8,_0x0c48('0x27'));_0x13b6ac[_0x0c48('0x31')]=_[_0x0c48('0x32')](_0x5cf7ae[_0x0c48('0x31')]);_0x13b6ac[_0x0c48('0x33')]=_[_0x0c48('0x34')](_0x13b6ac[_0x0c48('0x30')],_0x13b6ac[_0x0c48('0x31')]);_0x219605[_0x0c48('0x35')]=_[_0x0c48('0x34')](_0x13b6ac[_0x0c48('0x30')],qs[_0x0c48('0x36')](_0x5cf7ae['query']['fields']));_0x219605[_0x0c48('0x35')]=_0x219605[_0x0c48('0x35')][_0x0c48('0x37')]?_0x219605['attributes']:_0x13b6ac[_0x0c48('0x30')];if(!_0x5cf7ae[_0x0c48('0x31')][_0x0c48('0x38')]('nolimit')){_0x219605[_0x0c48('0x1b')]=qs[_0x0c48('0x1b')](_0x5cf7ae[_0x0c48('0x31')][_0x0c48('0x1b')]);_0x219605[_0x0c48('0x1c')]=qs['offset'](_0x5cf7ae[_0x0c48('0x31')][_0x0c48('0x1c')]);}_0x219605['order']=qs[_0x0c48('0x39')](_0x5cf7ae[_0x0c48('0x31')][_0x0c48('0x39')]);_0x219605['where']=qs[_0x0c48('0x33')](_[_0x0c48('0x3a')](_0x5cf7ae['query'],_0x13b6ac[_0x0c48('0x33')]),_0x35e9e8);if(_0x5cf7ae['query'][_0x0c48('0x3b')]){_0x219605[_0x0c48('0x3c')]=_[_0x0c48('0x3d')](_0x219605['where'],{'$or':_[_0x0c48('0x2a')](_0x35e9e8,function(_0x53df99){if(_0x53df99[_0x0c48('0x2e')]!==_0x0c48('0x3e')){var _0x259b74={};_0x259b74[_0x53df99[_0x0c48('0x27')]]={'$like':'%'+_0x5cf7ae[_0x0c48('0x31')][_0x0c48('0x3b')]+'%'};return _0x259b74;}})});}_0x219605=_['merge']({},_0x219605,_0x5cf7ae[_0x0c48('0x3f')]);var _0x47703e={'where':_0x219605[_0x0c48('0x3c')]};return db[_0x0c48('0x2b')][_0x0c48('0x1d')](_0x47703e)[_0x0c48('0x24')](function(_0xa8b6ed){_0x28a123[_0x0c48('0x1d')]=_0xa8b6ed;if(_0x5cf7ae[_0x0c48('0x31')][_0x0c48('0x40')]){_0x219605['include']=[{'all':!![]}];}return db[_0x0c48('0x2b')][_0x0c48('0x41')](_0x219605);})['then'](function(_0x523b75){_0x28a123[_0x0c48('0x42')]=_0x523b75;return _0x28a123;})['then'](respondWithFilteredResult(_0x38a1b5,_0x219605))[_0x0c48('0x43')](handleError(_0x38a1b5,null));};exports['show']=function(_0x13cfee,_0x27c3d8){var _0x4a2233={'raw':!![],'where':{'id':_0x13cfee[_0x0c48('0x44')]['id']}},_0x1208a6={};_0x1208a6[_0x0c48('0x30')]=_[_0x0c48('0x32')](db[_0x0c48('0x2b')][_0x0c48('0x2c')]);_0x1208a6[_0x0c48('0x31')]=_[_0x0c48('0x32')](_0x13cfee[_0x0c48('0x31')]);_0x1208a6[_0x0c48('0x33')]=_[_0x0c48('0x34')](_0x1208a6[_0x0c48('0x30')],_0x1208a6['query']);_0x4a2233[_0x0c48('0x35')]=_['intersection'](_0x1208a6[_0x0c48('0x30')],qs[_0x0c48('0x36')](_0x13cfee[_0x0c48('0x31')][_0x0c48('0x36')]));_0x4a2233[_0x0c48('0x35')]=_0x4a2233['attributes'][_0x0c48('0x37')]?_0x4a2233[_0x0c48('0x35')]:_0x1208a6[_0x0c48('0x30')];if(_0x13cfee['query'][_0x0c48('0x40')]){_0x4a2233[_0x0c48('0x45')]=[{'all':!![]}];}_0x4a2233=_['merge']({},_0x4a2233,_0x13cfee[_0x0c48('0x3f')]);return db[_0x0c48('0x2b')]['find'](_0x4a2233)[_0x0c48('0x24')](handleEntityNotFound(_0x27c3d8,null))[_0x0c48('0x24')](respondWithResult(_0x27c3d8,null))[_0x0c48('0x43')](handleError(_0x27c3d8,null));};exports[_0x0c48('0x46')]=function(_0x396988,_0x126743){return db['FreshsalesField'][_0x0c48('0x46')](_0x396988[_0x0c48('0x47')],{})['then'](respondWithResult(_0x126743,0xc9))['catch'](handleError(_0x126743,null));};exports[_0x0c48('0x48')]=function(_0x7d6ae2,_0x1c6ec6){if(_0x7d6ae2[_0x0c48('0x47')]['id']){delete _0x7d6ae2[_0x0c48('0x47')]['id'];}return db[_0x0c48('0x2b')]['find']({'where':{'id':_0x7d6ae2['params']['id']}})['then'](handleEntityNotFound(_0x1c6ec6,null))[_0x0c48('0x24')](saveUpdates(_0x7d6ae2[_0x0c48('0x47')],null))[_0x0c48('0x24')](respondWithResult(_0x1c6ec6,null))[_0x0c48('0x43')](handleError(_0x1c6ec6,null));};exports[_0x0c48('0x25')]=function(_0x51fea4,_0x27fe81){return db['FreshsalesField'][_0x0c48('0x49')]({'where':{'id':_0x51fea4[_0x0c48('0x44')]['id']}})[_0x0c48('0x24')](handleEntityNotFound(_0x27fe81,null))[_0x0c48('0x24')](removeEntity(_0x27fe81,null))[_0x0c48('0x43')](handleError(_0x27fe81,null));}; \ No newline at end of file +var _0x198a=['index','map','FreshsalesField','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','send'];(function(_0x3470ef,_0x3bc4b3){var _0x4286a4=function(_0x597635){while(--_0x597635){_0x3470ef['push'](_0x3470ef['shift']());}};_0x4286a4(++_0x3bc4b3);}(_0x198a,0x1e3));var _0xa198=function(_0x3e89ca,_0x41c7e0){_0x3e89ca=_0x3e89ca-0x0;var _0x3e93d8=_0x198a[_0x3e89ca];return _0x3e93d8;};'use strict';var emlformat=require(_0xa198('0x0'));var rimraf=require(_0xa198('0x1'));var zipdir=require(_0xa198('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa198('0x3'));var BPromise=require(_0xa198('0x4'));var Mustache=require(_0xa198('0x5'));var util=require(_0xa198('0x6'));var path=require('path');var sox=require(_0xa198('0x7'));var csv=require(_0xa198('0x8'));var ejs=require(_0xa198('0x9'));var fs=require('fs');var fs_extra=require(_0xa198('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa198('0xb'));var jsforce=require(_0xa198('0xc'));var deskjs=require(_0xa198('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa198('0xe'));var Papa=require('papaparse');var Redis=require(_0xa198('0xf'));var authService=require(_0xa198('0x10'));var qs=require(_0xa198('0x11'));var as=require(_0xa198('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa198('0x13'))(_0xa198('0x14'));var utils=require(_0xa198('0x15'));var config=require(_0xa198('0x16'));var licenseUtil=require(_0xa198('0x17'));var db=require(_0xa198('0x18'))['db'];function respondWithStatusCode(_0x3d4034,_0x1c862a){_0x1c862a=_0x1c862a||0xcc;return function(_0x7616eb){if(_0x7616eb){return _0x3d4034[_0xa198('0x19')](_0x1c862a);}return _0x3d4034['status'](_0x1c862a)[_0xa198('0x1a')]();};}function respondWithResult(_0x4f5e7b,_0x19ebbf){_0x19ebbf=_0x19ebbf||0xc8;return function(_0x3305af){if(_0x3305af){return _0x4f5e7b[_0xa198('0x1b')](_0x19ebbf)[_0xa198('0x1c')](_0x3305af);}};}function respondWithFilteredResult(_0xb3f12d,_0x42f94a){return function(_0x4f893a){if(_0x4f893a){var _0x2c3848=typeof _0x42f94a[_0xa198('0x1d')]==='undefined'&&typeof _0x42f94a['limit']===_0xa198('0x1e');var _0x55e892=_0x4f893a[_0xa198('0x1f')];var _0x561c42=_0x2c3848?0x0:_0x42f94a[_0xa198('0x1d')];var _0x3e1a1f=_0x2c3848?_0x4f893a[_0xa198('0x1f')]:_0x42f94a[_0xa198('0x1d')]+_0x42f94a[_0xa198('0x20')];var _0x30e00e;if(_0x3e1a1f>=_0x55e892){_0x3e1a1f=_0x55e892;_0x30e00e=0xc8;}else{_0x30e00e=0xce;}_0xb3f12d[_0xa198('0x1b')](_0x30e00e);return _0xb3f12d[_0xa198('0x21')](_0xa198('0x22'),_0x561c42+'-'+_0x3e1a1f+'/'+_0x55e892)[_0xa198('0x1c')](_0x4f893a);}return null;};}function patchUpdates(_0x1e3ba6){return function(_0x172ed4){try{jsonpatch[_0xa198('0x23')](_0x172ed4,_0x1e3ba6,!![]);}catch(_0x1ac010){return BPromise['reject'](_0x1ac010);}return _0x172ed4[_0xa198('0x24')]();};}function saveUpdates(_0x168344,_0x40d4aa){return function(_0x134941){if(_0x134941){return _0x134941[_0xa198('0x25')](_0x168344)[_0xa198('0x26')](function(_0x3fc065){return _0x3fc065;});}return null;};}function removeEntity(_0x1ee730,_0x11aa3e){return function(_0xa00f01){if(_0xa00f01){return _0xa00f01[_0xa198('0x27')]()['then'](function(){_0x1ee730[_0xa198('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a1f81,_0x452c81){return function(_0x5a4b6b){if(!_0x5a4b6b){_0x5a1f81[_0xa198('0x19')](0x194);}return _0x5a4b6b;};}function handleError(_0x59ebf9,_0x424f29){_0x424f29=_0x424f29||0x1f4;return function(_0x475506){logger[_0xa198('0x28')](_0x475506['stack']);if(_0x475506['name']){delete _0x475506['name'];}_0x59ebf9[_0xa198('0x1b')](_0x424f29)[_0xa198('0x29')](_0x475506);};}exports[_0xa198('0x2a')]=function(_0x14511,_0x2521ef){var _0x5cc51f={},_0x2eeb35={},_0x57fba6={'count':0x0,'rows':[]};var _0x27e5a8=_[_0xa198('0x2b')](db[_0xa198('0x2c')]['rawAttributes'],function(_0x164ec5){return{'name':_0x164ec5['fieldName'],'type':_0x164ec5['type']['key']};});_0x2eeb35['model']=_['map'](_0x27e5a8,'name');_0x2eeb35['query']=_[_0xa198('0x2d')](_0x14511[_0xa198('0x2e')]);_0x2eeb35['filters']=_[_0xa198('0x2f')](_0x2eeb35[_0xa198('0x30')],_0x2eeb35[_0xa198('0x2e')]);_0x5cc51f['attributes']=_[_0xa198('0x2f')](_0x2eeb35[_0xa198('0x30')],qs[_0xa198('0x31')](_0x14511[_0xa198('0x2e')][_0xa198('0x31')]));_0x5cc51f[_0xa198('0x32')]=_0x5cc51f[_0xa198('0x32')][_0xa198('0x33')]?_0x5cc51f[_0xa198('0x32')]:_0x2eeb35[_0xa198('0x30')];if(!_0x14511[_0xa198('0x2e')][_0xa198('0x34')]('nolimit')){_0x5cc51f[_0xa198('0x20')]=qs[_0xa198('0x20')](_0x14511['query']['limit']);_0x5cc51f[_0xa198('0x1d')]=qs[_0xa198('0x1d')](_0x14511[_0xa198('0x2e')][_0xa198('0x1d')]);}_0x5cc51f[_0xa198('0x35')]=qs[_0xa198('0x36')](_0x14511[_0xa198('0x2e')][_0xa198('0x36')]);_0x5cc51f[_0xa198('0x37')]=qs['filters'](_[_0xa198('0x38')](_0x14511[_0xa198('0x2e')],_0x2eeb35[_0xa198('0x39')]),_0x27e5a8);if(_0x14511[_0xa198('0x2e')][_0xa198('0x3a')]){_0x5cc51f[_0xa198('0x37')]=_[_0xa198('0x3b')](_0x5cc51f[_0xa198('0x37')],{'$or':_[_0xa198('0x2b')](_0x27e5a8,function(_0xf0ef21){if(_0xf0ef21[_0xa198('0x3c')]!==_0xa198('0x3d')){var _0x1c3ede={};_0x1c3ede[_0xf0ef21[_0xa198('0x3e')]]={'$like':'%'+_0x14511['query'][_0xa198('0x3a')]+'%'};return _0x1c3ede;}})});}_0x5cc51f=_[_0xa198('0x3b')]({},_0x5cc51f,_0x14511[_0xa198('0x3f')]);var _0x123192={'where':_0x5cc51f['where']};return db[_0xa198('0x2c')][_0xa198('0x1f')](_0x123192)['then'](function(_0x595a09){_0x57fba6['count']=_0x595a09;if(_0x14511[_0xa198('0x2e')][_0xa198('0x40')]){_0x5cc51f[_0xa198('0x41')]=[{'all':!![]}];}return db[_0xa198('0x2c')][_0xa198('0x42')](_0x5cc51f);})[_0xa198('0x26')](function(_0x5de2d6){_0x57fba6[_0xa198('0x43')]=_0x5de2d6;return _0x57fba6;})[_0xa198('0x26')](respondWithFilteredResult(_0x2521ef,_0x5cc51f))['catch'](handleError(_0x2521ef,null));};exports[_0xa198('0x44')]=function(_0x2f920a,_0x6d2564){var _0x426e24={'raw':!![],'where':{'id':_0x2f920a[_0xa198('0x45')]['id']}},_0x393e3d={};_0x393e3d['model']=_[_0xa198('0x2d')](db[_0xa198('0x2c')][_0xa198('0x46')]);_0x393e3d[_0xa198('0x2e')]=_[_0xa198('0x2d')](_0x2f920a[_0xa198('0x2e')]);_0x393e3d[_0xa198('0x39')]=_['intersection'](_0x393e3d[_0xa198('0x30')],_0x393e3d[_0xa198('0x2e')]);_0x426e24[_0xa198('0x32')]=_[_0xa198('0x2f')](_0x393e3d['model'],qs[_0xa198('0x31')](_0x2f920a[_0xa198('0x2e')]['fields']));_0x426e24[_0xa198('0x32')]=_0x426e24[_0xa198('0x32')][_0xa198('0x33')]?_0x426e24[_0xa198('0x32')]:_0x393e3d['model'];if(_0x2f920a['query'][_0xa198('0x40')]){_0x426e24['include']=[{'all':!![]}];}_0x426e24=_['merge']({},_0x426e24,_0x2f920a[_0xa198('0x3f')]);return db[_0xa198('0x2c')][_0xa198('0x47')](_0x426e24)[_0xa198('0x26')](handleEntityNotFound(_0x6d2564,null))[_0xa198('0x26')](respondWithResult(_0x6d2564,null))[_0xa198('0x48')](handleError(_0x6d2564,null));};exports[_0xa198('0x49')]=function(_0x43b819,_0x3ab666){return db['FreshsalesField']['create'](_0x43b819[_0xa198('0x4a')],{})[_0xa198('0x26')](respondWithResult(_0x3ab666,0xc9))[_0xa198('0x48')](handleError(_0x3ab666,null));};exports[_0xa198('0x25')]=function(_0x437a1c,_0x5b5c40){if(_0x437a1c[_0xa198('0x4a')]['id']){delete _0x437a1c[_0xa198('0x4a')]['id'];}return db[_0xa198('0x2c')]['find']({'where':{'id':_0x437a1c[_0xa198('0x45')]['id']}})[_0xa198('0x26')](handleEntityNotFound(_0x5b5c40,null))[_0xa198('0x26')](saveUpdates(_0x437a1c['body'],null))['then'](respondWithResult(_0x5b5c40,null))[_0xa198('0x48')](handleError(_0x5b5c40,null));};exports[_0xa198('0x27')]=function(_0x56fb39,_0x5714f2){return db[_0xa198('0x2c')][_0xa198('0x47')]({'where':{'id':_0x56fb39[_0xa198('0x45')]['id']}})[_0xa198('0x26')](handleEntityNotFound(_0x5714f2,null))[_0xa198('0x26')](removeEntity(_0x5714f2,null))['catch'](handleError(_0x5714f2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e640c4c..3dadf47 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 _0x1267=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','FieldId','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1267,0xb5));var _0x7126=function(_0x26a096,_0xde2bf2){_0x26a096=_0x26a096-0x0;var _0x6586a=_0x1267[_0x26a096];return _0x6586a;};'use strict';var _=require(_0x7126('0x0'));var util=require(_0x7126('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7126('0x2'));var BPromise=require(_0x7126('0x3'));var rp=require(_0x7126('0x4'));var fs=require('fs');var path=require(_0x7126('0x5'));var rimraf=require(_0x7126('0x6'));var config=require(_0x7126('0x7'));var attributes=require(_0x7126('0x8'));module['exports']=function(_0x1fa48f,_0x3fe051){return _0x1fa48f[_0x7126('0x9')](_0x7126('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7126('0xb'),'fields':['idField',_0x7126('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x68b7=['moment','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','lodash','../../config/logger','api'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x68b7,0x8c));var _0x768b=function(_0xf8a7eb,_0x5539b5){_0xf8a7eb=_0xf8a7eb-0x0;var _0x131659=_0x68b7[_0xf8a7eb];return _0x131659;};'use strict';var _=require(_0x768b('0x0'));var util=require('util');var logger=require(_0x768b('0x1'))(_0x768b('0x2'));var moment=require(_0x768b('0x3'));var BPromise=require('bluebird');var rp=require(_0x768b('0x4'));var fs=require('fs');var path=require(_0x768b('0x5'));var rimraf=require(_0x768b('0x6'));var config=require('../../config/environment');var attributes=require(_0x768b('0x7'));module[_0x768b('0x8')]=function(_0x18aaaa,_0x31aba4){return _0x18aaaa[_0x768b('0x9')](_0x768b('0xa'),attributes,{'tableName':_0x768b('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x768b('0xc'),'FieldId'],'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 8e258ad..10654ab 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 _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x4f36a5,_0x26e6ba){var _0x332185=function(_0x102330){while(--_0x102330){_0x4f36a5['push'](_0x4f36a5['shift']());}};_0x332185(++_0x26e6ba);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x13bdee,_0x564c12){_0x13bdee=_0x13bdee-0x0;var _0x718a90=_0xdbf5[_0x13bdee];return _0x718a90;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file +var _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4ea558,_0x4587e8){var _0x146d7c=function(_0x1e16ad){while(--_0x1e16ad){_0x4ea558['push'](_0x4ea558['shift']());}};_0x146d7c(++_0x4587e8);}(_0x2bd8,0x130));var _0x82bd=function(_0x42a3ab,_0x72d67f){_0x42a3ab=_0x42a3ab-0x0;var _0x59baee=_0x2bd8[_0x42a3ab];return _0x59baee;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5bf925e..162b936 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x27450a,_0x267abb){var _0x49a74c=function(_0x169844){while(--_0x169844){_0x27450a['push'](_0x27450a['shift']());}};_0x49a74c(++_0x267abb);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1f65d0,_0x34317a){var _0x36b5d1=function(_0x27bbf0){while(--_0x27bbf0){_0x1f65d0['push'](_0x1f65d0['shift']());}};_0x36b5d1(++_0x34317a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e091e62..9a352de 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 _0xd0ee=['STRING','ENUM','exports'];(function(_0x17ea7a,_0x532de6){var _0xfbc8d2=function(_0x6bde42){while(--_0x6bde42){_0x17ea7a['push'](_0x17ea7a['shift']());}};_0xfbc8d2(++_0x532de6);}(_0xd0ee,0x19a));var _0xed0e=function(_0x4a58d1,_0x17cd55){_0x4a58d1=_0x4a58d1-0x0;var _0x121f99=_0xd0ee[_0x4a58d1];return _0x121f99;};'use strict';var Sequelize=require('sequelize');module[_0xed0e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xed0e('0x1')]},'username':{'type':Sequelize[_0xed0e('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xed0e('0x1')]},'password':{'type':Sequelize[_0xed0e('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xed0e('0x1')]},'securityToken':{'type':Sequelize[_0xed0e('0x1')]},'serverUrl':{'type':Sequelize[_0xed0e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xed0e('0x2')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2517=['newTab','integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x2517,0xfe));var _0x7251=function(_0x3723d5,_0x421f4b){_0x3723d5=_0x3723d5-0x0;var _0x215936=_0x2517[_0x3723d5];return _0x215936;};'use strict';var Sequelize=require(_0x7251('0x0'));module[_0x7251('0x1')]={'name':{'type':Sequelize[_0x7251('0x2')]},'description':{'type':Sequelize[_0x7251('0x2')]},'username':{'type':Sequelize[_0x7251('0x2')],'unique':_0x7251('0x3')},'remoteUri':{'type':Sequelize[_0x7251('0x2')]},'password':{'type':Sequelize[_0x7251('0x2')]},'clientId':{'type':Sequelize[_0x7251('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x7251('0x2')]},'serverUrl':{'type':Sequelize[_0x7251('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7251('0x4')]('integrationTab',_0x7251('0x5')),'defaultValue':_0x7251('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 31a2c28..01db50b 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 _0xeb32=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','find','create','body','getConfigurations','findOne','SalesforceConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','lastIndexOf','Connection','login','username','concat','isNil','ticketType','sobject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','statusCode','error','getFields','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto'];(function(_0x3050b5,_0x182c6a){var _0x37cceb=function(_0x49b797){while(--_0x49b797){_0x3050b5['push'](_0x3050b5['shift']());}};_0x37cceb(++_0x182c6a);}(_0xeb32,0x6b));var _0x2eb3=function(_0x3a33cb,_0x1a8c5d){_0x3a33cb=_0x3a33cb-0x0;var _0x17ac91=_0xeb32[_0x3a33cb];return _0x17ac91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2eb3('0x0'));var zipdir=require(_0x2eb3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2eb3('0x2'));var moment=require(_0x2eb3('0x3'));var BPromise=require(_0x2eb3('0x4'));var Mustache=require(_0x2eb3('0x5'));var util=require(_0x2eb3('0x6'));var path=require(_0x2eb3('0x7'));var sox=require(_0x2eb3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2eb3('0x9'));var _=require(_0x2eb3('0xa'));var squel=require('squel');var crypto=require(_0x2eb3('0xb'));var jsforce=require(_0x2eb3('0xc'));var deskjs=require(_0x2eb3('0xd'));var toCsv=require(_0x2eb3('0xe'));var querystring=require(_0x2eb3('0xf'));var Papa=require(_0x2eb3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2eb3('0x11'));var as=require(_0x2eb3('0x12'));var hardwareService=require(_0x2eb3('0x13'));var logger=require(_0x2eb3('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2eb3('0x15'));var db=require(_0x2eb3('0x16'))['db'];var integrations=require(_0x2eb3('0x17'));function respondWithStatusCode(_0x319995,_0x224721){_0x224721=_0x224721||0xcc;return function(_0x1b8bc9){if(_0x1b8bc9){return _0x319995[_0x2eb3('0x18')](_0x224721);}return _0x319995[_0x2eb3('0x19')](_0x224721)[_0x2eb3('0x1a')]();};}function respondWithResult(_0x14b2b0,_0x5adc5b){_0x5adc5b=_0x5adc5b||0xc8;return function(_0x169c44){if(_0x169c44){return _0x14b2b0['status'](_0x5adc5b)[_0x2eb3('0x1b')](_0x169c44);}};}function respondWithFilteredResult(_0x260c1e,_0x23adf0){return function(_0x1f21c9){if(_0x1f21c9){var _0x1a3eb7=typeof _0x23adf0[_0x2eb3('0x1c')]===_0x2eb3('0x1d')&&typeof _0x23adf0[_0x2eb3('0x1e')]===_0x2eb3('0x1d');var _0x2ee390=_0x1f21c9[_0x2eb3('0x1f')];var _0x18e8ee=_0x1a3eb7?0x0:_0x23adf0['offset'];var _0x3f63c4=_0x1a3eb7?_0x1f21c9['count']:_0x23adf0[_0x2eb3('0x1c')]+_0x23adf0[_0x2eb3('0x1e')];var _0x39fb26;if(_0x3f63c4>=_0x2ee390){_0x3f63c4=_0x2ee390;_0x39fb26=0xc8;}else{_0x39fb26=0xce;}_0x260c1e[_0x2eb3('0x19')](_0x39fb26);return _0x260c1e[_0x2eb3('0x20')](_0x2eb3('0x21'),_0x18e8ee+'-'+_0x3f63c4+'/'+_0x2ee390)[_0x2eb3('0x1b')](_0x1f21c9);}return null;};}function patchUpdates(_0x5853b6){return function(_0x58385e){try{jsonpatch['apply'](_0x58385e,_0x5853b6,!![]);}catch(_0x1b974e){return BPromise['reject'](_0x1b974e);}return _0x58385e['save']();};}function saveUpdates(_0x47995a,_0x4b3826){return function(_0x2b41dc){if(_0x2b41dc){return _0x2b41dc[_0x2eb3('0x22')](_0x47995a)[_0x2eb3('0x23')](function(_0x1d3f8f){return _0x1d3f8f;});}return null;};}function removeEntity(_0x7b8752,_0x1e1d14){return function(_0x4bf8a5){if(_0x4bf8a5){return _0x4bf8a5[_0x2eb3('0x24')]()[_0x2eb3('0x23')](function(){_0x7b8752[_0x2eb3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2e91,_0x117fd8){return function(_0x168954){if(!_0x168954){_0x2b2e91[_0x2eb3('0x18')](0x194);}return _0x168954;};}function handleError(_0x151568,_0x11f90f){_0x11f90f=_0x11f90f||0x1f4;return function(_0x30449d){logger['error'](_0x30449d[_0x2eb3('0x25')]);if(_0x30449d[_0x2eb3('0x26')]){delete _0x30449d['name'];}_0x151568[_0x2eb3('0x19')](_0x11f90f)[_0x2eb3('0x27')](_0x30449d);};}exports[_0x2eb3('0x28')]=function(_0x406b9b,_0x4c0d63){var _0x4486b0={},_0x44c7a5={},_0x7e6b37={'count':0x0,'rows':[]};var _0x45bde4=_[_0x2eb3('0x29')](db[_0x2eb3('0x2a')]['rawAttributes'],function(_0x36aca5){return{'name':_0x36aca5[_0x2eb3('0x2b')],'type':_0x36aca5[_0x2eb3('0x2c')][_0x2eb3('0x2d')]};});_0x44c7a5['model']=_['map'](_0x45bde4,_0x2eb3('0x26'));_0x44c7a5[_0x2eb3('0x2e')]=_['keys'](_0x406b9b[_0x2eb3('0x2e')]);_0x44c7a5[_0x2eb3('0x2f')]=_[_0x2eb3('0x30')](_0x44c7a5[_0x2eb3('0x31')],_0x44c7a5['query']);_0x4486b0[_0x2eb3('0x32')]=_[_0x2eb3('0x30')](_0x44c7a5[_0x2eb3('0x31')],qs[_0x2eb3('0x33')](_0x406b9b[_0x2eb3('0x2e')][_0x2eb3('0x33')]));_0x4486b0[_0x2eb3('0x32')]=_0x4486b0['attributes'][_0x2eb3('0x34')]?_0x4486b0['attributes']:_0x44c7a5['model'];if(!_0x406b9b['query'][_0x2eb3('0x35')](_0x2eb3('0x36'))){_0x4486b0[_0x2eb3('0x1e')]=qs[_0x2eb3('0x1e')](_0x406b9b[_0x2eb3('0x2e')]['limit']);_0x4486b0[_0x2eb3('0x1c')]=qs[_0x2eb3('0x1c')](_0x406b9b[_0x2eb3('0x2e')]['offset']);}_0x4486b0[_0x2eb3('0x37')]=qs[_0x2eb3('0x38')](_0x406b9b[_0x2eb3('0x2e')][_0x2eb3('0x38')]);_0x4486b0[_0x2eb3('0x39')]=qs[_0x2eb3('0x2f')](_[_0x2eb3('0x3a')](_0x406b9b[_0x2eb3('0x2e')],_0x44c7a5[_0x2eb3('0x2f')]),_0x45bde4);if(_0x406b9b[_0x2eb3('0x2e')][_0x2eb3('0x3b')]){_0x4486b0['where']=_[_0x2eb3('0x3c')](_0x4486b0[_0x2eb3('0x39')],{'$or':_[_0x2eb3('0x29')](_0x45bde4,function(_0x28e9d3){if(_0x28e9d3[_0x2eb3('0x2c')]!==_0x2eb3('0x3d')){var _0x5ebc29={};_0x5ebc29[_0x28e9d3[_0x2eb3('0x26')]]={'$like':'%'+_0x406b9b[_0x2eb3('0x2e')]['filter']+'%'};return _0x5ebc29;}})});}_0x4486b0=_[_0x2eb3('0x3c')]({},_0x4486b0,_0x406b9b[_0x2eb3('0x3e')]);var _0x2235b1={'where':_0x4486b0[_0x2eb3('0x39')]};return db[_0x2eb3('0x2a')][_0x2eb3('0x1f')](_0x2235b1)[_0x2eb3('0x23')](function(_0x2765ee){_0x7e6b37[_0x2eb3('0x1f')]=_0x2765ee;if(_0x406b9b[_0x2eb3('0x2e')][_0x2eb3('0x3f')]){_0x4486b0['include']=[{'all':!![]}];}return db[_0x2eb3('0x2a')][_0x2eb3('0x40')](_0x4486b0);})[_0x2eb3('0x23')](function(_0x4838ed){_0x7e6b37[_0x2eb3('0x41')]=_0x4838ed;return _0x7e6b37;})[_0x2eb3('0x23')](respondWithFilteredResult(_0x4c0d63,_0x4486b0))[_0x2eb3('0x42')](handleError(_0x4c0d63,null));};exports['show']=function(_0xe9a8d1,_0x554148){var _0x36c457={'raw':![],'where':{'id':_0xe9a8d1[_0x2eb3('0x43')]['id']}},_0xf4ec2c={};_0xf4ec2c[_0x2eb3('0x31')]=_[_0x2eb3('0x44')](db[_0x2eb3('0x2a')][_0x2eb3('0x45')]);_0xf4ec2c[_0x2eb3('0x2e')]=_[_0x2eb3('0x44')](_0xe9a8d1[_0x2eb3('0x2e')]);_0xf4ec2c[_0x2eb3('0x2f')]=_[_0x2eb3('0x30')](_0xf4ec2c[_0x2eb3('0x31')],_0xf4ec2c[_0x2eb3('0x2e')]);_0x36c457[_0x2eb3('0x32')]=_[_0x2eb3('0x30')](_0xf4ec2c[_0x2eb3('0x31')],qs['fields'](_0xe9a8d1[_0x2eb3('0x2e')]['fields']));_0x36c457['attributes']=_0x36c457[_0x2eb3('0x32')][_0x2eb3('0x34')]?_0x36c457[_0x2eb3('0x32')]:_0xf4ec2c[_0x2eb3('0x31')];if(_0xe9a8d1[_0x2eb3('0x2e')][_0x2eb3('0x3f')]){_0x36c457['include']=[{'all':!![]}];}_0x36c457=_[_0x2eb3('0x3c')]({},_0x36c457,_0xe9a8d1['options']);return db['SalesforceAccount'][_0x2eb3('0x46')](_0x36c457)[_0x2eb3('0x23')](handleEntityNotFound(_0x554148,null))[_0x2eb3('0x23')](respondWithResult(_0x554148,null))[_0x2eb3('0x42')](handleError(_0x554148,null));};exports[_0x2eb3('0x47')]=function(_0xa6cc1a,_0x16ffe0){return db['SalesforceAccount'][_0x2eb3('0x47')](_0xa6cc1a[_0x2eb3('0x48')],{})[_0x2eb3('0x23')](respondWithResult(_0x16ffe0,0xc9))[_0x2eb3('0x42')](handleError(_0x16ffe0,null));};exports[_0x2eb3('0x22')]=function(_0x2d40ee,_0x5d23c5){if(_0x2d40ee['body']['id']){delete _0x2d40ee[_0x2eb3('0x48')]['id'];}return db[_0x2eb3('0x2a')][_0x2eb3('0x46')]({'where':{'id':_0x2d40ee[_0x2eb3('0x43')]['id']}})[_0x2eb3('0x23')](handleEntityNotFound(_0x5d23c5,null))[_0x2eb3('0x23')](saveUpdates(_0x2d40ee[_0x2eb3('0x48')],null))[_0x2eb3('0x23')](respondWithResult(_0x5d23c5,null))[_0x2eb3('0x42')](handleError(_0x5d23c5,null));};exports[_0x2eb3('0x24')]=function(_0x1b622c,_0x2142a2){return db[_0x2eb3('0x2a')]['find']({'where':{'id':_0x1b622c['params']['id']}})[_0x2eb3('0x23')](handleEntityNotFound(_0x2142a2,null))['then'](removeEntity(_0x2142a2,null))[_0x2eb3('0x42')](handleError(_0x2142a2,null));};exports[_0x2eb3('0x49')]=function(_0x5cefb0,_0x43ff9f,_0x3e1bf2){var _0x536fda={};var _0x38aa2e={};var _0x16487c;var _0x4cc7fb;return db['SalesforceAccount'][_0x2eb3('0x4a')]({'where':{'id':_0x5cefb0[_0x2eb3('0x43')]['id']}})[_0x2eb3('0x23')](handleEntityNotFound(_0x43ff9f,null))[_0x2eb3('0x23')](function(_0x32c714){if(_0x32c714){_0x16487c=_0x32c714;_0x38aa2e[_0x2eb3('0x31')]=_[_0x2eb3('0x44')](db[_0x2eb3('0x4b')][_0x2eb3('0x45')]);_0x38aa2e[_0x2eb3('0x2e')]=_['keys'](_0x5cefb0['query']);_0x38aa2e[_0x2eb3('0x2f')]=_[_0x2eb3('0x30')](_0x38aa2e[_0x2eb3('0x31')],_0x38aa2e[_0x2eb3('0x2e')]);_0x536fda['attributes']=_[_0x2eb3('0x30')](_0x38aa2e[_0x2eb3('0x31')],qs[_0x2eb3('0x33')](_0x5cefb0[_0x2eb3('0x2e')][_0x2eb3('0x33')]));_0x536fda[_0x2eb3('0x32')]=_0x536fda[_0x2eb3('0x32')][_0x2eb3('0x34')]?_0x536fda[_0x2eb3('0x32')]:_0x38aa2e['model'];_0x536fda['order']=qs['sort'](_0x5cefb0[_0x2eb3('0x2e')][_0x2eb3('0x38')]);_0x536fda[_0x2eb3('0x39')]=qs['filters'](_[_0x2eb3('0x3a')](_0x5cefb0[_0x2eb3('0x2e')],_0x38aa2e[_0x2eb3('0x2f')]));if(_0x5cefb0[_0x2eb3('0x2e')][_0x2eb3('0x3b')]){_0x536fda[_0x2eb3('0x39')]=_[_0x2eb3('0x3c')](_0x536fda[_0x2eb3('0x39')],{'$or':_[_0x2eb3('0x29')](_0x536fda['attributes'],function(_0x374864){var _0x4abc72={};_0x4abc72[_0x374864]={'$like':'%'+_0x5cefb0[_0x2eb3('0x2e')][_0x2eb3('0x3b')]+'%'};return _0x4abc72;})});}_0x536fda=_['merge']({},_0x536fda,_0x5cefb0[_0x2eb3('0x3e')]);return _0x16487c[_0x2eb3('0x49')](_0x536fda);}})['then'](function(_0x3dd402){if(_0x3dd402){_0x4cc7fb=_0x3dd402[_0x2eb3('0x34')];if(!_0x5cefb0[_0x2eb3('0x2e')][_0x2eb3('0x35')](_0x2eb3('0x36'))){_0x536fda[_0x2eb3('0x1e')]=qs[_0x2eb3('0x1e')](_0x5cefb0['query'][_0x2eb3('0x1e')]);_0x536fda[_0x2eb3('0x1c')]=qs[_0x2eb3('0x1c')](_0x5cefb0['query']['offset']);}return _0x16487c[_0x2eb3('0x49')](_0x536fda);}})[_0x2eb3('0x23')](function(_0x51fa16){if(_0x51fa16){return _0x51fa16?{'count':_0x4cc7fb,'rows':_0x51fa16}:null;}})['then'](respondWithResult(_0x43ff9f,null))[_0x2eb3('0x42')](handleError(_0x43ff9f,null));};exports['addConfiguration']=function(_0x2bb0eb,_0x32d27e,_0x4b6390){if(_0x2bb0eb[_0x2eb3('0x48')]['id']){delete _0x2bb0eb['body']['id'];}return db['SalesforceAccount'][_0x2eb3('0x4a')]({'where':{'id':_0x2bb0eb[_0x2eb3('0x43')]['id']}})[_0x2eb3('0x23')](handleEntityNotFound(_0x32d27e,null))[_0x2eb3('0x23')](function(_0x5e8c21){if(_0x5e8c21){_0x2bb0eb[_0x2eb3('0x48')][_0x2eb3('0x4c')]=_0x5e8c21['id'];_0x2bb0eb[_0x2eb3('0x48')][_0x2eb3('0x4d')]=integrations[_0x2eb3('0x4e')](_0x2bb0eb[_0x2eb3('0x48')][_0x2eb3('0x4f')],_0x2bb0eb['body'][_0x2eb3('0x2c')]);_0x2bb0eb['body'][_0x2eb3('0x50')]=integrations['getDescriptions'](_0x2bb0eb[_0x2eb3('0x48')][_0x2eb3('0x4f')],_0x2bb0eb['body'][_0x2eb3('0x2c')]);return db['SalesforceConfiguration']['create'](_0x2bb0eb[_0x2eb3('0x48')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x2eb3('0x51')],'as':_0x2eb3('0x50')}]});}return null;})[_0x2eb3('0x23')](respondWithResult(_0x32d27e,null))[_0x2eb3('0x42')](handleError(_0x32d27e,null));};exports['getFields']=function(_0x4f571f,_0xb6b25d,_0xd804a9){var _0x4f5ad7;var _0x261b6b='';var _0x1edcb2=_0x2eb3('0x52');return db[_0x2eb3('0x2a')][_0x2eb3('0x4a')]({'where':{'id':_0x4f571f[_0x2eb3('0x43')]['id']},'attributes':['id',_0x2eb3('0x53'),_0x2eb3('0x54'),_0x2eb3('0x55'),'username',_0x2eb3('0x56'),_0x2eb3('0x57')]})[_0x2eb3('0x23')](handleEntityNotFound(_0xb6b25d,null))[_0x2eb3('0x23')](function(_0x51feba){if(_0x51feba){_0x261b6b=_0x51feba[_0x2eb3('0x53')];var _0x1f5896=_0x261b6b[_0x2eb3('0x58')](-0x1);if(_0x1f5896==='/'){_0x261b6b=_0x261b6b['substring'](0x0,_0x261b6b[_0x2eb3('0x59')](_0x1f5896));}_0x4f5ad7=new jsforce[(_0x2eb3('0x5a'))]({'oauth2':{'loginUrl':_0x261b6b,'clientId':_0x51feba[_0x2eb3('0x54')],'clientSecret':_0x51feba[_0x2eb3('0x55')]}});return _0x4f5ad7[_0x2eb3('0x5b')](_0x51feba[_0x2eb3('0x5c')],_0x51feba[_0x2eb3('0x56')][_0x2eb3('0x5d')](_0x51feba[_0x2eb3('0x57')]));}})[_0x2eb3('0x23')](function(_0x1a9a0b){if(_0x1a9a0b){if(!_[_0x2eb3('0x5e')](_0x4f571f['query'][_0x2eb3('0x5f')])){_0x1edcb2=_0x4f571f[_0x2eb3('0x2e')]['ticketType'];}return _0x4f5ad7[_0x2eb3('0x60')](_0x1edcb2)['describe']();}})[_0x2eb3('0x23')](function(_0x56ecbc){var _0x1946ca=['OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject',_0x2eb3('0x61')];var _0x4ba8de=[_0x2eb3('0x62'),'int',_0x2eb3('0x63'),_0x2eb3('0x64'),_0x2eb3('0x65'),_0x2eb3('0x66'),_0x2eb3('0x67')];if(_0x56ecbc){_[_0x2eb3('0x68')](_0x56ecbc[_0x2eb3('0x33')],function(_0x3a3c1e){return _0x1946ca[_0x2eb3('0x69')](_0x3a3c1e[_0x2eb3('0x26')])||!_0x4ba8de['includes'](_0x3a3c1e[_0x2eb3('0x2c')]);});return{'count':_0x56ecbc[_0x2eb3('0x33')][_0x2eb3('0x34')],'rows':_[_0x2eb3('0x29')](_0x56ecbc[_0x2eb3('0x33')],function(_0x41af18){return{'id':_0x41af18[_0x2eb3('0x26')],'name':_0x41af18[_0x2eb3('0x6a')],'custom':_0x41af18[_0x2eb3('0x6b')],'options':_0x41af18['picklistValues'][_0x2eb3('0x34')]>0x0?_['map'](_0x41af18[_0x2eb3('0x6c')],function(_0x59e582){return{'name':_0x59e582['label'],'value':_0x59e582[_0x2eb3('0x6d')]};}):_0x41af18[_0x2eb3('0x2c')]=='boolean'?[{'name':_0x2eb3('0x6e'),'value':_0x2eb3('0x6f')},{'name':_0x2eb3('0x70'),'value':_0x2eb3('0x71')}]:[]};})};}})[_0x2eb3('0x23')](respondWithResult(_0xb6b25d,null))[_0x2eb3('0x42')](function(_0x4c731e){var _0x4d4dd8=_0x4f571f[_0x2eb3('0x2e')]['test']?0x1f4:_0x4c731e[_0x2eb3('0x72')]||0x1f4;logger[_0x2eb3('0x73')]('getFields,\x20%s,\x20%s,\x20%s',_0x2eb3('0x74'),_0x4d4dd8,JSON['stringify'](_0x4c731e));delete _0x4c731e[_0x2eb3('0x26')];if(_0x4d4dd8===0x191){_0x4d4dd8=0x190;}_0xb6b25d[_0x2eb3('0x19')](_0x4d4dd8)[_0x2eb3('0x27')](_0x4f571f[_0x2eb3('0x2e')][_0x2eb3('0x75')]?{'message':_0x2eb3('0x76'),'statusCode':_0x4c731e[_0x2eb3('0x72')]}:_0x4c731e);});}; \ No newline at end of file +var _0x1b36=['IsRecurrence','Subject','string','email','phone','remove','includes','label','custom','picklistValues','value','boolean','true','False','false','test','statusCode','stringify','zip-dir','request-promise','moment','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','SalesforceAccount','includeAll','findAll','catch','params','include','find','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','findOne','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x1b36,0xfc));var _0x61b3=function(_0x45a082,_0x396c1c){_0x45a082=_0x45a082-0x0;var _0x22cf7c=_0x1b36[_0x45a082];return _0x22cf7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61b3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61b3('0x1'));var moment=require(_0x61b3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x61b3('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x61b3('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61b3('0x5'));var _=require('lodash');var squel=require(_0x61b3('0x6'));var crypto=require(_0x61b3('0x7'));var jsforce=require(_0x61b3('0x8'));var deskjs=require(_0x61b3('0x9'));var toCsv=require(_0x61b3('0x4'));var querystring=require(_0x61b3('0xa'));var Papa=require('papaparse');var Redis=require(_0x61b3('0xb'));var authService=require(_0x61b3('0xc'));var qs=require(_0x61b3('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61b3('0xe'));var logger=require(_0x61b3('0xf'))(_0x61b3('0x10'));var utils=require(_0x61b3('0x11'));var config=require(_0x61b3('0x12'));var licenseUtil=require(_0x61b3('0x13'));var db=require(_0x61b3('0x14'))['db'];var integrations=require(_0x61b3('0x15'));function respondWithStatusCode(_0x2aee3f,_0x5857e1){_0x5857e1=_0x5857e1||0xcc;return function(_0x39d1cb){if(_0x39d1cb){return _0x2aee3f[_0x61b3('0x16')](_0x5857e1);}return _0x2aee3f[_0x61b3('0x17')](_0x5857e1)['end']();};}function respondWithResult(_0x1d1cef,_0x45d6f1){_0x45d6f1=_0x45d6f1||0xc8;return function(_0x5698e2){if(_0x5698e2){return _0x1d1cef[_0x61b3('0x17')](_0x45d6f1)[_0x61b3('0x18')](_0x5698e2);}};}function respondWithFilteredResult(_0x2dba96,_0x109759){return function(_0x4c7bfb){if(_0x4c7bfb){var _0x4e1eb5=typeof _0x109759['offset']===_0x61b3('0x19')&&typeof _0x109759[_0x61b3('0x1a')]===_0x61b3('0x19');var _0x477ac6=_0x4c7bfb[_0x61b3('0x1b')];var _0x5d76d9=_0x4e1eb5?0x0:_0x109759[_0x61b3('0x1c')];var _0x2e2056=_0x4e1eb5?_0x4c7bfb[_0x61b3('0x1b')]:_0x109759['offset']+_0x109759['limit'];var _0x4d91cf;if(_0x2e2056>=_0x477ac6){_0x2e2056=_0x477ac6;_0x4d91cf=0xc8;}else{_0x4d91cf=0xce;}_0x2dba96[_0x61b3('0x17')](_0x4d91cf);return _0x2dba96['set'](_0x61b3('0x1d'),_0x5d76d9+'-'+_0x2e2056+'/'+_0x477ac6)[_0x61b3('0x18')](_0x4c7bfb);}return null;};}function patchUpdates(_0x1f0023){return function(_0x39079a){try{jsonpatch[_0x61b3('0x1e')](_0x39079a,_0x1f0023,!![]);}catch(_0x1c3d76){return BPromise[_0x61b3('0x1f')](_0x1c3d76);}return _0x39079a['save']();};}function saveUpdates(_0x53c00a,_0xf97917){return function(_0x6b65b8){if(_0x6b65b8){return _0x6b65b8[_0x61b3('0x20')](_0x53c00a)[_0x61b3('0x21')](function(_0x123ded){return _0x123ded;});}return null;};}function removeEntity(_0x2a3305,_0x190334){return function(_0x31fe88){if(_0x31fe88){return _0x31fe88[_0x61b3('0x22')]()['then'](function(){_0x2a3305[_0x61b3('0x17')](0xcc)[_0x61b3('0x23')]();});}};}function handleEntityNotFound(_0x41492c,_0x5823b7){return function(_0x13e8e2){if(!_0x13e8e2){_0x41492c[_0x61b3('0x16')](0x194);}return _0x13e8e2;};}function handleError(_0x19494f,_0x2164e1){_0x2164e1=_0x2164e1||0x1f4;return function(_0x29b10a){logger[_0x61b3('0x24')](_0x29b10a['stack']);if(_0x29b10a[_0x61b3('0x25')]){delete _0x29b10a[_0x61b3('0x25')];}_0x19494f[_0x61b3('0x17')](_0x2164e1)[_0x61b3('0x26')](_0x29b10a);};}exports[_0x61b3('0x27')]=function(_0x189076,_0xb2bc32){var _0x3af444={},_0x107ab5={},_0xc82cd9={'count':0x0,'rows':[]};var _0x5546c4=_[_0x61b3('0x28')](db['SalesforceAccount'][_0x61b3('0x29')],function(_0xa6205a){return{'name':_0xa6205a[_0x61b3('0x2a')],'type':_0xa6205a[_0x61b3('0x2b')][_0x61b3('0x2c')]};});_0x107ab5[_0x61b3('0x2d')]=_[_0x61b3('0x28')](_0x5546c4,_0x61b3('0x25'));_0x107ab5[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x189076[_0x61b3('0x2e')]);_0x107ab5[_0x61b3('0x30')]=_[_0x61b3('0x31')](_0x107ab5[_0x61b3('0x2d')],_0x107ab5[_0x61b3('0x2e')]);_0x3af444[_0x61b3('0x32')]=_[_0x61b3('0x31')](_0x107ab5[_0x61b3('0x2d')],qs[_0x61b3('0x33')](_0x189076[_0x61b3('0x2e')]['fields']));_0x3af444['attributes']=_0x3af444['attributes'][_0x61b3('0x34')]?_0x3af444['attributes']:_0x107ab5[_0x61b3('0x2d')];if(!_0x189076[_0x61b3('0x2e')][_0x61b3('0x35')](_0x61b3('0x36'))){_0x3af444['limit']=qs[_0x61b3('0x1a')](_0x189076['query'][_0x61b3('0x1a')]);_0x3af444[_0x61b3('0x1c')]=qs[_0x61b3('0x1c')](_0x189076[_0x61b3('0x2e')][_0x61b3('0x1c')]);}_0x3af444[_0x61b3('0x37')]=qs[_0x61b3('0x38')](_0x189076[_0x61b3('0x2e')][_0x61b3('0x38')]);_0x3af444['where']=qs[_0x61b3('0x30')](_[_0x61b3('0x39')](_0x189076['query'],_0x107ab5[_0x61b3('0x30')]),_0x5546c4);if(_0x189076[_0x61b3('0x2e')]['filter']){_0x3af444[_0x61b3('0x3a')]=_[_0x61b3('0x3b')](_0x3af444[_0x61b3('0x3a')],{'$or':_[_0x61b3('0x28')](_0x5546c4,function(_0x577737){if(_0x577737[_0x61b3('0x2b')]!==_0x61b3('0x3c')){var _0x184d6a={};_0x184d6a[_0x577737['name']]={'$like':'%'+_0x189076[_0x61b3('0x2e')][_0x61b3('0x3d')]+'%'};return _0x184d6a;}})});}_0x3af444=_[_0x61b3('0x3b')]({},_0x3af444,_0x189076[_0x61b3('0x3e')]);var _0xa94adc={'where':_0x3af444[_0x61b3('0x3a')]};return db[_0x61b3('0x3f')][_0x61b3('0x1b')](_0xa94adc)[_0x61b3('0x21')](function(_0x299d3a){_0xc82cd9[_0x61b3('0x1b')]=_0x299d3a;if(_0x189076[_0x61b3('0x2e')][_0x61b3('0x40')]){_0x3af444['include']=[{'all':!![]}];}return db[_0x61b3('0x3f')][_0x61b3('0x41')](_0x3af444);})[_0x61b3('0x21')](function(_0x228302){_0xc82cd9['rows']=_0x228302;return _0xc82cd9;})['then'](respondWithFilteredResult(_0xb2bc32,_0x3af444))[_0x61b3('0x42')](handleError(_0xb2bc32,null));};exports['show']=function(_0x25fca4,_0xc63f7f){var _0x3c90d6={'raw':![],'where':{'id':_0x25fca4[_0x61b3('0x43')]['id']}},_0x1b3842={};_0x1b3842['model']=_[_0x61b3('0x2f')](db[_0x61b3('0x3f')][_0x61b3('0x29')]);_0x1b3842['query']=_[_0x61b3('0x2f')](_0x25fca4[_0x61b3('0x2e')]);_0x1b3842[_0x61b3('0x30')]=_[_0x61b3('0x31')](_0x1b3842[_0x61b3('0x2d')],_0x1b3842[_0x61b3('0x2e')]);_0x3c90d6[_0x61b3('0x32')]=_['intersection'](_0x1b3842[_0x61b3('0x2d')],qs[_0x61b3('0x33')](_0x25fca4[_0x61b3('0x2e')][_0x61b3('0x33')]));_0x3c90d6[_0x61b3('0x32')]=_0x3c90d6[_0x61b3('0x32')]['length']?_0x3c90d6[_0x61b3('0x32')]:_0x1b3842[_0x61b3('0x2d')];if(_0x25fca4[_0x61b3('0x2e')][_0x61b3('0x40')]){_0x3c90d6[_0x61b3('0x44')]=[{'all':!![]}];}_0x3c90d6=_['merge']({},_0x3c90d6,_0x25fca4[_0x61b3('0x3e')]);return db[_0x61b3('0x3f')][_0x61b3('0x45')](_0x3c90d6)[_0x61b3('0x21')](handleEntityNotFound(_0xc63f7f,null))[_0x61b3('0x21')](respondWithResult(_0xc63f7f,null))[_0x61b3('0x42')](handleError(_0xc63f7f,null));};exports[_0x61b3('0x46')]=function(_0x37db93,_0x38f037){return db[_0x61b3('0x3f')][_0x61b3('0x46')](_0x37db93['body'],{})[_0x61b3('0x21')](respondWithResult(_0x38f037,0xc9))[_0x61b3('0x42')](handleError(_0x38f037,null));};exports[_0x61b3('0x20')]=function(_0x5d8d8c,_0x1ea5f9){if(_0x5d8d8c[_0x61b3('0x47')]['id']){delete _0x5d8d8c[_0x61b3('0x47')]['id'];}return db[_0x61b3('0x3f')][_0x61b3('0x45')]({'where':{'id':_0x5d8d8c[_0x61b3('0x43')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x1ea5f9,null))['then'](saveUpdates(_0x5d8d8c['body'],null))[_0x61b3('0x21')](respondWithResult(_0x1ea5f9,null))[_0x61b3('0x42')](handleError(_0x1ea5f9,null));};exports['destroy']=function(_0x3710e8,_0x39e5bf){return db[_0x61b3('0x3f')][_0x61b3('0x45')]({'where':{'id':_0x3710e8[_0x61b3('0x43')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x39e5bf,null))[_0x61b3('0x21')](removeEntity(_0x39e5bf,null))['catch'](handleError(_0x39e5bf,null));};exports[_0x61b3('0x48')]=function(_0x2ebfe3,_0x929145,_0xf6c254){var _0x246b91={};var _0x3bcd4d={};var _0x12943a;var _0x3b511a;return db['SalesforceAccount']['findOne']({'where':{'id':_0x2ebfe3['params']['id']}})['then'](handleEntityNotFound(_0x929145,null))['then'](function(_0x398a42){if(_0x398a42){_0x12943a=_0x398a42;_0x3bcd4d[_0x61b3('0x2d')]=_[_0x61b3('0x2f')](db[_0x61b3('0x49')]['rawAttributes']);_0x3bcd4d[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x2ebfe3[_0x61b3('0x2e')]);_0x3bcd4d['filters']=_['intersection'](_0x3bcd4d[_0x61b3('0x2d')],_0x3bcd4d[_0x61b3('0x2e')]);_0x246b91[_0x61b3('0x32')]=_[_0x61b3('0x31')](_0x3bcd4d[_0x61b3('0x2d')],qs[_0x61b3('0x33')](_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x33')]));_0x246b91[_0x61b3('0x32')]=_0x246b91[_0x61b3('0x32')][_0x61b3('0x34')]?_0x246b91[_0x61b3('0x32')]:_0x3bcd4d[_0x61b3('0x2d')];_0x246b91['order']=qs[_0x61b3('0x38')](_0x2ebfe3[_0x61b3('0x2e')]['sort']);_0x246b91[_0x61b3('0x3a')]=qs[_0x61b3('0x30')](_[_0x61b3('0x39')](_0x2ebfe3[_0x61b3('0x2e')],_0x3bcd4d[_0x61b3('0x30')]));if(_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x3d')]){_0x246b91[_0x61b3('0x3a')]=_[_0x61b3('0x3b')](_0x246b91[_0x61b3('0x3a')],{'$or':_[_0x61b3('0x28')](_0x246b91[_0x61b3('0x32')],function(_0x599ad1){var _0x47f081={};_0x47f081[_0x599ad1]={'$like':'%'+_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x3d')]+'%'};return _0x47f081;})});}_0x246b91=_[_0x61b3('0x3b')]({},_0x246b91,_0x2ebfe3[_0x61b3('0x3e')]);return _0x12943a[_0x61b3('0x48')](_0x246b91);}})[_0x61b3('0x21')](function(_0x501452){if(_0x501452){_0x3b511a=_0x501452['length'];if(!_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x35')](_0x61b3('0x36'))){_0x246b91['limit']=qs[_0x61b3('0x1a')](_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x1a')]);_0x246b91[_0x61b3('0x1c')]=qs['offset'](_0x2ebfe3[_0x61b3('0x2e')][_0x61b3('0x1c')]);}return _0x12943a[_0x61b3('0x48')](_0x246b91);}})[_0x61b3('0x21')](function(_0x2a5363){if(_0x2a5363){return _0x2a5363?{'count':_0x3b511a,'rows':_0x2a5363}:null;}})['then'](respondWithResult(_0x929145,null))[_0x61b3('0x42')](handleError(_0x929145,null));};exports[_0x61b3('0x4a')]=function(_0x4c74cc,_0x4d5c51,_0xead944){if(_0x4c74cc[_0x61b3('0x47')]['id']){delete _0x4c74cc[_0x61b3('0x47')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x4c74cc[_0x61b3('0x43')]['id']}})[_0x61b3('0x21')](handleEntityNotFound(_0x4d5c51,null))[_0x61b3('0x21')](function(_0x24a7b0){if(_0x24a7b0){_0x4c74cc['body'][_0x61b3('0x4b')]=_0x24a7b0['id'];_0x4c74cc[_0x61b3('0x47')][_0x61b3('0x4c')]=integrations[_0x61b3('0x4d')](_0x4c74cc[_0x61b3('0x47')]['channel'],_0x4c74cc[_0x61b3('0x47')][_0x61b3('0x2b')]);_0x4c74cc[_0x61b3('0x47')]['Descriptions']=integrations['getDescriptions'](_0x4c74cc['body'][_0x61b3('0x4e')],_0x4c74cc['body'][_0x61b3('0x2b')]);return db['SalesforceConfiguration'][_0x61b3('0x46')](_0x4c74cc['body'],{'include':[{'model':db[_0x61b3('0x4f')],'as':_0x61b3('0x4c')},{'model':db[_0x61b3('0x4f')],'as':_0x61b3('0x50')}]});}return null;})[_0x61b3('0x21')](respondWithResult(_0x4d5c51,null))[_0x61b3('0x42')](handleError(_0x4d5c51,null));};exports[_0x61b3('0x51')]=function(_0x2a821b,_0x39a273,_0x75508e){var _0xcabb74;var _0x350e56='';var _0x40795d=_0x61b3('0x52');return db[_0x61b3('0x3f')][_0x61b3('0x53')]({'where':{'id':_0x2a821b[_0x61b3('0x43')]['id']},'attributes':['id',_0x61b3('0x54'),_0x61b3('0x55'),_0x61b3('0x56'),_0x61b3('0x57'),_0x61b3('0x58'),_0x61b3('0x59')]})[_0x61b3('0x21')](handleEntityNotFound(_0x39a273,null))['then'](function(_0x9ac050){if(_0x9ac050){_0x350e56=_0x9ac050['remoteUri'];var _0x17c071=_0x350e56[_0x61b3('0x5a')](-0x1);if(_0x17c071==='/'){_0x350e56=_0x350e56[_0x61b3('0x5b')](0x0,_0x350e56['lastIndexOf'](_0x17c071));}_0xcabb74=new jsforce[(_0x61b3('0x5c'))]({'oauth2':{'loginUrl':_0x350e56,'clientId':_0x9ac050[_0x61b3('0x55')],'clientSecret':_0x9ac050['clientSecret']}});return _0xcabb74['login'](_0x9ac050[_0x61b3('0x57')],_0x9ac050[_0x61b3('0x58')]['concat'](_0x9ac050[_0x61b3('0x59')]));}})[_0x61b3('0x21')](function(_0x4d2b46){if(_0x4d2b46){if(!_[_0x61b3('0x5d')](_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x5e')])){_0x40795d=_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x5e')];}return _0xcabb74[_0x61b3('0x5f')](_0x40795d)[_0x61b3('0x60')]();}})[_0x61b3('0x21')](function(_0x1fdadc){var _0x45975b=['OwnerId',_0x61b3('0x61'),_0x61b3('0x62'),_0x61b3('0x63'),_0x61b3('0x64'),'Description'];var _0x4f8290=[_0x61b3('0x65'),'int','picklist','boolean',_0x61b3('0x66'),'textarea',_0x61b3('0x67')];if(_0x1fdadc){_[_0x61b3('0x68')](_0x1fdadc[_0x61b3('0x33')],function(_0xd478fa){return _0x45975b[_0x61b3('0x69')](_0xd478fa['name'])||!_0x4f8290[_0x61b3('0x69')](_0xd478fa[_0x61b3('0x2b')]);});return{'count':_0x1fdadc['fields']['length'],'rows':_[_0x61b3('0x28')](_0x1fdadc[_0x61b3('0x33')],function(_0x18d1b6){return{'id':_0x18d1b6[_0x61b3('0x25')],'name':_0x18d1b6[_0x61b3('0x6a')],'custom':_0x18d1b6[_0x61b3('0x6b')],'options':_0x18d1b6[_0x61b3('0x6c')][_0x61b3('0x34')]>0x0?_[_0x61b3('0x28')](_0x18d1b6['picklistValues'],function(_0x488865){return{'name':_0x488865[_0x61b3('0x6a')],'value':_0x488865[_0x61b3('0x6d')]};}):_0x18d1b6[_0x61b3('0x2b')]==_0x61b3('0x6e')?[{'name':'True','value':_0x61b3('0x6f')},{'name':_0x61b3('0x70'),'value':_0x61b3('0x71')}]:[]};})};}})[_0x61b3('0x21')](respondWithResult(_0x39a273,null))[_0x61b3('0x42')](function(_0x5a58e6){var _0x34d36b=_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x72')]?0x1f4:_0x5a58e6[_0x61b3('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x61b3('0x51'),_0x34d36b,JSON[_0x61b3('0x74')](_0x5a58e6));delete _0x5a58e6[_0x61b3('0x25')];if(_0x34d36b===0x191){_0x34d36b=0x190;}_0x39a273[_0x61b3('0x17')](_0x34d36b)[_0x61b3('0x26')](_0x2a821b[_0x61b3('0x2e')][_0x61b3('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x5a58e6[_0x61b3('0x73')]}:_0x5a58e6);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6b50aff..f33d5c6 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 _0x465a=['exports','define','SalesforceAccount','int_salesforce_accounts','util','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x29d461,_0x237ccb){var _0x5bbe24=function(_0x25a93b){while(--_0x25a93b){_0x29d461['push'](_0x29d461['shift']());}};_0x5bbe24(++_0x237ccb);}(_0x465a,0x1d8));var _0xa465=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x465a[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xa465('0x0'));var logger=require('../../config/logger')(_0xa465('0x1'));var moment=require(_0xa465('0x2'));var BPromise=require(_0xa465('0x3'));var rp=require(_0xa465('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa465('0x5'));var attributes=require(_0xa465('0x6'));var integrations=require(_0xa465('0x7'));module[_0xa465('0x8')]=function(_0x616511,_0x576953){return _0x616511[_0xa465('0x9')](_0xa465('0xa'),attributes,{'tableName':_0xa465('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2504=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts'];(function(_0x481457,_0x1c3300){var _0xc73cb8=function(_0x3cd329){while(--_0x3cd329){_0x481457['push'](_0x481457['shift']());}};_0xc73cb8(++_0x1c3300);}(_0x2504,0xee));var _0x4250=function(_0x47649a,_0x36744a){_0x47649a=_0x47649a-0x0;var _0x1ddb5a=_0x2504[_0x47649a];return _0x1ddb5a;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var logger=require(_0x4250('0x2'))(_0x4250('0x3'));var moment=require(_0x4250('0x4'));var BPromise=require(_0x4250('0x5'));var rp=require(_0x4250('0x6'));var fs=require('fs');var path=require(_0x4250('0x7'));var rimraf=require(_0x4250('0x8'));var config=require(_0x4250('0x9'));var attributes=require(_0x4250('0xa'));var integrations=require(_0x4250('0xb'));module['exports']=function(_0x473cb8,_0x4e177e){return _0x473cb8['define'](_0x4250('0xc'),attributes,{'tableName':_0x4250('0xd'),'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 60ba906..cd1d8fa 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 _0x103f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','SalesforceAccount','options','raw','attributes','limit','map','include','model','debug','stringify','ShowSalesforceAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4adddd,_0x5475ed){var _0x430922=function(_0x2c6124){while(--_0x2c6124){_0x4adddd['push'](_0x4adddd['shift']());}};_0x430922(++_0x5475ed);}(_0x103f,0x13e));var _0xf103=function(_0x4d4df4,_0x2ee62a){_0x4d4df4=_0x4d4df4-0x0;var _0x4aa744=_0x103f[_0x4d4df4];return _0x4aa744;};'use strict';var _=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var moment=require(_0xf103('0x2'));var BPromise=require(_0xf103('0x3'));var rs=require(_0xf103('0x4'));var fs=require('fs');var Redis=require(_0xf103('0x5'));var db=require(_0xf103('0x6'))['db'];var utils=require(_0xf103('0x7'));var logger=require(_0xf103('0x8'))(_0xf103('0x9'));var config=require('../../config/environment');var jayson=require(_0xf103('0xa'));var client=jayson[_0xf103('0xb')][_0xf103('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x211dbc,_0x36d86b,_0x3cfbd1){return new BPromise(function(_0x37e92b,_0x3c9eac){return client[_0xf103('0xd')](_0x211dbc,_0x3cfbd1)[_0xf103('0xe')](function(_0x2e0f75){logger[_0xf103('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x36d86b,_0xf103('0x10'));logger['debug'](_0xf103('0x11'),_0x36d86b,'request\x20sent',JSON['stringify'](_0x2e0f75));if(_0x2e0f75[_0xf103('0x12')]){if(_0x2e0f75[_0xf103('0x12')]['code']===0x1f4){logger[_0xf103('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x36d86b,_0x2e0f75['error']['message']);return _0x3c9eac(_0x2e0f75[_0xf103('0x12')]['message']);}logger[_0xf103('0x12')](_0xf103('0x13'),_0x36d86b,_0x2e0f75['error'][_0xf103('0x14')]);return _0x37e92b(_0x2e0f75[_0xf103('0x12')]['message']);}else{logger[_0xf103('0xf')](_0xf103('0x13'),_0x36d86b,'request\x20sent');_0x37e92b(_0x2e0f75[_0xf103('0x15')]['message']);}})['catch'](function(_0x1900fc){logger[_0xf103('0x12')](_0xf103('0x13'),_0x36d86b,_0x1900fc);_0x3c9eac(_0x1900fc);});});}exports[_0xf103('0x16')]=function(_0x1659fa){var _0x2fbf42=this;return new Promise(function(_0x5a2e85,_0x9946b1){return db[_0xf103('0x17')]['findAll']({'raw':_0x1659fa[_0xf103('0x18')]?_0x1659fa[_0xf103('0x18')][_0xf103('0x19')]===undefined?!![]:![]:!![],'where':_0x1659fa[_0xf103('0x18')]?_0x1659fa[_0xf103('0x18')]['where']||null:null,'attributes':_0x1659fa[_0xf103('0x18')]?_0x1659fa[_0xf103('0x18')][_0xf103('0x1a')]||null:null,'limit':_0x1659fa[_0xf103('0x18')]?_0x1659fa[_0xf103('0x18')][_0xf103('0x1b')]||null:null,'include':_0x1659fa[_0xf103('0x18')]?_0x1659fa[_0xf103('0x18')]['include']?_[_0xf103('0x1c')](_0x1659fa['options'][_0xf103('0x1d')],function(_0x4d1752){return{'model':db[_0x4d1752[_0xf103('0x1e')]],'as':_0x4d1752['as'],'attributes':_0x4d1752[_0xf103('0x1a')],'include':_0x4d1752[_0xf103('0x1d')]?_[_0xf103('0x1c')](_0x4d1752[_0xf103('0x1d')],function(_0x297198){return{'model':db[_0x297198[_0xf103('0x1e')]],'as':_0x297198['as'],'attributes':_0x297198[_0xf103('0x1a')],'include':_0x297198['include']?_[_0xf103('0x1c')](_0x297198['include'],function(_0x259fdc){return{'model':db[_0x259fdc['model']],'as':_0x259fdc['as'],'attributes':_0x259fdc[_0xf103('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf103('0xe')](function(_0x3a807f){logger[_0xf103('0xf')]('GetSalesforceAccount',_0x1659fa);logger[_0xf103('0x1f')](_0xf103('0x16'),_0x1659fa,JSON[_0xf103('0x20')](_0x3a807f));_0x5a2e85(_0x3a807f);})['catch'](function(_0x4adf44){logger[_0xf103('0x12')](_0xf103('0x16'),_0x4adf44['message'],_0x1659fa);_0x9946b1(_0x2fbf42[_0xf103('0x12')](0x1f4,_0x4adf44[_0xf103('0x14')]));});});};exports[_0xf103('0x21')]=function(_0x65b43d){var _0x5becbe=this;return new Promise(function(_0x57d393,_0x5887cb){return db['SalesforceAccount'][_0xf103('0x22')]({'raw':_0x65b43d['options']?_0x65b43d[_0xf103('0x18')][_0xf103('0x19')]===undefined?!![]:![]:!![],'where':_0x65b43d[_0xf103('0x18')]?_0x65b43d['options']['where']||null:null,'attributes':_0x65b43d[_0xf103('0x18')]?_0x65b43d[_0xf103('0x18')]['attributes']||null:null,'include':_0x65b43d[_0xf103('0x18')]?_0x65b43d[_0xf103('0x18')][_0xf103('0x1d')]?_[_0xf103('0x1c')](_0x65b43d[_0xf103('0x18')][_0xf103('0x1d')],function(_0x28ab18){return{'model':db[_0x28ab18[_0xf103('0x1e')]],'as':_0x28ab18['as'],'attributes':_0x28ab18[_0xf103('0x1a')],'include':_0x28ab18[_0xf103('0x1d')]?_[_0xf103('0x1c')](_0x28ab18[_0xf103('0x1d')],function(_0x1db3e8){return{'model':db[_0x1db3e8[_0xf103('0x1e')]],'as':_0x1db3e8['as'],'attributes':_0x1db3e8[_0xf103('0x1a')],'include':_0x1db3e8[_0xf103('0x1d')]?_[_0xf103('0x1c')](_0x1db3e8['include'],function(_0x315309){return{'model':db[_0x315309[_0xf103('0x1e')]],'as':_0x315309['as'],'attributes':_0x315309[_0xf103('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39101d){logger['info']('ShowSalesforceAccount',_0x65b43d);logger[_0xf103('0x1f')](_0xf103('0x21'),_0x65b43d,JSON[_0xf103('0x20')](_0x39101d));_0x57d393(_0x39101d);})[_0xf103('0x23')](function(_0x192a0d){logger[_0xf103('0x12')](_0xf103('0x21'),_0x192a0d[_0xf103('0x14')],_0x65b43d);_0x5887cb(_0x5becbe[_0xf103('0x12')](0x1f4,_0x192a0d['message']));});});}; \ No newline at end of file +var _0x2743=['include','map','model','attributes','catch','ShowSalesforceAccount','SalesforceAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','GetSalesforceAccount','findAll','options','limit'];(function(_0x42e103,_0x6498f3){var _0x2a6eba=function(_0x1683ed){while(--_0x1683ed){_0x42e103['push'](_0x42e103['shift']());}};_0x2a6eba(++_0x6498f3);}(_0x2743,0x13b));var _0x3274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3274('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3274('0x1'));var rs=require(_0x3274('0x2'));var fs=require('fs');var Redis=require(_0x3274('0x3'));var db=require(_0x3274('0x4'))['db'];var utils=require(_0x3274('0x5'));var logger=require('../../config/logger')(_0x3274('0x6'));var config=require(_0x3274('0x7'));var jayson=require(_0x3274('0x8'));var client=jayson[_0x3274('0x9')][_0x3274('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40557c,_0x4221fd,_0x3236cc){return new BPromise(function(_0x5cf004,_0x2afedd){return client['request'](_0x40557c,_0x3236cc)[_0x3274('0xb')](function(_0x6dc464){logger[_0x3274('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x4221fd,_0x3274('0xd'));logger[_0x3274('0xe')](_0x3274('0xf'),_0x4221fd,_0x3274('0xd'),JSON[_0x3274('0x10')](_0x6dc464));if(_0x6dc464[_0x3274('0x11')]){if(_0x6dc464[_0x3274('0x11')][_0x3274('0x12')]===0x1f4){logger[_0x3274('0x11')](_0x3274('0x13'),_0x4221fd,_0x6dc464[_0x3274('0x11')]['message']);return _0x2afedd(_0x6dc464[_0x3274('0x11')][_0x3274('0x14')]);}logger[_0x3274('0x11')](_0x3274('0x13'),_0x4221fd,_0x6dc464[_0x3274('0x11')]['message']);return _0x5cf004(_0x6dc464['error'][_0x3274('0x14')]);}else{logger[_0x3274('0xc')](_0x3274('0x13'),_0x4221fd,_0x3274('0xd'));_0x5cf004(_0x6dc464['result'][_0x3274('0x14')]);}})['catch'](function(_0x1a1f95){logger[_0x3274('0x11')](_0x3274('0x13'),_0x4221fd,_0x1a1f95);_0x2afedd(_0x1a1f95);});});}exports[_0x3274('0x15')]=function(_0x579b36){var _0x3a2571=this;return new Promise(function(_0x52a5b8,_0x94314a){return db['SalesforceAccount'][_0x3274('0x16')]({'raw':_0x579b36['options']?_0x579b36[_0x3274('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x579b36[_0x3274('0x17')]?_0x579b36[_0x3274('0x17')]['where']||null:null,'attributes':_0x579b36[_0x3274('0x17')]?_0x579b36[_0x3274('0x17')]['attributes']||null:null,'limit':_0x579b36[_0x3274('0x17')]?_0x579b36[_0x3274('0x17')][_0x3274('0x18')]||null:null,'include':_0x579b36['options']?_0x579b36['options'][_0x3274('0x19')]?_[_0x3274('0x1a')](_0x579b36[_0x3274('0x17')][_0x3274('0x19')],function(_0x5bd69f){return{'model':db[_0x5bd69f[_0x3274('0x1b')]],'as':_0x5bd69f['as'],'attributes':_0x5bd69f[_0x3274('0x1c')],'include':_0x5bd69f[_0x3274('0x19')]?_[_0x3274('0x1a')](_0x5bd69f[_0x3274('0x19')],function(_0x4e5399){return{'model':db[_0x4e5399[_0x3274('0x1b')]],'as':_0x4e5399['as'],'attributes':_0x4e5399[_0x3274('0x1c')],'include':_0x4e5399[_0x3274('0x19')]?_[_0x3274('0x1a')](_0x4e5399[_0x3274('0x19')],function(_0x3dd53a){return{'model':db[_0x3dd53a['model']],'as':_0x3dd53a['as'],'attributes':_0x3dd53a[_0x3274('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1722af){logger[_0x3274('0xc')]('GetSalesforceAccount',_0x579b36);logger[_0x3274('0xe')](_0x3274('0x15'),_0x579b36,JSON[_0x3274('0x10')](_0x1722af));_0x52a5b8(_0x1722af);})[_0x3274('0x1d')](function(_0x44c305){logger[_0x3274('0x11')]('GetSalesforceAccount',_0x44c305[_0x3274('0x14')],_0x579b36);_0x94314a(_0x3a2571[_0x3274('0x11')](0x1f4,_0x44c305[_0x3274('0x14')]));});});};exports[_0x3274('0x1e')]=function(_0x184f6d){var _0x4b1e4b=this;return new Promise(function(_0x266a28,_0x2890d2){return db[_0x3274('0x1f')][_0x3274('0x20')]({'raw':_0x184f6d[_0x3274('0x17')]?_0x184f6d[_0x3274('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x184f6d[_0x3274('0x17')]?_0x184f6d[_0x3274('0x17')][_0x3274('0x21')]||null:null,'attributes':_0x184f6d[_0x3274('0x17')]?_0x184f6d[_0x3274('0x17')][_0x3274('0x1c')]||null:null,'include':_0x184f6d['options']?_0x184f6d[_0x3274('0x17')][_0x3274('0x19')]?_[_0x3274('0x1a')](_0x184f6d[_0x3274('0x17')]['include'],function(_0x5c1e90){return{'model':db[_0x5c1e90[_0x3274('0x1b')]],'as':_0x5c1e90['as'],'attributes':_0x5c1e90[_0x3274('0x1c')],'include':_0x5c1e90[_0x3274('0x19')]?_['map'](_0x5c1e90[_0x3274('0x19')],function(_0x510ffd){return{'model':db[_0x510ffd[_0x3274('0x1b')]],'as':_0x510ffd['as'],'attributes':_0x510ffd[_0x3274('0x1c')],'include':_0x510ffd['include']?_[_0x3274('0x1a')](_0x510ffd[_0x3274('0x19')],function(_0x2354e9){return{'model':db[_0x2354e9[_0x3274('0x1b')]],'as':_0x2354e9['as'],'attributes':_0x2354e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x3274('0xb')](function(_0x400381){logger['info'](_0x3274('0x1e'),_0x184f6d);logger[_0x3274('0xe')](_0x3274('0x1e'),_0x184f6d,JSON[_0x3274('0x10')](_0x400381));_0x266a28(_0x400381);})[_0x3274('0x1d')](function(_0x5ca2fa){logger[_0x3274('0x11')](_0x3274('0x1e'),_0x5ca2fa['message'],_0x184f6d);_0x2890d2(_0x4b1e4b['error'](0x1f4,_0x5ca2fa['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 75ed33f..f648d26 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(_0x230c81,_0x4488b3){var _0x585905=function(_0x389253){while(--_0x389253){_0x230c81['push'](_0x230c81['shift']());}};_0x585905(++_0x4488b3);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa61745,_0x5ddfe5){_0xa61745=_0xa61745-0x0;var _0x3aee5b=_0x5f2f[_0xa61745];return _0x3aee5b;};'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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x524a0f,_0x1f812d){var _0x1da965=function(_0x362356){while(--_0x362356){_0x524a0f['push'](_0x524a0f['shift']());}};_0x1da965(++_0x1f812d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'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('./intSalesforceConfiguration.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['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f61e7fc..8f3096e 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 _0xe0c7=['account','nothing','contact','STRING','ENUM','Case','Task','contact_lead','lead','account_contact_lead'];(function(_0xf7ac3a,_0x2818d2){var _0xa0b8ec=function(_0x4e2448){while(--_0x4e2448){_0xf7ac3a['push'](_0xf7ac3a['shift']());}};_0xa0b8ec(++_0x2818d2);}(_0xe0c7,0x189));var _0x7e0c=function(_0x1f97c5,_0x41588a){_0x1f97c5=_0x1f97c5-0x0;var _0x52978=_0xe0c7[_0x1f97c5];return _0x52978;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7e0c('0x0')]},'ticketType':{'type':Sequelize[_0x7e0c('0x1')]('Task',_0x7e0c('0x2')),'defaultValue':_0x7e0c('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x7e0c('0x4'),'contact',_0x7e0c('0x5'),_0x7e0c('0x6'),_0x7e0c('0x7')),'defaultValue':_0x7e0c('0x4')},'moduleCreate':{'type':Sequelize[_0x7e0c('0x1')](_0x7e0c('0x8'),_0x7e0c('0x9'),_0x7e0c('0x5'),'account'),'defaultValue':_0x7e0c('0x5')},'leadId':{'type':Sequelize[_0x7e0c('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x7e0c('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x7e0c('0x0')]},'additionalSearchLead':{'type':Sequelize[_0x7e0c('0x0')]}}; \ No newline at end of file +var _0x57c0=['lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x57c0,0xa0));var _0x057c=function(_0x2c4570,_0x21871d){_0x2c4570=_0x2c4570-0x0;var _0x26f4b0=_0x57c0[_0x2c4570];return _0x26f4b0;};'use strict';var Sequelize=require(_0x057c('0x0'));module[_0x057c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x057c('0x2')]},'ticketType':{'type':Sequelize[_0x057c('0x3')](_0x057c('0x4'),_0x057c('0x5')),'defaultValue':_0x057c('0x4')},'moduleSearch':{'type':Sequelize[_0x057c('0x3')](_0x057c('0x6'),_0x057c('0x7'),_0x057c('0x8'),_0x057c('0x9'),_0x057c('0xa')),'defaultValue':_0x057c('0x6')},'moduleCreate':{'type':Sequelize[_0x057c('0x3')](_0x057c('0xb'),_0x057c('0x7'),_0x057c('0x8'),_0x057c('0xa')),'defaultValue':_0x057c('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x057c('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x057c('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index ab508f4..98fd799 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 _0x7113=['map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','body','update','find','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','then','destroy','end','error','stack','name','send','index'];(function(_0x52af0b,_0x580c97){var _0x40ed35=function(_0x545038){while(--_0x545038){_0x52af0b['push'](_0x52af0b['shift']());}};_0x40ed35(++_0x580c97);}(_0x7113,0xc4));var _0x3711=function(_0x324d9f,_0x6b19e5){_0x324d9f=_0x324d9f-0x0;var _0x489dd8=_0x7113[_0x324d9f];return _0x489dd8;};'use strict';var emlformat=require(_0x3711('0x0'));var rimraf=require(_0x3711('0x1'));var zipdir=require(_0x3711('0x2'));var jsonpatch=require(_0x3711('0x3'));var rp=require(_0x3711('0x4'));var moment=require('moment');var BPromise=require(_0x3711('0x5'));var Mustache=require(_0x3711('0x6'));var util=require(_0x3711('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3711('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3711('0x9'));var squel=require('squel');var crypto=require(_0x3711('0xa'));var jsforce=require(_0x3711('0xb'));var deskjs=require(_0x3711('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3711('0xd'));var Papa=require(_0x3711('0xe'));var Redis=require(_0x3711('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3711('0x10'));var as=require(_0x3711('0x11'));var hardwareService=require(_0x3711('0x12'));var logger=require(_0x3711('0x13'))(_0x3711('0x14'));var utils=require('../../config/utils');var config=require(_0x3711('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3711('0x16'))['db'];function respondWithStatusCode(_0x9d49da,_0x522052){_0x522052=_0x522052||0xcc;return function(_0x31d71a){if(_0x31d71a){return _0x9d49da[_0x3711('0x17')](_0x522052);}return _0x9d49da[_0x3711('0x18')](_0x522052)['end']();};}function respondWithResult(_0x3cf651,_0x2055a7){_0x2055a7=_0x2055a7||0xc8;return function(_0x32c0f7){if(_0x32c0f7){return _0x3cf651[_0x3711('0x18')](_0x2055a7)[_0x3711('0x19')](_0x32c0f7);}};}function respondWithFilteredResult(_0x2b88b4,_0x5d7cfc){return function(_0x530ffd){if(_0x530ffd){var _0x9d9d0a=typeof _0x5d7cfc[_0x3711('0x1a')]===_0x3711('0x1b')&&typeof _0x5d7cfc['limit']==='undefined';var _0x6d9603=_0x530ffd[_0x3711('0x1c')];var _0x119944=_0x9d9d0a?0x0:_0x5d7cfc[_0x3711('0x1a')];var _0xb8e7c2=_0x9d9d0a?_0x530ffd[_0x3711('0x1c')]:_0x5d7cfc[_0x3711('0x1a')]+_0x5d7cfc[_0x3711('0x1d')];var _0x4463a1;if(_0xb8e7c2>=_0x6d9603){_0xb8e7c2=_0x6d9603;_0x4463a1=0xc8;}else{_0x4463a1=0xce;}_0x2b88b4[_0x3711('0x18')](_0x4463a1);return _0x2b88b4[_0x3711('0x1e')]('Content-Range',_0x119944+'-'+_0xb8e7c2+'/'+_0x6d9603)[_0x3711('0x19')](_0x530ffd);}return null;};}function patchUpdates(_0x30cc28){return function(_0x40bc2a){try{jsonpatch[_0x3711('0x1f')](_0x40bc2a,_0x30cc28,!![]);}catch(_0x2e4468){return BPromise['reject'](_0x2e4468);}return _0x40bc2a[_0x3711('0x20')]();};}function saveUpdates(_0x287247,_0x6fd86a){return function(_0x39c37b){if(_0x39c37b){return _0x39c37b['update'](_0x287247)[_0x3711('0x21')](function(_0x3c7796){return _0x3c7796;});}return null;};}function removeEntity(_0x2c4676,_0x42fe62){return function(_0x442d50){if(_0x442d50){return _0x442d50[_0x3711('0x22')]()[_0x3711('0x21')](function(){_0x2c4676[_0x3711('0x18')](0xcc)[_0x3711('0x23')]();});}};}function handleEntityNotFound(_0x186fc1,_0x76880b){return function(_0x4abba3){if(!_0x4abba3){_0x186fc1[_0x3711('0x17')](0x194);}return _0x4abba3;};}function handleError(_0x4f40ee,_0x34af2c){_0x34af2c=_0x34af2c||0x1f4;return function(_0x3fb0d7){logger[_0x3711('0x24')](_0x3fb0d7[_0x3711('0x25')]);if(_0x3fb0d7[_0x3711('0x26')]){delete _0x3fb0d7[_0x3711('0x26')];}_0x4f40ee[_0x3711('0x18')](_0x34af2c)[_0x3711('0x27')](_0x3fb0d7);};}exports[_0x3711('0x28')]=function(_0x4a8503,_0x4ed3e7){var _0x5e7059={},_0xcd3c6a={},_0x41f956={'count':0x0,'rows':[]};var _0x19ee88=_[_0x3711('0x29')](db[_0x3711('0x2a')][_0x3711('0x2b')],function(_0x824aa8){return{'name':_0x824aa8[_0x3711('0x2c')],'type':_0x824aa8[_0x3711('0x2d')][_0x3711('0x2e')]};});_0xcd3c6a[_0x3711('0x2f')]=_[_0x3711('0x29')](_0x19ee88,_0x3711('0x26'));_0xcd3c6a['query']=_[_0x3711('0x30')](_0x4a8503[_0x3711('0x31')]);_0xcd3c6a[_0x3711('0x32')]=_[_0x3711('0x33')](_0xcd3c6a[_0x3711('0x2f')],_0xcd3c6a[_0x3711('0x31')]);_0x5e7059[_0x3711('0x34')]=_[_0x3711('0x33')](_0xcd3c6a['model'],qs[_0x3711('0x35')](_0x4a8503[_0x3711('0x31')][_0x3711('0x35')]));_0x5e7059[_0x3711('0x34')]=_0x5e7059[_0x3711('0x34')][_0x3711('0x36')]?_0x5e7059[_0x3711('0x34')]:_0xcd3c6a[_0x3711('0x2f')];if(!_0x4a8503['query'][_0x3711('0x37')](_0x3711('0x38'))){_0x5e7059['limit']=qs['limit'](_0x4a8503[_0x3711('0x31')]['limit']);_0x5e7059[_0x3711('0x1a')]=qs['offset'](_0x4a8503[_0x3711('0x31')][_0x3711('0x1a')]);}_0x5e7059[_0x3711('0x39')]=qs[_0x3711('0x3a')](_0x4a8503[_0x3711('0x31')][_0x3711('0x3a')]);_0x5e7059[_0x3711('0x3b')]=qs['filters'](_[_0x3711('0x3c')](_0x4a8503['query'],_0xcd3c6a[_0x3711('0x32')]),_0x19ee88);if(_0x4a8503[_0x3711('0x31')][_0x3711('0x3d')]){_0x5e7059[_0x3711('0x3b')]=_[_0x3711('0x3e')](_0x5e7059[_0x3711('0x3b')],{'$or':_[_0x3711('0x29')](_0x19ee88,function(_0x4e5fbe){if(_0x4e5fbe[_0x3711('0x2d')]!=='VIRTUAL'){var _0x4a935c={};_0x4a935c[_0x4e5fbe[_0x3711('0x26')]]={'$like':'%'+_0x4a8503['query'][_0x3711('0x3d')]+'%'};return _0x4a935c;}})});}_0x5e7059=_['merge']({},_0x5e7059,_0x4a8503[_0x3711('0x3f')]);var _0x1192e8={'where':_0x5e7059[_0x3711('0x3b')]};return db[_0x3711('0x2a')][_0x3711('0x1c')](_0x1192e8)['then'](function(_0xb1b7ed){_0x41f956[_0x3711('0x1c')]=_0xb1b7ed;if(_0x4a8503[_0x3711('0x31')][_0x3711('0x40')]){_0x5e7059['include']=[{'all':!![]}];}return db[_0x3711('0x2a')][_0x3711('0x41')](_0x5e7059);})[_0x3711('0x21')](function(_0x6b89ed){_0x41f956[_0x3711('0x42')]=_0x6b89ed;return _0x41f956;})['then'](respondWithFilteredResult(_0x4ed3e7,_0x5e7059))[_0x3711('0x43')](handleError(_0x4ed3e7,null));};exports[_0x3711('0x44')]=function(_0x86cb32,_0x2e3976){var _0xcf5820={'raw':![],'where':{'id':_0x86cb32['params']['id']}},_0x14a9b5={};_0x14a9b5[_0x3711('0x2f')]=_[_0x3711('0x30')](db[_0x3711('0x2a')][_0x3711('0x2b')]);_0x14a9b5[_0x3711('0x31')]=_[_0x3711('0x30')](_0x86cb32[_0x3711('0x31')]);_0x14a9b5[_0x3711('0x32')]=_[_0x3711('0x33')](_0x14a9b5['model'],_0x14a9b5[_0x3711('0x31')]);_0xcf5820['attributes']=_[_0x3711('0x33')](_0x14a9b5['model'],qs['fields'](_0x86cb32['query'][_0x3711('0x35')]));_0xcf5820[_0x3711('0x34')]=_0xcf5820[_0x3711('0x34')][_0x3711('0x36')]?_0xcf5820[_0x3711('0x34')]:_0x14a9b5[_0x3711('0x2f')];if(_0x86cb32[_0x3711('0x31')]['includeAll']){_0xcf5820[_0x3711('0x45')]=[{'all':!![]}];}_0xcf5820=_[_0x3711('0x3e')]({},_0xcf5820,_0x86cb32[_0x3711('0x3f')]);return db[_0x3711('0x2a')]['find'](_0xcf5820)[_0x3711('0x21')](handleEntityNotFound(_0x2e3976,null))['then'](respondWithResult(_0x2e3976,null))[_0x3711('0x43')](handleError(_0x2e3976,null));};exports['create']=function(_0x2e2b14,_0x3171fe){return db[_0x3711('0x2a')]['create'](_0x2e2b14[_0x3711('0x46')],{})[_0x3711('0x21')](respondWithResult(_0x3171fe,0xc9))[_0x3711('0x43')](handleError(_0x3171fe,null));};exports[_0x3711('0x47')]=function(_0x1f041a,_0x2c5981){if(_0x1f041a[_0x3711('0x46')]['id']){delete _0x1f041a[_0x3711('0x46')]['id'];}return db[_0x3711('0x2a')][_0x3711('0x48')]({'where':{'id':_0x1f041a[_0x3711('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c5981,null))['then'](saveUpdates(_0x1f041a[_0x3711('0x46')],null))[_0x3711('0x21')](respondWithResult(_0x2c5981,null))[_0x3711('0x43')](handleError(_0x2c5981,null));};exports['destroy']=function(_0xc3ed8d,_0xcf4484){return db[_0x3711('0x2a')][_0x3711('0x48')]({'where':{'id':_0xc3ed8d[_0x3711('0x49')]['id']}})['then'](handleEntityNotFound(_0xcf4484,null))[_0x3711('0x21')](removeEntity(_0xcf4484,null))[_0x3711('0x43')](handleError(_0xcf4484,null));};exports[_0x3711('0x4a')]=function(_0xfd23ad,_0x46d794,_0x223d75){var _0x2ed95c={};var _0x4b71e1={};var _0x39cc0c;var _0x2bd5d4;return db[_0x3711('0x2a')][_0x3711('0x4b')]({'where':{'id':_0xfd23ad[_0x3711('0x49')]['id']}})['then'](handleEntityNotFound(_0x46d794,null))[_0x3711('0x21')](function(_0x54c737){if(_0x54c737){_0x39cc0c=_0x54c737;_0x4b71e1['model']=_[_0x3711('0x30')](db[_0x3711('0x4c')][_0x3711('0x2b')]);_0x4b71e1['query']=_[_0x3711('0x30')](_0xfd23ad[_0x3711('0x31')]);_0x4b71e1[_0x3711('0x32')]=_[_0x3711('0x33')](_0x4b71e1['model'],_0x4b71e1[_0x3711('0x31')]);_0x2ed95c[_0x3711('0x34')]=_[_0x3711('0x33')](_0x4b71e1[_0x3711('0x2f')],qs[_0x3711('0x35')](_0xfd23ad[_0x3711('0x31')]['fields']));_0x2ed95c['attributes']=_0x2ed95c[_0x3711('0x34')][_0x3711('0x36')]?_0x2ed95c[_0x3711('0x34')]:_0x4b71e1[_0x3711('0x2f')];_0x2ed95c[_0x3711('0x39')]=qs[_0x3711('0x3a')](_0xfd23ad['query'][_0x3711('0x3a')]);_0x2ed95c['where']=qs[_0x3711('0x32')](_['pick'](_0xfd23ad[_0x3711('0x31')],_0x4b71e1[_0x3711('0x32')]));if(_0xfd23ad[_0x3711('0x31')][_0x3711('0x3d')]){_0x2ed95c['where']=_[_0x3711('0x3e')](_0x2ed95c[_0x3711('0x3b')],{'$or':_[_0x3711('0x29')](_0x2ed95c['attributes'],function(_0x3ace49){var _0x2b6263={};_0x2b6263[_0x3ace49]={'$like':'%'+_0xfd23ad['query'][_0x3711('0x3d')]+'%'};return _0x2b6263;})});}_0x2ed95c=_['merge']({},_0x2ed95c,_0xfd23ad['options']);return _0x39cc0c[_0x3711('0x4a')](_0x2ed95c);}})[_0x3711('0x21')](function(_0x48f138){if(_0x48f138){_0x2bd5d4=_0x48f138[_0x3711('0x36')];if(!_0xfd23ad[_0x3711('0x31')][_0x3711('0x37')](_0x3711('0x38'))){_0x2ed95c[_0x3711('0x1d')]=qs[_0x3711('0x1d')](_0xfd23ad[_0x3711('0x31')][_0x3711('0x1d')]);_0x2ed95c['offset']=qs['offset'](_0xfd23ad[_0x3711('0x31')][_0x3711('0x1a')]);}return _0x39cc0c['getFields'](_0x2ed95c);}})['then'](function(_0x520210){if(_0x520210){return _0x520210?{'count':_0x2bd5d4,'rows':_0x520210}:null;}})[_0x3711('0x21')](respondWithResult(_0x46d794,null))[_0x3711('0x43')](handleError(_0x46d794,null));};exports['getSubjects']=function(_0x57b70b,_0x450e01,_0x3dc755){var _0xd4eac1={};var _0x4f3202={};var _0x575daf;var _0x15e794;return db[_0x3711('0x2a')][_0x3711('0x4b')]({'where':{'id':_0x57b70b[_0x3711('0x49')]['id']}})[_0x3711('0x21')](handleEntityNotFound(_0x450e01,null))[_0x3711('0x21')](function(_0xc3c01e){if(_0xc3c01e){_0x575daf=_0xc3c01e;_0x4f3202[_0x3711('0x2f')]=_['keys'](db['SalesforceField'][_0x3711('0x2b')]);_0x4f3202[_0x3711('0x31')]=_[_0x3711('0x30')](_0x57b70b[_0x3711('0x31')]);_0x4f3202[_0x3711('0x32')]=_[_0x3711('0x33')](_0x4f3202[_0x3711('0x2f')],_0x4f3202[_0x3711('0x31')]);_0xd4eac1[_0x3711('0x34')]=_[_0x3711('0x33')](_0x4f3202[_0x3711('0x2f')],qs[_0x3711('0x35')](_0x57b70b['query'][_0x3711('0x35')]));_0xd4eac1[_0x3711('0x34')]=_0xd4eac1[_0x3711('0x34')]['length']?_0xd4eac1[_0x3711('0x34')]:_0x4f3202[_0x3711('0x2f')];_0xd4eac1[_0x3711('0x39')]=qs['sort'](_0x57b70b['query'][_0x3711('0x3a')]);_0xd4eac1[_0x3711('0x3b')]=qs[_0x3711('0x32')](_[_0x3711('0x3c')](_0x57b70b[_0x3711('0x31')],_0x4f3202[_0x3711('0x32')]));if(_0x57b70b[_0x3711('0x31')]['filter']){_0xd4eac1[_0x3711('0x3b')]=_[_0x3711('0x3e')](_0xd4eac1[_0x3711('0x3b')],{'$or':_[_0x3711('0x29')](_0xd4eac1[_0x3711('0x34')],function(_0x3ddc33){var _0x325a62={};_0x325a62[_0x3ddc33]={'$like':'%'+_0x57b70b[_0x3711('0x31')]['filter']+'%'};return _0x325a62;})});}_0xd4eac1=_['merge']({},_0xd4eac1,_0x57b70b[_0x3711('0x3f')]);return _0x575daf[_0x3711('0x4d')](_0xd4eac1);}})['then'](function(_0x11b477){if(_0x11b477){_0x15e794=_0x11b477['length'];if(!_0x57b70b['query'][_0x3711('0x37')]('nolimit')){_0xd4eac1[_0x3711('0x1d')]=qs[_0x3711('0x1d')](_0x57b70b[_0x3711('0x31')][_0x3711('0x1d')]);_0xd4eac1[_0x3711('0x1a')]=qs[_0x3711('0x1a')](_0x57b70b[_0x3711('0x31')][_0x3711('0x1a')]);}return _0x575daf[_0x3711('0x4d')](_0xd4eac1);}})['then'](function(_0x2de6ce){if(_0x2de6ce){return _0x2de6ce?{'count':_0x15e794,'rows':_0x2de6ce}:null;}})[_0x3711('0x21')](respondWithResult(_0x450e01,null))[_0x3711('0x43')](handleError(_0x450e01,null));};exports['getDescriptions']=function(_0x17bec9,_0x4b722b,_0x32cc87){var _0xd55cb3={};var _0x1e62df={};var _0x1dd80b;var _0x4be8b8;return db[_0x3711('0x2a')][_0x3711('0x4b')]({'where':{'id':_0x17bec9['params']['id']}})['then'](handleEntityNotFound(_0x4b722b,null))['then'](function(_0xfa4a61){if(_0xfa4a61){_0x1dd80b=_0xfa4a61;_0x1e62df['model']=_[_0x3711('0x30')](db[_0x3711('0x4c')][_0x3711('0x2b')]);_0x1e62df[_0x3711('0x31')]=_['keys'](_0x17bec9[_0x3711('0x31')]);_0x1e62df[_0x3711('0x32')]=_[_0x3711('0x33')](_0x1e62df[_0x3711('0x2f')],_0x1e62df[_0x3711('0x31')]);_0xd55cb3[_0x3711('0x34')]=_[_0x3711('0x33')](_0x1e62df[_0x3711('0x2f')],qs[_0x3711('0x35')](_0x17bec9[_0x3711('0x31')][_0x3711('0x35')]));_0xd55cb3['attributes']=_0xd55cb3[_0x3711('0x34')]['length']?_0xd55cb3[_0x3711('0x34')]:_0x1e62df['model'];_0xd55cb3[_0x3711('0x39')]=qs[_0x3711('0x3a')](_0x17bec9[_0x3711('0x31')][_0x3711('0x3a')]);_0xd55cb3['where']=qs[_0x3711('0x32')](_['pick'](_0x17bec9[_0x3711('0x31')],_0x1e62df['filters']));if(_0x17bec9[_0x3711('0x31')][_0x3711('0x3d')]){_0xd55cb3[_0x3711('0x3b')]=_['merge'](_0xd55cb3[_0x3711('0x3b')],{'$or':_[_0x3711('0x29')](_0xd55cb3[_0x3711('0x34')],function(_0x4f7565){var _0x2976a5={};_0x2976a5[_0x4f7565]={'$like':'%'+_0x17bec9[_0x3711('0x31')][_0x3711('0x3d')]+'%'};return _0x2976a5;})});}_0xd55cb3=_[_0x3711('0x3e')]({},_0xd55cb3,_0x17bec9['options']);return _0x1dd80b['getDescriptions'](_0xd55cb3);}})[_0x3711('0x21')](function(_0x5e0efd){if(_0x5e0efd){_0x4be8b8=_0x5e0efd[_0x3711('0x36')];if(!_0x17bec9[_0x3711('0x31')][_0x3711('0x37')](_0x3711('0x38'))){_0xd55cb3[_0x3711('0x1d')]=qs[_0x3711('0x1d')](_0x17bec9[_0x3711('0x31')]['limit']);_0xd55cb3[_0x3711('0x1a')]=qs[_0x3711('0x1a')](_0x17bec9[_0x3711('0x31')][_0x3711('0x1a')]);}return _0x1dd80b[_0x3711('0x4e')](_0xd55cb3);}})[_0x3711('0x21')](function(_0x1c8f34){if(_0x1c8f34){return _0x1c8f34?{'count':_0x4be8b8,'rows':_0x1c8f34}:null;}})[_0x3711('0x21')](respondWithResult(_0x4b722b,null))[_0x3711('0x43')](handleError(_0x4b722b,null));}; \ No newline at end of file +var _0x1f17=['query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','order','nolimit','getFields','getSubjects','getDescriptions','SalesforceField','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','SalesforceConfiguration','fieldName','type','model','map'];(function(_0x1cd8d0,_0x9fd33c){var _0xd91b2=function(_0x229fce){while(--_0x229fce){_0x1cd8d0['push'](_0x1cd8d0['shift']());}};_0xd91b2(++_0x9fd33c);}(_0x1f17,0x71));var _0x71f1=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x1f17[_0x3cc9d9];return _0x1a425d;};'use strict';var emlformat=require(_0x71f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x71f1('0x1'));var jsonpatch=require(_0x71f1('0x2'));var rp=require(_0x71f1('0x3'));var moment=require('moment');var BPromise=require(_0x71f1('0x4'));var Mustache=require(_0x71f1('0x5'));var util=require('util');var path=require(_0x71f1('0x6'));var sox=require('sox');var csv=require(_0x71f1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71f1('0x8'));var squel=require('squel');var crypto=require(_0x71f1('0x9'));var jsforce=require(_0x71f1('0xa'));var deskjs=require(_0x71f1('0xb'));var toCsv=require(_0x71f1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x71f1('0xc'));var authService=require(_0x71f1('0xd'));var qs=require(_0x71f1('0xe'));var as=require(_0x71f1('0xf'));var hardwareService=require(_0x71f1('0x10'));var logger=require('../../config/logger')(_0x71f1('0x11'));var utils=require(_0x71f1('0x12'));var config=require(_0x71f1('0x13'));var licenseUtil=require(_0x71f1('0x14'));var db=require(_0x71f1('0x15'))['db'];function respondWithStatusCode(_0x36d424,_0x33b1a1){_0x33b1a1=_0x33b1a1||0xcc;return function(_0x2f0e1e){if(_0x2f0e1e){return _0x36d424['sendStatus'](_0x33b1a1);}return _0x36d424[_0x71f1('0x16')](_0x33b1a1)[_0x71f1('0x17')]();};}function respondWithResult(_0x57fad5,_0x1e60f0){_0x1e60f0=_0x1e60f0||0xc8;return function(_0x399d21){if(_0x399d21){return _0x57fad5[_0x71f1('0x16')](_0x1e60f0)[_0x71f1('0x18')](_0x399d21);}};}function respondWithFilteredResult(_0x4ae480,_0x4ba8c8){return function(_0x37c695){if(_0x37c695){var _0x1abae3=typeof _0x4ba8c8[_0x71f1('0x19')]===_0x71f1('0x1a')&&typeof _0x4ba8c8[_0x71f1('0x1b')]==='undefined';var _0x4ac912=_0x37c695[_0x71f1('0x1c')];var _0x5e49fc=_0x1abae3?0x0:_0x4ba8c8[_0x71f1('0x19')];var _0x44ee79=_0x1abae3?_0x37c695[_0x71f1('0x1c')]:_0x4ba8c8[_0x71f1('0x19')]+_0x4ba8c8[_0x71f1('0x1b')];var _0x536e76;if(_0x44ee79>=_0x4ac912){_0x44ee79=_0x4ac912;_0x536e76=0xc8;}else{_0x536e76=0xce;}_0x4ae480[_0x71f1('0x16')](_0x536e76);return _0x4ae480[_0x71f1('0x1d')](_0x71f1('0x1e'),_0x5e49fc+'-'+_0x44ee79+'/'+_0x4ac912)[_0x71f1('0x18')](_0x37c695);}return null;};}function patchUpdates(_0x1a2410){return function(_0xde337e){try{jsonpatch[_0x71f1('0x1f')](_0xde337e,_0x1a2410,!![]);}catch(_0x1be421){return BPromise[_0x71f1('0x20')](_0x1be421);}return _0xde337e[_0x71f1('0x21')]();};}function saveUpdates(_0x44b338,_0x392101){return function(_0x1aca33){if(_0x1aca33){return _0x1aca33[_0x71f1('0x22')](_0x44b338)[_0x71f1('0x23')](function(_0x300563){return _0x300563;});}return null;};}function removeEntity(_0x387546,_0x5116c4){return function(_0x469147){if(_0x469147){return _0x469147[_0x71f1('0x24')]()[_0x71f1('0x23')](function(){_0x387546[_0x71f1('0x16')](0xcc)[_0x71f1('0x17')]();});}};}function handleEntityNotFound(_0x419b8a,_0x46d977){return function(_0x1e79da){if(!_0x1e79da){_0x419b8a[_0x71f1('0x25')](0x194);}return _0x1e79da;};}function handleError(_0x222ce9,_0x46aba2){_0x46aba2=_0x46aba2||0x1f4;return function(_0xc493ba){logger[_0x71f1('0x26')](_0xc493ba[_0x71f1('0x27')]);if(_0xc493ba[_0x71f1('0x28')]){delete _0xc493ba[_0x71f1('0x28')];}_0x222ce9[_0x71f1('0x16')](_0x46aba2)['send'](_0xc493ba);};}exports[_0x71f1('0x29')]=function(_0x2b5716,_0x1aea12){var _0x338b51={},_0x4287bd={},_0x109ac4={'count':0x0,'rows':[]};var _0x5ce2bc=_['map'](db[_0x71f1('0x2a')]['rawAttributes'],function(_0x54a50b){return{'name':_0x54a50b[_0x71f1('0x2b')],'type':_0x54a50b[_0x71f1('0x2c')]['key']};});_0x4287bd[_0x71f1('0x2d')]=_[_0x71f1('0x2e')](_0x5ce2bc,_0x71f1('0x28'));_0x4287bd[_0x71f1('0x2f')]=_[_0x71f1('0x30')](_0x2b5716[_0x71f1('0x2f')]);_0x4287bd[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x4287bd[_0x71f1('0x2d')],_0x4287bd['query']);_0x338b51['attributes']=_[_0x71f1('0x32')](_0x4287bd[_0x71f1('0x2d')],qs[_0x71f1('0x33')](_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x338b51['attributes']=_0x338b51['attributes'][_0x71f1('0x34')]?_0x338b51[_0x71f1('0x35')]:_0x4287bd[_0x71f1('0x2d')];if(!_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x36')]('nolimit')){_0x338b51[_0x71f1('0x1b')]=qs['limit'](_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x1b')]);_0x338b51['offset']=qs['offset'](_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x19')]);}_0x338b51['order']=qs[_0x71f1('0x37')](_0x2b5716[_0x71f1('0x2f')]['sort']);_0x338b51['where']=qs[_0x71f1('0x31')](_[_0x71f1('0x38')](_0x2b5716['query'],_0x4287bd[_0x71f1('0x31')]),_0x5ce2bc);if(_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x39')]){_0x338b51['where']=_[_0x71f1('0x3a')](_0x338b51[_0x71f1('0x3b')],{'$or':_['map'](_0x5ce2bc,function(_0x20f9e1){if(_0x20f9e1[_0x71f1('0x2c')]!==_0x71f1('0x3c')){var _0x36d3e3={};_0x36d3e3[_0x20f9e1['name']]={'$like':'%'+_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x39')]+'%'};return _0x36d3e3;}})});}_0x338b51=_[_0x71f1('0x3a')]({},_0x338b51,_0x2b5716[_0x71f1('0x3d')]);var _0xd78829={'where':_0x338b51['where']};return db[_0x71f1('0x2a')][_0x71f1('0x1c')](_0xd78829)['then'](function(_0x27bb40){_0x109ac4['count']=_0x27bb40;if(_0x2b5716[_0x71f1('0x2f')][_0x71f1('0x3e')]){_0x338b51[_0x71f1('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x71f1('0x40')](_0x338b51);})[_0x71f1('0x23')](function(_0x1b9a75){_0x109ac4[_0x71f1('0x41')]=_0x1b9a75;return _0x109ac4;})[_0x71f1('0x23')](respondWithFilteredResult(_0x1aea12,_0x338b51))[_0x71f1('0x42')](handleError(_0x1aea12,null));};exports[_0x71f1('0x43')]=function(_0x425013,_0x1856d7){var _0x5c1c48={'raw':![],'where':{'id':_0x425013[_0x71f1('0x44')]['id']}},_0x4d591a={};_0x4d591a[_0x71f1('0x2d')]=_['keys'](db['SalesforceConfiguration'][_0x71f1('0x45')]);_0x4d591a['query']=_[_0x71f1('0x30')](_0x425013[_0x71f1('0x2f')]);_0x4d591a[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x4d591a['model'],_0x4d591a[_0x71f1('0x2f')]);_0x5c1c48[_0x71f1('0x35')]=_['intersection'](_0x4d591a[_0x71f1('0x2d')],qs['fields'](_0x425013[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x5c1c48[_0x71f1('0x35')]=_0x5c1c48[_0x71f1('0x35')][_0x71f1('0x34')]?_0x5c1c48[_0x71f1('0x35')]:_0x4d591a[_0x71f1('0x2d')];if(_0x425013['query']['includeAll']){_0x5c1c48[_0x71f1('0x3f')]=[{'all':!![]}];}_0x5c1c48=_[_0x71f1('0x3a')]({},_0x5c1c48,_0x425013['options']);return db['SalesforceConfiguration'][_0x71f1('0x46')](_0x5c1c48)[_0x71f1('0x23')](handleEntityNotFound(_0x1856d7,null))[_0x71f1('0x23')](respondWithResult(_0x1856d7,null))[_0x71f1('0x42')](handleError(_0x1856d7,null));};exports[_0x71f1('0x47')]=function(_0x1237ea,_0x1416a8){return db['SalesforceConfiguration'][_0x71f1('0x47')](_0x1237ea[_0x71f1('0x48')],{})[_0x71f1('0x23')](respondWithResult(_0x1416a8,0xc9))[_0x71f1('0x42')](handleError(_0x1416a8,null));};exports[_0x71f1('0x22')]=function(_0x2739bf,_0x5ba03a){if(_0x2739bf[_0x71f1('0x48')]['id']){delete _0x2739bf[_0x71f1('0x48')]['id'];}return db[_0x71f1('0x2a')][_0x71f1('0x46')]({'where':{'id':_0x2739bf[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x5ba03a,null))[_0x71f1('0x23')](saveUpdates(_0x2739bf[_0x71f1('0x48')],null))['then'](respondWithResult(_0x5ba03a,null))['catch'](handleError(_0x5ba03a,null));};exports[_0x71f1('0x24')]=function(_0x5b4e8,_0x24b64b){return db['SalesforceConfiguration'][_0x71f1('0x46')]({'where':{'id':_0x5b4e8[_0x71f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x24b64b,null))[_0x71f1('0x23')](removeEntity(_0x24b64b,null))[_0x71f1('0x42')](handleError(_0x24b64b,null));};exports['getFields']=function(_0x4e1cb6,_0x2154fa,_0x1c0d83){var _0x424a14={};var _0x3e6957={};var _0x15177b;var _0x21f9da;return db[_0x71f1('0x2a')][_0x71f1('0x49')]({'where':{'id':_0x4e1cb6[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x2154fa,null))[_0x71f1('0x23')](function(_0x20cd9d){if(_0x20cd9d){_0x15177b=_0x20cd9d;_0x3e6957['model']=_['keys'](db['SalesforceField'][_0x71f1('0x45')]);_0x3e6957[_0x71f1('0x2f')]=_[_0x71f1('0x30')](_0x4e1cb6[_0x71f1('0x2f')]);_0x3e6957['filters']=_['intersection'](_0x3e6957['model'],_0x3e6957[_0x71f1('0x2f')]);_0x424a14[_0x71f1('0x35')]=_[_0x71f1('0x32')](_0x3e6957[_0x71f1('0x2d')],qs[_0x71f1('0x33')](_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x424a14['attributes']=_0x424a14[_0x71f1('0x35')][_0x71f1('0x34')]?_0x424a14[_0x71f1('0x35')]:_0x3e6957[_0x71f1('0x2d')];_0x424a14[_0x71f1('0x4a')]=qs['sort'](_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x37')]);_0x424a14[_0x71f1('0x3b')]=qs['filters'](_['pick'](_0x4e1cb6[_0x71f1('0x2f')],_0x3e6957[_0x71f1('0x31')]));if(_0x4e1cb6['query'][_0x71f1('0x39')]){_0x424a14[_0x71f1('0x3b')]=_['merge'](_0x424a14[_0x71f1('0x3b')],{'$or':_[_0x71f1('0x2e')](_0x424a14['attributes'],function(_0x25932d){var _0x2f4150={};_0x2f4150[_0x25932d]={'$like':'%'+_0x4e1cb6['query'][_0x71f1('0x39')]+'%'};return _0x2f4150;})});}_0x424a14=_[_0x71f1('0x3a')]({},_0x424a14,_0x4e1cb6[_0x71f1('0x3d')]);return _0x15177b['getFields'](_0x424a14);}})['then'](function(_0x5c72bf){if(_0x5c72bf){_0x21f9da=_0x5c72bf[_0x71f1('0x34')];if(!_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x36')](_0x71f1('0x4b'))){_0x424a14[_0x71f1('0x1b')]=qs[_0x71f1('0x1b')](_0x4e1cb6['query'][_0x71f1('0x1b')]);_0x424a14['offset']=qs['offset'](_0x4e1cb6[_0x71f1('0x2f')][_0x71f1('0x19')]);}return _0x15177b[_0x71f1('0x4c')](_0x424a14);}})[_0x71f1('0x23')](function(_0x5abd12){if(_0x5abd12){return _0x5abd12?{'count':_0x21f9da,'rows':_0x5abd12}:null;}})[_0x71f1('0x23')](respondWithResult(_0x2154fa,null))[_0x71f1('0x42')](handleError(_0x2154fa,null));};exports['getSubjects']=function(_0x270366,_0x534b2a,_0x2ef98b){var _0xc2bf6c={};var _0x5c955e={};var _0x45d161;var _0x1545ae;return db[_0x71f1('0x2a')]['findOne']({'where':{'id':_0x270366[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x534b2a,null))[_0x71f1('0x23')](function(_0x3f778b){if(_0x3f778b){_0x45d161=_0x3f778b;_0x5c955e[_0x71f1('0x2d')]=_[_0x71f1('0x30')](db['SalesforceField']['rawAttributes']);_0x5c955e[_0x71f1('0x2f')]=_[_0x71f1('0x30')](_0x270366['query']);_0x5c955e[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x5c955e[_0x71f1('0x2d')],_0x5c955e['query']);_0xc2bf6c[_0x71f1('0x35')]=_['intersection'](_0x5c955e['model'],qs[_0x71f1('0x33')](_0x270366[_0x71f1('0x2f')][_0x71f1('0x33')]));_0xc2bf6c[_0x71f1('0x35')]=_0xc2bf6c[_0x71f1('0x35')][_0x71f1('0x34')]?_0xc2bf6c[_0x71f1('0x35')]:_0x5c955e[_0x71f1('0x2d')];_0xc2bf6c[_0x71f1('0x4a')]=qs[_0x71f1('0x37')](_0x270366[_0x71f1('0x2f')][_0x71f1('0x37')]);_0xc2bf6c[_0x71f1('0x3b')]=qs['filters'](_['pick'](_0x270366[_0x71f1('0x2f')],_0x5c955e[_0x71f1('0x31')]));if(_0x270366[_0x71f1('0x2f')][_0x71f1('0x39')]){_0xc2bf6c['where']=_[_0x71f1('0x3a')](_0xc2bf6c[_0x71f1('0x3b')],{'$or':_[_0x71f1('0x2e')](_0xc2bf6c[_0x71f1('0x35')],function(_0x128f7e){var _0x3b2e61={};_0x3b2e61[_0x128f7e]={'$like':'%'+_0x270366[_0x71f1('0x2f')][_0x71f1('0x39')]+'%'};return _0x3b2e61;})});}_0xc2bf6c=_[_0x71f1('0x3a')]({},_0xc2bf6c,_0x270366[_0x71f1('0x3d')]);return _0x45d161[_0x71f1('0x4d')](_0xc2bf6c);}})['then'](function(_0x1857cf){if(_0x1857cf){_0x1545ae=_0x1857cf[_0x71f1('0x34')];if(!_0x270366['query'][_0x71f1('0x36')](_0x71f1('0x4b'))){_0xc2bf6c[_0x71f1('0x1b')]=qs[_0x71f1('0x1b')](_0x270366[_0x71f1('0x2f')][_0x71f1('0x1b')]);_0xc2bf6c['offset']=qs['offset'](_0x270366[_0x71f1('0x2f')][_0x71f1('0x19')]);}return _0x45d161['getSubjects'](_0xc2bf6c);}})[_0x71f1('0x23')](function(_0x2790cb){if(_0x2790cb){return _0x2790cb?{'count':_0x1545ae,'rows':_0x2790cb}:null;}})[_0x71f1('0x23')](respondWithResult(_0x534b2a,null))[_0x71f1('0x42')](handleError(_0x534b2a,null));};exports[_0x71f1('0x4e')]=function(_0x1478c6,_0x9ce385,_0x466130){var _0x4788ed={};var _0x54bff4={};var _0x5efbfb;var _0x537adb;return db[_0x71f1('0x2a')]['findOne']({'where':{'id':_0x1478c6[_0x71f1('0x44')]['id']}})[_0x71f1('0x23')](handleEntityNotFound(_0x9ce385,null))[_0x71f1('0x23')](function(_0x397337){if(_0x397337){_0x5efbfb=_0x397337;_0x54bff4['model']=_[_0x71f1('0x30')](db[_0x71f1('0x4f')][_0x71f1('0x45')]);_0x54bff4['query']=_[_0x71f1('0x30')](_0x1478c6[_0x71f1('0x2f')]);_0x54bff4[_0x71f1('0x31')]=_[_0x71f1('0x32')](_0x54bff4[_0x71f1('0x2d')],_0x54bff4['query']);_0x4788ed['attributes']=_[_0x71f1('0x32')](_0x54bff4[_0x71f1('0x2d')],qs['fields'](_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x33')]));_0x4788ed['attributes']=_0x4788ed[_0x71f1('0x35')][_0x71f1('0x34')]?_0x4788ed['attributes']:_0x54bff4[_0x71f1('0x2d')];_0x4788ed[_0x71f1('0x4a')]=qs['sort'](_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x37')]);_0x4788ed[_0x71f1('0x3b')]=qs[_0x71f1('0x31')](_[_0x71f1('0x38')](_0x1478c6[_0x71f1('0x2f')],_0x54bff4[_0x71f1('0x31')]));if(_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x39')]){_0x4788ed[_0x71f1('0x3b')]=_[_0x71f1('0x3a')](_0x4788ed[_0x71f1('0x3b')],{'$or':_['map'](_0x4788ed[_0x71f1('0x35')],function(_0x207bd1){var _0x273897={};_0x273897[_0x207bd1]={'$like':'%'+_0x1478c6['query']['filter']+'%'};return _0x273897;})});}_0x4788ed=_[_0x71f1('0x3a')]({},_0x4788ed,_0x1478c6['options']);return _0x5efbfb[_0x71f1('0x4e')](_0x4788ed);}})['then'](function(_0xe47ca4){if(_0xe47ca4){_0x537adb=_0xe47ca4[_0x71f1('0x34')];if(!_0x1478c6[_0x71f1('0x2f')][_0x71f1('0x36')](_0x71f1('0x4b'))){_0x4788ed[_0x71f1('0x1b')]=qs[_0x71f1('0x1b')](_0x1478c6['query'][_0x71f1('0x1b')]);_0x4788ed[_0x71f1('0x19')]=qs[_0x71f1('0x19')](_0x1478c6['query']['offset']);}return _0x5efbfb['getDescriptions'](_0x4788ed);}})['then'](function(_0x225e1a){if(_0x225e1a){return _0x225e1a?{'count':_0x537adb,'rows':_0x225e1a}:null;}})['then'](respondWithResult(_0x9ce385,null))[_0x71f1('0x42')](handleError(_0x9ce385,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 15247df..084e106 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 _0x8e67=['moment','bluebird','path','rimraf','../../config/environment','exports','SalesforceConfiguration','lodash','util','api'];(function(_0x4469c9,_0x3bd8e4){var _0x1f2a7a=function(_0x3a5368){while(--_0x3a5368){_0x4469c9['push'](_0x4469c9['shift']());}};_0x1f2a7a(++_0x3bd8e4);}(_0x8e67,0x75));var _0x78e6=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x8e67[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x78e6('0x0'));var util=require(_0x78e6('0x1'));var logger=require('../../config/logger')(_0x78e6('0x2'));var moment=require(_0x78e6('0x3'));var BPromise=require(_0x78e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78e6('0x5'));var rimraf=require(_0x78e6('0x6'));var config=require(_0x78e6('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x78e6('0x8')]=function(_0x577f84,_0x398630){return _0x577f84['define'](_0x78e6('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3167=['exports','define','SalesforceConfiguration','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./intSalesforceConfiguration.attributes'];(function(_0x333f02,_0x5446f8){var _0x30eee5=function(_0x14f491){while(--_0x14f491){_0x333f02['push'](_0x333f02['shift']());}};_0x30eee5(++_0x5446f8);}(_0x3167,0x14d));var _0x7316=function(_0x458656,_0x4292d8){_0x458656=_0x458656-0x0;var _0x24e475=_0x3167[_0x458656];return _0x24e475;};'use strict';var _=require(_0x7316('0x0'));var util=require(_0x7316('0x1'));var logger=require(_0x7316('0x2'))(_0x7316('0x3'));var moment=require(_0x7316('0x4'));var BPromise=require(_0x7316('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7316('0x6'));var config=require('../../config/environment');var attributes=require(_0x7316('0x7'));module[_0x7316('0x8')]=function(_0x3e1b1c,_0x238cf4){return _0x3e1b1c[_0x7316('0x9')](_0x7316('0xa'),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 248fb8b..ed30cbe 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 _0x6879=['ioredis','../../config/logger','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6879,0x88));var _0x9687=function(_0x90b3ef,_0x340160){_0x90b3ef=_0x90b3ef-0x0;var _0x28e487=_0x6879[_0x90b3ef];return _0x28e487;};'use strict';var _=require(_0x9687('0x0'));var util=require('util');var moment=require(_0x9687('0x1'));var BPromise=require(_0x9687('0x2'));var rs=require(_0x9687('0x3'));var fs=require('fs');var Redis=require(_0x9687('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9687('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9687('0x6'));var client=jayson[_0x9687('0x7')][_0x9687('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6f3081,_0x226755,_0x4e692d){return new BPromise(function(_0x2af42b,_0x1cfd34){return client[_0x9687('0x9')](_0x6f3081,_0x4e692d)[_0x9687('0xa')](function(_0x2a411f){logger['info'](_0x9687('0xb'),_0x226755,_0x9687('0xc'));logger[_0x9687('0xd')](_0x9687('0xe'),_0x226755,_0x9687('0xc'),JSON['stringify'](_0x2a411f));if(_0x2a411f[_0x9687('0xf')]){if(_0x2a411f[_0x9687('0xf')][_0x9687('0x10')]===0x1f4){logger[_0x9687('0xf')](_0x9687('0xb'),_0x226755,_0x2a411f['error'][_0x9687('0x11')]);return _0x1cfd34(_0x2a411f[_0x9687('0xf')]['message']);}logger[_0x9687('0xf')](_0x9687('0xb'),_0x226755,_0x2a411f[_0x9687('0xf')]['message']);return _0x2af42b(_0x2a411f[_0x9687('0xf')][_0x9687('0x11')]);}else{logger[_0x9687('0x12')](_0x9687('0xb'),_0x226755,_0x9687('0xc'));_0x2af42b(_0x2a411f['result']['message']);}})[_0x9687('0x13')](function(_0x3c31c0){logger[_0x9687('0xf')](_0x9687('0xb'),_0x226755,_0x3c31c0);_0x1cfd34(_0x3c31c0);});});} \ No newline at end of file +var _0x875e=['SalesforceConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x394dea,_0x252474){var _0x3a2054=function(_0xd47d76){while(--_0xd47d76){_0x394dea['push'](_0x394dea['shift']());}};_0x3a2054(++_0x252474);}(_0x875e,0x82));var _0xe875=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x875e[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require(_0xe875('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe875('0x4'))['db'];var utils=require(_0xe875('0x5'));var logger=require(_0xe875('0x6'))(_0xe875('0x7'));var config=require('../../config/environment');var jayson=require(_0xe875('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd54ffb,_0x362b6c,_0x1ecfd0){return new BPromise(function(_0x29b7a1,_0x3389a1){return client[_0xe875('0x9')](_0xd54ffb,_0x1ecfd0)[_0xe875('0xa')](function(_0xfc4137){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0xe875('0xb'));logger[_0xe875('0xc')](_0xe875('0xd'),_0x362b6c,_0xe875('0xb'),JSON['stringify'](_0xfc4137));if(_0xfc4137[_0xe875('0xe')]){if(_0xfc4137[_0xe875('0xe')][_0xe875('0xf')]===0x1f4){logger[_0xe875('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0xfc4137['error'][_0xe875('0x10')]);return _0x3389a1(_0xfc4137[_0xe875('0xe')][_0xe875('0x10')]);}logger[_0xe875('0xe')](_0xe875('0x11'),_0x362b6c,_0xfc4137['error'][_0xe875('0x10')]);return _0x29b7a1(_0xfc4137[_0xe875('0xe')][_0xe875('0x10')]);}else{logger[_0xe875('0x12')](_0xe875('0x11'),_0x362b6c,_0xe875('0xb'));_0x29b7a1(_0xfc4137[_0xe875('0x13')][_0xe875('0x10')]);}})[_0xe875('0x14')](function(_0x451561){logger[_0xe875('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0x451561);_0x3389a1(_0x451561);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3c40f5f..1a9fed6 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 _0x73d5=['express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x4235b3,_0x4295b9){var _0x5a6cc9=function(_0x3cd80d){while(--_0x3cd80d){_0x4235b3['push'](_0x4235b3['shift']());}};_0x5a6cc9(++_0x4295b9);}(_0x73d5,0x8c));var _0x573d=function(_0x2804d7,_0x2d8d6c){_0x2804d7=_0x2804d7-0x0;var _0x4a84e7=_0x73d5[_0x2804d7];return _0x4a84e7;};'use strict';var multer=require(_0x573d('0x0'));var util=require(_0x573d('0x1'));var path=require(_0x573d('0x2'));var timeout=require(_0x573d('0x3'));var express=require(_0x573d('0x4'));var router=express[_0x573d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x573d('0x6'));var config=require(_0x573d('0x7'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x573d('0x8')](),controller[_0x573d('0x9')]);router['get'](_0x573d('0xa'),auth['isAuthenticated'](),controller[_0x573d('0xb')]);router[_0x573d('0xc')]('/',auth[_0x573d('0x8')](),controller[_0x573d('0xd')]);router[_0x573d('0xe')](_0x573d('0xa'),auth['isAuthenticated'](),controller[_0x573d('0xf')]);router[_0x573d('0x10')](_0x573d('0xa'),auth[_0x573d('0x8')](),controller['destroy']);module[_0x573d('0x11')]=router; \ No newline at end of file +var _0x3973=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','delete','multer','util','path'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x3973,0x1ec));var _0x3397=function(_0x21e06b,_0x14d7df){_0x21e06b=_0x21e06b-0x0;var _0x16872a=_0x3973[_0x21e06b];return _0x16872a;};'use strict';var multer=require(_0x3397('0x0'));var util=require(_0x3397('0x1'));var path=require(_0x3397('0x2'));var timeout=require(_0x3397('0x3'));var express=require(_0x3397('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3397('0x5'));var interaction=require(_0x3397('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x3397('0x7')]('/',auth[_0x3397('0x8')](),controller[_0x3397('0x9')]);router[_0x3397('0x7')](_0x3397('0xa'),auth[_0x3397('0x8')](),controller['show']);router[_0x3397('0xb')]('/',auth[_0x3397('0x8')](),controller[_0x3397('0xc')]);router[_0x3397('0xd')](_0x3397('0xa'),auth[_0x3397('0x8')](),controller['update']);router[_0x3397('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index f7125a6..b069106 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 _0x3634=['customVariable','keyValue','picklist','string','STRING','variable','exports','ENUM'];(function(_0x3c7142,_0x54f57b){var _0xed7ea7=function(_0x3f5214){while(--_0x3f5214){_0x3c7142['push'](_0x3c7142['shift']());}};_0xed7ea7(++_0x54f57b);}(_0x3634,0x9e));var _0x4363=function(_0x1c797a,_0x33a805){_0x1c797a=_0x1c797a-0x0;var _0x3b7d80=_0x3634[_0x1c797a];return _0x3b7d80;};'use strict';var Sequelize=require('sequelize');module[_0x4363('0x0')]={'type':{'type':Sequelize[_0x4363('0x1')]('string','variable',_0x4363('0x2'),_0x4363('0x3'),_0x4363('0x4')),'defaultValue':_0x4363('0x5')},'content':{'type':Sequelize[_0x4363('0x6')]},'key':{'type':Sequelize[_0x4363('0x6')]},'keyType':{'type':Sequelize[_0x4363('0x1')](_0x4363('0x5'),_0x4363('0x7'),_0x4363('0x2'))},'keyContent':{'type':Sequelize[_0x4363('0x6')]},'idField':{'type':Sequelize[_0x4363('0x6')]},'variableName':{'type':Sequelize[_0x4363('0x6')]}}; \ No newline at end of file +var _0x7c62=['STRING','variable','sequelize','exports','ENUM','customVariable','string'];(function(_0x4bed3e,_0x56e922){var _0x5d0f37=function(_0x21a458){while(--_0x21a458){_0x4bed3e['push'](_0x4bed3e['shift']());}};_0x5d0f37(++_0x56e922);}(_0x7c62,0xd4));var _0x27c6=function(_0x26aa22,_0x1b10a5){_0x26aa22=_0x26aa22-0x0;var _0x377a7c=_0x7c62[_0x26aa22];return _0x377a7c;};'use strict';var Sequelize=require(_0x27c6('0x0'));module[_0x27c6('0x1')]={'type':{'type':Sequelize[_0x27c6('0x2')]('string','variable',_0x27c6('0x3'),'keyValue','picklist'),'defaultValue':_0x27c6('0x4')},'content':{'type':Sequelize[_0x27c6('0x5')]},'key':{'type':Sequelize[_0x27c6('0x5')]},'keyType':{'type':Sequelize[_0x27c6('0x2')](_0x27c6('0x4'),_0x27c6('0x6'),_0x27c6('0x3'))},'keyContent':{'type':Sequelize[_0x27c6('0x5')]},'idField':{'type':Sequelize[_0x27c6('0x5')]},'variableName':{'type':Sequelize[_0x27c6('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index c918fdb..f236b26 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 _0xf47b=['index','map','SalesforceField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send'];(function(_0x58e500,_0x149406){var _0x3a204c=function(_0x14dd20){while(--_0x14dd20){_0x58e500['push'](_0x58e500['shift']());}};_0x3a204c(++_0x149406);}(_0xf47b,0xaf));var _0xbf47=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf47b[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf47('0x0'));var zipdir=require(_0xbf47('0x1'));var jsonpatch=require(_0xbf47('0x2'));var rp=require(_0xbf47('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf47('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbf47('0x5'));var csv=require(_0xbf47('0x6'));var ejs=require(_0xbf47('0x7'));var fs=require('fs');var fs_extra=require(_0xbf47('0x8'));var _=require(_0xbf47('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbf47('0xa'));var toCsv=require(_0xbf47('0x6'));var querystring=require('querystring');var Papa=require(_0xbf47('0xb'));var Redis=require(_0xbf47('0xc'));var authService=require(_0xbf47('0xd'));var qs=require(_0xbf47('0xe'));var as=require(_0xbf47('0xf'));var hardwareService=require(_0xbf47('0x10'));var logger=require(_0xbf47('0x11'))('api');var utils=require(_0xbf47('0x12'));var config=require(_0xbf47('0x13'));var licenseUtil=require(_0xbf47('0x14'));var db=require(_0xbf47('0x15'))['db'];function respondWithStatusCode(_0x47e17a,_0x5418f1){_0x5418f1=_0x5418f1||0xcc;return function(_0x220539){if(_0x220539){return _0x47e17a['sendStatus'](_0x5418f1);}return _0x47e17a[_0xbf47('0x16')](_0x5418f1)['end']();};}function respondWithResult(_0x3d8475,_0xdc8072){_0xdc8072=_0xdc8072||0xc8;return function(_0x2afe0b){if(_0x2afe0b){return _0x3d8475[_0xbf47('0x16')](_0xdc8072)['json'](_0x2afe0b);}};}function respondWithFilteredResult(_0x2e3c7b,_0x26a24e){return function(_0x40a56d){if(_0x40a56d){var _0x5492ac=typeof _0x26a24e[_0xbf47('0x17')]===_0xbf47('0x18')&&typeof _0x26a24e['limit']===_0xbf47('0x18');var _0x3cace1=_0x40a56d[_0xbf47('0x19')];var _0xbb963d=_0x5492ac?0x0:_0x26a24e[_0xbf47('0x17')];var _0x4e9411=_0x5492ac?_0x40a56d[_0xbf47('0x19')]:_0x26a24e[_0xbf47('0x17')]+_0x26a24e[_0xbf47('0x1a')];var _0x54dccd;if(_0x4e9411>=_0x3cace1){_0x4e9411=_0x3cace1;_0x54dccd=0xc8;}else{_0x54dccd=0xce;}_0x2e3c7b[_0xbf47('0x16')](_0x54dccd);return _0x2e3c7b[_0xbf47('0x1b')](_0xbf47('0x1c'),_0xbb963d+'-'+_0x4e9411+'/'+_0x3cace1)[_0xbf47('0x1d')](_0x40a56d);}return null;};}function patchUpdates(_0x29c529){return function(_0x5d9bb6){try{jsonpatch[_0xbf47('0x1e')](_0x5d9bb6,_0x29c529,!![]);}catch(_0x4a3831){return BPromise[_0xbf47('0x1f')](_0x4a3831);}return _0x5d9bb6[_0xbf47('0x20')]();};}function saveUpdates(_0x4815f8,_0x56d784){return function(_0x1f8a3d){if(_0x1f8a3d){return _0x1f8a3d[_0xbf47('0x21')](_0x4815f8)[_0xbf47('0x22')](function(_0x3b3ec2){return _0x3b3ec2;});}return null;};}function removeEntity(_0xd0df08,_0x35e157){return function(_0x2c7955){if(_0x2c7955){return _0x2c7955[_0xbf47('0x23')]()[_0xbf47('0x22')](function(){_0xd0df08[_0xbf47('0x16')](0xcc)[_0xbf47('0x24')]();});}};}function handleEntityNotFound(_0xeb8d7f,_0x1cb1dc){return function(_0x435acf){if(!_0x435acf){_0xeb8d7f[_0xbf47('0x25')](0x194);}return _0x435acf;};}function handleError(_0x211ee8,_0x53a670){_0x53a670=_0x53a670||0x1f4;return function(_0x4e7da3){logger[_0xbf47('0x26')](_0x4e7da3['stack']);if(_0x4e7da3[_0xbf47('0x27')]){delete _0x4e7da3[_0xbf47('0x27')];}_0x211ee8['status'](_0x53a670)[_0xbf47('0x28')](_0x4e7da3);};}exports[_0xbf47('0x29')]=function(_0x7a09f8,_0x519c09){var _0x1d3ced={},_0x5a465b={},_0x7a8e35={'count':0x0,'rows':[]};var _0x38a8e0=_[_0xbf47('0x2a')](db[_0xbf47('0x2b')]['rawAttributes'],function(_0x48ea5d){return{'name':_0x48ea5d[_0xbf47('0x2c')],'type':_0x48ea5d['type'][_0xbf47('0x2d')]};});_0x5a465b[_0xbf47('0x2e')]=_['map'](_0x38a8e0,_0xbf47('0x27'));_0x5a465b[_0xbf47('0x2f')]=_[_0xbf47('0x30')](_0x7a09f8['query']);_0x5a465b[_0xbf47('0x31')]=_[_0xbf47('0x32')](_0x5a465b[_0xbf47('0x2e')],_0x5a465b[_0xbf47('0x2f')]);_0x1d3ced[_0xbf47('0x33')]=_[_0xbf47('0x32')](_0x5a465b[_0xbf47('0x2e')],qs[_0xbf47('0x34')](_0x7a09f8['query'][_0xbf47('0x34')]));_0x1d3ced[_0xbf47('0x33')]=_0x1d3ced['attributes'][_0xbf47('0x35')]?_0x1d3ced['attributes']:_0x5a465b[_0xbf47('0x2e')];if(!_0x7a09f8['query'][_0xbf47('0x36')](_0xbf47('0x37'))){_0x1d3ced[_0xbf47('0x1a')]=qs['limit'](_0x7a09f8[_0xbf47('0x2f')][_0xbf47('0x1a')]);_0x1d3ced[_0xbf47('0x17')]=qs[_0xbf47('0x17')](_0x7a09f8['query'][_0xbf47('0x17')]);}_0x1d3ced['order']=qs[_0xbf47('0x38')](_0x7a09f8['query'][_0xbf47('0x38')]);_0x1d3ced[_0xbf47('0x39')]=qs[_0xbf47('0x31')](_[_0xbf47('0x3a')](_0x7a09f8[_0xbf47('0x2f')],_0x5a465b['filters']),_0x38a8e0);if(_0x7a09f8[_0xbf47('0x2f')]['filter']){_0x1d3ced[_0xbf47('0x39')]=_[_0xbf47('0x3b')](_0x1d3ced[_0xbf47('0x39')],{'$or':_[_0xbf47('0x2a')](_0x38a8e0,function(_0x4f710c){if(_0x4f710c[_0xbf47('0x3c')]!==_0xbf47('0x3d')){var _0x911aa3={};_0x911aa3[_0x4f710c['name']]={'$like':'%'+_0x7a09f8[_0xbf47('0x2f')]['filter']+'%'};return _0x911aa3;}})});}_0x1d3ced=_[_0xbf47('0x3b')]({},_0x1d3ced,_0x7a09f8[_0xbf47('0x3e')]);var _0x3208f4={'where':_0x1d3ced['where']};return db[_0xbf47('0x2b')][_0xbf47('0x19')](_0x3208f4)[_0xbf47('0x22')](function(_0x51722b){_0x7a8e35[_0xbf47('0x19')]=_0x51722b;if(_0x7a09f8[_0xbf47('0x2f')][_0xbf47('0x3f')]){_0x1d3ced[_0xbf47('0x40')]=[{'all':!![]}];}return db[_0xbf47('0x2b')]['findAll'](_0x1d3ced);})['then'](function(_0x5c15ed){_0x7a8e35[_0xbf47('0x41')]=_0x5c15ed;return _0x7a8e35;})[_0xbf47('0x22')](respondWithFilteredResult(_0x519c09,_0x1d3ced))[_0xbf47('0x42')](handleError(_0x519c09,null));};exports['show']=function(_0x5b4c59,_0x159c0d){var _0x4e1cff={'raw':!![],'where':{'id':_0x5b4c59[_0xbf47('0x43')]['id']}},_0x48e176={};_0x48e176[_0xbf47('0x2e')]=_['keys'](db[_0xbf47('0x2b')][_0xbf47('0x44')]);_0x48e176['query']=_['keys'](_0x5b4c59['query']);_0x48e176[_0xbf47('0x31')]=_['intersection'](_0x48e176[_0xbf47('0x2e')],_0x48e176[_0xbf47('0x2f')]);_0x4e1cff['attributes']=_[_0xbf47('0x32')](_0x48e176[_0xbf47('0x2e')],qs[_0xbf47('0x34')](_0x5b4c59['query']['fields']));_0x4e1cff[_0xbf47('0x33')]=_0x4e1cff[_0xbf47('0x33')][_0xbf47('0x35')]?_0x4e1cff['attributes']:_0x48e176[_0xbf47('0x2e')];if(_0x5b4c59[_0xbf47('0x2f')][_0xbf47('0x3f')]){_0x4e1cff['include']=[{'all':!![]}];}_0x4e1cff=_['merge']({},_0x4e1cff,_0x5b4c59[_0xbf47('0x3e')]);return db['SalesforceField']['find'](_0x4e1cff)[_0xbf47('0x22')](handleEntityNotFound(_0x159c0d,null))[_0xbf47('0x22')](respondWithResult(_0x159c0d,null))[_0xbf47('0x42')](handleError(_0x159c0d,null));};exports[_0xbf47('0x45')]=function(_0xcfe22c,_0x14ed6d){return db[_0xbf47('0x2b')]['create'](_0xcfe22c[_0xbf47('0x46')],{})['then'](respondWithResult(_0x14ed6d,0xc9))['catch'](handleError(_0x14ed6d,null));};exports['update']=function(_0x26bb79,_0x1be5ba){if(_0x26bb79[_0xbf47('0x46')]['id']){delete _0x26bb79[_0xbf47('0x46')]['id'];}return db[_0xbf47('0x2b')][_0xbf47('0x47')]({'where':{'id':_0x26bb79['params']['id']}})[_0xbf47('0x22')](handleEntityNotFound(_0x1be5ba,null))[_0xbf47('0x22')](saveUpdates(_0x26bb79['body'],null))[_0xbf47('0x22')](respondWithResult(_0x1be5ba,null))[_0xbf47('0x42')](handleError(_0x1be5ba,null));};exports[_0xbf47('0x23')]=function(_0x105aee,_0x2d2147){return db[_0xbf47('0x2b')][_0xbf47('0x47')]({'where':{'id':_0x105aee[_0xbf47('0x43')]['id']}})[_0xbf47('0x22')](handleEntityNotFound(_0x2d2147,null))['then'](removeEntity(_0x2d2147,null))[_0xbf47('0x42')](handleError(_0x2d2147,null));}; \ No newline at end of file +var _0x6d7a=['length','hasOwnProperty','offset','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','params','model','create','body','update','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes'];(function(_0x4bff06,_0x529ea1){var _0x5a1c2e=function(_0x16e026){while(--_0x16e026){_0x4bff06['push'](_0x4bff06['shift']());}};_0x5a1c2e(++_0x529ea1);}(_0x6d7a,0x133));var _0xa6d7=function(_0x1d5127,_0x2aab5f){_0x1d5127=_0x1d5127-0x0;var _0x1b1e28=_0x6d7a[_0x1d5127];return _0x1b1e28;};'use strict';var emlformat=require(_0xa6d7('0x0'));var rimraf=require(_0xa6d7('0x1'));var zipdir=require(_0xa6d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6d7('0x3'));var moment=require(_0xa6d7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa6d7('0x5'));var util=require('util');var path=require(_0xa6d7('0x6'));var sox=require('sox');var csv=require(_0xa6d7('0x7'));var ejs=require(_0xa6d7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6d7('0x9'));var squel=require(_0xa6d7('0xa'));var crypto=require(_0xa6d7('0xb'));var jsforce=require(_0xa6d7('0xc'));var deskjs=require(_0xa6d7('0xd'));var toCsv=require(_0xa6d7('0x7'));var querystring=require(_0xa6d7('0xe'));var Papa=require(_0xa6d7('0xf'));var Redis=require('ioredis');var authService=require(_0xa6d7('0x10'));var qs=require(_0xa6d7('0x11'));var as=require(_0xa6d7('0x12'));var hardwareService=require(_0xa6d7('0x13'));var logger=require(_0xa6d7('0x14'))(_0xa6d7('0x15'));var utils=require(_0xa6d7('0x16'));var config=require(_0xa6d7('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71a11,_0x9fbb84){_0x9fbb84=_0x9fbb84||0xcc;return function(_0x13064c){if(_0x13064c){return _0x71a11[_0xa6d7('0x18')](_0x9fbb84);}return _0x71a11[_0xa6d7('0x19')](_0x9fbb84)[_0xa6d7('0x1a')]();};}function respondWithResult(_0x160acb,_0x28c4e0){_0x28c4e0=_0x28c4e0||0xc8;return function(_0x468849){if(_0x468849){return _0x160acb[_0xa6d7('0x19')](_0x28c4e0)[_0xa6d7('0x1b')](_0x468849);}};}function respondWithFilteredResult(_0x34f62b,_0x114ebb){return function(_0x32b33f){if(_0x32b33f){var _0x2388ae=typeof _0x114ebb['offset']===_0xa6d7('0x1c')&&typeof _0x114ebb['limit']==='undefined';var _0x4c8e27=_0x32b33f['count'];var _0x50da72=_0x2388ae?0x0:_0x114ebb['offset'];var _0x3c6aa5=_0x2388ae?_0x32b33f['count']:_0x114ebb['offset']+_0x114ebb[_0xa6d7('0x1d')];var _0x1c757a;if(_0x3c6aa5>=_0x4c8e27){_0x3c6aa5=_0x4c8e27;_0x1c757a=0xc8;}else{_0x1c757a=0xce;}_0x34f62b[_0xa6d7('0x19')](_0x1c757a);return _0x34f62b[_0xa6d7('0x1e')](_0xa6d7('0x1f'),_0x50da72+'-'+_0x3c6aa5+'/'+_0x4c8e27)[_0xa6d7('0x1b')](_0x32b33f);}return null;};}function patchUpdates(_0x5c659d){return function(_0x47dc31){try{jsonpatch[_0xa6d7('0x20')](_0x47dc31,_0x5c659d,!![]);}catch(_0x25111f){return BPromise[_0xa6d7('0x21')](_0x25111f);}return _0x47dc31[_0xa6d7('0x22')]();};}function saveUpdates(_0x350cb3,_0xe40d04){return function(_0x22a7e1){if(_0x22a7e1){return _0x22a7e1['update'](_0x350cb3)['then'](function(_0x58c6c7){return _0x58c6c7;});}return null;};}function removeEntity(_0x4667e6,_0x5d4636){return function(_0x3123ce){if(_0x3123ce){return _0x3123ce[_0xa6d7('0x23')]()[_0xa6d7('0x24')](function(){_0x4667e6['status'](0xcc)[_0xa6d7('0x1a')]();});}};}function handleEntityNotFound(_0x4e0a6d,_0x454aa2){return function(_0x57ac7d){if(!_0x57ac7d){_0x4e0a6d[_0xa6d7('0x18')](0x194);}return _0x57ac7d;};}function handleError(_0x26be1e,_0xa8e93c){_0xa8e93c=_0xa8e93c||0x1f4;return function(_0xb4f80e){logger[_0xa6d7('0x25')](_0xb4f80e[_0xa6d7('0x26')]);if(_0xb4f80e[_0xa6d7('0x27')]){delete _0xb4f80e[_0xa6d7('0x27')];}_0x26be1e[_0xa6d7('0x19')](_0xa8e93c)[_0xa6d7('0x28')](_0xb4f80e);};}exports[_0xa6d7('0x29')]=function(_0x4cb487,_0x46f3b1){var _0x4f343e={},_0x374c4e={},_0x18036e={'count':0x0,'rows':[]};var _0x2a6933=_[_0xa6d7('0x2a')](db[_0xa6d7('0x2b')][_0xa6d7('0x2c')],function(_0x3144a4){return{'name':_0x3144a4[_0xa6d7('0x2d')],'type':_0x3144a4['type'][_0xa6d7('0x2e')]};});_0x374c4e['model']=_[_0xa6d7('0x2a')](_0x2a6933,_0xa6d7('0x27'));_0x374c4e[_0xa6d7('0x2f')]=_[_0xa6d7('0x30')](_0x4cb487[_0xa6d7('0x2f')]);_0x374c4e[_0xa6d7('0x31')]=_[_0xa6d7('0x32')](_0x374c4e['model'],_0x374c4e[_0xa6d7('0x2f')]);_0x4f343e['attributes']=_['intersection'](_0x374c4e['model'],qs[_0xa6d7('0x33')](_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x33')]));_0x4f343e[_0xa6d7('0x34')]=_0x4f343e[_0xa6d7('0x34')][_0xa6d7('0x35')]?_0x4f343e[_0xa6d7('0x34')]:_0x374c4e['model'];if(!_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x36')]('nolimit')){_0x4f343e[_0xa6d7('0x1d')]=qs[_0xa6d7('0x1d')](_0x4cb487['query'][_0xa6d7('0x1d')]);_0x4f343e[_0xa6d7('0x37')]=qs[_0xa6d7('0x37')](_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x37')]);}_0x4f343e['order']=qs['sort'](_0x4cb487['query']['sort']);_0x4f343e[_0xa6d7('0x38')]=qs[_0xa6d7('0x31')](_['pick'](_0x4cb487['query'],_0x374c4e[_0xa6d7('0x31')]),_0x2a6933);if(_0x4cb487['query'][_0xa6d7('0x39')]){_0x4f343e[_0xa6d7('0x38')]=_[_0xa6d7('0x3a')](_0x4f343e[_0xa6d7('0x38')],{'$or':_[_0xa6d7('0x2a')](_0x2a6933,function(_0x30ec3b){if(_0x30ec3b[_0xa6d7('0x3b')]!==_0xa6d7('0x3c')){var _0x23e449={};_0x23e449[_0x30ec3b['name']]={'$like':'%'+_0x4cb487['query'][_0xa6d7('0x39')]+'%'};return _0x23e449;}})});}_0x4f343e=_[_0xa6d7('0x3a')]({},_0x4f343e,_0x4cb487[_0xa6d7('0x3d')]);var _0x4d590c={'where':_0x4f343e['where']};return db[_0xa6d7('0x2b')]['count'](_0x4d590c)[_0xa6d7('0x24')](function(_0x286256){_0x18036e[_0xa6d7('0x3e')]=_0x286256;if(_0x4cb487[_0xa6d7('0x2f')][_0xa6d7('0x3f')]){_0x4f343e[_0xa6d7('0x40')]=[{'all':!![]}];}return db[_0xa6d7('0x2b')]['findAll'](_0x4f343e);})[_0xa6d7('0x24')](function(_0x579bff){_0x18036e['rows']=_0x579bff;return _0x18036e;})[_0xa6d7('0x24')](respondWithFilteredResult(_0x46f3b1,_0x4f343e))['catch'](handleError(_0x46f3b1,null));};exports['show']=function(_0x250c9d,_0x58da93){var _0xeea526={'raw':!![],'where':{'id':_0x250c9d[_0xa6d7('0x41')]['id']}},_0x5c8139={};_0x5c8139[_0xa6d7('0x42')]=_[_0xa6d7('0x30')](db[_0xa6d7('0x2b')]['rawAttributes']);_0x5c8139[_0xa6d7('0x2f')]=_[_0xa6d7('0x30')](_0x250c9d[_0xa6d7('0x2f')]);_0x5c8139['filters']=_[_0xa6d7('0x32')](_0x5c8139['model'],_0x5c8139[_0xa6d7('0x2f')]);_0xeea526[_0xa6d7('0x34')]=_[_0xa6d7('0x32')](_0x5c8139[_0xa6d7('0x42')],qs[_0xa6d7('0x33')](_0x250c9d[_0xa6d7('0x2f')][_0xa6d7('0x33')]));_0xeea526[_0xa6d7('0x34')]=_0xeea526['attributes']['length']?_0xeea526['attributes']:_0x5c8139['model'];if(_0x250c9d[_0xa6d7('0x2f')][_0xa6d7('0x3f')]){_0xeea526['include']=[{'all':!![]}];}_0xeea526=_['merge']({},_0xeea526,_0x250c9d[_0xa6d7('0x3d')]);return db[_0xa6d7('0x2b')]['find'](_0xeea526)['then'](handleEntityNotFound(_0x58da93,null))[_0xa6d7('0x24')](respondWithResult(_0x58da93,null))['catch'](handleError(_0x58da93,null));};exports['create']=function(_0x5ca068,_0x4178be){return db[_0xa6d7('0x2b')][_0xa6d7('0x43')](_0x5ca068[_0xa6d7('0x44')],{})[_0xa6d7('0x24')](respondWithResult(_0x4178be,0xc9))['catch'](handleError(_0x4178be,null));};exports[_0xa6d7('0x45')]=function(_0x10bd2c,_0x58616f){if(_0x10bd2c[_0xa6d7('0x44')]['id']){delete _0x10bd2c[_0xa6d7('0x44')]['id'];}return db[_0xa6d7('0x2b')]['find']({'where':{'id':_0x10bd2c[_0xa6d7('0x41')]['id']}})[_0xa6d7('0x24')](handleEntityNotFound(_0x58616f,null))[_0xa6d7('0x24')](saveUpdates(_0x10bd2c[_0xa6d7('0x44')],null))[_0xa6d7('0x24')](respondWithResult(_0x58616f,null))[_0xa6d7('0x46')](handleError(_0x58616f,null));};exports['destroy']=function(_0x5345fe,_0x2011f9){return db['SalesforceField'][_0xa6d7('0x47')]({'where':{'id':_0x5345fe[_0xa6d7('0x41')]['id']}})[_0xa6d7('0x24')](handleEntityNotFound(_0x2011f9,null))[_0xa6d7('0x24')](removeEntity(_0x2011f9,null))[_0xa6d7('0x46')](handleError(_0x2011f9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1884fee..2d5954d 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 _0xd5f8=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c00d5,_0x45c3ca){var _0x2d5f13=function(_0x59ac8d){while(--_0x59ac8d){_0x3c00d5['push'](_0x3c00d5['shift']());}};_0x2d5f13(++_0x45c3ca);}(_0xd5f8,0x1d3));var _0x8d5f=function(_0x4422cf,_0xadcb4e){_0x4422cf=_0x4422cf-0x0;var _0xfbe20a=_0xd5f8[_0x4422cf];return _0xfbe20a;};'use strict';var _=require(_0x8d5f('0x0'));var util=require('util');var logger=require(_0x8d5f('0x1'))(_0x8d5f('0x2'));var moment=require(_0x8d5f('0x3'));var BPromise=require(_0x8d5f('0x4'));var rp=require(_0x8d5f('0x5'));var fs=require('fs');var path=require(_0x8d5f('0x6'));var rimraf=require(_0x8d5f('0x7'));var config=require(_0x8d5f('0x8'));var attributes=require(_0x8d5f('0x9'));module[_0x8d5f('0xa')]=function(_0x2e1829,_0x5f58f2){return _0x2e1829[_0x8d5f('0xb')](_0x8d5f('0xc'),attributes,{'tableName':_0x8d5f('0xd'),'paranoid':![],'indexes':[{'name':_0x8d5f('0xe'),'fields':[_0x8d5f('0xf'),_0x8d5f('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0fcf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fcf,0x8d));var _0xf0fc=function(_0xadb514,_0x19bd2a){_0xadb514=_0xadb514-0x0;var _0x5dccb1=_0x0fcf[_0xadb514];return _0x5dccb1;};'use strict';var _=require(_0xf0fc('0x0'));var util=require(_0xf0fc('0x1'));var logger=require(_0xf0fc('0x2'))(_0xf0fc('0x3'));var moment=require(_0xf0fc('0x4'));var BPromise=require(_0xf0fc('0x5'));var rp=require(_0xf0fc('0x6'));var fs=require('fs');var path=require(_0xf0fc('0x7'));var rimraf=require(_0xf0fc('0x8'));var config=require(_0xf0fc('0x9'));var attributes=require('./intSalesforceField.attributes');module[_0xf0fc('0xa')]=function(_0x593724,_0xfbd44){return _0x593724[_0xf0fc('0xb')](_0xf0fc('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xf0fc('0xd'),'fields':[_0xf0fc('0xe'),_0xf0fc('0xf')],'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 0cc276a..48ddcf9 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 _0xd366=['then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x39439f,_0x5de32c){var _0x5bb4d7=function(_0x4dfe56){while(--_0x4dfe56){_0x39439f['push'](_0x39439f['shift']());}};_0x5bb4d7(++_0x5de32c);}(_0xd366,0x136));var _0x6d36=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xd366[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0x6d36('0x0'));var util=require(_0x6d36('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d36('0x2'));var fs=require('fs');var Redis=require(_0x6d36('0x3'));var db=require(_0x6d36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6d36('0x5'));var config=require(_0x6d36('0x6'));var jayson=require(_0x6d36('0x7'));var client=jayson['client'][_0x6d36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f38af,_0x5cdb12,_0x3e0568){return new BPromise(function(_0x1e48ef,_0x13ef7a){return client[_0x6d36('0x9')](_0x2f38af,_0x3e0568)[_0x6d36('0xa')](function(_0x2161bc){logger['info'](_0x6d36('0xb'),_0x5cdb12,_0x6d36('0xc'));logger['debug'](_0x6d36('0xd'),_0x5cdb12,'request\x20sent',JSON[_0x6d36('0xe')](_0x2161bc));if(_0x2161bc[_0x6d36('0xf')]){if(_0x2161bc[_0x6d36('0xf')][_0x6d36('0x10')]===0x1f4){logger[_0x6d36('0xf')](_0x6d36('0xb'),_0x5cdb12,_0x2161bc['error'][_0x6d36('0x11')]);return _0x13ef7a(_0x2161bc[_0x6d36('0xf')]['message']);}logger[_0x6d36('0xf')](_0x6d36('0xb'),_0x5cdb12,_0x2161bc[_0x6d36('0xf')]['message']);return _0x1e48ef(_0x2161bc[_0x6d36('0xf')][_0x6d36('0x11')]);}else{logger['info'](_0x6d36('0xb'),_0x5cdb12,_0x6d36('0xc'));_0x1e48ef(_0x2161bc[_0x6d36('0x12')]['message']);}})[_0x6d36('0x13')](function(_0x4c6878){logger[_0x6d36('0xf')](_0x6d36('0xb'),_0x5cdb12,_0x4c6878);_0x13ef7a(_0x4c6878);});});} \ No newline at end of file +var _0xb625=['message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xb625,0xd2));var _0x5b62=function(_0x3076b5,_0x6bc9df){_0x3076b5=_0x3076b5-0x0;var _0x5ef5da=_0xb625[_0x3076b5];return _0x5ef5da;};'use strict';var _=require(_0x5b62('0x0'));var util=require(_0x5b62('0x1'));var moment=require(_0x5b62('0x2'));var BPromise=require(_0x5b62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b62('0x4'));var db=require(_0x5b62('0x5'))['db'];var utils=require(_0x5b62('0x6'));var logger=require(_0x5b62('0x7'))(_0x5b62('0x8'));var config=require(_0x5b62('0x9'));var jayson=require(_0x5b62('0xa'));var client=jayson[_0x5b62('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5c9a,_0x53f36c,_0xb2581c){return new BPromise(function(_0x3b97bf,_0x5f59dd){return client['request'](_0x3a5c9a,_0xb2581c)[_0x5b62('0xc')](function(_0x19ce83){logger[_0x5b62('0xd')](_0x5b62('0xe'),_0x53f36c,'request\x20sent');logger[_0x5b62('0xf')](_0x5b62('0x10'),_0x53f36c,'request\x20sent',JSON[_0x5b62('0x11')](_0x19ce83));if(_0x19ce83[_0x5b62('0x12')]){if(_0x19ce83['error'][_0x5b62('0x13')]===0x1f4){logger[_0x5b62('0x12')](_0x5b62('0xe'),_0x53f36c,_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);return _0x5f59dd(_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);}logger[_0x5b62('0x12')](_0x5b62('0xe'),_0x53f36c,_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);return _0x3b97bf(_0x19ce83[_0x5b62('0x12')][_0x5b62('0x14')]);}else{logger[_0x5b62('0xd')](_0x5b62('0xe'),_0x53f36c,_0x5b62('0x15'));_0x3b97bf(_0x19ce83[_0x5b62('0x16')][_0x5b62('0x14')]);}})['catch'](function(_0x21ec29){logger[_0x5b62('0x12')](_0x5b62('0xe'),_0x53f36c,_0x21ec29);_0x5f59dd(_0x21ec29);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 47b23a5..d595a61 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 _0x9234=['create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post'];(function(_0x111ac0,_0x21be2b){var _0x2019d2=function(_0x5be449){while(--_0x5be449){_0x111ac0['push'](_0x111ac0['shift']());}};_0x2019d2(++_0x21be2b);}(_0x9234,0x1bd));var _0x4923=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x9234[_0x2adfb1];return _0xa52d45;};'use strict';var multer=require(_0x4923('0x0'));var util=require('util');var path=require(_0x4923('0x1'));var timeout=require(_0x4923('0x2'));var express=require(_0x4923('0x3'));var router=express[_0x4923('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4923('0x5'));var interaction=require(_0x4923('0x6'));var config=require('../../config/environment');var controller=require(_0x4923('0x7'));router[_0x4923('0x8')]('/',auth[_0x4923('0x9')](),controller[_0x4923('0xa')]);router[_0x4923('0x8')](_0x4923('0xb'),auth[_0x4923('0x9')](),controller['show']);router[_0x4923('0x8')]('/:id/configurations',auth[_0x4923('0x9')](),controller[_0x4923('0xc')]);router[_0x4923('0x8')]('/:id/fields',auth[_0x4923('0x9')](),controller[_0x4923('0xd')]);router[_0x4923('0xe')]('/',auth[_0x4923('0x9')](),controller[_0x4923('0xf')]);router[_0x4923('0xe')](_0x4923('0x10'),auth[_0x4923('0x9')](),controller[_0x4923('0x11')]);router[_0x4923('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4923('0x13')]);router[_0x4923('0x14')](_0x4923('0xb'),auth['isAuthenticated'](),controller[_0x4923('0x15')]);module[_0x4923('0x16')]=router; \ No newline at end of file +var _0xf966=['isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intServicenowAccount.controller','get'];(function(_0x31004a,_0x91730){var _0x14ac70=function(_0x37db9e){while(--_0x37db9e){_0x31004a['push'](_0x31004a['shift']());}};_0x14ac70(++_0x91730);}(_0xf966,0x65));var _0x6f96=function(_0x164515,_0x4c9255){_0x164515=_0x164515-0x0;var _0x2409d0=_0xf966[_0x164515];return _0x2409d0;};'use strict';var multer=require(_0x6f96('0x0'));var util=require(_0x6f96('0x1'));var path=require(_0x6f96('0x2'));var timeout=require(_0x6f96('0x3'));var express=require(_0x6f96('0x4'));var router=express[_0x6f96('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6f96('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f96('0x7'));router[_0x6f96('0x8')]('/',auth[_0x6f96('0x9')](),controller[_0x6f96('0xa')]);router[_0x6f96('0x8')](_0x6f96('0xb'),auth['isAuthenticated'](),controller[_0x6f96('0xc')]);router[_0x6f96('0x8')](_0x6f96('0xd'),auth[_0x6f96('0x9')](),controller['getConfigurations']);router[_0x6f96('0x8')](_0x6f96('0xe'),auth['isAuthenticated'](),controller[_0x6f96('0xf')]);router['post']('/',auth[_0x6f96('0x9')](),controller[_0x6f96('0x10')]);router[_0x6f96('0x11')](_0x6f96('0xd'),auth[_0x6f96('0x9')](),controller[_0x6f96('0x12')]);router['put'](_0x6f96('0xb'),auth[_0x6f96('0x9')](),controller[_0x6f96('0x13')]);router[_0x6f96('0x14')](_0x6f96('0xb'),auth[_0x6f96('0x9')](),controller['destroy']);module[_0x6f96('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index fe4e5d2..d56a53f 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 _0xa8ad=['username','remoteUri','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa8ad,0x188));var _0xda8a=function(_0x108d1a,_0x40bc99){_0x108d1a=_0x108d1a-0x0;var _0x3e8c49=_0xa8ad[_0x108d1a];return _0x3e8c49;};'use strict';var Sequelize=require(_0xda8a('0x0'));module[_0xda8a('0x1')]={'name':{'type':Sequelize[_0xda8a('0x2')]},'description':{'type':Sequelize[_0xda8a('0x2')]},'username':{'type':Sequelize[_0xda8a('0x2')],'unique':_0xda8a('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xda8a('0x2')]},'remoteUri':{'type':Sequelize[_0xda8a('0x2')],'unique':_0xda8a('0x4')},'serverUrl':{'type':Sequelize[_0xda8a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe8ea=['exports','STRING','username','remoteUri','sequelize'];(function(_0x496b11,_0x576cb0){var _0x3030ac=function(_0x38185b){while(--_0x38185b){_0x496b11['push'](_0x496b11['shift']());}};_0x3030ac(++_0x576cb0);}(_0xe8ea,0xd1));var _0xae8e=function(_0x3149b6,_0x4a1273){_0x3149b6=_0x3149b6-0x0;var _0x547bad=_0xe8ea[_0x3149b6];return _0x547bad;};'use strict';var Sequelize=require(_0xae8e('0x0'));module[_0xae8e('0x1')]={'name':{'type':Sequelize[_0xae8e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xae8e('0x2')],'unique':_0xae8e('0x3')},'password':{'type':Sequelize[_0xae8e('0x2')]},'email':{'type':Sequelize[_0xae8e('0x2')]},'remoteUri':{'type':Sequelize[_0xae8e('0x2')],'unique':_0xae8e('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index c07813e..7b87117 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 _0x8818=['%s/api/now/table/','username','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ServicenowAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','getConfigurations','findOne','ServicenowConfiguration','order','sort','AccountId','Subjects','getSubjects','getDescriptions','ServicenowField','Descriptions','made_sla','hold_reason','subcategory','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','location','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8818,0xd1));var _0x8881=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x8818[_0x1d9aa0];return _0x226868;};'use strict';var emlformat=require(_0x8881('0x0'));var rimraf=require(_0x8881('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8881('0x2'));var rp=require(_0x8881('0x3'));var moment=require('moment');var BPromise=require(_0x8881('0x4'));var Mustache=require(_0x8881('0x5'));var util=require(_0x8881('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8881('0x7'));var ejs=require(_0x8881('0x8'));var fs=require('fs');var fs_extra=require(_0x8881('0x9'));var _=require(_0x8881('0xa'));var squel=require(_0x8881('0xb'));var crypto=require('crypto');var jsforce=require(_0x8881('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8881('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8881('0xd'));var authService=require(_0x8881('0xe'));var qs=require(_0x8881('0xf'));var as=require(_0x8881('0x10'));var hardwareService=require(_0x8881('0x11'));var logger=require(_0x8881('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8881('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8881('0x14'));function respondWithStatusCode(_0xbba515,_0xf3446c){_0xf3446c=_0xf3446c||0xcc;return function(_0x15ddb5){if(_0x15ddb5){return _0xbba515[_0x8881('0x15')](_0xf3446c);}return _0xbba515[_0x8881('0x16')](_0xf3446c)[_0x8881('0x17')]();};}function respondWithResult(_0x3b3aa2,_0x25e490){_0x25e490=_0x25e490||0xc8;return function(_0xb43862){if(_0xb43862){return _0x3b3aa2[_0x8881('0x16')](_0x25e490)[_0x8881('0x18')](_0xb43862);}};}function respondWithFilteredResult(_0x27b752,_0x522fd2){return function(_0x1dd028){if(_0x1dd028){var _0x53d650=typeof _0x522fd2['offset']===_0x8881('0x19')&&typeof _0x522fd2[_0x8881('0x1a')]===_0x8881('0x19');var _0x2cc60a=_0x1dd028[_0x8881('0x1b')];var _0x437a0a=_0x53d650?0x0:_0x522fd2[_0x8881('0x1c')];var _0x368e92=_0x53d650?_0x1dd028[_0x8881('0x1b')]:_0x522fd2[_0x8881('0x1c')]+_0x522fd2[_0x8881('0x1a')];var _0xd7e0bc;if(_0x368e92>=_0x2cc60a){_0x368e92=_0x2cc60a;_0xd7e0bc=0xc8;}else{_0xd7e0bc=0xce;}_0x27b752[_0x8881('0x16')](_0xd7e0bc);return _0x27b752[_0x8881('0x1d')](_0x8881('0x1e'),_0x437a0a+'-'+_0x368e92+'/'+_0x2cc60a)['json'](_0x1dd028);}return null;};}function patchUpdates(_0x3b231f){return function(_0x5e55c4){try{jsonpatch[_0x8881('0x1f')](_0x5e55c4,_0x3b231f,!![]);}catch(_0x312b41){return BPromise[_0x8881('0x20')](_0x312b41);}return _0x5e55c4[_0x8881('0x21')]();};}function saveUpdates(_0x433d8c,_0x1b3bb7){return function(_0x88d260){if(_0x88d260){return _0x88d260[_0x8881('0x22')](_0x433d8c)[_0x8881('0x23')](function(_0x757aea){return _0x757aea;});}return null;};}function removeEntity(_0x3b3228,_0xad5182){return function(_0xa242ec){if(_0xa242ec){return _0xa242ec[_0x8881('0x24')]()['then'](function(){_0x3b3228[_0x8881('0x16')](0xcc)[_0x8881('0x17')]();});}};}function handleEntityNotFound(_0x378ce1,_0x20f3b0){return function(_0x3aac52){if(!_0x3aac52){_0x378ce1[_0x8881('0x15')](0x194);}return _0x3aac52;};}function handleError(_0xa63db0,_0x439a34){_0x439a34=_0x439a34||0x1f4;return function(_0x4ca4a1){logger[_0x8881('0x25')](_0x4ca4a1[_0x8881('0x26')]);if(_0x4ca4a1['name']){delete _0x4ca4a1[_0x8881('0x27')];}_0xa63db0['status'](_0x439a34)[_0x8881('0x28')](_0x4ca4a1);};}exports['index']=function(_0x1f781a,_0x7dc14b){var _0x1d346c={},_0x49ed0d={},_0x58cb={'count':0x0,'rows':[]};var _0x298749=_[_0x8881('0x29')](db[_0x8881('0x2a')][_0x8881('0x2b')],function(_0x30c055){return{'name':_0x30c055['fieldName'],'type':_0x30c055[_0x8881('0x2c')][_0x8881('0x2d')]};});_0x49ed0d['model']=_[_0x8881('0x29')](_0x298749,_0x8881('0x27'));_0x49ed0d[_0x8881('0x2e')]=_[_0x8881('0x2f')](_0x1f781a[_0x8881('0x2e')]);_0x49ed0d[_0x8881('0x30')]=_[_0x8881('0x31')](_0x49ed0d[_0x8881('0x32')],_0x49ed0d[_0x8881('0x2e')]);_0x1d346c[_0x8881('0x33')]=_[_0x8881('0x31')](_0x49ed0d[_0x8881('0x32')],qs[_0x8881('0x34')](_0x1f781a[_0x8881('0x2e')][_0x8881('0x34')]));_0x1d346c[_0x8881('0x33')]=_0x1d346c[_0x8881('0x33')][_0x8881('0x35')]?_0x1d346c[_0x8881('0x33')]:_0x49ed0d[_0x8881('0x32')];if(!_0x1f781a[_0x8881('0x2e')][_0x8881('0x36')](_0x8881('0x37'))){_0x1d346c[_0x8881('0x1a')]=qs['limit'](_0x1f781a[_0x8881('0x2e')][_0x8881('0x1a')]);_0x1d346c[_0x8881('0x1c')]=qs[_0x8881('0x1c')](_0x1f781a['query'][_0x8881('0x1c')]);}_0x1d346c['order']=qs['sort'](_0x1f781a['query']['sort']);_0x1d346c[_0x8881('0x38')]=qs[_0x8881('0x30')](_[_0x8881('0x39')](_0x1f781a[_0x8881('0x2e')],_0x49ed0d['filters']),_0x298749);if(_0x1f781a['query'][_0x8881('0x3a')]){_0x1d346c[_0x8881('0x38')]=_[_0x8881('0x3b')](_0x1d346c[_0x8881('0x38')],{'$or':_['map'](_0x298749,function(_0x4f2f05){if(_0x4f2f05[_0x8881('0x2c')]!==_0x8881('0x3c')){var _0x5f229e={};_0x5f229e[_0x4f2f05[_0x8881('0x27')]]={'$like':'%'+_0x1f781a['query'][_0x8881('0x3a')]+'%'};return _0x5f229e;}})});}_0x1d346c=_[_0x8881('0x3b')]({},_0x1d346c,_0x1f781a[_0x8881('0x3d')]);var _0xacbf89={'where':_0x1d346c[_0x8881('0x38')]};return db[_0x8881('0x2a')]['count'](_0xacbf89)[_0x8881('0x23')](function(_0x31775a){_0x58cb[_0x8881('0x1b')]=_0x31775a;if(_0x1f781a[_0x8881('0x2e')][_0x8881('0x3e')]){_0x1d346c[_0x8881('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x8881('0x40')](_0x1d346c);})['then'](function(_0xfc1a21){_0x58cb['rows']=_0xfc1a21;return _0x58cb;})[_0x8881('0x23')](respondWithFilteredResult(_0x7dc14b,_0x1d346c))['catch'](handleError(_0x7dc14b,null));};exports[_0x8881('0x41')]=function(_0x234bda,_0x1450a0){var _0x469637={'raw':![],'where':{'id':_0x234bda[_0x8881('0x42')]['id']}},_0x25b498={};_0x25b498[_0x8881('0x32')]=_[_0x8881('0x2f')](db[_0x8881('0x2a')][_0x8881('0x2b')]);_0x25b498[_0x8881('0x2e')]=_[_0x8881('0x2f')](_0x234bda[_0x8881('0x2e')]);_0x25b498['filters']=_[_0x8881('0x31')](_0x25b498[_0x8881('0x32')],_0x25b498[_0x8881('0x2e')]);_0x469637[_0x8881('0x33')]=_[_0x8881('0x31')](_0x25b498[_0x8881('0x32')],qs[_0x8881('0x34')](_0x234bda['query'][_0x8881('0x34')]));_0x469637['attributes']=_0x469637[_0x8881('0x33')][_0x8881('0x35')]?_0x469637[_0x8881('0x33')]:_0x25b498[_0x8881('0x32')];if(_0x234bda[_0x8881('0x2e')]['includeAll']){_0x469637[_0x8881('0x3f')]=[{'all':!![]}];}_0x469637=_['merge']({},_0x469637,_0x234bda['options']);return db[_0x8881('0x2a')][_0x8881('0x43')](_0x469637)[_0x8881('0x23')](handleEntityNotFound(_0x1450a0,null))['then'](respondWithResult(_0x1450a0,null))[_0x8881('0x44')](handleError(_0x1450a0,null));};exports[_0x8881('0x45')]=function(_0x3bc153,_0x55a1c0){return db[_0x8881('0x2a')][_0x8881('0x45')](_0x3bc153['body'],{})[_0x8881('0x23')](respondWithResult(_0x55a1c0,0xc9))[_0x8881('0x44')](handleError(_0x55a1c0,null));};exports['update']=function(_0x4697a6,_0x617480){if(_0x4697a6['body']['id']){delete _0x4697a6['body']['id'];}return db[_0x8881('0x2a')][_0x8881('0x43')]({'where':{'id':_0x4697a6['params']['id']}})[_0x8881('0x23')](handleEntityNotFound(_0x617480,null))[_0x8881('0x23')](saveUpdates(_0x4697a6[_0x8881('0x46')],null))[_0x8881('0x23')](respondWithResult(_0x617480,null))['catch'](handleError(_0x617480,null));};exports['destroy']=function(_0x4f1e97,_0x555598){return db[_0x8881('0x2a')][_0x8881('0x43')]({'where':{'id':_0x4f1e97[_0x8881('0x42')]['id']}})[_0x8881('0x23')](handleEntityNotFound(_0x555598,null))[_0x8881('0x23')](removeEntity(_0x555598,null))[_0x8881('0x44')](handleError(_0x555598,null));};exports[_0x8881('0x47')]=function(_0x17cd62,_0x5835d0,_0x159702){var _0x408d64={};var _0x484873={};var _0x320f79;var _0x5e0371;return db[_0x8881('0x2a')][_0x8881('0x48')]({'where':{'id':_0x17cd62[_0x8881('0x42')]['id']}})[_0x8881('0x23')](handleEntityNotFound(_0x5835d0,null))[_0x8881('0x23')](function(_0x25e0ff){if(_0x25e0ff){_0x320f79=_0x25e0ff;_0x484873[_0x8881('0x32')]=_['keys'](db[_0x8881('0x49')][_0x8881('0x2b')]);_0x484873[_0x8881('0x2e')]=_[_0x8881('0x2f')](_0x17cd62['query']);_0x484873[_0x8881('0x30')]=_['intersection'](_0x484873[_0x8881('0x32')],_0x484873[_0x8881('0x2e')]);_0x408d64[_0x8881('0x33')]=_[_0x8881('0x31')](_0x484873[_0x8881('0x32')],qs[_0x8881('0x34')](_0x17cd62[_0x8881('0x2e')][_0x8881('0x34')]));_0x408d64[_0x8881('0x33')]=_0x408d64[_0x8881('0x33')][_0x8881('0x35')]?_0x408d64[_0x8881('0x33')]:_0x484873[_0x8881('0x32')];_0x408d64[_0x8881('0x4a')]=qs[_0x8881('0x4b')](_0x17cd62['query'][_0x8881('0x4b')]);_0x408d64[_0x8881('0x38')]=qs[_0x8881('0x30')](_[_0x8881('0x39')](_0x17cd62[_0x8881('0x2e')],_0x484873['filters']));if(_0x17cd62[_0x8881('0x2e')][_0x8881('0x3a')]){_0x408d64[_0x8881('0x38')]=_[_0x8881('0x3b')](_0x408d64[_0x8881('0x38')],{'$or':_[_0x8881('0x29')](_0x408d64['attributes'],function(_0x39a76a){var _0x5be372={};_0x5be372[_0x39a76a]={'$like':'%'+_0x17cd62[_0x8881('0x2e')][_0x8881('0x3a')]+'%'};return _0x5be372;})});}_0x408d64=_[_0x8881('0x3b')]({},_0x408d64,_0x17cd62['options']);return _0x320f79[_0x8881('0x47')](_0x408d64);}})[_0x8881('0x23')](function(_0x183a4e){if(_0x183a4e){_0x5e0371=_0x183a4e[_0x8881('0x35')];if(!_0x17cd62[_0x8881('0x2e')][_0x8881('0x36')](_0x8881('0x37'))){_0x408d64[_0x8881('0x1a')]=qs[_0x8881('0x1a')](_0x17cd62['query'][_0x8881('0x1a')]);_0x408d64[_0x8881('0x1c')]=qs[_0x8881('0x1c')](_0x17cd62[_0x8881('0x2e')][_0x8881('0x1c')]);}return _0x320f79[_0x8881('0x47')](_0x408d64);}})['then'](function(_0x508025){if(_0x508025){return _0x508025?{'count':_0x5e0371,'rows':_0x508025}:null;}})[_0x8881('0x23')](respondWithResult(_0x5835d0,null))[_0x8881('0x44')](handleError(_0x5835d0,null));};exports['addConfiguration']=function(_0x459d93,_0x4b3076,_0x212a6b){if(_0x459d93['body']['id']){delete _0x459d93[_0x8881('0x46')]['id'];}return db['ServicenowAccount'][_0x8881('0x48')]({'where':{'id':_0x459d93[_0x8881('0x42')]['id']}})[_0x8881('0x23')](handleEntityNotFound(_0x4b3076,null))[_0x8881('0x23')](function(_0x2ab1c4){if(_0x2ab1c4){_0x459d93[_0x8881('0x46')][_0x8881('0x4c')]=_0x2ab1c4['id'];_0x459d93['body'][_0x8881('0x4d')]=integrations[_0x8881('0x4e')](_0x459d93['body']['channel'],_0x459d93[_0x8881('0x46')][_0x8881('0x2c')]);_0x459d93['body']['Descriptions']=integrations[_0x8881('0x4f')](_0x459d93[_0x8881('0x46')]['channel'],_0x459d93[_0x8881('0x46')]['type']);return db['ServicenowConfiguration'][_0x8881('0x45')](_0x459d93['body'],{'include':[{'model':db[_0x8881('0x50')],'as':_0x8881('0x4d')},{'model':db[_0x8881('0x50')],'as':_0x8881('0x51')}]});}return null;})[_0x8881('0x23')](respondWithResult(_0x4b3076,null))[_0x8881('0x44')](handleError(_0x4b3076,null));};exports['getFields']=function(_0x31af25,_0x2e1497,_0x3ee0af){var _0x563e2d=[_0x8881('0x52'),_0x8881('0x53'),'knowledge',_0x8881('0x54'),'close_code',_0x8881('0x55'),_0x8881('0x56'),_0x8881('0x57'),_0x8881('0x58')];var _0x298e4d=[_0x8881('0x59'),_0x8881('0x52'),_0x8881('0x5a'),_0x8881('0x5b'),_0x8881('0x5c'),_0x8881('0x5d'),_0x8881('0x5e'),'hold_reason',_0x8881('0x5f'),_0x8881('0x60'),_0x8881('0x61'),'sys_updated_by',_0x8881('0x62'),'user_input',_0x8881('0x63'),_0x8881('0x64'),_0x8881('0x65'),_0x8881('0x66'),_0x8881('0x67'),_0x8881('0x4a'),'calendar_stc','closed_at',_0x8881('0x68'),_0x8881('0x69'),'impact',_0x8881('0x6a'),_0x8881('0x6b'),_0x8881('0x6c'),_0x8881('0x6d'),_0x8881('0x6e'),_0x8881('0x6f'),_0x8881('0x70'),'expected_start','opened_at',_0x8881('0x71'),_0x8881('0x72'),_0x8881('0x73'),'reopened_time',_0x8881('0x74'),_0x8881('0x75'),_0x8881('0x76'),'subcategory',_0x8881('0x77'),_0x8881('0x78'),_0x8881('0x79'),_0x8881('0x7a'),_0x8881('0x7b'),'work_start',_0x8881('0x7c'),_0x8881('0x7d'),_0x8881('0x7e'),_0x8881('0x7f'),_0x8881('0x80'),'notify','sys_class_name',_0x8881('0x81'),_0x8881('0x82'),_0x8881('0x83'),_0x8881('0x84'),_0x8881('0x85'),'contact_type',_0x8881('0x86'),_0x8881('0x56'),_0x8881('0x87'),_0x8881('0x88'),'company',_0x8881('0x89'),_0x8881('0x8a'),_0x8881('0x8b'),_0x8881('0x57'),_0x8881('0x8c'),_0x8881('0x8d'),_0x8881('0x8e'),_0x8881('0x8f'),_0x8881('0x90'),'sys_mod_count','reopen_count',_0x8881('0x91'),_0x8881('0x92'),_0x8881('0x93'),'correlation_id',_0x8881('0x94'),_0x8881('0x58')];var _0x132647='';var _0x43d793='';var _0x117614=[];var _0x1e955b='';var _0x440351='';var _0x3f5520=[];var _0x3feab5='';var _0x3508d2='';var _0x1c5d7d={};var _0x141e7c='';return db[_0x8881('0x2a')][_0x8881('0x48')]({'where':{'id':_0x31af25[_0x8881('0x42')]['id']},'attributes':['id','username',_0x8881('0x95'),_0x8881('0x96'),_0x8881('0x97'),'serverUrl']})[_0x8881('0x23')](handleEntityNotFound(_0x2e1497,null))[_0x8881('0x23')](function(_0x2ba810){if(_0x2ba810){_0x141e7c=_0x2ba810[_0x8881('0x97')];var _0x517b0f=_0x141e7c[_0x8881('0x98')](-0x1);if(_0x517b0f==='/'){_0x141e7c=_0x141e7c[_0x8881('0x99')](0x0,_0x141e7c[_0x8881('0x9a')](_0x517b0f));}_0x3508d2=util[_0x8881('0x9b')](_0x8881('0x9c'),_0x141e7c);_0x3feab5=util[_0x8881('0x9b')](_0x8881('0x9d'),_0x141e7c);_0x1c5d7d={'user':_0x2ba810[_0x8881('0x9e')],'pass':_0x2ba810[_0x8881('0x95')]};var _0xa23de1={'method':'GET','uri':_0x3508d2+_0x8881('0x9f'),'auth':_0x1c5d7d,'json':!![]};return rp(_0xa23de1);}})[_0x8881('0x23')](function(_0x11be46){if(_0x11be46[_0x8881('0xa0')][_0x8881('0x35')]>0x0){_0x132647=_0x11be46[_0x8881('0xa0')];}console[_0x8881('0xa1')](_0x8881('0xa2'),_0x132647);_0x3f5520=[];_0x43d793=Object[_0x8881('0xa3')]([],_0x132647);_[_0x8881('0xa4')](_0x43d793,function(_0x2d9038){return!_0x563e2d[_0x8881('0xa5')](_0x2d9038[_0x8881('0x27')]);});_0x43d793[_0x8881('0xa6')](function(_0x1d8518){var _0x9394ab=createFieldObject(_0x3feab5,_0x1c5d7d,_0x1d8518[_0x8881('0xa7')],_0x1d8518[_0x8881('0x27')],_0x1d8518['label'],![]);_0x3f5520[_0x8881('0xa8')](_0x9394ab);});return Promise[_0x8881('0xa9')](_0x3f5520);})[_0x8881('0x23')](function(_0x5b3577){_0x117614=_0x5b3577;_0x1e955b=Object['assign']([],_0x132647);console[_0x8881('0xa1')](_0x8881('0xaa'),_0x132647);_[_0x8881('0xa4')](_0x1e955b,function(_0x2cf85e){return _0x298e4d[_0x8881('0xa5')](_0x2cf85e[_0x8881('0x27')]);});console[_0x8881('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1e955b);_0x3f5520=[];_0x1e955b['forEach'](function(_0x3d0031){var _0x445dd2=createFieldObject(_0x3feab5,_0x1c5d7d,_0x3d0031['internalType'],_0x3d0031[_0x8881('0x27')],_0x3d0031[_0x8881('0xab')],!![]);_0x3f5520[_0x8881('0xa8')](_0x445dd2);});return Promise[_0x8881('0xa9')](_0x3f5520);})[_0x8881('0x23')](function(_0x14ec29){_0x440351=_0x14ec29;var _0x83303e=_0x117614[_0x8881('0xac')](_0x440351);return{'count':_0x83303e[_0x8881('0x35')],'rows':_0x83303e};})['then'](respondWithResult(_0x2e1497,null))[_0x8881('0x44')](function(_0x99500){console['log'](_0x8881('0xad')+_0x99500);var _0x16257d=_0x31af25['query'][_0x8881('0xae')]?0x1f4:_0x99500[_0x8881('0xaf')]||0x1f4;logger['error'](_0x99500[_0x8881('0x26')]);delete _0x99500['name'];if(_0x16257d===0x191){_0x16257d=0x190;}_0x2e1497[_0x8881('0x16')](_0x16257d)[_0x8881('0x28')](_0x31af25[_0x8881('0x2e')][_0x8881('0xae')]?{'message':_0x8881('0xb0'),'statusCode':_0x99500[_0x8881('0xaf')]}:_0x99500);});};function createFieldObject(_0x178e85,_0x5d369e,_0x49c942,_0x3d62b0,_0x27b6a6,_0x3c9831){return new Promise(function(_0x575eba,_0x3c6e86){var _0x3cba81={'id':_0x3d62b0,'name':_0x27b6a6,'custom':_0x3c9831};if(_0x49c942==='boolean'){_0x3cba81[_0x8881('0x3d')]=[{'name':_0x8881('0xb1'),'value':'true'},{'name':_0x8881('0xb2'),'value':'false'}];_0x575eba(_0x3cba81);}else{var _0x3255b1={'method':_0x8881('0xb3'),'uri':_0x178e85+_0x8881('0xb4')+_0x3d62b0,'auth':_0x5d369e,'json':!![]};return rp(_0x3255b1)['then'](function(_0x6662c6){var _0x423e37=[];if(_0x6662c6[_0x8881('0xa0')][_0x8881('0x35')]>0x0){_0x6662c6[_0x8881('0xa0')][_0x8881('0xa6')](function(_0x447494){if(_0x447494[_0x8881('0xb5')]===_0x8881('0xb6')){var _0x446599={'name':_0x447494[_0x8881('0xab')],'value':_0x447494['value']};_0x423e37[_0x8881('0xa8')](_0x446599);}});}_0x3cba81[_0x8881('0x3d')]=_0x423e37;if(_0x3cba81['options']['length']>0x0){_0x575eba(_0x3cba81);}else{if(_0x3c9831==![]){_0x575eba();}else{_0x575eba(_0x3cba81);}}});}});} \ No newline at end of file +var _0x39ac=['delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','correlation_id','location','username','password','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/table/','incident?sysparm_display_value=all','result','log','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','index','ServicenowAccount','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','findOne','ServicenowConfiguration','map','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','incident_state','category','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','correlation_display'];(function(_0x1eaced,_0x5987b9){var _0x4b5bcd=function(_0x39889e){while(--_0x39889e){_0x1eaced['push'](_0x1eaced['shift']());}};_0x4b5bcd(++_0x5987b9);}(_0x39ac,0xe9));var _0xc39a=function(_0x181b98,_0xb45686){_0x181b98=_0x181b98-0x0;var _0x319a5d=_0x39ac[_0x181b98];return _0x319a5d;};'use strict';var emlformat=require(_0xc39a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc39a('0x1'));var jsonpatch=require(_0xc39a('0x2'));var rp=require(_0xc39a('0x3'));var moment=require(_0xc39a('0x4'));var BPromise=require(_0xc39a('0x5'));var Mustache=require(_0xc39a('0x6'));var util=require(_0xc39a('0x7'));var path=require('path');var sox=require(_0xc39a('0x8'));var csv=require(_0xc39a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc39a('0xa'));var _=require('lodash');var squel=require(_0xc39a('0xb'));var crypto=require('crypto');var jsforce=require(_0xc39a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc39a('0xd'));var Papa=require(_0xc39a('0xe'));var Redis=require(_0xc39a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc39a('0x10'));var as=require(_0xc39a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc39a('0x12'))(_0xc39a('0x13'));var utils=require(_0xc39a('0x14'));var config=require(_0xc39a('0x15'));var licenseUtil=require(_0xc39a('0x16'));var db=require(_0xc39a('0x17'))['db'];var integrations=require(_0xc39a('0x18'));function respondWithStatusCode(_0xbf200d,_0x51d27d){_0x51d27d=_0x51d27d||0xcc;return function(_0x32d8cb){if(_0x32d8cb){return _0xbf200d[_0xc39a('0x19')](_0x51d27d);}return _0xbf200d[_0xc39a('0x1a')](_0x51d27d)[_0xc39a('0x1b')]();};}function respondWithResult(_0xdd14d1,_0xde0aa4){_0xde0aa4=_0xde0aa4||0xc8;return function(_0x34718f){if(_0x34718f){return _0xdd14d1[_0xc39a('0x1a')](_0xde0aa4)[_0xc39a('0x1c')](_0x34718f);}};}function respondWithFilteredResult(_0x15ab81,_0x30fec9){return function(_0x3785aa){if(_0x3785aa){var _0x184fa3=typeof _0x30fec9[_0xc39a('0x1d')]===_0xc39a('0x1e')&&typeof _0x30fec9[_0xc39a('0x1f')]===_0xc39a('0x1e');var _0x2d1b22=_0x3785aa[_0xc39a('0x20')];var _0x52a823=_0x184fa3?0x0:_0x30fec9[_0xc39a('0x1d')];var _0x21083b=_0x184fa3?_0x3785aa[_0xc39a('0x20')]:_0x30fec9[_0xc39a('0x1d')]+_0x30fec9[_0xc39a('0x1f')];var _0x32e300;if(_0x21083b>=_0x2d1b22){_0x21083b=_0x2d1b22;_0x32e300=0xc8;}else{_0x32e300=0xce;}_0x15ab81['status'](_0x32e300);return _0x15ab81['set']('Content-Range',_0x52a823+'-'+_0x21083b+'/'+_0x2d1b22)['json'](_0x3785aa);}return null;};}function patchUpdates(_0x3256ae){return function(_0x15dedb){try{jsonpatch[_0xc39a('0x21')](_0x15dedb,_0x3256ae,!![]);}catch(_0x2e3db3){return BPromise[_0xc39a('0x22')](_0x2e3db3);}return _0x15dedb[_0xc39a('0x23')]();};}function saveUpdates(_0x1d9334,_0x260724){return function(_0x3c846e){if(_0x3c846e){return _0x3c846e[_0xc39a('0x24')](_0x1d9334)[_0xc39a('0x25')](function(_0x23bb20){return _0x23bb20;});}return null;};}function removeEntity(_0x2c96da,_0x26127f){return function(_0x2d08c7){if(_0x2d08c7){return _0x2d08c7['destroy']()[_0xc39a('0x25')](function(){_0x2c96da['status'](0xcc)[_0xc39a('0x1b')]();});}};}function handleEntityNotFound(_0x2d1e83,_0x5ecdbe){return function(_0x227842){if(!_0x227842){_0x2d1e83[_0xc39a('0x19')](0x194);}return _0x227842;};}function handleError(_0x4703d3,_0x526f07){_0x526f07=_0x526f07||0x1f4;return function(_0x3287ab){logger[_0xc39a('0x26')](_0x3287ab[_0xc39a('0x27')]);if(_0x3287ab[_0xc39a('0x28')]){delete _0x3287ab[_0xc39a('0x28')];}_0x4703d3[_0xc39a('0x1a')](_0x526f07)['send'](_0x3287ab);};}exports[_0xc39a('0x29')]=function(_0xbf2b5a,_0x3873aa){var _0x5b39e6={},_0xbdff3a={},_0x143f18={'count':0x0,'rows':[]};var _0x3d9b55=_['map'](db[_0xc39a('0x2a')][_0xc39a('0x2b')],function(_0x337911){return{'name':_0x337911['fieldName'],'type':_0x337911[_0xc39a('0x2c')][_0xc39a('0x2d')]};});_0xbdff3a['model']=_['map'](_0x3d9b55,_0xc39a('0x28'));_0xbdff3a[_0xc39a('0x2e')]=_[_0xc39a('0x2f')](_0xbf2b5a[_0xc39a('0x2e')]);_0xbdff3a[_0xc39a('0x30')]=_['intersection'](_0xbdff3a['model'],_0xbdff3a[_0xc39a('0x2e')]);_0x5b39e6[_0xc39a('0x31')]=_[_0xc39a('0x32')](_0xbdff3a[_0xc39a('0x33')],qs[_0xc39a('0x34')](_0xbf2b5a['query']['fields']));_0x5b39e6[_0xc39a('0x31')]=_0x5b39e6['attributes'][_0xc39a('0x35')]?_0x5b39e6[_0xc39a('0x31')]:_0xbdff3a[_0xc39a('0x33')];if(!_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x36')]('nolimit')){_0x5b39e6[_0xc39a('0x1f')]=qs['limit'](_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x1f')]);_0x5b39e6[_0xc39a('0x1d')]=qs[_0xc39a('0x1d')](_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x1d')]);}_0x5b39e6[_0xc39a('0x37')]=qs[_0xc39a('0x38')](_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x38')]);_0x5b39e6[_0xc39a('0x39')]=qs[_0xc39a('0x30')](_[_0xc39a('0x3a')](_0xbf2b5a['query'],_0xbdff3a[_0xc39a('0x30')]),_0x3d9b55);if(_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x3b')]){_0x5b39e6[_0xc39a('0x39')]=_[_0xc39a('0x3c')](_0x5b39e6[_0xc39a('0x39')],{'$or':_['map'](_0x3d9b55,function(_0x5c01dc){if(_0x5c01dc[_0xc39a('0x2c')]!==_0xc39a('0x3d')){var _0x241b25={};_0x241b25[_0x5c01dc[_0xc39a('0x28')]]={'$like':'%'+_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x3b')]+'%'};return _0x241b25;}})});}_0x5b39e6=_['merge']({},_0x5b39e6,_0xbf2b5a[_0xc39a('0x3e')]);var _0x4ff5e0={'where':_0x5b39e6[_0xc39a('0x39')]};return db[_0xc39a('0x2a')][_0xc39a('0x20')](_0x4ff5e0)['then'](function(_0xef886e){_0x143f18[_0xc39a('0x20')]=_0xef886e;if(_0xbf2b5a[_0xc39a('0x2e')][_0xc39a('0x3f')]){_0x5b39e6[_0xc39a('0x40')]=[{'all':!![]}];}return db[_0xc39a('0x2a')][_0xc39a('0x41')](_0x5b39e6);})[_0xc39a('0x25')](function(_0x57fac2){_0x143f18[_0xc39a('0x42')]=_0x57fac2;return _0x143f18;})[_0xc39a('0x25')](respondWithFilteredResult(_0x3873aa,_0x5b39e6))['catch'](handleError(_0x3873aa,null));};exports[_0xc39a('0x43')]=function(_0x3291b3,_0x611e28){var _0x20985={'raw':![],'where':{'id':_0x3291b3[_0xc39a('0x44')]['id']}},_0x207676={};_0x207676[_0xc39a('0x33')]=_[_0xc39a('0x2f')](db['ServicenowAccount']['rawAttributes']);_0x207676[_0xc39a('0x2e')]=_[_0xc39a('0x2f')](_0x3291b3[_0xc39a('0x2e')]);_0x207676[_0xc39a('0x30')]=_[_0xc39a('0x32')](_0x207676[_0xc39a('0x33')],_0x207676[_0xc39a('0x2e')]);_0x20985['attributes']=_[_0xc39a('0x32')](_0x207676[_0xc39a('0x33')],qs['fields'](_0x3291b3[_0xc39a('0x2e')][_0xc39a('0x34')]));_0x20985['attributes']=_0x20985['attributes'][_0xc39a('0x35')]?_0x20985['attributes']:_0x207676['model'];if(_0x3291b3[_0xc39a('0x2e')][_0xc39a('0x3f')]){_0x20985[_0xc39a('0x40')]=[{'all':!![]}];}_0x20985=_[_0xc39a('0x3c')]({},_0x20985,_0x3291b3['options']);return db['ServicenowAccount']['find'](_0x20985)['then'](handleEntityNotFound(_0x611e28,null))[_0xc39a('0x25')](respondWithResult(_0x611e28,null))[_0xc39a('0x45')](handleError(_0x611e28,null));};exports[_0xc39a('0x46')]=function(_0x5e7281,_0x1a1769){return db[_0xc39a('0x2a')][_0xc39a('0x46')](_0x5e7281['body'],{})[_0xc39a('0x25')](respondWithResult(_0x1a1769,0xc9))[_0xc39a('0x45')](handleError(_0x1a1769,null));};exports[_0xc39a('0x24')]=function(_0x14766e,_0x247fc3){if(_0x14766e[_0xc39a('0x47')]['id']){delete _0x14766e[_0xc39a('0x47')]['id'];}return db['ServicenowAccount'][_0xc39a('0x48')]({'where':{'id':_0x14766e[_0xc39a('0x44')]['id']}})[_0xc39a('0x25')](handleEntityNotFound(_0x247fc3,null))[_0xc39a('0x25')](saveUpdates(_0x14766e[_0xc39a('0x47')],null))['then'](respondWithResult(_0x247fc3,null))['catch'](handleError(_0x247fc3,null));};exports['destroy']=function(_0x3b59a3,_0x3aa553){return db[_0xc39a('0x2a')]['find']({'where':{'id':_0x3b59a3[_0xc39a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aa553,null))[_0xc39a('0x25')](removeEntity(_0x3aa553,null))[_0xc39a('0x45')](handleError(_0x3aa553,null));};exports[_0xc39a('0x49')]=function(_0x4144c0,_0x1215e6,_0x201e6a){var _0x5eec08={};var _0x56dd34={};var _0x67d44;var _0x4fc167;return db[_0xc39a('0x2a')][_0xc39a('0x4a')]({'where':{'id':_0x4144c0[_0xc39a('0x44')]['id']}})[_0xc39a('0x25')](handleEntityNotFound(_0x1215e6,null))[_0xc39a('0x25')](function(_0x488fa7){if(_0x488fa7){_0x67d44=_0x488fa7;_0x56dd34[_0xc39a('0x33')]=_[_0xc39a('0x2f')](db[_0xc39a('0x4b')][_0xc39a('0x2b')]);_0x56dd34[_0xc39a('0x2e')]=_[_0xc39a('0x2f')](_0x4144c0['query']);_0x56dd34[_0xc39a('0x30')]=_['intersection'](_0x56dd34[_0xc39a('0x33')],_0x56dd34[_0xc39a('0x2e')]);_0x5eec08[_0xc39a('0x31')]=_[_0xc39a('0x32')](_0x56dd34[_0xc39a('0x33')],qs[_0xc39a('0x34')](_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x34')]));_0x5eec08['attributes']=_0x5eec08[_0xc39a('0x31')][_0xc39a('0x35')]?_0x5eec08['attributes']:_0x56dd34[_0xc39a('0x33')];_0x5eec08[_0xc39a('0x37')]=qs[_0xc39a('0x38')](_0x4144c0[_0xc39a('0x2e')]['sort']);_0x5eec08['where']=qs[_0xc39a('0x30')](_[_0xc39a('0x3a')](_0x4144c0['query'],_0x56dd34[_0xc39a('0x30')]));if(_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x3b')]){_0x5eec08[_0xc39a('0x39')]=_[_0xc39a('0x3c')](_0x5eec08['where'],{'$or':_[_0xc39a('0x4c')](_0x5eec08[_0xc39a('0x31')],function(_0x555ed8){var _0x3a7ef3={};_0x3a7ef3[_0x555ed8]={'$like':'%'+_0x4144c0[_0xc39a('0x2e')]['filter']+'%'};return _0x3a7ef3;})});}_0x5eec08=_['merge']({},_0x5eec08,_0x4144c0[_0xc39a('0x3e')]);return _0x67d44[_0xc39a('0x49')](_0x5eec08);}})[_0xc39a('0x25')](function(_0x59e521){if(_0x59e521){_0x4fc167=_0x59e521['length'];if(!_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x36')](_0xc39a('0x4d'))){_0x5eec08[_0xc39a('0x1f')]=qs['limit'](_0x4144c0[_0xc39a('0x2e')]['limit']);_0x5eec08[_0xc39a('0x1d')]=qs[_0xc39a('0x1d')](_0x4144c0[_0xc39a('0x2e')][_0xc39a('0x1d')]);}return _0x67d44[_0xc39a('0x49')](_0x5eec08);}})[_0xc39a('0x25')](function(_0x1b71e3){if(_0x1b71e3){return _0x1b71e3?{'count':_0x4fc167,'rows':_0x1b71e3}:null;}})[_0xc39a('0x25')](respondWithResult(_0x1215e6,null))[_0xc39a('0x45')](handleError(_0x1215e6,null));};exports[_0xc39a('0x4e')]=function(_0x41da93,_0x549d10,_0x4f069f){if(_0x41da93[_0xc39a('0x47')]['id']){delete _0x41da93['body']['id'];}return db[_0xc39a('0x2a')]['findOne']({'where':{'id':_0x41da93[_0xc39a('0x44')]['id']}})[_0xc39a('0x25')](handleEntityNotFound(_0x549d10,null))[_0xc39a('0x25')](function(_0x2d86cd){if(_0x2d86cd){_0x41da93['body']['AccountId']=_0x2d86cd['id'];_0x41da93['body'][_0xc39a('0x4f')]=integrations[_0xc39a('0x50')](_0x41da93['body'][_0xc39a('0x51')],_0x41da93[_0xc39a('0x47')]['type']);_0x41da93[_0xc39a('0x47')][_0xc39a('0x52')]=integrations['getDescriptions'](_0x41da93['body'][_0xc39a('0x51')],_0x41da93['body'][_0xc39a('0x2c')]);return db[_0xc39a('0x4b')]['create'](_0x41da93[_0xc39a('0x47')],{'include':[{'model':db[_0xc39a('0x53')],'as':'Subjects'},{'model':db[_0xc39a('0x53')],'as':_0xc39a('0x52')}]});}return null;})['then'](respondWithResult(_0x549d10,null))[_0xc39a('0x45')](handleError(_0x549d10,null));};exports['getFields']=function(_0x3017e0,_0x345118,_0x9897cf){var _0x38c49c=[_0xc39a('0x54'),_0xc39a('0x55'),'knowledge',_0xc39a('0x56'),_0xc39a('0x57'),'notify',_0xc39a('0x58'),'severity',_0xc39a('0x59')];var _0x1b09d7=[_0xc39a('0x5a'),_0xc39a('0x54'),'caused_by','watch_list',_0xc39a('0x5b'),_0xc39a('0x5c'),_0xc39a('0x5d'),_0xc39a('0x55'),_0xc39a('0x5e'),_0xc39a('0x5f'),_0xc39a('0x60'),_0xc39a('0x61'),_0xc39a('0x62'),_0xc39a('0x63'),'sys_created_on',_0xc39a('0x64'),'state',_0xc39a('0x65'),_0xc39a('0x66'),_0xc39a('0x37'),_0xc39a('0x67'),_0xc39a('0x68'),_0xc39a('0x69'),_0xc39a('0x6a'),_0xc39a('0x6b'),_0xc39a('0x6c'),_0xc39a('0x6d'),_0xc39a('0x6e'),'priority',_0xc39a('0x6f'),_0xc39a('0x70'),_0xc39a('0x71'),'expected_start',_0xc39a('0x72'),_0xc39a('0x73'),_0xc39a('0x74'),_0xc39a('0x75'),'reopened_time',_0xc39a('0x76'),_0xc39a('0x77'),_0xc39a('0x78'),_0xc39a('0x56'),_0xc39a('0x79'),'short_description',_0xc39a('0x57'),_0xc39a('0x7a'),_0xc39a('0x7b'),_0xc39a('0x7c'),_0xc39a('0x7d'),_0xc39a('0x7e'),'additional_assignee_list',_0xc39a('0x7f'),_0xc39a('0x80'),'notify',_0xc39a('0x81'),_0xc39a('0x82'),_0xc39a('0x83'),_0xc39a('0x84'),'parent_incident',_0xc39a('0x85'),_0xc39a('0x86'),_0xc39a('0x87'),_0xc39a('0x58'),_0xc39a('0x88'),_0xc39a('0x89'),_0xc39a('0x8a'),'reassignment_count',_0xc39a('0x8b'),_0xc39a('0x8c'),'severity',_0xc39a('0x8d'),'sla_due',_0xc39a('0x8e'),_0xc39a('0x8f'),_0xc39a('0x90'),_0xc39a('0x91'),_0xc39a('0x92'),'sys_tags','escalation','upon_approval',_0xc39a('0x93'),_0xc39a('0x94'),_0xc39a('0x59')];var _0x1e2ec8='';var _0x131c9d='';var _0x5080ce=[];var _0x302155='';var _0x4ac05b='';var _0x5553c4=[];var _0x3acd9f='';var _0x56b1f7='';var _0x29c8e9={};var _0x1a4482='';return db[_0xc39a('0x2a')][_0xc39a('0x4a')]({'where':{'id':_0x3017e0['params']['id']},'attributes':['id',_0xc39a('0x95'),_0xc39a('0x96'),'email',_0xc39a('0x97'),_0xc39a('0x98')]})[_0xc39a('0x25')](handleEntityNotFound(_0x345118,null))[_0xc39a('0x25')](function(_0x50d847){if(_0x50d847){_0x1a4482=_0x50d847['remoteUri'];var _0x3dde2d=_0x1a4482['slice'](-0x1);if(_0x3dde2d==='/'){_0x1a4482=_0x1a4482[_0xc39a('0x99')](0x0,_0x1a4482[_0xc39a('0x9a')](_0x3dde2d));}_0x56b1f7=util['format']('%s/api/now/doc/table/schema/',_0x1a4482);_0x3acd9f=util['format'](_0xc39a('0x9b'),_0x1a4482);_0x29c8e9={'user':_0x50d847['username'],'pass':_0x50d847[_0xc39a('0x96')]};var _0x108784={'method':'GET','uri':_0x56b1f7+_0xc39a('0x9c'),'auth':_0x29c8e9,'json':!![]};return rp(_0x108784);}})[_0xc39a('0x25')](function(_0x570fa1){if(_0x570fa1['result'][_0xc39a('0x35')]>0x0){_0x1e2ec8=_0x570fa1[_0xc39a('0x9d')];}console[_0xc39a('0x9e')]('incident\x20table\x20objects',_0x1e2ec8);_0x5553c4=[];_0x131c9d=Object['assign']([],_0x1e2ec8);_[_0xc39a('0x9f')](_0x131c9d,function(_0x1f8a54){return!_0x38c49c['includes'](_0x1f8a54[_0xc39a('0x28')]);});_0x131c9d[_0xc39a('0xa0')](function(_0x404031){var _0x30af2f=createFieldObject(_0x3acd9f,_0x29c8e9,_0x404031[_0xc39a('0xa1')],_0x404031[_0xc39a('0x28')],_0x404031[_0xc39a('0xa2')],![]);_0x5553c4[_0xc39a('0xa3')](_0x30af2f);});return Promise[_0xc39a('0xa4')](_0x5553c4);})['then'](function(_0x5613c1){_0x5080ce=_0x5613c1;_0x302155=Object['assign']([],_0x1e2ec8);console[_0xc39a('0x9e')](_0xc39a('0xa5'),_0x1e2ec8);_[_0xc39a('0x9f')](_0x302155,function(_0x3d0d78){return _0x1b09d7[_0xc39a('0xa6')](_0x3d0d78[_0xc39a('0x28')]);});console[_0xc39a('0x9e')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x302155);_0x5553c4=[];_0x302155[_0xc39a('0xa0')](function(_0x5b4347){var _0x4af095=createFieldObject(_0x3acd9f,_0x29c8e9,_0x5b4347[_0xc39a('0xa1')],_0x5b4347['name'],_0x5b4347[_0xc39a('0xa2')],!![]);_0x5553c4[_0xc39a('0xa3')](_0x4af095);});return Promise['all'](_0x5553c4);})['then'](function(_0x51e56c){_0x4ac05b=_0x51e56c;var _0x570ab3=_0x5080ce[_0xc39a('0xa7')](_0x4ac05b);return{'count':_0x570ab3[_0xc39a('0x35')],'rows':_0x570ab3};})[_0xc39a('0x25')](respondWithResult(_0x345118,null))[_0xc39a('0x45')](function(_0xaba8e1){console[_0xc39a('0x9e')](_0xc39a('0xa8')+_0xaba8e1);var _0xcddfcc=_0x3017e0[_0xc39a('0x2e')]['test']?0x1f4:_0xaba8e1[_0xc39a('0xa9')]||0x1f4;logger[_0xc39a('0x26')](_0xaba8e1[_0xc39a('0x27')]);delete _0xaba8e1[_0xc39a('0x28')];if(_0xcddfcc===0x191){_0xcddfcc=0x190;}_0x345118['status'](_0xcddfcc)[_0xc39a('0xaa')](_0x3017e0[_0xc39a('0x2e')]['test']?{'message':_0xc39a('0xab'),'statusCode':_0xaba8e1[_0xc39a('0xa9')]}:_0xaba8e1);});};function createFieldObject(_0x1b1cc2,_0x3d4448,_0x31b854,_0x2bb8ed,_0x159e40,_0x20ec6a){return new Promise(function(_0x2e07a1,_0x2098c3){var _0x49ade2={'id':_0x2bb8ed,'name':_0x159e40,'custom':_0x20ec6a};if(_0x31b854==='boolean'){_0x49ade2[_0xc39a('0x3e')]=[{'name':'True','value':_0xc39a('0xac')},{'name':_0xc39a('0xad'),'value':_0xc39a('0xae')}];_0x2e07a1(_0x49ade2);}else{var _0x239d31={'method':_0xc39a('0xaf'),'uri':_0x1b1cc2+_0xc39a('0xb0')+_0x2bb8ed,'auth':_0x3d4448,'json':!![]};return rp(_0x239d31)[_0xc39a('0x25')](function(_0x2ce6d3){var _0x44a5dc=[];if(_0x2ce6d3['result'][_0xc39a('0x35')]>0x0){_0x2ce6d3[_0xc39a('0x9d')][_0xc39a('0xa0')](function(_0xbb551f){if(_0xbb551f['inactive']==='false'){var _0x510674={'name':_0xbb551f[_0xc39a('0xa2')],'value':_0xbb551f[_0xc39a('0xb1')]};_0x44a5dc['push'](_0x510674);}});}_0x49ade2[_0xc39a('0x3e')]=_0x44a5dc;if(_0x49ade2[_0xc39a('0x3e')]['length']>0x0){_0x2e07a1(_0x49ade2);}else{if(_0x20ec6a==![]){_0x2e07a1();}else{_0x2e07a1(_0x49ade2);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index b007a25..25e42d0 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 _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0xb0656e,_0xaa6992){var _0x26a122=function(_0x26748f){while(--_0x26748f){_0xb0656e['push'](_0xb0656e['shift']());}};_0x26a122(++_0xaa6992);}(_0xb138,0x1dd));var _0x8b13=function(_0x55f780,_0x23ac49){_0x55f780=_0x55f780-0x0;var _0x52c368=_0xb138[_0x55f780];return _0x52c368;};'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 +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0x7a54,0x106));var _0x47a5=function(_0x5d57bc,_0x41c13c){_0x5d57bc=_0x5d57bc-0x0;var _0x5b63bf=_0x7a54[_0x5d57bc];return _0x5b63bf;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 17c3be1..882a0eb 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 _0xf66a=['find','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','map','include','model','stringify','catch','ShowServicenowAccount'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0xf66a,0xa6));var _0xaf66=function(_0x20a719,_0x10e9dd){_0x20a719=_0x20a719-0x0;var _0x454946=_0xf66a[_0x20a719];return _0x454946;};'use strict';var _=require('lodash');var util=require(_0xaf66('0x0'));var moment=require(_0xaf66('0x1'));var BPromise=require('bluebird');var rs=require(_0xaf66('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf66('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xaf66('0x4'));var jayson=require(_0xaf66('0x5'));var client=jayson[_0xaf66('0x6')][_0xaf66('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x259953,_0xfeb1de,_0x258d09){return new BPromise(function(_0x1ec847,_0x19efa0){return client[_0xaf66('0x8')](_0x259953,_0x258d09)[_0xaf66('0x9')](function(_0x44b203){logger['info'](_0xaf66('0xa'),_0xfeb1de,'request\x20sent');logger[_0xaf66('0xb')](_0xaf66('0xc'),_0xfeb1de,'request\x20sent',JSON['stringify'](_0x44b203));if(_0x44b203[_0xaf66('0xd')]){if(_0x44b203[_0xaf66('0xd')][_0xaf66('0xe')]===0x1f4){logger[_0xaf66('0xd')](_0xaf66('0xa'),_0xfeb1de,_0x44b203[_0xaf66('0xd')][_0xaf66('0xf')]);return _0x19efa0(_0x44b203['error'][_0xaf66('0xf')]);}logger['error'](_0xaf66('0xa'),_0xfeb1de,_0x44b203[_0xaf66('0xd')][_0xaf66('0xf')]);return _0x1ec847(_0x44b203[_0xaf66('0xd')][_0xaf66('0xf')]);}else{logger[_0xaf66('0x10')](_0xaf66('0xa'),_0xfeb1de,_0xaf66('0x11'));_0x1ec847(_0x44b203[_0xaf66('0x12')][_0xaf66('0xf')]);}})['catch'](function(_0x5e8de4){logger[_0xaf66('0xd')](_0xaf66('0xa'),_0xfeb1de,_0x5e8de4);_0x19efa0(_0x5e8de4);});});}exports[_0xaf66('0x13')]=function(_0x319790){var _0x5e4c47=this;return new Promise(function(_0x379a0d,_0x2b3c31){return db[_0xaf66('0x14')][_0xaf66('0x15')]({'raw':_0x319790[_0xaf66('0x16')]?_0x319790[_0xaf66('0x16')][_0xaf66('0x17')]===undefined?!![]:![]:!![],'where':_0x319790[_0xaf66('0x16')]?_0x319790[_0xaf66('0x16')][_0xaf66('0x18')]||null:null,'attributes':_0x319790[_0xaf66('0x16')]?_0x319790[_0xaf66('0x16')][_0xaf66('0x19')]||null:null,'limit':_0x319790[_0xaf66('0x16')]?_0x319790[_0xaf66('0x16')]['limit']||null:null,'include':_0x319790[_0xaf66('0x16')]?_0x319790[_0xaf66('0x16')]['include']?_[_0xaf66('0x1a')](_0x319790[_0xaf66('0x16')][_0xaf66('0x1b')],function(_0x2dfe8f){return{'model':db[_0x2dfe8f[_0xaf66('0x1c')]],'as':_0x2dfe8f['as'],'attributes':_0x2dfe8f[_0xaf66('0x19')],'include':_0x2dfe8f[_0xaf66('0x1b')]?_[_0xaf66('0x1a')](_0x2dfe8f[_0xaf66('0x1b')],function(_0x2f6b87){return{'model':db[_0x2f6b87[_0xaf66('0x1c')]],'as':_0x2f6b87['as'],'attributes':_0x2f6b87[_0xaf66('0x19')],'include':_0x2f6b87[_0xaf66('0x1b')]?_[_0xaf66('0x1a')](_0x2f6b87['include'],function(_0x1f4101){return{'model':db[_0x1f4101[_0xaf66('0x1c')]],'as':_0x1f4101['as'],'attributes':_0x1f4101[_0xaf66('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaf66('0x9')](function(_0x1ec4b6){logger[_0xaf66('0x10')](_0xaf66('0x13'),_0x319790);logger[_0xaf66('0xb')](_0xaf66('0x13'),_0x319790,JSON[_0xaf66('0x1d')](_0x1ec4b6));_0x379a0d(_0x1ec4b6);})[_0xaf66('0x1e')](function(_0x431a43){logger['error'](_0xaf66('0x13'),_0x431a43[_0xaf66('0xf')],_0x319790);_0x2b3c31(_0x5e4c47['error'](0x1f4,_0x431a43[_0xaf66('0xf')]));});});};exports[_0xaf66('0x1f')]=function(_0x4905d3){var _0x51f9d3=this;return new Promise(function(_0x37e372,_0x4ce5e6){return db[_0xaf66('0x14')][_0xaf66('0x20')]({'raw':_0x4905d3[_0xaf66('0x16')]?_0x4905d3[_0xaf66('0x16')][_0xaf66('0x17')]===undefined?!![]:![]:!![],'where':_0x4905d3[_0xaf66('0x16')]?_0x4905d3['options'][_0xaf66('0x18')]||null:null,'attributes':_0x4905d3[_0xaf66('0x16')]?_0x4905d3[_0xaf66('0x16')][_0xaf66('0x19')]||null:null,'include':_0x4905d3[_0xaf66('0x16')]?_0x4905d3[_0xaf66('0x16')][_0xaf66('0x1b')]?_[_0xaf66('0x1a')](_0x4905d3[_0xaf66('0x16')][_0xaf66('0x1b')],function(_0x5230eb){return{'model':db[_0x5230eb[_0xaf66('0x1c')]],'as':_0x5230eb['as'],'attributes':_0x5230eb[_0xaf66('0x19')],'include':_0x5230eb['include']?_[_0xaf66('0x1a')](_0x5230eb[_0xaf66('0x1b')],function(_0x289f99){return{'model':db[_0x289f99['model']],'as':_0x289f99['as'],'attributes':_0x289f99['attributes'],'include':_0x289f99[_0xaf66('0x1b')]?_[_0xaf66('0x1a')](_0x289f99['include'],function(_0x39d922){return{'model':db[_0x39d922[_0xaf66('0x1c')]],'as':_0x39d922['as'],'attributes':_0x39d922[_0xaf66('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaf66('0x9')](function(_0x1d7958){logger['info'](_0xaf66('0x1f'),_0x4905d3);logger[_0xaf66('0xb')](_0xaf66('0x1f'),_0x4905d3,JSON[_0xaf66('0x1d')](_0x1d7958));_0x37e372(_0x1d7958);})[_0xaf66('0x1e')](function(_0x947ab3){logger[_0xaf66('0xd')](_0xaf66('0x1f'),_0x947ab3[_0xaf66('0xf')],_0x4905d3);_0x4ce5e6(_0x51f9d3[_0xaf66('0xd')](0x1f4,_0x947ab3[_0xaf66('0xf')]));});});}; \ No newline at end of file +var _0x1f99=['result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','stringify','ShowServicenowAccount','ServicenowAccount','find','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x45500d,_0x28f732){var _0x4171d4=function(_0x311a6f){while(--_0x311a6f){_0x45500d['push'](_0x45500d['shift']());}};_0x4171d4(++_0x28f732);}(_0x1f99,0x70));var _0x91f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f99[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91f9('0x0'));var util=require('util');var moment=require(_0x91f9('0x1'));var BPromise=require(_0x91f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x91f9('0x3'))(_0x91f9('0x4'));var config=require(_0x91f9('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36f55b,_0x18d531,_0x23faac){return new BPromise(function(_0x1c292f,_0x40954a){return client[_0x91f9('0x6')](_0x36f55b,_0x23faac)[_0x91f9('0x7')](function(_0x2bcbdd){logger[_0x91f9('0x8')](_0x91f9('0x9'),_0x18d531,_0x91f9('0xa'));logger[_0x91f9('0xb')](_0x91f9('0xc'),_0x18d531,'request\x20sent',JSON['stringify'](_0x2bcbdd));if(_0x2bcbdd[_0x91f9('0xd')]){if(_0x2bcbdd[_0x91f9('0xd')][_0x91f9('0xe')]===0x1f4){logger[_0x91f9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x18d531,_0x2bcbdd[_0x91f9('0xd')][_0x91f9('0xf')]);return _0x40954a(_0x2bcbdd['error']['message']);}logger[_0x91f9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x18d531,_0x2bcbdd[_0x91f9('0xd')]['message']);return _0x1c292f(_0x2bcbdd['error'][_0x91f9('0xf')]);}else{logger[_0x91f9('0x8')](_0x91f9('0x9'),_0x18d531,_0x91f9('0xa'));_0x1c292f(_0x2bcbdd[_0x91f9('0x10')]['message']);}})[_0x91f9('0x11')](function(_0x446176){logger[_0x91f9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x18d531,_0x446176);_0x40954a(_0x446176);});});}exports['GetServicenowAccount']=function(_0x4dc2ef){var _0x87259b=this;return new Promise(function(_0x1afad1,_0x54bc87){return db['ServicenowAccount'][_0x91f9('0x12')]({'raw':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x14')]===undefined?!![]:![]:!![],'where':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x15')]||null:null,'attributes':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x16')]||null:null,'limit':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x17')]||null:null,'include':_0x4dc2ef[_0x91f9('0x13')]?_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x18')]?_[_0x91f9('0x19')](_0x4dc2ef[_0x91f9('0x13')][_0x91f9('0x18')],function(_0x3ca44f){return{'model':db[_0x3ca44f['model']],'as':_0x3ca44f['as'],'attributes':_0x3ca44f['attributes'],'include':_0x3ca44f[_0x91f9('0x18')]?_['map'](_0x3ca44f[_0x91f9('0x18')],function(_0x4fd7a0){return{'model':db[_0x4fd7a0[_0x91f9('0x1a')]],'as':_0x4fd7a0['as'],'attributes':_0x4fd7a0['attributes'],'include':_0x4fd7a0[_0x91f9('0x18')]?_[_0x91f9('0x19')](_0x4fd7a0[_0x91f9('0x18')],function(_0x58b7e6){return{'model':db[_0x58b7e6[_0x91f9('0x1a')]],'as':_0x58b7e6['as'],'attributes':_0x58b7e6[_0x91f9('0x16')]};}):[]};}):[]};}):[]:[]})[_0x91f9('0x7')](function(_0x5193e5){logger[_0x91f9('0x8')](_0x91f9('0x1b'),_0x4dc2ef);logger['debug'](_0x91f9('0x1b'),_0x4dc2ef,JSON[_0x91f9('0x1c')](_0x5193e5));_0x1afad1(_0x5193e5);})[_0x91f9('0x11')](function(_0x181a52){logger[_0x91f9('0xd')](_0x91f9('0x1b'),_0x181a52[_0x91f9('0xf')],_0x4dc2ef);_0x54bc87(_0x87259b['error'](0x1f4,_0x181a52[_0x91f9('0xf')]));});});};exports[_0x91f9('0x1d')]=function(_0x34af17){var _0x148fd3=this;return new Promise(function(_0x250cdc,_0xb701f1){return db[_0x91f9('0x1e')][_0x91f9('0x1f')]({'raw':_0x34af17[_0x91f9('0x13')]?_0x34af17[_0x91f9('0x13')][_0x91f9('0x14')]===undefined?!![]:![]:!![],'where':_0x34af17[_0x91f9('0x13')]?_0x34af17[_0x91f9('0x13')][_0x91f9('0x15')]||null:null,'attributes':_0x34af17[_0x91f9('0x13')]?_0x34af17[_0x91f9('0x13')][_0x91f9('0x16')]||null:null,'include':_0x34af17['options']?_0x34af17[_0x91f9('0x13')][_0x91f9('0x18')]?_['map'](_0x34af17[_0x91f9('0x13')]['include'],function(_0x538f49){return{'model':db[_0x538f49[_0x91f9('0x1a')]],'as':_0x538f49['as'],'attributes':_0x538f49[_0x91f9('0x16')],'include':_0x538f49[_0x91f9('0x18')]?_[_0x91f9('0x19')](_0x538f49[_0x91f9('0x18')],function(_0x54e54a){return{'model':db[_0x54e54a[_0x91f9('0x1a')]],'as':_0x54e54a['as'],'attributes':_0x54e54a[_0x91f9('0x16')],'include':_0x54e54a[_0x91f9('0x18')]?_['map'](_0x54e54a[_0x91f9('0x18')],function(_0x3c1617){return{'model':db[_0x3c1617[_0x91f9('0x1a')]],'as':_0x3c1617['as'],'attributes':_0x3c1617[_0x91f9('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd74b37){logger[_0x91f9('0x8')](_0x91f9('0x1d'),_0x34af17);logger[_0x91f9('0xb')](_0x91f9('0x1d'),_0x34af17,JSON[_0x91f9('0x1c')](_0xd74b37));_0x250cdc(_0xd74b37);})[_0x91f9('0x11')](function(_0x4bd59f){logger[_0x91f9('0xd')](_0x91f9('0x1d'),_0x4bd59f['message'],_0x34af17);_0xb701f1(_0x148fd3[_0x91f9('0xd')](0x1f4,_0x4bd59f[_0x91f9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3faf141..8112169 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 _0x3698=['getSubjects','/:id/descriptions','post','create','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x3684c8,_0x3ddbd1){var _0x460f26=function(_0x88c204){while(--_0x88c204){_0x3684c8['push'](_0x3684c8['shift']());}};_0x460f26(++_0x3ddbd1);}(_0x3698,0x1bf));var _0x8369=function(_0x3f9dd9,_0x5d17c8){_0x3f9dd9=_0x3f9dd9-0x0;var _0x235dbe=_0x3698[_0x3f9dd9];return _0x235dbe;};'use strict';var multer=require(_0x8369('0x0'));var util=require(_0x8369('0x1'));var path=require(_0x8369('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8369('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8369('0x4'));var config=require(_0x8369('0x5'));var controller=require(_0x8369('0x6'));router[_0x8369('0x7')]('/',auth[_0x8369('0x8')](),controller[_0x8369('0x9')]);router[_0x8369('0x7')](_0x8369('0xa'),auth[_0x8369('0x8')](),controller[_0x8369('0xb')]);router[_0x8369('0x7')](_0x8369('0xc'),auth[_0x8369('0x8')](),controller[_0x8369('0xd')]);router[_0x8369('0x7')](_0x8369('0xe'),auth[_0x8369('0x8')](),controller[_0x8369('0xf')]);router[_0x8369('0x7')](_0x8369('0x10'),auth[_0x8369('0x8')](),controller['getDescriptions']);router[_0x8369('0x11')]('/',auth[_0x8369('0x8')](),controller[_0x8369('0x12')]);router['put'](_0x8369('0xa'),auth['isAuthenticated'](),controller[_0x8369('0x13')]);router[_0x8369('0x14')](_0x8369('0xa'),auth[_0x8369('0x8')](),controller['destroy']);module[_0x8369('0x15')]=router; \ No newline at end of file +var _0x54ae=['./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x42ad41,_0x5eb9bc){var _0x2e1ea4=function(_0x2ffe5a){while(--_0x2ffe5a){_0x42ad41['push'](_0x42ad41['shift']());}};_0x2e1ea4(++_0x5eb9bc);}(_0x54ae,0xaa));var _0xe54a=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x54ae[_0x2ca2d0];return _0x521c23;};'use strict';var multer=require(_0xe54a('0x0'));var util=require('util');var path=require(_0xe54a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe54a('0x2')]();var fs_extra=require(_0xe54a('0x3'));var auth=require(_0xe54a('0x4'));var interaction=require(_0xe54a('0x5'));var config=require('../../config/environment');var controller=require(_0xe54a('0x6'));router[_0xe54a('0x7')]('/',auth[_0xe54a('0x8')](),controller[_0xe54a('0x9')]);router[_0xe54a('0x7')]('/:id',auth[_0xe54a('0x8')](),controller['show']);router[_0xe54a('0x7')](_0xe54a('0xa'),auth[_0xe54a('0x8')](),controller[_0xe54a('0xb')]);router['get'](_0xe54a('0xc'),auth[_0xe54a('0x8')](),controller[_0xe54a('0xd')]);router[_0xe54a('0x7')](_0xe54a('0xe'),auth[_0xe54a('0x8')](),controller['getDescriptions']);router[_0xe54a('0xf')]('/',auth[_0xe54a('0x8')](),controller[_0xe54a('0x10')]);router[_0xe54a('0x11')](_0xe54a('0x12'),auth[_0xe54a('0x8')](),controller['update']);router[_0xe54a('0x13')](_0xe54a('0x12'),auth[_0xe54a('0x8')](),controller[_0xe54a('0x14')]);module[_0xe54a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index dbdb24d..b80f7f1 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 _0xa5d0=['sequelize','exports','STRING'];(function(_0x285447,_0x2b5f12){var _0x25bb21=function(_0x293e61){while(--_0x293e61){_0x285447['push'](_0x285447['shift']());}};_0x25bb21(++_0x2b5f12);}(_0xa5d0,0x87));var _0x0a5d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa5d0[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x0a5d('0x0'));module[_0x0a5d('0x1')]={'name':{'type':Sequelize[_0x0a5d('0x2')]},'description':{'type':Sequelize[_0x0a5d('0x2')]}}; \ No newline at end of file +var _0x684a=['STRING','exports'];(function(_0x4dd2d3,_0x4c6bfc){var _0x488c8f=function(_0x2aa871){while(--_0x2aa871){_0x4dd2d3['push'](_0x4dd2d3['shift']());}};_0x488c8f(++_0x4c6bfc);}(_0x684a,0x85));var _0xa684=function(_0x144b47,_0xe33df){_0x144b47=_0x144b47-0x0;var _0x40a39d=_0x684a[_0x144b47];return _0x40a39d;};'use strict';var Sequelize=require('sequelize');module[_0xa684('0x0')]={'name':{'type':Sequelize[_0xa684('0x1')]},'description':{'type':Sequelize[_0xa684('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e07a6dd..ec4645e 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 _0xd0b9=['status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1c1056,_0x1db6b0){var _0x53f633=function(_0x53e6b0){while(--_0x53e6b0){_0x1c1056['push'](_0x1c1056['shift']());}};_0x53f633(++_0x1db6b0);}(_0xd0b9,0x1e8));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9d0b('0x0'));var rimraf=require(_0x9d0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d0b('0x2'));var rp=require(_0x9d0b('0x3'));var moment=require(_0x9d0b('0x4'));var BPromise=require(_0x9d0b('0x5'));var Mustache=require('mustache');var util=require(_0x9d0b('0x6'));var path=require(_0x9d0b('0x7'));var sox=require(_0x9d0b('0x8'));var csv=require('to-csv');var ejs=require(_0x9d0b('0x9'));var fs=require('fs');var fs_extra=require(_0x9d0b('0xa'));var _=require(_0x9d0b('0xb'));var squel=require(_0x9d0b('0xc'));var crypto=require(_0x9d0b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d0b('0xe'));var toCsv=require(_0x9d0b('0xf'));var querystring=require('querystring');var Papa=require(_0x9d0b('0x10'));var Redis=require(_0x9d0b('0x11'));var authService=require(_0x9d0b('0x12'));var qs=require(_0x9d0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d0b('0x14'));var logger=require(_0x9d0b('0x15'))(_0x9d0b('0x16'));var utils=require(_0x9d0b('0x17'));var config=require(_0x9d0b('0x18'));var licenseUtil=require(_0x9d0b('0x19'));var db=require(_0x9d0b('0x1a'))['db'];function respondWithStatusCode(_0x2b53c5,_0x122a9b){_0x122a9b=_0x122a9b||0xcc;return function(_0x551fef){if(_0x551fef){return _0x2b53c5[_0x9d0b('0x1b')](_0x122a9b);}return _0x2b53c5[_0x9d0b('0x1c')](_0x122a9b)['end']();};}function respondWithResult(_0x13e953,_0xfcb7ce){_0xfcb7ce=_0xfcb7ce||0xc8;return function(_0x3be4df){if(_0x3be4df){return _0x13e953['status'](_0xfcb7ce)['json'](_0x3be4df);}};}function respondWithFilteredResult(_0x416d22,_0x3c79c6){return function(_0x5e7213){if(_0x5e7213){var _0x51c985=typeof _0x3c79c6[_0x9d0b('0x1d')]==='undefined'&&typeof _0x3c79c6[_0x9d0b('0x1e')]===_0x9d0b('0x1f');var _0x23d155=_0x5e7213[_0x9d0b('0x20')];var _0x3fc036=_0x51c985?0x0:_0x3c79c6['offset'];var _0xcb21fd=_0x51c985?_0x5e7213[_0x9d0b('0x20')]:_0x3c79c6['offset']+_0x3c79c6[_0x9d0b('0x1e')];var _0x30802d;if(_0xcb21fd>=_0x23d155){_0xcb21fd=_0x23d155;_0x30802d=0xc8;}else{_0x30802d=0xce;}_0x416d22[_0x9d0b('0x1c')](_0x30802d);return _0x416d22[_0x9d0b('0x21')](_0x9d0b('0x22'),_0x3fc036+'-'+_0xcb21fd+'/'+_0x23d155)[_0x9d0b('0x23')](_0x5e7213);}return null;};}function patchUpdates(_0x4d36be){return function(_0x2a90bc){try{jsonpatch['apply'](_0x2a90bc,_0x4d36be,!![]);}catch(_0x5c113b){return BPromise[_0x9d0b('0x24')](_0x5c113b);}return _0x2a90bc[_0x9d0b('0x25')]();};}function saveUpdates(_0x3fea02,_0x38e0dd){return function(_0x39413c){if(_0x39413c){return _0x39413c[_0x9d0b('0x26')](_0x3fea02)[_0x9d0b('0x27')](function(_0x43b74b){return _0x43b74b;});}return null;};}function removeEntity(_0x37984a,_0xcabe47){return function(_0x188fa7){if(_0x188fa7){return _0x188fa7[_0x9d0b('0x28')]()[_0x9d0b('0x27')](function(){_0x37984a[_0x9d0b('0x1c')](0xcc)[_0x9d0b('0x29')]();});}};}function handleEntityNotFound(_0x3b7997,_0x106d2b){return function(_0x58433b){if(!_0x58433b){_0x3b7997['sendStatus'](0x194);}return _0x58433b;};}function handleError(_0x46fc05,_0x11301c){_0x11301c=_0x11301c||0x1f4;return function(_0x4e815b){logger[_0x9d0b('0x2a')](_0x4e815b[_0x9d0b('0x2b')]);if(_0x4e815b[_0x9d0b('0x2c')]){delete _0x4e815b[_0x9d0b('0x2c')];}_0x46fc05[_0x9d0b('0x1c')](_0x11301c)[_0x9d0b('0x2d')](_0x4e815b);};}exports[_0x9d0b('0x2e')]=function(_0x5e8011,_0x4ac4c3){var _0x52be6f={},_0x52658a={},_0x23c2ce={'count':0x0,'rows':[]};var _0x523cc3=_[_0x9d0b('0x2f')](db[_0x9d0b('0x30')][_0x9d0b('0x31')],function(_0x4a108e){return{'name':_0x4a108e[_0x9d0b('0x32')],'type':_0x4a108e[_0x9d0b('0x33')][_0x9d0b('0x34')]};});_0x52658a[_0x9d0b('0x35')]=_[_0x9d0b('0x2f')](_0x523cc3,_0x9d0b('0x2c'));_0x52658a[_0x9d0b('0x36')]=_[_0x9d0b('0x37')](_0x5e8011['query']);_0x52658a[_0x9d0b('0x38')]=_[_0x9d0b('0x39')](_0x52658a['model'],_0x52658a[_0x9d0b('0x36')]);_0x52be6f[_0x9d0b('0x3a')]=_['intersection'](_0x52658a[_0x9d0b('0x35')],qs['fields'](_0x5e8011['query'][_0x9d0b('0x3b')]));_0x52be6f[_0x9d0b('0x3a')]=_0x52be6f[_0x9d0b('0x3a')]['length']?_0x52be6f['attributes']:_0x52658a['model'];if(!_0x5e8011[_0x9d0b('0x36')][_0x9d0b('0x3c')](_0x9d0b('0x3d'))){_0x52be6f['limit']=qs[_0x9d0b('0x1e')](_0x5e8011['query']['limit']);_0x52be6f['offset']=qs[_0x9d0b('0x1d')](_0x5e8011[_0x9d0b('0x36')][_0x9d0b('0x1d')]);}_0x52be6f[_0x9d0b('0x3e')]=qs[_0x9d0b('0x3f')](_0x5e8011[_0x9d0b('0x36')][_0x9d0b('0x3f')]);_0x52be6f['where']=qs[_0x9d0b('0x38')](_[_0x9d0b('0x40')](_0x5e8011['query'],_0x52658a[_0x9d0b('0x38')]),_0x523cc3);if(_0x5e8011['query'][_0x9d0b('0x41')]){_0x52be6f[_0x9d0b('0x42')]=_[_0x9d0b('0x43')](_0x52be6f['where'],{'$or':_['map'](_0x523cc3,function(_0x25b51a){if(_0x25b51a[_0x9d0b('0x33')]!==_0x9d0b('0x44')){var _0xa1e9a={};_0xa1e9a[_0x25b51a[_0x9d0b('0x2c')]]={'$like':'%'+_0x5e8011[_0x9d0b('0x36')]['filter']+'%'};return _0xa1e9a;}})});}_0x52be6f=_[_0x9d0b('0x43')]({},_0x52be6f,_0x5e8011[_0x9d0b('0x45')]);var _0x1b0353={'where':_0x52be6f[_0x9d0b('0x42')]};return db['ServicenowConfiguration']['count'](_0x1b0353)[_0x9d0b('0x27')](function(_0x3a9f5a){_0x23c2ce['count']=_0x3a9f5a;if(_0x5e8011['query'][_0x9d0b('0x46')]){_0x52be6f[_0x9d0b('0x47')]=[{'all':!![]}];}return db[_0x9d0b('0x30')][_0x9d0b('0x48')](_0x52be6f);})['then'](function(_0x1cfecb){_0x23c2ce[_0x9d0b('0x49')]=_0x1cfecb;return _0x23c2ce;})['then'](respondWithFilteredResult(_0x4ac4c3,_0x52be6f))[_0x9d0b('0x4a')](handleError(_0x4ac4c3,null));};exports[_0x9d0b('0x4b')]=function(_0x149e2c,_0x4bb7e5){var _0x1a7e33={'raw':![],'where':{'id':_0x149e2c[_0x9d0b('0x4c')]['id']}},_0x566514={};_0x566514[_0x9d0b('0x35')]=_[_0x9d0b('0x37')](db[_0x9d0b('0x30')][_0x9d0b('0x31')]);_0x566514[_0x9d0b('0x36')]=_['keys'](_0x149e2c[_0x9d0b('0x36')]);_0x566514[_0x9d0b('0x38')]=_['intersection'](_0x566514[_0x9d0b('0x35')],_0x566514[_0x9d0b('0x36')]);_0x1a7e33[_0x9d0b('0x3a')]=_[_0x9d0b('0x39')](_0x566514['model'],qs['fields'](_0x149e2c[_0x9d0b('0x36')][_0x9d0b('0x3b')]));_0x1a7e33['attributes']=_0x1a7e33[_0x9d0b('0x3a')][_0x9d0b('0x4d')]?_0x1a7e33['attributes']:_0x566514[_0x9d0b('0x35')];if(_0x149e2c[_0x9d0b('0x36')][_0x9d0b('0x46')]){_0x1a7e33[_0x9d0b('0x47')]=[{'all':!![]}];}_0x1a7e33=_['merge']({},_0x1a7e33,_0x149e2c['options']);return db['ServicenowConfiguration'][_0x9d0b('0x4e')](_0x1a7e33)[_0x9d0b('0x27')](handleEntityNotFound(_0x4bb7e5,null))['then'](respondWithResult(_0x4bb7e5,null))[_0x9d0b('0x4a')](handleError(_0x4bb7e5,null));};exports[_0x9d0b('0x4f')]=function(_0x2111d1,_0x2e7301){return db[_0x9d0b('0x30')][_0x9d0b('0x4f')](_0x2111d1[_0x9d0b('0x50')],{})['then'](respondWithResult(_0x2e7301,0xc9))[_0x9d0b('0x4a')](handleError(_0x2e7301,null));};exports[_0x9d0b('0x26')]=function(_0x130587,_0x2f2d63){if(_0x130587[_0x9d0b('0x50')]['id']){delete _0x130587[_0x9d0b('0x50')]['id'];}return db[_0x9d0b('0x30')][_0x9d0b('0x4e')]({'where':{'id':_0x130587[_0x9d0b('0x4c')]['id']}})[_0x9d0b('0x27')](handleEntityNotFound(_0x2f2d63,null))[_0x9d0b('0x27')](saveUpdates(_0x130587[_0x9d0b('0x50')],null))[_0x9d0b('0x27')](respondWithResult(_0x2f2d63,null))['catch'](handleError(_0x2f2d63,null));};exports[_0x9d0b('0x28')]=function(_0x426c31,_0x56dc72){return db['ServicenowConfiguration'][_0x9d0b('0x4e')]({'where':{'id':_0x426c31['params']['id']}})[_0x9d0b('0x27')](handleEntityNotFound(_0x56dc72,null))[_0x9d0b('0x27')](removeEntity(_0x56dc72,null))['catch'](handleError(_0x56dc72,null));};exports[_0x9d0b('0x51')]=function(_0x472290,_0x3650ea,_0x3b126c){var _0x499c94={};var _0x5aee5a={};var _0x57fed7;var _0x952fd6;return db[_0x9d0b('0x30')][_0x9d0b('0x52')]({'where':{'id':_0x472290[_0x9d0b('0x4c')]['id']}})[_0x9d0b('0x27')](handleEntityNotFound(_0x3650ea,null))[_0x9d0b('0x27')](function(_0x3c0a11){if(_0x3c0a11){_0x57fed7=_0x3c0a11;_0x5aee5a['model']=_[_0x9d0b('0x37')](db[_0x9d0b('0x53')]['rawAttributes']);_0x5aee5a[_0x9d0b('0x36')]=_[_0x9d0b('0x37')](_0x472290[_0x9d0b('0x36')]);_0x5aee5a[_0x9d0b('0x38')]=_['intersection'](_0x5aee5a[_0x9d0b('0x35')],_0x5aee5a[_0x9d0b('0x36')]);_0x499c94[_0x9d0b('0x3a')]=_['intersection'](_0x5aee5a[_0x9d0b('0x35')],qs[_0x9d0b('0x3b')](_0x472290[_0x9d0b('0x36')][_0x9d0b('0x3b')]));_0x499c94[_0x9d0b('0x3a')]=_0x499c94[_0x9d0b('0x3a')][_0x9d0b('0x4d')]?_0x499c94[_0x9d0b('0x3a')]:_0x5aee5a[_0x9d0b('0x35')];_0x499c94[_0x9d0b('0x3e')]=qs['sort'](_0x472290[_0x9d0b('0x36')][_0x9d0b('0x3f')]);_0x499c94['where']=qs['filters'](_[_0x9d0b('0x40')](_0x472290[_0x9d0b('0x36')],_0x5aee5a[_0x9d0b('0x38')]));if(_0x472290[_0x9d0b('0x36')][_0x9d0b('0x41')]){_0x499c94[_0x9d0b('0x42')]=_['merge'](_0x499c94[_0x9d0b('0x42')],{'$or':_[_0x9d0b('0x2f')](_0x499c94[_0x9d0b('0x3a')],function(_0x11ca3c){var _0x3cdec7={};_0x3cdec7[_0x11ca3c]={'$like':'%'+_0x472290[_0x9d0b('0x36')][_0x9d0b('0x41')]+'%'};return _0x3cdec7;})});}_0x499c94=_[_0x9d0b('0x43')]({},_0x499c94,_0x472290[_0x9d0b('0x45')]);return _0x57fed7[_0x9d0b('0x51')](_0x499c94);}})[_0x9d0b('0x27')](function(_0x177f94){if(_0x177f94){_0x952fd6=_0x177f94['length'];if(!_0x472290['query']['hasOwnProperty'](_0x9d0b('0x3d'))){_0x499c94[_0x9d0b('0x1e')]=qs['limit'](_0x472290['query']['limit']);_0x499c94[_0x9d0b('0x1d')]=qs[_0x9d0b('0x1d')](_0x472290[_0x9d0b('0x36')][_0x9d0b('0x1d')]);}return _0x57fed7['getFields'](_0x499c94);}})[_0x9d0b('0x27')](function(_0x46d0cb){if(_0x46d0cb){return _0x46d0cb?{'count':_0x952fd6,'rows':_0x46d0cb}:null;}})[_0x9d0b('0x27')](respondWithResult(_0x3650ea,null))['catch'](handleError(_0x3650ea,null));};exports[_0x9d0b('0x54')]=function(_0x295d74,_0x16f07b,_0x195023){var _0x398c9b={};var _0xc1c679={};var _0x3f8db6;var _0x22ef61;return db[_0x9d0b('0x30')][_0x9d0b('0x52')]({'where':{'id':_0x295d74[_0x9d0b('0x4c')]['id']}})[_0x9d0b('0x27')](handleEntityNotFound(_0x16f07b,null))[_0x9d0b('0x27')](function(_0x459c98){if(_0x459c98){_0x3f8db6=_0x459c98;_0xc1c679['model']=_['keys'](db[_0x9d0b('0x53')][_0x9d0b('0x31')]);_0xc1c679['query']=_['keys'](_0x295d74['query']);_0xc1c679[_0x9d0b('0x38')]=_[_0x9d0b('0x39')](_0xc1c679[_0x9d0b('0x35')],_0xc1c679[_0x9d0b('0x36')]);_0x398c9b[_0x9d0b('0x3a')]=_[_0x9d0b('0x39')](_0xc1c679['model'],qs[_0x9d0b('0x3b')](_0x295d74[_0x9d0b('0x36')][_0x9d0b('0x3b')]));_0x398c9b[_0x9d0b('0x3a')]=_0x398c9b['attributes']['length']?_0x398c9b[_0x9d0b('0x3a')]:_0xc1c679['model'];_0x398c9b['order']=qs['sort'](_0x295d74[_0x9d0b('0x36')][_0x9d0b('0x3f')]);_0x398c9b[_0x9d0b('0x42')]=qs[_0x9d0b('0x38')](_['pick'](_0x295d74[_0x9d0b('0x36')],_0xc1c679[_0x9d0b('0x38')]));if(_0x295d74[_0x9d0b('0x36')]['filter']){_0x398c9b['where']=_['merge'](_0x398c9b[_0x9d0b('0x42')],{'$or':_['map'](_0x398c9b[_0x9d0b('0x3a')],function(_0x5abc29){var _0x47b4ac={};_0x47b4ac[_0x5abc29]={'$like':'%'+_0x295d74[_0x9d0b('0x36')][_0x9d0b('0x41')]+'%'};return _0x47b4ac;})});}_0x398c9b=_[_0x9d0b('0x43')]({},_0x398c9b,_0x295d74[_0x9d0b('0x45')]);return _0x3f8db6[_0x9d0b('0x54')](_0x398c9b);}})[_0x9d0b('0x27')](function(_0x153bcf){if(_0x153bcf){_0x22ef61=_0x153bcf[_0x9d0b('0x4d')];if(!_0x295d74[_0x9d0b('0x36')][_0x9d0b('0x3c')]('nolimit')){_0x398c9b[_0x9d0b('0x1e')]=qs['limit'](_0x295d74['query'][_0x9d0b('0x1e')]);_0x398c9b[_0x9d0b('0x1d')]=qs[_0x9d0b('0x1d')](_0x295d74['query'][_0x9d0b('0x1d')]);}return _0x3f8db6[_0x9d0b('0x54')](_0x398c9b);}})[_0x9d0b('0x27')](function(_0x5b879){if(_0x5b879){return _0x5b879?{'count':_0x22ef61,'rows':_0x5b879}:null;}})[_0x9d0b('0x27')](respondWithResult(_0x16f07b,null))['catch'](handleError(_0x16f07b,null));};exports['getDescriptions']=function(_0x3ac008,_0x31603f,_0x43ac67){var _0x410ada={};var _0x2c07ef={};var _0x6f510f;var _0x3704a3;return db[_0x9d0b('0x30')][_0x9d0b('0x52')]({'where':{'id':_0x3ac008[_0x9d0b('0x4c')]['id']}})[_0x9d0b('0x27')](handleEntityNotFound(_0x31603f,null))['then'](function(_0x23c11f){if(_0x23c11f){_0x6f510f=_0x23c11f;_0x2c07ef['model']=_[_0x9d0b('0x37')](db[_0x9d0b('0x53')][_0x9d0b('0x31')]);_0x2c07ef[_0x9d0b('0x36')]=_[_0x9d0b('0x37')](_0x3ac008[_0x9d0b('0x36')]);_0x2c07ef[_0x9d0b('0x38')]=_[_0x9d0b('0x39')](_0x2c07ef[_0x9d0b('0x35')],_0x2c07ef[_0x9d0b('0x36')]);_0x410ada[_0x9d0b('0x3a')]=_['intersection'](_0x2c07ef[_0x9d0b('0x35')],qs[_0x9d0b('0x3b')](_0x3ac008['query']['fields']));_0x410ada['attributes']=_0x410ada['attributes'][_0x9d0b('0x4d')]?_0x410ada[_0x9d0b('0x3a')]:_0x2c07ef['model'];_0x410ada['order']=qs[_0x9d0b('0x3f')](_0x3ac008[_0x9d0b('0x36')][_0x9d0b('0x3f')]);_0x410ada[_0x9d0b('0x42')]=qs[_0x9d0b('0x38')](_[_0x9d0b('0x40')](_0x3ac008[_0x9d0b('0x36')],_0x2c07ef[_0x9d0b('0x38')]));if(_0x3ac008[_0x9d0b('0x36')][_0x9d0b('0x41')]){_0x410ada[_0x9d0b('0x42')]=_[_0x9d0b('0x43')](_0x410ada[_0x9d0b('0x42')],{'$or':_[_0x9d0b('0x2f')](_0x410ada[_0x9d0b('0x3a')],function(_0x3f9e29){var _0x2a20f5={};_0x2a20f5[_0x3f9e29]={'$like':'%'+_0x3ac008['query'][_0x9d0b('0x41')]+'%'};return _0x2a20f5;})});}_0x410ada=_[_0x9d0b('0x43')]({},_0x410ada,_0x3ac008['options']);return _0x6f510f[_0x9d0b('0x55')](_0x410ada);}})[_0x9d0b('0x27')](function(_0x1a38a0){if(_0x1a38a0){_0x3704a3=_0x1a38a0[_0x9d0b('0x4d')];if(!_0x3ac008[_0x9d0b('0x36')]['hasOwnProperty'](_0x9d0b('0x3d'))){_0x410ada['limit']=qs[_0x9d0b('0x1e')](_0x3ac008['query']['limit']);_0x410ada[_0x9d0b('0x1d')]=qs[_0x9d0b('0x1d')](_0x3ac008['query'][_0x9d0b('0x1d')]);}return _0x6f510f['getDescriptions'](_0x410ada);}})[_0x9d0b('0x27')](function(_0x5a03c6){if(_0x5a03c6){return _0x5a03c6?{'count':_0x3704a3,'rows':_0x5a03c6}:null;}})[_0x9d0b('0x27')](respondWithResult(_0x31603f,null))[_0x9d0b('0x4a')](handleError(_0x31603f,null));}; \ No newline at end of file +var _0x482f=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','find','catch','create','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query'];(function(_0x113a1a,_0x22a2c9){var _0x14d16e=function(_0x150dbd){while(--_0x150dbd){_0x113a1a['push'](_0x113a1a['shift']());}};_0x14d16e(++_0x22a2c9);}(_0x482f,0x1c1));var _0xf482=function(_0x28c013,_0x228d51){_0x28c013=_0x28c013-0x0;var _0x5a1768=_0x482f[_0x28c013];return _0x5a1768;};'use strict';var emlformat=require(_0xf482('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf482('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf482('0x2'));var moment=require(_0xf482('0x3'));var BPromise=require(_0xf482('0x4'));var Mustache=require(_0xf482('0x5'));var util=require(_0xf482('0x6'));var path=require(_0xf482('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf482('0x8'));var fs=require('fs');var fs_extra=require(_0xf482('0x9'));var _=require(_0xf482('0xa'));var squel=require(_0xf482('0xb'));var crypto=require('crypto');var jsforce=require(_0xf482('0xc'));var deskjs=require(_0xf482('0xd'));var toCsv=require(_0xf482('0xe'));var querystring=require(_0xf482('0xf'));var Papa=require(_0xf482('0x10'));var Redis=require(_0xf482('0x11'));var authService=require(_0xf482('0x12'));var qs=require(_0xf482('0x13'));var as=require(_0xf482('0x14'));var hardwareService=require(_0xf482('0x15'));var logger=require(_0xf482('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf482('0x17'));var licenseUtil=require(_0xf482('0x18'));var db=require(_0xf482('0x19'))['db'];function respondWithStatusCode(_0x54c2e1,_0x991564){_0x991564=_0x991564||0xcc;return function(_0x161cd1){if(_0x161cd1){return _0x54c2e1['sendStatus'](_0x991564);}return _0x54c2e1[_0xf482('0x1a')](_0x991564)['end']();};}function respondWithResult(_0x3806be,_0x580ce2){_0x580ce2=_0x580ce2||0xc8;return function(_0x4dbcfa){if(_0x4dbcfa){return _0x3806be[_0xf482('0x1a')](_0x580ce2)[_0xf482('0x1b')](_0x4dbcfa);}};}function respondWithFilteredResult(_0x574918,_0x3fb2ee){return function(_0x25233a){if(_0x25233a){var _0x5138dd=typeof _0x3fb2ee[_0xf482('0x1c')]===_0xf482('0x1d')&&typeof _0x3fb2ee[_0xf482('0x1e')]===_0xf482('0x1d');var _0x5937e6=_0x25233a['count'];var _0x3d5c3b=_0x5138dd?0x0:_0x3fb2ee['offset'];var _0x26ee42=_0x5138dd?_0x25233a[_0xf482('0x1f')]:_0x3fb2ee[_0xf482('0x1c')]+_0x3fb2ee['limit'];var _0x21ccf2;if(_0x26ee42>=_0x5937e6){_0x26ee42=_0x5937e6;_0x21ccf2=0xc8;}else{_0x21ccf2=0xce;}_0x574918['status'](_0x21ccf2);return _0x574918[_0xf482('0x20')](_0xf482('0x21'),_0x3d5c3b+'-'+_0x26ee42+'/'+_0x5937e6)['json'](_0x25233a);}return null;};}function patchUpdates(_0x1311f0){return function(_0x21b381){try{jsonpatch[_0xf482('0x22')](_0x21b381,_0x1311f0,!![]);}catch(_0x28438d){return BPromise[_0xf482('0x23')](_0x28438d);}return _0x21b381[_0xf482('0x24')]();};}function saveUpdates(_0x66c74f,_0x2ed25c){return function(_0x3bc22a){if(_0x3bc22a){return _0x3bc22a[_0xf482('0x25')](_0x66c74f)[_0xf482('0x26')](function(_0x19e1b6){return _0x19e1b6;});}return null;};}function removeEntity(_0x5a9f68,_0x24dd7e){return function(_0x5811c2){if(_0x5811c2){return _0x5811c2[_0xf482('0x27')]()[_0xf482('0x26')](function(){_0x5a9f68['status'](0xcc)[_0xf482('0x28')]();});}};}function handleEntityNotFound(_0x23ae9b,_0x2701c3){return function(_0x4d0d22){if(!_0x4d0d22){_0x23ae9b[_0xf482('0x29')](0x194);}return _0x4d0d22;};}function handleError(_0x31896a,_0x4e6bee){_0x4e6bee=_0x4e6bee||0x1f4;return function(_0x28ba43){logger[_0xf482('0x2a')](_0x28ba43[_0xf482('0x2b')]);if(_0x28ba43['name']){delete _0x28ba43[_0xf482('0x2c')];}_0x31896a['status'](_0x4e6bee)[_0xf482('0x2d')](_0x28ba43);};}exports[_0xf482('0x2e')]=function(_0x30aef4,_0x3108e7){var _0x1fe6ec={},_0x1f49f0={},_0x439a04={'count':0x0,'rows':[]};var _0x212093=_[_0xf482('0x2f')](db[_0xf482('0x30')][_0xf482('0x31')],function(_0x409abc){return{'name':_0x409abc[_0xf482('0x32')],'type':_0x409abc[_0xf482('0x33')][_0xf482('0x34')]};});_0x1f49f0[_0xf482('0x35')]=_[_0xf482('0x2f')](_0x212093,_0xf482('0x2c'));_0x1f49f0[_0xf482('0x36')]=_[_0xf482('0x37')](_0x30aef4[_0xf482('0x36')]);_0x1f49f0[_0xf482('0x38')]=_[_0xf482('0x39')](_0x1f49f0[_0xf482('0x35')],_0x1f49f0[_0xf482('0x36')]);_0x1fe6ec['attributes']=_[_0xf482('0x39')](_0x1f49f0[_0xf482('0x35')],qs[_0xf482('0x3a')](_0x30aef4[_0xf482('0x36')][_0xf482('0x3a')]));_0x1fe6ec[_0xf482('0x3b')]=_0x1fe6ec[_0xf482('0x3b')][_0xf482('0x3c')]?_0x1fe6ec[_0xf482('0x3b')]:_0x1f49f0[_0xf482('0x35')];if(!_0x30aef4[_0xf482('0x36')][_0xf482('0x3d')](_0xf482('0x3e'))){_0x1fe6ec[_0xf482('0x1e')]=qs['limit'](_0x30aef4[_0xf482('0x36')][_0xf482('0x1e')]);_0x1fe6ec['offset']=qs[_0xf482('0x1c')](_0x30aef4[_0xf482('0x36')][_0xf482('0x1c')]);}_0x1fe6ec['order']=qs[_0xf482('0x3f')](_0x30aef4[_0xf482('0x36')][_0xf482('0x3f')]);_0x1fe6ec['where']=qs[_0xf482('0x38')](_[_0xf482('0x40')](_0x30aef4[_0xf482('0x36')],_0x1f49f0[_0xf482('0x38')]),_0x212093);if(_0x30aef4[_0xf482('0x36')][_0xf482('0x41')]){_0x1fe6ec[_0xf482('0x42')]=_[_0xf482('0x43')](_0x1fe6ec[_0xf482('0x42')],{'$or':_['map'](_0x212093,function(_0xd2feca){if(_0xd2feca[_0xf482('0x33')]!==_0xf482('0x44')){var _0x491da9={};_0x491da9[_0xd2feca[_0xf482('0x2c')]]={'$like':'%'+_0x30aef4[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0x491da9;}})});}_0x1fe6ec=_[_0xf482('0x43')]({},_0x1fe6ec,_0x30aef4[_0xf482('0x45')]);var _0xd1535d={'where':_0x1fe6ec[_0xf482('0x42')]};return db[_0xf482('0x30')]['count'](_0xd1535d)[_0xf482('0x26')](function(_0xae93a7){_0x439a04[_0xf482('0x1f')]=_0xae93a7;if(_0x30aef4[_0xf482('0x36')][_0xf482('0x46')]){_0x1fe6ec['include']=[{'all':!![]}];}return db[_0xf482('0x30')][_0xf482('0x47')](_0x1fe6ec);})[_0xf482('0x26')](function(_0x1f38c1){_0x439a04['rows']=_0x1f38c1;return _0x439a04;})[_0xf482('0x26')](respondWithFilteredResult(_0x3108e7,_0x1fe6ec))['catch'](handleError(_0x3108e7,null));};exports[_0xf482('0x48')]=function(_0x13cb2e,_0x124567){var _0x5ed194={'raw':![],'where':{'id':_0x13cb2e[_0xf482('0x49')]['id']}},_0x557eab={};_0x557eab[_0xf482('0x35')]=_[_0xf482('0x37')](db[_0xf482('0x30')][_0xf482('0x31')]);_0x557eab[_0xf482('0x36')]=_['keys'](_0x13cb2e[_0xf482('0x36')]);_0x557eab['filters']=_[_0xf482('0x39')](_0x557eab[_0xf482('0x35')],_0x557eab[_0xf482('0x36')]);_0x5ed194['attributes']=_[_0xf482('0x39')](_0x557eab[_0xf482('0x35')],qs[_0xf482('0x3a')](_0x13cb2e[_0xf482('0x36')][_0xf482('0x3a')]));_0x5ed194[_0xf482('0x3b')]=_0x5ed194[_0xf482('0x3b')][_0xf482('0x3c')]?_0x5ed194['attributes']:_0x557eab[_0xf482('0x35')];if(_0x13cb2e['query']['includeAll']){_0x5ed194['include']=[{'all':!![]}];}_0x5ed194=_[_0xf482('0x43')]({},_0x5ed194,_0x13cb2e[_0xf482('0x45')]);return db[_0xf482('0x30')][_0xf482('0x4a')](_0x5ed194)[_0xf482('0x26')](handleEntityNotFound(_0x124567,null))['then'](respondWithResult(_0x124567,null))[_0xf482('0x4b')](handleError(_0x124567,null));};exports[_0xf482('0x4c')]=function(_0x4de85b,_0x1c2beb){return db[_0xf482('0x30')][_0xf482('0x4c')](_0x4de85b['body'],{})[_0xf482('0x26')](respondWithResult(_0x1c2beb,0xc9))[_0xf482('0x4b')](handleError(_0x1c2beb,null));};exports[_0xf482('0x25')]=function(_0x32bac2,_0x31a27c){if(_0x32bac2['body']['id']){delete _0x32bac2['body']['id'];}return db[_0xf482('0x30')][_0xf482('0x4a')]({'where':{'id':_0x32bac2[_0xf482('0x49')]['id']}})[_0xf482('0x26')](handleEntityNotFound(_0x31a27c,null))[_0xf482('0x26')](saveUpdates(_0x32bac2[_0xf482('0x4d')],null))[_0xf482('0x26')](respondWithResult(_0x31a27c,null))[_0xf482('0x4b')](handleError(_0x31a27c,null));};exports[_0xf482('0x27')]=function(_0x4e6bd2,_0x3702c6){return db[_0xf482('0x30')][_0xf482('0x4a')]({'where':{'id':_0x4e6bd2[_0xf482('0x49')]['id']}})[_0xf482('0x26')](handleEntityNotFound(_0x3702c6,null))[_0xf482('0x26')](removeEntity(_0x3702c6,null))['catch'](handleError(_0x3702c6,null));};exports[_0xf482('0x4e')]=function(_0x12207c,_0x2374b7,_0x26923f){var _0x2bef6f={};var _0x47570c={};var _0x3f8e96;var _0x1742d2;return db[_0xf482('0x30')][_0xf482('0x4f')]({'where':{'id':_0x12207c[_0xf482('0x49')]['id']}})[_0xf482('0x26')](handleEntityNotFound(_0x2374b7,null))[_0xf482('0x26')](function(_0xa64793){if(_0xa64793){_0x3f8e96=_0xa64793;_0x47570c[_0xf482('0x35')]=_[_0xf482('0x37')](db[_0xf482('0x50')][_0xf482('0x31')]);_0x47570c[_0xf482('0x36')]=_['keys'](_0x12207c[_0xf482('0x36')]);_0x47570c[_0xf482('0x38')]=_[_0xf482('0x39')](_0x47570c[_0xf482('0x35')],_0x47570c[_0xf482('0x36')]);_0x2bef6f['attributes']=_['intersection'](_0x47570c[_0xf482('0x35')],qs[_0xf482('0x3a')](_0x12207c['query'][_0xf482('0x3a')]));_0x2bef6f[_0xf482('0x3b')]=_0x2bef6f[_0xf482('0x3b')]['length']?_0x2bef6f[_0xf482('0x3b')]:_0x47570c[_0xf482('0x35')];_0x2bef6f[_0xf482('0x51')]=qs[_0xf482('0x3f')](_0x12207c[_0xf482('0x36')][_0xf482('0x3f')]);_0x2bef6f[_0xf482('0x42')]=qs[_0xf482('0x38')](_[_0xf482('0x40')](_0x12207c[_0xf482('0x36')],_0x47570c[_0xf482('0x38')]));if(_0x12207c['query'][_0xf482('0x41')]){_0x2bef6f[_0xf482('0x42')]=_[_0xf482('0x43')](_0x2bef6f[_0xf482('0x42')],{'$or':_[_0xf482('0x2f')](_0x2bef6f[_0xf482('0x3b')],function(_0x59ddf2){var _0x3e6b42={};_0x3e6b42[_0x59ddf2]={'$like':'%'+_0x12207c[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0x3e6b42;})});}_0x2bef6f=_[_0xf482('0x43')]({},_0x2bef6f,_0x12207c[_0xf482('0x45')]);return _0x3f8e96['getFields'](_0x2bef6f);}})[_0xf482('0x26')](function(_0x17a0db){if(_0x17a0db){_0x1742d2=_0x17a0db[_0xf482('0x3c')];if(!_0x12207c['query'][_0xf482('0x3d')]('nolimit')){_0x2bef6f['limit']=qs[_0xf482('0x1e')](_0x12207c[_0xf482('0x36')][_0xf482('0x1e')]);_0x2bef6f['offset']=qs[_0xf482('0x1c')](_0x12207c['query'][_0xf482('0x1c')]);}return _0x3f8e96[_0xf482('0x4e')](_0x2bef6f);}})[_0xf482('0x26')](function(_0x10f56a){if(_0x10f56a){return _0x10f56a?{'count':_0x1742d2,'rows':_0x10f56a}:null;}})[_0xf482('0x26')](respondWithResult(_0x2374b7,null))['catch'](handleError(_0x2374b7,null));};exports[_0xf482('0x52')]=function(_0x388966,_0x29936a,_0x29eea0){var _0x79f45c={};var _0x1a691a={};var _0x1ca4f2;var _0x11cbaa;return db[_0xf482('0x30')][_0xf482('0x4f')]({'where':{'id':_0x388966[_0xf482('0x49')]['id']}})['then'](handleEntityNotFound(_0x29936a,null))[_0xf482('0x26')](function(_0x4dbca6){if(_0x4dbca6){_0x1ca4f2=_0x4dbca6;_0x1a691a[_0xf482('0x35')]=_[_0xf482('0x37')](db['ServicenowField'][_0xf482('0x31')]);_0x1a691a[_0xf482('0x36')]=_[_0xf482('0x37')](_0x388966['query']);_0x1a691a[_0xf482('0x38')]=_[_0xf482('0x39')](_0x1a691a[_0xf482('0x35')],_0x1a691a[_0xf482('0x36')]);_0x79f45c[_0xf482('0x3b')]=_['intersection'](_0x1a691a[_0xf482('0x35')],qs['fields'](_0x388966['query'][_0xf482('0x3a')]));_0x79f45c[_0xf482('0x3b')]=_0x79f45c[_0xf482('0x3b')]['length']?_0x79f45c[_0xf482('0x3b')]:_0x1a691a[_0xf482('0x35')];_0x79f45c[_0xf482('0x51')]=qs[_0xf482('0x3f')](_0x388966[_0xf482('0x36')]['sort']);_0x79f45c[_0xf482('0x42')]=qs['filters'](_[_0xf482('0x40')](_0x388966[_0xf482('0x36')],_0x1a691a['filters']));if(_0x388966[_0xf482('0x36')]['filter']){_0x79f45c[_0xf482('0x42')]=_['merge'](_0x79f45c[_0xf482('0x42')],{'$or':_[_0xf482('0x2f')](_0x79f45c['attributes'],function(_0x482ed9){var _0x264a2e={};_0x264a2e[_0x482ed9]={'$like':'%'+_0x388966[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0x264a2e;})});}_0x79f45c=_[_0xf482('0x43')]({},_0x79f45c,_0x388966[_0xf482('0x45')]);return _0x1ca4f2[_0xf482('0x52')](_0x79f45c);}})[_0xf482('0x26')](function(_0x5ef78d){if(_0x5ef78d){_0x11cbaa=_0x5ef78d[_0xf482('0x3c')];if(!_0x388966[_0xf482('0x36')]['hasOwnProperty'](_0xf482('0x3e'))){_0x79f45c[_0xf482('0x1e')]=qs['limit'](_0x388966['query'][_0xf482('0x1e')]);_0x79f45c[_0xf482('0x1c')]=qs['offset'](_0x388966['query'][_0xf482('0x1c')]);}return _0x1ca4f2[_0xf482('0x52')](_0x79f45c);}})['then'](function(_0x20eee5){if(_0x20eee5){return _0x20eee5?{'count':_0x11cbaa,'rows':_0x20eee5}:null;}})['then'](respondWithResult(_0x29936a,null))[_0xf482('0x4b')](handleError(_0x29936a,null));};exports[_0xf482('0x53')]=function(_0x23807e,_0x41b7ae,_0x1b826a){var _0x37f535={};var _0x547ae2={};var _0x42044c;var _0x51c285;return db[_0xf482('0x30')]['findOne']({'where':{'id':_0x23807e[_0xf482('0x49')]['id']}})['then'](handleEntityNotFound(_0x41b7ae,null))['then'](function(_0x35e494){if(_0x35e494){_0x42044c=_0x35e494;_0x547ae2['model']=_[_0xf482('0x37')](db[_0xf482('0x50')][_0xf482('0x31')]);_0x547ae2[_0xf482('0x36')]=_[_0xf482('0x37')](_0x23807e[_0xf482('0x36')]);_0x547ae2[_0xf482('0x38')]=_[_0xf482('0x39')](_0x547ae2['model'],_0x547ae2[_0xf482('0x36')]);_0x37f535[_0xf482('0x3b')]=_[_0xf482('0x39')](_0x547ae2[_0xf482('0x35')],qs['fields'](_0x23807e[_0xf482('0x36')][_0xf482('0x3a')]));_0x37f535[_0xf482('0x3b')]=_0x37f535[_0xf482('0x3b')][_0xf482('0x3c')]?_0x37f535['attributes']:_0x547ae2[_0xf482('0x35')];_0x37f535[_0xf482('0x51')]=qs['sort'](_0x23807e[_0xf482('0x36')]['sort']);_0x37f535[_0xf482('0x42')]=qs[_0xf482('0x38')](_[_0xf482('0x40')](_0x23807e[_0xf482('0x36')],_0x547ae2[_0xf482('0x38')]));if(_0x23807e['query'][_0xf482('0x41')]){_0x37f535[_0xf482('0x42')]=_[_0xf482('0x43')](_0x37f535['where'],{'$or':_[_0xf482('0x2f')](_0x37f535[_0xf482('0x3b')],function(_0x4e6e07){var _0xdc50d={};_0xdc50d[_0x4e6e07]={'$like':'%'+_0x23807e[_0xf482('0x36')][_0xf482('0x41')]+'%'};return _0xdc50d;})});}_0x37f535=_[_0xf482('0x43')]({},_0x37f535,_0x23807e[_0xf482('0x45')]);return _0x42044c[_0xf482('0x53')](_0x37f535);}})[_0xf482('0x26')](function(_0x429ed7){if(_0x429ed7){_0x51c285=_0x429ed7['length'];if(!_0x23807e[_0xf482('0x36')][_0xf482('0x3d')]('nolimit')){_0x37f535['limit']=qs[_0xf482('0x1e')](_0x23807e[_0xf482('0x36')]['limit']);_0x37f535[_0xf482('0x1c')]=qs[_0xf482('0x1c')](_0x23807e[_0xf482('0x36')]['offset']);}return _0x42044c['getDescriptions'](_0x37f535);}})[_0xf482('0x26')](function(_0x5b26d9){if(_0x5b26d9){return _0x5b26d9?{'count':_0x51c285,'rows':_0x5b26d9}:null;}})['then'](respondWithResult(_0x41b7ae,null))[_0xf482('0x4b')](handleError(_0x41b7ae,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b2057ca..f41152c 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 _0x56dc=['int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0x2225c9,_0xe99b2e){var _0xe7b099=function(_0x3dd76d){while(--_0x3dd76d){_0x2225c9['push'](_0x2225c9['shift']());}};_0xe7b099(++_0xe99b2e);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc56d('0x0'));var util=require('util');var logger=require(_0xc56d('0x1'))(_0xc56d('0x2'));var moment=require(_0xc56d('0x3'));var BPromise=require(_0xc56d('0x4'));var rp=require(_0xc56d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc56d('0x6'));var config=require(_0xc56d('0x7'));var attributes=require(_0xc56d('0x8'));module[_0xc56d('0x9')]=function(_0x3eb4ed,_0x3e68f4){return _0x3eb4ed['define'](_0xc56d('0xa'),attributes,{'tableName':_0xc56d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d86=['int_servicenow_configurations','lodash','util','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x549899,_0x5edefe){var _0x53cc91=function(_0x5e0ba3){while(--_0x5e0ba3){_0x549899['push'](_0x549899['shift']());}};_0x53cc91(++_0x5edefe);}(_0x5d86,0x76));var _0x65d8=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x5d86[_0x180c9b];return _0x3ff116;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x65d8('0x3'));var fs=require('fs');var path=require(_0x65d8('0x4'));var rimraf=require('rimraf');var config=require(_0x65d8('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x65d8('0x6')]=function(_0x50c922,_0x1581a6){return _0x50c922[_0x65d8('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0x65d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index faa1822..f00e91c 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 _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x687b,0x14a));var _0xb687=function(_0x8a217e,_0x450bfc){_0x8a217e=_0x8a217e-0x0;var _0x3fc350=_0x687b[_0x8a217e];return _0x3fc350;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file +var _0xef78=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x39f28c,_0x53199a){var _0x4ca8d9=function(_0x515895){while(--_0x515895){_0x39f28c['push'](_0x39f28c['shift']());}};_0x4ca8d9(++_0x53199a);}(_0xef78,0x18b));var _0x8ef7=function(_0x2507c0,_0x31c7f1){_0x2507c0=_0x2507c0-0x0;var _0x40eb0d=_0xef78[_0x2507c0];return _0x40eb0d;};'use strict';var _=require(_0x8ef7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ef7('0x1'));var rs=require(_0x8ef7('0x2'));var fs=require('fs');var Redis=require(_0x8ef7('0x3'));var db=require(_0x8ef7('0x4'))['db'];var utils=require(_0x8ef7('0x5'));var logger=require(_0x8ef7('0x6'))(_0x8ef7('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ef7('0x8'));var client=jayson['client'][_0x8ef7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1ed0,_0x717607,_0x42e91b){return new BPromise(function(_0x54be63,_0x7f1f4f){return client[_0x8ef7('0xa')](_0x4d1ed0,_0x42e91b)[_0x8ef7('0xb')](function(_0x1df65a){logger[_0x8ef7('0xc')](_0x8ef7('0xd'),_0x717607,_0x8ef7('0xe'));logger['debug'](_0x8ef7('0xf'),_0x717607,_0x8ef7('0xe'),JSON['stringify'](_0x1df65a));if(_0x1df65a[_0x8ef7('0x10')]){if(_0x1df65a[_0x8ef7('0x10')]['code']===0x1f4){logger[_0x8ef7('0x10')](_0x8ef7('0xd'),_0x717607,_0x1df65a[_0x8ef7('0x10')][_0x8ef7('0x11')]);return _0x7f1f4f(_0x1df65a['error'][_0x8ef7('0x11')]);}logger[_0x8ef7('0x10')](_0x8ef7('0xd'),_0x717607,_0x1df65a[_0x8ef7('0x10')]['message']);return _0x54be63(_0x1df65a[_0x8ef7('0x10')]['message']);}else{logger['info'](_0x8ef7('0xd'),_0x717607,_0x8ef7('0xe'));_0x54be63(_0x1df65a[_0x8ef7('0x12')][_0x8ef7('0x11')]);}})['catch'](function(_0x518af0){logger[_0x8ef7('0x10')](_0x8ef7('0xd'),_0x717607,_0x518af0);_0x7f1f4f(_0x518af0);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 5cc2a15..b3cf732 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 _0xa799=['create','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intServicenowField.controller','isAuthenticated'];(function(_0x380775,_0x348799){var _0x2d39d7=function(_0x4fd2e0){while(--_0x4fd2e0){_0x380775['push'](_0x380775['shift']());}};_0x2d39d7(++_0x348799);}(_0xa799,0x156));var _0x9a79=function(_0xb69076,_0x164c72){_0xb69076=_0xb69076-0x0;var _0x211b86=_0xa799[_0xb69076];return _0x211b86;};'use strict';var multer=require(_0x9a79('0x0'));var util=require('util');var path=require(_0x9a79('0x1'));var timeout=require(_0x9a79('0x2'));var express=require('express');var router=express[_0x9a79('0x3')]();var fs_extra=require(_0x9a79('0x4'));var auth=require(_0x9a79('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a79('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9a79('0x7')](),controller[_0x9a79('0x8')]);router[_0x9a79('0x9')](_0x9a79('0xa'),auth[_0x9a79('0x7')](),controller[_0x9a79('0xb')]);router['delete'](_0x9a79('0xa'),auth[_0x9a79('0x7')](),controller[_0x9a79('0xc')]);module[_0x9a79('0xd')]=router; \ No newline at end of file +var _0xce6e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','show','post','/:id','delete','exports','multer','util','path','express'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0xce6e,0x15c));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xece6('0x0'));var util=require(_0xece6('0x1'));var path=require(_0xece6('0x2'));var timeout=require('connect-timeout');var express=require(_0xece6('0x3'));var router=express[_0xece6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xece6('0x5'));var interaction=require(_0xece6('0x6'));var config=require(_0xece6('0x7'));var controller=require(_0xece6('0x8'));router['get']('/',auth[_0xece6('0x9')](),controller['index']);router[_0xece6('0xa')]('/:id',auth[_0xece6('0x9')](),controller[_0xece6('0xb')]);router[_0xece6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xece6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xece6('0xe')](_0xece6('0xd'),auth[_0xece6('0x9')](),controller['destroy']);module[_0xece6('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4da7696..db20a81 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 _0xfe11=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xfe11,0x163));var _0x1fe1=function(_0x453704,_0xcf42a8){_0x453704=_0x453704-0x0;var _0x1d1ba5=_0xfe11[_0x453704];return _0x1d1ba5;};'use strict';var Sequelize=require(_0x1fe1('0x0'));module[_0x1fe1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1fe1('0x2'),_0x1fe1('0x3'),_0x1fe1('0x4'),'keyValue','picklist'),'defaultValue':_0x1fe1('0x2')},'content':{'type':Sequelize[_0x1fe1('0x5')]},'key':{'type':Sequelize[_0x1fe1('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x1fe1('0x5')]},'idField':{'type':Sequelize[_0x1fe1('0x5')]},'nameField':{'type':Sequelize[_0x1fe1('0x5')]},'customField':{'type':Sequelize[_0x1fe1('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xceae=['string','STRING','ENUM','sequelize','exports','variable','customVariable','keyValue','picklist'];(function(_0x4555aa,_0x1edfcf){var _0x3bccd9=function(_0x2313e6){while(--_0x2313e6){_0x4555aa['push'](_0x4555aa['shift']());}};_0x3bccd9(++_0x1edfcf);}(_0xceae,0xa5));var _0xecea=function(_0x36d45b,_0x417426){_0x36d45b=_0x36d45b-0x0;var _0x3dc01c=_0xceae[_0x36d45b];return _0x3dc01c;};'use strict';var Sequelize=require(_0xecea('0x0'));module[_0xecea('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xecea('0x2'),_0xecea('0x3'),_0xecea('0x4'),_0xecea('0x5')),'defaultValue':_0xecea('0x6')},'content':{'type':Sequelize[_0xecea('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xecea('0x8')](_0xecea('0x6'),_0xecea('0x2'),_0xecea('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xecea('0x7')]},'nameField':{'type':Sequelize[_0xecea('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xecea('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 0bbee0b..0eda542 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 _0x92d5=['order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2a9dc3,_0xef4807){var _0x501b91=function(_0x124e5e){while(--_0x124e5e){_0x2a9dc3['push'](_0x2a9dc3['shift']());}};_0x501b91(++_0xef4807);}(_0x92d5,0x17f));var _0x592d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x92d5[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x592d('0x0'));var rimraf=require(_0x592d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x592d('0x2'));var rp=require(_0x592d('0x3'));var moment=require('moment');var BPromise=require(_0x592d('0x4'));var Mustache=require(_0x592d('0x5'));var util=require(_0x592d('0x6'));var path=require(_0x592d('0x7'));var sox=require(_0x592d('0x8'));var csv=require(_0x592d('0x9'));var ejs=require(_0x592d('0xa'));var fs=require('fs');var fs_extra=require(_0x592d('0xb'));var _=require(_0x592d('0xc'));var squel=require(_0x592d('0xd'));var crypto=require(_0x592d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x592d('0x9'));var querystring=require(_0x592d('0xf'));var Papa=require(_0x592d('0x10'));var Redis=require(_0x592d('0x11'));var authService=require(_0x592d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x592d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x592d('0x14'));var utils=require('../../config/utils');var config=require(_0x592d('0x15'));var licenseUtil=require(_0x592d('0x16'));var db=require(_0x592d('0x17'))['db'];function respondWithStatusCode(_0x1213c0,_0x26426b){_0x26426b=_0x26426b||0xcc;return function(_0xbdd003){if(_0xbdd003){return _0x1213c0[_0x592d('0x18')](_0x26426b);}return _0x1213c0[_0x592d('0x19')](_0x26426b)['end']();};}function respondWithResult(_0x2c621d,_0x2d94d3){_0x2d94d3=_0x2d94d3||0xc8;return function(_0x4c4d3d){if(_0x4c4d3d){return _0x2c621d[_0x592d('0x19')](_0x2d94d3)['json'](_0x4c4d3d);}};}function respondWithFilteredResult(_0x47228b,_0x5d9a57){return function(_0x17fc86){if(_0x17fc86){var _0x54f053=typeof _0x5d9a57[_0x592d('0x1a')]===_0x592d('0x1b')&&typeof _0x5d9a57['limit']===_0x592d('0x1b');var _0x5b69a9=_0x17fc86[_0x592d('0x1c')];var _0x29fa26=_0x54f053?0x0:_0x5d9a57['offset'];var _0x4f3fc8=_0x54f053?_0x17fc86[_0x592d('0x1c')]:_0x5d9a57[_0x592d('0x1a')]+_0x5d9a57[_0x592d('0x1d')];var _0x500934;if(_0x4f3fc8>=_0x5b69a9){_0x4f3fc8=_0x5b69a9;_0x500934=0xc8;}else{_0x500934=0xce;}_0x47228b['status'](_0x500934);return _0x47228b['set'](_0x592d('0x1e'),_0x29fa26+'-'+_0x4f3fc8+'/'+_0x5b69a9)[_0x592d('0x1f')](_0x17fc86);}return null;};}function patchUpdates(_0x12120b){return function(_0x3b0c89){try{jsonpatch['apply'](_0x3b0c89,_0x12120b,!![]);}catch(_0x16d61e){return BPromise[_0x592d('0x20')](_0x16d61e);}return _0x3b0c89[_0x592d('0x21')]();};}function saveUpdates(_0x507845,_0x28f24f){return function(_0x3c5f16){if(_0x3c5f16){return _0x3c5f16[_0x592d('0x22')](_0x507845)[_0x592d('0x23')](function(_0x29ee1d){return _0x29ee1d;});}return null;};}function removeEntity(_0x5a1824,_0x412849){return function(_0x1e46eb){if(_0x1e46eb){return _0x1e46eb[_0x592d('0x24')]()[_0x592d('0x23')](function(){_0x5a1824[_0x592d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c653,_0x2e39fb){return function(_0xa3a9ea){if(!_0xa3a9ea){_0x25c653[_0x592d('0x18')](0x194);}return _0xa3a9ea;};}function handleError(_0x4429d8,_0x31a211){_0x31a211=_0x31a211||0x1f4;return function(_0xa76e1){logger[_0x592d('0x25')](_0xa76e1['stack']);if(_0xa76e1[_0x592d('0x26')]){delete _0xa76e1['name'];}_0x4429d8[_0x592d('0x19')](_0x31a211)[_0x592d('0x27')](_0xa76e1);};}exports[_0x592d('0x28')]=function(_0x309519,_0x512ec4){var _0xc047c8={},_0x40c34d={},_0x2c4f63={'count':0x0,'rows':[]};var _0x1c85d8=_[_0x592d('0x29')](db[_0x592d('0x2a')][_0x592d('0x2b')],function(_0xfbdc00){return{'name':_0xfbdc00[_0x592d('0x2c')],'type':_0xfbdc00[_0x592d('0x2d')]['key']};});_0x40c34d[_0x592d('0x2e')]=_[_0x592d('0x29')](_0x1c85d8,_0x592d('0x26'));_0x40c34d['query']=_[_0x592d('0x2f')](_0x309519[_0x592d('0x30')]);_0x40c34d[_0x592d('0x31')]=_[_0x592d('0x32')](_0x40c34d['model'],_0x40c34d[_0x592d('0x30')]);_0xc047c8[_0x592d('0x33')]=_[_0x592d('0x32')](_0x40c34d[_0x592d('0x2e')],qs[_0x592d('0x34')](_0x309519['query']['fields']));_0xc047c8['attributes']=_0xc047c8[_0x592d('0x33')]['length']?_0xc047c8['attributes']:_0x40c34d[_0x592d('0x2e')];if(!_0x309519[_0x592d('0x30')][_0x592d('0x35')](_0x592d('0x36'))){_0xc047c8['limit']=qs['limit'](_0x309519[_0x592d('0x30')][_0x592d('0x1d')]);_0xc047c8[_0x592d('0x1a')]=qs['offset'](_0x309519[_0x592d('0x30')][_0x592d('0x1a')]);}_0xc047c8[_0x592d('0x37')]=qs[_0x592d('0x38')](_0x309519['query'][_0x592d('0x38')]);_0xc047c8['where']=qs[_0x592d('0x31')](_[_0x592d('0x39')](_0x309519[_0x592d('0x30')],_0x40c34d['filters']),_0x1c85d8);if(_0x309519[_0x592d('0x30')][_0x592d('0x3a')]){_0xc047c8[_0x592d('0x3b')]=_[_0x592d('0x3c')](_0xc047c8[_0x592d('0x3b')],{'$or':_[_0x592d('0x29')](_0x1c85d8,function(_0x365f1d){if(_0x365f1d[_0x592d('0x2d')]!==_0x592d('0x3d')){var _0xac689a={};_0xac689a[_0x365f1d['name']]={'$like':'%'+_0x309519['query'][_0x592d('0x3a')]+'%'};return _0xac689a;}})});}_0xc047c8=_[_0x592d('0x3c')]({},_0xc047c8,_0x309519[_0x592d('0x3e')]);var _0x3a7343={'where':_0xc047c8[_0x592d('0x3b')]};return db['ServicenowField']['count'](_0x3a7343)[_0x592d('0x23')](function(_0x1cf6be){_0x2c4f63[_0x592d('0x1c')]=_0x1cf6be;if(_0x309519[_0x592d('0x30')][_0x592d('0x3f')]){_0xc047c8[_0x592d('0x40')]=[{'all':!![]}];}return db['ServicenowField'][_0x592d('0x41')](_0xc047c8);})['then'](function(_0x13bae1){_0x2c4f63[_0x592d('0x42')]=_0x13bae1;return _0x2c4f63;})[_0x592d('0x23')](respondWithFilteredResult(_0x512ec4,_0xc047c8))[_0x592d('0x43')](handleError(_0x512ec4,null));};exports['show']=function(_0x27050e,_0x2078fd){var _0x40caf7={'raw':!![],'where':{'id':_0x27050e[_0x592d('0x44')]['id']}},_0x45efc5={};_0x45efc5[_0x592d('0x2e')]=_[_0x592d('0x2f')](db[_0x592d('0x2a')][_0x592d('0x2b')]);_0x45efc5[_0x592d('0x30')]=_[_0x592d('0x2f')](_0x27050e[_0x592d('0x30')]);_0x45efc5['filters']=_[_0x592d('0x32')](_0x45efc5[_0x592d('0x2e')],_0x45efc5['query']);_0x40caf7[_0x592d('0x33')]=_['intersection'](_0x45efc5[_0x592d('0x2e')],qs[_0x592d('0x34')](_0x27050e['query'][_0x592d('0x34')]));_0x40caf7[_0x592d('0x33')]=_0x40caf7[_0x592d('0x33')][_0x592d('0x45')]?_0x40caf7[_0x592d('0x33')]:_0x45efc5[_0x592d('0x2e')];if(_0x27050e[_0x592d('0x30')][_0x592d('0x3f')]){_0x40caf7[_0x592d('0x40')]=[{'all':!![]}];}_0x40caf7=_[_0x592d('0x3c')]({},_0x40caf7,_0x27050e[_0x592d('0x3e')]);return db['ServicenowField']['find'](_0x40caf7)[_0x592d('0x23')](handleEntityNotFound(_0x2078fd,null))[_0x592d('0x23')](respondWithResult(_0x2078fd,null))['catch'](handleError(_0x2078fd,null));};exports[_0x592d('0x46')]=function(_0xf87d95,_0x1bb821){return db['ServicenowField'][_0x592d('0x46')](_0xf87d95[_0x592d('0x47')],{})[_0x592d('0x23')](respondWithResult(_0x1bb821,0xc9))['catch'](handleError(_0x1bb821,null));};exports[_0x592d('0x22')]=function(_0x25457a,_0x2ac47c){if(_0x25457a['body']['id']){delete _0x25457a[_0x592d('0x47')]['id'];}return db['ServicenowField'][_0x592d('0x48')]({'where':{'id':_0x25457a[_0x592d('0x44')]['id']}})[_0x592d('0x23')](handleEntityNotFound(_0x2ac47c,null))[_0x592d('0x23')](saveUpdates(_0x25457a['body'],null))[_0x592d('0x23')](respondWithResult(_0x2ac47c,null))[_0x592d('0x43')](handleError(_0x2ac47c,null));};exports[_0x592d('0x24')]=function(_0x701fd0,_0x360b55){return db[_0x592d('0x2a')][_0x592d('0x48')]({'where':{'id':_0x701fd0[_0x592d('0x44')]['id']}})['then'](handleEntityNotFound(_0x360b55,null))['then'](removeEntity(_0x360b55,null))[_0x592d('0x43')](handleError(_0x360b55,null));}; \ No newline at end of file +var _0x6e3f=['ServicenowField','findAll','rows','catch','show','params','merge','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6e3f,0x191));var _0xf6e3=function(_0x4d4141,_0x404fb1){_0x4d4141=_0x4d4141-0x0;var _0xe29ea5=_0x6e3f[_0x4d4141];return _0xe29ea5;};'use strict';var emlformat=require(_0xf6e3('0x0'));var rimraf=require(_0xf6e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6e3('0x2'));var rp=require(_0xf6e3('0x3'));var moment=require(_0xf6e3('0x4'));var BPromise=require(_0xf6e3('0x5'));var Mustache=require(_0xf6e3('0x6'));var util=require('util');var path=require(_0xf6e3('0x7'));var sox=require(_0xf6e3('0x8'));var csv=require(_0xf6e3('0x9'));var ejs=require(_0xf6e3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6e3('0xb'));var squel=require(_0xf6e3('0xc'));var crypto=require(_0xf6e3('0xd'));var jsforce=require(_0xf6e3('0xe'));var deskjs=require(_0xf6e3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf6e3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf6e3('0x11'));var qs=require(_0xf6e3('0x12'));var as=require(_0xf6e3('0x13'));var hardwareService=require(_0xf6e3('0x14'));var logger=require(_0xf6e3('0x15'))(_0xf6e3('0x16'));var utils=require(_0xf6e3('0x17'));var config=require(_0xf6e3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6e3('0x19'))['db'];function respondWithStatusCode(_0x5ed64b,_0x5b253e){_0x5b253e=_0x5b253e||0xcc;return function(_0x38ff0d){if(_0x38ff0d){return _0x5ed64b['sendStatus'](_0x5b253e);}return _0x5ed64b[_0xf6e3('0x1a')](_0x5b253e)[_0xf6e3('0x1b')]();};}function respondWithResult(_0x5d2077,_0x431e2b){_0x431e2b=_0x431e2b||0xc8;return function(_0x4ee2ec){if(_0x4ee2ec){return _0x5d2077['status'](_0x431e2b)['json'](_0x4ee2ec);}};}function respondWithFilteredResult(_0x4487dd,_0x1b150e){return function(_0x476d6e){if(_0x476d6e){var _0x1aa4bf=typeof _0x1b150e[_0xf6e3('0x1c')]===_0xf6e3('0x1d')&&typeof _0x1b150e['limit']===_0xf6e3('0x1d');var _0xe39462=_0x476d6e[_0xf6e3('0x1e')];var _0x3777c7=_0x1aa4bf?0x0:_0x1b150e[_0xf6e3('0x1c')];var _0x4feed2=_0x1aa4bf?_0x476d6e[_0xf6e3('0x1e')]:_0x1b150e[_0xf6e3('0x1c')]+_0x1b150e[_0xf6e3('0x1f')];var _0x2365f2;if(_0x4feed2>=_0xe39462){_0x4feed2=_0xe39462;_0x2365f2=0xc8;}else{_0x2365f2=0xce;}_0x4487dd['status'](_0x2365f2);return _0x4487dd[_0xf6e3('0x20')](_0xf6e3('0x21'),_0x3777c7+'-'+_0x4feed2+'/'+_0xe39462)[_0xf6e3('0x22')](_0x476d6e);}return null;};}function patchUpdates(_0x190e21){return function(_0x2d3f80){try{jsonpatch[_0xf6e3('0x23')](_0x2d3f80,_0x190e21,!![]);}catch(_0x50dff0){return BPromise[_0xf6e3('0x24')](_0x50dff0);}return _0x2d3f80[_0xf6e3('0x25')]();};}function saveUpdates(_0xa1150,_0x3bda29){return function(_0x2970f9){if(_0x2970f9){return _0x2970f9[_0xf6e3('0x26')](_0xa1150)[_0xf6e3('0x27')](function(_0xbad9d9){return _0xbad9d9;});}return null;};}function removeEntity(_0x59f076,_0x5922b9){return function(_0x4d86fe){if(_0x4d86fe){return _0x4d86fe['destroy']()['then'](function(){_0x59f076[_0xf6e3('0x1a')](0xcc)[_0xf6e3('0x1b')]();});}};}function handleEntityNotFound(_0x5eab35,_0x57d2d7){return function(_0x3f5726){if(!_0x3f5726){_0x5eab35['sendStatus'](0x194);}return _0x3f5726;};}function handleError(_0x502e,_0xe72e93){_0xe72e93=_0xe72e93||0x1f4;return function(_0x4ec1b6){logger[_0xf6e3('0x28')](_0x4ec1b6[_0xf6e3('0x29')]);if(_0x4ec1b6['name']){delete _0x4ec1b6[_0xf6e3('0x2a')];}_0x502e[_0xf6e3('0x1a')](_0xe72e93)['send'](_0x4ec1b6);};}exports[_0xf6e3('0x2b')]=function(_0x1503e8,_0x5cbdde){var _0x654006={},_0x10da61={},_0x29cc66={'count':0x0,'rows':[]};var _0x52aaea=_[_0xf6e3('0x2c')](db['ServicenowField'][_0xf6e3('0x2d')],function(_0x159231){return{'name':_0x159231[_0xf6e3('0x2e')],'type':_0x159231['type'][_0xf6e3('0x2f')]};});_0x10da61[_0xf6e3('0x30')]=_[_0xf6e3('0x2c')](_0x52aaea,_0xf6e3('0x2a'));_0x10da61[_0xf6e3('0x31')]=_[_0xf6e3('0x32')](_0x1503e8['query']);_0x10da61['filters']=_[_0xf6e3('0x33')](_0x10da61[_0xf6e3('0x30')],_0x10da61['query']);_0x654006[_0xf6e3('0x34')]=_[_0xf6e3('0x33')](_0x10da61[_0xf6e3('0x30')],qs['fields'](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x35')]));_0x654006[_0xf6e3('0x34')]=_0x654006[_0xf6e3('0x34')][_0xf6e3('0x36')]?_0x654006[_0xf6e3('0x34')]:_0x10da61[_0xf6e3('0x30')];if(!_0x1503e8['query']['hasOwnProperty'](_0xf6e3('0x37'))){_0x654006[_0xf6e3('0x1f')]=qs[_0xf6e3('0x1f')](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x1f')]);_0x654006[_0xf6e3('0x1c')]=qs[_0xf6e3('0x1c')](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x1c')]);}_0x654006[_0xf6e3('0x38')]=qs[_0xf6e3('0x39')](_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x39')]);_0x654006[_0xf6e3('0x3a')]=qs['filters'](_[_0xf6e3('0x3b')](_0x1503e8[_0xf6e3('0x31')],_0x10da61[_0xf6e3('0x3c')]),_0x52aaea);if(_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x3d')]){_0x654006[_0xf6e3('0x3a')]=_['merge'](_0x654006[_0xf6e3('0x3a')],{'$or':_['map'](_0x52aaea,function(_0x1f237e){if(_0x1f237e[_0xf6e3('0x3e')]!==_0xf6e3('0x3f')){var _0x19339b={};_0x19339b[_0x1f237e[_0xf6e3('0x2a')]]={'$like':'%'+_0x1503e8['query'][_0xf6e3('0x3d')]+'%'};return _0x19339b;}})});}_0x654006=_['merge']({},_0x654006,_0x1503e8[_0xf6e3('0x40')]);var _0x1d8406={'where':_0x654006[_0xf6e3('0x3a')]};return db['ServicenowField'][_0xf6e3('0x1e')](_0x1d8406)[_0xf6e3('0x27')](function(_0x441191){_0x29cc66[_0xf6e3('0x1e')]=_0x441191;if(_0x1503e8[_0xf6e3('0x31')][_0xf6e3('0x41')]){_0x654006[_0xf6e3('0x42')]=[{'all':!![]}];}return db[_0xf6e3('0x43')][_0xf6e3('0x44')](_0x654006);})[_0xf6e3('0x27')](function(_0x5a898a){_0x29cc66[_0xf6e3('0x45')]=_0x5a898a;return _0x29cc66;})[_0xf6e3('0x27')](respondWithFilteredResult(_0x5cbdde,_0x654006))[_0xf6e3('0x46')](handleError(_0x5cbdde,null));};exports[_0xf6e3('0x47')]=function(_0x3e4690,_0x3f5348){var _0x4dacaa={'raw':!![],'where':{'id':_0x3e4690[_0xf6e3('0x48')]['id']}},_0x309b87={};_0x309b87[_0xf6e3('0x30')]=_['keys'](db[_0xf6e3('0x43')][_0xf6e3('0x2d')]);_0x309b87[_0xf6e3('0x31')]=_[_0xf6e3('0x32')](_0x3e4690['query']);_0x309b87[_0xf6e3('0x3c')]=_['intersection'](_0x309b87[_0xf6e3('0x30')],_0x309b87['query']);_0x4dacaa[_0xf6e3('0x34')]=_['intersection'](_0x309b87[_0xf6e3('0x30')],qs[_0xf6e3('0x35')](_0x3e4690[_0xf6e3('0x31')][_0xf6e3('0x35')]));_0x4dacaa[_0xf6e3('0x34')]=_0x4dacaa[_0xf6e3('0x34')][_0xf6e3('0x36')]?_0x4dacaa[_0xf6e3('0x34')]:_0x309b87[_0xf6e3('0x30')];if(_0x3e4690[_0xf6e3('0x31')][_0xf6e3('0x41')]){_0x4dacaa[_0xf6e3('0x42')]=[{'all':!![]}];}_0x4dacaa=_[_0xf6e3('0x49')]({},_0x4dacaa,_0x3e4690['options']);return db[_0xf6e3('0x43')][_0xf6e3('0x4a')](_0x4dacaa)[_0xf6e3('0x27')](handleEntityNotFound(_0x3f5348,null))[_0xf6e3('0x27')](respondWithResult(_0x3f5348,null))['catch'](handleError(_0x3f5348,null));};exports[_0xf6e3('0x4b')]=function(_0x918d7e,_0x56d38b){return db[_0xf6e3('0x43')][_0xf6e3('0x4b')](_0x918d7e[_0xf6e3('0x4c')],{})[_0xf6e3('0x27')](respondWithResult(_0x56d38b,0xc9))['catch'](handleError(_0x56d38b,null));};exports['update']=function(_0x35d7e0,_0x331efb){if(_0x35d7e0[_0xf6e3('0x4c')]['id']){delete _0x35d7e0[_0xf6e3('0x4c')]['id'];}return db['ServicenowField'][_0xf6e3('0x4a')]({'where':{'id':_0x35d7e0['params']['id']}})[_0xf6e3('0x27')](handleEntityNotFound(_0x331efb,null))['then'](saveUpdates(_0x35d7e0[_0xf6e3('0x4c')],null))[_0xf6e3('0x27')](respondWithResult(_0x331efb,null))['catch'](handleError(_0x331efb,null));};exports[_0xf6e3('0x4d')]=function(_0x2f61df,_0xffd8d7){return db[_0xf6e3('0x43')][_0xf6e3('0x4a')]({'where':{'id':_0x2f61df[_0xf6e3('0x48')]['id']}})['then'](handleEntityNotFound(_0xffd8d7,null))[_0xf6e3('0x27')](removeEntity(_0xffd8d7,null))['catch'](handleError(_0xffd8d7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 514b8c1..d5c5f5e 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 _0x263e=['define','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x4202fb,_0x105439){var _0x402b44=function(_0x5aa569){while(--_0x5aa569){_0x4202fb['push'](_0x4202fb['shift']());}};_0x402b44(++_0x105439);}(_0x263e,0x121));var _0xe263=function(_0x5b697a,_0x280202){_0x5b697a=_0x5b697a-0x0;var _0x5de43b=_0x263e[_0x5b697a];return _0x5de43b;};'use strict';var _=require(_0xe263('0x0'));var util=require(_0xe263('0x1'));var logger=require(_0xe263('0x2'))(_0xe263('0x3'));var moment=require(_0xe263('0x4'));var BPromise=require(_0xe263('0x5'));var rp=require(_0xe263('0x6'));var fs=require('fs');var path=require(_0xe263('0x7'));var rimraf=require(_0xe263('0x8'));var config=require(_0xe263('0x9'));var attributes=require(_0xe263('0xa'));module['exports']=function(_0x1dd617,_0x53a53c){return _0x1dd617[_0xe263('0xb')]('ServicenowField',attributes,{'tableName':_0xe263('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xe263('0xd'),_0xe263('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2fe6=['exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x3c57a1,_0x120278){var _0x2744b0=function(_0x4d4b4e){while(--_0x4d4b4e){_0x3c57a1['push'](_0x3c57a1['shift']());}};_0x2744b0(++_0x120278);}(_0x2fe6,0x7b));var _0x62fe=function(_0x13f779,_0x5a9934){_0x13f779=_0x13f779-0x0;var _0x17dcac=_0x2fe6[_0x13f779];return _0x17dcac;};'use strict';var _=require(_0x62fe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x62fe('0x1'));var BPromise=require('bluebird');var rp=require(_0x62fe('0x2'));var fs=require('fs');var path=require(_0x62fe('0x3'));var rimraf=require(_0x62fe('0x4'));var config=require(_0x62fe('0x5'));var attributes=require(_0x62fe('0x6'));module[_0x62fe('0x7')]=function(_0xd62252,_0x9782c9){return _0xd62252[_0x62fe('0x8')](_0x62fe('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x62fe('0xa'),'fields':[_0x62fe('0xb'),_0x62fe('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 7be3e8f..7deb657 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5a4cc9,_0x817226){var _0x17d47b=function(_0x1d44a8){while(--_0x1d44a8){_0x5a4cc9['push'](_0x5a4cc9['shift']());}};_0x17d47b(++_0x817226);}(_0x70e0,0x17b));var _0x070e=function(_0x13d41e,_0x520c94){_0x13d41e=_0x13d41e-0x0;var _0x27dda8=_0x70e0[_0x13d41e];return _0x27dda8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _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(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 61ba1bf..359fb2c 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4a86ed,_0x474b45){var _0x147591=function(_0x23506d){while(--_0x23506d){_0x4a86ed['push'](_0x4a86ed['shift']());}};_0x147591(++_0x474b45);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x44b738,_0x3c9e38){var _0x49308b=function(_0x288ed2){while(--_0x288ed2){_0x44b738['push'](_0x44b738['shift']());}};_0x49308b(++_0x3c9e38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 1aa1b59..93bbe82 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(_0x19dc0b,_0x3e9472){var _0x40ec32=function(_0x4face6){while(--_0x4face6){_0x19dc0b['push'](_0x19dc0b['shift']());}};_0x40ec32(++_0x3e9472);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x4aea9b,_0x1a6500){var _0x23a590=function(_0x6d8ade){while(--_0x6d8ade){_0x4aea9b['push'](_0x4aea9b['shift']());}};_0x23a590(++_0x1a6500);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 d5367b0..f17bbe4 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 _0x753c=['rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','find','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','username','password','remoteUri','slice','substring','POST','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','stringify','Calls','includes','label','values','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x753c,0x79));var _0xc753=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x753c[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xc753('0x0'));var rimraf=require(_0xc753('0x1'));var zipdir=require(_0xc753('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc753('0x3'));var BPromise=require(_0xc753('0x4'));var Mustache=require(_0xc753('0x5'));var util=require('util');var path=require(_0xc753('0x6'));var sox=require(_0xc753('0x7'));var csv=require(_0xc753('0x8'));var ejs=require(_0xc753('0x9'));var fs=require('fs');var fs_extra=require(_0xc753('0xa'));var _=require('lodash');var squel=require(_0xc753('0xb'));var crypto=require(_0xc753('0xc'));var jsforce=require(_0xc753('0xd'));var deskjs=require(_0xc753('0xe'));var toCsv=require(_0xc753('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc753('0xf'));var qs=require(_0xc753('0x10'));var as=require(_0xc753('0x11'));var hardwareService=require(_0xc753('0x12'));var logger=require(_0xc753('0x13'))(_0xc753('0x14'));var utils=require(_0xc753('0x15'));var config=require(_0xc753('0x16'));var licenseUtil=require(_0xc753('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc753('0x18'));function respondWithStatusCode(_0x39ac72,_0x3433d1){_0x3433d1=_0x3433d1||0xcc;return function(_0x5e63fb){if(_0x5e63fb){return _0x39ac72['sendStatus'](_0x3433d1);}return _0x39ac72[_0xc753('0x19')](_0x3433d1)['end']();};}function respondWithResult(_0x5bc4a0,_0x63ed32){_0x63ed32=_0x63ed32||0xc8;return function(_0x6a4886){if(_0x6a4886){return _0x5bc4a0[_0xc753('0x19')](_0x63ed32)[_0xc753('0x1a')](_0x6a4886);}};}function respondWithFilteredResult(_0x59c628,_0x46f922){return function(_0x3fbfd6){if(_0x3fbfd6){var _0x39ee4a=typeof _0x46f922['offset']===_0xc753('0x1b')&&typeof _0x46f922[_0xc753('0x1c')]===_0xc753('0x1b');var _0x4630b1=_0x3fbfd6[_0xc753('0x1d')];var _0x2a73bb=_0x39ee4a?0x0:_0x46f922[_0xc753('0x1e')];var _0x41e1cc=_0x39ee4a?_0x3fbfd6[_0xc753('0x1d')]:_0x46f922[_0xc753('0x1e')]+_0x46f922[_0xc753('0x1c')];var _0xdd73ec;if(_0x41e1cc>=_0x4630b1){_0x41e1cc=_0x4630b1;_0xdd73ec=0xc8;}else{_0xdd73ec=0xce;}_0x59c628[_0xc753('0x19')](_0xdd73ec);return _0x59c628[_0xc753('0x1f')](_0xc753('0x20'),_0x2a73bb+'-'+_0x41e1cc+'/'+_0x4630b1)[_0xc753('0x1a')](_0x3fbfd6);}return null;};}function patchUpdates(_0x567c78){return function(_0x1eda9d){try{jsonpatch[_0xc753('0x21')](_0x1eda9d,_0x567c78,!![]);}catch(_0x6c9be7){return BPromise[_0xc753('0x22')](_0x6c9be7);}return _0x1eda9d[_0xc753('0x23')]();};}function saveUpdates(_0x58eaca,_0x68bb91){return function(_0x18b944){if(_0x18b944){return _0x18b944[_0xc753('0x24')](_0x58eaca)[_0xc753('0x25')](function(_0x176802){return _0x176802;});}return null;};}function removeEntity(_0x2f15e0,_0x12038f){return function(_0x4bfc4d){if(_0x4bfc4d){return _0x4bfc4d[_0xc753('0x26')]()[_0xc753('0x25')](function(){_0x2f15e0[_0xc753('0x19')](0xcc)[_0xc753('0x27')]();});}};}function handleEntityNotFound(_0x3d3046,_0x198c89){return function(_0x1077cf){if(!_0x1077cf){_0x3d3046[_0xc753('0x28')](0x194);}return _0x1077cf;};}function handleError(_0x85026d,_0x53f644){_0x53f644=_0x53f644||0x1f4;return function(_0x512db1){logger['error'](_0x512db1[_0xc753('0x29')]);if(_0x512db1[_0xc753('0x2a')]){delete _0x512db1[_0xc753('0x2a')];}_0x85026d['status'](_0x53f644)[_0xc753('0x2b')](_0x512db1);};}exports[_0xc753('0x2c')]=function(_0xaf3391,_0x2a3f42){var _0x529111={},_0x56005e={},_0x447b56={'count':0x0,'rows':[]};var _0x234b02=_[_0xc753('0x2d')](db[_0xc753('0x2e')][_0xc753('0x2f')],function(_0xee9d7){return{'name':_0xee9d7[_0xc753('0x30')],'type':_0xee9d7[_0xc753('0x31')]['key']};});_0x56005e[_0xc753('0x32')]=_[_0xc753('0x2d')](_0x234b02,_0xc753('0x2a'));_0x56005e[_0xc753('0x33')]=_[_0xc753('0x34')](_0xaf3391[_0xc753('0x33')]);_0x56005e[_0xc753('0x35')]=_['intersection'](_0x56005e['model'],_0x56005e[_0xc753('0x33')]);_0x529111[_0xc753('0x36')]=_['intersection'](_0x56005e[_0xc753('0x32')],qs[_0xc753('0x37')](_0xaf3391['query'][_0xc753('0x37')]));_0x529111[_0xc753('0x36')]=_0x529111[_0xc753('0x36')][_0xc753('0x38')]?_0x529111[_0xc753('0x36')]:_0x56005e[_0xc753('0x32')];if(!_0xaf3391[_0xc753('0x33')]['hasOwnProperty'](_0xc753('0x39'))){_0x529111[_0xc753('0x1c')]=qs['limit'](_0xaf3391[_0xc753('0x33')]['limit']);_0x529111['offset']=qs['offset'](_0xaf3391[_0xc753('0x33')]['offset']);}_0x529111[_0xc753('0x3a')]=qs['sort'](_0xaf3391[_0xc753('0x33')][_0xc753('0x3b')]);_0x529111[_0xc753('0x3c')]=qs[_0xc753('0x35')](_[_0xc753('0x3d')](_0xaf3391[_0xc753('0x33')],_0x56005e[_0xc753('0x35')]),_0x234b02);if(_0xaf3391[_0xc753('0x33')][_0xc753('0x3e')]){_0x529111[_0xc753('0x3c')]=_['merge'](_0x529111['where'],{'$or':_[_0xc753('0x2d')](_0x234b02,function(_0x5a89bb){if(_0x5a89bb['type']!==_0xc753('0x3f')){var _0x347fdc={};_0x347fdc[_0x5a89bb[_0xc753('0x2a')]]={'$like':'%'+_0xaf3391[_0xc753('0x33')][_0xc753('0x3e')]+'%'};return _0x347fdc;}})});}_0x529111=_[_0xc753('0x40')]({},_0x529111,_0xaf3391[_0xc753('0x41')]);var _0x2438e7={'where':_0x529111['where']};return db[_0xc753('0x2e')]['count'](_0x2438e7)[_0xc753('0x25')](function(_0x209834){_0x447b56[_0xc753('0x1d')]=_0x209834;if(_0xaf3391[_0xc753('0x33')][_0xc753('0x42')]){_0x529111[_0xc753('0x43')]=[{'all':!![]}];}return db[_0xc753('0x2e')][_0xc753('0x44')](_0x529111);})[_0xc753('0x25')](function(_0x53cca8){_0x447b56[_0xc753('0x45')]=_0x53cca8;return _0x447b56;})[_0xc753('0x25')](respondWithFilteredResult(_0x2a3f42,_0x529111))['catch'](handleError(_0x2a3f42,null));};exports[_0xc753('0x46')]=function(_0x54c033,_0x26b4aa){var _0xcc76f6={'raw':![],'where':{'id':_0x54c033[_0xc753('0x47')]['id']}},_0x27b09a={};_0x27b09a[_0xc753('0x32')]=_['keys'](db[_0xc753('0x2e')][_0xc753('0x2f')]);_0x27b09a[_0xc753('0x33')]=_[_0xc753('0x34')](_0x54c033[_0xc753('0x33')]);_0x27b09a[_0xc753('0x35')]=_[_0xc753('0x48')](_0x27b09a['model'],_0x27b09a[_0xc753('0x33')]);_0xcc76f6[_0xc753('0x36')]=_[_0xc753('0x48')](_0x27b09a[_0xc753('0x32')],qs['fields'](_0x54c033[_0xc753('0x33')][_0xc753('0x37')]));_0xcc76f6['attributes']=_0xcc76f6[_0xc753('0x36')][_0xc753('0x38')]?_0xcc76f6[_0xc753('0x36')]:_0x27b09a['model'];if(_0x54c033['query']['includeAll']){_0xcc76f6[_0xc753('0x43')]=[{'all':!![]}];}_0xcc76f6=_['merge']({},_0xcc76f6,_0x54c033[_0xc753('0x41')]);return db['SugarcrmAccount']['find'](_0xcc76f6)[_0xc753('0x25')](handleEntityNotFound(_0x26b4aa,null))[_0xc753('0x25')](respondWithResult(_0x26b4aa,null))[_0xc753('0x49')](handleError(_0x26b4aa,null));};exports[_0xc753('0x4a')]=function(_0x16268c,_0x2d8ba5){return db[_0xc753('0x2e')][_0xc753('0x4a')](_0x16268c[_0xc753('0x4b')],{})[_0xc753('0x25')](respondWithResult(_0x2d8ba5,0xc9))[_0xc753('0x49')](handleError(_0x2d8ba5,null));};exports[_0xc753('0x24')]=function(_0x2d4350,_0x96b781){if(_0x2d4350[_0xc753('0x4b')]['id']){delete _0x2d4350[_0xc753('0x4b')]['id'];}return db[_0xc753('0x2e')][_0xc753('0x4c')]({'where':{'id':_0x2d4350[_0xc753('0x47')]['id']}})[_0xc753('0x25')](handleEntityNotFound(_0x96b781,null))[_0xc753('0x25')](saveUpdates(_0x2d4350[_0xc753('0x4b')],null))['then'](respondWithResult(_0x96b781,null))[_0xc753('0x49')](handleError(_0x96b781,null));};exports[_0xc753('0x26')]=function(_0x256dff,_0x3c563a){return db['SugarcrmAccount'][_0xc753('0x4c')]({'where':{'id':_0x256dff['params']['id']}})['then'](handleEntityNotFound(_0x3c563a,null))[_0xc753('0x25')](removeEntity(_0x3c563a,null))['catch'](handleError(_0x3c563a,null));};exports[_0xc753('0x4d')]=function(_0x40a7d6,_0x551836,_0x2673ce){var _0x2e8489={};var _0x5b7225={};var _0x485b94;var _0x32c847;return db[_0xc753('0x2e')]['findOne']({'where':{'id':_0x40a7d6['params']['id']}})['then'](handleEntityNotFound(_0x551836,null))['then'](function(_0x593d0d){if(_0x593d0d){_0x485b94=_0x593d0d;_0x5b7225['model']=_[_0xc753('0x34')](db['SugarcrmConfiguration'][_0xc753('0x2f')]);_0x5b7225[_0xc753('0x33')]=_[_0xc753('0x34')](_0x40a7d6[_0xc753('0x33')]);_0x5b7225['filters']=_['intersection'](_0x5b7225['model'],_0x5b7225[_0xc753('0x33')]);_0x2e8489[_0xc753('0x36')]=_[_0xc753('0x48')](_0x5b7225[_0xc753('0x32')],qs['fields'](_0x40a7d6[_0xc753('0x33')][_0xc753('0x37')]));_0x2e8489['attributes']=_0x2e8489[_0xc753('0x36')][_0xc753('0x38')]?_0x2e8489[_0xc753('0x36')]:_0x5b7225[_0xc753('0x32')];_0x2e8489[_0xc753('0x3a')]=qs['sort'](_0x40a7d6['query'][_0xc753('0x3b')]);_0x2e8489[_0xc753('0x3c')]=qs['filters'](_[_0xc753('0x3d')](_0x40a7d6[_0xc753('0x33')],_0x5b7225[_0xc753('0x35')]));if(_0x40a7d6[_0xc753('0x33')][_0xc753('0x3e')]){_0x2e8489[_0xc753('0x3c')]=_[_0xc753('0x40')](_0x2e8489[_0xc753('0x3c')],{'$or':_['map'](_0x2e8489[_0xc753('0x36')],function(_0x5ee5da){var _0x22a5ab={};_0x22a5ab[_0x5ee5da]={'$like':'%'+_0x40a7d6['query'][_0xc753('0x3e')]+'%'};return _0x22a5ab;})});}_0x2e8489=_['merge']({},_0x2e8489,_0x40a7d6[_0xc753('0x41')]);return _0x485b94['getConfigurations'](_0x2e8489);}})[_0xc753('0x25')](function(_0x1886b1){if(_0x1886b1){_0x32c847=_0x1886b1[_0xc753('0x38')];if(!_0x40a7d6[_0xc753('0x33')][_0xc753('0x4e')](_0xc753('0x39'))){_0x2e8489['limit']=qs[_0xc753('0x1c')](_0x40a7d6[_0xc753('0x33')][_0xc753('0x1c')]);_0x2e8489[_0xc753('0x1e')]=qs[_0xc753('0x1e')](_0x40a7d6[_0xc753('0x33')][_0xc753('0x1e')]);}return _0x485b94[_0xc753('0x4d')](_0x2e8489);}})['then'](function(_0x112f17){if(_0x112f17){return _0x112f17?{'count':_0x32c847,'rows':_0x112f17}:null;}})[_0xc753('0x25')](respondWithResult(_0x551836,null))[_0xc753('0x49')](handleError(_0x551836,null));};exports[_0xc753('0x4f')]=function(_0x581137,_0x48e1ed,_0x52d304){if(_0x581137[_0xc753('0x4b')]['id']){delete _0x581137[_0xc753('0x4b')]['id'];}return db[_0xc753('0x2e')][_0xc753('0x50')]({'where':{'id':_0x581137[_0xc753('0x47')]['id']}})[_0xc753('0x25')](handleEntityNotFound(_0x48e1ed,null))[_0xc753('0x25')](function(_0x274a4a){if(_0x274a4a){_0x581137[_0xc753('0x4b')][_0xc753('0x51')]=_0x274a4a['id'];_0x581137[_0xc753('0x4b')]['Subjects']=integrations[_0xc753('0x52')](_0x581137['body'][_0xc753('0x53')],_0x581137[_0xc753('0x4b')]['type']);_0x581137[_0xc753('0x4b')][_0xc753('0x54')]=integrations[_0xc753('0x55')](_0x581137[_0xc753('0x4b')][_0xc753('0x53')],_0x581137['body'][_0xc753('0x31')]);return db[_0xc753('0x56')][_0xc753('0x4a')](_0x581137[_0xc753('0x4b')],{'include':[{'model':db[_0xc753('0x57')],'as':_0xc753('0x58')},{'model':db[_0xc753('0x57')],'as':_0xc753('0x54')}]});}return null;})['then'](respondWithResult(_0x48e1ed,null))[_0xc753('0x49')](handleError(_0x48e1ed,null));};exports[_0xc753('0x59')]=function(_0x51d7c9,_0x12af8e,_0x47efb3){var _0x3afc64='';var _0x22c732=['id','name',_0xc753('0x5a'),_0xc753('0x5b'),_0xc753('0x5c'),_0xc753('0x5d'),_0xc753('0x5e'),_0xc753('0x5f'),_0xc753('0x60'),'parent_type','parent_name','direction'];return db[_0xc753('0x2e')][_0xc753('0x50')]({'where':{'id':_0x51d7c9[_0xc753('0x47')]['id']},'attributes':['id',_0xc753('0x61'),_0xc753('0x62'),_0xc753('0x63')]})[_0xc753('0x25')](handleEntityNotFound(_0x12af8e,null))[_0xc753('0x25')](function(_0x4ec8fe){if(_0x4ec8fe){_0x3afc64=_0x4ec8fe[_0xc753('0x63')];var _0x11b807=_0x3afc64[_0xc753('0x64')](-0x1);if(_0x11b807==='/'){_0x3afc64=_0x3afc64[_0xc753('0x65')](0x0,_0x3afc64['lastIndexOf'](_0x11b807));}return rp({'method':_0xc753('0x66'),'uri':util['format']('%s%s',_0x3afc64,_0xc753('0x67')),'json':!![],'form':{'method':_0xc753('0x68'),'input_type':_0xc753('0x69'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4ec8fe[_0xc753('0x61')],'password':_0x4ec8fe[_0xc753('0x62')],'encryption':_0xc753('0x6a')},'application':_0xc753('0x6b')})}});}})['then'](function(_0x101f11){if(_0x101f11&&_0x101f11[_0xc753('0x2a')]!==_0xc753('0x6c')&&_0x101f11[_0xc753('0x2a')]!==_0xc753('0x6d')){return rp({'method':_0xc753('0x66'),'uri':util['format'](_0xc753('0x6e'),_0x3afc64,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xc753('0x69'),'response_type':_0xc753('0x69'),'rest_data':JSON[_0xc753('0x6f')]({'session':_0x101f11['id'],'module_name':_0xc753('0x70')})}})[_0xc753('0x25')](function(_0x38c66b){if(_0x38c66b){var _0x2d4e5a=_['values'](_0x38c66b['module_fields']);_['remove'](_0x2d4e5a,function(_0x2fa8ac){return _0x22c732[_0xc753('0x71')](_0x2fa8ac['name']);});return{'count':_0x2d4e5a['length'],'rows':_[_0xc753('0x2d')](_0x2d4e5a,function(_0x213961){return{'id':_0x213961[_0xc753('0x2a')],'name':_0x213961[_0xc753('0x72')],'custom':_['endsWith'](_0x213961[_0xc753('0x2a')],'_c')?!![]:![],'options':_0x213961[_0xc753('0x41')]?_[_0xc753('0x2d')](_[_0xc753('0x73')](_0x213961['options']),function(_0x169215){return{'name':_0x169215[_0xc753('0x74')],'value':_0x169215['name']};}):[]};})};}})[_0xc753('0x25')](respondWithResult(_0x12af8e,null))[_0xc753('0x49')](function(_0xf74287){var _0x253fc4=_0x51d7c9[_0xc753('0x33')][_0xc753('0x75')]?0x1f4:_0xf74287[_0xc753('0x76')]||0x1f4;logger[_0xc753('0x77')](_0xc753('0x78'),_0xc753('0x59'),_0x253fc4,JSON[_0xc753('0x6f')](_0xf74287));delete _0xf74287[_0xc753('0x2a')];if(_0x253fc4===0x191){_0x253fc4=0x190;}_0x12af8e['status'](_0x253fc4)[_0xc753('0x2b')](_0x51d7c9[_0xc753('0x33')][_0xc753('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0xf74287['statusCode']}:_0xf74287);});}else{var _0x199aa8=0x1f4;_0x12af8e[_0xc753('0x19')](_0x199aa8)[_0xc753('0x2b')]({'message':_0xc753('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6c77=['status','json','offset','limit','count','set','apply','reject','then','destroy','end','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','length','create','body','find','params','SugarcrmConfiguration','filter','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','stringify','password','PLAIN','Invalid\x20Login','/service/v4_1/rest.php','get_module_fields','module_fields','remove','includes','label','values','value','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration'];(function(_0x1fbb69,_0x541d33){var _0x4bb876=function(_0x499882){while(--_0x499882){_0x1fbb69['push'](_0x1fbb69['shift']());}};_0x4bb876(++_0x541d33);}(_0x6c77,0x143));var _0x76c7=function(_0x1c47b0,_0x19e61c){_0x1c47b0=_0x1c47b0-0x0;var _0x5ae2e3=_0x6c77[_0x1c47b0];return _0x5ae2e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76c7('0x0'));var zipdir=require(_0x76c7('0x1'));var jsonpatch=require(_0x76c7('0x2'));var rp=require(_0x76c7('0x3'));var moment=require('moment');var BPromise=require(_0x76c7('0x4'));var Mustache=require(_0x76c7('0x5'));var util=require(_0x76c7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x76c7('0x7'));var ejs=require(_0x76c7('0x8'));var fs=require('fs');var fs_extra=require(_0x76c7('0x9'));var _=require(_0x76c7('0xa'));var squel=require(_0x76c7('0xb'));var crypto=require(_0x76c7('0xc'));var jsforce=require(_0x76c7('0xd'));var deskjs=require(_0x76c7('0xe'));var toCsv=require(_0x76c7('0x7'));var querystring=require(_0x76c7('0xf'));var Papa=require(_0x76c7('0x10'));var Redis=require(_0x76c7('0x11'));var authService=require(_0x76c7('0x12'));var qs=require(_0x76c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x76c7('0x14'))('api');var utils=require(_0x76c7('0x15'));var config=require(_0x76c7('0x16'));var licenseUtil=require(_0x76c7('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x76c7('0x18'));function respondWithStatusCode(_0x166c2e,_0x1842bc){_0x1842bc=_0x1842bc||0xcc;return function(_0x3a4cf1){if(_0x3a4cf1){return _0x166c2e['sendStatus'](_0x1842bc);}return _0x166c2e['status'](_0x1842bc)['end']();};}function respondWithResult(_0x19d239,_0x4d7a40){_0x4d7a40=_0x4d7a40||0xc8;return function(_0x439507){if(_0x439507){return _0x19d239[_0x76c7('0x19')](_0x4d7a40)[_0x76c7('0x1a')](_0x439507);}};}function respondWithFilteredResult(_0x2ba6e1,_0x39dfc9){return function(_0xd2f189){if(_0xd2f189){var _0x544bf6=typeof _0x39dfc9[_0x76c7('0x1b')]==='undefined'&&typeof _0x39dfc9[_0x76c7('0x1c')]==='undefined';var _0xcabbd8=_0xd2f189[_0x76c7('0x1d')];var _0x3a630e=_0x544bf6?0x0:_0x39dfc9['offset'];var _0x1062e6=_0x544bf6?_0xd2f189[_0x76c7('0x1d')]:_0x39dfc9[_0x76c7('0x1b')]+_0x39dfc9[_0x76c7('0x1c')];var _0x2763e4;if(_0x1062e6>=_0xcabbd8){_0x1062e6=_0xcabbd8;_0x2763e4=0xc8;}else{_0x2763e4=0xce;}_0x2ba6e1['status'](_0x2763e4);return _0x2ba6e1[_0x76c7('0x1e')]('Content-Range',_0x3a630e+'-'+_0x1062e6+'/'+_0xcabbd8)[_0x76c7('0x1a')](_0xd2f189);}return null;};}function patchUpdates(_0x435986){return function(_0x3cd65b){try{jsonpatch[_0x76c7('0x1f')](_0x3cd65b,_0x435986,!![]);}catch(_0x30ed83){return BPromise[_0x76c7('0x20')](_0x30ed83);}return _0x3cd65b['save']();};}function saveUpdates(_0x301998,_0x47b101){return function(_0x2f6bc1){if(_0x2f6bc1){return _0x2f6bc1['update'](_0x301998)[_0x76c7('0x21')](function(_0x443c8d){return _0x443c8d;});}return null;};}function removeEntity(_0x1a38a9,_0x4e9d53){return function(_0x147a9f){if(_0x147a9f){return _0x147a9f[_0x76c7('0x22')]()[_0x76c7('0x21')](function(){_0x1a38a9[_0x76c7('0x19')](0xcc)[_0x76c7('0x23')]();});}};}function handleEntityNotFound(_0x1de46c,_0x2c2638){return function(_0x4a8991){if(!_0x4a8991){_0x1de46c[_0x76c7('0x24')](0x194);}return _0x4a8991;};}function handleError(_0x8e8569,_0x38dcd5){_0x38dcd5=_0x38dcd5||0x1f4;return function(_0x54950f){logger[_0x76c7('0x25')](_0x54950f[_0x76c7('0x26')]);if(_0x54950f[_0x76c7('0x27')]){delete _0x54950f[_0x76c7('0x27')];}_0x8e8569[_0x76c7('0x19')](_0x38dcd5)[_0x76c7('0x28')](_0x54950f);};}exports[_0x76c7('0x29')]=function(_0xa0a3c9,_0x3729dd){var _0x5a7e14={},_0x13db2c={},_0x3d3ffb={'count':0x0,'rows':[]};var _0x2d158d=_[_0x76c7('0x2a')](db[_0x76c7('0x2b')][_0x76c7('0x2c')],function(_0x74a30e){return{'name':_0x74a30e[_0x76c7('0x2d')],'type':_0x74a30e[_0x76c7('0x2e')][_0x76c7('0x2f')]};});_0x13db2c[_0x76c7('0x30')]=_[_0x76c7('0x2a')](_0x2d158d,_0x76c7('0x27'));_0x13db2c['query']=_[_0x76c7('0x31')](_0xa0a3c9['query']);_0x13db2c[_0x76c7('0x32')]=_[_0x76c7('0x33')](_0x13db2c[_0x76c7('0x30')],_0x13db2c[_0x76c7('0x34')]);_0x5a7e14['attributes']=_[_0x76c7('0x33')](_0x13db2c['model'],qs[_0x76c7('0x35')](_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x35')]));_0x5a7e14[_0x76c7('0x36')]=_0x5a7e14[_0x76c7('0x36')]['length']?_0x5a7e14[_0x76c7('0x36')]:_0x13db2c[_0x76c7('0x30')];if(!_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x37')](_0x76c7('0x38'))){_0x5a7e14[_0x76c7('0x1c')]=qs[_0x76c7('0x1c')](_0xa0a3c9[_0x76c7('0x34')]['limit']);_0x5a7e14['offset']=qs[_0x76c7('0x1b')](_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x1b')]);}_0x5a7e14[_0x76c7('0x39')]=qs[_0x76c7('0x3a')](_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x3a')]);_0x5a7e14[_0x76c7('0x3b')]=qs[_0x76c7('0x32')](_[_0x76c7('0x3c')](_0xa0a3c9[_0x76c7('0x34')],_0x13db2c[_0x76c7('0x32')]),_0x2d158d);if(_0xa0a3c9['query']['filter']){_0x5a7e14[_0x76c7('0x3b')]=_[_0x76c7('0x3d')](_0x5a7e14[_0x76c7('0x3b')],{'$or':_[_0x76c7('0x2a')](_0x2d158d,function(_0x4e1565){if(_0x4e1565[_0x76c7('0x2e')]!==_0x76c7('0x3e')){var _0x524fb6={};_0x524fb6[_0x4e1565[_0x76c7('0x27')]]={'$like':'%'+_0xa0a3c9[_0x76c7('0x34')]['filter']+'%'};return _0x524fb6;}})});}_0x5a7e14=_[_0x76c7('0x3d')]({},_0x5a7e14,_0xa0a3c9[_0x76c7('0x3f')]);var _0x55a284={'where':_0x5a7e14[_0x76c7('0x3b')]};return db[_0x76c7('0x2b')][_0x76c7('0x1d')](_0x55a284)[_0x76c7('0x21')](function(_0x39aad1){_0x3d3ffb[_0x76c7('0x1d')]=_0x39aad1;if(_0xa0a3c9[_0x76c7('0x34')][_0x76c7('0x40')]){_0x5a7e14[_0x76c7('0x41')]=[{'all':!![]}];}return db[_0x76c7('0x2b')]['findAll'](_0x5a7e14);})[_0x76c7('0x21')](function(_0x241c6c){_0x3d3ffb[_0x76c7('0x42')]=_0x241c6c;return _0x3d3ffb;})[_0x76c7('0x21')](respondWithFilteredResult(_0x3729dd,_0x5a7e14))[_0x76c7('0x43')](handleError(_0x3729dd,null));};exports[_0x76c7('0x44')]=function(_0x1ec193,_0x532666){var _0x3ad283={'raw':![],'where':{'id':_0x1ec193['params']['id']}},_0x170373={};_0x170373[_0x76c7('0x30')]=_[_0x76c7('0x31')](db[_0x76c7('0x2b')]['rawAttributes']);_0x170373[_0x76c7('0x34')]=_[_0x76c7('0x31')](_0x1ec193['query']);_0x170373[_0x76c7('0x32')]=_['intersection'](_0x170373[_0x76c7('0x30')],_0x170373['query']);_0x3ad283[_0x76c7('0x36')]=_[_0x76c7('0x33')](_0x170373[_0x76c7('0x30')],qs[_0x76c7('0x35')](_0x1ec193[_0x76c7('0x34')][_0x76c7('0x35')]));_0x3ad283[_0x76c7('0x36')]=_0x3ad283['attributes'][_0x76c7('0x45')]?_0x3ad283[_0x76c7('0x36')]:_0x170373[_0x76c7('0x30')];if(_0x1ec193[_0x76c7('0x34')][_0x76c7('0x40')]){_0x3ad283[_0x76c7('0x41')]=[{'all':!![]}];}_0x3ad283=_[_0x76c7('0x3d')]({},_0x3ad283,_0x1ec193['options']);return db[_0x76c7('0x2b')]['find'](_0x3ad283)[_0x76c7('0x21')](handleEntityNotFound(_0x532666,null))[_0x76c7('0x21')](respondWithResult(_0x532666,null))[_0x76c7('0x43')](handleError(_0x532666,null));};exports[_0x76c7('0x46')]=function(_0x50c5a0,_0x48aa31){return db[_0x76c7('0x2b')]['create'](_0x50c5a0[_0x76c7('0x47')],{})[_0x76c7('0x21')](respondWithResult(_0x48aa31,0xc9))['catch'](handleError(_0x48aa31,null));};exports['update']=function(_0x5d0788,_0x1aa61c){if(_0x5d0788['body']['id']){delete _0x5d0788[_0x76c7('0x47')]['id'];}return db[_0x76c7('0x2b')][_0x76c7('0x48')]({'where':{'id':_0x5d0788['params']['id']}})[_0x76c7('0x21')](handleEntityNotFound(_0x1aa61c,null))[_0x76c7('0x21')](saveUpdates(_0x5d0788[_0x76c7('0x47')],null))[_0x76c7('0x21')](respondWithResult(_0x1aa61c,null))[_0x76c7('0x43')](handleError(_0x1aa61c,null));};exports[_0x76c7('0x22')]=function(_0x533bfc,_0x1b3616){return db['SugarcrmAccount'][_0x76c7('0x48')]({'where':{'id':_0x533bfc[_0x76c7('0x49')]['id']}})[_0x76c7('0x21')](handleEntityNotFound(_0x1b3616,null))[_0x76c7('0x21')](removeEntity(_0x1b3616,null))[_0x76c7('0x43')](handleError(_0x1b3616,null));};exports['getConfigurations']=function(_0x1bf53c,_0x4f5a21,_0x16ba57){var _0x4782da={};var _0x496e7d={};var _0x1e950d;var _0x465cf1;return db[_0x76c7('0x2b')]['findOne']({'where':{'id':_0x1bf53c[_0x76c7('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f5a21,null))['then'](function(_0x1bb9f7){if(_0x1bb9f7){_0x1e950d=_0x1bb9f7;_0x496e7d[_0x76c7('0x30')]=_[_0x76c7('0x31')](db[_0x76c7('0x4a')][_0x76c7('0x2c')]);_0x496e7d['query']=_[_0x76c7('0x31')](_0x1bf53c[_0x76c7('0x34')]);_0x496e7d[_0x76c7('0x32')]=_[_0x76c7('0x33')](_0x496e7d['model'],_0x496e7d[_0x76c7('0x34')]);_0x4782da[_0x76c7('0x36')]=_[_0x76c7('0x33')](_0x496e7d[_0x76c7('0x30')],qs[_0x76c7('0x35')](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x35')]));_0x4782da[_0x76c7('0x36')]=_0x4782da[_0x76c7('0x36')]['length']?_0x4782da[_0x76c7('0x36')]:_0x496e7d[_0x76c7('0x30')];_0x4782da[_0x76c7('0x39')]=qs[_0x76c7('0x3a')](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x3a')]);_0x4782da[_0x76c7('0x3b')]=qs[_0x76c7('0x32')](_[_0x76c7('0x3c')](_0x1bf53c[_0x76c7('0x34')],_0x496e7d['filters']));if(_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x4b')]){_0x4782da[_0x76c7('0x3b')]=_[_0x76c7('0x3d')](_0x4782da[_0x76c7('0x3b')],{'$or':_[_0x76c7('0x2a')](_0x4782da['attributes'],function(_0x58280d){var _0x368465={};_0x368465[_0x58280d]={'$like':'%'+_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x4b')]+'%'};return _0x368465;})});}_0x4782da=_[_0x76c7('0x3d')]({},_0x4782da,_0x1bf53c[_0x76c7('0x3f')]);return _0x1e950d[_0x76c7('0x4c')](_0x4782da);}})[_0x76c7('0x21')](function(_0x1ddfd2){if(_0x1ddfd2){_0x465cf1=_0x1ddfd2[_0x76c7('0x45')];if(!_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x37')]('nolimit')){_0x4782da[_0x76c7('0x1c')]=qs['limit'](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x1c')]);_0x4782da[_0x76c7('0x1b')]=qs[_0x76c7('0x1b')](_0x1bf53c[_0x76c7('0x34')][_0x76c7('0x1b')]);}return _0x1e950d[_0x76c7('0x4c')](_0x4782da);}})[_0x76c7('0x21')](function(_0x3ba835){if(_0x3ba835){return _0x3ba835?{'count':_0x465cf1,'rows':_0x3ba835}:null;}})[_0x76c7('0x21')](respondWithResult(_0x4f5a21,null))[_0x76c7('0x43')](handleError(_0x4f5a21,null));};exports[_0x76c7('0x4d')]=function(_0x3a6e83,_0x39c0a4,_0x549b8c){if(_0x3a6e83[_0x76c7('0x47')]['id']){delete _0x3a6e83['body']['id'];}return db[_0x76c7('0x2b')][_0x76c7('0x4e')]({'where':{'id':_0x3a6e83[_0x76c7('0x49')]['id']}})[_0x76c7('0x21')](handleEntityNotFound(_0x39c0a4,null))[_0x76c7('0x21')](function(_0x91b6f2){if(_0x91b6f2){_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x4f')]=_0x91b6f2['id'];_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x50')]=integrations[_0x76c7('0x51')](_0x3a6e83[_0x76c7('0x47')]['channel'],_0x3a6e83['body'][_0x76c7('0x2e')]);_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x52')]=integrations['getDescriptions'](_0x3a6e83[_0x76c7('0x47')][_0x76c7('0x53')],_0x3a6e83[_0x76c7('0x47')]['type']);return db['SugarcrmConfiguration']['create'](_0x3a6e83[_0x76c7('0x47')],{'include':[{'model':db['SugarcrmField'],'as':_0x76c7('0x50')},{'model':db[_0x76c7('0x54')],'as':_0x76c7('0x52')}]});}return null;})[_0x76c7('0x21')](respondWithResult(_0x39c0a4,null))['catch'](handleError(_0x39c0a4,null));};exports[_0x76c7('0x55')]=function(_0x34abcc,_0x2a3d10,_0x12e57d){var _0x748a5f='';var _0x186c2f=['id','name',_0x76c7('0x56'),'created_by',_0x76c7('0x57'),_0x76c7('0x58'),_0x76c7('0x59'),_0x76c7('0x5a'),_0x76c7('0x5b'),_0x76c7('0x5c'),'parent_name','direction'];return db[_0x76c7('0x2b')][_0x76c7('0x4e')]({'where':{'id':_0x34abcc[_0x76c7('0x49')]['id']},'attributes':['id',_0x76c7('0x5d'),'password','remoteUri']})[_0x76c7('0x21')](handleEntityNotFound(_0x2a3d10,null))[_0x76c7('0x21')](function(_0x3dcf88){if(_0x3dcf88){_0x748a5f=_0x3dcf88[_0x76c7('0x5e')];var _0x2efa62=_0x748a5f[_0x76c7('0x5f')](-0x1);if(_0x2efa62==='/'){_0x748a5f=_0x748a5f['substring'](0x0,_0x748a5f[_0x76c7('0x60')](_0x2efa62));}return rp({'method':_0x76c7('0x61'),'uri':util[_0x76c7('0x62')](_0x76c7('0x63'),_0x748a5f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x76c7('0x64'),'input_type':'JSON','response_type':_0x76c7('0x65'),'rest_data':JSON[_0x76c7('0x66')]({'user_auth':{'user_name':_0x3dcf88[_0x76c7('0x5d')],'password':_0x3dcf88[_0x76c7('0x67')],'encryption':_0x76c7('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x76c7('0x21')](function(_0x16e5f0){if(_0x16e5f0&&_0x16e5f0['name']!==_0x76c7('0x69')&&_0x16e5f0[_0x76c7('0x27')]!=='Password\x20Expired'){return rp({'method':_0x76c7('0x61'),'uri':util[_0x76c7('0x62')](_0x76c7('0x63'),_0x748a5f,_0x76c7('0x6a')),'json':!![],'form':{'method':_0x76c7('0x6b'),'input_type':_0x76c7('0x65'),'response_type':'JSON','rest_data':JSON[_0x76c7('0x66')]({'session':_0x16e5f0['id'],'module_name':'Calls'})}})[_0x76c7('0x21')](function(_0x1fd3f7){if(_0x1fd3f7){var _0x4801dd=_['values'](_0x1fd3f7[_0x76c7('0x6c')]);_[_0x76c7('0x6d')](_0x4801dd,function(_0x4ff97d){return _0x186c2f[_0x76c7('0x6e')](_0x4ff97d[_0x76c7('0x27')]);});return{'count':_0x4801dd['length'],'rows':_['map'](_0x4801dd,function(_0x23eaea){return{'id':_0x23eaea[_0x76c7('0x27')],'name':_0x23eaea[_0x76c7('0x6f')],'custom':_['endsWith'](_0x23eaea['name'],'_c')?!![]:![],'options':_0x23eaea['options']?_[_0x76c7('0x2a')](_[_0x76c7('0x70')](_0x23eaea[_0x76c7('0x3f')]),function(_0x1738cc){return{'name':_0x1738cc[_0x76c7('0x71')],'value':_0x1738cc[_0x76c7('0x27')]};}):[]};})};}})[_0x76c7('0x21')](respondWithResult(_0x2a3d10,null))[_0x76c7('0x43')](function(_0x64b780){var _0xd77d9d=_0x34abcc[_0x76c7('0x34')]['test']?0x1f4:_0x64b780[_0x76c7('0x72')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x76c7('0x55'),_0xd77d9d,JSON[_0x76c7('0x66')](_0x64b780));delete _0x64b780[_0x76c7('0x27')];if(_0xd77d9d===0x191){_0xd77d9d=0x190;}_0x2a3d10['status'](_0xd77d9d)[_0x76c7('0x28')](_0x34abcc[_0x76c7('0x34')]['test']?{'message':_0x76c7('0x73'),'statusCode':_0x64b780[_0x76c7('0x72')]}:_0x64b780);});}else{var _0x512c76=0x1f4;_0x2a3d10[_0x76c7('0x19')](_0x512c76)[_0x76c7('0x28')]({'message':_0x76c7('0x73'),'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 2ade548..a46a84e 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 _0x310c=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0xc26c6a,_0x49253a){var _0x517e0f=function(_0x3d7692){while(--_0x3d7692){_0xc26c6a['push'](_0xc26c6a['shift']());}};_0x517e0f(++_0x49253a);}(_0x310c,0x194));var _0xc310=function(_0x404605,_0x177332){_0x404605=_0x404605-0x0;var _0x44976a=_0x310c[_0x404605];return _0x44976a;};'use strict';var _=require('lodash');var util=require(_0xc310('0x0'));var logger=require(_0xc310('0x1'))(_0xc310('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc310('0x3'));var rimraf=require(_0xc310('0x4'));var config=require(_0xc310('0x5'));var attributes=require(_0xc310('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xc310('0x7')]=function(_0x4e8f7b,_0x4410f){return _0x4e8f7b[_0xc310('0x8')](_0xc310('0x9'),attributes,{'tableName':_0xc310('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1dc=['exports','define','SugarcrmAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x4f5efe,_0x58ab97){var _0x3bfb40=function(_0x15c92b){while(--_0x15c92b){_0x4f5efe['push'](_0x4f5efe['shift']());}};_0x3bfb40(++_0x58ab97);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xb1dc[_0x1faaa1];return _0x994ec;};'use strict';var _=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var logger=require(_0xcb1d('0x2'))(_0xcb1d('0x3'));var moment=require(_0xcb1d('0x4'));var BPromise=require(_0xcb1d('0x5'));var rp=require(_0xcb1d('0x6'));var fs=require('fs');var path=require(_0xcb1d('0x7'));var rimraf=require(_0xcb1d('0x8'));var config=require(_0xcb1d('0x9'));var attributes=require(_0xcb1d('0xa'));var integrations=require(_0xcb1d('0xb'));module[_0xcb1d('0xc')]=function(_0x2dbb99,_0x1fc363){return _0x2dbb99[_0xcb1d('0xd')](_0xcb1d('0xe'),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 a8a6809..75efc28 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 _0x6052=['map','model','info','stringify','ShowSugarcrmAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x22a77b,_0x50197e){var _0x11b512=function(_0x5e5575){while(--_0x5e5575){_0x22a77b['push'](_0x22a77b['shift']());}};_0x11b512(++_0x50197e);}(_0x6052,0x1ce));var _0x2605=function(_0x5e6944,_0x3a6f62){_0x5e6944=_0x5e6944-0x0;var _0x13254a=_0x6052[_0x5e6944];return _0x13254a;};'use strict';var _=require(_0x2605('0x0'));var util=require('util');var moment=require(_0x2605('0x1'));var BPromise=require(_0x2605('0x2'));var rs=require(_0x2605('0x3'));var fs=require('fs');var Redis=require(_0x2605('0x4'));var db=require(_0x2605('0x5'))['db'];var utils=require(_0x2605('0x6'));var logger=require(_0x2605('0x7'))(_0x2605('0x8'));var config=require('../../config/environment');var jayson=require(_0x2605('0x9'));var client=jayson[_0x2605('0xa')][_0x2605('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257d42,_0x155a54,_0x3c45db){return new BPromise(function(_0x69d53c,_0x1f2e15){return client[_0x2605('0xc')](_0x257d42,_0x3c45db)[_0x2605('0xd')](function(_0x4a4ae3){logger['info'](_0x2605('0xe'),_0x155a54,_0x2605('0xf'));logger[_0x2605('0x10')](_0x2605('0x11'),_0x155a54,_0x2605('0xf'),JSON['stringify'](_0x4a4ae3));if(_0x4a4ae3[_0x2605('0x12')]){if(_0x4a4ae3[_0x2605('0x12')][_0x2605('0x13')]===0x1f4){logger[_0x2605('0x12')](_0x2605('0xe'),_0x155a54,_0x4a4ae3['error'][_0x2605('0x14')]);return _0x1f2e15(_0x4a4ae3[_0x2605('0x12')][_0x2605('0x14')]);}logger[_0x2605('0x12')](_0x2605('0xe'),_0x155a54,_0x4a4ae3['error']['message']);return _0x69d53c(_0x4a4ae3[_0x2605('0x12')][_0x2605('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x155a54,_0x2605('0xf'));_0x69d53c(_0x4a4ae3[_0x2605('0x15')][_0x2605('0x14')]);}})[_0x2605('0x16')](function(_0x225a8e){logger[_0x2605('0x12')](_0x2605('0xe'),_0x155a54,_0x225a8e);_0x1f2e15(_0x225a8e);});});}exports[_0x2605('0x17')]=function(_0x2e8128){var _0x158889=this;return new Promise(function(_0x34195e,_0x56d154){return db[_0x2605('0x18')][_0x2605('0x19')]({'raw':_0x2e8128[_0x2605('0x1a')]?_0x2e8128['options'][_0x2605('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e8128[_0x2605('0x1a')]?_0x2e8128['options'][_0x2605('0x1c')]||null:null,'attributes':_0x2e8128[_0x2605('0x1a')]?_0x2e8128[_0x2605('0x1a')][_0x2605('0x1d')]||null:null,'limit':_0x2e8128[_0x2605('0x1a')]?_0x2e8128['options'][_0x2605('0x1e')]||null:null,'include':_0x2e8128[_0x2605('0x1a')]?_0x2e8128['options'][_0x2605('0x1f')]?_[_0x2605('0x20')](_0x2e8128[_0x2605('0x1a')][_0x2605('0x1f')],function(_0x542c55){return{'model':db[_0x542c55[_0x2605('0x21')]],'as':_0x542c55['as'],'attributes':_0x542c55['attributes'],'include':_0x542c55[_0x2605('0x1f')]?_[_0x2605('0x20')](_0x542c55[_0x2605('0x1f')],function(_0x408014){return{'model':db[_0x408014[_0x2605('0x21')]],'as':_0x408014['as'],'attributes':_0x408014[_0x2605('0x1d')],'include':_0x408014['include']?_[_0x2605('0x20')](_0x408014[_0x2605('0x1f')],function(_0x3a8140){return{'model':db[_0x3a8140[_0x2605('0x21')]],'as':_0x3a8140['as'],'attributes':_0x3a8140[_0x2605('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597e6d){logger[_0x2605('0x22')](_0x2605('0x17'),_0x2e8128);logger[_0x2605('0x10')]('GetSugarcrmAccount',_0x2e8128,JSON[_0x2605('0x23')](_0x597e6d));_0x34195e(_0x597e6d);})[_0x2605('0x16')](function(_0x374287){logger[_0x2605('0x12')](_0x2605('0x17'),_0x374287[_0x2605('0x14')],_0x2e8128);_0x56d154(_0x158889[_0x2605('0x12')](0x1f4,_0x374287[_0x2605('0x14')]));});});};exports[_0x2605('0x24')]=function(_0x5f5a1f){var _0x23b1f3=this;return new Promise(function(_0x516a15,_0x3bfb08){return db[_0x2605('0x18')][_0x2605('0x25')]({'raw':_0x5f5a1f[_0x2605('0x1a')]?_0x5f5a1f[_0x2605('0x1a')][_0x2605('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f5a1f[_0x2605('0x1a')]?_0x5f5a1f[_0x2605('0x1a')][_0x2605('0x1c')]||null:null,'attributes':_0x5f5a1f[_0x2605('0x1a')]?_0x5f5a1f[_0x2605('0x1a')][_0x2605('0x1d')]||null:null,'include':_0x5f5a1f['options']?_0x5f5a1f[_0x2605('0x1a')][_0x2605('0x1f')]?_[_0x2605('0x20')](_0x5f5a1f['options'][_0x2605('0x1f')],function(_0x7cf077){return{'model':db[_0x7cf077[_0x2605('0x21')]],'as':_0x7cf077['as'],'attributes':_0x7cf077['attributes'],'include':_0x7cf077[_0x2605('0x1f')]?_['map'](_0x7cf077[_0x2605('0x1f')],function(_0x5d18ab){return{'model':db[_0x5d18ab[_0x2605('0x21')]],'as':_0x5d18ab['as'],'attributes':_0x5d18ab[_0x2605('0x1d')],'include':_0x5d18ab[_0x2605('0x1f')]?_[_0x2605('0x20')](_0x5d18ab[_0x2605('0x1f')],function(_0x5671e3){return{'model':db[_0x5671e3[_0x2605('0x21')]],'as':_0x5671e3['as'],'attributes':_0x5671e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x2605('0xd')](function(_0x20bd1e){logger[_0x2605('0x22')](_0x2605('0x24'),_0x5f5a1f);logger['debug'](_0x2605('0x24'),_0x5f5a1f,JSON[_0x2605('0x23')](_0x20bd1e));_0x516a15(_0x20bd1e);})['catch'](function(_0x84cb26){logger[_0x2605('0x12')](_0x2605('0x24'),_0x84cb26[_0x2605('0x14')],_0x5f5a1f);_0x3bfb08(_0x23b1f3[_0x2605('0x12')](0x1f4,_0x84cb26[_0x2605('0x14')]));});});}; \ No newline at end of file +var _0x5a64=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','GetSugarcrmAccount','findAll','options','raw','limit','map','include','attributes','model','ShowSugarcrmAccount','find'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5a64,0x1ba));var _0x45a6=function(_0x5cdd74,_0x557b3c){_0x5cdd74=_0x5cdd74-0x0;var _0x113ef8=_0x5a64[_0x5cdd74];return _0x113ef8;};'use strict';var _=require(_0x45a6('0x0'));var util=require(_0x45a6('0x1'));var moment=require(_0x45a6('0x2'));var BPromise=require(_0x45a6('0x3'));var rs=require(_0x45a6('0x4'));var fs=require('fs');var Redis=require(_0x45a6('0x5'));var db=require(_0x45a6('0x6'))['db'];var utils=require(_0x45a6('0x7'));var logger=require('../../config/logger')(_0x45a6('0x8'));var config=require(_0x45a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45a6('0xa')][_0x45a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x236301,_0xf5317b,_0x4d279d){return new BPromise(function(_0x415d06,_0x4b1eb1){return client[_0x45a6('0xc')](_0x236301,_0x4d279d)[_0x45a6('0xd')](function(_0x61683){logger[_0x45a6('0xe')](_0x45a6('0xf'),_0xf5317b,'request\x20sent');logger[_0x45a6('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xf5317b,'request\x20sent',JSON[_0x45a6('0x11')](_0x61683));if(_0x61683[_0x45a6('0x12')]){if(_0x61683['error']['code']===0x1f4){logger[_0x45a6('0x12')](_0x45a6('0xf'),_0xf5317b,_0x61683[_0x45a6('0x12')][_0x45a6('0x13')]);return _0x4b1eb1(_0x61683[_0x45a6('0x12')][_0x45a6('0x13')]);}logger[_0x45a6('0x12')](_0x45a6('0xf'),_0xf5317b,_0x61683['error']['message']);return _0x415d06(_0x61683['error'][_0x45a6('0x13')]);}else{logger[_0x45a6('0xe')](_0x45a6('0xf'),_0xf5317b,_0x45a6('0x14'));_0x415d06(_0x61683[_0x45a6('0x15')][_0x45a6('0x13')]);}})[_0x45a6('0x16')](function(_0x2aba5c){logger[_0x45a6('0x12')](_0x45a6('0xf'),_0xf5317b,_0x2aba5c);_0x4b1eb1(_0x2aba5c);});});}exports[_0x45a6('0x17')]=function(_0x5904c1){var _0x30e5c5=this;return new Promise(function(_0x45d2d0,_0xc86b1a){return db['SugarcrmAccount'][_0x45a6('0x18')]({'raw':_0x5904c1[_0x45a6('0x19')]?_0x5904c1[_0x45a6('0x19')][_0x45a6('0x1a')]===undefined?!![]:![]:!![],'where':_0x5904c1['options']?_0x5904c1['options']['where']||null:null,'attributes':_0x5904c1['options']?_0x5904c1[_0x45a6('0x19')]['attributes']||null:null,'limit':_0x5904c1[_0x45a6('0x19')]?_0x5904c1['options'][_0x45a6('0x1b')]||null:null,'include':_0x5904c1[_0x45a6('0x19')]?_0x5904c1[_0x45a6('0x19')]['include']?_[_0x45a6('0x1c')](_0x5904c1[_0x45a6('0x19')][_0x45a6('0x1d')],function(_0x23614d){return{'model':db[_0x23614d['model']],'as':_0x23614d['as'],'attributes':_0x23614d[_0x45a6('0x1e')],'include':_0x23614d[_0x45a6('0x1d')]?_['map'](_0x23614d[_0x45a6('0x1d')],function(_0x20125e){return{'model':db[_0x20125e[_0x45a6('0x1f')]],'as':_0x20125e['as'],'attributes':_0x20125e[_0x45a6('0x1e')],'include':_0x20125e[_0x45a6('0x1d')]?_['map'](_0x20125e[_0x45a6('0x1d')],function(_0x58894d){return{'model':db[_0x58894d[_0x45a6('0x1f')]],'as':_0x58894d['as'],'attributes':_0x58894d['attributes']};}):[]};}):[]};}):[]:[]})[_0x45a6('0xd')](function(_0x2f5751){logger[_0x45a6('0xe')](_0x45a6('0x17'),_0x5904c1);logger[_0x45a6('0x10')]('GetSugarcrmAccount',_0x5904c1,JSON['stringify'](_0x2f5751));_0x45d2d0(_0x2f5751);})[_0x45a6('0x16')](function(_0x1d76e3){logger['error'](_0x45a6('0x17'),_0x1d76e3[_0x45a6('0x13')],_0x5904c1);_0xc86b1a(_0x30e5c5['error'](0x1f4,_0x1d76e3['message']));});});};exports[_0x45a6('0x20')]=function(_0x725007){var _0x58a997=this;return new Promise(function(_0x41da77,_0x4bf12b){return db['SugarcrmAccount'][_0x45a6('0x21')]({'raw':_0x725007[_0x45a6('0x19')]?_0x725007['options'][_0x45a6('0x1a')]===undefined?!![]:![]:!![],'where':_0x725007[_0x45a6('0x19')]?_0x725007[_0x45a6('0x19')]['where']||null:null,'attributes':_0x725007[_0x45a6('0x19')]?_0x725007[_0x45a6('0x19')][_0x45a6('0x1e')]||null:null,'include':_0x725007[_0x45a6('0x19')]?_0x725007[_0x45a6('0x19')][_0x45a6('0x1d')]?_[_0x45a6('0x1c')](_0x725007[_0x45a6('0x19')][_0x45a6('0x1d')],function(_0x4ee107){return{'model':db[_0x4ee107['model']],'as':_0x4ee107['as'],'attributes':_0x4ee107[_0x45a6('0x1e')],'include':_0x4ee107[_0x45a6('0x1d')]?_[_0x45a6('0x1c')](_0x4ee107['include'],function(_0x145029){return{'model':db[_0x145029[_0x45a6('0x1f')]],'as':_0x145029['as'],'attributes':_0x145029[_0x45a6('0x1e')],'include':_0x145029[_0x45a6('0x1d')]?_[_0x45a6('0x1c')](_0x145029[_0x45a6('0x1d')],function(_0x392a6b){return{'model':db[_0x392a6b[_0x45a6('0x1f')]],'as':_0x392a6b['as'],'attributes':_0x392a6b[_0x45a6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x45a6('0xd')](function(_0x496eca){logger[_0x45a6('0xe')](_0x45a6('0x20'),_0x725007);logger[_0x45a6('0x10')](_0x45a6('0x20'),_0x725007,JSON['stringify'](_0x496eca));_0x41da77(_0x496eca);})[_0x45a6('0x16')](function(_0x567d4c){logger[_0x45a6('0x12')](_0x45a6('0x20'),_0x567d4c[_0x45a6('0x13')],_0x725007);_0x4bf12b(_0x58a997[_0x45a6('0x12')](0x1f4,_0x567d4c[_0x45a6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f7cc16b..b04416d 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 _0x07bb=['../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getDescriptions','create','put','update','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x394438,_0x1455e9){var _0x4bb03b=function(_0x33478e){while(--_0x33478e){_0x394438['push'](_0x394438['shift']());}};_0x4bb03b(++_0x1455e9);}(_0x07bb,0x161));var _0xb07b=function(_0x361152,_0x495395){_0x361152=_0x361152-0x0;var _0x5c068f=_0x07bb[_0x361152];return _0x5c068f;};'use strict';var multer=require('multer');var util=require(_0xb07b('0x0'));var path=require(_0xb07b('0x1'));var timeout=require(_0xb07b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb07b('0x3'));var auth=require(_0xb07b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb07b('0x5'));router[_0xb07b('0x6')]('/',auth[_0xb07b('0x7')](),controller[_0xb07b('0x8')]);router[_0xb07b('0x6')](_0xb07b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xb07b('0x6')]('/:id/fields',auth[_0xb07b('0x7')](),controller['getFields']);router['get'](_0xb07b('0xa'),auth[_0xb07b('0x7')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xb07b('0x7')](),controller[_0xb07b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb07b('0xc')]);router[_0xb07b('0xd')]('/:id',auth[_0xb07b('0x7')](),controller[_0xb07b('0xe')]);router['delete'](_0xb07b('0x9'),auth['isAuthenticated'](),controller[_0xb07b('0xf')]);module[_0xb07b('0x10')]=router; \ No newline at end of file +var _0x9759=['show','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9759,0x120));var _0x9975=function(_0xf1ad6,_0x5130cf){_0xf1ad6=_0xf1ad6-0x0;var _0xa14879=_0x9759[_0xf1ad6];return _0xa14879;};'use strict';var multer=require(_0x9975('0x0'));var util=require(_0x9975('0x1'));var path=require(_0x9975('0x2'));var timeout=require(_0x9975('0x3'));var express=require(_0x9975('0x4'));var router=express[_0x9975('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9975('0x6'));var config=require(_0x9975('0x7'));var controller=require(_0x9975('0x8'));router[_0x9975('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x9975('0xa')](),controller[_0x9975('0xb')]);router[_0x9975('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x9975('0x9')](_0x9975('0xc'),auth[_0x9975('0xa')](),controller[_0x9975('0xd')]);router[_0x9975('0x9')]('/:id/descriptions',auth[_0x9975('0xa')](),controller[_0x9975('0xe')]);router[_0x9975('0xf')]('/',auth[_0x9975('0xa')](),controller[_0x9975('0x10')]);router[_0x9975('0x11')](_0x9975('0x12'),auth[_0x9975('0xa')](),controller[_0x9975('0x13')]);router[_0x9975('0x14')](_0x9975('0x12'),auth[_0x9975('0xa')](),controller[_0x9975('0x15')]);module[_0x9975('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 79d250a..c4a50fb 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 _0x0942=['STRING'];(function(_0x19e85f,_0x439edd){var _0x364c13=function(_0x4f3881){while(--_0x4f3881){_0x19e85f['push'](_0x19e85f['shift']());}};_0x364c13(++_0x439edd);}(_0x0942,0x1ce));var _0x2094=function(_0xd8f451,_0xb2c18a){_0xd8f451=_0xd8f451-0x0;var _0x5bbd35=_0x0942[_0xd8f451];return _0x5bbd35;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2094('0x0')]},'description':{'type':Sequelize[_0x2094('0x0')]}}; \ No newline at end of file +var _0x8e11=['exports','STRING'];(function(_0x1ea17a,_0x7bdd9e){var _0x22eabe=function(_0x7123c6){while(--_0x7123c6){_0x1ea17a['push'](_0x1ea17a['shift']());}};_0x22eabe(++_0x7bdd9e);}(_0x8e11,0x72));var _0x18e1=function(_0x7a0228,_0x239f44){_0x7a0228=_0x7a0228-0x0;var _0x564448=_0x8e11[_0x7a0228];return _0x564448;};'use strict';var Sequelize=require('sequelize');module[_0x18e1('0x0')]={'name':{'type':Sequelize[_0x18e1('0x1')]},'description':{'type':Sequelize[_0x18e1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2b52788..26ef4dc 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 _0x4df2=['send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','getFields','findOne','SugarcrmField','fields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','error','stack','name'];(function(_0x3af893,_0x344d9e){var _0x300935=function(_0x108a78){while(--_0x108a78){_0x3af893['push'](_0x3af893['shift']());}};_0x300935(++_0x344d9e);}(_0x4df2,0x118));var _0x24df=function(_0x5529ff,_0x3c4f41){_0x5529ff=_0x5529ff-0x0;var _0x4f5dee=_0x4df2[_0x5529ff];return _0x4f5dee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24df('0x0'));var zipdir=require(_0x24df('0x1'));var jsonpatch=require(_0x24df('0x2'));var rp=require('request-promise');var moment=require(_0x24df('0x3'));var BPromise=require(_0x24df('0x4'));var Mustache=require(_0x24df('0x5'));var util=require('util');var path=require(_0x24df('0x6'));var sox=require(_0x24df('0x7'));var csv=require(_0x24df('0x8'));var ejs=require(_0x24df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24df('0xa'));var squel=require(_0x24df('0xb'));var crypto=require(_0x24df('0xc'));var jsforce=require(_0x24df('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x24df('0xe'));var Papa=require(_0x24df('0xf'));var Redis=require('ioredis');var authService=require(_0x24df('0x10'));var qs=require(_0x24df('0x11'));var as=require(_0x24df('0x12'));var hardwareService=require(_0x24df('0x13'));var logger=require(_0x24df('0x14'))(_0x24df('0x15'));var utils=require(_0x24df('0x16'));var config=require(_0x24df('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x24df('0x18'))['db'];function respondWithStatusCode(_0x19d564,_0x2dfbbc){_0x2dfbbc=_0x2dfbbc||0xcc;return function(_0x16da0f){if(_0x16da0f){return _0x19d564[_0x24df('0x19')](_0x2dfbbc);}return _0x19d564['status'](_0x2dfbbc)[_0x24df('0x1a')]();};}function respondWithResult(_0x53eea0,_0x195646){_0x195646=_0x195646||0xc8;return function(_0x56c4d8){if(_0x56c4d8){return _0x53eea0[_0x24df('0x1b')](_0x195646)[_0x24df('0x1c')](_0x56c4d8);}};}function respondWithFilteredResult(_0x56102e,_0x118c25){return function(_0x4bdf42){if(_0x4bdf42){var _0x36cfd2=typeof _0x118c25[_0x24df('0x1d')]===_0x24df('0x1e')&&typeof _0x118c25[_0x24df('0x1f')]==='undefined';var _0x5af0e8=_0x4bdf42[_0x24df('0x20')];var _0x2584ea=_0x36cfd2?0x0:_0x118c25['offset'];var _0x3c6f9a=_0x36cfd2?_0x4bdf42['count']:_0x118c25[_0x24df('0x1d')]+_0x118c25[_0x24df('0x1f')];var _0x1c57e8;if(_0x3c6f9a>=_0x5af0e8){_0x3c6f9a=_0x5af0e8;_0x1c57e8=0xc8;}else{_0x1c57e8=0xce;}_0x56102e[_0x24df('0x1b')](_0x1c57e8);return _0x56102e['set'](_0x24df('0x21'),_0x2584ea+'-'+_0x3c6f9a+'/'+_0x5af0e8)[_0x24df('0x1c')](_0x4bdf42);}return null;};}function patchUpdates(_0x3a7db0){return function(_0x483cab){try{jsonpatch['apply'](_0x483cab,_0x3a7db0,!![]);}catch(_0x112e54){return BPromise[_0x24df('0x22')](_0x112e54);}return _0x483cab['save']();};}function saveUpdates(_0x512b40,_0x2cba39){return function(_0x212bbe){if(_0x212bbe){return _0x212bbe['update'](_0x512b40)[_0x24df('0x23')](function(_0x40e3e6){return _0x40e3e6;});}return null;};}function removeEntity(_0x532fef,_0x16b416){return function(_0x8b6fc5){if(_0x8b6fc5){return _0x8b6fc5[_0x24df('0x24')]()['then'](function(){_0x532fef[_0x24df('0x1b')](0xcc)[_0x24df('0x1a')]();});}};}function handleEntityNotFound(_0x417bfb,_0x287ee3){return function(_0x30f0de){if(!_0x30f0de){_0x417bfb[_0x24df('0x19')](0x194);}return _0x30f0de;};}function handleError(_0x16ad6e,_0x3da7d7){_0x3da7d7=_0x3da7d7||0x1f4;return function(_0x2f59f7){logger[_0x24df('0x25')](_0x2f59f7[_0x24df('0x26')]);if(_0x2f59f7['name']){delete _0x2f59f7[_0x24df('0x27')];}_0x16ad6e[_0x24df('0x1b')](_0x3da7d7)[_0x24df('0x28')](_0x2f59f7);};}exports[_0x24df('0x29')]=function(_0x3a908b,_0x488875){var _0x4c8d62={},_0x3834da={},_0x425162={'count':0x0,'rows':[]};var _0x30a9c0=_[_0x24df('0x2a')](db[_0x24df('0x2b')][_0x24df('0x2c')],function(_0x3a6608){return{'name':_0x3a6608['fieldName'],'type':_0x3a6608[_0x24df('0x2d')][_0x24df('0x2e')]};});_0x3834da[_0x24df('0x2f')]=_[_0x24df('0x2a')](_0x30a9c0,'name');_0x3834da['query']=_[_0x24df('0x30')](_0x3a908b[_0x24df('0x31')]);_0x3834da['filters']=_[_0x24df('0x32')](_0x3834da[_0x24df('0x2f')],_0x3834da[_0x24df('0x31')]);_0x4c8d62[_0x24df('0x33')]=_[_0x24df('0x32')](_0x3834da['model'],qs['fields'](_0x3a908b[_0x24df('0x31')]['fields']));_0x4c8d62['attributes']=_0x4c8d62[_0x24df('0x33')][_0x24df('0x34')]?_0x4c8d62[_0x24df('0x33')]:_0x3834da[_0x24df('0x2f')];if(!_0x3a908b[_0x24df('0x31')][_0x24df('0x35')](_0x24df('0x36'))){_0x4c8d62[_0x24df('0x1f')]=qs[_0x24df('0x1f')](_0x3a908b[_0x24df('0x31')][_0x24df('0x1f')]);_0x4c8d62[_0x24df('0x1d')]=qs[_0x24df('0x1d')](_0x3a908b[_0x24df('0x31')]['offset']);}_0x4c8d62[_0x24df('0x37')]=qs['sort'](_0x3a908b[_0x24df('0x31')][_0x24df('0x38')]);_0x4c8d62[_0x24df('0x39')]=qs[_0x24df('0x3a')](_[_0x24df('0x3b')](_0x3a908b[_0x24df('0x31')],_0x3834da['filters']),_0x30a9c0);if(_0x3a908b[_0x24df('0x31')][_0x24df('0x3c')]){_0x4c8d62[_0x24df('0x39')]=_[_0x24df('0x3d')](_0x4c8d62[_0x24df('0x39')],{'$or':_['map'](_0x30a9c0,function(_0xaa10f2){if(_0xaa10f2['type']!==_0x24df('0x3e')){var _0x76f2d3={};_0x76f2d3[_0xaa10f2[_0x24df('0x27')]]={'$like':'%'+_0x3a908b[_0x24df('0x31')][_0x24df('0x3c')]+'%'};return _0x76f2d3;}})});}_0x4c8d62=_['merge']({},_0x4c8d62,_0x3a908b['options']);var _0x520b5e={'where':_0x4c8d62[_0x24df('0x39')]};return db[_0x24df('0x2b')][_0x24df('0x20')](_0x520b5e)[_0x24df('0x23')](function(_0x37336b){_0x425162[_0x24df('0x20')]=_0x37336b;if(_0x3a908b[_0x24df('0x31')][_0x24df('0x3f')]){_0x4c8d62[_0x24df('0x40')]=[{'all':!![]}];}return db[_0x24df('0x2b')][_0x24df('0x41')](_0x4c8d62);})[_0x24df('0x23')](function(_0x15427f){_0x425162[_0x24df('0x42')]=_0x15427f;return _0x425162;})[_0x24df('0x23')](respondWithFilteredResult(_0x488875,_0x4c8d62))[_0x24df('0x43')](handleError(_0x488875,null));};exports[_0x24df('0x44')]=function(_0x5ea5f0,_0x31d362){var _0x30cd6e={'raw':![],'where':{'id':_0x5ea5f0['params']['id']}},_0x520450={};_0x520450[_0x24df('0x2f')]=_[_0x24df('0x30')](db['SugarcrmConfiguration']['rawAttributes']);_0x520450['query']=_[_0x24df('0x30')](_0x5ea5f0['query']);_0x520450[_0x24df('0x3a')]=_[_0x24df('0x32')](_0x520450[_0x24df('0x2f')],_0x520450[_0x24df('0x31')]);_0x30cd6e[_0x24df('0x33')]=_[_0x24df('0x32')](_0x520450[_0x24df('0x2f')],qs['fields'](_0x5ea5f0[_0x24df('0x31')]['fields']));_0x30cd6e[_0x24df('0x33')]=_0x30cd6e[_0x24df('0x33')][_0x24df('0x34')]?_0x30cd6e['attributes']:_0x520450[_0x24df('0x2f')];if(_0x5ea5f0['query'][_0x24df('0x3f')]){_0x30cd6e['include']=[{'all':!![]}];}_0x30cd6e=_[_0x24df('0x3d')]({},_0x30cd6e,_0x5ea5f0[_0x24df('0x45')]);return db[_0x24df('0x2b')][_0x24df('0x46')](_0x30cd6e)[_0x24df('0x23')](handleEntityNotFound(_0x31d362,null))[_0x24df('0x23')](respondWithResult(_0x31d362,null))[_0x24df('0x43')](handleError(_0x31d362,null));};exports[_0x24df('0x47')]=function(_0x5bde9a,_0x5754d0){return db[_0x24df('0x2b')][_0x24df('0x47')](_0x5bde9a['body'],{})[_0x24df('0x23')](respondWithResult(_0x5754d0,0xc9))[_0x24df('0x43')](handleError(_0x5754d0,null));};exports['update']=function(_0x2c943a,_0x5a7d0c){if(_0x2c943a[_0x24df('0x48')]['id']){delete _0x2c943a[_0x24df('0x48')]['id'];}return db[_0x24df('0x2b')]['find']({'where':{'id':_0x2c943a[_0x24df('0x49')]['id']}})[_0x24df('0x23')](handleEntityNotFound(_0x5a7d0c,null))[_0x24df('0x23')](saveUpdates(_0x2c943a[_0x24df('0x48')],null))[_0x24df('0x23')](respondWithResult(_0x5a7d0c,null))[_0x24df('0x43')](handleError(_0x5a7d0c,null));};exports[_0x24df('0x24')]=function(_0xc9d710,_0x419a36){return db['SugarcrmConfiguration'][_0x24df('0x46')]({'where':{'id':_0xc9d710[_0x24df('0x49')]['id']}})[_0x24df('0x23')](handleEntityNotFound(_0x419a36,null))['then'](removeEntity(_0x419a36,null))[_0x24df('0x43')](handleError(_0x419a36,null));};exports[_0x24df('0x4a')]=function(_0x242dfb,_0x411e3c,_0x32bf5c){var _0x3a7254={};var _0x5e43f3={};var _0x1ebbf7;var _0x1dd190;return db['SugarcrmConfiguration'][_0x24df('0x4b')]({'where':{'id':_0x242dfb['params']['id']}})[_0x24df('0x23')](handleEntityNotFound(_0x411e3c,null))[_0x24df('0x23')](function(_0x282a6d){if(_0x282a6d){_0x1ebbf7=_0x282a6d;_0x5e43f3['model']=_[_0x24df('0x30')](db[_0x24df('0x4c')][_0x24df('0x2c')]);_0x5e43f3['query']=_[_0x24df('0x30')](_0x242dfb[_0x24df('0x31')]);_0x5e43f3['filters']=_[_0x24df('0x32')](_0x5e43f3[_0x24df('0x2f')],_0x5e43f3[_0x24df('0x31')]);_0x3a7254[_0x24df('0x33')]=_[_0x24df('0x32')](_0x5e43f3['model'],qs[_0x24df('0x4d')](_0x242dfb[_0x24df('0x31')][_0x24df('0x4d')]));_0x3a7254[_0x24df('0x33')]=_0x3a7254[_0x24df('0x33')][_0x24df('0x34')]?_0x3a7254[_0x24df('0x33')]:_0x5e43f3['model'];_0x3a7254[_0x24df('0x37')]=qs[_0x24df('0x38')](_0x242dfb[_0x24df('0x31')][_0x24df('0x38')]);_0x3a7254[_0x24df('0x39')]=qs[_0x24df('0x3a')](_['pick'](_0x242dfb[_0x24df('0x31')],_0x5e43f3[_0x24df('0x3a')]));if(_0x242dfb[_0x24df('0x31')][_0x24df('0x3c')]){_0x3a7254['where']=_[_0x24df('0x3d')](_0x3a7254[_0x24df('0x39')],{'$or':_['map'](_0x3a7254[_0x24df('0x33')],function(_0x43c9ef){var _0x4c23e9={};_0x4c23e9[_0x43c9ef]={'$like':'%'+_0x242dfb[_0x24df('0x31')][_0x24df('0x3c')]+'%'};return _0x4c23e9;})});}_0x3a7254=_[_0x24df('0x3d')]({},_0x3a7254,_0x242dfb[_0x24df('0x45')]);return _0x1ebbf7['getFields'](_0x3a7254);}})[_0x24df('0x23')](function(_0x5ab291){if(_0x5ab291){_0x1dd190=_0x5ab291[_0x24df('0x34')];if(!_0x242dfb['query'][_0x24df('0x35')](_0x24df('0x36'))){_0x3a7254[_0x24df('0x1f')]=qs[_0x24df('0x1f')](_0x242dfb['query'][_0x24df('0x1f')]);_0x3a7254['offset']=qs[_0x24df('0x1d')](_0x242dfb[_0x24df('0x31')][_0x24df('0x1d')]);}return _0x1ebbf7[_0x24df('0x4a')](_0x3a7254);}})['then'](function(_0x3c9f6d){if(_0x3c9f6d){return _0x3c9f6d?{'count':_0x1dd190,'rows':_0x3c9f6d}:null;}})[_0x24df('0x23')](respondWithResult(_0x411e3c,null))['catch'](handleError(_0x411e3c,null));};exports[_0x24df('0x4e')]=function(_0x149c49,_0x394e0b,_0x4d4380){var _0x52850b={};var _0x17cabb={};var _0x5ed37e;var _0x4f00ee;return db[_0x24df('0x2b')]['findOne']({'where':{'id':_0x149c49[_0x24df('0x49')]['id']}})[_0x24df('0x23')](handleEntityNotFound(_0x394e0b,null))[_0x24df('0x23')](function(_0x2d6a08){if(_0x2d6a08){_0x5ed37e=_0x2d6a08;_0x17cabb[_0x24df('0x2f')]=_[_0x24df('0x30')](db['SugarcrmField']['rawAttributes']);_0x17cabb[_0x24df('0x31')]=_[_0x24df('0x30')](_0x149c49['query']);_0x17cabb[_0x24df('0x3a')]=_['intersection'](_0x17cabb[_0x24df('0x2f')],_0x17cabb[_0x24df('0x31')]);_0x52850b[_0x24df('0x33')]=_['intersection'](_0x17cabb[_0x24df('0x2f')],qs[_0x24df('0x4d')](_0x149c49[_0x24df('0x31')][_0x24df('0x4d')]));_0x52850b[_0x24df('0x33')]=_0x52850b['attributes']['length']?_0x52850b[_0x24df('0x33')]:_0x17cabb[_0x24df('0x2f')];_0x52850b['order']=qs[_0x24df('0x38')](_0x149c49[_0x24df('0x31')][_0x24df('0x38')]);_0x52850b['where']=qs[_0x24df('0x3a')](_[_0x24df('0x3b')](_0x149c49[_0x24df('0x31')],_0x17cabb[_0x24df('0x3a')]));if(_0x149c49['query'][_0x24df('0x3c')]){_0x52850b[_0x24df('0x39')]=_[_0x24df('0x3d')](_0x52850b[_0x24df('0x39')],{'$or':_[_0x24df('0x2a')](_0x52850b[_0x24df('0x33')],function(_0x4d79b2){var _0x4eb837={};_0x4eb837[_0x4d79b2]={'$like':'%'+_0x149c49[_0x24df('0x31')][_0x24df('0x3c')]+'%'};return _0x4eb837;})});}_0x52850b=_[_0x24df('0x3d')]({},_0x52850b,_0x149c49[_0x24df('0x45')]);return _0x5ed37e[_0x24df('0x4e')](_0x52850b);}})[_0x24df('0x23')](function(_0x148ebb){if(_0x148ebb){_0x4f00ee=_0x148ebb[_0x24df('0x34')];if(!_0x149c49['query']['hasOwnProperty'](_0x24df('0x36'))){_0x52850b[_0x24df('0x1f')]=qs['limit'](_0x149c49[_0x24df('0x31')][_0x24df('0x1f')]);_0x52850b['offset']=qs[_0x24df('0x1d')](_0x149c49['query'][_0x24df('0x1d')]);}return _0x5ed37e['getSubjects'](_0x52850b);}})[_0x24df('0x23')](function(_0x497107){if(_0x497107){return _0x497107?{'count':_0x4f00ee,'rows':_0x497107}:null;}})['then'](respondWithResult(_0x394e0b,null))[_0x24df('0x43')](handleError(_0x394e0b,null));};exports['getDescriptions']=function(_0x5e531e,_0x2a1bd8,_0xe34920){var _0x3852d7={};var _0x526b79={};var _0x3abb33;var _0x512c95;return db[_0x24df('0x2b')]['findOne']({'where':{'id':_0x5e531e[_0x24df('0x49')]['id']}})[_0x24df('0x23')](handleEntityNotFound(_0x2a1bd8,null))['then'](function(_0x110d9c){if(_0x110d9c){_0x3abb33=_0x110d9c;_0x526b79[_0x24df('0x2f')]=_[_0x24df('0x30')](db['SugarcrmField'][_0x24df('0x2c')]);_0x526b79[_0x24df('0x31')]=_[_0x24df('0x30')](_0x5e531e[_0x24df('0x31')]);_0x526b79[_0x24df('0x3a')]=_[_0x24df('0x32')](_0x526b79[_0x24df('0x2f')],_0x526b79[_0x24df('0x31')]);_0x3852d7[_0x24df('0x33')]=_['intersection'](_0x526b79[_0x24df('0x2f')],qs[_0x24df('0x4d')](_0x5e531e[_0x24df('0x31')][_0x24df('0x4d')]));_0x3852d7['attributes']=_0x3852d7[_0x24df('0x33')][_0x24df('0x34')]?_0x3852d7[_0x24df('0x33')]:_0x526b79[_0x24df('0x2f')];_0x3852d7[_0x24df('0x37')]=qs[_0x24df('0x38')](_0x5e531e[_0x24df('0x31')][_0x24df('0x38')]);_0x3852d7[_0x24df('0x39')]=qs['filters'](_[_0x24df('0x3b')](_0x5e531e[_0x24df('0x31')],_0x526b79[_0x24df('0x3a')]));if(_0x5e531e['query'][_0x24df('0x3c')]){_0x3852d7[_0x24df('0x39')]=_[_0x24df('0x3d')](_0x3852d7[_0x24df('0x39')],{'$or':_[_0x24df('0x2a')](_0x3852d7['attributes'],function(_0x248bb3){var _0x5a3170={};_0x5a3170[_0x248bb3]={'$like':'%'+_0x5e531e[_0x24df('0x31')][_0x24df('0x3c')]+'%'};return _0x5a3170;})});}_0x3852d7=_['merge']({},_0x3852d7,_0x5e531e['options']);return _0x3abb33[_0x24df('0x4f')](_0x3852d7);}})['then'](function(_0x2ed6b5){if(_0x2ed6b5){_0x512c95=_0x2ed6b5[_0x24df('0x34')];if(!_0x5e531e[_0x24df('0x31')][_0x24df('0x35')](_0x24df('0x36'))){_0x3852d7[_0x24df('0x1f')]=qs['limit'](_0x5e531e['query'][_0x24df('0x1f')]);_0x3852d7[_0x24df('0x1d')]=qs[_0x24df('0x1d')](_0x5e531e[_0x24df('0x31')][_0x24df('0x1d')]);}return _0x3abb33[_0x24df('0x4f')](_0x3852d7);}})[_0x24df('0x23')](function(_0x4a9bc7){if(_0x4a9bc7){return _0x4a9bc7?{'count':_0x512c95,'rows':_0x4a9bc7}:null;}})[_0x24df('0x23')](respondWithResult(_0x2a1bd8,null))[_0x24df('0x43')](handleError(_0x2a1bd8,null));}; \ No newline at end of file +var _0xf0a6=['limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','catch','show','params','include','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x35a1a3,_0x3a86e3){var _0x596022=function(_0x747fe0){while(--_0x747fe0){_0x35a1a3['push'](_0x35a1a3['shift']());}};_0x596022(++_0x3a86e3);}(_0xf0a6,0x7f));var _0x6f0a=function(_0x57f959,_0x3ce8ef){_0x57f959=_0x57f959-0x0;var _0xef3d9f=_0xf0a6[_0x57f959];return _0xef3d9f;};'use strict';var emlformat=require(_0x6f0a('0x0'));var rimraf=require(_0x6f0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f0a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f0a('0x3'));var path=require('path');var sox=require(_0x6f0a('0x4'));var csv=require(_0x6f0a('0x5'));var ejs=require(_0x6f0a('0x6'));var fs=require('fs');var fs_extra=require(_0x6f0a('0x7'));var _=require(_0x6f0a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f0a('0x9'));var deskjs=require(_0x6f0a('0xa'));var toCsv=require(_0x6f0a('0x5'));var querystring=require(_0x6f0a('0xb'));var Papa=require(_0x6f0a('0xc'));var Redis=require(_0x6f0a('0xd'));var authService=require(_0x6f0a('0xe'));var qs=require(_0x6f0a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f0a('0x10'));var logger=require(_0x6f0a('0x11'))(_0x6f0a('0x12'));var utils=require(_0x6f0a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f0a('0x14'))['db'];function respondWithStatusCode(_0x2e3bef,_0x19f44f){_0x19f44f=_0x19f44f||0xcc;return function(_0x5b1b51){if(_0x5b1b51){return _0x2e3bef[_0x6f0a('0x15')](_0x19f44f);}return _0x2e3bef[_0x6f0a('0x16')](_0x19f44f)[_0x6f0a('0x17')]();};}function respondWithResult(_0x2136e2,_0x48ab60){_0x48ab60=_0x48ab60||0xc8;return function(_0x1cc4d9){if(_0x1cc4d9){return _0x2136e2[_0x6f0a('0x16')](_0x48ab60)[_0x6f0a('0x18')](_0x1cc4d9);}};}function respondWithFilteredResult(_0x59bb60,_0x23a2e9){return function(_0x3dbc84){if(_0x3dbc84){var _0x4fca4a=typeof _0x23a2e9[_0x6f0a('0x19')]===_0x6f0a('0x1a')&&typeof _0x23a2e9[_0x6f0a('0x1b')]===_0x6f0a('0x1a');var _0x835a25=_0x3dbc84['count'];var _0x34e31c=_0x4fca4a?0x0:_0x23a2e9['offset'];var _0x537fe4=_0x4fca4a?_0x3dbc84[_0x6f0a('0x1c')]:_0x23a2e9[_0x6f0a('0x19')]+_0x23a2e9[_0x6f0a('0x1b')];var _0x1e0d5b;if(_0x537fe4>=_0x835a25){_0x537fe4=_0x835a25;_0x1e0d5b=0xc8;}else{_0x1e0d5b=0xce;}_0x59bb60[_0x6f0a('0x16')](_0x1e0d5b);return _0x59bb60[_0x6f0a('0x1d')](_0x6f0a('0x1e'),_0x34e31c+'-'+_0x537fe4+'/'+_0x835a25)[_0x6f0a('0x18')](_0x3dbc84);}return null;};}function patchUpdates(_0x312fda){return function(_0x38281e){try{jsonpatch[_0x6f0a('0x1f')](_0x38281e,_0x312fda,!![]);}catch(_0x5624be){return BPromise[_0x6f0a('0x20')](_0x5624be);}return _0x38281e[_0x6f0a('0x21')]();};}function saveUpdates(_0x3520a6,_0x7c5561){return function(_0x3877db){if(_0x3877db){return _0x3877db[_0x6f0a('0x22')](_0x3520a6)['then'](function(_0x53b135){return _0x53b135;});}return null;};}function removeEntity(_0xf51c8b,_0xcaf377){return function(_0xd7536){if(_0xd7536){return _0xd7536[_0x6f0a('0x23')]()[_0x6f0a('0x24')](function(){_0xf51c8b[_0x6f0a('0x16')](0xcc)[_0x6f0a('0x17')]();});}};}function handleEntityNotFound(_0x18be37,_0x1b279d){return function(_0x452076){if(!_0x452076){_0x18be37[_0x6f0a('0x15')](0x194);}return _0x452076;};}function handleError(_0x5645bd,_0x2b545c){_0x2b545c=_0x2b545c||0x1f4;return function(_0x347165){logger[_0x6f0a('0x25')](_0x347165[_0x6f0a('0x26')]);if(_0x347165[_0x6f0a('0x27')]){delete _0x347165[_0x6f0a('0x27')];}_0x5645bd['status'](_0x2b545c)['send'](_0x347165);};}exports[_0x6f0a('0x28')]=function(_0x520397,_0x307ea2){var _0x38c097={},_0x26dd5e={},_0x59ffa2={'count':0x0,'rows':[]};var _0x4c40e4=_[_0x6f0a('0x29')](db[_0x6f0a('0x2a')][_0x6f0a('0x2b')],function(_0x498508){return{'name':_0x498508['fieldName'],'type':_0x498508[_0x6f0a('0x2c')][_0x6f0a('0x2d')]};});_0x26dd5e[_0x6f0a('0x2e')]=_[_0x6f0a('0x29')](_0x4c40e4,'name');_0x26dd5e[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x520397[_0x6f0a('0x2f')]);_0x26dd5e['filters']=_[_0x6f0a('0x31')](_0x26dd5e['model'],_0x26dd5e[_0x6f0a('0x2f')]);_0x38c097['attributes']=_[_0x6f0a('0x31')](_0x26dd5e['model'],qs[_0x6f0a('0x32')](_0x520397[_0x6f0a('0x2f')]['fields']));_0x38c097[_0x6f0a('0x33')]=_0x38c097[_0x6f0a('0x33')][_0x6f0a('0x34')]?_0x38c097[_0x6f0a('0x33')]:_0x26dd5e[_0x6f0a('0x2e')];if(!_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0x38c097[_0x6f0a('0x1b')]=qs[_0x6f0a('0x1b')](_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x1b')]);_0x38c097[_0x6f0a('0x19')]=qs[_0x6f0a('0x19')](_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x19')]);}_0x38c097[_0x6f0a('0x37')]=qs['sort'](_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x38')]);_0x38c097[_0x6f0a('0x39')]=qs['filters'](_[_0x6f0a('0x3a')](_0x520397[_0x6f0a('0x2f')],_0x26dd5e[_0x6f0a('0x3b')]),_0x4c40e4);if(_0x520397[_0x6f0a('0x2f')]['filter']){_0x38c097[_0x6f0a('0x39')]=_['merge'](_0x38c097[_0x6f0a('0x39')],{'$or':_[_0x6f0a('0x29')](_0x4c40e4,function(_0x428cf1){if(_0x428cf1[_0x6f0a('0x2c')]!==_0x6f0a('0x3c')){var _0x570d7d={};_0x570d7d[_0x428cf1['name']]={'$like':'%'+_0x520397[_0x6f0a('0x2f')][_0x6f0a('0x3d')]+'%'};return _0x570d7d;}})});}_0x38c097=_[_0x6f0a('0x3e')]({},_0x38c097,_0x520397[_0x6f0a('0x3f')]);var _0x2d45a3={'where':_0x38c097[_0x6f0a('0x39')]};return db[_0x6f0a('0x2a')][_0x6f0a('0x1c')](_0x2d45a3)[_0x6f0a('0x24')](function(_0x3a8e9f){_0x59ffa2[_0x6f0a('0x1c')]=_0x3a8e9f;if(_0x520397['query'][_0x6f0a('0x40')]){_0x38c097['include']=[{'all':!![]}];}return db[_0x6f0a('0x2a')]['findAll'](_0x38c097);})[_0x6f0a('0x24')](function(_0x252806){_0x59ffa2['rows']=_0x252806;return _0x59ffa2;})['then'](respondWithFilteredResult(_0x307ea2,_0x38c097))[_0x6f0a('0x41')](handleError(_0x307ea2,null));};exports[_0x6f0a('0x42')]=function(_0x5740ef,_0x1a5568){var _0x104e21={'raw':![],'where':{'id':_0x5740ef[_0x6f0a('0x43')]['id']}},_0x5d2454={};_0x5d2454[_0x6f0a('0x2e')]=_['keys'](db[_0x6f0a('0x2a')]['rawAttributes']);_0x5d2454[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x5740ef['query']);_0x5d2454[_0x6f0a('0x3b')]=_[_0x6f0a('0x31')](_0x5d2454[_0x6f0a('0x2e')],_0x5d2454['query']);_0x104e21[_0x6f0a('0x33')]=_[_0x6f0a('0x31')](_0x5d2454['model'],qs[_0x6f0a('0x32')](_0x5740ef[_0x6f0a('0x2f')][_0x6f0a('0x32')]));_0x104e21['attributes']=_0x104e21[_0x6f0a('0x33')]['length']?_0x104e21['attributes']:_0x5d2454['model'];if(_0x5740ef['query'][_0x6f0a('0x40')]){_0x104e21[_0x6f0a('0x44')]=[{'all':!![]}];}_0x104e21=_['merge']({},_0x104e21,_0x5740ef[_0x6f0a('0x3f')]);return db[_0x6f0a('0x2a')][_0x6f0a('0x45')](_0x104e21)['then'](handleEntityNotFound(_0x1a5568,null))[_0x6f0a('0x24')](respondWithResult(_0x1a5568,null))['catch'](handleError(_0x1a5568,null));};exports[_0x6f0a('0x46')]=function(_0x2e5ddb,_0x15864d){return db['SugarcrmConfiguration'][_0x6f0a('0x46')](_0x2e5ddb[_0x6f0a('0x47')],{})[_0x6f0a('0x24')](respondWithResult(_0x15864d,0xc9))[_0x6f0a('0x41')](handleError(_0x15864d,null));};exports[_0x6f0a('0x22')]=function(_0x460b3d,_0x25d9ae){if(_0x460b3d[_0x6f0a('0x47')]['id']){delete _0x460b3d[_0x6f0a('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x6f0a('0x45')]({'where':{'id':_0x460b3d[_0x6f0a('0x43')]['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x25d9ae,null))['then'](saveUpdates(_0x460b3d[_0x6f0a('0x47')],null))[_0x6f0a('0x24')](respondWithResult(_0x25d9ae,null))[_0x6f0a('0x41')](handleError(_0x25d9ae,null));};exports[_0x6f0a('0x23')]=function(_0x30993c,_0x2ef87c){return db['SugarcrmConfiguration'][_0x6f0a('0x45')]({'where':{'id':_0x30993c[_0x6f0a('0x43')]['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x2ef87c,null))[_0x6f0a('0x24')](removeEntity(_0x2ef87c,null))['catch'](handleError(_0x2ef87c,null));};exports[_0x6f0a('0x48')]=function(_0x2bfa18,_0x2b0c55,_0x2aace2){var _0x131ec3={};var _0x15ea7a={};var _0x33ce48;var _0x537f73;return db[_0x6f0a('0x2a')][_0x6f0a('0x49')]({'where':{'id':_0x2bfa18[_0x6f0a('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b0c55,null))[_0x6f0a('0x24')](function(_0x2f40c3){if(_0x2f40c3){_0x33ce48=_0x2f40c3;_0x15ea7a[_0x6f0a('0x2e')]=_['keys'](db[_0x6f0a('0x4a')][_0x6f0a('0x2b')]);_0x15ea7a['query']=_[_0x6f0a('0x30')](_0x2bfa18['query']);_0x15ea7a['filters']=_[_0x6f0a('0x31')](_0x15ea7a['model'],_0x15ea7a[_0x6f0a('0x2f')]);_0x131ec3[_0x6f0a('0x33')]=_[_0x6f0a('0x31')](_0x15ea7a[_0x6f0a('0x2e')],qs['fields'](_0x2bfa18['query'][_0x6f0a('0x32')]));_0x131ec3['attributes']=_0x131ec3[_0x6f0a('0x33')][_0x6f0a('0x34')]?_0x131ec3['attributes']:_0x15ea7a[_0x6f0a('0x2e')];_0x131ec3[_0x6f0a('0x37')]=qs[_0x6f0a('0x38')](_0x2bfa18[_0x6f0a('0x2f')][_0x6f0a('0x38')]);_0x131ec3['where']=qs[_0x6f0a('0x3b')](_[_0x6f0a('0x3a')](_0x2bfa18[_0x6f0a('0x2f')],_0x15ea7a[_0x6f0a('0x3b')]));if(_0x2bfa18['query'][_0x6f0a('0x3d')]){_0x131ec3[_0x6f0a('0x39')]=_['merge'](_0x131ec3['where'],{'$or':_['map'](_0x131ec3[_0x6f0a('0x33')],function(_0x2efe80){var _0xc3c990={};_0xc3c990[_0x2efe80]={'$like':'%'+_0x2bfa18['query']['filter']+'%'};return _0xc3c990;})});}_0x131ec3=_['merge']({},_0x131ec3,_0x2bfa18[_0x6f0a('0x3f')]);return _0x33ce48[_0x6f0a('0x48')](_0x131ec3);}})[_0x6f0a('0x24')](function(_0x46a711){if(_0x46a711){_0x537f73=_0x46a711[_0x6f0a('0x34')];if(!_0x2bfa18[_0x6f0a('0x2f')][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0x131ec3[_0x6f0a('0x1b')]=qs['limit'](_0x2bfa18[_0x6f0a('0x2f')][_0x6f0a('0x1b')]);_0x131ec3['offset']=qs[_0x6f0a('0x19')](_0x2bfa18[_0x6f0a('0x2f')]['offset']);}return _0x33ce48[_0x6f0a('0x48')](_0x131ec3);}})['then'](function(_0x22b276){if(_0x22b276){return _0x22b276?{'count':_0x537f73,'rows':_0x22b276}:null;}})[_0x6f0a('0x24')](respondWithResult(_0x2b0c55,null))['catch'](handleError(_0x2b0c55,null));};exports[_0x6f0a('0x4b')]=function(_0x331873,_0x341b1f,_0x46fe7b){var _0x2e0c79={};var _0x45c729={};var _0x3bf67a;var _0x5156b2;return db[_0x6f0a('0x2a')][_0x6f0a('0x49')]({'where':{'id':_0x331873[_0x6f0a('0x43')]['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x341b1f,null))[_0x6f0a('0x24')](function(_0x118f27){if(_0x118f27){_0x3bf67a=_0x118f27;_0x45c729['model']=_['keys'](db['SugarcrmField'][_0x6f0a('0x2b')]);_0x45c729[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x331873[_0x6f0a('0x2f')]);_0x45c729[_0x6f0a('0x3b')]=_[_0x6f0a('0x31')](_0x45c729[_0x6f0a('0x2e')],_0x45c729['query']);_0x2e0c79[_0x6f0a('0x33')]=_['intersection'](_0x45c729[_0x6f0a('0x2e')],qs[_0x6f0a('0x32')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x32')]));_0x2e0c79[_0x6f0a('0x33')]=_0x2e0c79['attributes'][_0x6f0a('0x34')]?_0x2e0c79[_0x6f0a('0x33')]:_0x45c729[_0x6f0a('0x2e')];_0x2e0c79[_0x6f0a('0x37')]=qs[_0x6f0a('0x38')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x38')]);_0x2e0c79[_0x6f0a('0x39')]=qs['filters'](_['pick'](_0x331873[_0x6f0a('0x2f')],_0x45c729['filters']));if(_0x331873[_0x6f0a('0x2f')]['filter']){_0x2e0c79['where']=_[_0x6f0a('0x3e')](_0x2e0c79[_0x6f0a('0x39')],{'$or':_['map'](_0x2e0c79['attributes'],function(_0x50d387){var _0x452380={};_0x452380[_0x50d387]={'$like':'%'+_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x3d')]+'%'};return _0x452380;})});}_0x2e0c79=_[_0x6f0a('0x3e')]({},_0x2e0c79,_0x331873[_0x6f0a('0x3f')]);return _0x3bf67a['getSubjects'](_0x2e0c79);}})[_0x6f0a('0x24')](function(_0x55bf4e){if(_0x55bf4e){_0x5156b2=_0x55bf4e[_0x6f0a('0x34')];if(!_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0x2e0c79[_0x6f0a('0x1b')]=qs[_0x6f0a('0x1b')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x1b')]);_0x2e0c79[_0x6f0a('0x19')]=qs[_0x6f0a('0x19')](_0x331873[_0x6f0a('0x2f')][_0x6f0a('0x19')]);}return _0x3bf67a[_0x6f0a('0x4b')](_0x2e0c79);}})[_0x6f0a('0x24')](function(_0x50436f){if(_0x50436f){return _0x50436f?{'count':_0x5156b2,'rows':_0x50436f}:null;}})[_0x6f0a('0x24')](respondWithResult(_0x341b1f,null))[_0x6f0a('0x41')](handleError(_0x341b1f,null));};exports[_0x6f0a('0x4c')]=function(_0x59c02b,_0x337b05,_0x55a0d8){var _0xfff1af={};var _0x3f5d68={};var _0x55e404;var _0x3e87c8;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x59c02b['params']['id']}})[_0x6f0a('0x24')](handleEntityNotFound(_0x337b05,null))['then'](function(_0x337013){if(_0x337013){_0x55e404=_0x337013;_0x3f5d68[_0x6f0a('0x2e')]=_['keys'](db[_0x6f0a('0x4a')][_0x6f0a('0x2b')]);_0x3f5d68[_0x6f0a('0x2f')]=_[_0x6f0a('0x30')](_0x59c02b[_0x6f0a('0x2f')]);_0x3f5d68[_0x6f0a('0x3b')]=_[_0x6f0a('0x31')](_0x3f5d68[_0x6f0a('0x2e')],_0x3f5d68[_0x6f0a('0x2f')]);_0xfff1af[_0x6f0a('0x33')]=_[_0x6f0a('0x31')](_0x3f5d68['model'],qs[_0x6f0a('0x32')](_0x59c02b[_0x6f0a('0x2f')]['fields']));_0xfff1af[_0x6f0a('0x33')]=_0xfff1af['attributes'][_0x6f0a('0x34')]?_0xfff1af[_0x6f0a('0x33')]:_0x3f5d68['model'];_0xfff1af[_0x6f0a('0x37')]=qs['sort'](_0x59c02b[_0x6f0a('0x2f')]['sort']);_0xfff1af[_0x6f0a('0x39')]=qs['filters'](_[_0x6f0a('0x3a')](_0x59c02b[_0x6f0a('0x2f')],_0x3f5d68[_0x6f0a('0x3b')]));if(_0x59c02b[_0x6f0a('0x2f')][_0x6f0a('0x3d')]){_0xfff1af[_0x6f0a('0x39')]=_[_0x6f0a('0x3e')](_0xfff1af[_0x6f0a('0x39')],{'$or':_[_0x6f0a('0x29')](_0xfff1af[_0x6f0a('0x33')],function(_0x168af5){var _0x33bda5={};_0x33bda5[_0x168af5]={'$like':'%'+_0x59c02b[_0x6f0a('0x2f')]['filter']+'%'};return _0x33bda5;})});}_0xfff1af=_[_0x6f0a('0x3e')]({},_0xfff1af,_0x59c02b['options']);return _0x55e404[_0x6f0a('0x4c')](_0xfff1af);}})[_0x6f0a('0x24')](function(_0x1d126c){if(_0x1d126c){_0x3e87c8=_0x1d126c[_0x6f0a('0x34')];if(!_0x59c02b['query'][_0x6f0a('0x35')](_0x6f0a('0x36'))){_0xfff1af[_0x6f0a('0x1b')]=qs['limit'](_0x59c02b[_0x6f0a('0x2f')]['limit']);_0xfff1af[_0x6f0a('0x19')]=qs[_0x6f0a('0x19')](_0x59c02b[_0x6f0a('0x2f')][_0x6f0a('0x19')]);}return _0x55e404['getDescriptions'](_0xfff1af);}})[_0x6f0a('0x24')](function(_0x1efa52){if(_0x1efa52){return _0x1efa52?{'count':_0x3e87c8,'rows':_0x1efa52}:null;}})[_0x6f0a('0x24')](respondWithResult(_0x337b05,null))[_0x6f0a('0x41')](handleError(_0x337b05,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 7654a9f..26e4513 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 _0x4245=['define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x1d6f4f,_0x230710){var _0x4aa71a=function(_0x509115){while(--_0x509115){_0x1d6f4f['push'](_0x1d6f4f['shift']());}};_0x4aa71a(++_0x230710);}(_0x4245,0x81));var _0x5424=function(_0x325592,_0x552b78){_0x325592=_0x325592-0x0;var _0x170941=_0x4245[_0x325592];return _0x170941;};'use strict';var _=require('lodash');var util=require(_0x5424('0x0'));var logger=require(_0x5424('0x1'))(_0x5424('0x2'));var moment=require(_0x5424('0x3'));var BPromise=require(_0x5424('0x4'));var rp=require(_0x5424('0x5'));var fs=require('fs');var path=require(_0x5424('0x6'));var rimraf=require(_0x5424('0x7'));var config=require(_0x5424('0x8'));var attributes=require(_0x5424('0x9'));module[_0x5424('0xa')]=function(_0x35c4ba,_0x48aad3){return _0x35c4ba[_0x5424('0xb')](_0x5424('0xc'),attributes,{'tableName':_0x5424('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdc7=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','api'];(function(_0x50dc2f,_0x2512fc){var _0xefb8c5=function(_0x3fe9aa){while(--_0x3fe9aa){_0x50dc2f['push'](_0x50dc2f['shift']());}};_0xefb8c5(++_0x2512fc);}(_0xcdc7,0xa3));var _0x7cdc=function(_0x3e9e8b,_0xc8ed51){_0x3e9e8b=_0x3e9e8b-0x0;var _0x58e996=_0xcdc7[_0x3e9e8b];return _0x58e996;};'use strict';var _=require(_0x7cdc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7cdc('0x1'));var moment=require(_0x7cdc('0x2'));var BPromise=require(_0x7cdc('0x3'));var rp=require(_0x7cdc('0x4'));var fs=require('fs');var path=require(_0x7cdc('0x5'));var rimraf=require('rimraf');var config=require(_0x7cdc('0x6'));var attributes=require(_0x7cdc('0x7'));module[_0x7cdc('0x8')]=function(_0x14ae95,_0x3905e2){return _0x14ae95[_0x7cdc('0x9')](_0x7cdc('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 8de8391..37e8cf0 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 _0x7a07=['rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x7a07,0x19f));var _0x77a0=function(_0x44fbe2,_0x143626){_0x44fbe2=_0x44fbe2-0x0;var _0x1b74be=_0x7a07[_0x44fbe2];return _0x1b74be;};'use strict';var _=require(_0x77a0('0x0'));var util=require(_0x77a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77a0('0x2'))['db'];var utils=require(_0x77a0('0x3'));var logger=require(_0x77a0('0x4'))(_0x77a0('0x5'));var config=require(_0x77a0('0x6'));var jayson=require(_0x77a0('0x7'));var client=jayson[_0x77a0('0x8')][_0x77a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x207a42,_0x21b07a,_0x3e464a){return new BPromise(function(_0x25f92b,_0x3f5028){return client[_0x77a0('0xa')](_0x207a42,_0x3e464a)[_0x77a0('0xb')](function(_0x231655){logger['info'](_0x77a0('0xc'),_0x21b07a,_0x77a0('0xd'));logger[_0x77a0('0xe')](_0x77a0('0xf'),_0x21b07a,_0x77a0('0xd'),JSON[_0x77a0('0x10')](_0x231655));if(_0x231655[_0x77a0('0x11')]){if(_0x231655['error'][_0x77a0('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x21b07a,_0x231655[_0x77a0('0x11')]['message']);return _0x3f5028(_0x231655[_0x77a0('0x11')][_0x77a0('0x13')]);}logger[_0x77a0('0x11')](_0x77a0('0xc'),_0x21b07a,_0x231655[_0x77a0('0x11')]['message']);return _0x25f92b(_0x231655[_0x77a0('0x11')]['message']);}else{logger['info'](_0x77a0('0xc'),_0x21b07a,'request\x20sent');_0x25f92b(_0x231655['result']['message']);}})[_0x77a0('0x14')](function(_0x32ce7e){logger[_0x77a0('0x11')](_0x77a0('0xc'),_0x21b07a,_0x32ce7e);_0x3f5028(_0x32ce7e);});});} \ No newline at end of file +var _0xfb3e=['lodash','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xa9671b,_0x11378d){var _0x205591=function(_0x5dc88d){while(--_0x5dc88d){_0xa9671b['push'](_0xa9671b['shift']());}};_0x205591(++_0x11378d);}(_0xfb3e,0x1c2));var _0xefb3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfb3e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xefb3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xefb3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefb3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefb3('0x3'))('rpc');var config=require(_0xefb3('0x4'));var jayson=require(_0xefb3('0x5'));var client=jayson[_0xefb3('0x6')][_0xefb3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f6478,_0x353f03,_0x4f7461){return new BPromise(function(_0x41f986,_0x547006){return client['request'](_0x1f6478,_0x4f7461)['then'](function(_0x1de63a){logger[_0xefb3('0x8')](_0xefb3('0x9'),_0x353f03,_0xefb3('0xa'));logger[_0xefb3('0xb')](_0xefb3('0xc'),_0x353f03,_0xefb3('0xa'),JSON[_0xefb3('0xd')](_0x1de63a));if(_0x1de63a['error']){if(_0x1de63a[_0xefb3('0xe')]['code']===0x1f4){logger[_0xefb3('0xe')](_0xefb3('0x9'),_0x353f03,_0x1de63a[_0xefb3('0xe')][_0xefb3('0xf')]);return _0x547006(_0x1de63a['error'][_0xefb3('0xf')]);}logger[_0xefb3('0xe')](_0xefb3('0x9'),_0x353f03,_0x1de63a[_0xefb3('0xe')][_0xefb3('0xf')]);return _0x41f986(_0x1de63a[_0xefb3('0xe')]['message']);}else{logger[_0xefb3('0x8')](_0xefb3('0x9'),_0x353f03,_0xefb3('0xa'));_0x41f986(_0x1de63a[_0xefb3('0x10')]['message']);}})[_0xefb3('0x11')](function(_0x2234f9){logger['error'](_0xefb3('0x9'),_0x353f03,_0x2234f9);_0x547006(_0x2234f9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index d67d6f8..c61c8b5 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 _0x0009=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0xdc009e,_0x10b501){var _0x499d0f=function(_0x36b5c0){while(--_0x36b5c0){_0xdc009e['push'](_0xdc009e['shift']());}};_0x499d0f(++_0x10b501);}(_0x0009,0x13f));var _0x9000=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0x0009[_0x39a2d6];return _0x23af66;};'use strict';var multer=require(_0x9000('0x0'));var util=require(_0x9000('0x1'));var path=require(_0x9000('0x2'));var timeout=require(_0x9000('0x3'));var express=require(_0x9000('0x4'));var router=express[_0x9000('0x5')]();var fs_extra=require(_0x9000('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9000('0x7'));var config=require(_0x9000('0x8'));var controller=require(_0x9000('0x9'));router[_0x9000('0xa')]('/',auth[_0x9000('0xb')](),controller[_0x9000('0xc')]);router['get'](_0x9000('0xd'),auth[_0x9000('0xb')](),controller[_0x9000('0xe')]);router[_0x9000('0xf')]('/',auth[_0x9000('0xb')](),controller[_0x9000('0x10')]);router[_0x9000('0x11')](_0x9000('0xd'),auth[_0x9000('0xb')](),controller[_0x9000('0x12')]);router[_0x9000('0x13')](_0x9000('0xd'),auth[_0x9000('0xb')](),controller[_0x9000('0x14')]);module[_0x9000('0x15')]=router; \ No newline at end of file +var _0x3ac5=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x3ac5,0xe0));var _0x53ac=function(_0x34dcde,_0x35aed){_0x34dcde=_0x34dcde-0x0;var _0x264419=_0x3ac5[_0x34dcde];return _0x264419;};'use strict';var multer=require(_0x53ac('0x0'));var util=require(_0x53ac('0x1'));var path=require(_0x53ac('0x2'));var timeout=require(_0x53ac('0x3'));var express=require(_0x53ac('0x4'));var router=express[_0x53ac('0x5')]();var fs_extra=require(_0x53ac('0x6'));var auth=require(_0x53ac('0x7'));var interaction=require(_0x53ac('0x8'));var config=require(_0x53ac('0x9'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x53ac('0xa')](),controller[_0x53ac('0xb')]);router[_0x53ac('0xc')](_0x53ac('0xd'),auth['isAuthenticated'](),controller[_0x53ac('0xe')]);router['post']('/',auth[_0x53ac('0xa')](),controller[_0x53ac('0xf')]);router[_0x53ac('0x10')](_0x53ac('0xd'),auth['isAuthenticated'](),controller[_0x53ac('0x11')]);router[_0x53ac('0x12')](_0x53ac('0xd'),auth[_0x53ac('0xa')](),controller[_0x53ac('0x13')]);module[_0x53ac('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 661a1ff..49b1d6d 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 _0x9d34=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x3e88d5,_0x2bf53e){var _0x343031=function(_0xfff2b){while(--_0xfff2b){_0x3e88d5['push'](_0x3e88d5['shift']());}};_0x343031(++_0x2bf53e);}(_0x9d34,0xfe));var _0x49d3=function(_0x5dbd4b,_0x2fb8fe){_0x5dbd4b=_0x5dbd4b-0x0;var _0x5d2723=_0x9d34[_0x5dbd4b];return _0x5d2723;};'use strict';var Sequelize=require(_0x49d3('0x0'));module[_0x49d3('0x1')]={'type':{'type':Sequelize[_0x49d3('0x2')](_0x49d3('0x3'),_0x49d3('0x4'),_0x49d3('0x5'),_0x49d3('0x6'),_0x49d3('0x7')),'defaultValue':_0x49d3('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x49d3('0x2')](_0x49d3('0x3'),'variable',_0x49d3('0x5'))},'keyContent':{'type':Sequelize[_0x49d3('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x49d3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49d3('0x8')]}}; \ No newline at end of file +var _0xca6b=['string','variable','customVariable','picklist','STRING','BOOLEAN','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xca6b,0x179));var _0xbca6=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xca6b[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xbca6('0x0')](_0xbca6('0x1'),_0xbca6('0x2'),_0xbca6('0x3'),'keyValue',_0xbca6('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbca6('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbca6('0x1'),_0xbca6('0x2'),_0xbca6('0x3'))},'keyContent':{'type':Sequelize[_0xbca6('0x5')]},'idField':{'type':Sequelize[_0xbca6('0x5')]},'nameField':{'type':Sequelize[_0xbca6('0x5')]},'customField':{'type':Sequelize[_0xbca6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a7e5e57..3d3f3fe 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 _0x4688=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','SugarcrmField','key','model','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','where','merge','filter','options','count','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','create','body','params','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x50c5fd,_0x4d9f10){var _0x547eb7=function(_0x181422){while(--_0x181422){_0x50c5fd['push'](_0x50c5fd['shift']());}};_0x547eb7(++_0x4d9f10);}(_0x4688,0x121));var _0x8468=function(_0x1d760b,_0x47f9fe){_0x1d760b=_0x1d760b-0x0;var _0x18fb17=_0x4688[_0x1d760b];return _0x18fb17;};'use strict';var emlformat=require(_0x8468('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8468('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8468('0x2'));var moment=require(_0x8468('0x3'));var BPromise=require(_0x8468('0x4'));var Mustache=require(_0x8468('0x5'));var util=require('util');var path=require(_0x8468('0x6'));var sox=require(_0x8468('0x7'));var csv=require('to-csv');var ejs=require(_0x8468('0x8'));var fs=require('fs');var fs_extra=require(_0x8468('0x9'));var _=require(_0x8468('0xa'));var squel=require(_0x8468('0xb'));var crypto=require(_0x8468('0xc'));var jsforce=require(_0x8468('0xd'));var deskjs=require(_0x8468('0xe'));var toCsv=require(_0x8468('0xf'));var querystring=require('querystring');var Papa=require(_0x8468('0x10'));var Redis=require(_0x8468('0x11'));var authService=require(_0x8468('0x12'));var qs=require(_0x8468('0x13'));var as=require(_0x8468('0x14'));var hardwareService=require(_0x8468('0x15'));var logger=require(_0x8468('0x16'))('api');var utils=require(_0x8468('0x17'));var config=require(_0x8468('0x18'));var licenseUtil=require(_0x8468('0x19'));var db=require(_0x8468('0x1a'))['db'];function respondWithStatusCode(_0x33ce36,_0x685586){_0x685586=_0x685586||0xcc;return function(_0x24fcd0){if(_0x24fcd0){return _0x33ce36[_0x8468('0x1b')](_0x685586);}return _0x33ce36[_0x8468('0x1c')](_0x685586)['end']();};}function respondWithResult(_0x186cee,_0x2a2887){_0x2a2887=_0x2a2887||0xc8;return function(_0xcfaf0){if(_0xcfaf0){return _0x186cee[_0x8468('0x1c')](_0x2a2887)[_0x8468('0x1d')](_0xcfaf0);}};}function respondWithFilteredResult(_0x49b402,_0x5387ef){return function(_0x42d051){if(_0x42d051){var _0x4bc8aa=typeof _0x5387ef['offset']===_0x8468('0x1e')&&typeof _0x5387ef['limit']==='undefined';var _0x386a70=_0x42d051['count'];var _0x243640=_0x4bc8aa?0x0:_0x5387ef[_0x8468('0x1f')];var _0x4ec943=_0x4bc8aa?_0x42d051['count']:_0x5387ef[_0x8468('0x1f')]+_0x5387ef['limit'];var _0x31fa73;if(_0x4ec943>=_0x386a70){_0x4ec943=_0x386a70;_0x31fa73=0xc8;}else{_0x31fa73=0xce;}_0x49b402[_0x8468('0x1c')](_0x31fa73);return _0x49b402[_0x8468('0x20')](_0x8468('0x21'),_0x243640+'-'+_0x4ec943+'/'+_0x386a70)[_0x8468('0x1d')](_0x42d051);}return null;};}function patchUpdates(_0x54fe28){return function(_0x2e36a5){try{jsonpatch[_0x8468('0x22')](_0x2e36a5,_0x54fe28,!![]);}catch(_0x4ae991){return BPromise[_0x8468('0x23')](_0x4ae991);}return _0x2e36a5['save']();};}function saveUpdates(_0x449146,_0x2fdc6d){return function(_0x2f58ae){if(_0x2f58ae){return _0x2f58ae[_0x8468('0x24')](_0x449146)[_0x8468('0x25')](function(_0x1a7885){return _0x1a7885;});}return null;};}function removeEntity(_0x3d26fb,_0x59baa6){return function(_0x5be7d6){if(_0x5be7d6){return _0x5be7d6[_0x8468('0x26')]()[_0x8468('0x25')](function(){_0x3d26fb['status'](0xcc)[_0x8468('0x27')]();});}};}function handleEntityNotFound(_0x3087a3,_0x1f4cf7){return function(_0x1bd99e){if(!_0x1bd99e){_0x3087a3[_0x8468('0x1b')](0x194);}return _0x1bd99e;};}function handleError(_0x14d573,_0x38cec2){_0x38cec2=_0x38cec2||0x1f4;return function(_0x43f652){logger['error'](_0x43f652[_0x8468('0x28')]);if(_0x43f652[_0x8468('0x29')]){delete _0x43f652[_0x8468('0x29')];}_0x14d573[_0x8468('0x1c')](_0x38cec2)[_0x8468('0x2a')](_0x43f652);};}exports[_0x8468('0x2b')]=function(_0x5cb5e0,_0x106540){var _0x53d5e1={},_0xe92cf5={},_0x58c4ba={'count':0x0,'rows':[]};var _0x560763=_[_0x8468('0x2c')](db[_0x8468('0x2d')]['rawAttributes'],function(_0x3add1a){return{'name':_0x3add1a['fieldName'],'type':_0x3add1a['type'][_0x8468('0x2e')]};});_0xe92cf5[_0x8468('0x2f')]=_[_0x8468('0x2c')](_0x560763,_0x8468('0x29'));_0xe92cf5['query']=_['keys'](_0x5cb5e0[_0x8468('0x30')]);_0xe92cf5[_0x8468('0x31')]=_['intersection'](_0xe92cf5[_0x8468('0x2f')],_0xe92cf5[_0x8468('0x30')]);_0x53d5e1[_0x8468('0x32')]=_[_0x8468('0x33')](_0xe92cf5['model'],qs[_0x8468('0x34')](_0x5cb5e0[_0x8468('0x30')]['fields']));_0x53d5e1[_0x8468('0x32')]=_0x53d5e1[_0x8468('0x32')][_0x8468('0x35')]?_0x53d5e1['attributes']:_0xe92cf5['model'];if(!_0x5cb5e0['query']['hasOwnProperty'](_0x8468('0x36'))){_0x53d5e1[_0x8468('0x37')]=qs[_0x8468('0x37')](_0x5cb5e0[_0x8468('0x30')][_0x8468('0x37')]);_0x53d5e1[_0x8468('0x1f')]=qs['offset'](_0x5cb5e0['query'][_0x8468('0x1f')]);}_0x53d5e1[_0x8468('0x38')]=qs[_0x8468('0x39')](_0x5cb5e0[_0x8468('0x30')][_0x8468('0x39')]);_0x53d5e1['where']=qs[_0x8468('0x31')](_[_0x8468('0x3a')](_0x5cb5e0[_0x8468('0x30')],_0xe92cf5[_0x8468('0x31')]),_0x560763);if(_0x5cb5e0[_0x8468('0x30')]['filter']){_0x53d5e1[_0x8468('0x3b')]=_[_0x8468('0x3c')](_0x53d5e1[_0x8468('0x3b')],{'$or':_[_0x8468('0x2c')](_0x560763,function(_0x4e831b){if(_0x4e831b['type']!=='VIRTUAL'){var _0x40f238={};_0x40f238[_0x4e831b['name']]={'$like':'%'+_0x5cb5e0[_0x8468('0x30')][_0x8468('0x3d')]+'%'};return _0x40f238;}})});}_0x53d5e1=_[_0x8468('0x3c')]({},_0x53d5e1,_0x5cb5e0[_0x8468('0x3e')]);var _0x15e82b={'where':_0x53d5e1[_0x8468('0x3b')]};return db[_0x8468('0x2d')]['count'](_0x15e82b)[_0x8468('0x25')](function(_0x22089f){_0x58c4ba[_0x8468('0x3f')]=_0x22089f;if(_0x5cb5e0[_0x8468('0x30')][_0x8468('0x40')]){_0x53d5e1['include']=[{'all':!![]}];}return db[_0x8468('0x2d')][_0x8468('0x41')](_0x53d5e1);})[_0x8468('0x25')](function(_0x9e12a0){_0x58c4ba[_0x8468('0x42')]=_0x9e12a0;return _0x58c4ba;})[_0x8468('0x25')](respondWithFilteredResult(_0x106540,_0x53d5e1))[_0x8468('0x43')](handleError(_0x106540,null));};exports[_0x8468('0x44')]=function(_0x3c4d06,_0x56352a){var _0x3df9e8={'raw':!![],'where':{'id':_0x3c4d06['params']['id']}},_0x573100={};_0x573100[_0x8468('0x2f')]=_[_0x8468('0x45')](db[_0x8468('0x2d')][_0x8468('0x46')]);_0x573100[_0x8468('0x30')]=_['keys'](_0x3c4d06['query']);_0x573100[_0x8468('0x31')]=_['intersection'](_0x573100[_0x8468('0x2f')],_0x573100[_0x8468('0x30')]);_0x3df9e8[_0x8468('0x32')]=_[_0x8468('0x33')](_0x573100[_0x8468('0x2f')],qs[_0x8468('0x34')](_0x3c4d06['query'][_0x8468('0x34')]));_0x3df9e8['attributes']=_0x3df9e8['attributes'][_0x8468('0x35')]?_0x3df9e8[_0x8468('0x32')]:_0x573100[_0x8468('0x2f')];if(_0x3c4d06[_0x8468('0x30')][_0x8468('0x40')]){_0x3df9e8[_0x8468('0x47')]=[{'all':!![]}];}_0x3df9e8=_[_0x8468('0x3c')]({},_0x3df9e8,_0x3c4d06[_0x8468('0x3e')]);return db[_0x8468('0x2d')]['find'](_0x3df9e8)[_0x8468('0x25')](handleEntityNotFound(_0x56352a,null))[_0x8468('0x25')](respondWithResult(_0x56352a,null))[_0x8468('0x43')](handleError(_0x56352a,null));};exports['create']=function(_0x5b04e2,_0x29fa46){return db[_0x8468('0x2d')][_0x8468('0x48')](_0x5b04e2[_0x8468('0x49')],{})[_0x8468('0x25')](respondWithResult(_0x29fa46,0xc9))[_0x8468('0x43')](handleError(_0x29fa46,null));};exports[_0x8468('0x24')]=function(_0x38825e,_0x1aff8b){if(_0x38825e['body']['id']){delete _0x38825e[_0x8468('0x49')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x38825e[_0x8468('0x4a')]['id']}})[_0x8468('0x25')](handleEntityNotFound(_0x1aff8b,null))[_0x8468('0x25')](saveUpdates(_0x38825e['body'],null))['then'](respondWithResult(_0x1aff8b,null))['catch'](handleError(_0x1aff8b,null));};exports['destroy']=function(_0x1038d2,_0x44053d){return db['SugarcrmField'][_0x8468('0x4b')]({'where':{'id':_0x1038d2[_0x8468('0x4a')]['id']}})[_0x8468('0x25')](handleEntityNotFound(_0x44053d,null))[_0x8468('0x25')](removeEntity(_0x44053d,null))[_0x8468('0x43')](handleError(_0x44053d,null));}; \ No newline at end of file +var _0x369c=['fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','show','length','includeAll','options','find','create','body','params','catch','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes'];(function(_0x15aacc,_0x907610){var _0x511759=function(_0xf00a28){while(--_0xf00a28){_0x15aacc['push'](_0x15aacc['shift']());}};_0x511759(++_0x907610);}(_0x369c,0x190));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc369('0x0'));var jsonpatch=require(_0xc369('0x1'));var rp=require(_0xc369('0x2'));var moment=require('moment');var BPromise=require(_0xc369('0x3'));var Mustache=require(_0xc369('0x4'));var util=require(_0xc369('0x5'));var path=require(_0xc369('0x6'));var sox=require(_0xc369('0x7'));var csv=require('to-csv');var ejs=require(_0xc369('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc369('0x9'));var squel=require(_0xc369('0xa'));var crypto=require(_0xc369('0xb'));var jsforce=require(_0xc369('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc369('0xd'));var Papa=require(_0xc369('0xe'));var Redis=require('ioredis');var authService=require(_0xc369('0xf'));var qs=require(_0xc369('0x10'));var as=require(_0xc369('0x11'));var hardwareService=require(_0xc369('0x12'));var logger=require(_0xc369('0x13'))(_0xc369('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc369('0x15'));var db=require(_0xc369('0x16'))['db'];function respondWithStatusCode(_0x3c3408,_0x300010){_0x300010=_0x300010||0xcc;return function(_0x7b701c){if(_0x7b701c){return _0x3c3408[_0xc369('0x17')](_0x300010);}return _0x3c3408[_0xc369('0x18')](_0x300010)['end']();};}function respondWithResult(_0xb3b4b6,_0x1c3866){_0x1c3866=_0x1c3866||0xc8;return function(_0x25b059){if(_0x25b059){return _0xb3b4b6['status'](_0x1c3866)[_0xc369('0x19')](_0x25b059);}};}function respondWithFilteredResult(_0x2d45b9,_0x21498c){return function(_0x470e8c){if(_0x470e8c){var _0x2fe402=typeof _0x21498c[_0xc369('0x1a')]===_0xc369('0x1b')&&typeof _0x21498c[_0xc369('0x1c')]===_0xc369('0x1b');var _0x228e2=_0x470e8c[_0xc369('0x1d')];var _0x35530c=_0x2fe402?0x0:_0x21498c['offset'];var _0x4909dd=_0x2fe402?_0x470e8c[_0xc369('0x1d')]:_0x21498c[_0xc369('0x1a')]+_0x21498c[_0xc369('0x1c')];var _0x2f37dc;if(_0x4909dd>=_0x228e2){_0x4909dd=_0x228e2;_0x2f37dc=0xc8;}else{_0x2f37dc=0xce;}_0x2d45b9[_0xc369('0x18')](_0x2f37dc);return _0x2d45b9['set'](_0xc369('0x1e'),_0x35530c+'-'+_0x4909dd+'/'+_0x228e2)[_0xc369('0x19')](_0x470e8c);}return null;};}function patchUpdates(_0x4ff5a0){return function(_0x454a74){try{jsonpatch[_0xc369('0x1f')](_0x454a74,_0x4ff5a0,!![]);}catch(_0x367a53){return BPromise[_0xc369('0x20')](_0x367a53);}return _0x454a74['save']();};}function saveUpdates(_0x29dd04,_0x1c5d4d){return function(_0x547eba){if(_0x547eba){return _0x547eba[_0xc369('0x21')](_0x29dd04)[_0xc369('0x22')](function(_0x23dcb8){return _0x23dcb8;});}return null;};}function removeEntity(_0x4cc240,_0x5a63f0){return function(_0x3ede20){if(_0x3ede20){return _0x3ede20[_0xc369('0x23')]()[_0xc369('0x22')](function(){_0x4cc240[_0xc369('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a24c,_0x3d1a1f){return function(_0xa5e9f5){if(!_0xa5e9f5){_0x20a24c[_0xc369('0x17')](0x194);}return _0xa5e9f5;};}function handleError(_0xff4145,_0x34a8bf){_0x34a8bf=_0x34a8bf||0x1f4;return function(_0xb57ed5){logger[_0xc369('0x24')](_0xb57ed5[_0xc369('0x25')]);if(_0xb57ed5[_0xc369('0x26')]){delete _0xb57ed5[_0xc369('0x26')];}_0xff4145['status'](_0x34a8bf)[_0xc369('0x27')](_0xb57ed5);};}exports[_0xc369('0x28')]=function(_0x5c321b,_0x4ec244){var _0xf2b38f={},_0x379dfe={},_0x39177d={'count':0x0,'rows':[]};var _0x12c3a7=_[_0xc369('0x29')](db[_0xc369('0x2a')][_0xc369('0x2b')],function(_0x3fe0c3){return{'name':_0x3fe0c3[_0xc369('0x2c')],'type':_0x3fe0c3[_0xc369('0x2d')][_0xc369('0x2e')]};});_0x379dfe[_0xc369('0x2f')]=_[_0xc369('0x29')](_0x12c3a7,_0xc369('0x26'));_0x379dfe[_0xc369('0x30')]=_[_0xc369('0x31')](_0x5c321b[_0xc369('0x30')]);_0x379dfe['filters']=_[_0xc369('0x32')](_0x379dfe[_0xc369('0x2f')],_0x379dfe[_0xc369('0x30')]);_0xf2b38f[_0xc369('0x33')]=_[_0xc369('0x32')](_0x379dfe[_0xc369('0x2f')],qs[_0xc369('0x34')](_0x5c321b[_0xc369('0x30')][_0xc369('0x34')]));_0xf2b38f['attributes']=_0xf2b38f[_0xc369('0x33')]['length']?_0xf2b38f['attributes']:_0x379dfe[_0xc369('0x2f')];if(!_0x5c321b[_0xc369('0x30')][_0xc369('0x35')](_0xc369('0x36'))){_0xf2b38f[_0xc369('0x1c')]=qs[_0xc369('0x1c')](_0x5c321b[_0xc369('0x30')]['limit']);_0xf2b38f[_0xc369('0x1a')]=qs[_0xc369('0x1a')](_0x5c321b['query'][_0xc369('0x1a')]);}_0xf2b38f[_0xc369('0x37')]=qs['sort'](_0x5c321b['query'][_0xc369('0x38')]);_0xf2b38f[_0xc369('0x39')]=qs[_0xc369('0x3a')](_[_0xc369('0x3b')](_0x5c321b[_0xc369('0x30')],_0x379dfe['filters']),_0x12c3a7);if(_0x5c321b[_0xc369('0x30')][_0xc369('0x3c')]){_0xf2b38f[_0xc369('0x39')]=_[_0xc369('0x3d')](_0xf2b38f[_0xc369('0x39')],{'$or':_[_0xc369('0x29')](_0x12c3a7,function(_0x1e5d41){if(_0x1e5d41['type']!==_0xc369('0x3e')){var _0x4e6f19={};_0x4e6f19[_0x1e5d41[_0xc369('0x26')]]={'$like':'%'+_0x5c321b[_0xc369('0x30')]['filter']+'%'};return _0x4e6f19;}})});}_0xf2b38f=_[_0xc369('0x3d')]({},_0xf2b38f,_0x5c321b['options']);var _0x1ead7a={'where':_0xf2b38f['where']};return db[_0xc369('0x2a')][_0xc369('0x1d')](_0x1ead7a)[_0xc369('0x22')](function(_0x105c89){_0x39177d['count']=_0x105c89;if(_0x5c321b['query']['includeAll']){_0xf2b38f[_0xc369('0x3f')]=[{'all':!![]}];}return db[_0xc369('0x2a')][_0xc369('0x40')](_0xf2b38f);})[_0xc369('0x22')](function(_0x1d3934){_0x39177d['rows']=_0x1d3934;return _0x39177d;})[_0xc369('0x22')](respondWithFilteredResult(_0x4ec244,_0xf2b38f))['catch'](handleError(_0x4ec244,null));};exports[_0xc369('0x41')]=function(_0x149b33,_0xaf41ef){var _0x486059={'raw':!![],'where':{'id':_0x149b33['params']['id']}},_0x5dfbf2={};_0x5dfbf2[_0xc369('0x2f')]=_[_0xc369('0x31')](db['SugarcrmField'][_0xc369('0x2b')]);_0x5dfbf2[_0xc369('0x30')]=_[_0xc369('0x31')](_0x149b33[_0xc369('0x30')]);_0x5dfbf2[_0xc369('0x3a')]=_[_0xc369('0x32')](_0x5dfbf2[_0xc369('0x2f')],_0x5dfbf2[_0xc369('0x30')]);_0x486059[_0xc369('0x33')]=_[_0xc369('0x32')](_0x5dfbf2[_0xc369('0x2f')],qs['fields'](_0x149b33[_0xc369('0x30')]['fields']));_0x486059['attributes']=_0x486059[_0xc369('0x33')][_0xc369('0x42')]?_0x486059[_0xc369('0x33')]:_0x5dfbf2[_0xc369('0x2f')];if(_0x149b33[_0xc369('0x30')][_0xc369('0x43')]){_0x486059[_0xc369('0x3f')]=[{'all':!![]}];}_0x486059=_[_0xc369('0x3d')]({},_0x486059,_0x149b33[_0xc369('0x44')]);return db[_0xc369('0x2a')][_0xc369('0x45')](_0x486059)[_0xc369('0x22')](handleEntityNotFound(_0xaf41ef,null))[_0xc369('0x22')](respondWithResult(_0xaf41ef,null))['catch'](handleError(_0xaf41ef,null));};exports[_0xc369('0x46')]=function(_0x388222,_0x136dc5){return db[_0xc369('0x2a')][_0xc369('0x46')](_0x388222[_0xc369('0x47')],{})[_0xc369('0x22')](respondWithResult(_0x136dc5,0xc9))['catch'](handleError(_0x136dc5,null));};exports['update']=function(_0xb37051,_0x20aaa2){if(_0xb37051[_0xc369('0x47')]['id']){delete _0xb37051[_0xc369('0x47')]['id'];}return db[_0xc369('0x2a')][_0xc369('0x45')]({'where':{'id':_0xb37051[_0xc369('0x48')]['id']}})[_0xc369('0x22')](handleEntityNotFound(_0x20aaa2,null))[_0xc369('0x22')](saveUpdates(_0xb37051[_0xc369('0x47')],null))[_0xc369('0x22')](respondWithResult(_0x20aaa2,null))[_0xc369('0x49')](handleError(_0x20aaa2,null));};exports['destroy']=function(_0x56d7e8,_0x46e205){return db[_0xc369('0x2a')]['find']({'where':{'id':_0x56d7e8[_0xc369('0x48')]['id']}})[_0xc369('0x22')](handleEntityNotFound(_0x46e205,null))[_0xc369('0x22')](removeEntity(_0x46e205,null))['catch'](handleError(_0x46e205,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8c36270..54bffe3 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 _0xad58=['FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','define','sugarcrm_unique_index','idField'];(function(_0x2679e4,_0x4f4383){var _0x1e59db=function(_0x7d0643){while(--_0x7d0643){_0x2679e4['push'](_0x2679e4['shift']());}};_0x1e59db(++_0x4f4383);}(_0xad58,0x90));var _0x8ad5=function(_0x27b42c,_0x1bbc67){_0x27b42c=_0x27b42c-0x0;var _0x2e931c=_0xad58[_0x27b42c];return _0x2e931c;};'use strict';var _=require(_0x8ad5('0x0'));var util=require(_0x8ad5('0x1'));var logger=require(_0x8ad5('0x2'))(_0x8ad5('0x3'));var moment=require('moment');var BPromise=require(_0x8ad5('0x4'));var rp=require(_0x8ad5('0x5'));var fs=require('fs');var path=require(_0x8ad5('0x6'));var rimraf=require(_0x8ad5('0x7'));var config=require('../../config/environment');var attributes=require(_0x8ad5('0x8'));module['exports']=function(_0x2ed6a1,_0x27ab0c){return _0x2ed6a1[_0x8ad5('0x9')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x8ad5('0xa'),'fields':[_0x8ad5('0xb'),_0x8ad5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33c0=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','api','bluebird','request-promise','path','../../config/environment','exports','define','SugarcrmField'];(function(_0x35d086,_0x385b52){var _0xae0642=function(_0x28f28b){while(--_0x28f28b){_0x35d086['push'](_0x35d086['shift']());}};_0xae0642(++_0x385b52);}(_0x33c0,0x86));var _0x033c=function(_0x9f7d39,_0x4ae560){_0x9f7d39=_0x9f7d39-0x0;var _0x5a2c19=_0x33c0[_0x9f7d39];return _0x5a2c19;};'use strict';var _=require(_0x033c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x033c('0x1'));var moment=require('moment');var BPromise=require(_0x033c('0x2'));var rp=require(_0x033c('0x3'));var fs=require('fs');var path=require(_0x033c('0x4'));var rimraf=require('rimraf');var config=require(_0x033c('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x033c('0x6')]=function(_0x15b478,_0x50d338){return _0x15b478[_0x033c('0x7')](_0x033c('0x8'),attributes,{'tableName':_0x033c('0x9'),'paranoid':![],'indexes':[{'name':_0x033c('0xa'),'fields':[_0x033c('0xb'),_0x033c('0xc')],'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 5aa5412..7eae76a 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 _0xfe84=['jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x58848e,_0x369460){var _0x4d04a5=function(_0x4adab9){while(--_0x4adab9){_0x58848e['push'](_0x58848e['shift']());}};_0x4d04a5(++_0x369460);}(_0xfe84,0xf9));var _0x4fe8=function(_0x4c0d2b,_0x2ff906){_0x4c0d2b=_0x4c0d2b-0x0;var _0x58c4fe=_0xfe84[_0x4c0d2b];return _0x58c4fe;};'use strict';var _=require(_0x4fe8('0x0'));var util=require(_0x4fe8('0x1'));var moment=require(_0x4fe8('0x2'));var BPromise=require(_0x4fe8('0x3'));var rs=require(_0x4fe8('0x4'));var fs=require('fs');var Redis=require(_0x4fe8('0x5'));var db=require(_0x4fe8('0x6'))['db'];var utils=require(_0x4fe8('0x7'));var logger=require(_0x4fe8('0x8'))(_0x4fe8('0x9'));var config=require(_0x4fe8('0xa'));var jayson=require(_0x4fe8('0xb'));var client=jayson[_0x4fe8('0xc')][_0x4fe8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x486715,_0x41095f,_0x287f6a){return new BPromise(function(_0xbb21ad,_0x24f8b1){return client[_0x4fe8('0xe')](_0x486715,_0x287f6a)[_0x4fe8('0xf')](function(_0x1a1e50){logger[_0x4fe8('0x10')](_0x4fe8('0x11'),_0x41095f,'request\x20sent');logger[_0x4fe8('0x12')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x41095f,_0x4fe8('0x13'),JSON[_0x4fe8('0x14')](_0x1a1e50));if(_0x1a1e50['error']){if(_0x1a1e50[_0x4fe8('0x15')][_0x4fe8('0x16')]===0x1f4){logger[_0x4fe8('0x15')](_0x4fe8('0x11'),_0x41095f,_0x1a1e50['error'][_0x4fe8('0x17')]);return _0x24f8b1(_0x1a1e50[_0x4fe8('0x15')][_0x4fe8('0x17')]);}logger[_0x4fe8('0x15')](_0x4fe8('0x11'),_0x41095f,_0x1a1e50[_0x4fe8('0x15')][_0x4fe8('0x17')]);return _0xbb21ad(_0x1a1e50[_0x4fe8('0x15')][_0x4fe8('0x17')]);}else{logger[_0x4fe8('0x10')](_0x4fe8('0x11'),_0x41095f,_0x4fe8('0x13'));_0xbb21ad(_0x1a1e50[_0x4fe8('0x18')][_0x4fe8('0x17')]);}})[_0x4fe8('0x19')](function(_0xf939d5){logger[_0x4fe8('0x15')](_0x4fe8('0x11'),_0x41095f,_0xf939d5);_0x24f8b1(_0xf939d5);});});} \ No newline at end of file +var _0x9f06=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','message','SugarcrmField,\x20%s,\x20%s','info','result','lodash','util'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9f06,0x1e2));var _0x69f0=function(_0x30d5a8,_0x25d8ab){_0x30d5a8=_0x30d5a8-0x0;var _0x3c33d5=_0x9f06[_0x30d5a8];return _0x3c33d5;};'use strict';var _=require(_0x69f0('0x0'));var util=require(_0x69f0('0x1'));var moment=require('moment');var BPromise=require(_0x69f0('0x2'));var rs=require(_0x69f0('0x3'));var fs=require('fs');var Redis=require(_0x69f0('0x4'));var db=require(_0x69f0('0x5'))['db'];var utils=require(_0x69f0('0x6'));var logger=require('../../config/logger')(_0x69f0('0x7'));var config=require(_0x69f0('0x8'));var jayson=require(_0x69f0('0x9'));var client=jayson[_0x69f0('0xa')][_0x69f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ca22f,_0x21ff75,_0x598e8b){return new BPromise(function(_0x4c8922,_0x4eb19f){return client[_0x69f0('0xc')](_0x2ca22f,_0x598e8b)[_0x69f0('0xd')](function(_0x3577e4){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x21ff75,_0x69f0('0xe'));logger[_0x69f0('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x21ff75,'request\x20sent',JSON['stringify'](_0x3577e4));if(_0x3577e4[_0x69f0('0x10')]){if(_0x3577e4[_0x69f0('0x10')][_0x69f0('0x11')]===0x1f4){logger[_0x69f0('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x21ff75,_0x3577e4['error'][_0x69f0('0x12')]);return _0x4eb19f(_0x3577e4[_0x69f0('0x10')][_0x69f0('0x12')]);}logger['error'](_0x69f0('0x13'),_0x21ff75,_0x3577e4[_0x69f0('0x10')][_0x69f0('0x12')]);return _0x4c8922(_0x3577e4['error'][_0x69f0('0x12')]);}else{logger[_0x69f0('0x14')](_0x69f0('0x13'),_0x21ff75,_0x69f0('0xe'));_0x4c8922(_0x3577e4[_0x69f0('0x15')][_0x69f0('0x12')]);}})['catch'](function(_0x5223e9){logger[_0x69f0('0x10')](_0x69f0('0x13'),_0x21ff75,_0x5223e9);_0x4eb19f(_0x5223e9);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 29f1b1f..fb341dc 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 _0x383a=['get','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','/:id','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x34e1ba,_0x327502){var _0x5302b9=function(_0x305c1b){while(--_0x305c1b){_0x34e1ba['push'](_0x34e1ba['shift']());}};_0x5302b9(++_0x327502);}(_0x383a,0x1ad));var _0xa383=function(_0x1f1f3b,_0x227aa9){_0x1f1f3b=_0x1f1f3b-0x0;var _0x2e63aa=_0x383a[_0x1f1f3b];return _0x2e63aa;};'use strict';var multer=require('multer');var util=require(_0xa383('0x0'));var path=require(_0xa383('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa383('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa383('0x3'));var interaction=require(_0xa383('0x4'));var config=require(_0xa383('0x5'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0xa383('0x6')](),controller[_0xa383('0x7')]);router[_0xa383('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xa383('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xa383('0x8')](_0xa383('0xa'),auth['isAuthenticated'](),controller[_0xa383('0xb')]);router[_0xa383('0xc')]('/',auth[_0xa383('0x6')](),controller['create']);router[_0xa383('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa383('0xd')]);router[_0xa383('0xe')](_0xa383('0xf'),auth[_0xa383('0x6')](),controller['update']);router[_0xa383('0x10')](_0xa383('0xf'),auth[_0xa383('0x6')](),controller[_0xa383('0x11')]);module[_0xa383('0x12')]=router; \ No newline at end of file +var _0x5dea=['create','put','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post'];(function(_0x364439,_0x212e33){var _0x3c09c0=function(_0x184bf3){while(--_0x184bf3){_0x364439['push'](_0x364439['shift']());}};_0x3c09c0(++_0x212e33);}(_0x5dea,0x1bc));var _0xa5de=function(_0x5a3ef6,_0x5508ed){_0x5a3ef6=_0x5a3ef6-0x0;var _0x34da2b=_0x5dea[_0x5a3ef6];return _0x34da2b;};'use strict';var multer=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var path=require(_0xa5de('0x2'));var timeout=require(_0xa5de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa5de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5de('0x5'));var config=require(_0xa5de('0x6'));var controller=require(_0xa5de('0x7'));router[_0xa5de('0x8')]('/',auth['isAuthenticated'](),controller[_0xa5de('0x9')]);router['get'](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller['show']);router[_0xa5de('0x8')](_0xa5de('0xc'),auth[_0xa5de('0xb')](),controller[_0xa5de('0xd')]);router[_0xa5de('0x8')]('/:id/fields',auth[_0xa5de('0xb')](),controller[_0xa5de('0xe')]);router[_0xa5de('0xf')]('/',auth[_0xa5de('0xb')](),controller[_0xa5de('0x10')]);router['post'](_0xa5de('0xc'),auth[_0xa5de('0xb')](),controller['addConfiguration']);router[_0xa5de('0x11')](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller[_0xa5de('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa5de('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 44c0a50..f5290f8 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 _0x397a=['sequelize','STRING','HelpDesk'];(function(_0x374d6b,_0x1a85af){var _0x655b09=function(_0x834bb4){while(--_0x834bb4){_0x374d6b['push'](_0x374d6b['shift']());}};_0x655b09(++_0x1a85af);}(_0x397a,0xae));var _0xa397=function(_0x24ccda,_0x1c3018){_0x24ccda=_0x24ccda-0x0;var _0x383213=_0x397a[_0x24ccda];return _0x383213;};'use strict';var Sequelize=require(_0xa397('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa397('0x1')]},'username':{'type':Sequelize[_0xa397('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa397('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa397('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa397('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x27aa=['HelpDesk','sequelize','STRING'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x27aa,0x109));var _0xa27a=function(_0x167b84,_0x3233e2){_0x167b84=_0x167b84-0x0;var _0x30d147=_0x27aa[_0x167b84];return _0x30d147;};'use strict';var Sequelize=require(_0xa27a('0x0'));module['exports']={'name':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa27a('0x1')]},'username':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![],'defaultValue':_0xa27a('0x2')},'remoteUri':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa27a('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa27a('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 3d59c9d..6b0ceb5 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 _0xd48f=['apply','save','update','destroy','name','send','index','map','VtigerAccount','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','VtigerConfiguration','VtigerField','md5','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','result','describe','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','log','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json'];(function(_0x6061e3,_0x146d7d){var _0x310d99=function(_0x4d03e5){while(--_0x4d03e5){_0x6061e3['push'](_0x6061e3['shift']());}};_0x310d99(++_0x146d7d);}(_0xd48f,0x1c1));var _0xfd48=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xd48f[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0xfd48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd48('0x1'));var jsonpatch=require(_0xfd48('0x2'));var rp=require(_0xfd48('0x3'));var moment=require(_0xfd48('0x4'));var BPromise=require(_0xfd48('0x5'));var Mustache=require(_0xfd48('0x6'));var util=require(_0xfd48('0x7'));var path=require(_0xfd48('0x8'));var sox=require(_0xfd48('0x9'));var csv=require(_0xfd48('0xa'));var ejs=require(_0xfd48('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd48('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfd48('0xd'));var deskjs=require(_0xfd48('0xe'));var toCsv=require(_0xfd48('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfd48('0xf'));var qs=require(_0xfd48('0x10'));var as=require(_0xfd48('0x11'));var hardwareService=require(_0xfd48('0x12'));var logger=require(_0xfd48('0x13'))('api');var utils=require(_0xfd48('0x14'));var config=require(_0xfd48('0x15'));var licenseUtil=require(_0xfd48('0x16'));var db=require(_0xfd48('0x17'))['db'];var integrations=require(_0xfd48('0x18'));function respondWithStatusCode(_0x3508f2,_0x40f705){_0x40f705=_0x40f705||0xcc;return function(_0x5685f2){if(_0x5685f2){return _0x3508f2[_0xfd48('0x19')](_0x40f705);}return _0x3508f2[_0xfd48('0x1a')](_0x40f705)[_0xfd48('0x1b')]();};}function respondWithResult(_0x4a66ce,_0x2bd0cf){_0x2bd0cf=_0x2bd0cf||0xc8;return function(_0x4d9b78){if(_0x4d9b78){return _0x4a66ce[_0xfd48('0x1a')](_0x2bd0cf)['json'](_0x4d9b78);}};}function respondWithFilteredResult(_0x180448,_0x20a1d1){return function(_0x4fd739){if(_0x4fd739){var _0x58f8e2=typeof _0x20a1d1[_0xfd48('0x1c')]===_0xfd48('0x1d')&&typeof _0x20a1d1['limit']===_0xfd48('0x1d');var _0x59dc93=_0x4fd739[_0xfd48('0x1e')];var _0x3a6c77=_0x58f8e2?0x0:_0x20a1d1[_0xfd48('0x1c')];var _0x56d830=_0x58f8e2?_0x4fd739[_0xfd48('0x1e')]:_0x20a1d1[_0xfd48('0x1c')]+_0x20a1d1[_0xfd48('0x1f')];var _0x53df60;if(_0x56d830>=_0x59dc93){_0x56d830=_0x59dc93;_0x53df60=0xc8;}else{_0x53df60=0xce;}_0x180448[_0xfd48('0x1a')](_0x53df60);return _0x180448[_0xfd48('0x20')](_0xfd48('0x21'),_0x3a6c77+'-'+_0x56d830+'/'+_0x59dc93)[_0xfd48('0x22')](_0x4fd739);}return null;};}function patchUpdates(_0xaecba5){return function(_0x47d0f5){try{jsonpatch[_0xfd48('0x23')](_0x47d0f5,_0xaecba5,!![]);}catch(_0x5ac2c2){return BPromise['reject'](_0x5ac2c2);}return _0x47d0f5[_0xfd48('0x24')]();};}function saveUpdates(_0x605861,_0x45bba9){return function(_0x239c75){if(_0x239c75){return _0x239c75[_0xfd48('0x25')](_0x605861)['then'](function(_0x29e376){return _0x29e376;});}return null;};}function removeEntity(_0x2f33c5,_0x4207c5){return function(_0x3e7544){if(_0x3e7544){return _0x3e7544[_0xfd48('0x26')]()['then'](function(){_0x2f33c5[_0xfd48('0x1a')](0xcc)[_0xfd48('0x1b')]();});}};}function handleEntityNotFound(_0x597f23,_0x43caae){return function(_0x1e91c9){if(!_0x1e91c9){_0x597f23[_0xfd48('0x19')](0x194);}return _0x1e91c9;};}function handleError(_0x3198d9,_0x5e83c2){_0x5e83c2=_0x5e83c2||0x1f4;return function(_0x2b54b8){logger['error'](_0x2b54b8['stack']);if(_0x2b54b8[_0xfd48('0x27')]){delete _0x2b54b8[_0xfd48('0x27')];}_0x3198d9[_0xfd48('0x1a')](_0x5e83c2)[_0xfd48('0x28')](_0x2b54b8);};}exports[_0xfd48('0x29')]=function(_0x3bd8f1,_0x23ee9a){var _0x1903e9={},_0x3c089f={},_0x1c96f1={'count':0x0,'rows':[]};var _0xb357ce=_[_0xfd48('0x2a')](db[_0xfd48('0x2b')]['rawAttributes'],function(_0x33ce8b){return{'name':_0x33ce8b[_0xfd48('0x2c')],'type':_0x33ce8b['type']['key']};});_0x3c089f[_0xfd48('0x2d')]=_[_0xfd48('0x2a')](_0xb357ce,_0xfd48('0x27'));_0x3c089f['query']=_[_0xfd48('0x2e')](_0x3bd8f1[_0xfd48('0x2f')]);_0x3c089f[_0xfd48('0x30')]=_['intersection'](_0x3c089f[_0xfd48('0x2d')],_0x3c089f[_0xfd48('0x2f')]);_0x1903e9['attributes']=_[_0xfd48('0x31')](_0x3c089f['model'],qs[_0xfd48('0x32')](_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x32')]));_0x1903e9[_0xfd48('0x33')]=_0x1903e9[_0xfd48('0x33')][_0xfd48('0x34')]?_0x1903e9['attributes']:_0x3c089f[_0xfd48('0x2d')];if(!_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x35')](_0xfd48('0x36'))){_0x1903e9['limit']=qs[_0xfd48('0x1f')](_0x3bd8f1['query']['limit']);_0x1903e9[_0xfd48('0x1c')]=qs[_0xfd48('0x1c')](_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x1c')]);}_0x1903e9['order']=qs[_0xfd48('0x37')](_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x37')]);_0x1903e9[_0xfd48('0x38')]=qs[_0xfd48('0x30')](_[_0xfd48('0x39')](_0x3bd8f1[_0xfd48('0x2f')],_0x3c089f[_0xfd48('0x30')]),_0xb357ce);if(_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x3a')]){_0x1903e9[_0xfd48('0x38')]=_[_0xfd48('0x3b')](_0x1903e9[_0xfd48('0x38')],{'$or':_[_0xfd48('0x2a')](_0xb357ce,function(_0x22bcee){if(_0x22bcee[_0xfd48('0x3c')]!==_0xfd48('0x3d')){var _0x3733f1={};_0x3733f1[_0x22bcee[_0xfd48('0x27')]]={'$like':'%'+_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x3a')]+'%'};return _0x3733f1;}})});}_0x1903e9=_[_0xfd48('0x3b')]({},_0x1903e9,_0x3bd8f1[_0xfd48('0x3e')]);var _0x267948={'where':_0x1903e9[_0xfd48('0x38')]};return db[_0xfd48('0x2b')]['count'](_0x267948)[_0xfd48('0x3f')](function(_0x28a598){_0x1c96f1[_0xfd48('0x1e')]=_0x28a598;if(_0x3bd8f1[_0xfd48('0x2f')][_0xfd48('0x40')]){_0x1903e9[_0xfd48('0x41')]=[{'all':!![]}];}return db[_0xfd48('0x2b')][_0xfd48('0x42')](_0x1903e9);})['then'](function(_0x135583){_0x1c96f1[_0xfd48('0x43')]=_0x135583;return _0x1c96f1;})[_0xfd48('0x3f')](respondWithFilteredResult(_0x23ee9a,_0x1903e9))[_0xfd48('0x44')](handleError(_0x23ee9a,null));};exports[_0xfd48('0x45')]=function(_0x11d230,_0xc1d78e){var _0x21325e={'raw':![],'where':{'id':_0x11d230[_0xfd48('0x46')]['id']}},_0x1aaec6={};_0x1aaec6[_0xfd48('0x2d')]=_[_0xfd48('0x2e')](db[_0xfd48('0x2b')]['rawAttributes']);_0x1aaec6['query']=_[_0xfd48('0x2e')](_0x11d230[_0xfd48('0x2f')]);_0x1aaec6['filters']=_[_0xfd48('0x31')](_0x1aaec6[_0xfd48('0x2d')],_0x1aaec6[_0xfd48('0x2f')]);_0x21325e[_0xfd48('0x33')]=_['intersection'](_0x1aaec6[_0xfd48('0x2d')],qs[_0xfd48('0x32')](_0x11d230[_0xfd48('0x2f')][_0xfd48('0x32')]));_0x21325e[_0xfd48('0x33')]=_0x21325e['attributes']['length']?_0x21325e['attributes']:_0x1aaec6[_0xfd48('0x2d')];if(_0x11d230['query'][_0xfd48('0x40')]){_0x21325e[_0xfd48('0x41')]=[{'all':!![]}];}_0x21325e=_[_0xfd48('0x3b')]({},_0x21325e,_0x11d230['options']);return db[_0xfd48('0x2b')][_0xfd48('0x47')](_0x21325e)['then'](handleEntityNotFound(_0xc1d78e,null))[_0xfd48('0x3f')](respondWithResult(_0xc1d78e,null))[_0xfd48('0x44')](handleError(_0xc1d78e,null));};exports[_0xfd48('0x48')]=function(_0x50ba5e,_0x322e23){return db['VtigerAccount'][_0xfd48('0x48')](_0x50ba5e[_0xfd48('0x49')],{})[_0xfd48('0x3f')](respondWithResult(_0x322e23,0xc9))[_0xfd48('0x44')](handleError(_0x322e23,null));};exports[_0xfd48('0x25')]=function(_0x3e3350,_0x2fdb4e){if(_0x3e3350[_0xfd48('0x49')]['id']){delete _0x3e3350[_0xfd48('0x49')]['id'];}return db[_0xfd48('0x2b')][_0xfd48('0x47')]({'where':{'id':_0x3e3350[_0xfd48('0x46')]['id']}})[_0xfd48('0x3f')](handleEntityNotFound(_0x2fdb4e,null))[_0xfd48('0x3f')](saveUpdates(_0x3e3350[_0xfd48('0x49')],null))[_0xfd48('0x3f')](respondWithResult(_0x2fdb4e,null))[_0xfd48('0x44')](handleError(_0x2fdb4e,null));};exports['destroy']=function(_0x4c9a74,_0xf75ca){return db[_0xfd48('0x2b')][_0xfd48('0x47')]({'where':{'id':_0x4c9a74[_0xfd48('0x46')]['id']}})[_0xfd48('0x3f')](handleEntityNotFound(_0xf75ca,null))[_0xfd48('0x3f')](removeEntity(_0xf75ca,null))[_0xfd48('0x44')](handleError(_0xf75ca,null));};exports[_0xfd48('0x4a')]=function(_0x1352b7,_0x2490e7,_0x59e0ab){var _0x360c0f={};var _0x329a65={};var _0x5e8db6;var _0x15de81;return db[_0xfd48('0x2b')][_0xfd48('0x4b')]({'where':{'id':_0x1352b7[_0xfd48('0x46')]['id']}})[_0xfd48('0x3f')](handleEntityNotFound(_0x2490e7,null))['then'](function(_0x237f08){if(_0x237f08){_0x5e8db6=_0x237f08;_0x329a65[_0xfd48('0x2d')]=_[_0xfd48('0x2e')](db['VtigerConfiguration']['rawAttributes']);_0x329a65['query']=_[_0xfd48('0x2e')](_0x1352b7['query']);_0x329a65[_0xfd48('0x30')]=_['intersection'](_0x329a65['model'],_0x329a65[_0xfd48('0x2f')]);_0x360c0f[_0xfd48('0x33')]=_[_0xfd48('0x31')](_0x329a65[_0xfd48('0x2d')],qs[_0xfd48('0x32')](_0x1352b7[_0xfd48('0x2f')]['fields']));_0x360c0f[_0xfd48('0x33')]=_0x360c0f[_0xfd48('0x33')][_0xfd48('0x34')]?_0x360c0f[_0xfd48('0x33')]:_0x329a65[_0xfd48('0x2d')];_0x360c0f[_0xfd48('0x4c')]=qs['sort'](_0x1352b7[_0xfd48('0x2f')][_0xfd48('0x37')]);_0x360c0f['where']=qs[_0xfd48('0x30')](_[_0xfd48('0x39')](_0x1352b7[_0xfd48('0x2f')],_0x329a65['filters']));if(_0x1352b7[_0xfd48('0x2f')][_0xfd48('0x3a')]){_0x360c0f['where']=_[_0xfd48('0x3b')](_0x360c0f[_0xfd48('0x38')],{'$or':_[_0xfd48('0x2a')](_0x360c0f[_0xfd48('0x33')],function(_0x2eccc7){var _0x36eab5={};_0x36eab5[_0x2eccc7]={'$like':'%'+_0x1352b7[_0xfd48('0x2f')][_0xfd48('0x3a')]+'%'};return _0x36eab5;})});}_0x360c0f=_[_0xfd48('0x3b')]({},_0x360c0f,_0x1352b7[_0xfd48('0x3e')]);return _0x5e8db6[_0xfd48('0x4a')](_0x360c0f);}})[_0xfd48('0x3f')](function(_0x4f7c8c){if(_0x4f7c8c){_0x15de81=_0x4f7c8c[_0xfd48('0x34')];if(!_0x1352b7['query'][_0xfd48('0x35')]('nolimit')){_0x360c0f[_0xfd48('0x1f')]=qs['limit'](_0x1352b7[_0xfd48('0x2f')][_0xfd48('0x1f')]);_0x360c0f['offset']=qs[_0xfd48('0x1c')](_0x1352b7[_0xfd48('0x2f')]['offset']);}return _0x5e8db6[_0xfd48('0x4a')](_0x360c0f);}})['then'](function(_0x404309){if(_0x404309){return _0x404309?{'count':_0x15de81,'rows':_0x404309}:null;}})[_0xfd48('0x3f')](respondWithResult(_0x2490e7,null))['catch'](handleError(_0x2490e7,null));};exports[_0xfd48('0x4d')]=function(_0x573c8d,_0x42ceab,_0x15e775){if(_0x573c8d['body']['id']){delete _0x573c8d[_0xfd48('0x49')]['id'];}return db[_0xfd48('0x2b')]['findOne']({'where':{'id':_0x573c8d[_0xfd48('0x46')]['id']}})[_0xfd48('0x3f')](handleEntityNotFound(_0x42ceab,null))[_0xfd48('0x3f')](function(_0x837290){if(_0x837290){_0x573c8d[_0xfd48('0x49')][_0xfd48('0x4e')]=_0x837290['id'];_0x573c8d[_0xfd48('0x49')][_0xfd48('0x4f')]=integrations['getSubjects'](_0x573c8d[_0xfd48('0x49')]['channel'],_0x573c8d[_0xfd48('0x49')][_0xfd48('0x3c')]);_0x573c8d['body'][_0xfd48('0x50')]=integrations[_0xfd48('0x51')](_0x573c8d[_0xfd48('0x49')][_0xfd48('0x52')],_0x573c8d[_0xfd48('0x49')][_0xfd48('0x3c')]);return db[_0xfd48('0x53')]['create'](_0x573c8d[_0xfd48('0x49')],{'include':[{'model':db['VtigerField'],'as':_0xfd48('0x4f')},{'model':db[_0xfd48('0x54')],'as':_0xfd48('0x50')}]});}return null;})[_0xfd48('0x3f')](respondWithResult(_0x42ceab,null))[_0xfd48('0x44')](handleError(_0x42ceab,null));};var md5=require(_0xfd48('0x55'));exports[_0xfd48('0x56')]=function(_0xf8423,_0x4612a8,_0x41077d){var _0x26a495=null;var _0x2c3f18=null;var _0x58438f=null;var _0x279678=null;var _0x42e09b='';return db[_0xfd48('0x2b')]['findOne']({'where':{'id':_0xf8423['params']['id']},'attributes':['id','name','username',_0xfd48('0x57'),_0xfd48('0x58'),_0xfd48('0x59'),_0xfd48('0x5a'),_0xfd48('0x5b')]})[_0xfd48('0x3f')](handleEntityNotFound(_0x4612a8,null))[_0xfd48('0x3f')](function(_0x102043){if(_0x102043){_0x26a495=_0x102043[_0xfd48('0x5c')];_0x2c3f18=_0x102043[_0xfd48('0x5b')];_0x58438f=_0x102043[_0xfd48('0x58')];_0x42e09b=_0x102043['remoteUri'];var _0x3516b4=_0x42e09b[_0xfd48('0x5d')](-0x1);if(_0x3516b4==='/'){_0x42e09b=_0x42e09b[_0xfd48('0x5e')](0x0,_0x42e09b[_0xfd48('0x5f')](_0x3516b4));}_0x279678=util[_0xfd48('0x60')]('%s/webservice.php',_0x42e09b);var _0x292fc0={'method':_0xfd48('0x61'),'uri':_0x279678,'qs':{'operation':_0xfd48('0x62'),'username':_0x102043[_0xfd48('0x5c')]},'json':!![]};return rp(_0x292fc0);}})['then'](function(_0x21fe5e){if(_0x21fe5e[_0xfd48('0x63')]){var _0x5d628d={'method':_0xfd48('0x64'),'uri':_0x279678,'form':{'operation':_0xfd48('0x65'),'username':_0x26a495,'accessKey':md5(_0x21fe5e[_0xfd48('0x66')]['token']+_0x2c3f18)},'json':!![]};return rp(_0x5d628d);}})['then'](function(_0x40581a){if(_0x40581a[_0xfd48('0x63')]){var _0x1f7480={'method':_0xfd48('0x61'),'uri':_0x279678,'qs':{'operation':_0xfd48('0x67'),'username':_0x26a495,'sessionName':_0x40581a['result'][_0xfd48('0x68')],'elementType':_0x58438f},'json':!![]};return rp(_0x1f7480);}})[_0xfd48('0x3f')](function(_0xa277b2){if(_0xa277b2[_0xfd48('0x63')]){var _0x1561f9=['autogenerated',_0xfd48('0x69'),_0xfd48('0x6a')];_[_0xfd48('0x6b')](_0xa277b2[_0xfd48('0x66')][_0xfd48('0x32')],function(_0xcb5886){return _0x1561f9[_0xfd48('0x6c')](_0xcb5886[_0xfd48('0x3c')]['name']);});_['remove'](_0xa277b2['result'][_0xfd48('0x32')],function(_0x4c95ec){return _0x4c95ec[_0xfd48('0x6d')]===_0xfd48('0x6e');});return{'count':_0xa277b2[_0xfd48('0x66')][_0xfd48('0x32')][_0xfd48('0x34')],'rows':_[_0xfd48('0x2a')](_0xa277b2[_0xfd48('0x66')]['fields'],function(_0x3a9334){return{'id':_0x3a9334['name'],'name':_0x3a9334[_0xfd48('0x6f')],'custom':_[_0xfd48('0x70')](_0x3a9334[_0xfd48('0x27')],_0xfd48('0x71'))?!![]:![],'options':_0x3a9334['type']['name']==='picklist'&&_0x3a9334['type'][_0xfd48('0x72')][_0xfd48('0x34')]>0x0?_[_0xfd48('0x2a')](_0x3a9334['type'][_0xfd48('0x72')],function(_0x3cf86d){return{'name':_0x3cf86d[_0xfd48('0x6f')],'value':_0x3cf86d[_0xfd48('0x73')]};}):[]};})};}})['then'](respondWithResult(_0x4612a8,null))[_0xfd48('0x44')](function(_0x500675){console[_0xfd48('0x74')]('vTiger\x20error:\x20'+_0x500675);var _0x45f135=_0xf8423['query'][_0xfd48('0x75')]?0x1f4:_0x500675['statusCode']||0x1f4;logger[_0xfd48('0x76')](_0xfd48('0x77'),_0xfd48('0x56'),_0x45f135,JSON[_0xfd48('0x78')](_0x500675));delete _0x500675['name'];if(_0x45f135===0x191){_0x45f135=0x190;}_0x4612a8['status'](_0x45f135)['send'](_0xf8423[_0xfd48('0x2f')][_0xfd48('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x500675['statusCode']}:_0x500675);});}; \ No newline at end of file +var _0x6444=['rows','show','intersection','includeAll','merge','catch','create','body','find','params','getConfigurations','VtigerConfiguration','rawAttributes','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','undefined','limit','count','offset','status','Content-Range','json','reject','save','update','destroy','then','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','options','VtigerAccount','include','findAll'];(function(_0x1dcdca,_0x3544cf){var _0x27ec22=function(_0x4089e6){while(--_0x4089e6){_0x1dcdca['push'](_0x1dcdca['shift']());}};_0x27ec22(++_0x3544cf);}(_0x6444,0x1af));var _0x4644=function(_0x52ec0e,_0x10a03c){_0x52ec0e=_0x52ec0e-0x0;var _0x2d649c=_0x6444[_0x52ec0e];return _0x2d649c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4644('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4644('0x1'));var rp=require(_0x4644('0x2'));var moment=require('moment');var BPromise=require(_0x4644('0x3'));var Mustache=require(_0x4644('0x4'));var util=require(_0x4644('0x5'));var path=require('path');var sox=require(_0x4644('0x6'));var csv=require(_0x4644('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4644('0x8'));var _=require(_0x4644('0x9'));var squel=require(_0x4644('0xa'));var crypto=require(_0x4644('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4644('0xc'));var toCsv=require(_0x4644('0x7'));var querystring=require(_0x4644('0xd'));var Papa=require(_0x4644('0xe'));var Redis=require(_0x4644('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4644('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4644('0x11'));var logger=require(_0x4644('0x12'))(_0x4644('0x13'));var utils=require(_0x4644('0x14'));var config=require(_0x4644('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4644('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x35d351,_0x2b0716){_0x2b0716=_0x2b0716||0xcc;return function(_0x65a0fe){if(_0x65a0fe){return _0x35d351[_0x4644('0x17')](_0x2b0716);}return _0x35d351['status'](_0x2b0716)['end']();};}function respondWithResult(_0x28e82b,_0x591dda){_0x591dda=_0x591dda||0xc8;return function(_0x266d1f){if(_0x266d1f){return _0x28e82b['status'](_0x591dda)['json'](_0x266d1f);}};}function respondWithFilteredResult(_0x52933b,_0x28fa03){return function(_0x5339f9){if(_0x5339f9){var _0x3b4688=typeof _0x28fa03['offset']===_0x4644('0x18')&&typeof _0x28fa03[_0x4644('0x19')]===_0x4644('0x18');var _0x243efc=_0x5339f9[_0x4644('0x1a')];var _0x1f0b18=_0x3b4688?0x0:_0x28fa03[_0x4644('0x1b')];var _0x34318b=_0x3b4688?_0x5339f9[_0x4644('0x1a')]:_0x28fa03[_0x4644('0x1b')]+_0x28fa03[_0x4644('0x19')];var _0x510cda;if(_0x34318b>=_0x243efc){_0x34318b=_0x243efc;_0x510cda=0xc8;}else{_0x510cda=0xce;}_0x52933b[_0x4644('0x1c')](_0x510cda);return _0x52933b['set'](_0x4644('0x1d'),_0x1f0b18+'-'+_0x34318b+'/'+_0x243efc)[_0x4644('0x1e')](_0x5339f9);}return null;};}function patchUpdates(_0x28ab10){return function(_0x1915c4){try{jsonpatch['apply'](_0x1915c4,_0x28ab10,!![]);}catch(_0x389ea9){return BPromise[_0x4644('0x1f')](_0x389ea9);}return _0x1915c4[_0x4644('0x20')]();};}function saveUpdates(_0x44b82b,_0x376856){return function(_0x369f93){if(_0x369f93){return _0x369f93[_0x4644('0x21')](_0x44b82b)['then'](function(_0x560b81){return _0x560b81;});}return null;};}function removeEntity(_0x41d574,_0x36a253){return function(_0x422b5a){if(_0x422b5a){return _0x422b5a[_0x4644('0x22')]()[_0x4644('0x23')](function(){_0x41d574[_0x4644('0x1c')](0xcc)[_0x4644('0x24')]();});}};}function handleEntityNotFound(_0x15cae7,_0x489abe){return function(_0x26940f){if(!_0x26940f){_0x15cae7[_0x4644('0x17')](0x194);}return _0x26940f;};}function handleError(_0x44a0fe,_0x5ab938){_0x5ab938=_0x5ab938||0x1f4;return function(_0x4fd7c3){logger['error'](_0x4fd7c3[_0x4644('0x25')]);if(_0x4fd7c3[_0x4644('0x26')]){delete _0x4fd7c3['name'];}_0x44a0fe[_0x4644('0x1c')](_0x5ab938)[_0x4644('0x27')](_0x4fd7c3);};}exports[_0x4644('0x28')]=function(_0x297dfc,_0x2fd086){var _0x221dc2={},_0x1558cb={},_0x33eb52={'count':0x0,'rows':[]};var _0x23fc1a=_[_0x4644('0x29')](db['VtigerAccount']['rawAttributes'],function(_0x1a10fa){return{'name':_0x1a10fa[_0x4644('0x2a')],'type':_0x1a10fa[_0x4644('0x2b')][_0x4644('0x2c')]};});_0x1558cb[_0x4644('0x2d')]=_[_0x4644('0x29')](_0x23fc1a,_0x4644('0x26'));_0x1558cb[_0x4644('0x2e')]=_[_0x4644('0x2f')](_0x297dfc[_0x4644('0x2e')]);_0x1558cb[_0x4644('0x30')]=_['intersection'](_0x1558cb[_0x4644('0x2d')],_0x1558cb[_0x4644('0x2e')]);_0x221dc2['attributes']=_['intersection'](_0x1558cb[_0x4644('0x2d')],qs['fields'](_0x297dfc[_0x4644('0x2e')][_0x4644('0x31')]));_0x221dc2[_0x4644('0x32')]=_0x221dc2[_0x4644('0x32')][_0x4644('0x33')]?_0x221dc2[_0x4644('0x32')]:_0x1558cb[_0x4644('0x2d')];if(!_0x297dfc[_0x4644('0x2e')][_0x4644('0x34')]('nolimit')){_0x221dc2[_0x4644('0x19')]=qs[_0x4644('0x19')](_0x297dfc[_0x4644('0x2e')][_0x4644('0x19')]);_0x221dc2[_0x4644('0x1b')]=qs[_0x4644('0x1b')](_0x297dfc[_0x4644('0x2e')][_0x4644('0x1b')]);}_0x221dc2['order']=qs['sort'](_0x297dfc[_0x4644('0x2e')][_0x4644('0x35')]);_0x221dc2['where']=qs[_0x4644('0x30')](_[_0x4644('0x36')](_0x297dfc['query'],_0x1558cb['filters']),_0x23fc1a);if(_0x297dfc['query'][_0x4644('0x37')]){_0x221dc2[_0x4644('0x38')]=_['merge'](_0x221dc2[_0x4644('0x38')],{'$or':_[_0x4644('0x29')](_0x23fc1a,function(_0x291db8){if(_0x291db8['type']!=='VIRTUAL'){var _0x22a35a={};_0x22a35a[_0x291db8[_0x4644('0x26')]]={'$like':'%'+_0x297dfc[_0x4644('0x2e')][_0x4644('0x37')]+'%'};return _0x22a35a;}})});}_0x221dc2=_['merge']({},_0x221dc2,_0x297dfc[_0x4644('0x39')]);var _0x120ff5={'where':_0x221dc2['where']};return db[_0x4644('0x3a')][_0x4644('0x1a')](_0x120ff5)[_0x4644('0x23')](function(_0xfa6aa1){_0x33eb52[_0x4644('0x1a')]=_0xfa6aa1;if(_0x297dfc[_0x4644('0x2e')]['includeAll']){_0x221dc2[_0x4644('0x3b')]=[{'all':!![]}];}return db[_0x4644('0x3a')][_0x4644('0x3c')](_0x221dc2);})[_0x4644('0x23')](function(_0x178482){_0x33eb52[_0x4644('0x3d')]=_0x178482;return _0x33eb52;})[_0x4644('0x23')](respondWithFilteredResult(_0x2fd086,_0x221dc2))['catch'](handleError(_0x2fd086,null));};exports[_0x4644('0x3e')]=function(_0x45c2b3,_0xe7f70d){var _0x2e3470={'raw':![],'where':{'id':_0x45c2b3['params']['id']}},_0x3dfab5={};_0x3dfab5[_0x4644('0x2d')]=_[_0x4644('0x2f')](db[_0x4644('0x3a')]['rawAttributes']);_0x3dfab5[_0x4644('0x2e')]=_[_0x4644('0x2f')](_0x45c2b3[_0x4644('0x2e')]);_0x3dfab5['filters']=_[_0x4644('0x3f')](_0x3dfab5[_0x4644('0x2d')],_0x3dfab5[_0x4644('0x2e')]);_0x2e3470[_0x4644('0x32')]=_[_0x4644('0x3f')](_0x3dfab5[_0x4644('0x2d')],qs[_0x4644('0x31')](_0x45c2b3[_0x4644('0x2e')][_0x4644('0x31')]));_0x2e3470[_0x4644('0x32')]=_0x2e3470[_0x4644('0x32')]['length']?_0x2e3470['attributes']:_0x3dfab5[_0x4644('0x2d')];if(_0x45c2b3[_0x4644('0x2e')][_0x4644('0x40')]){_0x2e3470['include']=[{'all':!![]}];}_0x2e3470=_[_0x4644('0x41')]({},_0x2e3470,_0x45c2b3['options']);return db[_0x4644('0x3a')]['find'](_0x2e3470)[_0x4644('0x23')](handleEntityNotFound(_0xe7f70d,null))[_0x4644('0x23')](respondWithResult(_0xe7f70d,null))[_0x4644('0x42')](handleError(_0xe7f70d,null));};exports['create']=function(_0x5b21a6,_0x37fd7b){return db['VtigerAccount'][_0x4644('0x43')](_0x5b21a6[_0x4644('0x44')],{})[_0x4644('0x23')](respondWithResult(_0x37fd7b,0xc9))[_0x4644('0x42')](handleError(_0x37fd7b,null));};exports[_0x4644('0x21')]=function(_0x222c65,_0x2d7ddb){if(_0x222c65[_0x4644('0x44')]['id']){delete _0x222c65[_0x4644('0x44')]['id'];}return db['VtigerAccount'][_0x4644('0x45')]({'where':{'id':_0x222c65[_0x4644('0x46')]['id']}})[_0x4644('0x23')](handleEntityNotFound(_0x2d7ddb,null))['then'](saveUpdates(_0x222c65[_0x4644('0x44')],null))[_0x4644('0x23')](respondWithResult(_0x2d7ddb,null))['catch'](handleError(_0x2d7ddb,null));};exports[_0x4644('0x22')]=function(_0x449a18,_0x5680cd){return db['VtigerAccount'][_0x4644('0x45')]({'where':{'id':_0x449a18[_0x4644('0x46')]['id']}})[_0x4644('0x23')](handleEntityNotFound(_0x5680cd,null))['then'](removeEntity(_0x5680cd,null))[_0x4644('0x42')](handleError(_0x5680cd,null));};exports[_0x4644('0x47')]=function(_0x16b911,_0x2da394,_0x4ad28c){var _0x371149={};var _0x32220b={};var _0xaec0b7;var _0x3efccf;return db['VtigerAccount']['findOne']({'where':{'id':_0x16b911['params']['id']}})['then'](handleEntityNotFound(_0x2da394,null))[_0x4644('0x23')](function(_0x103a5c){if(_0x103a5c){_0xaec0b7=_0x103a5c;_0x32220b[_0x4644('0x2d')]=_[_0x4644('0x2f')](db[_0x4644('0x48')][_0x4644('0x49')]);_0x32220b[_0x4644('0x2e')]=_[_0x4644('0x2f')](_0x16b911['query']);_0x32220b[_0x4644('0x30')]=_[_0x4644('0x3f')](_0x32220b[_0x4644('0x2d')],_0x32220b['query']);_0x371149[_0x4644('0x32')]=_[_0x4644('0x3f')](_0x32220b[_0x4644('0x2d')],qs[_0x4644('0x31')](_0x16b911[_0x4644('0x2e')]['fields']));_0x371149[_0x4644('0x32')]=_0x371149['attributes'][_0x4644('0x33')]?_0x371149['attributes']:_0x32220b[_0x4644('0x2d')];_0x371149[_0x4644('0x4a')]=qs['sort'](_0x16b911[_0x4644('0x2e')][_0x4644('0x35')]);_0x371149['where']=qs[_0x4644('0x30')](_['pick'](_0x16b911['query'],_0x32220b[_0x4644('0x30')]));if(_0x16b911['query'][_0x4644('0x37')]){_0x371149[_0x4644('0x38')]=_[_0x4644('0x41')](_0x371149[_0x4644('0x38')],{'$or':_['map'](_0x371149[_0x4644('0x32')],function(_0x7eb656){var _0x4fff7c={};_0x4fff7c[_0x7eb656]={'$like':'%'+_0x16b911[_0x4644('0x2e')]['filter']+'%'};return _0x4fff7c;})});}_0x371149=_['merge']({},_0x371149,_0x16b911[_0x4644('0x39')]);return _0xaec0b7[_0x4644('0x47')](_0x371149);}})['then'](function(_0x42a590){if(_0x42a590){_0x3efccf=_0x42a590['length'];if(!_0x16b911[_0x4644('0x2e')][_0x4644('0x34')](_0x4644('0x4b'))){_0x371149[_0x4644('0x19')]=qs[_0x4644('0x19')](_0x16b911[_0x4644('0x2e')]['limit']);_0x371149[_0x4644('0x1b')]=qs[_0x4644('0x1b')](_0x16b911[_0x4644('0x2e')][_0x4644('0x1b')]);}return _0xaec0b7[_0x4644('0x47')](_0x371149);}})[_0x4644('0x23')](function(_0x218453){if(_0x218453){return _0x218453?{'count':_0x3efccf,'rows':_0x218453}:null;}})[_0x4644('0x23')](respondWithResult(_0x2da394,null))[_0x4644('0x42')](handleError(_0x2da394,null));};exports[_0x4644('0x4c')]=function(_0x53387f,_0x5b1656,_0x349b88){if(_0x53387f[_0x4644('0x44')]['id']){delete _0x53387f['body']['id'];}return db[_0x4644('0x3a')][_0x4644('0x4d')]({'where':{'id':_0x53387f[_0x4644('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b1656,null))[_0x4644('0x23')](function(_0x598c57){if(_0x598c57){_0x53387f['body'][_0x4644('0x4e')]=_0x598c57['id'];_0x53387f[_0x4644('0x44')][_0x4644('0x4f')]=integrations[_0x4644('0x50')](_0x53387f[_0x4644('0x44')][_0x4644('0x51')],_0x53387f['body']['type']);_0x53387f[_0x4644('0x44')]['Descriptions']=integrations[_0x4644('0x52')](_0x53387f[_0x4644('0x44')][_0x4644('0x51')],_0x53387f['body'][_0x4644('0x2b')]);return db[_0x4644('0x48')][_0x4644('0x43')](_0x53387f[_0x4644('0x44')],{'include':[{'model':db['VtigerField'],'as':_0x4644('0x4f')},{'model':db[_0x4644('0x53')],'as':_0x4644('0x54')}]});}return null;})['then'](respondWithResult(_0x5b1656,null))[_0x4644('0x42')](handleError(_0x5b1656,null));};var md5=require('md5');exports['getFields']=function(_0x860cbf,_0x32c71b,_0x4184b3){var _0x1a4b15=null;var _0x609ad2=null;var _0x2084fa=null;var _0x535550=null;var _0x506f97='';return db[_0x4644('0x3a')]['findOne']({'where':{'id':_0x860cbf[_0x4644('0x46')]['id']},'attributes':['id',_0x4644('0x26'),_0x4644('0x55'),_0x4644('0x56'),_0x4644('0x57'),_0x4644('0x58'),_0x4644('0x59'),_0x4644('0x5a')]})['then'](handleEntityNotFound(_0x32c71b,null))[_0x4644('0x23')](function(_0x2f33fd){if(_0x2f33fd){_0x1a4b15=_0x2f33fd[_0x4644('0x55')];_0x609ad2=_0x2f33fd['accessKey'];_0x2084fa=_0x2f33fd['moduleName'];_0x506f97=_0x2f33fd[_0x4644('0x58')];var _0x3da835=_0x506f97[_0x4644('0x5b')](-0x1);if(_0x3da835==='/'){_0x506f97=_0x506f97[_0x4644('0x5c')](0x0,_0x506f97['lastIndexOf'](_0x3da835));}_0x535550=util[_0x4644('0x5d')](_0x4644('0x5e'),_0x506f97);var _0x39fb36={'method':'GET','uri':_0x535550,'qs':{'operation':_0x4644('0x5f'),'username':_0x2f33fd[_0x4644('0x55')]},'json':!![]};return rp(_0x39fb36);}})[_0x4644('0x23')](function(_0x4ff5d9){if(_0x4ff5d9[_0x4644('0x60')]){var _0x3dde9a={'method':_0x4644('0x61'),'uri':_0x535550,'form':{'operation':_0x4644('0x62'),'username':_0x1a4b15,'accessKey':md5(_0x4ff5d9[_0x4644('0x63')][_0x4644('0x64')]+_0x609ad2)},'json':!![]};return rp(_0x3dde9a);}})[_0x4644('0x23')](function(_0x212da7){if(_0x212da7['success']){var _0xed1c6={'method':_0x4644('0x65'),'uri':_0x535550,'qs':{'operation':'describe','username':_0x1a4b15,'sessionName':_0x212da7['result'][_0x4644('0x66')],'elementType':_0x2084fa},'json':!![]};return rp(_0xed1c6);}})[_0x4644('0x23')](function(_0x1a2edd){if(_0x1a2edd['success']){var _0x5d2d2d=['autogenerated',_0x4644('0x67'),_0x4644('0x68')];_[_0x4644('0x69')](_0x1a2edd[_0x4644('0x63')][_0x4644('0x31')],function(_0x554d56){return _0x5d2d2d[_0x4644('0x6a')](_0x554d56[_0x4644('0x2b')][_0x4644('0x26')]);});_[_0x4644('0x69')](_0x1a2edd['result']['fields'],function(_0x28b833){return _0x28b833[_0x4644('0x6b')]===_0x4644('0x6c');});return{'count':_0x1a2edd[_0x4644('0x63')][_0x4644('0x31')][_0x4644('0x33')],'rows':_[_0x4644('0x29')](_0x1a2edd[_0x4644('0x63')]['fields'],function(_0x3458b6){return{'id':_0x3458b6[_0x4644('0x26')],'name':_0x3458b6[_0x4644('0x6d')],'custom':_[_0x4644('0x6e')](_0x3458b6[_0x4644('0x26')],_0x4644('0x6f'))?!![]:![],'options':_0x3458b6['type']['name']===_0x4644('0x70')&&_0x3458b6[_0x4644('0x2b')][_0x4644('0x71')][_0x4644('0x33')]>0x0?_['map'](_0x3458b6[_0x4644('0x2b')][_0x4644('0x71')],function(_0x4f1aa4){return{'name':_0x4f1aa4[_0x4644('0x6d')],'value':_0x4f1aa4[_0x4644('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x32c71b,null))[_0x4644('0x42')](function(_0x7180c1){console[_0x4644('0x73')](_0x4644('0x74')+_0x7180c1);var _0x10d9fe=_0x860cbf[_0x4644('0x2e')][_0x4644('0x75')]?0x1f4:_0x7180c1[_0x4644('0x76')]||0x1f4;logger[_0x4644('0x77')](_0x4644('0x78'),_0x4644('0x79'),_0x10d9fe,JSON['stringify'](_0x7180c1));delete _0x7180c1[_0x4644('0x26')];if(_0x10d9fe===0x191){_0x10d9fe=0x190;}_0x32c71b[_0x4644('0x1c')](_0x10d9fe)[_0x4644('0x27')](_0x860cbf['query']['test']?{'message':_0x4644('0x7a'),'statusCode':_0x7180c1['statusCode']}:_0x7180c1);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index ea4e878..6cbfe4b 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 _0x3b3d=['../../config/environment','define','VtigerAccount','int_vtiger_accounts','lodash','util','moment','bluebird','request-promise'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x3b3d,0x175));var _0xd3b3=function(_0x3d6c67,_0x559e1f){_0x3d6c67=_0x3d6c67-0x0;var _0x2db4ab=_0x3b3d[_0x3d6c67];return _0x2db4ab;};'use strict';var _=require(_0xd3b3('0x0'));var util=require(_0xd3b3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd3b3('0x2'));var BPromise=require(_0xd3b3('0x3'));var rp=require(_0xd3b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd3b3('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5de9b7,_0x2eda93){return _0x5de9b7[_0xd3b3('0x6')](_0xd3b3('0x7'),attributes,{'tableName':_0xd3b3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4979=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','util','../../config/logger','api','moment','request-promise','path'];(function(_0x113cde,_0xa79d69){var _0x1c09a4=function(_0x35e50b){while(--_0x35e50b){_0x113cde['push'](_0x113cde['shift']());}};_0x1c09a4(++_0xa79d69);}(_0x4979,0x96));var _0x9497=function(_0x57dbce,_0x2a4604){_0x57dbce=_0x57dbce-0x0;var _0x2ab396=_0x4979[_0x57dbce];return _0x2ab396;};'use strict';var _=require('lodash');var util=require(_0x9497('0x0'));var logger=require(_0x9497('0x1'))(_0x9497('0x2'));var moment=require(_0x9497('0x3'));var BPromise=require('bluebird');var rp=require(_0x9497('0x4'));var fs=require('fs');var path=require(_0x9497('0x5'));var rimraf=require(_0x9497('0x6'));var config=require(_0x9497('0x7'));var attributes=require(_0x9497('0x8'));var integrations=require(_0x9497('0x9'));module[_0x9497('0xa')]=function(_0x4661b5,_0x3a4258){return _0x4661b5[_0x9497('0xb')]('VtigerAccount',attributes,{'tableName':_0x9497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 9b485e9..b0fd293 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 _0x6c76=['findAll','options','raw','where','attributes','map','include','model','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xbdb5bf,_0x28e321){var _0x443e60=function(_0x59cc8c){while(--_0x59cc8c){_0xbdb5bf['push'](_0xbdb5bf['shift']());}};_0x443e60(++_0x28e321);}(_0x6c76,0x184));var _0x66c7=function(_0x178b40,_0x13abe7){_0x178b40=_0x178b40-0x0;var _0x42f6f7=_0x6c76[_0x178b40];return _0x42f6f7;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetVtigerAccount']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['VtigerAccount'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});};exports[_0x66c7('0x1e')]=function(_0x4f1a34){var _0xfbd97=this;return new Promise(function(_0x543fbf,_0x296875){return db[_0x66c7('0x1f')][_0x66c7('0x20')]({'raw':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f1a34['options']?_0x4f1a34['options'][_0x66c7('0x17')]||null:null,'attributes':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'include':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fd460){return{'model':db[_0x1fd460[_0x66c7('0x1b')]],'as':_0x1fd460['as'],'attributes':_0x1fd460['attributes'],'include':_0x1fd460['include']?_[_0x66c7('0x19')](_0x1fd460[_0x66c7('0x1a')],function(_0x367ad5){return{'model':db[_0x367ad5[_0x66c7('0x1b')]],'as':_0x367ad5['as'],'attributes':_0x367ad5[_0x66c7('0x18')],'include':_0x367ad5[_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x367ad5['include'],function(_0x30b90f){return{'model':db[_0x30b90f[_0x66c7('0x1b')]],'as':_0x30b90f['as'],'attributes':_0x30b90f[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x66c7('0x21')](function(_0x1e5993){logger[_0x66c7('0xa')](_0x66c7('0x1e'),_0x4f1a34);logger[_0x66c7('0x1d')](_0x66c7('0x1e'),_0x4f1a34,JSON[_0x66c7('0xe')](_0x1e5993));_0x543fbf(_0x1e5993);})[_0x66c7('0x13')](function(_0x4cd663){logger['error'](_0x66c7('0x1e'),_0x4cd663[_0x66c7('0x11')],_0x4f1a34);_0x296875(_0xfbd97[_0x66c7('0xf')](0x1f4,_0x4cd663['message']));});});}; \ No newline at end of file +var _0xcf66=['raw','where','attributes','limit','include','map','model','info','ShowVtigerAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x4759e7,_0x103555){var _0xd31f0e=function(_0x53f9c8){while(--_0x53f9c8){_0x4759e7['push'](_0x4759e7['shift']());}};_0xd31f0e(++_0x103555);}(_0xcf66,0x71));var _0x6cf6=function(_0x43e9ce,_0x4ccea0){_0x43e9ce=_0x43e9ce-0x0;var _0x533e90=_0xcf66[_0x43e9ce];return _0x533e90;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}exports[_0x6cf6('0x14')]=function(_0x2ca2b1){var _0x5e8b11=this;return new Promise(function(_0x11d994,_0x22915c){return db[_0x6cf6('0x15')]['findAll']({'raw':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x17')]===undefined?!![]:![]:!![],'where':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1['options'][_0x6cf6('0x19')]||null:null,'limit':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1a')]||null:null,'include':_0x2ca2b1[_0x6cf6('0x16')]?_0x2ca2b1[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x2ca2b1['options']['include'],function(_0x276225){return{'model':db[_0x276225['model']],'as':_0x276225['as'],'attributes':_0x276225[_0x6cf6('0x19')],'include':_0x276225[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x276225[_0x6cf6('0x1b')],function(_0x3f9871){return{'model':db[_0x3f9871[_0x6cf6('0x1d')]],'as':_0x3f9871['as'],'attributes':_0x3f9871[_0x6cf6('0x19')],'include':_0x3f9871['include']?_[_0x6cf6('0x1c')](_0x3f9871[_0x6cf6('0x1b')],function(_0x3eaa31){return{'model':db[_0x3eaa31['model']],'as':_0x3eaa31['as'],'attributes':_0x3eaa31[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x2224db){logger[_0x6cf6('0x1e')]('GetVtigerAccount',_0x2ca2b1);logger['debug'](_0x6cf6('0x14'),_0x2ca2b1,JSON[_0x6cf6('0xe')](_0x2224db));_0x11d994(_0x2224db);})[_0x6cf6('0x13')](function(_0x5869e9){logger['error'](_0x6cf6('0x14'),_0x5869e9['message'],_0x2ca2b1);_0x22915c(_0x5e8b11['error'](0x1f4,_0x5869e9['message']));});});};exports[_0x6cf6('0x1f')]=function(_0x65433){var _0x33d308=this;return new Promise(function(_0x42f488,_0x11c848){return db['VtigerAccount'][_0x6cf6('0x20')]({'raw':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x18')]||null:null,'attributes':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x19')]||null:null,'include':_0x65433[_0x6cf6('0x16')]?_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x65433[_0x6cf6('0x16')][_0x6cf6('0x1b')],function(_0x4620b6){return{'model':db[_0x4620b6[_0x6cf6('0x1d')]],'as':_0x4620b6['as'],'attributes':_0x4620b6[_0x6cf6('0x19')],'include':_0x4620b6[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x4620b6[_0x6cf6('0x1b')],function(_0x5cc6cd){return{'model':db[_0x5cc6cd[_0x6cf6('0x1d')]],'as':_0x5cc6cd['as'],'attributes':_0x5cc6cd[_0x6cf6('0x19')],'include':_0x5cc6cd[_0x6cf6('0x1b')]?_[_0x6cf6('0x1c')](_0x5cc6cd[_0x6cf6('0x1b')],function(_0x2cf3a3){return{'model':db[_0x2cf3a3[_0x6cf6('0x1d')]],'as':_0x2cf3a3['as'],'attributes':_0x2cf3a3[_0x6cf6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0xb')](function(_0x3718a1){logger[_0x6cf6('0x1e')]('ShowVtigerAccount',_0x65433);logger[_0x6cf6('0x21')](_0x6cf6('0x1f'),_0x65433,JSON[_0x6cf6('0xe')](_0x3718a1));_0x42f488(_0x3718a1);})[_0x6cf6('0x13')](function(_0x31c822){logger[_0x6cf6('0xf')](_0x6cf6('0x1f'),_0x31c822[_0x6cf6('0x11')],_0x65433);_0x11c848(_0x33d308[_0x6cf6('0xf')](0x1f4,_0x31c822['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a9c5c14..5e60cad 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 _0xc3a2=['../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','show','getSubjects','/:id/descriptions','post','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x38c947,_0x5a0aa0){var _0x3b9593=function(_0x1a3f4e){while(--_0x1a3f4e){_0x38c947['push'](_0x38c947['shift']());}};_0x3b9593(++_0x5a0aa0);}(_0xc3a2,0xcb));var _0x2c3a=function(_0x4fb6aa,_0xdd3b59){_0x4fb6aa=_0x4fb6aa-0x0;var _0x325100=_0xc3a2[_0x4fb6aa];return _0x325100;};'use strict';var multer=require(_0x2c3a('0x0'));var util=require(_0x2c3a('0x1'));var path=require('path');var timeout=require(_0x2c3a('0x2'));var express=require(_0x2c3a('0x3'));var router=express['Router']();var fs_extra=require(_0x2c3a('0x4'));var auth=require(_0x2c3a('0x5'));var interaction=require(_0x2c3a('0x6'));var config=require(_0x2c3a('0x7'));var controller=require(_0x2c3a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2c3a('0x9')]('/:id',auth[_0x2c3a('0xa')](),controller[_0x2c3a('0xb')]);router[_0x2c3a('0x9')]('/:id/fields',auth[_0x2c3a('0xa')](),controller['getFields']);router[_0x2c3a('0x9')]('/:id/subjects',auth[_0x2c3a('0xa')](),controller[_0x2c3a('0xc')]);router['get'](_0x2c3a('0xd'),auth[_0x2c3a('0xa')](),controller['getDescriptions']);router[_0x2c3a('0xe')]('/',auth[_0x2c3a('0xa')](),controller['create']);router[_0x2c3a('0xf')]('/:id',auth[_0x2c3a('0xa')](),controller[_0x2c3a('0x10')]);router[_0x2c3a('0x11')](_0x2c3a('0x12'),auth[_0x2c3a('0xa')](),controller[_0x2c3a('0x13')]);module[_0x2c3a('0x14')]=router; \ No newline at end of file +var _0x120d=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','post','create','delete','destroy'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x120d,0xd2));var _0xd120=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x120d[_0x1acc2d];return _0xabfa6d;};'use strict';var multer=require(_0xd120('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd120('0x1'));var express=require(_0xd120('0x2'));var router=express[_0xd120('0x3')]();var fs_extra=require(_0xd120('0x4'));var auth=require(_0xd120('0x5'));var interaction=require(_0xd120('0x6'));var config=require(_0xd120('0x7'));var controller=require(_0xd120('0x8'));router[_0xd120('0x9')]('/',auth[_0xd120('0xa')](),controller[_0xd120('0xb')]);router[_0xd120('0x9')](_0xd120('0xc'),auth['isAuthenticated'](),controller[_0xd120('0xd')]);router[_0xd120('0x9')]('/:id/fields',auth[_0xd120('0xa')](),controller[_0xd120('0xe')]);router['get'](_0xd120('0xf'),auth[_0xd120('0xa')](),controller[_0xd120('0x10')]);router[_0xd120('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd120('0x11')]('/',auth[_0xd120('0xa')](),controller[_0xd120('0x12')]);router['put'](_0xd120('0xc'),auth[_0xd120('0xa')](),controller['update']);router[_0xd120('0x13')](_0xd120('0xc'),auth[_0xd120('0xa')](),controller[_0xd120('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index d286dbc..73499b9 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 _0xf711=['STRING','sequelize'];(function(_0x154a0a,_0x96977b){var _0x550392=function(_0xf5f946){while(--_0xf5f946){_0x154a0a['push'](_0x154a0a['shift']());}};_0x550392(++_0x96977b);}(_0xf711,0x75));var _0x1f71=function(_0x309d84,_0x38d956){_0x309d84=_0x309d84-0x0;var _0x389343=_0xf711[_0x309d84];return _0x389343;};'use strict';var Sequelize=require(_0x1f71('0x0'));module['exports']={'name':{'type':Sequelize[_0x1f71('0x1')]},'description':{'type':Sequelize[_0x1f71('0x1')]}}; \ No newline at end of file +var _0xc582=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc582,0x79));var _0x2c58=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc582[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x2c58('0x0'));module[_0x2c58('0x1')]={'name':{'type':Sequelize[_0x2c58('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a549f51..c7dfa42 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 _0x8e0d=['Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','destroy','getFields','findOne','VtigerField','rawAttributes','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','json','offset','undefined','count'];(function(_0x155e37,_0x5f2377){var _0x113357=function(_0x3aa453){while(--_0x3aa453){_0x155e37['push'](_0x155e37['shift']());}};_0x113357(++_0x5f2377);}(_0x8e0d,0x82));var _0xd8e0=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x8e0d[_0x531d15];return _0x271a18;};'use strict';var emlformat=require(_0xd8e0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd8e0('0x1'));var rp=require(_0xd8e0('0x2'));var moment=require('moment');var BPromise=require(_0xd8e0('0x3'));var Mustache=require(_0xd8e0('0x4'));var util=require(_0xd8e0('0x5'));var path=require(_0xd8e0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8e0('0x7'));var fs=require('fs');var fs_extra=require(_0xd8e0('0x8'));var _=require(_0xd8e0('0x9'));var squel=require(_0xd8e0('0xa'));var crypto=require('crypto');var jsforce=require(_0xd8e0('0xb'));var deskjs=require(_0xd8e0('0xc'));var toCsv=require(_0xd8e0('0xd'));var querystring=require(_0xd8e0('0xe'));var Papa=require(_0xd8e0('0xf'));var Redis=require('ioredis');var authService=require(_0xd8e0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8e0('0x12'));var utils=require(_0xd8e0('0x13'));var config=require(_0xd8e0('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdc16bd,_0x4d968a){_0x4d968a=_0x4d968a||0xcc;return function(_0x11cf8d){if(_0x11cf8d){return _0xdc16bd['sendStatus'](_0x4d968a);}return _0xdc16bd['status'](_0x4d968a)['end']();};}function respondWithResult(_0x1557be,_0x5c983a){_0x5c983a=_0x5c983a||0xc8;return function(_0x34f992){if(_0x34f992){return _0x1557be[_0xd8e0('0x15')](_0x5c983a)[_0xd8e0('0x16')](_0x34f992);}};}function respondWithFilteredResult(_0x14e38b,_0x2689d3){return function(_0x28f3e0){if(_0x28f3e0){var _0xe5d019=typeof _0x2689d3[_0xd8e0('0x17')]===_0xd8e0('0x18')&&typeof _0x2689d3['limit']===_0xd8e0('0x18');var _0x282a0f=_0x28f3e0[_0xd8e0('0x19')];var _0x42586f=_0xe5d019?0x0:_0x2689d3[_0xd8e0('0x17')];var _0x2bf195=_0xe5d019?_0x28f3e0[_0xd8e0('0x19')]:_0x2689d3[_0xd8e0('0x17')]+_0x2689d3['limit'];var _0x371136;if(_0x2bf195>=_0x282a0f){_0x2bf195=_0x282a0f;_0x371136=0xc8;}else{_0x371136=0xce;}_0x14e38b[_0xd8e0('0x15')](_0x371136);return _0x14e38b['set'](_0xd8e0('0x1a'),_0x42586f+'-'+_0x2bf195+'/'+_0x282a0f)['json'](_0x28f3e0);}return null;};}function patchUpdates(_0x55ce9b){return function(_0x50c2a2){try{jsonpatch[_0xd8e0('0x1b')](_0x50c2a2,_0x55ce9b,!![]);}catch(_0x29c413){return BPromise['reject'](_0x29c413);}return _0x50c2a2[_0xd8e0('0x1c')]();};}function saveUpdates(_0x4209fb,_0x1d31de){return function(_0x40f098){if(_0x40f098){return _0x40f098[_0xd8e0('0x1d')](_0x4209fb)[_0xd8e0('0x1e')](function(_0x5285d7){return _0x5285d7;});}return null;};}function removeEntity(_0x1757f3,_0x340ae1){return function(_0x54c515){if(_0x54c515){return _0x54c515['destroy']()['then'](function(){_0x1757f3[_0xd8e0('0x15')](0xcc)[_0xd8e0('0x1f')]();});}};}function handleEntityNotFound(_0x2c1257,_0x16f1ab){return function(_0x148646){if(!_0x148646){_0x2c1257['sendStatus'](0x194);}return _0x148646;};}function handleError(_0x5a156c,_0x1a29c7){_0x1a29c7=_0x1a29c7||0x1f4;return function(_0x469b52){logger[_0xd8e0('0x20')](_0x469b52[_0xd8e0('0x21')]);if(_0x469b52['name']){delete _0x469b52[_0xd8e0('0x22')];}_0x5a156c[_0xd8e0('0x15')](_0x1a29c7)[_0xd8e0('0x23')](_0x469b52);};}exports[_0xd8e0('0x24')]=function(_0x532542,_0x38692c){var _0x46f3a2={},_0x1a9364={},_0x2ab62b={'count':0x0,'rows':[]};var _0x276665=_[_0xd8e0('0x25')](db[_0xd8e0('0x26')]['rawAttributes'],function(_0x2f27ae){return{'name':_0x2f27ae[_0xd8e0('0x27')],'type':_0x2f27ae[_0xd8e0('0x28')][_0xd8e0('0x29')]};});_0x1a9364[_0xd8e0('0x2a')]=_[_0xd8e0('0x25')](_0x276665,_0xd8e0('0x22'));_0x1a9364[_0xd8e0('0x2b')]=_[_0xd8e0('0x2c')](_0x532542[_0xd8e0('0x2b')]);_0x1a9364[_0xd8e0('0x2d')]=_['intersection'](_0x1a9364[_0xd8e0('0x2a')],_0x1a9364[_0xd8e0('0x2b')]);_0x46f3a2[_0xd8e0('0x2e')]=_[_0xd8e0('0x2f')](_0x1a9364[_0xd8e0('0x2a')],qs[_0xd8e0('0x30')](_0x532542['query'][_0xd8e0('0x30')]));_0x46f3a2[_0xd8e0('0x2e')]=_0x46f3a2[_0xd8e0('0x2e')][_0xd8e0('0x31')]?_0x46f3a2[_0xd8e0('0x2e')]:_0x1a9364[_0xd8e0('0x2a')];if(!_0x532542['query'][_0xd8e0('0x32')](_0xd8e0('0x33'))){_0x46f3a2[_0xd8e0('0x34')]=qs['limit'](_0x532542[_0xd8e0('0x2b')]['limit']);_0x46f3a2[_0xd8e0('0x17')]=qs[_0xd8e0('0x17')](_0x532542[_0xd8e0('0x2b')][_0xd8e0('0x17')]);}_0x46f3a2[_0xd8e0('0x35')]=qs[_0xd8e0('0x36')](_0x532542['query'][_0xd8e0('0x36')]);_0x46f3a2[_0xd8e0('0x37')]=qs[_0xd8e0('0x2d')](_[_0xd8e0('0x38')](_0x532542[_0xd8e0('0x2b')],_0x1a9364['filters']),_0x276665);if(_0x532542[_0xd8e0('0x2b')][_0xd8e0('0x39')]){_0x46f3a2[_0xd8e0('0x37')]=_[_0xd8e0('0x3a')](_0x46f3a2[_0xd8e0('0x37')],{'$or':_[_0xd8e0('0x25')](_0x276665,function(_0xd2d3fd){if(_0xd2d3fd[_0xd8e0('0x28')]!==_0xd8e0('0x3b')){var _0x4b3d02={};_0x4b3d02[_0xd2d3fd[_0xd8e0('0x22')]]={'$like':'%'+_0x532542[_0xd8e0('0x2b')][_0xd8e0('0x39')]+'%'};return _0x4b3d02;}})});}_0x46f3a2=_[_0xd8e0('0x3a')]({},_0x46f3a2,_0x532542[_0xd8e0('0x3c')]);var _0x2531e5={'where':_0x46f3a2[_0xd8e0('0x37')]};return db['VtigerConfiguration'][_0xd8e0('0x19')](_0x2531e5)[_0xd8e0('0x1e')](function(_0x5f6426){_0x2ab62b[_0xd8e0('0x19')]=_0x5f6426;if(_0x532542[_0xd8e0('0x2b')][_0xd8e0('0x3d')]){_0x46f3a2['include']=[{'all':!![]}];}return db[_0xd8e0('0x26')][_0xd8e0('0x3e')](_0x46f3a2);})['then'](function(_0x371ca7){_0x2ab62b[_0xd8e0('0x3f')]=_0x371ca7;return _0x2ab62b;})[_0xd8e0('0x1e')](respondWithFilteredResult(_0x38692c,_0x46f3a2))[_0xd8e0('0x40')](handleError(_0x38692c,null));};exports[_0xd8e0('0x41')]=function(_0x460da3,_0x41ec9c){var _0x3b9867={'raw':![],'where':{'id':_0x460da3[_0xd8e0('0x42')]['id']}},_0xf808a={};_0xf808a[_0xd8e0('0x2a')]=_[_0xd8e0('0x2c')](db[_0xd8e0('0x26')]['rawAttributes']);_0xf808a['query']=_[_0xd8e0('0x2c')](_0x460da3['query']);_0xf808a[_0xd8e0('0x2d')]=_[_0xd8e0('0x2f')](_0xf808a['model'],_0xf808a[_0xd8e0('0x2b')]);_0x3b9867[_0xd8e0('0x2e')]=_[_0xd8e0('0x2f')](_0xf808a[_0xd8e0('0x2a')],qs[_0xd8e0('0x30')](_0x460da3['query'][_0xd8e0('0x30')]));_0x3b9867[_0xd8e0('0x2e')]=_0x3b9867[_0xd8e0('0x2e')]['length']?_0x3b9867['attributes']:_0xf808a['model'];if(_0x460da3[_0xd8e0('0x2b')][_0xd8e0('0x3d')]){_0x3b9867[_0xd8e0('0x43')]=[{'all':!![]}];}_0x3b9867=_[_0xd8e0('0x3a')]({},_0x3b9867,_0x460da3[_0xd8e0('0x3c')]);return db[_0xd8e0('0x26')]['find'](_0x3b9867)[_0xd8e0('0x1e')](handleEntityNotFound(_0x41ec9c,null))[_0xd8e0('0x1e')](respondWithResult(_0x41ec9c,null))[_0xd8e0('0x40')](handleError(_0x41ec9c,null));};exports[_0xd8e0('0x44')]=function(_0x20a2eb,_0x3c6af6){return db[_0xd8e0('0x26')][_0xd8e0('0x44')](_0x20a2eb['body'],{})[_0xd8e0('0x1e')](respondWithResult(_0x3c6af6,0xc9))[_0xd8e0('0x40')](handleError(_0x3c6af6,null));};exports['update']=function(_0x58b5a9,_0x3cec45){if(_0x58b5a9[_0xd8e0('0x45')]['id']){delete _0x58b5a9[_0xd8e0('0x45')]['id'];}return db[_0xd8e0('0x26')][_0xd8e0('0x46')]({'where':{'id':_0x58b5a9[_0xd8e0('0x42')]['id']}})[_0xd8e0('0x1e')](handleEntityNotFound(_0x3cec45,null))[_0xd8e0('0x1e')](saveUpdates(_0x58b5a9[_0xd8e0('0x45')],null))['then'](respondWithResult(_0x3cec45,null))[_0xd8e0('0x40')](handleError(_0x3cec45,null));};exports[_0xd8e0('0x47')]=function(_0x415e0f,_0x56ca9a){return db[_0xd8e0('0x26')][_0xd8e0('0x46')]({'where':{'id':_0x415e0f[_0xd8e0('0x42')]['id']}})[_0xd8e0('0x1e')](handleEntityNotFound(_0x56ca9a,null))['then'](removeEntity(_0x56ca9a,null))[_0xd8e0('0x40')](handleError(_0x56ca9a,null));};exports[_0xd8e0('0x48')]=function(_0x698f20,_0x2fd866,_0x393634){var _0x33e6d4={};var _0x316e92={};var _0x2882e8;var _0x33ca2d;return db['VtigerConfiguration'][_0xd8e0('0x49')]({'where':{'id':_0x698f20['params']['id']}})[_0xd8e0('0x1e')](handleEntityNotFound(_0x2fd866,null))['then'](function(_0x4e6aac){if(_0x4e6aac){_0x2882e8=_0x4e6aac;_0x316e92[_0xd8e0('0x2a')]=_[_0xd8e0('0x2c')](db[_0xd8e0('0x4a')][_0xd8e0('0x4b')]);_0x316e92[_0xd8e0('0x2b')]=_[_0xd8e0('0x2c')](_0x698f20[_0xd8e0('0x2b')]);_0x316e92['filters']=_[_0xd8e0('0x2f')](_0x316e92[_0xd8e0('0x2a')],_0x316e92[_0xd8e0('0x2b')]);_0x33e6d4[_0xd8e0('0x2e')]=_['intersection'](_0x316e92[_0xd8e0('0x2a')],qs[_0xd8e0('0x30')](_0x698f20[_0xd8e0('0x2b')][_0xd8e0('0x30')]));_0x33e6d4[_0xd8e0('0x2e')]=_0x33e6d4[_0xd8e0('0x2e')][_0xd8e0('0x31')]?_0x33e6d4['attributes']:_0x316e92[_0xd8e0('0x2a')];_0x33e6d4[_0xd8e0('0x35')]=qs[_0xd8e0('0x36')](_0x698f20[_0xd8e0('0x2b')][_0xd8e0('0x36')]);_0x33e6d4[_0xd8e0('0x37')]=qs['filters'](_[_0xd8e0('0x38')](_0x698f20[_0xd8e0('0x2b')],_0x316e92[_0xd8e0('0x2d')]));if(_0x698f20[_0xd8e0('0x2b')][_0xd8e0('0x39')]){_0x33e6d4[_0xd8e0('0x37')]=_[_0xd8e0('0x3a')](_0x33e6d4['where'],{'$or':_[_0xd8e0('0x25')](_0x33e6d4[_0xd8e0('0x2e')],function(_0x1c8686){var _0x565782={};_0x565782[_0x1c8686]={'$like':'%'+_0x698f20[_0xd8e0('0x2b')][_0xd8e0('0x39')]+'%'};return _0x565782;})});}_0x33e6d4=_[_0xd8e0('0x3a')]({},_0x33e6d4,_0x698f20['options']);return _0x2882e8['getFields'](_0x33e6d4);}})['then'](function(_0x56aa73){if(_0x56aa73){_0x33ca2d=_0x56aa73[_0xd8e0('0x31')];if(!_0x698f20[_0xd8e0('0x2b')][_0xd8e0('0x32')](_0xd8e0('0x33'))){_0x33e6d4[_0xd8e0('0x34')]=qs[_0xd8e0('0x34')](_0x698f20[_0xd8e0('0x2b')]['limit']);_0x33e6d4[_0xd8e0('0x17')]=qs[_0xd8e0('0x17')](_0x698f20[_0xd8e0('0x2b')][_0xd8e0('0x17')]);}return _0x2882e8['getFields'](_0x33e6d4);}})[_0xd8e0('0x1e')](function(_0x3ca36f){if(_0x3ca36f){return _0x3ca36f?{'count':_0x33ca2d,'rows':_0x3ca36f}:null;}})[_0xd8e0('0x1e')](respondWithResult(_0x2fd866,null))['catch'](handleError(_0x2fd866,null));};exports[_0xd8e0('0x4c')]=function(_0x4c24bf,_0x583cd2,_0x3b3646){var _0x2c7ffe={};var _0x1a4bba={};var _0x54330f;var _0x2dc97f;return db[_0xd8e0('0x26')][_0xd8e0('0x49')]({'where':{'id':_0x4c24bf[_0xd8e0('0x42')]['id']}})['then'](handleEntityNotFound(_0x583cd2,null))[_0xd8e0('0x1e')](function(_0x3339d0){if(_0x3339d0){_0x54330f=_0x3339d0;_0x1a4bba['model']=_[_0xd8e0('0x2c')](db[_0xd8e0('0x4a')]['rawAttributes']);_0x1a4bba[_0xd8e0('0x2b')]=_[_0xd8e0('0x2c')](_0x4c24bf[_0xd8e0('0x2b')]);_0x1a4bba['filters']=_[_0xd8e0('0x2f')](_0x1a4bba[_0xd8e0('0x2a')],_0x1a4bba['query']);_0x2c7ffe[_0xd8e0('0x2e')]=_[_0xd8e0('0x2f')](_0x1a4bba[_0xd8e0('0x2a')],qs[_0xd8e0('0x30')](_0x4c24bf[_0xd8e0('0x2b')][_0xd8e0('0x30')]));_0x2c7ffe[_0xd8e0('0x2e')]=_0x2c7ffe[_0xd8e0('0x2e')][_0xd8e0('0x31')]?_0x2c7ffe[_0xd8e0('0x2e')]:_0x1a4bba[_0xd8e0('0x2a')];_0x2c7ffe[_0xd8e0('0x35')]=qs[_0xd8e0('0x36')](_0x4c24bf[_0xd8e0('0x2b')][_0xd8e0('0x36')]);_0x2c7ffe[_0xd8e0('0x37')]=qs[_0xd8e0('0x2d')](_[_0xd8e0('0x38')](_0x4c24bf[_0xd8e0('0x2b')],_0x1a4bba[_0xd8e0('0x2d')]));if(_0x4c24bf['query'][_0xd8e0('0x39')]){_0x2c7ffe['where']=_[_0xd8e0('0x3a')](_0x2c7ffe[_0xd8e0('0x37')],{'$or':_[_0xd8e0('0x25')](_0x2c7ffe[_0xd8e0('0x2e')],function(_0x4f5007){var _0x1d9271={};_0x1d9271[_0x4f5007]={'$like':'%'+_0x4c24bf[_0xd8e0('0x2b')][_0xd8e0('0x39')]+'%'};return _0x1d9271;})});}_0x2c7ffe=_['merge']({},_0x2c7ffe,_0x4c24bf[_0xd8e0('0x3c')]);return _0x54330f[_0xd8e0('0x4c')](_0x2c7ffe);}})[_0xd8e0('0x1e')](function(_0x31f648){if(_0x31f648){_0x2dc97f=_0x31f648[_0xd8e0('0x31')];if(!_0x4c24bf[_0xd8e0('0x2b')][_0xd8e0('0x32')]('nolimit')){_0x2c7ffe[_0xd8e0('0x34')]=qs[_0xd8e0('0x34')](_0x4c24bf[_0xd8e0('0x2b')][_0xd8e0('0x34')]);_0x2c7ffe[_0xd8e0('0x17')]=qs[_0xd8e0('0x17')](_0x4c24bf[_0xd8e0('0x2b')]['offset']);}return _0x54330f[_0xd8e0('0x4c')](_0x2c7ffe);}})['then'](function(_0x3385ed){if(_0x3385ed){return _0x3385ed?{'count':_0x2dc97f,'rows':_0x3385ed}:null;}})[_0xd8e0('0x1e')](respondWithResult(_0x583cd2,null))[_0xd8e0('0x40')](handleError(_0x583cd2,null));};exports['getDescriptions']=function(_0x5a704f,_0x2bf489,_0x5a0ccd){var _0x332477={};var _0x154022={};var _0x3afe9d;var _0x3dfec8;return db['VtigerConfiguration'][_0xd8e0('0x49')]({'where':{'id':_0x5a704f[_0xd8e0('0x42')]['id']}})[_0xd8e0('0x1e')](handleEntityNotFound(_0x2bf489,null))[_0xd8e0('0x1e')](function(_0x4751e1){if(_0x4751e1){_0x3afe9d=_0x4751e1;_0x154022[_0xd8e0('0x2a')]=_[_0xd8e0('0x2c')](db['VtigerField'][_0xd8e0('0x4b')]);_0x154022[_0xd8e0('0x2b')]=_['keys'](_0x5a704f[_0xd8e0('0x2b')]);_0x154022[_0xd8e0('0x2d')]=_[_0xd8e0('0x2f')](_0x154022[_0xd8e0('0x2a')],_0x154022[_0xd8e0('0x2b')]);_0x332477[_0xd8e0('0x2e')]=_[_0xd8e0('0x2f')](_0x154022[_0xd8e0('0x2a')],qs['fields'](_0x5a704f['query'][_0xd8e0('0x30')]));_0x332477[_0xd8e0('0x2e')]=_0x332477[_0xd8e0('0x2e')][_0xd8e0('0x31')]?_0x332477[_0xd8e0('0x2e')]:_0x154022[_0xd8e0('0x2a')];_0x332477[_0xd8e0('0x35')]=qs[_0xd8e0('0x36')](_0x5a704f[_0xd8e0('0x2b')][_0xd8e0('0x36')]);_0x332477[_0xd8e0('0x37')]=qs['filters'](_[_0xd8e0('0x38')](_0x5a704f[_0xd8e0('0x2b')],_0x154022[_0xd8e0('0x2d')]));if(_0x5a704f[_0xd8e0('0x2b')]['filter']){_0x332477[_0xd8e0('0x37')]=_[_0xd8e0('0x3a')](_0x332477['where'],{'$or':_[_0xd8e0('0x25')](_0x332477['attributes'],function(_0xe2d046){var _0x340f15={};_0x340f15[_0xe2d046]={'$like':'%'+_0x5a704f[_0xd8e0('0x2b')]['filter']+'%'};return _0x340f15;})});}_0x332477=_['merge']({},_0x332477,_0x5a704f[_0xd8e0('0x3c')]);return _0x3afe9d[_0xd8e0('0x4d')](_0x332477);}})[_0xd8e0('0x1e')](function(_0x286bec){if(_0x286bec){_0x3dfec8=_0x286bec[_0xd8e0('0x31')];if(!_0x5a704f[_0xd8e0('0x2b')][_0xd8e0('0x32')](_0xd8e0('0x33'))){_0x332477[_0xd8e0('0x34')]=qs[_0xd8e0('0x34')](_0x5a704f[_0xd8e0('0x2b')]['limit']);_0x332477[_0xd8e0('0x17')]=qs[_0xd8e0('0x17')](_0x5a704f[_0xd8e0('0x2b')][_0xd8e0('0x17')]);}return _0x3afe9d[_0xd8e0('0x4d')](_0x332477);}})[_0xd8e0('0x1e')](function(_0x524d76){if(_0x524d76){return _0x524d76?{'count':_0x3dfec8,'rows':_0x524d76}:null;}})[_0xd8e0('0x1e')](respondWithResult(_0x2bf489,null))[_0xd8e0('0x40')](handleError(_0x2bf489,null));}; \ No newline at end of file +var _0x63eb=['model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','VtigerConfiguration','include','findAll','rows','catch','show','params','length','includeAll','create','body','update','find','getFields','VtigerField','getSubjects','findOne','pick','nolimit','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','json','apply','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key'];(function(_0x46215c,_0xc59ffb){var _0x9f54d2=function(_0x24c5ec){while(--_0x24c5ec){_0x46215c['push'](_0x46215c['shift']());}};_0x9f54d2(++_0xc59ffb);}(_0x63eb,0x10d));var _0xb63e=function(_0x443fc9,_0x24fc48){_0x443fc9=_0x443fc9-0x0;var _0x13fdb4=_0x63eb[_0x443fc9];return _0x13fdb4;};'use strict';var emlformat=require(_0xb63e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb63e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb63e('0x2'));var moment=require(_0xb63e('0x3'));var BPromise=require(_0xb63e('0x4'));var Mustache=require(_0xb63e('0x5'));var util=require(_0xb63e('0x6'));var path=require(_0xb63e('0x7'));var sox=require(_0xb63e('0x8'));var csv=require(_0xb63e('0x9'));var ejs=require(_0xb63e('0xa'));var fs=require('fs');var fs_extra=require(_0xb63e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb63e('0xc'));var toCsv=require(_0xb63e('0x9'));var querystring=require('querystring');var Papa=require(_0xb63e('0xd'));var Redis=require(_0xb63e('0xe'));var authService=require(_0xb63e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb63e('0x10'));var hardwareService=require(_0xb63e('0x11'));var logger=require(_0xb63e('0x12'))(_0xb63e('0x13'));var utils=require(_0xb63e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb63e('0x15'));var db=require(_0xb63e('0x16'))['db'];function respondWithStatusCode(_0x54b891,_0x43f6cb){_0x43f6cb=_0x43f6cb||0xcc;return function(_0x97f8ad){if(_0x97f8ad){return _0x54b891['sendStatus'](_0x43f6cb);}return _0x54b891['status'](_0x43f6cb)[_0xb63e('0x17')]();};}function respondWithResult(_0x186f79,_0x1719bb){_0x1719bb=_0x1719bb||0xc8;return function(_0xc3dc2b){if(_0xc3dc2b){return _0x186f79['status'](_0x1719bb)['json'](_0xc3dc2b);}};}function respondWithFilteredResult(_0x3a65f3,_0x569952){return function(_0x8c6d1f){if(_0x8c6d1f){var _0x965ebc=typeof _0x569952[_0xb63e('0x18')]===_0xb63e('0x19')&&typeof _0x569952[_0xb63e('0x1a')]==='undefined';var _0x2e0bea=_0x8c6d1f[_0xb63e('0x1b')];var _0x5c9c54=_0x965ebc?0x0:_0x569952[_0xb63e('0x18')];var _0x3ffa41=_0x965ebc?_0x8c6d1f[_0xb63e('0x1b')]:_0x569952['offset']+_0x569952['limit'];var _0x271aea;if(_0x3ffa41>=_0x2e0bea){_0x3ffa41=_0x2e0bea;_0x271aea=0xc8;}else{_0x271aea=0xce;}_0x3a65f3[_0xb63e('0x1c')](_0x271aea);return _0x3a65f3['set'](_0xb63e('0x1d'),_0x5c9c54+'-'+_0x3ffa41+'/'+_0x2e0bea)[_0xb63e('0x1e')](_0x8c6d1f);}return null;};}function patchUpdates(_0x4daa02){return function(_0x5f2fd3){try{jsonpatch[_0xb63e('0x1f')](_0x5f2fd3,_0x4daa02,!![]);}catch(_0x18ed9c){return BPromise['reject'](_0x18ed9c);}return _0x5f2fd3['save']();};}function saveUpdates(_0x4cafb1,_0x12ff05){return function(_0x21e036){if(_0x21e036){return _0x21e036['update'](_0x4cafb1)[_0xb63e('0x20')](function(_0x5913e9){return _0x5913e9;});}return null;};}function removeEntity(_0x5f2d91,_0x114fb5){return function(_0x189d6a){if(_0x189d6a){return _0x189d6a[_0xb63e('0x21')]()[_0xb63e('0x20')](function(){_0x5f2d91[_0xb63e('0x1c')](0xcc)[_0xb63e('0x17')]();});}};}function handleEntityNotFound(_0x644624,_0x14af95){return function(_0x1cb297){if(!_0x1cb297){_0x644624[_0xb63e('0x22')](0x194);}return _0x1cb297;};}function handleError(_0x4e95e5,_0x36c99a){_0x36c99a=_0x36c99a||0x1f4;return function(_0x1d44c7){logger[_0xb63e('0x23')](_0x1d44c7['stack']);if(_0x1d44c7[_0xb63e('0x24')]){delete _0x1d44c7[_0xb63e('0x24')];}_0x4e95e5['status'](_0x36c99a)[_0xb63e('0x25')](_0x1d44c7);};}exports['index']=function(_0x44be2f,_0x8d039c){var _0x51c1ef={},_0xc3c0f2={},_0x2ec459={'count':0x0,'rows':[]};var _0x20b408=_[_0xb63e('0x26')](db['VtigerConfiguration'][_0xb63e('0x27')],function(_0x52b879){return{'name':_0x52b879[_0xb63e('0x28')],'type':_0x52b879[_0xb63e('0x29')][_0xb63e('0x2a')]};});_0xc3c0f2[_0xb63e('0x2b')]=_[_0xb63e('0x26')](_0x20b408,'name');_0xc3c0f2[_0xb63e('0x2c')]=_[_0xb63e('0x2d')](_0x44be2f[_0xb63e('0x2c')]);_0xc3c0f2[_0xb63e('0x2e')]=_[_0xb63e('0x2f')](_0xc3c0f2[_0xb63e('0x2b')],_0xc3c0f2[_0xb63e('0x2c')]);_0x51c1ef['attributes']=_[_0xb63e('0x2f')](_0xc3c0f2[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x44be2f[_0xb63e('0x2c')]['fields']));_0x51c1ef[_0xb63e('0x31')]=_0x51c1ef['attributes']['length']?_0x51c1ef[_0xb63e('0x31')]:_0xc3c0f2[_0xb63e('0x2b')];if(!_0x44be2f[_0xb63e('0x2c')][_0xb63e('0x32')]('nolimit')){_0x51c1ef[_0xb63e('0x1a')]=qs['limit'](_0x44be2f[_0xb63e('0x2c')][_0xb63e('0x1a')]);_0x51c1ef[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x44be2f[_0xb63e('0x2c')]['offset']);}_0x51c1ef[_0xb63e('0x33')]=qs[_0xb63e('0x34')](_0x44be2f[_0xb63e('0x2c')][_0xb63e('0x34')]);_0x51c1ef[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_['pick'](_0x44be2f['query'],_0xc3c0f2['filters']),_0x20b408);if(_0x44be2f[_0xb63e('0x2c')]['filter']){_0x51c1ef[_0xb63e('0x35')]=_[_0xb63e('0x36')](_0x51c1ef[_0xb63e('0x35')],{'$or':_['map'](_0x20b408,function(_0x416c63){if(_0x416c63['type']!==_0xb63e('0x37')){var _0x26ed6e={};_0x26ed6e[_0x416c63['name']]={'$like':'%'+_0x44be2f['query'][_0xb63e('0x38')]+'%'};return _0x26ed6e;}})});}_0x51c1ef=_[_0xb63e('0x36')]({},_0x51c1ef,_0x44be2f[_0xb63e('0x39')]);var _0x274272={'where':_0x51c1ef['where']};return db[_0xb63e('0x3a')][_0xb63e('0x1b')](_0x274272)['then'](function(_0xbe01e2){_0x2ec459[_0xb63e('0x1b')]=_0xbe01e2;if(_0x44be2f[_0xb63e('0x2c')]['includeAll']){_0x51c1ef[_0xb63e('0x3b')]=[{'all':!![]}];}return db[_0xb63e('0x3a')][_0xb63e('0x3c')](_0x51c1ef);})[_0xb63e('0x20')](function(_0x49f853){_0x2ec459[_0xb63e('0x3d')]=_0x49f853;return _0x2ec459;})[_0xb63e('0x20')](respondWithFilteredResult(_0x8d039c,_0x51c1ef))[_0xb63e('0x3e')](handleError(_0x8d039c,null));};exports[_0xb63e('0x3f')]=function(_0x3ff7dd,_0x2e5620){var _0xba3521={'raw':![],'where':{'id':_0x3ff7dd[_0xb63e('0x40')]['id']}},_0x45a520={};_0x45a520[_0xb63e('0x2b')]=_[_0xb63e('0x2d')](db[_0xb63e('0x3a')][_0xb63e('0x27')]);_0x45a520[_0xb63e('0x2c')]=_[_0xb63e('0x2d')](_0x3ff7dd[_0xb63e('0x2c')]);_0x45a520[_0xb63e('0x2e')]=_[_0xb63e('0x2f')](_0x45a520['model'],_0x45a520[_0xb63e('0x2c')]);_0xba3521['attributes']=_['intersection'](_0x45a520['model'],qs[_0xb63e('0x30')](_0x3ff7dd[_0xb63e('0x2c')][_0xb63e('0x30')]));_0xba3521[_0xb63e('0x31')]=_0xba3521[_0xb63e('0x31')][_0xb63e('0x41')]?_0xba3521[_0xb63e('0x31')]:_0x45a520[_0xb63e('0x2b')];if(_0x3ff7dd[_0xb63e('0x2c')][_0xb63e('0x42')]){_0xba3521['include']=[{'all':!![]}];}_0xba3521=_[_0xb63e('0x36')]({},_0xba3521,_0x3ff7dd[_0xb63e('0x39')]);return db[_0xb63e('0x3a')]['find'](_0xba3521)[_0xb63e('0x20')](handleEntityNotFound(_0x2e5620,null))[_0xb63e('0x20')](respondWithResult(_0x2e5620,null))[_0xb63e('0x3e')](handleError(_0x2e5620,null));};exports['create']=function(_0x30f84b,_0x1f09fd){return db[_0xb63e('0x3a')][_0xb63e('0x43')](_0x30f84b[_0xb63e('0x44')],{})[_0xb63e('0x20')](respondWithResult(_0x1f09fd,0xc9))[_0xb63e('0x3e')](handleError(_0x1f09fd,null));};exports[_0xb63e('0x45')]=function(_0x503d5e,_0x576886){if(_0x503d5e[_0xb63e('0x44')]['id']){delete _0x503d5e['body']['id'];}return db[_0xb63e('0x3a')]['find']({'where':{'id':_0x503d5e['params']['id']}})['then'](handleEntityNotFound(_0x576886,null))[_0xb63e('0x20')](saveUpdates(_0x503d5e[_0xb63e('0x44')],null))[_0xb63e('0x20')](respondWithResult(_0x576886,null))['catch'](handleError(_0x576886,null));};exports['destroy']=function(_0x137b54,_0x4c7a6f){return db[_0xb63e('0x3a')][_0xb63e('0x46')]({'where':{'id':_0x137b54[_0xb63e('0x40')]['id']}})[_0xb63e('0x20')](handleEntityNotFound(_0x4c7a6f,null))[_0xb63e('0x20')](removeEntity(_0x4c7a6f,null))[_0xb63e('0x3e')](handleError(_0x4c7a6f,null));};exports[_0xb63e('0x47')]=function(_0x3b05c6,_0xa6a634,_0x24b411){var _0x173172={};var _0x5b593f={};var _0x28792f;var _0x310cc7;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x3b05c6[_0xb63e('0x40')]['id']}})['then'](handleEntityNotFound(_0xa6a634,null))['then'](function(_0x3b9f1d){if(_0x3b9f1d){_0x28792f=_0x3b9f1d;_0x5b593f['model']=_[_0xb63e('0x2d')](db[_0xb63e('0x48')][_0xb63e('0x27')]);_0x5b593f[_0xb63e('0x2c')]=_[_0xb63e('0x2d')](_0x3b05c6['query']);_0x5b593f[_0xb63e('0x2e')]=_['intersection'](_0x5b593f[_0xb63e('0x2b')],_0x5b593f[_0xb63e('0x2c')]);_0x173172[_0xb63e('0x31')]=_[_0xb63e('0x2f')](_0x5b593f[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x3b05c6['query'][_0xb63e('0x30')]));_0x173172[_0xb63e('0x31')]=_0x173172[_0xb63e('0x31')]['length']?_0x173172[_0xb63e('0x31')]:_0x5b593f[_0xb63e('0x2b')];_0x173172['order']=qs['sort'](_0x3b05c6[_0xb63e('0x2c')]['sort']);_0x173172[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_['pick'](_0x3b05c6[_0xb63e('0x2c')],_0x5b593f[_0xb63e('0x2e')]));if(_0x3b05c6[_0xb63e('0x2c')]['filter']){_0x173172[_0xb63e('0x35')]=_['merge'](_0x173172[_0xb63e('0x35')],{'$or':_[_0xb63e('0x26')](_0x173172[_0xb63e('0x31')],function(_0x1946e8){var _0x1a9cd1={};_0x1a9cd1[_0x1946e8]={'$like':'%'+_0x3b05c6[_0xb63e('0x2c')][_0xb63e('0x38')]+'%'};return _0x1a9cd1;})});}_0x173172=_[_0xb63e('0x36')]({},_0x173172,_0x3b05c6['options']);return _0x28792f[_0xb63e('0x47')](_0x173172);}})[_0xb63e('0x20')](function(_0x950e05){if(_0x950e05){_0x310cc7=_0x950e05[_0xb63e('0x41')];if(!_0x3b05c6[_0xb63e('0x2c')][_0xb63e('0x32')]('nolimit')){_0x173172['limit']=qs[_0xb63e('0x1a')](_0x3b05c6['query'][_0xb63e('0x1a')]);_0x173172[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x3b05c6[_0xb63e('0x2c')][_0xb63e('0x18')]);}return _0x28792f[_0xb63e('0x47')](_0x173172);}})[_0xb63e('0x20')](function(_0x3e0f49){if(_0x3e0f49){return _0x3e0f49?{'count':_0x310cc7,'rows':_0x3e0f49}:null;}})[_0xb63e('0x20')](respondWithResult(_0xa6a634,null))['catch'](handleError(_0xa6a634,null));};exports[_0xb63e('0x49')]=function(_0x2cae1c,_0x17c590,_0x203a24){var _0x5cf082={};var _0x148bd4={};var _0x4f51a6;var _0x27021c;return db['VtigerConfiguration'][_0xb63e('0x4a')]({'where':{'id':_0x2cae1c['params']['id']}})['then'](handleEntityNotFound(_0x17c590,null))[_0xb63e('0x20')](function(_0x1ac350){if(_0x1ac350){_0x4f51a6=_0x1ac350;_0x148bd4[_0xb63e('0x2b')]=_['keys'](db[_0xb63e('0x48')][_0xb63e('0x27')]);_0x148bd4['query']=_[_0xb63e('0x2d')](_0x2cae1c[_0xb63e('0x2c')]);_0x148bd4[_0xb63e('0x2e')]=_[_0xb63e('0x2f')](_0x148bd4['model'],_0x148bd4[_0xb63e('0x2c')]);_0x5cf082[_0xb63e('0x31')]=_[_0xb63e('0x2f')](_0x148bd4[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x30')]));_0x5cf082[_0xb63e('0x31')]=_0x5cf082[_0xb63e('0x31')][_0xb63e('0x41')]?_0x5cf082[_0xb63e('0x31')]:_0x148bd4[_0xb63e('0x2b')];_0x5cf082[_0xb63e('0x33')]=qs[_0xb63e('0x34')](_0x2cae1c['query'][_0xb63e('0x34')]);_0x5cf082[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_[_0xb63e('0x4b')](_0x2cae1c['query'],_0x148bd4[_0xb63e('0x2e')]));if(_0x2cae1c[_0xb63e('0x2c')]['filter']){_0x5cf082[_0xb63e('0x35')]=_[_0xb63e('0x36')](_0x5cf082[_0xb63e('0x35')],{'$or':_[_0xb63e('0x26')](_0x5cf082[_0xb63e('0x31')],function(_0x3c2202){var _0x17d163={};_0x17d163[_0x3c2202]={'$like':'%'+_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x38')]+'%'};return _0x17d163;})});}_0x5cf082=_[_0xb63e('0x36')]({},_0x5cf082,_0x2cae1c[_0xb63e('0x39')]);return _0x4f51a6[_0xb63e('0x49')](_0x5cf082);}})[_0xb63e('0x20')](function(_0x40639f){if(_0x40639f){_0x27021c=_0x40639f[_0xb63e('0x41')];if(!_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x32')](_0xb63e('0x4c'))){_0x5cf082['limit']=qs[_0xb63e('0x1a')](_0x2cae1c['query'][_0xb63e('0x1a')]);_0x5cf082[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x2cae1c[_0xb63e('0x2c')][_0xb63e('0x18')]);}return _0x4f51a6[_0xb63e('0x49')](_0x5cf082);}})['then'](function(_0x3b96e2){if(_0x3b96e2){return _0x3b96e2?{'count':_0x27021c,'rows':_0x3b96e2}:null;}})[_0xb63e('0x20')](respondWithResult(_0x17c590,null))[_0xb63e('0x3e')](handleError(_0x17c590,null));};exports[_0xb63e('0x4d')]=function(_0x4cc498,_0x3fa697,_0x32e744){var _0x34c680={};var _0x27a69a={};var _0x34e5ff;var _0x2e0279;return db[_0xb63e('0x3a')][_0xb63e('0x4a')]({'where':{'id':_0x4cc498[_0xb63e('0x40')]['id']}})[_0xb63e('0x20')](handleEntityNotFound(_0x3fa697,null))[_0xb63e('0x20')](function(_0x370069){if(_0x370069){_0x34e5ff=_0x370069;_0x27a69a[_0xb63e('0x2b')]=_[_0xb63e('0x2d')](db['VtigerField'][_0xb63e('0x27')]);_0x27a69a[_0xb63e('0x2c')]=_['keys'](_0x4cc498[_0xb63e('0x2c')]);_0x27a69a['filters']=_[_0xb63e('0x2f')](_0x27a69a[_0xb63e('0x2b')],_0x27a69a[_0xb63e('0x2c')]);_0x34c680[_0xb63e('0x31')]=_['intersection'](_0x27a69a[_0xb63e('0x2b')],qs[_0xb63e('0x30')](_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x30')]));_0x34c680['attributes']=_0x34c680[_0xb63e('0x31')][_0xb63e('0x41')]?_0x34c680[_0xb63e('0x31')]:_0x27a69a['model'];_0x34c680[_0xb63e('0x33')]=qs['sort'](_0x4cc498[_0xb63e('0x2c')]['sort']);_0x34c680[_0xb63e('0x35')]=qs[_0xb63e('0x2e')](_[_0xb63e('0x4b')](_0x4cc498['query'],_0x27a69a[_0xb63e('0x2e')]));if(_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x38')]){_0x34c680[_0xb63e('0x35')]=_[_0xb63e('0x36')](_0x34c680[_0xb63e('0x35')],{'$or':_['map'](_0x34c680[_0xb63e('0x31')],function(_0x2a3399){var _0x1d746d={};_0x1d746d[_0x2a3399]={'$like':'%'+_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x38')]+'%'};return _0x1d746d;})});}_0x34c680=_[_0xb63e('0x36')]({},_0x34c680,_0x4cc498['options']);return _0x34e5ff[_0xb63e('0x4d')](_0x34c680);}})[_0xb63e('0x20')](function(_0x5ed090){if(_0x5ed090){_0x2e0279=_0x5ed090[_0xb63e('0x41')];if(!_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x32')](_0xb63e('0x4c'))){_0x34c680[_0xb63e('0x1a')]=qs['limit'](_0x4cc498[_0xb63e('0x2c')][_0xb63e('0x1a')]);_0x34c680[_0xb63e('0x18')]=qs[_0xb63e('0x18')](_0x4cc498['query']['offset']);}return _0x34e5ff['getDescriptions'](_0x34c680);}})[_0xb63e('0x20')](function(_0x1d3a09){if(_0x1d3a09){return _0x1d3a09?{'count':_0x2e0279,'rows':_0x1d3a09}:null;}})[_0xb63e('0x20')](respondWithResult(_0x3fa697,null))[_0xb63e('0x3e')](handleError(_0x3fa697,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6524128..8ed405a 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 _0x0771=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','api','bluebird','request-promise'];(function(_0x12c08c,_0x6a91d0){var _0x361d0a=function(_0x1692cb){while(--_0x1692cb){_0x12c08c['push'](_0x12c08c['shift']());}};_0x361d0a(++_0x6a91d0);}(_0x0771,0x8c));var _0x1077=function(_0x50bca7,_0xb23979){_0x50bca7=_0x50bca7-0x0;var _0x40e5ee=_0x0771[_0x50bca7];return _0x40e5ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1077('0x0'))(_0x1077('0x1'));var moment=require('moment');var BPromise=require(_0x1077('0x2'));var rp=require(_0x1077('0x3'));var fs=require('fs');var path=require(_0x1077('0x4'));var rimraf=require(_0x1077('0x5'));var config=require(_0x1077('0x6'));var attributes=require(_0x1077('0x7'));module[_0x1077('0x8')]=function(_0x1d10d1,_0x487970){return _0x1d10d1[_0x1077('0x9')](_0x1077('0xa'),attributes,{'tableName':_0x1077('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82aa=['rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x82aa,0x1da));var _0xa82a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x82aa[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa82a('0x0'));var util=require(_0xa82a('0x1'));var logger=require(_0xa82a('0x2'))(_0xa82a('0x3'));var moment=require(_0xa82a('0x4'));var BPromise=require(_0xa82a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa82a('0x6'));var config=require(_0xa82a('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xa82a('0x8')]=function(_0x359fc5,_0x53bba1){return _0x359fc5[_0xa82a('0x9')](_0xa82a('0xa'),attributes,{'tableName':_0xa82a('0xb'),'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 e84b195..9426d35 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 _0x28ed=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e7cf6,_0x4fe111){var _0xa1f51d=function(_0x53ad27){while(--_0x53ad27){_0x1e7cf6['push'](_0x1e7cf6['shift']());}};_0xa1f51d(++_0x4fe111);}(_0x28ed,0x96));var _0xd28e=function(_0xf71e1,_0x122101){_0xf71e1=_0xf71e1-0x0;var _0x1546d9=_0x28ed[_0xf71e1];return _0x1546d9;};'use strict';var _=require(_0xd28e('0x0'));var util=require(_0xd28e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd28e('0x2'));var fs=require('fs');var Redis=require(_0xd28e('0x3'));var db=require(_0xd28e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd28e('0x5'))('rpc');var config=require(_0xd28e('0x6'));var jayson=require(_0xd28e('0x7'));var client=jayson['client'][_0xd28e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29c365,_0x30c4d7,_0x71d44f){return new BPromise(function(_0x4b5622,_0x367f54){return client[_0xd28e('0x9')](_0x29c365,_0x71d44f)[_0xd28e('0xa')](function(_0x2b5929){logger[_0xd28e('0xb')](_0xd28e('0xc'),_0x30c4d7,_0xd28e('0xd'));logger[_0xd28e('0xe')](_0xd28e('0xf'),_0x30c4d7,_0xd28e('0xd'),JSON[_0xd28e('0x10')](_0x2b5929));if(_0x2b5929[_0xd28e('0x11')]){if(_0x2b5929[_0xd28e('0x11')]['code']===0x1f4){logger[_0xd28e('0x11')](_0xd28e('0xc'),_0x30c4d7,_0x2b5929[_0xd28e('0x11')][_0xd28e('0x12')]);return _0x367f54(_0x2b5929['error']['message']);}logger['error'](_0xd28e('0xc'),_0x30c4d7,_0x2b5929[_0xd28e('0x11')][_0xd28e('0x12')]);return _0x4b5622(_0x2b5929[_0xd28e('0x11')]['message']);}else{logger['info'](_0xd28e('0xc'),_0x30c4d7,'request\x20sent');_0x4b5622(_0x2b5929[_0xd28e('0x13')]['message']);}})[_0xd28e('0x14')](function(_0x57fadd){logger[_0xd28e('0x11')](_0xd28e('0xc'),_0x30c4d7,_0x57fadd);_0x367f54(_0x57fadd);});});} \ No newline at end of file +var _0x404f=['../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xdc3fc6,_0x11bd84){var _0x3128c4=function(_0xea0e68){while(--_0xea0e68){_0xdc3fc6['push'](_0xdc3fc6['shift']());}};_0x3128c4(++_0x11bd84);}(_0x404f,0x12d));var _0xf404=function(_0x542318,_0x49ac00){_0x542318=_0x542318-0x0;var _0x1d3987=_0x404f[_0x542318];return _0x1d3987;};'use strict';var _=require(_0xf404('0x0'));var util=require(_0xf404('0x1'));var moment=require('moment');var BPromise=require(_0xf404('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf404('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf404('0x4'));var logger=require(_0xf404('0x5'))(_0xf404('0x6'));var config=require(_0xf404('0x7'));var jayson=require(_0xf404('0x8'));var client=jayson['client'][_0xf404('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x339db0,_0xabc7d7,_0x37cc49){return new BPromise(function(_0xdf1fed,_0x57142f){return client[_0xf404('0xa')](_0x339db0,_0x37cc49)[_0xf404('0xb')](function(_0x13d043){logger[_0xf404('0xc')](_0xf404('0xd'),_0xabc7d7,_0xf404('0xe'));logger[_0xf404('0xf')](_0xf404('0x10'),_0xabc7d7,_0xf404('0xe'),JSON['stringify'](_0x13d043));if(_0x13d043[_0xf404('0x11')]){if(_0x13d043[_0xf404('0x11')][_0xf404('0x12')]===0x1f4){logger['error'](_0xf404('0xd'),_0xabc7d7,_0x13d043[_0xf404('0x11')][_0xf404('0x13')]);return _0x57142f(_0x13d043[_0xf404('0x11')][_0xf404('0x13')]);}logger[_0xf404('0x11')](_0xf404('0xd'),_0xabc7d7,_0x13d043[_0xf404('0x11')]['message']);return _0xdf1fed(_0x13d043['error'][_0xf404('0x13')]);}else{logger['info'](_0xf404('0xd'),_0xabc7d7,_0xf404('0xe'));_0xdf1fed(_0x13d043[_0xf404('0x14')][_0xf404('0x13')]);}})[_0xf404('0x15')](function(_0x408214){logger[_0xf404('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0xabc7d7,_0x408214);_0x57142f(_0x408214);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index aaa97f7..f009bef 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 _0xc5ce=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerField.controller','isAuthenticated','get','/:id','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x406fbb,_0x1093e5){var _0x8e921d=function(_0x410517){while(--_0x410517){_0x406fbb['push'](_0x406fbb['shift']());}};_0x8e921d(++_0x1093e5);}(_0xc5ce,0x153));var _0xec5c=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc5ce[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xec5c('0x0'));var util=require(_0xec5c('0x1'));var path=require(_0xec5c('0x2'));var timeout=require(_0xec5c('0x3'));var express=require(_0xec5c('0x4'));var router=express[_0xec5c('0x5')]();var fs_extra=require(_0xec5c('0x6'));var auth=require(_0xec5c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xec5c('0x8'));router['get']('/',auth[_0xec5c('0x9')](),controller['index']);router[_0xec5c('0xa')](_0xec5c('0xb'),auth[_0xec5c('0x9')](),controller['show']);router[_0xec5c('0xc')]('/',auth['isAuthenticated'](),controller[_0xec5c('0xd')]);router['put'](_0xec5c('0xb'),auth[_0xec5c('0x9')](),controller[_0xec5c('0xe')]);router[_0xec5c('0xf')](_0xec5c('0xb'),auth[_0xec5c('0x9')](),controller[_0xec5c('0x10')]);module[_0xec5c('0x11')]=router; \ No newline at end of file +var _0xbed3=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xbed3,0x10f));var _0x3bed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbed3[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x3bed('0x0'));var util=require('util');var path=require(_0x3bed('0x1'));var timeout=require(_0x3bed('0x2'));var express=require(_0x3bed('0x3'));var router=express[_0x3bed('0x4')]();var fs_extra=require(_0x3bed('0x5'));var auth=require(_0x3bed('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3bed('0x7'));router['get']('/',auth[_0x3bed('0x8')](),controller[_0x3bed('0x9')]);router[_0x3bed('0xa')](_0x3bed('0xb'),auth[_0x3bed('0x8')](),controller['show']);router[_0x3bed('0xc')]('/',auth[_0x3bed('0x8')](),controller[_0x3bed('0xd')]);router[_0x3bed('0xe')](_0x3bed('0xb'),auth[_0x3bed('0x8')](),controller[_0x3bed('0xf')]);router[_0x3bed('0x10')](_0x3bed('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3bed('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 ae94fc3..394a91d 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 _0x60c8=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x60c8,0x143));var _0x860c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60c8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x860c('0x0'));module['exports']={'type':{'type':Sequelize[_0x860c('0x1')](_0x860c('0x2'),_0x860c('0x3'),_0x860c('0x4'),_0x860c('0x5'),'picklist'),'defaultValue':_0x860c('0x2')},'content':{'type':Sequelize[_0x860c('0x6')]},'key':{'type':Sequelize[_0x860c('0x6')]},'keyType':{'type':Sequelize[_0x860c('0x1')]('string',_0x860c('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x860c('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x860c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x860c('0x6')]}}; \ No newline at end of file +var _0x6774=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x5baf82,_0x52df08){var _0x2e83ea=function(_0x23c822){while(--_0x23c822){_0x5baf82['push'](_0x5baf82['shift']());}};_0x2e83ea(++_0x52df08);}(_0x6774,0xc7));var _0x4677=function(_0x457647,_0xf944ac){_0x457647=_0x457647-0x0;var _0x440eb1=_0x6774[_0x457647];return _0x440eb1;};'use strict';var Sequelize=require(_0x4677('0x0'));module[_0x4677('0x1')]={'type':{'type':Sequelize[_0x4677('0x2')](_0x4677('0x3'),_0x4677('0x4'),_0x4677('0x5'),'keyValue',_0x4677('0x6')),'defaultValue':_0x4677('0x3')},'content':{'type':Sequelize[_0x4677('0x7')]},'key':{'type':Sequelize[_0x4677('0x7')]},'keyType':{'type':Sequelize[_0x4677('0x2')](_0x4677('0x3'),_0x4677('0x4'),_0x4677('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4677('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4677('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4677('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 98f86c0..01fb0e6 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 _0x00a2=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','include','findAll','rows','show','params','VtigerField','includeAll','find','create','body','catch','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x2b419a,_0x2c74b7){var _0x1d1e40=function(_0x5bc36f){while(--_0x5bc36f){_0x2b419a['push'](_0x2b419a['shift']());}};_0x1d1e40(++_0x2c74b7);}(_0x00a2,0xb1));var _0x200a=function(_0x3a2d3d,_0x4e057f){_0x3a2d3d=_0x3a2d3d-0x0;var _0x1a7446=_0x00a2[_0x3a2d3d];return _0x1a7446;};'use strict';var emlformat=require(_0x200a('0x0'));var rimraf=require(_0x200a('0x1'));var zipdir=require(_0x200a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x200a('0x3'));var Mustache=require(_0x200a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x200a('0x5'));var csv=require(_0x200a('0x6'));var ejs=require(_0x200a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x200a('0x8'));var squel=require(_0x200a('0x9'));var crypto=require(_0x200a('0xa'));var jsforce=require(_0x200a('0xb'));var deskjs=require(_0x200a('0xc'));var toCsv=require(_0x200a('0x6'));var querystring=require(_0x200a('0xd'));var Papa=require(_0x200a('0xe'));var Redis=require(_0x200a('0xf'));var authService=require(_0x200a('0x10'));var qs=require(_0x200a('0x11'));var as=require(_0x200a('0x12'));var hardwareService=require(_0x200a('0x13'));var logger=require(_0x200a('0x14'))(_0x200a('0x15'));var utils=require(_0x200a('0x16'));var config=require(_0x200a('0x17'));var licenseUtil=require(_0x200a('0x18'));var db=require(_0x200a('0x19'))['db'];function respondWithStatusCode(_0xc3f6f8,_0x4ac456){_0x4ac456=_0x4ac456||0xcc;return function(_0x275aac){if(_0x275aac){return _0xc3f6f8[_0x200a('0x1a')](_0x4ac456);}return _0xc3f6f8['status'](_0x4ac456)['end']();};}function respondWithResult(_0x4eaede,_0x5f53c3){_0x5f53c3=_0x5f53c3||0xc8;return function(_0x2636d1){if(_0x2636d1){return _0x4eaede['status'](_0x5f53c3)['json'](_0x2636d1);}};}function respondWithFilteredResult(_0x177188,_0xed4671){return function(_0x164a40){if(_0x164a40){var _0x491c5b=typeof _0xed4671[_0x200a('0x1b')]===_0x200a('0x1c')&&typeof _0xed4671[_0x200a('0x1d')]===_0x200a('0x1c');var _0x1429ad=_0x164a40['count'];var _0x59927b=_0x491c5b?0x0:_0xed4671[_0x200a('0x1b')];var _0x507251=_0x491c5b?_0x164a40[_0x200a('0x1e')]:_0xed4671[_0x200a('0x1b')]+_0xed4671['limit'];var _0x3c6ed9;if(_0x507251>=_0x1429ad){_0x507251=_0x1429ad;_0x3c6ed9=0xc8;}else{_0x3c6ed9=0xce;}_0x177188['status'](_0x3c6ed9);return _0x177188[_0x200a('0x1f')](_0x200a('0x20'),_0x59927b+'-'+_0x507251+'/'+_0x1429ad)['json'](_0x164a40);}return null;};}function patchUpdates(_0x164eef){return function(_0x48271d){try{jsonpatch[_0x200a('0x21')](_0x48271d,_0x164eef,!![]);}catch(_0xf1e683){return BPromise[_0x200a('0x22')](_0xf1e683);}return _0x48271d[_0x200a('0x23')]();};}function saveUpdates(_0x196e03,_0x20999c){return function(_0xb6b1e0){if(_0xb6b1e0){return _0xb6b1e0[_0x200a('0x24')](_0x196e03)[_0x200a('0x25')](function(_0x1e8d1){return _0x1e8d1;});}return null;};}function removeEntity(_0x3cc87f,_0x7e91d7){return function(_0xd8b8c0){if(_0xd8b8c0){return _0xd8b8c0[_0x200a('0x26')]()[_0x200a('0x25')](function(){_0x3cc87f[_0x200a('0x27')](0xcc)[_0x200a('0x28')]();});}};}function handleEntityNotFound(_0x123ce3,_0x289b6b){return function(_0x14e492){if(!_0x14e492){_0x123ce3[_0x200a('0x1a')](0x194);}return _0x14e492;};}function handleError(_0x49c379,_0x4b82b0){_0x4b82b0=_0x4b82b0||0x1f4;return function(_0x361b37){logger[_0x200a('0x29')](_0x361b37['stack']);if(_0x361b37[_0x200a('0x2a')]){delete _0x361b37['name'];}_0x49c379[_0x200a('0x27')](_0x4b82b0)[_0x200a('0x2b')](_0x361b37);};}exports[_0x200a('0x2c')]=function(_0x46425b,_0x4e2bdf){var _0x4afc40={},_0x5512f4={},_0xe985ec={'count':0x0,'rows':[]};var _0x4e67d3=_[_0x200a('0x2d')](db['VtigerField'][_0x200a('0x2e')],function(_0x56e7cf){return{'name':_0x56e7cf[_0x200a('0x2f')],'type':_0x56e7cf[_0x200a('0x30')][_0x200a('0x31')]};});_0x5512f4[_0x200a('0x32')]=_[_0x200a('0x2d')](_0x4e67d3,_0x200a('0x2a'));_0x5512f4[_0x200a('0x33')]=_[_0x200a('0x34')](_0x46425b[_0x200a('0x33')]);_0x5512f4['filters']=_[_0x200a('0x35')](_0x5512f4[_0x200a('0x32')],_0x5512f4[_0x200a('0x33')]);_0x4afc40['attributes']=_['intersection'](_0x5512f4[_0x200a('0x32')],qs['fields'](_0x46425b['query'][_0x200a('0x36')]));_0x4afc40[_0x200a('0x37')]=_0x4afc40[_0x200a('0x37')][_0x200a('0x38')]?_0x4afc40['attributes']:_0x5512f4[_0x200a('0x32')];if(!_0x46425b[_0x200a('0x33')][_0x200a('0x39')](_0x200a('0x3a'))){_0x4afc40['limit']=qs[_0x200a('0x1d')](_0x46425b[_0x200a('0x33')][_0x200a('0x1d')]);_0x4afc40['offset']=qs['offset'](_0x46425b['query'][_0x200a('0x1b')]);}_0x4afc40[_0x200a('0x3b')]=qs['sort'](_0x46425b[_0x200a('0x33')][_0x200a('0x3c')]);_0x4afc40[_0x200a('0x3d')]=qs[_0x200a('0x3e')](_['pick'](_0x46425b['query'],_0x5512f4[_0x200a('0x3e')]),_0x4e67d3);if(_0x46425b['query']['filter']){_0x4afc40[_0x200a('0x3d')]=_['merge'](_0x4afc40[_0x200a('0x3d')],{'$or':_['map'](_0x4e67d3,function(_0x144a9f){if(_0x144a9f[_0x200a('0x30')]!==_0x200a('0x3f')){var _0x35cad0={};_0x35cad0[_0x144a9f[_0x200a('0x2a')]]={'$like':'%'+_0x46425b[_0x200a('0x33')]['filter']+'%'};return _0x35cad0;}})});}_0x4afc40=_[_0x200a('0x40')]({},_0x4afc40,_0x46425b[_0x200a('0x41')]);var _0x1c7aed={'where':_0x4afc40[_0x200a('0x3d')]};return db['VtigerField']['count'](_0x1c7aed)[_0x200a('0x25')](function(_0x2f84ba){_0xe985ec[_0x200a('0x1e')]=_0x2f84ba;if(_0x46425b[_0x200a('0x33')]['includeAll']){_0x4afc40[_0x200a('0x42')]=[{'all':!![]}];}return db['VtigerField'][_0x200a('0x43')](_0x4afc40);})['then'](function(_0x530721){_0xe985ec[_0x200a('0x44')]=_0x530721;return _0xe985ec;})[_0x200a('0x25')](respondWithFilteredResult(_0x4e2bdf,_0x4afc40))['catch'](handleError(_0x4e2bdf,null));};exports[_0x200a('0x45')]=function(_0x1d2e71,_0x255e06){var _0x50e0a8={'raw':!![],'where':{'id':_0x1d2e71[_0x200a('0x46')]['id']}},_0x5134db={};_0x5134db['model']=_[_0x200a('0x34')](db[_0x200a('0x47')][_0x200a('0x2e')]);_0x5134db[_0x200a('0x33')]=_['keys'](_0x1d2e71[_0x200a('0x33')]);_0x5134db['filters']=_[_0x200a('0x35')](_0x5134db['model'],_0x5134db[_0x200a('0x33')]);_0x50e0a8['attributes']=_[_0x200a('0x35')](_0x5134db['model'],qs[_0x200a('0x36')](_0x1d2e71[_0x200a('0x33')][_0x200a('0x36')]));_0x50e0a8[_0x200a('0x37')]=_0x50e0a8[_0x200a('0x37')][_0x200a('0x38')]?_0x50e0a8[_0x200a('0x37')]:_0x5134db[_0x200a('0x32')];if(_0x1d2e71[_0x200a('0x33')][_0x200a('0x48')]){_0x50e0a8[_0x200a('0x42')]=[{'all':!![]}];}_0x50e0a8=_[_0x200a('0x40')]({},_0x50e0a8,_0x1d2e71['options']);return db[_0x200a('0x47')][_0x200a('0x49')](_0x50e0a8)[_0x200a('0x25')](handleEntityNotFound(_0x255e06,null))[_0x200a('0x25')](respondWithResult(_0x255e06,null))['catch'](handleError(_0x255e06,null));};exports[_0x200a('0x4a')]=function(_0x34fe90,_0x218eb3){return db[_0x200a('0x47')][_0x200a('0x4a')](_0x34fe90[_0x200a('0x4b')],{})['then'](respondWithResult(_0x218eb3,0xc9))[_0x200a('0x4c')](handleError(_0x218eb3,null));};exports[_0x200a('0x24')]=function(_0x59f0b5,_0x3b649){if(_0x59f0b5[_0x200a('0x4b')]['id']){delete _0x59f0b5['body']['id'];}return db[_0x200a('0x47')][_0x200a('0x49')]({'where':{'id':_0x59f0b5[_0x200a('0x46')]['id']}})[_0x200a('0x25')](handleEntityNotFound(_0x3b649,null))['then'](saveUpdates(_0x59f0b5[_0x200a('0x4b')],null))['then'](respondWithResult(_0x3b649,null))['catch'](handleError(_0x3b649,null));};exports[_0x200a('0x26')]=function(_0x134091,_0x12fc7a){return db[_0x200a('0x47')][_0x200a('0x49')]({'where':{'id':_0x134091[_0x200a('0x46')]['id']}})['then'](handleEntityNotFound(_0x12fc7a,null))['then'](removeEntity(_0x12fc7a,null))[_0x200a('0x4c')](handleError(_0x12fc7a,null));}; \ No newline at end of file +var _0x65f6=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','VtigerField','rawAttributes','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x65f6,0x77));var _0x665f=function(_0x532c54,_0x54f860){_0x532c54=_0x532c54-0x0;var _0x5887e5=_0x65f6[_0x532c54];return _0x5887e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x665f('0x0'));var zipdir=require(_0x665f('0x1'));var jsonpatch=require(_0x665f('0x2'));var rp=require(_0x665f('0x3'));var moment=require(_0x665f('0x4'));var BPromise=require(_0x665f('0x5'));var Mustache=require('mustache');var util=require(_0x665f('0x6'));var path=require('path');var sox=require(_0x665f('0x7'));var csv=require(_0x665f('0x8'));var ejs=require(_0x665f('0x9'));var fs=require('fs');var fs_extra=require(_0x665f('0xa'));var _=require('lodash');var squel=require(_0x665f('0xb'));var crypto=require(_0x665f('0xc'));var jsforce=require(_0x665f('0xd'));var deskjs=require(_0x665f('0xe'));var toCsv=require(_0x665f('0x8'));var querystring=require(_0x665f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x665f('0x10'));var as=require(_0x665f('0x11'));var hardwareService=require(_0x665f('0x12'));var logger=require(_0x665f('0x13'))(_0x665f('0x14'));var utils=require(_0x665f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x665f('0x16'));var db=require(_0x665f('0x17'))['db'];function respondWithStatusCode(_0x2b64d5,_0x4e7286){_0x4e7286=_0x4e7286||0xcc;return function(_0x2cc1f8){if(_0x2cc1f8){return _0x2b64d5[_0x665f('0x18')](_0x4e7286);}return _0x2b64d5[_0x665f('0x19')](_0x4e7286)[_0x665f('0x1a')]();};}function respondWithResult(_0x2ff680,_0x16f677){_0x16f677=_0x16f677||0xc8;return function(_0x58f48c){if(_0x58f48c){return _0x2ff680[_0x665f('0x19')](_0x16f677)[_0x665f('0x1b')](_0x58f48c);}};}function respondWithFilteredResult(_0x5ff7e0,_0x43960a){return function(_0x2fe036){if(_0x2fe036){var _0x13bb64=typeof _0x43960a[_0x665f('0x1c')]===_0x665f('0x1d')&&typeof _0x43960a[_0x665f('0x1e')]==='undefined';var _0x498c9b=_0x2fe036[_0x665f('0x1f')];var _0xfd7b35=_0x13bb64?0x0:_0x43960a[_0x665f('0x1c')];var _0x28ea1e=_0x13bb64?_0x2fe036['count']:_0x43960a[_0x665f('0x1c')]+_0x43960a[_0x665f('0x1e')];var _0x5a9715;if(_0x28ea1e>=_0x498c9b){_0x28ea1e=_0x498c9b;_0x5a9715=0xc8;}else{_0x5a9715=0xce;}_0x5ff7e0[_0x665f('0x19')](_0x5a9715);return _0x5ff7e0[_0x665f('0x20')](_0x665f('0x21'),_0xfd7b35+'-'+_0x28ea1e+'/'+_0x498c9b)[_0x665f('0x1b')](_0x2fe036);}return null;};}function patchUpdates(_0x389516){return function(_0x44afde){try{jsonpatch[_0x665f('0x22')](_0x44afde,_0x389516,!![]);}catch(_0x45b448){return BPromise[_0x665f('0x23')](_0x45b448);}return _0x44afde[_0x665f('0x24')]();};}function saveUpdates(_0x4ad07e,_0x32eb12){return function(_0x2c0370){if(_0x2c0370){return _0x2c0370[_0x665f('0x25')](_0x4ad07e)[_0x665f('0x26')](function(_0x4483af){return _0x4483af;});}return null;};}function removeEntity(_0x841de,_0x4cc8ec){return function(_0x270e36){if(_0x270e36){return _0x270e36[_0x665f('0x27')]()[_0x665f('0x26')](function(){_0x841de[_0x665f('0x19')](0xcc)[_0x665f('0x1a')]();});}};}function handleEntityNotFound(_0x9d1e8d,_0x40ff2b){return function(_0x538529){if(!_0x538529){_0x9d1e8d[_0x665f('0x18')](0x194);}return _0x538529;};}function handleError(_0x4d685c,_0x462bcd){_0x462bcd=_0x462bcd||0x1f4;return function(_0x1e2f6d){logger['error'](_0x1e2f6d[_0x665f('0x28')]);if(_0x1e2f6d['name']){delete _0x1e2f6d[_0x665f('0x29')];}_0x4d685c['status'](_0x462bcd)['send'](_0x1e2f6d);};}exports[_0x665f('0x2a')]=function(_0x5bc5a4,_0x2e8ff3){var _0x4b94f4={},_0x2bff02={},_0x3abc91={'count':0x0,'rows':[]};var _0x5b1821=_[_0x665f('0x2b')](db[_0x665f('0x2c')][_0x665f('0x2d')],function(_0x1c2cfc){return{'name':_0x1c2cfc['fieldName'],'type':_0x1c2cfc['type']['key']};});_0x2bff02['model']=_[_0x665f('0x2b')](_0x5b1821,_0x665f('0x29'));_0x2bff02['query']=_[_0x665f('0x2e')](_0x5bc5a4['query']);_0x2bff02[_0x665f('0x2f')]=_[_0x665f('0x30')](_0x2bff02[_0x665f('0x31')],_0x2bff02[_0x665f('0x32')]);_0x4b94f4['attributes']=_['intersection'](_0x2bff02[_0x665f('0x31')],qs[_0x665f('0x33')](_0x5bc5a4['query'][_0x665f('0x33')]));_0x4b94f4['attributes']=_0x4b94f4[_0x665f('0x34')][_0x665f('0x35')]?_0x4b94f4['attributes']:_0x2bff02[_0x665f('0x31')];if(!_0x5bc5a4[_0x665f('0x32')][_0x665f('0x36')](_0x665f('0x37'))){_0x4b94f4[_0x665f('0x1e')]=qs[_0x665f('0x1e')](_0x5bc5a4[_0x665f('0x32')][_0x665f('0x1e')]);_0x4b94f4[_0x665f('0x1c')]=qs[_0x665f('0x1c')](_0x5bc5a4['query'][_0x665f('0x1c')]);}_0x4b94f4['order']=qs[_0x665f('0x38')](_0x5bc5a4[_0x665f('0x32')][_0x665f('0x38')]);_0x4b94f4[_0x665f('0x39')]=qs['filters'](_['pick'](_0x5bc5a4[_0x665f('0x32')],_0x2bff02[_0x665f('0x2f')]),_0x5b1821);if(_0x5bc5a4[_0x665f('0x32')][_0x665f('0x3a')]){_0x4b94f4['where']=_[_0x665f('0x3b')](_0x4b94f4['where'],{'$or':_['map'](_0x5b1821,function(_0x2b2017){if(_0x2b2017[_0x665f('0x3c')]!=='VIRTUAL'){var _0x10b286={};_0x10b286[_0x2b2017['name']]={'$like':'%'+_0x5bc5a4[_0x665f('0x32')][_0x665f('0x3a')]+'%'};return _0x10b286;}})});}_0x4b94f4=_['merge']({},_0x4b94f4,_0x5bc5a4[_0x665f('0x3d')]);var _0x30be9d={'where':_0x4b94f4[_0x665f('0x39')]};return db[_0x665f('0x2c')]['count'](_0x30be9d)[_0x665f('0x26')](function(_0x15aeb5){_0x3abc91[_0x665f('0x1f')]=_0x15aeb5;if(_0x5bc5a4[_0x665f('0x32')]['includeAll']){_0x4b94f4[_0x665f('0x3e')]=[{'all':!![]}];}return db[_0x665f('0x2c')][_0x665f('0x3f')](_0x4b94f4);})[_0x665f('0x26')](function(_0x2232fd){_0x3abc91[_0x665f('0x40')]=_0x2232fd;return _0x3abc91;})['then'](respondWithFilteredResult(_0x2e8ff3,_0x4b94f4))[_0x665f('0x41')](handleError(_0x2e8ff3,null));};exports[_0x665f('0x42')]=function(_0x64ebb4,_0x624023){var _0x4e32b4={'raw':!![],'where':{'id':_0x64ebb4['params']['id']}},_0x576772={};_0x576772[_0x665f('0x31')]=_[_0x665f('0x2e')](db['VtigerField']['rawAttributes']);_0x576772['query']=_[_0x665f('0x2e')](_0x64ebb4['query']);_0x576772[_0x665f('0x2f')]=_['intersection'](_0x576772['model'],_0x576772[_0x665f('0x32')]);_0x4e32b4[_0x665f('0x34')]=_['intersection'](_0x576772[_0x665f('0x31')],qs['fields'](_0x64ebb4[_0x665f('0x32')][_0x665f('0x33')]));_0x4e32b4[_0x665f('0x34')]=_0x4e32b4[_0x665f('0x34')][_0x665f('0x35')]?_0x4e32b4[_0x665f('0x34')]:_0x576772['model'];if(_0x64ebb4[_0x665f('0x32')]['includeAll']){_0x4e32b4[_0x665f('0x3e')]=[{'all':!![]}];}_0x4e32b4=_['merge']({},_0x4e32b4,_0x64ebb4[_0x665f('0x3d')]);return db[_0x665f('0x2c')][_0x665f('0x43')](_0x4e32b4)[_0x665f('0x26')](handleEntityNotFound(_0x624023,null))[_0x665f('0x26')](respondWithResult(_0x624023,null))[_0x665f('0x41')](handleError(_0x624023,null));};exports['create']=function(_0x110527,_0x3df1ca){return db[_0x665f('0x2c')][_0x665f('0x44')](_0x110527['body'],{})[_0x665f('0x26')](respondWithResult(_0x3df1ca,0xc9))['catch'](handleError(_0x3df1ca,null));};exports[_0x665f('0x25')]=function(_0x359bb8,_0x5874d7){if(_0x359bb8[_0x665f('0x45')]['id']){delete _0x359bb8[_0x665f('0x45')]['id'];}return db[_0x665f('0x2c')]['find']({'where':{'id':_0x359bb8[_0x665f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5874d7,null))[_0x665f('0x26')](saveUpdates(_0x359bb8['body'],null))[_0x665f('0x26')](respondWithResult(_0x5874d7,null))[_0x665f('0x41')](handleError(_0x5874d7,null));};exports[_0x665f('0x27')]=function(_0x4714b0,_0x51077b){return db[_0x665f('0x2c')][_0x665f('0x43')]({'where':{'id':_0x4714b0[_0x665f('0x46')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x51077b,null))[_0x665f('0x26')](removeEntity(_0x51077b,null))[_0x665f('0x41')](handleError(_0x51077b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 10aa020..1c6cc40 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 _0x4e86=['exports','define','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x4e86,0x8d));var _0x64e8=function(_0x4b473f,_0x539bea){_0x4b473f=_0x4b473f-0x0;var _0x5a26fc=_0x4e86[_0x4b473f];return _0x5a26fc;};'use strict';var _=require(_0x64e8('0x0'));var util=require(_0x64e8('0x1'));var logger=require(_0x64e8('0x2'))(_0x64e8('0x3'));var moment=require('moment');var BPromise=require(_0x64e8('0x4'));var rp=require(_0x64e8('0x5'));var fs=require('fs');var path=require(_0x64e8('0x6'));var rimraf=require('rimraf');var config=require(_0x64e8('0x7'));var attributes=require(_0x64e8('0x8'));module[_0x64e8('0x9')]=function(_0x403ad2,_0x34b352){return _0x403ad2[_0x64e8('0xa')](_0x64e8('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x64e8('0xc'),'fields':[_0x64e8('0xd'),_0x64e8('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a6d=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','vtiger_unique_index','FieldId'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x3a6d,0x15f));var _0xd3a6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3a6d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd3a6('0x2'));var BPromise=require(_0xd3a6('0x3'));var rp=require(_0xd3a6('0x4'));var fs=require('fs');var path=require(_0xd3a6('0x5'));var rimraf=require(_0xd3a6('0x6'));var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x212956,_0x17b1a7){return _0x212956[_0xd3a6('0xa')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xd3a6('0xb'),'fields':['idField',_0xd3a6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 454fb23..10e4ae2 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 _0x80b9=['VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x80b9,0x1d5));var _0x980b=function(_0x5322c4,_0x5b054a){_0x5322c4=_0x5322c4-0x0;var _0x327751=_0x80b9[_0x5322c4];return _0x327751;};'use strict';var _=require('lodash');var util=require(_0x980b('0x0'));var moment=require(_0x980b('0x1'));var BPromise=require(_0x980b('0x2'));var rs=require(_0x980b('0x3'));var fs=require('fs');var Redis=require(_0x980b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x980b('0x5'));var logger=require(_0x980b('0x6'))(_0x980b('0x7'));var config=require(_0x980b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x980b('0x9')][_0x980b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b046b,_0x2248bb,_0x13882b){return new BPromise(function(_0x5e050e,_0x3519f1){return client[_0x980b('0xb')](_0x5b046b,_0x13882b)[_0x980b('0xc')](function(_0x3ee74a){logger[_0x980b('0xd')](_0x980b('0xe'),_0x2248bb,'request\x20sent');logger[_0x980b('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x2248bb,_0x980b('0x10'),JSON[_0x980b('0x11')](_0x3ee74a));if(_0x3ee74a[_0x980b('0x12')]){if(_0x3ee74a['error'][_0x980b('0x13')]===0x1f4){logger[_0x980b('0x12')]('VtigerField,\x20%s,\x20%s',_0x2248bb,_0x3ee74a['error'][_0x980b('0x14')]);return _0x3519f1(_0x3ee74a[_0x980b('0x12')][_0x980b('0x14')]);}logger['error'](_0x980b('0xe'),_0x2248bb,_0x3ee74a['error']['message']);return _0x5e050e(_0x3ee74a[_0x980b('0x12')]['message']);}else{logger[_0x980b('0xd')](_0x980b('0xe'),_0x2248bb,_0x980b('0x10'));_0x5e050e(_0x3ee74a[_0x980b('0x15')][_0x980b('0x14')]);}})[_0x980b('0x16')](function(_0x15672c){logger['error'](_0x980b('0xe'),_0x2248bb,_0x15672c);_0x3519f1(_0x15672c);});});} \ No newline at end of file +var _0xe200=['error','code','message','result','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b280d,_0x4097f8){var _0x2e51f7=function(_0x4f87a2){while(--_0x4f87a2){_0x4b280d['push'](_0x4b280d['shift']());}};_0x2e51f7(++_0x4097f8);}(_0xe200,0x18b));var _0x0e20=function(_0x598ac0,_0x43cb83){_0x598ac0=_0x598ac0-0x0;var _0x557323=_0xe200[_0x598ac0];return _0x557323;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e20('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e20('0x1'));var db=require(_0x0e20('0x2'))['db'];var utils=require(_0x0e20('0x3'));var logger=require('../../config/logger')(_0x0e20('0x4'));var config=require(_0x0e20('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0e20('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9fb423,_0x5a6d1c,_0x194a65){return new BPromise(function(_0x2bd8d1,_0x59a18c){return client['request'](_0x9fb423,_0x194a65)[_0x0e20('0x7')](function(_0x188b46){logger[_0x0e20('0x8')](_0x0e20('0x9'),_0x5a6d1c,_0x0e20('0xa'));logger['debug'](_0x0e20('0xb'),_0x5a6d1c,_0x0e20('0xa'),JSON[_0x0e20('0xc')](_0x188b46));if(_0x188b46['error']){if(_0x188b46[_0x0e20('0xd')][_0x0e20('0xe')]===0x1f4){logger[_0x0e20('0xd')](_0x0e20('0x9'),_0x5a6d1c,_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);return _0x59a18c(_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x5a6d1c,_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);return _0x2bd8d1(_0x188b46[_0x0e20('0xd')][_0x0e20('0xf')]);}else{logger[_0x0e20('0x8')](_0x0e20('0x9'),_0x5a6d1c,'request\x20sent');_0x2bd8d1(_0x188b46[_0x0e20('0x10')][_0x0e20('0xf')]);}})['catch'](function(_0x4a83d4){logger[_0x0e20('0xd')](_0x0e20('0x9'),_0x5a6d1c,_0x4a83d4);_0x59a18c(_0x4a83d4);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 134aaa0..b4e3a92 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 _0x8cb1=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x1add2d,_0x340983){var _0x5b2c32=function(_0x14e3ac){while(--_0x14e3ac){_0x1add2d['push'](_0x1add2d['shift']());}};_0x5b2c32(++_0x340983);}(_0x8cb1,0xfd));var _0x18cb=function(_0x23a43d,_0x4d825b){_0x23a43d=_0x23a43d-0x0;var _0x237807=_0x8cb1[_0x23a43d];return _0x237807;};'use strict';var multer=require(_0x18cb('0x0'));var util=require(_0x18cb('0x1'));var path=require(_0x18cb('0x2'));var timeout=require(_0x18cb('0x3'));var express=require('express');var router=express[_0x18cb('0x4')]();var fs_extra=require(_0x18cb('0x5'));var auth=require(_0x18cb('0x6'));var interaction=require(_0x18cb('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x18cb('0x8')]('/',auth[_0x18cb('0x9')](),controller[_0x18cb('0xa')]);router[_0x18cb('0x8')](_0x18cb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x18cb('0x8')](_0x18cb('0xc'),auth[_0x18cb('0x9')](),controller[_0x18cb('0xd')]);router[_0x18cb('0x8')]('/:id/fields',auth[_0x18cb('0x9')](),controller[_0x18cb('0xe')]);router[_0x18cb('0xf')]('/',auth[_0x18cb('0x9')](),controller[_0x18cb('0x10')]);router['post'](_0x18cb('0xc'),auth[_0x18cb('0x9')](),controller[_0x18cb('0x11')]);router[_0x18cb('0x12')](_0x18cb('0xb'),auth[_0x18cb('0x9')](),controller[_0x18cb('0x13')]);router[_0x18cb('0x14')](_0x18cb('0xb'),auth[_0x18cb('0x9')](),controller[_0x18cb('0x15')]);module[_0x18cb('0x16')]=router; \ No newline at end of file +var _0x7fbc=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','put','delete'];(function(_0x16889b,_0x5624ce){var _0x8bcf73=function(_0x21ca4c){while(--_0x21ca4c){_0x16889b['push'](_0x16889b['shift']());}};_0x8bcf73(++_0x5624ce);}(_0x7fbc,0x73));var _0xc7fb=function(_0x7cfbd0,_0x4d8181){_0x7cfbd0=_0x7cfbd0-0x0;var _0x273fe2=_0x7fbc[_0x7cfbd0];return _0x273fe2;};'use strict';var multer=require('multer');var util=require(_0xc7fb('0x0'));var path=require(_0xc7fb('0x1'));var timeout=require(_0xc7fb('0x2'));var express=require('express');var router=express[_0xc7fb('0x3')]();var fs_extra=require(_0xc7fb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc7fb('0x5'));var config=require(_0xc7fb('0x6'));var controller=require(_0xc7fb('0x7'));router['get']('/',auth[_0xc7fb('0x8')](),controller[_0xc7fb('0x9')]);router[_0xc7fb('0xa')](_0xc7fb('0xb'),auth[_0xc7fb('0x8')](),controller[_0xc7fb('0xc')]);router[_0xc7fb('0xa')](_0xc7fb('0xd'),auth[_0xc7fb('0x8')](),controller[_0xc7fb('0xe')]);router[_0xc7fb('0xa')]('/:id/fields',auth[_0xc7fb('0x8')](),controller[_0xc7fb('0xf')]);router['post']('/',auth[_0xc7fb('0x8')](),controller['create']);router['post'](_0xc7fb('0xd'),auth[_0xc7fb('0x8')](),controller['addConfiguration']);router[_0xc7fb('0x10')]('/:id',auth[_0xc7fb('0x8')](),controller['update']);router[_0xc7fb('0x11')](_0xc7fb('0xb'),auth[_0xc7fb('0x8')](),controller['destroy']);module[_0xc7fb('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index e708659..a1ab561 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 _0x9fe7=['newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM','password'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x9fe7,0x1df));var _0x79fe=function(_0x331641,_0x3a766b){_0x331641=_0x331641-0x0;var _0x182810=_0x9fe7[_0x331641];return _0x182810;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79fe('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x79fe('0x3')},'password':{'type':Sequelize[_0x79fe('0x2')]},'token':{'type':Sequelize[_0x79fe('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x79fe('0x4')},'authType':{'type':Sequelize[_0x79fe('0x5')](_0x79fe('0x6'),'token'),'defaultValue':_0x79fe('0x6')},'serverUrl':{'type':Sequelize[_0x79fe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x79fe('0x5')]('integrationTab',_0x79fe('0x7')),'defaultValue':_0x79fe('0x8')}}; \ No newline at end of file +var _0x326f=['integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM','password','token'];(function(_0x45ed41,_0x30682a){var _0x3afbce=function(_0x4239d4){while(--_0x4239d4){_0x45ed41['push'](_0x45ed41['shift']());}};_0x3afbce(++_0x30682a);}(_0x326f,0xd1));var _0xf326=function(_0x491142,_0xd39be3){_0x491142=_0x491142-0x0;var _0x2481b9=_0x326f[_0x491142];return _0x2481b9;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'password':{'type':Sequelize[_0xf326('0x1')]},'token':{'type':Sequelize[_0xf326('0x1')]},'remoteUri':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x3')},'authType':{'type':Sequelize[_0xf326('0x4')](_0xf326('0x5'),_0xf326('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xf326('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x4')](_0xf326('0x7'),_0xf326('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 401c90c..7fe420c 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 _0xea28=['stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','length','find','catch','create','body','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','authType','%s:%s','token','Basic\x20%s','%s/token:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x259663,_0x1123e5){var _0x3c3d35=function(_0x911d21){while(--_0x911d21){_0x259663['push'](_0x259663['shift']());}};_0x3c3d35(++_0x1123e5);}(_0xea28,0x13a));var _0x8ea2=function(_0x813f4,_0x17828d){_0x813f4=_0x813f4-0x0;var _0x4415a2=_0xea28[_0x813f4];return _0x4415a2;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];var integrations=require(_0x8ea2('0x1b'));function respondWithStatusCode(_0x10aead,_0xe47c0e){_0xe47c0e=_0xe47c0e||0xcc;return function(_0x5e662e){if(_0x5e662e){return _0x10aead[_0x8ea2('0x1c')](_0xe47c0e);}return _0x10aead['status'](_0xe47c0e)['end']();};}function respondWithResult(_0x772bad,_0x4726a7){_0x4726a7=_0x4726a7||0xc8;return function(_0x416bae){if(_0x416bae){return _0x772bad[_0x8ea2('0x1d')](_0x4726a7)[_0x8ea2('0x1e')](_0x416bae);}};}function respondWithFilteredResult(_0xbb9bd1,_0x3cff96){return function(_0x11f5e8){if(_0x11f5e8){var _0x474873=typeof _0x3cff96[_0x8ea2('0x1f')]===_0x8ea2('0x20')&&typeof _0x3cff96[_0x8ea2('0x21')]===_0x8ea2('0x20');var _0xaa8abf=_0x11f5e8[_0x8ea2('0x22')];var _0x174ef2=_0x474873?0x0:_0x3cff96[_0x8ea2('0x1f')];var _0x2a0329=_0x474873?_0x11f5e8[_0x8ea2('0x22')]:_0x3cff96[_0x8ea2('0x1f')]+_0x3cff96[_0x8ea2('0x21')];var _0x287597;if(_0x2a0329>=_0xaa8abf){_0x2a0329=_0xaa8abf;_0x287597=0xc8;}else{_0x287597=0xce;}_0xbb9bd1['status'](_0x287597);return _0xbb9bd1['set'](_0x8ea2('0x23'),_0x174ef2+'-'+_0x2a0329+'/'+_0xaa8abf)[_0x8ea2('0x1e')](_0x11f5e8);}return null;};}function patchUpdates(_0x29151a){return function(_0x5ebc04){try{jsonpatch[_0x8ea2('0x24')](_0x5ebc04,_0x29151a,!![]);}catch(_0x218bd0){return BPromise['reject'](_0x218bd0);}return _0x5ebc04[_0x8ea2('0x25')]();};}function saveUpdates(_0x283f00,_0x37229a){return function(_0x9f9548){if(_0x9f9548){return _0x9f9548[_0x8ea2('0x26')](_0x283f00)[_0x8ea2('0x27')](function(_0x199417){return _0x199417;});}return null;};}function removeEntity(_0x1e4cc9,_0x18ec34){return function(_0x4d5030){if(_0x4d5030){return _0x4d5030[_0x8ea2('0x28')]()['then'](function(){_0x1e4cc9[_0x8ea2('0x1d')](0xcc)[_0x8ea2('0x29')]();});}};}function handleEntityNotFound(_0x29b38f,_0x4e2106){return function(_0x53ed43){if(!_0x53ed43){_0x29b38f[_0x8ea2('0x1c')](0x194);}return _0x53ed43;};}function handleError(_0x4dc7bf,_0x200a49){_0x200a49=_0x200a49||0x1f4;return function(_0x4e786d){logger[_0x8ea2('0x2a')](_0x4e786d[_0x8ea2('0x2b')]);if(_0x4e786d[_0x8ea2('0x2c')]){delete _0x4e786d[_0x8ea2('0x2c')];}_0x4dc7bf['status'](_0x200a49)['send'](_0x4e786d);};}exports[_0x8ea2('0x2d')]=function(_0x4da5b3,_0x4a9875){var _0x287078={},_0x24f187={},_0x41f482={'count':0x0,'rows':[]};var _0x307c74=_[_0x8ea2('0x2e')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')],function(_0x19e868){return{'name':_0x19e868[_0x8ea2('0x31')],'type':_0x19e868['type']['key']};});_0x24f187[_0x8ea2('0x32')]=_[_0x8ea2('0x2e')](_0x307c74,'name');_0x24f187['query']=_[_0x8ea2('0x33')](_0x4da5b3['query']);_0x24f187[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x24f187['model'],_0x24f187[_0x8ea2('0x36')]);_0x287078[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x24f187['model'],qs['fields'](_0x4da5b3['query'][_0x8ea2('0x38')]));_0x287078[_0x8ea2('0x37')]=_0x287078[_0x8ea2('0x37')]['length']?_0x287078[_0x8ea2('0x37')]:_0x24f187[_0x8ea2('0x32')];if(!_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x287078[_0x8ea2('0x21')]=qs[_0x8ea2('0x21')](_0x4da5b3[_0x8ea2('0x36')]['limit']);_0x287078[_0x8ea2('0x1f')]=qs[_0x8ea2('0x1f')](_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}_0x287078['order']=qs[_0x8ea2('0x3b')](_0x4da5b3['query'][_0x8ea2('0x3b')]);_0x287078[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x4da5b3['query'],_0x24f187[_0x8ea2('0x34')]),_0x307c74);if(_0x4da5b3['query']['filter']){_0x287078[_0x8ea2('0x3c')]=_['merge'](_0x287078[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x307c74,function(_0x1c229d){if(_0x1c229d[_0x8ea2('0x3e')]!==_0x8ea2('0x3f')){var _0x4ae536={};_0x4ae536[_0x1c229d[_0x8ea2('0x2c')]]={'$like':'%'+_0x4da5b3['query'][_0x8ea2('0x40')]+'%'};return _0x4ae536;}})});}_0x287078=_[_0x8ea2('0x41')]({},_0x287078,_0x4da5b3[_0x8ea2('0x42')]);var _0x3995ff={'where':_0x287078['where']};return db[_0x8ea2('0x2f')]['count'](_0x3995ff)[_0x8ea2('0x27')](function(_0x5ba351){_0x41f482[_0x8ea2('0x22')]=_0x5ba351;if(_0x4da5b3[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x287078[_0x8ea2('0x44')]=[{'all':!![]}];}return db[_0x8ea2('0x2f')][_0x8ea2('0x45')](_0x287078);})[_0x8ea2('0x27')](function(_0x478d5c){_0x41f482['rows']=_0x478d5c;return _0x41f482;})[_0x8ea2('0x27')](respondWithFilteredResult(_0x4a9875,_0x287078))['catch'](handleError(_0x4a9875,null));};exports['show']=function(_0x59e2fa,_0x3cbc09){var _0x5d9ba0={'raw':![],'where':{'id':_0x59e2fa[_0x8ea2('0x46')]['id']}},_0x40a532={};_0x40a532[_0x8ea2('0x32')]=_[_0x8ea2('0x33')](db[_0x8ea2('0x2f')][_0x8ea2('0x30')]);_0x40a532[_0x8ea2('0x36')]=_[_0x8ea2('0x33')](_0x59e2fa['query']);_0x40a532[_0x8ea2('0x34')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],_0x40a532['query']);_0x5d9ba0[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x40a532[_0x8ea2('0x32')],qs[_0x8ea2('0x38')](_0x59e2fa[_0x8ea2('0x36')]['fields']));_0x5d9ba0[_0x8ea2('0x37')]=_0x5d9ba0[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x5d9ba0['attributes']:_0x40a532[_0x8ea2('0x32')];if(_0x59e2fa[_0x8ea2('0x36')][_0x8ea2('0x43')]){_0x5d9ba0[_0x8ea2('0x44')]=[{'all':!![]}];}_0x5d9ba0=_[_0x8ea2('0x41')]({},_0x5d9ba0,_0x59e2fa[_0x8ea2('0x42')]);return db[_0x8ea2('0x2f')][_0x8ea2('0x48')](_0x5d9ba0)[_0x8ea2('0x27')](handleEntityNotFound(_0x3cbc09,null))[_0x8ea2('0x27')](respondWithResult(_0x3cbc09,null))[_0x8ea2('0x49')](handleError(_0x3cbc09,null));};exports[_0x8ea2('0x4a')]=function(_0x220970,_0x12e81f){return db['ZendeskAccount'][_0x8ea2('0x4a')](_0x220970[_0x8ea2('0x4b')],{})[_0x8ea2('0x27')](respondWithResult(_0x12e81f,0xc9))[_0x8ea2('0x49')](handleError(_0x12e81f,null));};exports[_0x8ea2('0x26')]=function(_0x1daa25,_0x11b3ef){if(_0x1daa25[_0x8ea2('0x4b')]['id']){delete _0x1daa25['body']['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x1daa25[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x11b3ef,null))['then'](saveUpdates(_0x1daa25[_0x8ea2('0x4b')],null))[_0x8ea2('0x27')](respondWithResult(_0x11b3ef,null))[_0x8ea2('0x49')](handleError(_0x11b3ef,null));};exports['destroy']=function(_0x3d86f3,_0x315b5d){return db[_0x8ea2('0x2f')][_0x8ea2('0x48')]({'where':{'id':_0x3d86f3[_0x8ea2('0x46')]['id']}})['then'](handleEntityNotFound(_0x315b5d,null))['then'](removeEntity(_0x315b5d,null))[_0x8ea2('0x49')](handleError(_0x315b5d,null));};exports[_0x8ea2('0x4c')]=function(_0x1b8c4b,_0x5e4268,_0x18cbe9){var _0x100e29={};var _0x442dce={};var _0x54c9d7;var _0x5c6524;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1b8c4b['params']['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x5e4268,null))[_0x8ea2('0x27')](function(_0x5f56f8){if(_0x5f56f8){_0x54c9d7=_0x5f56f8;_0x442dce['model']=_[_0x8ea2('0x33')](db[_0x8ea2('0x4d')][_0x8ea2('0x30')]);_0x442dce['query']=_[_0x8ea2('0x33')](_0x1b8c4b[_0x8ea2('0x36')]);_0x442dce['filters']=_[_0x8ea2('0x35')](_0x442dce[_0x8ea2('0x32')],_0x442dce[_0x8ea2('0x36')]);_0x100e29[_0x8ea2('0x37')]=_[_0x8ea2('0x35')](_0x442dce['model'],qs['fields'](_0x1b8c4b['query'][_0x8ea2('0x38')]));_0x100e29[_0x8ea2('0x37')]=_0x100e29[_0x8ea2('0x37')][_0x8ea2('0x47')]?_0x100e29[_0x8ea2('0x37')]:_0x442dce[_0x8ea2('0x32')];_0x100e29[_0x8ea2('0x4e')]=qs['sort'](_0x1b8c4b['query']['sort']);_0x100e29[_0x8ea2('0x3c')]=qs[_0x8ea2('0x34')](_[_0x8ea2('0x3d')](_0x1b8c4b[_0x8ea2('0x36')],_0x442dce['filters']));if(_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x40')]){_0x100e29['where']=_[_0x8ea2('0x41')](_0x100e29[_0x8ea2('0x3c')],{'$or':_[_0x8ea2('0x2e')](_0x100e29[_0x8ea2('0x37')],function(_0x3de1a2){var _0x48c1de={};_0x48c1de[_0x3de1a2]={'$like':'%'+_0x1b8c4b['query']['filter']+'%'};return _0x48c1de;})});}_0x100e29=_[_0x8ea2('0x41')]({},_0x100e29,_0x1b8c4b[_0x8ea2('0x42')]);return _0x54c9d7[_0x8ea2('0x4c')](_0x100e29);}})[_0x8ea2('0x27')](function(_0x3c44ef){if(_0x3c44ef){_0x5c6524=_0x3c44ef['length'];if(!_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x39')](_0x8ea2('0x3a'))){_0x100e29[_0x8ea2('0x21')]=qs['limit'](_0x1b8c4b[_0x8ea2('0x36')]['limit']);_0x100e29[_0x8ea2('0x1f')]=qs['offset'](_0x1b8c4b[_0x8ea2('0x36')][_0x8ea2('0x1f')]);}return _0x54c9d7['getConfigurations'](_0x100e29);}})['then'](function(_0x1d0326){if(_0x1d0326){return _0x1d0326?{'count':_0x5c6524,'rows':_0x1d0326}:null;}})['then'](respondWithResult(_0x5e4268,null))[_0x8ea2('0x49')](handleError(_0x5e4268,null));};exports[_0x8ea2('0x4f')]=function(_0x1c5489,_0x23185e,_0x4dab8f){if(_0x1c5489[_0x8ea2('0x4b')]['id']){delete _0x1c5489[_0x8ea2('0x4b')]['id'];}return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x1c5489[_0x8ea2('0x46')]['id']}})[_0x8ea2('0x27')](handleEntityNotFound(_0x23185e,null))[_0x8ea2('0x27')](function(_0x3a78c9){if(_0x3a78c9){_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x51')]=_0x3a78c9['id'];_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x52')]=integrations['getSubjects'](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x54')]=integrations[_0x8ea2('0x55')](_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x53')],_0x1c5489[_0x8ea2('0x4b')][_0x8ea2('0x3e')]);return db[_0x8ea2('0x4d')]['create'](_0x1c5489[_0x8ea2('0x4b')],{'include':[{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x52')},{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x54')}]});}return null;})['then'](respondWithResult(_0x23185e,null))['catch'](handleError(_0x23185e,null));};exports['getFields']=function(_0x17f2f2,_0xe8b3ed,_0x380066){var _0x31bda0='';return db[_0x8ea2('0x2f')][_0x8ea2('0x50')]({'where':{'id':_0x17f2f2['params']['id']},'attributes':['id',_0x8ea2('0x57'),_0x8ea2('0x58'),'token','authType',_0x8ea2('0x59')]})[_0x8ea2('0x27')](handleEntityNotFound(_0xe8b3ed,null))[_0x8ea2('0x27')](function(_0x289e74){if(_0x289e74){_0x31bda0=_0x289e74[_0x8ea2('0x59')];var _0x32a8f2=_0x31bda0[_0x8ea2('0x5a')](-0x1);if(_0x32a8f2==='/'){_0x31bda0=_0x31bda0['substring'](0x0,_0x31bda0[_0x8ea2('0x5b')](_0x32a8f2));}var _0x3fa2c8={'method':_0x8ea2('0x5c'),'uri':util[_0x8ea2('0x5d')]('%s/%s',_0x31bda0,_0x8ea2('0x5e')),'json':!![]};switch(_0x289e74[_0x8ea2('0x5f')]){case _0x8ea2('0x58'):_0x3fa2c8['headers']={'Authorization':util[_0x8ea2('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0x8ea2('0x60'),_0x289e74[_0x8ea2('0x57')],_0x289e74['password']))['toString']('base64'))};break;case _0x8ea2('0x61'):_0x3fa2c8['headers']={'Authorization':util['format'](_0x8ea2('0x62'),new Buffer(util[_0x8ea2('0x5d')](_0x8ea2('0x63'),_0x289e74[_0x8ea2('0x57')],_0x289e74[_0x8ea2('0x61')]))[_0x8ea2('0x64')](_0x8ea2('0x65')))};break;default:throw new db[(_0x8ea2('0x66'))][(_0x8ea2('0x67'))](_0x8ea2('0x68'));}return rp(_0x3fa2c8);}})[_0x8ea2('0x27')](function(_0x15eab7){if(_0x15eab7){var _0x1961a9=[_0x8ea2('0x69'),'description',_0x8ea2('0x6a'),_0x8ea2('0x6b')];_[_0x8ea2('0x6c')](_0x15eab7['ticket_fields'],function(_0x1807bb){return _0x1961a9['includes'](_0x1807bb[_0x8ea2('0x3e')]);});return{'count':_0x15eab7['ticket_fields'][_0x8ea2('0x47')],'rows':_['map'](_0x15eab7[_0x8ea2('0x5e')],function(_0x165052){return{'id':_0x165052['id'],'name':_0x165052['position']>0x7?_0x165052[_0x8ea2('0x6d')]:_0x165052['type'],'custom':_0x165052[_0x8ea2('0x6e')]>0x7?!![]:![],'options':_0x165052[_0x8ea2('0x6f')]?_0x165052[_0x8ea2('0x6f')]:_0x165052[_0x8ea2('0x70')]?_0x165052[_0x8ea2('0x70')]:[]};})};}})['then'](respondWithResult(_0xe8b3ed,null))['catch'](function(_0x39d0d7){var _0x4b7e5e=_0x17f2f2[_0x8ea2('0x36')][_0x8ea2('0x71')]?0x1f4:_0x39d0d7[_0x8ea2('0x72')]||0x1f4;logger[_0x8ea2('0x2a')](_0x8ea2('0x73'),_0x8ea2('0x74'),_0x4b7e5e,JSON['stringify'](_0x39d0d7));delete _0x39d0d7['name'];if(_0x4b7e5e===0x191){_0x4b7e5e=0x190;}_0xe8b3ed['status'](_0x4b7e5e)[_0x8ea2('0x75')](_0x17f2f2['query'][_0x8ea2('0x71')]?{'message':_0x8ea2('0x76'),'statusCode':_0x39d0d7[_0x8ea2('0x72')]}:_0x39d0d7);});}; \ No newline at end of file +var _0x236c=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','index','map','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','ZendeskAccount','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','fields','order','nolimit','Subjects','getSubjects','channel','Descriptions','ZendeskConfiguration','ZendeskField','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','%s:%s','toString','Basic\x20%s','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format'];(function(_0x50406a,_0x2871ee){var _0xe06568=function(_0xa087a){while(--_0xa087a){_0x50406a['push'](_0x50406a['shift']());}};_0xe06568(++_0x2871ee);}(_0x236c,0x155));var _0xc236=function(_0x3284c6,_0x392da8){_0x3284c6=_0x3284c6-0x0;var _0x334b7d=_0x236c[_0x3284c6];return _0x334b7d;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5b9638,_0x5bce83){_0x5bce83=_0x5bce83||0xcc;return function(_0x599d36){if(_0x599d36){return _0x5b9638[_0xc236('0x18')](_0x5bce83);}return _0x5b9638[_0xc236('0x19')](_0x5bce83)[_0xc236('0x1a')]();};}function respondWithResult(_0x71bce2,_0x5052db){_0x5052db=_0x5052db||0xc8;return function(_0x13a42b){if(_0x13a42b){return _0x71bce2['status'](_0x5052db)['json'](_0x13a42b);}};}function respondWithFilteredResult(_0x9a65e8,_0x32f2fd){return function(_0x443a46){if(_0x443a46){var _0x1aeafc=typeof _0x32f2fd[_0xc236('0x1b')]==='undefined'&&typeof _0x32f2fd['limit']==='undefined';var _0x3f5884=_0x443a46[_0xc236('0x1c')];var _0x11ec65=_0x1aeafc?0x0:_0x32f2fd['offset'];var _0x13b432=_0x1aeafc?_0x443a46['count']:_0x32f2fd['offset']+_0x32f2fd[_0xc236('0x1d')];var _0x30adeb;if(_0x13b432>=_0x3f5884){_0x13b432=_0x3f5884;_0x30adeb=0xc8;}else{_0x30adeb=0xce;}_0x9a65e8[_0xc236('0x19')](_0x30adeb);return _0x9a65e8[_0xc236('0x1e')](_0xc236('0x1f'),_0x11ec65+'-'+_0x13b432+'/'+_0x3f5884)[_0xc236('0x20')](_0x443a46);}return null;};}function patchUpdates(_0x3f0e2f){return function(_0x27c96a){try{jsonpatch[_0xc236('0x21')](_0x27c96a,_0x3f0e2f,!![]);}catch(_0x32876d){return BPromise[_0xc236('0x22')](_0x32876d);}return _0x27c96a['save']();};}function saveUpdates(_0x208c3f,_0x34d73a){return function(_0x3bd41b){if(_0x3bd41b){return _0x3bd41b[_0xc236('0x23')](_0x208c3f)[_0xc236('0x24')](function(_0x21fab8){return _0x21fab8;});}return null;};}function removeEntity(_0x3a315b,_0xf921e6){return function(_0x1d65e2){if(_0x1d65e2){return _0x1d65e2[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x3a315b['status'](0xcc)[_0xc236('0x1a')]();});}};}function handleEntityNotFound(_0x21d78f,_0x356042){return function(_0x9017ec){if(!_0x9017ec){_0x21d78f['sendStatus'](0x194);}return _0x9017ec;};}function handleError(_0x42f248,_0x5da4b2){_0x5da4b2=_0x5da4b2||0x1f4;return function(_0x5351bc){logger[_0xc236('0x26')](_0x5351bc['stack']);if(_0x5351bc[_0xc236('0x27')]){delete _0x5351bc['name'];}_0x42f248[_0xc236('0x19')](_0x5da4b2)['send'](_0x5351bc);};}exports[_0xc236('0x28')]=function(_0x1d144b,_0x4f5175){var _0x5a61b5={},_0x265c8d={},_0x1fd31d={'count':0x0,'rows':[]};var _0x1f4995=_[_0xc236('0x29')](db['ZendeskAccount']['rawAttributes'],function(_0x28ffa5){return{'name':_0x28ffa5['fieldName'],'type':_0x28ffa5[_0xc236('0x2a')]['key']};});_0x265c8d[_0xc236('0x2b')]=_[_0xc236('0x29')](_0x1f4995,'name');_0x265c8d['query']=_[_0xc236('0x2c')](_0x1d144b[_0xc236('0x2d')]);_0x265c8d[_0xc236('0x2e')]=_[_0xc236('0x2f')](_0x265c8d[_0xc236('0x2b')],_0x265c8d[_0xc236('0x2d')]);_0x5a61b5[_0xc236('0x30')]=_[_0xc236('0x2f')](_0x265c8d[_0xc236('0x2b')],qs['fields'](_0x1d144b['query']['fields']));_0x5a61b5[_0xc236('0x30')]=_0x5a61b5[_0xc236('0x30')][_0xc236('0x31')]?_0x5a61b5[_0xc236('0x30')]:_0x265c8d[_0xc236('0x2b')];if(!_0x1d144b[_0xc236('0x2d')][_0xc236('0x32')]('nolimit')){_0x5a61b5[_0xc236('0x1d')]=qs[_0xc236('0x1d')](_0x1d144b[_0xc236('0x2d')]['limit']);_0x5a61b5[_0xc236('0x1b')]=qs[_0xc236('0x1b')](_0x1d144b[_0xc236('0x2d')][_0xc236('0x1b')]);}_0x5a61b5['order']=qs[_0xc236('0x33')](_0x1d144b[_0xc236('0x2d')][_0xc236('0x33')]);_0x5a61b5[_0xc236('0x34')]=qs[_0xc236('0x2e')](_[_0xc236('0x35')](_0x1d144b[_0xc236('0x2d')],_0x265c8d[_0xc236('0x2e')]),_0x1f4995);if(_0x1d144b[_0xc236('0x2d')][_0xc236('0x36')]){_0x5a61b5[_0xc236('0x34')]=_[_0xc236('0x37')](_0x5a61b5[_0xc236('0x34')],{'$or':_[_0xc236('0x29')](_0x1f4995,function(_0x12e802){if(_0x12e802[_0xc236('0x2a')]!==_0xc236('0x38')){var _0x4f5490={};_0x4f5490[_0x12e802['name']]={'$like':'%'+_0x1d144b['query']['filter']+'%'};return _0x4f5490;}})});}_0x5a61b5=_[_0xc236('0x37')]({},_0x5a61b5,_0x1d144b['options']);var _0x35905c={'where':_0x5a61b5[_0xc236('0x34')]};return db[_0xc236('0x39')][_0xc236('0x1c')](_0x35905c)[_0xc236('0x24')](function(_0x3b95ec){_0x1fd31d[_0xc236('0x1c')]=_0x3b95ec;if(_0x1d144b[_0xc236('0x2d')][_0xc236('0x3a')]){_0x5a61b5[_0xc236('0x3b')]=[{'all':!![]}];}return db[_0xc236('0x39')][_0xc236('0x3c')](_0x5a61b5);})[_0xc236('0x24')](function(_0x3df25e){_0x1fd31d[_0xc236('0x3d')]=_0x3df25e;return _0x1fd31d;})['then'](respondWithFilteredResult(_0x4f5175,_0x5a61b5))[_0xc236('0x3e')](handleError(_0x4f5175,null));};exports[_0xc236('0x3f')]=function(_0x506ba0,_0xb90a83){var _0x5b0bc5={'raw':![],'where':{'id':_0x506ba0['params']['id']}},_0x1cecc5={};_0x1cecc5[_0xc236('0x2b')]=_[_0xc236('0x2c')](db[_0xc236('0x39')]['rawAttributes']);_0x1cecc5[_0xc236('0x2d')]=_[_0xc236('0x2c')](_0x506ba0[_0xc236('0x2d')]);_0x1cecc5['filters']=_[_0xc236('0x2f')](_0x1cecc5[_0xc236('0x2b')],_0x1cecc5[_0xc236('0x2d')]);_0x5b0bc5[_0xc236('0x30')]=_[_0xc236('0x2f')](_0x1cecc5[_0xc236('0x2b')],qs['fields'](_0x506ba0[_0xc236('0x2d')]['fields']));_0x5b0bc5[_0xc236('0x30')]=_0x5b0bc5[_0xc236('0x30')][_0xc236('0x31')]?_0x5b0bc5[_0xc236('0x30')]:_0x1cecc5[_0xc236('0x2b')];if(_0x506ba0[_0xc236('0x2d')][_0xc236('0x3a')]){_0x5b0bc5['include']=[{'all':!![]}];}_0x5b0bc5=_[_0xc236('0x37')]({},_0x5b0bc5,_0x506ba0['options']);return db[_0xc236('0x39')][_0xc236('0x40')](_0x5b0bc5)['then'](handleEntityNotFound(_0xb90a83,null))[_0xc236('0x24')](respondWithResult(_0xb90a83,null))[_0xc236('0x3e')](handleError(_0xb90a83,null));};exports[_0xc236('0x41')]=function(_0x161890,_0x181dd6){return db[_0xc236('0x39')][_0xc236('0x41')](_0x161890['body'],{})['then'](respondWithResult(_0x181dd6,0xc9))[_0xc236('0x3e')](handleError(_0x181dd6,null));};exports[_0xc236('0x23')]=function(_0x510f7f,_0xcfaa44){if(_0x510f7f[_0xc236('0x42')]['id']){delete _0x510f7f[_0xc236('0x42')]['id'];}return db[_0xc236('0x39')][_0xc236('0x40')]({'where':{'id':_0x510f7f[_0xc236('0x43')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0xcfaa44,null))[_0xc236('0x24')](saveUpdates(_0x510f7f[_0xc236('0x42')],null))['then'](respondWithResult(_0xcfaa44,null))[_0xc236('0x3e')](handleError(_0xcfaa44,null));};exports[_0xc236('0x25')]=function(_0x41b7d5,_0x447a83){return db[_0xc236('0x39')][_0xc236('0x40')]({'where':{'id':_0x41b7d5[_0xc236('0x43')]['id']}})['then'](handleEntityNotFound(_0x447a83,null))[_0xc236('0x24')](removeEntity(_0x447a83,null))[_0xc236('0x3e')](handleError(_0x447a83,null));};exports[_0xc236('0x44')]=function(_0x16ff63,_0x4860d8,_0xa34c01){var _0x3e6da6={};var _0xad71ea={};var _0x2f3d08;var _0x9d81c8;return db['ZendeskAccount'][_0xc236('0x45')]({'where':{'id':_0x16ff63['params']['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x4860d8,null))[_0xc236('0x24')](function(_0x3f9e85){if(_0x3f9e85){_0x2f3d08=_0x3f9e85;_0xad71ea[_0xc236('0x2b')]=_[_0xc236('0x2c')](db['ZendeskConfiguration']['rawAttributes']);_0xad71ea[_0xc236('0x2d')]=_[_0xc236('0x2c')](_0x16ff63[_0xc236('0x2d')]);_0xad71ea[_0xc236('0x2e')]=_[_0xc236('0x2f')](_0xad71ea[_0xc236('0x2b')],_0xad71ea[_0xc236('0x2d')]);_0x3e6da6[_0xc236('0x30')]=_[_0xc236('0x2f')](_0xad71ea[_0xc236('0x2b')],qs['fields'](_0x16ff63['query'][_0xc236('0x46')]));_0x3e6da6[_0xc236('0x30')]=_0x3e6da6[_0xc236('0x30')][_0xc236('0x31')]?_0x3e6da6['attributes']:_0xad71ea[_0xc236('0x2b')];_0x3e6da6[_0xc236('0x47')]=qs['sort'](_0x16ff63[_0xc236('0x2d')][_0xc236('0x33')]);_0x3e6da6[_0xc236('0x34')]=qs[_0xc236('0x2e')](_['pick'](_0x16ff63[_0xc236('0x2d')],_0xad71ea[_0xc236('0x2e')]));if(_0x16ff63[_0xc236('0x2d')][_0xc236('0x36')]){_0x3e6da6[_0xc236('0x34')]=_[_0xc236('0x37')](_0x3e6da6[_0xc236('0x34')],{'$or':_['map'](_0x3e6da6[_0xc236('0x30')],function(_0x4c99a4){var _0x4289c5={};_0x4289c5[_0x4c99a4]={'$like':'%'+_0x16ff63[_0xc236('0x2d')][_0xc236('0x36')]+'%'};return _0x4289c5;})});}_0x3e6da6=_[_0xc236('0x37')]({},_0x3e6da6,_0x16ff63['options']);return _0x2f3d08[_0xc236('0x44')](_0x3e6da6);}})[_0xc236('0x24')](function(_0x379e99){if(_0x379e99){_0x9d81c8=_0x379e99['length'];if(!_0x16ff63[_0xc236('0x2d')][_0xc236('0x32')](_0xc236('0x48'))){_0x3e6da6[_0xc236('0x1d')]=qs[_0xc236('0x1d')](_0x16ff63[_0xc236('0x2d')]['limit']);_0x3e6da6['offset']=qs[_0xc236('0x1b')](_0x16ff63[_0xc236('0x2d')][_0xc236('0x1b')]);}return _0x2f3d08[_0xc236('0x44')](_0x3e6da6);}})[_0xc236('0x24')](function(_0x4649a3){if(_0x4649a3){return _0x4649a3?{'count':_0x9d81c8,'rows':_0x4649a3}:null;}})[_0xc236('0x24')](respondWithResult(_0x4860d8,null))['catch'](handleError(_0x4860d8,null));};exports['addConfiguration']=function(_0x4b59d3,_0x119710,_0x3c11da){if(_0x4b59d3[_0xc236('0x42')]['id']){delete _0x4b59d3[_0xc236('0x42')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x4b59d3['params']['id']}})['then'](handleEntityNotFound(_0x119710,null))[_0xc236('0x24')](function(_0x5df2ba){if(_0x5df2ba){_0x4b59d3[_0xc236('0x42')]['AccountId']=_0x5df2ba['id'];_0x4b59d3[_0xc236('0x42')][_0xc236('0x49')]=integrations[_0xc236('0x4a')](_0x4b59d3[_0xc236('0x42')][_0xc236('0x4b')],_0x4b59d3[_0xc236('0x42')][_0xc236('0x2a')]);_0x4b59d3['body'][_0xc236('0x4c')]=integrations['getDescriptions'](_0x4b59d3[_0xc236('0x42')][_0xc236('0x4b')],_0x4b59d3[_0xc236('0x42')][_0xc236('0x2a')]);return db[_0xc236('0x4d')][_0xc236('0x41')](_0x4b59d3['body'],{'include':[{'model':db[_0xc236('0x4e')],'as':_0xc236('0x49')},{'model':db['ZendeskField'],'as':_0xc236('0x4c')}]});}return null;})[_0xc236('0x24')](respondWithResult(_0x119710,null))[_0xc236('0x3e')](handleError(_0x119710,null));};exports['getFields']=function(_0x226573,_0x45fe5a,_0x5897a1){var _0x2c8f89='';return db[_0xc236('0x39')][_0xc236('0x45')]({'where':{'id':_0x226573[_0xc236('0x43')]['id']},'attributes':['id',_0xc236('0x4f'),_0xc236('0x50'),_0xc236('0x51'),_0xc236('0x52'),_0xc236('0x53')]})['then'](handleEntityNotFound(_0x45fe5a,null))[_0xc236('0x24')](function(_0x2b9fd8){if(_0x2b9fd8){_0x2c8f89=_0x2b9fd8[_0xc236('0x53')];var _0x5d395b=_0x2c8f89[_0xc236('0x54')](-0x1);if(_0x5d395b==='/'){_0x2c8f89=_0x2c8f89[_0xc236('0x55')](0x0,_0x2c8f89[_0xc236('0x56')](_0x5d395b));}var _0x4ef002={'method':'GET','uri':util[_0xc236('0x57')]('%s/%s',_0x2c8f89,_0xc236('0x58')),'json':!![]};switch(_0x2b9fd8['authType']){case _0xc236('0x50'):_0x4ef002[_0xc236('0x59')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xc236('0x5a'),_0x2b9fd8['username'],_0x2b9fd8[_0xc236('0x50')]))[_0xc236('0x5b')]('base64'))};break;case _0xc236('0x51'):_0x4ef002[_0xc236('0x59')]={'Authorization':util['format'](_0xc236('0x5c'),new Buffer(util[_0xc236('0x57')](_0xc236('0x5d'),_0x2b9fd8[_0xc236('0x4f')],_0x2b9fd8['token']))[_0xc236('0x5b')](_0xc236('0x5e')))};break;default:throw new db[(_0xc236('0x5f'))][(_0xc236('0x60'))](_0xc236('0x61'));}return rp(_0x4ef002);}})[_0xc236('0x24')](function(_0x141497){if(_0x141497){var _0x509f3b=['subject',_0xc236('0x62'),_0xc236('0x63'),_0xc236('0x64')];_[_0xc236('0x65')](_0x141497[_0xc236('0x58')],function(_0x49e417){return _0x509f3b[_0xc236('0x66')](_0x49e417[_0xc236('0x2a')]);});return{'count':_0x141497['ticket_fields']['length'],'rows':_[_0xc236('0x29')](_0x141497['ticket_fields'],function(_0x35e0d8){return{'id':_0x35e0d8['id'],'name':_0x35e0d8[_0xc236('0x67')]>0x7?_0x35e0d8[_0xc236('0x68')]:_0x35e0d8['type'],'custom':_0x35e0d8[_0xc236('0x67')]>0x7?!![]:![],'options':_0x35e0d8['system_field_options']?_0x35e0d8[_0xc236('0x69')]:_0x35e0d8[_0xc236('0x6a')]?_0x35e0d8[_0xc236('0x6a')]:[]};})};}})[_0xc236('0x24')](respondWithResult(_0x45fe5a,null))['catch'](function(_0x41c76d){var _0x22b942=_0x226573['query'][_0xc236('0x6b')]?0x1f4:_0x41c76d[_0xc236('0x6c')]||0x1f4;logger[_0xc236('0x26')](_0xc236('0x6d'),_0xc236('0x6e'),_0x22b942,JSON[_0xc236('0x6f')](_0x41c76d));delete _0x41c76d[_0xc236('0x27')];if(_0x22b942===0x191){_0x22b942=0x190;}_0x45fe5a['status'](_0x22b942)[_0xc236('0x70')](_0x226573[_0xc236('0x2d')][_0xc236('0x6b')]?{'message':_0xc236('0x71'),'statusCode':_0x41c76d['statusCode']}:_0x41c76d);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index f95ecde..6077444 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 _0xd9b3=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount'];(function(_0xb821e3,_0x3c373a){var _0x3625ef=function(_0x8bdf8c){while(--_0x8bdf8c){_0xb821e3['push'](_0xb821e3['shift']());}};_0x3625ef(++_0x3c373a);}(_0xd9b3,0xfd));var _0x3d9b=function(_0xbdd80a,_0x539de2){_0xbdd80a=_0xbdd80a-0x0;var _0x14c9d9=_0xd9b3[_0xbdd80a];return _0x14c9d9;};'use strict';var _=require(_0x3d9b('0x0'));var util=require(_0x3d9b('0x1'));var logger=require(_0x3d9b('0x2'))(_0x3d9b('0x3'));var moment=require(_0x3d9b('0x4'));var BPromise=require(_0x3d9b('0x5'));var rp=require(_0x3d9b('0x6'));var fs=require('fs');var path=require(_0x3d9b('0x7'));var rimraf=require(_0x3d9b('0x8'));var config=require(_0x3d9b('0x9'));var attributes=require(_0x3d9b('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x3d9b('0xb')]=function(_0x3c8b93,_0x30ac54){return _0x3c8b93['define'](_0x3d9b('0xc'),attributes,{'tableName':_0x3d9b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfad6=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x26b15e,_0x4cb99e){var _0xe0b7f=function(_0xada32f){while(--_0xada32f){_0x26b15e['push'](_0x26b15e['shift']());}};_0xe0b7f(++_0x4cb99e);}(_0xfad6,0xe8));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6fad('0x0'));var logger=require(_0x6fad('0x1'))(_0x6fad('0x2'));var moment=require(_0x6fad('0x3'));var BPromise=require(_0x6fad('0x4'));var rp=require(_0x6fad('0x5'));var fs=require('fs');var path=require(_0x6fad('0x6'));var rimraf=require('rimraf');var config=require(_0x6fad('0x7'));var attributes=require(_0x6fad('0x8'));var integrations=require(_0x6fad('0x9'));module[_0x6fad('0xa')]=function(_0x13d144,_0x19cb71){return _0x13d144[_0x6fad('0xb')](_0x6fad('0xc'),attributes,{'tableName':_0x6fad('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 99194b8..0e9d400 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 _0xc5bf=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowZendeskAccount','find','stringify'];(function(_0x475d5d,_0x385121){var _0x4289e6=function(_0x3cbb9f){while(--_0x3cbb9f){_0x475d5d['push'](_0x475d5d['shift']());}};_0x4289e6(++_0x385121);}(_0xc5bf,0x1ad));var _0xfc5b=function(_0x2c7b4f,_0x44eabd){_0x2c7b4f=_0x2c7b4f-0x0;var _0x17c596=_0xc5bf[_0x2c7b4f];return _0x17c596;};'use strict';var _=require('lodash');var util=require(_0xfc5b('0x0'));var moment=require('moment');var BPromise=require(_0xfc5b('0x1'));var rs=require(_0xfc5b('0x2'));var fs=require('fs');var Redis=require(_0xfc5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc5b('0x4'));var logger=require(_0xfc5b('0x5'))(_0xfc5b('0x6'));var config=require(_0xfc5b('0x7'));var jayson=require(_0xfc5b('0x8'));var client=jayson['client'][_0xfc5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c546d,_0x46a419,_0x1fde61){return new BPromise(function(_0x64d9f5,_0x1ab0d9){return client['request'](_0x4c546d,_0x1fde61)[_0xfc5b('0xa')](function(_0x28315f){logger[_0xfc5b('0xb')](_0xfc5b('0xc'),_0x46a419,_0xfc5b('0xd'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x46a419,_0xfc5b('0xd'),JSON['stringify'](_0x28315f));if(_0x28315f[_0xfc5b('0xe')]){if(_0x28315f[_0xfc5b('0xe')][_0xfc5b('0xf')]===0x1f4){logger[_0xfc5b('0xe')](_0xfc5b('0xc'),_0x46a419,_0x28315f[_0xfc5b('0xe')][_0xfc5b('0x10')]);return _0x1ab0d9(_0x28315f[_0xfc5b('0xe')]['message']);}logger['error'](_0xfc5b('0xc'),_0x46a419,_0x28315f[_0xfc5b('0xe')]['message']);return _0x64d9f5(_0x28315f[_0xfc5b('0xe')][_0xfc5b('0x10')]);}else{logger['info'](_0xfc5b('0xc'),_0x46a419,_0xfc5b('0xd'));_0x64d9f5(_0x28315f['result'][_0xfc5b('0x10')]);}})[_0xfc5b('0x11')](function(_0x14cb0c){logger[_0xfc5b('0xe')](_0xfc5b('0xc'),_0x46a419,_0x14cb0c);_0x1ab0d9(_0x14cb0c);});});}exports[_0xfc5b('0x12')]=function(_0x138592){var _0x3ab84d=this;return new Promise(function(_0x5314f9,_0x3e34ea){return db[_0xfc5b('0x13')][_0xfc5b('0x14')]({'raw':_0x138592[_0xfc5b('0x15')]?_0x138592[_0xfc5b('0x15')][_0xfc5b('0x16')]===undefined?!![]:![]:!![],'where':_0x138592[_0xfc5b('0x15')]?_0x138592[_0xfc5b('0x15')][_0xfc5b('0x17')]||null:null,'attributes':_0x138592[_0xfc5b('0x15')]?_0x138592['options'][_0xfc5b('0x18')]||null:null,'limit':_0x138592['options']?_0x138592[_0xfc5b('0x15')][_0xfc5b('0x19')]||null:null,'include':_0x138592['options']?_0x138592[_0xfc5b('0x15')][_0xfc5b('0x1a')]?_[_0xfc5b('0x1b')](_0x138592[_0xfc5b('0x15')][_0xfc5b('0x1a')],function(_0x4e9e2b){return{'model':db[_0x4e9e2b[_0xfc5b('0x1c')]],'as':_0x4e9e2b['as'],'attributes':_0x4e9e2b[_0xfc5b('0x18')],'include':_0x4e9e2b[_0xfc5b('0x1a')]?_[_0xfc5b('0x1b')](_0x4e9e2b['include'],function(_0x5ee7ee){return{'model':db[_0x5ee7ee['model']],'as':_0x5ee7ee['as'],'attributes':_0x5ee7ee[_0xfc5b('0x18')],'include':_0x5ee7ee[_0xfc5b('0x1a')]?_['map'](_0x5ee7ee[_0xfc5b('0x1a')],function(_0x10578b){return{'model':db[_0x10578b[_0xfc5b('0x1c')]],'as':_0x10578b['as'],'attributes':_0x10578b[_0xfc5b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d2a52){logger['info'](_0xfc5b('0x12'),_0x138592);logger[_0xfc5b('0x1d')](_0xfc5b('0x12'),_0x138592,JSON['stringify'](_0x1d2a52));_0x5314f9(_0x1d2a52);})['catch'](function(_0x2064a6){logger[_0xfc5b('0xe')](_0xfc5b('0x12'),_0x2064a6[_0xfc5b('0x10')],_0x138592);_0x3e34ea(_0x3ab84d[_0xfc5b('0xe')](0x1f4,_0x2064a6['message']));});});};exports[_0xfc5b('0x1e')]=function(_0x1220f1){var _0x3028da=this;return new Promise(function(_0x228040,_0x196be1){return db[_0xfc5b('0x13')][_0xfc5b('0x1f')]({'raw':_0x1220f1[_0xfc5b('0x15')]?_0x1220f1[_0xfc5b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1220f1[_0xfc5b('0x15')]?_0x1220f1[_0xfc5b('0x15')][_0xfc5b('0x17')]||null:null,'attributes':_0x1220f1[_0xfc5b('0x15')]?_0x1220f1[_0xfc5b('0x15')][_0xfc5b('0x18')]||null:null,'include':_0x1220f1[_0xfc5b('0x15')]?_0x1220f1['options']['include']?_[_0xfc5b('0x1b')](_0x1220f1[_0xfc5b('0x15')]['include'],function(_0x3925a9){return{'model':db[_0x3925a9[_0xfc5b('0x1c')]],'as':_0x3925a9['as'],'attributes':_0x3925a9[_0xfc5b('0x18')],'include':_0x3925a9[_0xfc5b('0x1a')]?_[_0xfc5b('0x1b')](_0x3925a9['include'],function(_0x206e4a){return{'model':db[_0x206e4a[_0xfc5b('0x1c')]],'as':_0x206e4a['as'],'attributes':_0x206e4a['attributes'],'include':_0x206e4a[_0xfc5b('0x1a')]?_[_0xfc5b('0x1b')](_0x206e4a[_0xfc5b('0x1a')],function(_0x40894e){return{'model':db[_0x40894e[_0xfc5b('0x1c')]],'as':_0x40894e['as'],'attributes':_0x40894e[_0xfc5b('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfc5b('0xa')](function(_0x3a823f){logger[_0xfc5b('0xb')]('ShowZendeskAccount',_0x1220f1);logger[_0xfc5b('0x1d')](_0xfc5b('0x1e'),_0x1220f1,JSON[_0xfc5b('0x20')](_0x3a823f));_0x228040(_0x3a823f);})[_0xfc5b('0x11')](function(_0x40111d){logger['error'](_0xfc5b('0x1e'),_0x40111d[_0xfc5b('0x10')],_0x1220f1);_0x196be1(_0x3028da[_0xfc5b('0xe')](0x1f4,_0x40111d['message']));});});}; \ No newline at end of file +var _0xfb65=['map','model','ShowZendeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','attributes','include'];(function(_0x27714d,_0x457b53){var _0x18e2fb=function(_0x28f1d9){while(--_0x28f1d9){_0x27714d['push'](_0x27714d['shift']());}};_0x18e2fb(++_0x457b53);}(_0xfb65,0x8c));var _0x5fb6=function(_0x2c2943,_0x385231){_0x2c2943=_0x2c2943-0x0;var _0x23a14f=_0xfb65[_0x2c2943];return _0x23a14f;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var moment=require(_0x5fb6('0x1'));var BPromise=require(_0x5fb6('0x2'));var rs=require(_0x5fb6('0x3'));var fs=require('fs');var Redis=require(_0x5fb6('0x4'));var db=require(_0x5fb6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fb6('0x6'))(_0x5fb6('0x7'));var config=require('../../config/environment');var jayson=require(_0x5fb6('0x8'));var client=jayson[_0x5fb6('0x9')][_0x5fb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d796,_0x3ef4dd,_0x4d142d){return new BPromise(function(_0x2c00c5,_0x502040){return client['request'](_0x56d796,_0x4d142d)[_0x5fb6('0xb')](function(_0x19eeb6){logger[_0x5fb6('0xc')](_0x5fb6('0xd'),_0x3ef4dd,'request\x20sent');logger[_0x5fb6('0xe')](_0x5fb6('0xf'),_0x3ef4dd,'request\x20sent',JSON[_0x5fb6('0x10')](_0x19eeb6));if(_0x19eeb6[_0x5fb6('0x11')]){if(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x12')]===0x1f4){logger[_0x5fb6('0x11')](_0x5fb6('0xd'),_0x3ef4dd,_0x19eeb6['error'][_0x5fb6('0x13')]);return _0x502040(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x13')]);}logger['error'](_0x5fb6('0xd'),_0x3ef4dd,_0x19eeb6['error'][_0x5fb6('0x13')]);return _0x2c00c5(_0x19eeb6[_0x5fb6('0x11')][_0x5fb6('0x13')]);}else{logger[_0x5fb6('0xc')](_0x5fb6('0xd'),_0x3ef4dd,_0x5fb6('0x14'));_0x2c00c5(_0x19eeb6['result'][_0x5fb6('0x13')]);}})[_0x5fb6('0x15')](function(_0x2930a7){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3ef4dd,_0x2930a7);_0x502040(_0x2930a7);});});}exports[_0x5fb6('0x16')]=function(_0x5c06fc){var _0x3b0b87=this;return new Promise(function(_0x47196b,_0x50fc16){return db[_0x5fb6('0x17')][_0x5fb6('0x18')]({'raw':_0x5c06fc['options']?_0x5c06fc['options'][_0x5fb6('0x19')]===undefined?!![]:![]:!![],'where':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1b')]||null:null,'attributes':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1c')]||null:null,'limit':_0x5c06fc['options']?_0x5c06fc[_0x5fb6('0x1a')]['limit']||null:null,'include':_0x5c06fc[_0x5fb6('0x1a')]?_0x5c06fc[_0x5fb6('0x1a')][_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x5c06fc['options'][_0x5fb6('0x1d')],function(_0x47cec9){return{'model':db[_0x47cec9['model']],'as':_0x47cec9['as'],'attributes':_0x47cec9[_0x5fb6('0x1c')],'include':_0x47cec9['include']?_[_0x5fb6('0x1e')](_0x47cec9[_0x5fb6('0x1d')],function(_0x4fa1e0){return{'model':db[_0x4fa1e0[_0x5fb6('0x1f')]],'as':_0x4fa1e0['as'],'attributes':_0x4fa1e0['attributes'],'include':_0x4fa1e0['include']?_[_0x5fb6('0x1e')](_0x4fa1e0[_0x5fb6('0x1d')],function(_0x12701d){return{'model':db[_0x12701d[_0x5fb6('0x1f')]],'as':_0x12701d['as'],'attributes':_0x12701d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fb6('0xb')](function(_0x309bc0){logger[_0x5fb6('0xc')]('GetZendeskAccount',_0x5c06fc);logger[_0x5fb6('0xe')](_0x5fb6('0x16'),_0x5c06fc,JSON[_0x5fb6('0x10')](_0x309bc0));_0x47196b(_0x309bc0);})['catch'](function(_0x68b491){logger[_0x5fb6('0x11')](_0x5fb6('0x16'),_0x68b491['message'],_0x5c06fc);_0x50fc16(_0x3b0b87[_0x5fb6('0x11')](0x1f4,_0x68b491[_0x5fb6('0x13')]));});});};exports[_0x5fb6('0x20')]=function(_0x52ea14){var _0x315b08=this;return new Promise(function(_0x5f27fc,_0x349dd1){return db[_0x5fb6('0x17')][_0x5fb6('0x21')]({'raw':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14['options'][_0x5fb6('0x19')]===undefined?!![]:![]:!![],'where':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1b')]||null:null,'attributes':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1c')]||null:null,'include':_0x52ea14[_0x5fb6('0x1a')]?_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x52ea14[_0x5fb6('0x1a')][_0x5fb6('0x1d')],function(_0x306964){return{'model':db[_0x306964['model']],'as':_0x306964['as'],'attributes':_0x306964['attributes'],'include':_0x306964['include']?_[_0x5fb6('0x1e')](_0x306964['include'],function(_0x251bb7){return{'model':db[_0x251bb7['model']],'as':_0x251bb7['as'],'attributes':_0x251bb7[_0x5fb6('0x1c')],'include':_0x251bb7[_0x5fb6('0x1d')]?_[_0x5fb6('0x1e')](_0x251bb7[_0x5fb6('0x1d')],function(_0x51d501){return{'model':db[_0x51d501[_0x5fb6('0x1f')]],'as':_0x51d501['as'],'attributes':_0x51d501[_0x5fb6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34b553){logger[_0x5fb6('0xc')]('ShowZendeskAccount',_0x52ea14);logger[_0x5fb6('0xe')](_0x5fb6('0x20'),_0x52ea14,JSON[_0x5fb6('0x10')](_0x34b553));_0x5f27fc(_0x34b553);})['catch'](function(_0x5bfb54){logger[_0x5fb6('0x11')](_0x5fb6('0x20'),_0x5bfb54[_0x5fb6('0x13')],_0x52ea14);_0x349dd1(_0x315b08['error'](0x1f4,_0x5bfb54[_0x5fb6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index fe18ac6..1c15d1f 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x2361dd,_0x42ccf3){var _0x179770=function(_0x3beeb8){while(--_0x3beeb8){_0x2361dd['push'](_0x2361dd['shift']());}};_0x179770(++_0x42ccf3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0xb10b[_0x2a276d];return _0x2914cd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4024=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/fields','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x4024,0x89));var _0x4402=function(_0xd7a51f,_0x1583cc){_0xd7a51f=_0xd7a51f-0x0;var _0x235558=_0x4024[_0xd7a51f];return _0x235558;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x4402('0x9')]('/:id/subjects',auth[_0x4402('0x7')](),controller['getSubjects']);router[_0x4402('0x9')]('/:id/descriptions',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['get'](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0xd')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xf')](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0x10')]);router[_0x4402('0x11')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x15')]);module[_0x4402('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9d0ef8c..155076d 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 _0xec50=['STRING','sequelize','exports'];(function(_0x3c4f42,_0x1a45dd){var _0x46addb=function(_0x4fd25c){while(--_0x4fd25c){_0x3c4f42['push'](_0x3c4f42['shift']());}};_0x46addb(++_0x1a45dd);}(_0xec50,0xf7));var _0x0ec5=function(_0xcff8d1,_0x36bb26){_0xcff8d1=_0xcff8d1-0x0;var _0x201167=_0xec50[_0xcff8d1];return _0x201167;};'use strict';var Sequelize=require(_0x0ec5('0x0'));module[_0x0ec5('0x1')]={'name':{'type':Sequelize[_0x0ec5('0x2')]},'description':{'type':Sequelize[_0x0ec5('0x2')]}}; \ No newline at end of file +var _0xbc6a=['sequelize','exports','STRING'];(function(_0x47fbb0,_0x39af12){var _0x2c1a37=function(_0x142376){while(--_0x142376){_0x47fbb0['push'](_0x47fbb0['shift']());}};_0x2c1a37(++_0x39af12);}(_0xbc6a,0x9c));var _0xabc6=function(_0x1d03e2,_0x355bac){_0x1d03e2=_0x1d03e2-0x0;var _0x11e4cd=_0xbc6a[_0x1d03e2];return _0x11e4cd;};'use strict';var Sequelize=require(_0xabc6('0x0'));module[_0xabc6('0x1')]={'name':{'type':Sequelize[_0xabc6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index aee1bac..0c6d3e5 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 _0x3bfc=['getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','send','index','ZendeskConfiguration','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','include','create','body','catch','find','destroy'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x3bfc,0x10f));var _0xc3bf=function(_0x469fc4,_0x427a80){_0x469fc4=_0x469fc4-0x0;var _0x11f6d4=_0x3bfc[_0x469fc4];return _0x11f6d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3bf('0x0'));var zipdir=require(_0xc3bf('0x1'));var jsonpatch=require(_0xc3bf('0x2'));var rp=require(_0xc3bf('0x3'));var moment=require('moment');var BPromise=require(_0xc3bf('0x4'));var Mustache=require(_0xc3bf('0x5'));var util=require(_0xc3bf('0x6'));var path=require(_0xc3bf('0x7'));var sox=require(_0xc3bf('0x8'));var csv=require('to-csv');var ejs=require(_0xc3bf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3bf('0xa'));var squel=require(_0xc3bf('0xb'));var crypto=require('crypto');var jsforce=require(_0xc3bf('0xc'));var deskjs=require(_0xc3bf('0xd'));var toCsv=require(_0xc3bf('0xe'));var querystring=require(_0xc3bf('0xf'));var Papa=require(_0xc3bf('0x10'));var Redis=require(_0xc3bf('0x11'));var authService=require(_0xc3bf('0x12'));var qs=require(_0xc3bf('0x13'));var as=require(_0xc3bf('0x14'));var hardwareService=require(_0xc3bf('0x15'));var logger=require(_0xc3bf('0x16'))(_0xc3bf('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc3bf('0x18'));var db=require(_0xc3bf('0x19'))['db'];function respondWithStatusCode(_0x315c13,_0x1d26a8){_0x1d26a8=_0x1d26a8||0xcc;return function(_0x1be25f){if(_0x1be25f){return _0x315c13[_0xc3bf('0x1a')](_0x1d26a8);}return _0x315c13[_0xc3bf('0x1b')](_0x1d26a8)[_0xc3bf('0x1c')]();};}function respondWithResult(_0x2b6b63,_0x49ef02){_0x49ef02=_0x49ef02||0xc8;return function(_0x41057e){if(_0x41057e){return _0x2b6b63[_0xc3bf('0x1b')](_0x49ef02)[_0xc3bf('0x1d')](_0x41057e);}};}function respondWithFilteredResult(_0x378ab2,_0x3f19a8){return function(_0xbf86f7){if(_0xbf86f7){var _0x308fa2=typeof _0x3f19a8[_0xc3bf('0x1e')]===_0xc3bf('0x1f')&&typeof _0x3f19a8[_0xc3bf('0x20')]===_0xc3bf('0x1f');var _0x311e60=_0xbf86f7[_0xc3bf('0x21')];var _0xef1bcc=_0x308fa2?0x0:_0x3f19a8[_0xc3bf('0x1e')];var _0x88b586=_0x308fa2?_0xbf86f7[_0xc3bf('0x21')]:_0x3f19a8[_0xc3bf('0x1e')]+_0x3f19a8[_0xc3bf('0x20')];var _0x465cd9;if(_0x88b586>=_0x311e60){_0x88b586=_0x311e60;_0x465cd9=0xc8;}else{_0x465cd9=0xce;}_0x378ab2['status'](_0x465cd9);return _0x378ab2[_0xc3bf('0x22')](_0xc3bf('0x23'),_0xef1bcc+'-'+_0x88b586+'/'+_0x311e60)[_0xc3bf('0x1d')](_0xbf86f7);}return null;};}function patchUpdates(_0x3c0545){return function(_0x454f62){try{jsonpatch[_0xc3bf('0x24')](_0x454f62,_0x3c0545,!![]);}catch(_0x241eb3){return BPromise[_0xc3bf('0x25')](_0x241eb3);}return _0x454f62[_0xc3bf('0x26')]();};}function saveUpdates(_0x461c64,_0x277825){return function(_0xe7c1df){if(_0xe7c1df){return _0xe7c1df['update'](_0x461c64)[_0xc3bf('0x27')](function(_0x38aed7){return _0x38aed7;});}return null;};}function removeEntity(_0x1554c3,_0x32dd60){return function(_0xe9c45e){if(_0xe9c45e){return _0xe9c45e['destroy']()[_0xc3bf('0x27')](function(){_0x1554c3[_0xc3bf('0x1b')](0xcc)[_0xc3bf('0x1c')]();});}};}function handleEntityNotFound(_0x1b98eb,_0x22ab44){return function(_0x28bfbe){if(!_0x28bfbe){_0x1b98eb[_0xc3bf('0x1a')](0x194);}return _0x28bfbe;};}function handleError(_0x197adc,_0x623fe8){_0x623fe8=_0x623fe8||0x1f4;return function(_0x414369){logger['error'](_0x414369[_0xc3bf('0x28')]);if(_0x414369['name']){delete _0x414369['name'];}_0x197adc[_0xc3bf('0x1b')](_0x623fe8)[_0xc3bf('0x29')](_0x414369);};}exports[_0xc3bf('0x2a')]=function(_0x255bfa,_0x49d42e){var _0x9368ea={},_0x2a16f4={},_0x56c099={'count':0x0,'rows':[]};var _0x3b6db2=_['map'](db[_0xc3bf('0x2b')]['rawAttributes'],function(_0x56ed2e){return{'name':_0x56ed2e[_0xc3bf('0x2c')],'type':_0x56ed2e['type'][_0xc3bf('0x2d')]};});_0x2a16f4[_0xc3bf('0x2e')]=_[_0xc3bf('0x2f')](_0x3b6db2,_0xc3bf('0x30'));_0x2a16f4[_0xc3bf('0x31')]=_[_0xc3bf('0x32')](_0x255bfa[_0xc3bf('0x31')]);_0x2a16f4[_0xc3bf('0x33')]=_[_0xc3bf('0x34')](_0x2a16f4['model'],_0x2a16f4[_0xc3bf('0x31')]);_0x9368ea[_0xc3bf('0x35')]=_[_0xc3bf('0x34')](_0x2a16f4[_0xc3bf('0x2e')],qs[_0xc3bf('0x36')](_0x255bfa[_0xc3bf('0x31')][_0xc3bf('0x36')]));_0x9368ea[_0xc3bf('0x35')]=_0x9368ea['attributes'][_0xc3bf('0x37')]?_0x9368ea[_0xc3bf('0x35')]:_0x2a16f4['model'];if(!_0x255bfa[_0xc3bf('0x31')]['hasOwnProperty'](_0xc3bf('0x38'))){_0x9368ea[_0xc3bf('0x20')]=qs[_0xc3bf('0x20')](_0x255bfa[_0xc3bf('0x31')][_0xc3bf('0x20')]);_0x9368ea[_0xc3bf('0x1e')]=qs[_0xc3bf('0x1e')](_0x255bfa[_0xc3bf('0x31')][_0xc3bf('0x1e')]);}_0x9368ea[_0xc3bf('0x39')]=qs[_0xc3bf('0x3a')](_0x255bfa[_0xc3bf('0x31')][_0xc3bf('0x3a')]);_0x9368ea[_0xc3bf('0x3b')]=qs[_0xc3bf('0x33')](_[_0xc3bf('0x3c')](_0x255bfa[_0xc3bf('0x31')],_0x2a16f4[_0xc3bf('0x33')]),_0x3b6db2);if(_0x255bfa[_0xc3bf('0x31')][_0xc3bf('0x3d')]){_0x9368ea[_0xc3bf('0x3b')]=_[_0xc3bf('0x3e')](_0x9368ea[_0xc3bf('0x3b')],{'$or':_[_0xc3bf('0x2f')](_0x3b6db2,function(_0x4b51d4){if(_0x4b51d4[_0xc3bf('0x3f')]!==_0xc3bf('0x40')){var _0xcb92f0={};_0xcb92f0[_0x4b51d4[_0xc3bf('0x30')]]={'$like':'%'+_0x255bfa[_0xc3bf('0x31')][_0xc3bf('0x3d')]+'%'};return _0xcb92f0;}})});}_0x9368ea=_[_0xc3bf('0x3e')]({},_0x9368ea,_0x255bfa[_0xc3bf('0x41')]);var _0x561eb9={'where':_0x9368ea[_0xc3bf('0x3b')]};return db[_0xc3bf('0x2b')][_0xc3bf('0x21')](_0x561eb9)[_0xc3bf('0x27')](function(_0x5c57f7){_0x56c099[_0xc3bf('0x21')]=_0x5c57f7;if(_0x255bfa['query'][_0xc3bf('0x42')]){_0x9368ea['include']=[{'all':!![]}];}return db[_0xc3bf('0x2b')][_0xc3bf('0x43')](_0x9368ea);})[_0xc3bf('0x27')](function(_0x4ad1ef){_0x56c099[_0xc3bf('0x44')]=_0x4ad1ef;return _0x56c099;})['then'](respondWithFilteredResult(_0x49d42e,_0x9368ea))['catch'](handleError(_0x49d42e,null));};exports['show']=function(_0x27be83,_0x2432f6){var _0xeda5b7={'raw':![],'where':{'id':_0x27be83[_0xc3bf('0x45')]['id']}},_0x2d196d={};_0x2d196d[_0xc3bf('0x2e')]=_[_0xc3bf('0x32')](db[_0xc3bf('0x2b')][_0xc3bf('0x46')]);_0x2d196d['query']=_[_0xc3bf('0x32')](_0x27be83['query']);_0x2d196d[_0xc3bf('0x33')]=_[_0xc3bf('0x34')](_0x2d196d[_0xc3bf('0x2e')],_0x2d196d['query']);_0xeda5b7[_0xc3bf('0x35')]=_[_0xc3bf('0x34')](_0x2d196d[_0xc3bf('0x2e')],qs[_0xc3bf('0x36')](_0x27be83[_0xc3bf('0x31')]['fields']));_0xeda5b7[_0xc3bf('0x35')]=_0xeda5b7['attributes'][_0xc3bf('0x37')]?_0xeda5b7[_0xc3bf('0x35')]:_0x2d196d[_0xc3bf('0x2e')];if(_0x27be83[_0xc3bf('0x31')][_0xc3bf('0x42')]){_0xeda5b7[_0xc3bf('0x47')]=[{'all':!![]}];}_0xeda5b7=_['merge']({},_0xeda5b7,_0x27be83[_0xc3bf('0x41')]);return db['ZendeskConfiguration']['find'](_0xeda5b7)['then'](handleEntityNotFound(_0x2432f6,null))[_0xc3bf('0x27')](respondWithResult(_0x2432f6,null))['catch'](handleError(_0x2432f6,null));};exports[_0xc3bf('0x48')]=function(_0x2969c8,_0x3c8139){return db[_0xc3bf('0x2b')][_0xc3bf('0x48')](_0x2969c8[_0xc3bf('0x49')],{})[_0xc3bf('0x27')](respondWithResult(_0x3c8139,0xc9))[_0xc3bf('0x4a')](handleError(_0x3c8139,null));};exports['update']=function(_0x5e407f,_0x5440ba){if(_0x5e407f[_0xc3bf('0x49')]['id']){delete _0x5e407f[_0xc3bf('0x49')]['id'];}return db[_0xc3bf('0x2b')][_0xc3bf('0x4b')]({'where':{'id':_0x5e407f[_0xc3bf('0x45')]['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x5440ba,null))[_0xc3bf('0x27')](saveUpdates(_0x5e407f[_0xc3bf('0x49')],null))[_0xc3bf('0x27')](respondWithResult(_0x5440ba,null))[_0xc3bf('0x4a')](handleError(_0x5440ba,null));};exports[_0xc3bf('0x4c')]=function(_0x352b59,_0x11f89b){return db[_0xc3bf('0x2b')]['find']({'where':{'id':_0x352b59['params']['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x11f89b,null))['then'](removeEntity(_0x11f89b,null))['catch'](handleError(_0x11f89b,null));};exports[_0xc3bf('0x4d')]=function(_0x2fb254,_0x7f97f3,_0x1f905f){var _0x3690fd={};var _0x531253={};var _0x5725cc;var _0x24dba9;return db[_0xc3bf('0x2b')][_0xc3bf('0x4e')]({'where':{'id':_0x2fb254[_0xc3bf('0x45')]['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x7f97f3,null))[_0xc3bf('0x27')](function(_0x3782c8){if(_0x3782c8){_0x5725cc=_0x3782c8;_0x531253[_0xc3bf('0x2e')]=_[_0xc3bf('0x32')](db[_0xc3bf('0x4f')][_0xc3bf('0x46')]);_0x531253['query']=_['keys'](_0x2fb254[_0xc3bf('0x31')]);_0x531253[_0xc3bf('0x33')]=_[_0xc3bf('0x34')](_0x531253[_0xc3bf('0x2e')],_0x531253[_0xc3bf('0x31')]);_0x3690fd[_0xc3bf('0x35')]=_[_0xc3bf('0x34')](_0x531253[_0xc3bf('0x2e')],qs['fields'](_0x2fb254[_0xc3bf('0x31')]['fields']));_0x3690fd[_0xc3bf('0x35')]=_0x3690fd['attributes'][_0xc3bf('0x37')]?_0x3690fd['attributes']:_0x531253[_0xc3bf('0x2e')];_0x3690fd[_0xc3bf('0x39')]=qs['sort'](_0x2fb254[_0xc3bf('0x31')]['sort']);_0x3690fd[_0xc3bf('0x3b')]=qs['filters'](_[_0xc3bf('0x3c')](_0x2fb254['query'],_0x531253[_0xc3bf('0x33')]));if(_0x2fb254[_0xc3bf('0x31')]['filter']){_0x3690fd['where']=_[_0xc3bf('0x3e')](_0x3690fd[_0xc3bf('0x3b')],{'$or':_[_0xc3bf('0x2f')](_0x3690fd[_0xc3bf('0x35')],function(_0x3c2b25){var _0x37ea23={};_0x37ea23[_0x3c2b25]={'$like':'%'+_0x2fb254[_0xc3bf('0x31')][_0xc3bf('0x3d')]+'%'};return _0x37ea23;})});}_0x3690fd=_['merge']({},_0x3690fd,_0x2fb254[_0xc3bf('0x41')]);return _0x5725cc[_0xc3bf('0x4d')](_0x3690fd);}})[_0xc3bf('0x27')](function(_0x1fbad8){if(_0x1fbad8){_0x24dba9=_0x1fbad8[_0xc3bf('0x37')];if(!_0x2fb254['query'][_0xc3bf('0x50')]('nolimit')){_0x3690fd[_0xc3bf('0x20')]=qs[_0xc3bf('0x20')](_0x2fb254[_0xc3bf('0x31')][_0xc3bf('0x20')]);_0x3690fd['offset']=qs[_0xc3bf('0x1e')](_0x2fb254['query'][_0xc3bf('0x1e')]);}return _0x5725cc[_0xc3bf('0x4d')](_0x3690fd);}})['then'](function(_0xa25833){if(_0xa25833){return _0xa25833?{'count':_0x24dba9,'rows':_0xa25833}:null;}})['then'](respondWithResult(_0x7f97f3,null))['catch'](handleError(_0x7f97f3,null));};exports['getSubjects']=function(_0xae513d,_0x6f6c14,_0xe67c4c){var _0x1cf514={};var _0x1b1af={};var _0x207788;var _0x6546ca;return db[_0xc3bf('0x2b')][_0xc3bf('0x4e')]({'where':{'id':_0xae513d[_0xc3bf('0x45')]['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x6f6c14,null))['then'](function(_0x45de9c){if(_0x45de9c){_0x207788=_0x45de9c;_0x1b1af['model']=_[_0xc3bf('0x32')](db[_0xc3bf('0x4f')][_0xc3bf('0x46')]);_0x1b1af[_0xc3bf('0x31')]=_[_0xc3bf('0x32')](_0xae513d[_0xc3bf('0x31')]);_0x1b1af[_0xc3bf('0x33')]=_['intersection'](_0x1b1af[_0xc3bf('0x2e')],_0x1b1af['query']);_0x1cf514[_0xc3bf('0x35')]=_[_0xc3bf('0x34')](_0x1b1af['model'],qs['fields'](_0xae513d[_0xc3bf('0x31')][_0xc3bf('0x36')]));_0x1cf514['attributes']=_0x1cf514[_0xc3bf('0x35')][_0xc3bf('0x37')]?_0x1cf514['attributes']:_0x1b1af['model'];_0x1cf514[_0xc3bf('0x39')]=qs[_0xc3bf('0x3a')](_0xae513d[_0xc3bf('0x31')][_0xc3bf('0x3a')]);_0x1cf514['where']=qs[_0xc3bf('0x33')](_['pick'](_0xae513d['query'],_0x1b1af[_0xc3bf('0x33')]));if(_0xae513d[_0xc3bf('0x31')][_0xc3bf('0x3d')]){_0x1cf514[_0xc3bf('0x3b')]=_[_0xc3bf('0x3e')](_0x1cf514['where'],{'$or':_[_0xc3bf('0x2f')](_0x1cf514[_0xc3bf('0x35')],function(_0x34058e){var _0x38ef0b={};_0x38ef0b[_0x34058e]={'$like':'%'+_0xae513d['query'][_0xc3bf('0x3d')]+'%'};return _0x38ef0b;})});}_0x1cf514=_[_0xc3bf('0x3e')]({},_0x1cf514,_0xae513d[_0xc3bf('0x41')]);return _0x207788[_0xc3bf('0x51')](_0x1cf514);}})[_0xc3bf('0x27')](function(_0x41abb3){if(_0x41abb3){_0x6546ca=_0x41abb3[_0xc3bf('0x37')];if(!_0xae513d[_0xc3bf('0x31')][_0xc3bf('0x50')]('nolimit')){_0x1cf514[_0xc3bf('0x20')]=qs['limit'](_0xae513d[_0xc3bf('0x31')]['limit']);_0x1cf514[_0xc3bf('0x1e')]=qs[_0xc3bf('0x1e')](_0xae513d[_0xc3bf('0x31')][_0xc3bf('0x1e')]);}return _0x207788['getSubjects'](_0x1cf514);}})[_0xc3bf('0x27')](function(_0x3c9615){if(_0x3c9615){return _0x3c9615?{'count':_0x6546ca,'rows':_0x3c9615}:null;}})[_0xc3bf('0x27')](respondWithResult(_0x6f6c14,null))[_0xc3bf('0x4a')](handleError(_0x6f6c14,null));};exports['getDescriptions']=function(_0x585e60,_0x49d763,_0x4cfaa5){var _0x4d2b4a={};var _0x37638b={};var _0x18b331;var _0x529ec9;return db[_0xc3bf('0x2b')]['findOne']({'where':{'id':_0x585e60[_0xc3bf('0x45')]['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x49d763,null))[_0xc3bf('0x27')](function(_0x15353c){if(_0x15353c){_0x18b331=_0x15353c;_0x37638b[_0xc3bf('0x2e')]=_['keys'](db[_0xc3bf('0x4f')][_0xc3bf('0x46')]);_0x37638b[_0xc3bf('0x31')]=_[_0xc3bf('0x32')](_0x585e60[_0xc3bf('0x31')]);_0x37638b[_0xc3bf('0x33')]=_[_0xc3bf('0x34')](_0x37638b[_0xc3bf('0x2e')],_0x37638b[_0xc3bf('0x31')]);_0x4d2b4a[_0xc3bf('0x35')]=_['intersection'](_0x37638b[_0xc3bf('0x2e')],qs[_0xc3bf('0x36')](_0x585e60[_0xc3bf('0x31')]['fields']));_0x4d2b4a[_0xc3bf('0x35')]=_0x4d2b4a['attributes'][_0xc3bf('0x37')]?_0x4d2b4a['attributes']:_0x37638b[_0xc3bf('0x2e')];_0x4d2b4a[_0xc3bf('0x39')]=qs['sort'](_0x585e60[_0xc3bf('0x31')][_0xc3bf('0x3a')]);_0x4d2b4a[_0xc3bf('0x3b')]=qs[_0xc3bf('0x33')](_[_0xc3bf('0x3c')](_0x585e60[_0xc3bf('0x31')],_0x37638b['filters']));if(_0x585e60[_0xc3bf('0x31')][_0xc3bf('0x3d')]){_0x4d2b4a[_0xc3bf('0x3b')]=_[_0xc3bf('0x3e')](_0x4d2b4a[_0xc3bf('0x3b')],{'$or':_[_0xc3bf('0x2f')](_0x4d2b4a[_0xc3bf('0x35')],function(_0x882512){var _0x5ac6b={};_0x5ac6b[_0x882512]={'$like':'%'+_0x585e60['query'][_0xc3bf('0x3d')]+'%'};return _0x5ac6b;})});}_0x4d2b4a=_[_0xc3bf('0x3e')]({},_0x4d2b4a,_0x585e60['options']);return _0x18b331[_0xc3bf('0x52')](_0x4d2b4a);}})[_0xc3bf('0x27')](function(_0x2a9135){if(_0x2a9135){_0x529ec9=_0x2a9135[_0xc3bf('0x37')];if(!_0x585e60['query'][_0xc3bf('0x50')]('nolimit')){_0x4d2b4a['limit']=qs[_0xc3bf('0x20')](_0x585e60[_0xc3bf('0x31')][_0xc3bf('0x20')]);_0x4d2b4a[_0xc3bf('0x1e')]=qs[_0xc3bf('0x1e')](_0x585e60[_0xc3bf('0x31')][_0xc3bf('0x1e')]);}return _0x18b331[_0xc3bf('0x52')](_0x4d2b4a);}})[_0xc3bf('0x27')](function(_0x58ffdf){if(_0x58ffdf){return _0x58ffdf?{'count':_0x529ec9,'rows':_0x58ffdf}:null;}})[_0xc3bf('0x27')](respondWithResult(_0x49d763,null))[_0xc3bf('0x4a')](handleError(_0x49d763,null));};exports[_0xc3bf('0x53')]=function(_0xec631b,_0x11ef32,_0x5caf58){var _0x22e701={};var _0x46214b={};var _0x556a9f;var _0x54feb1;return db[_0xc3bf('0x2b')][_0xc3bf('0x4e')]({'where':{'id':_0xec631b[_0xc3bf('0x45')]['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x11ef32,null))[_0xc3bf('0x27')](function(_0x2887b5){if(_0x2887b5){_0x556a9f=_0x2887b5;_0x46214b[_0xc3bf('0x2e')]=_[_0xc3bf('0x32')](db[_0xc3bf('0x54')]['rawAttributes']);_0x46214b[_0xc3bf('0x31')]=_[_0xc3bf('0x32')](_0xec631b[_0xc3bf('0x31')]);_0x46214b[_0xc3bf('0x33')]=_[_0xc3bf('0x34')](_0x46214b[_0xc3bf('0x2e')],_0x46214b[_0xc3bf('0x31')]);_0x22e701['attributes']=_['intersection'](_0x46214b[_0xc3bf('0x2e')],qs[_0xc3bf('0x36')](_0xec631b[_0xc3bf('0x31')][_0xc3bf('0x36')]));_0x22e701[_0xc3bf('0x35')]=_0x22e701[_0xc3bf('0x35')][_0xc3bf('0x37')]?_0x22e701['attributes']:_0x46214b[_0xc3bf('0x2e')];_0x22e701['order']=qs['sort'](_0xec631b[_0xc3bf('0x31')]['sort']);_0x22e701[_0xc3bf('0x3b')]=qs[_0xc3bf('0x33')](_[_0xc3bf('0x3c')](_0xec631b[_0xc3bf('0x31')],_0x46214b['filters']));if(_0xec631b['query']['filter']){_0x22e701[_0xc3bf('0x3b')]=_[_0xc3bf('0x3e')](_0x22e701[_0xc3bf('0x3b')],{'$or':_[_0xc3bf('0x2f')](_0x22e701[_0xc3bf('0x35')],function(_0x414376){var _0x51202d={};_0x51202d[_0x414376]={'$like':'%'+_0xec631b['query'][_0xc3bf('0x3d')]+'%'};return _0x51202d;})});}_0x22e701=_[_0xc3bf('0x3e')]({},_0x22e701,_0xec631b[_0xc3bf('0x41')]);return _0x556a9f[_0xc3bf('0x53')](_0x22e701);}})['then'](function(_0x181d35){if(_0x181d35){_0x54feb1=_0x181d35[_0xc3bf('0x37')];if(!_0xec631b[_0xc3bf('0x31')][_0xc3bf('0x50')](_0xc3bf('0x38'))){_0x22e701['limit']=qs[_0xc3bf('0x20')](_0xec631b[_0xc3bf('0x31')][_0xc3bf('0x20')]);_0x22e701['offset']=qs[_0xc3bf('0x1e')](_0xec631b[_0xc3bf('0x31')][_0xc3bf('0x1e')]);}return _0x556a9f[_0xc3bf('0x53')](_0x22e701);}})[_0xc3bf('0x27')](function(_0x3a7dea){if(_0x3a7dea){return _0x3a7dea?{'count':_0x54feb1,'rows':_0x3a7dea}:null;}})['then'](respondWithResult(_0x11ef32,null))[_0xc3bf('0x4a')](handleError(_0x11ef32,null));};exports[_0xc3bf('0x55')]=function(_0x34ae38,_0x335a07,_0x2d855e){if(_0x34ae38[_0xc3bf('0x49')]['id']){delete _0x34ae38[_0xc3bf('0x49')]['id'];}return db[_0xc3bf('0x2b')][_0xc3bf('0x4e')]({'where':{'id':_0x34ae38[_0xc3bf('0x45')]['id']}})[_0xc3bf('0x27')](handleEntityNotFound(_0x335a07,null))[_0xc3bf('0x27')](function(_0x588a92){if(_0x588a92){return _0x588a92[_0xc3bf('0x55')](_0x34ae38[_0xc3bf('0x49')][_0xc3bf('0x56')]||[]);}return null;})[_0xc3bf('0x27')](respondWithResult(_0x335a07,null))[_0xc3bf('0x4a')](handleError(_0x335a07,null));}; \ No newline at end of file +var _0xd440=['apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','findAll','rows','catch','show','includeAll','include','merge','find','create','update','body','params','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd440,0xe5));var _0x0d44=function(_0x541423,_0x10dc3b){_0x541423=_0x541423-0x0;var _0x252385=_0xd440[_0x541423];return _0x252385;};'use strict';var emlformat=require(_0x0d44('0x0'));var rimraf=require(_0x0d44('0x1'));var zipdir=require(_0x0d44('0x2'));var jsonpatch=require(_0x0d44('0x3'));var rp=require(_0x0d44('0x4'));var moment=require('moment');var BPromise=require(_0x0d44('0x5'));var Mustache=require(_0x0d44('0x6'));var util=require(_0x0d44('0x7'));var path=require(_0x0d44('0x8'));var sox=require(_0x0d44('0x9'));var csv=require(_0x0d44('0xa'));var ejs=require(_0x0d44('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d44('0xc'));var squel=require(_0x0d44('0xd'));var crypto=require(_0x0d44('0xe'));var jsforce=require(_0x0d44('0xf'));var deskjs=require(_0x0d44('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d44('0x11'));var Redis=require(_0x0d44('0x12'));var authService=require(_0x0d44('0x13'));var qs=require(_0x0d44('0x14'));var as=require(_0x0d44('0x15'));var hardwareService=require(_0x0d44('0x16'));var logger=require(_0x0d44('0x17'))(_0x0d44('0x18'));var utils=require('../../config/utils');var config=require(_0x0d44('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d44('0x1a'))['db'];function respondWithStatusCode(_0x27b934,_0x41d52e){_0x41d52e=_0x41d52e||0xcc;return function(_0xc95aa7){if(_0xc95aa7){return _0x27b934['sendStatus'](_0x41d52e);}return _0x27b934[_0x0d44('0x1b')](_0x41d52e)['end']();};}function respondWithResult(_0x134beb,_0x2769b8){_0x2769b8=_0x2769b8||0xc8;return function(_0x56ff5a){if(_0x56ff5a){return _0x134beb['status'](_0x2769b8)[_0x0d44('0x1c')](_0x56ff5a);}};}function respondWithFilteredResult(_0x192be3,_0x2ba98e){return function(_0x252eff){if(_0x252eff){var _0x2ee485=typeof _0x2ba98e[_0x0d44('0x1d')]===_0x0d44('0x1e')&&typeof _0x2ba98e[_0x0d44('0x1f')]===_0x0d44('0x1e');var _0x265c31=_0x252eff[_0x0d44('0x20')];var _0x5951e9=_0x2ee485?0x0:_0x2ba98e[_0x0d44('0x1d')];var _0x4444c5=_0x2ee485?_0x252eff['count']:_0x2ba98e[_0x0d44('0x1d')]+_0x2ba98e['limit'];var _0x23eee4;if(_0x4444c5>=_0x265c31){_0x4444c5=_0x265c31;_0x23eee4=0xc8;}else{_0x23eee4=0xce;}_0x192be3[_0x0d44('0x1b')](_0x23eee4);return _0x192be3[_0x0d44('0x21')](_0x0d44('0x22'),_0x5951e9+'-'+_0x4444c5+'/'+_0x265c31)[_0x0d44('0x1c')](_0x252eff);}return null;};}function patchUpdates(_0x2ec473){return function(_0x5da965){try{jsonpatch[_0x0d44('0x23')](_0x5da965,_0x2ec473,!![]);}catch(_0x3aaaa0){return BPromise[_0x0d44('0x24')](_0x3aaaa0);}return _0x5da965[_0x0d44('0x25')]();};}function saveUpdates(_0xe54731,_0xb5b874){return function(_0x501184){if(_0x501184){return _0x501184['update'](_0xe54731)[_0x0d44('0x26')](function(_0x3329b6){return _0x3329b6;});}return null;};}function removeEntity(_0x30dff5,_0x321585){return function(_0x42b764){if(_0x42b764){return _0x42b764[_0x0d44('0x27')]()[_0x0d44('0x26')](function(){_0x30dff5[_0x0d44('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e439,_0x35cdf0){return function(_0x28985c){if(!_0x28985c){_0x17e439[_0x0d44('0x28')](0x194);}return _0x28985c;};}function handleError(_0x528469,_0xf2d37c){_0xf2d37c=_0xf2d37c||0x1f4;return function(_0x52ca1c){logger[_0x0d44('0x29')](_0x52ca1c[_0x0d44('0x2a')]);if(_0x52ca1c[_0x0d44('0x2b')]){delete _0x52ca1c[_0x0d44('0x2b')];}_0x528469[_0x0d44('0x1b')](_0xf2d37c)[_0x0d44('0x2c')](_0x52ca1c);};}exports[_0x0d44('0x2d')]=function(_0x1e96dd,_0x39648b){var _0x2cc472={},_0x1152f9={},_0x27b946={'count':0x0,'rows':[]};var _0x3dbb70=_[_0x0d44('0x2e')](db[_0x0d44('0x2f')][_0x0d44('0x30')],function(_0x52422f){return{'name':_0x52422f['fieldName'],'type':_0x52422f[_0x0d44('0x31')]['key']};});_0x1152f9[_0x0d44('0x32')]=_['map'](_0x3dbb70,'name');_0x1152f9[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x1e96dd[_0x0d44('0x33')]);_0x1152f9[_0x0d44('0x35')]=_['intersection'](_0x1152f9[_0x0d44('0x32')],_0x1152f9[_0x0d44('0x33')]);_0x2cc472[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x1152f9[_0x0d44('0x32')],qs[_0x0d44('0x38')](_0x1e96dd[_0x0d44('0x33')]['fields']));_0x2cc472['attributes']=_0x2cc472[_0x0d44('0x36')][_0x0d44('0x39')]?_0x2cc472[_0x0d44('0x36')]:_0x1152f9[_0x0d44('0x32')];if(!_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x3a')](_0x0d44('0x3b'))){_0x2cc472[_0x0d44('0x1f')]=qs[_0x0d44('0x1f')](_0x1e96dd[_0x0d44('0x33')]['limit']);_0x2cc472[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x1d')]);}_0x2cc472['order']=qs[_0x0d44('0x3c')](_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x3c')]);_0x2cc472[_0x0d44('0x3d')]=qs[_0x0d44('0x35')](_[_0x0d44('0x3e')](_0x1e96dd[_0x0d44('0x33')],_0x1152f9['filters']),_0x3dbb70);if(_0x1e96dd[_0x0d44('0x33')]['filter']){_0x2cc472[_0x0d44('0x3d')]=_['merge'](_0x2cc472['where'],{'$or':_[_0x0d44('0x2e')](_0x3dbb70,function(_0x45fb2b){if(_0x45fb2b[_0x0d44('0x31')]!==_0x0d44('0x3f')){var _0x21bbfe={};_0x21bbfe[_0x45fb2b[_0x0d44('0x2b')]]={'$like':'%'+_0x1e96dd[_0x0d44('0x33')][_0x0d44('0x40')]+'%'};return _0x21bbfe;}})});}_0x2cc472=_['merge']({},_0x2cc472,_0x1e96dd[_0x0d44('0x41')]);var _0x48236b={'where':_0x2cc472[_0x0d44('0x3d')]};return db[_0x0d44('0x2f')][_0x0d44('0x20')](_0x48236b)['then'](function(_0x337acc){_0x27b946[_0x0d44('0x20')]=_0x337acc;if(_0x1e96dd['query']['includeAll']){_0x2cc472['include']=[{'all':!![]}];}return db[_0x0d44('0x2f')][_0x0d44('0x42')](_0x2cc472);})[_0x0d44('0x26')](function(_0x23bf7f){_0x27b946[_0x0d44('0x43')]=_0x23bf7f;return _0x27b946;})[_0x0d44('0x26')](respondWithFilteredResult(_0x39648b,_0x2cc472))[_0x0d44('0x44')](handleError(_0x39648b,null));};exports[_0x0d44('0x45')]=function(_0x2ccb7a,_0x372e88){var _0x4dbedd={'raw':![],'where':{'id':_0x2ccb7a['params']['id']}},_0x2c70be={};_0x2c70be[_0x0d44('0x32')]=_[_0x0d44('0x34')](db[_0x0d44('0x2f')]['rawAttributes']);_0x2c70be[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x2ccb7a['query']);_0x2c70be[_0x0d44('0x35')]=_['intersection'](_0x2c70be[_0x0d44('0x32')],_0x2c70be['query']);_0x4dbedd[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x2c70be['model'],qs[_0x0d44('0x38')](_0x2ccb7a[_0x0d44('0x33')][_0x0d44('0x38')]));_0x4dbedd[_0x0d44('0x36')]=_0x4dbedd['attributes'][_0x0d44('0x39')]?_0x4dbedd[_0x0d44('0x36')]:_0x2c70be[_0x0d44('0x32')];if(_0x2ccb7a[_0x0d44('0x33')][_0x0d44('0x46')]){_0x4dbedd[_0x0d44('0x47')]=[{'all':!![]}];}_0x4dbedd=_[_0x0d44('0x48')]({},_0x4dbedd,_0x2ccb7a[_0x0d44('0x41')]);return db[_0x0d44('0x2f')][_0x0d44('0x49')](_0x4dbedd)[_0x0d44('0x26')](handleEntityNotFound(_0x372e88,null))[_0x0d44('0x26')](respondWithResult(_0x372e88,null))[_0x0d44('0x44')](handleError(_0x372e88,null));};exports['create']=function(_0x2d89c3,_0x90243){return db[_0x0d44('0x2f')][_0x0d44('0x4a')](_0x2d89c3['body'],{})[_0x0d44('0x26')](respondWithResult(_0x90243,0xc9))[_0x0d44('0x44')](handleError(_0x90243,null));};exports[_0x0d44('0x4b')]=function(_0x2878e8,_0x355408){if(_0x2878e8[_0x0d44('0x4c')]['id']){delete _0x2878e8[_0x0d44('0x4c')]['id'];}return db[_0x0d44('0x2f')][_0x0d44('0x49')]({'where':{'id':_0x2878e8[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x355408,null))['then'](saveUpdates(_0x2878e8[_0x0d44('0x4c')],null))[_0x0d44('0x26')](respondWithResult(_0x355408,null))['catch'](handleError(_0x355408,null));};exports['destroy']=function(_0x4846cc,_0x4000b7){return db['ZendeskConfiguration'][_0x0d44('0x49')]({'where':{'id':_0x4846cc['params']['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x4000b7,null))[_0x0d44('0x26')](removeEntity(_0x4000b7,null))[_0x0d44('0x44')](handleError(_0x4000b7,null));};exports[_0x0d44('0x4e')]=function(_0x2b2e65,_0x4595c5,_0x2ca022){var _0x335348={};var _0x5b61e3={};var _0x205316;var _0x16bac1;return db[_0x0d44('0x2f')][_0x0d44('0x4f')]({'where':{'id':_0x2b2e65[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x4595c5,null))[_0x0d44('0x26')](function(_0x49fa44){if(_0x49fa44){_0x205316=_0x49fa44;_0x5b61e3[_0x0d44('0x32')]=_[_0x0d44('0x34')](db[_0x0d44('0x50')][_0x0d44('0x30')]);_0x5b61e3[_0x0d44('0x33')]=_['keys'](_0x2b2e65[_0x0d44('0x33')]);_0x5b61e3['filters']=_['intersection'](_0x5b61e3['model'],_0x5b61e3[_0x0d44('0x33')]);_0x335348[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x5b61e3[_0x0d44('0x32')],qs[_0x0d44('0x38')](_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x38')]));_0x335348['attributes']=_0x335348[_0x0d44('0x36')][_0x0d44('0x39')]?_0x335348[_0x0d44('0x36')]:_0x5b61e3['model'];_0x335348[_0x0d44('0x51')]=qs[_0x0d44('0x3c')](_0x2b2e65[_0x0d44('0x33')]['sort']);_0x335348[_0x0d44('0x3d')]=qs[_0x0d44('0x35')](_[_0x0d44('0x3e')](_0x2b2e65[_0x0d44('0x33')],_0x5b61e3[_0x0d44('0x35')]));if(_0x2b2e65['query'][_0x0d44('0x40')]){_0x335348[_0x0d44('0x3d')]=_[_0x0d44('0x48')](_0x335348[_0x0d44('0x3d')],{'$or':_[_0x0d44('0x2e')](_0x335348[_0x0d44('0x36')],function(_0x5ef669){var _0x5e2d7c={};_0x5e2d7c[_0x5ef669]={'$like':'%'+_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x40')]+'%'};return _0x5e2d7c;})});}_0x335348=_[_0x0d44('0x48')]({},_0x335348,_0x2b2e65['options']);return _0x205316[_0x0d44('0x4e')](_0x335348);}})[_0x0d44('0x26')](function(_0x5c0216){if(_0x5c0216){_0x16bac1=_0x5c0216[_0x0d44('0x39')];if(!_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x3a')](_0x0d44('0x3b'))){_0x335348['limit']=qs[_0x0d44('0x1f')](_0x2b2e65[_0x0d44('0x33')][_0x0d44('0x1f')]);_0x335348[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x2b2e65[_0x0d44('0x33')]['offset']);}return _0x205316[_0x0d44('0x4e')](_0x335348);}})[_0x0d44('0x26')](function(_0x15224a){if(_0x15224a){return _0x15224a?{'count':_0x16bac1,'rows':_0x15224a}:null;}})['then'](respondWithResult(_0x4595c5,null))['catch'](handleError(_0x4595c5,null));};exports[_0x0d44('0x52')]=function(_0x22b7d3,_0x45b777,_0x44ac7e){var _0x5f2a49={};var _0x4dedbe={};var _0x57f9f8;var _0x296cc7;return db['ZendeskConfiguration'][_0x0d44('0x4f')]({'where':{'id':_0x22b7d3[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x45b777,null))[_0x0d44('0x26')](function(_0x35d611){if(_0x35d611){_0x57f9f8=_0x35d611;_0x4dedbe[_0x0d44('0x32')]=_[_0x0d44('0x34')](db[_0x0d44('0x50')][_0x0d44('0x30')]);_0x4dedbe['query']=_[_0x0d44('0x34')](_0x22b7d3[_0x0d44('0x33')]);_0x4dedbe[_0x0d44('0x35')]=_[_0x0d44('0x37')](_0x4dedbe[_0x0d44('0x32')],_0x4dedbe[_0x0d44('0x33')]);_0x5f2a49[_0x0d44('0x36')]=_[_0x0d44('0x37')](_0x4dedbe[_0x0d44('0x32')],qs['fields'](_0x22b7d3[_0x0d44('0x33')]['fields']));_0x5f2a49[_0x0d44('0x36')]=_0x5f2a49[_0x0d44('0x36')][_0x0d44('0x39')]?_0x5f2a49[_0x0d44('0x36')]:_0x4dedbe[_0x0d44('0x32')];_0x5f2a49[_0x0d44('0x51')]=qs[_0x0d44('0x3c')](_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x3c')]);_0x5f2a49['where']=qs['filters'](_[_0x0d44('0x3e')](_0x22b7d3[_0x0d44('0x33')],_0x4dedbe[_0x0d44('0x35')]));if(_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x40')]){_0x5f2a49[_0x0d44('0x3d')]=_[_0x0d44('0x48')](_0x5f2a49[_0x0d44('0x3d')],{'$or':_[_0x0d44('0x2e')](_0x5f2a49[_0x0d44('0x36')],function(_0xaa3341){var _0x353e28={};_0x353e28[_0xaa3341]={'$like':'%'+_0x22b7d3[_0x0d44('0x33')]['filter']+'%'};return _0x353e28;})});}_0x5f2a49=_[_0x0d44('0x48')]({},_0x5f2a49,_0x22b7d3[_0x0d44('0x41')]);return _0x57f9f8[_0x0d44('0x52')](_0x5f2a49);}})[_0x0d44('0x26')](function(_0x47714e){if(_0x47714e){_0x296cc7=_0x47714e[_0x0d44('0x39')];if(!_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x3a')](_0x0d44('0x3b'))){_0x5f2a49[_0x0d44('0x1f')]=qs[_0x0d44('0x1f')](_0x22b7d3[_0x0d44('0x33')][_0x0d44('0x1f')]);_0x5f2a49[_0x0d44('0x1d')]=qs['offset'](_0x22b7d3['query'][_0x0d44('0x1d')]);}return _0x57f9f8[_0x0d44('0x52')](_0x5f2a49);}})['then'](function(_0x54fc82){if(_0x54fc82){return _0x54fc82?{'count':_0x296cc7,'rows':_0x54fc82}:null;}})[_0x0d44('0x26')](respondWithResult(_0x45b777,null))['catch'](handleError(_0x45b777,null));};exports['getDescriptions']=function(_0x1252c9,_0x423319,_0x2cd105){var _0x3eef3b={};var _0xae1653={};var _0x199a30;var _0x21aa5e;return db[_0x0d44('0x2f')][_0x0d44('0x4f')]({'where':{'id':_0x1252c9[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x423319,null))[_0x0d44('0x26')](function(_0x5a1aeb){if(_0x5a1aeb){_0x199a30=_0x5a1aeb;_0xae1653['model']=_[_0x0d44('0x34')](db[_0x0d44('0x50')][_0x0d44('0x30')]);_0xae1653[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x1252c9[_0x0d44('0x33')]);_0xae1653['filters']=_[_0x0d44('0x37')](_0xae1653[_0x0d44('0x32')],_0xae1653[_0x0d44('0x33')]);_0x3eef3b['attributes']=_['intersection'](_0xae1653['model'],qs[_0x0d44('0x38')](_0x1252c9[_0x0d44('0x33')][_0x0d44('0x38')]));_0x3eef3b[_0x0d44('0x36')]=_0x3eef3b[_0x0d44('0x36')][_0x0d44('0x39')]?_0x3eef3b[_0x0d44('0x36')]:_0xae1653[_0x0d44('0x32')];_0x3eef3b[_0x0d44('0x51')]=qs['sort'](_0x1252c9[_0x0d44('0x33')]['sort']);_0x3eef3b[_0x0d44('0x3d')]=qs['filters'](_[_0x0d44('0x3e')](_0x1252c9[_0x0d44('0x33')],_0xae1653['filters']));if(_0x1252c9[_0x0d44('0x33')][_0x0d44('0x40')]){_0x3eef3b[_0x0d44('0x3d')]=_[_0x0d44('0x48')](_0x3eef3b['where'],{'$or':_[_0x0d44('0x2e')](_0x3eef3b[_0x0d44('0x36')],function(_0x727456){var _0x564d62={};_0x564d62[_0x727456]={'$like':'%'+_0x1252c9[_0x0d44('0x33')]['filter']+'%'};return _0x564d62;})});}_0x3eef3b=_[_0x0d44('0x48')]({},_0x3eef3b,_0x1252c9[_0x0d44('0x41')]);return _0x199a30[_0x0d44('0x53')](_0x3eef3b);}})[_0x0d44('0x26')](function(_0x281f18){if(_0x281f18){_0x21aa5e=_0x281f18['length'];if(!_0x1252c9['query']['hasOwnProperty']('nolimit')){_0x3eef3b['limit']=qs[_0x0d44('0x1f')](_0x1252c9[_0x0d44('0x33')][_0x0d44('0x1f')]);_0x3eef3b[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x1252c9['query'][_0x0d44('0x1d')]);}return _0x199a30['getDescriptions'](_0x3eef3b);}})[_0x0d44('0x26')](function(_0x10b4b3){if(_0x10b4b3){return _0x10b4b3?{'count':_0x21aa5e,'rows':_0x10b4b3}:null;}})[_0x0d44('0x26')](respondWithResult(_0x423319,null))[_0x0d44('0x44')](handleError(_0x423319,null));};exports['getTags']=function(_0x2df7d7,_0x24b2ae,_0x74c2c8){var _0x14d658={};var _0x3c48b0={};var _0x28e18c;var _0x55b842;return db[_0x0d44('0x2f')][_0x0d44('0x4f')]({'where':{'id':_0x2df7d7[_0x0d44('0x4d')]['id']}})[_0x0d44('0x26')](handleEntityNotFound(_0x24b2ae,null))[_0x0d44('0x26')](function(_0x564418){if(_0x564418){_0x28e18c=_0x564418;_0x3c48b0['model']=_[_0x0d44('0x34')](db[_0x0d44('0x54')]['rawAttributes']);_0x3c48b0[_0x0d44('0x33')]=_[_0x0d44('0x34')](_0x2df7d7[_0x0d44('0x33')]);_0x3c48b0[_0x0d44('0x35')]=_[_0x0d44('0x37')](_0x3c48b0['model'],_0x3c48b0[_0x0d44('0x33')]);_0x14d658['attributes']=_['intersection'](_0x3c48b0[_0x0d44('0x32')],qs[_0x0d44('0x38')](_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x38')]));_0x14d658['attributes']=_0x14d658[_0x0d44('0x36')][_0x0d44('0x39')]?_0x14d658[_0x0d44('0x36')]:_0x3c48b0[_0x0d44('0x32')];_0x14d658[_0x0d44('0x51')]=qs[_0x0d44('0x3c')](_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x3c')]);_0x14d658[_0x0d44('0x3d')]=qs[_0x0d44('0x35')](_['pick'](_0x2df7d7[_0x0d44('0x33')],_0x3c48b0[_0x0d44('0x35')]));if(_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x40')]){_0x14d658[_0x0d44('0x3d')]=_['merge'](_0x14d658['where'],{'$or':_[_0x0d44('0x2e')](_0x14d658[_0x0d44('0x36')],function(_0x45ed20){var _0x2d4c43={};_0x2d4c43[_0x45ed20]={'$like':'%'+_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x40')]+'%'};return _0x2d4c43;})});}_0x14d658=_[_0x0d44('0x48')]({},_0x14d658,_0x2df7d7['options']);return _0x28e18c[_0x0d44('0x55')](_0x14d658);}})[_0x0d44('0x26')](function(_0x9d658a){if(_0x9d658a){_0x55b842=_0x9d658a[_0x0d44('0x39')];if(!_0x2df7d7[_0x0d44('0x33')][_0x0d44('0x3a')]('nolimit')){_0x14d658[_0x0d44('0x1f')]=qs[_0x0d44('0x1f')](_0x2df7d7['query'][_0x0d44('0x1f')]);_0x14d658[_0x0d44('0x1d')]=qs[_0x0d44('0x1d')](_0x2df7d7['query']['offset']);}return _0x28e18c[_0x0d44('0x55')](_0x14d658);}})['then'](function(_0x32a67b){if(_0x32a67b){return _0x32a67b?{'count':_0x55b842,'rows':_0x32a67b}:null;}})[_0x0d44('0x26')](respondWithResult(_0x24b2ae,null))[_0x0d44('0x44')](handleError(_0x24b2ae,null));};exports[_0x0d44('0x56')]=function(_0x5cb483,_0x565238,_0x57dc89){if(_0x5cb483[_0x0d44('0x4c')]['id']){delete _0x5cb483[_0x0d44('0x4c')]['id'];}return db[_0x0d44('0x2f')]['findOne']({'where':{'id':_0x5cb483[_0x0d44('0x4d')]['id']}})['then'](handleEntityNotFound(_0x565238,null))[_0x0d44('0x26')](function(_0x569a39){if(_0x569a39){return _0x569a39[_0x0d44('0x56')](_0x5cb483[_0x0d44('0x4c')][_0x0d44('0x57')]||[]);}return null;})[_0x0d44('0x26')](respondWithResult(_0x565238,null))[_0x0d44('0x44')](handleError(_0x565238,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 89e2fd7..ad96893 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 _0x4e81=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0x4e81,0x1bc));var _0x14e8=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x4e81[_0x57fa33];return _0x12e724;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14e8('0x3'));var fs=require('fs');var path=require(_0x14e8('0x4'));var rimraf=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var attributes=require(_0x14e8('0x7'));module[_0x14e8('0x8')]=function(_0x56a266,_0x57c79b){return _0x56a266[_0x14e8('0x9')](_0x14e8('0xa'),attributes,{'tableName':_0x14e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x160f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','int_zendesk_configurations'];(function(_0x3bde9c,_0x364111){var _0x1ac8b9=function(_0x134bcd){while(--_0x134bcd){_0x3bde9c['push'](_0x3bde9c['shift']());}};_0x1ac8b9(++_0x364111);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require(_0xf160('0x2'))(_0xf160('0x3'));var moment=require('moment');var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var attributes=require(_0xf160('0x9'));module['exports']=function(_0x311d63,_0x11902f){return _0x311d63['define']('ZendeskConfiguration',attributes,{'tableName':_0xf160('0xa'),'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 e8b8fdd..f5ae273 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 _0xc5a4=['jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x678ec6,_0x463479){var _0x2033f8=function(_0x4d5d6b){while(--_0x4d5d6b){_0x678ec6['push'](_0x678ec6['shift']());}};_0x2033f8(++_0x463479);}(_0xc5a4,0x134));var _0x4c5a=function(_0x5c563c,_0x15148f){_0x5c563c=_0x5c563c-0x0;var _0xf47e07=_0xc5a4[_0x5c563c];return _0xf47e07;};'use strict';var _=require('lodash');var util=require(_0x4c5a('0x0'));var moment=require(_0x4c5a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c5a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c5a('0x3'))['db'];var utils=require(_0x4c5a('0x4'));var logger=require('../../config/logger')(_0x4c5a('0x5'));var config=require(_0x4c5a('0x6'));var jayson=require(_0x4c5a('0x7'));var client=jayson[_0x4c5a('0x8')][_0x4c5a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26a8a4,_0x5486d3,_0x2991dc){return new BPromise(function(_0x54fddd,_0xbf70af){return client[_0x4c5a('0xa')](_0x26a8a4,_0x2991dc)[_0x4c5a('0xb')](function(_0x42ee80){logger['info'](_0x4c5a('0xc'),_0x5486d3,_0x4c5a('0xd'));logger['debug'](_0x4c5a('0xe'),_0x5486d3,_0x4c5a('0xd'),JSON[_0x4c5a('0xf')](_0x42ee80));if(_0x42ee80[_0x4c5a('0x10')]){if(_0x42ee80[_0x4c5a('0x10')]['code']===0x1f4){logger[_0x4c5a('0x10')](_0x4c5a('0xc'),_0x5486d3,_0x42ee80[_0x4c5a('0x10')]['message']);return _0xbf70af(_0x42ee80[_0x4c5a('0x10')][_0x4c5a('0x11')]);}logger[_0x4c5a('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5486d3,_0x42ee80[_0x4c5a('0x10')][_0x4c5a('0x11')]);return _0x54fddd(_0x42ee80[_0x4c5a('0x10')][_0x4c5a('0x11')]);}else{logger[_0x4c5a('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5486d3,_0x4c5a('0xd'));_0x54fddd(_0x42ee80[_0x4c5a('0x13')][_0x4c5a('0x11')]);}})[_0x4c5a('0x14')](function(_0x4ee87a){logger[_0x4c5a('0x10')](_0x4c5a('0xc'),_0x5486d3,_0x4ee87a);_0xbf70af(_0x4ee87a);});});} \ No newline at end of file +var _0xe06b=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xe06b,0x11a));var _0xbe06=function(_0x3039e2,_0x31f0b9){_0x3039e2=_0x3039e2-0x0;var _0x53d88e=_0xe06b[_0x3039e2];return _0x53d88e;};'use strict';var _=require('lodash');var util=require(_0xbe06('0x0'));var moment=require(_0xbe06('0x1'));var BPromise=require(_0xbe06('0x2'));var rs=require(_0xbe06('0x3'));var fs=require('fs');var Redis=require(_0xbe06('0x4'));var db=require(_0xbe06('0x5'))['db'];var utils=require(_0xbe06('0x6'));var logger=require(_0xbe06('0x7'))(_0xbe06('0x8'));var config=require(_0xbe06('0x9'));var jayson=require(_0xbe06('0xa'));var client=jayson[_0xbe06('0xb')][_0xbe06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4893e2,_0x2e9923,_0x4d9700){return new BPromise(function(_0x9f75a9,_0x5857c1){return client[_0xbe06('0xd')](_0x4893e2,_0x4d9700)[_0xbe06('0xe')](function(_0x1bbaf8){logger[_0xbe06('0xf')](_0xbe06('0x10'),_0x2e9923,_0xbe06('0x11'));logger[_0xbe06('0x12')](_0xbe06('0x13'),_0x2e9923,_0xbe06('0x11'),JSON[_0xbe06('0x14')](_0x1bbaf8));if(_0x1bbaf8[_0xbe06('0x15')]){if(_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x16')]===0x1f4){logger[_0xbe06('0x15')](_0xbe06('0x10'),_0x2e9923,_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x17')]);return _0x5857c1(_0x1bbaf8['error'][_0xbe06('0x17')]);}logger[_0xbe06('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e9923,_0x1bbaf8[_0xbe06('0x15')][_0xbe06('0x17')]);return _0x9f75a9(_0x1bbaf8['error']['message']);}else{logger[_0xbe06('0xf')](_0xbe06('0x10'),_0x2e9923,_0xbe06('0x11'));_0x9f75a9(_0x1bbaf8['result'][_0xbe06('0x17')]);}})[_0xbe06('0x18')](function(_0x458929){logger[_0xbe06('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2e9923,_0x458929);_0x5857c1(_0x458929);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 260c611..b1e8c62 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 _0xc838=['show','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x1bca85,_0x64f3c5){var _0x401681=function(_0x7e5086){while(--_0x7e5086){_0x1bca85['push'](_0x1bca85['shift']());}};_0x401681(++_0x64f3c5);}(_0xc838,0xa9));var _0x8c83=function(_0x252780,_0x303c4b){_0x252780=_0x252780-0x0;var _0x4430a1=_0xc838[_0x252780];return _0x4430a1;};'use strict';var multer=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var path=require(_0x8c83('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c83('0x3'));var router=express['Router']();var fs_extra=require(_0x8c83('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8c83('0x5'));var config=require(_0x8c83('0x6'));var controller=require('./intZendeskField.controller');router[_0x8c83('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c83('0x8')]);router[_0x8c83('0x7')](_0x8c83('0x9'),auth[_0x8c83('0xa')](),controller[_0x8c83('0xb')]);router['post']('/',auth[_0x8c83('0xa')](),controller[_0x8c83('0xc')]);router[_0x8c83('0xd')](_0x8c83('0x9'),auth[_0x8c83('0xa')](),controller[_0x8c83('0xe')]);router[_0x8c83('0xf')](_0x8c83('0x9'),auth[_0x8c83('0xa')](),controller[_0x8c83('0x10')]);module[_0x8c83('0x11')]=router; \ No newline at end of file +var _0x2087=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','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);}(_0x2087,0xeb));var _0x7208=function(_0xc4dc75,_0x323bfb){_0xc4dc75=_0xc4dc75-0x0;var _0x2b4314=_0x2087[_0xc4dc75];return _0x2b4314;};'use strict';var multer=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var path=require(_0x7208('0x2'));var timeout=require(_0x7208('0x3'));var express=require(_0x7208('0x4'));var router=express[_0x7208('0x5')]();var fs_extra=require(_0x7208('0x6'));var auth=require(_0x7208('0x7'));var interaction=require(_0x7208('0x8'));var config=require(_0x7208('0x9'));var controller=require('./intZendeskField.controller');router[_0x7208('0xa')]('/',auth[_0x7208('0xb')](),controller[_0x7208('0xc')]);router[_0x7208('0xa')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7208('0xf')]);router['put']('/:id',auth[_0x7208('0xb')](),controller[_0x7208('0x10')]);router[_0x7208('0x11')](_0x7208('0xd'),auth[_0x7208('0xb')](),controller[_0x7208('0x12')]);module[_0x7208('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2b89098..fdfbd60 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 _0x66b0=['customVariable','keyValue','picklist','string','STRING','ENUM','sequelize','variable'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x66b0,0x16e));var _0x066b=function(_0x260e77,_0x21bbb3){_0x260e77=_0x260e77-0x0;var _0x2bc8c7=_0x66b0[_0x260e77];return _0x2bc8c7;};'use strict';var Sequelize=require(_0x066b('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x066b('0x1'),_0x066b('0x2'),_0x066b('0x3'),_0x066b('0x4')),'defaultValue':_0x066b('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x066b('0x6')]},'keyType':{'type':Sequelize[_0x066b('0x7')]('string',_0x066b('0x1'),_0x066b('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x066b('0x6')]},'nameField':{'type':Sequelize[_0x066b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x066b('0x6')]}}; \ No newline at end of file +var _0x50dc=['sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN'];(function(_0x40b94e,_0xc1bad9){var _0x2e5a21=function(_0x5801d3){while(--_0x5801d3){_0x40b94e['push'](_0x40b94e['shift']());}};_0x2e5a21(++_0xc1bad9);}(_0x50dc,0xc8));var _0xc50d=function(_0x5bdc89,_0x179e7a){_0x5bdc89=_0x5bdc89-0x0;var _0x100db3=_0x50dc[_0x5bdc89];return _0x100db3;};'use strict';var Sequelize=require(_0xc50d('0x0'));module[_0xc50d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc50d('0x2'),'variable',_0xc50d('0x3'),_0xc50d('0x4'),_0xc50d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc50d('0x6')]},'key':{'type':Sequelize[_0xc50d('0x6')]},'keyType':{'type':Sequelize[_0xc50d('0x7')](_0xc50d('0x2'),_0xc50d('0x8'),_0xc50d('0x3'))},'keyContent':{'type':Sequelize[_0xc50d('0x6')]},'idField':{'type':Sequelize[_0xc50d('0x6')]},'nameField':{'type':Sequelize[_0xc50d('0x6')]},'customField':{'type':Sequelize[_0xc50d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc50d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 29b7857..2e5155b 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 _0xbe0f=['then','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x3510dd,_0x28476c){var _0x4b47e2=function(_0x3bdf30){while(--_0x3bdf30){_0x3510dd['push'](_0x3510dd['shift']());}};_0x4b47e2(++_0x28476c);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x16ec8d,_0x4bf3f0){_0x16ec8d=_0x16ec8d-0x0;var _0x12bdbf=_0xbe0f[_0x16ec8d];return _0x12bdbf;};'use strict';var emlformat=require(_0xfbe0('0x0'));var rimraf=require(_0xfbe0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfbe0('0x2'));var moment=require('moment');var BPromise=require(_0xfbe0('0x3'));var Mustache=require('mustache');var util=require(_0xfbe0('0x4'));var path=require(_0xfbe0('0x5'));var sox=require(_0xfbe0('0x6'));var csv=require('to-csv');var ejs=require(_0xfbe0('0x7'));var fs=require('fs');var fs_extra=require(_0xfbe0('0x8'));var _=require('lodash');var squel=require(_0xfbe0('0x9'));var crypto=require(_0xfbe0('0xa'));var jsforce=require(_0xfbe0('0xb'));var deskjs=require(_0xfbe0('0xc'));var toCsv=require(_0xfbe0('0xd'));var querystring=require('querystring');var Papa=require(_0xfbe0('0xe'));var Redis=require(_0xfbe0('0xf'));var authService=require(_0xfbe0('0x10'));var qs=require(_0xfbe0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbe0('0x12'));var logger=require(_0xfbe0('0x13'))(_0xfbe0('0x14'));var utils=require(_0xfbe0('0x15'));var config=require(_0xfbe0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbe0('0x17'))['db'];function respondWithStatusCode(_0x266dc8,_0x50eb9b){_0x50eb9b=_0x50eb9b||0xcc;return function(_0x69f1f9){if(_0x69f1f9){return _0x266dc8[_0xfbe0('0x18')](_0x50eb9b);}return _0x266dc8[_0xfbe0('0x19')](_0x50eb9b)[_0xfbe0('0x1a')]();};}function respondWithResult(_0xa82657,_0xfdc0c5){_0xfdc0c5=_0xfdc0c5||0xc8;return function(_0x1124e1){if(_0x1124e1){return _0xa82657[_0xfbe0('0x19')](_0xfdc0c5)[_0xfbe0('0x1b')](_0x1124e1);}};}function respondWithFilteredResult(_0x2c4f8f,_0x1dc43a){return function(_0x3fc06d){if(_0x3fc06d){var _0x33e4dc=typeof _0x1dc43a[_0xfbe0('0x1c')]===_0xfbe0('0x1d')&&typeof _0x1dc43a[_0xfbe0('0x1e')]===_0xfbe0('0x1d');var _0x583a10=_0x3fc06d['count'];var _0x5db910=_0x33e4dc?0x0:_0x1dc43a[_0xfbe0('0x1c')];var _0x3bb90d=_0x33e4dc?_0x3fc06d[_0xfbe0('0x1f')]:_0x1dc43a['offset']+_0x1dc43a[_0xfbe0('0x1e')];var _0xf28e67;if(_0x3bb90d>=_0x583a10){_0x3bb90d=_0x583a10;_0xf28e67=0xc8;}else{_0xf28e67=0xce;}_0x2c4f8f['status'](_0xf28e67);return _0x2c4f8f[_0xfbe0('0x20')](_0xfbe0('0x21'),_0x5db910+'-'+_0x3bb90d+'/'+_0x583a10)[_0xfbe0('0x1b')](_0x3fc06d);}return null;};}function patchUpdates(_0x3bdb0b){return function(_0x22dfa4){try{jsonpatch[_0xfbe0('0x22')](_0x22dfa4,_0x3bdb0b,!![]);}catch(_0x133aef){return BPromise[_0xfbe0('0x23')](_0x133aef);}return _0x22dfa4[_0xfbe0('0x24')]();};}function saveUpdates(_0x36fe1d,_0x1821bb){return function(_0x55eaf4){if(_0x55eaf4){return _0x55eaf4[_0xfbe0('0x25')](_0x36fe1d)['then'](function(_0x2e5755){return _0x2e5755;});}return null;};}function removeEntity(_0x103e31,_0x4bab8d){return function(_0x4ca905){if(_0x4ca905){return _0x4ca905[_0xfbe0('0x26')]()['then'](function(){_0x103e31[_0xfbe0('0x19')](0xcc)[_0xfbe0('0x1a')]();});}};}function handleEntityNotFound(_0x5af540,_0x57918d){return function(_0x5e7a5c){if(!_0x5e7a5c){_0x5af540[_0xfbe0('0x18')](0x194);}return _0x5e7a5c;};}function handleError(_0xe1392b,_0xc2d77c){_0xc2d77c=_0xc2d77c||0x1f4;return function(_0x1b5788){logger[_0xfbe0('0x27')](_0x1b5788['stack']);if(_0x1b5788[_0xfbe0('0x28')]){delete _0x1b5788[_0xfbe0('0x28')];}_0xe1392b[_0xfbe0('0x19')](_0xc2d77c)[_0xfbe0('0x29')](_0x1b5788);};}exports[_0xfbe0('0x2a')]=function(_0xfae62d,_0x106388){var _0xa170a6={},_0x1e5f2e={},_0x4f1463={'count':0x0,'rows':[]};var _0x248e81=_[_0xfbe0('0x2b')](db[_0xfbe0('0x2c')][_0xfbe0('0x2d')],function(_0x11d116){return{'name':_0x11d116[_0xfbe0('0x2e')],'type':_0x11d116[_0xfbe0('0x2f')][_0xfbe0('0x30')]};});_0x1e5f2e[_0xfbe0('0x31')]=_[_0xfbe0('0x2b')](_0x248e81,_0xfbe0('0x28'));_0x1e5f2e[_0xfbe0('0x32')]=_['keys'](_0xfae62d[_0xfbe0('0x32')]);_0x1e5f2e[_0xfbe0('0x33')]=_[_0xfbe0('0x34')](_0x1e5f2e[_0xfbe0('0x31')],_0x1e5f2e[_0xfbe0('0x32')]);_0xa170a6['attributes']=_[_0xfbe0('0x34')](_0x1e5f2e[_0xfbe0('0x31')],qs['fields'](_0xfae62d['query'][_0xfbe0('0x35')]));_0xa170a6[_0xfbe0('0x36')]=_0xa170a6[_0xfbe0('0x36')][_0xfbe0('0x37')]?_0xa170a6['attributes']:_0x1e5f2e[_0xfbe0('0x31')];if(!_0xfae62d[_0xfbe0('0x32')][_0xfbe0('0x38')](_0xfbe0('0x39'))){_0xa170a6[_0xfbe0('0x1e')]=qs[_0xfbe0('0x1e')](_0xfae62d[_0xfbe0('0x32')][_0xfbe0('0x1e')]);_0xa170a6[_0xfbe0('0x1c')]=qs[_0xfbe0('0x1c')](_0xfae62d[_0xfbe0('0x32')][_0xfbe0('0x1c')]);}_0xa170a6[_0xfbe0('0x3a')]=qs[_0xfbe0('0x3b')](_0xfae62d['query'][_0xfbe0('0x3b')]);_0xa170a6[_0xfbe0('0x3c')]=qs[_0xfbe0('0x33')](_[_0xfbe0('0x3d')](_0xfae62d[_0xfbe0('0x32')],_0x1e5f2e[_0xfbe0('0x33')]),_0x248e81);if(_0xfae62d['query']['filter']){_0xa170a6[_0xfbe0('0x3c')]=_[_0xfbe0('0x3e')](_0xa170a6[_0xfbe0('0x3c')],{'$or':_[_0xfbe0('0x2b')](_0x248e81,function(_0x21176c){if(_0x21176c[_0xfbe0('0x2f')]!==_0xfbe0('0x3f')){var _0x11eaf1={};_0x11eaf1[_0x21176c[_0xfbe0('0x28')]]={'$like':'%'+_0xfae62d[_0xfbe0('0x32')]['filter']+'%'};return _0x11eaf1;}})});}_0xa170a6=_[_0xfbe0('0x3e')]({},_0xa170a6,_0xfae62d[_0xfbe0('0x40')]);var _0x11d2fa={'where':_0xa170a6[_0xfbe0('0x3c')]};return db[_0xfbe0('0x2c')]['count'](_0x11d2fa)[_0xfbe0('0x41')](function(_0xbe6054){_0x4f1463[_0xfbe0('0x1f')]=_0xbe6054;if(_0xfae62d[_0xfbe0('0x32')][_0xfbe0('0x42')]){_0xa170a6[_0xfbe0('0x43')]=[{'all':!![]}];}return db[_0xfbe0('0x2c')][_0xfbe0('0x44')](_0xa170a6);})['then'](function(_0x2c4121){_0x4f1463[_0xfbe0('0x45')]=_0x2c4121;return _0x4f1463;})[_0xfbe0('0x41')](respondWithFilteredResult(_0x106388,_0xa170a6))['catch'](handleError(_0x106388,null));};exports[_0xfbe0('0x46')]=function(_0x395cae,_0xcc4a21){var _0x128736={'raw':!![],'where':{'id':_0x395cae[_0xfbe0('0x47')]['id']}},_0x24bce4={};_0x24bce4[_0xfbe0('0x31')]=_['keys'](db[_0xfbe0('0x2c')]['rawAttributes']);_0x24bce4[_0xfbe0('0x32')]=_['keys'](_0x395cae[_0xfbe0('0x32')]);_0x24bce4[_0xfbe0('0x33')]=_['intersection'](_0x24bce4[_0xfbe0('0x31')],_0x24bce4[_0xfbe0('0x32')]);_0x128736[_0xfbe0('0x36')]=_[_0xfbe0('0x34')](_0x24bce4['model'],qs[_0xfbe0('0x35')](_0x395cae[_0xfbe0('0x32')][_0xfbe0('0x35')]));_0x128736[_0xfbe0('0x36')]=_0x128736[_0xfbe0('0x36')][_0xfbe0('0x37')]?_0x128736[_0xfbe0('0x36')]:_0x24bce4[_0xfbe0('0x31')];if(_0x395cae[_0xfbe0('0x32')][_0xfbe0('0x42')]){_0x128736['include']=[{'all':!![]}];}_0x128736=_[_0xfbe0('0x3e')]({},_0x128736,_0x395cae[_0xfbe0('0x40')]);return db[_0xfbe0('0x2c')][_0xfbe0('0x48')](_0x128736)['then'](handleEntityNotFound(_0xcc4a21,null))[_0xfbe0('0x41')](respondWithResult(_0xcc4a21,null))[_0xfbe0('0x49')](handleError(_0xcc4a21,null));};exports[_0xfbe0('0x4a')]=function(_0x593349,_0x182753){return db[_0xfbe0('0x2c')][_0xfbe0('0x4a')](_0x593349['body'],{})[_0xfbe0('0x41')](respondWithResult(_0x182753,0xc9))[_0xfbe0('0x49')](handleError(_0x182753,null));};exports['update']=function(_0x125a3a,_0x3745ee){if(_0x125a3a[_0xfbe0('0x4b')]['id']){delete _0x125a3a[_0xfbe0('0x4b')]['id'];}return db[_0xfbe0('0x2c')][_0xfbe0('0x48')]({'where':{'id':_0x125a3a[_0xfbe0('0x47')]['id']}})[_0xfbe0('0x41')](handleEntityNotFound(_0x3745ee,null))[_0xfbe0('0x41')](saveUpdates(_0x125a3a['body'],null))[_0xfbe0('0x41')](respondWithResult(_0x3745ee,null))[_0xfbe0('0x49')](handleError(_0x3745ee,null));};exports[_0xfbe0('0x26')]=function(_0x3769ee,_0x52eb57){return db[_0xfbe0('0x2c')][_0xfbe0('0x48')]({'where':{'id':_0x3769ee[_0xfbe0('0x47')]['id']}})[_0xfbe0('0x41')](handleEntityNotFound(_0x52eb57,null))['then'](removeEntity(_0x52eb57,null))[_0xfbe0('0x49')](handleError(_0x52eb57,null));}; \ No newline at end of file +var _0x4512=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','ZendeskField','rawAttributes','type','key','model'];(function(_0x201ed2,_0x1042cc){var _0x138582=function(_0x682b4a){while(--_0x682b4a){_0x201ed2['push'](_0x201ed2['shift']());}};_0x138582(++_0x1042cc);}(_0x4512,0x1e7));var _0x2451=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0x4512[_0xf4add4];return _0x1c42fb;};'use strict';var emlformat=require(_0x2451('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2451('0x1'));var jsonpatch=require(_0x2451('0x2'));var rp=require('request-promise');var moment=require(_0x2451('0x3'));var BPromise=require(_0x2451('0x4'));var Mustache=require(_0x2451('0x5'));var util=require(_0x2451('0x6'));var path=require('path');var sox=require(_0x2451('0x7'));var csv=require('to-csv');var ejs=require(_0x2451('0x8'));var fs=require('fs');var fs_extra=require(_0x2451('0x9'));var _=require(_0x2451('0xa'));var squel=require(_0x2451('0xb'));var crypto=require(_0x2451('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2451('0xd'));var toCsv=require(_0x2451('0xe'));var querystring=require(_0x2451('0xf'));var Papa=require(_0x2451('0x10'));var Redis=require(_0x2451('0x11'));var authService=require(_0x2451('0x12'));var qs=require(_0x2451('0x13'));var as=require(_0x2451('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2451('0x15'))(_0x2451('0x16'));var utils=require(_0x2451('0x17'));var config=require(_0x2451('0x18'));var licenseUtil=require(_0x2451('0x19'));var db=require(_0x2451('0x1a'))['db'];function respondWithStatusCode(_0x4135c5,_0xe5c70c){_0xe5c70c=_0xe5c70c||0xcc;return function(_0x429a61){if(_0x429a61){return _0x4135c5[_0x2451('0x1b')](_0xe5c70c);}return _0x4135c5['status'](_0xe5c70c)[_0x2451('0x1c')]();};}function respondWithResult(_0x174347,_0x27d060){_0x27d060=_0x27d060||0xc8;return function(_0x3bbc00){if(_0x3bbc00){return _0x174347[_0x2451('0x1d')](_0x27d060)[_0x2451('0x1e')](_0x3bbc00);}};}function respondWithFilteredResult(_0x7a935a,_0x59f8ce){return function(_0x458682){if(_0x458682){var _0x52ef9e=typeof _0x59f8ce[_0x2451('0x1f')]===_0x2451('0x20')&&typeof _0x59f8ce[_0x2451('0x21')]===_0x2451('0x20');var _0x571301=_0x458682[_0x2451('0x22')];var _0x5cfd9f=_0x52ef9e?0x0:_0x59f8ce[_0x2451('0x1f')];var _0x4bf84e=_0x52ef9e?_0x458682[_0x2451('0x22')]:_0x59f8ce[_0x2451('0x1f')]+_0x59f8ce[_0x2451('0x21')];var _0xb53179;if(_0x4bf84e>=_0x571301){_0x4bf84e=_0x571301;_0xb53179=0xc8;}else{_0xb53179=0xce;}_0x7a935a[_0x2451('0x1d')](_0xb53179);return _0x7a935a[_0x2451('0x23')](_0x2451('0x24'),_0x5cfd9f+'-'+_0x4bf84e+'/'+_0x571301)[_0x2451('0x1e')](_0x458682);}return null;};}function patchUpdates(_0x4dd382){return function(_0x5cb073){try{jsonpatch[_0x2451('0x25')](_0x5cb073,_0x4dd382,!![]);}catch(_0x42eacf){return BPromise[_0x2451('0x26')](_0x42eacf);}return _0x5cb073[_0x2451('0x27')]();};}function saveUpdates(_0x5ec657,_0xeafcfe){return function(_0x2d5170){if(_0x2d5170){return _0x2d5170[_0x2451('0x28')](_0x5ec657)['then'](function(_0x1af07f){return _0x1af07f;});}return null;};}function removeEntity(_0x2f3ba2,_0x67ee8e){return function(_0x1616d4){if(_0x1616d4){return _0x1616d4[_0x2451('0x29')]()[_0x2451('0x2a')](function(){_0x2f3ba2['status'](0xcc)[_0x2451('0x1c')]();});}};}function handleEntityNotFound(_0x5e36b9,_0x4569d7){return function(_0x46dcb0){if(!_0x46dcb0){_0x5e36b9[_0x2451('0x1b')](0x194);}return _0x46dcb0;};}function handleError(_0x30661f,_0x41dff4){_0x41dff4=_0x41dff4||0x1f4;return function(_0x2d022d){logger['error'](_0x2d022d['stack']);if(_0x2d022d[_0x2451('0x2b')]){delete _0x2d022d[_0x2451('0x2b')];}_0x30661f[_0x2451('0x1d')](_0x41dff4)[_0x2451('0x2c')](_0x2d022d);};}exports[_0x2451('0x2d')]=function(_0x3a5bf1,_0x251728){var _0xd9d48c={},_0x10037c={},_0x426d32={'count':0x0,'rows':[]};var _0x41d8ca=_[_0x2451('0x2e')](db[_0x2451('0x2f')][_0x2451('0x30')],function(_0x3fc30d){return{'name':_0x3fc30d['fieldName'],'type':_0x3fc30d[_0x2451('0x31')][_0x2451('0x32')]};});_0x10037c[_0x2451('0x33')]=_[_0x2451('0x2e')](_0x41d8ca,_0x2451('0x2b'));_0x10037c[_0x2451('0x34')]=_['keys'](_0x3a5bf1[_0x2451('0x34')]);_0x10037c[_0x2451('0x35')]=_[_0x2451('0x36')](_0x10037c[_0x2451('0x33')],_0x10037c['query']);_0xd9d48c[_0x2451('0x37')]=_[_0x2451('0x36')](_0x10037c[_0x2451('0x33')],qs[_0x2451('0x38')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x38')]));_0xd9d48c['attributes']=_0xd9d48c[_0x2451('0x37')][_0x2451('0x39')]?_0xd9d48c[_0x2451('0x37')]:_0x10037c[_0x2451('0x33')];if(!_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3a')](_0x2451('0x3b'))){_0xd9d48c[_0x2451('0x21')]=qs[_0x2451('0x21')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x21')]);_0xd9d48c[_0x2451('0x1f')]=qs[_0x2451('0x1f')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x1f')]);}_0xd9d48c[_0x2451('0x3c')]=qs[_0x2451('0x3d')](_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3d')]);_0xd9d48c[_0x2451('0x3e')]=qs[_0x2451('0x35')](_['pick'](_0x3a5bf1['query'],_0x10037c['filters']),_0x41d8ca);if(_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3f')]){_0xd9d48c[_0x2451('0x3e')]=_[_0x2451('0x40')](_0xd9d48c[_0x2451('0x3e')],{'$or':_['map'](_0x41d8ca,function(_0x1692e8){if(_0x1692e8[_0x2451('0x31')]!==_0x2451('0x41')){var _0x49f0fa={};_0x49f0fa[_0x1692e8[_0x2451('0x2b')]]={'$like':'%'+_0x3a5bf1[_0x2451('0x34')][_0x2451('0x3f')]+'%'};return _0x49f0fa;}})});}_0xd9d48c=_[_0x2451('0x40')]({},_0xd9d48c,_0x3a5bf1[_0x2451('0x42')]);var _0x361328={'where':_0xd9d48c[_0x2451('0x3e')]};return db[_0x2451('0x2f')][_0x2451('0x22')](_0x361328)[_0x2451('0x2a')](function(_0x3ed2c2){_0x426d32[_0x2451('0x22')]=_0x3ed2c2;if(_0x3a5bf1[_0x2451('0x34')][_0x2451('0x43')]){_0xd9d48c[_0x2451('0x44')]=[{'all':!![]}];}return db[_0x2451('0x2f')][_0x2451('0x45')](_0xd9d48c);})[_0x2451('0x2a')](function(_0x20cbcf){_0x426d32[_0x2451('0x46')]=_0x20cbcf;return _0x426d32;})[_0x2451('0x2a')](respondWithFilteredResult(_0x251728,_0xd9d48c))[_0x2451('0x47')](handleError(_0x251728,null));};exports['show']=function(_0x597381,_0x3b5cbc){var _0xe37f6b={'raw':!![],'where':{'id':_0x597381[_0x2451('0x48')]['id']}},_0x2d19d0={};_0x2d19d0[_0x2451('0x33')]=_['keys'](db[_0x2451('0x2f')][_0x2451('0x30')]);_0x2d19d0[_0x2451('0x34')]=_[_0x2451('0x49')](_0x597381[_0x2451('0x34')]);_0x2d19d0[_0x2451('0x35')]=_['intersection'](_0x2d19d0['model'],_0x2d19d0[_0x2451('0x34')]);_0xe37f6b[_0x2451('0x37')]=_[_0x2451('0x36')](_0x2d19d0[_0x2451('0x33')],qs[_0x2451('0x38')](_0x597381[_0x2451('0x34')][_0x2451('0x38')]));_0xe37f6b[_0x2451('0x37')]=_0xe37f6b['attributes'][_0x2451('0x39')]?_0xe37f6b['attributes']:_0x2d19d0[_0x2451('0x33')];if(_0x597381[_0x2451('0x34')][_0x2451('0x43')]){_0xe37f6b[_0x2451('0x44')]=[{'all':!![]}];}_0xe37f6b=_[_0x2451('0x40')]({},_0xe37f6b,_0x597381[_0x2451('0x42')]);return db[_0x2451('0x2f')][_0x2451('0x4a')](_0xe37f6b)[_0x2451('0x2a')](handleEntityNotFound(_0x3b5cbc,null))[_0x2451('0x2a')](respondWithResult(_0x3b5cbc,null))[_0x2451('0x47')](handleError(_0x3b5cbc,null));};exports[_0x2451('0x4b')]=function(_0x35c2b3,_0xa3be91){return db['ZendeskField'][_0x2451('0x4b')](_0x35c2b3[_0x2451('0x4c')],{})[_0x2451('0x2a')](respondWithResult(_0xa3be91,0xc9))[_0x2451('0x47')](handleError(_0xa3be91,null));};exports[_0x2451('0x28')]=function(_0x327c52,_0x1669ce){if(_0x327c52['body']['id']){delete _0x327c52[_0x2451('0x4c')]['id'];}return db['ZendeskField'][_0x2451('0x4a')]({'where':{'id':_0x327c52[_0x2451('0x48')]['id']}})[_0x2451('0x2a')](handleEntityNotFound(_0x1669ce,null))[_0x2451('0x2a')](saveUpdates(_0x327c52['body'],null))['then'](respondWithResult(_0x1669ce,null))[_0x2451('0x47')](handleError(_0x1669ce,null));};exports['destroy']=function(_0x110d60,_0x431aa0){return db[_0x2451('0x2f')][_0x2451('0x4a')]({'where':{'id':_0x110d60[_0x2451('0x48')]['id']}})[_0x2451('0x2a')](handleEntityNotFound(_0x431aa0,null))['then'](removeEntity(_0x431aa0,null))[_0x2451('0x47')](handleError(_0x431aa0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e6fac61..f9d4958 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 _0xd99b=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0xd99b,0x11e));var _0xbd99=function(_0x27ac32,_0x42771f){_0x27ac32=_0x27ac32-0x0;var _0x20c811=_0xd99b[_0x27ac32];return _0x20c811;};'use strict';var _=require(_0xbd99('0x0'));var util=require(_0xbd99('0x1'));var logger=require(_0xbd99('0x2'))(_0xbd99('0x3'));var moment=require('moment');var BPromise=require(_0xbd99('0x4'));var rp=require(_0xbd99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd99('0x6'));var config=require(_0xbd99('0x7'));var attributes=require(_0xbd99('0x8'));module[_0xbd99('0x9')]=function(_0x57cd90,_0x12778b){return _0x57cd90[_0xbd99('0xa')](_0xbd99('0xb'),attributes,{'tableName':_0xbd99('0xc'),'paranoid':![],'indexes':[{'name':_0xbd99('0xd'),'fields':[_0xbd99('0xe'),_0xbd99('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x835c=['./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x835c,0xa7));var _0xc835=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x835c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc835('0x0'));var util=require('util');var logger=require(_0xc835('0x1'))(_0xc835('0x2'));var moment=require(_0xc835('0x3'));var BPromise=require(_0xc835('0x4'));var rp=require(_0xc835('0x5'));var fs=require('fs');var path=require(_0xc835('0x6'));var rimraf=require(_0xc835('0x7'));var config=require(_0xc835('0x8'));var attributes=require(_0xc835('0x9'));module['exports']=function(_0x357a8c,_0x114307){return _0x357a8c[_0xc835('0xa')](_0xc835('0xb'),attributes,{'tableName':_0xc835('0xc'),'paranoid':![],'indexes':[{'name':_0xc835('0xd'),'fields':[_0xc835('0xe'),_0xc835('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index bc8cbf0..bb7237d 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 _0x46b3=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x212527,_0xca3a43){var _0x57b541=function(_0x3751c4){while(--_0x3751c4){_0x212527['push'](_0x212527['shift']());}};_0x57b541(++_0xca3a43);}(_0x46b3,0x6f));var _0x346b=function(_0x165448,_0x1725ba){_0x165448=_0x165448-0x0;var _0x1bcb38=_0x46b3[_0x165448];return _0x1bcb38;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x346b('0x0'));var BPromise=require(_0x346b('0x1'));var rs=require(_0x346b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x346b('0x3'))['db'];var utils=require(_0x346b('0x4'));var logger=require('../../config/logger')(_0x346b('0x5'));var config=require(_0x346b('0x6'));var jayson=require(_0x346b('0x7'));var client=jayson[_0x346b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b480d,_0x3eb70c,_0x3054d9){return new BPromise(function(_0x10b9d7,_0x268d03){return client['request'](_0x3b480d,_0x3054d9)[_0x346b('0x9')](function(_0x1c4ef1){logger[_0x346b('0xa')](_0x346b('0xb'),_0x3eb70c,_0x346b('0xc'));logger[_0x346b('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3eb70c,'request\x20sent',JSON[_0x346b('0xe')](_0x1c4ef1));if(_0x1c4ef1[_0x346b('0xf')]){if(_0x1c4ef1['error'][_0x346b('0x10')]===0x1f4){logger['error'](_0x346b('0xb'),_0x3eb70c,_0x1c4ef1['error'][_0x346b('0x11')]);return _0x268d03(_0x1c4ef1[_0x346b('0xf')][_0x346b('0x11')]);}logger[_0x346b('0xf')]('ZendeskField,\x20%s,\x20%s',_0x3eb70c,_0x1c4ef1[_0x346b('0xf')]['message']);return _0x10b9d7(_0x1c4ef1[_0x346b('0xf')][_0x346b('0x11')]);}else{logger[_0x346b('0xa')](_0x346b('0xb'),_0x3eb70c,_0x346b('0xc'));_0x10b9d7(_0x1c4ef1[_0x346b('0x12')][_0x346b('0x11')]);}})[_0x346b('0x13')](function(_0x432b26){logger['error'](_0x346b('0xb'),_0x3eb70c,_0x432b26);_0x268d03(_0x432b26);});});} \ No newline at end of file +var _0x3016=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0x2b2ada,_0x3e95a6){var _0x4b8507=function(_0x144fe6){while(--_0x144fe6){_0x2b2ada['push'](_0x2b2ada['shift']());}};_0x4b8507(++_0x3e95a6);}(_0x3016,0x17a));var _0x6301=function(_0x6317ae,_0x4b3798){_0x6317ae=_0x6317ae-0x0;var _0x28f4a7=_0x3016[_0x6317ae];return _0x28f4a7;};'use strict';var _=require(_0x6301('0x0'));var util=require(_0x6301('0x1'));var moment=require(_0x6301('0x2'));var BPromise=require(_0x6301('0x3'));var rs=require(_0x6301('0x4'));var fs=require('fs');var Redis=require(_0x6301('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6301('0x6'))(_0x6301('0x7'));var config=require(_0x6301('0x8'));var jayson=require(_0x6301('0x9'));var client=jayson[_0x6301('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5377a4,_0x3ffad1,_0x452b8c){return new BPromise(function(_0x3742be,_0x31315b){return client[_0x6301('0xb')](_0x5377a4,_0x452b8c)[_0x6301('0xc')](function(_0x6d0456){logger[_0x6301('0xd')]('ZendeskField,\x20%s,\x20%s',_0x3ffad1,_0x6301('0xe'));logger[_0x6301('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3ffad1,_0x6301('0xe'),JSON['stringify'](_0x6d0456));if(_0x6d0456['error']){if(_0x6d0456[_0x6301('0x10')][_0x6301('0x11')]===0x1f4){logger['error'](_0x6301('0x12'),_0x3ffad1,_0x6d0456['error'][_0x6301('0x13')]);return _0x31315b(_0x6d0456[_0x6301('0x10')][_0x6301('0x13')]);}logger[_0x6301('0x10')](_0x6301('0x12'),_0x3ffad1,_0x6d0456['error'][_0x6301('0x13')]);return _0x3742be(_0x6d0456[_0x6301('0x10')][_0x6301('0x13')]);}else{logger[_0x6301('0xd')](_0x6301('0x12'),_0x3ffad1,_0x6301('0xe'));_0x3742be(_0x6d0456[_0x6301('0x14')]['message']);}})['catch'](function(_0x419c5e){logger[_0x6301('0x10')](_0x6301('0x12'),_0x3ffad1,_0x419c5e);_0x31315b(_0x419c5e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index a0fb26f..0d87e16 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 _0x91df=['/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x253d2b,_0x49a0fb){var _0x3ce8bd=function(_0x3fcafe){while(--_0x3fcafe){_0x253d2b['push'](_0x253d2b['shift']());}};_0x3ce8bd(++_0x49a0fb);}(_0x91df,0x1df));var _0xf91d=function(_0x5928aa,_0x329878){_0x5928aa=_0x5928aa-0x0;var _0x39fd8a=_0x91df[_0x5928aa];return _0x39fd8a;};'use strict';var multer=require('multer');var util=require(_0xf91d('0x0'));var path=require(_0xf91d('0x1'));var timeout=require(_0xf91d('0x2'));var express=require(_0xf91d('0x3'));var router=express[_0xf91d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf91d('0x5'));var interaction=require(_0xf91d('0x6'));var config=require(_0xf91d('0x7'));var controller=require(_0xf91d('0x8'));router[_0xf91d('0x9')]('/',auth[_0xf91d('0xa')](),controller[_0xf91d('0xb')]);router[_0xf91d('0x9')]('/:id',auth[_0xf91d('0xa')](),controller[_0xf91d('0xc')]);router[_0xf91d('0x9')](_0xf91d('0xd'),auth['isAuthenticated'](),controller[_0xf91d('0xe')]);router[_0xf91d('0x9')](_0xf91d('0xf'),auth[_0xf91d('0xa')](),controller[_0xf91d('0x10')]);router[_0xf91d('0x11')]('/',auth[_0xf91d('0xa')](),controller[_0xf91d('0x12')]);router['post'](_0xf91d('0xd'),auth[_0xf91d('0xa')](),controller[_0xf91d('0x13')]);router[_0xf91d('0x14')](_0xf91d('0x15'),auth[_0xf91d('0xa')](),controller['update']);router[_0xf91d('0x16')](_0xf91d('0x15'),auth[_0xf91d('0xa')](),controller[_0xf91d('0x17')]);module[_0xf91d('0x18')]=router; \ No newline at end of file +var _0x25d0=['create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x4f4f59,_0x4215c1){var _0x322725=function(_0x4eda03){while(--_0x4eda03){_0x4f4f59['push'](_0x4f4f59['shift']());}};_0x322725(++_0x4215c1);}(_0x25d0,0x100));var _0x025d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x025d('0x0'));var util=require(_0x025d('0x1'));var path=require(_0x025d('0x2'));var timeout=require(_0x025d('0x3'));var express=require(_0x025d('0x4'));var router=express[_0x025d('0x5')]();var fs_extra=require(_0x025d('0x6'));var auth=require(_0x025d('0x7'));var interaction=require(_0x025d('0x8'));var config=require('../../config/environment');var controller=require(_0x025d('0x9'));router['get']('/',auth[_0x025d('0xa')](),controller[_0x025d('0xb')]);router[_0x025d('0xc')](_0x025d('0xd'),auth[_0x025d('0xa')](),controller[_0x025d('0xe')]);router[_0x025d('0xc')](_0x025d('0xf'),auth[_0x025d('0xa')](),controller[_0x025d('0x10')]);router['get'](_0x025d('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0x025d('0x12')]('/',auth['isAuthenticated'](),controller[_0x025d('0x13')]);router[_0x025d('0x12')]('/:id/configurations',auth[_0x025d('0xa')](),controller[_0x025d('0x14')]);router[_0x025d('0x15')](_0x025d('0xd'),auth[_0x025d('0xa')](),controller[_0x025d('0x16')]);router['delete'](_0x025d('0xd'),auth[_0x025d('0xa')](),controller[_0x025d('0x17')]);module[_0x025d('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index f571c0b..a5f6158 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(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x153f,0x15b));var _0xf153=function(_0x2e2dd2,_0x37c16e){_0x2e2dd2=_0x2e2dd2-0x0;var _0x2bb814=_0x153f[_0x2e2dd2];return _0x2bb814;};'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 _0xb821=['STRING','exports'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xb821,0xa7));var _0x1b82=function(_0x127650,_0x18c9cf){_0x127650=_0x127650-0x0;var _0x24c7a2=_0xb821[_0x127650];return _0x24c7a2;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'name':{'type':Sequelize[_0x1b82('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x1b82('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b82('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x1b82('0x1')]},'refreshToken':{'type':Sequelize[_0x1b82('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a3d77ef..0864caa 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 _0x8f40=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','sendStatus','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','findAll','rows','show','include','find','catch','create','body','params','findOne','length','filter','nolimit','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','ZohoConfiguration','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','refreshToken','com','slice','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','custom_field','data_type','picklist','test','statusCode','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x209ad0,_0x178ba3){var _0x1859dd=function(_0x592de6){while(--_0x592de6){_0x209ad0['push'](_0x209ad0['shift']());}};_0x1859dd(++_0x178ba3);}(_0x8f40,0x1d8));var _0x08f4=function(_0x46218c,_0x4b18f2){_0x46218c=_0x46218c-0x0;var _0x424188=_0x8f40[_0x46218c];return _0x424188;};'use strict';var emlformat=require(_0x08f4('0x0'));var rimraf=require(_0x08f4('0x1'));var zipdir=require(_0x08f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08f4('0x3'));var moment=require(_0x08f4('0x4'));var BPromise=require(_0x08f4('0x5'));var Mustache=require(_0x08f4('0x6'));var util=require(_0x08f4('0x7'));var path=require('path');var sox=require(_0x08f4('0x8'));var csv=require(_0x08f4('0x9'));var ejs=require(_0x08f4('0xa'));var fs=require('fs');var fs_extra=require(_0x08f4('0xb'));var _=require(_0x08f4('0xc'));var squel=require(_0x08f4('0xd'));var crypto=require('crypto');var jsforce=require(_0x08f4('0xe'));var deskjs=require(_0x08f4('0xf'));var toCsv=require(_0x08f4('0x9'));var querystring=require(_0x08f4('0x10'));var Papa=require(_0x08f4('0x11'));var Redis=require(_0x08f4('0x12'));var authService=require(_0x08f4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x08f4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08f4('0x15'))(_0x08f4('0x16'));var utils=require(_0x08f4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x08f4('0x18'));var db=require(_0x08f4('0x19'))['db'];var integrations=require(_0x08f4('0x1a'));function respondWithStatusCode(_0x5987d3,_0x51aba4){_0x51aba4=_0x51aba4||0xcc;return function(_0x576bb4){if(_0x576bb4){return _0x5987d3['sendStatus'](_0x51aba4);}return _0x5987d3[_0x08f4('0x1b')](_0x51aba4)[_0x08f4('0x1c')]();};}function respondWithResult(_0x1087bf,_0x1e8e5b){_0x1e8e5b=_0x1e8e5b||0xc8;return function(_0x991e30){if(_0x991e30){return _0x1087bf[_0x08f4('0x1b')](_0x1e8e5b)['json'](_0x991e30);}};}function respondWithFilteredResult(_0x3c0960,_0x525aea){return function(_0x3e981d){if(_0x3e981d){var _0x56fd34=typeof _0x525aea['offset']===_0x08f4('0x1d')&&typeof _0x525aea[_0x08f4('0x1e')]==='undefined';var _0x4d38ee=_0x3e981d[_0x08f4('0x1f')];var _0x3bb751=_0x56fd34?0x0:_0x525aea['offset'];var _0x366800=_0x56fd34?_0x3e981d[_0x08f4('0x1f')]:_0x525aea[_0x08f4('0x20')]+_0x525aea[_0x08f4('0x1e')];var _0x2e6076;if(_0x366800>=_0x4d38ee){_0x366800=_0x4d38ee;_0x2e6076=0xc8;}else{_0x2e6076=0xce;}_0x3c0960['status'](_0x2e6076);return _0x3c0960[_0x08f4('0x21')](_0x08f4('0x22'),_0x3bb751+'-'+_0x366800+'/'+_0x4d38ee)[_0x08f4('0x23')](_0x3e981d);}return null;};}function patchUpdates(_0x5c4ab8){return function(_0x175e0c){try{jsonpatch['apply'](_0x175e0c,_0x5c4ab8,!![]);}catch(_0xed9660){return BPromise['reject'](_0xed9660);}return _0x175e0c[_0x08f4('0x24')]();};}function saveUpdates(_0x4e9829,_0x2684a4){return function(_0x21ea15){if(_0x21ea15){return _0x21ea15[_0x08f4('0x25')](_0x4e9829)[_0x08f4('0x26')](function(_0x131da2){return _0x131da2;});}return null;};}function removeEntity(_0x34d889,_0x460eed){return function(_0x36c5fa){if(_0x36c5fa){return _0x36c5fa['destroy']()['then'](function(){_0x34d889[_0x08f4('0x1b')](0xcc)[_0x08f4('0x1c')]();});}};}function handleEntityNotFound(_0x3fc866,_0x184f1c){return function(_0x55af42){if(!_0x55af42){_0x3fc866[_0x08f4('0x27')](0x194);}return _0x55af42;};}function handleError(_0x5d6b58,_0x168fcb){_0x168fcb=_0x168fcb||0x1f4;return function(_0x37dce8){logger[_0x08f4('0x28')](_0x37dce8[_0x08f4('0x29')]);if(_0x37dce8[_0x08f4('0x2a')]){delete _0x37dce8['name'];}_0x5d6b58[_0x08f4('0x1b')](_0x168fcb)[_0x08f4('0x2b')](_0x37dce8);};}exports[_0x08f4('0x2c')]=function(_0x5b5aec,_0x3c0f30){var _0x270336={},_0x51b8d1={},_0x1ca54c={'count':0x0,'rows':[]};var _0x8e3934=_['map'](db[_0x08f4('0x2d')][_0x08f4('0x2e')],function(_0x108d7f){return{'name':_0x108d7f[_0x08f4('0x2f')],'type':_0x108d7f[_0x08f4('0x30')][_0x08f4('0x31')]};});_0x51b8d1['model']=_[_0x08f4('0x32')](_0x8e3934,'name');_0x51b8d1[_0x08f4('0x33')]=_[_0x08f4('0x34')](_0x5b5aec['query']);_0x51b8d1[_0x08f4('0x35')]=_[_0x08f4('0x36')](_0x51b8d1[_0x08f4('0x37')],_0x51b8d1[_0x08f4('0x33')]);_0x270336[_0x08f4('0x38')]=_[_0x08f4('0x36')](_0x51b8d1[_0x08f4('0x37')],qs[_0x08f4('0x39')](_0x5b5aec['query'][_0x08f4('0x39')]));_0x270336[_0x08f4('0x38')]=_0x270336['attributes']['length']?_0x270336['attributes']:_0x51b8d1['model'];if(!_0x5b5aec[_0x08f4('0x33')][_0x08f4('0x3a')]('nolimit')){_0x270336[_0x08f4('0x1e')]=qs[_0x08f4('0x1e')](_0x5b5aec['query'][_0x08f4('0x1e')]);_0x270336[_0x08f4('0x20')]=qs[_0x08f4('0x20')](_0x5b5aec[_0x08f4('0x33')]['offset']);}_0x270336[_0x08f4('0x3b')]=qs[_0x08f4('0x3c')](_0x5b5aec[_0x08f4('0x33')][_0x08f4('0x3c')]);_0x270336[_0x08f4('0x3d')]=qs['filters'](_[_0x08f4('0x3e')](_0x5b5aec['query'],_0x51b8d1[_0x08f4('0x35')]),_0x8e3934);if(_0x5b5aec[_0x08f4('0x33')]['filter']){_0x270336[_0x08f4('0x3d')]=_[_0x08f4('0x3f')](_0x270336[_0x08f4('0x3d')],{'$or':_[_0x08f4('0x32')](_0x8e3934,function(_0x33f34d){if(_0x33f34d[_0x08f4('0x30')]!==_0x08f4('0x40')){var _0x4a5d34={};_0x4a5d34[_0x33f34d[_0x08f4('0x2a')]]={'$like':'%'+_0x5b5aec['query']['filter']+'%'};return _0x4a5d34;}})});}_0x270336=_[_0x08f4('0x3f')]({},_0x270336,_0x5b5aec['options']);var _0x47383e={'where':_0x270336[_0x08f4('0x3d')]};return db[_0x08f4('0x2d')]['count'](_0x47383e)['then'](function(_0x53c8ea){_0x1ca54c[_0x08f4('0x1f')]=_0x53c8ea;if(_0x5b5aec[_0x08f4('0x33')]['includeAll']){_0x270336['include']=[{'all':!![]}];}return db[_0x08f4('0x2d')][_0x08f4('0x41')](_0x270336);})[_0x08f4('0x26')](function(_0x99c87f){_0x1ca54c[_0x08f4('0x42')]=_0x99c87f;return _0x1ca54c;})[_0x08f4('0x26')](respondWithFilteredResult(_0x3c0f30,_0x270336))['catch'](handleError(_0x3c0f30,null));};exports[_0x08f4('0x43')]=function(_0x4c5074,_0x439149){var _0x2d850d={'raw':![],'where':{'id':_0x4c5074['params']['id']}},_0x482f91={};_0x482f91[_0x08f4('0x37')]=_[_0x08f4('0x34')](db[_0x08f4('0x2d')][_0x08f4('0x2e')]);_0x482f91[_0x08f4('0x33')]=_[_0x08f4('0x34')](_0x4c5074['query']);_0x482f91[_0x08f4('0x35')]=_[_0x08f4('0x36')](_0x482f91[_0x08f4('0x37')],_0x482f91[_0x08f4('0x33')]);_0x2d850d[_0x08f4('0x38')]=_[_0x08f4('0x36')](_0x482f91['model'],qs['fields'](_0x4c5074[_0x08f4('0x33')][_0x08f4('0x39')]));_0x2d850d['attributes']=_0x2d850d[_0x08f4('0x38')]['length']?_0x2d850d[_0x08f4('0x38')]:_0x482f91[_0x08f4('0x37')];if(_0x4c5074[_0x08f4('0x33')]['includeAll']){_0x2d850d[_0x08f4('0x44')]=[{'all':!![]}];}_0x2d850d=_['merge']({},_0x2d850d,_0x4c5074['options']);return db['ZohoAccount'][_0x08f4('0x45')](_0x2d850d)['then'](handleEntityNotFound(_0x439149,null))[_0x08f4('0x26')](respondWithResult(_0x439149,null))[_0x08f4('0x46')](handleError(_0x439149,null));};exports[_0x08f4('0x47')]=function(_0x5c9992,_0xd6686a){return db['ZohoAccount']['create'](_0x5c9992['body'],{})['then'](respondWithResult(_0xd6686a,0xc9))['catch'](handleError(_0xd6686a,null));};exports[_0x08f4('0x25')]=function(_0x2ea27e,_0x55d3cb){if(_0x2ea27e[_0x08f4('0x48')]['id']){delete _0x2ea27e['body']['id'];}return db[_0x08f4('0x2d')][_0x08f4('0x45')]({'where':{'id':_0x2ea27e[_0x08f4('0x49')]['id']}})[_0x08f4('0x26')](handleEntityNotFound(_0x55d3cb,null))[_0x08f4('0x26')](saveUpdates(_0x2ea27e[_0x08f4('0x48')],null))['then'](respondWithResult(_0x55d3cb,null))['catch'](handleError(_0x55d3cb,null));};exports['destroy']=function(_0x5cfa6e,_0x1f15fb){return db['ZohoAccount'][_0x08f4('0x45')]({'where':{'id':_0x5cfa6e[_0x08f4('0x49')]['id']}})[_0x08f4('0x26')](handleEntityNotFound(_0x1f15fb,null))[_0x08f4('0x26')](removeEntity(_0x1f15fb,null))['catch'](handleError(_0x1f15fb,null));};exports['getConfigurations']=function(_0x342ee1,_0x3d0f06,_0x5a34b2){var _0x35d6a8={};var _0x35af72={};var _0x14a975;var _0x2d7b66;return db[_0x08f4('0x2d')][_0x08f4('0x4a')]({'where':{'id':_0x342ee1[_0x08f4('0x49')]['id']}})[_0x08f4('0x26')](handleEntityNotFound(_0x3d0f06,null))[_0x08f4('0x26')](function(_0x4c2ae1){if(_0x4c2ae1){_0x14a975=_0x4c2ae1;_0x35af72[_0x08f4('0x37')]=_[_0x08f4('0x34')](db['ZohoConfiguration'][_0x08f4('0x2e')]);_0x35af72[_0x08f4('0x33')]=_[_0x08f4('0x34')](_0x342ee1[_0x08f4('0x33')]);_0x35af72[_0x08f4('0x35')]=_[_0x08f4('0x36')](_0x35af72[_0x08f4('0x37')],_0x35af72[_0x08f4('0x33')]);_0x35d6a8[_0x08f4('0x38')]=_[_0x08f4('0x36')](_0x35af72[_0x08f4('0x37')],qs[_0x08f4('0x39')](_0x342ee1[_0x08f4('0x33')][_0x08f4('0x39')]));_0x35d6a8[_0x08f4('0x38')]=_0x35d6a8[_0x08f4('0x38')][_0x08f4('0x4b')]?_0x35d6a8['attributes']:_0x35af72[_0x08f4('0x37')];_0x35d6a8[_0x08f4('0x3b')]=qs[_0x08f4('0x3c')](_0x342ee1[_0x08f4('0x33')][_0x08f4('0x3c')]);_0x35d6a8[_0x08f4('0x3d')]=qs['filters'](_[_0x08f4('0x3e')](_0x342ee1['query'],_0x35af72[_0x08f4('0x35')]));if(_0x342ee1[_0x08f4('0x33')][_0x08f4('0x4c')]){_0x35d6a8[_0x08f4('0x3d')]=_['merge'](_0x35d6a8[_0x08f4('0x3d')],{'$or':_[_0x08f4('0x32')](_0x35d6a8[_0x08f4('0x38')],function(_0x57a265){var _0x470108={};_0x470108[_0x57a265]={'$like':'%'+_0x342ee1['query']['filter']+'%'};return _0x470108;})});}_0x35d6a8=_[_0x08f4('0x3f')]({},_0x35d6a8,_0x342ee1['options']);return _0x14a975['getConfigurations'](_0x35d6a8);}})[_0x08f4('0x26')](function(_0x69441){if(_0x69441){_0x2d7b66=_0x69441[_0x08f4('0x4b')];if(!_0x342ee1[_0x08f4('0x33')][_0x08f4('0x3a')](_0x08f4('0x4d'))){_0x35d6a8[_0x08f4('0x1e')]=qs[_0x08f4('0x1e')](_0x342ee1[_0x08f4('0x33')][_0x08f4('0x1e')]);_0x35d6a8[_0x08f4('0x20')]=qs['offset'](_0x342ee1[_0x08f4('0x33')]['offset']);}return _0x14a975[_0x08f4('0x4e')](_0x35d6a8);}})[_0x08f4('0x26')](function(_0x306c54){if(_0x306c54){return _0x306c54?{'count':_0x2d7b66,'rows':_0x306c54}:null;}})[_0x08f4('0x26')](respondWithResult(_0x3d0f06,null))['catch'](handleError(_0x3d0f06,null));};exports['addConfiguration']=function(_0x295941,_0x5c84df,_0x1466ef){if(_0x295941[_0x08f4('0x48')]['id']){delete _0x295941['body']['id'];}return db['ZohoAccount'][_0x08f4('0x4a')]({'where':{'id':_0x295941[_0x08f4('0x49')]['id']}})[_0x08f4('0x26')](handleEntityNotFound(_0x5c84df,null))[_0x08f4('0x26')](function(_0x21251e){if(_0x21251e){_0x295941[_0x08f4('0x48')][_0x08f4('0x4f')]=_0x21251e['id'];_0x295941[_0x08f4('0x48')][_0x08f4('0x50')]=integrations[_0x08f4('0x51')](_0x295941['body']['channel'],_0x295941['body']['type']);_0x295941[_0x08f4('0x48')][_0x08f4('0x52')]=integrations['getDescriptions'](_0x295941[_0x08f4('0x48')]['channel'],_0x295941['body']['type']);return db[_0x08f4('0x53')][_0x08f4('0x47')](_0x295941[_0x08f4('0x48')],{'include':[{'model':db['ZohoField'],'as':_0x08f4('0x50')},{'model':db['ZohoField'],'as':_0x08f4('0x52')}]});}return null;})[_0x08f4('0x26')](respondWithResult(_0x5c84df,null))['catch'](handleError(_0x5c84df,null));};function getAccessToken(_0x41f246){return new Promise(function(_0x29b909,_0x261692){var _0x4c9870;switch(_0x41f246['zone']){case'US':_0x4c9870=_0x08f4('0x54');break;case'AU':_0x4c9870=_0x08f4('0x55');break;case'EU':_0x4c9870=_0x08f4('0x56');break;case'IN':_0x4c9870='https://accounts.zoho.in';break;case'CN':_0x4c9870='https://accounts.zoho.com.cn';break;default:_0x4c9870=_0x08f4('0x56');break;}var _0x3e1228={'method':'POST','uri':_0x4c9870+_0x08f4('0x57'),'qs':{'refresh_token':_0x41f246['refreshToken'],'client_id':_0x41f246[_0x08f4('0x58')],'client_secret':_0x41f246[_0x08f4('0x59')],'grant_type':_0x08f4('0x5a')},'json':!![]};return rp(_0x3e1228)[_0x08f4('0x26')](function(_0x4538ae){if(_0x4538ae[_0x08f4('0x5b')]){_0x29b909(_0x4538ae[_0x08f4('0x5b')]);}else{_0x261692(_0x08f4('0x5c'));}})[_0x08f4('0x46')](function(_0x15a241){_0x261692(_0x15a241);});});}exports[_0x08f4('0x5d')]=function(_0x14eaa4,_0x3426d1,_0x44cba8){var _0x2cf9f5,_0x15d688,_0x492529,_0x3ead7e,_0x4fb99b;return db['ZohoAccount'][_0x08f4('0x4a')]({'where':{'id':_0x14eaa4[_0x08f4('0x49')]['id']},'attributes':['id','host','zone',_0x08f4('0x58'),_0x08f4('0x59'),_0x08f4('0x5e'),_0x08f4('0x5f'),_0x08f4('0x60')]})['then'](handleEntityNotFound(_0x3426d1,null))[_0x08f4('0x26')](function(_0x3abed4){_0x4fb99b=_0x3abed4;_0x2cf9f5=_0x4fb99b['host'];_0x15d688=_0x2cf9f5==='zoho.eu'?'eu':_0x08f4('0x61');_0x492529=_0x4fb99b[_0x08f4('0x5e')];var _0x37a9cd=_0x492529[_0x08f4('0x62')](-0x1);if(_0x37a9cd==='/'||_0x37a9cd==='\x5c'||_0x37a9cd===':'){_0x492529=_0x492529['substring'](0x0,_0x492529[_0x08f4('0x63')](_0x37a9cd));}if(!_0x4fb99b[_0x08f4('0x60')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4fb99b);})[_0x08f4('0x26')](function(_0x4aafe9){if(_0x4aafe9){return rp({'method':_0x08f4('0x64'),'uri':util[_0x08f4('0x65')](_0x08f4('0x66'),_0x15d688),'qs':{'module':'Calls'},'headers':{'Authorization':_0x08f4('0x67')+_0x4aafe9},'json':!![]});}})[_0x08f4('0x26')](function(_0x39a568){if(_0x39a568){if(_0x39a568[_0x08f4('0x68')]&&_0x39a568[_0x08f4('0x68')]['error']){throw new Error(_0x39a568['response'][_0x08f4('0x28')][_0x08f4('0x69')]);}var _0x5dba76=[];var _0x3f23fd=[];var _0x18b24b=[_0x08f4('0x6a'),_0x08f4('0x6b'),_0x08f4('0x6c'),'WhoId',_0x08f4('0x6d'),_0x08f4('0x6e'),_0x08f4('0x6f'),_0x08f4('0x70')];_0x3f23fd=_[_0x08f4('0x71')](_0x39a568[_0x08f4('0x39')],function(_0xb42b84){return _0x18b24b[_0x08f4('0x72')](_0xb42b84[_0x08f4('0x73')]);});for(var _0x437791=0x0;_0x437791<_0x3f23fd[_0x08f4('0x4b')];_0x437791++){if(_0x3f23fd[_0x437791][_0x08f4('0x74')]===![]){_0x5dba76['push']({'id':_0x3f23fd[_0x437791]['id'],'name':_0x3f23fd[_0x437791]['display_label'],'custom':_0x3f23fd[_0x437791][_0x08f4('0x75')],'options':_0x3f23fd[_0x437791][_0x08f4('0x76')]===_0x08f4('0x77')&&_0x3f23fd[_0x437791]['pick_list_values'][_0x08f4('0x4b')]>-0x1?_[_0x08f4('0x32')](_0x3f23fd[_0x437791]['pick_list_values'],function(_0x1bab99){return{'name':_0x1bab99,'value':_0x1bab99};}):[]});}}return{'count':_0x5dba76['length'],'rows':_0x5dba76};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3426d1,null))[_0x08f4('0x46')](function(_0x3c9de8){var _0x1455e3=_0x14eaa4[_0x08f4('0x33')][_0x08f4('0x78')]?0x1f4:_0x3c9de8[_0x08f4('0x79')]||0x1f4;logger[_0x08f4('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x08f4('0x5d'),_0x1455e3,JSON[_0x08f4('0x7a')](_0x3c9de8));delete _0x3c9de8[_0x08f4('0x2a')];if(_0x1455e3===0x191){_0x1455e3=0x190;}_0x3426d1[_0x08f4('0x1b')](_0x1455e3)['send'](_0x14eaa4[_0x08f4('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3c9de8[_0x08f4('0x79')]}:_0x3c9de8);});}; \ No newline at end of file +var _0xafbf=['merge','VIRTUAL','options','ZohoAccount','then','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','params','destroy','find','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','nolimit','getSubjects','getDescriptions','channel','Subjects','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','getFields','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','save','update','error','name','send','map','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter'];(function(_0x1ee367,_0x3f99e6){var _0x1b2213=function(_0x42dd22){while(--_0x42dd22){_0x1ee367['push'](_0x1ee367['shift']());}};_0x1b2213(++_0x3f99e6);}(_0xafbf,0x13c));var _0xfafb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xafbf[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfafb('0x0'));var rimraf=require(_0xfafb('0x1'));var zipdir=require(_0xfafb('0x2'));var jsonpatch=require(_0xfafb('0x3'));var rp=require(_0xfafb('0x4'));var moment=require(_0xfafb('0x5'));var BPromise=require(_0xfafb('0x6'));var Mustache=require(_0xfafb('0x7'));var util=require(_0xfafb('0x8'));var path=require(_0xfafb('0x9'));var sox=require('sox');var csv=require(_0xfafb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfafb('0xb'));var _=require('lodash');var squel=require(_0xfafb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfafb('0xd'));var toCsv=require(_0xfafb('0xa'));var querystring=require(_0xfafb('0xe'));var Papa=require(_0xfafb('0xf'));var Redis=require(_0xfafb('0x10'));var authService=require(_0xfafb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfafb('0x12'));var logger=require(_0xfafb('0x13'))(_0xfafb('0x14'));var utils=require(_0xfafb('0x15'));var config=require(_0xfafb('0x16'));var licenseUtil=require(_0xfafb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfafb('0x18'));function respondWithStatusCode(_0x1ded9f,_0x439ef3){_0x439ef3=_0x439ef3||0xcc;return function(_0x32bb69){if(_0x32bb69){return _0x1ded9f[_0xfafb('0x19')](_0x439ef3);}return _0x1ded9f[_0xfafb('0x1a')](_0x439ef3)[_0xfafb('0x1b')]();};}function respondWithResult(_0x3b3703,_0x40a649){_0x40a649=_0x40a649||0xc8;return function(_0x56dfb){if(_0x56dfb){return _0x3b3703[_0xfafb('0x1a')](_0x40a649)[_0xfafb('0x1c')](_0x56dfb);}};}function respondWithFilteredResult(_0x36edbe,_0x228587){return function(_0x4bb644){if(_0x4bb644){var _0x487a24=typeof _0x228587[_0xfafb('0x1d')]==='undefined'&&typeof _0x228587[_0xfafb('0x1e')]===_0xfafb('0x1f');var _0x5c1aa5=_0x4bb644[_0xfafb('0x20')];var _0x2a1a8d=_0x487a24?0x0:_0x228587[_0xfafb('0x1d')];var _0x30a095=_0x487a24?_0x4bb644[_0xfafb('0x20')]:_0x228587['offset']+_0x228587[_0xfafb('0x1e')];var _0x4dd280;if(_0x30a095>=_0x5c1aa5){_0x30a095=_0x5c1aa5;_0x4dd280=0xc8;}else{_0x4dd280=0xce;}_0x36edbe[_0xfafb('0x1a')](_0x4dd280);return _0x36edbe['set'](_0xfafb('0x21'),_0x2a1a8d+'-'+_0x30a095+'/'+_0x5c1aa5)[_0xfafb('0x1c')](_0x4bb644);}return null;};}function patchUpdates(_0x26bc85){return function(_0x34438d){try{jsonpatch['apply'](_0x34438d,_0x26bc85,!![]);}catch(_0x2db844){return BPromise['reject'](_0x2db844);}return _0x34438d[_0xfafb('0x22')]();};}function saveUpdates(_0x3eab3b,_0x1aaff6){return function(_0xb507ab){if(_0xb507ab){return _0xb507ab[_0xfafb('0x23')](_0x3eab3b)['then'](function(_0x16dd43){return _0x16dd43;});}return null;};}function removeEntity(_0x181b1c,_0x5a752c){return function(_0x5a3875){if(_0x5a3875){return _0x5a3875['destroy']()['then'](function(){_0x181b1c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4292e7,_0x5c77e1){return function(_0x52e378){if(!_0x52e378){_0x4292e7[_0xfafb('0x19')](0x194);}return _0x52e378;};}function handleError(_0x3506e7,_0x25bf9a){_0x25bf9a=_0x25bf9a||0x1f4;return function(_0xae9dc7){logger[_0xfafb('0x24')](_0xae9dc7['stack']);if(_0xae9dc7[_0xfafb('0x25')]){delete _0xae9dc7['name'];}_0x3506e7[_0xfafb('0x1a')](_0x25bf9a)[_0xfafb('0x26')](_0xae9dc7);};}exports['index']=function(_0x326ddb,_0x11688a){var _0x48b2fd={},_0x16be9d={},_0x59b44c={'count':0x0,'rows':[]};var _0x137695=_[_0xfafb('0x27')](db['ZohoAccount']['rawAttributes'],function(_0x102956){return{'name':_0x102956[_0xfafb('0x28')],'type':_0x102956[_0xfafb('0x29')][_0xfafb('0x2a')]};});_0x16be9d[_0xfafb('0x2b')]=_[_0xfafb('0x27')](_0x137695,_0xfafb('0x25'));_0x16be9d['query']=_[_0xfafb('0x2c')](_0x326ddb[_0xfafb('0x2d')]);_0x16be9d[_0xfafb('0x2e')]=_['intersection'](_0x16be9d[_0xfafb('0x2b')],_0x16be9d['query']);_0x48b2fd[_0xfafb('0x2f')]=_[_0xfafb('0x30')](_0x16be9d[_0xfafb('0x2b')],qs[_0xfafb('0x31')](_0x326ddb['query'][_0xfafb('0x31')]));_0x48b2fd['attributes']=_0x48b2fd[_0xfafb('0x2f')][_0xfafb('0x32')]?_0x48b2fd[_0xfafb('0x2f')]:_0x16be9d[_0xfafb('0x2b')];if(!_0x326ddb['query']['hasOwnProperty']('nolimit')){_0x48b2fd[_0xfafb('0x1e')]=qs[_0xfafb('0x1e')](_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x1e')]);_0x48b2fd['offset']=qs[_0xfafb('0x1d')](_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x1d')]);}_0x48b2fd[_0xfafb('0x33')]=qs['sort'](_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x34')]);_0x48b2fd[_0xfafb('0x35')]=qs[_0xfafb('0x2e')](_[_0xfafb('0x36')](_0x326ddb['query'],_0x16be9d[_0xfafb('0x2e')]),_0x137695);if(_0x326ddb['query'][_0xfafb('0x37')]){_0x48b2fd[_0xfafb('0x35')]=_[_0xfafb('0x38')](_0x48b2fd[_0xfafb('0x35')],{'$or':_['map'](_0x137695,function(_0x568f87){if(_0x568f87['type']!==_0xfafb('0x39')){var _0x522b1e={};_0x522b1e[_0x568f87['name']]={'$like':'%'+_0x326ddb['query'][_0xfafb('0x37')]+'%'};return _0x522b1e;}})});}_0x48b2fd=_[_0xfafb('0x38')]({},_0x48b2fd,_0x326ddb[_0xfafb('0x3a')]);var _0x3ae526={'where':_0x48b2fd[_0xfafb('0x35')]};return db[_0xfafb('0x3b')][_0xfafb('0x20')](_0x3ae526)[_0xfafb('0x3c')](function(_0x16e79e){_0x59b44c[_0xfafb('0x20')]=_0x16e79e;if(_0x326ddb[_0xfafb('0x2d')][_0xfafb('0x3d')]){_0x48b2fd['include']=[{'all':!![]}];}return db[_0xfafb('0x3b')][_0xfafb('0x3e')](_0x48b2fd);})[_0xfafb('0x3c')](function(_0x2db2f7){_0x59b44c[_0xfafb('0x3f')]=_0x2db2f7;return _0x59b44c;})[_0xfafb('0x3c')](respondWithFilteredResult(_0x11688a,_0x48b2fd))[_0xfafb('0x40')](handleError(_0x11688a,null));};exports[_0xfafb('0x41')]=function(_0x321c46,_0x24aa9a){var _0x23295d={'raw':![],'where':{'id':_0x321c46['params']['id']}},_0xea081d={};_0xea081d[_0xfafb('0x2b')]=_[_0xfafb('0x2c')](db[_0xfafb('0x3b')][_0xfafb('0x42')]);_0xea081d['query']=_[_0xfafb('0x2c')](_0x321c46[_0xfafb('0x2d')]);_0xea081d['filters']=_['intersection'](_0xea081d['model'],_0xea081d[_0xfafb('0x2d')]);_0x23295d[_0xfafb('0x2f')]=_[_0xfafb('0x30')](_0xea081d[_0xfafb('0x2b')],qs[_0xfafb('0x31')](_0x321c46['query'][_0xfafb('0x31')]));_0x23295d[_0xfafb('0x2f')]=_0x23295d[_0xfafb('0x2f')][_0xfafb('0x32')]?_0x23295d[_0xfafb('0x2f')]:_0xea081d[_0xfafb('0x2b')];if(_0x321c46[_0xfafb('0x2d')]['includeAll']){_0x23295d[_0xfafb('0x43')]=[{'all':!![]}];}_0x23295d=_[_0xfafb('0x38')]({},_0x23295d,_0x321c46[_0xfafb('0x3a')]);return db['ZohoAccount']['find'](_0x23295d)[_0xfafb('0x3c')](handleEntityNotFound(_0x24aa9a,null))[_0xfafb('0x3c')](respondWithResult(_0x24aa9a,null))[_0xfafb('0x40')](handleError(_0x24aa9a,null));};exports[_0xfafb('0x44')]=function(_0x2c7b07,_0x5e1f4c){return db[_0xfafb('0x3b')][_0xfafb('0x44')](_0x2c7b07[_0xfafb('0x45')],{})['then'](respondWithResult(_0x5e1f4c,0xc9))[_0xfafb('0x40')](handleError(_0x5e1f4c,null));};exports[_0xfafb('0x23')]=function(_0x4991e5,_0xbc3a05){if(_0x4991e5[_0xfafb('0x45')]['id']){delete _0x4991e5[_0xfafb('0x45')]['id'];}return db[_0xfafb('0x3b')]['find']({'where':{'id':_0x4991e5[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0xbc3a05,null))[_0xfafb('0x3c')](saveUpdates(_0x4991e5[_0xfafb('0x45')],null))['then'](respondWithResult(_0xbc3a05,null))[_0xfafb('0x40')](handleError(_0xbc3a05,null));};exports[_0xfafb('0x47')]=function(_0x3879de,_0x40446b){return db['ZohoAccount'][_0xfafb('0x48')]({'where':{'id':_0x3879de[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0x40446b,null))[_0xfafb('0x3c')](removeEntity(_0x40446b,null))[_0xfafb('0x40')](handleError(_0x40446b,null));};exports['getConfigurations']=function(_0x858cc3,_0x57d635,_0xf2e014){var _0x5bf74c={};var _0x2196c6={};var _0x136cc0;var _0x2a95da;return db[_0xfafb('0x3b')][_0xfafb('0x49')]({'where':{'id':_0x858cc3[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0x57d635,null))[_0xfafb('0x3c')](function(_0x2fa8d5){if(_0x2fa8d5){_0x136cc0=_0x2fa8d5;_0x2196c6[_0xfafb('0x2b')]=_[_0xfafb('0x2c')](db[_0xfafb('0x4a')]['rawAttributes']);_0x2196c6[_0xfafb('0x2d')]=_[_0xfafb('0x2c')](_0x858cc3['query']);_0x2196c6['filters']=_[_0xfafb('0x30')](_0x2196c6[_0xfafb('0x2b')],_0x2196c6[_0xfafb('0x2d')]);_0x5bf74c[_0xfafb('0x2f')]=_['intersection'](_0x2196c6[_0xfafb('0x2b')],qs[_0xfafb('0x31')](_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x31')]));_0x5bf74c['attributes']=_0x5bf74c[_0xfafb('0x2f')][_0xfafb('0x32')]?_0x5bf74c['attributes']:_0x2196c6['model'];_0x5bf74c[_0xfafb('0x33')]=qs[_0xfafb('0x34')](_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x34')]);_0x5bf74c[_0xfafb('0x35')]=qs[_0xfafb('0x2e')](_['pick'](_0x858cc3['query'],_0x2196c6[_0xfafb('0x2e')]));if(_0x858cc3['query'][_0xfafb('0x37')]){_0x5bf74c[_0xfafb('0x35')]=_[_0xfafb('0x38')](_0x5bf74c[_0xfafb('0x35')],{'$or':_[_0xfafb('0x27')](_0x5bf74c[_0xfafb('0x2f')],function(_0x22cede){var _0x147c56={};_0x147c56[_0x22cede]={'$like':'%'+_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x37')]+'%'};return _0x147c56;})});}_0x5bf74c=_[_0xfafb('0x38')]({},_0x5bf74c,_0x858cc3[_0xfafb('0x3a')]);return _0x136cc0[_0xfafb('0x4b')](_0x5bf74c);}})['then'](function(_0x50fa21){if(_0x50fa21){_0x2a95da=_0x50fa21[_0xfafb('0x32')];if(!_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x4c')](_0xfafb('0x4d'))){_0x5bf74c[_0xfafb('0x1e')]=qs[_0xfafb('0x1e')](_0x858cc3[_0xfafb('0x2d')][_0xfafb('0x1e')]);_0x5bf74c[_0xfafb('0x1d')]=qs['offset'](_0x858cc3[_0xfafb('0x2d')]['offset']);}return _0x136cc0[_0xfafb('0x4b')](_0x5bf74c);}})[_0xfafb('0x3c')](function(_0xc413d4){if(_0xc413d4){return _0xc413d4?{'count':_0x2a95da,'rows':_0xc413d4}:null;}})['then'](respondWithResult(_0x57d635,null))[_0xfafb('0x40')](handleError(_0x57d635,null));};exports['addConfiguration']=function(_0x2470c4,_0x99fd31,_0x58e405){if(_0x2470c4[_0xfafb('0x45')]['id']){delete _0x2470c4[_0xfafb('0x45')]['id'];}return db[_0xfafb('0x3b')][_0xfafb('0x49')]({'where':{'id':_0x2470c4[_0xfafb('0x46')]['id']}})[_0xfafb('0x3c')](handleEntityNotFound(_0x99fd31,null))['then'](function(_0xbb7543){if(_0xbb7543){_0x2470c4[_0xfafb('0x45')]['AccountId']=_0xbb7543['id'];_0x2470c4['body']['Subjects']=integrations[_0xfafb('0x4e')](_0x2470c4['body']['channel'],_0x2470c4[_0xfafb('0x45')][_0xfafb('0x29')]);_0x2470c4['body']['Descriptions']=integrations[_0xfafb('0x4f')](_0x2470c4[_0xfafb('0x45')][_0xfafb('0x50')],_0x2470c4[_0xfafb('0x45')]['type']);return db[_0xfafb('0x4a')][_0xfafb('0x44')](_0x2470c4[_0xfafb('0x45')],{'include':[{'model':db['ZohoField'],'as':_0xfafb('0x51')},{'model':db[_0xfafb('0x52')],'as':'Descriptions'}]});}return null;})[_0xfafb('0x3c')](respondWithResult(_0x99fd31,null))[_0xfafb('0x40')](handleError(_0x99fd31,null));};function getAccessToken(_0xae3ad4){return new Promise(function(_0x43605d,_0x2636ef){var _0xa9c9b7;switch(_0xae3ad4[_0xfafb('0x53')]){case'US':_0xa9c9b7=_0xfafb('0x54');break;case'AU':_0xa9c9b7=_0xfafb('0x55');break;case'EU':_0xa9c9b7=_0xfafb('0x56');break;case'IN':_0xa9c9b7='https://accounts.zoho.in';break;case'CN':_0xa9c9b7=_0xfafb('0x57');break;default:_0xa9c9b7=_0xfafb('0x56');break;}var _0x2726ad={'method':_0xfafb('0x58'),'uri':_0xa9c9b7+_0xfafb('0x59'),'qs':{'refresh_token':_0xae3ad4[_0xfafb('0x5a')],'client_id':_0xae3ad4[_0xfafb('0x5b')],'client_secret':_0xae3ad4[_0xfafb('0x5c')],'grant_type':_0xfafb('0x5d')},'json':!![]};return rp(_0x2726ad)[_0xfafb('0x3c')](function(_0x405e63){if(_0x405e63['access_token']){_0x43605d(_0x405e63['access_token']);}else{_0x2636ef('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xfafb('0x40')](function(_0xb4b570){_0x2636ef(_0xb4b570);});});}exports[_0xfafb('0x5e')]=function(_0x2508f2,_0x20c691,_0x1af5c5){var _0x1f7d21,_0x94cb98,_0x355cab,_0x1d5247,_0x165b12;return db['ZohoAccount']['findOne']({'where':{'id':_0x2508f2[_0xfafb('0x46')]['id']},'attributes':['id',_0xfafb('0x5f'),_0xfafb('0x53'),_0xfafb('0x5b'),_0xfafb('0x5c'),_0xfafb('0x60'),_0xfafb('0x61'),_0xfafb('0x5a')]})['then'](handleEntityNotFound(_0x20c691,null))[_0xfafb('0x3c')](function(_0x11ed81){_0x165b12=_0x11ed81;_0x1f7d21=_0x165b12[_0xfafb('0x5f')];_0x94cb98=_0x1f7d21==='zoho.eu'?'eu':_0xfafb('0x62');_0x355cab=_0x165b12['serverUrl'];var _0x2dd9a3=_0x355cab[_0xfafb('0x63')](-0x1);if(_0x2dd9a3==='/'||_0x2dd9a3==='\x5c'||_0x2dd9a3===':'){_0x355cab=_0x355cab[_0xfafb('0x64')](0x0,_0x355cab[_0xfafb('0x65')](_0x2dd9a3));}if(!_0x165b12[_0xfafb('0x5a')]){throw new Error(_0xfafb('0x66'));}return getAccessToken(_0x165b12);})['then'](function(_0x118b59){if(_0x118b59){return rp({'method':'GET','uri':util[_0xfafb('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x94cb98),'qs':{'module':'Calls'},'headers':{'Authorization':_0xfafb('0x68')+_0x118b59},'json':!![]});}})[_0xfafb('0x3c')](function(_0x164721){if(_0x164721){if(_0x164721[_0xfafb('0x69')]&&_0x164721[_0xfafb('0x69')][_0xfafb('0x24')]){throw new Error(_0x164721[_0xfafb('0x69')]['error'][_0xfafb('0x6a')]);}var _0x393979=[];var _0x3bcc67=[];var _0x3ab6af=['Owner',_0xfafb('0x6b'),'Description',_0xfafb('0x6c'),_0xfafb('0x6d'),_0xfafb('0x6e'),_0xfafb('0x6f'),'Call_Type'];_0x3bcc67=_[_0xfafb('0x70')](_0x164721[_0xfafb('0x31')],function(_0x3d60ec){return _0x3ab6af[_0xfafb('0x71')](_0x3d60ec['api_name']);});for(var _0xd42c03=0x0;_0xd42c03<_0x3bcc67[_0xfafb('0x32')];_0xd42c03++){if(_0x3bcc67[_0xd42c03][_0xfafb('0x72')]===![]){_0x393979[_0xfafb('0x73')]({'id':_0x3bcc67[_0xd42c03]['id'],'name':_0x3bcc67[_0xd42c03][_0xfafb('0x74')],'custom':_0x3bcc67[_0xd42c03]['custom_field'],'options':_0x3bcc67[_0xd42c03][_0xfafb('0x75')]===_0xfafb('0x76')&&_0x3bcc67[_0xd42c03][_0xfafb('0x77')][_0xfafb('0x32')]>-0x1?_[_0xfafb('0x27')](_0x3bcc67[_0xd42c03]['pick_list_values'],function(_0x1075f9){return{'name':_0x1075f9,'value':_0x1075f9};}):[]});}}return{'count':_0x393979[_0xfafb('0x32')],'rows':_0x393979};}else{return{'count':0x0,'rows':[]};}})[_0xfafb('0x3c')](respondWithResult(_0x20c691,null))[_0xfafb('0x40')](function(_0x73edc3){var _0x3f489a=_0x2508f2[_0xfafb('0x2d')]['test']?0x1f4:_0x73edc3[_0xfafb('0x78')]||0x1f4;logger['error'](_0xfafb('0x79'),'getFields',_0x3f489a,JSON[_0xfafb('0x7a')](_0x73edc3));delete _0x73edc3[_0xfafb('0x25')];if(_0x3f489a===0x191){_0x3f489a=0x190;}_0x20c691[_0xfafb('0x1a')](_0x3f489a)['send'](_0x2508f2[_0xfafb('0x2d')][_0xfafb('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x73edc3[_0xfafb('0x78')]}:_0x73edc3);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index e9df8dc..cce1e27 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 _0xf2b4=['substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','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','zone','clientSecret','slice','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','code','host'];(function(_0x1b5231,_0x2f89ce){var _0x37e141=function(_0x5d2056){while(--_0x5d2056){_0x1b5231['push'](_0x1b5231['shift']());}};_0x37e141(++_0x2f89ce);}(_0xf2b4,0xbd));var _0x4f2b=function(_0x4a1156,_0x455af6){_0x4a1156=_0x4a1156-0x0;var _0x230e6e=_0xf2b4[_0x4a1156];return _0x230e6e;};'use strict';var _=require(_0x4f2b('0x0'));var util=require(_0x4f2b('0x1'));var logger=require('../../config/logger')(_0x4f2b('0x2'));var moment=require(_0x4f2b('0x3'));var BPromise=require(_0x4f2b('0x4'));var rp=require(_0x4f2b('0x5'));var fs=require('fs');var path=require(_0x4f2b('0x6'));var rimraf=require('rimraf');var config=require(_0x4f2b('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4f2b('0x8')]=function(_0x3facbd,_0x16fefc){return _0x3facbd[_0x4f2b('0x9')](_0x4f2b('0xa'),attributes,{'tableName':_0x4f2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x80901f,_0x1c1b91,_0x1f40e7){if(_0x80901f[_0x4f2b('0xc')]('zone')||_0x80901f[_0x4f2b('0xc')](_0x4f2b('0xd'))||_0x80901f[_0x4f2b('0xc')]('clientId')||_0x80901f[_0x4f2b('0xc')]('clientSecret')||_0x80901f[_0x4f2b('0xc')](_0x4f2b('0xe'))||_0x80901f[_0x4f2b('0xc')](_0x4f2b('0xf'))){var _0x45ca95,_0x35e9f1;_0x45ca95=_0x80901f[_0x4f2b('0xd')];var _0x3f5d1f=_0x45ca95['slice'](-0x1);if(_0x3f5d1f==='/'||_0x3f5d1f==='\x5c'||_0x3f5d1f===':'){_0x45ca95=_0x45ca95[_0x4f2b('0x10')](0x0,_0x45ca95[_0x4f2b('0x11')](_0x3f5d1f));}switch(_0x80901f['zone']){case'US':_0x35e9f1=_0x4f2b('0x12');break;case'AU':_0x35e9f1=_0x4f2b('0x13');break;case'IN':_0x35e9f1=_0x4f2b('0x14');break;case'CN':_0x35e9f1=_0x4f2b('0x15');break;default:_0x35e9f1=_0x4f2b('0x16');break;}var _0x464556={'method':_0x4f2b('0x17'),'uri':_0x35e9f1+_0x4f2b('0x18'),'form':{'grant_type':_0x4f2b('0x19'),'client_id':_0x80901f[_0x4f2b('0x1a')],'client_secret':_0x80901f['clientSecret'],'redirect_uri':_0x80901f[_0x4f2b('0xd')],'code':_0x80901f['code']},'headers':{'Content-Type':_0x4f2b('0x1b')}};return rp(_0x464556)[_0x4f2b('0x1c')](function(_0x5c9766){var _0x397d1b=JSON[_0x4f2b('0x1d')](_0x5c9766);if(_0x397d1b[_0x4f2b('0x1e')]){_0x80901f['refreshToken']=_0x397d1b[_0x4f2b('0x1e')];logger['info'](util['format'](_0x4f2b('0x1f'),_0x80901f[_0x4f2b('0x20')],_0x80901f['id']));}else{logger[_0x4f2b('0x21')](util[_0x4f2b('0x22')](_0x4f2b('0x23'),_0x80901f['name'],_0x80901f['id']),util[_0x4f2b('0x24')](_0x397d1b,{'showHidden':![],'depth':null}));}return _0x1f40e7(null,_0x1c1b91);})[_0x4f2b('0x25')](function(_0x3da668){logger[_0x4f2b('0x21')](util[_0x4f2b('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x80901f[_0x4f2b('0x20')],_0x80901f['id']),util[_0x4f2b('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1f40e7(_0x3da668);});}else{return _0x1f40e7(null,_0x1c1b91);}},'beforeUpdate':function(_0x571112,_0x3e8618,_0xeae50b){if(_0x571112[_0x4f2b('0xc')](_0x4f2b('0x26'))||_0x571112[_0x4f2b('0xc')](_0x4f2b('0xd'))||_0x571112[_0x4f2b('0xc')]('clientId')||_0x571112[_0x4f2b('0xc')](_0x4f2b('0x27'))||_0x571112[_0x4f2b('0xc')](_0x4f2b('0xe'))||_0x571112[_0x4f2b('0xc')]('host')){var _0x114840,_0x3d7cee;_0x114840=_0x571112[_0x4f2b('0xd')];var _0x577193=_0x114840[_0x4f2b('0x28')](-0x1);if(_0x577193==='/'||_0x577193==='\x5c'||_0x577193===':'){_0x114840=_0x114840[_0x4f2b('0x10')](0x0,_0x114840[_0x4f2b('0x11')](_0x577193));}switch(_0x571112[_0x4f2b('0x26')]){case'US':_0x3d7cee='https://accounts.zoho.com';break;case'AU':_0x3d7cee=_0x4f2b('0x13');break;case'IN':_0x3d7cee=_0x4f2b('0x14');break;case'CN':_0x3d7cee=_0x4f2b('0x15');break;default:_0x3d7cee=_0x4f2b('0x16');break;}var _0x3947d6={'method':_0x4f2b('0x17'),'uri':_0x3d7cee+_0x4f2b('0x18'),'form':{'grant_type':_0x4f2b('0x19'),'client_id':_0x571112[_0x4f2b('0x1a')],'client_secret':_0x571112['clientSecret'],'redirect_uri':_0x571112[_0x4f2b('0xd')],'code':_0x571112[_0x4f2b('0xe')]},'headers':{'Content-Type':_0x4f2b('0x1b')}};return rp(_0x3947d6)[_0x4f2b('0x1c')](function(_0x34b22f){var _0x58fa9b=JSON['parse'](_0x34b22f);if(_0x58fa9b['refresh_token']){_0x571112['refreshToken']=_0x58fa9b[_0x4f2b('0x1e')];logger['info'](util[_0x4f2b('0x22')](_0x4f2b('0x1f'),_0x571112[_0x4f2b('0x20')],_0x571112['id']));}else{logger[_0x4f2b('0x21')](util[_0x4f2b('0x22')](_0x4f2b('0x23'),_0x571112[_0x4f2b('0x20')],_0x571112['id']),util['inspect'](_0x58fa9b,{'showHidden':![],'depth':null}));}return _0xeae50b(null,_0x3e8618);})[_0x4f2b('0x25')](function(_0x3fb676){logger[_0x4f2b('0x21')](util[_0x4f2b('0x22')](_0x4f2b('0x23'),_0x571112[_0x4f2b('0x20')],_0x571112['id']),util[_0x4f2b('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0xeae50b(_0x3fb676);});}else{return _0xeae50b(null,_0x3e8618);}}}});}; \ No newline at end of file +var _0xe6d0=['https://accounts.zoho.com','https://accounts.zoho.eu','authorization_code','clientId','clientSecret','code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','parse','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','slice','substring','lastIndexOf'];(function(_0x3a2c29,_0x3e1216){var _0x18cc5e=function(_0x3027a3){while(--_0x3027a3){_0x3a2c29['push'](_0x3a2c29['shift']());}};_0x18cc5e(++_0x3e1216);}(_0xe6d0,0x17e));var _0x0e6d=function(_0x5b2263,_0x2df183){_0x5b2263=_0x5b2263-0x0;var _0x487cbe=_0xe6d0[_0x5b2263];return _0x487cbe;};'use strict';var _=require(_0x0e6d('0x0'));var util=require(_0x0e6d('0x1'));var logger=require(_0x0e6d('0x2'))('api');var moment=require(_0x0e6d('0x3'));var BPromise=require(_0x0e6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e6d('0x5'));var config=require(_0x0e6d('0x6'));var attributes=require(_0x0e6d('0x7'));var integrations=require(_0x0e6d('0x8'));module[_0x0e6d('0x9')]=function(_0x174ec3,_0x386715){return _0x174ec3['define'](_0x0e6d('0xa'),attributes,{'tableName':_0x0e6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x606776,_0x47b376,_0x46c97a){if(_0x606776[_0x0e6d('0xc')](_0x0e6d('0xd'))||_0x606776[_0x0e6d('0xc')](_0x0e6d('0xe'))||_0x606776[_0x0e6d('0xc')]('clientId')||_0x606776[_0x0e6d('0xc')]('clientSecret')||_0x606776[_0x0e6d('0xc')]('code')||_0x606776['changed']('host')){var _0xee55ee,_0x30d156;_0xee55ee=_0x606776[_0x0e6d('0xe')];var _0x2982ff=_0xee55ee[_0x0e6d('0xf')](-0x1);if(_0x2982ff==='/'||_0x2982ff==='\x5c'||_0x2982ff===':'){_0xee55ee=_0xee55ee[_0x0e6d('0x10')](0x0,_0xee55ee[_0x0e6d('0x11')](_0x2982ff));}switch(_0x606776[_0x0e6d('0xd')]){case'US':_0x30d156=_0x0e6d('0x12');break;case'AU':_0x30d156='https://accounts.zoho.com.au';break;case'IN':_0x30d156='https://accounts.zoho.in';break;case'CN':_0x30d156='https://accounts.zoho.com.cn';break;default:_0x30d156=_0x0e6d('0x13');break;}var _0x3b3734={'method':'POST','uri':_0x30d156+'/oauth/v2/token','form':{'grant_type':_0x0e6d('0x14'),'client_id':_0x606776[_0x0e6d('0x15')],'client_secret':_0x606776[_0x0e6d('0x16')],'redirect_uri':_0x606776[_0x0e6d('0xe')],'code':_0x606776[_0x0e6d('0x17')]},'headers':{'Content-Type':_0x0e6d('0x18')}};return rp(_0x3b3734)['then'](function(_0x2a5861){var _0x5856b0=JSON['parse'](_0x2a5861);if(_0x5856b0[_0x0e6d('0x19')]){_0x606776[_0x0e6d('0x1a')]=_0x5856b0[_0x0e6d('0x19')];logger[_0x0e6d('0x1b')](util[_0x0e6d('0x1c')](_0x0e6d('0x1d'),_0x606776['name'],_0x606776['id']));}else{logger[_0x0e6d('0x1e')](util[_0x0e6d('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x606776[_0x0e6d('0x1f')],_0x606776['id']),util[_0x0e6d('0x20')](_0x5856b0,{'showHidden':![],'depth':null}));}return _0x46c97a(null,_0x47b376);})[_0x0e6d('0x21')](function(_0x57fca7){logger[_0x0e6d('0x1e')](util['format'](_0x0e6d('0x22'),_0x606776['name'],_0x606776['id']),util[_0x0e6d('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x46c97a(_0x57fca7);});}else{return _0x46c97a(null,_0x47b376);}},'beforeUpdate':function(_0x1b5b44,_0x14174c,_0x138ed2){if(_0x1b5b44['changed'](_0x0e6d('0xd'))||_0x1b5b44[_0x0e6d('0xc')](_0x0e6d('0xe'))||_0x1b5b44[_0x0e6d('0xc')](_0x0e6d('0x15'))||_0x1b5b44[_0x0e6d('0xc')](_0x0e6d('0x16'))||_0x1b5b44[_0x0e6d('0xc')]('code')||_0x1b5b44['changed']('host')){var _0x262b52,_0x51d33c;_0x262b52=_0x1b5b44['serverUrl'];var _0x1388f8=_0x262b52[_0x0e6d('0xf')](-0x1);if(_0x1388f8==='/'||_0x1388f8==='\x5c'||_0x1388f8===':'){_0x262b52=_0x262b52[_0x0e6d('0x10')](0x0,_0x262b52[_0x0e6d('0x11')](_0x1388f8));}switch(_0x1b5b44['zone']){case'US':_0x51d33c=_0x0e6d('0x12');break;case'AU':_0x51d33c='https://accounts.zoho.com.au';break;case'IN':_0x51d33c=_0x0e6d('0x23');break;case'CN':_0x51d33c=_0x0e6d('0x24');break;default:_0x51d33c=_0x0e6d('0x13');break;}var _0x467ac8={'method':_0x0e6d('0x25'),'uri':_0x51d33c+_0x0e6d('0x26'),'form':{'grant_type':_0x0e6d('0x14'),'client_id':_0x1b5b44['clientId'],'client_secret':_0x1b5b44[_0x0e6d('0x16')],'redirect_uri':_0x1b5b44['serverUrl'],'code':_0x1b5b44[_0x0e6d('0x17')]},'headers':{'Content-Type':_0x0e6d('0x18')}};return rp(_0x467ac8)['then'](function(_0x55619c){var _0x1e214b=JSON[_0x0e6d('0x27')](_0x55619c);if(_0x1e214b[_0x0e6d('0x19')]){_0x1b5b44[_0x0e6d('0x1a')]=_0x1e214b[_0x0e6d('0x19')];logger[_0x0e6d('0x1b')](util[_0x0e6d('0x1c')](_0x0e6d('0x1d'),_0x1b5b44[_0x0e6d('0x1f')],_0x1b5b44['id']));}else{logger[_0x0e6d('0x1e')](util[_0x0e6d('0x1c')](_0x0e6d('0x22'),_0x1b5b44[_0x0e6d('0x1f')],_0x1b5b44['id']),util[_0x0e6d('0x20')](_0x1e214b,{'showHidden':![],'depth':null}));}return _0x138ed2(null,_0x14174c);})[_0x0e6d('0x21')](function(_0x12b1be){logger[_0x0e6d('0x1e')](util[_0x0e6d('0x1c')](_0x0e6d('0x22'),_0x1b5b44[_0x0e6d('0x1f')],_0x1b5b44['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x138ed2(_0x12b1be);});}else{return _0x138ed2(null,_0x14174c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index d421494..cee6ee5 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 _0x002d=['findAll','options','raw','where','limit','include','map','model','attributes','info','ShowZohoAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount'];(function(_0x1e9148,_0x35cb79){var _0x2f7dbd=function(_0x4e6fa7){while(--_0x4e6fa7){_0x1e9148['push'](_0x1e9148['shift']());}};_0x2f7dbd(++_0x35cb79);}(_0x002d,0xca));var _0xd002=function(_0xcb855,_0x826c36){_0xcb855=_0xcb855-0x0;var _0x3a801f=_0x002d[_0xcb855];return _0x3a801f;};'use strict';var _=require(_0xd002('0x0'));var util=require(_0xd002('0x1'));var moment=require(_0xd002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd002('0x3'));var db=require(_0xd002('0x4'))['db'];var utils=require(_0xd002('0x5'));var logger=require(_0xd002('0x6'))(_0xd002('0x7'));var config=require(_0xd002('0x8'));var jayson=require(_0xd002('0x9'));var client=jayson[_0xd002('0xa')][_0xd002('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3711b0,_0x24766e,_0x45d45f){return new BPromise(function(_0x18df0a,_0x166980){return client[_0xd002('0xc')](_0x3711b0,_0x45d45f)[_0xd002('0xd')](function(_0x3bc57b){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x24766e,_0xd002('0xe'));logger[_0xd002('0xf')](_0xd002('0x10'),_0x24766e,'request\x20sent',JSON[_0xd002('0x11')](_0x3bc57b));if(_0x3bc57b[_0xd002('0x12')]){if(_0x3bc57b[_0xd002('0x12')][_0xd002('0x13')]===0x1f4){logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);return _0x166980(_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);}logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);return _0x18df0a(_0x3bc57b['error']['message']);}else{logger['info'](_0xd002('0x14'),_0x24766e,'request\x20sent');_0x18df0a(_0x3bc57b[_0xd002('0x16')][_0xd002('0x15')]);}})[_0xd002('0x17')](function(_0x282c43){logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x282c43);_0x166980(_0x282c43);});});}exports[_0xd002('0x18')]=function(_0x5e1f31){var _0x83090d=this;return new Promise(function(_0x4708f6,_0x3d1a5f){return db[_0xd002('0x19')][_0xd002('0x1a')]({'raw':_0x5e1f31['options']?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1d')]||null:null,'attributes':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31['options']['attributes']||null:null,'limit':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1e')]||null:null,'include':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1f')]?_[_0xd002('0x20')](_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1f')],function(_0x15ccfb){return{'model':db[_0x15ccfb[_0xd002('0x21')]],'as':_0x15ccfb['as'],'attributes':_0x15ccfb[_0xd002('0x22')],'include':_0x15ccfb['include']?_[_0xd002('0x20')](_0x15ccfb[_0xd002('0x1f')],function(_0x55e3be){return{'model':db[_0x55e3be[_0xd002('0x21')]],'as':_0x55e3be['as'],'attributes':_0x55e3be[_0xd002('0x22')],'include':_0x55e3be[_0xd002('0x1f')]?_['map'](_0x55e3be[_0xd002('0x1f')],function(_0x4f58fa){return{'model':db[_0x4f58fa['model']],'as':_0x4f58fa['as'],'attributes':_0x4f58fa['attributes']};}):[]};}):[]};}):[]:[]})[_0xd002('0xd')](function(_0x45745c){logger[_0xd002('0x23')](_0xd002('0x18'),_0x5e1f31);logger[_0xd002('0xf')](_0xd002('0x18'),_0x5e1f31,JSON[_0xd002('0x11')](_0x45745c));_0x4708f6(_0x45745c);})[_0xd002('0x17')](function(_0x9999ea){logger[_0xd002('0x12')]('GetZohoAccount',_0x9999ea[_0xd002('0x15')],_0x5e1f31);_0x3d1a5f(_0x83090d[_0xd002('0x12')](0x1f4,_0x9999ea[_0xd002('0x15')]));});});};exports[_0xd002('0x24')]=function(_0x4d863e){var _0x2445bb=this;return new Promise(function(_0x568d90,_0x41ebcc){return db['ZohoAccount'][_0xd002('0x25')]({'raw':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1d')]||null:null,'attributes':_0x4d863e[_0xd002('0x1b')]?_0x4d863e['options'][_0xd002('0x22')]||null:null,'include':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1f')]?_[_0xd002('0x20')](_0x4d863e[_0xd002('0x1b')]['include'],function(_0x58411e){return{'model':db[_0x58411e['model']],'as':_0x58411e['as'],'attributes':_0x58411e[_0xd002('0x22')],'include':_0x58411e['include']?_[_0xd002('0x20')](_0x58411e[_0xd002('0x1f')],function(_0x2a85c0){return{'model':db[_0x2a85c0[_0xd002('0x21')]],'as':_0x2a85c0['as'],'attributes':_0x2a85c0[_0xd002('0x22')],'include':_0x2a85c0[_0xd002('0x1f')]?_[_0xd002('0x20')](_0x2a85c0[_0xd002('0x1f')],function(_0x5430bc){return{'model':db[_0x5430bc[_0xd002('0x21')]],'as':_0x5430bc['as'],'attributes':_0x5430bc[_0xd002('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd484){logger[_0xd002('0x23')](_0xd002('0x24'),_0x4d863e);logger[_0xd002('0xf')](_0xd002('0x24'),_0x4d863e,JSON['stringify'](_0x4bd484));_0x568d90(_0x4bd484);})[_0xd002('0x17')](function(_0x5545f2){logger[_0xd002('0x12')](_0xd002('0x24'),_0x5545f2[_0xd002('0x15')],_0x4d863e);_0x41ebcc(_0x2445bb[_0xd002('0x12')](0x1f4,_0x5545f2[_0xd002('0x15')]));});});}; \ No newline at end of file +var _0xd8d7=['ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','ZohoAccount','catch','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client','http','request','then','info'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd8d7,0x1d4));var _0x7d8d=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd8d7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7d8d('0x0'));var util=require(_0x7d8d('0x1'));var moment=require(_0x7d8d('0x2'));var BPromise=require(_0x7d8d('0x3'));var rs=require(_0x7d8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7d8d('0x5'));var config=require('../../config/environment');var jayson=require(_0x7d8d('0x6'));var client=jayson[_0x7d8d('0x7')][_0x7d8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc39292,_0x2294c2,_0x3036a9){return new BPromise(function(_0x1bac2e,_0x506fcd){return client[_0x7d8d('0x9')](_0xc39292,_0x3036a9)[_0x7d8d('0xa')](function(_0x3e2f6e){logger[_0x7d8d('0xb')](_0x7d8d('0xc'),_0x2294c2,_0x7d8d('0xd'));logger[_0x7d8d('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'),JSON[_0x7d8d('0xf')](_0x3e2f6e));if(_0x3e2f6e[_0x7d8d('0x10')]){if(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x11')]===0x1f4){logger['error'](_0x7d8d('0xc'),_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x506fcd(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}logger[_0x7d8d('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x2294c2,_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);return _0x1bac2e(_0x3e2f6e[_0x7d8d('0x10')][_0x7d8d('0x12')]);}else{logger[_0x7d8d('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2294c2,_0x7d8d('0xd'));_0x1bac2e(_0x3e2f6e['result'][_0x7d8d('0x12')]);}})['catch'](function(_0x12588c){logger[_0x7d8d('0x10')](_0x7d8d('0xc'),_0x2294c2,_0x12588c);_0x506fcd(_0x12588c);});});}exports[_0x7d8d('0x13')]=function(_0x1c00a3){var _0x31be40=this;return new Promise(function(_0x36dfbe,_0x37fe93){return db['ZohoAccount'][_0x7d8d('0x14')]({'raw':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x16')]===undefined?!![]:![]:!![],'where':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x17')]||null:null,'attributes':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x18')]||null:null,'limit':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x19')]||null:null,'include':_0x1c00a3[_0x7d8d('0x15')]?_0x1c00a3['options']['include']?_['map'](_0x1c00a3[_0x7d8d('0x15')][_0x7d8d('0x1a')],function(_0x2ab3b8){return{'model':db[_0x2ab3b8[_0x7d8d('0x1b')]],'as':_0x2ab3b8['as'],'attributes':_0x2ab3b8[_0x7d8d('0x18')],'include':_0x2ab3b8['include']?_[_0x7d8d('0x1c')](_0x2ab3b8[_0x7d8d('0x1a')],function(_0x459e88){return{'model':db[_0x459e88[_0x7d8d('0x1b')]],'as':_0x459e88['as'],'attributes':_0x459e88[_0x7d8d('0x18')],'include':_0x459e88[_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x459e88['include'],function(_0x414da4){return{'model':db[_0x414da4[_0x7d8d('0x1b')]],'as':_0x414da4['as'],'attributes':_0x414da4[_0x7d8d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7d8d('0xa')](function(_0xedad25){logger['info']('GetZohoAccount',_0x1c00a3);logger[_0x7d8d('0xe')](_0x7d8d('0x13'),_0x1c00a3,JSON[_0x7d8d('0xf')](_0xedad25));_0x36dfbe(_0xedad25);})['catch'](function(_0x18605b){logger[_0x7d8d('0x10')](_0x7d8d('0x13'),_0x18605b['message'],_0x1c00a3);_0x37fe93(_0x31be40[_0x7d8d('0x10')](0x1f4,_0x18605b[_0x7d8d('0x12')]));});});};exports['ShowZohoAccount']=function(_0x1a918c){var _0x46319a=this;return new Promise(function(_0x3c1fb2,_0x308383){return db[_0x7d8d('0x1d')]['find']({'raw':_0x1a918c['options']?_0x1a918c[_0x7d8d('0x15')][_0x7d8d('0x16')]===undefined?!![]:![]:!![],'where':_0x1a918c['options']?_0x1a918c[_0x7d8d('0x15')]['where']||null:null,'attributes':_0x1a918c[_0x7d8d('0x15')]?_0x1a918c[_0x7d8d('0x15')]['attributes']||null:null,'include':_0x1a918c[_0x7d8d('0x15')]?_0x1a918c[_0x7d8d('0x15')][_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x1a918c['options'][_0x7d8d('0x1a')],function(_0x55262f){return{'model':db[_0x55262f[_0x7d8d('0x1b')]],'as':_0x55262f['as'],'attributes':_0x55262f[_0x7d8d('0x18')],'include':_0x55262f[_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x55262f['include'],function(_0x35e469){return{'model':db[_0x35e469[_0x7d8d('0x1b')]],'as':_0x35e469['as'],'attributes':_0x35e469[_0x7d8d('0x18')],'include':_0x35e469[_0x7d8d('0x1a')]?_[_0x7d8d('0x1c')](_0x35e469[_0x7d8d('0x1a')],function(_0x3a90df){return{'model':db[_0x3a90df[_0x7d8d('0x1b')]],'as':_0x3a90df['as'],'attributes':_0x3a90df['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d8d('0xa')](function(_0x3f87da){logger[_0x7d8d('0xb')]('ShowZohoAccount',_0x1a918c);logger['debug']('ShowZohoAccount',_0x1a918c,JSON[_0x7d8d('0xf')](_0x3f87da));_0x3c1fb2(_0x3f87da);})[_0x7d8d('0x1e')](function(_0x41432a){logger[_0x7d8d('0x10')](_0x7d8d('0x1f'),_0x41432a['message'],_0x1a918c);_0x308383(_0x46319a[_0x7d8d('0x10')](0x1f4,_0x41432a[_0x7d8d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index cafd8f8..8c3cacb 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 _0x9b0b=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoConfiguration.controller','isAuthenticated','index','/:id','show','/:id/fields','getFields','get','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0x9b0b,0x1e1));var _0xb9b0=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x9b0b[_0x125ff8];return _0x2d9ef;};'use strict';var multer=require(_0xb9b0('0x0'));var util=require('util');var path=require(_0xb9b0('0x1'));var timeout=require(_0xb9b0('0x2'));var express=require(_0xb9b0('0x3'));var router=express[_0xb9b0('0x4')]();var fs_extra=require(_0xb9b0('0x5'));var auth=require(_0xb9b0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb9b0('0x7'));router['get']('/',auth[_0xb9b0('0x8')](),controller[_0xb9b0('0x9')]);router['get'](_0xb9b0('0xa'),auth[_0xb9b0('0x8')](),controller[_0xb9b0('0xb')]);router['get'](_0xb9b0('0xc'),auth[_0xb9b0('0x8')](),controller[_0xb9b0('0xd')]);router[_0xb9b0('0xe')](_0xb9b0('0xf'),auth[_0xb9b0('0x8')](),controller['getSubjects']);router[_0xb9b0('0xe')](_0xb9b0('0x10'),auth[_0xb9b0('0x8')](),controller[_0xb9b0('0x11')]);router[_0xb9b0('0x12')]('/',auth[_0xb9b0('0x8')](),controller[_0xb9b0('0x13')]);router[_0xb9b0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xb9b0('0x15')]);router[_0xb9b0('0x16')](_0xb9b0('0xa'),auth[_0xb9b0('0x8')](),controller[_0xb9b0('0x17')]);module[_0xb9b0('0x18')]=router; \ No newline at end of file +var _0x92c9=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','multer','util','path','express'];(function(_0x566168,_0x4c39af){var _0x4e1f7a=function(_0x5ec3ee){while(--_0x5ec3ee){_0x566168['push'](_0x566168['shift']());}};_0x4e1f7a(++_0x4c39af);}(_0x92c9,0x1ac));var _0x992c=function(_0x4ae58a,_0x72bd08){_0x4ae58a=_0x4ae58a-0x0;var _0x3c0445=_0x92c9[_0x4ae58a];return _0x3c0445;};'use strict';var multer=require(_0x992c('0x0'));var util=require(_0x992c('0x1'));var path=require(_0x992c('0x2'));var timeout=require('connect-timeout');var express=require(_0x992c('0x3'));var router=express['Router']();var fs_extra=require(_0x992c('0x4'));var auth=require(_0x992c('0x5'));var interaction=require(_0x992c('0x6'));var config=require('../../config/environment');var controller=require(_0x992c('0x7'));router[_0x992c('0x8')]('/',auth[_0x992c('0x9')](),controller[_0x992c('0xa')]);router[_0x992c('0x8')]('/:id',auth[_0x992c('0x9')](),controller[_0x992c('0xb')]);router[_0x992c('0x8')](_0x992c('0xc'),auth[_0x992c('0x9')](),controller[_0x992c('0xd')]);router[_0x992c('0x8')](_0x992c('0xe'),auth[_0x992c('0x9')](),controller[_0x992c('0xf')]);router[_0x992c('0x8')](_0x992c('0x10'),auth['isAuthenticated'](),controller[_0x992c('0x11')]);router[_0x992c('0x12')]('/',auth[_0x992c('0x9')](),controller[_0x992c('0x13')]);router[_0x992c('0x14')](_0x992c('0x15'),auth[_0x992c('0x9')](),controller[_0x992c('0x16')]);router['delete'](_0x992c('0x15'),auth['isAuthenticated'](),controller[_0x992c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 0527c53..b4ccef4 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 _0x4fa8=['nothing','sequelize','STRING','ENUM','lead','contact'];(function(_0x557e9e,_0xadf44f){var _0x19e077=function(_0x42b3fb){while(--_0x42b3fb){_0x557e9e['push'](_0x557e9e['shift']());}};_0x19e077(++_0xadf44f);}(_0x4fa8,0x139));var _0x84fa=function(_0x54eb3a,_0xb0a913){_0x54eb3a=_0x54eb3a-0x0;var _0x41dfb0=_0x4fa8[_0x54eb3a];return _0x41dfb0;};'use strict';var Sequelize=require(_0x84fa('0x0'));module['exports']={'name':{'type':Sequelize[_0x84fa('0x1')]},'moduleCreate':{'type':Sequelize[_0x84fa('0x2')](_0x84fa('0x3'),_0x84fa('0x4'),_0x84fa('0x5')),'defaultValue':_0x84fa('0x3')},'moduleSearch':{'type':Sequelize[_0x84fa('0x2')]('contact_lead',_0x84fa('0x4'),_0x84fa('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x84fa('0x1')]}}; \ No newline at end of file +var _0x7025=['STRING','ENUM','contact','lead','contact_lead','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7025,0x132));var _0x5702=function(_0xa40a5c,_0x4d941f){_0xa40a5c=_0xa40a5c-0x0;var _0x2ccbc5=_0x7025[_0xa40a5c];return _0x2ccbc5;};'use strict';var Sequelize=require(_0x5702('0x0'));module[_0x5702('0x1')]={'name':{'type':Sequelize[_0x5702('0x2')]},'moduleCreate':{'type':Sequelize[_0x5702('0x3')]('lead',_0x5702('0x4'),'nothing'),'defaultValue':_0x5702('0x5')},'moduleSearch':{'type':Sequelize[_0x5702('0x3')](_0x5702('0x6'),_0x5702('0x4'),_0x5702('0x5')),'defaultValue':_0x5702('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index dbdab0f..4d96701 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 _0xa959=['../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','ZohoField','sort','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5a895e,_0x301dba){var _0x10b20e=function(_0x8b4737){while(--_0x8b4737){_0x5a895e['push'](_0x5a895e['shift']());}};_0x10b20e(++_0x301dba);}(_0xa959,0xe4));var _0x9a95=function(_0x481127,_0x166b93){_0x481127=_0x481127-0x0;var _0x282728=_0xa959[_0x481127];return _0x282728;};'use strict';var emlformat=require(_0x9a95('0x0'));var rimraf=require(_0x9a95('0x1'));var zipdir=require(_0x9a95('0x2'));var jsonpatch=require(_0x9a95('0x3'));var rp=require(_0x9a95('0x4'));var moment=require(_0x9a95('0x5'));var BPromise=require(_0x9a95('0x6'));var Mustache=require(_0x9a95('0x7'));var util=require(_0x9a95('0x8'));var path=require(_0x9a95('0x9'));var sox=require(_0x9a95('0xa'));var csv=require('to-csv');var ejs=require(_0x9a95('0xb'));var fs=require('fs');var fs_extra=require(_0x9a95('0xc'));var _=require(_0x9a95('0xd'));var squel=require(_0x9a95('0xe'));var crypto=require(_0x9a95('0xf'));var jsforce=require(_0x9a95('0x10'));var deskjs=require(_0x9a95('0x11'));var toCsv=require(_0x9a95('0x12'));var querystring=require('querystring');var Papa=require(_0x9a95('0x13'));var Redis=require('ioredis');var authService=require(_0x9a95('0x14'));var qs=require(_0x9a95('0x15'));var as=require(_0x9a95('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a95('0x17'))('api');var utils=require(_0x9a95('0x18'));var config=require(_0x9a95('0x19'));var licenseUtil=require(_0x9a95('0x1a'));var db=require(_0x9a95('0x1b'))['db'];function respondWithStatusCode(_0xd8bce9,_0x46dd3a){_0x46dd3a=_0x46dd3a||0xcc;return function(_0x1e0582){if(_0x1e0582){return _0xd8bce9[_0x9a95('0x1c')](_0x46dd3a);}return _0xd8bce9[_0x9a95('0x1d')](_0x46dd3a)[_0x9a95('0x1e')]();};}function respondWithResult(_0x5a47fa,_0x1ab950){_0x1ab950=_0x1ab950||0xc8;return function(_0x268e80){if(_0x268e80){return _0x5a47fa['status'](_0x1ab950)[_0x9a95('0x1f')](_0x268e80);}};}function respondWithFilteredResult(_0x30a70c,_0x334fd6){return function(_0x2c813a){if(_0x2c813a){var _0x5d2830=typeof _0x334fd6['offset']==='undefined'&&typeof _0x334fd6[_0x9a95('0x20')]===_0x9a95('0x21');var _0x101bc8=_0x2c813a[_0x9a95('0x22')];var _0xd80f6c=_0x5d2830?0x0:_0x334fd6[_0x9a95('0x23')];var _0x1cb0b0=_0x5d2830?_0x2c813a[_0x9a95('0x22')]:_0x334fd6[_0x9a95('0x23')]+_0x334fd6[_0x9a95('0x20')];var _0x326861;if(_0x1cb0b0>=_0x101bc8){_0x1cb0b0=_0x101bc8;_0x326861=0xc8;}else{_0x326861=0xce;}_0x30a70c['status'](_0x326861);return _0x30a70c[_0x9a95('0x24')](_0x9a95('0x25'),_0xd80f6c+'-'+_0x1cb0b0+'/'+_0x101bc8)[_0x9a95('0x1f')](_0x2c813a);}return null;};}function patchUpdates(_0x22ea01){return function(_0x39e444){try{jsonpatch[_0x9a95('0x26')](_0x39e444,_0x22ea01,!![]);}catch(_0x36267a){return BPromise[_0x9a95('0x27')](_0x36267a);}return _0x39e444['save']();};}function saveUpdates(_0x20d2c5,_0x1a459a){return function(_0x1b0570){if(_0x1b0570){return _0x1b0570[_0x9a95('0x28')](_0x20d2c5)[_0x9a95('0x29')](function(_0x18372c){return _0x18372c;});}return null;};}function removeEntity(_0x3e3274,_0x1dd017){return function(_0x617eb8){if(_0x617eb8){return _0x617eb8[_0x9a95('0x2a')]()['then'](function(){_0x3e3274[_0x9a95('0x1d')](0xcc)[_0x9a95('0x1e')]();});}};}function handleEntityNotFound(_0x3becdb,_0x36f3ba){return function(_0x2e123f){if(!_0x2e123f){_0x3becdb[_0x9a95('0x1c')](0x194);}return _0x2e123f;};}function handleError(_0xc19d8b,_0x3875eb){_0x3875eb=_0x3875eb||0x1f4;return function(_0x4d31a6){logger[_0x9a95('0x2b')](_0x4d31a6[_0x9a95('0x2c')]);if(_0x4d31a6[_0x9a95('0x2d')]){delete _0x4d31a6['name'];}_0xc19d8b['status'](_0x3875eb)['send'](_0x4d31a6);};}exports[_0x9a95('0x2e')]=function(_0x29c44d,_0x3ee27f){var _0x1d28d1={},_0x206d3f={},_0x5ef7f1={'count':0x0,'rows':[]};var _0x21fcac=_['map'](db['ZohoConfiguration'][_0x9a95('0x2f')],function(_0x3b142b){return{'name':_0x3b142b['fieldName'],'type':_0x3b142b['type'][_0x9a95('0x30')]};});_0x206d3f[_0x9a95('0x31')]=_[_0x9a95('0x32')](_0x21fcac,_0x9a95('0x2d'));_0x206d3f[_0x9a95('0x33')]=_[_0x9a95('0x34')](_0x29c44d['query']);_0x206d3f[_0x9a95('0x35')]=_[_0x9a95('0x36')](_0x206d3f[_0x9a95('0x31')],_0x206d3f[_0x9a95('0x33')]);_0x1d28d1[_0x9a95('0x37')]=_[_0x9a95('0x36')](_0x206d3f[_0x9a95('0x31')],qs[_0x9a95('0x38')](_0x29c44d['query'][_0x9a95('0x38')]));_0x1d28d1[_0x9a95('0x37')]=_0x1d28d1[_0x9a95('0x37')][_0x9a95('0x39')]?_0x1d28d1[_0x9a95('0x37')]:_0x206d3f[_0x9a95('0x31')];if(!_0x29c44d[_0x9a95('0x33')][_0x9a95('0x3a')](_0x9a95('0x3b'))){_0x1d28d1['limit']=qs[_0x9a95('0x20')](_0x29c44d['query']['limit']);_0x1d28d1[_0x9a95('0x23')]=qs[_0x9a95('0x23')](_0x29c44d[_0x9a95('0x33')][_0x9a95('0x23')]);}_0x1d28d1[_0x9a95('0x3c')]=qs['sort'](_0x29c44d[_0x9a95('0x33')]['sort']);_0x1d28d1[_0x9a95('0x3d')]=qs['filters'](_[_0x9a95('0x3e')](_0x29c44d[_0x9a95('0x33')],_0x206d3f[_0x9a95('0x35')]),_0x21fcac);if(_0x29c44d[_0x9a95('0x33')][_0x9a95('0x3f')]){_0x1d28d1['where']=_['merge'](_0x1d28d1[_0x9a95('0x3d')],{'$or':_['map'](_0x21fcac,function(_0x4c04e5){if(_0x4c04e5[_0x9a95('0x40')]!==_0x9a95('0x41')){var _0x49247c={};_0x49247c[_0x4c04e5['name']]={'$like':'%'+_0x29c44d[_0x9a95('0x33')]['filter']+'%'};return _0x49247c;}})});}_0x1d28d1=_[_0x9a95('0x42')]({},_0x1d28d1,_0x29c44d['options']);var _0x4bb888={'where':_0x1d28d1['where']};return db[_0x9a95('0x43')][_0x9a95('0x22')](_0x4bb888)[_0x9a95('0x29')](function(_0x5976c1){_0x5ef7f1[_0x9a95('0x22')]=_0x5976c1;if(_0x29c44d[_0x9a95('0x33')][_0x9a95('0x44')]){_0x1d28d1[_0x9a95('0x45')]=[{'all':!![]}];}return db[_0x9a95('0x43')][_0x9a95('0x46')](_0x1d28d1);})[_0x9a95('0x29')](function(_0x23d215){_0x5ef7f1[_0x9a95('0x47')]=_0x23d215;return _0x5ef7f1;})[_0x9a95('0x29')](respondWithFilteredResult(_0x3ee27f,_0x1d28d1))[_0x9a95('0x48')](handleError(_0x3ee27f,null));};exports[_0x9a95('0x49')]=function(_0x22511c,_0x5918d3){var _0x56ade4={'raw':![],'where':{'id':_0x22511c[_0x9a95('0x4a')]['id']}},_0x54e624={};_0x54e624['model']=_[_0x9a95('0x34')](db[_0x9a95('0x43')][_0x9a95('0x2f')]);_0x54e624[_0x9a95('0x33')]=_[_0x9a95('0x34')](_0x22511c[_0x9a95('0x33')]);_0x54e624[_0x9a95('0x35')]=_[_0x9a95('0x36')](_0x54e624[_0x9a95('0x31')],_0x54e624['query']);_0x56ade4[_0x9a95('0x37')]=_[_0x9a95('0x36')](_0x54e624[_0x9a95('0x31')],qs['fields'](_0x22511c[_0x9a95('0x33')][_0x9a95('0x38')]));_0x56ade4['attributes']=_0x56ade4[_0x9a95('0x37')][_0x9a95('0x39')]?_0x56ade4[_0x9a95('0x37')]:_0x54e624[_0x9a95('0x31')];if(_0x22511c['query'][_0x9a95('0x44')]){_0x56ade4['include']=[{'all':!![]}];}_0x56ade4=_[_0x9a95('0x42')]({},_0x56ade4,_0x22511c[_0x9a95('0x4b')]);return db[_0x9a95('0x43')][_0x9a95('0x4c')](_0x56ade4)[_0x9a95('0x29')](handleEntityNotFound(_0x5918d3,null))['then'](respondWithResult(_0x5918d3,null))[_0x9a95('0x48')](handleError(_0x5918d3,null));};exports[_0x9a95('0x4d')]=function(_0x4bc06b,_0x1bf928){return db['ZohoConfiguration'][_0x9a95('0x4d')](_0x4bc06b[_0x9a95('0x4e')],{})['then'](respondWithResult(_0x1bf928,0xc9))['catch'](handleError(_0x1bf928,null));};exports[_0x9a95('0x28')]=function(_0x29bed5,_0x4c1116){if(_0x29bed5['body']['id']){delete _0x29bed5['body']['id'];}return db[_0x9a95('0x43')][_0x9a95('0x4c')]({'where':{'id':_0x29bed5[_0x9a95('0x4a')]['id']}})[_0x9a95('0x29')](handleEntityNotFound(_0x4c1116,null))[_0x9a95('0x29')](saveUpdates(_0x29bed5[_0x9a95('0x4e')],null))[_0x9a95('0x29')](respondWithResult(_0x4c1116,null))['catch'](handleError(_0x4c1116,null));};exports[_0x9a95('0x2a')]=function(_0x568dbe,_0x5d800e){return db[_0x9a95('0x43')][_0x9a95('0x4c')]({'where':{'id':_0x568dbe[_0x9a95('0x4a')]['id']}})[_0x9a95('0x29')](handleEntityNotFound(_0x5d800e,null))[_0x9a95('0x29')](removeEntity(_0x5d800e,null))[_0x9a95('0x48')](handleError(_0x5d800e,null));};exports[_0x9a95('0x4f')]=function(_0x59064e,_0x320c99,_0x1e05e5){var _0x486eef={};var _0x519f32={};var _0xa98dcb;var _0x3b012b;return db[_0x9a95('0x43')]['findOne']({'where':{'id':_0x59064e[_0x9a95('0x4a')]['id']}})[_0x9a95('0x29')](handleEntityNotFound(_0x320c99,null))[_0x9a95('0x29')](function(_0x1b5939){if(_0x1b5939){_0xa98dcb=_0x1b5939;_0x519f32[_0x9a95('0x31')]=_[_0x9a95('0x34')](db[_0x9a95('0x50')]['rawAttributes']);_0x519f32[_0x9a95('0x33')]=_[_0x9a95('0x34')](_0x59064e[_0x9a95('0x33')]);_0x519f32['filters']=_[_0x9a95('0x36')](_0x519f32[_0x9a95('0x31')],_0x519f32[_0x9a95('0x33')]);_0x486eef[_0x9a95('0x37')]=_[_0x9a95('0x36')](_0x519f32[_0x9a95('0x31')],qs[_0x9a95('0x38')](_0x59064e[_0x9a95('0x33')][_0x9a95('0x38')]));_0x486eef['attributes']=_0x486eef['attributes'][_0x9a95('0x39')]?_0x486eef[_0x9a95('0x37')]:_0x519f32[_0x9a95('0x31')];_0x486eef['order']=qs['sort'](_0x59064e[_0x9a95('0x33')][_0x9a95('0x51')]);_0x486eef['where']=qs[_0x9a95('0x35')](_[_0x9a95('0x3e')](_0x59064e['query'],_0x519f32[_0x9a95('0x35')]));if(_0x59064e[_0x9a95('0x33')]['filter']){_0x486eef[_0x9a95('0x3d')]=_[_0x9a95('0x42')](_0x486eef[_0x9a95('0x3d')],{'$or':_[_0x9a95('0x32')](_0x486eef[_0x9a95('0x37')],function(_0x3f2e8b){var _0x18fbfd={};_0x18fbfd[_0x3f2e8b]={'$like':'%'+_0x59064e[_0x9a95('0x33')]['filter']+'%'};return _0x18fbfd;})});}_0x486eef=_[_0x9a95('0x42')]({},_0x486eef,_0x59064e['options']);return _0xa98dcb[_0x9a95('0x4f')](_0x486eef);}})[_0x9a95('0x29')](function(_0x33a31f){if(_0x33a31f){_0x3b012b=_0x33a31f[_0x9a95('0x39')];if(!_0x59064e['query'][_0x9a95('0x3a')](_0x9a95('0x3b'))){_0x486eef['limit']=qs[_0x9a95('0x20')](_0x59064e[_0x9a95('0x33')][_0x9a95('0x20')]);_0x486eef['offset']=qs[_0x9a95('0x23')](_0x59064e['query'][_0x9a95('0x23')]);}return _0xa98dcb[_0x9a95('0x4f')](_0x486eef);}})[_0x9a95('0x29')](function(_0x1eea4a){if(_0x1eea4a){return _0x1eea4a?{'count':_0x3b012b,'rows':_0x1eea4a}:null;}})[_0x9a95('0x29')](respondWithResult(_0x320c99,null))[_0x9a95('0x48')](handleError(_0x320c99,null));};exports[_0x9a95('0x52')]=function(_0x156994,_0x57eccb,_0x24fbe2){var _0x4e7831={};var _0x2d705e={};var _0x3ffa96;var _0x28e3f5;return db[_0x9a95('0x43')][_0x9a95('0x53')]({'where':{'id':_0x156994[_0x9a95('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57eccb,null))[_0x9a95('0x29')](function(_0x1d16db){if(_0x1d16db){_0x3ffa96=_0x1d16db;_0x2d705e[_0x9a95('0x31')]=_[_0x9a95('0x34')](db[_0x9a95('0x50')][_0x9a95('0x2f')]);_0x2d705e[_0x9a95('0x33')]=_[_0x9a95('0x34')](_0x156994[_0x9a95('0x33')]);_0x2d705e[_0x9a95('0x35')]=_[_0x9a95('0x36')](_0x2d705e[_0x9a95('0x31')],_0x2d705e[_0x9a95('0x33')]);_0x4e7831['attributes']=_[_0x9a95('0x36')](_0x2d705e[_0x9a95('0x31')],qs['fields'](_0x156994['query'][_0x9a95('0x38')]));_0x4e7831[_0x9a95('0x37')]=_0x4e7831[_0x9a95('0x37')][_0x9a95('0x39')]?_0x4e7831['attributes']:_0x2d705e[_0x9a95('0x31')];_0x4e7831[_0x9a95('0x3c')]=qs[_0x9a95('0x51')](_0x156994[_0x9a95('0x33')][_0x9a95('0x51')]);_0x4e7831['where']=qs[_0x9a95('0x35')](_[_0x9a95('0x3e')](_0x156994[_0x9a95('0x33')],_0x2d705e[_0x9a95('0x35')]));if(_0x156994[_0x9a95('0x33')][_0x9a95('0x3f')]){_0x4e7831[_0x9a95('0x3d')]=_[_0x9a95('0x42')](_0x4e7831[_0x9a95('0x3d')],{'$or':_[_0x9a95('0x32')](_0x4e7831[_0x9a95('0x37')],function(_0x196c56){var _0x3e936b={};_0x3e936b[_0x196c56]={'$like':'%'+_0x156994[_0x9a95('0x33')][_0x9a95('0x3f')]+'%'};return _0x3e936b;})});}_0x4e7831=_[_0x9a95('0x42')]({},_0x4e7831,_0x156994[_0x9a95('0x4b')]);return _0x3ffa96['getSubjects'](_0x4e7831);}})['then'](function(_0x19de4c){if(_0x19de4c){_0x28e3f5=_0x19de4c[_0x9a95('0x39')];if(!_0x156994[_0x9a95('0x33')][_0x9a95('0x3a')](_0x9a95('0x3b'))){_0x4e7831[_0x9a95('0x20')]=qs['limit'](_0x156994[_0x9a95('0x33')][_0x9a95('0x20')]);_0x4e7831[_0x9a95('0x23')]=qs[_0x9a95('0x23')](_0x156994['query'][_0x9a95('0x23')]);}return _0x3ffa96['getSubjects'](_0x4e7831);}})[_0x9a95('0x29')](function(_0x20edc0){if(_0x20edc0){return _0x20edc0?{'count':_0x28e3f5,'rows':_0x20edc0}:null;}})['then'](respondWithResult(_0x57eccb,null))[_0x9a95('0x48')](handleError(_0x57eccb,null));};exports[_0x9a95('0x54')]=function(_0xd09b94,_0x5ec143,_0x4c448c){var _0xc5a0d2={};var _0x16ef3e={};var _0x100cf2;var _0x5dd263;return db[_0x9a95('0x43')][_0x9a95('0x53')]({'where':{'id':_0xd09b94[_0x9a95('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ec143,null))[_0x9a95('0x29')](function(_0x321235){if(_0x321235){_0x100cf2=_0x321235;_0x16ef3e[_0x9a95('0x31')]=_[_0x9a95('0x34')](db['ZohoField']['rawAttributes']);_0x16ef3e[_0x9a95('0x33')]=_['keys'](_0xd09b94['query']);_0x16ef3e[_0x9a95('0x35')]=_[_0x9a95('0x36')](_0x16ef3e[_0x9a95('0x31')],_0x16ef3e[_0x9a95('0x33')]);_0xc5a0d2[_0x9a95('0x37')]=_[_0x9a95('0x36')](_0x16ef3e[_0x9a95('0x31')],qs['fields'](_0xd09b94['query'][_0x9a95('0x38')]));_0xc5a0d2['attributes']=_0xc5a0d2[_0x9a95('0x37')][_0x9a95('0x39')]?_0xc5a0d2['attributes']:_0x16ef3e['model'];_0xc5a0d2[_0x9a95('0x3c')]=qs[_0x9a95('0x51')](_0xd09b94[_0x9a95('0x33')][_0x9a95('0x51')]);_0xc5a0d2[_0x9a95('0x3d')]=qs[_0x9a95('0x35')](_[_0x9a95('0x3e')](_0xd09b94['query'],_0x16ef3e[_0x9a95('0x35')]));if(_0xd09b94[_0x9a95('0x33')][_0x9a95('0x3f')]){_0xc5a0d2[_0x9a95('0x3d')]=_[_0x9a95('0x42')](_0xc5a0d2[_0x9a95('0x3d')],{'$or':_[_0x9a95('0x32')](_0xc5a0d2[_0x9a95('0x37')],function(_0x5c1621){var _0x59a330={};_0x59a330[_0x5c1621]={'$like':'%'+_0xd09b94[_0x9a95('0x33')][_0x9a95('0x3f')]+'%'};return _0x59a330;})});}_0xc5a0d2=_[_0x9a95('0x42')]({},_0xc5a0d2,_0xd09b94[_0x9a95('0x4b')]);return _0x100cf2[_0x9a95('0x54')](_0xc5a0d2);}})[_0x9a95('0x29')](function(_0x2e84ad){if(_0x2e84ad){_0x5dd263=_0x2e84ad[_0x9a95('0x39')];if(!_0xd09b94['query'][_0x9a95('0x3a')](_0x9a95('0x3b'))){_0xc5a0d2[_0x9a95('0x20')]=qs[_0x9a95('0x20')](_0xd09b94[_0x9a95('0x33')][_0x9a95('0x20')]);_0xc5a0d2[_0x9a95('0x23')]=qs['offset'](_0xd09b94[_0x9a95('0x33')][_0x9a95('0x23')]);}return _0x100cf2[_0x9a95('0x54')](_0xc5a0d2);}})[_0x9a95('0x29')](function(_0x5b6c9c){if(_0x5b6c9c){return _0x5b6c9c?{'count':_0x5dd263,'rows':_0x5b6c9c}:null;}})['then'](respondWithResult(_0x5ec143,null))['catch'](handleError(_0x5ec143,null));}; \ No newline at end of file +var _0xae6d=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','params','findOne','ZohoField','getFields','getSubjects','getDescriptions','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','ZohoConfiguration','fieldName','key','model','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae6d,0x11b));var _0xdae6=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0xae6d[_0x1a8ff0];return _0x3588bf;};'use strict';var emlformat=require(_0xdae6('0x0'));var rimraf=require(_0xdae6('0x1'));var zipdir=require(_0xdae6('0x2'));var jsonpatch=require(_0xdae6('0x3'));var rp=require(_0xdae6('0x4'));var moment=require(_0xdae6('0x5'));var BPromise=require(_0xdae6('0x6'));var Mustache=require(_0xdae6('0x7'));var util=require(_0xdae6('0x8'));var path=require(_0xdae6('0x9'));var sox=require(_0xdae6('0xa'));var csv=require(_0xdae6('0xb'));var ejs=require(_0xdae6('0xc'));var fs=require('fs');var fs_extra=require(_0xdae6('0xd'));var _=require(_0xdae6('0xe'));var squel=require(_0xdae6('0xf'));var crypto=require('crypto');var jsforce=require(_0xdae6('0x10'));var deskjs=require(_0xdae6('0x11'));var toCsv=require(_0xdae6('0xb'));var querystring=require(_0xdae6('0x12'));var Papa=require(_0xdae6('0x13'));var Redis=require('ioredis');var authService=require(_0xdae6('0x14'));var qs=require(_0xdae6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdae6('0x16'));var logger=require(_0xdae6('0x17'))(_0xdae6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdae6('0x19'))['db'];function respondWithStatusCode(_0x1c32bb,_0x2b214c){_0x2b214c=_0x2b214c||0xcc;return function(_0x46cf35){if(_0x46cf35){return _0x1c32bb['sendStatus'](_0x2b214c);}return _0x1c32bb['status'](_0x2b214c)[_0xdae6('0x1a')]();};}function respondWithResult(_0x227cbb,_0x3c21c1){_0x3c21c1=_0x3c21c1||0xc8;return function(_0x4086a4){if(_0x4086a4){return _0x227cbb[_0xdae6('0x1b')](_0x3c21c1)['json'](_0x4086a4);}};}function respondWithFilteredResult(_0x308494,_0x4e9d54){return function(_0x41badb){if(_0x41badb){var _0x1e1522=typeof _0x4e9d54[_0xdae6('0x1c')]==='undefined'&&typeof _0x4e9d54[_0xdae6('0x1d')]===_0xdae6('0x1e');var _0x42063f=_0x41badb[_0xdae6('0x1f')];var _0x39f77d=_0x1e1522?0x0:_0x4e9d54[_0xdae6('0x1c')];var _0x62315c=_0x1e1522?_0x41badb[_0xdae6('0x1f')]:_0x4e9d54[_0xdae6('0x1c')]+_0x4e9d54[_0xdae6('0x1d')];var _0x4d895a;if(_0x62315c>=_0x42063f){_0x62315c=_0x42063f;_0x4d895a=0xc8;}else{_0x4d895a=0xce;}_0x308494[_0xdae6('0x1b')](_0x4d895a);return _0x308494[_0xdae6('0x20')]('Content-Range',_0x39f77d+'-'+_0x62315c+'/'+_0x42063f)[_0xdae6('0x21')](_0x41badb);}return null;};}function patchUpdates(_0x155a48){return function(_0x405cd4){try{jsonpatch[_0xdae6('0x22')](_0x405cd4,_0x155a48,!![]);}catch(_0x1af408){return BPromise[_0xdae6('0x23')](_0x1af408);}return _0x405cd4[_0xdae6('0x24')]();};}function saveUpdates(_0x4c236d,_0x490fdb){return function(_0x2c3e99){if(_0x2c3e99){return _0x2c3e99[_0xdae6('0x25')](_0x4c236d)[_0xdae6('0x26')](function(_0x1ff037){return _0x1ff037;});}return null;};}function removeEntity(_0x21dfc4,_0x52f57d){return function(_0x53049b){if(_0x53049b){return _0x53049b[_0xdae6('0x27')]()[_0xdae6('0x26')](function(){_0x21dfc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e71e,_0x4e1e5f){return function(_0x32d4bc){if(!_0x32d4bc){_0x34e71e[_0xdae6('0x28')](0x194);}return _0x32d4bc;};}function handleError(_0x3d1a09,_0x2c8a96){_0x2c8a96=_0x2c8a96||0x1f4;return function(_0x1fee12){logger['error'](_0x1fee12[_0xdae6('0x29')]);if(_0x1fee12[_0xdae6('0x2a')]){delete _0x1fee12[_0xdae6('0x2a')];}_0x3d1a09[_0xdae6('0x1b')](_0x2c8a96)[_0xdae6('0x2b')](_0x1fee12);};}exports['index']=function(_0xae5b6e,_0x2a3c73){var _0x54cac9={},_0x3c5d3e={},_0x27fd26={'count':0x0,'rows':[]};var _0x503ade=_['map'](db[_0xdae6('0x2c')]['rawAttributes'],function(_0x4ed1ac){return{'name':_0x4ed1ac[_0xdae6('0x2d')],'type':_0x4ed1ac['type'][_0xdae6('0x2e')]};});_0x3c5d3e[_0xdae6('0x2f')]=_[_0xdae6('0x30')](_0x503ade,_0xdae6('0x2a'));_0x3c5d3e[_0xdae6('0x31')]=_[_0xdae6('0x32')](_0xae5b6e[_0xdae6('0x31')]);_0x3c5d3e[_0xdae6('0x33')]=_[_0xdae6('0x34')](_0x3c5d3e[_0xdae6('0x2f')],_0x3c5d3e[_0xdae6('0x31')]);_0x54cac9[_0xdae6('0x35')]=_['intersection'](_0x3c5d3e['model'],qs['fields'](_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x36')]));_0x54cac9[_0xdae6('0x35')]=_0x54cac9[_0xdae6('0x35')]['length']?_0x54cac9['attributes']:_0x3c5d3e[_0xdae6('0x2f')];if(!_0xae5b6e['query'][_0xdae6('0x37')](_0xdae6('0x38'))){_0x54cac9['limit']=qs['limit'](_0xae5b6e['query'][_0xdae6('0x1d')]);_0x54cac9[_0xdae6('0x1c')]=qs[_0xdae6('0x1c')](_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x1c')]);}_0x54cac9[_0xdae6('0x39')]=qs[_0xdae6('0x3a')](_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x54cac9[_0xdae6('0x3b')]=qs[_0xdae6('0x33')](_[_0xdae6('0x3c')](_0xae5b6e[_0xdae6('0x31')],_0x3c5d3e['filters']),_0x503ade);if(_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x54cac9[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x54cac9[_0xdae6('0x3b')],{'$or':_['map'](_0x503ade,function(_0x56221c){if(_0x56221c[_0xdae6('0x3f')]!==_0xdae6('0x40')){var _0x4d2d93={};_0x4d2d93[_0x56221c['name']]={'$like':'%'+_0xae5b6e[_0xdae6('0x31')][_0xdae6('0x3d')]+'%'};return _0x4d2d93;}})});}_0x54cac9=_[_0xdae6('0x3e')]({},_0x54cac9,_0xae5b6e[_0xdae6('0x41')]);var _0x1fa103={'where':_0x54cac9[_0xdae6('0x3b')]};return db['ZohoConfiguration'][_0xdae6('0x1f')](_0x1fa103)[_0xdae6('0x26')](function(_0x482ce4){_0x27fd26[_0xdae6('0x1f')]=_0x482ce4;if(_0xae5b6e[_0xdae6('0x31')]['includeAll']){_0x54cac9[_0xdae6('0x42')]=[{'all':!![]}];}return db[_0xdae6('0x2c')][_0xdae6('0x43')](_0x54cac9);})[_0xdae6('0x26')](function(_0x436f53){_0x27fd26[_0xdae6('0x44')]=_0x436f53;return _0x27fd26;})[_0xdae6('0x26')](respondWithFilteredResult(_0x2a3c73,_0x54cac9))[_0xdae6('0x45')](handleError(_0x2a3c73,null));};exports[_0xdae6('0x46')]=function(_0xe88e54,_0x2754ac){var _0x2e845f={'raw':![],'where':{'id':_0xe88e54['params']['id']}},_0x9f4b80={};_0x9f4b80[_0xdae6('0x2f')]=_['keys'](db['ZohoConfiguration'][_0xdae6('0x47')]);_0x9f4b80['query']=_[_0xdae6('0x32')](_0xe88e54[_0xdae6('0x31')]);_0x9f4b80[_0xdae6('0x33')]=_['intersection'](_0x9f4b80['model'],_0x9f4b80[_0xdae6('0x31')]);_0x2e845f[_0xdae6('0x35')]=_['intersection'](_0x9f4b80[_0xdae6('0x2f')],qs[_0xdae6('0x36')](_0xe88e54['query']['fields']));_0x2e845f[_0xdae6('0x35')]=_0x2e845f[_0xdae6('0x35')][_0xdae6('0x48')]?_0x2e845f['attributes']:_0x9f4b80['model'];if(_0xe88e54[_0xdae6('0x31')][_0xdae6('0x49')]){_0x2e845f[_0xdae6('0x42')]=[{'all':!![]}];}_0x2e845f=_[_0xdae6('0x3e')]({},_0x2e845f,_0xe88e54[_0xdae6('0x41')]);return db[_0xdae6('0x2c')][_0xdae6('0x4a')](_0x2e845f)['then'](handleEntityNotFound(_0x2754ac,null))[_0xdae6('0x26')](respondWithResult(_0x2754ac,null))[_0xdae6('0x45')](handleError(_0x2754ac,null));};exports[_0xdae6('0x4b')]=function(_0x2bf5c4,_0x32e31d){return db[_0xdae6('0x2c')][_0xdae6('0x4b')](_0x2bf5c4[_0xdae6('0x4c')],{})['then'](respondWithResult(_0x32e31d,0xc9))[_0xdae6('0x45')](handleError(_0x32e31d,null));};exports[_0xdae6('0x25')]=function(_0x3e9bc6,_0x541da7){if(_0x3e9bc6[_0xdae6('0x4c')]['id']){delete _0x3e9bc6[_0xdae6('0x4c')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x3e9bc6['params']['id']}})['then'](handleEntityNotFound(_0x541da7,null))[_0xdae6('0x26')](saveUpdates(_0x3e9bc6[_0xdae6('0x4c')],null))[_0xdae6('0x26')](respondWithResult(_0x541da7,null))[_0xdae6('0x45')](handleError(_0x541da7,null));};exports[_0xdae6('0x27')]=function(_0x11696d,_0x191ac9){return db[_0xdae6('0x2c')][_0xdae6('0x4a')]({'where':{'id':_0x11696d[_0xdae6('0x4d')]['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x191ac9,null))[_0xdae6('0x26')](removeEntity(_0x191ac9,null))[_0xdae6('0x45')](handleError(_0x191ac9,null));};exports['getFields']=function(_0x47354b,_0x51f5d3,_0x512273){var _0x91c18f={};var _0x8e4dbc={};var _0x35f344;var _0xc15d0;return db[_0xdae6('0x2c')][_0xdae6('0x4e')]({'where':{'id':_0x47354b[_0xdae6('0x4d')]['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x51f5d3,null))['then'](function(_0xca9435){if(_0xca9435){_0x35f344=_0xca9435;_0x8e4dbc[_0xdae6('0x2f')]=_[_0xdae6('0x32')](db[_0xdae6('0x4f')][_0xdae6('0x47')]);_0x8e4dbc[_0xdae6('0x31')]=_[_0xdae6('0x32')](_0x47354b['query']);_0x8e4dbc['filters']=_[_0xdae6('0x34')](_0x8e4dbc[_0xdae6('0x2f')],_0x8e4dbc[_0xdae6('0x31')]);_0x91c18f[_0xdae6('0x35')]=_[_0xdae6('0x34')](_0x8e4dbc[_0xdae6('0x2f')],qs[_0xdae6('0x36')](_0x47354b[_0xdae6('0x31')][_0xdae6('0x36')]));_0x91c18f[_0xdae6('0x35')]=_0x91c18f['attributes']['length']?_0x91c18f['attributes']:_0x8e4dbc[_0xdae6('0x2f')];_0x91c18f['order']=qs['sort'](_0x47354b[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x91c18f[_0xdae6('0x3b')]=qs[_0xdae6('0x33')](_['pick'](_0x47354b[_0xdae6('0x31')],_0x8e4dbc[_0xdae6('0x33')]));if(_0x47354b[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x91c18f[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x91c18f[_0xdae6('0x3b')],{'$or':_[_0xdae6('0x30')](_0x91c18f[_0xdae6('0x35')],function(_0x47303b){var _0x556716={};_0x556716[_0x47303b]={'$like':'%'+_0x47354b[_0xdae6('0x31')][_0xdae6('0x3d')]+'%'};return _0x556716;})});}_0x91c18f=_[_0xdae6('0x3e')]({},_0x91c18f,_0x47354b['options']);return _0x35f344[_0xdae6('0x50')](_0x91c18f);}})[_0xdae6('0x26')](function(_0x271864){if(_0x271864){_0xc15d0=_0x271864['length'];if(!_0x47354b[_0xdae6('0x31')][_0xdae6('0x37')](_0xdae6('0x38'))){_0x91c18f[_0xdae6('0x1d')]=qs[_0xdae6('0x1d')](_0x47354b[_0xdae6('0x31')][_0xdae6('0x1d')]);_0x91c18f[_0xdae6('0x1c')]=qs[_0xdae6('0x1c')](_0x47354b[_0xdae6('0x31')][_0xdae6('0x1c')]);}return _0x35f344[_0xdae6('0x50')](_0x91c18f);}})[_0xdae6('0x26')](function(_0x2637cb){if(_0x2637cb){return _0x2637cb?{'count':_0xc15d0,'rows':_0x2637cb}:null;}})[_0xdae6('0x26')](respondWithResult(_0x51f5d3,null))[_0xdae6('0x45')](handleError(_0x51f5d3,null));};exports['getSubjects']=function(_0x4b4b7b,_0x3bc1e3,_0x2e95d9){var _0x1461b9={};var _0xb874e={};var _0xd2c85e;var _0x41efbd;return db[_0xdae6('0x2c')][_0xdae6('0x4e')]({'where':{'id':_0x4b4b7b['params']['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x3bc1e3,null))['then'](function(_0x3f9533){if(_0x3f9533){_0xd2c85e=_0x3f9533;_0xb874e[_0xdae6('0x2f')]=_['keys'](db[_0xdae6('0x4f')][_0xdae6('0x47')]);_0xb874e[_0xdae6('0x31')]=_['keys'](_0x4b4b7b['query']);_0xb874e[_0xdae6('0x33')]=_[_0xdae6('0x34')](_0xb874e[_0xdae6('0x2f')],_0xb874e[_0xdae6('0x31')]);_0x1461b9[_0xdae6('0x35')]=_[_0xdae6('0x34')](_0xb874e[_0xdae6('0x2f')],qs['fields'](_0x4b4b7b['query'][_0xdae6('0x36')]));_0x1461b9[_0xdae6('0x35')]=_0x1461b9[_0xdae6('0x35')][_0xdae6('0x48')]?_0x1461b9[_0xdae6('0x35')]:_0xb874e[_0xdae6('0x2f')];_0x1461b9[_0xdae6('0x39')]=qs[_0xdae6('0x3a')](_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x1461b9[_0xdae6('0x3b')]=qs['filters'](_[_0xdae6('0x3c')](_0x4b4b7b['query'],_0xb874e[_0xdae6('0x33')]));if(_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x1461b9[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x1461b9[_0xdae6('0x3b')],{'$or':_[_0xdae6('0x30')](_0x1461b9['attributes'],function(_0x366298){var _0x49a38a={};_0x49a38a[_0x366298]={'$like':'%'+_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x3d')]+'%'};return _0x49a38a;})});}_0x1461b9=_[_0xdae6('0x3e')]({},_0x1461b9,_0x4b4b7b[_0xdae6('0x41')]);return _0xd2c85e[_0xdae6('0x51')](_0x1461b9);}})['then'](function(_0x2798f1){if(_0x2798f1){_0x41efbd=_0x2798f1['length'];if(!_0x4b4b7b[_0xdae6('0x31')][_0xdae6('0x37')](_0xdae6('0x38'))){_0x1461b9[_0xdae6('0x1d')]=qs[_0xdae6('0x1d')](_0x4b4b7b['query'][_0xdae6('0x1d')]);_0x1461b9['offset']=qs[_0xdae6('0x1c')](_0x4b4b7b['query']['offset']);}return _0xd2c85e['getSubjects'](_0x1461b9);}})[_0xdae6('0x26')](function(_0x295b6b){if(_0x295b6b){return _0x295b6b?{'count':_0x41efbd,'rows':_0x295b6b}:null;}})[_0xdae6('0x26')](respondWithResult(_0x3bc1e3,null))[_0xdae6('0x45')](handleError(_0x3bc1e3,null));};exports['getDescriptions']=function(_0x513b15,_0x29b8bf,_0x38a90b){var _0x56b2df={};var _0x37db39={};var _0x205cf1;var _0x97ad10;return db[_0xdae6('0x2c')][_0xdae6('0x4e')]({'where':{'id':_0x513b15['params']['id']}})[_0xdae6('0x26')](handleEntityNotFound(_0x29b8bf,null))[_0xdae6('0x26')](function(_0x378b9f){if(_0x378b9f){_0x205cf1=_0x378b9f;_0x37db39[_0xdae6('0x2f')]=_[_0xdae6('0x32')](db[_0xdae6('0x4f')]['rawAttributes']);_0x37db39[_0xdae6('0x31')]=_[_0xdae6('0x32')](_0x513b15[_0xdae6('0x31')]);_0x37db39[_0xdae6('0x33')]=_[_0xdae6('0x34')](_0x37db39[_0xdae6('0x2f')],_0x37db39['query']);_0x56b2df[_0xdae6('0x35')]=_[_0xdae6('0x34')](_0x37db39[_0xdae6('0x2f')],qs['fields'](_0x513b15[_0xdae6('0x31')][_0xdae6('0x36')]));_0x56b2df[_0xdae6('0x35')]=_0x56b2df['attributes'][_0xdae6('0x48')]?_0x56b2df[_0xdae6('0x35')]:_0x37db39['model'];_0x56b2df[_0xdae6('0x39')]=qs['sort'](_0x513b15[_0xdae6('0x31')][_0xdae6('0x3a')]);_0x56b2df[_0xdae6('0x3b')]=qs[_0xdae6('0x33')](_[_0xdae6('0x3c')](_0x513b15['query'],_0x37db39[_0xdae6('0x33')]));if(_0x513b15[_0xdae6('0x31')][_0xdae6('0x3d')]){_0x56b2df[_0xdae6('0x3b')]=_[_0xdae6('0x3e')](_0x56b2df[_0xdae6('0x3b')],{'$or':_['map'](_0x56b2df[_0xdae6('0x35')],function(_0x30c127){var _0x1a6314={};_0x1a6314[_0x30c127]={'$like':'%'+_0x513b15['query'][_0xdae6('0x3d')]+'%'};return _0x1a6314;})});}_0x56b2df=_[_0xdae6('0x3e')]({},_0x56b2df,_0x513b15['options']);return _0x205cf1[_0xdae6('0x52')](_0x56b2df);}})[_0xdae6('0x26')](function(_0xc86f62){if(_0xc86f62){_0x97ad10=_0xc86f62[_0xdae6('0x48')];if(!_0x513b15[_0xdae6('0x31')][_0xdae6('0x37')]('nolimit')){_0x56b2df[_0xdae6('0x1d')]=qs[_0xdae6('0x1d')](_0x513b15[_0xdae6('0x31')][_0xdae6('0x1d')]);_0x56b2df[_0xdae6('0x1c')]=qs[_0xdae6('0x1c')](_0x513b15[_0xdae6('0x31')][_0xdae6('0x1c')]);}return _0x205cf1[_0xdae6('0x52')](_0x56b2df);}})['then'](function(_0x550500){if(_0x550500){return _0x550500?{'count':_0x97ad10,'rows':_0x550500}:null;}})[_0xdae6('0x26')](respondWithResult(_0x29b8bf,null))[_0xdae6('0x45')](handleError(_0x29b8bf,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 470d541..c6c95b1 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 _0xb3f0=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb3f0,0x10f));var _0x0b3f=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb3f0[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x0b3f('0x0'));var logger=require(_0x0b3f('0x1'))(_0x0b3f('0x2'));var moment=require(_0x0b3f('0x3'));var BPromise=require(_0x0b3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b3f('0x5'));var rimraf=require(_0x0b3f('0x6'));var config=require(_0x0b3f('0x7'));var attributes=require(_0x0b3f('0x8'));module['exports']=function(_0x5f4260,_0x52d6a3){return _0x5f4260[_0x0b3f('0x9')](_0x0b3f('0xa'),attributes,{'tableName':_0x0b3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf15d=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','moment'];(function(_0x13e239,_0x2b5884){var _0x17a730=function(_0x4c62bc){while(--_0x4c62bc){_0x13e239['push'](_0x13e239['shift']());}};_0x17a730(++_0x2b5884);}(_0xf15d,0x1ae));var _0xdf15=function(_0xc5daa2,_0x4fe5ac){_0xc5daa2=_0xc5daa2-0x0;var _0x21e811=_0xf15d[_0xc5daa2];return _0x21e811;};'use strict';var _=require('lodash');var util=require(_0xdf15('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdf15('0x1'));var BPromise=require(_0xdf15('0x2'));var rp=require(_0xdf15('0x3'));var fs=require('fs');var path=require(_0xdf15('0x4'));var rimraf=require(_0xdf15('0x5'));var config=require(_0xdf15('0x6'));var attributes=require(_0xdf15('0x7'));module[_0xdf15('0x8')]=function(_0x8a6b95,_0x48a3df){return _0x8a6b95[_0xdf15('0x9')](_0xdf15('0xa'),attributes,{'tableName':_0xdf15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index facf147..52447ee 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 _0x5d14=['../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x206993,_0x11b404){var _0x8c1e4e=function(_0x4dd7d1){while(--_0x4dd7d1){_0x206993['push'](_0x206993['shift']());}};_0x8c1e4e(++_0x11b404);}(_0x5d14,0x19e));var _0x45d1=function(_0x1de641,_0x44d464){_0x1de641=_0x1de641-0x0;var _0xccacbc=_0x5d14[_0x1de641];return _0xccacbc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x45d1('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45d1('0x1'));var db=require(_0x45d1('0x2'))['db'];var utils=require(_0x45d1('0x3'));var logger=require(_0x45d1('0x4'))(_0x45d1('0x5'));var config=require(_0x45d1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x45d1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17a9ac,_0x310e5a,_0x4ec09c){return new BPromise(function(_0xe6470f,_0x5bf024){return client[_0x45d1('0x8')](_0x17a9ac,_0x4ec09c)[_0x45d1('0x9')](function(_0x5b5c65){logger[_0x45d1('0xa')](_0x45d1('0xb'),_0x310e5a,_0x45d1('0xc'));logger[_0x45d1('0xd')](_0x45d1('0xe'),_0x310e5a,_0x45d1('0xc'),JSON[_0x45d1('0xf')](_0x5b5c65));if(_0x5b5c65[_0x45d1('0x10')]){if(_0x5b5c65['error'][_0x45d1('0x11')]===0x1f4){logger[_0x45d1('0x10')](_0x45d1('0xb'),_0x310e5a,_0x5b5c65[_0x45d1('0x10')]['message']);return _0x5bf024(_0x5b5c65[_0x45d1('0x10')][_0x45d1('0x12')]);}logger[_0x45d1('0x10')](_0x45d1('0xb'),_0x310e5a,_0x5b5c65['error'][_0x45d1('0x12')]);return _0xe6470f(_0x5b5c65[_0x45d1('0x10')][_0x45d1('0x12')]);}else{logger[_0x45d1('0xa')](_0x45d1('0xb'),_0x310e5a,_0x45d1('0xc'));_0xe6470f(_0x5b5c65[_0x45d1('0x13')]['message']);}})['catch'](function(_0xde8428){logger[_0x45d1('0x10')](_0x45d1('0xb'),_0x310e5a,_0xde8428);_0x5bf024(_0xde8428);});});} \ No newline at end of file +var _0xefef=['error','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','message'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xefef,0xdf));var _0xfefe=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xefef[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0xfefe('0x0'));var util=require('util');var moment=require(_0xfefe('0x1'));var BPromise=require(_0xfefe('0x2'));var rs=require(_0xfefe('0x3'));var fs=require('fs');var Redis=require(_0xfefe('0x4'));var db=require(_0xfefe('0x5'))['db'];var utils=require(_0xfefe('0x6'));var logger=require(_0xfefe('0x7'))('rpc');var config=require(_0xfefe('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfefe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18730b,_0x5e80b9,_0x338c93){return new BPromise(function(_0xfbf67e,_0xf1aa5b){return client[_0xfefe('0xa')](_0x18730b,_0x338c93)[_0xfefe('0xb')](function(_0x4472f1){logger['info'](_0xfefe('0xc'),_0x5e80b9,_0xfefe('0xd'));logger['debug'](_0xfefe('0xe'),_0x5e80b9,_0xfefe('0xd'),JSON[_0xfefe('0xf')](_0x4472f1));if(_0x4472f1['error']){if(_0x4472f1['error']['code']===0x1f4){logger['error'](_0xfefe('0xc'),_0x5e80b9,_0x4472f1['error'][_0xfefe('0x10')]);return _0xf1aa5b(_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);}logger[_0xfefe('0x11')](_0xfefe('0xc'),_0x5e80b9,_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);return _0xfbf67e(_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);}else{logger[_0xfefe('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x5e80b9,_0xfefe('0xd'));_0xfbf67e(_0x4472f1[_0xfefe('0x13')][_0xfefe('0x10')]);}})['catch'](function(_0x24353f){logger['error'](_0xfefe('0xc'),_0x5e80b9,_0x24353f);_0xf1aa5b(_0x24353f);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 12f3336..a09b992 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 _0x6e8b=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x14cc68,_0x3fd7fb){var _0x20a0d3=function(_0x6e8232){while(--_0x6e8232){_0x14cc68['push'](_0x14cc68['shift']());}};_0x20a0d3(++_0x3fd7fb);}(_0x6e8b,0x109));var _0xb6e8=function(_0xfaddc9,_0x5c9ad2){_0xfaddc9=_0xfaddc9-0x0;var _0x579846=_0x6e8b[_0xfaddc9];return _0x579846;};'use strict';var multer=require(_0xb6e8('0x0'));var util=require('util');var path=require(_0xb6e8('0x1'));var timeout=require(_0xb6e8('0x2'));var express=require(_0xb6e8('0x3'));var router=express['Router']();var fs_extra=require(_0xb6e8('0x4'));var auth=require(_0xb6e8('0x5'));var interaction=require(_0xb6e8('0x6'));var config=require(_0xb6e8('0x7'));var controller=require(_0xb6e8('0x8'));router[_0xb6e8('0x9')]('/',auth[_0xb6e8('0xa')](),controller[_0xb6e8('0xb')]);router[_0xb6e8('0x9')](_0xb6e8('0xc'),auth[_0xb6e8('0xa')](),controller[_0xb6e8('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb6e8('0xe')]);router[_0xb6e8('0xf')](_0xb6e8('0xc'),auth['isAuthenticated'](),controller[_0xb6e8('0x10')]);router[_0xb6e8('0x11')](_0xb6e8('0xc'),auth[_0xb6e8('0xa')](),controller[_0xb6e8('0x12')]);module[_0xb6e8('0x13')]=router; \ No newline at end of file +var _0x2340=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2f7ed6,_0x32d850){var _0x27fbf6=function(_0x4810fb){while(--_0x4810fb){_0x2f7ed6['push'](_0x2f7ed6['shift']());}};_0x27fbf6(++_0x32d850);}(_0x2340,0xf5));var _0x0234=function(_0x4e1abb,_0x290f95){_0x4e1abb=_0x4e1abb-0x0;var _0x1b26a7=_0x2340[_0x4e1abb];return _0x1b26a7;};'use strict';var multer=require('multer');var util=require(_0x0234('0x0'));var path=require(_0x0234('0x1'));var timeout=require('connect-timeout');var express=require(_0x0234('0x2'));var router=express[_0x0234('0x3')]();var fs_extra=require(_0x0234('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0234('0x5'));var config=require(_0x0234('0x6'));var controller=require(_0x0234('0x7'));router[_0x0234('0x8')]('/',auth[_0x0234('0x9')](),controller[_0x0234('0xa')]);router['get'](_0x0234('0xb'),auth['isAuthenticated'](),controller[_0x0234('0xc')]);router[_0x0234('0xd')]('/',auth[_0x0234('0x9')](),controller['create']);router[_0x0234('0xe')](_0x0234('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0234('0xf')](_0x0234('0xb'),auth[_0x0234('0x9')](),controller[_0x0234('0x10')]);module[_0x0234('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 7c17402..16d63dc 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 _0x351f=['STRING','variable','BOOLEAN','exports','ENUM','customVariable','keyValue','picklist','string'];(function(_0x279238,_0xd85a9c){var _0xefb16=function(_0x26c840){while(--_0x26c840){_0x279238['push'](_0x279238['shift']());}};_0xefb16(++_0xd85a9c);}(_0x351f,0x12c));var _0xf351=function(_0x5af93a,_0x3295be){_0x5af93a=_0x5af93a-0x0;var _0x401444=_0x351f[_0x5af93a];return _0x401444;};'use strict';var Sequelize=require('sequelize');module[_0xf351('0x0')]={'type':{'type':Sequelize[_0xf351('0x1')]('string','variable',_0xf351('0x2'),_0xf351('0x3'),_0xf351('0x4')),'defaultValue':_0xf351('0x5')},'content':{'type':Sequelize[_0xf351('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf351('0x5'),_0xf351('0x7'),_0xf351('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf351('0x6')]},'nameField':{'type':Sequelize[_0xf351('0x6')]},'customField':{'type':Sequelize[_0xf351('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4f76=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f76,0x1aa));var _0x64f7=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0x4f76[_0x31b31b];return _0x2c8fc2;};'use strict';var Sequelize=require(_0x64f7('0x0'));module[_0x64f7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x64f7('0x2'),_0x64f7('0x3'),_0x64f7('0x4'),_0x64f7('0x5'),_0x64f7('0x6')),'defaultValue':_0x64f7('0x2')},'content':{'type':Sequelize[_0x64f7('0x7')]},'key':{'type':Sequelize[_0x64f7('0x7')]},'keyType':{'type':Sequelize[_0x64f7('0x8')](_0x64f7('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x64f7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64f7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 76f77c1..2bf449a 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 _0xe5a2=['catch','show','params','ZohoField','rawAttributes','intersection','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','type','key','map','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','include','findAll','rows'];(function(_0x4f6c07,_0x112fc8){var _0x1bb56b=function(_0x82d84b){while(--_0x82d84b){_0x4f6c07['push'](_0x4f6c07['shift']());}};_0x1bb56b(++_0x112fc8);}(_0xe5a2,0x98));var _0x2e5a=function(_0x39e5ce,_0x1eb61d){_0x39e5ce=_0x39e5ce-0x0;var _0x37e737=_0xe5a2[_0x39e5ce];return _0x37e737;};'use strict';var emlformat=require(_0x2e5a('0x0'));var rimraf=require(_0x2e5a('0x1'));var zipdir=require(_0x2e5a('0x2'));var jsonpatch=require(_0x2e5a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e5a('0x4'));var util=require(_0x2e5a('0x5'));var path=require(_0x2e5a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e5a('0x8'));var squel=require(_0x2e5a('0x9'));var crypto=require('crypto');var jsforce=require(_0x2e5a('0xa'));var deskjs=require(_0x2e5a('0xb'));var toCsv=require(_0x2e5a('0xc'));var querystring=require(_0x2e5a('0xd'));var Papa=require('papaparse');var Redis=require(_0x2e5a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2e5a('0xf'));var as=require(_0x2e5a('0x10'));var hardwareService=require(_0x2e5a('0x11'));var logger=require('../../config/logger')(_0x2e5a('0x12'));var utils=require(_0x2e5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2e5a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51be77,_0x565930){_0x565930=_0x565930||0xcc;return function(_0x431806){if(_0x431806){return _0x51be77['sendStatus'](_0x565930);}return _0x51be77[_0x2e5a('0x15')](_0x565930)['end']();};}function respondWithResult(_0x35389f,_0x4d3955){_0x4d3955=_0x4d3955||0xc8;return function(_0x55683b){if(_0x55683b){return _0x35389f[_0x2e5a('0x15')](_0x4d3955)[_0x2e5a('0x16')](_0x55683b);}};}function respondWithFilteredResult(_0x32ac4b,_0x5727b2){return function(_0x33d65b){if(_0x33d65b){var _0xea48b4=typeof _0x5727b2[_0x2e5a('0x17')]===_0x2e5a('0x18')&&typeof _0x5727b2[_0x2e5a('0x19')]===_0x2e5a('0x18');var _0x24a812=_0x33d65b['count'];var _0x4a2834=_0xea48b4?0x0:_0x5727b2[_0x2e5a('0x17')];var _0x7d81dc=_0xea48b4?_0x33d65b[_0x2e5a('0x1a')]:_0x5727b2['offset']+_0x5727b2[_0x2e5a('0x19')];var _0x4b89ce;if(_0x7d81dc>=_0x24a812){_0x7d81dc=_0x24a812;_0x4b89ce=0xc8;}else{_0x4b89ce=0xce;}_0x32ac4b['status'](_0x4b89ce);return _0x32ac4b[_0x2e5a('0x1b')]('Content-Range',_0x4a2834+'-'+_0x7d81dc+'/'+_0x24a812)[_0x2e5a('0x16')](_0x33d65b);}return null;};}function patchUpdates(_0x24e818){return function(_0x345698){try{jsonpatch[_0x2e5a('0x1c')](_0x345698,_0x24e818,!![]);}catch(_0x241a92){return BPromise[_0x2e5a('0x1d')](_0x241a92);}return _0x345698[_0x2e5a('0x1e')]();};}function saveUpdates(_0x1551b2,_0x4229db){return function(_0x243ae2){if(_0x243ae2){return _0x243ae2[_0x2e5a('0x1f')](_0x1551b2)['then'](function(_0x37554f){return _0x37554f;});}return null;};}function removeEntity(_0x5f3830,_0x28518f){return function(_0x33df1e){if(_0x33df1e){return _0x33df1e[_0x2e5a('0x20')]()[_0x2e5a('0x21')](function(){_0x5f3830[_0x2e5a('0x15')](0xcc)[_0x2e5a('0x22')]();});}};}function handleEntityNotFound(_0x26b708,_0x207a6b){return function(_0x4dcf8d){if(!_0x4dcf8d){_0x26b708['sendStatus'](0x194);}return _0x4dcf8d;};}function handleError(_0xd53985,_0xa05d75){_0xa05d75=_0xa05d75||0x1f4;return function(_0x133f00){logger[_0x2e5a('0x23')](_0x133f00[_0x2e5a('0x24')]);if(_0x133f00[_0x2e5a('0x25')]){delete _0x133f00[_0x2e5a('0x25')];}_0xd53985[_0x2e5a('0x15')](_0xa05d75)[_0x2e5a('0x26')](_0x133f00);};}exports['index']=function(_0x4dea20,_0x445278){var _0x4e44b3={},_0x313a05={},_0x35f2ec={'count':0x0,'rows':[]};var _0x34ea4d=_['map'](db['ZohoField']['rawAttributes'],function(_0x3baa9d){return{'name':_0x3baa9d['fieldName'],'type':_0x3baa9d[_0x2e5a('0x27')][_0x2e5a('0x28')]};});_0x313a05['model']=_[_0x2e5a('0x29')](_0x34ea4d,_0x2e5a('0x25'));_0x313a05[_0x2e5a('0x2a')]=_[_0x2e5a('0x2b')](_0x4dea20[_0x2e5a('0x2a')]);_0x313a05['filters']=_['intersection'](_0x313a05[_0x2e5a('0x2c')],_0x313a05[_0x2e5a('0x2a')]);_0x4e44b3['attributes']=_['intersection'](_0x313a05[_0x2e5a('0x2c')],qs[_0x2e5a('0x2d')](_0x4dea20[_0x2e5a('0x2a')][_0x2e5a('0x2d')]));_0x4e44b3[_0x2e5a('0x2e')]=_0x4e44b3[_0x2e5a('0x2e')][_0x2e5a('0x2f')]?_0x4e44b3[_0x2e5a('0x2e')]:_0x313a05[_0x2e5a('0x2c')];if(!_0x4dea20['query'][_0x2e5a('0x30')](_0x2e5a('0x31'))){_0x4e44b3[_0x2e5a('0x19')]=qs[_0x2e5a('0x19')](_0x4dea20[_0x2e5a('0x2a')][_0x2e5a('0x19')]);_0x4e44b3['offset']=qs['offset'](_0x4dea20[_0x2e5a('0x2a')][_0x2e5a('0x17')]);}_0x4e44b3[_0x2e5a('0x32')]=qs[_0x2e5a('0x33')](_0x4dea20[_0x2e5a('0x2a')][_0x2e5a('0x33')]);_0x4e44b3['where']=qs[_0x2e5a('0x34')](_[_0x2e5a('0x35')](_0x4dea20['query'],_0x313a05[_0x2e5a('0x34')]),_0x34ea4d);if(_0x4dea20['query'][_0x2e5a('0x36')]){_0x4e44b3[_0x2e5a('0x37')]=_['merge'](_0x4e44b3[_0x2e5a('0x37')],{'$or':_[_0x2e5a('0x29')](_0x34ea4d,function(_0x9c8fb5){if(_0x9c8fb5[_0x2e5a('0x27')]!==_0x2e5a('0x38')){var _0x4c679d={};_0x4c679d[_0x9c8fb5[_0x2e5a('0x25')]]={'$like':'%'+_0x4dea20[_0x2e5a('0x2a')][_0x2e5a('0x36')]+'%'};return _0x4c679d;}})});}_0x4e44b3=_['merge']({},_0x4e44b3,_0x4dea20[_0x2e5a('0x39')]);var _0x5ed16b={'where':_0x4e44b3[_0x2e5a('0x37')]};return db['ZohoField']['count'](_0x5ed16b)[_0x2e5a('0x21')](function(_0x1909c8){_0x35f2ec[_0x2e5a('0x1a')]=_0x1909c8;if(_0x4dea20[_0x2e5a('0x2a')]['includeAll']){_0x4e44b3[_0x2e5a('0x3a')]=[{'all':!![]}];}return db['ZohoField'][_0x2e5a('0x3b')](_0x4e44b3);})[_0x2e5a('0x21')](function(_0x11b9a6){_0x35f2ec[_0x2e5a('0x3c')]=_0x11b9a6;return _0x35f2ec;})[_0x2e5a('0x21')](respondWithFilteredResult(_0x445278,_0x4e44b3))[_0x2e5a('0x3d')](handleError(_0x445278,null));};exports[_0x2e5a('0x3e')]=function(_0x58d060,_0x166af4){var _0x29d0c3={'raw':!![],'where':{'id':_0x58d060[_0x2e5a('0x3f')]['id']}},_0x79b12d={};_0x79b12d['model']=_['keys'](db[_0x2e5a('0x40')][_0x2e5a('0x41')]);_0x79b12d[_0x2e5a('0x2a')]=_[_0x2e5a('0x2b')](_0x58d060['query']);_0x79b12d[_0x2e5a('0x34')]=_[_0x2e5a('0x42')](_0x79b12d[_0x2e5a('0x2c')],_0x79b12d[_0x2e5a('0x2a')]);_0x29d0c3[_0x2e5a('0x2e')]=_[_0x2e5a('0x42')](_0x79b12d[_0x2e5a('0x2c')],qs[_0x2e5a('0x2d')](_0x58d060[_0x2e5a('0x2a')][_0x2e5a('0x2d')]));_0x29d0c3['attributes']=_0x29d0c3[_0x2e5a('0x2e')][_0x2e5a('0x2f')]?_0x29d0c3['attributes']:_0x79b12d['model'];if(_0x58d060[_0x2e5a('0x2a')][_0x2e5a('0x43')]){_0x29d0c3[_0x2e5a('0x3a')]=[{'all':!![]}];}_0x29d0c3=_['merge']({},_0x29d0c3,_0x58d060[_0x2e5a('0x39')]);return db[_0x2e5a('0x40')]['find'](_0x29d0c3)[_0x2e5a('0x21')](handleEntityNotFound(_0x166af4,null))[_0x2e5a('0x21')](respondWithResult(_0x166af4,null))[_0x2e5a('0x3d')](handleError(_0x166af4,null));};exports[_0x2e5a('0x44')]=function(_0x23c162,_0x41ce48){return db[_0x2e5a('0x40')][_0x2e5a('0x44')](_0x23c162['body'],{})[_0x2e5a('0x21')](respondWithResult(_0x41ce48,0xc9))[_0x2e5a('0x3d')](handleError(_0x41ce48,null));};exports[_0x2e5a('0x1f')]=function(_0x4bd956,_0x389a7b){if(_0x4bd956[_0x2e5a('0x45')]['id']){delete _0x4bd956[_0x2e5a('0x45')]['id'];}return db[_0x2e5a('0x40')][_0x2e5a('0x46')]({'where':{'id':_0x4bd956['params']['id']}})[_0x2e5a('0x21')](handleEntityNotFound(_0x389a7b,null))[_0x2e5a('0x21')](saveUpdates(_0x4bd956[_0x2e5a('0x45')],null))['then'](respondWithResult(_0x389a7b,null))['catch'](handleError(_0x389a7b,null));};exports['destroy']=function(_0x2d3bbb,_0x2d17b2){return db[_0x2e5a('0x40')][_0x2e5a('0x46')]({'where':{'id':_0x2d3bbb[_0x2e5a('0x3f')]['id']}})[_0x2e5a('0x21')](handleEntityNotFound(_0x2d17b2,null))[_0x2e5a('0x21')](removeEntity(_0x2d17b2,null))['catch'](handleError(_0x2d17b2,null));}; \ No newline at end of file +var _0x2f3a=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','model','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','filters'];(function(_0x252a30,_0x919e04){var _0x3aa79a=function(_0x25ce22){while(--_0x25ce22){_0x252a30['push'](_0x252a30['shift']());}};_0x3aa79a(++_0x919e04);}(_0x2f3a,0x195));var _0xa2f3=function(_0x23ce33,_0x388cfe){_0x23ce33=_0x23ce33-0x0;var _0x1f3c67=_0x2f3a[_0x23ce33];return _0x1f3c67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require('util');var path=require(_0xa2f3('0x6'));var sox=require(_0xa2f3('0x7'));var csv=require(_0xa2f3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require(_0xa2f3('0xa'));var crypto=require(_0xa2f3('0xb'));var jsforce=require(_0xa2f3('0xc'));var deskjs=require(_0xa2f3('0xd'));var toCsv=require(_0xa2f3('0x8'));var querystring=require(_0xa2f3('0xe'));var Papa=require(_0xa2f3('0xf'));var Redis=require('ioredis');var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa2f3('0x14'));var licenseUtil=require(_0xa2f3('0x15'));var db=require(_0xa2f3('0x16'))['db'];function respondWithStatusCode(_0x3a64f6,_0x5ccd84){_0x5ccd84=_0x5ccd84||0xcc;return function(_0x441119){if(_0x441119){return _0x3a64f6[_0xa2f3('0x17')](_0x5ccd84);}return _0x3a64f6[_0xa2f3('0x18')](_0x5ccd84)[_0xa2f3('0x19')]();};}function respondWithResult(_0x89bbe0,_0x50f79f){_0x50f79f=_0x50f79f||0xc8;return function(_0x323d86){if(_0x323d86){return _0x89bbe0[_0xa2f3('0x18')](_0x50f79f)[_0xa2f3('0x1a')](_0x323d86);}};}function respondWithFilteredResult(_0x5d6790,_0x68664a){return function(_0x37ad71){if(_0x37ad71){var _0x552991=typeof _0x68664a[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x68664a[_0xa2f3('0x1d')]===_0xa2f3('0x1c');var _0x126f01=_0x37ad71[_0xa2f3('0x1e')];var _0x13255b=_0x552991?0x0:_0x68664a[_0xa2f3('0x1b')];var _0x519f3b=_0x552991?_0x37ad71[_0xa2f3('0x1e')]:_0x68664a[_0xa2f3('0x1b')]+_0x68664a[_0xa2f3('0x1d')];var _0x1e5fb1;if(_0x519f3b>=_0x126f01){_0x519f3b=_0x126f01;_0x1e5fb1=0xc8;}else{_0x1e5fb1=0xce;}_0x5d6790[_0xa2f3('0x18')](_0x1e5fb1);return _0x5d6790[_0xa2f3('0x1f')](_0xa2f3('0x20'),_0x13255b+'-'+_0x519f3b+'/'+_0x126f01)[_0xa2f3('0x1a')](_0x37ad71);}return null;};}function patchUpdates(_0x2194d1){return function(_0x2f0842){try{jsonpatch[_0xa2f3('0x21')](_0x2f0842,_0x2194d1,!![]);}catch(_0x1d2c84){return BPromise[_0xa2f3('0x22')](_0x1d2c84);}return _0x2f0842[_0xa2f3('0x23')]();};}function saveUpdates(_0x2c2444,_0x4f7285){return function(_0x1faca5){if(_0x1faca5){return _0x1faca5[_0xa2f3('0x24')](_0x2c2444)['then'](function(_0x3a9057){return _0x3a9057;});}return null;};}function removeEntity(_0x218326,_0x964bc5){return function(_0x5b0e36){if(_0x5b0e36){return _0x5b0e36[_0xa2f3('0x25')]()[_0xa2f3('0x26')](function(){_0x218326['status'](0xcc)[_0xa2f3('0x19')]();});}};}function handleEntityNotFound(_0x584135,_0x310456){return function(_0x4371ac){if(!_0x4371ac){_0x584135[_0xa2f3('0x17')](0x194);}return _0x4371ac;};}function handleError(_0x18bace,_0x13c950){_0x13c950=_0x13c950||0x1f4;return function(_0x116825){logger[_0xa2f3('0x27')](_0x116825['stack']);if(_0x116825[_0xa2f3('0x28')]){delete _0x116825['name'];}_0x18bace[_0xa2f3('0x18')](_0x13c950)[_0xa2f3('0x29')](_0x116825);};}exports[_0xa2f3('0x2a')]=function(_0x6b9f68,_0x1e2185){var _0xd8789d={},_0x5a07f5={},_0x198d30={'count':0x0,'rows':[]};var _0x1b4f38=_[_0xa2f3('0x2b')](db[_0xa2f3('0x2c')][_0xa2f3('0x2d')],function(_0x361f8d){return{'name':_0x361f8d[_0xa2f3('0x2e')],'type':_0x361f8d[_0xa2f3('0x2f')][_0xa2f3('0x30')]};});_0x5a07f5['model']=_[_0xa2f3('0x2b')](_0x1b4f38,_0xa2f3('0x28'));_0x5a07f5[_0xa2f3('0x31')]=_['keys'](_0x6b9f68[_0xa2f3('0x31')]);_0x5a07f5[_0xa2f3('0x32')]=_[_0xa2f3('0x33')](_0x5a07f5['model'],_0x5a07f5[_0xa2f3('0x31')]);_0xd8789d[_0xa2f3('0x34')]=_[_0xa2f3('0x33')](_0x5a07f5['model'],qs[_0xa2f3('0x35')](_0x6b9f68['query']['fields']));_0xd8789d[_0xa2f3('0x34')]=_0xd8789d[_0xa2f3('0x34')][_0xa2f3('0x36')]?_0xd8789d[_0xa2f3('0x34')]:_0x5a07f5['model'];if(!_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x37')](_0xa2f3('0x38'))){_0xd8789d[_0xa2f3('0x1d')]=qs[_0xa2f3('0x1d')](_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x1d')]);_0xd8789d[_0xa2f3('0x1b')]=qs['offset'](_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x1b')]);}_0xd8789d[_0xa2f3('0x39')]=qs['sort'](_0x6b9f68['query'][_0xa2f3('0x3a')]);_0xd8789d[_0xa2f3('0x3b')]=qs['filters'](_[_0xa2f3('0x3c')](_0x6b9f68['query'],_0x5a07f5[_0xa2f3('0x32')]),_0x1b4f38);if(_0x6b9f68['query']['filter']){_0xd8789d[_0xa2f3('0x3b')]=_[_0xa2f3('0x3d')](_0xd8789d['where'],{'$or':_[_0xa2f3('0x2b')](_0x1b4f38,function(_0x51e710){if(_0x51e710[_0xa2f3('0x2f')]!==_0xa2f3('0x3e')){var _0x26a823={};_0x26a823[_0x51e710[_0xa2f3('0x28')]]={'$like':'%'+_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x3f')]+'%'};return _0x26a823;}})});}_0xd8789d=_[_0xa2f3('0x3d')]({},_0xd8789d,_0x6b9f68[_0xa2f3('0x40')]);var _0x12bde9={'where':_0xd8789d[_0xa2f3('0x3b')]};return db[_0xa2f3('0x2c')]['count'](_0x12bde9)[_0xa2f3('0x26')](function(_0x2984ac){_0x198d30[_0xa2f3('0x1e')]=_0x2984ac;if(_0x6b9f68[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0xd8789d[_0xa2f3('0x42')]=[{'all':!![]}];}return db[_0xa2f3('0x2c')][_0xa2f3('0x43')](_0xd8789d);})[_0xa2f3('0x26')](function(_0x246bc0){_0x198d30[_0xa2f3('0x44')]=_0x246bc0;return _0x198d30;})[_0xa2f3('0x26')](respondWithFilteredResult(_0x1e2185,_0xd8789d))[_0xa2f3('0x45')](handleError(_0x1e2185,null));};exports['show']=function(_0x12c715,_0xc823eb){var _0x2f7e3b={'raw':!![],'where':{'id':_0x12c715[_0xa2f3('0x46')]['id']}},_0x3d9f7d={};_0x3d9f7d['model']=_[_0xa2f3('0x47')](db[_0xa2f3('0x2c')][_0xa2f3('0x2d')]);_0x3d9f7d[_0xa2f3('0x31')]=_[_0xa2f3('0x47')](_0x12c715[_0xa2f3('0x31')]);_0x3d9f7d[_0xa2f3('0x32')]=_[_0xa2f3('0x33')](_0x3d9f7d['model'],_0x3d9f7d[_0xa2f3('0x31')]);_0x2f7e3b[_0xa2f3('0x34')]=_['intersection'](_0x3d9f7d[_0xa2f3('0x48')],qs[_0xa2f3('0x35')](_0x12c715[_0xa2f3('0x31')]['fields']));_0x2f7e3b[_0xa2f3('0x34')]=_0x2f7e3b[_0xa2f3('0x34')]['length']?_0x2f7e3b[_0xa2f3('0x34')]:_0x3d9f7d['model'];if(_0x12c715[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0x2f7e3b['include']=[{'all':!![]}];}_0x2f7e3b=_['merge']({},_0x2f7e3b,_0x12c715[_0xa2f3('0x40')]);return db[_0xa2f3('0x2c')][_0xa2f3('0x49')](_0x2f7e3b)['then'](handleEntityNotFound(_0xc823eb,null))['then'](respondWithResult(_0xc823eb,null))['catch'](handleError(_0xc823eb,null));};exports[_0xa2f3('0x4a')]=function(_0x47dad0,_0x5bd376){return db[_0xa2f3('0x2c')][_0xa2f3('0x4a')](_0x47dad0['body'],{})[_0xa2f3('0x26')](respondWithResult(_0x5bd376,0xc9))['catch'](handleError(_0x5bd376,null));};exports[_0xa2f3('0x24')]=function(_0x195767,_0x466d9f){if(_0x195767['body']['id']){delete _0x195767['body']['id'];}return db[_0xa2f3('0x2c')][_0xa2f3('0x49')]({'where':{'id':_0x195767[_0xa2f3('0x46')]['id']}})[_0xa2f3('0x26')](handleEntityNotFound(_0x466d9f,null))[_0xa2f3('0x26')](saveUpdates(_0x195767[_0xa2f3('0x4b')],null))[_0xa2f3('0x26')](respondWithResult(_0x466d9f,null))[_0xa2f3('0x45')](handleError(_0x466d9f,null));};exports[_0xa2f3('0x25')]=function(_0x460104,_0x4d638b){return db[_0xa2f3('0x2c')][_0xa2f3('0x49')]({'where':{'id':_0x460104[_0xa2f3('0x46')]['id']}})[_0xa2f3('0x26')](handleEntityNotFound(_0x4d638b,null))[_0xa2f3('0x26')](removeEntity(_0x4d638b,null))['catch'](handleError(_0x4d638b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 62f7c2f..952485a 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 _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x3e27ba,_0x46b120){var _0x10b3f2=function(_0x330316){while(--_0x330316){_0x3e27ba['push'](_0x3e27ba['shift']());}};_0x10b3f2(++_0x46b120);}(_0xb145,0xa3));var _0x5b14=function(_0x2d8627,_0x2ed604){_0x2d8627=_0x2d8627-0x0;var _0x278342=_0xb145[_0x2d8627];return _0x278342;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x205b46,_0x3ca65b){var _0x2b6ae8=function(_0x1f4ae9){while(--_0x1f4ae9){_0x205b46['push'](_0x205b46['shift']());}};_0x2b6ae8(++_0x3ca65b);}(_0x896e,0x1e9));var _0xe896=function(_0x8fcbd5,_0x26d50c){_0x8fcbd5=_0x8fcbd5-0x0;var _0xe8bd33=_0x896e[_0x8fcbd5];return _0xe8bd33;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[{'name':_0xe896('0xf'),'fields':['idField',_0xe896('0x10')],'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 0b0b4aa..95eaf6f 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 _0xf1ad=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x425ce7,_0x37a78d){var _0x1b3d5f=function(_0x28243d){while(--_0x28243d){_0x425ce7['push'](_0x425ce7['shift']());}};_0x1b3d5f(++_0x37a78d);}(_0xf1ad,0x158));var _0xdf1a=function(_0x25a386,_0x17fac2){_0x25a386=_0x25a386-0x0;var _0x4edaa6=_0xf1ad[_0x25a386];return _0x4edaa6;};'use strict';var _=require(_0xdf1a('0x0'));var util=require(_0xdf1a('0x1'));var moment=require(_0xdf1a('0x2'));var BPromise=require(_0xdf1a('0x3'));var rs=require(_0xdf1a('0x4'));var fs=require('fs');var Redis=require(_0xdf1a('0x5'));var db=require(_0xdf1a('0x6'))['db'];var utils=require(_0xdf1a('0x7'));var logger=require(_0xdf1a('0x8'))(_0xdf1a('0x9'));var config=require(_0xdf1a('0xa'));var jayson=require(_0xdf1a('0xb'));var client=jayson[_0xdf1a('0xc')][_0xdf1a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x242c87,_0x46e2ca,_0x4a913b){return new BPromise(function(_0xbc21e4,_0x27cced){return client[_0xdf1a('0xe')](_0x242c87,_0x4a913b)[_0xdf1a('0xf')](function(_0x23c89b){logger[_0xdf1a('0x10')](_0xdf1a('0x11'),_0x46e2ca,_0xdf1a('0x12'));logger['debug'](_0xdf1a('0x13'),_0x46e2ca,'request\x20sent',JSON['stringify'](_0x23c89b));if(_0x23c89b['error']){if(_0x23c89b[_0xdf1a('0x14')][_0xdf1a('0x15')]===0x1f4){logger[_0xdf1a('0x14')](_0xdf1a('0x11'),_0x46e2ca,_0x23c89b[_0xdf1a('0x14')]['message']);return _0x27cced(_0x23c89b[_0xdf1a('0x14')]['message']);}logger[_0xdf1a('0x14')]('ZohoField,\x20%s,\x20%s',_0x46e2ca,_0x23c89b[_0xdf1a('0x14')][_0xdf1a('0x16')]);return _0xbc21e4(_0x23c89b['error'][_0xdf1a('0x16')]);}else{logger[_0xdf1a('0x10')](_0xdf1a('0x11'),_0x46e2ca,_0xdf1a('0x12'));_0xbc21e4(_0x23c89b[_0xdf1a('0x17')][_0xdf1a('0x16')]);}})[_0xdf1a('0x18')](function(_0x5f4bbd){logger[_0xdf1a('0x14')](_0xdf1a('0x11'),_0x46e2ca,_0x5f4bbd);_0x27cced(_0x5f4bbd);});});} \ No newline at end of file +var _0x2010=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x2010,0xce));var _0x0201=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2010[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0201('0x0'));var util=require(_0x0201('0x1'));var moment=require(_0x0201('0x2'));var BPromise=require(_0x0201('0x3'));var rs=require(_0x0201('0x4'));var fs=require('fs');var Redis=require(_0x0201('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0201('0x6'));var logger=require(_0x0201('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0201('0x8'));var client=jayson[_0x0201('0x9')][_0x0201('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265931,_0x29fc99,_0x8be28f){return new BPromise(function(_0x3d6467,_0x3652c1){return client[_0x0201('0xb')](_0x265931,_0x8be28f)[_0x0201('0xc')](function(_0x5c022c){logger[_0x0201('0xd')]('ZohoField,\x20%s,\x20%s',_0x29fc99,_0x0201('0xe'));logger[_0x0201('0xf')](_0x0201('0x10'),_0x29fc99,_0x0201('0xe'),JSON['stringify'](_0x5c022c));if(_0x5c022c[_0x0201('0x11')]){if(_0x5c022c[_0x0201('0x11')][_0x0201('0x12')]===0x1f4){logger[_0x0201('0x11')](_0x0201('0x13'),_0x29fc99,_0x5c022c[_0x0201('0x11')][_0x0201('0x14')]);return _0x3652c1(_0x5c022c[_0x0201('0x11')][_0x0201('0x14')]);}logger[_0x0201('0x11')](_0x0201('0x13'),_0x29fc99,_0x5c022c['error'][_0x0201('0x14')]);return _0x3d6467(_0x5c022c[_0x0201('0x11')][_0x0201('0x14')]);}else{logger[_0x0201('0xd')]('ZohoField,\x20%s,\x20%s',_0x29fc99,_0x0201('0xe'));_0x3d6467(_0x5c022c[_0x0201('0x15')]['message']);}})['catch'](function(_0x30050d){logger[_0x0201('0x11')](_0x0201('0x13'),_0x29fc99,_0x30050d);_0x3652c1(_0x30050d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index e243423..87e68ec 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x540136,_0x2ee616){var _0x7b8ef2=function(_0x5c415b){while(--_0x5c415b){_0x540136['push'](_0x540136['shift']());}};_0x7b8ef2(++_0x2ee616);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xcb91[_0x48ec91];return _0x22766c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4662955..e763733 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 _0x400d=['INTEGER','BOOLEAN','exports','unique_name_and_version','STRING','app.js'];(function(_0x13c8a9,_0x4d834c){var _0x426f64=function(_0x32f811){while(--_0x32f811){_0x13c8a9['push'](_0x13c8a9['shift']());}};_0x426f64(++_0x4d834c);}(_0x400d,0x80));var _0xd400=function(_0x28d06c,_0xf80378){_0x28d06c=_0x28d06c-0x0;var _0x594317=_0x400d[_0x28d06c];return _0x594317;};'use strict';var Sequelize=require('sequelize');module[_0xd400('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd400('0x1')},'version':{'type':Sequelize[_0xd400('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xd400('0x2')],'defaultValue':_0xd400('0x3')},'filename':{'type':Sequelize[_0xd400('0x2')]},'path':{'type':Sequelize[_0xd400('0x2')]},'type':{'type':Sequelize[_0xd400('0x2')]},'size':{'type':Sequelize[_0xd400('0x4')]},'active':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xd400('0x2')]},'state':{'type':Sequelize[_0xd400('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd400('0x2')]},'title':{'type':Sequelize[_0xd400('0x2')]},'remoteUri':{'type':Sequelize[_0xd400('0x2')]},'link':{'type':Sequelize[_0xd400('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x2ad5=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x2ad5,0x8b));var _0x52ad=function(_0x443410,_0x16dfbc){_0x443410=_0x443410-0x0;var _0xd3d76d=_0x2ad5[_0x443410];return _0xd3d76d;};'use strict';var Sequelize=require('sequelize');module[_0x52ad('0x0')]={'name':{'type':Sequelize[_0x52ad('0x1')],'allowNull':![],'unique':_0x52ad('0x2')},'version':{'type':Sequelize[_0x52ad('0x1')],'allowNull':![],'unique':_0x52ad('0x2')},'main':{'type':Sequelize[_0x52ad('0x1')],'defaultValue':_0x52ad('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x52ad('0x1')]},'type':{'type':Sequelize[_0x52ad('0x1')]},'size':{'type':Sequelize[_0x52ad('0x4')]},'active':{'type':Sequelize[_0x52ad('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x52ad('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x52ad('0x1')],'unique':_0x52ad('0x6')},'description':{'type':Sequelize[_0x52ad('0x1')]},'title':{'type':Sequelize[_0x52ad('0x1')]},'remoteUri':{'type':Sequelize[_0x52ad('0x1')]},'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 f7fcdd6..65de995 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 _0xd117=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','Integration','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length'];(function(_0x1570a3,_0x32144e){var _0x5371e7=function(_0x379c45){while(--_0x379c45){_0x1570a3['push'](_0x1570a3['shift']());}};_0x5371e7(++_0x32144e);}(_0xd117,0x182));var _0x7d11=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xd117[_0x2b91c5];return _0xbd5531;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['Integration'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));}; \ No newline at end of file +var _0x430c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x434543,_0x2fd498){var _0x3e6749=function(_0x5956f7){while(--_0x5956f7){_0x434543['push'](_0x434543['shift']());}};_0x3e6749(++_0x2fd498);}(_0x430c,0x1a1));var _0xc430=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0x430c[_0x26721d];return _0x1035c5;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d740f14..59a3127 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 _0xba2f=['util','moment','../../config/environment','exports','define','Integration','integrations','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba2f,0xef));var _0xfba2=function(_0x529239,_0x20d56c){_0x529239=_0x529239-0x0;var _0xadd0c8=_0xba2f[_0x529239];return _0xadd0c8;};'use strict';var _=require(_0xfba2('0x0'));var util=require(_0xfba2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfba2('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(_0xfba2('0x3'));var attributes=require('./integration.attributes');module[_0xfba2('0x4')]=function(_0xecb7e2,_0x4ffd98){return _0xecb7e2[_0xfba2('0x5')](_0xfba2('0x6'),attributes,{'tableName':_0xfba2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf39f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','Integration','integrations'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0xf39f,0x104));var _0xff39=function(_0x2e3ba5,_0x133220){_0x2e3ba5=_0x2e3ba5-0x0;var _0x4c03f4=_0xf39f[_0x2e3ba5];return _0x4c03f4;};'use strict';var _=require(_0xff39('0x0'));var util=require(_0xff39('0x1'));var logger=require(_0xff39('0x2'))('api');var moment=require(_0xff39('0x3'));var BPromise=require(_0xff39('0x4'));var rp=require(_0xff39('0x5'));var fs=require('fs');var path=require(_0xff39('0x6'));var rimraf=require(_0xff39('0x7'));var config=require('../../config/environment');var attributes=require(_0xff39('0x8'));module[_0xff39('0x9')]=function(_0x47245d,_0x22958){return _0x47245d[_0xff39('0xa')](_0xff39('0xb'),attributes,{'tableName':_0xff39('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 8c8d14f..7891ca0 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x531a75,_0x47ee80){var _0x465a76=function(_0x1f2648){while(--_0x1f2648){_0x531a75['push'](_0x531a75['shift']());}};_0x465a76(++_0x47ee80);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3d5688,_0x57c0f0){_0x3d5688=_0x3d5688-0x0;var _0x38a999=_0x5f2f[_0x3d5688];return _0x38a999;};'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')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x26d17e,_0x606502){var _0x38578a=function(_0x28c53d){while(--_0x28c53d){_0x26d17e['push'](_0x26d17e['shift']());}};_0x38578a(++_0x606502);}(_0x66fa,0x117));var _0xa66f=function(_0x4da52b,_0x5ba3c5){_0x4da52b=_0x4da52b-0x0;var _0x160493=_0x66fa[_0x4da52b];return _0x160493;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index babbc7b..221e5d8 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 _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x2787b6,_0x286653){var _0x483b48=function(_0x8b4d4d){while(--_0x8b4d4d){_0x2787b6['push'](_0x2787b6['shift']());}};_0x483b48(++_0x286653);}(_0x1a85,0x178));var _0x51a8=function(_0x1afe3e,_0x4bf84a){_0x1afe3e=_0x1afe3e-0x0;var _0x25645f=_0x1a85[_0x1afe3e];return _0x25645f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5a4d4e,_0x399511){var _0x491b79=function(_0x12ef65){while(--_0x12ef65){_0x5a4d4e['push'](_0x5a4d4e['shift']());}};_0x491b79(++_0x399511);}(_0x57ca,0x108));var _0xa57c=function(_0x46e5f7,_0x2618c1){_0x46e5f7=_0x46e5f7-0x0;var _0x8f5b4f=_0x57ca[_0x46e5f7];return _0x8f5b4f;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 22e72c0..c676291 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 _0x4f03=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports'];(function(_0x3e9364,_0x4620e5){var _0xb837f1=function(_0x161062){while(--_0x161062){_0x3e9364['push'](_0x3e9364['shift']());}};_0xb837f1(++_0x4620e5);}(_0x4f03,0x174));var _0x34f0=function(_0x20c4a2,_0x83cf29){_0x20c4a2=_0x20c4a2-0x0;var _0x151d44=_0x4f03[_0x20c4a2];return _0x151d44;};'use strict';var Sequelize=require(_0x34f0('0x0'));module[_0x34f0('0x1')]={'integration':{'type':Sequelize[_0x34f0('0x2')]},'eventChannel':{'type':Sequelize[_0x34f0('0x2')]},'exitStatus':{'type':Sequelize[_0x34f0('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x34f0('0x3')]},'contacts':{'type':Sequelize[_0x34f0('0x2')]},'uniqueid':{'type':Sequelize[_0x34f0('0x2')]},'calleridnum':{'type':Sequelize[_0x34f0('0x2')]},'calleridname':{'type':Sequelize[_0x34f0('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x34f0('0x2')]},'agentcalledAt':{'type':Sequelize[_0x34f0('0x4')]},'agentconnectAt':{'type':Sequelize[_0x34f0('0x4')]},'holdtime':{'type':Sequelize[_0x34f0('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x34f0('0x4')]},'talktime':{'type':Sequelize[_0x34f0('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x34f0('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x34f0('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x34f0('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x34f0('0x2')]},'channel':{'type':Sequelize[_0x34f0('0x2')]},'channelstate':{'type':Sequelize[_0x34f0('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x34f0('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x34f0('0x2')]},'context':{'type':Sequelize[_0x34f0('0x2')]},'exten':{'type':Sequelize[_0x34f0('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x34f0('0x2')]},'destchannelstate':{'type':Sequelize[_0x34f0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x34f0('0x2')]},'destcalleridnum':{'type':Sequelize[_0x34f0('0x2')]},'destcalleridname':{'type':Sequelize[_0x34f0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x34f0('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x34f0('0x2')]},'destaccountcode':{'type':Sequelize[_0x34f0('0x2')]},'destcontext':{'type':Sequelize[_0x34f0('0x2')]},'destexten':{'type':Sequelize[_0x34f0('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x34f0('0x2')]},'messageId':{'type':Sequelize[_0x34f0('0x2')]},'inReplyTo':{'type':Sequelize[_0x34f0('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x34f0('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x34f0('0x2')]},'attachment':{'type':Sequelize[_0x34f0('0x6')]},'html':{'type':Sequelize[_0x34f0('0x6')]},'text':{'type':Sequelize[_0x34f0('0x6')]},'status':{'type':Sequelize[_0x34f0('0x7')](_0x34f0('0x8'),_0x34f0('0x9'),_0x34f0('0xa'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x34f0('0x2')]},'appdata':{'type':Sequelize[_0x34f0('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x52bf=['ENUM','SENT','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x8a19f,_0x4483f5){var _0x4e53b2=function(_0x4eec0c){while(--_0x4eec0c){_0x8a19f['push'](_0x8a19f['shift']());}};_0x4e53b2(++_0x4483f5);}(_0x52bf,0x143));var _0xf52b=function(_0x14224f,_0x45c123){_0x14224f=_0x14224f-0x0;var _0x1c7925=_0x52bf[_0x14224f];return _0x1c7925;};'use strict';var Sequelize=require(_0xf52b('0x0'));module[_0xf52b('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf52b('0x2')]},'exitStatus':{'type':Sequelize[_0xf52b('0x2')]},'ticketId':{'type':Sequelize[_0xf52b('0x2')]},'integrationId':{'type':Sequelize[_0xf52b('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf52b('0x2')]},'calleridname':{'type':Sequelize[_0xf52b('0x2')]},'queue':{'type':Sequelize[_0xf52b('0x2')]},'interface':{'type':Sequelize[_0xf52b('0x2')]},'membername':{'type':Sequelize[_0xf52b('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf52b('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf52b('0x4')]},'holdtime':{'type':Sequelize[_0xf52b('0x3')]},'agentcomplete':{'type':Sequelize[_0xf52b('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf52b('0x4')]},'talktime':{'type':Sequelize[_0xf52b('0x3')]},'agentacw':{'type':Sequelize[_0xf52b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf52b('0x3')]},'reason':{'type':Sequelize[_0xf52b('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf52b('0x4')]},'agentdump':{'type':Sequelize[_0xf52b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf52b('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf52b('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf52b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf52b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf52b('0x2')]},'priority':{'type':Sequelize[_0xf52b('0x2')]},'destchannel':{'type':Sequelize[_0xf52b('0x2')]},'destchannelstate':{'type':Sequelize[_0xf52b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf52b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf52b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf52b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf52b('0x2')]},'destlanguage':{'type':Sequelize[_0xf52b('0x2')]},'destaccountcode':{'type':Sequelize[_0xf52b('0x2')]},'destcontext':{'type':Sequelize[_0xf52b('0x2')]},'destexten':{'type':Sequelize[_0xf52b('0x2')]},'destpriority':{'type':Sequelize[_0xf52b('0x2')]},'destuniqueid':{'type':Sequelize[_0xf52b('0x2')]},'messageId':{'type':Sequelize[_0xf52b('0x2')]},'inReplyTo':{'type':Sequelize[_0xf52b('0x2')]},'subject':{'type':Sequelize[_0xf52b('0x2')]},'from':{'type':Sequelize[_0xf52b('0x2')]},'to':{'type':Sequelize[_0xf52b('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xf52b('0x6')]},'text':{'type':Sequelize[_0xf52b('0x6')]},'status':{'type':Sequelize[_0xf52b('0x7')](_0xf52b('0x8'),'SENDING','RECEIVED',_0xf52b('0x9'))},'url':{'type':Sequelize[_0xf52b('0x2')]},'app':{'type':Sequelize[_0xf52b('0x2')]},'appdata':{'type':Sequelize[_0xf52b('0x2')]},'projectId':{'type':Sequelize[_0xf52b('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index a3bf8f7..9e28d50 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 _0xf3ae=['status','end','json','undefined','limit','count','offset','Content-Range','reject','save','then','error','name','send','index','map','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','IntegrationReport','rawAttributes','include','options','find','create','body','update','destroy','describe','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3ae,0xc7));var _0xef3a=function(_0x569174,_0x4b8716){_0x569174=_0x569174-0x0;var _0x48ab32=_0xf3ae[_0x569174];return _0x48ab32;};'use strict';var emlformat=require(_0xef3a('0x0'));var rimraf=require(_0xef3a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xef3a('0x2'));var Mustache=require(_0xef3a('0x3'));var util=require(_0xef3a('0x4'));var path=require('path');var sox=require(_0xef3a('0x5'));var csv=require(_0xef3a('0x6'));var ejs=require(_0xef3a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef3a('0x8'));var squel=require('squel');var crypto=require(_0xef3a('0x9'));var jsforce=require(_0xef3a('0xa'));var deskjs=require(_0xef3a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xef3a('0xc'));var Papa=require('papaparse');var Redis=require(_0xef3a('0xd'));var authService=require(_0xef3a('0xe'));var qs=require(_0xef3a('0xf'));var as=require(_0xef3a('0x10'));var hardwareService=require(_0xef3a('0x11'));var logger=require(_0xef3a('0x12'))('api');var utils=require(_0xef3a('0x13'));var config=require(_0xef3a('0x14'));var licenseUtil=require(_0xef3a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4724de,_0x1f4c12){_0x1f4c12=_0x1f4c12||0xcc;return function(_0x4a0762){if(_0x4a0762){return _0x4724de[_0xef3a('0x16')](_0x1f4c12);}return _0x4724de[_0xef3a('0x17')](_0x1f4c12)[_0xef3a('0x18')]();};}function respondWithResult(_0x112429,_0x4a733f){_0x4a733f=_0x4a733f||0xc8;return function(_0x2f65f9){if(_0x2f65f9){return _0x112429[_0xef3a('0x17')](_0x4a733f)[_0xef3a('0x19')](_0x2f65f9);}};}function respondWithFilteredResult(_0x10ea6c,_0x4eb154){return function(_0x3bffd2){if(_0x3bffd2){var _0x50800a=typeof _0x4eb154['offset']===_0xef3a('0x1a')&&typeof _0x4eb154[_0xef3a('0x1b')]==='undefined';var _0x1b27ce=_0x3bffd2[_0xef3a('0x1c')];var _0x46cde0=_0x50800a?0x0:_0x4eb154[_0xef3a('0x1d')];var _0x21bda4=_0x50800a?_0x3bffd2[_0xef3a('0x1c')]:_0x4eb154[_0xef3a('0x1d')]+_0x4eb154[_0xef3a('0x1b')];var _0x1f5aaf;if(_0x21bda4>=_0x1b27ce){_0x21bda4=_0x1b27ce;_0x1f5aaf=0xc8;}else{_0x1f5aaf=0xce;}_0x10ea6c['status'](_0x1f5aaf);return _0x10ea6c['set'](_0xef3a('0x1e'),_0x46cde0+'-'+_0x21bda4+'/'+_0x1b27ce)[_0xef3a('0x19')](_0x3bffd2);}return null;};}function patchUpdates(_0x245736){return function(_0x2d7440){try{jsonpatch['apply'](_0x2d7440,_0x245736,!![]);}catch(_0x3a5560){return BPromise[_0xef3a('0x1f')](_0x3a5560);}return _0x2d7440[_0xef3a('0x20')]();};}function saveUpdates(_0x5fd583,_0x12dbed){return function(_0xcdaf56){if(_0xcdaf56){return _0xcdaf56['update'](_0x5fd583)[_0xef3a('0x21')](function(_0xbbbd72){return _0xbbbd72;});}return null;};}function removeEntity(_0x740950,_0x474a99){return function(_0x286ece){if(_0x286ece){return _0x286ece['destroy']()[_0xef3a('0x21')](function(){_0x740950['status'](0xcc)[_0xef3a('0x18')]();});}};}function handleEntityNotFound(_0x56d040,_0x168f4c){return function(_0x3e99ba){if(!_0x3e99ba){_0x56d040[_0xef3a('0x16')](0x194);}return _0x3e99ba;};}function handleError(_0x2029f0,_0x197502){_0x197502=_0x197502||0x1f4;return function(_0x3dacd9){logger[_0xef3a('0x22')](_0x3dacd9['stack']);if(_0x3dacd9[_0xef3a('0x23')]){delete _0x3dacd9[_0xef3a('0x23')];}_0x2029f0[_0xef3a('0x17')](_0x197502)[_0xef3a('0x24')](_0x3dacd9);};}exports[_0xef3a('0x25')]=function(_0x59c4db,_0x594134){var _0x317f56={},_0x7263b5={},_0x7835d={'count':0x0,'rows':[]};var _0x30c005=_[_0xef3a('0x26')](db['IntegrationReport']['rawAttributes'],function(_0x3112c9){return{'name':_0x3112c9['fieldName'],'type':_0x3112c9['type'][_0xef3a('0x27')]};});_0x7263b5[_0xef3a('0x28')]=_[_0xef3a('0x26')](_0x30c005,_0xef3a('0x23'));_0x7263b5['query']=_[_0xef3a('0x29')](_0x59c4db[_0xef3a('0x2a')]);_0x7263b5['filters']=_[_0xef3a('0x2b')](_0x7263b5['model'],_0x7263b5[_0xef3a('0x2a')]);_0x317f56[_0xef3a('0x2c')]=_['intersection'](_0x7263b5[_0xef3a('0x28')],qs[_0xef3a('0x2d')](_0x59c4db['query']['fields']));_0x317f56[_0xef3a('0x2c')]=_0x317f56[_0xef3a('0x2c')][_0xef3a('0x2e')]?_0x317f56[_0xef3a('0x2c')]:_0x7263b5[_0xef3a('0x28')];if(!_0x59c4db[_0xef3a('0x2a')][_0xef3a('0x2f')](_0xef3a('0x30'))){_0x317f56[_0xef3a('0x1b')]=qs['limit'](_0x59c4db[_0xef3a('0x2a')]['limit']);_0x317f56[_0xef3a('0x1d')]=qs[_0xef3a('0x1d')](_0x59c4db[_0xef3a('0x2a')][_0xef3a('0x1d')]);}_0x317f56[_0xef3a('0x31')]=qs['sort'](_0x59c4db['query'][_0xef3a('0x32')]);_0x317f56['where']=qs[_0xef3a('0x33')](_[_0xef3a('0x34')](_0x59c4db['query'],_0x7263b5[_0xef3a('0x33')]),_0x30c005);if(_0x59c4db[_0xef3a('0x2a')][_0xef3a('0x35')]){_0x317f56[_0xef3a('0x36')]=_[_0xef3a('0x37')](_0x317f56['where'],{'$or':_[_0xef3a('0x26')](_0x30c005,function(_0x5819d2){if(_0x5819d2[_0xef3a('0x38')]!==_0xef3a('0x39')){var _0x3feaa0={};_0x3feaa0[_0x5819d2[_0xef3a('0x23')]]={'$like':'%'+_0x59c4db[_0xef3a('0x2a')][_0xef3a('0x35')]+'%'};return _0x3feaa0;}})});}_0x317f56=_[_0xef3a('0x37')]({},_0x317f56,_0x59c4db['options']);var _0x55d5e5={'where':_0x317f56['where']};return db['IntegrationReport'][_0xef3a('0x1c')](_0x55d5e5)[_0xef3a('0x21')](function(_0x263352){_0x7835d[_0xef3a('0x1c')]=_0x263352;if(_0x59c4db['query'][_0xef3a('0x3a')]){_0x317f56['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xef3a('0x3b')](_0x317f56);})[_0xef3a('0x21')](function(_0x1773d){_0x7835d[_0xef3a('0x3c')]=_0x1773d;return _0x7835d;})['then'](respondWithFilteredResult(_0x594134,_0x317f56))[_0xef3a('0x3d')](handleError(_0x594134,null));};exports[_0xef3a('0x3e')]=function(_0x130364,_0x4b6b79){var _0x198eea={'raw':![],'where':{'id':_0x130364[_0xef3a('0x3f')]['id']}},_0x1ed397={};_0x1ed397['model']=_[_0xef3a('0x29')](db[_0xef3a('0x40')][_0xef3a('0x41')]);_0x1ed397[_0xef3a('0x2a')]=_[_0xef3a('0x29')](_0x130364[_0xef3a('0x2a')]);_0x1ed397[_0xef3a('0x33')]=_[_0xef3a('0x2b')](_0x1ed397[_0xef3a('0x28')],_0x1ed397[_0xef3a('0x2a')]);_0x198eea[_0xef3a('0x2c')]=_[_0xef3a('0x2b')](_0x1ed397[_0xef3a('0x28')],qs[_0xef3a('0x2d')](_0x130364[_0xef3a('0x2a')][_0xef3a('0x2d')]));_0x198eea[_0xef3a('0x2c')]=_0x198eea['attributes'][_0xef3a('0x2e')]?_0x198eea[_0xef3a('0x2c')]:_0x1ed397[_0xef3a('0x28')];if(_0x130364['query'][_0xef3a('0x3a')]){_0x198eea[_0xef3a('0x42')]=[{'all':!![]}];}_0x198eea=_['merge']({},_0x198eea,_0x130364[_0xef3a('0x43')]);return db[_0xef3a('0x40')][_0xef3a('0x44')](_0x198eea)[_0xef3a('0x21')](handleEntityNotFound(_0x4b6b79,null))['then'](respondWithResult(_0x4b6b79,null))[_0xef3a('0x3d')](handleError(_0x4b6b79,null));};exports[_0xef3a('0x45')]=function(_0x5a76a5,_0x4e4209){return db[_0xef3a('0x40')][_0xef3a('0x45')](_0x5a76a5[_0xef3a('0x46')],{})[_0xef3a('0x21')](respondWithResult(_0x4e4209,0xc9))[_0xef3a('0x3d')](handleError(_0x4e4209,null));};exports[_0xef3a('0x47')]=function(_0xa8e069,_0x36b012){if(_0xa8e069['body']['id']){delete _0xa8e069[_0xef3a('0x46')]['id'];}return db[_0xef3a('0x40')][_0xef3a('0x44')]({'where':{'id':_0xa8e069[_0xef3a('0x3f')]['id']}})[_0xef3a('0x21')](handleEntityNotFound(_0x36b012,null))[_0xef3a('0x21')](saveUpdates(_0xa8e069[_0xef3a('0x46')],null))[_0xef3a('0x21')](respondWithResult(_0x36b012,null))['catch'](handleError(_0x36b012,null));};exports[_0xef3a('0x48')]=function(_0xd7f223,_0x3f6921){return db[_0xef3a('0x40')][_0xef3a('0x44')]({'where':{'id':_0xd7f223['params']['id']}})[_0xef3a('0x21')](handleEntityNotFound(_0x3f6921,null))['then'](removeEntity(_0x3f6921,null))[_0xef3a('0x3d')](handleError(_0x3f6921,null));};exports[_0xef3a('0x49')]=function(_0x5ee2f8,_0x23b881){return db[_0xef3a('0x40')][_0xef3a('0x49')]()[_0xef3a('0x21')](respondWithResult(_0x23b881,null))['catch'](handleError(_0x23b881,null));}; \ No newline at end of file +var _0xd93d=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','key','model','query','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','options','IntegrationReport','then','include','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd93d,0x1d0));var _0xdd93=function(_0x571473,_0x334789){_0x571473=_0x571473-0x0;var _0x12722f=_0xd93d[_0x571473];return _0x12722f;};'use strict';var emlformat=require(_0xdd93('0x0'));var rimraf=require(_0xdd93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd93('0x2'));var rp=require('request-promise');var moment=require(_0xdd93('0x3'));var BPromise=require(_0xdd93('0x4'));var Mustache=require(_0xdd93('0x5'));var util=require(_0xdd93('0x6'));var path=require('path');var sox=require(_0xdd93('0x7'));var csv=require(_0xdd93('0x8'));var ejs=require(_0xdd93('0x9'));var fs=require('fs');var fs_extra=require(_0xdd93('0xa'));var _=require(_0xdd93('0xb'));var squel=require('squel');var crypto=require(_0xdd93('0xc'));var jsforce=require(_0xdd93('0xd'));var deskjs=require(_0xdd93('0xe'));var toCsv=require(_0xdd93('0x8'));var querystring=require(_0xdd93('0xf'));var Papa=require(_0xdd93('0x10'));var Redis=require('ioredis');var authService=require(_0xdd93('0x11'));var qs=require(_0xdd93('0x12'));var as=require(_0xdd93('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd93('0x14'))('api');var utils=require(_0xdd93('0x15'));var config=require(_0xdd93('0x16'));var licenseUtil=require(_0xdd93('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d7427,_0x688b0a){_0x688b0a=_0x688b0a||0xcc;return function(_0x1cadaa){if(_0x1cadaa){return _0x1d7427[_0xdd93('0x18')](_0x688b0a);}return _0x1d7427[_0xdd93('0x19')](_0x688b0a)['end']();};}function respondWithResult(_0x41f818,_0x400baf){_0x400baf=_0x400baf||0xc8;return function(_0x39e6cd){if(_0x39e6cd){return _0x41f818['status'](_0x400baf)[_0xdd93('0x1a')](_0x39e6cd);}};}function respondWithFilteredResult(_0x497585,_0x353349){return function(_0x4e8d39){if(_0x4e8d39){var _0x39c16a=typeof _0x353349['offset']===_0xdd93('0x1b')&&typeof _0x353349[_0xdd93('0x1c')]===_0xdd93('0x1b');var _0x504b4c=_0x4e8d39['count'];var _0x139921=_0x39c16a?0x0:_0x353349[_0xdd93('0x1d')];var _0x14e07f=_0x39c16a?_0x4e8d39[_0xdd93('0x1e')]:_0x353349['offset']+_0x353349[_0xdd93('0x1c')];var _0x39bc63;if(_0x14e07f>=_0x504b4c){_0x14e07f=_0x504b4c;_0x39bc63=0xc8;}else{_0x39bc63=0xce;}_0x497585[_0xdd93('0x19')](_0x39bc63);return _0x497585[_0xdd93('0x1f')]('Content-Range',_0x139921+'-'+_0x14e07f+'/'+_0x504b4c)[_0xdd93('0x1a')](_0x4e8d39);}return null;};}function patchUpdates(_0x3bb478){return function(_0x1971d6){try{jsonpatch[_0xdd93('0x20')](_0x1971d6,_0x3bb478,!![]);}catch(_0x54ef53){return BPromise[_0xdd93('0x21')](_0x54ef53);}return _0x1971d6[_0xdd93('0x22')]();};}function saveUpdates(_0x430c61,_0x3e6423){return function(_0x10b4c5){if(_0x10b4c5){return _0x10b4c5[_0xdd93('0x23')](_0x430c61)['then'](function(_0x140a6f){return _0x140a6f;});}return null;};}function removeEntity(_0x2a2076,_0x344f35){return function(_0x2506df){if(_0x2506df){return _0x2506df[_0xdd93('0x24')]()['then'](function(){_0x2a2076['status'](0xcc)[_0xdd93('0x25')]();});}};}function handleEntityNotFound(_0x562996,_0x16dc58){return function(_0x7ca5ab){if(!_0x7ca5ab){_0x562996[_0xdd93('0x18')](0x194);}return _0x7ca5ab;};}function handleError(_0x4ca7a8,_0x345b84){_0x345b84=_0x345b84||0x1f4;return function(_0x30f647){logger['error'](_0x30f647[_0xdd93('0x26')]);if(_0x30f647[_0xdd93('0x27')]){delete _0x30f647[_0xdd93('0x27')];}_0x4ca7a8[_0xdd93('0x19')](_0x345b84)[_0xdd93('0x28')](_0x30f647);};}exports[_0xdd93('0x29')]=function(_0x3e6f6f,_0x3306f7){var _0x171f57={},_0x2c2640={},_0x138149={'count':0x0,'rows':[]};var _0x25c14d=_[_0xdd93('0x2a')](db['IntegrationReport'][_0xdd93('0x2b')],function(_0x56760f){return{'name':_0x56760f['fieldName'],'type':_0x56760f['type'][_0xdd93('0x2c')]};});_0x2c2640[_0xdd93('0x2d')]=_[_0xdd93('0x2a')](_0x25c14d,_0xdd93('0x27'));_0x2c2640['query']=_['keys'](_0x3e6f6f[_0xdd93('0x2e')]);_0x2c2640['filters']=_[_0xdd93('0x2f')](_0x2c2640[_0xdd93('0x2d')],_0x2c2640[_0xdd93('0x2e')]);_0x171f57['attributes']=_[_0xdd93('0x2f')](_0x2c2640[_0xdd93('0x2d')],qs[_0xdd93('0x30')](_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x30')]));_0x171f57[_0xdd93('0x31')]=_0x171f57[_0xdd93('0x31')][_0xdd93('0x32')]?_0x171f57['attributes']:_0x2c2640[_0xdd93('0x2d')];if(!_0x3e6f6f[_0xdd93('0x2e')]['hasOwnProperty']('nolimit')){_0x171f57[_0xdd93('0x1c')]=qs[_0xdd93('0x1c')](_0x3e6f6f['query'][_0xdd93('0x1c')]);_0x171f57[_0xdd93('0x1d')]=qs[_0xdd93('0x1d')](_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x1d')]);}_0x171f57['order']=qs[_0xdd93('0x33')](_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x33')]);_0x171f57[_0xdd93('0x34')]=qs[_0xdd93('0x35')](_[_0xdd93('0x36')](_0x3e6f6f[_0xdd93('0x2e')],_0x2c2640['filters']),_0x25c14d);if(_0x3e6f6f['query'][_0xdd93('0x37')]){_0x171f57[_0xdd93('0x34')]=_[_0xdd93('0x38')](_0x171f57[_0xdd93('0x34')],{'$or':_['map'](_0x25c14d,function(_0x4169dc){if(_0x4169dc['type']!=='VIRTUAL'){var _0x477df7={};_0x477df7[_0x4169dc['name']]={'$like':'%'+_0x3e6f6f[_0xdd93('0x2e')][_0xdd93('0x37')]+'%'};return _0x477df7;}})});}_0x171f57=_[_0xdd93('0x38')]({},_0x171f57,_0x3e6f6f[_0xdd93('0x39')]);var _0x3b0e6d={'where':_0x171f57[_0xdd93('0x34')]};return db[_0xdd93('0x3a')][_0xdd93('0x1e')](_0x3b0e6d)[_0xdd93('0x3b')](function(_0xd288cd){_0x138149['count']=_0xd288cd;if(_0x3e6f6f['query']['includeAll']){_0x171f57[_0xdd93('0x3c')]=[{'all':!![]}];}return db[_0xdd93('0x3a')]['findAll'](_0x171f57);})['then'](function(_0x78b089){_0x138149['rows']=_0x78b089;return _0x138149;})[_0xdd93('0x3b')](respondWithFilteredResult(_0x3306f7,_0x171f57))[_0xdd93('0x3d')](handleError(_0x3306f7,null));};exports[_0xdd93('0x3e')]=function(_0x2b183a,_0x260b77){var _0xbf8a28={'raw':![],'where':{'id':_0x2b183a[_0xdd93('0x3f')]['id']}},_0x4f8fd0={};_0x4f8fd0[_0xdd93('0x2d')]=_[_0xdd93('0x40')](db[_0xdd93('0x3a')][_0xdd93('0x2b')]);_0x4f8fd0[_0xdd93('0x2e')]=_['keys'](_0x2b183a[_0xdd93('0x2e')]);_0x4f8fd0['filters']=_[_0xdd93('0x2f')](_0x4f8fd0[_0xdd93('0x2d')],_0x4f8fd0[_0xdd93('0x2e')]);_0xbf8a28['attributes']=_[_0xdd93('0x2f')](_0x4f8fd0[_0xdd93('0x2d')],qs[_0xdd93('0x30')](_0x2b183a[_0xdd93('0x2e')][_0xdd93('0x30')]));_0xbf8a28[_0xdd93('0x31')]=_0xbf8a28[_0xdd93('0x31')]['length']?_0xbf8a28[_0xdd93('0x31')]:_0x4f8fd0[_0xdd93('0x2d')];if(_0x2b183a[_0xdd93('0x2e')]['includeAll']){_0xbf8a28[_0xdd93('0x3c')]=[{'all':!![]}];}_0xbf8a28=_[_0xdd93('0x38')]({},_0xbf8a28,_0x2b183a[_0xdd93('0x39')]);return db['IntegrationReport'][_0xdd93('0x41')](_0xbf8a28)['then'](handleEntityNotFound(_0x260b77,null))[_0xdd93('0x3b')](respondWithResult(_0x260b77,null))[_0xdd93('0x3d')](handleError(_0x260b77,null));};exports[_0xdd93('0x42')]=function(_0x25993e,_0x283791){return db[_0xdd93('0x3a')][_0xdd93('0x42')](_0x25993e[_0xdd93('0x43')],{})[_0xdd93('0x3b')](respondWithResult(_0x283791,0xc9))[_0xdd93('0x3d')](handleError(_0x283791,null));};exports[_0xdd93('0x23')]=function(_0x222ff5,_0x1bd6f6){if(_0x222ff5[_0xdd93('0x43')]['id']){delete _0x222ff5[_0xdd93('0x43')]['id'];}return db['IntegrationReport'][_0xdd93('0x41')]({'where':{'id':_0x222ff5[_0xdd93('0x3f')]['id']}})[_0xdd93('0x3b')](handleEntityNotFound(_0x1bd6f6,null))[_0xdd93('0x3b')](saveUpdates(_0x222ff5['body'],null))[_0xdd93('0x3b')](respondWithResult(_0x1bd6f6,null))[_0xdd93('0x3d')](handleError(_0x1bd6f6,null));};exports[_0xdd93('0x24')]=function(_0x91ce95,_0x6390c){return db[_0xdd93('0x3a')][_0xdd93('0x41')]({'where':{'id':_0x91ce95['params']['id']}})[_0xdd93('0x3b')](handleEntityNotFound(_0x6390c,null))[_0xdd93('0x3b')](removeEntity(_0x6390c,null))[_0xdd93('0x3d')](handleError(_0x6390c,null));};exports['describe']=function(_0x1bd6e0,_0x16a68b){return db[_0xdd93('0x3a')][_0xdd93('0x44')]()['then'](respondWithResult(_0x16a68b,null))['catch'](handleError(_0x16a68b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 849f263..3bffdce 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 _0xfa58=['../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x424f60,_0x5a137f){var _0x2d727b=function(_0x3da83b){while(--_0x3da83b){_0x424f60['push'](_0x424f60['shift']());}};_0x2d727b(++_0x5a137f);}(_0xfa58,0x170));var _0x8fa5=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xfa58[_0x561771];return _0x54d16e;};'use strict';var _=require(_0x8fa5('0x0'));var util=require('util');var logger=require(_0x8fa5('0x1'))('api');var moment=require(_0x8fa5('0x2'));var BPromise=require(_0x8fa5('0x3'));var rp=require(_0x8fa5('0x4'));var fs=require('fs');var path=require(_0x8fa5('0x5'));var rimraf=require('rimraf');var config=require(_0x8fa5('0x6'));var attributes=require(_0x8fa5('0x7'));module[_0x8fa5('0x8')]=function(_0x22c951,_0x2a58cd){return _0x22c951[_0x8fa5('0x9')]('IntegrationReport',attributes,{'tableName':_0x8fa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98f6=['report_integration','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x98f6,0x79));var _0x698f=function(_0x58df23,_0x3e9eb9){_0x58df23=_0x58df23-0x0;var _0x2fcd18=_0x98f6[_0x58df23];return _0x2fcd18;};'use strict';var _=require(_0x698f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x698f('0x1'));var moment=require(_0x698f('0x2'));var BPromise=require(_0x698f('0x3'));var rp=require(_0x698f('0x4'));var fs=require('fs');var path=require(_0x698f('0x5'));var rimraf=require('rimraf');var config=require(_0x698f('0x6'));var attributes=require(_0x698f('0x7'));module[_0x698f('0x8')]=function(_0xc57c24,_0x13fd0a){return _0xc57c24[_0x698f('0x9')](_0x698f('0xa'),attributes,{'tableName':_0x698f('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 206a5c6..18f8a0b 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xf210cd,_0x3f4f86){var _0x571220=function(_0x57e5a2){while(--_0x57e5a2){_0xf210cd['push'](_0xf210cd['shift']());}};_0x571220(++_0x3f4f86);}(_0x31f0,0xb7));var _0x031f=function(_0x542c91,_0x62b288){_0x542c91=_0x542c91-0x0;var _0x238c72=_0x31f0[_0x542c91];return _0x238c72;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x814b,0x1a2));var _0xb814=function(_0x4fd82a,_0x29d9d5){_0x4fd82a=_0x4fd82a-0x0;var _0x21d2a8=_0x814b[_0x4fd82a];return _0x21d2a8;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c5f63d5..8f2d793 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 _0x7a8d=['addIntervals','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many'];(function(_0x228357,_0x3bfd51){var _0x91eb=function(_0x20a586){while(--_0x20a586){_0x228357['push'](_0x228357['shift']());}};_0x91eb(++_0x3bfd51);}(_0x7a8d,0x185));var _0xd7a8=function(_0x58eec9,_0x340186){_0x58eec9=_0x58eec9-0x0;var _0x54f818=_0x7a8d[_0x58eec9];return _0x54f818;};'use strict';var multer=require(_0xd7a8('0x0'));var util=require(_0xd7a8('0x1'));var path=require(_0xd7a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xd7a8('0x3'));var router=express['Router']();var fs_extra=require(_0xd7a8('0x4'));var auth=require(_0xd7a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a8('0x6'));var controller=require(_0xd7a8('0x7'));router[_0xd7a8('0x8')]('/',auth[_0xd7a8('0x9')](),controller[_0xd7a8('0xa')]);router['get'](_0xd7a8('0xb'),auth[_0xd7a8('0x9')](),controller[_0xd7a8('0xc')]);router[_0xd7a8('0x8')](_0xd7a8('0xd'),auth[_0xd7a8('0x9')](),controller[_0xd7a8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd7a8('0xf')]);router[_0xd7a8('0x10')]('/:id/sub_intervals',auth[_0xd7a8('0x9')](),controller[_0xd7a8('0x11')]);router['post'](_0xd7a8('0x12'),auth[_0xd7a8('0x9')](),controller[_0xd7a8('0x13')]);router[_0xd7a8('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd7a8('0x15')](_0xd7a8('0xb'),auth[_0xd7a8('0x9')](),controller[_0xd7a8('0x16')]);module[_0xd7a8('0x17')]=router; \ No newline at end of file +var _0xcddd=['post','create','addInterval','/:id/sub_intervals/create_many','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','/:id/sub_intervals'];(function(_0x2e8795,_0x506198){var _0x1e258b=function(_0x39708d){while(--_0x39708d){_0x2e8795['push'](_0x2e8795['shift']());}};_0x1e258b(++_0x506198);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x22425b,_0x1ef674){_0x22425b=_0x22425b-0x0;var _0x4f7ded=_0xcddd[_0x22425b];return _0x4f7ded;};'use strict';var multer=require(_0xdcdd('0x0'));var util=require(_0xdcdd('0x1'));var path=require(_0xdcdd('0x2'));var timeout=require(_0xdcdd('0x3'));var express=require(_0xdcdd('0x4'));var router=express[_0xdcdd('0x5')]();var fs_extra=require(_0xdcdd('0x6'));var auth=require(_0xdcdd('0x7'));var interaction=require(_0xdcdd('0x8'));var config=require(_0xdcdd('0x9'));var controller=require(_0xdcdd('0xa'));router[_0xdcdd('0xb')]('/',auth['isAuthenticated'](),controller[_0xdcdd('0xc')]);router[_0xdcdd('0xb')]('/:id',auth[_0xdcdd('0xd')](),controller['show']);router[_0xdcdd('0xb')](_0xdcdd('0xe'),auth[_0xdcdd('0xd')](),controller['getIntervals']);router[_0xdcdd('0xf')]('/',auth['isAuthenticated'](),controller[_0xdcdd('0x10')]);router[_0xdcdd('0xf')]('/:id/sub_intervals',auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x11')]);router[_0xdcdd('0xf')](_0xdcdd('0x12'),auth['isAuthenticated'](),controller['addIntervals']);router[_0xdcdd('0x13')](_0xdcdd('0x14'),auth['isAuthenticated'](),controller[_0xdcdd('0x15')]);router[_0xdcdd('0x16')](_0xdcdd('0x14'),auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 3fb82fa..d59b5b2 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 _0x41bc=['STRING','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x41bc,0x1b1));var _0xc41b=function(_0x4228b1,_0x641417){_0x4228b1=_0x4228b1-0x0;var _0x48807e=_0x41bc[_0x4228b1];return _0x48807e;};'use strict';var Sequelize=require(_0xc41b('0x0'));module[_0xc41b('0x1')]={'name':{'type':Sequelize[_0xc41b('0x2')]},'description':{'type':Sequelize[_0xc41b('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x5be5=['sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5be5,0x10b));var _0x55be=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0x5be5[_0x284506];return _0x1e9ee5;};'use strict';var Sequelize=require(_0x55be('0x0'));module[_0x55be('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x55be('0x2')]},'interval':{'type':Sequelize[_0x55be('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 38db85d..4f129f8 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 _0x78e0=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','userProfileId','autoAssociation','params','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','index','map','Interval','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x3b4585,_0x16a9c2){var _0x551be9=function(_0x5cea93){while(--_0x5cea93){_0x3b4585['push'](_0x3b4585['shift']());}};_0x551be9(++_0x16a9c2);}(_0x78e0,0x12f));var _0x078e=function(_0x2776c0,_0x3bdc05){_0x2776c0=_0x2776c0-0x0;var _0x42b7b7=_0x78e0[_0x2776c0];return _0x42b7b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x078e('0x0'));var zipdir=require(_0x078e('0x1'));var jsonpatch=require(_0x078e('0x2'));var rp=require(_0x078e('0x3'));var moment=require(_0x078e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x078e('0x5'));var path=require('path');var sox=require(_0x078e('0x6'));var csv=require(_0x078e('0x7'));var ejs=require(_0x078e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x078e('0x9'));var squel=require(_0x078e('0xa'));var crypto=require(_0x078e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x078e('0xc'));var toCsv=require(_0x078e('0x7'));var querystring=require(_0x078e('0xd'));var Papa=require(_0x078e('0xe'));var Redis=require(_0x078e('0xf'));var authService=require(_0x078e('0x10'));var qs=require(_0x078e('0x11'));var as=require(_0x078e('0x12'));var hardwareService=require(_0x078e('0x13'));var logger=require(_0x078e('0x14'))(_0x078e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x078e('0x16'));var db=require(_0x078e('0x17'))['db'];var extensions=require(_0x078e('0x18'));function respondWithStatusCode(_0x50756c,_0x1ddddf){_0x1ddddf=_0x1ddddf||0xcc;return function(_0x7af2c0){if(_0x7af2c0){return _0x50756c[_0x078e('0x19')](_0x1ddddf);}return _0x50756c[_0x078e('0x1a')](_0x1ddddf)['end']();};}function respondWithResult(_0x373585,_0x56dde){_0x56dde=_0x56dde||0xc8;return function(_0x3714a1){if(_0x3714a1){return _0x373585['status'](_0x56dde)[_0x078e('0x1b')](_0x3714a1);}};}function respondWithFilteredResult(_0x198c4f,_0x56cbf9){return function(_0x5998f1){if(_0x5998f1){var _0x2ac48e=typeof _0x56cbf9[_0x078e('0x1c')]==='undefined'&&typeof _0x56cbf9['limit']==='undefined';var _0x327492=_0x5998f1[_0x078e('0x1d')];var _0x2f347b=_0x2ac48e?0x0:_0x56cbf9[_0x078e('0x1c')];var _0xea12c2=_0x2ac48e?_0x5998f1[_0x078e('0x1d')]:_0x56cbf9['offset']+_0x56cbf9['limit'];var _0x205c74;if(_0xea12c2>=_0x327492){_0xea12c2=_0x327492;_0x205c74=0xc8;}else{_0x205c74=0xce;}_0x198c4f[_0x078e('0x1a')](_0x205c74);return _0x198c4f[_0x078e('0x1e')](_0x078e('0x1f'),_0x2f347b+'-'+_0xea12c2+'/'+_0x327492)[_0x078e('0x1b')](_0x5998f1);}return null;};}function patchUpdates(_0x3f4270){return function(_0x493a6b){try{jsonpatch[_0x078e('0x20')](_0x493a6b,_0x3f4270,!![]);}catch(_0x4f788d){return BPromise[_0x078e('0x21')](_0x4f788d);}return _0x493a6b[_0x078e('0x22')]();};}function saveUpdates(_0x2c1d4c,_0x1ef076){return function(_0x46dc37){if(_0x46dc37){return _0x46dc37[_0x078e('0x23')](_0x2c1d4c)[_0x078e('0x24')](function(_0x4ca5aa){return _0x4ca5aa;});}return null;};}function removeEntity(_0x19effd,_0x144733){return function(_0x344990){if(_0x344990){return _0x344990[_0x078e('0x25')]()[_0x078e('0x24')](function(){var _0xb8aa0a=_0x344990['get']({'plain':!![]});var _0x4faa10='Intervals';return db[_0x078e('0x26')][_0x078e('0x25')]({'where':{'type':_0x4faa10,'resourceId':_0xb8aa0a['id']}})[_0x078e('0x24')](function(){return _0x344990;});})[_0x078e('0x24')](function(){_0x19effd['status'](0xcc)[_0x078e('0x27')]();});}};}function handleEntityNotFound(_0x1fc7ff,_0x187915){return function(_0x2e1cf9){if(!_0x2e1cf9){_0x1fc7ff[_0x078e('0x19')](0x194);}return _0x2e1cf9;};}function handleError(_0x2975a4,_0x1314e0){_0x1314e0=_0x1314e0||0x1f4;return function(_0x31cc01){logger[_0x078e('0x28')](_0x31cc01[_0x078e('0x29')]);if(_0x31cc01[_0x078e('0x2a')]){delete _0x31cc01[_0x078e('0x2a')];}_0x2975a4[_0x078e('0x1a')](_0x1314e0)['send'](_0x31cc01);};}exports[_0x078e('0x2b')]=function(_0xe640ca,_0x46f434){var _0x3fd737={},_0x1467b1={},_0x5bf784={'count':0x0,'rows':[]};var _0x15936d=_[_0x078e('0x2c')](db[_0x078e('0x2d')]['rawAttributes'],function(_0x3def5b){return{'name':_0x3def5b[_0x078e('0x2e')],'type':_0x3def5b[_0x078e('0x2f')][_0x078e('0x30')]};});_0x1467b1[_0x078e('0x31')]=_['map'](_0x15936d,_0x078e('0x2a'));_0x1467b1[_0x078e('0x32')]=_[_0x078e('0x33')](_0xe640ca[_0x078e('0x32')]);_0x1467b1[_0x078e('0x34')]=_['intersection'](_0x1467b1[_0x078e('0x31')],_0x1467b1[_0x078e('0x32')]);_0x3fd737[_0x078e('0x35')]=_[_0x078e('0x36')](_0x1467b1[_0x078e('0x31')],qs[_0x078e('0x37')](_0xe640ca[_0x078e('0x32')]['fields']));_0x3fd737[_0x078e('0x35')]=_0x3fd737[_0x078e('0x35')][_0x078e('0x38')]?_0x3fd737['attributes']:_0x1467b1[_0x078e('0x31')];if(!_0xe640ca[_0x078e('0x32')][_0x078e('0x39')](_0x078e('0x3a'))){_0x3fd737[_0x078e('0x3b')]=qs['limit'](_0xe640ca[_0x078e('0x32')][_0x078e('0x3b')]);_0x3fd737[_0x078e('0x1c')]=qs[_0x078e('0x1c')](_0xe640ca[_0x078e('0x32')][_0x078e('0x1c')]);}_0x3fd737[_0x078e('0x3c')]=qs[_0x078e('0x3d')](_0xe640ca[_0x078e('0x32')][_0x078e('0x3d')]);_0x3fd737[_0x078e('0x3e')]=qs['filters'](_[_0x078e('0x3f')](_0xe640ca[_0x078e('0x32')],_0x1467b1[_0x078e('0x34')]),_0x15936d);if(_0xe640ca[_0x078e('0x32')][_0x078e('0x40')]){_0x3fd737[_0x078e('0x3e')]=_[_0x078e('0x41')](_0x3fd737['where'],{'$or':_['map'](_0x15936d,function(_0x14338a){if(_0x14338a[_0x078e('0x2f')]!==_0x078e('0x42')){var _0x1712d6={};_0x1712d6[_0x14338a[_0x078e('0x2a')]]={'$like':'%'+_0xe640ca['query'][_0x078e('0x40')]+'%'};return _0x1712d6;}})});}_0x3fd737=_[_0x078e('0x41')]({},_0x3fd737,_0xe640ca[_0x078e('0x43')]);var _0x232a5f={'where':_0x3fd737[_0x078e('0x3e')]};return db[_0x078e('0x2d')]['count'](_0x232a5f)[_0x078e('0x24')](function(_0x2c658c){_0x5bf784[_0x078e('0x1d')]=_0x2c658c;if(_0xe640ca[_0x078e('0x32')][_0x078e('0x44')]){_0x3fd737['include']=[{'all':!![]}];}return db[_0x078e('0x2d')][_0x078e('0x45')](_0x3fd737);})[_0x078e('0x24')](function(_0x1e6ccd){_0x5bf784[_0x078e('0x46')]=_0x1e6ccd;return _0x5bf784;})[_0x078e('0x24')](respondWithFilteredResult(_0x46f434,_0x3fd737))['catch'](handleError(_0x46f434,null));};exports[_0x078e('0x47')]=function(_0x4cd729,_0x1bb03e){var _0x42014e={'raw':!![],'where':{'id':_0x4cd729['params']['id']}},_0x2f0a02={};_0x2f0a02[_0x078e('0x31')]=_[_0x078e('0x33')](db['Interval']['rawAttributes']);_0x2f0a02[_0x078e('0x32')]=_[_0x078e('0x33')](_0x4cd729['query']);_0x2f0a02[_0x078e('0x34')]=_[_0x078e('0x36')](_0x2f0a02['model'],_0x2f0a02[_0x078e('0x32')]);_0x42014e[_0x078e('0x35')]=_['intersection'](_0x2f0a02['model'],qs[_0x078e('0x37')](_0x4cd729['query'][_0x078e('0x37')]));_0x42014e[_0x078e('0x35')]=_0x42014e[_0x078e('0x35')][_0x078e('0x38')]?_0x42014e[_0x078e('0x35')]:_0x2f0a02['model'];if(_0x4cd729[_0x078e('0x32')][_0x078e('0x44')]){_0x42014e['include']=[{'all':!![]}];}_0x42014e=_[_0x078e('0x41')]({},_0x42014e,_0x4cd729[_0x078e('0x43')]);return db[_0x078e('0x2d')][_0x078e('0x48')](_0x42014e)['then'](handleEntityNotFound(_0x1bb03e,null))[_0x078e('0x24')](respondWithResult(_0x1bb03e,null))[_0x078e('0x49')](handleError(_0x1bb03e,null));};exports['create']=function(_0x4bd4ed,_0x1fa263){return db['Interval'][_0x078e('0x4a')](_0x4bd4ed[_0x078e('0x4b')],{})[_0x078e('0x24')](function(_0x1ba902){var _0x3db4ef=_0x4bd4ed[_0x078e('0x4c')][_0x078e('0x4d')]({'plain':!![]});if(!_0x3db4ef)throw new Error(_0x078e('0x4e'));if(_0x3db4ef['role']===_0x078e('0x4c')){var _0x2be92c=_0x1ba902['get']({'plain':!![]});var _0x3f6e07=_0x078e('0x4f');return db['UserProfileSection'][_0x078e('0x48')]({'where':{'name':_0x3f6e07,'userProfileId':_0x3db4ef[_0x078e('0x50')]},'raw':!![]})[_0x078e('0x24')](function(_0x567055){if(_0x567055&&_0x567055[_0x078e('0x51')]===0x0){return db[_0x078e('0x26')][_0x078e('0x4a')]({'name':_0x2be92c[_0x078e('0x2a')],'resourceId':_0x2be92c['id'],'type':_0x567055[_0x078e('0x2a')],'sectionId':_0x567055['id']},{})[_0x078e('0x24')](function(){return _0x1ba902;});}else{return _0x1ba902;}})[_0x078e('0x49')](function(_0x36d212){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36d212);throw _0x36d212;});}return _0x1ba902;})[_0x078e('0x24')](respondWithResult(_0x1fa263,0xc9))[_0x078e('0x49')](handleError(_0x1fa263,null));};exports[_0x078e('0x23')]=function(_0x5b57c2,_0x41e752){if(_0x5b57c2['body']['id']){delete _0x5b57c2[_0x078e('0x4b')]['id'];}return db[_0x078e('0x2d')][_0x078e('0x48')]({'where':{'id':_0x5b57c2[_0x078e('0x52')]['id']}})[_0x078e('0x24')](handleEntityNotFound(_0x41e752,null))['then'](saveUpdates(_0x5b57c2[_0x078e('0x4b')],null))[_0x078e('0x24')](respondWithResult(_0x41e752,null))[_0x078e('0x49')](handleError(_0x41e752,null));};exports['destroy']=function(_0x4f948a,_0xc242e4){return db[_0x078e('0x2d')][_0x078e('0x48')]({'where':{'id':_0x4f948a[_0x078e('0x52')]['id']}})[_0x078e('0x24')](handleEntityNotFound(_0xc242e4,null))['then'](removeEntity(_0xc242e4,null))['catch'](handleError(_0xc242e4,null));};exports[_0x078e('0x53')]=function(_0x626604,_0x1e14b1,_0x2ec36c){if(_0x626604['body']['id']){delete _0x626604[_0x078e('0x4b')]['id'];}return db[_0x078e('0x2d')][_0x078e('0x48')]({'where':{'id':_0x626604[_0x078e('0x52')]['id']}})[_0x078e('0x24')](handleEntityNotFound(_0x1e14b1,null))[_0x078e('0x24')](function(_0x4b2601){if(_0x4b2601){_0x626604[_0x078e('0x4b')][_0x078e('0x54')]=_0x4b2601['id'];return db[_0x078e('0x2d')][_0x078e('0x4a')](_0x626604[_0x078e('0x4b')]);}})[_0x078e('0x24')](respondWithResult(_0x1e14b1,null))['catch'](handleError(_0x1e14b1,null));};exports['getIntervals']=function(_0x3707ee,_0x11d9f2,_0x2c239d){var _0x3b2c96={};var _0x41b3a4={};var _0x2c465e;var _0x97e854;return db[_0x078e('0x2d')][_0x078e('0x55')]({'where':{'id':_0x3707ee['params']['id']}})[_0x078e('0x24')](handleEntityNotFound(_0x11d9f2,null))[_0x078e('0x24')](function(_0x1d5d92){if(_0x1d5d92){_0x2c465e=_0x1d5d92;_0x41b3a4[_0x078e('0x31')]=_['keys'](db['Interval']['rawAttributes']);_0x41b3a4[_0x078e('0x32')]=_['keys'](_0x3707ee[_0x078e('0x32')]);_0x41b3a4[_0x078e('0x34')]=_[_0x078e('0x36')](_0x41b3a4[_0x078e('0x31')],_0x41b3a4['query']);_0x3b2c96[_0x078e('0x35')]=_['intersection'](_0x41b3a4[_0x078e('0x31')],qs[_0x078e('0x37')](_0x3707ee[_0x078e('0x32')][_0x078e('0x37')]));_0x3b2c96['attributes']=_0x3b2c96[_0x078e('0x35')][_0x078e('0x38')]?_0x3b2c96[_0x078e('0x35')]:_0x41b3a4['model'];_0x3b2c96[_0x078e('0x3c')]=qs[_0x078e('0x3d')](_0x3707ee['query'][_0x078e('0x3d')]);_0x3b2c96['where']=qs[_0x078e('0x34')](_['pick'](_0x3707ee['query'],_0x41b3a4[_0x078e('0x34')]));if(_0x3707ee[_0x078e('0x32')][_0x078e('0x40')]){_0x3b2c96[_0x078e('0x3e')]=_[_0x078e('0x41')](_0x3b2c96[_0x078e('0x3e')],{'$or':_[_0x078e('0x2c')](_0x3b2c96['attributes'],function(_0x41efef){var _0x5c6957={};_0x5c6957[_0x41efef]={'$like':'%'+_0x3707ee[_0x078e('0x32')][_0x078e('0x40')]+'%'};return _0x5c6957;})});}_0x3b2c96=_['merge']({},_0x3b2c96,_0x3707ee[_0x078e('0x43')]);return _0x2c465e[_0x078e('0x56')](_0x3b2c96);}})['then'](function(_0x471c43){if(_0x471c43){_0x97e854=_0x471c43[_0x078e('0x38')];if(!_0x3707ee[_0x078e('0x32')][_0x078e('0x39')](_0x078e('0x3a'))){_0x3b2c96[_0x078e('0x3b')]=qs['limit'](_0x3707ee[_0x078e('0x32')][_0x078e('0x3b')]);_0x3b2c96[_0x078e('0x1c')]=qs[_0x078e('0x1c')](_0x3707ee[_0x078e('0x32')][_0x078e('0x1c')]);}return _0x2c465e['getIntervals'](_0x3b2c96);}})[_0x078e('0x24')](function(_0x44f2f1){if(_0x44f2f1){return _0x44f2f1?{'count':_0x97e854,'rows':_0x44f2f1}:null;}})[_0x078e('0x24')](respondWithResult(_0x11d9f2,null))[_0x078e('0x49')](handleError(_0x11d9f2,null));};exports[_0x078e('0x57')]=function(_0x4cc0b8,_0x27799a,_0x242c94){return db[_0x078e('0x2d')][_0x078e('0x55')]({'where':{'id':_0x4cc0b8[_0x078e('0x52')]['id']}})[_0x078e('0x24')](handleEntityNotFound(_0x27799a,null))[_0x078e('0x24')](function(_0x49e048){if(_0x49e048){return db[_0x078e('0x58')][_0x078e('0x59')](function(_0x138e8a){return db[_0x078e('0x2d')][_0x078e('0x25')]({'where':{'IntervalId':_0x4cc0b8['params']['id']},'transaction':_0x138e8a})[_0x078e('0x24')](function(_0x1ab33d){var _0x258548=_['map'](_0x4cc0b8['body'],function(_0x37bd22){delete _0x37bd22['id'];_0x37bd22[_0x078e('0x54')]=_0x4cc0b8[_0x078e('0x52')]['id'];return _0x37bd22;});return db[_0x078e('0x2d')][_0x078e('0x5a')](_0x258548,{'transaction':_0x138e8a});});})[_0x078e('0x24')](function(){return db[_0x078e('0x2d')][_0x078e('0x45')]({'where':{'IntervalId':_0x4cc0b8[_0x078e('0x52')]['id']}});});}})[_0x078e('0x24')](respondWithResult(_0x27799a,null))[_0x078e('0x49')](handleError(_0x27799a,null));}; \ No newline at end of file +var _0x0210=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x0210,0xa9));var _0x0021=function(_0x52bb0c,_0x26a464){_0x52bb0c=_0x52bb0c-0x0;var _0x40a7ee=_0x0210[_0x52bb0c];return _0x40a7ee;};'use strict';var emlformat=require(_0x0021('0x0'));var rimraf=require(_0x0021('0x1'));var zipdir=require(_0x0021('0x2'));var jsonpatch=require(_0x0021('0x3'));var rp=require(_0x0021('0x4'));var moment=require(_0x0021('0x5'));var BPromise=require(_0x0021('0x6'));var Mustache=require(_0x0021('0x7'));var util=require(_0x0021('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0021('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0021('0xa'));var _=require('lodash');var squel=require(_0x0021('0xb'));var crypto=require(_0x0021('0xc'));var jsforce=require(_0x0021('0xd'));var deskjs=require(_0x0021('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0021('0xf'));var Papa=require(_0x0021('0x10'));var Redis=require(_0x0021('0x11'));var authService=require(_0x0021('0x12'));var qs=require(_0x0021('0x13'));var as=require(_0x0021('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0021('0x15'))(_0x0021('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0021('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x50b061,_0x3da42c){_0x3da42c=_0x3da42c||0xcc;return function(_0x26748a){if(_0x26748a){return _0x50b061[_0x0021('0x18')](_0x3da42c);}return _0x50b061[_0x0021('0x19')](_0x3da42c)[_0x0021('0x1a')]();};}function respondWithResult(_0x25f155,_0x4f2059){_0x4f2059=_0x4f2059||0xc8;return function(_0x3245e7){if(_0x3245e7){return _0x25f155[_0x0021('0x19')](_0x4f2059)['json'](_0x3245e7);}};}function respondWithFilteredResult(_0x63ca17,_0x58e815){return function(_0x529ce3){if(_0x529ce3){var _0x44d3d9=typeof _0x58e815[_0x0021('0x1b')]===_0x0021('0x1c')&&typeof _0x58e815[_0x0021('0x1d')]===_0x0021('0x1c');var _0x2d7247=_0x529ce3[_0x0021('0x1e')];var _0x2f8775=_0x44d3d9?0x0:_0x58e815[_0x0021('0x1b')];var _0x4c389a=_0x44d3d9?_0x529ce3[_0x0021('0x1e')]:_0x58e815[_0x0021('0x1b')]+_0x58e815['limit'];var _0x3541fc;if(_0x4c389a>=_0x2d7247){_0x4c389a=_0x2d7247;_0x3541fc=0xc8;}else{_0x3541fc=0xce;}_0x63ca17['status'](_0x3541fc);return _0x63ca17[_0x0021('0x1f')](_0x0021('0x20'),_0x2f8775+'-'+_0x4c389a+'/'+_0x2d7247)[_0x0021('0x21')](_0x529ce3);}return null;};}function patchUpdates(_0x2a99aa){return function(_0x48a6f2){try{jsonpatch[_0x0021('0x22')](_0x48a6f2,_0x2a99aa,!![]);}catch(_0xdc4943){return BPromise[_0x0021('0x23')](_0xdc4943);}return _0x48a6f2[_0x0021('0x24')]();};}function saveUpdates(_0x2c01a0,_0x4fa6b1){return function(_0x1e4161){if(_0x1e4161){return _0x1e4161[_0x0021('0x25')](_0x2c01a0)[_0x0021('0x26')](function(_0x515ae3){return _0x515ae3;});}return null;};}function removeEntity(_0x164795,_0x3643b9){return function(_0x37cd07){if(_0x37cd07){return _0x37cd07[_0x0021('0x27')]()[_0x0021('0x26')](function(){var _0x58a381=_0x37cd07[_0x0021('0x28')]({'plain':!![]});var _0x1a0a21=_0x0021('0x29');return db[_0x0021('0x2a')]['destroy']({'where':{'type':_0x1a0a21,'resourceId':_0x58a381['id']}})[_0x0021('0x26')](function(){return _0x37cd07;});})['then'](function(){_0x164795[_0x0021('0x19')](0xcc)[_0x0021('0x1a')]();});}};}function handleEntityNotFound(_0x50040b,_0x5c4313){return function(_0x5f4328){if(!_0x5f4328){_0x50040b[_0x0021('0x18')](0x194);}return _0x5f4328;};}function handleError(_0x124c45,_0x1e67db){_0x1e67db=_0x1e67db||0x1f4;return function(_0x24441e){logger['error'](_0x24441e[_0x0021('0x2b')]);if(_0x24441e[_0x0021('0x2c')]){delete _0x24441e['name'];}_0x124c45[_0x0021('0x19')](_0x1e67db)[_0x0021('0x2d')](_0x24441e);};}exports[_0x0021('0x2e')]=function(_0x27a43a,_0x1e9f3a){var _0xc5b85b={},_0x5331cf={},_0x41b512={'count':0x0,'rows':[]};var _0x4ecb7a=_['map'](db[_0x0021('0x2f')][_0x0021('0x30')],function(_0x3e867b){return{'name':_0x3e867b[_0x0021('0x31')],'type':_0x3e867b[_0x0021('0x32')][_0x0021('0x33')]};});_0x5331cf[_0x0021('0x34')]=_[_0x0021('0x35')](_0x4ecb7a,_0x0021('0x2c'));_0x5331cf[_0x0021('0x36')]=_[_0x0021('0x37')](_0x27a43a[_0x0021('0x36')]);_0x5331cf['filters']=_[_0x0021('0x38')](_0x5331cf[_0x0021('0x34')],_0x5331cf[_0x0021('0x36')]);_0xc5b85b[_0x0021('0x39')]=_['intersection'](_0x5331cf[_0x0021('0x34')],qs[_0x0021('0x3a')](_0x27a43a[_0x0021('0x36')]['fields']));_0xc5b85b['attributes']=_0xc5b85b[_0x0021('0x39')][_0x0021('0x3b')]?_0xc5b85b[_0x0021('0x39')]:_0x5331cf[_0x0021('0x34')];if(!_0x27a43a['query'][_0x0021('0x3c')](_0x0021('0x3d'))){_0xc5b85b[_0x0021('0x1d')]=qs[_0x0021('0x1d')](_0x27a43a['query'][_0x0021('0x1d')]);_0xc5b85b[_0x0021('0x1b')]=qs[_0x0021('0x1b')](_0x27a43a[_0x0021('0x36')][_0x0021('0x1b')]);}_0xc5b85b[_0x0021('0x3e')]=qs['sort'](_0x27a43a[_0x0021('0x36')][_0x0021('0x3f')]);_0xc5b85b[_0x0021('0x40')]=qs['filters'](_[_0x0021('0x41')](_0x27a43a['query'],_0x5331cf[_0x0021('0x42')]),_0x4ecb7a);if(_0x27a43a[_0x0021('0x36')][_0x0021('0x43')]){_0xc5b85b[_0x0021('0x40')]=_[_0x0021('0x44')](_0xc5b85b['where'],{'$or':_['map'](_0x4ecb7a,function(_0x53e756){if(_0x53e756['type']!==_0x0021('0x45')){var _0x897bc={};_0x897bc[_0x53e756['name']]={'$like':'%'+_0x27a43a['query'][_0x0021('0x43')]+'%'};return _0x897bc;}})});}_0xc5b85b=_[_0x0021('0x44')]({},_0xc5b85b,_0x27a43a[_0x0021('0x46')]);var _0xf22674={'where':_0xc5b85b[_0x0021('0x40')]};return db[_0x0021('0x2f')][_0x0021('0x1e')](_0xf22674)['then'](function(_0x38a844){_0x41b512[_0x0021('0x1e')]=_0x38a844;if(_0x27a43a[_0x0021('0x36')][_0x0021('0x47')]){_0xc5b85b['include']=[{'all':!![]}];}return db[_0x0021('0x2f')]['findAll'](_0xc5b85b);})[_0x0021('0x26')](function(_0x31b2a2){_0x41b512['rows']=_0x31b2a2;return _0x41b512;})[_0x0021('0x26')](respondWithFilteredResult(_0x1e9f3a,_0xc5b85b))[_0x0021('0x48')](handleError(_0x1e9f3a,null));};exports[_0x0021('0x49')]=function(_0x4e75e4,_0x5b2811){var _0x83e1e7={'raw':!![],'where':{'id':_0x4e75e4[_0x0021('0x4a')]['id']}},_0x3195f9={};_0x3195f9[_0x0021('0x34')]=_[_0x0021('0x37')](db[_0x0021('0x2f')]['rawAttributes']);_0x3195f9[_0x0021('0x36')]=_[_0x0021('0x37')](_0x4e75e4[_0x0021('0x36')]);_0x3195f9[_0x0021('0x42')]=_[_0x0021('0x38')](_0x3195f9[_0x0021('0x34')],_0x3195f9['query']);_0x83e1e7['attributes']=_[_0x0021('0x38')](_0x3195f9[_0x0021('0x34')],qs[_0x0021('0x3a')](_0x4e75e4[_0x0021('0x36')][_0x0021('0x3a')]));_0x83e1e7[_0x0021('0x39')]=_0x83e1e7['attributes'][_0x0021('0x3b')]?_0x83e1e7[_0x0021('0x39')]:_0x3195f9[_0x0021('0x34')];if(_0x4e75e4[_0x0021('0x36')][_0x0021('0x47')]){_0x83e1e7[_0x0021('0x4b')]=[{'all':!![]}];}_0x83e1e7=_['merge']({},_0x83e1e7,_0x4e75e4[_0x0021('0x46')]);return db[_0x0021('0x2f')]['find'](_0x83e1e7)[_0x0021('0x26')](handleEntityNotFound(_0x5b2811,null))[_0x0021('0x26')](respondWithResult(_0x5b2811,null))['catch'](handleError(_0x5b2811,null));};exports[_0x0021('0x4c')]=function(_0x2808f9,_0x378fd9){return db[_0x0021('0x2f')][_0x0021('0x4c')](_0x2808f9[_0x0021('0x4d')],{})['then'](function(_0x4ad1f2){var _0x3194f9=_0x2808f9[_0x0021('0x4e')][_0x0021('0x28')]({'plain':!![]});if(!_0x3194f9)throw new Error(_0x0021('0x4f'));if(_0x3194f9[_0x0021('0x50')]===_0x0021('0x4e')){var _0x5712e7=_0x4ad1f2[_0x0021('0x28')]({'plain':!![]});var _0xd7d20c=_0x0021('0x29');return db[_0x0021('0x51')]['find']({'where':{'name':_0xd7d20c,'userProfileId':_0x3194f9[_0x0021('0x52')]},'raw':!![]})[_0x0021('0x26')](function(_0x301288){if(_0x301288&&_0x301288['autoAssociation']===0x0){return db[_0x0021('0x2a')][_0x0021('0x4c')]({'name':_0x5712e7[_0x0021('0x2c')],'resourceId':_0x5712e7['id'],'type':_0x301288[_0x0021('0x2c')],'sectionId':_0x301288['id']},{})[_0x0021('0x26')](function(){return _0x4ad1f2;});}else{return _0x4ad1f2;}})[_0x0021('0x48')](function(_0x49446d){logger['error'](_0x0021('0x53'),_0x49446d);throw _0x49446d;});}return _0x4ad1f2;})[_0x0021('0x26')](respondWithResult(_0x378fd9,0xc9))['catch'](handleError(_0x378fd9,null));};exports['update']=function(_0xf16ecc,_0x53576){if(_0xf16ecc['body']['id']){delete _0xf16ecc[_0x0021('0x4d')]['id'];}return db['Interval'][_0x0021('0x54')]({'where':{'id':_0xf16ecc[_0x0021('0x4a')]['id']}})[_0x0021('0x26')](handleEntityNotFound(_0x53576,null))[_0x0021('0x26')](saveUpdates(_0xf16ecc[_0x0021('0x4d')],null))[_0x0021('0x26')](respondWithResult(_0x53576,null))[_0x0021('0x48')](handleError(_0x53576,null));};exports[_0x0021('0x27')]=function(_0x52f69,_0x50c9f5){return db[_0x0021('0x2f')][_0x0021('0x54')]({'where':{'id':_0x52f69[_0x0021('0x4a')]['id']}})[_0x0021('0x26')](handleEntityNotFound(_0x50c9f5,null))['then'](removeEntity(_0x50c9f5,null))['catch'](handleError(_0x50c9f5,null));};exports[_0x0021('0x55')]=function(_0xa68178,_0x499fd1,_0x5ddf84){if(_0xa68178[_0x0021('0x4d')]['id']){delete _0xa68178['body']['id'];}return db[_0x0021('0x2f')][_0x0021('0x54')]({'where':{'id':_0xa68178[_0x0021('0x4a')]['id']}})['then'](handleEntityNotFound(_0x499fd1,null))[_0x0021('0x26')](function(_0x390f82){if(_0x390f82){_0xa68178[_0x0021('0x4d')][_0x0021('0x56')]=_0x390f82['id'];return db[_0x0021('0x2f')]['create'](_0xa68178[_0x0021('0x4d')]);}})[_0x0021('0x26')](respondWithResult(_0x499fd1,null))[_0x0021('0x48')](handleError(_0x499fd1,null));};exports[_0x0021('0x57')]=function(_0x51302c,_0x1dc48c,_0x5ef3b6){var _0xc03f1e={};var _0x145bb0={};var _0xb536e8;var _0x505951;return db[_0x0021('0x2f')]['findOne']({'where':{'id':_0x51302c[_0x0021('0x4a')]['id']}})[_0x0021('0x26')](handleEntityNotFound(_0x1dc48c,null))[_0x0021('0x26')](function(_0x5ec1b4){if(_0x5ec1b4){_0xb536e8=_0x5ec1b4;_0x145bb0[_0x0021('0x34')]=_[_0x0021('0x37')](db[_0x0021('0x2f')]['rawAttributes']);_0x145bb0[_0x0021('0x36')]=_[_0x0021('0x37')](_0x51302c[_0x0021('0x36')]);_0x145bb0[_0x0021('0x42')]=_[_0x0021('0x38')](_0x145bb0[_0x0021('0x34')],_0x145bb0['query']);_0xc03f1e[_0x0021('0x39')]=_[_0x0021('0x38')](_0x145bb0[_0x0021('0x34')],qs[_0x0021('0x3a')](_0x51302c['query'][_0x0021('0x3a')]));_0xc03f1e['attributes']=_0xc03f1e[_0x0021('0x39')][_0x0021('0x3b')]?_0xc03f1e[_0x0021('0x39')]:_0x145bb0[_0x0021('0x34')];_0xc03f1e[_0x0021('0x3e')]=qs[_0x0021('0x3f')](_0x51302c[_0x0021('0x36')][_0x0021('0x3f')]);_0xc03f1e['where']=qs['filters'](_[_0x0021('0x41')](_0x51302c[_0x0021('0x36')],_0x145bb0['filters']));if(_0x51302c['query'][_0x0021('0x43')]){_0xc03f1e[_0x0021('0x40')]=_[_0x0021('0x44')](_0xc03f1e[_0x0021('0x40')],{'$or':_[_0x0021('0x35')](_0xc03f1e['attributes'],function(_0x29c505){var _0x2c14e3={};_0x2c14e3[_0x29c505]={'$like':'%'+_0x51302c[_0x0021('0x36')][_0x0021('0x43')]+'%'};return _0x2c14e3;})});}_0xc03f1e=_[_0x0021('0x44')]({},_0xc03f1e,_0x51302c['options']);return _0xb536e8[_0x0021('0x57')](_0xc03f1e);}})[_0x0021('0x26')](function(_0x1059a5){if(_0x1059a5){_0x505951=_0x1059a5[_0x0021('0x3b')];if(!_0x51302c[_0x0021('0x36')]['hasOwnProperty'](_0x0021('0x3d'))){_0xc03f1e[_0x0021('0x1d')]=qs[_0x0021('0x1d')](_0x51302c[_0x0021('0x36')][_0x0021('0x1d')]);_0xc03f1e[_0x0021('0x1b')]=qs['offset'](_0x51302c[_0x0021('0x36')][_0x0021('0x1b')]);}return _0xb536e8['getIntervals'](_0xc03f1e);}})['then'](function(_0x26b3da){if(_0x26b3da){return _0x26b3da?{'count':_0x505951,'rows':_0x26b3da}:null;}})[_0x0021('0x26')](respondWithResult(_0x1dc48c,null))[_0x0021('0x48')](handleError(_0x1dc48c,null));};exports[_0x0021('0x58')]=function(_0x269eb1,_0x1380d6,_0x51f176){return db[_0x0021('0x2f')][_0x0021('0x59')]({'where':{'id':_0x269eb1[_0x0021('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1380d6,null))['then'](function(_0x353e52){if(_0x353e52){return db[_0x0021('0x5a')]['transaction'](function(_0x104e80){return db[_0x0021('0x2f')][_0x0021('0x27')]({'where':{'IntervalId':_0x269eb1[_0x0021('0x4a')]['id']},'transaction':_0x104e80})[_0x0021('0x26')](function(_0x5d216f){var _0x38fccd=_['map'](_0x269eb1[_0x0021('0x4d')],function(_0x46d6c5){delete _0x46d6c5['id'];_0x46d6c5[_0x0021('0x56')]=_0x269eb1[_0x0021('0x4a')]['id'];return _0x46d6c5;});return db[_0x0021('0x2f')]['bulkCreate'](_0x38fccd,{'transaction':_0x104e80});});})[_0x0021('0x26')](function(){return db[_0x0021('0x2f')][_0x0021('0x5b')]({'where':{'IntervalId':_0x269eb1[_0x0021('0x4a')]['id']}});});}})[_0x0021('0x26')](respondWithResult(_0x1380d6,null))['catch'](handleError(_0x1380d6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 2f9cded..6dc8926 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 _0x8921=['then','map','../../utils/iftime','iftime','define','tools_intervals','rewrite','interval','string','getIntervals'];(function(_0x35c36e,_0x48818d){var _0x98f067=function(_0x462cf3){while(--_0x462cf3){_0x35c36e['push'](_0x35c36e['shift']());}};_0x98f067(++_0x48818d);}(_0x8921,0x70));var _0x1892=function(_0x21dff0,_0x36f110){_0x21dff0=_0x21dff0-0x0;var _0x5db7bc=_0x8921[_0x21dff0];return _0x5db7bc;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x1892('0x0'))[_0x1892('0x1')];module['exports']=function(_0x604b01){return _0x604b01[_0x1892('0x2')]('Interval',attributes,{'tableName':_0x1892('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d6497){extensions[_0x1892('0x4')](_0x604b01,_0x2d6497);},'afterBulkCreate':function(_0x3f8386,_0xb73277,_0x529896){_0x529896();extensions[_0x1892('0x4')](_0x604b01,_0x3f8386[0x0]);},'afterUpdate':function(_0x4c798a){extensions['rewrite'](_0x604b01,_0x4c798a);},'afterDestroy':function(_0x248f9b){extensions[_0x1892('0x4')](_0x604b01,_0x248f9b);}},'instanceMethods':{'ifTime':function(_0x1e47b0=undefined,_0x4157eb=new Date()){if(typeof this[_0x1892('0x5')]===_0x1892('0x6')){return iftime(this[_0x1892('0x5')],_0x1e47b0,_0x4157eb);}else{return this[_0x1892('0x7')]()[_0x1892('0x8')](function(_0xf5eea6){return Promise['all'](_0xf5eea6[_0x1892('0x9')](function(_0x559ed2){return _0x559ed2['ifTime'](_0x1e47b0,_0x4157eb);}));})[_0x1892('0x8')](function(_0x5aac4e){return _0x5aac4e['reduce'](function(_0x45092e,_0x213e6a){return _0x45092e||_0x213e6a;},![]);});}}}});}; \ No newline at end of file +var _0x9fd4=['define','Interval','rewrite','interval','string','then','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','exports'];(function(_0xb5617b,_0x149dad){var _0x40b4bd=function(_0x277563){while(--_0x277563){_0xb5617b['push'](_0xb5617b['shift']());}};_0x40b4bd(++_0x149dad);}(_0x9fd4,0x1cb));var _0x49fd=function(_0x1d0f10,_0x4de9fb){_0x1d0f10=_0x1d0f10-0x0;var _0xa1dcaf=_0x9fd4[_0x1d0f10];return _0xa1dcaf;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x49fd('0x0'));var iftime=require(_0x49fd('0x1'))['iftime'];module[_0x49fd('0x2')]=function(_0x265f1a){return _0x265f1a[_0x49fd('0x3')](_0x49fd('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35b10f){extensions[_0x49fd('0x5')](_0x265f1a,_0x35b10f);},'afterBulkCreate':function(_0x4b9fd4,_0x26139f,_0xd4e78d){_0xd4e78d();extensions['rewrite'](_0x265f1a,_0x4b9fd4[0x0]);},'afterUpdate':function(_0x287e1f){extensions[_0x49fd('0x5')](_0x265f1a,_0x287e1f);},'afterDestroy':function(_0x250c06){extensions[_0x49fd('0x5')](_0x265f1a,_0x250c06);}},'instanceMethods':{'ifTime':function(_0x1a1921=undefined,_0x1bb6cb=new Date()){if(typeof this[_0x49fd('0x6')]===_0x49fd('0x7')){return iftime(this[_0x49fd('0x6')],_0x1a1921,_0x1bb6cb);}else{return this['getIntervals']()[_0x49fd('0x8')](function(_0x36354f){return Promise['all'](_0x36354f['map'](function(_0x178bfe){return _0x178bfe[_0x49fd('0x9')](_0x1a1921,_0x1bb6cb);}));})[_0x49fd('0x8')](function(_0x549c7e){return _0x549c7e[_0x49fd('0xa')](function(_0xe7f457,_0x5d549c){return _0xe7f457||_0x5d549c;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 50c2779..33c92fe 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 _0xef30=['debug','Interval','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','resolve','util','../../mysqldb','../../config/logger','rpc','GetInterval','findAll','options','where','attributes','limit','include','map','model','then','info','stringify','catch','error','message','find','ShowInterval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef30,0xe1));var _0x0ef3=function(_0x11a962,_0x3cc338){_0x11a962=_0x11a962-0x0;var _0x55d423=_0xef30[_0x11a962];return _0x55d423;};'use strict';var _=require('lodash');var util=require(_0x0ef3('0x0'));var db=require(_0x0ef3('0x1'))['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require(_0x0ef3('0x2'))(_0x0ef3('0x3'));exports[_0x0ef3('0x4')]=function(_0x563764){var _0x1ec27b=this;return new Promise(function(_0x510416,_0x3cbe92){return db['Interval'][_0x0ef3('0x5')]({'raw':_0x563764[_0x0ef3('0x6')]?_0x563764['options']['raw']===undefined?!![]:![]:!![],'where':_0x563764[_0x0ef3('0x6')]?_0x563764[_0x0ef3('0x6')][_0x0ef3('0x7')]||null:null,'attributes':_0x563764[_0x0ef3('0x6')]?_0x563764[_0x0ef3('0x6')][_0x0ef3('0x8')]||null:null,'limit':_0x563764[_0x0ef3('0x6')]?_0x563764['options'][_0x0ef3('0x9')]||null:null,'include':_0x563764[_0x0ef3('0x6')]?_0x563764[_0x0ef3('0x6')][_0x0ef3('0xa')]?_[_0x0ef3('0xb')](_0x563764[_0x0ef3('0x6')][_0x0ef3('0xa')],function(_0xeb3854){return{'model':db[_0xeb3854[_0x0ef3('0xc')]],'as':_0xeb3854['as'],'attributes':_0xeb3854[_0x0ef3('0x8')],'include':_0xeb3854['include']?_['map'](_0xeb3854['include'],function(_0x51838c){return{'model':db[_0x51838c[_0x0ef3('0xc')]],'as':_0x51838c['as'],'attributes':_0x51838c[_0x0ef3('0x8')],'include':_0x51838c['include']?_['map'](_0x51838c[_0x0ef3('0xa')],function(_0x20caad){return{'model':db[_0x20caad[_0x0ef3('0xc')]],'as':_0x20caad['as'],'attributes':_0x20caad[_0x0ef3('0x8')]};}):[]};}):[]};}):[]:[]})[_0x0ef3('0xd')](function(_0xd4dc22){logger[_0x0ef3('0xe')]('GetInterval',_0x563764);logger['debug'](_0x0ef3('0x4'),_0x563764,JSON[_0x0ef3('0xf')](_0xd4dc22));_0x510416(_0xd4dc22);})[_0x0ef3('0x10')](function(_0x2b5cb6){logger[_0x0ef3('0x11')](_0x0ef3('0x4'),_0x2b5cb6[_0x0ef3('0x12')],_0x563764);_0x3cbe92(_0x1ec27b[_0x0ef3('0x11')](0x1f4,_0x2b5cb6['message']));});});};exports['ShowInterval']=function(_0x32add3){var _0x3aee17=this;return new Promise(function(_0x35750b,_0x376de5){return db['Interval'][_0x0ef3('0x13')]({'raw':_0x32add3['options']?_0x32add3[_0x0ef3('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x32add3[_0x0ef3('0x6')]?_0x32add3[_0x0ef3('0x6')][_0x0ef3('0x7')]||null:null,'attributes':_0x32add3['options']?_0x32add3['options'][_0x0ef3('0x8')]||null:null,'include':_0x32add3[_0x0ef3('0x6')]?_0x32add3[_0x0ef3('0x6')][_0x0ef3('0xa')]?_[_0x0ef3('0xb')](_0x32add3[_0x0ef3('0x6')][_0x0ef3('0xa')],function(_0x133146){return{'model':db[_0x133146[_0x0ef3('0xc')]],'as':_0x133146['as'],'attributes':_0x133146[_0x0ef3('0x8')],'include':_0x133146[_0x0ef3('0xa')]?_[_0x0ef3('0xb')](_0x133146[_0x0ef3('0xa')],function(_0x1f7590){return{'model':db[_0x1f7590[_0x0ef3('0xc')]],'as':_0x1f7590['as'],'attributes':_0x1f7590[_0x0ef3('0x8')],'include':_0x1f7590[_0x0ef3('0xa')]?_[_0x0ef3('0xb')](_0x1f7590[_0x0ef3('0xa')],function(_0x32ffca){return{'model':db[_0x32ffca[_0x0ef3('0xc')]],'as':_0x32ffca['as'],'attributes':_0x32ffca['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ef3('0xd')](function(_0x530cd1){logger[_0x0ef3('0xe')](_0x0ef3('0x14'),_0x32add3);logger[_0x0ef3('0x15')]('ShowInterval',_0x32add3,JSON[_0x0ef3('0xf')](_0x530cd1));_0x35750b(_0x530cd1);})['catch'](function(_0x405e47){logger[_0x0ef3('0x11')](_0x0ef3('0x14'),_0x405e47[_0x0ef3('0x12')],_0x32add3);_0x376de5(_0x3aee17['error'](0x1f4,_0x405e47[_0x0ef3('0x12')]));});});};function checkArrayOfIntervals(_0x23caa9,_0x4951d9){var _0x518d41=[];return db[_0x0ef3('0x16')][_0x0ef3('0x5')]({'where':{'id':_0x23caa9}})[_0x0ef3('0xd')](function(_0x4fbd1e){_0x518d41=_0x4fbd1e;return Promise['all'](_0x518d41[_0x0ef3('0xb')](function(_0xe23539){return _0xe23539['ifTime'](_0x4951d9);}));})[_0x0ef3('0xd')](function(_0x5be6aa){var _0x4192ef=_0x5be6aa[_0x0ef3('0x17')](function(_0x1f9f92,_0x39de5a){return _0x1f9f92||_0x39de5a;},![]);logger[_0x0ef3('0xe')](util[_0x0ef3('0x18')](_0x0ef3('0x19'),_0x518d41[_0x0ef3('0xb')](function(_0x1cc179){return _0x1cc179[_0x0ef3('0x1a')];})[_0x0ef3('0x1b')](',\x20'),_0x518d41[_0x0ef3('0xb')](function(_0x2dda12){return _0x2dda12['id'];})[_0x0ef3('0x1b')](',\x20')));return _0x4192ef;});}function checkSingleInterval(_0x3e6af6,_0x590389){return db[_0x0ef3('0x16')][_0x0ef3('0x1c')](_0x3e6af6)['then'](function(_0x1c08b3){if(_0x1c08b3){logger[_0x0ef3('0xe')](util[_0x0ef3('0x18')](_0x0ef3('0x1d'),_0x1c08b3[_0x0ef3('0x1a')],_0x1c08b3['id']));return _0x1c08b3['ifTime'](_0x590389);}});}exports[_0x0ef3('0x1e')]=function(_0x42416c){var _0x33e6eb=_0x42416c[_0x0ef3('0x1f')];var _0x3ae962=Array[_0x0ef3('0x20')](_0x42416c[_0x0ef3('0x21')])?_0x42416c['intervals']:typeof _0x42416c[_0x0ef3('0x21')]===_0x0ef3('0x22')?[_0x42416c['intervals']]:[];var _0x4a90f8=_0x42416c[_0x0ef3('0x23')]||undefined;var _0x30f6e5=![];if(_0x3ae962[_0x0ef3('0x24')]){logger[_0x0ef3('0xe')](util[_0x0ef3('0x18')](_0x0ef3('0x25'),_0x3ae962[_0x0ef3('0x1b')](';\x20')));}if(_0x4a90f8){logger[_0x0ef3('0xe')](util[_0x0ef3('0x18')](_0x0ef3('0x26'),_0x4a90f8));}logger[_0x0ef3('0x15')](_0x0ef3('0x27'),_0x30f6e5);logger['silly'](_0x0ef3('0x1e'),_0x42416c);return Promise[_0x0ef3('0x28')]()['then'](function(){if(Array['isArray'](_0x33e6eb)){return checkArrayOfIntervals(_0x33e6eb,_0x4a90f8);}else if(_0x33e6eb){return checkSingleInterval(_0x33e6eb,_0x4a90f8);}})['then'](function(_0x5a822b){var _0x4d3400=_0x3ae962[_0x0ef3('0x17')](function(_0x29ff5f,_0x1018d6){return _0x29ff5f||iftime(_0x1018d6,_0x4a90f8);},![]);_0x30f6e5=_0x5a822b||_0x4d3400;return _0x30f6e5;})[_0x0ef3('0x10')](function(_0x282398){logger[_0x0ef3('0x11')](_0x0ef3('0x1e'),_0x42416c,_0x282398);throw this[_0x0ef3('0x11')](0x1f4,_0x282398['message']);});}; \ No newline at end of file +var _0xe2a7=['iftime','rpc','GetInterval','Interval','raw','options','include','model','attributes','map','info','catch','error','message','find','then','debug','ShowInterval','stringify','findAll','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','format','ifTime','IntervalIftime','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','isArray','lodash','util','../../utils/iftime'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xe2a7,0x165));var _0x7e2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e2a('0x0'));var util=require(_0x7e2a('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x7e2a('0x2'))[_0x7e2a('0x3')];var logger=require('../../config/logger')(_0x7e2a('0x4'));exports[_0x7e2a('0x5')]=function(_0x2f21ac){var _0x1e237b=this;return new Promise(function(_0x44723f,_0x53987d){return db[_0x7e2a('0x6')]['findAll']({'raw':_0x2f21ac['options']?_0x2f21ac['options'][_0x7e2a('0x7')]===undefined?!![]:![]:!![],'where':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac[_0x7e2a('0x8')]['where']||null:null,'attributes':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac[_0x7e2a('0x8')]['attributes']||null:null,'limit':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac['options']['limit']||null:null,'include':_0x2f21ac[_0x7e2a('0x8')]?_0x2f21ac[_0x7e2a('0x8')][_0x7e2a('0x9')]?_['map'](_0x2f21ac[_0x7e2a('0x8')][_0x7e2a('0x9')],function(_0x4e480a){return{'model':db[_0x4e480a[_0x7e2a('0xa')]],'as':_0x4e480a['as'],'attributes':_0x4e480a[_0x7e2a('0xb')],'include':_0x4e480a[_0x7e2a('0x9')]?_[_0x7e2a('0xc')](_0x4e480a[_0x7e2a('0x9')],function(_0x43ed72){return{'model':db[_0x43ed72['model']],'as':_0x43ed72['as'],'attributes':_0x43ed72[_0x7e2a('0xb')],'include':_0x43ed72['include']?_['map'](_0x43ed72['include'],function(_0x100970){return{'model':db[_0x100970['model']],'as':_0x100970['as'],'attributes':_0x100970[_0x7e2a('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42dc33){logger[_0x7e2a('0xd')](_0x7e2a('0x5'),_0x2f21ac);logger['debug'](_0x7e2a('0x5'),_0x2f21ac,JSON['stringify'](_0x42dc33));_0x44723f(_0x42dc33);})[_0x7e2a('0xe')](function(_0x541204){logger[_0x7e2a('0xf')](_0x7e2a('0x5'),_0x541204[_0x7e2a('0x10')],_0x2f21ac);_0x53987d(_0x1e237b['error'](0x1f4,_0x541204[_0x7e2a('0x10')]));});});};exports['ShowInterval']=function(_0x46cc95){var _0x55f7b5=this;return new Promise(function(_0x4d8e16,_0x6e3653){return db[_0x7e2a('0x6')][_0x7e2a('0x11')]({'raw':_0x46cc95[_0x7e2a('0x8')]?_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0x7')]===undefined?!![]:![]:!![],'where':_0x46cc95['options']?_0x46cc95[_0x7e2a('0x8')]['where']||null:null,'attributes':_0x46cc95[_0x7e2a('0x8')]?_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0xb')]||null:null,'include':_0x46cc95['options']?_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0x9')]?_[_0x7e2a('0xc')](_0x46cc95[_0x7e2a('0x8')][_0x7e2a('0x9')],function(_0x45284f){return{'model':db[_0x45284f[_0x7e2a('0xa')]],'as':_0x45284f['as'],'attributes':_0x45284f[_0x7e2a('0xb')],'include':_0x45284f['include']?_[_0x7e2a('0xc')](_0x45284f[_0x7e2a('0x9')],function(_0x3a6b76){return{'model':db[_0x3a6b76['model']],'as':_0x3a6b76['as'],'attributes':_0x3a6b76[_0x7e2a('0xb')],'include':_0x3a6b76[_0x7e2a('0x9')]?_[_0x7e2a('0xc')](_0x3a6b76[_0x7e2a('0x9')],function(_0x39237e){return{'model':db[_0x39237e[_0x7e2a('0xa')]],'as':_0x39237e['as'],'attributes':_0x39237e[_0x7e2a('0xb')]};}):[]};}):[]};}):[]:[]})[_0x7e2a('0x12')](function(_0x53eab6){logger['info']('ShowInterval',_0x46cc95);logger[_0x7e2a('0x13')](_0x7e2a('0x14'),_0x46cc95,JSON[_0x7e2a('0x15')](_0x53eab6));_0x4d8e16(_0x53eab6);})[_0x7e2a('0xe')](function(_0x3b1e19){logger[_0x7e2a('0xf')]('ShowInterval',_0x3b1e19['message'],_0x46cc95);_0x6e3653(_0x55f7b5[_0x7e2a('0xf')](0x1f4,_0x3b1e19[_0x7e2a('0x10')]));});});};function checkArrayOfIntervals(_0x483b67,_0x5c428c){var _0xdf5f9c=[];return db[_0x7e2a('0x6')][_0x7e2a('0x16')]({'where':{'id':_0x483b67}})[_0x7e2a('0x12')](function(_0x217780){_0xdf5f9c=_0x217780;return Promise['all'](_0xdf5f9c[_0x7e2a('0xc')](function(_0x4d90de){return _0x4d90de['ifTime'](_0x5c428c);}));})['then'](function(_0xdc6467){var _0x2b5080=_0xdc6467[_0x7e2a('0x17')](function(_0x52aa2e,_0x2b1ca4){return _0x52aa2e||_0x2b1ca4;},![]);logger[_0x7e2a('0xd')](util['format'](_0x7e2a('0x18'),_0xdf5f9c['map'](function(_0x3ac154){return _0x3ac154[_0x7e2a('0x19')];})[_0x7e2a('0x1a')](',\x20'),_0xdf5f9c['map'](function(_0x11ad85){return _0x11ad85['id'];})[_0x7e2a('0x1a')](',\x20')));return _0x2b5080;});}function checkSingleInterval(_0x198825,_0x3556d9){return db[_0x7e2a('0x6')]['findById'](_0x198825)[_0x7e2a('0x12')](function(_0x1b875c){if(_0x1b875c){logger[_0x7e2a('0xd')](util[_0x7e2a('0x1b')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x1b875c[_0x7e2a('0x19')],_0x1b875c['id']));return _0x1b875c[_0x7e2a('0x1c')](_0x3556d9);}});}exports[_0x7e2a('0x1d')]=function(_0x5c4804){var _0x398cdf=_0x5c4804['intervalIds'];var _0x527cad=Array['isArray'](_0x5c4804[_0x7e2a('0x1e')])?_0x5c4804['intervals']:typeof _0x5c4804[_0x7e2a('0x1e')]===_0x7e2a('0x1f')?[_0x5c4804['intervals']]:[];var _0x105559=_0x5c4804[_0x7e2a('0x20')]||undefined;var _0x395e66=![];if(_0x527cad[_0x7e2a('0x21')]){logger[_0x7e2a('0xd')](util[_0x7e2a('0x1b')](_0x7e2a('0x22'),_0x527cad[_0x7e2a('0x1a')](';\x20')));}if(_0x105559){logger[_0x7e2a('0xd')](util['format'](_0x7e2a('0x23'),_0x105559));}logger[_0x7e2a('0x13')](_0x7e2a('0x24'),_0x395e66);logger[_0x7e2a('0x25')](_0x7e2a('0x1d'),_0x5c4804);return Promise[_0x7e2a('0x26')]()['then'](function(){if(Array[_0x7e2a('0x27')](_0x398cdf)){return checkArrayOfIntervals(_0x398cdf,_0x105559);}else if(_0x398cdf){return checkSingleInterval(_0x398cdf,_0x105559);}})[_0x7e2a('0x12')](function(_0x2d20e3){var _0x44b5bc=_0x527cad['reduce'](function(_0x5685dd,_0x560ca5){return _0x5685dd||iftime(_0x560ca5,_0x105559);},![]);_0x395e66=_0x2d20e3||_0x44b5bc;return _0x395e66;})[_0x7e2a('0xe')](function(_0x89a04a){logger[_0x7e2a('0xf')](_0x7e2a('0x1d'),_0x5c4804,_0x89a04a);throw this['error'](0x1f4,_0x89a04a[_0x7e2a('0x10')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index cbae620..c03d15e 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(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5c59e9,_0x253541){_0x5c59e9=_0x5c59e9-0x0;var _0x56b0b3=_0x0b0e[_0x5c59e9];return _0x56b0b3;};'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(_0x14aab5,_0x5328b8){var _0x19e794=function(_0x42cd5f){while(--_0x42cd5f){_0x14aab5['push'](_0x14aab5['shift']());}};_0x19e794(++_0x5328b8);}(_0xdb28,0x106));var _0x8db2=function(_0x5cec24,_0x570a65){_0x5cec24=_0x5cec24-0x0;var _0x592f2c=_0xdb28[_0x5cec24];return _0x592f2c;};'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 1a73746..c9804a4 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 _0x1d31=['openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','data','end','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x1d31,0x18a));var _0x11d3=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x1d31[_0x2d364e];return _0x1b9312;};'use strict';var BPromise=require(_0x11d3('0x0'));var https=require('https');var logger=require(_0x11d3('0x1'))(_0x11d3('0x2'));var USERNAME='support';var PASSWORD=_0x11d3('0x3');function openIssue(_0x398fbe,_0x322640){var _0x45ea62={'fields':{'project':{'key':_0x398fbe[_0x11d3('0x4')]||'MOTGUI'},'summary':(_0x398fbe[_0x11d3('0x5')]||_0x11d3('0x6'))+_0x11d3('0x7')+_0x398fbe['ip'],'description':_0x398fbe[_0x11d3('0x8')]||JSON[_0x11d3('0x9')](_0x398fbe),'issuetype':{'name':_0x398fbe[_0x11d3('0xa')]||_0x11d3('0xb')}}};_0x45ea62[_0x11d3('0xc')][_0x11d3('0xd')]=_0x398fbe[_0x11d3('0xe')];_0x45ea62[_0x11d3('0xc')]['customfield_11501']=_0x398fbe['oldToken'];_0x45ea62[_0x11d3('0xc')][_0x11d3('0xf')]=_0x398fbe[_0x11d3('0x10')];_0x45ea62[_0x11d3('0xc')]['customfield_11503']=_0x398fbe[_0x11d3('0x11')];_0x45ea62['fields'][_0x11d3('0x12')]=_0x398fbe[_0x11d3('0x13')];_0x45ea62['fields'][_0x11d3('0x14')]=_0x398fbe['ip'];var _0x3a9cdd={'host':_0x11d3('0x15'),'port':0x1bb,'path':_0x11d3('0x16'),'method':_0x11d3('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x11d3('0x18'),'Authorization':_0x11d3('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x11d3('0x1a')]('base64')}};var _0xb0d8d8=JSON[_0x11d3('0x9')](_0x45ea62);var _0x351c0f=https[_0x11d3('0x1b')](_0x3a9cdd,function(_0x26d04d){_0x26d04d['setEncoding']('utf8');var _0x29b118='';_0x26d04d['on'](_0x11d3('0x1c'),function(_0xee3375){_0x29b118+=_0xee3375;});_0x26d04d['on'](_0x11d3('0x1d'),function(){if(_0x322640){return _0x322640['status'](_0x26d04d['statusCode'])[_0x11d3('0x1e')](JSON['parse'](_0x29b118));}});});_0x351c0f['on'](_0x11d3('0x1f'),function(_0x56ee74){if(_0x322640){return _0x322640[_0x11d3('0x20')](0x1f4)[_0x11d3('0x1e')]({'errors':[{'message':_0x11d3('0x21'),'type':_0x11d3('0x22')}]});}});_0x351c0f[_0x11d3('0x23')](_0xb0d8d8);_0x351c0f[_0x11d3('0x1d')]();}exports[_0x11d3('0x24')]=openIssue;exports[_0x11d3('0x25')]=function(_0x141426,_0x49cfc1){_0x141426[_0x11d3('0x26')]['ip']=_0x141426[_0x11d3('0x27')]['x-forwarded-for']||_0x141426[_0x11d3('0x28')][_0x11d3('0x29')]||_0x141426[_0x11d3('0x2a')][_0x11d3('0x29')]||_0x141426[_0x11d3('0x28')][_0x11d3('0x2a')][_0x11d3('0x29')];return openIssue(_0x141426['body'],_0x49cfc1);}; \ No newline at end of file +var _0xf686=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','email','customfield_11501','oldToken','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','setEncoding','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','remoteAddress','socket','connection','body','https','support','3eAmWpBVP0'];(function(_0x5ceba2,_0x171562){var _0xaed6b5=function(_0x451744){while(--_0x451744){_0x5ceba2['push'](_0x5ceba2['shift']());}};_0xaed6b5(++_0x171562);}(_0xf686,0xd9));var _0x6f68=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf686[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var https=require(_0x6f68('0x0'));var logger=require('../../config/logger')('api');var USERNAME=_0x6f68('0x1');var PASSWORD=_0x6f68('0x2');function openIssue(_0x48e093,_0x402bd5){var _0x3e0436={'fields':{'project':{'key':_0x48e093[_0x6f68('0x3')]||_0x6f68('0x4')},'summary':(_0x48e093[_0x6f68('0x5')]||_0x6f68('0x6'))+_0x6f68('0x7')+_0x48e093['ip'],'description':_0x48e093[_0x6f68('0x8')]||JSON[_0x6f68('0x9')](_0x48e093),'issuetype':{'name':_0x48e093['issuetype']||_0x6f68('0xa')}}};_0x3e0436[_0x6f68('0xb')]['customfield_11500']=_0x48e093[_0x6f68('0xc')];_0x3e0436[_0x6f68('0xb')][_0x6f68('0xd')]=_0x48e093[_0x6f68('0xe')];_0x3e0436['fields']['customfield_11502']=_0x48e093[_0x6f68('0xf')];_0x3e0436[_0x6f68('0xb')]['customfield_11503']=_0x48e093[_0x6f68('0x10')];_0x3e0436['fields'][_0x6f68('0x11')]=_0x48e093[_0x6f68('0x12')];_0x3e0436[_0x6f68('0xb')][_0x6f68('0x13')]=_0x48e093['ip'];var _0x4ed45b={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x6f68('0x14'),'method':_0x6f68('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x6f68('0x16'),'Authorization':_0x6f68('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x6f68('0x18'))}};var _0x201029=JSON[_0x6f68('0x9')](_0x3e0436);var _0x2bff7b=https[_0x6f68('0x19')](_0x4ed45b,function(_0x2ed2e7){_0x2ed2e7[_0x6f68('0x1a')](_0x6f68('0x1b'));var _0x1ce164='';_0x2ed2e7['on']('data',function(_0x4dd947){_0x1ce164+=_0x4dd947;});_0x2ed2e7['on'](_0x6f68('0x1c'),function(){if(_0x402bd5){return _0x402bd5[_0x6f68('0x1d')](_0x2ed2e7[_0x6f68('0x1e')])[_0x6f68('0x1f')](JSON[_0x6f68('0x20')](_0x1ce164));}});});_0x2bff7b['on'](_0x6f68('0x21'),function(_0x4627a8){if(_0x402bd5){return _0x402bd5[_0x6f68('0x1d')](0x1f4)[_0x6f68('0x1f')]({'errors':[{'message':_0x6f68('0x22'),'type':_0x6f68('0x23')}]});}});_0x2bff7b[_0x6f68('0x24')](_0x201029);_0x2bff7b[_0x6f68('0x1c')]();}exports[_0x6f68('0x25')]=openIssue;exports[_0x6f68('0x26')]=function(_0x473beb,_0x21d96f){_0x473beb['body']['ip']=_0x473beb[_0x6f68('0x27')]['x-forwarded-for']||_0x473beb['connection'][_0x6f68('0x28')]||_0x473beb[_0x6f68('0x29')][_0x6f68('0x28')]||_0x473beb[_0x6f68('0x2a')][_0x6f68('0x29')][_0x6f68('0x28')];return openIssue(_0x473beb[_0x6f68('0x2b')],_0x21d96f);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 34ad4a7..5c14cc3 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 _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x43787d,_0x4dd3e3){var _0x56acf0=function(_0x1811de){while(--_0x1811de){_0x43787d['push'](_0x43787d['shift']());}};_0x56acf0(++_0x4dd3e3);}(_0x91a7,0xe7));var _0x791a=function(_0x5ab556,_0x35506f){_0x5ab556=_0x5ab556-0x0;var _0x421fda=_0x91a7[_0x5ab556];return _0x421fda;};'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['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0xc29019,_0x4c1f3b){var _0x25bdf4=function(_0xaf0bba){while(--_0xaf0bba){_0xc29019['push'](_0xc29019['shift']());}};_0x25bdf4(++_0x4c1f3b);}(_0x750a,0x140));var _0xa750=function(_0x10c398,_0x5ad5fd){_0x10c398=_0x10c398-0x0;var _0x3ab5b3=_0x750a[_0x10c398];return _0x3ab5b3;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ed46939..5cc6f99 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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x5731ab,_0x3de7a1){_0x5731ab=_0x5731ab-0x0;var _0x458592=_0x7a54[_0x5731ab];return _0x458592;};'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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x1f06af,_0x159b03){_0x1f06af=_0x1f06af-0x0;var _0x46f8d7=_0x7a54[_0x1f06af];return _0x46f8d7;};'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 8d60548..dff9805 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 _0xba18=['filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick'];(function(_0x24d92a,_0x5dcc4d){var _0x2d5aed=function(_0x2df528){while(--_0x2df528){_0x24d92a['push'](_0x24d92a['shift']());}};_0x2d5aed(++_0x5dcc4d);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8ba1('0x0'));var rimraf=require(_0x8ba1('0x1'));var zipdir=require(_0x8ba1('0x2'));var jsonpatch=require(_0x8ba1('0x3'));var rp=require(_0x8ba1('0x4'));var moment=require(_0x8ba1('0x5'));var BPromise=require(_0x8ba1('0x6'));var Mustache=require(_0x8ba1('0x7'));var util=require('util');var path=require(_0x8ba1('0x8'));var sox=require(_0x8ba1('0x9'));var csv=require(_0x8ba1('0xa'));var ejs=require(_0x8ba1('0xb'));var fs=require('fs');var fs_extra=require(_0x8ba1('0xc'));var _=require(_0x8ba1('0xd'));var squel=require('squel');var crypto=require(_0x8ba1('0xe'));var jsforce=require(_0x8ba1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ba1('0x10'));var Redis=require(_0x8ba1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8ba1('0x12'));var as=require(_0x8ba1('0x13'));var hardwareService=require(_0x8ba1('0x14'));var logger=require(_0x8ba1('0x15'))(_0x8ba1('0x16'));var utils=require('../../config/utils');var config=require(_0x8ba1('0x17'));var licenseUtil=require(_0x8ba1('0x18'));var db=require(_0x8ba1('0x19'))['db'];function respondWithStatusCode(_0x1fcfd7,_0x29adbb){_0x29adbb=_0x29adbb||0xcc;return function(_0x229748){if(_0x229748){return _0x1fcfd7['sendStatus'](_0x29adbb);}return _0x1fcfd7[_0x8ba1('0x1a')](_0x29adbb)[_0x8ba1('0x1b')]();};}function respondWithResult(_0x2e81d1,_0xca53c4){_0xca53c4=_0xca53c4||0xc8;return function(_0x4c8d5c){if(_0x4c8d5c){return _0x2e81d1['status'](_0xca53c4)['json'](_0x4c8d5c);}};}function respondWithFilteredResult(_0x3058ac,_0x398f40){return function(_0x5a3a8a){if(_0x5a3a8a){var _0x1b885b=typeof _0x398f40[_0x8ba1('0x1c')]===_0x8ba1('0x1d')&&typeof _0x398f40[_0x8ba1('0x1e')]===_0x8ba1('0x1d');var _0x19ade9=_0x5a3a8a[_0x8ba1('0x1f')];var _0x4d75fa=_0x1b885b?0x0:_0x398f40['offset'];var _0x1a48fa=_0x1b885b?_0x5a3a8a[_0x8ba1('0x1f')]:_0x398f40['offset']+_0x398f40[_0x8ba1('0x1e')];var _0x2e5fba;if(_0x1a48fa>=_0x19ade9){_0x1a48fa=_0x19ade9;_0x2e5fba=0xc8;}else{_0x2e5fba=0xce;}_0x3058ac[_0x8ba1('0x1a')](_0x2e5fba);return _0x3058ac[_0x8ba1('0x20')](_0x8ba1('0x21'),_0x4d75fa+'-'+_0x1a48fa+'/'+_0x19ade9)[_0x8ba1('0x22')](_0x5a3a8a);}return null;};}function patchUpdates(_0x5ddcf8){return function(_0x489662){try{jsonpatch['apply'](_0x489662,_0x5ddcf8,!![]);}catch(_0xd78e53){return BPromise[_0x8ba1('0x23')](_0xd78e53);}return _0x489662[_0x8ba1('0x24')]();};}function saveUpdates(_0x3dd1d8,_0x4e66e1){return function(_0x1d619c){if(_0x1d619c){return _0x1d619c[_0x8ba1('0x25')](_0x3dd1d8)[_0x8ba1('0x26')](function(_0x38a2de){return _0x38a2de;});}return null;};}function removeEntity(_0x2d4ad6,_0x3b70ea){return function(_0x845108){if(_0x845108){return _0x845108[_0x8ba1('0x27')]()[_0x8ba1('0x26')](function(){_0x2d4ad6[_0x8ba1('0x1a')](0xcc)[_0x8ba1('0x1b')]();});}};}function handleEntityNotFound(_0x550d33,_0x5c924e){return function(_0x41c2bb){if(!_0x41c2bb){_0x550d33[_0x8ba1('0x28')](0x194);}return _0x41c2bb;};}function handleError(_0x56aef2,_0x2baa80){_0x2baa80=_0x2baa80||0x1f4;return function(_0xef508d){logger[_0x8ba1('0x29')](_0xef508d[_0x8ba1('0x2a')]);if(_0xef508d[_0x8ba1('0x2b')]){delete _0xef508d[_0x8ba1('0x2b')];}_0x56aef2[_0x8ba1('0x1a')](_0x2baa80)[_0x8ba1('0x2c')](_0xef508d);};}exports[_0x8ba1('0x2d')]=function(_0x3f1b37,_0x3e8e6d){var _0x136eef={},_0x32782a={},_0x229e16={'count':0x0,'rows':[]};var _0x5e28b7=_[_0x8ba1('0x2e')](db[_0x8ba1('0x2f')][_0x8ba1('0x30')],function(_0x3c37fd){return{'name':_0x3c37fd[_0x8ba1('0x31')],'type':_0x3c37fd[_0x8ba1('0x32')]['key']};});_0x32782a[_0x8ba1('0x33')]=_[_0x8ba1('0x2e')](_0x5e28b7,'name');_0x32782a[_0x8ba1('0x34')]=_['keys'](_0x3f1b37[_0x8ba1('0x34')]);_0x32782a[_0x8ba1('0x35')]=_['intersection'](_0x32782a[_0x8ba1('0x33')],_0x32782a[_0x8ba1('0x34')]);_0x136eef[_0x8ba1('0x36')]=_[_0x8ba1('0x37')](_0x32782a[_0x8ba1('0x33')],qs['fields'](_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x38')]));_0x136eef[_0x8ba1('0x36')]=_0x136eef[_0x8ba1('0x36')][_0x8ba1('0x39')]?_0x136eef[_0x8ba1('0x36')]:_0x32782a[_0x8ba1('0x33')];if(!_0x3f1b37[_0x8ba1('0x34')]['hasOwnProperty'](_0x8ba1('0x3a'))){_0x136eef[_0x8ba1('0x1e')]=qs[_0x8ba1('0x1e')](_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x1e')]);_0x136eef[_0x8ba1('0x1c')]=qs[_0x8ba1('0x1c')](_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x1c')]);}_0x136eef[_0x8ba1('0x3b')]=qs['sort'](_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x3c')]);_0x136eef[_0x8ba1('0x3d')]=qs[_0x8ba1('0x35')](_[_0x8ba1('0x3e')](_0x3f1b37[_0x8ba1('0x34')],_0x32782a[_0x8ba1('0x35')]),_0x5e28b7);if(_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x3f')]){_0x136eef[_0x8ba1('0x3d')]=_['merge'](_0x136eef['where'],{'$or':_[_0x8ba1('0x2e')](_0x5e28b7,function(_0x3b02a6){if(_0x3b02a6[_0x8ba1('0x32')]!==_0x8ba1('0x40')){var _0x467a82={};_0x467a82[_0x3b02a6[_0x8ba1('0x2b')]]={'$like':'%'+_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x3f')]+'%'};return _0x467a82;}})});}_0x136eef=_[_0x8ba1('0x41')]({},_0x136eef,_0x3f1b37[_0x8ba1('0x42')]);var _0x2f4ac4={'where':_0x136eef[_0x8ba1('0x3d')]};return db[_0x8ba1('0x2f')][_0x8ba1('0x1f')](_0x2f4ac4)['then'](function(_0xf8c3b){_0x229e16[_0x8ba1('0x1f')]=_0xf8c3b;if(_0x3f1b37[_0x8ba1('0x34')][_0x8ba1('0x43')]){_0x136eef['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x8ba1('0x44')](_0x136eef);})[_0x8ba1('0x26')](function(_0x1d1ffd){_0x229e16[_0x8ba1('0x45')]=_0x1d1ffd;return _0x229e16;})[_0x8ba1('0x26')](respondWithFilteredResult(_0x3e8e6d,_0x136eef))['catch'](handleError(_0x3e8e6d,null));};exports[_0x8ba1('0x46')]=function(_0x171054,_0x16bdb1){var _0x5b02d8={'raw':!![],'where':{'id':_0x171054[_0x8ba1('0x47')]['id']}},_0x1e5376={};_0x1e5376[_0x8ba1('0x33')]=_[_0x8ba1('0x48')](db[_0x8ba1('0x2f')][_0x8ba1('0x30')]);_0x1e5376['query']=_[_0x8ba1('0x48')](_0x171054['query']);_0x1e5376[_0x8ba1('0x35')]=_[_0x8ba1('0x37')](_0x1e5376[_0x8ba1('0x33')],_0x1e5376[_0x8ba1('0x34')]);_0x5b02d8[_0x8ba1('0x36')]=_[_0x8ba1('0x37')](_0x1e5376['model'],qs[_0x8ba1('0x38')](_0x171054[_0x8ba1('0x34')]['fields']));_0x5b02d8['attributes']=_0x5b02d8[_0x8ba1('0x36')][_0x8ba1('0x39')]?_0x5b02d8[_0x8ba1('0x36')]:_0x1e5376[_0x8ba1('0x33')];if(_0x171054[_0x8ba1('0x34')][_0x8ba1('0x43')]){_0x5b02d8[_0x8ba1('0x49')]=[{'all':!![]}];}_0x5b02d8=_[_0x8ba1('0x41')]({},_0x5b02d8,_0x171054[_0x8ba1('0x42')]);return db[_0x8ba1('0x2f')][_0x8ba1('0x4a')](_0x5b02d8)[_0x8ba1('0x26')](handleEntityNotFound(_0x16bdb1,null))[_0x8ba1('0x26')](respondWithResult(_0x16bdb1,null))['catch'](handleError(_0x16bdb1,null));};exports[_0x8ba1('0x4b')]=function(_0x3bb667,_0x1405a2){return db[_0x8ba1('0x2f')][_0x8ba1('0x4b')](_0x3bb667[_0x8ba1('0x4c')],{})[_0x8ba1('0x26')](respondWithResult(_0x1405a2,0xc9))[_0x8ba1('0x4d')](handleError(_0x1405a2,null));};exports[_0x8ba1('0x25')]=function(_0xd1ec48,_0xae04af){if(_0xd1ec48[_0x8ba1('0x4c')]['id']){delete _0xd1ec48[_0x8ba1('0x4c')]['id'];}return db[_0x8ba1('0x2f')]['find']({'where':{'id':_0xd1ec48[_0x8ba1('0x47')]['id']}})[_0x8ba1('0x26')](handleEntityNotFound(_0xae04af,null))['then'](saveUpdates(_0xd1ec48[_0x8ba1('0x4c')],null))[_0x8ba1('0x26')](respondWithResult(_0xae04af,null))[_0x8ba1('0x4d')](handleError(_0xae04af,null));};exports[_0x8ba1('0x27')]=function(_0x10fc3c,_0x5304c4){return db['JscriptyAnswerReport'][_0x8ba1('0x4a')]({'where':{'id':_0x10fc3c[_0x8ba1('0x47')]['id']}})['then'](handleEntityNotFound(_0x5304c4,null))[_0x8ba1('0x26')](removeEntity(_0x5304c4,null))[_0x8ba1('0x4d')](handleError(_0x5304c4,null));};exports[_0x8ba1('0x4e')]=function(_0x4d93b2,_0x3b9bb4){return db[_0x8ba1('0x2f')][_0x8ba1('0x4e')]()['then'](respondWithResult(_0x3b9bb4,null))[_0x8ba1('0x4d')](handleError(_0x3b9bb4,null));}; \ No newline at end of file +var _0x2675=['limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','create','body','update','params','describe','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x2cb046,_0x11465d){var _0x2fa703=function(_0x5300db){while(--_0x5300db){_0x2cb046['push'](_0x2cb046['shift']());}};_0x2fa703(++_0x11465d);}(_0x2675,0x75));var _0x5267=function(_0x32b2cc,_0x1f5116){_0x32b2cc=_0x32b2cc-0x0;var _0x39bc4c=_0x2675[_0x32b2cc];return _0x39bc4c;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['JscriptyAnswerReport'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['JscriptyAnswerReport'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['create']=function(_0x12d6a8,_0x4ee826){return db['JscriptyAnswerReport'][_0x5267('0x43')](_0x12d6a8[_0x5267('0x44')],{})['then'](respondWithResult(_0x4ee826,0xc9))['catch'](handleError(_0x4ee826,null));};exports[_0x5267('0x45')]=function(_0xe0439e,_0x3d2436){if(_0xe0439e[_0x5267('0x44')]['id']){delete _0xe0439e[_0x5267('0x44')]['id'];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0xe0439e[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x3d2436,null))[_0x5267('0x22')](saveUpdates(_0xe0439e[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0x3d2436,null))[_0x5267('0x3d')](handleError(_0x3d2436,null));};exports[_0x5267('0x21')]=function(_0x4f7f75,_0x8636d0){return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'id':_0x4f7f75['params']['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x8636d0,null))[_0x5267('0x22')](removeEntity(_0x8636d0,null))[_0x5267('0x3d')](handleError(_0x8636d0,null));};exports[_0x5267('0x47')]=function(_0x119546,_0x1457cf){return db['JscriptyAnswerReport'][_0x5267('0x47')]()['then'](respondWithResult(_0x1457cf,null))[_0x5267('0x3d')](handleError(_0x1457cf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 5559da4..dad3097 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 _0x8f4d=['report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','JscriptyAnswerReport'];(function(_0x2d5fda,_0x302e14){var _0x5e8b55=function(_0x46b643){while(--_0x46b643){_0x2d5fda['push'](_0x2d5fda['shift']());}};_0x5e8b55(++_0x302e14);}(_0x8f4d,0x1d5));var _0xd8f4=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x8f4d[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xd8f4('0x0'));var util=require(_0xd8f4('0x1'));var logger=require(_0xd8f4('0x2'))(_0xd8f4('0x3'));var moment=require('moment');var BPromise=require(_0xd8f4('0x4'));var rp=require(_0xd8f4('0x5'));var fs=require('fs');var path=require(_0xd8f4('0x6'));var rimraf=require(_0xd8f4('0x7'));var config=require(_0xd8f4('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x6011a2,_0x30914b){return _0x6011a2[_0xd8f4('0x9')](_0xd8f4('0xa'),attributes,{'tableName':_0xd8f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaa5=['moment','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api'];(function(_0x3a6a19,_0x500313){var _0xce7903=function(_0x121818){while(--_0x121818){_0x3a6a19['push'](_0x3a6a19['shift']());}};_0xce7903(++_0x500313);}(_0xcaa5,0x152));var _0x5caa=function(_0x1d5ccb,_0x136776){_0x1d5ccb=_0x1d5ccb-0x0;var _0x49fc07=_0xcaa5[_0x1d5ccb];return _0x49fc07;};'use strict';var _=require(_0x5caa('0x0'));var util=require(_0x5caa('0x1'));var logger=require(_0x5caa('0x2'))(_0x5caa('0x3'));var moment=require(_0x5caa('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5caa('0x5'));var rimraf=require(_0x5caa('0x6'));var config=require(_0x5caa('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x5caa('0x8')]=function(_0x3465ad,_0x1c6b77){return _0x3465ad['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 3ddd8bc..4f193e6 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 _0xb5cc=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x24ef1c,_0x559d36){var _0x45ab3e=function(_0x21283b){while(--_0x21283b){_0x24ef1c['push'](_0x24ef1c['shift']());}};_0x45ab3e(++_0x559d36);}(_0xb5cc,0x194));var _0xcb5c=function(_0x399c11,_0x3b4997){_0x399c11=_0x399c11-0x0;var _0x4926c4=_0xb5cc[_0x399c11];return _0x4926c4;};'use strict';var _=require(_0xcb5c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb5c('0x1'));var db=require(_0xcb5c('0x2'))['db'];var utils=require(_0xcb5c('0x3'));var logger=require(_0xcb5c('0x4'))(_0xcb5c('0x5'));var config=require(_0xcb5c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcb5c('0x7')][_0xcb5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x68898a,_0x3e831c,_0x4a337f){return new BPromise(function(_0x594565,_0x1350cb){return client[_0xcb5c('0x9')](_0x68898a,_0x4a337f)[_0xcb5c('0xa')](function(_0x202887){logger[_0xcb5c('0xb')](_0xcb5c('0xc'),_0x3e831c,_0xcb5c('0xd'));logger[_0xcb5c('0xe')](_0xcb5c('0xf'),_0x3e831c,'request\x20sent',JSON[_0xcb5c('0x10')](_0x202887));if(_0x202887['error']){if(_0x202887[_0xcb5c('0x11')][_0xcb5c('0x12')]===0x1f4){logger[_0xcb5c('0x11')](_0xcb5c('0xc'),_0x3e831c,_0x202887[_0xcb5c('0x11')][_0xcb5c('0x13')]);return _0x1350cb(_0x202887[_0xcb5c('0x11')][_0xcb5c('0x13')]);}logger[_0xcb5c('0x11')](_0xcb5c('0xc'),_0x3e831c,_0x202887['error'][_0xcb5c('0x13')]);return _0x594565(_0x202887['error'][_0xcb5c('0x13')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3e831c,_0xcb5c('0xd'));_0x594565(_0x202887[_0xcb5c('0x14')][_0xcb5c('0x13')]);}})[_0xcb5c('0x15')](function(_0x45d4e4){logger[_0xcb5c('0x11')](_0xcb5c('0xc'),_0x3e831c,_0x45d4e4);_0x1350cb(_0x45d4e4);});});} \ No newline at end of file +var _0x648f=['request\x20sent','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x648f,0x124));var _0xf648=function(_0x301148,_0x25b884){_0x301148=_0x301148-0x0;var _0x42ce24=_0x648f[_0x301148];return _0x42ce24;};'use strict';var _=require('lodash');var util=require(_0xf648('0x0'));var moment=require(_0xf648('0x1'));var BPromise=require(_0xf648('0x2'));var rs=require(_0xf648('0x3'));var fs=require('fs');var Redis=require(_0xf648('0x4'));var db=require(_0xf648('0x5'))['db'];var utils=require(_0xf648('0x6'));var logger=require(_0xf648('0x7'))(_0xf648('0x8'));var config=require(_0xf648('0x9'));var jayson=require(_0xf648('0xa'));var client=jayson['client'][_0xf648('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x394d25,_0x41da33,_0xe0e416){return new BPromise(function(_0x56e4d7,_0x4bbb06){return client[_0xf648('0xc')](_0x394d25,_0xe0e416)[_0xf648('0xd')](function(_0x2324fa){logger['info'](_0xf648('0xe'),_0x41da33,'request\x20sent');logger['debug'](_0xf648('0xf'),_0x41da33,_0xf648('0x10'),JSON['stringify'](_0x2324fa));if(_0x2324fa[_0xf648('0x11')]){if(_0x2324fa[_0xf648('0x11')][_0xf648('0x12')]===0x1f4){logger[_0xf648('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x41da33,_0x2324fa[_0xf648('0x11')][_0xf648('0x13')]);return _0x4bbb06(_0x2324fa[_0xf648('0x11')]['message']);}logger[_0xf648('0x11')](_0xf648('0xe'),_0x41da33,_0x2324fa[_0xf648('0x11')][_0xf648('0x13')]);return _0x56e4d7(_0x2324fa['error']['message']);}else{logger[_0xf648('0x14')](_0xf648('0xe'),_0x41da33,_0xf648('0x10'));_0x56e4d7(_0x2324fa[_0xf648('0x15')][_0xf648('0x13')]);}})['catch'](function(_0x5f5ddd){logger['error'](_0xf648('0xe'),_0x41da33,_0x5f5ddd);_0x4bbb06(_0x5f5ddd);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index de6a974..2f71bb9 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 _0xe549=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/sessions','getSessions','getAnswers','30s','getSummary','post','create','/:id/clone','put','delete'];(function(_0x427b94,_0x50aee2){var _0x49d642=function(_0x42e067){while(--_0x42e067){_0x427b94['push'](_0x427b94['shift']());}};_0x49d642(++_0x50aee2);}(_0xe549,0x1a4));var _0x9e54=function(_0x3b3d65,_0x5a15c3){_0x3b3d65=_0x3b3d65-0x0;var _0x4f31bf=_0xe549[_0x3b3d65];return _0x4f31bf;};'use strict';var multer=require(_0x9e54('0x0'));var util=require(_0x9e54('0x1'));var path=require(_0x9e54('0x2'));var timeout=require(_0x9e54('0x3'));var express=require(_0x9e54('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e54('0x5'));var interaction=require(_0x9e54('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x9e54('0x7')]('/',auth[_0x9e54('0x8')](),controller['index']);router[_0x9e54('0x7')](_0x9e54('0x9'),auth[_0x9e54('0x8')](),controller['show']);router[_0x9e54('0x7')](_0x9e54('0xa'),auth[_0x9e54('0x8')](),controller[_0x9e54('0xb')]);router[_0x9e54('0x7')]('/:id/answers',auth[_0x9e54('0x8')](),controller[_0x9e54('0xc')]);router[_0x9e54('0x7')]('/:id/summary',auth[_0x9e54('0x8')](),timeout(_0x9e54('0xd')),controller[_0x9e54('0xe')]);router[_0x9e54('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e54('0x10')]);router[_0x9e54('0xf')](_0x9e54('0x11'),auth[_0x9e54('0x8')](),controller['clone']);router[_0x9e54('0x12')]('/:id',auth[_0x9e54('0x8')](),controller['update']);router[_0x9e54('0x13')](_0x9e54('0x9'),auth[_0x9e54('0x8')](),controller[_0x9e54('0x14')]);module[_0x9e54('0x15')]=router; \ No newline at end of file +var _0xd0b6=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/sessions','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x375242,_0x4fe67f){var _0xf3426b=function(_0x2e52bd){while(--_0x2e52bd){_0x375242['push'](_0x375242['shift']());}};_0xf3426b(++_0x4fe67f);}(_0xd0b6,0x19f));var _0x6d0b=function(_0x28edf8,_0x3ab79f){_0x28edf8=_0x28edf8-0x0;var _0xb0bbba=_0xd0b6[_0x28edf8];return _0xb0bbba;};'use strict';var multer=require('multer');var util=require(_0x6d0b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6d0b('0x1'));var router=express[_0x6d0b('0x2')]();var fs_extra=require(_0x6d0b('0x3'));var auth=require(_0x6d0b('0x4'));var interaction=require(_0x6d0b('0x5'));var config=require(_0x6d0b('0x6'));var controller=require(_0x6d0b('0x7'));router['get']('/',auth[_0x6d0b('0x8')](),controller['index']);router[_0x6d0b('0x9')](_0x6d0b('0xa'),auth[_0x6d0b('0x8')](),controller[_0x6d0b('0xb')]);router[_0x6d0b('0x9')](_0x6d0b('0xc'),auth['isAuthenticated'](),controller['getSessions']);router[_0x6d0b('0x9')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x6d0b('0x9')](_0x6d0b('0xd'),auth[_0x6d0b('0x8')](),timeout(_0x6d0b('0xe')),controller[_0x6d0b('0xf')]);router[_0x6d0b('0x10')]('/',auth[_0x6d0b('0x8')](),controller['create']);router['post'](_0x6d0b('0x11'),auth[_0x6d0b('0x8')](),controller[_0x6d0b('0x12')]);router[_0x6d0b('0x13')]('/:id',auth[_0x6d0b('0x8')](),controller['update']);router['delete'](_0x6d0b('0xa'),auth[_0x6d0b('0x8')](),controller['destroy']);module[_0x6d0b('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4e1f9ba..a52e18d 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 _0x3f66=['BOOLEAN','lodash','exports','STRING','name','long','isObjectLike','formData','isString','format','getDataValue','description'];(function(_0x492daf,_0x41afe0){var _0x540390=function(_0x4b00d7){while(--_0x4b00d7){_0x492daf['push'](_0x492daf['shift']());}};_0x540390(++_0x41afe0);}(_0x3f66,0xf1));var _0x63f6=function(_0x424ddb,_0x5b68b3){_0x424ddb=_0x424ddb-0x0;var _0xcd6c28=_0x3f66[_0x424ddb];return _0xcd6c28;};'use strict';var Sequelize=require('sequelize');var _=require(_0x63f6('0x0'));var util=require('util');module[_0x63f6('0x1')]={'name':{'type':Sequelize[_0x63f6('0x2')],'unique':_0x63f6('0x3')},'description':{'type':Sequelize[_0x63f6('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x63f6('0x4')),'set':function(_0x59c677){if(_[_0x63f6('0x5')](_0x59c677)){this['setDataValue'](_0x63f6('0x6'),JSON['stringify'](_0x59c677));}else if(_[_0x63f6('0x7')](_0x59c677)){this['setDataValue']('formData',_0x59c677);}else{this['setDataValue'](_0x63f6('0x6'),util[_0x63f6('0x8')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x63f6('0x9')](_0x63f6('0x3'))||'',this['getDataValue'](_0x63f6('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x63f6('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x2cb9=['util','exports','STRING','name','TEXT','isObjectLike','formData','stringify','isString','setDataValue','getDataValue','description','BOOLEAN','lodash'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x2cb9,0x99));var _0x92cb=function(_0x309719,_0xab8feb){_0x309719=_0x309719-0x0;var _0x1cbf70=_0x2cb9[_0x309719];return _0x1cbf70;};'use strict';var Sequelize=require('sequelize');var _=require(_0x92cb('0x0'));var util=require(_0x92cb('0x1'));module[_0x92cb('0x2')]={'name':{'type':Sequelize[_0x92cb('0x3')],'unique':_0x92cb('0x4')},'description':{'type':Sequelize[_0x92cb('0x3')]},'formData':{'type':Sequelize[_0x92cb('0x5')]('long'),'set':function(_0x9ea82e){if(_[_0x92cb('0x6')](_0x9ea82e)){this['setDataValue'](_0x92cb('0x7'),JSON[_0x92cb('0x8')](_0x9ea82e));}else if(_[_0x92cb('0x9')](_0x9ea82e)){this[_0x92cb('0xa')]('formData',_0x9ea82e);}else{this[_0x92cb('0xa')](_0x92cb('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x92cb('0xb')]('name')||'',this[_0x92cb('0xb')](_0x92cb('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x92cb('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 4fffd9a..2f3f751 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 _0xef0f=['/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','Projects','UserProfileResource','error','stack','name','send','index','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','JscriptyProject','rows','catch','show','include','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','params','rawAttributes','includeAll','merge','createdAt','updatedAt','role','getSessions','findOne','ProjectId','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','number','toString','indexOf','starttime','parse','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','push','isEmpty','now','writeFileSync'];(function(_0x4466e9,_0x2422db){var _0x3d1c7f=function(_0x156a1d){while(--_0x156a1d){_0x4466e9['push'](_0x4466e9['shift']());}};_0x3d1c7f(++_0x2422db);}(_0xef0f,0x168));var _0xfef0=function(_0x1f453a,_0x4cf2ef){_0x1f453a=_0x1f453a-0x0;var _0x3ef9a2=_0xef0f[_0x1f453a];return _0x3ef9a2;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){var _0x5c9085=_0x4483f2['get']({'plain':!![]});var _0x316e20=_0xfef0('0x2a');return db[_0xfef0('0x2b')][_0xfef0('0x28')]({'where':{'type':_0x316e20,'resourceId':_0x5c9085['id']}})[_0xfef0('0x29')](function(){return _0x4483f2;});})[_0xfef0('0x29')](function(){_0x46b34a[_0xfef0('0x1c')](0xcc)[_0xfef0('0x1d')]();});}};}function handleEntityNotFound(_0x391279,_0x529d86){return function(_0x1a6758){if(!_0x1a6758){_0x391279[_0xfef0('0x1b')](0x194);}return _0x1a6758;};}function handleError(_0xca0cce,_0x956de8){_0x956de8=_0x956de8||0x1f4;return function(_0x37921f){logger[_0xfef0('0x2c')](_0x37921f[_0xfef0('0x2d')]);if(_0x37921f[_0xfef0('0x2e')]){delete _0x37921f[_0xfef0('0x2e')];}_0xca0cce[_0xfef0('0x1c')](_0x956de8)[_0xfef0('0x2f')](_0x37921f);};}exports[_0xfef0('0x30')]=function(_0x51af0f,_0x445625){var _0x5806bd={},_0x4eaf74={},_0x7d1692={'count':0x0,'rows':[]};var _0x2ae54a=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x4f65cd){return{'name':_0x4f65cd['fieldName'],'type':_0x4f65cd[_0xfef0('0x31')][_0xfef0('0x32')]};});_0x4eaf74[_0xfef0('0x33')]=_['map'](_0x2ae54a,'name');_0x4eaf74['query']=_[_0xfef0('0x34')](_0x51af0f['query']);_0x4eaf74[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x4eaf74[_0xfef0('0x33')],_0x4eaf74['query']);_0x5806bd[_0xfef0('0x37')]=_['intersection'](_0x4eaf74[_0xfef0('0x33')],qs[_0xfef0('0x38')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x38')]));_0x5806bd[_0xfef0('0x37')]=_0x5806bd[_0xfef0('0x37')][_0xfef0('0x3a')]?_0x5806bd[_0xfef0('0x37')]:_0x4eaf74['model'];if(!_0x51af0f[_0xfef0('0x39')][_0xfef0('0x3b')](_0xfef0('0x3c'))){_0x5806bd[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x20')]);_0x5806bd[_0xfef0('0x1e')]=qs[_0xfef0('0x1e')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x1e')]);}_0x5806bd[_0xfef0('0x3d')]=qs[_0xfef0('0x3e')](_0x51af0f['query'][_0xfef0('0x3e')]);_0x5806bd['where']=qs[_0xfef0('0x35')](_[_0xfef0('0x3f')](_0x51af0f[_0xfef0('0x39')],_0x4eaf74['filters']),_0x2ae54a);if(_0x51af0f[_0xfef0('0x39')][_0xfef0('0x40')]){_0x5806bd[_0xfef0('0x41')]=_['merge'](_0x5806bd[_0xfef0('0x41')],{'$or':_[_0xfef0('0x42')](_0x2ae54a,function(_0x39b5c2){if(_0x39b5c2['type']!==_0xfef0('0x43')){var _0x492b90={};_0x492b90[_0x39b5c2['name']]={'$like':'%'+_0x51af0f[_0xfef0('0x39')]['filter']+'%'};return _0x492b90;}})});}_0x5806bd=_['merge']({},_0x5806bd,_0x51af0f[_0xfef0('0x44')]);var _0x61f1ce={'where':_0x5806bd[_0xfef0('0x41')]};return db[_0xfef0('0x45')][_0xfef0('0x21')](_0x61f1ce)[_0xfef0('0x29')](function(_0x4dd8f8){_0x7d1692[_0xfef0('0x21')]=_0x4dd8f8;if(_0x51af0f[_0xfef0('0x39')]['includeAll']){_0x5806bd['include']=[{'all':!![]}];}return db[_0xfef0('0x45')]['findAll'](_0x5806bd);})[_0xfef0('0x29')](function(_0x22c940){_0x7d1692[_0xfef0('0x46')]=_0x22c940;return _0x7d1692;})[_0xfef0('0x29')](respondWithFilteredResult(_0x445625,_0x5806bd))[_0xfef0('0x47')](handleError(_0x445625,null));};exports[_0xfef0('0x48')]=function(_0x166a7b,_0x15b4a6){var _0x4e63f3={'raw':![],'where':{'id':_0x166a7b['params']['id']}},_0x1813dc={};_0x1813dc['model']=_[_0xfef0('0x34')](db[_0xfef0('0x45')]['rawAttributes']);_0x1813dc[_0xfef0('0x39')]=_['keys'](_0x166a7b[_0xfef0('0x39')]);_0x1813dc[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x1813dc[_0xfef0('0x33')],_0x1813dc['query']);_0x4e63f3[_0xfef0('0x37')]=_[_0xfef0('0x36')](_0x1813dc['model'],qs['fields'](_0x166a7b[_0xfef0('0x39')]['fields']));_0x4e63f3[_0xfef0('0x37')]=_0x4e63f3[_0xfef0('0x37')][_0xfef0('0x3a')]?_0x4e63f3[_0xfef0('0x37')]:_0x1813dc[_0xfef0('0x33')];if(_0x166a7b[_0xfef0('0x39')]['includeAll']){_0x4e63f3[_0xfef0('0x49')]=[{'all':!![]}];}_0x4e63f3=_['merge']({},_0x4e63f3,_0x166a7b['options']);return db[_0xfef0('0x45')][_0xfef0('0x4a')](_0x4e63f3)[_0xfef0('0x29')](handleEntityNotFound(_0x15b4a6,null))['then'](respondWithResult(_0x15b4a6,null))[_0xfef0('0x47')](handleError(_0x15b4a6,null));};exports['create']=function(_0x5dd26b,_0x51f207){return db[_0xfef0('0x45')][_0xfef0('0x4b')](_0x5dd26b[_0xfef0('0x4c')],{})[_0xfef0('0x29')](function(_0x2712e9){var _0xa23cc8=_0x5dd26b[_0xfef0('0x4d')][_0xfef0('0x4e')]({'plain':!![]});if(!_0xa23cc8)throw new Error(_0xfef0('0x4f'));if(_0xa23cc8['role']==='user'){var _0x2bebec=_0x2712e9[_0xfef0('0x4e')]({'plain':!![]});var _0x34e9ed=_0xfef0('0x2a');return db[_0xfef0('0x50')][_0xfef0('0x4a')]({'where':{'name':_0x34e9ed,'userProfileId':_0xa23cc8[_0xfef0('0x51')]},'raw':!![]})[_0xfef0('0x29')](function(_0x5e989f){if(_0x5e989f&&_0x5e989f[_0xfef0('0x52')]===0x0){return db[_0xfef0('0x2b')][_0xfef0('0x4b')]({'name':_0x2bebec[_0xfef0('0x2e')],'resourceId':_0x2bebec['id'],'type':_0x5e989f[_0xfef0('0x2e')],'sectionId':_0x5e989f['id']},{})['then'](function(){return _0x2712e9;});}else{return _0x2712e9;}})['catch'](function(_0x523763){logger[_0xfef0('0x2c')](_0xfef0('0x53'),_0x523763);throw _0x523763;});}return _0x2712e9;})[_0xfef0('0x29')](respondWithResult(_0x51f207,0xc9))[_0xfef0('0x47')](handleError(_0x51f207,null));};exports['clone']=function(_0x18a6ee,_0x2b5c33){var _0x302908={'where':{'id':_0x18a6ee[_0xfef0('0x54')]['id']}},_0x28b90c={};_0x28b90c[_0xfef0('0x33')]=_[_0xfef0('0x34')](db['JscriptyProject'][_0xfef0('0x55')]);_0x302908[_0xfef0('0x37')]=_['intersection'](_0x28b90c[_0xfef0('0x33')],qs['fields'](_0x18a6ee[_0xfef0('0x39')][_0xfef0('0x38')]));_0x302908['attributes']=_0x302908[_0xfef0('0x37')]['length']?_0x302908['attributes']:_0x28b90c['model'];if(_0x18a6ee[_0xfef0('0x39')][_0xfef0('0x56')]){_0x302908[_0xfef0('0x49')]=[{'all':!![]}];}_0x302908=_[_0xfef0('0x57')]({},_0x302908,_0x18a6ee[_0xfef0('0x44')]);return db[_0xfef0('0x45')]['find'](_0x302908)[_0xfef0('0x29')](handleEntityNotFound(_0x2b5c33,null))[_0xfef0('0x29')](function(_0x12f52d){if(_0x12f52d){var _0x45abb3=_0x12f52d[_0xfef0('0x4e')]({'plain':!![]});_0x45abb3=qs['omit'](_0x45abb3,['id',_0xfef0('0x58'),'updatedAt']);_0x18a6ee[_0xfef0('0x4c')]=_['omit'](_0x18a6ee[_0xfef0('0x4c')],['id',_0xfef0('0x58'),_0xfef0('0x59')]);return db[_0xfef0('0x45')][_0xfef0('0x4b')](_['merge'](_0x45abb3,_0x18a6ee[_0xfef0('0x4c')]),{'include':_0x18a6ee['query'][_0xfef0('0x56')]?[{'all':!![]}]:undefined})[_0xfef0('0x29')](function(_0x4a4d36){var _0x3a12c5=_0x18a6ee[_0xfef0('0x4d')][_0xfef0('0x4e')]({'plain':!![]});if(!_0x3a12c5)throw new Error(_0xfef0('0x4f'));if(_0x3a12c5[_0xfef0('0x5a')]===_0xfef0('0x4d')){var _0x400028=_0x4a4d36[_0xfef0('0x4e')]({'plain':!![]});var _0x17a595=_0xfef0('0x2a');return db[_0xfef0('0x50')][_0xfef0('0x4a')]({'where':{'name':_0x17a595,'userProfileId':_0x3a12c5['userProfileId']},'raw':!![]})[_0xfef0('0x29')](function(_0x3b660c){if(_0x3b660c&&_0x3b660c[_0xfef0('0x52')]===0x0){return db[_0xfef0('0x2b')][_0xfef0('0x4b')]({'name':_0x400028['name'],'resourceId':_0x400028['id'],'type':_0x3b660c[_0xfef0('0x2e')],'sectionId':_0x3b660c['id']},{})[_0xfef0('0x29')](function(){return _0x4a4d36;});}else{return _0x4a4d36;}})[_0xfef0('0x47')](function(_0x3c6bb8){logger[_0xfef0('0x2c')](_0xfef0('0x53'),_0x3c6bb8);throw _0x3c6bb8;});}return _0x4a4d36;});}})[_0xfef0('0x29')](respondWithResult(_0x2b5c33,0xc9))[_0xfef0('0x47')](handleError(_0x2b5c33,null));};exports[_0xfef0('0x27')]=function(_0x3f26d9,_0x4f7ad3){if(_0x3f26d9[_0xfef0('0x4c')]['id']){delete _0x3f26d9['body']['id'];}return db[_0xfef0('0x45')][_0xfef0('0x4a')]({'where':{'id':_0x3f26d9['params']['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x4f7ad3,null))[_0xfef0('0x29')](saveUpdates(_0x3f26d9[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x4f7ad3,null))[_0xfef0('0x47')](handleError(_0x4f7ad3,null));};exports['destroy']=function(_0x28a7f3,_0x740663){return db[_0xfef0('0x45')]['find']({'where':{'id':_0x28a7f3[_0xfef0('0x54')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x740663,null))[_0xfef0('0x29')](removeEntity(_0x740663,null))[_0xfef0('0x47')](handleError(_0x740663,null));};exports[_0xfef0('0x5b')]=function(_0x3cfe32,_0x45ba65,_0x48c2e1){var _0x389181={'raw':!![],'where':{}};var _0x31e191={};var _0x3cd0c5={'count':0x0,'rows':[]};return db[_0xfef0('0x45')][_0xfef0('0x5c')]({'where':{'id':_0x3cfe32[_0xfef0('0x54')]['id']}})['then'](handleEntityNotFound(_0x45ba65,null))[_0xfef0('0x29')](function(_0x3e9a2f){if(_0x3e9a2f){_0x31e191[_0xfef0('0x33')]=_[_0xfef0('0x34')](db['JscriptySessionReport'][_0xfef0('0x55')]);_0x31e191[_0xfef0('0x39')]=_['keys'](_0x3cfe32[_0xfef0('0x39')]);_0x31e191[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x31e191[_0xfef0('0x33')],_0x31e191[_0xfef0('0x39')]);_0x389181['attributes']=_['intersection'](_0x31e191['model'],qs[_0xfef0('0x38')](_0x3cfe32[_0xfef0('0x39')][_0xfef0('0x38')]));_0x389181['attributes']=_0x389181[_0xfef0('0x37')]['length']?_0x389181['attributes']:_0x31e191['model'];if(!_0x3cfe32[_0xfef0('0x39')][_0xfef0('0x3b')]('nolimit')){_0x389181[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x3cfe32[_0xfef0('0x39')]['limit']);_0x389181[_0xfef0('0x1e')]=qs['offset'](_0x3cfe32['query'][_0xfef0('0x1e')]);}_0x389181[_0xfef0('0x3d')]=qs[_0xfef0('0x3e')](_0x3cfe32[_0xfef0('0x39')]['sort']);_0x389181['where']=qs['filters'](_[_0xfef0('0x3f')](_0x3cfe32['query'],_0x31e191[_0xfef0('0x35')]));_0x389181[_0xfef0('0x41')][_0xfef0('0x5d')]=_0x3e9a2f['id'];if(_0x3cfe32[_0xfef0('0x39')][_0xfef0('0x40')]){_0x389181['where']=_[_0xfef0('0x57')](_0x389181['where'],{'$or':_['map'](_0x389181[_0xfef0('0x37')],function(_0x2b3151){var _0xc30175={};_0xc30175[_0x2b3151]={'$like':'%'+_0x3cfe32[_0xfef0('0x39')]['filter']+'%'};return _0xc30175;})});}_0x389181=_['merge']({},_0x389181,_0x3cfe32[_0xfef0('0x44')]);return db[_0xfef0('0x5e')]['count']({'where':_0x389181[_0xfef0('0x41')]})[_0xfef0('0x29')](function(_0x4690c0){_0x3cd0c5[_0xfef0('0x21')]=_0x4690c0;if(_0x3cfe32[_0xfef0('0x39')][_0xfef0('0x56')]){_0x389181[_0xfef0('0x49')]=[{'all':!![]}];}return db[_0xfef0('0x5e')][_0xfef0('0x5f')](_0x389181);})[_0xfef0('0x29')](function(_0x4373a0){_0x3cd0c5[_0xfef0('0x46')]=_0x4373a0;return _0x3cd0c5;});}})[_0xfef0('0x29')](respondWithFilteredResult(_0x45ba65,_0x389181))[_0xfef0('0x47')](handleError(_0x45ba65,null));};exports[_0xfef0('0x60')]=function(_0x2240da,_0x1a61e4,_0x5d8873){var _0x26530e={'raw':!![],'where':{}};var _0x2fe46f={};var _0x196d03={'count':0x0,'rows':[]};return db[_0xfef0('0x45')][_0xfef0('0x5c')]({'where':{'id':_0x2240da[_0xfef0('0x54')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x1a61e4,null))[_0xfef0('0x29')](function(_0x32944e){if(_0x32944e){_0x2fe46f[_0xfef0('0x33')]=_[_0xfef0('0x34')](db[_0xfef0('0x61')][_0xfef0('0x55')]);_0x2fe46f['query']=_[_0xfef0('0x34')](_0x2240da['query']);_0x2fe46f['filters']=_[_0xfef0('0x36')](_0x2fe46f[_0xfef0('0x33')],_0x2fe46f['query']);_0x26530e[_0xfef0('0x37')]=_['intersection'](_0x2fe46f['model'],qs[_0xfef0('0x38')](_0x2240da[_0xfef0('0x39')][_0xfef0('0x38')]));_0x26530e[_0xfef0('0x37')]=_0x26530e['attributes'][_0xfef0('0x3a')]?_0x26530e[_0xfef0('0x37')]:_0x2fe46f['model'];if(!_0x2240da[_0xfef0('0x39')][_0xfef0('0x3b')](_0xfef0('0x3c'))){_0x26530e['limit']=qs['limit'](_0x2240da[_0xfef0('0x39')]['limit']);_0x26530e['offset']=qs[_0xfef0('0x1e')](_0x2240da['query'][_0xfef0('0x1e')]);}_0x26530e[_0xfef0('0x3d')]=qs[_0xfef0('0x3e')](_0x2240da[_0xfef0('0x39')][_0xfef0('0x3e')]);_0x26530e[_0xfef0('0x41')]=qs[_0xfef0('0x35')](_[_0xfef0('0x3f')](_0x2240da[_0xfef0('0x39')],_0x2fe46f[_0xfef0('0x35')]));_0x26530e['where'][_0xfef0('0x5d')]=_0x32944e['id'];if(_0x2240da['query']['filter']){_0x26530e[_0xfef0('0x41')]=_['merge'](_0x26530e[_0xfef0('0x41')],{'$or':_[_0xfef0('0x42')](_0x26530e[_0xfef0('0x37')],function(_0x34b802){var _0x2e5aeb={};_0x2e5aeb[_0x34b802]={'$like':'%'+_0x2240da[_0xfef0('0x39')]['filter']+'%'};return _0x2e5aeb;})});}_0x26530e=_[_0xfef0('0x57')]({},_0x26530e,_0x2240da[_0xfef0('0x44')]);return db[_0xfef0('0x61')][_0xfef0('0x21')]({'where':_0x26530e[_0xfef0('0x41')]})[_0xfef0('0x29')](function(_0x3cc27e){_0x196d03[_0xfef0('0x21')]=_0x3cc27e;if(_0x2240da['query'][_0xfef0('0x56')]){_0x26530e[_0xfef0('0x49')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xfef0('0x5f')](_0x26530e);})[_0xfef0('0x29')](function(_0x221b17){_0x196d03['rows']=_0x221b17;return _0x196d03;});}})[_0xfef0('0x29')](respondWithFilteredResult(_0x1a61e4,_0x26530e))['catch'](handleError(_0x1a61e4,null));};function char(_0x1cb952){return _0xfef0('0x62')===typeof _0x1cb952?String['fromCharCode'][_0xfef0('0x24')](null,arguments):_0x1cb952;}function needsEncapsulation(_0x51f79b){return!!_0x51f79b&&(_0x51f79b[_0xfef0('0x63')]()[_0xfef0('0x64')](char(0xd))>=0x0||_0x51f79b[_0xfef0('0x63')]()[_0xfef0('0x64')](char(0xa))>=0x0||_0x51f79b[_0xfef0('0x63')]()[_0xfef0('0x64')](char(0x2c))>=0x0||_0x51f79b[_0xfef0('0x63')]()[_0xfef0('0x64')](char(0x22))>=0x0);}function encapsulate(_0x269d51){var _0xca9e92=char(0x22),_0x31a5e2='\x5c'+char(0x22),_0x5b7ffa=_0x269d51[_0xfef0('0x63')]()['replace'](new RegExp(_0xca9e92,'g'),_0x31a5e2);return _0xca9e92+_0x5b7ffa+_0xca9e92;}exports['getSummary']=function(_0x2c7069,_0x4ff902,_0x3567d8){var _0x4ec70e,_0x4eae82;var _0x3f3689={'where':{'ProjectId':_0x2c7069['params']['id']}};if(_0x2c7069['query']['startTime']){_0x3f3689[_0xfef0('0x41')][_0xfef0('0x65')]=JSON[_0xfef0('0x66')](_0x2c7069[_0xfef0('0x39')]['startTime']);}return db[_0xfef0('0x5e')][_0xfef0('0x5f')](_0x3f3689)[_0xfef0('0x29')](handleEntityNotFound(_0x4ff902,null))[_0xfef0('0x29')](function(_0x1c16ad){if(_0x1c16ad){_0x4ec70e=_0x1c16ad;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xfef0('0x42')](_0x4ec70e,'id')},'ProjectId':_0x2c7069[_0xfef0('0x54')]['id']},'order':'-createdAt'});}})[_0xfef0('0x29')](handleEntityNotFound(_0x4ff902,null))[_0xfef0('0x29')](function(_0x3be21b){if(_0x3be21b){_0x4eae82=_0x3be21b;var _0x10ff58={};for(var _0x69217d=0x0,_0x35e50f=_0x4eae82[_0xfef0('0x3a')];_0x69217d<_0x35e50f;_0x69217d++){if(!_0x10ff58[_0xfef0('0x3b')](_0x4eae82[_0x69217d]['questionId'])){_0x10ff58[_0x4eae82[_0x69217d]['questionId']]=needsEncapsulation(_0x4eae82[_0x69217d][_0xfef0('0x67')])?encapsulate(_0x4eae82[_0x69217d][_0xfef0('0x67')]):_0x4eae82[_0x69217d][_0xfef0('0x67')];}}var _0x475eb7=[],_0x287712={};for(var _0x3a52e2=0x0,_0x40bb93=_0x4ec70e[_0xfef0('0x3a')];_0x3a52e2<_0x40bb93;_0x3a52e2++){_0x287712={'ProjectId':_0x2c7069['params']['id'],'SessionId':_0x4ec70e[_0x3a52e2]['id'],'StartTime':moment(_0x4ec70e[_0x3a52e2]['starttime'])[_0xfef0('0x68')](_0xfef0('0x69'))};for(var _0x374877=0x0,_0xd780bb=_0x4eae82[_0xfef0('0x3a')];_0x374877<_0xd780bb;_0x374877++){if(_0x4eae82[_0x374877][_0xfef0('0x6a')]==_0x4ec70e[_0x3a52e2]['id']&&_0x10ff58['hasOwnProperty'](_0x4eae82[_0x374877][_0xfef0('0x6b')])){_0x287712[_0x10ff58[_0x4eae82[_0x374877][_0xfef0('0x6b')]]]=_0x4eae82[_0x374877]['answer'];}}for(var _0x3feb62 in _0x10ff58){if(!_0x287712[_0xfef0('0x3b')](_0x10ff58[_0x3feb62])){_0x287712[_0x10ff58[_0x3feb62]]=null;}}_0x475eb7[_0xfef0('0x6c')](_0x287712);}return _0x475eb7;}})[_0xfef0('0x29')](function(_0x3b8b10){if(!_[_0xfef0('0x6d')](_0x3b8b10)){var _0x57f6dd=toCsv(_0x3b8b10);var _0x4dd6e8=Date[_0xfef0('0x6e')]();fs[_0xfef0('0x6f')](util[_0xfef0('0x68')](_0xfef0('0x70'),_0x2c7069[_0xfef0('0x54')]['id'],_0x4dd6e8),_0x57f6dd);_0x4ff902[_0xfef0('0x71')]('Content-disposition',_0xfef0('0x72')+util['format'](_0xfef0('0x73'),_0x2c7069['params']['id'],_0x4dd6e8));_0x4ff902[_0xfef0('0x71')](_0xfef0('0x74'),'text/csv');return _0x4ff902[_0xfef0('0x75')](util[_0xfef0('0x68')](_0xfef0('0x70'),_0x2c7069['params']['id'],_0x4dd6e8));}else{return _0x4ff902['sendStatus'](0xcc);}})['catch'](handleError(_0x4ff902,null));}; \ No newline at end of file +var _0x4502=['UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','hasOwnProperty','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','findAll','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','name','index','map','JscriptyProject','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x16e60d,_0xab1f7e){var _0x12162d=function(_0x5b78d2){while(--_0x5b78d2){_0x16e60d['push'](_0x16e60d['shift']());}};_0x12162d(++_0xab1f7e);}(_0x4502,0xa0));var _0x2450=function(_0x430d7c,_0xff17e8){_0x430d7c=_0x430d7c-0x0;var _0x5d322a=_0x4502[_0x430d7c];return _0x5d322a;};'use strict';var emlformat=require(_0x2450('0x0'));var rimraf=require(_0x2450('0x1'));var zipdir=require(_0x2450('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2450('0x3'));var Mustache=require(_0x2450('0x4'));var util=require('util');var path=require(_0x2450('0x5'));var sox=require(_0x2450('0x6'));var csv=require(_0x2450('0x7'));var ejs=require(_0x2450('0x8'));var fs=require('fs');var fs_extra=require(_0x2450('0x9'));var _=require('lodash');var squel=require(_0x2450('0xa'));var crypto=require('crypto');var jsforce=require(_0x2450('0xb'));var deskjs=require(_0x2450('0xc'));var toCsv=require(_0x2450('0x7'));var querystring=require(_0x2450('0xd'));var Papa=require(_0x2450('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2450('0xf'));var as=require(_0x2450('0x10'));var hardwareService=require(_0x2450('0x11'));var logger=require(_0x2450('0x12'))('api');var utils=require(_0x2450('0x13'));var config=require(_0x2450('0x14'));var licenseUtil=require(_0x2450('0x15'));var db=require(_0x2450('0x16'))['db'];function respondWithStatusCode(_0x46b49f,_0x252bee){_0x252bee=_0x252bee||0xcc;return function(_0x22bda4){if(_0x22bda4){return _0x46b49f['sendStatus'](_0x252bee);}return _0x46b49f[_0x2450('0x17')](_0x252bee)[_0x2450('0x18')]();};}function respondWithResult(_0x3bc485,_0x2b7f29){_0x2b7f29=_0x2b7f29||0xc8;return function(_0x1b1fd7){if(_0x1b1fd7){return _0x3bc485[_0x2450('0x17')](_0x2b7f29)[_0x2450('0x19')](_0x1b1fd7);}};}function respondWithFilteredResult(_0x585f22,_0x12eddd){return function(_0xc50004){if(_0xc50004){var _0x110b9a=typeof _0x12eddd[_0x2450('0x1a')]===_0x2450('0x1b')&&typeof _0x12eddd[_0x2450('0x1c')]==='undefined';var _0x2bfcfb=_0xc50004[_0x2450('0x1d')];var _0x1ae639=_0x110b9a?0x0:_0x12eddd[_0x2450('0x1a')];var _0x11b331=_0x110b9a?_0xc50004[_0x2450('0x1d')]:_0x12eddd[_0x2450('0x1a')]+_0x12eddd['limit'];var _0x59abce;if(_0x11b331>=_0x2bfcfb){_0x11b331=_0x2bfcfb;_0x59abce=0xc8;}else{_0x59abce=0xce;}_0x585f22[_0x2450('0x17')](_0x59abce);return _0x585f22[_0x2450('0x1e')]('Content-Range',_0x1ae639+'-'+_0x11b331+'/'+_0x2bfcfb)[_0x2450('0x19')](_0xc50004);}return null;};}function patchUpdates(_0x3d8968){return function(_0xf75aff){try{jsonpatch[_0x2450('0x1f')](_0xf75aff,_0x3d8968,!![]);}catch(_0x2d2ac3){return BPromise[_0x2450('0x20')](_0x2d2ac3);}return _0xf75aff[_0x2450('0x21')]();};}function saveUpdates(_0x468e19,_0x1fb375){return function(_0x2556a2){if(_0x2556a2){return _0x2556a2[_0x2450('0x22')](_0x468e19)[_0x2450('0x23')](function(_0x3276a3){return _0x3276a3;});}return null;};}function removeEntity(_0x2731dd,_0x41e185){return function(_0xd566c0){if(_0xd566c0){return _0xd566c0[_0x2450('0x24')]()['then'](function(){var _0x12fc2d=_0xd566c0[_0x2450('0x25')]({'plain':!![]});var _0x22c841=_0x2450('0x26');return db[_0x2450('0x27')]['destroy']({'where':{'type':_0x22c841,'resourceId':_0x12fc2d['id']}})[_0x2450('0x23')](function(){return _0xd566c0;});})[_0x2450('0x23')](function(){_0x2731dd[_0x2450('0x17')](0xcc)[_0x2450('0x18')]();});}};}function handleEntityNotFound(_0x566d87,_0x36ab03){return function(_0x35a844){if(!_0x35a844){_0x566d87[_0x2450('0x28')](0x194);}return _0x35a844;};}function handleError(_0x2aaaf1,_0xd9be6b){_0xd9be6b=_0xd9be6b||0x1f4;return function(_0x2ec839){logger['error'](_0x2ec839[_0x2450('0x29')]);if(_0x2ec839[_0x2450('0x2a')]){delete _0x2ec839[_0x2450('0x2a')];}_0x2aaaf1[_0x2450('0x17')](_0xd9be6b)['send'](_0x2ec839);};}exports[_0x2450('0x2b')]=function(_0x11c663,_0x1e7caf){var _0x567cb0={},_0xc6ba2={},_0x39c0d6={'count':0x0,'rows':[]};var _0x5bb42c=_[_0x2450('0x2c')](db[_0x2450('0x2d')]['rawAttributes'],function(_0x3251ff){return{'name':_0x3251ff[_0x2450('0x2e')],'type':_0x3251ff[_0x2450('0x2f')][_0x2450('0x30')]};});_0xc6ba2[_0x2450('0x31')]=_[_0x2450('0x2c')](_0x5bb42c,_0x2450('0x2a'));_0xc6ba2[_0x2450('0x32')]=_['keys'](_0x11c663[_0x2450('0x32')]);_0xc6ba2['filters']=_[_0x2450('0x33')](_0xc6ba2[_0x2450('0x31')],_0xc6ba2[_0x2450('0x32')]);_0x567cb0[_0x2450('0x34')]=_[_0x2450('0x33')](_0xc6ba2['model'],qs[_0x2450('0x35')](_0x11c663[_0x2450('0x32')][_0x2450('0x35')]));_0x567cb0['attributes']=_0x567cb0[_0x2450('0x34')][_0x2450('0x36')]?_0x567cb0[_0x2450('0x34')]:_0xc6ba2[_0x2450('0x31')];if(!_0x11c663[_0x2450('0x32')]['hasOwnProperty'](_0x2450('0x37'))){_0x567cb0[_0x2450('0x1c')]=qs[_0x2450('0x1c')](_0x11c663[_0x2450('0x32')]['limit']);_0x567cb0['offset']=qs[_0x2450('0x1a')](_0x11c663[_0x2450('0x32')][_0x2450('0x1a')]);}_0x567cb0[_0x2450('0x38')]=qs['sort'](_0x11c663[_0x2450('0x32')][_0x2450('0x39')]);_0x567cb0['where']=qs[_0x2450('0x3a')](_[_0x2450('0x3b')](_0x11c663[_0x2450('0x32')],_0xc6ba2['filters']),_0x5bb42c);if(_0x11c663[_0x2450('0x32')]['filter']){_0x567cb0[_0x2450('0x3c')]=_[_0x2450('0x3d')](_0x567cb0['where'],{'$or':_[_0x2450('0x2c')](_0x5bb42c,function(_0x1644b4){if(_0x1644b4[_0x2450('0x2f')]!==_0x2450('0x3e')){var _0xfbf18c={};_0xfbf18c[_0x1644b4[_0x2450('0x2a')]]={'$like':'%'+_0x11c663[_0x2450('0x32')][_0x2450('0x3f')]+'%'};return _0xfbf18c;}})});}_0x567cb0=_[_0x2450('0x3d')]({},_0x567cb0,_0x11c663[_0x2450('0x40')]);var _0x402d32={'where':_0x567cb0[_0x2450('0x3c')]};return db[_0x2450('0x2d')][_0x2450('0x1d')](_0x402d32)[_0x2450('0x23')](function(_0x2667b0){_0x39c0d6[_0x2450('0x1d')]=_0x2667b0;if(_0x11c663['query'][_0x2450('0x41')]){_0x567cb0[_0x2450('0x42')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x567cb0);})[_0x2450('0x23')](function(_0x41606f){_0x39c0d6[_0x2450('0x43')]=_0x41606f;return _0x39c0d6;})[_0x2450('0x23')](respondWithFilteredResult(_0x1e7caf,_0x567cb0))[_0x2450('0x44')](handleError(_0x1e7caf,null));};exports['show']=function(_0x8e9cb9,_0x11ca3e){var _0x435408={'raw':![],'where':{'id':_0x8e9cb9[_0x2450('0x45')]['id']}},_0x28722d={};_0x28722d[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x2d')][_0x2450('0x47')]);_0x28722d[_0x2450('0x32')]=_[_0x2450('0x46')](_0x8e9cb9[_0x2450('0x32')]);_0x28722d[_0x2450('0x3a')]=_['intersection'](_0x28722d['model'],_0x28722d[_0x2450('0x32')]);_0x435408[_0x2450('0x34')]=_[_0x2450('0x33')](_0x28722d[_0x2450('0x31')],qs['fields'](_0x8e9cb9[_0x2450('0x32')][_0x2450('0x35')]));_0x435408[_0x2450('0x34')]=_0x435408['attributes'][_0x2450('0x36')]?_0x435408['attributes']:_0x28722d[_0x2450('0x31')];if(_0x8e9cb9['query']['includeAll']){_0x435408['include']=[{'all':!![]}];}_0x435408=_[_0x2450('0x3d')]({},_0x435408,_0x8e9cb9[_0x2450('0x40')]);return db[_0x2450('0x2d')][_0x2450('0x48')](_0x435408)[_0x2450('0x23')](handleEntityNotFound(_0x11ca3e,null))[_0x2450('0x23')](respondWithResult(_0x11ca3e,null))[_0x2450('0x44')](handleError(_0x11ca3e,null));};exports[_0x2450('0x49')]=function(_0x57217a,_0x4e605e){return db['JscriptyProject'][_0x2450('0x49')](_0x57217a[_0x2450('0x4a')],{})[_0x2450('0x23')](function(_0x49a05d){var _0x5a6c44=_0x57217a[_0x2450('0x4b')][_0x2450('0x25')]({'plain':!![]});if(!_0x5a6c44)throw new Error(_0x2450('0x4c'));if(_0x5a6c44[_0x2450('0x4d')]==='user'){var _0x361024=_0x49a05d[_0x2450('0x25')]({'plain':!![]});var _0x2be718='Projects';return db[_0x2450('0x4e')][_0x2450('0x48')]({'where':{'name':_0x2be718,'userProfileId':_0x5a6c44[_0x2450('0x4f')]},'raw':!![]})[_0x2450('0x23')](function(_0x2b489c){if(_0x2b489c&&_0x2b489c[_0x2450('0x50')]===0x0){return db[_0x2450('0x27')][_0x2450('0x49')]({'name':_0x361024[_0x2450('0x2a')],'resourceId':_0x361024['id'],'type':_0x2b489c[_0x2450('0x2a')],'sectionId':_0x2b489c['id']},{})['then'](function(){return _0x49a05d;});}else{return _0x49a05d;}})[_0x2450('0x44')](function(_0x4df731){logger[_0x2450('0x51')](_0x2450('0x52'),_0x4df731);throw _0x4df731;});}return _0x49a05d;})[_0x2450('0x23')](respondWithResult(_0x4e605e,0xc9))['catch'](handleError(_0x4e605e,null));};exports[_0x2450('0x53')]=function(_0x19a64c,_0x156710){var _0x3e6d06={'where':{'id':_0x19a64c[_0x2450('0x45')]['id']}},_0x5b2108={};_0x5b2108[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x2d')][_0x2450('0x47')]);_0x3e6d06[_0x2450('0x34')]=_[_0x2450('0x33')](_0x5b2108[_0x2450('0x31')],qs['fields'](_0x19a64c[_0x2450('0x32')][_0x2450('0x35')]));_0x3e6d06[_0x2450('0x34')]=_0x3e6d06[_0x2450('0x34')][_0x2450('0x36')]?_0x3e6d06[_0x2450('0x34')]:_0x5b2108[_0x2450('0x31')];if(_0x19a64c[_0x2450('0x32')][_0x2450('0x41')]){_0x3e6d06[_0x2450('0x42')]=[{'all':!![]}];}_0x3e6d06=_[_0x2450('0x3d')]({},_0x3e6d06,_0x19a64c[_0x2450('0x40')]);return db[_0x2450('0x2d')][_0x2450('0x48')](_0x3e6d06)[_0x2450('0x23')](handleEntityNotFound(_0x156710,null))[_0x2450('0x23')](function(_0x8f2eaa){if(_0x8f2eaa){var _0x37bc7e=_0x8f2eaa[_0x2450('0x25')]({'plain':!![]});_0x37bc7e=qs[_0x2450('0x54')](_0x37bc7e,['id',_0x2450('0x55'),_0x2450('0x56')]);_0x19a64c[_0x2450('0x4a')]=_[_0x2450('0x54')](_0x19a64c[_0x2450('0x4a')],['id',_0x2450('0x55'),'updatedAt']);return db[_0x2450('0x2d')][_0x2450('0x49')](_[_0x2450('0x3d')](_0x37bc7e,_0x19a64c[_0x2450('0x4a')]),{'include':_0x19a64c[_0x2450('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x2450('0x23')](function(_0x3ac5ed){var _0x3eba47=_0x19a64c[_0x2450('0x4b')]['get']({'plain':!![]});if(!_0x3eba47)throw new Error(_0x2450('0x4c'));if(_0x3eba47[_0x2450('0x4d')]==='user'){var _0x5a96d4=_0x3ac5ed[_0x2450('0x25')]({'plain':!![]});var _0x1123e4=_0x2450('0x26');return db[_0x2450('0x4e')]['find']({'where':{'name':_0x1123e4,'userProfileId':_0x3eba47['userProfileId']},'raw':!![]})[_0x2450('0x23')](function(_0x514b17){if(_0x514b17&&_0x514b17[_0x2450('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a96d4[_0x2450('0x2a')],'resourceId':_0x5a96d4['id'],'type':_0x514b17['name'],'sectionId':_0x514b17['id']},{})['then'](function(){return _0x3ac5ed;});}else{return _0x3ac5ed;}})['catch'](function(_0x1c228f){logger[_0x2450('0x51')](_0x2450('0x52'),_0x1c228f);throw _0x1c228f;});}return _0x3ac5ed;});}})['then'](respondWithResult(_0x156710,0xc9))[_0x2450('0x44')](handleError(_0x156710,null));};exports['update']=function(_0x28187a,_0x418cc5){if(_0x28187a[_0x2450('0x4a')]['id']){delete _0x28187a[_0x2450('0x4a')]['id'];}return db[_0x2450('0x2d')][_0x2450('0x48')]({'where':{'id':_0x28187a['params']['id']}})[_0x2450('0x23')](handleEntityNotFound(_0x418cc5,null))[_0x2450('0x23')](saveUpdates(_0x28187a['body'],null))[_0x2450('0x23')](respondWithResult(_0x418cc5,null))[_0x2450('0x44')](handleError(_0x418cc5,null));};exports['destroy']=function(_0x208972,_0x4b0672){return db[_0x2450('0x2d')][_0x2450('0x48')]({'where':{'id':_0x208972['params']['id']}})[_0x2450('0x23')](handleEntityNotFound(_0x4b0672,null))[_0x2450('0x23')](removeEntity(_0x4b0672,null))['catch'](handleError(_0x4b0672,null));};exports[_0x2450('0x57')]=function(_0x199129,_0x3b367b,_0x493c39){var _0x42e1cc={'raw':!![],'where':{}};var _0x19a1b7={};var _0x27d4da={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2450('0x58')]({'where':{'id':_0x199129['params']['id']}})['then'](handleEntityNotFound(_0x3b367b,null))[_0x2450('0x23')](function(_0x49544a){if(_0x49544a){_0x19a1b7[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x59')][_0x2450('0x47')]);_0x19a1b7[_0x2450('0x32')]=_[_0x2450('0x46')](_0x199129[_0x2450('0x32')]);_0x19a1b7['filters']=_[_0x2450('0x33')](_0x19a1b7[_0x2450('0x31')],_0x19a1b7[_0x2450('0x32')]);_0x42e1cc[_0x2450('0x34')]=_['intersection'](_0x19a1b7[_0x2450('0x31')],qs[_0x2450('0x35')](_0x199129[_0x2450('0x32')][_0x2450('0x35')]));_0x42e1cc[_0x2450('0x34')]=_0x42e1cc[_0x2450('0x34')]['length']?_0x42e1cc[_0x2450('0x34')]:_0x19a1b7[_0x2450('0x31')];if(!_0x199129[_0x2450('0x32')]['hasOwnProperty']('nolimit')){_0x42e1cc[_0x2450('0x1c')]=qs['limit'](_0x199129[_0x2450('0x32')][_0x2450('0x1c')]);_0x42e1cc[_0x2450('0x1a')]=qs[_0x2450('0x1a')](_0x199129[_0x2450('0x32')]['offset']);}_0x42e1cc[_0x2450('0x38')]=qs[_0x2450('0x39')](_0x199129[_0x2450('0x32')][_0x2450('0x39')]);_0x42e1cc['where']=qs[_0x2450('0x3a')](_[_0x2450('0x3b')](_0x199129['query'],_0x19a1b7['filters']));_0x42e1cc[_0x2450('0x3c')][_0x2450('0x5a')]=_0x49544a['id'];if(_0x199129[_0x2450('0x32')][_0x2450('0x3f')]){_0x42e1cc['where']=_[_0x2450('0x3d')](_0x42e1cc[_0x2450('0x3c')],{'$or':_[_0x2450('0x2c')](_0x42e1cc[_0x2450('0x34')],function(_0x30836d){var _0x31a79d={};_0x31a79d[_0x30836d]={'$like':'%'+_0x199129[_0x2450('0x32')][_0x2450('0x3f')]+'%'};return _0x31a79d;})});}_0x42e1cc=_[_0x2450('0x3d')]({},_0x42e1cc,_0x199129[_0x2450('0x40')]);return db['JscriptySessionReport']['count']({'where':_0x42e1cc[_0x2450('0x3c')]})[_0x2450('0x23')](function(_0x57d348){_0x27d4da['count']=_0x57d348;if(_0x199129[_0x2450('0x32')][_0x2450('0x41')]){_0x42e1cc['include']=[{'all':!![]}];}return db[_0x2450('0x59')]['findAll'](_0x42e1cc);})[_0x2450('0x23')](function(_0x4e6a85){_0x27d4da[_0x2450('0x43')]=_0x4e6a85;return _0x27d4da;});}})['then'](respondWithFilteredResult(_0x3b367b,_0x42e1cc))[_0x2450('0x44')](handleError(_0x3b367b,null));};exports[_0x2450('0x5b')]=function(_0x43154e,_0x46cb43,_0x56de45){var _0x34424d={'raw':!![],'where':{}};var _0xab9563={};var _0x663e7c={'count':0x0,'rows':[]};return db[_0x2450('0x2d')][_0x2450('0x58')]({'where':{'id':_0x43154e[_0x2450('0x45')]['id']}})['then'](handleEntityNotFound(_0x46cb43,null))['then'](function(_0x2c2c84){if(_0x2c2c84){_0xab9563[_0x2450('0x31')]=_[_0x2450('0x46')](db[_0x2450('0x5c')][_0x2450('0x47')]);_0xab9563[_0x2450('0x32')]=_[_0x2450('0x46')](_0x43154e[_0x2450('0x32')]);_0xab9563[_0x2450('0x3a')]=_[_0x2450('0x33')](_0xab9563[_0x2450('0x31')],_0xab9563[_0x2450('0x32')]);_0x34424d[_0x2450('0x34')]=_['intersection'](_0xab9563[_0x2450('0x31')],qs['fields'](_0x43154e[_0x2450('0x32')][_0x2450('0x35')]));_0x34424d[_0x2450('0x34')]=_0x34424d[_0x2450('0x34')][_0x2450('0x36')]?_0x34424d[_0x2450('0x34')]:_0xab9563['model'];if(!_0x43154e['query'][_0x2450('0x5d')](_0x2450('0x37'))){_0x34424d[_0x2450('0x1c')]=qs[_0x2450('0x1c')](_0x43154e[_0x2450('0x32')]['limit']);_0x34424d[_0x2450('0x1a')]=qs[_0x2450('0x1a')](_0x43154e[_0x2450('0x32')][_0x2450('0x1a')]);}_0x34424d[_0x2450('0x38')]=qs['sort'](_0x43154e[_0x2450('0x32')][_0x2450('0x39')]);_0x34424d['where']=qs['filters'](_[_0x2450('0x3b')](_0x43154e['query'],_0xab9563['filters']));_0x34424d[_0x2450('0x3c')][_0x2450('0x5a')]=_0x2c2c84['id'];if(_0x43154e[_0x2450('0x32')][_0x2450('0x3f')]){_0x34424d['where']=_['merge'](_0x34424d[_0x2450('0x3c')],{'$or':_[_0x2450('0x2c')](_0x34424d[_0x2450('0x34')],function(_0x198545){var _0xcb2ccc={};_0xcb2ccc[_0x198545]={'$like':'%'+_0x43154e[_0x2450('0x32')][_0x2450('0x3f')]+'%'};return _0xcb2ccc;})});}_0x34424d=_[_0x2450('0x3d')]({},_0x34424d,_0x43154e['options']);return db[_0x2450('0x5c')][_0x2450('0x1d')]({'where':_0x34424d[_0x2450('0x3c')]})[_0x2450('0x23')](function(_0x33a1f1){_0x663e7c[_0x2450('0x1d')]=_0x33a1f1;if(_0x43154e[_0x2450('0x32')][_0x2450('0x41')]){_0x34424d[_0x2450('0x42')]=[{'all':!![]}];}return db[_0x2450('0x5c')]['findAll'](_0x34424d);})[_0x2450('0x23')](function(_0x5a6a9d){_0x663e7c['rows']=_0x5a6a9d;return _0x663e7c;});}})[_0x2450('0x23')](respondWithFilteredResult(_0x46cb43,_0x34424d))[_0x2450('0x44')](handleError(_0x46cb43,null));};function char(_0xfa6f2d){return _0x2450('0x5e')===typeof _0xfa6f2d?String['fromCharCode']['apply'](null,arguments):_0xfa6f2d;}function needsEncapsulation(_0x253ff3){return!!_0x253ff3&&(_0x253ff3[_0x2450('0x5f')]()[_0x2450('0x60')](char(0xd))>=0x0||_0x253ff3[_0x2450('0x5f')]()[_0x2450('0x60')](char(0xa))>=0x0||_0x253ff3[_0x2450('0x5f')]()[_0x2450('0x60')](char(0x2c))>=0x0||_0x253ff3[_0x2450('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5dcb73){var _0x540c1b=char(0x22),_0x2eb08c='\x5c'+char(0x22),_0x4c3219=_0x5dcb73[_0x2450('0x5f')]()[_0x2450('0x61')](new RegExp(_0x540c1b,'g'),_0x2eb08c);return _0x540c1b+_0x4c3219+_0x540c1b;}exports[_0x2450('0x62')]=function(_0x3ff662,_0xa5df28,_0x2dfcce){var _0x1ff44a,_0x2f52b0;var _0x43434a={'where':{'ProjectId':_0x3ff662[_0x2450('0x45')]['id']}};if(_0x3ff662[_0x2450('0x32')][_0x2450('0x63')]){_0x43434a[_0x2450('0x3c')][_0x2450('0x64')]=JSON[_0x2450('0x65')](_0x3ff662[_0x2450('0x32')][_0x2450('0x63')]);}return db[_0x2450('0x59')]['findAll'](_0x43434a)[_0x2450('0x23')](handleEntityNotFound(_0xa5df28,null))[_0x2450('0x23')](function(_0x1bc6b6){if(_0x1bc6b6){_0x1ff44a=_0x1bc6b6;return db[_0x2450('0x66')][_0x2450('0x67')]({'where':{'SessionId':{'$in':_['map'](_0x1ff44a,'id')},'ProjectId':_0x3ff662[_0x2450('0x45')]['id']},'order':_0x2450('0x68')});}})[_0x2450('0x23')](handleEntityNotFound(_0xa5df28,null))[_0x2450('0x23')](function(_0x339ba2){if(_0x339ba2){_0x2f52b0=_0x339ba2;var _0x3491a8={};for(var _0x45ebaa=0x0,_0x341727=_0x2f52b0[_0x2450('0x36')];_0x45ebaa<_0x341727;_0x45ebaa++){if(!_0x3491a8[_0x2450('0x5d')](_0x2f52b0[_0x45ebaa]['questionId'])){_0x3491a8[_0x2f52b0[_0x45ebaa][_0x2450('0x69')]]=needsEncapsulation(_0x2f52b0[_0x45ebaa][_0x2450('0x6a')])?encapsulate(_0x2f52b0[_0x45ebaa][_0x2450('0x6a')]):_0x2f52b0[_0x45ebaa]['question'];}}var _0x10b0df=[],_0x5e1402={};for(var _0x3dab08=0x0,_0x520366=_0x1ff44a[_0x2450('0x36')];_0x3dab08<_0x520366;_0x3dab08++){_0x5e1402={'ProjectId':_0x3ff662[_0x2450('0x45')]['id'],'SessionId':_0x1ff44a[_0x3dab08]['id'],'StartTime':moment(_0x1ff44a[_0x3dab08][_0x2450('0x64')])['format'](_0x2450('0x6b'))};for(var _0x3ca1af=0x0,_0x2fb541=_0x2f52b0[_0x2450('0x36')];_0x3ca1af<_0x2fb541;_0x3ca1af++){if(_0x2f52b0[_0x3ca1af][_0x2450('0x6c')]==_0x1ff44a[_0x3dab08]['id']&&_0x3491a8['hasOwnProperty'](_0x2f52b0[_0x3ca1af][_0x2450('0x69')])){_0x5e1402[_0x3491a8[_0x2f52b0[_0x3ca1af][_0x2450('0x69')]]]=_0x2f52b0[_0x3ca1af][_0x2450('0x6d')];}}for(var _0x1e4d99 in _0x3491a8){if(!_0x5e1402[_0x2450('0x5d')](_0x3491a8[_0x1e4d99])){_0x5e1402[_0x3491a8[_0x1e4d99]]=null;}}_0x10b0df['push'](_0x5e1402);}return _0x10b0df;}})[_0x2450('0x23')](function(_0xce526e){if(!_['isEmpty'](_0xce526e)){var _0x55a646=toCsv(_0xce526e);var _0x304934=Date[_0x2450('0x6e')]();fs[_0x2450('0x6f')](util[_0x2450('0x70')](_0x2450('0x71'),_0x3ff662[_0x2450('0x45')]['id'],_0x304934),_0x55a646);_0xa5df28[_0x2450('0x72')]('Content-disposition',_0x2450('0x73')+util[_0x2450('0x70')](_0x2450('0x74'),_0x3ff662[_0x2450('0x45')]['id'],_0x304934));_0xa5df28['setHeader']('Content-type',_0x2450('0x75'));return _0xa5df28[_0x2450('0x76')](util[_0x2450('0x70')](_0x2450('0x71'),_0x3ff662[_0x2450('0x45')]['id'],_0x304934));}else{return _0xa5df28['sendStatus'](0xcc);}})[_0x2450('0x44')](handleError(_0xa5df28,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 80829a4..526c8d2 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 _0xb66c=['jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x47e29f,_0x5363ae){var _0x5e1485=function(_0x3e3a49){while(--_0x3e3a49){_0x47e29f['push'](_0x47e29f['shift']());}};_0x5e1485(++_0x5363ae);}(_0xb66c,0x175));var _0xcb66=function(_0x322269,_0x3d9b3f){_0x322269=_0x322269-0x0;var _0x439a8c=_0xb66c[_0x322269];return _0x439a8c;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb957=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger'];(function(_0xda6c79,_0x33d237){var _0x37d374=function(_0x23638b){while(--_0x23638b){_0xda6c79['push'](_0xda6c79['shift']());}};_0x37d374(++_0x33d237);}(_0xb957,0x6d));var _0x7b95=function(_0x226c94,_0x4fce4c){_0x226c94=_0x226c94-0x0;var _0x410936=_0xb957[_0x226c94];return _0x410936;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b95('0x0'))('api');var moment=require(_0x7b95('0x1'));var BPromise=require(_0x7b95('0x2'));var rp=require(_0x7b95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var attributes=require(_0x7b95('0x6'));module[_0x7b95('0x7')]=function(_0x19ff14,_0x518099){return _0x19ff14[_0x7b95('0x8')](_0x7b95('0x9'),attributes,{'tableName':_0x7b95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 7ab6e3f..7d02231 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xda3f,0xec));var _0xfda3=function(_0x207feb,_0x32ab84){_0x207feb=_0x207feb-0x0;var _0x4f731b=_0xda3f[_0x207feb];return _0x4f731b;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1020e6,_0x5b3901){var _0x44ee20=function(_0x230987){while(--_0x230987){_0x1020e6['push'](_0x1020e6['shift']());}};_0x44ee20(++_0x5b3901);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d01527c..ff14d20 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 _0x5ed2=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x42ecb5,_0x20b4d2){var _0x487442=function(_0x555189){while(--_0x555189){_0x42ecb5['push'](_0x42ecb5['shift']());}};_0x487442(++_0x20b4d2);}(_0x5ed2,0x187));var _0x25ed=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0x5ed2[_0x1e3c02];return _0x4d26d7;};'use strict';var multer=require(_0x25ed('0x0'));var util=require(_0x25ed('0x1'));var path=require(_0x25ed('0x2'));var timeout=require(_0x25ed('0x3'));var express=require(_0x25ed('0x4'));var router=express[_0x25ed('0x5')]();var fs_extra=require(_0x25ed('0x6'));var auth=require(_0x25ed('0x7'));var interaction=require(_0x25ed('0x8'));var config=require(_0x25ed('0x9'));var controller=require('./jscriptyQuestionReport.controller');router[_0x25ed('0xa')]('/',auth[_0x25ed('0xb')](),controller['index']);router[_0x25ed('0xa')](_0x25ed('0xc'),auth[_0x25ed('0xb')](),controller[_0x25ed('0xd')]);router['get'](_0x25ed('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x25ed('0xf')]('/',auth[_0x25ed('0xb')](),controller[_0x25ed('0x10')]);router[_0x25ed('0x11')](_0x25ed('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x25ed('0x12')](_0x25ed('0xe'),auth[_0x25ed('0xb')](),controller['destroy']);module[_0x25ed('0x13')]=router; \ No newline at end of file +var _0x23a8=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x23a8,0xd1));var _0x823a=function(_0x240837,_0x3dc212){_0x240837=_0x240837-0x0;var _0x36bd37=_0x23a8[_0x240837];return _0x36bd37;};'use strict';var multer=require(_0x823a('0x0'));var util=require(_0x823a('0x1'));var path=require(_0x823a('0x2'));var timeout=require(_0x823a('0x3'));var express=require(_0x823a('0x4'));var router=express['Router']();var fs_extra=require(_0x823a('0x5'));var auth=require(_0x823a('0x6'));var interaction=require(_0x823a('0x7'));var config=require('../../config/environment');var controller=require(_0x823a('0x8'));router[_0x823a('0x9')]('/',auth[_0x823a('0xa')](),controller[_0x823a('0xb')]);router[_0x823a('0x9')](_0x823a('0xc'),auth[_0x823a('0xa')](),controller[_0x823a('0xd')]);router[_0x823a('0x9')](_0x823a('0xe'),auth[_0x823a('0xa')](),controller[_0x823a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x823a('0x10')]);router['put'](_0x823a('0xe'),auth[_0x823a('0xa')](),controller[_0x823a('0x11')]);router[_0x823a('0x12')](_0x823a('0xe'),auth[_0x823a('0xa')](),controller[_0x823a('0x13')]);module[_0x823a('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 17be2be..39cf85a 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x5b7a45,_0x45ee77){_0x5b7a45=_0x5b7a45-0x0;var _0x5c833d=_0x7a54[_0x5b7a45];return _0x5c833d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x4a0d44,_0xce757c){_0x4a0d44=_0x4a0d44-0x0;var _0x1bb33b=_0x7a54[_0x4a0d44];return _0x1bb33b;};'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 aaeb953..4800700 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 _0xbab7=['body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','JscriptyQuestionReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','merge','includeAll','rows','catch','show','rawAttributes','options','find','create'];(function(_0x4283c0,_0xc694d5){var _0x6b47ab=function(_0x4a8f0){while(--_0x4a8f0){_0x4283c0['push'](_0x4283c0['shift']());}};_0x6b47ab(++_0xc694d5);}(_0xbab7,0xdb));var _0x7bab=function(_0x577906,_0x220854){_0x577906=_0x577906-0x0;var _0x177b78=_0xbab7[_0x577906];return _0x177b78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bab('0x0'));var zipdir=require(_0x7bab('0x1'));var jsonpatch=require(_0x7bab('0x2'));var rp=require(_0x7bab('0x3'));var moment=require(_0x7bab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7bab('0x5'));var util=require(_0x7bab('0x6'));var path=require('path');var sox=require(_0x7bab('0x7'));var csv=require('to-csv');var ejs=require(_0x7bab('0x8'));var fs=require('fs');var fs_extra=require(_0x7bab('0x9'));var _=require('lodash');var squel=require(_0x7bab('0xa'));var crypto=require('crypto');var jsforce=require(_0x7bab('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7bab('0xc'));var querystring=require(_0x7bab('0xd'));var Papa=require(_0x7bab('0xe'));var Redis=require(_0x7bab('0xf'));var authService=require(_0x7bab('0x10'));var qs=require(_0x7bab('0x11'));var as=require(_0x7bab('0x12'));var hardwareService=require(_0x7bab('0x13'));var logger=require('../../config/logger')(_0x7bab('0x14'));var utils=require(_0x7bab('0x15'));var config=require(_0x7bab('0x16'));var licenseUtil=require(_0x7bab('0x17'));var db=require(_0x7bab('0x18'))['db'];function respondWithStatusCode(_0x2c639c,_0x3436d){_0x3436d=_0x3436d||0xcc;return function(_0xf07cdd){if(_0xf07cdd){return _0x2c639c[_0x7bab('0x19')](_0x3436d);}return _0x2c639c['status'](_0x3436d)[_0x7bab('0x1a')]();};}function respondWithResult(_0xdc562d,_0x3c9b24){_0x3c9b24=_0x3c9b24||0xc8;return function(_0x33c1da){if(_0x33c1da){return _0xdc562d[_0x7bab('0x1b')](_0x3c9b24)[_0x7bab('0x1c')](_0x33c1da);}};}function respondWithFilteredResult(_0x4f744c,_0x1702e5){return function(_0x564fb6){if(_0x564fb6){var _0x23e18d=typeof _0x1702e5[_0x7bab('0x1d')]==='undefined'&&typeof _0x1702e5['limit']==='undefined';var _0x4b16f0=_0x564fb6[_0x7bab('0x1e')];var _0x3792ac=_0x23e18d?0x0:_0x1702e5[_0x7bab('0x1d')];var _0x40b12a=_0x23e18d?_0x564fb6[_0x7bab('0x1e')]:_0x1702e5[_0x7bab('0x1d')]+_0x1702e5[_0x7bab('0x1f')];var _0x8d11bd;if(_0x40b12a>=_0x4b16f0){_0x40b12a=_0x4b16f0;_0x8d11bd=0xc8;}else{_0x8d11bd=0xce;}_0x4f744c[_0x7bab('0x1b')](_0x8d11bd);return _0x4f744c[_0x7bab('0x20')](_0x7bab('0x21'),_0x3792ac+'-'+_0x40b12a+'/'+_0x4b16f0)['json'](_0x564fb6);}return null;};}function patchUpdates(_0xfeec4b){return function(_0x74a0f9){try{jsonpatch['apply'](_0x74a0f9,_0xfeec4b,!![]);}catch(_0x4d0d07){return BPromise[_0x7bab('0x22')](_0x4d0d07);}return _0x74a0f9[_0x7bab('0x23')]();};}function saveUpdates(_0x5432dc,_0x549737){return function(_0x181547){if(_0x181547){return _0x181547[_0x7bab('0x24')](_0x5432dc)[_0x7bab('0x25')](function(_0x6d8061){return _0x6d8061;});}return null;};}function removeEntity(_0xecfb08,_0x299b94){return function(_0x4bd111){if(_0x4bd111){return _0x4bd111['destroy']()[_0x7bab('0x25')](function(){_0xecfb08[_0x7bab('0x1b')](0xcc)[_0x7bab('0x1a')]();});}};}function handleEntityNotFound(_0xcdad62,_0x4fc123){return function(_0x365667){if(!_0x365667){_0xcdad62[_0x7bab('0x19')](0x194);}return _0x365667;};}function handleError(_0xbc8378,_0x5bfb94){_0x5bfb94=_0x5bfb94||0x1f4;return function(_0x3798ad){logger[_0x7bab('0x26')](_0x3798ad[_0x7bab('0x27')]);if(_0x3798ad['name']){delete _0x3798ad[_0x7bab('0x28')];}_0xbc8378[_0x7bab('0x1b')](_0x5bfb94)[_0x7bab('0x29')](_0x3798ad);};}exports['index']=function(_0x16f8ce,_0x5571c6){var _0x3a7d13={},_0x512499={},_0x4f7a84={'count':0x0,'rows':[]};var _0x32a6bf=_['map'](db[_0x7bab('0x2a')]['rawAttributes'],function(_0x377b45){return{'name':_0x377b45['fieldName'],'type':_0x377b45[_0x7bab('0x2b')][_0x7bab('0x2c')]};});_0x512499[_0x7bab('0x2d')]=_['map'](_0x32a6bf,'name');_0x512499[_0x7bab('0x2e')]=_[_0x7bab('0x2f')](_0x16f8ce[_0x7bab('0x2e')]);_0x512499[_0x7bab('0x30')]=_[_0x7bab('0x31')](_0x512499[_0x7bab('0x2d')],_0x512499[_0x7bab('0x2e')]);_0x3a7d13[_0x7bab('0x32')]=_['intersection'](_0x512499[_0x7bab('0x2d')],qs['fields'](_0x16f8ce[_0x7bab('0x2e')][_0x7bab('0x33')]));_0x3a7d13[_0x7bab('0x32')]=_0x3a7d13[_0x7bab('0x32')][_0x7bab('0x34')]?_0x3a7d13[_0x7bab('0x32')]:_0x512499[_0x7bab('0x2d')];if(!_0x16f8ce[_0x7bab('0x2e')][_0x7bab('0x35')](_0x7bab('0x36'))){_0x3a7d13[_0x7bab('0x1f')]=qs[_0x7bab('0x1f')](_0x16f8ce['query'][_0x7bab('0x1f')]);_0x3a7d13['offset']=qs[_0x7bab('0x1d')](_0x16f8ce[_0x7bab('0x2e')][_0x7bab('0x1d')]);}_0x3a7d13[_0x7bab('0x37')]=qs[_0x7bab('0x38')](_0x16f8ce['query'][_0x7bab('0x38')]);_0x3a7d13['where']=qs[_0x7bab('0x30')](_['pick'](_0x16f8ce['query'],_0x512499[_0x7bab('0x30')]),_0x32a6bf);if(_0x16f8ce[_0x7bab('0x2e')][_0x7bab('0x39')]){_0x3a7d13[_0x7bab('0x3a')]=_['merge'](_0x3a7d13[_0x7bab('0x3a')],{'$or':_[_0x7bab('0x3b')](_0x32a6bf,function(_0x468f26){if(_0x468f26['type']!=='VIRTUAL'){var _0x19965e={};_0x19965e[_0x468f26['name']]={'$like':'%'+_0x16f8ce[_0x7bab('0x2e')][_0x7bab('0x39')]+'%'};return _0x19965e;}})});}_0x3a7d13=_[_0x7bab('0x3c')]({},_0x3a7d13,_0x16f8ce['options']);var _0x59d479={'where':_0x3a7d13[_0x7bab('0x3a')]};return db[_0x7bab('0x2a')][_0x7bab('0x1e')](_0x59d479)['then'](function(_0x4c8fbf){_0x4f7a84[_0x7bab('0x1e')]=_0x4c8fbf;if(_0x16f8ce[_0x7bab('0x2e')][_0x7bab('0x3d')]){_0x3a7d13['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x3a7d13);})[_0x7bab('0x25')](function(_0x1119ba){_0x4f7a84[_0x7bab('0x3e')]=_0x1119ba;return _0x4f7a84;})[_0x7bab('0x25')](respondWithFilteredResult(_0x5571c6,_0x3a7d13))[_0x7bab('0x3f')](handleError(_0x5571c6,null));};exports[_0x7bab('0x40')]=function(_0x265fc4,_0x1dc9ee){var _0x2d3dd4={'raw':!![],'where':{'id':_0x265fc4['params']['id']}},_0x200a40={};_0x200a40[_0x7bab('0x2d')]=_[_0x7bab('0x2f')](db['JscriptyQuestionReport'][_0x7bab('0x41')]);_0x200a40[_0x7bab('0x2e')]=_[_0x7bab('0x2f')](_0x265fc4['query']);_0x200a40[_0x7bab('0x30')]=_[_0x7bab('0x31')](_0x200a40[_0x7bab('0x2d')],_0x200a40[_0x7bab('0x2e')]);_0x2d3dd4[_0x7bab('0x32')]=_[_0x7bab('0x31')](_0x200a40[_0x7bab('0x2d')],qs[_0x7bab('0x33')](_0x265fc4[_0x7bab('0x2e')][_0x7bab('0x33')]));_0x2d3dd4[_0x7bab('0x32')]=_0x2d3dd4[_0x7bab('0x32')][_0x7bab('0x34')]?_0x2d3dd4[_0x7bab('0x32')]:_0x200a40['model'];if(_0x265fc4[_0x7bab('0x2e')][_0x7bab('0x3d')]){_0x2d3dd4['include']=[{'all':!![]}];}_0x2d3dd4=_[_0x7bab('0x3c')]({},_0x2d3dd4,_0x265fc4[_0x7bab('0x42')]);return db[_0x7bab('0x2a')][_0x7bab('0x43')](_0x2d3dd4)[_0x7bab('0x25')](handleEntityNotFound(_0x1dc9ee,null))['then'](respondWithResult(_0x1dc9ee,null))[_0x7bab('0x3f')](handleError(_0x1dc9ee,null));};exports[_0x7bab('0x44')]=function(_0x6def19,_0x33ae15){return db['JscriptyQuestionReport'][_0x7bab('0x44')](_0x6def19['body'],{})[_0x7bab('0x25')](respondWithResult(_0x33ae15,0xc9))[_0x7bab('0x3f')](handleError(_0x33ae15,null));};exports[_0x7bab('0x24')]=function(_0x424461,_0x57dcdc){if(_0x424461[_0x7bab('0x45')]['id']){delete _0x424461[_0x7bab('0x45')]['id'];}return db['JscriptyQuestionReport'][_0x7bab('0x43')]({'where':{'id':_0x424461[_0x7bab('0x46')]['id']}})[_0x7bab('0x25')](handleEntityNotFound(_0x57dcdc,null))[_0x7bab('0x25')](saveUpdates(_0x424461[_0x7bab('0x45')],null))['then'](respondWithResult(_0x57dcdc,null))[_0x7bab('0x3f')](handleError(_0x57dcdc,null));};exports['destroy']=function(_0x3805d5,_0x3be998){return db[_0x7bab('0x2a')][_0x7bab('0x43')]({'where':{'id':_0x3805d5[_0x7bab('0x46')]['id']}})['then'](handleEntityNotFound(_0x3be998,null))[_0x7bab('0x25')](removeEntity(_0x3be998,null))['catch'](handleError(_0x3be998,null));};exports[_0x7bab('0x47')]=function(_0x395201,_0x20d648){return db[_0x7bab('0x2a')][_0x7bab('0x47')]()[_0x7bab('0x25')](respondWithResult(_0x20d648,null))['catch'](handleError(_0x20d648,null));}; \ No newline at end of file +var _0x5a5a=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','sort','pick','filter','where','findAll','rows','show','params','fields','include','merge','options','catch','create','body','update','find','describe','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1e6f49,_0x536d8e){var _0x528779=function(_0x206619){while(--_0x206619){_0x1e6f49['push'](_0x1e6f49['shift']());}};_0x528779(++_0x536d8e);}(_0x5a5a,0x191));var _0xa5a5=function(_0x589eb4,_0xaa2019){_0x589eb4=_0x589eb4-0x0;var _0xf50816=_0x5a5a[_0x589eb4];return _0xf50816;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5a5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5a5('0x1'));var rp=require('request-promise');var moment=require(_0xa5a5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5a5('0x3'));var sox=require(_0xa5a5('0x4'));var csv=require(_0xa5a5('0x5'));var ejs=require(_0xa5a5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5a5('0x7'));var squel=require(_0xa5a5('0x8'));var crypto=require('crypto');var jsforce=require(_0xa5a5('0x9'));var deskjs=require(_0xa5a5('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa5a5('0xb'));var authService=require(_0xa5a5('0xc'));var qs=require(_0xa5a5('0xd'));var as=require(_0xa5a5('0xe'));var hardwareService=require(_0xa5a5('0xf'));var logger=require(_0xa5a5('0x10'))(_0xa5a5('0x11'));var utils=require('../../config/utils');var config=require(_0xa5a5('0x12'));var licenseUtil=require(_0xa5a5('0x13'));var db=require(_0xa5a5('0x14'))['db'];function respondWithStatusCode(_0x285a52,_0x7408a6){_0x7408a6=_0x7408a6||0xcc;return function(_0x2f20e1){if(_0x2f20e1){return _0x285a52['sendStatus'](_0x7408a6);}return _0x285a52[_0xa5a5('0x15')](_0x7408a6)[_0xa5a5('0x16')]();};}function respondWithResult(_0x34aeec,_0x81c371){_0x81c371=_0x81c371||0xc8;return function(_0x282757){if(_0x282757){return _0x34aeec['status'](_0x81c371)[_0xa5a5('0x17')](_0x282757);}};}function respondWithFilteredResult(_0x19f33a,_0x34047f){return function(_0xad442d){if(_0xad442d){var _0x4131ca=typeof _0x34047f[_0xa5a5('0x18')]===_0xa5a5('0x19')&&typeof _0x34047f[_0xa5a5('0x1a')]===_0xa5a5('0x19');var _0x4bb668=_0xad442d[_0xa5a5('0x1b')];var _0x44d2a4=_0x4131ca?0x0:_0x34047f[_0xa5a5('0x18')];var _0x1965a0=_0x4131ca?_0xad442d['count']:_0x34047f[_0xa5a5('0x18')]+_0x34047f[_0xa5a5('0x1a')];var _0xaa276;if(_0x1965a0>=_0x4bb668){_0x1965a0=_0x4bb668;_0xaa276=0xc8;}else{_0xaa276=0xce;}_0x19f33a[_0xa5a5('0x15')](_0xaa276);return _0x19f33a['set'](_0xa5a5('0x1c'),_0x44d2a4+'-'+_0x1965a0+'/'+_0x4bb668)[_0xa5a5('0x17')](_0xad442d);}return null;};}function patchUpdates(_0x5ac75e){return function(_0x3c0920){try{jsonpatch[_0xa5a5('0x1d')](_0x3c0920,_0x5ac75e,!![]);}catch(_0xb9547f){return BPromise[_0xa5a5('0x1e')](_0xb9547f);}return _0x3c0920[_0xa5a5('0x1f')]();};}function saveUpdates(_0x2a2fdc,_0x40531e){return function(_0x4618f4){if(_0x4618f4){return _0x4618f4['update'](_0x2a2fdc)[_0xa5a5('0x20')](function(_0x3042a1){return _0x3042a1;});}return null;};}function removeEntity(_0x4149a7,_0x1578bf){return function(_0x5113b4){if(_0x5113b4){return _0x5113b4[_0xa5a5('0x21')]()[_0xa5a5('0x20')](function(){_0x4149a7[_0xa5a5('0x15')](0xcc)[_0xa5a5('0x16')]();});}};}function handleEntityNotFound(_0x2391e3,_0x1bd72e){return function(_0x405d73){if(!_0x405d73){_0x2391e3[_0xa5a5('0x22')](0x194);}return _0x405d73;};}function handleError(_0x59b0d5,_0x176928){_0x176928=_0x176928||0x1f4;return function(_0x1affa6){logger['error'](_0x1affa6[_0xa5a5('0x23')]);if(_0x1affa6[_0xa5a5('0x24')]){delete _0x1affa6['name'];}_0x59b0d5[_0xa5a5('0x15')](_0x176928)[_0xa5a5('0x25')](_0x1affa6);};}exports[_0xa5a5('0x26')]=function(_0x549881,_0x3e8659){var _0x584706={},_0x411a61={},_0x21a370={'count':0x0,'rows':[]};var _0x6df566=_[_0xa5a5('0x27')](db[_0xa5a5('0x28')]['rawAttributes'],function(_0x184962){return{'name':_0x184962[_0xa5a5('0x29')],'type':_0x184962[_0xa5a5('0x2a')][_0xa5a5('0x2b')]};});_0x411a61['model']=_[_0xa5a5('0x27')](_0x6df566,_0xa5a5('0x24'));_0x411a61[_0xa5a5('0x2c')]=_[_0xa5a5('0x2d')](_0x549881[_0xa5a5('0x2c')]);_0x411a61[_0xa5a5('0x2e')]=_[_0xa5a5('0x2f')](_0x411a61[_0xa5a5('0x30')],_0x411a61[_0xa5a5('0x2c')]);_0x584706[_0xa5a5('0x31')]=_['intersection'](_0x411a61[_0xa5a5('0x30')],qs['fields'](_0x549881[_0xa5a5('0x2c')]['fields']));_0x584706[_0xa5a5('0x31')]=_0x584706[_0xa5a5('0x31')][_0xa5a5('0x32')]?_0x584706[_0xa5a5('0x31')]:_0x411a61[_0xa5a5('0x30')];if(!_0x549881[_0xa5a5('0x2c')]['hasOwnProperty'](_0xa5a5('0x33'))){_0x584706[_0xa5a5('0x1a')]=qs[_0xa5a5('0x1a')](_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x1a')]);_0x584706[_0xa5a5('0x18')]=qs[_0xa5a5('0x18')](_0x549881['query']['offset']);}_0x584706['order']=qs['sort'](_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x34')]);_0x584706['where']=qs['filters'](_[_0xa5a5('0x35')](_0x549881[_0xa5a5('0x2c')],_0x411a61[_0xa5a5('0x2e')]),_0x6df566);if(_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x36')]){_0x584706[_0xa5a5('0x37')]=_['merge'](_0x584706['where'],{'$or':_[_0xa5a5('0x27')](_0x6df566,function(_0x51ae43){if(_0x51ae43[_0xa5a5('0x2a')]!=='VIRTUAL'){var _0x5c84ee={};_0x5c84ee[_0x51ae43[_0xa5a5('0x24')]]={'$like':'%'+_0x549881[_0xa5a5('0x2c')][_0xa5a5('0x36')]+'%'};return _0x5c84ee;}})});}_0x584706=_['merge']({},_0x584706,_0x549881['options']);var _0x1eef78={'where':_0x584706[_0xa5a5('0x37')]};return db[_0xa5a5('0x28')][_0xa5a5('0x1b')](_0x1eef78)[_0xa5a5('0x20')](function(_0x5ada97){_0x21a370['count']=_0x5ada97;if(_0x549881['query']['includeAll']){_0x584706['include']=[{'all':!![]}];}return db[_0xa5a5('0x28')][_0xa5a5('0x38')](_0x584706);})[_0xa5a5('0x20')](function(_0x266c0e){_0x21a370[_0xa5a5('0x39')]=_0x266c0e;return _0x21a370;})[_0xa5a5('0x20')](respondWithFilteredResult(_0x3e8659,_0x584706))['catch'](handleError(_0x3e8659,null));};exports[_0xa5a5('0x3a')]=function(_0x1a32c8,_0x4b6686){var _0x3d51e9={'raw':!![],'where':{'id':_0x1a32c8[_0xa5a5('0x3b')]['id']}},_0x450ca2={};_0x450ca2[_0xa5a5('0x30')]=_[_0xa5a5('0x2d')](db[_0xa5a5('0x28')]['rawAttributes']);_0x450ca2[_0xa5a5('0x2c')]=_[_0xa5a5('0x2d')](_0x1a32c8[_0xa5a5('0x2c')]);_0x450ca2['filters']=_[_0xa5a5('0x2f')](_0x450ca2['model'],_0x450ca2[_0xa5a5('0x2c')]);_0x3d51e9[_0xa5a5('0x31')]=_[_0xa5a5('0x2f')](_0x450ca2[_0xa5a5('0x30')],qs[_0xa5a5('0x3c')](_0x1a32c8['query'][_0xa5a5('0x3c')]));_0x3d51e9['attributes']=_0x3d51e9[_0xa5a5('0x31')][_0xa5a5('0x32')]?_0x3d51e9[_0xa5a5('0x31')]:_0x450ca2[_0xa5a5('0x30')];if(_0x1a32c8[_0xa5a5('0x2c')]['includeAll']){_0x3d51e9[_0xa5a5('0x3d')]=[{'all':!![]}];}_0x3d51e9=_[_0xa5a5('0x3e')]({},_0x3d51e9,_0x1a32c8[_0xa5a5('0x3f')]);return db[_0xa5a5('0x28')]['find'](_0x3d51e9)[_0xa5a5('0x20')](handleEntityNotFound(_0x4b6686,null))[_0xa5a5('0x20')](respondWithResult(_0x4b6686,null))[_0xa5a5('0x40')](handleError(_0x4b6686,null));};exports[_0xa5a5('0x41')]=function(_0x181eb4,_0x1b6c79){return db[_0xa5a5('0x28')][_0xa5a5('0x41')](_0x181eb4[_0xa5a5('0x42')],{})[_0xa5a5('0x20')](respondWithResult(_0x1b6c79,0xc9))[_0xa5a5('0x40')](handleError(_0x1b6c79,null));};exports[_0xa5a5('0x43')]=function(_0x59215b,_0x8a0489){if(_0x59215b[_0xa5a5('0x42')]['id']){delete _0x59215b[_0xa5a5('0x42')]['id'];}return db[_0xa5a5('0x28')][_0xa5a5('0x44')]({'where':{'id':_0x59215b[_0xa5a5('0x3b')]['id']}})['then'](handleEntityNotFound(_0x8a0489,null))[_0xa5a5('0x20')](saveUpdates(_0x59215b['body'],null))[_0xa5a5('0x20')](respondWithResult(_0x8a0489,null))[_0xa5a5('0x40')](handleError(_0x8a0489,null));};exports[_0xa5a5('0x21')]=function(_0x6d293a,_0x2a72e1){return db[_0xa5a5('0x28')][_0xa5a5('0x44')]({'where':{'id':_0x6d293a['params']['id']}})['then'](handleEntityNotFound(_0x2a72e1,null))[_0xa5a5('0x20')](removeEntity(_0x2a72e1,null))['catch'](handleError(_0x2a72e1,null));};exports[_0xa5a5('0x45')]=function(_0x510407,_0x3b6918){return db[_0xa5a5('0x28')][_0xa5a5('0x45')]()[_0xa5a5('0x20')](respondWithResult(_0x3b6918,null))[_0xa5a5('0x40')](handleError(_0x3b6918,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index df98c3d..978ce0b 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 _0x42df=['define','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x580bed,_0x2f204a){var _0x2d4838=function(_0x4830a9){while(--_0x4830a9){_0x580bed['push'](_0x580bed['shift']());}};_0x2d4838(++_0x2f204a);}(_0x42df,0x7b));var _0xf42d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x42df[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xf42d('0x0'));var logger=require(_0xf42d('0x1'))(_0xf42d('0x2'));var moment=require(_0xf42d('0x3'));var BPromise=require(_0xf42d('0x4'));var rp=require(_0xf42d('0x5'));var fs=require('fs');var path=require(_0xf42d('0x6'));var rimraf=require(_0xf42d('0x7'));var config=require(_0xf42d('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x1451dc,_0x1c722){return _0x1451dc[_0xf42d('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0xf42d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2144=['moment','bluebird','path','rimraf','./jscriptyQuestionReport.attributes','exports','lodash','util','../../config/logger','api'];(function(_0xd44397,_0x3111b4){var _0x4cd1f8=function(_0x430274){while(--_0x430274){_0xd44397['push'](_0xd44397['shift']());}};_0x4cd1f8(++_0x3111b4);}(_0x2144,0x15a));var _0x4214=function(_0x4071cc,_0x2ba75f){_0x4071cc=_0x4071cc-0x0;var _0x2f2f8c=_0x2144[_0x4071cc];return _0x2f2f8c;};'use strict';var _=require(_0x4214('0x0'));var util=require(_0x4214('0x1'));var logger=require(_0x4214('0x2'))(_0x4214('0x3'));var moment=require(_0x4214('0x4'));var BPromise=require(_0x4214('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4214('0x6'));var rimraf=require(_0x4214('0x7'));var config=require('../../config/environment');var attributes=require(_0x4214('0x8'));module[_0x4214('0x9')]=function(_0x44a7ee,_0x3c1c44){return _0x44a7ee['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 230712c..296c61b 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 _0xf627=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x2315b9,_0x995911){var _0x518780=function(_0x32ffd3){while(--_0x32ffd3){_0x2315b9['push'](_0x2315b9['shift']());}};_0x518780(++_0x995911);}(_0xf627,0xac));var _0x7f62=function(_0x4f2c7c,_0x2bd7f){_0x4f2c7c=_0x4f2c7c-0x0;var _0x27463f=_0xf627[_0x4f2c7c];return _0x27463f;};'use strict';var _=require(_0x7f62('0x0'));var util=require(_0x7f62('0x1'));var moment=require(_0x7f62('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f62('0x3'));var fs=require('fs');var Redis=require(_0x7f62('0x4'));var db=require(_0x7f62('0x5'))['db'];var utils=require(_0x7f62('0x6'));var logger=require(_0x7f62('0x7'))(_0x7f62('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f62('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x128ee7,_0xeaa735,_0x247162){return new BPromise(function(_0x57f360,_0x939ca0){return client[_0x7f62('0xa')](_0x128ee7,_0x247162)['then'](function(_0x4b4195){logger[_0x7f62('0xb')](_0x7f62('0xc'),_0xeaa735,_0x7f62('0xd'));logger[_0x7f62('0xe')](_0x7f62('0xf'),_0xeaa735,_0x7f62('0xd'),JSON[_0x7f62('0x10')](_0x4b4195));if(_0x4b4195[_0x7f62('0x11')]){if(_0x4b4195[_0x7f62('0x11')][_0x7f62('0x12')]===0x1f4){logger['error'](_0x7f62('0xc'),_0xeaa735,_0x4b4195[_0x7f62('0x11')][_0x7f62('0x13')]);return _0x939ca0(_0x4b4195[_0x7f62('0x11')][_0x7f62('0x13')]);}logger[_0x7f62('0x11')](_0x7f62('0xc'),_0xeaa735,_0x4b4195[_0x7f62('0x11')][_0x7f62('0x13')]);return _0x57f360(_0x4b4195[_0x7f62('0x11')][_0x7f62('0x13')]);}else{logger['info'](_0x7f62('0xc'),_0xeaa735,_0x7f62('0xd'));_0x57f360(_0x4b4195[_0x7f62('0x14')][_0x7f62('0x13')]);}})[_0x7f62('0x15')](function(_0x39f5bd){logger[_0x7f62('0x11')](_0x7f62('0xc'),_0xeaa735,_0x39f5bd);_0x939ca0(_0x39f5bd);});});} \ No newline at end of file +var _0xdf04=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x4d6f1e,_0x39bdc6){var _0x353276=function(_0x592922){while(--_0x592922){_0x4d6f1e['push'](_0x4d6f1e['shift']());}};_0x353276(++_0x39bdc6);}(_0xdf04,0x162));var _0x4df0=function(_0x44207b,_0x51e14b){_0x44207b=_0x44207b-0x0;var _0x881624=_0xdf04[_0x44207b];return _0x881624;};'use strict';var _=require(_0x4df0('0x0'));var util=require(_0x4df0('0x1'));var moment=require(_0x4df0('0x2'));var BPromise=require(_0x4df0('0x3'));var rs=require(_0x4df0('0x4'));var fs=require('fs');var Redis=require(_0x4df0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4df0('0x6'));var logger=require(_0x4df0('0x7'))(_0x4df0('0x8'));var config=require('../../config/environment');var jayson=require(_0x4df0('0x9'));var client=jayson[_0x4df0('0xa')][_0x4df0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf40,_0x2da3d6,_0x387e3a){return new BPromise(function(_0x2a0d6d,_0x54f69d){return client[_0x4df0('0xc')](_0x4bdf40,_0x387e3a)['then'](function(_0x3f55c5){logger[_0x4df0('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2da3d6,'request\x20sent');logger[_0x4df0('0xe')](_0x4df0('0xf'),_0x2da3d6,_0x4df0('0x10'),JSON[_0x4df0('0x11')](_0x3f55c5));if(_0x3f55c5[_0x4df0('0x12')]){if(_0x3f55c5['error']['code']===0x1f4){logger[_0x4df0('0x12')](_0x4df0('0x13'),_0x2da3d6,_0x3f55c5['error']['message']);return _0x54f69d(_0x3f55c5['error']['message']);}logger[_0x4df0('0x12')](_0x4df0('0x13'),_0x2da3d6,_0x3f55c5[_0x4df0('0x12')]['message']);return _0x2a0d6d(_0x3f55c5[_0x4df0('0x12')][_0x4df0('0x14')]);}else{logger[_0x4df0('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2da3d6,_0x4df0('0x10'));_0x2a0d6d(_0x3f55c5[_0x4df0('0x15')][_0x4df0('0x14')]);}})[_0x4df0('0x16')](function(_0x5b4b7b){logger[_0x4df0('0x12')](_0x4df0('0x13'),_0x2da3d6,_0x5b4b7b);_0x54f69d(_0x5b4b7b);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ad90e40..5555c28 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 _0x440b=['put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','show','/:id/questions','getQuestions','post','create'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x440b,0x83));var _0xb440=function(_0x20c159,_0x5e151a){_0x20c159=_0x20c159-0x0;var _0x3b48f7=_0x440b[_0x20c159];return _0x3b48f7;};'use strict';var multer=require(_0xb440('0x0'));var util=require(_0xb440('0x1'));var path=require(_0xb440('0x2'));var timeout=require(_0xb440('0x3'));var express=require(_0xb440('0x4'));var router=express[_0xb440('0x5')]();var fs_extra=require(_0xb440('0x6'));var auth=require(_0xb440('0x7'));var interaction=require(_0xb440('0x8'));var config=require('../../config/environment');var controller=require(_0xb440('0x9'));router[_0xb440('0xa')]('/',auth[_0xb440('0xb')](),controller[_0xb440('0xc')]);router[_0xb440('0xa')]('/describe',auth[_0xb440('0xb')](),controller[_0xb440('0xd')]);router[_0xb440('0xa')]('/:id',auth[_0xb440('0xb')](),controller[_0xb440('0xe')]);router[_0xb440('0xa')](_0xb440('0xf'),auth[_0xb440('0xb')](),controller[_0xb440('0x10')]);router[_0xb440('0x11')]('/',auth[_0xb440('0xb')](),controller[_0xb440('0x12')]);router[_0xb440('0x13')]('/:id',auth[_0xb440('0xb')](),controller[_0xb440('0x14')]);router[_0xb440('0x15')](_0xb440('0x16'),auth[_0xb440('0xb')](),controller[_0xb440('0x17')]);module[_0xb440('0x18')]=router; \ No newline at end of file +var _0xfc8e=['/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc8e,0x9c));var _0xefc8=function(_0x2cab21,_0x72aab5){_0x2cab21=_0x2cab21-0x0;var _0x4cf8ba=_0xfc8e[_0x2cab21];return _0x4cf8ba;};'use strict';var multer=require('multer');var util=require(_0xefc8('0x0'));var path=require('path');var timeout=require(_0xefc8('0x1'));var express=require(_0xefc8('0x2'));var router=express[_0xefc8('0x3')]();var fs_extra=require(_0xefc8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xefc8('0x5'));router[_0xefc8('0x6')]('/',auth[_0xefc8('0x7')](),controller[_0xefc8('0x8')]);router[_0xefc8('0x6')]('/describe',auth[_0xefc8('0x7')](),controller[_0xefc8('0x9')]);router[_0xefc8('0x6')](_0xefc8('0xa'),auth[_0xefc8('0x7')](),controller[_0xefc8('0xb')]);router[_0xefc8('0x6')](_0xefc8('0xc'),auth[_0xefc8('0x7')](),controller[_0xefc8('0xd')]);router[_0xefc8('0xe')]('/',auth['isAuthenticated'](),controller[_0xefc8('0xf')]);router[_0xefc8('0x10')](_0xefc8('0xa'),auth[_0xefc8('0x7')](),controller[_0xefc8('0x11')]);router[_0xefc8('0x12')](_0xefc8('0xa'),auth[_0xefc8('0x7')](),controller[_0xefc8('0x13')]);module[_0xefc8('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 03e11ca..64c529e 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 _0x152c=['starttime','format','DATE','STRING','moment','sequelize','exports','setDataValue'];(function(_0x53a3e7,_0x18ed8b){var _0x1deba2=function(_0x7fc319){while(--_0x7fc319){_0x53a3e7['push'](_0x53a3e7['shift']());}};_0x1deba2(++_0x18ed8b);}(_0x152c,0x144));var _0xc152=function(_0x246bbe,_0x5c95a2){_0x246bbe=_0x246bbe-0x0;var _0x10185f=_0x152c[_0x246bbe];return _0x10185f;};'use strict';var moment=require(_0xc152('0x0'));var Sequelize=require(_0xc152('0x1'));module[_0xc152('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x33ddc0){this[_0xc152('0x3')](_0xc152('0x4'),_0x33ddc0);this['setDataValue']('endtime',moment()[_0xc152('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xc152('0x6')]},'membername':{'type':Sequelize[_0xc152('0x7')]},'projectname':{'type':Sequelize[_0xc152('0x7')]},'queue':{'type':Sequelize[_0xc152('0x7')]},'uniqueid':{'type':Sequelize[_0xc152('0x7')]},'calleridname':{'type':Sequelize[_0xc152('0x7')]},'calleridnum':{'type':Sequelize[_0xc152('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8417=['exports','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize'];(function(_0x428659,_0x4e40bf){var _0x3e7c37=function(_0x5648f3){while(--_0x5648f3){_0x428659['push'](_0x428659['shift']());}};_0x3e7c37(++_0x4e40bf);}(_0x8417,0xfa));var _0x7841=function(_0x4620c5,_0x2079db){_0x4620c5=_0x4620c5-0x0;var _0x15310d=_0x8417[_0x4620c5];return _0x15310d;};'use strict';var moment=require(_0x7841('0x0'));var Sequelize=require(_0x7841('0x1'));module[_0x7841('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4ce4b8){this[_0x7841('0x3')]('starttime',_0x4ce4b8);this[_0x7841('0x3')](_0x7841('0x4'),moment()['format'](_0x7841('0x5')));}},'endtime':{'type':Sequelize[_0x7841('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7841('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7841('0x7')]},'calleridname':{'type':Sequelize[_0x7841('0x7')]},'calleridnum':{'type':Sequelize[_0x7841('0x7')]},'completed':{'type':Sequelize[_0x7841('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 53aa6be..9e641dd 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 _0x1cee=['rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','JscriptySessionReport','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','pick','eml-format'];(function(_0x43a8ce,_0x218806){var _0x7e1d6a=function(_0x4bdce7){while(--_0x4bdce7){_0x43a8ce['push'](_0x43a8ce['shift']());}};_0x7e1d6a(++_0x218806);}(_0x1cee,0xa5));var _0xe1ce=function(_0x4d677a,_0x2bd1f4){_0x4d677a=_0x4d677a-0x0;var _0xad983b=_0x1cee[_0x4d677a];return _0xad983b;};'use strict';var emlformat=require(_0xe1ce('0x0'));var rimraf=require(_0xe1ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe1ce('0x2'));var BPromise=require(_0xe1ce('0x3'));var Mustache=require(_0xe1ce('0x4'));var util=require(_0xe1ce('0x5'));var path=require(_0xe1ce('0x6'));var sox=require(_0xe1ce('0x7'));var csv=require('to-csv');var ejs=require(_0xe1ce('0x8'));var fs=require('fs');var fs_extra=require(_0xe1ce('0x9'));var _=require(_0xe1ce('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe1ce('0xb'));var deskjs=require(_0xe1ce('0xc'));var toCsv=require(_0xe1ce('0xd'));var querystring=require(_0xe1ce('0xe'));var Papa=require(_0xe1ce('0xf'));var Redis=require(_0xe1ce('0x10'));var authService=require(_0xe1ce('0x11'));var qs=require(_0xe1ce('0x12'));var as=require(_0xe1ce('0x13'));var hardwareService=require(_0xe1ce('0x14'));var logger=require('../../config/logger')(_0xe1ce('0x15'));var utils=require(_0xe1ce('0x16'));var config=require(_0xe1ce('0x17'));var licenseUtil=require(_0xe1ce('0x18'));var db=require(_0xe1ce('0x19'))['db'];function respondWithStatusCode(_0x4e1b76,_0x3af1f8){_0x3af1f8=_0x3af1f8||0xcc;return function(_0x559cca){if(_0x559cca){return _0x4e1b76[_0xe1ce('0x1a')](_0x3af1f8);}return _0x4e1b76['status'](_0x3af1f8)[_0xe1ce('0x1b')]();};}function respondWithResult(_0x3c9771,_0x6004b7){_0x6004b7=_0x6004b7||0xc8;return function(_0x1e3686){if(_0x1e3686){return _0x3c9771[_0xe1ce('0x1c')](_0x6004b7)[_0xe1ce('0x1d')](_0x1e3686);}};}function respondWithFilteredResult(_0x2e72f2,_0x1414d9){return function(_0x58c27c){if(_0x58c27c){var _0xff3ceb=typeof _0x1414d9['offset']===_0xe1ce('0x1e')&&typeof _0x1414d9[_0xe1ce('0x1f')]==='undefined';var _0x1ed7db=_0x58c27c[_0xe1ce('0x20')];var _0x16ff39=_0xff3ceb?0x0:_0x1414d9[_0xe1ce('0x21')];var _0x333b0b=_0xff3ceb?_0x58c27c[_0xe1ce('0x20')]:_0x1414d9['offset']+_0x1414d9[_0xe1ce('0x1f')];var _0x275a38;if(_0x333b0b>=_0x1ed7db){_0x333b0b=_0x1ed7db;_0x275a38=0xc8;}else{_0x275a38=0xce;}_0x2e72f2[_0xe1ce('0x1c')](_0x275a38);return _0x2e72f2[_0xe1ce('0x22')](_0xe1ce('0x23'),_0x16ff39+'-'+_0x333b0b+'/'+_0x1ed7db)[_0xe1ce('0x1d')](_0x58c27c);}return null;};}function patchUpdates(_0x4e52c7){return function(_0x406748){try{jsonpatch[_0xe1ce('0x24')](_0x406748,_0x4e52c7,!![]);}catch(_0x58b45f){return BPromise[_0xe1ce('0x25')](_0x58b45f);}return _0x406748[_0xe1ce('0x26')]();};}function saveUpdates(_0xc5e936,_0x160bcf){return function(_0x4029f9){if(_0x4029f9){return _0x4029f9[_0xe1ce('0x27')](_0xc5e936)[_0xe1ce('0x28')](function(_0x17fc07){return _0x17fc07;});}return null;};}function removeEntity(_0x4e7691,_0x14ef66){return function(_0x14b6c1){if(_0x14b6c1){return _0x14b6c1[_0xe1ce('0x29')]()[_0xe1ce('0x28')](function(){_0x4e7691[_0xe1ce('0x1c')](0xcc)[_0xe1ce('0x1b')]();});}};}function handleEntityNotFound(_0x4a77c0,_0x4d9b11){return function(_0x25ecb8){if(!_0x25ecb8){_0x4a77c0[_0xe1ce('0x1a')](0x194);}return _0x25ecb8;};}function handleError(_0x5613f6,_0xd9775a){_0xd9775a=_0xd9775a||0x1f4;return function(_0x4046b9){logger[_0xe1ce('0x2a')](_0x4046b9['stack']);if(_0x4046b9[_0xe1ce('0x2b')]){delete _0x4046b9[_0xe1ce('0x2b')];}_0x5613f6[_0xe1ce('0x1c')](_0xd9775a)[_0xe1ce('0x2c')](_0x4046b9);};}exports[_0xe1ce('0x2d')]=function(_0xf5989f,_0x32c18e){var _0x51969d={},_0x361d3a={},_0x5e6cb3={'count':0x0,'rows':[]};var _0x57af0e=_['map'](db[_0xe1ce('0x2e')]['rawAttributes'],function(_0x11c0df){return{'name':_0x11c0df[_0xe1ce('0x2f')],'type':_0x11c0df[_0xe1ce('0x30')][_0xe1ce('0x31')]};});_0x361d3a[_0xe1ce('0x32')]=_[_0xe1ce('0x33')](_0x57af0e,_0xe1ce('0x2b'));_0x361d3a['query']=_['keys'](_0xf5989f[_0xe1ce('0x34')]);_0x361d3a['filters']=_[_0xe1ce('0x35')](_0x361d3a['model'],_0x361d3a['query']);_0x51969d[_0xe1ce('0x36')]=_[_0xe1ce('0x35')](_0x361d3a[_0xe1ce('0x32')],qs[_0xe1ce('0x37')](_0xf5989f[_0xe1ce('0x34')][_0xe1ce('0x37')]));_0x51969d[_0xe1ce('0x36')]=_0x51969d[_0xe1ce('0x36')][_0xe1ce('0x38')]?_0x51969d[_0xe1ce('0x36')]:_0x361d3a[_0xe1ce('0x32')];if(!_0xf5989f[_0xe1ce('0x34')][_0xe1ce('0x39')](_0xe1ce('0x3a'))){_0x51969d[_0xe1ce('0x1f')]=qs[_0xe1ce('0x1f')](_0xf5989f[_0xe1ce('0x34')][_0xe1ce('0x1f')]);_0x51969d['offset']=qs['offset'](_0xf5989f[_0xe1ce('0x34')]['offset']);}_0x51969d[_0xe1ce('0x3b')]=qs[_0xe1ce('0x3c')](_0xf5989f['query'][_0xe1ce('0x3c')]);_0x51969d[_0xe1ce('0x3d')]=qs[_0xe1ce('0x3e')](_['pick'](_0xf5989f['query'],_0x361d3a[_0xe1ce('0x3e')]),_0x57af0e);if(_0xf5989f[_0xe1ce('0x34')][_0xe1ce('0x3f')]){_0x51969d[_0xe1ce('0x3d')]=_[_0xe1ce('0x40')](_0x51969d[_0xe1ce('0x3d')],{'$or':_['map'](_0x57af0e,function(_0x50edd0){if(_0x50edd0[_0xe1ce('0x30')]!=='VIRTUAL'){var _0x2cad2d={};_0x2cad2d[_0x50edd0[_0xe1ce('0x2b')]]={'$like':'%'+_0xf5989f[_0xe1ce('0x34')][_0xe1ce('0x3f')]+'%'};return _0x2cad2d;}})});}_0x51969d=_['merge']({},_0x51969d,_0xf5989f['options']);var _0x411901={'where':_0x51969d['where']};return db['JscriptySessionReport'][_0xe1ce('0x20')](_0x411901)[_0xe1ce('0x28')](function(_0xb18357){_0x5e6cb3[_0xe1ce('0x20')]=_0xb18357;if(_0xf5989f[_0xe1ce('0x34')][_0xe1ce('0x41')]){_0x51969d[_0xe1ce('0x42')]=[{'all':!![]}];}return db[_0xe1ce('0x2e')][_0xe1ce('0x43')](_0x51969d);})[_0xe1ce('0x28')](function(_0x5767b5){_0x5e6cb3[_0xe1ce('0x44')]=_0x5767b5;return _0x5e6cb3;})['then'](respondWithFilteredResult(_0x32c18e,_0x51969d))[_0xe1ce('0x45')](handleError(_0x32c18e,null));};exports[_0xe1ce('0x46')]=function(_0x2eccf3,_0x49e5c4){var _0x230dd7={'raw':!![],'where':{'id':_0x2eccf3[_0xe1ce('0x47')]['id']}},_0x2a7692={};_0x2a7692[_0xe1ce('0x32')]=_[_0xe1ce('0x48')](db['JscriptySessionReport'][_0xe1ce('0x49')]);_0x2a7692['query']=_[_0xe1ce('0x48')](_0x2eccf3['query']);_0x2a7692['filters']=_[_0xe1ce('0x35')](_0x2a7692[_0xe1ce('0x32')],_0x2a7692[_0xe1ce('0x34')]);_0x230dd7[_0xe1ce('0x36')]=_[_0xe1ce('0x35')](_0x2a7692[_0xe1ce('0x32')],qs[_0xe1ce('0x37')](_0x2eccf3[_0xe1ce('0x34')][_0xe1ce('0x37')]));_0x230dd7[_0xe1ce('0x36')]=_0x230dd7[_0xe1ce('0x36')][_0xe1ce('0x38')]?_0x230dd7[_0xe1ce('0x36')]:_0x2a7692[_0xe1ce('0x32')];if(_0x2eccf3['query'][_0xe1ce('0x41')]){_0x230dd7[_0xe1ce('0x42')]=[{'all':!![]}];}_0x230dd7=_[_0xe1ce('0x40')]({},_0x230dd7,_0x2eccf3[_0xe1ce('0x4a')]);return db['JscriptySessionReport'][_0xe1ce('0x4b')](_0x230dd7)[_0xe1ce('0x28')](handleEntityNotFound(_0x49e5c4,null))[_0xe1ce('0x28')](respondWithResult(_0x49e5c4,null))[_0xe1ce('0x45')](handleError(_0x49e5c4,null));};exports['create']=function(_0x51c9cb,_0x268eb4){return db[_0xe1ce('0x2e')][_0xe1ce('0x4c')](_0x51c9cb[_0xe1ce('0x4d')],{})[_0xe1ce('0x28')](respondWithResult(_0x268eb4,0xc9))[_0xe1ce('0x45')](handleError(_0x268eb4,null));};exports[_0xe1ce('0x27')]=function(_0xe4131a,_0x2b1407){if(_0xe4131a[_0xe1ce('0x4d')]['id']){delete _0xe4131a['body']['id'];}return db[_0xe1ce('0x2e')]['find']({'where':{'id':_0xe4131a[_0xe1ce('0x47')]['id']}})[_0xe1ce('0x28')](handleEntityNotFound(_0x2b1407,null))['then'](saveUpdates(_0xe4131a[_0xe1ce('0x4d')],null))['then'](respondWithResult(_0x2b1407,null))[_0xe1ce('0x45')](handleError(_0x2b1407,null));};exports[_0xe1ce('0x29')]=function(_0x4f6c5b,_0x5b1f59){return db[_0xe1ce('0x2e')][_0xe1ce('0x4b')]({'where':{'id':_0x4f6c5b[_0xe1ce('0x47')]['id']}})[_0xe1ce('0x28')](handleEntityNotFound(_0x5b1f59,null))[_0xe1ce('0x28')](removeEntity(_0x5b1f59,null))[_0xe1ce('0x45')](handleError(_0x5b1f59,null));};exports[_0xe1ce('0x4e')]=function(_0x316f0a,_0xe2f9d9){return db[_0xe1ce('0x2e')][_0xe1ce('0x4e')]()[_0xe1ce('0x28')](respondWithResult(_0xe2f9d9,null))[_0xe1ce('0x45')](handleError(_0xe2f9d9,null));};exports[_0xe1ce('0x4f')]=function(_0x395aa9,_0x5c6dbc,_0x4a9c81){var _0x33bec9={'raw':!![],'where':{}};var _0x345845={};var _0x2aa42b={'count':0x0,'rows':[]};return db[_0xe1ce('0x2e')][_0xe1ce('0x50')]({'where':{'id':_0x395aa9['params']['id']}})[_0xe1ce('0x28')](handleEntityNotFound(_0x5c6dbc,null))['then'](function(_0x4af03e){if(_0x4af03e){_0x345845[_0xe1ce('0x32')]=_[_0xe1ce('0x48')](db[_0xe1ce('0x51')][_0xe1ce('0x49')]);_0x345845['query']=_['keys'](_0x395aa9[_0xe1ce('0x34')]);_0x345845[_0xe1ce('0x3e')]=_[_0xe1ce('0x35')](_0x345845[_0xe1ce('0x32')],_0x345845[_0xe1ce('0x34')]);_0x33bec9[_0xe1ce('0x36')]=_['intersection'](_0x345845[_0xe1ce('0x32')],qs[_0xe1ce('0x37')](_0x395aa9['query']['fields']));_0x33bec9['attributes']=_0x33bec9['attributes'][_0xe1ce('0x38')]?_0x33bec9[_0xe1ce('0x36')]:_0x345845[_0xe1ce('0x32')];if(!_0x395aa9['query'][_0xe1ce('0x39')](_0xe1ce('0x3a'))){_0x33bec9[_0xe1ce('0x1f')]=qs[_0xe1ce('0x1f')](_0x395aa9[_0xe1ce('0x34')][_0xe1ce('0x1f')]);_0x33bec9[_0xe1ce('0x21')]=qs['offset'](_0x395aa9[_0xe1ce('0x34')][_0xe1ce('0x21')]);}_0x33bec9[_0xe1ce('0x3b')]=qs[_0xe1ce('0x3c')](_0x395aa9[_0xe1ce('0x34')][_0xe1ce('0x3c')]);_0x33bec9[_0xe1ce('0x3d')]=qs[_0xe1ce('0x3e')](_[_0xe1ce('0x52')](_0x395aa9['query'],_0x345845[_0xe1ce('0x3e')]));_0x33bec9[_0xe1ce('0x3d')]['SessionId']=_0x4af03e['id'];if(_0x395aa9[_0xe1ce('0x34')][_0xe1ce('0x3f')]){_0x33bec9[_0xe1ce('0x3d')]=_[_0xe1ce('0x40')](_0x33bec9[_0xe1ce('0x3d')],{'$or':_[_0xe1ce('0x33')](_0x33bec9[_0xe1ce('0x36')],function(_0x30711b){var _0x4f98bd={};_0x4f98bd[_0x30711b]={'$like':'%'+_0x395aa9[_0xe1ce('0x34')]['filter']+'%'};return _0x4f98bd;})});}_0x33bec9=_[_0xe1ce('0x40')]({},_0x33bec9,_0x395aa9[_0xe1ce('0x4a')]);return db[_0xe1ce('0x51')][_0xe1ce('0x20')]({'where':_0x33bec9[_0xe1ce('0x3d')]})[_0xe1ce('0x28')](function(_0x5b61fd){_0x2aa42b['count']=_0x5b61fd;if(_0x395aa9[_0xe1ce('0x34')][_0xe1ce('0x41')]){_0x33bec9['include']=[{'all':!![]}];}return db[_0xe1ce('0x51')][_0xe1ce('0x43')](_0x33bec9);})[_0xe1ce('0x28')](function(_0x596891){_0x2aa42b[_0xe1ce('0x44')]=_0x596891;return _0x2aa42b;});}})[_0xe1ce('0x28')](respondWithFilteredResult(_0x5c6dbc,_0x33bec9))[_0xe1ce('0x45')](handleError(_0x5c6dbc,null));}; \ No newline at end of file +var _0x3476=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','include','options','find','catch','create','body','params','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce'];(function(_0x258180,_0x593d87){var _0x37a1eb=function(_0x146f01){while(--_0x146f01){_0x258180['push'](_0x258180['shift']());}};_0x37a1eb(++_0x593d87);}(_0x3476,0x12a));var _0x6347=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x3476[_0x176329];return _0x31997c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6347('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6347('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6347('0x2'));var Mustache=require(_0x6347('0x3'));var util=require(_0x6347('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x6347('0x5'));var ejs=require(_0x6347('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6347('0x7'));var squel=require(_0x6347('0x8'));var crypto=require('crypto');var jsforce=require(_0x6347('0x9'));var deskjs=require(_0x6347('0xa'));var toCsv=require(_0x6347('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6347('0xb'));var authService=require(_0x6347('0xc'));var qs=require(_0x6347('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6347('0xe'));var logger=require(_0x6347('0xf'))(_0x6347('0x10'));var utils=require(_0x6347('0x11'));var config=require(_0x6347('0x12'));var licenseUtil=require(_0x6347('0x13'));var db=require(_0x6347('0x14'))['db'];function respondWithStatusCode(_0x1c9ada,_0x2d71c5){_0x2d71c5=_0x2d71c5||0xcc;return function(_0x72e624){if(_0x72e624){return _0x1c9ada['sendStatus'](_0x2d71c5);}return _0x1c9ada[_0x6347('0x15')](_0x2d71c5)[_0x6347('0x16')]();};}function respondWithResult(_0x2c8978,_0xfcdb0a){_0xfcdb0a=_0xfcdb0a||0xc8;return function(_0x32caa5){if(_0x32caa5){return _0x2c8978[_0x6347('0x15')](_0xfcdb0a)[_0x6347('0x17')](_0x32caa5);}};}function respondWithFilteredResult(_0x2cf7d3,_0x3b9262){return function(_0x295a5e){if(_0x295a5e){var _0x1a8159=typeof _0x3b9262['offset']===_0x6347('0x18')&&typeof _0x3b9262[_0x6347('0x19')]==='undefined';var _0x5c9cf3=_0x295a5e[_0x6347('0x1a')];var _0x5c2614=_0x1a8159?0x0:_0x3b9262[_0x6347('0x1b')];var _0x2052db=_0x1a8159?_0x295a5e[_0x6347('0x1a')]:_0x3b9262[_0x6347('0x1b')]+_0x3b9262[_0x6347('0x19')];var _0x70a6c8;if(_0x2052db>=_0x5c9cf3){_0x2052db=_0x5c9cf3;_0x70a6c8=0xc8;}else{_0x70a6c8=0xce;}_0x2cf7d3[_0x6347('0x15')](_0x70a6c8);return _0x2cf7d3[_0x6347('0x1c')](_0x6347('0x1d'),_0x5c2614+'-'+_0x2052db+'/'+_0x5c9cf3)[_0x6347('0x17')](_0x295a5e);}return null;};}function patchUpdates(_0x4e92d5){return function(_0x53c21b){try{jsonpatch['apply'](_0x53c21b,_0x4e92d5,!![]);}catch(_0x538c35){return BPromise[_0x6347('0x1e')](_0x538c35);}return _0x53c21b[_0x6347('0x1f')]();};}function saveUpdates(_0x59c27d,_0x296245){return function(_0x269078){if(_0x269078){return _0x269078['update'](_0x59c27d)[_0x6347('0x20')](function(_0x30dccf){return _0x30dccf;});}return null;};}function removeEntity(_0x515f7c,_0x155602){return function(_0x3c1c20){if(_0x3c1c20){return _0x3c1c20[_0x6347('0x21')]()[_0x6347('0x20')](function(){_0x515f7c['status'](0xcc)[_0x6347('0x16')]();});}};}function handleEntityNotFound(_0x2b5840,_0x3e6866){return function(_0xb46f5d){if(!_0xb46f5d){_0x2b5840[_0x6347('0x22')](0x194);}return _0xb46f5d;};}function handleError(_0x132d69,_0x2ec29f){_0x2ec29f=_0x2ec29f||0x1f4;return function(_0x1c7bd0){logger[_0x6347('0x23')](_0x1c7bd0[_0x6347('0x24')]);if(_0x1c7bd0[_0x6347('0x25')]){delete _0x1c7bd0[_0x6347('0x25')];}_0x132d69['status'](_0x2ec29f)[_0x6347('0x26')](_0x1c7bd0);};}exports[_0x6347('0x27')]=function(_0x3ed1ea,_0x24aa12){var _0x2bca9e={},_0x3068f2={},_0x3ddbd9={'count':0x0,'rows':[]};var _0x3d2349=_[_0x6347('0x28')](db[_0x6347('0x29')][_0x6347('0x2a')],function(_0x2ed56e){return{'name':_0x2ed56e['fieldName'],'type':_0x2ed56e[_0x6347('0x2b')][_0x6347('0x2c')]};});_0x3068f2[_0x6347('0x2d')]=_['map'](_0x3d2349,_0x6347('0x25'));_0x3068f2[_0x6347('0x2e')]=_[_0x6347('0x2f')](_0x3ed1ea['query']);_0x3068f2[_0x6347('0x30')]=_[_0x6347('0x31')](_0x3068f2['model'],_0x3068f2[_0x6347('0x2e')]);_0x2bca9e[_0x6347('0x32')]=_['intersection'](_0x3068f2[_0x6347('0x2d')],qs[_0x6347('0x33')](_0x3ed1ea['query']['fields']));_0x2bca9e['attributes']=_0x2bca9e[_0x6347('0x32')][_0x6347('0x34')]?_0x2bca9e[_0x6347('0x32')]:_0x3068f2[_0x6347('0x2d')];if(!_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x35')](_0x6347('0x36'))){_0x2bca9e[_0x6347('0x19')]=qs[_0x6347('0x19')](_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x19')]);_0x2bca9e[_0x6347('0x1b')]=qs[_0x6347('0x1b')](_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x1b')]);}_0x2bca9e['order']=qs['sort'](_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x37')]);_0x2bca9e[_0x6347('0x38')]=qs[_0x6347('0x30')](_[_0x6347('0x39')](_0x3ed1ea[_0x6347('0x2e')],_0x3068f2['filters']),_0x3d2349);if(_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x3a')]){_0x2bca9e[_0x6347('0x38')]=_[_0x6347('0x3b')](_0x2bca9e[_0x6347('0x38')],{'$or':_[_0x6347('0x28')](_0x3d2349,function(_0x45613e){if(_0x45613e[_0x6347('0x2b')]!==_0x6347('0x3c')){var _0x1125c1={};_0x1125c1[_0x45613e[_0x6347('0x25')]]={'$like':'%'+_0x3ed1ea[_0x6347('0x2e')][_0x6347('0x3a')]+'%'};return _0x1125c1;}})});}_0x2bca9e=_[_0x6347('0x3b')]({},_0x2bca9e,_0x3ed1ea['options']);var _0x339b23={'where':_0x2bca9e[_0x6347('0x38')]};return db[_0x6347('0x29')]['count'](_0x339b23)[_0x6347('0x20')](function(_0x11f6c8){_0x3ddbd9[_0x6347('0x1a')]=_0x11f6c8;if(_0x3ed1ea['query'][_0x6347('0x3d')]){_0x2bca9e['include']=[{'all':!![]}];}return db[_0x6347('0x29')][_0x6347('0x3e')](_0x2bca9e);})['then'](function(_0x36c17a){_0x3ddbd9[_0x6347('0x3f')]=_0x36c17a;return _0x3ddbd9;})[_0x6347('0x20')](respondWithFilteredResult(_0x24aa12,_0x2bca9e))['catch'](handleError(_0x24aa12,null));};exports['show']=function(_0x5eaa02,_0xebc7eb){var _0x4e8945={'raw':!![],'where':{'id':_0x5eaa02['params']['id']}},_0x4fcd63={};_0x4fcd63[_0x6347('0x2d')]=_[_0x6347('0x2f')](db[_0x6347('0x29')][_0x6347('0x2a')]);_0x4fcd63[_0x6347('0x2e')]=_[_0x6347('0x2f')](_0x5eaa02[_0x6347('0x2e')]);_0x4fcd63[_0x6347('0x30')]=_[_0x6347('0x31')](_0x4fcd63[_0x6347('0x2d')],_0x4fcd63['query']);_0x4e8945[_0x6347('0x32')]=_['intersection'](_0x4fcd63[_0x6347('0x2d')],qs[_0x6347('0x33')](_0x5eaa02[_0x6347('0x2e')][_0x6347('0x33')]));_0x4e8945['attributes']=_0x4e8945[_0x6347('0x32')]['length']?_0x4e8945['attributes']:_0x4fcd63[_0x6347('0x2d')];if(_0x5eaa02['query']['includeAll']){_0x4e8945[_0x6347('0x40')]=[{'all':!![]}];}_0x4e8945=_[_0x6347('0x3b')]({},_0x4e8945,_0x5eaa02[_0x6347('0x41')]);return db[_0x6347('0x29')][_0x6347('0x42')](_0x4e8945)['then'](handleEntityNotFound(_0xebc7eb,null))[_0x6347('0x20')](respondWithResult(_0xebc7eb,null))[_0x6347('0x43')](handleError(_0xebc7eb,null));};exports[_0x6347('0x44')]=function(_0x4216f1,_0x5cf128){return db[_0x6347('0x29')][_0x6347('0x44')](_0x4216f1[_0x6347('0x45')],{})[_0x6347('0x20')](respondWithResult(_0x5cf128,0xc9))[_0x6347('0x43')](handleError(_0x5cf128,null));};exports['update']=function(_0x308588,_0x174016){if(_0x308588[_0x6347('0x45')]['id']){delete _0x308588[_0x6347('0x45')]['id'];}return db['JscriptySessionReport'][_0x6347('0x42')]({'where':{'id':_0x308588[_0x6347('0x46')]['id']}})['then'](handleEntityNotFound(_0x174016,null))[_0x6347('0x20')](saveUpdates(_0x308588[_0x6347('0x45')],null))['then'](respondWithResult(_0x174016,null))[_0x6347('0x43')](handleError(_0x174016,null));};exports[_0x6347('0x21')]=function(_0x3d649a,_0x1813b8){return db[_0x6347('0x29')][_0x6347('0x42')]({'where':{'id':_0x3d649a[_0x6347('0x46')]['id']}})[_0x6347('0x20')](handleEntityNotFound(_0x1813b8,null))['then'](removeEntity(_0x1813b8,null))[_0x6347('0x43')](handleError(_0x1813b8,null));};exports[_0x6347('0x47')]=function(_0x2d140c,_0x3c9b01){return db[_0x6347('0x29')][_0x6347('0x47')]()[_0x6347('0x20')](respondWithResult(_0x3c9b01,null))[_0x6347('0x43')](handleError(_0x3c9b01,null));};exports[_0x6347('0x48')]=function(_0x43bf76,_0x3ff9bf,_0x178277){var _0x494116={'raw':!![],'where':{}};var _0x2a0891={};var _0x4544ac={'count':0x0,'rows':[]};return db[_0x6347('0x29')][_0x6347('0x49')]({'where':{'id':_0x43bf76[_0x6347('0x46')]['id']}})[_0x6347('0x20')](handleEntityNotFound(_0x3ff9bf,null))[_0x6347('0x20')](function(_0x356aff){if(_0x356aff){_0x2a0891[_0x6347('0x2d')]=_[_0x6347('0x2f')](db['JscriptyQuestionReport']['rawAttributes']);_0x2a0891['query']=_[_0x6347('0x2f')](_0x43bf76[_0x6347('0x2e')]);_0x2a0891[_0x6347('0x30')]=_['intersection'](_0x2a0891[_0x6347('0x2d')],_0x2a0891[_0x6347('0x2e')]);_0x494116['attributes']=_[_0x6347('0x31')](_0x2a0891['model'],qs['fields'](_0x43bf76[_0x6347('0x2e')]['fields']));_0x494116[_0x6347('0x32')]=_0x494116[_0x6347('0x32')][_0x6347('0x34')]?_0x494116[_0x6347('0x32')]:_0x2a0891[_0x6347('0x2d')];if(!_0x43bf76[_0x6347('0x2e')][_0x6347('0x35')]('nolimit')){_0x494116[_0x6347('0x19')]=qs[_0x6347('0x19')](_0x43bf76[_0x6347('0x2e')][_0x6347('0x19')]);_0x494116[_0x6347('0x1b')]=qs[_0x6347('0x1b')](_0x43bf76['query'][_0x6347('0x1b')]);}_0x494116[_0x6347('0x4a')]=qs[_0x6347('0x37')](_0x43bf76['query'][_0x6347('0x37')]);_0x494116[_0x6347('0x38')]=qs['filters'](_[_0x6347('0x39')](_0x43bf76[_0x6347('0x2e')],_0x2a0891[_0x6347('0x30')]));_0x494116[_0x6347('0x38')][_0x6347('0x4b')]=_0x356aff['id'];if(_0x43bf76['query'][_0x6347('0x3a')]){_0x494116[_0x6347('0x38')]=_['merge'](_0x494116[_0x6347('0x38')],{'$or':_[_0x6347('0x28')](_0x494116[_0x6347('0x32')],function(_0x37b2e3){var _0x2e9487={};_0x2e9487[_0x37b2e3]={'$like':'%'+_0x43bf76[_0x6347('0x2e')][_0x6347('0x3a')]+'%'};return _0x2e9487;})});}_0x494116=_[_0x6347('0x3b')]({},_0x494116,_0x43bf76[_0x6347('0x41')]);return db[_0x6347('0x4c')][_0x6347('0x1a')]({'where':_0x494116[_0x6347('0x38')]})['then'](function(_0x65284b){_0x4544ac['count']=_0x65284b;if(_0x43bf76[_0x6347('0x2e')][_0x6347('0x3d')]){_0x494116[_0x6347('0x40')]=[{'all':!![]}];}return db[_0x6347('0x4c')][_0x6347('0x3e')](_0x494116);})['then'](function(_0x208140){_0x4544ac[_0x6347('0x3f')]=_0x208140;return _0x4544ac;});}})[_0x6347('0x20')](respondWithFilteredResult(_0x3ff9bf,_0x494116))['catch'](handleError(_0x3ff9bf,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 15a41c0..c2205f7 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 _0x5334=['moment','request-promise','rimraf','../../config/environment','lodash','util','../../config/logger','api'];(function(_0x7dba1a,_0x5e2ac5){var _0x285eb6=function(_0x5a2c96){while(--_0x5a2c96){_0x7dba1a['push'](_0x7dba1a['shift']());}};_0x285eb6(++_0x5e2ac5);}(_0x5334,0x84));var _0x4533=function(_0x44fb50,_0x2852b5){_0x44fb50=_0x44fb50-0x0;var _0x41c71e=_0x5334[_0x44fb50];return _0x41c71e;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require('bluebird');var rp=require(_0x4533('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4533('0x6'));var config=require(_0x4533('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x51b4ce,_0x201673){return _0x51b4ce['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8958=['define','JscriptySessionReport','report_jscripty_sessions','util','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x25ec03,_0x37ae5f){var _0x596657=function(_0x875259){while(--_0x875259){_0x25ec03['push'](_0x25ec03['shift']());}};_0x596657(++_0x37ae5f);}(_0x8958,0x93));var _0x8895=function(_0x45faee,_0x5ef86a){_0x45faee=_0x45faee-0x0;var _0x452e3d=_0x8958[_0x45faee];return _0x452e3d;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));module['exports']=function(_0x22fa52,_0x2f03ad){return _0x22fa52[_0x8895('0x5')](_0x8895('0x6'),attributes,{'tableName':_0x8895('0x7'),'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 5a9af28..e15f3bf 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x22febb,_0x4d156e){var _0x3d8ba2=function(_0x5c2af7){while(--_0x5c2af7){_0x22febb['push'](_0x22febb['shift']());}};_0x3d8ba2(++_0x4d156e);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3fe164,_0xcc2525){_0x3fe164=_0x3fe164-0x0;var _0x245dab=_0x9f0e[_0x3fe164];return _0x245dab;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x430c=['then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x430c,0x1a1));var _0xc430=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x430c[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 0238893..5292c7d 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 _0x2646=['../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x506e4e,_0x1e893b){var _0x23719c=function(_0x33e3c0){while(--_0x33e3c0){_0x506e4e['push'](_0x506e4e['shift']());}};_0x23719c(++_0x1e893b);}(_0x2646,0x65));var _0x6264=function(_0x59c6dc,_0x2f43d2){_0x59c6dc=_0x59c6dc-0x0;var _0x3ae1b6=_0x2646[_0x59c6dc];return _0x3ae1b6;};'use strict';var multer=require(_0x6264('0x0'));var util=require(_0x6264('0x1'));var path=require(_0x6264('0x2'));var timeout=require(_0x6264('0x3'));var express=require(_0x6264('0x4'));var router=express[_0x6264('0x5')]();var fs_extra=require(_0x6264('0x6'));var auth=require(_0x6264('0x7'));var interaction=require(_0x6264('0x8'));var config=require('../../config/environment');var controller=require(_0x6264('0x9'));router[_0x6264('0xa')]('/',controller[_0x6264('0xb')]);router[_0x6264('0xc')](_0x6264('0xd'),auth[_0x6264('0xe')](),controller[_0x6264('0xf')]);router[_0x6264('0xa')](_0x6264('0x10'),auth['isAuthenticated'](),controller[_0x6264('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd85c=['update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0xb219b6,_0x112fae){var _0x2aefe4=function(_0x4b820a){while(--_0x4b820a){_0xb219b6['push'](_0xb219b6['shift']());}};_0x2aefe4(++_0x112fae);}(_0xd85c,0x155));var _0xcd85=function(_0x1770dc,_0x4aa2cf){_0x1770dc=_0x1770dc-0x0;var _0x166cba=_0xd85c[_0x1770dc];return _0x166cba;};'use strict';var multer=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var path=require(_0xcd85('0x2'));var timeout=require(_0xcd85('0x3'));var express=require(_0xcd85('0x4'));var router=express[_0xcd85('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcd85('0x6'));var config=require(_0xcd85('0x7'));var controller=require(_0xcd85('0x8'));router[_0xcd85('0x9')]('/',controller[_0xcd85('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcd85('0xb')]);router[_0xcd85('0x9')](_0xcd85('0xc'),auth[_0xcd85('0xd')](),controller[_0xcd85('0xe')]);module[_0xcd85('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b012ce7..490bece 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 _0x72d0=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x72d0,0xa3));var _0x072d=function(_0x36e8e4,_0x213a61){_0x36e8e4=_0x36e8e4-0x0;var _0x491ac7=_0x72d0[_0x36e8e4];return _0x491ac7;};'use strict';var Sequelize=require(_0x072d('0x0'));module[_0x072d('0x1')]={'license':{'type':Sequelize[_0x072d('0x2')]},'data1':{'type':Sequelize[_0x072d('0x3')]},'data2':{'type':Sequelize[_0x072d('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x072d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x393e=['INTEGER','exports','STRING'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x393e,0x118));var _0xe393=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x393e[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');module[_0xe393('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xe393('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xe393('0x2')],'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 96ddbbc..3f92bba 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 _0xc780=['intersection','attributes','fields','merge','options','getLicense','catch','body','find','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','model','License','query','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc780,0xac));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c78('0x0'));var rimraf=require(_0x0c78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c78('0x2'));var rp=require(_0x0c78('0x3'));var moment=require(_0x0c78('0x4'));var BPromise=require(_0x0c78('0x5'));var Mustache=require(_0x0c78('0x6'));var util=require(_0x0c78('0x7'));var path=require(_0x0c78('0x8'));var sox=require(_0x0c78('0x9'));var csv=require(_0x0c78('0xa'));var ejs=require(_0x0c78('0xb'));var fs=require('fs');var fs_extra=require(_0x0c78('0xc'));var _=require('lodash');var squel=require(_0x0c78('0xd'));var crypto=require(_0x0c78('0xe'));var jsforce=require(_0x0c78('0xf'));var deskjs=require(_0x0c78('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0c78('0x11'));var Papa=require(_0x0c78('0x12'));var Redis=require(_0x0c78('0x13'));var authService=require(_0x0c78('0x14'));var qs=require(_0x0c78('0x15'));var as=require(_0x0c78('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c78('0x17'))(_0x0c78('0x18'));var utils=require(_0x0c78('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0c78('0x1a'));var db=require(_0x0c78('0x1b'))['db'];function respondWithStatusCode(_0x57c42c,_0x57a470){_0x57a470=_0x57a470||0xcc;return function(_0x13ddbb){if(_0x13ddbb){return _0x57c42c[_0x0c78('0x1c')](_0x57a470);}return _0x57c42c[_0x0c78('0x1d')](_0x57a470)['end']();};}function respondWithResult(_0x5eb537,_0x555000){_0x555000=_0x555000||0xc8;return function(_0x4efd55){if(_0x4efd55){return _0x5eb537[_0x0c78('0x1d')](_0x555000)['json'](_0x4efd55);}};}function respondWithFilteredResult(_0x21599b,_0x5b97ef){return function(_0x1d13d4){if(_0x1d13d4){var _0x446720=typeof _0x5b97ef[_0x0c78('0x1e')]===_0x0c78('0x1f')&&typeof _0x5b97ef[_0x0c78('0x20')]===_0x0c78('0x1f');var _0x534bc1=_0x1d13d4[_0x0c78('0x21')];var _0x2532f3=_0x446720?0x0:_0x5b97ef[_0x0c78('0x1e')];var _0x3a3c0e=_0x446720?_0x1d13d4[_0x0c78('0x21')]:_0x5b97ef[_0x0c78('0x1e')]+_0x5b97ef[_0x0c78('0x20')];var _0x52d20d;if(_0x3a3c0e>=_0x534bc1){_0x3a3c0e=_0x534bc1;_0x52d20d=0xc8;}else{_0x52d20d=0xce;}_0x21599b[_0x0c78('0x1d')](_0x52d20d);return _0x21599b[_0x0c78('0x22')]('Content-Range',_0x2532f3+'-'+_0x3a3c0e+'/'+_0x534bc1)['json'](_0x1d13d4);}return null;};}function patchUpdates(_0x2a65d1){return function(_0x444c9b){try{jsonpatch[_0x0c78('0x23')](_0x444c9b,_0x2a65d1,!![]);}catch(_0x21a6f4){return BPromise[_0x0c78('0x24')](_0x21a6f4);}return _0x444c9b[_0x0c78('0x25')]();};}function saveUpdates(_0x87c01,_0x4cf08f){return function(_0x2a510d){if(_0x2a510d){return _0x2a510d[_0x0c78('0x26')](_0x87c01)['then'](function(_0x617bd3){return _0x617bd3;});}return null;};}function removeEntity(_0x1f5c3c,_0x5e71fd){return function(_0x5ca9fe){if(_0x5ca9fe){return _0x5ca9fe['destroy']()[_0x0c78('0x27')](function(){_0x1f5c3c[_0x0c78('0x1d')](0xcc)[_0x0c78('0x28')]();});}};}function handleEntityNotFound(_0x5ea129,_0x19eca5){return function(_0x44398d){if(!_0x44398d){_0x5ea129[_0x0c78('0x1c')](0x194);}return _0x44398d;};}function handleError(_0x4dc98b,_0x5336a0){_0x5336a0=_0x5336a0||0x1f4;return function(_0x4d6d88){logger[_0x0c78('0x29')](_0x4d6d88[_0x0c78('0x2a')]);if(_0x4d6d88['name']){delete _0x4d6d88[_0x0c78('0x2b')];}_0x4dc98b['status'](_0x5336a0)[_0x0c78('0x2c')](_0x4d6d88);};}var utilLicense=require(_0x0c78('0x1a'));exports[_0x0c78('0x2d')]=function(_0x156da4,_0x289a3a){var _0x50699c={'raw':!![],'where':{'id':0x1}},_0x56c9c9={};_0x56c9c9[_0x0c78('0x2e')]=_['keys'](db[_0x0c78('0x2f')]['rawAttributes']);_0x56c9c9[_0x0c78('0x30')]=_[_0x0c78('0x31')](_0x156da4[_0x0c78('0x30')]);_0x56c9c9['filters']=_[_0x0c78('0x32')](_0x56c9c9['model'],_0x56c9c9[_0x0c78('0x30')]);_0x50699c[_0x0c78('0x33')]=_[_0x0c78('0x32')](_0x56c9c9[_0x0c78('0x2e')],qs[_0x0c78('0x34')](_0x156da4[_0x0c78('0x30')]['fields']));_0x50699c['attributes']=_0x50699c[_0x0c78('0x33')]['length']?_0x50699c[_0x0c78('0x33')]:_0x56c9c9[_0x0c78('0x2e')];_0x50699c=_[_0x0c78('0x35')]({},_0x50699c,_0x156da4[_0x0c78('0x36')]);return utilLicense[_0x0c78('0x37')](_0x50699c)[_0x0c78('0x27')](respondWithResult(_0x289a3a,null))[_0x0c78('0x38')](handleError(_0x289a3a,null));};exports[_0x0c78('0x26')]=function(_0x2a4e4a,_0x1e2e6f){if(_0x2a4e4a[_0x0c78('0x39')]['id']){delete _0x2a4e4a[_0x0c78('0x39')]['id'];}return db['License'][_0x0c78('0x3a')]({'where':{'id':_0x2a4e4a['params']['id']}})[_0x0c78('0x27')](handleEntityNotFound(_0x1e2e6f,null))[_0x0c78('0x27')](function(_0xc2ba4e){var _0x580539=_0xc2ba4e[_0x0c78('0x3b')]({'plain':!![]});return utilLicense[_0x0c78('0x3c')](_0x580539,_0x2a4e4a[_0x0c78('0x39')][_0x0c78('0x3d')]);})[_0x0c78('0x27')](function(_0x1afd0f){if(!_0x1afd0f[_0x0c78('0x3e')]){return saveUpdates(_0x2a4e4a[_0x0c78('0x39')],null);}return _0x1afd0f;})['then'](respondWithResult(_0x1e2e6f,null))['catch'](handleError(_0x1e2e6f,null));};exports[_0x0c78('0x3f')]=function(_0x54bdff,_0x96873a){var _0x581d0c=_0x0c78('0x40');var _0xc3e8f=path[_0x0c78('0x41')]('/var',_0x0c78('0x42'),_0x0c78('0x43'),_0x581d0c);_0x96873a[_0x0c78('0x44')](_0x0c78('0x45'),_0x0c78('0x46')+_0x581d0c);_0x96873a[_0x0c78('0x22')](_0x0c78('0x47'),_0x0c78('0x48'));_0x96873a[_0x0c78('0x49')](_0xc3e8f);}; \ No newline at end of file +var _0x4dec=['fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','getLicense','catch','body','find','params','checkLicense','key','downloadLogFile','join','log','xcally','setHeader','attachment;\x20filename=','Content-Type','eml-format','rimraf','zip-dir'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x4dec,0x81));var _0xc4de=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4dec[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xc4de('0x0'));var rimraf=require(_0xc4de('0x1'));var zipdir=require(_0xc4de('0x2'));var jsonpatch=require(_0xc4de('0x3'));var rp=require(_0xc4de('0x4'));var moment=require('moment');var BPromise=require(_0xc4de('0x5'));var Mustache=require(_0xc4de('0x6'));var util=require('util');var path=require(_0xc4de('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4de('0x8'));var fs=require('fs');var fs_extra=require(_0xc4de('0x9'));var _=require(_0xc4de('0xa'));var squel=require(_0xc4de('0xb'));var crypto=require(_0xc4de('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4de('0xd'));var querystring=require(_0xc4de('0xe'));var Papa=require(_0xc4de('0xf'));var Redis=require(_0xc4de('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc4de('0x11'));var as=require(_0xc4de('0x12'));var hardwareService=require(_0xc4de('0x13'));var logger=require('../../config/logger')(_0xc4de('0x14'));var utils=require(_0xc4de('0x15'));var config=require(_0xc4de('0x16'));var licenseUtil=require(_0xc4de('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3022,_0x17fa9e){_0x17fa9e=_0x17fa9e||0xcc;return function(_0x308483){if(_0x308483){return _0x4f3022[_0xc4de('0x18')](_0x17fa9e);}return _0x4f3022[_0xc4de('0x19')](_0x17fa9e)['end']();};}function respondWithResult(_0x289193,_0x5d17d9){_0x5d17d9=_0x5d17d9||0xc8;return function(_0x290d88){if(_0x290d88){return _0x289193[_0xc4de('0x19')](_0x5d17d9)['json'](_0x290d88);}};}function respondWithFilteredResult(_0x2b3604,_0x4913db){return function(_0x3bab27){if(_0x3bab27){var _0x4e0d79=typeof _0x4913db[_0xc4de('0x1a')]===_0xc4de('0x1b')&&typeof _0x4913db[_0xc4de('0x1c')]===_0xc4de('0x1b');var _0x548f95=_0x3bab27[_0xc4de('0x1d')];var _0x75080f=_0x4e0d79?0x0:_0x4913db[_0xc4de('0x1a')];var _0x310cdc=_0x4e0d79?_0x3bab27[_0xc4de('0x1d')]:_0x4913db[_0xc4de('0x1a')]+_0x4913db['limit'];var _0x1c2bb3;if(_0x310cdc>=_0x548f95){_0x310cdc=_0x548f95;_0x1c2bb3=0xc8;}else{_0x1c2bb3=0xce;}_0x2b3604['status'](_0x1c2bb3);return _0x2b3604[_0xc4de('0x1e')](_0xc4de('0x1f'),_0x75080f+'-'+_0x310cdc+'/'+_0x548f95)['json'](_0x3bab27);}return null;};}function patchUpdates(_0x3bba63){return function(_0x5ee932){try{jsonpatch[_0xc4de('0x20')](_0x5ee932,_0x3bba63,!![]);}catch(_0x3d2ba2){return BPromise[_0xc4de('0x21')](_0x3d2ba2);}return _0x5ee932[_0xc4de('0x22')]();};}function saveUpdates(_0xc999c2,_0x22cda2){return function(_0x53a59b){if(_0x53a59b){return _0x53a59b[_0xc4de('0x23')](_0xc999c2)[_0xc4de('0x24')](function(_0xc51da8){return _0xc51da8;});}return null;};}function removeEntity(_0x2f904b,_0x2be156){return function(_0x25f7b4){if(_0x25f7b4){return _0x25f7b4['destroy']()[_0xc4de('0x24')](function(){_0x2f904b[_0xc4de('0x19')](0xcc)[_0xc4de('0x25')]();});}};}function handleEntityNotFound(_0x5099e5,_0x5c7881){return function(_0x4df386){if(!_0x4df386){_0x5099e5[_0xc4de('0x18')](0x194);}return _0x4df386;};}function handleError(_0x833da,_0x5b66fa){_0x5b66fa=_0x5b66fa||0x1f4;return function(_0x25e98c){logger[_0xc4de('0x26')](_0x25e98c['stack']);if(_0x25e98c[_0xc4de('0x27')]){delete _0x25e98c['name'];}_0x833da[_0xc4de('0x19')](_0x5b66fa)[_0xc4de('0x28')](_0x25e98c);};}var utilLicense=require(_0xc4de('0x17'));exports[_0xc4de('0x29')]=function(_0x2b2c7d,_0x5d2da6){var _0x3cded9={'raw':!![],'where':{'id':0x1}},_0x18c6ea={};_0x18c6ea[_0xc4de('0x2a')]=_[_0xc4de('0x2b')](db[_0xc4de('0x2c')][_0xc4de('0x2d')]);_0x18c6ea[_0xc4de('0x2e')]=_[_0xc4de('0x2b')](_0x2b2c7d[_0xc4de('0x2e')]);_0x18c6ea[_0xc4de('0x2f')]=_[_0xc4de('0x30')](_0x18c6ea[_0xc4de('0x2a')],_0x18c6ea[_0xc4de('0x2e')]);_0x3cded9[_0xc4de('0x31')]=_[_0xc4de('0x30')](_0x18c6ea[_0xc4de('0x2a')],qs[_0xc4de('0x32')](_0x2b2c7d[_0xc4de('0x2e')]['fields']));_0x3cded9['attributes']=_0x3cded9[_0xc4de('0x31')][_0xc4de('0x33')]?_0x3cded9[_0xc4de('0x31')]:_0x18c6ea[_0xc4de('0x2a')];_0x3cded9=_['merge']({},_0x3cded9,_0x2b2c7d['options']);return utilLicense[_0xc4de('0x34')](_0x3cded9)[_0xc4de('0x24')](respondWithResult(_0x5d2da6,null))[_0xc4de('0x35')](handleError(_0x5d2da6,null));};exports['update']=function(_0x216649,_0x126584){if(_0x216649[_0xc4de('0x36')]['id']){delete _0x216649['body']['id'];}return db[_0xc4de('0x2c')][_0xc4de('0x37')]({'where':{'id':_0x216649[_0xc4de('0x38')]['id']}})[_0xc4de('0x24')](handleEntityNotFound(_0x126584,null))['then'](function(_0x130a81){var _0x2855f5=_0x130a81['get']({'plain':!![]});return utilLicense[_0xc4de('0x39')](_0x2855f5,_0x216649['body'][_0xc4de('0x3a')]);})[_0xc4de('0x24')](function(_0x20d78e){if(!_0x20d78e['demo']){return saveUpdates(_0x216649['body'],null);}return _0x20d78e;})['then'](respondWithResult(_0x126584,null))[_0xc4de('0x35')](handleError(_0x126584,null));};exports[_0xc4de('0x3b')]=function(_0x35963c,_0x28644f){var _0x423992='license-info.log';var _0x19639a=path[_0xc4de('0x3c')]('/var',_0xc4de('0x3d'),_0xc4de('0x3e'),_0x423992);_0x28644f[_0xc4de('0x3f')]('Content-disposition',_0xc4de('0x40')+_0x423992);_0x28644f[_0xc4de('0x1e')](_0xc4de('0x41'),'text/plain');_0x28644f['download'](_0x19639a);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a324b14..1499332 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 _0xdf1f=['./license.attributes','exports','License','license','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3a49fa,_0x470a15){var _0x205591=function(_0x45385c){while(--_0x45385c){_0x3a49fa['push'](_0x3a49fa['shift']());}};_0x205591(++_0x470a15);}(_0xdf1f,0x10c));var _0xfdf1=function(_0x4d9d54,_0x1b9bcf){_0x4d9d54=_0x4d9d54-0x0;var _0x489b1b=_0xdf1f[_0x4d9d54];return _0x489b1b;};'use strict';var _=require(_0xfdf1('0x0'));var util=require('util');var logger=require(_0xfdf1('0x1'))(_0xfdf1('0x2'));var moment=require(_0xfdf1('0x3'));var BPromise=require(_0xfdf1('0x4'));var rp=require(_0xfdf1('0x5'));var fs=require('fs');var path=require(_0xfdf1('0x6'));var rimraf=require('rimraf');var config=require(_0xfdf1('0x7'));var attributes=require(_0xfdf1('0x8'));module[_0xfdf1('0x9')]=function(_0x5da99c,_0x4b1909){return _0x5da99c['define'](_0xfdf1('0xa'),attributes,{'tableName':_0xfdf1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x800f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','License','license'];(function(_0x2c770a,_0x39607a){var _0x3424ba=function(_0x2b1f63){while(--_0x2b1f63){_0x2c770a['push'](_0x2c770a['shift']());}};_0x3424ba(++_0x39607a);}(_0x800f,0xdd));var _0xf800=function(_0x3f6aab,_0x500c95){_0x3f6aab=_0x3f6aab-0x0;var _0xf7a8a4=_0x800f[_0x3f6aab];return _0xf7a8a4;};'use strict';var _=require(_0xf800('0x0'));var util=require(_0xf800('0x1'));var logger=require(_0xf800('0x2'))(_0xf800('0x3'));var moment=require(_0xf800('0x4'));var BPromise=require(_0xf800('0x5'));var rp=require(_0xf800('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf800('0x7'));var config=require(_0xf800('0x8'));var attributes=require(_0xf800('0x9'));module[_0xf800('0xa')]=function(_0x4ffbf4,_0x25f2fc){return _0x4ffbf4['define'](_0xf800('0xb'),attributes,{'tableName':_0xf800('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 184999b..102f325 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 _0x82fe=['result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1e03bd,_0x4482fc){var _0x1672dd=function(_0x453d90){while(--_0x453d90){_0x1e03bd['push'](_0x1e03bd['shift']());}};_0x1672dd(++_0x4482fc);}(_0x82fe,0xfe));var _0xe82f=function(_0x4a4b45,_0x16bc77){_0x4a4b45=_0x4a4b45-0x0;var _0x3d9e27=_0x82fe[_0x4a4b45];return _0x3d9e27;};'use strict';var _=require(_0xe82f('0x0'));var util=require(_0xe82f('0x1'));var moment=require(_0xe82f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe82f('0x3'));var fs=require('fs');var Redis=require(_0xe82f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe82f('0x5'));var logger=require(_0xe82f('0x6'))(_0xe82f('0x7'));var config=require(_0xe82f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe82f('0x9')][_0xe82f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30ca7b,_0x18f131,_0x49eca6){return new BPromise(function(_0x334394,_0x4e0c28){return client[_0xe82f('0xb')](_0x30ca7b,_0x49eca6)[_0xe82f('0xc')](function(_0x2a8fd4){logger['info'](_0xe82f('0xd'),_0x18f131,_0xe82f('0xe'));logger[_0xe82f('0xf')](_0xe82f('0x10'),_0x18f131,_0xe82f('0xe'),JSON[_0xe82f('0x11')](_0x2a8fd4));if(_0x2a8fd4[_0xe82f('0x12')]){if(_0x2a8fd4['error'][_0xe82f('0x13')]===0x1f4){logger[_0xe82f('0x12')](_0xe82f('0xd'),_0x18f131,_0x2a8fd4[_0xe82f('0x12')]['message']);return _0x4e0c28(_0x2a8fd4[_0xe82f('0x12')][_0xe82f('0x14')]);}logger[_0xe82f('0x12')](_0xe82f('0xd'),_0x18f131,_0x2a8fd4[_0xe82f('0x12')][_0xe82f('0x14')]);return _0x334394(_0x2a8fd4['error']['message']);}else{logger[_0xe82f('0x15')](_0xe82f('0xd'),_0x18f131,_0xe82f('0xe'));_0x334394(_0x2a8fd4[_0xe82f('0x16')][_0xe82f('0x14')]);}})['catch'](function(_0x17c55d){logger[_0xe82f('0x12')](_0xe82f('0xd'),_0x18f131,_0x17c55d);_0x4e0c28(_0x17c55d);});});} \ No newline at end of file +var _0x51a3=['jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x51a3,0xb0));var _0x351a=function(_0x4f595b,_0x21875e){_0x4f595b=_0x4f595b-0x0;var _0xc9597c=_0x51a3[_0x4f595b];return _0xc9597c;};'use strict';var _=require(_0x351a('0x0'));var util=require(_0x351a('0x1'));var moment=require('moment');var BPromise=require(_0x351a('0x2'));var rs=require(_0x351a('0x3'));var fs=require('fs');var Redis=require(_0x351a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x351a('0x5'))(_0x351a('0x6'));var config=require(_0x351a('0x7'));var jayson=require(_0x351a('0x8'));var client=jayson[_0x351a('0x9')][_0x351a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35601e,_0x1bbda0,_0x25bd3f){return new BPromise(function(_0x378c0e,_0x40b8f7){return client[_0x351a('0xb')](_0x35601e,_0x25bd3f)[_0x351a('0xc')](function(_0x26fa08){logger[_0x351a('0xd')](_0x351a('0xe'),_0x1bbda0,'request\x20sent');logger[_0x351a('0xf')](_0x351a('0x10'),_0x1bbda0,_0x351a('0x11'),JSON[_0x351a('0x12')](_0x26fa08));if(_0x26fa08[_0x351a('0x13')]){if(_0x26fa08[_0x351a('0x13')][_0x351a('0x14')]===0x1f4){logger[_0x351a('0x13')](_0x351a('0xe'),_0x1bbda0,_0x26fa08[_0x351a('0x13')][_0x351a('0x15')]);return _0x40b8f7(_0x26fa08['error'][_0x351a('0x15')]);}logger[_0x351a('0x13')](_0x351a('0xe'),_0x1bbda0,_0x26fa08[_0x351a('0x13')][_0x351a('0x15')]);return _0x378c0e(_0x26fa08[_0x351a('0x13')]['message']);}else{logger[_0x351a('0xd')]('License,\x20%s,\x20%s',_0x1bbda0,_0x351a('0x11'));_0x378c0e(_0x26fa08['result'][_0x351a('0x15')]);}})[_0x351a('0x16')](function(_0x5aa5a0){logger[_0x351a('0x13')](_0x351a('0xe'),_0x1bbda0,_0x5aa5a0);_0x40b8f7(_0x5aa5a0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 185dc65..c3dc65c 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 _0x2a05=['send','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','/:id/users','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','getAgents','addDisposition','post','addAnswer','create','addSmtp','addInteraction','addApplications','/:id/send'];(function(_0x1e4dca,_0x44147a){var _0x355ca9=function(_0x4d49b2){while(--_0x4d49b2){_0x1e4dca['push'](_0x1e4dca['shift']());}};_0x355ca9(++_0x44147a);}(_0x2a05,0x182));var _0x52a0=function(_0x46f181,_0x30ddf5){_0x46f181=_0x46f181-0x0;var _0xa7c9ec=_0x2a05[_0x46f181];return _0xa7c9ec;};'use strict';var multer=require(_0x52a0('0x0'));var util=require(_0x52a0('0x1'));var path=require('path');var timeout=require(_0x52a0('0x2'));var express=require('express');var router=express[_0x52a0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x52a0('0x4'));var interaction=require(_0x52a0('0x5'));var config=require(_0x52a0('0x6'));var controller=require(_0x52a0('0x7'));router[_0x52a0('0x8')]('/',auth[_0x52a0('0x9')](),controller['index']);router[_0x52a0('0x8')](_0x52a0('0xa'),auth[_0x52a0('0x9')](),controller[_0x52a0('0xb')]);router[_0x52a0('0x8')](_0x52a0('0xc'),auth[_0x52a0('0x9')](),controller[_0x52a0('0xd')]);router[_0x52a0('0x8')](_0x52a0('0xe'),auth['isAuthenticated'](),controller[_0x52a0('0xf')]);router[_0x52a0('0x8')](_0x52a0('0x10'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x11')]);router['get'](_0x52a0('0x12'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x13')]);router[_0x52a0('0x8')](_0x52a0('0x14'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x15')]);router[_0x52a0('0x8')]('/:id/interactions',auth[_0x52a0('0x9')](),controller[_0x52a0('0x16')]);router[_0x52a0('0x8')](_0x52a0('0x17'),auth['isAuthenticated'](),controller[_0x52a0('0x18')]);router['get'](_0x52a0('0x19'),auth['isAuthenticated'](),controller['getMessages']);router[_0x52a0('0x8')](_0x52a0('0x1a'),auth['isAuthenticated'](),controller[_0x52a0('0x1b')]);router[_0x52a0('0x8')]('/:id/users',auth[_0x52a0('0x9')](),controller[_0x52a0('0x1c')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x52a0('0x1d')]);router[_0x52a0('0x1e')](_0x52a0('0x10'),auth['isAuthenticated'](),controller[_0x52a0('0x1f')]);router[_0x52a0('0x1e')]('/',auth[_0x52a0('0x9')](),controller[_0x52a0('0x20')]);router[_0x52a0('0x1e')]('/:id/in_servers',auth[_0x52a0('0x9')](),controller['addImap']);router['post'](_0x52a0('0x14'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x21')]);router['post']('/:id/interactions',auth[_0x52a0('0x9')](),controller[_0x52a0('0x22')]);router[_0x52a0('0x1e')](_0x52a0('0x17'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x23')]);router[_0x52a0('0x1e')](_0x52a0('0x24'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x25')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x52a0('0x26')](_0x52a0('0xc'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x27')]);router[_0x52a0('0x28')](_0x52a0('0xe'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x29')]);router[_0x52a0('0x28')](_0x52a0('0x10'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x2a')]);router[_0x52a0('0x28')](_0x52a0('0x12'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x2b')]);router[_0x52a0('0x28')](_0x52a0('0x14'),auth[_0x52a0('0x9')](),controller['removeSmtp']);router[_0x52a0('0x28')](_0x52a0('0xc'),auth[_0x52a0('0x9')](),controller[_0x52a0('0x2c')]);router[_0x52a0('0x28')](_0x52a0('0x2d'),auth[_0x52a0('0x9')](),controller['removeAgents']);module[_0x52a0('0x2e')]=router; \ No newline at end of file +var _0x5eab=['Router','fs-extra','../../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','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addInteraction','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeSmtp','destroy','removeAgents','exports','path','connect-timeout','express'];(function(_0x19d835,_0xe87640){var _0x3171f4=function(_0x595e6f){while(--_0x595e6f){_0x19d835['push'](_0x19d835['shift']());}};_0x3171f4(++_0xe87640);}(_0x5eab,0x11d));var _0xb5ea=function(_0x45f1b3,_0x2300fa){_0x45f1b3=_0x45f1b3-0x0;var _0x5744d6=_0x5eab[_0x45f1b3];return _0x5744d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5ea('0x0'));var timeout=require(_0xb5ea('0x1'));var express=require(_0xb5ea('0x2'));var router=express[_0xb5ea('0x3')]();var fs_extra=require(_0xb5ea('0x4'));var auth=require(_0xb5ea('0x5'));var interaction=require(_0xb5ea('0x6'));var config=require(_0xb5ea('0x7'));var controller=require('./mailAccount.controller');router[_0xb5ea('0x8')]('/',auth[_0xb5ea('0x9')](),controller['index']);router[_0xb5ea('0x8')](_0xb5ea('0xa'),auth[_0xb5ea('0x9')](),controller['describe']);router['get'](_0xb5ea('0xb'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0xc')]);router['get'](_0xb5ea('0xd'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0xe')]);router[_0xb5ea('0x8')](_0xb5ea('0xf'),auth['isAuthenticated'](),controller[_0xb5ea('0x10')]);router['get']('/:id/in_servers',auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x11')]);router[_0xb5ea('0x8')](_0xb5ea('0x12'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x13')]);router[_0xb5ea('0x8')](_0xb5ea('0x14'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x15')]);router['get'](_0xb5ea('0x16'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x17')]);router['get'](_0xb5ea('0x18'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x19')]);router[_0xb5ea('0x8')](_0xb5ea('0x1a'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0xb5ea('0x8')](_0xb5ea('0x1b'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x1c')]);router['post'](_0xb5ea('0xd'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x1d')]);router[_0xb5ea('0x1e')](_0xb5ea('0xf'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x1f')]);router[_0xb5ea('0x1e')]('/',auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x20')]);router[_0xb5ea('0x1e')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xb5ea('0x21')]);router[_0xb5ea('0x1e')](_0xb5ea('0x12'),auth[_0xb5ea('0x9')](),controller['addSmtp']);router[_0xb5ea('0x1e')](_0xb5ea('0x14'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x22')]);router[_0xb5ea('0x1e')](_0xb5ea('0x16'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x23')]);router[_0xb5ea('0x1e')](_0xb5ea('0x24'),auth[_0xb5ea('0x9')](),controller['send']);router['post'](_0xb5ea('0x1b'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x25')]);router[_0xb5ea('0x26')]('/:id',auth['isAuthenticated'](),controller[_0xb5ea('0x27')]);router[_0xb5ea('0x28')](_0xb5ea('0xd'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x29')]);router[_0xb5ea('0x28')]('/:id/canned_answers',auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x2a')]);router[_0xb5ea('0x28')](_0xb5ea('0x2b'),auth['isAuthenticated'](),controller['removeImap']);router[_0xb5ea('0x28')](_0xb5ea('0x12'),auth['isAuthenticated'](),controller[_0xb5ea('0x2c')]);router['delete'](_0xb5ea('0xb'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x2d')]);router[_0xb5ea('0x28')](_0xb5ea('0x1b'),auth[_0xb5ea('0x9')](),controller[_0xb5ea('0x2e')]);module[_0xb5ea('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index af9228a..599b4ad 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 _0xee79=['gmail','hotmail','outlook365','getDataValue','provider','custom','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}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x4b253c,_0x50508f){var _0x2db07f=function(_0x598156){while(--_0x598156){_0x4b253c['push'](_0x4b253c['shift']());}};_0x2db07f(++_0x50508f);}(_0xee79,0x16e));var _0x9ee7=function(_0x1f7a55,_0x352d22){_0x1f7a55=_0x1f7a55-0x0;var _0x2a291b=_0xee79[_0x1f7a55];return _0x2a291b;};'use strict';var Sequelize=require('sequelize');module[_0x9ee7('0x0')]={'description':{'type':Sequelize[_0x9ee7('0x1')]},'name':{'type':Sequelize[_0x9ee7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x9ee7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x9ee7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x9ee7('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x9ee7('0x3')]},'markAsUnread':{'type':Sequelize[_0x9ee7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9ee7('0x1')],'allowNull':![],'defaultValue':_0x9ee7('0x4')},'fontSize':{'type':Sequelize[_0x9ee7('0x5')](0x2)[_0x9ee7('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9ee7('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9ee7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9ee7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9ee7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ee7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ee7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9ee7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ee7('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9ee7('0x8'),'set':function(_0x32cb1c){if(!_0x32cb1c)this[_0x9ee7('0x9')](_0x9ee7('0xa'),null);this['setDataValue'](_0x9ee7('0xb'),_0x32cb1c);}},'provider':{'type':Sequelize['ENUM'](_0x9ee7('0xc'),_0x9ee7('0xd'),'yahoo',_0x9ee7('0xe')),'defaultValue':null,'get':function(){if(!this[_0x9ee7('0xf')]('provider'))return'custom';return this[_0x9ee7('0xf')](_0x9ee7('0x10'));},'set':function(_0x17fa2d){if(_0x17fa2d===_0x9ee7('0x11'))_0x17fa2d=null;return this[_0x9ee7('0x9')](_0x9ee7('0x10'),_0x17fa2d);}}}; \ No newline at end of file +var _0x6cc5=['mandatoryDispositionPauseId','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x6cc5,0x14b));var _0x56cc=function(_0x189e8a,_0x356211){_0x189e8a=_0x189e8a-0x0;var _0x33f0ab=_0x6cc5[_0x189e8a];return _0x33f0ab;};'use strict';var Sequelize=require('sequelize');module[_0x56cc('0x0')]={'description':{'type':Sequelize[_0x56cc('0x1')]},'name':{'type':Sequelize[_0x56cc('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x56cc('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x56cc('0x1')],'allowNull':![],'defaultValue':_0x56cc('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x56cc('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x56cc('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x56cc('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x56cc('0x2')],'defaultValue':![],'comment':_0x56cc('0x7'),'set':function(_0x1d6847){if(!_0x1d6847)this[_0x56cc('0x8')](_0x56cc('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x1d6847);}},'provider':{'type':Sequelize[_0x56cc('0xa')](_0x56cc('0xb'),_0x56cc('0xc'),'yahoo',_0x56cc('0xd')),'defaultValue':null,'get':function(){if(!this[_0x56cc('0xe')](_0x56cc('0xf')))return _0x56cc('0x10');return this[_0x56cc('0xe')](_0x56cc('0xf'));},'set':function(_0x5b0e4f){if(_0x5b0e4f===_0x56cc('0x10'))_0x5b0e4f=null;return this[_0x56cc('0x8')](_0x56cc('0xf'),_0x5b0e4f);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 9f8a441..3dbc1af 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 _0x2c85=['split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','defaults','messageId','subject','out','Interaction','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','undefined','count','Content-Range','destroy','get','MailAccounts','stack','name','send','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','rows','params','intersection','find','catch','update','body','provider','MailServerIn','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','findOne','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','key','custom','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','json','getApplications','getMessages','MailMessage','$gte'];(function(_0x20bbaa,_0x2d39be){var _0x33e6c5=function(_0x36a45c){while(--_0x36a45c){_0x20bbaa['push'](_0x20bbaa['shift']());}};_0x33e6c5(++_0x2d39be);}(_0x2c85,0xde));var _0x52c8=function(_0x184b7d,_0x4cde4e){_0x184b7d=_0x184b7d-0x0;var _0xe51a6f=_0x2c85[_0x184b7d];return _0xe51a6f;};'use strict';var moment=require(_0x52c8('0x0'));var BPromise=require('bluebird');var util=require(_0x52c8('0x1'));var path=require(_0x52c8('0x2'));var _=require(_0x52c8('0x3'));var juice=require(_0x52c8('0x4'));var Redis=require(_0x52c8('0x5'));var qs=require(_0x52c8('0x6'));var logger=require(_0x52c8('0x7'))('api');var config=require('../../config/environment');var db=require(_0x52c8('0x8'))['db'];config[_0x52c8('0x9')]=_['defaults'](config['redis'],{'host':_0x52c8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x52c8('0xb'))['register'](socket);var jayson=require(_0x52c8('0xc'));var client=jayson[_0x52c8('0xd')][_0x52c8('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x29065a,_0x1a707f,_0x452155,_0x356334){return new BPromise(function(_0x4d2eb5,_0x2cc738){var _0x17e6ad=_0x356334||client;return _0x17e6ad[_0x52c8('0xf')](_0x29065a,_0x452155)[_0x52c8('0x10')](function(_0xdd4f63){logger[_0x52c8('0x11')](_0x52c8('0x12'),_0x1a707f,_0x52c8('0x13'));logger[_0x52c8('0x14')](_0x52c8('0x15'),_0x1a707f,'request\x20sent',JSON[_0x52c8('0x16')](_0xdd4f63));if(_0xdd4f63[_0x52c8('0x17')]){if(_0xdd4f63['error'][_0x52c8('0x18')]===0x1f4){logger[_0x52c8('0x17')](_0x52c8('0x12'),_0x1a707f,_0xdd4f63[_0x52c8('0x17')][_0x52c8('0x19')]);return _0x2cc738(_0xdd4f63[_0x52c8('0x17')][_0x52c8('0x19')]);}logger[_0x52c8('0x17')](_0x52c8('0x12'),_0x1a707f,_0xdd4f63['error'][_0x52c8('0x19')]);return _0x4d2eb5(_0xdd4f63[_0x52c8('0x17')][_0x52c8('0x19')]);}else{logger['info'](_0x52c8('0x12'),_0x1a707f,'request\x20sent');_0x4d2eb5(_0xdd4f63[_0x52c8('0x1a')][_0x52c8('0x19')]);}})['catch'](function(_0x580d9c){logger[_0x52c8('0x17')]('MailAccount,\x20%s,\x20%s',_0x1a707f,_0x580d9c);_0x2cc738(_0x580d9c);});});}function respondWithStatusCode(_0x33ae05,_0x31f6b3){_0x31f6b3=_0x31f6b3||0xcc;return function(_0xf6105b){if(_0xf6105b){return _0x33ae05[_0x52c8('0x1b')](_0x31f6b3);}return _0x33ae05[_0x52c8('0x1c')](_0x31f6b3)[_0x52c8('0x1d')]();};}function respondWithResult(_0x5531e9,_0xdc9331){_0xdc9331=_0xdc9331||0xc8;return function(_0x13099e){if(_0x13099e){return _0x5531e9[_0x52c8('0x1c')](_0xdc9331)['json'](_0x13099e);}};}function respondWithFilteredResult(_0x5cd9a4,_0x53b3da){return function(_0x4f8e48){if(_0x4f8e48){var _0x5a3fc8=typeof _0x53b3da[_0x52c8('0x1e')]==='undefined'&&typeof _0x53b3da[_0x52c8('0x1f')]===_0x52c8('0x20');var _0x5747e2=_0x4f8e48[_0x52c8('0x21')];var _0x3780e2=_0x5a3fc8?0x0:_0x53b3da['offset'];var _0x3f2880=_0x5a3fc8?_0x4f8e48[_0x52c8('0x21')]:_0x53b3da[_0x52c8('0x1e')]+_0x53b3da[_0x52c8('0x1f')];var _0x4d9d68;if(_0x3f2880>=_0x5747e2){_0x3f2880=_0x5747e2;_0x4d9d68=0xc8;}else{_0x4d9d68=0xce;}_0x5cd9a4[_0x52c8('0x1c')](_0x4d9d68);return _0x5cd9a4['set'](_0x52c8('0x22'),_0x3780e2+'-'+_0x3f2880+'/'+_0x5747e2)['json'](_0x4f8e48);}return null;};}function saveUpdates(_0x1f20a9){return function(_0x2552df){if(_0x2552df){return _0x2552df['update'](_0x1f20a9)['then'](function(_0x185bd9){return _0x185bd9;});}return null;};}function removeEntity(_0xce45d7){return function(_0x459506){if(_0x459506){return _0x459506[_0x52c8('0x23')]()[_0x52c8('0x10')](function(){var _0x5e4df2=_0x459506[_0x52c8('0x24')]({'plain':!![]});var _0x4db686=_0x52c8('0x25');return db['UserProfileResource'][_0x52c8('0x23')]({'where':{'type':_0x4db686,'resourceId':_0x5e4df2['id']}})[_0x52c8('0x10')](function(){return _0x459506;});})[_0x52c8('0x10')](function(){_0xce45d7[_0x52c8('0x1c')](0xcc)[_0x52c8('0x1d')]();});}};}function handleEntityNotFound(_0x4c45c2){return function(_0x46e645){if(!_0x46e645){_0x4c45c2['sendStatus'](0x194);}return _0x46e645;};}function handleError(_0x2d5e84,_0x1209d2){_0x1209d2=_0x1209d2||0x1f4;return function(_0x4f290c){logger[_0x52c8('0x17')](_0x4f290c[_0x52c8('0x26')]);if(_0x4f290c[_0x52c8('0x27')]){delete _0x4f290c['name'];}_0x2d5e84[_0x52c8('0x1c')](_0x1209d2)[_0x52c8('0x28')](_0x4f290c);};}function getImapHost(_0x434e4a){switch(_0x434e4a){case'gmail':return _0x52c8('0x29');case _0x52c8('0x2a'):return'imap.mail.yahoo.com';case _0x52c8('0x2b'):return _0x52c8('0x2c');case _0x52c8('0x2d'):return _0x52c8('0x2e');}throw new Error(_0x52c8('0x2f'),_0x434e4a);}function getSmtpHost(_0x38b719){switch(_0x38b719){case _0x52c8('0x30'):return _0x52c8('0x31');case _0x52c8('0x2a'):return _0x52c8('0x32');case _0x52c8('0x2b'):return _0x52c8('0x33');case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x38b719);}function getAuthenticationOptions(_0x3c93ed,_0x6adfcd){var _0x1725d6={};var _0x188b73={};if(_0x3c93ed){_0x1725d6[_0x52c8('0x34')]=_0x188b73[_0x52c8('0x34')]=_0x6adfcd[_0x52c8('0x35')];_0x1725d6[_0x52c8('0x36')]=_0x188b73[_0x52c8('0x37')]=_0x6adfcd[_0x52c8('0x36')];if(_0x6adfcd['modernAuthentication']){_0x1725d6[_0x52c8('0x38')]=_0x188b73['modernAuthentication']=!![];_0x1725d6[_0x52c8('0x39')]=_0x188b73[_0x52c8('0x39')]=_0x6adfcd[_0x52c8('0x39')];_0x1725d6[_0x52c8('0x36')]=_0x188b73['pass']=null;}else{_0x1725d6[_0x52c8('0x39')]=_0x188b73[_0x52c8('0x39')]=null;}_0x1725d6[_0x52c8('0x3a')]=getImapHost(_0x3c93ed);_0x1725d6[_0x52c8('0x3b')]=0x3e1;_0x188b73[_0x52c8('0x3a')]=getSmtpHost(_0x3c93ed);_0x188b73[_0x52c8('0x3b')]=0x24b;_0x188b73[_0x52c8('0x3c')]=![];_0x1725d6[_0x52c8('0x3d')]=_0x188b73[_0x52c8('0x3d')]=null;}else{if(_0x6adfcd[_0x52c8('0x3e')]){_0x1725d6['user']=_0x188b73[_0x52c8('0x34')]=_0x6adfcd[_0x52c8('0x35')];_0x1725d6['password']=_0x188b73[_0x52c8('0x37')]=_0x6adfcd['password'];}else{_0x1725d6[_0x52c8('0x3e')]=_0x188b73[_0x52c8('0x3e')]=![];_0x1725d6['user']=_0x188b73[_0x52c8('0x34')]=null;_0x1725d6[_0x52c8('0x36')]=_0x188b73['pass']=null;}_0x1725d6['host']=_0x6adfcd[_0x52c8('0x3f')][_0x52c8('0x3a')];_0x1725d6[_0x52c8('0x3b')]=_0x6adfcd[_0x52c8('0x3f')][_0x52c8('0x3b')];_0x188b73['host']=_0x6adfcd[_0x52c8('0x40')][_0x52c8('0x3a')];_0x188b73[_0x52c8('0x3b')]=_0x6adfcd['Smtp'][_0x52c8('0x3b')];}return{'Imap':_0x1725d6,'Smtp':_0x188b73};}exports['index']=function(_0x5d403f,_0x2bc283){var _0x8bf0ed={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x52c8('0x41')],'as':_0x52c8('0x40')},{'model':db[_0x52c8('0x42')],'as':_0x52c8('0x43')}]},_0x4f868c={},_0x103395={'count':0x0,'rows':[]};var _0xeeae2=_[_0x52c8('0x44')](db['MailAccount'][_0x52c8('0x45')],function(_0x41fd2b){return{'name':_0x41fd2b[_0x52c8('0x46')],'type':_0x41fd2b[_0x52c8('0x47')]['key']};});_0x4f868c['model']=_[_0x52c8('0x44')](_0xeeae2,_0x52c8('0x27'));_0x4f868c[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0x5d403f[_0x52c8('0x48')]);_0x4f868c[_0x52c8('0x4a')]=_['intersection'](_0x4f868c[_0x52c8('0x4b')],_0x4f868c['query']);_0x8bf0ed[_0x52c8('0x4c')]=_['intersection'](_0x4f868c['model'],qs[_0x52c8('0x4d')](_0x5d403f[_0x52c8('0x48')][_0x52c8('0x4d')]));_0x8bf0ed[_0x52c8('0x4c')]=_0x8bf0ed[_0x52c8('0x4c')][_0x52c8('0x4e')]?_0x8bf0ed[_0x52c8('0x4c')]:_0x4f868c[_0x52c8('0x4b')];if(!_0x5d403f['query'][_0x52c8('0x4f')](_0x52c8('0x50'))){_0x8bf0ed[_0x52c8('0x1f')]=qs['limit'](_0x5d403f[_0x52c8('0x48')][_0x52c8('0x1f')]);_0x8bf0ed['offset']=qs[_0x52c8('0x1e')](_0x5d403f[_0x52c8('0x48')][_0x52c8('0x1e')]);}_0x8bf0ed[_0x52c8('0x51')]=qs[_0x52c8('0x52')](_0x5d403f[_0x52c8('0x48')][_0x52c8('0x52')]);_0x8bf0ed['where']=qs[_0x52c8('0x4a')](_[_0x52c8('0x53')](_0x5d403f['query'],_0x4f868c['filters']),_0xeeae2);if(_0x5d403f[_0x52c8('0x48')][_0x52c8('0x54')]){_0x8bf0ed[_0x52c8('0x55')]=_[_0x52c8('0x56')](_0x8bf0ed['where'],{'$or':_[_0x52c8('0x44')](_0xeeae2,function(_0x15ef19){if(_0x15ef19['type']!==_0x52c8('0x57')){var _0x2d8152={};_0x2d8152[_0x15ef19['name']]={'$like':'%'+_0x5d403f[_0x52c8('0x48')][_0x52c8('0x54')]+'%'};return _0x2d8152;}})});}_0x8bf0ed=_[_0x52c8('0x56')]({},_0x8bf0ed,_0x5d403f[_0x52c8('0x58')]);var _0x3323d5={'where':_0x8bf0ed['where']};return db[_0x52c8('0x59')][_0x52c8('0x21')](_0x3323d5)[_0x52c8('0x10')](function(_0x41e496){_0x103395['count']=_0x41e496;if(_0x5d403f[_0x52c8('0x48')][_0x52c8('0x5a')]){_0x8bf0ed[_0x52c8('0x5b')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x8bf0ed);})[_0x52c8('0x10')](function(_0x58f57e){_0x103395[_0x52c8('0x5c')]=_0x58f57e;return _0x103395;})[_0x52c8('0x10')](respondWithFilteredResult(_0x2bc283,_0x8bf0ed))['catch'](handleError(_0x2bc283,null));};exports['show']=function(_0x214e7e,_0x7b187d){var _0x2cdcc8={'raw':![],'where':{'id':_0x214e7e[_0x52c8('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x52c8('0x41')],'as':_0x52c8('0x40')},{'model':db['Pause'],'as':_0x52c8('0x43')}]},_0xf34b51={};_0xf34b51[_0x52c8('0x4b')]=_[_0x52c8('0x49')](db[_0x52c8('0x59')][_0x52c8('0x45')]);_0xf34b51[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0x214e7e['query']);_0xf34b51['filters']=_[_0x52c8('0x5e')](_0xf34b51[_0x52c8('0x4b')],_0xf34b51[_0x52c8('0x48')]);_0x2cdcc8[_0x52c8('0x4c')]=_[_0x52c8('0x5e')](_0xf34b51[_0x52c8('0x4b')],qs[_0x52c8('0x4d')](_0x214e7e[_0x52c8('0x48')]['fields']));_0x2cdcc8['attributes']=_0x2cdcc8['attributes'][_0x52c8('0x4e')]?_0x2cdcc8[_0x52c8('0x4c')]:_0xf34b51['model'];if(_0x214e7e['query'][_0x52c8('0x5a')]){_0x2cdcc8[_0x52c8('0x5b')]=[{'all':!![]}];}_0x2cdcc8=_['merge']({},_0x2cdcc8,_0x214e7e['options']);return db[_0x52c8('0x59')][_0x52c8('0x5f')](_0x2cdcc8)['then'](handleEntityNotFound(_0x7b187d,null))[_0x52c8('0x10')](respondWithResult(_0x7b187d,null))[_0x52c8('0x60')](handleError(_0x7b187d,null));};exports[_0x52c8('0x61')]=function(_0x209435,_0x1d01ea){if(_0x209435[_0x52c8('0x62')]['id']){delete _0x209435['body']['id'];}var _0x9b88b1=_0x209435[_0x52c8('0x62')][_0x52c8('0x63')]==='custom'?null:_0x209435[_0x52c8('0x62')][_0x52c8('0x63')];var _0x4bbe40=_0x209435[_0x52c8('0x62')]['Imap']||{};var _0x1a78b1=_0x209435[_0x52c8('0x62')][_0x52c8('0x40')]||{};if(_0x9b88b1){_0x4bbe40['host']=getImapHost(_0x9b88b1);_0x4bbe40['port']=0x3e1;_0x1a78b1['host']=getSmtpHost(_0x9b88b1);_0x1a78b1[_0x52c8('0x3b')]=0x24b;_0x1a78b1[_0x52c8('0x3c')]=![];}if(_0x1a78b1[_0x52c8('0x38')]){_0x1a78b1[_0x52c8('0x3c')]=![];}else{_0x1a78b1[_0x52c8('0x39')]=null;}if(!_0x4bbe40[_0x52c8('0x38')])_0x4bbe40['CloudProviderId']=null;_0x209435[_0x52c8('0x62')][_0x52c8('0x3f')]=_0x4bbe40;_0x209435[_0x52c8('0x62')][_0x52c8('0x40')]=_0x1a78b1;return db['MailAccount']['find']({'where':{'id':_0x209435[_0x52c8('0x5d')]['id']},'include':[{'model':db[_0x52c8('0x64')],'as':_0x52c8('0x3f')},{'model':db[_0x52c8('0x41')],'as':_0x52c8('0x40')},{'model':db[_0x52c8('0x42')],'as':_0x52c8('0x43')}]})[_0x52c8('0x10')](handleEntityNotFound(_0x1d01ea,null))['then'](function(_0x255c34){if(!_0x255c34)throw new Error(_0x52c8('0x65'));if(_0x255c34[_0x52c8('0x3d')])delete _0x209435[_0x52c8('0x62')][_0x52c8('0x3f')];return _0x255c34;})[_0x52c8('0x10')](saveUpdates(_0x209435['body'],null))[_0x52c8('0x10')](function(_0x5eea01){if(!_0x209435[_0x52c8('0x62')][_0x52c8('0x3f')])return _0x5eea01;return db['MailServerIn'][_0x52c8('0x61')](_0x209435[_0x52c8('0x62')][_0x52c8('0x3f')],{'where':{'MailAccountId':_0x5eea01['id']}})['then'](function(){return _0x5eea01;});})['then'](function(_0x466074){if(!_0x209435[_0x52c8('0x62')][_0x52c8('0x40')])return _0x466074;return db[_0x52c8('0x41')][_0x52c8('0x61')](_0x209435[_0x52c8('0x62')][_0x52c8('0x40')],{'where':{'MailAccountId':_0x466074['id']}})[_0x52c8('0x10')](function(){return _0x466074;});})[_0x52c8('0x10')](respondWithResult(_0x1d01ea,null))['catch'](handleError(_0x1d01ea,null));};exports[_0x52c8('0x66')]=function(_0x5227ac,_0x3c5121){return db[_0x52c8('0x59')][_0x52c8('0x66')]()['then'](respondWithResult(_0x3c5121,null))[_0x52c8('0x60')](handleError(_0x3c5121,null));};exports['addDisposition']=function(_0x550712,_0x5b3e31){if(_0x550712['body']['id']){delete _0x550712[_0x52c8('0x62')]['id'];}return db[_0x52c8('0x59')]['find']({'where':{'id':_0x550712['params']['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x5b3e31,null))[_0x52c8('0x10')](function(_0x2a5f71){if(_0x2a5f71){_0x550712[_0x52c8('0x62')][_0x52c8('0x67')]=_0x2a5f71['id'];return db[_0x52c8('0x68')][_0x52c8('0x69')](_0x550712[_0x52c8('0x62')]);}})[_0x52c8('0x10')](respondWithResult(_0x5b3e31,null))['catch'](handleError(_0x5b3e31,null));};exports['getDispositions']=function(_0xbffc46,_0x2469fd){var _0x598b45={'raw':![],'where':{}};var _0x55cb89={};var _0x599954={'count':0x0,'rows':[]};return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0xbffc46['params']['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x2469fd,null))[_0x52c8('0x10')](function(_0x3a082b){if(_0x3a082b){_0x55cb89['model']=_[_0x52c8('0x49')](db['Disposition'][_0x52c8('0x45')]);_0x55cb89[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0xbffc46[_0x52c8('0x48')]);_0x55cb89[_0x52c8('0x4a')]=_[_0x52c8('0x5e')](_0x55cb89['model'],_0x55cb89[_0x52c8('0x48')]);_0x598b45[_0x52c8('0x4c')]=_[_0x52c8('0x5e')](_0x55cb89['model'],qs[_0x52c8('0x4d')](_0xbffc46[_0x52c8('0x48')]['fields']));_0x598b45[_0x52c8('0x4c')]=_0x598b45['attributes']['length']?_0x598b45[_0x52c8('0x4c')]:_0x55cb89[_0x52c8('0x4b')];if(!_0xbffc46[_0x52c8('0x48')][_0x52c8('0x4f')](_0x52c8('0x50'))){_0x598b45[_0x52c8('0x1f')]=qs[_0x52c8('0x1f')](_0xbffc46[_0x52c8('0x48')][_0x52c8('0x1f')]);_0x598b45['offset']=qs[_0x52c8('0x1e')](_0xbffc46[_0x52c8('0x48')][_0x52c8('0x1e')]);}_0x598b45[_0x52c8('0x51')]=qs[_0x52c8('0x52')](_0xbffc46['query']['sort']);_0x598b45[_0x52c8('0x55')]=qs[_0x52c8('0x4a')](_[_0x52c8('0x53')](_0xbffc46[_0x52c8('0x48')],_0x55cb89['filters']));_0x598b45[_0x52c8('0x55')][_0x52c8('0x67')]=_0x3a082b['id'];if(_0xbffc46[_0x52c8('0x48')][_0x52c8('0x54')]){_0x598b45[_0x52c8('0x55')]=_[_0x52c8('0x56')](_0x598b45[_0x52c8('0x55')],{'$or':_[_0x52c8('0x44')](_0x598b45[_0x52c8('0x4c')],function(_0x175cbd){var _0x38ffab={};_0x38ffab[_0x175cbd]={'$like':'%'+_0xbffc46[_0x52c8('0x48')][_0x52c8('0x54')]+'%'};return _0x38ffab;})});}_0x598b45=_[_0x52c8('0x56')]({},_0x598b45,_0xbffc46[_0x52c8('0x58')]);return db[_0x52c8('0x68')][_0x52c8('0x21')]({'where':_0x598b45[_0x52c8('0x55')]})['then'](function(_0x4f169e){_0x599954[_0x52c8('0x21')]=_0x4f169e;if(_0xbffc46['query'][_0x52c8('0x5a')]){_0x598b45['include']=[{'all':!![]}];}return db['Disposition'][_0x52c8('0x6b')](_0x598b45);})['then'](function(_0x4ebea2){_0x599954['rows']=_0x4ebea2;return _0x599954;});}})[_0x52c8('0x10')](respondWithFilteredResult(_0x2469fd,_0x598b45))['catch'](handleError(_0x2469fd,null));};exports['removeDispositions']=function(_0x406b8b,_0x1d3560){return db[_0x52c8('0x59')][_0x52c8('0x5f')]({'where':{'id':_0x406b8b[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x1d3560,null))[_0x52c8('0x10')](function(_0x2576d3){if(_0x2576d3){return _0x2576d3[_0x52c8('0x6c')](_0x406b8b['query']['ids']);}})[_0x52c8('0x10')](respondWithStatusCode(_0x1d3560,null))[_0x52c8('0x60')](handleError(_0x1d3560,null));};exports['addAnswer']=function(_0x3b4aed,_0x4021da){if(_0x3b4aed[_0x52c8('0x62')]['id']){delete _0x3b4aed[_0x52c8('0x62')]['id'];}return db[_0x52c8('0x59')][_0x52c8('0x5f')]({'where':{'id':_0x3b4aed[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x4021da,null))[_0x52c8('0x10')](function(_0x21779e){if(_0x21779e){_0x3b4aed[_0x52c8('0x62')][_0x52c8('0x67')]=_0x21779e['id'];return db[_0x52c8('0x6d')][_0x52c8('0x69')](_0x3b4aed[_0x52c8('0x62')]);}})[_0x52c8('0x10')](respondWithResult(_0x4021da,null))[_0x52c8('0x60')](handleError(_0x4021da,null));};exports[_0x52c8('0x6e')]=function(_0x3c33b7,_0x292726){var _0x1c4a42={'raw':![],'where':{}};var _0x48735a={};var _0xe44f6e={'count':0x0,'rows':[]};return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0x3c33b7[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x292726,null))['then'](function(_0x18ec8d){if(_0x18ec8d){_0x48735a['model']=_['keys'](db['CannedAnswer'][_0x52c8('0x45')]);_0x48735a[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0x3c33b7[_0x52c8('0x48')]);_0x48735a[_0x52c8('0x4a')]=_[_0x52c8('0x5e')](_0x48735a[_0x52c8('0x4b')],_0x48735a[_0x52c8('0x48')]);_0x1c4a42['attributes']=_[_0x52c8('0x5e')](_0x48735a[_0x52c8('0x4b')],qs[_0x52c8('0x4d')](_0x3c33b7['query']['fields']));_0x1c4a42[_0x52c8('0x4c')]=_0x1c4a42[_0x52c8('0x4c')][_0x52c8('0x4e')]?_0x1c4a42[_0x52c8('0x4c')]:_0x48735a['model'];if(!_0x3c33b7['query'][_0x52c8('0x4f')]('nolimit')){_0x1c4a42[_0x52c8('0x1f')]=qs[_0x52c8('0x1f')](_0x3c33b7['query'][_0x52c8('0x1f')]);_0x1c4a42[_0x52c8('0x1e')]=qs['offset'](_0x3c33b7[_0x52c8('0x48')][_0x52c8('0x1e')]);}_0x1c4a42['order']=qs[_0x52c8('0x52')](_0x3c33b7[_0x52c8('0x48')]['sort']);_0x1c4a42[_0x52c8('0x55')]=qs['filters'](_[_0x52c8('0x53')](_0x3c33b7['query'],_0x48735a[_0x52c8('0x4a')]));_0x1c4a42[_0x52c8('0x55')][_0x52c8('0x67')]=_0x18ec8d['id'];if(_0x3c33b7['query']['filter']){_0x1c4a42[_0x52c8('0x55')]=_[_0x52c8('0x56')](_0x1c4a42[_0x52c8('0x55')],{'$or':_[_0x52c8('0x44')](_0x1c4a42['attributes'],function(_0x56a12e){var _0x5a34b6={};_0x5a34b6[_0x56a12e]={'$like':'%'+_0x3c33b7[_0x52c8('0x48')][_0x52c8('0x54')]+'%'};return _0x5a34b6;})});}_0x1c4a42=_[_0x52c8('0x56')]({},_0x1c4a42,_0x3c33b7[_0x52c8('0x58')]);return db['CannedAnswer'][_0x52c8('0x21')]({'where':_0x1c4a42['where']})[_0x52c8('0x10')](function(_0xd20f9a){_0xe44f6e['count']=_0xd20f9a;if(_0x3c33b7['query'][_0x52c8('0x5a')]){_0x1c4a42[_0x52c8('0x5b')]=[{'all':!![]}];}return db[_0x52c8('0x6d')][_0x52c8('0x6b')](_0x1c4a42);})[_0x52c8('0x10')](function(_0x3fbff8){_0xe44f6e[_0x52c8('0x5c')]=_0x3fbff8;return _0xe44f6e;});}})[_0x52c8('0x10')](respondWithFilteredResult(_0x292726,_0x1c4a42))[_0x52c8('0x60')](handleError(_0x292726,null));};exports[_0x52c8('0x6f')]=function(_0x17acfa,_0x204e13){return db['MailAccount'][_0x52c8('0x5f')]({'where':{'id':_0x17acfa['params']['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x204e13,null))[_0x52c8('0x10')](function(_0xcb9623){if(_0xcb9623){return _0xcb9623[_0x52c8('0x6f')](_0x17acfa[_0x52c8('0x48')][_0x52c8('0x70')]);}})['then'](respondWithStatusCode(_0x204e13,null))[_0x52c8('0x60')](handleError(_0x204e13,null));};exports[_0x52c8('0x69')]=function(_0x442c56,_0x98dd41){var _0x18ac73={'name':_0x442c56[_0x52c8('0x62')][_0x52c8('0x27')],'key':_0x442c56[_0x52c8('0x62')][_0x52c8('0x71')],'provider':_0x442c56[_0x52c8('0x62')][_0x52c8('0x63')]===_0x52c8('0x72')?null:_0x442c56[_0x52c8('0x62')][_0x52c8('0x63')],'email':_0x442c56[_0x52c8('0x62')][_0x52c8('0x73')],'ListId':_0x442c56[_0x52c8('0x62')]['ListId'],'active':!_[_0x52c8('0x74')](_0x442c56[_0x52c8('0x62')][_0x52c8('0x75')])?_0x442c56['body'][_0x52c8('0x75')]:!![],'description':_0x442c56[_0x52c8('0x62')][_0x52c8('0x76')]||null};var _0x74e949=getAuthenticationOptions(_0x18ac73[_0x52c8('0x63')],_0x442c56['body']);_0x18ac73[_0x52c8('0x3f')]=_0x74e949[_0x52c8('0x3f')];_0x18ac73['Smtp']=_0x74e949[_0x52c8('0x40')];return db[_0x52c8('0x59')][_0x52c8('0x69')](_0x18ac73,{'include':[{'model':db[_0x52c8('0x41')],'as':_0x52c8('0x40')},{'model':db[_0x52c8('0x64')],'as':'Imap'}]})['then'](function(_0x776bc9){var _0xb55dec=_0x442c56[_0x52c8('0x34')]['get']({'plain':!![]});if(!_0xb55dec)throw new Error(_0x52c8('0x77'));if(_0xb55dec[_0x52c8('0x78')]==='user'){var _0x36de84=_0x776bc9[_0x52c8('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x52c8('0x5f')]({'where':{'name':_0x52c8('0x25'),'userProfileId':_0xb55dec[_0x52c8('0x79')]},'raw':!![]})[_0x52c8('0x10')](function(_0x2217d2){if(_0x2217d2&&_0x2217d2[_0x52c8('0x7a')]===0x0){return db['UserProfileResource'][_0x52c8('0x69')]({'name':_0x36de84[_0x52c8('0x27')],'resourceId':_0x36de84['id'],'type':_0x2217d2[_0x52c8('0x27')],'sectionId':_0x2217d2['id']},{})[_0x52c8('0x10')](function(){return _0x776bc9;});}else{return _0x776bc9;}})[_0x52c8('0x60')](function(_0x2518e5){logger['error'](_0x52c8('0x7b'),_0x2518e5);throw _0x2518e5;});}return _0x776bc9;})[_0x52c8('0x10')](respondWithResult(_0x98dd41,0xc9))[_0x52c8('0x60')](handleError(_0x98dd41,null));};exports[_0x52c8('0x7c')]=function(_0x41c367,_0x416e5a){return db['MailAccount'][_0x52c8('0x6a')]({'where':{'id':_0x41c367[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x416e5a,null))[_0x52c8('0x10')](function(_0x415bd0){if(_0x415bd0){return _0x415bd0[_0x52c8('0x7c')]();}return null;})[_0x52c8('0x10')](respondWithResult(_0x416e5a,null))[_0x52c8('0x60')](handleError(_0x416e5a,null));};exports[_0x52c8('0x7d')]=function(_0x483f02,_0x1134d2){if(_0x483f02[_0x52c8('0x62')]['id']){delete _0x483f02[_0x52c8('0x62')]['id'];}return db[_0x52c8('0x59')][_0x52c8('0x5f')]({'where':{'id':_0x483f02['params']['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x1134d2,null))[_0x52c8('0x10')](function(_0xd4bd0a){if(_0xd4bd0a){_0x483f02[_0x52c8('0x62')][_0x52c8('0x67')]=_0xd4bd0a['id'];return db[_0x52c8('0x64')][_0x52c8('0x69')](_0x483f02[_0x52c8('0x62')]);}})[_0x52c8('0x10')](respondWithResult(_0x1134d2,null))[_0x52c8('0x60')](handleError(_0x1134d2,null));};exports[_0x52c8('0x7e')]=function(_0x47ae5a,_0x4ea694){return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0x47ae5a[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x4ea694,null))[_0x52c8('0x10')](function(_0x554f43){if(_0x554f43){return _0x554f43[_0x52c8('0x7f')](null);}return null;})[_0x52c8('0x10')](respondWithStatusCode(_0x4ea694,null))[_0x52c8('0x60')](handleError(_0x4ea694,null));};exports['getSmtp']=function(_0x2a8b75,_0x369f0f){return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0x2a8b75[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x369f0f,null))[_0x52c8('0x10')](function(_0x1b479b){if(_0x1b479b){return _0x1b479b[_0x52c8('0x80')]();}return null;})['then'](respondWithResult(_0x369f0f,null))[_0x52c8('0x60')](handleError(_0x369f0f,null));};exports[_0x52c8('0x81')]=function(_0x4614d6,_0x5b3bd0){if(_0x4614d6[_0x52c8('0x62')]['id']){delete _0x4614d6[_0x52c8('0x62')]['id'];}return db[_0x52c8('0x59')][_0x52c8('0x5f')]({'where':{'id':_0x4614d6[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x5b3bd0,null))['then'](function(_0xd8ac20){if(_0xd8ac20){_0x4614d6['body'][_0x52c8('0x67')]=_0xd8ac20['id'];return db[_0x52c8('0x41')]['create'](_0x4614d6[_0x52c8('0x62')]);}})[_0x52c8('0x10')](respondWithResult(_0x5b3bd0,null))[_0x52c8('0x60')](handleError(_0x5b3bd0,null));};exports[_0x52c8('0x82')]=function(_0x420ff9,_0xbe77b5){return db['MailAccount'][_0x52c8('0x6a')]({'where':{'id':_0x420ff9[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0xbe77b5,null))[_0x52c8('0x10')](function(_0x5dca03){if(_0x5dca03){return _0x5dca03['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0xbe77b5,null))[_0x52c8('0x60')](handleError(_0xbe77b5,null));};exports['addInteraction']=function(_0x5b81e8,_0x301d7c){return db[_0x52c8('0x83')][_0x52c8('0x5f')]({'where':{'id':_0x5b81e8[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x301d7c,null))[_0x52c8('0x10')](function(_0x17101a){if(_0x17101a){return _0x17101a['addInteraction'](_0x5b81e8['body']['ids'],_[_0x52c8('0x84')](_0x5b81e8[_0x52c8('0x62')],[_0x52c8('0x70'),'id'])||{});}})[_0x52c8('0x10')](respondWithResult(_0x301d7c,null))['catch'](handleError(_0x301d7c,null));};exports[_0x52c8('0x85')]=function(_0x55beec,_0x146360){var _0x3d0f03={'raw':![],'where':{}};var _0x132f81={};var _0x46ec9a={'count':0x0,'rows':[]};return db[_0x52c8('0x59')]['findOne']({'where':{'id':_0x55beec[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x146360,null))['then'](function(_0x26875d){if(_0x26875d){_0x132f81['model']=_['keys'](db['MailInteraction'][_0x52c8('0x45')]);_0x132f81[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0x55beec[_0x52c8('0x48')]);_0x132f81[_0x52c8('0x4a')]=_[_0x52c8('0x5e')](_0x132f81[_0x52c8('0x4b')],_0x132f81[_0x52c8('0x48')]);_0x3d0f03['attributes']=_['intersection'](_0x132f81['model'],qs['fields'](_0x55beec[_0x52c8('0x48')][_0x52c8('0x4d')]));_0x3d0f03[_0x52c8('0x4c')]=_0x3d0f03[_0x52c8('0x4c')]['length']?_0x3d0f03[_0x52c8('0x4c')]:_0x132f81[_0x52c8('0x4b')];if(!_0x55beec[_0x52c8('0x48')][_0x52c8('0x4f')](_0x52c8('0x50'))){_0x3d0f03['limit']=qs[_0x52c8('0x1f')](_0x55beec[_0x52c8('0x48')][_0x52c8('0x1f')]);_0x3d0f03[_0x52c8('0x1e')]=qs[_0x52c8('0x1e')](_0x55beec[_0x52c8('0x48')][_0x52c8('0x1e')]);}_0x3d0f03[_0x52c8('0x51')]=qs[_0x52c8('0x52')](_0x55beec[_0x52c8('0x48')]['sort']);_0x3d0f03[_0x52c8('0x55')]=qs[_0x52c8('0x4a')](_[_0x52c8('0x53')](_0x55beec[_0x52c8('0x48')],_0x132f81[_0x52c8('0x4a')]));_0x3d0f03['where'][_0x52c8('0x67')]=_0x26875d['id'];if(_0x55beec[_0x52c8('0x48')]['filter']){_0x3d0f03[_0x52c8('0x55')]=_['merge'](_0x3d0f03[_0x52c8('0x55')],{'$or':_[_0x52c8('0x44')](_0x3d0f03[_0x52c8('0x4c')],function(_0x3d32ba){var _0x218fb8={};_0x218fb8[_0x3d32ba]={'$like':'%'+_0x55beec[_0x52c8('0x48')]['filter']+'%'};return _0x218fb8;})});}_0x3d0f03=_[_0x52c8('0x56')]({},_0x3d0f03,_0x55beec[_0x52c8('0x58')]);return db[_0x52c8('0x83')][_0x52c8('0x21')]({'where':_0x3d0f03[_0x52c8('0x55')]})[_0x52c8('0x10')](function(_0x2856d7){_0x46ec9a['count']=_0x2856d7;if(_0x55beec[_0x52c8('0x48')][_0x52c8('0x5a')]){_0x3d0f03[_0x52c8('0x5b')]=[{'model':db[_0x52c8('0x86')],'as':_0x52c8('0x87'),'required':![]},{'model':db[_0x52c8('0x88')],'as':_0x52c8('0x89'),'attributes':[_0x52c8('0x27'),'fullname',_0x52c8('0x8a')],'required':![]},{'model':db[_0x52c8('0x8b')],'as':'Tags','attributes':['id',_0x52c8('0x27'),_0x52c8('0x8c')],'where':_0x55beec[_0x52c8('0x48')][_0x52c8('0x8d')]?{'id':_0x55beec['query'][_0x52c8('0x8d')]}:undefined,'required':_0x55beec['query']['tag']?!![]:![]}];}return db[_0x52c8('0x83')]['findAll'](_0x3d0f03);})[_0x52c8('0x10')](function(_0xa248e9){_0x46ec9a[_0x52c8('0x5c')]=_0xa248e9;return _0x46ec9a;});}})['then'](respondWithFilteredResult(_0x146360,_0x3d0f03))[_0x52c8('0x60')](handleError(_0x146360,null));};exports[_0x52c8('0x8e')]=function addApplications(_0x49af87,_0x2e9673){var _0x154330=_0x49af87['params']['id'];var _0x8ce5d4=_0x49af87['body'];var _0x13f8b5=0xc8;var _0x344a39=null;return db['sequelize'][_0x52c8('0x8f')]({'isolationLevel':db[_0x52c8('0x90')][_0x52c8('0x91')]['ISOLATION_LEVELS'][_0x52c8('0x92')]},function(_0x4440f6){return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0x154330},'transaction':_0x4440f6})[_0x52c8('0x10')](function(_0x52e0da){if(_0x52e0da){return db['MailApplication'][_0x52c8('0x23')]({'where':{'MailAccountId':_0x154330},'transaction':_0x4440f6})[_0x52c8('0x10')](function(){var _0x43f2c0=_[_0x52c8('0x44')](_0x8ce5d4,function(_0x433152){_0x433152[_0x52c8('0x67')]=_0x154330;return _0x433152;});return db[_0x52c8('0x93')][_0x52c8('0x94')](_0x43f2c0,{'transaction':_0x4440f6});});}else{_0x13f8b5=0x194;_0x344a39=[];}});})['then'](function(){if(_0x13f8b5!==0x194){return db[_0x52c8('0x93')][_0x52c8('0x95')]({'where':{'MailAccountId':_0x154330},'order':'priority'})[_0x52c8('0x10')](function(_0x49f20c){_0x344a39=_0x49f20c;});}})[_0x52c8('0x60')](function(_0x16e641){_0x13f8b5=0x1f4;logger[_0x52c8('0x17')](_0x16e641['stack']);if(_0x16e641[_0x52c8('0x27')]){delete _0x16e641[_0x52c8('0x27')];}_0x344a39=_0x16e641;})[_0x52c8('0x96')](function(){if(_0x344a39===null){_0x2e9673[_0x52c8('0x1b')](_0x13f8b5);}else{if(_0x13f8b5===0x1f4){_0x2e9673['status'](_0x13f8b5)[_0x52c8('0x28')](_0x344a39);}else{_0x2e9673[_0x52c8('0x1c')](_0x13f8b5)[_0x52c8('0x97')](_0x344a39);}}});};exports['getApplications']=function(_0x2d563d,_0x5be4f9){var _0x388244={};var _0x343bf7={};var _0x27d7c8;var _0xe76978;return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0x2d563d[_0x52c8('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5be4f9,null))[_0x52c8('0x10')](function(_0x308daf){if(_0x308daf){_0x27d7c8=_0x308daf;_0x343bf7['model']=_[_0x52c8('0x49')](db['MailApplication'][_0x52c8('0x45')]);_0x343bf7[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0x2d563d['query']);_0x343bf7[_0x52c8('0x4a')]=_['intersection'](_0x343bf7[_0x52c8('0x4b')],_0x343bf7[_0x52c8('0x48')]);_0x388244[_0x52c8('0x4c')]=_['intersection'](_0x343bf7[_0x52c8('0x4b')],qs[_0x52c8('0x4d')](_0x2d563d[_0x52c8('0x48')][_0x52c8('0x4d')]));_0x388244['attributes']=_0x388244[_0x52c8('0x4c')][_0x52c8('0x4e')]?_0x388244[_0x52c8('0x4c')]:_0x343bf7[_0x52c8('0x4b')];_0x388244['order']=qs[_0x52c8('0x52')](_0x2d563d[_0x52c8('0x48')]['sort']);_0x388244[_0x52c8('0x55')]=qs[_0x52c8('0x4a')](_[_0x52c8('0x53')](_0x2d563d[_0x52c8('0x48')],_0x343bf7[_0x52c8('0x4a')]));if(_0x2d563d[_0x52c8('0x48')][_0x52c8('0x54')]){_0x388244[_0x52c8('0x55')]=_[_0x52c8('0x56')](_0x388244[_0x52c8('0x55')],{'$or':_[_0x52c8('0x44')](_0x388244[_0x52c8('0x4c')],function(_0x46a975){var _0x57364a={};_0x57364a[_0x46a975]={'$like':'%'+_0x2d563d[_0x52c8('0x48')][_0x52c8('0x54')]+'%'};return _0x57364a;})});}_0x388244=_['merge']({},_0x388244,_0x2d563d[_0x52c8('0x58')]);return _0x27d7c8['getApplications'](_0x388244);}})['then'](function(_0x41f8c2){if(_0x41f8c2){_0xe76978=_0x41f8c2['length'];if(!_0x2d563d[_0x52c8('0x48')][_0x52c8('0x4f')](_0x52c8('0x50'))){_0x388244[_0x52c8('0x1f')]=qs[_0x52c8('0x1f')](_0x2d563d[_0x52c8('0x48')][_0x52c8('0x1f')]);_0x388244[_0x52c8('0x1e')]=qs[_0x52c8('0x1e')](_0x2d563d['query'][_0x52c8('0x1e')]);}return _0x27d7c8[_0x52c8('0x98')](_0x388244);}})[_0x52c8('0x10')](function(_0x186ccb){if(_0x186ccb){return _0x186ccb?{'count':_0xe76978,'rows':_0x186ccb}:null;}})['then'](respondWithResult(_0x5be4f9,null))['catch'](handleError(_0x5be4f9,null));};exports[_0x52c8('0x99')]=function(_0x48fa6c,_0x149ac4){var _0x59b034={'raw':!![],'where':{}};var _0x2a37d4={};var _0x3b866b={'count':0x0,'rows':[]};return db[_0x52c8('0x59')][_0x52c8('0x6a')]({'where':{'id':_0x48fa6c[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x149ac4,null))[_0x52c8('0x10')](function(_0x11c2fc){if(_0x11c2fc){_0x2a37d4['model']=_[_0x52c8('0x49')](db[_0x52c8('0x9a')]['rawAttributes']);_0x2a37d4[_0x52c8('0x48')]=_[_0x52c8('0x49')](_0x48fa6c[_0x52c8('0x48')]);_0x2a37d4[_0x52c8('0x4a')]=_['intersection'](_0x2a37d4[_0x52c8('0x4b')],_0x2a37d4[_0x52c8('0x48')]);_0x59b034['attributes']=_[_0x52c8('0x5e')](_0x2a37d4[_0x52c8('0x4b')],qs['fields'](_0x48fa6c[_0x52c8('0x48')]['fields']));_0x59b034[_0x52c8('0x4c')]=_0x59b034['attributes']['length']?_0x59b034[_0x52c8('0x4c')]:_0x2a37d4[_0x52c8('0x4b')];if(!_0x48fa6c['query'][_0x52c8('0x4f')](_0x52c8('0x50'))){_0x59b034['limit']=qs[_0x52c8('0x1f')](_0x48fa6c[_0x52c8('0x48')][_0x52c8('0x1f')]);_0x59b034['offset']=qs[_0x52c8('0x1e')](_0x48fa6c[_0x52c8('0x48')][_0x52c8('0x1e')]);}_0x59b034['order']=qs[_0x52c8('0x52')](_0x48fa6c[_0x52c8('0x48')][_0x52c8('0x52')]);_0x59b034[_0x52c8('0x55')]=qs[_0x52c8('0x4a')](_['pick'](_0x48fa6c[_0x52c8('0x48')],_0x2a37d4[_0x52c8('0x4a')]));_0x59b034[_0x52c8('0x55')][_0x52c8('0x67')]=_0x11c2fc['id'];if(_0x48fa6c[_0x52c8('0x48')][_0x52c8('0x54')]){_0x59b034[_0x52c8('0x55')]=_['merge'](_0x59b034['where'],{'$or':_['map'](_0x59b034['attributes'],function(_0x17c904){var _0x59df11={};_0x59df11[_0x17c904]={'$like':'%'+_0x48fa6c['query'][_0x52c8('0x54')]+'%'};return _0x59df11;})});}if(_0x48fa6c['query'][_0x52c8('0x9b')]){var _0x464ee5=_0x48fa6c[_0x52c8('0x48')][_0x52c8('0x9b')][_0x52c8('0x9c')](',');var _0x3e6dd3={};_0x3e6dd3[_0x464ee5[0x0]]={'$gte':moment(_0x464ee5[0x1])['format'](_0x52c8('0x9d'))};_0x59b034[_0x52c8('0x55')]=_[_0x52c8('0x56')](_0x59b034[_0x52c8('0x55')],_0x3e6dd3);}_0x59b034=_['merge']({},_0x59b034,_0x48fa6c[_0x52c8('0x58')]);return db[_0x52c8('0x9a')][_0x52c8('0x21')]({'where':_0x59b034[_0x52c8('0x55')]})[_0x52c8('0x10')](function(_0x861160){_0x3b866b[_0x52c8('0x21')]=_0x861160;if(_0x48fa6c['query'][_0x52c8('0x5a')]){_0x59b034[_0x52c8('0x5b')]=[{'all':!![]}];}return db[_0x52c8('0x9a')][_0x52c8('0x6b')](_0x59b034);})[_0x52c8('0x10')](function(_0x8a2404){if(_0x48fa6c['query'][_0x52c8('0x9e')]===_0x52c8('0x9f')){for(var _0x25d9bd=0x0;_0x25d9bd<_0x8a2404[_0x52c8('0x4e')];_0x25d9bd++){_0x8a2404[_0x25d9bd][_0x52c8('0x62')]=juice(_0x8a2404[_0x25d9bd][_0x52c8('0x62')]);}}_0x3b866b['rows']=_0x8a2404;return _0x3b866b;});}})[_0x52c8('0x10')](respondWithFilteredResult(_0x149ac4,_0x59b034))[_0x52c8('0x60')](handleError(_0x149ac4,null));};exports[_0x52c8('0x28')]=function(_0x10404b,_0x55fad9){var _0x5eb835,_0x503448={},_0x534e1a;if(_0x10404b['body']['to']){_0x534e1a=_0x10404b[_0x52c8('0x62')]['to'][_0x52c8('0x9c')](',')[0x0];}return db[_0x52c8('0x59')]['find']({'where':{'id':_0x10404b['params']['id']},'include':[{'model':db[_0x52c8('0xa0')],'as':'List','include':[{'model':db['CmContact'],'as':_0x52c8('0xa1'),'where':{'email':_0x534e1a},'limit':0x1,'order':[[_0x52c8('0xa2'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x52c8('0x40'),'raw':!![],'include':[{'model':db[_0x52c8('0xa3')],'as':_0x52c8('0xa3'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x55fad9,null))['then'](function(_0x21ee35){if(!_0x21ee35)return;_0x5eb835=_0x21ee35;if(!_0x21ee35['Smtp'])throw new Error(_0x52c8('0xa4'));if(_[_0x52c8('0x74')](_0x10404b[_0x52c8('0x62')]['from'])){_0x10404b[_0x52c8('0x62')][_0x52c8('0xa5')]=util[_0x52c8('0xa6')](_0x52c8('0xa7'),_0x21ee35[_0x52c8('0x27')],_0x21ee35[_0x52c8('0x73')]||_0x21ee35[_0x52c8('0x40')][_0x52c8('0x34')]);}if(_0x10404b['body']['attachments']&&_0x10404b[_0x52c8('0x62')][_0x52c8('0xa8')][_0x52c8('0x4e')]){for(var _0x534bd2=0x0;_0x534bd2<_0x10404b['body'][_0x52c8('0xa8')]['length'];_0x534bd2+=0x1){_0x10404b[_0x52c8('0x62')][_0x52c8('0xa8')][_0x534bd2]={'filename':_0x10404b[_0x52c8('0x62')][_0x52c8('0xa8')][_0x534bd2][_0x52c8('0x27')],'path':path['join'](config['root'],'server/files/attachments',_0x10404b['body']['attachments'][_0x534bd2][_0x52c8('0xa9')])};}}var _0x3ff774=_0x21ee35[_0x52c8('0xaa')]();return respondWithRpcPromise(_0x52c8('0xab'),'sendMail',{'account':_0x3ff774,'message':_0x10404b[_0x52c8('0x62')]});})[_0x52c8('0x10')](function(_0x33a7ac){if(!_0x33a7ac)return;_0x503448=_0x33a7ac;if(!_0x5eb835[_0x52c8('0xac')])throw new Error(_0x52c8('0xad'));if(_0x5eb835['List'][_0x52c8('0xa1')]['length'])return _0x5eb835['List'][_0x52c8('0xa1')][0x0];return db[_0x52c8('0x86')][_0x52c8('0x69')](_[_0x52c8('0xae')](_0x10404b[_0x52c8('0x62')],{'firstName':_0x10404b[_0x52c8('0x62')]['to'],'email':_0x10404b[_0x52c8('0x62')]['to'],'phone':_0x10404b[_0x52c8('0x62')]['to'],'ListId':_0x5eb835['ListId']}));})[_0x52c8('0x10')](function(_0xfa6140){if(!_0xfa6140)return;var _0x5ed1fe={'UserId':_0x10404b['user']['id'],'ContactId':_0xfa6140['id'],'MailAccountId':_0x5eb835['id'],'inReplyTo':_0x503448[_0x52c8('0xaf')],'to':_0x10404b[_0x52c8('0x62')]['from'],'cc':_0x10404b['body']['cc'],'subject':_0x10404b[_0x52c8('0x62')][_0x52c8('0xb0')],'attach':_0x10404b[_0x52c8('0x62')]['attach'],'firstMsgDirection':_0x52c8('0xb1'),'lastMsgAt':moment()['format'](_0x52c8('0x9d')),'lastMsgDirection':_0x52c8('0xb1'),'Messages':[_[_0x52c8('0x56')](_0x10404b['body'],{'messageId':_0x503448[_0x52c8('0xaf')],'sentAt':moment()['format'](_0x52c8('0x9d')),'read':!![],'MailAccountId':_0x5eb835['id'],'UserId':_0x10404b[_0x52c8('0x34')]['id'],'ContactId':_0xfa6140['id']})]};if(_0x10404b['body'][_0x52c8('0xb2')]){_0x5ed1fe=_[_0x52c8('0x56')](_0x5ed1fe,_0x10404b[_0x52c8('0x62')][_0x52c8('0xb2')]);}return db['MailInteraction']['create'](_0x5ed1fe,{'include':[{'model':db[_0x52c8('0x9a')],'as':_0x52c8('0xb3')}]});})[_0x52c8('0x10')](respondWithResult(_0x55fad9,null))[_0x52c8('0x60')](handleError(_0x55fad9,null));};exports[_0x52c8('0xb4')]=function(_0x216ec4,_0x5af8ba){return db['MailAccount'][_0x52c8('0x5f')]({'where':{'id':_0x216ec4[_0x52c8('0x5d')]['id']},'include':[{'model':db[_0x52c8('0x41')],'as':_0x52c8('0x40'),'raw':!![],'include':[{'model':db[_0x52c8('0xa3')],'as':_0x52c8('0xa3'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5af8ba,null))[_0x52c8('0x10')](function(_0xa18041){if(!_0xa18041[_0x52c8('0x40')])return;var _0x4c25ee=_0xa18041[_0x52c8('0xaa')]();return respondWithRpcPromise('VerifySmtp',_0x52c8('0xb4'),{'account':_0x4c25ee});})[_0x52c8('0x10')](respondWithResult(_0x5af8ba,null))[_0x52c8('0x60')](handleError(_0x5af8ba,null));};exports[_0x52c8('0x23')]=function(_0x4a68a2,_0x4f03db){return db[_0x52c8('0x59')]['find']({'where':{'id':_0x4a68a2[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x4f03db,null))['then'](function(_0x58a397){if(_0x58a397&&_0x58a397[_0x52c8('0x3d')]){throw new db['Sequelize'][(_0x52c8('0xb5'))](_0x52c8('0xb6'));}return _0x58a397;})[_0x52c8('0x10')](removeEntity(_0x4f03db,null))[_0x52c8('0x60')](handleError(_0x4f03db,null));};exports[_0x52c8('0xb7')]=function(_0x293da9,_0x522b50){return db[_0x52c8('0x59')][_0x52c8('0x5f')]({'where':{'id':_0x293da9[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x522b50,null))[_0x52c8('0x10')](function(_0x4ffa68){if(_0x4ffa68){return _0x4ffa68['addAgents'](_0x293da9[_0x52c8('0x62')][_0x52c8('0x70')],_[_0x52c8('0x84')](_0x293da9[_0x52c8('0x62')],[_0x52c8('0x70'),'id'])||{})['spread'](function(_0x3ad165){for(var _0x3af5ae=0x0;_0x3af5ae<_0x293da9[_0x52c8('0x62')]['ids']['length'];_0x3af5ae+=0x1){socket[_0x52c8('0xb8')]('userMailAccount:save',{'UserId':Number(_0x293da9[_0x52c8('0x62')][_0x52c8('0x70')][_0x3af5ae]),'MailAccountId':Number(_0x293da9['params']['id'])});}return _0x3ad165;});}})[_0x52c8('0x10')](respondWithResult(_0x522b50,null))[_0x52c8('0x60')](handleError(_0x522b50,null));};exports[_0x52c8('0xb9')]=function(_0x1fadd3,_0x18e878){return db['MailAccount']['find']({'where':{'id':_0x1fadd3[_0x52c8('0x5d')]['id']}})['then'](handleEntityNotFound(_0x18e878,null))['then'](function(_0x48e338){if(_0x48e338){return _0x48e338[_0x52c8('0xb9')](_0x1fadd3[_0x52c8('0x48')][_0x52c8('0x70')])['then'](function(){if(_[_0x52c8('0xba')](_0x1fadd3[_0x52c8('0x48')][_0x52c8('0x70')])){for(var _0x236c93=0x0;_0x236c93<_0x1fadd3[_0x52c8('0x48')][_0x52c8('0x70')][_0x52c8('0x4e')];_0x236c93+=0x1){socket[_0x52c8('0xb8')](_0x52c8('0xbb'),{'UserId':Number(_0x1fadd3['query'][_0x52c8('0x70')][_0x236c93]),'MailAccountId':Number(_0x1fadd3[_0x52c8('0x5d')]['id'])});}}else{socket[_0x52c8('0xb8')](_0x52c8('0xbb'),{'UserId':Number(_0x1fadd3[_0x52c8('0x48')]['ids']),'MailAccountId':Number(_0x1fadd3[_0x52c8('0x5d')]['id'])});}});}})[_0x52c8('0x10')](respondWithStatusCode(_0x18e878,null))['catch'](handleError(_0x18e878,null));};exports[_0x52c8('0xbc')]=function(_0x4ef007,_0x2dbf89){var _0x101b86={};var _0x4f73f5={};var _0x29cfb4;var _0x5ebaa1;return db[_0x52c8('0x59')]['findOne']({'where':{'id':_0x4ef007[_0x52c8('0x5d')]['id']}})[_0x52c8('0x10')](handleEntityNotFound(_0x2dbf89,null))['then'](function(_0x3f18f7){if(_0x3f18f7){_0x29cfb4=_0x3f18f7;_0x4f73f5[_0x52c8('0x4b')]=_[_0x52c8('0x49')](db[_0x52c8('0x88')][_0x52c8('0x45')]);_0x4f73f5[_0x52c8('0x48')]=_['keys'](_0x4ef007[_0x52c8('0x48')]);_0x4f73f5[_0x52c8('0x4a')]=_[_0x52c8('0x5e')](_0x4f73f5['model'],_0x4f73f5['query']);_0x101b86[_0x52c8('0x4c')]=_['intersection'](_0x4f73f5[_0x52c8('0x4b')],qs[_0x52c8('0x4d')](_0x4ef007['query'][_0x52c8('0x4d')]));_0x101b86[_0x52c8('0x4c')]=_0x101b86[_0x52c8('0x4c')]['length']?_0x101b86[_0x52c8('0x4c')]:_0x4f73f5[_0x52c8('0x4b')];_0x101b86[_0x52c8('0x51')]=qs[_0x52c8('0x52')](_0x4ef007[_0x52c8('0x48')][_0x52c8('0x52')]);_0x101b86[_0x52c8('0x55')]=qs[_0x52c8('0x4a')](_[_0x52c8('0x53')](_0x4ef007[_0x52c8('0x48')],_0x4f73f5[_0x52c8('0x4a')]));if(_0x4ef007[_0x52c8('0x48')][_0x52c8('0x54')]){_0x101b86[_0x52c8('0x55')]=_[_0x52c8('0x56')](_0x101b86[_0x52c8('0x55')],{'$or':_[_0x52c8('0x44')](_0x101b86[_0x52c8('0x4c')],function(_0x5d29ea){var _0x100b69={};_0x100b69[_0x5d29ea]={'$like':'%'+_0x4ef007[_0x52c8('0x48')][_0x52c8('0x54')]+'%'};return _0x100b69;})});}_0x101b86=_[_0x52c8('0x56')]({},_0x101b86,_0x4ef007['options']);return _0x29cfb4[_0x52c8('0xbc')](_0x101b86);}})[_0x52c8('0x10')](function(_0x4ec96a){if(_0x4ec96a){_0x5ebaa1=_0x4ec96a[_0x52c8('0x4e')];if(!_0x4ef007[_0x52c8('0x48')][_0x52c8('0x4f')](_0x52c8('0x50'))){_0x101b86[_0x52c8('0x1f')]=qs[_0x52c8('0x1f')](_0x4ef007[_0x52c8('0x48')][_0x52c8('0x1f')]);_0x101b86[_0x52c8('0x1e')]=qs['offset'](_0x4ef007[_0x52c8('0x48')][_0x52c8('0x1e')]);}return _0x29cfb4['getAgents'](_0x101b86);}})[_0x52c8('0x10')](function(_0x579ad5){if(_0x579ad5){return _0x579ad5?{'count':_0x5ebaa1,'rows':_0x579ad5}:null;}})[_0x52c8('0x10')](respondWithResult(_0x2dbf89,null))[_0x52c8('0x60')](handleError(_0x2dbf89,null));}; \ No newline at end of file +var _0xdcf9=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','rows','params','rawAttributes','find','body','custom','provider','secure','Mail\x20Account\x20not\x20found','describe','Disposition','create','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','MailAccountId','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','messageId','subject','attach','out','Interaction','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents','User','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','username','pass','password','modernAuthentication','CloudProviderId','host','port','service','authentication','user','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','fieldName','type'];(function(_0x176e11,_0xbd8c84){var _0x4817c0=function(_0x457036){while(--_0x457036){_0x176e11['push'](_0x176e11['shift']());}};_0x4817c0(++_0xbd8c84);}(_0xdcf9,0x13e));var _0x9dcf=function(_0x2ebf5e,_0x16af2b){_0x2ebf5e=_0x2ebf5e-0x0;var _0x4af3ef=_0xdcf9[_0x2ebf5e];return _0x4af3ef;};'use strict';var moment=require(_0x9dcf('0x0'));var BPromise=require(_0x9dcf('0x1'));var util=require(_0x9dcf('0x2'));var path=require(_0x9dcf('0x3'));var _=require(_0x9dcf('0x4'));var juice=require(_0x9dcf('0x5'));var Redis=require('ioredis');var qs=require(_0x9dcf('0x6'));var logger=require('../../config/logger')(_0x9dcf('0x7'));var config=require(_0x9dcf('0x8'));var db=require(_0x9dcf('0x9'))['db'];config['redis']=_[_0x9dcf('0xa')](config[_0x9dcf('0xb')],{'host':_0x9dcf('0xc'),'port':0x18eb});var socket=require(_0x9dcf('0xd'))(new Redis(config[_0x9dcf('0xb')]));require(_0x9dcf('0xe'))['register'](socket);var jayson=require(_0x9dcf('0xf'));var client=jayson[_0x9dcf('0x10')][_0x9dcf('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1ba8d4,_0x5d4c90,_0x414ed,_0x596f48){return new BPromise(function(_0x4f845f,_0x3eb173){var _0x349140=_0x596f48||client;return _0x349140['request'](_0x1ba8d4,_0x414ed)[_0x9dcf('0x12')](function(_0x24c048){logger[_0x9dcf('0x13')](_0x9dcf('0x14'),_0x5d4c90,'request\x20sent');logger[_0x9dcf('0x15')](_0x9dcf('0x16'),_0x5d4c90,_0x9dcf('0x17'),JSON[_0x9dcf('0x18')](_0x24c048));if(_0x24c048['error']){if(_0x24c048[_0x9dcf('0x19')][_0x9dcf('0x1a')]===0x1f4){logger[_0x9dcf('0x19')](_0x9dcf('0x14'),_0x5d4c90,_0x24c048[_0x9dcf('0x19')][_0x9dcf('0x1b')]);return _0x3eb173(_0x24c048['error'][_0x9dcf('0x1b')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5d4c90,_0x24c048[_0x9dcf('0x19')]['message']);return _0x4f845f(_0x24c048[_0x9dcf('0x19')][_0x9dcf('0x1b')]);}else{logger[_0x9dcf('0x13')](_0x9dcf('0x14'),_0x5d4c90,_0x9dcf('0x17'));_0x4f845f(_0x24c048[_0x9dcf('0x1c')][_0x9dcf('0x1b')]);}})[_0x9dcf('0x1d')](function(_0x9659d8){logger[_0x9dcf('0x19')]('MailAccount,\x20%s,\x20%s',_0x5d4c90,_0x9659d8);_0x3eb173(_0x9659d8);});});}function respondWithStatusCode(_0x420065,_0x6cdfbf){_0x6cdfbf=_0x6cdfbf||0xcc;return function(_0x2f2e30){if(_0x2f2e30){return _0x420065[_0x9dcf('0x1e')](_0x6cdfbf);}return _0x420065[_0x9dcf('0x1f')](_0x6cdfbf)['end']();};}function respondWithResult(_0x66fd06,_0x410483){_0x410483=_0x410483||0xc8;return function(_0x2aa3d3){if(_0x2aa3d3){return _0x66fd06['status'](_0x410483)[_0x9dcf('0x20')](_0x2aa3d3);}};}function respondWithFilteredResult(_0x4e6bde,_0x2c8c46){return function(_0x44951b){if(_0x44951b){var _0x24efd6=typeof _0x2c8c46[_0x9dcf('0x21')]===_0x9dcf('0x22')&&typeof _0x2c8c46[_0x9dcf('0x23')]==='undefined';var _0x5541a6=_0x44951b[_0x9dcf('0x24')];var _0x1b8895=_0x24efd6?0x0:_0x2c8c46['offset'];var _0x32a61c=_0x24efd6?_0x44951b[_0x9dcf('0x24')]:_0x2c8c46[_0x9dcf('0x21')]+_0x2c8c46[_0x9dcf('0x23')];var _0x44d9bb;if(_0x32a61c>=_0x5541a6){_0x32a61c=_0x5541a6;_0x44d9bb=0xc8;}else{_0x44d9bb=0xce;}_0x4e6bde[_0x9dcf('0x1f')](_0x44d9bb);return _0x4e6bde[_0x9dcf('0x25')]('Content-Range',_0x1b8895+'-'+_0x32a61c+'/'+_0x5541a6)[_0x9dcf('0x20')](_0x44951b);}return null;};}function saveUpdates(_0x3cf370){return function(_0x167c8c){if(_0x167c8c){return _0x167c8c[_0x9dcf('0x26')](_0x3cf370)[_0x9dcf('0x12')](function(_0x2c97d4){return _0x2c97d4;});}return null;};}function removeEntity(_0x356211){return function(_0x211b29){if(_0x211b29){return _0x211b29[_0x9dcf('0x27')]()[_0x9dcf('0x12')](function(){var _0x4e2391=_0x211b29[_0x9dcf('0x28')]({'plain':!![]});var _0x20c790=_0x9dcf('0x29');return db[_0x9dcf('0x2a')][_0x9dcf('0x27')]({'where':{'type':_0x20c790,'resourceId':_0x4e2391['id']}})[_0x9dcf('0x12')](function(){return _0x211b29;});})[_0x9dcf('0x12')](function(){_0x356211[_0x9dcf('0x1f')](0xcc)[_0x9dcf('0x2b')]();});}};}function handleEntityNotFound(_0x4c0f42){return function(_0x481bc9){if(!_0x481bc9){_0x4c0f42['sendStatus'](0x194);}return _0x481bc9;};}function handleError(_0x4d6ecc,_0x5cf0b0){_0x5cf0b0=_0x5cf0b0||0x1f4;return function(_0x41db2e){logger[_0x9dcf('0x19')](_0x41db2e[_0x9dcf('0x2c')]);if(_0x41db2e[_0x9dcf('0x2d')]){delete _0x41db2e[_0x9dcf('0x2d')];}_0x4d6ecc[_0x9dcf('0x1f')](_0x5cf0b0)[_0x9dcf('0x2e')](_0x41db2e);};}function getImapHost(_0x437335){switch(_0x437335){case _0x9dcf('0x2f'):return _0x9dcf('0x30');case _0x9dcf('0x31'):return _0x9dcf('0x32');case _0x9dcf('0x33'):return _0x9dcf('0x34');case _0x9dcf('0x35'):return _0x9dcf('0x36');}throw new Error(_0x9dcf('0x37'),_0x437335);}function getSmtpHost(_0x814f01){switch(_0x814f01){case _0x9dcf('0x2f'):return _0x9dcf('0x38');case _0x9dcf('0x31'):return _0x9dcf('0x39');case _0x9dcf('0x33'):return _0x9dcf('0x3a');case _0x9dcf('0x35'):return _0x9dcf('0x3b');}throw new Error(_0x9dcf('0x37'),_0x814f01);}function getAuthenticationOptions(_0x4e36a1,_0x3a97d6){var _0x13a47b={};var _0xfdd9fe={};if(_0x4e36a1){_0x13a47b['user']=_0xfdd9fe['user']=_0x3a97d6[_0x9dcf('0x3c')];_0x13a47b['password']=_0xfdd9fe[_0x9dcf('0x3d')]=_0x3a97d6[_0x9dcf('0x3e')];if(_0x3a97d6[_0x9dcf('0x3f')]){_0x13a47b['modernAuthentication']=_0xfdd9fe[_0x9dcf('0x3f')]=!![];_0x13a47b['CloudProviderId']=_0xfdd9fe['CloudProviderId']=_0x3a97d6[_0x9dcf('0x40')];_0x13a47b[_0x9dcf('0x3e')]=_0xfdd9fe[_0x9dcf('0x3d')]=null;}else{_0x13a47b[_0x9dcf('0x40')]=_0xfdd9fe['CloudProviderId']=null;}_0x13a47b[_0x9dcf('0x41')]=getImapHost(_0x4e36a1);_0x13a47b[_0x9dcf('0x42')]=0x3e1;_0xfdd9fe[_0x9dcf('0x41')]=getSmtpHost(_0x4e36a1);_0xfdd9fe['port']=0x24b;_0xfdd9fe['secure']=![];_0x13a47b[_0x9dcf('0x43')]=_0xfdd9fe[_0x9dcf('0x43')]=null;}else{if(_0x3a97d6[_0x9dcf('0x44')]){_0x13a47b[_0x9dcf('0x45')]=_0xfdd9fe[_0x9dcf('0x45')]=_0x3a97d6[_0x9dcf('0x3c')];_0x13a47b[_0x9dcf('0x3e')]=_0xfdd9fe[_0x9dcf('0x3d')]=_0x3a97d6[_0x9dcf('0x3e')];}else{_0x13a47b[_0x9dcf('0x44')]=_0xfdd9fe[_0x9dcf('0x44')]=![];_0x13a47b[_0x9dcf('0x45')]=_0xfdd9fe[_0x9dcf('0x45')]=null;_0x13a47b['password']=_0xfdd9fe[_0x9dcf('0x3d')]=null;}_0x13a47b[_0x9dcf('0x41')]=_0x3a97d6['Imap']['host'];_0x13a47b[_0x9dcf('0x42')]=_0x3a97d6['Imap'][_0x9dcf('0x42')];_0xfdd9fe[_0x9dcf('0x41')]=_0x3a97d6[_0x9dcf('0x46')][_0x9dcf('0x41')];_0xfdd9fe[_0x9dcf('0x42')]=_0x3a97d6['Smtp'][_0x9dcf('0x42')];}return{'Imap':_0x13a47b,'Smtp':_0xfdd9fe};}exports[_0x9dcf('0x47')]=function(_0x3ffa18,_0x1f85e2){var _0x362030={'include':[{'model':db[_0x9dcf('0x48')],'as':_0x9dcf('0x49')},{'model':db[_0x9dcf('0x4a')],'as':'Smtp'},{'model':db[_0x9dcf('0x4b')],'as':_0x9dcf('0x4c')}]},_0x2ee479={},_0x260bc2={'count':0x0,'rows':[]};var _0x4513ae=_[_0x9dcf('0x4d')](db['MailAccount']['rawAttributes'],function(_0x42c116){return{'name':_0x42c116[_0x9dcf('0x4e')],'type':_0x42c116[_0x9dcf('0x4f')][_0x9dcf('0x50')]};});_0x2ee479[_0x9dcf('0x51')]=_[_0x9dcf('0x4d')](_0x4513ae,'name');_0x2ee479[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x3ffa18[_0x9dcf('0x52')]);_0x2ee479[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0x2ee479[_0x9dcf('0x51')],_0x2ee479[_0x9dcf('0x52')]);_0x362030[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x2ee479[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x3ffa18[_0x9dcf('0x52')]['fields']));_0x362030[_0x9dcf('0x56')]=_0x362030[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x362030[_0x9dcf('0x56')]:_0x2ee479[_0x9dcf('0x51')];if(!_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x59')]('nolimit')){_0x362030[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x3ffa18['query']['limit']);_0x362030['offset']=qs[_0x9dcf('0x21')](_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x21')]);}_0x362030['order']=qs[_0x9dcf('0x5a')](_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x5a')]);_0x362030[_0x9dcf('0x5b')]=qs['filters'](_[_0x9dcf('0x5c')](_0x3ffa18[_0x9dcf('0x52')],_0x2ee479[_0x9dcf('0x54')]),_0x4513ae);if(_0x3ffa18['query'][_0x9dcf('0x5d')]){_0x362030[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x362030[_0x9dcf('0x5b')],{'$or':_['map'](_0x4513ae,function(_0x20ade2){if(_0x20ade2['type']!==_0x9dcf('0x5f')){var _0x1d6b78={};_0x1d6b78[_0x20ade2[_0x9dcf('0x2d')]]={'$like':'%'+_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x1d6b78;}})});}_0x362030=_['merge']({},_0x362030,_0x3ffa18[_0x9dcf('0x60')]);var _0x3296cc={'where':_0x362030['where']};return db[_0x9dcf('0x61')][_0x9dcf('0x24')](_0x3296cc)['then'](function(_0x3cfdce){_0x260bc2[_0x9dcf('0x24')]=_0x3cfdce;if(_0x3ffa18[_0x9dcf('0x52')][_0x9dcf('0x62')]){_0x362030[_0x9dcf('0x63')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x362030);})[_0x9dcf('0x12')](function(_0x1958fb){_0x260bc2[_0x9dcf('0x64')]=_0x1958fb;return _0x260bc2;})[_0x9dcf('0x12')](respondWithFilteredResult(_0x1f85e2,_0x362030))[_0x9dcf('0x1d')](handleError(_0x1f85e2,null));};exports['show']=function(_0x2f5f8c,_0x3b75a8){var _0x52de7e={'raw':![],'where':{'id':_0x2f5f8c[_0x9dcf('0x65')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46')},{'model':db[_0x9dcf('0x4b')],'as':_0x9dcf('0x4c')}]},_0xd8cc5b={};_0xd8cc5b[_0x9dcf('0x51')]=_['keys'](db['MailAccount'][_0x9dcf('0x66')]);_0xd8cc5b['query']=_['keys'](_0x2f5f8c['query']);_0xd8cc5b[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0xd8cc5b[_0x9dcf('0x51')],_0xd8cc5b[_0x9dcf('0x52')]);_0x52de7e['attributes']=_[_0x9dcf('0x55')](_0xd8cc5b['model'],qs[_0x9dcf('0x57')](_0x2f5f8c['query']['fields']));_0x52de7e[_0x9dcf('0x56')]=_0x52de7e['attributes']['length']?_0x52de7e['attributes']:_0xd8cc5b[_0x9dcf('0x51')];if(_0x2f5f8c[_0x9dcf('0x52')][_0x9dcf('0x62')]){_0x52de7e[_0x9dcf('0x63')]=[{'all':!![]}];}_0x52de7e=_[_0x9dcf('0x5e')]({},_0x52de7e,_0x2f5f8c[_0x9dcf('0x60')]);return db[_0x9dcf('0x61')][_0x9dcf('0x67')](_0x52de7e)[_0x9dcf('0x12')](handleEntityNotFound(_0x3b75a8,null))[_0x9dcf('0x12')](respondWithResult(_0x3b75a8,null))[_0x9dcf('0x1d')](handleError(_0x3b75a8,null));};exports[_0x9dcf('0x26')]=function(_0x332649,_0x3bdf1f){if(_0x332649[_0x9dcf('0x68')]['id']){delete _0x332649['body']['id'];}var _0x1e397c=_0x332649[_0x9dcf('0x68')]['provider']===_0x9dcf('0x69')?null:_0x332649[_0x9dcf('0x68')][_0x9dcf('0x6a')];var _0x24cf4d=_0x332649[_0x9dcf('0x68')][_0x9dcf('0x49')]||{};var _0x1c98d1=_0x332649[_0x9dcf('0x68')]['Smtp']||{};if(_0x1e397c){_0x24cf4d[_0x9dcf('0x41')]=getImapHost(_0x1e397c);_0x24cf4d['port']=0x3e1;_0x1c98d1[_0x9dcf('0x41')]=getSmtpHost(_0x1e397c);_0x1c98d1[_0x9dcf('0x42')]=0x24b;_0x1c98d1[_0x9dcf('0x6b')]=![];}if(_0x1c98d1[_0x9dcf('0x3f')]){_0x1c98d1[_0x9dcf('0x6b')]=![];}else{_0x1c98d1[_0x9dcf('0x40')]=null;}if(!_0x24cf4d[_0x9dcf('0x3f')])_0x24cf4d['CloudProviderId']=null;_0x332649[_0x9dcf('0x68')][_0x9dcf('0x49')]=_0x24cf4d;_0x332649['body'][_0x9dcf('0x46')]=_0x1c98d1;return db[_0x9dcf('0x61')]['find']({'where':{'id':_0x332649[_0x9dcf('0x65')]['id']},'include':[{'model':db[_0x9dcf('0x48')],'as':_0x9dcf('0x49')},{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3bdf1f,null))[_0x9dcf('0x12')](function(_0x155c8c){if(!_0x155c8c)throw new Error(_0x9dcf('0x6c'));if(_0x155c8c[_0x9dcf('0x43')])delete _0x332649[_0x9dcf('0x68')]['Imap'];return _0x155c8c;})['then'](saveUpdates(_0x332649[_0x9dcf('0x68')],null))[_0x9dcf('0x12')](function(_0x5b3f8c){if(!_0x332649[_0x9dcf('0x68')][_0x9dcf('0x49')])return _0x5b3f8c;return db['MailServerIn'][_0x9dcf('0x26')](_0x332649['body'][_0x9dcf('0x49')],{'where':{'MailAccountId':_0x5b3f8c['id']}})['then'](function(){return _0x5b3f8c;});})[_0x9dcf('0x12')](function(_0x1d6fe9){if(!_0x332649[_0x9dcf('0x68')][_0x9dcf('0x46')])return _0x1d6fe9;return db[_0x9dcf('0x4a')]['update'](_0x332649['body'][_0x9dcf('0x46')],{'where':{'MailAccountId':_0x1d6fe9['id']}})['then'](function(){return _0x1d6fe9;});})[_0x9dcf('0x12')](respondWithResult(_0x3bdf1f,null))[_0x9dcf('0x1d')](handleError(_0x3bdf1f,null));};exports['describe']=function(_0x5348b3,_0x9a4862){return db[_0x9dcf('0x61')][_0x9dcf('0x6d')]()[_0x9dcf('0x12')](respondWithResult(_0x9a4862,null))[_0x9dcf('0x1d')](handleError(_0x9a4862,null));};exports['addDisposition']=function(_0x133dff,_0x35eab6){if(_0x133dff[_0x9dcf('0x68')]['id']){delete _0x133dff[_0x9dcf('0x68')]['id'];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x133dff['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x35eab6,null))[_0x9dcf('0x12')](function(_0xdbf8b5){if(_0xdbf8b5){_0x133dff['body']['MailAccountId']=_0xdbf8b5['id'];return db[_0x9dcf('0x6e')][_0x9dcf('0x6f')](_0x133dff[_0x9dcf('0x68')]);}})[_0x9dcf('0x12')](respondWithResult(_0x35eab6,null))[_0x9dcf('0x1d')](handleError(_0x35eab6,null));};exports['getDispositions']=function(_0x5338f6,_0x3cd4bd){var _0x31aa5c={'raw':![],'where':{}};var _0x563e9d={};var _0x555b75={'count':0x0,'rows':[]};return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0x5338f6[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x3cd4bd,null))['then'](function(_0x1a5a12){if(_0x1a5a12){_0x563e9d[_0x9dcf('0x51')]=_[_0x9dcf('0x53')](db[_0x9dcf('0x6e')][_0x9dcf('0x66')]);_0x563e9d[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x5338f6[_0x9dcf('0x52')]);_0x563e9d[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0x563e9d[_0x9dcf('0x51')],_0x563e9d[_0x9dcf('0x52')]);_0x31aa5c['attributes']=_[_0x9dcf('0x55')](_0x563e9d[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x5338f6[_0x9dcf('0x52')]['fields']));_0x31aa5c['attributes']=_0x31aa5c[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x31aa5c[_0x9dcf('0x56')]:_0x563e9d['model'];if(!_0x5338f6['query'][_0x9dcf('0x59')]('nolimit')){_0x31aa5c[_0x9dcf('0x23')]=qs['limit'](_0x5338f6['query'][_0x9dcf('0x23')]);_0x31aa5c[_0x9dcf('0x21')]=qs['offset'](_0x5338f6['query'][_0x9dcf('0x21')]);}_0x31aa5c[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0x5338f6[_0x9dcf('0x52')][_0x9dcf('0x5a')]);_0x31aa5c[_0x9dcf('0x5b')]=qs[_0x9dcf('0x54')](_['pick'](_0x5338f6[_0x9dcf('0x52')],_0x563e9d[_0x9dcf('0x54')]));_0x31aa5c[_0x9dcf('0x5b')]['MailAccountId']=_0x1a5a12['id'];if(_0x5338f6[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x31aa5c[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x31aa5c[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x31aa5c[_0x9dcf('0x56')],function(_0x3b68c7){var _0x3c8836={};_0x3c8836[_0x3b68c7]={'$like':'%'+_0x5338f6['query']['filter']+'%'};return _0x3c8836;})});}_0x31aa5c=_[_0x9dcf('0x5e')]({},_0x31aa5c,_0x5338f6[_0x9dcf('0x60')]);return db[_0x9dcf('0x6e')][_0x9dcf('0x24')]({'where':_0x31aa5c[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0xaa18c6){_0x555b75[_0x9dcf('0x24')]=_0xaa18c6;if(_0x5338f6['query'][_0x9dcf('0x62')]){_0x31aa5c[_0x9dcf('0x63')]=[{'all':!![]}];}return db['Disposition'][_0x9dcf('0x72')](_0x31aa5c);})[_0x9dcf('0x12')](function(_0x4acd42){_0x555b75[_0x9dcf('0x64')]=_0x4acd42;return _0x555b75;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x3cd4bd,_0x31aa5c))['catch'](handleError(_0x3cd4bd,null));};exports[_0x9dcf('0x73')]=function(_0x2f8984,_0x4e6df1){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x2f8984['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x4e6df1,null))[_0x9dcf('0x12')](function(_0x2a29e9){if(_0x2a29e9){return _0x2a29e9[_0x9dcf('0x73')](_0x2f8984['query'][_0x9dcf('0x74')]);}})[_0x9dcf('0x12')](respondWithStatusCode(_0x4e6df1,null))['catch'](handleError(_0x4e6df1,null));};exports[_0x9dcf('0x75')]=function(_0x1c1039,_0x1025b1){if(_0x1c1039[_0x9dcf('0x68')]['id']){delete _0x1c1039[_0x9dcf('0x68')]['id'];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x1c1039[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x1025b1,null))[_0x9dcf('0x12')](function(_0x2f6019){if(_0x2f6019){_0x1c1039[_0x9dcf('0x68')]['MailAccountId']=_0x2f6019['id'];return db[_0x9dcf('0x76')][_0x9dcf('0x6f')](_0x1c1039[_0x9dcf('0x68')]);}})[_0x9dcf('0x12')](respondWithResult(_0x1025b1,null))[_0x9dcf('0x1d')](handleError(_0x1025b1,null));};exports[_0x9dcf('0x77')]=function(_0x3a2af1,_0x5ec7e6){var _0x35a432={'raw':![],'where':{}};var _0x54bf03={};var _0x3e56da={'count':0x0,'rows':[]};return db['MailAccount'][_0x9dcf('0x70')]({'where':{'id':_0x3a2af1[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x5ec7e6,null))['then'](function(_0x480be9){if(_0x480be9){_0x54bf03['model']=_['keys'](db['CannedAnswer'][_0x9dcf('0x66')]);_0x54bf03[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x3a2af1[_0x9dcf('0x52')]);_0x54bf03[_0x9dcf('0x54')]=_['intersection'](_0x54bf03[_0x9dcf('0x51')],_0x54bf03['query']);_0x35a432['attributes']=_['intersection'](_0x54bf03['model'],qs[_0x9dcf('0x57')](_0x3a2af1[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x35a432['attributes']=_0x35a432[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x35a432[_0x9dcf('0x56')]:_0x54bf03[_0x9dcf('0x51')];if(!_0x3a2af1['query'][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x35a432['limit']=qs[_0x9dcf('0x23')](_0x3a2af1['query'][_0x9dcf('0x23')]);_0x35a432[_0x9dcf('0x21')]=qs[_0x9dcf('0x21')](_0x3a2af1[_0x9dcf('0x52')]['offset']);}_0x35a432['order']=qs[_0x9dcf('0x5a')](_0x3a2af1[_0x9dcf('0x52')]['sort']);_0x35a432[_0x9dcf('0x5b')]=qs['filters'](_[_0x9dcf('0x5c')](_0x3a2af1[_0x9dcf('0x52')],_0x54bf03['filters']));_0x35a432[_0x9dcf('0x5b')]['MailAccountId']=_0x480be9['id'];if(_0x3a2af1[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x35a432[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x35a432[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x35a432[_0x9dcf('0x56')],function(_0x15cc5f){var _0x1313fa={};_0x1313fa[_0x15cc5f]={'$like':'%'+_0x3a2af1[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x1313fa;})});}_0x35a432=_[_0x9dcf('0x5e')]({},_0x35a432,_0x3a2af1[_0x9dcf('0x60')]);return db[_0x9dcf('0x76')]['count']({'where':_0x35a432[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0x11a4b1){_0x3e56da[_0x9dcf('0x24')]=_0x11a4b1;if(_0x3a2af1['query'][_0x9dcf('0x62')]){_0x35a432[_0x9dcf('0x63')]=[{'all':!![]}];}return db[_0x9dcf('0x76')][_0x9dcf('0x72')](_0x35a432);})[_0x9dcf('0x12')](function(_0x49fb61){_0x3e56da['rows']=_0x49fb61;return _0x3e56da;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x5ec7e6,_0x35a432))[_0x9dcf('0x1d')](handleError(_0x5ec7e6,null));};exports[_0x9dcf('0x79')]=function(_0x3a4c06,_0x4ed0f5){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x3a4c06[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x4ed0f5,null))['then'](function(_0x54052e){if(_0x54052e){return _0x54052e[_0x9dcf('0x79')](_0x3a4c06[_0x9dcf('0x52')]['ids']);}})[_0x9dcf('0x12')](respondWithStatusCode(_0x4ed0f5,null))[_0x9dcf('0x1d')](handleError(_0x4ed0f5,null));};exports[_0x9dcf('0x6f')]=function(_0x580d53,_0x5b5375){var _0x56f86a={'name':_0x580d53['body'][_0x9dcf('0x2d')],'key':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x50')],'provider':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x6a')]==='custom'?null:_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x6a')],'email':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7a')],'ListId':_0x580d53[_0x9dcf('0x68')]['ListId'],'active':!_[_0x9dcf('0x7b')](_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7c')])?_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7c')]:!![],'description':_0x580d53[_0x9dcf('0x68')][_0x9dcf('0x7d')]||null};var _0xec2398=getAuthenticationOptions(_0x56f86a[_0x9dcf('0x6a')],_0x580d53[_0x9dcf('0x68')]);_0x56f86a[_0x9dcf('0x49')]=_0xec2398[_0x9dcf('0x49')];_0x56f86a['Smtp']=_0xec2398['Smtp'];return db[_0x9dcf('0x61')][_0x9dcf('0x6f')](_0x56f86a,{'include':[{'model':db['MailServerOut'],'as':_0x9dcf('0x46')},{'model':db[_0x9dcf('0x48')],'as':_0x9dcf('0x49')}]})[_0x9dcf('0x12')](function(_0x3105b3){var _0x5c6195=_0x580d53['user'][_0x9dcf('0x28')]({'plain':!![]});if(!_0x5c6195)throw new Error(_0x9dcf('0x7e'));if(_0x5c6195[_0x9dcf('0x7f')]===_0x9dcf('0x45')){var _0x90b6f7=_0x3105b3[_0x9dcf('0x28')]({'plain':!![]});return db[_0x9dcf('0x80')][_0x9dcf('0x67')]({'where':{'name':_0x9dcf('0x29'),'userProfileId':_0x5c6195[_0x9dcf('0x81')]},'raw':!![]})[_0x9dcf('0x12')](function(_0x24bf47){if(_0x24bf47&&_0x24bf47[_0x9dcf('0x82')]===0x0){return db['UserProfileResource'][_0x9dcf('0x6f')]({'name':_0x90b6f7[_0x9dcf('0x2d')],'resourceId':_0x90b6f7['id'],'type':_0x24bf47['name'],'sectionId':_0x24bf47['id']},{})['then'](function(){return _0x3105b3;});}else{return _0x3105b3;}})[_0x9dcf('0x1d')](function(_0x18818f){logger[_0x9dcf('0x19')](_0x9dcf('0x83'),_0x18818f);throw _0x18818f;});}return _0x3105b3;})[_0x9dcf('0x12')](respondWithResult(_0x5b5375,0xc9))[_0x9dcf('0x1d')](handleError(_0x5b5375,null));};exports[_0x9dcf('0x84')]=function(_0x316c1b,_0x43e45a){return db['MailAccount'][_0x9dcf('0x70')]({'where':{'id':_0x316c1b[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x43e45a,null))[_0x9dcf('0x12')](function(_0x36c205){if(_0x36c205){return _0x36c205['getImap']();}return null;})[_0x9dcf('0x12')](respondWithResult(_0x43e45a,null))[_0x9dcf('0x1d')](handleError(_0x43e45a,null));};exports['addImap']=function(_0x15da14,_0x605ada){if(_0x15da14[_0x9dcf('0x68')]['id']){delete _0x15da14[_0x9dcf('0x68')]['id'];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x15da14[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x605ada,null))[_0x9dcf('0x12')](function(_0x43ae4d){if(_0x43ae4d){_0x15da14[_0x9dcf('0x68')][_0x9dcf('0x85')]=_0x43ae4d['id'];return db[_0x9dcf('0x48')][_0x9dcf('0x6f')](_0x15da14[_0x9dcf('0x68')]);}})[_0x9dcf('0x12')](respondWithResult(_0x605ada,null))['catch'](handleError(_0x605ada,null));};exports[_0x9dcf('0x86')]=function(_0x53d182,_0x2653ee){return db[_0x9dcf('0x61')]['findOne']({'where':{'id':_0x53d182[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x2653ee,null))[_0x9dcf('0x12')](function(_0x39f783){if(_0x39f783){return _0x39f783['setImap'](null);}return null;})[_0x9dcf('0x12')](respondWithStatusCode(_0x2653ee,null))[_0x9dcf('0x1d')](handleError(_0x2653ee,null));};exports[_0x9dcf('0x87')]=function(_0x46c81d,_0x51c699){return db['MailAccount'][_0x9dcf('0x70')]({'where':{'id':_0x46c81d['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x51c699,null))['then'](function(_0xbd912f){if(_0xbd912f){return _0xbd912f[_0x9dcf('0x87')]();}return null;})[_0x9dcf('0x12')](respondWithResult(_0x51c699,null))[_0x9dcf('0x1d')](handleError(_0x51c699,null));};exports[_0x9dcf('0x88')]=function(_0x2c413f,_0x58e979){if(_0x2c413f['body']['id']){delete _0x2c413f['body']['id'];}return db['MailAccount'][_0x9dcf('0x67')]({'where':{'id':_0x2c413f[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x58e979,null))[_0x9dcf('0x12')](function(_0xd0bdab){if(_0xd0bdab){_0x2c413f[_0x9dcf('0x68')][_0x9dcf('0x85')]=_0xd0bdab['id'];return db[_0x9dcf('0x4a')][_0x9dcf('0x6f')](_0x2c413f[_0x9dcf('0x68')]);}})['then'](respondWithResult(_0x58e979,null))['catch'](handleError(_0x58e979,null));};exports[_0x9dcf('0x89')]=function(_0x4c0693,_0x14d2b7){return db[_0x9dcf('0x61')]['findOne']({'where':{'id':_0x4c0693['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x14d2b7,null))[_0x9dcf('0x12')](function(_0x40d822){if(_0x40d822){return _0x40d822[_0x9dcf('0x8a')](null);}return null;})[_0x9dcf('0x12')](respondWithStatusCode(_0x14d2b7,null))[_0x9dcf('0x1d')](handleError(_0x14d2b7,null));};exports[_0x9dcf('0x8b')]=function(_0x49c160,_0xa29cf4){return db[_0x9dcf('0x8c')][_0x9dcf('0x67')]({'where':{'id':_0x49c160[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0xa29cf4,null))[_0x9dcf('0x12')](function(_0xc14866){if(_0xc14866){return _0xc14866[_0x9dcf('0x8b')](_0x49c160[_0x9dcf('0x68')][_0x9dcf('0x74')],_['omit'](_0x49c160[_0x9dcf('0x68')],['ids','id'])||{});}})['then'](respondWithResult(_0xa29cf4,null))['catch'](handleError(_0xa29cf4,null));};exports[_0x9dcf('0x8d')]=function(_0x4c6b9f,_0x1dace0){var _0x25bff4={'raw':![],'where':{}};var _0x4d6668={};var _0x58181d={'count':0x0,'rows':[]};return db[_0x9dcf('0x61')]['findOne']({'where':{'id':_0x4c6b9f[_0x9dcf('0x65')]['id']}})['then'](handleEntityNotFound(_0x1dace0,null))[_0x9dcf('0x12')](function(_0x1af33a){if(_0x1af33a){_0x4d6668[_0x9dcf('0x51')]=_['keys'](db[_0x9dcf('0x8c')][_0x9dcf('0x66')]);_0x4d6668[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x4c6b9f['query']);_0x4d6668['filters']=_['intersection'](_0x4d6668['model'],_0x4d6668[_0x9dcf('0x52')]);_0x25bff4[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x4d6668[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x25bff4['attributes']=_0x25bff4['attributes'][_0x9dcf('0x58')]?_0x25bff4[_0x9dcf('0x56')]:_0x4d6668[_0x9dcf('0x51')];if(!_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x25bff4[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x4c6b9f[_0x9dcf('0x52')]['limit']);_0x25bff4['offset']=qs['offset'](_0x4c6b9f[_0x9dcf('0x52')]['offset']);}_0x25bff4['order']=qs['sort'](_0x4c6b9f['query']['sort']);_0x25bff4['where']=qs[_0x9dcf('0x54')](_[_0x9dcf('0x5c')](_0x4c6b9f[_0x9dcf('0x52')],_0x4d6668['filters']));_0x25bff4['where'][_0x9dcf('0x85')]=_0x1af33a['id'];if(_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x25bff4[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x25bff4[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x25bff4['attributes'],function(_0x5d3cb0){var _0x55f690={};_0x55f690[_0x5d3cb0]={'$like':'%'+_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x55f690;})});}_0x25bff4=_[_0x9dcf('0x5e')]({},_0x25bff4,_0x4c6b9f[_0x9dcf('0x60')]);return db['MailInteraction'][_0x9dcf('0x24')]({'where':_0x25bff4[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0x19b73d){_0x58181d[_0x9dcf('0x24')]=_0x19b73d;if(_0x4c6b9f['query'][_0x9dcf('0x62')]){_0x25bff4[_0x9dcf('0x63')]=[{'model':db['CmContact'],'as':_0x9dcf('0x8e'),'required':![]},{'model':db['User'],'as':_0x9dcf('0x8f'),'attributes':[_0x9dcf('0x2d'),'fullname',_0x9dcf('0x90')],'required':![]},{'model':db[_0x9dcf('0x91')],'as':'Tags','attributes':['id',_0x9dcf('0x2d'),_0x9dcf('0x92')],'where':_0x4c6b9f['query'][_0x9dcf('0x93')]?{'id':_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x93')]}:undefined,'required':_0x4c6b9f[_0x9dcf('0x52')][_0x9dcf('0x93')]?!![]:![]}];}return db['MailInteraction'][_0x9dcf('0x72')](_0x25bff4);})[_0x9dcf('0x12')](function(_0x53bd73){_0x58181d[_0x9dcf('0x64')]=_0x53bd73;return _0x58181d;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x1dace0,_0x25bff4))[_0x9dcf('0x1d')](handleError(_0x1dace0,null));};exports[_0x9dcf('0x94')]=function addApplications(_0x48b903,_0x23a099){var _0xbb8c8b=_0x48b903[_0x9dcf('0x65')]['id'];var _0x177298=_0x48b903[_0x9dcf('0x68')];var _0x1060a8=0xc8;var _0xe42d61=null;return db[_0x9dcf('0x95')][_0x9dcf('0x96')]({'isolationLevel':db[_0x9dcf('0x95')][_0x9dcf('0x97')][_0x9dcf('0x98')][_0x9dcf('0x99')]},function(_0x524330){return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0xbb8c8b},'transaction':_0x524330})[_0x9dcf('0x12')](function(_0xdc4a9f){if(_0xdc4a9f){return db[_0x9dcf('0x9a')][_0x9dcf('0x27')]({'where':{'MailAccountId':_0xbb8c8b},'transaction':_0x524330})['then'](function(){var _0x1b8c65=_[_0x9dcf('0x4d')](_0x177298,function(_0x1feb7e){_0x1feb7e[_0x9dcf('0x85')]=_0xbb8c8b;return _0x1feb7e;});return db[_0x9dcf('0x9a')][_0x9dcf('0x9b')](_0x1b8c65,{'transaction':_0x524330});});}else{_0x1060a8=0x194;_0xe42d61=[];}});})[_0x9dcf('0x12')](function(){if(_0x1060a8!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0xbb8c8b},'order':_0x9dcf('0x9c')})[_0x9dcf('0x12')](function(_0x473c7e){_0xe42d61=_0x473c7e;});}})['catch'](function(_0x1c2914){_0x1060a8=0x1f4;logger[_0x9dcf('0x19')](_0x1c2914[_0x9dcf('0x2c')]);if(_0x1c2914[_0x9dcf('0x2d')]){delete _0x1c2914['name'];}_0xe42d61=_0x1c2914;})['finally'](function(){if(_0xe42d61===null){_0x23a099[_0x9dcf('0x1e')](_0x1060a8);}else{if(_0x1060a8===0x1f4){_0x23a099[_0x9dcf('0x1f')](_0x1060a8)['send'](_0xe42d61);}else{_0x23a099[_0x9dcf('0x1f')](_0x1060a8)[_0x9dcf('0x20')](_0xe42d61);}}});};exports[_0x9dcf('0x9d')]=function(_0xab7f5,_0xd0c4db){var _0x17770b={};var _0xe4aca0={};var _0x6e3b66;var _0x150e78;return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0xab7f5['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0xd0c4db,null))[_0x9dcf('0x12')](function(_0x1263ff){if(_0x1263ff){_0x6e3b66=_0x1263ff;_0xe4aca0['model']=_[_0x9dcf('0x53')](db[_0x9dcf('0x9a')][_0x9dcf('0x66')]);_0xe4aca0[_0x9dcf('0x52')]=_['keys'](_0xab7f5[_0x9dcf('0x52')]);_0xe4aca0['filters']=_[_0x9dcf('0x55')](_0xe4aca0[_0x9dcf('0x51')],_0xe4aca0['query']);_0x17770b['attributes']=_[_0x9dcf('0x55')](_0xe4aca0['model'],qs['fields'](_0xab7f5['query'][_0x9dcf('0x57')]));_0x17770b['attributes']=_0x17770b['attributes'][_0x9dcf('0x58')]?_0x17770b[_0x9dcf('0x56')]:_0xe4aca0[_0x9dcf('0x51')];_0x17770b[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0xab7f5[_0x9dcf('0x52')]['sort']);_0x17770b[_0x9dcf('0x5b')]=qs[_0x9dcf('0x54')](_[_0x9dcf('0x5c')](_0xab7f5[_0x9dcf('0x52')],_0xe4aca0[_0x9dcf('0x54')]));if(_0xab7f5['query'][_0x9dcf('0x5d')]){_0x17770b[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x17770b[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x17770b[_0x9dcf('0x56')],function(_0x373efd){var _0xa1967a={};_0xa1967a[_0x373efd]={'$like':'%'+_0xab7f5[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0xa1967a;})});}_0x17770b=_['merge']({},_0x17770b,_0xab7f5[_0x9dcf('0x60')]);return _0x6e3b66['getApplications'](_0x17770b);}})[_0x9dcf('0x12')](function(_0xc66746){if(_0xc66746){_0x150e78=_0xc66746[_0x9dcf('0x58')];if(!_0xab7f5[_0x9dcf('0x52')][_0x9dcf('0x59')]('nolimit')){_0x17770b[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0xab7f5[_0x9dcf('0x52')][_0x9dcf('0x23')]);_0x17770b[_0x9dcf('0x21')]=qs[_0x9dcf('0x21')](_0xab7f5['query'][_0x9dcf('0x21')]);}return _0x6e3b66[_0x9dcf('0x9d')](_0x17770b);}})[_0x9dcf('0x12')](function(_0x2ce6db){if(_0x2ce6db){return _0x2ce6db?{'count':_0x150e78,'rows':_0x2ce6db}:null;}})[_0x9dcf('0x12')](respondWithResult(_0xd0c4db,null))[_0x9dcf('0x1d')](handleError(_0xd0c4db,null));};exports[_0x9dcf('0x9e')]=function(_0x240554,_0x3bce89){var _0x27e298={'raw':!![],'where':{}};var _0x1fab59={};var _0x46b9c1={'count':0x0,'rows':[]};return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0x240554[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x3bce89,null))[_0x9dcf('0x12')](function(_0x394b61){if(_0x394b61){_0x1fab59[_0x9dcf('0x51')]=_[_0x9dcf('0x53')](db[_0x9dcf('0x9f')]['rawAttributes']);_0x1fab59[_0x9dcf('0x52')]=_['keys'](_0x240554[_0x9dcf('0x52')]);_0x1fab59[_0x9dcf('0x54')]=_[_0x9dcf('0x55')](_0x1fab59['model'],_0x1fab59[_0x9dcf('0x52')]);_0x27e298[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x1fab59[_0x9dcf('0x51')],qs[_0x9dcf('0x57')](_0x240554[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x27e298['attributes']=_0x27e298[_0x9dcf('0x56')][_0x9dcf('0x58')]?_0x27e298[_0x9dcf('0x56')]:_0x1fab59['model'];if(!_0x240554[_0x9dcf('0x52')][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x27e298[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x240554[_0x9dcf('0x52')][_0x9dcf('0x23')]);_0x27e298[_0x9dcf('0x21')]=qs[_0x9dcf('0x21')](_0x240554['query'][_0x9dcf('0x21')]);}_0x27e298[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0x240554[_0x9dcf('0x52')]['sort']);_0x27e298['where']=qs['filters'](_[_0x9dcf('0x5c')](_0x240554[_0x9dcf('0x52')],_0x1fab59[_0x9dcf('0x54')]));_0x27e298[_0x9dcf('0x5b')][_0x9dcf('0x85')]=_0x394b61['id'];if(_0x240554['query']['filter']){_0x27e298['where']=_[_0x9dcf('0x5e')](_0x27e298[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x27e298[_0x9dcf('0x56')],function(_0x500af3){var _0x3af60d={};_0x3af60d[_0x500af3]={'$like':'%'+_0x240554[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x3af60d;})});}if(_0x240554[_0x9dcf('0x52')]['$gte']){var _0x3d29e7=_0x240554['query'][_0x9dcf('0xa0')][_0x9dcf('0xa1')](',');var _0xbc853={};_0xbc853[_0x3d29e7[0x0]]={'$gte':moment(_0x3d29e7[0x1])[_0x9dcf('0xa2')](_0x9dcf('0xa3'))};_0x27e298[_0x9dcf('0x5b')]=_['merge'](_0x27e298['where'],_0xbc853);}_0x27e298=_['merge']({},_0x27e298,_0x240554['options']);return db[_0x9dcf('0x9f')][_0x9dcf('0x24')]({'where':_0x27e298[_0x9dcf('0x5b')]})[_0x9dcf('0x12')](function(_0x4d5133){_0x46b9c1[_0x9dcf('0x24')]=_0x4d5133;if(_0x240554['query'][_0x9dcf('0x62')]){_0x27e298['include']=[{'all':!![]}];}return db[_0x9dcf('0x9f')]['findAll'](_0x27e298);})['then'](function(_0x85c39){if(_0x240554[_0x9dcf('0x52')][_0x9dcf('0xa4')]==='true'){for(var _0x443563=0x0;_0x443563<_0x85c39[_0x9dcf('0x58')];_0x443563++){_0x85c39[_0x443563][_0x9dcf('0x68')]=juice(_0x85c39[_0x443563][_0x9dcf('0x68')]);}}_0x46b9c1[_0x9dcf('0x64')]=_0x85c39;return _0x46b9c1;});}})[_0x9dcf('0x12')](respondWithFilteredResult(_0x3bce89,_0x27e298))[_0x9dcf('0x1d')](handleError(_0x3bce89,null));};exports[_0x9dcf('0x2e')]=function(_0x2a56f1,_0x3684fb){var _0x234efc,_0x4ded08={},_0x323601;if(_0x2a56f1[_0x9dcf('0x68')]['to']){_0x323601=_0x2a56f1[_0x9dcf('0x68')]['to'][_0x9dcf('0xa1')](',')[0x0];}return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x2a56f1['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9dcf('0xa5')],'as':_0x9dcf('0xa6'),'where':{'email':_0x323601},'limit':0x1,'order':[[_0x9dcf('0xa7'),_0x9dcf('0xa8')]]}]},{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46'),'raw':!![],'include':[{'model':db[_0x9dcf('0xa9')],'as':_0x9dcf('0xa9'),'raw':!![]}]}]})[_0x9dcf('0x12')](handleEntityNotFound(_0x3684fb,null))[_0x9dcf('0x12')](function(_0x47d0ae){if(!_0x47d0ae)return;_0x234efc=_0x47d0ae;if(!_0x47d0ae[_0x9dcf('0x46')])throw new Error(_0x9dcf('0xaa'));if(_[_0x9dcf('0x7b')](_0x2a56f1['body'][_0x9dcf('0xab')])){_0x2a56f1['body']['from']=util[_0x9dcf('0xa2')](_0x9dcf('0xac'),_0x47d0ae[_0x9dcf('0x2d')],_0x47d0ae[_0x9dcf('0x7a')]||_0x47d0ae[_0x9dcf('0x46')][_0x9dcf('0x45')]);}if(_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')]&&_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x9dcf('0x58')]){for(var _0x27a00d=0x0;_0x27a00d<_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x9dcf('0x58')];_0x27a00d+=0x1){_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x27a00d]={'filename':_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x27a00d][_0x9dcf('0x2d')],'path':path[_0x9dcf('0xae')](config['root'],_0x9dcf('0xaf'),_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xad')][_0x27a00d][_0x9dcf('0xb0')])};}}var _0x37afd4=_0x47d0ae[_0x9dcf('0xb1')]();return respondWithRpcPromise(_0x9dcf('0xb2'),'sendMail',{'account':_0x37afd4,'message':_0x2a56f1[_0x9dcf('0x68')]});})[_0x9dcf('0x12')](function(_0x339dd3){if(!_0x339dd3)return;_0x4ded08=_0x339dd3;if(!_0x234efc[_0x9dcf('0xb3')])throw new Error(_0x9dcf('0xb4'));if(_0x234efc[_0x9dcf('0xb3')][_0x9dcf('0xa6')]['length'])return _0x234efc[_0x9dcf('0xb3')][_0x9dcf('0xa6')][0x0];return db[_0x9dcf('0xa5')][_0x9dcf('0x6f')](_['defaults'](_0x2a56f1[_0x9dcf('0x68')],{'firstName':_0x2a56f1[_0x9dcf('0x68')]['to'],'email':_0x2a56f1['body']['to'],'phone':_0x2a56f1[_0x9dcf('0x68')]['to'],'ListId':_0x234efc['ListId']}));})[_0x9dcf('0x12')](function(_0x588b7d){if(!_0x588b7d)return;var _0x1fe03d={'UserId':_0x2a56f1[_0x9dcf('0x45')]['id'],'ContactId':_0x588b7d['id'],'MailAccountId':_0x234efc['id'],'inReplyTo':_0x4ded08[_0x9dcf('0xb5')],'to':_0x2a56f1[_0x9dcf('0x68')]['from'],'cc':_0x2a56f1['body']['cc'],'subject':_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xb6')],'attach':_0x2a56f1['body'][_0x9dcf('0xb7')],'firstMsgDirection':_0x9dcf('0xb8'),'lastMsgAt':moment()['format'](_0x9dcf('0xa3')),'lastMsgDirection':'out','Messages':[_[_0x9dcf('0x5e')](_0x2a56f1[_0x9dcf('0x68')],{'messageId':_0x4ded08[_0x9dcf('0xb5')],'sentAt':moment()[_0x9dcf('0xa2')](_0x9dcf('0xa3')),'read':!![],'MailAccountId':_0x234efc['id'],'UserId':_0x2a56f1[_0x9dcf('0x45')]['id'],'ContactId':_0x588b7d['id']})]};if(_0x2a56f1[_0x9dcf('0x68')][_0x9dcf('0xb9')]){_0x1fe03d=_[_0x9dcf('0x5e')](_0x1fe03d,_0x2a56f1['body'][_0x9dcf('0xb9')]);}return db['MailInteraction']['create'](_0x1fe03d,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x9dcf('0x12')](respondWithResult(_0x3684fb,null))[_0x9dcf('0x1d')](handleError(_0x3684fb,null));};exports[_0x9dcf('0xba')]=function(_0x5b5917,_0x37714a){return db['MailAccount'][_0x9dcf('0x67')]({'where':{'id':_0x5b5917[_0x9dcf('0x65')]['id']},'include':[{'model':db[_0x9dcf('0x4a')],'as':_0x9dcf('0x46'),'raw':!![],'include':[{'model':db[_0x9dcf('0xa9')],'as':_0x9dcf('0xa9'),'raw':!![]}]}]})[_0x9dcf('0x12')](handleEntityNotFound(_0x37714a,null))[_0x9dcf('0x12')](function(_0x2b5eba){if(!_0x2b5eba[_0x9dcf('0x46')])return;var _0x309d92=_0x2b5eba[_0x9dcf('0xb1')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x309d92});})['then'](respondWithResult(_0x37714a,null))[_0x9dcf('0x1d')](handleError(_0x37714a,null));};exports[_0x9dcf('0x27')]=function(_0x42a53a,_0x2983df){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x42a53a[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x2983df,null))[_0x9dcf('0x12')](function(_0x1d38d7){if(_0x1d38d7&&_0x1d38d7[_0x9dcf('0x43')]){throw new db['Sequelize'][(_0x9dcf('0xbb'))](_0x9dcf('0xbc'));}return _0x1d38d7;})['then'](removeEntity(_0x2983df,null))['catch'](handleError(_0x2983df,null));};exports[_0x9dcf('0xbd')]=function(_0x2491e1,_0x1bd716){return db[_0x9dcf('0x61')][_0x9dcf('0x67')]({'where':{'id':_0x2491e1[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x1bd716,null))[_0x9dcf('0x12')](function(_0x4bf17a){if(_0x4bf17a){return _0x4bf17a[_0x9dcf('0xbd')](_0x2491e1[_0x9dcf('0x68')][_0x9dcf('0x74')],_[_0x9dcf('0xbe')](_0x2491e1[_0x9dcf('0x68')],[_0x9dcf('0x74'),'id'])||{})[_0x9dcf('0xbf')](function(_0x2802db){for(var _0xc2dec5=0x0;_0xc2dec5<_0x2491e1[_0x9dcf('0x68')]['ids'][_0x9dcf('0x58')];_0xc2dec5+=0x1){socket['emit'](_0x9dcf('0xc0'),{'UserId':Number(_0x2491e1[_0x9dcf('0x68')][_0x9dcf('0x74')][_0xc2dec5]),'MailAccountId':Number(_0x2491e1['params']['id'])});}return _0x2802db;});}})[_0x9dcf('0x12')](respondWithResult(_0x1bd716,null))[_0x9dcf('0x1d')](handleError(_0x1bd716,null));};exports[_0x9dcf('0xc1')]=function(_0x138b2b,_0x1bd6bf){return db['MailAccount'][_0x9dcf('0x67')]({'where':{'id':_0x138b2b[_0x9dcf('0x65')]['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x1bd6bf,null))['then'](function(_0xe353c9){if(_0xe353c9){return _0xe353c9[_0x9dcf('0xc1')](_0x138b2b[_0x9dcf('0x52')]['ids'])['then'](function(){if(_[_0x9dcf('0xc2')](_0x138b2b['query'][_0x9dcf('0x74')])){for(var _0x281884=0x0;_0x281884<_0x138b2b[_0x9dcf('0x52')][_0x9dcf('0x74')][_0x9dcf('0x58')];_0x281884+=0x1){socket['emit'](_0x9dcf('0xc3'),{'UserId':Number(_0x138b2b[_0x9dcf('0x52')]['ids'][_0x281884]),'MailAccountId':Number(_0x138b2b[_0x9dcf('0x65')]['id'])});}}else{socket[_0x9dcf('0xc4')]('userMailAccount:remove',{'UserId':Number(_0x138b2b[_0x9dcf('0x52')][_0x9dcf('0x74')]),'MailAccountId':Number(_0x138b2b[_0x9dcf('0x65')]['id'])});}});}})[_0x9dcf('0x12')](respondWithStatusCode(_0x1bd6bf,null))[_0x9dcf('0x1d')](handleError(_0x1bd6bf,null));};exports[_0x9dcf('0xc5')]=function(_0x82c22b,_0x487768){var _0x1404ea={};var _0x17e52d={};var _0x6bd583;var _0x2aea01;return db[_0x9dcf('0x61')][_0x9dcf('0x70')]({'where':{'id':_0x82c22b['params']['id']}})[_0x9dcf('0x12')](handleEntityNotFound(_0x487768,null))[_0x9dcf('0x12')](function(_0x894d8a){if(_0x894d8a){_0x6bd583=_0x894d8a;_0x17e52d['model']=_[_0x9dcf('0x53')](db[_0x9dcf('0xc6')][_0x9dcf('0x66')]);_0x17e52d[_0x9dcf('0x52')]=_[_0x9dcf('0x53')](_0x82c22b[_0x9dcf('0x52')]);_0x17e52d['filters']=_[_0x9dcf('0x55')](_0x17e52d['model'],_0x17e52d[_0x9dcf('0x52')]);_0x1404ea[_0x9dcf('0x56')]=_[_0x9dcf('0x55')](_0x17e52d[_0x9dcf('0x51')],qs['fields'](_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x57')]));_0x1404ea['attributes']=_0x1404ea['attributes'][_0x9dcf('0x58')]?_0x1404ea['attributes']:_0x17e52d[_0x9dcf('0x51')];_0x1404ea[_0x9dcf('0x71')]=qs[_0x9dcf('0x5a')](_0x82c22b[_0x9dcf('0x52')]['sort']);_0x1404ea[_0x9dcf('0x5b')]=qs['filters'](_['pick'](_0x82c22b[_0x9dcf('0x52')],_0x17e52d['filters']));if(_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x5d')]){_0x1404ea[_0x9dcf('0x5b')]=_[_0x9dcf('0x5e')](_0x1404ea[_0x9dcf('0x5b')],{'$or':_[_0x9dcf('0x4d')](_0x1404ea['attributes'],function(_0x54d5ba){var _0x46a1a8={};_0x46a1a8[_0x54d5ba]={'$like':'%'+_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x5d')]+'%'};return _0x46a1a8;})});}_0x1404ea=_[_0x9dcf('0x5e')]({},_0x1404ea,_0x82c22b[_0x9dcf('0x60')]);return _0x6bd583[_0x9dcf('0xc5')](_0x1404ea);}})[_0x9dcf('0x12')](function(_0x5d23b0){if(_0x5d23b0){_0x2aea01=_0x5d23b0[_0x9dcf('0x58')];if(!_0x82c22b[_0x9dcf('0x52')][_0x9dcf('0x59')](_0x9dcf('0x78'))){_0x1404ea[_0x9dcf('0x23')]=qs[_0x9dcf('0x23')](_0x82c22b['query'][_0x9dcf('0x23')]);_0x1404ea[_0x9dcf('0x21')]=qs['offset'](_0x82c22b[_0x9dcf('0x52')]['offset']);}return _0x6bd583['getAgents'](_0x1404ea);}})[_0x9dcf('0x12')](function(_0xbad0a2){if(_0xbad0a2){return _0xbad0a2?{'count':_0x2aea01,'rows':_0xbad0a2}:null;}})[_0x9dcf('0x12')](respondWithResult(_0x487768,null))[_0x9dcf('0x1d')](handleError(_0x487768,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 78a8e3f..ea3c6dc 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 _0xf970=['hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0f97('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x0f97('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0f97('0x2')](0x0);var events={'afterCreate':_0x0f97('0x3'),'afterUpdate':_0x0f97('0x4'),'afterDestroy':_0x0f97('0x5')};function emitEvent(_0x25e484){return function(_0x439149,_0x4ab74d,_0xc822e8){MailAccountEvents[_0x0f97('0x6')](_0x25e484+':'+_0x439149['id'],_0x439149);MailAccountEvents[_0x0f97('0x6')](_0x25e484,_0x439149);_0xc822e8(null);};}for(var e in events){if(events[_0x0f97('0x7')](e)){var event=events[e];MailAccount[_0x0f97('0x8')](e,emitEvent(event));}}module[_0x0f97('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x66fa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x66fa,0x117));var _0xa66f=function(_0x4c34ef,_0x3b438d){_0x4c34ef=_0x4c34ef-0x0;var _0x377846=_0x66fa[_0x4c34ef];return _0x377846;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var MailAccount=require(_0xa66f('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa66f('0x2')](0x0);var events={'afterCreate':_0xa66f('0x3'),'afterUpdate':_0xa66f('0x4'),'afterDestroy':_0xa66f('0x5')};function emitEvent(_0x3d0c49){return function(_0x2a2abf,_0x3f4904,_0x5ebea5){MailAccountEvents['emit'](_0x3d0c49+':'+_0x2a2abf['id'],_0x2a2abf);MailAccountEvents[_0xa66f('0x6')](_0x3d0c49,_0x2a2abf);_0x5ebea5(null);};}for(var e in events){if(events[_0xa66f('0x7')](e)){var event=events[e];MailAccount[_0xa66f('0x8')](e,emitEvent(event));}}module[_0xa66f('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 7afbd7c..deb2cea 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 _0xe241=['data5','./mailAccount.attributes','define','mail_accounts','provider','service','Smtp','host','port','secure','authentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user'];(function(_0xdb344f,_0xd0f413){var _0x1addba=function(_0x4a0ad0){while(--_0x4a0ad0){_0xdb344f['push'](_0xdb344f['shift']());}};_0x1addba(++_0xd0f413);}(_0xe241,0x169));var _0x1e24=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xe241[_0x2aecb2];return _0x3ebb80;};'use strict';var attributes=require(_0x1e24('0x0'));module['exports']=function(_0x367d92){return _0x367d92[_0x1e24('0x1')]('MailAccount',attributes,{'tableName':_0x1e24('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x22fff5=this;var _0x4df7f8={'id':_0x22fff5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x22fff5[_0x1e24('0x3')]!=='custom'){_0x4df7f8[_0x1e24('0x4')]=_0x22fff5[_0x1e24('0x3')];}else{_0x4df7f8['host']=_0x22fff5[_0x1e24('0x5')][_0x1e24('0x6')];_0x4df7f8['port']=_0x22fff5[_0x1e24('0x5')][_0x1e24('0x7')];_0x4df7f8[_0x1e24('0x8')]=_0x22fff5[_0x1e24('0x5')][_0x1e24('0x8')];}if(_0x22fff5[_0x1e24('0x5')][_0x1e24('0x9')]){if(_0x22fff5['Smtp']['modernAuthentication']){if(!_0x22fff5[_0x1e24('0x5')]['CloudProvider'])throw new Error(_0x1e24('0xa'));_0x4df7f8[_0x1e24('0xb')]={'type':_0x1e24('0xc'),'user':_0x22fff5[_0x1e24('0x5')][_0x1e24('0xd')],'accessToken':_0x22fff5[_0x1e24('0x5')]['CloudProvider'][_0x1e24('0xe')]};}else{_0x4df7f8[_0x1e24('0xb')]={'user':_0x22fff5[_0x1e24('0x5')][_0x1e24('0xd')],'pass':_0x22fff5[_0x1e24('0x5')]['pass']};}}return _0x4df7f8;}}});}; \ No newline at end of file +var _0x4901=['service','provider','host','Smtp','port','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user','data5','auth','pass','./mailAccount.attributes','exports','define','mail_accounts','custom'];(function(_0x49c03d,_0x3434d8){var _0x37e8b1=function(_0x341e18){while(--_0x341e18){_0x49c03d['push'](_0x49c03d['shift']());}};_0x37e8b1(++_0x3434d8);}(_0x4901,0xb6));var _0x1490=function(_0x55d50d,_0x5d82d7){_0x55d50d=_0x55d50d-0x0;var _0x315583=_0x4901[_0x55d50d];return _0x315583;};'use strict';var attributes=require(_0x1490('0x0'));module[_0x1490('0x1')]=function(_0x7061bb){return _0x7061bb[_0x1490('0x2')]('MailAccount',attributes,{'tableName':_0x1490('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x194de1=this;var _0x548117={'id':_0x194de1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x194de1['provider']!==_0x1490('0x4')){_0x548117[_0x1490('0x5')]=_0x194de1[_0x1490('0x6')];}else{_0x548117[_0x1490('0x7')]=_0x194de1[_0x1490('0x8')][_0x1490('0x7')];_0x548117[_0x1490('0x9')]=_0x194de1[_0x1490('0x8')][_0x1490('0x9')];_0x548117[_0x1490('0xa')]=_0x194de1['Smtp'][_0x1490('0xa')];}if(_0x194de1[_0x1490('0x8')]['authentication']){if(_0x194de1[_0x1490('0x8')]['modernAuthentication']){if(!_0x194de1['Smtp'][_0x1490('0xb')])throw new Error(_0x1490('0xc'));_0x548117['auth']={'type':'OAuth2','user':_0x194de1['Smtp'][_0x1490('0xd')],'accessToken':_0x194de1['Smtp']['CloudProvider'][_0x1490('0xe')]};}else{_0x548117[_0x1490('0xf')]={'user':_0x194de1[_0x1490('0x8')][_0x1490('0xd')],'pass':_0x194de1[_0x1490('0x8')][_0x1490('0x10')]};}}return _0x548117;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index be00a79..698245c 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 _0xf69d=['redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','MailAccount','findAll','raw','options','attributes','limit','map','include','GetMailAccount','debug','catch','ShowMailAccount','find','where','model','setDataValue','smtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','asc','length','close','autoclose','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','update','format','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','*,*,*,*','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0xf69d,0xd3));var _0xdf69=function(_0x429681,_0x112ee7){_0x429681=_0x429681-0x0;var _0x5ca793=_0xf69d[_0x429681];return _0x5ca793;};'use strict';var _=require(_0xdf69('0x0'));var moment=require(_0xdf69('0x1'));var BPromise=require(_0xdf69('0x2'));var rs=require(_0xdf69('0x3'));var Redis=require(_0xdf69('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xdf69('0x5'))(_0xdf69('0x6'));var config=require(_0xdf69('0x7'));var jayson=require(_0xdf69('0x8'));var client=jayson[_0xdf69('0x9')][_0xdf69('0xa')]({'port':0x232c});config[_0xdf69('0xb')]=_[_0xdf69('0xc')](config[_0xdf69('0xb')],{'host':_0xdf69('0xd'),'port':0x18eb});var socket=require(_0xdf69('0xe'))(new Redis(config[_0xdf69('0xb')]));require(_0xdf69('0xf'))[_0xdf69('0x10')](socket);function respondWithRpcPromise(_0x40217f,_0x211ea9,_0x1e0e8d){return new BPromise(function(_0x4fcc93,_0x305726){return client[_0xdf69('0x11')](_0x40217f,_0x1e0e8d)[_0xdf69('0x12')](function(_0x21d8e0){logger[_0xdf69('0x13')](_0xdf69('0x14'),_0x211ea9,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x211ea9,'request\x20sent',JSON[_0xdf69('0x15')](_0x21d8e0));if(_0x21d8e0[_0xdf69('0x16')]){if(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x17')]===0x1f4){logger[_0xdf69('0x16')](_0xdf69('0x14'),_0x211ea9,_0x21d8e0['error'][_0xdf69('0x18')]);return _0x305726(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x18')]);}logger[_0xdf69('0x16')]('MailAccount,\x20%s,\x20%s',_0x211ea9,_0x21d8e0[_0xdf69('0x16')]['message']);return _0x4fcc93(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x18')]);}else{logger['info'](_0xdf69('0x14'),_0x211ea9,_0xdf69('0x19'));_0x4fcc93(_0x21d8e0[_0xdf69('0x1a')][_0xdf69('0x18')]);}})['catch'](function(_0x5ae237){logger[_0xdf69('0x16')](_0xdf69('0x14'),_0x211ea9,_0x5ae237);_0x305726(_0x5ae237);});});}exports['GetMailAccount']=function(_0x32cf65){var _0x259e90=this;return new Promise(function(_0x68fa80,_0x526cbc){return db[_0xdf69('0x1b')][_0xdf69('0x1c')]({'raw':_0x32cf65['options']?_0x32cf65['options'][_0xdf69('0x1d')]===undefined?!![]:![]:!![],'where':_0x32cf65[_0xdf69('0x1e')]?_0x32cf65[_0xdf69('0x1e')]['where']||null:null,'attributes':_0x32cf65['options']?_0x32cf65['options'][_0xdf69('0x1f')]||null:null,'limit':_0x32cf65['options']?_0x32cf65[_0xdf69('0x1e')][_0xdf69('0x20')]||null:null,'include':_0x32cf65[_0xdf69('0x1e')]?_0x32cf65['options']['include']?_[_0xdf69('0x21')](_0x32cf65[_0xdf69('0x1e')][_0xdf69('0x22')],function(_0x3fd933){return{'model':db[_0x3fd933['model']],'as':_0x3fd933['as'],'attributes':_0x3fd933[_0xdf69('0x1f')],'include':_0x3fd933[_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x3fd933['include'],function(_0x2da3df){return{'model':db[_0x2da3df['model']],'as':_0x2da3df['as'],'attributes':_0x2da3df['attributes'],'include':_0x2da3df['include']?_['map'](_0x2da3df[_0xdf69('0x22')],function(_0xe339ac){return{'model':db[_0xe339ac['model']],'as':_0xe339ac['as'],'attributes':_0xe339ac[_0xdf69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf69('0x12')](function(_0x19cf2d){logger[_0xdf69('0x13')](_0xdf69('0x23'),_0x32cf65);logger[_0xdf69('0x24')](_0xdf69('0x23'),_0x32cf65,JSON[_0xdf69('0x15')](_0x19cf2d));_0x68fa80(_0x19cf2d);})[_0xdf69('0x25')](function(_0x3b97df){logger[_0xdf69('0x16')](_0xdf69('0x23'),_0x3b97df[_0xdf69('0x18')],_0x32cf65);_0x526cbc(_0x259e90[_0xdf69('0x16')](0x1f4,_0x3b97df[_0xdf69('0x18')]));});});};exports[_0xdf69('0x26')]=function(_0x1f4602){var _0x5ade53=this;return new Promise(function(_0xf910a0,_0x2aab76){return db[_0xdf69('0x1b')][_0xdf69('0x27')]({'raw':_0x1f4602[_0xdf69('0x1e')]?_0x1f4602['options'][_0xdf69('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f4602['options']?_0x1f4602[_0xdf69('0x1e')][_0xdf69('0x28')]||null:null,'attributes':_0x1f4602['options']?_0x1f4602[_0xdf69('0x1e')]['attributes']||null:null,'include':_0x1f4602[_0xdf69('0x1e')]?_0x1f4602[_0xdf69('0x1e')][_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x1f4602[_0xdf69('0x1e')]['include'],function(_0x175d5a){return{'model':db[_0x175d5a['model']],'as':_0x175d5a['as'],'attributes':_0x175d5a[_0xdf69('0x1f')],'include':_0x175d5a[_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x175d5a[_0xdf69('0x22')],function(_0x5c38db){return{'model':db[_0x5c38db[_0xdf69('0x29')]],'as':_0x5c38db['as'],'attributes':_0x5c38db['attributes'],'include':_0x5c38db[_0xdf69('0x22')]?_['map'](_0x5c38db[_0xdf69('0x22')],function(_0x5d8e26){return{'model':db[_0x5d8e26[_0xdf69('0x29')]],'as':_0x5d8e26['as'],'attributes':_0x5d8e26[_0xdf69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf69('0x12')](function(_0x2b7628){if(_0x1f4602[_0xdf69('0x1e')]['smtp']===!![])_0x2b7628[_0xdf69('0x2a')](_0xdf69('0x2b'),_0x2b7628['getSmtpOptions']());logger['info']('ShowMailAccount',_0x1f4602);logger['debug'](_0xdf69('0x26'),_0x1f4602,JSON['stringify'](_0x2b7628));_0xf910a0(_0x2b7628);})[_0xdf69('0x25')](function(_0x1c45b1){logger[_0xdf69('0x16')](_0xdf69('0x26'),_0x1c45b1['message'],_0x1f4602);_0x2aab76(_0x5ade53[_0xdf69('0x16')](0x1f4,_0x1c45b1[_0xdf69('0x18')]));});});};exports[_0xdf69('0x2c')]=function(_0x4f3370){var _0x216f62=this;return new Promise(function(_0xdd919d,_0x34ab67){var _0x1101ad={'body':_0x4f3370[_0xdf69('0x2d')],'channel':_0xdf69('0x2e')};var _0x4094d7=_['difference'](_['keys'](db[_0xdf69('0x2f')][_0xdf69('0x30')]),[_0xdf69('0x31'),_0xdf69('0x32'),'CompanyId','ListId']);var _0x5980b1=![];if(_0x4f3370['body']['id']){delete _0x4f3370[_0xdf69('0x2d')]['id'];}if(_['isNil'](_0x4f3370[_0xdf69('0x2d')]['from'])){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x33')));}if(_[_0xdf69('0x34')](_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x2d')])||_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x2d')]===''){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x35')));}if(_['isNil'](_0x4f3370['body'][_0xdf69('0x36')])){return _0x34ab67(_0x216f62['error'](0x1f4,_0xdf69('0x37')+_0x4094d7));}if(!_[_0xdf69('0x38')](_0x4094d7,_0x4f3370[_0xdf69('0x2d')]['mapKey'])){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x39')+_0x4094d7));}var _0x4093e9={};_0x4093e9[_0x4f3370[_0xdf69('0x2d')]['mapKey']]=_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x3a')];return db['MailAccount']['find']({'where':{'id':_0x4f3370[_0xdf69('0x3b')]['id']},'include':[{'model':db[_0xdf69('0x3c')],'as':_0xdf69('0x3d'),'include':[{'model':db[_0xdf69('0x2f')],'as':_0xdf69('0x3e'),'where':_0x4093e9,'limit':0x1,'order':[[_0xdf69('0x32'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xdf69('0x3f')},{'model':db[_0xdf69('0x40')],'as':_0xdf69('0x41'),'include':[{'model':db[_0xdf69('0x42')],'as':'CloudProvider'}]}]})['then'](function(_0xb34f76){if(_0xb34f76&&_0xb34f76[_0xdf69('0x3d')]){var _0x3ee7a5=_0xb34f76[_0xdf69('0x43')]({'plain':!![]});_0x1101ad[_0xdf69('0x3b')]=_[_0xdf69('0x44')](_0x3ee7a5,[_0xdf69('0x3f'),_0xdf69('0x3d')]);_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x2b')]=_0xb34f76[_0xdf69('0x45')]();_0x1101ad[_0xdf69('0x46')]=_0x3ee7a5[_0xdf69('0x3f')];_0x1101ad[_0xdf69('0x47')]=_0x3ee7a5['List'];_0x1101ad[_0xdf69('0x46')]=_[_0xdf69('0x48')](_0x1101ad[_0xdf69('0x46')],['priority'],[_0xdf69('0x49')]);if(_0x1101ad[_0xdf69('0x3b')]&&_0x1101ad[_0xdf69('0x3b')]['autoclose']){_0x1101ad[_0xdf69('0x46')]['push']({'id':0x0,'priority':_0x1101ad[_0xdf69('0x46')][_0xdf69('0x4a')]+0x1,'app':_0xdf69('0x4b'),'appdata':_0xdf69('0x4c'),'interval':'*,*,*,*'});}if(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3f')]){delete _0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3f')];}if(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3d')]){delete _0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3d')];}if(_0x3ee7a5[_0xdf69('0x3d')]['Contacts'][_0xdf69('0x4a')]){return _0x3ee7a5[_0xdf69('0x3d')]['Contacts'][0x0];}var _0x44b011=_[_0xdf69('0xc')](_0x4f3370['body'],{'firstName':_0x4f3370['body'][_0xdf69('0x3a')],'ListId':_0x3ee7a5['ListId']});_0x44b011[_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x36')]]=_0x4f3370[_0xdf69('0x2d')]['from'];return db['CmContact'][_0xdf69('0x4d')](_0x44b011);}else{throw new Error(_0xdf69('0x4e'));}})[_0xdf69('0x12')](function(_0x45ed01){_0x1101ad[_0xdf69('0x4f')]=_0x45ed01;if(_0x45ed01){if(!_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x50')]){_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['messageId']=rs[_0xdf69('0x51')]()+'\x20'+_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x3a')];}var _0x11ee6c={'ContactId':_0x45ed01['id'],'MailAccountId':_0x4f3370[_0xdf69('0x3b')]['id'],'inReplyTo':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x50')],'to':_0x4f3370['body']['message'][_0xdf69('0x3a')],'cc':_0x4f3370[_0xdf69('0x2d')]['message']['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x53')],'lastMsgAt':moment()['format'](_0xdf69('0x54')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xdf69('0x27')]({'where':{'closed':![],'MailAccountId':_0x4f3370['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xdf69('0x55'),'attributes':[_0xdf69('0x50')],'where':{'messageId':_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x56')]}}]})[_0xdf69('0x12')](function(_0x29e6a3){if(_0x29e6a3){return[_0x29e6a3,![]];}return db[_0xdf69('0x57')][_0xdf69('0x4d')](_0x11ee6c)[_0xdf69('0x12')](function(_0x232a69){return[_0x232a69,!![]];});});}else{throw new Error(_0xdf69('0x58'));}})['spread'](function(_0x5cd512,_0x5a2c39){if(_0x5cd512){_0x5980b1=_0x5a2c39;if(!_0x5a2c39){return _0x5cd512[_0xdf69('0x59')]({'inReplyTo':_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x50')],'to':_0x4f3370['body']['message'][_0xdf69('0x3a')],'cc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x5cd512[_0xdf69('0x53')]?_0x5cd512[_0xdf69('0x53')]:_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x53')],'substatus':null,'substatusAt':moment()[_0xdf69('0x5a')](_0xdf69('0x54')),'lastMsgAt':moment()['format'](_0xdf69('0x54')),'lastMsgDirection':'in'});}else{return _0x5cd512;}}})[_0xdf69('0x12')](function(_0x3914bf){_0x1101ad[_0xdf69('0x5b')]=_0x3914bf[_0xdf69('0x43')]({'plain':!![]});_0x1101ad['interaction']['created']=_0x5980b1;return db['MailMessage']['create']({'body':_0x4f3370['body'][_0xdf69('0x2d')],'MailAccountId':_0x4f3370['account']['id'],'MailInteractionId':_0x3914bf['id'],'direction':'in','ContactId':_0x1101ad['contact']['id'],'messageId':_0x4f3370['body']['message'][_0xdf69('0x50')],'from':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x3a')],'to':_0x4f3370['body'][_0xdf69('0x18')]['to'],'cc':_0x4f3370[_0xdf69('0x2d')]['message']['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x53')],'Attachments':_0x4f3370[_0xdf69('0x2d')]['message'][_0xdf69('0x5c')],'originTo':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5d')],'originCc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5e')],'bcc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5f')],'ChatWebsiteId':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x60')]||null,'originChannel':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x61')]||'Email','ChatOfflineMessageId':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xdf69('0x62')],'as':_0xdf69('0x63')}]});})[_0xdf69('0x12')](function(_0x3aa055){_0x1101ad[_0xdf69('0x18')]=_0x3aa055;if(!_0x1101ad[_0xdf69('0x5b')][_0xdf69('0x64')]){return;}return db[_0xdf69('0x65')]['find']({'attributes':['id','name'],'where':{'id':_0x1101ad['interaction'][_0xdf69('0x64')]}});})[_0xdf69('0x12')](function(_0x4659b5){if(_0x4659b5){_0x1101ad['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4659b5[_0xdf69('0x66')]+','+(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x1101ad['interaction'][_0xdf69('0x68')]){return;}return db[_0xdf69('0x69')][_0xdf69('0x27')]({'attributes':['id',_0xdf69('0x66')],'where':{'id':_0x1101ad['interaction'][_0xdf69('0x68')]}});})[_0xdf69('0x12')](function(_0x5b6a69){if(_0x5b6a69){_0x1101ad['applications'][_0xdf69('0x6a')]({'id':0x0,'priority':0x1,'app':_0xdf69('0x6b'),'appdata':_0x5b6a69['name']+','+(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x6c')]||0x12c),'interval':_0xdf69('0x6d')});}return respondWithRpcPromise('Start',_0xdf69('0x6e'),_0x1101ad);})['then'](function(_0x4ba3a0){_0xdd919d(_0x4ba3a0);})['catch'](function(_0x33f057){_0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0x33f057[_0xdf69('0x18')]));});});}; \ No newline at end of file +var _0x029b=['lodash','moment','randomstring','ioredis','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','then','stringify','find','where','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','list','applications','orderBy','priority','autoclose','close','*,*,*,*','length','create','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','interaction','get','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','unshift','agent','MailQueue','queue','Start','startRouting'];(function(_0x42c3d2,_0x156aa3){var _0x56b0f0=function(_0x163583){while(--_0x163583){_0x42c3d2['push'](_0x42c3d2['shift']());}};_0x56b0f0(++_0x156aa3);}(_0x029b,0x66));var _0xb029=function(_0x2e304c,_0x5aa490){_0x2e304c=_0x2e304c-0x0;var _0x1385b8=_0x029b[_0x2e304c];return _0x1385b8;};'use strict';var _=require(_0xb029('0x0'));var moment=require(_0xb029('0x1'));var BPromise=require('bluebird');var rs=require(_0xb029('0x2'));var Redis=require(_0xb029('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb029('0x4'))(_0xb029('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb029('0x6')][_0xb029('0x7')]({'port':0x232c});config[_0xb029('0x8')]=_[_0xb029('0x9')](config[_0xb029('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb029('0xa'))(new Redis(config['redis']));require(_0xb029('0xb'))['register'](socket);function respondWithRpcPromise(_0x2c3772,_0x5a8bb7,_0x23fee0){return new BPromise(function(_0x4b3036,_0x2696e3){return client[_0xb029('0xc')](_0x2c3772,_0x23fee0)['then'](function(_0x266df5){logger[_0xb029('0xd')](_0xb029('0xe'),_0x5a8bb7,_0xb029('0xf'));logger[_0xb029('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5a8bb7,_0xb029('0xf'),JSON['stringify'](_0x266df5));if(_0x266df5[_0xb029('0x11')]){if(_0x266df5[_0xb029('0x11')][_0xb029('0x12')]===0x1f4){logger[_0xb029('0x11')]('MailAccount,\x20%s,\x20%s',_0x5a8bb7,_0x266df5[_0xb029('0x11')][_0xb029('0x13')]);return _0x2696e3(_0x266df5[_0xb029('0x11')]['message']);}logger[_0xb029('0x11')](_0xb029('0xe'),_0x5a8bb7,_0x266df5[_0xb029('0x11')][_0xb029('0x13')]);return _0x4b3036(_0x266df5[_0xb029('0x11')][_0xb029('0x13')]);}else{logger[_0xb029('0xd')](_0xb029('0xe'),_0x5a8bb7,_0xb029('0xf'));_0x4b3036(_0x266df5['result']['message']);}})[_0xb029('0x14')](function(_0x5373cd){logger[_0xb029('0x11')](_0xb029('0xe'),_0x5a8bb7,_0x5373cd);_0x2696e3(_0x5373cd);});});}exports[_0xb029('0x15')]=function(_0x497ca0){var _0x5e1741=this;return new Promise(function(_0x13ff77,_0x8d3e35){return db[_0xb029('0x16')][_0xb029('0x17')]({'raw':_0x497ca0[_0xb029('0x18')]?_0x497ca0[_0xb029('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x497ca0['options']?_0x497ca0['options']['where']||null:null,'attributes':_0x497ca0[_0xb029('0x18')]?_0x497ca0[_0xb029('0x18')][_0xb029('0x19')]||null:null,'limit':_0x497ca0[_0xb029('0x18')]?_0x497ca0['options'][_0xb029('0x1a')]||null:null,'include':_0x497ca0[_0xb029('0x18')]?_0x497ca0[_0xb029('0x18')][_0xb029('0x1b')]?_[_0xb029('0x1c')](_0x497ca0[_0xb029('0x18')][_0xb029('0x1b')],function(_0x3eb5ac){return{'model':db[_0x3eb5ac[_0xb029('0x1d')]],'as':_0x3eb5ac['as'],'attributes':_0x3eb5ac[_0xb029('0x19')],'include':_0x3eb5ac[_0xb029('0x1b')]?_[_0xb029('0x1c')](_0x3eb5ac[_0xb029('0x1b')],function(_0x599a14){return{'model':db[_0x599a14[_0xb029('0x1d')]],'as':_0x599a14['as'],'attributes':_0x599a14[_0xb029('0x19')],'include':_0x599a14['include']?_['map'](_0x599a14[_0xb029('0x1b')],function(_0x3b030a){return{'model':db[_0x3b030a[_0xb029('0x1d')]],'as':_0x3b030a['as'],'attributes':_0x3b030a[_0xb029('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb029('0x1e')](function(_0x4af2ad){logger[_0xb029('0xd')]('GetMailAccount',_0x497ca0);logger[_0xb029('0x10')](_0xb029('0x15'),_0x497ca0,JSON[_0xb029('0x1f')](_0x4af2ad));_0x13ff77(_0x4af2ad);})['catch'](function(_0x1aa94b){logger[_0xb029('0x11')]('GetMailAccount',_0x1aa94b[_0xb029('0x13')],_0x497ca0);_0x8d3e35(_0x5e1741['error'](0x1f4,_0x1aa94b[_0xb029('0x13')]));});});};exports['ShowMailAccount']=function(_0x88a69b){var _0x3b0bfe=this;return new Promise(function(_0x392d0f,_0x2324f3){return db[_0xb029('0x16')][_0xb029('0x20')]({'raw':_0x88a69b[_0xb029('0x18')]?_0x88a69b[_0xb029('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x88a69b[_0xb029('0x18')]?_0x88a69b[_0xb029('0x18')][_0xb029('0x21')]||null:null,'attributes':_0x88a69b['options']?_0x88a69b[_0xb029('0x18')][_0xb029('0x19')]||null:null,'include':_0x88a69b['options']?_0x88a69b[_0xb029('0x18')]['include']?_[_0xb029('0x1c')](_0x88a69b['options'][_0xb029('0x1b')],function(_0x42f980){return{'model':db[_0x42f980[_0xb029('0x1d')]],'as':_0x42f980['as'],'attributes':_0x42f980[_0xb029('0x19')],'include':_0x42f980[_0xb029('0x1b')]?_[_0xb029('0x1c')](_0x42f980[_0xb029('0x1b')],function(_0x5a1d11){return{'model':db[_0x5a1d11[_0xb029('0x1d')]],'as':_0x5a1d11['as'],'attributes':_0x5a1d11[_0xb029('0x19')],'include':_0x5a1d11['include']?_[_0xb029('0x1c')](_0x5a1d11[_0xb029('0x1b')],function(_0x35105c){return{'model':db[_0x35105c[_0xb029('0x1d')]],'as':_0x35105c['as'],'attributes':_0x35105c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb029('0x1e')](function(_0x3a2547){if(_0x88a69b[_0xb029('0x18')]['smtp']===!![])_0x3a2547[_0xb029('0x22')](_0xb029('0x23'),_0x3a2547[_0xb029('0x24')]());logger[_0xb029('0xd')](_0xb029('0x25'),_0x88a69b);logger[_0xb029('0x10')](_0xb029('0x25'),_0x88a69b,JSON[_0xb029('0x1f')](_0x3a2547));_0x392d0f(_0x3a2547);})[_0xb029('0x14')](function(_0x1392af){logger['error'](_0xb029('0x25'),_0x1392af[_0xb029('0x13')],_0x88a69b);_0x2324f3(_0x3b0bfe[_0xb029('0x11')](0x1f4,_0x1392af['message']));});});};exports['NotifyMailAccount']=function(_0x521b20){var _0x31477a=this;return new Promise(function(_0x41a857,_0x5c7082){var _0x1a7285={'body':_0x521b20[_0xb029('0x26')],'channel':_0xb029('0x27')};var _0x3bc456=_[_0xb029('0x28')](_['keys'](db[_0xb029('0x29')][_0xb029('0x2a')]),['createdAt',_0xb029('0x2b'),_0xb029('0x2c'),_0xb029('0x2d')]);var _0x56a470=![];if(_0x521b20[_0xb029('0x26')]['id']){delete _0x521b20[_0xb029('0x26')]['id'];}if(_['isNil'](_0x521b20['body'][_0xb029('0x2e')])){return _0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,_0xb029('0x2f')));}if(_[_0xb029('0x30')](_0x521b20['body']['body'])||_0x521b20[_0xb029('0x26')]['body']===''){return _0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xb029('0x30')](_0x521b20[_0xb029('0x26')][_0xb029('0x31')])){return _0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,_0xb029('0x32')+_0x3bc456));}if(!_[_0xb029('0x33')](_0x3bc456,_0x521b20['body'][_0xb029('0x31')])){return _0x5c7082(_0x31477a['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3bc456));}var _0x2dde2e={};_0x2dde2e[_0x521b20['body'][_0xb029('0x31')]]=_0x521b20['body'][_0xb029('0x2e')];return db[_0xb029('0x16')][_0xb029('0x20')]({'where':{'id':_0x521b20[_0xb029('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xb029('0x35'),'include':[{'model':db[_0xb029('0x29')],'as':_0xb029('0x36'),'where':_0x2dde2e,'limit':0x1,'order':[[_0xb029('0x2b'),_0xb029('0x37')]]}]},{'model':db[_0xb029('0x38')],'as':_0xb029('0x39')},{'model':db[_0xb029('0x3a')],'as':_0xb029('0x3b'),'include':[{'model':db[_0xb029('0x3c')],'as':'CloudProvider'}]}]})[_0xb029('0x1e')](function(_0x2345cd){if(_0x2345cd&&_0x2345cd[_0xb029('0x35')]){var _0x3172a2=_0x2345cd['get']({'plain':!![]});_0x1a7285[_0xb029('0x34')]=_['omit'](_0x3172a2,[_0xb029('0x39'),_0xb029('0x35')]);_0x1a7285[_0xb029('0x34')][_0xb029('0x23')]=_0x2345cd[_0xb029('0x24')]();_0x1a7285['applications']=_0x3172a2['Applications'];_0x1a7285[_0xb029('0x3d')]=_0x3172a2[_0xb029('0x35')];_0x1a7285[_0xb029('0x3e')]=_[_0xb029('0x3f')](_0x1a7285[_0xb029('0x3e')],[_0xb029('0x40')],['asc']);if(_0x1a7285[_0xb029('0x34')]&&_0x1a7285[_0xb029('0x34')][_0xb029('0x41')]){_0x1a7285['applications']['push']({'id':0x0,'priority':_0x1a7285[_0xb029('0x3e')]['length']+0x1,'app':_0xb029('0x42'),'appdata':_0xb029('0x41'),'interval':_0xb029('0x43')});}if(_0x1a7285['account'][_0xb029('0x39')]){delete _0x1a7285[_0xb029('0x34')]['Applications'];}if(_0x1a7285[_0xb029('0x34')][_0xb029('0x35')]){delete _0x1a7285[_0xb029('0x34')]['List'];}if(_0x3172a2[_0xb029('0x35')][_0xb029('0x36')][_0xb029('0x44')]){return _0x3172a2[_0xb029('0x35')]['Contacts'][0x0];}var _0x3cbbfe=_[_0xb029('0x9')](_0x521b20[_0xb029('0x26')],{'firstName':_0x521b20['body'][_0xb029('0x2e')],'ListId':_0x3172a2['ListId']});_0x3cbbfe[_0x521b20[_0xb029('0x26')][_0xb029('0x31')]]=_0x521b20[_0xb029('0x26')][_0xb029('0x2e')];return db[_0xb029('0x29')][_0xb029('0x45')](_0x3cbbfe);}else{throw new Error(_0xb029('0x46'));}})['then'](function(_0x4f41ad){_0x1a7285['contact']=_0x4f41ad;if(_0x4f41ad){if(!_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x47')]){_0x521b20[_0xb029('0x26')][_0xb029('0x13')]['messageId']=rs[_0xb029('0x48')]()+'\x20'+_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x2e')];}var _0x5b7c6d={'ContactId':_0x4f41ad['id'],'MailAccountId':_0x521b20[_0xb029('0x34')]['id'],'inReplyTo':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x47')],'to':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x2e')],'cc':_0x521b20[_0xb029('0x26')]['message']['cc'],'subject':_0x521b20[_0xb029('0x26')][_0xb029('0x13')]['subject'],'attach':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x49')],'lastMsgAt':moment()[_0xb029('0x4a')](_0xb029('0x4b')),'lastMsgDirection':'in'};return db[_0xb029('0x4c')][_0xb029('0x20')]({'where':{'closed':![],'MailAccountId':_0x521b20[_0xb029('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xb029('0x4d'),'attributes':['messageId'],'where':{'messageId':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x4e')]}}]})['then'](function(_0xd82930){if(_0xd82930){return[_0xd82930,![]];}return db[_0xb029('0x4c')]['create'](_0x5b7c6d)['then'](function(_0x5792a1){return[_0x5792a1,!![]];});});}else{throw new Error(_0xb029('0x4f'));}})['spread'](function(_0x3d8ff6,_0x5419d5){if(_0x3d8ff6){_0x56a470=_0x5419d5;if(!_0x5419d5){return _0x3d8ff6['update']({'inReplyTo':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x47')],'to':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x2e')],'cc':_0x521b20[_0xb029('0x26')]['message']['cc'],'subject':_0x521b20[_0xb029('0x26')][_0xb029('0x13')]['subject'],'attach':_0x3d8ff6[_0xb029('0x49')]?_0x3d8ff6[_0xb029('0x49')]:_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x49')],'substatus':null,'substatusAt':moment()[_0xb029('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xb029('0x4a')](_0xb029('0x4b')),'lastMsgDirection':'in'});}else{return _0x3d8ff6;}}})['then'](function(_0x227bfd){_0x1a7285[_0xb029('0x50')]=_0x227bfd[_0xb029('0x51')]({'plain':!![]});_0x1a7285[_0xb029('0x50')][_0xb029('0x52')]=_0x56a470;return db['MailMessage'][_0xb029('0x45')]({'body':_0x521b20['body']['body'],'MailAccountId':_0x521b20[_0xb029('0x34')]['id'],'MailInteractionId':_0x227bfd['id'],'direction':'in','ContactId':_0x1a7285[_0xb029('0x53')]['id'],'messageId':_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x47')],'from':_0x521b20[_0xb029('0x26')]['message']['from'],'to':_0x521b20[_0xb029('0x26')]['message']['to'],'cc':_0x521b20[_0xb029('0x26')]['message']['cc'],'subject':_0x521b20['body'][_0xb029('0x13')]['subject'],'attach':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x49')],'Attachments':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x54')],'originTo':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x55')],'originCc':_0x521b20['body'][_0xb029('0x13')][_0xb029('0x56')],'bcc':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x57')],'ChatWebsiteId':_0x521b20[_0xb029('0x26')][_0xb029('0x13')][_0xb029('0x58')]||null,'originChannel':_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x59')]||_0xb029('0x5a'),'ChatOfflineMessageId':_0x521b20[_0xb029('0x26')]['message'][_0xb029('0x5b')]||null},{'include':[{'model':db[_0xb029('0x5c')],'as':_0xb029('0x5d')}]});})[_0xb029('0x1e')](function(_0x133e8c){_0x1a7285[_0xb029('0x13')]=_0x133e8c;if(!_0x1a7285[_0xb029('0x50')]['UserId']){return;}return db[_0xb029('0x5e')]['find']({'attributes':['id',_0xb029('0x5f')],'where':{'id':_0x1a7285[_0xb029('0x50')]['UserId']}});})[_0xb029('0x1e')](function(_0x493c86){if(_0x493c86){_0x1a7285['applications'][_0xb029('0x60')]({'id':0x0,'priority':0x0,'app':_0xb029('0x61'),'appdata':_0x493c86[_0xb029('0x5f')]+','+(_0x1a7285[_0xb029('0x34')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x1a7285[_0xb029('0x50')]['queueId']){return;}return db[_0xb029('0x62')][_0xb029('0x20')]({'attributes':['id',_0xb029('0x5f')],'where':{'id':_0x1a7285[_0xb029('0x50')]['queueId']}});})[_0xb029('0x1e')](function(_0x5849c9){if(_0x5849c9){_0x1a7285['applications'][_0xb029('0x60')]({'id':0x0,'priority':0x1,'app':_0xb029('0x63'),'appdata':_0x5849c9[_0xb029('0x5f')]+','+(_0x1a7285[_0xb029('0x34')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb029('0x64'),_0xb029('0x65'),_0x1a7285);})[_0xb029('0x1e')](function(_0xc0111b){_0x41a857(_0xc0111b);})[_0xb029('0x14')](function(_0x4969af){_0x5c7082(_0x31477a[_0xb029('0x11')](0x1f4,_0x4969af[_0xb029('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index b4045fd..71b06d5 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 _0x6659=['emit','removeListener','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x109011,_0x2fc2e6){var _0x26b1d4=function(_0x45b220){while(--_0x45b220){_0x109011['push'](_0x109011['shift']());}};_0x26b1d4(++_0x2fc2e6);}(_0x6659,0x16c));var _0x9665=function(_0x1973a2,_0x345a86){_0x1973a2=_0x1973a2-0x0;var _0x23067c=_0x6659[_0x1973a2];return _0x23067c;};'use strict';var MailAccountEvents=require(_0x9665('0x0'));var events=[_0x9665('0x1'),_0x9665('0x2'),_0x9665('0x3')];function createListener(_0x35bca0,_0x5b3aa1){return function(_0x274011){_0x5b3aa1[_0x9665('0x4')](_0x35bca0,_0x274011);};}function removeListener(_0x82d8ca,_0x4154da){return function(){MailAccountEvents[_0x9665('0x5')](_0x82d8ca,_0x4154da);};}exports['register']=function(_0x2c7276){for(var _0x27ddc8=0x0,_0x1d7ad2=events[_0x9665('0x6')];_0x27ddc8<_0x1d7ad2;_0x27ddc8++){var _0x3262b8=events[_0x27ddc8];var _0x4b46ca=createListener(_0x9665('0x7')+_0x3262b8,_0x2c7276);MailAccountEvents['on'](_0x3262b8,_0x4b46ca);}}; \ No newline at end of file +var _0x5d72=['remove','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x3e29df,_0x42fdf8){var _0x3e3ba9=function(_0x47ccb0){while(--_0x47ccb0){_0x3e29df['push'](_0x3e29df['shift']());}};_0x3e3ba9(++_0x42fdf8);}(_0x5d72,0x7c));var _0x25d7=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0x5d72[_0x2649e2];return _0x4797d4;};'use strict';var MailAccountEvents=require(_0x25d7('0x0'));var events=[_0x25d7('0x1'),_0x25d7('0x2'),'update'];function createListener(_0x2bf814,_0x5e716b){return function(_0x2af5a9){_0x5e716b['emit'](_0x2bf814,_0x2af5a9);};}function removeListener(_0x512ace,_0x52b98b){return function(){MailAccountEvents[_0x25d7('0x3')](_0x512ace,_0x52b98b);};}exports[_0x25d7('0x4')]=function(_0x29619f){for(var _0x1034ab=0x0,_0x14aa9f=events[_0x25d7('0x5')];_0x1034ab<_0x14aa9f;_0x1034ab++){var _0x5e1f69=events[_0x1034ab];var _0x26ae21=createListener(_0x25d7('0x6')+_0x5e1f69,_0x29619f);MailAccountEvents['on'](_0x5e1f69,_0x26ae21);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9e4e0c9..1859b9d 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 _0x606c=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer'];(function(_0x53a00d,_0x462437){var _0x28b7f6=function(_0x4f6ef3){while(--_0x4f6ef3){_0x53a00d['push'](_0x53a00d['shift']());}};_0x28b7f6(++_0x462437);}(_0x606c,0x17b));var _0xc606=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0x606c[_0x4c06a3];return _0x7ff53c;};'use strict';var multer=require(_0xc606('0x0'));var util=require(_0xc606('0x1'));var path=require(_0xc606('0x2'));var timeout=require('connect-timeout');var express=require(_0xc606('0x3'));var router=express[_0xc606('0x4')]();var fs_extra=require(_0xc606('0x5'));var auth=require(_0xc606('0x6'));var interaction=require(_0xc606('0x7'));var config=require(_0xc606('0x8'));var controller=require(_0xc606('0x9'));router[_0xc606('0xa')](_0xc606('0xb'),auth[_0xc606('0xc')](),controller[_0xc606('0xd')]);router[_0xc606('0xe')](_0xc606('0xb'),auth[_0xc606('0xc')](),controller[_0xc606('0xf')]);router[_0xc606('0x10')](_0xc606('0xb'),auth[_0xc606('0xc')](),controller[_0xc606('0x11')]);module[_0xc606('0x12')]=router; \ No newline at end of file +var _0xa248=['../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa248,0x172));var _0x8a24=function(_0x3a25e1,_0x5896c3){_0x3a25e1=_0x3a25e1-0x0;var _0x14a25b=_0xa248[_0x3a25e1];return _0x14a25b;};'use strict';var multer=require(_0x8a24('0x0'));var util=require(_0x8a24('0x1'));var path=require(_0x8a24('0x2'));var timeout=require(_0x8a24('0x3'));var express=require(_0x8a24('0x4'));var router=express[_0x8a24('0x5')]();var fs_extra=require(_0x8a24('0x6'));var auth=require(_0x8a24('0x7'));var interaction=require(_0x8a24('0x8'));var config=require(_0x8a24('0x9'));var controller=require(_0x8a24('0xa'));router['get'](_0x8a24('0xb'),auth[_0x8a24('0xc')](),controller[_0x8a24('0xd')]);router[_0x8a24('0xe')]('/:id',auth[_0x8a24('0xc')](),controller[_0x8a24('0xf')]);router[_0x8a24('0x10')]('/:id',auth[_0x8a24('0xc')](),controller['destroy']);module[_0x8a24('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 5cf3ca3..a3d1809 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 _0x37c6=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0x10b967,_0xb32c4d){var _0x264da2=function(_0x1a7212){while(--_0x1a7212){_0x10b967['push'](_0x10b967['shift']());}};_0x264da2(++_0xb32c4d);}(_0x37c6,0x69));var _0x637c=function(_0x58ad47,_0x6cd0e8){_0x58ad47=_0x58ad47-0x0;var _0x16eee0=_0x37c6[_0x58ad47];return _0x16eee0;};'use strict';var Sequelize=require(_0x637c('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x637c('0x1')],'allowNull':![],'defaultValue':_0x637c('0x2')},'appdata':{'type':Sequelize[_0x637c('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x637c('0x1')],'defaultValue':_0x637c('0x4')}}; \ No newline at end of file +var _0x0746=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x0746,0x173));var _0x6074=function(_0x54883f,_0x3f7c3a){_0x54883f=_0x54883f-0x0;var _0x3dfb29=_0x0746[_0x54883f];return _0x3dfb29;};'use strict';var Sequelize=require('sequelize');module[_0x6074('0x0')]={'priority':{'type':Sequelize[_0x6074('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6074('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6074('0x3')]()},'description':{'type':Sequelize[_0x6074('0x2')]},'interval':{'type':Sequelize[_0x6074('0x2')],'defaultValue':_0x6074('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c5371b5..fdb18c5 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 _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x4959fd,_0x186515){var _0x97de01=function(_0x29e1d0){while(--_0x29e1d0){_0x4959fd['push'](_0x4959fd['shift']());}};_0x97de01(++_0x186515);}(_0xe706,0xa3));var _0x6e70=function(_0x4da196,_0x357dc9){_0x4da196=_0x4da196-0x0;var _0x375df3=_0xe706[_0x4da196];return _0x375df3;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x2caae5,_0x23acda){var _0x5e1f96=function(_0x218bbf){while(--_0x218bbf){_0x2caae5['push'](_0x2caae5['shift']());}};_0x5e1f96(++_0x23acda);}(_0x70e0,0x17b));var _0x070e=function(_0x2c20dc,_0x303703){_0x2c20dc=_0x2c20dc-0x0;var _0x1de700=_0x70e0[_0x2c20dc];return _0x1de700;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 79062a8..62e7d86 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 _0x206d=['MailApplication','utf8mb4','lodash','api','moment','bluebird','request-promise','path','exports','define'];(function(_0x406b67,_0x40dd13){var _0x46b09b=function(_0x22ba61){while(--_0x22ba61){_0x406b67['push'](_0x406b67['shift']());}};_0x46b09b(++_0x40dd13);}(_0x206d,0x110));var _0xd206=function(_0xc5ad2b,_0x5d7243){_0xc5ad2b=_0xc5ad2b-0x0;var _0x3587f4=_0x206d[_0xc5ad2b];return _0x3587f4;};'use strict';var _=require(_0xd206('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd206('0x1'));var moment=require(_0xd206('0x2'));var BPromise=require(_0xd206('0x3'));var rp=require(_0xd206('0x4'));var fs=require('fs');var path=require(_0xd206('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xd206('0x6')]=function(_0x278b55,_0x279969){return _0x278b55[_0xd206('0x7')](_0xd206('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd206('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4296=['mail_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf','./mailApplication.attributes','exports','MailApplication'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4296,0x70));var _0x6429=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x4296[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x6429('0x0'));var logger=require('../../config/logger')(_0x6429('0x1'));var moment=require(_0x6429('0x2'));var BPromise=require(_0x6429('0x3'));var rp=require(_0x6429('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6429('0x5'));var config=require('../../config/environment');var attributes=require(_0x6429('0x6'));module[_0x6429('0x7')]=function(_0x397b46,_0x8d2b6b){return _0x397b46['define'](_0x6429('0x8'),attributes,{'tableName':_0x6429('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6429('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7128b46..49b86fa 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 _0xb67b=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x276559,_0x545d71){var _0x47f8ab=function(_0x4df9fe){while(--_0x4df9fe){_0x276559['push'](_0x276559['shift']());}};_0x47f8ab(++_0x545d71);}(_0xb67b,0x1f3));var _0xbb67=function(_0x37f6d8,_0x444925){_0x37f6d8=_0x37f6d8-0x0;var _0x49f67b=_0xb67b[_0x37f6d8];return _0x49f67b;};'use strict';var _=require(_0xbb67('0x0'));var util=require('util');var moment=require(_0xbb67('0x1'));var BPromise=require(_0xbb67('0x2'));var rs=require(_0xbb67('0x3'));var fs=require('fs');var Redis=require(_0xbb67('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb67('0x5'));var logger=require(_0xbb67('0x6'))(_0xbb67('0x7'));var config=require(_0xbb67('0x8'));var jayson=require(_0xbb67('0x9'));var client=jayson[_0xbb67('0xa')][_0xbb67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56ff14,_0x352fae,_0x24ac3d){return new BPromise(function(_0x57d582,_0x4912e4){return client[_0xbb67('0xc')](_0x56ff14,_0x24ac3d)[_0xbb67('0xd')](function(_0x30f2f7){logger[_0xbb67('0xe')](_0xbb67('0xf'),_0x352fae,_0xbb67('0x10'));logger[_0xbb67('0x11')](_0xbb67('0x12'),_0x352fae,_0xbb67('0x10'),JSON[_0xbb67('0x13')](_0x30f2f7));if(_0x30f2f7['error']){if(_0x30f2f7[_0xbb67('0x14')][_0xbb67('0x15')]===0x1f4){logger[_0xbb67('0x14')](_0xbb67('0xf'),_0x352fae,_0x30f2f7[_0xbb67('0x14')][_0xbb67('0x16')]);return _0x4912e4(_0x30f2f7[_0xbb67('0x14')]['message']);}logger['error']('MailApplication,\x20%s,\x20%s',_0x352fae,_0x30f2f7[_0xbb67('0x14')]['message']);return _0x57d582(_0x30f2f7[_0xbb67('0x14')][_0xbb67('0x16')]);}else{logger[_0xbb67('0xe')](_0xbb67('0xf'),_0x352fae,'request\x20sent');_0x57d582(_0x30f2f7[_0xbb67('0x17')]['message']);}})['catch'](function(_0x4b4273){logger[_0xbb67('0x14')](_0xbb67('0xf'),_0x352fae,_0x4b4273);_0x4912e4(_0x4b4273);});});}exports[_0xbb67('0x18')]=function(_0x4ff1f3){var _0x3161f6=this;return new Promise(function(_0x4eaa7d,_0x52aaa0){return db[_0xbb67('0x19')]['update'](_0x4ff1f3[_0xbb67('0x1a')],{'raw':_0x4ff1f3[_0xbb67('0x1b')]?_0x4ff1f3[_0xbb67('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ff1f3['options']?_0x4ff1f3['options'][_0xbb67('0x1c')]||null:null,'attributes':_0x4ff1f3[_0xbb67('0x1b')]?_0x4ff1f3['options'][_0xbb67('0x1d')]||null:null,'limit':_0x4ff1f3[_0xbb67('0x1b')]?_0x4ff1f3[_0xbb67('0x1b')][_0xbb67('0x1e')]||null:null})[_0xbb67('0xd')](function(_0xc9762d){logger[_0xbb67('0xe')](_0xbb67('0x18'),_0x4ff1f3);logger[_0xbb67('0x11')](_0xbb67('0x18'),_0x4ff1f3,JSON[_0xbb67('0x13')](_0xc9762d));_0x4eaa7d(_0xc9762d);})[_0xbb67('0x1f')](function(_0x14dcf7){logger[_0xbb67('0x14')]('UpdateMailApplication',_0x14dcf7[_0xbb67('0x16')],_0x4ff1f3);_0x52aaa0(_0x3161f6[_0xbb67('0x14')](0x1f4,_0x14dcf7[_0xbb67('0x16')]));});});}; \ No newline at end of file +var _0xed22=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2293da,_0x3a3686){var _0x11c5cd=function(_0x3e43f0){while(--_0x3e43f0){_0x2293da['push'](_0x2293da['shift']());}};_0x11c5cd(++_0x3a3686);}(_0xed22,0x101));var _0x2ed2=function(_0x501078,_0x5bb1e9){_0x501078=_0x501078-0x0;var _0x18eaac=_0xed22[_0x501078];return _0x18eaac;};'use strict';var _=require('lodash');var util=require(_0x2ed2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2ed2('0x1'));var fs=require('fs');var Redis=require(_0x2ed2('0x2'));var db=require(_0x2ed2('0x3'))['db'];var utils=require(_0x2ed2('0x4'));var logger=require(_0x2ed2('0x5'))(_0x2ed2('0x6'));var config=require(_0x2ed2('0x7'));var jayson=require(_0x2ed2('0x8'));var client=jayson[_0x2ed2('0x9')][_0x2ed2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd6db37,_0xd7eb08,_0x2fb359){return new BPromise(function(_0x2becf6,_0x1d0d9a){return client[_0x2ed2('0xb')](_0xd6db37,_0x2fb359)[_0x2ed2('0xc')](function(_0x69125d){logger['info'](_0x2ed2('0xd'),_0xd7eb08,_0x2ed2('0xe'));logger[_0x2ed2('0xf')](_0x2ed2('0x10'),_0xd7eb08,'request\x20sent',JSON[_0x2ed2('0x11')](_0x69125d));if(_0x69125d[_0x2ed2('0x12')]){if(_0x69125d[_0x2ed2('0x12')]['code']===0x1f4){logger[_0x2ed2('0x12')](_0x2ed2('0xd'),_0xd7eb08,_0x69125d[_0x2ed2('0x12')][_0x2ed2('0x13')]);return _0x1d0d9a(_0x69125d[_0x2ed2('0x12')][_0x2ed2('0x13')]);}logger[_0x2ed2('0x12')](_0x2ed2('0xd'),_0xd7eb08,_0x69125d['error'][_0x2ed2('0x13')]);return _0x2becf6(_0x69125d[_0x2ed2('0x12')][_0x2ed2('0x13')]);}else{logger[_0x2ed2('0x14')](_0x2ed2('0xd'),_0xd7eb08,_0x2ed2('0xe'));_0x2becf6(_0x69125d[_0x2ed2('0x15')][_0x2ed2('0x13')]);}})[_0x2ed2('0x16')](function(_0x1b7a9f){logger[_0x2ed2('0x12')](_0x2ed2('0xd'),_0xd7eb08,_0x1b7a9f);_0x1d0d9a(_0x1b7a9f);});});}exports[_0x2ed2('0x17')]=function(_0x1b5456){var _0x446644=this;return new Promise(function(_0x43e81e,_0x1d0471){return db[_0x2ed2('0x18')]['update'](_0x1b5456[_0x2ed2('0x19')],{'raw':_0x1b5456[_0x2ed2('0x1a')]?_0x1b5456['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5456[_0x2ed2('0x1a')]?_0x1b5456[_0x2ed2('0x1a')][_0x2ed2('0x1b')]||null:null,'attributes':_0x1b5456['options']?_0x1b5456[_0x2ed2('0x1a')][_0x2ed2('0x1c')]||null:null,'limit':_0x1b5456[_0x2ed2('0x1a')]?_0x1b5456['options'][_0x2ed2('0x1d')]||null:null})[_0x2ed2('0xc')](function(_0x4c0be7){logger[_0x2ed2('0x14')]('UpdateMailApplication',_0x1b5456);logger[_0x2ed2('0xf')](_0x2ed2('0x17'),_0x1b5456,JSON[_0x2ed2('0x11')](_0x4c0be7));_0x43e81e(_0x4c0be7);})[_0x2ed2('0x16')](function(_0x487978){logger['error'](_0x2ed2('0x17'),_0x487978['message'],_0x1b5456);_0x1d0471(_0x446644[_0x2ed2('0x12')](0x1f4,_0x487978[_0x2ed2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index f10710e..5dce772 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 _0xf70e=['addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','mailinteraction:destroy','destroy','delete','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x4c2c33,_0x4408e5){var _0x581e5e=function(_0x1dd9bc){while(--_0x1dd9bc){_0x4c2c33['push'](_0x4c2c33['shift']());}};_0x581e5e(++_0x4408e5);}(_0xf70e,0x174));var _0xef70=function(_0xdc7170,_0x571276){_0xdc7170=_0xdc7170-0x0;var _0x9e8216=_0xf70e[_0xdc7170];return _0x9e8216;};'use strict';var express=require(_0xef70('0x0'));var router=express[_0xef70('0x1')]();var auth=require(_0xef70('0x2'));var interaction=require(_0xef70('0x3'));var controller=require(_0xef70('0x4'));router[_0xef70('0x5')]('/',auth[_0xef70('0x6')](),controller[_0xef70('0x7')]);router[_0xef70('0x5')](_0xef70('0x8'),auth[_0xef70('0x6')](),controller[_0xef70('0x9')]);router[_0xef70('0x5')](_0xef70('0xa'),auth[_0xef70('0x6')](),controller[_0xef70('0xb')]);router[_0xef70('0x5')](_0xef70('0xc'),auth[_0xef70('0x6')](),controller[_0xef70('0xd')]);router[_0xef70('0x5')](_0xef70('0xe'),auth[_0xef70('0x6')](),controller[_0xef70('0xf')]);router[_0xef70('0x10')]('/',auth[_0xef70('0x6')](),controller[_0xef70('0x11')]);router[_0xef70('0x10')](_0xef70('0xc'),auth['isAuthenticated'](),controller[_0xef70('0x12')]);router['post'](_0xef70('0x13'),auth[_0xef70('0x6')](),interaction[_0xef70('0x14')](_0xef70('0x15'),_0xef70('0x16')),controller[_0xef70('0x17')]);router['put']('/:id',auth[_0xef70('0x6')](),interaction[_0xef70('0x14')]('mail',_0xef70('0x18')),controller['update']);router['delete'](_0xef70('0xa'),auth[_0xef70('0x6')](),interaction[_0xef70('0x14')](_0xef70('0x15'),_0xef70('0x19')),controller[_0xef70('0x1a')]);router[_0xef70('0x1b')](_0xef70('0x13'),auth[_0xef70('0x6')](),controller[_0xef70('0x1c')]);module[_0xef70('0x1d')]=router; \ No newline at end of file +var _0x9bbe=['addTags','put','/:id','tracked','mail','update','mailinteraction:destroy','delete','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mailinteraction:addtags'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x9bbe,0x64));var _0xe9bb=function(_0x341abd,_0x3cf12a){_0x341abd=_0x341abd-0x0;var _0x1db3aa=_0x9bbe[_0x341abd];return _0x1db3aa;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xe9bb('0x0'));var interaction=require(_0xe9bb('0x1'));var controller=require('./mailInteraction.controller');router[_0xe9bb('0x2')]('/',auth[_0xe9bb('0x3')](),controller['index']);router[_0xe9bb('0x2')](_0xe9bb('0x4'),auth[_0xe9bb('0x3')](),controller['describe']);router['get']('/:id',auth[_0xe9bb('0x3')](),controller[_0xe9bb('0x5')]);router[_0xe9bb('0x2')](_0xe9bb('0x6'),auth[_0xe9bb('0x3')](),controller[_0xe9bb('0x7')]);router[_0xe9bb('0x2')](_0xe9bb('0x8'),auth[_0xe9bb('0x3')](),controller[_0xe9bb('0x9')]);router[_0xe9bb('0xa')]('/',auth[_0xe9bb('0x3')](),controller[_0xe9bb('0xb')]);router['post']('/:id/messages',auth[_0xe9bb('0x3')](),controller[_0xe9bb('0xc')]);router[_0xe9bb('0xa')](_0xe9bb('0xd'),auth[_0xe9bb('0x3')](),interaction['tracked']('mail',_0xe9bb('0xe')),controller[_0xe9bb('0xf')]);router[_0xe9bb('0x10')](_0xe9bb('0x11'),auth[_0xe9bb('0x3')](),interaction[_0xe9bb('0x12')](_0xe9bb('0x13'),'mailinteraction:update'),controller[_0xe9bb('0x14')]);router['delete'](_0xe9bb('0x11'),auth['isAuthenticated'](),interaction[_0xe9bb('0x12')](_0xe9bb('0x13'),_0xe9bb('0x15')),controller['destroy']);router[_0xe9bb('0x16')]('/:id/tags',auth[_0xe9bb('0x3')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 383365a..d81f3ca 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 _0xa681=['sequelize','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','INTEGER'];(function(_0x3bcb39,_0x2e1bd0){var _0x158bc4=function(_0x5570d3){while(--_0x5570d3){_0x3bcb39['push'](_0x3bcb39['shift']());}};_0x158bc4(++_0x2e1bd0);}(_0xa681,0x75));var _0x1a68=function(_0xd9d868,_0x441fe1){_0xd9d868=_0xd9d868-0x0;var _0x3e9b89=_0xa681[_0xd9d868];return _0x3e9b89;};'use strict';var Sequelize=require(_0x1a68('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x1a68('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1a68('0x2')]},'disposition':{'type':Sequelize[_0x1a68('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1a68('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x1a68('0x3')](0x1fe)},'to':{'type':Sequelize[_0x1a68('0x3')]},'cc':{'type':Sequelize[_0x1a68('0x4')](_0x1a68('0x5'))},'subject':{'type':Sequelize[_0x1a68('0x4')]()},'attach':{'type':Sequelize[_0x1a68('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1a68('0x2')]},'substatus':{'type':Sequelize[_0x1a68('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x1a68('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1a68('0x6')]('in',_0x1a68('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1a68('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1a68('0x8')]}}; \ No newline at end of file +var _0xc615=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x3e0a2c,_0x351c1f){var _0x3f13ff=function(_0x246a1d){while(--_0x246a1d){_0x3e0a2c['push'](_0x3e0a2c['shift']());}};_0x3f13ff(++_0x351c1f);}(_0xc615,0x1dc));var _0x5c61=function(_0x4ac24c,_0x2791b9){_0x4ac24c=_0x4ac24c-0x0;var _0x3961b0=_0xc615[_0x4ac24c];return _0x3961b0;};'use strict';var Sequelize=require(_0x5c61('0x0'));var iconv=require(_0x5c61('0x1'));module[_0x5c61('0x2')]={'closed':{'type':Sequelize[_0x5c61('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5c61('0x4')]},'disposition':{'type':Sequelize[_0x5c61('0x5')]},'secondDisposition':{'type':Sequelize[_0x5c61('0x5')]},'thirdDisposition':{'type':Sequelize[_0x5c61('0x5')]},'note':{'type':Sequelize[_0x5c61('0x5')]},'inReplyTo':{'type':Sequelize[_0x5c61('0x5')](0x1fe)},'to':{'type':Sequelize[_0x5c61('0x5')]},'cc':{'type':Sequelize[_0x5c61('0x6')](_0x5c61('0x7'))},'subject':{'type':Sequelize[_0x5c61('0x6')]()},'attach':{'type':Sequelize[_0x5c61('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5c61('0x4')]},'substatus':{'type':Sequelize[_0x5c61('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x5c61('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5c61('0x8')]('in',_0x5c61('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5c61('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index dfeecfe..01e502a 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 _0xefb1=['path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','offset','count','set','update','destroy','then','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','describe','addMessage','MailMessage','params','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','pick','MailInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','emit','removeTags','unix','toString','root','server','files','tmp','join','format','transcript-%d-%s.zip','attachments','push','Attachment','Messages','from','bcc','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util'];(function(_0x21267d,_0x18c6f5){var _0x679d4c=function(_0x7f1e92){while(--_0x7f1e92){_0x21267d['push'](_0x21267d['shift']());}};_0x679d4c(++_0x18c6f5);}(_0xefb1,0xe2));var _0x1efb=function(_0x35d8b5,_0x51500f){_0x35d8b5=_0x35d8b5-0x0;var _0x50c046=_0xefb1[_0x35d8b5];return _0x50c046;};'use strict';var emlformat=require(_0x1efb('0x0'));var rimraf=require(_0x1efb('0x1'));var zipdir=require(_0x1efb('0x2'));var moment=require(_0x1efb('0x3'));var BPromise=require(_0x1efb('0x4'));var util=require(_0x1efb('0x5'));var path=require(_0x1efb('0x6'));var fs=require('fs');var _=require(_0x1efb('0x7'));var juice=require(_0x1efb('0x8'));var Redis=require(_0x1efb('0x9'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x1efb('0xa'))(_0x1efb('0xb'));var config=require(_0x1efb('0xc'));var db=require(_0x1efb('0xd'))['db'];var htmlEntities=require(_0x1efb('0xe'));config[_0x1efb('0xf')]=_[_0x1efb('0x10')](config[_0x1efb('0xf')],{'host':_0x1efb('0x11'),'port':0x18eb});var socket=require(_0x1efb('0x12'))(new Redis(config[_0x1efb('0xf')]));require('./mailInteraction.socket')[_0x1efb('0x13')](socket);function respondWithStatusCode(_0x5ddd5c,_0x10b3de){_0x10b3de=_0x10b3de||0xcc;return function(_0x11d57a){if(_0x11d57a){return _0x5ddd5c[_0x1efb('0x14')](_0x10b3de);}return _0x5ddd5c[_0x1efb('0x15')](_0x10b3de)['end']();};}function respondWithResult(_0x5c6cde,_0x1abf9b){_0x1abf9b=_0x1abf9b||0xc8;return function(_0x401ca5){if(_0x401ca5){return _0x5c6cde[_0x1efb('0x15')](_0x1abf9b)[_0x1efb('0x16')](_0x401ca5);}};}function respondWithFilteredResult(_0x46b465,_0x27868f){return function(_0x548c1d){if(_0x548c1d){var _0x35350c=typeof _0x27868f['offset']===_0x1efb('0x17')&&typeof _0x27868f[_0x1efb('0x18')]==='undefined';var _0x19ec4e=_0x548c1d['count'];var _0x18f166=_0x35350c?0x0:_0x27868f[_0x1efb('0x19')];var _0x422753=_0x35350c?_0x548c1d[_0x1efb('0x1a')]:_0x27868f[_0x1efb('0x19')]+_0x27868f[_0x1efb('0x18')];var _0x2336d1;if(_0x422753>=_0x19ec4e){_0x422753=_0x19ec4e;_0x2336d1=0xc8;}else{_0x2336d1=0xce;}_0x46b465[_0x1efb('0x15')](_0x2336d1);return _0x46b465[_0x1efb('0x1b')]('Content-Range',_0x18f166+'-'+_0x422753+'/'+_0x19ec4e)[_0x1efb('0x16')](_0x548c1d);}return null;};}function saveUpdates(_0x53af97){return function(_0x578e52){if(_0x578e52){return _0x578e52[_0x1efb('0x1c')](_0x53af97)['then'](function(_0x3e01da){return _0x3e01da;});}return null;};}function removeEntity(_0x3c7dd0){return function(_0x53fc10){if(_0x53fc10){return _0x53fc10[_0x1efb('0x1d')]()[_0x1efb('0x1e')](function(){_0x3c7dd0[_0x1efb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x734fd0){return function(_0x16fbf9){if(!_0x16fbf9){_0x734fd0[_0x1efb('0x14')](0x194);}return _0x16fbf9;};}function handleError(_0x22bb50,_0x3477d8){_0x3477d8=_0x3477d8||0x1f4;return function(_0x42ffc8){logger[_0x1efb('0x1f')](_0x42ffc8[_0x1efb('0x20')]);if(_0x42ffc8[_0x1efb('0x21')]){delete _0x42ffc8[_0x1efb('0x21')];}_0x22bb50[_0x1efb('0x15')](_0x3477d8)[_0x1efb('0x22')](_0x42ffc8);};}exports[_0x1efb('0x23')]=function(_0x8cb136,_0x300a54){var _0x5bbbcf={};var _0x1db225=_['map'](db[_0x1efb('0x24')][_0x1efb('0x25')],function(_0x25e508){return{'name':_0x25e508[_0x1efb('0x26')],'type':_0x25e508[_0x1efb('0x27')][_0x1efb('0x28')]};});_0x5bbbcf=qs[_0x1efb('0x29')](_0x1db225,_0x8cb136);return interaction[_0x1efb('0x2a')](_0x1efb('0x2b'),_0x8cb136[_0x1efb('0x2c')],_0x8cb136['user'],_0x5bbbcf,_0x1db225)[_0x1efb('0x1e')](respondWithFilteredResult(_0x300a54,_0x5bbbcf))[_0x1efb('0x2d')](handleError(_0x300a54,null));};exports[_0x1efb('0x2e')]=function(_0x5110e3,_0x4e5eca){var _0x26e4ab={'raw':![],'where':{'id':_0x5110e3['params']['id']}},_0x2628a6={};_0x2628a6[_0x1efb('0x2f')]=_[_0x1efb('0x30')](db[_0x1efb('0x24')][_0x1efb('0x25')]);_0x2628a6['query']=_[_0x1efb('0x30')](_0x5110e3[_0x1efb('0x2c')]);_0x2628a6[_0x1efb('0x31')]=_[_0x1efb('0x32')](_0x2628a6[_0x1efb('0x2f')],_0x2628a6['query']);_0x26e4ab[_0x1efb('0x33')]=_[_0x1efb('0x32')](_0x2628a6[_0x1efb('0x2f')],qs[_0x1efb('0x34')](_0x5110e3[_0x1efb('0x2c')][_0x1efb('0x34')]));_0x26e4ab['attributes']=_0x26e4ab[_0x1efb('0x33')][_0x1efb('0x35')]?_0x26e4ab[_0x1efb('0x33')]:_0x2628a6['model'];if(_0x5110e3['query'][_0x1efb('0x36')]){_0x26e4ab['include']=[{'all':!![]}];}_0x26e4ab=_[_0x1efb('0x37')]({},_0x26e4ab,_0x5110e3[_0x1efb('0x38')]);return db[_0x1efb('0x24')][_0x1efb('0x39')](_0x26e4ab)[_0x1efb('0x1e')](handleEntityNotFound(_0x4e5eca,null))[_0x1efb('0x1e')](respondWithResult(_0x4e5eca,null))[_0x1efb('0x2d')](handleError(_0x4e5eca,null));};exports['create']=function(_0x4bcc1c,_0x39a68e){return db[_0x1efb('0x24')]['create'](_0x4bcc1c[_0x1efb('0x3a')],{})[_0x1efb('0x1e')](respondWithResult(_0x39a68e,0xc9))[_0x1efb('0x2d')](handleError(_0x39a68e,null));};exports[_0x1efb('0x1c')]=function(_0xf85af4,_0x2ea1d1){if(_0xf85af4[_0x1efb('0x3a')]['id']){delete _0xf85af4[_0x1efb('0x3a')]['id'];}return db[_0x1efb('0x24')][_0x1efb('0x39')]({'where':{'id':_0xf85af4['params']['id']}})[_0x1efb('0x1e')](handleEntityNotFound(_0x2ea1d1,null))[_0x1efb('0x1e')](saveUpdates(_0xf85af4[_0x1efb('0x3a')],null))['then'](respondWithResult(_0x2ea1d1,null))[_0x1efb('0x2d')](handleError(_0x2ea1d1,null));};exports[_0x1efb('0x1d')]=function(_0x2da400,_0x51fe5e){return db[_0x1efb('0x24')][_0x1efb('0x39')]({'where':{'id':_0x2da400['params']['id']}})['then'](handleEntityNotFound(_0x51fe5e,null))[_0x1efb('0x1e')](removeEntity(_0x51fe5e,null))[_0x1efb('0x2d')](handleError(_0x51fe5e,null));};exports[_0x1efb('0x3b')]=function(_0x3a0bba,_0x560596){return db['MailInteraction'][_0x1efb('0x3b')]()[_0x1efb('0x1e')](respondWithResult(_0x560596,null))[_0x1efb('0x2d')](handleError(_0x560596,null));};exports[_0x1efb('0x3c')]=function(_0x314c4f,_0x41b6a1){return db[_0x1efb('0x3d')]['find']({'where':{'id':_0x314c4f[_0x1efb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x41b6a1,null))[_0x1efb('0x1e')](function(_0x146148){if(_0x146148){return _0x146148['addMessage'](_0x314c4f['body'][_0x1efb('0x3f')],_[_0x1efb('0x40')](_0x314c4f[_0x1efb('0x3a')],[_0x1efb('0x3f'),'id'])||{});}})[_0x1efb('0x1e')](respondWithResult(_0x41b6a1,null))[_0x1efb('0x2d')](handleError(_0x41b6a1,null));};exports[_0x1efb('0x41')]=function(_0x30654f,_0x11687d){var _0x26b355={'raw':![],'where':{}};var _0x4f426a={};var _0x29e9a6={'count':0x0,'rows':[]};return db[_0x1efb('0x24')][_0x1efb('0x42')]({'where':{'id':_0x30654f[_0x1efb('0x3e')]['id']}})[_0x1efb('0x1e')](handleEntityNotFound(_0x11687d,null))['then'](function(_0x2ae2f6){if(_0x2ae2f6){_0x4f426a['model']=_[_0x1efb('0x30')](db[_0x1efb('0x3d')][_0x1efb('0x25')]);_0x4f426a[_0x1efb('0x2c')]=_['keys'](_0x30654f[_0x1efb('0x2c')]);_0x4f426a['filters']=_[_0x1efb('0x32')](_0x4f426a[_0x1efb('0x2f')],_0x4f426a['query']);_0x26b355[_0x1efb('0x33')]=_[_0x1efb('0x32')](_0x4f426a[_0x1efb('0x2f')],qs[_0x1efb('0x34')](_0x30654f['query'][_0x1efb('0x34')]));_0x26b355['attributes']=_0x26b355[_0x1efb('0x33')][_0x1efb('0x35')]?_0x26b355[_0x1efb('0x33')]:_0x4f426a[_0x1efb('0x2f')];if(!_0x30654f[_0x1efb('0x2c')][_0x1efb('0x43')]('nolimit')){_0x26b355[_0x1efb('0x18')]=qs[_0x1efb('0x18')](_0x30654f[_0x1efb('0x2c')][_0x1efb('0x18')]);_0x26b355[_0x1efb('0x19')]=qs[_0x1efb('0x19')](_0x30654f[_0x1efb('0x2c')][_0x1efb('0x19')]);}_0x26b355[_0x1efb('0x44')]=qs['sort'](_0x30654f[_0x1efb('0x2c')][_0x1efb('0x45')]);_0x26b355[_0x1efb('0x46')]=qs[_0x1efb('0x31')](_[_0x1efb('0x47')](_0x30654f[_0x1efb('0x2c')],_0x4f426a[_0x1efb('0x31')]));_0x26b355['where'][_0x1efb('0x48')]=_0x2ae2f6['id'];if(_0x30654f[_0x1efb('0x2c')][_0x1efb('0x49')]){_0x26b355[_0x1efb('0x46')]=_[_0x1efb('0x37')](_0x26b355[_0x1efb('0x46')],{'$or':_[_0x1efb('0x4a')](_0x26b355[_0x1efb('0x33')],function(_0x2d5821){var _0x57252e={};_0x57252e[_0x2d5821]={'$like':'%'+_0x30654f['query']['filter']+'%'};return _0x57252e;})});}if(_0x30654f[_0x1efb('0x2c')]['$gte']){var _0x32f98b=_0x30654f[_0x1efb('0x2c')][_0x1efb('0x4b')][_0x1efb('0x4c')](',');var _0x2708dd={};_0x2708dd[_0x32f98b[0x0]]={'$gte':moment(_0x32f98b[0x1])['format'](_0x1efb('0x4d'))};_0x26b355['where']=_[_0x1efb('0x37')](_0x26b355['where'],_0x2708dd);}_0x26b355=_[_0x1efb('0x37')]({},_0x26b355,_0x30654f['options']);return db['MailMessage'][_0x1efb('0x1a')]({'where':_0x26b355[_0x1efb('0x46')]})['then'](function(_0x584158){_0x29e9a6[_0x1efb('0x1a')]=_0x584158;if(_0x30654f[_0x1efb('0x2c')]['includeAll']){_0x26b355['include']=[{'all':!![]}];}return db['MailMessage'][_0x1efb('0x2a')](_0x26b355);})[_0x1efb('0x1e')](function(_0x4792f4){if(_0x30654f['query']['inlineCss']==='true'){for(var _0x10d1bb=0x0;_0x10d1bb<_0x4792f4[_0x1efb('0x35')];_0x10d1bb++){_0x4792f4[_0x10d1bb][_0x1efb('0x3a')]=juice(_0x4792f4[_0x10d1bb]['body']);}}_0x29e9a6[_0x1efb('0x4e')]=_0x4792f4;return _0x29e9a6;});}})[_0x1efb('0x1e')](respondWithFilteredResult(_0x11687d,_0x26b355))['catch'](handleError(_0x11687d,null));};exports[_0x1efb('0x4f')]=function(_0x5013ba,_0x3e4370){return db[_0x1efb('0x24')][_0x1efb('0x39')]({'where':{'id':_0x5013ba[_0x1efb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3e4370,null))[_0x1efb('0x1e')](function(_0x2376e2){if(_0x2376e2){return _0x2376e2[_0x1efb('0x50')](_0x5013ba[_0x1efb('0x3a')][_0x1efb('0x3f')],_[_0x1efb('0x40')](_0x5013ba['body'],[_0x1efb('0x3f'),'id'])||{})['spread'](function(){return db[_0x1efb('0x51')]['findAll']({'attributes':['id',_0x1efb('0x21'),'color'],'where':{'id':_0x5013ba[_0x1efb('0x3a')][_0x1efb('0x3f')]}});})[_0x1efb('0x1e')](function(_0x393005){socket[_0x1efb('0x52')]('mailInteractionTags:save',{'id':Number(_0x5013ba[_0x1efb('0x3e')]['id']),'tags':_0x393005||[]});return{'id':Number(_0x5013ba[_0x1efb('0x3e')]['id']),'tags':_0x393005||[]};});}})[_0x1efb('0x1e')](respondWithResult(_0x3e4370,null))['catch'](handleError(_0x3e4370,null));};exports[_0x1efb('0x53')]=function(_0x47ef6a,_0x17c2df){return db[_0x1efb('0x24')]['find']({'where':{'id':_0x47ef6a[_0x1efb('0x3e')]['id']}})[_0x1efb('0x1e')](handleEntityNotFound(_0x17c2df,null))[_0x1efb('0x1e')](function(_0x4af0c0){if(_0x4af0c0){return _0x4af0c0[_0x1efb('0x53')](_0x47ef6a[_0x1efb('0x2c')][_0x1efb('0x3f')]);}})[_0x1efb('0x1e')](respondWithStatusCode(_0x17c2df,null))[_0x1efb('0x2d')](handleError(_0x17c2df,null));};exports['download']=function(_0x3b54bf,_0x291d64){var _0x3ebead=moment()[_0x1efb('0x54')]()[_0x1efb('0x55')]();var _0x1d3c1b=path['join'](config[_0x1efb('0x56')],_0x1efb('0x57'),_0x1efb('0x58'),_0x1efb('0x59'));var _0x5da7e5=path[_0x1efb('0x5a')](config[_0x1efb('0x56')],'server','files','attachments');var _0x3e8036=path['join'](_0x1d3c1b,_0x3ebead);var _0x57470e=util[_0x1efb('0x5b')](_0x1efb('0x5c'),_0x3b54bf['params']['id'],_0x3ebead);var _0x486e53=path['join'](_0x1d3c1b,_0x57470e);var _0x3d4769=[];if(_0x3b54bf[_0x1efb('0x2c')][_0x1efb('0x5d')]){_0x3d4769[_0x1efb('0x5e')]({'model':db[_0x1efb('0x5f')],'as':'Attachments','raw':!![]});}var _0x168e6d=[{'model':db[_0x1efb('0x3d')],'as':_0x1efb('0x60'),'attributes':['id','body',_0x1efb('0x61'),'to','cc',_0x1efb('0x62'),'subject',_0x1efb('0x63')],'where':{'secret':![]},'order':qs[_0x1efb('0x45')]('id'),'include':_0x3d4769}];return db[_0x1efb('0x24')][_0x1efb('0x39')]({'where':{'id':_0x3b54bf[_0x1efb('0x3e')]['id']},'include':_0x168e6d})[_0x1efb('0x1e')](handleEntityNotFound(_0x291d64,null))[_0x1efb('0x1e')](function(_0x54a006){if(_0x54a006&&_0x54a006[_0x1efb('0x60')]){var _0x42ba95=_0x54a006[_0x1efb('0x64')]({'plain':!![]});fs[_0x1efb('0x65')](_0x3e8036);return BPromise[_0x1efb('0x66')](_0x42ba95['Messages'],function(_0x470cd5,_0x524555){var _0x1330d1={'from':_0x470cd5[_0x1efb('0x61')],'to':_0x470cd5['to']||_0x1efb('0x67'),'subject':_0x470cd5[_0x1efb('0x68')],'html':htmlEntities[_0x1efb('0x69')](_0x470cd5['body']),'headers':{'Date':moment(_0x470cd5['createdAt'])[_0x1efb('0x5b')](_0x1efb('0x6a'))},'attachments':[]};if(_0x470cd5['cc']){_0x1330d1[_0x1efb('0x6b')]['Cc']=_0x470cd5['cc'];}if(_0x470cd5[_0x1efb('0x62')]){_0x1330d1['headers']['Bcc']=_0x470cd5[_0x1efb('0x62')];}return new BPromise(function(_0x48fe3c,_0x220bd8){if(_0x470cd5[_0x1efb('0x6c')]){for(var _0x59afd5=0x0;_0x59afd5<_0x470cd5[_0x1efb('0x6c')]['length'];_0x59afd5++){var _0x314dbd=_0x470cd5[_0x1efb('0x6c')][_0x59afd5];var _0x3d03f9=path['join'](_0x5da7e5,_0x314dbd['basename']);if(fs[_0x1efb('0x6d')](_0x3d03f9)){_0x1330d1[_0x1efb('0x5d')][_0x1efb('0x5e')]({'name':_0x314dbd['name'],'contentType':_0x314dbd[_0x1efb('0x27')],'data':fs[_0x1efb('0x6e')](_0x3d03f9)});}}}emlformat[_0x1efb('0x6f')](_0x1330d1,function(_0x564db9,_0x5c36bc){if(_0x564db9)return _0x220bd8(_0x564db9);fs[_0x1efb('0x70')](path[_0x1efb('0x5a')](_0x3e8036,util[_0x1efb('0x5b')](_0x1efb('0x71'),_0x524555)),_0x5c36bc);return _0x48fe3c(_0x5c36bc);});});})[_0x1efb('0x1e')](function(){return new BPromise(function(_0x5d6d67,_0x11475e){zipdir(_0x3e8036,{'saveTo':_0x486e53},function(_0x7d8711,_0x3d5862){if(_0x7d8711)return _0x11475e(_0x7d8711);return _0x5d6d67(_0x3d5862);});})[_0x1efb('0x1e')](function(){return new BPromise(function(_0x2dd8a6,_0x204b7f){rimraf(_0x3e8036,function(_0x2de895){if(_0x2de895)_0x204b7f(_0x2de895);return _0x2dd8a6();});});})[_0x1efb('0x1e')](function(){return _0x291d64[_0x1efb('0x72')](_0x486e53,_0x57470e,function(_0x33dc22){if(!_0x33dc22)fs[_0x1efb('0x73')](_0x486e53);});});});}else{return _0x291d64['sendStatus'](0xc8);}})[_0x1efb('0x2d')](handleError(_0x291d64,null));}; \ No newline at end of file +var _0xfbaa=['body','destroy','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','sort','where','pick','MailInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','juice','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','update','then','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','mail','query','user','params','keys','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create'];(function(_0x17e05b,_0x66e4e5){var _0x5cc4b6=function(_0x25a799){while(--_0x25a799){_0x17e05b['push'](_0x17e05b['shift']());}};_0x5cc4b6(++_0x66e4e5);}(_0xfbaa,0x18b));var _0xafba=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xfbaa[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xafba('0x0'));var rimraf=require(_0xafba('0x1'));var zipdir=require(_0xafba('0x2'));var moment=require(_0xafba('0x3'));var BPromise=require('bluebird');var util=require(_0xafba('0x4'));var path=require(_0xafba('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0xafba('0x6'));var Redis=require('ioredis');var interaction=require(_0xafba('0x7'));var qs=require(_0xafba('0x8'));var logger=require('../../config/logger')('api');var config=require(_0xafba('0x9'));var db=require(_0xafba('0xa'))['db'];var htmlEntities=require(_0xafba('0xb'));config['redis']=_[_0xafba('0xc')](config[_0xafba('0xd')],{'host':_0xafba('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafba('0xd')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x159d3b,_0x4ea48e){_0x4ea48e=_0x4ea48e||0xcc;return function(_0x51ed2a){if(_0x51ed2a){return _0x159d3b[_0xafba('0xf')](_0x4ea48e);}return _0x159d3b['status'](_0x4ea48e)[_0xafba('0x10')]();};}function respondWithResult(_0x58434c,_0x3bc9f6){_0x3bc9f6=_0x3bc9f6||0xc8;return function(_0x5e1e9e){if(_0x5e1e9e){return _0x58434c[_0xafba('0x11')](_0x3bc9f6)[_0xafba('0x12')](_0x5e1e9e);}};}function respondWithFilteredResult(_0x3d648d,_0x2ee008){return function(_0x2ccfd1){if(_0x2ccfd1){var _0x59ad8e=typeof _0x2ee008['offset']==='undefined'&&typeof _0x2ee008['limit']===_0xafba('0x13');var _0x525c26=_0x2ccfd1[_0xafba('0x14')];var _0x10540d=_0x59ad8e?0x0:_0x2ee008[_0xafba('0x15')];var _0x372596=_0x59ad8e?_0x2ccfd1[_0xafba('0x14')]:_0x2ee008['offset']+_0x2ee008[_0xafba('0x16')];var _0x1c7b34;if(_0x372596>=_0x525c26){_0x372596=_0x525c26;_0x1c7b34=0xc8;}else{_0x1c7b34=0xce;}_0x3d648d[_0xafba('0x11')](_0x1c7b34);return _0x3d648d[_0xafba('0x17')](_0xafba('0x18'),_0x10540d+'-'+_0x372596+'/'+_0x525c26)[_0xafba('0x12')](_0x2ccfd1);}return null;};}function saveUpdates(_0x4533f3){return function(_0x4964bd){if(_0x4964bd){return _0x4964bd[_0xafba('0x19')](_0x4533f3)[_0xafba('0x1a')](function(_0x590994){return _0x590994;});}return null;};}function removeEntity(_0x50304f){return function(_0x4481e0){if(_0x4481e0){return _0x4481e0['destroy']()[_0xafba('0x1a')](function(){_0x50304f[_0xafba('0x11')](0xcc)[_0xafba('0x10')]();});}};}function handleEntityNotFound(_0x4f7669){return function(_0x494b58){if(!_0x494b58){_0x4f7669[_0xafba('0xf')](0x194);}return _0x494b58;};}function handleError(_0x96c974,_0x3bd1bb){_0x3bd1bb=_0x3bd1bb||0x1f4;return function(_0x11fd1e){logger[_0xafba('0x1b')](_0x11fd1e[_0xafba('0x1c')]);if(_0x11fd1e['name']){delete _0x11fd1e[_0xafba('0x1d')];}_0x96c974[_0xafba('0x11')](_0x3bd1bb)[_0xafba('0x1e')](_0x11fd1e);};}exports[_0xafba('0x1f')]=function(_0x304ab8,_0x12783e){var _0x4d4838={};var _0x24c39c=_[_0xafba('0x20')](db[_0xafba('0x21')][_0xafba('0x22')],function(_0x12a492){return{'name':_0x12a492[_0xafba('0x23')],'type':_0x12a492[_0xafba('0x24')]['key']};});_0x4d4838=qs[_0xafba('0x25')](_0x24c39c,_0x304ab8);return interaction[_0xafba('0x26')](_0xafba('0x27'),_0x304ab8[_0xafba('0x28')],_0x304ab8[_0xafba('0x29')],_0x4d4838,_0x24c39c)[_0xafba('0x1a')](respondWithFilteredResult(_0x12783e,_0x4d4838))['catch'](handleError(_0x12783e,null));};exports['show']=function(_0x19012b,_0x2d7e9d){var _0x406296={'raw':![],'where':{'id':_0x19012b[_0xafba('0x2a')]['id']}},_0xd6fe59={};_0xd6fe59['model']=_[_0xafba('0x2b')](db[_0xafba('0x21')][_0xafba('0x22')]);_0xd6fe59['query']=_[_0xafba('0x2b')](_0x19012b[_0xafba('0x28')]);_0xd6fe59[_0xafba('0x2c')]=_['intersection'](_0xd6fe59[_0xafba('0x2d')],_0xd6fe59[_0xafba('0x28')]);_0x406296[_0xafba('0x2e')]=_[_0xafba('0x2f')](_0xd6fe59[_0xafba('0x2d')],qs['fields'](_0x19012b[_0xafba('0x28')][_0xafba('0x30')]));_0x406296[_0xafba('0x2e')]=_0x406296[_0xafba('0x2e')][_0xafba('0x31')]?_0x406296[_0xafba('0x2e')]:_0xd6fe59[_0xafba('0x2d')];if(_0x19012b[_0xafba('0x28')][_0xafba('0x32')]){_0x406296[_0xafba('0x33')]=[{'all':!![]}];}_0x406296=_[_0xafba('0x34')]({},_0x406296,_0x19012b[_0xafba('0x35')]);return db[_0xafba('0x21')][_0xafba('0x36')](_0x406296)[_0xafba('0x1a')](handleEntityNotFound(_0x2d7e9d,null))[_0xafba('0x1a')](respondWithResult(_0x2d7e9d,null))[_0xafba('0x37')](handleError(_0x2d7e9d,null));};exports['create']=function(_0x31ef5c,_0x3dd757){return db[_0xafba('0x21')][_0xafba('0x38')](_0x31ef5c[_0xafba('0x39')],{})['then'](respondWithResult(_0x3dd757,0xc9))[_0xafba('0x37')](handleError(_0x3dd757,null));};exports['update']=function(_0x52ffac,_0xbb48ba){if(_0x52ffac[_0xafba('0x39')]['id']){delete _0x52ffac[_0xafba('0x39')]['id'];}return db['MailInteraction'][_0xafba('0x36')]({'where':{'id':_0x52ffac[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0xbb48ba,null))[_0xafba('0x1a')](saveUpdates(_0x52ffac['body'],null))[_0xafba('0x1a')](respondWithResult(_0xbb48ba,null))[_0xafba('0x37')](handleError(_0xbb48ba,null));};exports[_0xafba('0x3a')]=function(_0x1ee5b8,_0x8aff40){return db['MailInteraction'][_0xafba('0x36')]({'where':{'id':_0x1ee5b8['params']['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0x8aff40,null))[_0xafba('0x1a')](removeEntity(_0x8aff40,null))[_0xafba('0x37')](handleError(_0x8aff40,null));};exports[_0xafba('0x3b')]=function(_0x3ab1d7,_0x3dcd6a){return db['MailInteraction'][_0xafba('0x3b')]()[_0xafba('0x1a')](respondWithResult(_0x3dcd6a,null))[_0xafba('0x37')](handleError(_0x3dcd6a,null));};exports['addMessage']=function(_0x595be5,_0x3bb4dc){return db['MailMessage']['find']({'where':{'id':_0x595be5[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0x3bb4dc,null))['then'](function(_0x58ef95){if(_0x58ef95){return _0x58ef95[_0xafba('0x3c')](_0x595be5[_0xafba('0x39')][_0xafba('0x3d')],_[_0xafba('0x3e')](_0x595be5[_0xafba('0x39')],[_0xafba('0x3d'),'id'])||{});}})[_0xafba('0x1a')](respondWithResult(_0x3bb4dc,null))['catch'](handleError(_0x3bb4dc,null));};exports[_0xafba('0x3f')]=function(_0xf615f2,_0x4fe707){var _0x5777e4={'raw':![],'where':{}};var _0x5e4acf={};var _0x1eeef3={'count':0x0,'rows':[]};return db[_0xafba('0x21')][_0xafba('0x40')]({'where':{'id':_0xf615f2[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0x4fe707,null))[_0xafba('0x1a')](function(_0x1c4e90){if(_0x1c4e90){_0x5e4acf[_0xafba('0x2d')]=_[_0xafba('0x2b')](db[_0xafba('0x41')][_0xafba('0x22')]);_0x5e4acf['query']=_[_0xafba('0x2b')](_0xf615f2[_0xafba('0x28')]);_0x5e4acf[_0xafba('0x2c')]=_['intersection'](_0x5e4acf[_0xafba('0x2d')],_0x5e4acf[_0xafba('0x28')]);_0x5777e4[_0xafba('0x2e')]=_[_0xafba('0x2f')](_0x5e4acf[_0xafba('0x2d')],qs['fields'](_0xf615f2[_0xafba('0x28')]['fields']));_0x5777e4[_0xafba('0x2e')]=_0x5777e4[_0xafba('0x2e')]['length']?_0x5777e4[_0xafba('0x2e')]:_0x5e4acf['model'];if(!_0xf615f2[_0xafba('0x28')][_0xafba('0x42')]('nolimit')){_0x5777e4[_0xafba('0x16')]=qs['limit'](_0xf615f2['query'][_0xafba('0x16')]);_0x5777e4[_0xafba('0x15')]=qs[_0xafba('0x15')](_0xf615f2['query'][_0xafba('0x15')]);}_0x5777e4['order']=qs[_0xafba('0x43')](_0xf615f2[_0xafba('0x28')][_0xafba('0x43')]);_0x5777e4[_0xafba('0x44')]=qs[_0xafba('0x2c')](_[_0xafba('0x45')](_0xf615f2[_0xafba('0x28')],_0x5e4acf[_0xafba('0x2c')]));_0x5777e4['where'][_0xafba('0x46')]=_0x1c4e90['id'];if(_0xf615f2[_0xafba('0x28')][_0xafba('0x47')]){_0x5777e4[_0xafba('0x44')]=_[_0xafba('0x34')](_0x5777e4['where'],{'$or':_[_0xafba('0x20')](_0x5777e4[_0xafba('0x2e')],function(_0x52cc58){var _0xee790b={};_0xee790b[_0x52cc58]={'$like':'%'+_0xf615f2[_0xafba('0x28')]['filter']+'%'};return _0xee790b;})});}if(_0xf615f2[_0xafba('0x28')][_0xafba('0x48')]){var _0x4adfb8=_0xf615f2[_0xafba('0x28')][_0xafba('0x48')]['split'](',');var _0xf7512d={};_0xf7512d[_0x4adfb8[0x0]]={'$gte':moment(_0x4adfb8[0x1])['format'](_0xafba('0x49'))};_0x5777e4[_0xafba('0x44')]=_[_0xafba('0x34')](_0x5777e4[_0xafba('0x44')],_0xf7512d);}_0x5777e4=_['merge']({},_0x5777e4,_0xf615f2[_0xafba('0x35')]);return db[_0xafba('0x41')][_0xafba('0x14')]({'where':_0x5777e4['where']})[_0xafba('0x1a')](function(_0x47dddc){_0x1eeef3[_0xafba('0x14')]=_0x47dddc;if(_0xf615f2[_0xafba('0x28')]['includeAll']){_0x5777e4[_0xafba('0x33')]=[{'all':!![]}];}return db[_0xafba('0x41')][_0xafba('0x26')](_0x5777e4);})[_0xafba('0x1a')](function(_0x31daab){if(_0xf615f2[_0xafba('0x28')]['inlineCss']==='true'){for(var _0xe33761=0x0;_0xe33761<_0x31daab['length'];_0xe33761++){_0x31daab[_0xe33761][_0xafba('0x39')]=juice(_0x31daab[_0xe33761]['body']);}}_0x1eeef3[_0xafba('0x4a')]=_0x31daab;return _0x1eeef3;});}})['then'](respondWithFilteredResult(_0x4fe707,_0x5777e4))[_0xafba('0x37')](handleError(_0x4fe707,null));};exports[_0xafba('0x4b')]=function(_0x372731,_0x339028){return db[_0xafba('0x21')][_0xafba('0x36')]({'where':{'id':_0x372731[_0xafba('0x2a')]['id']}})['then'](handleEntityNotFound(_0x339028,null))[_0xafba('0x1a')](function(_0x25b13b){if(_0x25b13b){return _0x25b13b[_0xafba('0x4c')](_0x372731['body'][_0xafba('0x3d')],_[_0xafba('0x3e')](_0x372731[_0xafba('0x39')],['ids','id'])||{})[_0xafba('0x4d')](function(){return db[_0xafba('0x4e')][_0xafba('0x26')]({'attributes':['id',_0xafba('0x1d'),_0xafba('0x4f')],'where':{'id':_0x372731[_0xafba('0x39')]['ids']}});})[_0xafba('0x1a')](function(_0x3e2d59){socket[_0xafba('0x50')]('mailInteractionTags:save',{'id':Number(_0x372731[_0xafba('0x2a')]['id']),'tags':_0x3e2d59||[]});return{'id':Number(_0x372731[_0xafba('0x2a')]['id']),'tags':_0x3e2d59||[]};});}})[_0xafba('0x1a')](respondWithResult(_0x339028,null))['catch'](handleError(_0x339028,null));};exports[_0xafba('0x51')]=function(_0x3e228e,_0xe48230){return db[_0xafba('0x21')]['find']({'where':{'id':_0x3e228e[_0xafba('0x2a')]['id']}})[_0xafba('0x1a')](handleEntityNotFound(_0xe48230,null))['then'](function(_0x2a4da4){if(_0x2a4da4){return _0x2a4da4[_0xafba('0x51')](_0x3e228e[_0xafba('0x28')][_0xafba('0x3d')]);}})[_0xafba('0x1a')](respondWithStatusCode(_0xe48230,null))[_0xafba('0x37')](handleError(_0xe48230,null));};exports[_0xafba('0x52')]=function(_0x394736,_0x274f66){var _0x18db10=moment()[_0xafba('0x53')]()[_0xafba('0x54')]();var _0x2a60ae=path[_0xafba('0x55')](config[_0xafba('0x56')],_0xafba('0x57'),'files','tmp');var _0x53c1fe=path['join'](config[_0xafba('0x56')],'server',_0xafba('0x58'),_0xafba('0x59'));var _0x4a7d5b=path['join'](_0x2a60ae,_0x18db10);var _0x5cbf70=util['format']('transcript-%d-%s.zip',_0x394736['params']['id'],_0x18db10);var _0x6b2c15=path['join'](_0x2a60ae,_0x5cbf70);var _0x47f2b3=[];if(_0x394736[_0xafba('0x28')][_0xafba('0x59')]){_0x47f2b3[_0xafba('0x5a')]({'model':db[_0xafba('0x5b')],'as':_0xafba('0x5c'),'raw':!![]});}var _0x28faae=[{'model':db[_0xafba('0x41')],'as':_0xafba('0x5d'),'attributes':['id',_0xafba('0x39'),_0xafba('0x5e'),'to','cc',_0xafba('0x5f'),_0xafba('0x60'),_0xafba('0x61')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x47f2b3}];return db[_0xafba('0x21')][_0xafba('0x36')]({'where':{'id':_0x394736['params']['id']},'include':_0x28faae})[_0xafba('0x1a')](handleEntityNotFound(_0x274f66,null))[_0xafba('0x1a')](function(_0x1d7df4){if(_0x1d7df4&&_0x1d7df4[_0xafba('0x5d')]){var _0x3b0182=_0x1d7df4[_0xafba('0x62')]({'plain':!![]});fs[_0xafba('0x63')](_0x4a7d5b);return BPromise[_0xafba('0x64')](_0x3b0182[_0xafba('0x5d')],function(_0x19c009,_0x4bee00){var _0x559106={'from':_0x19c009[_0xafba('0x5e')],'to':_0x19c009['to']||_0xafba('0x65'),'subject':_0x19c009[_0xafba('0x60')],'html':htmlEntities[_0xafba('0x66')](_0x19c009[_0xafba('0x39')]),'headers':{'Date':moment(_0x19c009[_0xafba('0x61')])[_0xafba('0x67')](_0xafba('0x68'))},'attachments':[]};if(_0x19c009['cc']){_0x559106['headers']['Cc']=_0x19c009['cc'];}if(_0x19c009['bcc']){_0x559106[_0xafba('0x69')][_0xafba('0x6a')]=_0x19c009[_0xafba('0x5f')];}return new BPromise(function(_0x386948,_0x4e6e75){if(_0x19c009['Attachments']){for(var _0x4559b3=0x0;_0x4559b3<_0x19c009[_0xafba('0x5c')]['length'];_0x4559b3++){var _0x485ab4=_0x19c009[_0xafba('0x5c')][_0x4559b3];var _0x5d5a66=path[_0xafba('0x55')](_0x53c1fe,_0x485ab4[_0xafba('0x6b')]);if(fs['existsSync'](_0x5d5a66)){_0x559106[_0xafba('0x59')][_0xafba('0x5a')]({'name':_0x485ab4[_0xafba('0x1d')],'contentType':_0x485ab4['type'],'data':fs[_0xafba('0x6c')](_0x5d5a66)});}}}emlformat[_0xafba('0x6d')](_0x559106,function(_0x1f977d,_0x260e15){if(_0x1f977d)return _0x4e6e75(_0x1f977d);fs[_0xafba('0x6e')](path[_0xafba('0x55')](_0x4a7d5b,util[_0xafba('0x67')](_0xafba('0x6f'),_0x4bee00)),_0x260e15);return _0x386948(_0x260e15);});});})[_0xafba('0x1a')](function(){return new BPromise(function(_0x192f49,_0x4946ff){zipdir(_0x4a7d5b,{'saveTo':_0x6b2c15},function(_0x452e40,_0x524cdb){if(_0x452e40)return _0x4946ff(_0x452e40);return _0x192f49(_0x524cdb);});})[_0xafba('0x1a')](function(){return new BPromise(function(_0x4670ba,_0x22c756){rimraf(_0x4a7d5b,function(_0xbcbd17){if(_0xbcbd17)_0x22c756(_0xbcbd17);return _0x4670ba();});});})[_0xafba('0x1a')](function(){return _0x274f66['download'](_0x6b2c15,_0x5cbf70,function(_0x526802){if(!_0x526802)fs[_0xafba('0x70')](_0x6b2c15);});});});}else{return _0x274f66[_0xafba('0xf')](0xc8);}})[_0xafba('0x37')](handleError(_0x274f66,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c10646f..a596f26 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 _0xd966=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue'];(function(_0x142135,_0x4aaa92){var _0x462de8=function(_0x52e7f5){while(--_0x52e7f5){_0x142135['push'](_0x142135['shift']());}};_0x462de8(++_0x4aaa92);}(_0xd966,0x1ec));var _0x6d96=function(_0x569560,_0x16b989){_0x569560=_0x569560-0x0;var _0x3c1de0=_0xd966[_0x569560];return _0x3c1de0;};'use strict';var EventEmitter=require(_0x6d96('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x6d96('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x6d96('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6d96('0x3')](0x0);var events={'afterCreate':_0x6d96('0x4'),'afterUpdate':_0x6d96('0x5'),'afterDestroy':_0x6d96('0x6')};function emitEvent(_0x84aaa5){return function(_0x42b51d,_0x2621f1,_0x5b5224){_0x42b51d[_0x6d96('0x7')]({'attributes':['id'],'raw':!![]})[_0x6d96('0x8')](function(_0x339a81){_0x42b51d['setDataValue'](_0x6d96('0x9'),_0x339a81[_0x6d96('0xa')](function(_0x2286a7){return{'id':_0x2286a7['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x42b51d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ea2b5){_0x42b51d[_0x6d96('0xb')](_0x6d96('0xc'),_0x4ea2b5['length']);MailInteractionEvents[_0x6d96('0xd')](_0x84aaa5+':'+_0x42b51d['id'],_0x42b51d);MailInteractionEvents[_0x6d96('0xd')](_0x84aaa5,_0x42b51d);_0x5b5224(null);})[_0x6d96('0xe')](_0x5b5224(null));};}for(var e in events){if(events[_0x6d96('0xf')](e)){var event=events[e];MailInteraction[_0x6d96('0x10')](e,emitEvent(event));}}module[_0x6d96('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x3da7=['../../mysqldb','save','update','getUsers','then','setDataValue','Users','map','findAll','emit','hook','exports','events','MailInteraction'];(function(_0xc6302c,_0x1a1513){var _0x472f1b=function(_0x53a574){while(--_0x53a574){_0xc6302c['push'](_0xc6302c['shift']());}};_0x472f1b(++_0x1a1513);}(_0x3da7,0x8a));var _0x73da=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x3da7[_0x1344d6];return _0xf45b24;};'use strict';var EventEmitter=require(_0x73da('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x73da('0x1')];var MailMessage=require(_0x73da('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x73da('0x3'),'afterUpdate':_0x73da('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ce34a){return function(_0x56e566,_0x208e6e,_0x210b22){_0x56e566[_0x73da('0x5')]({'attributes':['id'],'raw':!![]})[_0x73da('0x6')](function(_0x2866b6){_0x56e566[_0x73da('0x7')](_0x73da('0x8'),_0x2866b6[_0x73da('0x9')](function(_0x21faeb){return{'id':_0x21faeb['id']};}));return MailMessage[_0x73da('0xa')]({'where':{'MailInteractionId':_0x56e566['id'],'direction':'in','read':![]},'raw':!![]});})[_0x73da('0x6')](function(_0x2f64b3){_0x56e566[_0x73da('0x7')]('unreadMessages',_0x2f64b3['length']);MailInteractionEvents[_0x73da('0xb')](_0x3ce34a+':'+_0x56e566['id'],_0x56e566);MailInteractionEvents[_0x73da('0xb')](_0x3ce34a,_0x56e566);_0x210b22(null);})['catch'](_0x210b22(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x73da('0xc')](e,emitEvent(event));}}module[_0x73da('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f7efbdf..b38caae 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 _0x9c39=['MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get'];(function(_0x18d9bb,_0x46e4ab){var _0x2dd06f=function(_0x36288b){while(--_0x36288b){_0x18d9bb['push'](_0x18d9bb['shift']());}};_0x2dd06f(++_0x46e4ab);}(_0x9c39,0xdd));var _0x99c3=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x9c39[_0x307086];return _0x699043;};'use strict';var _=require(_0x99c3('0x0'));var util=require(_0x99c3('0x1'));var logger=require(_0x99c3('0x2'))(_0x99c3('0x3'));var moment=require('moment');var BPromise=require(_0x99c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99c3('0x5'));var rimraf=require(_0x99c3('0x6'));var config=require(_0x99c3('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x99c3('0x8')]=function(_0x230629,_0x30a761){return _0x230629['define'](_0x99c3('0x9'),attributes,{'tableName':_0x99c3('0xa'),'paranoid':![],'indexes':[{'name':_0x99c3('0xb'),'fields':['subject','to'],'type':_0x99c3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x460897,_0x10704d,_0x376a93){if(_0x460897[_0x99c3('0xd')]){_0x460897[_0x99c3('0xe')]=moment()['format'](_0x99c3('0xf'));}if(_0x460897[_0x99c3('0x10')]){_0x460897[_0x99c3('0x11')]=moment()[_0x99c3('0x12')](_0x99c3('0xf'));}_0x376a93(null,_0x10704d);},'beforeUpdate':function(_0x25714a,_0x324f24,_0x6f4d85){if(_0x25714a[_0x99c3('0x13')](_0x99c3('0xd'))){_0x25714a['substatusAt']=_0x25714a[_0x99c3('0xd')]?moment()[_0x99c3('0x12')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x25714a[_0x99c3('0x13')](_0x99c3('0x10'))){_0x25714a['closedAt']=moment()[_0x99c3('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x25714a[_0x99c3('0xd')]=null;_0x25714a['substatusAt']=null;}_0x6f4d85(null,_0x25714a);},'afterUpdate':function(_0x5efc25,_0x404b26,_0x5bb19d){var _0x16487f=_0x230629[_0x99c3('0x14')];var _0x53bd2f=_0x5efc25[_0x99c3('0x15')]({'plain':!![]});if(_0x53bd2f[_0x99c3('0x10')]){return _0x16487f[_0x99c3('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x53bd2f['id']}})[_0x99c3('0x17')](function(){_0x5bb19d();})[_0x99c3('0x18')](function(_0x249abe){_0x5bb19d(_0x249abe);});}else{_0x5bb19d();}}},'charset':_0x99c3('0x19'),'collate':_0x99c3('0x1a')});}; \ No newline at end of file +var _0xbcec=['substatus','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xbcec,0x121));var _0xcbce=function(_0xd2af37,_0x417656){_0xd2af37=_0xd2af37-0x0;var _0x3eefcf=_0xbcec[_0xd2af37];return _0x3eefcf;};'use strict';var _=require(_0xcbce('0x0'));var util=require(_0xcbce('0x1'));var logger=require(_0xcbce('0x2'))(_0xcbce('0x3'));var moment=require(_0xcbce('0x4'));var BPromise=require('bluebird');var rp=require(_0xcbce('0x5'));var fs=require('fs');var path=require(_0xcbce('0x6'));var rimraf=require('rimraf');var config=require(_0xcbce('0x7'));var attributes=require(_0xcbce('0x8'));module[_0xcbce('0x9')]=function(_0x2d9276,_0x1cb101){return _0x2d9276['define']('MailInteraction',attributes,{'tableName':_0xcbce('0xa'),'paranoid':![],'indexes':[{'name':_0xcbce('0xb'),'fields':['subject','to'],'type':_0xcbce('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x489c03,_0x40da4d,_0x58ce5c){if(_0x489c03['substatus']){_0x489c03[_0xcbce('0xd')]=moment()[_0xcbce('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x489c03[_0xcbce('0xf')]){_0x489c03[_0xcbce('0x10')]=moment()[_0xcbce('0xe')](_0xcbce('0x11'));}_0x58ce5c(null,_0x40da4d);},'beforeUpdate':function(_0x238abd,_0x3ec05f,_0x40b617){if(_0x238abd[_0xcbce('0x12')](_0xcbce('0x13'))){_0x238abd[_0xcbce('0xd')]=_0x238abd[_0xcbce('0x13')]?moment()[_0xcbce('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x238abd['changed'](_0xcbce('0xf'))){_0x238abd[_0xcbce('0x10')]=moment()[_0xcbce('0xe')](_0xcbce('0x11'));_0x238abd[_0xcbce('0x13')]=null;_0x238abd[_0xcbce('0xd')]=null;}_0x40b617(null,_0x238abd);},'afterUpdate':function(_0x4b9ef9,_0x442ff1,_0x422a0d){var _0x4c1f2e=_0x2d9276[_0xcbce('0x14')];var _0x34669b=_0x4b9ef9[_0xcbce('0x15')]({'plain':!![]});if(_0x34669b['closed']){return _0x4c1f2e[_0xcbce('0x16')][_0xcbce('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x34669b['id']}})[_0xcbce('0x18')](function(){_0x422a0d();})[_0xcbce('0x19')](function(_0x1e2f48){_0x422a0d(_0x1e2f48);});}else{_0x422a0d();}}},'charset':_0xcbce('0x1a'),'collate':_0xcbce('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index f2b67ba..1b98e07 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 _0xf431=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','body','options','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x35d45d,_0x4b71fe){var _0x2543bc=function(_0x1e75b5){while(--_0x1e75b5){_0x35d45d['push'](_0x35d45d['shift']());}};_0x2543bc(++_0x4b71fe);}(_0xf431,0xc5));var _0x1f43=function(_0x4496d4,_0x35a23c){_0x4496d4=_0x4496d4-0x0;var _0x549149=_0xf431[_0x4496d4];return _0x549149;};'use strict';var _=require(_0x1f43('0x0'));var util=require(_0x1f43('0x1'));var moment=require(_0x1f43('0x2'));var BPromise=require(_0x1f43('0x3'));var rs=require(_0x1f43('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f43('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f43('0x6'));var config=require(_0x1f43('0x7'));var jayson=require(_0x1f43('0x8'));var client=jayson[_0x1f43('0x9')][_0x1f43('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1f43('0xb')],{'host':_0x1f43('0xc'),'port':0x18eb});var socket=require(_0x1f43('0xd'))(new Redis(config['redis']));require(_0x1f43('0xe'))[_0x1f43('0xf')](socket);function respondWithRpcPromise(_0x4563e0,_0x255f7c,_0x3dd6a5){return new BPromise(function(_0x1ca41c,_0x18f247){return client[_0x1f43('0x10')](_0x4563e0,_0x3dd6a5)[_0x1f43('0x11')](function(_0x4bf5c3){logger[_0x1f43('0x12')](_0x1f43('0x13'),_0x255f7c,_0x1f43('0x14'));logger[_0x1f43('0x15')](_0x1f43('0x16'),_0x255f7c,_0x1f43('0x14'),JSON[_0x1f43('0x17')](_0x4bf5c3));if(_0x4bf5c3[_0x1f43('0x18')]){if(_0x4bf5c3[_0x1f43('0x18')][_0x1f43('0x19')]===0x1f4){logger['error'](_0x1f43('0x13'),_0x255f7c,_0x4bf5c3[_0x1f43('0x18')][_0x1f43('0x1a')]);return _0x18f247(_0x4bf5c3[_0x1f43('0x18')][_0x1f43('0x1a')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x255f7c,_0x4bf5c3[_0x1f43('0x18')]['message']);return _0x1ca41c(_0x4bf5c3['error']['message']);}else{logger[_0x1f43('0x12')]('MailInteraction,\x20%s,\x20%s',_0x255f7c,_0x1f43('0x14'));_0x1ca41c(_0x4bf5c3['result'][_0x1f43('0x1a')]);}})[_0x1f43('0x1b')](function(_0x5de53f){logger[_0x1f43('0x18')](_0x1f43('0x13'),_0x255f7c,_0x5de53f);_0x18f247(_0x5de53f);});});}exports[_0x1f43('0x1c')]=function(_0x2314e7){var _0x49e379=this;return new Promise(function(_0x10640f,_0x493908){return db['MailInteraction']['update'](_0x2314e7[_0x1f43('0x1d')],{'raw':_0x2314e7[_0x1f43('0x1e')]?_0x2314e7[_0x1f43('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2314e7['options']?_0x2314e7[_0x1f43('0x1e')][_0x1f43('0x1f')]||null:null,'attributes':_0x2314e7['options']?_0x2314e7[_0x1f43('0x1e')][_0x1f43('0x20')]||null:null,'limit':_0x2314e7[_0x1f43('0x1e')]?_0x2314e7['options'][_0x1f43('0x21')]||null:null})['then'](function(_0x4735ae){logger[_0x1f43('0x12')](_0x1f43('0x1c'),_0x2314e7);logger[_0x1f43('0x15')](_0x1f43('0x1c'),_0x2314e7,JSON[_0x1f43('0x17')](_0x4735ae));_0x10640f(_0x4735ae);})[_0x1f43('0x1b')](function(_0x5e3bfc){logger['error'](_0x1f43('0x1c'),_0x5e3bfc[_0x1f43('0x1a')],_0x2314e7);_0x493908(_0x49e379[_0x1f43('0x18')](0x1f4,_0x5e3bfc['message']));});});};exports[_0x1f43('0x22')]=function(_0x28cc88){return new Promise(function(_0x387993,_0x5f54a4){return db['MailInteraction'][_0x1f43('0x23')]({'where':_0x28cc88[_0x1f43('0x1e')]?_0x28cc88['options'][_0x1f43('0x1f')]||null:null})[_0x1f43('0x11')](function(_0x6b42a){if(_0x6b42a){return _0x6b42a[_0x1f43('0x24')](_0x28cc88[_0x1f43('0x1d')][_0x1f43('0x25')],_[_0x1f43('0x26')](_0x28cc88['body'],[_0x1f43('0x25'),'id'])||{});}})[_0x1f43('0x27')](function(_0x24ed31){logger['info'](_0x1f43('0x28'),_0x28cc88);logger[_0x1f43('0x15')]('AddTags',_0x28cc88,JSON[_0x1f43('0x17')](_0x24ed31));_0x387993(_0x24ed31);})[_0x1f43('0x1b')](function(_0x2200da){logger[_0x1f43('0x18')](_0x1f43('0x28'),_0x2200da[_0x1f43('0x1a')],_0x28cc88);_0x5f54a4(_this[_0x1f43('0x18')](0x1f4,_0x2200da[_0x1f43('0x1a')]));});});}; \ No newline at end of file +var _0x6a52=['MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','MailInteraction','options','attributes','AddTagsToMailInteraction','where','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6a52,0x189));var _0x26a5=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x6a52[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0x26a5('0x0'));var util=require(_0x26a5('0x1'));var moment=require(_0x26a5('0x2'));var BPromise=require(_0x26a5('0x3'));var rs=require(_0x26a5('0x4'));var fs=require('fs');var Redis=require(_0x26a5('0x5'));var db=require(_0x26a5('0x6'))['db'];var utils=require(_0x26a5('0x7'));var logger=require(_0x26a5('0x8'))(_0x26a5('0x9'));var config=require('../../config/environment');var jayson=require(_0x26a5('0xa'));var client=jayson[_0x26a5('0xb')][_0x26a5('0xc')]({'port':0x232a});config[_0x26a5('0xd')]=_[_0x26a5('0xe')](config['redis'],{'host':_0x26a5('0xf'),'port':0x18eb});var socket=require(_0x26a5('0x10'))(new Redis(config[_0x26a5('0xd')]));require('./mailInteraction.socket')[_0x26a5('0x11')](socket);function respondWithRpcPromise(_0xd52fa9,_0x52cd47,_0x527f51){return new BPromise(function(_0x13f14d,_0x4aab48){return client[_0x26a5('0x12')](_0xd52fa9,_0x527f51)[_0x26a5('0x13')](function(_0x23fcbb){logger['info']('MailInteraction,\x20%s,\x20%s',_0x52cd47,_0x26a5('0x14'));logger[_0x26a5('0x15')](_0x26a5('0x16'),_0x52cd47,_0x26a5('0x14'),JSON[_0x26a5('0x17')](_0x23fcbb));if(_0x23fcbb['error']){if(_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x19')]===0x1f4){logger[_0x26a5('0x18')]('MailInteraction,\x20%s,\x20%s',_0x52cd47,_0x23fcbb['error'][_0x26a5('0x1a')]);return _0x4aab48(_0x23fcbb['error'][_0x26a5('0x1a')]);}logger[_0x26a5('0x18')](_0x26a5('0x1b'),_0x52cd47,_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x1a')]);return _0x13f14d(_0x23fcbb[_0x26a5('0x18')][_0x26a5('0x1a')]);}else{logger[_0x26a5('0x1c')](_0x26a5('0x1b'),_0x52cd47,_0x26a5('0x14'));_0x13f14d(_0x23fcbb[_0x26a5('0x1d')][_0x26a5('0x1a')]);}})[_0x26a5('0x1e')](function(_0x28b9ee){logger['error'](_0x26a5('0x1b'),_0x52cd47,_0x28b9ee);_0x4aab48(_0x28b9ee);});});}exports[_0x26a5('0x1f')]=function(_0x59912f){var _0x160012=this;return new Promise(function(_0x78a972,_0x25b585){return db[_0x26a5('0x20')]['update'](_0x59912f['body'],{'raw':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59912f['options']?_0x59912f[_0x26a5('0x21')]['where']||null:null,'attributes':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')][_0x26a5('0x22')]||null:null,'limit':_0x59912f[_0x26a5('0x21')]?_0x59912f[_0x26a5('0x21')]['limit']||null:null})[_0x26a5('0x13')](function(_0x5220bd){logger[_0x26a5('0x1c')](_0x26a5('0x1f'),_0x59912f);logger[_0x26a5('0x15')](_0x26a5('0x1f'),_0x59912f,JSON[_0x26a5('0x17')](_0x5220bd));_0x78a972(_0x5220bd);})[_0x26a5('0x1e')](function(_0x1d2a27){logger[_0x26a5('0x18')](_0x26a5('0x1f'),_0x1d2a27['message'],_0x59912f);_0x25b585(_0x160012[_0x26a5('0x18')](0x1f4,_0x1d2a27['message']));});});};exports[_0x26a5('0x23')]=function(_0x490431){return new Promise(function(_0x3d5aaa,_0x165654){return db[_0x26a5('0x20')]['find']({'where':_0x490431['options']?_0x490431[_0x26a5('0x21')][_0x26a5('0x24')]||null:null})[_0x26a5('0x13')](function(_0x1d6dc7){if(_0x1d6dc7){return _0x1d6dc7['addTags'](_0x490431[_0x26a5('0x25')]['ids'],_[_0x26a5('0x26')](_0x490431[_0x26a5('0x25')],[_0x26a5('0x27'),'id'])||{});}})[_0x26a5('0x28')](function(_0x4dab80){logger[_0x26a5('0x1c')]('AddTags',_0x490431);logger[_0x26a5('0x15')](_0x26a5('0x29'),_0x490431,JSON['stringify'](_0x4dab80));_0x3d5aaa(_0x4dab80);})['catch'](function(_0x46f6c7){logger[_0x26a5('0x18')](_0x26a5('0x29'),_0x46f6c7[_0x26a5('0x1a')],_0x490431);_0x165654(_this['error'](0x1f4,_0x46f6c7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8ad2a05..f1cc187 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 _0xffe0=['remove','update','emit','register','length','./mailInteraction.events','save'];(function(_0x3f560e,_0x289aa8){var _0x5bf213=function(_0xcc2f71){while(--_0xcc2f71){_0x3f560e['push'](_0x3f560e['shift']());}};_0x5bf213(++_0x289aa8);}(_0xffe0,0xf3));var _0x0ffe=function(_0x2a43b5,_0x1182fa){_0x2a43b5=_0x2a43b5-0x0;var _0x4d29ef=_0xffe0[_0x2a43b5];return _0x4d29ef;};'use strict';var MailInteractionEvents=require(_0x0ffe('0x0'));var events=[_0x0ffe('0x1'),_0x0ffe('0x2'),_0x0ffe('0x3')];function createListener(_0x5316fb,_0xc8cbb1){return function(_0x201cc8){_0xc8cbb1[_0x0ffe('0x4')](_0x5316fb,_0x201cc8);};}function removeListener(_0x5da021,_0x12efa3){return function(){MailInteractionEvents['removeListener'](_0x5da021,_0x12efa3);};}exports[_0x0ffe('0x5')]=function(_0x1b19c8){for(var _0xa87a2e=0x0,_0x5d2609=events[_0x0ffe('0x6')];_0xa87a2e<_0x5d2609;_0xa87a2e++){var _0x578081=events[_0xa87a2e];var _0x1a40be=createListener('mailInteraction:'+_0x578081,_0x1b19c8);MailInteractionEvents['on'](_0x578081,_0x1a40be);}}; \ No newline at end of file +var _0x294a=['removeListener','register','length','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x294a,0x73));var _0xa294=function(_0x183b21,_0x271b8e){_0x183b21=_0x183b21-0x0;var _0x4dbe1b=_0x294a[_0x183b21];return _0x4dbe1b;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa294('0x0'),_0xa294('0x1'),_0xa294('0x2')];function createListener(_0x8a1c42,_0x39a131){return function(_0x3799b7){_0x39a131[_0xa294('0x3')](_0x8a1c42,_0x3799b7);};}function removeListener(_0x4e8564,_0x3d1fc4){return function(){MailInteractionEvents[_0xa294('0x4')](_0x4e8564,_0x3d1fc4);};}exports[_0xa294('0x5')]=function(_0xb05650){for(var _0x11a825=0x0,_0x5e9132=events[_0xa294('0x6')];_0x11a825<_0x5e9132;_0x11a825++){var _0x942deb=events[_0x11a825];var _0x32b36b=createListener('mailInteraction:'+_0x942deb,_0xb05650);MailInteractionEvents['on'](_0x942deb,_0x32b36b);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 77b69e4..3a3b0c5 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 _0xaed4=['./mailMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xaed4,0xf4));var _0x4aed=function(_0x2be86b,_0x77701){_0x2be86b=_0x2be86b-0x0;var _0x31b70b=_0xaed4[_0x2be86b];return _0x31b70b;};'use strict';var multer=require(_0x4aed('0x0'));var util=require('util');var path=require(_0x4aed('0x1'));var timeout=require(_0x4aed('0x2'));var express=require(_0x4aed('0x3'));var router=express[_0x4aed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4aed('0x5'));var interaction=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var controller=require(_0x4aed('0x8'));router[_0x4aed('0x9')]('/',auth['isAuthenticated'](),controller[_0x4aed('0xa')]);router[_0x4aed('0x9')](_0x4aed('0xb'),auth[_0x4aed('0xc')](),controller[_0x4aed('0xd')]);router['get'](_0x4aed('0xe'),auth['isAuthenticated'](),controller[_0x4aed('0xf')]);router[_0x4aed('0x9')](_0x4aed('0x10'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x11')]);router[_0x4aed('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4aed('0x13'),_0x4aed('0x14')),controller[_0x4aed('0x15')]);router[_0x4aed('0x16')]('/:id',auth[_0x4aed('0xc')](),controller['update']);router[_0x4aed('0x16')](_0x4aed('0x17'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x18')]);router[_0x4aed('0x16')]('/:id/reject',auth[_0x4aed('0xc')](),controller[_0x4aed('0x19')]);router[_0x4aed('0x1a')](_0x4aed('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4aed('0x1b')]=router; \ No newline at end of file +var _0x1a83=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports'];(function(_0x5de505,_0xee5804){var _0x1df98e=function(_0x80f4e5){while(--_0x80f4e5){_0x5de505['push'](_0x5de505['shift']());}};_0x1df98e(++_0xee5804);}(_0x1a83,0x1c0));var _0x31a8=function(_0x4287df,_0x347e1b){_0x4287df=_0x4287df-0x0;var _0x4dd842=_0x1a83[_0x4287df];return _0x4dd842;};'use strict';var multer=require(_0x31a8('0x0'));var util=require(_0x31a8('0x1'));var path=require(_0x31a8('0x2'));var timeout=require('connect-timeout');var express=require(_0x31a8('0x3'));var router=express['Router']();var fs_extra=require(_0x31a8('0x4'));var auth=require(_0x31a8('0x5'));var interaction=require(_0x31a8('0x6'));var config=require(_0x31a8('0x7'));var controller=require('./mailMessage.controller');router['get']('/',auth[_0x31a8('0x8')](),controller[_0x31a8('0x9')]);router[_0x31a8('0xa')](_0x31a8('0xb'),auth[_0x31a8('0x8')](),controller[_0x31a8('0xc')]);router[_0x31a8('0xa')](_0x31a8('0xd'),auth[_0x31a8('0x8')](),controller[_0x31a8('0xe')]);router['get'](_0x31a8('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x31a8('0x10')]('/',auth[_0x31a8('0x8')](),interaction['tracked'](_0x31a8('0x11'),_0x31a8('0x12')),controller[_0x31a8('0x13')]);router[_0x31a8('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x31a8('0x15')]);router['put'](_0x31a8('0x16'),auth['isAuthenticated'](),controller[_0x31a8('0x17')]);router[_0x31a8('0x14')](_0x31a8('0x18'),auth['isAuthenticated'](),controller[_0x31a8('0x19')]);router[_0x31a8('0x1a')]('/:id',auth[_0x31a8('0x8')](),controller['destroy']);module[_0x31a8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 71ffa10..7d8627f 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 _0x3337=['INTEGER','ENUM','Chat','Email','lodash','exports','TEXT','long','medium','BOOLEAN','out','STRING'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x3337,0xe8));var _0x7333=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x3337[_0x29632e];return _0x426e04;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7333('0x0'));module[_0x7333('0x1')]={'body':{'type':Sequelize[_0x7333('0x2')](_0x7333('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7333('0x2')](_0x7333('0x4'))},'read':{'type':Sequelize[_0x7333('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7333('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7333('0x7')](0x1fe)},'from':{'type':Sequelize[_0x7333('0x7')]},'to':{'type':Sequelize[_0x7333('0x2')](_0x7333('0x3'))},'cc':{'type':Sequelize[_0x7333('0x2')](_0x7333('0x3'))},'bcc':{'type':Sequelize[_0x7333('0x2')]('long')},'subject':{'type':Sequelize[_0x7333('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x7333('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7333('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x7333('0x2')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x7333('0x9')]('Email',_0x7333('0xa')),'defaultValue':_0x7333('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x6ffa=['medium','BOOLEAN','ENUM','out','STRING','DATE','Email','lodash','exports','TEXT','long'];(function(_0x5bfab9,_0x4701b0){var _0x30e836=function(_0xa55526){while(--_0xa55526){_0x5bfab9['push'](_0x5bfab9['shift']());}};_0x30e836(++_0x4701b0);}(_0x6ffa,0x80));var _0xa6ff=function(_0x5cf6ff,_0x1a9a03){_0x5cf6ff=_0x5cf6ff-0x0;var _0x40a548=_0x6ffa[_0x5cf6ff];return _0x40a548;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa6ff('0x0'));module[_0xa6ff('0x1')]={'body':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x4'))},'read':{'type':Sequelize[_0xa6ff('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa6ff('0x6')]('in',_0xa6ff('0x7')),'defaultValue':_0xa6ff('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa6ff('0x8')](0x1fe)},'from':{'type':Sequelize[_0xa6ff('0x8')]},'to':{'type':Sequelize[_0xa6ff('0x2')]('long')},'cc':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'bcc':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'subject':{'type':Sequelize[_0xa6ff('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa6ff('0x9')]},'originTo':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'originCc':{'type':Sequelize[_0xa6ff('0x2')](_0xa6ff('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0xa6ff('0xa'),'Chat'),'defaultValue':_0xa6ff('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 1dfadcf..0103475 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 _0x0dfd=['server','files','tmp','message-%s.eml','bcc','subject','createdAt','from','headers','Bcc','Attachments','existsSync','push','build','writeFileSync','unlinkSync','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','register','http','client','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','offset','undefined','count','set','json','destroy','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','body','catch','describe','create','MailAccount','MailAccountId','CmList','List','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','defaults','ListId','List\x20not\x20found','SendMail','update','YYYY-MM-DD\x20HH:mm:ss','accept','mail','format','UserId','user','agent','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','motionChannel','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','download','unix','toString'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x0dfd,0x138));var _0xd0df=function(_0x842523,_0x10e275){_0x842523=_0x842523-0x0;var _0x1274a8=_0x0dfd[_0x842523];return _0x1274a8;};'use strict';var emlformat=require('eml-format');var moment=require(_0xd0df('0x0'));var BPromise=require('bluebird');var util=require(_0xd0df('0x1'));var path=require(_0xd0df('0x2'));var fs=require('fs');var _=require(_0xd0df('0x3'));var Redis=require(_0xd0df('0x4'));var htmlToText=require(_0xd0df('0x5'));var qs=require(_0xd0df('0x6'));var logger=require(_0xd0df('0x7'))(_0xd0df('0x8'));var interaction_log=require(_0xd0df('0x7'))('mail-interactions');var config=require('../../config/environment');var db=require(_0xd0df('0x9'))['db'];config[_0xd0df('0xa')]=_['defaults'](config[_0xd0df('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0df('0xb'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xd0df('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd0df('0xd')]({'port':0x232c});var client9003=jayson[_0xd0df('0xe')][_0xd0df('0xd')]({'port':0x232b});var client9002=jayson[_0xd0df('0xe')][_0xd0df('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5842dd,_0x241eec,_0x5575b2,_0x2b95b6){return new BPromise(function(_0x2ce60e,_0xe2acc8){var _0x2ffd1f=_0x2b95b6||client;return _0x2ffd1f['request'](_0x5842dd,_0x5575b2)[_0xd0df('0xf')](function(_0x556a29){logger[_0xd0df('0x10')](_0xd0df('0x11'),_0x241eec,_0xd0df('0x12'));logger[_0xd0df('0x13')](_0xd0df('0x14'),_0x241eec,'request\x20sent',JSON[_0xd0df('0x15')](_0x556a29));if(_0x556a29[_0xd0df('0x16')]){if(_0x556a29['error'][_0xd0df('0x17')]===0x1f4){logger[_0xd0df('0x16')](_0xd0df('0x11'),_0x241eec,_0x556a29['error'][_0xd0df('0x18')]);return _0xe2acc8(_0x556a29['error'][_0xd0df('0x18')]);}logger[_0xd0df('0x16')](_0xd0df('0x11'),_0x241eec,_0x556a29[_0xd0df('0x16')]['message']);return _0x2ce60e(_0x556a29[_0xd0df('0x16')][_0xd0df('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x241eec,_0xd0df('0x12'));_0x2ce60e(_0x556a29[_0xd0df('0x19')][_0xd0df('0x18')]);}})['catch'](function(_0xeabc80){logger['error'](_0xd0df('0x11'),_0x241eec,_0xeabc80);_0xe2acc8(_0xeabc80);});});}function respondWithResult(_0x16ab2b,_0x5d8816){_0x5d8816=_0x5d8816||0xc8;return function(_0xd637e8){if(_0xd637e8){return _0x16ab2b[_0xd0df('0x1a')](_0x5d8816)['json'](_0xd637e8);}};}function respondWithFilteredResult(_0x3fe789,_0x36320d){return function(_0x15469f){if(_0x15469f){var _0x26a977=typeof _0x36320d[_0xd0df('0x1b')]===_0xd0df('0x1c')&&typeof _0x36320d['limit']===_0xd0df('0x1c');var _0x4d8a36=_0x15469f[_0xd0df('0x1d')];var _0x5786f9=_0x26a977?0x0:_0x36320d[_0xd0df('0x1b')];var _0x2610b5=_0x26a977?_0x15469f[_0xd0df('0x1d')]:_0x36320d['offset']+_0x36320d['limit'];var _0x139db6;if(_0x2610b5>=_0x4d8a36){_0x2610b5=_0x4d8a36;_0x139db6=0xc8;}else{_0x139db6=0xce;}_0x3fe789[_0xd0df('0x1a')](_0x139db6);return _0x3fe789[_0xd0df('0x1e')]('Content-Range',_0x5786f9+'-'+_0x2610b5+'/'+_0x4d8a36)[_0xd0df('0x1f')](_0x15469f);}return null;};}function saveUpdates(_0x1a52f6){return function(_0x2a7d52){if(_0x2a7d52){return _0x2a7d52['update'](_0x1a52f6)[_0xd0df('0xf')](function(_0x3bb5d3){return _0x3bb5d3;});}return null;};}function removeEntity(_0x40a69){return function(_0x27f344){if(_0x27f344){return _0x27f344[_0xd0df('0x20')]()['then'](function(){_0x40a69[_0xd0df('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x152308){return function(_0x299a4b){if(!_0x299a4b){_0x152308['sendStatus'](0x194);}return _0x299a4b;};}function handleError(_0x17af55,_0x3078aa){_0x3078aa=_0x3078aa||0x1f4;return function(_0x427824){logger[_0xd0df('0x16')](_0x427824['stack']);if(_0x427824['name']){delete _0x427824[_0xd0df('0x21')];}_0x17af55[_0xd0df('0x1a')](_0x3078aa)[_0xd0df('0x22')](_0x427824);};}exports[_0xd0df('0x23')]=function(_0x470105,_0x2be239){var _0x3f83eb={},_0x55aed0={},_0x4958de={'count':0x0,'rows':[]};var _0x125343=_[_0xd0df('0x24')](db[_0xd0df('0x25')][_0xd0df('0x26')],function(_0x37aa3e){return{'name':_0x37aa3e[_0xd0df('0x27')],'type':_0x37aa3e[_0xd0df('0x28')][_0xd0df('0x29')]};});_0x55aed0[_0xd0df('0x2a')]=_[_0xd0df('0x24')](_0x125343,_0xd0df('0x21'));_0x55aed0[_0xd0df('0x2b')]=_[_0xd0df('0x2c')](_0x470105[_0xd0df('0x2b')]);_0x55aed0[_0xd0df('0x2d')]=_[_0xd0df('0x2e')](_0x55aed0[_0xd0df('0x2a')],_0x55aed0[_0xd0df('0x2b')]);_0x3f83eb[_0xd0df('0x2f')]=_[_0xd0df('0x2e')](_0x55aed0[_0xd0df('0x2a')],qs['fields'](_0x470105[_0xd0df('0x2b')][_0xd0df('0x30')]));_0x3f83eb[_0xd0df('0x2f')]=_0x3f83eb[_0xd0df('0x2f')][_0xd0df('0x31')]?_0x3f83eb['attributes']:_0x55aed0[_0xd0df('0x2a')];if(!_0x470105[_0xd0df('0x2b')][_0xd0df('0x32')](_0xd0df('0x33'))){_0x3f83eb['limit']=qs[_0xd0df('0x34')](_0x470105[_0xd0df('0x2b')]['limit']);_0x3f83eb[_0xd0df('0x1b')]=qs[_0xd0df('0x1b')](_0x470105[_0xd0df('0x2b')][_0xd0df('0x1b')]);}_0x3f83eb[_0xd0df('0x35')]=qs['sort'](_0x470105[_0xd0df('0x2b')][_0xd0df('0x36')]);_0x3f83eb[_0xd0df('0x37')]=qs[_0xd0df('0x2d')](_['pick'](_0x470105[_0xd0df('0x2b')],_0x55aed0[_0xd0df('0x2d')]),_0x125343);if(_0x470105['query']['filter']){_0x3f83eb[_0xd0df('0x37')]=_[_0xd0df('0x38')](_0x3f83eb[_0xd0df('0x37')],{'$or':_[_0xd0df('0x24')](_0x125343,function(_0x36c30a){if(_0x36c30a['type']!==_0xd0df('0x39')){var _0x15f24a={};_0x15f24a[_0x36c30a[_0xd0df('0x21')]]={'$like':'%'+_0x470105[_0xd0df('0x2b')][_0xd0df('0x3a')]+'%'};return _0x15f24a;}})});}_0x3f83eb=_['merge']({},_0x3f83eb,_0x470105[_0xd0df('0x3b')]);var _0x2013aa={'where':_0x3f83eb['where']};return db[_0xd0df('0x25')][_0xd0df('0x1d')](_0x2013aa)['then'](function(_0x1fa11a){_0x4958de[_0xd0df('0x1d')]=_0x1fa11a;if(_0x470105[_0xd0df('0x2b')][_0xd0df('0x3c')]){_0x3f83eb[_0xd0df('0x3d')]=[{'all':!![]}];}return db[_0xd0df('0x25')]['findAll'](_0x3f83eb);})['then'](function(_0x3ff2c5){_0x4958de[_0xd0df('0x3e')]=_0x3ff2c5;return _0x4958de;})[_0xd0df('0xf')](respondWithFilteredResult(_0x2be239,_0x3f83eb))['catch'](handleError(_0x2be239,null));};exports[_0xd0df('0x3f')]=function(_0x294630,_0x31d3cd){var _0x53742c={'raw':!![],'where':{'id':_0x294630[_0xd0df('0x40')]['id']}},_0x48dcb8={};_0x48dcb8[_0xd0df('0x2a')]=_['keys'](db[_0xd0df('0x25')]['rawAttributes']);_0x48dcb8['query']=_[_0xd0df('0x2c')](_0x294630[_0xd0df('0x2b')]);_0x48dcb8[_0xd0df('0x2d')]=_[_0xd0df('0x2e')](_0x48dcb8[_0xd0df('0x2a')],_0x48dcb8[_0xd0df('0x2b')]);_0x53742c[_0xd0df('0x2f')]=_[_0xd0df('0x2e')](_0x48dcb8['model'],qs[_0xd0df('0x30')](_0x294630[_0xd0df('0x2b')][_0xd0df('0x30')]));_0x53742c['attributes']=_0x53742c[_0xd0df('0x2f')][_0xd0df('0x31')]?_0x53742c[_0xd0df('0x2f')]:_0x48dcb8[_0xd0df('0x2a')];if(_0x294630[_0xd0df('0x2b')][_0xd0df('0x3c')]){_0x53742c['include']=[{'all':!![]}];}_0x53742c=_['merge']({},_0x53742c,_0x294630[_0xd0df('0x3b')]);return db[_0xd0df('0x25')][_0xd0df('0x41')](_0x53742c)['then'](handleEntityNotFound(_0x31d3cd,null))[_0xd0df('0xf')](respondWithResult(_0x31d3cd,null))['catch'](handleError(_0x31d3cd,null));};exports['update']=function(_0x52d78e,_0x11613c){if(_0x52d78e[_0xd0df('0x42')]['id']){delete _0x52d78e[_0xd0df('0x42')]['id'];}return db[_0xd0df('0x25')][_0xd0df('0x41')]({'where':{'id':_0x52d78e[_0xd0df('0x40')]['id']}})[_0xd0df('0xf')](handleEntityNotFound(_0x11613c,null))[_0xd0df('0xf')](saveUpdates(_0x52d78e['body'],null))[_0xd0df('0xf')](respondWithResult(_0x11613c,null))[_0xd0df('0x43')](handleError(_0x11613c,null));};exports[_0xd0df('0x20')]=function(_0x5aa2c1,_0x1b7bed){return db[_0xd0df('0x25')]['find']({'where':{'id':_0x5aa2c1['params']['id']}})['then'](handleEntityNotFound(_0x1b7bed,null))[_0xd0df('0xf')](removeEntity(_0x1b7bed,null))[_0xd0df('0x43')](handleError(_0x1b7bed,null));};exports[_0xd0df('0x44')]=function(_0x70a165,_0x35248a){return db[_0xd0df('0x25')][_0xd0df('0x44')]()['then'](respondWithResult(_0x35248a,null))['catch'](handleError(_0x35248a,null));};exports[_0xd0df('0x45')]=function(_0x4be966,_0x3c78cd){return db[_0xd0df('0x25')][_0xd0df('0x45')](_0x4be966[_0xd0df('0x42')])[_0xd0df('0xf')](function(_0x4165e1){if(_0x4165e1){if(_0x4165e1['direction']==='out'&&!_0x4165e1['secret']){var _0x478ab5,_0x2758b4,_0x5c4a1b;if(_0x4be966[_0xd0df('0x42')]['to']){_0x2758b4=_0x4be966[_0xd0df('0x42')]['to']['split'](',')[0x0];}return db[_0xd0df('0x46')]['findOne']({'where':{'id':_0x4165e1[_0xd0df('0x47')]},'include':[{'model':db[_0xd0df('0x48')],'as':_0xd0df('0x49'),'include':[{'model':db['CmContact'],'as':_0xd0df('0x4a'),'where':{'email':_0x2758b4},'limit':0x1,'order':[[_0xd0df('0x4b'),'DESC']]}]},{'model':db[_0xd0df('0x4c')],'as':_0xd0df('0x4d'),'raw':!![],'include':[{'model':db[_0xd0df('0x4e')],'as':_0xd0df('0x4e'),'raw':!![]}]}]})['then'](function(_0x5e90fc){_0x478ab5=_0x5e90fc;if(!_0x478ab5||!_0x478ab5[_0xd0df('0x4d')])return;var _0x230a80=_0x478ab5[_0xd0df('0x4f')]();if(_0x4be966[_0xd0df('0x42')][_0xd0df('0x50')]&&_0x4be966['body'][_0xd0df('0x50')][_0xd0df('0x31')]){for(var _0x29e025=0x0;_0x29e025<_0x4be966[_0xd0df('0x42')][_0xd0df('0x50')][_0xd0df('0x31')];_0x29e025+=0x1){_0x4be966[_0xd0df('0x42')][_0xd0df('0x50')][_0x29e025]={'filename':_0x4be966[_0xd0df('0x42')][_0xd0df('0x50')][_0x29e025][_0xd0df('0x21')],'path':path[_0xd0df('0x51')](config[_0xd0df('0x52')],_0xd0df('0x53'),_0x4be966['body'][_0xd0df('0x50')][_0x29e025][_0xd0df('0x54')])};}}_0x5c4a1b={'account':_0x230a80,'message':_0x4be966[_0xd0df('0x42')]};return;})[_0xd0df('0xf')](function(){if(_0x478ab5[_0xd0df('0x49')]){if(_0x478ab5[_0xd0df('0x49')]['Contacts'][_0xd0df('0x31')]){return _0x478ab5['List'][_0xd0df('0x4a')][0x0];}else{return db[_0xd0df('0x55')][_0xd0df('0x45')](_[_0xd0df('0x56')](_0x4be966[_0xd0df('0x42')],{'firstName':_0x4be966[_0xd0df('0x42')]['to'],'email':_0x4be966[_0xd0df('0x42')]['to'],'phone':_0x4be966['body']['to'],'ListId':_0x478ab5[_0xd0df('0x57')]}));}}else{throw new Error(_0xd0df('0x58'));}})[_0xd0df('0xf')](function(){if(_0x5c4a1b){return respondWithRpcPromise(_0xd0df('0x59'),'sendMail',_0x5c4a1b,client9003)[_0xd0df('0xf')](function(_0x3a038c){return _0x4165e1[_0xd0df('0x5a')]({'read':!![],'messageId':_0x3a038c['messageId'],'sentAt':moment()['format'](_0xd0df('0x5b'))});})['catch'](function(_0x4e4332){logger[_0xd0df('0x16')]('%s',JSON['stringify'](_0x4e4332));return _0x4165e1;});}return _0x4165e1;});}return _0x4165e1;}})[_0xd0df('0xf')](respondWithResult(_0x3c78cd,0xc9))['catch'](handleError(_0x3c78cd,null));};exports[_0xd0df('0x5c')]=function(_0x5c6d2a,_0x456ba4){var _0x17ac80={'agent':{},'channel':_0xd0df('0x5d')};if(_0x5c6d2a['body']['id']){delete _0x5c6d2a['body']['id'];}_0x5c6d2a[_0xd0df('0x42')]['read']=!![];_0x5c6d2a[_0xd0df('0x42')]['readAt']=moment()[_0xd0df('0x5e')](_0xd0df('0x5b'));_0x5c6d2a[_0xd0df('0x42')]['UserId']=_0x5c6d2a[_0xd0df('0x42')][_0xd0df('0x5f')]||_0x5c6d2a[_0xd0df('0x60')]['id'];_0x17ac80[_0xd0df('0x61')]['id']=_0x5c6d2a[_0xd0df('0x42')]['UserId'];return db[_0xd0df('0x25')][_0xd0df('0x41')]({'where':{'id':_0x5c6d2a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x456ba4,null))['then'](saveUpdates(_0x5c6d2a['body'],null))[_0xd0df('0xf')](function(_0x5e9569){if(_0x5e9569){_0x17ac80[_0xd0df('0x18')]=_0x5e9569['get']({'plain':!![]});return db[_0xd0df('0x62')][_0xd0df('0x41')]({'where':{'id':_0x5e9569[_0xd0df('0x63')]}});}return null;})[_0xd0df('0xf')](handleEntityNotFound(_0x456ba4,null))[_0xd0df('0xf')](function(_0x4094f4){if(_0x4094f4){return _0x4094f4[_0xd0df('0x5a')]({'UserId':_0x5c6d2a[_0xd0df('0x42')][_0xd0df('0x5f')],'read1stAt':_['isNil'](_0x4094f4[_0xd0df('0x64')])?moment()[_0xd0df('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd0df('0xf')](function(_0x46561b){if(_0x46561b){_0x17ac80[_0xd0df('0x65')]=_0x46561b[_0xd0df('0x66')]({'plain':!![]});interaction_log[_0xd0df('0x10')](_0xd0df('0x67'),_0x5c6d2a[_0xd0df('0x60')]['id'],_0x5c6d2a['user']['name'],_0x5c6d2a[_0xd0df('0x60')][_0xd0df('0x68')],_0x17ac80['interaction']['id'],_0x5c6d2a[_0xd0df('0x42')]?JSON[_0xd0df('0x15')](_0x5c6d2a['body']):_0xd0df('0x69'));return respondWithRpcPromise(_0xd0df('0x6a'),'acceptMessage',_0x17ac80);}return null;})[_0xd0df('0xf')](function(_0x163929){var _0x2ccdfb=_0xd0df('0x6b')+_0x163929[_0xd0df('0x18')][_0xd0df('0x6c')];return db[_0xd0df('0x6d')][_0xd0df('0x2b')](_0x2ccdfb,{'type':db[_0xd0df('0x6e')][_0xd0df('0x6f')][_0xd0df('0x70')],'raw':!![]})[_0xd0df('0xf')](function(_0x11e039){return _0x11e039;});})[_0xd0df('0xf')](function(_0x89f81d){if(_0x89f81d){_0x17ac80['message']['contact']=_0x89f81d[0x0];if(!_0x5c6d2a[_0xd0df('0x42')][_0xd0df('0x5f')])return;return db[_0xd0df('0x71')][_0xd0df('0x41')]({'where':{'id':_0x5c6d2a['body'][_0xd0df('0x5f')],'role':_0xd0df('0x61')},'attributes':['id','name',_0xd0df('0x72'),_0xd0df('0x73'),_0xd0df('0x74')],'raw':!![]});}return null;})[_0xd0df('0xf')](function(_0x488347){if(!_0x488347)return null;_0x17ac80[_0xd0df('0x18')]['agent']=_0x488347;return _0x17ac80;})['then'](function(_0x307f0b){if(_0x307f0b){if(_0x5c6d2a['body'][_0xd0df('0x75')]){_0x17ac80[_0xd0df('0x18')][_0xd0df('0x76')]=util[_0xd0df('0x5e')]('SIP/%s',_0x5c6d2a[_0xd0df('0x60')][_0xd0df('0x21')]);_0x17ac80[_0xd0df('0x18')]['channel']=_0x17ac80['channel'];_0x17ac80[_0xd0df('0x18')][_0xd0df('0x77')]=_0x17ac80[_0xd0df('0x78')];_0x17ac80[_0xd0df('0x18')][_0xd0df('0x79')]=_0xd0df('0x5c');_0x17ac80[_0xd0df('0x18')][_0xd0df('0x42')]=htmlToText[_0xd0df('0x7a')](_0x17ac80[_0xd0df('0x18')][_0xd0df('0x42')]);return respondWithRpcPromise(_0xd0df('0x7b'),'EventManager',{'event':_0xd0df('0x7c'),'message':_0x17ac80[_0xd0df('0x18')]},client9002)['then'](function(){return _0x17ac80;});}return _0x17ac80;}return null;})[_0xd0df('0xf')](respondWithResult(_0x456ba4,null))[_0xd0df('0x43')](handleError(_0x456ba4,null));};exports[_0xd0df('0x7d')]=function(_0x491a87,_0x4bec13){var _0x14f86e={'agent':{},'channel':_0xd0df('0x5d')};if(_0x491a87[_0xd0df('0x42')]['id']){delete _0x491a87['body']['id'];}_0x491a87[_0xd0df('0x42')][_0xd0df('0x5f')]=_0x491a87['body'][_0xd0df('0x5f')]||_0x491a87[_0xd0df('0x60')]['id'];_0x14f86e[_0xd0df('0x61')]['id']=_0x491a87[_0xd0df('0x42')]['UserId'];return db['MailMessage'][_0xd0df('0x41')]({'where':{'id':_0x491a87[_0xd0df('0x40')]['id'],'UserId':null}})[_0xd0df('0xf')](handleEntityNotFound(_0x4bec13,null))[_0xd0df('0xf')](function(_0x42437e){if(_0x42437e){_0x14f86e[_0xd0df('0x18')]=_0x42437e[_0xd0df('0x66')]({'plain':!![]});return db['MailInteraction'][_0xd0df('0x41')]({'where':{'id':_0x42437e[_0xd0df('0x63')]}});}return null;})[_0xd0df('0xf')](handleEntityNotFound(_0x4bec13,null))['then'](function(_0x2cad3b){if(_0x2cad3b){_0x14f86e[_0xd0df('0x65')]=_0x2cad3b[_0xd0df('0x66')]({'plain':!![]});interaction_log['info'](_0xd0df('0x7e'),_0x491a87[_0xd0df('0x60')]['id'],_0x491a87[_0xd0df('0x60')][_0xd0df('0x21')],_0x491a87[_0xd0df('0x60')][_0xd0df('0x68')],_0x14f86e[_0xd0df('0x65')]['id'],_0x491a87[_0xd0df('0x42')]?JSON[_0xd0df('0x15')](_0x491a87[_0xd0df('0x42')]):_0xd0df('0x69'));return respondWithRpcPromise('RejectMessage',_0xd0df('0x7f'),_0x14f86e);}return null;})[_0xd0df('0xf')](function(_0x19a2c1){var _0x470a40='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x19a2c1[_0xd0df('0x18')][_0xd0df('0x6c')];return db['sequelize'][_0xd0df('0x2b')](_0x470a40,{'type':db[_0xd0df('0x6e')][_0xd0df('0x6f')][_0xd0df('0x70')],'raw':!![]})[_0xd0df('0xf')](function(_0xe2d2a6){return _0xe2d2a6;});})[_0xd0df('0xf')](function(_0x54c7c8){if(_0x54c7c8){_0x14f86e['message'][_0xd0df('0x80')]=_0x54c7c8[0x0];if(!_0x491a87[_0xd0df('0x42')]['UserId'])return;return db['User'][_0xd0df('0x41')]({'where':{'id':_0x491a87[_0xd0df('0x42')][_0xd0df('0x5f')],'role':_0xd0df('0x61')},'attributes':['id',_0xd0df('0x21'),_0xd0df('0x72'),_0xd0df('0x73'),_0xd0df('0x74')],'raw':!![]});}return null;})[_0xd0df('0xf')](function(_0x2975cd){if(!_0x2975cd)return null;_0x14f86e[_0xd0df('0x18')]['agent']=_0x2975cd;return _0x14f86e;})[_0xd0df('0xf')](function(_0x589c53){if(_0x589c53){_0x589c53[_0xd0df('0x18')][_0xd0df('0x76')]=util[_0xd0df('0x5e')]('SIP/%s',_0x491a87[_0xd0df('0x60')][_0xd0df('0x21')]);_0x589c53[_0xd0df('0x18')][_0xd0df('0x78')]=_0x14f86e['channel'];_0x589c53['message'][_0xd0df('0x77')]=_0x14f86e[_0xd0df('0x78')];_0x589c53['message']['event']='reject';_0x589c53[_0xd0df('0x18')][_0xd0df('0x42')]=htmlToText[_0xd0df('0x7a')](_0x14f86e[_0xd0df('0x18')][_0xd0df('0x42')]);respondWithRpcPromise(_0xd0df('0x7b'),_0xd0df('0x7b'),{'event':'rejectmessage','message':_0x589c53[_0xd0df('0x18')]},client9002);return _0x14f86e;}return null;})['then'](respondWithResult(_0x4bec13,null))['catch'](handleError(_0x4bec13,null));};exports[_0xd0df('0x81')]=function(_0x5ba505,_0x3a2cdb){var _0x3af396=moment()[_0xd0df('0x82')]()[_0xd0df('0x83')]();var _0x40cd61=path['join'](config[_0xd0df('0x52')],_0xd0df('0x84'),_0xd0df('0x85'),_0xd0df('0x86'));var _0xc3e8a0=path[_0xd0df('0x51')](config[_0xd0df('0x52')],'server','files',_0xd0df('0x50'));var _0x136da6=util[_0xd0df('0x5e')](_0xd0df('0x87'),_0x3af396);return db[_0xd0df('0x25')][_0xd0df('0x41')]({'where':{'id':_0x5ba505[_0xd0df('0x40')]['id']},'attributes':['id',_0xd0df('0x42'),'from','to','cc',_0xd0df('0x88'),_0xd0df('0x89'),_0xd0df('0x8a')],'include':_0x5ba505[_0xd0df('0x2b')][_0xd0df('0x50')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xd0df('0xf')](handleEntityNotFound(_0x3a2cdb,null))['then'](function(_0x1880bd){if(_0x1880bd){var _0x74536d=_0x1880bd;var _0x19c948={'from':_0x74536d[_0xd0df('0x8b')],'to':_0x74536d['to'],'subject':_0x74536d[_0xd0df('0x89')],'html':htmlEntities['decode'](_0x74536d[_0xd0df('0x42')]),'headers':{'Date':moment(_0x74536d[_0xd0df('0x8a')])[_0xd0df('0x5e')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1880bd['cc']){_0x19c948[_0xd0df('0x8c')]['Cc']=_0x1880bd['cc'];}if(_0x1880bd['bcc']){_0x19c948[_0xd0df('0x8c')][_0xd0df('0x8d')]=_0x1880bd[_0xd0df('0x88')];}return new BPromise(function(_0x14458e,_0x42f64f){if(_0x1880bd[_0xd0df('0x8e')]){for(var _0x3f44d1=0x0;_0x3f44d1<_0x1880bd[_0xd0df('0x8e')][_0xd0df('0x31')];_0x3f44d1++){var _0xfde370=_0x1880bd['Attachments'][_0x3f44d1];var _0x35382a=path[_0xd0df('0x51')](_0xc3e8a0,_0xfde370[_0xd0df('0x54')]);if(fs[_0xd0df('0x8f')](_0x35382a)){_0x19c948[_0xd0df('0x50')][_0xd0df('0x90')]({'name':_0xfde370[_0xd0df('0x21')],'contentType':_0xfde370['type'],'data':fs['readFileSync'](_0x35382a)});}}}emlformat[_0xd0df('0x91')](_0x19c948,function(_0x16bbe8,_0x480a01){if(_0x16bbe8)return _0x42f64f(_0x16bbe8);fs[_0xd0df('0x92')](path[_0xd0df('0x51')](_0x40cd61,_0x136da6),_0x480a01);return _0x14458e(_0x480a01);});});}})['then'](function(_0x2e0716){if(_0x2e0716){return _0x3a2cdb[_0xd0df('0x81')](path[_0xd0df('0x51')](_0x40cd61,_0x136da6),_0x136da6,function(_0x47b3cf){if(!_0x47b3cf)fs[_0xd0df('0x93')](path[_0xd0df('0x51')](_0x40cd61,_0x136da6));});}})[_0xd0df('0x43')](handleError(_0x3a2cdb,null));}; \ No newline at end of file +var _0x591b=['end','sendStatus','stack','name','send','index','MailMessage','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','List','CmContact','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE: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','contact','User','email','interface','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','motionChannel','event','rejectmessage','download','server','tmp','files','message-%s.eml','subject','createdAt','Attachments','decode','headers','bcc','Bcc','basename','push','type','build','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','redis','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy'];(function(_0x3f6426,_0x12cbf9){var _0x25d790=function(_0x3c6756){while(--_0x3c6756){_0x3f6426['push'](_0x3f6426['shift']());}};_0x25d790(++_0x12cbf9);}(_0x591b,0x77));var _0xb591=function(_0x1a7352,_0x1b50c2){_0x1a7352=_0x1a7352-0x0;var _0x533af4=_0x591b[_0x1a7352];return _0x533af4;};'use strict';var emlformat=require(_0xb591('0x0'));var moment=require(_0xb591('0x1'));var BPromise=require('bluebird');var util=require(_0xb591('0x2'));var path=require(_0xb591('0x3'));var fs=require('fs');var _=require(_0xb591('0x4'));var Redis=require(_0xb591('0x5'));var htmlToText=require(_0xb591('0x6'));var qs=require(_0xb591('0x7'));var logger=require('../../config/logger')(_0xb591('0x8'));var interaction_log=require(_0xb591('0x9'))('mail-interactions');var config=require(_0xb591('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb591('0xb')](config['redis'],{'host':_0xb591('0xc'),'port':0x18eb});var socket=require(_0xb591('0xd'))(new Redis(config[_0xb591('0xe')]));var htmlEntities=require(_0xb591('0xf'));require(_0xb591('0x10'))[_0xb591('0x11')](socket);var jayson=require(_0xb591('0x12'));var client=jayson['client'][_0xb591('0x13')]({'port':0x232c});var client9003=jayson[_0xb591('0x14')][_0xb591('0x13')]({'port':0x232b});var client9002=jayson[_0xb591('0x14')][_0xb591('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x52b404,_0x41cea2,_0x4b42c9,_0x58b4ed){return new BPromise(function(_0x25d347,_0x3d1f7c){var _0x566cf5=_0x58b4ed||client;return _0x566cf5['request'](_0x52b404,_0x4b42c9)['then'](function(_0x5b6043){logger['info']('MailMessage,\x20%s,\x20%s',_0x41cea2,_0xb591('0x15'));logger['debug'](_0xb591('0x16'),_0x41cea2,_0xb591('0x15'),JSON[_0xb591('0x17')](_0x5b6043));if(_0x5b6043['error']){if(_0x5b6043[_0xb591('0x18')][_0xb591('0x19')]===0x1f4){logger[_0xb591('0x18')](_0xb591('0x1a'),_0x41cea2,_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);return _0x3d1f7c(_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);}logger[_0xb591('0x18')](_0xb591('0x1a'),_0x41cea2,_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);return _0x25d347(_0x5b6043[_0xb591('0x18')][_0xb591('0x1b')]);}else{logger[_0xb591('0x1c')]('MailMessage,\x20%s,\x20%s',_0x41cea2,_0xb591('0x15'));_0x25d347(_0x5b6043[_0xb591('0x1d')]['message']);}})['catch'](function(_0x1e428b){logger[_0xb591('0x18')](_0xb591('0x1a'),_0x41cea2,_0x1e428b);_0x3d1f7c(_0x1e428b);});});}function respondWithResult(_0x10bfff,_0x24d771){_0x24d771=_0x24d771||0xc8;return function(_0x490859){if(_0x490859){return _0x10bfff[_0xb591('0x1e')](_0x24d771)[_0xb591('0x1f')](_0x490859);}};}function respondWithFilteredResult(_0x150de1,_0x295977){return function(_0x11755b){if(_0x11755b){var _0x1d648f=typeof _0x295977[_0xb591('0x20')]==='undefined'&&typeof _0x295977[_0xb591('0x21')]===_0xb591('0x22');var _0x2503dd=_0x11755b[_0xb591('0x23')];var _0x3b29ea=_0x1d648f?0x0:_0x295977[_0xb591('0x20')];var _0x4a3095=_0x1d648f?_0x11755b[_0xb591('0x23')]:_0x295977[_0xb591('0x20')]+_0x295977[_0xb591('0x21')];var _0x216363;if(_0x4a3095>=_0x2503dd){_0x4a3095=_0x2503dd;_0x216363=0xc8;}else{_0x216363=0xce;}_0x150de1[_0xb591('0x1e')](_0x216363);return _0x150de1[_0xb591('0x24')](_0xb591('0x25'),_0x3b29ea+'-'+_0x4a3095+'/'+_0x2503dd)[_0xb591('0x1f')](_0x11755b);}return null;};}function saveUpdates(_0x46439e){return function(_0x58578a){if(_0x58578a){return _0x58578a[_0xb591('0x26')](_0x46439e)[_0xb591('0x27')](function(_0x1e231a){return _0x1e231a;});}return null;};}function removeEntity(_0xeabf70){return function(_0x1f4d3c){if(_0x1f4d3c){return _0x1f4d3c[_0xb591('0x28')]()[_0xb591('0x27')](function(){_0xeabf70['status'](0xcc)[_0xb591('0x29')]();});}};}function handleEntityNotFound(_0x93a158){return function(_0x44688d){if(!_0x44688d){_0x93a158[_0xb591('0x2a')](0x194);}return _0x44688d;};}function handleError(_0x40f356,_0x40b910){_0x40b910=_0x40b910||0x1f4;return function(_0x3e5106){logger[_0xb591('0x18')](_0x3e5106[_0xb591('0x2b')]);if(_0x3e5106[_0xb591('0x2c')]){delete _0x3e5106['name'];}_0x40f356[_0xb591('0x1e')](_0x40b910)[_0xb591('0x2d')](_0x3e5106);};}exports[_0xb591('0x2e')]=function(_0x5eba2c,_0x2b0bdc){var _0x4c41dc={},_0x2b3011={},_0x20a6f2={'count':0x0,'rows':[]};var _0x1b3ff0=_['map'](db[_0xb591('0x2f')]['rawAttributes'],function(_0x313e72){return{'name':_0x313e72[_0xb591('0x30')],'type':_0x313e72['type'][_0xb591('0x31')]};});_0x2b3011['model']=_[_0xb591('0x32')](_0x1b3ff0,_0xb591('0x2c'));_0x2b3011[_0xb591('0x33')]=_[_0xb591('0x34')](_0x5eba2c[_0xb591('0x33')]);_0x2b3011[_0xb591('0x35')]=_[_0xb591('0x36')](_0x2b3011[_0xb591('0x37')],_0x2b3011[_0xb591('0x33')]);_0x4c41dc['attributes']=_[_0xb591('0x36')](_0x2b3011[_0xb591('0x37')],qs[_0xb591('0x38')](_0x5eba2c[_0xb591('0x33')]['fields']));_0x4c41dc[_0xb591('0x39')]=_0x4c41dc[_0xb591('0x39')][_0xb591('0x3a')]?_0x4c41dc['attributes']:_0x2b3011[_0xb591('0x37')];if(!_0x5eba2c[_0xb591('0x33')]['hasOwnProperty']('nolimit')){_0x4c41dc[_0xb591('0x21')]=qs[_0xb591('0x21')](_0x5eba2c[_0xb591('0x33')][_0xb591('0x21')]);_0x4c41dc[_0xb591('0x20')]=qs['offset'](_0x5eba2c[_0xb591('0x33')][_0xb591('0x20')]);}_0x4c41dc[_0xb591('0x3b')]=qs['sort'](_0x5eba2c['query'][_0xb591('0x3c')]);_0x4c41dc[_0xb591('0x3d')]=qs[_0xb591('0x35')](_[_0xb591('0x3e')](_0x5eba2c[_0xb591('0x33')],_0x2b3011[_0xb591('0x35')]),_0x1b3ff0);if(_0x5eba2c['query'][_0xb591('0x3f')]){_0x4c41dc['where']=_[_0xb591('0x40')](_0x4c41dc[_0xb591('0x3d')],{'$or':_[_0xb591('0x32')](_0x1b3ff0,function(_0x1c6225){if(_0x1c6225['type']!==_0xb591('0x41')){var _0x2ff51b={};_0x2ff51b[_0x1c6225[_0xb591('0x2c')]]={'$like':'%'+_0x5eba2c[_0xb591('0x33')][_0xb591('0x3f')]+'%'};return _0x2ff51b;}})});}_0x4c41dc=_[_0xb591('0x40')]({},_0x4c41dc,_0x5eba2c[_0xb591('0x42')]);var _0x362208={'where':_0x4c41dc[_0xb591('0x3d')]};return db[_0xb591('0x2f')][_0xb591('0x23')](_0x362208)[_0xb591('0x27')](function(_0x209711){_0x20a6f2[_0xb591('0x23')]=_0x209711;if(_0x5eba2c[_0xb591('0x33')][_0xb591('0x43')]){_0x4c41dc[_0xb591('0x44')]=[{'all':!![]}];}return db[_0xb591('0x2f')][_0xb591('0x45')](_0x4c41dc);})[_0xb591('0x27')](function(_0x4a37da){_0x20a6f2[_0xb591('0x46')]=_0x4a37da;return _0x20a6f2;})[_0xb591('0x27')](respondWithFilteredResult(_0x2b0bdc,_0x4c41dc))[_0xb591('0x47')](handleError(_0x2b0bdc,null));};exports[_0xb591('0x48')]=function(_0x2736c5,_0xf8d937){var _0x593adc={'raw':!![],'where':{'id':_0x2736c5[_0xb591('0x49')]['id']}},_0x209c1e={};_0x209c1e[_0xb591('0x37')]=_[_0xb591('0x34')](db[_0xb591('0x2f')][_0xb591('0x4a')]);_0x209c1e[_0xb591('0x33')]=_[_0xb591('0x34')](_0x2736c5[_0xb591('0x33')]);_0x209c1e[_0xb591('0x35')]=_[_0xb591('0x36')](_0x209c1e['model'],_0x209c1e['query']);_0x593adc[_0xb591('0x39')]=_[_0xb591('0x36')](_0x209c1e['model'],qs[_0xb591('0x38')](_0x2736c5[_0xb591('0x33')]['fields']));_0x593adc['attributes']=_0x593adc[_0xb591('0x39')]['length']?_0x593adc[_0xb591('0x39')]:_0x209c1e[_0xb591('0x37')];if(_0x2736c5[_0xb591('0x33')][_0xb591('0x43')]){_0x593adc['include']=[{'all':!![]}];}_0x593adc=_[_0xb591('0x40')]({},_0x593adc,_0x2736c5['options']);return db[_0xb591('0x2f')][_0xb591('0x4b')](_0x593adc)['then'](handleEntityNotFound(_0xf8d937,null))[_0xb591('0x27')](respondWithResult(_0xf8d937,null))[_0xb591('0x47')](handleError(_0xf8d937,null));};exports[_0xb591('0x26')]=function(_0x44d637,_0x46dfd0){if(_0x44d637['body']['id']){delete _0x44d637['body']['id'];}return db['MailMessage'][_0xb591('0x4b')]({'where':{'id':_0x44d637[_0xb591('0x49')]['id']}})[_0xb591('0x27')](handleEntityNotFound(_0x46dfd0,null))[_0xb591('0x27')](saveUpdates(_0x44d637[_0xb591('0x4c')],null))[_0xb591('0x27')](respondWithResult(_0x46dfd0,null))[_0xb591('0x47')](handleError(_0x46dfd0,null));};exports[_0xb591('0x28')]=function(_0x3803,_0x5ab046){return db[_0xb591('0x2f')]['find']({'where':{'id':_0x3803[_0xb591('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ab046,null))['then'](removeEntity(_0x5ab046,null))[_0xb591('0x47')](handleError(_0x5ab046,null));};exports[_0xb591('0x4d')]=function(_0x288308,_0x389371){return db[_0xb591('0x2f')][_0xb591('0x4d')]()[_0xb591('0x27')](respondWithResult(_0x389371,null))[_0xb591('0x47')](handleError(_0x389371,null));};exports[_0xb591('0x4e')]=function(_0x5a10b4,_0x446317){return db[_0xb591('0x2f')][_0xb591('0x4e')](_0x5a10b4[_0xb591('0x4c')])['then'](function(_0x3cd14d){if(_0x3cd14d){if(_0x3cd14d[_0xb591('0x4f')]===_0xb591('0x50')&&!_0x3cd14d[_0xb591('0x51')]){var _0x55d45b,_0xe6a12e,_0xaafa81;if(_0x5a10b4[_0xb591('0x4c')]['to']){_0xe6a12e=_0x5a10b4[_0xb591('0x4c')]['to'][_0xb591('0x52')](',')[0x0];}return db[_0xb591('0x53')][_0xb591('0x54')]({'where':{'id':_0x3cd14d[_0xb591('0x55')]},'include':[{'model':db[_0xb591('0x56')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb591('0x57'),'where':{'email':_0xe6a12e},'limit':0x1,'order':[[_0xb591('0x58'),'DESC']]}]},{'model':db[_0xb591('0x59')],'as':_0xb591('0x5a'),'raw':!![],'include':[{'model':db[_0xb591('0x5b')],'as':_0xb591('0x5b'),'raw':!![]}]}]})[_0xb591('0x27')](function(_0x14189a){_0x55d45b=_0x14189a;if(!_0x55d45b||!_0x55d45b[_0xb591('0x5a')])return;var _0x32cb58=_0x55d45b[_0xb591('0x5c')]();if(_0x5a10b4['body'][_0xb591('0x5d')]&&_0x5a10b4[_0xb591('0x4c')][_0xb591('0x5d')]['length']){for(var _0x405eb6=0x0;_0x405eb6<_0x5a10b4[_0xb591('0x4c')][_0xb591('0x5d')][_0xb591('0x3a')];_0x405eb6+=0x1){_0x5a10b4[_0xb591('0x4c')][_0xb591('0x5d')][_0x405eb6]={'filename':_0x5a10b4[_0xb591('0x4c')]['attachments'][_0x405eb6]['name'],'path':path[_0xb591('0x5e')](config[_0xb591('0x5f')],_0xb591('0x60'),_0x5a10b4[_0xb591('0x4c')]['attachments'][_0x405eb6]['basename'])};}}_0xaafa81={'account':_0x32cb58,'message':_0x5a10b4[_0xb591('0x4c')]};return;})['then'](function(){if(_0x55d45b[_0xb591('0x61')]){if(_0x55d45b[_0xb591('0x61')][_0xb591('0x57')][_0xb591('0x3a')]){return _0x55d45b[_0xb591('0x61')][_0xb591('0x57')][0x0];}else{return db[_0xb591('0x62')]['create'](_[_0xb591('0xb')](_0x5a10b4[_0xb591('0x4c')],{'firstName':_0x5a10b4['body']['to'],'email':_0x5a10b4[_0xb591('0x4c')]['to'],'phone':_0x5a10b4[_0xb591('0x4c')]['to'],'ListId':_0x55d45b[_0xb591('0x63')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xb591('0x27')](function(){if(_0xaafa81){return respondWithRpcPromise(_0xb591('0x64'),'sendMail',_0xaafa81,client9003)[_0xb591('0x27')](function(_0x9b3bac){return _0x3cd14d['update']({'read':!![],'messageId':_0x9b3bac[_0xb591('0x65')],'sentAt':moment()[_0xb591('0x66')](_0xb591('0x67'))});})[_0xb591('0x47')](function(_0x5bdee7){logger[_0xb591('0x18')]('%s',JSON[_0xb591('0x17')](_0x5bdee7));return _0x3cd14d;});}return _0x3cd14d;});}return _0x3cd14d;}})[_0xb591('0x27')](respondWithResult(_0x446317,0xc9))['catch'](handleError(_0x446317,null));};exports[_0xb591('0x68')]=function(_0x2157fa,_0x10ab1b){var _0x1c2965={'agent':{},'channel':_0xb591('0x69')};if(_0x2157fa[_0xb591('0x4c')]['id']){delete _0x2157fa[_0xb591('0x4c')]['id'];}_0x2157fa['body'][_0xb591('0x6a')]=!![];_0x2157fa[_0xb591('0x4c')][_0xb591('0x6b')]=moment()['format'](_0xb591('0x67'));_0x2157fa['body'][_0xb591('0x6c')]=_0x2157fa[_0xb591('0x4c')][_0xb591('0x6c')]||_0x2157fa[_0xb591('0x6d')]['id'];_0x1c2965[_0xb591('0x6e')]['id']=_0x2157fa['body']['UserId'];return db[_0xb591('0x2f')][_0xb591('0x4b')]({'where':{'id':_0x2157fa[_0xb591('0x49')]['id'],'UserId':null}})[_0xb591('0x27')](handleEntityNotFound(_0x10ab1b,null))['then'](saveUpdates(_0x2157fa[_0xb591('0x4c')],null))[_0xb591('0x27')](function(_0x2c8d36){if(_0x2c8d36){_0x1c2965[_0xb591('0x1b')]=_0x2c8d36[_0xb591('0x6f')]({'plain':!![]});return db[_0xb591('0x70')]['find']({'where':{'id':_0x2c8d36[_0xb591('0x71')]}});}return null;})[_0xb591('0x27')](handleEntityNotFound(_0x10ab1b,null))['then'](function(_0x44736d){if(_0x44736d){return _0x44736d[_0xb591('0x26')]({'UserId':_0x2157fa[_0xb591('0x4c')][_0xb591('0x6c')],'read1stAt':_['isNil'](_0x44736d[_0xb591('0x72')])?moment()['format'](_0xb591('0x67')):undefined});}return null;})[_0xb591('0x27')](function(_0x362328){if(_0x362328){_0x1c2965[_0xb591('0x73')]=_0x362328['get']({'plain':!![]});interaction_log[_0xb591('0x1c')](_0xb591('0x74'),_0x2157fa['user']['id'],_0x2157fa[_0xb591('0x6d')][_0xb591('0x2c')],_0x2157fa[_0xb591('0x6d')][_0xb591('0x75')],_0x1c2965[_0xb591('0x73')]['id'],_0x2157fa['body']?JSON[_0xb591('0x17')](_0x2157fa['body']):_0xb591('0x76'));return respondWithRpcPromise(_0xb591('0x77'),_0xb591('0x78'),_0x1c2965);}return null;})['then'](function(_0x2f8ba9){var _0x530cc4=_0xb591('0x79')+_0x2f8ba9[_0xb591('0x1b')]['ContactId'];return db[_0xb591('0x7a')][_0xb591('0x33')](_0x530cc4,{'type':db[_0xb591('0x7b')][_0xb591('0x7c')][_0xb591('0x7d')],'raw':!![]})[_0xb591('0x27')](function(_0x52ebc2){return _0x52ebc2;});})[_0xb591('0x27')](function(_0x33d30d){if(_0x33d30d){_0x1c2965[_0xb591('0x1b')][_0xb591('0x7e')]=_0x33d30d[0x0];if(!_0x2157fa[_0xb591('0x4c')][_0xb591('0x6c')])return;return db[_0xb591('0x7f')][_0xb591('0x4b')]({'where':{'id':_0x2157fa['body'][_0xb591('0x6c')],'role':_0xb591('0x6e')},'attributes':['id',_0xb591('0x2c'),'fullname',_0xb591('0x80'),'internal'],'raw':!![]});}return null;})[_0xb591('0x27')](function(_0x56e062){if(!_0x56e062)return null;_0x1c2965['message'][_0xb591('0x6e')]=_0x56e062;return _0x1c2965;})[_0xb591('0x27')](function(_0xb9cfe5){if(_0xb9cfe5){if(_0x2157fa['body']['manual']){_0x1c2965[_0xb591('0x1b')][_0xb591('0x81')]=util[_0xb591('0x66')](_0xb591('0x82'),_0x2157fa['user'][_0xb591('0x2c')]);_0x1c2965[_0xb591('0x1b')][_0xb591('0x83')]=_0x1c2965[_0xb591('0x83')];_0x1c2965[_0xb591('0x1b')]['motionChannel']=_0x1c2965['channel'];_0x1c2965[_0xb591('0x1b')]['event']=_0xb591('0x68');_0x1c2965['message']['body']=htmlToText[_0xb591('0x84')](_0x1c2965[_0xb591('0x1b')][_0xb591('0x4c')]);return respondWithRpcPromise(_0xb591('0x85'),_0xb591('0x85'),{'event':_0xb591('0x86'),'message':_0x1c2965[_0xb591('0x1b')]},client9002)[_0xb591('0x27')](function(){return _0x1c2965;});}return _0x1c2965;}return null;})[_0xb591('0x27')](respondWithResult(_0x10ab1b,null))[_0xb591('0x47')](handleError(_0x10ab1b,null));};exports[_0xb591('0x87')]=function(_0x2c331c,_0x231412){var _0x31219f={'agent':{},'channel':_0xb591('0x69')};if(_0x2c331c[_0xb591('0x4c')]['id']){delete _0x2c331c[_0xb591('0x4c')]['id'];}_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')]=_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')]||_0x2c331c[_0xb591('0x6d')]['id'];_0x31219f[_0xb591('0x6e')]['id']=_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')];return db[_0xb591('0x2f')][_0xb591('0x4b')]({'where':{'id':_0x2c331c[_0xb591('0x49')]['id'],'UserId':null}})[_0xb591('0x27')](handleEntityNotFound(_0x231412,null))[_0xb591('0x27')](function(_0x4bb91b){if(_0x4bb91b){_0x31219f[_0xb591('0x1b')]=_0x4bb91b[_0xb591('0x6f')]({'plain':!![]});return db[_0xb591('0x70')][_0xb591('0x4b')]({'where':{'id':_0x4bb91b[_0xb591('0x71')]}});}return null;})[_0xb591('0x27')](handleEntityNotFound(_0x231412,null))['then'](function(_0x49a07e){if(_0x49a07e){_0x31219f[_0xb591('0x73')]=_0x49a07e['get']({'plain':!![]});interaction_log[_0xb591('0x1c')](_0xb591('0x88'),_0x2c331c[_0xb591('0x6d')]['id'],_0x2c331c['user'][_0xb591('0x2c')],_0x2c331c[_0xb591('0x6d')][_0xb591('0x75')],_0x31219f[_0xb591('0x73')]['id'],_0x2c331c[_0xb591('0x4c')]?JSON[_0xb591('0x17')](_0x2c331c[_0xb591('0x4c')]):'null');return respondWithRpcPromise(_0xb591('0x89'),'rejectMessage',_0x31219f);}return null;})[_0xb591('0x27')](function(_0x335335){var _0x441c9a=_0xb591('0x79')+_0x335335['message']['ContactId'];return db['sequelize']['query'](_0x441c9a,{'type':db[_0xb591('0x7b')][_0xb591('0x7c')][_0xb591('0x7d')],'raw':!![]})[_0xb591('0x27')](function(_0x8387ed){return _0x8387ed;});})[_0xb591('0x27')](function(_0x5d93c4){if(_0x5d93c4){_0x31219f[_0xb591('0x1b')]['contact']=_0x5d93c4[0x0];if(!_0x2c331c['body']['UserId'])return;return db[_0xb591('0x7f')][_0xb591('0x4b')]({'where':{'id':_0x2c331c[_0xb591('0x4c')][_0xb591('0x6c')],'role':_0xb591('0x6e')},'attributes':['id',_0xb591('0x2c'),'fullname',_0xb591('0x80'),_0xb591('0x8a')],'raw':!![]});}return null;})[_0xb591('0x27')](function(_0x3cd071){if(!_0x3cd071)return null;_0x31219f[_0xb591('0x1b')][_0xb591('0x6e')]=_0x3cd071;return _0x31219f;})[_0xb591('0x27')](function(_0x93f9bc){if(_0x93f9bc){_0x93f9bc[_0xb591('0x1b')][_0xb591('0x81')]=util[_0xb591('0x66')](_0xb591('0x82'),_0x2c331c[_0xb591('0x6d')]['name']);_0x93f9bc[_0xb591('0x1b')][_0xb591('0x83')]=_0x31219f[_0xb591('0x83')];_0x93f9bc[_0xb591('0x1b')][_0xb591('0x8b')]=_0x31219f['channel'];_0x93f9bc[_0xb591('0x1b')][_0xb591('0x8c')]=_0xb591('0x87');_0x93f9bc[_0xb591('0x1b')][_0xb591('0x4c')]=htmlToText[_0xb591('0x84')](_0x31219f[_0xb591('0x1b')]['body']);respondWithRpcPromise(_0xb591('0x85'),_0xb591('0x85'),{'event':_0xb591('0x8d'),'message':_0x93f9bc['message']},client9002);return _0x31219f;}return null;})['then'](respondWithResult(_0x231412,null))[_0xb591('0x47')](handleError(_0x231412,null));};exports[_0xb591('0x8e')]=function(_0x54abdc,_0x3f359a){var _0x3baf84=moment()['unix']()['toString']();var _0x4f0ef8=path['join'](config['root'],_0xb591('0x8f'),'files',_0xb591('0x90'));var _0x25023f=path[_0xb591('0x5e')](config[_0xb591('0x5f')],'server',_0xb591('0x91'),_0xb591('0x5d'));var _0x200db0=util[_0xb591('0x66')](_0xb591('0x92'),_0x3baf84);return db[_0xb591('0x2f')][_0xb591('0x4b')]({'where':{'id':_0x54abdc['params']['id']},'attributes':['id',_0xb591('0x4c'),'from','to','cc','bcc',_0xb591('0x93'),_0xb591('0x94')],'include':_0x54abdc[_0xb591('0x33')]['attachments']?[{'model':db['Attachment'],'as':_0xb591('0x95')}]:undefined})['then'](handleEntityNotFound(_0x3f359a,null))[_0xb591('0x27')](function(_0xcd1d58){if(_0xcd1d58){var _0x8e5a44=_0xcd1d58;var _0x5189ac={'from':_0x8e5a44['from'],'to':_0x8e5a44['to'],'subject':_0x8e5a44[_0xb591('0x93')],'html':htmlEntities[_0xb591('0x96')](_0x8e5a44[_0xb591('0x4c')]),'headers':{'Date':moment(_0x8e5a44[_0xb591('0x94')])[_0xb591('0x66')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xcd1d58['cc']){_0x5189ac[_0xb591('0x97')]['Cc']=_0xcd1d58['cc'];}if(_0xcd1d58[_0xb591('0x98')]){_0x5189ac['headers'][_0xb591('0x99')]=_0xcd1d58[_0xb591('0x98')];}return new BPromise(function(_0x344d4d,_0x502b32){if(_0xcd1d58[_0xb591('0x95')]){for(var _0x1f08c8=0x0;_0x1f08c8<_0xcd1d58[_0xb591('0x95')][_0xb591('0x3a')];_0x1f08c8++){var _0x1b2ec0=_0xcd1d58[_0xb591('0x95')][_0x1f08c8];var _0x298fda=path[_0xb591('0x5e')](_0x25023f,_0x1b2ec0[_0xb591('0x9a')]);if(fs['existsSync'](_0x298fda)){_0x5189ac['attachments'][_0xb591('0x9b')]({'name':_0x1b2ec0[_0xb591('0x2c')],'contentType':_0x1b2ec0[_0xb591('0x9c')],'data':fs['readFileSync'](_0x298fda)});}}}emlformat[_0xb591('0x9d')](_0x5189ac,function(_0x333724,_0x294ad4){if(_0x333724)return _0x502b32(_0x333724);fs[_0xb591('0x9e')](path[_0xb591('0x5e')](_0x4f0ef8,_0x200db0),_0x294ad4);return _0x344d4d(_0x294ad4);});});}})[_0xb591('0x27')](function(_0x2f6a53){if(_0x2f6a53){return _0x3f359a[_0xb591('0x8e')](path[_0xb591('0x5e')](_0x4f0ef8,_0x200db0),_0x200db0,function(_0x7101aa){if(!_0x7101aa)fs[_0xb591('0x9f')](path[_0xb591('0x5e')](_0x4f0ef8,_0x200db0));});}})['catch'](handleError(_0x3f359a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8d1ef80..9999a30 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 _0xab5c=['hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','update','remove','emit'];(function(_0x4095e8,_0x20173b){var _0x1ec6aa=function(_0x1a367a){while(--_0x1a367a){_0x4095e8['push'](_0x4095e8['shift']());}};_0x1ec6aa(++_0x20173b);}(_0xab5c,0x6f));var _0xcab5=function(_0x339c77,_0x53eac1){_0x339c77=_0x339c77-0x0;var _0x4463d7=_0xab5c[_0x339c77];return _0x4463d7;};'use strict';var EventEmitter=require(_0xcab5('0x0'));var MailMessage=require(_0xcab5('0x1'))['db'][_0xcab5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcab5('0x3'),'afterDestroy':_0xcab5('0x4')};function emitEvent(_0x2d6e50){return function(_0x87833,_0x3bbfd9,_0x2d7b1f){MailMessageEvents[_0xcab5('0x5')](_0x2d6e50+':'+_0x87833['id'],_0x87833);MailMessageEvents[_0xcab5('0x5')](_0x2d6e50,_0x87833);_0x2d7b1f(null);};}for(var e in events){if(events[_0xcab5('0x6')](e)){var event=events[e];MailMessage[_0xcab5('0x7')](e,emitEvent(event));}}module[_0xcab5('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x8da7=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x190b95,_0xfbfcc9){var _0x4d5c92=function(_0x3a00ea){while(--_0x3a00ea){_0x190b95['push'](_0x190b95['shift']());}};_0x4d5c92(++_0xfbfcc9);}(_0x8da7,0xc4));var _0x78da=function(_0x573be2,_0x5e4bd0){_0x573be2=_0x573be2-0x0;var _0x378751=_0x8da7[_0x573be2];return _0x378751;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x78da('0x0'))['db'][_0x78da('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x78da('0x2')](0x0);var events={'afterCreate':_0x78da('0x3'),'afterUpdate':_0x78da('0x4'),'afterDestroy':_0x78da('0x5')};function emitEvent(_0x209ab){return function(_0x29463c,_0x53c76c,_0x21fb32){MailMessageEvents['emit'](_0x209ab+':'+_0x29463c['id'],_0x29463c);MailMessageEvents[_0x78da('0x6')](_0x209ab,_0x29463c);_0x21fb32(null);};}for(var e in events){if(events[_0x78da('0x7')](e)){var event=events[e];MailMessage[_0x78da('0x8')](e,emitEvent(event));}}module[_0x78da('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 8f364a3..22a536b 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 _0xd369=['update','createdAt','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then'];(function(_0x4ec1a7,_0x3f29a0){var _0x477952=function(_0x4a7760){while(--_0x4a7760){_0x4ec1a7['push'](_0x4ec1a7['shift']());}};_0x477952(++_0x3f29a0);}(_0xd369,0xcf));var _0x9d36=function(_0x53e3d5,_0x32a152){_0x53e3d5=_0x53e3d5-0x0;var _0x406586=_0xd369[_0x53e3d5];return _0x406586;};'use strict';var _=require(_0x9d36('0x0'));var util=require(_0x9d36('0x1'));var logger=require(_0x9d36('0x2'))(_0x9d36('0x3'));var moment=require(_0x9d36('0x4'));var BPromise=require(_0x9d36('0x5'));var rp=require(_0x9d36('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x9d36('0x7'));var rimraf=require(_0x9d36('0x8'));var config=require('../../config/environment');var attributes=require(_0x9d36('0x9'));module[_0x9d36('0xa')]=function(_0x1e3c50,_0x1e861c){return _0x1e3c50[_0x9d36('0xb')](_0x9d36('0xc'),attributes,{'tableName':_0x9d36('0xd'),'paranoid':![],'indexes':[{'name':_0x9d36('0xe'),'fields':[_0x9d36('0xe')]},{'name':_0x9d36('0xf'),'fields':[_0x9d36('0x10'),_0x9d36('0x11')],'type':_0x9d36('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53b81c,_0x5942b6,_0x40d524){if(_0x53b81c[_0x9d36('0x13')]){_0x53b81c[_0x9d36('0x10')]=htmlToText['fromString'](_0x53b81c[_0x9d36('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x40d524(null,_0x5942b6);},'afterCreate':function(_0x198b7c,_0x233552,_0x280c21){var _0x235235=_0x1e3c50['models'];var _0x17adfc=_0x198b7c[_0x9d36('0x14')]({'plain':!![]});if(_0x17adfc['direction']['toLowerCase']()==='in'||_0x17adfc[_0x9d36('0x15')][_0x9d36('0x16')]()===_0x9d36('0x17')&&!_0x17adfc[_0x9d36('0x18')]&&!_[_0x9d36('0x19')](_0x17adfc[_0x9d36('0x1a')])){_0x235235[_0x9d36('0x1b')][_0x9d36('0x1c')]({'where':{'id':_0x17adfc[_0x9d36('0x1d')]}})[_0x9d36('0x1e')](function(_0xe1665b){if(_0xe1665b){_0xe1665b[_0x9d36('0x1f')]({'lastMsgAt':_0x17adfc[_0x9d36('0x20')],'lastMsgDirection':_0x17adfc[_0x9d36('0x15')]['toLowerCase']()});}})['catch'](function(_0x1f00dc){console['error'](_0x1f00dc);});}_0x280c21();}},'charset':_0x9d36('0x21'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb449=['path','rimraf','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','error','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','html-to-text'];(function(_0x3f0122,_0x1627ca){var _0x2039d7=function(_0x5631dd){while(--_0x5631dd){_0x3f0122['push'](_0x3f0122['shift']());}};_0x2039d7(++_0x1627ca);}(_0xb449,0x90));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b44('0x2'));var BPromise=require(_0x9b44('0x3'));var rp=require(_0x9b44('0x4'));var htmlToText=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require(_0x9b44('0x7'));var config=require(_0x9b44('0x8'));var attributes=require('./mailMessage.attributes');module[_0x9b44('0x9')]=function(_0x2375c9,_0x1318da){return _0x2375c9[_0x9b44('0xa')](_0x9b44('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x9b44('0xc'),'fields':['messageId']},{'name':_0x9b44('0xd'),'fields':[_0x9b44('0xe'),'subject'],'type':_0x9b44('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x565416,_0x301056,_0x5844d4){if(_0x565416[_0x9b44('0x10')]){_0x565416[_0x9b44('0xe')]=htmlToText[_0x9b44('0x11')](_0x565416[_0x9b44('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5844d4(null,_0x301056);},'afterCreate':function(_0x51fa2f,_0x17dd90,_0x3d0d01){var _0x2bce5c=_0x2375c9['models'];var _0x3b1853=_0x51fa2f[_0x9b44('0x12')]({'plain':!![]});if(_0x3b1853[_0x9b44('0x13')][_0x9b44('0x14')]()==='in'||_0x3b1853['direction'][_0x9b44('0x14')]()===_0x9b44('0x15')&&!_0x3b1853[_0x9b44('0x16')]&&!_[_0x9b44('0x17')](_0x3b1853[_0x9b44('0x18')])){_0x2bce5c[_0x9b44('0x19')]['findOne']({'where':{'id':_0x3b1853[_0x9b44('0x1a')]}})[_0x9b44('0x1b')](function(_0x367e04){if(_0x367e04){_0x367e04['update']({'lastMsgAt':_0x3b1853['createdAt'],'lastMsgDirection':_0x3b1853[_0x9b44('0x13')]['toLowerCase']()});}})['catch'](function(_0x18d32e){console[_0x9b44('0x1c')](_0x18d32e);});}_0x3d0d01();}},'charset':'utf8mb4','collate':_0x9b44('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 96605cd..fa93057 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 _0x958a=['./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4e7c95,_0x5179a1){var _0x5e66ab=function(_0x2aa8c2){while(--_0x2aa8c2){_0x4e7c95['push'](_0x4e7c95['shift']());}};_0x5e66ab(++_0x5179a1);}(_0x958a,0x128));var _0xa958=function(_0x15881e,_0x1db13a){_0x15881e=_0x15881e-0x0;var _0xc6c0dc=_0x958a[_0x15881e];return _0xc6c0dc;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});config[_0xa958('0xb')]=_[_0xa958('0xc')](config[_0xa958('0xb')],{'host':_0xa958('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa958('0xe'))[_0xa958('0xf')](socket);function respondWithRpcPromise(_0x11f090,_0x44b66e,_0x37afa0){return new BPromise(function(_0x94caac,_0xebb1c6){return client[_0xa958('0x10')](_0x11f090,_0x37afa0)[_0xa958('0x11')](function(_0x250999){logger[_0xa958('0x12')](_0xa958('0x13'),_0x44b66e,_0xa958('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x44b66e,'request\x20sent',JSON[_0xa958('0x15')](_0x250999));if(_0x250999[_0xa958('0x16')]){if(_0x250999[_0xa958('0x16')]['code']===0x1f4){logger[_0xa958('0x16')]('MailMessage,\x20%s,\x20%s',_0x44b66e,_0x250999['error']['message']);return _0xebb1c6(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0x250999[_0xa958('0x16')][_0xa958('0x17')]);return _0x94caac(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}else{logger['info'](_0xa958('0x13'),_0x44b66e,'request\x20sent');_0x94caac(_0x250999[_0xa958('0x18')][_0xa958('0x17')]);}})['catch'](function(_0xe4129a){logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0xe4129a);_0xebb1c6(_0xe4129a);});});}exports[_0xa958('0x19')]=function(_0x2759ad){var _0x1f82aa=this;return new Promise(function(_0x56314b,_0x4a90c2){return db[_0xa958('0x1a')][_0xa958('0x1b')](_0x2759ad[_0xa958('0x1c')],{'raw':_0x2759ad['options']?_0x2759ad[_0xa958('0x1d')][_0xa958('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x28cf12){logger[_0xa958('0x12')]('CreateMailMessage',_0x2759ad);logger['debug'](_0xa958('0x19'),_0x2759ad,JSON[_0xa958('0x15')](_0x28cf12));_0x56314b(_0x28cf12);})['catch'](function(_0x25f461){logger[_0xa958('0x16')](_0xa958('0x19'),_0x25f461[_0xa958('0x17')],_0x2759ad);_0x4a90c2(_0x1f82aa[_0xa958('0x16')](0x1f4,_0x25f461[_0xa958('0x17')]));});});}; \ No newline at end of file +var _0x6cb4=['result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6cb4,0xff));var _0x46cb=function(_0x2941d4,_0x995343){_0x2941d4=_0x2941d4-0x0;var _0x27d807=_0x6cb4[_0x2941d4];return _0x27d807;};'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});config[_0x46cb('0xb')]=_[_0x46cb('0xc')](config[_0x46cb('0xb')],{'host':_0x46cb('0xd'),'port':0x18eb});var socket=require(_0x46cb('0xe'))(new Redis(config[_0x46cb('0xb')]));require('./mailMessage.socket')[_0x46cb('0xf')](socket);function respondWithRpcPromise(_0x34f9e9,_0x48101c,_0x206f10){return new BPromise(function(_0x106a87,_0x4a60b2){return client[_0x46cb('0x10')](_0x34f9e9,_0x206f10)[_0x46cb('0x11')](function(_0x570cfd){logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,_0x46cb('0x12'));logger[_0x46cb('0x13')](_0x46cb('0x14'),_0x48101c,_0x46cb('0x12'),JSON['stringify'](_0x570cfd));if(_0x570cfd[_0x46cb('0x15')]){if(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x16')]===0x1f4){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);return _0x4a60b2(_0x570cfd[_0x46cb('0x15')][_0x46cb('0x18')]);}logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0x570cfd['error'][_0x46cb('0x18')]);return _0x106a87(_0x570cfd['error'][_0x46cb('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x48101c,'request\x20sent');_0x106a87(_0x570cfd[_0x46cb('0x19')][_0x46cb('0x18')]);}})[_0x46cb('0x1a')](function(_0xcc8e2){logger[_0x46cb('0x15')](_0x46cb('0x17'),_0x48101c,_0xcc8e2);_0x4a60b2(_0xcc8e2);});});}exports[_0x46cb('0x1b')]=function(_0x32e9fe){var _0x90cd50=this;return new Promise(function(_0xfc9064,_0x149483){return db[_0x46cb('0x1c')][_0x46cb('0x1d')](_0x32e9fe[_0x46cb('0x1e')],{'raw':_0x32e9fe[_0x46cb('0x1f')]?_0x32e9fe[_0x46cb('0x1f')][_0x46cb('0x20')]===undefined?!![]:![]:!![]})[_0x46cb('0x11')](function(_0x41ecd2){logger[_0x46cb('0x21')](_0x46cb('0x1b'),_0x32e9fe);logger[_0x46cb('0x13')](_0x46cb('0x1b'),_0x32e9fe,JSON[_0x46cb('0x22')](_0x41ecd2));_0xfc9064(_0x41ecd2);})[_0x46cb('0x1a')](function(_0x5a1338){logger['error'](_0x46cb('0x1b'),_0x5a1338[_0x46cb('0x18')],_0x32e9fe);_0x149483(_0x90cd50[_0x46cb('0x15')](0x1f4,_0x5a1338[_0x46cb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 5ce6280..cdec5dd 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 _0x10ca=['save','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x3bb035,_0x3a6648){var _0x40f88c=function(_0x47a7a4){while(--_0x47a7a4){_0x3bb035['push'](_0x3bb035['shift']());}};_0x40f88c(++_0x3a6648);}(_0x10ca,0x1a7));var _0xa10c=function(_0x58e0c6,_0x4ce2cb){_0x58e0c6=_0x58e0c6-0x0;var _0x116ab4=_0x10ca[_0x58e0c6];return _0x116ab4;};'use strict';var MailMessageEvents=require(_0xa10c('0x0'));var events=[_0xa10c('0x1'),'remove',_0xa10c('0x2')];function createListener(_0x2f5081,_0x4b203f){return function(_0x3bdeb0){_0x4b203f[_0xa10c('0x3')](_0x2f5081,_0x3bdeb0);};}function removeListener(_0x894f16,_0x472bf4){return function(){MailMessageEvents[_0xa10c('0x4')](_0x894f16,_0x472bf4);};}exports[_0xa10c('0x5')]=function(_0x4cf58e){for(var _0x14b64d=0x0,_0x3484dc=events[_0xa10c('0x6')];_0x14b64d<_0x3484dc;_0x14b64d++){var _0x1a9c7c=events[_0x14b64d];var _0x16afd3=createListener(_0xa10c('0x7')+_0x1a9c7c,_0x4cf58e);MailMessageEvents['on'](_0x1a9c7c,_0x16afd3);}}; \ No newline at end of file +var _0x8176=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0x277641,_0x482581){var _0xc434d0=function(_0x5a7ba6){while(--_0x5a7ba6){_0x277641['push'](_0x277641['shift']());}};_0xc434d0(++_0x482581);}(_0x8176,0xfe));var _0x6817=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8176[_0x55f8b4];return _0x2475f9;};'use strict';var MailMessageEvents=require(_0x6817('0x0'));var events=['save',_0x6817('0x1'),_0x6817('0x2')];function createListener(_0x324280,_0x49675b){return function(_0x334c22){_0x49675b[_0x6817('0x3')](_0x324280,_0x334c22);};}function removeListener(_0x1f89a8,_0x525340){return function(){MailMessageEvents[_0x6817('0x4')](_0x1f89a8,_0x525340);};}exports[_0x6817('0x5')]=function(_0x428519){for(var _0x4a10e8=0x0,_0x236e94=events[_0x6817('0x6')];_0x4a10e8<_0x236e94;_0x4a10e8++){var _0x54279b=events[_0x4a10e8];var _0x401d5d=createListener(_0x6817('0x7')+_0x54279b,_0x428519);MailMessageEvents['on'](_0x54279b,_0x401d5d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 14ee790..445b70f 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 _0x688f=['removeTeams','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','/:id','update','delete','destroy'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x688f,0xe3));var _0xf688=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x688f[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf688('0x0'));var timeout=require(_0xf688('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf688('0x2'));var auth=require(_0xf688('0x3'));var interaction=require(_0xf688('0x4'));var config=require(_0xf688('0x5'));var controller=require(_0xf688('0x6'));router[_0xf688('0x7')]('/',auth[_0xf688('0x8')](),controller['index']);router['get'](_0xf688('0x9'),auth[_0xf688('0x8')](),controller[_0xf688('0xa')]);router[_0xf688('0x7')]('/:id',auth[_0xf688('0x8')](),controller['show']);router[_0xf688('0x7')]('/:id/members',auth[_0xf688('0x8')](),controller['getMembers']);router[_0xf688('0x7')](_0xf688('0xb'),auth[_0xf688('0x8')](),controller[_0xf688('0xc')]);router['get'](_0xf688('0xd'),auth[_0xf688('0x8')](),controller[_0xf688('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf688('0xf')]);router[_0xf688('0x10')](_0xf688('0xb'),auth[_0xf688('0x8')](),controller[_0xf688('0x11')]);router[_0xf688('0x10')](_0xf688('0xd'),auth[_0xf688('0x8')](),controller[_0xf688('0x12')]);router['put'](_0xf688('0x13'),auth[_0xf688('0x8')](),controller[_0xf688('0x14')]);router[_0xf688('0x15')]('/:id',auth[_0xf688('0x8')](),controller[_0xf688('0x16')]);router[_0xf688('0x15')](_0xf688('0xb'),auth[_0xf688('0x8')](),controller[_0xf688('0x17')]);router[_0xf688('0x15')](_0xf688('0xd'),auth[_0xf688('0x8')](),controller['removeAgents']);module[_0xf688('0x18')]=router; \ No newline at end of file +var _0x6b43=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3fbeba,_0x586f51){var _0x2d5677=function(_0x3559a1){while(--_0x3559a1){_0x3fbeba['push'](_0x3fbeba['shift']());}};_0x2d5677(++_0x586f51);}(_0x6b43,0x12e));var _0x36b4=function(_0x559fa0,_0x18562d){_0x559fa0=_0x559fa0-0x0;var _0xa9e414=_0x6b43[_0x559fa0];return _0xa9e414;};'use strict';var multer=require(_0x36b4('0x0'));var util=require(_0x36b4('0x1'));var path=require(_0x36b4('0x2'));var timeout=require(_0x36b4('0x3'));var express=require(_0x36b4('0x4'));var router=express[_0x36b4('0x5')]();var fs_extra=require(_0x36b4('0x6'));var auth=require(_0x36b4('0x7'));var interaction=require(_0x36b4('0x8'));var config=require(_0x36b4('0x9'));var controller=require('./mailQueue.controller');router[_0x36b4('0xa')]('/',auth[_0x36b4('0xb')](),controller[_0x36b4('0xc')]);router[_0x36b4('0xa')](_0x36b4('0xd'),auth['isAuthenticated'](),controller[_0x36b4('0xe')]);router['get'](_0x36b4('0xf'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x10')]);router[_0x36b4('0xa')](_0x36b4('0x11'),auth[_0x36b4('0xb')](),controller['getMembers']);router['get'](_0x36b4('0x12'),auth[_0x36b4('0xb')](),controller['getTeams']);router[_0x36b4('0xa')]('/:id/users',auth[_0x36b4('0xb')](),controller[_0x36b4('0x13')]);router[_0x36b4('0x14')]('/',auth['isAuthenticated'](),controller[_0x36b4('0x15')]);router[_0x36b4('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x36b4('0x16')]);router['post']('/:id/users',auth[_0x36b4('0xb')](),controller[_0x36b4('0x17')]);router['put'](_0x36b4('0xf'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x18')]);router[_0x36b4('0x19')](_0x36b4('0xf'),auth['isAuthenticated'](),controller[_0x36b4('0x1a')]);router[_0x36b4('0x19')](_0x36b4('0x12'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x1b')]);router[_0x36b4('0x19')](_0x36b4('0x1c'),auth[_0x36b4('0xb')](),controller[_0x36b4('0x1d')]);module[_0x36b4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index aafd625..064f730 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 _0x143a=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x3670d4,_0x4c067b){var _0x3d6438=function(_0x438993){while(--_0x438993){_0x3670d4['push'](_0x3670d4['shift']());}};_0x3d6438(++_0x4c067b);}(_0x143a,0x166));var _0xa143=function(_0x1c2599,_0x4db2c1){_0x1c2599=_0x1c2599-0x0;var _0x5debd9=_0x143a[_0x1c2599];return _0x5debd9;};'use strict';var Sequelize=require(_0xa143('0x0'));module[_0xa143('0x1')]={'name':{'type':Sequelize[_0xa143('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa143('0x2')]},'timeout':{'type':Sequelize[_0xa143('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa143('0x4')](_0xa143('0x5'),'beepall',_0xa143('0x6'))}}; \ No newline at end of file +var _0xb718=['rrmemory','roundrobin','sequelize','STRING','name'];(function(_0x1e8e7b,_0x590356){var _0x523be6=function(_0x5d33e0){while(--_0x5d33e0){_0x1e8e7b['push'](_0x1e8e7b['shift']());}};_0x523be6(++_0x590356);}(_0xb718,0x179));var _0x8b71=function(_0x38e717,_0x5b8bba){_0x38e717=_0x38e717-0x0;var _0x5bda01=_0xb718[_0x38e717];return _0x5bda01;};'use strict';var Sequelize=require(_0x8b71('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b71('0x1')],'unique':_0x8b71('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8b71('0x3'),'beepall',_0x8b71('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4d2ae23..7e1c256 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 _0x0cb3=['userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','emit','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','./mailQueue.socket','register','sendStatus','status','end','undefined','count','offset','limit','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','rows','params','model','keys','filters','intersection','attributes','fields','length','merge','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','describe','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','where','pick','MailQueueId','filter','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','mailPause','Team','getTeams','addTeams','ids','User','Agents','interface','flatMap','transaction','forEach'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x0cb3,0x110));var _0x30cb=function(_0xacb7d1,_0x547e04){_0xacb7d1=_0xacb7d1-0x0;var _0x5ae5d6=_0x0cb3[_0xacb7d1];return _0x5ae5d6;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x30cb('0x0'));var squel=require(_0x30cb('0x1'));var Redis=require(_0x30cb('0x2'));var qs=require(_0x30cb('0x3'));var logger=require(_0x30cb('0x4'))(_0x30cb('0x5'));var config=require('../../config/environment');var db=require(_0x30cb('0x6'))['db'];config[_0x30cb('0x7')]=_[_0x30cb('0x8')](config[_0x30cb('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x30cb('0x9'))[_0x30cb('0xa')](socket);function respondWithStatusCode(_0x414058,_0x3108af){_0x3108af=_0x3108af||0xcc;return function(_0x233220){if(_0x233220){return _0x414058[_0x30cb('0xb')](_0x3108af);}return _0x414058[_0x30cb('0xc')](_0x3108af)[_0x30cb('0xd')]();};}function respondWithResult(_0x1f513f,_0x2e4873){_0x2e4873=_0x2e4873||0xc8;return function(_0x503271){if(_0x503271){return _0x1f513f[_0x30cb('0xc')](_0x2e4873)['json'](_0x503271);}};}function respondWithFilteredResult(_0x15fc49,_0x438c46){return function(_0x311800){if(_0x311800){var _0x3a4d56=typeof _0x438c46['offset']==='undefined'&&typeof _0x438c46['limit']===_0x30cb('0xe');var _0x59343c=_0x311800[_0x30cb('0xf')];var _0x37b968=_0x3a4d56?0x0:_0x438c46['offset'];var _0x3e9689=_0x3a4d56?_0x311800[_0x30cb('0xf')]:_0x438c46[_0x30cb('0x10')]+_0x438c46[_0x30cb('0x11')];var _0x24f1a3;if(_0x3e9689>=_0x59343c){_0x3e9689=_0x59343c;_0x24f1a3=0xc8;}else{_0x24f1a3=0xce;}_0x15fc49['status'](_0x24f1a3);return _0x15fc49['set'](_0x30cb('0x12'),_0x37b968+'-'+_0x3e9689+'/'+_0x59343c)['json'](_0x311800);}return null;};}function saveUpdates(_0x4fb90f){return function(_0x15a1ba){if(_0x15a1ba){return _0x15a1ba[_0x30cb('0x13')](_0x4fb90f)[_0x30cb('0x14')](function(_0x50cdbd){return _0x50cdbd;});}return null;};}function removeEntity(_0x2474ad){return function(_0x36bb96){if(_0x36bb96){return _0x36bb96[_0x30cb('0x15')]()[_0x30cb('0x14')](function(){var _0x586a88=_0x36bb96[_0x30cb('0x16')]({'plain':!![]});var _0x2a1ca5=_0x30cb('0x17');return db[_0x30cb('0x18')][_0x30cb('0x15')]({'where':{'type':_0x2a1ca5,'resourceId':_0x586a88['id']}})[_0x30cb('0x14')](function(){return _0x36bb96;});})[_0x30cb('0x14')](function(){_0x2474ad[_0x30cb('0xc')](0xcc)[_0x30cb('0xd')]();});}};}function handleEntityNotFound(_0x58c6b1){return function(_0x166408){if(!_0x166408){_0x58c6b1[_0x30cb('0xb')](0x194);}return _0x166408;};}function handleError(_0x168fa7,_0x55e8bc){_0x55e8bc=_0x55e8bc||0x1f4;return function(_0x30cab0){logger[_0x30cb('0x19')](_0x30cab0[_0x30cb('0x1a')]);if(_0x30cab0[_0x30cb('0x1b')]){delete _0x30cab0['name'];}_0x168fa7[_0x30cb('0xc')](_0x55e8bc)[_0x30cb('0x1c')](_0x30cab0);};}exports[_0x30cb('0x1d')]=function(_0x267e5d,_0x424434){var _0x138644={};var _0x4c6097={'count':0x0,'rows':[]};var _0xbc1842=_[_0x30cb('0x1e')](db[_0x30cb('0x1f')][_0x30cb('0x20')],function(_0x3989e0){return{'name':_0x3989e0[_0x30cb('0x21')],'type':_0x3989e0[_0x30cb('0x22')][_0x30cb('0x23')]};});_0x138644=qs[_0x30cb('0x24')](_0xbc1842,_0x267e5d);var _0x1fb300={'where':_0x138644['where']};return db[_0x30cb('0x1f')]['count'](_0x1fb300)[_0x30cb('0x14')](function(_0x34e790){_0x4c6097['count']=_0x34e790;_0x138644[_0x30cb('0x25')]=qs[_0x30cb('0x25')](_0x267e5d[_0x30cb('0x26')]);return db[_0x30cb('0x1f')][_0x30cb('0x27')](_0x138644);})[_0x30cb('0x14')](function(_0x156995){_0x4c6097[_0x30cb('0x28')]=_0x156995;return _0x4c6097;})[_0x30cb('0x14')](respondWithFilteredResult(_0x424434,_0x138644))['catch'](handleError(_0x424434,null));};exports['show']=function(_0x4700bc,_0x490353){var _0x37d74c={'raw':!![],'where':{'id':_0x4700bc[_0x30cb('0x29')]['id']}},_0x3fe979={};_0x3fe979[_0x30cb('0x2a')]=_[_0x30cb('0x2b')](db[_0x30cb('0x1f')][_0x30cb('0x20')]);_0x3fe979['query']=_[_0x30cb('0x2b')](_0x4700bc[_0x30cb('0x26')]);_0x3fe979[_0x30cb('0x2c')]=_[_0x30cb('0x2d')](_0x3fe979[_0x30cb('0x2a')],_0x3fe979[_0x30cb('0x26')]);_0x37d74c[_0x30cb('0x2e')]=_[_0x30cb('0x2d')](_0x3fe979[_0x30cb('0x2a')],qs[_0x30cb('0x2f')](_0x4700bc[_0x30cb('0x26')][_0x30cb('0x2f')]));_0x37d74c[_0x30cb('0x2e')]=_0x37d74c[_0x30cb('0x2e')][_0x30cb('0x30')]?_0x37d74c['attributes']:_0x3fe979[_0x30cb('0x2a')];if(_0x4700bc[_0x30cb('0x26')]['includeAll']){_0x37d74c['include']=[{'all':!![]}];}_0x37d74c=_[_0x30cb('0x31')]({},_0x37d74c,_0x4700bc[_0x30cb('0x32')]);return db[_0x30cb('0x1f')][_0x30cb('0x33')](_0x37d74c)[_0x30cb('0x14')](handleEntityNotFound(_0x490353,null))[_0x30cb('0x14')](respondWithResult(_0x490353,null))[_0x30cb('0x34')](handleError(_0x490353,null));};exports[_0x30cb('0x35')]=function(_0x4b4aad,_0x36eeb3){return db[_0x30cb('0x1f')][_0x30cb('0x35')](_0x4b4aad[_0x30cb('0x36')],{})[_0x30cb('0x14')](function(_0x31ebdc){var _0x246159=_0x4b4aad['user']['get']({'plain':!![]});if(!_0x246159)throw new Error(_0x30cb('0x37'));if(_0x246159[_0x30cb('0x38')]===_0x30cb('0x39')){var _0x878280=_0x31ebdc[_0x30cb('0x16')]({'plain':!![]});var _0x19bdbf=_0x30cb('0x17');return db[_0x30cb('0x3a')][_0x30cb('0x33')]({'where':{'name':_0x19bdbf,'userProfileId':_0x246159['userProfileId']},'raw':!![]})['then'](function(_0x3dbccf){if(_0x3dbccf&&_0x3dbccf[_0x30cb('0x3b')]===0x0){return db[_0x30cb('0x18')][_0x30cb('0x35')]({'name':_0x878280['name'],'resourceId':_0x878280['id'],'type':_0x3dbccf[_0x30cb('0x1b')],'sectionId':_0x3dbccf['id']},{})[_0x30cb('0x14')](function(){return _0x31ebdc;});}else{return _0x31ebdc;}})[_0x30cb('0x34')](function(_0x2aa873){logger[_0x30cb('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aa873);throw _0x2aa873;});}return _0x31ebdc;})[_0x30cb('0x14')](respondWithResult(_0x36eeb3,0xc9))[_0x30cb('0x34')](handleError(_0x36eeb3,null));};exports[_0x30cb('0x13')]=function(_0x46ac7a,_0x873d58){if(_0x46ac7a[_0x30cb('0x36')]['id']){delete _0x46ac7a[_0x30cb('0x36')]['id'];}return db[_0x30cb('0x1f')][_0x30cb('0x33')]({'where':{'id':_0x46ac7a['params']['id']}})[_0x30cb('0x14')](handleEntityNotFound(_0x873d58,null))[_0x30cb('0x14')](saveUpdates(_0x46ac7a[_0x30cb('0x36')],null))[_0x30cb('0x14')](respondWithResult(_0x873d58,null))[_0x30cb('0x34')](handleError(_0x873d58,null));};exports[_0x30cb('0x15')]=function(_0x252d38,_0xb94e5){return db['MailQueue'][_0x30cb('0x33')]({'where':{'id':_0x252d38[_0x30cb('0x29')]['id']}})[_0x30cb('0x14')](handleEntityNotFound(_0xb94e5,null))['then'](removeEntity(_0xb94e5,null))[_0x30cb('0x34')](handleError(_0xb94e5,null));};exports[_0x30cb('0x3c')]=function(_0x18a8af,_0x357119){return db[_0x30cb('0x1f')][_0x30cb('0x3c')]()[_0x30cb('0x14')](respondWithResult(_0x357119,null))[_0x30cb('0x34')](handleError(_0x357119,null));};exports['getMembers']=function(_0x8f8c32,_0x25c2f2){var _0x16ff21={'raw':!![],'where':{}},_0x528969={},_0x1e48c1;return db[_0x30cb('0x1f')][_0x30cb('0x3d')]({'where':{'id':_0x8f8c32[_0x30cb('0x29')]['id']}})[_0x30cb('0x14')](handleEntityNotFound(_0x25c2f2,null))[_0x30cb('0x14')](function(_0x5de6a6){if(_0x5de6a6){_0x1e48c1=_0x5de6a6['get']({'plain':!![]});_0x528969['model']=_['keys'](db[_0x30cb('0x3e')][_0x30cb('0x20')]);_0x528969['query']=_[_0x30cb('0x2b')](_0x8f8c32[_0x30cb('0x26')]);_0x528969[_0x30cb('0x2c')]=_[_0x30cb('0x2d')](_0x528969[_0x30cb('0x2a')],_0x528969[_0x30cb('0x26')]);_0x16ff21[_0x30cb('0x2e')]=_[_0x30cb('0x2d')](_0x528969[_0x30cb('0x2a')],qs[_0x30cb('0x2f')](_0x8f8c32['query']['fields']));_0x16ff21[_0x30cb('0x2e')]=_0x16ff21[_0x30cb('0x2e')][_0x30cb('0x30')]?_0x16ff21[_0x30cb('0x2e')]:_0x528969[_0x30cb('0x2a')];if(!_0x8f8c32[_0x30cb('0x26')][_0x30cb('0x3f')](_0x30cb('0x40'))){_0x16ff21['limit']=qs[_0x30cb('0x11')](_0x8f8c32[_0x30cb('0x26')][_0x30cb('0x11')]);_0x16ff21[_0x30cb('0x10')]=qs['offset'](_0x8f8c32['query'][_0x30cb('0x10')]);}_0x16ff21[_0x30cb('0x41')]=qs[_0x30cb('0x42')](_0x8f8c32[_0x30cb('0x26')][_0x30cb('0x42')]);_0x16ff21[_0x30cb('0x43')]=qs['filters'](_[_0x30cb('0x44')](_0x8f8c32[_0x30cb('0x26')],_0x528969[_0x30cb('0x2c')]));_0x16ff21[_0x30cb('0x43')][_0x30cb('0x45')]=_0x5de6a6['id'];if(_0x8f8c32[_0x30cb('0x26')]['filter']){_0x16ff21['where']=_['merge'](_0x16ff21[_0x30cb('0x43')],{'$or':_[_0x30cb('0x1e')](_0x16ff21[_0x30cb('0x2e')],function(_0x39919a){var _0x43acce={};_0x43acce[_0x39919a]={'$like':'%'+_0x8f8c32['query'][_0x30cb('0x46')]+'%'};return _0x43acce;})});}_0x16ff21=_[_0x30cb('0x31')]({},_0x16ff21,_0x8f8c32[_0x30cb('0x32')]);return db['UserMailQueue'][_0x30cb('0x27')](_0x16ff21);}})[_0x30cb('0x14')](function(_0x5d25e1){if(_0x5d25e1){return db['User'][_0x30cb('0x47')]({'where':{'id':_[_0x30cb('0x1e')](_0x5d25e1,'UserId'),'role':_0x30cb('0x48')},'attributes':['id',_0x30cb('0x1b'),'mailPause',_0x30cb('0x49'),_0x30cb('0x4a')]});}})[_0x30cb('0x14')](function(_0x3a7d4f){if(_0x3a7d4f){return{'count':_0x3a7d4f[_0x30cb('0xf')],'rows':_[_0x30cb('0x1e')](_0x3a7d4f[_0x30cb('0x28')],function(_0x4319e5){return{'membername':_0x4319e5[_0x30cb('0x1b')],'UserId':_0x4319e5['id'],'queue_name':_0x1e48c1[_0x30cb('0x1b')],'MailQueueId':_0x1e48c1['id'],'interface':util['format'](_0x30cb('0x4b'),_0x30cb('0x4c'),_0x4319e5[_0x30cb('0x1b')]),'penalty':0x0,'paused':_0x4319e5[_0x30cb('0x4d')],'createdAt':_0x4319e5[_0x30cb('0x4a')],'updatedAt':_0x4319e5[_0x30cb('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x30cb('0x14')](respondWithFilteredResult(_0x25c2f2,_0x16ff21))['catch'](handleError(_0x25c2f2,null));};exports['getTeams']=function(_0x36dee9,_0x2dc405){var _0x2dea8f={};var _0xe4ee70={};var _0x531826;var _0x485fb8;return db['MailQueue'][_0x30cb('0x3d')]({'where':{'id':_0x36dee9[_0x30cb('0x29')]['id']}})[_0x30cb('0x14')](handleEntityNotFound(_0x2dc405,null))['then'](function(_0x3e4dd0){if(_0x3e4dd0){_0x531826=_0x3e4dd0;_0xe4ee70[_0x30cb('0x2a')]=_[_0x30cb('0x2b')](db[_0x30cb('0x4e')]['rawAttributes']);_0xe4ee70['query']=_[_0x30cb('0x2b')](_0x36dee9['query']);_0xe4ee70[_0x30cb('0x2c')]=_[_0x30cb('0x2d')](_0xe4ee70[_0x30cb('0x2a')],_0xe4ee70['query']);_0x2dea8f[_0x30cb('0x2e')]=_[_0x30cb('0x2d')](_0xe4ee70['model'],qs[_0x30cb('0x2f')](_0x36dee9[_0x30cb('0x26')][_0x30cb('0x2f')]));_0x2dea8f[_0x30cb('0x2e')]=_0x2dea8f[_0x30cb('0x2e')]['length']?_0x2dea8f[_0x30cb('0x2e')]:_0xe4ee70[_0x30cb('0x2a')];_0x2dea8f['order']=qs['sort'](_0x36dee9[_0x30cb('0x26')][_0x30cb('0x42')]);_0x2dea8f[_0x30cb('0x43')]=qs[_0x30cb('0x2c')](_[_0x30cb('0x44')](_0x36dee9[_0x30cb('0x26')],_0xe4ee70['filters']));if(_0x36dee9[_0x30cb('0x26')]['filter']){_0x2dea8f[_0x30cb('0x43')]=_[_0x30cb('0x31')](_0x2dea8f[_0x30cb('0x43')],{'$or':_[_0x30cb('0x1e')](_0x2dea8f[_0x30cb('0x2e')],function(_0x270166){var _0x5df37a={};_0x5df37a[_0x270166]={'$like':'%'+_0x36dee9[_0x30cb('0x26')][_0x30cb('0x46')]+'%'};return _0x5df37a;})});}_0x2dea8f=_[_0x30cb('0x31')]({},_0x2dea8f,_0x36dee9[_0x30cb('0x32')]);return _0x531826['getTeams'](_0x2dea8f);}})[_0x30cb('0x14')](function(_0x59b79a){if(_0x59b79a){_0x485fb8=_0x59b79a[_0x30cb('0x30')];if(!_0x36dee9[_0x30cb('0x26')][_0x30cb('0x3f')](_0x30cb('0x40'))){_0x2dea8f[_0x30cb('0x11')]=qs[_0x30cb('0x11')](_0x36dee9[_0x30cb('0x26')][_0x30cb('0x11')]);_0x2dea8f[_0x30cb('0x10')]=qs['offset'](_0x36dee9[_0x30cb('0x26')][_0x30cb('0x10')]);}return _0x531826[_0x30cb('0x4f')](_0x2dea8f);}})[_0x30cb('0x14')](function(_0x3ff97c){if(_0x3ff97c){return _0x3ff97c?{'count':_0x485fb8,'rows':_0x3ff97c}:null;}})[_0x30cb('0x14')](respondWithResult(_0x2dc405,null))[_0x30cb('0x34')](handleError(_0x2dc405,null));};exports[_0x30cb('0x50')]=function(_0x4b85dc,_0x54b810){var _0x1f25cd=_0x4b85dc[_0x30cb('0x36')][_0x30cb('0x51')];return db[_0x30cb('0x4e')][_0x30cb('0x27')]({'where':{'id':_0x1f25cd},'attributes':['id'],'include':[{'model':db[_0x30cb('0x52')],'as':_0x30cb('0x53'),'attributes':['id','name','online','voicePause',_0x30cb('0x54')],'raw':!![]}]})[_0x30cb('0x14')](function(_0x579730){if(_0x579730){var _0x3f7f36=_[_0x30cb('0x55')](_0x579730,function(_0x3735b8){var _0x2c6483=_0x3735b8[_0x30cb('0x16')]({'plain':!![]});return _0x2c6483[_0x30cb('0x53')];});return db[_0x30cb('0x1f')][_0x30cb('0x33')]({'where':{'id':_0x4b85dc['params']['id']}})[_0x30cb('0x14')](function(_0x12cc1b){return db['sequelize'][_0x30cb('0x56')](function(_0x39ae18){return _0x12cc1b[_0x30cb('0x50')](_0x1f25cd,{'transaction':_0x39ae18})['then'](function(){return BPromise['each'](_0x3f7f36,function(_0x315678){return db[_0x30cb('0x3e')]['findOrCreate']({'where':{'UserId':_0x315678['id'],'MailQueueId':_0x4b85dc[_0x30cb('0x29')]['id']},'transaction':_0x39ae18});});})['then'](function(){_0x3f7f36[_0x30cb('0x57')](function(_0x139ead){socket['emit'](_0x30cb('0x58'),{'UserId':_0x139ead['id'],'MailQueueId':_0x12cc1b['id']});});});});});}})[_0x30cb('0x14')](respondWithStatusCode(_0x54b810,null))['catch'](handleError(_0x54b810,null));};exports[_0x30cb('0x59')]=function(_0x33a4ef,_0x50423c){return db['Team'][_0x30cb('0x27')]({'where':{'id':_0x33a4ef['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x30cb('0x52')],'as':_0x30cb('0x53'),'attributes':['id'],'raw':!![]}]})[_0x30cb('0x14')](handleEntityNotFound(_0x50423c,null))[_0x30cb('0x14')](function(_0x2a3582){var _0x202347=_[_0x30cb('0x1e')](_0x2a3582,'id');var _0x386fee=[];var _0x2eece6=[];var _0x1ab293=squel[_0x30cb('0x5a')]();_0x1ab293[_0x30cb('0x5b')](_0x30cb('0x5c'))[_0x30cb('0x5d')](_0x30cb('0x5e'),'tq')[_0x30cb('0x5f')](_0x30cb('0x60'),'ut',_0x30cb('0x61'))[_0x30cb('0x43')](_0x30cb('0x62'),_0x33a4ef['params']['id']);for(var _0x57e8ad=0x0;_0x57e8ad<_0x2a3582[_0x30cb('0x30')];_0x57e8ad+=0x1){let _0x2f112a=_0x2a3582[_0x57e8ad];for(var _0x5bd776=0x0;_0x5bd776<_0x2f112a[_0x30cb('0x53')][_0x30cb('0x30')];_0x5bd776+=0x1){let _0x214b12=_0x2f112a['Agents'][_0x5bd776];var _0x30d640=_0x1ab293[_0x30cb('0x63')]();_0x30d640[_0x30cb('0x43')](_0x30cb('0x64'),_0x214b12['id']);_0x2eece6[_0x30cb('0x65')](db[_0x30cb('0x66')][_0x30cb('0x26')](_0x30d640[_0x30cb('0x67')](),{'type':db[_0x30cb('0x66')][_0x30cb('0x68')][_0x30cb('0x69')]})[_0x30cb('0x14')](function(_0x467e3f){if(_0x467e3f[_0x30cb('0x30')]===0x1){return _0x214b12['id'];}else{var _0x25e9bd=_[_0x30cb('0x6a')](_[_0x30cb('0x1e')](_0x467e3f,_0x30cb('0x6b')),function(_0x5bc827){return _[_0x30cb('0x6c')](_0x202347,_0x5bc827);});if(_0x25e9bd){return _0x214b12['id'];}}}));}}return BPromise[_0x30cb('0x6d')](_0x2eece6)[_0x30cb('0x14')](function(_0x4f698a){_0x386fee=_(_0x386fee)[_0x30cb('0x6e')](_0x4f698a)[_0x30cb('0x6f')]()['value']();return db[_0x30cb('0x1f')]['find']({'where':{'id':_0x33a4ef[_0x30cb('0x29')]['id']}})[_0x30cb('0x14')](function(_0xea2816){return db['sequelize'][_0x30cb('0x56')](function(_0x3135d4){return _0xea2816[_0x30cb('0x59')](_0x33a4ef['query'][_0x30cb('0x51')],{'transaction':_0x3135d4})[_0x30cb('0x14')](function(){if(!_['isEmpty'](_0x386fee)){return _0xea2816['removeAgents'](_0x386fee,{'transaction':_0x3135d4});}})[_0x30cb('0x14')](function(){_0x386fee[_0x30cb('0x57')](function(_0x3f4581){socket[_0x30cb('0x70')](_0x30cb('0x71'),{'UserId':_0x3f4581,'MailQueueId':_0xea2816['id']});});});});});});})[_0x30cb('0x14')](respondWithStatusCode(_0x50423c,null))[_0x30cb('0x34')](handleError(_0x50423c,null));};exports[_0x30cb('0x72')]=function(_0x58ad65,_0x450114){return db[_0x30cb('0x1f')][_0x30cb('0x33')]({'where':{'id':_0x58ad65[_0x30cb('0x29')]['id']}})[_0x30cb('0x14')](handleEntityNotFound(_0x450114,null))[_0x30cb('0x14')](function(_0x26cf2a){if(_0x26cf2a){return _0x26cf2a[_0x30cb('0x72')](_0x58ad65[_0x30cb('0x36')][_0x30cb('0x51')],_[_0x30cb('0x73')](_0x58ad65[_0x30cb('0x36')],[_0x30cb('0x51'),'id'])||{})[_0x30cb('0x74')](function(_0x39dea8){for(var _0x5f5beb=0x0;_0x5f5beb<_0x58ad65[_0x30cb('0x36')][_0x30cb('0x51')][_0x30cb('0x30')];_0x5f5beb+=0x1){socket[_0x30cb('0x70')](_0x30cb('0x58'),{'UserId':Number(_0x58ad65[_0x30cb('0x36')][_0x30cb('0x51')][_0x5f5beb]),'MailQueueId':Number(_0x58ad65[_0x30cb('0x29')]['id'])});}return _0x39dea8;});}})[_0x30cb('0x14')](respondWithResult(_0x450114,null))[_0x30cb('0x34')](handleError(_0x450114,null));};exports[_0x30cb('0x75')]=function(_0x5a931c,_0x30b909){return db[_0x30cb('0x1f')][_0x30cb('0x33')]({'where':{'id':_0x5a931c['params']['id']}})[_0x30cb('0x14')](handleEntityNotFound(_0x30b909,null))[_0x30cb('0x14')](function(_0x79b8dc){if(_0x79b8dc){return _0x79b8dc['removeAgents'](_0x5a931c['query'][_0x30cb('0x51')])[_0x30cb('0x14')](function(){if(_[_0x30cb('0x76')](_0x5a931c[_0x30cb('0x26')][_0x30cb('0x51')])){for(var _0x56301b=0x0;_0x56301b<_0x5a931c['query'][_0x30cb('0x51')][_0x30cb('0x30')];_0x56301b+=0x1){socket[_0x30cb('0x70')]('userMailQueue:remove',{'UserId':Number(_0x5a931c[_0x30cb('0x26')][_0x30cb('0x51')][_0x56301b]),'MailQueueId':Number(_0x5a931c['params']['id'])});}}else{socket[_0x30cb('0x70')](_0x30cb('0x71'),{'UserId':Number(_0x5a931c[_0x30cb('0x26')][_0x30cb('0x51')]),'MailQueueId':Number(_0x5a931c[_0x30cb('0x29')]['id'])});}});}})[_0x30cb('0x14')](respondWithStatusCode(_0x30b909,null))[_0x30cb('0x34')](handleError(_0x30b909,null));};exports[_0x30cb('0x77')]=function(_0x45f228,_0x5a3b0b){var _0xd9c7a6={};var _0x668c04={};var _0xeb754;var _0x1ea447;return db['MailQueue'][_0x30cb('0x3d')]({'where':{'id':_0x45f228['params']['id']}})['then'](handleEntityNotFound(_0x5a3b0b,null))[_0x30cb('0x14')](function(_0x54aea3){if(_0x54aea3){_0xeb754=_0x54aea3;_0x668c04[_0x30cb('0x2a')]=_['keys'](db['User'][_0x30cb('0x20')]);_0x668c04[_0x30cb('0x26')]=_[_0x30cb('0x2b')](_0x45f228[_0x30cb('0x26')]);_0x668c04['filters']=_['intersection'](_0x668c04[_0x30cb('0x2a')],_0x668c04[_0x30cb('0x26')]);_0xd9c7a6[_0x30cb('0x2e')]=_[_0x30cb('0x2d')](_0x668c04[_0x30cb('0x2a')],qs[_0x30cb('0x2f')](_0x45f228[_0x30cb('0x26')][_0x30cb('0x2f')]));_0xd9c7a6[_0x30cb('0x2e')]=_0xd9c7a6[_0x30cb('0x2e')]['length']?_0xd9c7a6['attributes']:_0x668c04[_0x30cb('0x2a')];_0xd9c7a6['order']=qs['sort'](_0x45f228[_0x30cb('0x26')][_0x30cb('0x42')]);_0xd9c7a6[_0x30cb('0x43')]=qs[_0x30cb('0x2c')](_[_0x30cb('0x44')](_0x45f228[_0x30cb('0x26')],_0x668c04[_0x30cb('0x2c')]));if(_0x45f228[_0x30cb('0x26')][_0x30cb('0x46')]){_0xd9c7a6['where']=_[_0x30cb('0x31')](_0xd9c7a6[_0x30cb('0x43')],{'$or':_[_0x30cb('0x1e')](_0xd9c7a6['attributes'],function(_0x591903){var _0x51768b={};_0x51768b[_0x591903]={'$like':'%'+_0x45f228[_0x30cb('0x26')][_0x30cb('0x46')]+'%'};return _0x51768b;})});}_0xd9c7a6=_['merge']({},_0xd9c7a6,_0x45f228[_0x30cb('0x32')]);return _0xeb754['getAgents'](_0xd9c7a6);}})[_0x30cb('0x14')](function(_0x4d2e62){if(_0x4d2e62){_0x1ea447=_0x4d2e62[_0x30cb('0x30')];if(!_0x45f228['query'][_0x30cb('0x3f')]('nolimit')){_0xd9c7a6['limit']=qs['limit'](_0x45f228['query']['limit']);_0xd9c7a6['offset']=qs[_0x30cb('0x10')](_0x45f228[_0x30cb('0x26')][_0x30cb('0x10')]);}return _0xeb754[_0x30cb('0x77')](_0xd9c7a6);}})['then'](function(_0x2480dc){if(_0x2480dc){return _0x2480dc?{'count':_0x1ea447,'rows':_0x2480dc}:null;}})[_0x30cb('0x14')](respondWithResult(_0x5a3b0b,null))['catch'](handleError(_0x5a3b0b,null));}; \ No newline at end of file +var _0xc957=['pick','hasOwnProperty','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','emit','userMailQueue:save','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','union','compact','value','removeTeams','isEmpty','forEach','userMailQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','redis','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','get','MailQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','key','where','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','fields','nolimit','order','sort','filter','findAll','User','findAndCountAll','agent','mailPause','createdAt','%s/%s','SIP','getTeams','findOne','Team'];(function(_0x79f5a7,_0x570dfb){var _0x43fb06=function(_0x14d156){while(--_0x14d156){_0x79f5a7['push'](_0x79f5a7['shift']());}};_0x43fb06(++_0x570dfb);}(_0xc957,0x98));var _0x7c95=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xc957[_0x47b58b];return _0x46bebe;};'use strict';var BPromise=require(_0x7c95('0x0'));var util=require('util');var _=require(_0x7c95('0x1'));var squel=require('squel');var Redis=require(_0x7c95('0x2'));var qs=require(_0x7c95('0x3'));var logger=require(_0x7c95('0x4'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7c95('0x5')]=_['defaults'](config['redis'],{'host':_0x7c95('0x6'),'port':0x18eb});var socket=require(_0x7c95('0x7'))(new Redis(config[_0x7c95('0x5')]));require('./mailQueue.socket')[_0x7c95('0x8')](socket);function respondWithStatusCode(_0x1e42eb,_0x473328){_0x473328=_0x473328||0xcc;return function(_0x3af5a5){if(_0x3af5a5){return _0x1e42eb['sendStatus'](_0x473328);}return _0x1e42eb[_0x7c95('0x9')](_0x473328)[_0x7c95('0xa')]();};}function respondWithResult(_0x55e164,_0xb26954){_0xb26954=_0xb26954||0xc8;return function(_0x147e32){if(_0x147e32){return _0x55e164[_0x7c95('0x9')](_0xb26954)[_0x7c95('0xb')](_0x147e32);}};}function respondWithFilteredResult(_0x567b1e,_0x281ff8){return function(_0x1341f8){if(_0x1341f8){var _0x8f5e92=typeof _0x281ff8['offset']===_0x7c95('0xc')&&typeof _0x281ff8[_0x7c95('0xd')]===_0x7c95('0xc');var _0x125561=_0x1341f8[_0x7c95('0xe')];var _0x5c3859=_0x8f5e92?0x0:_0x281ff8[_0x7c95('0xf')];var _0x330f14=_0x8f5e92?_0x1341f8[_0x7c95('0xe')]:_0x281ff8[_0x7c95('0xf')]+_0x281ff8[_0x7c95('0xd')];var _0x1dbfa0;if(_0x330f14>=_0x125561){_0x330f14=_0x125561;_0x1dbfa0=0xc8;}else{_0x1dbfa0=0xce;}_0x567b1e['status'](_0x1dbfa0);return _0x567b1e[_0x7c95('0x10')](_0x7c95('0x11'),_0x5c3859+'-'+_0x330f14+'/'+_0x125561)[_0x7c95('0xb')](_0x1341f8);}return null;};}function saveUpdates(_0x466ea8){return function(_0xde0fb3){if(_0xde0fb3){return _0xde0fb3[_0x7c95('0x12')](_0x466ea8)['then'](function(_0x2909b6){return _0x2909b6;});}return null;};}function removeEntity(_0x24cb18){return function(_0x376942){if(_0x376942){return _0x376942['destroy']()[_0x7c95('0x13')](function(){var _0x26ff06=_0x376942[_0x7c95('0x14')]({'plain':!![]});var _0xcd621d=_0x7c95('0x15');return db[_0x7c95('0x16')][_0x7c95('0x17')]({'where':{'type':_0xcd621d,'resourceId':_0x26ff06['id']}})[_0x7c95('0x13')](function(){return _0x376942;});})[_0x7c95('0x13')](function(){_0x24cb18[_0x7c95('0x9')](0xcc)[_0x7c95('0xa')]();});}};}function handleEntityNotFound(_0x3f9c4b){return function(_0x5e928e){if(!_0x5e928e){_0x3f9c4b[_0x7c95('0x18')](0x194);}return _0x5e928e;};}function handleError(_0x3eae9f,_0x40c60a){_0x40c60a=_0x40c60a||0x1f4;return function(_0x2e23b8){logger[_0x7c95('0x19')](_0x2e23b8[_0x7c95('0x1a')]);if(_0x2e23b8['name']){delete _0x2e23b8[_0x7c95('0x1b')];}_0x3eae9f[_0x7c95('0x9')](_0x40c60a)[_0x7c95('0x1c')](_0x2e23b8);};}exports['index']=function(_0xf2bfb7,_0x471dba){var _0x2bfd58={};var _0x5307c9={'count':0x0,'rows':[]};var _0x177545=_[_0x7c95('0x1d')](db[_0x7c95('0x1e')][_0x7c95('0x1f')],function(_0x4e7a2){return{'name':_0x4e7a2[_0x7c95('0x20')],'type':_0x4e7a2[_0x7c95('0x21')][_0x7c95('0x22')]};});_0x2bfd58=qs['getOptions'](_0x177545,_0xf2bfb7);var _0x4e7f7d={'where':_0x2bfd58[_0x7c95('0x23')]};return db[_0x7c95('0x1e')][_0x7c95('0xe')](_0x4e7f7d)[_0x7c95('0x13')](function(_0x1a8008){_0x5307c9[_0x7c95('0xe')]=_0x1a8008;_0x2bfd58[_0x7c95('0x24')]=qs[_0x7c95('0x24')](_0xf2bfb7[_0x7c95('0x25')]);return db[_0x7c95('0x1e')]['findAll'](_0x2bfd58);})[_0x7c95('0x13')](function(_0x1519f6){_0x5307c9[_0x7c95('0x26')]=_0x1519f6;return _0x5307c9;})[_0x7c95('0x13')](respondWithFilteredResult(_0x471dba,_0x2bfd58))[_0x7c95('0x27')](handleError(_0x471dba,null));};exports[_0x7c95('0x28')]=function(_0x407875,_0x203b7c){var _0x324c3d={'raw':!![],'where':{'id':_0x407875[_0x7c95('0x29')]['id']}},_0x8e26d2={};_0x8e26d2[_0x7c95('0x2a')]=_[_0x7c95('0x2b')](db[_0x7c95('0x1e')]['rawAttributes']);_0x8e26d2['query']=_[_0x7c95('0x2b')](_0x407875['query']);_0x8e26d2[_0x7c95('0x2c')]=_[_0x7c95('0x2d')](_0x8e26d2['model'],_0x8e26d2[_0x7c95('0x25')]);_0x324c3d[_0x7c95('0x2e')]=_['intersection'](_0x8e26d2[_0x7c95('0x2a')],qs['fields'](_0x407875[_0x7c95('0x25')]['fields']));_0x324c3d['attributes']=_0x324c3d[_0x7c95('0x2e')][_0x7c95('0x2f')]?_0x324c3d['attributes']:_0x8e26d2[_0x7c95('0x2a')];if(_0x407875['query'][_0x7c95('0x30')]){_0x324c3d[_0x7c95('0x24')]=[{'all':!![]}];}_0x324c3d=_[_0x7c95('0x31')]({},_0x324c3d,_0x407875[_0x7c95('0x32')]);return db[_0x7c95('0x1e')][_0x7c95('0x33')](_0x324c3d)['then'](handleEntityNotFound(_0x203b7c,null))[_0x7c95('0x13')](respondWithResult(_0x203b7c,null))['catch'](handleError(_0x203b7c,null));};exports[_0x7c95('0x34')]=function(_0x48ca51,_0x180959){return db[_0x7c95('0x1e')]['create'](_0x48ca51[_0x7c95('0x35')],{})['then'](function(_0x5b1876){var _0x9a273a=_0x48ca51[_0x7c95('0x36')]['get']({'plain':!![]});if(!_0x9a273a)throw new Error(_0x7c95('0x37'));if(_0x9a273a[_0x7c95('0x38')]===_0x7c95('0x36')){var _0x5baaba=_0x5b1876[_0x7c95('0x14')]({'plain':!![]});var _0x29af22=_0x7c95('0x15');return db['UserProfileSection'][_0x7c95('0x33')]({'where':{'name':_0x29af22,'userProfileId':_0x9a273a['userProfileId']},'raw':!![]})['then'](function(_0x39252a){if(_0x39252a&&_0x39252a[_0x7c95('0x39')]===0x0){return db[_0x7c95('0x16')][_0x7c95('0x34')]({'name':_0x5baaba[_0x7c95('0x1b')],'resourceId':_0x5baaba['id'],'type':_0x39252a[_0x7c95('0x1b')],'sectionId':_0x39252a['id']},{})['then'](function(){return _0x5b1876;});}else{return _0x5b1876;}})[_0x7c95('0x27')](function(_0x589d58){logger[_0x7c95('0x19')](_0x7c95('0x3a'),_0x589d58);throw _0x589d58;});}return _0x5b1876;})[_0x7c95('0x13')](respondWithResult(_0x180959,0xc9))[_0x7c95('0x27')](handleError(_0x180959,null));};exports['update']=function(_0x432781,_0x42bc0b){if(_0x432781[_0x7c95('0x35')]['id']){delete _0x432781[_0x7c95('0x35')]['id'];}return db[_0x7c95('0x1e')]['find']({'where':{'id':_0x432781[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x42bc0b,null))[_0x7c95('0x13')](saveUpdates(_0x432781[_0x7c95('0x35')],null))[_0x7c95('0x13')](respondWithResult(_0x42bc0b,null))['catch'](handleError(_0x42bc0b,null));};exports[_0x7c95('0x17')]=function(_0x37833c,_0x234dd0){return db[_0x7c95('0x1e')][_0x7c95('0x33')]({'where':{'id':_0x37833c[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x234dd0,null))['then'](removeEntity(_0x234dd0,null))[_0x7c95('0x27')](handleError(_0x234dd0,null));};exports['describe']=function(_0x59d74e,_0x194392){return db[_0x7c95('0x1e')][_0x7c95('0x3b')]()[_0x7c95('0x13')](respondWithResult(_0x194392,null))[_0x7c95('0x27')](handleError(_0x194392,null));};exports[_0x7c95('0x3c')]=function(_0x328936,_0x34451a){var _0x1f028b={'raw':!![],'where':{}},_0x2260f5={},_0xbd0015;return db[_0x7c95('0x1e')]['findOne']({'where':{'id':_0x328936['params']['id']}})['then'](handleEntityNotFound(_0x34451a,null))[_0x7c95('0x13')](function(_0x2ff330){if(_0x2ff330){_0xbd0015=_0x2ff330['get']({'plain':!![]});_0x2260f5[_0x7c95('0x2a')]=_[_0x7c95('0x2b')](db[_0x7c95('0x3d')]['rawAttributes']);_0x2260f5['query']=_[_0x7c95('0x2b')](_0x328936['query']);_0x2260f5[_0x7c95('0x2c')]=_[_0x7c95('0x2d')](_0x2260f5[_0x7c95('0x2a')],_0x2260f5[_0x7c95('0x25')]);_0x1f028b['attributes']=_[_0x7c95('0x2d')](_0x2260f5[_0x7c95('0x2a')],qs['fields'](_0x328936[_0x7c95('0x25')][_0x7c95('0x3e')]));_0x1f028b[_0x7c95('0x2e')]=_0x1f028b[_0x7c95('0x2e')][_0x7c95('0x2f')]?_0x1f028b[_0x7c95('0x2e')]:_0x2260f5[_0x7c95('0x2a')];if(!_0x328936['query']['hasOwnProperty'](_0x7c95('0x3f'))){_0x1f028b[_0x7c95('0xd')]=qs[_0x7c95('0xd')](_0x328936[_0x7c95('0x25')][_0x7c95('0xd')]);_0x1f028b[_0x7c95('0xf')]=qs[_0x7c95('0xf')](_0x328936[_0x7c95('0x25')]['offset']);}_0x1f028b[_0x7c95('0x40')]=qs[_0x7c95('0x41')](_0x328936[_0x7c95('0x25')][_0x7c95('0x41')]);_0x1f028b['where']=qs[_0x7c95('0x2c')](_['pick'](_0x328936[_0x7c95('0x25')],_0x2260f5[_0x7c95('0x2c')]));_0x1f028b[_0x7c95('0x23')]['MailQueueId']=_0x2ff330['id'];if(_0x328936[_0x7c95('0x25')][_0x7c95('0x42')]){_0x1f028b[_0x7c95('0x23')]=_[_0x7c95('0x31')](_0x1f028b[_0x7c95('0x23')],{'$or':_['map'](_0x1f028b['attributes'],function(_0xa9d05e){var _0x45f1ff={};_0x45f1ff[_0xa9d05e]={'$like':'%'+_0x328936[_0x7c95('0x25')][_0x7c95('0x42')]+'%'};return _0x45f1ff;})});}_0x1f028b=_['merge']({},_0x1f028b,_0x328936[_0x7c95('0x32')]);return db[_0x7c95('0x3d')][_0x7c95('0x43')](_0x1f028b);}})[_0x7c95('0x13')](function(_0x1d272d){if(_0x1d272d){return db[_0x7c95('0x44')][_0x7c95('0x45')]({'where':{'id':_[_0x7c95('0x1d')](_0x1d272d,'UserId'),'role':_0x7c95('0x46')},'attributes':['id','name',_0x7c95('0x47'),'updatedAt',_0x7c95('0x48')]});}})[_0x7c95('0x13')](function(_0x19c173){if(_0x19c173){return{'count':_0x19c173[_0x7c95('0xe')],'rows':_[_0x7c95('0x1d')](_0x19c173[_0x7c95('0x26')],function(_0x4d50e0){return{'membername':_0x4d50e0[_0x7c95('0x1b')],'UserId':_0x4d50e0['id'],'queue_name':_0xbd0015[_0x7c95('0x1b')],'MailQueueId':_0xbd0015['id'],'interface':util['format'](_0x7c95('0x49'),_0x7c95('0x4a'),_0x4d50e0[_0x7c95('0x1b')]),'penalty':0x0,'paused':_0x4d50e0[_0x7c95('0x47')],'createdAt':_0x4d50e0[_0x7c95('0x48')],'updatedAt':_0x4d50e0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c95('0x13')](respondWithFilteredResult(_0x34451a,_0x1f028b))[_0x7c95('0x27')](handleError(_0x34451a,null));};exports[_0x7c95('0x4b')]=function(_0x5b0e1e,_0x521e39){var _0x193c5f={};var _0x968c9f={};var _0x168a06;var _0x26a849;return db[_0x7c95('0x1e')][_0x7c95('0x4c')]({'where':{'id':_0x5b0e1e[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x521e39,null))[_0x7c95('0x13')](function(_0x301502){if(_0x301502){_0x168a06=_0x301502;_0x968c9f['model']=_['keys'](db[_0x7c95('0x4d')][_0x7c95('0x1f')]);_0x968c9f[_0x7c95('0x25')]=_[_0x7c95('0x2b')](_0x5b0e1e[_0x7c95('0x25')]);_0x968c9f['filters']=_[_0x7c95('0x2d')](_0x968c9f[_0x7c95('0x2a')],_0x968c9f[_0x7c95('0x25')]);_0x193c5f[_0x7c95('0x2e')]=_[_0x7c95('0x2d')](_0x968c9f['model'],qs[_0x7c95('0x3e')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0x3e')]));_0x193c5f[_0x7c95('0x2e')]=_0x193c5f[_0x7c95('0x2e')]['length']?_0x193c5f[_0x7c95('0x2e')]:_0x968c9f[_0x7c95('0x2a')];_0x193c5f['order']=qs[_0x7c95('0x41')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0x41')]);_0x193c5f[_0x7c95('0x23')]=qs[_0x7c95('0x2c')](_[_0x7c95('0x4e')](_0x5b0e1e['query'],_0x968c9f[_0x7c95('0x2c')]));if(_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0x42')]){_0x193c5f[_0x7c95('0x23')]=_[_0x7c95('0x31')](_0x193c5f[_0x7c95('0x23')],{'$or':_['map'](_0x193c5f[_0x7c95('0x2e')],function(_0x2f7c5d){var _0x2185b2={};_0x2185b2[_0x2f7c5d]={'$like':'%'+_0x5b0e1e['query'][_0x7c95('0x42')]+'%'};return _0x2185b2;})});}_0x193c5f=_[_0x7c95('0x31')]({},_0x193c5f,_0x5b0e1e[_0x7c95('0x32')]);return _0x168a06[_0x7c95('0x4b')](_0x193c5f);}})[_0x7c95('0x13')](function(_0x502d26){if(_0x502d26){_0x26a849=_0x502d26[_0x7c95('0x2f')];if(!_0x5b0e1e['query'][_0x7c95('0x4f')](_0x7c95('0x3f'))){_0x193c5f['limit']=qs[_0x7c95('0xd')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0xd')]);_0x193c5f[_0x7c95('0xf')]=qs[_0x7c95('0xf')](_0x5b0e1e[_0x7c95('0x25')][_0x7c95('0xf')]);}return _0x168a06[_0x7c95('0x4b')](_0x193c5f);}})['then'](function(_0x599b55){if(_0x599b55){return _0x599b55?{'count':_0x26a849,'rows':_0x599b55}:null;}})[_0x7c95('0x13')](respondWithResult(_0x521e39,null))['catch'](handleError(_0x521e39,null));};exports[_0x7c95('0x50')]=function(_0x348e11,_0x365caf){var _0x31138c=_0x348e11['body'][_0x7c95('0x51')];return db[_0x7c95('0x4d')][_0x7c95('0x43')]({'where':{'id':_0x31138c},'attributes':['id'],'include':[{'model':db[_0x7c95('0x44')],'as':_0x7c95('0x52'),'attributes':['id',_0x7c95('0x1b'),_0x7c95('0x53'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x2f1cb7){if(_0x2f1cb7){var _0x576299=_[_0x7c95('0x54')](_0x2f1cb7,function(_0x3945f6){var _0x5a4ed5=_0x3945f6[_0x7c95('0x14')]({'plain':!![]});return _0x5a4ed5[_0x7c95('0x52')];});return db['MailQueue'][_0x7c95('0x33')]({'where':{'id':_0x348e11[_0x7c95('0x29')]['id']}})['then'](function(_0x332e67){return db[_0x7c95('0x55')][_0x7c95('0x56')](function(_0x483905){return _0x332e67['addTeams'](_0x31138c,{'transaction':_0x483905})[_0x7c95('0x13')](function(){return BPromise[_0x7c95('0x57')](_0x576299,function(_0x4c5ab2){return db[_0x7c95('0x3d')]['findOrCreate']({'where':{'UserId':_0x4c5ab2['id'],'MailQueueId':_0x348e11[_0x7c95('0x29')]['id']},'transaction':_0x483905});});})['then'](function(){_0x576299['forEach'](function(_0xc4acc2){socket[_0x7c95('0x58')](_0x7c95('0x59'),{'UserId':_0xc4acc2['id'],'MailQueueId':_0x332e67['id']});});});});});}})[_0x7c95('0x13')](respondWithStatusCode(_0x365caf,null))[_0x7c95('0x27')](handleError(_0x365caf,null));};exports['removeTeams']=function(_0x396f53,_0x3c0a21){return db[_0x7c95('0x4d')]['findAll']({'where':{'id':_0x396f53[_0x7c95('0x25')][_0x7c95('0x51')]},'attributes':['id'],'include':[{'model':db[_0x7c95('0x44')],'as':_0x7c95('0x52'),'attributes':['id'],'raw':!![]}]})[_0x7c95('0x13')](handleEntityNotFound(_0x3c0a21,null))[_0x7c95('0x13')](function(_0x2615f8){var _0x3143d6=_[_0x7c95('0x1d')](_0x2615f8,'id');var _0x312a52=[];var _0x4f38c8=[];var _0x437cad=squel[_0x7c95('0x5a')]();_0x437cad[_0x7c95('0x5b')](_0x7c95('0x5c'))['from'](_0x7c95('0x5d'),'tq')[_0x7c95('0x5e')](_0x7c95('0x5f'),'ut',_0x7c95('0x60'))['where']('MailQueueId\x20=\x20?',_0x396f53['params']['id']);for(var _0x1e9a72=0x0;_0x1e9a72<_0x2615f8[_0x7c95('0x2f')];_0x1e9a72+=0x1){let _0x35939b=_0x2615f8[_0x1e9a72];for(var _0x281ed6=0x0;_0x281ed6<_0x35939b[_0x7c95('0x52')][_0x7c95('0x2f')];_0x281ed6+=0x1){let _0x42958c=_0x35939b['Agents'][_0x281ed6];var _0x5712ad=_0x437cad[_0x7c95('0x61')]();_0x5712ad[_0x7c95('0x23')](_0x7c95('0x62'),_0x42958c['id']);_0x4f38c8['push'](db[_0x7c95('0x55')][_0x7c95('0x25')](_0x5712ad[_0x7c95('0x63')](),{'type':db[_0x7c95('0x55')]['QueryTypes'][_0x7c95('0x64')]})[_0x7c95('0x13')](function(_0x27cf4b){if(_0x27cf4b[_0x7c95('0x2f')]===0x1){return _0x42958c['id'];}else{var _0x13edac=_['every'](_[_0x7c95('0x1d')](_0x27cf4b,_0x7c95('0x65')),function(_0x30a1c5){return _[_0x7c95('0x66')](_0x3143d6,_0x30a1c5);});if(_0x13edac){return _0x42958c['id'];}}}));}}return BPromise['all'](_0x4f38c8)[_0x7c95('0x13')](function(_0x1509d8){_0x312a52=_(_0x312a52)[_0x7c95('0x67')](_0x1509d8)[_0x7c95('0x68')]()[_0x7c95('0x69')]();return db[_0x7c95('0x1e')][_0x7c95('0x33')]({'where':{'id':_0x396f53[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](function(_0xe583d9){return db[_0x7c95('0x55')][_0x7c95('0x56')](function(_0x2d9e8e){return _0xe583d9[_0x7c95('0x6a')](_0x396f53[_0x7c95('0x25')][_0x7c95('0x51')],{'transaction':_0x2d9e8e})[_0x7c95('0x13')](function(){if(!_[_0x7c95('0x6b')](_0x312a52)){return _0xe583d9['removeAgents'](_0x312a52,{'transaction':_0x2d9e8e});}})[_0x7c95('0x13')](function(){_0x312a52[_0x7c95('0x6c')](function(_0x505271){socket[_0x7c95('0x58')](_0x7c95('0x6d'),{'UserId':_0x505271,'MailQueueId':_0xe583d9['id']});});});});});});})[_0x7c95('0x13')](respondWithStatusCode(_0x3c0a21,null))[_0x7c95('0x27')](handleError(_0x3c0a21,null));};exports[_0x7c95('0x6e')]=function(_0x7a4a6b,_0x4643e5){return db['MailQueue'][_0x7c95('0x33')]({'where':{'id':_0x7a4a6b[_0x7c95('0x29')]['id']}})['then'](handleEntityNotFound(_0x4643e5,null))[_0x7c95('0x13')](function(_0x57f513){if(_0x57f513){return _0x57f513[_0x7c95('0x6e')](_0x7a4a6b[_0x7c95('0x35')][_0x7c95('0x51')],_[_0x7c95('0x6f')](_0x7a4a6b[_0x7c95('0x35')],[_0x7c95('0x51'),'id'])||{})[_0x7c95('0x70')](function(_0x52af04){for(var _0x2ea4ec=0x0;_0x2ea4ec<_0x7a4a6b[_0x7c95('0x35')][_0x7c95('0x51')]['length'];_0x2ea4ec+=0x1){socket[_0x7c95('0x58')](_0x7c95('0x59'),{'UserId':Number(_0x7a4a6b[_0x7c95('0x35')][_0x7c95('0x51')][_0x2ea4ec]),'MailQueueId':Number(_0x7a4a6b[_0x7c95('0x29')]['id'])});}return _0x52af04;});}})[_0x7c95('0x13')](respondWithResult(_0x4643e5,null))[_0x7c95('0x27')](handleError(_0x4643e5,null));};exports['removeAgents']=function(_0x25e631,_0x3e0639){return db[_0x7c95('0x1e')][_0x7c95('0x33')]({'where':{'id':_0x25e631[_0x7c95('0x29')]['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x3e0639,null))[_0x7c95('0x13')](function(_0x5efed3){if(_0x5efed3){return _0x5efed3[_0x7c95('0x71')](_0x25e631[_0x7c95('0x25')][_0x7c95('0x51')])[_0x7c95('0x13')](function(){if(_['isArray'](_0x25e631[_0x7c95('0x25')][_0x7c95('0x51')])){for(var _0x55e041=0x0;_0x55e041<_0x25e631[_0x7c95('0x25')][_0x7c95('0x51')][_0x7c95('0x2f')];_0x55e041+=0x1){socket[_0x7c95('0x58')]('userMailQueue:remove',{'UserId':Number(_0x25e631['query'][_0x7c95('0x51')][_0x55e041]),'MailQueueId':Number(_0x25e631[_0x7c95('0x29')]['id'])});}}else{socket[_0x7c95('0x58')](_0x7c95('0x6d'),{'UserId':Number(_0x25e631['query'][_0x7c95('0x51')]),'MailQueueId':Number(_0x25e631[_0x7c95('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e0639,null))['catch'](handleError(_0x3e0639,null));};exports[_0x7c95('0x72')]=function(_0x582708,_0x13c892){var _0x89d0e7={};var _0x23e286={};var _0x418956;var _0xe3336c;return db['MailQueue'][_0x7c95('0x4c')]({'where':{'id':_0x582708['params']['id']}})[_0x7c95('0x13')](handleEntityNotFound(_0x13c892,null))[_0x7c95('0x13')](function(_0x586406){if(_0x586406){_0x418956=_0x586406;_0x23e286['model']=_[_0x7c95('0x2b')](db[_0x7c95('0x44')][_0x7c95('0x1f')]);_0x23e286[_0x7c95('0x25')]=_[_0x7c95('0x2b')](_0x582708[_0x7c95('0x25')]);_0x23e286[_0x7c95('0x2c')]=_[_0x7c95('0x2d')](_0x23e286[_0x7c95('0x2a')],_0x23e286[_0x7c95('0x25')]);_0x89d0e7[_0x7c95('0x2e')]=_[_0x7c95('0x2d')](_0x23e286[_0x7c95('0x2a')],qs[_0x7c95('0x3e')](_0x582708[_0x7c95('0x25')][_0x7c95('0x3e')]));_0x89d0e7[_0x7c95('0x2e')]=_0x89d0e7[_0x7c95('0x2e')]['length']?_0x89d0e7['attributes']:_0x23e286[_0x7c95('0x2a')];_0x89d0e7[_0x7c95('0x40')]=qs[_0x7c95('0x41')](_0x582708[_0x7c95('0x25')][_0x7c95('0x41')]);_0x89d0e7[_0x7c95('0x23')]=qs[_0x7c95('0x2c')](_[_0x7c95('0x4e')](_0x582708[_0x7c95('0x25')],_0x23e286[_0x7c95('0x2c')]));if(_0x582708[_0x7c95('0x25')]['filter']){_0x89d0e7[_0x7c95('0x23')]=_[_0x7c95('0x31')](_0x89d0e7[_0x7c95('0x23')],{'$or':_[_0x7c95('0x1d')](_0x89d0e7[_0x7c95('0x2e')],function(_0x234afa){var _0x2a33a9={};_0x2a33a9[_0x234afa]={'$like':'%'+_0x582708[_0x7c95('0x25')][_0x7c95('0x42')]+'%'};return _0x2a33a9;})});}_0x89d0e7=_[_0x7c95('0x31')]({},_0x89d0e7,_0x582708['options']);return _0x418956[_0x7c95('0x72')](_0x89d0e7);}})['then'](function(_0x10f833){if(_0x10f833){_0xe3336c=_0x10f833['length'];if(!_0x582708[_0x7c95('0x25')][_0x7c95('0x4f')]('nolimit')){_0x89d0e7[_0x7c95('0xd')]=qs['limit'](_0x582708[_0x7c95('0x25')][_0x7c95('0xd')]);_0x89d0e7[_0x7c95('0xf')]=qs[_0x7c95('0xf')](_0x582708[_0x7c95('0x25')][_0x7c95('0xf')]);}return _0x418956[_0x7c95('0x72')](_0x89d0e7);}})[_0x7c95('0x13')](function(_0x131e37){if(_0x131e37){return _0x131e37?{'count':_0xe3336c,'rows':_0x131e37}:null;}})[_0x7c95('0x13')](respondWithResult(_0x13c892,null))[_0x7c95('0x27')](handleError(_0x13c892,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 045701b..e947edc 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 _0xfbe1=['emit','hasOwnProperty','exports','setMaxListeners','save','update'];(function(_0x1e04b0,_0x999b86){var _0x5c0136=function(_0x4600b0){while(--_0x4600b0){_0x1e04b0['push'](_0x1e04b0['shift']());}};_0x5c0136(++_0x999b86);}(_0xfbe1,0x7b));var _0x1fbe=function(_0x131ad9,_0x46f5d8){_0x131ad9=_0x131ad9-0x0;var _0x37c28a=_0xfbe1[_0x131ad9];return _0x37c28a;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1fbe('0x0')](0x0);var events={'afterCreate':_0x1fbe('0x1'),'afterUpdate':_0x1fbe('0x2'),'afterDestroy':'remove'};function emitEvent(_0x30f5c2){return function(_0x15af21,_0x3506bf,_0x3ca0eb){MailQueueEvents[_0x1fbe('0x3')](_0x30f5c2+':'+_0x15af21['id'],_0x15af21);MailQueueEvents['emit'](_0x30f5c2,_0x15af21);_0x3ca0eb(null);};}for(var e in events){if(events[_0x1fbe('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x1fbe('0x5')]=MailQueueEvents; \ No newline at end of file +var _0x70dc=['MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x70dc,0x80));var _0xc70d=function(_0xc50fc4,_0x56db19){_0xc50fc4=_0xc50fc4-0x0;var _0x5547c9=_0x70dc[_0xc50fc4];return _0x5547c9;};'use strict';var EventEmitter=require(_0xc70d('0x0'));var MailQueue=require(_0xc70d('0x1'))['db'][_0xc70d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc70d('0x3')](0x0);var events={'afterCreate':_0xc70d('0x4'),'afterUpdate':_0xc70d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2bbe24){return function(_0xc368,_0x363a89,_0x55cb9e){MailQueueEvents[_0xc70d('0x6')](_0x2bbe24+':'+_0xc368['id'],_0xc368);MailQueueEvents[_0xc70d('0x6')](_0x2bbe24,_0xc368);_0x55cb9e(null);};}for(var e in events){if(events[_0xc70d('0x7')](e)){var event=events[e];MailQueue[_0xc70d('0x8')](e,emitEvent(event));}}module[_0xc70d('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 89cc5bf..445fb96 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 _0x8b88=['request-promise','path','../../config/environment','exports','define','MailQueue','lodash','util','../../config/logger','api','bluebird'];(function(_0xfd440d,_0x208e33){var _0x2f041f=function(_0x20f4f4){while(--_0x20f4f4){_0xfd440d['push'](_0xfd440d['shift']());}};_0x2f041f(++_0x208e33);}(_0x8b88,0x12f));var _0x88b8=function(_0x3bd28b,_0x168b1f){_0x3bd28b=_0x3bd28b-0x0;var _0x4e4864=_0x8b88[_0x3bd28b];return _0x4e4864;};'use strict';var _=require(_0x88b8('0x0'));var util=require(_0x88b8('0x1'));var logger=require(_0x88b8('0x2'))(_0x88b8('0x3'));var moment=require('moment');var BPromise=require(_0x88b8('0x4'));var rp=require(_0x88b8('0x5'));var fs=require('fs');var path=require(_0x88b8('0x6'));var rimraf=require('rimraf');var config=require(_0x88b8('0x7'));var attributes=require('./mailQueue.attributes');module[_0x88b8('0x8')]=function(_0x59159a,_0x55e06f){return _0x59159a[_0x88b8('0x9')](_0x88b8('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc979=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./mailQueue.attributes','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc979,0xab));var _0x9c97=function(_0x1b660b,_0x20d60f){_0x1b660b=_0x1b660b-0x0;var _0x41ea4b=_0xc979[_0x1b660b];return _0x41ea4b;};'use strict';var _=require(_0x9c97('0x0'));var util=require(_0x9c97('0x1'));var logger=require(_0x9c97('0x2'))(_0x9c97('0x3'));var moment=require(_0x9c97('0x4'));var BPromise=require(_0x9c97('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c97('0x6'));var attributes=require(_0x9c97('0x7'));module[_0x9c97('0x8')]=function(_0x933e15,_0x24ebd9){return _0x933e15[_0x9c97('0x9')](_0x9c97('0xa'),attributes,{'tableName':_0x9c97('0xb'),'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 77bf5f1..c502037 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 _0x24ef=['attributes','limit','include','map','model','debug','ShowMailQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where'];(function(_0x5c8edb,_0x105253){var _0x5a1451=function(_0x5371f8){while(--_0x5371f8){_0x5c8edb['push'](_0x5c8edb['shift']());}};_0x5a1451(++_0x105253);}(_0x24ef,0xdf));var _0xf24e=function(_0xc158a8,_0x2c9a70){_0xc158a8=_0xc158a8-0x0;var _0x31f1a4=_0x24ef[_0xc158a8];return _0x31f1a4;};'use strict';var _=require(_0xf24e('0x0'));var util=require('util');var moment=require(_0xf24e('0x1'));var BPromise=require(_0xf24e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf24e('0x3'));var db=require(_0xf24e('0x4'))['db'];var utils=require(_0xf24e('0x5'));var logger=require(_0xf24e('0x6'))(_0xf24e('0x7'));var config=require(_0xf24e('0x8'));var jayson=require(_0xf24e('0x9'));var client=jayson[_0xf24e('0xa')][_0xf24e('0xb')]({'port':0x232a});config[_0xf24e('0xc')]=_[_0xf24e('0xd')](config['redis'],{'host':_0xf24e('0xe'),'port':0x18eb});var socket=require(_0xf24e('0xf'))(new Redis(config[_0xf24e('0xc')]));require(_0xf24e('0x10'))[_0xf24e('0x11')](socket);function respondWithRpcPromise(_0x593dba,_0x4dd242,_0x486091){return new BPromise(function(_0x1cee5d,_0x3e5dc6){return client[_0xf24e('0x12')](_0x593dba,_0x486091)[_0xf24e('0x13')](function(_0x22ef01){logger[_0xf24e('0x14')](_0xf24e('0x15'),_0x4dd242,_0xf24e('0x16'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x4dd242,_0xf24e('0x16'),JSON[_0xf24e('0x17')](_0x22ef01));if(_0x22ef01[_0xf24e('0x18')]){if(_0x22ef01['error'][_0xf24e('0x19')]===0x1f4){logger['error'](_0xf24e('0x15'),_0x4dd242,_0x22ef01['error'][_0xf24e('0x1a')]);return _0x3e5dc6(_0x22ef01['error'][_0xf24e('0x1a')]);}logger[_0xf24e('0x18')](_0xf24e('0x15'),_0x4dd242,_0x22ef01['error'][_0xf24e('0x1a')]);return _0x1cee5d(_0x22ef01[_0xf24e('0x18')][_0xf24e('0x1a')]);}else{logger['info'](_0xf24e('0x15'),_0x4dd242,_0xf24e('0x16'));_0x1cee5d(_0x22ef01[_0xf24e('0x1b')][_0xf24e('0x1a')]);}})[_0xf24e('0x1c')](function(_0x1ecba3){logger[_0xf24e('0x18')](_0xf24e('0x15'),_0x4dd242,_0x1ecba3);_0x3e5dc6(_0x1ecba3);});});}exports[_0xf24e('0x1d')]=function(_0x5b7d67){var _0x39079f=this;return new Promise(function(_0x18e053,_0x46dcbb){return db[_0xf24e('0x1e')][_0xf24e('0x1f')]({'raw':_0x5b7d67[_0xf24e('0x20')]?_0x5b7d67[_0xf24e('0x20')][_0xf24e('0x21')]===undefined?!![]:![]:!![],'where':_0x5b7d67[_0xf24e('0x20')]?_0x5b7d67[_0xf24e('0x20')][_0xf24e('0x22')]||null:null,'attributes':_0x5b7d67[_0xf24e('0x20')]?_0x5b7d67['options'][_0xf24e('0x23')]||null:null,'limit':_0x5b7d67[_0xf24e('0x20')]?_0x5b7d67[_0xf24e('0x20')][_0xf24e('0x24')]||null:null,'include':_0x5b7d67[_0xf24e('0x20')]?_0x5b7d67['options'][_0xf24e('0x25')]?_[_0xf24e('0x26')](_0x5b7d67[_0xf24e('0x20')][_0xf24e('0x25')],function(_0x3ca5c6){return{'model':db[_0x3ca5c6[_0xf24e('0x27')]],'as':_0x3ca5c6['as'],'attributes':_0x3ca5c6[_0xf24e('0x23')],'include':_0x3ca5c6[_0xf24e('0x25')]?_[_0xf24e('0x26')](_0x3ca5c6['include'],function(_0x10bd1f){return{'model':db[_0x10bd1f[_0xf24e('0x27')]],'as':_0x10bd1f['as'],'attributes':_0x10bd1f[_0xf24e('0x23')],'include':_0x10bd1f['include']?_[_0xf24e('0x26')](_0x10bd1f[_0xf24e('0x25')],function(_0x1190ab){return{'model':db[_0x1190ab[_0xf24e('0x27')]],'as':_0x1190ab['as'],'attributes':_0x1190ab[_0xf24e('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf24e('0x13')](function(_0x5361e7){logger[_0xf24e('0x14')](_0xf24e('0x1d'),_0x5b7d67);logger[_0xf24e('0x28')](_0xf24e('0x1d'),_0x5b7d67,JSON[_0xf24e('0x17')](_0x5361e7));_0x18e053(_0x5361e7);})['catch'](function(_0x1e7627){logger[_0xf24e('0x18')](_0xf24e('0x1d'),_0x1e7627['message'],_0x5b7d67);_0x46dcbb(_0x39079f[_0xf24e('0x18')](0x1f4,_0x1e7627[_0xf24e('0x1a')]));});});};exports[_0xf24e('0x29')]=function(_0xdf7a61){var _0x4a0ef7=this;return new Promise(function(_0x1bbd39,_0x27e016){return db['MailQueue'][_0xf24e('0x2a')]({'raw':_0xdf7a61[_0xf24e('0x20')]?_0xdf7a61['options']['raw']===undefined?!![]:![]:!![],'where':_0xdf7a61[_0xf24e('0x20')]?_0xdf7a61[_0xf24e('0x20')][_0xf24e('0x22')]||null:null,'attributes':_0xdf7a61[_0xf24e('0x20')]?_0xdf7a61[_0xf24e('0x20')][_0xf24e('0x23')]||null:null,'include':_0xdf7a61[_0xf24e('0x20')]?_0xdf7a61[_0xf24e('0x20')][_0xf24e('0x25')]?_[_0xf24e('0x26')](_0xdf7a61[_0xf24e('0x20')][_0xf24e('0x25')],function(_0x17db02){return{'model':db[_0x17db02[_0xf24e('0x27')]],'as':_0x17db02['as'],'attributes':_0x17db02[_0xf24e('0x23')],'include':_0x17db02['include']?_[_0xf24e('0x26')](_0x17db02[_0xf24e('0x25')],function(_0x40894e){return{'model':db[_0x40894e[_0xf24e('0x27')]],'as':_0x40894e['as'],'attributes':_0x40894e[_0xf24e('0x23')],'include':_0x40894e[_0xf24e('0x25')]?_['map'](_0x40894e[_0xf24e('0x25')],function(_0x2e47d4){return{'model':db[_0x2e47d4['model']],'as':_0x2e47d4['as'],'attributes':_0x2e47d4[_0xf24e('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20d6a6){logger['info']('ShowMailQueue',_0xdf7a61);logger['debug'](_0xf24e('0x29'),_0xdf7a61,JSON[_0xf24e('0x17')](_0x20d6a6));_0x1bbd39(_0x20d6a6);})['catch'](function(_0x369da8){logger[_0xf24e('0x18')](_0xf24e('0x29'),_0x369da8['message'],_0xdf7a61);_0x27e016(_0x4a0ef7[_0xf24e('0x18')](0x1f4,_0x369da8[_0xf24e('0x1a')]));});});}; \ No newline at end of file +var _0x55f4=['model','info','find','ShowMailQueue','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','include'];(function(_0x41f272,_0x5351f5){var _0x55cff3=function(_0x275c76){while(--_0x275c76){_0x41f272['push'](_0x41f272['shift']());}};_0x55cff3(++_0x5351f5);}(_0x55f4,0x1f1));var _0x455f=function(_0x3ae9ce,_0x5bed25){_0x3ae9ce=_0x3ae9ce-0x0;var _0x54bad0=_0x55f4[_0x3ae9ce];return _0x54bad0;};'use strict';var _=require(_0x455f('0x0'));var util=require('util');var moment=require(_0x455f('0x1'));var BPromise=require(_0x455f('0x2'));var rs=require(_0x455f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x455f('0x4'))['db'];var utils=require(_0x455f('0x5'));var logger=require(_0x455f('0x6'))(_0x455f('0x7'));var config=require(_0x455f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x455f('0x9')][_0x455f('0xa')]({'port':0x232a});config[_0x455f('0xb')]=_[_0x455f('0xc')](config['redis'],{'host':_0x455f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x455f('0xb')]));require(_0x455f('0xe'))[_0x455f('0xf')](socket);function respondWithRpcPromise(_0xbd97bf,_0x30fd78,_0x3cd760){return new BPromise(function(_0x59e3ae,_0x1e8243){return client[_0x455f('0x10')](_0xbd97bf,_0x3cd760)[_0x455f('0x11')](function(_0x353578){logger['info']('MailQueue,\x20%s,\x20%s',_0x30fd78,_0x455f('0x12'));logger['debug'](_0x455f('0x13'),_0x30fd78,_0x455f('0x12'),JSON[_0x455f('0x14')](_0x353578));if(_0x353578[_0x455f('0x15')]){if(_0x353578[_0x455f('0x15')][_0x455f('0x16')]===0x1f4){logger[_0x455f('0x15')](_0x455f('0x17'),_0x30fd78,_0x353578[_0x455f('0x15')][_0x455f('0x18')]);return _0x1e8243(_0x353578['error'][_0x455f('0x18')]);}logger[_0x455f('0x15')](_0x455f('0x17'),_0x30fd78,_0x353578[_0x455f('0x15')][_0x455f('0x18')]);return _0x59e3ae(_0x353578[_0x455f('0x15')]['message']);}else{logger['info'](_0x455f('0x17'),_0x30fd78,_0x455f('0x12'));_0x59e3ae(_0x353578[_0x455f('0x19')][_0x455f('0x18')]);}})[_0x455f('0x1a')](function(_0x327fd8){logger[_0x455f('0x15')]('MailQueue,\x20%s,\x20%s',_0x30fd78,_0x327fd8);_0x1e8243(_0x327fd8);});});}exports[_0x455f('0x1b')]=function(_0x5be6c8){var _0x4e2eaa=this;return new Promise(function(_0x19cc7c,_0x4a32aa){return db[_0x455f('0x1c')]['findAll']({'raw':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8[_0x455f('0x1d')][_0x455f('0x1e')]===undefined?!![]:![]:!![],'where':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8['options'][_0x455f('0x1f')]||null:null,'attributes':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8[_0x455f('0x1d')][_0x455f('0x20')]||null:null,'limit':_0x5be6c8['options']?_0x5be6c8[_0x455f('0x1d')][_0x455f('0x21')]||null:null,'include':_0x5be6c8[_0x455f('0x1d')]?_0x5be6c8[_0x455f('0x1d')]['include']?_[_0x455f('0x22')](_0x5be6c8[_0x455f('0x1d')][_0x455f('0x23')],function(_0x135d71){return{'model':db[_0x135d71[_0x455f('0x24')]],'as':_0x135d71['as'],'attributes':_0x135d71[_0x455f('0x20')],'include':_0x135d71[_0x455f('0x23')]?_[_0x455f('0x22')](_0x135d71['include'],function(_0x167dd5){return{'model':db[_0x167dd5[_0x455f('0x24')]],'as':_0x167dd5['as'],'attributes':_0x167dd5[_0x455f('0x20')],'include':_0x167dd5[_0x455f('0x23')]?_[_0x455f('0x22')](_0x167dd5[_0x455f('0x23')],function(_0x3edd4c){return{'model':db[_0x3edd4c[_0x455f('0x24')]],'as':_0x3edd4c['as'],'attributes':_0x3edd4c['attributes']};}):[]};}):[]};}):[]:[]})[_0x455f('0x11')](function(_0x3892ac){logger[_0x455f('0x25')](_0x455f('0x1b'),_0x5be6c8);logger['debug']('GetMailQueue',_0x5be6c8,JSON[_0x455f('0x14')](_0x3892ac));_0x19cc7c(_0x3892ac);})[_0x455f('0x1a')](function(_0x745536){logger[_0x455f('0x15')](_0x455f('0x1b'),_0x745536['message'],_0x5be6c8);_0x4a32aa(_0x4e2eaa['error'](0x1f4,_0x745536[_0x455f('0x18')]));});});};exports['ShowMailQueue']=function(_0x20efad){var _0x137c0a=this;return new Promise(function(_0x1750d8,_0x399c40){return db['MailQueue'][_0x455f('0x26')]({'raw':_0x20efad['options']?_0x20efad['options'][_0x455f('0x1e')]===undefined?!![]:![]:!![],'where':_0x20efad['options']?_0x20efad['options'][_0x455f('0x1f')]||null:null,'attributes':_0x20efad[_0x455f('0x1d')]?_0x20efad[_0x455f('0x1d')]['attributes']||null:null,'include':_0x20efad[_0x455f('0x1d')]?_0x20efad[_0x455f('0x1d')][_0x455f('0x23')]?_[_0x455f('0x22')](_0x20efad[_0x455f('0x1d')][_0x455f('0x23')],function(_0x433dab){return{'model':db[_0x433dab['model']],'as':_0x433dab['as'],'attributes':_0x433dab[_0x455f('0x20')],'include':_0x433dab[_0x455f('0x23')]?_[_0x455f('0x22')](_0x433dab[_0x455f('0x23')],function(_0x2ed2b1){return{'model':db[_0x2ed2b1[_0x455f('0x24')]],'as':_0x2ed2b1['as'],'attributes':_0x2ed2b1['attributes'],'include':_0x2ed2b1['include']?_[_0x455f('0x22')](_0x2ed2b1[_0x455f('0x23')],function(_0xe5e28){return{'model':db[_0xe5e28[_0x455f('0x24')]],'as':_0xe5e28['as'],'attributes':_0xe5e28['attributes']};}):[]};}):[]};}):[]:[]})[_0x455f('0x11')](function(_0x249d02){logger[_0x455f('0x25')](_0x455f('0x27'),_0x20efad);logger[_0x455f('0x28')](_0x455f('0x27'),_0x20efad,JSON[_0x455f('0x14')](_0x249d02));_0x1750d8(_0x249d02);})[_0x455f('0x1a')](function(_0xc88eed){logger[_0x455f('0x15')](_0x455f('0x27'),_0xc88eed[_0x455f('0x18')],_0x20efad);_0x399c40(_0x137c0a[_0x455f('0x15')](0x1f4,_0xc88eed[_0x455f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 292828c..d5d0d9f 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 _0x077f=['removeListener','register','length','mailQueue:','./mailQueue.events','save','update','emit'];(function(_0x1b6801,_0x365fc8){var _0xe84e12=function(_0x1ff27e){while(--_0x1ff27e){_0x1b6801['push'](_0x1b6801['shift']());}};_0xe84e12(++_0x365fc8);}(_0x077f,0x64));var _0xf077=function(_0x1f21da,_0x2fa4a6){_0x1f21da=_0x1f21da-0x0;var _0x335af4=_0x077f[_0x1f21da];return _0x335af4;};'use strict';var MailQueueEvents=require(_0xf077('0x0'));var events=[_0xf077('0x1'),'remove',_0xf077('0x2')];function createListener(_0x12c824,_0x242b59){return function(_0x4c93f4){_0x242b59[_0xf077('0x3')](_0x12c824,_0x4c93f4);};}function removeListener(_0x1e19fe,_0x18d1b6){return function(){MailQueueEvents[_0xf077('0x4')](_0x1e19fe,_0x18d1b6);};}exports[_0xf077('0x5')]=function(_0x18205a){for(var _0x110290=0x0,_0x3263ee=events[_0xf077('0x6')];_0x110290<_0x3263ee;_0x110290++){var _0x5d71e0=events[_0x110290];var _0x5b7f91=createListener(_0xf077('0x7')+_0x5d71e0,_0x18205a);MailQueueEvents['on'](_0x5d71e0,_0x5b7f91);}}; \ No newline at end of file +var _0xecd7=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xecd7,0x18a));var _0x7ecd=function(_0x3ee662,_0x3d0aa1){_0x3ee662=_0x3ee662-0x0;var _0x363de7=_0xecd7[_0x3ee662];return _0x363de7;};'use strict';var MailQueueEvents=require(_0x7ecd('0x0'));var events=[_0x7ecd('0x1'),_0x7ecd('0x2'),_0x7ecd('0x3')];function createListener(_0x521ab8,_0x55d3f4){return function(_0x56520e){_0x55d3f4[_0x7ecd('0x4')](_0x521ab8,_0x56520e);};}function removeListener(_0x119035,_0x1b25cc){return function(){MailQueueEvents[_0x7ecd('0x5')](_0x119035,_0x1b25cc);};}exports[_0x7ecd('0x6')]=function(_0x2f653c){for(var _0x18ed77=0x0,_0xc60de0=events[_0x7ecd('0x7')];_0x18ed77<_0xc60de0;_0x18ed77++){var _0x5824ae=events[_0x18ed77];var _0x2e30e6=createListener(_0x7ecd('0x8')+_0x5824ae,_0x2f653c);MailQueueEvents['on'](_0x5824ae,_0x2e30e6);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 77b7289..fe7ce77 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 _0xfafb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','update','delete','destroy'];(function(_0x17884c,_0x10959f){var _0x1c1c66=function(_0x4492ff){while(--_0x4492ff){_0x17884c['push'](_0x17884c['shift']());}};_0x1c1c66(++_0x10959f);}(_0xfafb,0x6d));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbfaf('0x0'));var util=require(_0xbfaf('0x1'));var path=require(_0xbfaf('0x2'));var timeout=require(_0xbfaf('0x3'));var express=require(_0xbfaf('0x4'));var router=express[_0xbfaf('0x5')]();var fs_extra=require(_0xbfaf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbfaf('0x7'));var config=require(_0xbfaf('0x8'));var controller=require('./mailQueueReport.controller');router[_0xbfaf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbfaf('0x9')]('/describe',auth[_0xbfaf('0xa')](),controller['describe']);router[_0xbfaf('0x9')](_0xbfaf('0xb'),auth[_0xbfaf('0xa')](),controller['show']);router[_0xbfaf('0xc')]('/',auth[_0xbfaf('0xa')](),controller[_0xbfaf('0xd')]);router['put']('/:id',auth[_0xbfaf('0xa')](),controller[_0xbfaf('0xe')]);router[_0xbfaf('0xf')](_0xbfaf('0xb'),auth['isAuthenticated'](),controller[_0xbfaf('0x10')]);module[_0xbfaf('0x11')]=router; \ No newline at end of file +var _0x02cd=['put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x1bc147,_0x47acdd){var _0x3fa75f=function(_0x460884){while(--_0x460884){_0x1bc147['push'](_0x1bc147['shift']());}};_0x3fa75f(++_0x47acdd);}(_0x02cd,0x122));var _0xd02c=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x02cd[_0x1591d4];return _0x4c46bb;};'use strict';var multer=require(_0xd02c('0x0'));var util=require('util');var path=require(_0xd02c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd02c('0x2')]();var fs_extra=require(_0xd02c('0x3'));var auth=require(_0xd02c('0x4'));var interaction=require(_0xd02c('0x5'));var config=require(_0xd02c('0x6'));var controller=require(_0xd02c('0x7'));router[_0xd02c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd02c('0x8')](_0xd02c('0x9'),auth[_0xd02c('0xa')](),controller[_0xd02c('0xb')]);router[_0xd02c('0x8')](_0xd02c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd02c('0xd')]('/',auth[_0xd02c('0xa')](),controller['create']);router[_0xd02c('0xe')](_0xd02c('0xc'),auth[_0xd02c('0xa')](),controller[_0xd02c('0xf')]);router[_0xd02c('0x10')](_0xd02c('0xc'),auth[_0xd02c('0xa')](),controller[_0xd02c('0x11')]);module[_0xd02c('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 45cdd81..1043849 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 _0x9555=['sequelize','exports','STRING','DATE','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9555,0x149));var _0x5955=function(_0x3abd3d,_0x5e28bd){_0x3abd3d=_0x3abd3d-0x0;var _0x414f41=_0x9555[_0x3abd3d];return _0x414f41;};'use strict';var moment=require(_0x5955('0x0'));var Sequelize=require(_0x5955('0x1'));module[_0x5955('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5955('0x3')]},'joinAt':{'type':Sequelize[_0x5955('0x4')]},'leaveAt':{'type':Sequelize[_0x5955('0x4')]},'acceptAt':{'type':Sequelize[_0x5955('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5955('0x3')]}}; \ No newline at end of file +var _0xd652=['exports','STRING','DATE','sequelize'];(function(_0x5bc786,_0x2139fe){var _0x1d9881=function(_0x3e8c01){while(--_0x3e8c01){_0x5bc786['push'](_0x5bc786['shift']());}};_0x1d9881(++_0x2139fe);}(_0xd652,0xe3));var _0x2d65=function(_0xe6f139,_0x193ac1){_0xe6f139=_0xe6f139-0x0;var _0x3f84c5=_0xd652[_0xe6f139];return _0x3f84c5;};'use strict';var moment=require('moment');var Sequelize=require(_0x2d65('0x0'));module[_0x2d65('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2d65('0x2')]},'joinAt':{'type':Sequelize[_0x2d65('0x3')]},'leaveAt':{'type':Sequelize[_0x2d65('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2d65('0x3')]},'reason':{'type':Sequelize[_0x2d65('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e4cf4cb..515c70d 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 _0x8952=['filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','destroy','find','describe','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','end','stack','name','map','MailQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x8952,0x17e));var _0x2895=function(_0x244b38,_0x30dcfa){_0x244b38=_0x244b38-0x0;var _0x46e285=_0x8952[_0x244b38];return _0x46e285;};'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(){_0x384357[_0x2895('0x16')](0xcc)[_0x2895('0x22')]();});}};}function handleEntityNotFound(_0x4a21cf,_0x3d3320){return function(_0x3690ce){if(!_0x3690ce){_0x4a21cf['sendStatus'](0x194);}return _0x3690ce;};}function handleError(_0x293ad3,_0x127540){_0x127540=_0x127540||0x1f4;return function(_0x2cd4df){logger['error'](_0x2cd4df[_0x2895('0x23')]);if(_0x2cd4df[_0x2895('0x24')]){delete _0x2cd4df['name'];}_0x293ad3[_0x2895('0x16')](_0x127540)['send'](_0x2cd4df);};}exports['index']=function(_0x18a935,_0x4ee2cc){var _0xfa4f85={},_0x381538={},_0x4fdd94={'count':0x0,'rows':[]};var _0x5574bf=_[_0x2895('0x25')](db[_0x2895('0x26')][_0x2895('0x27')],function(_0x14e343){return{'name':_0x14e343[_0x2895('0x28')],'type':_0x14e343[_0x2895('0x29')][_0x2895('0x2a')]};});_0x381538['model']=_[_0x2895('0x25')](_0x5574bf,_0x2895('0x24'));_0x381538[_0x2895('0x2b')]=_['keys'](_0x18a935[_0x2895('0x2b')]);_0x381538[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],_0x381538['query']);_0xfa4f85[_0x2895('0x2f')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x18a935[_0x2895('0x2b')]['fields']));_0xfa4f85['attributes']=_0xfa4f85[_0x2895('0x2f')][_0x2895('0x31')]?_0xfa4f85['attributes']:_0x381538[_0x2895('0x2e')];if(!_0x18a935['query'][_0x2895('0x32')](_0x2895('0x33'))){_0xfa4f85['limit']=qs[_0x2895('0x1a')](_0x18a935['query'][_0x2895('0x1a')]);_0xfa4f85['offset']=qs['offset'](_0x18a935[_0x2895('0x2b')][_0x2895('0x18')]);}_0xfa4f85[_0x2895('0x34')]=qs['sort'](_0x18a935[_0x2895('0x2b')][_0x2895('0x35')]);_0xfa4f85[_0x2895('0x36')]=qs[_0x2895('0x2c')](_[_0x2895('0x37')](_0x18a935[_0x2895('0x2b')],_0x381538[_0x2895('0x2c')]),_0x5574bf);if(_0x18a935[_0x2895('0x2b')][_0x2895('0x38')]){_0xfa4f85[_0x2895('0x36')]=_['merge'](_0xfa4f85[_0x2895('0x36')],{'$or':_[_0x2895('0x25')](_0x5574bf,function(_0x47413d){if(_0x47413d[_0x2895('0x29')]!==_0x2895('0x39')){var _0x12d7d8={};_0x12d7d8[_0x47413d[_0x2895('0x24')]]={'$like':'%'+_0x18a935['query']['filter']+'%'};return _0x12d7d8;}})});}_0xfa4f85=_[_0x2895('0x3a')]({},_0xfa4f85,_0x18a935[_0x2895('0x3b')]);var _0x24b9e0={'where':_0xfa4f85[_0x2895('0x36')]};return db[_0x2895('0x26')][_0x2895('0x1b')](_0x24b9e0)['then'](function(_0x5d18ef){_0x4fdd94[_0x2895('0x1b')]=_0x5d18ef;if(_0x18a935[_0x2895('0x2b')]['includeAll']){_0xfa4f85['include']=[{'all':!![]}];}return db[_0x2895('0x26')][_0x2895('0x3c')](_0xfa4f85);})[_0x2895('0x21')](function(_0x28967f){_0x4fdd94[_0x2895('0x3d')]=_0x28967f;return _0x4fdd94;})[_0x2895('0x21')](respondWithFilteredResult(_0x4ee2cc,_0xfa4f85))['catch'](handleError(_0x4ee2cc,null));};exports[_0x2895('0x3e')]=function(_0x2cfb24,_0x18ca24){var _0x1537fd={'raw':!![],'where':{'id':_0x2cfb24[_0x2895('0x3f')]['id']}},_0x4af6d6={};_0x4af6d6[_0x2895('0x2e')]=_[_0x2895('0x40')](db[_0x2895('0x26')]['rawAttributes']);_0x4af6d6['query']=_[_0x2895('0x40')](_0x2cfb24[_0x2895('0x2b')]);_0x4af6d6[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],_0x4af6d6['query']);_0x1537fd['attributes']=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x2cfb24[_0x2895('0x2b')][_0x2895('0x30')]));_0x1537fd[_0x2895('0x2f')]=_0x1537fd[_0x2895('0x2f')]['length']?_0x1537fd[_0x2895('0x2f')]:_0x4af6d6[_0x2895('0x2e')];if(_0x2cfb24[_0x2895('0x2b')][_0x2895('0x41')]){_0x1537fd[_0x2895('0x42')]=[{'all':!![]}];}_0x1537fd=_[_0x2895('0x3a')]({},_0x1537fd,_0x2cfb24[_0x2895('0x3b')]);return db[_0x2895('0x26')]['find'](_0x1537fd)[_0x2895('0x21')](handleEntityNotFound(_0x18ca24,null))[_0x2895('0x21')](respondWithResult(_0x18ca24,null))[_0x2895('0x43')](handleError(_0x18ca24,null));};exports['create']=function(_0xc85aa1,_0x5307a9){return db['MailQueueReport'][_0x2895('0x44')](_0xc85aa1[_0x2895('0x45')],{})[_0x2895('0x21')](respondWithResult(_0x5307a9,0xc9))[_0x2895('0x43')](handleError(_0x5307a9,null));};exports[_0x2895('0x20')]=function(_0x3cc331,_0x11e53a){if(_0x3cc331['body']['id']){delete _0x3cc331[_0x2895('0x45')]['id'];}return db[_0x2895('0x26')]['find']({'where':{'id':_0x3cc331['params']['id']}})['then'](handleEntityNotFound(_0x11e53a,null))[_0x2895('0x21')](saveUpdates(_0x3cc331[_0x2895('0x45')],null))[_0x2895('0x21')](respondWithResult(_0x11e53a,null))[_0x2895('0x43')](handleError(_0x11e53a,null));};exports[_0x2895('0x46')]=function(_0x3c5261,_0xaca46c){return db[_0x2895('0x26')][_0x2895('0x47')]({'where':{'id':_0x3c5261[_0x2895('0x3f')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xaca46c,null))[_0x2895('0x21')](removeEntity(_0xaca46c,null))[_0x2895('0x43')](handleError(_0xaca46c,null));};exports[_0x2895('0x48')]=function(_0x356d35,_0x3c1135){return db[_0x2895('0x26')][_0x2895('0x48')]()[_0x2895('0x21')](respondWithResult(_0x3c1135,null))[_0x2895('0x43')](handleError(_0x3c1135,null));}; \ No newline at end of file +var _0x0424=['index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x1d7907,_0x131382){var _0x4656fa=function(_0x440fd6){while(--_0x440fd6){_0x1d7907['push'](_0x1d7907['shift']());}};_0x4656fa(++_0x131382);}(_0x0424,0x159));var _0x4042=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x0424[_0x5d9a85];return _0x1ef8aa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4042('0x0'));var jsonpatch=require(_0x4042('0x1'));var rp=require(_0x4042('0x2'));var moment=require(_0x4042('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4042('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4042('0x5'));var csv=require(_0x4042('0x6'));var ejs=require(_0x4042('0x7'));var fs=require('fs');var fs_extra=require(_0x4042('0x8'));var _=require(_0x4042('0x9'));var squel=require(_0x4042('0xa'));var crypto=require(_0x4042('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4042('0x6'));var querystring=require(_0x4042('0xc'));var Papa=require(_0x4042('0xd'));var Redis=require('ioredis');var authService=require(_0x4042('0xe'));var qs=require(_0x4042('0xf'));var as=require(_0x4042('0x10'));var hardwareService=require(_0x4042('0x11'));var logger=require(_0x4042('0x12'))(_0x4042('0x13'));var utils=require(_0x4042('0x14'));var config=require(_0x4042('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4042('0x16'))['db'];function respondWithStatusCode(_0x357838,_0x59a068){_0x59a068=_0x59a068||0xcc;return function(_0x25fd0a){if(_0x25fd0a){return _0x357838[_0x4042('0x17')](_0x59a068);}return _0x357838[_0x4042('0x18')](_0x59a068)[_0x4042('0x19')]();};}function respondWithResult(_0x35f82a,_0x1ff3ca){_0x1ff3ca=_0x1ff3ca||0xc8;return function(_0xc115bd){if(_0xc115bd){return _0x35f82a['status'](_0x1ff3ca)[_0x4042('0x1a')](_0xc115bd);}};}function respondWithFilteredResult(_0x291e5c,_0x50206f){return function(_0x28087d){if(_0x28087d){var _0x3f99f8=typeof _0x50206f[_0x4042('0x1b')]===_0x4042('0x1c')&&typeof _0x50206f[_0x4042('0x1d')]===_0x4042('0x1c');var _0x62cb76=_0x28087d[_0x4042('0x1e')];var _0x466077=_0x3f99f8?0x0:_0x50206f['offset'];var _0xe5c1ec=_0x3f99f8?_0x28087d['count']:_0x50206f[_0x4042('0x1b')]+_0x50206f['limit'];var _0xca9ca6;if(_0xe5c1ec>=_0x62cb76){_0xe5c1ec=_0x62cb76;_0xca9ca6=0xc8;}else{_0xca9ca6=0xce;}_0x291e5c[_0x4042('0x18')](_0xca9ca6);return _0x291e5c[_0x4042('0x1f')](_0x4042('0x20'),_0x466077+'-'+_0xe5c1ec+'/'+_0x62cb76)['json'](_0x28087d);}return null;};}function patchUpdates(_0xb72021){return function(_0x4561e3){try{jsonpatch[_0x4042('0x21')](_0x4561e3,_0xb72021,!![]);}catch(_0xd1ddb){return BPromise['reject'](_0xd1ddb);}return _0x4561e3[_0x4042('0x22')]();};}function saveUpdates(_0xf0e0c6,_0xd6fe6c){return function(_0x83ce71){if(_0x83ce71){return _0x83ce71[_0x4042('0x23')](_0xf0e0c6)['then'](function(_0x1f9d4a){return _0x1f9d4a;});}return null;};}function removeEntity(_0x6d12a5,_0x519f2c){return function(_0x1daee8){if(_0x1daee8){return _0x1daee8['destroy']()[_0x4042('0x24')](function(){_0x6d12a5[_0x4042('0x18')](0xcc)[_0x4042('0x19')]();});}};}function handleEntityNotFound(_0x5d5c6d,_0x461c5e){return function(_0x3b9e78){if(!_0x3b9e78){_0x5d5c6d[_0x4042('0x17')](0x194);}return _0x3b9e78;};}function handleError(_0xbdadc8,_0x1c4d9f){_0x1c4d9f=_0x1c4d9f||0x1f4;return function(_0x52e575){logger['error'](_0x52e575[_0x4042('0x25')]);if(_0x52e575[_0x4042('0x26')]){delete _0x52e575[_0x4042('0x26')];}_0xbdadc8[_0x4042('0x18')](_0x1c4d9f)[_0x4042('0x27')](_0x52e575);};}exports[_0x4042('0x28')]=function(_0x5eb84b,_0x33733b){var _0x1e9bd7={},_0x4a6a6e={},_0xae26c2={'count':0x0,'rows':[]};var _0x89e16=_[_0x4042('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x3d1f48){return{'name':_0x3d1f48[_0x4042('0x2a')],'type':_0x3d1f48['type'][_0x4042('0x2b')]};});_0x4a6a6e[_0x4042('0x2c')]=_[_0x4042('0x29')](_0x89e16,_0x4042('0x26'));_0x4a6a6e[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x5eb84b[_0x4042('0x2d')]);_0x4a6a6e[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x4a6a6e['model'],_0x4a6a6e[_0x4042('0x2d')]);_0x1e9bd7[_0x4042('0x31')]=_['intersection'](_0x4a6a6e[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x5eb84b['query'][_0x4042('0x32')]));_0x1e9bd7[_0x4042('0x31')]=_0x1e9bd7[_0x4042('0x31')][_0x4042('0x33')]?_0x1e9bd7[_0x4042('0x31')]:_0x4a6a6e[_0x4042('0x2c')];if(!_0x5eb84b[_0x4042('0x2d')][_0x4042('0x34')](_0x4042('0x35'))){_0x1e9bd7[_0x4042('0x1d')]=qs[_0x4042('0x1d')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1d')]);_0x1e9bd7[_0x4042('0x1b')]=qs[_0x4042('0x1b')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x1b')]);}_0x1e9bd7[_0x4042('0x36')]=qs[_0x4042('0x37')](_0x5eb84b[_0x4042('0x2d')][_0x4042('0x37')]);_0x1e9bd7['where']=qs[_0x4042('0x2f')](_[_0x4042('0x38')](_0x5eb84b[_0x4042('0x2d')],_0x4a6a6e[_0x4042('0x2f')]),_0x89e16);if(_0x5eb84b['query'][_0x4042('0x39')]){_0x1e9bd7[_0x4042('0x3a')]=_[_0x4042('0x3b')](_0x1e9bd7[_0x4042('0x3a')],{'$or':_[_0x4042('0x29')](_0x89e16,function(_0x13da64){if(_0x13da64[_0x4042('0x3c')]!==_0x4042('0x3d')){var _0x341083={};_0x341083[_0x13da64[_0x4042('0x26')]]={'$like':'%'+_0x5eb84b['query'][_0x4042('0x39')]+'%'};return _0x341083;}})});}_0x1e9bd7=_[_0x4042('0x3b')]({},_0x1e9bd7,_0x5eb84b[_0x4042('0x3e')]);var _0x1eab87={'where':_0x1e9bd7[_0x4042('0x3a')]};return db[_0x4042('0x3f')][_0x4042('0x1e')](_0x1eab87)[_0x4042('0x24')](function(_0x52b1bd){_0xae26c2['count']=_0x52b1bd;if(_0x5eb84b[_0x4042('0x2d')][_0x4042('0x40')]){_0x1e9bd7[_0x4042('0x41')]=[{'all':!![]}];}return db[_0x4042('0x3f')][_0x4042('0x42')](_0x1e9bd7);})[_0x4042('0x24')](function(_0xdfb5cb){_0xae26c2[_0x4042('0x43')]=_0xdfb5cb;return _0xae26c2;})[_0x4042('0x24')](respondWithFilteredResult(_0x33733b,_0x1e9bd7))[_0x4042('0x44')](handleError(_0x33733b,null));};exports[_0x4042('0x45')]=function(_0x35fdc2,_0x5666ed){var _0x5dea57={'raw':!![],'where':{'id':_0x35fdc2[_0x4042('0x46')]['id']}},_0x929884={};_0x929884['model']=_[_0x4042('0x2e')](db['MailQueueReport'][_0x4042('0x47')]);_0x929884[_0x4042('0x2d')]=_[_0x4042('0x2e')](_0x35fdc2['query']);_0x929884[_0x4042('0x2f')]=_[_0x4042('0x30')](_0x929884['model'],_0x929884[_0x4042('0x2d')]);_0x5dea57[_0x4042('0x31')]=_[_0x4042('0x30')](_0x929884[_0x4042('0x2c')],qs[_0x4042('0x32')](_0x35fdc2['query']['fields']));_0x5dea57['attributes']=_0x5dea57[_0x4042('0x31')][_0x4042('0x33')]?_0x5dea57['attributes']:_0x929884['model'];if(_0x35fdc2['query'][_0x4042('0x40')]){_0x5dea57['include']=[{'all':!![]}];}_0x5dea57=_['merge']({},_0x5dea57,_0x35fdc2[_0x4042('0x3e')]);return db[_0x4042('0x3f')][_0x4042('0x48')](_0x5dea57)[_0x4042('0x24')](handleEntityNotFound(_0x5666ed,null))[_0x4042('0x24')](respondWithResult(_0x5666ed,null))[_0x4042('0x44')](handleError(_0x5666ed,null));};exports[_0x4042('0x49')]=function(_0x2abc13,_0x198209){return db['MailQueueReport']['create'](_0x2abc13['body'],{})['then'](respondWithResult(_0x198209,0xc9))[_0x4042('0x44')](handleError(_0x198209,null));};exports[_0x4042('0x23')]=function(_0xd898ea,_0x250434){if(_0xd898ea[_0x4042('0x4a')]['id']){delete _0xd898ea[_0x4042('0x4a')]['id'];}return db[_0x4042('0x3f')][_0x4042('0x48')]({'where':{'id':_0xd898ea['params']['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x250434,null))[_0x4042('0x24')](saveUpdates(_0xd898ea[_0x4042('0x4a')],null))[_0x4042('0x24')](respondWithResult(_0x250434,null))[_0x4042('0x44')](handleError(_0x250434,null));};exports[_0x4042('0x4b')]=function(_0xf5f38a,_0x591a0f){return db['MailQueueReport']['find']({'where':{'id':_0xf5f38a[_0x4042('0x46')]['id']}})[_0x4042('0x24')](handleEntityNotFound(_0x591a0f,null))['then'](removeEntity(_0x591a0f,null))[_0x4042('0x44')](handleError(_0x591a0f,null));};exports[_0x4042('0x4c')]=function(_0x5d42a7,_0x4ec047){return db[_0x4042('0x3f')][_0x4042('0x4c')]()[_0x4042('0x24')](respondWithResult(_0x4ec047,null))[_0x4042('0x44')](handleError(_0x4ec047,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d5d1420..fef2d53 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 _0xe4c9=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','MailQueueReport','uniqueid','lodash','util'];(function(_0x499a91,_0x2fc67e){var _0x11e9dd=function(_0x2770a6){while(--_0x2770a6){_0x499a91['push'](_0x499a91['shift']());}};_0x11e9dd(++_0x2fc67e);}(_0xe4c9,0x98));var _0x9e4c=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0xe4c9[_0x488ca1];return _0x4dd0a4;};'use strict';var _=require(_0x9e4c('0x0'));var util=require(_0x9e4c('0x1'));var logger=require(_0x9e4c('0x2'))(_0x9e4c('0x3'));var moment=require(_0x9e4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x9e4c('0x5'));var fs=require('fs');var path=require(_0x9e4c('0x6'));var rimraf=require('rimraf');var config=require(_0x9e4c('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x9e4c('0x8')]=function(_0x5672b3,_0x2b39e1){return _0x5672b3['define'](_0x9e4c('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x9e4c('0xa'),'fields':[_0x9e4c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9285=['exports','define','MailQueueReport','uniqueid','api','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x447d7a,_0xbf199){var _0x20f25e=function(_0x54504d){while(--_0x54504d){_0x447d7a['push'](_0x447d7a['shift']());}};_0x20f25e(++_0xbf199);}(_0x9285,0x158));var _0x5928=function(_0x4524ba,_0x467f29){_0x4524ba=_0x4524ba-0x0;var _0x216f93=_0x9285[_0x4524ba];return _0x216f93;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5928('0x0'));var moment=require('moment');var BPromise=require(_0x5928('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5928('0x2'));var rimraf=require(_0x5928('0x3'));var config=require(_0x5928('0x4'));var attributes=require(_0x5928('0x5'));module[_0x5928('0x6')]=function(_0x661f6e,_0x4d7f8a){return _0x661f6e[_0x5928('0x7')](_0x5928('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5928('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b3bc121..7e77056 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x7ce1b5,_0x1a74e3){var _0x10f68d=function(_0x5b1305){while(--_0x5b1305){_0x7ce1b5['push'](_0x7ce1b5['shift']());}};_0x10f68d(++_0x1a74e3);}(_0x1261,0x144));var _0x1126=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0x1261[_0x2f7d18];return _0x425175;};'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')]('MailQueueReport,\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['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ 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(_0x3b3e81,_0x34e727){var _0x1c9744=function(_0x35b081){while(--_0x35b081){_0x3b3e81['push'](_0x3b3e81['shift']());}};_0x1c9744(++_0x34e727);}(_0xadb5,0xad));var _0x5adb=function(_0x449161,_0x1ae5a5){_0x449161=_0x449161-0x0;var _0x3dbaed=_0xadb5[_0x449161];return _0x3dbaed;};'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 9b1c9ae..f6ef1a9 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x38b3ca,_0x5d3f62){var _0x21dd11=function(_0x54cb01){while(--_0x54cb01){_0x38b3ca['push'](_0x38b3ca['shift']());}};_0x21dd11(++_0x5d3f62);}(_0xe706,0xa3));var _0x6e70=function(_0xa7662e,_0x22304d){_0xa7662e=_0xa7662e-0x0;var _0x425053=_0xe706[_0xa7662e];return _0x425053;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x290844,_0x366077){var _0x546847=function(_0x4ea65e){while(--_0x4ea65e){_0x290844['push'](_0x290844['shift']());}};_0x546847(++_0x366077);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a0a4738..9d257f6 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 _0x9bc9=['exports','STRING','INTEGER','BOOLEAN','INBOX'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x9bc9,0x8c));var _0x99bc=function(_0x7f6e8e,_0x44db37){_0x7f6e8e=_0x7f6e8e-0x0;var _0x455aad=_0x9bc9[_0x7f6e8e];return _0x455aad;};'use strict';var Sequelize=require('sequelize');module[_0x99bc('0x0')]={'description':{'type':Sequelize[_0x99bc('0x1')]},'host':{'type':Sequelize[_0x99bc('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x99bc('0x1')]},'password':{'type':Sequelize[_0x99bc('0x1')]},'port':{'type':Sequelize[_0x99bc('0x2')]},'tls':{'type':Sequelize[_0x99bc('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x99bc('0x4')},'connTimeout':{'type':Sequelize[_0x99bc('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc458=['INTEGER','sequelize','exports','STRING','BOOLEAN','INBOX'];(function(_0x2d132d,_0x5a589b){var _0x331b85=function(_0x565b66){while(--_0x565b66){_0x2d132d['push'](_0x2d132d['shift']());}};_0x331b85(++_0x5a589b);}(_0xc458,0x1f3));var _0x8c45=function(_0x17f1bd,_0x5f5005){_0x17f1bd=_0x17f1bd-0x0;var _0x16bfaa=_0xc458[_0x17f1bd];return _0x16bfaa;};'use strict';var Sequelize=require(_0x8c45('0x0'));module[_0x8c45('0x1')]={'description':{'type':Sequelize[_0x8c45('0x2')]},'host':{'type':Sequelize[_0x8c45('0x2')]},'authentication':{'type':Sequelize[_0x8c45('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8c45('0x2')]},'password':{'type':Sequelize[_0x8c45('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x8c45('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8c45('0x2')],'defaultValue':_0x8c45('0x4')},'connTimeout':{'type':Sequelize[_0x8c45('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8c45('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8c45('0x2')]},'modernAuthentication':{'type':Sequelize[_0x8c45('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 45c9433..2eccf6a 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 _0xdc74=['define','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xdc74,0x16e));var _0x4dc7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xdc74[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x4dc7('0x0'));var util=require(_0x4dc7('0x1'));var logger=require(_0x4dc7('0x2'))(_0x4dc7('0x3'));var moment=require('moment');var BPromise=require(_0x4dc7('0x4'));var rp=require(_0x4dc7('0x5'));var fs=require('fs');var path=require(_0x4dc7('0x6'));var rimraf=require(_0x4dc7('0x7'));var config=require(_0x4dc7('0x8'));var attributes=require(_0x4dc7('0x9'));module[_0x4dc7('0xa')]=function(_0x211a37,_0x383362){return _0x211a37[_0x4dc7('0xb')]('MailServerIn',attributes,{'tableName':_0x4dc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fdf=['exports','define','MailServerIn','api','moment','bluebird','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2fdf,0x1aa));var _0xf2fd=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2fdf[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf2fd('0x0'));var moment=require(_0xf2fd('0x1'));var BPromise=require(_0xf2fd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf2fd('0x3'));var config=require(_0xf2fd('0x4'));var attributes=require(_0xf2fd('0x5'));module[_0xf2fd('0x6')]=function(_0x379574,_0x8c277d){return _0x379574[_0xf2fd('0x7')](_0xf2fd('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index bd47d0f..6d597a4 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 _0x9181=['client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','limit','include','map','model','GetMailServerIn','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59b9d3,_0x384472){var _0x171163=function(_0x251233){while(--_0x251233){_0x59b9d3['push'](_0x59b9d3['shift']());}};_0x171163(++_0x384472);}(_0x9181,0x182));var _0x1918=function(_0x59e614,_0x2b855a){_0x59e614=_0x59e614-0x0;var _0x114e35=_0x9181[_0x59e614];return _0x114e35;};'use strict';var _=require(_0x1918('0x0'));var util=require(_0x1918('0x1'));var moment=require(_0x1918('0x2'));var BPromise=require(_0x1918('0x3'));var rs=require(_0x1918('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1918('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1918('0x6'))(_0x1918('0x7'));var config=require(_0x1918('0x8'));var jayson=require(_0x1918('0x9'));var client=jayson[_0x1918('0xa')][_0x1918('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cf696,_0xdafd69,_0x54a715){return new BPromise(function(_0x434acb,_0x53c498){return client[_0x1918('0xc')](_0x4cf696,_0x54a715)[_0x1918('0xd')](function(_0x24c807){logger[_0x1918('0xe')](_0x1918('0xf'),_0xdafd69,_0x1918('0x10'));logger[_0x1918('0x11')](_0x1918('0x12'),_0xdafd69,_0x1918('0x10'),JSON[_0x1918('0x13')](_0x24c807));if(_0x24c807[_0x1918('0x14')]){if(_0x24c807[_0x1918('0x14')][_0x1918('0x15')]===0x1f4){logger['error'](_0x1918('0xf'),_0xdafd69,_0x24c807[_0x1918('0x14')][_0x1918('0x16')]);return _0x53c498(_0x24c807[_0x1918('0x14')][_0x1918('0x16')]);}logger[_0x1918('0x14')](_0x1918('0xf'),_0xdafd69,_0x24c807['error'][_0x1918('0x16')]);return _0x434acb(_0x24c807[_0x1918('0x14')][_0x1918('0x16')]);}else{logger[_0x1918('0xe')]('MailServerIn,\x20%s,\x20%s',_0xdafd69,'request\x20sent');_0x434acb(_0x24c807['result'][_0x1918('0x16')]);}})[_0x1918('0x17')](function(_0x303245){logger['error']('MailServerIn,\x20%s,\x20%s',_0xdafd69,_0x303245);_0x53c498(_0x303245);});});}exports['GetMailServerIn']=function(_0x7c2a35){var _0x3df504=this;return new Promise(function(_0x4bda90,_0x591d98){return db['MailServerIn'][_0x1918('0x18')]({'raw':_0x7c2a35[_0x1918('0x19')]?_0x7c2a35[_0x1918('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x7c2a35[_0x1918('0x19')]?_0x7c2a35[_0x1918('0x19')][_0x1918('0x1a')]||null:null,'attributes':_0x7c2a35[_0x1918('0x19')]?_0x7c2a35[_0x1918('0x19')][_0x1918('0x1b')]||null:null,'limit':_0x7c2a35[_0x1918('0x19')]?_0x7c2a35['options'][_0x1918('0x1c')]||null:null,'include':_0x7c2a35[_0x1918('0x19')]?_0x7c2a35[_0x1918('0x19')][_0x1918('0x1d')]?_[_0x1918('0x1e')](_0x7c2a35['options'][_0x1918('0x1d')],function(_0x5b4407){return{'model':db[_0x5b4407['model']],'as':_0x5b4407['as'],'attributes':_0x5b4407['attributes'],'include':_0x5b4407[_0x1918('0x1d')]?_[_0x1918('0x1e')](_0x5b4407[_0x1918('0x1d')],function(_0x3e0532){return{'model':db[_0x3e0532[_0x1918('0x1f')]],'as':_0x3e0532['as'],'attributes':_0x3e0532[_0x1918('0x1b')],'include':_0x3e0532[_0x1918('0x1d')]?_[_0x1918('0x1e')](_0x3e0532[_0x1918('0x1d')],function(_0x2b74ee){return{'model':db[_0x2b74ee[_0x1918('0x1f')]],'as':_0x2b74ee['as'],'attributes':_0x2b74ee[_0x1918('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1918('0xd')](function(_0x58e227){logger[_0x1918('0xe')]('GetMailServerIn',_0x7c2a35);logger[_0x1918('0x11')](_0x1918('0x20'),_0x7c2a35,JSON['stringify'](_0x58e227));_0x4bda90(_0x58e227);})[_0x1918('0x17')](function(_0x32dd3b){logger[_0x1918('0x14')](_0x1918('0x20'),_0x32dd3b[_0x1918('0x16')],_0x7c2a35);_0x591d98(_0x3df504[_0x1918('0x14')](0x1f4,_0x32dd3b['message']));});});}; \ No newline at end of file +var _0xf72b=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','lodash','moment','randomstring'];(function(_0x2c9238,_0x42c58d){var _0x1acf94=function(_0x2d5bee){while(--_0x2d5bee){_0x2c9238['push'](_0x2c9238['shift']());}};_0x1acf94(++_0x42c58d);}(_0xf72b,0x1d9));var _0xbf72=function(_0x53e814,_0x44dc81){_0x53e814=_0x53e814-0x0;var _0x50aaea=_0xf72b[_0x53e814];return _0x50aaea;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var moment=require(_0xbf72('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf72('0x2'));var fs=require('fs');var Redis=require(_0xbf72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf72('0x4'));var logger=require(_0xbf72('0x5'))(_0xbf72('0x6'));var config=require(_0xbf72('0x7'));var jayson=require(_0xbf72('0x8'));var client=jayson[_0xbf72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c11d,_0xc0842b,_0x119807){return new BPromise(function(_0xd0402c,_0xdd6177){return client[_0xbf72('0xa')](_0x41c11d,_0x119807)['then'](function(_0x455891){logger['info'](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));logger['debug'](_0xbf72('0xd'),_0xc0842b,_0xbf72('0xc'),JSON[_0xbf72('0xe')](_0x455891));if(_0x455891[_0xbf72('0xf')]){if(_0x455891[_0xbf72('0xf')][_0xbf72('0x10')]===0x1f4){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x455891['error'][_0xbf72('0x11')]);return _0xdd6177(_0x455891[_0xbf72('0xf')][_0xbf72('0x11')]);}logger['error'](_0xbf72('0xb'),_0xc0842b,_0x455891['error']['message']);return _0xd0402c(_0x455891['error'][_0xbf72('0x11')]);}else{logger[_0xbf72('0x12')](_0xbf72('0xb'),_0xc0842b,_0xbf72('0xc'));_0xd0402c(_0x455891[_0xbf72('0x13')][_0xbf72('0x11')]);}})['catch'](function(_0x266ce2){logger[_0xbf72('0xf')](_0xbf72('0xb'),_0xc0842b,_0x266ce2);_0xdd6177(_0x266ce2);});});}exports[_0xbf72('0x14')]=function(_0x27dadc){var _0x5b5fc9=this;return new Promise(function(_0x51d4c9,_0x1b8d73){return db[_0xbf72('0x15')][_0xbf72('0x16')]({'raw':_0x27dadc[_0xbf72('0x17')]?_0x27dadc[_0xbf72('0x17')][_0xbf72('0x18')]===undefined?!![]:![]:!![],'where':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x19')]||null:null,'attributes':_0x27dadc[_0xbf72('0x17')]?_0x27dadc[_0xbf72('0x17')][_0xbf72('0x1a')]||null:null,'limit':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x1b')]||null:null,'include':_0x27dadc[_0xbf72('0x17')]?_0x27dadc['options'][_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x27dadc[_0xbf72('0x17')]['include'],function(_0x44f3f9){return{'model':db[_0x44f3f9[_0xbf72('0x1e')]],'as':_0x44f3f9['as'],'attributes':_0x44f3f9[_0xbf72('0x1a')],'include':_0x44f3f9[_0xbf72('0x1c')]?_['map'](_0x44f3f9[_0xbf72('0x1c')],function(_0x392a8c){return{'model':db[_0x392a8c[_0xbf72('0x1e')]],'as':_0x392a8c['as'],'attributes':_0x392a8c['attributes'],'include':_0x392a8c[_0xbf72('0x1c')]?_[_0xbf72('0x1d')](_0x392a8c[_0xbf72('0x1c')],function(_0x1a2f55){return{'model':db[_0x1a2f55[_0xbf72('0x1e')]],'as':_0x1a2f55['as'],'attributes':_0x1a2f55[_0xbf72('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbf72('0x1f')](function(_0x25ecdf){logger[_0xbf72('0x12')](_0xbf72('0x14'),_0x27dadc);logger[_0xbf72('0x20')](_0xbf72('0x14'),_0x27dadc,JSON[_0xbf72('0xe')](_0x25ecdf));_0x51d4c9(_0x25ecdf);})[_0xbf72('0x21')](function(_0x37a233){logger['error'](_0xbf72('0x14'),_0x37a233[_0xbf72('0x11')],_0x27dadc);_0x1b8d73(_0x5b5fc9[_0xbf72('0xf')](0x1f4,_0x37a233[_0xbf72('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 5f2064f..48322f0 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x338727,_0x6af5cb){_0x338727=_0x338727-0x0;var _0x2bacf3=_0x7a54[_0x338727];return _0x2bacf3;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x157138,_0x37073d){_0x157138=_0x157138-0x0;var _0x3dbef9=_0x7a54[_0x157138];return _0x3dbef9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 5c63317..6408476 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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xac4a,0x13f));var _0xaac4=function(_0xe14fbd,_0x53d5b0){_0xe14fbd=_0xe14fbd-0x0;var _0x276987=_0xac4a[_0xe14fbd];return _0x276987;};'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 _0x282b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x49e8ea,_0x161f50){var _0x1601e6=function(_0x894444){while(--_0x894444){_0x49e8ea['push'](_0x49e8ea['shift']());}};_0x1601e6(++_0x161f50);}(_0x282b,0xec));var _0xb282=function(_0x21c8d5,_0x16ed7f){_0x21c8d5=_0x21c8d5-0x0;var _0x406421=_0x282b[_0x21c8d5];return _0x406421;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'description':{'type':Sequelize[_0xb282('0x2')]},'host':{'type':Sequelize[_0xb282('0x2')]},'user':{'type':Sequelize[_0xb282('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xb282('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 a2c93a8..b500631 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 _0x49f9=['VIRTUAL','options','includeAll','include','then','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','end','error','stack','name','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge'];(function(_0x53bea,_0x197d23){var _0x1d7a94=function(_0x1ca209){while(--_0x1ca209){_0x53bea['push'](_0x53bea['shift']());}};_0x1d7a94(++_0x197d23);}(_0x49f9,0x174));var _0x949f=function(_0x374954,_0x18dc36){_0x374954=_0x374954-0x0;var _0x42073e=_0x49f9[_0x374954];return _0x42073e;};'use strict';var emlformat=require(_0x949f('0x0'));var rimraf=require(_0x949f('0x1'));var zipdir=require(_0x949f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x949f('0x3'));var BPromise=require(_0x949f('0x4'));var Mustache=require('mustache');var util=require(_0x949f('0x5'));var path=require(_0x949f('0x6'));var sox=require(_0x949f('0x7'));var csv=require(_0x949f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x949f('0x9'));var _=require(_0x949f('0xa'));var squel=require(_0x949f('0xb'));var crypto=require(_0x949f('0xc'));var jsforce=require(_0x949f('0xd'));var deskjs=require(_0x949f('0xe'));var toCsv=require(_0x949f('0x8'));var querystring=require(_0x949f('0xf'));var Papa=require(_0x949f('0x10'));var Redis=require(_0x949f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x949f('0x12'));var as=require(_0x949f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x949f('0x14'));var utils=require('../../config/utils');var config=require(_0x949f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x949f('0x16'))['db'];function respondWithStatusCode(_0x215bd6,_0x298407){_0x298407=_0x298407||0xcc;return function(_0x5ae9a9){if(_0x5ae9a9){return _0x215bd6[_0x949f('0x17')](_0x298407);}return _0x215bd6[_0x949f('0x18')](_0x298407)['end']();};}function respondWithResult(_0x25f6f1,_0x4b70f8){_0x4b70f8=_0x4b70f8||0xc8;return function(_0x3aa427){if(_0x3aa427){return _0x25f6f1[_0x949f('0x18')](_0x4b70f8)[_0x949f('0x19')](_0x3aa427);}};}function respondWithFilteredResult(_0x3981ce,_0x103a43){return function(_0x2611c9){if(_0x2611c9){var _0x1fed6d=typeof _0x103a43[_0x949f('0x1a')]===_0x949f('0x1b')&&typeof _0x103a43[_0x949f('0x1c')]===_0x949f('0x1b');var _0x52076b=_0x2611c9[_0x949f('0x1d')];var _0x4995f1=_0x1fed6d?0x0:_0x103a43[_0x949f('0x1a')];var _0x231383=_0x1fed6d?_0x2611c9[_0x949f('0x1d')]:_0x103a43[_0x949f('0x1a')]+_0x103a43[_0x949f('0x1c')];var _0x342802;if(_0x231383>=_0x52076b){_0x231383=_0x52076b;_0x342802=0xc8;}else{_0x342802=0xce;}_0x3981ce['status'](_0x342802);return _0x3981ce[_0x949f('0x1e')](_0x949f('0x1f'),_0x4995f1+'-'+_0x231383+'/'+_0x52076b)[_0x949f('0x19')](_0x2611c9);}return null;};}function patchUpdates(_0x436766){return function(_0x2fa14b){try{jsonpatch[_0x949f('0x20')](_0x2fa14b,_0x436766,!![]);}catch(_0x5f432f){return BPromise['reject'](_0x5f432f);}return _0x2fa14b['save']();};}function saveUpdates(_0x552388,_0xcdfbb){return function(_0x25a4f1){if(_0x25a4f1){return _0x25a4f1[_0x949f('0x21')](_0x552388)['then'](function(_0x331bb8){return _0x331bb8;});}return null;};}function removeEntity(_0x60f5a8,_0x1d2414){return function(_0x328080){if(_0x328080){return _0x328080[_0x949f('0x22')]()['then'](function(){_0x60f5a8[_0x949f('0x18')](0xcc)[_0x949f('0x23')]();});}};}function handleEntityNotFound(_0x5512bb,_0x4c30fc){return function(_0x391455){if(!_0x391455){_0x5512bb[_0x949f('0x17')](0x194);}return _0x391455;};}function handleError(_0x2b8009,_0x5167b6){_0x5167b6=_0x5167b6||0x1f4;return function(_0x584321){logger[_0x949f('0x24')](_0x584321[_0x949f('0x25')]);if(_0x584321['name']){delete _0x584321[_0x949f('0x26')];}_0x2b8009['status'](_0x5167b6)['send'](_0x584321);};}exports[_0x949f('0x27')]=function(_0x1e5df0,_0x333e56){var _0x26e64d={},_0x3073ef={},_0x35ba99={'count':0x0,'rows':[]};var _0x21f8ff=_[_0x949f('0x28')](db[_0x949f('0x29')][_0x949f('0x2a')],function(_0x3d3a8a){return{'name':_0x3d3a8a['fieldName'],'type':_0x3d3a8a[_0x949f('0x2b')][_0x949f('0x2c')]};});_0x3073ef[_0x949f('0x2d')]=_[_0x949f('0x28')](_0x21f8ff,_0x949f('0x26'));_0x3073ef['query']=_[_0x949f('0x2e')](_0x1e5df0[_0x949f('0x2f')]);_0x3073ef['filters']=_[_0x949f('0x30')](_0x3073ef[_0x949f('0x2d')],_0x3073ef[_0x949f('0x2f')]);_0x26e64d[_0x949f('0x31')]=_[_0x949f('0x30')](_0x3073ef[_0x949f('0x2d')],qs[_0x949f('0x32')](_0x1e5df0[_0x949f('0x2f')][_0x949f('0x32')]));_0x26e64d[_0x949f('0x31')]=_0x26e64d[_0x949f('0x31')][_0x949f('0x33')]?_0x26e64d[_0x949f('0x31')]:_0x3073ef[_0x949f('0x2d')];if(!_0x1e5df0[_0x949f('0x2f')]['hasOwnProperty'](_0x949f('0x34'))){_0x26e64d['limit']=qs[_0x949f('0x1c')](_0x1e5df0[_0x949f('0x2f')][_0x949f('0x1c')]);_0x26e64d[_0x949f('0x1a')]=qs[_0x949f('0x1a')](_0x1e5df0[_0x949f('0x2f')][_0x949f('0x1a')]);}_0x26e64d[_0x949f('0x35')]=qs[_0x949f('0x36')](_0x1e5df0[_0x949f('0x2f')][_0x949f('0x36')]);_0x26e64d[_0x949f('0x37')]=qs['filters'](_[_0x949f('0x38')](_0x1e5df0[_0x949f('0x2f')],_0x3073ef[_0x949f('0x39')]),_0x21f8ff);if(_0x1e5df0[_0x949f('0x2f')][_0x949f('0x3a')]){_0x26e64d['where']=_[_0x949f('0x3b')](_0x26e64d['where'],{'$or':_['map'](_0x21f8ff,function(_0x3b32bb){if(_0x3b32bb[_0x949f('0x2b')]!==_0x949f('0x3c')){var _0x4f9426={};_0x4f9426[_0x3b32bb[_0x949f('0x26')]]={'$like':'%'+_0x1e5df0[_0x949f('0x2f')][_0x949f('0x3a')]+'%'};return _0x4f9426;}})});}_0x26e64d=_[_0x949f('0x3b')]({},_0x26e64d,_0x1e5df0[_0x949f('0x3d')]);var _0x30f8c1={'where':_0x26e64d['where']};return db['MailServerOut']['count'](_0x30f8c1)['then'](function(_0x4180c3){_0x35ba99[_0x949f('0x1d')]=_0x4180c3;if(_0x1e5df0[_0x949f('0x2f')][_0x949f('0x3e')]){_0x26e64d[_0x949f('0x3f')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x26e64d);})[_0x949f('0x40')](function(_0x4cb6b7){_0x35ba99[_0x949f('0x41')]=_0x4cb6b7;return _0x35ba99;})[_0x949f('0x40')](respondWithFilteredResult(_0x333e56,_0x26e64d))[_0x949f('0x42')](handleError(_0x333e56,null));};exports[_0x949f('0x43')]=function(_0x9f8ae5,_0x220e40){var _0x2db851={'raw':!![],'where':{'id':_0x9f8ae5[_0x949f('0x44')]['id']}},_0x1a2f38={};_0x1a2f38[_0x949f('0x2d')]=_[_0x949f('0x2e')](db['MailServerOut'][_0x949f('0x2a')]);_0x1a2f38['query']=_[_0x949f('0x2e')](_0x9f8ae5[_0x949f('0x2f')]);_0x1a2f38['filters']=_['intersection'](_0x1a2f38['model'],_0x1a2f38[_0x949f('0x2f')]);_0x2db851[_0x949f('0x31')]=_['intersection'](_0x1a2f38[_0x949f('0x2d')],qs[_0x949f('0x32')](_0x9f8ae5[_0x949f('0x2f')][_0x949f('0x32')]));_0x2db851[_0x949f('0x31')]=_0x2db851[_0x949f('0x31')][_0x949f('0x33')]?_0x2db851['attributes']:_0x1a2f38[_0x949f('0x2d')];if(_0x9f8ae5['query']['includeAll']){_0x2db851[_0x949f('0x3f')]=[{'all':!![]}];}_0x2db851=_['merge']({},_0x2db851,_0x9f8ae5['options']);return db['MailServerOut']['find'](_0x2db851)[_0x949f('0x40')](handleEntityNotFound(_0x220e40,null))[_0x949f('0x40')](respondWithResult(_0x220e40,null))[_0x949f('0x42')](handleError(_0x220e40,null));};exports['create']=function(_0x41bbc3,_0x3f1e82){return db['MailServerOut'][_0x949f('0x45')](_0x41bbc3[_0x949f('0x46')],{})['then'](respondWithResult(_0x3f1e82,0xc9))[_0x949f('0x42')](handleError(_0x3f1e82,null));};exports['update']=function(_0x5db8a1,_0x2da0d0){if(_0x5db8a1['body']['id']){delete _0x5db8a1[_0x949f('0x46')]['id'];}return db[_0x949f('0x29')][_0x949f('0x47')]({'where':{'id':_0x5db8a1[_0x949f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2da0d0,null))[_0x949f('0x40')](saveUpdates(_0x5db8a1[_0x949f('0x46')],null))[_0x949f('0x40')](respondWithResult(_0x2da0d0,null))['catch'](handleError(_0x2da0d0,null));};exports[_0x949f('0x22')]=function(_0x489032,_0x2c59db){return db['MailServerOut'][_0x949f('0x47')]({'where':{'id':_0x489032[_0x949f('0x44')]['id']}})[_0x949f('0x40')](handleEntityNotFound(_0x2c59db,null))[_0x949f('0x40')](removeEntity(_0x2c59db,null))[_0x949f('0x42')](handleError(_0x2c59db,null));}; \ No newline at end of file +var _0x6896=['show','params','keys','rawAttributes','intersection','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','MailServerOut','fieldName','query','filters','attributes','model','fields','length','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x6896,0x12c));var _0x6689=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6896[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6689('0x0'));var zipdir=require(_0x6689('0x1'));var jsonpatch=require(_0x6689('0x2'));var rp=require(_0x6689('0x3'));var moment=require(_0x6689('0x4'));var BPromise=require(_0x6689('0x5'));var Mustache=require(_0x6689('0x6'));var util=require(_0x6689('0x7'));var path=require(_0x6689('0x8'));var sox=require('sox');var csv=require(_0x6689('0x9'));var ejs=require(_0x6689('0xa'));var fs=require('fs');var fs_extra=require(_0x6689('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6689('0xc'));var jsforce=require(_0x6689('0xd'));var deskjs=require(_0x6689('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6689('0xf'));var Papa=require(_0x6689('0x10'));var Redis=require(_0x6689('0x11'));var authService=require(_0x6689('0x12'));var qs=require(_0x6689('0x13'));var as=require(_0x6689('0x14'));var hardwareService=require(_0x6689('0x15'));var logger=require(_0x6689('0x16'))(_0x6689('0x17'));var utils=require(_0x6689('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6689('0x19'))['db'];function respondWithStatusCode(_0x578ce5,_0x191ca2){_0x191ca2=_0x191ca2||0xcc;return function(_0x1ac983){if(_0x1ac983){return _0x578ce5[_0x6689('0x1a')](_0x191ca2);}return _0x578ce5[_0x6689('0x1b')](_0x191ca2)[_0x6689('0x1c')]();};}function respondWithResult(_0x591978,_0x3c6ef5){_0x3c6ef5=_0x3c6ef5||0xc8;return function(_0x5464cf){if(_0x5464cf){return _0x591978[_0x6689('0x1b')](_0x3c6ef5)[_0x6689('0x1d')](_0x5464cf);}};}function respondWithFilteredResult(_0x5f2202,_0x5e2772){return function(_0x1e49ee){if(_0x1e49ee){var _0x360fcd=typeof _0x5e2772['offset']===_0x6689('0x1e')&&typeof _0x5e2772[_0x6689('0x1f')]===_0x6689('0x1e');var _0x21c4f6=_0x1e49ee[_0x6689('0x20')];var _0x3975c8=_0x360fcd?0x0:_0x5e2772[_0x6689('0x21')];var _0x325e61=_0x360fcd?_0x1e49ee[_0x6689('0x20')]:_0x5e2772[_0x6689('0x21')]+_0x5e2772[_0x6689('0x1f')];var _0x3d0b0c;if(_0x325e61>=_0x21c4f6){_0x325e61=_0x21c4f6;_0x3d0b0c=0xc8;}else{_0x3d0b0c=0xce;}_0x5f2202[_0x6689('0x1b')](_0x3d0b0c);return _0x5f2202[_0x6689('0x22')](_0x6689('0x23'),_0x3975c8+'-'+_0x325e61+'/'+_0x21c4f6)['json'](_0x1e49ee);}return null;};}function patchUpdates(_0x42fc18){return function(_0x4e0e94){try{jsonpatch[_0x6689('0x24')](_0x4e0e94,_0x42fc18,!![]);}catch(_0x13781f){return BPromise[_0x6689('0x25')](_0x13781f);}return _0x4e0e94['save']();};}function saveUpdates(_0x5cfcf2,_0x15c49a){return function(_0x388d31){if(_0x388d31){return _0x388d31[_0x6689('0x26')](_0x5cfcf2)[_0x6689('0x27')](function(_0x4896fd){return _0x4896fd;});}return null;};}function removeEntity(_0x531d2b,_0x468937){return function(_0x392fc2){if(_0x392fc2){return _0x392fc2[_0x6689('0x28')]()[_0x6689('0x27')](function(){_0x531d2b[_0x6689('0x1b')](0xcc)[_0x6689('0x1c')]();});}};}function handleEntityNotFound(_0x95eb4,_0x311b0e){return function(_0x114045){if(!_0x114045){_0x95eb4[_0x6689('0x1a')](0x194);}return _0x114045;};}function handleError(_0x128ec2,_0xb4edbf){_0xb4edbf=_0xb4edbf||0x1f4;return function(_0xaffca1){logger['error'](_0xaffca1[_0x6689('0x29')]);if(_0xaffca1[_0x6689('0x2a')]){delete _0xaffca1[_0x6689('0x2a')];}_0x128ec2[_0x6689('0x1b')](_0xb4edbf)[_0x6689('0x2b')](_0xaffca1);};}exports[_0x6689('0x2c')]=function(_0x2b929d,_0x477c6e){var _0xe10149={},_0x48533c={},_0x2e65b5={'count':0x0,'rows':[]};var _0x1d53aa=_[_0x6689('0x2d')](db[_0x6689('0x2e')]['rawAttributes'],function(_0x165670){return{'name':_0x165670[_0x6689('0x2f')],'type':_0x165670['type']['key']};});_0x48533c['model']=_[_0x6689('0x2d')](_0x1d53aa,'name');_0x48533c[_0x6689('0x30')]=_['keys'](_0x2b929d[_0x6689('0x30')]);_0x48533c[_0x6689('0x31')]=_['intersection'](_0x48533c['model'],_0x48533c[_0x6689('0x30')]);_0xe10149[_0x6689('0x32')]=_['intersection'](_0x48533c[_0x6689('0x33')],qs[_0x6689('0x34')](_0x2b929d[_0x6689('0x30')][_0x6689('0x34')]));_0xe10149[_0x6689('0x32')]=_0xe10149['attributes'][_0x6689('0x35')]?_0xe10149['attributes']:_0x48533c[_0x6689('0x33')];if(!_0x2b929d['query']['hasOwnProperty'](_0x6689('0x36'))){_0xe10149[_0x6689('0x1f')]=qs['limit'](_0x2b929d[_0x6689('0x30')][_0x6689('0x1f')]);_0xe10149[_0x6689('0x21')]=qs[_0x6689('0x21')](_0x2b929d[_0x6689('0x30')][_0x6689('0x21')]);}_0xe10149['order']=qs[_0x6689('0x37')](_0x2b929d[_0x6689('0x30')][_0x6689('0x37')]);_0xe10149['where']=qs['filters'](_[_0x6689('0x38')](_0x2b929d[_0x6689('0x30')],_0x48533c[_0x6689('0x31')]),_0x1d53aa);if(_0x2b929d[_0x6689('0x30')][_0x6689('0x39')]){_0xe10149[_0x6689('0x3a')]=_[_0x6689('0x3b')](_0xe10149[_0x6689('0x3a')],{'$or':_['map'](_0x1d53aa,function(_0x1600b6){if(_0x1600b6['type']!=='VIRTUAL'){var _0x5b4d4d={};_0x5b4d4d[_0x1600b6['name']]={'$like':'%'+_0x2b929d[_0x6689('0x30')][_0x6689('0x39')]+'%'};return _0x5b4d4d;}})});}_0xe10149=_[_0x6689('0x3b')]({},_0xe10149,_0x2b929d[_0x6689('0x3c')]);var _0x385293={'where':_0xe10149[_0x6689('0x3a')]};return db[_0x6689('0x2e')][_0x6689('0x20')](_0x385293)[_0x6689('0x27')](function(_0x221b02){_0x2e65b5[_0x6689('0x20')]=_0x221b02;if(_0x2b929d[_0x6689('0x30')][_0x6689('0x3d')]){_0xe10149[_0x6689('0x3e')]=[{'all':!![]}];}return db['MailServerOut'][_0x6689('0x3f')](_0xe10149);})['then'](function(_0x42d7de){_0x2e65b5['rows']=_0x42d7de;return _0x2e65b5;})[_0x6689('0x27')](respondWithFilteredResult(_0x477c6e,_0xe10149))[_0x6689('0x40')](handleError(_0x477c6e,null));};exports[_0x6689('0x41')]=function(_0x3b4cf1,_0x4787e3){var _0x5347bc={'raw':!![],'where':{'id':_0x3b4cf1[_0x6689('0x42')]['id']}},_0x515fd9={};_0x515fd9[_0x6689('0x33')]=_[_0x6689('0x43')](db[_0x6689('0x2e')][_0x6689('0x44')]);_0x515fd9[_0x6689('0x30')]=_[_0x6689('0x43')](_0x3b4cf1[_0x6689('0x30')]);_0x515fd9[_0x6689('0x31')]=_[_0x6689('0x45')](_0x515fd9[_0x6689('0x33')],_0x515fd9[_0x6689('0x30')]);_0x5347bc[_0x6689('0x32')]=_[_0x6689('0x45')](_0x515fd9[_0x6689('0x33')],qs['fields'](_0x3b4cf1[_0x6689('0x30')][_0x6689('0x34')]));_0x5347bc[_0x6689('0x32')]=_0x5347bc[_0x6689('0x32')][_0x6689('0x35')]?_0x5347bc[_0x6689('0x32')]:_0x515fd9[_0x6689('0x33')];if(_0x3b4cf1['query']['includeAll']){_0x5347bc[_0x6689('0x3e')]=[{'all':!![]}];}_0x5347bc=_[_0x6689('0x3b')]({},_0x5347bc,_0x3b4cf1['options']);return db[_0x6689('0x2e')]['find'](_0x5347bc)[_0x6689('0x27')](handleEntityNotFound(_0x4787e3,null))[_0x6689('0x27')](respondWithResult(_0x4787e3,null))['catch'](handleError(_0x4787e3,null));};exports[_0x6689('0x46')]=function(_0x593def,_0x5407cc){return db[_0x6689('0x2e')]['create'](_0x593def[_0x6689('0x47')],{})[_0x6689('0x27')](respondWithResult(_0x5407cc,0xc9))[_0x6689('0x40')](handleError(_0x5407cc,null));};exports[_0x6689('0x26')]=function(_0x298a04,_0x16c29c){if(_0x298a04[_0x6689('0x47')]['id']){delete _0x298a04[_0x6689('0x47')]['id'];}return db[_0x6689('0x2e')][_0x6689('0x48')]({'where':{'id':_0x298a04[_0x6689('0x42')]['id']}})['then'](handleEntityNotFound(_0x16c29c,null))[_0x6689('0x27')](saveUpdates(_0x298a04[_0x6689('0x47')],null))[_0x6689('0x27')](respondWithResult(_0x16c29c,null))[_0x6689('0x40')](handleError(_0x16c29c,null));};exports[_0x6689('0x28')]=function(_0x5f4d00,_0x5e3455){return db[_0x6689('0x2e')]['find']({'where':{'id':_0x5f4d00[_0x6689('0x42')]['id']}})[_0x6689('0x27')](handleEntityNotFound(_0x5e3455,null))[_0x6689('0x27')](removeEntity(_0x5e3455,null))[_0x6689('0x40')](handleError(_0x5e3455,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6290569..7080d2a 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 _0xb5f9=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','MailServerOut','mail_servers_out','lodash','util'];(function(_0x5e9951,_0x4dcbbf){var _0x3fce5c=function(_0x13c857){while(--_0x13c857){_0x5e9951['push'](_0x5e9951['shift']());}};_0x3fce5c(++_0x4dcbbf);}(_0xb5f9,0xcf));var _0x9b5f=function(_0x1724e0,_0x4afc68){_0x1724e0=_0x1724e0-0x0;var _0x241917=_0xb5f9[_0x1724e0];return _0x241917;};'use strict';var _=require(_0x9b5f('0x0'));var util=require(_0x9b5f('0x1'));var logger=require(_0x9b5f('0x2'))(_0x9b5f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b5f('0x4'));var fs=require('fs');var path=require(_0x9b5f('0x5'));var rimraf=require(_0x9b5f('0x6'));var config=require(_0x9b5f('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x9b5f('0x8')]=function(_0x36b7de,_0x1a8b1a){return _0x36b7de['define'](_0x9b5f('0x9'),attributes,{'tableName':_0x9b5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89dd=['../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x1a8aed,_0x5a5a76){var _0x2d3f1e=function(_0x48dcda){while(--_0x48dcda){_0x1a8aed['push'](_0x1a8aed['shift']());}};_0x2d3f1e(++_0x5a5a76);}(_0x89dd,0x69));var _0xd89d=function(_0x31fa27,_0x44189c){_0x31fa27=_0x31fa27-0x0;var _0x189c87=_0x89dd[_0x31fa27];return _0x189c87;};'use strict';var _=require(_0xd89d('0x0'));var util=require(_0xd89d('0x1'));var logger=require(_0xd89d('0x2'))(_0xd89d('0x3'));var moment=require(_0xd89d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd89d('0x5'));var attributes=require(_0xd89d('0x6'));module[_0xd89d('0x7')]=function(_0x542103,_0x3ed745){return _0x542103['define'](_0xd89d('0x8'),attributes,{'tableName':_0xd89d('0x9'),'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 d66ae76..ad8d481 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1a99af,_0x416438){_0x1a99af=_0x1a99af-0x0;var _0xd834e2=_0x7a54[_0x1a99af];return _0xd834e2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xa15ff1,_0x48f63d){_0xa15ff1=_0xa15ff1-0x0;var _0x33d8b2=_0x7a54[_0xa15ff1];return _0x33d8b2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 8b34107..7153a1c 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 _0x0784=['/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x6c0b0a,_0x496391){var _0x5f456a=function(_0x5ae918){while(--_0x5ae918){_0x6c0b0a['push'](_0x6c0b0a['shift']());}};_0x5f456a(++_0x496391);}(_0x0784,0xa2));var _0x4078=function(_0x147cc1,_0x3dc911){_0x147cc1=_0x147cc1-0x0;var _0x16d6f9=_0x0784[_0x147cc1];return _0x16d6f9;};'use strict';var multer=require('multer');var util=require(_0x4078('0x0'));var path=require('path');var timeout=require(_0x4078('0x1'));var express=require(_0x4078('0x2'));var router=express[_0x4078('0x3')]();var fs_extra=require(_0x4078('0x4'));var auth=require(_0x4078('0x5'));var interaction=require(_0x4078('0x6'));var config=require(_0x4078('0x7'));var controller=require(_0x4078('0x8'));router[_0x4078('0x9')]('/',auth[_0x4078('0xa')](),controller[_0x4078('0xb')]);router[_0x4078('0x9')](_0x4078('0xc'),auth['isAuthenticated'](),controller[_0x4078('0xd')]);router['get'](_0x4078('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x4078('0xf')]('/',auth['isAuthenticated'](),controller[_0x4078('0x10')]);router[_0x4078('0x11')](_0x4078('0xe'),auth[_0x4078('0xa')](),controller[_0x4078('0x12')]);router[_0x4078('0x13')](_0x4078('0xe'),auth['isAuthenticated'](),controller[_0x4078('0x14')]);module[_0x4078('0x15')]=router; \ No newline at end of file +var _0x150d=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x4fd6bb,_0x55886c){var _0x149758=function(_0x1c6f41){while(--_0x1c6f41){_0x4fd6bb['push'](_0x4fd6bb['shift']());}};_0x149758(++_0x55886c);}(_0x150d,0x190));var _0xd150=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x150d[_0x3fa7d3];return _0x4c51bd;};'use strict';var multer=require('multer');var util=require(_0xd150('0x0'));var path=require(_0xd150('0x1'));var timeout=require(_0xd150('0x2'));var express=require(_0xd150('0x3'));var router=express[_0xd150('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd150('0x5'));var interaction=require(_0xd150('0x6'));var config=require(_0xd150('0x7'));var controller=require(_0xd150('0x8'));router[_0xd150('0x9')]('/',auth['isAuthenticated'](),controller[_0xd150('0xa')]);router[_0xd150('0x9')](_0xd150('0xb'),auth[_0xd150('0xc')](),controller[_0xd150('0xd')]);router[_0xd150('0x9')](_0xd150('0xe'),auth['isAuthenticated'](),controller[_0xd150('0xf')]);router[_0xd150('0x10')]('/',auth[_0xd150('0xc')](),controller[_0xd150('0x11')]);router[_0xd150('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd150('0x13')]);router[_0xd150('0x14')](_0xd150('0xe'),auth[_0xd150('0xc')](),controller[_0xd150('0x15')]);module[_0xd150('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f9cde2c..382679b 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 _0x4074=['sequelize','exports','STRING'];(function(_0x8d714c,_0x1e466f){var _0x4632a4=function(_0x27ab0f){while(--_0x27ab0f){_0x8d714c['push'](_0x8d714c['shift']());}};_0x4632a4(++_0x1e466f);}(_0x4074,0xf0));var _0x4407=function(_0x46fea4,_0x299e4f){_0x46fea4=_0x46fea4-0x0;var _0x282a52=_0x4074[_0x46fea4];return _0x282a52;};'use strict';var Sequelize=require(_0x4407('0x0'));module[_0x4407('0x1')]={'name':{'type':Sequelize[_0x4407('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4407('0x2')]}}; \ No newline at end of file +var _0x3c94=['name','sequelize','exports','STRING'];(function(_0x2ebdf5,_0x3a1b0b){var _0x5c0115=function(_0x29f6c8){while(--_0x29f6c8){_0x2ebdf5['push'](_0x2ebdf5['shift']());}};_0x5c0115(++_0x3a1b0b);}(_0x3c94,0xcd));var _0x43c9=function(_0x5079f0,_0x2e0ae4){_0x5079f0=_0x5079f0-0x0;var _0x182bce=_0x3c94[_0x5079f0];return _0x182bce;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'name':{'type':Sequelize[_0x43c9('0x2')],'unique':_0x43c9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x43c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 5ac3ca5..3e914d4 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 _0x7009=['MailSubstatus','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map'];(function(_0xe2709a,_0xd3717f){var _0x29b3b6=function(_0x1dcf7e){while(--_0x1dcf7e){_0xe2709a['push'](_0xe2709a['shift']());}};_0x29b3b6(++_0xd3717f);}(_0x7009,0x1a8));var _0x9700=function(_0x375e7e,_0x280231){_0x375e7e=_0x375e7e-0x0;var _0x265763=_0x7009[_0x375e7e];return _0x265763;};'use strict';var emlformat=require(_0x9700('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9700('0x1'));var jsonpatch=require(_0x9700('0x2'));var rp=require(_0x9700('0x3'));var moment=require(_0x9700('0x4'));var BPromise=require(_0x9700('0x5'));var Mustache=require(_0x9700('0x6'));var util=require('util');var path=require(_0x9700('0x7'));var sox=require(_0x9700('0x8'));var csv=require(_0x9700('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9700('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9700('0xb'));var deskjs=require(_0x9700('0xc'));var toCsv=require(_0x9700('0x9'));var querystring=require(_0x9700('0xd'));var Papa=require('papaparse');var Redis=require(_0x9700('0xe'));var authService=require(_0x9700('0xf'));var qs=require(_0x9700('0x10'));var as=require(_0x9700('0x11'));var hardwareService=require(_0x9700('0x12'));var logger=require(_0x9700('0x13'))('api');var utils=require(_0x9700('0x14'));var config=require(_0x9700('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9700('0x16'))['db'];function respondWithStatusCode(_0x88ff22,_0x126aa3){_0x126aa3=_0x126aa3||0xcc;return function(_0x3b0e3b){if(_0x3b0e3b){return _0x88ff22['sendStatus'](_0x126aa3);}return _0x88ff22[_0x9700('0x17')](_0x126aa3)[_0x9700('0x18')]();};}function respondWithResult(_0x1931a3,_0x1c30de){_0x1c30de=_0x1c30de||0xc8;return function(_0x3b27d4){if(_0x3b27d4){return _0x1931a3[_0x9700('0x17')](_0x1c30de)[_0x9700('0x19')](_0x3b27d4);}};}function respondWithFilteredResult(_0x2e7aff,_0x584536){return function(_0x506a27){if(_0x506a27){var _0x357d99=typeof _0x584536[_0x9700('0x1a')]===_0x9700('0x1b')&&typeof _0x584536[_0x9700('0x1c')]===_0x9700('0x1b');var _0x451def=_0x506a27[_0x9700('0x1d')];var _0x118c60=_0x357d99?0x0:_0x584536[_0x9700('0x1a')];var _0x540107=_0x357d99?_0x506a27[_0x9700('0x1d')]:_0x584536[_0x9700('0x1a')]+_0x584536['limit'];var _0x498797;if(_0x540107>=_0x451def){_0x540107=_0x451def;_0x498797=0xc8;}else{_0x498797=0xce;}_0x2e7aff['status'](_0x498797);return _0x2e7aff[_0x9700('0x1e')](_0x9700('0x1f'),_0x118c60+'-'+_0x540107+'/'+_0x451def)[_0x9700('0x19')](_0x506a27);}return null;};}function patchUpdates(_0x560e50){return function(_0x2f1cdf){try{jsonpatch[_0x9700('0x20')](_0x2f1cdf,_0x560e50,!![]);}catch(_0x5ee102){return BPromise[_0x9700('0x21')](_0x5ee102);}return _0x2f1cdf[_0x9700('0x22')]();};}function saveUpdates(_0x4a958f,_0x47e42f){return function(_0x1ac5b4){if(_0x1ac5b4){return _0x1ac5b4[_0x9700('0x23')](_0x4a958f)[_0x9700('0x24')](function(_0x388994){return _0x388994;});}return null;};}function removeEntity(_0x94cb53,_0x5527b3){return function(_0x97a3f3){if(_0x97a3f3){return _0x97a3f3[_0x9700('0x25')]()['then'](function(){_0x94cb53['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb93011,_0x16a6c5){return function(_0x56f3b9){if(!_0x56f3b9){_0xb93011[_0x9700('0x26')](0x194);}return _0x56f3b9;};}function handleError(_0x48beff,_0x2c3d61){_0x2c3d61=_0x2c3d61||0x1f4;return function(_0x58ae47){logger[_0x9700('0x27')](_0x58ae47[_0x9700('0x28')]);if(_0x58ae47[_0x9700('0x29')]){delete _0x58ae47[_0x9700('0x29')];}_0x48beff['status'](_0x2c3d61)[_0x9700('0x2a')](_0x58ae47);};}exports['index']=function(_0x19c6a8,_0x1d0dfc){var _0x51b2bf={},_0x4edc68={},_0x542f02={'count':0x0,'rows':[]};var _0x54b5ef=_[_0x9700('0x2b')](db[_0x9700('0x2c')][_0x9700('0x2d')],function(_0x2972ff){return{'name':_0x2972ff[_0x9700('0x2e')],'type':_0x2972ff[_0x9700('0x2f')][_0x9700('0x30')]};});_0x4edc68['model']=_['map'](_0x54b5ef,'name');_0x4edc68['query']=_[_0x9700('0x31')](_0x19c6a8[_0x9700('0x32')]);_0x4edc68[_0x9700('0x33')]=_[_0x9700('0x34')](_0x4edc68[_0x9700('0x35')],_0x4edc68[_0x9700('0x32')]);_0x51b2bf[_0x9700('0x36')]=_['intersection'](_0x4edc68[_0x9700('0x35')],qs[_0x9700('0x37')](_0x19c6a8[_0x9700('0x32')][_0x9700('0x37')]));_0x51b2bf[_0x9700('0x36')]=_0x51b2bf['attributes'][_0x9700('0x38')]?_0x51b2bf['attributes']:_0x4edc68[_0x9700('0x35')];if(!_0x19c6a8[_0x9700('0x32')][_0x9700('0x39')](_0x9700('0x3a'))){_0x51b2bf[_0x9700('0x1c')]=qs['limit'](_0x19c6a8[_0x9700('0x32')][_0x9700('0x1c')]);_0x51b2bf[_0x9700('0x1a')]=qs[_0x9700('0x1a')](_0x19c6a8[_0x9700('0x32')]['offset']);}_0x51b2bf[_0x9700('0x3b')]=qs[_0x9700('0x3c')](_0x19c6a8[_0x9700('0x32')]['sort']);_0x51b2bf['where']=qs['filters'](_[_0x9700('0x3d')](_0x19c6a8[_0x9700('0x32')],_0x4edc68[_0x9700('0x33')]),_0x54b5ef);if(_0x19c6a8[_0x9700('0x32')][_0x9700('0x3e')]){_0x51b2bf[_0x9700('0x3f')]=_[_0x9700('0x40')](_0x51b2bf[_0x9700('0x3f')],{'$or':_['map'](_0x54b5ef,function(_0x3efe5b){if(_0x3efe5b[_0x9700('0x2f')]!==_0x9700('0x41')){var _0x523a02={};_0x523a02[_0x3efe5b['name']]={'$like':'%'+_0x19c6a8[_0x9700('0x32')][_0x9700('0x3e')]+'%'};return _0x523a02;}})});}_0x51b2bf=_[_0x9700('0x40')]({},_0x51b2bf,_0x19c6a8['options']);var _0x498881={'where':_0x51b2bf[_0x9700('0x3f')]};return db[_0x9700('0x2c')][_0x9700('0x1d')](_0x498881)[_0x9700('0x24')](function(_0x2929d9){_0x542f02[_0x9700('0x1d')]=_0x2929d9;if(_0x19c6a8[_0x9700('0x32')][_0x9700('0x42')]){_0x51b2bf['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x9700('0x43')](_0x51b2bf);})[_0x9700('0x24')](function(_0x1e6d9e){_0x542f02[_0x9700('0x44')]=_0x1e6d9e;return _0x542f02;})['then'](respondWithFilteredResult(_0x1d0dfc,_0x51b2bf))['catch'](handleError(_0x1d0dfc,null));};exports[_0x9700('0x45')]=function(_0x3a9daf,_0x555b63){var _0x511de0={'raw':!![],'where':{'id':_0x3a9daf[_0x9700('0x46')]['id']}},_0x40f995={};_0x40f995['model']=_[_0x9700('0x31')](db[_0x9700('0x2c')][_0x9700('0x2d')]);_0x40f995[_0x9700('0x32')]=_[_0x9700('0x31')](_0x3a9daf['query']);_0x40f995[_0x9700('0x33')]=_['intersection'](_0x40f995['model'],_0x40f995[_0x9700('0x32')]);_0x511de0[_0x9700('0x36')]=_[_0x9700('0x34')](_0x40f995[_0x9700('0x35')],qs[_0x9700('0x37')](_0x3a9daf[_0x9700('0x32')][_0x9700('0x37')]));_0x511de0[_0x9700('0x36')]=_0x511de0['attributes'][_0x9700('0x38')]?_0x511de0['attributes']:_0x40f995[_0x9700('0x35')];if(_0x3a9daf[_0x9700('0x32')][_0x9700('0x42')]){_0x511de0[_0x9700('0x47')]=[{'all':!![]}];}_0x511de0=_[_0x9700('0x40')]({},_0x511de0,_0x3a9daf[_0x9700('0x48')]);return db[_0x9700('0x2c')][_0x9700('0x49')](_0x511de0)[_0x9700('0x24')](handleEntityNotFound(_0x555b63,null))[_0x9700('0x24')](respondWithResult(_0x555b63,null))[_0x9700('0x4a')](handleError(_0x555b63,null));};exports['create']=function(_0x17189d,_0x168bcd){return db[_0x9700('0x2c')][_0x9700('0x4b')](_0x17189d['body'],{})[_0x9700('0x24')](respondWithResult(_0x168bcd,0xc9))['catch'](handleError(_0x168bcd,null));};exports[_0x9700('0x23')]=function(_0x54e029,_0x150cc8){if(_0x54e029[_0x9700('0x4c')]['id']){delete _0x54e029[_0x9700('0x4c')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x54e029[_0x9700('0x46')]['id']}})[_0x9700('0x24')](handleEntityNotFound(_0x150cc8,null))[_0x9700('0x24')](saveUpdates(_0x54e029[_0x9700('0x4c')],null))['then'](respondWithResult(_0x150cc8,null))['catch'](handleError(_0x150cc8,null));};exports[_0x9700('0x25')]=function(_0xcecc63,_0x51c393){return db[_0x9700('0x2c')][_0x9700('0x49')]({'where':{'id':_0xcecc63[_0x9700('0x46')]['id']}})[_0x9700('0x24')](handleEntityNotFound(_0x51c393,null))['then'](removeEntity(_0x51c393,null))[_0x9700('0x4a')](handleError(_0x51c393,null));};exports['describe']=function(_0xf49ade,_0x108348){return db[_0x9700('0x2c')][_0x9700('0x4d')]()[_0x9700('0x24')](respondWithResult(_0x108348,null))[_0x9700('0x4a')](handleError(_0x108348,null));}; \ No newline at end of file +var _0x3a69=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','offset','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x430de2,_0x1e47f5){var _0x2d9072=function(_0x243403){while(--_0x243403){_0x430de2['push'](_0x430de2['shift']());}};_0x2d9072(++_0x1e47f5);}(_0x3a69,0x9b));var _0x93a6=function(_0x431532,_0x55c467){_0x431532=_0x431532-0x0;var _0x50a52d=_0x3a69[_0x431532];return _0x50a52d;};'use strict';var emlformat=require(_0x93a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93a6('0x1'));var jsonpatch=require(_0x93a6('0x2'));var rp=require('request-promise');var moment=require(_0x93a6('0x3'));var BPromise=require(_0x93a6('0x4'));var Mustache=require('mustache');var util=require(_0x93a6('0x5'));var path=require('path');var sox=require(_0x93a6('0x6'));var csv=require(_0x93a6('0x7'));var ejs=require(_0x93a6('0x8'));var fs=require('fs');var fs_extra=require(_0x93a6('0x9'));var _=require(_0x93a6('0xa'));var squel=require('squel');var crypto=require(_0x93a6('0xb'));var jsforce=require(_0x93a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x93a6('0x7'));var querystring=require(_0x93a6('0xd'));var Papa=require(_0x93a6('0xe'));var Redis=require(_0x93a6('0xf'));var authService=require(_0x93a6('0x10'));var qs=require(_0x93a6('0x11'));var as=require(_0x93a6('0x12'));var hardwareService=require(_0x93a6('0x13'));var logger=require(_0x93a6('0x14'))(_0x93a6('0x15'));var utils=require(_0x93a6('0x16'));var config=require(_0x93a6('0x17'));var licenseUtil=require(_0x93a6('0x18'));var db=require(_0x93a6('0x19'))['db'];function respondWithStatusCode(_0x4f2722,_0x451942){_0x451942=_0x451942||0xcc;return function(_0x295ff3){if(_0x295ff3){return _0x4f2722[_0x93a6('0x1a')](_0x451942);}return _0x4f2722['status'](_0x451942)[_0x93a6('0x1b')]();};}function respondWithResult(_0x578ccb,_0xb43dc0){_0xb43dc0=_0xb43dc0||0xc8;return function(_0x3da276){if(_0x3da276){return _0x578ccb[_0x93a6('0x1c')](_0xb43dc0)[_0x93a6('0x1d')](_0x3da276);}};}function respondWithFilteredResult(_0x2f89d9,_0xc9dd82){return function(_0x565aed){if(_0x565aed){var _0x26d8d8=typeof _0xc9dd82['offset']===_0x93a6('0x1e')&&typeof _0xc9dd82[_0x93a6('0x1f')]===_0x93a6('0x1e');var _0x5c6104=_0x565aed[_0x93a6('0x20')];var _0x35bb64=_0x26d8d8?0x0:_0xc9dd82['offset'];var _0x2aacd0=_0x26d8d8?_0x565aed['count']:_0xc9dd82['offset']+_0xc9dd82[_0x93a6('0x1f')];var _0x372fe6;if(_0x2aacd0>=_0x5c6104){_0x2aacd0=_0x5c6104;_0x372fe6=0xc8;}else{_0x372fe6=0xce;}_0x2f89d9['status'](_0x372fe6);return _0x2f89d9[_0x93a6('0x21')](_0x93a6('0x22'),_0x35bb64+'-'+_0x2aacd0+'/'+_0x5c6104)[_0x93a6('0x1d')](_0x565aed);}return null;};}function patchUpdates(_0x2a6a9c){return function(_0x113bdd){try{jsonpatch[_0x93a6('0x23')](_0x113bdd,_0x2a6a9c,!![]);}catch(_0x3a8acf){return BPromise[_0x93a6('0x24')](_0x3a8acf);}return _0x113bdd[_0x93a6('0x25')]();};}function saveUpdates(_0x31eabe,_0x4c46e1){return function(_0x1ff45a){if(_0x1ff45a){return _0x1ff45a[_0x93a6('0x26')](_0x31eabe)[_0x93a6('0x27')](function(_0x4e5890){return _0x4e5890;});}return null;};}function removeEntity(_0x388ab0,_0x451244){return function(_0x21ee05){if(_0x21ee05){return _0x21ee05[_0x93a6('0x28')]()['then'](function(){_0x388ab0[_0x93a6('0x1c')](0xcc)[_0x93a6('0x1b')]();});}};}function handleEntityNotFound(_0x4a8d69,_0x4e158f){return function(_0x49fe75){if(!_0x49fe75){_0x4a8d69[_0x93a6('0x1a')](0x194);}return _0x49fe75;};}function handleError(_0xc823ad,_0x5391a6){_0x5391a6=_0x5391a6||0x1f4;return function(_0x395c1a){logger[_0x93a6('0x29')](_0x395c1a['stack']);if(_0x395c1a[_0x93a6('0x2a')]){delete _0x395c1a[_0x93a6('0x2a')];}_0xc823ad['status'](_0x5391a6)[_0x93a6('0x2b')](_0x395c1a);};}exports[_0x93a6('0x2c')]=function(_0x2eadde,_0x3593f2){var _0x49cb71={},_0x4e60cc={},_0x594447={'count':0x0,'rows':[]};var _0x49bb3f=_[_0x93a6('0x2d')](db[_0x93a6('0x2e')][_0x93a6('0x2f')],function(_0x32ea50){return{'name':_0x32ea50['fieldName'],'type':_0x32ea50[_0x93a6('0x30')][_0x93a6('0x31')]};});_0x4e60cc[_0x93a6('0x32')]=_[_0x93a6('0x2d')](_0x49bb3f,_0x93a6('0x2a'));_0x4e60cc['query']=_[_0x93a6('0x33')](_0x2eadde[_0x93a6('0x34')]);_0x4e60cc['filters']=_[_0x93a6('0x35')](_0x4e60cc[_0x93a6('0x32')],_0x4e60cc[_0x93a6('0x34')]);_0x49cb71['attributes']=_[_0x93a6('0x35')](_0x4e60cc[_0x93a6('0x32')],qs[_0x93a6('0x36')](_0x2eadde['query']['fields']));_0x49cb71['attributes']=_0x49cb71[_0x93a6('0x37')][_0x93a6('0x38')]?_0x49cb71['attributes']:_0x4e60cc[_0x93a6('0x32')];if(!_0x2eadde[_0x93a6('0x34')]['hasOwnProperty'](_0x93a6('0x39'))){_0x49cb71[_0x93a6('0x1f')]=qs[_0x93a6('0x1f')](_0x2eadde['query']['limit']);_0x49cb71['offset']=qs[_0x93a6('0x3a')](_0x2eadde[_0x93a6('0x34')][_0x93a6('0x3a')]);}_0x49cb71[_0x93a6('0x3b')]=qs[_0x93a6('0x3c')](_0x2eadde[_0x93a6('0x34')][_0x93a6('0x3c')]);_0x49cb71[_0x93a6('0x3d')]=qs[_0x93a6('0x3e')](_[_0x93a6('0x3f')](_0x2eadde['query'],_0x4e60cc[_0x93a6('0x3e')]),_0x49bb3f);if(_0x2eadde[_0x93a6('0x34')]['filter']){_0x49cb71[_0x93a6('0x3d')]=_['merge'](_0x49cb71[_0x93a6('0x3d')],{'$or':_[_0x93a6('0x2d')](_0x49bb3f,function(_0x4856ff){if(_0x4856ff[_0x93a6('0x30')]!==_0x93a6('0x40')){var _0x46eb5f={};_0x46eb5f[_0x4856ff[_0x93a6('0x2a')]]={'$like':'%'+_0x2eadde[_0x93a6('0x34')][_0x93a6('0x41')]+'%'};return _0x46eb5f;}})});}_0x49cb71=_[_0x93a6('0x42')]({},_0x49cb71,_0x2eadde[_0x93a6('0x43')]);var _0x20a8e5={'where':_0x49cb71[_0x93a6('0x3d')]};return db[_0x93a6('0x2e')][_0x93a6('0x20')](_0x20a8e5)[_0x93a6('0x27')](function(_0x55d960){_0x594447[_0x93a6('0x20')]=_0x55d960;if(_0x2eadde[_0x93a6('0x34')][_0x93a6('0x44')]){_0x49cb71[_0x93a6('0x45')]=[{'all':!![]}];}return db[_0x93a6('0x2e')][_0x93a6('0x46')](_0x49cb71);})[_0x93a6('0x27')](function(_0x1f57c4){_0x594447[_0x93a6('0x47')]=_0x1f57c4;return _0x594447;})[_0x93a6('0x27')](respondWithFilteredResult(_0x3593f2,_0x49cb71))[_0x93a6('0x48')](handleError(_0x3593f2,null));};exports[_0x93a6('0x49')]=function(_0x2f68b7,_0x15b9d2){var _0x1686de={'raw':!![],'where':{'id':_0x2f68b7[_0x93a6('0x4a')]['id']}},_0x11e36f={};_0x11e36f[_0x93a6('0x32')]=_[_0x93a6('0x33')](db['MailSubstatus'][_0x93a6('0x2f')]);_0x11e36f[_0x93a6('0x34')]=_['keys'](_0x2f68b7['query']);_0x11e36f['filters']=_[_0x93a6('0x35')](_0x11e36f['model'],_0x11e36f[_0x93a6('0x34')]);_0x1686de[_0x93a6('0x37')]=_[_0x93a6('0x35')](_0x11e36f[_0x93a6('0x32')],qs[_0x93a6('0x36')](_0x2f68b7[_0x93a6('0x34')][_0x93a6('0x36')]));_0x1686de['attributes']=_0x1686de['attributes']['length']?_0x1686de['attributes']:_0x11e36f[_0x93a6('0x32')];if(_0x2f68b7[_0x93a6('0x34')][_0x93a6('0x44')]){_0x1686de['include']=[{'all':!![]}];}_0x1686de=_[_0x93a6('0x42')]({},_0x1686de,_0x2f68b7[_0x93a6('0x43')]);return db[_0x93a6('0x2e')][_0x93a6('0x4b')](_0x1686de)['then'](handleEntityNotFound(_0x15b9d2,null))[_0x93a6('0x27')](respondWithResult(_0x15b9d2,null))['catch'](handleError(_0x15b9d2,null));};exports[_0x93a6('0x4c')]=function(_0xd7e799,_0x18b514){return db[_0x93a6('0x2e')][_0x93a6('0x4c')](_0xd7e799[_0x93a6('0x4d')],{})['then'](respondWithResult(_0x18b514,0xc9))['catch'](handleError(_0x18b514,null));};exports[_0x93a6('0x26')]=function(_0x92a413,_0x3555e6){if(_0x92a413[_0x93a6('0x4d')]['id']){delete _0x92a413[_0x93a6('0x4d')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x92a413[_0x93a6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3555e6,null))[_0x93a6('0x27')](saveUpdates(_0x92a413['body'],null))['then'](respondWithResult(_0x3555e6,null))['catch'](handleError(_0x3555e6,null));};exports[_0x93a6('0x28')]=function(_0x3eb2b1,_0x38cf99){return db['MailSubstatus'][_0x93a6('0x4b')]({'where':{'id':_0x3eb2b1[_0x93a6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x38cf99,null))[_0x93a6('0x27')](removeEntity(_0x38cf99,null))[_0x93a6('0x48')](handleError(_0x38cf99,null));};exports['describe']=function(_0x169708,_0x1788ba){return db[_0x93a6('0x2e')][_0x93a6('0x4e')]()[_0x93a6('0x27')](respondWithResult(_0x1788ba,null))['catch'](handleError(_0x1788ba,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index a2b059a..220735b 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 _0x52e6=['update','emit','exports','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x822fb9,_0x3fc565){var _0x13f715=function(_0x35e222){while(--_0x35e222){_0x822fb9['push'](_0x822fb9['shift']());}};_0x13f715(++_0x3fc565);}(_0x52e6,0x153));var _0x652e=function(_0x1e724a,_0x20e0c3){_0x1e724a=_0x1e724a-0x0;var _0x877058=_0x52e6[_0x1e724a];return _0x877058;};'use strict';var EventEmitter=require(_0x652e('0x0'));var MailSubstatus=require(_0x652e('0x1'))['db'][_0x652e('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x652e('0x3')](0x0);var events={'afterUpdate':_0x652e('0x4')};function emitEvent(_0x164f79){return function(_0x26ae3d,_0x1a4db0,_0x4932a9){MailSubstatusEvents[_0x652e('0x5')](_0x164f79+':'+_0x26ae3d['id'],_0x26ae3d);MailSubstatusEvents[_0x652e('0x5')](_0x164f79,_0x26ae3d);_0x4932a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x652e('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xc7b2=['setMaxListeners','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4e0be5,_0x462d7a){var _0x4c96b3=function(_0x49af0e){while(--_0x49af0e){_0x4e0be5['push'](_0x4e0be5['shift']());}};_0x4c96b3(++_0x462d7a);}(_0xc7b2,0x100));var _0x2c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2c7b('0x0'));var MailSubstatus=require(_0x2c7b('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x2c7b('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2fcaa9){return function(_0x476dc3,_0x542bc8,_0x2d477e){MailSubstatusEvents[_0x2c7b('0x3')](_0x2fcaa9+':'+_0x476dc3['id'],_0x476dc3);MailSubstatusEvents[_0x2c7b('0x3')](_0x2fcaa9,_0x476dc3);_0x2d477e(null);};}for(var e in events){if(events[_0x2c7b('0x4')](e)){var event=events[e];MailSubstatus[_0x2c7b('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 761affa..b811f6d 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 _0x29ca=['./mailSubstatus.attributes','exports','models','define','mail_substatuses','update','name','mailSubstatus','_previousDataValues','catch'];(function(_0x3a574b,_0x2c4f1d){var _0x445031=function(_0x559747){while(--_0x559747){_0x3a574b['push'](_0x3a574b['shift']());}};_0x445031(++_0x2c4f1d);}(_0x29ca,0x122));var _0xa29c=function(_0x45283b,_0xe68902){_0x45283b=_0x45283b-0x0;var _0x1b23f9=_0x29ca[_0x45283b];return _0x1b23f9;};'use strict';var attributes=require(_0xa29c('0x0'));module[_0xa29c('0x1')]=function(_0x38d60c){var _0xa1c404=_0x38d60c[_0xa29c('0x2')];return _0x38d60c[_0xa29c('0x3')]('MailSubstatus',attributes,{'tableName':_0xa29c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1c7e82,_0x3e8045,_0x22b0a4){return _0xa1c404['Condition'][_0xa29c('0x5')]({'value':_0x1c7e82[_0xa29c('0x6')]},{'where':{'field':_0xa29c('0x7'),'value':_0x1c7e82[_0xa29c('0x8')]['name']}})['then'](function(){_0x22b0a4();})[_0xa29c('0x9')](function(_0x391b61){_0x22b0a4(_0x391b61);});}}});}; \ No newline at end of file +var _0x3c82=['_previousDataValues','then','catch','models','MailSubstatus','mail_substatuses','name','mailSubstatus'];(function(_0x524515,_0x52d779){var _0x1ce231=function(_0x103cec){while(--_0x103cec){_0x524515['push'](_0x524515['shift']());}};_0x1ce231(++_0x52d779);}(_0x3c82,0x1f3));var _0x23c8=function(_0x5e477e,_0x50aebb){_0x5e477e=_0x5e477e-0x0;var _0x408a61=_0x3c82[_0x5e477e];return _0x408a61;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x5d96af){var _0x5c16a0=_0x5d96af[_0x23c8('0x0')];return _0x5d96af['define'](_0x23c8('0x1'),attributes,{'tableName':_0x23c8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1e5b3c,_0x13ebe1,_0x5f480b){return _0x5c16a0['Condition']['update']({'value':_0x1e5b3c[_0x23c8('0x3')]},{'where':{'field':_0x23c8('0x4'),'value':_0x1e5b3c[_0x23c8('0x5')][_0x23c8('0x3')]}})[_0x23c8('0x6')](function(){_0x5f480b();})[_0x23c8('0x7')](function(_0x2bcb30){_0x5f480b(_0x2bcb30);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 2229597..4951c9e 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 _0x29bc=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0x1f7af0,_0x24b93b){var _0x507a23=function(_0x2eeff3){while(--_0x2eeff3){_0x1f7af0['push'](_0x1f7af0['shift']());}};_0x507a23(++_0x24b93b);}(_0x29bc,0x146));var _0xc29b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x29bc[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xc29b('0x0'));var moment=require(_0xc29b('0x1'));var BPromise=require(_0xc29b('0x2'));var rs=require(_0xc29b('0x3'));var fs=require('fs');var Redis=require(_0xc29b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc29b('0x5'));var logger=require(_0xc29b('0x6'))(_0xc29b('0x7'));var config=require(_0xc29b('0x8'));var jayson=require(_0xc29b('0x9'));var client=jayson[_0xc29b('0xa')][_0xc29b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34e103,_0x1e3a93,_0x3ad166){return new BPromise(function(_0xc31f77,_0x13efe2){return client[_0xc29b('0xc')](_0x34e103,_0x3ad166)[_0xc29b('0xd')](function(_0x353067){logger[_0xc29b('0xe')](_0xc29b('0xf'),_0x1e3a93,'request\x20sent');logger['debug'](_0xc29b('0x10'),_0x1e3a93,'request\x20sent',JSON[_0xc29b('0x11')](_0x353067));if(_0x353067['error']){if(_0x353067[_0xc29b('0x12')][_0xc29b('0x13')]===0x1f4){logger[_0xc29b('0x12')](_0xc29b('0xf'),_0x1e3a93,_0x353067[_0xc29b('0x12')]['message']);return _0x13efe2(_0x353067[_0xc29b('0x12')][_0xc29b('0x14')]);}logger[_0xc29b('0x12')](_0xc29b('0xf'),_0x1e3a93,_0x353067[_0xc29b('0x12')][_0xc29b('0x14')]);return _0xc31f77(_0x353067[_0xc29b('0x12')][_0xc29b('0x14')]);}else{logger[_0xc29b('0xe')](_0xc29b('0xf'),_0x1e3a93,'request\x20sent');_0xc31f77(_0x353067[_0xc29b('0x15')][_0xc29b('0x14')]);}})['catch'](function(_0x8320e9){logger[_0xc29b('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x1e3a93,_0x8320e9);_0x13efe2(_0x8320e9);});});} \ No newline at end of file +var _0x42f1=['info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b8bbb,_0x33fc97){var _0x1b75a5=function(_0x5c84ff){while(--_0x5c84ff){_0x4b8bbb['push'](_0x4b8bbb['shift']());}};_0x1b75a5(++_0x33fc97);}(_0x42f1,0x1e2));var _0x142f=function(_0x2d3903,_0x476d2e){_0x2d3903=_0x2d3903-0x0;var _0x171317=_0x42f1[_0x2d3903];return _0x171317;};'use strict';var _=require(_0x142f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x142f('0x1'));var rs=require(_0x142f('0x2'));var fs=require('fs');var Redis=require(_0x142f('0x3'));var db=require(_0x142f('0x4'))['db'];var utils=require(_0x142f('0x5'));var logger=require(_0x142f('0x6'))(_0x142f('0x7'));var config=require(_0x142f('0x8'));var jayson=require(_0x142f('0x9'));var client=jayson[_0x142f('0xa')][_0x142f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113fa,_0x39b289,_0x4a196f){return new BPromise(function(_0x4db8f9,_0x44a323){return client[_0x142f('0xc')](_0x2113fa,_0x4a196f)[_0x142f('0xd')](function(_0x2d6c7b){logger['info'](_0x142f('0xe'),_0x39b289,_0x142f('0xf'));logger[_0x142f('0x10')](_0x142f('0x11'),_0x39b289,_0x142f('0xf'),JSON[_0x142f('0x12')](_0x2d6c7b));if(_0x2d6c7b[_0x142f('0x13')]){if(_0x2d6c7b[_0x142f('0x13')][_0x142f('0x14')]===0x1f4){logger[_0x142f('0x13')](_0x142f('0xe'),_0x39b289,_0x2d6c7b[_0x142f('0x13')][_0x142f('0x15')]);return _0x44a323(_0x2d6c7b[_0x142f('0x13')][_0x142f('0x15')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x39b289,_0x2d6c7b[_0x142f('0x13')][_0x142f('0x15')]);return _0x4db8f9(_0x2d6c7b['error'][_0x142f('0x15')]);}else{logger[_0x142f('0x16')]('MailSubstatus,\x20%s,\x20%s',_0x39b289,_0x142f('0xf'));_0x4db8f9(_0x2d6c7b[_0x142f('0x17')]['message']);}})['catch'](function(_0x217391){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x39b289,_0x217391);_0x44a323(_0x217391);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 19c08ea..b989753 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 _0xa7f7=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','create','put','delete','destroy','exports','connect-timeout','Router','fs-extra'];(function(_0x5663f7,_0xe1e383){var _0x21eb05=function(_0x4bcfc7){while(--_0x4bcfc7){_0x5663f7['push'](_0x5663f7['shift']());}};_0x21eb05(++_0xe1e383);}(_0xa7f7,0xfd));var _0x7a7f=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xa7f7[_0x421eeb];return _0x2c7371;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7a7f('0x0'));var express=require('express');var router=express[_0x7a7f('0x1')]();var fs_extra=require(_0x7a7f('0x2'));var auth=require(_0x7a7f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7a7f('0x4'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x7a7f('0x5')](),controller[_0x7a7f('0x6')]);router[_0x7a7f('0x7')](_0x7a7f('0x8'),auth[_0x7a7f('0x5')](),controller[_0x7a7f('0x9')]);router[_0x7a7f('0x7')](_0x7a7f('0xa'),auth[_0x7a7f('0x5')](),controller['show']);router['post']('/',auth[_0x7a7f('0x5')](),controller[_0x7a7f('0xb')]);router[_0x7a7f('0xc')](_0x7a7f('0xa'),auth[_0x7a7f('0x5')](),controller['update']);router[_0x7a7f('0xd')](_0x7a7f('0xa'),auth[_0x7a7f('0x5')](),controller[_0x7a7f('0xe')]);module[_0x7a7f('0xf')]=router; \ No newline at end of file +var _0x27be=['describe','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3de230,_0x5184cc){var _0x16779e=function(_0x26d6e7){while(--_0x26d6e7){_0x3de230['push'](_0x3de230['shift']());}};_0x16779e(++_0x5184cc);}(_0x27be,0x1bc));var _0xe27b=function(_0x4ed481,_0x1aad66){_0x4ed481=_0x4ed481-0x0;var _0x553d22=_0x27be[_0x4ed481];return _0x553d22;};'use strict';var multer=require(_0xe27b('0x0'));var util=require(_0xe27b('0x1'));var path=require(_0xe27b('0x2'));var timeout=require(_0xe27b('0x3'));var express=require(_0xe27b('0x4'));var router=express['Router']();var fs_extra=require(_0xe27b('0x5'));var auth=require(_0xe27b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe27b('0x7'));var controller=require('./mailTransferReport.controller');router[_0xe27b('0x8')]('/',auth[_0xe27b('0x9')](),controller[_0xe27b('0xa')]);router['get'](_0xe27b('0xb'),auth[_0xe27b('0x9')](),controller[_0xe27b('0xc')]);router[_0xe27b('0x8')](_0xe27b('0xd'),auth[_0xe27b('0x9')](),controller[_0xe27b('0xe')]);router['post']('/',auth[_0xe27b('0x9')](),controller['create']);router[_0xe27b('0xf')](_0xe27b('0xd'),auth[_0xe27b('0x9')](),controller[_0xe27b('0x10')]);router[_0xe27b('0x11')](_0xe27b('0xd'),auth[_0xe27b('0x9')](),controller['destroy']);module[_0xe27b('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4c8a318..d8cd6ca 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x447139,_0x39e32b){var _0x3660cd=function(_0xf00060){while(--_0xf00060){_0x447139['push'](_0x447139['shift']());}};_0x3660cd(++_0x39e32b);}(_0x70e0,0x17b));var _0x070e=function(_0x199ab0,_0x5076e9){_0x199ab0=_0x199ab0-0x0;var _0x546f9f=_0x70e0[_0x199ab0];return _0x546f9f;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3fbc6a,_0x1f1133){var _0x524a7c=function(_0x5d25c8){while(--_0x5d25c8){_0x3fbc6a['push'](_0x3fbc6a['shift']());}};_0x524a7c(++_0x1f1133);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 daad783..c21ca31 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 _0x7d1f=['destroy','end','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','filters','model','query','attributes','intersection','fields','hasOwnProperty','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0x7d1f,0x70));var _0xf7d1=function(_0x1192db,_0x3587b9){_0x1192db=_0x1192db-0x0;var _0xe6ada3=_0x7d1f[_0x1192db];return _0xe6ada3;};'use strict';var emlformat=require(_0xf7d1('0x0'));var rimraf=require(_0xf7d1('0x1'));var zipdir=require(_0xf7d1('0x2'));var jsonpatch=require(_0xf7d1('0x3'));var rp=require(_0xf7d1('0x4'));var moment=require(_0xf7d1('0x5'));var BPromise=require(_0xf7d1('0x6'));var Mustache=require(_0xf7d1('0x7'));var util=require(_0xf7d1('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf7d1('0x9'));var ejs=require(_0xf7d1('0xa'));var fs=require('fs');var fs_extra=require(_0xf7d1('0xb'));var _=require(_0xf7d1('0xc'));var squel=require(_0xf7d1('0xd'));var crypto=require(_0xf7d1('0xe'));var jsforce=require(_0xf7d1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf7d1('0x10'));var Papa=require(_0xf7d1('0x11'));var Redis=require(_0xf7d1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf7d1('0x13'));var as=require(_0xf7d1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7d1('0x15'))(_0xf7d1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7d1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f764c,_0x287d4c){_0x287d4c=_0x287d4c||0xcc;return function(_0x4044d3){if(_0x4044d3){return _0x1f764c[_0xf7d1('0x18')](_0x287d4c);}return _0x1f764c[_0xf7d1('0x19')](_0x287d4c)['end']();};}function respondWithResult(_0x2016a4,_0x1b6d94){_0x1b6d94=_0x1b6d94||0xc8;return function(_0x23c259){if(_0x23c259){return _0x2016a4[_0xf7d1('0x19')](_0x1b6d94)['json'](_0x23c259);}};}function respondWithFilteredResult(_0xada0b7,_0x17e98d){return function(_0x40a4c8){if(_0x40a4c8){var _0x34bf1a=typeof _0x17e98d['offset']==='undefined'&&typeof _0x17e98d[_0xf7d1('0x1a')]===_0xf7d1('0x1b');var _0x5462fb=_0x40a4c8[_0xf7d1('0x1c')];var _0x508e37=_0x34bf1a?0x0:_0x17e98d[_0xf7d1('0x1d')];var _0x504925=_0x34bf1a?_0x40a4c8['count']:_0x17e98d[_0xf7d1('0x1d')]+_0x17e98d[_0xf7d1('0x1a')];var _0x2a16ee;if(_0x504925>=_0x5462fb){_0x504925=_0x5462fb;_0x2a16ee=0xc8;}else{_0x2a16ee=0xce;}_0xada0b7[_0xf7d1('0x19')](_0x2a16ee);return _0xada0b7[_0xf7d1('0x1e')](_0xf7d1('0x1f'),_0x508e37+'-'+_0x504925+'/'+_0x5462fb)[_0xf7d1('0x20')](_0x40a4c8);}return null;};}function patchUpdates(_0x47395c){return function(_0x3114f4){try{jsonpatch[_0xf7d1('0x21')](_0x3114f4,_0x47395c,!![]);}catch(_0x3bd383){return BPromise[_0xf7d1('0x22')](_0x3bd383);}return _0x3114f4[_0xf7d1('0x23')]();};}function saveUpdates(_0x4b26e7,_0x16738f){return function(_0x189b6d){if(_0x189b6d){return _0x189b6d[_0xf7d1('0x24')](_0x4b26e7)[_0xf7d1('0x25')](function(_0x589e72){return _0x589e72;});}return null;};}function removeEntity(_0x308712,_0xe3c4a){return function(_0x522d61){if(_0x522d61){return _0x522d61[_0xf7d1('0x26')]()['then'](function(){_0x308712['status'](0xcc)[_0xf7d1('0x27')]();});}};}function handleEntityNotFound(_0x4b492f,_0x9a4c84){return function(_0x4f12bc){if(!_0x4f12bc){_0x4b492f[_0xf7d1('0x18')](0x194);}return _0x4f12bc;};}function handleError(_0x2bab19,_0x34e0bf){_0x34e0bf=_0x34e0bf||0x1f4;return function(_0x570a39){logger[_0xf7d1('0x28')](_0x570a39[_0xf7d1('0x29')]);if(_0x570a39['name']){delete _0x570a39[_0xf7d1('0x2a')];}_0x2bab19['status'](_0x34e0bf)['send'](_0x570a39);};}exports[_0xf7d1('0x2b')]=function(_0x39914f,_0x30e073){var _0x11ed40={},_0x2f40c1={},_0x2034cd={'count':0x0,'rows':[]};var _0x5c18b4=_[_0xf7d1('0x2c')](db[_0xf7d1('0x2d')][_0xf7d1('0x2e')],function(_0x17f36c){return{'name':_0x17f36c[_0xf7d1('0x2f')],'type':_0x17f36c[_0xf7d1('0x30')][_0xf7d1('0x31')]};});_0x2f40c1['model']=_[_0xf7d1('0x2c')](_0x5c18b4,_0xf7d1('0x2a'));_0x2f40c1['query']=_['keys'](_0x39914f['query']);_0x2f40c1[_0xf7d1('0x32')]=_['intersection'](_0x2f40c1[_0xf7d1('0x33')],_0x2f40c1[_0xf7d1('0x34')]);_0x11ed40[_0xf7d1('0x35')]=_[_0xf7d1('0x36')](_0x2f40c1[_0xf7d1('0x33')],qs[_0xf7d1('0x37')](_0x39914f['query'][_0xf7d1('0x37')]));_0x11ed40[_0xf7d1('0x35')]=_0x11ed40[_0xf7d1('0x35')]['length']?_0x11ed40[_0xf7d1('0x35')]:_0x2f40c1[_0xf7d1('0x33')];if(!_0x39914f['query'][_0xf7d1('0x38')]('nolimit')){_0x11ed40[_0xf7d1('0x1a')]=qs[_0xf7d1('0x1a')](_0x39914f['query'][_0xf7d1('0x1a')]);_0x11ed40['offset']=qs[_0xf7d1('0x1d')](_0x39914f['query'][_0xf7d1('0x1d')]);}_0x11ed40['order']=qs['sort'](_0x39914f[_0xf7d1('0x34')]['sort']);_0x11ed40['where']=qs[_0xf7d1('0x32')](_[_0xf7d1('0x39')](_0x39914f['query'],_0x2f40c1[_0xf7d1('0x32')]),_0x5c18b4);if(_0x39914f[_0xf7d1('0x34')][_0xf7d1('0x3a')]){_0x11ed40[_0xf7d1('0x3b')]=_[_0xf7d1('0x3c')](_0x11ed40[_0xf7d1('0x3b')],{'$or':_[_0xf7d1('0x2c')](_0x5c18b4,function(_0x9fcff0){if(_0x9fcff0[_0xf7d1('0x30')]!=='VIRTUAL'){var _0x43a589={};_0x43a589[_0x9fcff0['name']]={'$like':'%'+_0x39914f[_0xf7d1('0x34')]['filter']+'%'};return _0x43a589;}})});}_0x11ed40=_['merge']({},_0x11ed40,_0x39914f[_0xf7d1('0x3d')]);var _0x241cf9={'where':_0x11ed40[_0xf7d1('0x3b')]};return db[_0xf7d1('0x2d')][_0xf7d1('0x1c')](_0x241cf9)[_0xf7d1('0x25')](function(_0x4749a4){_0x2034cd[_0xf7d1('0x1c')]=_0x4749a4;if(_0x39914f[_0xf7d1('0x34')][_0xf7d1('0x3e')]){_0x11ed40[_0xf7d1('0x3f')]=[{'all':!![]}];}return db[_0xf7d1('0x2d')][_0xf7d1('0x40')](_0x11ed40);})['then'](function(_0x349690){_0x2034cd[_0xf7d1('0x41')]=_0x349690;return _0x2034cd;})[_0xf7d1('0x25')](respondWithFilteredResult(_0x30e073,_0x11ed40))[_0xf7d1('0x42')](handleError(_0x30e073,null));};exports[_0xf7d1('0x43')]=function(_0x43410c,_0x1128b1){var _0x4f34a8={'raw':!![],'where':{'id':_0x43410c[_0xf7d1('0x44')]['id']}},_0x10602b={};_0x10602b[_0xf7d1('0x33')]=_[_0xf7d1('0x45')](db[_0xf7d1('0x2d')][_0xf7d1('0x2e')]);_0x10602b['query']=_[_0xf7d1('0x45')](_0x43410c[_0xf7d1('0x34')]);_0x10602b['filters']=_[_0xf7d1('0x36')](_0x10602b['model'],_0x10602b['query']);_0x4f34a8['attributes']=_[_0xf7d1('0x36')](_0x10602b[_0xf7d1('0x33')],qs[_0xf7d1('0x37')](_0x43410c[_0xf7d1('0x34')][_0xf7d1('0x37')]));_0x4f34a8[_0xf7d1('0x35')]=_0x4f34a8['attributes'][_0xf7d1('0x46')]?_0x4f34a8[_0xf7d1('0x35')]:_0x10602b[_0xf7d1('0x33')];if(_0x43410c[_0xf7d1('0x34')][_0xf7d1('0x3e')]){_0x4f34a8['include']=[{'all':!![]}];}_0x4f34a8=_[_0xf7d1('0x3c')]({},_0x4f34a8,_0x43410c[_0xf7d1('0x3d')]);return db[_0xf7d1('0x2d')][_0xf7d1('0x47')](_0x4f34a8)['then'](handleEntityNotFound(_0x1128b1,null))['then'](respondWithResult(_0x1128b1,null))[_0xf7d1('0x42')](handleError(_0x1128b1,null));};exports[_0xf7d1('0x48')]=function(_0x55f809,_0x537b44){return db[_0xf7d1('0x2d')]['create'](_0x55f809[_0xf7d1('0x49')],{})[_0xf7d1('0x25')](respondWithResult(_0x537b44,0xc9))[_0xf7d1('0x42')](handleError(_0x537b44,null));};exports[_0xf7d1('0x24')]=function(_0x5db71,_0x3980c4){if(_0x5db71[_0xf7d1('0x49')]['id']){delete _0x5db71[_0xf7d1('0x49')]['id'];}return db[_0xf7d1('0x2d')][_0xf7d1('0x47')]({'where':{'id':_0x5db71[_0xf7d1('0x44')]['id']}})[_0xf7d1('0x25')](handleEntityNotFound(_0x3980c4,null))[_0xf7d1('0x25')](saveUpdates(_0x5db71[_0xf7d1('0x49')],null))[_0xf7d1('0x25')](respondWithResult(_0x3980c4,null))[_0xf7d1('0x42')](handleError(_0x3980c4,null));};exports['destroy']=function(_0x3a7acf,_0x5e53e2){return db[_0xf7d1('0x2d')][_0xf7d1('0x47')]({'where':{'id':_0x3a7acf[_0xf7d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e53e2,null))['then'](removeEntity(_0x5e53e2,null))[_0xf7d1('0x42')](handleError(_0x5e53e2,null));};exports[_0xf7d1('0x4a')]=function(_0x3bd3ba,_0x28b3b5){return db['MailTransferReport'][_0xf7d1('0x4a')]()['then'](respondWithResult(_0x28b3b5,null))[_0xf7d1('0x42')](handleError(_0x28b3b5,null));}; \ No newline at end of file +var _0x2f33=['status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','index','map','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','name','filter','options','MailTransferReport','includeAll','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end'];(function(_0x54d347,_0x1b8cb6){var _0x2e6636=function(_0x575bdf){while(--_0x575bdf){_0x54d347['push'](_0x54d347['shift']());}};_0x2e6636(++_0x1b8cb6);}(_0x2f33,0x102));var _0x32f3=function(_0x46a25e,_0x4e1822){_0x46a25e=_0x46a25e-0x0;var _0x1547c8=_0x2f33[_0x46a25e];return _0x1547c8;};'use strict';var emlformat=require(_0x32f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32f3('0x1'));var jsonpatch=require(_0x32f3('0x2'));var rp=require(_0x32f3('0x3'));var moment=require(_0x32f3('0x4'));var BPromise=require(_0x32f3('0x5'));var Mustache=require(_0x32f3('0x6'));var util=require(_0x32f3('0x7'));var path=require(_0x32f3('0x8'));var sox=require('sox');var csv=require(_0x32f3('0x9'));var ejs=require(_0x32f3('0xa'));var fs=require('fs');var fs_extra=require(_0x32f3('0xb'));var _=require(_0x32f3('0xc'));var squel=require('squel');var crypto=require(_0x32f3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x32f3('0xe'));var toCsv=require(_0x32f3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x32f3('0xf'));var authService=require(_0x32f3('0x10'));var qs=require(_0x32f3('0x11'));var as=require(_0x32f3('0x12'));var hardwareService=require(_0x32f3('0x13'));var logger=require(_0x32f3('0x14'))(_0x32f3('0x15'));var utils=require(_0x32f3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e02d,_0x55c078){_0x55c078=_0x55c078||0xcc;return function(_0x452740){if(_0x452740){return _0x19e02d[_0x32f3('0x18')](_0x55c078);}return _0x19e02d['status'](_0x55c078)[_0x32f3('0x19')]();};}function respondWithResult(_0x5c2b82,_0x4c0c7e){_0x4c0c7e=_0x4c0c7e||0xc8;return function(_0xa5f26c){if(_0xa5f26c){return _0x5c2b82[_0x32f3('0x1a')](_0x4c0c7e)[_0x32f3('0x1b')](_0xa5f26c);}};}function respondWithFilteredResult(_0x3a4cc9,_0x10f169){return function(_0x2e28cb){if(_0x2e28cb){var _0x1934cf=typeof _0x10f169[_0x32f3('0x1c')]===_0x32f3('0x1d')&&typeof _0x10f169[_0x32f3('0x1e')]===_0x32f3('0x1d');var _0x567fcb=_0x2e28cb[_0x32f3('0x1f')];var _0x498adc=_0x1934cf?0x0:_0x10f169['offset'];var _0x2de5f5=_0x1934cf?_0x2e28cb['count']:_0x10f169['offset']+_0x10f169[_0x32f3('0x1e')];var _0x5eb882;if(_0x2de5f5>=_0x567fcb){_0x2de5f5=_0x567fcb;_0x5eb882=0xc8;}else{_0x5eb882=0xce;}_0x3a4cc9['status'](_0x5eb882);return _0x3a4cc9[_0x32f3('0x20')](_0x32f3('0x21'),_0x498adc+'-'+_0x2de5f5+'/'+_0x567fcb)[_0x32f3('0x1b')](_0x2e28cb);}return null;};}function patchUpdates(_0x176958){return function(_0xa3b2f0){try{jsonpatch['apply'](_0xa3b2f0,_0x176958,!![]);}catch(_0x1318fe){return BPromise['reject'](_0x1318fe);}return _0xa3b2f0[_0x32f3('0x22')]();};}function saveUpdates(_0x27c108,_0x309dda){return function(_0x155f08){if(_0x155f08){return _0x155f08[_0x32f3('0x23')](_0x27c108)[_0x32f3('0x24')](function(_0x1ce001){return _0x1ce001;});}return null;};}function removeEntity(_0x19742d,_0x4e4dcd){return function(_0x528c1e){if(_0x528c1e){return _0x528c1e[_0x32f3('0x25')]()[_0x32f3('0x24')](function(){_0x19742d[_0x32f3('0x1a')](0xcc)[_0x32f3('0x19')]();});}};}function handleEntityNotFound(_0x2babb4,_0x52e361){return function(_0x3ae02f){if(!_0x3ae02f){_0x2babb4[_0x32f3('0x18')](0x194);}return _0x3ae02f;};}function handleError(_0x543db0,_0x5b2e1e){_0x5b2e1e=_0x5b2e1e||0x1f4;return function(_0x480475){logger[_0x32f3('0x26')](_0x480475['stack']);if(_0x480475['name']){delete _0x480475['name'];}_0x543db0['status'](_0x5b2e1e)['send'](_0x480475);};}exports[_0x32f3('0x27')]=function(_0x4cca32,_0x4b3b67){var _0x2a3d47={},_0xdc836d={},_0x452fc0={'count':0x0,'rows':[]};var _0x260bd3=_[_0x32f3('0x28')](db['MailTransferReport']['rawAttributes'],function(_0xfaa764){return{'name':_0xfaa764[_0x32f3('0x29')],'type':_0xfaa764['type'][_0x32f3('0x2a')]};});_0xdc836d['model']=_[_0x32f3('0x28')](_0x260bd3,'name');_0xdc836d[_0x32f3('0x2b')]=_[_0x32f3('0x2c')](_0x4cca32[_0x32f3('0x2b')]);_0xdc836d[_0x32f3('0x2d')]=_[_0x32f3('0x2e')](_0xdc836d['model'],_0xdc836d['query']);_0x2a3d47[_0x32f3('0x2f')]=_[_0x32f3('0x2e')](_0xdc836d[_0x32f3('0x30')],qs['fields'](_0x4cca32['query'][_0x32f3('0x31')]));_0x2a3d47['attributes']=_0x2a3d47['attributes'][_0x32f3('0x32')]?_0x2a3d47[_0x32f3('0x2f')]:_0xdc836d['model'];if(!_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x33')](_0x32f3('0x34'))){_0x2a3d47['limit']=qs[_0x32f3('0x1e')](_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x1e')]);_0x2a3d47[_0x32f3('0x1c')]=qs[_0x32f3('0x1c')](_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x1c')]);}_0x2a3d47[_0x32f3('0x35')]=qs[_0x32f3('0x36')](_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x36')]);_0x2a3d47[_0x32f3('0x37')]=qs[_0x32f3('0x2d')](_[_0x32f3('0x38')](_0x4cca32[_0x32f3('0x2b')],_0xdc836d[_0x32f3('0x2d')]),_0x260bd3);if(_0x4cca32[_0x32f3('0x2b')]['filter']){_0x2a3d47[_0x32f3('0x37')]=_['merge'](_0x2a3d47[_0x32f3('0x37')],{'$or':_[_0x32f3('0x28')](_0x260bd3,function(_0x51a56d){if(_0x51a56d['type']!==_0x32f3('0x39')){var _0x190615={};_0x190615[_0x51a56d[_0x32f3('0x3a')]]={'$like':'%'+_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x3b')]+'%'};return _0x190615;}})});}_0x2a3d47=_['merge']({},_0x2a3d47,_0x4cca32[_0x32f3('0x3c')]);var _0x4ed120={'where':_0x2a3d47[_0x32f3('0x37')]};return db[_0x32f3('0x3d')][_0x32f3('0x1f')](_0x4ed120)[_0x32f3('0x24')](function(_0x3869db){_0x452fc0['count']=_0x3869db;if(_0x4cca32[_0x32f3('0x2b')][_0x32f3('0x3e')]){_0x2a3d47['include']=[{'all':!![]}];}return db[_0x32f3('0x3d')][_0x32f3('0x3f')](_0x2a3d47);})[_0x32f3('0x24')](function(_0x2c5008){_0x452fc0['rows']=_0x2c5008;return _0x452fc0;})[_0x32f3('0x24')](respondWithFilteredResult(_0x4b3b67,_0x2a3d47))[_0x32f3('0x40')](handleError(_0x4b3b67,null));};exports[_0x32f3('0x41')]=function(_0x227ab7,_0x327c49){var _0x277814={'raw':!![],'where':{'id':_0x227ab7[_0x32f3('0x42')]['id']}},_0x170239={};_0x170239['model']=_[_0x32f3('0x2c')](db[_0x32f3('0x3d')]['rawAttributes']);_0x170239[_0x32f3('0x2b')]=_[_0x32f3('0x2c')](_0x227ab7[_0x32f3('0x2b')]);_0x170239[_0x32f3('0x2d')]=_[_0x32f3('0x2e')](_0x170239[_0x32f3('0x30')],_0x170239[_0x32f3('0x2b')]);_0x277814[_0x32f3('0x2f')]=_[_0x32f3('0x2e')](_0x170239[_0x32f3('0x30')],qs[_0x32f3('0x31')](_0x227ab7[_0x32f3('0x2b')][_0x32f3('0x31')]));_0x277814[_0x32f3('0x2f')]=_0x277814[_0x32f3('0x2f')][_0x32f3('0x32')]?_0x277814[_0x32f3('0x2f')]:_0x170239[_0x32f3('0x30')];if(_0x227ab7['query'][_0x32f3('0x3e')]){_0x277814['include']=[{'all':!![]}];}_0x277814=_['merge']({},_0x277814,_0x227ab7[_0x32f3('0x3c')]);return db[_0x32f3('0x3d')][_0x32f3('0x43')](_0x277814)[_0x32f3('0x24')](handleEntityNotFound(_0x327c49,null))[_0x32f3('0x24')](respondWithResult(_0x327c49,null))[_0x32f3('0x40')](handleError(_0x327c49,null));};exports[_0x32f3('0x44')]=function(_0x22fb92,_0x193ed2){return db['MailTransferReport'][_0x32f3('0x44')](_0x22fb92[_0x32f3('0x45')],{})[_0x32f3('0x24')](respondWithResult(_0x193ed2,0xc9))[_0x32f3('0x40')](handleError(_0x193ed2,null));};exports[_0x32f3('0x23')]=function(_0x35203c,_0x47311f){if(_0x35203c[_0x32f3('0x45')]['id']){delete _0x35203c[_0x32f3('0x45')]['id'];}return db[_0x32f3('0x3d')][_0x32f3('0x43')]({'where':{'id':_0x35203c['params']['id']}})[_0x32f3('0x24')](handleEntityNotFound(_0x47311f,null))['then'](saveUpdates(_0x35203c[_0x32f3('0x45')],null))['then'](respondWithResult(_0x47311f,null))[_0x32f3('0x40')](handleError(_0x47311f,null));};exports['destroy']=function(_0xfae4b6,_0x4cd49d){return db[_0x32f3('0x3d')][_0x32f3('0x43')]({'where':{'id':_0xfae4b6['params']['id']}})[_0x32f3('0x24')](handleEntityNotFound(_0x4cd49d,null))[_0x32f3('0x24')](removeEntity(_0x4cd49d,null))[_0x32f3('0x40')](handleError(_0x4cd49d,null));};exports[_0x32f3('0x46')]=function(_0xf6e1e4,_0x265ec7){return db['MailTransferReport'][_0x32f3('0x46')]()[_0x32f3('0x24')](respondWithResult(_0x265ec7,null))[_0x32f3('0x40')](handleError(_0x265ec7,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5da1f3d..5ae77b2 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 _0x4f16=['uniqueid','lodash','util','../../config/logger','request-promise','path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer'];(function(_0x56ff59,_0x429581){var _0x39f094=function(_0x31f87b){while(--_0x31f87b){_0x56ff59['push'](_0x56ff59['shift']());}};_0x39f094(++_0x429581);}(_0x4f16,0x11f));var _0x64f1=function(_0x5e4f42,_0x296563){_0x5e4f42=_0x5e4f42-0x0;var _0x24a54e=_0x4f16[_0x5e4f42];return _0x24a54e;};'use strict';var _=require(_0x64f1('0x0'));var util=require(_0x64f1('0x1'));var logger=require(_0x64f1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64f1('0x3'));var fs=require('fs');var path=require(_0x64f1('0x4'));var rimraf=require('rimraf');var config=require(_0x64f1('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0x64f1('0x6')]=function(_0x1ff13e,_0x464433){return _0x1ff13e[_0x64f1('0x7')](_0x64f1('0x8'),attributes,{'tableName':_0x64f1('0x9'),'paranoid':![],'indexes':[{'name':_0x64f1('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4849=['path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x4849,0x86));var _0x9484=function(_0xbb1868,_0x19ea4a){_0xbb1868=_0xbb1868-0x0;var _0x1d0a70=_0x4849[_0xbb1868];return _0x1d0a70;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var logger=require('../../config/logger')(_0x9484('0x2'));var moment=require(_0x9484('0x3'));var BPromise=require(_0x9484('0x4'));var rp=require(_0x9484('0x5'));var fs=require('fs');var path=require(_0x9484('0x6'));var rimraf=require(_0x9484('0x7'));var config=require(_0x9484('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x9484('0x9')]=function(_0x1b6819,_0x4d8ab1){return _0x1b6819[_0x9484('0xa')](_0x9484('0xb'),attributes,{'tableName':_0x9484('0xc'),'paranoid':![],'indexes':[{'name':_0x9484('0xd'),'fields':[_0x9484('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 5d564da..e1489e7 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 _0x7b90=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7b90,0x175));var _0x07b9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b90[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x07b9('0x0'));var moment=require(_0x07b9('0x1'));var BPromise=require(_0x07b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07b9('0x3'));var db=require(_0x07b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x07b9('0x5'))(_0x07b9('0x6'));var config=require(_0x07b9('0x7'));var jayson=require(_0x07b9('0x8'));var client=jayson[_0x07b9('0x9')][_0x07b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57cb3d,_0x4dac0d,_0x46ef5e){return new BPromise(function(_0x20d0d2,_0x371cb5){return client[_0x07b9('0xb')](_0x57cb3d,_0x46ef5e)[_0x07b9('0xc')](function(_0x186c3c){logger[_0x07b9('0xd')](_0x07b9('0xe'),_0x4dac0d,_0x07b9('0xf'));logger[_0x07b9('0x10')](_0x07b9('0x11'),_0x4dac0d,'request\x20sent',JSON[_0x07b9('0x12')](_0x186c3c));if(_0x186c3c[_0x07b9('0x13')]){if(_0x186c3c[_0x07b9('0x13')]['code']===0x1f4){logger[_0x07b9('0x13')](_0x07b9('0xe'),_0x4dac0d,_0x186c3c['error']['message']);return _0x371cb5(_0x186c3c['error'][_0x07b9('0x14')]);}logger['error'](_0x07b9('0xe'),_0x4dac0d,_0x186c3c[_0x07b9('0x13')][_0x07b9('0x14')]);return _0x20d0d2(_0x186c3c[_0x07b9('0x13')][_0x07b9('0x14')]);}else{logger[_0x07b9('0xd')](_0x07b9('0xe'),_0x4dac0d,_0x07b9('0xf'));_0x20d0d2(_0x186c3c[_0x07b9('0x15')]['message']);}})[_0x07b9('0x16')](function(_0x11e894){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4dac0d,_0x11e894);_0x371cb5(_0x11e894);});});} \ No newline at end of file +var _0xf3dd=['rpc','../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xf34f78,_0x206922){var _0x5ea8b4=function(_0x2cb254){while(--_0x2cb254){_0xf34f78['push'](_0xf34f78['shift']());}};_0x5ea8b4(++_0x206922);}(_0xf3dd,0x92));var _0xdf3d=function(_0x4d1d3b,_0x358031){_0x4d1d3b=_0x4d1d3b-0x0;var _0x473905=_0xf3dd[_0x4d1d3b];return _0x473905;};'use strict';var _=require(_0xdf3d('0x0'));var util=require(_0xdf3d('0x1'));var moment=require(_0xdf3d('0x2'));var BPromise=require(_0xdf3d('0x3'));var rs=require(_0xdf3d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdf3d('0x6'));var config=require(_0xdf3d('0x7'));var jayson=require(_0xdf3d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1070ec,_0x5026a0,_0x183192){return new BPromise(function(_0x1fc27b,_0x43cd94){return client[_0xdf3d('0x9')](_0x1070ec,_0x183192)[_0xdf3d('0xa')](function(_0x18d8b3){logger[_0xdf3d('0xb')](_0xdf3d('0xc'),_0x5026a0,_0xdf3d('0xd'));logger['debug'](_0xdf3d('0xe'),_0x5026a0,'request\x20sent',JSON[_0xdf3d('0xf')](_0x18d8b3));if(_0x18d8b3['error']){if(_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x11')]===0x1f4){logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x18d8b3['error']['message']);return _0x43cd94(_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x12')]);}logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x18d8b3[_0xdf3d('0x10')][_0xdf3d('0x12')]);return _0x1fc27b(_0x18d8b3[_0xdf3d('0x10')]['message']);}else{logger[_0xdf3d('0xb')](_0xdf3d('0xc'),_0x5026a0,_0xdf3d('0xd'));_0x1fc27b(_0x18d8b3['result']['message']);}})['catch'](function(_0x2fc0ec){logger[_0xdf3d('0x10')](_0xdf3d('0xc'),_0x5026a0,_0x2fc0ec);_0x43cd94(_0x2fc0ec);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cbe4f09..3939a9c 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 _0xab6a=['/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','post','create','put'];(function(_0x111fb2,_0xbf8de7){var _0x1dc344=function(_0x24b87b){while(--_0x24b87b){_0x111fb2['push'](_0x111fb2['shift']());}};_0x1dc344(++_0xbf8de7);}(_0xab6a,0xd0));var _0xaab6=function(_0x192830,_0x44ba6f){_0x192830=_0x192830-0x0;var _0x4b4689=_0xab6a[_0x192830];return _0x4b4689;};'use strict';var multer=require('multer');var util=require(_0xaab6('0x0'));var path=require(_0xaab6('0x1'));var timeout=require(_0xaab6('0x2'));var express=require(_0xaab6('0x3'));var router=express[_0xaab6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaab6('0x5'));var interaction=require(_0xaab6('0x6'));var config=require('../../config/environment');var controller=require(_0xaab6('0x7'));router[_0xaab6('0x8')]('/',auth[_0xaab6('0x9')](),controller['index']);router[_0xaab6('0x8')]('/describe',auth[_0xaab6('0x9')](),controller['describe']);router['get']('/:id',auth[_0xaab6('0x9')](),controller['show']);router[_0xaab6('0xa')]('/',auth[_0xaab6('0x9')](),controller[_0xaab6('0xb')]);router[_0xaab6('0xc')](_0xaab6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaab6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xaab6('0xf')]);module[_0xaab6('0x10')]=router; \ No newline at end of file +var _0x74d5=['/:id','show','post','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','describe'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x74d5,0x8b));var _0x574d=function(_0x1a3c28,_0x4d892e){_0x1a3c28=_0x1a3c28-0x0;var _0x259952=_0x74d5[_0x1a3c28];return _0x259952;};'use strict';var multer=require(_0x574d('0x0'));var util=require(_0x574d('0x1'));var path=require(_0x574d('0x2'));var timeout=require('connect-timeout');var express=require(_0x574d('0x3'));var router=express[_0x574d('0x4')]();var fs_extra=require(_0x574d('0x5'));var auth=require(_0x574d('0x6'));var interaction=require(_0x574d('0x7'));var config=require('../../config/environment');var controller=require(_0x574d('0x8'));router['get']('/',auth[_0x574d('0x9')](),controller[_0x574d('0xa')]);router[_0x574d('0xb')]('/describe',auth[_0x574d('0x9')](),controller[_0x574d('0xc')]);router[_0x574d('0xb')](_0x574d('0xd'),auth[_0x574d('0x9')](),controller[_0x574d('0xe')]);router[_0x574d('0xf')]('/',auth[_0x574d('0x9')](),controller['create']);router['put'](_0x574d('0xd'),auth[_0x574d('0x9')](),controller[_0x574d('0x10')]);router[_0x574d('0x11')](_0x574d('0xd'),auth[_0x574d('0x9')](),controller['destroy']);module[_0x574d('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c62c026..ab38798 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 _0x20e5=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x20e5,0xbb));var _0x520e=function(_0x1cf2b0,_0x3be4e0){_0x1cf2b0=_0x1cf2b0-0x0;var _0x4e849b=_0x20e5[_0x1cf2b0];return _0x4e849b;};'use strict';var Sequelize=require(_0x520e('0x0'));var moment=require('moment');module[_0x520e('0x1')]={'channel':{'type':Sequelize[_0x520e('0x2')]},'membername':{'type':Sequelize[_0x520e('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x520e('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x520e('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x520e('0x4')]},'exitAt':{'type':Sequelize[_0x520e('0x4')],'set':function(_0x225dcf){var _0x4d5d66=moment(_0x225dcf);var _0x3e66e6=moment(this[_0x520e('0x5')](_0x520e('0x6')));var _0x160309=_0x4d5d66[_0x520e('0x7')](_0x3e66e6,_0x520e('0x8'));this[_0x520e('0x9')](_0x520e('0xa'),_0x225dcf);this[_0x520e('0x9')]('duration',_0x160309>=0x0?_0x160309:null);}},'data1':{'type':Sequelize[_0x520e('0x2')],'comment':_0x520e('0xb')},'data2':{'type':Sequelize[_0x520e('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x520e('0x2')],'comment':_0x520e('0xc')},'data4':{'type':Sequelize[_0x520e('0x2')],'comment':_0x520e('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x520e('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x520e('0xf')]},'uniqueid':{'type':Sequelize[_0x520e('0x2')]}}; \ No newline at end of file +var _0x714e=['getDataValue','enterAt','diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x3219cc,_0x50a602){var _0x480c96=function(_0x3c3bf2){while(--_0x3c3bf2){_0x3219cc['push'](_0x3219cc['shift']());}};_0x480c96(++_0x50a602);}(_0x714e,0xcc));var _0xe714=function(_0x568427,_0x742280){_0x568427=_0x568427-0x0;var _0x3c2f86=_0x714e[_0x568427];return _0x3c2f86;};'use strict';var Sequelize=require(_0xe714('0x0'));var moment=require('moment');module[_0xe714('0x1')]={'channel':{'type':Sequelize[_0xe714('0x2')]},'membername':{'type':Sequelize[_0xe714('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe714('0x2')],'defaultValue':_0xe714('0x3'),'comment':_0xe714('0x4')},'duration':{'type':Sequelize[_0xe714('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x44eeba){var _0x24c5b0=moment(_0x44eeba);var _0x54be19=moment(this[_0xe714('0x6')](_0xe714('0x7')));var _0x564be3=_0x24c5b0[_0xe714('0x8')](_0x54be19,'seconds');this['setDataValue']('exitAt',_0x44eeba);this[_0xe714('0x9')](_0xe714('0xa'),_0x564be3>=0x0?_0x564be3:null);}},'data1':{'type':Sequelize[_0xe714('0x2')],'comment':_0xe714('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xe714('0xc')},'data3':{'type':Sequelize[_0xe714('0x2')],'comment':_0xe714('0xd')},'data4':{'type':Sequelize[_0xe714('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xe714('0x2')],'comment':_0xe714('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xe714('0x5')]},'uniqueid':{'type':Sequelize[_0xe714('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 4f87a82..8e57f15 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 _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(_0x13a8b9,_0xd4f9a5){var _0x3e27a1=function(_0x9754d3){while(--_0x9754d3){_0x13a8b9['push'](_0x13a8b9['shift']());}};_0x3e27a1(++_0xd4f9a5);}(_0x008c,0x188));var _0xc008=function(_0x42e013,_0x4e1584){_0x42e013=_0x42e013-0x0;var _0x3e951b=_0x008c[_0x42e013];return _0x3e951b;};'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 +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x34e8,0x12c));var _0x834e=function(_0x341f00,_0x5658f5){_0x341f00=_0x341f00-0x0;var _0x4b3f3d=_0x34e8[_0x341f00];return _0x4b3f3d;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index fb90e3e..8ee7e5c 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 _0x8e0c=['rimraf','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','lodash','../../config/logger','api','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8e0c,0xe5));var _0xc8e0=function(_0x56f68c,_0x3925c3){_0x56f68c=_0x56f68c-0x0;var _0x45a06e=_0x8e0c[_0x56f68c];return _0x45a06e;};'use strict';var _=require(_0xc8e0('0x0'));var util=require('util');var logger=require(_0xc8e0('0x1'))(_0xc8e0('0x2'));var moment=require('moment');var BPromise=require(_0xc8e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8e0('0x4'));var rimraf=require(_0xc8e0('0x5'));var config=require('../../config/environment');var attributes=require(_0xc8e0('0x6'));module[_0xc8e0('0x7')]=function(_0x466d3e,_0x4a3884){return _0x466d3e[_0xc8e0('0x8')](_0xc8e0('0x9'),attributes,{'tableName':_0xc8e0('0xa'),'paranoid':![],'indexes':[{'name':_0xc8e0('0xb'),'fields':[_0xc8e0('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x04f9=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername','interface','util','../../config/logger','api'];(function(_0x5f4488,_0x3e5788){var _0x5141cb=function(_0x4f2a13){while(--_0x4f2a13){_0x5f4488['push'](_0x5f4488['shift']());}};_0x5141cb(++_0x3e5788);}(_0x04f9,0xb3));var _0x904f=function(_0x27a381,_0x4780aa){_0x27a381=_0x27a381-0x0;var _0x42f82c=_0x04f9[_0x27a381];return _0x42f82c;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var logger=require(_0x904f('0x1'))(_0x904f('0x2'));var moment=require('moment');var BPromise=require(_0x904f('0x3'));var rp=require(_0x904f('0x4'));var fs=require('fs');var path=require(_0x904f('0x5'));var rimraf=require(_0x904f('0x6'));var config=require(_0x904f('0x7'));var attributes=require(_0x904f('0x8'));module['exports']=function(_0x4e5a0c,_0x2bcb2a){return _0x4e5a0c[_0x904f('0x9')](_0x904f('0xa'),attributes,{'tableName':_0x904f('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x904f('0xc'),_0x904f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 732e769..6b472ae 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 _0x9c50=['../../config/logger','rpc','jayson/promise','http','request','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','map','include','model','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','bluebird','ioredis'];(function(_0x579f0e,_0x565082){var _0x14fbfa=function(_0x4545b7){while(--_0x4545b7){_0x579f0e['push'](_0x579f0e['shift']());}};_0x14fbfa(++_0x565082);}(_0x9c50,0xec));var _0x09c5=function(_0x4e2215,_0x1c4a2e){_0x4e2215=_0x4e2215-0x0;var _0x5b62aa=_0x9c50[_0x4e2215];return _0x5b62aa;};'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')]('MemberReport,\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')]('MemberReport,\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);});});}exports[_0x09c5('0x12')]=function(_0x1040b1){var _0x3207f2=this;return new Promise(function(_0x38e59e,_0x436db2){return db['MemberReport'][_0x09c5('0x13')]({'raw':_0x1040b1[_0x09c5('0x14')]?_0x1040b1[_0x09c5('0x14')][_0x09c5('0x15')]===undefined?!![]:![]:!![],'where':_0x1040b1[_0x09c5('0x14')]?_0x1040b1['options'][_0x09c5('0x16')]||null:null,'attributes':_0x1040b1[_0x09c5('0x14')]?_0x1040b1[_0x09c5('0x14')][_0x09c5('0x17')]||null:null,'limit':_0x1040b1['options']?_0x1040b1['options'][_0x09c5('0x18')]||null:null,'include':_0x1040b1[_0x09c5('0x14')]?_0x1040b1[_0x09c5('0x14')]['include']?_[_0x09c5('0x19')](_0x1040b1[_0x09c5('0x14')][_0x09c5('0x1a')],function(_0x365e6d){return{'model':db[_0x365e6d['model']],'as':_0x365e6d['as'],'attributes':_0x365e6d[_0x09c5('0x17')],'include':_0x365e6d['include']?_[_0x09c5('0x19')](_0x365e6d[_0x09c5('0x1a')],function(_0x356001){return{'model':db[_0x356001[_0x09c5('0x1b')]],'as':_0x356001['as'],'attributes':_0x356001['attributes'],'include':_0x356001[_0x09c5('0x1a')]?_[_0x09c5('0x19')](_0x356001[_0x09c5('0x1a')],function(_0x4f991b){return{'model':db[_0x4f991b[_0x09c5('0x1b')]],'as':_0x4f991b['as'],'attributes':_0x4f991b[_0x09c5('0x17')]};}):[]};}):[]};}):[]:[]})[_0x09c5('0x7')](function(_0x416881){logger[_0x09c5('0x8')](_0x09c5('0x12'),_0x1040b1);logger[_0x09c5('0x9')]('GetMemberReport',_0x1040b1,JSON['stringify'](_0x416881));_0x38e59e(_0x416881);})[_0x09c5('0x11')](function(_0x51cd04){logger[_0x09c5('0xd')](_0x09c5('0x12'),_0x51cd04['message'],_0x1040b1);_0x436db2(_0x3207f2['error'](0x1f4,_0x51cd04[_0x09c5('0x10')]));});});};exports['CreateMemberReport']=function(_0x33ab28){var _0x172fc0=this;return new Promise(function(_0x3c67ba,_0x52904f){return db[_0x09c5('0x1c')][_0x09c5('0x1d')](_0x33ab28[_0x09c5('0x1e')],{'raw':_0x33ab28['options']?_0x33ab28['options'][_0x09c5('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x25f710){logger[_0x09c5('0x8')](_0x09c5('0x1f'),_0x33ab28);logger[_0x09c5('0x9')](_0x09c5('0x1f'),_0x33ab28,JSON[_0x09c5('0xc')](_0x25f710));_0x3c67ba(_0x25f710);})['catch'](function(_0x59fb3c){logger[_0x09c5('0xd')](_0x09c5('0x1f'),_0x59fb3c[_0x09c5('0x10')],_0x33ab28);_0x52904f(_0x172fc0['error'](0x1f4,_0x59fb3c[_0x09c5('0x10')]));});});};exports[_0x09c5('0x20')]=function(_0x15f778){var _0x1c2f0b=this;return new Promise(function(_0x395e7e,_0x31321d){return db[_0x09c5('0x1c')][_0x09c5('0x21')](_0x15f778[_0x09c5('0x1e')],{'raw':_0x15f778[_0x09c5('0x14')]?_0x15f778[_0x09c5('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15f778[_0x09c5('0x14')]?_0x15f778[_0x09c5('0x14')][_0x09c5('0x16')]||null:null,'attributes':_0x15f778[_0x09c5('0x14')]?_0x15f778['options'][_0x09c5('0x17')]||null:null,'limit':_0x15f778[_0x09c5('0x14')]?_0x15f778[_0x09c5('0x14')]['limit']||null:null})[_0x09c5('0x7')](function(_0x8bd105){logger[_0x09c5('0x8')](_0x09c5('0x20'),_0x15f778);logger[_0x09c5('0x9')](_0x09c5('0x20'),_0x15f778,JSON[_0x09c5('0xc')](_0x8bd105));_0x395e7e(_0x8bd105);})[_0x09c5('0x11')](function(_0x5d3117){logger[_0x09c5('0xd')](_0x09c5('0x20'),_0x5d3117[_0x09c5('0x10')],_0x15f778);_0x31321d(_0x1c2f0b[_0x09c5('0xd')](0x1f4,_0x5d3117['message']));});});}; \ No newline at end of file +var _0x6c14=['findAll','raw','where','options','attributes','limit','include','map','model','catch','create','CreateMemberReport','UpdateMemberReport','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','MemberReport'];(function(_0x302d79,_0x4df472){var _0xa7c5b8=function(_0x753c08){while(--_0x753c08){_0x302d79['push'](_0x302d79['shift']());}};_0xa7c5b8(++_0x4df472);}(_0x6c14,0xd1));var _0x46c1=function(_0x360122,_0x3d1b8c){_0x360122=_0x360122-0x0;var _0x431219=_0x6c14[_0x360122];return _0x431219;};'use strict';var _=require(_0x46c1('0x0'));var util=require(_0x46c1('0x1'));var moment=require(_0x46c1('0x2'));var BPromise=require(_0x46c1('0x3'));var rs=require(_0x46c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c1('0x5'))['db'];var utils=require(_0x46c1('0x6'));var logger=require(_0x46c1('0x7'))('rpc');var config=require(_0x46c1('0x8'));var jayson=require(_0x46c1('0x9'));var client=jayson[_0x46c1('0xa')][_0x46c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29b2d8,_0x10b22d,_0xfaf798){return new BPromise(function(_0x1277f7,_0x2997e1){return client['request'](_0x29b2d8,_0xfaf798)[_0x46c1('0xc')](function(_0x5f5b75){logger[_0x46c1('0xd')]('MemberReport,\x20%s,\x20%s',_0x10b22d,_0x46c1('0xe'));logger[_0x46c1('0xf')](_0x46c1('0x10'),_0x10b22d,'request\x20sent',JSON[_0x46c1('0x11')](_0x5f5b75));if(_0x5f5b75[_0x46c1('0x12')]){if(_0x5f5b75[_0x46c1('0x12')][_0x46c1('0x13')]===0x1f4){logger['error'](_0x46c1('0x14'),_0x10b22d,_0x5f5b75[_0x46c1('0x12')]['message']);return _0x2997e1(_0x5f5b75['error'][_0x46c1('0x15')]);}logger[_0x46c1('0x12')](_0x46c1('0x14'),_0x10b22d,_0x5f5b75[_0x46c1('0x12')][_0x46c1('0x15')]);return _0x1277f7(_0x5f5b75['error'][_0x46c1('0x15')]);}else{logger[_0x46c1('0xd')](_0x46c1('0x14'),_0x10b22d,_0x46c1('0xe'));_0x1277f7(_0x5f5b75[_0x46c1('0x16')]['message']);}})['catch'](function(_0x23e912){logger[_0x46c1('0x12')](_0x46c1('0x14'),_0x10b22d,_0x23e912);_0x2997e1(_0x23e912);});});}exports[_0x46c1('0x17')]=function(_0x466899){var _0xae104a=this;return new Promise(function(_0x2ec920,_0x4c42b8){return db[_0x46c1('0x18')][_0x46c1('0x19')]({'raw':_0x466899['options']?_0x466899['options'][_0x46c1('0x1a')]===undefined?!![]:![]:!![],'where':_0x466899['options']?_0x466899['options'][_0x46c1('0x1b')]||null:null,'attributes':_0x466899[_0x46c1('0x1c')]?_0x466899[_0x46c1('0x1c')][_0x46c1('0x1d')]||null:null,'limit':_0x466899[_0x46c1('0x1c')]?_0x466899[_0x46c1('0x1c')][_0x46c1('0x1e')]||null:null,'include':_0x466899[_0x46c1('0x1c')]?_0x466899[_0x46c1('0x1c')][_0x46c1('0x1f')]?_[_0x46c1('0x20')](_0x466899[_0x46c1('0x1c')][_0x46c1('0x1f')],function(_0x712eb8){return{'model':db[_0x712eb8[_0x46c1('0x21')]],'as':_0x712eb8['as'],'attributes':_0x712eb8[_0x46c1('0x1d')],'include':_0x712eb8[_0x46c1('0x1f')]?_[_0x46c1('0x20')](_0x712eb8[_0x46c1('0x1f')],function(_0x361c66){return{'model':db[_0x361c66[_0x46c1('0x21')]],'as':_0x361c66['as'],'attributes':_0x361c66[_0x46c1('0x1d')],'include':_0x361c66[_0x46c1('0x1f')]?_['map'](_0x361c66['include'],function(_0xa8b66e){return{'model':db[_0xa8b66e[_0x46c1('0x21')]],'as':_0xa8b66e['as'],'attributes':_0xa8b66e['attributes']};}):[]};}):[]};}):[]:[]})[_0x46c1('0xc')](function(_0xe710e8){logger[_0x46c1('0xd')](_0x46c1('0x17'),_0x466899);logger[_0x46c1('0xf')](_0x46c1('0x17'),_0x466899,JSON['stringify'](_0xe710e8));_0x2ec920(_0xe710e8);})[_0x46c1('0x22')](function(_0x4475f7){logger[_0x46c1('0x12')](_0x46c1('0x17'),_0x4475f7[_0x46c1('0x15')],_0x466899);_0x4c42b8(_0xae104a[_0x46c1('0x12')](0x1f4,_0x4475f7[_0x46c1('0x15')]));});});};exports['CreateMemberReport']=function(_0xb33e57){var _0x5448f4=this;return new Promise(function(_0x18072d,_0x1a3c5a){return db[_0x46c1('0x18')][_0x46c1('0x23')](_0xb33e57['body'],{'raw':_0xb33e57['options']?_0xb33e57[_0x46c1('0x1c')][_0x46c1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x666a49){logger[_0x46c1('0xd')](_0x46c1('0x24'),_0xb33e57);logger[_0x46c1('0xf')]('CreateMemberReport',_0xb33e57,JSON[_0x46c1('0x11')](_0x666a49));_0x18072d(_0x666a49);})[_0x46c1('0x22')](function(_0x5d5074){logger[_0x46c1('0x12')]('CreateMemberReport',_0x5d5074[_0x46c1('0x15')],_0xb33e57);_0x1a3c5a(_0x5448f4[_0x46c1('0x12')](0x1f4,_0x5d5074[_0x46c1('0x15')]));});});};exports[_0x46c1('0x25')]=function(_0x2a7212){var _0xccf843=this;return new Promise(function(_0x4e2b14,_0x50e68c){return db[_0x46c1('0x18')]['update'](_0x2a7212[_0x46c1('0x26')],{'raw':_0x2a7212['options']?_0x2a7212['options'][_0x46c1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a7212[_0x46c1('0x1c')]?_0x2a7212[_0x46c1('0x1c')]['where']||null:null,'attributes':_0x2a7212[_0x46c1('0x1c')]?_0x2a7212[_0x46c1('0x1c')][_0x46c1('0x1d')]||null:null,'limit':_0x2a7212['options']?_0x2a7212[_0x46c1('0x1c')][_0x46c1('0x1e')]||null:null})[_0x46c1('0xc')](function(_0x20f23d){logger[_0x46c1('0xd')](_0x46c1('0x25'),_0x2a7212);logger[_0x46c1('0xf')](_0x46c1('0x25'),_0x2a7212,JSON[_0x46c1('0x11')](_0x20f23d));_0x4e2b14(_0x20f23d);})['catch'](function(_0xcb59ca){logger[_0x46c1('0x12')](_0x46c1('0x25'),_0xcb59ca[_0x46c1('0x15')],_0x2a7212);_0x50e68c(_0xccf843[_0x46c1('0x12')](0x1f4,_0xcb59ca[_0x46c1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 8984b48..b618da2 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 _0x71f8=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x499b15,_0x5b8630){var _0x4f8495=function(_0x349f98){while(--_0x349f98){_0x499b15['push'](_0x499b15['shift']());}};_0x4f8495(++_0x5b8630);}(_0x71f8,0x1ae));var _0x871f=function(_0x3e9e11,_0x4be033){_0x3e9e11=_0x3e9e11-0x0;var _0x27cae1=_0x71f8[_0x3e9e11];return _0x27cae1;};'use strict';var multer=require(_0x871f('0x0'));var util=require(_0x871f('0x1'));var path=require(_0x871f('0x2'));var timeout=require('connect-timeout');var express=require(_0x871f('0x3'));var router=express[_0x871f('0x4')]();var fs_extra=require(_0x871f('0x5'));var auth=require(_0x871f('0x6'));var interaction=require(_0x871f('0x7'));var config=require(_0x871f('0x8'));var controller=require(_0x871f('0x9'));router[_0x871f('0xa')]('/',controller[_0x871f('0xb')]);module[_0x871f('0xc')]=router; \ No newline at end of file +var _0x2202=['index','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./migration.controller'];(function(_0x489f9d,_0x564461){var _0x4a0050=function(_0x4bf35c){while(--_0x4bf35c){_0x489f9d['push'](_0x489f9d['shift']());}};_0x4a0050(++_0x564461);}(_0x2202,0xab));var _0x2220=function(_0x51d32c,_0x18c817){_0x51d32c=_0x51d32c-0x0;var _0x58be79=_0x2202[_0x51d32c];return _0x58be79;};'use strict';var multer=require(_0x2220('0x0'));var util=require(_0x2220('0x1'));var path=require(_0x2220('0x2'));var timeout=require(_0x2220('0x3'));var express=require(_0x2220('0x4'));var router=express[_0x2220('0x5')]();var fs_extra=require(_0x2220('0x6'));var auth=require(_0x2220('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2220('0x8'));router['get']('/',controller[_0x2220('0x9')]);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 a3fb8e6..99afda2 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 _0x8600=['exports','STRING','version','sequelize'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8600,0x13b));var _0x0860=function(_0x4af0a7,_0x49afdd){_0x4af0a7=_0x4af0a7-0x0;var _0x2d7cc9=_0x8600[_0x4af0a7];return _0x2d7cc9;};'use strict';var Sequelize=require(_0x0860('0x0'));module[_0x0860('0x1')]={'version':{'type':Sequelize[_0x0860('0x2')],'unique':_0x0860('0x3')}}; \ No newline at end of file +var _0x05dc=['version','exports','STRING'];(function(_0x13134f,_0xffe6f2){var _0x160f40=function(_0x5e0b9e){while(--_0x5e0b9e){_0x13134f['push'](_0x13134f['shift']());}};_0x160f40(++_0xffe6f2);}(_0x05dc,0x127));var _0xc05d=function(_0x49a456,_0x76c6d6){_0x49a456=_0x49a456-0x0;var _0x5818aa=_0x05dc[_0x49a456];return _0x5818aa;};'use strict';var Sequelize=require('sequelize');module[_0xc05d('0x0')]={'version':{'type':Sequelize[_0xc05d('0x1')],'unique':_0xc05d('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9e5bee5..6a1084b 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 _0x280b=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','sendStatus','error','name','index','Migration','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x371088,_0x32abf1){var _0xa60179=function(_0x1e4bf6){while(--_0x1e4bf6){_0x371088['push'](_0x371088['shift']());}};_0xa60179(++_0x32abf1);}(_0x280b,0xc0));var _0xb280=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x280b[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xb280('0x0'));var rimraf=require(_0xb280('0x1'));var zipdir=require(_0xb280('0x2'));var jsonpatch=require(_0xb280('0x3'));var rp=require(_0xb280('0x4'));var moment=require(_0xb280('0x5'));var BPromise=require(_0xb280('0x6'));var Mustache=require(_0xb280('0x7'));var util=require(_0xb280('0x8'));var path=require(_0xb280('0x9'));var sox=require(_0xb280('0xa'));var csv=require('to-csv');var ejs=require(_0xb280('0xb'));var fs=require('fs');var fs_extra=require(_0xb280('0xc'));var _=require(_0xb280('0xd'));var squel=require(_0xb280('0xe'));var crypto=require(_0xb280('0xf'));var jsforce=require(_0xb280('0x10'));var deskjs=require(_0xb280('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb280('0x12'));var Redis=require(_0xb280('0x13'));var authService=require(_0xb280('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb280('0x15'));var hardwareService=require(_0xb280('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb280('0x17'));var config=require(_0xb280('0x18'));var licenseUtil=require(_0xb280('0x19'));var db=require(_0xb280('0x1a'))['db'];function respondWithStatusCode(_0x4891ca,_0x317758){_0x317758=_0x317758||0xcc;return function(_0x531ebc){if(_0x531ebc){return _0x4891ca['sendStatus'](_0x317758);}return _0x4891ca[_0xb280('0x1b')](_0x317758)[_0xb280('0x1c')]();};}function respondWithResult(_0x56907e,_0x586daf){_0x586daf=_0x586daf||0xc8;return function(_0x29adce){if(_0x29adce){return _0x56907e[_0xb280('0x1b')](_0x586daf)[_0xb280('0x1d')](_0x29adce);}};}function respondWithFilteredResult(_0x3e7043,_0x395523){return function(_0x4c33ff){if(_0x4c33ff){var _0x5f41e8=typeof _0x395523[_0xb280('0x1e')]===_0xb280('0x1f')&&typeof _0x395523[_0xb280('0x20')]===_0xb280('0x1f');var _0x3b0712=_0x4c33ff[_0xb280('0x21')];var _0x127f1c=_0x5f41e8?0x0:_0x395523[_0xb280('0x1e')];var _0x4d9603=_0x5f41e8?_0x4c33ff[_0xb280('0x21')]:_0x395523[_0xb280('0x1e')]+_0x395523[_0xb280('0x20')];var _0x58059a;if(_0x4d9603>=_0x3b0712){_0x4d9603=_0x3b0712;_0x58059a=0xc8;}else{_0x58059a=0xce;}_0x3e7043[_0xb280('0x1b')](_0x58059a);return _0x3e7043[_0xb280('0x22')]('Content-Range',_0x127f1c+'-'+_0x4d9603+'/'+_0x3b0712)[_0xb280('0x1d')](_0x4c33ff);}return null;};}function patchUpdates(_0x3aa973){return function(_0x403b47){try{jsonpatch[_0xb280('0x23')](_0x403b47,_0x3aa973,!![]);}catch(_0x5c52a3){return BPromise[_0xb280('0x24')](_0x5c52a3);}return _0x403b47[_0xb280('0x25')]();};}function saveUpdates(_0x5df8aa,_0xd31f70){return function(_0x23bf0a){if(_0x23bf0a){return _0x23bf0a[_0xb280('0x26')](_0x5df8aa)['then'](function(_0x6f8853){return _0x6f8853;});}return null;};}function removeEntity(_0x2f6fe6,_0x584b2b){return function(_0x1fcfbb){if(_0x1fcfbb){return _0x1fcfbb[_0xb280('0x27')]()['then'](function(){_0x2f6fe6[_0xb280('0x1b')](0xcc)[_0xb280('0x1c')]();});}};}function handleEntityNotFound(_0x389dfe,_0x36f5ee){return function(_0x5f1517){if(!_0x5f1517){_0x389dfe[_0xb280('0x28')](0x194);}return _0x5f1517;};}function handleError(_0x3f5a4a,_0x19250f){_0x19250f=_0x19250f||0x1f4;return function(_0x400d15){logger[_0xb280('0x29')](_0x400d15['stack']);if(_0x400d15['name']){delete _0x400d15[_0xb280('0x2a')];}_0x3f5a4a[_0xb280('0x1b')](_0x19250f)['send'](_0x400d15);};}exports[_0xb280('0x2b')]=function(_0x3aa2ad,_0x4b16d5){var _0x21f3d6={},_0x48246e={},_0x1a96af={'count':0x0,'rows':[]};var _0x590365=_['map'](db[_0xb280('0x2c')][_0xb280('0x2d')],function(_0x1354dd){return{'name':_0x1354dd[_0xb280('0x2e')],'type':_0x1354dd[_0xb280('0x2f')]['key']};});_0x48246e['model']=_[_0xb280('0x30')](_0x590365,_0xb280('0x2a'));_0x48246e[_0xb280('0x31')]=_[_0xb280('0x32')](_0x3aa2ad[_0xb280('0x31')]);_0x48246e[_0xb280('0x33')]=_[_0xb280('0x34')](_0x48246e[_0xb280('0x35')],_0x48246e[_0xb280('0x31')]);_0x21f3d6[_0xb280('0x36')]=_['intersection'](_0x48246e[_0xb280('0x35')],qs[_0xb280('0x37')](_0x3aa2ad['query'][_0xb280('0x37')]));_0x21f3d6[_0xb280('0x36')]=_0x21f3d6[_0xb280('0x36')]['length']?_0x21f3d6[_0xb280('0x36')]:_0x48246e[_0xb280('0x35')];if(!_0x3aa2ad[_0xb280('0x31')][_0xb280('0x38')](_0xb280('0x39'))){_0x21f3d6[_0xb280('0x20')]=qs[_0xb280('0x20')](_0x3aa2ad[_0xb280('0x31')][_0xb280('0x20')]);_0x21f3d6[_0xb280('0x1e')]=qs[_0xb280('0x1e')](_0x3aa2ad['query'][_0xb280('0x1e')]);}_0x21f3d6[_0xb280('0x3a')]=qs['sort'](_0x3aa2ad[_0xb280('0x31')][_0xb280('0x3b')]);_0x21f3d6[_0xb280('0x3c')]=qs[_0xb280('0x33')](_[_0xb280('0x3d')](_0x3aa2ad[_0xb280('0x31')],_0x48246e['filters']),_0x590365);if(_0x3aa2ad['query'][_0xb280('0x3e')]){_0x21f3d6['where']=_[_0xb280('0x3f')](_0x21f3d6[_0xb280('0x3c')],{'$or':_[_0xb280('0x30')](_0x590365,function(_0x17fdab){if(_0x17fdab[_0xb280('0x2f')]!==_0xb280('0x40')){var _0x509c68={};_0x509c68[_0x17fdab[_0xb280('0x2a')]]={'$like':'%'+_0x3aa2ad[_0xb280('0x31')]['filter']+'%'};return _0x509c68;}})});}_0x21f3d6=_['merge']({},_0x21f3d6,_0x3aa2ad[_0xb280('0x41')]);var _0x24645d={'where':_0x21f3d6[_0xb280('0x3c')]};return db['Migration'][_0xb280('0x21')](_0x24645d)[_0xb280('0x42')](function(_0x476508){_0x1a96af[_0xb280('0x21')]=_0x476508;if(_0x3aa2ad[_0xb280('0x31')]['includeAll']){_0x21f3d6[_0xb280('0x43')]=[{'all':!![]}];}return db[_0xb280('0x2c')][_0xb280('0x44')](_0x21f3d6);})[_0xb280('0x42')](function(_0x12ff3c){_0x1a96af['rows']=_0x12ff3c;return _0x1a96af;})[_0xb280('0x42')](respondWithFilteredResult(_0x4b16d5,_0x21f3d6))['catch'](handleError(_0x4b16d5,null));}; \ No newline at end of file +var _0x4f6b=['name','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','apply','reject','save','update','then','sendStatus','stack'];(function(_0x333d99,_0x87dd42){var _0x41c679=function(_0xae20f){while(--_0xae20f){_0x333d99['push'](_0x333d99['shift']());}};_0x41c679(++_0x87dd42);}(_0x4f6b,0x15a));var _0xb4f6=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4f6b[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0xb4f6('0x0'));var rimraf=require(_0xb4f6('0x1'));var zipdir=require(_0xb4f6('0x2'));var jsonpatch=require(_0xb4f6('0x3'));var rp=require('request-promise');var moment=require(_0xb4f6('0x4'));var BPromise=require(_0xb4f6('0x5'));var Mustache=require('mustache');var util=require(_0xb4f6('0x6'));var path=require(_0xb4f6('0x7'));var sox=require(_0xb4f6('0x8'));var csv=require(_0xb4f6('0x9'));var ejs=require(_0xb4f6('0xa'));var fs=require('fs');var fs_extra=require(_0xb4f6('0xb'));var _=require(_0xb4f6('0xc'));var squel=require(_0xb4f6('0xd'));var crypto=require(_0xb4f6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb4f6('0xf'));var toCsv=require(_0xb4f6('0x9'));var querystring=require(_0xb4f6('0x10'));var Papa=require(_0xb4f6('0x11'));var Redis=require('ioredis');var authService=require(_0xb4f6('0x12'));var qs=require(_0xb4f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4f6('0x14'));var logger=require(_0xb4f6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb4f6('0x16'));var licenseUtil=require(_0xb4f6('0x17'));var db=require(_0xb4f6('0x18'))['db'];function respondWithStatusCode(_0x575ae0,_0x5be2d1){_0x5be2d1=_0x5be2d1||0xcc;return function(_0x44b4c0){if(_0x44b4c0){return _0x575ae0['sendStatus'](_0x5be2d1);}return _0x575ae0['status'](_0x5be2d1)[_0xb4f6('0x19')]();};}function respondWithResult(_0x3c3344,_0x504deb){_0x504deb=_0x504deb||0xc8;return function(_0x3a9f35){if(_0x3a9f35){return _0x3c3344[_0xb4f6('0x1a')](_0x504deb)[_0xb4f6('0x1b')](_0x3a9f35);}};}function respondWithFilteredResult(_0x240597,_0x1c714e){return function(_0x3b9532){if(_0x3b9532){var _0x5e6b8a=typeof _0x1c714e[_0xb4f6('0x1c')]===_0xb4f6('0x1d')&&typeof _0x1c714e[_0xb4f6('0x1e')]===_0xb4f6('0x1d');var _0x462e4f=_0x3b9532['count'];var _0x46293c=_0x5e6b8a?0x0:_0x1c714e[_0xb4f6('0x1c')];var _0x227d5a=_0x5e6b8a?_0x3b9532['count']:_0x1c714e[_0xb4f6('0x1c')]+_0x1c714e['limit'];var _0x3cc659;if(_0x227d5a>=_0x462e4f){_0x227d5a=_0x462e4f;_0x3cc659=0xc8;}else{_0x3cc659=0xce;}_0x240597[_0xb4f6('0x1a')](_0x3cc659);return _0x240597['set']('Content-Range',_0x46293c+'-'+_0x227d5a+'/'+_0x462e4f)[_0xb4f6('0x1b')](_0x3b9532);}return null;};}function patchUpdates(_0x487411){return function(_0x18be56){try{jsonpatch[_0xb4f6('0x1f')](_0x18be56,_0x487411,!![]);}catch(_0x9a9975){return BPromise[_0xb4f6('0x20')](_0x9a9975);}return _0x18be56[_0xb4f6('0x21')]();};}function saveUpdates(_0xc89b81,_0x4b77f7){return function(_0x5ce040){if(_0x5ce040){return _0x5ce040[_0xb4f6('0x22')](_0xc89b81)[_0xb4f6('0x23')](function(_0x487900){return _0x487900;});}return null;};}function removeEntity(_0x3ad119,_0x3db8e7){return function(_0x2b482b){if(_0x2b482b){return _0x2b482b['destroy']()[_0xb4f6('0x23')](function(){_0x3ad119['status'](0xcc)[_0xb4f6('0x19')]();});}};}function handleEntityNotFound(_0x37a15c,_0x264734){return function(_0x55430c){if(!_0x55430c){_0x37a15c[_0xb4f6('0x24')](0x194);}return _0x55430c;};}function handleError(_0x33ffbe,_0x9a32ba){_0x9a32ba=_0x9a32ba||0x1f4;return function(_0x384797){logger['error'](_0x384797[_0xb4f6('0x25')]);if(_0x384797[_0xb4f6('0x26')]){delete _0x384797[_0xb4f6('0x26')];}_0x33ffbe[_0xb4f6('0x1a')](_0x9a32ba)['send'](_0x384797);};}exports[_0xb4f6('0x27')]=function(_0x4ec123,_0x419b27){var _0x4b0e35={},_0x2fc002={},_0x32e872={'count':0x0,'rows':[]};var _0x626db2=_[_0xb4f6('0x28')](db[_0xb4f6('0x29')][_0xb4f6('0x2a')],function(_0x269295){return{'name':_0x269295[_0xb4f6('0x2b')],'type':_0x269295[_0xb4f6('0x2c')][_0xb4f6('0x2d')]};});_0x2fc002[_0xb4f6('0x2e')]=_[_0xb4f6('0x28')](_0x626db2,_0xb4f6('0x26'));_0x2fc002['query']=_[_0xb4f6('0x2f')](_0x4ec123[_0xb4f6('0x30')]);_0x2fc002[_0xb4f6('0x31')]=_[_0xb4f6('0x32')](_0x2fc002[_0xb4f6('0x2e')],_0x2fc002[_0xb4f6('0x30')]);_0x4b0e35[_0xb4f6('0x33')]=_[_0xb4f6('0x32')](_0x2fc002[_0xb4f6('0x2e')],qs[_0xb4f6('0x34')](_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x34')]));_0x4b0e35[_0xb4f6('0x33')]=_0x4b0e35[_0xb4f6('0x33')][_0xb4f6('0x35')]?_0x4b0e35[_0xb4f6('0x33')]:_0x2fc002[_0xb4f6('0x2e')];if(!_0x4ec123[_0xb4f6('0x30')]['hasOwnProperty']('nolimit')){_0x4b0e35[_0xb4f6('0x1e')]=qs[_0xb4f6('0x1e')](_0x4ec123['query']['limit']);_0x4b0e35[_0xb4f6('0x1c')]=qs[_0xb4f6('0x1c')](_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x1c')]);}_0x4b0e35['order']=qs[_0xb4f6('0x36')](_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x36')]);_0x4b0e35[_0xb4f6('0x37')]=qs[_0xb4f6('0x31')](_[_0xb4f6('0x38')](_0x4ec123[_0xb4f6('0x30')],_0x2fc002[_0xb4f6('0x31')]),_0x626db2);if(_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x39')]){_0x4b0e35[_0xb4f6('0x37')]=_[_0xb4f6('0x3a')](_0x4b0e35['where'],{'$or':_[_0xb4f6('0x28')](_0x626db2,function(_0x1e9ddf){if(_0x1e9ddf[_0xb4f6('0x2c')]!==_0xb4f6('0x3b')){var _0x4de2c3={};_0x4de2c3[_0x1e9ddf['name']]={'$like':'%'+_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x39')]+'%'};return _0x4de2c3;}})});}_0x4b0e35=_['merge']({},_0x4b0e35,_0x4ec123[_0xb4f6('0x3c')]);var _0x1d3dd0={'where':_0x4b0e35[_0xb4f6('0x37')]};return db[_0xb4f6('0x29')][_0xb4f6('0x3d')](_0x1d3dd0)[_0xb4f6('0x23')](function(_0x3d2c31){_0x32e872[_0xb4f6('0x3d')]=_0x3d2c31;if(_0x4ec123[_0xb4f6('0x30')][_0xb4f6('0x3e')]){_0x4b0e35['include']=[{'all':!![]}];}return db[_0xb4f6('0x29')][_0xb4f6('0x3f')](_0x4b0e35);})[_0xb4f6('0x23')](function(_0x2ab02c){_0x32e872['rows']=_0x2ab02c;return _0x32e872;})['then'](respondWithFilteredResult(_0x419b27,_0x4b0e35))['catch'](handleError(_0x419b27,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index fbb305f..a33a5d0 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 _0x5a58=['path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x125581,_0x1c1bf1){var _0x5909e5=function(_0x54a051){while(--_0x54a051){_0x125581['push'](_0x125581['shift']());}};_0x5909e5(++_0x1c1bf1);}(_0x5a58,0x97));var _0x85a5=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x5a58[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require(_0x85a5('0x0'));var logger=require(_0x85a5('0x1'))('api');var moment=require(_0x85a5('0x2'));var BPromise=require(_0x85a5('0x3'));var rp=require(_0x85a5('0x4'));var fs=require('fs');var path=require(_0x85a5('0x5'));var rimraf=require(_0x85a5('0x6'));var config=require(_0x85a5('0x7'));var attributes=require(_0x85a5('0x8'));module[_0x85a5('0x9')]=function(_0x3653ee,_0x45796a){return _0x3653ee['define'](_0x85a5('0xa'),attributes,{'tableName':_0x85a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e3c=['../../config/environment','./migration.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x7e3c,0xb8));var _0xc7e3=function(_0x36b22b,_0x589e80){_0x36b22b=_0x36b22b-0x0;var _0x2ad385=_0x7e3c[_0x36b22b];return _0x2ad385;};'use strict';var _=require(_0xc7e3('0x0'));var util=require(_0xc7e3('0x1'));var logger=require(_0xc7e3('0x2'))(_0xc7e3('0x3'));var moment=require(_0xc7e3('0x4'));var BPromise=require(_0xc7e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7e3('0x6'));var rimraf=require(_0xc7e3('0x7'));var config=require(_0xc7e3('0x8'));var attributes=require(_0xc7e3('0x9'));module[_0xc7e3('0xa')]=function(_0x540f1c,_0x295317){return _0x540f1c[_0xc7e3('0xb')]('Migration',attributes,{'tableName':'migrations','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 1185da7..787cfd9 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 _0xbf1a=['../../config/environment','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbf1a,0x7c));var _0xabf1=function(_0x2ad6f9,_0x5b1fbd){_0x2ad6f9=_0x2ad6f9-0x0;var _0x22ee60=_0xbf1a[_0x2ad6f9];return _0x22ee60;};'use strict';var _=require(_0xabf1('0x0'));var util=require(_0xabf1('0x1'));var moment=require(_0xabf1('0x2'));var BPromise=require(_0xabf1('0x3'));var rs=require(_0xabf1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabf1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabf1('0x6'))(_0xabf1('0x7'));var config=require(_0xabf1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xabf1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5b53,_0x3bdf07,_0x1cc1f6){return new BPromise(function(_0x1f48f5,_0x3eb992){return client[_0xabf1('0xa')](_0x4f5b53,_0x1cc1f6)[_0xabf1('0xb')](function(_0x59a7a2){logger[_0xabf1('0xc')](_0xabf1('0xd'),_0x3bdf07,_0xabf1('0xe'));logger[_0xabf1('0xf')](_0xabf1('0x10'),_0x3bdf07,_0xabf1('0xe'),JSON['stringify'](_0x59a7a2));if(_0x59a7a2[_0xabf1('0x11')]){if(_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x12')]===0x1f4){logger[_0xabf1('0x11')](_0xabf1('0xd'),_0x3bdf07,_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x13')]);return _0x3eb992(_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x13')]);}logger[_0xabf1('0x11')]('Migration,\x20%s,\x20%s',_0x3bdf07,_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x13')]);return _0x1f48f5(_0x59a7a2[_0xabf1('0x11')]['message']);}else{logger[_0xabf1('0xc')](_0xabf1('0xd'),_0x3bdf07,_0xabf1('0xe'));_0x1f48f5(_0x59a7a2[_0xabf1('0x14')]['message']);}})[_0xabf1('0x15')](function(_0x4b138d){logger[_0xabf1('0x11')](_0xabf1('0xd'),_0x3bdf07,_0x4b138d);_0x3eb992(_0x4b138d);});});} \ No newline at end of file +var _0xbfcc=['Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0xb1fa2c,_0x3479af){var _0x3a9890=function(_0x5dc537){while(--_0x5dc537){_0xb1fa2c['push'](_0xb1fa2c['shift']());}};_0x3a9890(++_0x3479af);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xbfcc[_0x2f5a22];return _0x326b70;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('Migration,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index adea28a..0736b41 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 _0x23db=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x4cc235,_0x3caf73){var _0x39e3e2=function(_0x34f181){while(--_0x34f181){_0x4cc235['push'](_0x4cc235['shift']());}};_0x39e3e2(++_0x3caf73);}(_0x23db,0x141));var _0xb23d=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x23db[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0xb23d('0x0'));var util=require(_0xb23d('0x1'));var path=require(_0xb23d('0x2'));var timeout=require(_0xb23d('0x3'));var express=require(_0xb23d('0x4'));var router=express[_0xb23d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb23d('0x6'));var config=require(_0xb23d('0x7'));var controller=require('./network.controller');router[_0xb23d('0x8')]('/',auth[_0xb23d('0x9')](),controller[_0xb23d('0xa')]);router[_0xb23d('0x8')](_0xb23d('0xb'),auth[_0xb23d('0x9')](),controller[_0xb23d('0xc')]);router[_0xb23d('0xd')]('/',auth[_0xb23d('0x9')](),controller['create']);router[_0xb23d('0xe')](_0xb23d('0xb'),auth[_0xb23d('0x9')](),controller[_0xb23d('0xf')]);router[_0xb23d('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb23d('0x11')]=router; \ No newline at end of file +var _0x073d=['show','post','create','put','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0x073d,0xd2));var _0xd073=function(_0x2a43b9,_0x2aa7ea){_0x2a43b9=_0x2a43b9-0x0;var _0x3b6c90=_0x073d[_0x2a43b9];return _0x3b6c90;};'use strict';var multer=require('multer');var util=require(_0xd073('0x0'));var path=require(_0xd073('0x1'));var timeout=require(_0xd073('0x2'));var express=require('express');var router=express[_0xd073('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd073('0x4'));var interaction=require(_0xd073('0x5'));var config=require('../../config/environment');var controller=require(_0xd073('0x6'));router[_0xd073('0x7')]('/',auth[_0xd073('0x8')](),controller[_0xd073('0x9')]);router[_0xd073('0x7')](_0xd073('0xa'),auth[_0xd073('0x8')](),controller[_0xd073('0xb')]);router[_0xd073('0xc')]('/',auth[_0xd073('0x8')](),controller[_0xd073('0xd')]);router[_0xd073('0xe')](_0xd073('0xa'),auth[_0xd073('0x8')](),controller['update']);router['delete'](_0xd073('0xa'),auth['isAuthenticated'](),controller[_0xd073('0xf')]);module[_0xd073('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 21e2979..28e34c0 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 _0xa1b7=['turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa1b7,0xa4));var _0x7a1b=function(_0xc2701d,_0x47010b){_0xc2701d=_0xc2701d-0x0;var _0x15c8f3=_0xa1b7[_0xc2701d];return _0x15c8f3;};'use strict';var Sequelize=require(_0x7a1b('0x0'));module[_0x7a1b('0x1')]={'type':{'type':Sequelize[_0x7a1b('0x2')](_0x7a1b('0x3'),'externip','stun',_0x7a1b('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7a1b('0x5')]},'password':{'type':Sequelize[_0x7a1b('0x5')]}}; \ No newline at end of file +var _0xfea2=['STRING','sequelize','exports','localnet','externip','stun','turn'];(function(_0x13f9f4,_0x285d05){var _0x1b6af0=function(_0x13afd5){while(--_0x13afd5){_0x13f9f4['push'](_0x13f9f4['shift']());}};_0x1b6af0(++_0x285d05);}(_0xfea2,0x1c1));var _0x2fea=function(_0x35685f,_0x595545){_0x35685f=_0x35685f-0x0;var _0x4fdfa5=_0xfea2[_0x35685f];return _0x4fdfa5;};'use strict';var Sequelize=require(_0x2fea('0x0'));module[_0x2fea('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2fea('0x2'),_0x2fea('0x3'),_0x2fea('0x4'),_0x2fea('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2fea('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 900bea3..d607a37 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 _0x5f24=['request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','limit','undefined','count','update','destroy','end','sendStatus','stack','name','send','index','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','Network','includeAll','include','findAll','rows','catch','show','find','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','render','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','params','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','toLowerCase','path','ejs','../../components/parsers/qs','api','client','http'];(function(_0x51ddaf,_0x2367a8){var _0x38bd07=function(_0x2536c8){while(--_0x2536c8){_0x51ddaf['push'](_0x51ddaf['shift']());}};_0x38bd07(++_0x2367a8);}(_0x5f24,0x9a));var _0x45f2=function(_0x129479,_0x256c7e){_0x129479=_0x129479-0x0;var _0x3fa0ce=_0x5f24[_0x129479];return _0x3fa0ce;};'use strict';var util=require('util');var path=require(_0x45f2('0x0'));var ejs=require(_0x45f2('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0x45f2('0x2'));var logger=require('../../config/logger')(_0x45f2('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x45f2('0x4')][_0x45f2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2c6285,_0x418330,_0x45dc95,_0x14332f){return new Promise(function(_0x2b5d5e,_0x258671){var _0x5ed2bc=_0x14332f||client;return _0x5ed2bc[_0x45f2('0x6')](_0x2c6285,_0x45dc95)[_0x45f2('0x7')](function(_0x3293be){logger[_0x45f2('0x8')](_0x45f2('0x9'),_0x418330,_0x45f2('0xa'));logger[_0x45f2('0xb')](_0x45f2('0xc'),_0x418330,_0x45f2('0xa'),JSON[_0x45f2('0xd')](_0x3293be));if(_0x3293be['error']){if(_0x3293be[_0x45f2('0xe')][_0x45f2('0xf')]===0x1f4){logger['error'](_0x45f2('0x9'),_0x418330,_0x3293be[_0x45f2('0xe')][_0x45f2('0x10')]);return _0x258671(_0x3293be['error'][_0x45f2('0x10')]);}logger[_0x45f2('0xe')](_0x45f2('0x9'),_0x418330,_0x3293be[_0x45f2('0xe')][_0x45f2('0x10')]);return _0x2b5d5e(_0x3293be[_0x45f2('0xe')][_0x45f2('0x10')]);}else{logger[_0x45f2('0x8')](_0x45f2('0x9'),_0x418330,_0x45f2('0xa'));_0x2b5d5e(_0x3293be[_0x45f2('0x11')][_0x45f2('0x10')]);}})['catch'](function(_0x1d0984){logger[_0x45f2('0xe')]('Network,\x20%s,\x20%s',_0x418330,_0x1d0984);_0x258671(_0x1d0984);});});}function respondWithResult(_0x243895,_0x13a4b7){_0x13a4b7=_0x13a4b7||0xc8;return function(_0x145a89){if(_0x145a89){return _0x243895[_0x45f2('0x12')](_0x13a4b7)[_0x45f2('0x13')](_0x145a89);}};}function respondWithFilteredResult(_0xe0ceb7,_0x5308fd){return function(_0x14d8c8){if(_0x14d8c8){var _0x2df9a8=typeof _0x5308fd[_0x45f2('0x14')]==='undefined'&&typeof _0x5308fd[_0x45f2('0x15')]===_0x45f2('0x16');var _0x4684df=_0x14d8c8[_0x45f2('0x17')];var _0x5d6caa=_0x2df9a8?0x0:_0x5308fd[_0x45f2('0x14')];var _0x4e12c5=_0x2df9a8?_0x14d8c8[_0x45f2('0x17')]:_0x5308fd[_0x45f2('0x14')]+_0x5308fd[_0x45f2('0x15')];var _0x5bbc33;if(_0x4e12c5>=_0x4684df){_0x4e12c5=_0x4684df;_0x5bbc33=0xc8;}else{_0x5bbc33=0xce;}_0xe0ceb7[_0x45f2('0x12')](_0x5bbc33);return _0xe0ceb7['set']('Content-Range',_0x5d6caa+'-'+_0x4e12c5+'/'+_0x4684df)[_0x45f2('0x13')](_0x14d8c8);}return null;};}function saveUpdates(_0xff2a80){return function(_0x114935){if(_0x114935){return _0x114935[_0x45f2('0x18')](_0xff2a80)[_0x45f2('0x7')](function(_0x330d40){return _0x330d40;});}return null;};}function removeEntity(_0x2bd9ca){return function(_0x539c5b){if(_0x539c5b){return _0x539c5b[_0x45f2('0x19')]()['then'](function(){_0x2bd9ca[_0x45f2('0x12')](0xcc)[_0x45f2('0x1a')]();});}};}function handleEntityNotFound(_0x5f0a31){return function(_0x170c15){if(!_0x170c15){_0x5f0a31[_0x45f2('0x1b')](0x194);}return _0x170c15;};}function handleError(_0xff3cd8,_0x2a45fc){_0x2a45fc=_0x2a45fc||0x1f4;return function(_0x1aef29){logger[_0x45f2('0xe')](_0x1aef29[_0x45f2('0x1c')]);if(_0x1aef29[_0x45f2('0x1d')]){delete _0x1aef29[_0x45f2('0x1d')];}_0xff3cd8['status'](_0x2a45fc)[_0x45f2('0x1e')](_0x1aef29);};}exports[_0x45f2('0x1f')]=function(_0x1d6070,_0x16ff42){var _0x81dd36={},_0x3d5b53={},_0x4731a6={'count':0x0,'rows':[]};var _0x47aa44=_['map'](db['Network']['rawAttributes'],function(_0x1b6238){return{'name':_0x1b6238['fieldName'],'type':_0x1b6238['type']['key']};});_0x3d5b53['model']=_[_0x45f2('0x20')](_0x47aa44,_0x45f2('0x1d'));_0x3d5b53['query']=_[_0x45f2('0x21')](_0x1d6070[_0x45f2('0x22')]);_0x3d5b53[_0x45f2('0x23')]=_[_0x45f2('0x24')](_0x3d5b53[_0x45f2('0x25')],_0x3d5b53[_0x45f2('0x22')]);_0x81dd36[_0x45f2('0x26')]=_[_0x45f2('0x24')](_0x3d5b53[_0x45f2('0x25')],qs[_0x45f2('0x27')](_0x1d6070[_0x45f2('0x22')][_0x45f2('0x27')]));_0x81dd36[_0x45f2('0x26')]=_0x81dd36['attributes'][_0x45f2('0x28')]?_0x81dd36[_0x45f2('0x26')]:_0x3d5b53['model'];if(!_0x1d6070[_0x45f2('0x22')][_0x45f2('0x29')]('nolimit')){_0x81dd36[_0x45f2('0x15')]=qs[_0x45f2('0x15')](_0x1d6070[_0x45f2('0x22')][_0x45f2('0x15')]);_0x81dd36[_0x45f2('0x14')]=qs[_0x45f2('0x14')](_0x1d6070[_0x45f2('0x22')]['offset']);}_0x81dd36['order']=qs[_0x45f2('0x2a')](_0x1d6070[_0x45f2('0x22')][_0x45f2('0x2a')]);_0x81dd36[_0x45f2('0x2b')]=qs[_0x45f2('0x23')](_['pick'](_0x1d6070[_0x45f2('0x22')],_0x3d5b53[_0x45f2('0x23')]),_0x47aa44);if(_0x1d6070[_0x45f2('0x22')][_0x45f2('0x2c')]){_0x81dd36[_0x45f2('0x2b')]=_[_0x45f2('0x2d')](_0x81dd36['where'],{'$or':_['map'](_0x47aa44,function(_0x401b7c){if(_0x401b7c[_0x45f2('0x2e')]!==_0x45f2('0x2f')){var _0x5a671e={};_0x5a671e[_0x401b7c[_0x45f2('0x1d')]]={'$like':'%'+_0x1d6070[_0x45f2('0x22')][_0x45f2('0x2c')]+'%'};return _0x5a671e;}})});}_0x81dd36=_[_0x45f2('0x2d')]({},_0x81dd36,_0x1d6070[_0x45f2('0x30')]);var _0x37afcd={'where':_0x81dd36[_0x45f2('0x2b')]};return db[_0x45f2('0x31')][_0x45f2('0x17')](_0x37afcd)[_0x45f2('0x7')](function(_0x40530a){_0x4731a6['count']=_0x40530a;if(_0x1d6070[_0x45f2('0x22')][_0x45f2('0x32')]){_0x81dd36[_0x45f2('0x33')]=[{'all':!![]}];}return db['Network'][_0x45f2('0x34')](_0x81dd36);})[_0x45f2('0x7')](function(_0x4638fa){_0x4731a6[_0x45f2('0x35')]=_0x4638fa;return _0x4731a6;})[_0x45f2('0x7')](respondWithFilteredResult(_0x16ff42,_0x81dd36))[_0x45f2('0x36')](handleError(_0x16ff42,null));};exports[_0x45f2('0x37')]=function(_0x3141f5,_0x3b4a95){var _0x55be58={'raw':!![],'where':{'id':_0x3141f5['params']['id']}},_0x1980f8={};_0x1980f8[_0x45f2('0x25')]=_['keys'](db['Network']['rawAttributes']);_0x1980f8[_0x45f2('0x22')]=_[_0x45f2('0x21')](_0x3141f5['query']);_0x1980f8[_0x45f2('0x23')]=_[_0x45f2('0x24')](_0x1980f8[_0x45f2('0x25')],_0x1980f8['query']);_0x55be58[_0x45f2('0x26')]=_[_0x45f2('0x24')](_0x1980f8[_0x45f2('0x25')],qs['fields'](_0x3141f5[_0x45f2('0x22')][_0x45f2('0x27')]));_0x55be58['attributes']=_0x55be58[_0x45f2('0x26')][_0x45f2('0x28')]?_0x55be58['attributes']:_0x1980f8[_0x45f2('0x25')];if(_0x3141f5[_0x45f2('0x22')]['includeAll']){_0x55be58[_0x45f2('0x33')]=[{'all':!![]}];}_0x55be58=_[_0x45f2('0x2d')]({},_0x55be58,_0x3141f5[_0x45f2('0x30')]);return db[_0x45f2('0x31')][_0x45f2('0x38')](_0x55be58)[_0x45f2('0x7')](handleEntityNotFound(_0x3b4a95,null))[_0x45f2('0x7')](respondWithResult(_0x3b4a95,null))[_0x45f2('0x36')](handleError(_0x3b4a95,null));};exports[_0x45f2('0x39')]=function(_0x5d17ef,_0x7f5d63){var _0x35358a;return db['Network']['create'](_0x5d17ef[_0x45f2('0x3a')],{'raw':!![]})[_0x45f2('0x7')](function(_0x4918c0){_0x35358a=_0x4918c0;return db[_0x45f2('0x31')][_0x45f2('0x34')]({'where':{'type':_0x5d17ef[_0x45f2('0x3a')][_0x45f2('0x2e')]},'raw':!![]});})[_0x45f2('0x7')](function(_0x2525bc){if(_0x35358a[_0x45f2('0x2e')]['toUpperCase']()==_0x45f2('0x3b')){var _0x576d5c=fs[_0x45f2('0x3c')](path[_0x45f2('0x3d')](config[_0x45f2('0x3e')],_0x45f2('0x3f')),_0x45f2('0x40'));var _0x1d8c36=ejs['render'](_0x576d5c,{'networks':_0x2525bc||[]});fs[_0x45f2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x1d8c36);return respondWithRpcPromise(_0x45f2('0x42'),_0x45f2('0x39'),{'module':'res_stun_monitor.so'});}else if(_0x35358a[_0x45f2('0x2e')][_0x45f2('0x43')]()==_0x45f2('0x44')){var _0x16bdd8=fs['readFileSync'](path[_0x45f2('0x3d')](config[_0x45f2('0x3e')],_0x45f2('0x45')),_0x45f2('0x40'));var _0x50b866=ejs[_0x45f2('0x46')](_0x16bdd8,{'networks':_0x2525bc||[]});fs[_0x45f2('0x41')]('/etc/asterisk/turn_xcally.conf',_0x50b866);return respondWithRpcPromise(_0x45f2('0x42'),_0x45f2('0x39'),{'module':_0x45f2('0x47')});}else{var _0x2a1353=fs[_0x45f2('0x3c')](path[_0x45f2('0x3d')](config['root'],_0x45f2('0x48')),_0x45f2('0x40'));var _0x4b5af4=ejs[_0x45f2('0x46')](_0x2a1353,{'networks':_0x2525bc||[]});fs[_0x45f2('0x41')](util[_0x45f2('0x49')](_0x45f2('0x4a'),_0x5d17ef['body'][_0x45f2('0x2e')]['toLowerCase']()),_0x4b5af4);return respondWithRpcPromise(_0x45f2('0x42'),_0x45f2('0x39'),{'module':_0x45f2('0x4b')});}})[_0x45f2('0x7')](function(){return _0x35358a;})[_0x45f2('0x7')](respondWithResult(_0x7f5d63,0xc9))[_0x45f2('0x36')](handleError(_0x7f5d63,null));};exports[_0x45f2('0x18')]=function(_0x4bf813,_0xab7d2e){var _0x22b943;return db[_0x45f2('0x31')][_0x45f2('0x38')]({'where':{'id':_0x4bf813[_0x45f2('0x4c')]['id']}})[_0x45f2('0x7')](handleEntityNotFound(_0xab7d2e,null))[_0x45f2('0x7')](saveUpdates(_0x4bf813[_0x45f2('0x3a')],null))['then'](function(_0x320939){if(_0x320939){_0x22b943=_0x320939;return db[_0x45f2('0x31')][_0x45f2('0x34')]({'where':{'type':_0x22b943[_0x45f2('0x2e')]},'raw':!![]});}return null;})[_0x45f2('0x7')](function(_0x590dc9){if(_0x22b943[_0x45f2('0x2e')][_0x45f2('0x43')]()==_0x45f2('0x3b')){var _0x4d1fec=fs[_0x45f2('0x3c')](path['join'](config[_0x45f2('0x3e')],_0x45f2('0x3f')),_0x45f2('0x40'));var _0x51a90e=ejs[_0x45f2('0x46')](_0x4d1fec,{'networks':_0x590dc9||[]});fs[_0x45f2('0x41')](_0x45f2('0x4d'),_0x51a90e);return respondWithRpcPromise(_0x45f2('0x42'),'update',{'module':'res_stun_monitor.so'});}else if(_0x22b943[_0x45f2('0x2e')][_0x45f2('0x43')]()==_0x45f2('0x44')){var _0x52993a=fs[_0x45f2('0x3c')](path['join'](config[_0x45f2('0x3e')],'server/files/templates/turn_multiple.ejs'),_0x45f2('0x40'));var _0x1800a6=ejs[_0x45f2('0x46')](_0x52993a,{'networks':_0x590dc9||[]});fs[_0x45f2('0x41')](_0x45f2('0x4e'),_0x1800a6);return respondWithRpcPromise(_0x45f2('0x42'),_0x45f2('0x18'),{'module':_0x45f2('0x47')});}else{var _0x497152=fs[_0x45f2('0x3c')](path[_0x45f2('0x3d')](config[_0x45f2('0x3e')],_0x45f2('0x48')),_0x45f2('0x40'));var _0x207789=ejs['render'](_0x497152,{'networks':_0x590dc9||[]});fs[_0x45f2('0x41')](util[_0x45f2('0x49')](_0x45f2('0x4a'),_0x4bf813[_0x45f2('0x3a')]['type'][_0x45f2('0x4f')]()),_0x207789);return respondWithRpcPromise(_0x45f2('0x42'),_0x45f2('0x18'),{'module':_0x45f2('0x4b')});}})[_0x45f2('0x7')](function(_0x1497c5){if(_0x1497c5){return _0x22b943;}return null;})['then'](respondWithResult(_0xab7d2e,null))[_0x45f2('0x36')](handleError(_0xab7d2e,null));};exports['destroy']=function(_0x2a1613,_0x2f61a6){var _0x527688;return db[_0x45f2('0x31')][_0x45f2('0x38')]({'where':{'id':_0x2a1613[_0x45f2('0x4c')]['id']}})[_0x45f2('0x7')](function(_0x15ea5f){_0x527688=_0x15ea5f;return _0x15ea5f;})[_0x45f2('0x7')](handleEntityNotFound(_0x2f61a6,null))['then'](removeEntity(_0x2f61a6,null))['then'](function(){if(_0x527688){return db[_0x45f2('0x31')][_0x45f2('0x34')]({'where':{'type':_0x527688[_0x45f2('0x2e')]},'raw':!![]});}})[_0x45f2('0x7')](function(_0x48d6a8){if(_0x527688[_0x45f2('0x2e')][_0x45f2('0x43')]()=='STUN'){var _0x2d9a98=fs[_0x45f2('0x3c')](path[_0x45f2('0x3d')](config[_0x45f2('0x3e')],_0x45f2('0x3f')),_0x45f2('0x40'));var _0x4bbdf0=ejs[_0x45f2('0x46')](_0x2d9a98,{'networks':_0x48d6a8||[]});fs['writeFileSync'](_0x45f2('0x4d'),_0x4bbdf0);return respondWithRpcPromise(_0x45f2('0x42'),_0x45f2('0x19'),{'module':_0x45f2('0x47')});}else if(_0x527688[_0x45f2('0x2e')][_0x45f2('0x43')]()==_0x45f2('0x44')){var _0x29a9eb=fs[_0x45f2('0x3c')](path[_0x45f2('0x3d')](config[_0x45f2('0x3e')],_0x45f2('0x45')),_0x45f2('0x40'));var _0x2c4899=ejs[_0x45f2('0x46')](_0x29a9eb,{'networks':_0x48d6a8||[]});fs[_0x45f2('0x41')]('/etc/asterisk/turn_xcally.conf',_0x2c4899);return respondWithRpcPromise(_0x45f2('0x42'),'destroy',{'module':_0x45f2('0x47')});}else{var _0x5935a5=fs[_0x45f2('0x3c')](path[_0x45f2('0x3d')](config[_0x45f2('0x3e')],_0x45f2('0x48')),_0x45f2('0x40'));var _0xd86c8a=ejs[_0x45f2('0x46')](_0x5935a5,{'networks':_0x48d6a8||[]});fs['writeFileSync'](util['format'](_0x45f2('0x4a'),_0x527688[_0x45f2('0x2e')][_0x45f2('0x4f')]()),_0xd86c8a);return respondWithRpcPromise(_0x45f2('0x42'),'destroy',{'module':'chan_sip.so'});}})[_0x45f2('0x36')](handleError(_0x2f61a6,null));}; \ No newline at end of file +var _0x5485=['http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','Network','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','writeFileSync','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','TURN','chan_sip.so','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0xf310ac,_0x4ea1ef){var _0xed806b=function(_0x2f5aca){while(--_0x2f5aca){_0xf310ac['push'](_0xf310ac['shift']());}};_0xed806b(++_0x4ea1ef);}(_0x5485,0xa0));var _0x5548=function(_0xe08f0e,_0x527e44){_0xe08f0e=_0xe08f0e-0x0;var _0x402cf1=_0x5485[_0xe08f0e];return _0x402cf1;};'use strict';var util=require(_0x5548('0x0'));var path=require(_0x5548('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5548('0x2'));var qs=require(_0x5548('0x3'));var logger=require(_0x5548('0x4'))(_0x5548('0x5'));var config=require(_0x5548('0x6'));var db=require(_0x5548('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5548('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ec1c2,_0x18f301,_0x1d66a9,_0x10445c){return new Promise(function(_0x29b7d9,_0x158417){var _0x2b6409=_0x10445c||client;return _0x2b6409[_0x5548('0x9')](_0x2ec1c2,_0x1d66a9)[_0x5548('0xa')](function(_0x521625){logger[_0x5548('0xb')]('Network,\x20%s,\x20%s',_0x18f301,_0x5548('0xc'));logger['debug'](_0x5548('0xd'),_0x18f301,_0x5548('0xc'),JSON[_0x5548('0xe')](_0x521625));if(_0x521625[_0x5548('0xf')]){if(_0x521625[_0x5548('0xf')][_0x5548('0x10')]===0x1f4){logger[_0x5548('0xf')](_0x5548('0x11'),_0x18f301,_0x521625[_0x5548('0xf')][_0x5548('0x12')]);return _0x158417(_0x521625['error']['message']);}logger[_0x5548('0xf')](_0x5548('0x11'),_0x18f301,_0x521625[_0x5548('0xf')][_0x5548('0x12')]);return _0x29b7d9(_0x521625[_0x5548('0xf')]['message']);}else{logger['info'](_0x5548('0x11'),_0x18f301,_0x5548('0xc'));_0x29b7d9(_0x521625[_0x5548('0x13')]['message']);}})['catch'](function(_0xbc6c45){logger[_0x5548('0xf')](_0x5548('0x11'),_0x18f301,_0xbc6c45);_0x158417(_0xbc6c45);});});}function respondWithResult(_0x1f01b3,_0x290b4e){_0x290b4e=_0x290b4e||0xc8;return function(_0x48da40){if(_0x48da40){return _0x1f01b3[_0x5548('0x14')](_0x290b4e)[_0x5548('0x15')](_0x48da40);}};}function respondWithFilteredResult(_0x8ebb6e,_0x14ef67){return function(_0x45730b){if(_0x45730b){var _0x17cd25=typeof _0x14ef67[_0x5548('0x16')]===_0x5548('0x17')&&typeof _0x14ef67['limit']===_0x5548('0x17');var _0x4b1791=_0x45730b['count'];var _0x3d115e=_0x17cd25?0x0:_0x14ef67['offset'];var _0x3c05da=_0x17cd25?_0x45730b[_0x5548('0x18')]:_0x14ef67['offset']+_0x14ef67[_0x5548('0x19')];var _0x5f53cd;if(_0x3c05da>=_0x4b1791){_0x3c05da=_0x4b1791;_0x5f53cd=0xc8;}else{_0x5f53cd=0xce;}_0x8ebb6e['status'](_0x5f53cd);return _0x8ebb6e[_0x5548('0x1a')](_0x5548('0x1b'),_0x3d115e+'-'+_0x3c05da+'/'+_0x4b1791)[_0x5548('0x15')](_0x45730b);}return null;};}function saveUpdates(_0x4f27e9){return function(_0xc13a01){if(_0xc13a01){return _0xc13a01[_0x5548('0x1c')](_0x4f27e9)[_0x5548('0xa')](function(_0x48612f){return _0x48612f;});}return null;};}function removeEntity(_0x324134){return function(_0x3b50d4){if(_0x3b50d4){return _0x3b50d4[_0x5548('0x1d')]()[_0x5548('0xa')](function(){_0x324134['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c7227){return function(_0x3139bd){if(!_0x3139bd){_0x5c7227['sendStatus'](0x194);}return _0x3139bd;};}function handleError(_0x464131,_0x3875c6){_0x3875c6=_0x3875c6||0x1f4;return function(_0x59968f){logger['error'](_0x59968f[_0x5548('0x1e')]);if(_0x59968f[_0x5548('0x1f')]){delete _0x59968f[_0x5548('0x1f')];}_0x464131[_0x5548('0x14')](_0x3875c6)[_0x5548('0x20')](_0x59968f);};}exports['index']=function(_0x5d7b66,_0x24fc99){var _0x4d4f7e={},_0x59bc8c={},_0x16382f={'count':0x0,'rows':[]};var _0x1c2bad=_[_0x5548('0x21')](db['Network'][_0x5548('0x22')],function(_0xe143a){return{'name':_0xe143a[_0x5548('0x23')],'type':_0xe143a[_0x5548('0x24')][_0x5548('0x25')]};});_0x59bc8c['model']=_[_0x5548('0x21')](_0x1c2bad,_0x5548('0x1f'));_0x59bc8c[_0x5548('0x26')]=_[_0x5548('0x27')](_0x5d7b66[_0x5548('0x26')]);_0x59bc8c['filters']=_[_0x5548('0x28')](_0x59bc8c[_0x5548('0x29')],_0x59bc8c['query']);_0x4d4f7e[_0x5548('0x2a')]=_['intersection'](_0x59bc8c['model'],qs[_0x5548('0x2b')](_0x5d7b66['query'][_0x5548('0x2b')]));_0x4d4f7e[_0x5548('0x2a')]=_0x4d4f7e[_0x5548('0x2a')][_0x5548('0x2c')]?_0x4d4f7e[_0x5548('0x2a')]:_0x59bc8c[_0x5548('0x29')];if(!_0x5d7b66[_0x5548('0x26')][_0x5548('0x2d')](_0x5548('0x2e'))){_0x4d4f7e['limit']=qs[_0x5548('0x19')](_0x5d7b66[_0x5548('0x26')][_0x5548('0x19')]);_0x4d4f7e[_0x5548('0x16')]=qs[_0x5548('0x16')](_0x5d7b66[_0x5548('0x26')][_0x5548('0x16')]);}_0x4d4f7e[_0x5548('0x2f')]=qs[_0x5548('0x30')](_0x5d7b66['query']['sort']);_0x4d4f7e[_0x5548('0x31')]=qs[_0x5548('0x32')](_[_0x5548('0x33')](_0x5d7b66['query'],_0x59bc8c['filters']),_0x1c2bad);if(_0x5d7b66[_0x5548('0x26')][_0x5548('0x34')]){_0x4d4f7e['where']=_['merge'](_0x4d4f7e[_0x5548('0x31')],{'$or':_['map'](_0x1c2bad,function(_0x33fa1d){if(_0x33fa1d[_0x5548('0x24')]!=='VIRTUAL'){var _0x40c6e2={};_0x40c6e2[_0x33fa1d[_0x5548('0x1f')]]={'$like':'%'+_0x5d7b66[_0x5548('0x26')][_0x5548('0x34')]+'%'};return _0x40c6e2;}})});}_0x4d4f7e=_[_0x5548('0x35')]({},_0x4d4f7e,_0x5d7b66[_0x5548('0x36')]);var _0xe889c={'where':_0x4d4f7e[_0x5548('0x31')]};return db['Network'][_0x5548('0x18')](_0xe889c)['then'](function(_0x1f25b7){_0x16382f['count']=_0x1f25b7;if(_0x5d7b66[_0x5548('0x26')][_0x5548('0x37')]){_0x4d4f7e[_0x5548('0x38')]=[{'all':!![]}];}return db['Network'][_0x5548('0x39')](_0x4d4f7e);})[_0x5548('0xa')](function(_0x32d2a){_0x16382f[_0x5548('0x3a')]=_0x32d2a;return _0x16382f;})[_0x5548('0xa')](respondWithFilteredResult(_0x24fc99,_0x4d4f7e))[_0x5548('0x3b')](handleError(_0x24fc99,null));};exports['show']=function(_0xbdbef5,_0x22a29f){var _0xab736e={'raw':!![],'where':{'id':_0xbdbef5[_0x5548('0x3c')]['id']}},_0x186ddf={};_0x186ddf[_0x5548('0x29')]=_[_0x5548('0x27')](db[_0x5548('0x3d')][_0x5548('0x22')]);_0x186ddf[_0x5548('0x26')]=_[_0x5548('0x27')](_0xbdbef5[_0x5548('0x26')]);_0x186ddf[_0x5548('0x32')]=_[_0x5548('0x28')](_0x186ddf[_0x5548('0x29')],_0x186ddf[_0x5548('0x26')]);_0xab736e[_0x5548('0x2a')]=_['intersection'](_0x186ddf[_0x5548('0x29')],qs[_0x5548('0x2b')](_0xbdbef5[_0x5548('0x26')][_0x5548('0x2b')]));_0xab736e[_0x5548('0x2a')]=_0xab736e['attributes'][_0x5548('0x2c')]?_0xab736e['attributes']:_0x186ddf['model'];if(_0xbdbef5[_0x5548('0x26')][_0x5548('0x37')]){_0xab736e[_0x5548('0x38')]=[{'all':!![]}];}_0xab736e=_[_0x5548('0x35')]({},_0xab736e,_0xbdbef5[_0x5548('0x36')]);return db[_0x5548('0x3d')][_0x5548('0x3e')](_0xab736e)[_0x5548('0xa')](handleEntityNotFound(_0x22a29f,null))[_0x5548('0xa')](respondWithResult(_0x22a29f,null))[_0x5548('0x3b')](handleError(_0x22a29f,null));};exports[_0x5548('0x3f')]=function(_0x2c05e7,_0x2833e6){var _0x5d97b2;return db[_0x5548('0x3d')][_0x5548('0x3f')](_0x2c05e7[_0x5548('0x40')],{'raw':!![]})[_0x5548('0xa')](function(_0x283279){_0x5d97b2=_0x283279;return db[_0x5548('0x3d')][_0x5548('0x39')]({'where':{'type':_0x2c05e7[_0x5548('0x40')][_0x5548('0x24')]},'raw':!![]});})['then'](function(_0x6a8877){if(_0x5d97b2['type'][_0x5548('0x41')]()==_0x5548('0x42')){var _0x31d065=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x46')),_0x5548('0x47'));var _0x14e98c=ejs[_0x5548('0x48')](_0x31d065,{'networks':_0x6a8877||[]});fs['writeFileSync'](_0x5548('0x49'),_0x14e98c);return respondWithRpcPromise(_0x5548('0x4a'),'create',{'module':'res_stun_monitor.so'});}else if(_0x5d97b2[_0x5548('0x24')][_0x5548('0x41')]()=='TURN'){var _0x2a72b6=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4b')),'utf8');var _0x517cce=ejs[_0x5548('0x48')](_0x2a72b6,{'networks':_0x6a8877||[]});fs[_0x5548('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x517cce);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x3f'),{'module':_0x5548('0x4d')});}else{var _0xcf2be7=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4e')),_0x5548('0x47'));var _0x3f9138=ejs['render'](_0xcf2be7,{'networks':_0x6a8877||[]});fs[_0x5548('0x4c')](util[_0x5548('0x4f')](_0x5548('0x50'),_0x2c05e7[_0x5548('0x40')][_0x5548('0x24')][_0x5548('0x51')]()),_0x3f9138);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x3f'),{'module':'chan_sip.so'});}})[_0x5548('0xa')](function(){return _0x5d97b2;})[_0x5548('0xa')](respondWithResult(_0x2833e6,0xc9))[_0x5548('0x3b')](handleError(_0x2833e6,null));};exports[_0x5548('0x1c')]=function(_0x2880ae,_0x9d958b){var _0x3c89d8;return db[_0x5548('0x3d')][_0x5548('0x3e')]({'where':{'id':_0x2880ae[_0x5548('0x3c')]['id']}})[_0x5548('0xa')](handleEntityNotFound(_0x9d958b,null))['then'](saveUpdates(_0x2880ae[_0x5548('0x40')],null))['then'](function(_0x596ade){if(_0x596ade){_0x3c89d8=_0x596ade;return db['Network']['findAll']({'where':{'type':_0x3c89d8['type']},'raw':!![]});}return null;})[_0x5548('0xa')](function(_0x490f9a){if(_0x3c89d8[_0x5548('0x24')][_0x5548('0x41')]()==_0x5548('0x42')){var _0x5683cb=fs[_0x5548('0x43')](path['join'](config[_0x5548('0x45')],_0x5548('0x46')),_0x5548('0x47'));var _0x27f136=ejs[_0x5548('0x48')](_0x5683cb,{'networks':_0x490f9a||[]});fs[_0x5548('0x4c')](_0x5548('0x49'),_0x27f136);return respondWithRpcPromise(_0x5548('0x4a'),'update',{'module':_0x5548('0x4d')});}else if(_0x3c89d8[_0x5548('0x24')][_0x5548('0x41')]()==_0x5548('0x52')){var _0x2986c9=fs[_0x5548('0x43')](path['join'](config['root'],_0x5548('0x4b')),_0x5548('0x47'));var _0x7284c8=ejs[_0x5548('0x48')](_0x2986c9,{'networks':_0x490f9a||[]});fs[_0x5548('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x7284c8);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x1c'),{'module':_0x5548('0x4d')});}else{var _0x5c7e8c=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4e')),_0x5548('0x47'));var _0xcde047=ejs[_0x5548('0x48')](_0x5c7e8c,{'networks':_0x490f9a||[]});fs[_0x5548('0x4c')](util[_0x5548('0x4f')](_0x5548('0x50'),_0x2880ae[_0x5548('0x40')]['type'][_0x5548('0x51')]()),_0xcde047);return respondWithRpcPromise('Reload',_0x5548('0x1c'),{'module':'chan_sip.so'});}})[_0x5548('0xa')](function(_0x2dc769){if(_0x2dc769){return _0x3c89d8;}return null;})[_0x5548('0xa')](respondWithResult(_0x9d958b,null))[_0x5548('0x3b')](handleError(_0x9d958b,null));};exports['destroy']=function(_0x382622,_0x473096){var _0x2d86a1;return db[_0x5548('0x3d')]['find']({'where':{'id':_0x382622['params']['id']}})[_0x5548('0xa')](function(_0xf4c1b8){_0x2d86a1=_0xf4c1b8;return _0xf4c1b8;})[_0x5548('0xa')](handleEntityNotFound(_0x473096,null))[_0x5548('0xa')](removeEntity(_0x473096,null))[_0x5548('0xa')](function(){if(_0x2d86a1){return db[_0x5548('0x3d')][_0x5548('0x39')]({'where':{'type':_0x2d86a1[_0x5548('0x24')]},'raw':!![]});}})['then'](function(_0x72cc34){if(_0x2d86a1[_0x5548('0x24')][_0x5548('0x41')]()==_0x5548('0x42')){var _0xc760f8=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x46')),_0x5548('0x47'));var _0x2a28d4=ejs['render'](_0xc760f8,{'networks':_0x72cc34||[]});fs[_0x5548('0x4c')](_0x5548('0x49'),_0x2a28d4);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x2d86a1[_0x5548('0x24')]['toUpperCase']()==_0x5548('0x52')){var _0x43ee40=fs[_0x5548('0x43')](path[_0x5548('0x44')](config[_0x5548('0x45')],_0x5548('0x4b')),_0x5548('0x47'));var _0x1a706a=ejs[_0x5548('0x48')](_0x43ee40,{'networks':_0x72cc34||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1a706a);return respondWithRpcPromise(_0x5548('0x4a'),_0x5548('0x1d'),{'module':_0x5548('0x4d')});}else{var _0xbb80f0=fs[_0x5548('0x43')](path['join'](config['root'],_0x5548('0x4e')),_0x5548('0x47'));var _0x5324bd=ejs[_0x5548('0x48')](_0xbb80f0,{'networks':_0x72cc34||[]});fs[_0x5548('0x4c')](util[_0x5548('0x4f')](_0x5548('0x50'),_0x2d86a1[_0x5548('0x24')][_0x5548('0x51')]()),_0x5324bd);return respondWithRpcPromise(_0x5548('0x4a'),'destroy',{'module':_0x5548('0x53')});}})[_0x5548('0x3b')](handleError(_0x473096,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d2a579f..f026d9c 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 _0x39cb=['network','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','define','Network'];(function(_0x1068b3,_0x1a326c){var _0x2a3509=function(_0x23ff49){while(--_0x23ff49){_0x1068b3['push'](_0x1068b3['shift']());}};_0x2a3509(++_0x1a326c);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var moment=require(_0xb39c('0x2'));var BPromise=require(_0xb39c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb39c('0x4'));var rimraf=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var attributes=require(_0xb39c('0x7'));module[_0xb39c('0x8')]=function(_0x4ae4cf,_0x32cdcd){return _0x4ae4cf[_0xb39c('0x9')](_0xb39c('0xa'),attributes,{'tableName':_0xb39c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','Network','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x40f20c,_0x2905c8){var _0xde7e46=function(_0x5af7a4){while(--_0x5af7a4){_0x40f20c['push'](_0x40f20c['shift']());}};_0xde7e46(++_0x2905c8);}(_0x702d,0x147));var _0xd702=function(_0x5de018,_0x31a3b8){_0x5de018=_0x5de018-0x0;var _0x2995ad=_0x702d[_0x5de018];return _0x2995ad;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./network.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 1740beb..7a40c2b 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b6317,_0x28aec7){var _0x6f6fbd=function(_0x1ceb7f){while(--_0x1ceb7f){_0x3b6317['push'](_0x3b6317['shift']());}};_0x6f6fbd(++_0x28aec7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x904860,_0xd9dd4f){var _0x33e77c=function(_0x1e096f){while(--_0x1e096f){_0x904860['push'](_0x904860['shift']());}};_0x33e77c(++_0xd9dd4f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 5a81c06..a61a1a0 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 _0x6840=['describe','/:id','show','/:id/dispositions','getDispositions','get','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','/describe'];(function(_0x128221,_0x1848ea){var _0x195298=function(_0x207b82){while(--_0x207b82){_0x128221['push'](_0x128221['shift']());}};_0x195298(++_0x1848ea);}(_0x6840,0x12e));var _0x0684=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6840[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x0684('0x0'));var util=require('util');var path=require(_0x0684('0x1'));var timeout=require(_0x0684('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0684('0x3'));var auth=require(_0x0684('0x4'));var interaction=require(_0x0684('0x5'));var config=require('../../config/environment');var controller=require(_0x0684('0x6'));router['get']('/',auth[_0x0684('0x7')](),controller[_0x0684('0x8')]);router['get'](_0x0684('0x9'),auth[_0x0684('0x7')](),controller[_0x0684('0xa')]);router['get'](_0x0684('0xb'),auth[_0x0684('0x7')](),controller[_0x0684('0xc')]);router['get'](_0x0684('0xd'),auth[_0x0684('0x7')](),controller[_0x0684('0xe')]);router[_0x0684('0xf')](_0x0684('0x10'),auth[_0x0684('0x7')](),controller[_0x0684('0x11')]);router[_0x0684('0xf')](_0x0684('0x12'),auth[_0x0684('0x7')](),controller[_0x0684('0x13')]);router[_0x0684('0xf')](_0x0684('0x14'),auth[_0x0684('0x7')](),controller[_0x0684('0x15')]);router[_0x0684('0xf')](_0x0684('0x16'),auth[_0x0684('0x7')](),controller[_0x0684('0x17')]);router[_0x0684('0x18')]('/',auth[_0x0684('0x7')](),controller[_0x0684('0x19')]);router[_0x0684('0x18')](_0x0684('0xd'),auth[_0x0684('0x7')](),controller['addDisposition']);router[_0x0684('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0684('0x1a')]);router[_0x0684('0x18')](_0x0684('0x1b'),controller['notify']);router['post'](_0x0684('0x12'),auth[_0x0684('0x7')](),controller[_0x0684('0x1c')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x0684('0x18')](_0x0684('0x1d'),auth[_0x0684('0x7')](),controller[_0x0684('0x1e')]);router[_0x0684('0x1f')](_0x0684('0xb'),auth[_0x0684('0x7')](),controller[_0x0684('0x20')]);router[_0x0684('0x21')](_0x0684('0xb'),auth[_0x0684('0x7')](),controller[_0x0684('0x22')]);router[_0x0684('0x21')](_0x0684('0xd'),auth[_0x0684('0x7')](),controller[_0x0684('0x23')]);router[_0x0684('0x21')](_0x0684('0x10'),auth[_0x0684('0x7')](),controller[_0x0684('0x24')]);router[_0x0684('0x21')]('/:id/users',auth[_0x0684('0x7')](),controller[_0x0684('0x25')]);module[_0x0684('0x26')]=router; \ No newline at end of file +var _0x341c=['addApplications','/:id/users','/:id/send','send','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify'];(function(_0x460264,_0x51ddff){var _0x2d75a1=function(_0x5a02a8){while(--_0x5a02a8){_0x460264['push'](_0x460264['shift']());}};_0x2d75a1(++_0x51ddff);}(_0x341c,0xfb));var _0xc341=function(_0x21bf0d,_0x91bf98){_0x21bf0d=_0x21bf0d-0x0;var _0x561491=_0x341c[_0x21bf0d];return _0x561491;};'use strict';var multer=require(_0xc341('0x0'));var util=require('util');var path=require(_0xc341('0x1'));var timeout=require(_0xc341('0x2'));var express=require(_0xc341('0x3'));var router=express[_0xc341('0x4')]();var fs_extra=require(_0xc341('0x5'));var auth=require(_0xc341('0x6'));var interaction=require(_0xc341('0x7'));var config=require(_0xc341('0x8'));var controller=require(_0xc341('0x9'));router[_0xc341('0xa')]('/',auth[_0xc341('0xb')](),controller[_0xc341('0xc')]);router[_0xc341('0xa')](_0xc341('0xd'),auth[_0xc341('0xb')](),controller['describe']);router['get']('/:id',auth[_0xc341('0xb')](),controller[_0xc341('0xe')]);router[_0xc341('0xa')](_0xc341('0xf'),auth[_0xc341('0xb')](),controller[_0xc341('0x10')]);router[_0xc341('0xa')](_0xc341('0x11'),auth['isAuthenticated'](),controller[_0xc341('0x12')]);router[_0xc341('0xa')](_0xc341('0x13'),auth[_0xc341('0xb')](),controller['getApplications']);router[_0xc341('0xa')](_0xc341('0x14'),auth[_0xc341('0xb')](),controller[_0xc341('0x15')]);router[_0xc341('0xa')]('/:id/users',auth[_0xc341('0xb')](),controller[_0xc341('0x16')]);router[_0xc341('0x17')]('/',auth[_0xc341('0xb')](),controller[_0xc341('0x18')]);router[_0xc341('0x17')](_0xc341('0xf'),auth[_0xc341('0xb')](),controller[_0xc341('0x19')]);router[_0xc341('0x17')](_0xc341('0x11'),auth[_0xc341('0xb')](),controller[_0xc341('0x1a')]);router['post'](_0xc341('0x1b'),controller[_0xc341('0x1c')]);router[_0xc341('0x17')](_0xc341('0x13'),auth[_0xc341('0xb')](),controller[_0xc341('0x1d')]);router['post'](_0xc341('0x1e'),auth[_0xc341('0xb')](),controller['addAgents']);router[_0xc341('0x17')](_0xc341('0x1f'),auth[_0xc341('0xb')](),controller[_0xc341('0x20')]);router['put']('/:id',auth[_0xc341('0xb')](),controller['update']);router[_0xc341('0x21')](_0xc341('0x22'),auth[_0xc341('0xb')](),controller[_0xc341('0x23')]);router['delete'](_0xc341('0xf'),auth['isAuthenticated'](),controller[_0xc341('0x24')]);router[_0xc341('0x21')](_0xc341('0x11'),auth['isAuthenticated'](),controller[_0xc341('0x25')]);router[_0xc341('0x21')](_0xc341('0x1e'),auth[_0xc341('0xb')](),controller[_0xc341('0x26')]);module[_0xc341('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 66d0672..909cc27 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 _0x32ac=['randomstring','exports','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','sequelize'];(function(_0x352f24,_0x4007c5){var _0x5a9c5f=function(_0x5bd545){while(--_0x5bd545){_0x352f24['push'](_0x352f24['shift']());}};_0x5a9c5f(++_0x4007c5);}(_0x32ac,0x1ee));var _0xc32a=function(_0x2d4dfa,_0x58f99a){_0x2d4dfa=_0x2d4dfa-0x0;var _0x374c9d=_0x32ac[_0x2d4dfa];return _0x374c9d;};'use strict';var Sequelize=require(_0xc32a('0x0'));var rs=require(_0xc32a('0x1'));module[_0xc32a('0x2')]={'name':{'type':Sequelize[_0xc32a('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc32a('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc32a('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc32a('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc32a('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc32a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc32a('0x3')]},'queueTransfer':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc32a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc32a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc32a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc32a('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x27c905){if(!_0x27c905)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x27c905);}}}; \ No newline at end of file +var _0xeb0e=['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','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','TEXT'];(function(_0x1afda3,_0xf74e14){var _0x454b7c=function(_0xf42f9c){while(--_0xf42f9c){_0x1afda3['push'](_0x1afda3['shift']());}};_0x454b7c(++_0xf74e14);}(_0xeb0e,0x16e));var _0xeeb0=function(_0x530b83,_0x39676d){_0x530b83=_0x530b83-0x0;var _0x4af58e=_0xeb0e[_0x530b83];return _0x4af58e;};'use strict';var Sequelize=require(_0xeeb0('0x0'));var rs=require(_0xeeb0('0x1'));module['exports']={'name':{'type':Sequelize[_0xeeb0('0x2')],'unique':_0xeeb0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xeeb0('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xeeb0('0x4')]();}},'replyUri':{'type':Sequelize[_0xeeb0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xeeb0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xeeb0('0x5')],'defaultValue':function(){return _0xeeb0('0x6');}},'notificationSound':{'type':Sequelize[_0xeeb0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xeeb0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xeeb0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xeeb0('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeeb0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeeb0('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeeb0('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xeeb0('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xeeb0('0x7')],'defaultValue':![],'comment':_0xeeb0('0xa'),'set':function(_0x1570f1){if(!_0x1570f1)this['setDataValue'](_0xeeb0('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x1570f1);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 6651c00..76a703a 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 _0xdebe=['reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','count','removeDispositions','ids','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','account','applications','Applications','orderBy','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','tag','omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdebe,0x142));var _0xedeb=function(_0x275cdf,_0x32810d){_0x275cdf=_0x275cdf-0x0;var _0x37c9ad=_0xdebe[_0x275cdf];return _0x37c9ad;};'use strict';var emlformat=require(_0xedeb('0x0'));var rimraf=require(_0xedeb('0x1'));var zipdir=require(_0xedeb('0x2'));var jsonpatch=require(_0xedeb('0x3'));var rp=require('request-promise');var moment=require(_0xedeb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xedeb('0x5'));var util=require(_0xedeb('0x6'));var path=require('path');var sox=require(_0xedeb('0x7'));var csv=require(_0xedeb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xedeb('0x9'));var crypto=require(_0xedeb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xedeb('0xb'));var toCsv=require('to-csv');var querystring=require(_0xedeb('0xc'));var Papa=require(_0xedeb('0xd'));var Redis=require(_0xedeb('0xe'));var authService=require(_0xedeb('0xf'));var qs=require(_0xedeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedeb('0x11'));var logger=require(_0xedeb('0x12'))(_0xedeb('0x13'));var utils=require(_0xedeb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xedeb('0x15'))['db'];config[_0xedeb('0x16')]=_[_0xedeb('0x17')](config[_0xedeb('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xedeb('0x18'))(new Redis(config['redis']));require(_0xedeb('0x19'))[_0xedeb('0x1a')](socket);var jayson=require(_0xedeb('0x1b'));var client=jayson[_0xedeb('0x1c')][_0xedeb('0x1d')]({'port':0x232c});var client9002=jayson[_0xedeb('0x1c')][_0xedeb('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x209b11,_0x5c7d92,_0x26dcaa,_0x337de4){return new BPromise(function(_0x55082f,_0x3e8fd4){var _0x312e11=_0x337de4||client;return _0x312e11[_0xedeb('0x1e')](_0x209b11,_0x26dcaa)[_0xedeb('0x1f')](function(_0x3c5492){logger[_0xedeb('0x20')](_0xedeb('0x21'),_0x5c7d92,_0xedeb('0x22'));logger[_0xedeb('0x23')](_0xedeb('0x24'),_0x5c7d92,_0xedeb('0x22'),JSON[_0xedeb('0x25')](_0x3c5492));if(_0x3c5492[_0xedeb('0x26')]){if(_0x3c5492[_0xedeb('0x26')][_0xedeb('0x27')]===0x1f4){logger[_0xedeb('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5c7d92,_0x3c5492[_0xedeb('0x26')][_0xedeb('0x28')]);return _0x3e8fd4(_0x3c5492[_0xedeb('0x26')][_0xedeb('0x28')]);}logger[_0xedeb('0x26')](_0xedeb('0x21'),_0x5c7d92,_0x3c5492[_0xedeb('0x26')][_0xedeb('0x28')]);return _0x55082f(_0x3c5492['error'][_0xedeb('0x28')]);}else{logger[_0xedeb('0x20')](_0xedeb('0x21'),_0x5c7d92,_0xedeb('0x22'));_0x55082f(_0x3c5492[_0xedeb('0x29')]['message']);}})['catch'](function(_0x35b30b){logger[_0xedeb('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5c7d92,_0x35b30b);_0x3e8fd4(_0x35b30b);});});}function respondWithStatusCode(_0x515830,_0x4db997){_0x4db997=_0x4db997||0xcc;return function(_0x33a207){if(_0x33a207){return _0x515830[_0xedeb('0x2a')](_0x4db997);}return _0x515830[_0xedeb('0x2b')](_0x4db997)[_0xedeb('0x2c')]();};}function respondWithResult(_0x2669c9,_0x42f529){_0x42f529=_0x42f529||0xc8;return function(_0x50d8c0){if(_0x50d8c0){return _0x2669c9['status'](_0x42f529)[_0xedeb('0x2d')](_0x50d8c0);}};}function respondWithFilteredResult(_0x42d0d0,_0x36f06c){return function(_0xedc43c){if(_0xedc43c){var _0x3f92fa=typeof _0x36f06c[_0xedeb('0x2e')]===_0xedeb('0x2f')&&typeof _0x36f06c[_0xedeb('0x30')]==='undefined';var _0x2be8e8=_0xedc43c['count'];var _0x336467=_0x3f92fa?0x0:_0x36f06c[_0xedeb('0x2e')];var _0x523466=_0x3f92fa?_0xedc43c['count']:_0x36f06c['offset']+_0x36f06c[_0xedeb('0x30')];var _0x13cc1b;if(_0x523466>=_0x2be8e8){_0x523466=_0x2be8e8;_0x13cc1b=0xc8;}else{_0x13cc1b=0xce;}_0x42d0d0[_0xedeb('0x2b')](_0x13cc1b);return _0x42d0d0[_0xedeb('0x31')](_0xedeb('0x32'),_0x336467+'-'+_0x523466+'/'+_0x2be8e8)[_0xedeb('0x2d')](_0xedc43c);}return null;};}function patchUpdates(_0x31268a){return function(_0x90660b){try{jsonpatch[_0xedeb('0x33')](_0x90660b,_0x31268a,!![]);}catch(_0x494bb8){return BPromise[_0xedeb('0x34')](_0x494bb8);}return _0x90660b[_0xedeb('0x35')]();};}function saveUpdates(_0x4033d0,_0x115d5f){return function(_0x1700de){if(_0x1700de){return _0x1700de[_0xedeb('0x36')](_0x4033d0)[_0xedeb('0x1f')](function(_0x576a70){return _0x576a70;});}return null;};}function removeEntity(_0x2b8c9a,_0x6f101b){return function(_0x498bba){if(_0x498bba){return _0x498bba[_0xedeb('0x37')]()['then'](function(){var _0x117302=_0x498bba[_0xedeb('0x38')]({'plain':!![]});var _0x2e8db1=_0xedeb('0x39');return db[_0xedeb('0x3a')][_0xedeb('0x37')]({'where':{'type':_0x2e8db1,'resourceId':_0x117302['id']}})[_0xedeb('0x1f')](function(){return _0x498bba;});})['then'](function(){_0x2b8c9a[_0xedeb('0x2b')](0xcc)[_0xedeb('0x2c')]();});}};}function handleEntityNotFound(_0x25e1be,_0xfbf4b3){return function(_0x377a11){if(!_0x377a11){_0x25e1be[_0xedeb('0x2a')](0x194);}return _0x377a11;};}function handleError(_0x41b4ac,_0x4c6632){_0x4c6632=_0x4c6632||0x1f4;return function(_0x268b35){logger[_0xedeb('0x26')](_0x268b35[_0xedeb('0x3b')]);if(_0x268b35[_0xedeb('0x3c')]){delete _0x268b35['name'];}_0x41b4ac[_0xedeb('0x2b')](_0x4c6632)[_0xedeb('0x3d')](_0x268b35);};}exports[_0xedeb('0x3e')]=function(_0x3c001c,_0x4903f2){var _0x5d1dc3={'include':[{'model':db[_0xedeb('0x3f')],'as':_0xedeb('0x40')}]},_0x295521={},_0x31245e={'count':0x0,'rows':[]};var _0x1ee31e=_['map'](db[_0xedeb('0x41')][_0xedeb('0x42')],function(_0x36062b){return{'name':_0x36062b['fieldName'],'type':_0x36062b[_0xedeb('0x43')][_0xedeb('0x44')]};});_0x295521[_0xedeb('0x45')]=_[_0xedeb('0x46')](_0x1ee31e,_0xedeb('0x3c'));_0x295521['query']=_[_0xedeb('0x47')](_0x3c001c['query']);_0x295521['filters']=_[_0xedeb('0x48')](_0x295521[_0xedeb('0x45')],_0x295521['query']);_0x5d1dc3[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0x295521[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x3c001c['query'][_0xedeb('0x4a')]));_0x5d1dc3['attributes']=_0x5d1dc3[_0xedeb('0x49')][_0xedeb('0x4b')]?_0x5d1dc3[_0xedeb('0x49')]:_0x295521[_0xedeb('0x45')];if(!_0x3c001c[_0xedeb('0x4c')][_0xedeb('0x4d')](_0xedeb('0x4e'))){_0x5d1dc3[_0xedeb('0x30')]=qs[_0xedeb('0x30')](_0x3c001c[_0xedeb('0x4c')][_0xedeb('0x30')]);_0x5d1dc3[_0xedeb('0x2e')]=qs[_0xedeb('0x2e')](_0x3c001c[_0xedeb('0x4c')][_0xedeb('0x2e')]);}_0x5d1dc3[_0xedeb('0x4f')]=qs['sort'](_0x3c001c[_0xedeb('0x4c')][_0xedeb('0x50')]);_0x5d1dc3[_0xedeb('0x51')]=qs[_0xedeb('0x52')](_[_0xedeb('0x53')](_0x3c001c[_0xedeb('0x4c')],_0x295521[_0xedeb('0x52')]),_0x1ee31e);if(_0x3c001c[_0xedeb('0x4c')][_0xedeb('0x54')]){_0x5d1dc3[_0xedeb('0x51')]=_[_0xedeb('0x55')](_0x5d1dc3[_0xedeb('0x51')],{'$or':_['map'](_0x1ee31e,function(_0x34b005){if(_0x34b005[_0xedeb('0x43')]!==_0xedeb('0x56')){var _0x4dcb61={};_0x4dcb61[_0x34b005[_0xedeb('0x3c')]]={'$like':'%'+_0x3c001c[_0xedeb('0x4c')]['filter']+'%'};return _0x4dcb61;}})});}_0x5d1dc3=_[_0xedeb('0x55')]({},_0x5d1dc3,_0x3c001c[_0xedeb('0x57')]);var _0x4343e3={'where':_0x5d1dc3[_0xedeb('0x51')]};return db['OpenchannelAccount']['count'](_0x4343e3)[_0xedeb('0x1f')](function(_0x1846a5){_0x31245e['count']=_0x1846a5;if(_0x3c001c[_0xedeb('0x4c')][_0xedeb('0x58')]){_0x5d1dc3[_0xedeb('0x59')]=[{'all':!![]}];}return db[_0xedeb('0x41')][_0xedeb('0x5a')](_0x5d1dc3);})[_0xedeb('0x1f')](function(_0xceca95){_0x31245e[_0xedeb('0x5b')]=_0xceca95;return _0x31245e;})['then'](respondWithFilteredResult(_0x4903f2,_0x5d1dc3))[_0xedeb('0x5c')](handleError(_0x4903f2,null));};exports['show']=function(_0x1cf316,_0x279df2){var _0x5d405f={'raw':![],'where':{'id':_0x1cf316[_0xedeb('0x5d')]['id']},'include':[{'model':db[_0xedeb('0x3f')],'as':_0xedeb('0x40')}]},_0x5e158d={};_0x5e158d[_0xedeb('0x45')]=_[_0xedeb('0x47')](db[_0xedeb('0x41')][_0xedeb('0x42')]);_0x5e158d[_0xedeb('0x4c')]=_[_0xedeb('0x47')](_0x1cf316[_0xedeb('0x4c')]);_0x5e158d[_0xedeb('0x52')]=_['intersection'](_0x5e158d['model'],_0x5e158d[_0xedeb('0x4c')]);_0x5d405f[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0x5e158d[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x1cf316[_0xedeb('0x4c')][_0xedeb('0x4a')]));_0x5d405f[_0xedeb('0x49')]=_0x5d405f[_0xedeb('0x49')][_0xedeb('0x4b')]?_0x5d405f[_0xedeb('0x49')]:_0x5e158d['model'];if(_0x1cf316['query'][_0xedeb('0x58')]){_0x5d405f[_0xedeb('0x59')]=[{'all':!![]}];}_0x5d405f=_['merge']({},_0x5d405f,_0x1cf316[_0xedeb('0x57')]);return db[_0xedeb('0x41')][_0xedeb('0x5e')](_0x5d405f)[_0xedeb('0x1f')](handleEntityNotFound(_0x279df2,null))[_0xedeb('0x1f')](respondWithResult(_0x279df2,null))['catch'](handleError(_0x279df2,null));};exports[_0xedeb('0x5f')]=function(_0x45097a,_0x302aec){return db[_0xedeb('0x41')][_0xedeb('0x5f')](_0x45097a[_0xedeb('0x60')],{})['then'](function(_0x511f17){var _0x5e0a0a=_0x45097a[_0xedeb('0x61')][_0xedeb('0x38')]({'plain':!![]});if(!_0x5e0a0a)throw new Error(_0xedeb('0x62'));if(_0x5e0a0a['role']===_0xedeb('0x61')){var _0x511450=_0x511f17[_0xedeb('0x38')]({'plain':!![]});var _0x3a969a=_0xedeb('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x3a969a,'userProfileId':_0x5e0a0a['userProfileId']},'raw':!![]})['then'](function(_0x407f2b){if(_0x407f2b&&_0x407f2b['autoAssociation']===0x0){return db[_0xedeb('0x3a')][_0xedeb('0x5f')]({'name':_0x511450[_0xedeb('0x3c')],'resourceId':_0x511450['id'],'type':_0x407f2b[_0xedeb('0x3c')],'sectionId':_0x407f2b['id']},{})[_0xedeb('0x1f')](function(){return _0x511f17;});}else{return _0x511f17;}})[_0xedeb('0x5c')](function(_0x256877){logger[_0xedeb('0x26')](_0xedeb('0x63'),_0x256877);throw _0x256877;});}return _0x511f17;})[_0xedeb('0x1f')](respondWithResult(_0x302aec,0xc9))[_0xedeb('0x5c')](handleError(_0x302aec,null));};exports['update']=function(_0x157e7a,_0x532208){if(_0x157e7a[_0xedeb('0x60')]['id']){delete _0x157e7a['body']['id'];}return db[_0xedeb('0x41')]['find']({'where':{'id':_0x157e7a[_0xedeb('0x5d')]['id']},'include':[{'model':db[_0xedeb('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xedeb('0x1f')](handleEntityNotFound(_0x532208,null))[_0xedeb('0x1f')](saveUpdates(_0x157e7a['body'],null))[_0xedeb('0x1f')](respondWithResult(_0x532208,null))['catch'](handleError(_0x532208,null));};exports[_0xedeb('0x37')]=function(_0x51eb38,_0x501e83){return db[_0xedeb('0x41')][_0xedeb('0x5e')]({'where':{'id':_0x51eb38[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x501e83,null))[_0xedeb('0x1f')](removeEntity(_0x501e83,null))['catch'](handleError(_0x501e83,null));};exports[_0xedeb('0x64')]=function(_0x45f666,_0x5e6514){return db[_0xedeb('0x41')][_0xedeb('0x64')]()[_0xedeb('0x1f')](respondWithResult(_0x5e6514,null))[_0xedeb('0x5c')](handleError(_0x5e6514,null));};exports['addDisposition']=function(_0x5c3c1c,_0x575985,_0x2c494b){if(_0x5c3c1c[_0xedeb('0x60')]['id']){delete _0x5c3c1c[_0xedeb('0x60')]['id'];}return db[_0xedeb('0x41')][_0xedeb('0x5e')]({'where':{'id':_0x5c3c1c[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x575985,null))[_0xedeb('0x1f')](function(_0x4a27b7){if(_0x4a27b7){_0x5c3c1c[_0xedeb('0x60')][_0xedeb('0x65')]=_0x4a27b7['id'];return db[_0xedeb('0x66')][_0xedeb('0x5f')](_0x5c3c1c[_0xedeb('0x60')]);}})[_0xedeb('0x1f')](respondWithResult(_0x575985,null))[_0xedeb('0x5c')](handleError(_0x575985,null));};exports[_0xedeb('0x67')]=function(_0x210df4,_0x4e8f91,_0x389bd1){var _0xb9a42b={'raw':![],'where':{}};var _0x3d78bc={};var _0x1d4094={'count':0x0,'rows':[]};return db[_0xedeb('0x41')][_0xedeb('0x68')]({'where':{'id':_0x210df4[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x4e8f91,null))[_0xedeb('0x1f')](function(_0x38d293){if(_0x38d293){_0x3d78bc[_0xedeb('0x45')]=_[_0xedeb('0x47')](db['Disposition'][_0xedeb('0x42')]);_0x3d78bc[_0xedeb('0x4c')]=_[_0xedeb('0x47')](_0x210df4[_0xedeb('0x4c')]);_0x3d78bc[_0xedeb('0x52')]=_[_0xedeb('0x48')](_0x3d78bc[_0xedeb('0x45')],_0x3d78bc[_0xedeb('0x4c')]);_0xb9a42b[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0x3d78bc[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x210df4[_0xedeb('0x4c')][_0xedeb('0x4a')]));_0xb9a42b[_0xedeb('0x49')]=_0xb9a42b[_0xedeb('0x49')][_0xedeb('0x4b')]?_0xb9a42b[_0xedeb('0x49')]:_0x3d78bc[_0xedeb('0x45')];if(!_0x210df4[_0xedeb('0x4c')]['hasOwnProperty'](_0xedeb('0x4e'))){_0xb9a42b[_0xedeb('0x30')]=qs[_0xedeb('0x30')](_0x210df4[_0xedeb('0x4c')][_0xedeb('0x30')]);_0xb9a42b[_0xedeb('0x2e')]=qs[_0xedeb('0x2e')](_0x210df4['query']['offset']);}_0xb9a42b[_0xedeb('0x4f')]=qs[_0xedeb('0x50')](_0x210df4[_0xedeb('0x4c')][_0xedeb('0x50')]);_0xb9a42b[_0xedeb('0x51')]=qs['filters'](_[_0xedeb('0x53')](_0x210df4[_0xedeb('0x4c')],_0x3d78bc['filters']));_0xb9a42b[_0xedeb('0x51')][_0xedeb('0x65')]=_0x38d293['id'];if(_0x210df4[_0xedeb('0x4c')][_0xedeb('0x54')]){_0xb9a42b[_0xedeb('0x51')]=_[_0xedeb('0x55')](_0xb9a42b[_0xedeb('0x51')],{'$or':_[_0xedeb('0x46')](_0xb9a42b[_0xedeb('0x49')],function(_0x25ef6f){var _0x433d2d={};_0x433d2d[_0x25ef6f]={'$like':'%'+_0x210df4[_0xedeb('0x4c')][_0xedeb('0x54')]+'%'};return _0x433d2d;})});}_0xb9a42b=_[_0xedeb('0x55')]({},_0xb9a42b,_0x210df4['options']);return db[_0xedeb('0x66')][_0xedeb('0x69')]({'where':_0xb9a42b[_0xedeb('0x51')]})['then'](function(_0x11ef28){_0x1d4094['count']=_0x11ef28;if(_0x210df4[_0xedeb('0x4c')][_0xedeb('0x58')]){_0xb9a42b['include']=[{'all':!![]}];}return db[_0xedeb('0x66')][_0xedeb('0x5a')](_0xb9a42b);})[_0xedeb('0x1f')](function(_0x50e7f4){_0x1d4094[_0xedeb('0x5b')]=_0x50e7f4;return _0x1d4094;});}})[_0xedeb('0x1f')](respondWithFilteredResult(_0x4e8f91,_0xb9a42b))['catch'](handleError(_0x4e8f91,null));};exports[_0xedeb('0x6a')]=function(_0x3d50af,_0x497eb6,_0x95cf3f){return db[_0xedeb('0x41')][_0xedeb('0x5e')]({'where':{'id':_0x3d50af['params']['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x497eb6,null))[_0xedeb('0x1f')](function(_0x53c406){if(_0x53c406){return _0x53c406[_0xedeb('0x6a')](_0x3d50af[_0xedeb('0x4c')][_0xedeb('0x6b')]);}})[_0xedeb('0x1f')](respondWithStatusCode(_0x497eb6,null))['catch'](handleError(_0x497eb6,null));};exports['addAnswer']=function(_0x2efdb8,_0x1c81c0,_0x2c25d4){if(_0x2efdb8[_0xedeb('0x60')]['id']){delete _0x2efdb8[_0xedeb('0x60')]['id'];}return db['OpenchannelAccount'][_0xedeb('0x5e')]({'where':{'id':_0x2efdb8[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x1c81c0,null))[_0xedeb('0x1f')](function(_0x5e13ec){if(_0x5e13ec){_0x2efdb8[_0xedeb('0x60')][_0xedeb('0x65')]=_0x5e13ec['id'];return db[_0xedeb('0x6c')][_0xedeb('0x5f')](_0x2efdb8[_0xedeb('0x60')]);}})[_0xedeb('0x1f')](respondWithResult(_0x1c81c0,null))[_0xedeb('0x5c')](handleError(_0x1c81c0,null));};exports['getAnswers']=function(_0x24251c,_0x5b93bf,_0x1eba66){var _0x549001={'raw':![],'where':{}};var _0x373e62={};var _0x584d13={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xedeb('0x68')]({'where':{'id':_0x24251c[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x5b93bf,null))['then'](function(_0x5ce5fd){if(_0x5ce5fd){_0x373e62[_0xedeb('0x45')]=_[_0xedeb('0x47')](db[_0xedeb('0x6c')][_0xedeb('0x42')]);_0x373e62[_0xedeb('0x4c')]=_[_0xedeb('0x47')](_0x24251c[_0xedeb('0x4c')]);_0x373e62[_0xedeb('0x52')]=_[_0xedeb('0x48')](_0x373e62[_0xedeb('0x45')],_0x373e62['query']);_0x549001[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0x373e62[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x24251c[_0xedeb('0x4c')][_0xedeb('0x4a')]));_0x549001[_0xedeb('0x49')]=_0x549001[_0xedeb('0x49')][_0xedeb('0x4b')]?_0x549001[_0xedeb('0x49')]:_0x373e62[_0xedeb('0x45')];if(!_0x24251c[_0xedeb('0x4c')][_0xedeb('0x4d')](_0xedeb('0x4e'))){_0x549001[_0xedeb('0x30')]=qs[_0xedeb('0x30')](_0x24251c[_0xedeb('0x4c')][_0xedeb('0x30')]);_0x549001[_0xedeb('0x2e')]=qs[_0xedeb('0x2e')](_0x24251c['query'][_0xedeb('0x2e')]);}_0x549001[_0xedeb('0x4f')]=qs[_0xedeb('0x50')](_0x24251c[_0xedeb('0x4c')][_0xedeb('0x50')]);_0x549001[_0xedeb('0x51')]=qs[_0xedeb('0x52')](_[_0xedeb('0x53')](_0x24251c[_0xedeb('0x4c')],_0x373e62[_0xedeb('0x52')]));_0x549001['where']['OpenchannelAccountId']=_0x5ce5fd['id'];if(_0x24251c[_0xedeb('0x4c')][_0xedeb('0x54')]){_0x549001[_0xedeb('0x51')]=_[_0xedeb('0x55')](_0x549001[_0xedeb('0x51')],{'$or':_[_0xedeb('0x46')](_0x549001[_0xedeb('0x49')],function(_0x4d3a3b){var _0x94187a={};_0x94187a[_0x4d3a3b]={'$like':'%'+_0x24251c[_0xedeb('0x4c')][_0xedeb('0x54')]+'%'};return _0x94187a;})});}_0x549001=_[_0xedeb('0x55')]({},_0x549001,_0x24251c['options']);return db[_0xedeb('0x6c')][_0xedeb('0x69')]({'where':_0x549001['where']})[_0xedeb('0x1f')](function(_0xd0c36a){_0x584d13[_0xedeb('0x69')]=_0xd0c36a;if(_0x24251c[_0xedeb('0x4c')][_0xedeb('0x58')]){_0x549001[_0xedeb('0x59')]=[{'all':!![]}];}return db[_0xedeb('0x6c')][_0xedeb('0x5a')](_0x549001);})[_0xedeb('0x1f')](function(_0x47feb7){_0x584d13[_0xedeb('0x5b')]=_0x47feb7;return _0x584d13;});}})[_0xedeb('0x1f')](respondWithFilteredResult(_0x5b93bf,_0x549001))[_0xedeb('0x5c')](handleError(_0x5b93bf,null));};exports[_0xedeb('0x6d')]=function(_0x29b7d7,_0x5acbae,_0x3ed622){return db[_0xedeb('0x41')]['find']({'where':{'id':_0x29b7d7[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x5acbae,null))[_0xedeb('0x1f')](function(_0x5379ae){if(_0x5379ae){return _0x5379ae['removeAnswers'](_0x29b7d7['query'][_0xedeb('0x6b')]);}})[_0xedeb('0x1f')](respondWithStatusCode(_0x5acbae,null))[_0xedeb('0x5c')](handleError(_0x5acbae,null));};exports[_0xedeb('0x6e')]=function(_0x1bac92,_0x2f8ffa,_0x3cdd8f){var _0x594f38={'body':_0x1bac92['body'],'channel':'openchannel'};var _0x3e9b5b=[];var _0x20e16f=[];var _0x419420={};var _0x119617=![];return db[_0xedeb('0x6f')][_0xedeb('0x64')]()[_0xedeb('0x1f')](function(_0x416b08){if(!_0x416b08){throw new db[(_0xedeb('0x70'))][(_0xedeb('0x71'))](_0xedeb('0x72'));}_0x3e9b5b=_['difference'](_[_0xedeb('0x47')](_0x416b08),[_0xedeb('0x73'),'updatedAt']);_0x20e16f=_['difference'](_[_0xedeb('0x47')](_0x416b08),[_0xedeb('0x73'),_0xedeb('0x74'),_0xedeb('0x75'),_0xedeb('0x76')]);if(_0x1bac92[_0xedeb('0x60')]['id']){delete _0x1bac92[_0xedeb('0x60')]['id'];}if(_[_0xedeb('0x77')](_0x1bac92[_0xedeb('0x60')][_0xedeb('0x78')])){throw new db[(_0xedeb('0x70'))][(_0xedeb('0x71'))](_0xedeb('0x79'));}if(_[_0xedeb('0x77')](_0x1bac92[_0xedeb('0x60')]['body'])||_0x1bac92[_0xedeb('0x60')][_0xedeb('0x60')]===''){throw new db[(_0xedeb('0x70'))][(_0xedeb('0x71'))](_0xedeb('0x7a'));}if(_[_0xedeb('0x77')](_0x1bac92[_0xedeb('0x60')]['mapKey'])){throw new db['Sequelize'][(_0xedeb('0x71'))](_0xedeb('0x7b')+_0x20e16f);}if(!_['includes'](_0x20e16f,_0x1bac92[_0xedeb('0x60')][_0xedeb('0x7c')])){throw new db[(_0xedeb('0x70'))][(_0xedeb('0x71'))](_0xedeb('0x7d')+_0x20e16f);}_0x419420[_0x1bac92[_0xedeb('0x60')][_0xedeb('0x7c')]]=_0x1bac92[_0xedeb('0x60')]['from'];})[_0xedeb('0x1f')](function(){return db[_0xedeb('0x41')][_0xedeb('0x5e')]({'where':{'id':_0x1bac92[_0xedeb('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0xedeb('0x7e'),'include':[{'model':db[_0xedeb('0x6f')],'as':_0xedeb('0x7f'),'where':_0x419420,'limit':0x1,'order':[[_0xedeb('0x74'),_0xedeb('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x2f8ffa,null))[_0xedeb('0x1f')](function(_0x2f0f0e){if(_0x2f0f0e&&_0x2f0f0e[_0xedeb('0x7e')]){_0x594f38[_0xedeb('0x81')]=_0x2f0f0e;_0x594f38[_0xedeb('0x82')]=_0x2f0f0e[_0xedeb('0x83')];_0x594f38['list']=_0x2f0f0e[_0xedeb('0x7e')];_0x594f38[_0xedeb('0x82')]=_[_0xedeb('0x84')](_0x594f38['applications'],['priority'],['asc']);if(_0x594f38[_0xedeb('0x81')][_0xedeb('0x83')]){delete _0x594f38['account'][_0xedeb('0x83')];}if(_0x594f38[_0xedeb('0x81')][_0xedeb('0x7e')]&&_0x594f38[_0xedeb('0x81')][_0xedeb('0x7e')][_0xedeb('0x7f')]['length']){return _0x594f38[_0xedeb('0x81')]['List']['Contacts'][0x0];}var _0x1b8b62=_[_0xedeb('0x17')](_0x1bac92[_0xedeb('0x60')],{'firstName':_0x1bac92['body'][_0xedeb('0x78')],'ListId':_0x2f0f0e[_0xedeb('0x76')]});_0x1b8b62[_0x1bac92[_0xedeb('0x60')][_0xedeb('0x7c')]]=_0x1bac92[_0xedeb('0x60')][_0xedeb('0x78')];return db[_0xedeb('0x6f')]['create'](_0x1b8b62,{'fields':_0x3e9b5b,'raw':!![]});}})['then'](handleEntityNotFound(_0x2f8ffa,null))[_0xedeb('0x1f')](function(_0xa26750){_0x594f38['contact']=_0xa26750;if(_0xa26750){var _0x43cc97={'ContactId':_0xa26750['id'],'OpenchannelAccountId':_0x1bac92[_0xedeb('0x5d')]['id'],'from':(_0xa26750[_0xedeb('0x85')]||'')+'\x20'+(_0xa26750[_0xedeb('0x86')]||'')};var _0x43af74={'OpenchannelAccountId':_0x1bac92[_0xedeb('0x5d')]['id'],'closed':![]};if(_0x1bac92[_0xedeb('0x60')][_0xedeb('0x87')]){_0x43af74[_0xedeb('0x87')]=_0x1bac92[_0xedeb('0x60')][_0xedeb('0x87')];return db[_0xedeb('0x88')][_0xedeb('0x5e')]({'where':_0x43af74})[_0xedeb('0x1f')](function(_0x48fd4b){if(_0x48fd4b){return[_0x48fd4b,![]];}_0x43cc97[_0xedeb('0x87')]=_0x1bac92[_0xedeb('0x60')][_0xedeb('0x87')];_0x43cc97[_0xedeb('0x89')]=_0x1bac92['body'][_0xedeb('0x89')];return db[_0xedeb('0x88')]['create'](_0x43cc97)[_0xedeb('0x1f')](function(_0x249030){return[_0x249030,!![]];});});}else{_0x43af74[_0xedeb('0x87')]=null;}_0x43af74['ContactId']=_0xa26750['id'];return db[_0xedeb('0x88')]['find']({'where':_0x43af74})[_0xedeb('0x1f')](function(_0x1c1e10){if(_0x1c1e10){return[_0x1c1e10,![]];}return db[_0xedeb('0x88')][_0xedeb('0x5f')](_0x43cc97)[_0xedeb('0x1f')](function(_0x466ebd){return[_0x466ebd,!![]];});});}})[_0xedeb('0x8a')](function(_0xc53ee6,_0x33b61e){if(_0xc53ee6){_0x119617=_0x33b61e;if(!_0x33b61e){var _0x5b20cb={'from':(_0x594f38[_0xedeb('0x8b')][_0xedeb('0x85')]||'')+'\x20'+(_0x594f38[_0xedeb('0x8b')][_0xedeb('0x86')]||'')};if(_0x1bac92[_0xedeb('0x60')]['threadId']&&_0x1bac92[_0xedeb('0x60')]['messageId']&&_0x1bac92[_0xedeb('0x60')][_0xedeb('0x87')]!=_0x1bac92[_0xedeb('0x60')][_0xedeb('0x8c')]){_0x5b20cb['threadId']=_0x1bac92['body'][_0xedeb('0x8c')];}return _0xc53ee6[_0xedeb('0x36')](_0x5b20cb);}else{return _0xc53ee6;}}})[_0xedeb('0x1f')](function(_0x527b34){_0x594f38[_0xedeb('0x8d')]=_0x527b34[_0xedeb('0x38')]({'plain':!![]});_0x594f38[_0xedeb('0x8d')][_0xedeb('0x8e')]=_0x119617;if(_0x594f38[_0xedeb('0x8d')][_0xedeb('0x8e')]){if(_0x594f38[_0xedeb('0x81')][_0xedeb('0x8f')]){_0x594f38[_0xedeb('0x82')][_0xedeb('0x90')]({'id':0x0,'priority':_0x594f38[_0xedeb('0x82')][_0xedeb('0x4b')]+0x1,'app':_0xedeb('0x91'),'appdata':_0xedeb('0x92'),'interval':_0xedeb('0x93')});}}return db[_0xedeb('0x94')][_0xedeb('0x5f')]({'body':_0x1bac92[_0xedeb('0x60')][_0xedeb('0x60')],'OpenchannelAccountId':_0x1bac92[_0xedeb('0x5d')]['id'],'OpenchannelInteractionId':_0x527b34['id'],'direction':'in','ContactId':_0x594f38[_0xedeb('0x8b')]['id'],'AttachmentId':_0x1bac92['body'][_0xedeb('0x95')]});})[_0xedeb('0x1f')](function(_0x61a8d1){_0x594f38[_0xedeb('0x28')]=_0x61a8d1;if(!_0x594f38[_0xedeb('0x8d')]['UserId'])return;return db[_0xedeb('0x96')][_0xedeb('0x5e')]({'attributes':['id','name'],'where':{'id':_0x594f38[_0xedeb('0x8d')]['UserId']}});})[_0xedeb('0x1f')](function(_0x2fa2c6){if(_0x2fa2c6){_0x594f38[_0xedeb('0x82')][_0xedeb('0x97')]({'id':0x0,'priority':0x0,'app':_0xedeb('0x98'),'appdata':_0x2fa2c6[_0xedeb('0x3c')]+','+(_0x594f38[_0xedeb('0x81')][_0xedeb('0x99')]||0xa),'interval':_0xedeb('0x93')});}if(!_0x594f38[_0xedeb('0x8d')][_0xedeb('0x9a')])return;return db[_0xedeb('0x9b')]['find']({'attributes':['id',_0xedeb('0x3c')],'where':{'id':_0x594f38[_0xedeb('0x8d')]['queueId']}});})[_0xedeb('0x1f')](function(_0xcec504){if(_0xcec504){_0x594f38[_0xedeb('0x82')][_0xedeb('0x97')]({'id':0x0,'priority':0x1,'app':_0xedeb('0x9c'),'appdata':_0xcec504[_0xedeb('0x3c')]+','+(_0x594f38[_0xedeb('0x81')][_0xedeb('0x9d')]||0x12c),'interval':_0xedeb('0x93')});}return respondWithRpcPromise('Start',_0xedeb('0x9e'),_0x594f38);})['then'](function(_0x2d59b5){respondWithRpcPromise(_0xedeb('0x9f'),_0xedeb('0x9f'),{'event':_0xedeb('0x6e'),'message':_0x2d59b5},client9002);return _0x2d59b5;})['then'](respondWithResult(_0x2f8ffa,null))['catch'](handleError(_0x2f8ffa,null));};exports[_0xedeb('0xa0')]=function(_0x11f30e,_0x19a85f){var _0x23eff4=_0x11f30e[_0xedeb('0x5d')]['id'];var _0x1751b9=_0x11f30e[_0xedeb('0x60')];var _0x3eae95=0xc8;var _0x2b3b5f=null;return db[_0xedeb('0xa1')][_0xedeb('0xa2')]({'isolationLevel':db['sequelize'][_0xedeb('0xa3')][_0xedeb('0xa4')][_0xedeb('0xa5')]},function(_0x56a6aa){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x23eff4},'transaction':_0x56a6aa})[_0xedeb('0x1f')](function(_0xa66d9){if(_0xa66d9){return db[_0xedeb('0xa6')][_0xedeb('0x37')]({'where':{'OpenchannelAccountId':_0x23eff4},'transaction':_0x56a6aa})[_0xedeb('0x1f')](function(){var _0x4d6f2d=_[_0xedeb('0x46')](_0x1751b9,function(_0x46e8be){_0x46e8be[_0xedeb('0x65')]=_0x23eff4;return _0x46e8be;});return db[_0xedeb('0xa6')][_0xedeb('0xa7')](_0x4d6f2d,{'transaction':_0x56a6aa});});}else{_0x3eae95=0x194;_0x2b3b5f=[];}});})['then'](function(){if(_0x3eae95!==0x194){return db['OpenchannelApplication'][_0xedeb('0xa8')]({'where':{'OpenchannelAccountId':_0x23eff4},'order':'priority'})[_0xedeb('0x1f')](function(_0x1aae6a){_0x2b3b5f=_0x1aae6a;});}})[_0xedeb('0x5c')](function(_0x16f7c7){_0x3eae95=0x1f4;logger[_0xedeb('0x26')](_0x16f7c7['stack']);if(_0x16f7c7[_0xedeb('0x3c')]){delete _0x16f7c7['name'];}_0x2b3b5f=_0x16f7c7;})[_0xedeb('0xa9')](function(){if(_0x2b3b5f===null){_0x19a85f[_0xedeb('0x2a')](_0x3eae95);}else{if(_0x3eae95===0x1f4){_0x19a85f[_0xedeb('0x2b')](_0x3eae95)[_0xedeb('0x3d')](_0x2b3b5f);}else{_0x19a85f['status'](_0x3eae95)[_0xedeb('0x2d')](_0x2b3b5f);}}});};exports[_0xedeb('0xaa')]=function(_0x3949ff,_0x2d18aa,_0x50e85a){var _0x1d53c7={};var _0x3dbe03={};var _0x437d8f;var _0x20a16e;return db['OpenchannelAccount'][_0xedeb('0x68')]({'where':{'id':_0x3949ff[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x2d18aa,null))[_0xedeb('0x1f')](function(_0x3572da){if(_0x3572da){_0x437d8f=_0x3572da;_0x3dbe03[_0xedeb('0x45')]=_[_0xedeb('0x47')](db[_0xedeb('0xa6')][_0xedeb('0x42')]);_0x3dbe03['query']=_[_0xedeb('0x47')](_0x3949ff['query']);_0x3dbe03['filters']=_['intersection'](_0x3dbe03[_0xedeb('0x45')],_0x3dbe03[_0xedeb('0x4c')]);_0x1d53c7[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0x3dbe03[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x3949ff[_0xedeb('0x4c')][_0xedeb('0x4a')]));_0x1d53c7[_0xedeb('0x49')]=_0x1d53c7[_0xedeb('0x49')][_0xedeb('0x4b')]?_0x1d53c7[_0xedeb('0x49')]:_0x3dbe03[_0xedeb('0x45')];_0x1d53c7[_0xedeb('0x4f')]=qs[_0xedeb('0x50')](_0x3949ff['query'][_0xedeb('0x50')]);_0x1d53c7[_0xedeb('0x51')]=qs[_0xedeb('0x52')](_['pick'](_0x3949ff['query'],_0x3dbe03['filters']));if(_0x3949ff[_0xedeb('0x4c')]['filter']){_0x1d53c7['where']=_[_0xedeb('0x55')](_0x1d53c7[_0xedeb('0x51')],{'$or':_[_0xedeb('0x46')](_0x1d53c7['attributes'],function(_0x27955c){var _0x4b160f={};_0x4b160f[_0x27955c]={'$like':'%'+_0x3949ff[_0xedeb('0x4c')][_0xedeb('0x54')]+'%'};return _0x4b160f;})});}_0x1d53c7=_[_0xedeb('0x55')]({},_0x1d53c7,_0x3949ff[_0xedeb('0x57')]);return _0x437d8f[_0xedeb('0xaa')](_0x1d53c7);}})[_0xedeb('0x1f')](function(_0xbbc378){if(_0xbbc378){_0x20a16e=_0xbbc378[_0xedeb('0x4b')];if(!_0x3949ff[_0xedeb('0x4c')]['hasOwnProperty'](_0xedeb('0x4e'))){_0x1d53c7['limit']=qs[_0xedeb('0x30')](_0x3949ff[_0xedeb('0x4c')][_0xedeb('0x30')]);_0x1d53c7[_0xedeb('0x2e')]=qs['offset'](_0x3949ff[_0xedeb('0x4c')][_0xedeb('0x2e')]);}return _0x437d8f[_0xedeb('0xaa')](_0x1d53c7);}})[_0xedeb('0x1f')](function(_0x5a4839){if(_0x5a4839){return _0x5a4839?{'count':_0x20a16e,'rows':_0x5a4839}:null;}})[_0xedeb('0x1f')](respondWithResult(_0x2d18aa,null))[_0xedeb('0x5c')](handleError(_0x2d18aa,null));};exports[_0xedeb('0xab')]=function(_0x4b9b7c,_0x413275,_0x4b53ac){var _0x4e3d0f={'raw':![],'where':{}};var _0xb2d85f={};var _0x36d154={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xedeb('0x68')]({'where':{'id':_0x4b9b7c[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x413275,null))[_0xedeb('0x1f')](function(_0x306094){if(_0x306094){_0xb2d85f[_0xedeb('0x45')]=_[_0xedeb('0x47')](db[_0xedeb('0x88')][_0xedeb('0x42')]);_0xb2d85f[_0xedeb('0x4c')]=_[_0xedeb('0x47')](_0x4b9b7c[_0xedeb('0x4c')]);_0xb2d85f[_0xedeb('0x52')]=_[_0xedeb('0x48')](_0xb2d85f[_0xedeb('0x45')],_0xb2d85f[_0xedeb('0x4c')]);_0x4e3d0f[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0xb2d85f[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x4b9b7c[_0xedeb('0x4c')][_0xedeb('0x4a')]));_0x4e3d0f[_0xedeb('0x49')]=_0x4e3d0f[_0xedeb('0x49')]['length']?_0x4e3d0f[_0xedeb('0x49')]:_0xb2d85f[_0xedeb('0x45')];if(!_0x4b9b7c['query'][_0xedeb('0x4d')](_0xedeb('0x4e'))){_0x4e3d0f[_0xedeb('0x30')]=qs['limit'](_0x4b9b7c['query'][_0xedeb('0x30')]);_0x4e3d0f['offset']=qs[_0xedeb('0x2e')](_0x4b9b7c[_0xedeb('0x4c')]['offset']);}_0x4e3d0f[_0xedeb('0x4f')]=qs['sort'](_0x4b9b7c[_0xedeb('0x4c')][_0xedeb('0x50')]);_0x4e3d0f[_0xedeb('0x51')]=qs[_0xedeb('0x52')](_[_0xedeb('0x53')](_0x4b9b7c['query'],_0xb2d85f[_0xedeb('0x52')]));_0x4e3d0f['where'][_0xedeb('0x65')]=_0x306094['id'];if(_0x4b9b7c['query'][_0xedeb('0x54')]){_0x4e3d0f[_0xedeb('0x51')]=_[_0xedeb('0x55')](_0x4e3d0f[_0xedeb('0x51')],{'$or':_[_0xedeb('0x46')](_0x4e3d0f[_0xedeb('0x49')],function(_0x4b02f8){var _0xaed431={};_0xaed431[_0x4b02f8]={'$like':'%'+_0x4b9b7c[_0xedeb('0x4c')][_0xedeb('0x54')]+'%'};return _0xaed431;})});}_0x4e3d0f=_['merge']({},_0x4e3d0f,_0x4b9b7c[_0xedeb('0x57')]);return db[_0xedeb('0x88')][_0xedeb('0x69')]({'where':_0x4e3d0f[_0xedeb('0x51')]})[_0xedeb('0x1f')](function(_0x8add00){_0x36d154[_0xedeb('0x69')]=_0x8add00;if(_0x4b9b7c[_0xedeb('0x4c')][_0xedeb('0x58')]){_0x4e3d0f[_0xedeb('0x59')]=[{'model':db[_0xedeb('0x6f')],'as':'Contact','required':![]},{'model':db[_0xedeb('0x96')],'as':_0xedeb('0xac'),'attributes':[_0xedeb('0x3c'),_0xedeb('0xad'),_0xedeb('0xae')],'required':![]},{'model':db[_0xedeb('0xaf')],'as':'Tags','attributes':['id',_0xedeb('0x3c'),'color'],'where':_0x4b9b7c[_0xedeb('0x4c')][_0xedeb('0xb0')]?{'id':_0x4b9b7c['query'][_0xedeb('0xb0')]}:undefined,'required':_0x4b9b7c[_0xedeb('0x4c')][_0xedeb('0xb0')]?!![]:![]}];}return db[_0xedeb('0x88')][_0xedeb('0x5a')](_0x4e3d0f);})['then'](function(_0x2840c0){_0x36d154['rows']=_0x2840c0;return _0x36d154;});}})[_0xedeb('0x1f')](respondWithFilteredResult(_0x413275,_0x4e3d0f))[_0xedeb('0x5c')](handleError(_0x413275,null));};exports['addAgents']=function(_0x4e4802,_0x1e2e6c,_0x3e16c4){return db[_0xedeb('0x41')][_0xedeb('0x5e')]({'where':{'id':_0x4e4802[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x1e2e6c,null))[_0xedeb('0x1f')](function(_0x32af8f){if(_0x32af8f){return _0x32af8f['addAgents'](_0x4e4802[_0xedeb('0x60')][_0xedeb('0x6b')],_[_0xedeb('0xb1')](_0x4e4802[_0xedeb('0x60')],[_0xedeb('0x6b'),'id'])||{})[_0xedeb('0x8a')](function(_0x399218){for(var _0x56d864=0x0;_0x56d864<_0x4e4802[_0xedeb('0x60')][_0xedeb('0x6b')][_0xedeb('0x4b')];_0x56d864+=0x1){socket[_0xedeb('0xb2')](_0xedeb('0xb3'),{'UserId':Number(_0x4e4802[_0xedeb('0x60')][_0xedeb('0x6b')][_0x56d864]),'OpenchannelAccountId':Number(_0x4e4802[_0xedeb('0x5d')]['id'])});}return _0x399218;});}})[_0xedeb('0x1f')](respondWithResult(_0x1e2e6c,null))[_0xedeb('0x5c')](handleError(_0x1e2e6c,null));};exports['removeAgents']=function(_0x27b90d,_0x451198,_0x256436){return db[_0xedeb('0x41')]['find']({'where':{'id':_0x27b90d[_0xedeb('0x5d')]['id']}})['then'](handleEntityNotFound(_0x451198,null))[_0xedeb('0x1f')](function(_0x59e0e8){if(_0x59e0e8){return _0x59e0e8['removeAgents'](_0x27b90d[_0xedeb('0x4c')][_0xedeb('0x6b')])[_0xedeb('0x1f')](function(){if(_[_0xedeb('0xb4')](_0x27b90d['query']['ids'])){for(var _0x396c2c=0x0;_0x396c2c<_0x27b90d['query']['ids']['length'];_0x396c2c+=0x1){socket[_0xedeb('0xb2')](_0xedeb('0xb5'),{'UserId':Number(_0x27b90d['query'][_0xedeb('0x6b')][_0x396c2c]),'OpenchannelAccountId':Number(_0x27b90d[_0xedeb('0x5d')]['id'])});}}else{socket[_0xedeb('0xb2')](_0xedeb('0xb5'),{'UserId':Number(_0x27b90d[_0xedeb('0x4c')][_0xedeb('0x6b')]),'OpenchannelAccountId':Number(_0x27b90d['params']['id'])});}});}})[_0xedeb('0x1f')](respondWithStatusCode(_0x451198,null))['catch'](handleError(_0x451198,null));};exports[_0xedeb('0xb6')]=function(_0x92e1f6,_0x1f4138,_0x1b3ae1){var _0x5b5059={};var _0x181e3b={};var _0xd35965;var _0x126ca6;return db[_0xedeb('0x41')][_0xedeb('0x68')]({'where':{'id':_0x92e1f6['params']['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x1f4138,null))[_0xedeb('0x1f')](function(_0x2f960b){if(_0x2f960b){_0xd35965=_0x2f960b;_0x181e3b[_0xedeb('0x45')]=_[_0xedeb('0x47')](db[_0xedeb('0x96')][_0xedeb('0x42')]);_0x181e3b[_0xedeb('0x4c')]=_[_0xedeb('0x47')](_0x92e1f6[_0xedeb('0x4c')]);_0x181e3b['filters']=_[_0xedeb('0x48')](_0x181e3b[_0xedeb('0x45')],_0x181e3b[_0xedeb('0x4c')]);_0x5b5059[_0xedeb('0x49')]=_[_0xedeb('0x48')](_0x181e3b[_0xedeb('0x45')],qs[_0xedeb('0x4a')](_0x92e1f6[_0xedeb('0x4c')][_0xedeb('0x4a')]));_0x5b5059['attributes']=_0x5b5059[_0xedeb('0x49')][_0xedeb('0x4b')]?_0x5b5059['attributes']:_0x181e3b[_0xedeb('0x45')];_0x5b5059[_0xedeb('0x4f')]=qs[_0xedeb('0x50')](_0x92e1f6['query'][_0xedeb('0x50')]);_0x5b5059[_0xedeb('0x51')]=qs[_0xedeb('0x52')](_['pick'](_0x92e1f6[_0xedeb('0x4c')],_0x181e3b[_0xedeb('0x52')]));if(_0x92e1f6[_0xedeb('0x4c')][_0xedeb('0x54')]){_0x5b5059[_0xedeb('0x51')]=_[_0xedeb('0x55')](_0x5b5059['where'],{'$or':_[_0xedeb('0x46')](_0x5b5059[_0xedeb('0x49')],function(_0x70546c){var _0x42bff8={};_0x42bff8[_0x70546c]={'$like':'%'+_0x92e1f6[_0xedeb('0x4c')][_0xedeb('0x54')]+'%'};return _0x42bff8;})});}_0x5b5059=_[_0xedeb('0x55')]({},_0x5b5059,_0x92e1f6[_0xedeb('0x57')]);return _0xd35965[_0xedeb('0xb6')](_0x5b5059);}})[_0xedeb('0x1f')](function(_0x3a927a){if(_0x3a927a){_0x126ca6=_0x3a927a[_0xedeb('0x4b')];if(!_0x92e1f6[_0xedeb('0x4c')][_0xedeb('0x4d')](_0xedeb('0x4e'))){_0x5b5059[_0xedeb('0x30')]=qs[_0xedeb('0x30')](_0x92e1f6[_0xedeb('0x4c')][_0xedeb('0x30')]);_0x5b5059[_0xedeb('0x2e')]=qs[_0xedeb('0x2e')](_0x92e1f6[_0xedeb('0x4c')][_0xedeb('0x2e')]);}return _0xd35965[_0xedeb('0xb6')](_0x5b5059);}})['then'](function(_0x1f0dd6){if(_0x1f0dd6){return _0x1f0dd6?{'count':_0x126ca6,'rows':_0x1f0dd6}:null;}})[_0xedeb('0x1f')](respondWithResult(_0x1f4138,null))[_0xedeb('0x5c')](handleError(_0x1f4138,null));};exports['send']=function(_0x4e4f04,_0x9d7ddb,_0x309523){var _0x1e207b,_0x52e064,_0x23b4da;if(_[_0xedeb('0x77')](_0x4e4f04[_0xedeb('0x60')][_0xedeb('0x60')])||_0x4e4f04[_0xedeb('0x60')][_0xedeb('0x60')]===''){throw new db['Sequelize'][(_0xedeb('0x71'))](_0xedeb('0x7a'));}if(_[_0xedeb('0x77')](_0x4e4f04[_0xedeb('0x60')]['to'])){}_0x1e207b=_0x4e4f04[_0xedeb('0x60')]['to'];return db[_0xedeb('0x41')][_0xedeb('0x68')]({'where':{'id':_0x4e4f04[_0xedeb('0x5d')]['id']}})[_0xedeb('0x1f')](handleEntityNotFound(_0x9d7ddb,null))['then'](function(_0xe89a82){if(_0xe89a82){return db[_0xedeb('0x41')][_0xedeb('0x5e')]({'where':{'id':_0xe89a82['id']},'include':[{'model':db[_0xedeb('0xb7')],'as':'List','include':[{'model':db[_0xedeb('0x6f')],'as':_0xedeb('0x7f'),'where':{[_0xe89a82[_0xedeb('0x7c')]]:_0x1e207b},'limit':0x1,'order':[[_0xedeb('0x74'),_0xedeb('0x80')]]}]}]})[_0xedeb('0x1f')](handleEntityNotFound(_0x9d7ddb,null))[_0xedeb('0x1f')](function(_0x5416d3){if(_0x5416d3&&_0x5416d3['List']){_0x52e064=_0x5416d3[_0xedeb('0x38')]({'plain':!![]});if(_0x52e064[_0xedeb('0x7e')]&&_0x52e064[_0xedeb('0x7e')][_0xedeb('0x7f')][_0xedeb('0x4b')]){return _0x52e064['List'][_0xedeb('0x7f')][0x0];}return db[_0xedeb('0x6f')][_0xedeb('0x5f')](_['defaults'](_0x4e4f04[_0xedeb('0x60')],{'firstName':_0x1e207b,[_0x5416d3[_0xedeb('0x7c')]]:_0x1e207b,'phone':_0x1e207b,'ListId':_0x52e064[_0xedeb('0x76')]}));}})[_0xedeb('0x1f')](handleEntityNotFound(_0x9d7ddb,null))['then'](function(_0x3975b3){if(_0x3975b3){_0x23b4da=_0x3975b3;return db[_0xedeb('0x88')][_0xedeb('0x5e')]({'where':{'ContactId':_0x23b4da['id'],'closed':![],'OpenchannelAccountId':_0x52e064['id']}})[_0xedeb('0x1f')](function(_0x221e35){if(_0x221e35){return[_0x221e35,![]];}return db[_0xedeb('0x88')][_0xedeb('0x5f')]({'UserId':_0x4e4f04[_0xedeb('0x61')]['id'],'ContactId':_0x23b4da['id'],'OpenchannelAccountId':_0x52e064['id'],'lastMsgDirection':_0xedeb('0xb8'),'firstMsgDirection':'out','Messages':[_[_0xedeb('0x55')](_0x4e4f04['body'],{'read':![],'body':_0x4e4f04['body'][_0xedeb('0x60')],'OpenchannelAccountId':_0x52e064['id'],'UserId':_0x4e4f04['user']['id'],'ContactId':_0x23b4da['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xedeb('0xb9')}]})[_0xedeb('0x1f')](function(_0x160641){return[_0x160641,!![]];});});}})[_0xedeb('0x8a')](function(_0x1af6e1,_0x1830d1){if(_0x1830d1){return _0x1af6e1;}return db[_0xedeb('0x94')][_0xedeb('0x5f')](_['merge'](_0x4e4f04[_0xedeb('0x60')],{'read':![],'body':_0x4e4f04[_0xedeb('0x60')][_0xedeb('0x60')],'OpenchannelAccountId':_0x52e064['id'],'OpenchannelInteractionId':_0x1af6e1['id'],'UserId':_0x4e4f04['user']['id'],'ContactId':_0x23b4da['id']}))[_0xedeb('0x1f')](function(_0x1f527d){_0x1af6e1[_0xedeb('0xba')][_0xedeb('0xb9')]=[];_0x1af6e1['dataValues'][_0xedeb('0xb9')][_0xedeb('0x90')](_0x1f527d[_0xedeb('0xba')]);return _0x1af6e1;});});}})[_0xedeb('0x1f')](respondWithResult(_0x9d7ddb,null))[_0xedeb('0x5c')](handleError(_0x9d7ddb,null));}; \ No newline at end of file +var _0x4629=['order','sort','where','merge','VIRTUAL','filter','options','include','show','params','mandatoryDispositionPause','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','findOne','length','hasOwnProperty','OpenchannelAccountId','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','openchannel','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','isNil','from','Sequelize','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','lastName','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','stack','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Contacts','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','nolimit'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x4629,0x136));var _0x9462=function(_0xa861aa,_0x2895a4){_0xa861aa=_0xa861aa-0x0;var _0x1e34de=_0x4629[_0xa861aa];return _0x1e34de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9462('0x0'));var zipdir=require(_0x9462('0x1'));var jsonpatch=require(_0x9462('0x2'));var rp=require(_0x9462('0x3'));var moment=require(_0x9462('0x4'));var BPromise=require(_0x9462('0x5'));var Mustache=require(_0x9462('0x6'));var util=require(_0x9462('0x7'));var path=require(_0x9462('0x8'));var sox=require(_0x9462('0x9'));var csv=require(_0x9462('0xa'));var ejs=require(_0x9462('0xb'));var fs=require('fs');var fs_extra=require(_0x9462('0xc'));var _=require(_0x9462('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9462('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9462('0xa'));var querystring=require(_0x9462('0xf'));var Papa=require(_0x9462('0x10'));var Redis=require(_0x9462('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9462('0x12'));var as=require(_0x9462('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9462('0x14'))(_0x9462('0x15'));var utils=require(_0x9462('0x16'));var config=require(_0x9462('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9462('0x18'))['db'];config[_0x9462('0x19')]=_[_0x9462('0x1a')](config[_0x9462('0x19')],{'host':_0x9462('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9462('0x19')]));require(_0x9462('0x1c'))[_0x9462('0x1d')](socket);var jayson=require(_0x9462('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13f909,_0x43201b,_0x38df8f,_0x3a0f07){return new BPromise(function(_0x1ab51c,_0x2f2564){var _0x235d07=_0x3a0f07||client;return _0x235d07[_0x9462('0x1f')](_0x13f909,_0x38df8f)[_0x9462('0x20')](function(_0xfaf552){logger[_0x9462('0x21')](_0x9462('0x22'),_0x43201b,_0x9462('0x23'));logger[_0x9462('0x24')](_0x9462('0x25'),_0x43201b,_0x9462('0x23'),JSON[_0x9462('0x26')](_0xfaf552));if(_0xfaf552[_0x9462('0x27')]){if(_0xfaf552[_0x9462('0x27')]['code']===0x1f4){logger[_0x9462('0x27')](_0x9462('0x22'),_0x43201b,_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);return _0x2f2564(_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);}logger[_0x9462('0x27')](_0x9462('0x22'),_0x43201b,_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);return _0x1ab51c(_0xfaf552[_0x9462('0x27')][_0x9462('0x28')]);}else{logger[_0x9462('0x21')](_0x9462('0x22'),_0x43201b,_0x9462('0x23'));_0x1ab51c(_0xfaf552[_0x9462('0x29')][_0x9462('0x28')]);}})[_0x9462('0x2a')](function(_0x497288){logger[_0x9462('0x27')](_0x9462('0x22'),_0x43201b,_0x497288);_0x2f2564(_0x497288);});});}function respondWithStatusCode(_0x268a5f,_0x6d5891){_0x6d5891=_0x6d5891||0xcc;return function(_0x169cb2){if(_0x169cb2){return _0x268a5f[_0x9462('0x2b')](_0x6d5891);}return _0x268a5f[_0x9462('0x2c')](_0x6d5891)[_0x9462('0x2d')]();};}function respondWithResult(_0xd0a648,_0x1812b0){_0x1812b0=_0x1812b0||0xc8;return function(_0x574a11){if(_0x574a11){return _0xd0a648['status'](_0x1812b0)[_0x9462('0x2e')](_0x574a11);}};}function respondWithFilteredResult(_0xaa5a5,_0x162f58){return function(_0x58609e){if(_0x58609e){var _0x515d7b=typeof _0x162f58[_0x9462('0x2f')]==='undefined'&&typeof _0x162f58['limit']===_0x9462('0x30');var _0x1248a5=_0x58609e[_0x9462('0x31')];var _0x2989bc=_0x515d7b?0x0:_0x162f58[_0x9462('0x2f')];var _0xe1bfc1=_0x515d7b?_0x58609e['count']:_0x162f58[_0x9462('0x2f')]+_0x162f58[_0x9462('0x32')];var _0x2e2b74;if(_0xe1bfc1>=_0x1248a5){_0xe1bfc1=_0x1248a5;_0x2e2b74=0xc8;}else{_0x2e2b74=0xce;}_0xaa5a5['status'](_0x2e2b74);return _0xaa5a5[_0x9462('0x33')](_0x9462('0x34'),_0x2989bc+'-'+_0xe1bfc1+'/'+_0x1248a5)[_0x9462('0x2e')](_0x58609e);}return null;};}function patchUpdates(_0x23b2da){return function(_0x4f4953){try{jsonpatch[_0x9462('0x35')](_0x4f4953,_0x23b2da,!![]);}catch(_0xbd3965){return BPromise[_0x9462('0x36')](_0xbd3965);}return _0x4f4953[_0x9462('0x37')]();};}function saveUpdates(_0x476de1,_0x537e77){return function(_0x344b1e){if(_0x344b1e){return _0x344b1e[_0x9462('0x38')](_0x476de1)[_0x9462('0x20')](function(_0x536006){return _0x536006;});}return null;};}function removeEntity(_0x10d703,_0x429ff0){return function(_0x5daffe){if(_0x5daffe){return _0x5daffe[_0x9462('0x39')]()[_0x9462('0x20')](function(){var _0x2ba1d9=_0x5daffe[_0x9462('0x3a')]({'plain':!![]});var _0x46c866=_0x9462('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x46c866,'resourceId':_0x2ba1d9['id']}})['then'](function(){return _0x5daffe;});})[_0x9462('0x20')](function(){_0x10d703[_0x9462('0x2c')](0xcc)[_0x9462('0x2d')]();});}};}function handleEntityNotFound(_0x15656e,_0x14aaf4){return function(_0x3dfa9a){if(!_0x3dfa9a){_0x15656e[_0x9462('0x2b')](0x194);}return _0x3dfa9a;};}function handleError(_0x4f7fef,_0x5dcab0){_0x5dcab0=_0x5dcab0||0x1f4;return function(_0x334403){logger[_0x9462('0x27')](_0x334403['stack']);if(_0x334403[_0x9462('0x3c')]){delete _0x334403[_0x9462('0x3c')];}_0x4f7fef[_0x9462('0x2c')](_0x5dcab0)[_0x9462('0x3d')](_0x334403);};}exports[_0x9462('0x3e')]=function(_0x285137,_0x7b4257){var _0x565162={'include':[{'model':db[_0x9462('0x3f')],'as':'mandatoryDispositionPause'}]},_0x6f6b2a={},_0x968d8b={'count':0x0,'rows':[]};var _0x3da4bf=_[_0x9462('0x40')](db[_0x9462('0x41')][_0x9462('0x42')],function(_0x1b912f){return{'name':_0x1b912f[_0x9462('0x43')],'type':_0x1b912f[_0x9462('0x44')][_0x9462('0x45')]};});_0x6f6b2a['model']=_[_0x9462('0x40')](_0x3da4bf,_0x9462('0x3c'));_0x6f6b2a[_0x9462('0x46')]=_[_0x9462('0x47')](_0x285137['query']);_0x6f6b2a[_0x9462('0x48')]=_[_0x9462('0x49')](_0x6f6b2a['model'],_0x6f6b2a[_0x9462('0x46')]);_0x565162[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x6f6b2a['model'],qs[_0x9462('0x4b')](_0x285137[_0x9462('0x46')][_0x9462('0x4b')]));_0x565162[_0x9462('0x4a')]=_0x565162[_0x9462('0x4a')]['length']?_0x565162[_0x9462('0x4a')]:_0x6f6b2a[_0x9462('0x4c')];if(!_0x285137[_0x9462('0x46')]['hasOwnProperty'](_0x9462('0x4d'))){_0x565162[_0x9462('0x32')]=qs[_0x9462('0x32')](_0x285137[_0x9462('0x46')]['limit']);_0x565162[_0x9462('0x2f')]=qs['offset'](_0x285137['query'][_0x9462('0x2f')]);}_0x565162[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x285137['query'][_0x9462('0x4f')]);_0x565162['where']=qs[_0x9462('0x48')](_['pick'](_0x285137[_0x9462('0x46')],_0x6f6b2a[_0x9462('0x48')]),_0x3da4bf);if(_0x285137[_0x9462('0x46')]['filter']){_0x565162[_0x9462('0x50')]=_[_0x9462('0x51')](_0x565162[_0x9462('0x50')],{'$or':_['map'](_0x3da4bf,function(_0x336ff5){if(_0x336ff5[_0x9462('0x44')]!==_0x9462('0x52')){var _0x1a36ee={};_0x1a36ee[_0x336ff5[_0x9462('0x3c')]]={'$like':'%'+_0x285137[_0x9462('0x46')][_0x9462('0x53')]+'%'};return _0x1a36ee;}})});}_0x565162=_[_0x9462('0x51')]({},_0x565162,_0x285137[_0x9462('0x54')]);var _0x193482={'where':_0x565162[_0x9462('0x50')]};return db[_0x9462('0x41')][_0x9462('0x31')](_0x193482)[_0x9462('0x20')](function(_0x2f39cf){_0x968d8b[_0x9462('0x31')]=_0x2f39cf;if(_0x285137[_0x9462('0x46')]['includeAll']){_0x565162[_0x9462('0x55')]=[{'all':!![]}];}return db[_0x9462('0x41')]['findAll'](_0x565162);})[_0x9462('0x20')](function(_0xb39d16){_0x968d8b['rows']=_0xb39d16;return _0x968d8b;})[_0x9462('0x20')](respondWithFilteredResult(_0x7b4257,_0x565162))['catch'](handleError(_0x7b4257,null));};exports[_0x9462('0x56')]=function(_0x4b2212,_0x24a192){var _0x57692b={'raw':![],'where':{'id':_0x4b2212[_0x9462('0x57')]['id']},'include':[{'model':db[_0x9462('0x3f')],'as':_0x9462('0x58')}]},_0x723d19={};_0x723d19[_0x9462('0x4c')]=_[_0x9462('0x47')](db[_0x9462('0x41')]['rawAttributes']);_0x723d19['query']=_[_0x9462('0x47')](_0x4b2212['query']);_0x723d19['filters']=_[_0x9462('0x49')](_0x723d19[_0x9462('0x4c')],_0x723d19[_0x9462('0x46')]);_0x57692b[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x723d19[_0x9462('0x4c')],qs['fields'](_0x4b2212[_0x9462('0x46')]['fields']));_0x57692b['attributes']=_0x57692b[_0x9462('0x4a')]['length']?_0x57692b[_0x9462('0x4a')]:_0x723d19[_0x9462('0x4c')];if(_0x4b2212[_0x9462('0x46')][_0x9462('0x59')]){_0x57692b[_0x9462('0x55')]=[{'all':!![]}];}_0x57692b=_[_0x9462('0x51')]({},_0x57692b,_0x4b2212[_0x9462('0x54')]);return db[_0x9462('0x41')]['find'](_0x57692b)[_0x9462('0x20')](handleEntityNotFound(_0x24a192,null))['then'](respondWithResult(_0x24a192,null))[_0x9462('0x2a')](handleError(_0x24a192,null));};exports[_0x9462('0x5a')]=function(_0x1cdc5d,_0x42e887){return db['OpenchannelAccount']['create'](_0x1cdc5d[_0x9462('0x5b')],{})[_0x9462('0x20')](function(_0x3553b4){var _0x4b0e88=_0x1cdc5d[_0x9462('0x5c')][_0x9462('0x3a')]({'plain':!![]});if(!_0x4b0e88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b0e88[_0x9462('0x5d')]===_0x9462('0x5c')){var _0x4eca20=_0x3553b4[_0x9462('0x3a')]({'plain':!![]});var _0xcff7c2=_0x9462('0x3b');return db[_0x9462('0x5e')][_0x9462('0x5f')]({'where':{'name':_0xcff7c2,'userProfileId':_0x4b0e88[_0x9462('0x60')]},'raw':!![]})[_0x9462('0x20')](function(_0x4dc8e4){if(_0x4dc8e4&&_0x4dc8e4[_0x9462('0x61')]===0x0){return db[_0x9462('0x62')][_0x9462('0x5a')]({'name':_0x4eca20[_0x9462('0x3c')],'resourceId':_0x4eca20['id'],'type':_0x4dc8e4[_0x9462('0x3c')],'sectionId':_0x4dc8e4['id']},{})[_0x9462('0x20')](function(){return _0x3553b4;});}else{return _0x3553b4;}})[_0x9462('0x2a')](function(_0x42de4a){logger[_0x9462('0x27')](_0x9462('0x63'),_0x42de4a);throw _0x42de4a;});}return _0x3553b4;})[_0x9462('0x20')](respondWithResult(_0x42e887,0xc9))['catch'](handleError(_0x42e887,null));};exports[_0x9462('0x38')]=function(_0x237fd6,_0xdeb888){if(_0x237fd6[_0x9462('0x5b')]['id']){delete _0x237fd6['body']['id'];}return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x237fd6[_0x9462('0x57')]['id']},'include':[{'model':db[_0x9462('0x3f')],'as':_0x9462('0x58')}]})[_0x9462('0x20')](handleEntityNotFound(_0xdeb888,null))[_0x9462('0x20')](saveUpdates(_0x237fd6[_0x9462('0x5b')],null))['then'](respondWithResult(_0xdeb888,null))[_0x9462('0x2a')](handleError(_0xdeb888,null));};exports['destroy']=function(_0x3b2fd9,_0xba10e3){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x3b2fd9[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0xba10e3,null))['then'](removeEntity(_0xba10e3,null))[_0x9462('0x2a')](handleError(_0xba10e3,null));};exports['describe']=function(_0x2d1b34,_0x6641a3){return db[_0x9462('0x41')]['describe']()['then'](respondWithResult(_0x6641a3,null))[_0x9462('0x2a')](handleError(_0x6641a3,null));};exports[_0x9462('0x64')]=function(_0x24f1ef,_0x1eae68,_0x41304d){if(_0x24f1ef[_0x9462('0x5b')]['id']){delete _0x24f1ef[_0x9462('0x5b')]['id'];}return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x24f1ef[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x1eae68,null))[_0x9462('0x20')](function(_0x3f4fdc){if(_0x3f4fdc){_0x24f1ef[_0x9462('0x5b')]['OpenchannelAccountId']=_0x3f4fdc['id'];return db[_0x9462('0x65')][_0x9462('0x5a')](_0x24f1ef['body']);}})[_0x9462('0x20')](respondWithResult(_0x1eae68,null))[_0x9462('0x2a')](handleError(_0x1eae68,null));};exports[_0x9462('0x66')]=function(_0x34058d,_0x145551,_0x54c186){var _0x158a74={'raw':![],'where':{}};var _0x5d27e7={};var _0x2ffcdc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9462('0x67')]({'where':{'id':_0x34058d[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x145551,null))[_0x9462('0x20')](function(_0x4d40e2){if(_0x4d40e2){_0x5d27e7[_0x9462('0x4c')]=_['keys'](db[_0x9462('0x65')][_0x9462('0x42')]);_0x5d27e7[_0x9462('0x46')]=_[_0x9462('0x47')](_0x34058d['query']);_0x5d27e7[_0x9462('0x48')]=_[_0x9462('0x49')](_0x5d27e7[_0x9462('0x4c')],_0x5d27e7[_0x9462('0x46')]);_0x158a74[_0x9462('0x4a')]=_['intersection'](_0x5d27e7[_0x9462('0x4c')],qs[_0x9462('0x4b')](_0x34058d['query'][_0x9462('0x4b')]));_0x158a74[_0x9462('0x4a')]=_0x158a74[_0x9462('0x4a')][_0x9462('0x68')]?_0x158a74[_0x9462('0x4a')]:_0x5d27e7['model'];if(!_0x34058d[_0x9462('0x46')][_0x9462('0x69')](_0x9462('0x4d'))){_0x158a74['limit']=qs[_0x9462('0x32')](_0x34058d[_0x9462('0x46')][_0x9462('0x32')]);_0x158a74[_0x9462('0x2f')]=qs[_0x9462('0x2f')](_0x34058d[_0x9462('0x46')][_0x9462('0x2f')]);}_0x158a74[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x34058d[_0x9462('0x46')][_0x9462('0x4f')]);_0x158a74[_0x9462('0x50')]=qs['filters'](_['pick'](_0x34058d[_0x9462('0x46')],_0x5d27e7[_0x9462('0x48')]));_0x158a74[_0x9462('0x50')][_0x9462('0x6a')]=_0x4d40e2['id'];if(_0x34058d['query'][_0x9462('0x53')]){_0x158a74['where']=_[_0x9462('0x51')](_0x158a74[_0x9462('0x50')],{'$or':_[_0x9462('0x40')](_0x158a74[_0x9462('0x4a')],function(_0x5ed947){var _0x341718={};_0x341718[_0x5ed947]={'$like':'%'+_0x34058d[_0x9462('0x46')]['filter']+'%'};return _0x341718;})});}_0x158a74=_['merge']({},_0x158a74,_0x34058d[_0x9462('0x54')]);return db[_0x9462('0x65')][_0x9462('0x31')]({'where':_0x158a74[_0x9462('0x50')]})[_0x9462('0x20')](function(_0x3c542c){_0x2ffcdc[_0x9462('0x31')]=_0x3c542c;if(_0x34058d[_0x9462('0x46')][_0x9462('0x59')]){_0x158a74[_0x9462('0x55')]=[{'all':!![]}];}return db[_0x9462('0x65')][_0x9462('0x6b')](_0x158a74);})[_0x9462('0x20')](function(_0x359a97){_0x2ffcdc[_0x9462('0x6c')]=_0x359a97;return _0x2ffcdc;});}})['then'](respondWithFilteredResult(_0x145551,_0x158a74))['catch'](handleError(_0x145551,null));};exports[_0x9462('0x6d')]=function(_0x81f981,_0x4ccc80,_0x5db957){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x81f981['params']['id']}})['then'](handleEntityNotFound(_0x4ccc80,null))[_0x9462('0x20')](function(_0xcc2003){if(_0xcc2003){return _0xcc2003['removeDispositions'](_0x81f981[_0x9462('0x46')][_0x9462('0x6e')]);}})['then'](respondWithStatusCode(_0x4ccc80,null))[_0x9462('0x2a')](handleError(_0x4ccc80,null));};exports['addAnswer']=function(_0x2d27e2,_0x3046aa,_0x2932ba){if(_0x2d27e2[_0x9462('0x5b')]['id']){delete _0x2d27e2['body']['id'];}return db['OpenchannelAccount'][_0x9462('0x5f')]({'where':{'id':_0x2d27e2['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x3046aa,null))[_0x9462('0x20')](function(_0x46a26b){if(_0x46a26b){_0x2d27e2['body'][_0x9462('0x6a')]=_0x46a26b['id'];return db[_0x9462('0x6f')][_0x9462('0x5a')](_0x2d27e2[_0x9462('0x5b')]);}})[_0x9462('0x20')](respondWithResult(_0x3046aa,null))['catch'](handleError(_0x3046aa,null));};exports[_0x9462('0x70')]=function(_0x34efc1,_0x237f63,_0x38a761){var _0x48fbb8={'raw':![],'where':{}};var _0x16ac21={};var _0x1c0305={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9462('0x67')]({'where':{'id':_0x34efc1['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x237f63,null))[_0x9462('0x20')](function(_0x13b76e){if(_0x13b76e){_0x16ac21['model']=_[_0x9462('0x47')](db[_0x9462('0x6f')]['rawAttributes']);_0x16ac21[_0x9462('0x46')]=_[_0x9462('0x47')](_0x34efc1[_0x9462('0x46')]);_0x16ac21[_0x9462('0x48')]=_[_0x9462('0x49')](_0x16ac21[_0x9462('0x4c')],_0x16ac21[_0x9462('0x46')]);_0x48fbb8['attributes']=_['intersection'](_0x16ac21[_0x9462('0x4c')],qs[_0x9462('0x4b')](_0x34efc1['query'][_0x9462('0x4b')]));_0x48fbb8[_0x9462('0x4a')]=_0x48fbb8[_0x9462('0x4a')]['length']?_0x48fbb8['attributes']:_0x16ac21[_0x9462('0x4c')];if(!_0x34efc1[_0x9462('0x46')][_0x9462('0x69')](_0x9462('0x4d'))){_0x48fbb8['limit']=qs[_0x9462('0x32')](_0x34efc1[_0x9462('0x46')]['limit']);_0x48fbb8[_0x9462('0x2f')]=qs[_0x9462('0x2f')](_0x34efc1['query'][_0x9462('0x2f')]);}_0x48fbb8[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x34efc1['query'][_0x9462('0x4f')]);_0x48fbb8['where']=qs[_0x9462('0x48')](_[_0x9462('0x71')](_0x34efc1[_0x9462('0x46')],_0x16ac21[_0x9462('0x48')]));_0x48fbb8[_0x9462('0x50')]['OpenchannelAccountId']=_0x13b76e['id'];if(_0x34efc1['query']['filter']){_0x48fbb8[_0x9462('0x50')]=_[_0x9462('0x51')](_0x48fbb8[_0x9462('0x50')],{'$or':_['map'](_0x48fbb8[_0x9462('0x4a')],function(_0x3b414b){var _0x50fc34={};_0x50fc34[_0x3b414b]={'$like':'%'+_0x34efc1[_0x9462('0x46')]['filter']+'%'};return _0x50fc34;})});}_0x48fbb8=_[_0x9462('0x51')]({},_0x48fbb8,_0x34efc1['options']);return db[_0x9462('0x6f')]['count']({'where':_0x48fbb8[_0x9462('0x50')]})[_0x9462('0x20')](function(_0x46c116){_0x1c0305['count']=_0x46c116;if(_0x34efc1[_0x9462('0x46')][_0x9462('0x59')]){_0x48fbb8['include']=[{'all':!![]}];}return db[_0x9462('0x6f')]['findAll'](_0x48fbb8);})['then'](function(_0x2530b9){_0x1c0305[_0x9462('0x6c')]=_0x2530b9;return _0x1c0305;});}})['then'](respondWithFilteredResult(_0x237f63,_0x48fbb8))[_0x9462('0x2a')](handleError(_0x237f63,null));};exports[_0x9462('0x72')]=function(_0x1184b2,_0x26085e,_0x4c182a){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x1184b2['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x26085e,null))[_0x9462('0x20')](function(_0x14d0ef){if(_0x14d0ef){return _0x14d0ef[_0x9462('0x72')](_0x1184b2[_0x9462('0x46')][_0x9462('0x6e')]);}})[_0x9462('0x20')](respondWithStatusCode(_0x26085e,null))[_0x9462('0x2a')](handleError(_0x26085e,null));};exports[_0x9462('0x73')]=function(_0x12f776,_0x480355,_0x1292b2){var _0x281049={'body':_0x12f776[_0x9462('0x5b')],'channel':_0x9462('0x74')};var _0x73c39=[];var _0x3eaeef=[];var _0x1af529={};var _0x103c6b=![];return db[_0x9462('0x75')][_0x9462('0x76')]()[_0x9462('0x20')](function(_0x3afbe4){if(!_0x3afbe4){throw new db['Sequelize'][(_0x9462('0x77'))](_0x9462('0x78'));}_0x73c39=_[_0x9462('0x79')](_[_0x9462('0x47')](_0x3afbe4),['createdAt',_0x9462('0x7a')]);_0x3eaeef=_[_0x9462('0x79')](_['keys'](_0x3afbe4),[_0x9462('0x7b'),_0x9462('0x7a'),'CompanyId',_0x9462('0x7c')]);if(_0x12f776[_0x9462('0x5b')]['id']){delete _0x12f776['body']['id'];}if(_[_0x9462('0x7d')](_0x12f776[_0x9462('0x5b')][_0x9462('0x7e')])){throw new db[(_0x9462('0x7f'))][(_0x9462('0x77'))]('from\x20is\x20mandatory');}if(_[_0x9462('0x7d')](_0x12f776[_0x9462('0x5b')]['body'])||_0x12f776[_0x9462('0x5b')][_0x9462('0x5b')]===''){throw new db['Sequelize'][(_0x9462('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9462('0x7d')](_0x12f776[_0x9462('0x5b')]['mapKey'])){throw new db[(_0x9462('0x7f'))][(_0x9462('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3eaeef);}if(!_['includes'](_0x3eaeef,_0x12f776[_0x9462('0x5b')][_0x9462('0x80')])){throw new db[(_0x9462('0x7f'))][(_0x9462('0x77'))](_0x9462('0x81')+_0x3eaeef);}_0x1af529[_0x12f776[_0x9462('0x5b')][_0x9462('0x80')]]=_0x12f776[_0x9462('0x5b')]['from'];})[_0x9462('0x20')](function(){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x12f776[_0x9462('0x57')]['id']},'include':[{'model':db[_0x9462('0x82')],'as':_0x9462('0x83'),'include':[{'model':db[_0x9462('0x75')],'as':'Contacts','where':_0x1af529,'limit':0x1,'order':[[_0x9462('0x7a'),_0x9462('0x84')]]}]},{'model':db[_0x9462('0x85')],'as':'Applications'}]});})[_0x9462('0x20')](handleEntityNotFound(_0x480355,null))['then'](function(_0x32fef6){if(_0x32fef6&&_0x32fef6[_0x9462('0x83')]){_0x281049[_0x9462('0x86')]=_0x32fef6;_0x281049[_0x9462('0x87')]=_0x32fef6[_0x9462('0x88')];_0x281049[_0x9462('0x89')]=_0x32fef6[_0x9462('0x83')];_0x281049[_0x9462('0x87')]=_[_0x9462('0x8a')](_0x281049['applications'],['priority'],[_0x9462('0x8b')]);if(_0x281049[_0x9462('0x86')][_0x9462('0x88')]){delete _0x281049['account'][_0x9462('0x88')];}if(_0x281049[_0x9462('0x86')]['List']&&_0x281049[_0x9462('0x86')][_0x9462('0x83')]['Contacts'][_0x9462('0x68')]){return _0x281049[_0x9462('0x86')][_0x9462('0x83')]['Contacts'][0x0];}var _0x73318f=_[_0x9462('0x1a')](_0x12f776[_0x9462('0x5b')],{'firstName':_0x12f776[_0x9462('0x5b')]['from'],'ListId':_0x32fef6['ListId']});_0x73318f[_0x12f776[_0x9462('0x5b')][_0x9462('0x80')]]=_0x12f776[_0x9462('0x5b')][_0x9462('0x7e')];return db[_0x9462('0x75')][_0x9462('0x5a')](_0x73318f,{'fields':_0x73c39,'raw':!![]});}})[_0x9462('0x20')](handleEntityNotFound(_0x480355,null))['then'](function(_0x3fe3d7){_0x281049[_0x9462('0x8c')]=_0x3fe3d7;if(_0x3fe3d7){var _0x1f448e={'ContactId':_0x3fe3d7['id'],'OpenchannelAccountId':_0x12f776[_0x9462('0x57')]['id'],'from':(_0x3fe3d7[_0x9462('0x8d')]||'')+'\x20'+(_0x3fe3d7['lastName']||'')};var _0x591e16={'OpenchannelAccountId':_0x12f776[_0x9462('0x57')]['id'],'closed':![]};if(_0x12f776[_0x9462('0x5b')]['threadId']){_0x591e16[_0x9462('0x8e')]=_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')];return db[_0x9462('0x8f')][_0x9462('0x5f')]({'where':_0x591e16})[_0x9462('0x20')](function(_0x1a9f78){if(_0x1a9f78){return[_0x1a9f78,![]];}_0x1f448e['threadId']=_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')];_0x1f448e[_0x9462('0x90')]=_0x12f776['body']['externalUrl'];return db[_0x9462('0x8f')][_0x9462('0x5a')](_0x1f448e)['then'](function(_0x889c2c){return[_0x889c2c,!![]];});});}else{_0x591e16['threadId']=null;}_0x591e16['ContactId']=_0x3fe3d7['id'];return db['OpenchannelInteraction'][_0x9462('0x5f')]({'where':_0x591e16})['then'](function(_0x580cfa){if(_0x580cfa){return[_0x580cfa,![]];}return db[_0x9462('0x8f')][_0x9462('0x5a')](_0x1f448e)[_0x9462('0x20')](function(_0x4934e4){return[_0x4934e4,!![]];});});}})[_0x9462('0x91')](function(_0xd3a214,_0x286488){if(_0xd3a214){_0x103c6b=_0x286488;if(!_0x286488){var _0x545637={'from':(_0x281049[_0x9462('0x8c')][_0x9462('0x8d')]||'')+'\x20'+(_0x281049[_0x9462('0x8c')][_0x9462('0x92')]||'')};if(_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')]&&_0x12f776['body'][_0x9462('0x93')]&&_0x12f776[_0x9462('0x5b')][_0x9462('0x8e')]!=_0x12f776[_0x9462('0x5b')][_0x9462('0x93')]){_0x545637[_0x9462('0x8e')]=_0x12f776['body'][_0x9462('0x93')];}return _0xd3a214[_0x9462('0x38')](_0x545637);}else{return _0xd3a214;}}})[_0x9462('0x20')](function(_0x224dd6){_0x281049['interaction']=_0x224dd6['get']({'plain':!![]});_0x281049[_0x9462('0x94')][_0x9462('0x95')]=_0x103c6b;if(_0x281049[_0x9462('0x94')][_0x9462('0x95')]){if(_0x281049[_0x9462('0x86')][_0x9462('0x96')]){_0x281049['applications'][_0x9462('0x97')]({'id':0x0,'priority':_0x281049['applications'][_0x9462('0x68')]+0x1,'app':_0x9462('0x98'),'appdata':'unmanaged','interval':_0x9462('0x99')});}}return db[_0x9462('0x9a')][_0x9462('0x5a')]({'body':_0x12f776[_0x9462('0x5b')][_0x9462('0x5b')],'OpenchannelAccountId':_0x12f776[_0x9462('0x57')]['id'],'OpenchannelInteractionId':_0x224dd6['id'],'direction':'in','ContactId':_0x281049[_0x9462('0x8c')]['id'],'AttachmentId':_0x12f776[_0x9462('0x5b')][_0x9462('0x9b')]});})[_0x9462('0x20')](function(_0x547c18){_0x281049['message']=_0x547c18;if(!_0x281049['interaction'][_0x9462('0x9c')])return;return db[_0x9462('0x9d')][_0x9462('0x5f')]({'attributes':['id',_0x9462('0x3c')],'where':{'id':_0x281049['interaction'][_0x9462('0x9c')]}});})['then'](function(_0x3eee17){if(_0x3eee17){_0x281049[_0x9462('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9462('0x9e'),'appdata':_0x3eee17[_0x9462('0x3c')]+','+(_0x281049[_0x9462('0x86')][_0x9462('0x9f')]||0xa),'interval':_0x9462('0x99')});}if(!_0x281049[_0x9462('0x94')][_0x9462('0xa0')])return;return db['OpenchannelQueue'][_0x9462('0x5f')]({'attributes':['id',_0x9462('0x3c')],'where':{'id':_0x281049['interaction'][_0x9462('0xa0')]}});})[_0x9462('0x20')](function(_0x50d0b6){if(_0x50d0b6){_0x281049[_0x9462('0x87')][_0x9462('0xa1')]({'id':0x0,'priority':0x1,'app':_0x9462('0xa2'),'appdata':_0x50d0b6[_0x9462('0x3c')]+','+(_0x281049[_0x9462('0x86')][_0x9462('0xa3')]||0x12c),'interval':_0x9462('0x99')});}return respondWithRpcPromise(_0x9462('0xa4'),_0x9462('0xa5'),_0x281049);})['then'](function(_0x57fed2){respondWithRpcPromise('EventManager',_0x9462('0xa6'),{'event':'notify','message':_0x57fed2},client9002);return _0x57fed2;})['then'](respondWithResult(_0x480355,null))[_0x9462('0x2a')](handleError(_0x480355,null));};exports[_0x9462('0xa7')]=function(_0x5110ff,_0x238de7){var _0x4dc84f=_0x5110ff[_0x9462('0x57')]['id'];var _0xf65dc3=_0x5110ff[_0x9462('0x5b')];var _0x43c44c=0xc8;var _0x4e3514=null;return db[_0x9462('0xa8')][_0x9462('0xa9')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x9462('0xaa')]},function(_0x3c5db8){return db[_0x9462('0x41')][_0x9462('0x67')]({'where':{'id':_0x4dc84f},'transaction':_0x3c5db8})['then'](function(_0x2dc116){if(_0x2dc116){return db['OpenchannelApplication'][_0x9462('0x39')]({'where':{'OpenchannelAccountId':_0x4dc84f},'transaction':_0x3c5db8})['then'](function(){var _0x1ae02c=_[_0x9462('0x40')](_0xf65dc3,function(_0x19d0b5){_0x19d0b5[_0x9462('0x6a')]=_0x4dc84f;return _0x19d0b5;});return db[_0x9462('0x85')][_0x9462('0xab')](_0x1ae02c,{'transaction':_0x3c5db8});});}else{_0x43c44c=0x194;_0x4e3514=[];}});})[_0x9462('0x20')](function(){if(_0x43c44c!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4dc84f},'order':'priority'})[_0x9462('0x20')](function(_0x170ef3){_0x4e3514=_0x170ef3;});}})[_0x9462('0x2a')](function(_0x5b3301){_0x43c44c=0x1f4;logger['error'](_0x5b3301[_0x9462('0xac')]);if(_0x5b3301['name']){delete _0x5b3301['name'];}_0x4e3514=_0x5b3301;})['finally'](function(){if(_0x4e3514===null){_0x238de7['sendStatus'](_0x43c44c);}else{if(_0x43c44c===0x1f4){_0x238de7[_0x9462('0x2c')](_0x43c44c)[_0x9462('0x3d')](_0x4e3514);}else{_0x238de7['status'](_0x43c44c)[_0x9462('0x2e')](_0x4e3514);}}});};exports[_0x9462('0xad')]=function(_0xbf7c27,_0x1231a0,_0x40d752){var _0x48ca3b={};var _0x620d09={};var _0x3c2656;var _0x274bcd;return db['OpenchannelAccount']['findOne']({'where':{'id':_0xbf7c27[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x1231a0,null))[_0x9462('0x20')](function(_0xfccb37){if(_0xfccb37){_0x3c2656=_0xfccb37;_0x620d09[_0x9462('0x4c')]=_[_0x9462('0x47')](db['OpenchannelApplication'][_0x9462('0x42')]);_0x620d09['query']=_[_0x9462('0x47')](_0xbf7c27[_0x9462('0x46')]);_0x620d09[_0x9462('0x48')]=_['intersection'](_0x620d09['model'],_0x620d09['query']);_0x48ca3b[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x620d09[_0x9462('0x4c')],qs['fields'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x4b')]));_0x48ca3b[_0x9462('0x4a')]=_0x48ca3b[_0x9462('0x4a')][_0x9462('0x68')]?_0x48ca3b[_0x9462('0x4a')]:_0x620d09['model'];_0x48ca3b[_0x9462('0x4e')]=qs['sort'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x4f')]);_0x48ca3b[_0x9462('0x50')]=qs[_0x9462('0x48')](_['pick'](_0xbf7c27[_0x9462('0x46')],_0x620d09[_0x9462('0x48')]));if(_0xbf7c27[_0x9462('0x46')][_0x9462('0x53')]){_0x48ca3b[_0x9462('0x50')]=_[_0x9462('0x51')](_0x48ca3b['where'],{'$or':_['map'](_0x48ca3b[_0x9462('0x4a')],function(_0x1b0a3c){var _0x164fd1={};_0x164fd1[_0x1b0a3c]={'$like':'%'+_0xbf7c27['query'][_0x9462('0x53')]+'%'};return _0x164fd1;})});}_0x48ca3b=_['merge']({},_0x48ca3b,_0xbf7c27[_0x9462('0x54')]);return _0x3c2656[_0x9462('0xad')](_0x48ca3b);}})[_0x9462('0x20')](function(_0x4ae2a7){if(_0x4ae2a7){_0x274bcd=_0x4ae2a7[_0x9462('0x68')];if(!_0xbf7c27[_0x9462('0x46')]['hasOwnProperty']('nolimit')){_0x48ca3b[_0x9462('0x32')]=qs['limit'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x32')]);_0x48ca3b[_0x9462('0x2f')]=qs['offset'](_0xbf7c27[_0x9462('0x46')][_0x9462('0x2f')]);}return _0x3c2656[_0x9462('0xad')](_0x48ca3b);}})[_0x9462('0x20')](function(_0x2a2df5){if(_0x2a2df5){return _0x2a2df5?{'count':_0x274bcd,'rows':_0x2a2df5}:null;}})[_0x9462('0x20')](respondWithResult(_0x1231a0,null))[_0x9462('0x2a')](handleError(_0x1231a0,null));};exports[_0x9462('0xae')]=function(_0x3a7a17,_0x12f3c9,_0xfe1adb){var _0x23c24d={'raw':![],'where':{}};var _0x38b048={};var _0xbd40d6={'count':0x0,'rows':[]};return db[_0x9462('0x41')]['findOne']({'where':{'id':_0x3a7a17[_0x9462('0x57')]['id']}})['then'](handleEntityNotFound(_0x12f3c9,null))['then'](function(_0x2adf9f){if(_0x2adf9f){_0x38b048['model']=_[_0x9462('0x47')](db[_0x9462('0x8f')][_0x9462('0x42')]);_0x38b048['query']=_['keys'](_0x3a7a17['query']);_0x38b048['filters']=_[_0x9462('0x49')](_0x38b048[_0x9462('0x4c')],_0x38b048[_0x9462('0x46')]);_0x23c24d[_0x9462('0x4a')]=_['intersection'](_0x38b048[_0x9462('0x4c')],qs[_0x9462('0x4b')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x4b')]));_0x23c24d[_0x9462('0x4a')]=_0x23c24d[_0x9462('0x4a')][_0x9462('0x68')]?_0x23c24d[_0x9462('0x4a')]:_0x38b048[_0x9462('0x4c')];if(!_0x3a7a17[_0x9462('0x46')][_0x9462('0x69')]('nolimit')){_0x23c24d['limit']=qs[_0x9462('0x32')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x32')]);_0x23c24d[_0x9462('0x2f')]=qs[_0x9462('0x2f')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x2f')]);}_0x23c24d[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x3a7a17[_0x9462('0x46')][_0x9462('0x4f')]);_0x23c24d[_0x9462('0x50')]=qs[_0x9462('0x48')](_[_0x9462('0x71')](_0x3a7a17[_0x9462('0x46')],_0x38b048[_0x9462('0x48')]));_0x23c24d[_0x9462('0x50')][_0x9462('0x6a')]=_0x2adf9f['id'];if(_0x3a7a17['query']['filter']){_0x23c24d['where']=_[_0x9462('0x51')](_0x23c24d[_0x9462('0x50')],{'$or':_['map'](_0x23c24d[_0x9462('0x4a')],function(_0x2308bb){var _0x2f483f={};_0x2f483f[_0x2308bb]={'$like':'%'+_0x3a7a17[_0x9462('0x46')][_0x9462('0x53')]+'%'};return _0x2f483f;})});}_0x23c24d=_[_0x9462('0x51')]({},_0x23c24d,_0x3a7a17['options']);return db[_0x9462('0x8f')][_0x9462('0x31')]({'where':_0x23c24d['where']})[_0x9462('0x20')](function(_0xe45cc){_0xbd40d6['count']=_0xe45cc;if(_0x3a7a17[_0x9462('0x46')][_0x9462('0x59')]){_0x23c24d[_0x9462('0x55')]=[{'model':db['CmContact'],'as':_0x9462('0xaf'),'required':![]},{'model':db[_0x9462('0x9d')],'as':_0x9462('0xb0'),'attributes':['name',_0x9462('0xb1'),_0x9462('0xb2')],'required':![]},{'model':db[_0x9462('0xb3')],'as':'Tags','attributes':['id',_0x9462('0x3c'),_0x9462('0xb4')],'where':_0x3a7a17[_0x9462('0x46')]['tag']?{'id':_0x3a7a17['query'][_0x9462('0xb5')]}:undefined,'required':_0x3a7a17[_0x9462('0x46')][_0x9462('0xb5')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x9462('0x6b')](_0x23c24d);})[_0x9462('0x20')](function(_0x158186){_0xbd40d6[_0x9462('0x6c')]=_0x158186;return _0xbd40d6;});}})[_0x9462('0x20')](respondWithFilteredResult(_0x12f3c9,_0x23c24d))['catch'](handleError(_0x12f3c9,null));};exports[_0x9462('0xb6')]=function(_0x9e7148,_0x289126,_0x533574){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x9e7148[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x289126,null))[_0x9462('0x20')](function(_0x17faf5){if(_0x17faf5){return _0x17faf5[_0x9462('0xb6')](_0x9e7148[_0x9462('0x5b')][_0x9462('0x6e')],_['omit'](_0x9e7148[_0x9462('0x5b')],['ids','id'])||{})[_0x9462('0x91')](function(_0x572834){for(var _0x2bd597=0x0;_0x2bd597<_0x9e7148[_0x9462('0x5b')]['ids'][_0x9462('0x68')];_0x2bd597+=0x1){socket[_0x9462('0xb7')](_0x9462('0xb8'),{'UserId':Number(_0x9e7148[_0x9462('0x5b')][_0x9462('0x6e')][_0x2bd597]),'OpenchannelAccountId':Number(_0x9e7148[_0x9462('0x57')]['id'])});}return _0x572834;});}})[_0x9462('0x20')](respondWithResult(_0x289126,null))[_0x9462('0x2a')](handleError(_0x289126,null));};exports[_0x9462('0xb9')]=function(_0x1e3d5b,_0x4c1c39,_0x7a8884){return db[_0x9462('0x41')][_0x9462('0x5f')]({'where':{'id':_0x1e3d5b['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x4c1c39,null))[_0x9462('0x20')](function(_0x49627e){if(_0x49627e){return _0x49627e[_0x9462('0xb9')](_0x1e3d5b[_0x9462('0x46')][_0x9462('0x6e')])['then'](function(){if(_[_0x9462('0xba')](_0x1e3d5b[_0x9462('0x46')]['ids'])){for(var _0x1caf7d=0x0;_0x1caf7d<_0x1e3d5b['query'][_0x9462('0x6e')][_0x9462('0x68')];_0x1caf7d+=0x1){socket[_0x9462('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1e3d5b[_0x9462('0x46')][_0x9462('0x6e')][_0x1caf7d]),'OpenchannelAccountId':Number(_0x1e3d5b[_0x9462('0x57')]['id'])});}}else{socket[_0x9462('0xb7')](_0x9462('0xbb'),{'UserId':Number(_0x1e3d5b[_0x9462('0x46')][_0x9462('0x6e')]),'OpenchannelAccountId':Number(_0x1e3d5b['params']['id'])});}});}})[_0x9462('0x20')](respondWithStatusCode(_0x4c1c39,null))[_0x9462('0x2a')](handleError(_0x4c1c39,null));};exports[_0x9462('0xbc')]=function(_0x44dc47,_0xc90ec3,_0x4e8b96){var _0x51772e={};var _0x3f97b8={};var _0x2eecca;var _0x22b973;return db[_0x9462('0x41')]['findOne']({'where':{'id':_0x44dc47[_0x9462('0x57')]['id']}})[_0x9462('0x20')](handleEntityNotFound(_0xc90ec3,null))[_0x9462('0x20')](function(_0x5141ce){if(_0x5141ce){_0x2eecca=_0x5141ce;_0x3f97b8[_0x9462('0x4c')]=_['keys'](db[_0x9462('0x9d')][_0x9462('0x42')]);_0x3f97b8[_0x9462('0x46')]=_[_0x9462('0x47')](_0x44dc47[_0x9462('0x46')]);_0x3f97b8[_0x9462('0x48')]=_['intersection'](_0x3f97b8['model'],_0x3f97b8[_0x9462('0x46')]);_0x51772e[_0x9462('0x4a')]=_[_0x9462('0x49')](_0x3f97b8['model'],qs[_0x9462('0x4b')](_0x44dc47[_0x9462('0x46')][_0x9462('0x4b')]));_0x51772e[_0x9462('0x4a')]=_0x51772e[_0x9462('0x4a')][_0x9462('0x68')]?_0x51772e[_0x9462('0x4a')]:_0x3f97b8['model'];_0x51772e[_0x9462('0x4e')]=qs[_0x9462('0x4f')](_0x44dc47[_0x9462('0x46')][_0x9462('0x4f')]);_0x51772e[_0x9462('0x50')]=qs[_0x9462('0x48')](_[_0x9462('0x71')](_0x44dc47['query'],_0x3f97b8[_0x9462('0x48')]));if(_0x44dc47[_0x9462('0x46')][_0x9462('0x53')]){_0x51772e[_0x9462('0x50')]=_[_0x9462('0x51')](_0x51772e[_0x9462('0x50')],{'$or':_['map'](_0x51772e['attributes'],function(_0x252e8a){var _0x3d37ca={};_0x3d37ca[_0x252e8a]={'$like':'%'+_0x44dc47[_0x9462('0x46')][_0x9462('0x53')]+'%'};return _0x3d37ca;})});}_0x51772e=_[_0x9462('0x51')]({},_0x51772e,_0x44dc47[_0x9462('0x54')]);return _0x2eecca[_0x9462('0xbc')](_0x51772e);}})[_0x9462('0x20')](function(_0x5be014){if(_0x5be014){_0x22b973=_0x5be014['length'];if(!_0x44dc47[_0x9462('0x46')][_0x9462('0x69')](_0x9462('0x4d'))){_0x51772e[_0x9462('0x32')]=qs[_0x9462('0x32')](_0x44dc47['query'][_0x9462('0x32')]);_0x51772e['offset']=qs['offset'](_0x44dc47[_0x9462('0x46')][_0x9462('0x2f')]);}return _0x2eecca[_0x9462('0xbc')](_0x51772e);}})[_0x9462('0x20')](function(_0x3682a8){if(_0x3682a8){return _0x3682a8?{'count':_0x22b973,'rows':_0x3682a8}:null;}})['then'](respondWithResult(_0xc90ec3,null))[_0x9462('0x2a')](handleError(_0xc90ec3,null));};exports[_0x9462('0x3d')]=function(_0x11b812,_0x373c1a,_0x3fcc20){var _0x575d56,_0x238b2d,_0x430512;if(_[_0x9462('0x7d')](_0x11b812['body'][_0x9462('0x5b')])||_0x11b812[_0x9462('0x5b')][_0x9462('0x5b')]===''){throw new db['Sequelize'][(_0x9462('0x77'))](_0x9462('0xbd'));}if(_[_0x9462('0x7d')](_0x11b812['body']['to'])){}_0x575d56=_0x11b812['body']['to'];return db[_0x9462('0x41')][_0x9462('0x67')]({'where':{'id':_0x11b812['params']['id']}})[_0x9462('0x20')](handleEntityNotFound(_0x373c1a,null))[_0x9462('0x20')](function(_0x313fbb){if(_0x313fbb){return db['OpenchannelAccount']['find']({'where':{'id':_0x313fbb['id']},'include':[{'model':db[_0x9462('0x82')],'as':_0x9462('0x83'),'include':[{'model':db[_0x9462('0x75')],'as':_0x9462('0xbe'),'where':{[_0x313fbb['mapKey']]:_0x575d56},'limit':0x1,'order':[['updatedAt',_0x9462('0x84')]]}]}]})['then'](handleEntityNotFound(_0x373c1a,null))[_0x9462('0x20')](function(_0x5bb350){if(_0x5bb350&&_0x5bb350['List']){_0x238b2d=_0x5bb350[_0x9462('0x3a')]({'plain':!![]});if(_0x238b2d[_0x9462('0x83')]&&_0x238b2d[_0x9462('0x83')][_0x9462('0xbe')][_0x9462('0x68')]){return _0x238b2d[_0x9462('0x83')][_0x9462('0xbe')][0x0];}return db[_0x9462('0x75')][_0x9462('0x5a')](_[_0x9462('0x1a')](_0x11b812[_0x9462('0x5b')],{'firstName':_0x575d56,[_0x5bb350[_0x9462('0x80')]]:_0x575d56,'phone':_0x575d56,'ListId':_0x238b2d[_0x9462('0x7c')]}));}})['then'](handleEntityNotFound(_0x373c1a,null))[_0x9462('0x20')](function(_0x264343){if(_0x264343){_0x430512=_0x264343;return db[_0x9462('0x8f')]['find']({'where':{'ContactId':_0x430512['id'],'closed':![],'OpenchannelAccountId':_0x238b2d['id']}})[_0x9462('0x20')](function(_0x335225){if(_0x335225){return[_0x335225,![]];}return db[_0x9462('0x8f')][_0x9462('0x5a')]({'UserId':_0x11b812['user']['id'],'ContactId':_0x430512['id'],'OpenchannelAccountId':_0x238b2d['id'],'lastMsgDirection':_0x9462('0xbf'),'firstMsgDirection':_0x9462('0xbf'),'Messages':[_[_0x9462('0x51')](_0x11b812[_0x9462('0x5b')],{'read':![],'body':_0x11b812['body']['body'],'OpenchannelAccountId':_0x238b2d['id'],'UserId':_0x11b812[_0x9462('0x5c')]['id'],'ContactId':_0x430512['id']})]},{'include':[{'model':db[_0x9462('0x9a')],'as':_0x9462('0xc0')}]})[_0x9462('0x20')](function(_0x190e50){return[_0x190e50,!![]];});});}})[_0x9462('0x91')](function(_0x24d1ef,_0xd920ac){if(_0xd920ac){return _0x24d1ef;}return db[_0x9462('0x9a')]['create'](_['merge'](_0x11b812['body'],{'read':![],'body':_0x11b812[_0x9462('0x5b')][_0x9462('0x5b')],'OpenchannelAccountId':_0x238b2d['id'],'OpenchannelInteractionId':_0x24d1ef['id'],'UserId':_0x11b812[_0x9462('0x5c')]['id'],'ContactId':_0x430512['id']}))['then'](function(_0x15367a){_0x24d1ef[_0x9462('0xc1')]['Messages']=[];_0x24d1ef[_0x9462('0xc1')][_0x9462('0xc0')][_0x9462('0x97')](_0x15367a['dataValues']);return _0x24d1ef;});});}})[_0x9462('0x20')](respondWithResult(_0x373c1a,null))[_0x9462('0x2a')](handleError(_0x373c1a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index f3e108e..0cd51a8 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 _0xb43b=['events','../../mysqldb','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x4db64c,_0x3c603f){var _0x50e25a=function(_0x322158){while(--_0x322158){_0x4db64c['push'](_0x4db64c['shift']());}};_0x50e25a(++_0x3c603f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1e40e5,_0x21b323){_0x1e40e5=_0x1e40e5-0x0;var _0x520598=_0xb43b[_0x1e40e5];return _0x520598;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var OpenchannelAccount=require(_0xbb43('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb43('0x2')](0x0);var events={'afterCreate':_0xbb43('0x3'),'afterUpdate':_0xbb43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x131e9e){return function(_0x41aff6,_0x351254,_0x16432a){OpenchannelAccountEvents['emit'](_0x131e9e+':'+_0x41aff6['id'],_0x41aff6);OpenchannelAccountEvents['emit'](_0x131e9e,_0x41aff6);_0x16432a(null);};}for(var e in events){if(events[_0xbb43('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xbb43('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x19f841,_0x10846f){var _0x16595a=function(_0x2413cd){while(--_0x2413cd){_0x19f841['push'](_0x19f841['shift']());}};_0x16595a(++_0x10846f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x480d86,_0x50d7d2){_0x480d86=_0x480d86-0x0;var _0x3f82a8=_0xee5b[_0x480d86];return _0x3f82a8;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b62c355..7e1aff3 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(_0x4acd2a,_0x640ad5){var _0x54601e=function(_0x8fe510){while(--_0x8fe510){_0x4acd2a['push'](_0x4acd2a['shift']());}};_0x54601e(++_0x640ad5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x442a6e,_0x30c482){var _0x2f6e96=function(_0x115406){while(--_0x115406){_0x442a6e['push'](_0x442a6e['shift']());}};_0x2f6e96(++_0x30c482);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index bca5558..90ac4f4 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 _0x2bb0=['lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelAccount,\x20%s,\x20%s','result','catch'];(function(_0x2fca21,_0x3ea0e0){var _0x33f59c=function(_0x21d3ee){while(--_0x21d3ee){_0x2fca21['push'](_0x2fca21['shift']());}};_0x33f59c(++_0x3ea0e0);}(_0x2bb0,0xf3));var _0x02bb=function(_0x35b3e2,_0x5ef840){_0x35b3e2=_0x35b3e2-0x0;var _0x472f9d=_0x2bb0[_0x35b3e2];return _0x472f9d;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});config[_0x02bb('0xa')]=_[_0x02bb('0xb')](config['redis'],{'host':_0x02bb('0xc'),'port':0x18eb});var socket=require(_0x02bb('0xd'))(new Redis(config[_0x02bb('0xa')]));require('./openchannelAccount.socket')[_0x02bb('0xe')](socket);function respondWithRpcPromise(_0x5a4a7f,_0x3edabe,_0x1863ec){return new BPromise(function(_0x4d3418,_0x3f861e){return client[_0x02bb('0xf')](_0x5a4a7f,_0x1863ec)[_0x02bb('0x10')](function(_0x523480){logger[_0x02bb('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3edabe,_0x02bb('0x12'));logger[_0x02bb('0x13')](_0x02bb('0x14'),_0x3edabe,'request\x20sent',JSON[_0x02bb('0x15')](_0x523480));if(_0x523480[_0x02bb('0x16')]){if(_0x523480[_0x02bb('0x16')]['code']===0x1f4){logger[_0x02bb('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x3edabe,_0x523480[_0x02bb('0x16')][_0x02bb('0x17')]);return _0x3f861e(_0x523480[_0x02bb('0x16')][_0x02bb('0x17')]);}logger[_0x02bb('0x16')](_0x02bb('0x18'),_0x3edabe,_0x523480['error']['message']);return _0x4d3418(_0x523480[_0x02bb('0x16')][_0x02bb('0x17')]);}else{logger[_0x02bb('0x11')](_0x02bb('0x18'),_0x3edabe,_0x02bb('0x12'));_0x4d3418(_0x523480[_0x02bb('0x19')]['message']);}})[_0x02bb('0x1a')](function(_0x4b3f78){logger[_0x02bb('0x16')](_0x02bb('0x18'),_0x3edabe,_0x4b3f78);_0x3f861e(_0x4b3f78);});});} \ No newline at end of file +var _0x8cc8=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8cc8,0x177));var _0x88cc=function(_0x1d6265,_0x5dbaae){_0x1d6265=_0x1d6265-0x0;var _0x3bed33=_0x8cc8[_0x1d6265];return _0x3bed33;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var moment=require(_0x88cc('0x2'));var BPromise=require(_0x88cc('0x3'));var rs=require(_0x88cc('0x4'));var fs=require('fs');var Redis=require(_0x88cc('0x5'));var db=require(_0x88cc('0x6'))['db'];var utils=require(_0x88cc('0x7'));var logger=require(_0x88cc('0x8'))(_0x88cc('0x9'));var config=require(_0x88cc('0xa'));var jayson=require(_0x88cc('0xb'));var client=jayson[_0x88cc('0xc')]['http']({'port':0x232a});config['redis']=_[_0x88cc('0xd')](config[_0x88cc('0xe')],{'host':_0x88cc('0xf'),'port':0x18eb});var socket=require(_0x88cc('0x10'))(new Redis(config['redis']));require(_0x88cc('0x11'))[_0x88cc('0x12')](socket);function respondWithRpcPromise(_0x574946,_0x349991,_0x5586aa){return new BPromise(function(_0x379c2a,_0x23aee8){return client[_0x88cc('0x13')](_0x574946,_0x5586aa)[_0x88cc('0x14')](function(_0x5a70a9){logger[_0x88cc('0x15')](_0x88cc('0x16'),_0x349991,_0x88cc('0x17'));logger[_0x88cc('0x18')](_0x88cc('0x19'),_0x349991,_0x88cc('0x17'),JSON[_0x88cc('0x1a')](_0x5a70a9));if(_0x5a70a9[_0x88cc('0x1b')]){if(_0x5a70a9['error'][_0x88cc('0x1c')]===0x1f4){logger[_0x88cc('0x1b')](_0x88cc('0x16'),_0x349991,_0x5a70a9[_0x88cc('0x1b')][_0x88cc('0x1d')]);return _0x23aee8(_0x5a70a9[_0x88cc('0x1b')]['message']);}logger[_0x88cc('0x1b')](_0x88cc('0x16'),_0x349991,_0x5a70a9[_0x88cc('0x1b')][_0x88cc('0x1d')]);return _0x379c2a(_0x5a70a9[_0x88cc('0x1b')]['message']);}else{logger[_0x88cc('0x15')](_0x88cc('0x16'),_0x349991,_0x88cc('0x17'));_0x379c2a(_0x5a70a9[_0x88cc('0x1e')][_0x88cc('0x1d')]);}})['catch'](function(_0x2a08a4){logger[_0x88cc('0x1b')]('OpenchannelAccount,\x20%s,\x20%s',_0x349991,_0x2a08a4);_0x23aee8(_0x2a08a4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 4528f2a..3c0edbd 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 _0xf46a=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','remove','update','emit'];(function(_0x1ad659,_0x1ab26a){var _0x56d7e2=function(_0x3c3f02){while(--_0x3c3f02){_0x1ad659['push'](_0x1ad659['shift']());}};_0x56d7e2(++_0x1ab26a);}(_0xf46a,0xa4));var _0xaf46=function(_0x2a08e2,_0x316672){_0x2a08e2=_0x2a08e2-0x0;var _0x29b048=_0xf46a[_0x2a08e2];return _0x29b048;};'use strict';var OpenchannelAccountEvents=require(_0xaf46('0x0'));var events=['save',_0xaf46('0x1'),_0xaf46('0x2')];function createListener(_0x571132,_0xf4ff9e){return function(_0x3a7936){_0xf4ff9e[_0xaf46('0x3')](_0x571132,_0x3a7936);};}function removeListener(_0x14a6b6,_0x34c69d){return function(){OpenchannelAccountEvents[_0xaf46('0x4')](_0x14a6b6,_0x34c69d);};}exports[_0xaf46('0x5')]=function(_0x399251){for(var _0x3aef9c=0x0,_0x9e9887=events[_0xaf46('0x6')];_0x3aef9c<_0x9e9887;_0x3aef9c++){var _0xa4a618=events[_0x3aef9c];var _0x105943=createListener(_0xaf46('0x7')+_0xa4a618,_0x399251);OpenchannelAccountEvents['on'](_0xa4a618,_0x105943);}}; \ No newline at end of file +var _0x03ce=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x03ce,0x1a1));var _0xe03c=function(_0x1d7bc3,_0x5dc8bf){_0x1d7bc3=_0x1d7bc3-0x0;var _0x2d99d2=_0x03ce[_0x1d7bc3];return _0x2d99d2;};'use strict';var OpenchannelAccountEvents=require(_0xe03c('0x0'));var events=[_0xe03c('0x1'),_0xe03c('0x2'),_0xe03c('0x3')];function createListener(_0x56ac7a,_0x18e8ab){return function(_0x2e9f29){_0x18e8ab[_0xe03c('0x4')](_0x56ac7a,_0x2e9f29);};}function removeListener(_0x527a32,_0x317708){return function(){OpenchannelAccountEvents[_0xe03c('0x5')](_0x527a32,_0x317708);};}exports[_0xe03c('0x6')]=function(_0x2c0e4b){for(var _0x4340f0=0x0,_0x44c54f=events[_0xe03c('0x7')];_0x4340f0<_0x44c54f;_0x4340f0++){var _0x52dda4=events[_0x4340f0];var _0x53c2b0=createListener(_0xe03c('0x8')+_0x52dda4,_0x2c0e4b);OpenchannelAccountEvents['on'](_0x52dda4,_0x53c2b0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 9694f86..7d24db2 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 _0x851e=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer'];(function(_0x2ddb6d,_0x25d45b){var _0x56c103=function(_0x4f73c4){while(--_0x4f73c4){_0x2ddb6d['push'](_0x2ddb6d['shift']());}};_0x56c103(++_0x25d45b);}(_0x851e,0x1df));var _0xe851=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0x851e[_0x412b2a];return _0x5872e3;};'use strict';var multer=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var path=require(_0xe851('0x2'));var timeout=require('connect-timeout');var express=require(_0xe851('0x3'));var router=express[_0xe851('0x4')]();var fs_extra=require(_0xe851('0x5'));var auth=require(_0xe851('0x6'));var interaction=require(_0xe851('0x7'));var config=require(_0xe851('0x8'));var controller=require(_0xe851('0x9'));router[_0xe851('0xa')]('/',auth[_0xe851('0xb')](),controller[_0xe851('0xc')]);router[_0xe851('0xa')](_0xe851('0xd'),auth[_0xe851('0xb')](),controller[_0xe851('0xe')]);router[_0xe851('0xf')]('/',auth[_0xe851('0xb')](),controller[_0xe851('0x10')]);router[_0xe851('0x11')](_0xe851('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe851('0x12')](_0xe851('0xd'),auth[_0xe851('0xb')](),controller[_0xe851('0x13')]);module['exports']=router; \ No newline at end of file +var _0xab0f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer'];(function(_0x466266,_0x39bb43){var _0x1795fa=function(_0x3b61aa){while(--_0x3b61aa){_0x466266['push'](_0x466266['shift']());}};_0x1795fa(++_0x39bb43);}(_0xab0f,0x155));var _0xfab0=function(_0x3c33b4,_0x379e04){_0x3c33b4=_0x3c33b4-0x0;var _0x21ad8d=_0xab0f[_0x3c33b4];return _0x21ad8d;};'use strict';var multer=require(_0xfab0('0x0'));var util=require('util');var path=require(_0xfab0('0x1'));var timeout=require(_0xfab0('0x2'));var express=require(_0xfab0('0x3'));var router=express[_0xfab0('0x4')]();var fs_extra=require(_0xfab0('0x5'));var auth=require(_0xfab0('0x6'));var interaction=require(_0xfab0('0x7'));var config=require(_0xfab0('0x8'));var controller=require(_0xfab0('0x9'));router['get']('/',auth[_0xfab0('0xa')](),controller[_0xfab0('0xb')]);router['get'](_0xfab0('0xc'),auth['isAuthenticated'](),controller[_0xfab0('0xd')]);router[_0xfab0('0xe')]('/',auth[_0xfab0('0xa')](),controller['create']);router[_0xfab0('0xf')](_0xfab0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfab0('0x10')](_0xfab0('0xc'),auth['isAuthenticated'](),controller[_0xfab0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 8644a2f..9ab411c 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 _0x9437=['TEXT','STRING','*,*,*,*','exports'];(function(_0x3fc52a,_0x1412bf){var _0x325e8b=function(_0x5a3535){while(--_0x5a3535){_0x3fc52a['push'](_0x3fc52a['shift']());}};_0x325e8b(++_0x1412bf);}(_0x9437,0xab));var _0x7943=function(_0x511b9b,_0x4516c9){_0x511b9b=_0x511b9b-0x0;var _0x9ce318=_0x9437[_0x511b9b];return _0x9ce318;};'use strict';var Sequelize=require('sequelize');module[_0x7943('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7943('0x1')]()},'description':{'type':Sequelize[_0x7943('0x2')]},'interval':{'type':Sequelize[_0x7943('0x2')],'defaultValue':_0x7943('0x3')}}; \ No newline at end of file +var _0x96f4=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x527a20,_0x347399){var _0x21f5e0=function(_0x2e01f8){while(--_0x2e01f8){_0x527a20['push'](_0x527a20['shift']());}};_0x21f5e0(++_0x347399);}(_0x96f4,0x1a7));var _0x496f=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x96f4[_0x46efd7];return _0x5637e4;};'use strict';var Sequelize=require(_0x496f('0x0'));module[_0x496f('0x1')]={'priority':{'type':Sequelize[_0x496f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x496f('0x3')},'appdata':{'type':Sequelize[_0x496f('0x4')]()},'description':{'type':Sequelize[_0x496f('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x496f('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 135ae78..480824c 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 _0xb326=['destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','offset','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','set','Content-Range','reject','update','then'];(function(_0x211e54,_0x452f37){var _0x12995a=function(_0x25fee9){while(--_0x25fee9){_0x211e54['push'](_0x211e54['shift']());}};_0x12995a(++_0x452f37);}(_0xb326,0x18b));var _0x6b32=function(_0x10f727,_0x231abb){_0x10f727=_0x10f727-0x0;var _0x5487fe=_0xb326[_0x10f727];return _0x5487fe;};'use strict';var emlformat=require(_0x6b32('0x0'));var rimraf=require(_0x6b32('0x1'));var zipdir=require(_0x6b32('0x2'));var jsonpatch=require(_0x6b32('0x3'));var rp=require(_0x6b32('0x4'));var moment=require(_0x6b32('0x5'));var BPromise=require(_0x6b32('0x6'));var Mustache=require(_0x6b32('0x7'));var util=require('util');var path=require(_0x6b32('0x8'));var sox=require('sox');var csv=require(_0x6b32('0x9'));var ejs=require(_0x6b32('0xa'));var fs=require('fs');var fs_extra=require(_0x6b32('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b32('0xc'));var deskjs=require(_0x6b32('0xd'));var toCsv=require(_0x6b32('0x9'));var querystring=require(_0x6b32('0xe'));var Papa=require(_0x6b32('0xf'));var Redis=require('ioredis');var authService=require(_0x6b32('0x10'));var qs=require(_0x6b32('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6b32('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6b32('0x13'));var db=require(_0x6b32('0x14'))['db'];function respondWithStatusCode(_0x1e4eb8,_0x3b9d25){_0x3b9d25=_0x3b9d25||0xcc;return function(_0x500f9e){if(_0x500f9e){return _0x1e4eb8['sendStatus'](_0x3b9d25);}return _0x1e4eb8[_0x6b32('0x15')](_0x3b9d25)[_0x6b32('0x16')]();};}function respondWithResult(_0x2db780,_0x2e8895){_0x2e8895=_0x2e8895||0xc8;return function(_0x3209a6){if(_0x3209a6){return _0x2db780[_0x6b32('0x15')](_0x2e8895)[_0x6b32('0x17')](_0x3209a6);}};}function respondWithFilteredResult(_0x29daf5,_0x46e4fe){return function(_0x5c8312){if(_0x5c8312){var _0x2be6d9=typeof _0x46e4fe['offset']===_0x6b32('0x18')&&typeof _0x46e4fe[_0x6b32('0x19')]===_0x6b32('0x18');var _0x587a8c=_0x5c8312['count'];var _0x363597=_0x2be6d9?0x0:_0x46e4fe['offset'];var _0x4f3a2d=_0x2be6d9?_0x5c8312['count']:_0x46e4fe['offset']+_0x46e4fe[_0x6b32('0x19')];var _0x2c588a;if(_0x4f3a2d>=_0x587a8c){_0x4f3a2d=_0x587a8c;_0x2c588a=0xc8;}else{_0x2c588a=0xce;}_0x29daf5[_0x6b32('0x15')](_0x2c588a);return _0x29daf5[_0x6b32('0x1a')](_0x6b32('0x1b'),_0x363597+'-'+_0x4f3a2d+'/'+_0x587a8c)[_0x6b32('0x17')](_0x5c8312);}return null;};}function patchUpdates(_0x526175){return function(_0x1c699c){try{jsonpatch['apply'](_0x1c699c,_0x526175,!![]);}catch(_0x29a18c){return BPromise[_0x6b32('0x1c')](_0x29a18c);}return _0x1c699c['save']();};}function saveUpdates(_0x1b5777,_0x5325fa){return function(_0x3812c8){if(_0x3812c8){return _0x3812c8[_0x6b32('0x1d')](_0x1b5777)[_0x6b32('0x1e')](function(_0x1c5c00){return _0x1c5c00;});}return null;};}function removeEntity(_0x52b1dc,_0xe0d3b6){return function(_0x43d165){if(_0x43d165){return _0x43d165[_0x6b32('0x1f')]()[_0x6b32('0x1e')](function(){_0x52b1dc[_0x6b32('0x15')](0xcc)[_0x6b32('0x16')]();});}};}function handleEntityNotFound(_0x4d5fcf,_0x1d018e){return function(_0x1015e3){if(!_0x1015e3){_0x4d5fcf[_0x6b32('0x20')](0x194);}return _0x1015e3;};}function handleError(_0x5ea7c8,_0x21c268){_0x21c268=_0x21c268||0x1f4;return function(_0xb8d529){logger[_0x6b32('0x21')](_0xb8d529[_0x6b32('0x22')]);if(_0xb8d529[_0x6b32('0x23')]){delete _0xb8d529['name'];}_0x5ea7c8['status'](_0x21c268)[_0x6b32('0x24')](_0xb8d529);};}exports[_0x6b32('0x25')]=function(_0x31bf38,_0x37b37b){var _0x528023={},_0x58dc0a={},_0xe3f185={'count':0x0,'rows':[]};var _0x122dd2=_[_0x6b32('0x26')](db[_0x6b32('0x27')][_0x6b32('0x28')],function(_0x4aae55){return{'name':_0x4aae55[_0x6b32('0x29')],'type':_0x4aae55[_0x6b32('0x2a')]['key']};});_0x58dc0a[_0x6b32('0x2b')]=_[_0x6b32('0x26')](_0x122dd2,'name');_0x58dc0a[_0x6b32('0x2c')]=_[_0x6b32('0x2d')](_0x31bf38['query']);_0x58dc0a['filters']=_[_0x6b32('0x2e')](_0x58dc0a[_0x6b32('0x2b')],_0x58dc0a[_0x6b32('0x2c')]);_0x528023[_0x6b32('0x2f')]=_[_0x6b32('0x2e')](_0x58dc0a[_0x6b32('0x2b')],qs[_0x6b32('0x30')](_0x31bf38[_0x6b32('0x2c')][_0x6b32('0x30')]));_0x528023[_0x6b32('0x2f')]=_0x528023['attributes'][_0x6b32('0x31')]?_0x528023['attributes']:_0x58dc0a[_0x6b32('0x2b')];if(!_0x31bf38[_0x6b32('0x2c')][_0x6b32('0x32')]('nolimit')){_0x528023[_0x6b32('0x19')]=qs[_0x6b32('0x19')](_0x31bf38['query'][_0x6b32('0x19')]);_0x528023[_0x6b32('0x33')]=qs[_0x6b32('0x33')](_0x31bf38['query']['offset']);}_0x528023['order']=qs[_0x6b32('0x34')](_0x31bf38['query'][_0x6b32('0x34')]);_0x528023[_0x6b32('0x35')]=qs['filters'](_[_0x6b32('0x36')](_0x31bf38['query'],_0x58dc0a[_0x6b32('0x37')]),_0x122dd2);if(_0x31bf38[_0x6b32('0x2c')][_0x6b32('0x38')]){_0x528023[_0x6b32('0x35')]=_[_0x6b32('0x39')](_0x528023['where'],{'$or':_[_0x6b32('0x26')](_0x122dd2,function(_0x4fae69){if(_0x4fae69[_0x6b32('0x2a')]!==_0x6b32('0x3a')){var _0x29ff09={};_0x29ff09[_0x4fae69[_0x6b32('0x23')]]={'$like':'%'+_0x31bf38[_0x6b32('0x2c')][_0x6b32('0x38')]+'%'};return _0x29ff09;}})});}_0x528023=_[_0x6b32('0x39')]({},_0x528023,_0x31bf38[_0x6b32('0x3b')]);var _0x460bea={'where':_0x528023[_0x6b32('0x35')]};return db[_0x6b32('0x27')][_0x6b32('0x3c')](_0x460bea)[_0x6b32('0x1e')](function(_0x2337c8){_0xe3f185[_0x6b32('0x3c')]=_0x2337c8;if(_0x31bf38[_0x6b32('0x2c')][_0x6b32('0x3d')]){_0x528023[_0x6b32('0x3e')]=[{'all':!![]}];}return db[_0x6b32('0x27')][_0x6b32('0x3f')](_0x528023);})['then'](function(_0xb6731a){_0xe3f185[_0x6b32('0x40')]=_0xb6731a;return _0xe3f185;})[_0x6b32('0x1e')](respondWithFilteredResult(_0x37b37b,_0x528023))['catch'](handleError(_0x37b37b,null));};exports[_0x6b32('0x41')]=function(_0x11e833,_0x2a77b2){var _0x546684={'raw':!![],'where':{'id':_0x11e833[_0x6b32('0x42')]['id']}},_0x40c716={};_0x40c716['model']=_[_0x6b32('0x2d')](db[_0x6b32('0x27')][_0x6b32('0x28')]);_0x40c716[_0x6b32('0x2c')]=_[_0x6b32('0x2d')](_0x11e833[_0x6b32('0x2c')]);_0x40c716[_0x6b32('0x37')]=_[_0x6b32('0x2e')](_0x40c716[_0x6b32('0x2b')],_0x40c716[_0x6b32('0x2c')]);_0x546684[_0x6b32('0x2f')]=_[_0x6b32('0x2e')](_0x40c716[_0x6b32('0x2b')],qs[_0x6b32('0x30')](_0x11e833[_0x6b32('0x2c')][_0x6b32('0x30')]));_0x546684[_0x6b32('0x2f')]=_0x546684['attributes'][_0x6b32('0x31')]?_0x546684[_0x6b32('0x2f')]:_0x40c716['model'];if(_0x11e833['query']['includeAll']){_0x546684[_0x6b32('0x3e')]=[{'all':!![]}];}_0x546684=_['merge']({},_0x546684,_0x11e833[_0x6b32('0x3b')]);return db[_0x6b32('0x27')][_0x6b32('0x43')](_0x546684)[_0x6b32('0x1e')](handleEntityNotFound(_0x2a77b2,null))['then'](respondWithResult(_0x2a77b2,null))[_0x6b32('0x44')](handleError(_0x2a77b2,null));};exports[_0x6b32('0x45')]=function(_0x1666dc,_0x3e953d){return db['OpenchannelApplication'][_0x6b32('0x45')](_0x1666dc['body'],{})[_0x6b32('0x1e')](respondWithResult(_0x3e953d,0xc9))[_0x6b32('0x44')](handleError(_0x3e953d,null));};exports[_0x6b32('0x1d')]=function(_0x2ca0c8,_0x134864){if(_0x2ca0c8[_0x6b32('0x46')]['id']){delete _0x2ca0c8[_0x6b32('0x46')]['id'];}return db[_0x6b32('0x27')]['find']({'where':{'id':_0x2ca0c8[_0x6b32('0x42')]['id']}})[_0x6b32('0x1e')](handleEntityNotFound(_0x134864,null))[_0x6b32('0x1e')](saveUpdates(_0x2ca0c8['body'],null))[_0x6b32('0x1e')](respondWithResult(_0x134864,null))[_0x6b32('0x44')](handleError(_0x134864,null));};exports[_0x6b32('0x1f')]=function(_0x1974c8,_0x1e516b){return db[_0x6b32('0x27')][_0x6b32('0x43')]({'where':{'id':_0x1974c8[_0x6b32('0x42')]['id']}})[_0x6b32('0x1e')](handleEntityNotFound(_0x1e516b,null))[_0x6b32('0x1e')](removeEntity(_0x1e516b,null))[_0x6b32('0x44')](handleError(_0x1e516b,null));}; \ No newline at end of file +var _0x1307=['../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelApplication','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5a7ce1,_0xb44041){var _0x1965c2=function(_0x539523){while(--_0x539523){_0x5a7ce1['push'](_0x5a7ce1['shift']());}};_0x1965c2(++_0xb44041);}(_0x1307,0x190));var _0x7130=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x1307[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0x7130('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7130('0x1'));var jsonpatch=require(_0x7130('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7130('0x3'));var Mustache=require(_0x7130('0x4'));var util=require('util');var path=require(_0x7130('0x5'));var sox=require(_0x7130('0x6'));var csv=require(_0x7130('0x7'));var ejs=require(_0x7130('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7130('0x9'));var crypto=require(_0x7130('0xa'));var jsforce=require(_0x7130('0xb'));var deskjs=require(_0x7130('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7130('0xd'));var Papa=require(_0x7130('0xe'));var Redis=require(_0x7130('0xf'));var authService=require(_0x7130('0x10'));var qs=require(_0x7130('0x11'));var as=require(_0x7130('0x12'));var hardwareService=require(_0x7130('0x13'));var logger=require(_0x7130('0x14'))('api');var utils=require(_0x7130('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7130('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ec213,_0x54f797){_0x54f797=_0x54f797||0xcc;return function(_0x23d666){if(_0x23d666){return _0x2ec213[_0x7130('0x17')](_0x54f797);}return _0x2ec213[_0x7130('0x18')](_0x54f797)[_0x7130('0x19')]();};}function respondWithResult(_0x1dbaf3,_0x398391){_0x398391=_0x398391||0xc8;return function(_0x81611){if(_0x81611){return _0x1dbaf3[_0x7130('0x18')](_0x398391)['json'](_0x81611);}};}function respondWithFilteredResult(_0x583ba9,_0x2529f7){return function(_0x434de4){if(_0x434de4){var _0xfe11ba=typeof _0x2529f7[_0x7130('0x1a')]==='undefined'&&typeof _0x2529f7[_0x7130('0x1b')]===_0x7130('0x1c');var _0x44e5b2=_0x434de4[_0x7130('0x1d')];var _0x441743=_0xfe11ba?0x0:_0x2529f7[_0x7130('0x1a')];var _0x421713=_0xfe11ba?_0x434de4[_0x7130('0x1d')]:_0x2529f7[_0x7130('0x1a')]+_0x2529f7[_0x7130('0x1b')];var _0x47ea53;if(_0x421713>=_0x44e5b2){_0x421713=_0x44e5b2;_0x47ea53=0xc8;}else{_0x47ea53=0xce;}_0x583ba9[_0x7130('0x18')](_0x47ea53);return _0x583ba9['set'](_0x7130('0x1e'),_0x441743+'-'+_0x421713+'/'+_0x44e5b2)[_0x7130('0x1f')](_0x434de4);}return null;};}function patchUpdates(_0x32b1f4){return function(_0x62b889){try{jsonpatch['apply'](_0x62b889,_0x32b1f4,!![]);}catch(_0x451855){return BPromise['reject'](_0x451855);}return _0x62b889[_0x7130('0x20')]();};}function saveUpdates(_0x5620af,_0x175071){return function(_0x3c9fee){if(_0x3c9fee){return _0x3c9fee[_0x7130('0x21')](_0x5620af)[_0x7130('0x22')](function(_0x3d6986){return _0x3d6986;});}return null;};}function removeEntity(_0x1a1021,_0x9bcad4){return function(_0x94dda7){if(_0x94dda7){return _0x94dda7[_0x7130('0x23')]()[_0x7130('0x22')](function(){_0x1a1021['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a5a5,_0x2a92d3){return function(_0x194c57){if(!_0x194c57){_0x44a5a5[_0x7130('0x17')](0x194);}return _0x194c57;};}function handleError(_0x71c231,_0x1c8fef){_0x1c8fef=_0x1c8fef||0x1f4;return function(_0x1d87a0){logger['error'](_0x1d87a0[_0x7130('0x24')]);if(_0x1d87a0[_0x7130('0x25')]){delete _0x1d87a0['name'];}_0x71c231['status'](_0x1c8fef)['send'](_0x1d87a0);};}exports[_0x7130('0x26')]=function(_0x25527d,_0xbff1cb){var _0x36e7e1={},_0x59c2d0={},_0xf644d8={'count':0x0,'rows':[]};var _0x300d89=_[_0x7130('0x27')](db['OpenchannelApplication']['rawAttributes'],function(_0x22bfca){return{'name':_0x22bfca[_0x7130('0x28')],'type':_0x22bfca[_0x7130('0x29')][_0x7130('0x2a')]};});_0x59c2d0['model']=_[_0x7130('0x27')](_0x300d89,'name');_0x59c2d0[_0x7130('0x2b')]=_[_0x7130('0x2c')](_0x25527d[_0x7130('0x2b')]);_0x59c2d0[_0x7130('0x2d')]=_[_0x7130('0x2e')](_0x59c2d0['model'],_0x59c2d0[_0x7130('0x2b')]);_0x36e7e1['attributes']=_[_0x7130('0x2e')](_0x59c2d0[_0x7130('0x2f')],qs[_0x7130('0x30')](_0x25527d['query'][_0x7130('0x30')]));_0x36e7e1[_0x7130('0x31')]=_0x36e7e1['attributes'][_0x7130('0x32')]?_0x36e7e1[_0x7130('0x31')]:_0x59c2d0[_0x7130('0x2f')];if(!_0x25527d[_0x7130('0x2b')]['hasOwnProperty'](_0x7130('0x33'))){_0x36e7e1[_0x7130('0x1b')]=qs[_0x7130('0x1b')](_0x25527d[_0x7130('0x2b')][_0x7130('0x1b')]);_0x36e7e1[_0x7130('0x1a')]=qs['offset'](_0x25527d[_0x7130('0x2b')][_0x7130('0x1a')]);}_0x36e7e1['order']=qs[_0x7130('0x34')](_0x25527d[_0x7130('0x2b')][_0x7130('0x34')]);_0x36e7e1[_0x7130('0x35')]=qs[_0x7130('0x2d')](_[_0x7130('0x36')](_0x25527d[_0x7130('0x2b')],_0x59c2d0[_0x7130('0x2d')]),_0x300d89);if(_0x25527d[_0x7130('0x2b')][_0x7130('0x37')]){_0x36e7e1[_0x7130('0x35')]=_[_0x7130('0x38')](_0x36e7e1[_0x7130('0x35')],{'$or':_[_0x7130('0x27')](_0x300d89,function(_0x2edc3d){if(_0x2edc3d[_0x7130('0x29')]!==_0x7130('0x39')){var _0xcbd247={};_0xcbd247[_0x2edc3d[_0x7130('0x25')]]={'$like':'%'+_0x25527d[_0x7130('0x2b')][_0x7130('0x37')]+'%'};return _0xcbd247;}})});}_0x36e7e1=_['merge']({},_0x36e7e1,_0x25527d[_0x7130('0x3a')]);var _0x504c30={'where':_0x36e7e1[_0x7130('0x35')]};return db[_0x7130('0x3b')][_0x7130('0x1d')](_0x504c30)[_0x7130('0x22')](function(_0x10b33b){_0xf644d8[_0x7130('0x1d')]=_0x10b33b;if(_0x25527d[_0x7130('0x2b')][_0x7130('0x3c')]){_0x36e7e1['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x7130('0x3d')](_0x36e7e1);})['then'](function(_0x56880a){_0xf644d8[_0x7130('0x3e')]=_0x56880a;return _0xf644d8;})[_0x7130('0x22')](respondWithFilteredResult(_0xbff1cb,_0x36e7e1))['catch'](handleError(_0xbff1cb,null));};exports[_0x7130('0x3f')]=function(_0x5b8022,_0x4f7bd5){var _0x309bf7={'raw':!![],'where':{'id':_0x5b8022[_0x7130('0x40')]['id']}},_0x53055f={};_0x53055f[_0x7130('0x2f')]=_[_0x7130('0x2c')](db[_0x7130('0x3b')]['rawAttributes']);_0x53055f[_0x7130('0x2b')]=_[_0x7130('0x2c')](_0x5b8022['query']);_0x53055f[_0x7130('0x2d')]=_[_0x7130('0x2e')](_0x53055f[_0x7130('0x2f')],_0x53055f['query']);_0x309bf7['attributes']=_['intersection'](_0x53055f[_0x7130('0x2f')],qs[_0x7130('0x30')](_0x5b8022[_0x7130('0x2b')][_0x7130('0x30')]));_0x309bf7[_0x7130('0x31')]=_0x309bf7[_0x7130('0x31')]['length']?_0x309bf7['attributes']:_0x53055f[_0x7130('0x2f')];if(_0x5b8022[_0x7130('0x2b')][_0x7130('0x3c')]){_0x309bf7[_0x7130('0x41')]=[{'all':!![]}];}_0x309bf7=_['merge']({},_0x309bf7,_0x5b8022[_0x7130('0x3a')]);return db['OpenchannelApplication'][_0x7130('0x42')](_0x309bf7)[_0x7130('0x22')](handleEntityNotFound(_0x4f7bd5,null))['then'](respondWithResult(_0x4f7bd5,null))[_0x7130('0x43')](handleError(_0x4f7bd5,null));};exports[_0x7130('0x44')]=function(_0x1fe3b3,_0xe50dc1){return db[_0x7130('0x3b')][_0x7130('0x44')](_0x1fe3b3['body'],{})[_0x7130('0x22')](respondWithResult(_0xe50dc1,0xc9))[_0x7130('0x43')](handleError(_0xe50dc1,null));};exports['update']=function(_0x2c8609,_0x352f34){if(_0x2c8609[_0x7130('0x45')]['id']){delete _0x2c8609[_0x7130('0x45')]['id'];}return db['OpenchannelApplication'][_0x7130('0x42')]({'where':{'id':_0x2c8609[_0x7130('0x40')]['id']}})[_0x7130('0x22')](handleEntityNotFound(_0x352f34,null))['then'](saveUpdates(_0x2c8609[_0x7130('0x45')],null))[_0x7130('0x22')](respondWithResult(_0x352f34,null))['catch'](handleError(_0x352f34,null));};exports[_0x7130('0x23')]=function(_0x1c4dd9,_0x2511d2){return db[_0x7130('0x3b')]['find']({'where':{'id':_0x1c4dd9[_0x7130('0x40')]['id']}})[_0x7130('0x22')](handleEntityNotFound(_0x2511d2,null))[_0x7130('0x22')](removeEntity(_0x2511d2,null))['catch'](handleError(_0x2511d2,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index dda4439..b67bb3a 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 _0x345b=['define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','exports'];(function(_0x3347b6,_0x384f71){var _0x48c3fa=function(_0x3af891){while(--_0x3af891){_0x3347b6['push'](_0x3347b6['shift']());}};_0x48c3fa(++_0x384f71);}(_0x345b,0x124));var _0xb345=function(_0x34480a,_0x162f49){_0x34480a=_0x34480a-0x0;var _0x47f40d=_0x345b[_0x34480a];return _0x47f40d;};'use strict';var _=require(_0xb345('0x0'));var util=require(_0xb345('0x1'));var logger=require('../../config/logger')(_0xb345('0x2'));var moment=require(_0xb345('0x3'));var BPromise=require('bluebird');var rp=require(_0xb345('0x4'));var fs=require('fs');var path=require(_0xb345('0x5'));var rimraf=require(_0xb345('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0xb345('0x7')]=function(_0x7f9620,_0x57797a){return _0x7f9620[_0xb345('0x8')](_0xb345('0x9'),attributes,{'tableName':_0xb345('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb345('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2a50=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelApplication.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a50,0xad));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x02a5('0x0'));var util=require(_0x02a5('0x1'));var logger=require(_0x02a5('0x2'))(_0x02a5('0x3'));var moment=require(_0x02a5('0x4'));var BPromise=require(_0x02a5('0x5'));var rp=require(_0x02a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x02a5('0x7'));var attributes=require(_0x02a5('0x8'));module['exports']=function(_0x1aa1a6,_0x227391){return _0x1aa1a6['define'](_0x02a5('0x9'),attributes,{'tableName':_0x02a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x02a5('0xb'),'collate':_0x02a5('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index af9d4b4..14047c9 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 _0x06b5=['options','where','attributes','limit','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','body'];(function(_0xe70083,_0x4106b7){var _0x4eca21=function(_0x3e062a){while(--_0x3e062a){_0xe70083['push'](_0xe70083['shift']());}};_0x4eca21(++_0x4106b7);}(_0x06b5,0x1f2));var _0x506b=function(_0x390000,_0x377d4a){_0x390000=_0x390000-0x0;var _0x30512e=_0x06b5[_0x390000];return _0x30512e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x506b('0x0'));var BPromise=require(_0x506b('0x1'));var rs=require(_0x506b('0x2'));var fs=require('fs');var Redis=require(_0x506b('0x3'));var db=require(_0x506b('0x4'))['db'];var utils=require(_0x506b('0x5'));var logger=require(_0x506b('0x6'))(_0x506b('0x7'));var config=require('../../config/environment');var jayson=require(_0x506b('0x8'));var client=jayson['client'][_0x506b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32c6d9,_0x4a7c1d,_0x70785a){return new BPromise(function(_0x498888,_0xcdbc58){return client[_0x506b('0xa')](_0x32c6d9,_0x70785a)[_0x506b('0xb')](function(_0x2dcae1){logger['info'](_0x506b('0xc'),_0x4a7c1d,_0x506b('0xd'));logger['debug'](_0x506b('0xe'),_0x4a7c1d,_0x506b('0xd'),JSON[_0x506b('0xf')](_0x2dcae1));if(_0x2dcae1['error']){if(_0x2dcae1[_0x506b('0x10')][_0x506b('0x11')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x4a7c1d,_0x2dcae1['error'][_0x506b('0x12')]);return _0xcdbc58(_0x2dcae1['error'][_0x506b('0x12')]);}logger[_0x506b('0x10')](_0x506b('0xc'),_0x4a7c1d,_0x2dcae1[_0x506b('0x10')][_0x506b('0x12')]);return _0x498888(_0x2dcae1[_0x506b('0x10')][_0x506b('0x12')]);}else{logger[_0x506b('0x13')](_0x506b('0xc'),_0x4a7c1d,_0x506b('0xd'));_0x498888(_0x2dcae1['result'][_0x506b('0x12')]);}})[_0x506b('0x14')](function(_0x2dd7ec){logger[_0x506b('0x10')](_0x506b('0xc'),_0x4a7c1d,_0x2dd7ec);_0xcdbc58(_0x2dd7ec);});});}exports[_0x506b('0x15')]=function(_0x52ade6){var _0x57945e=this;return new Promise(function(_0x59db02,_0x224b5a){return db[_0x506b('0x16')]['update'](_0x52ade6[_0x506b('0x17')],{'raw':_0x52ade6[_0x506b('0x18')]?_0x52ade6[_0x506b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ade6['options']?_0x52ade6[_0x506b('0x18')][_0x506b('0x19')]||null:null,'attributes':_0x52ade6[_0x506b('0x18')]?_0x52ade6[_0x506b('0x18')][_0x506b('0x1a')]||null:null,'limit':_0x52ade6[_0x506b('0x18')]?_0x52ade6[_0x506b('0x18')][_0x506b('0x1b')]||null:null})[_0x506b('0xb')](function(_0x5c7224){logger['info'](_0x506b('0x15'),_0x52ade6);logger[_0x506b('0x1c')](_0x506b('0x15'),_0x52ade6,JSON['stringify'](_0x5c7224));_0x59db02(_0x5c7224);})[_0x506b('0x14')](function(_0x474cec){logger[_0x506b('0x10')](_0x506b('0x15'),_0x474cec[_0x506b('0x12')],_0x52ade6);_0x224b5a(_0x57945e[_0x506b('0x10')](0x1f4,_0x474cec[_0x506b('0x12')]));});});}; \ No newline at end of file +var _0xdbf8=['error','code','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','raw','options','attributes','limit','lodash','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf8,0xa2));var _0x8dbf=function(_0x3f8e71,_0x561727){_0x3f8e71=_0x3f8e71-0x0;var _0x9cfc5=_0xdbf8[_0x3f8e71];return _0x9cfc5;};'use strict';var _=require(_0x8dbf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8dbf('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8dbf('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8dbf('0x3'));var config=require(_0x8dbf('0x4'));var jayson=require(_0x8dbf('0x5'));var client=jayson[_0x8dbf('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d60d8,_0x22f5e9,_0x1dbaab){return new BPromise(function(_0x447043,_0x36ef76){return client['request'](_0x4d60d8,_0x1dbaab)[_0x8dbf('0x7')](function(_0x397f59){logger['info'](_0x8dbf('0x8'),_0x22f5e9,_0x8dbf('0x9'));logger[_0x8dbf('0xa')](_0x8dbf('0xb'),_0x22f5e9,_0x8dbf('0x9'),JSON[_0x8dbf('0xc')](_0x397f59));if(_0x397f59[_0x8dbf('0xd')]){if(_0x397f59['error'][_0x8dbf('0xe')]===0x1f4){logger['error'](_0x8dbf('0x8'),_0x22f5e9,_0x397f59['error'][_0x8dbf('0xf')]);return _0x36ef76(_0x397f59[_0x8dbf('0xd')][_0x8dbf('0xf')]);}logger[_0x8dbf('0xd')](_0x8dbf('0x8'),_0x22f5e9,_0x397f59['error'][_0x8dbf('0xf')]);return _0x447043(_0x397f59[_0x8dbf('0xd')][_0x8dbf('0xf')]);}else{logger[_0x8dbf('0x10')](_0x8dbf('0x8'),_0x22f5e9,_0x8dbf('0x9'));_0x447043(_0x397f59['result']['message']);}})[_0x8dbf('0x11')](function(_0x56471c){logger['error'](_0x8dbf('0x8'),_0x22f5e9,_0x56471c);_0x36ef76(_0x56471c);});});}exports[_0x8dbf('0x12')]=function(_0x5c1161){var _0x349d29=this;return new Promise(function(_0x1ef062,_0x439709){return db[_0x8dbf('0x13')][_0x8dbf('0x14')](_0x5c1161['body'],{'raw':_0x5c1161['options']?_0x5c1161['options'][_0x8dbf('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c1161[_0x8dbf('0x16')]?_0x5c1161['options']['where']||null:null,'attributes':_0x5c1161[_0x8dbf('0x16')]?_0x5c1161[_0x8dbf('0x16')][_0x8dbf('0x17')]||null:null,'limit':_0x5c1161[_0x8dbf('0x16')]?_0x5c1161[_0x8dbf('0x16')][_0x8dbf('0x18')]||null:null})[_0x8dbf('0x7')](function(_0xeee4cf){logger[_0x8dbf('0x10')]('UpdateOpenchannelApplication',_0x5c1161);logger[_0x8dbf('0xa')](_0x8dbf('0x12'),_0x5c1161,JSON['stringify'](_0xeee4cf));_0x1ef062(_0xeee4cf);})[_0x8dbf('0x11')](function(_0x3afbd6){logger['error'](_0x8dbf('0x12'),_0x3afbd6[_0x8dbf('0xf')],_0x5c1161);_0x439709(_0x349d29['error'](0x1f4,_0x3afbd6[_0x8dbf('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 98b933a..5bacea4 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 _0x8de9=['/:id','update','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put'];(function(_0x31ddb5,_0x289bc3){var _0x2031fd=function(_0x3bef64){while(--_0x3bef64){_0x31ddb5['push'](_0x31ddb5['shift']());}};_0x2031fd(++_0x289bc3);}(_0x8de9,0x1b3));var _0x98de=function(_0x4e5fe3,_0x2dcac4){_0x4e5fe3=_0x4e5fe3-0x0;var _0x16cb9f=_0x8de9[_0x4e5fe3];return _0x16cb9f;};'use strict';var multer=require(_0x98de('0x0'));var util=require(_0x98de('0x1'));var path=require(_0x98de('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x98de('0x3')]();var fs_extra=require(_0x98de('0x4'));var auth=require(_0x98de('0x5'));var interaction=require(_0x98de('0x6'));var config=require(_0x98de('0x7'));var controller=require(_0x98de('0x8'));router[_0x98de('0x9')]('/',auth[_0x98de('0xa')](),controller[_0x98de('0xb')]);router[_0x98de('0x9')](_0x98de('0xc'),auth[_0x98de('0xa')](),controller[_0x98de('0xd')]);router['get']('/:id',auth[_0x98de('0xa')](),controller[_0x98de('0xe')]);router[_0x98de('0x9')](_0x98de('0xf'),auth['isAuthenticated'](),controller[_0x98de('0x10')]);router[_0x98de('0x9')](_0x98de('0x11'),auth[_0x98de('0xa')](),controller[_0x98de('0x12')]);router[_0x98de('0x13')]('/',auth[_0x98de('0xa')](),controller['create']);router[_0x98de('0x13')](_0x98de('0xf'),auth[_0x98de('0xa')](),controller[_0x98de('0x14')]);router[_0x98de('0x13')](_0x98de('0x15'),auth[_0x98de('0xa')](),interaction[_0x98de('0x16')](_0x98de('0x17'),_0x98de('0x18')),controller[_0x98de('0x19')]);router[_0x98de('0x1a')](_0x98de('0x1b'),auth['isAuthenticated'](),interaction[_0x98de('0x16')](_0x98de('0x17'),'openchannelinteraction:update'),controller[_0x98de('0x1c')]);router['delete'](_0x98de('0x1b'),auth[_0x98de('0xa')](),interaction[_0x98de('0x16')](_0x98de('0x17'),_0x98de('0x1d')),controller[_0x98de('0x1e')]);router['delete'](_0x98de('0x15'),auth[_0x98de('0xa')](),controller[_0x98de('0x1f')]);module[_0x98de('0x20')]=router; \ No newline at end of file +var _0x7b7f=['connect-timeout','express','Router','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannel','put','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b7f,0x13d));var _0xf7b7=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x7b7f[_0x18afca];return _0x11603f;};'use strict';var multer=require(_0xf7b7('0x0'));var util=require(_0xf7b7('0x1'));var path=require(_0xf7b7('0x2'));var timeout=require(_0xf7b7('0x3'));var express=require(_0xf7b7('0x4'));var router=express[_0xf7b7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf7b7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf7b7('0x7'));router[_0xf7b7('0x8')]('/',auth[_0xf7b7('0x9')](),controller[_0xf7b7('0xa')]);router['get'](_0xf7b7('0xb'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0xc')]);router[_0xf7b7('0x8')](_0xf7b7('0xd'),auth['isAuthenticated'](),controller[_0xf7b7('0xe')]);router['get'](_0xf7b7('0xf'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x10')]);router[_0xf7b7('0x8')](_0xf7b7('0x11'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x12')]);router['post']('/',auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x13')]);router[_0xf7b7('0x14')](_0xf7b7('0xf'),auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x15')]);router[_0xf7b7('0x14')](_0xf7b7('0x16'),auth['isAuthenticated'](),interaction[_0xf7b7('0x17')](_0xf7b7('0x18'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xf7b7('0x19')](_0xf7b7('0xd'),auth['isAuthenticated'](),interaction[_0xf7b7('0x17')](_0xf7b7('0x18'),_0xf7b7('0x1a')),controller['update']);router['delete']('/:id',auth[_0xf7b7('0x9')](),interaction['tracked'](_0xf7b7('0x18'),_0xf7b7('0x1b')),controller[_0xf7b7('0x1c')]);router[_0xf7b7('0x1d')]('/:id/tags',auth[_0xf7b7('0x9')](),controller[_0xf7b7('0x1e')]);module[_0xf7b7('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 a1b09e4..8591efe 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 _0x6be1=['exports','STRING','DATE','ENUM','out','BOOLEAN','INTEGER','sequelize'];(function(_0x18cd03,_0x3416ce){var _0x324541=function(_0x1c8f3a){while(--_0x1c8f3a){_0x18cd03['push'](_0x18cd03['shift']());}};_0x324541(++_0x3416ce);}(_0x6be1,0x12f));var _0x16be=function(_0x534ea9,_0x1d22b5){_0x534ea9=_0x534ea9-0x0;var _0x244ec9=_0x6be1[_0x534ea9];return _0x244ec9;};'use strict';var Sequelize=require(_0x16be('0x0'));module[_0x16be('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x16be('0x2')]},'note':{'type':Sequelize[_0x16be('0x2')]},'read1stAt':{'type':Sequelize[_0x16be('0x3')]},'threadId':{'type':Sequelize[_0x16be('0x2')]},'externalUrl':{'type':Sequelize[_0x16be('0x2')]},'lastMsgAt':{'type':Sequelize[_0x16be('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x16be('0x4')]('in',_0x16be('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x16be('0x4')]('in',_0x16be('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x16be('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x16be('0x7')]}}; \ No newline at end of file +var _0xcc40=['INTEGER','sequelize','DATE','STRING','out','BOOLEAN'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xcc40,0x97));var _0x0cc4=function(_0x26aedb,_0x379d14){_0x26aedb=_0x26aedb-0x0;var _0x4dca33=_0xcc40[_0x26aedb];return _0x4dca33;};'use strict';var Sequelize=require(_0x0cc4('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0cc4('0x1')]},'disposition':{'type':Sequelize[_0x0cc4('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0cc4('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0cc4('0x1')]},'threadId':{'type':Sequelize[_0x0cc4('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0cc4('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0cc4('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0cc4('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x0cc4('0x4')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0cc4('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 54428e8..6a7bcbb 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 _0x832d=['$gte','split','format','includeAll','include','findAll','rows','addTags','spread','Tag','color','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','push','User','fullname','CmContact','firstName','Attachment','Messages','direction','secret','get','Openchannel','Owner','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','filter','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','lastName','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','merge','options','find','body','describe','OpenchannelMessage','ids','omit','getMessages','length','hasOwnProperty','offset','order','sort','where','pick','OpenchannelInteractionId'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x832d,0x1a9));var _0xd832=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x832d[_0x3947c9];return _0x2e7871;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd832('0x0'));var moment=require('moment');var util=require(_0xd832('0x1'));var path=require('path');var ejs=require(_0xd832('0x2'));var fs=require('fs');var _=require(_0xd832('0x3'));var Redis=require(_0xd832('0x4'));var interaction=require(_0xd832('0x5'));var qs=require(_0xd832('0x6'));var pdf=require(_0xd832('0x7'));var logger=require(_0xd832('0x8'))('api');var config=require('../../config/environment');var db=require(_0xd832('0x9'))['db'];config[_0xd832('0xa')]=_[_0xd832('0xb')](config['redis'],{'host':_0xd832('0xc'),'port':0x18eb});var socket=require(_0xd832('0xd'))(new Redis(config['redis']));require(_0xd832('0xe'))[_0xd832('0xf')](socket);function respondWithStatusCode(_0x286cc0,_0x2d3949){_0x2d3949=_0x2d3949||0xcc;return function(_0xc134){if(_0xc134){return _0x286cc0[_0xd832('0x10')](_0x2d3949);}return _0x286cc0[_0xd832('0x11')](_0x2d3949)[_0xd832('0x12')]();};}function respondWithResult(_0x57b3be,_0x5c1a08){_0x5c1a08=_0x5c1a08||0xc8;return function(_0x4f6034){if(_0x4f6034){return _0x57b3be['status'](_0x5c1a08)['json'](_0x4f6034);}};}function respondWithFilteredResult(_0x5a4494,_0x56d0ae){return function(_0x4c6783){if(_0x4c6783){var _0x4ae91b=typeof _0x56d0ae['offset']===_0xd832('0x13')&&typeof _0x56d0ae[_0xd832('0x14')]==='undefined';var _0x94058e=_0x4c6783[_0xd832('0x15')];var _0x9d4c73=_0x4ae91b?0x0:_0x56d0ae['offset'];var _0x2cb581=_0x4ae91b?_0x4c6783[_0xd832('0x15')]:_0x56d0ae['offset']+_0x56d0ae[_0xd832('0x14')];var _0x10b4d1;if(_0x2cb581>=_0x94058e){_0x2cb581=_0x94058e;_0x10b4d1=0xc8;}else{_0x10b4d1=0xce;}_0x5a4494['status'](_0x10b4d1);return _0x5a4494[_0xd832('0x16')](_0xd832('0x17'),_0x9d4c73+'-'+_0x2cb581+'/'+_0x94058e)[_0xd832('0x18')](_0x4c6783);}return null;};}function saveUpdates(_0x186d8d){return function(_0x20fc80){if(_0x20fc80){return _0x20fc80[_0xd832('0x19')](_0x186d8d)[_0xd832('0x1a')](function(_0x323cf9){return _0x323cf9;});}return null;};}function removeEntity(_0x2f65eb){return function(_0x50ec8a){if(_0x50ec8a){return _0x50ec8a[_0xd832('0x1b')]()[_0xd832('0x1a')](function(){_0x2f65eb[_0xd832('0x11')](0xcc)[_0xd832('0x12')]();});}};}function handleEntityNotFound(_0x13d9ac){return function(_0x4aafcd){if(!_0x4aafcd){_0x13d9ac[_0xd832('0x10')](0x194);}return _0x4aafcd;};}function handleError(_0x463a31,_0xcd039){_0xcd039=_0xcd039||0x1f4;return function(_0x47ad31){logger['error'](_0x47ad31[_0xd832('0x1c')]);if(_0x47ad31[_0xd832('0x1d')]){delete _0x47ad31[_0xd832('0x1d')];}_0x463a31[_0xd832('0x11')](_0xcd039)['send'](_0x47ad31);};}exports[_0xd832('0x1e')]=function(_0x20832c,_0x30d69a){var _0x251f49={};var _0x47c8e4=_[_0xd832('0x1f')](db[_0xd832('0x20')][_0xd832('0x21')],function(_0x44e92f){return{'name':_0x44e92f[_0xd832('0x22')],'type':_0x44e92f[_0xd832('0x23')][_0xd832('0x24')]};});_0x251f49=qs[_0xd832('0x25')](_0x47c8e4,_0x20832c);return interaction['findAll'](_0xd832('0x26'),_0x20832c[_0xd832('0x27')],_0x20832c[_0xd832('0x28')],_0x251f49,_0x47c8e4)[_0xd832('0x1a')](respondWithFilteredResult(_0x30d69a,_0x251f49))[_0xd832('0x29')](handleError(_0x30d69a,null));};exports[_0xd832('0x2a')]=function(_0x3730b2,_0x3116f4){var _0x3ae5f6={};if(_0x3730b2[_0xd832('0x27')]['type']&&_0x3730b2[_0xd832('0x27')][_0xd832('0x23')]==='from'){_0x3ae5f6['from']=_0x3730b2[_0xd832('0x2b')]['id'];}else{_0x3ae5f6['id']=_0x3730b2[_0xd832('0x2b')]['id'];}var _0x5b2c0a={'raw':![],'where':_0x3ae5f6},_0x573549={};_0x573549[_0xd832('0x2c')]=_['keys'](db[_0xd832('0x20')][_0xd832('0x21')]);_0x573549[_0xd832('0x27')]=_[_0xd832('0x2d')](_0x3730b2[_0xd832('0x27')]);_0x573549[_0xd832('0x2e')]=_[_0xd832('0x2f')](_0x573549['model'],_0x573549[_0xd832('0x27')]);_0x5b2c0a['attributes']=_['intersection'](_0x573549[_0xd832('0x2c')],qs[_0xd832('0x30')](_0x3730b2[_0xd832('0x27')][_0xd832('0x30')]));_0x5b2c0a[_0xd832('0x31')]=_0x5b2c0a[_0xd832('0x31')]['length']?_0x5b2c0a[_0xd832('0x31')]:_0x573549[_0xd832('0x2c')];if(_0x3730b2[_0xd832('0x27')]['includeAll']){_0x5b2c0a['include']=[{'all':!![]}];}_0x5b2c0a=_[_0xd832('0x32')]({},_0x5b2c0a,_0x3730b2[_0xd832('0x33')]);return db[_0xd832('0x20')][_0xd832('0x34')](_0x5b2c0a)[_0xd832('0x1a')](handleEntityNotFound(_0x3116f4,null))[_0xd832('0x1a')](respondWithResult(_0x3116f4,null))['catch'](handleError(_0x3116f4,null));};exports['create']=function(_0x2bb2e7,_0x50d724){return db[_0xd832('0x20')]['create'](_0x2bb2e7[_0xd832('0x35')],{})['then'](respondWithResult(_0x50d724,0xc9))[_0xd832('0x29')](handleError(_0x50d724,null));};exports[_0xd832('0x19')]=function(_0x1d691e,_0x274ee2){if(_0x1d691e[_0xd832('0x35')]['id']){delete _0x1d691e['body']['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x1d691e[_0xd832('0x2b')]['id']}})[_0xd832('0x1a')](handleEntityNotFound(_0x274ee2,null))[_0xd832('0x1a')](saveUpdates(_0x1d691e[_0xd832('0x35')],null))[_0xd832('0x1a')](respondWithResult(_0x274ee2,null))[_0xd832('0x29')](handleError(_0x274ee2,null));};exports[_0xd832('0x1b')]=function(_0x4cf672,_0x4c6d24){return db['OpenchannelInteraction'][_0xd832('0x34')]({'where':{'id':_0x4cf672[_0xd832('0x2b')]['id']}})[_0xd832('0x1a')](handleEntityNotFound(_0x4c6d24,null))[_0xd832('0x1a')](removeEntity(_0x4c6d24,null))['catch'](handleError(_0x4c6d24,null));};exports['describe']=function(_0x566efc,_0x364266){return db[_0xd832('0x20')][_0xd832('0x36')]()[_0xd832('0x1a')](respondWithResult(_0x364266,null))[_0xd832('0x29')](handleError(_0x364266,null));};exports['addMessage']=function(_0x24195f,_0x23466e){return db[_0xd832('0x37')][_0xd832('0x34')]({'where':{'id':_0x24195f[_0xd832('0x2b')]['id']}})[_0xd832('0x1a')](handleEntityNotFound(_0x23466e,null))[_0xd832('0x1a')](function(_0x4869bc){if(_0x4869bc){return _0x4869bc['addMessage'](_0x24195f['body'][_0xd832('0x38')],_[_0xd832('0x39')](_0x24195f[_0xd832('0x35')],['ids','id'])||{});}})[_0xd832('0x1a')](respondWithResult(_0x23466e,null))['catch'](handleError(_0x23466e,null));};exports[_0xd832('0x3a')]=function(_0x3857ed,_0x205a0a){var _0x2bc26c={'raw':![],'where':{}};var _0x3b7cdd={};var _0x52c2ad={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x3857ed[_0xd832('0x2b')]['id']}})[_0xd832('0x1a')](handleEntityNotFound(_0x205a0a,null))['then'](function(_0x391586){if(_0x391586){_0x3b7cdd[_0xd832('0x2c')]=_[_0xd832('0x2d')](db[_0xd832('0x37')]['rawAttributes']);_0x3b7cdd[_0xd832('0x27')]=_[_0xd832('0x2d')](_0x3857ed['query']);_0x3b7cdd['filters']=_[_0xd832('0x2f')](_0x3b7cdd[_0xd832('0x2c')],_0x3b7cdd[_0xd832('0x27')]);_0x2bc26c['attributes']=_[_0xd832('0x2f')](_0x3b7cdd[_0xd832('0x2c')],qs[_0xd832('0x30')](_0x3857ed[_0xd832('0x27')][_0xd832('0x30')]));_0x2bc26c[_0xd832('0x31')]=_0x2bc26c[_0xd832('0x31')][_0xd832('0x3b')]?_0x2bc26c[_0xd832('0x31')]:_0x3b7cdd[_0xd832('0x2c')];if(!_0x3857ed[_0xd832('0x27')][_0xd832('0x3c')]('nolimit')){_0x2bc26c[_0xd832('0x14')]=qs[_0xd832('0x14')](_0x3857ed[_0xd832('0x27')][_0xd832('0x14')]);_0x2bc26c[_0xd832('0x3d')]=qs[_0xd832('0x3d')](_0x3857ed['query'][_0xd832('0x3d')]);}_0x2bc26c[_0xd832('0x3e')]=qs['sort'](_0x3857ed[_0xd832('0x27')][_0xd832('0x3f')]);_0x2bc26c[_0xd832('0x40')]=qs[_0xd832('0x2e')](_[_0xd832('0x41')](_0x3857ed[_0xd832('0x27')],_0x3b7cdd[_0xd832('0x2e')]));_0x2bc26c['where'][_0xd832('0x42')]=_0x391586['id'];if(_0x3857ed[_0xd832('0x27')]['filter']){_0x2bc26c[_0xd832('0x40')]=_[_0xd832('0x32')](_0x2bc26c['where'],{'$or':_[_0xd832('0x1f')](_0x2bc26c['attributes'],function(_0x5bf7d5){var _0x2c89c4={};_0x2c89c4[_0x5bf7d5]={'$like':'%'+_0x3857ed[_0xd832('0x27')]['filter']+'%'};return _0x2c89c4;})});}if(_0x3857ed[_0xd832('0x27')][_0xd832('0x43')]){var _0x509148=_0x3857ed[_0xd832('0x27')][_0xd832('0x43')][_0xd832('0x44')](',');var _0x390df8={};_0x390df8[_0x509148[0x0]]={'$gte':moment(_0x509148[0x1])[_0xd832('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2bc26c['where']=_[_0xd832('0x32')](_0x2bc26c[_0xd832('0x40')],_0x390df8);}_0x2bc26c=_['merge']({},_0x2bc26c,_0x3857ed['options']);return db['OpenchannelMessage']['count']({'where':_0x2bc26c[_0xd832('0x40')]})['then'](function(_0x3ee7f1){_0x52c2ad['count']=_0x3ee7f1;if(_0x3857ed[_0xd832('0x27')][_0xd832('0x46')]){_0x2bc26c[_0xd832('0x47')]=[{'all':!![]}];}return db[_0xd832('0x37')][_0xd832('0x48')](_0x2bc26c);})[_0xd832('0x1a')](function(_0xe18c47){_0x52c2ad[_0xd832('0x49')]=_0xe18c47;return _0x52c2ad;});}})[_0xd832('0x1a')](respondWithFilteredResult(_0x205a0a,_0x2bc26c))[_0xd832('0x29')](handleError(_0x205a0a,null));};exports[_0xd832('0x4a')]=function(_0x51daf9,_0x1a384b){return db[_0xd832('0x20')]['find']({'where':{'id':_0x51daf9['params']['id']}})[_0xd832('0x1a')](handleEntityNotFound(_0x1a384b,null))[_0xd832('0x1a')](function(_0x383acf){if(_0x383acf){return _0x383acf['setTags'](_0x51daf9[_0xd832('0x35')][_0xd832('0x38')],_[_0xd832('0x39')](_0x51daf9[_0xd832('0x35')],[_0xd832('0x38'),'id'])||{})[_0xd832('0x4b')](function(){return db[_0xd832('0x4c')]['findAll']({'attributes':['id',_0xd832('0x1d'),_0xd832('0x4d')],'where':{'id':_0x51daf9[_0xd832('0x35')][_0xd832('0x38')]}});})[_0xd832('0x1a')](function(_0x5bc0e9){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x51daf9['params']['id']),'tags':_0x5bc0e9||[]});return{'id':Number(_0x51daf9[_0xd832('0x2b')]['id']),'tags':_0x5bc0e9||[]};});}})[_0xd832('0x1a')](respondWithResult(_0x1a384b,null))[_0xd832('0x29')](handleError(_0x1a384b,null));};exports[_0xd832('0x4e')]=function(_0x47b186,_0x31e757){return db[_0xd832('0x20')]['find']({'where':{'id':_0x47b186[_0xd832('0x2b')]['id']}})['then'](handleEntityNotFound(_0x31e757,null))['then'](function(_0x2e4b02){if(_0x2e4b02){return _0x2e4b02['removeTags'](_0x47b186['query'][_0xd832('0x38')]);}})[_0xd832('0x1a')](respondWithStatusCode(_0x31e757,null))[_0xd832('0x29')](handleError(_0x31e757,null));};exports[_0xd832('0x4f')]=function(_0x447e95,_0x5f452c){var _0x589db0=moment()[_0xd832('0x50')]()[_0xd832('0x51')]();var _0x3b95f6=path[_0xd832('0x52')](config['root'],_0xd832('0x53'),_0xd832('0x54'),_0xd832('0x55'));var _0x524227=path[_0xd832('0x52')](config[_0xd832('0x56')],_0xd832('0x53'),_0xd832('0x54'),_0xd832('0x57'));var _0x2689f6=path[_0xd832('0x52')](_0x3b95f6,_0x589db0);var _0xb432a5=util[_0xd832('0x45')]('transcript-%d-%s.zip',_0x447e95[_0xd832('0x2b')]['id'],_0x589db0);var _0x2cf23d=path[_0xd832('0x52')](_0x3b95f6,_0xb432a5);var _0x1323fc=[];_0x1323fc[_0xd832('0x58')]({'model':db[_0xd832('0x59')],'as':_0xd832('0x59'),'attributes':['id',_0xd832('0x5a')],'raw':!![]});_0x1323fc['push']({'model':db[_0xd832('0x5b')],'as':'Contact','attributes':['id',_0xd832('0x5c'),'lastName'],'raw':!![]});if(_0x447e95['query'][_0xd832('0x57')]){_0x1323fc['push']({'model':db[_0xd832('0x5d')],'as':_0xd832('0x5d'),'raw':!![]});}var _0xb0ef04=[{'model':db[_0xd832('0x37')],'as':_0xd832('0x5e'),'attributes':['id',_0xd832('0x35'),'createdAt',_0xd832('0x5f'),_0xd832('0x60'),'read'],'include':_0x1323fc}];_0xb0ef04[_0xd832('0x58')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xd832('0x1d')]});_0xb0ef04[_0xd832('0x58')]({'model':db[_0xd832('0x59')],'as':'Owner','attributes':['id',_0xd832('0x5a')]});return db[_0xd832('0x20')]['find']({'where':{'id':_0x447e95['params']['id']},'include':_0xb0ef04})[_0xd832('0x1a')](handleEntityNotFound(_0x5f452c,null))[_0xd832('0x1a')](function(_0x329a0e){if(_0x329a0e){var _0x3ce259=_0x329a0e[_0xd832('0x61')]({'plain':!![]});fs['mkdirSync'](_0x2689f6);var _0x56b7be={'channel':_0xd832('0x62'),'account':_0x3ce259['Account']['name'],'agent':_0x3ce259[_0xd832('0x63')]?_0x3ce259[_0xd832('0x63')][_0xd832('0x5a')]:_0xd832('0x64'),'createdAt':moment(_0x3ce259[_0xd832('0x65')])[_0xd832('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd832('0x51')](),'closedAt':_0x3ce259['closed']?moment(_0x3ce259['closedAt'])['format'](_0xd832('0x66'))[_0xd832('0x51')]():'','disposition':_0x3ce259['disposition'],'visibility':_0x3ce259['threadId']?'Public':'Private','messages':_(_0x3ce259[_0xd832('0x5e')])[_0xd832('0x67')]({'secret':![]})[_0xd832('0x1f')](function(_0x49b9ae){if(_0x49b9ae['Attachment']){var _0x3bd761=path[_0xd832('0x52')](_0x524227,_0x49b9ae[_0xd832('0x5d')][_0xd832('0x68')]);if(fs[_0xd832('0x69')](_0x3bd761)){fs[_0xd832('0x6a')](_0x3bd761)[_0xd832('0x6b')](fs[_0xd832('0x6c')](path[_0xd832('0x52')](_0x2689f6,_0x49b9ae[_0xd832('0x5d')][_0xd832('0x68')])));}}return{'date':moment(_0x49b9ae[_0xd832('0x65')])['format'](_0xd832('0x66'))[_0xd832('0x51')](),'sender':_0x49b9ae[_0xd832('0x5f')]===_0xd832('0x6d')?_0x49b9ae['User']?_0x49b9ae[_0xd832('0x59')][_0xd832('0x5a')]:_0xd832('0x6e'):_0x49b9ae[_0xd832('0x6f')][_0xd832('0x5c')]+(_0x49b9ae[_0xd832('0x6f')][_0xd832('0x70')]?'\x20'+_0x49b9ae[_0xd832('0x6f')][_0xd832('0x70')]:''),'body':_0x49b9ae['Attachment']?_0x49b9ae[_0xd832('0x5d')][_0xd832('0x68')]:_0x49b9ae[_0xd832('0x35')],'direction':_0x49b9ae[_0xd832('0x5f')]===_0xd832('0x6d')?'A':'C','secret':_0x49b9ae[_0xd832('0x60')],'read':_0x49b9ae[_0xd832('0x71')],'attachment':_0x49b9ae['Attachment']};})[_0xd832('0x72')]()};return ejs[_0xd832('0x73')](path['join'](config[_0xd832('0x56')],_0xd832('0x53'),_0xd832('0x74'),_0xd832('0x75')),{'interaction':_0x56b7be})[_0xd832('0x1a')](function(_0x1f3377){var _0x1805b1=path[_0xd832('0x52')](_0x2689f6,'transcript-'+_0x3ce259['id']+'-'+_0x589db0+_0xd832('0x76'));var _0x5f5d4c={'path':_0x1805b1,'channel':_0xd832('0x62'),'interactionId':_0x3ce259['id']};return pdf[_0xd832('0x77')](_0x1f3377,_0x5f5d4c);})[_0xd832('0x1a')](function(){return new Promise(function(_0x30f985,_0x2704b2){zipdir(_0x2689f6,{'saveTo':_0x2cf23d},function(_0x128a45,_0x3e86e5){if(_0x128a45)return _0x2704b2(_0x128a45);return _0x30f985(_0x3e86e5);});})['then'](function(){return new Promise(function(_0x4510be,_0x40f487){rimraf(_0x2689f6,function(_0xedc75f){if(_0xedc75f)_0x40f487(_0xedc75f);return _0x4510be();});});})[_0xd832('0x1a')](function(){return _0x5f452c[_0xd832('0x4f')](_0x2cf23d,_0xb432a5,function(_0x355752){if(_0x355752){logger[_0xd832('0x78')](_0xd832('0x79'),_0x355752);}else{fs[_0xd832('0x7a')](_0x2cf23d);}});});});}else{return _0x5f452c[_0xd832('0x10')](0xc8);}})[_0xd832('0x29')](handleError(_0x5f452c,null));}; \ No newline at end of file +var _0x1eaa=['OpenchannelInteraction','rawAttributes','key','getOptions','findAll','openchannel','user','catch','query','type','from','params','model','filters','attributes','fields','length','includeAll','merge','create','body','find','describe','addMessage','OpenchannelMessage','omit','ids','keys','intersection','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','format','options','include','rows','addTags','setTags','spread','color','openchannelInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Private','existsSync','createWriteStream','basename','out','System','Contact','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','rimraf','zip-dir','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','status','json','offset','undefined','limit','count','set','update','then','destroy','end','stack','name','index','map'];(function(_0x7f04ce,_0x51d650){var _0x5ee6c7=function(_0x36d23c){while(--_0x36d23c){_0x7f04ce['push'](_0x7f04ce['shift']());}};_0x5ee6c7(++_0x51d650);}(_0x1eaa,0x1e7));var _0xa1ea=function(_0x5c5f88,_0x429bf){_0x5c5f88=_0x5c5f88-0x0;var _0x501d56=_0x1eaa[_0x5c5f88];return _0x501d56;};'use strict';var rimraf=require(_0xa1ea('0x0'));var zipdir=require(_0xa1ea('0x1'));var moment=require(_0xa1ea('0x2'));var util=require(_0xa1ea('0x3'));var path=require(_0xa1ea('0x4'));var ejs=require(_0xa1ea('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa1ea('0x6'));var interaction=require(_0xa1ea('0x7'));var qs=require(_0xa1ea('0x8'));var pdf=require(_0xa1ea('0x9'));var logger=require(_0xa1ea('0xa'))('api');var config=require(_0xa1ea('0xb'));var db=require(_0xa1ea('0xc'))['db'];config[_0xa1ea('0xd')]=_[_0xa1ea('0xe')](config[_0xa1ea('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1ea('0xf'))(new Redis(config[_0xa1ea('0xd')]));require(_0xa1ea('0x10'))[_0xa1ea('0x11')](socket);function respondWithStatusCode(_0x318f0f,_0x410e03){_0x410e03=_0x410e03||0xcc;return function(_0x3f7962){if(_0x3f7962){return _0x318f0f['sendStatus'](_0x410e03);}return _0x318f0f['status'](_0x410e03)['end']();};}function respondWithResult(_0x4d300d,_0x57b9e4){_0x57b9e4=_0x57b9e4||0xc8;return function(_0x3896f9){if(_0x3896f9){return _0x4d300d[_0xa1ea('0x12')](_0x57b9e4)[_0xa1ea('0x13')](_0x3896f9);}};}function respondWithFilteredResult(_0x3d4fe5,_0x5c6039){return function(_0x1129b7){if(_0x1129b7){var _0x59aac7=typeof _0x5c6039[_0xa1ea('0x14')]===_0xa1ea('0x15')&&typeof _0x5c6039[_0xa1ea('0x16')]==='undefined';var _0x3ea52d=_0x1129b7[_0xa1ea('0x17')];var _0x33cc68=_0x59aac7?0x0:_0x5c6039[_0xa1ea('0x14')];var _0x113f48=_0x59aac7?_0x1129b7['count']:_0x5c6039[_0xa1ea('0x14')]+_0x5c6039[_0xa1ea('0x16')];var _0x13856e;if(_0x113f48>=_0x3ea52d){_0x113f48=_0x3ea52d;_0x13856e=0xc8;}else{_0x13856e=0xce;}_0x3d4fe5[_0xa1ea('0x12')](_0x13856e);return _0x3d4fe5[_0xa1ea('0x18')]('Content-Range',_0x33cc68+'-'+_0x113f48+'/'+_0x3ea52d)[_0xa1ea('0x13')](_0x1129b7);}return null;};}function saveUpdates(_0x14ab5d){return function(_0x5cda82){if(_0x5cda82){return _0x5cda82[_0xa1ea('0x19')](_0x14ab5d)[_0xa1ea('0x1a')](function(_0x1c1345){return _0x1c1345;});}return null;};}function removeEntity(_0x73a73b){return function(_0x2d1470){if(_0x2d1470){return _0x2d1470[_0xa1ea('0x1b')]()[_0xa1ea('0x1a')](function(){_0x73a73b[_0xa1ea('0x12')](0xcc)[_0xa1ea('0x1c')]();});}};}function handleEntityNotFound(_0x2608e3){return function(_0x11a88f){if(!_0x11a88f){_0x2608e3['sendStatus'](0x194);}return _0x11a88f;};}function handleError(_0x5142c1,_0x370d25){_0x370d25=_0x370d25||0x1f4;return function(_0x420263){logger['error'](_0x420263[_0xa1ea('0x1d')]);if(_0x420263[_0xa1ea('0x1e')]){delete _0x420263[_0xa1ea('0x1e')];}_0x5142c1[_0xa1ea('0x12')](_0x370d25)['send'](_0x420263);};}exports[_0xa1ea('0x1f')]=function(_0x21f16b,_0x59cc90){var _0xf63e2d={};var _0x13a16e=_[_0xa1ea('0x20')](db[_0xa1ea('0x21')][_0xa1ea('0x22')],function(_0x39fc5d){return{'name':_0x39fc5d['fieldName'],'type':_0x39fc5d['type'][_0xa1ea('0x23')]};});_0xf63e2d=qs[_0xa1ea('0x24')](_0x13a16e,_0x21f16b);return interaction[_0xa1ea('0x25')](_0xa1ea('0x26'),_0x21f16b['query'],_0x21f16b[_0xa1ea('0x27')],_0xf63e2d,_0x13a16e)[_0xa1ea('0x1a')](respondWithFilteredResult(_0x59cc90,_0xf63e2d))[_0xa1ea('0x28')](handleError(_0x59cc90,null));};exports['show']=function(_0x4b3774,_0x5dde90){var _0x3e2392={};if(_0x4b3774[_0xa1ea('0x29')]['type']&&_0x4b3774[_0xa1ea('0x29')][_0xa1ea('0x2a')]===_0xa1ea('0x2b')){_0x3e2392[_0xa1ea('0x2b')]=_0x4b3774['params']['id'];}else{_0x3e2392['id']=_0x4b3774[_0xa1ea('0x2c')]['id'];}var _0x37faf1={'raw':![],'where':_0x3e2392},_0x54834b={};_0x54834b[_0xa1ea('0x2d')]=_['keys'](db[_0xa1ea('0x21')]['rawAttributes']);_0x54834b[_0xa1ea('0x29')]=_['keys'](_0x4b3774[_0xa1ea('0x29')]);_0x54834b[_0xa1ea('0x2e')]=_['intersection'](_0x54834b['model'],_0x54834b[_0xa1ea('0x29')]);_0x37faf1[_0xa1ea('0x2f')]=_['intersection'](_0x54834b[_0xa1ea('0x2d')],qs[_0xa1ea('0x30')](_0x4b3774[_0xa1ea('0x29')][_0xa1ea('0x30')]));_0x37faf1[_0xa1ea('0x2f')]=_0x37faf1['attributes'][_0xa1ea('0x31')]?_0x37faf1[_0xa1ea('0x2f')]:_0x54834b[_0xa1ea('0x2d')];if(_0x4b3774[_0xa1ea('0x29')][_0xa1ea('0x32')]){_0x37faf1['include']=[{'all':!![]}];}_0x37faf1=_[_0xa1ea('0x33')]({},_0x37faf1,_0x4b3774['options']);return db[_0xa1ea('0x21')]['find'](_0x37faf1)[_0xa1ea('0x1a')](handleEntityNotFound(_0x5dde90,null))[_0xa1ea('0x1a')](respondWithResult(_0x5dde90,null))[_0xa1ea('0x28')](handleError(_0x5dde90,null));};exports[_0xa1ea('0x34')]=function(_0xf7e92a,_0x236b03){return db['OpenchannelInteraction'][_0xa1ea('0x34')](_0xf7e92a[_0xa1ea('0x35')],{})[_0xa1ea('0x1a')](respondWithResult(_0x236b03,0xc9))['catch'](handleError(_0x236b03,null));};exports[_0xa1ea('0x19')]=function(_0x554d5d,_0x35ed84){if(_0x554d5d[_0xa1ea('0x35')]['id']){delete _0x554d5d[_0xa1ea('0x35')]['id'];}return db[_0xa1ea('0x21')]['find']({'where':{'id':_0x554d5d[_0xa1ea('0x2c')]['id']}})['then'](handleEntityNotFound(_0x35ed84,null))['then'](saveUpdates(_0x554d5d['body'],null))[_0xa1ea('0x1a')](respondWithResult(_0x35ed84,null))[_0xa1ea('0x28')](handleError(_0x35ed84,null));};exports[_0xa1ea('0x1b')]=function(_0x2be5fc,_0x3abde5){return db[_0xa1ea('0x21')][_0xa1ea('0x36')]({'where':{'id':_0x2be5fc[_0xa1ea('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3abde5,null))[_0xa1ea('0x1a')](removeEntity(_0x3abde5,null))['catch'](handleError(_0x3abde5,null));};exports[_0xa1ea('0x37')]=function(_0x20c350,_0x23ff7f){return db[_0xa1ea('0x21')][_0xa1ea('0x37')]()[_0xa1ea('0x1a')](respondWithResult(_0x23ff7f,null))['catch'](handleError(_0x23ff7f,null));};exports[_0xa1ea('0x38')]=function(_0x5763a5,_0x1b2c96){return db[_0xa1ea('0x39')]['find']({'where':{'id':_0x5763a5[_0xa1ea('0x2c')]['id']}})[_0xa1ea('0x1a')](handleEntityNotFound(_0x1b2c96,null))[_0xa1ea('0x1a')](function(_0x313eaf){if(_0x313eaf){return _0x313eaf[_0xa1ea('0x38')](_0x5763a5[_0xa1ea('0x35')]['ids'],_[_0xa1ea('0x3a')](_0x5763a5['body'],[_0xa1ea('0x3b'),'id'])||{});}})[_0xa1ea('0x1a')](respondWithResult(_0x1b2c96,null))['catch'](handleError(_0x1b2c96,null));};exports['getMessages']=function(_0x291533,_0x5b3311){var _0x1c4f02={'raw':![],'where':{}};var _0x1e8167={};var _0xf42054={'count':0x0,'rows':[]};return db[_0xa1ea('0x21')]['findOne']({'where':{'id':_0x291533[_0xa1ea('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5b3311,null))[_0xa1ea('0x1a')](function(_0x413694){if(_0x413694){_0x1e8167[_0xa1ea('0x2d')]=_[_0xa1ea('0x3c')](db['OpenchannelMessage'][_0xa1ea('0x22')]);_0x1e8167['query']=_[_0xa1ea('0x3c')](_0x291533[_0xa1ea('0x29')]);_0x1e8167[_0xa1ea('0x2e')]=_['intersection'](_0x1e8167[_0xa1ea('0x2d')],_0x1e8167[_0xa1ea('0x29')]);_0x1c4f02[_0xa1ea('0x2f')]=_[_0xa1ea('0x3d')](_0x1e8167[_0xa1ea('0x2d')],qs[_0xa1ea('0x30')](_0x291533['query'][_0xa1ea('0x30')]));_0x1c4f02[_0xa1ea('0x2f')]=_0x1c4f02[_0xa1ea('0x2f')][_0xa1ea('0x31')]?_0x1c4f02[_0xa1ea('0x2f')]:_0x1e8167[_0xa1ea('0x2d')];if(!_0x291533[_0xa1ea('0x29')][_0xa1ea('0x3e')](_0xa1ea('0x3f'))){_0x1c4f02[_0xa1ea('0x16')]=qs[_0xa1ea('0x16')](_0x291533['query'][_0xa1ea('0x16')]);_0x1c4f02[_0xa1ea('0x14')]=qs['offset'](_0x291533[_0xa1ea('0x29')][_0xa1ea('0x14')]);}_0x1c4f02[_0xa1ea('0x40')]=qs['sort'](_0x291533[_0xa1ea('0x29')][_0xa1ea('0x41')]);_0x1c4f02['where']=qs[_0xa1ea('0x2e')](_['pick'](_0x291533['query'],_0x1e8167['filters']));_0x1c4f02[_0xa1ea('0x42')][_0xa1ea('0x43')]=_0x413694['id'];if(_0x291533['query'][_0xa1ea('0x44')]){_0x1c4f02[_0xa1ea('0x42')]=_[_0xa1ea('0x33')](_0x1c4f02[_0xa1ea('0x42')],{'$or':_[_0xa1ea('0x20')](_0x1c4f02['attributes'],function(_0x13ac2d){var _0x4c76c4={};_0x4c76c4[_0x13ac2d]={'$like':'%'+_0x291533['query']['filter']+'%'};return _0x4c76c4;})});}if(_0x291533[_0xa1ea('0x29')][_0xa1ea('0x45')]){var _0x47cc44=_0x291533['query'][_0xa1ea('0x45')][_0xa1ea('0x46')](',');var _0x55d87c={};_0x55d87c[_0x47cc44[0x0]]={'$gte':moment(_0x47cc44[0x1])[_0xa1ea('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1c4f02[_0xa1ea('0x42')]=_[_0xa1ea('0x33')](_0x1c4f02[_0xa1ea('0x42')],_0x55d87c);}_0x1c4f02=_['merge']({},_0x1c4f02,_0x291533[_0xa1ea('0x48')]);return db[_0xa1ea('0x39')][_0xa1ea('0x17')]({'where':_0x1c4f02[_0xa1ea('0x42')]})[_0xa1ea('0x1a')](function(_0xebcc98){_0xf42054[_0xa1ea('0x17')]=_0xebcc98;if(_0x291533[_0xa1ea('0x29')]['includeAll']){_0x1c4f02[_0xa1ea('0x49')]=[{'all':!![]}];}return db[_0xa1ea('0x39')][_0xa1ea('0x25')](_0x1c4f02);})[_0xa1ea('0x1a')](function(_0x155c89){_0xf42054[_0xa1ea('0x4a')]=_0x155c89;return _0xf42054;});}})[_0xa1ea('0x1a')](respondWithFilteredResult(_0x5b3311,_0x1c4f02))[_0xa1ea('0x28')](handleError(_0x5b3311,null));};exports[_0xa1ea('0x4b')]=function(_0x48d530,_0x329df3){return db[_0xa1ea('0x21')][_0xa1ea('0x36')]({'where':{'id':_0x48d530[_0xa1ea('0x2c')]['id']}})[_0xa1ea('0x1a')](handleEntityNotFound(_0x329df3,null))[_0xa1ea('0x1a')](function(_0x138326){if(_0x138326){return _0x138326[_0xa1ea('0x4c')](_0x48d530['body'][_0xa1ea('0x3b')],_['omit'](_0x48d530[_0xa1ea('0x35')],[_0xa1ea('0x3b'),'id'])||{})[_0xa1ea('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa1ea('0x1e'),_0xa1ea('0x4e')],'where':{'id':_0x48d530['body'][_0xa1ea('0x3b')]}});})[_0xa1ea('0x1a')](function(_0x52758f){socket['emit'](_0xa1ea('0x4f'),{'id':Number(_0x48d530[_0xa1ea('0x2c')]['id']),'tags':_0x52758f||[]});return{'id':Number(_0x48d530[_0xa1ea('0x2c')]['id']),'tags':_0x52758f||[]};});}})[_0xa1ea('0x1a')](respondWithResult(_0x329df3,null))[_0xa1ea('0x28')](handleError(_0x329df3,null));};exports[_0xa1ea('0x50')]=function(_0x5c755b,_0x5e47fa){return db['OpenchannelInteraction'][_0xa1ea('0x36')]({'where':{'id':_0x5c755b[_0xa1ea('0x2c')]['id']}})[_0xa1ea('0x1a')](handleEntityNotFound(_0x5e47fa,null))[_0xa1ea('0x1a')](function(_0x3fd8bf){if(_0x3fd8bf){return _0x3fd8bf[_0xa1ea('0x50')](_0x5c755b[_0xa1ea('0x29')][_0xa1ea('0x3b')]);}})['then'](respondWithStatusCode(_0x5e47fa,null))['catch'](handleError(_0x5e47fa,null));};exports[_0xa1ea('0x51')]=function(_0x2ca439,_0x55bc58){var _0x4fa04f=moment()['unix']()[_0xa1ea('0x52')]();var _0x48b237=path[_0xa1ea('0x53')](config[_0xa1ea('0x54')],_0xa1ea('0x55'),_0xa1ea('0x56'),_0xa1ea('0x57'));var _0x24e1fc=path[_0xa1ea('0x53')](config[_0xa1ea('0x54')],_0xa1ea('0x55'),_0xa1ea('0x56'),_0xa1ea('0x58'));var _0x365b89=path[_0xa1ea('0x53')](_0x48b237,_0x4fa04f);var _0x4a61f6=util[_0xa1ea('0x47')](_0xa1ea('0x59'),_0x2ca439[_0xa1ea('0x2c')]['id'],_0x4fa04f);var _0x30467d=path[_0xa1ea('0x53')](_0x48b237,_0x4a61f6);var _0xc50d15=[];_0xc50d15['push']({'model':db[_0xa1ea('0x5a')],'as':'User','attributes':['id',_0xa1ea('0x5b')],'raw':!![]});_0xc50d15[_0xa1ea('0x5c')]({'model':db[_0xa1ea('0x5d')],'as':'Contact','attributes':['id',_0xa1ea('0x5e'),_0xa1ea('0x5f')],'raw':!![]});if(_0x2ca439[_0xa1ea('0x29')][_0xa1ea('0x58')]){_0xc50d15[_0xa1ea('0x5c')]({'model':db[_0xa1ea('0x60')],'as':_0xa1ea('0x60'),'raw':!![]});}var _0x1a0aed=[{'model':db[_0xa1ea('0x39')],'as':_0xa1ea('0x61'),'attributes':['id','body',_0xa1ea('0x62'),_0xa1ea('0x63'),_0xa1ea('0x64'),_0xa1ea('0x65')],'include':_0xc50d15}];_0x1a0aed[_0xa1ea('0x5c')]({'model':db['OpenchannelAccount'],'as':_0xa1ea('0x66'),'attributes':['id',_0xa1ea('0x1e')]});_0x1a0aed['push']({'model':db['User'],'as':_0xa1ea('0x67'),'attributes':['id',_0xa1ea('0x5b')]});return db[_0xa1ea('0x21')][_0xa1ea('0x36')]({'where':{'id':_0x2ca439['params']['id']},'include':_0x1a0aed})['then'](handleEntityNotFound(_0x55bc58,null))[_0xa1ea('0x1a')](function(_0x20ef71){if(_0x20ef71){var _0x3df605=_0x20ef71[_0xa1ea('0x68')]({'plain':!![]});fs[_0xa1ea('0x69')](_0x365b89);var _0x20c634={'channel':_0xa1ea('0x6a'),'account':_0x3df605[_0xa1ea('0x66')][_0xa1ea('0x1e')],'agent':_0x3df605[_0xa1ea('0x67')]?_0x3df605[_0xa1ea('0x67')][_0xa1ea('0x5b')]:_0xa1ea('0x6b'),'createdAt':moment(_0x3df605['createdAt'])[_0xa1ea('0x47')](_0xa1ea('0x6c'))[_0xa1ea('0x52')](),'closedAt':_0x3df605[_0xa1ea('0x6d')]?moment(_0x3df605[_0xa1ea('0x6e')])[_0xa1ea('0x47')](_0xa1ea('0x6c'))[_0xa1ea('0x52')]():'','disposition':_0x3df605[_0xa1ea('0x6f')],'visibility':_0x3df605[_0xa1ea('0x70')]?'Public':_0xa1ea('0x71'),'messages':_(_0x3df605[_0xa1ea('0x61')])[_0xa1ea('0x44')]({'secret':![]})[_0xa1ea('0x20')](function(_0x55ea64){if(_0x55ea64[_0xa1ea('0x60')]){var _0x2e7b95=path[_0xa1ea('0x53')](_0x24e1fc,_0x55ea64[_0xa1ea('0x60')]['basename']);if(fs[_0xa1ea('0x72')](_0x2e7b95)){fs['createReadStream'](_0x2e7b95)['pipe'](fs[_0xa1ea('0x73')](path[_0xa1ea('0x53')](_0x365b89,_0x55ea64['Attachment'][_0xa1ea('0x74')])));}}return{'date':moment(_0x55ea64['createdAt'])[_0xa1ea('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa1ea('0x52')](),'sender':_0x55ea64[_0xa1ea('0x63')]===_0xa1ea('0x75')?_0x55ea64['User']?_0x55ea64[_0xa1ea('0x5a')][_0xa1ea('0x5b')]:_0xa1ea('0x76'):_0x55ea64['Contact'][_0xa1ea('0x5e')]+(_0x55ea64[_0xa1ea('0x77')][_0xa1ea('0x5f')]?'\x20'+_0x55ea64[_0xa1ea('0x77')][_0xa1ea('0x5f')]:''),'body':_0x55ea64[_0xa1ea('0x60')]?_0x55ea64['Attachment'][_0xa1ea('0x74')]:_0x55ea64[_0xa1ea('0x35')],'direction':_0x55ea64[_0xa1ea('0x63')]===_0xa1ea('0x75')?'A':'C','secret':_0x55ea64[_0xa1ea('0x64')],'read':_0x55ea64['read'],'attachment':_0x55ea64[_0xa1ea('0x60')]};})[_0xa1ea('0x78')]()};return ejs['renderFile'](path['join'](config[_0xa1ea('0x54')],'server',_0xa1ea('0x79'),_0xa1ea('0x7a')),{'interaction':_0x20c634})[_0xa1ea('0x1a')](function(_0x187995){var _0x3f9a48=path[_0xa1ea('0x53')](_0x365b89,_0xa1ea('0x7b')+_0x3df605['id']+'-'+_0x4fa04f+_0xa1ea('0x7c'));var _0x2d43a4={'path':_0x3f9a48,'channel':_0xa1ea('0x6a'),'interactionId':_0x3df605['id']};return pdf[_0xa1ea('0x7d')](_0x187995,_0x2d43a4);})['then'](function(){return new Promise(function(_0x394588,_0xe61f9b){zipdir(_0x365b89,{'saveTo':_0x30467d},function(_0x4b5155,_0xd13023){if(_0x4b5155)return _0xe61f9b(_0x4b5155);return _0x394588(_0xd13023);});})['then'](function(){return new Promise(function(_0x1313bd,_0x3e56a3){rimraf(_0x365b89,function(_0x2badce){if(_0x2badce)_0x3e56a3(_0x2badce);return _0x1313bd();});});})['then'](function(){return _0x55bc58[_0xa1ea('0x51')](_0x30467d,_0x4a61f6,function(_0x1f1eb9){if(_0x1f1eb9){logger[_0xa1ea('0x7e')](_0xa1ea('0x7f'),_0x1f1eb9);}else{fs[_0xa1ea('0x80')](_0x30467d);}});});});}else{return _0x55bc58[_0xa1ea('0x81')](0xc8);}})['catch'](handleError(_0x55bc58,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0cecef7..29763ea 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 _0xb1b7=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xb1b7,0xbe));var _0x7b1b=function(_0x1680af,_0x475d8a){_0x1680af=_0x1680af-0x0;var _0x5039f8=_0xb1b7[_0x1680af];return _0x5039f8;};'use strict';var EventEmitter=require(_0x7b1b('0x0'));var OpenchannelInteraction=require(_0x7b1b('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7b1b('0x1'))['db'][_0x7b1b('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7b1b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b1b('0x4'),'afterDestroy':_0x7b1b('0x5')};function emitEvent(_0xd5db4d){return function(_0x4dfaa1,_0x349c7b,_0x32d424){_0x4dfaa1[_0x7b1b('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12ffac){_0x4dfaa1[_0x7b1b('0x7')](_0x7b1b('0x8'),_0x12ffac[_0x7b1b('0x9')](function(_0x57f8e6){return{'id':_0x57f8e6['id']};}));return OpenchannelMessage[_0x7b1b('0xa')]({'where':{'OpenchannelInteractionId':_0x4dfaa1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b1b('0xb')](function(_0x2eebdf){_0x4dfaa1['setDataValue'](_0x7b1b('0xc'),_0x2eebdf[_0x7b1b('0xd')]);OpenchannelInteractionEvents[_0x7b1b('0xe')](_0xd5db4d+':'+_0x4dfaa1['id'],_0x4dfaa1);OpenchannelInteractionEvents[_0x7b1b('0xe')](_0xd5db4d,_0x4dfaa1);_0x32d424(null);})[_0x7b1b('0xf')](_0x32d424(null));};}for(var e in events){if(events[_0x7b1b('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x7b1b('0x11')](e,emitEvent(event));}}module[_0x7b1b('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x3880=['OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0x32689c,_0x1e5ad2){var _0xce38dd=function(_0x3945d8){while(--_0x3945d8){_0x32689c['push'](_0x32689c['shift']());}};_0xce38dd(++_0x1e5ad2);}(_0x3880,0x140));var _0x0388=function(_0x120f01,_0x18f9d6){_0x120f01=_0x120f01-0x0;var _0x32b851=_0x3880[_0x120f01];return _0x32b851;};'use strict';var EventEmitter=require(_0x0388('0x0'));var OpenchannelInteraction=require(_0x0388('0x1'))['db'][_0x0388('0x2')];var OpenchannelMessage=require(_0x0388('0x1'))['db'][_0x0388('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0388('0x4')](0x0);var events={'afterCreate':_0x0388('0x5'),'afterUpdate':_0x0388('0x6'),'afterDestroy':_0x0388('0x7')};function emitEvent(_0x2262e9){return function(_0x45d402,_0x4b5ac7,_0x503c10){_0x45d402[_0x0388('0x8')]({'attributes':['id'],'raw':!![]})[_0x0388('0x9')](function(_0x2f32e9){_0x45d402[_0x0388('0xa')]('Users',_0x2f32e9[_0x0388('0xb')](function(_0x67403a){return{'id':_0x67403a['id']};}));return OpenchannelMessage[_0x0388('0xc')]({'where':{'OpenchannelInteractionId':_0x45d402['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0388('0x9')](function(_0x49091c){_0x45d402['setDataValue'](_0x0388('0xd'),_0x49091c[_0x0388('0xe')]);OpenchannelInteractionEvents['emit'](_0x2262e9+':'+_0x45d402['id'],_0x45d402);OpenchannelInteractionEvents[_0x0388('0xf')](_0x2262e9,_0x45d402);_0x503c10(null);})[_0x0388('0x10')](_0x503c10(null));};}for(var e in events){if(events[_0x0388('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x0388('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 513b19c..a983264 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 _0xacea=['OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x107156,_0x865412){var _0x3b4b86=function(_0x252701){while(--_0x252701){_0x107156['push'](_0x107156['shift']());}};_0x3b4b86(++_0x865412);}(_0xacea,0x1d2));var _0xaace=function(_0x164a6b,_0x33b019){_0x164a6b=_0x164a6b-0x0;var _0x4985fb=_0xacea[_0x164a6b];return _0x4985fb;};'use strict';var _=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var logger=require(_0xaace('0x2'))('api');var moment=require(_0xaace('0x3'));var BPromise=require(_0xaace('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaace('0x5'));var rimraf=require('rimraf');var config=require(_0xaace('0x6'));var attributes=require(_0xaace('0x7'));module[_0xaace('0x8')]=function(_0x334ca9,_0x764dc6){return _0x334ca9[_0xaace('0x9')](_0xaace('0xa'),attributes,{'tableName':_0xaace('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaace('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x546aca,_0x35d906,_0x47f12d){if(_0x546aca['changed'](_0xaace('0xd'))){_0x546aca[_0xaace('0xe')]=moment()[_0xaace('0xf')](_0xaace('0x10'));}_0x47f12d(null,_0x546aca);}}});}; \ No newline at end of file +var _0xf899=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','../../config/logger','moment','request-promise'];(function(_0x150903,_0x378aab){var _0x5bbc72=function(_0x17a385){while(--_0x17a385){_0x150903['push'](_0x150903['shift']());}};_0x5bbc72(++_0x378aab);}(_0xf899,0x19d));var _0x9f89=function(_0x2a56e4,_0x3fc413){_0x2a56e4=_0x2a56e4-0x0;var _0x39bc0e=_0xf899[_0x2a56e4];return _0x39bc0e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f89('0x0'))('api');var moment=require(_0x9f89('0x1'));var BPromise=require('bluebird');var rp=require(_0x9f89('0x2'));var fs=require('fs');var path=require(_0x9f89('0x3'));var rimraf=require(_0x9f89('0x4'));var config=require(_0x9f89('0x5'));var attributes=require(_0x9f89('0x6'));module[_0x9f89('0x7')]=function(_0x56b324,_0x45349f){return _0x56b324[_0x9f89('0x8')](_0x9f89('0x9'),attributes,{'tableName':_0x9f89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f89('0xb'),'collate':_0x9f89('0xc'),'hooks':{'beforeUpdate':function(_0x44ba59,_0x1fbd3f,_0x167524){if(_0x44ba59[_0x9f89('0xd')](_0x9f89('0xe'))){_0x44ba59['closedAt']=moment()[_0x9f89('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x167524(null,_0x44ba59);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7d12d1e..0f94c84 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 _0xe58b=['options','raw','where','attributes','limit','catch','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x4e1e37,_0x21c94d){var _0x528769=function(_0xb7b578){while(--_0xb7b578){_0x4e1e37['push'](_0x4e1e37['shift']());}};_0x528769(++_0x21c94d);}(_0xe58b,0x1f0));var _0xbe58=function(_0x4af81d,_0x238652){_0x4af81d=_0x4af81d-0x0;var _0x16bf50=_0xe58b[_0x4af81d];return _0x16bf50;};'use strict';var _=require(_0xbe58('0x0'));var util=require('util');var moment=require(_0xbe58('0x1'));var BPromise=require(_0xbe58('0x2'));var rs=require(_0xbe58('0x3'));var fs=require('fs');var Redis=require(_0xbe58('0x4'));var db=require(_0xbe58('0x5'))['db'];var utils=require(_0xbe58('0x6'));var logger=require(_0xbe58('0x7'))(_0xbe58('0x8'));var config=require(_0xbe58('0x9'));var jayson=require(_0xbe58('0xa'));var client=jayson[_0xbe58('0xb')][_0xbe58('0xc')]({'port':0x232a});config[_0xbe58('0xd')]=_[_0xbe58('0xe')](config[_0xbe58('0xd')],{'host':_0xbe58('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe58('0xd')]));require('./openchannelInteraction.socket')[_0xbe58('0x10')](socket);function respondWithRpcPromise(_0x1e29e2,_0x100e18,_0x23a651){return new BPromise(function(_0x599f9c,_0x55a1ab){return client[_0xbe58('0x11')](_0x1e29e2,_0x23a651)[_0xbe58('0x12')](function(_0x2497f5){logger['info'](_0xbe58('0x13'),_0x100e18,_0xbe58('0x14'));logger[_0xbe58('0x15')](_0xbe58('0x16'),_0x100e18,_0xbe58('0x14'),JSON[_0xbe58('0x17')](_0x2497f5));if(_0x2497f5[_0xbe58('0x18')]){if(_0x2497f5[_0xbe58('0x18')][_0xbe58('0x19')]===0x1f4){logger[_0xbe58('0x18')](_0xbe58('0x13'),_0x100e18,_0x2497f5[_0xbe58('0x18')][_0xbe58('0x1a')]);return _0x55a1ab(_0x2497f5['error']['message']);}logger[_0xbe58('0x18')](_0xbe58('0x13'),_0x100e18,_0x2497f5[_0xbe58('0x18')][_0xbe58('0x1a')]);return _0x599f9c(_0x2497f5[_0xbe58('0x18')]['message']);}else{logger[_0xbe58('0x1b')](_0xbe58('0x13'),_0x100e18,'request\x20sent');_0x599f9c(_0x2497f5['result'][_0xbe58('0x1a')]);}})['catch'](function(_0x411af8){logger['error'](_0xbe58('0x13'),_0x100e18,_0x411af8);_0x55a1ab(_0x411af8);});});}exports[_0xbe58('0x1c')]=function(_0xb62489){var _0x311c36=this;return new Promise(function(_0x5e19f2,_0x37836d){return db[_0xbe58('0x1d')][_0xbe58('0x1e')](_0xb62489[_0xbe58('0x1f')],{'raw':_0xb62489['options']?_0xb62489[_0xbe58('0x20')][_0xbe58('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb62489[_0xbe58('0x20')]?_0xb62489[_0xbe58('0x20')][_0xbe58('0x22')]||null:null,'attributes':_0xb62489[_0xbe58('0x20')]?_0xb62489[_0xbe58('0x20')][_0xbe58('0x23')]||null:null,'limit':_0xb62489[_0xbe58('0x20')]?_0xb62489[_0xbe58('0x20')][_0xbe58('0x24')]||null:null})[_0xbe58('0x12')](function(_0x34c6a3){logger['info'](_0xbe58('0x1c'),_0xb62489);logger[_0xbe58('0x15')](_0xbe58('0x1c'),_0xb62489,JSON[_0xbe58('0x17')](_0x34c6a3));_0x5e19f2(_0x34c6a3);})[_0xbe58('0x25')](function(_0x3223a3){logger[_0xbe58('0x18')](_0xbe58('0x1c'),_0x3223a3[_0xbe58('0x1a')],_0xb62489);_0x37836d(_0x311c36[_0xbe58('0x18')](0x1f4,_0x3223a3[_0xbe58('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x25e313){return new Promise(function(_0x2badde,_0x86df24){return db['OpenchannelInteraction'][_0xbe58('0x26')]({'where':_0x25e313[_0xbe58('0x20')]?_0x25e313['options']['where']||null:null})[_0xbe58('0x12')](function(_0x16bf7a){if(_0x16bf7a){return _0x16bf7a[_0xbe58('0x27')](_0x25e313[_0xbe58('0x1f')][_0xbe58('0x28')],_[_0xbe58('0x29')](_0x25e313[_0xbe58('0x1f')],[_0xbe58('0x28'),'id'])||{});}})[_0xbe58('0x2a')](function(_0x5a76c2){logger['info']('AddTags',_0x25e313);logger[_0xbe58('0x15')](_0xbe58('0x2b'),_0x25e313,JSON[_0xbe58('0x17')](_0x5a76c2));_0x2badde(_0x5a76c2);})[_0xbe58('0x25')](function(_0x486823){logger['error'](_0xbe58('0x2b'),_0x486823['message'],_0x25e313);_0x86df24(_this[_0xbe58('0x18')](0x1f4,_0x486823[_0xbe58('0x1a')]));});});}; \ No newline at end of file +var _0x89ac=['body','options','raw','attributes','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','addTags','ids','omit','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89ac,0x89));var _0xc89a=function(_0x24c733,_0x525907){_0x24c733=_0x24c733-0x0;var _0x21a2d3=_0x89ac[_0x24c733];return _0x21a2d3;};'use strict';var _=require(_0xc89a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc89a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc89a('0x2'));var db=require(_0xc89a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc89a('0x4'))(_0xc89a('0x5'));var config=require(_0xc89a('0x6'));var jayson=require(_0xc89a('0x7'));var client=jayson['client'][_0xc89a('0x8')]({'port':0x232a});config[_0xc89a('0x9')]=_[_0xc89a('0xa')](config[_0xc89a('0x9')],{'host':_0xc89a('0xb'),'port':0x18eb});var socket=require(_0xc89a('0xc'))(new Redis(config[_0xc89a('0x9')]));require('./openchannelInteraction.socket')[_0xc89a('0xd')](socket);function respondWithRpcPromise(_0x3d3cf6,_0x499db2,_0x485efe){return new BPromise(function(_0x487194,_0xe5b8ca){return client[_0xc89a('0xe')](_0x3d3cf6,_0x485efe)[_0xc89a('0xf')](function(_0x1db47e){logger['info'](_0xc89a('0x10'),_0x499db2,'request\x20sent');logger['debug'](_0xc89a('0x11'),_0x499db2,_0xc89a('0x12'),JSON[_0xc89a('0x13')](_0x1db47e));if(_0x1db47e['error']){if(_0x1db47e[_0xc89a('0x14')][_0xc89a('0x15')]===0x1f4){logger[_0xc89a('0x14')](_0xc89a('0x10'),_0x499db2,_0x1db47e[_0xc89a('0x14')]['message']);return _0xe5b8ca(_0x1db47e[_0xc89a('0x14')][_0xc89a('0x16')]);}logger[_0xc89a('0x14')](_0xc89a('0x10'),_0x499db2,_0x1db47e[_0xc89a('0x14')][_0xc89a('0x16')]);return _0x487194(_0x1db47e[_0xc89a('0x14')][_0xc89a('0x16')]);}else{logger[_0xc89a('0x17')](_0xc89a('0x10'),_0x499db2,_0xc89a('0x12'));_0x487194(_0x1db47e['result'][_0xc89a('0x16')]);}})[_0xc89a('0x18')](function(_0x1d32f1){logger[_0xc89a('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x499db2,_0x1d32f1);_0xe5b8ca(_0x1d32f1);});});}exports[_0xc89a('0x19')]=function(_0x32b9ee){var _0x1cd583=this;return new Promise(function(_0xbeefd0,_0x106767){return db['OpenchannelInteraction'][_0xc89a('0x1a')](_0x32b9ee[_0xc89a('0x1b')],{'raw':_0x32b9ee['options']?_0x32b9ee[_0xc89a('0x1c')][_0xc89a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32b9ee['options']?_0x32b9ee[_0xc89a('0x1c')]['where']||null:null,'attributes':_0x32b9ee[_0xc89a('0x1c')]?_0x32b9ee[_0xc89a('0x1c')][_0xc89a('0x1e')]||null:null,'limit':_0x32b9ee[_0xc89a('0x1c')]?_0x32b9ee[_0xc89a('0x1c')][_0xc89a('0x1f')]||null:null})[_0xc89a('0xf')](function(_0x21940e){logger['info'](_0xc89a('0x19'),_0x32b9ee);logger[_0xc89a('0x20')]('UpdateOpenchannelInteraction',_0x32b9ee,JSON[_0xc89a('0x13')](_0x21940e));_0xbeefd0(_0x21940e);})[_0xc89a('0x18')](function(_0x1d9ea5){logger[_0xc89a('0x14')]('UpdateOpenchannelInteraction',_0x1d9ea5[_0xc89a('0x16')],_0x32b9ee);_0x106767(_0x1cd583[_0xc89a('0x14')](0x1f4,_0x1d9ea5[_0xc89a('0x16')]));});});};exports[_0xc89a('0x21')]=function(_0x5a2e26){return new Promise(function(_0x112701,_0x3a02d9){return db[_0xc89a('0x22')][_0xc89a('0x23')]({'where':_0x5a2e26[_0xc89a('0x1c')]?_0x5a2e26[_0xc89a('0x1c')][_0xc89a('0x24')]||null:null})[_0xc89a('0xf')](function(_0x6bd449){if(_0x6bd449){return _0x6bd449[_0xc89a('0x25')](_0x5a2e26[_0xc89a('0x1b')][_0xc89a('0x26')],_[_0xc89a('0x27')](_0x5a2e26[_0xc89a('0x1b')],[_0xc89a('0x26'),'id'])||{});}})['spread'](function(_0x24efd0){logger['info'](_0xc89a('0x28'),_0x5a2e26);logger['debug'](_0xc89a('0x28'),_0x5a2e26,JSON[_0xc89a('0x13')](_0x24efd0));_0x112701(_0x24efd0);})[_0xc89a('0x18')](function(_0x2b0fc1){logger[_0xc89a('0x14')](_0xc89a('0x28'),_0x2b0fc1[_0xc89a('0x16')],_0x5a2e26);_0x3a02d9(_this[_0xc89a('0x14')](0x1f4,_0x2b0fc1[_0xc89a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a5f9a86..8c0fcbe 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 _0xaee3=['update','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x121def,_0x419723){var _0x13c6b3=function(_0x1561b7){while(--_0x1561b7){_0x121def['push'](_0x121def['shift']());}};_0x13c6b3(++_0x419723);}(_0xaee3,0x145));var _0x3aee=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0xaee3[_0x46a671];return _0x526d75;};'use strict';var OpenchannelInteractionEvents=require(_0x3aee('0x0'));var events=[_0x3aee('0x1'),_0x3aee('0x2'),_0x3aee('0x3')];function createListener(_0x3f8b29,_0x2c779e){return function(_0x49fedf){_0x2c779e['emit'](_0x3f8b29,_0x49fedf);};}function removeListener(_0x1260cd,_0x2d5f11){return function(){OpenchannelInteractionEvents[_0x3aee('0x4')](_0x1260cd,_0x2d5f11);};}exports[_0x3aee('0x5')]=function(_0x54a141){for(var _0x55d728=0x0,_0x4b3d94=events[_0x3aee('0x6')];_0x55d728<_0x4b3d94;_0x55d728++){var _0x2a136b=events[_0x55d728];var _0x2d0627=createListener(_0x3aee('0x7')+_0x2a136b,_0x54a141);OpenchannelInteractionEvents['on'](_0x2a136b,_0x2d0627);}}; \ No newline at end of file +var _0x6561=['emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x520a3f,_0x57eba7){var _0x189b9e=function(_0x43c8c2){while(--_0x43c8c2){_0x520a3f['push'](_0x520a3f['shift']());}};_0x189b9e(++_0x57eba7);}(_0x6561,0x10e));var _0x1656=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x6561[_0x11f249];return _0x5c3656;};'use strict';var OpenchannelInteractionEvents=require(_0x1656('0x0'));var events=[_0x1656('0x1'),_0x1656('0x2'),'update'];function createListener(_0x3d2a71,_0x18fd6e){return function(_0x24426f){_0x18fd6e[_0x1656('0x3')](_0x3d2a71,_0x24426f);};}function removeListener(_0x1f3b0b,_0x35c4f0){return function(){OpenchannelInteractionEvents['removeListener'](_0x1f3b0b,_0x35c4f0);};}exports[_0x1656('0x4')]=function(_0x1372d0){for(var _0x449177=0x0,_0x1b8e8e=events[_0x1656('0x5')];_0x449177<_0x1b8e8e;_0x449177++){var _0x4b4512=events[_0x449177];var _0x5f3a5d=createListener(_0x1656('0x6')+_0x4b4512,_0x1372d0);OpenchannelInteractionEvents['on'](_0x4b4512,_0x5f3a5d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e9bf266..be397c3 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x5dac46,_0x28e9dc){var _0x51095c=function(_0x5918c6){while(--_0x5918c6){_0x5dac46['push'](_0x5dac46['shift']());}};_0x51095c(++_0x28e9dc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0xcb91[_0x52b7b9];return _0x5b5d30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x10807e,_0x2bba67){var _0xa69618=function(_0xd0c9e2){while(--_0xd0c9e2){_0x10807e['push'](_0x10807e['shift']());}};_0xa69618(++_0x2bba67);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 8f7b92a..35566f7 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 _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x298897,_0x2e08d2){var _0x1abad6=function(_0x325660){while(--_0x325660){_0x298897['push'](_0x298897['shift']());}};_0x1abad6(++_0x2e08d2);}(_0xfd6f,0x19d));var _0xffd6=function(_0x445c1e,_0x59ebb6){_0x445c1e=_0x445c1e-0x0;var _0x333ee3=_0xfd6f[_0x445c1e];return _0x333ee3;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}}; \ No newline at end of file +var _0x4899=['ENUM','out','DATE','STRING','sequelize','TEXT','BOOLEAN'];(function(_0x2f7e06,_0x391dd8){var _0x50c81a=function(_0x4ac464){while(--_0x4ac464){_0x2f7e06['push'](_0x2f7e06['shift']());}};_0x50c81a(++_0x391dd8);}(_0x4899,0x74));var _0x9489=function(_0x3f50e2,_0x59e6ed){_0x3f50e2=_0x3f50e2-0x0;var _0x109a55=_0x4899[_0x3f50e2];return _0x109a55;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'body':{'type':Sequelize[_0x9489('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9489('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9489('0x3')]('in',_0x9489('0x4')),'defaultValue':_0x9489('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9489('0x5')]},'providerName':{'type':Sequelize[_0x9489('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 670a9cc..3aaa732 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 _0x612a=['OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SIP/%s','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','debug','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','nolimit','sort','pick','where','merge','map','filter','options','includeAll','include','OpenchannelMessage','findAll','rows','show','params','fields','find','create','body','openchannel-interactions','openchannel','readAt','format','user','agent','UserId','get','OpenchannelInteraction'];(function(_0x533210,_0x4649db){var _0x35f206=function(_0xd1a309){while(--_0xd1a309){_0x533210['push'](_0x533210['shift']());}};_0x35f206(++_0x4649db);}(_0x612a,0xa4));var _0xa612=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x612a[_0x58175c];return _0x55b88f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa612('0x0'));var zipdir=require(_0xa612('0x1'));var jsonpatch=require(_0xa612('0x2'));var rp=require(_0xa612('0x3'));var moment=require('moment');var BPromise=require(_0xa612('0x4'));var Mustache=require(_0xa612('0x5'));var util=require(_0xa612('0x6'));var path=require(_0xa612('0x7'));var sox=require(_0xa612('0x8'));var csv=require('to-csv');var ejs=require(_0xa612('0x9'));var fs=require('fs');var fs_extra=require(_0xa612('0xa'));var _=require(_0xa612('0xb'));var squel=require(_0xa612('0xc'));var crypto=require(_0xa612('0xd'));var jsforce=require(_0xa612('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa612('0xf'));var Redis=require(_0xa612('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa612('0x11'));var as=require(_0xa612('0x12'));var hardwareService=require(_0xa612('0x13'));var logger=require(_0xa612('0x14'))(_0xa612('0x15'));var utils=require('../../config/utils');var config=require(_0xa612('0x16'));var licenseUtil=require(_0xa612('0x17'));var db=require(_0xa612('0x18'))['db'];config[_0xa612('0x19')]=_[_0xa612('0x1a')](config[_0xa612('0x19')],{'host':_0xa612('0x1b'),'port':0x18eb});var socket=require(_0xa612('0x1c'))(new Redis(config[_0xa612('0x19')]));require('./openchannelMessage.socket')[_0xa612('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa612('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xa612('0x1e')][_0xa612('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x11115b,_0x314980,_0x3b39ea,_0x56ce52){return new BPromise(function(_0x5a28d1,_0x415540){var _0x304cd8=_0x56ce52||client;return _0x304cd8[_0xa612('0x20')](_0x11115b,_0x3b39ea)[_0xa612('0x21')](function(_0x4c3446){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x314980,'request\x20sent');logger[_0xa612('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x314980,_0xa612('0x23'),JSON[_0xa612('0x24')](_0x4c3446));if(_0x4c3446['error']){if(_0x4c3446[_0xa612('0x25')]['code']===0x1f4){logger[_0xa612('0x25')](_0xa612('0x26'),_0x314980,_0x4c3446[_0xa612('0x25')][_0xa612('0x27')]);return _0x415540(_0x4c3446[_0xa612('0x25')][_0xa612('0x27')]);}logger[_0xa612('0x25')](_0xa612('0x26'),_0x314980,_0x4c3446[_0xa612('0x25')][_0xa612('0x27')]);return _0x5a28d1(_0x4c3446[_0xa612('0x25')][_0xa612('0x27')]);}else{logger[_0xa612('0x28')](_0xa612('0x26'),_0x314980,_0xa612('0x23'));_0x5a28d1(_0x4c3446[_0xa612('0x29')][_0xa612('0x27')]);}})[_0xa612('0x2a')](function(_0x43a7e8){logger[_0xa612('0x25')](_0xa612('0x26'),_0x314980,_0x43a7e8);_0x415540(_0x43a7e8);});});}function respondWithStatusCode(_0x5e32f3,_0x234194){_0x234194=_0x234194||0xcc;return function(_0x5192a7){if(_0x5192a7){return _0x5e32f3[_0xa612('0x2b')](_0x234194);}return _0x5e32f3[_0xa612('0x2c')](_0x234194)[_0xa612('0x2d')]();};}function respondWithResult(_0x52e29f,_0x39f3cc){_0x39f3cc=_0x39f3cc||0xc8;return function(_0xe5810c){if(_0xe5810c){return _0x52e29f[_0xa612('0x2c')](_0x39f3cc)[_0xa612('0x2e')](_0xe5810c);}};}function respondWithFilteredResult(_0x15b095,_0x5a6008){return function(_0x48fee4){if(_0x48fee4){var _0x44371d=typeof _0x5a6008[_0xa612('0x2f')]===_0xa612('0x30')&&typeof _0x5a6008[_0xa612('0x31')]==='undefined';var _0x39b995=_0x48fee4[_0xa612('0x32')];var _0x2aea24=_0x44371d?0x0:_0x5a6008['offset'];var _0x56ae90=_0x44371d?_0x48fee4[_0xa612('0x32')]:_0x5a6008[_0xa612('0x2f')]+_0x5a6008['limit'];var _0x2a6503;if(_0x56ae90>=_0x39b995){_0x56ae90=_0x39b995;_0x2a6503=0xc8;}else{_0x2a6503=0xce;}_0x15b095[_0xa612('0x2c')](_0x2a6503);return _0x15b095[_0xa612('0x33')](_0xa612('0x34'),_0x2aea24+'-'+_0x56ae90+'/'+_0x39b995)[_0xa612('0x2e')](_0x48fee4);}return null;};}function patchUpdates(_0xf041cf){return function(_0x465964){try{jsonpatch['apply'](_0x465964,_0xf041cf,!![]);}catch(_0x58ab42){return BPromise[_0xa612('0x35')](_0x58ab42);}return _0x465964[_0xa612('0x36')]();};}function saveUpdates(_0x3ae416,_0x2a5a33){return function(_0x125749){if(_0x125749){return _0x125749[_0xa612('0x37')](_0x3ae416)[_0xa612('0x21')](function(_0x19e389){return _0x19e389;});}return null;};}function removeEntity(_0x3cfca8,_0x46eeb1){return function(_0x45fa2a){if(_0x45fa2a){return _0x45fa2a[_0xa612('0x38')]()[_0xa612('0x21')](function(){_0x3cfca8[_0xa612('0x2c')](0xcc)[_0xa612('0x2d')]();});}};}function handleEntityNotFound(_0x4eca45,_0x217dc5){return function(_0x4a2152){if(!_0x4a2152){_0x4eca45[_0xa612('0x2b')](0x194);}return _0x4a2152;};}function handleError(_0x269584,_0xb40f37){_0xb40f37=_0xb40f37||0x1f4;return function(_0x1902df){logger[_0xa612('0x25')](_0x1902df[_0xa612('0x39')]);if(_0x1902df[_0xa612('0x3a')]){delete _0x1902df['name'];}_0x269584['status'](_0xb40f37)[_0xa612('0x3b')](_0x1902df);};}exports[_0xa612('0x3c')]=function(_0x4715d9,_0x155720){var _0x1487cc={},_0x4059e2={},_0x19ada7={'count':0x0,'rows':[]};var _0x201794=_['map'](db['OpenchannelMessage'][_0xa612('0x3d')],function(_0xbbecbd){return{'name':_0xbbecbd[_0xa612('0x3e')],'type':_0xbbecbd[_0xa612('0x3f')][_0xa612('0x40')]};});_0x4059e2[_0xa612('0x41')]=_['map'](_0x201794,'name');_0x4059e2[_0xa612('0x42')]=_[_0xa612('0x43')](_0x4715d9[_0xa612('0x42')]);_0x4059e2[_0xa612('0x44')]=_['intersection'](_0x4059e2[_0xa612('0x41')],_0x4059e2[_0xa612('0x42')]);_0x1487cc[_0xa612('0x45')]=_[_0xa612('0x46')](_0x4059e2[_0xa612('0x41')],qs['fields'](_0x4715d9['query']['fields']));_0x1487cc[_0xa612('0x45')]=_0x1487cc[_0xa612('0x45')][_0xa612('0x47')]?_0x1487cc[_0xa612('0x45')]:_0x4059e2['model'];if(!_0x4715d9[_0xa612('0x42')]['hasOwnProperty'](_0xa612('0x48'))){_0x1487cc[_0xa612('0x31')]=qs['limit'](_0x4715d9[_0xa612('0x42')][_0xa612('0x31')]);_0x1487cc['offset']=qs[_0xa612('0x2f')](_0x4715d9[_0xa612('0x42')]['offset']);}_0x1487cc['order']=qs[_0xa612('0x49')](_0x4715d9[_0xa612('0x42')][_0xa612('0x49')]);_0x1487cc['where']=qs[_0xa612('0x44')](_[_0xa612('0x4a')](_0x4715d9['query'],_0x4059e2[_0xa612('0x44')]),_0x201794);if(_0x4715d9[_0xa612('0x42')]['filter']){_0x1487cc[_0xa612('0x4b')]=_[_0xa612('0x4c')](_0x1487cc[_0xa612('0x4b')],{'$or':_[_0xa612('0x4d')](_0x201794,function(_0x3d5eaa){if(_0x3d5eaa[_0xa612('0x3f')]!=='VIRTUAL'){var _0x393049={};_0x393049[_0x3d5eaa[_0xa612('0x3a')]]={'$like':'%'+_0x4715d9[_0xa612('0x42')][_0xa612('0x4e')]+'%'};return _0x393049;}})});}_0x1487cc=_['merge']({},_0x1487cc,_0x4715d9[_0xa612('0x4f')]);var _0x41ee5c={'where':_0x1487cc[_0xa612('0x4b')]};return db['OpenchannelMessage'][_0xa612('0x32')](_0x41ee5c)['then'](function(_0x1d09e7){_0x19ada7['count']=_0x1d09e7;if(_0x4715d9[_0xa612('0x42')][_0xa612('0x50')]){_0x1487cc[_0xa612('0x51')]=[{'all':!![]}];}return db[_0xa612('0x52')][_0xa612('0x53')](_0x1487cc);})[_0xa612('0x21')](function(_0x295bac){_0x19ada7[_0xa612('0x54')]=_0x295bac;return _0x19ada7;})[_0xa612('0x21')](respondWithFilteredResult(_0x155720,_0x1487cc))['catch'](handleError(_0x155720,null));};exports[_0xa612('0x55')]=function(_0x1a2948,_0x275635){var _0x130ffb={'raw':!![],'where':{'id':_0x1a2948[_0xa612('0x56')]['id']}},_0x3a3cf7={};_0x3a3cf7['model']=_[_0xa612('0x43')](db[_0xa612('0x52')][_0xa612('0x3d')]);_0x3a3cf7[_0xa612('0x42')]=_[_0xa612('0x43')](_0x1a2948['query']);_0x3a3cf7[_0xa612('0x44')]=_[_0xa612('0x46')](_0x3a3cf7[_0xa612('0x41')],_0x3a3cf7[_0xa612('0x42')]);_0x130ffb[_0xa612('0x45')]=_[_0xa612('0x46')](_0x3a3cf7[_0xa612('0x41')],qs[_0xa612('0x57')](_0x1a2948[_0xa612('0x42')]['fields']));_0x130ffb[_0xa612('0x45')]=_0x130ffb[_0xa612('0x45')]['length']?_0x130ffb[_0xa612('0x45')]:_0x3a3cf7[_0xa612('0x41')];if(_0x1a2948[_0xa612('0x42')][_0xa612('0x50')]){_0x130ffb[_0xa612('0x51')]=[{'all':!![]}];}_0x130ffb=_[_0xa612('0x4c')]({},_0x130ffb,_0x1a2948[_0xa612('0x4f')]);return db[_0xa612('0x52')][_0xa612('0x58')](_0x130ffb)[_0xa612('0x21')](handleEntityNotFound(_0x275635,null))[_0xa612('0x21')](respondWithResult(_0x275635,null))[_0xa612('0x2a')](handleError(_0x275635,null));};exports[_0xa612('0x59')]=function(_0x31a587,_0xb2ee5f){return db[_0xa612('0x52')][_0xa612('0x59')](_0x31a587[_0xa612('0x5a')],{})[_0xa612('0x21')](respondWithResult(_0xb2ee5f,0xc9))[_0xa612('0x2a')](handleError(_0xb2ee5f,null));};exports[_0xa612('0x37')]=function(_0x347e1f,_0x1217e7){if(_0x347e1f['body']['id']){delete _0x347e1f['body']['id'];}return db[_0xa612('0x52')][_0xa612('0x58')]({'where':{'id':_0x347e1f[_0xa612('0x56')]['id']}})['then'](handleEntityNotFound(_0x1217e7,null))[_0xa612('0x21')](saveUpdates(_0x347e1f[_0xa612('0x5a')],null))[_0xa612('0x21')](respondWithResult(_0x1217e7,null))[_0xa612('0x2a')](handleError(_0x1217e7,null));};exports['destroy']=function(_0x7a8977,_0x24731d){return db['OpenchannelMessage'][_0xa612('0x58')]({'where':{'id':_0x7a8977[_0xa612('0x56')]['id']}})[_0xa612('0x21')](handleEntityNotFound(_0x24731d,null))[_0xa612('0x21')](removeEntity(_0x24731d,null))['catch'](handleError(_0x24731d,null));};exports['describe']=function(_0x24d7ed,_0x556e86){return db[_0xa612('0x52')]['describe']()[_0xa612('0x21')](respondWithResult(_0x556e86,null))[_0xa612('0x2a')](handleError(_0x556e86,null));};var interaction_log=require(_0xa612('0x14'))(_0xa612('0x5b'));exports['accept']=function(_0x557b23,_0x1c7fc1,_0x1ae273){var _0x465886={'agent':{},'channel':_0xa612('0x5c')};if(_0x557b23[_0xa612('0x5a')]['id']){delete _0x557b23[_0xa612('0x5a')]['id'];}_0x557b23[_0xa612('0x5a')]['read']=!![];_0x557b23[_0xa612('0x5a')][_0xa612('0x5d')]=moment()[_0xa612('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x557b23['body']['UserId']=_0x557b23[_0xa612('0x5a')]['UserId']||_0x557b23[_0xa612('0x5f')]['id'];_0x465886[_0xa612('0x60')]['id']=_0x557b23[_0xa612('0x5a')][_0xa612('0x61')];return db[_0xa612('0x52')][_0xa612('0x58')]({'where':{'id':_0x557b23[_0xa612('0x56')]['id'],'UserId':null}})[_0xa612('0x21')](handleEntityNotFound(_0x1c7fc1,null))[_0xa612('0x21')](saveUpdates(_0x557b23[_0xa612('0x5a')],null))[_0xa612('0x21')](function(_0x4e1aeb){if(_0x4e1aeb){_0x465886[_0xa612('0x27')]=_0x4e1aeb[_0xa612('0x62')]({'plain':!![]});return db[_0xa612('0x63')]['find']({'where':{'id':_0x4e1aeb[_0xa612('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1c7fc1,null))[_0xa612('0x21')](function(_0x40f0d1){if(_0x40f0d1){return _0x40f0d1[_0xa612('0x37')]({'UserId':_0x557b23[_0xa612('0x5a')]['UserId'],'read1stAt':_[_0xa612('0x65')](_0x40f0d1[_0xa612('0x66')])?moment()[_0xa612('0x5e')](_0xa612('0x67')):undefined});}return null;})['then'](function(_0x2503b5){if(_0x2503b5){_0x465886[_0xa612('0x68')]=_0x2503b5[_0xa612('0x62')]({'plain':!![]});interaction_log['info'](_0xa612('0x69'),_0x557b23['user']['id'],_0x557b23[_0xa612('0x5f')][_0xa612('0x3a')],_0x557b23[_0xa612('0x5f')][_0xa612('0x6a')],_0x465886[_0xa612('0x68')]['id'],_0x557b23['body']?JSON[_0xa612('0x24')](_0x557b23['body']):'null');return respondWithRpcPromise(_0xa612('0x6b'),_0xa612('0x6c'),_0x465886);}return null;})[_0xa612('0x21')](function(_0x582b72){var _0x44bfe1=_0xa612('0x6d')+_0x582b72[_0xa612('0x27')][_0xa612('0x6e')];return db[_0xa612('0x6f')][_0xa612('0x42')](_0x44bfe1,{'type':db[_0xa612('0x70')][_0xa612('0x71')][_0xa612('0x72')],'raw':!![]})[_0xa612('0x21')](function(_0x2cbfcd){return _0x2cbfcd;});})[_0xa612('0x21')](function(_0x55f442){if(_0x55f442){_0x465886['message'][_0xa612('0x73')]=_0x55f442[0x0];if(!_0x557b23[_0xa612('0x5a')][_0xa612('0x61')])return;return db[_0xa612('0x74')][_0xa612('0x58')]({'where':{'id':_0x557b23[_0xa612('0x5a')]['UserId'],'role':_0xa612('0x60')},'attributes':['id','name',_0xa612('0x75'),_0xa612('0x76'),_0xa612('0x77')],'raw':!![]});}return null;})[_0xa612('0x21')](function(_0x21955d){if(!_0x21955d)return null;_0x465886[_0xa612('0x27')]['agent']=_0x21955d;return _0x465886;})['then'](function(_0x4b98bf){if(_0x4b98bf){if(_0x557b23[_0xa612('0x5a')][_0xa612('0x78')]){_0x465886[_0xa612('0x27')][_0xa612('0x79')]=util[_0xa612('0x5e')]('SIP/%s',_0x557b23[_0xa612('0x5f')][_0xa612('0x3a')]);_0x465886[_0xa612('0x27')][_0xa612('0x7a')]=_0x465886[_0xa612('0x7a')];_0x465886['message'][_0xa612('0x7b')]=_0x465886[_0xa612('0x7a')];_0x465886[_0xa612('0x27')][_0xa612('0x7c')]='accept';return respondWithRpcPromise(_0xa612('0x7d'),'EventManager',{'event':_0xa612('0x7e'),'message':_0x465886['message']},client9002)[_0xa612('0x21')](function(){return _0x465886;});}return _0x465886;}return null;})[_0xa612('0x21')](respondWithResult(_0x1c7fc1,null))[_0xa612('0x2a')](handleError(_0x1c7fc1,null));};var interaction_log=require(_0xa612('0x14'))(_0xa612('0x5b'));exports['reject']=function(_0x5e8122,_0x3cd756,_0x35e69b){var _0x50d3d3={'agent':{},'channel':'openchannel'};if(_0x5e8122[_0xa612('0x5a')]['id']){delete _0x5e8122['body']['id'];}_0x5e8122[_0xa612('0x5a')][_0xa612('0x61')]=_0x5e8122['body'][_0xa612('0x61')]||_0x5e8122['user']['id'];_0x50d3d3['agent']['id']=_0x5e8122[_0xa612('0x5a')][_0xa612('0x61')];return db[_0xa612('0x52')]['find']({'where':{'id':_0x5e8122[_0xa612('0x56')]['id'],'UserId':null}})[_0xa612('0x21')](handleEntityNotFound(_0x3cd756,null))[_0xa612('0x21')](function(_0xda7b51){if(_0xda7b51){_0x50d3d3[_0xa612('0x27')]=_0xda7b51['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xda7b51['OpenchannelInteractionId']}});}return null;})[_0xa612('0x21')](handleEntityNotFound(_0x3cd756,null))[_0xa612('0x21')](function(_0x28a0b7){if(_0x28a0b7){_0x50d3d3[_0xa612('0x68')]=_0x28a0b7[_0xa612('0x62')]({'plain':!![]});interaction_log[_0xa612('0x28')](_0xa612('0x7f'),_0x5e8122[_0xa612('0x5f')]['id'],_0x5e8122[_0xa612('0x5f')][_0xa612('0x3a')],_0x5e8122['user'][_0xa612('0x6a')],_0x50d3d3[_0xa612('0x68')]['id'],_0x5e8122[_0xa612('0x5a')]?JSON[_0xa612('0x24')](_0x5e8122[_0xa612('0x5a')]):_0xa612('0x80'));return respondWithRpcPromise(_0xa612('0x81'),'rejectMessage',_0x50d3d3);}return null;})[_0xa612('0x21')](function(_0x3b5a48){var _0x3cf166='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3b5a48['message'][_0xa612('0x6e')];return db['sequelize'][_0xa612('0x42')](_0x3cf166,{'type':db[_0xa612('0x70')][_0xa612('0x71')][_0xa612('0x72')],'raw':!![]})[_0xa612('0x21')](function(_0x480067){return _0x480067;});})[_0xa612('0x21')](function(_0x1b4153){if(_0x1b4153){_0x50d3d3[_0xa612('0x27')][_0xa612('0x73')]=_0x1b4153[0x0];if(!_0x5e8122[_0xa612('0x5a')]['UserId'])return;return db[_0xa612('0x74')][_0xa612('0x58')]({'where':{'id':_0x5e8122[_0xa612('0x5a')]['UserId'],'role':_0xa612('0x60')},'attributes':['id',_0xa612('0x3a'),_0xa612('0x75'),_0xa612('0x76'),_0xa612('0x77')],'raw':!![]});}return null;})[_0xa612('0x21')](function(_0x556d96){if(!_0x556d96)return null;_0x50d3d3[_0xa612('0x27')][_0xa612('0x60')]=_0x556d96;return _0x50d3d3;})[_0xa612('0x21')](function(_0x526d3c){if(_0x526d3c){_0x526d3c[_0xa612('0x27')][_0xa612('0x79')]=util['format'](_0xa612('0x82'),_0x5e8122[_0xa612('0x5f')][_0xa612('0x3a')]);_0x526d3c[_0xa612('0x27')]['channel']=_0x50d3d3[_0xa612('0x7a')];_0x526d3c[_0xa612('0x27')][_0xa612('0x7b')]=_0x50d3d3[_0xa612('0x7a')];_0x526d3c[_0xa612('0x27')]['event']=_0xa612('0x35');respondWithRpcPromise(_0xa612('0x7d'),_0xa612('0x7d'),{'event':_0xa612('0x83'),'message':_0x526d3c[_0xa612('0x27')]},client9002);return _0x50d3d3;}return null;})[_0xa612('0x21')](respondWithResult(_0x3cd756,null))[_0xa612('0x2a')](handleError(_0x3cd756,null));}; \ No newline at end of file +var _0xc9aa=['options','includeAll','include','findAll','params','find','create','body','describe','openchannel-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE: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','contact','User','fullname','internal','manual','interface','channel','event','accept','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','email','SIP/%s','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','name','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2f8255,_0x44ff85){var _0x2207f6=function(_0x30c5c2){while(--_0x30c5c2){_0x2f8255['push'](_0x2f8255['shift']());}};_0x2207f6(++_0x44ff85);}(_0xc9aa,0x12c));var _0xac9a=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0xc9aa[_0x813d0a];return _0x241352;};'use strict';var emlformat=require(_0xac9a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac9a('0x1'));var jsonpatch=require(_0xac9a('0x2'));var rp=require(_0xac9a('0x3'));var moment=require(_0xac9a('0x4'));var BPromise=require(_0xac9a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xac9a('0x6'));var csv=require(_0xac9a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac9a('0x8'));var _=require(_0xac9a('0x9'));var squel=require(_0xac9a('0xa'));var crypto=require(_0xac9a('0xb'));var jsforce=require(_0xac9a('0xc'));var deskjs=require(_0xac9a('0xd'));var toCsv=require(_0xac9a('0x7'));var querystring=require('querystring');var Papa=require(_0xac9a('0xe'));var Redis=require(_0xac9a('0xf'));var authService=require(_0xac9a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac9a('0x11'));var logger=require(_0xac9a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xac9a('0x13'));var licenseUtil=require(_0xac9a('0x14'));var db=require(_0xac9a('0x15'))['db'];config[_0xac9a('0x16')]=_['defaults'](config[_0xac9a('0x16')],{'host':_0xac9a('0x17'),'port':0x18eb});var socket=require(_0xac9a('0x18'))(new Redis(config['redis']));require(_0xac9a('0x19'))[_0xac9a('0x1a')](socket);var jayson=require(_0xac9a('0x1b'));var client=jayson['client'][_0xac9a('0x1c')]({'port':0x232c});var client9002=jayson[_0xac9a('0x1d')][_0xac9a('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d736d,_0x539fa0,_0x1d849a,_0x4d0961){return new BPromise(function(_0x438530,_0x220665){var _0x31aff2=_0x4d0961||client;return _0x31aff2['request'](_0x5d736d,_0x1d849a)[_0xac9a('0x1e')](function(_0x4f2259){logger['info'](_0xac9a('0x1f'),_0x539fa0,_0xac9a('0x20'));logger[_0xac9a('0x21')](_0xac9a('0x22'),_0x539fa0,_0xac9a('0x20'),JSON[_0xac9a('0x23')](_0x4f2259));if(_0x4f2259['error']){if(_0x4f2259[_0xac9a('0x24')][_0xac9a('0x25')]===0x1f4){logger['error'](_0xac9a('0x1f'),_0x539fa0,_0x4f2259[_0xac9a('0x24')][_0xac9a('0x26')]);return _0x220665(_0x4f2259[_0xac9a('0x24')][_0xac9a('0x26')]);}logger[_0xac9a('0x24')](_0xac9a('0x1f'),_0x539fa0,_0x4f2259[_0xac9a('0x24')]['message']);return _0x438530(_0x4f2259['error']['message']);}else{logger[_0xac9a('0x27')](_0xac9a('0x1f'),_0x539fa0,_0xac9a('0x20'));_0x438530(_0x4f2259[_0xac9a('0x28')]['message']);}})[_0xac9a('0x29')](function(_0x352839){logger[_0xac9a('0x24')](_0xac9a('0x1f'),_0x539fa0,_0x352839);_0x220665(_0x352839);});});}function respondWithStatusCode(_0x4ad8f2,_0xd2dcc4){_0xd2dcc4=_0xd2dcc4||0xcc;return function(_0x4a8ad7){if(_0x4a8ad7){return _0x4ad8f2[_0xac9a('0x2a')](_0xd2dcc4);}return _0x4ad8f2[_0xac9a('0x2b')](_0xd2dcc4)[_0xac9a('0x2c')]();};}function respondWithResult(_0x37daae,_0xbb8c5c){_0xbb8c5c=_0xbb8c5c||0xc8;return function(_0xe791b4){if(_0xe791b4){return _0x37daae[_0xac9a('0x2b')](_0xbb8c5c)[_0xac9a('0x2d')](_0xe791b4);}};}function respondWithFilteredResult(_0x36a0c3,_0x64ff8e){return function(_0x4b3a0c){if(_0x4b3a0c){var _0x49d00b=typeof _0x64ff8e[_0xac9a('0x2e')]===_0xac9a('0x2f')&&typeof _0x64ff8e['limit']==='undefined';var _0x3a6ac=_0x4b3a0c[_0xac9a('0x30')];var _0x158d68=_0x49d00b?0x0:_0x64ff8e[_0xac9a('0x2e')];var _0x46626e=_0x49d00b?_0x4b3a0c['count']:_0x64ff8e[_0xac9a('0x2e')]+_0x64ff8e[_0xac9a('0x31')];var _0x56c8fc;if(_0x46626e>=_0x3a6ac){_0x46626e=_0x3a6ac;_0x56c8fc=0xc8;}else{_0x56c8fc=0xce;}_0x36a0c3[_0xac9a('0x2b')](_0x56c8fc);return _0x36a0c3[_0xac9a('0x32')](_0xac9a('0x33'),_0x158d68+'-'+_0x46626e+'/'+_0x3a6ac)[_0xac9a('0x2d')](_0x4b3a0c);}return null;};}function patchUpdates(_0x4fa8c8){return function(_0x1aed83){try{jsonpatch[_0xac9a('0x34')](_0x1aed83,_0x4fa8c8,!![]);}catch(_0x2f26b2){return BPromise[_0xac9a('0x35')](_0x2f26b2);}return _0x1aed83[_0xac9a('0x36')]();};}function saveUpdates(_0xe01e40,_0x2df00a){return function(_0x1aaddb){if(_0x1aaddb){return _0x1aaddb[_0xac9a('0x37')](_0xe01e40)['then'](function(_0x488ef3){return _0x488ef3;});}return null;};}function removeEntity(_0x54e88d,_0x249685){return function(_0x3bd1ef){if(_0x3bd1ef){return _0x3bd1ef['destroy']()[_0xac9a('0x1e')](function(){_0x54e88d[_0xac9a('0x2b')](0xcc)[_0xac9a('0x2c')]();});}};}function handleEntityNotFound(_0x3172ca,_0x3d3bfd){return function(_0x22da68){if(!_0x22da68){_0x3172ca['sendStatus'](0x194);}return _0x22da68;};}function handleError(_0x5679a0,_0x1e05d4){_0x1e05d4=_0x1e05d4||0x1f4;return function(_0x4818e6){logger[_0xac9a('0x24')](_0x4818e6['stack']);if(_0x4818e6[_0xac9a('0x38')]){delete _0x4818e6[_0xac9a('0x38')];}_0x5679a0[_0xac9a('0x2b')](_0x1e05d4)['send'](_0x4818e6);};}exports['index']=function(_0x33b4b2,_0x48ee89){var _0x5d8518={},_0x189e7c={},_0x2fed0f={'count':0x0,'rows':[]};var _0x4260a2=_[_0xac9a('0x39')](db[_0xac9a('0x3a')][_0xac9a('0x3b')],function(_0x48242c){return{'name':_0x48242c[_0xac9a('0x3c')],'type':_0x48242c['type'][_0xac9a('0x3d')]};});_0x189e7c[_0xac9a('0x3e')]=_[_0xac9a('0x39')](_0x4260a2,_0xac9a('0x38'));_0x189e7c[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x33b4b2[_0xac9a('0x3f')]);_0x189e7c[_0xac9a('0x41')]=_['intersection'](_0x189e7c[_0xac9a('0x3e')],_0x189e7c[_0xac9a('0x3f')]);_0x5d8518['attributes']=_[_0xac9a('0x42')](_0x189e7c[_0xac9a('0x3e')],qs[_0xac9a('0x43')](_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x5d8518[_0xac9a('0x44')]=_0x5d8518[_0xac9a('0x44')][_0xac9a('0x45')]?_0x5d8518[_0xac9a('0x44')]:_0x189e7c['model'];if(!_0x33b4b2[_0xac9a('0x3f')]['hasOwnProperty'](_0xac9a('0x46'))){_0x5d8518[_0xac9a('0x31')]=qs[_0xac9a('0x31')](_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x31')]);_0x5d8518[_0xac9a('0x2e')]=qs['offset'](_0x33b4b2['query']['offset']);}_0x5d8518[_0xac9a('0x47')]=qs[_0xac9a('0x48')](_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x48')]);_0x5d8518[_0xac9a('0x49')]=qs[_0xac9a('0x41')](_[_0xac9a('0x4a')](_0x33b4b2[_0xac9a('0x3f')],_0x189e7c['filters']),_0x4260a2);if(_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x4b')]){_0x5d8518[_0xac9a('0x49')]=_[_0xac9a('0x4c')](_0x5d8518[_0xac9a('0x49')],{'$or':_['map'](_0x4260a2,function(_0x1246a7){if(_0x1246a7['type']!==_0xac9a('0x4d')){var _0x29f644={};_0x29f644[_0x1246a7[_0xac9a('0x38')]]={'$like':'%'+_0x33b4b2[_0xac9a('0x3f')][_0xac9a('0x4b')]+'%'};return _0x29f644;}})});}_0x5d8518=_[_0xac9a('0x4c')]({},_0x5d8518,_0x33b4b2[_0xac9a('0x4e')]);var _0x8e67af={'where':_0x5d8518['where']};return db[_0xac9a('0x3a')][_0xac9a('0x30')](_0x8e67af)['then'](function(_0x4ced54){_0x2fed0f[_0xac9a('0x30')]=_0x4ced54;if(_0x33b4b2['query'][_0xac9a('0x4f')]){_0x5d8518[_0xac9a('0x50')]=[{'all':!![]}];}return db[_0xac9a('0x3a')][_0xac9a('0x51')](_0x5d8518);})['then'](function(_0x4c3ad9){_0x2fed0f['rows']=_0x4c3ad9;return _0x2fed0f;})['then'](respondWithFilteredResult(_0x48ee89,_0x5d8518))['catch'](handleError(_0x48ee89,null));};exports['show']=function(_0x96bcf,_0x1071b9){var _0x5126f6={'raw':!![],'where':{'id':_0x96bcf[_0xac9a('0x52')]['id']}},_0x1238ac={};_0x1238ac['model']=_[_0xac9a('0x40')](db[_0xac9a('0x3a')][_0xac9a('0x3b')]);_0x1238ac[_0xac9a('0x3f')]=_[_0xac9a('0x40')](_0x96bcf[_0xac9a('0x3f')]);_0x1238ac[_0xac9a('0x41')]=_[_0xac9a('0x42')](_0x1238ac['model'],_0x1238ac[_0xac9a('0x3f')]);_0x5126f6[_0xac9a('0x44')]=_[_0xac9a('0x42')](_0x1238ac[_0xac9a('0x3e')],qs['fields'](_0x96bcf[_0xac9a('0x3f')][_0xac9a('0x43')]));_0x5126f6['attributes']=_0x5126f6['attributes'][_0xac9a('0x45')]?_0x5126f6[_0xac9a('0x44')]:_0x1238ac[_0xac9a('0x3e')];if(_0x96bcf['query'][_0xac9a('0x4f')]){_0x5126f6['include']=[{'all':!![]}];}_0x5126f6=_['merge']({},_0x5126f6,_0x96bcf[_0xac9a('0x4e')]);return db[_0xac9a('0x3a')][_0xac9a('0x53')](_0x5126f6)['then'](handleEntityNotFound(_0x1071b9,null))[_0xac9a('0x1e')](respondWithResult(_0x1071b9,null))[_0xac9a('0x29')](handleError(_0x1071b9,null));};exports[_0xac9a('0x54')]=function(_0x4d89df,_0x62fb8a){return db[_0xac9a('0x3a')][_0xac9a('0x54')](_0x4d89df['body'],{})[_0xac9a('0x1e')](respondWithResult(_0x62fb8a,0xc9))['catch'](handleError(_0x62fb8a,null));};exports[_0xac9a('0x37')]=function(_0x4c9167,_0x1f5c34){if(_0x4c9167[_0xac9a('0x55')]['id']){delete _0x4c9167[_0xac9a('0x55')]['id'];}return db['OpenchannelMessage'][_0xac9a('0x53')]({'where':{'id':_0x4c9167[_0xac9a('0x52')]['id']}})[_0xac9a('0x1e')](handleEntityNotFound(_0x1f5c34,null))[_0xac9a('0x1e')](saveUpdates(_0x4c9167[_0xac9a('0x55')],null))[_0xac9a('0x1e')](respondWithResult(_0x1f5c34,null))['catch'](handleError(_0x1f5c34,null));};exports['destroy']=function(_0x5935df,_0x491ee8){return db[_0xac9a('0x3a')][_0xac9a('0x53')]({'where':{'id':_0x5935df[_0xac9a('0x52')]['id']}})['then'](handleEntityNotFound(_0x491ee8,null))[_0xac9a('0x1e')](removeEntity(_0x491ee8,null))['catch'](handleError(_0x491ee8,null));};exports[_0xac9a('0x56')]=function(_0x5d1bcd,_0xbaa18c){return db[_0xac9a('0x3a')][_0xac9a('0x56')]()['then'](respondWithResult(_0xbaa18c,null))[_0xac9a('0x29')](handleError(_0xbaa18c,null));};var interaction_log=require(_0xac9a('0x12'))(_0xac9a('0x57'));exports['accept']=function(_0x50eb96,_0x55fc82,_0x519a95){var _0x1259c5={'agent':{},'channel':'openchannel'};if(_0x50eb96[_0xac9a('0x55')]['id']){delete _0x50eb96[_0xac9a('0x55')]['id'];}_0x50eb96[_0xac9a('0x55')]['read']=!![];_0x50eb96[_0xac9a('0x55')][_0xac9a('0x58')]=moment()[_0xac9a('0x59')](_0xac9a('0x5a'));_0x50eb96['body'][_0xac9a('0x5b')]=_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')]||_0x50eb96[_0xac9a('0x5c')]['id'];_0x1259c5[_0xac9a('0x5d')]['id']=_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')];return db['OpenchannelMessage'][_0xac9a('0x53')]({'where':{'id':_0x50eb96['params']['id'],'UserId':null}})[_0xac9a('0x1e')](handleEntityNotFound(_0x55fc82,null))[_0xac9a('0x1e')](saveUpdates(_0x50eb96[_0xac9a('0x55')],null))[_0xac9a('0x1e')](function(_0x33462d){if(_0x33462d){_0x1259c5[_0xac9a('0x26')]=_0x33462d[_0xac9a('0x5e')]({'plain':!![]});return db[_0xac9a('0x5f')][_0xac9a('0x53')]({'where':{'id':_0x33462d[_0xac9a('0x60')]}});}return null;})[_0xac9a('0x1e')](handleEntityNotFound(_0x55fc82,null))[_0xac9a('0x1e')](function(_0x23167d){if(_0x23167d){return _0x23167d[_0xac9a('0x37')]({'UserId':_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')],'read1stAt':_[_0xac9a('0x61')](_0x23167d['read1stAt'])?moment()[_0xac9a('0x59')](_0xac9a('0x5a')):undefined});}return null;})[_0xac9a('0x1e')](function(_0x166ec6){if(_0x166ec6){_0x1259c5[_0xac9a('0x62')]=_0x166ec6['get']({'plain':!![]});interaction_log[_0xac9a('0x27')](_0xac9a('0x63'),_0x50eb96['user']['id'],_0x50eb96[_0xac9a('0x5c')]['name'],_0x50eb96[_0xac9a('0x5c')][_0xac9a('0x64')],_0x1259c5[_0xac9a('0x62')]['id'],_0x50eb96['body']?JSON['stringify'](_0x50eb96[_0xac9a('0x55')]):_0xac9a('0x65'));return respondWithRpcPromise(_0xac9a('0x66'),_0xac9a('0x67'),_0x1259c5);}return null;})[_0xac9a('0x1e')](function(_0x5414fb){var _0x135514=_0xac9a('0x68')+_0x5414fb[_0xac9a('0x26')][_0xac9a('0x69')];return db[_0xac9a('0x6a')]['query'](_0x135514,{'type':db[_0xac9a('0x6b')][_0xac9a('0x6c')]['SELECT'],'raw':!![]})[_0xac9a('0x1e')](function(_0x486cc3){return _0x486cc3;});})['then'](function(_0x5b6cc1){if(_0x5b6cc1){_0x1259c5['message'][_0xac9a('0x6d')]=_0x5b6cc1[0x0];if(!_0x50eb96[_0xac9a('0x55')][_0xac9a('0x5b')])return;return db[_0xac9a('0x6e')][_0xac9a('0x53')]({'where':{'id':_0x50eb96['body'][_0xac9a('0x5b')],'role':_0xac9a('0x5d')},'attributes':['id','name',_0xac9a('0x6f'),'email',_0xac9a('0x70')],'raw':!![]});}return null;})[_0xac9a('0x1e')](function(_0x523aa0){if(!_0x523aa0)return null;_0x1259c5['message'][_0xac9a('0x5d')]=_0x523aa0;return _0x1259c5;})['then'](function(_0x4951c2){if(_0x4951c2){if(_0x50eb96['body'][_0xac9a('0x71')]){_0x1259c5[_0xac9a('0x26')][_0xac9a('0x72')]=util[_0xac9a('0x59')]('SIP/%s',_0x50eb96[_0xac9a('0x5c')]['name']);_0x1259c5[_0xac9a('0x26')][_0xac9a('0x73')]=_0x1259c5[_0xac9a('0x73')];_0x1259c5[_0xac9a('0x26')]['motionChannel']=_0x1259c5[_0xac9a('0x73')];_0x1259c5[_0xac9a('0x26')][_0xac9a('0x74')]=_0xac9a('0x75');return respondWithRpcPromise(_0xac9a('0x76'),_0xac9a('0x76'),{'event':'acceptmessage','message':_0x1259c5[_0xac9a('0x26')]},client9002)[_0xac9a('0x1e')](function(){return _0x1259c5;});}return _0x1259c5;}return null;})[_0xac9a('0x1e')](respondWithResult(_0x55fc82,null))[_0xac9a('0x29')](handleError(_0x55fc82,null));};var interaction_log=require(_0xac9a('0x12'))(_0xac9a('0x57'));exports['reject']=function(_0xe09fcb,_0x4631d4,_0x400845){var _0x537ce1={'agent':{},'channel':'openchannel'};if(_0xe09fcb[_0xac9a('0x55')]['id']){delete _0xe09fcb['body']['id'];}_0xe09fcb['body'][_0xac9a('0x5b')]=_0xe09fcb[_0xac9a('0x55')][_0xac9a('0x5b')]||_0xe09fcb[_0xac9a('0x5c')]['id'];_0x537ce1[_0xac9a('0x5d')]['id']=_0xe09fcb['body'][_0xac9a('0x5b')];return db['OpenchannelMessage'][_0xac9a('0x53')]({'where':{'id':_0xe09fcb[_0xac9a('0x52')]['id'],'UserId':null}})[_0xac9a('0x1e')](handleEntityNotFound(_0x4631d4,null))[_0xac9a('0x1e')](function(_0x3dce62){if(_0x3dce62){_0x537ce1[_0xac9a('0x26')]=_0x3dce62[_0xac9a('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0xac9a('0x53')]({'where':{'id':_0x3dce62['OpenchannelInteractionId']}});}return null;})[_0xac9a('0x1e')](handleEntityNotFound(_0x4631d4,null))[_0xac9a('0x1e')](function(_0x24391c){if(_0x24391c){_0x537ce1[_0xac9a('0x62')]=_0x24391c[_0xac9a('0x5e')]({'plain':!![]});interaction_log[_0xac9a('0x27')](_0xac9a('0x77'),_0xe09fcb[_0xac9a('0x5c')]['id'],_0xe09fcb[_0xac9a('0x5c')]['name'],_0xe09fcb[_0xac9a('0x5c')]['role'],_0x537ce1[_0xac9a('0x62')]['id'],_0xe09fcb['body']?JSON['stringify'](_0xe09fcb[_0xac9a('0x55')]):_0xac9a('0x65'));return respondWithRpcPromise('RejectMessage',_0xac9a('0x78'),_0x537ce1);}return null;})[_0xac9a('0x1e')](function(_0x350fa7){var _0x20decf=_0xac9a('0x68')+_0x350fa7[_0xac9a('0x26')][_0xac9a('0x69')];return db[_0xac9a('0x6a')][_0xac9a('0x3f')](_0x20decf,{'type':db[_0xac9a('0x6b')][_0xac9a('0x6c')][_0xac9a('0x79')],'raw':!![]})[_0xac9a('0x1e')](function(_0x49bae2){return _0x49bae2;});})[_0xac9a('0x1e')](function(_0x435d49){if(_0x435d49){_0x537ce1['message'][_0xac9a('0x6d')]=_0x435d49[0x0];if(!_0xe09fcb[_0xac9a('0x55')][_0xac9a('0x5b')])return;return db[_0xac9a('0x6e')][_0xac9a('0x53')]({'where':{'id':_0xe09fcb[_0xac9a('0x55')]['UserId'],'role':_0xac9a('0x5d')},'attributes':['id','name',_0xac9a('0x6f'),_0xac9a('0x7a'),_0xac9a('0x70')],'raw':!![]});}return null;})[_0xac9a('0x1e')](function(_0x1fa92d){if(!_0x1fa92d)return null;_0x537ce1[_0xac9a('0x26')]['agent']=_0x1fa92d;return _0x537ce1;})['then'](function(_0x292028){if(_0x292028){_0x292028[_0xac9a('0x26')][_0xac9a('0x72')]=util[_0xac9a('0x59')](_0xac9a('0x7b'),_0xe09fcb[_0xac9a('0x5c')]['name']);_0x292028['message'][_0xac9a('0x73')]=_0x537ce1[_0xac9a('0x73')];_0x292028[_0xac9a('0x26')][_0xac9a('0x7c')]=_0x537ce1[_0xac9a('0x73')];_0x292028['message'][_0xac9a('0x74')]=_0xac9a('0x35');respondWithRpcPromise('EventManager',_0xac9a('0x76'),{'event':_0xac9a('0x7d'),'message':_0x292028[_0xac9a('0x26')]},client9002);return _0x537ce1;}return null;})[_0xac9a('0x1e')](respondWithResult(_0x4631d4,null))['catch'](handleError(_0x4631d4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 8b627d7..3a2a6d8 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 _0x9653=['setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x22cc9b,_0x52b4c8){var _0x29b637=function(_0x59204f){while(--_0x59204f){_0x22cc9b['push'](_0x22cc9b['shift']());}};_0x29b637(++_0x52b4c8);}(_0x9653,0x75));var _0x3965=function(_0x3ba03b,_0xba0afa){_0x3ba03b=_0x3ba03b-0x0;var _0x3968a8=_0x9653[_0x3ba03b];return _0x3968a8;};'use strict';var EventEmitter=require(_0x3965('0x0'));var OpenchannelMessage=require(_0x3965('0x1'))['db'][_0x3965('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3965('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4acd56){return function(_0x21ca81,_0x2006d9,_0x28ab8b){OpenchannelMessageEvents[_0x3965('0x4')](_0x4acd56+':'+_0x21ca81['id'],_0x21ca81);OpenchannelMessageEvents[_0x3965('0x4')](_0x4acd56,_0x21ca81);_0x28ab8b(null);};}for(var e in events){if(events[_0x3965('0x5')](e)){var event=events[e];OpenchannelMessage[_0x3965('0x6')](e,emitEvent(event));}}module[_0x3965('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0d39=['exports','events','../../mysqldb','OpenchannelMessage','update','emit','hasOwnProperty'];(function(_0x1b9799,_0x23f56a){var _0x335fa1=function(_0x19786e){while(--_0x19786e){_0x1b9799['push'](_0x1b9799['shift']());}};_0x335fa1(++_0x23f56a);}(_0x0d39,0xef));var _0x90d3=function(_0x375b26,_0x3a243d){_0x375b26=_0x375b26-0x0;var _0x348359=_0x0d39[_0x375b26];return _0x348359;};'use strict';var EventEmitter=require(_0x90d3('0x0'));var OpenchannelMessage=require(_0x90d3('0x1'))['db'][_0x90d3('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x90d3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x12636e){return function(_0x14a80b,_0x333400,_0x204312){OpenchannelMessageEvents[_0x90d3('0x4')](_0x12636e+':'+_0x14a80b['id'],_0x14a80b);OpenchannelMessageEvents[_0x90d3('0x4')](_0x12636e,_0x14a80b);_0x204312(null);};}for(var e in events){if(events[_0x90d3('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x90d3('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 5d80554..082bc77 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 _0x6a15=['fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','then','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages'];(function(_0x57b484,_0x2272b4){var _0x823cf6=function(_0x4849be){while(--_0x4849be){_0x57b484['push'](_0x57b484['shift']());}};_0x823cf6(++_0x2272b4);}(_0x6a15,0xf7));var _0x56a1=function(_0x39f8da,_0x313ea0){_0x39f8da=_0x39f8da-0x0;var _0x2f3ea6=_0x6a15[_0x39f8da];return _0x2f3ea6;};'use strict';var _=require(_0x56a1('0x0'));var util=require(_0x56a1('0x1'));var logger=require(_0x56a1('0x2'))('api');var moment=require(_0x56a1('0x3'));var BPromise=require(_0x56a1('0x4'));var rp=require(_0x56a1('0x5'));var fs=require('fs');var path=require(_0x56a1('0x6'));var rimraf=require(_0x56a1('0x7'));var config=require(_0x56a1('0x8'));var attributes=require(_0x56a1('0x9'));module['exports']=function(_0x554e39,_0x3a4e83){return _0x554e39[_0x56a1('0xa')](_0x56a1('0xb'),attributes,{'tableName':_0x56a1('0xc'),'paranoid':![],'indexes':[{'name':_0x56a1('0xd'),'fields':[_0x56a1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x591339,_0x4f8794,_0x5f183b){var _0x476c42=_0x554e39[_0x56a1('0xf')];var _0x4acf8e=_0x591339[_0x56a1('0x10')]({'plain':!![]});if(_0x4acf8e[_0x56a1('0x11')][_0x56a1('0x12')]()==='in'||_0x4acf8e[_0x56a1('0x11')][_0x56a1('0x12')]()===_0x56a1('0x13')&&!_0x4acf8e[_0x56a1('0x14')]&&!_[_0x56a1('0x15')](_0x4acf8e[_0x56a1('0x16')])){_0x476c42[_0x56a1('0x17')]['findOne']({'where':{'id':_0x4acf8e[_0x56a1('0x18')]}})['then'](function(_0x14c0d6){if(_0x14c0d6){_0x14c0d6[_0x56a1('0x19')]({'lastMsgAt':_0x4acf8e[_0x56a1('0x1a')],'lastMsgDirection':_0x4acf8e['direction']['toLowerCase']()});}})[_0x56a1('0x1b')](function(_0x366c4f){console[_0x56a1('0x1c')](_0x366c4f);});}if(_0x4acf8e[_0x56a1('0x11')]===_0x56a1('0x13')&&!_0x4acf8e['secret']){var _0x83fa3f;_0x476c42[_0x56a1('0x1d')]['describe']()['then'](function(_0x3fa5db){return _0x476c42[_0x56a1('0x1e')]['find']({'where':{'id':_0x4acf8e[_0x56a1('0x1f')]},'include':[{'model':_0x476c42['OpenchannelInteraction'],'as':_0x56a1('0x20'),'where':{'id':_0x4acf8e[_0x56a1('0x18')]},'limit':0x1,'include':[{'model':_0x476c42[_0x56a1('0x1d')],'as':_0x56a1('0x21'),'attributes':_[_0x56a1('0x22')](_0x3fa5db)}]}]});})[_0x56a1('0x23')](function(_0x3f6fdf){_0x83fa3f=_0x3f6fdf[_0x56a1('0x10')]({'plain':!![]});if(_0x83fa3f&&_0x83fa3f[_0x56a1('0x24')]){logger['info'](_0x56a1('0x25'),_0x56a1('0x26'),util[_0x56a1('0x27')](_0x56a1('0x28'),_0x4acf8e['id'],_0x83fa3f[_0x56a1('0x24')]));if(_0x83fa3f[_0x56a1('0x20')]&&_0x83fa3f[_0x56a1('0x20')][_0x56a1('0x29')]){_0x4acf8e[_0x56a1('0x2a')]=_[_0x56a1('0x2b')](_0x83fa3f['Interactions'][0x0],_0x56a1('0x21'));_0x4acf8e[_0x56a1('0x21')]=_0x83fa3f[_0x56a1('0x20')][0x0]['Contact'];}var _0x4f8794={'method':_0x56a1('0x2c'),'uri':encodeURI(_0x83fa3f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4f8794[_0x56a1('0x2d')]){case _0x56a1('0x2e'):_0x4f8794['qs']=_0x4acf8e;break;case'POST':_0x4f8794['body']=_0x4acf8e;break;}return rp(_0x4f8794)['then'](function(_0x5899d2){logger['info'](_0x56a1('0x25'),_0x56a1('0x26'),util['format'](_0x56a1('0x2f'),_0x4acf8e['id'],_0x83fa3f['replyUri']));if(_0x5899d2[_0x56a1('0xe')]['threadId']&&_0x5899d2[_0x56a1('0xe')][_0x56a1('0x30')]!=_0x4acf8e['Interaction'][_0x56a1('0x30')]){return _0x476c42['OpenchannelInteraction'][_0x56a1('0x19')]({'threadId':_0x5899d2[_0x56a1('0xe')][_0x56a1('0x30')]},{'where':{'id':_0x4acf8e[_0x56a1('0x2a')]['id']}});}else{return;}})[_0x56a1('0x23')](function(){return _0x591339[_0x56a1('0x19')]({'read':!![]});})['catch'](function(_0x148332){logger[_0x56a1('0x1c')](_0x56a1('0x25'),_0x56a1('0x26'),util[_0x56a1('0x31')](_0x148332,{'showHidden':![],'depth':null}));_0x5f183b();});}else{_0x5f183b();}})['finally'](function(){_0x5f183b();});}else{_0x5f183b();}}},'charset':_0x56a1('0x32'),'collate':_0x56a1('0x33')});}; \ No newline at end of file +var _0x6de5=['omit','Contact','POST','GET','body','info','format','threadId','Interaction','catch','inspect','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','error','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri'];(function(_0x398a68,_0x48e6c5){var _0x821fd6=function(_0x2963b8){while(--_0x2963b8){_0x398a68['push'](_0x398a68['shift']());}};_0x821fd6(++_0x48e6c5);}(_0x6de5,0x13e));var _0x56de=function(_0x4b5b19,_0x57f2cd){_0x4b5b19=_0x4b5b19-0x0;var _0x4052ae=_0x6de5[_0x4b5b19];return _0x4052ae;};'use strict';var _=require(_0x56de('0x0'));var util=require(_0x56de('0x1'));var logger=require(_0x56de('0x2'))(_0x56de('0x3'));var moment=require(_0x56de('0x4'));var BPromise=require(_0x56de('0x5'));var rp=require(_0x56de('0x6'));var fs=require('fs');var path=require(_0x56de('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x56de('0x8'));module[_0x56de('0x9')]=function(_0x2ed1f9,_0x307d9e){return _0x2ed1f9[_0x56de('0xa')](_0x56de('0xb'),attributes,{'tableName':_0x56de('0xc'),'paranoid':![],'indexes':[{'name':_0x56de('0xd'),'fields':['body'],'type':_0x56de('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d8b1a,_0x503d1b,_0x24d793){var _0x10f7fa=_0x2ed1f9[_0x56de('0xf')];var _0x5b07=_0x4d8b1a[_0x56de('0x10')]({'plain':!![]});if(_0x5b07[_0x56de('0x11')][_0x56de('0x12')]()==='in'||_0x5b07[_0x56de('0x11')][_0x56de('0x12')]()===_0x56de('0x13')&&!_0x5b07[_0x56de('0x14')]&&!_[_0x56de('0x15')](_0x5b07[_0x56de('0x16')])){_0x10f7fa['OpenchannelInteraction'][_0x56de('0x17')]({'where':{'id':_0x5b07[_0x56de('0x18')]}})[_0x56de('0x19')](function(_0xc6c585){if(_0xc6c585){_0xc6c585[_0x56de('0x1a')]({'lastMsgAt':_0x5b07[_0x56de('0x1b')],'lastMsgDirection':_0x5b07[_0x56de('0x11')]['toLowerCase']()});}})['catch'](function(_0x1a9389){console[_0x56de('0x1c')](_0x1a9389);});}if(_0x5b07[_0x56de('0x11')]===_0x56de('0x13')&&!_0x5b07[_0x56de('0x14')]){var _0xf115c1;_0x10f7fa['CmContact'][_0x56de('0x1d')]()['then'](function(_0x4c3314){return _0x10f7fa[_0x56de('0x1e')]['find']({'where':{'id':_0x5b07[_0x56de('0x1f')]},'include':[{'model':_0x10f7fa[_0x56de('0x20')],'as':_0x56de('0x21'),'where':{'id':_0x5b07[_0x56de('0x18')]},'limit':0x1,'include':[{'model':_0x10f7fa[_0x56de('0x22')],'as':'Contact','attributes':_['keys'](_0x4c3314)}]}]});})[_0x56de('0x19')](function(_0x17b99e){_0xf115c1=_0x17b99e[_0x56de('0x10')]({'plain':!![]});if(_0xf115c1&&_0xf115c1['replyUri']){logger['info'](_0x56de('0x23'),_0x56de('0x24'),util['format'](_0x56de('0x25'),_0x5b07['id'],_0xf115c1[_0x56de('0x26')]));if(_0xf115c1[_0x56de('0x21')]&&_0xf115c1[_0x56de('0x21')]['length']){_0x5b07['Interaction']=_[_0x56de('0x27')](_0xf115c1[_0x56de('0x21')][0x0],_0x56de('0x28'));_0x5b07[_0x56de('0x28')]=_0xf115c1[_0x56de('0x21')][0x0]['Contact'];}var _0x503d1b={'method':_0x56de('0x29'),'uri':encodeURI(_0xf115c1[_0x56de('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x503d1b['method']){case _0x56de('0x2a'):_0x503d1b['qs']=_0x5b07;break;case _0x56de('0x29'):_0x503d1b[_0x56de('0x2b')]=_0x5b07;break;}return rp(_0x503d1b)['then'](function(_0x3f0fc4){logger[_0x56de('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x56de('0x24'),util[_0x56de('0x2d')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5b07['id'],_0xf115c1[_0x56de('0x26')]));if(_0x3f0fc4['body'][_0x56de('0x2e')]&&_0x3f0fc4[_0x56de('0x2b')][_0x56de('0x2e')]!=_0x5b07[_0x56de('0x2f')][_0x56de('0x2e')]){return _0x10f7fa[_0x56de('0x20')]['update']({'threadId':_0x3f0fc4[_0x56de('0x2b')][_0x56de('0x2e')]},{'where':{'id':_0x5b07['Interaction']['id']}});}else{return;}})['then'](function(){return _0x4d8b1a[_0x56de('0x1a')]({'read':!![]});})[_0x56de('0x30')](function(_0x4cb066){logger[_0x56de('0x1c')](_0x56de('0x23'),_0x56de('0x24'),util[_0x56de('0x31')](_0x4cb066,{'showHidden':![],'depth':null}));_0x24d793();});}else{_0x24d793();}})['finally'](function(){_0x24d793();});}else{_0x24d793();}}},'charset':_0x56de('0x32'),'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 d2d3635..b492ccf 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x81cf64,_0x93209f){var _0x486ffd=function(_0x35cb5b){while(--_0x35cb5b){_0x81cf64['push'](_0x81cf64['shift']());}};_0x486ffd(++_0x93209f);}(_0xadb5,0xad));var _0x5adb=function(_0x331347,_0x34f9df){_0x331347=_0x331347-0x0;var _0x2f6144=_0xadb5[_0x331347];return _0x2f6144;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3fdcf1,_0x382ec5){var _0x484219=function(_0x5d5bae){while(--_0x5d5bae){_0x3fdcf1['push'](_0x3fdcf1['shift']());}};_0x484219(++_0x382ec5);}(_0x7a54,0x106));var _0x47a5=function(_0x5ac3bf,_0x251950){_0x5ac3bf=_0x5ac3bf-0x0;var _0x23839f=_0x7a54[_0x5ac3bf];return _0x23839f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1cd224e..ed742ab 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 _0x6596=['update','emit','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0xdd8f1a,_0x2c3b5){var _0x143f80=function(_0x33ddfc){while(--_0x33ddfc){_0xdd8f1a['push'](_0xdd8f1a['shift']());}};_0x143f80(++_0x2c3b5);}(_0x6596,0x1d3));var _0x6659=function(_0x1bbac2,_0x3f471c){_0x1bbac2=_0x1bbac2-0x0;var _0x37130f=_0x6596[_0x1bbac2];return _0x37130f;};'use strict';var OpenchannelMessageEvents=require(_0x6659('0x0'));var events=[_0x6659('0x1'),'remove',_0x6659('0x2')];function createListener(_0x114579,_0x3b1b74){return function(_0x2c58e1){_0x3b1b74[_0x6659('0x3')](_0x114579,_0x2c58e1);};}function removeListener(_0x67ac1d,_0x4bfd3c){return function(){OpenchannelMessageEvents['removeListener'](_0x67ac1d,_0x4bfd3c);};}exports[_0x6659('0x4')]=function(_0x3091f1){for(var _0xd6bf59=0x0,_0x1ed458=events[_0x6659('0x5')];_0xd6bf59<_0x1ed458;_0xd6bf59++){var _0x4a900d=events[_0xd6bf59];var _0x485ea0=createListener(_0x6659('0x6')+_0x4a900d,_0x3091f1);OpenchannelMessageEvents['on'](_0x4a900d,_0x485ea0);}}; \ No newline at end of file +var _0xdadf=['emit','removeListener','register','length','./openchannelMessage.events','remove','update'];(function(_0x2221da,_0x27bf6d){var _0x29079f=function(_0x362d96){while(--_0x362d96){_0x2221da['push'](_0x2221da['shift']());}};_0x29079f(++_0x27bf6d);}(_0xdadf,0xc8));var _0xfdad=function(_0x14a900,_0xdb3fa9){_0x14a900=_0x14a900-0x0;var _0x3b2cbd=_0xdadf[_0x14a900];return _0x3b2cbd;};'use strict';var OpenchannelMessageEvents=require(_0xfdad('0x0'));var events=['save',_0xfdad('0x1'),_0xfdad('0x2')];function createListener(_0x5043e7,_0x35475f){return function(_0x3df338){_0x35475f[_0xfdad('0x3')](_0x5043e7,_0x3df338);};}function removeListener(_0x235726,_0xfaf253){return function(){OpenchannelMessageEvents[_0xfdad('0x4')](_0x235726,_0xfaf253);};}exports[_0xfdad('0x5')]=function(_0x4dfe82){for(var _0x172b2a=0x0,_0x3eca55=events[_0xfdad('0x6')];_0x172b2a<_0x3eca55;_0x172b2a++){var _0x27deab=events[_0x172b2a];var _0xbfaca2=createListener('openchannelMessage:'+_0x27deab,_0x4dfe82);OpenchannelMessageEvents['on'](_0x27deab,_0xbfaca2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index ae03fdc..026175a 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 _0x2edd=['get','/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','removeTeams','removeAgents','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller'];(function(_0x589d9a,_0x1ef2b3){var _0x3ac5ec=function(_0x53003a){while(--_0x53003a){_0x589d9a['push'](_0x589d9a['shift']());}};_0x3ac5ec(++_0x1ef2b3);}(_0x2edd,0x1ed));var _0xd2ed=function(_0x5bacc3,_0x2be147){_0x5bacc3=_0x5bacc3-0x0;var _0x37dad5=_0x2edd[_0x5bacc3];return _0x37dad5;};'use strict';var multer=require('multer');var util=require(_0xd2ed('0x0'));var path=require(_0xd2ed('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd2ed('0x2'));var auth=require(_0xd2ed('0x3'));var interaction=require(_0xd2ed('0x4'));var config=require(_0xd2ed('0x5'));var controller=require(_0xd2ed('0x6'));router[_0xd2ed('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd2ed('0x8'),auth[_0xd2ed('0x9')](),controller['describe']);router[_0xd2ed('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd2ed('0xa')]);router['get'](_0xd2ed('0xb'),auth['isAuthenticated'](),controller[_0xd2ed('0xc')]);router[_0xd2ed('0x7')](_0xd2ed('0xd'),auth['isAuthenticated'](),controller['getTeams']);router[_0xd2ed('0x7')](_0xd2ed('0xe'),auth[_0xd2ed('0x9')](),controller[_0xd2ed('0xf')]);router[_0xd2ed('0x10')]('/',auth['isAuthenticated'](),controller[_0xd2ed('0x11')]);router[_0xd2ed('0x10')](_0xd2ed('0xd'),auth[_0xd2ed('0x9')](),controller['addTeams']);router[_0xd2ed('0x10')](_0xd2ed('0xe'),auth[_0xd2ed('0x9')](),controller[_0xd2ed('0x12')]);router[_0xd2ed('0x13')](_0xd2ed('0x14'),auth[_0xd2ed('0x9')](),controller[_0xd2ed('0x15')]);router[_0xd2ed('0x16')]('/:id',auth[_0xd2ed('0x9')](),controller['destroy']);router[_0xd2ed('0x16')](_0xd2ed('0xd'),auth[_0xd2ed('0x9')](),controller[_0xd2ed('0x17')]);router['delete'](_0xd2ed('0xe'),auth[_0xd2ed('0x9')](),controller[_0xd2ed('0x18')]);module['exports']=router; \ No newline at end of file +var _0xeed8=['getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','getMembers'];(function(_0x4071d4,_0x5372ed){var _0x447c43=function(_0x1d5e55){while(--_0x1d5e55){_0x4071d4['push'](_0x4071d4['shift']());}};_0x447c43(++_0x5372ed);}(_0xeed8,0x16a));var _0x8eed=function(_0x5ea4b9,_0x1a62b6){_0x5ea4b9=_0x5ea4b9-0x0;var _0x3d375f=_0xeed8[_0x5ea4b9];return _0x3d375f;};'use strict';var multer=require(_0x8eed('0x0'));var util=require(_0x8eed('0x1'));var path=require(_0x8eed('0x2'));var timeout=require(_0x8eed('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8eed('0x4'));var interaction=require(_0x8eed('0x5'));var config=require(_0x8eed('0x6'));var controller=require(_0x8eed('0x7'));router[_0x8eed('0x8')]('/',auth[_0x8eed('0x9')](),controller[_0x8eed('0xa')]);router['get']('/describe',auth[_0x8eed('0x9')](),controller[_0x8eed('0xb')]);router[_0x8eed('0x8')]('/:id',auth[_0x8eed('0x9')](),controller[_0x8eed('0xc')]);router[_0x8eed('0x8')](_0x8eed('0xd'),auth[_0x8eed('0x9')](),controller[_0x8eed('0xe')]);router['get']('/:id/teams',auth[_0x8eed('0x9')](),controller[_0x8eed('0xf')]);router[_0x8eed('0x8')](_0x8eed('0x10'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x11')]);router[_0x8eed('0x12')]('/',auth[_0x8eed('0x9')](),controller['create']);router['post'](_0x8eed('0x13'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x14')]);router[_0x8eed('0x12')](_0x8eed('0x10'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x15')]);router[_0x8eed('0x16')](_0x8eed('0x17'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x18')]);router[_0x8eed('0x19')](_0x8eed('0x17'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x1a')]);router['delete'](_0x8eed('0x13'),auth[_0x8eed('0x9')](),controller[_0x8eed('0x1b')]);router[_0x8eed('0x19')](_0x8eed('0x10'),auth[_0x8eed('0x9')](),controller['removeAgents']);module[_0x8eed('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 65fe375..db07989 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 _0x6eef=['name','INTEGER','ENUM','rrmemory','beepall','STRING'];(function(_0x544099,_0x102022){var _0x1e5253=function(_0x3eb26d){while(--_0x3eb26d){_0x544099['push'](_0x544099['shift']());}};_0x1e5253(++_0x102022);}(_0x6eef,0xd7));var _0xf6ee=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0x6eef[_0x541a67];return _0x45da2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf6ee('0x0')],'unique':_0xf6ee('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf6ee('0x0')]},'timeout':{'type':Sequelize[_0xf6ee('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf6ee('0x3')](_0xf6ee('0x4'),_0xf6ee('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x550a=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x550a,0x1af));var _0xa550=function(_0x2aded5,_0x2bb595){_0x2aded5=_0x2aded5-0x0;var _0x463e98=_0x550a[_0x2aded5];return _0x463e98;};'use strict';var Sequelize=require(_0xa550('0x0'));module[_0xa550('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa550('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa550('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa550('0x4'),_0xa550('0x5'),_0xa550('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4fbd91c..1efd4bf 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 _0xb305=['OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','util','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','getOptions','where','include','query','OpenchannelQueue','findAll','rows','catch','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','nolimit','order','sort','pick','OpenchannelQueueId','filter','map','findAndCountAll','UserId','agent','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','hasOwnProperty','ids','Team','User','Agents','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x14ad4c,_0x16f038){var _0x5c44c9=function(_0x5d47f4){while(--_0x5d47f4){_0x14ad4c['push'](_0x14ad4c['shift']());}};_0x5c44c9(++_0x16f038);}(_0xb305,0x10e));var _0x5b30=function(_0x4fbc85,_0x141410){_0x4fbc85=_0x4fbc85-0x0;var _0x462d7d=_0xb305[_0x4fbc85];return _0x462d7d;};'use strict';var BPromise=require(_0x5b30('0x0'));var util=require(_0x5b30('0x1'));var _=require(_0x5b30('0x2'));var squel=require('squel');var Redis=require(_0x5b30('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5b30('0x4'));var config=require(_0x5b30('0x5'));var db=require(_0x5b30('0x6'))['db'];config[_0x5b30('0x7')]=_[_0x5b30('0x8')](config['redis'],{'host':_0x5b30('0x9'),'port':0x18eb});var socket=require(_0x5b30('0xa'))(new Redis(config[_0x5b30('0x7')]));require(_0x5b30('0xb'))[_0x5b30('0xc')](socket);function respondWithStatusCode(_0x1ee5c4,_0x4c2350){_0x4c2350=_0x4c2350||0xcc;return function(_0x302c59){if(_0x302c59){return _0x1ee5c4[_0x5b30('0xd')](_0x4c2350);}return _0x1ee5c4['status'](_0x4c2350)[_0x5b30('0xe')]();};}function respondWithResult(_0x11bb5a,_0x25b23a){_0x25b23a=_0x25b23a||0xc8;return function(_0x3a67c2){if(_0x3a67c2){return _0x11bb5a[_0x5b30('0xf')](_0x25b23a)['json'](_0x3a67c2);}};}function respondWithFilteredResult(_0x2be7b2,_0x538c5c){return function(_0x25fd9e){if(_0x25fd9e){var _0x39be4a=typeof _0x538c5c[_0x5b30('0x10')]==='undefined'&&typeof _0x538c5c['limit']===_0x5b30('0x11');var _0x5a534d=_0x25fd9e[_0x5b30('0x12')];var _0xfa6e3e=_0x39be4a?0x0:_0x538c5c[_0x5b30('0x10')];var _0x13d631=_0x39be4a?_0x25fd9e[_0x5b30('0x12')]:_0x538c5c[_0x5b30('0x10')]+_0x538c5c[_0x5b30('0x13')];var _0x25527c;if(_0x13d631>=_0x5a534d){_0x13d631=_0x5a534d;_0x25527c=0xc8;}else{_0x25527c=0xce;}_0x2be7b2['status'](_0x25527c);return _0x2be7b2[_0x5b30('0x14')]('Content-Range',_0xfa6e3e+'-'+_0x13d631+'/'+_0x5a534d)['json'](_0x25fd9e);}return null;};}function saveUpdates(_0x3062c0){return function(_0x335c0e){if(_0x335c0e){return _0x335c0e[_0x5b30('0x15')](_0x3062c0)['then'](function(_0x372d4d){return _0x372d4d;});}return null;};}function removeEntity(_0x3466a2){return function(_0x561d25){if(_0x561d25){return _0x561d25[_0x5b30('0x16')]()[_0x5b30('0x17')](function(){var _0xca1e9b=_0x561d25[_0x5b30('0x18')]({'plain':!![]});var _0x588a63=_0x5b30('0x19');return db[_0x5b30('0x1a')][_0x5b30('0x16')]({'where':{'type':_0x588a63,'resourceId':_0xca1e9b['id']}})[_0x5b30('0x17')](function(){return _0x561d25;});})['then'](function(){_0x3466a2[_0x5b30('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4de5bb){return function(_0x3ba55a){if(!_0x3ba55a){_0x4de5bb['sendStatus'](0x194);}return _0x3ba55a;};}function handleError(_0x9261c0,_0x45ec14){_0x45ec14=_0x45ec14||0x1f4;return function(_0x24e12f){logger[_0x5b30('0x1b')](_0x24e12f[_0x5b30('0x1c')]);if(_0x24e12f[_0x5b30('0x1d')]){delete _0x24e12f[_0x5b30('0x1d')];}_0x9261c0[_0x5b30('0xf')](_0x45ec14)[_0x5b30('0x1e')](_0x24e12f);};}exports[_0x5b30('0x1f')]=function(_0x14569b,_0x5d02d7){var _0x19f5ce={};var _0x5bb3b5={'count':0x0,'rows':[]};var _0x5790ae=_['map'](db['OpenchannelQueue'][_0x5b30('0x20')],function(_0x1dbe5e){return{'name':_0x1dbe5e[_0x5b30('0x21')],'type':_0x1dbe5e[_0x5b30('0x22')][_0x5b30('0x23')]};});_0x19f5ce=qs[_0x5b30('0x24')](_0x5790ae,_0x14569b);var _0x59c8e1={'where':_0x19f5ce[_0x5b30('0x25')]};return db['OpenchannelQueue']['count'](_0x59c8e1)[_0x5b30('0x17')](function(_0x288000){_0x5bb3b5[_0x5b30('0x12')]=_0x288000;_0x19f5ce[_0x5b30('0x26')]=qs[_0x5b30('0x26')](_0x14569b[_0x5b30('0x27')]);return db[_0x5b30('0x28')][_0x5b30('0x29')](_0x19f5ce);})[_0x5b30('0x17')](function(_0x2e1104){_0x5bb3b5[_0x5b30('0x2a')]=_0x2e1104;return _0x5bb3b5;})[_0x5b30('0x17')](respondWithFilteredResult(_0x5d02d7,_0x19f5ce))[_0x5b30('0x2b')](handleError(_0x5d02d7,null));};exports['show']=function(_0x228cf9,_0x2c6d8e){var _0x11819e={'raw':!![],'where':{'id':_0x228cf9[_0x5b30('0x2c')]['id']}},_0x2dd4a8={};_0x2dd4a8[_0x5b30('0x2d')]=_[_0x5b30('0x2e')](db[_0x5b30('0x28')][_0x5b30('0x20')]);_0x2dd4a8[_0x5b30('0x27')]=_[_0x5b30('0x2e')](_0x228cf9[_0x5b30('0x27')]);_0x2dd4a8[_0x5b30('0x2f')]=_['intersection'](_0x2dd4a8[_0x5b30('0x2d')],_0x2dd4a8[_0x5b30('0x27')]);_0x11819e['attributes']=_[_0x5b30('0x30')](_0x2dd4a8['model'],qs[_0x5b30('0x31')](_0x228cf9[_0x5b30('0x27')][_0x5b30('0x31')]));_0x11819e['attributes']=_0x11819e[_0x5b30('0x32')][_0x5b30('0x33')]?_0x11819e['attributes']:_0x2dd4a8['model'];if(_0x228cf9[_0x5b30('0x27')][_0x5b30('0x34')]){_0x11819e['include']=[{'all':!![]}];}_0x11819e=_[_0x5b30('0x35')]({},_0x11819e,_0x228cf9[_0x5b30('0x36')]);return db['OpenchannelQueue'][_0x5b30('0x37')](_0x11819e)['then'](handleEntityNotFound(_0x2c6d8e,null))[_0x5b30('0x17')](respondWithResult(_0x2c6d8e,null))['catch'](handleError(_0x2c6d8e,null));};exports[_0x5b30('0x38')]=function(_0x222902,_0xa76bea){return db[_0x5b30('0x28')][_0x5b30('0x38')](_0x222902[_0x5b30('0x39')],{})[_0x5b30('0x17')](function(_0x10f39e){var _0x340ee6=_0x222902[_0x5b30('0x3a')][_0x5b30('0x18')]({'plain':!![]});if(!_0x340ee6)throw new Error(_0x5b30('0x3b'));if(_0x340ee6['role']===_0x5b30('0x3a')){var _0x26c144=_0x10f39e[_0x5b30('0x18')]({'plain':!![]});var _0x16662e=_0x5b30('0x19');return db[_0x5b30('0x3c')][_0x5b30('0x37')]({'where':{'name':_0x16662e,'userProfileId':_0x340ee6[_0x5b30('0x3d')]},'raw':!![]})['then'](function(_0x8060ca){if(_0x8060ca&&_0x8060ca[_0x5b30('0x3e')]===0x0){return db[_0x5b30('0x1a')][_0x5b30('0x38')]({'name':_0x26c144['name'],'resourceId':_0x26c144['id'],'type':_0x8060ca[_0x5b30('0x1d')],'sectionId':_0x8060ca['id']},{})[_0x5b30('0x17')](function(){return _0x10f39e;});}else{return _0x10f39e;}})[_0x5b30('0x2b')](function(_0x375b79){logger[_0x5b30('0x1b')](_0x5b30('0x3f'),_0x375b79);throw _0x375b79;});}return _0x10f39e;})[_0x5b30('0x17')](respondWithResult(_0xa76bea,0xc9))[_0x5b30('0x2b')](handleError(_0xa76bea,null));};exports[_0x5b30('0x15')]=function(_0x5c5816,_0x4487d3){if(_0x5c5816[_0x5b30('0x39')]['id']){delete _0x5c5816[_0x5b30('0x39')]['id'];}return db['OpenchannelQueue'][_0x5b30('0x37')]({'where':{'id':_0x5c5816[_0x5b30('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4487d3,null))[_0x5b30('0x17')](saveUpdates(_0x5c5816['body'],null))['then'](respondWithResult(_0x4487d3,null))[_0x5b30('0x2b')](handleError(_0x4487d3,null));};exports['destroy']=function(_0x3e231a,_0x269524){return db[_0x5b30('0x28')][_0x5b30('0x37')]({'where':{'id':_0x3e231a[_0x5b30('0x2c')]['id']}})['then'](handleEntityNotFound(_0x269524,null))[_0x5b30('0x17')](removeEntity(_0x269524,null))[_0x5b30('0x2b')](handleError(_0x269524,null));};exports[_0x5b30('0x40')]=function(_0x5741c0,_0x2ad94b){return db[_0x5b30('0x28')]['describe']()[_0x5b30('0x17')](respondWithResult(_0x2ad94b,null))[_0x5b30('0x2b')](handleError(_0x2ad94b,null));};exports['getMembers']=function(_0x5451b9,_0x6f1d0d){var _0x21cfa6={'raw':!![],'where':{}},_0x39722d={},_0x2b2aad;return db['OpenchannelQueue'][_0x5b30('0x41')]({'where':{'id':_0x5451b9['params']['id']}})[_0x5b30('0x17')](handleEntityNotFound(_0x6f1d0d,null))[_0x5b30('0x17')](function(_0x19d7b6){if(_0x19d7b6){_0x2b2aad=_0x19d7b6['get']({'plain':!![]});_0x39722d[_0x5b30('0x2d')]=_[_0x5b30('0x2e')](db[_0x5b30('0x42')][_0x5b30('0x20')]);_0x39722d['query']=_[_0x5b30('0x2e')](_0x5451b9[_0x5b30('0x27')]);_0x39722d[_0x5b30('0x2f')]=_[_0x5b30('0x30')](_0x39722d[_0x5b30('0x2d')],_0x39722d[_0x5b30('0x27')]);_0x21cfa6[_0x5b30('0x32')]=_[_0x5b30('0x30')](_0x39722d[_0x5b30('0x2d')],qs['fields'](_0x5451b9['query'][_0x5b30('0x31')]));_0x21cfa6[_0x5b30('0x32')]=_0x21cfa6[_0x5b30('0x32')]['length']?_0x21cfa6['attributes']:_0x39722d[_0x5b30('0x2d')];if(!_0x5451b9[_0x5b30('0x27')]['hasOwnProperty'](_0x5b30('0x43'))){_0x21cfa6[_0x5b30('0x13')]=qs[_0x5b30('0x13')](_0x5451b9[_0x5b30('0x27')][_0x5b30('0x13')]);_0x21cfa6[_0x5b30('0x10')]=qs['offset'](_0x5451b9[_0x5b30('0x27')][_0x5b30('0x10')]);}_0x21cfa6[_0x5b30('0x44')]=qs[_0x5b30('0x45')](_0x5451b9[_0x5b30('0x27')]['sort']);_0x21cfa6[_0x5b30('0x25')]=qs[_0x5b30('0x2f')](_[_0x5b30('0x46')](_0x5451b9[_0x5b30('0x27')],_0x39722d[_0x5b30('0x2f')]));_0x21cfa6[_0x5b30('0x25')][_0x5b30('0x47')]=_0x19d7b6['id'];if(_0x5451b9[_0x5b30('0x27')][_0x5b30('0x48')]){_0x21cfa6['where']=_[_0x5b30('0x35')](_0x21cfa6[_0x5b30('0x25')],{'$or':_[_0x5b30('0x49')](_0x21cfa6[_0x5b30('0x32')],function(_0xceb078){var _0x50ebf6={};_0x50ebf6[_0xceb078]={'$like':'%'+_0x5451b9['query'][_0x5b30('0x48')]+'%'};return _0x50ebf6;})});}_0x21cfa6=_[_0x5b30('0x35')]({},_0x21cfa6,_0x5451b9[_0x5b30('0x36')]);return db[_0x5b30('0x42')][_0x5b30('0x29')](_0x21cfa6);}})[_0x5b30('0x17')](function(_0x3b3bda){if(_0x3b3bda){return db['User'][_0x5b30('0x4a')]({'where':{'id':_[_0x5b30('0x49')](_0x3b3bda,_0x5b30('0x4b')),'role':_0x5b30('0x4c')},'attributes':['id',_0x5b30('0x1d'),_0x5b30('0x4d'),'updatedAt',_0x5b30('0x4e')]});}})[_0x5b30('0x17')](function(_0x14e71b){if(_0x14e71b){return{'count':_0x14e71b[_0x5b30('0x12')],'rows':_[_0x5b30('0x49')](_0x14e71b[_0x5b30('0x2a')],function(_0x2c7fe8){return{'membername':_0x2c7fe8[_0x5b30('0x1d')],'UserId':_0x2c7fe8['id'],'queue_name':_0x2b2aad[_0x5b30('0x1d')],'OpenchannelQueueId':_0x2b2aad['id'],'interface':util['format'](_0x5b30('0x4f'),_0x5b30('0x50'),_0x2c7fe8['name']),'penalty':0x0,'paused':_0x2c7fe8[_0x5b30('0x4d')],'createdAt':_0x2c7fe8[_0x5b30('0x4e')],'updatedAt':_0x2c7fe8[_0x5b30('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x6f1d0d,_0x21cfa6))['catch'](handleError(_0x6f1d0d,null));};exports[_0x5b30('0x52')]=function(_0x240727,_0x34d347){var _0x21a3f2={};var _0x14df12={};var _0x5e1b01;var _0x4e6f0b;return db[_0x5b30('0x28')][_0x5b30('0x41')]({'where':{'id':_0x240727['params']['id']}})['then'](handleEntityNotFound(_0x34d347,null))[_0x5b30('0x17')](function(_0x3fc02a){if(_0x3fc02a){_0x5e1b01=_0x3fc02a;_0x14df12[_0x5b30('0x2d')]=_[_0x5b30('0x2e')](db['Team'][_0x5b30('0x20')]);_0x14df12[_0x5b30('0x27')]=_[_0x5b30('0x2e')](_0x240727['query']);_0x14df12[_0x5b30('0x2f')]=_[_0x5b30('0x30')](_0x14df12[_0x5b30('0x2d')],_0x14df12['query']);_0x21a3f2[_0x5b30('0x32')]=_[_0x5b30('0x30')](_0x14df12[_0x5b30('0x2d')],qs['fields'](_0x240727[_0x5b30('0x27')][_0x5b30('0x31')]));_0x21a3f2['attributes']=_0x21a3f2[_0x5b30('0x32')][_0x5b30('0x33')]?_0x21a3f2[_0x5b30('0x32')]:_0x14df12[_0x5b30('0x2d')];_0x21a3f2['order']=qs[_0x5b30('0x45')](_0x240727[_0x5b30('0x27')][_0x5b30('0x45')]);_0x21a3f2[_0x5b30('0x25')]=qs[_0x5b30('0x2f')](_[_0x5b30('0x46')](_0x240727[_0x5b30('0x27')],_0x14df12['filters']));if(_0x240727[_0x5b30('0x27')][_0x5b30('0x48')]){_0x21a3f2['where']=_[_0x5b30('0x35')](_0x21a3f2[_0x5b30('0x25')],{'$or':_[_0x5b30('0x49')](_0x21a3f2['attributes'],function(_0x28abd2){var _0x478ce2={};_0x478ce2[_0x28abd2]={'$like':'%'+_0x240727[_0x5b30('0x27')][_0x5b30('0x48')]+'%'};return _0x478ce2;})});}_0x21a3f2=_[_0x5b30('0x35')]({},_0x21a3f2,_0x240727[_0x5b30('0x36')]);return _0x5e1b01[_0x5b30('0x52')](_0x21a3f2);}})[_0x5b30('0x17')](function(_0x413245){if(_0x413245){_0x4e6f0b=_0x413245[_0x5b30('0x33')];if(!_0x240727['query'][_0x5b30('0x53')](_0x5b30('0x43'))){_0x21a3f2[_0x5b30('0x13')]=qs[_0x5b30('0x13')](_0x240727['query'][_0x5b30('0x13')]);_0x21a3f2[_0x5b30('0x10')]=qs['offset'](_0x240727['query']['offset']);}return _0x5e1b01[_0x5b30('0x52')](_0x21a3f2);}})['then'](function(_0x566d5c){if(_0x566d5c){return _0x566d5c?{'count':_0x4e6f0b,'rows':_0x566d5c}:null;}})[_0x5b30('0x17')](respondWithResult(_0x34d347,null))['catch'](handleError(_0x34d347,null));};exports['addTeams']=function(_0x453c12,_0x360ecf){var _0x387289=_0x453c12['body'][_0x5b30('0x54')];return db[_0x5b30('0x55')][_0x5b30('0x29')]({'where':{'id':_0x387289},'attributes':['id'],'include':[{'model':db[_0x5b30('0x56')],'as':_0x5b30('0x57'),'attributes':['id',_0x5b30('0x1d'),'online',_0x5b30('0x58'),'interface'],'raw':!![]}]})[_0x5b30('0x17')](function(_0x3ad728){if(_0x3ad728){var _0x5a8a3a=_[_0x5b30('0x59')](_0x3ad728,function(_0x5b1bc9){var _0x509c69=_0x5b1bc9['get']({'plain':!![]});return _0x509c69[_0x5b30('0x57')];});return db[_0x5b30('0x28')][_0x5b30('0x37')]({'where':{'id':_0x453c12['params']['id']}})[_0x5b30('0x17')](function(_0x46987d){return db[_0x5b30('0x5a')]['transaction'](function(_0xe76485){return _0x46987d[_0x5b30('0x5b')](_0x387289,{'transaction':_0xe76485})[_0x5b30('0x17')](function(){return BPromise[_0x5b30('0x5c')](_0x5a8a3a,function(_0x41224e){return db[_0x5b30('0x42')][_0x5b30('0x5d')]({'where':{'UserId':_0x41224e['id'],'OpenchannelQueueId':_0x453c12[_0x5b30('0x2c')]['id']},'transaction':_0xe76485});});})['then'](function(){_0x5a8a3a[_0x5b30('0x5e')](function(_0xe588e6){socket[_0x5b30('0x5f')](_0x5b30('0x60'),{'UserId':_0xe588e6['id'],'OpenchannelQueueId':_0x46987d['id']});});});});});}})[_0x5b30('0x17')](respondWithStatusCode(_0x360ecf,null))[_0x5b30('0x2b')](handleError(_0x360ecf,null));};exports['removeTeams']=function(_0x13f4c2,_0x382702){return db[_0x5b30('0x55')][_0x5b30('0x29')]({'where':{'id':_0x13f4c2[_0x5b30('0x27')][_0x5b30('0x54')]},'attributes':['id'],'include':[{'model':db[_0x5b30('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5b30('0x17')](handleEntityNotFound(_0x382702,null))[_0x5b30('0x17')](function(_0x20b14d){var _0x2e0a92=_['map'](_0x20b14d,'id');var _0x18da9f=[];var _0x136d23=[];var _0x52c040=squel[_0x5b30('0x61')]();_0x52c040[_0x5b30('0x62')](_0x5b30('0x63'))[_0x5b30('0x64')](_0x5b30('0x65'),'tq')[_0x5b30('0x66')](_0x5b30('0x67'),'ut',_0x5b30('0x68'))[_0x5b30('0x25')](_0x5b30('0x69'),_0x13f4c2[_0x5b30('0x2c')]['id']);for(var _0x37b4bc=0x0;_0x37b4bc<_0x20b14d[_0x5b30('0x33')];_0x37b4bc+=0x1){let _0x3e3b9b=_0x20b14d[_0x37b4bc];for(var _0xc465ec=0x0;_0xc465ec<_0x3e3b9b[_0x5b30('0x57')][_0x5b30('0x33')];_0xc465ec+=0x1){let _0x40f23f=_0x3e3b9b['Agents'][_0xc465ec];var _0x2ca030=_0x52c040['clone']();_0x2ca030['where'](_0x5b30('0x6a'),_0x40f23f['id']);_0x136d23[_0x5b30('0x6b')](db[_0x5b30('0x5a')][_0x5b30('0x27')](_0x2ca030['toString'](),{'type':db[_0x5b30('0x5a')][_0x5b30('0x6c')][_0x5b30('0x6d')]})[_0x5b30('0x17')](function(_0xf54784){if(_0xf54784[_0x5b30('0x33')]===0x1){return _0x40f23f['id'];}else{var _0x14adfe=_[_0x5b30('0x6e')](_[_0x5b30('0x49')](_0xf54784,'TeamId'),function(_0x9abafb){return _[_0x5b30('0x6f')](_0x2e0a92,_0x9abafb);});if(_0x14adfe){return _0x40f23f['id'];}}}));}}return BPromise[_0x5b30('0x70')](_0x136d23)['then'](function(_0x4df7be){_0x18da9f=_(_0x18da9f)[_0x5b30('0x71')](_0x4df7be)[_0x5b30('0x72')]()[_0x5b30('0x73')]();return db[_0x5b30('0x28')][_0x5b30('0x37')]({'where':{'id':_0x13f4c2[_0x5b30('0x2c')]['id']}})[_0x5b30('0x17')](function(_0x30ef45){return db[_0x5b30('0x5a')][_0x5b30('0x74')](function(_0x454b29){return _0x30ef45[_0x5b30('0x75')](_0x13f4c2['query'][_0x5b30('0x54')],{'transaction':_0x454b29})[_0x5b30('0x17')](function(){if(!_[_0x5b30('0x76')](_0x18da9f)){return _0x30ef45['removeAgents'](_0x18da9f,{'transaction':_0x454b29});}})[_0x5b30('0x17')](function(){_0x18da9f[_0x5b30('0x5e')](function(_0x204bee){socket['emit'](_0x5b30('0x77'),{'UserId':_0x204bee,'OpenchannelQueueId':_0x30ef45['id']});});});});});});})[_0x5b30('0x17')](respondWithStatusCode(_0x382702,null))[_0x5b30('0x2b')](handleError(_0x382702,null));};exports[_0x5b30('0x78')]=function(_0x431cf3,_0x258966){return db[_0x5b30('0x28')][_0x5b30('0x37')]({'where':{'id':_0x431cf3[_0x5b30('0x2c')]['id']}})[_0x5b30('0x17')](handleEntityNotFound(_0x258966,null))['then'](function(_0x235b7e){if(_0x235b7e){return _0x235b7e[_0x5b30('0x78')](_0x431cf3[_0x5b30('0x39')][_0x5b30('0x54')],_[_0x5b30('0x79')](_0x431cf3[_0x5b30('0x39')],[_0x5b30('0x54'),'id'])||{})[_0x5b30('0x7a')](function(_0x4fdab3){for(var _0x3a364e=0x0;_0x3a364e<_0x431cf3[_0x5b30('0x39')]['ids'][_0x5b30('0x33')];_0x3a364e+=0x1){socket['emit'](_0x5b30('0x60'),{'UserId':Number(_0x431cf3[_0x5b30('0x39')][_0x5b30('0x54')][_0x3a364e]),'OpenchannelQueueId':Number(_0x431cf3[_0x5b30('0x2c')]['id'])});}return _0x4fdab3;});}})['then'](respondWithResult(_0x258966,null))[_0x5b30('0x2b')](handleError(_0x258966,null));};exports[_0x5b30('0x7b')]=function(_0x56a3df,_0x5e93b8){return db[_0x5b30('0x28')][_0x5b30('0x37')]({'where':{'id':_0x56a3df['params']['id']}})['then'](handleEntityNotFound(_0x5e93b8,null))['then'](function(_0x4d715c){if(_0x4d715c){return _0x4d715c['removeAgents'](_0x56a3df[_0x5b30('0x27')][_0x5b30('0x54')])['then'](function(){if(_['isArray'](_0x56a3df[_0x5b30('0x27')][_0x5b30('0x54')])){for(var _0x2434d9=0x0;_0x2434d9<_0x56a3df[_0x5b30('0x27')][_0x5b30('0x54')]['length'];_0x2434d9+=0x1){socket['emit'](_0x5b30('0x77'),{'UserId':Number(_0x56a3df['query'][_0x5b30('0x54')][_0x2434d9]),'OpenchannelQueueId':Number(_0x56a3df[_0x5b30('0x2c')]['id'])});}}else{socket['emit'](_0x5b30('0x77'),{'UserId':Number(_0x56a3df[_0x5b30('0x27')][_0x5b30('0x54')]),'OpenchannelQueueId':Number(_0x56a3df[_0x5b30('0x2c')]['id'])});}});}})[_0x5b30('0x17')](respondWithStatusCode(_0x5e93b8,null))[_0x5b30('0x2b')](handleError(_0x5e93b8,null));};exports[_0x5b30('0x7c')]=function(_0x5ae71e,_0x271711){var _0x2331b3={};var _0x3e6d20={};var _0x404375;var _0x12abe4;return db[_0x5b30('0x28')]['findOne']({'where':{'id':_0x5ae71e[_0x5b30('0x2c')]['id']}})[_0x5b30('0x17')](handleEntityNotFound(_0x271711,null))[_0x5b30('0x17')](function(_0x460898){if(_0x460898){_0x404375=_0x460898;_0x3e6d20[_0x5b30('0x2d')]=_[_0x5b30('0x2e')](db[_0x5b30('0x56')]['rawAttributes']);_0x3e6d20[_0x5b30('0x27')]=_[_0x5b30('0x2e')](_0x5ae71e[_0x5b30('0x27')]);_0x3e6d20[_0x5b30('0x2f')]=_['intersection'](_0x3e6d20[_0x5b30('0x2d')],_0x3e6d20['query']);_0x2331b3['attributes']=_[_0x5b30('0x30')](_0x3e6d20['model'],qs['fields'](_0x5ae71e[_0x5b30('0x27')][_0x5b30('0x31')]));_0x2331b3['attributes']=_0x2331b3[_0x5b30('0x32')][_0x5b30('0x33')]?_0x2331b3[_0x5b30('0x32')]:_0x3e6d20[_0x5b30('0x2d')];_0x2331b3[_0x5b30('0x44')]=qs[_0x5b30('0x45')](_0x5ae71e[_0x5b30('0x27')][_0x5b30('0x45')]);_0x2331b3[_0x5b30('0x25')]=qs[_0x5b30('0x2f')](_['pick'](_0x5ae71e['query'],_0x3e6d20[_0x5b30('0x2f')]));if(_0x5ae71e['query'][_0x5b30('0x48')]){_0x2331b3['where']=_[_0x5b30('0x35')](_0x2331b3[_0x5b30('0x25')],{'$or':_[_0x5b30('0x49')](_0x2331b3['attributes'],function(_0xaf9469){var _0x1aaf29={};_0x1aaf29[_0xaf9469]={'$like':'%'+_0x5ae71e[_0x5b30('0x27')][_0x5b30('0x48')]+'%'};return _0x1aaf29;})});}_0x2331b3=_[_0x5b30('0x35')]({},_0x2331b3,_0x5ae71e[_0x5b30('0x36')]);return _0x404375[_0x5b30('0x7c')](_0x2331b3);}})[_0x5b30('0x17')](function(_0x34f245){if(_0x34f245){_0x12abe4=_0x34f245['length'];if(!_0x5ae71e[_0x5b30('0x27')][_0x5b30('0x53')](_0x5b30('0x43'))){_0x2331b3[_0x5b30('0x13')]=qs[_0x5b30('0x13')](_0x5ae71e[_0x5b30('0x27')][_0x5b30('0x13')]);_0x2331b3[_0x5b30('0x10')]=qs[_0x5b30('0x10')](_0x5ae71e[_0x5b30('0x27')]['offset']);}return _0x404375[_0x5b30('0x7c')](_0x2331b3);}})['then'](function(_0x797bb1){if(_0x797bb1){return _0x797bb1?{'count':_0x12abe4,'rows':_0x797bb1}:null;}})[_0x5b30('0x17')](respondWithResult(_0x271711,null))[_0x5b30('0x2b')](handleError(_0x271711,null));}; \ No newline at end of file +var _0xf178=['fields','attributes','length','include','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','UserProfileResource','describe','findOne','keys','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','where','filters','OpenchannelQueueId','filter','findAndCountAll','agent','openchannelPause','format','%s/%s','createdAt','updatedAt','getTeams','Team','order','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userOpenchannelQueue:remove','omit','userOpenchannelQueue:save','isArray','getAgents','pick','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','OpenchannelQueues','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','query','findAll','rows','catch','params','model','intersection'];(function(_0x49a694,_0x281f2d){var _0x13db1e=function(_0xcc3fdc){while(--_0xcc3fdc){_0x49a694['push'](_0x49a694['shift']());}};_0x13db1e(++_0x281f2d);}(_0xf178,0x1b0));var _0x8f17=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0xf178[_0x4b1012];return _0x23d715;};'use strict';var BPromise=require(_0x8f17('0x0'));var util=require(_0x8f17('0x1'));var _=require('lodash');var squel=require(_0x8f17('0x2'));var Redis=require(_0x8f17('0x3'));var qs=require(_0x8f17('0x4'));var logger=require(_0x8f17('0x5'))(_0x8f17('0x6'));var config=require(_0x8f17('0x7'));var db=require(_0x8f17('0x8'))['db'];config[_0x8f17('0x9')]=_[_0x8f17('0xa')](config[_0x8f17('0x9')],{'host':_0x8f17('0xb'),'port':0x18eb});var socket=require(_0x8f17('0xc'))(new Redis(config[_0x8f17('0x9')]));require(_0x8f17('0xd'))[_0x8f17('0xe')](socket);function respondWithStatusCode(_0x436378,_0x54929c){_0x54929c=_0x54929c||0xcc;return function(_0x1cb313){if(_0x1cb313){return _0x436378[_0x8f17('0xf')](_0x54929c);}return _0x436378[_0x8f17('0x10')](_0x54929c)[_0x8f17('0x11')]();};}function respondWithResult(_0x27df23,_0x3381fa){_0x3381fa=_0x3381fa||0xc8;return function(_0x3e5a4f){if(_0x3e5a4f){return _0x27df23[_0x8f17('0x10')](_0x3381fa)['json'](_0x3e5a4f);}};}function respondWithFilteredResult(_0x10f908,_0x2ba1f0){return function(_0x1e9ffa){if(_0x1e9ffa){var _0x2d05ea=typeof _0x2ba1f0[_0x8f17('0x12')]===_0x8f17('0x13')&&typeof _0x2ba1f0['limit']==='undefined';var _0x50ba79=_0x1e9ffa[_0x8f17('0x14')];var _0x14fc71=_0x2d05ea?0x0:_0x2ba1f0[_0x8f17('0x12')];var _0x1dc5fe=_0x2d05ea?_0x1e9ffa[_0x8f17('0x14')]:_0x2ba1f0['offset']+_0x2ba1f0[_0x8f17('0x15')];var _0x1ce889;if(_0x1dc5fe>=_0x50ba79){_0x1dc5fe=_0x50ba79;_0x1ce889=0xc8;}else{_0x1ce889=0xce;}_0x10f908['status'](_0x1ce889);return _0x10f908[_0x8f17('0x16')](_0x8f17('0x17'),_0x14fc71+'-'+_0x1dc5fe+'/'+_0x50ba79)[_0x8f17('0x18')](_0x1e9ffa);}return null;};}function saveUpdates(_0x5eb1c0){return function(_0x1446c8){if(_0x1446c8){return _0x1446c8[_0x8f17('0x19')](_0x5eb1c0)[_0x8f17('0x1a')](function(_0x48dd84){return _0x48dd84;});}return null;};}function removeEntity(_0x18b9ff){return function(_0x261c6f){if(_0x261c6f){return _0x261c6f[_0x8f17('0x1b')]()[_0x8f17('0x1a')](function(){var _0x335d69=_0x261c6f['get']({'plain':!![]});var _0x4b88b3=_0x8f17('0x1c');return db['UserProfileResource'][_0x8f17('0x1b')]({'where':{'type':_0x4b88b3,'resourceId':_0x335d69['id']}})[_0x8f17('0x1a')](function(){return _0x261c6f;});})['then'](function(){_0x18b9ff[_0x8f17('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367f74){return function(_0x40f841){if(!_0x40f841){_0x367f74[_0x8f17('0xf')](0x194);}return _0x40f841;};}function handleError(_0x67ea16,_0x3fa58a){_0x3fa58a=_0x3fa58a||0x1f4;return function(_0x5c2772){logger[_0x8f17('0x1d')](_0x5c2772[_0x8f17('0x1e')]);if(_0x5c2772[_0x8f17('0x1f')]){delete _0x5c2772[_0x8f17('0x1f')];}_0x67ea16[_0x8f17('0x10')](_0x3fa58a)['send'](_0x5c2772);};}exports[_0x8f17('0x20')]=function(_0x5d2bfd,_0x14d417){var _0x402296={};var _0x29e7ab={'count':0x0,'rows':[]};var _0x530e16=_[_0x8f17('0x21')](db[_0x8f17('0x22')][_0x8f17('0x23')],function(_0x1ec63c){return{'name':_0x1ec63c[_0x8f17('0x24')],'type':_0x1ec63c['type']['key']};});_0x402296=qs['getOptions'](_0x530e16,_0x5d2bfd);var _0x5aae25={'where':_0x402296['where']};return db[_0x8f17('0x22')][_0x8f17('0x14')](_0x5aae25)['then'](function(_0xcdce95){_0x29e7ab[_0x8f17('0x14')]=_0xcdce95;_0x402296['include']=qs['include'](_0x5d2bfd[_0x8f17('0x25')]);return db[_0x8f17('0x22')][_0x8f17('0x26')](_0x402296);})[_0x8f17('0x1a')](function(_0x2cf142){_0x29e7ab[_0x8f17('0x27')]=_0x2cf142;return _0x29e7ab;})[_0x8f17('0x1a')](respondWithFilteredResult(_0x14d417,_0x402296))[_0x8f17('0x28')](handleError(_0x14d417,null));};exports['show']=function(_0x36b886,_0x371f6d){var _0x50fd5a={'raw':!![],'where':{'id':_0x36b886[_0x8f17('0x29')]['id']}},_0x3669a8={};_0x3669a8[_0x8f17('0x2a')]=_['keys'](db[_0x8f17('0x22')][_0x8f17('0x23')]);_0x3669a8[_0x8f17('0x25')]=_['keys'](_0x36b886[_0x8f17('0x25')]);_0x3669a8['filters']=_[_0x8f17('0x2b')](_0x3669a8['model'],_0x3669a8[_0x8f17('0x25')]);_0x50fd5a['attributes']=_[_0x8f17('0x2b')](_0x3669a8['model'],qs['fields'](_0x36b886[_0x8f17('0x25')][_0x8f17('0x2c')]));_0x50fd5a['attributes']=_0x50fd5a[_0x8f17('0x2d')][_0x8f17('0x2e')]?_0x50fd5a['attributes']:_0x3669a8['model'];if(_0x36b886[_0x8f17('0x25')]['includeAll']){_0x50fd5a[_0x8f17('0x2f')]=[{'all':!![]}];}_0x50fd5a=_[_0x8f17('0x30')]({},_0x50fd5a,_0x36b886[_0x8f17('0x31')]);return db[_0x8f17('0x22')]['find'](_0x50fd5a)['then'](handleEntityNotFound(_0x371f6d,null))['then'](respondWithResult(_0x371f6d,null))['catch'](handleError(_0x371f6d,null));};exports[_0x8f17('0x32')]=function(_0x5c2007,_0x43ae5c){return db['OpenchannelQueue'][_0x8f17('0x32')](_0x5c2007[_0x8f17('0x33')],{})[_0x8f17('0x1a')](function(_0x1bd662){var _0x1abcca=_0x5c2007[_0x8f17('0x34')][_0x8f17('0x35')]({'plain':!![]});if(!_0x1abcca)throw new Error(_0x8f17('0x36'));if(_0x1abcca[_0x8f17('0x37')]==='user'){var _0xb0688a=_0x1bd662[_0x8f17('0x35')]({'plain':!![]});var _0x239c5f=_0x8f17('0x1c');return db['UserProfileSection'][_0x8f17('0x38')]({'where':{'name':_0x239c5f,'userProfileId':_0x1abcca[_0x8f17('0x39')]},'raw':!![]})[_0x8f17('0x1a')](function(_0x1799ac){if(_0x1799ac&&_0x1799ac['autoAssociation']===0x0){return db[_0x8f17('0x3a')]['create']({'name':_0xb0688a[_0x8f17('0x1f')],'resourceId':_0xb0688a['id'],'type':_0x1799ac['name'],'sectionId':_0x1799ac['id']},{})[_0x8f17('0x1a')](function(){return _0x1bd662;});}else{return _0x1bd662;}})[_0x8f17('0x28')](function(_0x3e2f18){logger[_0x8f17('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e2f18);throw _0x3e2f18;});}return _0x1bd662;})[_0x8f17('0x1a')](respondWithResult(_0x43ae5c,0xc9))[_0x8f17('0x28')](handleError(_0x43ae5c,null));};exports[_0x8f17('0x19')]=function(_0x57f04f,_0x626e3e){if(_0x57f04f[_0x8f17('0x33')]['id']){delete _0x57f04f[_0x8f17('0x33')]['id'];}return db[_0x8f17('0x22')][_0x8f17('0x38')]({'where':{'id':_0x57f04f['params']['id']}})['then'](handleEntityNotFound(_0x626e3e,null))[_0x8f17('0x1a')](saveUpdates(_0x57f04f[_0x8f17('0x33')],null))[_0x8f17('0x1a')](respondWithResult(_0x626e3e,null))[_0x8f17('0x28')](handleError(_0x626e3e,null));};exports[_0x8f17('0x1b')]=function(_0x1b7f91,_0x2e5b22){return db['OpenchannelQueue'][_0x8f17('0x38')]({'where':{'id':_0x1b7f91['params']['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x2e5b22,null))[_0x8f17('0x1a')](removeEntity(_0x2e5b22,null))[_0x8f17('0x28')](handleError(_0x2e5b22,null));};exports[_0x8f17('0x3b')]=function(_0x649c5b,_0xdffe03){return db[_0x8f17('0x22')][_0x8f17('0x3b')]()[_0x8f17('0x1a')](respondWithResult(_0xdffe03,null))['catch'](handleError(_0xdffe03,null));};exports['getMembers']=function(_0x2470d9,_0x145c12){var _0x3a5c5e={'raw':!![],'where':{}},_0x4de61b={},_0x1c94c9;return db[_0x8f17('0x22')][_0x8f17('0x3c')]({'where':{'id':_0x2470d9[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x145c12,null))[_0x8f17('0x1a')](function(_0x4cf91e){if(_0x4cf91e){_0x1c94c9=_0x4cf91e[_0x8f17('0x35')]({'plain':!![]});_0x4de61b[_0x8f17('0x2a')]=_[_0x8f17('0x3d')](db[_0x8f17('0x3e')]['rawAttributes']);_0x4de61b['query']=_['keys'](_0x2470d9[_0x8f17('0x25')]);_0x4de61b['filters']=_[_0x8f17('0x2b')](_0x4de61b[_0x8f17('0x2a')],_0x4de61b[_0x8f17('0x25')]);_0x3a5c5e[_0x8f17('0x2d')]=_[_0x8f17('0x2b')](_0x4de61b[_0x8f17('0x2a')],qs[_0x8f17('0x2c')](_0x2470d9[_0x8f17('0x25')][_0x8f17('0x2c')]));_0x3a5c5e[_0x8f17('0x2d')]=_0x3a5c5e[_0x8f17('0x2d')][_0x8f17('0x2e')]?_0x3a5c5e['attributes']:_0x4de61b['model'];if(!_0x2470d9[_0x8f17('0x25')][_0x8f17('0x3f')](_0x8f17('0x40'))){_0x3a5c5e[_0x8f17('0x15')]=qs[_0x8f17('0x15')](_0x2470d9['query'][_0x8f17('0x15')]);_0x3a5c5e[_0x8f17('0x12')]=qs[_0x8f17('0x12')](_0x2470d9[_0x8f17('0x25')][_0x8f17('0x12')]);}_0x3a5c5e['order']=qs[_0x8f17('0x41')](_0x2470d9['query']['sort']);_0x3a5c5e[_0x8f17('0x42')]=qs[_0x8f17('0x43')](_['pick'](_0x2470d9[_0x8f17('0x25')],_0x4de61b['filters']));_0x3a5c5e[_0x8f17('0x42')][_0x8f17('0x44')]=_0x4cf91e['id'];if(_0x2470d9[_0x8f17('0x25')][_0x8f17('0x45')]){_0x3a5c5e[_0x8f17('0x42')]=_[_0x8f17('0x30')](_0x3a5c5e[_0x8f17('0x42')],{'$or':_['map'](_0x3a5c5e[_0x8f17('0x2d')],function(_0xd2522a){var _0x248bb6={};_0x248bb6[_0xd2522a]={'$like':'%'+_0x2470d9[_0x8f17('0x25')][_0x8f17('0x45')]+'%'};return _0x248bb6;})});}_0x3a5c5e=_['merge']({},_0x3a5c5e,_0x2470d9[_0x8f17('0x31')]);return db[_0x8f17('0x3e')][_0x8f17('0x26')](_0x3a5c5e);}})['then'](function(_0x3650a3){if(_0x3650a3){return db['User'][_0x8f17('0x46')]({'where':{'id':_[_0x8f17('0x21')](_0x3650a3,'UserId'),'role':_0x8f17('0x47')},'attributes':['id','name',_0x8f17('0x48'),'updatedAt','createdAt']});}})[_0x8f17('0x1a')](function(_0x5c4546){if(_0x5c4546){return{'count':_0x5c4546['count'],'rows':_[_0x8f17('0x21')](_0x5c4546[_0x8f17('0x27')],function(_0x3e15f0){return{'membername':_0x3e15f0['name'],'UserId':_0x3e15f0['id'],'queue_name':_0x1c94c9[_0x8f17('0x1f')],'OpenchannelQueueId':_0x1c94c9['id'],'interface':util[_0x8f17('0x49')](_0x8f17('0x4a'),'SIP',_0x3e15f0[_0x8f17('0x1f')]),'penalty':0x0,'paused':_0x3e15f0[_0x8f17('0x48')],'createdAt':_0x3e15f0[_0x8f17('0x4b')],'updatedAt':_0x3e15f0[_0x8f17('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x145c12,_0x3a5c5e))[_0x8f17('0x28')](handleError(_0x145c12,null));};exports[_0x8f17('0x4d')]=function(_0x175ed2,_0x50ce33){var _0x4c5f1e={};var _0x4ab467={};var _0x50456d;var _0x54bbc3;return db[_0x8f17('0x22')][_0x8f17('0x3c')]({'where':{'id':_0x175ed2[_0x8f17('0x29')]['id']}})['then'](handleEntityNotFound(_0x50ce33,null))[_0x8f17('0x1a')](function(_0x53f53a){if(_0x53f53a){_0x50456d=_0x53f53a;_0x4ab467[_0x8f17('0x2a')]=_[_0x8f17('0x3d')](db[_0x8f17('0x4e')][_0x8f17('0x23')]);_0x4ab467[_0x8f17('0x25')]=_['keys'](_0x175ed2['query']);_0x4ab467[_0x8f17('0x43')]=_[_0x8f17('0x2b')](_0x4ab467[_0x8f17('0x2a')],_0x4ab467[_0x8f17('0x25')]);_0x4c5f1e[_0x8f17('0x2d')]=_[_0x8f17('0x2b')](_0x4ab467[_0x8f17('0x2a')],qs[_0x8f17('0x2c')](_0x175ed2[_0x8f17('0x25')][_0x8f17('0x2c')]));_0x4c5f1e[_0x8f17('0x2d')]=_0x4c5f1e['attributes'][_0x8f17('0x2e')]?_0x4c5f1e[_0x8f17('0x2d')]:_0x4ab467[_0x8f17('0x2a')];_0x4c5f1e[_0x8f17('0x4f')]=qs[_0x8f17('0x41')](_0x175ed2['query'][_0x8f17('0x41')]);_0x4c5f1e[_0x8f17('0x42')]=qs[_0x8f17('0x43')](_['pick'](_0x175ed2[_0x8f17('0x25')],_0x4ab467[_0x8f17('0x43')]));if(_0x175ed2[_0x8f17('0x25')][_0x8f17('0x45')]){_0x4c5f1e['where']=_[_0x8f17('0x30')](_0x4c5f1e[_0x8f17('0x42')],{'$or':_['map'](_0x4c5f1e[_0x8f17('0x2d')],function(_0x52f858){var _0x5bc97a={};_0x5bc97a[_0x52f858]={'$like':'%'+_0x175ed2['query']['filter']+'%'};return _0x5bc97a;})});}_0x4c5f1e=_['merge']({},_0x4c5f1e,_0x175ed2[_0x8f17('0x31')]);return _0x50456d[_0x8f17('0x4d')](_0x4c5f1e);}})[_0x8f17('0x1a')](function(_0xbe8d5){if(_0xbe8d5){_0x54bbc3=_0xbe8d5['length'];if(!_0x175ed2[_0x8f17('0x25')][_0x8f17('0x3f')]('nolimit')){_0x4c5f1e['limit']=qs[_0x8f17('0x15')](_0x175ed2['query'][_0x8f17('0x15')]);_0x4c5f1e[_0x8f17('0x12')]=qs['offset'](_0x175ed2[_0x8f17('0x25')][_0x8f17('0x12')]);}return _0x50456d[_0x8f17('0x4d')](_0x4c5f1e);}})[_0x8f17('0x1a')](function(_0x56ed76){if(_0x56ed76){return _0x56ed76?{'count':_0x54bbc3,'rows':_0x56ed76}:null;}})[_0x8f17('0x1a')](respondWithResult(_0x50ce33,null))[_0x8f17('0x28')](handleError(_0x50ce33,null));};exports['addTeams']=function(_0x27f995,_0x1d7c53){var _0x559075=_0x27f995[_0x8f17('0x33')][_0x8f17('0x50')];return db[_0x8f17('0x4e')][_0x8f17('0x26')]({'where':{'id':_0x559075},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8f17('0x51'),'attributes':['id',_0x8f17('0x1f'),_0x8f17('0x52'),_0x8f17('0x53'),'interface'],'raw':!![]}]})['then'](function(_0x13bf8){if(_0x13bf8){var _0x4010f5=_[_0x8f17('0x54')](_0x13bf8,function(_0x2f1b14){var _0x3a34b9=_0x2f1b14['get']({'plain':!![]});return _0x3a34b9['Agents'];});return db[_0x8f17('0x22')][_0x8f17('0x38')]({'where':{'id':_0x27f995[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](function(_0x42f5dd){return db[_0x8f17('0x55')][_0x8f17('0x56')](function(_0x2867c9){return _0x42f5dd[_0x8f17('0x57')](_0x559075,{'transaction':_0x2867c9})[_0x8f17('0x1a')](function(){return BPromise[_0x8f17('0x58')](_0x4010f5,function(_0x33791a){return db[_0x8f17('0x3e')][_0x8f17('0x59')]({'where':{'UserId':_0x33791a['id'],'OpenchannelQueueId':_0x27f995['params']['id']},'transaction':_0x2867c9});});})[_0x8f17('0x1a')](function(){_0x4010f5[_0x8f17('0x5a')](function(_0x4ab490){socket[_0x8f17('0x5b')]('userOpenchannelQueue:save',{'UserId':_0x4ab490['id'],'OpenchannelQueueId':_0x42f5dd['id']});});});});});}})[_0x8f17('0x1a')](respondWithStatusCode(_0x1d7c53,null))[_0x8f17('0x28')](handleError(_0x1d7c53,null));};exports[_0x8f17('0x5c')]=function(_0x276954,_0x172eab){return db[_0x8f17('0x4e')][_0x8f17('0x26')]({'where':{'id':_0x276954[_0x8f17('0x25')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8f17('0x5d')],'as':_0x8f17('0x51'),'attributes':['id'],'raw':!![]}]})[_0x8f17('0x1a')](handleEntityNotFound(_0x172eab,null))[_0x8f17('0x1a')](function(_0x4480be){var _0x359a11=_[_0x8f17('0x21')](_0x4480be,'id');var _0x125fdd=[];var _0x13d796=[];var _0x465ad6=squel[_0x8f17('0x5e')]();_0x465ad6[_0x8f17('0x5f')](_0x8f17('0x60'))[_0x8f17('0x61')](_0x8f17('0x62'),'tq')['join'](_0x8f17('0x63'),'ut',_0x8f17('0x64'))[_0x8f17('0x42')](_0x8f17('0x65'),_0x276954['params']['id']);for(var _0x533943=0x0;_0x533943<_0x4480be[_0x8f17('0x2e')];_0x533943+=0x1){let _0x41ab89=_0x4480be[_0x533943];for(var _0x504b67=0x0;_0x504b67<_0x41ab89[_0x8f17('0x51')]['length'];_0x504b67+=0x1){let _0x5da659=_0x41ab89[_0x8f17('0x51')][_0x504b67];var _0x29b089=_0x465ad6[_0x8f17('0x66')]();_0x29b089['where'](_0x8f17('0x67'),_0x5da659['id']);_0x13d796[_0x8f17('0x68')](db[_0x8f17('0x55')]['query'](_0x29b089['toString'](),{'type':db[_0x8f17('0x55')][_0x8f17('0x69')][_0x8f17('0x6a')]})[_0x8f17('0x1a')](function(_0x420a4b){if(_0x420a4b[_0x8f17('0x2e')]===0x1){return _0x5da659['id'];}else{var _0x2f3c47=_[_0x8f17('0x6b')](_['map'](_0x420a4b,_0x8f17('0x6c')),function(_0x20098f){return _['includes'](_0x359a11,_0x20098f);});if(_0x2f3c47){return _0x5da659['id'];}}}));}}return BPromise[_0x8f17('0x6d')](_0x13d796)[_0x8f17('0x1a')](function(_0x7e4fb){_0x125fdd=_(_0x125fdd)[_0x8f17('0x6e')](_0x7e4fb)['compact']()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x276954[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](function(_0x51110a){return db[_0x8f17('0x55')]['transaction'](function(_0x4dfee9){return _0x51110a[_0x8f17('0x5c')](_0x276954['query'][_0x8f17('0x50')],{'transaction':_0x4dfee9})[_0x8f17('0x1a')](function(){if(!_[_0x8f17('0x6f')](_0x125fdd)){return _0x51110a[_0x8f17('0x70')](_0x125fdd,{'transaction':_0x4dfee9});}})['then'](function(){_0x125fdd[_0x8f17('0x5a')](function(_0x1160d7){socket[_0x8f17('0x5b')](_0x8f17('0x71'),{'UserId':_0x1160d7,'OpenchannelQueueId':_0x51110a['id']});});});});});});})[_0x8f17('0x1a')](respondWithStatusCode(_0x172eab,null))[_0x8f17('0x28')](handleError(_0x172eab,null));};exports['addAgents']=function(_0x5ba08e,_0x3d824e){return db['OpenchannelQueue'][_0x8f17('0x38')]({'where':{'id':_0x5ba08e[_0x8f17('0x29')]['id']}})['then'](handleEntityNotFound(_0x3d824e,null))[_0x8f17('0x1a')](function(_0x21a63f){if(_0x21a63f){return _0x21a63f['addAgents'](_0x5ba08e['body']['ids'],_[_0x8f17('0x72')](_0x5ba08e[_0x8f17('0x33')],[_0x8f17('0x50'),'id'])||{})['spread'](function(_0x204f2f){for(var _0x2ef855=0x0;_0x2ef855<_0x5ba08e[_0x8f17('0x33')][_0x8f17('0x50')][_0x8f17('0x2e')];_0x2ef855+=0x1){socket['emit'](_0x8f17('0x73'),{'UserId':Number(_0x5ba08e[_0x8f17('0x33')][_0x8f17('0x50')][_0x2ef855]),'OpenchannelQueueId':Number(_0x5ba08e[_0x8f17('0x29')]['id'])});}return _0x204f2f;});}})[_0x8f17('0x1a')](respondWithResult(_0x3d824e,null))[_0x8f17('0x28')](handleError(_0x3d824e,null));};exports['removeAgents']=function(_0x1818cc,_0x13c18a){return db[_0x8f17('0x22')][_0x8f17('0x38')]({'where':{'id':_0x1818cc[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x13c18a,null))[_0x8f17('0x1a')](function(_0x6c5e65){if(_0x6c5e65){return _0x6c5e65[_0x8f17('0x70')](_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')])[_0x8f17('0x1a')](function(){if(_[_0x8f17('0x74')](_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')])){for(var _0x5ca5e1=0x0;_0x5ca5e1<_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')][_0x8f17('0x2e')];_0x5ca5e1+=0x1){socket['emit'](_0x8f17('0x71'),{'UserId':Number(_0x1818cc['query']['ids'][_0x5ca5e1]),'OpenchannelQueueId':Number(_0x1818cc['params']['id'])});}}else{socket[_0x8f17('0x5b')](_0x8f17('0x71'),{'UserId':Number(_0x1818cc[_0x8f17('0x25')][_0x8f17('0x50')]),'OpenchannelQueueId':Number(_0x1818cc[_0x8f17('0x29')]['id'])});}});}})[_0x8f17('0x1a')](respondWithStatusCode(_0x13c18a,null))['catch'](handleError(_0x13c18a,null));};exports[_0x8f17('0x75')]=function(_0xe5832e,_0x1df4c5){var _0x382cb9={};var _0x33a4fe={};var _0x30cbbc;var _0x28a784;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xe5832e[_0x8f17('0x29')]['id']}})[_0x8f17('0x1a')](handleEntityNotFound(_0x1df4c5,null))[_0x8f17('0x1a')](function(_0x1aa48a){if(_0x1aa48a){_0x30cbbc=_0x1aa48a;_0x33a4fe[_0x8f17('0x2a')]=_[_0x8f17('0x3d')](db[_0x8f17('0x5d')][_0x8f17('0x23')]);_0x33a4fe['query']=_[_0x8f17('0x3d')](_0xe5832e[_0x8f17('0x25')]);_0x33a4fe[_0x8f17('0x43')]=_[_0x8f17('0x2b')](_0x33a4fe[_0x8f17('0x2a')],_0x33a4fe[_0x8f17('0x25')]);_0x382cb9[_0x8f17('0x2d')]=_[_0x8f17('0x2b')](_0x33a4fe[_0x8f17('0x2a')],qs[_0x8f17('0x2c')](_0xe5832e['query']['fields']));_0x382cb9['attributes']=_0x382cb9[_0x8f17('0x2d')][_0x8f17('0x2e')]?_0x382cb9[_0x8f17('0x2d')]:_0x33a4fe[_0x8f17('0x2a')];_0x382cb9[_0x8f17('0x4f')]=qs['sort'](_0xe5832e[_0x8f17('0x25')][_0x8f17('0x41')]);_0x382cb9[_0x8f17('0x42')]=qs[_0x8f17('0x43')](_[_0x8f17('0x76')](_0xe5832e[_0x8f17('0x25')],_0x33a4fe[_0x8f17('0x43')]));if(_0xe5832e[_0x8f17('0x25')]['filter']){_0x382cb9[_0x8f17('0x42')]=_['merge'](_0x382cb9[_0x8f17('0x42')],{'$or':_['map'](_0x382cb9[_0x8f17('0x2d')],function(_0x2121a2){var _0x466bdf={};_0x466bdf[_0x2121a2]={'$like':'%'+_0xe5832e[_0x8f17('0x25')]['filter']+'%'};return _0x466bdf;})});}_0x382cb9=_[_0x8f17('0x30')]({},_0x382cb9,_0xe5832e['options']);return _0x30cbbc['getAgents'](_0x382cb9);}})[_0x8f17('0x1a')](function(_0x4c2331){if(_0x4c2331){_0x28a784=_0x4c2331['length'];if(!_0xe5832e[_0x8f17('0x25')][_0x8f17('0x3f')]('nolimit')){_0x382cb9[_0x8f17('0x15')]=qs[_0x8f17('0x15')](_0xe5832e[_0x8f17('0x25')][_0x8f17('0x15')]);_0x382cb9['offset']=qs[_0x8f17('0x12')](_0xe5832e[_0x8f17('0x25')][_0x8f17('0x12')]);}return _0x30cbbc[_0x8f17('0x75')](_0x382cb9);}})['then'](function(_0x58dcc5){if(_0x58dcc5){return _0x58dcc5?{'count':_0x28a784,'rows':_0x58dcc5}:null;}})[_0x8f17('0x1a')](respondWithResult(_0x1df4c5,null))[_0x8f17('0x28')](handleError(_0x1df4c5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index f9b756f..09f585e 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 _0xf17c=['emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','save','remove'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xf17c,0x74));var _0xcf17=function(_0xa5bfea,_0x491377){_0xa5bfea=_0xa5bfea-0x0;var _0x377de1=_0xf17c[_0xa5bfea];return _0x377de1;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xcf17('0x0'))['db'][_0xcf17('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf17('0x2'),'afterUpdate':'update','afterDestroy':_0xcf17('0x3')};function emitEvent(_0x540bca){return function(_0x156f0e,_0x2c3aa9,_0x1c681e){OpenchannelQueueEvents['emit'](_0x540bca+':'+_0x156f0e['id'],_0x156f0e);OpenchannelQueueEvents[_0xcf17('0x4')](_0x540bca,_0x156f0e);_0x1c681e(null);};}for(var e in events){if(events[_0xcf17('0x5')](e)){var event=events[e];OpenchannelQueue[_0xcf17('0x6')](e,emitEvent(event));}}module[_0xcf17('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x1ea5=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x2d9e68,_0x2fcad4){var _0x34d5b5=function(_0x5095a7){while(--_0x5095a7){_0x2d9e68['push'](_0x2d9e68['shift']());}};_0x34d5b5(++_0x2fcad4);}(_0x1ea5,0x190));var _0x51ea=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0x1ea5[_0x5df61d];return _0x24cc4c;};'use strict';var EventEmitter=require(_0x51ea('0x0'));var OpenchannelQueue=require(_0x51ea('0x1'))['db'][_0x51ea('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x51ea('0x3')](0x0);var events={'afterCreate':_0x51ea('0x4'),'afterUpdate':_0x51ea('0x5'),'afterDestroy':_0x51ea('0x6')};function emitEvent(_0x14bbc1){return function(_0x2badee,_0xc15793,_0x57d8c4){OpenchannelQueueEvents['emit'](_0x14bbc1+':'+_0x2badee['id'],_0x2badee);OpenchannelQueueEvents[_0x51ea('0x7')](_0x14bbc1,_0x2badee);_0x57d8c4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x51ea('0x8')](e,emitEvent(event));}}module[_0x51ea('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 5bcf290..7bae071 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 _0x6e70=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0xff2dac,_0x24506f){var _0x603430=function(_0x4a4ec9){while(--_0x4a4ec9){_0xff2dac['push'](_0xff2dac['shift']());}};_0x603430(++_0x24506f);}(_0x6e70,0x91));var _0x06e7=function(_0x72814d,_0x35cd78){_0x72814d=_0x72814d-0x0;var _0x4b06ec=_0x6e70[_0x72814d];return _0x4b06ec;};'use strict';var _=require(_0x06e7('0x0'));var util=require(_0x06e7('0x1'));var logger=require(_0x06e7('0x2'))('api');var moment=require(_0x06e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x06e7('0x4'));var rimraf=require(_0x06e7('0x5'));var config=require(_0x06e7('0x6'));var attributes=require(_0x06e7('0x7'));module[_0x06e7('0x8')]=function(_0x2101f9,_0x2390b0){return _0x2101f9['define'](_0x06e7('0x9'),attributes,{'tableName':_0x06e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66f3=['define','OpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x1c7ac2,_0x295452){var _0xa6128f=function(_0xf5eee4){while(--_0xf5eee4){_0x1c7ac2['push'](_0x1c7ac2['shift']());}};_0xa6128f(++_0x295452);}(_0x66f3,0x1b0));var _0x366f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x66f3[_0x95ac8b];return _0x5b0792;};'use strict';var _=require(_0x366f('0x0'));var util=require('util');var logger=require(_0x366f('0x1'))(_0x366f('0x2'));var moment=require('moment');var BPromise=require(_0x366f('0x3'));var rp=require(_0x366f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x366f('0x5'));var config=require(_0x366f('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x366f('0x7')]=function(_0x598ab6,_0x20a16f){return _0x598ab6[_0x366f('0x8')](_0x366f('0x9'),attributes,{'tableName':'openchannel_queues','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 e878fc7..9be82a4 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 _0xa7c8=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','model','map','catch','find','ShowOpenchannelQueue','lodash','util','moment'];(function(_0x1cc3c9,_0x2ff477){var _0x3a41a2=function(_0x15f70f){while(--_0x15f70f){_0x1cc3c9['push'](_0x1cc3c9['shift']());}};_0x3a41a2(++_0x2ff477);}(_0xa7c8,0x9d));var _0x8a7c=function(_0x15b044,_0x52797a){_0x15b044=_0x15b044-0x0;var _0x332f8f=_0xa7c8[_0x15b044];return _0x332f8f;};'use strict';var _=require(_0x8a7c('0x0'));var util=require(_0x8a7c('0x1'));var moment=require(_0x8a7c('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a7c('0x3'));var fs=require('fs');var Redis=require(_0x8a7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a7c('0x5'));var logger=require('../../config/logger')(_0x8a7c('0x6'));var config=require(_0x8a7c('0x7'));var jayson=require(_0x8a7c('0x8'));var client=jayson[_0x8a7c('0x9')][_0x8a7c('0xa')]({'port':0x232a});config[_0x8a7c('0xb')]=_[_0x8a7c('0xc')](config[_0x8a7c('0xb')],{'host':_0x8a7c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a7c('0xb')]));require('./openchannelQueue.socket')[_0x8a7c('0xe')](socket);function respondWithRpcPromise(_0x16ee99,_0x4cc5bb,_0x1a4857){return new BPromise(function(_0x43ccf3,_0x218265){return client[_0x8a7c('0xf')](_0x16ee99,_0x1a4857)[_0x8a7c('0x10')](function(_0x45cd13){logger[_0x8a7c('0x11')](_0x8a7c('0x12'),_0x4cc5bb,_0x8a7c('0x13'));logger[_0x8a7c('0x14')](_0x8a7c('0x15'),_0x4cc5bb,_0x8a7c('0x13'),JSON[_0x8a7c('0x16')](_0x45cd13));if(_0x45cd13[_0x8a7c('0x17')]){if(_0x45cd13[_0x8a7c('0x17')][_0x8a7c('0x18')]===0x1f4){logger[_0x8a7c('0x17')](_0x8a7c('0x12'),_0x4cc5bb,_0x45cd13['error'][_0x8a7c('0x19')]);return _0x218265(_0x45cd13[_0x8a7c('0x17')]['message']);}logger[_0x8a7c('0x17')](_0x8a7c('0x12'),_0x4cc5bb,_0x45cd13['error'][_0x8a7c('0x19')]);return _0x43ccf3(_0x45cd13[_0x8a7c('0x17')]['message']);}else{logger[_0x8a7c('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x4cc5bb,_0x8a7c('0x13'));_0x43ccf3(_0x45cd13[_0x8a7c('0x1a')][_0x8a7c('0x19')]);}})['catch'](function(_0x5adaf0){logger[_0x8a7c('0x17')](_0x8a7c('0x12'),_0x4cc5bb,_0x5adaf0);_0x218265(_0x5adaf0);});});}exports[_0x8a7c('0x1b')]=function(_0x123a32){var _0x57b290=this;return new Promise(function(_0x296ae4,_0xeb5e84){return db[_0x8a7c('0x1c')]['findAll']({'raw':_0x123a32[_0x8a7c('0x1d')]?_0x123a32[_0x8a7c('0x1d')][_0x8a7c('0x1e')]===undefined?!![]:![]:!![],'where':_0x123a32['options']?_0x123a32['options'][_0x8a7c('0x1f')]||null:null,'attributes':_0x123a32['options']?_0x123a32[_0x8a7c('0x1d')][_0x8a7c('0x20')]||null:null,'limit':_0x123a32[_0x8a7c('0x1d')]?_0x123a32['options'][_0x8a7c('0x21')]||null:null,'include':_0x123a32['options']?_0x123a32[_0x8a7c('0x1d')][_0x8a7c('0x22')]?_['map'](_0x123a32[_0x8a7c('0x1d')][_0x8a7c('0x22')],function(_0x1be13f){return{'model':db[_0x1be13f[_0x8a7c('0x23')]],'as':_0x1be13f['as'],'attributes':_0x1be13f[_0x8a7c('0x20')],'include':_0x1be13f['include']?_[_0x8a7c('0x24')](_0x1be13f['include'],function(_0x59b494){return{'model':db[_0x59b494[_0x8a7c('0x23')]],'as':_0x59b494['as'],'attributes':_0x59b494['attributes'],'include':_0x59b494[_0x8a7c('0x22')]?_[_0x8a7c('0x24')](_0x59b494['include'],function(_0x2be7a5){return{'model':db[_0x2be7a5[_0x8a7c('0x23')]],'as':_0x2be7a5['as'],'attributes':_0x2be7a5[_0x8a7c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8a7c('0x10')](function(_0x4d8952){logger[_0x8a7c('0x11')]('GetOpenchannelQueue',_0x123a32);logger[_0x8a7c('0x14')]('GetOpenchannelQueue',_0x123a32,JSON[_0x8a7c('0x16')](_0x4d8952));_0x296ae4(_0x4d8952);})[_0x8a7c('0x25')](function(_0x36aae8){logger[_0x8a7c('0x17')](_0x8a7c('0x1b'),_0x36aae8['message'],_0x123a32);_0xeb5e84(_0x57b290[_0x8a7c('0x17')](0x1f4,_0x36aae8['message']));});});};exports['ShowOpenchannelQueue']=function(_0x57287d){var _0x37aedf=this;return new Promise(function(_0x2a7a69,_0x561a65){return db[_0x8a7c('0x1c')][_0x8a7c('0x26')]({'raw':_0x57287d['options']?_0x57287d['options']['raw']===undefined?!![]:![]:!![],'where':_0x57287d[_0x8a7c('0x1d')]?_0x57287d['options']['where']||null:null,'attributes':_0x57287d[_0x8a7c('0x1d')]?_0x57287d[_0x8a7c('0x1d')][_0x8a7c('0x20')]||null:null,'include':_0x57287d[_0x8a7c('0x1d')]?_0x57287d[_0x8a7c('0x1d')]['include']?_['map'](_0x57287d['options'][_0x8a7c('0x22')],function(_0x112af0){return{'model':db[_0x112af0['model']],'as':_0x112af0['as'],'attributes':_0x112af0[_0x8a7c('0x20')],'include':_0x112af0[_0x8a7c('0x22')]?_[_0x8a7c('0x24')](_0x112af0['include'],function(_0x35df50){return{'model':db[_0x35df50['model']],'as':_0x35df50['as'],'attributes':_0x35df50[_0x8a7c('0x20')],'include':_0x35df50[_0x8a7c('0x22')]?_[_0x8a7c('0x24')](_0x35df50[_0x8a7c('0x22')],function(_0x19b959){return{'model':db[_0x19b959[_0x8a7c('0x23')]],'as':_0x19b959['as'],'attributes':_0x19b959['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a7c('0x10')](function(_0x28f881){logger[_0x8a7c('0x11')]('ShowOpenchannelQueue',_0x57287d);logger['debug']('ShowOpenchannelQueue',_0x57287d,JSON[_0x8a7c('0x16')](_0x28f881));_0x2a7a69(_0x28f881);})[_0x8a7c('0x25')](function(_0x5c5c71){logger['error'](_0x8a7c('0x27'),_0x5c5c71[_0x8a7c('0x19')],_0x57287d);_0x561a65(_0x37aedf[_0x8a7c('0x17')](0x1f4,_0x5c5c71[_0x8a7c('0x19')]));});});}; \ No newline at end of file +var _0x297d=['info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x297d,0x1bc));var _0xd297=function(_0x256bba,_0x1e9329){_0x256bba=_0x256bba-0x0;var _0x3cafcd=_0x297d[_0x256bba];return _0x3cafcd;};'use strict';var _=require('lodash');var util=require(_0xd297('0x0'));var moment=require(_0xd297('0x1'));var BPromise=require('bluebird');var rs=require(_0xd297('0x2'));var fs=require('fs');var Redis=require(_0xd297('0x3'));var db=require(_0xd297('0x4'))['db'];var utils=require(_0xd297('0x5'));var logger=require(_0xd297('0x6'))('rpc');var config=require(_0xd297('0x7'));var jayson=require(_0xd297('0x8'));var client=jayson[_0xd297('0x9')][_0xd297('0xa')]({'port':0x232a});config[_0xd297('0xb')]=_[_0xd297('0xc')](config[_0xd297('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd297('0xd'))(new Redis(config[_0xd297('0xb')]));require(_0xd297('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cf9d0,_0x35d465,_0x51e59a){return new BPromise(function(_0x15cf38,_0x1741b2){return client['request'](_0x1cf9d0,_0x51e59a)[_0xd297('0xf')](function(_0x5471c7){logger['info'](_0xd297('0x10'),_0x35d465,_0xd297('0x11'));logger[_0xd297('0x12')](_0xd297('0x13'),_0x35d465,'request\x20sent',JSON[_0xd297('0x14')](_0x5471c7));if(_0x5471c7[_0xd297('0x15')]){if(_0x5471c7['error'][_0xd297('0x16')]===0x1f4){logger[_0xd297('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x35d465,_0x5471c7['error'][_0xd297('0x17')]);return _0x1741b2(_0x5471c7[_0xd297('0x15')][_0xd297('0x17')]);}logger['error'](_0xd297('0x10'),_0x35d465,_0x5471c7[_0xd297('0x15')][_0xd297('0x17')]);return _0x15cf38(_0x5471c7['error']['message']);}else{logger[_0xd297('0x18')](_0xd297('0x10'),_0x35d465,_0xd297('0x11'));_0x15cf38(_0x5471c7[_0xd297('0x19')][_0xd297('0x17')]);}})[_0xd297('0x1a')](function(_0x524cad){logger[_0xd297('0x15')](_0xd297('0x10'),_0x35d465,_0x524cad);_0x1741b2(_0x524cad);});});}exports[_0xd297('0x1b')]=function(_0xe99c9a){var _0x2754cf=this;return new Promise(function(_0x1ea975,_0x469f78){return db[_0xd297('0x1c')][_0xd297('0x1d')]({'raw':_0xe99c9a['options']?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x1f')]===undefined?!![]:![]:!![],'where':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x20')]||null:null,'attributes':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')]['attributes']||null:null,'limit':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x21')]||null:null,'include':_0xe99c9a[_0xd297('0x1e')]?_0xe99c9a[_0xd297('0x1e')][_0xd297('0x22')]?_[_0xd297('0x23')](_0xe99c9a[_0xd297('0x1e')]['include'],function(_0x7d8e26){return{'model':db[_0x7d8e26[_0xd297('0x24')]],'as':_0x7d8e26['as'],'attributes':_0x7d8e26[_0xd297('0x25')],'include':_0x7d8e26[_0xd297('0x22')]?_['map'](_0x7d8e26['include'],function(_0x54c4bf){return{'model':db[_0x54c4bf[_0xd297('0x24')]],'as':_0x54c4bf['as'],'attributes':_0x54c4bf[_0xd297('0x25')],'include':_0x54c4bf[_0xd297('0x22')]?_[_0xd297('0x23')](_0x54c4bf[_0xd297('0x22')],function(_0x48db45){return{'model':db[_0x48db45[_0xd297('0x24')]],'as':_0x48db45['as'],'attributes':_0x48db45[_0xd297('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd297('0xf')](function(_0x573dff){logger[_0xd297('0x18')](_0xd297('0x1b'),_0xe99c9a);logger[_0xd297('0x12')](_0xd297('0x1b'),_0xe99c9a,JSON[_0xd297('0x14')](_0x573dff));_0x1ea975(_0x573dff);})[_0xd297('0x1a')](function(_0x1f6a42){logger[_0xd297('0x15')]('GetOpenchannelQueue',_0x1f6a42['message'],_0xe99c9a);_0x469f78(_0x2754cf[_0xd297('0x15')](0x1f4,_0x1f6a42[_0xd297('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x1503fc){var _0x4969b0=this;return new Promise(function(_0x213fe1,_0x1e9ce8){return db[_0xd297('0x1c')]['find']({'raw':_0x1503fc[_0xd297('0x1e')]?_0x1503fc[_0xd297('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1503fc['options']?_0x1503fc[_0xd297('0x1e')][_0xd297('0x20')]||null:null,'attributes':_0x1503fc[_0xd297('0x1e')]?_0x1503fc[_0xd297('0x1e')]['attributes']||null:null,'include':_0x1503fc[_0xd297('0x1e')]?_0x1503fc[_0xd297('0x1e')][_0xd297('0x22')]?_[_0xd297('0x23')](_0x1503fc[_0xd297('0x1e')][_0xd297('0x22')],function(_0xd3df14){return{'model':db[_0xd3df14[_0xd297('0x24')]],'as':_0xd3df14['as'],'attributes':_0xd3df14[_0xd297('0x25')],'include':_0xd3df14[_0xd297('0x22')]?_[_0xd297('0x23')](_0xd3df14[_0xd297('0x22')],function(_0x5b04c1){return{'model':db[_0x5b04c1[_0xd297('0x24')]],'as':_0x5b04c1['as'],'attributes':_0x5b04c1[_0xd297('0x25')],'include':_0x5b04c1['include']?_[_0xd297('0x23')](_0x5b04c1[_0xd297('0x22')],function(_0x4b5442){return{'model':db[_0x4b5442['model']],'as':_0x4b5442['as'],'attributes':_0x4b5442[_0xd297('0x25')]};}):[]};}):[]};}):[]:[]})[_0xd297('0xf')](function(_0x354491){logger[_0xd297('0x18')](_0xd297('0x26'),_0x1503fc);logger['debug'](_0xd297('0x26'),_0x1503fc,JSON['stringify'](_0x354491));_0x213fe1(_0x354491);})['catch'](function(_0x17afa6){logger[_0xd297('0x15')]('ShowOpenchannelQueue',_0x17afa6[_0xd297('0x17')],_0x1503fc);_0x1e9ce8(_0x4969b0[_0xd297('0x15')](0x1f4,_0x17afa6[_0xd297('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 9826710..b5d176f 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 _0xa3b9=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x4a5651,_0x4dfb2c){var _0x31d763=function(_0x97f954){while(--_0x97f954){_0x4a5651['push'](_0x4a5651['shift']());}};_0x31d763(++_0x4dfb2c);}(_0xa3b9,0x6b));var _0x9a3b=function(_0xd3eacd,_0x2ea5e4){_0xd3eacd=_0xd3eacd-0x0;var _0x167660=_0xa3b9[_0xd3eacd];return _0x167660;};'use strict';var OpenchannelQueueEvents=require(_0x9a3b('0x0'));var events=[_0x9a3b('0x1'),_0x9a3b('0x2'),_0x9a3b('0x3')];function createListener(_0x57e47c,_0x5442dc){return function(_0xac2269){_0x5442dc[_0x9a3b('0x4')](_0x57e47c,_0xac2269);};}function removeListener(_0x19f6f2,_0x31b24d){return function(){OpenchannelQueueEvents['removeListener'](_0x19f6f2,_0x31b24d);};}exports[_0x9a3b('0x5')]=function(_0x5649a1){for(var _0x439762=0x0,_0x1b4480=events[_0x9a3b('0x6')];_0x439762<_0x1b4480;_0x439762++){var _0x198863=events[_0x439762];var _0x1ce8d5=createListener(_0x9a3b('0x7')+_0x198863,_0x5649a1);OpenchannelQueueEvents['on'](_0x198863,_0x1ce8d5);}}; \ No newline at end of file +var _0x4b31=['length','openchannelQueue:','save','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b31,0x1e5));var _0x14b3=function(_0x119f6a,_0x594d77){_0x119f6a=_0x119f6a-0x0;var _0x4c00a3=_0x4b31[_0x119f6a];return _0x4c00a3;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x14b3('0x0'),'remove',_0x14b3('0x1')];function createListener(_0x399723,_0x210b46){return function(_0x1e0bfa){_0x210b46[_0x14b3('0x2')](_0x399723,_0x1e0bfa);};}function removeListener(_0x264af7,_0x172457){return function(){OpenchannelQueueEvents[_0x14b3('0x3')](_0x264af7,_0x172457);};}exports[_0x14b3('0x4')]=function(_0x9f9585){for(var _0x14188d=0x0,_0x4c31cf=events[_0x14b3('0x5')];_0x14188d<_0x4c31cf;_0x14188d++){var _0x39aa6e=events[_0x14188d];var _0x2ad301=createListener(_0x14b3('0x6')+_0x39aa6e,_0x9f9585);OpenchannelQueueEvents['on'](_0x39aa6e,_0x2ad301);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index cb912c0..a89e7d2 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 _0x6bbc=['./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6bbc,0x115));var _0xc6bb=function(_0x4f4a07,_0x4ebd9d){_0x4f4a07=_0x4f4a07-0x0;var _0xc99fab=_0x6bbc[_0x4f4a07];return _0xc99fab;};'use strict';var multer=require(_0xc6bb('0x0'));var util=require(_0xc6bb('0x1'));var path=require(_0xc6bb('0x2'));var timeout=require(_0xc6bb('0x3'));var express=require(_0xc6bb('0x4'));var router=express[_0xc6bb('0x5')]();var fs_extra=require(_0xc6bb('0x6'));var auth=require(_0xc6bb('0x7'));var interaction=require(_0xc6bb('0x8'));var config=require('../../config/environment');var controller=require(_0xc6bb('0x9'));router[_0xc6bb('0xa')]('/',auth[_0xc6bb('0xb')](),controller['index']);router[_0xc6bb('0xa')](_0xc6bb('0xc'),auth[_0xc6bb('0xb')](),controller[_0xc6bb('0xd')]);router[_0xc6bb('0xa')]('/:id',auth[_0xc6bb('0xb')](),controller[_0xc6bb('0xe')]);router[_0xc6bb('0xf')]('/',auth[_0xc6bb('0xb')](),controller[_0xc6bb('0x10')]);router[_0xc6bb('0x11')]('/:id',auth[_0xc6bb('0xb')](),controller[_0xc6bb('0x12')]);router[_0xc6bb('0x13')](_0xc6bb('0x14'),auth[_0xc6bb('0xb')](),controller[_0xc6bb('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5f0f=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','delete','destroy','exports','util','express','Router','../../components/auth/service'];(function(_0xa5cc56,_0x482df1){var _0x52b569=function(_0x34be4c){while(--_0x34be4c){_0xa5cc56['push'](_0xa5cc56['shift']());}};_0x52b569(++_0x482df1);}(_0x5f0f,0xe6));var _0xf5f0=function(_0x866e1c,_0x549974){_0x866e1c=_0x866e1c-0x0;var _0x59697e=_0x5f0f[_0x866e1c];return _0x59697e;};'use strict';var multer=require('multer');var util=require(_0xf5f0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf5f0('0x1'));var router=express[_0xf5f0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf5f0('0x3'));var interaction=require(_0xf5f0('0x4'));var config=require(_0xf5f0('0x5'));var controller=require(_0xf5f0('0x6'));router[_0xf5f0('0x7')]('/',auth[_0xf5f0('0x8')](),controller[_0xf5f0('0x9')]);router[_0xf5f0('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf5f0('0xa')]);router[_0xf5f0('0x7')](_0xf5f0('0xb'),auth[_0xf5f0('0x8')](),controller['show']);router[_0xf5f0('0xc')]('/',auth[_0xf5f0('0x8')](),controller[_0xf5f0('0xd')]);router[_0xf5f0('0xe')](_0xf5f0('0xb'),auth[_0xf5f0('0x8')](),controller['update']);router[_0xf5f0('0xf')](_0xf5f0('0xb'),auth[_0xf5f0('0x8')](),controller[_0xf5f0('0x10')]);module[_0xf5f0('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 3e9f9cc..e51ecee 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 _0x57d8=['STRING','DATE','moment','sequelize','exports'];(function(_0x3c307c,_0x1b06c4){var _0x32cf08=function(_0x371144){while(--_0x371144){_0x3c307c['push'](_0x3c307c['shift']());}};_0x32cf08(++_0x1b06c4);}(_0x57d8,0x1e7));var _0x857d=function(_0x496652,_0x1ccdde){_0x496652=_0x496652-0x0;var _0x32f02c=_0x57d8[_0x496652];return _0x32f02c;};'use strict';var moment=require(_0x857d('0x0'));var Sequelize=require(_0x857d('0x1'));module[_0x857d('0x2')]={'uniqueid':{'type':Sequelize[_0x857d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x857d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x857d('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x857d('0x3')]}}; \ No newline at end of file +var _0xb7ff=['STRING','DATE','moment','exports'];(function(_0x545386,_0x23ea8e){var _0x310535=function(_0x479dd1){while(--_0x479dd1){_0x545386['push'](_0x545386['shift']());}};_0x310535(++_0x23ea8e);}(_0xb7ff,0x6e));var _0xfb7f=function(_0x40ae17,_0x423978){_0x40ae17=_0x40ae17-0x0;var _0x5b0efe=_0xb7ff[_0x40ae17];return _0x5b0efe;};'use strict';var moment=require(_0xfb7f('0x0'));var Sequelize=require('sequelize');module[_0xfb7f('0x1')]={'uniqueid':{'type':Sequelize[_0xfb7f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfb7f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfb7f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfb7f('0x3')]},'reason':{'type':Sequelize[_0xfb7f('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a146edc..1df263e 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 _0x91f2=['index','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filters','where','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','merge','create','body','update','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x31368f,_0x21735d){var _0x5c59f6=function(_0x1a7606){while(--_0x1a7606){_0x31368f['push'](_0x31368f['shift']());}};_0x5c59f6(++_0x21735d);}(_0x91f2,0x197));var _0x291f=function(_0x2e4d88,_0x288f33){_0x2e4d88=_0x2e4d88-0x0;var _0x1c6eb1=_0x91f2[_0x2e4d88];return _0x1c6eb1;};'use strict';var emlformat=require(_0x291f('0x0'));var rimraf=require(_0x291f('0x1'));var zipdir=require(_0x291f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x291f('0x3'));var BPromise=require(_0x291f('0x4'));var Mustache=require(_0x291f('0x5'));var util=require('util');var path=require(_0x291f('0x6'));var sox=require(_0x291f('0x7'));var csv=require('to-csv');var ejs=require(_0x291f('0x8'));var fs=require('fs');var fs_extra=require(_0x291f('0x9'));var _=require(_0x291f('0xa'));var squel=require(_0x291f('0xb'));var crypto=require(_0x291f('0xc'));var jsforce=require(_0x291f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x291f('0xe'));var querystring=require(_0x291f('0xf'));var Papa=require(_0x291f('0x10'));var Redis=require(_0x291f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x291f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x291f('0x13'));var utils=require(_0x291f('0x14'));var config=require(_0x291f('0x15'));var licenseUtil=require(_0x291f('0x16'));var db=require(_0x291f('0x17'))['db'];function respondWithStatusCode(_0x2979f4,_0x13a61e){_0x13a61e=_0x13a61e||0xcc;return function(_0x385c26){if(_0x385c26){return _0x2979f4[_0x291f('0x18')](_0x13a61e);}return _0x2979f4[_0x291f('0x19')](_0x13a61e)[_0x291f('0x1a')]();};}function respondWithResult(_0x58e3cd,_0x31594){_0x31594=_0x31594||0xc8;return function(_0x497082){if(_0x497082){return _0x58e3cd['status'](_0x31594)[_0x291f('0x1b')](_0x497082);}};}function respondWithFilteredResult(_0x1e374f,_0x4332f7){return function(_0x4a5e07){if(_0x4a5e07){var _0x5ccae0=typeof _0x4332f7[_0x291f('0x1c')]==='undefined'&&typeof _0x4332f7[_0x291f('0x1d')]===_0x291f('0x1e');var _0x53661e=_0x4a5e07[_0x291f('0x1f')];var _0x1787c2=_0x5ccae0?0x0:_0x4332f7[_0x291f('0x1c')];var _0x5104bd=_0x5ccae0?_0x4a5e07[_0x291f('0x1f')]:_0x4332f7[_0x291f('0x1c')]+_0x4332f7[_0x291f('0x1d')];var _0x6ab60f;if(_0x5104bd>=_0x53661e){_0x5104bd=_0x53661e;_0x6ab60f=0xc8;}else{_0x6ab60f=0xce;}_0x1e374f['status'](_0x6ab60f);return _0x1e374f[_0x291f('0x20')](_0x291f('0x21'),_0x1787c2+'-'+_0x5104bd+'/'+_0x53661e)[_0x291f('0x1b')](_0x4a5e07);}return null;};}function patchUpdates(_0x47ee4b){return function(_0x3a5893){try{jsonpatch[_0x291f('0x22')](_0x3a5893,_0x47ee4b,!![]);}catch(_0x48b622){return BPromise[_0x291f('0x23')](_0x48b622);}return _0x3a5893[_0x291f('0x24')]();};}function saveUpdates(_0x685662,_0x3a2bf1){return function(_0x33ca23){if(_0x33ca23){return _0x33ca23['update'](_0x685662)[_0x291f('0x25')](function(_0x5c6127){return _0x5c6127;});}return null;};}function removeEntity(_0x3ef69b,_0x23b607){return function(_0xe502bb){if(_0xe502bb){return _0xe502bb[_0x291f('0x26')]()[_0x291f('0x25')](function(){_0x3ef69b[_0x291f('0x19')](0xcc)[_0x291f('0x1a')]();});}};}function handleEntityNotFound(_0x19ff81,_0x635ad4){return function(_0x1247b0){if(!_0x1247b0){_0x19ff81[_0x291f('0x18')](0x194);}return _0x1247b0;};}function handleError(_0x458fd6,_0x35bc35){_0x35bc35=_0x35bc35||0x1f4;return function(_0x2523ed){logger[_0x291f('0x27')](_0x2523ed[_0x291f('0x28')]);if(_0x2523ed[_0x291f('0x29')]){delete _0x2523ed[_0x291f('0x29')];}_0x458fd6[_0x291f('0x19')](_0x35bc35)[_0x291f('0x2a')](_0x2523ed);};}exports[_0x291f('0x2b')]=function(_0x1f885c,_0x165d3f){var _0x2db58e={},_0x552268={},_0x27654c={'count':0x0,'rows':[]};var _0x3400a9=_['map'](db['OpenchannelQueueReport'][_0x291f('0x2c')],function(_0x32e31e){return{'name':_0x32e31e['fieldName'],'type':_0x32e31e[_0x291f('0x2d')]['key']};});_0x552268[_0x291f('0x2e')]=_[_0x291f('0x2f')](_0x3400a9,_0x291f('0x29'));_0x552268[_0x291f('0x30')]=_[_0x291f('0x31')](_0x1f885c[_0x291f('0x30')]);_0x552268['filters']=_[_0x291f('0x32')](_0x552268[_0x291f('0x2e')],_0x552268[_0x291f('0x30')]);_0x2db58e['attributes']=_[_0x291f('0x32')](_0x552268[_0x291f('0x2e')],qs[_0x291f('0x33')](_0x1f885c[_0x291f('0x30')][_0x291f('0x33')]));_0x2db58e[_0x291f('0x34')]=_0x2db58e[_0x291f('0x34')]['length']?_0x2db58e['attributes']:_0x552268[_0x291f('0x2e')];if(!_0x1f885c[_0x291f('0x30')][_0x291f('0x35')](_0x291f('0x36'))){_0x2db58e[_0x291f('0x1d')]=qs[_0x291f('0x1d')](_0x1f885c[_0x291f('0x30')][_0x291f('0x1d')]);_0x2db58e[_0x291f('0x1c')]=qs[_0x291f('0x1c')](_0x1f885c[_0x291f('0x30')]['offset']);}_0x2db58e['order']=qs[_0x291f('0x37')](_0x1f885c[_0x291f('0x30')]['sort']);_0x2db58e['where']=qs['filters'](_['pick'](_0x1f885c[_0x291f('0x30')],_0x552268[_0x291f('0x38')]),_0x3400a9);if(_0x1f885c['query']['filter']){_0x2db58e[_0x291f('0x39')]=_['merge'](_0x2db58e['where'],{'$or':_[_0x291f('0x2f')](_0x3400a9,function(_0x55b6c3){if(_0x55b6c3[_0x291f('0x2d')]!==_0x291f('0x3a')){var _0x5c88e3={};_0x5c88e3[_0x55b6c3[_0x291f('0x29')]]={'$like':'%'+_0x1f885c[_0x291f('0x30')][_0x291f('0x3b')]+'%'};return _0x5c88e3;}})});}_0x2db58e=_['merge']({},_0x2db58e,_0x1f885c[_0x291f('0x3c')]);var _0x4d8b09={'where':_0x2db58e[_0x291f('0x39')]};return db[_0x291f('0x3d')][_0x291f('0x1f')](_0x4d8b09)[_0x291f('0x25')](function(_0x1422f4){_0x27654c[_0x291f('0x1f')]=_0x1422f4;if(_0x1f885c[_0x291f('0x30')][_0x291f('0x3e')]){_0x2db58e[_0x291f('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x291f('0x40')](_0x2db58e);})[_0x291f('0x25')](function(_0x535de4){_0x27654c[_0x291f('0x41')]=_0x535de4;return _0x27654c;})[_0x291f('0x25')](respondWithFilteredResult(_0x165d3f,_0x2db58e))[_0x291f('0x42')](handleError(_0x165d3f,null));};exports[_0x291f('0x43')]=function(_0x228297,_0x3a469c){var _0x318481={'raw':!![],'where':{'id':_0x228297[_0x291f('0x44')]['id']}},_0xdcc576={};_0xdcc576[_0x291f('0x2e')]=_['keys'](db['OpenchannelQueueReport'][_0x291f('0x2c')]);_0xdcc576[_0x291f('0x30')]=_['keys'](_0x228297['query']);_0xdcc576[_0x291f('0x38')]=_['intersection'](_0xdcc576[_0x291f('0x2e')],_0xdcc576[_0x291f('0x30')]);_0x318481[_0x291f('0x34')]=_['intersection'](_0xdcc576[_0x291f('0x2e')],qs[_0x291f('0x33')](_0x228297[_0x291f('0x30')][_0x291f('0x33')]));_0x318481[_0x291f('0x34')]=_0x318481[_0x291f('0x34')]['length']?_0x318481[_0x291f('0x34')]:_0xdcc576[_0x291f('0x2e')];if(_0x228297[_0x291f('0x30')][_0x291f('0x3e')]){_0x318481[_0x291f('0x3f')]=[{'all':!![]}];}_0x318481=_[_0x291f('0x45')]({},_0x318481,_0x228297['options']);return db['OpenchannelQueueReport']['find'](_0x318481)[_0x291f('0x25')](handleEntityNotFound(_0x3a469c,null))['then'](respondWithResult(_0x3a469c,null))['catch'](handleError(_0x3a469c,null));};exports['create']=function(_0x36e5fd,_0x819a1){return db[_0x291f('0x3d')][_0x291f('0x46')](_0x36e5fd[_0x291f('0x47')],{})['then'](respondWithResult(_0x819a1,0xc9))[_0x291f('0x42')](handleError(_0x819a1,null));};exports[_0x291f('0x48')]=function(_0x3b3d72,_0x393f16){if(_0x3b3d72[_0x291f('0x47')]['id']){delete _0x3b3d72['body']['id'];}return db[_0x291f('0x3d')][_0x291f('0x49')]({'where':{'id':_0x3b3d72['params']['id']}})['then'](handleEntityNotFound(_0x393f16,null))[_0x291f('0x25')](saveUpdates(_0x3b3d72['body'],null))[_0x291f('0x25')](respondWithResult(_0x393f16,null))[_0x291f('0x42')](handleError(_0x393f16,null));};exports[_0x291f('0x26')]=function(_0x27b345,_0x1e6deb){return db[_0x291f('0x3d')]['find']({'where':{'id':_0x27b345[_0x291f('0x44')]['id']}})[_0x291f('0x25')](handleEntityNotFound(_0x1e6deb,null))[_0x291f('0x25')](removeEntity(_0x1e6deb,null))[_0x291f('0x42')](handleError(_0x1e6deb,null));};exports[_0x291f('0x4a')]=function(_0x2c31b2,_0x1e4254){return db['OpenchannelQueueReport'][_0x291f('0x4a')]()[_0x291f('0x25')](respondWithResult(_0x1e4254,null))[_0x291f('0x42')](handleError(_0x1e4254,null));}; \ No newline at end of file +var _0x8e02=['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','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','then','include','rows','catch','show','keys','fields','create','body','find','params','describe','eml-format'];(function(_0x4614fc,_0x379a38){var _0x103023=function(_0x4b27ca){while(--_0x4b27ca){_0x4614fc['push'](_0x4614fc['shift']());}};_0x103023(++_0x379a38);}(_0x8e02,0x176));var _0x28e0=function(_0x47ffcb,_0x11a91f){_0x47ffcb=_0x47ffcb-0x0;var _0x290416=_0x8e02[_0x47ffcb];return _0x290416;};'use strict';var emlformat=require(_0x28e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28e0('0x1'));var jsonpatch=require(_0x28e0('0x2'));var rp=require(_0x28e0('0x3'));var moment=require(_0x28e0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28e0('0x5'));var util=require(_0x28e0('0x6'));var path=require(_0x28e0('0x7'));var sox=require(_0x28e0('0x8'));var csv=require(_0x28e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28e0('0xa'));var _=require(_0x28e0('0xb'));var squel=require(_0x28e0('0xc'));var crypto=require(_0x28e0('0xd'));var jsforce=require(_0x28e0('0xe'));var deskjs=require(_0x28e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28e0('0x10'));var Papa=require(_0x28e0('0x11'));var Redis=require(_0x28e0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x28e0('0x13'));var as=require(_0x28e0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28e0('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x28e0('0x16'));var db=require(_0x28e0('0x17'))['db'];function respondWithStatusCode(_0x35fe27,_0x114081){_0x114081=_0x114081||0xcc;return function(_0x210ec6){if(_0x210ec6){return _0x35fe27['sendStatus'](_0x114081);}return _0x35fe27[_0x28e0('0x18')](_0x114081)[_0x28e0('0x19')]();};}function respondWithResult(_0x3c2507,_0x3f326c){_0x3f326c=_0x3f326c||0xc8;return function(_0x5edeac){if(_0x5edeac){return _0x3c2507[_0x28e0('0x18')](_0x3f326c)[_0x28e0('0x1a')](_0x5edeac);}};}function respondWithFilteredResult(_0x30f18f,_0x450364){return function(_0x19b633){if(_0x19b633){var _0x3b48c5=typeof _0x450364[_0x28e0('0x1b')]===_0x28e0('0x1c')&&typeof _0x450364['limit']==='undefined';var _0xf8a98f=_0x19b633[_0x28e0('0x1d')];var _0x270cae=_0x3b48c5?0x0:_0x450364['offset'];var _0x5c3ddf=_0x3b48c5?_0x19b633[_0x28e0('0x1d')]:_0x450364[_0x28e0('0x1b')]+_0x450364['limit'];var _0x279048;if(_0x5c3ddf>=_0xf8a98f){_0x5c3ddf=_0xf8a98f;_0x279048=0xc8;}else{_0x279048=0xce;}_0x30f18f[_0x28e0('0x18')](_0x279048);return _0x30f18f[_0x28e0('0x1e')](_0x28e0('0x1f'),_0x270cae+'-'+_0x5c3ddf+'/'+_0xf8a98f)[_0x28e0('0x1a')](_0x19b633);}return null;};}function patchUpdates(_0x1edcd9){return function(_0x4652c9){try{jsonpatch[_0x28e0('0x20')](_0x4652c9,_0x1edcd9,!![]);}catch(_0x5abd5b){return BPromise[_0x28e0('0x21')](_0x5abd5b);}return _0x4652c9[_0x28e0('0x22')]();};}function saveUpdates(_0x18ce7d,_0x5a5daa){return function(_0x210dbf){if(_0x210dbf){return _0x210dbf['update'](_0x18ce7d)['then'](function(_0x24c4a2){return _0x24c4a2;});}return null;};}function removeEntity(_0x283aed,_0x68ec08){return function(_0x45b8f3){if(_0x45b8f3){return _0x45b8f3[_0x28e0('0x23')]()['then'](function(){_0x283aed[_0x28e0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2df361,_0xac9057){return function(_0x3bffc2){if(!_0x3bffc2){_0x2df361[_0x28e0('0x24')](0x194);}return _0x3bffc2;};}function handleError(_0x5cc3b7,_0x13c8ed){_0x13c8ed=_0x13c8ed||0x1f4;return function(_0x25eed1){logger[_0x28e0('0x25')](_0x25eed1[_0x28e0('0x26')]);if(_0x25eed1[_0x28e0('0x27')]){delete _0x25eed1[_0x28e0('0x27')];}_0x5cc3b7[_0x28e0('0x18')](_0x13c8ed)['send'](_0x25eed1);};}exports[_0x28e0('0x28')]=function(_0x2ef604,_0x255f69){var _0x5a9358={},_0x5cbcac={},_0x9eaf2a={'count':0x0,'rows':[]};var _0x3cc3bf=_[_0x28e0('0x29')](db[_0x28e0('0x2a')][_0x28e0('0x2b')],function(_0xc048dd){return{'name':_0xc048dd[_0x28e0('0x2c')],'type':_0xc048dd[_0x28e0('0x2d')][_0x28e0('0x2e')]};});_0x5cbcac[_0x28e0('0x2f')]=_[_0x28e0('0x29')](_0x3cc3bf,_0x28e0('0x27'));_0x5cbcac['query']=_['keys'](_0x2ef604['query']);_0x5cbcac[_0x28e0('0x30')]=_[_0x28e0('0x31')](_0x5cbcac[_0x28e0('0x2f')],_0x5cbcac['query']);_0x5a9358[_0x28e0('0x32')]=_[_0x28e0('0x31')](_0x5cbcac[_0x28e0('0x2f')],qs['fields'](_0x2ef604[_0x28e0('0x33')]['fields']));_0x5a9358[_0x28e0('0x32')]=_0x5a9358[_0x28e0('0x32')][_0x28e0('0x34')]?_0x5a9358['attributes']:_0x5cbcac[_0x28e0('0x2f')];if(!_0x2ef604[_0x28e0('0x33')][_0x28e0('0x35')](_0x28e0('0x36'))){_0x5a9358[_0x28e0('0x37')]=qs[_0x28e0('0x37')](_0x2ef604[_0x28e0('0x33')]['limit']);_0x5a9358[_0x28e0('0x1b')]=qs['offset'](_0x2ef604[_0x28e0('0x33')][_0x28e0('0x1b')]);}_0x5a9358[_0x28e0('0x38')]=qs[_0x28e0('0x39')](_0x2ef604[_0x28e0('0x33')]['sort']);_0x5a9358[_0x28e0('0x3a')]=qs[_0x28e0('0x30')](_['pick'](_0x2ef604[_0x28e0('0x33')],_0x5cbcac[_0x28e0('0x30')]),_0x3cc3bf);if(_0x2ef604[_0x28e0('0x33')][_0x28e0('0x3b')]){_0x5a9358['where']=_[_0x28e0('0x3c')](_0x5a9358['where'],{'$or':_['map'](_0x3cc3bf,function(_0x119f19){if(_0x119f19[_0x28e0('0x2d')]!==_0x28e0('0x3d')){var _0x2fb32a={};_0x2fb32a[_0x119f19['name']]={'$like':'%'+_0x2ef604[_0x28e0('0x33')]['filter']+'%'};return _0x2fb32a;}})});}_0x5a9358=_['merge']({},_0x5a9358,_0x2ef604[_0x28e0('0x3e')]);var _0x551dd3={'where':_0x5a9358['where']};return db[_0x28e0('0x2a')][_0x28e0('0x1d')](_0x551dd3)[_0x28e0('0x3f')](function(_0x4db9bc){_0x9eaf2a[_0x28e0('0x1d')]=_0x4db9bc;if(_0x2ef604['query']['includeAll']){_0x5a9358[_0x28e0('0x40')]=[{'all':!![]}];}return db[_0x28e0('0x2a')]['findAll'](_0x5a9358);})['then'](function(_0x1ee111){_0x9eaf2a[_0x28e0('0x41')]=_0x1ee111;return _0x9eaf2a;})[_0x28e0('0x3f')](respondWithFilteredResult(_0x255f69,_0x5a9358))[_0x28e0('0x42')](handleError(_0x255f69,null));};exports[_0x28e0('0x43')]=function(_0x38cb9e,_0x5f0f80){var _0x4aec3e={'raw':!![],'where':{'id':_0x38cb9e['params']['id']}},_0x54dbf4={};_0x54dbf4[_0x28e0('0x2f')]=_[_0x28e0('0x44')](db[_0x28e0('0x2a')][_0x28e0('0x2b')]);_0x54dbf4[_0x28e0('0x33')]=_[_0x28e0('0x44')](_0x38cb9e[_0x28e0('0x33')]);_0x54dbf4[_0x28e0('0x30')]=_[_0x28e0('0x31')](_0x54dbf4[_0x28e0('0x2f')],_0x54dbf4[_0x28e0('0x33')]);_0x4aec3e['attributes']=_['intersection'](_0x54dbf4['model'],qs['fields'](_0x38cb9e['query'][_0x28e0('0x45')]));_0x4aec3e[_0x28e0('0x32')]=_0x4aec3e[_0x28e0('0x32')][_0x28e0('0x34')]?_0x4aec3e[_0x28e0('0x32')]:_0x54dbf4['model'];if(_0x38cb9e[_0x28e0('0x33')]['includeAll']){_0x4aec3e[_0x28e0('0x40')]=[{'all':!![]}];}_0x4aec3e=_[_0x28e0('0x3c')]({},_0x4aec3e,_0x38cb9e[_0x28e0('0x3e')]);return db[_0x28e0('0x2a')]['find'](_0x4aec3e)[_0x28e0('0x3f')](handleEntityNotFound(_0x5f0f80,null))[_0x28e0('0x3f')](respondWithResult(_0x5f0f80,null))[_0x28e0('0x42')](handleError(_0x5f0f80,null));};exports[_0x28e0('0x46')]=function(_0x3b495c,_0x4141ca){return db['OpenchannelQueueReport'][_0x28e0('0x46')](_0x3b495c[_0x28e0('0x47')],{})[_0x28e0('0x3f')](respondWithResult(_0x4141ca,0xc9))[_0x28e0('0x42')](handleError(_0x4141ca,null));};exports['update']=function(_0x3a00ac,_0x1e0013){if(_0x3a00ac[_0x28e0('0x47')]['id']){delete _0x3a00ac[_0x28e0('0x47')]['id'];}return db[_0x28e0('0x2a')][_0x28e0('0x48')]({'where':{'id':_0x3a00ac[_0x28e0('0x49')]['id']}})[_0x28e0('0x3f')](handleEntityNotFound(_0x1e0013,null))['then'](saveUpdates(_0x3a00ac[_0x28e0('0x47')],null))[_0x28e0('0x3f')](respondWithResult(_0x1e0013,null))['catch'](handleError(_0x1e0013,null));};exports['destroy']=function(_0x176e49,_0x4f9b0e){return db['OpenchannelQueueReport'][_0x28e0('0x48')]({'where':{'id':_0x176e49['params']['id']}})[_0x28e0('0x3f')](handleEntityNotFound(_0x4f9b0e,null))[_0x28e0('0x3f')](removeEntity(_0x4f9b0e,null))[_0x28e0('0x42')](handleError(_0x4f9b0e,null));};exports[_0x28e0('0x4a')]=function(_0x322c34,_0x1028db){return db[_0x28e0('0x2a')][_0x28e0('0x4a')]()['then'](respondWithResult(_0x1028db,null))[_0x28e0('0x42')](handleError(_0x1028db,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index bd3eaa4..2e0c79b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x3bda61,_0xc81b94){var _0x283361=function(_0x45605b){while(--_0x45605b){_0x3bda61['push'](_0x3bda61['shift']());}};_0x283361(++_0xc81b94);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x268da9,_0x38e619){var _0x3670c4=function(_0x186b01){while(--_0x186b01){_0x268da9['push'](_0x268da9['shift']());}};_0x3670c4(++_0x38e619);}(_0x1261,0x144));var _0x1126=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x1261[_0x1e05c1];return _0x15f1ca;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('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 71c035b..f78e8b5 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 _0xefda=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefda,0x96));var _0xaefd=function(_0x1636aa,_0x136a74){_0x1636aa=_0x1636aa-0x0;var _0x581f92=_0xefda[_0x1636aa];return _0x581f92;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['OpenchannelQueueReport'][_0xaefd('0x18')](_0x9748f4[_0xaefd('0x19')],{'raw':_0x9748f4[_0xaefd('0x1a')]?_0x9748f4[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![]})[_0xaefd('0xb')](function(_0x5282ed){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger[_0xaefd('0xd')](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5282ed));_0x2db61b(_0x5282ed);})['catch'](function(_0x479486){logger['error'](_0xaefd('0x17'),_0x479486[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1[_0xaefd('0x10')](0x1f4,_0x479486['message']));});});};exports[_0xaefd('0x1c')]=function(_0x4cd9b2){var _0x3deec8=this;return new Promise(function(_0x3caa99,_0x1a05eb){return db['OpenchannelQueueReport'][_0xaefd('0x1d')](_0x4cd9b2[_0xaefd('0x19')],{'raw':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cd9b2['options']?_0x4cd9b2[_0xaefd('0x1a')]['where']||null:null,'attributes':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')]['attributes']||null:null,'limit':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')]['limit']||null:null})[_0xaefd('0xb')](function(_0x114ec0){logger[_0xaefd('0x14')]('UpdateOpenchannelQueueReport',_0x4cd9b2);logger[_0xaefd('0xd')]('UpdateOpenchannelQueueReport',_0x4cd9b2,JSON[_0xaefd('0xf')](_0x114ec0));_0x3caa99(_0x114ec0);})['catch'](function(_0x4a1acb){logger[_0xaefd('0x10')](_0xaefd('0x1c'),_0x4a1acb['message'],_0x4cd9b2);_0x1a05eb(_0x3deec8['error'](0x1f4,_0x4a1acb['message']));});});}; \ No newline at end of file +var _0xa32b=['OpenchannelQueueReport','create','body','CreateOpenchannelQueueReport','stringify','options','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x10b26f,_0x29dfe8){var _0x4acf85=function(_0x184d40){while(--_0x184d40){_0x10b26f['push'](_0x10b26f['shift']());}};_0x4acf85(++_0x29dfe8);}(_0xa32b,0x68));var _0xba32=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0xa32b[_0x544b3f];return _0x15787f;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var moment=require(_0xba32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba32('0x2'));var db=require(_0xba32('0x3'))['db'];var utils=require(_0xba32('0x4'));var logger=require('../../config/logger')(_0xba32('0x5'));var config=require(_0xba32('0x6'));var jayson=require(_0xba32('0x7'));var client=jayson[_0xba32('0x8')][_0xba32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a59,_0x1b1332,_0x4edbc6){return new BPromise(function(_0xcdcc5b,_0x13395b){return client[_0xba32('0xa')](_0x5c5a59,_0x4edbc6)[_0xba32('0xb')](function(_0x5d8f64){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b1332,'request\x20sent');logger[_0xba32('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'),JSON['stringify'](_0x5d8f64));if(_0x5d8f64[_0xba32('0xe')]){if(_0x5d8f64['error']['code']===0x1f4){logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0x13395b(_0x5d8f64[_0xba32('0xe')]['message']);}logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0xcdcc5b(_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);}else{logger[_0xba32('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'));_0xcdcc5b(_0x5d8f64[_0xba32('0x12')][_0xba32('0x10')]);}})[_0xba32('0x13')](function(_0x310dee){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b1332,_0x310dee);_0x13395b(_0x310dee);});});}exports['CreateOpenchannelQueueReport']=function(_0x5c3fe6){var _0x234db9=this;return new Promise(function(_0x1ae3ea,_0x42803d){return db[_0xba32('0x14')][_0xba32('0x15')](_0x5c3fe6[_0xba32('0x16')],{'raw':_0x5c3fe6['options']?_0x5c3fe6['options']['raw']===undefined?!![]:![]:!![]})[_0xba32('0xb')](function(_0x51c43a){logger[_0xba32('0x11')](_0xba32('0x17'),_0x5c3fe6);logger[_0xba32('0xc')](_0xba32('0x17'),_0x5c3fe6,JSON[_0xba32('0x18')](_0x51c43a));_0x1ae3ea(_0x51c43a);})[_0xba32('0x13')](function(_0xdfa807){logger['error'](_0xba32('0x17'),_0xdfa807[_0xba32('0x10')],_0x5c3fe6);_0x42803d(_0x234db9[_0xba32('0xe')](0x1f4,_0xdfa807[_0xba32('0x10')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4b03a5){var _0x2f3318=this;return new Promise(function(_0x3a8f30,_0x4cfd59){return db[_0xba32('0x14')]['update'](_0x4b03a5[_0xba32('0x16')],{'raw':_0x4b03a5[_0xba32('0x19')]?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b03a5[_0xba32('0x19')]?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1b')]||null:null,'attributes':_0x4b03a5['options']?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1c')]||null:null,'limit':_0x4b03a5[_0xba32('0x19')]?_0x4b03a5[_0xba32('0x19')][_0xba32('0x1d')]||null:null})[_0xba32('0xb')](function(_0x27bc6f){logger[_0xba32('0x11')](_0xba32('0x1e'),_0x4b03a5);logger['debug'](_0xba32('0x1e'),_0x4b03a5,JSON[_0xba32('0x18')](_0x27bc6f));_0x3a8f30(_0x27bc6f);})[_0xba32('0x13')](function(_0x2a466e){logger[_0xba32('0xe')]('UpdateOpenchannelQueueReport',_0x2a466e[_0xba32('0x10')],_0x4b03a5);_0x4cfd59(_0x2f3318['error'](0x1f4,_0x2a466e[_0xba32('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 800d943..876aa85 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 _0x47df=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','exports','multer','path'];(function(_0x4dd23f,_0x37910f){var _0x565bd0=function(_0x5629b7){while(--_0x5629b7){_0x4dd23f['push'](_0x4dd23f['shift']());}};_0x565bd0(++_0x37910f);}(_0x47df,0x108));var _0xf47d=function(_0x4f49a7,_0x1606f8){_0x4f49a7=_0x4f49a7-0x0;var _0x2687d0=_0x47df[_0x4f49a7];return _0x2687d0;};'use strict';var multer=require(_0xf47d('0x0'));var util=require('util');var path=require(_0xf47d('0x1'));var timeout=require(_0xf47d('0x2'));var express=require(_0xf47d('0x3'));var router=express['Router']();var fs_extra=require(_0xf47d('0x4'));var auth=require(_0xf47d('0x5'));var interaction=require(_0xf47d('0x6'));var config=require(_0xf47d('0x7'));var controller=require(_0xf47d('0x8'));router[_0xf47d('0x9')]('/',auth[_0xf47d('0xa')](),controller[_0xf47d('0xb')]);router['get'](_0xf47d('0xc'),auth[_0xf47d('0xa')](),controller[_0xf47d('0xd')]);router[_0xf47d('0x9')](_0xf47d('0xe'),auth['isAuthenticated'](),controller[_0xf47d('0xf')]);router['post']('/',auth[_0xf47d('0xa')](),controller['create']);router[_0xf47d('0x10')](_0xf47d('0xe'),auth[_0xf47d('0xa')](),controller[_0xf47d('0x11')]);router['delete'](_0xf47d('0xe'),auth[_0xf47d('0xa')](),controller['destroy']);module[_0xf47d('0x12')]=router; \ No newline at end of file +var _0xc26e=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc26e,0x154));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xec26('0x0'));var util=require('util');var path=require(_0xec26('0x1'));var timeout=require(_0xec26('0x2'));var express=require(_0xec26('0x3'));var router=express['Router']();var fs_extra=require(_0xec26('0x4'));var auth=require(_0xec26('0x5'));var interaction=require(_0xec26('0x6'));var config=require(_0xec26('0x7'));var controller=require(_0xec26('0x8'));router['get']('/',auth[_0xec26('0x9')](),controller[_0xec26('0xa')]);router[_0xec26('0xb')]('/describe',auth[_0xec26('0x9')](),controller[_0xec26('0xc')]);router[_0xec26('0xb')](_0xec26('0xd'),auth[_0xec26('0x9')](),controller[_0xec26('0xe')]);router['post']('/',auth[_0xec26('0x9')](),controller[_0xec26('0xf')]);router[_0xec26('0x10')]('/:id',auth[_0xec26('0x9')](),controller[_0xec26('0x11')]);router[_0xec26('0x12')](_0xec26('0xd'),auth['isAuthenticated'](),controller[_0xec26('0x13')]);module[_0xec26('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 194df44..03225bb 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2e2844,_0x58a17f){var _0x28677=function(_0x29986b){while(--_0x29986b){_0x2e2844['push'](_0x2e2844['shift']());}};_0x28677(++_0x58a17f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xcb91[_0x13137e];return _0x346261;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2d4a07,_0x2e1f4d){var _0x43f637=function(_0x2992cf){while(--_0x2992cf){_0x2d4a07['push'](_0x2d4a07['shift']());}};_0x43f637(++_0x2e1f4d);}(_0x34e8,0x12c));var _0x834e=function(_0x2aff7d,_0x456060){_0x2aff7d=_0x2aff7d-0x0;var _0x38c992=_0x34e8[_0x2aff7d];return _0x38c992;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 938946a..c0336db 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 _0xbcaa=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','OpenchannelTransferReport','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x1dd332,_0x252d90){var _0x558a3a=function(_0x6ab5a6){while(--_0x6ab5a6){_0x1dd332['push'](_0x1dd332['shift']());}};_0x558a3a(++_0x252d90);}(_0xbcaa,0x128));var _0xabca=function(_0x4f5649,_0x358cf8){_0x4f5649=_0x4f5649-0x0;var _0x3a2d62=_0xbcaa[_0x4f5649];return _0x3a2d62;};'use strict';var emlformat=require(_0xabca('0x0'));var rimraf=require(_0xabca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabca('0x2'));var rp=require(_0xabca('0x3'));var moment=require(_0xabca('0x4'));var BPromise=require(_0xabca('0x5'));var Mustache=require(_0xabca('0x6'));var util=require(_0xabca('0x7'));var path=require('path');var sox=require(_0xabca('0x8'));var csv=require(_0xabca('0x9'));var ejs=require(_0xabca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabca('0xb'));var squel=require(_0xabca('0xc'));var crypto=require(_0xabca('0xd'));var jsforce=require(_0xabca('0xe'));var deskjs=require(_0xabca('0xf'));var toCsv=require(_0xabca('0x9'));var querystring=require(_0xabca('0x10'));var Papa=require('papaparse');var Redis=require(_0xabca('0x11'));var authService=require(_0xabca('0x12'));var qs=require(_0xabca('0x13'));var as=require(_0xabca('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xabca('0x15'));var utils=require(_0xabca('0x16'));var config=require(_0xabca('0x17'));var licenseUtil=require(_0xabca('0x18'));var db=require(_0xabca('0x19'))['db'];function respondWithStatusCode(_0x3680cb,_0x232ee5){_0x232ee5=_0x232ee5||0xcc;return function(_0x3c0e4a){if(_0x3c0e4a){return _0x3680cb[_0xabca('0x1a')](_0x232ee5);}return _0x3680cb['status'](_0x232ee5)[_0xabca('0x1b')]();};}function respondWithResult(_0x327d6e,_0x5ab10e){_0x5ab10e=_0x5ab10e||0xc8;return function(_0x93a8f7){if(_0x93a8f7){return _0x327d6e[_0xabca('0x1c')](_0x5ab10e)[_0xabca('0x1d')](_0x93a8f7);}};}function respondWithFilteredResult(_0x409089,_0x52ee59){return function(_0x4b06d1){if(_0x4b06d1){var _0x2ab475=typeof _0x52ee59[_0xabca('0x1e')]===_0xabca('0x1f')&&typeof _0x52ee59[_0xabca('0x20')]===_0xabca('0x1f');var _0x1c1cba=_0x4b06d1['count'];var _0x1960a4=_0x2ab475?0x0:_0x52ee59[_0xabca('0x1e')];var _0x5f07b0=_0x2ab475?_0x4b06d1[_0xabca('0x21')]:_0x52ee59[_0xabca('0x1e')]+_0x52ee59[_0xabca('0x20')];var _0x42d23c;if(_0x5f07b0>=_0x1c1cba){_0x5f07b0=_0x1c1cba;_0x42d23c=0xc8;}else{_0x42d23c=0xce;}_0x409089[_0xabca('0x1c')](_0x42d23c);return _0x409089[_0xabca('0x22')](_0xabca('0x23'),_0x1960a4+'-'+_0x5f07b0+'/'+_0x1c1cba)[_0xabca('0x1d')](_0x4b06d1);}return null;};}function patchUpdates(_0x5c8ecd){return function(_0x5eea59){try{jsonpatch[_0xabca('0x24')](_0x5eea59,_0x5c8ecd,!![]);}catch(_0x30428f){return BPromise['reject'](_0x30428f);}return _0x5eea59[_0xabca('0x25')]();};}function saveUpdates(_0x1a774e,_0xd1c286){return function(_0x41f2b0){if(_0x41f2b0){return _0x41f2b0[_0xabca('0x26')](_0x1a774e)[_0xabca('0x27')](function(_0x47c2ac){return _0x47c2ac;});}return null;};}function removeEntity(_0xba0e21,_0x10536a){return function(_0x4ab51b){if(_0x4ab51b){return _0x4ab51b[_0xabca('0x28')]()[_0xabca('0x27')](function(){_0xba0e21[_0xabca('0x1c')](0xcc)[_0xabca('0x1b')]();});}};}function handleEntityNotFound(_0x58054f,_0x69aa21){return function(_0x2bfb20){if(!_0x2bfb20){_0x58054f['sendStatus'](0x194);}return _0x2bfb20;};}function handleError(_0x347e10,_0x459660){_0x459660=_0x459660||0x1f4;return function(_0x54b1e6){logger[_0xabca('0x29')](_0x54b1e6[_0xabca('0x2a')]);if(_0x54b1e6[_0xabca('0x2b')]){delete _0x54b1e6[_0xabca('0x2b')];}_0x347e10[_0xabca('0x1c')](_0x459660)[_0xabca('0x2c')](_0x54b1e6);};}exports[_0xabca('0x2d')]=function(_0x418540,_0x23c4a4){var _0x2d199f={},_0x64a09c={},_0x4c7422={'count':0x0,'rows':[]};var _0x54329d=_['map'](db['OpenchannelTransferReport'][_0xabca('0x2e')],function(_0xb9948){return{'name':_0xb9948[_0xabca('0x2f')],'type':_0xb9948[_0xabca('0x30')][_0xabca('0x31')]};});_0x64a09c[_0xabca('0x32')]=_['map'](_0x54329d,_0xabca('0x2b'));_0x64a09c['query']=_[_0xabca('0x33')](_0x418540[_0xabca('0x34')]);_0x64a09c['filters']=_[_0xabca('0x35')](_0x64a09c[_0xabca('0x32')],_0x64a09c['query']);_0x2d199f[_0xabca('0x36')]=_[_0xabca('0x35')](_0x64a09c[_0xabca('0x32')],qs['fields'](_0x418540[_0xabca('0x34')][_0xabca('0x37')]));_0x2d199f[_0xabca('0x36')]=_0x2d199f[_0xabca('0x36')][_0xabca('0x38')]?_0x2d199f['attributes']:_0x64a09c[_0xabca('0x32')];if(!_0x418540[_0xabca('0x34')][_0xabca('0x39')](_0xabca('0x3a'))){_0x2d199f[_0xabca('0x20')]=qs[_0xabca('0x20')](_0x418540['query']['limit']);_0x2d199f['offset']=qs[_0xabca('0x1e')](_0x418540['query'][_0xabca('0x1e')]);}_0x2d199f[_0xabca('0x3b')]=qs[_0xabca('0x3c')](_0x418540['query'][_0xabca('0x3c')]);_0x2d199f['where']=qs[_0xabca('0x3d')](_[_0xabca('0x3e')](_0x418540[_0xabca('0x34')],_0x64a09c[_0xabca('0x3d')]),_0x54329d);if(_0x418540[_0xabca('0x34')][_0xabca('0x3f')]){_0x2d199f[_0xabca('0x40')]=_[_0xabca('0x41')](_0x2d199f[_0xabca('0x40')],{'$or':_[_0xabca('0x42')](_0x54329d,function(_0x13e391){if(_0x13e391['type']!==_0xabca('0x43')){var _0x150053={};_0x150053[_0x13e391[_0xabca('0x2b')]]={'$like':'%'+_0x418540[_0xabca('0x34')][_0xabca('0x3f')]+'%'};return _0x150053;}})});}_0x2d199f=_[_0xabca('0x41')]({},_0x2d199f,_0x418540[_0xabca('0x44')]);var _0x41e61b={'where':_0x2d199f[_0xabca('0x40')]};return db['OpenchannelTransferReport'][_0xabca('0x21')](_0x41e61b)[_0xabca('0x27')](function(_0x807e7d){_0x4c7422[_0xabca('0x21')]=_0x807e7d;if(_0x418540['query'][_0xabca('0x45')]){_0x2d199f[_0xabca('0x46')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xabca('0x47')](_0x2d199f);})['then'](function(_0x488be3){_0x4c7422[_0xabca('0x48')]=_0x488be3;return _0x4c7422;})[_0xabca('0x27')](respondWithFilteredResult(_0x23c4a4,_0x2d199f))[_0xabca('0x49')](handleError(_0x23c4a4,null));};exports['show']=function(_0x20aa64,_0x181274){var _0x10e16f={'raw':!![],'where':{'id':_0x20aa64[_0xabca('0x4a')]['id']}},_0xa67b17={};_0xa67b17[_0xabca('0x32')]=_[_0xabca('0x33')](db['OpenchannelTransferReport'][_0xabca('0x2e')]);_0xa67b17[_0xabca('0x34')]=_[_0xabca('0x33')](_0x20aa64[_0xabca('0x34')]);_0xa67b17[_0xabca('0x3d')]=_[_0xabca('0x35')](_0xa67b17[_0xabca('0x32')],_0xa67b17[_0xabca('0x34')]);_0x10e16f[_0xabca('0x36')]=_[_0xabca('0x35')](_0xa67b17[_0xabca('0x32')],qs['fields'](_0x20aa64[_0xabca('0x34')][_0xabca('0x37')]));_0x10e16f['attributes']=_0x10e16f[_0xabca('0x36')]['length']?_0x10e16f[_0xabca('0x36')]:_0xa67b17[_0xabca('0x32')];if(_0x20aa64[_0xabca('0x34')][_0xabca('0x45')]){_0x10e16f[_0xabca('0x46')]=[{'all':!![]}];}_0x10e16f=_[_0xabca('0x41')]({},_0x10e16f,_0x20aa64[_0xabca('0x44')]);return db[_0xabca('0x4b')][_0xabca('0x4c')](_0x10e16f)[_0xabca('0x27')](handleEntityNotFound(_0x181274,null))[_0xabca('0x27')](respondWithResult(_0x181274,null))[_0xabca('0x49')](handleError(_0x181274,null));};exports[_0xabca('0x4d')]=function(_0x14ed4e,_0x465718){return db[_0xabca('0x4b')][_0xabca('0x4d')](_0x14ed4e['body'],{})[_0xabca('0x27')](respondWithResult(_0x465718,0xc9))[_0xabca('0x49')](handleError(_0x465718,null));};exports[_0xabca('0x26')]=function(_0x284922,_0x3dcdc3){if(_0x284922[_0xabca('0x4e')]['id']){delete _0x284922[_0xabca('0x4e')]['id'];}return db[_0xabca('0x4b')][_0xabca('0x4c')]({'where':{'id':_0x284922['params']['id']}})[_0xabca('0x27')](handleEntityNotFound(_0x3dcdc3,null))[_0xabca('0x27')](saveUpdates(_0x284922[_0xabca('0x4e')],null))[_0xabca('0x27')](respondWithResult(_0x3dcdc3,null))[_0xabca('0x49')](handleError(_0x3dcdc3,null));};exports['destroy']=function(_0x3baf14,_0x2e5ae1){return db[_0xabca('0x4b')]['find']({'where':{'id':_0x3baf14[_0xabca('0x4a')]['id']}})[_0xabca('0x27')](handleEntityNotFound(_0x2e5ae1,null))[_0xabca('0x27')](removeEntity(_0x2e5ae1,null))[_0xabca('0x49')](handleError(_0x2e5ae1,null));};exports[_0xabca('0x4f')]=function(_0x19b933,_0x38c3b2){return db['OpenchannelTransferReport'][_0xabca('0x4f')]()[_0xabca('0x27')](respondWithResult(_0x38c3b2,null))[_0xabca('0x49')](handleError(_0x38c3b2,null));}; \ No newline at end of file +var _0x0e1a=['count','limit','Content-Range','apply','update','destroy','then','end','stack','name','send','index','map','OpenchannelTransferReport','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','findAll','show','keys','rawAttributes','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x579674,_0x5a143d){var _0x17f68a=function(_0x5c9204){while(--_0x5c9204){_0x579674['push'](_0x579674['shift']());}};_0x17f68a(++_0x5a143d);}(_0x0e1a,0x1e1));var _0xa0e1=function(_0x91ec86,_0x3010f0){_0x91ec86=_0x91ec86-0x0;var _0x2ea58d=_0x0e1a[_0x91ec86];return _0x2ea58d;};'use strict';var emlformat=require(_0xa0e1('0x0'));var rimraf=require(_0xa0e1('0x1'));var zipdir=require(_0xa0e1('0x2'));var jsonpatch=require(_0xa0e1('0x3'));var rp=require('request-promise');var moment=require(_0xa0e1('0x4'));var BPromise=require(_0xa0e1('0x5'));var Mustache=require(_0xa0e1('0x6'));var util=require('util');var path=require(_0xa0e1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0e1('0x8'));var squel=require('squel');var crypto=require(_0xa0e1('0x9'));var jsforce=require(_0xa0e1('0xa'));var deskjs=require(_0xa0e1('0xb'));var toCsv=require(_0xa0e1('0xc'));var querystring=require(_0xa0e1('0xd'));var Papa=require(_0xa0e1('0xe'));var Redis=require(_0xa0e1('0xf'));var authService=require(_0xa0e1('0x10'));var qs=require(_0xa0e1('0x11'));var as=require(_0xa0e1('0x12'));var hardwareService=require(_0xa0e1('0x13'));var logger=require(_0xa0e1('0x14'))(_0xa0e1('0x15'));var utils=require(_0xa0e1('0x16'));var config=require(_0xa0e1('0x17'));var licenseUtil=require(_0xa0e1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30a83d,_0x3ab8e2){_0x3ab8e2=_0x3ab8e2||0xcc;return function(_0x4d89b7){if(_0x4d89b7){return _0x30a83d[_0xa0e1('0x19')](_0x3ab8e2);}return _0x30a83d[_0xa0e1('0x1a')](_0x3ab8e2)['end']();};}function respondWithResult(_0x128c7b,_0x42a10a){_0x42a10a=_0x42a10a||0xc8;return function(_0x25631b){if(_0x25631b){return _0x128c7b[_0xa0e1('0x1a')](_0x42a10a)[_0xa0e1('0x1b')](_0x25631b);}};}function respondWithFilteredResult(_0x46657c,_0x548e15){return function(_0x5cd3fd){if(_0x5cd3fd){var _0x589b5d=typeof _0x548e15[_0xa0e1('0x1c')]===_0xa0e1('0x1d')&&typeof _0x548e15['limit']==='undefined';var _0x2db350=_0x5cd3fd[_0xa0e1('0x1e')];var _0x5d5310=_0x589b5d?0x0:_0x548e15[_0xa0e1('0x1c')];var _0x4c6191=_0x589b5d?_0x5cd3fd[_0xa0e1('0x1e')]:_0x548e15[_0xa0e1('0x1c')]+_0x548e15[_0xa0e1('0x1f')];var _0x2a3ece;if(_0x4c6191>=_0x2db350){_0x4c6191=_0x2db350;_0x2a3ece=0xc8;}else{_0x2a3ece=0xce;}_0x46657c[_0xa0e1('0x1a')](_0x2a3ece);return _0x46657c['set'](_0xa0e1('0x20'),_0x5d5310+'-'+_0x4c6191+'/'+_0x2db350)[_0xa0e1('0x1b')](_0x5cd3fd);}return null;};}function patchUpdates(_0x4e4427){return function(_0x31268f){try{jsonpatch[_0xa0e1('0x21')](_0x31268f,_0x4e4427,!![]);}catch(_0x5f1bfa){return BPromise['reject'](_0x5f1bfa);}return _0x31268f['save']();};}function saveUpdates(_0x3a3cf3,_0x9703c){return function(_0x1c2566){if(_0x1c2566){return _0x1c2566[_0xa0e1('0x22')](_0x3a3cf3)['then'](function(_0x102020){return _0x102020;});}return null;};}function removeEntity(_0x4b6641,_0x2742e2){return function(_0x5ae46c){if(_0x5ae46c){return _0x5ae46c[_0xa0e1('0x23')]()[_0xa0e1('0x24')](function(){_0x4b6641[_0xa0e1('0x1a')](0xcc)[_0xa0e1('0x25')]();});}};}function handleEntityNotFound(_0x1bb1fc,_0x3de151){return function(_0x4b660b){if(!_0x4b660b){_0x1bb1fc[_0xa0e1('0x19')](0x194);}return _0x4b660b;};}function handleError(_0x5e571c,_0x2b26d3){_0x2b26d3=_0x2b26d3||0x1f4;return function(_0x3fb880){logger['error'](_0x3fb880[_0xa0e1('0x26')]);if(_0x3fb880['name']){delete _0x3fb880[_0xa0e1('0x27')];}_0x5e571c[_0xa0e1('0x1a')](_0x2b26d3)[_0xa0e1('0x28')](_0x3fb880);};}exports[_0xa0e1('0x29')]=function(_0x2f82dc,_0x258e89){var _0x11c686={},_0x18e24c={},_0x3adad8={'count':0x0,'rows':[]};var _0x60eb95=_[_0xa0e1('0x2a')](db[_0xa0e1('0x2b')]['rawAttributes'],function(_0x281d4c){return{'name':_0x281d4c[_0xa0e1('0x2c')],'type':_0x281d4c['type'][_0xa0e1('0x2d')]};});_0x18e24c[_0xa0e1('0x2e')]=_[_0xa0e1('0x2a')](_0x60eb95,_0xa0e1('0x27'));_0x18e24c['query']=_['keys'](_0x2f82dc[_0xa0e1('0x2f')]);_0x18e24c[_0xa0e1('0x30')]=_[_0xa0e1('0x31')](_0x18e24c[_0xa0e1('0x2e')],_0x18e24c[_0xa0e1('0x2f')]);_0x11c686['attributes']=_[_0xa0e1('0x31')](_0x18e24c['model'],qs[_0xa0e1('0x32')](_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x32')]));_0x11c686[_0xa0e1('0x33')]=_0x11c686[_0xa0e1('0x33')][_0xa0e1('0x34')]?_0x11c686['attributes']:_0x18e24c[_0xa0e1('0x2e')];if(!_0x2f82dc['query']['hasOwnProperty'](_0xa0e1('0x35'))){_0x11c686[_0xa0e1('0x1f')]=qs[_0xa0e1('0x1f')](_0x2f82dc['query'][_0xa0e1('0x1f')]);_0x11c686[_0xa0e1('0x1c')]=qs[_0xa0e1('0x1c')](_0x2f82dc[_0xa0e1('0x2f')]['offset']);}_0x11c686[_0xa0e1('0x36')]=qs['sort'](_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x37')]);_0x11c686[_0xa0e1('0x38')]=qs['filters'](_['pick'](_0x2f82dc['query'],_0x18e24c['filters']),_0x60eb95);if(_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x39')]){_0x11c686[_0xa0e1('0x38')]=_[_0xa0e1('0x3a')](_0x11c686['where'],{'$or':_['map'](_0x60eb95,function(_0x8b54ae){if(_0x8b54ae[_0xa0e1('0x3b')]!=='VIRTUAL'){var _0x378d3f={};_0x378d3f[_0x8b54ae['name']]={'$like':'%'+_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x39')]+'%'};return _0x378d3f;}})});}_0x11c686=_['merge']({},_0x11c686,_0x2f82dc[_0xa0e1('0x3c')]);var _0x9ee831={'where':_0x11c686['where']};return db[_0xa0e1('0x2b')][_0xa0e1('0x1e')](_0x9ee831)['then'](function(_0x3fb9fe){_0x3adad8[_0xa0e1('0x1e')]=_0x3fb9fe;if(_0x2f82dc[_0xa0e1('0x2f')][_0xa0e1('0x3d')]){_0x11c686['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa0e1('0x3e')](_0x11c686);})[_0xa0e1('0x24')](function(_0x385263){_0x3adad8['rows']=_0x385263;return _0x3adad8;})[_0xa0e1('0x24')](respondWithFilteredResult(_0x258e89,_0x11c686))['catch'](handleError(_0x258e89,null));};exports[_0xa0e1('0x3f')]=function(_0x1f2e37,_0x2d2b4c){var _0x8addac={'raw':!![],'where':{'id':_0x1f2e37['params']['id']}},_0x25bfd9={};_0x25bfd9[_0xa0e1('0x2e')]=_[_0xa0e1('0x40')](db[_0xa0e1('0x2b')][_0xa0e1('0x41')]);_0x25bfd9[_0xa0e1('0x2f')]=_[_0xa0e1('0x40')](_0x1f2e37[_0xa0e1('0x2f')]);_0x25bfd9['filters']=_[_0xa0e1('0x31')](_0x25bfd9[_0xa0e1('0x2e')],_0x25bfd9[_0xa0e1('0x2f')]);_0x8addac[_0xa0e1('0x33')]=_[_0xa0e1('0x31')](_0x25bfd9[_0xa0e1('0x2e')],qs[_0xa0e1('0x32')](_0x1f2e37[_0xa0e1('0x2f')]['fields']));_0x8addac[_0xa0e1('0x33')]=_0x8addac[_0xa0e1('0x33')][_0xa0e1('0x34')]?_0x8addac[_0xa0e1('0x33')]:_0x25bfd9['model'];if(_0x1f2e37[_0xa0e1('0x2f')][_0xa0e1('0x3d')]){_0x8addac[_0xa0e1('0x42')]=[{'all':!![]}];}_0x8addac=_[_0xa0e1('0x3a')]({},_0x8addac,_0x1f2e37['options']);return db[_0xa0e1('0x2b')][_0xa0e1('0x43')](_0x8addac)['then'](handleEntityNotFound(_0x2d2b4c,null))[_0xa0e1('0x24')](respondWithResult(_0x2d2b4c,null))[_0xa0e1('0x44')](handleError(_0x2d2b4c,null));};exports['create']=function(_0x35e156,_0x5e868b){return db[_0xa0e1('0x2b')][_0xa0e1('0x45')](_0x35e156[_0xa0e1('0x46')],{})['then'](respondWithResult(_0x5e868b,0xc9))[_0xa0e1('0x44')](handleError(_0x5e868b,null));};exports[_0xa0e1('0x22')]=function(_0x17c029,_0x86b5e8){if(_0x17c029[_0xa0e1('0x46')]['id']){delete _0x17c029[_0xa0e1('0x46')]['id'];}return db['OpenchannelTransferReport'][_0xa0e1('0x43')]({'where':{'id':_0x17c029[_0xa0e1('0x47')]['id']}})['then'](handleEntityNotFound(_0x86b5e8,null))[_0xa0e1('0x24')](saveUpdates(_0x17c029[_0xa0e1('0x46')],null))[_0xa0e1('0x24')](respondWithResult(_0x86b5e8,null))[_0xa0e1('0x44')](handleError(_0x86b5e8,null));};exports[_0xa0e1('0x23')]=function(_0x255966,_0x16378e){return db[_0xa0e1('0x2b')]['find']({'where':{'id':_0x255966[_0xa0e1('0x47')]['id']}})[_0xa0e1('0x24')](handleEntityNotFound(_0x16378e,null))['then'](removeEntity(_0x16378e,null))[_0xa0e1('0x44')](handleError(_0x16378e,null));};exports['describe']=function(_0x132a2e,_0x33f14b){return db[_0xa0e1('0x2b')][_0xa0e1('0x48')]()[_0xa0e1('0x24')](respondWithResult(_0x33f14b,null))['catch'](handleError(_0x33f14b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a8089ff..7b82879 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 _0xb04a=['util','api','moment','bluebird','path','OpenchannelTransferReport','uniqueid'];(function(_0x55e150,_0x4a4f8b){var _0xb957bc=function(_0x1b3e99){while(--_0x1b3e99){_0x55e150['push'](_0x55e150['shift']());}};_0xb957bc(++_0x4a4f8b);}(_0xb04a,0xd2));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xab04('0x0'));var logger=require('../../config/logger')(_0xab04('0x1'));var moment=require(_0xab04('0x2'));var BPromise=require(_0xab04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab04('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x4c9ce5,_0x2d81db){return _0x4c9ce5['define'](_0xab04('0x5'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xab04('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb785=['path','rimraf','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5af5b8,_0x173477){var _0x3e7fa6=function(_0x1a764c){while(--_0x1a764c){_0x5af5b8['push'](_0x5af5b8['shift']());}};_0x3e7fa6(++_0x173477);}(_0xb785,0x172));var _0x5b78=function(_0xef88f,_0x2dd2d0){_0xef88f=_0xef88f-0x0;var _0x3ad795=_0xb785[_0xef88f];return _0x3ad795;};'use strict';var _=require(_0x5b78('0x0'));var util=require(_0x5b78('0x1'));var logger=require(_0x5b78('0x2'))(_0x5b78('0x3'));var moment=require(_0x5b78('0x4'));var BPromise=require(_0x5b78('0x5'));var rp=require(_0x5b78('0x6'));var fs=require('fs');var path=require(_0x5b78('0x7'));var rimraf=require(_0x5b78('0x8'));var config=require('../../config/environment');var attributes=require(_0x5b78('0x9'));module[_0x5b78('0xa')]=function(_0x2a4b6d,_0x4a39bd){return _0x2a4b6d['define'](_0x5b78('0xb'),attributes,{'tableName':_0x5b78('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0dfed16..c0e68d8 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 _0x815b=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x815b,0xb4));var _0xb815=function(_0x484909,_0x4c2b59){_0x484909=_0x484909-0x0;var _0x914381=_0x815b[_0x484909];return _0x914381;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var moment=require(_0xb815('0x2'));var BPromise=require(_0xb815('0x3'));var rs=require(_0xb815('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb815('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb815('0x6'));var config=require(_0xb815('0x7'));var jayson=require(_0xb815('0x8'));var client=jayson['client'][_0xb815('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f7a40,_0x4930f6,_0xeba45d){return new BPromise(function(_0x479b09,_0x4d0873){return client[_0xb815('0xa')](_0x3f7a40,_0xeba45d)[_0xb815('0xb')](function(_0x3f8c27){logger[_0xb815('0xc')](_0xb815('0xd'),_0x4930f6,_0xb815('0xe'));logger[_0xb815('0xf')](_0xb815('0x10'),_0x4930f6,'request\x20sent',JSON[_0xb815('0x11')](_0x3f8c27));if(_0x3f8c27[_0xb815('0x12')]){if(_0x3f8c27[_0xb815('0x12')][_0xb815('0x13')]===0x1f4){logger[_0xb815('0x12')](_0xb815('0xd'),_0x4930f6,_0x3f8c27[_0xb815('0x12')]['message']);return _0x4d0873(_0x3f8c27['error'][_0xb815('0x14')]);}logger[_0xb815('0x12')](_0xb815('0xd'),_0x4930f6,_0x3f8c27[_0xb815('0x12')][_0xb815('0x14')]);return _0x479b09(_0x3f8c27[_0xb815('0x12')][_0xb815('0x14')]);}else{logger[_0xb815('0xc')](_0xb815('0xd'),_0x4930f6,_0xb815('0xe'));_0x479b09(_0x3f8c27[_0xb815('0x15')][_0xb815('0x14')]);}})[_0xb815('0x16')](function(_0x52d8dd){logger['error'](_0xb815('0xd'),_0x4930f6,_0x52d8dd);_0x4d0873(_0x52d8dd);});});} \ No newline at end of file +var _0xa93e=['http','info','request\x20sent','debug','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa93e,0x1df));var _0xea93=function(_0x372dea,_0x3e8837){_0x372dea=_0x372dea-0x0;var _0x4e0c4a=_0xa93e[_0x372dea];return _0x4e0c4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea93('0x0'));var BPromise=require(_0xea93('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea93('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea93('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xea93('0x4'));var jayson=require(_0xea93('0x5'));var client=jayson[_0xea93('0x6')][_0xea93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x477a7d,_0x3d53bd,_0x54ebdf){return new BPromise(function(_0x12876e,_0x55d233){return client['request'](_0x477a7d,_0x54ebdf)['then'](function(_0x19047a){logger[_0xea93('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'));logger[_0xea93('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'),JSON[_0xea93('0xb')](_0x19047a));if(_0x19047a[_0xea93('0xc')]){if(_0x19047a[_0xea93('0xc')][_0xea93('0xd')]===0x1f4){logger[_0xea93('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0x19047a[_0xea93('0xc')]['message']);return _0x55d233(_0x19047a['error'][_0xea93('0xe')]);}logger[_0xea93('0xc')](_0xea93('0xf'),_0x3d53bd,_0x19047a[_0xea93('0xc')][_0xea93('0xe')]);return _0x12876e(_0x19047a[_0xea93('0xc')]['message']);}else{logger[_0xea93('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'));_0x12876e(_0x19047a[_0xea93('0x10')][_0xea93('0xe')]);}})[_0xea93('0x11')](function(_0x246b42){logger[_0xea93('0xc')](_0xea93('0xf'),_0x3d53bd,_0x246b42);_0x55d233(_0x246b42);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 8aa4eac..6098333 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 _0x3f10=['../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','put','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x17f7e0,_0x37d9e1){var _0x98c5f4=function(_0x51e278){while(--_0x51e278){_0x17f7e0['push'](_0x17f7e0['shift']());}};_0x98c5f4(++_0x37d9e1);}(_0x3f10,0xe9));var _0x03f1=function(_0x5ec47b,_0x5b8522){_0x5ec47b=_0x5ec47b-0x0;var _0x44f80d=_0x3f10[_0x5ec47b];return _0x44f80d;};'use strict';var multer=require(_0x03f1('0x0'));var util=require('util');var path=require(_0x03f1('0x1'));var timeout=require(_0x03f1('0x2'));var express=require(_0x03f1('0x3'));var router=express['Router']();var fs_extra=require(_0x03f1('0x4'));var auth=require(_0x03f1('0x5'));var interaction=require(_0x03f1('0x6'));var config=require(_0x03f1('0x7'));var controller=require(_0x03f1('0x8'));router[_0x03f1('0x9')]('/',auth[_0x03f1('0xa')](),controller['index']);router['get'](_0x03f1('0xb'),auth['isAuthenticated'](),controller[_0x03f1('0xc')]);router[_0x03f1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x03f1('0xe')](_0x03f1('0xb'),auth[_0x03f1('0xa')](),controller['update']);router[_0x03f1('0xf')](_0x03f1('0xb'),auth[_0x03f1('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xebd1=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show'];(function(_0x36f545,_0x41ed31){var _0x32087c=function(_0x1a6f2b){while(--_0x1a6f2b){_0x36f545['push'](_0x36f545['shift']());}};_0x32087c(++_0x41ed31);}(_0xebd1,0x1ac));var _0x1ebd=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xebd1[_0x44c768];return _0x55daf5;};'use strict';var multer=require(_0x1ebd('0x0'));var util=require(_0x1ebd('0x1'));var path=require(_0x1ebd('0x2'));var timeout=require(_0x1ebd('0x3'));var express=require(_0x1ebd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ebd('0x5'));var interaction=require(_0x1ebd('0x6'));var config=require(_0x1ebd('0x7'));var controller=require(_0x1ebd('0x8'));router[_0x1ebd('0x9')]('/',auth[_0x1ebd('0xa')](),controller[_0x1ebd('0xb')]);router[_0x1ebd('0x9')]('/:id',auth[_0x1ebd('0xa')](),controller[_0x1ebd('0xc')]);router[_0x1ebd('0xd')]('/',auth[_0x1ebd('0xa')](),controller[_0x1ebd('0xe')]);router[_0x1ebd('0xf')](_0x1ebd('0x10'),auth[_0x1ebd('0xa')](),controller[_0x1ebd('0x11')]);router[_0x1ebd('0x12')](_0x1ebd('0x10'),auth['isAuthenticated'](),controller[_0x1ebd('0x13')]);module[_0x1ebd('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 970895d..89b5e0a 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 _0xc2c8=['exports','STRING','sequelize'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0xc2c8,0x1d6));var _0x8c2c=function(_0x351c1b,_0x8de9e7){_0x351c1b=_0x351c1b-0x0;var _0x533863=_0xc2c8[_0x351c1b];return _0x533863;};'use strict';var Sequelize=require(_0x8c2c('0x0'));module[_0x8c2c('0x1')]={'name':{'type':Sequelize[_0x8c2c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8c2c('0x2')]}}; \ No newline at end of file +var _0x5d6c=['sequelize','name','STRING'];(function(_0x5a8085,_0x7a80e0){var _0x49a79a=function(_0x2afdd2){while(--_0x2afdd2){_0x5a8085['push'](_0x5a8085['shift']());}};_0x49a79a(++_0x7a80e0);}(_0x5d6c,0xe1));var _0xc5d6=function(_0x18485f,_0x4af173){_0x18485f=_0x18485f-0x0;var _0x5f4670=_0x5d6c[_0x18485f];return _0x5f4670;};'use strict';var Sequelize=require(_0xc5d6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc5d6('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc5d6('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c3f39d9..ce92cdb 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 _0x1e74=['query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','update','destroy','then','get','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','type','model'];(function(_0x4913b1,_0x4a115e){var _0x1b39a6=function(_0x7ef120){while(--_0x7ef120){_0x4913b1['push'](_0x4913b1['shift']());}};_0x1b39a6(++_0x4a115e);}(_0x1e74,0x71));var _0x41e7=function(_0x16ce1c,_0x202f13){_0x16ce1c=_0x16ce1c-0x0;var _0x545bbf=_0x1e74[_0x16ce1c];return _0x545bbf;};'use strict';var emlformat=require(_0x41e7('0x0'));var rimraf=require(_0x41e7('0x1'));var zipdir=require(_0x41e7('0x2'));var jsonpatch=require(_0x41e7('0x3'));var rp=require('request-promise');var moment=require(_0x41e7('0x4'));var BPromise=require(_0x41e7('0x5'));var Mustache=require(_0x41e7('0x6'));var util=require(_0x41e7('0x7'));var path=require(_0x41e7('0x8'));var sox=require(_0x41e7('0x9'));var csv=require(_0x41e7('0xa'));var ejs=require(_0x41e7('0xb'));var fs=require('fs');var fs_extra=require(_0x41e7('0xc'));var _=require(_0x41e7('0xd'));var squel=require(_0x41e7('0xe'));var crypto=require(_0x41e7('0xf'));var jsforce=require(_0x41e7('0x10'));var deskjs=require(_0x41e7('0x11'));var toCsv=require('to-csv');var querystring=require(_0x41e7('0x12'));var Papa=require(_0x41e7('0x13'));var Redis=require(_0x41e7('0x14'));var authService=require(_0x41e7('0x15'));var qs=require(_0x41e7('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x41e7('0x17'));var utils=require('../../config/utils');var config=require(_0x41e7('0x18'));var licenseUtil=require(_0x41e7('0x19'));var db=require(_0x41e7('0x1a'))['db'];function respondWithStatusCode(_0x4862de,_0xb2a04a){_0xb2a04a=_0xb2a04a||0xcc;return function(_0x5dc5c9){if(_0x5dc5c9){return _0x4862de[_0x41e7('0x1b')](_0xb2a04a);}return _0x4862de[_0x41e7('0x1c')](_0xb2a04a)[_0x41e7('0x1d')]();};}function respondWithResult(_0x3d297f,_0x104f96){_0x104f96=_0x104f96||0xc8;return function(_0x3b4134){if(_0x3b4134){return _0x3d297f[_0x41e7('0x1c')](_0x104f96)[_0x41e7('0x1e')](_0x3b4134);}};}function respondWithFilteredResult(_0x236fc6,_0x372346){return function(_0x4f14ff){if(_0x4f14ff){var _0x410598=typeof _0x372346[_0x41e7('0x1f')]===_0x41e7('0x20')&&typeof _0x372346[_0x41e7('0x21')]===_0x41e7('0x20');var _0x4be674=_0x4f14ff['count'];var _0x440dbe=_0x410598?0x0:_0x372346['offset'];var _0x443ea7=_0x410598?_0x4f14ff['count']:_0x372346['offset']+_0x372346[_0x41e7('0x21')];var _0x8fea80;if(_0x443ea7>=_0x4be674){_0x443ea7=_0x4be674;_0x8fea80=0xc8;}else{_0x8fea80=0xce;}_0x236fc6['status'](_0x8fea80);return _0x236fc6[_0x41e7('0x22')]('Content-Range',_0x440dbe+'-'+_0x443ea7+'/'+_0x4be674)[_0x41e7('0x1e')](_0x4f14ff);}return null;};}function patchUpdates(_0x150bfa){return function(_0x198378){try{jsonpatch[_0x41e7('0x23')](_0x198378,_0x150bfa,!![]);}catch(_0x24e5d9){return BPromise['reject'](_0x24e5d9);}return _0x198378['save']();};}function saveUpdates(_0x32e6bb,_0x2ed2a4){return function(_0x66eea){if(_0x66eea){return _0x66eea[_0x41e7('0x24')](_0x32e6bb)['then'](function(_0x25dc36){return _0x25dc36;});}return null;};}function removeEntity(_0x1c99a2,_0x34a4a7){return function(_0x36ea57){if(_0x36ea57){return _0x36ea57[_0x41e7('0x25')]()[_0x41e7('0x26')](function(){var _0xb4d852=_0x36ea57[_0x41e7('0x27')]({'plain':!![]});var _0x1b9ddb=_0x41e7('0x28');return db['UserProfileResource'][_0x41e7('0x25')]({'where':{'type':_0x1b9ddb,'resourceId':_0xb4d852['id']}})[_0x41e7('0x26')](function(){return _0x36ea57;});})[_0x41e7('0x26')](function(){_0x1c99a2['status'](0xcc)[_0x41e7('0x1d')]();});}};}function handleEntityNotFound(_0x313396,_0x468bf2){return function(_0x59cc56){if(!_0x59cc56){_0x313396[_0x41e7('0x1b')](0x194);}return _0x59cc56;};}function handleError(_0x43c16f,_0x1c3ca0){_0x1c3ca0=_0x1c3ca0||0x1f4;return function(_0xe4511e){logger[_0x41e7('0x29')](_0xe4511e[_0x41e7('0x2a')]);if(_0xe4511e[_0x41e7('0x2b')]){delete _0xe4511e[_0x41e7('0x2b')];}_0x43c16f[_0x41e7('0x1c')](_0x1c3ca0)[_0x41e7('0x2c')](_0xe4511e);};}exports[_0x41e7('0x2d')]=function(_0x4d11ec,_0xa68e39){var _0x2c08e9={},_0x29245d={},_0x4b6350={'count':0x0,'rows':[]};var _0x33cb80=_[_0x41e7('0x2e')](db[_0x41e7('0x2f')][_0x41e7('0x30')],function(_0x4049b2){return{'name':_0x4049b2['fieldName'],'type':_0x4049b2[_0x41e7('0x31')]['key']};});_0x29245d[_0x41e7('0x32')]=_[_0x41e7('0x2e')](_0x33cb80,_0x41e7('0x2b'));_0x29245d[_0x41e7('0x33')]=_[_0x41e7('0x34')](_0x4d11ec['query']);_0x29245d['filters']=_[_0x41e7('0x35')](_0x29245d['model'],_0x29245d['query']);_0x2c08e9[_0x41e7('0x36')]=_[_0x41e7('0x35')](_0x29245d[_0x41e7('0x32')],qs[_0x41e7('0x37')](_0x4d11ec[_0x41e7('0x33')]['fields']));_0x2c08e9[_0x41e7('0x36')]=_0x2c08e9[_0x41e7('0x36')]['length']?_0x2c08e9[_0x41e7('0x36')]:_0x29245d[_0x41e7('0x32')];if(!_0x4d11ec[_0x41e7('0x33')][_0x41e7('0x38')](_0x41e7('0x39'))){_0x2c08e9[_0x41e7('0x21')]=qs[_0x41e7('0x21')](_0x4d11ec['query'][_0x41e7('0x21')]);_0x2c08e9[_0x41e7('0x1f')]=qs[_0x41e7('0x1f')](_0x4d11ec['query'][_0x41e7('0x1f')]);}_0x2c08e9[_0x41e7('0x3a')]=qs['sort'](_0x4d11ec[_0x41e7('0x33')][_0x41e7('0x3b')]);_0x2c08e9[_0x41e7('0x3c')]=qs[_0x41e7('0x3d')](_[_0x41e7('0x3e')](_0x4d11ec[_0x41e7('0x33')],_0x29245d[_0x41e7('0x3d')]),_0x33cb80);if(_0x4d11ec[_0x41e7('0x33')][_0x41e7('0x3f')]){_0x2c08e9[_0x41e7('0x3c')]=_[_0x41e7('0x40')](_0x2c08e9[_0x41e7('0x3c')],{'$or':_['map'](_0x33cb80,function(_0x18fbbb){if(_0x18fbbb[_0x41e7('0x31')]!==_0x41e7('0x41')){var _0x2ea9d2={};_0x2ea9d2[_0x18fbbb[_0x41e7('0x2b')]]={'$like':'%'+_0x4d11ec[_0x41e7('0x33')][_0x41e7('0x3f')]+'%'};return _0x2ea9d2;}})});}_0x2c08e9=_[_0x41e7('0x40')]({},_0x2c08e9,_0x4d11ec[_0x41e7('0x42')]);var _0x2b5c79={'where':_0x2c08e9[_0x41e7('0x3c')]};return db[_0x41e7('0x2f')]['count'](_0x2b5c79)[_0x41e7('0x26')](function(_0x2595ba){_0x4b6350['count']=_0x2595ba;if(_0x4d11ec[_0x41e7('0x33')][_0x41e7('0x43')]){_0x2c08e9[_0x41e7('0x44')]=[{'all':!![]}];}return db[_0x41e7('0x2f')][_0x41e7('0x45')](_0x2c08e9);})['then'](function(_0x3d6dc7){_0x4b6350[_0x41e7('0x46')]=_0x3d6dc7;return _0x4b6350;})[_0x41e7('0x26')](respondWithFilteredResult(_0xa68e39,_0x2c08e9))[_0x41e7('0x47')](handleError(_0xa68e39,null));};exports['show']=function(_0x442a25,_0x213caf){var _0x4a7cbc={'raw':!![],'where':{'id':_0x442a25[_0x41e7('0x48')]['id']}},_0x1f5674={};_0x1f5674[_0x41e7('0x32')]=_[_0x41e7('0x34')](db[_0x41e7('0x2f')][_0x41e7('0x30')]);_0x1f5674[_0x41e7('0x33')]=_[_0x41e7('0x34')](_0x442a25[_0x41e7('0x33')]);_0x1f5674['filters']=_[_0x41e7('0x35')](_0x1f5674[_0x41e7('0x32')],_0x1f5674[_0x41e7('0x33')]);_0x4a7cbc[_0x41e7('0x36')]=_[_0x41e7('0x35')](_0x1f5674['model'],qs[_0x41e7('0x37')](_0x442a25['query']['fields']));_0x4a7cbc[_0x41e7('0x36')]=_0x4a7cbc['attributes'][_0x41e7('0x49')]?_0x4a7cbc[_0x41e7('0x36')]:_0x1f5674['model'];if(_0x442a25['query']['includeAll']){_0x4a7cbc[_0x41e7('0x44')]=[{'all':!![]}];}_0x4a7cbc=_[_0x41e7('0x40')]({},_0x4a7cbc,_0x442a25[_0x41e7('0x42')]);return db['Pause'][_0x41e7('0x4a')](_0x4a7cbc)[_0x41e7('0x26')](handleEntityNotFound(_0x213caf,null))[_0x41e7('0x26')](respondWithResult(_0x213caf,null))[_0x41e7('0x47')](handleError(_0x213caf,null));};exports[_0x41e7('0x4b')]=function(_0x130e76,_0x1ddcbb){return db[_0x41e7('0x2f')][_0x41e7('0x4b')](_0x130e76[_0x41e7('0x4c')],{})[_0x41e7('0x26')](function(_0x5be85a){var _0x4d68f6=_0x130e76['user'][_0x41e7('0x27')]({'plain':!![]});if(!_0x4d68f6)throw new Error(_0x41e7('0x4d'));if(_0x4d68f6[_0x41e7('0x4e')]==='user'){var _0x1aa398=_0x5be85a[_0x41e7('0x27')]({'plain':!![]});var _0x1d89fa=_0x41e7('0x28');return db[_0x41e7('0x4f')]['find']({'where':{'name':_0x1d89fa,'userProfileId':_0x4d68f6['userProfileId']},'raw':!![]})['then'](function(_0x467a2c){if(_0x467a2c&&_0x467a2c[_0x41e7('0x50')]===0x0){return db[_0x41e7('0x51')][_0x41e7('0x4b')]({'name':_0x1aa398[_0x41e7('0x2b')],'resourceId':_0x1aa398['id'],'type':_0x467a2c[_0x41e7('0x2b')],'sectionId':_0x467a2c['id']},{})['then'](function(){return _0x5be85a;});}else{return _0x5be85a;}})[_0x41e7('0x47')](function(_0x517689){logger[_0x41e7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x517689);throw _0x517689;});}return _0x5be85a;})[_0x41e7('0x26')](respondWithResult(_0x1ddcbb,0xc9))['catch'](handleError(_0x1ddcbb,null));};exports[_0x41e7('0x24')]=function(_0x4f1ae2,_0x4d913b){if(_0x4f1ae2[_0x41e7('0x4c')]['id']){delete _0x4f1ae2['body']['id'];}return db[_0x41e7('0x2f')][_0x41e7('0x4a')]({'where':{'id':_0x4f1ae2[_0x41e7('0x48')]['id']}})[_0x41e7('0x26')](handleEntityNotFound(_0x4d913b,null))[_0x41e7('0x26')](saveUpdates(_0x4f1ae2[_0x41e7('0x4c')],null))['then'](respondWithResult(_0x4d913b,null))[_0x41e7('0x47')](handleError(_0x4d913b,null));};exports[_0x41e7('0x25')]=function(_0x3d9b76,_0xcb3431){return db[_0x41e7('0x2f')][_0x41e7('0x4a')]({'where':{'id':_0x3d9b76[_0x41e7('0x48')]['id']}})[_0x41e7('0x26')](handleEntityNotFound(_0xcb3431,null))[_0x41e7('0x26')](removeEntity(_0xcb3431,null))[_0x41e7('0x47')](handleError(_0xcb3431,null));}; \ No newline at end of file +var _0xefc6=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','Pauses','destroy','sendStatus','error','name','send','map','Pause','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','rows','params','keys','rawAttributes','length','include','merge','catch','create','body','user'];(function(_0x54861f,_0x1ebd08){var _0x4a6c3c=function(_0x370d28){while(--_0x370d28){_0x54861f['push'](_0x54861f['shift']());}};_0x4a6c3c(++_0x1ebd08);}(_0xefc6,0xf8));var _0x6efc=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xefc6[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6efc('0x0'));var zipdir=require(_0x6efc('0x1'));var jsonpatch=require(_0x6efc('0x2'));var rp=require(_0x6efc('0x3'));var moment=require(_0x6efc('0x4'));var BPromise=require(_0x6efc('0x5'));var Mustache=require(_0x6efc('0x6'));var util=require(_0x6efc('0x7'));var path=require(_0x6efc('0x8'));var sox=require('sox');var csv=require(_0x6efc('0x9'));var ejs=require(_0x6efc('0xa'));var fs=require('fs');var fs_extra=require(_0x6efc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6efc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6efc('0xd'));var Papa=require('papaparse');var Redis=require(_0x6efc('0xe'));var authService=require(_0x6efc('0xf'));var qs=require(_0x6efc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6efc('0x11'));var logger=require(_0x6efc('0x12'))(_0x6efc('0x13'));var utils=require('../../config/utils');var config=require(_0x6efc('0x14'));var licenseUtil=require(_0x6efc('0x15'));var db=require(_0x6efc('0x16'))['db'];function respondWithStatusCode(_0x1afd51,_0x2e1359){_0x2e1359=_0x2e1359||0xcc;return function(_0x57570e){if(_0x57570e){return _0x1afd51['sendStatus'](_0x2e1359);}return _0x1afd51[_0x6efc('0x17')](_0x2e1359)[_0x6efc('0x18')]();};}function respondWithResult(_0x180492,_0x5c57e9){_0x5c57e9=_0x5c57e9||0xc8;return function(_0x277cbd){if(_0x277cbd){return _0x180492['status'](_0x5c57e9)[_0x6efc('0x19')](_0x277cbd);}};}function respondWithFilteredResult(_0x2d8e97,_0x55a500){return function(_0x8de859){if(_0x8de859){var _0x66797=typeof _0x55a500[_0x6efc('0x1a')]===_0x6efc('0x1b')&&typeof _0x55a500['limit']===_0x6efc('0x1b');var _0x13f534=_0x8de859['count'];var _0x57e14e=_0x66797?0x0:_0x55a500[_0x6efc('0x1a')];var _0x5e009e=_0x66797?_0x8de859[_0x6efc('0x1c')]:_0x55a500['offset']+_0x55a500[_0x6efc('0x1d')];var _0x3f0d7c;if(_0x5e009e>=_0x13f534){_0x5e009e=_0x13f534;_0x3f0d7c=0xc8;}else{_0x3f0d7c=0xce;}_0x2d8e97['status'](_0x3f0d7c);return _0x2d8e97['set'](_0x6efc('0x1e'),_0x57e14e+'-'+_0x5e009e+'/'+_0x13f534)['json'](_0x8de859);}return null;};}function patchUpdates(_0x2e52e4){return function(_0x4ad1c1){try{jsonpatch[_0x6efc('0x1f')](_0x4ad1c1,_0x2e52e4,!![]);}catch(_0x4f0d01){return BPromise[_0x6efc('0x20')](_0x4f0d01);}return _0x4ad1c1[_0x6efc('0x21')]();};}function saveUpdates(_0x2e2084,_0x20daa2){return function(_0x4d8aa0){if(_0x4d8aa0){return _0x4d8aa0[_0x6efc('0x22')](_0x2e2084)[_0x6efc('0x23')](function(_0x2f69eb){return _0x2f69eb;});}return null;};}function removeEntity(_0x23c8b6,_0x28b45f){return function(_0xd2ae4f){if(_0xd2ae4f){return _0xd2ae4f['destroy']()[_0x6efc('0x23')](function(){var _0x4f8128=_0xd2ae4f['get']({'plain':!![]});var _0x37986d=_0x6efc('0x24');return db['UserProfileResource'][_0x6efc('0x25')]({'where':{'type':_0x37986d,'resourceId':_0x4f8128['id']}})[_0x6efc('0x23')](function(){return _0xd2ae4f;});})[_0x6efc('0x23')](function(){_0x23c8b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44758a,_0xb5213f){return function(_0x27b3d6){if(!_0x27b3d6){_0x44758a[_0x6efc('0x26')](0x194);}return _0x27b3d6;};}function handleError(_0x595435,_0x5dba50){_0x5dba50=_0x5dba50||0x1f4;return function(_0x1c6f9e){logger[_0x6efc('0x27')](_0x1c6f9e['stack']);if(_0x1c6f9e['name']){delete _0x1c6f9e[_0x6efc('0x28')];}_0x595435[_0x6efc('0x17')](_0x5dba50)[_0x6efc('0x29')](_0x1c6f9e);};}exports['index']=function(_0x4e71a9,_0x3e1d4f){var _0x2c74f6={},_0x1ca04c={},_0x3667c1={'count':0x0,'rows':[]};var _0x57817a=_[_0x6efc('0x2a')](db[_0x6efc('0x2b')]['rawAttributes'],function(_0x1d3804){return{'name':_0x1d3804[_0x6efc('0x2c')],'type':_0x1d3804['type'][_0x6efc('0x2d')]};});_0x1ca04c[_0x6efc('0x2e')]=_[_0x6efc('0x2a')](_0x57817a,_0x6efc('0x28'));_0x1ca04c[_0x6efc('0x2f')]=_['keys'](_0x4e71a9[_0x6efc('0x2f')]);_0x1ca04c[_0x6efc('0x30')]=_['intersection'](_0x1ca04c[_0x6efc('0x2e')],_0x1ca04c['query']);_0x2c74f6['attributes']=_[_0x6efc('0x31')](_0x1ca04c[_0x6efc('0x2e')],qs[_0x6efc('0x32')](_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x32')]));_0x2c74f6[_0x6efc('0x33')]=_0x2c74f6['attributes']['length']?_0x2c74f6['attributes']:_0x1ca04c[_0x6efc('0x2e')];if(!_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x34')](_0x6efc('0x35'))){_0x2c74f6[_0x6efc('0x1d')]=qs[_0x6efc('0x1d')](_0x4e71a9['query'][_0x6efc('0x1d')]);_0x2c74f6[_0x6efc('0x1a')]=qs[_0x6efc('0x1a')](_0x4e71a9[_0x6efc('0x2f')]['offset']);}_0x2c74f6[_0x6efc('0x36')]=qs[_0x6efc('0x37')](_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x37')]);_0x2c74f6[_0x6efc('0x38')]=qs['filters'](_['pick'](_0x4e71a9[_0x6efc('0x2f')],_0x1ca04c[_0x6efc('0x30')]),_0x57817a);if(_0x4e71a9['query'][_0x6efc('0x39')]){_0x2c74f6['where']=_['merge'](_0x2c74f6['where'],{'$or':_[_0x6efc('0x2a')](_0x57817a,function(_0x16ff42){if(_0x16ff42['type']!==_0x6efc('0x3a')){var _0x85f7b3={};_0x85f7b3[_0x16ff42['name']]={'$like':'%'+_0x4e71a9[_0x6efc('0x2f')]['filter']+'%'};return _0x85f7b3;}})});}_0x2c74f6=_['merge']({},_0x2c74f6,_0x4e71a9[_0x6efc('0x3b')]);var _0x5266fc={'where':_0x2c74f6['where']};return db[_0x6efc('0x2b')]['count'](_0x5266fc)[_0x6efc('0x23')](function(_0x142b28){_0x3667c1[_0x6efc('0x1c')]=_0x142b28;if(_0x4e71a9[_0x6efc('0x2f')][_0x6efc('0x3c')]){_0x2c74f6['include']=[{'all':!![]}];}return db[_0x6efc('0x2b')]['findAll'](_0x2c74f6);})[_0x6efc('0x23')](function(_0x45395a){_0x3667c1[_0x6efc('0x3d')]=_0x45395a;return _0x3667c1;})[_0x6efc('0x23')](respondWithFilteredResult(_0x3e1d4f,_0x2c74f6))['catch'](handleError(_0x3e1d4f,null));};exports['show']=function(_0x43355c,_0x2f5956){var _0x547c23={'raw':!![],'where':{'id':_0x43355c[_0x6efc('0x3e')]['id']}},_0xc61d6f={};_0xc61d6f[_0x6efc('0x2e')]=_[_0x6efc('0x3f')](db[_0x6efc('0x2b')][_0x6efc('0x40')]);_0xc61d6f[_0x6efc('0x2f')]=_['keys'](_0x43355c[_0x6efc('0x2f')]);_0xc61d6f[_0x6efc('0x30')]=_[_0x6efc('0x31')](_0xc61d6f[_0x6efc('0x2e')],_0xc61d6f[_0x6efc('0x2f')]);_0x547c23['attributes']=_[_0x6efc('0x31')](_0xc61d6f[_0x6efc('0x2e')],qs['fields'](_0x43355c['query']['fields']));_0x547c23[_0x6efc('0x33')]=_0x547c23[_0x6efc('0x33')][_0x6efc('0x41')]?_0x547c23[_0x6efc('0x33')]:_0xc61d6f[_0x6efc('0x2e')];if(_0x43355c[_0x6efc('0x2f')][_0x6efc('0x3c')]){_0x547c23[_0x6efc('0x42')]=[{'all':!![]}];}_0x547c23=_[_0x6efc('0x43')]({},_0x547c23,_0x43355c[_0x6efc('0x3b')]);return db[_0x6efc('0x2b')]['find'](_0x547c23)['then'](handleEntityNotFound(_0x2f5956,null))[_0x6efc('0x23')](respondWithResult(_0x2f5956,null))[_0x6efc('0x44')](handleError(_0x2f5956,null));};exports[_0x6efc('0x45')]=function(_0x590884,_0x1561d0){return db['Pause'][_0x6efc('0x45')](_0x590884[_0x6efc('0x46')],{})[_0x6efc('0x23')](function(_0x520ad9){var _0x4119ae=_0x590884[_0x6efc('0x47')][_0x6efc('0x48')]({'plain':!![]});if(!_0x4119ae)throw new Error(_0x6efc('0x49'));if(_0x4119ae[_0x6efc('0x4a')]===_0x6efc('0x47')){var _0x576ac7=_0x520ad9[_0x6efc('0x48')]({'plain':!![]});var _0x57faaf='Pauses';return db['UserProfileSection'][_0x6efc('0x4b')]({'where':{'name':_0x57faaf,'userProfileId':_0x4119ae[_0x6efc('0x4c')]},'raw':!![]})['then'](function(_0xe39c15){if(_0xe39c15&&_0xe39c15[_0x6efc('0x4d')]===0x0){return db[_0x6efc('0x4e')]['create']({'name':_0x576ac7[_0x6efc('0x28')],'resourceId':_0x576ac7['id'],'type':_0xe39c15[_0x6efc('0x28')],'sectionId':_0xe39c15['id']},{})[_0x6efc('0x23')](function(){return _0x520ad9;});}else{return _0x520ad9;}})['catch'](function(_0x335aec){logger['error'](_0x6efc('0x4f'),_0x335aec);throw _0x335aec;});}return _0x520ad9;})[_0x6efc('0x23')](respondWithResult(_0x1561d0,0xc9))[_0x6efc('0x44')](handleError(_0x1561d0,null));};exports[_0x6efc('0x22')]=function(_0x5b7f7f,_0x37ee53){if(_0x5b7f7f[_0x6efc('0x46')]['id']){delete _0x5b7f7f[_0x6efc('0x46')]['id'];}return db[_0x6efc('0x2b')]['find']({'where':{'id':_0x5b7f7f[_0x6efc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37ee53,null))[_0x6efc('0x23')](saveUpdates(_0x5b7f7f[_0x6efc('0x46')],null))[_0x6efc('0x23')](respondWithResult(_0x37ee53,null))[_0x6efc('0x44')](handleError(_0x37ee53,null));};exports['destroy']=function(_0x28890b,_0x13367d){return db[_0x6efc('0x2b')][_0x6efc('0x4b')]({'where':{'id':_0x28890b['params']['id']}})['then'](handleEntityNotFound(_0x13367d,null))[_0x6efc('0x23')](removeEntity(_0x13367d,null))[_0x6efc('0x44')](handleError(_0x13367d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index bbee301..c99510d 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 _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0xd5a496,_0x2ddf78){var _0x33e5f1=function(_0x24c469){while(--_0x24c469){_0xd5a496['push'](_0xd5a496['shift']());}};_0x33e5f1(++_0x2ddf78);}(_0x5fab,0x177));var _0xb5fa=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x5fab[_0x2c0557];return _0x2878cd;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x21262e,_0x2c20fd){var _0x3b1223=function(_0x52d163){while(--_0x52d163){_0x21262e['push'](_0x21262e['shift']());}};_0x3b1223(++_0x2c20fd);}(_0x53ec,0x192));var _0xc53e=function(_0x13fb4f,_0x42f6af){_0x13fb4f=_0x13fb4f-0x0;var _0x298a4e=_0x53ec[_0x13fb4f];return _0x298a4e;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 6990094..4f7fc7f 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(_0x38fa4c,_0x1fffa5){var _0x125dd2=function(_0x32adb7){while(--_0x32adb7){_0x38fa4c['push'](_0x38fa4c['shift']());}};_0x125dd2(++_0x1fffa5);}(_0x7a54,0x106));var _0x47a5=function(_0x84a78a,_0x4b4a6e){_0x84a78a=_0x84a78a-0x0;var _0x1ca864=_0x7a54[_0x84a78a];return _0x1ca864;};'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(_0x334489,_0x12af94){var _0x2c0556=function(_0x9973b8){while(--_0x9973b8){_0x334489['push'](_0x334489['shift']());}};_0x2c0556(++_0x12af94);}(_0x7a54,0x106));var _0x47a5=function(_0x3f3280,_0xb66fc1){_0x3f3280=_0x3f3280-0x0;var _0x451f27=_0x7a54[_0x3f3280];return _0x451f27;};'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 f0e4bf4..4ae7bee 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 _0xed1f=['basename','originalname','now','extname','single','upload','post','webhookPost','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','diskStorage','server/files/plugins','replace','format'];(function(_0x30d1ed,_0x3c7574){var _0x49826e=function(_0x538baa){while(--_0x538baa){_0x30d1ed['push'](_0x30d1ed['shift']());}};_0x49826e(++_0x3c7574);}(_0xed1f,0x6a));var _0xfed1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xed1f[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),controller[_0xfed1('0xf')]);router[_0xfed1('0xb')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x10')]);router['get'](_0xfed1('0x11'),auth[_0xfed1('0xc')](),controller['download']);var upload=multer({'storage':multer[_0xfed1('0x12')]({'destination':function(_0x48c338,_0x1c3f40,_0x234f4e){_0x234f4e(null,path['join'](config['root'],_0xfed1('0x13')));},'filename':function(_0xe84ba6,_0x569a6e,_0x17f4fe){_0x569a6e['originalname']=_0x569a6e['originalname'][_0xfed1('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17f4fe(null,util[_0xfed1('0x15')]('%s-%s%s',path[_0xfed1('0x16')](_0x569a6e['originalname'],path['extname'](_0x569a6e[_0xfed1('0x17')])),Date[_0xfed1('0x18')](),path[_0xfed1('0x19')](_0x569a6e[_0xfed1('0x17')])));}})});router['post']('/',upload[_0xfed1('0x1a')]('file'),controller[_0xfed1('0x1b')]);router[_0xfed1('0x1c')]('/webhook',controller[_0xfed1('0x1d')]);router[_0xfed1('0x1e')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfed1('0x1f')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x524a=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','basename','now','extname','post','single','file','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./plugin.controller','get','isAuthenticated','webhookGet'];(function(_0x363d6a,_0x5e0228){var _0xaab1d9=function(_0x477821){while(--_0x477821){_0x363d6a['push'](_0x363d6a['shift']());}};_0xaab1d9(++_0x5e0228);}(_0x524a,0xf5));var _0xa524=function(_0x1fb362,_0x9860d4){_0x1fb362=_0x1fb362-0x0;var _0x3bca96=_0x524a[_0x1fb362];return _0x3bca96;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/webhook',controller[_0xa524('0xa')]);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0x8')](_0xa524('0xc'),auth[_0xa524('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xa524('0xd')]({'destination':function(_0x2ebea2,_0x59660a,_0x565fab){_0x565fab(null,path[_0xa524('0xe')](config[_0xa524('0xf')],_0xa524('0x10')));},'filename':function(_0x4936fa,_0x55117f,_0x14a0d6){_0x55117f['originalname']=_0x55117f[_0xa524('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x14a0d6(null,util[_0xa524('0x12')]('%s-%s%s',path[_0xa524('0x13')](_0x55117f[_0xa524('0x11')],path['extname'](_0x55117f[_0xa524('0x11')])),Date[_0xa524('0x14')](),path[_0xa524('0x15')](_0x55117f[_0xa524('0x11')])));}})});router[_0xa524('0x16')]('/',upload[_0xa524('0x17')](_0xa524('0x18')),controller['upload']);router[_0xa524('0x16')](_0xa524('0x19'),controller[_0xa524('0x1a')]);router[_0xa524('0x1b')](_0xa524('0x1c'),auth[_0xa524('0x9')](),controller[_0xa524('0x1d')]);router[_0xa524('0x1e')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x1e')]);module[_0xa524('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2554616..1b65954 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 _0x6a4a=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x1fb58e,_0x73313e){var _0x33b539=function(_0x46b848){while(--_0x46b848){_0x1fb58e['push'](_0x1fb58e['shift']());}};_0x33b539(++_0x73313e);}(_0x6a4a,0x1cc));var _0xa6a4=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0x6a4a[_0x2e3dfc];return _0x4b1245;};'use strict';var Sequelize=require(_0xa6a4('0x0'));module[_0xa6a4('0x1')]={'name':{'type':Sequelize[_0xa6a4('0x2')]},'type':{'type':Sequelize[_0xa6a4('0x3')](_0xa6a4('0x4'),_0xa6a4('0x5'))},'description':{'type':Sequelize[_0xa6a4('0x6')]},'version':{'type':Sequelize[_0xa6a4('0x6')]},'path':{'type':Sequelize[_0xa6a4('0x2')],'comment':_0xa6a4('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa6a4('0x8')},'sidebar':{'type':Sequelize[_0xa6a4('0x3')]('adminOnly','agentOnly',_0xa6a4('0x9'),_0xa6a4('0xa')),'defaultValue':_0xa6a4('0x9'),'comment':_0xa6a4('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xa6a4('0x2')]},'agentUrl':{'type':Sequelize[_0xa6a4('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xa6a4('0x2')]}}; \ No newline at end of file +var _0x6749=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','STRING'];(function(_0x1090d6,_0x947d13){var _0x210d4d=function(_0x4ede2a){while(--_0x4ede2a){_0x1090d6['push'](_0x1090d6['shift']());}};_0x210d4d(++_0x947d13);}(_0x6749,0x1af));var _0x9674=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6749[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9674('0x0')]},'type':{'type':Sequelize[_0x9674('0x1')](_0x9674('0x2'),_0x9674('0x3'))},'description':{'type':Sequelize[_0x9674('0x4')]},'version':{'type':Sequelize[_0x9674('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x9674('0x5')},'active':{'type':Sequelize[_0x9674('0x6')],'defaultValue':0x0,'comment':_0x9674('0x7')},'sidebar':{'type':Sequelize[_0x9674('0x1')](_0x9674('0x8'),_0x9674('0x9'),_0x9674('0xa'),_0x9674('0xb')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9674('0x0')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9674('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x9674('0x0')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 43dca8c..e53553a 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 _0xccdd=['end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','catch','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','extname','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','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','Invalid\x20manifest:\x20views\x20missing','views','admin','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','role','body','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','http://localhost:','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status'];(function(_0x4bd928,_0x591eff){var _0x404555=function(_0x30ff9f){while(--_0x30ff9f){_0x4bd928['push'](_0x4bd928['shift']());}};_0x404555(++_0x591eff);}(_0xccdd,0x13a));var _0xdccd=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xccdd[_0x209fcd];return _0x501d5e;};'use strict';var emlformat=require(_0xdccd('0x0'));var rimraf=require(_0xdccd('0x1'));var zipdir=require(_0xdccd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdccd('0x3'));var BPromise=require(_0xdccd('0x4'));var Mustache=require(_0xdccd('0x5'));var util=require('util');var path=require(_0xdccd('0x6'));var sox=require('sox');var csv=require(_0xdccd('0x7'));var ejs=require(_0xdccd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdccd('0x9'));var squel=require(_0xdccd('0xa'));var crypto=require(_0xdccd('0xb'));var jsforce=require(_0xdccd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdccd('0x7'));var querystring=require(_0xdccd('0xd'));var Papa=require('papaparse');var extract=require(_0xdccd('0xe'));var rimraf=require(_0xdccd('0x1'));var archiver=require(_0xdccd('0xf'));var Redis=require(_0xdccd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdccd('0x11'));var as=require(_0xdccd('0x12'));var hardwareService=require(_0xdccd('0x13'));var logger=require(_0xdccd('0x14'))(_0xdccd('0x15'));var utils=require(_0xdccd('0x16'));var config=require(_0xdccd('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdccd('0x18')]=_['defaults'](config['redis'],{'host':_0xdccd('0x19'),'port':0x18eb});var socket=require(_0xdccd('0x1a'))(new Redis(config[_0xdccd('0x18')]));require(_0xdccd('0x1b'))['register'](socket);function respondWithStatusCode(_0x653667,_0x3f88db){_0x3f88db=_0x3f88db||0xcc;return function(_0x29a7ae){if(_0x29a7ae){return _0x653667[_0xdccd('0x1c')](_0x3f88db);}return _0x653667[_0xdccd('0x1d')](_0x3f88db)[_0xdccd('0x1e')]();};}function respondWithResult(_0x46f1d8,_0x31687e){_0x31687e=_0x31687e||0xc8;return function(_0x9caa12){if(_0x9caa12){return _0x46f1d8[_0xdccd('0x1d')](_0x31687e)[_0xdccd('0x1f')](_0x9caa12);}};}function respondWithFilteredResult(_0x14cd82,_0x1a632c){return function(_0x470c65){if(_0x470c65){var _0x54562c=typeof _0x1a632c['offset']===_0xdccd('0x20')&&typeof _0x1a632c['limit']==='undefined';var _0xf12ce5=_0x470c65[_0xdccd('0x21')];var _0x4fcd51=_0x54562c?0x0:_0x1a632c[_0xdccd('0x22')];var _0xd6c61f=_0x54562c?_0x470c65[_0xdccd('0x21')]:_0x1a632c['offset']+_0x1a632c['limit'];var _0x52e82e;if(_0xd6c61f>=_0xf12ce5){_0xd6c61f=_0xf12ce5;_0x52e82e=0xc8;}else{_0x52e82e=0xce;}_0x14cd82[_0xdccd('0x1d')](_0x52e82e);return _0x14cd82[_0xdccd('0x23')](_0xdccd('0x24'),_0x4fcd51+'-'+_0xd6c61f+'/'+_0xf12ce5)[_0xdccd('0x1f')](_0x470c65);}return null;};}function patchUpdates(_0x2ba83b){return function(_0x1626f4){try{jsonpatch[_0xdccd('0x25')](_0x1626f4,_0x2ba83b,!![]);}catch(_0x303cee){return BPromise[_0xdccd('0x26')](_0x303cee);}return _0x1626f4[_0xdccd('0x27')]();};}function saveUpdates(_0xe0cbf0,_0x523239){return function(_0x1c1327){if(_0x1c1327){return _0x1c1327[_0xdccd('0x28')](_0xe0cbf0)[_0xdccd('0x29')](function(_0x3f4c52){return _0x3f4c52;});}return null;};}function removeEntity(_0x339fb8,_0x3cd945){return function(_0x4651bc){if(_0x4651bc){return _0x4651bc[_0xdccd('0x2a')]()[_0xdccd('0x29')](function(){var _0x169ef1=_0x4651bc[_0xdccd('0x2b')]({'plain':!![]});var _0xad0441=_0xdccd('0x2c');return db[_0xdccd('0x2d')][_0xdccd('0x2a')]({'where':{'type':_0xad0441,'resourceId':_0x169ef1['id']}})['then'](function(){return _0x4651bc;});})[_0xdccd('0x29')](function(){_0x339fb8[_0xdccd('0x1d')](0xcc)[_0xdccd('0x1e')]();});}};}function handleEntityNotFound(_0x483551,_0xbaecd8){return function(_0x2374cb){if(!_0x2374cb){_0x483551[_0xdccd('0x1c')](0x194);}return _0x2374cb;};}function handleError(_0x2edca6,_0x99f724){_0x99f724=_0x99f724||0x1f4;return function(_0x126d07){logger[_0xdccd('0x2e')](_0x126d07[_0xdccd('0x2f')]);if(_0x126d07[_0xdccd('0x30')]){delete _0x126d07[_0xdccd('0x30')];}_0x2edca6[_0xdccd('0x1d')](_0x99f724)[_0xdccd('0x31')](_0x126d07);};}exports[_0xdccd('0x32')]=function(_0xbc43d6,_0x210241){var _0x4b9b1f={},_0x4ebe1f={},_0x275d9b={'count':0x0,'rows':[]};var _0x3ef0aa=_['map'](db[_0xdccd('0x33')][_0xdccd('0x34')],function(_0x285dfd){return{'name':_0x285dfd[_0xdccd('0x35')],'type':_0x285dfd[_0xdccd('0x36')][_0xdccd('0x37')]};});_0x4ebe1f[_0xdccd('0x38')]=_['map'](_0x3ef0aa,_0xdccd('0x30'));_0x4ebe1f[_0xdccd('0x39')]=_[_0xdccd('0x3a')](_0xbc43d6['query']);_0x4ebe1f['filters']=_[_0xdccd('0x3b')](_0x4ebe1f[_0xdccd('0x38')],_0x4ebe1f['query']);_0x4b9b1f['attributes']=_[_0xdccd('0x3b')](_0x4ebe1f['model'],qs[_0xdccd('0x3c')](_0xbc43d6[_0xdccd('0x39')][_0xdccd('0x3c')]));_0x4b9b1f[_0xdccd('0x3d')]=_0x4b9b1f[_0xdccd('0x3d')][_0xdccd('0x3e')]?_0x4b9b1f[_0xdccd('0x3d')]:_0x4ebe1f[_0xdccd('0x38')];if(!_0xbc43d6['query']['hasOwnProperty'](_0xdccd('0x3f'))){_0x4b9b1f['limit']=qs[_0xdccd('0x40')](_0xbc43d6[_0xdccd('0x39')][_0xdccd('0x40')]);_0x4b9b1f[_0xdccd('0x22')]=qs['offset'](_0xbc43d6[_0xdccd('0x39')][_0xdccd('0x22')]);}_0x4b9b1f[_0xdccd('0x41')]=qs[_0xdccd('0x42')](_0xbc43d6[_0xdccd('0x39')][_0xdccd('0x42')]);_0x4b9b1f[_0xdccd('0x43')]=qs[_0xdccd('0x44')](_[_0xdccd('0x45')](_0xbc43d6[_0xdccd('0x39')],_0x4ebe1f[_0xdccd('0x44')]),_0x3ef0aa);if(_0xbc43d6['query'][_0xdccd('0x46')]){_0x4b9b1f[_0xdccd('0x43')]=_[_0xdccd('0x47')](_0x4b9b1f[_0xdccd('0x43')],{'$or':_[_0xdccd('0x48')](_0x3ef0aa,function(_0x4f8481){if(_0x4f8481['type']!==_0xdccd('0x49')){var _0x134b3c={};_0x134b3c[_0x4f8481[_0xdccd('0x30')]]={'$like':'%'+_0xbc43d6[_0xdccd('0x39')][_0xdccd('0x46')]+'%'};return _0x134b3c;}})});}_0x4b9b1f=_[_0xdccd('0x47')]({},_0x4b9b1f,_0xbc43d6[_0xdccd('0x4a')]);var _0x407b90={'where':_0x4b9b1f['where']};return db['Plugin'][_0xdccd('0x21')](_0x407b90)[_0xdccd('0x29')](function(_0x24a333){_0x275d9b['count']=_0x24a333;if(_0xbc43d6[_0xdccd('0x39')][_0xdccd('0x4b')]){_0x4b9b1f[_0xdccd('0x4c')]=[{'all':!![]}];}return db[_0xdccd('0x33')][_0xdccd('0x4d')](_0x4b9b1f);})[_0xdccd('0x29')](function(_0x39ef0c){_0x275d9b['rows']=_0x39ef0c;return _0x275d9b;})[_0xdccd('0x29')](respondWithFilteredResult(_0x210241,_0x4b9b1f))['catch'](handleError(_0x210241,null));};exports[_0xdccd('0x4e')]=function(_0x31aac0,_0x1c7255){var _0x264186={'raw':!![],'where':{'id':_0x31aac0[_0xdccd('0x4f')]['id']}},_0x3ac391={};_0x3ac391[_0xdccd('0x38')]=_[_0xdccd('0x3a')](db['Plugin'][_0xdccd('0x34')]);_0x3ac391[_0xdccd('0x39')]=_['keys'](_0x31aac0[_0xdccd('0x39')]);_0x3ac391[_0xdccd('0x44')]=_[_0xdccd('0x3b')](_0x3ac391[_0xdccd('0x38')],_0x3ac391[_0xdccd('0x39')]);_0x264186[_0xdccd('0x3d')]=_[_0xdccd('0x3b')](_0x3ac391[_0xdccd('0x38')],qs[_0xdccd('0x3c')](_0x31aac0['query']['fields']));_0x264186['attributes']=_0x264186[_0xdccd('0x3d')]['length']?_0x264186['attributes']:_0x3ac391['model'];if(_0x31aac0[_0xdccd('0x39')][_0xdccd('0x4b')]){_0x264186['include']=[{'all':!![]}];}_0x264186=_[_0xdccd('0x47')]({},_0x264186,_0x31aac0[_0xdccd('0x4a')]);return db[_0xdccd('0x33')]['find'](_0x264186)[_0xdccd('0x29')](handleEntityNotFound(_0x1c7255,null))[_0xdccd('0x29')](respondWithResult(_0x1c7255,null))[_0xdccd('0x50')](handleError(_0x1c7255,null));};exports['download']=function(_0xd1ac94,_0x55bc37,_0x3645a4){return db[_0xdccd('0x33')][_0xdccd('0x51')]({'where':{'id':_0xd1ac94['params']['id']},'attributes':[_0xdccd('0x30'),_0xdccd('0x6')],'raw':!![]})[_0xdccd('0x29')](handleEntityNotFound(_0x55bc37,null))[_0xdccd('0x29')](function(_0x545cda){if(_0x545cda){var _0x2c3ef3=path[_0xdccd('0x52')](config['root'],_0xdccd('0x53'),util[_0xdccd('0x54')](_0xdccd('0x55'),path[_0xdccd('0x56')](_0x545cda[_0xdccd('0x6')])));var _0x54ae5f=fs[_0xdccd('0x57')](_0x2c3ef3);var _0x2d9558=archiver('zip',{'zlib':{'level':0x9}});_0x2d9558['on'](_0xdccd('0x58'),function(_0x12ebb7){if(_0x12ebb7[_0xdccd('0x59')]===_0xdccd('0x5a')){logger[_0xdccd('0x2e')](_0x12ebb7);}else{throw new db[(_0xdccd('0x5b'))]['Error'](_0xdccd('0x5c'));}});_0x2d9558['on']('error',function(_0x12ba82){throw new db[(_0xdccd('0x5b'))][(_0xdccd('0x5d'))](_0xdccd('0x5c'));});_0x2d9558[_0xdccd('0x5e')](_0x54ae5f);_0x2d9558['glob'](_0xdccd('0x5f'),{'cwd':path[_0xdccd('0x52')](config[_0xdccd('0x60')],_0xdccd('0x53'),path[_0xdccd('0x61')](_0x545cda[_0xdccd('0x6')])),'ignore':[path['join'](path[_0xdccd('0x56')](_0x545cda[_0xdccd('0x6')]),_0xdccd('0x62')),path['join'](path[_0xdccd('0x56')](_0x545cda['path']),_0xdccd('0x63'))],'nodir':!![]})[_0xdccd('0x64')]();_0x54ae5f['on'](_0xdccd('0x65'),function(){if(!fs[_0xdccd('0x66')](_0x2c3ef3)){throw new db['Sequelize']['Error'](_0xdccd('0x67'));}return _0x55bc37[_0xdccd('0x68')](_0x2c3ef3,util[_0xdccd('0x54')](_0xdccd('0x55'),path[_0xdccd('0x56')](_0x545cda[_0xdccd('0x6')])),function(_0x30522b){if(_0x30522b){throw new db[(_0xdccd('0x5b'))][(_0xdccd('0x5d'))](_0xdccd('0x69'));}fs[_0xdccd('0x6a')](_0x2c3ef3);logger[_0xdccd('0x6b')]('Download\x20completed');logger[_0xdccd('0x6b')](_0xdccd('0x6c'));});});}return null;})[_0xdccd('0x50')](handleError(_0x55bc37,null));};exports['upload']=function(_0x86ae6b,_0x5c603a,_0x25d3f4){var _0x11e3e8=path[_0xdccd('0x56')](_0x86ae6b['file']['filename'],path[_0xdccd('0x6d')](_0x86ae6b[_0xdccd('0x6e')][_0xdccd('0x6f')]));var _0x3a9671=path[_0xdccd('0x52')](config[_0xdccd('0x60')],_0xdccd('0x53'),_0x86ae6b['file'][_0xdccd('0x6f')]);var _0x3ff684=path[_0xdccd('0x52')](config['root'],_0xdccd('0x53'),_0x11e3e8);logger[_0xdccd('0x6b')](_0xdccd('0x70'),_0x3a9671);logger['info'](_0xdccd('0x71'),_0x3ff684);try{fs[_0xdccd('0x72')](_0x3a9671,parseInt(_0xdccd('0x73'),0x8));extract(_0x3a9671,{'dir':_0x3ff684},function(_0x1fa243){if(_0x1fa243){logger[_0xdccd('0x2e')](_0x1fa243);handleError(_0x1fa243,!![]);};var _0x5af0f2=fs[_0xdccd('0x74')](_0x3ff684);if(_0x5af0f2['length']>0x1){removeReferences(_0x3a9671,_0x3ff684);logger[_0xdccd('0x2e')](_0xdccd('0x75'));return _0x25d3f4(new Error('Invalid\x20plugin\x20structure'));}var _0x43dfd4=fs[_0xdccd('0x76')](path[_0xdccd('0x52')](_0x3ff684,_0x5af0f2[0x0]));if(_0x43dfd4[_0xdccd('0x77')]()){removeReferences(_0x3a9671,_0x3ff684);logger[_0xdccd('0x2e')](_0xdccd('0x75'));return _0x25d3f4(new Error(_0xdccd('0x75')));}if(_0x43dfd4[_0xdccd('0x78')]()){var _0x57139=fs[_0xdccd('0x74')](path['join'](_0x3ff684,_0x5af0f2[0x0]));if(_0x57139['length']===0x0){removeReferences(_0x3a9671,_0x3ff684);logger['error'](_0xdccd('0x75'));return _0x25d3f4(new Error(_0xdccd('0x75')));}var _0xdf0ffd=_0x57139['some'](function(_0x260565){return _0x260565===_0xdccd('0x79');});if(!_0xdf0ffd){return _0x25d3f4(new Error(_0xdccd('0x7a')));}var _0x38e59f=fs[_0xdccd('0x7b')](path[_0xdccd('0x52')](_0x3ff684,_0x5af0f2[0x0],'manifest.json'));var _0x37b674=JSON[_0xdccd('0x7c')](_0x38e59f);if('undefined'==typeof _0x37b674[_0xdccd('0x30')]){return _0x25d3f4(new Error(_0xdccd('0x7d')));}if(_0xdccd('0x20')==typeof _0x37b674['type']){return _0x25d3f4(new Error(_0xdccd('0x7e')));}if(_0xdccd('0x20')==typeof _0x37b674[_0xdccd('0x7f')]){return _0x25d3f4(new Error(_0xdccd('0x80')));}if(_0xdccd('0x20')==typeof _0x37b674[_0xdccd('0x81')]){return _0x25d3f4(new Error(_0xdccd('0x82')));}if(_0x37b674[_0xdccd('0x36')]===_0xdccd('0x83')){if(_0xdccd('0x20')==typeof _0x37b674[_0xdccd('0x81')]['views']){return _0x25d3f4(new Error(_0xdccd('0x84')));}if(_0xdccd('0x20')==typeof _0x37b674['parameters'][_0xdccd('0x85')][_0xdccd('0x86')]&&'undefined'==typeof _0x37b674['parameters'][_0xdccd('0x85')]['agent']){return _0x25d3f4(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x37b674[_0xdccd('0x36')]===_0xdccd('0x87')){if('undefined'==typeof _0x37b674[_0xdccd('0x81')]['scriptName']){return _0x25d3f4(new Error(_0xdccd('0x88')));}if(_0xdccd('0x20')==typeof _0x37b674[_0xdccd('0x81')][_0xdccd('0x89')]){return _0x25d3f4(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x25d3f4(new Error(_0xdccd('0x8a')));}var _0xf3b59e=_0x37b674['name'];var _0x324750=_0x37b674['description'];var _0x1e721c=_0x37b674[_0xdccd('0x36')];var _0x4af000=_0x37b674[_0xdccd('0x8b')]?_0x37b674[_0xdccd('0x8b')]:_0xdccd('0x8c');var _0x5409f8=_0x37b674[_0xdccd('0x8d')]?_0x37b674['icon']:_0xdccd('0x8e');var _0x3fea28='';var _0xe5f3f9='';var _0x2f0187='';var _0x4cf0b4='';var _0x50a9c8=_0x37b674[_0xdccd('0x7f')];if(_0x1e721c===_0xdccd('0x83')){if(_0xdccd('0x20')!=typeof _0x37b674[_0xdccd('0x81')]['views'][_0xdccd('0x86')]){var _0x43ff14=_0x37b674['parameters']['views'][_0xdccd('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xdccd('0x8f')](_0x43ff14)){_0x3fea28=path[_0xdccd('0x52')](_0xdccd('0x90'),_0x11e3e8,_0x5af0f2[0x0],_0x43ff14);}else{_0x3fea28=_0x43ff14;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x37b674[_0xdccd('0x81')][_0xdccd('0x85')][_0xdccd('0x91')]){var _0x492f82=_0x37b674[_0xdccd('0x81')][_0xdccd('0x85')][_0xdccd('0x91')];if(!/^(f|ht)tps?:\/\//i[_0xdccd('0x8f')](_0x492f82)){_0xe5f3f9=path[_0xdccd('0x52')](_0xdccd('0x90'),_0x11e3e8,_0x5af0f2[0x0],_0x492f82);}else{_0xe5f3f9=_0x492f82;}}else{logger['info'](_0xdccd('0x92'));}}else if(_0x1e721c==='script'){_0x2f0187=_0x37b674[_0xdccd('0x81')][_0xdccd('0x93')];_0x4cf0b4=_0x37b674[_0xdccd('0x81')][_0xdccd('0x89')];if(_0xdccd('0x20')!=typeof _0x37b674['parameters'][_0xdccd('0x85')]){if(_0xdccd('0x20')!=typeof _0x37b674[_0xdccd('0x81')]['views'][_0xdccd('0x86')]){var _0x43ff14=_0x37b674[_0xdccd('0x81')][_0xdccd('0x85')][_0xdccd('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xdccd('0x8f')](_0x43ff14)){_0x3fea28=path[_0xdccd('0x52')](_0xdccd('0x90'),_0x11e3e8,_0x5af0f2[0x0],_0x43ff14);}else{_0x3fea28=_0x43ff14;}}if('undefined'!=typeof _0x37b674['parameters'][_0xdccd('0x85')][_0xdccd('0x91')]){var _0x492f82=_0x37b674[_0xdccd('0x81')][_0xdccd('0x85')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xdccd('0x8f')](_0x492f82)){_0xe5f3f9=path[_0xdccd('0x52')](_0xdccd('0x90'),_0x11e3e8,_0x5af0f2[0x0],_0x492f82);}else{_0xe5f3f9=_0x492f82;}}}}var _0x329051={'name':_0xf3b59e,'description':_0x324750,'path':path[_0xdccd('0x52')](_0x11e3e8,_0x5af0f2[0x0]),'type':_0x1e721c,'sidebar':_0x4af000,'icon':_0x5409f8,'adminUrl':_0x3fea28,'agentUrl':_0xe5f3f9,'scriptName':_0x2f0187,'scriptPath':_0x4cf0b4,'version':_0x50a9c8};removeReferences(_0x3a9671,null);return db['Plugin']['create'](_0x329051)[_0xdccd('0x29')](function(_0x3a9ed1){var _0x490aaf={'role':_0x86ae6b['body'][_0xdccd('0x94')],'userProfileId':_0x86ae6b[_0xdccd('0x95')]['userProfileId']};if(!_0x490aaf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x490aaf[_0xdccd('0x94')]===_0xdccd('0x96')){var _0x17bafe=_0x3a9ed1['get']({'plain':!![]});return db[_0xdccd('0x97')][_0xdccd('0x51')]({'where':{'name':_0xdccd('0x2c'),'userProfileId':_0x490aaf[_0xdccd('0x98')]},'raw':!![]})[_0xdccd('0x29')](function(_0x46f4c8){if(_0x46f4c8&&_0x46f4c8[_0xdccd('0x99')]===0x0){return db[_0xdccd('0x2d')][_0xdccd('0x9a')]({'name':_0x17bafe[_0xdccd('0x30')],'resourceId':_0x17bafe['id'],'type':_0x46f4c8[_0xdccd('0x30')],'sectionId':_0x46f4c8['id']},{})[_0xdccd('0x29')](function(){return _0x3a9ed1;});}else{return _0x3a9ed1;}})[_0xdccd('0x50')](function(_0x211455){logger[_0xdccd('0x2e')](_0xdccd('0x9b'),_0x211455);throw _0x211455;});}return _0x3a9ed1;})[_0xdccd('0x29')](respondWithResult(_0x5c603a,null))[_0xdccd('0x50')](handleError(_0x5c603a,null));}});}catch(_0x13e0b0){_0x5c603a[_0xdccd('0x1d')](0x1f4)[_0xdccd('0x31')](_0x13e0b0);}};function removeReferences(_0x502091,_0x40922d){try{if(_0x502091){fs['unlinkSync'](_0x502091);logger[_0xdccd('0x6b')]('Zip\x20archive\x20removed');}if(_0x40922d){rimraf(_0x40922d,function(){});logger['info'](_0xdccd('0x9c'));}}catch(_0xe02e9a){logger[_0xdccd('0x2e')](_0xe02e9a);}}exports[_0xdccd('0x28')]=function(_0x3edb40,_0x314d17,_0x40eaeb){return db['Plugin'][_0xdccd('0x51')]({'where':{'id':_0x3edb40[_0xdccd('0x4f')]['id']}})[_0xdccd('0x29')](handleEntityNotFound(_0x314d17,null))[_0xdccd('0x29')](saveUpdates(_0x3edb40[_0xdccd('0x95')],null))[_0xdccd('0x29')](respondWithResult(_0x314d17,null))[_0xdccd('0x50')](handleError(_0x314d17,null));};exports[_0xdccd('0x9d')]=function(_0x3b1165,_0x60e33e,_0xe66b62){return db['Plugin'][_0xdccd('0x51')]({'where':{'id':_0x3b1165[_0xdccd('0x4f')]['id']}})[_0xdccd('0x29')](function(_0x1f77dc){if(_0x1f77dc){return _0x1f77dc['destroy']();}})[_0xdccd('0x29')](function(_0x8e41a7){rimraf(path['join'](config[_0xdccd('0x60')],_0xdccd('0x53'),path[_0xdccd('0x61')](_0x8e41a7[_0xdccd('0x6')])),function(){});return _0x8e41a7;})[_0xdccd('0x29')](handleEntityNotFound(_0x60e33e,null))[_0xdccd('0x29')](respondWithStatusCode(_0x60e33e,null))[_0xdccd('0x50')](handleError(_0x60e33e,null));};exports[_0xdccd('0x9e')]=function(_0x178471,_0x16de7b,_0x207bea){return BPromise[_0xdccd('0x9f')]()[_0xdccd('0x29')](function(){if(!_0x178471[_0xdccd('0x39')][_0xdccd('0x6')]){throw new Error(_0xdccd('0xa0'));}if(!_0x178471[_0xdccd('0x39')][_0xdccd('0xa1')]){throw new Error(_0xdccd('0xa2'));}var _0x706299=_0x178471[_0xdccd('0x39')]['hostname']?_0x178471['query']['hostname']+':'+_0x178471[_0xdccd('0x39')][_0xdccd('0xa1')]:'http://localhost:'+_0x178471[_0xdccd('0x39')][_0xdccd('0xa1')];var _0xf5e1ec=_0x178471[_0xdccd('0x39')]['json']?_0x178471[_0xdccd('0x39')]['json']:!![];var _0x3af503=_0x178471[_0xdccd('0x39')][_0xdccd('0xa3')]?_0x178471[_0xdccd('0x39')][_0xdccd('0xa3')]:null;var _0x2471b2={'method':_0x178471[_0xdccd('0xa4')],'uri':util[_0xdccd('0x54')](_0xdccd('0xa5'),_0x706299,_0x178471[_0xdccd('0x39')][_0xdccd('0x6')]),'json':_0xf5e1ec,'resolveWithFullResponse':!![],'encoding':_0x3af503,'qs':_0x178471[_0xdccd('0x39')]};if(_0x178471['headers']){_0x2471b2[_0xdccd('0xa6')]=_0x178471['headers'];if(_0x2471b2['headers'][_0xdccd('0xa7')]){delete _0x2471b2[_0xdccd('0xa6')][_0xdccd('0xa7')];}}if(_0x2471b2['headers'][_0xdccd('0xa8')]){delete _0x2471b2[_0xdccd('0xa6')][_0xdccd('0xa8')];}return rp(_0x2471b2);})[_0xdccd('0x29')](function(_0x22afb5){if(_0x22afb5){_0x16de7b[_0xdccd('0x23')](_0x22afb5[_0xdccd('0xa6')]);logger[_0xdccd('0x6b')](_0x22afb5['body']);if(_['endsWith'](_0x178471[_0xdccd('0x39')][_0xdccd('0x6')],_0xdccd('0x68'))&&_0x22afb5['statusCode']==0x1f4){return _0x16de7b[_0xdccd('0x1c')](_0x22afb5[_0xdccd('0xa9')]);}else{return _0x16de7b[_0xdccd('0x1d')](_0x22afb5[_0xdccd('0xa9')])['send'](_0x22afb5[_0xdccd('0x95')]);}}else{return _0x16de7b[_0xdccd('0x1c')](0xc8);}})[_0xdccd('0x50')](handleError(_0x16de7b,null));};exports[_0xdccd('0xaa')]=function(_0x545f67,_0x1681cc,_0x76b06f){return BPromise['resolve']()[_0xdccd('0x29')](function(){if(!_0x545f67[_0xdccd('0x39')][_0xdccd('0x6')]){throw new Error(_0xdccd('0xa0'));}if(!_0x545f67[_0xdccd('0x39')][_0xdccd('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x9dadcb=_0x545f67[_0xdccd('0x39')]['hostname']?_0x545f67['query']['hostname']+':'+_0x545f67[_0xdccd('0x39')]['port']:_0xdccd('0xab')+_0x545f67[_0xdccd('0x39')][_0xdccd('0xa1')];var _0x3d0ec0=_0x545f67[_0xdccd('0x39')]['json']?_0x545f67['query'][_0xdccd('0x1f')]:!![];var _0x39ebb6=_0x545f67[_0xdccd('0x39')][_0xdccd('0xa3')]?_0x545f67[_0xdccd('0x39')][_0xdccd('0xa3')]:null;var _0x35e3fe={'method':_0x545f67[_0xdccd('0xa4')],'uri':util[_0xdccd('0x54')](_0xdccd('0xa5'),_0x9dadcb,_0x545f67[_0xdccd('0x39')]['path']),'json':_0x3d0ec0,'resolveWithFullResponse':!![],'encoding':_0x39ebb6,'body':_0x545f67[_0xdccd('0x95')]};if(_0x545f67['headers']){_0x35e3fe['headers']=_0x545f67[_0xdccd('0xa6')];if(_0x35e3fe[_0xdccd('0xa6')][_0xdccd('0xa7')]){delete _0x35e3fe[_0xdccd('0xa6')][_0xdccd('0xa7')];}}if(_0x35e3fe[_0xdccd('0xa6')][_0xdccd('0xa8')]){delete _0x35e3fe[_0xdccd('0xa6')][_0xdccd('0xa8')];}return rp(_0x35e3fe);})[_0xdccd('0x29')](function(_0x2e40ae){if(_0x2e40ae){_0x1681cc[_0xdccd('0x23')](_0x2e40ae[_0xdccd('0xa6')]);logger[_0xdccd('0x6b')](_0x2e40ae[_0xdccd('0x95')]);return _0x1681cc['status'](_0x2e40ae['statusCode'])[_0xdccd('0x31')](_0x2e40ae[_0xdccd('0x95')]);}else{return _0x1681cc['sendStatus'](0xc8);}})[_0xdccd('0x50')](handleError(_0x1681cc,null));}; \ No newline at end of file +var _0xc8a9=['Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./plugin.socket','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','get','destroy','sendStatus','error','send','map','Plugin','fieldName','type','name','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','download','path','root','server/files/plugins','format','zip','warning','code','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','script','scriptName'];(function(_0x39d481,_0x23c1a2){var _0x3b22d0=function(_0xea81e6){while(--_0xea81e6){_0x39d481['push'](_0x39d481['shift']());}};_0x3b22d0(++_0x23c1a2);}(_0xc8a9,0xd8));var _0x9c8a=function(_0x1dbb78,_0x363527){_0x1dbb78=_0x1dbb78-0x0;var _0x97030a=_0xc8a9[_0x1dbb78];return _0x97030a;};'use strict';var emlformat=require(_0x9c8a('0x0'));var rimraf=require(_0x9c8a('0x1'));var zipdir=require(_0x9c8a('0x2'));var jsonpatch=require(_0x9c8a('0x3'));var rp=require(_0x9c8a('0x4'));var moment=require(_0x9c8a('0x5'));var BPromise=require(_0x9c8a('0x6'));var Mustache=require(_0x9c8a('0x7'));var util=require(_0x9c8a('0x8'));var path=require('path');var sox=require(_0x9c8a('0x9'));var csv=require(_0x9c8a('0xa'));var ejs=require(_0x9c8a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c8a('0xc'));var crypto=require(_0x9c8a('0xd'));var jsforce=require(_0x9c8a('0xe'));var deskjs=require(_0x9c8a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9c8a('0x10'));var Papa=require(_0x9c8a('0x11'));var extract=require(_0x9c8a('0x12'));var rimraf=require(_0x9c8a('0x1'));var archiver=require(_0x9c8a('0x13'));var Redis=require(_0x9c8a('0x14'));var authService=require(_0x9c8a('0x15'));var qs=require(_0x9c8a('0x16'));var as=require(_0x9c8a('0x17'));var hardwareService=require(_0x9c8a('0x18'));var logger=require(_0x9c8a('0x19'))(_0x9c8a('0x1a'));var utils=require(_0x9c8a('0x1b'));var config=require(_0x9c8a('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c8a('0x1d'))['db'];config['redis']=_[_0x9c8a('0x1e')](config[_0x9c8a('0x1f')],{'host':_0x9c8a('0x20'),'port':0x18eb});var socket=require(_0x9c8a('0x21'))(new Redis(config['redis']));require(_0x9c8a('0x22'))['register'](socket);function respondWithStatusCode(_0x497f58,_0x421690){_0x421690=_0x421690||0xcc;return function(_0x4b730f){if(_0x4b730f){return _0x497f58['sendStatus'](_0x421690);}return _0x497f58[_0x9c8a('0x23')](_0x421690)[_0x9c8a('0x24')]();};}function respondWithResult(_0x4d7b8c,_0x47fe1){_0x47fe1=_0x47fe1||0xc8;return function(_0x1c2334){if(_0x1c2334){return _0x4d7b8c[_0x9c8a('0x23')](_0x47fe1)[_0x9c8a('0x25')](_0x1c2334);}};}function respondWithFilteredResult(_0x48185e,_0x7c89bb){return function(_0x25abe9){if(_0x25abe9){var _0x430698=typeof _0x7c89bb['offset']===_0x9c8a('0x26')&&typeof _0x7c89bb['limit']==='undefined';var _0x3e7456=_0x25abe9[_0x9c8a('0x27')];var _0x53b273=_0x430698?0x0:_0x7c89bb[_0x9c8a('0x28')];var _0x2c1450=_0x430698?_0x25abe9['count']:_0x7c89bb[_0x9c8a('0x28')]+_0x7c89bb[_0x9c8a('0x29')];var _0x1ee284;if(_0x2c1450>=_0x3e7456){_0x2c1450=_0x3e7456;_0x1ee284=0xc8;}else{_0x1ee284=0xce;}_0x48185e[_0x9c8a('0x23')](_0x1ee284);return _0x48185e['set'](_0x9c8a('0x2a'),_0x53b273+'-'+_0x2c1450+'/'+_0x3e7456)['json'](_0x25abe9);}return null;};}function patchUpdates(_0x552f3a){return function(_0x5cd2f0){try{jsonpatch[_0x9c8a('0x2b')](_0x5cd2f0,_0x552f3a,!![]);}catch(_0x2d6b4e){return BPromise[_0x9c8a('0x2c')](_0x2d6b4e);}return _0x5cd2f0[_0x9c8a('0x2d')]();};}function saveUpdates(_0x1b493c,_0xb8aca2){return function(_0x220ad6){if(_0x220ad6){return _0x220ad6['update'](_0x1b493c)[_0x9c8a('0x2e')](function(_0x46b567){return _0x46b567;});}return null;};}function removeEntity(_0x1cfd04,_0x509dd0){return function(_0x478aac){if(_0x478aac){return _0x478aac['destroy']()[_0x9c8a('0x2e')](function(){var _0x46d2cd=_0x478aac[_0x9c8a('0x2f')]({'plain':!![]});var _0x453377='Plugins';return db['UserProfileResource'][_0x9c8a('0x30')]({'where':{'type':_0x453377,'resourceId':_0x46d2cd['id']}})[_0x9c8a('0x2e')](function(){return _0x478aac;});})['then'](function(){_0x1cfd04[_0x9c8a('0x23')](0xcc)[_0x9c8a('0x24')]();});}};}function handleEntityNotFound(_0x4c61ba,_0x215f8e){return function(_0x5b348e){if(!_0x5b348e){_0x4c61ba[_0x9c8a('0x31')](0x194);}return _0x5b348e;};}function handleError(_0x3763c4,_0x2e864b){_0x2e864b=_0x2e864b||0x1f4;return function(_0x4f28f1){logger[_0x9c8a('0x32')](_0x4f28f1['stack']);if(_0x4f28f1['name']){delete _0x4f28f1['name'];}_0x3763c4[_0x9c8a('0x23')](_0x2e864b)[_0x9c8a('0x33')](_0x4f28f1);};}exports['index']=function(_0x321866,_0x3663dd){var _0x11d063={},_0x31b70d={},_0x4d2b4f={'count':0x0,'rows':[]};var _0xc62998=_[_0x9c8a('0x34')](db[_0x9c8a('0x35')]['rawAttributes'],function(_0x586ffe){return{'name':_0x586ffe[_0x9c8a('0x36')],'type':_0x586ffe[_0x9c8a('0x37')]['key']};});_0x31b70d['model']=_[_0x9c8a('0x34')](_0xc62998,_0x9c8a('0x38'));_0x31b70d[_0x9c8a('0x39')]=_['keys'](_0x321866['query']);_0x31b70d[_0x9c8a('0x3a')]=_['intersection'](_0x31b70d[_0x9c8a('0x3b')],_0x31b70d[_0x9c8a('0x39')]);_0x11d063['attributes']=_[_0x9c8a('0x3c')](_0x31b70d[_0x9c8a('0x3b')],qs[_0x9c8a('0x3d')](_0x321866['query'][_0x9c8a('0x3d')]));_0x11d063[_0x9c8a('0x3e')]=_0x11d063[_0x9c8a('0x3e')][_0x9c8a('0x3f')]?_0x11d063['attributes']:_0x31b70d[_0x9c8a('0x3b')];if(!_0x321866['query'][_0x9c8a('0x40')](_0x9c8a('0x41'))){_0x11d063[_0x9c8a('0x29')]=qs['limit'](_0x321866[_0x9c8a('0x39')][_0x9c8a('0x29')]);_0x11d063[_0x9c8a('0x28')]=qs['offset'](_0x321866['query']['offset']);}_0x11d063['order']=qs['sort'](_0x321866[_0x9c8a('0x39')][_0x9c8a('0x42')]);_0x11d063[_0x9c8a('0x43')]=qs[_0x9c8a('0x3a')](_[_0x9c8a('0x44')](_0x321866['query'],_0x31b70d[_0x9c8a('0x3a')]),_0xc62998);if(_0x321866[_0x9c8a('0x39')][_0x9c8a('0x45')]){_0x11d063[_0x9c8a('0x43')]=_[_0x9c8a('0x46')](_0x11d063[_0x9c8a('0x43')],{'$or':_['map'](_0xc62998,function(_0x48cdb6){if(_0x48cdb6[_0x9c8a('0x37')]!=='VIRTUAL'){var _0x2069c8={};_0x2069c8[_0x48cdb6[_0x9c8a('0x38')]]={'$like':'%'+_0x321866[_0x9c8a('0x39')][_0x9c8a('0x45')]+'%'};return _0x2069c8;}})});}_0x11d063=_['merge']({},_0x11d063,_0x321866['options']);var _0x418fab={'where':_0x11d063['where']};return db['Plugin']['count'](_0x418fab)[_0x9c8a('0x2e')](function(_0x3fbf96){_0x4d2b4f[_0x9c8a('0x27')]=_0x3fbf96;if(_0x321866[_0x9c8a('0x39')]['includeAll']){_0x11d063[_0x9c8a('0x47')]=[{'all':!![]}];}return db[_0x9c8a('0x35')][_0x9c8a('0x48')](_0x11d063);})[_0x9c8a('0x2e')](function(_0x59eec4){_0x4d2b4f[_0x9c8a('0x49')]=_0x59eec4;return _0x4d2b4f;})[_0x9c8a('0x2e')](respondWithFilteredResult(_0x3663dd,_0x11d063))['catch'](handleError(_0x3663dd,null));};exports[_0x9c8a('0x4a')]=function(_0x1993cc,_0x2e5029){var _0x3352fb={'raw':!![],'where':{'id':_0x1993cc[_0x9c8a('0x4b')]['id']}},_0x28d2b1={};_0x28d2b1[_0x9c8a('0x3b')]=_[_0x9c8a('0x4c')](db[_0x9c8a('0x35')][_0x9c8a('0x4d')]);_0x28d2b1['query']=_['keys'](_0x1993cc[_0x9c8a('0x39')]);_0x28d2b1[_0x9c8a('0x3a')]=_[_0x9c8a('0x3c')](_0x28d2b1[_0x9c8a('0x3b')],_0x28d2b1[_0x9c8a('0x39')]);_0x3352fb[_0x9c8a('0x3e')]=_['intersection'](_0x28d2b1['model'],qs[_0x9c8a('0x3d')](_0x1993cc[_0x9c8a('0x39')][_0x9c8a('0x3d')]));_0x3352fb[_0x9c8a('0x3e')]=_0x3352fb[_0x9c8a('0x3e')][_0x9c8a('0x3f')]?_0x3352fb['attributes']:_0x28d2b1[_0x9c8a('0x3b')];if(_0x1993cc[_0x9c8a('0x39')][_0x9c8a('0x4e')]){_0x3352fb['include']=[{'all':!![]}];}_0x3352fb=_[_0x9c8a('0x46')]({},_0x3352fb,_0x1993cc['options']);return db[_0x9c8a('0x35')][_0x9c8a('0x4f')](_0x3352fb)['then'](handleEntityNotFound(_0x2e5029,null))[_0x9c8a('0x2e')](respondWithResult(_0x2e5029,null))[_0x9c8a('0x50')](handleError(_0x2e5029,null));};exports[_0x9c8a('0x51')]=function(_0x179c96,_0x397083,_0x28039b){return db['Plugin'][_0x9c8a('0x4f')]({'where':{'id':_0x179c96[_0x9c8a('0x4b')]['id']},'attributes':[_0x9c8a('0x38'),_0x9c8a('0x52')],'raw':!![]})[_0x9c8a('0x2e')](handleEntityNotFound(_0x397083,null))[_0x9c8a('0x2e')](function(_0x1f9234){if(_0x1f9234){var _0x4b7b87=path['join'](config[_0x9c8a('0x53')],_0x9c8a('0x54'),util[_0x9c8a('0x55')]('%s.zip',path['basename'](_0x1f9234[_0x9c8a('0x52')])));var _0xce55d5=fs['createWriteStream'](_0x4b7b87);var _0x34d40c=archiver(_0x9c8a('0x56'),{'zlib':{'level':0x9}});_0x34d40c['on'](_0x9c8a('0x57'),function(_0x24d860){if(_0x24d860[_0x9c8a('0x58')]==='ENOENT'){logger[_0x9c8a('0x32')](_0x24d860);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x34d40c['on'](_0x9c8a('0x32'),function(_0x5b37b8){throw new db[(_0x9c8a('0x59'))]['Error'](_0x9c8a('0x5a'));});_0x34d40c['pipe'](_0xce55d5);_0x34d40c[_0x9c8a('0x5b')](_0x9c8a('0x5c'),{'cwd':path[_0x9c8a('0x5d')](config[_0x9c8a('0x53')],_0x9c8a('0x54'),path[_0x9c8a('0x5e')](_0x1f9234['path'])),'ignore':[path[_0x9c8a('0x5d')](path[_0x9c8a('0x5f')](_0x1f9234[_0x9c8a('0x52')]),_0x9c8a('0x60')),path['join'](path[_0x9c8a('0x5f')](_0x1f9234[_0x9c8a('0x52')]),_0x9c8a('0x61'))],'nodir':!![]})[_0x9c8a('0x62')]();_0xce55d5['on'](_0x9c8a('0x63'),function(){if(!fs[_0x9c8a('0x64')](_0x4b7b87)){throw new db[(_0x9c8a('0x59'))]['Error'](_0x9c8a('0x65'));}return _0x397083[_0x9c8a('0x51')](_0x4b7b87,util[_0x9c8a('0x55')](_0x9c8a('0x66'),path['basename'](_0x1f9234[_0x9c8a('0x52')])),function(_0x5c4d2e){if(_0x5c4d2e){throw new db[(_0x9c8a('0x59'))][(_0x9c8a('0x67'))](_0x9c8a('0x68'));}fs[_0x9c8a('0x69')](_0x4b7b87);logger[_0x9c8a('0x6a')](_0x9c8a('0x6b'));logger[_0x9c8a('0x6a')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x397083,null));};exports[_0x9c8a('0x6c')]=function(_0x5a534b,_0x42fa7e,_0x203536){var _0x16c44c=path[_0x9c8a('0x5f')](_0x5a534b[_0x9c8a('0x6d')][_0x9c8a('0x6e')],path[_0x9c8a('0x6f')](_0x5a534b[_0x9c8a('0x6d')][_0x9c8a('0x6e')]));var _0xdea4ba=path[_0x9c8a('0x5d')](config[_0x9c8a('0x53')],'server/files/plugins',_0x5a534b[_0x9c8a('0x6d')][_0x9c8a('0x6e')]);var _0x42210a=path[_0x9c8a('0x5d')](config['root'],'server/files/plugins',_0x16c44c);logger[_0x9c8a('0x6a')](_0x9c8a('0x70'),_0xdea4ba);logger[_0x9c8a('0x6a')](_0x9c8a('0x71'),_0x42210a);try{fs['chmodSync'](_0xdea4ba,parseInt(_0x9c8a('0x72'),0x8));extract(_0xdea4ba,{'dir':_0x42210a},function(_0x1045bc){if(_0x1045bc){logger[_0x9c8a('0x32')](_0x1045bc);handleError(_0x1045bc,!![]);};var _0xa0b6f3=fs[_0x9c8a('0x73')](_0x42210a);if(_0xa0b6f3[_0x9c8a('0x3f')]>0x1){removeReferences(_0xdea4ba,_0x42210a);logger['error']('Invalid\x20plugin\x20structure');return _0x203536(new Error(_0x9c8a('0x74')));}var _0x3f0614=fs[_0x9c8a('0x75')](path[_0x9c8a('0x5d')](_0x42210a,_0xa0b6f3[0x0]));if(_0x3f0614[_0x9c8a('0x76')]()){removeReferences(_0xdea4ba,_0x42210a);logger[_0x9c8a('0x32')](_0x9c8a('0x74'));return _0x203536(new Error('Invalid\x20plugin\x20structure'));}if(_0x3f0614[_0x9c8a('0x77')]()){var _0x120ed6=fs[_0x9c8a('0x73')](path[_0x9c8a('0x5d')](_0x42210a,_0xa0b6f3[0x0]));if(_0x120ed6[_0x9c8a('0x3f')]===0x0){removeReferences(_0xdea4ba,_0x42210a);logger[_0x9c8a('0x32')](_0x9c8a('0x74'));return _0x203536(new Error(_0x9c8a('0x74')));}var _0x384c13=_0x120ed6[_0x9c8a('0x78')](function(_0x210da0){return _0x210da0===_0x9c8a('0x79');});if(!_0x384c13){return _0x203536(new Error(_0x9c8a('0x7a')));}var _0x6b22bc=fs[_0x9c8a('0x7b')](path['join'](_0x42210a,_0xa0b6f3[0x0],_0x9c8a('0x79')));var _0x3e519a=JSON[_0x9c8a('0x7c')](_0x6b22bc);if(_0x9c8a('0x26')==typeof _0x3e519a['name']){return _0x203536(new Error(_0x9c8a('0x7d')));}if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x37')]){return _0x203536(new Error(_0x9c8a('0x7e')));}if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x7f')]){return _0x203536(new Error(_0x9c8a('0x80')));}if(_0x9c8a('0x26')==typeof _0x3e519a['parameters']){return _0x203536(new Error(_0x9c8a('0x81')));}if(_0x3e519a[_0x9c8a('0x37')]===_0x9c8a('0x82')){if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]){return _0x203536(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x9c8a('0x26')==typeof _0x3e519a['parameters'][_0x9c8a('0x84')][_0x9c8a('0x85')]&&_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent']){return _0x203536(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3e519a[_0x9c8a('0x37')]===_0x9c8a('0x86')){if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x87')]){return _0x203536(new Error(_0x9c8a('0x88')));}if(_0x9c8a('0x26')==typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x89')]){return _0x203536(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x203536(new Error(_0x9c8a('0x8a')));}var _0x3884e6=_0x3e519a[_0x9c8a('0x38')];var _0x53fe1a=_0x3e519a[_0x9c8a('0x8b')];var _0x3a1316=_0x3e519a[_0x9c8a('0x37')];var _0x3c1e77=_0x3e519a[_0x9c8a('0x8c')]?_0x3e519a['sidebar']:'always';var _0x1744ac=_0x3e519a[_0x9c8a('0x8d')]?_0x3e519a[_0x9c8a('0x8d')]:'icon-apps';var _0x9230fd='';var _0x506e37='';var _0x3f52ae='';var _0x14c9a8='';var _0x15554e=_0x3e519a[_0x9c8a('0x7f')];if(_0x3a1316===_0x9c8a('0x82')){if(_0x9c8a('0x26')!=typeof _0x3e519a['parameters'][_0x9c8a('0x84')][_0x9c8a('0x85')]){var _0x4912ae=_0x3e519a[_0x9c8a('0x83')]['views'][_0x9c8a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x4912ae)){_0x9230fd=path[_0x9c8a('0x5d')]('plugins',_0x16c44c,_0xa0b6f3[0x0],_0x4912ae);}else{_0x9230fd=_0x4912ae;}}else{logger[_0x9c8a('0x6a')](_0x9c8a('0x8f'));}if('undefined'!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent']){var _0x2a61ff=_0x3e519a[_0x9c8a('0x83')]['views'][_0x9c8a('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x2a61ff)){_0x506e37=path[_0x9c8a('0x5d')](_0x9c8a('0x91'),_0x16c44c,_0xa0b6f3[0x0],_0x2a61ff);}else{_0x506e37=_0x2a61ff;}}else{logger[_0x9c8a('0x6a')](_0x9c8a('0x92'));}}else if(_0x3a1316==='script'){_0x3f52ae=_0x3e519a[_0x9c8a('0x83')]['scriptName'];_0x14c9a8=_0x3e519a['parameters']['scriptPath'];if('undefined'!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]){if(_0x9c8a('0x26')!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')][_0x9c8a('0x85')]){var _0x4912ae=_0x3e519a[_0x9c8a('0x83')]['views'][_0x9c8a('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x4912ae)){_0x9230fd=path[_0x9c8a('0x5d')]('plugins',_0x16c44c,_0xa0b6f3[0x0],_0x4912ae);}else{_0x9230fd=_0x4912ae;}}if(_0x9c8a('0x26')!=typeof _0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent']){var _0x2a61ff=_0x3e519a[_0x9c8a('0x83')][_0x9c8a('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9c8a('0x8e')](_0x2a61ff)){_0x506e37=path[_0x9c8a('0x5d')](_0x9c8a('0x91'),_0x16c44c,_0xa0b6f3[0x0],_0x2a61ff);}else{_0x506e37=_0x2a61ff;}}}}var _0x58890d={'name':_0x3884e6,'description':_0x53fe1a,'path':path['join'](_0x16c44c,_0xa0b6f3[0x0]),'type':_0x3a1316,'sidebar':_0x3c1e77,'icon':_0x1744ac,'adminUrl':_0x9230fd,'agentUrl':_0x506e37,'scriptName':_0x3f52ae,'scriptPath':_0x14c9a8,'version':_0x15554e};removeReferences(_0xdea4ba,null);return db[_0x9c8a('0x35')]['create'](_0x58890d)[_0x9c8a('0x2e')](function(_0x47def6){var _0x1ea2cb={'role':_0x5a534b[_0x9c8a('0x93')][_0x9c8a('0x94')],'userProfileId':_0x5a534b[_0x9c8a('0x93')][_0x9c8a('0x95')]};if(!_0x1ea2cb)throw new Error(_0x9c8a('0x96'));if(_0x1ea2cb['role']===_0x9c8a('0x97')){var _0x3e34b6=_0x47def6[_0x9c8a('0x2f')]({'plain':!![]});return db[_0x9c8a('0x98')][_0x9c8a('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x1ea2cb['userProfileId']},'raw':!![]})['then'](function(_0x841c2f){if(_0x841c2f&&_0x841c2f[_0x9c8a('0x99')]===0x0){return db[_0x9c8a('0x9a')][_0x9c8a('0x9b')]({'name':_0x3e34b6['name'],'resourceId':_0x3e34b6['id'],'type':_0x841c2f['name'],'sectionId':_0x841c2f['id']},{})[_0x9c8a('0x2e')](function(){return _0x47def6;});}else{return _0x47def6;}})[_0x9c8a('0x50')](function(_0x427cb2){logger[_0x9c8a('0x32')](_0x9c8a('0x9c'),_0x427cb2);throw _0x427cb2;});}return _0x47def6;})['then'](respondWithResult(_0x42fa7e,null))['catch'](handleError(_0x42fa7e,null));}});}catch(_0x80e33){_0x42fa7e[_0x9c8a('0x23')](0x1f4)[_0x9c8a('0x33')](_0x80e33);}};function removeReferences(_0x4880af,_0x2acda7){try{if(_0x4880af){fs[_0x9c8a('0x69')](_0x4880af);logger['info'](_0x9c8a('0x9d'));}if(_0x2acda7){rimraf(_0x2acda7,function(){});logger[_0x9c8a('0x6a')](_0x9c8a('0x9e'));}}catch(_0x51fbe9){logger[_0x9c8a('0x32')](_0x51fbe9);}}exports[_0x9c8a('0x9f')]=function(_0x9e4120,_0x4f2388,_0x22e8c9){return db[_0x9c8a('0x35')]['find']({'where':{'id':_0x9e4120[_0x9c8a('0x4b')]['id']}})[_0x9c8a('0x2e')](handleEntityNotFound(_0x4f2388,null))[_0x9c8a('0x2e')](saveUpdates(_0x9e4120[_0x9c8a('0x93')],null))['then'](respondWithResult(_0x4f2388,null))[_0x9c8a('0x50')](handleError(_0x4f2388,null));};exports['delete']=function(_0x256e4c,_0x2d362e,_0x2f4a27){return db[_0x9c8a('0x35')][_0x9c8a('0x4f')]({'where':{'id':_0x256e4c['params']['id']}})[_0x9c8a('0x2e')](function(_0x7444bb){if(_0x7444bb){return _0x7444bb[_0x9c8a('0x30')]();}})['then'](function(_0x2ecd70){rimraf(path[_0x9c8a('0x5d')](config[_0x9c8a('0x53')],'server/files/plugins',path[_0x9c8a('0x5e')](_0x2ecd70[_0x9c8a('0x52')])),function(){});return _0x2ecd70;})[_0x9c8a('0x2e')](handleEntityNotFound(_0x2d362e,null))[_0x9c8a('0x2e')](respondWithStatusCode(_0x2d362e,null))[_0x9c8a('0x50')](handleError(_0x2d362e,null));};exports[_0x9c8a('0xa0')]=function(_0x971bc2,_0x212ab7,_0x47bb8c){return BPromise['resolve']()[_0x9c8a('0x2e')](function(){if(!_0x971bc2['query'][_0x9c8a('0x52')]){throw new Error(_0x9c8a('0xa1'));}if(!_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x197d04=_0x971bc2[_0x9c8a('0x39')]['hostname']?_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0xa3')]+':'+_0x971bc2[_0x9c8a('0x39')]['port']:_0x9c8a('0xa4')+_0x971bc2[_0x9c8a('0x39')]['port'];var _0x48f65d=_0x971bc2[_0x9c8a('0x39')]['json']?_0x971bc2[_0x9c8a('0x39')]['json']:!![];var _0x27a33e=_0x971bc2['query'][_0x9c8a('0xa5')]?_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0xa5')]:null;var _0x4c0f26={'method':_0x971bc2[_0x9c8a('0xa6')],'uri':util[_0x9c8a('0x55')](_0x9c8a('0xa7'),_0x197d04,_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0x52')]),'json':_0x48f65d,'resolveWithFullResponse':!![],'encoding':_0x27a33e,'qs':_0x971bc2[_0x9c8a('0x39')]};if(_0x971bc2[_0x9c8a('0xa8')]){_0x4c0f26[_0x9c8a('0xa8')]=_0x971bc2[_0x9c8a('0xa8')];if(_0x4c0f26['headers'][_0x9c8a('0xa9')]){delete _0x4c0f26[_0x9c8a('0xa8')][_0x9c8a('0xa9')];}}if(_0x4c0f26[_0x9c8a('0xa8')][_0x9c8a('0xaa')]){delete _0x4c0f26[_0x9c8a('0xa8')][_0x9c8a('0xaa')];}return rp(_0x4c0f26);})[_0x9c8a('0x2e')](function(_0x395906){if(_0x395906){_0x212ab7[_0x9c8a('0xab')](_0x395906[_0x9c8a('0xa8')]);logger['info'](_0x395906['body']);if(_[_0x9c8a('0xac')](_0x971bc2[_0x9c8a('0x39')][_0x9c8a('0x52')],'download')&&_0x395906['statusCode']==0x1f4){return _0x212ab7[_0x9c8a('0x31')](_0x395906[_0x9c8a('0xad')]);}else{return _0x212ab7['status'](_0x395906[_0x9c8a('0xad')])['send'](_0x395906[_0x9c8a('0x93')]);}}else{return _0x212ab7[_0x9c8a('0x31')](0xc8);}})[_0x9c8a('0x50')](handleError(_0x212ab7,null));};exports[_0x9c8a('0xae')]=function(_0x5a3c6f,_0x3a4e76,_0x1b4aa0){return BPromise[_0x9c8a('0xaf')]()[_0x9c8a('0x2e')](function(){if(!_0x5a3c6f['query'][_0x9c8a('0x52')]){throw new Error(_0x9c8a('0xa1'));}if(!_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x51fd16=_0x5a3c6f[_0x9c8a('0x39')]['hostname']?_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa3')]+':'+_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa2')]:_0x9c8a('0xa4')+_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa2')];var _0x3a2b78=_0x5a3c6f['query'][_0x9c8a('0x25')]?_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0x25')]:!![];var _0x30473e=_0x5a3c6f['query']['encoding']?_0x5a3c6f[_0x9c8a('0x39')][_0x9c8a('0xa5')]:null;var _0x554676={'method':_0x5a3c6f[_0x9c8a('0xa6')],'uri':util[_0x9c8a('0x55')](_0x9c8a('0xa7'),_0x51fd16,_0x5a3c6f['query'][_0x9c8a('0x52')]),'json':_0x3a2b78,'resolveWithFullResponse':!![],'encoding':_0x30473e,'body':_0x5a3c6f[_0x9c8a('0x93')]};if(_0x5a3c6f['headers']){_0x554676[_0x9c8a('0xa8')]=_0x5a3c6f[_0x9c8a('0xa8')];if(_0x554676[_0x9c8a('0xa8')][_0x9c8a('0xa9')]){delete _0x554676['headers'][_0x9c8a('0xa9')];}}if(_0x554676[_0x9c8a('0xa8')][_0x9c8a('0xaa')]){delete _0x554676[_0x9c8a('0xa8')][_0x9c8a('0xaa')];}return rp(_0x554676);})['then'](function(_0x565d3c){if(_0x565d3c){_0x3a4e76[_0x9c8a('0xab')](_0x565d3c[_0x9c8a('0xa8')]);logger[_0x9c8a('0x6a')](_0x565d3c[_0x9c8a('0x93')]);return _0x3a4e76['status'](_0x565d3c[_0x9c8a('0xad')])['send'](_0x565d3c[_0x9c8a('0x93')]);}else{return _0x3a4e76[_0x9c8a('0x31')](0xc8);}})['catch'](handleError(_0x3a4e76,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 31da172..9b73bb8 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 _0xcf71=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x1352fd,_0x166b29){var _0x4de3b6=function(_0x394c0d){while(--_0x394c0d){_0x1352fd['push'](_0x1352fd['shift']());}};_0x4de3b6(++_0x166b29);}(_0xcf71,0xba));var _0x1cf7=function(_0x42ba3b,_0x355441){_0x42ba3b=_0x42ba3b-0x0;var _0x17634b=_0xcf71[_0x42ba3b];return _0x17634b;};'use strict';var EventEmitter=require(_0x1cf7('0x0'));var Plugin=require(_0x1cf7('0x1'))['db'][_0x1cf7('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x1cf7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1cf7('0x4'),'afterDestroy':_0x1cf7('0x5')};function emitEvent(_0xcc31bf){return function(_0x21307d,_0x11e462,_0x14d074){PluginEvents[_0x1cf7('0x6')](_0xcc31bf+':'+_0x21307d['id'],_0x21307d);PluginEvents[_0x1cf7('0x6')](_0xcc31bf,_0x21307d);_0x14d074(null);};}for(var e in events){if(events[_0x1cf7('0x7')](e)){var event=events[e];Plugin[_0x1cf7('0x8')](e,emitEvent(event));}}module[_0x1cf7('0x9')]=PluginEvents; \ No newline at end of file +var _0x0967=['update','remove','emit','hasOwnProperty','hook','exports','events','Plugin','setMaxListeners','save'];(function(_0x134c9b,_0x2b4738){var _0x33f38e=function(_0x53e7b5){while(--_0x53e7b5){_0x134c9b['push'](_0x134c9b['shift']());}};_0x33f38e(++_0x2b4738);}(_0x0967,0x100));var _0x7096=function(_0x205937,_0x2b3a31){_0x205937=_0x205937-0x0;var _0x2bfab3=_0x0967[_0x205937];return _0x2bfab3;};'use strict';var EventEmitter=require(_0x7096('0x0'));var Plugin=require('../../mysqldb')['db'][_0x7096('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x7096('0x2')](0x0);var events={'afterCreate':_0x7096('0x3'),'afterUpdate':_0x7096('0x4'),'afterDestroy':_0x7096('0x5')};function emitEvent(_0xe41170){return function(_0x4106a2,_0x2a50e2,_0x4eba77){PluginEvents[_0x7096('0x6')](_0xe41170+':'+_0x4106a2['id'],_0x4106a2);PluginEvents[_0x7096('0x6')](_0xe41170,_0x4106a2);_0x4eba77(null);};}for(var e in events){if(events[_0x7096('0x7')](e)){var event=events[e];Plugin[_0x7096('0x8')](e,emitEvent(event));}}module[_0x7096('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 74b46b6..b6d8b26 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 _0x2d81=['../../config/logger','bluebird','request-promise','path','rimraf','./plugin.attributes','exports','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2d81,0xcf));var _0x12d8=function(_0x4971db,_0x1fb35c){_0x4971db=_0x4971db-0x0;var _0x28c91b=_0x2d81[_0x4971db];return _0x28c91b;};'use strict';var _=require('lodash');var util=require(_0x12d8('0x0'));var logger=require(_0x12d8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x12d8('0x2'));var rp=require(_0x12d8('0x3'));var fs=require('fs');var path=require(_0x12d8('0x4'));var rimraf=require(_0x12d8('0x5'));var config=require('../../config/environment');var attributes=require(_0x12d8('0x6'));module[_0x12d8('0x7')]=function(_0x1c769c,_0x12819a){return _0x1c769c['define']('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x476f=['path','../../config/environment','exports','Plugin','plugins','lodash','api','moment','bluebird','request-promise'];(function(_0x1907f6,_0x3ac387){var _0x2a9703=function(_0x48282b){while(--_0x48282b){_0x1907f6['push'](_0x1907f6['shift']());}};_0x2a9703(++_0x3ac387);}(_0x476f,0xf5));var _0xf476=function(_0x2af706,_0x635040){_0x2af706=_0x2af706-0x0;var _0x351914=_0x476f[_0x2af706];return _0x351914;};'use strict';var _=require(_0xf476('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf476('0x1'));var moment=require(_0xf476('0x2'));var BPromise=require(_0xf476('0x3'));var rp=require(_0xf476('0x4'));var fs=require('fs');var path=require(_0xf476('0x5'));var rimraf=require('rimraf');var config=require(_0xf476('0x6'));var attributes=require('./plugin.attributes');module[_0xf476('0x7')]=function(_0x32ac66,_0x24bb3c){return _0x32ac66['define'](_0xf476('0x8'),attributes,{'tableName':_0xf476('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 1499073..93f8a80 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 _0x974f=['redis','defaults','socket.io-emitter','./plugin.socket','register','info','request\x20sent','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','debug','util','moment','bluebird','randomstring','jayson/promise','client','http'];(function(_0x3b7af1,_0x16b3ca){var _0x224dd3=function(_0x54e9c8){while(--_0x54e9c8){_0x3b7af1['push'](_0x3b7af1['shift']());}};_0x224dd3(++_0x16b3ca);}(_0x974f,0x85));var _0xf974=function(_0xe836c2,_0x214edd){_0xe836c2=_0xe836c2-0x0;var _0x22f85c=_0x974f[_0xe836c2];return _0x22f85c;};'use strict';var _=require('lodash');var util=require(_0xf974('0x0'));var moment=require(_0xf974('0x1'));var BPromise=require(_0xf974('0x2'));var rs=require(_0xf974('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf974('0x4'));var client=jayson[_0xf974('0x5')][_0xf974('0x6')]({'port':0x232a});config[_0xf974('0x7')]=_[_0xf974('0x8')](config[_0xf974('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xf974('0x9'))(new Redis(config[_0xf974('0x7')]));require(_0xf974('0xa'))[_0xf974('0xb')](socket);function respondWithRpcPromise(_0x3a7bbe,_0x1ee421,_0x4d82cb){return new BPromise(function(_0x933f8f,_0x4c7b0a){return client['request'](_0x3a7bbe,_0x4d82cb)['then'](function(_0x3dfdb2){logger[_0xf974('0xc')]('Plugin,\x20%s,\x20%s',_0x1ee421,'request\x20sent');logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x1ee421,_0xf974('0xd'),JSON[_0xf974('0xe')](_0x3dfdb2));if(_0x3dfdb2['error']){if(_0x3dfdb2[_0xf974('0xf')]['code']===0x1f4){logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x3dfdb2[_0xf974('0xf')][_0xf974('0x11')]);return _0x4c7b0a(_0x3dfdb2[_0xf974('0xf')]['message']);}logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x3dfdb2[_0xf974('0xf')]['message']);return _0x933f8f(_0x3dfdb2[_0xf974('0xf')]['message']);}else{logger[_0xf974('0xc')](_0xf974('0x10'),_0x1ee421,_0xf974('0xd'));_0x933f8f(_0x3dfdb2[_0xf974('0x12')][_0xf974('0x11')]);}})[_0xf974('0x13')](function(_0x1a7e51){logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x1a7e51);_0x4c7b0a(_0x1a7e51);});});}exports[_0xf974('0x14')]=function(_0x1badf5){var _0xabcda1=this;return new Promise(function(_0x5e78f3,_0x4c5cd1){return db[_0xf974('0x15')][_0xf974('0x16')](_0x1badf5[_0xf974('0x17')],{'raw':_0x1badf5['options']?_0x1badf5[_0xf974('0x18')][_0xf974('0x19')]===undefined?!![]:![]:!![]})[_0xf974('0x1a')](function(_0x309d6e){logger[_0xf974('0xc')](_0xf974('0x14'),_0x1badf5);logger[_0xf974('0x1b')]('CreatePlugin',_0x1badf5,JSON['stringify'](_0x309d6e));_0x5e78f3(_0x309d6e);})[_0xf974('0x13')](function(_0xef33b5){logger[_0xf974('0xf')](_0xf974('0x14'),_0xef33b5[_0xf974('0x11')],_0x1badf5);_0x4c5cd1(_0xabcda1[_0xf974('0xf')](0x1f4,_0xef33b5[_0xf974('0x11')]));});});}; \ No newline at end of file +var _0x44d4=['redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreatePlugin','Plugin','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x44d4,0x7c));var _0x444d=function(_0x57172c,_0x1df512){_0x57172c=_0x57172c-0x0;var _0x38e8a4=_0x44d4[_0x57172c];return _0x38e8a4;};'use strict';var _=require(_0x444d('0x0'));var util=require(_0x444d('0x1'));var moment=require(_0x444d('0x2'));var BPromise=require(_0x444d('0x3'));var rs=require(_0x444d('0x4'));var fs=require('fs');var Redis=require(_0x444d('0x5'));var db=require(_0x444d('0x6'))['db'];var utils=require(_0x444d('0x7'));var logger=require('../../config/logger')(_0x444d('0x8'));var config=require(_0x444d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x444d('0xa')]({'port':0x232a});config['redis']=_[_0x444d('0xb')](config[_0x444d('0xc')],{'host':_0x444d('0xd'),'port':0x18eb});var socket=require(_0x444d('0xe'))(new Redis(config[_0x444d('0xc')]));require(_0x444d('0xf'))[_0x444d('0x10')](socket);function respondWithRpcPromise(_0x43414a,_0x5603b1,_0x5033dc){return new BPromise(function(_0x210d27,_0x271df6){return client[_0x444d('0x11')](_0x43414a,_0x5033dc)[_0x444d('0x12')](function(_0x11179b){logger['info'](_0x444d('0x13'),_0x5603b1,_0x444d('0x14'));logger[_0x444d('0x15')](_0x444d('0x16'),_0x5603b1,'request\x20sent',JSON[_0x444d('0x17')](_0x11179b));if(_0x11179b[_0x444d('0x18')]){if(_0x11179b[_0x444d('0x18')][_0x444d('0x19')]===0x1f4){logger[_0x444d('0x18')](_0x444d('0x13'),_0x5603b1,_0x11179b[_0x444d('0x18')][_0x444d('0x1a')]);return _0x271df6(_0x11179b[_0x444d('0x18')][_0x444d('0x1a')]);}logger[_0x444d('0x18')](_0x444d('0x13'),_0x5603b1,_0x11179b[_0x444d('0x18')][_0x444d('0x1a')]);return _0x210d27(_0x11179b['error']['message']);}else{logger[_0x444d('0x1b')](_0x444d('0x13'),_0x5603b1,'request\x20sent');_0x210d27(_0x11179b[_0x444d('0x1c')]['message']);}})['catch'](function(_0x83b7a9){logger[_0x444d('0x18')]('Plugin,\x20%s,\x20%s',_0x5603b1,_0x83b7a9);_0x271df6(_0x83b7a9);});});}exports[_0x444d('0x1d')]=function(_0x1cf5a2){var _0x435aa4=this;return new Promise(function(_0x4f520d,_0x4473c0){return db[_0x444d('0x1e')]['create'](_0x1cf5a2['body'],{'raw':_0x1cf5a2[_0x444d('0x1f')]?_0x1cf5a2[_0x444d('0x1f')][_0x444d('0x20')]===undefined?!![]:![]:!![]})[_0x444d('0x12')](function(_0x52e33e){logger[_0x444d('0x1b')](_0x444d('0x1d'),_0x1cf5a2);logger[_0x444d('0x15')](_0x444d('0x1d'),_0x1cf5a2,JSON[_0x444d('0x17')](_0x52e33e));_0x4f520d(_0x52e33e);})[_0x444d('0x21')](function(_0x3cb14b){logger[_0x444d('0x18')](_0x444d('0x1d'),_0x3cb14b[_0x444d('0x1a')],_0x1cf5a2);_0x4473c0(_0x435aa4[_0x444d('0x18')](0x1f4,_0x3cb14b['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 9c356a3..d1ae67b 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 _0x74bd=['update','removeListener','register','length','./plugin.events','save','remove'];(function(_0x249d49,_0x5008df){var _0x2abd74=function(_0x3ffa4d){while(--_0x3ffa4d){_0x249d49['push'](_0x249d49['shift']());}};_0x2abd74(++_0x5008df);}(_0x74bd,0xe4));var _0xd74b=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x74bd[_0x1d04b5];return _0x161342;};'use strict';var PluginEvents=require(_0xd74b('0x0'));var events=[_0xd74b('0x1'),_0xd74b('0x2'),_0xd74b('0x3')];function createListener(_0x1c01ad,_0x2ff4ef){return function(_0x52e475){_0x2ff4ef['emit'](_0x1c01ad,_0x52e475);};}function removeListener(_0x4a660a,_0x3fcd1e){return function(){PluginEvents[_0xd74b('0x4')](_0x4a660a,_0x3fcd1e);};}exports[_0xd74b('0x5')]=function(_0x470c7e){for(var _0x386672=0x0,_0x23e19e=events[_0xd74b('0x6')];_0x386672<_0x23e19e;_0x386672++){var _0x5580b5=events[_0x386672];var _0x44848b=createListener('plugin:'+_0x5580b5,_0x470c7e);PluginEvents['on'](_0x5580b5,_0x44848b);}}; \ No newline at end of file +var _0xd733=['register','length','plugin:','./plugin.events','save','update','removeListener'];(function(_0x39d42d,_0x396f40){var _0x4a49e8=function(_0x58f172){while(--_0x58f172){_0x39d42d['push'](_0x39d42d['shift']());}};_0x4a49e8(++_0x396f40);}(_0xd733,0x137));var _0x3d73=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xd733[_0x4de586];return _0x46baf5;};'use strict';var PluginEvents=require(_0x3d73('0x0'));var events=[_0x3d73('0x1'),'remove',_0x3d73('0x2')];function createListener(_0x1acbce,_0x5df9a5){return function(_0x453642){_0x5df9a5['emit'](_0x1acbce,_0x453642);};}function removeListener(_0x5a5318,_0x5c71fa){return function(){PluginEvents[_0x3d73('0x3')](_0x5a5318,_0x5c71fa);};}exports[_0x3d73('0x4')]=function(_0x54a53d){for(var _0x3d8257=0x0,_0xcc549a=events[_0x3d73('0x5')];_0x3d8257<_0xcc549a;_0x3d8257++){var _0xd7c9b=events[_0x3d8257];var _0x467216=createListener(_0x3d73('0x6')+_0xd7c9b,_0x54a53d);PluginEvents['on'](_0xd7c9b,_0x467216);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2e066a9..b6a4786 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(_0x144256,_0x51d42f){var _0x1cc635=function(_0x5a226c){while(--_0x5a226c){_0x144256['push'](_0x144256['shift']());}};_0x1cc635(++_0x51d42f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x2d93e4,_0x10b13e){var _0x177a6a=function(_0x4e9127){while(--_0x4e9127){_0x2d93e4['push'](_0x2d93e4['shift']());}};_0x177a6a(++_0x10b13e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 0398161..46843d2 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 _0xa75b=['motion2','length','catch','show','describe','params','create','body','script','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','delete','lodash','api','path','child_process','exec','bluebird','sendStatus','status','stack','name','send','npm\x20install','info','error','then','reject','express'];(function(_0xe717f6,_0x13c104){var _0x52b5b4=function(_0x398d22){while(--_0x398d22){_0xe717f6['push'](_0xe717f6['shift']());}};_0x52b5b4(++_0x13c104);}(_0xa75b,0x170));var _0xba75=function(_0x449b46,_0x394b34){_0x449b46=_0x449b46-0x0;var _0x1eb69e=_0xa75b[_0x449b46];return _0x1eb69e;};'use strict';var _=require(_0xba75('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xba75('0x1'));var path=require(_0xba75('0x2'));var exec=require(_0xba75('0x3'))[_0xba75('0x4')];var BPromise=require(_0xba75('0x5'));function handleEntityNotFound(_0x336606,_0x152269){return function(_0x398bd5){if(!_0x398bd5){_0x336606[_0xba75('0x6')](0x194);;}return _0x398bd5;};}function respondWithResult(_0x41afc9,_0x2baa28){_0x2baa28=_0x2baa28||0xc8;return function(_0x238a33){if(_0x238a33){return _0x41afc9[_0xba75('0x7')](_0x2baa28)['json'](_0x238a33);}return null;};}function handleError(_0x4b842d,_0x731cae){_0x731cae=_0x731cae||0x1f4;return function(_0x52669f){logger['error'](_0x52669f[_0xba75('0x8')]);if(_0x52669f['name']){delete _0x52669f[_0xba75('0x9')];}_0x4b842d[_0xba75('0x7')](_0x731cae)[_0xba75('0xa')](_0x52669f);};}function execChildProcess(){return new BPromise(function(_0x141931,_0x13f60f){exec(_0xba75('0xb'),function(_0xb5afb8,_0x2538eb,_0x1824e2){logger[_0xba75('0xc')](_0x2538eb);logger[_0xba75('0xc')](_0x1824e2);if(_0xb5afb8){logger[_0xba75('0xd')](_0xb5afb8);return _0x13f60f(_0xb5afb8);}return _0x141931(_0x2538eb);});});}exports['index']=function(_0x55553a,_0x38a6db){return pm2['list']()[_0xba75('0xe')](function(_0x2df615){if(_0x2df615){var _0xa27f76=_[_0xba75('0xf')](_0x2df615,function(_0x4c4a0b){return _0x4c4a0b[_0xba75('0x9')]===_0xba75('0x10')||_0x4c4a0b[_0xba75('0x9')]===_0xba75('0x11');});return{'rows':_0xa27f76,'count':_0xa27f76[_0xba75('0x12')]};}return null;})['then'](respondWithResult(_0x38a6db,null))[_0xba75('0x13')](handleError(_0x38a6db,null));};exports[_0xba75('0x14')]=function(_0x14bd83,_0x47be93){return pm2[_0xba75('0x15')](_0x14bd83[_0xba75('0x16')]['id'])[_0xba75('0xe')](respondWithResult(_0x47be93,null))[_0xba75('0xe')](handleEntityNotFound(_0x47be93,null))[_0xba75('0x13')](handleError(_0x47be93,null));};exports[_0xba75('0x17')]=function(_0x5811cb,_0x23c2ec){if(_0x5811cb[_0xba75('0x18')]['name']&&_0x5811cb['body'][_0xba75('0x19')]){var _0x31bc33=path['join'](__dirname,'../../files/plugins',_0x5811cb[_0xba75('0x18')]['script']);var _0x1b8a36=process[_0xba75('0x1a')]();process[_0xba75('0x1b')](path['dirname'](_0x31bc33));return execChildProcess()[_0xba75('0xe')](function(_0x221d5e){process[_0xba75('0x1b')](_0x1b8a36);return pm2[_0xba75('0x1c')]({'name':_0x5811cb[_0xba75('0x18')][_0xba75('0x9')],'script':_0x31bc33});})['then'](function(_0x246c48){pm2[_0xba75('0x1d')]();return _0x246c48[0x0];})[_0xba75('0xe')](respondWithResult(_0x23c2ec,0xc9))[_0xba75('0x13')](handleError(_0x23c2ec,null));}else{return _0x23c2ec[_0xba75('0x7')](0x1f4)[_0xba75('0xa')]({'message':_0xba75('0x1e')});}};exports[_0xba75('0x1f')]=function(_0x35c571,_0x155c74){if(_0x35c571['body']['id']){delete _0x35c571['body']['id'];}var _0x4e1987={'online':_0xba75('0x20'),'stopped':'stop'};if(_0x4e1987[_0xba75('0x21')](_0x35c571['body'][_0xba75('0x7')])){return pm2[_0x4e1987[_0x35c571[_0xba75('0x18')][_0xba75('0x7')]]](_0x35c571['params']['id'])[_0xba75('0xe')](respondWithResult(_0x155c74,0xc8))[_0xba75('0x13')](handleError(_0x155c74,null));}else{return _0x155c74[_0xba75('0x7')](0x1f4)[_0xba75('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x200715,_0x481a04){if(_0x200715[_0xba75('0x18')]['id']){delete _0x200715[_0xba75('0x18')]['id'];}if(_0x200715[_0xba75('0x16')]['id']){return pm2[_0xba75('0x22')](_0x200715['params']['id'])[_0xba75('0xe')](function(_0x222d98){pm2['dump']();return _0x222d98[0x0];})[_0xba75('0xe')](respondWithResult(_0x481a04,null))[_0xba75('0x13')](handleError(_0x481a04,null));}else{return _0x481a04[_0xba75('0x7')](0x1f4)[_0xba75('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xd2ea=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','index','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path'];(function(_0x605219,_0x41ec4c){var _0x316c9a=function(_0x1fd78c){while(--_0x1fd78c){_0x605219['push'](_0x605219['shift']());}};_0x316c9a(++_0x41ec4c);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2e94ff,_0x4251fe){_0x2e94ff=_0x2e94ff-0x0;var _0x3ca116=_0xd2ea[_0x2e94ff];return _0x3ca116;};'use strict';var _=require(_0xad2e('0x0'));var pm2=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var path=require(_0xad2e('0x4'));var exec=require('child_process')[_0xad2e('0x5')];var BPromise=require(_0xad2e('0x6'));function handleEntityNotFound(_0xcba7cb,_0x3e0741){return function(_0x2afdc4){if(!_0x2afdc4){_0xcba7cb[_0xad2e('0x7')](0x194);;}return _0x2afdc4;};}function respondWithResult(_0x29e97f,_0x592e8b){_0x592e8b=_0x592e8b||0xc8;return function(_0x3b5170){if(_0x3b5170){return _0x29e97f[_0xad2e('0x8')](_0x592e8b)[_0xad2e('0x9')](_0x3b5170);}return null;};}function handleError(_0x5710ac,_0x1e0e9e){_0x1e0e9e=_0x1e0e9e||0x1f4;return function(_0x19bb0d){logger['error'](_0x19bb0d[_0xad2e('0xa')]);if(_0x19bb0d['name']){delete _0x19bb0d[_0xad2e('0xb')];}_0x5710ac[_0xad2e('0x8')](_0x1e0e9e)[_0xad2e('0xc')](_0x19bb0d);};}function execChildProcess(){return new BPromise(function(_0x24c5da,_0x489f25){exec(_0xad2e('0xd'),function(_0x5707a5,_0x42d2ac,_0x347559){logger[_0xad2e('0xe')](_0x42d2ac);logger[_0xad2e('0xe')](_0x347559);if(_0x5707a5){logger['error'](_0x5707a5);return _0x489f25(_0x5707a5);}return _0x24c5da(_0x42d2ac);});});}exports[_0xad2e('0xf')]=function(_0x59201f,_0x1a91ce){return pm2['list']()['then'](function(_0x4a812b){if(_0x4a812b){var _0x5c96a7=_[_0xad2e('0x10')](_0x4a812b,function(_0x282780){return _0x282780[_0xad2e('0xb')]===_0xad2e('0x11')||_0x282780[_0xad2e('0xb')]===_0xad2e('0x12');});return{'rows':_0x5c96a7,'count':_0x5c96a7[_0xad2e('0x13')]};}return null;})[_0xad2e('0x14')](respondWithResult(_0x1a91ce,null))[_0xad2e('0x15')](handleError(_0x1a91ce,null));};exports[_0xad2e('0x16')]=function(_0x2af208,_0x39c5e4){return pm2[_0xad2e('0x17')](_0x2af208[_0xad2e('0x18')]['id'])[_0xad2e('0x14')](respondWithResult(_0x39c5e4,null))['then'](handleEntityNotFound(_0x39c5e4,null))[_0xad2e('0x15')](handleError(_0x39c5e4,null));};exports[_0xad2e('0x19')]=function(_0x489585,_0x50eb1a){if(_0x489585['body']['name']&&_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]){var _0x5549db=path[_0xad2e('0x1c')](__dirname,_0xad2e('0x1d'),_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]);var _0x23c0b6=process[_0xad2e('0x1e')]();process[_0xad2e('0x1f')](path[_0xad2e('0x20')](_0x5549db));return execChildProcess()[_0xad2e('0x14')](function(_0xd907a9){process[_0xad2e('0x1f')](_0x23c0b6);return pm2[_0xad2e('0x21')]({'name':_0x489585[_0xad2e('0x1a')]['name'],'script':_0x5549db});})[_0xad2e('0x14')](function(_0x2e8887){pm2[_0xad2e('0x22')]();return _0x2e8887[0x0];})[_0xad2e('0x14')](respondWithResult(_0x50eb1a,0xc9))[_0xad2e('0x15')](handleError(_0x50eb1a,null));}else{return _0x50eb1a[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x23')});}};exports[_0xad2e('0x24')]=function(_0x50d446,_0x356a19){if(_0x50d446['body']['id']){delete _0x50d446[_0xad2e('0x1a')]['id'];}var _0x28ef72={'online':_0xad2e('0x25'),'stopped':_0xad2e('0x26')};if(_0x28ef72[_0xad2e('0x27')](_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')])){return pm2[_0x28ef72[_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')]]](_0x50d446[_0xad2e('0x18')]['id'])['then'](respondWithResult(_0x356a19,0xc8))[_0xad2e('0x15')](handleError(_0x356a19,null));}else{return _0x356a19[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x28')});}};exports[_0xad2e('0x29')]=function(_0x9b4a23,_0x409f58){if(_0x9b4a23[_0xad2e('0x1a')]['id']){delete _0x9b4a23[_0xad2e('0x1a')]['id'];}if(_0x9b4a23[_0xad2e('0x18')]['id']){return pm2[_0xad2e('0x2a')](_0x9b4a23['params']['id'])[_0xad2e('0x14')](function(_0x55e1dc){pm2[_0xad2e('0x22')]();return _0x55e1dc[0x0];})[_0xad2e('0x14')](respondWithResult(_0x409f58,null))[_0xad2e('0x15')](handleError(_0x409f58,null));}else{return _0x409f58[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 582a3b8..2c347ec 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 _0x800d=['Router','../../components/auth/service','get','/agents','getAgents','/queues','getQueues','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x800d,0x190));var _0xd800=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x800d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0xd800('0x0')]();var auth=require(_0xd800('0x1'));var controller=require('./realtime.controller');router[_0xd800('0x2')](_0xd800('0x3'),auth['isAuthenticated'](),controller[_0xd800('0x4')]);router[_0xd800('0x2')](_0xd800('0x5'),auth['isAuthenticated'](),controller[_0xd800('0x6')]);module[_0xd800('0x7')]=router; \ No newline at end of file +var _0x0716=['exports','express','../../components/auth/service','/agents','getAgents','get','isAuthenticated','getQueues'];(function(_0x3da647,_0xa1a501){var _0x2e91a2=function(_0x34a811){while(--_0x34a811){_0x3da647['push'](_0x3da647['shift']());}};_0x2e91a2(++_0xa1a501);}(_0x0716,0x91));var _0x6071=function(_0x5d5979,_0x3b4921){_0x5d5979=_0x5d5979-0x0;var _0x237182=_0x0716[_0x5d5979];return _0x237182;};'use strict';var express=require(_0x6071('0x0'));var router=express['Router']();var auth=require(_0x6071('0x1'));var controller=require('./realtime.controller');router['get'](_0x6071('0x2'),auth['isAuthenticated'](),controller[_0x6071('0x3')]);router[_0x6071('0x4')]('/queues',auth[_0x6071('0x5')](),controller[_0x6071('0x6')]);module[_0x6071('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e0d888e..4661b01 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 _0x1885=['dialActive','dialMethod','fields','userProfileId','QueueCampaigns','Queues','name','filter','UserProfile','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','undefined','limit','count','offset','status','Content-Range','json','getChannels','globalQueueFilter','globalStatusFilter','query','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','length','map','User','rawAttributes','fieldName','key','agent','getOptions','raw','push','sequelize','literal','*pause','Pause','forEach','where','merge','user','role','Agents','online','extraQueryConditions','assign','findAndCountAll','find','filterAgentAttributes','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','getQueues','startCase','type','outbound'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x1885,0x117));var _0x5188=function(_0x3d30bf,_0x50411f){_0x3d30bf=_0x3d30bf-0x0;var _0x4930ae=_0x1885[_0x3d30bf];return _0x4930ae;};'use strict';var _=require(_0x5188('0x0'));var util=require(_0x5188('0x1'));var rta=require(_0x5188('0x2'));var rtq=require(_0x5188('0x3'));var qs=require(_0x5188('0x4'));var utils=require(_0x5188('0x5'));var db=require(_0x5188('0x6'))['db'];var APIBadRequestError=require('../../errors/api')[_0x5188('0x7')];var APIHandleError=require(_0x5188('0x8'))[_0x5188('0x9')];function respondWithFilteredResult(_0x3f88e8,_0x358256){return function(_0x1eb12f){if(_0x1eb12f){var _0x1e72a2=typeof _0x358256['offset']===_0x5188('0xa')&&typeof _0x358256[_0x5188('0xb')]==='undefined';var _0x2e72e9=_0x1eb12f[_0x5188('0xc')];var _0x1e2f25=_0x1e72a2?0x0:_0x358256[_0x5188('0xd')];var _0x57a694=_0x1e72a2?_0x1eb12f['count']:_0x358256[_0x5188('0xd')]+_0x358256[_0x5188('0xb')];var _0x154962;if(_0x57a694>=_0x2e72e9){_0x57a694=_0x2e72e9;_0x154962=0xc8;}else{_0x154962=0xce;}_0x3f88e8[_0x5188('0xe')](_0x154962);return _0x3f88e8['set'](_0x5188('0xf'),_0x1e2f25+'-'+_0x57a694+'/'+_0x2e72e9)[_0x5188('0x10')](_0x1eb12f);}return null;};}exports['getAgents']=function(_0x3af224,_0xe68c42){var _0x141586={'count':0x0,'rows':[]};var _0x10e1c8={};var _0x15a0c5;var _0xdc75a1=utils[_0x5188('0x11')]();var _0xc63b56;var _0x8edaed;var _0x581d31=_0x3af224['query'][_0x5188('0x12')];var _0x565dca=_0x3af224['query'][_0x5188('0x13')];var _0x1e4787=_0x3af224[_0x5188('0x14')][_0x5188('0x15')];var _0x5dd594=_0x565dca===_0x5188('0x16')||_0x565dca==='*pause'?!![]:![];var _0x2d28b5=[];var _0x108c33;var _0x25266b;Promise[_0x5188('0x17')]()[_0x5188('0x18')](function(){if(_0x3af224[_0x5188('0x14')][_0x5188('0x19')]){if(!utils[_0x5188('0x1a')](_0x3af224[_0x5188('0x14')]['channel'])){throw new APIBadRequestError(util[_0x5188('0x1b')](_0x5188('0x1c'),_0x3af224[_0x5188('0x14')][_0x5188('0x19')]));}_0x15a0c5=_0x3af224[_0x5188('0x14')][_0x5188('0x19')][_0x5188('0x1d')]();}if(!_0x3af224[_0x5188('0x14')][_0x5188('0x1e')]||!_0x3af224[_0x5188('0x14')][_0x5188('0x1e')][_0x5188('0x1f')](_0x5188('0x20'))){_0x3af224['query']['sort']=rta[_0x5188('0x21')](_0x3af224[_0x5188('0x14')][_0x5188('0x1e')]);return;}var _0x24b02d=rta['getUpdatedSortOptions'](_0x3af224[_0x5188('0x14')][_0x5188('0x1e')]);_0x3af224[_0x5188('0x14')][_0x5188('0x1e')]=_0x24b02d['fields'][_0x5188('0x22')](',');_0x108c33=_0x24b02d[_0x5188('0x23')];})['then'](function(){if(!_0x581d31){return[];}return rta[_0x5188('0x24')](_0x581d31,_0x15a0c5);})[_0x5188('0x18')](function(_0x324d23){_0x2d28b5=_0x324d23;return rta[_0x5188('0x25')]();})[_0x5188('0x18')](function(_0x3a2e52){_0x8edaed=_0x3a2e52[_0x5188('0x26')];if((!_0x565dca||_0x5dd594)&&!_0x108c33){return _0x2d28b5;}if(_0x108c33&&!_0x565dca){return rta['getSortedAgentsIdsByStatus'](_0x8edaed,_0x2d28b5,_0x108c33);}else{return rta['getAgentIdsByStatus'](_0x8edaed,_0x2d28b5,_0x565dca);}})[_0x5188('0x18')](function(_0x344614){_0x2d28b5=_0x344614;var _0x5a1811=![];if(_0x2d28b5[_0x5188('0x27')]===0x0){if(_0x581d31||_0x565dca){_0x5a1811=!![];}if(_0x5dd594){_0x5a1811=![];}}if(_0x5a1811){return _0x141586;}var _0x17e6fc=_[_0x5188('0x28')](db[_0x5188('0x29')][_0x5188('0x2a')],function(_0x2b0fc9){return{'name':_0x2b0fc9[_0x5188('0x2b')],'type':_0x2b0fc9['type'][_0x5188('0x2c')]};});_0x3af224[_0x5188('0x14')]['role']=_0x5188('0x2d');_0x10e1c8=qs[_0x5188('0x2e')](_0x17e6fc,_0x3af224);_0x10e1c8[_0x5188('0x2f')]=!![];var _0xfff380=[];if(_0x2d28b5[_0x5188('0x27')]>0x0){_0xfff380[_0x5188('0x30')]({'id':{'$in':_0x2d28b5}});if(_0x108c33&&!_0x565dca){_0x25266b=[db[_0x5188('0x31')][_0x5188('0x32')]('FIELD(id,'+_0x2d28b5+')')];_0x10e1c8[_0x5188('0x23')]=_0x25266b;}}if(_0x5dd594){_0xdc75a1['forEach'](function(_0x339e80){var _0x1d7817=!![];if(_0x565dca===_0x5188('0x33')&&_0x15a0c5!==_0x339e80){_0x1d7817=![];}_0xfff380[_0x5188('0x30')]({[_0x339e80+_0x5188('0x34')]:_0x1d7817});});if(_0x1e4787){_0xfff380[_0x5188('0x30')]({'pauseType':_0x1e4787});}}else if(_0x565dca){_0xdc75a1[_0x5188('0x35')](function(_0xc174f7){_0xfff380[_0x5188('0x30')]({[_0xc174f7+_0x5188('0x34')]:![]});});}_0x10e1c8[_0x5188('0x36')]=_[_0x5188('0x37')](_0x10e1c8[_0x5188('0x36')],{'$and':_0xfff380});if(_0x3af224[_0x5188('0x38')][_0x5188('0x39')]===_0x5188('0x38')){var _0x2b5b24={'params':{'id':_0x3af224[_0x5188('0x38')]['userProfileId']},'query':{'section':_0x5188('0x3a'),'role':'agent','raw':!![],'ids':_0x2d28b5,'customSorting':_0x25266b}};if(_0x3af224[_0x5188('0x14')][_0x5188('0x3b')]){_0x2b5b24[_0x5188('0x14')][_0x5188('0x3b')]=!![];}if(_0x5dd594){_0x2b5b24[_0x5188('0x14')][_0x5188('0x3c')]=_0xfff380;}_0x2b5b24[_0x5188('0x14')]=Object[_0x5188('0x3d')](_0x2b5b24['query'],_0x3af224[_0x5188('0x14')]);return db['UserProfile']['getResources'](_0x2b5b24);}return db[_0x5188('0x29')][_0x5188('0x3e')](_0x10e1c8);})[_0x5188('0x18')](function(_0x5c74f8){_0x141586[_0x5188('0xc')]=_0x5c74f8[_0x5188('0xc')];_0xc63b56=_0x5c74f8[_0x5188('0x26')];return _0xc63b56[_0x5188('0x28')](function(_0x9a8b83){var _0x25bfad=_[_0x5188('0x3f')](_0x8edaed,['id',_0x9a8b83['id']]);if(_0x25bfad){var _0x4a5e8a=rta[_0x5188('0x40')](_0x25bfad);_[_0x5188('0x37')](_0x9a8b83,_0x4a5e8a);}_0x9a8b83[_0x5188('0x20')]=rta[_0x5188('0x41')](_0x9a8b83);if(_0x9a8b83[_0x5188('0x20')]['includes'](_0x5188('0x16'))){_0xdc75a1[_0x5188('0x35')](function(_0x587bc8){if(_0x9a8b83[_0x587bc8+_0x5188('0x34')]){if(_0x587bc8===_0x5188('0x42')){if(_0x9a8b83[_0x5188('0x43')]!==_0x5188('0x44')){_0x9a8b83['voiceStatus']=_0x5188('0x16');}}else{_0x9a8b83[_0x587bc8+_0x5188('0x45')]=_0x5188('0x16');}}});}return _0x9a8b83;});})[_0x5188('0x18')](function(_0x169de3){if(!_0x108c33||_0x25266b){return _0x169de3;}return rta[_0x5188('0x46')](_0x169de3,_0x108c33);})[_0x5188('0x18')](function(_0x19c36a){var _0x485c39=rta[_0x5188('0x47')]();_0x141586[_0x5188('0x26')]=_0x19c36a[_0x5188('0x28')](function(_0x2071ba){return _[_0x5188('0x48')](_0x2071ba,_0x485c39);});return _0x141586;})['then'](respondWithFilteredResult(_0xe68c42,_0x10e1c8))['catch'](APIHandleError(_0xe68c42));};exports[_0x5188('0x49')]=function(_0x9b3769,_0x5015dc){var _0x1eab93={'count':0x0,'rows':[]};var _0x2f7228={};var _0x59d29d;var _0x1ee678;var _0x3ae0b3;Promise['resolve']()[_0x5188('0x18')](function(){if(_0x9b3769['query'][_0x5188('0x19')]){if(!utils[_0x5188('0x1a')](_0x9b3769['query']['channel'])){throw new APIBadRequestError(util[_0x5188('0x1b')](_0x5188('0x1c'),_0x9b3769['query'][_0x5188('0x19')]));}_0x59d29d=_0x9b3769['query'][_0x5188('0x19')][_0x5188('0x1d')]();}var _0x3e143a=_[_0x5188('0x4a')](_0x59d29d)+'Queue';var _0x484d24=_[_0x5188('0x28')](db[_0x3e143a][_0x5188('0x2a')],function(_0x22e803){return{'name':_0x22e803[_0x5188('0x2b')],'type':_0x22e803[_0x5188('0x4b')]['key']};});if(!_0x9b3769[_0x5188('0x14')]['fields']){var _0x80758b=['id','name'];if(_0x59d29d==='voice'){_0x80758b[_0x5188('0x30')](_0x5188('0x4b'));if(_0x9b3769['query'][_0x5188('0x4b')]===_0x5188('0x4c')){_0x80758b[_0x5188('0x30')]([_0x5188('0x4d'),_0x5188('0x4e')]);}}_0x9b3769[_0x5188('0x14')][_0x5188('0x4f')]=_0x80758b[_0x5188('0x22')](',');}_0x2f7228=qs['getOptions'](_0x484d24,_0x9b3769);if(_0x9b3769['user'][_0x5188('0x39')]===_0x5188('0x38')){var _0x305dde={'params':{'id':_0x9b3769[_0x5188('0x38')][_0x5188('0x50')]},'query':{'section':_0x59d29d===_0x5188('0x42')&&_0x9b3769['query'][_0x5188('0x4b')]===_0x5188('0x4c')?_0x5188('0x51'):_[_0x5188('0x4a')](_0x59d29d)+_0x5188('0x52'),'type':_0x9b3769[_0x5188('0x14')][_0x5188('0x4b')],'nolimit':!![],'sort':_0x5188('0x53'),'filter':_0x9b3769['query'][_0x5188('0x54')]}};_0x305dde[_0x5188('0x14')]=Object[_0x5188('0x3d')](_0x305dde[_0x5188('0x14')],_0x9b3769['query']);delete _0x305dde[_0x5188('0x14')]['id'];return db[_0x5188('0x55')][_0x5188('0x56')](_0x305dde);}return db[_0x3e143a][_0x5188('0x3e')](_0x2f7228);})['then'](function(_0x4ce076){_0x1eab93[_0x5188('0xc')]=_0x4ce076['count'];_0x1ee678=_0x4ce076[_0x5188('0x26')];return rtq[_0x5188('0x57')](_0x9b3769,_0x59d29d);})[_0x5188('0x18')](function(_0x1ee42d){_0x3ae0b3=_0x1ee42d[_0x5188('0x26')];return rtq[_0x5188('0x58')](_0x1ee678,_0x3ae0b3,_0x59d29d,_0x9b3769[_0x5188('0x14')][_0x5188('0x4b')]);})['then'](function(_0x40a99e){_0x1eab93['rows']=_0x40a99e;return _0x1eab93;})[_0x5188('0x18')](respondWithFilteredResult(_0x5015dc,_0x2f7228))['catch'](APIHandleError(_0x5015dc));}; \ No newline at end of file +var _0xecca=['isValidChannel','toLowerCase','startCase','Queue','name','outbound','dialActive','dialMethod','Queues','filter','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','validateSortParameter','getUpdatedSortOptions','fields','join','then','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','literal','FIELD(id,','order','forEach','push','Pause','where','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','findAndCountAll','map','find','filterAgentAttributes','globalStatus','includes','pause','voice','voiceStatus','talking','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues'];(function(_0x17e07e,_0x52cf24){var _0x155d9d=function(_0x1e6802){while(--_0x1e6802){_0x17e07e['push'](_0x17e07e['shift']());}};_0x155d9d(++_0x52cf24);}(_0xecca,0xbd));var _0xaecc=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xecca[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xaecc('0x0'));var util=require(_0xaecc('0x1'));var rta=require(_0xaecc('0x2'));var rtq=require(_0xaecc('0x3'));var qs=require(_0xaecc('0x4'));var utils=require(_0xaecc('0x5'));var db=require(_0xaecc('0x6'))['db'];var APIBadRequestError=require(_0xaecc('0x7'))[_0xaecc('0x8')];var APIHandleError=require(_0xaecc('0x7'))['handleError'];function respondWithFilteredResult(_0x4c2ea4,_0x813a32){return function(_0x3484e4){if(_0x3484e4){var _0xa272a0=typeof _0x813a32[_0xaecc('0x9')]===_0xaecc('0xa')&&typeof _0x813a32['limit']===_0xaecc('0xa');var _0x4e56c4=_0x3484e4['count'];var _0x12a8e9=_0xa272a0?0x0:_0x813a32[_0xaecc('0x9')];var _0x4cd2cb=_0xa272a0?_0x3484e4[_0xaecc('0xb')]:_0x813a32[_0xaecc('0x9')]+_0x813a32[_0xaecc('0xc')];var _0x2ec45d;if(_0x4cd2cb>=_0x4e56c4){_0x4cd2cb=_0x4e56c4;_0x2ec45d=0xc8;}else{_0x2ec45d=0xce;}_0x4c2ea4[_0xaecc('0xd')](_0x2ec45d);return _0x4c2ea4[_0xaecc('0xe')](_0xaecc('0xf'),_0x12a8e9+'-'+_0x4cd2cb+'/'+_0x4e56c4)[_0xaecc('0x10')](_0x3484e4);}return null;};}exports[_0xaecc('0x11')]=function(_0x24153d,_0x132573){var _0x44f8ea={'count':0x0,'rows':[]};var _0x3e2e72={};var _0x1f09b4;var _0x4053a7=utils[_0xaecc('0x12')]();var _0x17bc48;var _0x3032f4;var _0x2a8264=_0x24153d[_0xaecc('0x13')][_0xaecc('0x14')];var _0x26e1cb=_0x24153d[_0xaecc('0x13')][_0xaecc('0x15')];var _0x3e71fc=_0x24153d['query'][_0xaecc('0x16')];var _0x45c34e=_0x26e1cb==='pause'||_0x26e1cb===_0xaecc('0x17')?!![]:![];var _0x3373dc=[];var _0xde1b27;var _0x2edeb6;Promise['resolve']()['then'](function(){if(_0x24153d[_0xaecc('0x13')][_0xaecc('0x18')]){if(!utils['isValidChannel'](_0x24153d[_0xaecc('0x13')][_0xaecc('0x18')])){throw new APIBadRequestError(util[_0xaecc('0x19')](_0xaecc('0x1a'),_0x24153d[_0xaecc('0x13')][_0xaecc('0x18')]));}_0x1f09b4=_0x24153d[_0xaecc('0x13')]['channel']['toLowerCase']();}if(!_0x24153d[_0xaecc('0x13')][_0xaecc('0x1b')]||!_0x24153d[_0xaecc('0x13')][_0xaecc('0x1b')]['includes']('globalStatus')){_0x24153d[_0xaecc('0x13')]['sort']=rta[_0xaecc('0x1c')](_0x24153d['query'][_0xaecc('0x1b')]);return;}var _0x47c1da=rta[_0xaecc('0x1d')](_0x24153d[_0xaecc('0x13')][_0xaecc('0x1b')]);_0x24153d['query']['sort']=_0x47c1da[_0xaecc('0x1e')][_0xaecc('0x1f')](',');_0xde1b27=_0x47c1da['order'];})[_0xaecc('0x20')](function(){if(!_0x2a8264){return[];}return rta[_0xaecc('0x21')](_0x2a8264,_0x1f09b4);})[_0xaecc('0x20')](function(_0x5e0025){_0x3373dc=_0x5e0025;return rta['getRealtimeAgents']();})[_0xaecc('0x20')](function(_0x262421){_0x3032f4=_0x262421[_0xaecc('0x22')];if((!_0x26e1cb||_0x45c34e)&&!_0xde1b27){return _0x3373dc;}if(_0xde1b27&&!_0x26e1cb){return rta[_0xaecc('0x23')](_0x3032f4,_0x3373dc,_0xde1b27);}else{return rta['getAgentIdsByStatus'](_0x3032f4,_0x3373dc,_0x26e1cb);}})[_0xaecc('0x20')](function(_0x29ad2a){_0x3373dc=_0x29ad2a;var _0x101f8e=![];if(_0x3373dc[_0xaecc('0x24')]===0x0){if(_0x2a8264||_0x26e1cb){_0x101f8e=!![];}if(_0x45c34e){_0x101f8e=![];}}if(_0x101f8e){return _0x44f8ea;}var _0x1d2981=_['map'](db[_0xaecc('0x25')][_0xaecc('0x26')],function(_0x41c969){return{'name':_0x41c969[_0xaecc('0x27')],'type':_0x41c969[_0xaecc('0x28')][_0xaecc('0x29')]};});_0x24153d[_0xaecc('0x13')][_0xaecc('0x2a')]=_0xaecc('0x2b');_0x3e2e72=qs[_0xaecc('0x2c')](_0x1d2981,_0x24153d);_0x3e2e72[_0xaecc('0x2d')]=!![];var _0x3ae8f8=[];if(_0x3373dc[_0xaecc('0x24')]>0x0){_0x3ae8f8['push']({'id':{'$in':_0x3373dc}});if(_0xde1b27&&!_0x26e1cb){_0x2edeb6=[db['sequelize'][_0xaecc('0x2e')](_0xaecc('0x2f')+_0x3373dc+')')];_0x3e2e72[_0xaecc('0x30')]=_0x2edeb6;}}if(_0x45c34e){_0x4053a7[_0xaecc('0x31')](function(_0x5864d0){var _0x127833=!![];if(_0x26e1cb===_0xaecc('0x17')&&_0x1f09b4!==_0x5864d0){_0x127833=![];}_0x3ae8f8[_0xaecc('0x32')]({[_0x5864d0+_0xaecc('0x33')]:_0x127833});});if(_0x3e71fc){_0x3ae8f8[_0xaecc('0x32')]({'pauseType':_0x3e71fc});}}else if(_0x26e1cb){_0x4053a7[_0xaecc('0x31')](function(_0x1b46ce){_0x3ae8f8[_0xaecc('0x32')]({[_0x1b46ce+_0xaecc('0x33')]:![]});});}_0x3e2e72[_0xaecc('0x34')]=_[_0xaecc('0x35')](_0x3e2e72[_0xaecc('0x34')],{'$and':_0x3ae8f8});if(_0x24153d[_0xaecc('0x36')][_0xaecc('0x2a')]===_0xaecc('0x36')){var _0x321805={'params':{'id':_0x24153d[_0xaecc('0x36')][_0xaecc('0x37')]},'query':{'section':_0xaecc('0x38'),'role':'agent','raw':!![],'ids':_0x3373dc,'customSorting':_0x2edeb6}};if(_0x24153d[_0xaecc('0x13')]['online']){_0x321805[_0xaecc('0x13')]['online']=!![];}if(_0x45c34e){_0x321805['query'][_0xaecc('0x39')]=_0x3ae8f8;}_0x321805[_0xaecc('0x13')]=Object[_0xaecc('0x3a')](_0x321805[_0xaecc('0x13')],_0x24153d[_0xaecc('0x13')]);return db[_0xaecc('0x3b')]['getResources'](_0x321805);}return db[_0xaecc('0x25')][_0xaecc('0x3c')](_0x3e2e72);})[_0xaecc('0x20')](function(_0x29a373){_0x44f8ea[_0xaecc('0xb')]=_0x29a373[_0xaecc('0xb')];_0x17bc48=_0x29a373[_0xaecc('0x22')];return _0x17bc48[_0xaecc('0x3d')](function(_0x1fc9f7){var _0x452e30=_[_0xaecc('0x3e')](_0x3032f4,['id',_0x1fc9f7['id']]);if(_0x452e30){var _0x4dad47=rta[_0xaecc('0x3f')](_0x452e30);_[_0xaecc('0x35')](_0x1fc9f7,_0x4dad47);}_0x1fc9f7[_0xaecc('0x40')]=rta['getAgentStatus'](_0x1fc9f7);if(_0x1fc9f7[_0xaecc('0x40')][_0xaecc('0x41')](_0xaecc('0x42'))){_0x4053a7[_0xaecc('0x31')](function(_0x290013){if(_0x1fc9f7[_0x290013+'Pause']){if(_0x290013===_0xaecc('0x43')){if(_0x1fc9f7[_0xaecc('0x44')]!==_0xaecc('0x45')){_0x1fc9f7[_0xaecc('0x44')]='pause';}}else{_0x1fc9f7[_0x290013+'Status']=_0xaecc('0x42');}}});}return _0x1fc9f7;});})['then'](function(_0x51ad53){if(!_0xde1b27||_0x2edeb6){return _0x51ad53;}return rta[_0xaecc('0x46')](_0x51ad53,_0xde1b27);})[_0xaecc('0x20')](function(_0x13db5b){var _0x92ffb8=rta[_0xaecc('0x47')]();_0x44f8ea[_0xaecc('0x22')]=_0x13db5b[_0xaecc('0x3d')](function(_0x1b529d){return _[_0xaecc('0x48')](_0x1b529d,_0x92ffb8);});return _0x44f8ea;})[_0xaecc('0x20')](respondWithFilteredResult(_0x132573,_0x3e2e72))[_0xaecc('0x49')](APIHandleError(_0x132573));};exports[_0xaecc('0x4a')]=function(_0x270bd8,_0x20e5d1){var _0x3adef1={'count':0x0,'rows':[]};var _0x4b552e={};var _0x4a8fce;var _0x13b25a;var _0x126b88;Promise['resolve']()['then'](function(){if(_0x270bd8[_0xaecc('0x13')]['channel']){if(!utils[_0xaecc('0x4b')](_0x270bd8[_0xaecc('0x13')][_0xaecc('0x18')])){throw new APIBadRequestError(util[_0xaecc('0x19')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x270bd8[_0xaecc('0x13')]['channel']));}_0x4a8fce=_0x270bd8[_0xaecc('0x13')]['channel'][_0xaecc('0x4c')]();}var _0x93852=_[_0xaecc('0x4d')](_0x4a8fce)+_0xaecc('0x4e');var _0x3e5bc3=_['map'](db[_0x93852][_0xaecc('0x26')],function(_0x49373d){return{'name':_0x49373d['fieldName'],'type':_0x49373d[_0xaecc('0x28')][_0xaecc('0x29')]};});if(!_0x270bd8[_0xaecc('0x13')][_0xaecc('0x1e')]){var _0x75e86=['id',_0xaecc('0x4f')];if(_0x4a8fce==='voice'){_0x75e86['push'](_0xaecc('0x28'));if(_0x270bd8[_0xaecc('0x13')][_0xaecc('0x28')]===_0xaecc('0x50')){_0x75e86[_0xaecc('0x32')]([_0xaecc('0x51'),_0xaecc('0x52')]);}}_0x270bd8['query'][_0xaecc('0x1e')]=_0x75e86['join'](',');}_0x4b552e=qs[_0xaecc('0x2c')](_0x3e5bc3,_0x270bd8);if(_0x270bd8[_0xaecc('0x36')]['role']===_0xaecc('0x36')){var _0x3a3905={'params':{'id':_0x270bd8[_0xaecc('0x36')][_0xaecc('0x37')]},'query':{'section':_0x4a8fce===_0xaecc('0x43')&&_0x270bd8[_0xaecc('0x13')]['type']===_0xaecc('0x50')?'QueueCampaigns':_[_0xaecc('0x4d')](_0x4a8fce)+_0xaecc('0x53'),'type':_0x270bd8[_0xaecc('0x13')][_0xaecc('0x28')],'nolimit':!![],'sort':_0xaecc('0x4f'),'filter':_0x270bd8[_0xaecc('0x13')][_0xaecc('0x54')]}};_0x3a3905[_0xaecc('0x13')]=Object[_0xaecc('0x3a')](_0x3a3905[_0xaecc('0x13')],_0x270bd8[_0xaecc('0x13')]);delete _0x3a3905[_0xaecc('0x13')]['id'];return db[_0xaecc('0x3b')][_0xaecc('0x55')](_0x3a3905);}return db[_0x93852]['findAndCountAll'](_0x4b552e);})['then'](function(_0x1aa2f5){_0x3adef1[_0xaecc('0xb')]=_0x1aa2f5[_0xaecc('0xb')];_0x13b25a=_0x1aa2f5[_0xaecc('0x22')];return rtq[_0xaecc('0x56')](_0x270bd8,_0x4a8fce);})[_0xaecc('0x20')](function(_0x2f8ddc){_0x126b88=_0x2f8ddc[_0xaecc('0x22')];return rtq[_0xaecc('0x57')](_0x13b25a,_0x126b88,_0x4a8fce,_0x270bd8[_0xaecc('0x13')]['type']);})['then'](function(_0x53a1da){_0x3adef1['rows']=_0x53a1da;return _0x3adef1;})[_0xaecc('0x20')](respondWithFilteredResult(_0x20e5d1,_0x4b552e))[_0xaecc('0x49')](APIHandleError(_0x20e5d1));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index fdec1dc..357f4f9 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x29b634,_0x369836){var _0x4c1074=function(_0x51b2d7){while(--_0x51b2d7){_0x29b634['push'](_0x29b634['shift']());}};_0x4c1074(++_0x369836);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x148107,_0x55755a){var _0x4008fc=function(_0x494ab9){while(--_0x494ab9){_0x148107['push'](_0x148107['shift']());}};_0x4008fc(++_0x55755a);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2d187e8..56872dd 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 _0x539d=['INTEGER','STRING','DATE','sequelize'];(function(_0x5b56cd,_0x4885a1){var _0x503657=function(_0x5a5ce0){while(--_0x5a5ce0){_0x5b56cd['push'](_0x5b56cd['shift']());}};_0x503657(++_0x4885a1);}(_0x539d,0x17b));var _0xd539=function(_0x434543,_0x2fd498){_0x434543=_0x434543-0x0;var _0x3e6749=_0x539d[_0x434543];return _0x3e6749;};'use strict';var Sequelize=require(_0xd539('0x0'));module['exports']={'state':{'type':Sequelize[_0xd539('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd539('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd539('0x3')]},'responsetime':{'type':Sequelize[_0xd539('0x3')]},'ringtime':{'type':Sequelize[_0xd539('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xd539('0x2')]},'campaigntype':{'type':Sequelize[_0xd539('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7fbe=['INTEGER','STRING','DATE'];(function(_0x3da508,_0x2d3629){var _0xcdc748=function(_0x39e407){while(--_0x39e407){_0x3da508['push'](_0x3da508['shift']());}};_0xcdc748(++_0x2d3629);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16acb7,_0x23f034){_0x16acb7=_0x16acb7-0x0;var _0x39bf39=_0x7fbe[_0x16acb7];return _0x39bf39;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xe7fb('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xe7fb('0x1')]},'scheduledat':{'type':Sequelize[_0xe7fb('0x2')]},'uniqueid':{'type':Sequelize[_0xe7fb('0x1')]},'starttime':{'type':Sequelize[_0xe7fb('0x2')]},'responsetime':{'type':Sequelize[_0xe7fb('0x2')]},'ringtime':{'type':Sequelize[_0xe7fb('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe7fb('0x1')]},'campaigntype':{'type':Sequelize[_0xe7fb('0x1')]},'membername':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index fee3225..2d79a6b 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 _0x6116=['moment','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','util','../../config/logger'];(function(_0x3eb450,_0x592b0a){var _0x2c4cfd=function(_0x34f5dc){while(--_0x34f5dc){_0x3eb450['push'](_0x3eb450['shift']());}};_0x2c4cfd(++_0x592b0a);}(_0x6116,0x115));var _0x6611=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x6116[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0x6611('0x0'));var logger=require(_0x6611('0x1'))('api');var moment=require(_0x6611('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6611('0x3'));var config=require(_0x6611('0x4'));var attributes=require(_0x6611('0x5'));module[_0x6611('0x6')]=function(_0x3f3c09,_0x122cb7){return _0x3f3c09['define'](_0x6611('0x7'),attributes,{'tableName':_0x6611('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3689=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1972d3,_0x515867){var _0x52cc9b=function(_0x1c31f0){while(--_0x1c31f0){_0x1972d3['push'](_0x1972d3['shift']());}};_0x52cc9b(++_0x515867);}(_0x3689,0x1da));var _0x9368=function(_0x4f4296,_0x112d5f){_0x4f4296=_0x4f4296-0x0;var _0x3f9ad2=_0x3689[_0x4f4296];return _0x3f9ad2;};'use strict';var _=require(_0x9368('0x0'));var util=require(_0x9368('0x1'));var logger=require(_0x9368('0x2'))(_0x9368('0x3'));var moment=require(_0x9368('0x4'));var BPromise=require(_0x9368('0x5'));var rp=require(_0x9368('0x6'));var fs=require('fs');var path=require(_0x9368('0x7'));var rimraf=require(_0x9368('0x8'));var config=require(_0x9368('0x9'));var attributes=require(_0x9368('0xa'));module[_0x9368('0xb')]=function(_0xc34ee2,_0x141fd5){return _0xc34ee2[_0x9368('0xc')](_0x9368('0xd'),attributes,{'tableName':_0x9368('0xe'),'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 85b9c25..bf0c398 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 _0x1350=['CreateReportAgentPreview','util','moment','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ReportAgentPreview','options'];(function(_0x528d3f,_0x441cd3){var _0x21c7fd=function(_0x25471c){while(--_0x25471c){_0x528d3f['push'](_0x528d3f['shift']());}};_0x21c7fd(++_0x441cd3);}(_0x1350,0x1b6));var _0x0135=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1350[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0135('0x0'));var moment=require(_0x0135('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0135('0x2'));var db=require(_0x0135('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0135('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0135('0x5')][_0x0135('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3ac4df,_0x5249a5,_0x22a945){return new BPromise(function(_0x5adc5c,_0x2a6c29){return client[_0x0135('0x7')](_0x3ac4df,_0x22a945)[_0x0135('0x8')](function(_0x363807){logger[_0x0135('0x9')](_0x0135('0xa'),_0x5249a5,_0x0135('0xb'));logger[_0x0135('0xc')](_0x0135('0xd'),_0x5249a5,_0x0135('0xb'),JSON[_0x0135('0xe')](_0x363807));if(_0x363807[_0x0135('0xf')]){if(_0x363807[_0x0135('0xf')][_0x0135('0x10')]===0x1f4){logger[_0x0135('0xf')](_0x0135('0xa'),_0x5249a5,_0x363807[_0x0135('0xf')][_0x0135('0x11')]);return _0x2a6c29(_0x363807[_0x0135('0xf')]['message']);}logger[_0x0135('0xf')](_0x0135('0xa'),_0x5249a5,_0x363807[_0x0135('0xf')][_0x0135('0x11')]);return _0x5adc5c(_0x363807[_0x0135('0xf')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x5249a5,_0x0135('0xb'));_0x5adc5c(_0x363807[_0x0135('0x12')][_0x0135('0x11')]);}})[_0x0135('0x13')](function(_0x1777e6){logger['error'](_0x0135('0xa'),_0x5249a5,_0x1777e6);_0x2a6c29(_0x1777e6);});});}exports['CreateReportAgentPreview']=function(_0x560e7b){var _0x588cb3=this;return new Promise(function(_0x45b805,_0x3a28a2){return db[_0x0135('0x14')]['create'](_0x560e7b['body'],{'raw':_0x560e7b[_0x0135('0x15')]?_0x560e7b[_0x0135('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x0135('0x8')](function(_0x2e4a56){logger[_0x0135('0x9')](_0x0135('0x16'),_0x560e7b);logger[_0x0135('0xc')](_0x0135('0x16'),_0x560e7b,JSON[_0x0135('0xe')](_0x2e4a56));_0x45b805(_0x2e4a56);})[_0x0135('0x13')](function(_0x35e719){logger[_0x0135('0xf')](_0x0135('0x16'),_0x35e719[_0x0135('0x11')],_0x560e7b);_0x3a28a2(_0x588cb3[_0x0135('0xf')](0x1f4,_0x35e719[_0x0135('0x11')]));});});}; \ No newline at end of file +var _0x063a=['result','catch','CreateReportAgentPreview','options','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x173593,_0x43bab3){var _0x1c0eda=function(_0x196dd5){while(--_0x196dd5){_0x173593['push'](_0x173593['shift']());}};_0x1c0eda(++_0x43bab3);}(_0x063a,0x1e0));var _0xa063=function(_0x39200c,_0x40d877){_0x39200c=_0x39200c-0x0;var _0x3f47e9=_0x063a[_0x39200c];return _0x3f47e9;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa063('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa063('0x2'));var db=require(_0xa063('0x3'))['db'];var utils=require(_0xa063('0x4'));var logger=require(_0xa063('0x5'))(_0xa063('0x6'));var config=require('../../config/environment');var jayson=require(_0xa063('0x7'));var client=jayson[_0xa063('0x8')][_0xa063('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48d75c,_0xded8a0,_0xc15936){return new BPromise(function(_0x29604a,_0x20cffa){return client[_0xa063('0xa')](_0x48d75c,_0xc15936)[_0xa063('0xb')](function(_0x119bbb){logger[_0xa063('0xc')](_0xa063('0xd'),_0xded8a0,'request\x20sent');logger[_0xa063('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xded8a0,_0xa063('0xf'),JSON[_0xa063('0x10')](_0x119bbb));if(_0x119bbb[_0xa063('0x11')]){if(_0x119bbb[_0xa063('0x11')][_0xa063('0x12')]===0x1f4){logger[_0xa063('0x11')](_0xa063('0xd'),_0xded8a0,_0x119bbb['error'][_0xa063('0x13')]);return _0x20cffa(_0x119bbb[_0xa063('0x11')][_0xa063('0x13')]);}logger['error'](_0xa063('0xd'),_0xded8a0,_0x119bbb[_0xa063('0x11')]['message']);return _0x29604a(_0x119bbb[_0xa063('0x11')][_0xa063('0x13')]);}else{logger['info'](_0xa063('0xd'),_0xded8a0,'request\x20sent');_0x29604a(_0x119bbb[_0xa063('0x14')][_0xa063('0x13')]);}})[_0xa063('0x15')](function(_0x3adc90){logger[_0xa063('0x11')](_0xa063('0xd'),_0xded8a0,_0x3adc90);_0x20cffa(_0x3adc90);});});}exports[_0xa063('0x16')]=function(_0x4aabc8){var _0x1fa2ef=this;return new Promise(function(_0xc5b2ed,_0x259e94){return db['ReportAgentPreview']['create'](_0x4aabc8['body'],{'raw':_0x4aabc8[_0xa063('0x17')]?_0x4aabc8[_0xa063('0x17')][_0xa063('0x18')]===undefined?!![]:![]:!![]})[_0xa063('0xb')](function(_0x4aba7d){logger['info']('CreateReportAgentPreview',_0x4aabc8);logger[_0xa063('0xe')](_0xa063('0x16'),_0x4aabc8,JSON[_0xa063('0x10')](_0x4aba7d));_0xc5b2ed(_0x4aba7d);})[_0xa063('0x15')](function(_0x4484bd){logger[_0xa063('0x11')](_0xa063('0x16'),_0x4484bd[_0xa063('0x13')],_0x4aabc8);_0x259e94(_0x1fa2ef[_0xa063('0x11')](0x1f4,_0x4484bd[_0xa063('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 7a5d6ef..4b2e403 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 _0x2551=['/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','exports','multer','util','express','./rpc.controller','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax'];(function(_0x6f2c21,_0x37f8cf){var _0x293ea1=function(_0xcc97f2){while(--_0xcc97f2){_0x6f2c21['push'](_0x6f2c21['shift']());}};_0x293ea1(++_0x37f8cf);}(_0x2551,0x1c6));var _0x1255=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x2551[_0x1b70e3];return _0x1452ab;};'use strict';var multer=require(_0x1255('0x0'));var util=require(_0x1255('0x1'));var path=require('path');var express=require(_0x1255('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1255('0x3'));router['get'](_0x1255('0x4'),auth['isAuthenticated'](),controller['voiceChannels']);router['get'](_0x1255('0x5'),auth[_0x1255('0x6')](),controller[_0x1255('0x7')]);router[_0x1255('0x8')](_0x1255('0x9'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x1255('0x8')]('/voice/queues',auth['isAuthenticated'](),controller[_0x1255('0xa')]);router[_0x1255('0x8')]('/chat/queues',auth[_0x1255('0x6')](),controller['chatQueues']);router[_0x1255('0x8')](_0x1255('0xb'),auth['isAuthenticated'](),controller[_0x1255('0xc')]);router[_0x1255('0x8')](_0x1255('0xd'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x1255('0x8')](_0x1255('0xe'),auth[_0x1255('0x6')](),controller['openchannelQueues']);router['get'](_0x1255('0xf'),auth[_0x1255('0x6')](),controller[_0x1255('0x10')]);router['get'](_0x1255('0x11'),auth[_0x1255('0x6')](),controller[_0x1255('0x12')]);router[_0x1255('0x8')]('/fax/queues',auth['isAuthenticated'](),controller[_0x1255('0x13')]);router[_0x1255('0x8')](_0x1255('0x14'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x1255('0x8')](_0x1255('0x15'),auth['isAuthenticated'](),controller[_0x1255('0x16')]);router[_0x1255('0x8')](_0x1255('0x17'),auth[_0x1255('0x6')](),controller[_0x1255('0x18')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x1255('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x1255('0x8')](_0x1255('0x19'),auth['isAuthenticated'](),controller[_0x1255('0x1a')]);router[_0x1255('0x8')](_0x1255('0x1b'),auth[_0x1255('0x6')](),controller['showVoiceQueues']);router['put'](_0x1255('0x1b'),auth[_0x1255('0x6')](),controller['updateVoiceQueue']);router[_0x1255('0x8')](_0x1255('0x1c'),auth[_0x1255('0x6')](),controller[_0x1255('0x1d')]);router[_0x1255('0x8')](_0x1255('0x1e'),auth[_0x1255('0x6')](),controller[_0x1255('0x1f')]);router[_0x1255('0x8')](_0x1255('0x20'),auth[_0x1255('0x6')](),controller[_0x1255('0x21')]);router[_0x1255('0x22')]('/agents/:id/capacity',auth[_0x1255('0x6')](),controller[_0x1255('0x23')]);router[_0x1255('0x8')](_0x1255('0x24'),auth['isAuthenticated'](),controller[_0x1255('0x25')]);router[_0x1255('0x8')](_0x1255('0x26'),auth[_0x1255('0x6')](),controller[_0x1255('0x27')]);router['get'](_0x1255('0x28'),auth['isAuthenticated'](),controller['campaigns']);router[_0x1255('0x8')](_0x1255('0x29'),auth[_0x1255('0x6')](),controller['faxAccounts']);router[_0x1255('0x8')]('/chat/queues/waitinginteractions',auth[_0x1255('0x6')](),controller[_0x1255('0x2a')]);router[_0x1255('0x8')](_0x1255('0x2b'),auth['isAuthenticated'](),controller[_0x1255('0x2c')]);router[_0x1255('0x8')](_0x1255('0x2d'),auth['isAuthenticated'](),controller[_0x1255('0x2e')]);router[_0x1255('0x8')]('/openchannel/queues/:id/waitinginteractions',auth[_0x1255('0x6')](),controller[_0x1255('0x2f')]);router[_0x1255('0x8')](_0x1255('0x30'),auth[_0x1255('0x6')](),controller[_0x1255('0x31')]);router['get'](_0x1255('0x32'),auth['isAuthenticated'](),controller[_0x1255('0x33')]);router[_0x1255('0x8')]('/fax/queues/waitinginteractions',auth[_0x1255('0x6')](),controller[_0x1255('0x34')]);router[_0x1255('0x35')](_0x1255('0x36'),auth[_0x1255('0x6')](),controller[_0x1255('0x37')](_0x1255('0x38')));router[_0x1255('0x8')](_0x1255('0x39'),auth['isAuthenticated'](),controller[_0x1255('0x3a')]);router['post']('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x1255('0x37')](_0x1255('0x3b')));router[_0x1255('0x8')](_0x1255('0x3c'),auth['isAuthenticated'](),controller[_0x1255('0x3d')]);router[_0x1255('0x35')](_0x1255('0x3e'),auth[_0x1255('0x6')](),controller[_0x1255('0x37')](_0x1255('0x3f')));router[_0x1255('0x8')](_0x1255('0x40'),auth[_0x1255('0x6')](),controller['showFaxQueues']);router[_0x1255('0x35')]('/openchannel/queues/:id/notify',auth[_0x1255('0x6')](),controller['queueNotify'](_0x1255('0x41')));router[_0x1255('0x8')](_0x1255('0x42'),auth[_0x1255('0x6')](),controller[_0x1255('0x43')]);router[_0x1255('0x35')]('/sms/queues/:id/notify',auth[_0x1255('0x6')](),controller[_0x1255('0x37')](_0x1255('0x44')));router[_0x1255('0x35')](_0x1255('0x45'),auth[_0x1255('0x6')](),controller[_0x1255('0x37')]('whatsapp'));router[_0x1255('0x8')](_0x1255('0x46'),auth[_0x1255('0x6')](),controller['showSmsQueues']);router[_0x1255('0x8')](_0x1255('0x47'),auth[_0x1255('0x6')](),controller['showWhatsappQueues']);router[_0x1255('0x35')](_0x1255('0x48'),auth[_0x1255('0x6')](),controller['agentNotify']);module[_0x1255('0x49')]=router; \ No newline at end of file +var _0xb435=['faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts'];(function(_0x1a32fe,_0xdab6ac){var _0x1abca6=function(_0x280920){while(--_0x280920){_0x1a32fe['push'](_0x1a32fe['shift']());}};_0x1abca6(++_0xdab6ac);}(_0xb435,0x10d));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5b43('0x0'));var util=require(_0x5b43('0x1'));var path=require(_0x5b43('0x2'));var express=require(_0x5b43('0x3'));var router=express[_0x5b43('0x4')]();var auth=require(_0x5b43('0x5'));var controller=require('./rpc.controller');router[_0x5b43('0x6')](_0x5b43('0x7'),auth[_0x5b43('0x8')](),controller['voiceChannels']);router['get'](_0x5b43('0x9'),auth[_0x5b43('0x8')](),controller[_0x5b43('0xa')]);router[_0x5b43('0x6')](_0x5b43('0xb'),auth['isAuthenticated'](),controller[_0x5b43('0xc')]);router[_0x5b43('0x6')](_0x5b43('0xd'),auth[_0x5b43('0x8')](),controller['voiceQueues']);router[_0x5b43('0x6')](_0x5b43('0xe'),auth[_0x5b43('0x8')](),controller[_0x5b43('0xf')]);router['get'](_0x5b43('0x10'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x11')]);router[_0x5b43('0x6')](_0x5b43('0x12'),auth['isAuthenticated'](),controller[_0x5b43('0x13')]);router[_0x5b43('0x6')](_0x5b43('0x14'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x15')]);router[_0x5b43('0x6')](_0x5b43('0x16'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x17')]);router[_0x5b43('0x6')](_0x5b43('0x18'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0x5b43('0x19'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x1a')]);router[_0x5b43('0x6')](_0x5b43('0x1b'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x1c')]);router[_0x5b43('0x6')](_0x5b43('0x1d'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x1e')]);router[_0x5b43('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x5b43('0x8')](),controller[_0x5b43('0x1f')]);router[_0x5b43('0x6')](_0x5b43('0x20'),auth[_0x5b43('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x5b43('0x6')](_0x5b43('0x21'),auth['isAuthenticated'](),controller[_0x5b43('0x22')]);router[_0x5b43('0x6')](_0x5b43('0x23'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x24')]);router['put'](_0x5b43('0x23'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x25')]);router[_0x5b43('0x6')]('/outbound',auth[_0x5b43('0x8')](),controller['outbound']);router['get'](_0x5b43('0x26'),auth[_0x5b43('0x8')](),controller['outboundChannels']);router[_0x5b43('0x6')](_0x5b43('0x27'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x28')]);router[_0x5b43('0x29')](_0x5b43('0x2a'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x2b')]);router[_0x5b43('0x6')](_0x5b43('0x2c'),auth['isAuthenticated'](),controller[_0x5b43('0x2d')]);router['get'](_0x5b43('0x2e'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x2f')]);router[_0x5b43('0x6')](_0x5b43('0x30'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x31')]);router['get'](_0x5b43('0x32'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x33')]);router[_0x5b43('0x6')](_0x5b43('0x34'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x5b43('0x6')](_0x5b43('0x35'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x36')]);router[_0x5b43('0x6')](_0x5b43('0x37'),auth['isAuthenticated'](),controller[_0x5b43('0x38')]);router['get'](_0x5b43('0x39'),auth[_0x5b43('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5b43('0x6')](_0x5b43('0x3a'),auth['isAuthenticated'](),controller[_0x5b43('0x3b')]);router[_0x5b43('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3c')]);router['get']('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x5b43('0x3d')]('/mail/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x3f')));router[_0x5b43('0x6')]('/mail/queues/:id',auth[_0x5b43('0x8')](),controller[_0x5b43('0x40')]);router[_0x5b43('0x3d')]('/chat/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x41')));router['get'](_0x5b43('0x42'),auth['isAuthenticated'](),controller[_0x5b43('0x43')]);router[_0x5b43('0x3d')](_0x5b43('0x44'),auth['isAuthenticated'](),controller[_0x5b43('0x3e')](_0x5b43('0x45')));router[_0x5b43('0x6')](_0x5b43('0x46'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x47')]);router[_0x5b43('0x3d')]('/openchannel/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x48')));router['get'](_0x5b43('0x49'),auth[_0x5b43('0x8')](),controller['showOpenchannelQueues']);router[_0x5b43('0x3d')](_0x5b43('0x4a'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')]('sms'));router[_0x5b43('0x3d')]('/whatsapp/queues/:id/notify',auth[_0x5b43('0x8')](),controller[_0x5b43('0x3e')](_0x5b43('0x4b')));router[_0x5b43('0x6')](_0x5b43('0x4c'),auth[_0x5b43('0x8')](),controller[_0x5b43('0x4d')]);router['get']('/whatsapp/queues/:id',auth[_0x5b43('0x8')](),controller[_0x5b43('0x4e')]);router[_0x5b43('0x3d')]('/agents/:id/notify',auth[_0x5b43('0x8')](),controller['agentNotify']);module[_0x5b43('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 564337e..25bbee6 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 _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x55a0af,_0x44f60d){var _0x74b5bc=function(_0x3cc36f){while(--_0x3cc36f){_0x55a0af['push'](_0x55a0af['shift']());}};_0x74b5bc(++_0x44f60d);}(_0xe706,0xa3));var _0x6e70=function(_0x5bed28,_0x3069b3){_0x5bed28=_0x5bed28-0x0;var _0x44fe9f=_0xe706[_0x5bed28];return _0x44fe9f;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x1a8613,_0x363f1f){var _0x175671=function(_0x995e5e){while(--_0x995e5e){_0x1a8613['push'](_0x1a8613['shift']());}};_0x175671(++_0x363f1f);}(_0xe706,0xa3));var _0x6e70=function(_0x205328,_0x12c15a){_0x205328=_0x205328-0x0;var _0x4a30eb=_0xe706[_0x205328];return _0x4a30eb;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 8ffce53..283a00b 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 _0x6d49=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','put','update','destroy','exports','util','connect-timeout','express'];(function(_0x6ffa12,_0x45a92a){var _0x17b047=function(_0x1bf1f6){while(--_0x1bf1f6){_0x6ffa12['push'](_0x6ffa12['shift']());}};_0x17b047(++_0x45a92a);}(_0x6d49,0x18d));var _0x96d4=function(_0x16cfab,_0x1e94c4){_0x16cfab=_0x16cfab-0x0;var _0x31e529=_0x6d49[_0x16cfab];return _0x31e529;};'use strict';var multer=require('multer');var util=require(_0x96d4('0x0'));var path=require('path');var timeout=require(_0x96d4('0x1'));var express=require(_0x96d4('0x2'));var router=express[_0x96d4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x96d4('0x4'));var interaction=require(_0x96d4('0x5'));var config=require(_0x96d4('0x6'));var controller=require(_0x96d4('0x7'));router[_0x96d4('0x8')]('/',auth[_0x96d4('0x9')](),controller[_0x96d4('0xa')]);router[_0x96d4('0x8')](_0x96d4('0xb'),auth['isAuthenticated'](),controller[_0x96d4('0xc')]);router[_0x96d4('0x8')](_0x96d4('0xd'),auth['isAuthenticated'](),controller['run']);router[_0x96d4('0xe')]('/',auth[_0x96d4('0x9')](),controller[_0x96d4('0xf')]);router[_0x96d4('0x10')](_0x96d4('0xb'),auth[_0x96d4('0x9')](),controller[_0x96d4('0x11')]);router['delete']('/:id',auth[_0x96d4('0x9')](),controller[_0x96d4('0x12')]);module[_0x96d4('0x13')]=router; \ No newline at end of file +var _0x4f9a=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','run','create','put','/:id','update','delete','destroy','multer'];(function(_0x404d48,_0x217da3){var _0x36c2cf=function(_0x5b7381){while(--_0x5b7381){_0x404d48['push'](_0x404d48['shift']());}};_0x36c2cf(++_0x217da3);}(_0x4f9a,0x125));var _0xa4f9=function(_0xea82a4,_0x56f3ab){_0xea82a4=_0xea82a4-0x0;var _0x55134f=_0x4f9a[_0xea82a4];return _0x55134f;};'use strict';var multer=require(_0xa4f9('0x0'));var util=require(_0xa4f9('0x1'));var path=require(_0xa4f9('0x2'));var timeout=require(_0xa4f9('0x3'));var express=require('express');var router=express[_0xa4f9('0x4')]();var fs_extra=require(_0xa4f9('0x5'));var auth=require(_0xa4f9('0x6'));var interaction=require(_0xa4f9('0x7'));var config=require(_0xa4f9('0x8'));var controller=require(_0xa4f9('0x9'));router[_0xa4f9('0xa')]('/',auth[_0xa4f9('0xb')](),controller[_0xa4f9('0xc')]);router[_0xa4f9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa4f9('0xd')]);router[_0xa4f9('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0xa4f9('0xe')]);router['post']('/',auth[_0xa4f9('0xb')](),controller[_0xa4f9('0xf')]);router[_0xa4f9('0x10')](_0xa4f9('0x11'),auth[_0xa4f9('0xb')](),controller[_0xa4f9('0x12')]);router[_0xa4f9('0x13')](_0xa4f9('0x11'),auth[_0xa4f9('0xb')](),controller[_0xa4f9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index dfbdc92..652db5e 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 _0x9217=['DATE','ENUM','years','quarters','weeks','hours','minutes','csv','pdf','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*'];(function(_0x22121f,_0x382e41){var _0x48407a=function(_0x12e2e2){while(--_0x12e2e2){_0x22121f['push'](_0x22121f['shift']());}};_0x48407a(++_0x382e41);}(_0x9217,0x150));var _0x7921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9217[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7921('0x0'));module[_0x7921('0x1')]={'name':{'type':Sequelize[_0x7921('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7921('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7921('0x2')],'allowNull':![],'defaultValue':_0x7921('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x7921('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7921('0x5')](_0x7921('0x6'),_0x7921('0x7'),'months',_0x7921('0x8'),'days',_0x7921('0x9'),_0x7921('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x7921('0x5')](_0x7921('0xb'),_0x7921('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x7921('0xb')},'type':{'type':Sequelize[_0x7921('0x5')](_0x7921('0xd'),_0x7921('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x7921('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0x7921('0x2')]},'cc':{'type':Sequelize[_0x7921('0x10')]},'bcc':{'type':Sequelize[_0x7921('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x7921('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9a89=['weeks','days','minutes','ENUM','pdf','xlsx','csv','custom','default','TEXT','STRING','BOOLEAN','DATE','INTEGER','years','quarters'];(function(_0x486e8b,_0x4d3b79){var _0x3b76a9=function(_0x41b7ef){while(--_0x41b7ef){_0x486e8b['push'](_0x486e8b['shift']());}};_0x3b76a9(++_0x4d3b79);}(_0x9a89,0xda));var _0x99a8=function(_0x1a81b4,_0xe6ee3e){_0x1a81b4=_0x1a81b4-0x0;var _0xfcc341=_0x9a89[_0x1a81b4];return _0xfcc341;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x99a8('0x0')]},'active':{'type':Sequelize[_0x99a8('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x99a8('0x0')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x99a8('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x99a8('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x99a8('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x99a8('0x4'),_0x99a8('0x5'),'months',_0x99a8('0x6'),_0x99a8('0x7'),'hours',_0x99a8('0x8')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x99a8('0x9')]('csv',_0x99a8('0xa'),_0x99a8('0xb')),'allowNull':![],'defaultValue':_0x99a8('0xc')},'type':{'type':Sequelize[_0x99a8('0x9')](_0x99a8('0xd'),_0x99a8('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x99a8('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x99a8('0x0')]},'cc':{'type':Sequelize[_0x99a8('0xf')]},'bcc':{'type':Sequelize[_0x99a8('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x99a8('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index ade17cc..8a39117 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 _0x2d39=['include','rows','show','keys','rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','update','then','destroy','Scheduler','error','name','send','index','map','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll'];(function(_0xfd96f3,_0x3c3f80){var _0x5aadd8=function(_0x432182){while(--_0x432182){_0xfd96f3['push'](_0xfd96f3['shift']());}};_0x5aadd8(++_0x3c3f80);}(_0x2d39,0x1e7));var _0x92d3=function(_0x10def7,_0x661f22){_0x10def7=_0x10def7-0x0;var _0xb4cae1=_0x2d39[_0x10def7];return _0xb4cae1;};'use strict';var emlformat=require(_0x92d3('0x0'));var rimraf=require(_0x92d3('0x1'));var zipdir=require(_0x92d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x92d3('0x3'));var Mustache=require(_0x92d3('0x4'));var util=require(_0x92d3('0x5'));var path=require(_0x92d3('0x6'));var sox=require('sox');var csv=require(_0x92d3('0x7'));var ejs=require(_0x92d3('0x8'));var fs=require('fs');var fs_extra=require(_0x92d3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x92d3('0xa'));var jsforce=require(_0x92d3('0xb'));var deskjs=require(_0x92d3('0xc'));var toCsv=require(_0x92d3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x92d3('0xd'));var authService=require(_0x92d3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x92d3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92d3('0x10'))(_0x92d3('0x11'));var utils=require(_0x92d3('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x92d3('0x13'));var db=require(_0x92d3('0x14'))['db'];function respondWithStatusCode(_0x3d236d,_0x2fe5a1){_0x2fe5a1=_0x2fe5a1||0xcc;return function(_0x39007b){if(_0x39007b){return _0x3d236d[_0x92d3('0x15')](_0x2fe5a1);}return _0x3d236d[_0x92d3('0x16')](_0x2fe5a1)[_0x92d3('0x17')]();};}function respondWithResult(_0x571123,_0x59f69b){_0x59f69b=_0x59f69b||0xc8;return function(_0x3af932){if(_0x3af932){return _0x571123[_0x92d3('0x16')](_0x59f69b)['json'](_0x3af932);}};}function respondWithFilteredResult(_0x488a75,_0x5a674d){return function(_0x3b8ddb){if(_0x3b8ddb){var _0x20de3e=typeof _0x5a674d['offset']===_0x92d3('0x18')&&typeof _0x5a674d[_0x92d3('0x19')]==='undefined';var _0x9f7189=_0x3b8ddb[_0x92d3('0x1a')];var _0x4ae852=_0x20de3e?0x0:_0x5a674d[_0x92d3('0x1b')];var _0x44fcda=_0x20de3e?_0x3b8ddb[_0x92d3('0x1a')]:_0x5a674d[_0x92d3('0x1b')]+_0x5a674d[_0x92d3('0x19')];var _0x5cf82a;if(_0x44fcda>=_0x9f7189){_0x44fcda=_0x9f7189;_0x5cf82a=0xc8;}else{_0x5cf82a=0xce;}_0x488a75[_0x92d3('0x16')](_0x5cf82a);return _0x488a75['set'](_0x92d3('0x1c'),_0x4ae852+'-'+_0x44fcda+'/'+_0x9f7189)['json'](_0x3b8ddb);}return null;};}function patchUpdates(_0x579a46){return function(_0x5475bb){try{jsonpatch[_0x92d3('0x1d')](_0x5475bb,_0x579a46,!![]);}catch(_0x23995d){return BPromise['reject'](_0x23995d);}return _0x5475bb['save']();};}function saveUpdates(_0x1d9073,_0x2a2451){return function(_0x2c33e7){if(_0x2c33e7){return _0x2c33e7[_0x92d3('0x1e')](_0x1d9073)[_0x92d3('0x1f')](function(_0x129ee8){return _0x129ee8;});}return null;};}function removeEntity(_0x3a5b19,_0x14d216){return function(_0x33f298){if(_0x33f298){return _0x33f298[_0x92d3('0x20')]()[_0x92d3('0x1f')](function(){var _0x1a1ba6=_0x33f298['get']({'plain':!![]});var _0x3cf2aa=_0x92d3('0x21');return db['UserProfileResource'][_0x92d3('0x20')]({'where':{'type':_0x3cf2aa,'resourceId':_0x1a1ba6['id']}})[_0x92d3('0x1f')](function(){return _0x33f298;});})[_0x92d3('0x1f')](function(){_0x3a5b19[_0x92d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19cacd,_0x2b088b){return function(_0x3f1197){if(!_0x3f1197){_0x19cacd[_0x92d3('0x15')](0x194);}return _0x3f1197;};}function handleError(_0x54b2d4,_0x58f297){_0x58f297=_0x58f297||0x1f4;return function(_0x2350ff){logger[_0x92d3('0x22')](_0x2350ff['stack']);if(_0x2350ff[_0x92d3('0x23')]){delete _0x2350ff[_0x92d3('0x23')];}_0x54b2d4[_0x92d3('0x16')](_0x58f297)[_0x92d3('0x24')](_0x2350ff);};}exports[_0x92d3('0x25')]=function(_0x3cc2c4,_0x804de7){var _0x54b31f={},_0x2970de={},_0x498dbb={'count':0x0,'rows':[]};var _0x4ccf0b=_[_0x92d3('0x26')](db['Schedule']['rawAttributes'],function(_0x9ae2ea){return{'name':_0x9ae2ea['fieldName'],'type':_0x9ae2ea[_0x92d3('0x27')][_0x92d3('0x28')]};});_0x2970de[_0x92d3('0x29')]=_[_0x92d3('0x26')](_0x4ccf0b,_0x92d3('0x23'));_0x2970de[_0x92d3('0x2a')]=_['keys'](_0x3cc2c4['query']);_0x2970de[_0x92d3('0x2b')]=_[_0x92d3('0x2c')](_0x2970de[_0x92d3('0x29')],_0x2970de[_0x92d3('0x2a')]);_0x54b31f['attributes']=_['intersection'](_0x2970de[_0x92d3('0x29')],qs[_0x92d3('0x2d')](_0x3cc2c4[_0x92d3('0x2a')][_0x92d3('0x2d')]));_0x54b31f[_0x92d3('0x2e')]=_0x54b31f[_0x92d3('0x2e')][_0x92d3('0x2f')]?_0x54b31f[_0x92d3('0x2e')]:_0x2970de[_0x92d3('0x29')];if(!_0x3cc2c4['query'][_0x92d3('0x30')]('nolimit')){_0x54b31f['limit']=qs['limit'](_0x3cc2c4[_0x92d3('0x2a')][_0x92d3('0x19')]);_0x54b31f[_0x92d3('0x1b')]=qs['offset'](_0x3cc2c4['query'][_0x92d3('0x1b')]);}_0x54b31f[_0x92d3('0x31')]=qs[_0x92d3('0x32')](_0x3cc2c4[_0x92d3('0x2a')][_0x92d3('0x32')]);_0x54b31f[_0x92d3('0x33')]=qs['filters'](_[_0x92d3('0x34')](_0x3cc2c4[_0x92d3('0x2a')],_0x2970de[_0x92d3('0x2b')]),_0x4ccf0b);if(_0x3cc2c4[_0x92d3('0x2a')][_0x92d3('0x35')]){_0x54b31f[_0x92d3('0x33')]=_[_0x92d3('0x36')](_0x54b31f[_0x92d3('0x33')],{'$or':_[_0x92d3('0x26')](_0x4ccf0b,function(_0x1f3c31){if(_0x1f3c31[_0x92d3('0x27')]!==_0x92d3('0x37')){var _0x566b8e={};_0x566b8e[_0x1f3c31[_0x92d3('0x23')]]={'$like':'%'+_0x3cc2c4['query'][_0x92d3('0x35')]+'%'};return _0x566b8e;}})});}_0x54b31f=_['merge']({},_0x54b31f,_0x3cc2c4[_0x92d3('0x38')]);var _0x4f9b41={'where':_0x54b31f[_0x92d3('0x33')]};return db[_0x92d3('0x39')][_0x92d3('0x1a')](_0x4f9b41)[_0x92d3('0x1f')](function(_0x9acade){_0x498dbb['count']=_0x9acade;if(_0x3cc2c4['query'][_0x92d3('0x3a')]){_0x54b31f[_0x92d3('0x3b')]=[{'all':!![]}];}return db[_0x92d3('0x39')]['findAll'](_0x54b31f);})['then'](function(_0x30de35){_0x498dbb[_0x92d3('0x3c')]=_0x30de35;return _0x498dbb;})[_0x92d3('0x1f')](respondWithFilteredResult(_0x804de7,_0x54b31f))['catch'](handleError(_0x804de7,null));};exports[_0x92d3('0x3d')]=function(_0x45147d,_0x4663bd){var _0x48ef48={'raw':![],'where':{'id':_0x45147d['params']['id']}},_0x2c6815={};_0x2c6815['model']=_[_0x92d3('0x3e')](db[_0x92d3('0x39')][_0x92d3('0x3f')]);_0x2c6815[_0x92d3('0x2a')]=_[_0x92d3('0x3e')](_0x45147d[_0x92d3('0x2a')]);_0x2c6815[_0x92d3('0x2b')]=_[_0x92d3('0x2c')](_0x2c6815['model'],_0x2c6815[_0x92d3('0x2a')]);_0x48ef48['attributes']=_['intersection'](_0x2c6815['model'],qs[_0x92d3('0x2d')](_0x45147d[_0x92d3('0x2a')]['fields']));_0x48ef48['attributes']=_0x48ef48['attributes'][_0x92d3('0x2f')]?_0x48ef48['attributes']:_0x2c6815[_0x92d3('0x29')];if(_0x45147d[_0x92d3('0x2a')][_0x92d3('0x3a')]){_0x48ef48[_0x92d3('0x3b')]=[{'all':!![]}];}_0x48ef48=_[_0x92d3('0x36')]({},_0x48ef48,_0x45147d['options']);return db[_0x92d3('0x39')][_0x92d3('0x40')](_0x48ef48)[_0x92d3('0x1f')](handleEntityNotFound(_0x4663bd,null))[_0x92d3('0x1f')](respondWithResult(_0x4663bd,null))[_0x92d3('0x41')](handleError(_0x4663bd,null));};exports[_0x92d3('0x42')]=function(_0x31247e,_0xf12e17){return db[_0x92d3('0x39')][_0x92d3('0x42')](_0x31247e['body'],{})[_0x92d3('0x1f')](function(_0x42e892){var _0x43d1c4=_0x31247e[_0x92d3('0x43')][_0x92d3('0x44')]({'plain':!![]});if(!_0x43d1c4)throw new Error(_0x92d3('0x45'));if(_0x43d1c4[_0x92d3('0x46')]==='user'){var _0x3a3d60=_0x42e892[_0x92d3('0x44')]({'plain':!![]});var _0x3ab512=_0x92d3('0x21');return db['UserProfileSection'][_0x92d3('0x40')]({'where':{'name':_0x3ab512,'userProfileId':_0x43d1c4[_0x92d3('0x47')]},'raw':!![]})[_0x92d3('0x1f')](function(_0x2506d2){if(_0x2506d2&&_0x2506d2[_0x92d3('0x48')]===0x0){return db['UserProfileResource'][_0x92d3('0x42')]({'name':_0x3a3d60[_0x92d3('0x23')],'resourceId':_0x3a3d60['id'],'type':_0x2506d2[_0x92d3('0x23')],'sectionId':_0x2506d2['id']},{})[_0x92d3('0x1f')](function(){return _0x42e892;});}else{return _0x42e892;}})[_0x92d3('0x41')](function(_0x5b4930){logger[_0x92d3('0x22')](_0x92d3('0x49'),_0x5b4930);throw _0x5b4930;});}return _0x42e892;})['then'](respondWithResult(_0xf12e17,0xc9))[_0x92d3('0x41')](handleError(_0xf12e17,null));};exports[_0x92d3('0x1e')]=function(_0x3a6230,_0x1a09a8){if(_0x3a6230['body']['id']){delete _0x3a6230[_0x92d3('0x4a')]['id'];}return db[_0x92d3('0x39')][_0x92d3('0x40')]({'where':{'id':_0x3a6230[_0x92d3('0x4b')]['id']}})[_0x92d3('0x1f')](handleEntityNotFound(_0x1a09a8,null))['then'](saveUpdates(_0x3a6230['body'],null))[_0x92d3('0x1f')](respondWithResult(_0x1a09a8,null))[_0x92d3('0x41')](handleError(_0x1a09a8,null));};exports[_0x92d3('0x20')]=function(_0x7e7888,_0xfcb6d0){return db[_0x92d3('0x39')][_0x92d3('0x40')]({'where':{'id':_0x7e7888[_0x92d3('0x4b')]['id']}})[_0x92d3('0x1f')](handleEntityNotFound(_0xfcb6d0,null))[_0x92d3('0x1f')](removeEntity(_0xfcb6d0,null))[_0x92d3('0x41')](handleError(_0xfcb6d0,null));};exports[_0x92d3('0x4c')]=function(_0x4ae85a,_0x500924,_0x120ef6){var _0x99bb58=require(_0x92d3('0x4d'));return db[_0x92d3('0x39')][_0x92d3('0x40')]({'where':{'id':_0x4ae85a[_0x92d3('0x4b')]['id']},'raw':!![]})[_0x92d3('0x1f')](handleEntityNotFound(_0x500924,null))['then'](function(){_0x99bb58['run'](_0x4ae85a[_0x92d3('0x4b')]['id']);})[_0x92d3('0x1f')](respondWithStatusCode(_0x500924,null))[_0x92d3('0x41')](handleError(_0x500924,null));}; \ No newline at end of file +var _0x958b=['keys','filters','intersection','attributes','fields','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','query'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x958b,0x11b));var _0xb958=function(_0x8dee8d,_0x2a17fb){_0x8dee8d=_0x8dee8d-0x0;var _0x40d498=_0x958b[_0x8dee8d];return _0x40d498;};'use strict';var emlformat=require(_0xb958('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb958('0x1'));var rp=require(_0xb958('0x2'));var moment=require(_0xb958('0x3'));var BPromise=require(_0xb958('0x4'));var Mustache=require(_0xb958('0x5'));var util=require(_0xb958('0x6'));var path=require(_0xb958('0x7'));var sox=require(_0xb958('0x8'));var csv=require(_0xb958('0x9'));var ejs=require(_0xb958('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb958('0xb'));var squel=require(_0xb958('0xc'));var crypto=require('crypto');var jsforce=require(_0xb958('0xd'));var deskjs=require(_0xb958('0xe'));var toCsv=require(_0xb958('0x9'));var querystring=require(_0xb958('0xf'));var Papa=require(_0xb958('0x10'));var Redis=require(_0xb958('0x11'));var authService=require(_0xb958('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb958('0x13'));var hardwareService=require(_0xb958('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb958('0x15'));var config=require(_0xb958('0x16'));var licenseUtil=require(_0xb958('0x17'));var db=require(_0xb958('0x18'))['db'];function respondWithStatusCode(_0x2bfee2,_0x4597c5){_0x4597c5=_0x4597c5||0xcc;return function(_0x3f0486){if(_0x3f0486){return _0x2bfee2['sendStatus'](_0x4597c5);}return _0x2bfee2[_0xb958('0x19')](_0x4597c5)[_0xb958('0x1a')]();};}function respondWithResult(_0x58e337,_0x56db3f){_0x56db3f=_0x56db3f||0xc8;return function(_0x27909e){if(_0x27909e){return _0x58e337[_0xb958('0x19')](_0x56db3f)[_0xb958('0x1b')](_0x27909e);}};}function respondWithFilteredResult(_0x4d39ce,_0x2bfe25){return function(_0x2498a9){if(_0x2498a9){var _0x58c248=typeof _0x2bfe25[_0xb958('0x1c')]===_0xb958('0x1d')&&typeof _0x2bfe25[_0xb958('0x1e')]===_0xb958('0x1d');var _0x42a69a=_0x2498a9[_0xb958('0x1f')];var _0x176b51=_0x58c248?0x0:_0x2bfe25[_0xb958('0x1c')];var _0xff51e4=_0x58c248?_0x2498a9[_0xb958('0x1f')]:_0x2bfe25['offset']+_0x2bfe25['limit'];var _0x5e5375;if(_0xff51e4>=_0x42a69a){_0xff51e4=_0x42a69a;_0x5e5375=0xc8;}else{_0x5e5375=0xce;}_0x4d39ce['status'](_0x5e5375);return _0x4d39ce['set'](_0xb958('0x20'),_0x176b51+'-'+_0xff51e4+'/'+_0x42a69a)['json'](_0x2498a9);}return null;};}function patchUpdates(_0x451f6d){return function(_0x5dd3a9){try{jsonpatch['apply'](_0x5dd3a9,_0x451f6d,!![]);}catch(_0x460f73){return BPromise[_0xb958('0x21')](_0x460f73);}return _0x5dd3a9['save']();};}function saveUpdates(_0x18432f,_0x59578f){return function(_0x478c4b){if(_0x478c4b){return _0x478c4b['update'](_0x18432f)[_0xb958('0x22')](function(_0x29d399){return _0x29d399;});}return null;};}function removeEntity(_0x1c32cb,_0x445582){return function(_0x4396dd){if(_0x4396dd){return _0x4396dd[_0xb958('0x23')]()[_0xb958('0x22')](function(){var _0x4997e1=_0x4396dd['get']({'plain':!![]});var _0xa7852c='Scheduler';return db['UserProfileResource'][_0xb958('0x23')]({'where':{'type':_0xa7852c,'resourceId':_0x4997e1['id']}})['then'](function(){return _0x4396dd;});})[_0xb958('0x22')](function(){_0x1c32cb[_0xb958('0x19')](0xcc)[_0xb958('0x1a')]();});}};}function handleEntityNotFound(_0x39a6e8,_0x569579){return function(_0x1c393e){if(!_0x1c393e){_0x39a6e8[_0xb958('0x24')](0x194);}return _0x1c393e;};}function handleError(_0xa86662,_0x45d86b){_0x45d86b=_0x45d86b||0x1f4;return function(_0x14d7b7){logger[_0xb958('0x25')](_0x14d7b7[_0xb958('0x26')]);if(_0x14d7b7[_0xb958('0x27')]){delete _0x14d7b7[_0xb958('0x27')];}_0xa86662['status'](_0x45d86b)[_0xb958('0x28')](_0x14d7b7);};}exports[_0xb958('0x29')]=function(_0x2d6244,_0x5ef0e8){var _0x5899d1={},_0x325d31={},_0x544d6e={'count':0x0,'rows':[]};var _0x17f859=_['map'](db[_0xb958('0x2a')][_0xb958('0x2b')],function(_0x1ffaf2){return{'name':_0x1ffaf2[_0xb958('0x2c')],'type':_0x1ffaf2[_0xb958('0x2d')][_0xb958('0x2e')]};});_0x325d31[_0xb958('0x2f')]=_['map'](_0x17f859,_0xb958('0x27'));_0x325d31[_0xb958('0x30')]=_[_0xb958('0x31')](_0x2d6244[_0xb958('0x30')]);_0x325d31[_0xb958('0x32')]=_[_0xb958('0x33')](_0x325d31[_0xb958('0x2f')],_0x325d31['query']);_0x5899d1[_0xb958('0x34')]=_[_0xb958('0x33')](_0x325d31[_0xb958('0x2f')],qs[_0xb958('0x35')](_0x2d6244[_0xb958('0x30')]['fields']));_0x5899d1['attributes']=_0x5899d1[_0xb958('0x34')]['length']?_0x5899d1[_0xb958('0x34')]:_0x325d31[_0xb958('0x2f')];if(!_0x2d6244[_0xb958('0x30')]['hasOwnProperty']('nolimit')){_0x5899d1['limit']=qs['limit'](_0x2d6244[_0xb958('0x30')][_0xb958('0x1e')]);_0x5899d1['offset']=qs[_0xb958('0x1c')](_0x2d6244[_0xb958('0x30')]['offset']);}_0x5899d1['order']=qs[_0xb958('0x36')](_0x2d6244[_0xb958('0x30')]['sort']);_0x5899d1['where']=qs[_0xb958('0x32')](_[_0xb958('0x37')](_0x2d6244[_0xb958('0x30')],_0x325d31[_0xb958('0x32')]),_0x17f859);if(_0x2d6244[_0xb958('0x30')]['filter']){_0x5899d1[_0xb958('0x38')]=_[_0xb958('0x39')](_0x5899d1['where'],{'$or':_[_0xb958('0x3a')](_0x17f859,function(_0xe8777a){if(_0xe8777a[_0xb958('0x2d')]!==_0xb958('0x3b')){var _0x228081={};_0x228081[_0xe8777a[_0xb958('0x27')]]={'$like':'%'+_0x2d6244[_0xb958('0x30')][_0xb958('0x3c')]+'%'};return _0x228081;}})});}_0x5899d1=_[_0xb958('0x39')]({},_0x5899d1,_0x2d6244[_0xb958('0x3d')]);var _0x69bcb0={'where':_0x5899d1['where']};return db[_0xb958('0x2a')]['count'](_0x69bcb0)[_0xb958('0x22')](function(_0x1d6ab2){_0x544d6e[_0xb958('0x1f')]=_0x1d6ab2;if(_0x2d6244[_0xb958('0x30')][_0xb958('0x3e')]){_0x5899d1['include']=[{'all':!![]}];}return db['Schedule'][_0xb958('0x3f')](_0x5899d1);})['then'](function(_0x5cea34){_0x544d6e[_0xb958('0x40')]=_0x5cea34;return _0x544d6e;})[_0xb958('0x22')](respondWithFilteredResult(_0x5ef0e8,_0x5899d1))[_0xb958('0x41')](handleError(_0x5ef0e8,null));};exports[_0xb958('0x42')]=function(_0x39af28,_0x38b0b7){var _0x43986f={'raw':![],'where':{'id':_0x39af28[_0xb958('0x43')]['id']}},_0x5dfa79={};_0x5dfa79[_0xb958('0x2f')]=_[_0xb958('0x31')](db['Schedule'][_0xb958('0x2b')]);_0x5dfa79['query']=_[_0xb958('0x31')](_0x39af28[_0xb958('0x30')]);_0x5dfa79[_0xb958('0x32')]=_[_0xb958('0x33')](_0x5dfa79[_0xb958('0x2f')],_0x5dfa79[_0xb958('0x30')]);_0x43986f[_0xb958('0x34')]=_[_0xb958('0x33')](_0x5dfa79[_0xb958('0x2f')],qs[_0xb958('0x35')](_0x39af28[_0xb958('0x30')]['fields']));_0x43986f[_0xb958('0x34')]=_0x43986f[_0xb958('0x34')][_0xb958('0x44')]?_0x43986f['attributes']:_0x5dfa79['model'];if(_0x39af28[_0xb958('0x30')][_0xb958('0x3e')]){_0x43986f[_0xb958('0x45')]=[{'all':!![]}];}_0x43986f=_[_0xb958('0x39')]({},_0x43986f,_0x39af28['options']);return db['Schedule']['find'](_0x43986f)[_0xb958('0x22')](handleEntityNotFound(_0x38b0b7,null))['then'](respondWithResult(_0x38b0b7,null))[_0xb958('0x41')](handleError(_0x38b0b7,null));};exports['create']=function(_0xd83bae,_0x18060f){return db[_0xb958('0x2a')][_0xb958('0x46')](_0xd83bae[_0xb958('0x47')],{})[_0xb958('0x22')](function(_0x216a45){var _0x2e0858=_0xd83bae[_0xb958('0x48')]['get']({'plain':!![]});if(!_0x2e0858)throw new Error(_0xb958('0x49'));if(_0x2e0858[_0xb958('0x4a')]===_0xb958('0x48')){var _0x2f9996=_0x216a45[_0xb958('0x4b')]({'plain':!![]});var _0x46cbe6='Scheduler';return db['UserProfileSection'][_0xb958('0x4c')]({'where':{'name':_0x46cbe6,'userProfileId':_0x2e0858[_0xb958('0x4d')]},'raw':!![]})[_0xb958('0x22')](function(_0x192376){if(_0x192376&&_0x192376[_0xb958('0x4e')]===0x0){return db['UserProfileResource'][_0xb958('0x46')]({'name':_0x2f9996[_0xb958('0x27')],'resourceId':_0x2f9996['id'],'type':_0x192376[_0xb958('0x27')],'sectionId':_0x192376['id']},{})[_0xb958('0x22')](function(){return _0x216a45;});}else{return _0x216a45;}})['catch'](function(_0x4b07de){logger[_0xb958('0x25')](_0xb958('0x4f'),_0x4b07de);throw _0x4b07de;});}return _0x216a45;})['then'](respondWithResult(_0x18060f,0xc9))['catch'](handleError(_0x18060f,null));};exports[_0xb958('0x50')]=function(_0x116c20,_0x919540){if(_0x116c20[_0xb958('0x47')]['id']){delete _0x116c20[_0xb958('0x47')]['id'];}return db['Schedule'][_0xb958('0x4c')]({'where':{'id':_0x116c20[_0xb958('0x43')]['id']}})[_0xb958('0x22')](handleEntityNotFound(_0x919540,null))[_0xb958('0x22')](saveUpdates(_0x116c20[_0xb958('0x47')],null))[_0xb958('0x22')](respondWithResult(_0x919540,null))['catch'](handleError(_0x919540,null));};exports[_0xb958('0x23')]=function(_0x34f597,_0x21acc1){return db[_0xb958('0x2a')]['find']({'where':{'id':_0x34f597[_0xb958('0x43')]['id']}})[_0xb958('0x22')](handleEntityNotFound(_0x21acc1,null))[_0xb958('0x22')](removeEntity(_0x21acc1,null))['catch'](handleError(_0x21acc1,null));};exports[_0xb958('0x51')]=function(_0x366bae,_0x48ea30,_0x592b27){var _0x9844b6=require(_0xb958('0x52'));return db['Schedule'][_0xb958('0x4c')]({'where':{'id':_0x366bae['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x48ea30,null))['then'](function(){_0x9844b6[_0xb958('0x51')](_0x366bae[_0xb958('0x43')]['id']);})[_0xb958('0x22')](respondWithStatusCode(_0x48ea30,null))[_0xb958('0x41')](handleError(_0x48ea30,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1dad4ed..c0c490f 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 _0xacee=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x18ac57,_0x276f49){var _0x3f0224=function(_0x339b3a){while(--_0x339b3a){_0x18ac57['push'](_0x18ac57['shift']());}};_0x3f0224(++_0x276f49);}(_0xacee,0x1e4));var _0xeace=function(_0x404cd6,_0x31feb5){_0x404cd6=_0x404cd6-0x0;var _0x4ee9e0=_0xacee[_0x404cd6];return _0x4ee9e0;};'use strict';var _=require(_0xeace('0x0'));var util=require(_0xeace('0x1'));var logger=require(_0xeace('0x2'))(_0xeace('0x3'));var moment=require('moment');var BPromise=require(_0xeace('0x4'));var rp=require(_0xeace('0x5'));var fs=require('fs');var path=require(_0xeace('0x6'));var rimraf=require(_0xeace('0x7'));var config=require(_0xeace('0x8'));var attributes=require(_0xeace('0x9'));module[_0xeace('0xa')]=function(_0x257cf4,_0x493101){return _0x257cf4[_0xeace('0xb')](_0xeace('0xc'),attributes,{'tableName':_0xeace('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x544c=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Schedule','tools_schedules','util','../../config/logger'];(function(_0x3cd4f8,_0x116c1a){var _0x487b82=function(_0x3e42a8){while(--_0x3e42a8){_0x3cd4f8['push'](_0x3cd4f8['shift']());}};_0x487b82(++_0x116c1a);}(_0x544c,0x106));var _0xc544=function(_0x5b7606,_0x3367ef){_0x5b7606=_0x5b7606-0x0;var _0x186584=_0x544c[_0x5b7606];return _0x186584;};'use strict';var _=require('lodash');var util=require(_0xc544('0x0'));var logger=require(_0xc544('0x1'))(_0xc544('0x2'));var moment=require(_0xc544('0x3'));var BPromise=require(_0xc544('0x4'));var rp=require(_0xc544('0x5'));var fs=require('fs');var path=require(_0xc544('0x6'));var rimraf=require('rimraf');var config=require(_0xc544('0x7'));var attributes=require('./schedule.attributes');module[_0xc544('0x8')]=function(_0x30d5d3,_0x17a2ed){return _0x30d5d3[_0xc544('0x9')](_0xc544('0xa'),attributes,{'tableName':_0xc544('0xb'),'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 4e50067..f5d2def 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 _0xe8f5=['request','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x207b53,_0x71b115){var _0x3d8932=function(_0x5d97d4){while(--_0x5d97d4){_0x207b53['push'](_0x207b53['shift']());}};_0x3d8932(++_0x71b115);}(_0xe8f5,0x144));var _0x5e8f=function(_0x344b42,_0x16740b){_0x344b42=_0x344b42-0x0;var _0x1a4d40=_0xe8f5[_0x344b42];return _0x1a4d40;};'use strict';var _=require(_0x5e8f('0x0'));var util=require(_0x5e8f('0x1'));var moment=require(_0x5e8f('0x2'));var BPromise=require(_0x5e8f('0x3'));var rs=require(_0x5e8f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e8f('0x5'))['db'];var utils=require(_0x5e8f('0x6'));var logger=require('../../config/logger')(_0x5e8f('0x7'));var config=require(_0x5e8f('0x8'));var jayson=require(_0x5e8f('0x9'));var client=jayson[_0x5e8f('0xa')][_0x5e8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x245537,_0x4db9fb,_0x33e182){return new BPromise(function(_0x29c8ee,_0x18fb58){return client[_0x5e8f('0xc')](_0x245537,_0x33e182)[_0x5e8f('0xd')](function(_0x57b27b){logger[_0x5e8f('0xe')]('Schedule,\x20%s,\x20%s',_0x4db9fb,'request\x20sent');logger[_0x5e8f('0xf')](_0x5e8f('0x10'),_0x4db9fb,_0x5e8f('0x11'),JSON[_0x5e8f('0x12')](_0x57b27b));if(_0x57b27b['error']){if(_0x57b27b['error']['code']===0x1f4){logger[_0x5e8f('0x13')](_0x5e8f('0x14'),_0x4db9fb,_0x57b27b[_0x5e8f('0x13')]['message']);return _0x18fb58(_0x57b27b['error']['message']);}logger[_0x5e8f('0x13')]('Schedule,\x20%s,\x20%s',_0x4db9fb,_0x57b27b[_0x5e8f('0x13')][_0x5e8f('0x15')]);return _0x29c8ee(_0x57b27b[_0x5e8f('0x13')]['message']);}else{logger[_0x5e8f('0xe')](_0x5e8f('0x14'),_0x4db9fb,_0x5e8f('0x11'));_0x29c8ee(_0x57b27b[_0x5e8f('0x16')]['message']);}})[_0x5e8f('0x17')](function(_0x7d5a6e){logger[_0x5e8f('0x13')]('Schedule,\x20%s,\x20%s',_0x4db9fb,_0x7d5a6e);_0x18fb58(_0x7d5a6e);});});} \ No newline at end of file +var _0x76f7=['Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Schedule,\x20%s,\x20%s','debug'];(function(_0x18de2e,_0x412972){var _0x197a79=function(_0x3cc580){while(--_0x3cc580){_0x18de2e['push'](_0x18de2e['shift']());}};_0x197a79(++_0x412972);}(_0x76f7,0x1e7));var _0x776f=function(_0x290c3b,_0x13cb2a){_0x290c3b=_0x290c3b-0x0;var _0x235c79=_0x76f7[_0x290c3b];return _0x235c79;};'use strict';var _=require(_0x776f('0x0'));var util=require(_0x776f('0x1'));var moment=require(_0x776f('0x2'));var BPromise=require('bluebird');var rs=require(_0x776f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x776f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x776f('0x5'))('rpc');var config=require(_0x776f('0x6'));var jayson=require(_0x776f('0x7'));var client=jayson[_0x776f('0x8')][_0x776f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x430e79,_0x533b60,_0x394ca2){return new BPromise(function(_0x52c8e2,_0x49b90a){return client['request'](_0x430e79,_0x394ca2)[_0x776f('0xa')](function(_0x174faf){logger['info'](_0x776f('0xb'),_0x533b60,'request\x20sent');logger[_0x776f('0xc')](_0x776f('0xd'),_0x533b60,_0x776f('0xe'),JSON[_0x776f('0xf')](_0x174faf));if(_0x174faf[_0x776f('0x10')]){if(_0x174faf['error'][_0x776f('0x11')]===0x1f4){logger[_0x776f('0x10')](_0x776f('0xb'),_0x533b60,_0x174faf['error'][_0x776f('0x12')]);return _0x49b90a(_0x174faf[_0x776f('0x10')][_0x776f('0x12')]);}logger[_0x776f('0x10')](_0x776f('0xb'),_0x533b60,_0x174faf[_0x776f('0x10')][_0x776f('0x12')]);return _0x52c8e2(_0x174faf[_0x776f('0x10')][_0x776f('0x12')]);}else{logger['info'](_0x776f('0xb'),_0x533b60,'request\x20sent');_0x52c8e2(_0x174faf['result']['message']);}})[_0x776f('0x13')](function(_0x4a727e){logger[_0x776f('0x10')](_0x776f('0xb'),_0x533b60,_0x4a727e);_0x49b90a(_0x4a727e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 1df2a53..514973a 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 _0x0daa=['get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1ab390,_0x49d6e7){var _0x38e9e3=function(_0xfc8ed0){while(--_0xfc8ed0){_0x1ab390['push'](_0x1ab390['shift']());}};_0x38e9e3(++_0x49d6e7);}(_0x0daa,0x134));var _0xa0da=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0daa[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xa0da('0x0'));var util=require('util');var path=require(_0xa0da('0x1'));var timeout=require('connect-timeout');var express=require(_0xa0da('0x2'));var router=express[_0xa0da('0x3')]();var fs_extra=require(_0xa0da('0x4'));var auth=require(_0xa0da('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa0da('0x6'));var controller=require('./screenRecording.controller');router[_0xa0da('0x7')]('/',auth[_0xa0da('0x8')](),controller[_0xa0da('0x9')]);router[_0xa0da('0x7')]('/describe',auth[_0xa0da('0x8')](),controller[_0xa0da('0xa')]);router[_0xa0da('0x7')](_0xa0da('0xb'),auth[_0xa0da('0x8')](),controller[_0xa0da('0xc')]);router[_0xa0da('0x7')](_0xa0da('0xd'),auth[_0xa0da('0x8')](),controller[_0xa0da('0xe')]);router[_0xa0da('0xf')]('/',auth[_0xa0da('0x8')](),controller[_0xa0da('0x10')]);router[_0xa0da('0x11')](_0xa0da('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa0da('0x12')](_0xa0da('0xb'),auth[_0xa0da('0x8')](),controller[_0xa0da('0x13')]);module[_0xa0da('0x14')]=router; \ No newline at end of file +var _0xb1e8=['get','/describe','isAuthenticated','describe','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index'];(function(_0xdd619,_0x1ad3b5){var _0x281ec1=function(_0x3e2250){while(--_0x3e2250){_0xdd619['push'](_0xdd619['shift']());}};_0x281ec1(++_0x1ad3b5);}(_0xb1e8,0x16c));var _0x8b1e=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xb1e8[_0x32b542];return _0x554d54;};'use strict';var multer=require(_0x8b1e('0x0'));var util=require(_0x8b1e('0x1'));var path=require(_0x8b1e('0x2'));var timeout=require(_0x8b1e('0x3'));var express=require(_0x8b1e('0x4'));var router=express['Router']();var fs_extra=require(_0x8b1e('0x5'));var auth=require(_0x8b1e('0x6'));var interaction=require(_0x8b1e('0x7'));var config=require(_0x8b1e('0x8'));var controller=require(_0x8b1e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b1e('0xa')]);router[_0x8b1e('0xb')](_0x8b1e('0xc'),auth[_0x8b1e('0xd')](),controller[_0x8b1e('0xe')]);router[_0x8b1e('0xb')]('/:id',auth[_0x8b1e('0xd')](),controller[_0x8b1e('0xf')]);router['get'](_0x8b1e('0x10'),auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x11')]);router[_0x8b1e('0x12')]('/',auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x13')]);router[_0x8b1e('0x14')]('/:id',auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x15')]);router[_0x8b1e('0x16')](_0x8b1e('0x17'),auth[_0x8b1e('0xd')](),controller[_0x8b1e('0x18')]);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 76623f1..9adfdbe 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 _0xb96d=['../../config/environment','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','startedAt','subtract','closedAt','setDataValue','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','path'];(function(_0x2dfe6c,_0x2ad948){var _0x3a58a0=function(_0xe79dd0){while(--_0xe79dd0){_0x2dfe6c['push'](_0x2dfe6c['shift']());}};_0x3a58a0(++_0x2ad948);}(_0xb96d,0x9e));var _0xdb96=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0xb96d[_0x9a3e0f];return _0x3d2a9a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdb96('0x0'));var path=require(_0xdb96('0x1'));var config=require(_0xdb96('0x2'));module['exports']={'format':{'type':Sequelize[_0xdb96('0x3')],'get':function(){return this[_0xdb96('0x4')](_0xdb96('0x5'))?path['extname'](this['getDataValue'](_0xdb96('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xdb96('0x6')]},'channel':{'type':Sequelize[_0xdb96('0x6')]},'value':{'type':Sequelize[_0xdb96('0x6')],'set':function(_0x4f5e6f){var _0x294084=_0x4f5e6f[_0xdb96('0x7')](/\\/g,'/');this['setDataValue'](_0xdb96('0x5'),_0x294084);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdb96('0x8')],'set':function(_0xaea492){this['setDataValue'](_0xdb96('0x9'),moment()[_0xdb96('0xa')](_0xaea492,'ms'));this['setDataValue'](_0xdb96('0xb'),moment());this[_0xdb96('0xc')](_0xdb96('0xd'),_0xaea492);}},'startedAt':{'type':Sequelize[_0xdb96('0xe')],'get':function(){return moment(this['getDataValue'](_0xdb96('0x9')))[_0xdb96('0xf')](_0xdb96('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xdb96('0xe')],'get':function(){return moment(this[_0xdb96('0x4')](_0xdb96('0xb')))[_0xdb96('0xf')](_0xdb96('0x10'))[_0xdb96('0x11')]();}},'createdAt':{'type':Sequelize[_0xdb96('0xe')],'get':function(){return moment(this[_0xdb96('0x4')](_0xdb96('0x12')))[_0xdb96('0xf')](_0xdb96('0x10'))[_0xdb96('0x11')]();}},'updatedAt':{'type':Sequelize[_0xdb96('0xe')],'get':function(){return moment(this['getDataValue'](_0xdb96('0x13')))[_0xdb96('0xf')](_0xdb96('0x10'))[_0xdb96('0x11')]();}}}; \ No newline at end of file +var _0x1678=['updatedAt','sequelize','moment','path','../../config/environment','exports','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1678,0x17b));var _0x8167=function(_0x12a529,_0x1cf160){_0x12a529=_0x12a529-0x0;var _0x50c9fb=_0x1678[_0x12a529];return _0x50c9fb;};'use strict';var Sequelize=require(_0x8167('0x0'));var moment=require(_0x8167('0x1'));var path=require(_0x8167('0x2'));var config=require(_0x8167('0x3'));module[_0x8167('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x8167('0x5'))?path[_0x8167('0x6')](this[_0x8167('0x7')](_0x8167('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x8167('0x8')]},'channel':{'type':Sequelize[_0x8167('0x8')]},'value':{'type':Sequelize[_0x8167('0x8')],'set':function(_0x4ce075){var _0x34768e=_0x4ce075[_0x8167('0x9')](/\\/g,'/');this[_0x8167('0xa')]('value',_0x34768e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8167('0xb')],'set':function(_0x381a87){this['setDataValue'](_0x8167('0xc'),moment()[_0x8167('0xd')](_0x381a87,'ms'));this[_0x8167('0xa')](_0x8167('0xe'),moment());this[_0x8167('0xa')](_0x8167('0xf'),_0x381a87);}},'startedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x8167('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x8167('0x12')]();}},'closedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this[_0x8167('0x7')](_0x8167('0xe')))[_0x8167('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x8167('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x8167('0x13'))[_0x8167('0x12')]();}},'updatedAt':{'type':Sequelize[_0x8167('0x10')],'get':function(){return moment(this[_0x8167('0x7')](_0x8167('0x14')))[_0x8167('0x11')](_0x8167('0x13'))[_0x8167('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 001845b..3ceaa94 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 _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x19c452,_0x4dbaab){var _0x99698c=function(_0x5aef73){while(--_0x5aef73){_0x19c452['push'](_0x19c452['shift']());}};_0x99698c(++_0x4dbaab);}(_0xabce,0x103));var _0xeabc=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xabce[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file +var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0xb138,0x1dd));var _0x8b13=function(_0x436adc,_0x5c9ae1){_0x436adc=_0x436adc-0x0;var _0x421a87=_0xb138[_0x436adc];return _0x421a87;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index a9f0e38..e0055ba 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 _0x66a6=['rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x372c6f,_0x5d51d6){var _0x572683=function(_0x3b379e){while(--_0x3b379e){_0x372c6f['push'](_0x372c6f['shift']());}};_0x572683(++_0x5d51d6);}(_0x66a6,0x93));var _0x666a=function(_0x3680bd,_0x47acd5){_0x3680bd=_0x3680bd-0x0;var _0x55c431=_0x66a6[_0x3680bd];return _0x55c431;};'use strict';var _=require('lodash');var util=require(_0x666a('0x0'));var logger=require(_0x666a('0x1'))(_0x666a('0x2'));var moment=require(_0x666a('0x3'));var BPromise=require(_0x666a('0x4'));var rp=require(_0x666a('0x5'));var fs=require('fs');var path=require(_0x666a('0x6'));var rimraf=require(_0x666a('0x7'));var config=require('../../config/environment');var attributes=require(_0x666a('0x8'));module[_0x666a('0x9')]=function(_0x5c76e2,_0x5b72b8){return _0x5c76e2[_0x666a('0xa')](_0x666a('0xb'),attributes,{'tableName':_0x666a('0xc'),'paranoid':![],'indexes':[{'name':_0x666a('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3530=['./screenRecording.attributes','exports','define','ScreenRecording','lodash','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x22a6cc,_0x9fdac1){var _0x187a61=function(_0x1db594){while(--_0x1db594){_0x22a6cc['push'](_0x22a6cc['shift']());}};_0x187a61(++_0x9fdac1);}(_0x3530,0x11b));var _0x0353=function(_0x49bf75,_0x4d7f9e){_0x49bf75=_0x49bf75-0x0;var _0x35f13f=_0x3530[_0x49bf75];return _0x35f13f;};'use strict';var _=require(_0x0353('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0353('0x1'));var rp=require(_0x0353('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0353('0x3'));var config=require(_0x0353('0x4'));var attributes=require(_0x0353('0x5'));module[_0x0353('0x6')]=function(_0x20a28d,_0x282876){return _0x20a28d[_0x0353('0x7')](_0x0353('0x8'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 67190e3..e79714d 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 _0x2d0e=['ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../config/utils','rpc','client','then','info','request\x20sent','debug'];(function(_0x266ddc,_0x45aa52){var _0x39c1d7=function(_0x4cd07c){while(--_0x4cd07c){_0x266ddc['push'](_0x266ddc['shift']());}};_0x39c1d7(++_0x45aa52);}(_0x2d0e,0x149));var _0xe2d0=function(_0x239ad3,_0x24ec65){_0x239ad3=_0x239ad3-0x0;var _0x352a38=_0x2d0e[_0x239ad3];return _0x352a38;};'use strict';var _=require(_0xe2d0('0x0'));var util=require('util');var moment=require(_0xe2d0('0x1'));var BPromise=require(_0xe2d0('0x2'));var rs=require(_0xe2d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe2d0('0x4'));var logger=require('../../config/logger')(_0xe2d0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe2d0('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd2149,_0x259972,_0x25ed0a){return new BPromise(function(_0x3ea3bb,_0xcd336b){return client['request'](_0xd2149,_0x25ed0a)[_0xe2d0('0x7')](function(_0x565541){logger[_0xe2d0('0x8')]('ScreenRecording,\x20%s,\x20%s',_0x259972,_0xe2d0('0x9'));logger[_0xe2d0('0xa')](_0xe2d0('0xb'),_0x259972,_0xe2d0('0x9'),JSON['stringify'](_0x565541));if(_0x565541[_0xe2d0('0xc')]){if(_0x565541[_0xe2d0('0xc')][_0xe2d0('0xd')]===0x1f4){logger['error'](_0xe2d0('0xe'),_0x259972,_0x565541[_0xe2d0('0xc')][_0xe2d0('0xf')]);return _0xcd336b(_0x565541[_0xe2d0('0xc')][_0xe2d0('0xf')]);}logger[_0xe2d0('0xc')](_0xe2d0('0xe'),_0x259972,_0x565541[_0xe2d0('0xc')][_0xe2d0('0xf')]);return _0x3ea3bb(_0x565541[_0xe2d0('0xc')]['message']);}else{logger[_0xe2d0('0x8')](_0xe2d0('0xe'),_0x259972,'request\x20sent');_0x3ea3bb(_0x565541[_0xe2d0('0x10')][_0xe2d0('0xf')]);}})['catch'](function(_0x5e4f17){logger[_0xe2d0('0xc')](_0xe2d0('0xe'),_0x259972,_0x5e4f17);_0xcd336b(_0x5e4f17);});});} \ No newline at end of file +var _0x2199=['request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x415dbd,_0x156ec3){var _0x4df080=function(_0x20f28d){while(--_0x20f28d){_0x415dbd['push'](_0x415dbd['shift']());}};_0x4df080(++_0x156ec3);}(_0x2199,0x1d4));var _0x9219=function(_0x1ee0c1,_0x14f839){_0x1ee0c1=_0x1ee0c1-0x0;var _0x5d4fe5=_0x2199[_0x1ee0c1];return _0x5d4fe5;};'use strict';var _=require(_0x9219('0x0'));var util=require(_0x9219('0x1'));var moment=require(_0x9219('0x2'));var BPromise=require('bluebird');var rs=require(_0x9219('0x3'));var fs=require('fs');var Redis=require(_0x9219('0x4'));var db=require(_0x9219('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9219('0x6'))(_0x9219('0x7'));var config=require(_0x9219('0x8'));var jayson=require(_0x9219('0x9'));var client=jayson[_0x9219('0xa')][_0x9219('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ff692,_0x1dea37,_0x280bf5){return new BPromise(function(_0x27e2c8,_0x389c59){return client[_0x9219('0xc')](_0x4ff692,_0x280bf5)[_0x9219('0xd')](function(_0x21712f){logger[_0x9219('0xe')](_0x9219('0xf'),_0x1dea37,_0x9219('0x10'));logger[_0x9219('0x11')](_0x9219('0x12'),_0x1dea37,_0x9219('0x10'),JSON[_0x9219('0x13')](_0x21712f));if(_0x21712f[_0x9219('0x14')]){if(_0x21712f['error'][_0x9219('0x15')]===0x1f4){logger[_0x9219('0x14')](_0x9219('0xf'),_0x1dea37,_0x21712f['error'][_0x9219('0x16')]);return _0x389c59(_0x21712f['error'][_0x9219('0x16')]);}logger[_0x9219('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x1dea37,_0x21712f[_0x9219('0x14')][_0x9219('0x16')]);return _0x27e2c8(_0x21712f[_0x9219('0x14')][_0x9219('0x16')]);}else{logger[_0x9219('0xe')](_0x9219('0xf'),_0x1dea37,_0x9219('0x10'));_0x27e2c8(_0x21712f[_0x9219('0x17')][_0x9219('0x16')]);}})['catch'](function(_0x4c3e90){logger[_0x9219('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x1dea37,_0x4c3e90);_0x389c59(_0x4c3e90);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3c35003..655068f 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 _0xe530=['update','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','logo','extname','single','file','%s%s','logologin','originalname','post','addLogoLogin','diskStorage','addPreferred','favicon','/:id'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xe530,0x142));var _0x0e53=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xe530[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0x0e53('0x0'));var util=require(_0x0e53('0x1'));var path=require('path');var timeout=require(_0x0e53('0x2'));var express=require('express');var router=express[_0x0e53('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e53('0x4'));var config=require(_0x0e53('0x5'));var controller=require(_0x0e53('0x6'));router[_0x0e53('0x7')]('/',auth[_0x0e53('0x8')](),controller[_0x0e53('0x9')]);router[_0x0e53('0x7')](_0x0e53('0xa'),controller[_0x0e53('0xb')]);router[_0x0e53('0x7')]('/:id',controller[_0x0e53('0xc')]);router[_0x0e53('0x7')](_0x0e53('0xd'),controller[_0x0e53('0xe')]);router[_0x0e53('0x7')](_0x0e53('0xf'),controller[_0x0e53('0x10')]);router[_0x0e53('0x7')](_0x0e53('0x11'),controller[_0x0e53('0x12')]);router[_0x0e53('0x7')]('/:id/preferred',controller['getPreferred']);router[_0x0e53('0x7')](_0x0e53('0x13'),controller[_0x0e53('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a6be3,_0x433acd,_0x59bb05){_0x59bb05(null,path[_0x0e53('0x15')](config[_0x0e53('0x16')],_0x0e53('0x17')));},'filename':function(_0x3d8835,_0x2465fa,_0x5d09eb){_0x5d09eb(null,util[_0x0e53('0x18')]('%s%s',_0x0e53('0x19'),path[_0x0e53('0x1a')](_0x2465fa['originalname'])));}})});router['post'](_0x0e53('0xd'),upload[_0x0e53('0x1b')](_0x0e53('0x1c')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2587c3,_0x490689,_0x16f869){_0x16f869(null,path['join'](config[_0x0e53('0x16')],_0x0e53('0x17')));},'filename':function(_0x468b87,_0x1b7dd5,_0x1aff66){_0x1aff66(null,util[_0x0e53('0x18')](_0x0e53('0x1d'),_0x0e53('0x1e'),path[_0x0e53('0x1a')](_0x1b7dd5[_0x0e53('0x1f')])));}})});router[_0x0e53('0x20')]('/:id/logo_login',upload[_0x0e53('0x1b')](_0x0e53('0x1c')),controller[_0x0e53('0x21')]);var upload=multer({'storage':multer[_0x0e53('0x22')]({'destination':function(_0x3ba768,_0x5d94d9,_0x1fcb51){_0x1fcb51(null,path[_0x0e53('0x15')](config[_0x0e53('0x16')],_0x0e53('0x17')));},'filename':function(_0x44986d,_0x3c8d4d,_0xc0eb8d){_0xc0eb8d(null,util[_0x0e53('0x18')]('%s%s','preferred',path[_0x0e53('0x1a')](_0x3c8d4d[_0x0e53('0x1f')])));}})});router['post']('/:id/preferred',upload[_0x0e53('0x1b')]('file'),controller[_0x0e53('0x23')]);var upload=multer({'storage':multer[_0x0e53('0x22')]({'destination':function(_0x5ea46e,_0x53b5c7,_0x9c1db2){_0x9c1db2(null,path[_0x0e53('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x58eda7,_0x4b5853,_0x530031){_0x530031(null,util[_0x0e53('0x18')]('%s%s',_0x0e53('0x24'),path[_0x0e53('0x1a')](_0x4b5853[_0x0e53('0x1f')])));}})});router[_0x0e53('0x20')](_0x0e53('0x13'),upload[_0x0e53('0x1b')]('file'),controller['addFavicon']);router['put'](_0x0e53('0x25'),auth[_0x0e53('0x8')](),controller[_0x0e53('0x26')]);module[_0x0e53('0x27')]=router; \ No newline at end of file +var _0xfa1b=['logo','extname','originalname','post','single','file','addLogo','root','logologin','preferred','addPreferred','favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','/:id','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfa1b,0x1bd));var _0xbfa1=function(_0x2f470f,_0x132ae8){_0x2f470f=_0x2f470f-0x0;var _0xe996b=_0xfa1b[_0x2f470f];return _0xe996b;};'use strict';var multer=require(_0xbfa1('0x0'));var util=require(_0xbfa1('0x1'));var path=require(_0xbfa1('0x2'));var timeout=require(_0xbfa1('0x3'));var express=require(_0xbfa1('0x4'));var router=express[_0xbfa1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbfa1('0x6'));var interaction=require(_0xbfa1('0x7'));var config=require(_0xbfa1('0x8'));var controller=require(_0xbfa1('0x9'));router[_0xbfa1('0xa')]('/',auth[_0xbfa1('0xb')](),controller['index']);router[_0xbfa1('0xa')](_0xbfa1('0xc'),controller['getDate']);router[_0xbfa1('0xa')](_0xbfa1('0xd'),controller['show']);router[_0xbfa1('0xa')](_0xbfa1('0xe'),controller[_0xbfa1('0xf')]);router[_0xbfa1('0xa')](_0xbfa1('0x10'),controller['getLogoLogin']);router[_0xbfa1('0xa')](_0xbfa1('0x11'),controller[_0xbfa1('0x12')]);router[_0xbfa1('0xa')](_0xbfa1('0x13'),controller[_0xbfa1('0x14')]);router[_0xbfa1('0xa')](_0xbfa1('0x15'),controller[_0xbfa1('0x16')]);var upload=multer({'storage':multer[_0xbfa1('0x17')]({'destination':function(_0x1cc1da,_0x4a08d6,_0x5d3219){_0x5d3219(null,path[_0xbfa1('0x18')](config['root'],_0xbfa1('0x19')));},'filename':function(_0x1a43bd,_0x29ecba,_0x46ef6e){_0x46ef6e(null,util[_0xbfa1('0x1a')](_0xbfa1('0x1b'),_0xbfa1('0x1c'),path[_0xbfa1('0x1d')](_0x29ecba[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')](_0xbfa1('0xe'),upload[_0xbfa1('0x20')](_0xbfa1('0x21')),controller[_0xbfa1('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1040b7,_0x2ed041,_0x4d1fa0){_0x4d1fa0(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x5a0622,_0x5e8847,_0x4e11ed){_0x4e11ed(null,util[_0xbfa1('0x1a')](_0xbfa1('0x1b'),_0xbfa1('0x24'),path['extname'](_0x5e8847[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')](_0xbfa1('0x10'),upload['single'](_0xbfa1('0x21')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c40a9,_0x1ff58a,_0x217cc0){_0x217cc0(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x49991f,_0x17c4e0,_0xfd117){_0xfd117(null,util[_0xbfa1('0x1a')]('%s%s',_0xbfa1('0x25'),path['extname'](_0x17c4e0[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')]('/:id/preferred',upload['single'](_0xbfa1('0x21')),controller[_0xbfa1('0x26')]);var upload=multer({'storage':multer[_0xbfa1('0x17')]({'destination':function(_0x53ab06,_0x2e782d,_0x6f37a2){_0x6f37a2(null,path[_0xbfa1('0x18')](config[_0xbfa1('0x23')],_0xbfa1('0x19')));},'filename':function(_0x30ba87,_0x67cab2,_0x1434b1){_0x1434b1(null,util['format'](_0xbfa1('0x1b'),_0xbfa1('0x27'),path[_0xbfa1('0x1d')](_0x67cab2[_0xbfa1('0x1e')])));}})});router[_0xbfa1('0x1f')]('/:id/favicon',upload[_0xbfa1('0x20')](_0xbfa1('0x21')),controller[_0xbfa1('0x28')]);router['put']('/:id',auth[_0xbfa1('0xb')](),controller[_0xbfa1('0x29')]);module[_0xbfa1('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 e99fda4..a9c1eee 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(_0x4f3c79,_0x5b2b3f){var _0x86bff3=function(_0x3c94f2){while(--_0x3c94f2){_0x4f3c79['push'](_0x4f3c79['shift']());}};_0x86bff3(++_0x5b2b3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x58148e,_0x43ba4a){var _0x7e506c=function(_0x1dec00){while(--_0x1dec00){_0x58148e['push'](_0x58148e['shift']());}};_0x7e506c(++_0x43ba4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 0869886..b6f9cf2 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 _0xf9a6=['code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','name','index','map','Setting','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','keys','rawAttributes','length','include','options','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','upperFirst','gdpr','securePassword','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x404a53,_0x28624e){var _0x30f98c=function(_0x2fa1fa){while(--_0x2fa1fa){_0x404a53['push'](_0x404a53['shift']());}};_0x30f98c(++_0x28624e);}(_0xf9a6,0xd8));var _0x6f9a=function(_0x1b24a8,_0x3f4739){_0x1b24a8=_0x1b24a8-0x0;var _0x1d1404=_0xf9a6[_0x1b24a8];return _0x1d1404;};'use strict';var emlformat=require(_0x6f9a('0x0'));var rimraf=require(_0x6f9a('0x1'));var zipdir=require(_0x6f9a('0x2'));var jsonpatch=require(_0x6f9a('0x3'));var rp=require(_0x6f9a('0x4'));var moment=require('moment');var BPromise=require(_0x6f9a('0x5'));var Mustache=require(_0x6f9a('0x6'));var util=require('util');var path=require(_0x6f9a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6f9a('0x8'));var fs=require('fs');var fs_extra=require(_0x6f9a('0x9'));var _=require(_0x6f9a('0xa'));var squel=require(_0x6f9a('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f9a('0xc'));var deskjs=require(_0x6f9a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f9a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6f9a('0xf'));var as=require(_0x6f9a('0x10'));var hardwareService=require(_0x6f9a('0x11'));var logger=require(_0x6f9a('0x12'))(_0x6f9a('0x13'));var utils=require('../../config/utils');var config=require(_0x6f9a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f9a('0x15'))['db'];var jayson=require(_0x6f9a('0x16'));var client=jayson[_0x6f9a('0x17')][_0x6f9a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4d98d7,_0x109ff5,_0x286cde,_0x13295a){return new BPromise(function(_0xc6ee81,_0x377646){var _0x4d811f=_0x13295a||client;return _0x4d811f[_0x6f9a('0x19')](_0x4d98d7,_0x286cde)[_0x6f9a('0x1a')](function(_0x1bf480){logger[_0x6f9a('0x1b')](_0x6f9a('0x1c'),_0x109ff5,_0x6f9a('0x1d'));logger[_0x6f9a('0x1e')](_0x6f9a('0x1f'),_0x109ff5,_0x6f9a('0x1d'),JSON[_0x6f9a('0x20')](_0x1bf480));if(_0x1bf480[_0x6f9a('0x21')]){if(_0x1bf480['error'][_0x6f9a('0x22')]===0x1f4){logger[_0x6f9a('0x21')]('Setting,\x20%s,\x20%s',_0x109ff5,_0x1bf480['error'][_0x6f9a('0x23')]);return _0x377646(_0x1bf480[_0x6f9a('0x21')][_0x6f9a('0x23')]);}logger[_0x6f9a('0x21')](_0x6f9a('0x1c'),_0x109ff5,_0x1bf480[_0x6f9a('0x21')]['message']);return _0xc6ee81(_0x1bf480[_0x6f9a('0x21')][_0x6f9a('0x23')]);}else{logger['info'](_0x6f9a('0x1c'),_0x109ff5,_0x6f9a('0x1d'));_0xc6ee81(_0x1bf480['result']['message']);}})[_0x6f9a('0x24')](function(_0x3687fd){logger[_0x6f9a('0x21')](_0x6f9a('0x1c'),_0x109ff5,_0x3687fd);_0x377646(_0x3687fd);});});}function respondWithStatusCode(_0x264fcb,_0x3e9363){_0x3e9363=_0x3e9363||0xcc;return function(_0x40a075){if(_0x40a075){return _0x264fcb[_0x6f9a('0x25')](_0x3e9363);}return _0x264fcb[_0x6f9a('0x26')](_0x3e9363)[_0x6f9a('0x27')]();};}function respondWithResult(_0x6ca0aa,_0x22aa95){_0x22aa95=_0x22aa95||0xc8;return function(_0x60e863){if(_0x60e863){return _0x6ca0aa[_0x6f9a('0x26')](_0x22aa95)[_0x6f9a('0x28')](_0x60e863);}};}function respondWithFilteredResult(_0x452cc2,_0x1cfcc0){return function(_0x568ef6){if(_0x568ef6){var _0x47f7b3=typeof _0x1cfcc0[_0x6f9a('0x29')]===_0x6f9a('0x2a')&&typeof _0x1cfcc0[_0x6f9a('0x2b')]==='undefined';var _0x4e91de=_0x568ef6[_0x6f9a('0x2c')];var _0x579a36=_0x47f7b3?0x0:_0x1cfcc0[_0x6f9a('0x29')];var _0x169f7a=_0x47f7b3?_0x568ef6[_0x6f9a('0x2c')]:_0x1cfcc0[_0x6f9a('0x29')]+_0x1cfcc0['limit'];var _0x5758c4;if(_0x169f7a>=_0x4e91de){_0x169f7a=_0x4e91de;_0x5758c4=0xc8;}else{_0x5758c4=0xce;}_0x452cc2['status'](_0x5758c4);return _0x452cc2['set'](_0x6f9a('0x2d'),_0x579a36+'-'+_0x169f7a+'/'+_0x4e91de)['json'](_0x568ef6);}return null;};}function patchUpdates(_0x171587){return function(_0x41cb42){try{jsonpatch[_0x6f9a('0x2e')](_0x41cb42,_0x171587,!![]);}catch(_0x4f179a){return BPromise[_0x6f9a('0x2f')](_0x4f179a);}return _0x41cb42['save']();};}function saveUpdates(_0x813ff0,_0x585c19){return function(_0x578dd5){if(_0x578dd5){return _0x578dd5[_0x6f9a('0x30')](_0x813ff0)['then'](function(_0x384cab){return _0x384cab;});}return null;};}function removeEntity(_0x1c4ae4,_0x3199d1){return function(_0x506453){if(_0x506453){return _0x506453[_0x6f9a('0x31')]()['then'](function(){_0x1c4ae4[_0x6f9a('0x26')](0xcc)[_0x6f9a('0x27')]();});}};}function handleEntityNotFound(_0x1c2115,_0x38ce6d){return function(_0x3002b8){if(!_0x3002b8){_0x1c2115['sendStatus'](0x194);}return _0x3002b8;};}function handleError(_0x3a695f,_0x133157){_0x133157=_0x133157||0x1f4;return function(_0x3abe21){logger[_0x6f9a('0x21')](_0x3abe21[_0x6f9a('0x32')]);if(_0x3abe21[_0x6f9a('0x33')]){delete _0x3abe21['name'];}_0x3a695f['status'](_0x133157)['send'](_0x3abe21);};}exports[_0x6f9a('0x34')]=function(_0x4b552d,_0x7c637c){var _0x407b1f={},_0x3c2eee={},_0x4862ec={'count':0x0,'rows':[]};var _0x83682f=_[_0x6f9a('0x35')](db[_0x6f9a('0x36')]['rawAttributes'],function(_0x50d731){return{'name':_0x50d731[_0x6f9a('0x37')],'type':_0x50d731[_0x6f9a('0x38')][_0x6f9a('0x39')]};});_0x3c2eee[_0x6f9a('0x3a')]=_[_0x6f9a('0x35')](_0x83682f,_0x6f9a('0x33'));_0x3c2eee[_0x6f9a('0x3b')]=_['keys'](_0x4b552d[_0x6f9a('0x3b')]);_0x3c2eee[_0x6f9a('0x3c')]=_['intersection'](_0x3c2eee['model'],_0x3c2eee[_0x6f9a('0x3b')]);_0x407b1f['attributes']=_[_0x6f9a('0x3d')](_0x3c2eee[_0x6f9a('0x3a')],qs[_0x6f9a('0x3e')](_0x4b552d[_0x6f9a('0x3b')][_0x6f9a('0x3e')]));_0x407b1f[_0x6f9a('0x3f')]=_0x407b1f[_0x6f9a('0x3f')]['length']?_0x407b1f[_0x6f9a('0x3f')]:_0x3c2eee[_0x6f9a('0x3a')];if(!_0x4b552d[_0x6f9a('0x3b')][_0x6f9a('0x40')](_0x6f9a('0x41'))){_0x407b1f[_0x6f9a('0x2b')]=qs['limit'](_0x4b552d[_0x6f9a('0x3b')][_0x6f9a('0x2b')]);_0x407b1f['offset']=qs[_0x6f9a('0x29')](_0x4b552d[_0x6f9a('0x3b')][_0x6f9a('0x29')]);}_0x407b1f[_0x6f9a('0x42')]=qs[_0x6f9a('0x43')](_0x4b552d[_0x6f9a('0x3b')]['sort']);_0x407b1f[_0x6f9a('0x44')]=qs['filters'](_[_0x6f9a('0x45')](_0x4b552d[_0x6f9a('0x3b')],_0x3c2eee[_0x6f9a('0x3c')]),_0x83682f);if(_0x4b552d[_0x6f9a('0x3b')][_0x6f9a('0x46')]){_0x407b1f[_0x6f9a('0x44')]=_[_0x6f9a('0x47')](_0x407b1f[_0x6f9a('0x44')],{'$or':_['map'](_0x83682f,function(_0x388d3a){if(_0x388d3a['type']!==_0x6f9a('0x48')){var _0x2fee1c={};_0x2fee1c[_0x388d3a[_0x6f9a('0x33')]]={'$like':'%'+_0x4b552d['query']['filter']+'%'};return _0x2fee1c;}})});}_0x407b1f=_[_0x6f9a('0x47')]({},_0x407b1f,_0x4b552d['options']);var _0x588da9={'where':_0x407b1f['where']};return db['Setting']['count'](_0x588da9)[_0x6f9a('0x1a')](function(_0x4e01f0){_0x4862ec[_0x6f9a('0x2c')]=_0x4e01f0;if(_0x4b552d[_0x6f9a('0x3b')][_0x6f9a('0x49')]){_0x407b1f['include']=[{'all':!![]}];}return db['Setting'][_0x6f9a('0x4a')](_0x407b1f);})[_0x6f9a('0x1a')](function(_0x73f6d5){_0x4862ec[_0x6f9a('0x4b')]=_0x73f6d5;return _0x4862ec;})['then'](respondWithFilteredResult(_0x7c637c,_0x407b1f))[_0x6f9a('0x24')](handleError(_0x7c637c,null));};exports['show']=function(_0x7aa81e,_0x3e6e5c){var _0x1c5c34={'raw':![],'where':{'id':_0x7aa81e[_0x6f9a('0x4c')]['id']}},_0x5ae309={};_0x5ae309[_0x6f9a('0x3a')]=_[_0x6f9a('0x4d')](db[_0x6f9a('0x36')][_0x6f9a('0x4e')]);_0x5ae309[_0x6f9a('0x3b')]=_['keys'](_0x7aa81e[_0x6f9a('0x3b')]);_0x5ae309['filters']=_['intersection'](_0x5ae309[_0x6f9a('0x3a')],_0x5ae309['query']);_0x1c5c34[_0x6f9a('0x3f')]=_['intersection'](_0x5ae309[_0x6f9a('0x3a')],qs[_0x6f9a('0x3e')](_0x7aa81e[_0x6f9a('0x3b')][_0x6f9a('0x3e')]));_0x1c5c34[_0x6f9a('0x3f')]=_0x1c5c34[_0x6f9a('0x3f')][_0x6f9a('0x4f')]?_0x1c5c34[_0x6f9a('0x3f')]:_0x5ae309['model'];if(_0x7aa81e[_0x6f9a('0x3b')][_0x6f9a('0x49')]){_0x1c5c34[_0x6f9a('0x50')]=[{'all':!![]}];}_0x1c5c34=_[_0x6f9a('0x47')]({},_0x1c5c34,_0x7aa81e[_0x6f9a('0x51')]);return db[_0x6f9a('0x36')][_0x6f9a('0x52')](_0x1c5c34)['then'](handleEntityNotFound(_0x3e6e5c,null))[_0x6f9a('0x1a')](respondWithResult(_0x3e6e5c,null))[_0x6f9a('0x24')](handleError(_0x3e6e5c,null));};exports['update']=function(_0x37fd1a,_0x47e122){if(_0x37fd1a[_0x6f9a('0x53')]['id']){delete _0x37fd1a[_0x6f9a('0x53')]['id'];}return db[_0x6f9a('0x36')]['find']({'where':{'id':_0x37fd1a[_0x6f9a('0x4c')]['id']}})[_0x6f9a('0x1a')](handleEntityNotFound(_0x47e122,null))[_0x6f9a('0x1a')](saveUpdates(_0x37fd1a[_0x6f9a('0x53')],null))[_0x6f9a('0x1a')](respondWithResult(_0x47e122,null))[_0x6f9a('0x24')](handleError(_0x47e122,null));};exports[_0x6f9a('0x54')]=function(_0x1605ef,_0x9ca14e,_0x578ea4){if(_0x1605ef[_0x6f9a('0x55')]&&_0x1605ef['file'][_0x6f9a('0x56')]){_0x1605ef[_0x6f9a('0x53')][_0x6f9a('0x57')]=_0x1605ef[_0x6f9a('0x55')]['filename'];}return db[_0x6f9a('0x36')]['find']({'where':{'id':_0x1605ef[_0x6f9a('0x4c')]['id']}})[_0x6f9a('0x1a')](handleEntityNotFound(_0x9ca14e,null))[_0x6f9a('0x1a')](saveUpdates(_0x1605ef[_0x6f9a('0x53')],null))[_0x6f9a('0x1a')](respondWithResult(_0x9ca14e,null))[_0x6f9a('0x24')](handleError(_0x9ca14e,null));};exports[_0x6f9a('0x58')]=function(_0x3b44cf,_0x4d3784,_0x3fbd18){if(_0x3b44cf[_0x6f9a('0x55')]&&_0x3b44cf[_0x6f9a('0x55')][_0x6f9a('0x56')]){_0x3b44cf[_0x6f9a('0x53')][_0x6f9a('0x59')]=_0x3b44cf[_0x6f9a('0x55')]['filename'];}return db[_0x6f9a('0x36')][_0x6f9a('0x52')]({'where':{'id':_0x3b44cf[_0x6f9a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d3784,null))['then'](saveUpdates(_0x3b44cf[_0x6f9a('0x53')],null))['then'](respondWithResult(_0x4d3784,null))[_0x6f9a('0x24')](handleError(_0x4d3784,null));};var utilLicense=require(_0x6f9a('0x5a'));exports['getLogo']=function(_0x2b1c22,_0x33c3f0,_0x171c2f){var _0xa57da3=_0x6f9a('0x5b');var _0x1ca292={'custom':![]};return utilLicense[_0x6f9a('0x5c')]()[_0x6f9a('0x1a')](function(_0x3d7a0d){if(_0x3d7a0d){_0x1ca292=_0x3d7a0d;}return db[_0x6f9a('0x36')][_0x6f9a('0x52')]({'where':{'id':_0x2b1c22[_0x6f9a('0x4c')]['id']},'attributes':['logo',_0x6f9a('0x59'),_0x6f9a('0x5d'),_0x6f9a('0x5e'),_0x6f9a('0x5f'),_0x6f9a('0x60'),_0x6f9a('0x61'),_0x6f9a('0x62')],'raw':!![]});})[_0x6f9a('0x1a')](handleEntityNotFound(_0x33c3f0,null))[_0x6f9a('0x1a')](function(_0x125929){if(_0x125929){var _0xa84a9b=_0x125929[_0x6f9a('0x57')]&&fs[_0x6f9a('0x63')](path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xa57da3,_['toLower'](_0x125929['logo'])))?path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xa57da3,_[_0x6f9a('0x66')](_0x125929[_0x6f9a('0x57')])):path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xa57da3,_[_0x6f9a('0x66')](_0x6f9a('0x67')));var _0x20ef7f=_0x6f9a('0x68')+_['upperFirst']('logo');if(_0x125929[_0x20ef7f]||!_0x1ca292[_0x6f9a('0x69')]){_0xa84a9b=path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xa57da3,_[_0x6f9a('0x66')]('default_logo.svg'));}if(!fs[_0x6f9a('0x63')](_0xa84a9b)){throw new db[(_0x6f9a('0x6a'))][(_0x6f9a('0x6b'))](_['upperFirst'](_0x6f9a('0x57'))+_0x6f9a('0x6c'));}return _0x33c3f0[_0x6f9a('0x6d')](_0xa84a9b);}})[_0x6f9a('0x24')](handleError(_0x33c3f0,null));};var utilLicense=require(_0x6f9a('0x5a'));exports[_0x6f9a('0x6e')]=function(_0x3586d4,_0x5eeff8,_0x5649d5){var _0x1c9fc3=_0x6f9a('0x5b');var _0x5ae2f6={'custom':![]};return utilLicense['getLicense']()[_0x6f9a('0x1a')](function(_0xfa28f0){if(_0xfa28f0){_0x5ae2f6=_0xfa28f0;}return db[_0x6f9a('0x36')][_0x6f9a('0x52')]({'where':{'id':_0x3586d4[_0x6f9a('0x4c')]['id']},'attributes':[_0x6f9a('0x57'),_0x6f9a('0x59'),_0x6f9a('0x5d'),_0x6f9a('0x5e'),_0x6f9a('0x5f'),'defaultLoginLogo',_0x6f9a('0x61'),_0x6f9a('0x62')],'raw':!![]});})[_0x6f9a('0x1a')](handleEntityNotFound(_0x5eeff8,null))['then'](function(_0x2dece4){if(_0x2dece4){var _0x5ccd5d=_0x2dece4[_0x6f9a('0x59')]&&fs[_0x6f9a('0x63')](path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0x1c9fc3,_[_0x6f9a('0x66')](_0x2dece4[_0x6f9a('0x59')])))?path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0x1c9fc3,_['toLower'](_0x2dece4[_0x6f9a('0x59')])):path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0x1c9fc3,_[_0x6f9a('0x66')](_0x6f9a('0x6f')));var _0x52b1c0=_0x6f9a('0x68')+_[_0x6f9a('0x70')](_0x6f9a('0x59'));if(_0x2dece4[_0x52b1c0]||!_0x5ae2f6[_0x6f9a('0x69')]){_0x5ccd5d=path[_0x6f9a('0x64')](config['root'],_0x1c9fc3,_[_0x6f9a('0x66')](_0x6f9a('0x6f')));}if(!fs[_0x6f9a('0x63')](_0x5ccd5d)){throw new db[(_0x6f9a('0x6a'))][(_0x6f9a('0x6b'))](_['upperFirst'](_0x6f9a('0x59'))+'\x20not\x20found');}return _0x5eeff8['download'](_0x5ccd5d);}})[_0x6f9a('0x24')](handleError(_0x5eeff8,null));};exports[_0x6f9a('0x71')]=function(_0x3ae946,_0x4c0a00){return db['Setting']['find']({'where':{'id':_0x3ae946['params']['id']},'attributes':[_0x6f9a('0x72')]})[_0x6f9a('0x1a')](respondWithResult(_0x4c0a00,null))[_0x6f9a('0x24')](handleError(_0x4c0a00,null));};exports['addPreferred']=function(_0x173b6a,_0x51475a,_0x5a507c){if(_0x173b6a[_0x6f9a('0x55')]&&_0x173b6a[_0x6f9a('0x55')]['filename']){_0x173b6a['body'][_0x6f9a('0x5d')]=_0x173b6a['file'][_0x6f9a('0x56')];}return db['Setting'][_0x6f9a('0x52')]({'where':{'id':_0x173b6a[_0x6f9a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51475a,null))[_0x6f9a('0x1a')](saveUpdates(_0x173b6a['body'],null))[_0x6f9a('0x1a')](respondWithResult(_0x51475a,null))[_0x6f9a('0x24')](handleError(_0x51475a,null));};var utilLicense=require(_0x6f9a('0x5a'));exports['getPreferred']=function(_0x18d5c1,_0x487bda,_0x11da7b){var _0x72cc98=_0x6f9a('0x5b');var _0x17a64c={'custom':![]};return utilLicense[_0x6f9a('0x5c')]()[_0x6f9a('0x1a')](function(_0x54d88f){if(_0x54d88f){_0x17a64c=_0x54d88f;}return db['Setting'][_0x6f9a('0x52')]({'where':{'id':_0x18d5c1[_0x6f9a('0x4c')]['id']},'attributes':['logo',_0x6f9a('0x59'),'preferred',_0x6f9a('0x5e'),_0x6f9a('0x5f'),_0x6f9a('0x60'),_0x6f9a('0x61'),_0x6f9a('0x62')],'raw':!![]});})[_0x6f9a('0x1a')](handleEntityNotFound(_0x487bda,null))[_0x6f9a('0x1a')](function(_0x1715c6){if(_0x1715c6){var _0x471da0=_0x1715c6[_0x6f9a('0x5d')]&&fs[_0x6f9a('0x63')](path['join'](config['root'],_0x72cc98,_[_0x6f9a('0x66')](_0x1715c6[_0x6f9a('0x5d')])))?path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0x72cc98,_[_0x6f9a('0x66')](_0x1715c6['preferred'])):path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0x72cc98,_['toLower'](_0x6f9a('0x73')));var _0x959f17=_0x6f9a('0x68')+_[_0x6f9a('0x70')](_0x6f9a('0x5d'));if(_0x1715c6[_0x959f17]||!_0x17a64c[_0x6f9a('0x69')]||!_0x17a64c[_0x6f9a('0x5d')]){_0x471da0=path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0x72cc98,_[_0x6f9a('0x66')](_0x6f9a('0x73')));}if(!fs['existsSync'](_0x471da0)){throw new db[(_0x6f9a('0x6a'))][(_0x6f9a('0x6b'))](_[_0x6f9a('0x70')]('preferred')+_0x6f9a('0x6c'));}return _0x487bda[_0x6f9a('0x6d')](_0x471da0);}})['catch'](handleError(_0x487bda,null));};exports[_0x6f9a('0x74')]=function(_0xc60dfd,_0x4f034e,_0x5ef4d7){if(_0xc60dfd[_0x6f9a('0x55')]&&_0xc60dfd['file'][_0x6f9a('0x56')]){_0xc60dfd[_0x6f9a('0x53')][_0x6f9a('0x5e')]=_0xc60dfd[_0x6f9a('0x55')]['filename'];}return db[_0x6f9a('0x36')][_0x6f9a('0x52')]({'where':{'id':_0xc60dfd[_0x6f9a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4f034e,null))[_0x6f9a('0x1a')](saveUpdates(_0xc60dfd[_0x6f9a('0x53')],null))[_0x6f9a('0x1a')](respondWithResult(_0x4f034e,null))[_0x6f9a('0x24')](handleError(_0x4f034e,null));};var utilLicense=require('../../config/license/util');exports[_0x6f9a('0x75')]=function(_0x335c6b,_0x298134,_0x50f91a){var _0xc82ce2='server/files/images/logos';var _0x2d77a6={'custom':![]};return utilLicense[_0x6f9a('0x5c')]()['then'](function(_0x262781){if(_0x262781){_0x2d77a6=_0x262781;}return db[_0x6f9a('0x36')]['find']({'where':{'id':_0x335c6b[_0x6f9a('0x4c')]['id']},'attributes':[_0x6f9a('0x57'),_0x6f9a('0x59'),_0x6f9a('0x5d'),_0x6f9a('0x5e'),_0x6f9a('0x5f'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x6f9a('0x1a')](handleEntityNotFound(_0x298134,null))[_0x6f9a('0x1a')](function(_0x302b70){if(_0x302b70){var _0x5c916e=_0x302b70[_0x6f9a('0x5e')]&&fs['existsSync'](path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xc82ce2,_[_0x6f9a('0x66')](_0x302b70['favicon'])))?path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xc82ce2,_['toLower'](_0x302b70['favicon'])):path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xc82ce2,_[_0x6f9a('0x66')](_0x6f9a('0x76')));var _0x3584c8='default'+_[_0x6f9a('0x70')](_0x6f9a('0x5e'));if(_0x302b70[_0x3584c8]||!_0x2d77a6['custom']){_0x5c916e=path[_0x6f9a('0x64')](config[_0x6f9a('0x65')],_0xc82ce2,_[_0x6f9a('0x66')](_0x6f9a('0x76')));}if(!fs[_0x6f9a('0x63')](_0x5c916e)){throw new db['Sequelize'][(_0x6f9a('0x6b'))](_[_0x6f9a('0x70')]('favicon')+_0x6f9a('0x6c'));}return _0x298134[_0x6f9a('0x6d')](_0x5c916e);}})['catch'](handleError(_0x298134,null));};exports[_0x6f9a('0x77')]=function(_0x5f415d,_0x1e2baf){var _0x2fa4d9={'offset':moment()['utcOffset']()};_0x2fa4d9[_0x6f9a('0x78')]=moment()[_0x6f9a('0x79')](_0x2fa4d9['offset'])[_0x6f9a('0x7a')](_0x6f9a('0x7b'));return _0x1e2baf['status'](0xc8)[_0x6f9a('0x7c')](_0x2fa4d9);}; \ No newline at end of file +var _0xc4f5=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','destroy','stack','name','send','index','map','Setting','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','download','favicon','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','getPreferred','custom','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5d13ca,_0x3c66ee){var _0x5b8742=function(_0x406807){while(--_0x406807){_0x5d13ca['push'](_0x5d13ca['shift']());}};_0x5b8742(++_0x3c66ee);}(_0xc4f5,0x75));var _0x5c4f=function(_0x21c8a9,_0x5687f4){_0x21c8a9=_0x21c8a9-0x0;var _0x1f8a72=_0xc4f5[_0x21c8a9];return _0x1f8a72;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c4f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c4f('0x1'));var moment=require(_0x5c4f('0x2'));var BPromise=require(_0x5c4f('0x3'));var Mustache=require(_0x5c4f('0x4'));var util=require(_0x5c4f('0x5'));var path=require(_0x5c4f('0x6'));var sox=require(_0x5c4f('0x7'));var csv=require(_0x5c4f('0x8'));var ejs=require(_0x5c4f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c4f('0xa'));var squel=require(_0x5c4f('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c4f('0xc'));var deskjs=require(_0x5c4f('0xd'));var toCsv=require(_0x5c4f('0x8'));var querystring=require(_0x5c4f('0xe'));var Papa=require('papaparse');var Redis=require(_0x5c4f('0xf'));var authService=require(_0x5c4f('0x10'));var qs=require(_0x5c4f('0x11'));var as=require(_0x5c4f('0x12'));var hardwareService=require(_0x5c4f('0x13'));var logger=require(_0x5c4f('0x14'))(_0x5c4f('0x15'));var utils=require(_0x5c4f('0x16'));var config=require(_0x5c4f('0x17'));var licenseUtil=require(_0x5c4f('0x18'));var db=require(_0x5c4f('0x19'))['db'];var jayson=require(_0x5c4f('0x1a'));var client=jayson[_0x5c4f('0x1b')][_0x5c4f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x56c291,_0x2ad84b,_0x15c8f4,_0x3a5850){return new BPromise(function(_0x2bf021,_0x3a3842){var _0x2dc021=_0x3a5850||client;return _0x2dc021[_0x5c4f('0x1d')](_0x56c291,_0x15c8f4)[_0x5c4f('0x1e')](function(_0x555d4e){logger[_0x5c4f('0x1f')](_0x5c4f('0x20'),_0x2ad84b,'request\x20sent');logger[_0x5c4f('0x21')](_0x5c4f('0x22'),_0x2ad84b,'request\x20sent',JSON['stringify'](_0x555d4e));if(_0x555d4e['error']){if(_0x555d4e[_0x5c4f('0x23')][_0x5c4f('0x24')]===0x1f4){logger[_0x5c4f('0x23')](_0x5c4f('0x20'),_0x2ad84b,_0x555d4e[_0x5c4f('0x23')][_0x5c4f('0x25')]);return _0x3a3842(_0x555d4e['error']['message']);}logger[_0x5c4f('0x23')](_0x5c4f('0x20'),_0x2ad84b,_0x555d4e['error'][_0x5c4f('0x25')]);return _0x2bf021(_0x555d4e[_0x5c4f('0x23')][_0x5c4f('0x25')]);}else{logger[_0x5c4f('0x1f')]('Setting,\x20%s,\x20%s',_0x2ad84b,'request\x20sent');_0x2bf021(_0x555d4e[_0x5c4f('0x26')]['message']);}})[_0x5c4f('0x27')](function(_0x532cb2){logger[_0x5c4f('0x23')]('Setting,\x20%s,\x20%s',_0x2ad84b,_0x532cb2);_0x3a3842(_0x532cb2);});});}function respondWithStatusCode(_0x1fd735,_0x111e55){_0x111e55=_0x111e55||0xcc;return function(_0x5c439a){if(_0x5c439a){return _0x1fd735[_0x5c4f('0x28')](_0x111e55);}return _0x1fd735[_0x5c4f('0x29')](_0x111e55)[_0x5c4f('0x2a')]();};}function respondWithResult(_0x1bd9c8,_0x49b740){_0x49b740=_0x49b740||0xc8;return function(_0x1290fe){if(_0x1290fe){return _0x1bd9c8[_0x5c4f('0x29')](_0x49b740)[_0x5c4f('0x2b')](_0x1290fe);}};}function respondWithFilteredResult(_0x3745c5,_0x3cefd8){return function(_0x55e25e){if(_0x55e25e){var _0x23b606=typeof _0x3cefd8[_0x5c4f('0x2c')]===_0x5c4f('0x2d')&&typeof _0x3cefd8['limit']===_0x5c4f('0x2d');var _0x3e26ad=_0x55e25e[_0x5c4f('0x2e')];var _0x5cb872=_0x23b606?0x0:_0x3cefd8[_0x5c4f('0x2c')];var _0x577f7c=_0x23b606?_0x55e25e[_0x5c4f('0x2e')]:_0x3cefd8[_0x5c4f('0x2c')]+_0x3cefd8[_0x5c4f('0x2f')];var _0x34fe39;if(_0x577f7c>=_0x3e26ad){_0x577f7c=_0x3e26ad;_0x34fe39=0xc8;}else{_0x34fe39=0xce;}_0x3745c5['status'](_0x34fe39);return _0x3745c5[_0x5c4f('0x30')]('Content-Range',_0x5cb872+'-'+_0x577f7c+'/'+_0x3e26ad)['json'](_0x55e25e);}return null;};}function patchUpdates(_0x3d6511){return function(_0x1924f7){try{jsonpatch[_0x5c4f('0x31')](_0x1924f7,_0x3d6511,!![]);}catch(_0x2d6a19){return BPromise['reject'](_0x2d6a19);}return _0x1924f7['save']();};}function saveUpdates(_0x330c5c,_0x547da3){return function(_0x36a176){if(_0x36a176){return _0x36a176[_0x5c4f('0x32')](_0x330c5c)[_0x5c4f('0x1e')](function(_0x1fea2b){return _0x1fea2b;});}return null;};}function removeEntity(_0x87f79e,_0x49688a){return function(_0x1b4636){if(_0x1b4636){return _0x1b4636[_0x5c4f('0x33')]()['then'](function(){_0x87f79e[_0x5c4f('0x29')](0xcc)[_0x5c4f('0x2a')]();});}};}function handleEntityNotFound(_0x586625,_0x50ab00){return function(_0x181b62){if(!_0x181b62){_0x586625[_0x5c4f('0x28')](0x194);}return _0x181b62;};}function handleError(_0x3c788f,_0x2f2d5c){_0x2f2d5c=_0x2f2d5c||0x1f4;return function(_0x3715d8){logger[_0x5c4f('0x23')](_0x3715d8[_0x5c4f('0x34')]);if(_0x3715d8['name']){delete _0x3715d8[_0x5c4f('0x35')];}_0x3c788f[_0x5c4f('0x29')](_0x2f2d5c)[_0x5c4f('0x36')](_0x3715d8);};}exports[_0x5c4f('0x37')]=function(_0x2ee874,_0x287ec7){var _0x51b019={},_0xde6b57={},_0x14efd8={'count':0x0,'rows':[]};var _0x418db8=_[_0x5c4f('0x38')](db[_0x5c4f('0x39')]['rawAttributes'],function(_0xd0a9b5){return{'name':_0xd0a9b5['fieldName'],'type':_0xd0a9b5[_0x5c4f('0x3a')][_0x5c4f('0x3b')]};});_0xde6b57['model']=_[_0x5c4f('0x38')](_0x418db8,_0x5c4f('0x35'));_0xde6b57['query']=_['keys'](_0x2ee874[_0x5c4f('0x3c')]);_0xde6b57[_0x5c4f('0x3d')]=_['intersection'](_0xde6b57[_0x5c4f('0x3e')],_0xde6b57[_0x5c4f('0x3c')]);_0x51b019[_0x5c4f('0x3f')]=_[_0x5c4f('0x40')](_0xde6b57[_0x5c4f('0x3e')],qs['fields'](_0x2ee874['query'][_0x5c4f('0x41')]));_0x51b019[_0x5c4f('0x3f')]=_0x51b019[_0x5c4f('0x3f')][_0x5c4f('0x42')]?_0x51b019[_0x5c4f('0x3f')]:_0xde6b57['model'];if(!_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x43')](_0x5c4f('0x44'))){_0x51b019[_0x5c4f('0x2f')]=qs[_0x5c4f('0x2f')](_0x2ee874['query']['limit']);_0x51b019[_0x5c4f('0x2c')]=qs['offset'](_0x2ee874[_0x5c4f('0x3c')]['offset']);}_0x51b019['order']=qs[_0x5c4f('0x45')](_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x45')]);_0x51b019[_0x5c4f('0x46')]=qs[_0x5c4f('0x3d')](_[_0x5c4f('0x47')](_0x2ee874['query'],_0xde6b57[_0x5c4f('0x3d')]),_0x418db8);if(_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x48')]){_0x51b019[_0x5c4f('0x46')]=_[_0x5c4f('0x49')](_0x51b019['where'],{'$or':_[_0x5c4f('0x38')](_0x418db8,function(_0x5a5d52){if(_0x5a5d52[_0x5c4f('0x3a')]!=='VIRTUAL'){var _0x10bdc3={};_0x10bdc3[_0x5a5d52[_0x5c4f('0x35')]]={'$like':'%'+_0x2ee874['query'][_0x5c4f('0x48')]+'%'};return _0x10bdc3;}})});}_0x51b019=_['merge']({},_0x51b019,_0x2ee874[_0x5c4f('0x4a')]);var _0x3a021a={'where':_0x51b019[_0x5c4f('0x46')]};return db[_0x5c4f('0x39')]['count'](_0x3a021a)[_0x5c4f('0x1e')](function(_0x4a0d11){_0x14efd8['count']=_0x4a0d11;if(_0x2ee874[_0x5c4f('0x3c')][_0x5c4f('0x4b')]){_0x51b019['include']=[{'all':!![]}];}return db[_0x5c4f('0x39')][_0x5c4f('0x4c')](_0x51b019);})['then'](function(_0x5bb42e){_0x14efd8[_0x5c4f('0x4d')]=_0x5bb42e;return _0x14efd8;})[_0x5c4f('0x1e')](respondWithFilteredResult(_0x287ec7,_0x51b019))[_0x5c4f('0x27')](handleError(_0x287ec7,null));};exports[_0x5c4f('0x4e')]=function(_0x541b23,_0x1c595b){var _0x2a06a3={'raw':![],'where':{'id':_0x541b23[_0x5c4f('0x4f')]['id']}},_0x37e478={};_0x37e478['model']=_[_0x5c4f('0x50')](db['Setting'][_0x5c4f('0x51')]);_0x37e478['query']=_[_0x5c4f('0x50')](_0x541b23[_0x5c4f('0x3c')]);_0x37e478[_0x5c4f('0x3d')]=_[_0x5c4f('0x40')](_0x37e478[_0x5c4f('0x3e')],_0x37e478[_0x5c4f('0x3c')]);_0x2a06a3[_0x5c4f('0x3f')]=_[_0x5c4f('0x40')](_0x37e478[_0x5c4f('0x3e')],qs[_0x5c4f('0x41')](_0x541b23['query'][_0x5c4f('0x41')]));_0x2a06a3[_0x5c4f('0x3f')]=_0x2a06a3[_0x5c4f('0x3f')][_0x5c4f('0x42')]?_0x2a06a3['attributes']:_0x37e478['model'];if(_0x541b23[_0x5c4f('0x3c')]['includeAll']){_0x2a06a3['include']=[{'all':!![]}];}_0x2a06a3=_[_0x5c4f('0x49')]({},_0x2a06a3,_0x541b23[_0x5c4f('0x4a')]);return db['Setting'][_0x5c4f('0x52')](_0x2a06a3)[_0x5c4f('0x1e')](handleEntityNotFound(_0x1c595b,null))['then'](respondWithResult(_0x1c595b,null))['catch'](handleError(_0x1c595b,null));};exports['update']=function(_0x1b1cc2,_0x3b1a39){if(_0x1b1cc2[_0x5c4f('0x53')]['id']){delete _0x1b1cc2[_0x5c4f('0x53')]['id'];}return db['Setting'][_0x5c4f('0x52')]({'where':{'id':_0x1b1cc2[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x3b1a39,null))[_0x5c4f('0x1e')](saveUpdates(_0x1b1cc2['body'],null))['then'](respondWithResult(_0x3b1a39,null))[_0x5c4f('0x27')](handleError(_0x3b1a39,null));};exports[_0x5c4f('0x54')]=function(_0x4b9bf0,_0x32f413,_0xfc70f1){if(_0x4b9bf0[_0x5c4f('0x55')]&&_0x4b9bf0[_0x5c4f('0x55')][_0x5c4f('0x56')]){_0x4b9bf0[_0x5c4f('0x53')][_0x5c4f('0x57')]=_0x4b9bf0['file'][_0x5c4f('0x56')];}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x4b9bf0[_0x5c4f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x32f413,null))['then'](saveUpdates(_0x4b9bf0[_0x5c4f('0x53')],null))[_0x5c4f('0x1e')](respondWithResult(_0x32f413,null))[_0x5c4f('0x27')](handleError(_0x32f413,null));};exports[_0x5c4f('0x58')]=function(_0x50bf1f,_0x3b6673,_0x100a14){if(_0x50bf1f[_0x5c4f('0x55')]&&_0x50bf1f['file'][_0x5c4f('0x56')]){_0x50bf1f[_0x5c4f('0x53')][_0x5c4f('0x59')]=_0x50bf1f[_0x5c4f('0x55')][_0x5c4f('0x56')];}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x50bf1f[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x3b6673,null))[_0x5c4f('0x1e')](saveUpdates(_0x50bf1f[_0x5c4f('0x53')],null))['then'](respondWithResult(_0x3b6673,null))['catch'](handleError(_0x3b6673,null));};var utilLicense=require(_0x5c4f('0x18'));exports[_0x5c4f('0x5a')]=function(_0x391606,_0x47bbb7,_0x545817){var _0x33ffab=_0x5c4f('0x5b');var _0x3e16e7={'custom':![]};return utilLicense[_0x5c4f('0x5c')]()[_0x5c4f('0x1e')](function(_0x2bff57){if(_0x2bff57){_0x3e16e7=_0x2bff57;}return db[_0x5c4f('0x39')]['find']({'where':{'id':_0x391606['params']['id']},'attributes':[_0x5c4f('0x57'),_0x5c4f('0x59'),_0x5c4f('0x5d'),'favicon',_0x5c4f('0x5e'),'defaultLoginLogo',_0x5c4f('0x5f'),_0x5c4f('0x60')],'raw':!![]});})[_0x5c4f('0x1e')](handleEntityNotFound(_0x47bbb7,null))[_0x5c4f('0x1e')](function(_0x450f80){if(_0x450f80){var _0xf874e1=_0x450f80[_0x5c4f('0x57')]&&fs[_0x5c4f('0x61')](path['join'](config[_0x5c4f('0x62')],_0x33ffab,_[_0x5c4f('0x63')](_0x450f80[_0x5c4f('0x57')])))?path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x33ffab,_['toLower'](_0x450f80[_0x5c4f('0x57')])):path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x33ffab,_[_0x5c4f('0x63')](_0x5c4f('0x65')));var _0x52a544=_0x5c4f('0x66')+_[_0x5c4f('0x67')]('logo');if(_0x450f80[_0x52a544]||!_0x3e16e7['custom']){_0xf874e1=path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x33ffab,_[_0x5c4f('0x63')](_0x5c4f('0x65')));}if(!fs[_0x5c4f('0x61')](_0xf874e1)){throw new db[(_0x5c4f('0x68'))][(_0x5c4f('0x69'))](_[_0x5c4f('0x67')]('logo')+'\x20not\x20found');}return _0x47bbb7[_0x5c4f('0x6a')](_0xf874e1);}})['catch'](handleError(_0x47bbb7,null));};var utilLicense=require(_0x5c4f('0x18'));exports['getLogoLogin']=function(_0x1751db,_0x337a15,_0x461296){var _0x585779=_0x5c4f('0x5b');var _0x55aa06={'custom':![]};return utilLicense['getLicense']()[_0x5c4f('0x1e')](function(_0x3d2834){if(_0x3d2834){_0x55aa06=_0x3d2834;}return db['Setting'][_0x5c4f('0x52')]({'where':{'id':_0x1751db[_0x5c4f('0x4f')]['id']},'attributes':[_0x5c4f('0x57'),'loginLogo',_0x5c4f('0x5d'),_0x5c4f('0x6b'),_0x5c4f('0x5e'),_0x5c4f('0x6c'),_0x5c4f('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x5c4f('0x1e')](handleEntityNotFound(_0x337a15,null))['then'](function(_0x2115d4){if(_0x2115d4){var _0x2120b6=_0x2115d4['loginLogo']&&fs[_0x5c4f('0x61')](path['join'](config[_0x5c4f('0x62')],_0x585779,_[_0x5c4f('0x63')](_0x2115d4[_0x5c4f('0x59')])))?path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x585779,_['toLower'](_0x2115d4[_0x5c4f('0x59')])):path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x585779,_['toLower'](_0x5c4f('0x6d')));var _0x14bb85=_0x5c4f('0x66')+_[_0x5c4f('0x67')](_0x5c4f('0x59'));if(_0x2115d4[_0x14bb85]||!_0x55aa06['custom']){_0x2120b6=path['join'](config[_0x5c4f('0x62')],_0x585779,_[_0x5c4f('0x63')](_0x5c4f('0x6d')));}if(!fs[_0x5c4f('0x61')](_0x2120b6)){throw new db[(_0x5c4f('0x68'))][(_0x5c4f('0x69'))](_[_0x5c4f('0x67')](_0x5c4f('0x59'))+_0x5c4f('0x6e'));}return _0x337a15[_0x5c4f('0x6a')](_0x2120b6);}})['catch'](handleError(_0x337a15,null));};exports[_0x5c4f('0x6f')]=function(_0x162df3,_0x31d0c1){return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x162df3['params']['id']},'attributes':[_0x5c4f('0x70')]})['then'](respondWithResult(_0x31d0c1,null))[_0x5c4f('0x27')](handleError(_0x31d0c1,null));};exports['addPreferred']=function(_0x39dcaa,_0x24bc20,_0x45f911){if(_0x39dcaa[_0x5c4f('0x55')]&&_0x39dcaa['file'][_0x5c4f('0x56')]){_0x39dcaa['body'][_0x5c4f('0x5d')]=_0x39dcaa[_0x5c4f('0x55')]['filename'];}return db[_0x5c4f('0x39')]['find']({'where':{'id':_0x39dcaa[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x24bc20,null))[_0x5c4f('0x1e')](saveUpdates(_0x39dcaa['body'],null))['then'](respondWithResult(_0x24bc20,null))[_0x5c4f('0x27')](handleError(_0x24bc20,null));};var utilLicense=require(_0x5c4f('0x18'));exports[_0x5c4f('0x71')]=function(_0x172d4a,_0x4a8d2d,_0x166479){var _0x1cddf7=_0x5c4f('0x5b');var _0x1f7053={'custom':![]};return utilLicense[_0x5c4f('0x5c')]()[_0x5c4f('0x1e')](function(_0x49e1e0){if(_0x49e1e0){_0x1f7053=_0x49e1e0;}return db[_0x5c4f('0x39')]['find']({'where':{'id':_0x172d4a[_0x5c4f('0x4f')]['id']},'attributes':[_0x5c4f('0x57'),'loginLogo',_0x5c4f('0x5d'),_0x5c4f('0x6b'),_0x5c4f('0x5e'),_0x5c4f('0x6c'),_0x5c4f('0x5f'),_0x5c4f('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a8d2d,null))['then'](function(_0x2e91ae){if(_0x2e91ae){var _0x434de5=_0x2e91ae[_0x5c4f('0x5d')]&&fs[_0x5c4f('0x61')](path['join'](config['root'],_0x1cddf7,_[_0x5c4f('0x63')](_0x2e91ae[_0x5c4f('0x5d')])))?path['join'](config[_0x5c4f('0x62')],_0x1cddf7,_[_0x5c4f('0x63')](_0x2e91ae[_0x5c4f('0x5d')])):path['join'](config['root'],_0x1cddf7,_[_0x5c4f('0x63')]('default_preferred.png'));var _0x293efb=_0x5c4f('0x66')+_['upperFirst']('preferred');if(_0x2e91ae[_0x293efb]||!_0x1f7053[_0x5c4f('0x72')]||!_0x1f7053[_0x5c4f('0x5d')]){_0x434de5=path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x1cddf7,_['toLower'](_0x5c4f('0x73')));}if(!fs[_0x5c4f('0x61')](_0x434de5)){throw new db[(_0x5c4f('0x68'))]['ValidationError'](_[_0x5c4f('0x67')](_0x5c4f('0x5d'))+_0x5c4f('0x6e'));}return _0x4a8d2d[_0x5c4f('0x6a')](_0x434de5);}})['catch'](handleError(_0x4a8d2d,null));};exports[_0x5c4f('0x74')]=function(_0x17bf03,_0x460eb7,_0x47273c){if(_0x17bf03['file']&&_0x17bf03[_0x5c4f('0x55')][_0x5c4f('0x56')]){_0x17bf03[_0x5c4f('0x53')][_0x5c4f('0x6b')]=_0x17bf03[_0x5c4f('0x55')][_0x5c4f('0x56')];}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x17bf03[_0x5c4f('0x4f')]['id']}})[_0x5c4f('0x1e')](handleEntityNotFound(_0x460eb7,null))[_0x5c4f('0x1e')](saveUpdates(_0x17bf03[_0x5c4f('0x53')],null))['then'](respondWithResult(_0x460eb7,null))[_0x5c4f('0x27')](handleError(_0x460eb7,null));};var utilLicense=require('../../config/license/util');exports[_0x5c4f('0x75')]=function(_0x2b8968,_0x292bf7,_0x5f009f){var _0x262d9a=_0x5c4f('0x5b');var _0x1ca744={'custom':![]};return utilLicense[_0x5c4f('0x5c')]()[_0x5c4f('0x1e')](function(_0x1fb1cb){if(_0x1fb1cb){_0x1ca744=_0x1fb1cb;}return db[_0x5c4f('0x39')][_0x5c4f('0x52')]({'where':{'id':_0x2b8968[_0x5c4f('0x4f')]['id']},'attributes':['logo','loginLogo','preferred',_0x5c4f('0x6b'),_0x5c4f('0x5e'),_0x5c4f('0x6c'),_0x5c4f('0x5f'),_0x5c4f('0x60')],'raw':!![]});})[_0x5c4f('0x1e')](handleEntityNotFound(_0x292bf7,null))[_0x5c4f('0x1e')](function(_0x3a9967){if(_0x3a9967){var _0x4f3408=_0x3a9967[_0x5c4f('0x6b')]&&fs[_0x5c4f('0x61')](path['join'](config[_0x5c4f('0x62')],_0x262d9a,_[_0x5c4f('0x63')](_0x3a9967['favicon'])))?path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x262d9a,_[_0x5c4f('0x63')](_0x3a9967[_0x5c4f('0x6b')])):path['join'](config[_0x5c4f('0x62')],_0x262d9a,_[_0x5c4f('0x63')](_0x5c4f('0x76')));var _0x40a224='default'+_['upperFirst'](_0x5c4f('0x6b'));if(_0x3a9967[_0x40a224]||!_0x1ca744[_0x5c4f('0x72')]){_0x4f3408=path[_0x5c4f('0x64')](config[_0x5c4f('0x62')],_0x262d9a,_['toLower'](_0x5c4f('0x76')));}if(!fs[_0x5c4f('0x61')](_0x4f3408)){throw new db[(_0x5c4f('0x68'))]['ValidationError'](_['upperFirst'](_0x5c4f('0x6b'))+_0x5c4f('0x6e'));}return _0x292bf7[_0x5c4f('0x6a')](_0x4f3408);}})[_0x5c4f('0x27')](handleError(_0x292bf7,null));};exports[_0x5c4f('0x77')]=function(_0x4ea0b5,_0x15be12){var _0x23bbba={'offset':moment()[_0x5c4f('0x78')]()};_0x23bbba[_0x5c4f('0x79')]=moment()['utcOffset'](_0x23bbba[_0x5c4f('0x2c')])[_0x5c4f('0x7a')](_0x5c4f('0x7b'));return _0x15be12[_0x5c4f('0x29')](0xc8)[_0x5c4f('0x36')](_0x23bbba);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8eaaccf..a1d5f8f 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0xdf67cf,_0x240fc8){var _0x3a2f0b=function(_0x1202a3){while(--_0x1202a3){_0xdf67cf['push'](_0xdf67cf['shift']());}};_0x3a2f0b(++_0x240fc8);}(_0xe14b,0x93));var _0xbe14=function(_0x478457,_0x212ed5){_0x478457=_0x478457-0x0;var _0x384106=_0xe14b[_0x478457];return _0x384106;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'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(_0x14be3c,_0x224363){var _0x50b92a=function(_0x1456c8){while(--_0x1456c8){_0x14be3c['push'](_0x14be3c['shift']());}};_0x50b92a(++_0x224363);}(_0x34e8,0x12c));var _0x834e=function(_0x4f1146,_0xd03293){_0x4f1146=_0x4f1146-0x0;var _0x4203eb=_0x34e8[_0x4f1146];return _0x4203eb;};'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 5d37d87..b57d33a 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 _0x7808=['request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','Setting,\x20%s,\x20%s','result','catch','find','options','raw','where','attributes','map','include','model','ShowSetting','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x6e5677,_0x42a7b9){var _0x12be5e=function(_0x284ac4){while(--_0x284ac4){_0x6e5677['push'](_0x6e5677['shift']());}};_0x12be5e(++_0x42a7b9);}(_0x7808,0x1f3));var _0x8780=function(_0x472340,_0x3a7ad1){_0x472340=_0x472340-0x0;var _0x309b3a=_0x7808[_0x472340];return _0x309b3a;};'use strict';var _=require(_0x8780('0x0'));var util=require(_0x8780('0x1'));var moment=require(_0x8780('0x2'));var BPromise=require(_0x8780('0x3'));var rs=require(_0x8780('0x4'));var fs=require('fs');var Redis=require(_0x8780('0x5'));var db=require(_0x8780('0x6'))['db'];var utils=require(_0x8780('0x7'));var logger=require('../../config/logger')(_0x8780('0x8'));var config=require(_0x8780('0x9'));var jayson=require(_0x8780('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2201e6,_0xa94d32,_0x35a58b){return new BPromise(function(_0x3183e0,_0x1118f7){return client['request'](_0x2201e6,_0x35a58b)[_0x8780('0xb')](function(_0x5d78f9){logger[_0x8780('0xc')]('Setting,\x20%s,\x20%s',_0xa94d32,_0x8780('0xd'));logger['debug'](_0x8780('0xe'),_0xa94d32,_0x8780('0xd'),JSON['stringify'](_0x5d78f9));if(_0x5d78f9[_0x8780('0xf')]){if(_0x5d78f9[_0x8780('0xf')][_0x8780('0x10')]===0x1f4){logger[_0x8780('0xf')]('Setting,\x20%s,\x20%s',_0xa94d32,_0x5d78f9[_0x8780('0xf')]['message']);return _0x1118f7(_0x5d78f9[_0x8780('0xf')][_0x8780('0x11')]);}logger[_0x8780('0xf')](_0x8780('0x12'),_0xa94d32,_0x5d78f9[_0x8780('0xf')][_0x8780('0x11')]);return _0x3183e0(_0x5d78f9[_0x8780('0xf')][_0x8780('0x11')]);}else{logger[_0x8780('0xc')](_0x8780('0x12'),_0xa94d32,_0x8780('0xd'));_0x3183e0(_0x5d78f9[_0x8780('0x13')][_0x8780('0x11')]);}})[_0x8780('0x14')](function(_0x2c8380){logger[_0x8780('0xf')]('Setting,\x20%s,\x20%s',_0xa94d32,_0x2c8380);_0x1118f7(_0x2c8380);});});}exports['ShowSetting']=function(_0x4d1172){var _0x4466f0=this;return new Promise(function(_0x58fccc,_0x3329d5){return db['Setting'][_0x8780('0x15')]({'raw':_0x4d1172['options']?_0x4d1172[_0x8780('0x16')][_0x8780('0x17')]===undefined?!![]:![]:!![],'where':_0x4d1172[_0x8780('0x16')]?_0x4d1172[_0x8780('0x16')][_0x8780('0x18')]||null:null,'attributes':_0x4d1172[_0x8780('0x16')]?_0x4d1172[_0x8780('0x16')][_0x8780('0x19')]||null:null,'include':_0x4d1172[_0x8780('0x16')]?_0x4d1172[_0x8780('0x16')]['include']?_[_0x8780('0x1a')](_0x4d1172[_0x8780('0x16')]['include'],function(_0x38aec8){return{'model':db[_0x38aec8['model']],'as':_0x38aec8['as'],'attributes':_0x38aec8['attributes'],'include':_0x38aec8['include']?_[_0x8780('0x1a')](_0x38aec8['include'],function(_0x578d6b){return{'model':db[_0x578d6b['model']],'as':_0x578d6b['as'],'attributes':_0x578d6b[_0x8780('0x19')],'include':_0x578d6b[_0x8780('0x1b')]?_[_0x8780('0x1a')](_0x578d6b[_0x8780('0x1b')],function(_0x19c406){return{'model':db[_0x19c406[_0x8780('0x1c')]],'as':_0x19c406['as'],'attributes':_0x19c406[_0x8780('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c45e5){logger['info'](_0x8780('0x1d'),_0x4d1172);logger[_0x8780('0x1e')](_0x8780('0x1d'),_0x4d1172,JSON[_0x8780('0x1f')](_0x1c45e5));_0x58fccc(_0x1c45e5);})[_0x8780('0x14')](function(_0x5be81c){logger[_0x8780('0xf')](_0x8780('0x1d'),_0x5be81c[_0x8780('0x11')],_0x4d1172);_0x3329d5(_0x4466f0[_0x8780('0xf')](0x1f4,_0x5be81c['message']));});});}; \ No newline at end of file +var _0xd540=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','raw','options','where','include','map','attributes','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x2c7ce1,_0x3cdd46){var _0x99a890=function(_0x3abc7e){while(--_0x3abc7e){_0x2c7ce1['push'](_0x2c7ce1['shift']());}};_0x99a890(++_0x3cdd46);}(_0xd540,0x155));var _0x0d54=function(_0xd1e6e7,_0x39531c){_0xd1e6e7=_0xd1e6e7-0x0;var _0x425e07=_0xd540[_0xd1e6e7];return _0x425e07;};'use strict';var _=require('lodash');var util=require(_0x0d54('0x0'));var moment=require('moment');var BPromise=require(_0x0d54('0x1'));var rs=require(_0x0d54('0x2'));var fs=require('fs');var Redis=require(_0x0d54('0x3'));var db=require(_0x0d54('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d54('0x5'))(_0x0d54('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d54('0x7'));var client=jayson[_0x0d54('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x915057,_0x143e7e,_0x524cf3){return new BPromise(function(_0x2cb675,_0x3eeacb){return client[_0x0d54('0x9')](_0x915057,_0x524cf3)[_0x0d54('0xa')](function(_0x2106af){logger[_0x0d54('0xb')](_0x0d54('0xc'),_0x143e7e,_0x0d54('0xd'));logger[_0x0d54('0xe')](_0x0d54('0xf'),_0x143e7e,_0x0d54('0xd'),JSON[_0x0d54('0x10')](_0x2106af));if(_0x2106af[_0x0d54('0x11')]){if(_0x2106af['error'][_0x0d54('0x12')]===0x1f4){logger[_0x0d54('0x11')]('Setting,\x20%s,\x20%s',_0x143e7e,_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);return _0x3eeacb(_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);}logger[_0x0d54('0x11')](_0x0d54('0xc'),_0x143e7e,_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);return _0x2cb675(_0x2106af[_0x0d54('0x11')][_0x0d54('0x13')]);}else{logger[_0x0d54('0xb')](_0x0d54('0xc'),_0x143e7e,_0x0d54('0xd'));_0x2cb675(_0x2106af[_0x0d54('0x14')][_0x0d54('0x13')]);}})[_0x0d54('0x15')](function(_0x11b971){logger[_0x0d54('0x11')](_0x0d54('0xc'),_0x143e7e,_0x11b971);_0x3eeacb(_0x11b971);});});}exports[_0x0d54('0x16')]=function(_0x44a17e){var _0x3d99a1=this;return new Promise(function(_0x246639,_0x5c026e){return db[_0x0d54('0x17')][_0x0d54('0x18')]({'raw':_0x44a17e['options']?_0x44a17e['options'][_0x0d54('0x19')]===undefined?!![]:![]:!![],'where':_0x44a17e[_0x0d54('0x1a')]?_0x44a17e[_0x0d54('0x1a')][_0x0d54('0x1b')]||null:null,'attributes':_0x44a17e[_0x0d54('0x1a')]?_0x44a17e[_0x0d54('0x1a')]['attributes']||null:null,'include':_0x44a17e[_0x0d54('0x1a')]?_0x44a17e[_0x0d54('0x1a')][_0x0d54('0x1c')]?_[_0x0d54('0x1d')](_0x44a17e[_0x0d54('0x1a')][_0x0d54('0x1c')],function(_0x3766ff){return{'model':db[_0x3766ff['model']],'as':_0x3766ff['as'],'attributes':_0x3766ff[_0x0d54('0x1e')],'include':_0x3766ff[_0x0d54('0x1c')]?_[_0x0d54('0x1d')](_0x3766ff[_0x0d54('0x1c')],function(_0x59d18f){return{'model':db[_0x59d18f[_0x0d54('0x1f')]],'as':_0x59d18f['as'],'attributes':_0x59d18f[_0x0d54('0x1e')],'include':_0x59d18f[_0x0d54('0x1c')]?_[_0x0d54('0x1d')](_0x59d18f[_0x0d54('0x1c')],function(_0x442f49){return{'model':db[_0x442f49[_0x0d54('0x1f')]],'as':_0x442f49['as'],'attributes':_0x442f49[_0x0d54('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4faa19){logger[_0x0d54('0xb')](_0x0d54('0x16'),_0x44a17e);logger[_0x0d54('0xe')](_0x0d54('0x16'),_0x44a17e,JSON[_0x0d54('0x10')](_0x4faa19));_0x246639(_0x4faa19);})[_0x0d54('0x15')](function(_0x5c4dea){logger[_0x0d54('0x11')](_0x0d54('0x16'),_0x5c4dea[_0x0d54('0x13')],_0x44a17e);_0x5c026e(_0x3d99a1[_0x0d54('0x11')](0x1f4,_0x5c4dea['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 838212b..28938f3 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x21177a,_0x2a5e00){var _0xbd5908=function(_0x55ef2c){while(--_0x55ef2c){_0x21177a['push'](_0x21177a['shift']());}};_0xbd5908(++_0x2a5e00);}(_0x7a54,0x106));var _0x47a5=function(_0x33a7a7,_0x247d9b){_0x33a7a7=_0x33a7a7-0x0;var _0x40b6d0=_0x7a54[_0x33a7a7];return _0x40b6d0;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x263106,_0x55dae4){var _0x562b8a=function(_0x3eb79b){while(--_0x3eb79b){_0x263106['push'](_0x263106['shift']());}};_0x562b8a(++_0x55dae4);}(_0x7a54,0x106));var _0x47a5=function(_0x4a6e87,_0x5cb305){_0x4a6e87=_0x4a6e87-0x0;var _0x5cbe52=_0x7a54[_0x4a6e87];return _0x5cbe52;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index aafaa06..052b8a7 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 _0x709b=['clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','twilio','skebby','connectel'];(function(_0x478136,_0x5c6d05){var _0xd30355=function(_0x343a91){while(--_0x343a91){_0x478136['push'](_0x478136['shift']());}};_0xd30355(++_0x5c6d05);}(_0x709b,0x6b));var _0xb709=function(_0x5224a9,_0x4a16e5){_0x5224a9=_0x5224a9-0x0;var _0x109f71=_0x709b[_0x5224a9];return _0x109f71;};'use strict';var Sequelize=require(_0xb709('0x0'));var rs=require('randomstring');module[_0xb709('0x1')]={'name':{'type':Sequelize[_0xb709('0x2')],'unique':_0xb709('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb709('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb709('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb709('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb709('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb709('0x4'),_0xb709('0x5'),_0xb709('0x6'),_0xb709('0x7'),'plivo',_0xb709('0x8'),'bandwidth',_0xb709('0x9'),_0xb709('0xa'),_0xb709('0xb'))},'accountSid':{'type':Sequelize[_0xb709('0x2')]},'authId':{'type':Sequelize[_0xb709('0x2')]},'authToken':{'type':Sequelize[_0xb709('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xb709('0x2')]},'password':{'type':Sequelize[_0xb709('0x2')]},'apiKey':{'type':Sequelize[_0xb709('0x2')]},'applicationId':{'type':Sequelize[_0xb709('0x2')]},'accountId':{'type':Sequelize[_0xb709('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xb709('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xb709('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb709('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb709('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb709('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb709('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb709('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb709('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb709('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb709('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb709('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb709('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb709('0xe')],'comment':_0xb709('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d6cee){if(!_0x3d6cee)this['setDataValue'](_0xb709('0x10'),null);this[_0xb709('0x11')](_0xb709('0x12'),_0x3d6cee);}}}; \ No newline at end of file +var _0x88d6=['ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x448774,_0x45ddc7){var _0x46b2f6=function(_0x1dee94){while(--_0x1dee94){_0x448774['push'](_0x448774['shift']());}};_0x46b2f6(++_0x45ddc7);}(_0x88d6,0xb1));var _0x688d=function(_0x177c53,_0x338988){_0x177c53=_0x177c53-0x0;var _0x124d65=_0x88d6[_0x177c53];return _0x124d65;};'use strict';var Sequelize=require(_0x688d('0x0'));var rs=require(_0x688d('0x1'));module['exports']={'name':{'type':Sequelize[_0x688d('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x688d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x688d('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x688d('0x3')](_0x688d('0x4'),_0x688d('0x5'),_0x688d('0x6'),_0x688d('0x7'),_0x688d('0x8'),_0x688d('0x9'),'bandwidth',_0x688d('0xa'),'infobip',_0x688d('0xb'))},'accountSid':{'type':Sequelize[_0x688d('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x688d('0x2')]},'smsMethod':{'type':Sequelize[_0x688d('0x3')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x688d('0x2')]},'apiKey':{'type':Sequelize[_0x688d('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x688d('0x2')]},'senderString':{'type':Sequelize[_0x688d('0x2')]},'deliveryReport':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x688d('0xd');}},'notificationSound':{'type':Sequelize[_0x688d('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x688d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x688d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x688d('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x688d('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x688d('0xe')],'comment':_0x688d('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x688d('0xc')],'defaultValue':![],'comment':_0x688d('0x10'),'set':function(_0x4e44a6){if(!_0x4e44a6)this[_0x688d('0x11')](_0x688d('0x12'),null);this[_0x688d('0x11')](_0x688d('0x13'),_0x4e44a6);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bdb5ded..aba07dd 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 _0x86de=['findOne','rawAttributes','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','from','Body','messageId','MessageSid','text','connectel','clicksend','plivo','From','Text','MessageUUID','infobip','results','csc','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','spread','interaction','created','push','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','SmsInteraction','CmContact','Contact','Owner','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','requestid','statusInt','message_id','status_code','clickatell','redif','update','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','save','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','SmsAccountId','Disposition','getDispositions'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x86de,0x81));var _0xe86d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x86de[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe86d('0x0'));var rimraf=require(_0xe86d('0x1'));var zipdir=require(_0xe86d('0x2'));var jsonpatch=require(_0xe86d('0x3'));var rp=require(_0xe86d('0x4'));var moment=require(_0xe86d('0x5'));var BPromise=require(_0xe86d('0x6'));var Mustache=require(_0xe86d('0x7'));var util=require('util');var path=require(_0xe86d('0x8'));var sox=require('sox');var csv=require(_0xe86d('0x9'));var ejs=require(_0xe86d('0xa'));var fs=require('fs');var fs_extra=require(_0xe86d('0xb'));var _=require(_0xe86d('0xc'));var squel=require('squel');var crypto=require(_0xe86d('0xd'));var jsforce=require(_0xe86d('0xe'));var deskjs=require(_0xe86d('0xf'));var toCsv=require(_0xe86d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe86d('0x10'));var authService=require(_0xe86d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe86d('0x12'));var hardwareService=require(_0xe86d('0x13'));var logger=require(_0xe86d('0x14'))(_0xe86d('0x15'));var utils=require(_0xe86d('0x16'));var config=require(_0xe86d('0x17'));var licenseUtil=require(_0xe86d('0x18'));var db=require('../../mysqldb')['db'];config[_0xe86d('0x19')]=_[_0xe86d('0x1a')](config[_0xe86d('0x19')],{'host':_0xe86d('0x1b'),'port':0x18eb});var socket=require(_0xe86d('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')[_0xe86d('0x1d')](socket);var jayson=require(_0xe86d('0x1e'));var client=jayson[_0xe86d('0x1f')][_0xe86d('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x1b87f8,_0x19a869,_0x3c74a2,_0x37d641){return new BPromise(function(_0x34d05a,_0x45261e){var _0x35df76=_0x37d641||client;return _0x35df76[_0xe86d('0x21')](_0x1b87f8,_0x3c74a2)['then'](function(_0xfd78b2){logger[_0xe86d('0x22')]('SmsAccount,\x20%s,\x20%s',_0x19a869,_0xe86d('0x23'));logger[_0xe86d('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x19a869,_0xe86d('0x23'),JSON[_0xe86d('0x25')](_0xfd78b2));if(_0xfd78b2['error']){if(_0xfd78b2[_0xe86d('0x26')][_0xe86d('0x27')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x19a869,_0xfd78b2[_0xe86d('0x26')]['message']);return _0x45261e(_0xfd78b2['error'][_0xe86d('0x28')]);}logger['error'](_0xe86d('0x29'),_0x19a869,_0xfd78b2[_0xe86d('0x26')][_0xe86d('0x28')]);return _0x34d05a(_0xfd78b2[_0xe86d('0x26')]['message']);}else{logger[_0xe86d('0x22')](_0xe86d('0x29'),_0x19a869,_0xe86d('0x23'));_0x34d05a(_0xfd78b2['result'][_0xe86d('0x28')]);}})[_0xe86d('0x2a')](function(_0x2d5635){logger[_0xe86d('0x26')](_0xe86d('0x29'),_0x19a869,_0x2d5635);_0x45261e(_0x2d5635);});});}function respondWithStatusCode(_0x577ff9,_0x271b06){_0x271b06=_0x271b06||0xcc;return function(_0x2d36cc){if(_0x2d36cc){return _0x577ff9[_0xe86d('0x2b')](_0x271b06);}return _0x577ff9[_0xe86d('0x2c')](_0x271b06)[_0xe86d('0x2d')]();};}function respondWithResult(_0x30c17c,_0x3826c2){_0x3826c2=_0x3826c2||0xc8;return function(_0x59229d){if(_0x59229d){return _0x30c17c[_0xe86d('0x2c')](_0x3826c2)[_0xe86d('0x2e')](_0x59229d);}};}function respondWithFilteredResult(_0x480175,_0x533013){return function(_0x56e088){if(_0x56e088){var _0x4f3254=typeof _0x533013['offset']===_0xe86d('0x2f')&&typeof _0x533013[_0xe86d('0x30')]===_0xe86d('0x2f');var _0x32ca07=_0x56e088[_0xe86d('0x31')];var _0x349efa=_0x4f3254?0x0:_0x533013[_0xe86d('0x32')];var _0x595778=_0x4f3254?_0x56e088[_0xe86d('0x31')]:_0x533013[_0xe86d('0x32')]+_0x533013['limit'];var _0x5a834e;if(_0x595778>=_0x32ca07){_0x595778=_0x32ca07;_0x5a834e=0xc8;}else{_0x5a834e=0xce;}_0x480175[_0xe86d('0x2c')](_0x5a834e);return _0x480175['set'](_0xe86d('0x33'),_0x349efa+'-'+_0x595778+'/'+_0x32ca07)[_0xe86d('0x2e')](_0x56e088);}return null;};}function patchUpdates(_0x5891bf){return function(_0x1df063){try{jsonpatch['apply'](_0x1df063,_0x5891bf,!![]);}catch(_0x6b7bcb){return BPromise['reject'](_0x6b7bcb);}return _0x1df063[_0xe86d('0x34')]();};}function saveUpdates(_0x25df32,_0x4759f7){return function(_0x25969b){if(_0x25969b){return _0x25969b['update'](_0x25df32)[_0xe86d('0x35')](function(_0x539436){return _0x539436;});}return null;};}function removeEntity(_0x485ecd,_0x4d2323){return function(_0xa8f90f){if(_0xa8f90f){return _0xa8f90f[_0xe86d('0x36')]()[_0xe86d('0x35')](function(){var _0x32b814=_0xa8f90f[_0xe86d('0x37')]({'plain':!![]});var _0x4b5dd5=_0xe86d('0x38');return db[_0xe86d('0x39')]['destroy']({'where':{'type':_0x4b5dd5,'resourceId':_0x32b814['id']}})[_0xe86d('0x35')](function(){return _0xa8f90f;});})[_0xe86d('0x35')](function(){_0x485ecd[_0xe86d('0x2c')](0xcc)[_0xe86d('0x2d')]();});}};}function handleEntityNotFound(_0x2a06d5,_0xd1ebe0){return function(_0x16005d){if(!_0x16005d){_0x2a06d5[_0xe86d('0x2b')](0x194);}return _0x16005d;};}function handleError(_0x4bced7,_0x28d190){_0x28d190=_0x28d190||0x1f4;return function(_0x4870dc){logger[_0xe86d('0x26')](_0x4870dc[_0xe86d('0x3a')]);if(_0x4870dc[_0xe86d('0x3b')]){delete _0x4870dc[_0xe86d('0x3b')];}_0x4bced7['status'](_0x28d190)[_0xe86d('0x3c')](_0x4870dc);};}exports['index']=function(_0x37a452,_0x3fc59a){var _0x44a343={'include':[{'model':db[_0xe86d('0x3d')],'as':_0xe86d('0x3e')}]},_0x5dfe2b={},_0x1ad59a={'count':0x0,'rows':[]};var _0x2e7c0a=_[_0xe86d('0x3f')](db[_0xe86d('0x40')]['rawAttributes'],function(_0x1a16a1){return{'name':_0x1a16a1['fieldName'],'type':_0x1a16a1['type']['key']};});_0x5dfe2b[_0xe86d('0x41')]=_['map'](_0x2e7c0a,_0xe86d('0x3b'));_0x5dfe2b[_0xe86d('0x42')]=_[_0xe86d('0x43')](_0x37a452['query']);_0x5dfe2b[_0xe86d('0x44')]=_['intersection'](_0x5dfe2b[_0xe86d('0x41')],_0x5dfe2b[_0xe86d('0x42')]);_0x44a343['attributes']=_['intersection'](_0x5dfe2b[_0xe86d('0x41')],qs[_0xe86d('0x45')](_0x37a452['query']['fields']));_0x44a343[_0xe86d('0x46')]=_0x44a343[_0xe86d('0x46')][_0xe86d('0x47')]?_0x44a343['attributes']:_0x5dfe2b[_0xe86d('0x41')];if(!_0x37a452[_0xe86d('0x42')][_0xe86d('0x48')](_0xe86d('0x49'))){_0x44a343['limit']=qs[_0xe86d('0x30')](_0x37a452['query'][_0xe86d('0x30')]);_0x44a343['offset']=qs[_0xe86d('0x32')](_0x37a452[_0xe86d('0x42')][_0xe86d('0x32')]);}_0x44a343[_0xe86d('0x4a')]=qs['sort'](_0x37a452[_0xe86d('0x42')][_0xe86d('0x4b')]);_0x44a343['where']=qs[_0xe86d('0x44')](_[_0xe86d('0x4c')](_0x37a452[_0xe86d('0x42')],_0x5dfe2b[_0xe86d('0x44')]),_0x2e7c0a);if(_0x37a452[_0xe86d('0x42')][_0xe86d('0x4d')]){_0x44a343[_0xe86d('0x4e')]=_['merge'](_0x44a343[_0xe86d('0x4e')],{'$or':_[_0xe86d('0x3f')](_0x2e7c0a,function(_0x4374c1){if(_0x4374c1[_0xe86d('0x4f')]!==_0xe86d('0x50')){var _0x54bb41={};_0x54bb41[_0x4374c1['name']]={'$like':'%'+_0x37a452['query'][_0xe86d('0x4d')]+'%'};return _0x54bb41;}})});}_0x44a343=_[_0xe86d('0x51')]({},_0x44a343,_0x37a452[_0xe86d('0x52')]);var _0xb7f7c9={'where':_0x44a343[_0xe86d('0x4e')]};return db[_0xe86d('0x40')]['count'](_0xb7f7c9)[_0xe86d('0x35')](function(_0x29c0f4){_0x1ad59a[_0xe86d('0x31')]=_0x29c0f4;if(_0x37a452[_0xe86d('0x42')][_0xe86d('0x53')]){_0x44a343[_0xe86d('0x54')]=[{'all':!![]}];}return db[_0xe86d('0x40')][_0xe86d('0x55')](_0x44a343);})[_0xe86d('0x35')](function(_0x936295){_0x1ad59a[_0xe86d('0x56')]=_0x936295;return _0x1ad59a;})[_0xe86d('0x35')](respondWithFilteredResult(_0x3fc59a,_0x44a343))['catch'](handleError(_0x3fc59a,null));};exports['show']=function(_0x36a481,_0x177e89){var _0x2149b9={'raw':![],'where':{'id':_0x36a481[_0xe86d('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xe86d('0x3e')}]},_0xd6d2be={};_0xd6d2be[_0xe86d('0x41')]=_[_0xe86d('0x43')](db[_0xe86d('0x40')]['rawAttributes']);_0xd6d2be[_0xe86d('0x42')]=_[_0xe86d('0x43')](_0x36a481[_0xe86d('0x42')]);_0xd6d2be['filters']=_[_0xe86d('0x58')](_0xd6d2be[_0xe86d('0x41')],_0xd6d2be[_0xe86d('0x42')]);_0x2149b9[_0xe86d('0x46')]=_[_0xe86d('0x58')](_0xd6d2be[_0xe86d('0x41')],qs[_0xe86d('0x45')](_0x36a481[_0xe86d('0x42')]['fields']));_0x2149b9['attributes']=_0x2149b9[_0xe86d('0x46')][_0xe86d('0x47')]?_0x2149b9[_0xe86d('0x46')]:_0xd6d2be[_0xe86d('0x41')];if(_0x36a481[_0xe86d('0x42')][_0xe86d('0x53')]){_0x2149b9[_0xe86d('0x54')]=[{'all':!![]}];}_0x2149b9=_[_0xe86d('0x51')]({},_0x2149b9,_0x36a481[_0xe86d('0x52')]);return db['SmsAccount']['find'](_0x2149b9)[_0xe86d('0x35')](handleEntityNotFound(_0x177e89,null))['then'](respondWithResult(_0x177e89,null))['catch'](handleError(_0x177e89,null));};exports[_0xe86d('0x59')]=function(_0xa694fd,_0x16e600){return db['SmsAccount']['create'](_0xa694fd[_0xe86d('0x5a')],{})['then'](function(_0x16aae2){var _0x5cf3be=_0xa694fd['user'][_0xe86d('0x37')]({'plain':!![]});if(!_0x5cf3be)throw new Error(_0xe86d('0x5b'));if(_0x5cf3be[_0xe86d('0x5c')]===_0xe86d('0x5d')){var _0x5dfc92=_0x16aae2['get']({'plain':!![]});var _0x1357cc='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x1357cc,'userProfileId':_0x5cf3be[_0xe86d('0x5e')]},'raw':!![]})['then'](function(_0x43b15f){if(_0x43b15f&&_0x43b15f[_0xe86d('0x5f')]===0x0){return db[_0xe86d('0x39')][_0xe86d('0x59')]({'name':_0x5dfc92[_0xe86d('0x3b')],'resourceId':_0x5dfc92['id'],'type':_0x43b15f['name'],'sectionId':_0x43b15f['id']},{})[_0xe86d('0x35')](function(){return _0x16aae2;});}else{return _0x16aae2;}})[_0xe86d('0x2a')](function(_0xcdaaac){logger[_0xe86d('0x26')](_0xe86d('0x60'),_0xcdaaac);throw _0xcdaaac;});}return _0x16aae2;})[_0xe86d('0x35')](respondWithResult(_0x16e600,0xc9))[_0xe86d('0x2a')](handleError(_0x16e600,null));};exports['update']=function(_0x39cc5c,_0xcaa6dc){if(_0x39cc5c[_0xe86d('0x5a')]['id']){delete _0x39cc5c[_0xe86d('0x5a')]['id'];}return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x39cc5c[_0xe86d('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xe86d('0x3e')}]})[_0xe86d('0x35')](handleEntityNotFound(_0xcaa6dc,null))['then'](saveUpdates(_0x39cc5c['body'],null))[_0xe86d('0x35')](respondWithResult(_0xcaa6dc,null))['catch'](handleError(_0xcaa6dc,null));};exports['destroy']=function(_0x4f03a1,_0x389d18){return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x4f03a1[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x389d18,null))[_0xe86d('0x35')](removeEntity(_0x389d18,null))['catch'](handleError(_0x389d18,null));};exports[_0xe86d('0x62')]=function(_0x5d7af8,_0xcc3272){return db[_0xe86d('0x40')][_0xe86d('0x62')]()[_0xe86d('0x35')](respondWithResult(_0xcc3272,null))[_0xe86d('0x2a')](handleError(_0xcc3272,null));};exports['addDisposition']=function(_0x18d039,_0x3f7ab2,_0xfab3da){if(_0x18d039[_0xe86d('0x5a')]['id']){delete _0x18d039[_0xe86d('0x5a')]['id'];}return db['SmsAccount'][_0xe86d('0x61')]({'where':{'id':_0x18d039[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x3f7ab2,null))[_0xe86d('0x35')](function(_0x158799){if(_0x158799){_0x18d039[_0xe86d('0x5a')][_0xe86d('0x63')]=_0x158799['id'];return db[_0xe86d('0x64')]['create'](_0x18d039[_0xe86d('0x5a')]);}})[_0xe86d('0x35')](respondWithResult(_0x3f7ab2,null))[_0xe86d('0x2a')](handleError(_0x3f7ab2,null));};exports[_0xe86d('0x65')]=function(_0x317107,_0xd742e4,_0x5364e1){var _0x2fc972={'raw':![],'where':{}};var _0x500e06={};var _0x35f450={'count':0x0,'rows':[]};return db['SmsAccount'][_0xe86d('0x66')]({'where':{'id':_0x317107[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0xd742e4,null))['then'](function(_0x8d3d55){if(_0x8d3d55){_0x500e06[_0xe86d('0x41')]=_[_0xe86d('0x43')](db[_0xe86d('0x64')][_0xe86d('0x67')]);_0x500e06[_0xe86d('0x42')]=_[_0xe86d('0x43')](_0x317107['query']);_0x500e06[_0xe86d('0x44')]=_['intersection'](_0x500e06['model'],_0x500e06[_0xe86d('0x42')]);_0x2fc972[_0xe86d('0x46')]=_['intersection'](_0x500e06['model'],qs[_0xe86d('0x45')](_0x317107['query'][_0xe86d('0x45')]));_0x2fc972[_0xe86d('0x46')]=_0x2fc972[_0xe86d('0x46')][_0xe86d('0x47')]?_0x2fc972[_0xe86d('0x46')]:_0x500e06[_0xe86d('0x41')];if(!_0x317107[_0xe86d('0x42')][_0xe86d('0x48')](_0xe86d('0x49'))){_0x2fc972['limit']=qs[_0xe86d('0x30')](_0x317107[_0xe86d('0x42')][_0xe86d('0x30')]);_0x2fc972[_0xe86d('0x32')]=qs[_0xe86d('0x32')](_0x317107[_0xe86d('0x42')][_0xe86d('0x32')]);}_0x2fc972[_0xe86d('0x4a')]=qs[_0xe86d('0x4b')](_0x317107[_0xe86d('0x42')]['sort']);_0x2fc972['where']=qs[_0xe86d('0x44')](_['pick'](_0x317107[_0xe86d('0x42')],_0x500e06[_0xe86d('0x44')]));_0x2fc972[_0xe86d('0x4e')]['SmsAccountId']=_0x8d3d55['id'];if(_0x317107[_0xe86d('0x42')][_0xe86d('0x4d')]){_0x2fc972[_0xe86d('0x4e')]=_['merge'](_0x2fc972['where'],{'$or':_[_0xe86d('0x3f')](_0x2fc972['attributes'],function(_0x585c67){var _0x25283d={};_0x25283d[_0x585c67]={'$like':'%'+_0x317107[_0xe86d('0x42')][_0xe86d('0x4d')]+'%'};return _0x25283d;})});}_0x2fc972=_[_0xe86d('0x51')]({},_0x2fc972,_0x317107['options']);return db[_0xe86d('0x64')][_0xe86d('0x31')]({'where':_0x2fc972[_0xe86d('0x4e')]})[_0xe86d('0x35')](function(_0x308774){_0x35f450[_0xe86d('0x31')]=_0x308774;if(_0x317107[_0xe86d('0x42')][_0xe86d('0x53')]){_0x2fc972[_0xe86d('0x54')]=[{'all':!![]}];}return db[_0xe86d('0x64')][_0xe86d('0x55')](_0x2fc972);})[_0xe86d('0x35')](function(_0x2d524a){_0x35f450[_0xe86d('0x56')]=_0x2d524a;return _0x35f450;});}})[_0xe86d('0x35')](respondWithFilteredResult(_0xd742e4,_0x2fc972))[_0xe86d('0x2a')](handleError(_0xd742e4,null));};exports[_0xe86d('0x68')]=function(_0x5dd727,_0x589cd5,_0x4bfb25){return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x5dd727[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x589cd5,null))[_0xe86d('0x35')](function(_0x175556){if(_0x175556){return _0x175556[_0xe86d('0x68')](_0x5dd727[_0xe86d('0x42')][_0xe86d('0x69')]);}})['then'](respondWithStatusCode(_0x589cd5,null))[_0xe86d('0x2a')](handleError(_0x589cd5,null));};exports[_0xe86d('0x6a')]=function(_0x458d2f,_0x3514a0,_0x2b42cc){if(_0x458d2f[_0xe86d('0x5a')]['id']){delete _0x458d2f[_0xe86d('0x5a')]['id'];}return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x458d2f[_0xe86d('0x57')]['id']}})['then'](handleEntityNotFound(_0x3514a0,null))[_0xe86d('0x35')](function(_0x3911e6){if(_0x3911e6){_0x458d2f[_0xe86d('0x5a')][_0xe86d('0x63')]=_0x3911e6['id'];return db['CannedAnswer'][_0xe86d('0x59')](_0x458d2f[_0xe86d('0x5a')]);}})[_0xe86d('0x35')](respondWithResult(_0x3514a0,null))[_0xe86d('0x2a')](handleError(_0x3514a0,null));};exports[_0xe86d('0x6b')]=function(_0xc2d066,_0x16c3f5,_0x4767e5){var _0x21d8e6={'raw':![],'where':{}};var _0x529f2f={};var _0x34201c={'count':0x0,'rows':[]};return db[_0xe86d('0x40')]['findOne']({'where':{'id':_0xc2d066[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x16c3f5,null))[_0xe86d('0x35')](function(_0x499aec){if(_0x499aec){_0x529f2f['model']=_[_0xe86d('0x43')](db[_0xe86d('0x6c')]['rawAttributes']);_0x529f2f[_0xe86d('0x42')]=_[_0xe86d('0x43')](_0xc2d066[_0xe86d('0x42')]);_0x529f2f[_0xe86d('0x44')]=_[_0xe86d('0x58')](_0x529f2f['model'],_0x529f2f[_0xe86d('0x42')]);_0x21d8e6[_0xe86d('0x46')]=_[_0xe86d('0x58')](_0x529f2f[_0xe86d('0x41')],qs['fields'](_0xc2d066['query'][_0xe86d('0x45')]));_0x21d8e6[_0xe86d('0x46')]=_0x21d8e6['attributes']['length']?_0x21d8e6['attributes']:_0x529f2f[_0xe86d('0x41')];if(!_0xc2d066[_0xe86d('0x42')][_0xe86d('0x48')](_0xe86d('0x49'))){_0x21d8e6[_0xe86d('0x30')]=qs[_0xe86d('0x30')](_0xc2d066['query'][_0xe86d('0x30')]);_0x21d8e6[_0xe86d('0x32')]=qs[_0xe86d('0x32')](_0xc2d066[_0xe86d('0x42')][_0xe86d('0x32')]);}_0x21d8e6['order']=qs['sort'](_0xc2d066['query'][_0xe86d('0x4b')]);_0x21d8e6[_0xe86d('0x4e')]=qs[_0xe86d('0x44')](_['pick'](_0xc2d066['query'],_0x529f2f[_0xe86d('0x44')]));_0x21d8e6[_0xe86d('0x4e')][_0xe86d('0x63')]=_0x499aec['id'];if(_0xc2d066[_0xe86d('0x42')][_0xe86d('0x4d')]){_0x21d8e6[_0xe86d('0x4e')]=_[_0xe86d('0x51')](_0x21d8e6[_0xe86d('0x4e')],{'$or':_['map'](_0x21d8e6[_0xe86d('0x46')],function(_0x1985ea){var _0x277ccd={};_0x277ccd[_0x1985ea]={'$like':'%'+_0xc2d066['query'][_0xe86d('0x4d')]+'%'};return _0x277ccd;})});}_0x21d8e6=_[_0xe86d('0x51')]({},_0x21d8e6,_0xc2d066['options']);return db[_0xe86d('0x6c')]['count']({'where':_0x21d8e6[_0xe86d('0x4e')]})[_0xe86d('0x35')](function(_0x10d80b){_0x34201c[_0xe86d('0x31')]=_0x10d80b;if(_0xc2d066['query'][_0xe86d('0x53')]){_0x21d8e6['include']=[{'all':!![]}];}return db[_0xe86d('0x6c')]['findAll'](_0x21d8e6);})[_0xe86d('0x35')](function(_0x3c5627){_0x34201c['rows']=_0x3c5627;return _0x34201c;});}})['then'](respondWithFilteredResult(_0x16c3f5,_0x21d8e6))['catch'](handleError(_0x16c3f5,null));};exports[_0xe86d('0x6d')]=function(_0x1cf3cd,_0x14a054,_0x574792){return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x1cf3cd[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x14a054,null))[_0xe86d('0x35')](function(_0x2f23c3){if(_0x2f23c3){return _0x2f23c3['removeAnswers'](_0x1cf3cd['query']['ids']);}})[_0xe86d('0x35')](respondWithStatusCode(_0x14a054,null))['catch'](handleError(_0x14a054,null));};exports[_0xe86d('0x6e')]=function(_0x5749f8,_0x153e52,_0x3ad2db){var _0x498b13={'channel':_0xe86d('0x6f')};var _0x9caa8e=[];var _0x6d0ae3=[];var _0x5405c3={};return db[_0xe86d('0x40')]['find']({'where':{'id':_0x5749f8[_0xe86d('0x57')]['id']},'include':[{'model':db[_0xe86d('0x70')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x153e52,null))['then'](function(_0x1357a8){_0x498b13[_0xe86d('0x71')]=_0x1357a8;_0x498b13[_0xe86d('0x72')]=_[_0xe86d('0x73')](_0x1357a8[_0xe86d('0x74')],[_0xe86d('0x75')],['asc']);if(_0x498b13[_0xe86d('0x71')]['Applications']){delete _0x498b13[_0xe86d('0x71')][_0xe86d('0x74')];}return db['CmContact'][_0xe86d('0x62')]();})[_0xe86d('0x35')](function(_0x177eab){if(!_0x177eab){throw new db['Sequelize'][(_0xe86d('0x76'))]('no\x20available\x20attributes');}_0x9caa8e=_[_0xe86d('0x77')](_[_0xe86d('0x43')](_0x177eab),[_0xe86d('0x78'),_0xe86d('0x79')]);_0x6d0ae3=_[_0xe86d('0x77')](_[_0xe86d('0x43')](_0x177eab),[_0xe86d('0x78'),_0xe86d('0x79'),'CompanyId',_0xe86d('0x7a')]);_0x498b13['body']={'mapKey':_0xe86d('0x7b')};if(_0x498b13[_0xe86d('0x71')]['type']){switch(_0x498b13[_0xe86d('0x71')][_0xe86d('0x4f')]){case _0xe86d('0x7c'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]=_0x5749f8[_0xe86d('0x5a')]['From'];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x7e')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7f')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x80')];break;case'skebby':_0x498b13['body'][_0xe86d('0x7d')]='+'+_0x5749f8[_0xe86d('0x5a')]['sender'];_0x498b13['body'][_0xe86d('0x5a')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x81')];break;case _0xe86d('0x82'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x7d')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')]=_0x5749f8['body'][_0xe86d('0x28')];break;case _0xe86d('0x83'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]=_0x5749f8['body'][_0xe86d('0x7d')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x5a')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7f')]=_0x5749f8[_0xe86d('0x5a')]['message_id'];break;case _0xe86d('0x84'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x85')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')]=_0x5749f8['body'][_0xe86d('0x86')];_0x498b13[_0xe86d('0x5a')]['messageId']=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x87')];break;case _0xe86d('0x88'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]='+'+_0x5749f8['body']['results'][0x0][_0xe86d('0x7d')];_0x498b13[_0xe86d('0x5a')]['body']=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x89')][0x0][_0xe86d('0x81')];_0x498b13[_0xe86d('0x5a')]['messageId']=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x89')][0x0][_0xe86d('0x7f')];break;case _0xe86d('0x8a'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]=_0x5749f8['body']['originatingAddress'];_0x498b13['body']['body']=_0x5749f8[_0xe86d('0x5a')]['segmentedMessage'][_0xe86d('0x28')];break;case'clickatell':_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x8b')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x81')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7f')]=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x8c')];break;case _0xe86d('0x8d'):_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7f')]=_0x5749f8[_0xe86d('0x5a')][0x0]['message']['id'];_0x498b13[_0xe86d('0x5a')]['from']=_0x5749f8[_0xe86d('0x5a')][0x0][_0xe86d('0x28')][_0xe86d('0x7d')];_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')]=_0x5749f8[_0xe86d('0x5a')][0x0][_0xe86d('0x28')][_0xe86d('0x81')];break;case _0xe86d('0x8e'):_0x498b13[_0xe86d('0x5a')]['from']=_0x5749f8[_0xe86d('0x5a')]['from'];_0x498b13['body']['body']=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x28')];_0x498b13['body']['messageId']=_0x5749f8[_0xe86d('0x5a')][_0xe86d('0x8f')];break;}}if(_0x498b13[_0xe86d('0x5a')]['id']){delete _0x498b13['body']['id'];}if(_[_0xe86d('0x90')](_0x498b13[_0xe86d('0x5a')]['from'])){throw new db[(_0xe86d('0x91'))][(_0xe86d('0x76'))](_0xe86d('0x92'));}if(_['isNil'](_0x498b13[_0xe86d('0x5a')][_0xe86d('0x5a')])||_0x498b13[_0xe86d('0x5a')]['body']===''){throw new db[(_0xe86d('0x91'))][(_0xe86d('0x76'))](_0xe86d('0x93'));}if(_['isNil'](_0x498b13[_0xe86d('0x5a')][_0xe86d('0x94')])){throw new db[(_0xe86d('0x91'))][(_0xe86d('0x76'))](_0xe86d('0x95')+_0x6d0ae3);}if(!_[_0xe86d('0x96')](_0x6d0ae3,_0x498b13[_0xe86d('0x5a')][_0xe86d('0x94')])){throw new db[(_0xe86d('0x91'))][(_0xe86d('0x76'))](_0xe86d('0x97')+_0x6d0ae3);}_0x5405c3[_0x498b13[_0xe86d('0x5a')][_0xe86d('0x94')]]=_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')];return db[_0xe86d('0x98')]['find']({'where':{'id':_0x498b13[_0xe86d('0x71')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xe86d('0x99'),'where':_0x5405c3,'limit':0x1,'order':[['updatedAt',_0xe86d('0x9a')]]}]});})[_0xe86d('0x35')](handleEntityNotFound(_0x153e52,null))[_0xe86d('0x35')](function(_0x188cb1){if(_0x188cb1){_0x498b13[_0xe86d('0x9b')]=_[_0xe86d('0x9c')](_0x188cb1,[_0xe86d('0x99')]);if(_0x188cb1['Contacts'][_0xe86d('0x47')]){return _0x188cb1[_0xe86d('0x99')][0x0];}var _0x40e178=_[_0xe86d('0x1a')](_0x498b13['body'],{'firstName':_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')],'ListId':_0x188cb1['id']});_0x40e178[_0x498b13[_0xe86d('0x5a')]['mapKey']]=_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')];return db['CmContact'][_0xe86d('0x59')](_0x40e178,{'fields':_0x9caa8e,'raw':!![]});}})[_0xe86d('0x35')](handleEntityNotFound(_0x153e52,null))[_0xe86d('0x35')](function(_0x58fc65){if(_0x58fc65){_0x498b13['contact']=_0x58fc65;var _0x155061={'ContactId':_0x58fc65['id'],'phone':_0x498b13[_0xe86d('0x5a')]['from'],'SmsAccountId':_0x5749f8[_0xe86d('0x57')]['id']};var _0x5609bb={'ContactId':_0x58fc65['id'],'SmsAccountId':_0x5749f8[_0xe86d('0x57')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x5609bb})[_0xe86d('0x35')](function(_0xcad5ef){if(_0xcad5ef){return[_0xcad5ef,![]];}return db['SmsInteraction'][_0xe86d('0x59')](_0x155061)[_0xe86d('0x35')](function(_0x1fa25c){return[_0x1fa25c,!![]];});});}})[_0xe86d('0x9d')](function(_0x3fb63f,_0x5ec0b1){_0x498b13[_0xe86d('0x9e')]=_0x3fb63f[_0xe86d('0x37')]({'plain':!![]});_0x498b13[_0xe86d('0x9e')][_0xe86d('0x9f')]=![];if(_0x5ec0b1){if(_0x498b13['account']['autoclose']){_0x498b13[_0xe86d('0x72')][_0xe86d('0xa0')]({'id':0x0,'priority':_0x498b13[_0xe86d('0x72')][_0xe86d('0x47')]+0x1,'app':'close','appdata':_0xe86d('0xa1'),'interval':_0xe86d('0xa2')});}_0x498b13[_0xe86d('0x9e')]['created']=!![];}return db[_0xe86d('0xa3')][_0xe86d('0x59')]({'phone':_0x498b13[_0xe86d('0x5a')][_0xe86d('0x7d')],'messageId':_0x498b13['body']['messageId'],'body':_0x498b13[_0xe86d('0x5a')]['body'],'SmsAccountId':_0x5749f8['params']['id'],'SmsInteractionId':_0x3fb63f['id'],'direction':'in','ContactId':_0x3fb63f[_0xe86d('0xa4')],'AttachmentId':_0x498b13[_0xe86d('0x5a')]['AttachmentId']});})[_0xe86d('0x35')](function(_0x5245e8){_0x498b13[_0xe86d('0x28')]=_0x5245e8;if(!_0x498b13['interaction'][_0xe86d('0xa5')])return;return db[_0xe86d('0xa6')][_0xe86d('0x61')]({'attributes':['id',_0xe86d('0x3b')],'where':{'id':_0x498b13[_0xe86d('0x9e')][_0xe86d('0xa5')]}});})[_0xe86d('0x35')](function(_0x489ef9){if(_0x489ef9){_0x498b13[_0xe86d('0x72')][_0xe86d('0xa7')]({'id':0x0,'priority':0x0,'app':_0xe86d('0xa8'),'appdata':_0x489ef9['name']+','+(_0x498b13[_0xe86d('0x71')][_0xe86d('0xa9')]||0xa),'interval':_0xe86d('0xa2')});}if(!_0x498b13[_0xe86d('0x9e')][_0xe86d('0xaa')])return;return db[_0xe86d('0xab')][_0xe86d('0x61')]({'attributes':['id',_0xe86d('0x3b')],'where':{'id':_0x498b13[_0xe86d('0x9e')][_0xe86d('0xaa')]}});})[_0xe86d('0x35')](function(_0x30beb7){if(_0x30beb7){_0x498b13[_0xe86d('0x72')][_0xe86d('0xa7')]({'id':0x0,'priority':0x1,'app':_0xe86d('0xac'),'appdata':_0x30beb7['name']+','+(_0x498b13[_0xe86d('0x71')][_0xe86d('0xad')]||0x12c),'interval':_0xe86d('0xa2')});}return respondWithRpcPromise(_0xe86d('0xae'),_0xe86d('0xaf'),_0x498b13);})[_0xe86d('0x35')](function(_0x24d5dd){if(_0x24d5dd){var _0xe802b3=0xc8;var _0x44579d=_0xe86d('0xb0');logger[_0xe86d('0x22')](_0xe86d('0xb1'),_0x44579d,_0xe802b3,_0xe86d('0xb2'));logger[_0xe86d('0x24')](_0xe86d('0xb3'),_0x44579d,_0xe802b3,'entity\x20found',JSON['stringify'](_0x24d5dd));if(_0x498b13[_0xe86d('0x71')][_0xe86d('0x4f')]==='twilio'){return _0x153e52[_0xe86d('0x2c')](_0xe802b3)[_0xe86d('0xb4')](_0xe86d('0xb5'),_0xe86d('0xb6'))[_0xe86d('0x3c')]('\x0a');}else{return _0x153e52[_0xe86d('0x2c')](_0xe802b3)[_0xe86d('0x2e')](_0x24d5dd);}}})[_0xe86d('0x2a')](handleError(_0x153e52,null));};exports['addApplications']=function(_0x3a07bd,_0x1805e2){var _0x1f0bbd=_0x3a07bd['params']['id'];var _0x129268=_0x3a07bd['body'];var _0xca350a=0xc8;var _0x3dc9ab=null;return db[_0xe86d('0xb7')][_0xe86d('0xb8')]({'isolationLevel':db['sequelize'][_0xe86d('0xb9')][_0xe86d('0xba')]['READ_COMMITTED']},function(_0x406604){return db[_0xe86d('0x40')][_0xe86d('0x66')]({'where':{'id':_0x1f0bbd},'transaction':_0x406604})['then'](function(_0x438242){if(_0x438242){return db[_0xe86d('0x70')][_0xe86d('0x36')]({'where':{'SmsAccountId':_0x1f0bbd},'transaction':_0x406604})[_0xe86d('0x35')](function(){var _0x384e9b=_[_0xe86d('0x3f')](_0x129268,function(_0x470dca){_0x470dca['SmsAccountId']=_0x1f0bbd;return _0x470dca;});return db[_0xe86d('0x70')][_0xe86d('0xbb')](_0x384e9b,{'transaction':_0x406604});});}else{_0xca350a=0x194;_0x3dc9ab=[];}});})['then'](function(){if(_0xca350a!==0x194){return db[_0xe86d('0x70')][_0xe86d('0xbc')]({'where':{'SmsAccountId':_0x1f0bbd},'order':_0xe86d('0x75')})[_0xe86d('0x35')](function(_0xef01b0){_0x3dc9ab=_0xef01b0;});}})[_0xe86d('0x2a')](function(_0x534e9c){_0xca350a=0x1f4;logger['error'](_0x534e9c['stack']);if(_0x534e9c[_0xe86d('0x3b')]){delete _0x534e9c['name'];}_0x3dc9ab=_0x534e9c;})[_0xe86d('0xbd')](function(){if(_0x3dc9ab===null){_0x1805e2[_0xe86d('0x2b')](_0xca350a);}else{if(_0xca350a===0x1f4){_0x1805e2[_0xe86d('0x2c')](_0xca350a)[_0xe86d('0x3c')](_0x3dc9ab);}else{_0x1805e2['status'](_0xca350a)['json'](_0x3dc9ab);}}});};exports[_0xe86d('0xbe')]=function(_0x5a4f2e,_0x26b0c3,_0x3df4bd){var _0x499cdb={};var _0x1716fb={};var _0x997173;var _0x3ee5dc;return db[_0xe86d('0x40')][_0xe86d('0x66')]({'where':{'id':_0x5a4f2e[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x26b0c3,null))[_0xe86d('0x35')](function(_0x2b7d96){if(_0x2b7d96){_0x997173=_0x2b7d96;_0x1716fb[_0xe86d('0x41')]=_[_0xe86d('0x43')](db[_0xe86d('0x70')][_0xe86d('0x67')]);_0x1716fb[_0xe86d('0x42')]=_['keys'](_0x5a4f2e[_0xe86d('0x42')]);_0x1716fb[_0xe86d('0x44')]=_[_0xe86d('0x58')](_0x1716fb[_0xe86d('0x41')],_0x1716fb[_0xe86d('0x42')]);_0x499cdb[_0xe86d('0x46')]=_['intersection'](_0x1716fb['model'],qs[_0xe86d('0x45')](_0x5a4f2e[_0xe86d('0x42')]['fields']));_0x499cdb[_0xe86d('0x46')]=_0x499cdb[_0xe86d('0x46')][_0xe86d('0x47')]?_0x499cdb[_0xe86d('0x46')]:_0x1716fb['model'];_0x499cdb[_0xe86d('0x4a')]=qs[_0xe86d('0x4b')](_0x5a4f2e[_0xe86d('0x42')][_0xe86d('0x4b')]);_0x499cdb[_0xe86d('0x4e')]=qs[_0xe86d('0x44')](_[_0xe86d('0x4c')](_0x5a4f2e[_0xe86d('0x42')],_0x1716fb[_0xe86d('0x44')]));if(_0x5a4f2e[_0xe86d('0x42')][_0xe86d('0x4d')]){_0x499cdb['where']=_['merge'](_0x499cdb['where'],{'$or':_['map'](_0x499cdb[_0xe86d('0x46')],function(_0x172271){var _0x4a16b7={};_0x4a16b7[_0x172271]={'$like':'%'+_0x5a4f2e['query'][_0xe86d('0x4d')]+'%'};return _0x4a16b7;})});}_0x499cdb=_[_0xe86d('0x51')]({},_0x499cdb,_0x5a4f2e['options']);return _0x997173[_0xe86d('0xbe')](_0x499cdb);}})[_0xe86d('0x35')](function(_0x3fbf78){if(_0x3fbf78){_0x3ee5dc=_0x3fbf78['length'];if(!_0x5a4f2e[_0xe86d('0x42')][_0xe86d('0x48')](_0xe86d('0x49'))){_0x499cdb[_0xe86d('0x30')]=qs[_0xe86d('0x30')](_0x5a4f2e[_0xe86d('0x42')]['limit']);_0x499cdb[_0xe86d('0x32')]=qs[_0xe86d('0x32')](_0x5a4f2e[_0xe86d('0x42')][_0xe86d('0x32')]);}return _0x997173[_0xe86d('0xbe')](_0x499cdb);}})['then'](function(_0x1b154c){if(_0x1b154c){return _0x1b154c?{'count':_0x3ee5dc,'rows':_0x1b154c}:null;}})[_0xe86d('0x35')](respondWithResult(_0x26b0c3,null))[_0xe86d('0x2a')](handleError(_0x26b0c3,null));};exports['getInteractions']=function(_0x49eb8f,_0x32de42,_0x39553a){var _0x33d281={'raw':![],'where':{}};var _0x9fedcc={};var _0x51e5d7={'count':0x0,'rows':[]};return db[_0xe86d('0x40')]['findOne']({'where':{'id':_0x49eb8f[_0xe86d('0x57')]['id']}})['then'](handleEntityNotFound(_0x32de42,null))[_0xe86d('0x35')](function(_0x24bd56){if(_0x24bd56){_0x9fedcc[_0xe86d('0x41')]=_[_0xe86d('0x43')](db['SmsInteraction'][_0xe86d('0x67')]);_0x9fedcc[_0xe86d('0x42')]=_[_0xe86d('0x43')](_0x49eb8f['query']);_0x9fedcc['filters']=_[_0xe86d('0x58')](_0x9fedcc['model'],_0x9fedcc[_0xe86d('0x42')]);_0x33d281[_0xe86d('0x46')]=_[_0xe86d('0x58')](_0x9fedcc[_0xe86d('0x41')],qs['fields'](_0x49eb8f[_0xe86d('0x42')][_0xe86d('0x45')]));_0x33d281[_0xe86d('0x46')]=_0x33d281[_0xe86d('0x46')]['length']?_0x33d281[_0xe86d('0x46')]:_0x9fedcc[_0xe86d('0x41')];if(!_0x49eb8f['query']['hasOwnProperty']('nolimit')){_0x33d281[_0xe86d('0x30')]=qs['limit'](_0x49eb8f['query'][_0xe86d('0x30')]);_0x33d281[_0xe86d('0x32')]=qs[_0xe86d('0x32')](_0x49eb8f[_0xe86d('0x42')]['offset']);}_0x33d281[_0xe86d('0x4a')]=qs['sort'](_0x49eb8f[_0xe86d('0x42')][_0xe86d('0x4b')]);_0x33d281[_0xe86d('0x4e')]=qs[_0xe86d('0x44')](_[_0xe86d('0x4c')](_0x49eb8f['query'],_0x9fedcc[_0xe86d('0x44')]));_0x33d281['where'][_0xe86d('0x63')]=_0x24bd56['id'];if(_0x49eb8f['query']['filter']){_0x33d281[_0xe86d('0x4e')]=_[_0xe86d('0x51')](_0x33d281[_0xe86d('0x4e')],{'$or':_[_0xe86d('0x3f')](_0x33d281['attributes'],function(_0x38c88a){var _0xb6ae86={};_0xb6ae86[_0x38c88a]={'$like':'%'+_0x49eb8f[_0xe86d('0x42')][_0xe86d('0x4d')]+'%'};return _0xb6ae86;})});}_0x33d281=_[_0xe86d('0x51')]({},_0x33d281,_0x49eb8f[_0xe86d('0x52')]);return db[_0xe86d('0xbf')]['count']({'where':_0x33d281['where']})[_0xe86d('0x35')](function(_0x568e0a){_0x51e5d7[_0xe86d('0x31')]=_0x568e0a;if(_0x49eb8f[_0xe86d('0x42')][_0xe86d('0x53')]){_0x33d281[_0xe86d('0x54')]=[{'model':db[_0xe86d('0xc0')],'as':_0xe86d('0xc1'),'required':![]},{'model':db[_0xe86d('0xa6')],'as':_0xe86d('0xc2'),'attributes':[_0xe86d('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0xe86d('0xc3')],'as':_0xe86d('0xc4'),'attributes':['id',_0xe86d('0x3b'),_0xe86d('0xc5')],'where':_0x49eb8f[_0xe86d('0x42')][_0xe86d('0xc6')]?{'id':_0x49eb8f[_0xe86d('0x42')][_0xe86d('0xc6')]}:undefined,'required':_0x49eb8f[_0xe86d('0x42')][_0xe86d('0xc6')]?!![]:![]}];}return db['SmsInteraction'][_0xe86d('0x55')](_0x33d281);})['then'](function(_0x561e55){_0x51e5d7[_0xe86d('0x56')]=_0x561e55;return _0x51e5d7;});}})[_0xe86d('0x35')](respondWithFilteredResult(_0x32de42,_0x33d281))[_0xe86d('0x2a')](handleError(_0x32de42,null));};exports[_0xe86d('0x3c')]=function(_0x4ce97e,_0x441ec1,_0x52d837){var _0x5b7232,_0xfc4f10,_0x31e05a;if(_[_0xe86d('0x90')](_0x4ce97e[_0xe86d('0x5a')][_0xe86d('0x5a')])||_0x4ce97e['body'][_0xe86d('0x5a')]===''){throw new db[(_0xe86d('0x91'))][(_0xe86d('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe86d('0x90')](_0x4ce97e[_0xe86d('0x5a')]['to'])){throw new db[(_0xe86d('0x91'))][(_0xe86d('0x76'))](_0xe86d('0xc7'));}_0x5b7232=_0x4ce97e[_0xe86d('0x5a')]['to'];return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x4ce97e[_0xe86d('0x57')]['id']},'include':[{'model':db[_0xe86d('0x98')],'as':'List','include':[{'model':db[_0xe86d('0xc0')],'as':'Contacts','where':{'mobile':_0x5b7232},'limit':0x1,'order':[['updatedAt',_0xe86d('0x9a')]]}]}]})[_0xe86d('0x35')](handleEntityNotFound(_0x441ec1,null))[_0xe86d('0x35')](function(_0x49e708){if(_0x49e708&&_0x49e708[_0xe86d('0xc8')]){_0xfc4f10=_0x49e708['get']({'plain':!![]});if(_0xfc4f10[_0xe86d('0xc8')]&&_0xfc4f10['List'][_0xe86d('0x99')]['length']){return _0xfc4f10[_0xe86d('0xc8')][_0xe86d('0x99')][0x0];}return db['CmContact']['create'](_[_0xe86d('0x1a')](_0x4ce97e[_0xe86d('0x5a')],{'firstName':_0x5b7232,'mobile':_0x5b7232,'phone':_0x5b7232,'ListId':_0xfc4f10[_0xe86d('0x7a')]}));}})[_0xe86d('0x35')](handleEntityNotFound(_0x441ec1,null))[_0xe86d('0x35')](function(_0x11dcac){if(_0x11dcac){_0x31e05a=_0x11dcac;return db['SmsInteraction']['find']({'where':{'ContactId':_0x31e05a['id'],'closed':![],'SmsAccountId':_0xfc4f10['id']}})[_0xe86d('0x35')](function(_0x2f5b83){if(_0x2f5b83){return[_0x2f5b83,![]];}return db[_0xe86d('0xbf')][_0xe86d('0x59')]({'UserId':_0x4ce97e['user']['id'],'ContactId':_0x31e05a['id'],'SmsAccountId':_0xfc4f10['id'],'phone':_0x5b7232,'firstMsgDirection':_0xe86d('0xc9'),'Messages':[_['merge'](_0x4ce97e['body'],{'read':![],'body':_0x4ce97e[_0xe86d('0x5a')][_0xe86d('0x5a')],'phone':_0x5b7232,'SmsAccountId':_0xfc4f10['id'],'UserId':_0x4ce97e['user']['id'],'ContactId':_0x31e05a['id']})]},{'include':[{'model':db[_0xe86d('0xa3')],'as':_0xe86d('0xca')}]})['then'](function(_0x1a3450){return[_0x1a3450,!![]];});});}})['spread'](function(_0x1439c0,_0x3b3542){if(_0x3b3542){return _0x1439c0;}return db['SmsMessage']['create'](_['merge'](_0x4ce97e[_0xe86d('0x5a')],{'read':![],'body':_0x4ce97e[_0xe86d('0x5a')][_0xe86d('0x5a')],'phone':_0x5b7232,'SmsAccountId':_0xfc4f10['id'],'SmsInteractionId':_0x1439c0['id'],'UserId':_0x4ce97e[_0xe86d('0x5d')]['id'],'ContactId':_0x31e05a['id']}))[_0xe86d('0x35')](function(_0x447498){_0x1439c0[_0xe86d('0xcb')][_0xe86d('0xca')]=[];_0x1439c0[_0xe86d('0xcb')][_0xe86d('0xca')][_0xe86d('0xa0')](_0x447498[_0xe86d('0xcb')]);return _0x1439c0;});})['then'](respondWithResult(_0x441ec1,null))[_0xe86d('0x2a')](handleError(_0x441ec1,null));};exports['status']=function(_0x5ca81f,_0x1f5c4e,_0x4f4df8){if(_0x5ca81f[_0xe86d('0x5a')]['id']){delete _0x5ca81f[_0xe86d('0x5a')]['id'];}var _0x15cac5,_0x427f0c,_0x58fbf8;return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x5ca81f[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x1f5c4e,null))[_0xe86d('0x35')](function(_0x126aa4){if(_0x126aa4){_0x58fbf8=_0x126aa4;logger[_0xe86d('0x24')](_0xe86d('0xb1'),'status',_0xe86d('0xcc'),_0x126aa4[_0xe86d('0x4f')],util[_0xe86d('0xcd')](_0x5ca81f['body'],{'showHidden':![],'depth':null}));switch(_0x126aa4['type']){case _0xe86d('0xce'):if(_0x5ca81f[_0xe86d('0x5a')]['skebby_dispatch_id']&&_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0x2c')]){_0x427f0c=_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0x2c')];return db[_0xe86d('0xa3')][_0xe86d('0x61')]({'where':{'messageId':_0x5ca81f[_0xe86d('0x5a')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x5ca81f['body'][_0xe86d('0xcf')]&&_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0xd0')]){_0x427f0c=_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0xd0')];return db['SmsMessage'][_0xe86d('0x61')]({'where':{'messageId':_0x5ca81f[_0xe86d('0x5a')]['requestid']}});}break;case _0xe86d('0x83'):if(_0x5ca81f['body'][_0xe86d('0xd1')]&&_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0xd2')]){_0x427f0c=_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0xd2')];return db[_0xe86d('0xa3')]['find']({'where':{'messageId':_0x5ca81f[_0xe86d('0x5a')]['message_id']}});}break;case _0xe86d('0x88'):var _0x1834c3=_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0x89')][0x0];if(_0x1834c3[_0xe86d('0x7f')]&&_0x1834c3[_0xe86d('0x2c')]['groupName']==='DELIVERED'){_0x427f0c=_0x1834c3[_0xe86d('0x2c')]['groupName'];return db[_0xe86d('0xa3')][_0xe86d('0x61')]({'where':{'messageId':_0x1834c3['messageId']}});}break;case _0xe86d('0xd3'):if(_0x5ca81f['body'][_0xe86d('0x7f')]&&_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0x2c')]){_0x427f0c=_0x5ca81f['body']['status'];return db[_0xe86d('0xa3')][_0xe86d('0x61')]({'where':{'messageId':_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0x7f')]}});}break;case _0xe86d('0x8d'):if(_0x5ca81f['body'][0x0][_0xe86d('0x28')]['id']){_0x427f0c=_0x5ca81f['body'][0x0][_0xe86d('0x4f')];return db[_0xe86d('0xa3')][_0xe86d('0x61')]({'where':{'messageId':_0x5ca81f['body'][0x0][_0xe86d('0x28')]['id']}});}break;case _0xe86d('0x8e'):if(_0x5ca81f['body'][_0xe86d('0xd4')]&&_0x5ca81f['body'][_0xe86d('0x2c')]){_0x427f0c=_0x5ca81f[_0xe86d('0x5a')]['status'];return db[_0xe86d('0xa3')][_0xe86d('0x61')]({'where':{'messageId':_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0xd4')]}});}break;}}})[_0xe86d('0x35')](handleEntityNotFound(_0x1f5c4e,null))['then'](function(_0x5f795a){if(_0x5f795a){_0x15cac5=_0x5f795a;switch(_0x58fbf8[_0xe86d('0x4f')]){case _0xe86d('0xce'):if(_0x427f0c==='DELIVERED'){return _0x15cac5[_0xe86d('0xd5')]({'read':!![]});}else{logger['error'](_0xe86d('0xb1'),_0xe86d('0x2c'),'skebby',util[_0xe86d('0xcd')](_0x5ca81f['body'],{'showHidden':![],'depth':null}));}break;case _0xe86d('0x82'):if(_0x427f0c==='1'){return _0x15cac5['update']({'read':!![]});}else{logger[_0xe86d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe86d('0x2c'),_0xe86d('0xce'),util[_0xe86d('0xcd')](_0x5ca81f[_0xe86d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe86d('0x83'):if(!_0x5ca81f[_0xe86d('0x5a')][_0xe86d('0xd6')]&&_0x427f0c>=0xc8&&_0x427f0c<=0xce){return _0x15cac5[_0xe86d('0xd5')]({'read':!![]});}else{logger[_0xe86d('0x26')](_0xe86d('0xb1'),'status',_0xe86d('0x83'),util[_0xe86d('0xcd')](_0x5ca81f[_0xe86d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe86d('0x88'):var _0x1fa654=_0x5ca81f[_0xe86d('0x5a')]['results'][0x0];if(_0x1fa654['status']['groupName']===_0xe86d('0xd7')){return _0x15cac5[_0xe86d('0xd5')]({'read':!![]});}else{logger[_0xe86d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe86d('0x88'),util[_0xe86d('0xcd')](_0x5ca81f[_0xe86d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe86d('0xd3'):if(_0x427f0c==_0xe86d('0xd8')||_0x427f0c==_0xe86d('0xd9')){return _0x15cac5[_0xe86d('0xd5')]({'read':!![]});}else{logger['error'](_0xe86d('0xb1'),'status',_0xe86d('0xd3'),util[_0xe86d('0xcd')](_0x5ca81f[_0xe86d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe86d('0x8d'):if(_0x427f0c==_0xe86d('0xda')){return _0x15cac5[_0xe86d('0xd5')]({'read':!![]});}else{logger[_0xe86d('0x26')](_0xe86d('0xb1'),_0xe86d('0x2c'),'bandwidth',util[_0xe86d('0xcd')](_0x5ca81f[_0xe86d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xe86d('0x8e'):if(_0x427f0c===_0xe86d('0xdb')||_0x427f0c===_0xe86d('0xdc')){return _0x15cac5['update']({'read':!![]});}else{logger[_0xe86d('0x26')](_0xe86d('0xb1'),'status',_0xe86d('0x8e'),util['inspect'](_0x5ca81f[_0xe86d('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x15cac5;}})[_0xe86d('0x35')](respondWithResult(_0x1f5c4e,null))['catch'](handleError(_0x1f5c4e,null));};exports[_0xe86d('0xdd')]=function(_0x2aef1a,_0x592592,_0x3be17c){var _0x3468b4,_0x3d33d7,_0x482d8b;return db[_0xe86d('0x40')]['find']({'where':{'id':_0x2aef1a[_0xe86d('0x57')]['id']}})['then'](handleEntityNotFound(_0x592592,null))[_0xe86d('0x35')](function(_0x5af297){if(_0x5af297){_0x482d8b=_0x5af297;logger[_0xe86d('0x24')](_0xe86d('0xb1'),_0xe86d('0x2c'),_0xe86d('0xcc'),_0x5af297['type'],util[_0xe86d('0xcd')](_0x2aef1a[_0xe86d('0x42')],{'showHidden':![],'depth':null}));switch(_0x5af297[_0xe86d('0x4f')]){case _0xe86d('0x8a'):if(_0x2aef1a[_0xe86d('0x42')]['message-id']&&_0x2aef1a['query']['state']){_0x3d33d7=_0x2aef1a[_0xe86d('0x42')][_0xe86d('0xde')];return db[_0xe86d('0xa3')][_0xe86d('0x61')]({'where':{'messageId':_0x2aef1a[_0xe86d('0x42')][_0xe86d('0xdf')]}});}break;}}})[_0xe86d('0x35')](handleEntityNotFound(_0x592592,null))[_0xe86d('0x35')](function(_0x2ccef3){if(_0x2ccef3){_0x3468b4=_0x2ccef3;switch(_0x482d8b[_0xe86d('0x4f')]){case _0xe86d('0x8a'):if(_0x3d33d7==='2'||_0x3d33d7==='6'){return _0x3468b4[_0xe86d('0xd5')]({'read':!![]});}else{logger[_0xe86d('0x26')](_0xe86d('0xb1'),'status',_0xe86d('0x8a'),util[_0xe86d('0xcd')](_0x2aef1a['query'],{'showHidden':![],'depth':null}));};break;}return _0x3468b4;}})[_0xe86d('0x35')](respondWithResult(_0x592592,null))[_0xe86d('0x2a')](handleError(_0x592592,null));};exports['addAgents']=function(_0x32c4a2,_0x29fc4d,_0x5e559a){return db[_0xe86d('0x40')][_0xe86d('0x61')]({'where':{'id':_0x32c4a2[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x29fc4d,null))[_0xe86d('0x35')](function(_0x2cb0c0){if(_0x2cb0c0){return _0x2cb0c0[_0xe86d('0xe0')](_0x32c4a2[_0xe86d('0x5a')]['ids'],_[_0xe86d('0x9c')](_0x32c4a2[_0xe86d('0x5a')],[_0xe86d('0x69'),'id'])||{})[_0xe86d('0x9d')](function(_0x5a0903){for(var _0x2d52dd=0x0;_0x2d52dd<_0x32c4a2[_0xe86d('0x5a')]['ids'][_0xe86d('0x47')];_0x2d52dd+=0x1){socket[_0xe86d('0xe1')](_0xe86d('0xe2'),{'UserId':Number(_0x32c4a2['body'][_0xe86d('0x69')][_0x2d52dd]),'SmsAccountId':Number(_0x32c4a2['params']['id'])});}return _0x5a0903;});}})[_0xe86d('0x35')](respondWithResult(_0x29fc4d,null))[_0xe86d('0x2a')](handleError(_0x29fc4d,null));};exports['removeAgents']=function(_0x6a1867,_0x4deb5a,_0x459b10){return db[_0xe86d('0x40')]['find']({'where':{'id':_0x6a1867[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x4deb5a,null))[_0xe86d('0x35')](function(_0x2e66fb){if(_0x2e66fb){return _0x2e66fb[_0xe86d('0xe3')](_0x6a1867['query'][_0xe86d('0x69')])[_0xe86d('0x35')](function(){if(_[_0xe86d('0xe4')](_0x6a1867['query'][_0xe86d('0x69')])){for(var _0xf40478=0x0;_0xf40478<_0x6a1867['query'][_0xe86d('0x69')][_0xe86d('0x47')];_0xf40478+=0x1){socket['emit'](_0xe86d('0xe5'),{'UserId':Number(_0x6a1867[_0xe86d('0x42')]['ids'][_0xf40478]),'SmsAccountId':Number(_0x6a1867[_0xe86d('0x57')]['id'])});}}else{socket[_0xe86d('0xe1')](_0xe86d('0xe5'),{'UserId':Number(_0x6a1867['query']['ids']),'SmsAccountId':Number(_0x6a1867[_0xe86d('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x4deb5a,null))[_0xe86d('0x2a')](handleError(_0x4deb5a,null));};exports[_0xe86d('0xe6')]=function(_0x33c8af,_0x58440c,_0x56ba4c){var _0x26edb0={};var _0x22dc37={};var _0x4b31ed;var _0x10dbb3;return db[_0xe86d('0x40')][_0xe86d('0x66')]({'where':{'id':_0x33c8af[_0xe86d('0x57')]['id']}})[_0xe86d('0x35')](handleEntityNotFound(_0x58440c,null))['then'](function(_0x4901ab){if(_0x4901ab){_0x4b31ed=_0x4901ab;_0x22dc37[_0xe86d('0x41')]=_[_0xe86d('0x43')](db[_0xe86d('0xa6')][_0xe86d('0x67')]);_0x22dc37[_0xe86d('0x42')]=_[_0xe86d('0x43')](_0x33c8af[_0xe86d('0x42')]);_0x22dc37[_0xe86d('0x44')]=_['intersection'](_0x22dc37[_0xe86d('0x41')],_0x22dc37[_0xe86d('0x42')]);_0x26edb0[_0xe86d('0x46')]=_[_0xe86d('0x58')](_0x22dc37['model'],qs[_0xe86d('0x45')](_0x33c8af[_0xe86d('0x42')][_0xe86d('0x45')]));_0x26edb0[_0xe86d('0x46')]=_0x26edb0[_0xe86d('0x46')]['length']?_0x26edb0[_0xe86d('0x46')]:_0x22dc37['model'];_0x26edb0[_0xe86d('0x4a')]=qs[_0xe86d('0x4b')](_0x33c8af[_0xe86d('0x42')][_0xe86d('0x4b')]);_0x26edb0['where']=qs[_0xe86d('0x44')](_[_0xe86d('0x4c')](_0x33c8af[_0xe86d('0x42')],_0x22dc37['filters']));if(_0x33c8af[_0xe86d('0x42')][_0xe86d('0x4d')]){_0x26edb0[_0xe86d('0x4e')]=_[_0xe86d('0x51')](_0x26edb0[_0xe86d('0x4e')],{'$or':_[_0xe86d('0x3f')](_0x26edb0[_0xe86d('0x46')],function(_0x44a90b){var _0x5bc76b={};_0x5bc76b[_0x44a90b]={'$like':'%'+_0x33c8af[_0xe86d('0x42')][_0xe86d('0x4d')]+'%'};return _0x5bc76b;})});}_0x26edb0=_['merge']({},_0x26edb0,_0x33c8af[_0xe86d('0x52')]);return _0x4b31ed['getAgents'](_0x26edb0);}})[_0xe86d('0x35')](function(_0x1c4283){if(_0x1c4283){_0x10dbb3=_0x1c4283[_0xe86d('0x47')];if(!_0x33c8af['query'][_0xe86d('0x48')](_0xe86d('0x49'))){_0x26edb0[_0xe86d('0x30')]=qs['limit'](_0x33c8af[_0xe86d('0x42')][_0xe86d('0x30')]);_0x26edb0[_0xe86d('0x32')]=qs['offset'](_0x33c8af[_0xe86d('0x42')][_0xe86d('0x32')]);}return _0x4b31ed[_0xe86d('0xe6')](_0x26edb0);}})[_0xe86d('0x35')](function(_0x4b661d){if(_0x4b661d){return _0x4b661d?{'count':_0x10dbb3,'rows':_0x4b661d}:null;}})['then'](respondWithResult(_0x58440c,null))[_0xe86d('0x2a')](handleError(_0x58440c,null));}; \ No newline at end of file +var _0x6984=['Content-Range','apply','save','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','hasOwnProperty','nolimit','order','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','SmsApplication','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','list','omit','SmsInteraction','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','agent','*,*,*,*','queueId','SmsQueue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','Messages','spread','dataValues','push','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','update','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','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','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set'];(function(_0xd347b0,_0x300564){var _0xc75d7=function(_0xa3d982){while(--_0xa3d982){_0xd347b0['push'](_0xd347b0['shift']());}};_0xc75d7(++_0x300564);}(_0x6984,0x19a));var _0x4698=function(_0x1225af,_0x397de5){_0x1225af=_0x1225af-0x0;var _0x282b81=_0x6984[_0x1225af];return _0x282b81;};'use strict';var emlformat=require(_0x4698('0x0'));var rimraf=require(_0x4698('0x1'));var zipdir=require(_0x4698('0x2'));var jsonpatch=require(_0x4698('0x3'));var rp=require(_0x4698('0x4'));var moment=require('moment');var BPromise=require(_0x4698('0x5'));var Mustache=require(_0x4698('0x6'));var util=require('util');var path=require(_0x4698('0x7'));var sox=require(_0x4698('0x8'));var csv=require(_0x4698('0x9'));var ejs=require(_0x4698('0xa'));var fs=require('fs');var fs_extra=require(_0x4698('0xb'));var _=require(_0x4698('0xc'));var squel=require(_0x4698('0xd'));var crypto=require('crypto');var jsforce=require(_0x4698('0xe'));var deskjs=require(_0x4698('0xf'));var toCsv=require(_0x4698('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4698('0x10'));var authService=require(_0x4698('0x11'));var qs=require(_0x4698('0x12'));var as=require(_0x4698('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4698('0x14'))(_0x4698('0x15'));var utils=require(_0x4698('0x16'));var config=require(_0x4698('0x17'));var licenseUtil=require(_0x4698('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4698('0x19')](config[_0x4698('0x1a')],{'host':_0x4698('0x1b'),'port':0x18eb});var socket=require(_0x4698('0x1c'))(new Redis(config['redis']));require(_0x4698('0x1d'))['register'](socket);var jayson=require(_0x4698('0x1e'));var client=jayson[_0x4698('0x1f')][_0x4698('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x15ba72,_0x34eba9,_0x23462a,_0x18b8b3){return new BPromise(function(_0x1ee3fa,_0x44e5fb){var _0xf96c31=_0x18b8b3||client;return _0xf96c31[_0x4698('0x21')](_0x15ba72,_0x23462a)[_0x4698('0x22')](function(_0x2de691){logger[_0x4698('0x23')](_0x4698('0x24'),_0x34eba9,_0x4698('0x25'));logger[_0x4698('0x26')](_0x4698('0x27'),_0x34eba9,_0x4698('0x25'),JSON['stringify'](_0x2de691));if(_0x2de691[_0x4698('0x28')]){if(_0x2de691[_0x4698('0x28')]['code']===0x1f4){logger['error'](_0x4698('0x24'),_0x34eba9,_0x2de691[_0x4698('0x28')][_0x4698('0x29')]);return _0x44e5fb(_0x2de691[_0x4698('0x28')]['message']);}logger[_0x4698('0x28')]('SmsAccount,\x20%s,\x20%s',_0x34eba9,_0x2de691[_0x4698('0x28')][_0x4698('0x29')]);return _0x1ee3fa(_0x2de691[_0x4698('0x28')][_0x4698('0x29')]);}else{logger[_0x4698('0x23')]('SmsAccount,\x20%s,\x20%s',_0x34eba9,_0x4698('0x25'));_0x1ee3fa(_0x2de691[_0x4698('0x2a')][_0x4698('0x29')]);}})[_0x4698('0x2b')](function(_0x3a097a){logger[_0x4698('0x28')](_0x4698('0x24'),_0x34eba9,_0x3a097a);_0x44e5fb(_0x3a097a);});});}function respondWithStatusCode(_0xb061ba,_0x1feda0){_0x1feda0=_0x1feda0||0xcc;return function(_0x30e5ca){if(_0x30e5ca){return _0xb061ba[_0x4698('0x2c')](_0x1feda0);}return _0xb061ba[_0x4698('0x2d')](_0x1feda0)[_0x4698('0x2e')]();};}function respondWithResult(_0x555f48,_0x13ee1c){_0x13ee1c=_0x13ee1c||0xc8;return function(_0x5c7009){if(_0x5c7009){return _0x555f48[_0x4698('0x2d')](_0x13ee1c)[_0x4698('0x2f')](_0x5c7009);}};}function respondWithFilteredResult(_0x50a1b9,_0x20016a){return function(_0xcf0005){if(_0xcf0005){var _0x26c523=typeof _0x20016a[_0x4698('0x30')]==='undefined'&&typeof _0x20016a[_0x4698('0x31')]==='undefined';var _0x26ab8a=_0xcf0005[_0x4698('0x32')];var _0x9739e2=_0x26c523?0x0:_0x20016a[_0x4698('0x30')];var _0x47ede1=_0x26c523?_0xcf0005[_0x4698('0x32')]:_0x20016a[_0x4698('0x30')]+_0x20016a['limit'];var _0x3561d4;if(_0x47ede1>=_0x26ab8a){_0x47ede1=_0x26ab8a;_0x3561d4=0xc8;}else{_0x3561d4=0xce;}_0x50a1b9[_0x4698('0x2d')](_0x3561d4);return _0x50a1b9[_0x4698('0x33')](_0x4698('0x34'),_0x9739e2+'-'+_0x47ede1+'/'+_0x26ab8a)['json'](_0xcf0005);}return null;};}function patchUpdates(_0x1e5a50){return function(_0x1bbc5e){try{jsonpatch[_0x4698('0x35')](_0x1bbc5e,_0x1e5a50,!![]);}catch(_0x12000b){return BPromise['reject'](_0x12000b);}return _0x1bbc5e[_0x4698('0x36')]();};}function saveUpdates(_0x42f371,_0x55173f){return function(_0x2fa456){if(_0x2fa456){return _0x2fa456['update'](_0x42f371)[_0x4698('0x22')](function(_0x384552){return _0x384552;});}return null;};}function removeEntity(_0x15c406,_0x458d91){return function(_0x2f0aba){if(_0x2f0aba){return _0x2f0aba[_0x4698('0x37')]()[_0x4698('0x22')](function(){var _0x48d3bf=_0x2f0aba[_0x4698('0x38')]({'plain':!![]});var _0x34ec77=_0x4698('0x39');return db['UserProfileResource'][_0x4698('0x37')]({'where':{'type':_0x34ec77,'resourceId':_0x48d3bf['id']}})[_0x4698('0x22')](function(){return _0x2f0aba;});})[_0x4698('0x22')](function(){_0x15c406[_0x4698('0x2d')](0xcc)[_0x4698('0x2e')]();});}};}function handleEntityNotFound(_0x13435a,_0x17282c){return function(_0x12eee9){if(!_0x12eee9){_0x13435a[_0x4698('0x2c')](0x194);}return _0x12eee9;};}function handleError(_0x3898cc,_0x5167d8){_0x5167d8=_0x5167d8||0x1f4;return function(_0x46d1e3){logger[_0x4698('0x28')](_0x46d1e3[_0x4698('0x3a')]);if(_0x46d1e3[_0x4698('0x3b')]){delete _0x46d1e3[_0x4698('0x3b')];}_0x3898cc[_0x4698('0x2d')](_0x5167d8)[_0x4698('0x3c')](_0x46d1e3);};}exports[_0x4698('0x3d')]=function(_0xcaaac,_0x35032f){var _0x4770c3={'include':[{'model':db[_0x4698('0x3e')],'as':_0x4698('0x3f')}]},_0x5060df={},_0x4765eb={'count':0x0,'rows':[]};var _0x16f03c=_[_0x4698('0x40')](db[_0x4698('0x41')][_0x4698('0x42')],function(_0x2e9bbc){return{'name':_0x2e9bbc[_0x4698('0x43')],'type':_0x2e9bbc[_0x4698('0x44')][_0x4698('0x45')]};});_0x5060df[_0x4698('0x46')]=_[_0x4698('0x40')](_0x16f03c,_0x4698('0x3b'));_0x5060df[_0x4698('0x47')]=_[_0x4698('0x48')](_0xcaaac[_0x4698('0x47')]);_0x5060df[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x5060df['model'],_0x5060df[_0x4698('0x47')]);_0x4770c3[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x5060df[_0x4698('0x46')],qs['fields'](_0xcaaac[_0x4698('0x47')]['fields']));_0x4770c3[_0x4698('0x4b')]=_0x4770c3[_0x4698('0x4b')][_0x4698('0x4c')]?_0x4770c3['attributes']:_0x5060df[_0x4698('0x46')];if(!_0xcaaac[_0x4698('0x47')]['hasOwnProperty']('nolimit')){_0x4770c3['limit']=qs[_0x4698('0x31')](_0xcaaac['query'][_0x4698('0x31')]);_0x4770c3[_0x4698('0x30')]=qs['offset'](_0xcaaac[_0x4698('0x47')][_0x4698('0x30')]);}_0x4770c3['order']=qs[_0x4698('0x4d')](_0xcaaac[_0x4698('0x47')][_0x4698('0x4d')]);_0x4770c3['where']=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0xcaaac[_0x4698('0x47')],_0x5060df[_0x4698('0x49')]),_0x16f03c);if(_0xcaaac[_0x4698('0x47')][_0x4698('0x4f')]){_0x4770c3[_0x4698('0x50')]=_[_0x4698('0x51')](_0x4770c3[_0x4698('0x50')],{'$or':_[_0x4698('0x40')](_0x16f03c,function(_0x4a70bc){if(_0x4a70bc['type']!==_0x4698('0x52')){var _0x3da7bb={};_0x3da7bb[_0x4a70bc[_0x4698('0x3b')]]={'$like':'%'+_0xcaaac[_0x4698('0x47')][_0x4698('0x4f')]+'%'};return _0x3da7bb;}})});}_0x4770c3=_['merge']({},_0x4770c3,_0xcaaac['options']);var _0x9f3929={'where':_0x4770c3[_0x4698('0x50')]};return db[_0x4698('0x41')][_0x4698('0x32')](_0x9f3929)['then'](function(_0x1eb1ec){_0x4765eb[_0x4698('0x32')]=_0x1eb1ec;if(_0xcaaac[_0x4698('0x47')][_0x4698('0x53')]){_0x4770c3[_0x4698('0x54')]=[{'all':!![]}];}return db[_0x4698('0x41')][_0x4698('0x55')](_0x4770c3);})[_0x4698('0x22')](function(_0x57e9da){_0x4765eb[_0x4698('0x56')]=_0x57e9da;return _0x4765eb;})['then'](respondWithFilteredResult(_0x35032f,_0x4770c3))['catch'](handleError(_0x35032f,null));};exports['show']=function(_0x28c2a4,_0x3a0f16){var _0x11fdb3={'raw':![],'where':{'id':_0x28c2a4['params']['id']},'include':[{'model':db[_0x4698('0x3e')],'as':'mandatoryDispositionPause'}]},_0x57a9ff={};_0x57a9ff[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0x41')][_0x4698('0x42')]);_0x57a9ff[_0x4698('0x47')]=_[_0x4698('0x48')](_0x28c2a4[_0x4698('0x47')]);_0x57a9ff[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x57a9ff[_0x4698('0x46')],_0x57a9ff['query']);_0x11fdb3[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x57a9ff[_0x4698('0x46')],qs[_0x4698('0x57')](_0x28c2a4['query'][_0x4698('0x57')]));_0x11fdb3[_0x4698('0x4b')]=_0x11fdb3[_0x4698('0x4b')][_0x4698('0x4c')]?_0x11fdb3[_0x4698('0x4b')]:_0x57a9ff[_0x4698('0x46')];if(_0x28c2a4[_0x4698('0x47')][_0x4698('0x53')]){_0x11fdb3[_0x4698('0x54')]=[{'all':!![]}];}_0x11fdb3=_[_0x4698('0x51')]({},_0x11fdb3,_0x28c2a4[_0x4698('0x58')]);return db[_0x4698('0x41')][_0x4698('0x59')](_0x11fdb3)['then'](handleEntityNotFound(_0x3a0f16,null))['then'](respondWithResult(_0x3a0f16,null))[_0x4698('0x2b')](handleError(_0x3a0f16,null));};exports[_0x4698('0x5a')]=function(_0x451131,_0x562c70){return db[_0x4698('0x41')][_0x4698('0x5a')](_0x451131[_0x4698('0x5b')],{})[_0x4698('0x22')](function(_0x4bfaa0){var _0x3f4f9e=_0x451131[_0x4698('0x5c')][_0x4698('0x38')]({'plain':!![]});if(!_0x3f4f9e)throw new Error(_0x4698('0x5d'));if(_0x3f4f9e['role']==='user'){var _0x5f0bac=_0x4bfaa0[_0x4698('0x38')]({'plain':!![]});var _0x44dba1=_0x4698('0x39');return db['UserProfileSection'][_0x4698('0x59')]({'where':{'name':_0x44dba1,'userProfileId':_0x3f4f9e[_0x4698('0x5e')]},'raw':!![]})[_0x4698('0x22')](function(_0x2e1a16){if(_0x2e1a16&&_0x2e1a16[_0x4698('0x5f')]===0x0){return db[_0x4698('0x60')][_0x4698('0x5a')]({'name':_0x5f0bac[_0x4698('0x3b')],'resourceId':_0x5f0bac['id'],'type':_0x2e1a16[_0x4698('0x3b')],'sectionId':_0x2e1a16['id']},{})[_0x4698('0x22')](function(){return _0x4bfaa0;});}else{return _0x4bfaa0;}})['catch'](function(_0x285432){logger[_0x4698('0x28')](_0x4698('0x61'),_0x285432);throw _0x285432;});}return _0x4bfaa0;})[_0x4698('0x22')](respondWithResult(_0x562c70,0xc9))[_0x4698('0x2b')](handleError(_0x562c70,null));};exports['update']=function(_0x1ebddf,_0x1d33e6){if(_0x1ebddf[_0x4698('0x5b')]['id']){delete _0x1ebddf[_0x4698('0x5b')]['id'];}return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x1ebddf[_0x4698('0x62')]['id']},'include':[{'model':db[_0x4698('0x3e')],'as':_0x4698('0x3f')}]})[_0x4698('0x22')](handleEntityNotFound(_0x1d33e6,null))[_0x4698('0x22')](saveUpdates(_0x1ebddf[_0x4698('0x5b')],null))[_0x4698('0x22')](respondWithResult(_0x1d33e6,null))['catch'](handleError(_0x1d33e6,null));};exports[_0x4698('0x37')]=function(_0x2f5479,_0x317367){return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x2f5479[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x317367,null))[_0x4698('0x22')](removeEntity(_0x317367,null))[_0x4698('0x2b')](handleError(_0x317367,null));};exports[_0x4698('0x63')]=function(_0x4d4965,_0x24519d){return db[_0x4698('0x41')][_0x4698('0x63')]()[_0x4698('0x22')](respondWithResult(_0x24519d,null))[_0x4698('0x2b')](handleError(_0x24519d,null));};exports[_0x4698('0x64')]=function(_0xbb025e,_0x261571,_0x1b4ca4){if(_0xbb025e['body']['id']){delete _0xbb025e[_0x4698('0x5b')]['id'];}return db[_0x4698('0x41')]['find']({'where':{'id':_0xbb025e[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x261571,null))[_0x4698('0x22')](function(_0x1e928b){if(_0x1e928b){_0xbb025e[_0x4698('0x5b')][_0x4698('0x65')]=_0x1e928b['id'];return db[_0x4698('0x66')][_0x4698('0x5a')](_0xbb025e[_0x4698('0x5b')]);}})[_0x4698('0x22')](respondWithResult(_0x261571,null))[_0x4698('0x2b')](handleError(_0x261571,null));};exports[_0x4698('0x67')]=function(_0x44aea8,_0x3f23ee,_0x2726f1){var _0x2b1962={'raw':![],'where':{}};var _0x465752={};var _0x56a86b={'count':0x0,'rows':[]};return db[_0x4698('0x41')]['findOne']({'where':{'id':_0x44aea8[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x3f23ee,null))[_0x4698('0x22')](function(_0x36845c){if(_0x36845c){_0x465752['model']=_['keys'](db[_0x4698('0x66')]['rawAttributes']);_0x465752[_0x4698('0x47')]=_[_0x4698('0x48')](_0x44aea8['query']);_0x465752[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x465752[_0x4698('0x46')],_0x465752['query']);_0x2b1962[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x465752['model'],qs['fields'](_0x44aea8['query']['fields']));_0x2b1962[_0x4698('0x4b')]=_0x2b1962[_0x4698('0x4b')][_0x4698('0x4c')]?_0x2b1962[_0x4698('0x4b')]:_0x465752[_0x4698('0x46')];if(!_0x44aea8['query'][_0x4698('0x68')](_0x4698('0x69'))){_0x2b1962[_0x4698('0x31')]=qs[_0x4698('0x31')](_0x44aea8[_0x4698('0x47')][_0x4698('0x31')]);_0x2b1962[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x44aea8[_0x4698('0x47')][_0x4698('0x30')]);}_0x2b1962[_0x4698('0x6a')]=qs[_0x4698('0x4d')](_0x44aea8[_0x4698('0x47')][_0x4698('0x4d')]);_0x2b1962[_0x4698('0x50')]=qs[_0x4698('0x49')](_['pick'](_0x44aea8[_0x4698('0x47')],_0x465752[_0x4698('0x49')]));_0x2b1962['where'][_0x4698('0x65')]=_0x36845c['id'];if(_0x44aea8[_0x4698('0x47')][_0x4698('0x4f')]){_0x2b1962[_0x4698('0x50')]=_[_0x4698('0x51')](_0x2b1962[_0x4698('0x50')],{'$or':_[_0x4698('0x40')](_0x2b1962['attributes'],function(_0x477a0a){var _0x3ac78c={};_0x3ac78c[_0x477a0a]={'$like':'%'+_0x44aea8['query'][_0x4698('0x4f')]+'%'};return _0x3ac78c;})});}_0x2b1962=_[_0x4698('0x51')]({},_0x2b1962,_0x44aea8[_0x4698('0x58')]);return db[_0x4698('0x66')][_0x4698('0x32')]({'where':_0x2b1962[_0x4698('0x50')]})[_0x4698('0x22')](function(_0x5b842d){_0x56a86b[_0x4698('0x32')]=_0x5b842d;if(_0x44aea8[_0x4698('0x47')][_0x4698('0x53')]){_0x2b1962[_0x4698('0x54')]=[{'all':!![]}];}return db[_0x4698('0x66')][_0x4698('0x55')](_0x2b1962);})[_0x4698('0x22')](function(_0x2b587e){_0x56a86b[_0x4698('0x56')]=_0x2b587e;return _0x56a86b;});}})[_0x4698('0x22')](respondWithFilteredResult(_0x3f23ee,_0x2b1962))[_0x4698('0x2b')](handleError(_0x3f23ee,null));};exports['removeDispositions']=function(_0x36be47,_0x4fd19c,_0x1f4e1c){return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x36be47[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x4fd19c,null))['then'](function(_0x1e644c){if(_0x1e644c){return _0x1e644c['removeDispositions'](_0x36be47['query'][_0x4698('0x6b')]);}})[_0x4698('0x22')](respondWithStatusCode(_0x4fd19c,null))['catch'](handleError(_0x4fd19c,null));};exports[_0x4698('0x6c')]=function(_0x1c9182,_0x4934fa,_0x36adff){if(_0x1c9182[_0x4698('0x5b')]['id']){delete _0x1c9182[_0x4698('0x5b')]['id'];}return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x1c9182[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x4934fa,null))[_0x4698('0x22')](function(_0x55d4a7){if(_0x55d4a7){_0x1c9182[_0x4698('0x5b')][_0x4698('0x65')]=_0x55d4a7['id'];return db[_0x4698('0x6d')]['create'](_0x1c9182[_0x4698('0x5b')]);}})[_0x4698('0x22')](respondWithResult(_0x4934fa,null))[_0x4698('0x2b')](handleError(_0x4934fa,null));};exports[_0x4698('0x6e')]=function(_0x31015b,_0x215c47,_0x353320){var _0x3d7e42={'raw':![],'where':{}};var _0x21503e={};var _0x1d98f4={'count':0x0,'rows':[]};return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x31015b[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x215c47,null))[_0x4698('0x22')](function(_0x51af73){if(_0x51af73){_0x21503e[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0x6d')][_0x4698('0x42')]);_0x21503e['query']=_[_0x4698('0x48')](_0x31015b[_0x4698('0x47')]);_0x21503e[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x21503e[_0x4698('0x46')],_0x21503e[_0x4698('0x47')]);_0x3d7e42[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x21503e[_0x4698('0x46')],qs[_0x4698('0x57')](_0x31015b['query'][_0x4698('0x57')]));_0x3d7e42['attributes']=_0x3d7e42[_0x4698('0x4b')][_0x4698('0x4c')]?_0x3d7e42['attributes']:_0x21503e[_0x4698('0x46')];if(!_0x31015b[_0x4698('0x47')][_0x4698('0x68')](_0x4698('0x69'))){_0x3d7e42[_0x4698('0x31')]=qs[_0x4698('0x31')](_0x31015b['query']['limit']);_0x3d7e42[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x31015b[_0x4698('0x47')][_0x4698('0x30')]);}_0x3d7e42['order']=qs[_0x4698('0x4d')](_0x31015b['query'][_0x4698('0x4d')]);_0x3d7e42[_0x4698('0x50')]=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0x31015b[_0x4698('0x47')],_0x21503e[_0x4698('0x49')]));_0x3d7e42[_0x4698('0x50')][_0x4698('0x65')]=_0x51af73['id'];if(_0x31015b['query']['filter']){_0x3d7e42[_0x4698('0x50')]=_['merge'](_0x3d7e42['where'],{'$or':_['map'](_0x3d7e42[_0x4698('0x4b')],function(_0x2ce624){var _0xa4675b={};_0xa4675b[_0x2ce624]={'$like':'%'+_0x31015b[_0x4698('0x47')]['filter']+'%'};return _0xa4675b;})});}_0x3d7e42=_[_0x4698('0x51')]({},_0x3d7e42,_0x31015b[_0x4698('0x58')]);return db[_0x4698('0x6d')][_0x4698('0x32')]({'where':_0x3d7e42['where']})[_0x4698('0x22')](function(_0x2d9bab){_0x1d98f4[_0x4698('0x32')]=_0x2d9bab;if(_0x31015b[_0x4698('0x47')][_0x4698('0x53')]){_0x3d7e42[_0x4698('0x54')]=[{'all':!![]}];}return db[_0x4698('0x6d')][_0x4698('0x55')](_0x3d7e42);})[_0x4698('0x22')](function(_0x27a176){_0x1d98f4[_0x4698('0x56')]=_0x27a176;return _0x1d98f4;});}})[_0x4698('0x22')](respondWithFilteredResult(_0x215c47,_0x3d7e42))[_0x4698('0x2b')](handleError(_0x215c47,null));};exports[_0x4698('0x70')]=function(_0x298071,_0x2d7cf3,_0x27239b){return db[_0x4698('0x41')]['find']({'where':{'id':_0x298071[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x2d7cf3,null))[_0x4698('0x22')](function(_0x428d03){if(_0x428d03){return _0x428d03[_0x4698('0x70')](_0x298071['query'][_0x4698('0x6b')]);}})['then'](respondWithStatusCode(_0x2d7cf3,null))[_0x4698('0x2b')](handleError(_0x2d7cf3,null));};exports[_0x4698('0x71')]=function(_0x1400c1,_0x3cfb21,_0x2d4428){var _0xa7ee29={'channel':'sms'};var _0x20a717=[];var _0x1bd65f=[];var _0x5be254={};return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x1400c1[_0x4698('0x62')]['id']},'include':[{'model':db[_0x4698('0x72')],'as':_0x4698('0x73')}]})[_0x4698('0x22')](handleEntityNotFound(_0x3cfb21,null))[_0x4698('0x22')](function(_0x775705){_0xa7ee29[_0x4698('0x74')]=_0x775705;_0xa7ee29['applications']=_[_0x4698('0x75')](_0x775705[_0x4698('0x73')],['priority'],[_0x4698('0x76')]);if(_0xa7ee29[_0x4698('0x74')]['Applications']){delete _0xa7ee29[_0x4698('0x74')][_0x4698('0x73')];}return db[_0x4698('0x77')][_0x4698('0x63')]();})[_0x4698('0x22')](function(_0xb9fd79){if(!_0xb9fd79){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0x7a'));}_0x20a717=_[_0x4698('0x7b')](_['keys'](_0xb9fd79),['createdAt','updatedAt']);_0x1bd65f=_[_0x4698('0x7b')](_[_0x4698('0x48')](_0xb9fd79),[_0x4698('0x7c'),'updatedAt','CompanyId',_0x4698('0x7d')]);_0xa7ee29['body']={'mapKey':'mobile'};if(_0xa7ee29[_0x4698('0x74')][_0x4698('0x44')]){switch(_0xa7ee29[_0x4698('0x74')][_0x4698('0x44')]){case _0x4698('0x7e'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x80')];_0xa7ee29['body']['body']=_0x1400c1['body']['Body'];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x82')];break;case _0x4698('0x83'):_0xa7ee29[_0x4698('0x5b')]['from']='+'+_0x1400c1[_0x4698('0x5b')][_0x4698('0x84')];_0xa7ee29[_0x4698('0x5b')]['body']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x85')];break;case _0x4698('0x86'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')]['from'];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x29')];break;case _0x4698('0x87'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')]['from'];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x5b')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')]=_0x1400c1['body'][_0x4698('0x88')];break;case _0x4698('0x89'):_0xa7ee29['body'][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x80')];_0xa7ee29['body'][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8a')];_0xa7ee29[_0x4698('0x5b')]['messageId']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8b')];break;case'infobip':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]='+'+_0x1400c1[_0x4698('0x5b')][_0x4698('0x8c')][0x0][_0x4698('0x7f')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1['body'][_0x4698('0x8c')][0x0][_0x4698('0x85')];_0xa7ee29[_0x4698('0x5b')]['messageId']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8c')][0x0][_0x4698('0x81')];break;case _0x4698('0x8d'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8e')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x8f')][_0x4698('0x29')];break;case _0x4698('0x90'):_0xa7ee29['body'][_0x4698('0x7f')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x91')];_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x85')];_0xa7ee29['body'][_0x4698('0x81')]=_0x1400c1['body']['replyMessageId'];break;case _0x4698('0x92'):_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')]=_0x1400c1[_0x4698('0x5b')][0x0]['message']['id'];_0xa7ee29[_0x4698('0x5b')]['from']=_0x1400c1['body'][0x0]['message'][_0x4698('0x7f')];_0xa7ee29[_0x4698('0x5b')]['body']=_0x1400c1['body'][0x0]['message']['text'];break;case _0x4698('0x93'):_0xa7ee29['body'][_0x4698('0x7f')]=_0x1400c1['body'][_0x4698('0x7f')];_0xa7ee29['body'][_0x4698('0x5b')]=_0x1400c1[_0x4698('0x5b')][_0x4698('0x29')];_0xa7ee29[_0x4698('0x5b')]['messageId']=_0x1400c1[_0x4698('0x5b')][_0x4698('0x94')];break;}}if(_0xa7ee29[_0x4698('0x5b')]['id']){delete _0xa7ee29[_0x4698('0x5b')]['id'];}if(_[_0x4698('0x95')](_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')])){throw new db[(_0x4698('0x78'))]['ValidationError'](_0x4698('0x96'));}if(_[_0x4698('0x95')](_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')])||_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')]===''){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0x97'));}if(_[_0x4698('0x95')](_0xa7ee29[_0x4698('0x5b')][_0x4698('0x98')])){throw new db['Sequelize'][(_0x4698('0x79'))](_0x4698('0x99')+_0x1bd65f);}if(!_[_0x4698('0x9a')](_0x1bd65f,_0xa7ee29[_0x4698('0x5b')][_0x4698('0x98')])){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0x9b')+_0x1bd65f);}_0x5be254[_0xa7ee29[_0x4698('0x5b')][_0x4698('0x98')]]=_0xa7ee29[_0x4698('0x5b')]['from'];return db[_0x4698('0x9c')][_0x4698('0x59')]({'where':{'id':_0xa7ee29[_0x4698('0x74')][_0x4698('0x7d')]},'include':[{'model':db[_0x4698('0x77')],'as':_0x4698('0x9d'),'where':_0x5be254,'limit':0x1,'order':[[_0x4698('0x9e'),_0x4698('0x9f')]]}]});})[_0x4698('0x22')](handleEntityNotFound(_0x3cfb21,null))[_0x4698('0x22')](function(_0x427c4c){if(_0x427c4c){_0xa7ee29[_0x4698('0xa0')]=_[_0x4698('0xa1')](_0x427c4c,[_0x4698('0x9d')]);if(_0x427c4c[_0x4698('0x9d')][_0x4698('0x4c')]){return _0x427c4c[_0x4698('0x9d')][0x0];}var _0x47284f=_[_0x4698('0x19')](_0xa7ee29[_0x4698('0x5b')],{'firstName':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')],'ListId':_0x427c4c['id']});_0x47284f[_0xa7ee29['body'][_0x4698('0x98')]]=_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')];return db['CmContact'][_0x4698('0x5a')](_0x47284f,{'fields':_0x20a717,'raw':!![]});}})[_0x4698('0x22')](handleEntityNotFound(_0x3cfb21,null))[_0x4698('0x22')](function(_0xd1089c){if(_0xd1089c){_0xa7ee29['contact']=_0xd1089c;var _0x2b54cb={'ContactId':_0xd1089c['id'],'phone':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')],'SmsAccountId':_0x1400c1[_0x4698('0x62')]['id']};var _0x130842={'ContactId':_0xd1089c['id'],'SmsAccountId':_0x1400c1[_0x4698('0x62')]['id'],'closed':![]};return db[_0x4698('0xa2')][_0x4698('0x59')]({'where':_0x130842})['then'](function(_0x4513b8){if(_0x4513b8){return[_0x4513b8,![]];}return db[_0x4698('0xa2')]['create'](_0x2b54cb)[_0x4698('0x22')](function(_0x20d733){return[_0x20d733,!![]];});});}})['spread'](function(_0xa1c1c3,_0x116f8e){_0xa7ee29[_0x4698('0xa3')]=_0xa1c1c3[_0x4698('0x38')]({'plain':!![]});_0xa7ee29[_0x4698('0xa3')][_0x4698('0xa4')]=![];if(_0x116f8e){if(_0xa7ee29[_0x4698('0x74')][_0x4698('0xa5')]){_0xa7ee29[_0x4698('0xa6')]['push']({'id':0x0,'priority':_0xa7ee29['applications']['length']+0x1,'app':_0x4698('0xa7'),'appdata':_0x4698('0xa8'),'interval':'*,*,*,*'});}_0xa7ee29[_0x4698('0xa3')][_0x4698('0xa4')]=!![];}return db[_0x4698('0xa9')][_0x4698('0x5a')]({'phone':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x7f')],'messageId':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x81')],'body':_0xa7ee29[_0x4698('0x5b')][_0x4698('0x5b')],'SmsAccountId':_0x1400c1[_0x4698('0x62')]['id'],'SmsInteractionId':_0xa1c1c3['id'],'direction':'in','ContactId':_0xa1c1c3[_0x4698('0xaa')],'AttachmentId':_0xa7ee29[_0x4698('0x5b')]['AttachmentId']});})['then'](function(_0x48ee7d){_0xa7ee29[_0x4698('0x29')]=_0x48ee7d;if(!_0xa7ee29['interaction'][_0x4698('0xab')])return;return db[_0x4698('0xac')]['find']({'attributes':['id',_0x4698('0x3b')],'where':{'id':_0xa7ee29[_0x4698('0xa3')][_0x4698('0xab')]}});})[_0x4698('0x22')](function(_0x4be5d6){if(_0x4be5d6){_0xa7ee29[_0x4698('0xa6')][_0x4698('0xad')]({'id':0x0,'priority':0x0,'app':_0x4698('0xae'),'appdata':_0x4be5d6[_0x4698('0x3b')]+','+(_0xa7ee29[_0x4698('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0x4698('0xaf')});}if(!_0xa7ee29[_0x4698('0xa3')][_0x4698('0xb0')])return;return db[_0x4698('0xb1')][_0x4698('0x59')]({'attributes':['id',_0x4698('0x3b')],'where':{'id':_0xa7ee29[_0x4698('0xa3')][_0x4698('0xb0')]}});})[_0x4698('0x22')](function(_0x541ebd){if(_0x541ebd){_0xa7ee29[_0x4698('0xa6')][_0x4698('0xad')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x541ebd[_0x4698('0x3b')]+','+(_0xa7ee29[_0x4698('0x74')][_0x4698('0xb2')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4698('0xb3'),_0x4698('0xb4'),_0xa7ee29);})[_0x4698('0x22')](function(_0x2ca819){if(_0x2ca819){var _0x27fccb=0xc8;var _0x263a19='receiveMessage';logger['info'](_0x4698('0x27'),_0x263a19,_0x27fccb,_0x4698('0xb5'));logger[_0x4698('0x26')](_0x4698('0xb6'),_0x263a19,_0x27fccb,_0x4698('0xb5'),JSON['stringify'](_0x2ca819));if(_0xa7ee29[_0x4698('0x74')][_0x4698('0x44')]===_0x4698('0x7e')){return _0x3cfb21[_0x4698('0x2d')](_0x27fccb)[_0x4698('0x33')](_0x4698('0xb7'),_0x4698('0xb8'))[_0x4698('0x3c')](_0x4698('0xb9'));}else{return _0x3cfb21[_0x4698('0x2d')](_0x27fccb)[_0x4698('0x2f')](_0x2ca819);}}})[_0x4698('0x2b')](handleError(_0x3cfb21,null));};exports['addApplications']=function(_0x3b76c3,_0x3e2954){var _0x59d634=_0x3b76c3['params']['id'];var _0x46571c=_0x3b76c3['body'];var _0x5c612b=0xc8;var _0x209d20=null;return db[_0x4698('0xba')][_0x4698('0xbb')]({'isolationLevel':db[_0x4698('0xba')]['Transaction'][_0x4698('0xbc')][_0x4698('0xbd')]},function(_0x29f5f3){return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x59d634},'transaction':_0x29f5f3})[_0x4698('0x22')](function(_0x1e88ab){if(_0x1e88ab){return db[_0x4698('0x72')][_0x4698('0x37')]({'where':{'SmsAccountId':_0x59d634},'transaction':_0x29f5f3})['then'](function(){var _0x59a424=_[_0x4698('0x40')](_0x46571c,function(_0xfa43d1){_0xfa43d1['SmsAccountId']=_0x59d634;return _0xfa43d1;});return db[_0x4698('0x72')][_0x4698('0xbe')](_0x59a424,{'transaction':_0x29f5f3});});}else{_0x5c612b=0x194;_0x209d20=[];}});})['then'](function(){if(_0x5c612b!==0x194){return db[_0x4698('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x59d634},'order':_0x4698('0xbf')})[_0x4698('0x22')](function(_0x3852dc){_0x209d20=_0x3852dc;});}})['catch'](function(_0x2b333c){_0x5c612b=0x1f4;logger[_0x4698('0x28')](_0x2b333c['stack']);if(_0x2b333c[_0x4698('0x3b')]){delete _0x2b333c[_0x4698('0x3b')];}_0x209d20=_0x2b333c;})[_0x4698('0xc0')](function(){if(_0x209d20===null){_0x3e2954[_0x4698('0x2c')](_0x5c612b);}else{if(_0x5c612b===0x1f4){_0x3e2954[_0x4698('0x2d')](_0x5c612b)['send'](_0x209d20);}else{_0x3e2954[_0x4698('0x2d')](_0x5c612b)['json'](_0x209d20);}}});};exports[_0x4698('0xc1')]=function(_0x4993b5,_0x51f39b,_0x5e561e){var _0x13fb35={};var _0x21273a={};var _0xc66f49;var _0x7d0095;return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x4993b5[_0x4698('0x62')]['id']}})['then'](handleEntityNotFound(_0x51f39b,null))[_0x4698('0x22')](function(_0x2bf1bd){if(_0x2bf1bd){_0xc66f49=_0x2bf1bd;_0x21273a[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0x72')]['rawAttributes']);_0x21273a['query']=_[_0x4698('0x48')](_0x4993b5[_0x4698('0x47')]);_0x21273a[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x21273a[_0x4698('0x46')],_0x21273a[_0x4698('0x47')]);_0x13fb35['attributes']=_[_0x4698('0x4a')](_0x21273a[_0x4698('0x46')],qs['fields'](_0x4993b5['query'][_0x4698('0x57')]));_0x13fb35[_0x4698('0x4b')]=_0x13fb35[_0x4698('0x4b')]['length']?_0x13fb35['attributes']:_0x21273a['model'];_0x13fb35[_0x4698('0x6a')]=qs[_0x4698('0x4d')](_0x4993b5[_0x4698('0x47')]['sort']);_0x13fb35[_0x4698('0x50')]=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0x4993b5[_0x4698('0x47')],_0x21273a[_0x4698('0x49')]));if(_0x4993b5[_0x4698('0x47')][_0x4698('0x4f')]){_0x13fb35[_0x4698('0x50')]=_[_0x4698('0x51')](_0x13fb35[_0x4698('0x50')],{'$or':_['map'](_0x13fb35[_0x4698('0x4b')],function(_0x4014a7){var _0x2b4d4f={};_0x2b4d4f[_0x4014a7]={'$like':'%'+_0x4993b5[_0x4698('0x47')]['filter']+'%'};return _0x2b4d4f;})});}_0x13fb35=_[_0x4698('0x51')]({},_0x13fb35,_0x4993b5[_0x4698('0x58')]);return _0xc66f49['getApplications'](_0x13fb35);}})[_0x4698('0x22')](function(_0x8ae9a8){if(_0x8ae9a8){_0x7d0095=_0x8ae9a8[_0x4698('0x4c')];if(!_0x4993b5[_0x4698('0x47')]['hasOwnProperty'](_0x4698('0x69'))){_0x13fb35[_0x4698('0x31')]=qs['limit'](_0x4993b5['query'][_0x4698('0x31')]);_0x13fb35[_0x4698('0x30')]=qs['offset'](_0x4993b5['query']['offset']);}return _0xc66f49['getApplications'](_0x13fb35);}})[_0x4698('0x22')](function(_0x9db3d0){if(_0x9db3d0){return _0x9db3d0?{'count':_0x7d0095,'rows':_0x9db3d0}:null;}})[_0x4698('0x22')](respondWithResult(_0x51f39b,null))[_0x4698('0x2b')](handleError(_0x51f39b,null));};exports['getInteractions']=function(_0x1c20ec,_0x4f0967,_0x22c321){var _0x165bf7={'raw':![],'where':{}};var _0x267f7b={};var _0x4a9fbc={'count':0x0,'rows':[]};return db[_0x4698('0x41')]['findOne']({'where':{'id':_0x1c20ec[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x4f0967,null))[_0x4698('0x22')](function(_0x3b00fd){if(_0x3b00fd){_0x267f7b[_0x4698('0x46')]=_[_0x4698('0x48')](db[_0x4698('0xa2')][_0x4698('0x42')]);_0x267f7b[_0x4698('0x47')]=_[_0x4698('0x48')](_0x1c20ec[_0x4698('0x47')]);_0x267f7b[_0x4698('0x49')]=_[_0x4698('0x4a')](_0x267f7b['model'],_0x267f7b[_0x4698('0x47')]);_0x165bf7['attributes']=_['intersection'](_0x267f7b[_0x4698('0x46')],qs[_0x4698('0x57')](_0x1c20ec[_0x4698('0x47')][_0x4698('0x57')]));_0x165bf7[_0x4698('0x4b')]=_0x165bf7['attributes'][_0x4698('0x4c')]?_0x165bf7['attributes']:_0x267f7b[_0x4698('0x46')];if(!_0x1c20ec['query']['hasOwnProperty']('nolimit')){_0x165bf7[_0x4698('0x31')]=qs[_0x4698('0x31')](_0x1c20ec['query'][_0x4698('0x31')]);_0x165bf7[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x1c20ec['query'][_0x4698('0x30')]);}_0x165bf7['order']=qs[_0x4698('0x4d')](_0x1c20ec[_0x4698('0x47')][_0x4698('0x4d')]);_0x165bf7['where']=qs[_0x4698('0x49')](_[_0x4698('0x4e')](_0x1c20ec['query'],_0x267f7b['filters']));_0x165bf7['where'][_0x4698('0x65')]=_0x3b00fd['id'];if(_0x1c20ec[_0x4698('0x47')]['filter']){_0x165bf7['where']=_['merge'](_0x165bf7[_0x4698('0x50')],{'$or':_['map'](_0x165bf7['attributes'],function(_0x38d962){var _0xf41e08={};_0xf41e08[_0x38d962]={'$like':'%'+_0x1c20ec[_0x4698('0x47')][_0x4698('0x4f')]+'%'};return _0xf41e08;})});}_0x165bf7=_[_0x4698('0x51')]({},_0x165bf7,_0x1c20ec[_0x4698('0x58')]);return db['SmsInteraction'][_0x4698('0x32')]({'where':_0x165bf7[_0x4698('0x50')]})[_0x4698('0x22')](function(_0x1b20a1){_0x4a9fbc[_0x4698('0x32')]=_0x1b20a1;if(_0x1c20ec['query'][_0x4698('0x53')]){_0x165bf7[_0x4698('0x54')]=[{'model':db[_0x4698('0x77')],'as':_0x4698('0xc2'),'required':![]},{'model':db[_0x4698('0xac')],'as':_0x4698('0xc3'),'attributes':[_0x4698('0x3b'),_0x4698('0xc4'),_0x4698('0xc5')],'required':![]},{'model':db['Tag'],'as':_0x4698('0xc6'),'attributes':['id',_0x4698('0x3b'),_0x4698('0xc7')],'where':_0x1c20ec[_0x4698('0x47')][_0x4698('0xc8')]?{'id':_0x1c20ec['query'][_0x4698('0xc8')]}:undefined,'required':_0x1c20ec[_0x4698('0x47')]['tag']?!![]:![]}];}return db[_0x4698('0xa2')][_0x4698('0x55')](_0x165bf7);})[_0x4698('0x22')](function(_0x2e82a9){_0x4a9fbc[_0x4698('0x56')]=_0x2e82a9;return _0x4a9fbc;});}})[_0x4698('0x22')](respondWithFilteredResult(_0x4f0967,_0x165bf7))['catch'](handleError(_0x4f0967,null));};exports[_0x4698('0x3c')]=function(_0x4c3085,_0x41cdf4,_0x1e08e2){var _0x4f762d,_0x428381,_0x293b8;if(_[_0x4698('0x95')](_0x4c3085[_0x4698('0x5b')]['body'])||_0x4c3085[_0x4698('0x5b')]['body']===''){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4698('0x95')](_0x4c3085['body']['to'])){throw new db[(_0x4698('0x78'))][(_0x4698('0x79'))](_0x4698('0xc9'));}_0x4f762d=_0x4c3085['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x4c3085[_0x4698('0x62')]['id']},'include':[{'model':db[_0x4698('0x9c')],'as':_0x4698('0xca'),'include':[{'model':db['CmContact'],'as':_0x4698('0x9d'),'where':{'mobile':_0x4f762d},'limit':0x1,'order':[['updatedAt',_0x4698('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x41cdf4,null))[_0x4698('0x22')](function(_0x64d0d2){if(_0x64d0d2&&_0x64d0d2[_0x4698('0xca')]){_0x428381=_0x64d0d2[_0x4698('0x38')]({'plain':!![]});if(_0x428381['List']&&_0x428381[_0x4698('0xca')]['Contacts'][_0x4698('0x4c')]){return _0x428381[_0x4698('0xca')][_0x4698('0x9d')][0x0];}return db[_0x4698('0x77')][_0x4698('0x5a')](_['defaults'](_0x4c3085[_0x4698('0x5b')],{'firstName':_0x4f762d,'mobile':_0x4f762d,'phone':_0x4f762d,'ListId':_0x428381[_0x4698('0x7d')]}));}})[_0x4698('0x22')](handleEntityNotFound(_0x41cdf4,null))[_0x4698('0x22')](function(_0x5152cd){if(_0x5152cd){_0x293b8=_0x5152cd;return db[_0x4698('0xa2')][_0x4698('0x59')]({'where':{'ContactId':_0x293b8['id'],'closed':![],'SmsAccountId':_0x428381['id']}})['then'](function(_0xd1ce2e){if(_0xd1ce2e){return[_0xd1ce2e,![]];}return db[_0x4698('0xa2')][_0x4698('0x5a')]({'UserId':_0x4c3085['user']['id'],'ContactId':_0x293b8['id'],'SmsAccountId':_0x428381['id'],'phone':_0x4f762d,'firstMsgDirection':'out','Messages':[_['merge'](_0x4c3085[_0x4698('0x5b')],{'read':![],'body':_0x4c3085['body']['body'],'phone':_0x4f762d,'SmsAccountId':_0x428381['id'],'UserId':_0x4c3085[_0x4698('0x5c')]['id'],'ContactId':_0x293b8['id']})]},{'include':[{'model':db[_0x4698('0xa9')],'as':_0x4698('0xcb')}]})[_0x4698('0x22')](function(_0x209ac2){return[_0x209ac2,!![]];});});}})[_0x4698('0xcc')](function(_0x12adbc,_0x4108d8){if(_0x4108d8){return _0x12adbc;}return db['SmsMessage'][_0x4698('0x5a')](_[_0x4698('0x51')](_0x4c3085[_0x4698('0x5b')],{'read':![],'body':_0x4c3085[_0x4698('0x5b')]['body'],'phone':_0x4f762d,'SmsAccountId':_0x428381['id'],'SmsInteractionId':_0x12adbc['id'],'UserId':_0x4c3085[_0x4698('0x5c')]['id'],'ContactId':_0x293b8['id']}))['then'](function(_0x184934){_0x12adbc[_0x4698('0xcd')][_0x4698('0xcb')]=[];_0x12adbc[_0x4698('0xcd')]['Messages'][_0x4698('0xce')](_0x184934['dataValues']);return _0x12adbc;});})[_0x4698('0x22')](respondWithResult(_0x41cdf4,null))[_0x4698('0x2b')](handleError(_0x41cdf4,null));};exports[_0x4698('0x2d')]=function(_0x47ae2d,_0x309851,_0x5364d4){if(_0x47ae2d[_0x4698('0x5b')]['id']){delete _0x47ae2d[_0x4698('0x5b')]['id'];}var _0x3ce5d2,_0x5243c2,_0x31dd97;return db[_0x4698('0x41')][_0x4698('0x59')]({'where':{'id':_0x47ae2d[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x309851,null))[_0x4698('0x22')](function(_0x34de5a){if(_0x34de5a){_0x31dd97=_0x34de5a;logger[_0x4698('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),'received\x20delivery\x20report\x20from',_0x34de5a['type'],util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));switch(_0x34de5a['type']){case _0x4698('0x83'):if(_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd0')]&&_0x47ae2d[_0x4698('0x5b')]['status']){_0x5243c2=_0x47ae2d['body'][_0x4698('0x2d')];return db[_0x4698('0xa9')]['find']({'where':{'messageId':_0x47ae2d['body'][_0x4698('0xd0')]}});}break;case _0x4698('0x86'):if(_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd1')]&&_0x47ae2d['body'][_0x4698('0xd2')]){_0x5243c2=_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd2')];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')]['requestid']}});}break;case _0x4698('0x87'):if(_0x47ae2d['body'][_0x4698('0x88')]&&_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd3')]){_0x5243c2=_0x47ae2d['body'][_0x4698('0xd3')];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d['body'][_0x4698('0x88')]}});}break;case _0x4698('0xd4'):var _0x23e87e=_0x47ae2d[_0x4698('0x5b')][_0x4698('0x8c')][0x0];if(_0x23e87e['messageId']&&_0x23e87e[_0x4698('0x2d')][_0x4698('0xd5')]===_0x4698('0xd6')){_0x5243c2=_0x23e87e[_0x4698('0x2d')][_0x4698('0xd5')];return db[_0x4698('0xa9')]['find']({'where':{'messageId':_0x23e87e[_0x4698('0x81')]}});}break;case'clickatell':if(_0x47ae2d[_0x4698('0x5b')][_0x4698('0x81')]&&_0x47ae2d['body'][_0x4698('0x2d')]){_0x5243c2=_0x47ae2d[_0x4698('0x5b')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')][_0x4698('0x81')]}});}break;case _0x4698('0x92'):if(_0x47ae2d[_0x4698('0x5b')][0x0][_0x4698('0x29')]['id']){_0x5243c2=_0x47ae2d[_0x4698('0x5b')][0x0]['type'];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')][0x0][_0x4698('0x29')]['id']}});}break;case'intelepeer':if(_0x47ae2d['body'][_0x4698('0xd7')]&&_0x47ae2d['body'][_0x4698('0x2d')]){_0x5243c2=_0x47ae2d[_0x4698('0x5b')]['status'];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x47ae2d[_0x4698('0x5b')][_0x4698('0xd7')]}});}break;}}})[_0x4698('0x22')](handleEntityNotFound(_0x309851,null))[_0x4698('0x22')](function(_0x273ae1){if(_0x273ae1){_0x3ce5d2=_0x273ae1;switch(_0x31dd97[_0x4698('0x44')]){case _0x4698('0x83'):if(_0x5243c2==='DELIVERED'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x83'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4698('0x86'):if(_0x5243c2==='1'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x83'),util[_0x4698('0xcf')](_0x47ae2d['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x47ae2d['body']['error_code']&&_0x5243c2>=0xc8&&_0x5243c2<=0xce){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x87'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4698('0xd4'):var _0x2d046f=_0x47ae2d[_0x4698('0x5b')][_0x4698('0x8c')][0x0];if(_0x2d046f[_0x4698('0x2d')][_0x4698('0xd5')]===_0x4698('0xd6')){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),_0x4698('0xd4'),util[_0x4698('0xcf')](_0x47ae2d['body'],{'showHidden':![],'depth':null}));}break;case _0x4698('0x90'):if(_0x5243c2==_0x4698('0xd9')||_0x5243c2==_0x4698('0xda')){return _0x3ce5d2['update']({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x90'),util[_0x4698('0xcf')](_0x47ae2d['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5243c2=='message-delivered'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),_0x4698('0x92'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4698('0x93'):if(_0x5243c2===_0x4698('0xdb')||_0x5243c2==='ACCEPTD'){return _0x3ce5d2[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x93'),util[_0x4698('0xcf')](_0x47ae2d[_0x4698('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x3ce5d2;}})[_0x4698('0x22')](respondWithResult(_0x309851,null))[_0x4698('0x2b')](handleError(_0x309851,null));};exports[_0x4698('0xdc')]=function(_0x4f61df,_0x302d59,_0x5c0a18){var _0x50bc9b,_0x22e24e,_0x509397;return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x4f61df[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x302d59,null))[_0x4698('0x22')](function(_0x385a5a){if(_0x385a5a){_0x509397=_0x385a5a;logger[_0x4698('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4698('0x2d'),_0x4698('0xdd'),_0x385a5a[_0x4698('0x44')],util[_0x4698('0xcf')](_0x4f61df['query'],{'showHidden':![],'depth':null}));switch(_0x385a5a['type']){case'csc':if(_0x4f61df[_0x4698('0x47')][_0x4698('0xde')]&&_0x4f61df[_0x4698('0x47')][_0x4698('0xdf')]){_0x22e24e=_0x4f61df[_0x4698('0x47')]['state'];return db[_0x4698('0xa9')][_0x4698('0x59')]({'where':{'messageId':_0x4f61df[_0x4698('0x47')]['message-id']}});}break;}}})[_0x4698('0x22')](handleEntityNotFound(_0x302d59,null))[_0x4698('0x22')](function(_0x19d3ee){if(_0x19d3ee){_0x50bc9b=_0x19d3ee;switch(_0x509397[_0x4698('0x44')]){case _0x4698('0x8d'):if(_0x22e24e==='2'||_0x22e24e==='6'){return _0x50bc9b[_0x4698('0xd8')]({'read':!![]});}else{logger[_0x4698('0x28')](_0x4698('0x27'),_0x4698('0x2d'),_0x4698('0x8d'),util['inspect'](_0x4f61df[_0x4698('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x50bc9b;}})[_0x4698('0x22')](respondWithResult(_0x302d59,null))[_0x4698('0x2b')](handleError(_0x302d59,null));};exports[_0x4698('0xe0')]=function(_0x59790f,_0xc0a3ce,_0x1183d1){return db['SmsAccount'][_0x4698('0x59')]({'where':{'id':_0x59790f[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0xc0a3ce,null))[_0x4698('0x22')](function(_0x681ca6){if(_0x681ca6){return _0x681ca6[_0x4698('0xe0')](_0x59790f[_0x4698('0x5b')][_0x4698('0x6b')],_[_0x4698('0xa1')](_0x59790f[_0x4698('0x5b')],[_0x4698('0x6b'),'id'])||{})[_0x4698('0xcc')](function(_0x40d00e){for(var _0x4ffbf0=0x0;_0x4ffbf0<_0x59790f[_0x4698('0x5b')][_0x4698('0x6b')][_0x4698('0x4c')];_0x4ffbf0+=0x1){socket[_0x4698('0xe1')](_0x4698('0xe2'),{'UserId':Number(_0x59790f[_0x4698('0x5b')][_0x4698('0x6b')][_0x4ffbf0]),'SmsAccountId':Number(_0x59790f[_0x4698('0x62')]['id'])});}return _0x40d00e;});}})['then'](respondWithResult(_0xc0a3ce,null))[_0x4698('0x2b')](handleError(_0xc0a3ce,null));};exports['removeAgents']=function(_0x4057bc,_0x43b4bc,_0xbc6674){return db['SmsAccount']['find']({'where':{'id':_0x4057bc[_0x4698('0x62')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x43b4bc,null))['then'](function(_0x2caf7c){if(_0x2caf7c){return _0x2caf7c[_0x4698('0xe3')](_0x4057bc['query']['ids'])[_0x4698('0x22')](function(){if(_[_0x4698('0xe4')](_0x4057bc[_0x4698('0x47')]['ids'])){for(var _0x36b9f1=0x0;_0x36b9f1<_0x4057bc[_0x4698('0x47')]['ids']['length'];_0x36b9f1+=0x1){socket['emit'](_0x4698('0xe5'),{'UserId':Number(_0x4057bc['query'][_0x4698('0x6b')][_0x36b9f1]),'SmsAccountId':Number(_0x4057bc[_0x4698('0x62')]['id'])});}}else{socket[_0x4698('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x4057bc[_0x4698('0x47')][_0x4698('0x6b')]),'SmsAccountId':Number(_0x4057bc['params']['id'])});}});}})[_0x4698('0x22')](respondWithStatusCode(_0x43b4bc,null))[_0x4698('0x2b')](handleError(_0x43b4bc,null));};exports['getAgents']=function(_0x3c1d25,_0x2e1096,_0x586a16){var _0x1c0197={};var _0x1ab18c={};var _0x4c838f;var _0x124631;return db[_0x4698('0x41')][_0x4698('0x6f')]({'where':{'id':_0x3c1d25[_0x4698('0x62')]['id']}})['then'](handleEntityNotFound(_0x2e1096,null))[_0x4698('0x22')](function(_0x10b943){if(_0x10b943){_0x4c838f=_0x10b943;_0x1ab18c[_0x4698('0x46')]=_['keys'](db[_0x4698('0xac')][_0x4698('0x42')]);_0x1ab18c[_0x4698('0x47')]=_[_0x4698('0x48')](_0x3c1d25[_0x4698('0x47')]);_0x1ab18c[_0x4698('0x49')]=_['intersection'](_0x1ab18c[_0x4698('0x46')],_0x1ab18c['query']);_0x1c0197[_0x4698('0x4b')]=_[_0x4698('0x4a')](_0x1ab18c[_0x4698('0x46')],qs['fields'](_0x3c1d25['query'][_0x4698('0x57')]));_0x1c0197[_0x4698('0x4b')]=_0x1c0197[_0x4698('0x4b')][_0x4698('0x4c')]?_0x1c0197[_0x4698('0x4b')]:_0x1ab18c['model'];_0x1c0197[_0x4698('0x6a')]=qs[_0x4698('0x4d')](_0x3c1d25[_0x4698('0x47')]['sort']);_0x1c0197['where']=qs['filters'](_[_0x4698('0x4e')](_0x3c1d25[_0x4698('0x47')],_0x1ab18c['filters']));if(_0x3c1d25[_0x4698('0x47')][_0x4698('0x4f')]){_0x1c0197[_0x4698('0x50')]=_[_0x4698('0x51')](_0x1c0197[_0x4698('0x50')],{'$or':_[_0x4698('0x40')](_0x1c0197[_0x4698('0x4b')],function(_0x1a6817){var _0x2e1d7c={};_0x2e1d7c[_0x1a6817]={'$like':'%'+_0x3c1d25[_0x4698('0x47')][_0x4698('0x4f')]+'%'};return _0x2e1d7c;})});}_0x1c0197=_['merge']({},_0x1c0197,_0x3c1d25[_0x4698('0x58')]);return _0x4c838f[_0x4698('0xe6')](_0x1c0197);}})[_0x4698('0x22')](function(_0x362e6f){if(_0x362e6f){_0x124631=_0x362e6f[_0x4698('0x4c')];if(!_0x3c1d25[_0x4698('0x47')][_0x4698('0x68')](_0x4698('0x69'))){_0x1c0197['limit']=qs[_0x4698('0x31')](_0x3c1d25[_0x4698('0x47')][_0x4698('0x31')]);_0x1c0197[_0x4698('0x30')]=qs[_0x4698('0x30')](_0x3c1d25[_0x4698('0x47')][_0x4698('0x30')]);}return _0x4c838f[_0x4698('0xe6')](_0x1c0197);}})[_0x4698('0x22')](function(_0x18b88f){if(_0x18b88f){return _0x18b88f?{'count':_0x124631,'rows':_0x18b88f}:null;}})[_0x4698('0x22')](respondWithResult(_0x2e1096,null))['catch'](handleError(_0x2e1096,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 9c09178..21df436 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 _0xb9e6=['emit','hasOwnProperty','hook','exports','events','SmsAccount','save','update'];(function(_0x10f9af,_0x150a31){var _0x5ca366=function(_0x8ca02e){while(--_0x8ca02e){_0x10f9af['push'](_0x10f9af['shift']());}};_0x5ca366(++_0x150a31);}(_0xb9e6,0x1b4));var _0x6b9e=function(_0x5553e2,_0x293852){_0x5553e2=_0x5553e2-0x0;var _0x3b65e8=_0xb9e6[_0x5553e2];return _0x3b65e8;};'use strict';var EventEmitter=require(_0x6b9e('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x6b9e('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b9e('0x2'),'afterUpdate':_0x6b9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4f4dbe){return function(_0xd9b126,_0x2be3ca,_0x19df30){SmsAccountEvents[_0x6b9e('0x4')](_0x4f4dbe+':'+_0xd9b126['id'],_0xd9b126);SmsAccountEvents[_0x6b9e('0x4')](_0x4f4dbe,_0xd9b126);_0x19df30(null);};}for(var e in events){if(events[_0x6b9e('0x5')](e)){var event=events[e];SmsAccount[_0x6b9e('0x6')](e,emitEvent(event));}}module[_0x6b9e('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x7b84=['hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x33a974,_0x3becaa){var _0x1f85b9=function(_0x2afaf4){while(--_0x2afaf4){_0x33a974['push'](_0x33a974['shift']());}};_0x1f85b9(++_0x3becaa);}(_0x7b84,0x17e));var _0x47b8=function(_0x5cf8d5,_0x156e1a){_0x5cf8d5=_0x5cf8d5-0x0;var _0x31063e=_0x7b84[_0x5cf8d5];return _0x31063e;};'use strict';var EventEmitter=require(_0x47b8('0x0'));var SmsAccount=require(_0x47b8('0x1'))['db'][_0x47b8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x47b8('0x3')](0x0);var events={'afterCreate':_0x47b8('0x4'),'afterUpdate':_0x47b8('0x5'),'afterDestroy':_0x47b8('0x6')};function emitEvent(_0x51fbce){return function(_0x7db06f,_0x561ed1,_0x17a250){SmsAccountEvents[_0x47b8('0x7')](_0x51fbce+':'+_0x7db06f['id'],_0x7db06f);SmsAccountEvents[_0x47b8('0x7')](_0x51fbce,_0x7db06f);_0x17a250(null);};}for(var e in events){if(events[_0x47b8('0x8')](e)){var event=events[e];SmsAccount[_0x47b8('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 889c910..6830d02 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 _0x275b=['bluebird','request-promise','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','util','../../config/logger','moment'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0x275b,0x1a1));var _0xb275=function(_0x2009a8,_0x1c924d){_0x2009a8=_0x2009a8-0x0;var _0x34dbd7=_0x275b[_0x2009a8];return _0x34dbd7;};'use strict';var _=require('lodash');var util=require(_0xb275('0x0'));var logger=require(_0xb275('0x1'))('api');var moment=require(_0xb275('0x2'));var BPromise=require(_0xb275('0x3'));var rp=require(_0xb275('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb275('0x5'));var attributes=require(_0xb275('0x6'));module['exports']=function(_0x1c1ce3,_0xe6ebfe){return _0x1c1ce3[_0xb275('0x7')](_0xb275('0x8'),attributes,{'tableName':_0xb275('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d89=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1a80f2,_0x358d14){var _0x119a65=function(_0x5cc00b){while(--_0x5cc00b){_0x1a80f2['push'](_0x1a80f2['shift']());}};_0x119a65(++_0x358d14);}(_0x4d89,0xdd));var _0x94d8=function(_0x48bfeb,_0x4e3f39){_0x48bfeb=_0x48bfeb-0x0;var _0x316058=_0x4d89[_0x48bfeb];return _0x316058;};'use strict';var _=require(_0x94d8('0x0'));var util=require(_0x94d8('0x1'));var logger=require(_0x94d8('0x2'))(_0x94d8('0x3'));var moment=require(_0x94d8('0x4'));var BPromise=require(_0x94d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94d8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x94d8('0x7'));module[_0x94d8('0x8')]=function(_0x17e444,_0x262b60){return _0x17e444[_0x94d8('0x9')](_0x94d8('0xa'),attributes,{'tableName':_0x94d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 98eeaf2..e0a777c 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 _0x32ac=['model','map','ShowSmsAccount','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsAccount','find','options','raw','where','attributes','include'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x32ac,0x9b));var _0xc32a=function(_0x39fb9b,_0x270e0c){_0x39fb9b=_0x39fb9b-0x0;var _0x164194=_0x32ac[_0x39fb9b];return _0x164194;};'use strict';var _=require('lodash');var util=require(_0xc32a('0x0'));var moment=require(_0xc32a('0x1'));var BPromise=require(_0xc32a('0x2'));var rs=require(_0xc32a('0x3'));var fs=require('fs');var Redis=require(_0xc32a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc32a('0x5'))(_0xc32a('0x6'));var config=require(_0xc32a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc32a('0x8')][_0xc32a('0x9')]({'port':0x232a});config[_0xc32a('0xa')]=_[_0xc32a('0xb')](config[_0xc32a('0xa')],{'host':_0xc32a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc32a('0xa')]));require(_0xc32a('0xd'))[_0xc32a('0xe')](socket);function respondWithRpcPromise(_0x4813af,_0x126dcc,_0x11a816){return new BPromise(function(_0x148c9d,_0x5de2da){return client[_0xc32a('0xf')](_0x4813af,_0x11a816)[_0xc32a('0x10')](function(_0x122925){logger['info'](_0xc32a('0x11'),_0x126dcc,_0xc32a('0x12'));logger[_0xc32a('0x13')](_0xc32a('0x14'),_0x126dcc,_0xc32a('0x12'),JSON[_0xc32a('0x15')](_0x122925));if(_0x122925[_0xc32a('0x16')]){if(_0x122925[_0xc32a('0x16')][_0xc32a('0x17')]===0x1f4){logger[_0xc32a('0x16')](_0xc32a('0x11'),_0x126dcc,_0x122925[_0xc32a('0x16')]['message']);return _0x5de2da(_0x122925[_0xc32a('0x16')][_0xc32a('0x18')]);}logger[_0xc32a('0x16')](_0xc32a('0x11'),_0x126dcc,_0x122925[_0xc32a('0x16')][_0xc32a('0x18')]);return _0x148c9d(_0x122925['error'][_0xc32a('0x18')]);}else{logger[_0xc32a('0x19')]('SmsAccount,\x20%s,\x20%s',_0x126dcc,_0xc32a('0x12'));_0x148c9d(_0x122925[_0xc32a('0x1a')]['message']);}})[_0xc32a('0x1b')](function(_0x455e93){logger[_0xc32a('0x16')]('SmsAccount,\x20%s,\x20%s',_0x126dcc,_0x455e93);_0x5de2da(_0x455e93);});});}exports['ShowSmsAccount']=function(_0x2ee279){var _0x20fec1=this;return new Promise(function(_0xa35c05,_0x331ca2){return db[_0xc32a('0x1c')][_0xc32a('0x1d')]({'raw':_0x2ee279[_0xc32a('0x1e')]?_0x2ee279[_0xc32a('0x1e')][_0xc32a('0x1f')]===undefined?!![]:![]:!![],'where':_0x2ee279[_0xc32a('0x1e')]?_0x2ee279[_0xc32a('0x1e')][_0xc32a('0x20')]||null:null,'attributes':_0x2ee279[_0xc32a('0x1e')]?_0x2ee279[_0xc32a('0x1e')][_0xc32a('0x21')]||null:null,'include':_0x2ee279[_0xc32a('0x1e')]?_0x2ee279[_0xc32a('0x1e')][_0xc32a('0x22')]?_['map'](_0x2ee279[_0xc32a('0x1e')][_0xc32a('0x22')],function(_0x11f644){return{'model':db[_0x11f644[_0xc32a('0x23')]],'as':_0x11f644['as'],'attributes':_0x11f644[_0xc32a('0x21')],'include':_0x11f644[_0xc32a('0x22')]?_[_0xc32a('0x24')](_0x11f644['include'],function(_0x2c75f4){return{'model':db[_0x2c75f4[_0xc32a('0x23')]],'as':_0x2c75f4['as'],'attributes':_0x2c75f4[_0xc32a('0x21')],'include':_0x2c75f4[_0xc32a('0x22')]?_['map'](_0x2c75f4[_0xc32a('0x22')],function(_0x5568ac){return{'model':db[_0x5568ac[_0xc32a('0x23')]],'as':_0x5568ac['as'],'attributes':_0x5568ac[_0xc32a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc32a('0x10')](function(_0x235ca7){logger['info']('ShowSmsAccount',_0x2ee279);logger[_0xc32a('0x13')](_0xc32a('0x25'),_0x2ee279,JSON['stringify'](_0x235ca7));_0xa35c05(_0x235ca7);})[_0xc32a('0x1b')](function(_0x40488d){logger[_0xc32a('0x16')](_0xc32a('0x25'),_0x40488d[_0xc32a('0x18')],_0x2ee279);_0x331ca2(_0x20fec1['error'](0x1f4,_0x40488d[_0xc32a('0x18')]));});});}; \ No newline at end of file +var _0x6ff4=['include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','options','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6ff4,0x94));var _0x46ff=function(_0x2c1dd3,_0xe5f383){_0x2c1dd3=_0x2c1dd3-0x0;var _0x3ac491=_0x6ff4[_0x2c1dd3];return _0x3ac491;};'use strict';var _=require(_0x46ff('0x0'));var util=require(_0x46ff('0x1'));var moment=require(_0x46ff('0x2'));var BPromise=require(_0x46ff('0x3'));var rs=require(_0x46ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46ff('0x5'))['db'];var utils=require(_0x46ff('0x6'));var logger=require('../../config/logger')(_0x46ff('0x7'));var config=require(_0x46ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46ff('0x9')][_0x46ff('0xa')]({'port':0x232a});config['redis']=_[_0x46ff('0xb')](config[_0x46ff('0xc')],{'host':_0x46ff('0xd'),'port':0x18eb});var socket=require(_0x46ff('0xe'))(new Redis(config[_0x46ff('0xc')]));require(_0x46ff('0xf'))[_0x46ff('0x10')](socket);function respondWithRpcPromise(_0x476545,_0x100b4a,_0x34151f){return new BPromise(function(_0x58f8d7,_0x3681dd){return client[_0x46ff('0x11')](_0x476545,_0x34151f)['then'](function(_0x559c92){logger['info'](_0x46ff('0x12'),_0x100b4a,_0x46ff('0x13'));logger[_0x46ff('0x14')](_0x46ff('0x15'),_0x100b4a,_0x46ff('0x13'),JSON[_0x46ff('0x16')](_0x559c92));if(_0x559c92[_0x46ff('0x17')]){if(_0x559c92['error'][_0x46ff('0x18')]===0x1f4){logger[_0x46ff('0x17')](_0x46ff('0x12'),_0x100b4a,_0x559c92[_0x46ff('0x17')][_0x46ff('0x19')]);return _0x3681dd(_0x559c92['error'][_0x46ff('0x19')]);}logger[_0x46ff('0x17')](_0x46ff('0x12'),_0x100b4a,_0x559c92['error'][_0x46ff('0x19')]);return _0x58f8d7(_0x559c92[_0x46ff('0x17')][_0x46ff('0x19')]);}else{logger[_0x46ff('0x1a')](_0x46ff('0x12'),_0x100b4a,_0x46ff('0x13'));_0x58f8d7(_0x559c92['result'][_0x46ff('0x19')]);}})[_0x46ff('0x1b')](function(_0x5cd902){logger[_0x46ff('0x17')](_0x46ff('0x12'),_0x100b4a,_0x5cd902);_0x3681dd(_0x5cd902);});});}exports[_0x46ff('0x1c')]=function(_0x25224c){var _0x419d74=this;return new Promise(function(_0x21b3e6,_0x39489e){return db[_0x46ff('0x1d')]['find']({'raw':_0x25224c[_0x46ff('0x1e')]?_0x25224c[_0x46ff('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x25224c[_0x46ff('0x1e')]?_0x25224c[_0x46ff('0x1e')][_0x46ff('0x1f')]||null:null,'attributes':_0x25224c[_0x46ff('0x1e')]?_0x25224c[_0x46ff('0x1e')]['attributes']||null:null,'include':_0x25224c['options']?_0x25224c[_0x46ff('0x1e')][_0x46ff('0x20')]?_[_0x46ff('0x21')](_0x25224c[_0x46ff('0x1e')][_0x46ff('0x20')],function(_0x493e00){return{'model':db[_0x493e00[_0x46ff('0x22')]],'as':_0x493e00['as'],'attributes':_0x493e00[_0x46ff('0x23')],'include':_0x493e00['include']?_['map'](_0x493e00[_0x46ff('0x20')],function(_0x253b0e){return{'model':db[_0x253b0e[_0x46ff('0x22')]],'as':_0x253b0e['as'],'attributes':_0x253b0e['attributes'],'include':_0x253b0e[_0x46ff('0x20')]?_[_0x46ff('0x21')](_0x253b0e[_0x46ff('0x20')],function(_0x56b16c){return{'model':db[_0x56b16c['model']],'as':_0x56b16c['as'],'attributes':_0x56b16c[_0x46ff('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x502128){logger[_0x46ff('0x1a')]('ShowSmsAccount',_0x25224c);logger[_0x46ff('0x14')](_0x46ff('0x1c'),_0x25224c,JSON[_0x46ff('0x16')](_0x502128));_0x21b3e6(_0x502128);})['catch'](function(_0x4e5599){logger[_0x46ff('0x17')](_0x46ff('0x1c'),_0x4e5599[_0x46ff('0x19')],_0x25224c);_0x39489e(_0x419d74[_0x46ff('0x17')](0x1f4,_0x4e5599['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 06f32e6..2bbc6af 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 b411a73..d05a657 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x577c27,_0xb2403c){var _0xeaaf80=function(_0x352b18){while(--_0x352b18){_0x577c27['push'](_0x577c27['shift']());}};_0xeaaf80(++_0xb2403c);}(_0x7217,0x19e));var _0x7721=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7217[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 8033289..42e76b6 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 _0x7039=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x445a7d,_0x461764){var _0x35a490=function(_0x23023d){while(--_0x23023d){_0x445a7d['push'](_0x445a7d['shift']());}};_0x35a490(++_0x461764);}(_0x7039,0xfd));var _0x9703=function(_0x4dd7bb,_0x294ce5){_0x4dd7bb=_0x4dd7bb-0x0;var _0xb3bccf=_0x7039[_0x4dd7bb];return _0xb3bccf;};'use strict';var Sequelize=require(_0x9703('0x0'));module[_0x9703('0x1')]={'priority':{'type':Sequelize[_0x9703('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9703('0x3')],'allowNull':![],'defaultValue':_0x9703('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9703('0x3')]},'interval':{'type':Sequelize[_0x9703('0x3')],'defaultValue':_0x9703('0x5')}}; \ No newline at end of file +var _0x6868=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x6868,0x131));var _0x8686=function(_0x2d40ba,_0x245636){_0x2d40ba=_0x2d40ba-0x0;var _0x24c864=_0x6868[_0x2d40ba];return _0x24c864;};'use strict';var Sequelize=require(_0x8686('0x0'));module[_0x8686('0x1')]={'priority':{'type':Sequelize[_0x8686('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8686('0x3')],'allowNull':![],'defaultValue':_0x8686('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8686('0x3')]},'interval':{'type':Sequelize[_0x8686('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 8ea66d8..1509777 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 _0x2df4=['order','sort','pick','merge','VIRTUAL','options','where','includeAll','rows','catch','show','params','filters','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x5b0ba1,_0x54314d){var _0x4b9588=function(_0x2526ef){while(--_0x2526ef){_0x5b0ba1['push'](_0x5b0ba1['shift']());}};_0x4b9588(++_0x54314d);}(_0x2df4,0x1d9));var _0x42df=function(_0x64f59a,_0x549247){_0x64f59a=_0x64f59a-0x0;var _0x54ff1d=_0x2df4[_0x64f59a];return _0x54ff1d;};'use strict';var emlformat=require(_0x42df('0x0'));var rimraf=require(_0x42df('0x1'));var zipdir=require(_0x42df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42df('0x3'));var moment=require('moment');var BPromise=require(_0x42df('0x4'));var Mustache=require('mustache');var util=require(_0x42df('0x5'));var path=require('path');var sox=require(_0x42df('0x6'));var csv=require(_0x42df('0x7'));var ejs=require(_0x42df('0x8'));var fs=require('fs');var fs_extra=require(_0x42df('0x9'));var _=require(_0x42df('0xa'));var squel=require(_0x42df('0xb'));var crypto=require(_0x42df('0xc'));var jsforce=require(_0x42df('0xd'));var deskjs=require(_0x42df('0xe'));var toCsv=require('to-csv');var querystring=require(_0x42df('0xf'));var Papa=require(_0x42df('0x10'));var Redis=require(_0x42df('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x42df('0x12'));var as=require(_0x42df('0x13'));var hardwareService=require(_0x42df('0x14'));var logger=require(_0x42df('0x15'))(_0x42df('0x16'));var utils=require(_0x42df('0x17'));var config=require(_0x42df('0x18'));var licenseUtil=require(_0x42df('0x19'));var db=require(_0x42df('0x1a'))['db'];function respondWithStatusCode(_0x5a5ccc,_0x2151c7){_0x2151c7=_0x2151c7||0xcc;return function(_0x5d082d){if(_0x5d082d){return _0x5a5ccc[_0x42df('0x1b')](_0x2151c7);}return _0x5a5ccc[_0x42df('0x1c')](_0x2151c7)[_0x42df('0x1d')]();};}function respondWithResult(_0x1a23b9,_0x550690){_0x550690=_0x550690||0xc8;return function(_0x570081){if(_0x570081){return _0x1a23b9['status'](_0x550690)['json'](_0x570081);}};}function respondWithFilteredResult(_0x1e0872,_0x44716b){return function(_0x1d8276){if(_0x1d8276){var _0x55a18e=typeof _0x44716b[_0x42df('0x1e')]===_0x42df('0x1f')&&typeof _0x44716b[_0x42df('0x20')]===_0x42df('0x1f');var _0x410593=_0x1d8276['count'];var _0x3f0291=_0x55a18e?0x0:_0x44716b[_0x42df('0x1e')];var _0x102d64=_0x55a18e?_0x1d8276[_0x42df('0x21')]:_0x44716b[_0x42df('0x1e')]+_0x44716b[_0x42df('0x20')];var _0x458a98;if(_0x102d64>=_0x410593){_0x102d64=_0x410593;_0x458a98=0xc8;}else{_0x458a98=0xce;}_0x1e0872['status'](_0x458a98);return _0x1e0872[_0x42df('0x22')](_0x42df('0x23'),_0x3f0291+'-'+_0x102d64+'/'+_0x410593)['json'](_0x1d8276);}return null;};}function patchUpdates(_0xf872b3){return function(_0x13c650){try{jsonpatch['apply'](_0x13c650,_0xf872b3,!![]);}catch(_0x8aa191){return BPromise[_0x42df('0x24')](_0x8aa191);}return _0x13c650[_0x42df('0x25')]();};}function saveUpdates(_0x520729,_0x26521a){return function(_0x2fc7ea){if(_0x2fc7ea){return _0x2fc7ea['update'](_0x520729)[_0x42df('0x26')](function(_0x175504){return _0x175504;});}return null;};}function removeEntity(_0x20ee45,_0x2aad64){return function(_0x42127c){if(_0x42127c){return _0x42127c[_0x42df('0x27')]()[_0x42df('0x26')](function(){_0x20ee45[_0x42df('0x1c')](0xcc)[_0x42df('0x1d')]();});}};}function handleEntityNotFound(_0x42981b,_0x1c2d41){return function(_0x454aa3){if(!_0x454aa3){_0x42981b[_0x42df('0x1b')](0x194);}return _0x454aa3;};}function handleError(_0x5beab2,_0x25f6e7){_0x25f6e7=_0x25f6e7||0x1f4;return function(_0x4b9f31){logger[_0x42df('0x28')](_0x4b9f31[_0x42df('0x29')]);if(_0x4b9f31[_0x42df('0x2a')]){delete _0x4b9f31[_0x42df('0x2a')];}_0x5beab2[_0x42df('0x1c')](_0x25f6e7)[_0x42df('0x2b')](_0x4b9f31);};}exports[_0x42df('0x2c')]=function(_0x1398c9,_0x47f87b){var _0x5cb789={},_0x354709={},_0x4ce87f={'count':0x0,'rows':[]};var _0x809f96=_['map'](db[_0x42df('0x2d')][_0x42df('0x2e')],function(_0x37a61a){return{'name':_0x37a61a[_0x42df('0x2f')],'type':_0x37a61a[_0x42df('0x30')][_0x42df('0x31')]};});_0x354709[_0x42df('0x32')]=_[_0x42df('0x33')](_0x809f96,_0x42df('0x2a'));_0x354709['query']=_[_0x42df('0x34')](_0x1398c9[_0x42df('0x35')]);_0x354709['filters']=_[_0x42df('0x36')](_0x354709[_0x42df('0x32')],_0x354709[_0x42df('0x35')]);_0x5cb789[_0x42df('0x37')]=_[_0x42df('0x36')](_0x354709[_0x42df('0x32')],qs['fields'](_0x1398c9[_0x42df('0x35')][_0x42df('0x38')]));_0x5cb789[_0x42df('0x37')]=_0x5cb789[_0x42df('0x37')][_0x42df('0x39')]?_0x5cb789[_0x42df('0x37')]:_0x354709[_0x42df('0x32')];if(!_0x1398c9[_0x42df('0x35')][_0x42df('0x3a')]('nolimit')){_0x5cb789[_0x42df('0x20')]=qs[_0x42df('0x20')](_0x1398c9['query']['limit']);_0x5cb789[_0x42df('0x1e')]=qs[_0x42df('0x1e')](_0x1398c9['query'][_0x42df('0x1e')]);}_0x5cb789[_0x42df('0x3b')]=qs['sort'](_0x1398c9[_0x42df('0x35')][_0x42df('0x3c')]);_0x5cb789['where']=qs['filters'](_[_0x42df('0x3d')](_0x1398c9[_0x42df('0x35')],_0x354709['filters']),_0x809f96);if(_0x1398c9[_0x42df('0x35')]['filter']){_0x5cb789['where']=_[_0x42df('0x3e')](_0x5cb789['where'],{'$or':_[_0x42df('0x33')](_0x809f96,function(_0x211911){if(_0x211911['type']!==_0x42df('0x3f')){var _0x1664dc={};_0x1664dc[_0x211911[_0x42df('0x2a')]]={'$like':'%'+_0x1398c9[_0x42df('0x35')]['filter']+'%'};return _0x1664dc;}})});}_0x5cb789=_[_0x42df('0x3e')]({},_0x5cb789,_0x1398c9[_0x42df('0x40')]);var _0x481aa6={'where':_0x5cb789[_0x42df('0x41')]};return db[_0x42df('0x2d')][_0x42df('0x21')](_0x481aa6)['then'](function(_0x396d7a){_0x4ce87f['count']=_0x396d7a;if(_0x1398c9['query'][_0x42df('0x42')]){_0x5cb789['include']=[{'all':!![]}];}return db[_0x42df('0x2d')]['findAll'](_0x5cb789);})[_0x42df('0x26')](function(_0x14a223){_0x4ce87f[_0x42df('0x43')]=_0x14a223;return _0x4ce87f;})['then'](respondWithFilteredResult(_0x47f87b,_0x5cb789))[_0x42df('0x44')](handleError(_0x47f87b,null));};exports[_0x42df('0x45')]=function(_0xbc888c,_0x551ae4){var _0x429e67={'raw':!![],'where':{'id':_0xbc888c[_0x42df('0x46')]['id']}},_0x20105a={};_0x20105a[_0x42df('0x32')]=_[_0x42df('0x34')](db['SmsApplication'][_0x42df('0x2e')]);_0x20105a[_0x42df('0x35')]=_[_0x42df('0x34')](_0xbc888c[_0x42df('0x35')]);_0x20105a[_0x42df('0x47')]=_[_0x42df('0x36')](_0x20105a[_0x42df('0x32')],_0x20105a['query']);_0x429e67[_0x42df('0x37')]=_[_0x42df('0x36')](_0x20105a[_0x42df('0x32')],qs[_0x42df('0x38')](_0xbc888c[_0x42df('0x35')][_0x42df('0x38')]));_0x429e67[_0x42df('0x37')]=_0x429e67[_0x42df('0x37')][_0x42df('0x39')]?_0x429e67['attributes']:_0x20105a['model'];if(_0xbc888c['query'][_0x42df('0x42')]){_0x429e67[_0x42df('0x48')]=[{'all':!![]}];}_0x429e67=_['merge']({},_0x429e67,_0xbc888c[_0x42df('0x40')]);return db['SmsApplication'][_0x42df('0x49')](_0x429e67)[_0x42df('0x26')](handleEntityNotFound(_0x551ae4,null))[_0x42df('0x26')](respondWithResult(_0x551ae4,null))[_0x42df('0x44')](handleError(_0x551ae4,null));};exports[_0x42df('0x4a')]=function(_0x5dd8d7,_0x14ea76){return db['SmsApplication'][_0x42df('0x4a')](_0x5dd8d7['body'],{})[_0x42df('0x26')](respondWithResult(_0x14ea76,0xc9))['catch'](handleError(_0x14ea76,null));};exports['update']=function(_0x5174da,_0x31fb72){if(_0x5174da[_0x42df('0x4b')]['id']){delete _0x5174da[_0x42df('0x4b')]['id'];}return db['SmsApplication'][_0x42df('0x49')]({'where':{'id':_0x5174da[_0x42df('0x46')]['id']}})['then'](handleEntityNotFound(_0x31fb72,null))[_0x42df('0x26')](saveUpdates(_0x5174da[_0x42df('0x4b')],null))[_0x42df('0x26')](respondWithResult(_0x31fb72,null))[_0x42df('0x44')](handleError(_0x31fb72,null));};exports[_0x42df('0x27')]=function(_0x4fa4b1,_0x2a2a22){return db['SmsApplication'][_0x42df('0x49')]({'where':{'id':_0x4fa4b1[_0x42df('0x46')]['id']}})[_0x42df('0x26')](handleEntityNotFound(_0x2a2a22,null))[_0x42df('0x26')](removeEntity(_0x2a2a22,null))[_0x42df('0x44')](handleError(_0x2a2a22,null));}; \ No newline at end of file +var _0x0998=['end','error','stack','name','send','index','SmsApplication','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','include','rows','params','rawAttributes','includeAll','find','create','body','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','then','destroy'];(function(_0x1a7ca9,_0x1d026b){var _0x1a9241=function(_0x51da72){while(--_0x51da72){_0x1a7ca9['push'](_0x1a7ca9['shift']());}};_0x1a9241(++_0x1d026b);}(_0x0998,0x14a));var _0x8099=function(_0x2316dd,_0x568eaf){_0x2316dd=_0x2316dd-0x0;var _0x4a0dfe=_0x0998[_0x2316dd];return _0x4a0dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8099('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8099('0x1'));var rp=require('request-promise');var moment=require(_0x8099('0x2'));var BPromise=require(_0x8099('0x3'));var Mustache=require(_0x8099('0x4'));var util=require(_0x8099('0x5'));var path=require('path');var sox=require(_0x8099('0x6'));var csv=require(_0x8099('0x7'));var ejs=require(_0x8099('0x8'));var fs=require('fs');var fs_extra=require(_0x8099('0x9'));var _=require(_0x8099('0xa'));var squel=require(_0x8099('0xb'));var crypto=require(_0x8099('0xc'));var jsforce=require(_0x8099('0xd'));var deskjs=require(_0x8099('0xe'));var toCsv=require(_0x8099('0x7'));var querystring=require('querystring');var Papa=require(_0x8099('0xf'));var Redis=require(_0x8099('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8099('0x11'));var hardwareService=require(_0x8099('0x12'));var logger=require(_0x8099('0x13'))('api');var utils=require(_0x8099('0x14'));var config=require(_0x8099('0x15'));var licenseUtil=require(_0x8099('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1744ad,_0x6a4303){_0x6a4303=_0x6a4303||0xcc;return function(_0xbf8ecb){if(_0xbf8ecb){return _0x1744ad[_0x8099('0x17')](_0x6a4303);}return _0x1744ad[_0x8099('0x18')](_0x6a4303)['end']();};}function respondWithResult(_0x52fa4d,_0x4645ba){_0x4645ba=_0x4645ba||0xc8;return function(_0x16031b){if(_0x16031b){return _0x52fa4d[_0x8099('0x18')](_0x4645ba)['json'](_0x16031b);}};}function respondWithFilteredResult(_0x1449b9,_0x12707d){return function(_0x74224c){if(_0x74224c){var _0xe50b13=typeof _0x12707d[_0x8099('0x19')]==='undefined'&&typeof _0x12707d['limit']===_0x8099('0x1a');var _0x19374b=_0x74224c[_0x8099('0x1b')];var _0x163cc0=_0xe50b13?0x0:_0x12707d[_0x8099('0x19')];var _0x54aec6=_0xe50b13?_0x74224c[_0x8099('0x1b')]:_0x12707d['offset']+_0x12707d['limit'];var _0x12712d;if(_0x54aec6>=_0x19374b){_0x54aec6=_0x19374b;_0x12712d=0xc8;}else{_0x12712d=0xce;}_0x1449b9[_0x8099('0x18')](_0x12712d);return _0x1449b9[_0x8099('0x1c')]('Content-Range',_0x163cc0+'-'+_0x54aec6+'/'+_0x19374b)[_0x8099('0x1d')](_0x74224c);}return null;};}function patchUpdates(_0x227e1f){return function(_0x22c4e0){try{jsonpatch[_0x8099('0x1e')](_0x22c4e0,_0x227e1f,!![]);}catch(_0x48bbd7){return BPromise[_0x8099('0x1f')](_0x48bbd7);}return _0x22c4e0[_0x8099('0x20')]();};}function saveUpdates(_0x3f1dc4,_0x5837ab){return function(_0x3abc87){if(_0x3abc87){return _0x3abc87['update'](_0x3f1dc4)[_0x8099('0x21')](function(_0x272408){return _0x272408;});}return null;};}function removeEntity(_0x17a31f,_0x350734){return function(_0x392c02){if(_0x392c02){return _0x392c02[_0x8099('0x22')]()[_0x8099('0x21')](function(){_0x17a31f['status'](0xcc)[_0x8099('0x23')]();});}};}function handleEntityNotFound(_0x3c83de,_0x313fa7){return function(_0x7084ae){if(!_0x7084ae){_0x3c83de['sendStatus'](0x194);}return _0x7084ae;};}function handleError(_0x5d5a3b,_0x4caaac){_0x4caaac=_0x4caaac||0x1f4;return function(_0x86078c){logger[_0x8099('0x24')](_0x86078c[_0x8099('0x25')]);if(_0x86078c[_0x8099('0x26')]){delete _0x86078c[_0x8099('0x26')];}_0x5d5a3b[_0x8099('0x18')](_0x4caaac)[_0x8099('0x27')](_0x86078c);};}exports[_0x8099('0x28')]=function(_0x37c948,_0x13bcb0){var _0x378543={},_0x2e8d1b={},_0x4b89db={'count':0x0,'rows':[]};var _0x1b052f=_['map'](db[_0x8099('0x29')]['rawAttributes'],function(_0x36865f){return{'name':_0x36865f[_0x8099('0x2a')],'type':_0x36865f[_0x8099('0x2b')][_0x8099('0x2c')]};});_0x2e8d1b[_0x8099('0x2d')]=_[_0x8099('0x2e')](_0x1b052f,'name');_0x2e8d1b[_0x8099('0x2f')]=_[_0x8099('0x30')](_0x37c948[_0x8099('0x2f')]);_0x2e8d1b['filters']=_[_0x8099('0x31')](_0x2e8d1b[_0x8099('0x2d')],_0x2e8d1b[_0x8099('0x2f')]);_0x378543[_0x8099('0x32')]=_['intersection'](_0x2e8d1b[_0x8099('0x2d')],qs[_0x8099('0x33')](_0x37c948['query']['fields']));_0x378543[_0x8099('0x32')]=_0x378543['attributes'][_0x8099('0x34')]?_0x378543[_0x8099('0x32')]:_0x2e8d1b[_0x8099('0x2d')];if(!_0x37c948[_0x8099('0x2f')][_0x8099('0x35')](_0x8099('0x36'))){_0x378543['limit']=qs[_0x8099('0x37')](_0x37c948[_0x8099('0x2f')]['limit']);_0x378543[_0x8099('0x19')]=qs['offset'](_0x37c948['query']['offset']);}_0x378543[_0x8099('0x38')]=qs[_0x8099('0x39')](_0x37c948[_0x8099('0x2f')][_0x8099('0x39')]);_0x378543[_0x8099('0x3a')]=qs[_0x8099('0x3b')](_[_0x8099('0x3c')](_0x37c948[_0x8099('0x2f')],_0x2e8d1b[_0x8099('0x3b')]),_0x1b052f);if(_0x37c948['query']['filter']){_0x378543[_0x8099('0x3a')]=_[_0x8099('0x3d')](_0x378543[_0x8099('0x3a')],{'$or':_['map'](_0x1b052f,function(_0x12170f){if(_0x12170f[_0x8099('0x2b')]!==_0x8099('0x3e')){var _0x4277ad={};_0x4277ad[_0x12170f[_0x8099('0x26')]]={'$like':'%'+_0x37c948[_0x8099('0x2f')]['filter']+'%'};return _0x4277ad;}})});}_0x378543=_['merge']({},_0x378543,_0x37c948[_0x8099('0x3f')]);var _0x5a019a={'where':_0x378543[_0x8099('0x3a')]};return db[_0x8099('0x29')][_0x8099('0x1b')](_0x5a019a)['then'](function(_0x255287){_0x4b89db[_0x8099('0x1b')]=_0x255287;if(_0x37c948[_0x8099('0x2f')]['includeAll']){_0x378543[_0x8099('0x40')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x378543);})['then'](function(_0x25c6b8){_0x4b89db[_0x8099('0x41')]=_0x25c6b8;return _0x4b89db;})['then'](respondWithFilteredResult(_0x13bcb0,_0x378543))['catch'](handleError(_0x13bcb0,null));};exports['show']=function(_0x59bf9d,_0x580154){var _0x394a57={'raw':!![],'where':{'id':_0x59bf9d[_0x8099('0x42')]['id']}},_0x52c67d={};_0x52c67d[_0x8099('0x2d')]=_[_0x8099('0x30')](db[_0x8099('0x29')][_0x8099('0x43')]);_0x52c67d[_0x8099('0x2f')]=_[_0x8099('0x30')](_0x59bf9d[_0x8099('0x2f')]);_0x52c67d[_0x8099('0x3b')]=_[_0x8099('0x31')](_0x52c67d[_0x8099('0x2d')],_0x52c67d['query']);_0x394a57[_0x8099('0x32')]=_[_0x8099('0x31')](_0x52c67d[_0x8099('0x2d')],qs[_0x8099('0x33')](_0x59bf9d[_0x8099('0x2f')][_0x8099('0x33')]));_0x394a57[_0x8099('0x32')]=_0x394a57[_0x8099('0x32')][_0x8099('0x34')]?_0x394a57[_0x8099('0x32')]:_0x52c67d[_0x8099('0x2d')];if(_0x59bf9d[_0x8099('0x2f')][_0x8099('0x44')]){_0x394a57[_0x8099('0x40')]=[{'all':!![]}];}_0x394a57=_['merge']({},_0x394a57,_0x59bf9d[_0x8099('0x3f')]);return db[_0x8099('0x29')][_0x8099('0x45')](_0x394a57)['then'](handleEntityNotFound(_0x580154,null))[_0x8099('0x21')](respondWithResult(_0x580154,null))['catch'](handleError(_0x580154,null));};exports[_0x8099('0x46')]=function(_0x13b79f,_0x324991){return db[_0x8099('0x29')][_0x8099('0x46')](_0x13b79f[_0x8099('0x47')],{})[_0x8099('0x21')](respondWithResult(_0x324991,0xc9))['catch'](handleError(_0x324991,null));};exports['update']=function(_0x29ff3b,_0x3f6048){if(_0x29ff3b[_0x8099('0x47')]['id']){delete _0x29ff3b[_0x8099('0x47')]['id'];}return db[_0x8099('0x29')][_0x8099('0x45')]({'where':{'id':_0x29ff3b['params']['id']}})[_0x8099('0x21')](handleEntityNotFound(_0x3f6048,null))['then'](saveUpdates(_0x29ff3b[_0x8099('0x47')],null))['then'](respondWithResult(_0x3f6048,null))['catch'](handleError(_0x3f6048,null));};exports[_0x8099('0x22')]=function(_0x4c5138,_0x257b51){return db[_0x8099('0x29')]['find']({'where':{'id':_0x4c5138[_0x8099('0x42')]['id']}})[_0x8099('0x21')](handleEntityNotFound(_0x257b51,null))[_0x8099('0x21')](removeEntity(_0x257b51,null))[_0x8099('0x48')](handleError(_0x257b51,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 283ae53..c332f58 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 _0xd3f3=['path','rimraf','../../config/environment','exports','SmsApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x598502,_0x497165){var _0x4e14b9=function(_0x2ad6db){while(--_0x2ad6db){_0x598502['push'](_0x598502['shift']());}};_0x4e14b9(++_0x497165);}(_0xd3f3,0x72));var _0x3d3f=function(_0x28309d,_0x30211e){_0x28309d=_0x28309d-0x0;var _0x353add=_0xd3f3[_0x28309d];return _0x353add;};'use strict';var _=require(_0x3d3f('0x0'));var util=require(_0x3d3f('0x1'));var logger=require(_0x3d3f('0x2'))(_0x3d3f('0x3'));var moment=require(_0x3d3f('0x4'));var BPromise=require(_0x3d3f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d3f('0x6'));var rimraf=require(_0x3d3f('0x7'));var config=require(_0x3d3f('0x8'));var attributes=require('./smsApplication.attributes');module[_0x3d3f('0x9')]=function(_0x4b0219,_0x37ecae){return _0x4b0219['define'](_0x3d3f('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d3f('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8bc5=['SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define'];(function(_0xb60cb3,_0x2b08bf){var _0x354f54=function(_0x3434ca){while(--_0x3434ca){_0xb60cb3['push'](_0xb60cb3['shift']());}};_0x354f54(++_0x2b08bf);}(_0x8bc5,0xab));var _0x58bc=function(_0x2a0c3b,_0x598f3a){_0x2a0c3b=_0x2a0c3b-0x0;var _0x37435f=_0x8bc5[_0x2a0c3b];return _0x37435f;};'use strict';var _=require(_0x58bc('0x0'));var util=require(_0x58bc('0x1'));var logger=require(_0x58bc('0x2'))(_0x58bc('0x3'));var moment=require(_0x58bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x58bc('0x5'));var fs=require('fs');var path=require(_0x58bc('0x6'));var rimraf=require(_0x58bc('0x7'));var config=require(_0x58bc('0x8'));var attributes=require(_0x58bc('0x9'));module['exports']=function(_0x183016,_0x14fc57){return _0x183016[_0x58bc('0xa')](_0x58bc('0xb'),attributes,{'tableName':_0x58bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58bc('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index c9f5ff4..f4d5617 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 _0x75ea=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','SmsApplication,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75ea,0x7d));var _0xa75e=function(_0x44f9f3,_0x5b2fdc){_0x44f9f3=_0x44f9f3-0x0;var _0x4a69c1=_0x75ea[_0x44f9f3];return _0x4a69c1;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require('moment');var BPromise=require(_0xa75e('0x2'));var rs=require(_0xa75e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75e('0x4'))['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x9')][_0xa75e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f666f,_0x2c71ef,_0x148a23){return new BPromise(function(_0x31a28d,_0x351164){return client['request'](_0x1f666f,_0x148a23)['then'](function(_0x560baa){logger['info'](_0xa75e('0xb'),_0x2c71ef,'request\x20sent');logger[_0xa75e('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2c71ef,_0xa75e('0xd'),JSON[_0xa75e('0xe')](_0x560baa));if(_0x560baa['error']){if(_0x560baa[_0xa75e('0xf')][_0xa75e('0x10')]===0x1f4){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);return _0x351164(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}logger[_0xa75e('0xf')]('SmsApplication,\x20%s,\x20%s',_0x2c71ef,_0x560baa[_0xa75e('0xf')]['message']);return _0x31a28d(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}else{logger['info'](_0xa75e('0xb'),_0x2c71ef,_0xa75e('0xd'));_0x31a28d(_0x560baa[_0xa75e('0x12')]['message']);}})[_0xa75e('0x13')](function(_0x315fde){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x315fde);_0x351164(_0x315fde);});});} \ No newline at end of file +var _0x414f=['then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x414f,0x13f));var _0xf414=function(_0x1405c1,_0x532676){_0x1405c1=_0x1405c1-0x0;var _0x59aabc=_0x414f[_0x1405c1];return _0x59aabc;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdcdb,_0x34c4d0,_0x2306e5){return new BPromise(function(_0xad732,_0x5194e5){return client['request'](_0x4cdcdb,_0x2306e5)[_0xf414('0xb')](function(_0x2bbf01){logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));logger[_0xf414('0xf')](_0xf414('0x10'),_0x34c4d0,_0xf414('0xe'),JSON['stringify'](_0x2bbf01));if(_0x2bbf01['error']){if(_0x2bbf01[_0xf414('0x11')][_0xf414('0x12')]===0x1f4){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0x5194e5(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0xad732(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}else{logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));_0xad732(_0x2bbf01[_0xf414('0x14')][_0xf414('0x13')]);}})[_0xf414('0x15')](function(_0x483e29){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x483e29);_0x5194e5(_0x483e29);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b557c0b..53c8710 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 _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x4183c8,_0x447db1){var _0x2c7f46=function(_0x3d7236){while(--_0x3d7236){_0x4183c8['push'](_0x4183c8['shift']());}};_0x2c7f46(++_0x447db1);}(_0x3c81,0x102));var _0x13c8=function(_0x41823b,_0x13fe7a){_0x41823b=_0x41823b-0x0;var _0x614110=_0x3c81[_0x41823b];return _0x614110;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file +var _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x5707bb,_0x31e45a){var _0x3328ee=function(_0x5a2136){while(--_0x5a2136){_0x5707bb['push'](_0x5707bb['shift']());}};_0x3328ee(++_0x31e45a);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x4cf8[_0x5d9ceb];return _0x33ce82;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ef1f973..ff7856d 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 _0x98d8=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x489ff7,_0x4a75af){var _0x10ec29=function(_0x9c42d){while(--_0x9c42d){_0x489ff7['push'](_0x489ff7['shift']());}};_0x10ec29(++_0x4a75af);}(_0x98d8,0xce));var _0x898d=function(_0x5d8987,_0x14d054){_0x5d8987=_0x5d8987-0x0;var _0x2997eb=_0x98d8[_0x5d8987];return _0x2997eb;};'use strict';var Sequelize=require(_0x898d('0x0'));var moment=require(_0x898d('0x1'));module[_0x898d('0x2')]={'closed':{'type':Sequelize[_0x898d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x898d('0x4')]},'disposition':{'type':Sequelize[_0x898d('0x5')]},'secondDisposition':{'type':Sequelize[_0x898d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x898d('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x898d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x898d('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x898d('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5a3c=['STRING','ENUM','out','BOOLEAN','INTEGER','sequelize','moment','exports','DATE'];(function(_0xccbc23,_0xb234d){var _0x50e195=function(_0x3abc66){while(--_0x3abc66){_0xccbc23['push'](_0xccbc23['shift']());}};_0x50e195(++_0xb234d);}(_0x5a3c,0x176));var _0xc5a3=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x5a3c[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0xc5a3('0x0'));var moment=require(_0xc5a3('0x1'));module[_0xc5a3('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc5a3('0x3')]},'disposition':{'type':Sequelize[_0xc5a3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc5a3('0x4')]},'note':{'type':Sequelize[_0xc5a3('0x4')]},'phone':{'type':Sequelize[_0xc5a3('0x4')]},'read1stAt':{'type':Sequelize[_0xc5a3('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc5a3('0x5')]('in',_0xc5a3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc5a3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc5a3('0x5')]('in',_0xc5a3('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc5a3('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc5a3('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index e95676c..fd06de4 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 _0x6888=['N.A.','closed','closedAt','disposition','direction','out','User','System','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./smsInteraction.socket','sendStatus','end','json','offset','limit','count','status','set','Content-Range','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','findAll','sms','query','catch','params','keys','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','update','body','describe','addMessage','SmsMessage','ids','findOne','filters','nolimit','order','sort','pick','filter','where','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','color','emit','removeTags','unix','toString','join','root','server','transcript-%d-%s.zip','push','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','secret','read','Owner','get','Sms','Account'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6888,0x1e5));var _0x8688=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x6888[_0x82129b];return _0x2ae5dc;};'use strict';var rimraf=require(_0x8688('0x0'));var zipdir=require(_0x8688('0x1'));var moment=require(_0x8688('0x2'));var BPromise=require(_0x8688('0x3'));var util=require(_0x8688('0x4'));var path=require(_0x8688('0x5'));var ejs=require(_0x8688('0x6'));var fs=require('fs');var _=require(_0x8688('0x7'));var Redis=require(_0x8688('0x8'));var interaction=require(_0x8688('0x9'));var qs=require(_0x8688('0xa'));var pdf=require(_0x8688('0xb'));var logger=require(_0x8688('0xc'))('api');var config=require(_0x8688('0xd'));var db=require(_0x8688('0xe'))['db'];config[_0x8688('0xf')]=_['defaults'](config[_0x8688('0xf')],{'host':_0x8688('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8688('0xf')]));require(_0x8688('0x11'))['register'](socket);function respondWithStatusCode(_0x59bd25,_0x3c41a0){_0x3c41a0=_0x3c41a0||0xcc;return function(_0x2275f4){if(_0x2275f4){return _0x59bd25[_0x8688('0x12')](_0x3c41a0);}return _0x59bd25['status'](_0x3c41a0)[_0x8688('0x13')]();};}function respondWithResult(_0x56bd97,_0x5c3092){_0x5c3092=_0x5c3092||0xc8;return function(_0x4d3198){if(_0x4d3198){return _0x56bd97['status'](_0x5c3092)[_0x8688('0x14')](_0x4d3198);}};}function respondWithFilteredResult(_0x107be0,_0x55c87b){return function(_0x432162){if(_0x432162){var _0x1dd296=typeof _0x55c87b[_0x8688('0x15')]==='undefined'&&typeof _0x55c87b[_0x8688('0x16')]==='undefined';var _0x52503e=_0x432162[_0x8688('0x17')];var _0x51cb64=_0x1dd296?0x0:_0x55c87b[_0x8688('0x15')];var _0x2074ec=_0x1dd296?_0x432162[_0x8688('0x17')]:_0x55c87b['offset']+_0x55c87b[_0x8688('0x16')];var _0x651c4b;if(_0x2074ec>=_0x52503e){_0x2074ec=_0x52503e;_0x651c4b=0xc8;}else{_0x651c4b=0xce;}_0x107be0[_0x8688('0x18')](_0x651c4b);return _0x107be0[_0x8688('0x19')](_0x8688('0x1a'),_0x51cb64+'-'+_0x2074ec+'/'+_0x52503e)[_0x8688('0x14')](_0x432162);}return null;};}function saveUpdates(_0x31424b){return function(_0x886138){if(_0x886138){return _0x886138['update'](_0x31424b)[_0x8688('0x1b')](function(_0x602fc6){return _0x602fc6;});}return null;};}function removeEntity(_0xde781e){return function(_0x2517b0){if(_0x2517b0){return _0x2517b0[_0x8688('0x1c')]()[_0x8688('0x1b')](function(){_0xde781e[_0x8688('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd80296){return function(_0x5520fd){if(!_0x5520fd){_0xd80296[_0x8688('0x12')](0x194);}return _0x5520fd;};}function handleError(_0x46917b,_0x4d0fd5){_0x4d0fd5=_0x4d0fd5||0x1f4;return function(_0x501c09){logger[_0x8688('0x1d')](_0x501c09[_0x8688('0x1e')]);if(_0x501c09['name']){delete _0x501c09[_0x8688('0x1f')];}_0x46917b[_0x8688('0x18')](_0x4d0fd5)[_0x8688('0x20')](_0x501c09);};}exports[_0x8688('0x21')]=function(_0xcd435e,_0x1f5acd){var _0x3938a3={};var _0x4d0e91=_[_0x8688('0x22')](db[_0x8688('0x23')][_0x8688('0x24')],function(_0x26aa54){return{'name':_0x26aa54[_0x8688('0x25')],'type':_0x26aa54['type']['key']};});_0x3938a3=qs['getOptions'](_0x4d0e91,_0xcd435e);return interaction[_0x8688('0x26')](_0x8688('0x27'),_0xcd435e[_0x8688('0x28')],_0xcd435e['user'],_0x3938a3,_0x4d0e91)[_0x8688('0x1b')](respondWithFilteredResult(_0x1f5acd,_0x3938a3))[_0x8688('0x29')](handleError(_0x1f5acd,null));};exports['show']=function(_0x19ed5e,_0xdbbbbd){var _0x794d85={'raw':![],'where':{'id':_0x19ed5e[_0x8688('0x2a')]['id']}},_0x5e3404={};_0x5e3404['model']=_[_0x8688('0x2b')](db[_0x8688('0x23')]['rawAttributes']);_0x5e3404[_0x8688('0x28')]=_['keys'](_0x19ed5e[_0x8688('0x28')]);_0x5e3404['filters']=_[_0x8688('0x2c')](_0x5e3404[_0x8688('0x2d')],_0x5e3404[_0x8688('0x28')]);_0x794d85[_0x8688('0x2e')]=_['intersection'](_0x5e3404['model'],qs['fields'](_0x19ed5e[_0x8688('0x28')][_0x8688('0x2f')]));_0x794d85[_0x8688('0x2e')]=_0x794d85['attributes'][_0x8688('0x30')]?_0x794d85[_0x8688('0x2e')]:_0x5e3404['model'];if(_0x19ed5e[_0x8688('0x28')][_0x8688('0x31')]){_0x794d85[_0x8688('0x32')]=[{'all':!![]}];}_0x794d85=_[_0x8688('0x33')]({},_0x794d85,_0x19ed5e[_0x8688('0x34')]);return db[_0x8688('0x23')][_0x8688('0x35')](_0x794d85)[_0x8688('0x1b')](handleEntityNotFound(_0xdbbbbd,null))[_0x8688('0x1b')](respondWithResult(_0xdbbbbd,null))[_0x8688('0x29')](handleError(_0xdbbbbd,null));};exports[_0x8688('0x36')]=function(_0x42c33e,_0x401f1b){return db[_0x8688('0x23')]['create'](_0x42c33e['body'],{})['then'](respondWithResult(_0x401f1b,0xc9))[_0x8688('0x29')](handleError(_0x401f1b,null));};exports[_0x8688('0x37')]=function(_0x4c4727,_0x1506e1){if(_0x4c4727[_0x8688('0x38')]['id']){delete _0x4c4727[_0x8688('0x38')]['id'];}return db['SmsInteraction'][_0x8688('0x35')]({'where':{'id':_0x4c4727['params']['id']}})[_0x8688('0x1b')](handleEntityNotFound(_0x1506e1,null))[_0x8688('0x1b')](saveUpdates(_0x4c4727[_0x8688('0x38')],null))[_0x8688('0x1b')](respondWithResult(_0x1506e1,null))['catch'](handleError(_0x1506e1,null));};exports['destroy']=function(_0x1d66c2,_0x476f1c){return db['SmsInteraction']['find']({'where':{'id':_0x1d66c2['params']['id']}})['then'](handleEntityNotFound(_0x476f1c,null))[_0x8688('0x1b')](removeEntity(_0x476f1c,null))['catch'](handleError(_0x476f1c,null));};exports[_0x8688('0x39')]=function(_0xeed56,_0x315ba3){return db[_0x8688('0x23')][_0x8688('0x39')]()[_0x8688('0x1b')](respondWithResult(_0x315ba3,null))['catch'](handleError(_0x315ba3,null));};exports[_0x8688('0x3a')]=function(_0x3d7826,_0x238593){return db[_0x8688('0x3b')][_0x8688('0x35')]({'where':{'id':_0x3d7826[_0x8688('0x2a')]['id']}})['then'](handleEntityNotFound(_0x238593,null))[_0x8688('0x1b')](function(_0x497dc1){if(_0x497dc1){return _0x497dc1['addMessage'](_0x3d7826['body']['ids'],_['omit'](_0x3d7826['body'],[_0x8688('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x238593,null))[_0x8688('0x29')](handleError(_0x238593,null));};exports['getMessages']=function(_0x3cf6d0,_0x5700d6){var _0x1ecdb8={'raw':![],'where':{}};var _0x5f374a={};var _0x214327={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x8688('0x3d')]({'where':{'id':_0x3cf6d0[_0x8688('0x2a')]['id']}})[_0x8688('0x1b')](handleEntityNotFound(_0x5700d6,null))[_0x8688('0x1b')](function(_0x51021d){if(_0x51021d){_0x5f374a[_0x8688('0x2d')]=_['keys'](db['SmsMessage'][_0x8688('0x24')]);_0x5f374a[_0x8688('0x28')]=_['keys'](_0x3cf6d0[_0x8688('0x28')]);_0x5f374a[_0x8688('0x3e')]=_[_0x8688('0x2c')](_0x5f374a[_0x8688('0x2d')],_0x5f374a[_0x8688('0x28')]);_0x1ecdb8[_0x8688('0x2e')]=_[_0x8688('0x2c')](_0x5f374a[_0x8688('0x2d')],qs['fields'](_0x3cf6d0[_0x8688('0x28')][_0x8688('0x2f')]));_0x1ecdb8[_0x8688('0x2e')]=_0x1ecdb8[_0x8688('0x2e')][_0x8688('0x30')]?_0x1ecdb8['attributes']:_0x5f374a[_0x8688('0x2d')];if(!_0x3cf6d0[_0x8688('0x28')]['hasOwnProperty'](_0x8688('0x3f'))){_0x1ecdb8[_0x8688('0x16')]=qs[_0x8688('0x16')](_0x3cf6d0[_0x8688('0x28')][_0x8688('0x16')]);_0x1ecdb8[_0x8688('0x15')]=qs[_0x8688('0x15')](_0x3cf6d0[_0x8688('0x28')][_0x8688('0x15')]);}_0x1ecdb8[_0x8688('0x40')]=qs['sort'](_0x3cf6d0[_0x8688('0x28')][_0x8688('0x41')]);_0x1ecdb8['where']=qs[_0x8688('0x3e')](_[_0x8688('0x42')](_0x3cf6d0[_0x8688('0x28')],_0x5f374a[_0x8688('0x3e')]));_0x1ecdb8['where']['SmsInteractionId']=_0x51021d['id'];if(_0x3cf6d0[_0x8688('0x28')][_0x8688('0x43')]){_0x1ecdb8[_0x8688('0x44')]=_['merge'](_0x1ecdb8['where'],{'$or':_['map'](_0x1ecdb8[_0x8688('0x2e')],function(_0x399ce3){var _0x1a99f8={};_0x1a99f8[_0x399ce3]={'$like':'%'+_0x3cf6d0['query'][_0x8688('0x43')]+'%'};return _0x1a99f8;})});}if(_0x3cf6d0['query'][_0x8688('0x45')]){var _0x5a8690=_0x3cf6d0[_0x8688('0x28')][_0x8688('0x45')]['split'](',');var _0x4d7a90={};_0x4d7a90[_0x5a8690[0x0]]={'$gte':moment(_0x5a8690[0x1])[_0x8688('0x46')](_0x8688('0x47'))};_0x1ecdb8[_0x8688('0x44')]=_[_0x8688('0x33')](_0x1ecdb8[_0x8688('0x44')],_0x4d7a90);}_0x1ecdb8=_[_0x8688('0x33')]({},_0x1ecdb8,_0x3cf6d0['options']);return db['SmsMessage'][_0x8688('0x17')]({'where':_0x1ecdb8[_0x8688('0x44')]})[_0x8688('0x1b')](function(_0x3cef21){_0x214327[_0x8688('0x17')]=_0x3cef21;if(_0x3cf6d0[_0x8688('0x28')][_0x8688('0x31')]){_0x1ecdb8[_0x8688('0x32')]=[{'all':!![]}];}return db[_0x8688('0x3b')][_0x8688('0x26')](_0x1ecdb8);})[_0x8688('0x1b')](function(_0x4f0806){_0x214327[_0x8688('0x48')]=_0x4f0806;return _0x214327;});}})[_0x8688('0x1b')](respondWithFilteredResult(_0x5700d6,_0x1ecdb8))[_0x8688('0x29')](handleError(_0x5700d6,null));};exports[_0x8688('0x49')]=function(_0x1fc875,_0x12af19){return db[_0x8688('0x23')]['find']({'where':{'id':_0x1fc875[_0x8688('0x2a')]['id']}})[_0x8688('0x1b')](handleEntityNotFound(_0x12af19,null))[_0x8688('0x1b')](function(_0x35f4e7){if(_0x35f4e7){return _0x35f4e7[_0x8688('0x4a')](_0x1fc875[_0x8688('0x38')][_0x8688('0x3c')],_[_0x8688('0x4b')](_0x1fc875[_0x8688('0x38')],[_0x8688('0x3c'),'id'])||{})[_0x8688('0x4c')](function(){return db['Tag'][_0x8688('0x26')]({'attributes':['id',_0x8688('0x1f'),_0x8688('0x4d')],'where':{'id':_0x1fc875[_0x8688('0x38')][_0x8688('0x3c')]}});})[_0x8688('0x1b')](function(_0x6b9973){socket[_0x8688('0x4e')]('smsInteractionTags:save',{'id':Number(_0x1fc875['params']['id']),'tags':_0x6b9973||[]});return{'id':Number(_0x1fc875[_0x8688('0x2a')]['id']),'tags':_0x6b9973||[]};});}})['then'](respondWithResult(_0x12af19,null))[_0x8688('0x29')](handleError(_0x12af19,null));};exports[_0x8688('0x4f')]=function(_0x3fc869,_0xfa55ae){return db[_0x8688('0x23')][_0x8688('0x35')]({'where':{'id':_0x3fc869['params']['id']}})[_0x8688('0x1b')](handleEntityNotFound(_0xfa55ae,null))[_0x8688('0x1b')](function(_0x1830a2){if(_0x1830a2){return _0x1830a2[_0x8688('0x4f')](_0x3fc869[_0x8688('0x28')][_0x8688('0x3c')]);}})['then'](respondWithStatusCode(_0xfa55ae,null))['catch'](handleError(_0xfa55ae,null));};exports['download']=function(_0x27de6d,_0x5473dc){var _0x1af432=moment()[_0x8688('0x50')]()[_0x8688('0x51')]();var _0x328d10=path[_0x8688('0x52')](config[_0x8688('0x53')],_0x8688('0x54'),'files','tmp');var _0xcbe26d=path['join'](_0x328d10,_0x1af432);var _0xf6a5c=util[_0x8688('0x46')](_0x8688('0x55'),_0x27de6d['params']['id'],_0x1af432);var _0xba41f0=path[_0x8688('0x52')](_0x328d10,_0xf6a5c);var _0x5bbc22=[];_0x5bbc22[_0x8688('0x56')]({'model':db['User'],'as':'User','attributes':['id',_0x8688('0x57')],'raw':!![]});_0x5bbc22[_0x8688('0x56')]({'model':db[_0x8688('0x58')],'as':_0x8688('0x59'),'attributes':['id',_0x8688('0x5a'),_0x8688('0x5b')],'raw':!![]});var _0x736f24=[{'model':db['SmsMessage'],'as':_0x8688('0x5c'),'attributes':['id','body',_0x8688('0x5d'),'direction',_0x8688('0x5e'),_0x8688('0x5f')],'include':_0x5bbc22}];_0x736f24[_0x8688('0x56')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x8688('0x1f')]});_0x736f24['push']({'model':db['User'],'as':_0x8688('0x60'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x8688('0x35')]({'where':{'id':_0x27de6d[_0x8688('0x2a')]['id']},'include':_0x736f24})[_0x8688('0x1b')](handleEntityNotFound(_0x5473dc,null))[_0x8688('0x1b')](function(_0x335653){if(_0x335653){var _0x4aa96f=_0x335653[_0x8688('0x61')]({'plain':!![]});fs['mkdirSync'](_0xcbe26d);var _0x100266={'channel':_0x8688('0x62'),'account':_0x4aa96f[_0x8688('0x63')]['name'],'agent':_0x4aa96f[_0x8688('0x60')]?_0x4aa96f[_0x8688('0x60')][_0x8688('0x57')]:_0x8688('0x64'),'createdAt':moment(_0x4aa96f[_0x8688('0x5d')])[_0x8688('0x46')](_0x8688('0x47'))['toString'](),'closedAt':_0x4aa96f[_0x8688('0x65')]?moment(_0x4aa96f[_0x8688('0x66')])[_0x8688('0x46')](_0x8688('0x47'))[_0x8688('0x51')]():'','disposition':_0x4aa96f[_0x8688('0x67')],'messages':_(_0x4aa96f[_0x8688('0x5c')])[_0x8688('0x43')]({'secret':![]})[_0x8688('0x22')](function(_0x6e270c){return{'date':moment(_0x6e270c['createdAt'])[_0x8688('0x46')](_0x8688('0x47'))['toString'](),'sender':_0x6e270c[_0x8688('0x68')]===_0x8688('0x69')?_0x6e270c[_0x8688('0x6a')]?_0x6e270c[_0x8688('0x6a')][_0x8688('0x57')]:_0x8688('0x6b'):_0x6e270c['Contact'][_0x8688('0x5a')]+(_0x6e270c[_0x8688('0x59')][_0x8688('0x5b')]?'\x20'+_0x6e270c[_0x8688('0x59')]['lastName']:''),'body':_0x6e270c[_0x8688('0x38')],'direction':_0x6e270c[_0x8688('0x68')]===_0x8688('0x69')?'A':'C','secret':_0x6e270c[_0x8688('0x5e')],'read':_0x6e270c['read']};})['value']()};return ejs[_0x8688('0x6c')](path['join'](config[_0x8688('0x53')],_0x8688('0x54'),_0x8688('0x6d'),_0x8688('0x6e')),{'interaction':_0x100266})[_0x8688('0x1b')](function(_0x59dc93){var _0x16d3cc=path['join'](_0xcbe26d,_0x8688('0x6f')+_0x4aa96f['id']+'-'+_0x1af432+'.pdf');var _0x523889={'path':_0x16d3cc,'channel':'Sms','interactionId':_0x4aa96f['id']};return pdf[_0x8688('0x70')](_0x59dc93,_0x523889);})['then'](function(){return new BPromise(function(_0x3bb3d7,_0x357e76){zipdir(_0xcbe26d,{'saveTo':_0xba41f0},function(_0x108023,_0x20f887){if(_0x108023)return _0x357e76(_0x108023);return _0x3bb3d7(_0x20f887);});})[_0x8688('0x1b')](function(){return new BPromise(function(_0x3110d3,_0x3ea6fe){rimraf(_0xcbe26d,function(_0x546f02){if(_0x546f02)_0x3ea6fe(_0x546f02);return _0x3110d3();});});})[_0x8688('0x1b')](function(){return _0x5473dc[_0x8688('0x71')](_0xba41f0,_0xf6a5c,function(_0x5dfb9c){if(_0x5dfb9c){console[_0x8688('0x72')](_0x8688('0x73'),_0x5dfb9c);}else{fs[_0x8688('0x74')](_0xba41f0);}});});});}else{return _0x5473dc[_0x8688('0x12')](0xc8);}})[_0x8688('0x29')](handleError(_0x5473dc,null));}; \ No newline at end of file +var _0xf9b2=['destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','key','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','tmp','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Sms','Account','closed','closedAt','disposition','System','out','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then'];(function(_0x1988f1,_0x290a23){var _0x3c848e=function(_0x3600e7){while(--_0x3600e7){_0x1988f1['push'](_0x1988f1['shift']());}};_0x3c848e(++_0x290a23);}(_0xf9b2,0x1da));var _0x2f9b=function(_0x41a3e9,_0x6e1859){_0x41a3e9=_0x41a3e9-0x0;var _0x118c88=_0xf9b2[_0x41a3e9];return _0x118c88;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x2f9b('0x0'));var util=require(_0x2f9b('0x1'));var path=require(_0x2f9b('0x2'));var ejs=require(_0x2f9b('0x3'));var fs=require('fs');var _=require(_0x2f9b('0x4'));var Redis=require('ioredis');var interaction=require(_0x2f9b('0x5'));var qs=require(_0x2f9b('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x2f9b('0x7'));var config=require(_0x2f9b('0x8'));var db=require(_0x2f9b('0x9'))['db'];config[_0x2f9b('0xa')]=_[_0x2f9b('0xb')](config[_0x2f9b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f9b('0xc'))(new Redis(config['redis']));require(_0x2f9b('0xd'))[_0x2f9b('0xe')](socket);function respondWithStatusCode(_0x31ad34,_0x286f7f){_0x286f7f=_0x286f7f||0xcc;return function(_0x197a8b){if(_0x197a8b){return _0x31ad34[_0x2f9b('0xf')](_0x286f7f);}return _0x31ad34[_0x2f9b('0x10')](_0x286f7f)[_0x2f9b('0x11')]();};}function respondWithResult(_0x10bc0b,_0x5b873c){_0x5b873c=_0x5b873c||0xc8;return function(_0xe37f53){if(_0xe37f53){return _0x10bc0b[_0x2f9b('0x10')](_0x5b873c)[_0x2f9b('0x12')](_0xe37f53);}};}function respondWithFilteredResult(_0x34080e,_0x2936ce){return function(_0x1c7c70){if(_0x1c7c70){var _0x4ebc7b=typeof _0x2936ce[_0x2f9b('0x13')]==='undefined'&&typeof _0x2936ce['limit']===_0x2f9b('0x14');var _0x54dcc9=_0x1c7c70[_0x2f9b('0x15')];var _0x38ca40=_0x4ebc7b?0x0:_0x2936ce[_0x2f9b('0x13')];var _0x5425c1=_0x4ebc7b?_0x1c7c70[_0x2f9b('0x15')]:_0x2936ce[_0x2f9b('0x13')]+_0x2936ce[_0x2f9b('0x16')];var _0x4115f9;if(_0x5425c1>=_0x54dcc9){_0x5425c1=_0x54dcc9;_0x4115f9=0xc8;}else{_0x4115f9=0xce;}_0x34080e[_0x2f9b('0x10')](_0x4115f9);return _0x34080e['set'](_0x2f9b('0x17'),_0x38ca40+'-'+_0x5425c1+'/'+_0x54dcc9)[_0x2f9b('0x12')](_0x1c7c70);}return null;};}function saveUpdates(_0x14fbd3){return function(_0x46e3e0){if(_0x46e3e0){return _0x46e3e0[_0x2f9b('0x18')](_0x14fbd3)[_0x2f9b('0x19')](function(_0x423ea5){return _0x423ea5;});}return null;};}function removeEntity(_0x55a787){return function(_0x1ec994){if(_0x1ec994){return _0x1ec994[_0x2f9b('0x1a')]()['then'](function(){_0x55a787[_0x2f9b('0x10')](0xcc)[_0x2f9b('0x11')]();});}};}function handleEntityNotFound(_0x54902c){return function(_0x502273){if(!_0x502273){_0x54902c[_0x2f9b('0xf')](0x194);}return _0x502273;};}function handleError(_0x4bf3b0,_0x4c667d){_0x4c667d=_0x4c667d||0x1f4;return function(_0x5a7462){logger[_0x2f9b('0x1b')](_0x5a7462[_0x2f9b('0x1c')]);if(_0x5a7462[_0x2f9b('0x1d')]){delete _0x5a7462[_0x2f9b('0x1d')];}_0x4bf3b0[_0x2f9b('0x10')](_0x4c667d)[_0x2f9b('0x1e')](_0x5a7462);};}exports[_0x2f9b('0x1f')]=function(_0x4bd83e,_0x389dd0){var _0x2454fa={};var _0x7d06d4=_[_0x2f9b('0x20')](db[_0x2f9b('0x21')][_0x2f9b('0x22')],function(_0xa88d81){return{'name':_0xa88d81[_0x2f9b('0x23')],'type':_0xa88d81['type'][_0x2f9b('0x24')]};});_0x2454fa=qs['getOptions'](_0x7d06d4,_0x4bd83e);return interaction[_0x2f9b('0x25')](_0x2f9b('0x26'),_0x4bd83e[_0x2f9b('0x27')],_0x4bd83e[_0x2f9b('0x28')],_0x2454fa,_0x7d06d4)[_0x2f9b('0x19')](respondWithFilteredResult(_0x389dd0,_0x2454fa))[_0x2f9b('0x29')](handleError(_0x389dd0,null));};exports[_0x2f9b('0x2a')]=function(_0x14f0d1,_0x218854){var _0x1ce387={'raw':![],'where':{'id':_0x14f0d1[_0x2f9b('0x2b')]['id']}},_0x153ad5={};_0x153ad5[_0x2f9b('0x2c')]=_[_0x2f9b('0x2d')](db[_0x2f9b('0x21')][_0x2f9b('0x22')]);_0x153ad5[_0x2f9b('0x27')]=_['keys'](_0x14f0d1[_0x2f9b('0x27')]);_0x153ad5[_0x2f9b('0x2e')]=_[_0x2f9b('0x2f')](_0x153ad5[_0x2f9b('0x2c')],_0x153ad5[_0x2f9b('0x27')]);_0x1ce387['attributes']=_[_0x2f9b('0x2f')](_0x153ad5[_0x2f9b('0x2c')],qs[_0x2f9b('0x30')](_0x14f0d1['query'][_0x2f9b('0x30')]));_0x1ce387[_0x2f9b('0x31')]=_0x1ce387['attributes']['length']?_0x1ce387[_0x2f9b('0x31')]:_0x153ad5['model'];if(_0x14f0d1['query'][_0x2f9b('0x32')]){_0x1ce387[_0x2f9b('0x33')]=[{'all':!![]}];}_0x1ce387=_[_0x2f9b('0x34')]({},_0x1ce387,_0x14f0d1[_0x2f9b('0x35')]);return db[_0x2f9b('0x21')][_0x2f9b('0x36')](_0x1ce387)['then'](handleEntityNotFound(_0x218854,null))[_0x2f9b('0x19')](respondWithResult(_0x218854,null))['catch'](handleError(_0x218854,null));};exports[_0x2f9b('0x37')]=function(_0x17e067,_0x34bd3e){return db[_0x2f9b('0x21')]['create'](_0x17e067[_0x2f9b('0x38')],{})[_0x2f9b('0x19')](respondWithResult(_0x34bd3e,0xc9))[_0x2f9b('0x29')](handleError(_0x34bd3e,null));};exports[_0x2f9b('0x18')]=function(_0x538b6f,_0x1112f0){if(_0x538b6f[_0x2f9b('0x38')]['id']){delete _0x538b6f['body']['id'];}return db[_0x2f9b('0x21')][_0x2f9b('0x36')]({'where':{'id':_0x538b6f[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x1112f0,null))[_0x2f9b('0x19')](saveUpdates(_0x538b6f['body'],null))[_0x2f9b('0x19')](respondWithResult(_0x1112f0,null))[_0x2f9b('0x29')](handleError(_0x1112f0,null));};exports[_0x2f9b('0x1a')]=function(_0x33a637,_0x546413){return db[_0x2f9b('0x21')][_0x2f9b('0x36')]({'where':{'id':_0x33a637['params']['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x546413,null))[_0x2f9b('0x19')](removeEntity(_0x546413,null))[_0x2f9b('0x29')](handleError(_0x546413,null));};exports[_0x2f9b('0x39')]=function(_0x4c06aa,_0x15ec86){return db[_0x2f9b('0x21')][_0x2f9b('0x39')]()[_0x2f9b('0x19')](respondWithResult(_0x15ec86,null))['catch'](handleError(_0x15ec86,null));};exports[_0x2f9b('0x3a')]=function(_0x578537,_0x3f4ac0){return db[_0x2f9b('0x3b')][_0x2f9b('0x36')]({'where':{'id':_0x578537[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x3f4ac0,null))['then'](function(_0xc7c333){if(_0xc7c333){return _0xc7c333[_0x2f9b('0x3a')](_0x578537['body'][_0x2f9b('0x3c')],_[_0x2f9b('0x3d')](_0x578537['body'],[_0x2f9b('0x3c'),'id'])||{});}})[_0x2f9b('0x19')](respondWithResult(_0x3f4ac0,null))[_0x2f9b('0x29')](handleError(_0x3f4ac0,null));};exports[_0x2f9b('0x3e')]=function(_0xeb2ce0,_0x5dbbe7){var _0x5dc882={'raw':![],'where':{}};var _0x452eb2={};var _0x803e47={'count':0x0,'rows':[]};return db[_0x2f9b('0x21')][_0x2f9b('0x3f')]({'where':{'id':_0xeb2ce0[_0x2f9b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5dbbe7,null))['then'](function(_0xe35b24){if(_0xe35b24){_0x452eb2[_0x2f9b('0x2c')]=_[_0x2f9b('0x2d')](db[_0x2f9b('0x3b')][_0x2f9b('0x22')]);_0x452eb2[_0x2f9b('0x27')]=_['keys'](_0xeb2ce0[_0x2f9b('0x27')]);_0x452eb2[_0x2f9b('0x2e')]=_['intersection'](_0x452eb2['model'],_0x452eb2[_0x2f9b('0x27')]);_0x5dc882[_0x2f9b('0x31')]=_[_0x2f9b('0x2f')](_0x452eb2['model'],qs[_0x2f9b('0x30')](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x30')]));_0x5dc882[_0x2f9b('0x31')]=_0x5dc882[_0x2f9b('0x31')][_0x2f9b('0x40')]?_0x5dc882[_0x2f9b('0x31')]:_0x452eb2[_0x2f9b('0x2c')];if(!_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x41')](_0x2f9b('0x42'))){_0x5dc882[_0x2f9b('0x16')]=qs['limit'](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x16')]);_0x5dc882[_0x2f9b('0x13')]=qs[_0x2f9b('0x13')](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x13')]);}_0x5dc882['order']=qs[_0x2f9b('0x43')](_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x43')]);_0x5dc882[_0x2f9b('0x44')]=qs[_0x2f9b('0x2e')](_[_0x2f9b('0x45')](_0xeb2ce0[_0x2f9b('0x27')],_0x452eb2[_0x2f9b('0x2e')]));_0x5dc882[_0x2f9b('0x44')][_0x2f9b('0x46')]=_0xe35b24['id'];if(_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x47')]){_0x5dc882['where']=_[_0x2f9b('0x34')](_0x5dc882[_0x2f9b('0x44')],{'$or':_[_0x2f9b('0x20')](_0x5dc882['attributes'],function(_0x91581e){var _0x1a0978={};_0x1a0978[_0x91581e]={'$like':'%'+_0xeb2ce0['query']['filter']+'%'};return _0x1a0978;})});}if(_0xeb2ce0[_0x2f9b('0x27')]['$gte']){var _0x3020e3=_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x48')][_0x2f9b('0x49')](',');var _0x2ec007={};_0x2ec007[_0x3020e3[0x0]]={'$gte':moment(_0x3020e3[0x1])['format'](_0x2f9b('0x4a'))};_0x5dc882['where']=_[_0x2f9b('0x34')](_0x5dc882[_0x2f9b('0x44')],_0x2ec007);}_0x5dc882=_[_0x2f9b('0x34')]({},_0x5dc882,_0xeb2ce0['options']);return db['SmsMessage'][_0x2f9b('0x15')]({'where':_0x5dc882['where']})[_0x2f9b('0x19')](function(_0x2d53c0){_0x803e47[_0x2f9b('0x15')]=_0x2d53c0;if(_0xeb2ce0[_0x2f9b('0x27')][_0x2f9b('0x32')]){_0x5dc882[_0x2f9b('0x33')]=[{'all':!![]}];}return db[_0x2f9b('0x3b')][_0x2f9b('0x25')](_0x5dc882);})['then'](function(_0xa13ef3){_0x803e47[_0x2f9b('0x4b')]=_0xa13ef3;return _0x803e47;});}})['then'](respondWithFilteredResult(_0x5dbbe7,_0x5dc882))[_0x2f9b('0x29')](handleError(_0x5dbbe7,null));};exports['addTags']=function(_0x1a3ea9,_0x61d25f){return db['SmsInteraction']['find']({'where':{'id':_0x1a3ea9[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x61d25f,null))[_0x2f9b('0x19')](function(_0x1fae78){if(_0x1fae78){return _0x1fae78[_0x2f9b('0x4c')](_0x1a3ea9[_0x2f9b('0x38')][_0x2f9b('0x3c')],_[_0x2f9b('0x3d')](_0x1a3ea9['body'],['ids','id'])||{})[_0x2f9b('0x4d')](function(){return db[_0x2f9b('0x4e')][_0x2f9b('0x25')]({'attributes':['id',_0x2f9b('0x1d'),_0x2f9b('0x4f')],'where':{'id':_0x1a3ea9['body'][_0x2f9b('0x3c')]}});})[_0x2f9b('0x19')](function(_0x3f28e4){socket[_0x2f9b('0x50')]('smsInteractionTags:save',{'id':Number(_0x1a3ea9[_0x2f9b('0x2b')]['id']),'tags':_0x3f28e4||[]});return{'id':Number(_0x1a3ea9[_0x2f9b('0x2b')]['id']),'tags':_0x3f28e4||[]};});}})['then'](respondWithResult(_0x61d25f,null))[_0x2f9b('0x29')](handleError(_0x61d25f,null));};exports[_0x2f9b('0x51')]=function(_0x50d050,_0x48eb5d){return db[_0x2f9b('0x21')]['find']({'where':{'id':_0x50d050[_0x2f9b('0x2b')]['id']}})[_0x2f9b('0x19')](handleEntityNotFound(_0x48eb5d,null))[_0x2f9b('0x19')](function(_0x13708d){if(_0x13708d){return _0x13708d[_0x2f9b('0x51')](_0x50d050[_0x2f9b('0x27')][_0x2f9b('0x3c')]);}})['then'](respondWithStatusCode(_0x48eb5d,null))[_0x2f9b('0x29')](handleError(_0x48eb5d,null));};exports['download']=function(_0x5ee272,_0x232357){var _0x5039b7=moment()[_0x2f9b('0x52')]()[_0x2f9b('0x53')]();var _0x5ca37b=path['join'](config['root'],_0x2f9b('0x54'),_0x2f9b('0x55'),_0x2f9b('0x56'));var _0x5dc6ce=path[_0x2f9b('0x57')](_0x5ca37b,_0x5039b7);var _0x5a8f91=util[_0x2f9b('0x58')](_0x2f9b('0x59'),_0x5ee272['params']['id'],_0x5039b7);var _0x25ead2=path[_0x2f9b('0x57')](_0x5ca37b,_0x5a8f91);var _0x3d8bd4=[];_0x3d8bd4[_0x2f9b('0x5a')]({'model':db['User'],'as':_0x2f9b('0x5b'),'attributes':['id',_0x2f9b('0x5c')],'raw':!![]});_0x3d8bd4[_0x2f9b('0x5a')]({'model':db[_0x2f9b('0x5d')],'as':_0x2f9b('0x5e'),'attributes':['id',_0x2f9b('0x5f'),_0x2f9b('0x60')],'raw':!![]});var _0x10530c=[{'model':db[_0x2f9b('0x3b')],'as':_0x2f9b('0x61'),'attributes':['id',_0x2f9b('0x38'),_0x2f9b('0x62'),_0x2f9b('0x63'),_0x2f9b('0x64'),_0x2f9b('0x65')],'include':_0x3d8bd4}];_0x10530c[_0x2f9b('0x5a')]({'model':db[_0x2f9b('0x66')],'as':'Account','attributes':['id','name']});_0x10530c['push']({'model':db['User'],'as':_0x2f9b('0x67'),'attributes':['id',_0x2f9b('0x5c')]});return db[_0x2f9b('0x21')][_0x2f9b('0x36')]({'where':{'id':_0x5ee272[_0x2f9b('0x2b')]['id']},'include':_0x10530c})[_0x2f9b('0x19')](handleEntityNotFound(_0x232357,null))[_0x2f9b('0x19')](function(_0x1e20c5){if(_0x1e20c5){var _0x565bbd=_0x1e20c5[_0x2f9b('0x68')]({'plain':!![]});fs[_0x2f9b('0x69')](_0x5dc6ce);var _0x4720ad={'channel':_0x2f9b('0x6a'),'account':_0x565bbd[_0x2f9b('0x6b')]['name'],'agent':_0x565bbd[_0x2f9b('0x67')]?_0x565bbd[_0x2f9b('0x67')][_0x2f9b('0x5c')]:'N.A.','createdAt':moment(_0x565bbd[_0x2f9b('0x62')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2f9b('0x53')](),'closedAt':_0x565bbd[_0x2f9b('0x6c')]?moment(_0x565bbd[_0x2f9b('0x6d')])[_0x2f9b('0x58')](_0x2f9b('0x4a'))[_0x2f9b('0x53')]():'','disposition':_0x565bbd[_0x2f9b('0x6e')],'messages':_(_0x565bbd[_0x2f9b('0x61')])[_0x2f9b('0x47')]({'secret':![]})[_0x2f9b('0x20')](function(_0x43952f){return{'date':moment(_0x43952f[_0x2f9b('0x62')])[_0x2f9b('0x58')](_0x2f9b('0x4a'))[_0x2f9b('0x53')](),'sender':_0x43952f[_0x2f9b('0x63')]==='out'?_0x43952f[_0x2f9b('0x5b')]?_0x43952f[_0x2f9b('0x5b')]['fullname']:_0x2f9b('0x6f'):_0x43952f[_0x2f9b('0x5e')][_0x2f9b('0x5f')]+(_0x43952f[_0x2f9b('0x5e')]['lastName']?'\x20'+_0x43952f[_0x2f9b('0x5e')][_0x2f9b('0x60')]:''),'body':_0x43952f[_0x2f9b('0x38')],'direction':_0x43952f[_0x2f9b('0x63')]===_0x2f9b('0x70')?'A':'C','secret':_0x43952f['secret'],'read':_0x43952f['read']};})[_0x2f9b('0x71')]()};return ejs[_0x2f9b('0x72')](path['join'](config[_0x2f9b('0x73')],'server',_0x2f9b('0x74'),_0x2f9b('0x75')),{'interaction':_0x4720ad})[_0x2f9b('0x19')](function(_0x775d3e){var _0x59fd86=path[_0x2f9b('0x57')](_0x5dc6ce,_0x2f9b('0x76')+_0x565bbd['id']+'-'+_0x5039b7+_0x2f9b('0x77'));var _0x29bab3={'path':_0x59fd86,'channel':_0x2f9b('0x6a'),'interactionId':_0x565bbd['id']};return pdf[_0x2f9b('0x78')](_0x775d3e,_0x29bab3);})[_0x2f9b('0x19')](function(){return new BPromise(function(_0x33a755,_0xda8cd5){zipdir(_0x5dc6ce,{'saveTo':_0x25ead2},function(_0x4c68bf,_0x30271d){if(_0x4c68bf)return _0xda8cd5(_0x4c68bf);return _0x33a755(_0x30271d);});})[_0x2f9b('0x19')](function(){return new BPromise(function(_0x255468,_0x4e4514){rimraf(_0x5dc6ce,function(_0x45abad){if(_0x45abad)_0x4e4514(_0x45abad);return _0x255468();});});})[_0x2f9b('0x19')](function(){return _0x232357[_0x2f9b('0x79')](_0x25ead2,_0x5a8f91,function(_0x438efe){if(_0x438efe){console[_0x2f9b('0x7a')](_0x2f9b('0x7b'),_0x438efe);}else{fs[_0x2f9b('0x7c')](_0x25ead2);}});});});}else{return _0x232357[_0x2f9b('0xf')](0xc8);}})[_0x2f9b('0x29')](handleError(_0x232357,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 98bdb94..05b1c5e 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 _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x45ee3f,_0x1b9d0a){var _0x5f0e1a=function(_0x57222d){while(--_0x57222d){_0x45ee3f['push'](_0x45ee3f['shift']());}};_0x5f0e1a(++_0x1b9d0a);}(_0x3266,0x6a));var _0x6326=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x3266[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0xeb3b=['then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','update','getUsers'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x3dda0f,_0x5b9902){_0x3dda0f=_0x3dda0f-0x0;var _0x1b0488=_0xeb3b[_0x3dda0f];return _0x1b0488;};'use strict';var EventEmitter=require(_0xbeb3('0x0'));var SmsInteraction=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x2')];var SmsMessage=require(_0xbeb3('0x1'))['db'][_0xbeb3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbeb3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e8ce3){return function(_0x4852ca,_0x2e8a69,_0x5ae6f9){_0x4852ca[_0xbeb3('0x5')]({'attributes':['id'],'raw':!![]})[_0xbeb3('0x6')](function(_0x406927){_0x4852ca[_0xbeb3('0x7')]('Users',_0x406927[_0xbeb3('0x8')](function(_0x26e0f3){return{'id':_0x26e0f3['id']};}));return SmsMessage[_0xbeb3('0x9')]({'where':{'SmsInteractionId':_0x4852ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbeb3('0x6')](function(_0x443396){_0x4852ca[_0xbeb3('0x7')](_0xbeb3('0xa'),_0x443396['length']);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3+':'+_0x4852ca['id'],_0x4852ca);SmsInteractionEvents[_0xbeb3('0xb')](_0x2e8ce3,_0x4852ca);_0x5ae6f9(null);})['catch'](_0x5ae6f9(null));};}for(var e in events){if(events[_0xbeb3('0xc')](e)){var event=events[e];SmsInteraction[_0xbeb3('0xd')](e,emitEvent(event));}}module[_0xbeb3('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 8938b8c..0ad1b05 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 _0xa7ad=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x495dd9,_0x569333){var _0x862e68=function(_0x317469){while(--_0x317469){_0x495dd9['push'](_0x495dd9['shift']());}};_0x862e68(++_0x569333);}(_0xa7ad,0x1e1));var _0xda7a=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa7ad[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xda7a('0x0'));var util=require(_0xda7a('0x1'));var logger=require(_0xda7a('0x2'))(_0xda7a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xda7a('0x4'));var fs=require('fs');var path=require(_0xda7a('0x5'));var rimraf=require('rimraf');var config=require(_0xda7a('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3dd380,_0xda4bf){return _0x3dd380[_0xda7a('0x7')](_0xda7a('0x8'),attributes,{'tableName':_0xda7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c7a5c,_0xfd8b08,_0x235d96){if(_0x3c7a5c[_0xda7a('0xa')](_0xda7a('0xb'))){_0x3c7a5c[_0xda7a('0xc')]=moment()[_0xda7a('0xd')](_0xda7a('0xe'));}_0x235d96(null,_0x3c7a5c);}}});}; \ No newline at end of file +var _0xfd46=['bluebird','request-promise','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x60290f,_0x1da37a){var _0x38eaa0=function(_0x596744){while(--_0x596744){_0x60290f['push'](_0x60290f['shift']());}};_0x38eaa0(++_0x1da37a);}(_0xfd46,0x14d));var _0x6fd4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfd46[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x6fd4('0x0'));var util=require('util');var logger=require(_0x6fd4('0x1'))(_0x6fd4('0x2'));var moment=require('moment');var BPromise=require(_0x6fd4('0x3'));var rp=require(_0x6fd4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6fd4('0x5'));var config=require('../../config/environment');var attributes=require(_0x6fd4('0x6'));module[_0x6fd4('0x7')]=function(_0x190c82,_0x5a1433){return _0x190c82[_0x6fd4('0x8')](_0x6fd4('0x9'),attributes,{'tableName':_0x6fd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38d51c,_0x27a935,_0xe959e3){if(_0x38d51c['changed']('closed')){_0x38d51c['closedAt']=moment()['format'](_0x6fd4('0xb'));}_0xe959e3(null,_0x38d51c);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 877781c..385d849 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 _0x799f=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','code','error','message','SmsInteraction,\x20%s,\x20%s','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','find','addTags','ids','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18795a,_0x59010d){var _0x5e5a06=function(_0x489198){while(--_0x489198){_0x18795a['push'](_0x18795a['shift']());}};_0x5e5a06(++_0x59010d);}(_0x799f,0x124));var _0xf799=function(_0x2d58c8,_0x14d242){_0x2d58c8=_0x2d58c8-0x0;var _0x244a95=_0x799f[_0x2d58c8];return _0x244a95;};'use strict';var _=require(_0xf799('0x0'));var util=require(_0xf799('0x1'));var moment=require(_0xf799('0x2'));var BPromise=require(_0xf799('0x3'));var rs=require(_0xf799('0x4'));var fs=require('fs');var Redis=require(_0xf799('0x5'));var db=require(_0xf799('0x6'))['db'];var utils=require(_0xf799('0x7'));var logger=require(_0xf799('0x8'))('rpc');var config=require(_0xf799('0x9'));var jayson=require(_0xf799('0xa'));var client=jayson[_0xf799('0xb')][_0xf799('0xc')]({'port':0x232a});config[_0xf799('0xd')]=_[_0xf799('0xe')](config[_0xf799('0xd')],{'host':_0xf799('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf799('0xd')]));require(_0xf799('0x10'))['register'](socket);function respondWithRpcPromise(_0x417d5f,_0x2870e9,_0x3b7820){return new BPromise(function(_0x8f0c73,_0x5b7b10){return client[_0xf799('0x11')](_0x417d5f,_0x3b7820)[_0xf799('0x12')](function(_0x3d04d1){logger[_0xf799('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x2870e9,_0xf799('0x14'));logger[_0xf799('0x15')](_0xf799('0x16'),_0x2870e9,_0xf799('0x14'),JSON['stringify'](_0x3d04d1));if(_0x3d04d1['error']){if(_0x3d04d1['error'][_0xf799('0x17')]===0x1f4){logger[_0xf799('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x2870e9,_0x3d04d1[_0xf799('0x18')][_0xf799('0x19')]);return _0x5b7b10(_0x3d04d1['error'][_0xf799('0x19')]);}logger[_0xf799('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x2870e9,_0x3d04d1[_0xf799('0x18')]['message']);return _0x8f0c73(_0x3d04d1[_0xf799('0x18')][_0xf799('0x19')]);}else{logger['info'](_0xf799('0x1a'),_0x2870e9,_0xf799('0x14'));_0x8f0c73(_0x3d04d1[_0xf799('0x1b')][_0xf799('0x19')]);}})['catch'](function(_0xdac4a6){logger[_0xf799('0x18')](_0xf799('0x1a'),_0x2870e9,_0xdac4a6);_0x5b7b10(_0xdac4a6);});});}exports[_0xf799('0x1c')]=function(_0x480df6){var _0x186910=this;return new Promise(function(_0x28a8ce,_0x4e1450){return db[_0xf799('0x1d')]['update'](_0x480df6[_0xf799('0x1e')],{'raw':_0x480df6['options']?_0x480df6[_0xf799('0x1f')][_0xf799('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x480df6[_0xf799('0x1f')]?_0x480df6['options'][_0xf799('0x21')]||null:null,'attributes':_0x480df6['options']?_0x480df6[_0xf799('0x1f')][_0xf799('0x22')]||null:null,'limit':_0x480df6['options']?_0x480df6[_0xf799('0x1f')][_0xf799('0x23')]||null:null})[_0xf799('0x12')](function(_0x535c56){logger[_0xf799('0x13')](_0xf799('0x1c'),_0x480df6);logger[_0xf799('0x15')](_0xf799('0x1c'),_0x480df6,JSON['stringify'](_0x535c56));_0x28a8ce(_0x535c56);})[_0xf799('0x24')](function(_0x31afe8){logger[_0xf799('0x18')](_0xf799('0x1c'),_0x31afe8[_0xf799('0x19')],_0x480df6);_0x4e1450(_0x186910[_0xf799('0x18')](0x1f4,_0x31afe8['message']));});});};exports[_0xf799('0x25')]=function(_0x3a6e9c){return new Promise(function(_0x3a067a,_0x4d33ca){return db[_0xf799('0x1d')][_0xf799('0x26')]({'where':_0x3a6e9c[_0xf799('0x1f')]?_0x3a6e9c[_0xf799('0x1f')][_0xf799('0x21')]||null:null})[_0xf799('0x12')](function(_0x5ac506){if(_0x5ac506){return _0x5ac506[_0xf799('0x27')](_0x3a6e9c['body'][_0xf799('0x28')],_['omit'](_0x3a6e9c[_0xf799('0x1e')],[_0xf799('0x28'),'id'])||{});}})['spread'](function(_0x293bcf){logger['info'](_0xf799('0x29'),_0x3a6e9c);logger[_0xf799('0x15')](_0xf799('0x29'),_0x3a6e9c,JSON[_0xf799('0x2a')](_0x293bcf));_0x3a067a(_0x293bcf);})[_0xf799('0x24')](function(_0x3f73c6){logger[_0xf799('0x18')](_0xf799('0x29'),_0x3f73c6[_0xf799('0x19')],_0x3a6e9c);_0x4d33ca(_this[_0xf799('0x18')](0x1f4,_0x3f73c6[_0xf799('0x19')]));});});}; \ No newline at end of file +var _0x18c4=['options','raw','where','UpdateSmsInteraction','catch','AddTagsToSmsInteraction','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SmsInteraction','body'];(function(_0x1e67a9,_0x156a74){var _0x13c375=function(_0x7f2bd8){while(--_0x7f2bd8){_0x1e67a9['push'](_0x1e67a9['shift']());}};_0x13c375(++_0x156a74);}(_0x18c4,0xd2));var _0x418c=function(_0x3cbe28,_0x2f6465){_0x3cbe28=_0x3cbe28-0x0;var _0x23cdf9=_0x18c4[_0x3cbe28];return _0x23cdf9;};'use strict';var _=require(_0x418c('0x0'));var util=require(_0x418c('0x1'));var moment=require('moment');var BPromise=require(_0x418c('0x2'));var rs=require(_0x418c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x418c('0x4'))['db'];var utils=require(_0x418c('0x5'));var logger=require('../../config/logger')(_0x418c('0x6'));var config=require(_0x418c('0x7'));var jayson=require(_0x418c('0x8'));var client=jayson[_0x418c('0x9')]['http']({'port':0x232a});config['redis']=_[_0x418c('0xa')](config['redis'],{'host':_0x418c('0xb'),'port':0x18eb});var socket=require(_0x418c('0xc'))(new Redis(config[_0x418c('0xd')]));require(_0x418c('0xe'))[_0x418c('0xf')](socket);function respondWithRpcPromise(_0x338efd,_0x3d4c96,_0x3bf3cf){return new BPromise(function(_0x256afd,_0x5ba2dc){return client[_0x418c('0x10')](_0x338efd,_0x3bf3cf)[_0x418c('0x11')](function(_0x5b0ac2){logger['info'](_0x418c('0x12'),_0x3d4c96,_0x418c('0x13'));logger[_0x418c('0x14')](_0x418c('0x15'),_0x3d4c96,_0x418c('0x13'),JSON[_0x418c('0x16')](_0x5b0ac2));if(_0x5b0ac2[_0x418c('0x17')]){if(_0x5b0ac2[_0x418c('0x17')][_0x418c('0x18')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x3d4c96,_0x5b0ac2[_0x418c('0x17')][_0x418c('0x19')]);return _0x5ba2dc(_0x5b0ac2[_0x418c('0x17')][_0x418c('0x19')]);}logger[_0x418c('0x17')](_0x418c('0x12'),_0x3d4c96,_0x5b0ac2['error'][_0x418c('0x19')]);return _0x256afd(_0x5b0ac2[_0x418c('0x17')][_0x418c('0x19')]);}else{logger[_0x418c('0x1a')](_0x418c('0x12'),_0x3d4c96,_0x418c('0x13'));_0x256afd(_0x5b0ac2[_0x418c('0x1b')]['message']);}})['catch'](function(_0x24e9bc){logger[_0x418c('0x17')](_0x418c('0x12'),_0x3d4c96,_0x24e9bc);_0x5ba2dc(_0x24e9bc);});});}exports['UpdateSmsInteraction']=function(_0x54c2c9){var _0x3fbf93=this;return new Promise(function(_0x2b2c4b,_0x51d6a8){return db[_0x418c('0x1c')]['update'](_0x54c2c9[_0x418c('0x1d')],{'raw':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9[_0x418c('0x1e')][_0x418c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9[_0x418c('0x1e')][_0x418c('0x20')]||null:null,'attributes':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9['options']['attributes']||null:null,'limit':_0x54c2c9[_0x418c('0x1e')]?_0x54c2c9[_0x418c('0x1e')]['limit']||null:null})[_0x418c('0x11')](function(_0x19c92c){logger['info'](_0x418c('0x21'),_0x54c2c9);logger[_0x418c('0x14')](_0x418c('0x21'),_0x54c2c9,JSON['stringify'](_0x19c92c));_0x2b2c4b(_0x19c92c);})[_0x418c('0x22')](function(_0x485d9b){logger[_0x418c('0x17')](_0x418c('0x21'),_0x485d9b[_0x418c('0x19')],_0x54c2c9);_0x51d6a8(_0x3fbf93['error'](0x1f4,_0x485d9b[_0x418c('0x19')]));});});};exports[_0x418c('0x23')]=function(_0x322ed6){return new Promise(function(_0x198a44,_0x30b294){return db[_0x418c('0x1c')]['find']({'where':_0x322ed6[_0x418c('0x1e')]?_0x322ed6[_0x418c('0x1e')][_0x418c('0x20')]||null:null})[_0x418c('0x11')](function(_0x4b472e){if(_0x4b472e){return _0x4b472e['addTags'](_0x322ed6[_0x418c('0x1d')][_0x418c('0x24')],_[_0x418c('0x25')](_0x322ed6[_0x418c('0x1d')],[_0x418c('0x24'),'id'])||{});}})[_0x418c('0x26')](function(_0x58acc9){logger[_0x418c('0x1a')](_0x418c('0x27'),_0x322ed6);logger[_0x418c('0x14')](_0x418c('0x27'),_0x322ed6,JSON[_0x418c('0x16')](_0x58acc9));_0x198a44(_0x58acc9);})[_0x418c('0x22')](function(_0x3875dc){logger[_0x418c('0x17')](_0x418c('0x27'),_0x3875dc[_0x418c('0x19')],_0x322ed6);_0x30b294(_this[_0x418c('0x17')](0x1f4,_0x3875dc[_0x418c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 59ff8b4..b6130ae 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 _0x9b19=['save','update','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b19,0x133));var _0x99b1=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0x9b19[_0xf363f0];return _0x55a386;};'use strict';var SmsInteractionEvents=require(_0x99b1('0x0'));var events=[_0x99b1('0x1'),'remove',_0x99b1('0x2')];function createListener(_0xeaa387,_0x3bd9f6){return function(_0x2cee70){_0x3bd9f6['emit'](_0xeaa387,_0x2cee70);};}function removeListener(_0x2af578,_0x470f0a){return function(){SmsInteractionEvents[_0x99b1('0x3')](_0x2af578,_0x470f0a);};}exports[_0x99b1('0x4')]=function(_0x4ae5da){for(var _0xff10b6=0x0,_0x1ac486=events[_0x99b1('0x5')];_0xff10b6<_0x1ac486;_0xff10b6++){var _0x58f98e=events[_0xff10b6];var _0x4f9fb0=createListener(_0x99b1('0x6')+_0x58f98e,_0x4ae5da);SmsInteractionEvents['on'](_0x58f98e,_0x4f9fb0);}}; \ No newline at end of file +var _0x234b=['removeListener','register','length','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x234b,0x116));var _0xb234=function(_0x50c8a1,_0x38baa6){_0x50c8a1=_0x50c8a1-0x0;var _0x35b0c2=_0x234b[_0x50c8a1];return _0x35b0c2;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xb234('0x0'),'update'];function createListener(_0x2bb4e1,_0x278305){return function(_0x3e73e0){_0x278305[_0xb234('0x1')](_0x2bb4e1,_0x3e73e0);};}function removeListener(_0x306ddb,_0x13bc6b){return function(){SmsInteractionEvents[_0xb234('0x2')](_0x306ddb,_0x13bc6b);};}exports[_0xb234('0x3')]=function(_0xc3d130){for(var _0x1602f0=0x0,_0x4d407a=events[_0xb234('0x4')];_0x1602f0<_0x4d407a;_0x1602f0++){var _0x4e792e=events[_0x1602f0];var _0x3bb482=createListener('smsInteraction:'+_0x4e792e,_0xc3d130);SmsInteractionEvents['on'](_0x4e792e,_0x3bb482);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 08f6351..c14e2f4 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 _0xd9b6=['/:id/accept','accept','/:id/reject','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','smsmessage:create','create','status','put','update'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xd9b6,0x17b));var _0x6d9b=function(_0x50f17d,_0x260de1){_0x50f17d=_0x50f17d-0x0;var _0x207fb8=_0xd9b6[_0x50f17d];return _0x207fb8;};'use strict';var multer=require(_0x6d9b('0x0'));var util=require(_0x6d9b('0x1'));var path=require(_0x6d9b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6d9b('0x3')]();var fs_extra=require(_0x6d9b('0x4'));var auth=require(_0x6d9b('0x5'));var interaction=require(_0x6d9b('0x6'));var config=require(_0x6d9b('0x7'));var controller=require(_0x6d9b('0x8'));router[_0x6d9b('0x9')]('/',auth[_0x6d9b('0xa')](),controller['index']);router[_0x6d9b('0x9')](_0x6d9b('0xb'),auth[_0x6d9b('0xa')](),controller[_0x6d9b('0xc')]);router[_0x6d9b('0x9')](_0x6d9b('0xd'),auth[_0x6d9b('0xa')](),controller['show']);router[_0x6d9b('0xe')]('/',auth[_0x6d9b('0xa')](),interaction[_0x6d9b('0xf')]('sms',_0x6d9b('0x10')),controller[_0x6d9b('0x11')]);router[_0x6d9b('0xe')]('/:id/status',controller[_0x6d9b('0x12')]);router[_0x6d9b('0x13')](_0x6d9b('0xd'),auth['isAuthenticated'](),controller[_0x6d9b('0x14')]);router[_0x6d9b('0x13')](_0x6d9b('0x15'),auth[_0x6d9b('0xa')](),controller[_0x6d9b('0x16')]);router[_0x6d9b('0x13')](_0x6d9b('0x17'),auth[_0x6d9b('0xa')](),controller['reject']);router[_0x6d9b('0x18')](_0x6d9b('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4eab=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','smsmessage:create','create','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4eab,0x194));var _0xb4ea=function(_0x32a7ec,_0x3ae584){_0x32a7ec=_0x32a7ec-0x0;var _0x3a4f7e=_0x4eab[_0x32a7ec];return _0x3a4f7e;};'use strict';var multer=require(_0xb4ea('0x0'));var util=require(_0xb4ea('0x1'));var path=require(_0xb4ea('0x2'));var timeout=require(_0xb4ea('0x3'));var express=require(_0xb4ea('0x4'));var router=express[_0xb4ea('0x5')]();var fs_extra=require(_0xb4ea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb4ea('0x7'));var config=require(_0xb4ea('0x8'));var controller=require(_0xb4ea('0x9'));router[_0xb4ea('0xa')]('/',auth[_0xb4ea('0xb')](),controller['index']);router[_0xb4ea('0xa')]('/describe',auth[_0xb4ea('0xb')](),controller[_0xb4ea('0xc')]);router[_0xb4ea('0xa')](_0xb4ea('0xd'),auth[_0xb4ea('0xb')](),controller[_0xb4ea('0xe')]);router[_0xb4ea('0xf')]('/',auth[_0xb4ea('0xb')](),interaction['tracked']('sms',_0xb4ea('0x10')),controller[_0xb4ea('0x11')]);router[_0xb4ea('0xf')]('/:id/status',controller[_0xb4ea('0x12')]);router[_0xb4ea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb4ea('0x14')]);router[_0xb4ea('0x13')](_0xb4ea('0x15'),auth[_0xb4ea('0xb')](),controller[_0xb4ea('0x16')]);router[_0xb4ea('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xb4ea('0x17')]);router[_0xb4ea('0x18')](_0xb4ea('0xd'),auth[_0xb4ea('0xb')](),controller[_0xb4ea('0x19')]);module[_0xb4ea('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3b5e59a..47ded8b 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 _0x9143=['exports','medium','out','STRING','DATE','BOOLEAN','TEXT','sequelize'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9143,0x107));var _0x3914=function(_0xc7c4dc,_0x1fe46f){_0xc7c4dc=_0xc7c4dc-0x0;var _0xcc10db=_0x9143[_0xc7c4dc];return _0xcc10db;};'use strict';var Sequelize=require(_0x3914('0x0'));module[_0x3914('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3914('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3914('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3914('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x3914('0x5')]},'secret':{'type':Sequelize[_0x3914('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3914('0x4')]},'providerResponse':{'type':Sequelize[_0x3914('0x7')]}}; \ No newline at end of file +var _0xff3c=['exports','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x5e57e1,_0x192481){var _0x3269e5=function(_0x201888){while(--_0x201888){_0x5e57e1['push'](_0x5e57e1['shift']());}};_0x3269e5(++_0x192481);}(_0xff3c,0x179));var _0xcff3=function(_0xf3e375,_0x5dc1c9){_0xf3e375=_0xf3e375-0x0;var _0x27027b=_0xff3c[_0xf3e375];return _0x27027b;};'use strict';var Sequelize=require(_0xcff3('0x0'));module[_0xcff3('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcff3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcff3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xcff3('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcff3('0x5')](0xbe)},'phone':{'type':Sequelize[_0xcff3('0x5')]},'readAt':{'type':Sequelize[_0xcff3('0x6')]},'secret':{'type':Sequelize[_0xcff3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcff3('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 5c19e3a..5de011f 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 _0x7d29=['jayson/promise','client','http','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','then','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','destroy','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','update','isNil','format','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','manual','interface','channel','motionChannel','event','acceptmessage','RejectMessage','rejectMessage','SELECT','User','fullname','email','internal','SIP/%s','reject','EventManager','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageUUID','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x7d29,0x1a0));var _0x97d2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7d29[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x97d2('0x0'));var rimraf=require(_0x97d2('0x1'));var zipdir=require(_0x97d2('0x2'));var jsonpatch=require(_0x97d2('0x3'));var rp=require(_0x97d2('0x4'));var moment=require(_0x97d2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x97d2('0x6'));var path=require(_0x97d2('0x7'));var sox=require(_0x97d2('0x8'));var csv=require(_0x97d2('0x9'));var ejs=require(_0x97d2('0xa'));var fs=require('fs');var fs_extra=require(_0x97d2('0xb'));var _=require(_0x97d2('0xc'));var squel=require(_0x97d2('0xd'));var crypto=require(_0x97d2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x97d2('0xf'));var toCsv=require(_0x97d2('0x9'));var querystring=require(_0x97d2('0x10'));var Papa=require(_0x97d2('0x11'));var Redis=require('ioredis');var authService=require(_0x97d2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x97d2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97d2('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x97d2('0x15'));var db=require(_0x97d2('0x16'))['db'];config[_0x97d2('0x17')]=_[_0x97d2('0x18')](config[_0x97d2('0x17')],{'host':_0x97d2('0x19'),'port':0x18eb});var socket=require(_0x97d2('0x1a'))(new Redis(config[_0x97d2('0x17')]));require(_0x97d2('0x1b'))['register'](socket);var jayson=require(_0x97d2('0x1c'));var client=jayson[_0x97d2('0x1d')][_0x97d2('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x97d2('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x14db29,_0x51a863,_0x3f68fe,_0x29409e){return new BPromise(function(_0x3ecc0,_0x324cb3){var _0x46ae97=_0x29409e||client;return _0x46ae97['request'](_0x14db29,_0x3f68fe)['then'](function(_0x5b5427){logger['info'](_0x97d2('0x1f'),_0x51a863,_0x97d2('0x20'));logger[_0x97d2('0x21')](_0x97d2('0x22'),_0x51a863,_0x97d2('0x20'),JSON['stringify'](_0x5b5427));if(_0x5b5427['error']){if(_0x5b5427['error']['code']===0x1f4){logger[_0x97d2('0x23')](_0x97d2('0x1f'),_0x51a863,_0x5b5427['error'][_0x97d2('0x24')]);return _0x324cb3(_0x5b5427['error'][_0x97d2('0x24')]);}logger[_0x97d2('0x23')](_0x97d2('0x1f'),_0x51a863,_0x5b5427[_0x97d2('0x23')][_0x97d2('0x24')]);return _0x3ecc0(_0x5b5427['error'][_0x97d2('0x24')]);}else{logger[_0x97d2('0x25')](_0x97d2('0x1f'),_0x51a863,_0x97d2('0x20'));_0x3ecc0(_0x5b5427[_0x97d2('0x26')][_0x97d2('0x24')]);}})[_0x97d2('0x27')](function(_0xc16ba2){logger[_0x97d2('0x23')](_0x97d2('0x1f'),_0x51a863,_0xc16ba2);_0x324cb3(_0xc16ba2);});});}function respondWithStatusCode(_0x1618aa,_0x40e267){_0x40e267=_0x40e267||0xcc;return function(_0x1edeb2){if(_0x1edeb2){return _0x1618aa[_0x97d2('0x28')](_0x40e267);}return _0x1618aa[_0x97d2('0x29')](_0x40e267)['end']();};}function respondWithResult(_0x70e2d0,_0x5692e3){_0x5692e3=_0x5692e3||0xc8;return function(_0x5b7d58){if(_0x5b7d58){return _0x70e2d0[_0x97d2('0x29')](_0x5692e3)['json'](_0x5b7d58);}};}function respondWithFilteredResult(_0x336435,_0xe9f238){return function(_0x20ad20){if(_0x20ad20){var _0x3d638d=typeof _0xe9f238['offset']===_0x97d2('0x2a')&&typeof _0xe9f238['limit']===_0x97d2('0x2a');var _0x2cf239=_0x20ad20[_0x97d2('0x2b')];var _0x2d20c4=_0x3d638d?0x0:_0xe9f238['offset'];var _0x11ef1d=_0x3d638d?_0x20ad20[_0x97d2('0x2b')]:_0xe9f238[_0x97d2('0x2c')]+_0xe9f238[_0x97d2('0x2d')];var _0x3b7e61;if(_0x11ef1d>=_0x2cf239){_0x11ef1d=_0x2cf239;_0x3b7e61=0xc8;}else{_0x3b7e61=0xce;}_0x336435['status'](_0x3b7e61);return _0x336435[_0x97d2('0x2e')](_0x97d2('0x2f'),_0x2d20c4+'-'+_0x11ef1d+'/'+_0x2cf239)[_0x97d2('0x30')](_0x20ad20);}return null;};}function patchUpdates(_0x315cfe){return function(_0xe09aa0){try{jsonpatch[_0x97d2('0x31')](_0xe09aa0,_0x315cfe,!![]);}catch(_0x4652ff){return BPromise['reject'](_0x4652ff);}return _0xe09aa0[_0x97d2('0x32')]();};}function saveUpdates(_0x5be9cd,_0x517530){return function(_0x54fd26){if(_0x54fd26){return _0x54fd26['update'](_0x5be9cd)[_0x97d2('0x33')](function(_0x1cd848){return _0x1cd848;});}return null;};}function removeEntity(_0x171a55,_0x497220){return function(_0x45fc05){if(_0x45fc05){return _0x45fc05['destroy']()['then'](function(){_0x171a55['status'](0xcc)[_0x97d2('0x34')]();});}};}function handleEntityNotFound(_0x539921,_0x37cb76){return function(_0x2ba08a){if(!_0x2ba08a){_0x539921[_0x97d2('0x28')](0x194);}return _0x2ba08a;};}function handleError(_0x241449,_0x24908c){_0x24908c=_0x24908c||0x1f4;return function(_0x2da3bd){logger['error'](_0x2da3bd[_0x97d2('0x35')]);if(_0x2da3bd['name']){delete _0x2da3bd[_0x97d2('0x36')];}_0x241449['status'](_0x24908c)[_0x97d2('0x37')](_0x2da3bd);};}exports[_0x97d2('0x38')]=function(_0x548e6a,_0x46ad9e){var _0x4da089={},_0x347908={},_0x45027={'count':0x0,'rows':[]};var _0x29c96d=_[_0x97d2('0x39')](db[_0x97d2('0x3a')][_0x97d2('0x3b')],function(_0xd42122){return{'name':_0xd42122[_0x97d2('0x3c')],'type':_0xd42122[_0x97d2('0x3d')][_0x97d2('0x3e')]};});_0x347908['model']=_[_0x97d2('0x39')](_0x29c96d,_0x97d2('0x36'));_0x347908[_0x97d2('0x3f')]=_['keys'](_0x548e6a[_0x97d2('0x3f')]);_0x347908['filters']=_[_0x97d2('0x40')](_0x347908[_0x97d2('0x41')],_0x347908[_0x97d2('0x3f')]);_0x4da089[_0x97d2('0x42')]=_['intersection'](_0x347908[_0x97d2('0x41')],qs[_0x97d2('0x43')](_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x43')]));_0x4da089[_0x97d2('0x42')]=_0x4da089['attributes'][_0x97d2('0x44')]?_0x4da089['attributes']:_0x347908[_0x97d2('0x41')];if(!_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x45')]('nolimit')){_0x4da089[_0x97d2('0x2d')]=qs['limit'](_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x2d')]);_0x4da089[_0x97d2('0x2c')]=qs[_0x97d2('0x2c')](_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x2c')]);}_0x4da089['order']=qs[_0x97d2('0x46')](_0x548e6a['query'][_0x97d2('0x46')]);_0x4da089['where']=qs[_0x97d2('0x47')](_[_0x97d2('0x48')](_0x548e6a[_0x97d2('0x3f')],_0x347908[_0x97d2('0x47')]),_0x29c96d);if(_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x49')]){_0x4da089[_0x97d2('0x4a')]=_[_0x97d2('0x4b')](_0x4da089[_0x97d2('0x4a')],{'$or':_['map'](_0x29c96d,function(_0x1bfef5){if(_0x1bfef5[_0x97d2('0x3d')]!==_0x97d2('0x4c')){var _0x44afa4={};_0x44afa4[_0x1bfef5[_0x97d2('0x36')]]={'$like':'%'+_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x49')]+'%'};return _0x44afa4;}})});}_0x4da089=_[_0x97d2('0x4b')]({},_0x4da089,_0x548e6a[_0x97d2('0x4d')]);var _0x4edc16={'where':_0x4da089['where']};return db[_0x97d2('0x3a')][_0x97d2('0x2b')](_0x4edc16)[_0x97d2('0x33')](function(_0x18c7c1){_0x45027[_0x97d2('0x2b')]=_0x18c7c1;if(_0x548e6a[_0x97d2('0x3f')][_0x97d2('0x4e')]){_0x4da089[_0x97d2('0x4f')]=[{'all':!![]}];}return db[_0x97d2('0x3a')][_0x97d2('0x50')](_0x4da089);})[_0x97d2('0x33')](function(_0x41da4a){_0x45027[_0x97d2('0x51')]=_0x41da4a;return _0x45027;})[_0x97d2('0x33')](respondWithFilteredResult(_0x46ad9e,_0x4da089))['catch'](handleError(_0x46ad9e,null));};exports['show']=function(_0x1d69c7,_0x166624){var _0x4e0c25={'raw':!![],'where':{'id':_0x1d69c7[_0x97d2('0x52')]['id']}},_0xbe2f1d={};_0xbe2f1d[_0x97d2('0x41')]=_['keys'](db[_0x97d2('0x3a')]['rawAttributes']);_0xbe2f1d[_0x97d2('0x3f')]=_['keys'](_0x1d69c7[_0x97d2('0x3f')]);_0xbe2f1d[_0x97d2('0x47')]=_[_0x97d2('0x40')](_0xbe2f1d['model'],_0xbe2f1d['query']);_0x4e0c25[_0x97d2('0x42')]=_['intersection'](_0xbe2f1d[_0x97d2('0x41')],qs['fields'](_0x1d69c7['query'][_0x97d2('0x43')]));_0x4e0c25[_0x97d2('0x42')]=_0x4e0c25[_0x97d2('0x42')][_0x97d2('0x44')]?_0x4e0c25[_0x97d2('0x42')]:_0xbe2f1d[_0x97d2('0x41')];if(_0x1d69c7[_0x97d2('0x3f')]['includeAll']){_0x4e0c25[_0x97d2('0x4f')]=[{'all':!![]}];}_0x4e0c25=_[_0x97d2('0x4b')]({},_0x4e0c25,_0x1d69c7['options']);return db[_0x97d2('0x3a')][_0x97d2('0x53')](_0x4e0c25)[_0x97d2('0x33')](handleEntityNotFound(_0x166624,null))[_0x97d2('0x33')](respondWithResult(_0x166624,null))[_0x97d2('0x27')](handleError(_0x166624,null));};exports['create']=function(_0x2e9dfc,_0x1299cf){return db[_0x97d2('0x3a')][_0x97d2('0x54')](_0x2e9dfc[_0x97d2('0x55')],{})[_0x97d2('0x33')](respondWithResult(_0x1299cf,0xc9))[_0x97d2('0x27')](handleError(_0x1299cf,null));};exports['update']=function(_0x1e2758,_0xe4be6){if(_0x1e2758[_0x97d2('0x55')]['id']){delete _0x1e2758[_0x97d2('0x55')]['id'];}return db[_0x97d2('0x3a')][_0x97d2('0x53')]({'where':{'id':_0x1e2758[_0x97d2('0x52')]['id']}})[_0x97d2('0x33')](handleEntityNotFound(_0xe4be6,null))['then'](saveUpdates(_0x1e2758[_0x97d2('0x55')],null))['then'](respondWithResult(_0xe4be6,null))[_0x97d2('0x27')](handleError(_0xe4be6,null));};exports[_0x97d2('0x56')]=function(_0x1e8480,_0x5c9b7){return db['SmsMessage'][_0x97d2('0x53')]({'where':{'id':_0x1e8480[_0x97d2('0x52')]['id']}})['then'](handleEntityNotFound(_0x5c9b7,null))['then'](removeEntity(_0x5c9b7,null))[_0x97d2('0x27')](handleError(_0x5c9b7,null));};exports[_0x97d2('0x57')]=function(_0x47558e,_0x23c809){return db['SmsMessage'][_0x97d2('0x57')]()[_0x97d2('0x33')](respondWithResult(_0x23c809,null))[_0x97d2('0x27')](handleError(_0x23c809,null));};var interaction_log=require(_0x97d2('0x58'))(_0x97d2('0x59'));exports[_0x97d2('0x5a')]=function(_0x5160f7,_0x413428,_0x1236ad){var _0x5b5ec5={'agent':{},'channel':_0x97d2('0x5b')};if(_0x5160f7['body']['id']){delete _0x5160f7[_0x97d2('0x55')]['id'];}_0x5160f7[_0x97d2('0x55')][_0x97d2('0x5c')]=!![];_0x5160f7[_0x97d2('0x55')][_0x97d2('0x5d')]=moment()['format'](_0x97d2('0x5e'));_0x5160f7['body']['UserId']=_0x5160f7[_0x97d2('0x55')][_0x97d2('0x5f')]||_0x5160f7[_0x97d2('0x60')]['id'];_0x5b5ec5[_0x97d2('0x61')]['id']=_0x5160f7[_0x97d2('0x55')][_0x97d2('0x5f')];return db[_0x97d2('0x3a')][_0x97d2('0x53')]({'where':{'id':_0x5160f7[_0x97d2('0x52')]['id'],'UserId':null}})[_0x97d2('0x33')](handleEntityNotFound(_0x413428,null))[_0x97d2('0x33')](saveUpdates(_0x5160f7[_0x97d2('0x55')],null))[_0x97d2('0x33')](function(_0x3e7260){if(_0x3e7260){_0x5b5ec5[_0x97d2('0x24')]=_0x3e7260['get']({'plain':!![]});return db[_0x97d2('0x62')][_0x97d2('0x53')]({'where':{'id':_0x3e7260[_0x97d2('0x63')]}});}return null;})[_0x97d2('0x33')](handleEntityNotFound(_0x413428,null))[_0x97d2('0x33')](function(_0x32e517){if(_0x32e517){return _0x32e517[_0x97d2('0x64')]({'UserId':_0x5160f7[_0x97d2('0x55')][_0x97d2('0x5f')],'read1stAt':_[_0x97d2('0x65')](_0x32e517['read1stAt'])?moment()[_0x97d2('0x66')](_0x97d2('0x5e')):undefined});}return null;})[_0x97d2('0x33')](function(_0x5e558a){if(_0x5e558a){_0x5b5ec5[_0x97d2('0x67')]=_0x5e558a[_0x97d2('0x68')]({'plain':!![]});interaction_log[_0x97d2('0x25')](_0x97d2('0x69'),_0x5160f7[_0x97d2('0x60')]['id'],_0x5160f7[_0x97d2('0x60')][_0x97d2('0x36')],_0x5160f7[_0x97d2('0x60')][_0x97d2('0x6a')],_0x5b5ec5['interaction']['id'],_0x5160f7[_0x97d2('0x55')]?JSON[_0x97d2('0x6b')](_0x5160f7['body']):_0x97d2('0x6c'));return respondWithRpcPromise(_0x97d2('0x6d'),_0x97d2('0x6e'),_0x5b5ec5);}return null;})[_0x97d2('0x33')](function(_0x597714){var _0x19d3ea=_0x97d2('0x6f')+_0x597714['message'][_0x97d2('0x70')];return db[_0x97d2('0x71')][_0x97d2('0x3f')](_0x19d3ea,{'type':db[_0x97d2('0x72')][_0x97d2('0x73')]['SELECT'],'raw':!![]})[_0x97d2('0x33')](function(_0x416267){return _0x416267;});})[_0x97d2('0x33')](function(_0x14047a){if(_0x14047a){_0x5b5ec5[_0x97d2('0x24')][_0x97d2('0x74')]=_0x14047a[0x0];if(!_0x5160f7[_0x97d2('0x55')][_0x97d2('0x5f')])return;return db['User'][_0x97d2('0x53')]({'where':{'id':_0x5160f7['body'][_0x97d2('0x5f')],'role':'agent'},'attributes':['id',_0x97d2('0x36'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x97d2('0x33')](function(_0x1a1cfd){if(!_0x1a1cfd)return null;_0x5b5ec5['message'][_0x97d2('0x61')]=_0x1a1cfd;return _0x5b5ec5;})[_0x97d2('0x33')](function(_0x218978){if(_0x218978){if(_0x5160f7[_0x97d2('0x55')][_0x97d2('0x75')]){_0x5b5ec5['message'][_0x97d2('0x76')]=util['format']('SIP/%s',_0x5160f7[_0x97d2('0x60')][_0x97d2('0x36')]);_0x5b5ec5[_0x97d2('0x24')]['channel']=_0x5b5ec5[_0x97d2('0x77')];_0x5b5ec5['message'][_0x97d2('0x78')]=_0x5b5ec5[_0x97d2('0x77')];_0x5b5ec5[_0x97d2('0x24')][_0x97d2('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x97d2('0x7a'),'message':_0x5b5ec5[_0x97d2('0x24')]},client9002)[_0x97d2('0x33')](function(){return _0x5b5ec5;});}return _0x5b5ec5;}return null;})['then'](respondWithResult(_0x413428,null))[_0x97d2('0x27')](handleError(_0x413428,null));};var interaction_log=require(_0x97d2('0x58'))('sms-interactions');exports['reject']=function(_0x267835,_0x430d47,_0x282766){var _0x6bbef0={'agent':{},'channel':'sms'};if(_0x267835[_0x97d2('0x55')]['id']){delete _0x267835['body']['id'];}_0x267835[_0x97d2('0x55')][_0x97d2('0x5f')]=_0x267835[_0x97d2('0x55')][_0x97d2('0x5f')]||_0x267835[_0x97d2('0x60')]['id'];_0x6bbef0[_0x97d2('0x61')]['id']=_0x267835[_0x97d2('0x55')][_0x97d2('0x5f')];return db[_0x97d2('0x3a')][_0x97d2('0x53')]({'where':{'id':_0x267835[_0x97d2('0x52')]['id'],'UserId':null}})[_0x97d2('0x33')](handleEntityNotFound(_0x430d47,null))[_0x97d2('0x33')](function(_0x57ef14){if(_0x57ef14){_0x6bbef0[_0x97d2('0x24')]=_0x57ef14[_0x97d2('0x68')]({'plain':!![]});return db[_0x97d2('0x62')][_0x97d2('0x53')]({'where':{'id':_0x57ef14[_0x97d2('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x430d47,null))[_0x97d2('0x33')](function(_0x28e8d9){if(_0x28e8d9){_0x6bbef0['interaction']=_0x28e8d9[_0x97d2('0x68')]({'plain':!![]});interaction_log[_0x97d2('0x25')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x267835[_0x97d2('0x60')]['id'],_0x267835[_0x97d2('0x60')][_0x97d2('0x36')],_0x267835[_0x97d2('0x60')]['role'],_0x6bbef0[_0x97d2('0x67')]['id'],_0x267835[_0x97d2('0x55')]?JSON['stringify'](_0x267835['body']):_0x97d2('0x6c'));return respondWithRpcPromise(_0x97d2('0x7b'),_0x97d2('0x7c'),_0x6bbef0);}return null;})[_0x97d2('0x33')](function(_0x394b70){var _0x3d87b3=_0x97d2('0x6f')+_0x394b70['message'][_0x97d2('0x70')];return db['sequelize'][_0x97d2('0x3f')](_0x3d87b3,{'type':db['Sequelize'][_0x97d2('0x73')][_0x97d2('0x7d')],'raw':!![]})[_0x97d2('0x33')](function(_0x59d295){return _0x59d295;});})['then'](function(_0x222407){if(_0x222407){_0x6bbef0[_0x97d2('0x24')][_0x97d2('0x74')]=_0x222407[0x0];if(!_0x267835['body'][_0x97d2('0x5f')])return;return db[_0x97d2('0x7e')]['find']({'where':{'id':_0x267835['body'][_0x97d2('0x5f')],'role':_0x97d2('0x61')},'attributes':['id','name',_0x97d2('0x7f'),_0x97d2('0x80'),_0x97d2('0x81')],'raw':!![]});}return null;})['then'](function(_0xd306d1){if(!_0xd306d1)return null;_0x6bbef0[_0x97d2('0x24')][_0x97d2('0x61')]=_0xd306d1;return _0x6bbef0;})['then'](function(_0x27f6de){if(_0x27f6de){_0x27f6de['message'][_0x97d2('0x76')]=util[_0x97d2('0x66')](_0x97d2('0x82'),_0x267835['user'][_0x97d2('0x36')]);_0x27f6de[_0x97d2('0x24')][_0x97d2('0x77')]=_0x6bbef0[_0x97d2('0x77')];_0x27f6de['message'][_0x97d2('0x78')]=_0x6bbef0[_0x97d2('0x77')];_0x27f6de[_0x97d2('0x24')][_0x97d2('0x79')]=_0x97d2('0x83');respondWithRpcPromise(_0x97d2('0x84'),_0x97d2('0x84'),{'event':_0x97d2('0x85'),'message':_0x27f6de[_0x97d2('0x24')]},client9002);return _0x6bbef0;}return null;})[_0x97d2('0x33')](respondWithResult(_0x430d47,null))[_0x97d2('0x27')](handleError(_0x430d47,null));};exports[_0x97d2('0x29')]=function(_0x588cd7,_0x4e9d77,_0x2d5ad9){if(_0x588cd7[_0x97d2('0x55')]['id']){delete _0x588cd7[_0x97d2('0x55')]['id'];}var _0x170d7b;return db['SmsMessage'][_0x97d2('0x53')]({'where':{'id':_0x588cd7[_0x97d2('0x52')]['id']}})[_0x97d2('0x33')](handleEntityNotFound(_0x4e9d77,null))[_0x97d2('0x33')](function(_0x343722){if(_0x343722){_0x170d7b=_0x343722;return db['SmsAccount'][_0x97d2('0x53')]({'where':{'id':_0x343722[_0x97d2('0x86')]}});}})[_0x97d2('0x33')](handleEntityNotFound(_0x4e9d77,null))[_0x97d2('0x33')](function(_0x4f8dad){if(_0x4f8dad){logger[_0x97d2('0x21')](_0x97d2('0x22'),_0x97d2('0x29'),_0x97d2('0x87'),_0x4f8dad[_0x97d2('0x3d')],util[_0x97d2('0x88')](_0x588cd7[_0x97d2('0x55')],{'showHidden':![],'depth':null}));switch(_0x4f8dad[_0x97d2('0x3d')]){case _0x97d2('0x89'):if(_0x588cd7[_0x97d2('0x55')]['MessageSid']&&_0x588cd7[_0x97d2('0x55')][_0x97d2('0x8a')]===_0x170d7b['messageId']){return _0x170d7b[_0x97d2('0x64')]({'read':!![]});}else{logger[_0x97d2('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x97d2('0x29'),_0x97d2('0x89'),util[_0x97d2('0x88')](_0x588cd7[_0x97d2('0x55')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x588cd7['body'][_0x97d2('0x8b')]&&_0x588cd7[_0x97d2('0x55')]['MessageUUID']===_0x170d7b['messageId']&&_['indexOf'](['sent',_0x97d2('0x8c')],_0x588cd7[_0x97d2('0x55')][_0x97d2('0x8d')])>=0x0){return _0x170d7b[_0x97d2('0x64')]({'read':!![]});}else{logger[_0x97d2('0x23')](_0x97d2('0x8e'),_0x97d2('0x29'),_0x97d2('0x8f'),util['inspect'](_0x588cd7[_0x97d2('0x55')],{'showHidden':![],'depth':null}));}break;case _0x97d2('0x90'):var _0x2c44a0=_0x588cd7[_0x97d2('0x55')][_0x97d2('0x91')][0x0];if(_0x2c44a0[_0x97d2('0x29')][_0x97d2('0x92')]===_0x97d2('0x93')){return _0x170d7b[_0x97d2('0x64')]({'read':!![]});}else{logger[_0x97d2('0x23')](_0x97d2('0x8e'),_0x97d2('0x29'),_0x97d2('0x90'),util[_0x97d2('0x88')](_0x588cd7[_0x97d2('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x170d7b;}})[_0x97d2('0x33')](respondWithResult(_0x4e9d77,null))[_0x97d2('0x27')](handleError(_0x4e9d77,null));}; \ No newline at end of file +var _0x32c3=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','limit','count','apply','save','update','sendStatus','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','length','includeAll','include','find','create','body','destroy','describe','sms-interactions','sms','read','readAt','UserId','agent','SmsInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','channel','motionChannel','event','accept','SmsInteractionId','interaction','get','role','RejectMessage','rejectMessage','QueryTypes','User','interface','reject','EventManager','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','plivio','results','groupName','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x25a281,_0x22ae3b){var _0x12d134=function(_0x3f9cda){while(--_0x3f9cda){_0x25a281['push'](_0x25a281['shift']());}};_0x12d134(++_0x22ae3b);}(_0x32c3,0x1a8));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x332c('0x0'));var rimraf=require(_0x332c('0x1'));var zipdir=require(_0x332c('0x2'));var jsonpatch=require(_0x332c('0x3'));var rp=require(_0x332c('0x4'));var moment=require(_0x332c('0x5'));var BPromise=require(_0x332c('0x6'));var Mustache=require(_0x332c('0x7'));var util=require(_0x332c('0x8'));var path=require(_0x332c('0x9'));var sox=require(_0x332c('0xa'));var csv=require(_0x332c('0xb'));var ejs=require(_0x332c('0xc'));var fs=require('fs');var fs_extra=require(_0x332c('0xd'));var _=require(_0x332c('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x332c('0xf'));var deskjs=require(_0x332c('0x10'));var toCsv=require(_0x332c('0xb'));var querystring=require(_0x332c('0x11'));var Papa=require(_0x332c('0x12'));var Redis=require(_0x332c('0x13'));var authService=require(_0x332c('0x14'));var qs=require(_0x332c('0x15'));var as=require(_0x332c('0x16'));var hardwareService=require(_0x332c('0x17'));var logger=require(_0x332c('0x18'))('api');var utils=require(_0x332c('0x19'));var config=require(_0x332c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x332c('0x1b'))['db'];config[_0x332c('0x1c')]=_[_0x332c('0x1d')](config[_0x332c('0x1c')],{'host':_0x332c('0x1e'),'port':0x18eb});var socket=require(_0x332c('0x1f'))(new Redis(config[_0x332c('0x1c')]));require('./smsMessage.socket')[_0x332c('0x20')](socket);var jayson=require(_0x332c('0x21'));var client=jayson[_0x332c('0x22')][_0x332c('0x23')]({'port':0x232c});var client9002=jayson[_0x332c('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389f96,_0x2678c4,_0x37370d,_0x4f75b8){return new BPromise(function(_0x556b54,_0x2b91de){var _0xc5385e=_0x4f75b8||client;return _0xc5385e[_0x332c('0x24')](_0x389f96,_0x37370d)[_0x332c('0x25')](function(_0x293817){logger[_0x332c('0x26')](_0x332c('0x27'),_0x2678c4,'request\x20sent');logger[_0x332c('0x28')](_0x332c('0x29'),_0x2678c4,_0x332c('0x2a'),JSON[_0x332c('0x2b')](_0x293817));if(_0x293817['error']){if(_0x293817[_0x332c('0x2c')][_0x332c('0x2d')]===0x1f4){logger[_0x332c('0x2c')](_0x332c('0x27'),_0x2678c4,_0x293817['error'][_0x332c('0x2e')]);return _0x2b91de(_0x293817[_0x332c('0x2c')][_0x332c('0x2e')]);}logger[_0x332c('0x2c')](_0x332c('0x27'),_0x2678c4,_0x293817[_0x332c('0x2c')][_0x332c('0x2e')]);return _0x556b54(_0x293817[_0x332c('0x2c')][_0x332c('0x2e')]);}else{logger[_0x332c('0x26')]('SmsMessage,\x20%s,\x20%s',_0x2678c4,_0x332c('0x2a'));_0x556b54(_0x293817['result'][_0x332c('0x2e')]);}})[_0x332c('0x2f')](function(_0x3ba358){logger[_0x332c('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x2678c4,_0x3ba358);_0x2b91de(_0x3ba358);});});}function respondWithStatusCode(_0x5bcfc0,_0x30ba43){_0x30ba43=_0x30ba43||0xcc;return function(_0x36af75){if(_0x36af75){return _0x5bcfc0['sendStatus'](_0x30ba43);}return _0x5bcfc0[_0x332c('0x30')](_0x30ba43)[_0x332c('0x31')]();};}function respondWithResult(_0x112433,_0x5863c6){_0x5863c6=_0x5863c6||0xc8;return function(_0x43f47d){if(_0x43f47d){return _0x112433['status'](_0x5863c6)[_0x332c('0x32')](_0x43f47d);}};}function respondWithFilteredResult(_0x272484,_0x49007b){return function(_0x309286){if(_0x309286){var _0x2af30b=typeof _0x49007b[_0x332c('0x33')]==='undefined'&&typeof _0x49007b[_0x332c('0x34')]==='undefined';var _0x16ec20=_0x309286['count'];var _0x1200d8=_0x2af30b?0x0:_0x49007b['offset'];var _0xd79623=_0x2af30b?_0x309286[_0x332c('0x35')]:_0x49007b[_0x332c('0x33')]+_0x49007b[_0x332c('0x34')];var _0x5624a8;if(_0xd79623>=_0x16ec20){_0xd79623=_0x16ec20;_0x5624a8=0xc8;}else{_0x5624a8=0xce;}_0x272484[_0x332c('0x30')](_0x5624a8);return _0x272484['set']('Content-Range',_0x1200d8+'-'+_0xd79623+'/'+_0x16ec20)['json'](_0x309286);}return null;};}function patchUpdates(_0x5043d6){return function(_0x29385e){try{jsonpatch[_0x332c('0x36')](_0x29385e,_0x5043d6,!![]);}catch(_0x252a2c){return BPromise['reject'](_0x252a2c);}return _0x29385e[_0x332c('0x37')]();};}function saveUpdates(_0xa06702,_0xac2295){return function(_0x331145){if(_0x331145){return _0x331145[_0x332c('0x38')](_0xa06702)[_0x332c('0x25')](function(_0x4978de){return _0x4978de;});}return null;};}function removeEntity(_0x234b60,_0x6727a8){return function(_0x4a5e10){if(_0x4a5e10){return _0x4a5e10['destroy']()[_0x332c('0x25')](function(){_0x234b60[_0x332c('0x30')](0xcc)[_0x332c('0x31')]();});}};}function handleEntityNotFound(_0x520e98,_0x2993d4){return function(_0x21746a){if(!_0x21746a){_0x520e98[_0x332c('0x39')](0x194);}return _0x21746a;};}function handleError(_0x2482fb,_0xcf98a8){_0xcf98a8=_0xcf98a8||0x1f4;return function(_0x392ea5){logger[_0x332c('0x2c')](_0x392ea5[_0x332c('0x3a')]);if(_0x392ea5[_0x332c('0x3b')]){delete _0x392ea5['name'];}_0x2482fb[_0x332c('0x30')](_0xcf98a8)[_0x332c('0x3c')](_0x392ea5);};}exports['index']=function(_0x5686b6,_0x546df8){var _0x7779aa={},_0x5a8576={},_0x590f4b={'count':0x0,'rows':[]};var _0x4c7f71=_[_0x332c('0x3d')](db[_0x332c('0x3e')][_0x332c('0x3f')],function(_0x90b2ec){return{'name':_0x90b2ec[_0x332c('0x40')],'type':_0x90b2ec[_0x332c('0x41')][_0x332c('0x42')]};});_0x5a8576[_0x332c('0x43')]=_[_0x332c('0x3d')](_0x4c7f71,_0x332c('0x3b'));_0x5a8576[_0x332c('0x44')]=_['keys'](_0x5686b6['query']);_0x5a8576[_0x332c('0x45')]=_[_0x332c('0x46')](_0x5a8576[_0x332c('0x43')],_0x5a8576[_0x332c('0x44')]);_0x7779aa[_0x332c('0x47')]=_[_0x332c('0x46')](_0x5a8576[_0x332c('0x43')],qs[_0x332c('0x48')](_0x5686b6['query']['fields']));_0x7779aa[_0x332c('0x47')]=_0x7779aa['attributes']['length']?_0x7779aa[_0x332c('0x47')]:_0x5a8576[_0x332c('0x43')];if(!_0x5686b6[_0x332c('0x44')][_0x332c('0x49')]('nolimit')){_0x7779aa[_0x332c('0x34')]=qs[_0x332c('0x34')](_0x5686b6[_0x332c('0x44')][_0x332c('0x34')]);_0x7779aa['offset']=qs[_0x332c('0x33')](_0x5686b6[_0x332c('0x44')]['offset']);}_0x7779aa[_0x332c('0x4a')]=qs[_0x332c('0x4b')](_0x5686b6[_0x332c('0x44')]['sort']);_0x7779aa[_0x332c('0x4c')]=qs['filters'](_['pick'](_0x5686b6[_0x332c('0x44')],_0x5a8576['filters']),_0x4c7f71);if(_0x5686b6[_0x332c('0x44')][_0x332c('0x4d')]){_0x7779aa['where']=_['merge'](_0x7779aa[_0x332c('0x4c')],{'$or':_['map'](_0x4c7f71,function(_0x350c74){if(_0x350c74['type']!==_0x332c('0x4e')){var _0x2319e1={};_0x2319e1[_0x350c74[_0x332c('0x3b')]]={'$like':'%'+_0x5686b6[_0x332c('0x44')]['filter']+'%'};return _0x2319e1;}})});}_0x7779aa=_[_0x332c('0x4f')]({},_0x7779aa,_0x5686b6[_0x332c('0x50')]);var _0x174951={'where':_0x7779aa[_0x332c('0x4c')]};return db[_0x332c('0x3e')][_0x332c('0x35')](_0x174951)[_0x332c('0x25')](function(_0x59df95){_0x590f4b[_0x332c('0x35')]=_0x59df95;if(_0x5686b6[_0x332c('0x44')]['includeAll']){_0x7779aa['include']=[{'all':!![]}];}return db['SmsMessage'][_0x332c('0x51')](_0x7779aa);})[_0x332c('0x25')](function(_0x40d08d){_0x590f4b[_0x332c('0x52')]=_0x40d08d;return _0x590f4b;})[_0x332c('0x25')](respondWithFilteredResult(_0x546df8,_0x7779aa))[_0x332c('0x2f')](handleError(_0x546df8,null));};exports[_0x332c('0x53')]=function(_0x4c8259,_0x252ef7){var _0x47f069={'raw':!![],'where':{'id':_0x4c8259[_0x332c('0x54')]['id']}},_0x5a551b={};_0x5a551b[_0x332c('0x43')]=_['keys'](db[_0x332c('0x3e')][_0x332c('0x3f')]);_0x5a551b[_0x332c('0x44')]=_[_0x332c('0x55')](_0x4c8259['query']);_0x5a551b['filters']=_[_0x332c('0x46')](_0x5a551b[_0x332c('0x43')],_0x5a551b[_0x332c('0x44')]);_0x47f069[_0x332c('0x47')]=_[_0x332c('0x46')](_0x5a551b[_0x332c('0x43')],qs[_0x332c('0x48')](_0x4c8259[_0x332c('0x44')][_0x332c('0x48')]));_0x47f069[_0x332c('0x47')]=_0x47f069[_0x332c('0x47')][_0x332c('0x56')]?_0x47f069['attributes']:_0x5a551b[_0x332c('0x43')];if(_0x4c8259[_0x332c('0x44')][_0x332c('0x57')]){_0x47f069[_0x332c('0x58')]=[{'all':!![]}];}_0x47f069=_['merge']({},_0x47f069,_0x4c8259[_0x332c('0x50')]);return db['SmsMessage'][_0x332c('0x59')](_0x47f069)['then'](handleEntityNotFound(_0x252ef7,null))[_0x332c('0x25')](respondWithResult(_0x252ef7,null))[_0x332c('0x2f')](handleError(_0x252ef7,null));};exports[_0x332c('0x5a')]=function(_0xf99d06,_0x174954){return db[_0x332c('0x3e')]['create'](_0xf99d06[_0x332c('0x5b')],{})[_0x332c('0x25')](respondWithResult(_0x174954,0xc9))[_0x332c('0x2f')](handleError(_0x174954,null));};exports['update']=function(_0x40c6b6,_0x40b7a5){if(_0x40c6b6[_0x332c('0x5b')]['id']){delete _0x40c6b6[_0x332c('0x5b')]['id'];}return db[_0x332c('0x3e')][_0x332c('0x59')]({'where':{'id':_0x40c6b6[_0x332c('0x54')]['id']}})[_0x332c('0x25')](handleEntityNotFound(_0x40b7a5,null))[_0x332c('0x25')](saveUpdates(_0x40c6b6['body'],null))[_0x332c('0x25')](respondWithResult(_0x40b7a5,null))['catch'](handleError(_0x40b7a5,null));};exports[_0x332c('0x5c')]=function(_0x33ec64,_0x5a1a04){return db[_0x332c('0x3e')][_0x332c('0x59')]({'where':{'id':_0x33ec64[_0x332c('0x54')]['id']}})[_0x332c('0x25')](handleEntityNotFound(_0x5a1a04,null))['then'](removeEntity(_0x5a1a04,null))['catch'](handleError(_0x5a1a04,null));};exports[_0x332c('0x5d')]=function(_0x1bfb0a,_0x3789a3){return db[_0x332c('0x3e')][_0x332c('0x5d')]()[_0x332c('0x25')](respondWithResult(_0x3789a3,null))['catch'](handleError(_0x3789a3,null));};var interaction_log=require(_0x332c('0x18'))(_0x332c('0x5e'));exports['accept']=function(_0xd4ba6a,_0x3142f6,_0x26e269){var _0x49273a={'agent':{},'channel':_0x332c('0x5f')};if(_0xd4ba6a['body']['id']){delete _0xd4ba6a[_0x332c('0x5b')]['id'];}_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x60')]=!![];_0xd4ba6a['body'][_0x332c('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd4ba6a['body'][_0x332c('0x62')]=_0xd4ba6a[_0x332c('0x5b')]['UserId']||_0xd4ba6a['user']['id'];_0x49273a[_0x332c('0x63')]['id']=_0xd4ba6a[_0x332c('0x5b')]['UserId'];return db[_0x332c('0x3e')][_0x332c('0x59')]({'where':{'id':_0xd4ba6a[_0x332c('0x54')]['id'],'UserId':null}})[_0x332c('0x25')](handleEntityNotFound(_0x3142f6,null))[_0x332c('0x25')](saveUpdates(_0xd4ba6a[_0x332c('0x5b')],null))[_0x332c('0x25')](function(_0x168d62){if(_0x168d62){_0x49273a[_0x332c('0x2e')]=_0x168d62['get']({'plain':!![]});return db[_0x332c('0x64')][_0x332c('0x59')]({'where':{'id':_0x168d62['SmsInteractionId']}});}return null;})[_0x332c('0x25')](handleEntityNotFound(_0x3142f6,null))[_0x332c('0x25')](function(_0x204c60){if(_0x204c60){return _0x204c60['update']({'UserId':_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x62')],'read1stAt':_[_0x332c('0x65')](_0x204c60[_0x332c('0x66')])?moment()[_0x332c('0x67')](_0x332c('0x68')):undefined});}return null;})['then'](function(_0xef4811){if(_0xef4811){_0x49273a['interaction']=_0xef4811['get']({'plain':!![]});interaction_log['info'](_0x332c('0x69'),_0xd4ba6a['user']['id'],_0xd4ba6a[_0x332c('0x6a')][_0x332c('0x3b')],_0xd4ba6a[_0x332c('0x6a')]['role'],_0x49273a['interaction']['id'],_0xd4ba6a[_0x332c('0x5b')]?JSON['stringify'](_0xd4ba6a[_0x332c('0x5b')]):_0x332c('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x49273a);}return null;})[_0x332c('0x25')](function(_0x161a48){var _0x1f7412=_0x332c('0x6c')+_0x161a48[_0x332c('0x2e')][_0x332c('0x6d')];return db[_0x332c('0x6e')][_0x332c('0x44')](_0x1f7412,{'type':db[_0x332c('0x6f')]['QueryTypes'][_0x332c('0x70')],'raw':!![]})[_0x332c('0x25')](function(_0xb7ffae){return _0xb7ffae;});})[_0x332c('0x25')](function(_0x539ee7){if(_0x539ee7){_0x49273a[_0x332c('0x2e')][_0x332c('0x71')]=_0x539ee7[0x0];if(!_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x62')])return;return db['User'][_0x332c('0x59')]({'where':{'id':_0xd4ba6a[_0x332c('0x5b')][_0x332c('0x62')],'role':_0x332c('0x63')},'attributes':['id','name',_0x332c('0x72'),_0x332c('0x73'),_0x332c('0x74')],'raw':!![]});}return null;})[_0x332c('0x25')](function(_0x231492){if(!_0x231492)return null;_0x49273a['message'][_0x332c('0x63')]=_0x231492;return _0x49273a;})[_0x332c('0x25')](function(_0x279962){if(_0x279962){if(_0xd4ba6a[_0x332c('0x5b')]['manual']){_0x49273a['message']['interface']=util[_0x332c('0x67')]('SIP/%s',_0xd4ba6a[_0x332c('0x6a')][_0x332c('0x3b')]);_0x49273a[_0x332c('0x2e')][_0x332c('0x75')]=_0x49273a[_0x332c('0x75')];_0x49273a['message'][_0x332c('0x76')]=_0x49273a[_0x332c('0x75')];_0x49273a[_0x332c('0x2e')][_0x332c('0x77')]=_0x332c('0x78');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x49273a[_0x332c('0x2e')]},client9002)['then'](function(){return _0x49273a;});}return _0x49273a;}return null;})[_0x332c('0x25')](respondWithResult(_0x3142f6,null))[_0x332c('0x2f')](handleError(_0x3142f6,null));};var interaction_log=require(_0x332c('0x18'))(_0x332c('0x5e'));exports['reject']=function(_0x2b0eba,_0xac8b72,_0x23a158){var _0x368920={'agent':{},'channel':_0x332c('0x5f')};if(_0x2b0eba[_0x332c('0x5b')]['id']){delete _0x2b0eba[_0x332c('0x5b')]['id'];}_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')]=_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')]||_0x2b0eba[_0x332c('0x6a')]['id'];_0x368920['agent']['id']=_0x2b0eba['body'][_0x332c('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x2b0eba[_0x332c('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xac8b72,null))[_0x332c('0x25')](function(_0x1c471c){if(_0x1c471c){_0x368920[_0x332c('0x2e')]=_0x1c471c['get']({'plain':!![]});return db[_0x332c('0x64')][_0x332c('0x59')]({'where':{'id':_0x1c471c[_0x332c('0x79')]}});}return null;})[_0x332c('0x25')](handleEntityNotFound(_0xac8b72,null))['then'](function(_0x5a1b06){if(_0x5a1b06){_0x368920[_0x332c('0x7a')]=_0x5a1b06[_0x332c('0x7b')]({'plain':!![]});interaction_log[_0x332c('0x26')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b0eba[_0x332c('0x6a')]['id'],_0x2b0eba['user'][_0x332c('0x3b')],_0x2b0eba[_0x332c('0x6a')][_0x332c('0x7c')],_0x368920[_0x332c('0x7a')]['id'],_0x2b0eba[_0x332c('0x5b')]?JSON['stringify'](_0x2b0eba[_0x332c('0x5b')]):_0x332c('0x6b'));return respondWithRpcPromise(_0x332c('0x7d'),_0x332c('0x7e'),_0x368920);}return null;})[_0x332c('0x25')](function(_0x280631){var _0x4a0327='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x280631[_0x332c('0x2e')][_0x332c('0x6d')];return db['sequelize']['query'](_0x4a0327,{'type':db[_0x332c('0x6f')][_0x332c('0x7f')]['SELECT'],'raw':!![]})[_0x332c('0x25')](function(_0x584652){return _0x584652;});})['then'](function(_0x287b55){if(_0x287b55){_0x368920[_0x332c('0x2e')][_0x332c('0x71')]=_0x287b55[0x0];if(!_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')])return;return db[_0x332c('0x80')][_0x332c('0x59')]({'where':{'id':_0x2b0eba[_0x332c('0x5b')][_0x332c('0x62')],'role':_0x332c('0x63')},'attributes':['id','name',_0x332c('0x72'),_0x332c('0x73'),_0x332c('0x74')],'raw':!![]});}return null;})[_0x332c('0x25')](function(_0x57a126){if(!_0x57a126)return null;_0x368920[_0x332c('0x2e')][_0x332c('0x63')]=_0x57a126;return _0x368920;})[_0x332c('0x25')](function(_0x305e02){if(_0x305e02){_0x305e02[_0x332c('0x2e')][_0x332c('0x81')]=util[_0x332c('0x67')]('SIP/%s',_0x2b0eba[_0x332c('0x6a')][_0x332c('0x3b')]);_0x305e02[_0x332c('0x2e')]['channel']=_0x368920[_0x332c('0x75')];_0x305e02[_0x332c('0x2e')][_0x332c('0x76')]=_0x368920[_0x332c('0x75')];_0x305e02['message'][_0x332c('0x77')]=_0x332c('0x82');respondWithRpcPromise(_0x332c('0x83'),_0x332c('0x83'),{'event':_0x332c('0x84'),'message':_0x305e02[_0x332c('0x2e')]},client9002);return _0x368920;}return null;})[_0x332c('0x25')](respondWithResult(_0xac8b72,null))[_0x332c('0x2f')](handleError(_0xac8b72,null));};exports[_0x332c('0x30')]=function(_0x323369,_0x5ca8a5,_0x31572b){if(_0x323369['body']['id']){delete _0x323369['body']['id'];}var _0x55fd0e;return db[_0x332c('0x3e')]['find']({'where':{'id':_0x323369[_0x332c('0x54')]['id']}})[_0x332c('0x25')](handleEntityNotFound(_0x5ca8a5,null))['then'](function(_0x360290){if(_0x360290){_0x55fd0e=_0x360290;return db[_0x332c('0x85')][_0x332c('0x59')]({'where':{'id':_0x360290[_0x332c('0x86')]}});}})[_0x332c('0x25')](handleEntityNotFound(_0x5ca8a5,null))[_0x332c('0x25')](function(_0x56bbe1){if(_0x56bbe1){logger[_0x332c('0x28')](_0x332c('0x29'),_0x332c('0x30'),'received\x20delivery\x20report\x20from',_0x56bbe1['type'],util[_0x332c('0x87')](_0x323369[_0x332c('0x5b')],{'showHidden':![],'depth':null}));switch(_0x56bbe1[_0x332c('0x41')]){case'twilio':if(_0x323369[_0x332c('0x5b')]['MessageSid']&&_0x323369['body'][_0x332c('0x88')]===_0x55fd0e[_0x332c('0x89')]){return _0x55fd0e['update']({'read':!![]});}else{logger['error'](_0x332c('0x8a'),'status',_0x332c('0x8b'),util[_0x332c('0x87')](_0x323369[_0x332c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x332c('0x8c'):if(_0x323369[_0x332c('0x5b')][_0x332c('0x8d')]&&_0x323369[_0x332c('0x5b')]['MessageUUID']===_0x55fd0e[_0x332c('0x89')]&&_[_0x332c('0x8e')]([_0x332c('0x8f'),_0x332c('0x90')],_0x323369[_0x332c('0x5b')]['Status'])>=0x0){return _0x55fd0e['update']({'read':!![]});}else{logger[_0x332c('0x2c')](_0x332c('0x8a'),_0x332c('0x30'),_0x332c('0x91'),util[_0x332c('0x87')](_0x323369['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x38f0c3=_0x323369[_0x332c('0x5b')][_0x332c('0x92')][0x0];if(_0x38f0c3[_0x332c('0x30')][_0x332c('0x93')]==='DELIVERED'){return _0x55fd0e[_0x332c('0x38')]({'read':!![]});}else{logger[_0x332c('0x2c')](_0x332c('0x8a'),_0x332c('0x30'),_0x332c('0x94'),util[_0x332c('0x87')](_0x323369[_0x332c('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x55fd0e;}})[_0x332c('0x25')](respondWithResult(_0x5ca8a5,null))[_0x332c('0x2f')](handleError(_0x5ca8a5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index abad81d..526a1c9 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 _0x86c9=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4c2aba,_0x263b89){var _0x581bfe=function(_0x367a5c){while(--_0x367a5c){_0x4c2aba['push'](_0x4c2aba['shift']());}};_0x581bfe(++_0x263b89);}(_0x86c9,0x1bb));var _0x986c=function(_0xce8b56,_0x14e725){_0xce8b56=_0xce8b56-0x0;var _0x5eb4c2=_0x86c9[_0xce8b56];return _0x5eb4c2;};'use strict';var EventEmitter=require(_0x986c('0x0'));var SmsMessage=require(_0x986c('0x1'))['db'][_0x986c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x986c('0x3')](0x0);var events={'afterCreate':_0x986c('0x4'),'afterUpdate':_0x986c('0x5'),'afterDestroy':_0x986c('0x6')};function emitEvent(_0x316b51){return function(_0x25776b,_0x3c8b2f,_0x3d2a5d){SmsMessageEvents['emit'](_0x316b51+':'+_0x25776b['id'],_0x25776b);SmsMessageEvents[_0x986c('0x7')](_0x316b51,_0x25776b);_0x3d2a5d(null);};}for(var e in events){if(events[_0x986c('0x8')](e)){var event=events[e];SmsMessage[_0x986c('0x9')](e,emitEvent(event));}}module[_0x986c('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0x043b=['hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x043b,0xb0));var _0xb043=function(_0x246e35,_0x586dff){_0x246e35=_0x246e35-0x0;var _0x4895ef=_0x043b[_0x246e35];return _0x4895ef;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xb043('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb043('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb043('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3abf2f){return function(_0x58efa1,_0x582302,_0x237b58){SmsMessageEvents['emit'](_0x3abf2f+':'+_0x58efa1['id'],_0x58efa1);SmsMessageEvents[_0xb043('0x3')](_0x3abf2f,_0x58efa1);_0x237b58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xb043('0x4')](e,emitEvent(event));}}module[_0xb043('0x5')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ec210f8..328eefe 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 _0x7186=['timestamp','sort','apiKey','createHash','md5','digest','hex','signature=','keys','Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','error','find','type','twilio','accountSid','authToken','phone','messages','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','split','sms','POST','user_key','total_sent','deliveryReport','read','afterCreate','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','text'];(function(_0xbb3cd1,_0x4dd38c){var _0x559edf=function(_0x8344c4){while(--_0x8344c4){_0xbb3cd1['push'](_0xbb3cd1['shift']());}};_0x559edf(++_0x4dd38c);}(_0x7186,0x111));var _0x6718=function(_0x597a30,_0x442263){_0x597a30=_0x597a30-0x0;var _0x1fd04a=_0x7186[_0x597a30];return _0x1fd04a;};'use strict';var _=require(_0x6718('0x0'));var util=require(_0x6718('0x1'));var logger=require(_0x6718('0x2'))(_0x6718('0x3'));var moment=require('moment');var BPromise=require(_0x6718('0x4'));var rp=require(_0x6718('0x5'));var fs=require('fs');var path=require(_0x6718('0x6'));var rimraf=require(_0x6718('0x7'));var config=require(_0x6718('0x8'));var attributes=require(_0x6718('0x9'));module[_0x6718('0xa')]=function(_0x242b16,_0x31b2fa){return _0x242b16[_0x6718('0xb')](_0x6718('0xc'),attributes,{'tableName':_0x6718('0xd'),'paranoid':![],'indexes':[{'name':_0x6718('0xe'),'fields':[_0x6718('0xe')]},{'name':_0x6718('0xf'),'fields':[_0x6718('0x10')],'type':_0x6718('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42834d,_0x1d1a20,_0x3242fe){var _0x42b5a4=_0x242b16[_0x6718('0x12')];var _0x32ccde=_0x42834d[_0x6718('0x13')]({'plain':!![]});if(_0x32ccde['direction'][_0x6718('0x14')]()==='in'||_0x32ccde['direction']['toLowerCase']()===_0x6718('0x15')&&!_0x32ccde[_0x6718('0x16')]&&!_[_0x6718('0x17')](_0x32ccde[_0x6718('0x18')])&&!_[_0x6718('0x17')](_0x32ccde['SmsInteractionId'])){_0x42b5a4['SmsInteraction'][_0x6718('0x19')]({'where':{'id':_0x32ccde[_0x6718('0x1a')]}})[_0x6718('0x1b')](function(_0xa07de3){if(_0xa07de3){_0xa07de3[_0x6718('0x1c')]({'lastMsgAt':_0x32ccde[_0x6718('0x1d')],'lastMsgDirection':_0x32ccde['direction'][_0x6718('0x14')]()});}})[_0x6718('0x1e')](function(_0x7d54de){console[_0x6718('0x1f')](_0x7d54de);});}if(_0x32ccde['direction']===_0x6718('0x15')&&!_0x32ccde[_0x6718('0x16')]){var _0xb7c583;_0x42b5a4['SmsAccount'][_0x6718('0x20')]({'where':{'id':_0x32ccde['SmsAccountId']},'raw':!![]})[_0x6718('0x1b')](function(_0x17a2e4){_0xb7c583=_0x17a2e4;if(_0xb7c583&&_0xb7c583[_0x6718('0x21')]){switch(_0xb7c583[_0x6718('0x21')]){case _0x6718('0x22'):var _0x43c690=require(_0x6718('0x22'));if(_0xb7c583[_0x6718('0x23')]&&_0xb7c583[_0x6718('0x24')]&&_0xb7c583[_0x6718('0x25')]){var _0x3028d5=new _0x43c690(_0xb7c583['accountSid'],_0xb7c583['authToken']);_0x3028d5[_0x6718('0x26')]['create']({'body':_0x32ccde[_0x6718('0x10')],'to':_0x32ccde['phone'],'from':_0xb7c583[_0x6718('0x25')],'statusCallback':_0xb7c583[_0x6718('0x27')]+'/api/sms/messages/'+_0x32ccde['id']+'/status?token='+_0xb7c583[_0x6718('0x28')]})[_0x6718('0x1b')](function(_0x200288){if(_0x200288['sid']){return _0x42834d[_0x6718('0x1c')]({'messageId':_0x200288[_0x6718('0x29')]});}})[_0x6718('0x1e')](function(_0x15619c){logger[_0x6718('0x1f')](_0x6718('0x2a'),'afterCreate','twilio',util[_0x6718('0x2b')](_0x15619c,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6718('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x2dd90d=_0x6718('0x2c');if(_0xb7c583['username']&&_0xb7c583[_0x6718('0x2d')]){var _0x5e8035={'recipient':[_0x32ccde[_0x6718('0x25')]],'message':_0x32ccde['body'],'message_type':_0xb7c583[_0x6718('0x2e')]};if(_0xb7c583['smsMethod']&&_0xb7c583[_0x6718('0x2e')]!=='SI'){_0x5e8035[_0x6718('0x2f')]=_0xb7c583[_0x6718('0x25')];}var _0x12a87e={'url':_0x2dd90d+_0x6718('0x30')+_0xb7c583[_0x6718('0x31')]+'&password='+_0xb7c583[_0x6718('0x2d')],'method':'GET'};rp(_0x12a87e)[_0x6718('0x1b')](function(_0x498992){var _0x1ac428=_0x498992[_0x6718('0x32')](';');var _0x4bf18a={'user_key':_0x1ac428[0x0],'session_key':_0x1ac428[0x1]};_0x12a87e={'url':_0x2dd90d+_0x6718('0x33'),'method':_0x6718('0x34'),'headers':{'user_key':_0x4bf18a[_0x6718('0x35')],'Session_key':_0x4bf18a['session_key']},'json':!![],'body':_0x5e8035};return rp(_0x12a87e);})[_0x6718('0x1b')](function(_0x1dc177){if(_0x1dc177[_0x6718('0x36')]>=0x1){var _0x59e06={'messageId':_0x1dc177['internal_order_id']};if(_0xb7c583['smsMethod']!=='GP'||!_0xb7c583[_0x6718('0x37')]){_0x59e06[_0x6718('0x38')]=!![];}return _0x42834d['update'](_0x59e06);}else{return logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6718('0x39'),_0x6718('0x3a'),util[_0x6718('0x2b')](_0x1dc177,{'showHidden':![],'depth':null}));}})[_0x6718('0x1e')](function(_0x196ddd){return logger[_0x6718('0x1f')](_0x6718('0x2a'),'afterCreate',_0x6718('0x3a'),util[_0x6718('0x2b')](_0x196ddd,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6718('0x3a'),_0x6718('0x3b'));}break;case'connectel':if(_0xb7c583[_0x6718('0x24')]){var _0x5d7f1e={'recipient':_0x32ccde[_0x6718('0x25')],'message':_0x32ccde[_0x6718('0x10')],'sender':_0xb7c583[_0x6718('0x3c')]||_0xb7c583[_0x6718('0x25')],'authorization':_0xb7c583[_0x6718('0x24')]};var _0x1d1a20={'method':_0x6718('0x34'),'uri':_0x6718('0x3d'),'body':_0x5d7f1e,'json':!![]};rp(_0x1d1a20)[_0x6718('0x1b')](function(_0x1b7f11){var _0xc78ad8={'messageId':_0x1b7f11['requestid']};if(!_0xb7c583['deliveryReport']){_0xc78ad8[_0x6718('0x38')]=!![];}return _0x42834d[_0x6718('0x1c')](_0xc78ad8);})[_0x6718('0x1e')](function(_0x14a94d){logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x3e'),util[_0x6718('0x2b')](_0x14a94d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6718('0x2a'),_0x6718('0x39'),'connectel',_0x6718('0x3f'));}break;case'clicksend':if(_0xb7c583[_0x6718('0x31')]&&_0xb7c583[_0x6718('0x2d')]){var _0x5d7f1e={'messages':[{'source':_0x6718('0x40'),'to':_0x32ccde[_0x6718('0x25')],'body':_0x32ccde[_0x6718('0x10')],'from':_0xb7c583[_0x6718('0x3c')]||_0xb7c583[_0x6718('0x25')]}]};var _0x44edf9=util[_0x6718('0x41')]('%s:%s',_0xb7c583[_0x6718('0x31')],_0xb7c583[_0x6718('0x2d')]);var _0x1d1a20={'method':_0x6718('0x34'),'uri':_0x6718('0x42'),'body':_0x5d7f1e,'headers':{'Authorization':util['format'](_0x6718('0x43'),new Buffer(_0x44edf9)[_0x6718('0x44')]('base64'))},'json':!![]};rp(_0x1d1a20)[_0x6718('0x1b')](function(_0x27a347){if(_0x27a347[_0x6718('0x45')]>=0xc8&&_0x27a347['http_code']<=0xce){if(_0x27a347[_0x6718('0x46')]&&_0x27a347['data'][_0x6718('0x47')]>0x0){var _0x1b12ed=_['head'](_0x27a347[_0x6718('0x46')][_0x6718('0x26')]);var _0x2d4a64={'messageId':_0x1b12ed['message_id']};if(!_0xb7c583[_0x6718('0x37')]){_0x2d4a64[_0x6718('0x38')]=!![];}return _0x42834d[_0x6718('0x1c')](_0x2d4a64);}else{logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6718('0x39'),'clickSend',util[_0x6718('0x2b')](_0x27a347,{'showHidden':![],'depth':null}));}}else{logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x48'),util[_0x6718('0x2b')](_0x27a347,{'showHidden':![],'depth':null}));}})[_0x6718('0x1e')](function(_0x4d5ac2){logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x48'),util[_0x6718('0x2b')](_0x4d5ac2,{'showHidden':![],'depth':null}));});}else{logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6718('0x39'),_0x6718('0x48'),_0x6718('0x3b'));}break;case _0x6718('0x49'):if(_0xb7c583[_0x6718('0x4a')]&&_0xb7c583['authToken']){var _0x5d7f1e={'dst':_0x32ccde['phone'],'text':_0x32ccde[_0x6718('0x10')],'src':_0xb7c583['senderString']||_0xb7c583[_0x6718('0x25')],'url':_0xb7c583[_0x6718('0x27')]+'/api/sms/messages/'+_0x32ccde['id']+'/status?token='+_0xb7c583[_0x6718('0x28')]};var _0x44edf9=util['format']('%s:%s',_0xb7c583['authId'],_0xb7c583[_0x6718('0x24')]);var _0x1d1a20={'method':_0x6718('0x34'),'uri':util['format'](_0x6718('0x4b'),_0xb7c583[_0x6718('0x4a')]),'body':_0x5d7f1e,'headers':{'Authorization':util[_0x6718('0x41')]('Basic\x20%s',new Buffer(_0x44edf9)[_0x6718('0x44')](_0x6718('0x4c')))},'json':!![]};rp(_0x1d1a20)['then'](function(_0x1a2875){var _0x1ae24d={'messageId':_0x1a2875[_0x6718('0x4d')][0x0]};return _0x42834d[_0x6718('0x1c')](_0x1ae24d);})[_0x6718('0x1e')](function(_0x173311){logger[_0x6718('0x1f')](_0x6718('0x2a'),'afterCreate','plivo',util['inspect'](_0x173311,{'showHidden':![],'depth':null}));});}else{logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0x6718('0x4e'));}break;case _0x6718('0x4f'):if(_0xb7c583['username']&&_0xb7c583[_0x6718('0x2d')]){if(_0xb7c583[_0x6718('0x50')]){var _0x45532e={'method':_0x6718('0x34'),'uri':_0xb7c583['baseUrl']+_0x6718('0x51'),'body':{'username':_0xb7c583[_0x6718('0x31')],'password':_0xb7c583[_0x6718('0x2d')]},'json':!![]};return rp(_0x45532e)[_0x6718('0x1b')](function(_0x5305a8){var _0x30dca1={'method':_0x6718('0x34'),'uri':_0xb7c583[_0x6718('0x50')]+_0x6718('0x52'),'body':{'messages':[{'from':_0xb7c583[_0x6718('0x25')],'destinations':[{'to':_0x32ccde[_0x6718('0x25')]}],'text':_0x32ccde[_0x6718('0x10')],'notifyUrl':_0xb7c583[_0x6718('0x27')]+'/api/sms/messages/'+_0x32ccde['id']+_0x6718('0x53')+_0xb7c583[_0x6718('0x28')],'notifyContentType':_0x6718('0x54'),'callbackData':_0xb7c583[_0x6718('0x25')]+';'+_0x32ccde[_0x6718('0x10')]}]},'headers':{'Authorization':_0x6718('0x55')+_0x5305a8[_0x6718('0x28')]},'json':!![]};return rp(_0x30dca1)[_0x6718('0x1b')](function(_0x3713eb){if(_0x3713eb[_0x6718('0x26')]){var _0x40aa51={'messageId':_0x3713eb[_0x6718('0x26')][0x0]['messageId']};if(!_0xb7c583['deliveryReport']){_0x40aa51[_0x6718('0x38')]=!![];}return _0x42834d[_0x6718('0x1c')](_0x40aa51);}else{return logger['error'](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x4f'),util[_0x6718('0x2b')](_0x3713eb,{'showHidden':![],'depth':null}));}});})[_0x6718('0x1e')](function(_0xfe8a2e){return logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),'infobip',util['inspect'](_0xfe8a2e,{'showHidden':![],'depth':null}));});}else{logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6718('0x39'),_0x6718('0x4f'),_0x6718('0x56'));}}else{logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),'infobip',_0x6718('0x3b'));}break;case _0x6718('0x57'):var _0x5b1a43=require(_0x6718('0x58'));if(_0xb7c583['apiKey']){var _0x805ddc={};_0x805ddc['login']=_0xb7c583['username'];_0x805ddc[_0x6718('0x25')]=_0x32ccde[_0x6718('0x25')];_0x805ddc['sender']=_0xb7c583[_0x6718('0x25')];_0x805ddc[_0x6718('0x59')]=_0x32ccde['body'];_0x805ddc[_0x6718('0x5a')]=+new Date();var _0x469a67='';var _0xd04ff2='';var _0x320613=Object['keys'](_0x805ddc);_0x320613[_0x6718('0x5b')]();for(var _0x2abb95=0x0;_0x2abb95<_0x320613['length'];_0x2abb95++){if(_0x469a67!=''){_0x469a67+='&';}_0x469a67+=_0x320613[_0x2abb95]+'='+encodeURIComponent(_0x805ddc[_0x320613[_0x2abb95]]);_0xd04ff2+=_0x805ddc[_0x320613[_0x2abb95]];}_0xd04ff2+=_0xb7c583[_0x6718('0x5c')];_0xd04ff2=_0x5b1a43[_0x6718('0x5d')](_0x6718('0x5e'))[_0x6718('0x1c')](_0xd04ff2)[_0x6718('0x5f')](_0x6718('0x60'));if(_0x469a67!==''){_0x469a67+='&';}_0x469a67+=_0x6718('0x61')+_0xd04ff2;var _0x12a87e={'method':'GET','uri':_0xb7c583[_0x6718('0x50')]+'/external/get/send.php?'+_0x469a67,'json':!![]};return rp(_0x12a87e)[_0x6718('0x1b')](function(_0x5467ce){var _0xc58d37=Object[_0x6718('0x62')](_0x5467ce);if(_0x5467ce[_0xc58d37[0x0]][_0x6718('0x1f')]&&parseInt(_0x5467ce[_0xc58d37[0x0]][_0x6718('0x1f')])===0x0){var _0x22c6b3={'messageId':_0x5467ce[_0xc58d37[0x0]]['id_sms']};if(!_0xb7c583[_0x6718('0x37')]){_0x22c6b3[_0x6718('0x38')]=!![];}return _0x42834d[_0x6718('0x1c')](_0x22c6b3);}else{return logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x57'),util[_0x6718('0x2b')](_0x5467ce[_0x6718('0x1f')],{'showHidden':![],'depth':null}));}})[_0x6718('0x1e')](function(_0x32e9a7){return logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x57'),util[_0x6718('0x2b')](_0x32e9a7,{'showHidden':![],'depth':null}));});}else{logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6718('0x57'),_0x6718('0x63'));}break;case'clickatell':if(_0xb7c583[_0x6718('0x5c')]){var _0x157172={'method':_0x6718('0x34'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xb7c583[_0x6718('0x5c')]},'body':{'content':_0x32ccde[_0x6718('0x10')],'to':[_0x32ccde[_0x6718('0x25')]],'from':_0xb7c583['phone'],'binary':![],'clientMessageId':_0x6718('0x64'),'charset':_0x6718('0x65')},'json':!![]};rp(_0x157172)[_0x6718('0x1b')](function(_0x17debd){if(!_0x17debd[_0x6718('0x1f')]){var _0x130387={'messageId':_0x17debd[_0x6718('0x26')][0x0][_0x6718('0x66')]};if(!_0xb7c583[_0x6718('0x37')]){_0x130387['read']=!![];}return _0x42834d[_0x6718('0x1c')](_0x130387);}else{return logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6718('0x67'),util[_0x6718('0x2b')](_0x17debd['error'],{'showHidden':![],'depth':null}));}})[_0x6718('0x1e')](function(_0xbc66ab){return logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),'clickatell',util[_0x6718('0x2b')](_0xbc66ab,{'showHidden':![],'depth':null}));});}else{logger[_0x6718('0x1f')](_0x6718('0x2a'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0xb7c583[_0x6718('0x31')]&&_0xb7c583[_0x6718('0x2d')]){var _0x44edf9=util[_0x6718('0x41')](_0x6718('0x68'),_0xb7c583[_0x6718('0x31')],_0xb7c583['password']);var _0x1d1a20={'method':_0x6718('0x34'),'uri':_0x6718('0x69')+_0xb7c583[_0x6718('0x6a')]+_0x6718('0x6b'),'body':{'to':[_0x32ccde[_0x6718('0x25')]],'text':_0x32ccde[_0x6718('0x10')],'from':_0xb7c583[_0x6718('0x25')],'applicationId':_0xb7c583[_0x6718('0x6c')]},'headers':{'Authorization':util[_0x6718('0x41')](_0x6718('0x43'),new Buffer(_0x44edf9)[_0x6718('0x44')](_0x6718('0x4c')))},'json':!![]};rp(_0x1d1a20)[_0x6718('0x1b')](function(_0x2a8c4e){if(_0x2a8c4e['id']){var _0x2cdd9e={'messageId':_0x2a8c4e['id']};return _0x42834d[_0x6718('0x1c')](_0x2cdd9e);}else{logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x6d'),util['inspect'](_0x2a8c4e,{'showHidden':![],'depth':null}));}})[_0x6718('0x1e')](function(_0x55d27a){logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),'bandwidth',util[_0x6718('0x2b')](_0x55d27a,{'showHidden':![],'depth':null}));});}else{logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x6d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x6718('0x6e'):if(_0xb7c583[_0x6718('0x5c')]){var _0x264953={};var _0x12a87e={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0xb7c583[_0x6718('0x5c')],'Content-Type':_0x6718('0x54')},'body':{'from':_0xb7c583['phone'],'to':_0x32ccde['phone'],'text':_0x32ccde['body']},'json':!![]};return rp(_0x12a87e)[_0x6718('0x1b')](function(_0x17610e){if(_0x17610e[_0x6718('0x6f')]==0xca){_0x264953[_0x6718('0x70')]=_0x17610e;var _0x48a865={'method':_0x6718('0x34'),'uri':_0x6718('0x71'),'headers':{'Authorization':_0x6718('0x72')+_0xb7c583['apiKey'],'Content-Type':_0x6718('0x54')},'body':{'refid':_0x264953[_0x6718('0x70')][_0x6718('0x73')]},'json':!![]};return rp(_0x48a865)[_0x6718('0x1b')](function(_0x180218){_0x264953[_0x6718('0x74')]=_0x180218;var _0xe59988={'messageId':_0x264953[_0x6718('0x70')][_0x6718('0x73')],'read':!![]};return _0x42834d[_0x6718('0x1c')](_0xe59988);});}else{return logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x6e'),util[_0x6718('0x2b')](_0x17610e,{'showHidden':![],'depth':null}));}})[_0x6718('0x1e')](function(_0x13b332){return logger[_0x6718('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6718('0x39'),_0x6718('0x6e'),util[_0x6718('0x2b')](_0x13b332,{'showHidden':![],'depth':null}));});}else{return logger[_0x6718('0x1f')](_0x6718('0x2a'),_0x6718('0x39'),_0x6718('0x6e'),_0x6718('0x75'));}break;}}})[_0x6718('0x76')](function(){_0x3242fe();});}else{_0x3242fe();}}},'charset':_0x6718('0x77'),'collate':_0x6718('0x78')});}; \ No newline at end of file +var _0x7c62=['applicationId','Basic\x20%s','bandwidth','intelepeer','Bearer\x20','code','message','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','api','moment','request-promise','../../config/environment','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','update','createdAt','catch','SmsAccount','SmsAccountId','then','type','twilio','accountSid','phone','authToken','create','remote','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','toString','base64','http_code','data','messages','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','md5','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages'];(function(_0x39c12e,_0x265488){var _0x2f0a8c=function(_0x29e3cb){while(--_0x29e3cb){_0x39c12e['push'](_0x39c12e['shift']());}};_0x2f0a8c(++_0x265488);}(_0x7c62,0xf5));var _0x27c6=function(_0x20f23d,_0x52e944){_0x20f23d=_0x20f23d-0x0;var _0x3415c4=_0x7c62[_0x20f23d];return _0x3415c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x27c6('0x0'));var moment=require(_0x27c6('0x1'));var BPromise=require('bluebird');var rp=require(_0x27c6('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x27c6('0x3'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x350b02,_0x7d4a4){return _0x350b02['define'](_0x27c6('0x4'),attributes,{'tableName':_0x27c6('0x5'),'paranoid':![],'indexes':[{'name':_0x27c6('0x6'),'fields':[_0x27c6('0x6')]},{'name':'fti_sms_messages','fields':[_0x27c6('0x7')],'type':_0x27c6('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39e543,_0x12b275,_0x372679){var _0x2106bb=_0x350b02[_0x27c6('0x9')];var _0x382df6=_0x39e543['get']({'plain':!![]});if(_0x382df6[_0x27c6('0xa')][_0x27c6('0xb')]()==='in'||_0x382df6[_0x27c6('0xa')][_0x27c6('0xb')]()===_0x27c6('0xc')&&!_0x382df6[_0x27c6('0xd')]&&!_[_0x27c6('0xe')](_0x382df6[_0x27c6('0xf')])&&!_[_0x27c6('0xe')](_0x382df6[_0x27c6('0x10')])){_0x2106bb[_0x27c6('0x11')]['findOne']({'where':{'id':_0x382df6['SmsInteractionId']}})['then'](function(_0xeb2e43){if(_0xeb2e43){_0xeb2e43[_0x27c6('0x12')]({'lastMsgAt':_0x382df6[_0x27c6('0x13')],'lastMsgDirection':_0x382df6['direction'][_0x27c6('0xb')]()});}})[_0x27c6('0x14')](function(_0x3b9ebc){console['error'](_0x3b9ebc);});}if(_0x382df6[_0x27c6('0xa')]===_0x27c6('0xc')&&!_0x382df6[_0x27c6('0xd')]){var _0x53fba;_0x2106bb[_0x27c6('0x15')]['find']({'where':{'id':_0x382df6[_0x27c6('0x16')]},'raw':!![]})[_0x27c6('0x17')](function(_0x17dc70){_0x53fba=_0x17dc70;if(_0x53fba&&_0x53fba['type']){switch(_0x53fba[_0x27c6('0x18')]){case _0x27c6('0x19'):var _0x4dd299=require(_0x27c6('0x19'));if(_0x53fba[_0x27c6('0x1a')]&&_0x53fba['authToken']&&_0x53fba[_0x27c6('0x1b')]){var _0x14b26e=new _0x4dd299(_0x53fba[_0x27c6('0x1a')],_0x53fba[_0x27c6('0x1c')]);_0x14b26e['messages'][_0x27c6('0x1d')]({'body':_0x382df6['body'],'to':_0x382df6[_0x27c6('0x1b')],'from':_0x53fba[_0x27c6('0x1b')],'statusCallback':_0x53fba[_0x27c6('0x1e')]+'/api/sms/messages/'+_0x382df6['id']+_0x27c6('0x1f')+_0x53fba[_0x27c6('0x20')]})[_0x27c6('0x17')](function(_0x3ac9f1){if(_0x3ac9f1['sid']){return _0x39e543[_0x27c6('0x12')]({'messageId':_0x3ac9f1['sid']});}})[_0x27c6('0x14')](function(_0x3fcae1){logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x19'),util[_0x27c6('0x24')](_0x3fcae1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),'twilio',_0x27c6('0x25'));}break;case _0x27c6('0x26'):var _0x120220=_0x27c6('0x27');if(_0x53fba[_0x27c6('0x28')]&&_0x53fba[_0x27c6('0x29')]){var _0xcba358={'recipient':[_0x382df6['phone']],'message':_0x382df6[_0x27c6('0x7')],'message_type':_0x53fba[_0x27c6('0x2a')]};if(_0x53fba[_0x27c6('0x2a')]&&_0x53fba[_0x27c6('0x2a')]!=='SI'){_0xcba358[_0x27c6('0x2b')]=_0x53fba['phone'];}var _0x3062ff={'url':_0x120220+_0x27c6('0x2c')+_0x53fba[_0x27c6('0x28')]+_0x27c6('0x2d')+_0x53fba[_0x27c6('0x29')],'method':'GET'};rp(_0x3062ff)[_0x27c6('0x17')](function(_0xa4deea){var _0x4e1e0c=_0xa4deea[_0x27c6('0x2e')](';');var _0x2567ce={'user_key':_0x4e1e0c[0x0],'session_key':_0x4e1e0c[0x1]};_0x3062ff={'url':_0x120220+_0x27c6('0x2f'),'method':_0x27c6('0x30'),'headers':{'user_key':_0x2567ce[_0x27c6('0x31')],'Session_key':_0x2567ce[_0x27c6('0x32')]},'json':!![],'body':_0xcba358};return rp(_0x3062ff);})[_0x27c6('0x17')](function(_0xb1ef77){if(_0xb1ef77[_0x27c6('0x33')]>=0x1){var _0x5413ad={'messageId':_0xb1ef77[_0x27c6('0x34')]};if(_0x53fba['smsMethod']!=='GP'||!_0x53fba[_0x27c6('0x35')]){_0x5413ad[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x5413ad);}else{return logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),'skebby',util[_0x27c6('0x24')](_0xb1ef77,{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0x23e964){return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x26'),util[_0x27c6('0x24')](_0x23e964,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27c6('0x22'),'afterCreate',_0x27c6('0x26'),_0x27c6('0x37'));}break;case _0x27c6('0x38'):if(_0x53fba[_0x27c6('0x1c')]){var _0x12d9cb={'recipient':_0x382df6['phone'],'message':_0x382df6['body'],'sender':_0x53fba['senderString']||_0x53fba[_0x27c6('0x1b')],'authorization':_0x53fba['authToken']};var _0x12b275={'method':_0x27c6('0x30'),'uri':_0x27c6('0x39'),'body':_0x12d9cb,'json':!![]};rp(_0x12b275)[_0x27c6('0x17')](function(_0x515bd9){var _0x162775={'messageId':_0x515bd9[_0x27c6('0x3a')]};if(!_0x53fba[_0x27c6('0x35')]){_0x162775['read']=!![];}return _0x39e543[_0x27c6('0x12')](_0x162775);})[_0x27c6('0x14')](function(_0x56867d){logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x38'),util[_0x27c6('0x24')](_0x56867d,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x38'),_0x27c6('0x3b'));}break;case _0x27c6('0x3c'):if(_0x53fba[_0x27c6('0x28')]&&_0x53fba['password']){var _0x12d9cb={'messages':[{'source':_0x27c6('0x3d'),'to':_0x382df6[_0x27c6('0x1b')],'body':_0x382df6[_0x27c6('0x7')],'from':_0x53fba[_0x27c6('0x3e')]||_0x53fba[_0x27c6('0x1b')]}]};var _0x185642=util[_0x27c6('0x3f')](_0x27c6('0x40'),_0x53fba[_0x27c6('0x28')],_0x53fba['password']);var _0x12b275={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x12d9cb,'headers':{'Authorization':util[_0x27c6('0x3f')]('Basic\x20%s',new Buffer(_0x185642)[_0x27c6('0x41')](_0x27c6('0x42')))},'json':!![]};rp(_0x12b275)['then'](function(_0x2a6d02){if(_0x2a6d02['http_code']>=0xc8&&_0x2a6d02[_0x27c6('0x43')]<=0xce){if(_0x2a6d02[_0x27c6('0x44')]&&_0x2a6d02[_0x27c6('0x44')]['queued_count']>0x0){var _0x1dae9d=_['head'](_0x2a6d02[_0x27c6('0x44')][_0x27c6('0x45')]);var _0x7a9c22={'messageId':_0x1dae9d[_0x27c6('0x46')]};if(!_0x53fba[_0x27c6('0x35')]){_0x7a9c22[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x7a9c22);}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x47'),util[_0x27c6('0x24')](_0x2a6d02,{'showHidden':![],'depth':null}));}}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x47'),util[_0x27c6('0x24')](_0x2a6d02,{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0x370a1e){logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x47'),util[_0x27c6('0x24')](_0x370a1e,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x47'),_0x27c6('0x37'));}break;case _0x27c6('0x48'):if(_0x53fba[_0x27c6('0x49')]&&_0x53fba[_0x27c6('0x1c')]){var _0x12d9cb={'dst':_0x382df6['phone'],'text':_0x382df6['body'],'src':_0x53fba['senderString']||_0x53fba[_0x27c6('0x1b')],'url':_0x53fba[_0x27c6('0x1e')]+_0x27c6('0x4a')+_0x382df6['id']+_0x27c6('0x1f')+_0x53fba[_0x27c6('0x20')]};var _0x185642=util[_0x27c6('0x3f')](_0x27c6('0x40'),_0x53fba[_0x27c6('0x49')],_0x53fba[_0x27c6('0x1c')]);var _0x12b275={'method':_0x27c6('0x30'),'uri':util['format'](_0x27c6('0x4b'),_0x53fba[_0x27c6('0x49')]),'body':_0x12d9cb,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x185642)['toString'](_0x27c6('0x42')))},'json':!![]};rp(_0x12b275)['then'](function(_0xc11cec){var _0x473ea9={'messageId':_0xc11cec[_0x27c6('0x4c')][0x0]};return _0x39e543[_0x27c6('0x12')](_0x473ea9);})[_0x27c6('0x14')](function(_0x5c007d){logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate','plivo',util[_0x27c6('0x24')](_0x5c007d,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x27c6('0x4d'):if(_0x53fba[_0x27c6('0x28')]&&_0x53fba[_0x27c6('0x29')]){if(_0x53fba['baseUrl']){var _0x5d4e61={'method':_0x27c6('0x30'),'uri':_0x53fba[_0x27c6('0x4e')]+_0x27c6('0x4f'),'body':{'username':_0x53fba[_0x27c6('0x28')],'password':_0x53fba[_0x27c6('0x29')]},'json':!![]};return rp(_0x5d4e61)['then'](function(_0x238bf7){var _0x3c39b1={'method':_0x27c6('0x30'),'uri':_0x53fba['baseUrl']+_0x27c6('0x50'),'body':{'messages':[{'from':_0x53fba[_0x27c6('0x1b')],'destinations':[{'to':_0x382df6[_0x27c6('0x1b')]}],'text':_0x382df6['body'],'notifyUrl':_0x53fba[_0x27c6('0x1e')]+'/api/sms/messages/'+_0x382df6['id']+'/status?token='+_0x53fba['token'],'notifyContentType':_0x27c6('0x51'),'callbackData':_0x53fba['phone']+';'+_0x382df6[_0x27c6('0x7')]}]},'headers':{'Authorization':_0x27c6('0x52')+_0x238bf7[_0x27c6('0x20')]},'json':!![]};return rp(_0x3c39b1)[_0x27c6('0x17')](function(_0x4b4649){if(_0x4b4649[_0x27c6('0x45')]){var _0x50d7f3={'messageId':_0x4b4649['messages'][0x0][_0x27c6('0x6')]};if(!_0x53fba['deliveryReport']){_0x50d7f3[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x50d7f3);}else{return logger['error'](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x4d'),util[_0x27c6('0x24')](_0x4b4649,{'showHidden':![],'depth':null}));}});})[_0x27c6('0x14')](function(_0x2e3b79){return logger['error'](_0x27c6('0x22'),'afterCreate',_0x27c6('0x4d'),util[_0x27c6('0x24')](_0x2e3b79,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate','infobip',_0x27c6('0x53'));}}else{logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x27c6('0x54'):var _0x33511d=require(_0x27c6('0x55'));if(_0x53fba[_0x27c6('0x56')]){var _0x1e5fd4={};_0x1e5fd4['login']=_0x53fba[_0x27c6('0x28')];_0x1e5fd4[_0x27c6('0x1b')]=_0x382df6[_0x27c6('0x1b')];_0x1e5fd4[_0x27c6('0x2b')]=_0x53fba['phone'];_0x1e5fd4[_0x27c6('0x57')]=_0x382df6[_0x27c6('0x7')];_0x1e5fd4[_0x27c6('0x58')]=+new Date();var _0x1323bf='';var _0x53dd87='';var _0x24b93c=Object[_0x27c6('0x59')](_0x1e5fd4);_0x24b93c[_0x27c6('0x5a')]();for(var _0x46b633=0x0;_0x46b633<_0x24b93c[_0x27c6('0x5b')];_0x46b633++){if(_0x1323bf!=''){_0x1323bf+='&';}_0x1323bf+=_0x24b93c[_0x46b633]+'='+encodeURIComponent(_0x1e5fd4[_0x24b93c[_0x46b633]]);_0x53dd87+=_0x1e5fd4[_0x24b93c[_0x46b633]];}_0x53dd87+=_0x53fba[_0x27c6('0x56')];_0x53dd87=_0x33511d['createHash'](_0x27c6('0x5c'))['update'](_0x53dd87)['digest'](_0x27c6('0x5d'));if(_0x1323bf!==''){_0x1323bf+='&';}_0x1323bf+=_0x27c6('0x5e')+_0x53dd87;var _0x3062ff={'method':_0x27c6('0x5f'),'uri':_0x53fba[_0x27c6('0x4e')]+_0x27c6('0x60')+_0x1323bf,'json':!![]};return rp(_0x3062ff)[_0x27c6('0x17')](function(_0x265e01){var _0x3b419f=Object[_0x27c6('0x59')](_0x265e01);if(_0x265e01[_0x3b419f[0x0]][_0x27c6('0x21')]&&parseInt(_0x265e01[_0x3b419f[0x0]][_0x27c6('0x21')])===0x0){var _0x4185df={'messageId':_0x265e01[_0x3b419f[0x0]][_0x27c6('0x61')]};if(!_0x53fba[_0x27c6('0x35')]){_0x4185df[_0x27c6('0x36')]=!![];}return _0x39e543[_0x27c6('0x12')](_0x4185df);}else{return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x54'),util['inspect'](_0x265e01['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x41abe4){return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x54'),util[_0x27c6('0x24')](_0x41abe4,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x54'),_0x27c6('0x62'));}break;case _0x27c6('0x63'):if(_0x53fba['apiKey']){var _0x317d41={'method':'POST','uri':_0x27c6('0x64'),'headers':{'Authorization':_0x53fba['apiKey']},'body':{'content':_0x382df6[_0x27c6('0x7')],'to':[_0x382df6['phone']],'from':_0x53fba[_0x27c6('0x1b')],'binary':![],'clientMessageId':'uuid','charset':_0x27c6('0x65')},'json':!![]};rp(_0x317d41)[_0x27c6('0x17')](function(_0x5834f3){if(!_0x5834f3['error']){var _0x2095f5={'messageId':_0x5834f3[_0x27c6('0x45')][0x0][_0x27c6('0x66')]};if(!_0x53fba[_0x27c6('0x35')]){_0x2095f5['read']=!![];}return _0x39e543['update'](_0x2095f5);}else{return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x63'),util['inspect'](_0x5834f3[_0x27c6('0x21')],{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0x26b7ed){return logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),'clickatell',util[_0x27c6('0x24')](_0x26b7ed,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x63'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x53fba[_0x27c6('0x28')]&&_0x53fba[_0x27c6('0x29')]){var _0x185642=util[_0x27c6('0x3f')](_0x27c6('0x40'),_0x53fba['username'],_0x53fba[_0x27c6('0x29')]);var _0x12b275={'method':_0x27c6('0x30'),'uri':_0x27c6('0x67')+_0x53fba[_0x27c6('0x68')]+_0x27c6('0x69'),'body':{'to':[_0x382df6[_0x27c6('0x1b')]],'text':_0x382df6[_0x27c6('0x7')],'from':_0x53fba[_0x27c6('0x1b')],'applicationId':_0x53fba[_0x27c6('0x6a')]},'headers':{'Authorization':util['format'](_0x27c6('0x6b'),new Buffer(_0x185642)[_0x27c6('0x41')](_0x27c6('0x42')))},'json':!![]};rp(_0x12b275)[_0x27c6('0x17')](function(_0xb395d4){if(_0xb395d4['id']){var _0x5f6ae4={'messageId':_0xb395d4['id']};return _0x39e543[_0x27c6('0x12')](_0x5f6ae4);}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x6c'),util['inspect'](_0xb395d4,{'showHidden':![],'depth':null}));}})[_0x27c6('0x14')](function(_0xffd4bb){logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x6c'),util[_0x27c6('0x24')](_0xffd4bb,{'showHidden':![],'depth':null}));});}else{logger[_0x27c6('0x21')](_0x27c6('0x22'),_0x27c6('0x23'),_0x27c6('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x27c6('0x6d'):if(_0x53fba[_0x27c6('0x56')]){var _0x248d43={};var _0x3062ff={'method':_0x27c6('0x30'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x27c6('0x6e')+_0x53fba[_0x27c6('0x56')],'Content-Type':_0x27c6('0x51')},'body':{'from':_0x53fba['phone'],'to':_0x382df6['phone'],'text':_0x382df6[_0x27c6('0x7')]},'json':!![]};return rp(_0x3062ff)['then'](function(_0x45c263){if(_0x45c263[_0x27c6('0x6f')]==0xca){_0x248d43[_0x27c6('0x70')]=_0x45c263;var _0x7f7afa={'method':_0x27c6('0x30'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x27c6('0x6e')+_0x53fba[_0x27c6('0x56')],'Content-Type':_0x27c6('0x51')},'body':{'refid':_0x248d43[_0x27c6('0x70')][_0x27c6('0x71')]},'json':!![]};return rp(_0x7f7afa)[_0x27c6('0x17')](function(_0x270801){_0x248d43['status']=_0x270801;var _0x5e7bae={'messageId':_0x248d43[_0x27c6('0x70')][_0x27c6('0x71')],'read':!![]};return _0x39e543[_0x27c6('0x12')](_0x5e7bae);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x27c6('0x6d'),util[_0x27c6('0x24')](_0x45c263,{'showHidden':![],'depth':null}));}})['catch'](function(_0x50f345){return logger[_0x27c6('0x21')](_0x27c6('0x22'),'afterCreate',_0x27c6('0x6d'),util[_0x27c6('0x24')](_0x50f345,{'showHidden':![],'depth':null}));});}else{return logger[_0x27c6('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27c6('0x23'),_0x27c6('0x6d'),_0x27c6('0x72'));}break;}}})['finally'](function(){_0x372679();});}else{_0x372679();}}},'charset':_0x27c6('0x73'),'collate':_0x27c6('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index d1afbe9..47ff966 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 _0xd902=['socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsMessage','create','body','options','raw','CreateSmsMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x502a32,_0x23d261){var _0x30191c=function(_0x585f45){while(--_0x585f45){_0x502a32['push'](_0x502a32['shift']());}};_0x30191c(++_0x23d261);}(_0xd902,0xc9));var _0x2d90=function(_0x2c7377,_0x32ade5){_0x2c7377=_0x2c7377-0x0;var _0x35e181=_0xd902[_0x2c7377];return _0x35e181;};'use strict';var _=require(_0x2d90('0x0'));var util=require(_0x2d90('0x1'));var moment=require(_0x2d90('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d90('0x3'));var fs=require('fs');var Redis=require(_0x2d90('0x4'));var db=require(_0x2d90('0x5'))['db'];var utils=require(_0x2d90('0x6'));var logger=require(_0x2d90('0x7'))(_0x2d90('0x8'));var config=require(_0x2d90('0x9'));var jayson=require(_0x2d90('0xa'));var client=jayson[_0x2d90('0xb')]['http']({'port':0x232a});config['redis']=_[_0x2d90('0xc')](config[_0x2d90('0xd')],{'host':_0x2d90('0xe'),'port':0x18eb});var socket=require(_0x2d90('0xf'))(new Redis(config['redis']));require(_0x2d90('0x10'))[_0x2d90('0x11')](socket);function respondWithRpcPromise(_0x3ed67e,_0x5966ae,_0x13d48f){return new BPromise(function(_0x3f1b42,_0x14117a){return client[_0x2d90('0x12')](_0x3ed67e,_0x13d48f)[_0x2d90('0x13')](function(_0x5f0795){logger[_0x2d90('0x14')](_0x2d90('0x15'),_0x5966ae,_0x2d90('0x16'));logger[_0x2d90('0x17')](_0x2d90('0x18'),_0x5966ae,_0x2d90('0x16'),JSON[_0x2d90('0x19')](_0x5f0795));if(_0x5f0795[_0x2d90('0x1a')]){if(_0x5f0795[_0x2d90('0x1a')]['code']===0x1f4){logger[_0x2d90('0x1a')](_0x2d90('0x15'),_0x5966ae,_0x5f0795[_0x2d90('0x1a')]['message']);return _0x14117a(_0x5f0795[_0x2d90('0x1a')][_0x2d90('0x1b')]);}logger[_0x2d90('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x5966ae,_0x5f0795[_0x2d90('0x1a')]['message']);return _0x3f1b42(_0x5f0795[_0x2d90('0x1a')][_0x2d90('0x1b')]);}else{logger[_0x2d90('0x14')](_0x2d90('0x15'),_0x5966ae,_0x2d90('0x16'));_0x3f1b42(_0x5f0795[_0x2d90('0x1c')][_0x2d90('0x1b')]);}})['catch'](function(_0x18f645){logger[_0x2d90('0x1a')](_0x2d90('0x15'),_0x5966ae,_0x18f645);_0x14117a(_0x18f645);});});}exports['CreateSmsMessage']=function(_0x3666e6){var _0x57a1a6=this;return new Promise(function(_0xe50e5,_0x36d761){return db[_0x2d90('0x1d')][_0x2d90('0x1e')](_0x3666e6[_0x2d90('0x1f')],{'raw':_0x3666e6[_0x2d90('0x20')]?_0x3666e6['options'][_0x2d90('0x21')]===undefined?!![]:![]:!![]})[_0x2d90('0x13')](function(_0x2a967c){logger[_0x2d90('0x14')]('CreateSmsMessage',_0x3666e6);logger[_0x2d90('0x17')](_0x2d90('0x22'),_0x3666e6,JSON[_0x2d90('0x19')](_0x2a967c));_0xe50e5(_0x2a967c);})[_0x2d90('0x23')](function(_0x1edb1a){logger['error'](_0x2d90('0x22'),_0x1edb1a[_0x2d90('0x1b')],_0x3666e6);_0x36d761(_0x57a1a6[_0x2d90('0x1a')](0x1f4,_0x1edb1a[_0x2d90('0x1b')]));});});}; \ No newline at end of file +var _0xdd10=['then','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsMessage','SmsMessage','body','raw'];(function(_0x260038,_0x584f45){var _0x991a1e=function(_0x357c74){while(--_0x357c74){_0x260038['push'](_0x260038['shift']());}};_0x991a1e(++_0x584f45);}(_0xdd10,0x163));var _0x0dd1=function(_0x5e88db,_0x588bdd){_0x5e88db=_0x5e88db-0x0;var _0x414cda=_0xdd10[_0x5e88db];return _0x414cda;};'use strict';var _=require(_0x0dd1('0x0'));var util=require(_0x0dd1('0x1'));var moment=require('moment');var BPromise=require(_0x0dd1('0x2'));var rs=require(_0x0dd1('0x3'));var fs=require('fs');var Redis=require(_0x0dd1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dd1('0x5'));var logger=require(_0x0dd1('0x6'))(_0x0dd1('0x7'));var config=require(_0x0dd1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0dd1('0x9')][_0x0dd1('0xa')]({'port':0x232a});config[_0x0dd1('0xb')]=_[_0x0dd1('0xc')](config[_0x0dd1('0xb')],{'host':_0x0dd1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0dd1('0xb')]));require(_0x0dd1('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d2536,_0x105fc6,_0x53c052){return new BPromise(function(_0x171d33,_0x2357fa){return client[_0x0dd1('0xf')](_0x5d2536,_0x53c052)['then'](function(_0x4880fe){logger[_0x0dd1('0x10')](_0x0dd1('0x11'),_0x105fc6,_0x0dd1('0x12'));logger[_0x0dd1('0x13')](_0x0dd1('0x14'),_0x105fc6,_0x0dd1('0x12'),JSON['stringify'](_0x4880fe));if(_0x4880fe[_0x0dd1('0x15')]){if(_0x4880fe[_0x0dd1('0x15')][_0x0dd1('0x16')]===0x1f4){logger[_0x0dd1('0x15')](_0x0dd1('0x11'),_0x105fc6,_0x4880fe[_0x0dd1('0x15')][_0x0dd1('0x17')]);return _0x2357fa(_0x4880fe['error'][_0x0dd1('0x17')]);}logger[_0x0dd1('0x15')](_0x0dd1('0x11'),_0x105fc6,_0x4880fe[_0x0dd1('0x15')]['message']);return _0x171d33(_0x4880fe[_0x0dd1('0x15')][_0x0dd1('0x17')]);}else{logger[_0x0dd1('0x10')](_0x0dd1('0x11'),_0x105fc6,_0x0dd1('0x12'));_0x171d33(_0x4880fe[_0x0dd1('0x18')][_0x0dd1('0x17')]);}})['catch'](function(_0x2275ae){logger[_0x0dd1('0x15')](_0x0dd1('0x11'),_0x105fc6,_0x2275ae);_0x2357fa(_0x2275ae);});});}exports[_0x0dd1('0x19')]=function(_0x35c177){var _0x1f6914=this;return new Promise(function(_0x3bd736,_0xfb855e){return db[_0x0dd1('0x1a')]['create'](_0x35c177[_0x0dd1('0x1b')],{'raw':_0x35c177['options']?_0x35c177['options'][_0x0dd1('0x1c')]===undefined?!![]:![]:!![]})[_0x0dd1('0x1d')](function(_0x41920e){logger[_0x0dd1('0x10')](_0x0dd1('0x19'),_0x35c177);logger[_0x0dd1('0x13')](_0x0dd1('0x19'),_0x35c177,JSON[_0x0dd1('0x1e')](_0x41920e));_0x3bd736(_0x41920e);})[_0x0dd1('0x1f')](function(_0x5ce71b){logger[_0x0dd1('0x15')]('CreateSmsMessage',_0x5ce71b['message'],_0x35c177);_0xfb855e(_0x1f6914['error'](0x1f4,_0x5ce71b[_0x0dd1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 8e8b972..59f90f9 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 _0xa5e9=['length','./smsMessage.events','remove','update','emit','register'];(function(_0x31daa3,_0x5f3f99){var _0x221eb4=function(_0xb96eb6){while(--_0xb96eb6){_0x31daa3['push'](_0x31daa3['shift']());}};_0x221eb4(++_0x5f3f99);}(_0xa5e9,0x97));var _0x9a5e=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xa5e9[_0x38b14f];return _0x22a324;};'use strict';var SmsMessageEvents=require(_0x9a5e('0x0'));var events=['save',_0x9a5e('0x1'),_0x9a5e('0x2')];function createListener(_0x332ab8,_0x44699e){return function(_0x447314){_0x44699e[_0x9a5e('0x3')](_0x332ab8,_0x447314);};}function removeListener(_0x4ca247,_0x5d31f3){return function(){SmsMessageEvents['removeListener'](_0x4ca247,_0x5d31f3);};}exports[_0x9a5e('0x4')]=function(_0x80fcc9){for(var _0x31ff9c=0x0,_0x4e09d4=events[_0x9a5e('0x5')];_0x31ff9c<_0x4e09d4;_0x31ff9c++){var _0x182316=events[_0x31ff9c];var _0x7920d=createListener('smsMessage:'+_0x182316,_0x80fcc9);SmsMessageEvents['on'](_0x182316,_0x7920d);}}; \ No newline at end of file +var _0x22c2=['save','remove','update','emit','length','smsMessage:'];(function(_0x23fdbc,_0x167c8b){var _0x1f50ad=function(_0x481372){while(--_0x481372){_0x23fdbc['push'](_0x23fdbc['shift']());}};_0x1f50ad(++_0x167c8b);}(_0x22c2,0x1c8));var _0x222c=function(_0x4488a9,_0x8b6501){_0x4488a9=_0x4488a9-0x0;var _0xef61c5=_0x22c2[_0x4488a9];return _0xef61c5;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x222c('0x0'),_0x222c('0x1'),_0x222c('0x2')];function createListener(_0x1c965b,_0x424260){return function(_0x3dad71){_0x424260[_0x222c('0x3')](_0x1c965b,_0x3dad71);};}function removeListener(_0x22e7e8,_0x34db02){return function(){SmsMessageEvents['removeListener'](_0x22e7e8,_0x34db02);};}exports['register']=function(_0x229b48){for(var _0x1821ca=0x0,_0x4dcaab=events[_0x222c('0x4')];_0x1821ca<_0x4dcaab;_0x1821ca++){var _0x3ce9f0=events[_0x1821ca];var _0x169dbc=createListener(_0x222c('0x5')+_0x3ce9f0,_0x229b48);SmsMessageEvents['on'](_0x3ce9f0,_0x169dbc);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index a1360f0..bcdeaa5 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 _0x3d24=['getTeams','/:id/users','post','create','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d24,0xa7));var _0x43d2=function(_0x3440a8,_0x49e555){_0x3440a8=_0x3440a8-0x0;var _0x1bbdfe=_0x3d24[_0x3440a8];return _0x1bbdfe;};'use strict';var multer=require(_0x43d2('0x0'));var util=require(_0x43d2('0x1'));var path=require(_0x43d2('0x2'));var timeout=require(_0x43d2('0x3'));var express=require(_0x43d2('0x4'));var router=express[_0x43d2('0x5')]();var fs_extra=require(_0x43d2('0x6'));var auth=require(_0x43d2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d2('0x8'));var controller=require(_0x43d2('0x9'));router[_0x43d2('0xa')]('/',auth[_0x43d2('0xb')](),controller['index']);router[_0x43d2('0xa')](_0x43d2('0xc'),auth[_0x43d2('0xb')](),controller[_0x43d2('0xd')]);router['get'](_0x43d2('0xe'),auth[_0x43d2('0xb')](),controller[_0x43d2('0xf')]);router[_0x43d2('0xa')](_0x43d2('0x10'),auth[_0x43d2('0xb')](),controller[_0x43d2('0x11')]);router[_0x43d2('0xa')](_0x43d2('0x12'),auth['isAuthenticated'](),controller[_0x43d2('0x13')]);router[_0x43d2('0xa')](_0x43d2('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x43d2('0x15')]('/',auth['isAuthenticated'](),controller[_0x43d2('0x16')]);router[_0x43d2('0x15')](_0x43d2('0x12'),auth[_0x43d2('0xb')](),controller[_0x43d2('0x17')]);router[_0x43d2('0x15')](_0x43d2('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0x43d2('0x18')]('/:id',auth[_0x43d2('0xb')](),controller[_0x43d2('0x19')]);router[_0x43d2('0x1a')]('/:id',auth[_0x43d2('0xb')](),controller[_0x43d2('0x1b')]);router[_0x43d2('0x1a')]('/:id/teams',auth[_0x43d2('0xb')](),controller[_0x43d2('0x1c')]);router['delete'](_0x43d2('0x14'),auth[_0x43d2('0xb')](),controller[_0x43d2('0x1d')]);module[_0x43d2('0x1e')]=router; \ No newline at end of file +var _0x12ff=['/:id/teams','getTeams','/:id/users','post','create','addTeams','put','/:id','update','delete','removeTeams','removeAgents','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','/describe','/:id/members'];(function(_0x4f9d23,_0x3282c4){var _0x5b15ea=function(_0x4fe3c1){while(--_0x4fe3c1){_0x4f9d23['push'](_0x4f9d23['shift']());}};_0x5b15ea(++_0x3282c4);}(_0x12ff,0x165));var _0xf12f=function(_0x3c9520,_0x187f3c){_0x3c9520=_0x3c9520-0x0;var _0xbe7616=_0x12ff[_0x3c9520];return _0xbe7616;};'use strict';var multer=require('multer');var util=require(_0xf12f('0x0'));var path=require('path');var timeout=require(_0xf12f('0x1'));var express=require(_0xf12f('0x2'));var router=express['Router']();var fs_extra=require(_0xf12f('0x3'));var auth=require(_0xf12f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf12f('0x5'));var controller=require(_0xf12f('0x6'));router['get']('/',auth[_0xf12f('0x7')](),controller['index']);router[_0xf12f('0x8')](_0xf12f('0x9'),auth[_0xf12f('0x7')](),controller['describe']);router[_0xf12f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf12f('0x8')](_0xf12f('0xa'),auth[_0xf12f('0x7')](),controller['getMembers']);router[_0xf12f('0x8')](_0xf12f('0xb'),auth['isAuthenticated'](),controller[_0xf12f('0xc')]);router[_0xf12f('0x8')](_0xf12f('0xd'),auth[_0xf12f('0x7')](),controller['getAgents']);router[_0xf12f('0xe')]('/',auth['isAuthenticated'](),controller[_0xf12f('0xf')]);router['post'](_0xf12f('0xb'),auth['isAuthenticated'](),controller[_0xf12f('0x10')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xf12f('0x11')](_0xf12f('0x12'),auth[_0xf12f('0x7')](),controller[_0xf12f('0x13')]);router[_0xf12f('0x14')](_0xf12f('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0xf12f('0x14')](_0xf12f('0xb'),auth[_0xf12f('0x7')](),controller[_0xf12f('0x15')]);router[_0xf12f('0x14')](_0xf12f('0xd'),auth[_0xf12f('0x7')](),controller[_0xf12f('0x16')]);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 db8f0cd..464906f 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 _0xf357=['INTEGER','ENUM','rrmemory','beepall','sequelize','STRING','name'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xf357,0x1bd));var _0x7f35=function(_0x3c086c,_0x11dedb){_0x3c086c=_0x3c086c-0x0;var _0x1c7662=_0xf357[_0x3c086c];return _0x1c7662;};'use strict';var Sequelize=require(_0x7f35('0x0'));module['exports']={'name':{'type':Sequelize[_0x7f35('0x1')],'unique':_0x7f35('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7f35('0x1')]},'timeout':{'type':Sequelize[_0x7f35('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f35('0x4')](_0x7f35('0x5'),_0x7f35('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x0f9c=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x1dab30,_0xcb603e){var _0x564782=function(_0x2b9a23){while(--_0x2b9a23){_0x1dab30['push'](_0x1dab30['shift']());}};_0x564782(++_0xcb603e);}(_0x0f9c,0xd3));var _0xc0f9=function(_0x408f00,_0x2f6546){_0x408f00=_0x408f00-0x0;var _0x4ff564=_0x0f9c[_0x408f00];return _0x4ff564;};'use strict';var Sequelize=require('sequelize');module[_0xc0f9('0x0')]={'name':{'type':Sequelize[_0xc0f9('0x1')],'unique':_0xc0f9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc0f9('0x1')]},'timeout':{'type':Sequelize[_0xc0f9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc0f9('0x4')](_0xc0f9('0x5'),_0xc0f9('0x6'),_0xc0f9('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 357d005..5124850 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 _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x49c586,_0x5af079){var _0x430775=function(_0x12f801){while(--_0x12f801){_0x49c586['push'](_0x49c586['shift']());}};_0x430775(++_0x5af079);}(_0x7a54,0x106));var _0x47a5=function(_0x21cb85,_0x48956b){_0x21cb85=_0x21cb85-0x0;var _0x2916eb=_0x7a54[_0x21cb85];return _0x2916eb;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file +var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xadb5,0xad));var _0x5adb=function(_0x1b3e9e,_0x299251){_0x1b3e9e=_0x1b3e9e-0x0;var _0x588359=_0xadb5[_0x1b3e9e];return _0x588359;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 0657e46..f29e325 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 _0x6b84=['events','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x45a92e,_0x7dd8ad){var _0x25f5dd=function(_0x1c784f){while(--_0x1c784f){_0x45a92e['push'](_0x45a92e['shift']());}};_0x25f5dd(++_0x7dd8ad);}(_0x6b84,0x190));var _0x46b8=function(_0x12573a,_0x12d96a){_0x12573a=_0x12573a-0x0;var _0x39e3d6=_0x6b84[_0x12573a];return _0x39e3d6;};'use strict';var EventEmitter=require(_0x46b8('0x0'));var SmsQueue=require(_0x46b8('0x1'))['db'][_0x46b8('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x46b8('0x3')](0x0);var events={'afterCreate':_0x46b8('0x4'),'afterUpdate':'update','afterDestroy':_0x46b8('0x5')};function emitEvent(_0x32a6e3){return function(_0x430af6,_0x2b8f34,_0x2d97ec){SmsQueueEvents['emit'](_0x32a6e3+':'+_0x430af6['id'],_0x430af6);SmsQueueEvents[_0x46b8('0x6')](_0x32a6e3,_0x430af6);_0x2d97ec(null);};}for(var e in events){if(events[_0x46b8('0x7')](e)){var event=events[e];SmsQueue[_0x46b8('0x8')](e,emitEvent(event));}}module[_0x46b8('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xbed1=['exports','events','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbed1,0xac));var _0x1bed=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0xbed1[_0x219d87];return _0x22823d;};'use strict';var EventEmitter=require(_0x1bed('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x1bed('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1bed('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1bed('0x3'),'afterDestroy':_0x1bed('0x4')};function emitEvent(_0x2767ae){return function(_0x2f287c,_0x35d123,_0x3a344d){SmsQueueEvents[_0x1bed('0x5')](_0x2767ae+':'+_0x2f287c['id'],_0x2f287c);SmsQueueEvents[_0x1bed('0x5')](_0x2767ae,_0x2f287c);_0x3a344d(null);};}for(var e in events){if(events[_0x1bed('0x6')](e)){var event=events[e];SmsQueue[_0x1bed('0x7')](e,emitEvent(event));}}module[_0x1bed('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 48bcd78..c170dad 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 _0xe0d2=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','util','api','moment','bluebird'];(function(_0x2be026,_0x355ccb){var _0x203613=function(_0xbfc5a7){while(--_0xbfc5a7){_0x2be026['push'](_0x2be026['shift']());}};_0x203613(++_0x355ccb);}(_0xe0d2,0x164));var _0x2e0d=function(_0x25c356,_0x30ce37){_0x25c356=_0x25c356-0x0;var _0x1303d3=_0xe0d2[_0x25c356];return _0x1303d3;};'use strict';var _=require('lodash');var util=require(_0x2e0d('0x0'));var logger=require('../../config/logger')(_0x2e0d('0x1'));var moment=require(_0x2e0d('0x2'));var BPromise=require(_0x2e0d('0x3'));var rp=require(_0x2e0d('0x4'));var fs=require('fs');var path=require(_0x2e0d('0x5'));var rimraf=require(_0x2e0d('0x6'));var config=require(_0x2e0d('0x7'));var attributes=require(_0x2e0d('0x8'));module[_0x2e0d('0x9')]=function(_0x5cd18b,_0x3db3d7){return _0x5cd18b[_0x2e0d('0xa')](_0x2e0d('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6857=['api','moment','bluebird','rimraf','exports','lodash','util'];(function(_0x27aee9,_0x4df7a2){var _0x46fde5=function(_0x8501c6){while(--_0x8501c6){_0x27aee9['push'](_0x27aee9['shift']());}};_0x46fde5(++_0x4df7a2);}(_0x6857,0x116));var _0x7685=function(_0x5d6db4,_0x5e45fe){_0x5d6db4=_0x5d6db4-0x0;var _0x43d493=_0x6857[_0x5d6db4];return _0x43d493;};'use strict';var _=require(_0x7685('0x0'));var util=require(_0x7685('0x1'));var logger=require('../../config/logger')(_0x7685('0x2'));var moment=require(_0x7685('0x3'));var BPromise=require(_0x7685('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7685('0x5'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x7685('0x6')]=function(_0x2ee48e,_0x4e6c1f){return _0x2ee48e['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 8cc0987..a778a9d 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 _0xd140=['debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','limit','include','map','model','attributes','ShowSmsQueue','find','stringify','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x45f7ca,_0x2a15ea){var _0x2124ce=function(_0x40b5e6){while(--_0x40b5e6){_0x45f7ca['push'](_0x45f7ca['shift']());}};_0x2124ce(++_0x2a15ea);}(_0xd140,0x117));var _0x0d14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd140[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0d14('0x0'));var util=require(_0x0d14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d14('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0d14('0x3'));var logger=require(_0x0d14('0x4'))(_0x0d14('0x5'));var config=require('../../config/environment');var jayson=require(_0x0d14('0x6'));var client=jayson[_0x0d14('0x7')][_0x0d14('0x8')]({'port':0x232a});config[_0x0d14('0x9')]=_[_0x0d14('0xa')](config[_0x0d14('0x9')],{'host':_0x0d14('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d14('0x9')]));require('./smsQueue.socket')[_0x0d14('0xc')](socket);function respondWithRpcPromise(_0x424b86,_0x1fa5d6,_0x2f54c2){return new BPromise(function(_0x2b3ec1,_0x35bdc4){return client['request'](_0x424b86,_0x2f54c2)[_0x0d14('0xd')](function(_0x5e50f1){logger[_0x0d14('0xe')](_0x0d14('0xf'),_0x1fa5d6,_0x0d14('0x10'));logger[_0x0d14('0x11')](_0x0d14('0x12'),_0x1fa5d6,_0x0d14('0x10'),JSON['stringify'](_0x5e50f1));if(_0x5e50f1[_0x0d14('0x13')]){if(_0x5e50f1[_0x0d14('0x13')][_0x0d14('0x14')]===0x1f4){logger[_0x0d14('0x13')](_0x0d14('0xf'),_0x1fa5d6,_0x5e50f1[_0x0d14('0x13')][_0x0d14('0x15')]);return _0x35bdc4(_0x5e50f1[_0x0d14('0x13')]['message']);}logger[_0x0d14('0x13')](_0x0d14('0xf'),_0x1fa5d6,_0x5e50f1[_0x0d14('0x13')]['message']);return _0x2b3ec1(_0x5e50f1[_0x0d14('0x13')]['message']);}else{logger[_0x0d14('0xe')](_0x0d14('0xf'),_0x1fa5d6,_0x0d14('0x10'));_0x2b3ec1(_0x5e50f1[_0x0d14('0x16')][_0x0d14('0x15')]);}})[_0x0d14('0x17')](function(_0x2686bb){logger[_0x0d14('0x13')](_0x0d14('0xf'),_0x1fa5d6,_0x2686bb);_0x35bdc4(_0x2686bb);});});}exports[_0x0d14('0x18')]=function(_0x43a88d){var _0x5d049f=this;return new Promise(function(_0x46fcd0,_0x3c33ab){return db[_0x0d14('0x19')]['findAll']({'raw':_0x43a88d[_0x0d14('0x1a')]?_0x43a88d[_0x0d14('0x1a')][_0x0d14('0x1b')]===undefined?!![]:![]:!![],'where':_0x43a88d[_0x0d14('0x1a')]?_0x43a88d[_0x0d14('0x1a')][_0x0d14('0x1c')]||null:null,'attributes':_0x43a88d[_0x0d14('0x1a')]?_0x43a88d[_0x0d14('0x1a')]['attributes']||null:null,'limit':_0x43a88d['options']?_0x43a88d[_0x0d14('0x1a')][_0x0d14('0x1d')]||null:null,'include':_0x43a88d['options']?_0x43a88d[_0x0d14('0x1a')][_0x0d14('0x1e')]?_[_0x0d14('0x1f')](_0x43a88d['options'][_0x0d14('0x1e')],function(_0xa00195){return{'model':db[_0xa00195[_0x0d14('0x20')]],'as':_0xa00195['as'],'attributes':_0xa00195[_0x0d14('0x21')],'include':_0xa00195[_0x0d14('0x1e')]?_[_0x0d14('0x1f')](_0xa00195[_0x0d14('0x1e')],function(_0x52ceb4){return{'model':db[_0x52ceb4[_0x0d14('0x20')]],'as':_0x52ceb4['as'],'attributes':_0x52ceb4[_0x0d14('0x21')],'include':_0x52ceb4['include']?_[_0x0d14('0x1f')](_0x52ceb4[_0x0d14('0x1e')],function(_0x3ed765){return{'model':db[_0x3ed765['model']],'as':_0x3ed765['as'],'attributes':_0x3ed765[_0x0d14('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0d14('0xd')](function(_0x338877){logger[_0x0d14('0xe')](_0x0d14('0x18'),_0x43a88d);logger['debug'](_0x0d14('0x18'),_0x43a88d,JSON['stringify'](_0x338877));_0x46fcd0(_0x338877);})[_0x0d14('0x17')](function(_0x5af209){logger['error'](_0x0d14('0x18'),_0x5af209[_0x0d14('0x15')],_0x43a88d);_0x3c33ab(_0x5d049f[_0x0d14('0x13')](0x1f4,_0x5af209[_0x0d14('0x15')]));});});};exports[_0x0d14('0x22')]=function(_0x4a969f){var _0x554615=this;return new Promise(function(_0x2751b0,_0x58d804){return db[_0x0d14('0x19')][_0x0d14('0x23')]({'raw':_0x4a969f[_0x0d14('0x1a')]?_0x4a969f[_0x0d14('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4a969f[_0x0d14('0x1a')]?_0x4a969f[_0x0d14('0x1a')][_0x0d14('0x1c')]||null:null,'attributes':_0x4a969f[_0x0d14('0x1a')]?_0x4a969f['options']['attributes']||null:null,'include':_0x4a969f['options']?_0x4a969f[_0x0d14('0x1a')]['include']?_[_0x0d14('0x1f')](_0x4a969f['options'][_0x0d14('0x1e')],function(_0xc27b12){return{'model':db[_0xc27b12['model']],'as':_0xc27b12['as'],'attributes':_0xc27b12[_0x0d14('0x21')],'include':_0xc27b12[_0x0d14('0x1e')]?_[_0x0d14('0x1f')](_0xc27b12[_0x0d14('0x1e')],function(_0x323340){return{'model':db[_0x323340[_0x0d14('0x20')]],'as':_0x323340['as'],'attributes':_0x323340[_0x0d14('0x21')],'include':_0x323340[_0x0d14('0x1e')]?_[_0x0d14('0x1f')](_0x323340[_0x0d14('0x1e')],function(_0x3a9b07){return{'model':db[_0x3a9b07['model']],'as':_0x3a9b07['as'],'attributes':_0x3a9b07['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d14('0xd')](function(_0x4ea474){logger['info'](_0x0d14('0x22'),_0x4a969f);logger[_0x0d14('0x11')](_0x0d14('0x22'),_0x4a969f,JSON[_0x0d14('0x24')](_0x4ea474));_0x2751b0(_0x4ea474);})[_0x0d14('0x17')](function(_0x36495e){logger['error'](_0x0d14('0x22'),_0x36495e[_0x0d14('0x15')],_0x4a969f);_0x58d804(_0x554615[_0x0d14('0x13')](0x1f4,_0x36495e['message']));});});}; \ No newline at end of file +var _0xdded=['where','include','map','model','attributes','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw'];(function(_0x483d1c,_0x3d3094){var _0x28cd6f=function(_0x4a2bff){while(--_0x4a2bff){_0x483d1c['push'](_0x483d1c['shift']());}};_0x28cd6f(++_0x3d3094);}(_0xdded,0x7f));var _0xddde=function(_0x592629,_0x3cd2bb){_0x592629=_0x592629-0x0;var _0x5ccd30=_0xdded[_0x592629];return _0x5ccd30;};'use strict';var _=require(_0xddde('0x0'));var util=require('util');var moment=require(_0xddde('0x1'));var BPromise=require(_0xddde('0x2'));var rs=require(_0xddde('0x3'));var fs=require('fs');var Redis=require(_0xddde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddde('0x5'));var logger=require('../../config/logger')(_0xddde('0x6'));var config=require(_0xddde('0x7'));var jayson=require(_0xddde('0x8'));var client=jayson[_0xddde('0x9')][_0xddde('0xa')]({'port':0x232a});config[_0xddde('0xb')]=_[_0xddde('0xc')](config[_0xddde('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xddde('0xd'))(new Redis(config[_0xddde('0xb')]));require(_0xddde('0xe'))[_0xddde('0xf')](socket);function respondWithRpcPromise(_0x6bc680,_0x3ec861,_0x309831){return new BPromise(function(_0x24d2f8,_0x35e697){return client[_0xddde('0x10')](_0x6bc680,_0x309831)[_0xddde('0x11')](function(_0x55c83d){logger[_0xddde('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3ec861,'request\x20sent');logger[_0xddde('0x13')](_0xddde('0x14'),_0x3ec861,_0xddde('0x15'),JSON[_0xddde('0x16')](_0x55c83d));if(_0x55c83d[_0xddde('0x17')]){if(_0x55c83d[_0xddde('0x17')][_0xddde('0x18')]===0x1f4){logger[_0xddde('0x17')](_0xddde('0x19'),_0x3ec861,_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);return _0x35e697(_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);}logger['error'](_0xddde('0x19'),_0x3ec861,_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);return _0x24d2f8(_0x55c83d[_0xddde('0x17')][_0xddde('0x1a')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x3ec861,_0xddde('0x15'));_0x24d2f8(_0x55c83d['result']['message']);}})[_0xddde('0x1b')](function(_0x38bcb5){logger['error'](_0xddde('0x19'),_0x3ec861,_0x38bcb5);_0x35e697(_0x38bcb5);});});}exports[_0xddde('0x1c')]=function(_0x262ee1){var _0x4e07e6=this;return new Promise(function(_0x4f4a4f,_0x35a441){return db[_0xddde('0x1d')][_0xddde('0x1e')]({'raw':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')][_0xddde('0x20')]===undefined?!![]:![]:!![],'where':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')][_0xddde('0x21')]||null:null,'attributes':_0x262ee1['options']?_0x262ee1[_0xddde('0x1f')]['attributes']||null:null,'limit':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')]['limit']||null:null,'include':_0x262ee1[_0xddde('0x1f')]?_0x262ee1[_0xddde('0x1f')][_0xddde('0x22')]?_[_0xddde('0x23')](_0x262ee1[_0xddde('0x1f')]['include'],function(_0x215fad){return{'model':db[_0x215fad[_0xddde('0x24')]],'as':_0x215fad['as'],'attributes':_0x215fad['attributes'],'include':_0x215fad[_0xddde('0x22')]?_[_0xddde('0x23')](_0x215fad['include'],function(_0x43e567){return{'model':db[_0x43e567[_0xddde('0x24')]],'as':_0x43e567['as'],'attributes':_0x43e567[_0xddde('0x25')],'include':_0x43e567[_0xddde('0x22')]?_['map'](_0x43e567[_0xddde('0x22')],function(_0x2f5832){return{'model':db[_0x2f5832[_0xddde('0x24')]],'as':_0x2f5832['as'],'attributes':_0x2f5832['attributes']};}):[]};}):[]};}):[]:[]})[_0xddde('0x11')](function(_0x308638){logger[_0xddde('0x12')]('GetSmsQueue',_0x262ee1);logger[_0xddde('0x13')]('GetSmsQueue',_0x262ee1,JSON['stringify'](_0x308638));_0x4f4a4f(_0x308638);})[_0xddde('0x1b')](function(_0x3f7f32){logger[_0xddde('0x17')](_0xddde('0x1c'),_0x3f7f32[_0xddde('0x1a')],_0x262ee1);_0x35a441(_0x4e07e6['error'](0x1f4,_0x3f7f32[_0xddde('0x1a')]));});});};exports[_0xddde('0x26')]=function(_0x511652){var _0x53df4a=this;return new Promise(function(_0x5b17b4,_0x2aabf7){return db[_0xddde('0x1d')][_0xddde('0x27')]({'raw':_0x511652[_0xddde('0x1f')]?_0x511652[_0xddde('0x1f')][_0xddde('0x20')]===undefined?!![]:![]:!![],'where':_0x511652[_0xddde('0x1f')]?_0x511652['options'][_0xddde('0x21')]||null:null,'attributes':_0x511652[_0xddde('0x1f')]?_0x511652[_0xddde('0x1f')]['attributes']||null:null,'include':_0x511652[_0xddde('0x1f')]?_0x511652[_0xddde('0x1f')][_0xddde('0x22')]?_[_0xddde('0x23')](_0x511652[_0xddde('0x1f')]['include'],function(_0x5b3ae9){return{'model':db[_0x5b3ae9[_0xddde('0x24')]],'as':_0x5b3ae9['as'],'attributes':_0x5b3ae9[_0xddde('0x25')],'include':_0x5b3ae9['include']?_[_0xddde('0x23')](_0x5b3ae9['include'],function(_0x59e924){return{'model':db[_0x59e924[_0xddde('0x24')]],'as':_0x59e924['as'],'attributes':_0x59e924[_0xddde('0x25')],'include':_0x59e924[_0xddde('0x22')]?_['map'](_0x59e924[_0xddde('0x22')],function(_0x4858aa){return{'model':db[_0x4858aa['model']],'as':_0x4858aa['as'],'attributes':_0x4858aa[_0xddde('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x98e3d3){logger[_0xddde('0x12')]('ShowSmsQueue',_0x511652);logger['debug'](_0xddde('0x26'),_0x511652,JSON['stringify'](_0x98e3d3));_0x5b17b4(_0x98e3d3);})[_0xddde('0x1b')](function(_0x1d1684){logger[_0xddde('0x17')](_0xddde('0x26'),_0x1d1684[_0xddde('0x1a')],_0x511652);_0x2aabf7(_0x53df4a[_0xddde('0x17')](0x1f4,_0x1d1684['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 9596994..050816d 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 _0x9179=['emit','removeListener','length','smsQueue:','save','remove','update'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9179,0x10e));var _0x9917=function(_0x249141,_0xba0e2f){_0x249141=_0x249141-0x0;var _0x410288=_0x9179[_0x249141];return _0x410288;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x9917('0x0'),_0x9917('0x1'),_0x9917('0x2')];function createListener(_0x7dbf82,_0x515b63){return function(_0xe40083){_0x515b63[_0x9917('0x3')](_0x7dbf82,_0xe40083);};}function removeListener(_0x186cef,_0x9487aa){return function(){SmsQueueEvents[_0x9917('0x4')](_0x186cef,_0x9487aa);};}exports['register']=function(_0x5a55e0){for(var _0x1c88b9=0x0,_0x2ed7d9=events[_0x9917('0x5')];_0x1c88b9<_0x2ed7d9;_0x1c88b9++){var _0x272851=events[_0x1c88b9];var _0x2aae35=createListener(_0x9917('0x6')+_0x272851,_0x5a55e0);SmsQueueEvents['on'](_0x272851,_0x2aae35);}}; \ No newline at end of file +var _0xe3fd=['emit','register','length','smsQueue:','save','remove','update'];(function(_0x356fc0,_0x147f5f){var _0x21e6f7=function(_0x1f4786){while(--_0x1f4786){_0x356fc0['push'](_0x356fc0['shift']());}};_0x21e6f7(++_0x147f5f);}(_0xe3fd,0xc1));var _0xde3f=function(_0x572957,_0xdaa125){_0x572957=_0x572957-0x0;var _0x11d00f=_0xe3fd[_0x572957];return _0x11d00f;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xde3f('0x0'),_0xde3f('0x1'),_0xde3f('0x2')];function createListener(_0x560904,_0x836e01){return function(_0x251196){_0x836e01[_0xde3f('0x3')](_0x560904,_0x251196);};}function removeListener(_0x56dbae,_0x563de1){return function(){SmsQueueEvents['removeListener'](_0x56dbae,_0x563de1);};}exports[_0xde3f('0x4')]=function(_0x375643){for(var _0xcadfd9=0x0,_0x44ffb4=events[_0xde3f('0x5')];_0xcadfd9<_0x44ffb4;_0xcadfd9++){var _0x3cfab8=events[_0xcadfd9];var _0x45451e=createListener(_0xde3f('0x6')+_0x3cfab8,_0x375643);SmsQueueEvents['on'](_0x3cfab8,_0x45451e);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 65e99f7..5303b59 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 _0x3004=['isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x3004,0x123));var _0x4300=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x3004[_0x2dea24];return _0x309d58;};'use strict';var multer=require(_0x4300('0x0'));var util=require(_0x4300('0x1'));var path=require(_0x4300('0x2'));var timeout=require(_0x4300('0x3'));var express=require(_0x4300('0x4'));var router=express['Router']();var fs_extra=require(_0x4300('0x5'));var auth=require(_0x4300('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4300('0x7'));var controller=require('./smsQueueReport.controller');router[_0x4300('0x8')]('/',auth[_0x4300('0x9')](),controller[_0x4300('0xa')]);router['get'](_0x4300('0xb'),auth['isAuthenticated'](),controller[_0x4300('0xc')]);router[_0x4300('0x8')](_0x4300('0xd'),auth[_0x4300('0x9')](),controller[_0x4300('0xe')]);router[_0x4300('0xf')]('/',auth[_0x4300('0x9')](),controller[_0x4300('0x10')]);router['put']('/:id',auth[_0x4300('0x9')](),controller['update']);router[_0x4300('0x11')](_0x4300('0xd'),auth[_0x4300('0x9')](),controller[_0x4300('0x12')]);module[_0x4300('0x13')]=router; \ No newline at end of file +var _0x368c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x368c,0x1b4));var _0xc368=function(_0x557f92,_0x4ac37c){_0x557f92=_0x557f92-0x0;var _0x41aa4b=_0x368c[_0x557f92];return _0x41aa4b;};'use strict';var multer=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc368('0x2'));var router=express[_0xc368('0x3')]();var fs_extra=require(_0xc368('0x4'));var auth=require(_0xc368('0x5'));var interaction=require(_0xc368('0x6'));var config=require(_0xc368('0x7'));var controller=require(_0xc368('0x8'));router[_0xc368('0x9')]('/',auth[_0xc368('0xa')](),controller['index']);router[_0xc368('0x9')](_0xc368('0xb'),auth[_0xc368('0xa')](),controller[_0xc368('0xc')]);router[_0xc368('0x9')](_0xc368('0xd'),auth['isAuthenticated'](),controller[_0xc368('0xe')]);router[_0xc368('0xf')]('/',auth[_0xc368('0xa')](),controller[_0xc368('0x10')]);router['put']('/:id',auth[_0xc368('0xa')](),controller[_0xc368('0x11')]);router[_0xc368('0x12')]('/:id',auth[_0xc368('0xa')](),controller[_0xc368('0x13')]);module[_0xc368('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 659e725..89d6131 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 _0xee31=['STRING','DATE','moment','sequelize','exports'];(function(_0x26a184,_0x3ae3c2){var _0x2f67ee=function(_0xce701c){while(--_0xce701c){_0x26a184['push'](_0x26a184['shift']());}};_0x2f67ee(++_0x3ae3c2);}(_0xee31,0x101));var _0x1ee3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xee31[_0x199572];return _0x13cfa3;};'use strict';var moment=require(_0x1ee3('0x0'));var Sequelize=require(_0x1ee3('0x1'));module[_0x1ee3('0x2')]={'uniqueid':{'type':Sequelize[_0x1ee3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1ee3('0x3')]},'joinAt':{'type':Sequelize[_0x1ee3('0x4')]},'leaveAt':{'type':Sequelize[_0x1ee3('0x4')]},'acceptAt':{'type':Sequelize[_0x1ee3('0x4')]},'exitAt':{'type':Sequelize[_0x1ee3('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf920=['exports','STRING','DATE','sequelize'];(function(_0x196b9d,_0x409e0){var _0x2aab2b=function(_0x49378c){while(--_0x49378c){_0x196b9d['push'](_0x196b9d['shift']());}};_0x2aab2b(++_0x409e0);}(_0xf920,0x1a7));var _0x0f92=function(_0x1b6ae1,_0x7265ae){_0x1b6ae1=_0x1b6ae1-0x0;var _0x5843a2=_0xf920[_0x1b6ae1];return _0x5843a2;};'use strict';var moment=require('moment');var Sequelize=require(_0x0f92('0x0'));module[_0x0f92('0x1')]={'uniqueid':{'type':Sequelize[_0x0f92('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0f92('0x2')]},'joinAt':{'type':Sequelize[_0x0f92('0x3')]},'leaveAt':{'type':Sequelize[_0x0f92('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0f92('0x3')]},'reason':{'type':Sequelize[_0x0f92('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 35d047f..9f1f362 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 _0x6cb3=['destroy','then','error','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','desk.js','to-csv','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','Content-Range','apply','save','update'];(function(_0x2dfd0e,_0x13739e){var _0x343af6=function(_0x206e2f){while(--_0x206e2f){_0x2dfd0e['push'](_0x2dfd0e['shift']());}};_0x343af6(++_0x13739e);}(_0x6cb3,0x141));var _0x36cb=function(_0x2d38e5,_0x1cd1a4){_0x2d38e5=_0x2d38e5-0x0;var _0x3ca51f=_0x6cb3[_0x2d38e5];return _0x3ca51f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36cb('0x0'));var zipdir=require(_0x36cb('0x1'));var jsonpatch=require(_0x36cb('0x2'));var rp=require(_0x36cb('0x3'));var moment=require(_0x36cb('0x4'));var BPromise=require(_0x36cb('0x5'));var Mustache=require(_0x36cb('0x6'));var util=require(_0x36cb('0x7'));var path=require('path');var sox=require(_0x36cb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36cb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x36cb('0xa'));var toCsv=require(_0x36cb('0xb'));var querystring=require(_0x36cb('0xc'));var Papa=require(_0x36cb('0xd'));var Redis=require(_0x36cb('0xe'));var authService=require(_0x36cb('0xf'));var qs=require(_0x36cb('0x10'));var as=require(_0x36cb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x36cb('0x12'));var utils=require('../../config/utils');var config=require(_0x36cb('0x13'));var licenseUtil=require(_0x36cb('0x14'));var db=require(_0x36cb('0x15'))['db'];function respondWithStatusCode(_0x1e3022,_0x5871af){_0x5871af=_0x5871af||0xcc;return function(_0x10ddfd){if(_0x10ddfd){return _0x1e3022[_0x36cb('0x16')](_0x5871af);}return _0x1e3022[_0x36cb('0x17')](_0x5871af)[_0x36cb('0x18')]();};}function respondWithResult(_0x376599,_0x36fb92){_0x36fb92=_0x36fb92||0xc8;return function(_0x452cb4){if(_0x452cb4){return _0x376599['status'](_0x36fb92)[_0x36cb('0x19')](_0x452cb4);}};}function respondWithFilteredResult(_0x3c7d6e,_0x22c137){return function(_0x21f078){if(_0x21f078){var _0x3d3cae=typeof _0x22c137[_0x36cb('0x1a')]===_0x36cb('0x1b')&&typeof _0x22c137[_0x36cb('0x1c')]===_0x36cb('0x1b');var _0x5440d3=_0x21f078[_0x36cb('0x1d')];var _0x16582d=_0x3d3cae?0x0:_0x22c137[_0x36cb('0x1a')];var _0x7ba864=_0x3d3cae?_0x21f078[_0x36cb('0x1d')]:_0x22c137['offset']+_0x22c137[_0x36cb('0x1c')];var _0x346703;if(_0x7ba864>=_0x5440d3){_0x7ba864=_0x5440d3;_0x346703=0xc8;}else{_0x346703=0xce;}_0x3c7d6e['status'](_0x346703);return _0x3c7d6e['set'](_0x36cb('0x1e'),_0x16582d+'-'+_0x7ba864+'/'+_0x5440d3)[_0x36cb('0x19')](_0x21f078);}return null;};}function patchUpdates(_0x2a09ee){return function(_0x1937d1){try{jsonpatch[_0x36cb('0x1f')](_0x1937d1,_0x2a09ee,!![]);}catch(_0x1fb227){return BPromise['reject'](_0x1fb227);}return _0x1937d1[_0x36cb('0x20')]();};}function saveUpdates(_0x767add,_0x5458a5){return function(_0x2dfb5d){if(_0x2dfb5d){return _0x2dfb5d[_0x36cb('0x21')](_0x767add)['then'](function(_0x43a2d7){return _0x43a2d7;});}return null;};}function removeEntity(_0xb41239,_0x26b56a){return function(_0x17cdd9){if(_0x17cdd9){return _0x17cdd9[_0x36cb('0x22')]()[_0x36cb('0x23')](function(){_0xb41239[_0x36cb('0x17')](0xcc)[_0x36cb('0x18')]();});}};}function handleEntityNotFound(_0xaba14e,_0x2df102){return function(_0x29774a){if(!_0x29774a){_0xaba14e[_0x36cb('0x16')](0x194);}return _0x29774a;};}function handleError(_0x15ce3b,_0x5e6392){_0x5e6392=_0x5e6392||0x1f4;return function(_0x6fb52){logger[_0x36cb('0x24')](_0x6fb52[_0x36cb('0x25')]);if(_0x6fb52['name']){delete _0x6fb52[_0x36cb('0x26')];}_0x15ce3b[_0x36cb('0x17')](_0x5e6392)[_0x36cb('0x27')](_0x6fb52);};}exports['index']=function(_0x1cf03b,_0x41927a){var _0x7b10c0={},_0x31434a={},_0x402d76={'count':0x0,'rows':[]};var _0x3b2afc=_[_0x36cb('0x28')](db[_0x36cb('0x29')][_0x36cb('0x2a')],function(_0x304f35){return{'name':_0x304f35[_0x36cb('0x2b')],'type':_0x304f35[_0x36cb('0x2c')][_0x36cb('0x2d')]};});_0x31434a[_0x36cb('0x2e')]=_[_0x36cb('0x28')](_0x3b2afc,_0x36cb('0x26'));_0x31434a[_0x36cb('0x2f')]=_[_0x36cb('0x30')](_0x1cf03b['query']);_0x31434a[_0x36cb('0x31')]=_[_0x36cb('0x32')](_0x31434a['model'],_0x31434a[_0x36cb('0x2f')]);_0x7b10c0['attributes']=_[_0x36cb('0x32')](_0x31434a[_0x36cb('0x2e')],qs['fields'](_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x33')]));_0x7b10c0['attributes']=_0x7b10c0[_0x36cb('0x34')][_0x36cb('0x35')]?_0x7b10c0[_0x36cb('0x34')]:_0x31434a[_0x36cb('0x2e')];if(!_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x36')]('nolimit')){_0x7b10c0[_0x36cb('0x1c')]=qs[_0x36cb('0x1c')](_0x1cf03b['query']['limit']);_0x7b10c0[_0x36cb('0x1a')]=qs[_0x36cb('0x1a')](_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x1a')]);}_0x7b10c0[_0x36cb('0x37')]=qs[_0x36cb('0x38')](_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x38')]);_0x7b10c0[_0x36cb('0x39')]=qs[_0x36cb('0x31')](_['pick'](_0x1cf03b[_0x36cb('0x2f')],_0x31434a['filters']),_0x3b2afc);if(_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x3a')]){_0x7b10c0[_0x36cb('0x39')]=_[_0x36cb('0x3b')](_0x7b10c0['where'],{'$or':_[_0x36cb('0x28')](_0x3b2afc,function(_0x45fd9d){if(_0x45fd9d[_0x36cb('0x2c')]!=='VIRTUAL'){var _0x52a183={};_0x52a183[_0x45fd9d[_0x36cb('0x26')]]={'$like':'%'+_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x3a')]+'%'};return _0x52a183;}})});}_0x7b10c0=_[_0x36cb('0x3b')]({},_0x7b10c0,_0x1cf03b['options']);var _0x18c659={'where':_0x7b10c0['where']};return db[_0x36cb('0x29')][_0x36cb('0x1d')](_0x18c659)[_0x36cb('0x23')](function(_0xd5e401){_0x402d76[_0x36cb('0x1d')]=_0xd5e401;if(_0x1cf03b[_0x36cb('0x2f')][_0x36cb('0x3c')]){_0x7b10c0[_0x36cb('0x3d')]=[{'all':!![]}];}return db[_0x36cb('0x29')][_0x36cb('0x3e')](_0x7b10c0);})[_0x36cb('0x23')](function(_0x2fba68){_0x402d76['rows']=_0x2fba68;return _0x402d76;})[_0x36cb('0x23')](respondWithFilteredResult(_0x41927a,_0x7b10c0))[_0x36cb('0x3f')](handleError(_0x41927a,null));};exports[_0x36cb('0x40')]=function(_0x1243ec,_0x53a049){var _0x3bf64b={'raw':!![],'where':{'id':_0x1243ec[_0x36cb('0x41')]['id']}},_0x5cebb6={};_0x5cebb6['model']=_[_0x36cb('0x30')](db[_0x36cb('0x29')]['rawAttributes']);_0x5cebb6[_0x36cb('0x2f')]=_['keys'](_0x1243ec[_0x36cb('0x2f')]);_0x5cebb6[_0x36cb('0x31')]=_[_0x36cb('0x32')](_0x5cebb6[_0x36cb('0x2e')],_0x5cebb6[_0x36cb('0x2f')]);_0x3bf64b[_0x36cb('0x34')]=_[_0x36cb('0x32')](_0x5cebb6[_0x36cb('0x2e')],qs[_0x36cb('0x33')](_0x1243ec[_0x36cb('0x2f')][_0x36cb('0x33')]));_0x3bf64b[_0x36cb('0x34')]=_0x3bf64b[_0x36cb('0x34')][_0x36cb('0x35')]?_0x3bf64b['attributes']:_0x5cebb6[_0x36cb('0x2e')];if(_0x1243ec[_0x36cb('0x2f')]['includeAll']){_0x3bf64b['include']=[{'all':!![]}];}_0x3bf64b=_[_0x36cb('0x3b')]({},_0x3bf64b,_0x1243ec[_0x36cb('0x42')]);return db['SmsQueueReport'][_0x36cb('0x43')](_0x3bf64b)['then'](handleEntityNotFound(_0x53a049,null))[_0x36cb('0x23')](respondWithResult(_0x53a049,null))[_0x36cb('0x3f')](handleError(_0x53a049,null));};exports[_0x36cb('0x44')]=function(_0x2b395f,_0xf9ff04){return db[_0x36cb('0x29')][_0x36cb('0x44')](_0x2b395f[_0x36cb('0x45')],{})[_0x36cb('0x23')](respondWithResult(_0xf9ff04,0xc9))['catch'](handleError(_0xf9ff04,null));};exports[_0x36cb('0x21')]=function(_0x1847b7,_0x826c3f){if(_0x1847b7[_0x36cb('0x45')]['id']){delete _0x1847b7[_0x36cb('0x45')]['id'];}return db[_0x36cb('0x29')]['find']({'where':{'id':_0x1847b7[_0x36cb('0x41')]['id']}})[_0x36cb('0x23')](handleEntityNotFound(_0x826c3f,null))['then'](saveUpdates(_0x1847b7['body'],null))[_0x36cb('0x23')](respondWithResult(_0x826c3f,null))[_0x36cb('0x3f')](handleError(_0x826c3f,null));};exports['destroy']=function(_0x281463,_0x41b560){return db['SmsQueueReport'][_0x36cb('0x43')]({'where':{'id':_0x281463[_0x36cb('0x41')]['id']}})[_0x36cb('0x23')](handleEntityNotFound(_0x41b560,null))[_0x36cb('0x23')](removeEntity(_0x41b560,null))[_0x36cb('0x3f')](handleError(_0x41b560,null));};exports[_0x36cb('0x46')]=function(_0x1d07cf,_0x5dcc1e){return db['SmsQueueReport'][_0x36cb('0x46')]()['then'](respondWithResult(_0x5dcc1e,null))[_0x36cb('0x3f')](handleError(_0x5dcc1e,null));}; \ No newline at end of file +var _0x4e0f=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','SmsQueueReport','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1cd7f1,_0x44236f){var _0x5adfde=function(_0x409537){while(--_0x409537){_0x1cd7f1['push'](_0x1cd7f1['shift']());}};_0x5adfde(++_0x44236f);}(_0x4e0f,0x18f));var _0xf4e0=function(_0x4216ba,_0x5739c5){_0x4216ba=_0x4216ba-0x0;var _0x2592ca=_0x4e0f[_0x4216ba];return _0x2592ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4e0('0x0'));var zipdir=require(_0xf4e0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4e0('0x2'));var moment=require(_0xf4e0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf4e0('0x4'));var sox=require(_0xf4e0('0x5'));var csv=require(_0xf4e0('0x6'));var ejs=require(_0xf4e0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf4e0('0x8'));var crypto=require(_0xf4e0('0x9'));var jsforce=require(_0xf4e0('0xa'));var deskjs=require(_0xf4e0('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf4e0('0xc'));var Papa=require('papaparse');var Redis=require(_0xf4e0('0xd'));var authService=require(_0xf4e0('0xe'));var qs=require(_0xf4e0('0xf'));var as=require(_0xf4e0('0x10'));var hardwareService=require(_0xf4e0('0x11'));var logger=require(_0xf4e0('0x12'))(_0xf4e0('0x13'));var utils=require(_0xf4e0('0x14'));var config=require(_0xf4e0('0x15'));var licenseUtil=require(_0xf4e0('0x16'));var db=require(_0xf4e0('0x17'))['db'];function respondWithStatusCode(_0x239a2f,_0x3c2bed){_0x3c2bed=_0x3c2bed||0xcc;return function(_0x47b246){if(_0x47b246){return _0x239a2f[_0xf4e0('0x18')](_0x3c2bed);}return _0x239a2f[_0xf4e0('0x19')](_0x3c2bed)[_0xf4e0('0x1a')]();};}function respondWithResult(_0x1f7753,_0x555b52){_0x555b52=_0x555b52||0xc8;return function(_0x45cc0f){if(_0x45cc0f){return _0x1f7753['status'](_0x555b52)[_0xf4e0('0x1b')](_0x45cc0f);}};}function respondWithFilteredResult(_0x5bf334,_0x2ce5d9){return function(_0x46943b){if(_0x46943b){var _0x21c6c6=typeof _0x2ce5d9[_0xf4e0('0x1c')]===_0xf4e0('0x1d')&&typeof _0x2ce5d9[_0xf4e0('0x1e')]===_0xf4e0('0x1d');var _0x11c686=_0x46943b[_0xf4e0('0x1f')];var _0x3f64fb=_0x21c6c6?0x0:_0x2ce5d9[_0xf4e0('0x1c')];var _0x2ad307=_0x21c6c6?_0x46943b[_0xf4e0('0x1f')]:_0x2ce5d9[_0xf4e0('0x1c')]+_0x2ce5d9[_0xf4e0('0x1e')];var _0x109f16;if(_0x2ad307>=_0x11c686){_0x2ad307=_0x11c686;_0x109f16=0xc8;}else{_0x109f16=0xce;}_0x5bf334[_0xf4e0('0x19')](_0x109f16);return _0x5bf334[_0xf4e0('0x20')](_0xf4e0('0x21'),_0x3f64fb+'-'+_0x2ad307+'/'+_0x11c686)[_0xf4e0('0x1b')](_0x46943b);}return null;};}function patchUpdates(_0x16ebb2){return function(_0x44ea21){try{jsonpatch[_0xf4e0('0x22')](_0x44ea21,_0x16ebb2,!![]);}catch(_0x22eb5a){return BPromise['reject'](_0x22eb5a);}return _0x44ea21[_0xf4e0('0x23')]();};}function saveUpdates(_0x4ac0c0,_0x43d940){return function(_0x357a55){if(_0x357a55){return _0x357a55[_0xf4e0('0x24')](_0x4ac0c0)['then'](function(_0x1dc505){return _0x1dc505;});}return null;};}function removeEntity(_0x25605a,_0x295072){return function(_0x226141){if(_0x226141){return _0x226141[_0xf4e0('0x25')]()[_0xf4e0('0x26')](function(){_0x25605a[_0xf4e0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb6f8,_0x4c0c9b){return function(_0x29051b){if(!_0x29051b){_0x1fb6f8['sendStatus'](0x194);}return _0x29051b;};}function handleError(_0x50c1dd,_0x14625e){_0x14625e=_0x14625e||0x1f4;return function(_0x2c58fe){logger['error'](_0x2c58fe[_0xf4e0('0x27')]);if(_0x2c58fe[_0xf4e0('0x28')]){delete _0x2c58fe[_0xf4e0('0x28')];}_0x50c1dd[_0xf4e0('0x19')](_0x14625e)[_0xf4e0('0x29')](_0x2c58fe);};}exports[_0xf4e0('0x2a')]=function(_0x265c79,_0x42a073){var _0x42ac1c={},_0x3306a6={},_0x2c7aa1={'count':0x0,'rows':[]};var _0x1613f5=_[_0xf4e0('0x2b')](db[_0xf4e0('0x2c')]['rawAttributes'],function(_0x68fb05){return{'name':_0x68fb05[_0xf4e0('0x2d')],'type':_0x68fb05['type']['key']};});_0x3306a6[_0xf4e0('0x2e')]=_[_0xf4e0('0x2b')](_0x1613f5,_0xf4e0('0x28'));_0x3306a6['query']=_[_0xf4e0('0x2f')](_0x265c79[_0xf4e0('0x30')]);_0x3306a6[_0xf4e0('0x31')]=_[_0xf4e0('0x32')](_0x3306a6[_0xf4e0('0x2e')],_0x3306a6[_0xf4e0('0x30')]);_0x42ac1c[_0xf4e0('0x33')]=_[_0xf4e0('0x32')](_0x3306a6[_0xf4e0('0x2e')],qs[_0xf4e0('0x34')](_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x34')]));_0x42ac1c[_0xf4e0('0x33')]=_0x42ac1c[_0xf4e0('0x33')]['length']?_0x42ac1c[_0xf4e0('0x33')]:_0x3306a6[_0xf4e0('0x2e')];if(!_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x35')](_0xf4e0('0x36'))){_0x42ac1c[_0xf4e0('0x1e')]=qs['limit'](_0x265c79[_0xf4e0('0x30')]['limit']);_0x42ac1c[_0xf4e0('0x1c')]=qs[_0xf4e0('0x1c')](_0x265c79[_0xf4e0('0x30')]['offset']);}_0x42ac1c['order']=qs[_0xf4e0('0x37')](_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x37')]);_0x42ac1c[_0xf4e0('0x38')]=qs[_0xf4e0('0x31')](_['pick'](_0x265c79[_0xf4e0('0x30')],_0x3306a6[_0xf4e0('0x31')]),_0x1613f5);if(_0x265c79['query'][_0xf4e0('0x39')]){_0x42ac1c[_0xf4e0('0x38')]=_['merge'](_0x42ac1c[_0xf4e0('0x38')],{'$or':_['map'](_0x1613f5,function(_0x5a664e){if(_0x5a664e[_0xf4e0('0x3a')]!==_0xf4e0('0x3b')){var _0x512de5={};_0x512de5[_0x5a664e[_0xf4e0('0x28')]]={'$like':'%'+_0x265c79[_0xf4e0('0x30')][_0xf4e0('0x39')]+'%'};return _0x512de5;}})});}_0x42ac1c=_[_0xf4e0('0x3c')]({},_0x42ac1c,_0x265c79[_0xf4e0('0x3d')]);var _0x5d0fed={'where':_0x42ac1c[_0xf4e0('0x38')]};return db[_0xf4e0('0x2c')][_0xf4e0('0x1f')](_0x5d0fed)[_0xf4e0('0x26')](function(_0x637c3b){_0x2c7aa1['count']=_0x637c3b;if(_0x265c79['query'][_0xf4e0('0x3e')]){_0x42ac1c[_0xf4e0('0x3f')]=[{'all':!![]}];}return db[_0xf4e0('0x2c')][_0xf4e0('0x40')](_0x42ac1c);})['then'](function(_0x24a0b5){_0x2c7aa1['rows']=_0x24a0b5;return _0x2c7aa1;})[_0xf4e0('0x26')](respondWithFilteredResult(_0x42a073,_0x42ac1c))[_0xf4e0('0x41')](handleError(_0x42a073,null));};exports['show']=function(_0x3525ed,_0x5793f8){var _0x5c5364={'raw':!![],'where':{'id':_0x3525ed[_0xf4e0('0x42')]['id']}},_0x3a81f7={};_0x3a81f7[_0xf4e0('0x2e')]=_['keys'](db[_0xf4e0('0x2c')]['rawAttributes']);_0x3a81f7[_0xf4e0('0x30')]=_['keys'](_0x3525ed['query']);_0x3a81f7[_0xf4e0('0x31')]=_['intersection'](_0x3a81f7[_0xf4e0('0x2e')],_0x3a81f7[_0xf4e0('0x30')]);_0x5c5364[_0xf4e0('0x33')]=_[_0xf4e0('0x32')](_0x3a81f7[_0xf4e0('0x2e')],qs[_0xf4e0('0x34')](_0x3525ed[_0xf4e0('0x30')][_0xf4e0('0x34')]));_0x5c5364[_0xf4e0('0x33')]=_0x5c5364[_0xf4e0('0x33')]['length']?_0x5c5364[_0xf4e0('0x33')]:_0x3a81f7[_0xf4e0('0x2e')];if(_0x3525ed['query'][_0xf4e0('0x3e')]){_0x5c5364[_0xf4e0('0x3f')]=[{'all':!![]}];}_0x5c5364=_['merge']({},_0x5c5364,_0x3525ed[_0xf4e0('0x3d')]);return db[_0xf4e0('0x2c')][_0xf4e0('0x43')](_0x5c5364)[_0xf4e0('0x26')](handleEntityNotFound(_0x5793f8,null))[_0xf4e0('0x26')](respondWithResult(_0x5793f8,null))['catch'](handleError(_0x5793f8,null));};exports[_0xf4e0('0x44')]=function(_0x5659e9,_0xe3fabe){return db[_0xf4e0('0x2c')][_0xf4e0('0x44')](_0x5659e9[_0xf4e0('0x45')],{})[_0xf4e0('0x26')](respondWithResult(_0xe3fabe,0xc9))['catch'](handleError(_0xe3fabe,null));};exports[_0xf4e0('0x24')]=function(_0x50eaf6,_0x3db5a2){if(_0x50eaf6['body']['id']){delete _0x50eaf6['body']['id'];}return db[_0xf4e0('0x2c')][_0xf4e0('0x43')]({'where':{'id':_0x50eaf6[_0xf4e0('0x42')]['id']}})[_0xf4e0('0x26')](handleEntityNotFound(_0x3db5a2,null))[_0xf4e0('0x26')](saveUpdates(_0x50eaf6[_0xf4e0('0x45')],null))[_0xf4e0('0x26')](respondWithResult(_0x3db5a2,null))[_0xf4e0('0x41')](handleError(_0x3db5a2,null));};exports['destroy']=function(_0x2c45a,_0x4e4020){return db['SmsQueueReport'][_0xf4e0('0x43')]({'where':{'id':_0x2c45a[_0xf4e0('0x42')]['id']}})[_0xf4e0('0x26')](handleEntityNotFound(_0x4e4020,null))[_0xf4e0('0x26')](removeEntity(_0x4e4020,null))[_0xf4e0('0x41')](handleError(_0x4e4020,null));};exports['describe']=function(_0x35c518,_0xc0215a){return db[_0xf4e0('0x2c')]['describe']()[_0xf4e0('0x26')](respondWithResult(_0xc0215a,null))[_0xf4e0('0x41')](handleError(_0xc0215a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 8503002..0ec4985 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x3577ad,_0x11e389){var _0x56c663=function(_0xf6273d){while(--_0xf6273d){_0x3577ad['push'](_0x3577ad['shift']());}};_0x56c663(++_0x11e389);}(_0xe706,0xa3));var _0x6e70=function(_0x4237dc,_0x171899){_0x4237dc=_0x4237dc-0x0;var _0x35ed7f=_0xe706[_0x4237dc];return _0x35ed7f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index ea53452..9584db2 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 _0x0549=['CreateSmsQueueReport','debug','catch','UpdateSmsQueueReport','where','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','info','SmsQueueReport,\x20%s,\x20%s','stringify','error','message','SmsQueueReport','create','body','options','raw','then'];(function(_0x4f485f,_0x1db0f7){var _0x1e998e=function(_0x14066c){while(--_0x14066c){_0x4f485f['push'](_0x4f485f['shift']());}};_0x1e998e(++_0x1db0f7);}(_0x0549,0x123));var _0x9054=function(_0x4a7cf9,_0x1d7f2f){_0x4a7cf9=_0x4a7cf9-0x0;var _0x3c3d2f=_0x0549[_0x4a7cf9];return _0x3c3d2f;};'use strict';var _=require(_0x9054('0x0'));var util=require(_0x9054('0x1'));var moment=require(_0x9054('0x2'));var BPromise=require(_0x9054('0x3'));var rs=require(_0x9054('0x4'));var fs=require('fs');var Redis=require(_0x9054('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9054('0x6'));var config=require(_0x9054('0x7'));var jayson=require(_0x9054('0x8'));var client=jayson[_0x9054('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1869b7,_0x4afd27,_0x5636ba){return new BPromise(function(_0x401a5b,_0xff6524){return client['request'](_0x1869b7,_0x5636ba)['then'](function(_0x32351f){logger[_0x9054('0xa')](_0x9054('0xb'),_0x4afd27,'request\x20sent');logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x4afd27,'request\x20sent',JSON[_0x9054('0xc')](_0x32351f));if(_0x32351f[_0x9054('0xd')]){if(_0x32351f[_0x9054('0xd')]['code']===0x1f4){logger[_0x9054('0xd')](_0x9054('0xb'),_0x4afd27,_0x32351f[_0x9054('0xd')]['message']);return _0xff6524(_0x32351f[_0x9054('0xd')][_0x9054('0xe')]);}logger[_0x9054('0xd')](_0x9054('0xb'),_0x4afd27,_0x32351f['error']['message']);return _0x401a5b(_0x32351f[_0x9054('0xd')]['message']);}else{logger[_0x9054('0xa')](_0x9054('0xb'),_0x4afd27,'request\x20sent');_0x401a5b(_0x32351f['result'][_0x9054('0xe')]);}})['catch'](function(_0x46a856){logger[_0x9054('0xd')](_0x9054('0xb'),_0x4afd27,_0x46a856);_0xff6524(_0x46a856);});});}exports['CreateSmsQueueReport']=function(_0x5cdec5){var _0x18dd98=this;return new Promise(function(_0x37e642,_0x4573fc){return db[_0x9054('0xf')][_0x9054('0x10')](_0x5cdec5[_0x9054('0x11')],{'raw':_0x5cdec5[_0x9054('0x12')]?_0x5cdec5[_0x9054('0x12')][_0x9054('0x13')]===undefined?!![]:![]:!![]})[_0x9054('0x14')](function(_0x39eff5){logger[_0x9054('0xa')](_0x9054('0x15'),_0x5cdec5);logger[_0x9054('0x16')](_0x9054('0x15'),_0x5cdec5,JSON['stringify'](_0x39eff5));_0x37e642(_0x39eff5);})[_0x9054('0x17')](function(_0x4fed6e){logger[_0x9054('0xd')](_0x9054('0x15'),_0x4fed6e[_0x9054('0xe')],_0x5cdec5);_0x4573fc(_0x18dd98[_0x9054('0xd')](0x1f4,_0x4fed6e[_0x9054('0xe')]));});});};exports[_0x9054('0x18')]=function(_0x963d69){var _0x13721a=this;return new Promise(function(_0x26d365,_0x3d276c){return db['SmsQueueReport']['update'](_0x963d69[_0x9054('0x11')],{'raw':_0x963d69[_0x9054('0x12')]?_0x963d69[_0x9054('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x963d69['options']?_0x963d69[_0x9054('0x12')][_0x9054('0x19')]||null:null,'attributes':_0x963d69[_0x9054('0x12')]?_0x963d69[_0x9054('0x12')]['attributes']||null:null,'limit':_0x963d69[_0x9054('0x12')]?_0x963d69['options']['limit']||null:null})[_0x9054('0x14')](function(_0x334fc0){logger[_0x9054('0xa')](_0x9054('0x18'),_0x963d69);logger['debug'](_0x9054('0x18'),_0x963d69,JSON[_0x9054('0xc')](_0x334fc0));_0x26d365(_0x334fc0);})[_0x9054('0x17')](function(_0x11532b){logger[_0x9054('0xd')](_0x9054('0x18'),_0x11532b[_0x9054('0xe')],_0x963d69);_0x3d276c(_0x13721a[_0x9054('0xd')](0x1f4,_0x11532b[_0x9054('0xe')]));});});}; \ No newline at end of file +var _0x4841=['../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x38cb12,_0x16b5ed){var _0x16a400=function(_0x55ab30){while(--_0x55ab30){_0x38cb12['push'](_0x38cb12['shift']());}};_0x16a400(++_0x16b5ed);}(_0x4841,0x178));var _0x1484=function(_0x4c63c5,_0x17ccc3){_0x4c63c5=_0x4c63c5-0x0;var _0xfd612c=_0x4841[_0x4c63c5];return _0xfd612c;};'use strict';var _=require(_0x1484('0x0'));var util=require(_0x1484('0x1'));var moment=require(_0x1484('0x2'));var BPromise=require(_0x1484('0x3'));var rs=require(_0x1484('0x4'));var fs=require('fs');var Redis=require(_0x1484('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1484('0x6'));var logger=require(_0x1484('0x7'))(_0x1484('0x8'));var config=require(_0x1484('0x9'));var jayson=require(_0x1484('0xa'));var client=jayson[_0x1484('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a9923,_0x4c5f86,_0x3bf450){return new BPromise(function(_0x214d3b,_0x2103cb){return client[_0x1484('0xc')](_0x2a9923,_0x3bf450)[_0x1484('0xd')](function(_0x3670d0){logger[_0x1484('0xe')](_0x1484('0xf'),_0x4c5f86,_0x1484('0x10'));logger[_0x1484('0x11')](_0x1484('0x12'),_0x4c5f86,_0x1484('0x10'),JSON[_0x1484('0x13')](_0x3670d0));if(_0x3670d0[_0x1484('0x14')]){if(_0x3670d0[_0x1484('0x14')][_0x1484('0x15')]===0x1f4){logger[_0x1484('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x4c5f86,_0x3670d0[_0x1484('0x14')][_0x1484('0x16')]);return _0x2103cb(_0x3670d0['error'][_0x1484('0x16')]);}logger['error'](_0x1484('0xf'),_0x4c5f86,_0x3670d0[_0x1484('0x14')][_0x1484('0x16')]);return _0x214d3b(_0x3670d0[_0x1484('0x14')][_0x1484('0x16')]);}else{logger[_0x1484('0xe')](_0x1484('0xf'),_0x4c5f86,_0x1484('0x10'));_0x214d3b(_0x3670d0[_0x1484('0x17')][_0x1484('0x16')]);}})['catch'](function(_0x19da2d){logger[_0x1484('0x14')](_0x1484('0xf'),_0x4c5f86,_0x19da2d);_0x2103cb(_0x19da2d);});});}exports[_0x1484('0x18')]=function(_0x3c8f37){var _0x246f2a=this;return new Promise(function(_0x448f43,_0x440e9a){return db['SmsQueueReport'][_0x1484('0x19')](_0x3c8f37[_0x1484('0x1a')],{'raw':_0x3c8f37[_0x1484('0x1b')]?_0x3c8f37['options'][_0x1484('0x1c')]===undefined?!![]:![]:!![]})[_0x1484('0xd')](function(_0x43a24a){logger[_0x1484('0xe')]('CreateSmsQueueReport',_0x3c8f37);logger[_0x1484('0x11')](_0x1484('0x18'),_0x3c8f37,JSON[_0x1484('0x13')](_0x43a24a));_0x448f43(_0x43a24a);})[_0x1484('0x1d')](function(_0x30db11){logger[_0x1484('0x14')](_0x1484('0x18'),_0x30db11['message'],_0x3c8f37);_0x440e9a(_0x246f2a[_0x1484('0x14')](0x1f4,_0x30db11['message']));});});};exports[_0x1484('0x1e')]=function(_0x28e76f){var _0x3cf8b9=this;return new Promise(function(_0x460f2c,_0x540bb7){return db[_0x1484('0x1f')][_0x1484('0x20')](_0x28e76f[_0x1484('0x1a')],{'raw':_0x28e76f[_0x1484('0x1b')]?_0x28e76f[_0x1484('0x1b')][_0x1484('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28e76f['options']?_0x28e76f[_0x1484('0x1b')][_0x1484('0x21')]||null:null,'attributes':_0x28e76f['options']?_0x28e76f[_0x1484('0x1b')][_0x1484('0x22')]||null:null,'limit':_0x28e76f[_0x1484('0x1b')]?_0x28e76f['options']['limit']||null:null})[_0x1484('0xd')](function(_0x42717c){logger[_0x1484('0xe')](_0x1484('0x1e'),_0x28e76f);logger['debug'](_0x1484('0x1e'),_0x28e76f,JSON[_0x1484('0x13')](_0x42717c));_0x460f2c(_0x42717c);})[_0x1484('0x1d')](function(_0x334dc7){logger['error'](_0x1484('0x1e'),_0x334dc7['message'],_0x28e76f);_0x540bb7(_0x3cf8b9[_0x1484('0x14')](0x1f4,_0x334dc7[_0x1484('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 1ea1268..bb5127a 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 _0xd0bb=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x2ef2f2,_0x14c702){var _0x43838a=function(_0x480646){while(--_0x480646){_0x2ef2f2['push'](_0x2ef2f2['shift']());}};_0x43838a(++_0x14c702);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x34620e,_0x582015){_0x34620e=_0x34620e-0x0;var _0x3d33cd=_0xd0bb[_0x34620e];return _0x3d33cd;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var fs_extra=require(_0xbd0b('0x4'));var auth=require(_0xbd0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0b('0x6'));var controller=require('./smsTransferReport.controller');router[_0xbd0b('0x7')]('/',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x9')]);router[_0xbd0b('0x7')](_0xbd0b('0xa'),auth['isAuthenticated'](),controller[_0xbd0b('0xb')]);router[_0xbd0b('0x7')](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0b('0xe')]);router[_0xbd0b('0xf')]('/:id',auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x10')]);router['delete'](_0xbd0b('0xc'),auth[_0xbd0b('0x8')](),controller[_0xbd0b('0x11')]);module[_0xbd0b('0x12')]=router; \ No newline at end of file +var _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5f584a,_0x47f064){var _0x3788d9=function(_0x29c10b){while(--_0x29c10b){_0x5f584a['push'](_0x5f584a['shift']());}};_0x3788d9(++_0x47f064);}(_0xcca7,0x1aa));var _0x7cca=function(_0xa3781,_0x5d5603){_0xa3781=_0xa3781-0x0;var _0x4ca266=_0xcca7[_0xa3781];return _0x4ca266;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index ed8f791..aa085c8 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x28fe62,_0xae29cf){var _0x5e77be=function(_0x4bdb80){while(--_0x4bdb80){_0x28fe62['push'](_0x28fe62['shift']());}};_0x5e77be(++_0xae29cf);}(_0xf4eb,0xec));var _0xbf4e=function(_0x764607,_0x18e542){_0x764607=_0x764607-0x0;var _0x27b54d=_0xf4eb[_0x764607];return _0x27b54d;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 23121f2..5117ca4 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 _0xa355=['rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','SmsTransferReport','fieldName','type','model','name','keys','query','filters','intersection','fields','attributes','length','nolimit','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params'];(function(_0x47039a,_0x61a331){var _0x3a1a48=function(_0x18e6f5){while(--_0x18e6f5){_0x47039a['push'](_0x47039a['shift']());}};_0x3a1a48(++_0x61a331);}(_0xa355,0x136));var _0x5a35=function(_0x3f003c,_0x276a93){_0x3f003c=_0x3f003c-0x0;var _0x17ff25=_0xa355[_0x3f003c];return _0x17ff25;};'use strict';var emlformat=require(_0x5a35('0x0'));var rimraf=require(_0x5a35('0x1'));var zipdir=require(_0x5a35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a35('0x3'));var moment=require(_0x5a35('0x4'));var BPromise=require(_0x5a35('0x5'));var Mustache=require(_0x5a35('0x6'));var util=require(_0x5a35('0x7'));var path=require(_0x5a35('0x8'));var sox=require(_0x5a35('0x9'));var csv=require(_0x5a35('0xa'));var ejs=require(_0x5a35('0xb'));var fs=require('fs');var fs_extra=require(_0x5a35('0xc'));var _=require(_0x5a35('0xd'));var squel=require(_0x5a35('0xe'));var crypto=require(_0x5a35('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5a35('0x10'));var toCsv=require(_0x5a35('0xa'));var querystring=require(_0x5a35('0x11'));var Papa=require(_0x5a35('0x12'));var Redis=require('ioredis');var authService=require(_0x5a35('0x13'));var qs=require(_0x5a35('0x14'));var as=require(_0x5a35('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a35('0x16'));var utils=require('../../config/utils');var config=require(_0x5a35('0x17'));var licenseUtil=require(_0x5a35('0x18'));var db=require(_0x5a35('0x19'))['db'];function respondWithStatusCode(_0x27c8ea,_0x7af886){_0x7af886=_0x7af886||0xcc;return function(_0x36a95d){if(_0x36a95d){return _0x27c8ea[_0x5a35('0x1a')](_0x7af886);}return _0x27c8ea[_0x5a35('0x1b')](_0x7af886)[_0x5a35('0x1c')]();};}function respondWithResult(_0x24407a,_0x507d33){_0x507d33=_0x507d33||0xc8;return function(_0x5bad7e){if(_0x5bad7e){return _0x24407a['status'](_0x507d33)[_0x5a35('0x1d')](_0x5bad7e);}};}function respondWithFilteredResult(_0x5f4840,_0xa39a3){return function(_0x108cb4){if(_0x108cb4){var _0x3c7f7a=typeof _0xa39a3[_0x5a35('0x1e')]===_0x5a35('0x1f')&&typeof _0xa39a3['limit']===_0x5a35('0x1f');var _0x45dbe4=_0x108cb4[_0x5a35('0x20')];var _0x3a193e=_0x3c7f7a?0x0:_0xa39a3['offset'];var _0x244505=_0x3c7f7a?_0x108cb4[_0x5a35('0x20')]:_0xa39a3[_0x5a35('0x1e')]+_0xa39a3[_0x5a35('0x21')];var _0x5416af;if(_0x244505>=_0x45dbe4){_0x244505=_0x45dbe4;_0x5416af=0xc8;}else{_0x5416af=0xce;}_0x5f4840[_0x5a35('0x1b')](_0x5416af);return _0x5f4840[_0x5a35('0x22')](_0x5a35('0x23'),_0x3a193e+'-'+_0x244505+'/'+_0x45dbe4)[_0x5a35('0x1d')](_0x108cb4);}return null;};}function patchUpdates(_0x1c2aa7){return function(_0x4e6a26){try{jsonpatch['apply'](_0x4e6a26,_0x1c2aa7,!![]);}catch(_0x1310a9){return BPromise[_0x5a35('0x24')](_0x1310a9);}return _0x4e6a26[_0x5a35('0x25')]();};}function saveUpdates(_0x17078b,_0x3d0450){return function(_0x48187e){if(_0x48187e){return _0x48187e[_0x5a35('0x26')](_0x17078b)[_0x5a35('0x27')](function(_0x1dfbc1){return _0x1dfbc1;});}return null;};}function removeEntity(_0x35fc2c,_0xe3273f){return function(_0x349cc2){if(_0x349cc2){return _0x349cc2[_0x5a35('0x28')]()[_0x5a35('0x27')](function(){_0x35fc2c[_0x5a35('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd7afa4,_0x3bcb71){return function(_0x217670){if(!_0x217670){_0xd7afa4[_0x5a35('0x1a')](0x194);}return _0x217670;};}function handleError(_0x5d991c,_0x411cc5){_0x411cc5=_0x411cc5||0x1f4;return function(_0x105e51){logger[_0x5a35('0x29')](_0x105e51[_0x5a35('0x2a')]);if(_0x105e51['name']){delete _0x105e51['name'];}_0x5d991c[_0x5a35('0x1b')](_0x411cc5)[_0x5a35('0x2b')](_0x105e51);};}exports[_0x5a35('0x2c')]=function(_0x1c4d90,_0x7d156){var _0x2255ba={},_0x5b362b={},_0x1fc5d1={'count':0x0,'rows':[]};var _0x4f5a7d=_[_0x5a35('0x2d')](db[_0x5a35('0x2e')]['rawAttributes'],function(_0x583a4c){return{'name':_0x583a4c[_0x5a35('0x2f')],'type':_0x583a4c[_0x5a35('0x30')]['key']};});_0x5b362b[_0x5a35('0x31')]=_[_0x5a35('0x2d')](_0x4f5a7d,_0x5a35('0x32'));_0x5b362b['query']=_[_0x5a35('0x33')](_0x1c4d90[_0x5a35('0x34')]);_0x5b362b[_0x5a35('0x35')]=_[_0x5a35('0x36')](_0x5b362b[_0x5a35('0x31')],_0x5b362b[_0x5a35('0x34')]);_0x2255ba['attributes']=_[_0x5a35('0x36')](_0x5b362b['model'],qs[_0x5a35('0x37')](_0x1c4d90['query'][_0x5a35('0x37')]));_0x2255ba[_0x5a35('0x38')]=_0x2255ba['attributes'][_0x5a35('0x39')]?_0x2255ba[_0x5a35('0x38')]:_0x5b362b[_0x5a35('0x31')];if(!_0x1c4d90[_0x5a35('0x34')]['hasOwnProperty'](_0x5a35('0x3a'))){_0x2255ba[_0x5a35('0x21')]=qs[_0x5a35('0x21')](_0x1c4d90['query'][_0x5a35('0x21')]);_0x2255ba[_0x5a35('0x1e')]=qs[_0x5a35('0x1e')](_0x1c4d90[_0x5a35('0x34')][_0x5a35('0x1e')]);}_0x2255ba['order']=qs['sort'](_0x1c4d90[_0x5a35('0x34')]['sort']);_0x2255ba[_0x5a35('0x3b')]=qs[_0x5a35('0x35')](_[_0x5a35('0x3c')](_0x1c4d90['query'],_0x5b362b[_0x5a35('0x35')]),_0x4f5a7d);if(_0x1c4d90[_0x5a35('0x34')]['filter']){_0x2255ba[_0x5a35('0x3b')]=_[_0x5a35('0x3d')](_0x2255ba[_0x5a35('0x3b')],{'$or':_[_0x5a35('0x2d')](_0x4f5a7d,function(_0x3a2b03){if(_0x3a2b03['type']!==_0x5a35('0x3e')){var _0x148596={};_0x148596[_0x3a2b03[_0x5a35('0x32')]]={'$like':'%'+_0x1c4d90[_0x5a35('0x34')][_0x5a35('0x3f')]+'%'};return _0x148596;}})});}_0x2255ba=_[_0x5a35('0x3d')]({},_0x2255ba,_0x1c4d90['options']);var _0x128ca9={'where':_0x2255ba[_0x5a35('0x3b')]};return db[_0x5a35('0x2e')][_0x5a35('0x20')](_0x128ca9)['then'](function(_0x213e5a){_0x1fc5d1[_0x5a35('0x20')]=_0x213e5a;if(_0x1c4d90['query'][_0x5a35('0x40')]){_0x2255ba[_0x5a35('0x41')]=[{'all':!![]}];}return db[_0x5a35('0x2e')][_0x5a35('0x42')](_0x2255ba);})['then'](function(_0x260ca1){_0x1fc5d1['rows']=_0x260ca1;return _0x1fc5d1;})[_0x5a35('0x27')](respondWithFilteredResult(_0x7d156,_0x2255ba))[_0x5a35('0x43')](handleError(_0x7d156,null));};exports[_0x5a35('0x44')]=function(_0x1d5643,_0x53640c){var _0x201495={'raw':!![],'where':{'id':_0x1d5643[_0x5a35('0x45')]['id']}},_0x9b1f2b={};_0x9b1f2b['model']=_[_0x5a35('0x33')](db[_0x5a35('0x2e')][_0x5a35('0x46')]);_0x9b1f2b[_0x5a35('0x34')]=_[_0x5a35('0x33')](_0x1d5643[_0x5a35('0x34')]);_0x9b1f2b[_0x5a35('0x35')]=_[_0x5a35('0x36')](_0x9b1f2b[_0x5a35('0x31')],_0x9b1f2b[_0x5a35('0x34')]);_0x201495['attributes']=_[_0x5a35('0x36')](_0x9b1f2b['model'],qs[_0x5a35('0x37')](_0x1d5643[_0x5a35('0x34')]['fields']));_0x201495[_0x5a35('0x38')]=_0x201495['attributes'][_0x5a35('0x39')]?_0x201495[_0x5a35('0x38')]:_0x9b1f2b[_0x5a35('0x31')];if(_0x1d5643['query'][_0x5a35('0x40')]){_0x201495[_0x5a35('0x41')]=[{'all':!![]}];}_0x201495=_['merge']({},_0x201495,_0x1d5643[_0x5a35('0x47')]);return db[_0x5a35('0x2e')][_0x5a35('0x48')](_0x201495)[_0x5a35('0x27')](handleEntityNotFound(_0x53640c,null))[_0x5a35('0x27')](respondWithResult(_0x53640c,null))['catch'](handleError(_0x53640c,null));};exports[_0x5a35('0x49')]=function(_0x5e754c,_0x136635){return db[_0x5a35('0x2e')][_0x5a35('0x49')](_0x5e754c['body'],{})[_0x5a35('0x27')](respondWithResult(_0x136635,0xc9))[_0x5a35('0x43')](handleError(_0x136635,null));};exports[_0x5a35('0x26')]=function(_0x28eca4,_0x32f983){if(_0x28eca4[_0x5a35('0x4a')]['id']){delete _0x28eca4[_0x5a35('0x4a')]['id'];}return db[_0x5a35('0x2e')][_0x5a35('0x48')]({'where':{'id':_0x28eca4[_0x5a35('0x45')]['id']}})[_0x5a35('0x27')](handleEntityNotFound(_0x32f983,null))['then'](saveUpdates(_0x28eca4[_0x5a35('0x4a')],null))[_0x5a35('0x27')](respondWithResult(_0x32f983,null))[_0x5a35('0x43')](handleError(_0x32f983,null));};exports['destroy']=function(_0x2a1769,_0x1b7eb3){return db[_0x5a35('0x2e')][_0x5a35('0x48')]({'where':{'id':_0x2a1769[_0x5a35('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b7eb3,null))[_0x5a35('0x27')](removeEntity(_0x1b7eb3,null))[_0x5a35('0x43')](handleError(_0x1b7eb3,null));};exports[_0x5a35('0x4b')]=function(_0xb8cdfd,_0x3ee868){return db[_0x5a35('0x2e')]['describe']()[_0x5a35('0x27')](respondWithResult(_0x3ee868,null))[_0x5a35('0x43')](handleError(_0x3ee868,null));}; \ No newline at end of file +var _0xd544=['map','query','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','update','describe','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type'];(function(_0x266de2,_0x480cb5){var _0xe93032=function(_0x34ca82){while(--_0x34ca82){_0x266de2['push'](_0x266de2['shift']());}};_0xe93032(++_0x480cb5);}(_0xd544,0x14d));var _0x4d54=function(_0x203515,_0x1e86f6){_0x203515=_0x203515-0x0;var _0x221dc0=_0xd544[_0x203515];return _0x221dc0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d54('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d54('0x1'));var moment=require(_0x4d54('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d54('0x3'));var path=require(_0x4d54('0x4'));var sox=require('sox');var csv=require(_0x4d54('0x5'));var ejs=require(_0x4d54('0x6'));var fs=require('fs');var fs_extra=require(_0x4d54('0x7'));var _=require(_0x4d54('0x8'));var squel=require(_0x4d54('0x9'));var crypto=require('crypto');var jsforce=require(_0x4d54('0xa'));var deskjs=require(_0x4d54('0xb'));var toCsv=require(_0x4d54('0x5'));var querystring=require('querystring');var Papa=require(_0x4d54('0xc'));var Redis=require(_0x4d54('0xd'));var authService=require(_0x4d54('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4d54('0xf'));var hardwareService=require(_0x4d54('0x10'));var logger=require(_0x4d54('0x11'))(_0x4d54('0x12'));var utils=require(_0x4d54('0x13'));var config=require(_0x4d54('0x14'));var licenseUtil=require(_0x4d54('0x15'));var db=require(_0x4d54('0x16'))['db'];function respondWithStatusCode(_0x14175b,_0x6ace4e){_0x6ace4e=_0x6ace4e||0xcc;return function(_0x1f509a){if(_0x1f509a){return _0x14175b[_0x4d54('0x17')](_0x6ace4e);}return _0x14175b[_0x4d54('0x18')](_0x6ace4e)['end']();};}function respondWithResult(_0x3bfdad,_0x42115c){_0x42115c=_0x42115c||0xc8;return function(_0x180678){if(_0x180678){return _0x3bfdad[_0x4d54('0x18')](_0x42115c)[_0x4d54('0x19')](_0x180678);}};}function respondWithFilteredResult(_0x55137f,_0x48ac36){return function(_0x3311b4){if(_0x3311b4){var _0x763eac=typeof _0x48ac36['offset']===_0x4d54('0x1a')&&typeof _0x48ac36[_0x4d54('0x1b')]==='undefined';var _0x150049=_0x3311b4['count'];var _0x3d6ae5=_0x763eac?0x0:_0x48ac36['offset'];var _0x2f799f=_0x763eac?_0x3311b4[_0x4d54('0x1c')]:_0x48ac36[_0x4d54('0x1d')]+_0x48ac36['limit'];var _0x513c4c;if(_0x2f799f>=_0x150049){_0x2f799f=_0x150049;_0x513c4c=0xc8;}else{_0x513c4c=0xce;}_0x55137f['status'](_0x513c4c);return _0x55137f[_0x4d54('0x1e')](_0x4d54('0x1f'),_0x3d6ae5+'-'+_0x2f799f+'/'+_0x150049)[_0x4d54('0x19')](_0x3311b4);}return null;};}function patchUpdates(_0x54621a){return function(_0x5f1128){try{jsonpatch[_0x4d54('0x20')](_0x5f1128,_0x54621a,!![]);}catch(_0x5e17c3){return BPromise[_0x4d54('0x21')](_0x5e17c3);}return _0x5f1128[_0x4d54('0x22')]();};}function saveUpdates(_0x4dc2f0,_0x5ab0e1){return function(_0x2884b2){if(_0x2884b2){return _0x2884b2['update'](_0x4dc2f0)[_0x4d54('0x23')](function(_0xabb7db){return _0xabb7db;});}return null;};}function removeEntity(_0x5e009d,_0xfe574e){return function(_0x2b7d94){if(_0x2b7d94){return _0x2b7d94[_0x4d54('0x24')]()[_0x4d54('0x23')](function(){_0x5e009d[_0x4d54('0x18')](0xcc)[_0x4d54('0x25')]();});}};}function handleEntityNotFound(_0x5a6f8a,_0x739ea7){return function(_0x27e94d){if(!_0x27e94d){_0x5a6f8a[_0x4d54('0x17')](0x194);}return _0x27e94d;};}function handleError(_0x279922,_0x309e75){_0x309e75=_0x309e75||0x1f4;return function(_0x766957){logger[_0x4d54('0x26')](_0x766957[_0x4d54('0x27')]);if(_0x766957['name']){delete _0x766957[_0x4d54('0x28')];}_0x279922[_0x4d54('0x18')](_0x309e75)[_0x4d54('0x29')](_0x766957);};}exports[_0x4d54('0x2a')]=function(_0x246842,_0x16289e){var _0x281874={},_0x5904f9={},_0x494cdd={'count':0x0,'rows':[]};var _0x48f13e=_['map'](db[_0x4d54('0x2b')][_0x4d54('0x2c')],function(_0x529b49){return{'name':_0x529b49[_0x4d54('0x2d')],'type':_0x529b49[_0x4d54('0x2e')]['key']};});_0x5904f9['model']=_[_0x4d54('0x2f')](_0x48f13e,_0x4d54('0x28'));_0x5904f9['query']=_['keys'](_0x246842[_0x4d54('0x30')]);_0x5904f9['filters']=_[_0x4d54('0x31')](_0x5904f9['model'],_0x5904f9['query']);_0x281874[_0x4d54('0x32')]=_['intersection'](_0x5904f9['model'],qs['fields'](_0x246842[_0x4d54('0x30')]['fields']));_0x281874[_0x4d54('0x32')]=_0x281874['attributes']['length']?_0x281874['attributes']:_0x5904f9[_0x4d54('0x33')];if(!_0x246842[_0x4d54('0x30')][_0x4d54('0x34')](_0x4d54('0x35'))){_0x281874[_0x4d54('0x1b')]=qs[_0x4d54('0x1b')](_0x246842['query'][_0x4d54('0x1b')]);_0x281874[_0x4d54('0x1d')]=qs['offset'](_0x246842[_0x4d54('0x30')][_0x4d54('0x1d')]);}_0x281874[_0x4d54('0x36')]=qs[_0x4d54('0x37')](_0x246842[_0x4d54('0x30')][_0x4d54('0x37')]);_0x281874[_0x4d54('0x38')]=qs[_0x4d54('0x39')](_[_0x4d54('0x3a')](_0x246842['query'],_0x5904f9['filters']),_0x48f13e);if(_0x246842[_0x4d54('0x30')][_0x4d54('0x3b')]){_0x281874['where']=_[_0x4d54('0x3c')](_0x281874[_0x4d54('0x38')],{'$or':_[_0x4d54('0x2f')](_0x48f13e,function(_0x81d09){if(_0x81d09[_0x4d54('0x2e')]!=='VIRTUAL'){var _0x22b355={};_0x22b355[_0x81d09[_0x4d54('0x28')]]={'$like':'%'+_0x246842[_0x4d54('0x30')][_0x4d54('0x3b')]+'%'};return _0x22b355;}})});}_0x281874=_['merge']({},_0x281874,_0x246842[_0x4d54('0x3d')]);var _0x222238={'where':_0x281874[_0x4d54('0x38')]};return db[_0x4d54('0x2b')][_0x4d54('0x1c')](_0x222238)[_0x4d54('0x23')](function(_0x148633){_0x494cdd['count']=_0x148633;if(_0x246842[_0x4d54('0x30')][_0x4d54('0x3e')]){_0x281874[_0x4d54('0x3f')]=[{'all':!![]}];}return db[_0x4d54('0x2b')][_0x4d54('0x40')](_0x281874);})[_0x4d54('0x23')](function(_0x546404){_0x494cdd[_0x4d54('0x41')]=_0x546404;return _0x494cdd;})[_0x4d54('0x23')](respondWithFilteredResult(_0x16289e,_0x281874))[_0x4d54('0x42')](handleError(_0x16289e,null));};exports[_0x4d54('0x43')]=function(_0x42d079,_0x47da1d){var _0x35b628={'raw':!![],'where':{'id':_0x42d079[_0x4d54('0x44')]['id']}},_0x2b8060={};_0x2b8060['model']=_[_0x4d54('0x45')](db[_0x4d54('0x2b')][_0x4d54('0x2c')]);_0x2b8060[_0x4d54('0x30')]=_[_0x4d54('0x45')](_0x42d079[_0x4d54('0x30')]);_0x2b8060['filters']=_[_0x4d54('0x31')](_0x2b8060[_0x4d54('0x33')],_0x2b8060['query']);_0x35b628[_0x4d54('0x32')]=_[_0x4d54('0x31')](_0x2b8060['model'],qs[_0x4d54('0x46')](_0x42d079[_0x4d54('0x30')][_0x4d54('0x46')]));_0x35b628[_0x4d54('0x32')]=_0x35b628[_0x4d54('0x32')]['length']?_0x35b628[_0x4d54('0x32')]:_0x2b8060[_0x4d54('0x33')];if(_0x42d079['query'][_0x4d54('0x3e')]){_0x35b628[_0x4d54('0x3f')]=[{'all':!![]}];}_0x35b628=_[_0x4d54('0x3c')]({},_0x35b628,_0x42d079[_0x4d54('0x3d')]);return db[_0x4d54('0x2b')][_0x4d54('0x47')](_0x35b628)[_0x4d54('0x23')](handleEntityNotFound(_0x47da1d,null))[_0x4d54('0x23')](respondWithResult(_0x47da1d,null))[_0x4d54('0x42')](handleError(_0x47da1d,null));};exports[_0x4d54('0x48')]=function(_0x51806f,_0x39d3be){return db[_0x4d54('0x2b')]['create'](_0x51806f[_0x4d54('0x49')],{})[_0x4d54('0x23')](respondWithResult(_0x39d3be,0xc9))[_0x4d54('0x42')](handleError(_0x39d3be,null));};exports[_0x4d54('0x4a')]=function(_0x4ce304,_0x4681ba){if(_0x4ce304[_0x4d54('0x49')]['id']){delete _0x4ce304['body']['id'];}return db[_0x4d54('0x2b')]['find']({'where':{'id':_0x4ce304[_0x4d54('0x44')]['id']}})[_0x4d54('0x23')](handleEntityNotFound(_0x4681ba,null))['then'](saveUpdates(_0x4ce304[_0x4d54('0x49')],null))['then'](respondWithResult(_0x4681ba,null))[_0x4d54('0x42')](handleError(_0x4681ba,null));};exports[_0x4d54('0x24')]=function(_0x3d71c4,_0x4f46c8){return db[_0x4d54('0x2b')][_0x4d54('0x47')]({'where':{'id':_0x3d71c4[_0x4d54('0x44')]['id']}})[_0x4d54('0x23')](handleEntityNotFound(_0x4f46c8,null))['then'](removeEntity(_0x4f46c8,null))[_0x4d54('0x42')](handleError(_0x4f46c8,null));};exports[_0x4d54('0x4b')]=function(_0x24fcea,_0x212c4e){return db['SmsTransferReport'][_0x4d54('0x4b')]()['then'](respondWithResult(_0x212c4e,null))['catch'](handleError(_0x212c4e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index e88ede7..2625c2d 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 _0x5262=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x16e5ab,_0x5530f5){var _0x4e7e2a=function(_0xa93e7b){while(--_0xa93e7b){_0x16e5ab['push'](_0x16e5ab['shift']());}};_0x4e7e2a(++_0x5530f5);}(_0x5262,0xc2));var _0x2526=function(_0x1757f2,_0x3dfdf7){_0x1757f2=_0x1757f2-0x0;var _0x3ac076=_0x5262[_0x1757f2];return _0x3ac076;};'use strict';var _=require(_0x2526('0x0'));var util=require(_0x2526('0x1'));var logger=require(_0x2526('0x2'))(_0x2526('0x3'));var moment=require('moment');var BPromise=require(_0x2526('0x4'));var rp=require(_0x2526('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2526('0x6'));var attributes=require(_0x2526('0x7'));module[_0x2526('0x8')]=function(_0x378e13,_0x53644f){return _0x378e13[_0x2526('0x9')](_0x2526('0xa'),attributes,{'tableName':_0x2526('0xb'),'paranoid':![],'indexes':[{'name':_0x2526('0xc'),'fields':[_0x2526('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d07=['api','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x1d0cba,_0x2731b1){var _0xdc3278=function(_0x3b20f5){while(--_0x3b20f5){_0x1d0cba['push'](_0x1d0cba['shift']());}};_0xdc3278(++_0x2731b1);}(_0x2d07,0x176));var _0x72d0=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x2d07[_0x4dcecc];return _0x2aa658;};'use strict';var _=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var logger=require(_0x72d0('0x2'))(_0x72d0('0x3'));var moment=require('moment');var BPromise=require(_0x72d0('0x4'));var rp=require(_0x72d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x72d0('0x6'));var attributes=require(_0x72d0('0x7'));module[_0x72d0('0x8')]=function(_0xc96d0f,_0x3712b5){return _0xc96d0f[_0x72d0('0x9')](_0x72d0('0xa'),attributes,{'tableName':_0x72d0('0xb'),'paranoid':![],'indexes':[{'name':_0x72d0('0xc'),'fields':[_0x72d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 946100c..fe743e2 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 _0xbf4e=['randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0xbf4e,0x172));var _0xebf4=function(_0x322258,_0xa01c42){_0x322258=_0x322258-0x0;var _0x570785=_0xbf4e[_0x322258];return _0x570785;};'use strict';var _=require(_0xebf4('0x0'));var util=require(_0xebf4('0x1'));var moment=require(_0xebf4('0x2'));var BPromise=require(_0xebf4('0x3'));var rs=require(_0xebf4('0x4'));var fs=require('fs');var Redis=require(_0xebf4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xebf4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xebf4('0x7'));var jayson=require(_0xebf4('0x8'));var client=jayson['client'][_0xebf4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x995254,_0x33ff2b,_0x48764f){return new BPromise(function(_0x2f17c0,_0xcfaf52){return client[_0xebf4('0xa')](_0x995254,_0x48764f)[_0xebf4('0xb')](function(_0x50df01){logger[_0xebf4('0xc')](_0xebf4('0xd'),_0x33ff2b,_0xebf4('0xe'));logger[_0xebf4('0xf')](_0xebf4('0x10'),_0x33ff2b,_0xebf4('0xe'),JSON[_0xebf4('0x11')](_0x50df01));if(_0x50df01[_0xebf4('0x12')]){if(_0x50df01[_0xebf4('0x12')]['code']===0x1f4){logger[_0xebf4('0x12')](_0xebf4('0xd'),_0x33ff2b,_0x50df01[_0xebf4('0x12')]['message']);return _0xcfaf52(_0x50df01['error'][_0xebf4('0x13')]);}logger[_0xebf4('0x12')](_0xebf4('0xd'),_0x33ff2b,_0x50df01[_0xebf4('0x12')][_0xebf4('0x13')]);return _0x2f17c0(_0x50df01[_0xebf4('0x12')][_0xebf4('0x13')]);}else{logger[_0xebf4('0xc')](_0xebf4('0xd'),_0x33ff2b,_0xebf4('0xe'));_0x2f17c0(_0x50df01[_0xebf4('0x14')][_0xebf4('0x13')]);}})[_0xebf4('0x15')](function(_0x2b0259){logger[_0xebf4('0x12')](_0xebf4('0xd'),_0x33ff2b,_0x2b0259);_0xcfaf52(_0x2b0259);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59d73b,_0xd8e780){var _0x3ae655=function(_0x157a57){while(--_0x157a57){_0x59d73b['push'](_0x59d73b['shift']());}};_0x3ae655(++_0xd8e780);}(_0xa41a,0x6b));var _0xaa41=function(_0x4f2121,_0x155ef2){_0x4f2121=_0x4f2121-0x0;var _0x2a7c41=_0xa41a[_0x4f2121];return _0x2a7c41;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 37cb383..7d9b841 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 _0x2095=['isAuthenticated','index','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','post','single','file','put','update','/:id','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2095,0x8d));var _0x5209=function(_0x2eea44,_0x264798){_0x2eea44=_0x2eea44-0x0;var _0x47aee5=_0x2095[_0x2eea44];return _0x47aee5;};'use strict';var multer=require(_0x5209('0x0'));var util=require(_0x5209('0x1'));var path=require('path');var timeout=require(_0x5209('0x2'));var express=require(_0x5209('0x3'));var router=express['Router']();var fs_extra=require(_0x5209('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5209('0x5'));var config=require(_0x5209('0x6'));var controller=require(_0x5209('0x7'));router[_0x5209('0x8')]('/',auth[_0x5209('0x9')](),controller[_0x5209('0xa')]);router[_0x5209('0x8')]('/:id',auth[_0x5209('0x9')](),controller[_0x5209('0xb')]);router[_0x5209('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x5209('0xc')]);var upload=multer({'storage':multer[_0x5209('0xd')]({'destination':function(_0x5be056,_0x5d4e1f,_0x55a2df){_0x55a2df(null,path[_0x5209('0xe')](config[_0x5209('0xf')],_0x5209('0x10')));},'filename':function(_0x47d733,_0x214eae,_0x34408e){_0x214eae[_0x5209('0x11')]=_0x214eae[_0x5209('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x34408e(null,util[_0x5209('0x12')](_0x5209('0x13'),path['basename'](_0x214eae[_0x5209('0x11')],path[_0x5209('0x14')](_0x214eae[_0x5209('0x11')])),Date[_0x5209('0x15')](),path[_0x5209('0x14')](_0x214eae[_0x5209('0x11')])));}})});router[_0x5209('0x16')]('/',upload[_0x5209('0x17')](_0x5209('0x18')),controller['create']);router[_0x5209('0x19')]('/:id',auth[_0x5209('0x9')](),controller[_0x5209('0x1a')]);router['delete'](_0x5209('0x1b'),auth[_0x5209('0x9')](),controller[_0x5209('0x1c')]);module[_0x5209('0x1d')]=router; \ No newline at end of file +var _0xe67f=['../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','root','originalname','replace','format','%s-%s%s','now','extname','post','file','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f1880,_0x3997df){var _0x5374b1=function(_0x4daf28){while(--_0x4daf28){_0x2f1880['push'](_0x2f1880['shift']());}};_0x5374b1(++_0x3997df);}(_0xe67f,0x1de));var _0xfe67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe67f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xfe67('0x0'));var util=require(_0xfe67('0x1'));var path=require(_0xfe67('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe67('0x3'));var router=express[_0xfe67('0x4')]();var fs_extra=require(_0xfe67('0x5'));var auth=require(_0xfe67('0x6'));var interaction=require(_0xfe67('0x7'));var config=require(_0xfe67('0x8'));var controller=require(_0xfe67('0x9'));router[_0xfe67('0xa')]('/',auth[_0xfe67('0xb')](),controller['index']);router[_0xfe67('0xa')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0xd')]);router['get'](_0xfe67('0xe'),auth[_0xfe67('0xb')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x93e461,_0x52cc38,_0x5b4ba3){_0x5b4ba3(null,path['join'](config[_0xfe67('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2eb325,_0x3ca085,_0x3b79c0){_0x3ca085[_0xfe67('0x10')]=_0x3ca085[_0xfe67('0x10')][_0xfe67('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b79c0(null,util[_0xfe67('0x12')](_0xfe67('0x13'),path['basename'](_0x3ca085[_0xfe67('0x10')],path['extname'](_0x3ca085[_0xfe67('0x10')])),Date[_0xfe67('0x14')](),path[_0xfe67('0x15')](_0x3ca085[_0xfe67('0x10')])));}})});router[_0xfe67('0x16')]('/',upload['single'](_0xfe67('0x17')),controller['create']);router[_0xfe67('0x18')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0x19')]);router[_0xfe67('0x1a')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0x1a')]);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 5ebd866..7d2a904 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 _0xd8f3=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x54c8f6,_0x53c007){var _0x13be65=function(_0x17780a){while(--_0x17780a){_0x54c8f6['push'](_0x54c8f6['shift']());}};_0x13be65(++_0x53c007);}(_0xd8f3,0xcb));var _0x3d8f=function(_0x5ad468,_0x4ad804){_0x5ad468=_0x5ad468-0x0;var _0x56f26b=_0xd8f3[_0x5ad468];return _0x56f26b;};'use strict';var Sequelize=require(_0x3d8f('0x0'));module[_0x3d8f('0x1')]={'name':{'type':Sequelize[_0x3d8f('0x2')],'unique':_0x3d8f('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x3d8f('0x2')]},'display_name':{'type':Sequelize[_0x3d8f('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x3d8f('0x2')]},'original_format':{'type':Sequelize[_0x3d8f('0x2')]},'original_duration':{'type':Sequelize[_0x3d8f('0x4')]},'original_sampleCount':{'type':Sequelize[_0x3d8f('0x5')]},'original_channelCount':{'type':Sequelize[_0x3d8f('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x3d8f('0x6')]},'converted_format':{'type':Sequelize[_0x3d8f('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x3d8f('0x5')]},'converted_channelCount':{'type':Sequelize[_0x3d8f('0x6')]},'converted_bitRate':{'type':Sequelize[_0x3d8f('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x3d8f('0x6')]}}; \ No newline at end of file +var _0x2f46=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x24c67d,_0x5c8eba){var _0x1c1d49=function(_0x16857f){while(--_0x16857f){_0x24c67d['push'](_0x24c67d['shift']());}};_0x1c1d49(++_0x5c8eba);}(_0x2f46,0xdd));var _0x62f4=function(_0x340a57,_0xa7d50f){_0x340a57=_0x340a57-0x0;var _0xbc5cb=_0x2f46[_0x340a57];return _0xbc5cb;};'use strict';var Sequelize=require(_0x62f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x62f4('0x1')],'unique':_0x62f4('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x62f4('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x62f4('0x1')]},'original_format':{'type':Sequelize[_0x62f4('0x1')]},'original_duration':{'type':Sequelize[_0x62f4('0x3')]},'original_sampleCount':{'type':Sequelize[_0x62f4('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x62f4('0x4')]},'original_sampleRate':{'type':Sequelize[_0x62f4('0x5')]},'converted_format':{'type':Sequelize[_0x62f4('0x1')]},'converted_duration':{'type':Sequelize[_0x62f4('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x62f4('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a8986fc..4539f63 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 _0x436e=['format','%s.%s','create','file','extname','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','get','UserProfileResource','destroy','then','error','stack','name','send','index','Sound','rawAttributes','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','params','save_name','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','download','join'];(function(_0x100f69,_0x5edd64){var _0x4a7fac=function(_0x53e10b){while(--_0x53e10b){_0x100f69['push'](_0x100f69['shift']());}};_0x4a7fac(++_0x5edd64);}(_0x436e,0xa7));var _0xe436=function(_0x1b0749,_0x1fed72){_0x1b0749=_0x1b0749-0x0;var _0x4167f2=_0x436e[_0x1b0749];return _0x4167f2;};'use strict';var emlformat=require(_0xe436('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe436('0x1'));var jsonpatch=require(_0xe436('0x2'));var rp=require(_0xe436('0x3'));var moment=require(_0xe436('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe436('0x5'));var util=require('util');var path=require(_0xe436('0x6'));var sox=require(_0xe436('0x7'));var csv=require(_0xe436('0x8'));var ejs=require(_0xe436('0x9'));var fs=require('fs');var fs_extra=require(_0xe436('0xa'));var _=require(_0xe436('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe436('0xc'));var toCsv=require(_0xe436('0x8'));var querystring=require(_0xe436('0xd'));var Papa=require(_0xe436('0xe'));var Redis=require('ioredis');var authService=require(_0xe436('0xf'));var qs=require(_0xe436('0x10'));var as=require(_0xe436('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe436('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe436('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe436('0x14'))['db'];function respondWithStatusCode(_0x56733d,_0xd54f0b){_0xd54f0b=_0xd54f0b||0xcc;return function(_0x42d80c){if(_0x42d80c){return _0x56733d[_0xe436('0x15')](_0xd54f0b);}return _0x56733d['status'](_0xd54f0b)[_0xe436('0x16')]();};}function respondWithResult(_0x589eca,_0x11470b){_0x11470b=_0x11470b||0xc8;return function(_0x22d10b){if(_0x22d10b){return _0x589eca[_0xe436('0x17')](_0x11470b)[_0xe436('0x18')](_0x22d10b);}};}function respondWithFilteredResult(_0x321a84,_0x158f91){return function(_0x4fb75d){if(_0x4fb75d){var _0x31a211=typeof _0x158f91[_0xe436('0x19')]===_0xe436('0x1a')&&typeof _0x158f91['limit']==='undefined';var _0x558a7b=_0x4fb75d[_0xe436('0x1b')];var _0x43d26e=_0x31a211?0x0:_0x158f91[_0xe436('0x19')];var _0x452e5a=_0x31a211?_0x4fb75d[_0xe436('0x1b')]:_0x158f91[_0xe436('0x19')]+_0x158f91[_0xe436('0x1c')];var _0x38c15d;if(_0x452e5a>=_0x558a7b){_0x452e5a=_0x558a7b;_0x38c15d=0xc8;}else{_0x38c15d=0xce;}_0x321a84[_0xe436('0x17')](_0x38c15d);return _0x321a84[_0xe436('0x1d')](_0xe436('0x1e'),_0x43d26e+'-'+_0x452e5a+'/'+_0x558a7b)[_0xe436('0x18')](_0x4fb75d);}return null;};}function patchUpdates(_0x559cce){return function(_0x4f85a1){try{jsonpatch[_0xe436('0x1f')](_0x4f85a1,_0x559cce,!![]);}catch(_0x44bd3c){return BPromise['reject'](_0x44bd3c);}return _0x4f85a1[_0xe436('0x20')]();};}function saveUpdates(_0x2888a9,_0x546896){return function(_0xae862d){if(_0xae862d){return _0xae862d[_0xe436('0x21')](_0x2888a9)['then'](function(_0x2b108){return _0x2b108;});}return null;};}function removeEntity(_0x38bdd3,_0xd2b701){return function(_0x39bf49){if(_0x39bf49){return _0x39bf49['destroy']()['then'](function(){var _0x29cac9=_0x39bf49[_0xe436('0x22')]({'plain':!![]});var _0x5e228a='Sounds';return db[_0xe436('0x23')][_0xe436('0x24')]({'where':{'type':_0x5e228a,'resourceId':_0x29cac9['id']}})[_0xe436('0x25')](function(){return _0x39bf49;});})[_0xe436('0x25')](function(){_0x38bdd3[_0xe436('0x17')](0xcc)[_0xe436('0x16')]();});}};}function handleEntityNotFound(_0x40dedd,_0x3557e5){return function(_0x47006e){if(!_0x47006e){_0x40dedd['sendStatus'](0x194);}return _0x47006e;};}function handleError(_0x137d2a,_0x10d5f2){_0x10d5f2=_0x10d5f2||0x1f4;return function(_0x25f89e){logger[_0xe436('0x26')](_0x25f89e[_0xe436('0x27')]);if(_0x25f89e['name']){delete _0x25f89e[_0xe436('0x28')];}_0x137d2a[_0xe436('0x17')](_0x10d5f2)[_0xe436('0x29')](_0x25f89e);};}exports[_0xe436('0x2a')]=function(_0x421d97,_0x980081){var _0x22554e={},_0x2157af={},_0x4698fa={'count':0x0,'rows':[]};var _0x5f149b=_['map'](db[_0xe436('0x2b')][_0xe436('0x2c')],function(_0x42cc57){return{'name':_0x42cc57['fieldName'],'type':_0x42cc57['type'][_0xe436('0x2d')]};});_0x2157af['model']=_['map'](_0x5f149b,_0xe436('0x28'));_0x2157af[_0xe436('0x2e')]=_[_0xe436('0x2f')](_0x421d97[_0xe436('0x2e')]);_0x2157af[_0xe436('0x30')]=_['intersection'](_0x2157af['model'],_0x2157af[_0xe436('0x2e')]);_0x22554e[_0xe436('0x31')]=_[_0xe436('0x32')](_0x2157af[_0xe436('0x33')],qs[_0xe436('0x34')](_0x421d97[_0xe436('0x2e')][_0xe436('0x34')]));_0x22554e[_0xe436('0x31')]=_0x22554e['attributes'][_0xe436('0x35')]?_0x22554e['attributes']:_0x2157af[_0xe436('0x33')];if(!_0x421d97[_0xe436('0x2e')][_0xe436('0x36')]('nolimit')){_0x22554e['limit']=qs[_0xe436('0x1c')](_0x421d97[_0xe436('0x2e')]['limit']);_0x22554e['offset']=qs[_0xe436('0x19')](_0x421d97[_0xe436('0x2e')][_0xe436('0x19')]);}_0x22554e[_0xe436('0x37')]=qs[_0xe436('0x38')](_0x421d97[_0xe436('0x2e')][_0xe436('0x38')]);_0x22554e[_0xe436('0x39')]=qs[_0xe436('0x30')](_['pick'](_0x421d97[_0xe436('0x2e')],_0x2157af[_0xe436('0x30')]),_0x5f149b);if(_0x421d97[_0xe436('0x2e')]['filter']){_0x22554e['where']=_[_0xe436('0x3a')](_0x22554e['where'],{'$or':_['map'](_0x5f149b,function(_0x216fcc){if(_0x216fcc['type']!==_0xe436('0x3b')){var _0x2dc591={};_0x2dc591[_0x216fcc[_0xe436('0x28')]]={'$like':'%'+_0x421d97['query'][_0xe436('0x3c')]+'%'};return _0x2dc591;}})});}_0x22554e=_[_0xe436('0x3a')]({},_0x22554e,_0x421d97[_0xe436('0x3d')]);var _0x6f8427={'where':_0x22554e['where']};return db['Sound']['count'](_0x6f8427)[_0xe436('0x25')](function(_0x42af93){_0x4698fa[_0xe436('0x1b')]=_0x42af93;if(_0x421d97[_0xe436('0x2e')][_0xe436('0x3e')]){_0x22554e[_0xe436('0x3f')]=[{'all':!![]}];}return db[_0xe436('0x2b')][_0xe436('0x40')](_0x22554e);})['then'](function(_0x25c97c){_0x4698fa[_0xe436('0x41')]=_0x25c97c;return _0x4698fa;})[_0xe436('0x25')](respondWithFilteredResult(_0x980081,_0x22554e))[_0xe436('0x42')](handleError(_0x980081,null));};exports[_0xe436('0x43')]=function(_0x21811c,_0x5a126f){var _0x5b72bc={'raw':!![],'where':{'id':_0x21811c['params']['id']}},_0x4762e6={};_0x4762e6[_0xe436('0x33')]=_[_0xe436('0x2f')](db[_0xe436('0x2b')][_0xe436('0x2c')]);_0x4762e6[_0xe436('0x2e')]=_['keys'](_0x21811c[_0xe436('0x2e')]);_0x4762e6[_0xe436('0x30')]=_[_0xe436('0x32')](_0x4762e6['model'],_0x4762e6['query']);_0x5b72bc[_0xe436('0x31')]=_[_0xe436('0x32')](_0x4762e6[_0xe436('0x33')],qs[_0xe436('0x34')](_0x21811c[_0xe436('0x2e')][_0xe436('0x34')]));_0x5b72bc['attributes']=_0x5b72bc['attributes'][_0xe436('0x35')]?_0x5b72bc[_0xe436('0x31')]:_0x4762e6[_0xe436('0x33')];if(_0x21811c['query'][_0xe436('0x3e')]){_0x5b72bc[_0xe436('0x3f')]=[{'all':!![]}];}_0x5b72bc=_[_0xe436('0x3a')]({},_0x5b72bc,_0x21811c[_0xe436('0x3d')]);return db[_0xe436('0x2b')][_0xe436('0x44')](_0x5b72bc)[_0xe436('0x25')](handleEntityNotFound(_0x5a126f,null))[_0xe436('0x25')](respondWithResult(_0x5a126f,null))[_0xe436('0x42')](handleError(_0x5a126f,null));};exports['download']=function(_0x2d266e,_0x30f8b0,_0x307731){return db[_0xe436('0x2b')][_0xe436('0x44')]({'where':{'id':_0x2d266e[_0xe436('0x45')]['id']},'attributes':[_0xe436('0x28'),_0xe436('0x46'),'converted_format'],'raw':!![]})[_0xe436('0x25')](handleEntityNotFound(_0x30f8b0,null))[_0xe436('0x25')](function(_0x45eddf){if(_0x45eddf){if(!fs['existsSync'](path['join'](config[_0xe436('0x47')],_0xe436('0x48'),_0x45eddf[_0xe436('0x46')]+'.'+_0x45eddf[_0xe436('0x49')]))){throw new db[(_0xe436('0x4a'))][(_0xe436('0x4b'))](_0xe436('0x4c'));}return _0x30f8b0[_0xe436('0x4d')](path[_0xe436('0x4e')](config[_0xe436('0x47')],_0xe436('0x48'),util[_0xe436('0x4f')]('%s.%s',_0x45eddf[_0xe436('0x46')],_0x45eddf[_0xe436('0x49')])),util[_0xe436('0x4f')](_0xe436('0x50'),_0x45eddf[_0xe436('0x28')],_0x45eddf['converted_format']));}return null;})[_0xe436('0x42')](handleError(_0x30f8b0,null));};exports[_0xe436('0x51')]=function(_0x1f5366,_0xf546b5,_0x5a70ba){var _0x25a8f4={'name':path['basename'](_0x1f5366[_0xe436('0x52')]['originalname'],path[_0xe436('0x53')](_0x1f5366[_0xe436('0x52')][_0xe436('0x54')])),'save_name':path['basename'](_0x1f5366[_0xe436('0x52')][_0xe436('0x55')],path[_0xe436('0x53')](_0x1f5366[_0xe436('0x52')][_0xe436('0x55')])),'original_format':path['extname'](_0x1f5366['file'][_0xe436('0x54')])[_0xe436('0x56')](0x1),'converted_format':'wav'};var _0x546271=path[_0xe436('0x4e')](config[_0xe436('0x47')],_0xe436('0x57'),_0x1f5366[_0xe436('0x52')][_0xe436('0x55')]);var _0x33f60e=path[_0xe436('0x4e')](config[_0xe436('0x47')],_0xe436('0x48'),util[_0xe436('0x4f')](_0xe436('0x50'),path['basename'](_0x1f5366[_0xe436('0x52')][_0xe436('0x55')],path['extname'](_0x1f5366['file'][_0xe436('0x55')])),_0x25a8f4['converted_format']));logger[_0xe436('0x58')](_0xe436('0x59'),_0x546271);logger['info'](_0xe436('0x5a'),_0x33f60e);try{fs['chmodSync'](_0x546271,parseInt(_0xe436('0x5b'),0x8));var _0x121a95=sox[_0xe436('0x5c')](_0x546271,_0x33f60e,{'sampleRate':0x1f40,'format':_0xe436('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x121a95['on'](_0xe436('0x26'),function(_0x1a8675){fs[_0xe436('0x5e')](_0x546271);_0xf546b5[_0xe436('0x17')](0x1f4)[_0xe436('0x29')](_0x1a8675);});_0x121a95['on']('src',function(_0x4a8140){_0x25a8f4[_0xe436('0x5f')]=isNaN(_0x4a8140[_0xe436('0x60')])?null:_0x4a8140['duration']*0x3e8;_0x25a8f4[_0xe436('0x61')]=isNaN(_0x4a8140[_0xe436('0x62')])?null:_0x4a8140[_0xe436('0x62')];_0x25a8f4['original_channelCount']=isNaN(_0x4a8140[_0xe436('0x63')])?null:_0x4a8140[_0xe436('0x63')];_0x25a8f4[_0xe436('0x64')]=isNaN(_0x4a8140[_0xe436('0x65')])?null:_0x4a8140[_0xe436('0x65')];_0x25a8f4[_0xe436('0x66')]=isNaN(_0x4a8140['sampleRate'])?null:_0x4a8140['sampleRate'];});_0x121a95['on'](_0xe436('0x67'),function(_0x518f5e){_0x25a8f4[_0xe436('0x68')]=isNaN(_0x518f5e[_0xe436('0x60')])?null:_0x518f5e[_0xe436('0x60')]*0x3e8;_0x25a8f4[_0xe436('0x69')]=isNaN(_0x518f5e[_0xe436('0x62')])?null:_0x518f5e[_0xe436('0x62')];_0x25a8f4['converted_channelCount']=isNaN(_0x518f5e[_0xe436('0x63')])?null:_0x518f5e[_0xe436('0x63')];_0x25a8f4[_0xe436('0x6a')]=isNaN(_0x518f5e[_0xe436('0x65')])?null:_0x518f5e['bitRate'];_0x25a8f4[_0xe436('0x6b')]=isNaN(_0x518f5e['sampleRate'])?null:_0x518f5e[_0xe436('0x6c')];});_0x121a95['on']('end',function(){fs[_0xe436('0x6d')](_0x33f60e,parseInt('0777',0x8));return db[_0xe436('0x2b')]['create'](_0x25a8f4)[_0xe436('0x25')](function(_0x192ac6){var _0x5e7a67={'role':_0x1f5366[_0xe436('0x6e')][_0xe436('0x6f')],'userProfileId':_0x1f5366[_0xe436('0x6e')][_0xe436('0x70')]};if(!_0x5e7a67)throw new Error(_0xe436('0x71'));if(_0x5e7a67[_0xe436('0x6f')]===_0xe436('0x72')){var _0x4c66f7=_0x192ac6['get']({'plain':!![]});return db[_0xe436('0x73')][_0xe436('0x44')]({'where':{'name':_0xe436('0x74'),'userProfileId':_0x5e7a67[_0xe436('0x70')]},'raw':!![]})[_0xe436('0x25')](function(_0x3c8ddf){if(_0x3c8ddf&&_0x3c8ddf[_0xe436('0x75')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c66f7[_0xe436('0x28')],'resourceId':_0x4c66f7['id'],'type':_0x3c8ddf[_0xe436('0x28')],'sectionId':_0x3c8ddf['id']},{})['then'](function(){return _0x192ac6;});}else{return _0x192ac6;}})[_0xe436('0x42')](function(_0xfb1c87){logger[_0xe436('0x26')](_0xe436('0x76'),_0xfb1c87);throw _0xfb1c87;});}return _0x192ac6;})[_0xe436('0x25')](respondWithResult(_0xf546b5,null))['catch'](handleError(_0xf546b5,null));});_0x121a95[_0xe436('0x77')]();}catch(_0x16dda5){_0xf546b5['status'](0x1f4)[_0xe436('0x29')](_0x16dda5);}};exports[_0xe436('0x21')]=function(_0x13ac15,_0x471c30,_0xb79561){return db['Sound']['find']({'where':{'id':_0x13ac15[_0xe436('0x45')]['id']}})[_0xe436('0x25')](handleEntityNotFound(_0x471c30,null))[_0xe436('0x25')](saveUpdates(_[_0xe436('0x78')](_0x13ac15['body'],[_0xe436('0x28'),_0xe436('0x79')]),null))[_0xe436('0x25')](respondWithResult(_0x471c30,null))[_0xe436('0x42')](handleError(_0x471c30,null));};exports['delete']=function(_0x263779,_0x5844d8,_0x250c29){return db[_0xe436('0x2b')]['find']({'where':{'id':_0x263779[_0xe436('0x45')]['id']}})[_0xe436('0x25')](function(_0x32514d){if(_0x32514d){return _0x32514d['destroy']();}})['then'](function(_0x15064a){var _0x482d7b=path['join'](config[_0xe436('0x47')],_0xe436('0x57'),util[_0xe436('0x4f')](_0xe436('0x50'),_0x15064a[_0xe436('0x46')],_0x15064a[_0xe436('0x7a')]));var _0x5a6421=path[_0xe436('0x4e')](config[_0xe436('0x47')],_0xe436('0x48'),util[_0xe436('0x4f')](_0xe436('0x50'),_0x15064a[_0xe436('0x46')],_0x15064a[_0xe436('0x49')]));fs['unlinkSync'](_0x482d7b);fs[_0xe436('0x5e')](_0x5a6421);return _0x15064a;})[_0xe436('0x25')](function(_0x1cb282){if(_0x1cb282){return _0x5844d8[_0xe436('0x17')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x5844d8,null))[_0xe436('0x42')](handleError(_0x5844d8,null));}; \ No newline at end of file +var _0x7cf8=['end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Sound','findAll','rows','catch','show','params','keys','includeAll','include','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','converted_sampleCount','converted_bitRate','converted_sampleRate','sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Sounds','autoAssociation','UserProfileResource','start','update','description','delete','original_format','rimraf','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x3c0c1,_0x1f6c00){var _0x2f9d3c=function(_0x4a8f8b){while(--_0x4a8f8b){_0x3c0c1['push'](_0x3c0c1['shift']());}};_0x2f9d3c(++_0x1f6c00);}(_0x7cf8,0xde));var _0x87cf=function(_0x46a8d2,_0x5c151c){_0x46a8d2=_0x46a8d2-0x0;var _0x5447ac=_0x7cf8[_0x46a8d2];return _0x5447ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87cf('0x1'));var util=require(_0x87cf('0x2'));var path=require(_0x87cf('0x3'));var sox=require(_0x87cf('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x87cf('0x5'));var _=require(_0x87cf('0x6'));var squel=require('squel');var crypto=require(_0x87cf('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x87cf('0x8'));var toCsv=require(_0x87cf('0x9'));var querystring=require(_0x87cf('0xa'));var Papa=require(_0x87cf('0xb'));var Redis=require(_0x87cf('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x87cf('0xd'));var as=require(_0x87cf('0xe'));var hardwareService=require(_0x87cf('0xf'));var logger=require(_0x87cf('0x10'))(_0x87cf('0x11'));var utils=require(_0x87cf('0x12'));var config=require(_0x87cf('0x13'));var licenseUtil=require(_0x87cf('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e3b72,_0xd60be6){_0xd60be6=_0xd60be6||0xcc;return function(_0x195d95){if(_0x195d95){return _0x3e3b72[_0x87cf('0x15')](_0xd60be6);}return _0x3e3b72['status'](_0xd60be6)[_0x87cf('0x16')]();};}function respondWithResult(_0x544a95,_0x39815d){_0x39815d=_0x39815d||0xc8;return function(_0x8c69c5){if(_0x8c69c5){return _0x544a95[_0x87cf('0x17')](_0x39815d)[_0x87cf('0x18')](_0x8c69c5);}};}function respondWithFilteredResult(_0x4f639b,_0x2fe6a3){return function(_0x1a960e){if(_0x1a960e){var _0x226831=typeof _0x2fe6a3[_0x87cf('0x19')]===_0x87cf('0x1a')&&typeof _0x2fe6a3[_0x87cf('0x1b')]==='undefined';var _0x31e7ef=_0x1a960e[_0x87cf('0x1c')];var _0x172267=_0x226831?0x0:_0x2fe6a3['offset'];var _0x440f1f=_0x226831?_0x1a960e[_0x87cf('0x1c')]:_0x2fe6a3[_0x87cf('0x19')]+_0x2fe6a3['limit'];var _0x12c09a;if(_0x440f1f>=_0x31e7ef){_0x440f1f=_0x31e7ef;_0x12c09a=0xc8;}else{_0x12c09a=0xce;}_0x4f639b[_0x87cf('0x17')](_0x12c09a);return _0x4f639b[_0x87cf('0x1d')](_0x87cf('0x1e'),_0x172267+'-'+_0x440f1f+'/'+_0x31e7ef)[_0x87cf('0x18')](_0x1a960e);}return null;};}function patchUpdates(_0xc324c6){return function(_0x8fecff){try{jsonpatch['apply'](_0x8fecff,_0xc324c6,!![]);}catch(_0x523390){return BPromise[_0x87cf('0x1f')](_0x523390);}return _0x8fecff[_0x87cf('0x20')]();};}function saveUpdates(_0x2ab371,_0x54d44d){return function(_0x4836f5){if(_0x4836f5){return _0x4836f5['update'](_0x2ab371)['then'](function(_0x4aeab4){return _0x4aeab4;});}return null;};}function removeEntity(_0x1d9cf3,_0x120600){return function(_0x1aa290){if(_0x1aa290){return _0x1aa290[_0x87cf('0x21')]()['then'](function(){var _0x14f2f9=_0x1aa290[_0x87cf('0x22')]({'plain':!![]});var _0x41f4f5='Sounds';return db['UserProfileResource']['destroy']({'where':{'type':_0x41f4f5,'resourceId':_0x14f2f9['id']}})[_0x87cf('0x23')](function(){return _0x1aa290;});})['then'](function(){_0x1d9cf3[_0x87cf('0x17')](0xcc)[_0x87cf('0x16')]();});}};}function handleEntityNotFound(_0x109069,_0x225023){return function(_0x10aec2){if(!_0x10aec2){_0x109069[_0x87cf('0x15')](0x194);}return _0x10aec2;};}function handleError(_0x570190,_0x5e5147){_0x5e5147=_0x5e5147||0x1f4;return function(_0x1a75eb){logger[_0x87cf('0x24')](_0x1a75eb[_0x87cf('0x25')]);if(_0x1a75eb[_0x87cf('0x26')]){delete _0x1a75eb['name'];}_0x570190[_0x87cf('0x17')](_0x5e5147)[_0x87cf('0x27')](_0x1a75eb);};}exports[_0x87cf('0x28')]=function(_0x37fa5a,_0x37bbf6){var _0x38abdc={},_0x34dfd5={},_0x3de636={'count':0x0,'rows':[]};var _0x180620=_[_0x87cf('0x29')](db['Sound'][_0x87cf('0x2a')],function(_0x1c2bf7){return{'name':_0x1c2bf7['fieldName'],'type':_0x1c2bf7[_0x87cf('0x2b')][_0x87cf('0x2c')]};});_0x34dfd5[_0x87cf('0x2d')]=_[_0x87cf('0x29')](_0x180620,_0x87cf('0x26'));_0x34dfd5[_0x87cf('0x2e')]=_['keys'](_0x37fa5a['query']);_0x34dfd5[_0x87cf('0x2f')]=_[_0x87cf('0x30')](_0x34dfd5[_0x87cf('0x2d')],_0x34dfd5[_0x87cf('0x2e')]);_0x38abdc[_0x87cf('0x31')]=_['intersection'](_0x34dfd5[_0x87cf('0x2d')],qs[_0x87cf('0x32')](_0x37fa5a[_0x87cf('0x2e')]['fields']));_0x38abdc[_0x87cf('0x31')]=_0x38abdc[_0x87cf('0x31')][_0x87cf('0x33')]?_0x38abdc[_0x87cf('0x31')]:_0x34dfd5[_0x87cf('0x2d')];if(!_0x37fa5a[_0x87cf('0x2e')][_0x87cf('0x34')](_0x87cf('0x35'))){_0x38abdc['limit']=qs[_0x87cf('0x1b')](_0x37fa5a['query'][_0x87cf('0x1b')]);_0x38abdc[_0x87cf('0x19')]=qs[_0x87cf('0x19')](_0x37fa5a[_0x87cf('0x2e')][_0x87cf('0x19')]);}_0x38abdc[_0x87cf('0x36')]=qs[_0x87cf('0x37')](_0x37fa5a['query'][_0x87cf('0x37')]);_0x38abdc[_0x87cf('0x38')]=qs[_0x87cf('0x2f')](_[_0x87cf('0x39')](_0x37fa5a['query'],_0x34dfd5['filters']),_0x180620);if(_0x37fa5a[_0x87cf('0x2e')]['filter']){_0x38abdc[_0x87cf('0x38')]=_[_0x87cf('0x3a')](_0x38abdc['where'],{'$or':_['map'](_0x180620,function(_0x3a5e33){if(_0x3a5e33[_0x87cf('0x2b')]!==_0x87cf('0x3b')){var _0x17b263={};_0x17b263[_0x3a5e33[_0x87cf('0x26')]]={'$like':'%'+_0x37fa5a[_0x87cf('0x2e')]['filter']+'%'};return _0x17b263;}})});}_0x38abdc=_[_0x87cf('0x3a')]({},_0x38abdc,_0x37fa5a[_0x87cf('0x3c')]);var _0x145ec9={'where':_0x38abdc['where']};return db['Sound'][_0x87cf('0x1c')](_0x145ec9)['then'](function(_0x3ed71f){_0x3de636['count']=_0x3ed71f;if(_0x37fa5a[_0x87cf('0x2e')]['includeAll']){_0x38abdc['include']=[{'all':!![]}];}return db[_0x87cf('0x3d')][_0x87cf('0x3e')](_0x38abdc);})[_0x87cf('0x23')](function(_0x3d2c7c){_0x3de636[_0x87cf('0x3f')]=_0x3d2c7c;return _0x3de636;})['then'](respondWithFilteredResult(_0x37bbf6,_0x38abdc))[_0x87cf('0x40')](handleError(_0x37bbf6,null));};exports[_0x87cf('0x41')]=function(_0x3ba239,_0x14aabd){var _0x124c34={'raw':!![],'where':{'id':_0x3ba239[_0x87cf('0x42')]['id']}},_0x48cff9={};_0x48cff9[_0x87cf('0x2d')]=_[_0x87cf('0x43')](db[_0x87cf('0x3d')][_0x87cf('0x2a')]);_0x48cff9[_0x87cf('0x2e')]=_[_0x87cf('0x43')](_0x3ba239[_0x87cf('0x2e')]);_0x48cff9[_0x87cf('0x2f')]=_[_0x87cf('0x30')](_0x48cff9[_0x87cf('0x2d')],_0x48cff9[_0x87cf('0x2e')]);_0x124c34[_0x87cf('0x31')]=_[_0x87cf('0x30')](_0x48cff9[_0x87cf('0x2d')],qs[_0x87cf('0x32')](_0x3ba239[_0x87cf('0x2e')][_0x87cf('0x32')]));_0x124c34['attributes']=_0x124c34[_0x87cf('0x31')][_0x87cf('0x33')]?_0x124c34[_0x87cf('0x31')]:_0x48cff9['model'];if(_0x3ba239['query'][_0x87cf('0x44')]){_0x124c34[_0x87cf('0x45')]=[{'all':!![]}];}_0x124c34=_[_0x87cf('0x3a')]({},_0x124c34,_0x3ba239[_0x87cf('0x3c')]);return db['Sound']['find'](_0x124c34)[_0x87cf('0x23')](handleEntityNotFound(_0x14aabd,null))[_0x87cf('0x23')](respondWithResult(_0x14aabd,null))['catch'](handleError(_0x14aabd,null));};exports[_0x87cf('0x46')]=function(_0x2977cb,_0x29f48b,_0x21407b){return db[_0x87cf('0x3d')]['find']({'where':{'id':_0x2977cb[_0x87cf('0x42')]['id']},'attributes':[_0x87cf('0x26'),_0x87cf('0x47'),_0x87cf('0x48')],'raw':!![]})[_0x87cf('0x23')](handleEntityNotFound(_0x29f48b,null))[_0x87cf('0x23')](function(_0x4f5f32){if(_0x4f5f32){if(!fs['existsSync'](path[_0x87cf('0x49')](config['root'],_0x87cf('0x4a'),_0x4f5f32[_0x87cf('0x47')]+'.'+_0x4f5f32[_0x87cf('0x48')]))){throw new db[(_0x87cf('0x4b'))]['ValidationError']('Sound\x20not\x20found');}return _0x29f48b[_0x87cf('0x46')](path[_0x87cf('0x49')](config[_0x87cf('0x4c')],_0x87cf('0x4a'),util[_0x87cf('0x4d')](_0x87cf('0x4e'),_0x4f5f32[_0x87cf('0x47')],_0x4f5f32['converted_format'])),util[_0x87cf('0x4d')](_0x87cf('0x4e'),_0x4f5f32[_0x87cf('0x26')],_0x4f5f32[_0x87cf('0x48')]));}return null;})['catch'](handleError(_0x29f48b,null));};exports[_0x87cf('0x4f')]=function(_0x1f0a94,_0x56c802,_0x5adb9e){var _0x207122={'name':path[_0x87cf('0x50')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x52')],path[_0x87cf('0x53')](_0x1f0a94['file'][_0x87cf('0x52')])),'save_name':path[_0x87cf('0x50')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x54')],path[_0x87cf('0x53')](_0x1f0a94['file'][_0x87cf('0x54')])),'original_format':path[_0x87cf('0x53')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x52')])[_0x87cf('0x55')](0x1),'converted_format':_0x87cf('0x56')};var _0xd738f9=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],_0x87cf('0x57'),_0x1f0a94[_0x87cf('0x51')]['filename']);var _0x4a5aac=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],'server/files/sounds/converted',util[_0x87cf('0x4d')](_0x87cf('0x4e'),path['basename'](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x54')],path[_0x87cf('0x53')](_0x1f0a94[_0x87cf('0x51')][_0x87cf('0x54')])),_0x207122[_0x87cf('0x48')]));logger[_0x87cf('0x58')](_0x87cf('0x59'),_0xd738f9);logger[_0x87cf('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x4a5aac);try{fs[_0x87cf('0x5a')](_0xd738f9,parseInt(_0x87cf('0x5b'),0x8));var _0xdb0842=sox[_0x87cf('0x5c')](_0xd738f9,_0x4a5aac,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xdb0842['on'](_0x87cf('0x24'),function(_0x5ae01e){fs[_0x87cf('0x5d')](_0xd738f9);_0x56c802[_0x87cf('0x17')](0x1f4)[_0x87cf('0x27')](_0x5ae01e);});_0xdb0842['on'](_0x87cf('0x5e'),function(_0x355f1c){_0x207122[_0x87cf('0x5f')]=isNaN(_0x355f1c[_0x87cf('0x60')])?null:_0x355f1c[_0x87cf('0x60')]*0x3e8;_0x207122[_0x87cf('0x61')]=isNaN(_0x355f1c['sampleCount'])?null:_0x355f1c[_0x87cf('0x62')];_0x207122[_0x87cf('0x63')]=isNaN(_0x355f1c['channelCount'])?null:_0x355f1c[_0x87cf('0x64')];_0x207122[_0x87cf('0x65')]=isNaN(_0x355f1c[_0x87cf('0x66')])?null:_0x355f1c[_0x87cf('0x66')];_0x207122[_0x87cf('0x67')]=isNaN(_0x355f1c['sampleRate'])?null:_0x355f1c['sampleRate'];});_0xdb0842['on']('dest',function(_0x4e7756){_0x207122['converted_duration']=isNaN(_0x4e7756[_0x87cf('0x60')])?null:_0x4e7756[_0x87cf('0x60')]*0x3e8;_0x207122[_0x87cf('0x68')]=isNaN(_0x4e7756[_0x87cf('0x62')])?null:_0x4e7756[_0x87cf('0x62')];_0x207122['converted_channelCount']=isNaN(_0x4e7756[_0x87cf('0x64')])?null:_0x4e7756[_0x87cf('0x64')];_0x207122[_0x87cf('0x69')]=isNaN(_0x4e7756[_0x87cf('0x66')])?null:_0x4e7756[_0x87cf('0x66')];_0x207122[_0x87cf('0x6a')]=isNaN(_0x4e7756[_0x87cf('0x6b')])?null:_0x4e7756[_0x87cf('0x6b')];});_0xdb0842['on'](_0x87cf('0x16'),function(){fs['chmodSync'](_0x4a5aac,parseInt('0777',0x8));return db[_0x87cf('0x3d')][_0x87cf('0x4f')](_0x207122)[_0x87cf('0x23')](function(_0x4d1062){var _0x54614f={'role':_0x1f0a94[_0x87cf('0x6c')][_0x87cf('0x6d')],'userProfileId':_0x1f0a94[_0x87cf('0x6c')][_0x87cf('0x6e')]};if(!_0x54614f)throw new Error(_0x87cf('0x6f'));if(_0x54614f[_0x87cf('0x6d')]==='user'){var _0x3690f2=_0x4d1062[_0x87cf('0x22')]({'plain':!![]});return db[_0x87cf('0x70')][_0x87cf('0x71')]({'where':{'name':_0x87cf('0x72'),'userProfileId':_0x54614f[_0x87cf('0x6e')]},'raw':!![]})[_0x87cf('0x23')](function(_0x44f28e){if(_0x44f28e&&_0x44f28e[_0x87cf('0x73')]===0x0){return db[_0x87cf('0x74')][_0x87cf('0x4f')]({'name':_0x3690f2[_0x87cf('0x26')],'resourceId':_0x3690f2['id'],'type':_0x44f28e[_0x87cf('0x26')],'sectionId':_0x44f28e['id']},{})[_0x87cf('0x23')](function(){return _0x4d1062;});}else{return _0x4d1062;}})[_0x87cf('0x40')](function(_0x248d61){logger[_0x87cf('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x248d61);throw _0x248d61;});}return _0x4d1062;})['then'](respondWithResult(_0x56c802,null))[_0x87cf('0x40')](handleError(_0x56c802,null));});_0xdb0842[_0x87cf('0x75')]();}catch(_0xb858c2){_0x56c802[_0x87cf('0x17')](0x1f4)[_0x87cf('0x27')](_0xb858c2);}};exports[_0x87cf('0x76')]=function(_0x15d15d,_0x598c1c,_0x1af3ff){return db[_0x87cf('0x3d')][_0x87cf('0x71')]({'where':{'id':_0x15d15d[_0x87cf('0x42')]['id']}})[_0x87cf('0x23')](handleEntityNotFound(_0x598c1c,null))['then'](saveUpdates(_[_0x87cf('0x39')](_0x15d15d[_0x87cf('0x6c')],[_0x87cf('0x26'),_0x87cf('0x77')]),null))[_0x87cf('0x23')](respondWithResult(_0x598c1c,null))[_0x87cf('0x40')](handleError(_0x598c1c,null));};exports[_0x87cf('0x78')]=function(_0x5119f7,_0x4dbd4b,_0x4e6d19){return db[_0x87cf('0x3d')]['find']({'where':{'id':_0x5119f7[_0x87cf('0x42')]['id']}})[_0x87cf('0x23')](function(_0x1a3d64){if(_0x1a3d64){return _0x1a3d64[_0x87cf('0x21')]();}})[_0x87cf('0x23')](function(_0x323041){var _0x287655=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],'server/files/sounds/original',util[_0x87cf('0x4d')]('%s.%s',_0x323041['save_name'],_0x323041[_0x87cf('0x79')]));var _0x4b7ef7=path[_0x87cf('0x49')](config[_0x87cf('0x4c')],_0x87cf('0x4a'),util[_0x87cf('0x4d')]('%s.%s',_0x323041['save_name'],_0x323041[_0x87cf('0x48')]));fs['unlinkSync'](_0x287655);fs[_0x87cf('0x5d')](_0x4b7ef7);return _0x323041;})[_0x87cf('0x23')](function(_0x5a61c4){if(_0x5a61c4){return _0x4dbd4b[_0x87cf('0x17')](0xcc)[_0x87cf('0x16')]();}})[_0x87cf('0x23')](handleEntityNotFound(_0x4dbd4b,null))['catch'](handleError(_0x4dbd4b,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 3d81ad3..c2ec4c8 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 _0x62f3=['define','tools_sounds','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./sound.attributes','exports'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x62f3,0x8e));var _0x362f=function(_0x2a03fd,_0x1b5aa1){_0x2a03fd=_0x2a03fd-0x0;var _0x289c0a=_0x62f3[_0x2a03fd];return _0x289c0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x362f('0x0'))(_0x362f('0x1'));var moment=require(_0x362f('0x2'));var BPromise=require(_0x362f('0x3'));var rp=require(_0x362f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x362f('0x5'));var attributes=require(_0x362f('0x6'));module[_0x362f('0x7')]=function(_0x9fa41d,_0x5552e7){return _0x9fa41d[_0x362f('0x8')]('Sound',attributes,{'tableName':_0x362f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2d0=['moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x2652ef,_0x234230){var _0x2db578=function(_0x56b137){while(--_0x56b137){_0x2652ef['push'](_0x2652ef['shift']());}};_0x2db578(++_0x234230);}(_0xe2d0,0x1d0));var _0x0e2d=function(_0x422a93,_0xcaa914){_0x422a93=_0x422a93-0x0;var _0xae0bdd=_0xe2d0[_0x422a93];return _0xae0bdd;};'use strict';var _=require(_0x0e2d('0x0'));var util=require(_0x0e2d('0x1'));var logger=require(_0x0e2d('0x2'))(_0x0e2d('0x3'));var moment=require(_0x0e2d('0x4'));var BPromise=require(_0x0e2d('0x5'));var rp=require(_0x0e2d('0x6'));var fs=require('fs');var path=require(_0x0e2d('0x7'));var rimraf=require(_0x0e2d('0x8'));var config=require('../../config/environment');var attributes=require(_0x0e2d('0x9'));module[_0x0e2d('0xa')]=function(_0x35c146,_0x420ab6){return _0x35c146[_0x0e2d('0xb')]('Sound',attributes,{'tableName':_0x0e2d('0xc'),'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 e9cb5a2..089d124 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 _0x6d82=['client','http','request','then','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ShowSound','find','options','raw','where','attributes','include','map','model','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x307eff,_0x2228ae){var _0x32bbd9=function(_0xb3652f){while(--_0xb3652f){_0x307eff['push'](_0x307eff['shift']());}};_0x32bbd9(++_0x2228ae);}(_0x6d82,0x158));var _0x26d8=function(_0xd8ad2e,_0xdddfe2){_0xd8ad2e=_0xd8ad2e-0x0;var _0x291e10=_0x6d82[_0xd8ad2e];return _0x291e10;};'use strict';var _=require(_0x26d8('0x0'));var util=require(_0x26d8('0x1'));var moment=require('moment');var BPromise=require(_0x26d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26d8('0x3'))['db'];var utils=require(_0x26d8('0x4'));var logger=require(_0x26d8('0x5'))(_0x26d8('0x6'));var config=require('../../config/environment');var jayson=require(_0x26d8('0x7'));var client=jayson[_0x26d8('0x8')][_0x26d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b297a,_0x482072,_0x467a8e){return new BPromise(function(_0x608e9b,_0x574939){return client[_0x26d8('0xa')](_0x5b297a,_0x467a8e)[_0x26d8('0xb')](function(_0x5c9308){logger['info'](_0x26d8('0xc'),_0x482072,'request\x20sent');logger[_0x26d8('0xd')](_0x26d8('0xe'),_0x482072,_0x26d8('0xf'),JSON[_0x26d8('0x10')](_0x5c9308));if(_0x5c9308[_0x26d8('0x11')]){if(_0x5c9308[_0x26d8('0x11')][_0x26d8('0x12')]===0x1f4){logger['error'](_0x26d8('0xc'),_0x482072,_0x5c9308[_0x26d8('0x11')][_0x26d8('0x13')]);return _0x574939(_0x5c9308[_0x26d8('0x11')][_0x26d8('0x13')]);}logger[_0x26d8('0x11')](_0x26d8('0xc'),_0x482072,_0x5c9308[_0x26d8('0x11')][_0x26d8('0x13')]);return _0x608e9b(_0x5c9308[_0x26d8('0x11')]['message']);}else{logger[_0x26d8('0x14')](_0x26d8('0xc'),_0x482072,_0x26d8('0xf'));_0x608e9b(_0x5c9308[_0x26d8('0x15')][_0x26d8('0x13')]);}})['catch'](function(_0x59df2b){logger['error'](_0x26d8('0xc'),_0x482072,_0x59df2b);_0x574939(_0x59df2b);});});}exports[_0x26d8('0x16')]=function(_0x9f2215){var _0x24b4ee=this;return new Promise(function(_0x20fca0,_0x3d5e24){return db['Sound'][_0x26d8('0x17')]({'raw':_0x9f2215['options']?_0x9f2215[_0x26d8('0x18')][_0x26d8('0x19')]===undefined?!![]:![]:!![],'where':_0x9f2215[_0x26d8('0x18')]?_0x9f2215[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null,'attributes':_0x9f2215['options']?_0x9f2215['options'][_0x26d8('0x1b')]||null:null,'include':_0x9f2215[_0x26d8('0x18')]?_0x9f2215[_0x26d8('0x18')][_0x26d8('0x1c')]?_[_0x26d8('0x1d')](_0x9f2215[_0x26d8('0x18')][_0x26d8('0x1c')],function(_0xf7dae6){return{'model':db[_0xf7dae6[_0x26d8('0x1e')]],'as':_0xf7dae6['as'],'attributes':_0xf7dae6['attributes'],'include':_0xf7dae6[_0x26d8('0x1c')]?_[_0x26d8('0x1d')](_0xf7dae6[_0x26d8('0x1c')],function(_0x1faf13){return{'model':db[_0x1faf13[_0x26d8('0x1e')]],'as':_0x1faf13['as'],'attributes':_0x1faf13[_0x26d8('0x1b')],'include':_0x1faf13[_0x26d8('0x1c')]?_[_0x26d8('0x1d')](_0x1faf13[_0x26d8('0x1c')],function(_0x45e806){return{'model':db[_0x45e806[_0x26d8('0x1e')]],'as':_0x45e806['as'],'attributes':_0x45e806['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28b68a){logger['info'](_0x26d8('0x16'),_0x9f2215);logger[_0x26d8('0xd')](_0x26d8('0x16'),_0x9f2215,JSON['stringify'](_0x28b68a));_0x20fca0(_0x28b68a);})[_0x26d8('0x1f')](function(_0x389933){logger[_0x26d8('0x11')]('ShowSound',_0x389933[_0x26d8('0x13')],_0x9f2215);_0x3d5e24(_0x24b4ee[_0x26d8('0x11')](0x1f4,_0x389933[_0x26d8('0x13')]));});});}; \ No newline at end of file +var _0x3de5=['info','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','find','options','raw','where','map','include','attributes','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0xf6bb7d,_0x8af4f5){var _0x132764=function(_0x4f6309){while(--_0x4f6309){_0xf6bb7d['push'](_0xf6bb7d['shift']());}};_0x132764(++_0x8af4f5);}(_0x3de5,0x102));var _0x53de=function(_0x221f37,_0x17904c){_0x221f37=_0x221f37-0x0;var _0x237985=_0x3de5[_0x221f37];return _0x237985;};'use strict';var _=require(_0x53de('0x0'));var util=require('util');var moment=require(_0x53de('0x1'));var BPromise=require(_0x53de('0x2'));var rs=require(_0x53de('0x3'));var fs=require('fs');var Redis=require(_0x53de('0x4'));var db=require(_0x53de('0x5'))['db'];var utils=require(_0x53de('0x6'));var logger=require(_0x53de('0x7'))(_0x53de('0x8'));var config=require('../../config/environment');var jayson=require(_0x53de('0x9'));var client=jayson['client'][_0x53de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3e9f,_0x1dbf1c,_0x5928dc){return new BPromise(function(_0x4e015c,_0xd5b1fc){return client['request'](_0x3e3e9f,_0x5928dc)[_0x53de('0xb')](function(_0x409c79){logger[_0x53de('0xc')]('Sound,\x20%s,\x20%s',_0x1dbf1c,'request\x20sent');logger['debug'](_0x53de('0xd'),_0x1dbf1c,_0x53de('0xe'),JSON[_0x53de('0xf')](_0x409c79));if(_0x409c79['error']){if(_0x409c79[_0x53de('0x10')][_0x53de('0x11')]===0x1f4){logger[_0x53de('0x10')](_0x53de('0x12'),_0x1dbf1c,_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);return _0xd5b1fc(_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);}logger[_0x53de('0x10')]('Sound,\x20%s,\x20%s',_0x1dbf1c,_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);return _0x4e015c(_0x409c79[_0x53de('0x10')][_0x53de('0x13')]);}else{logger[_0x53de('0xc')]('Sound,\x20%s,\x20%s',_0x1dbf1c,_0x53de('0xe'));_0x4e015c(_0x409c79[_0x53de('0x14')][_0x53de('0x13')]);}})['catch'](function(_0x57a681){logger['error'](_0x53de('0x12'),_0x1dbf1c,_0x57a681);_0xd5b1fc(_0x57a681);});});}exports[_0x53de('0x15')]=function(_0x11b552){var _0x2738e9=this;return new Promise(function(_0x73246,_0x80a900){return db['Sound'][_0x53de('0x16')]({'raw':_0x11b552[_0x53de('0x17')]?_0x11b552[_0x53de('0x17')][_0x53de('0x18')]===undefined?!![]:![]:!![],'where':_0x11b552[_0x53de('0x17')]?_0x11b552[_0x53de('0x17')][_0x53de('0x19')]||null:null,'attributes':_0x11b552[_0x53de('0x17')]?_0x11b552['options']['attributes']||null:null,'include':_0x11b552['options']?_0x11b552['options']['include']?_[_0x53de('0x1a')](_0x11b552[_0x53de('0x17')]['include'],function(_0x455fd9){return{'model':db[_0x455fd9['model']],'as':_0x455fd9['as'],'attributes':_0x455fd9['attributes'],'include':_0x455fd9['include']?_[_0x53de('0x1a')](_0x455fd9[_0x53de('0x1b')],function(_0x24b38e){return{'model':db[_0x24b38e['model']],'as':_0x24b38e['as'],'attributes':_0x24b38e['attributes'],'include':_0x24b38e[_0x53de('0x1b')]?_[_0x53de('0x1a')](_0x24b38e[_0x53de('0x1b')],function(_0x2c9e19){return{'model':db[_0x2c9e19['model']],'as':_0x2c9e19['as'],'attributes':_0x2c9e19[_0x53de('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53de('0xb')](function(_0x4b4fc7){logger[_0x53de('0xc')](_0x53de('0x15'),_0x11b552);logger['debug'](_0x53de('0x15'),_0x11b552,JSON[_0x53de('0xf')](_0x4b4fc7));_0x73246(_0x4b4fc7);})[_0x53de('0x1d')](function(_0x5ae57b){logger[_0x53de('0x10')]('ShowSound',_0x5ae57b['message'],_0x11b552);_0x80a900(_0x2738e9[_0x53de('0x10')](0x1f4,_0x5ae57b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 813a41d..31d05e5 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 _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x505606,_0x38ed25){var _0x3d2e1a=function(_0x2f26ca){while(--_0x2f26ca){_0x505606['push'](_0x505606['shift']());}};_0x3d2e1a(++_0x38ed25);}(_0xda2d,0x102));var _0xdda2=function(_0xc83f28,_0x49b450){_0xc83f28=_0xc83f28-0x0;var _0x2df326=_0xda2d[_0xc83f28];return _0x2df326;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x2674cf,_0x852a1){var _0x54a8b8=function(_0x57be6d){while(--_0x57be6d){_0x2674cf['push'](_0x2674cf['shift']());}};_0x54a8b8(++_0x852a1);}(_0x757a,0xde));var _0xa757=function(_0x502c23,_0x503750){_0x502c23=_0x502c23-0x0;var _0x548c94=_0x757a[_0x502c23];return _0x548c94;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 90bfe94..941d164 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 _0x8cce=['STRING','medium','ENUM','out','TEXT','sequelize','exports'];(function(_0x1f2592,_0x20c291){var _0x4c0d8a=function(_0x1abffa){while(--_0x1abffa){_0x1f2592['push'](_0x1f2592['shift']());}};_0x4c0d8a(++_0x20c291);}(_0x8cce,0xd0));var _0xe8cc=function(_0x46e8b4,_0x71f41f){_0x46e8b4=_0x46e8b4-0x0;var _0x1312aa=_0x8cce[_0x46e8b4];return _0x1312aa;};'use strict';var Sequelize=require(_0xe8cc('0x0'));module[_0xe8cc('0x1')]={'uniqueid':{'type':Sequelize[_0xe8cc('0x2')]},'body':{'type':Sequelize['TEXT'](_0xe8cc('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe8cc('0x4')]('in',_0xe8cc('0x5')),'defaultValue':_0xe8cc('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe8cc('0x2')]},'providerResponse':{'type':Sequelize[_0xe8cc('0x6')]}}; \ No newline at end of file +var _0xbbf9=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x497613,_0x2ded69){var _0xd0efe=function(_0xc0fbd1){while(--_0xc0fbd1){_0x497613['push'](_0x497613['shift']());}};_0xd0efe(++_0x2ded69);}(_0xbbf9,0x191));var _0x9bbf=function(_0x10dac7,_0x3ed996){_0x10dac7=_0x10dac7-0x0;var _0x1bffb6=_0xbbf9[_0x10dac7];return _0x1bffb6;};'use strict';var Sequelize=require(_0x9bbf('0x0'));module[_0x9bbf('0x1')]={'uniqueid':{'type':Sequelize[_0x9bbf('0x2')]},'body':{'type':Sequelize[_0x9bbf('0x3')](_0x9bbf('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x9bbf('0x5')]('in',_0x9bbf('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x9bbf('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 27d0efa..bbe6f95 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 _0x094f=['mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','map','SquareMessage','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x094f,0x80));var _0xf094=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x094f[_0x396466];return _0x5e9ab4;};'use strict';var emlformat=require(_0xf094('0x0'));var rimraf=require(_0xf094('0x1'));var zipdir=require(_0xf094('0x2'));var jsonpatch=require(_0xf094('0x3'));var rp=require('request-promise');var moment=require(_0xf094('0x4'));var BPromise=require(_0xf094('0x5'));var Mustache=require(_0xf094('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf094('0x7'));var csv=require(_0xf094('0x8'));var ejs=require(_0xf094('0x9'));var fs=require('fs');var fs_extra=require(_0xf094('0xa'));var _=require(_0xf094('0xb'));var squel=require(_0xf094('0xc'));var crypto=require(_0xf094('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf094('0xe'));var authService=require(_0xf094('0xf'));var qs=require(_0xf094('0x10'));var as=require(_0xf094('0x11'));var hardwareService=require(_0xf094('0x12'));var logger=require('../../config/logger')(_0xf094('0x13'));var utils=require(_0xf094('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41d385,_0x4d99bd){_0x4d99bd=_0x4d99bd||0xcc;return function(_0x583a23){if(_0x583a23){return _0x41d385['sendStatus'](_0x4d99bd);}return _0x41d385[_0xf094('0x15')](_0x4d99bd)['end']();};}function respondWithResult(_0x4b97cb,_0x32f64d){_0x32f64d=_0x32f64d||0xc8;return function(_0x29d688){if(_0x29d688){return _0x4b97cb[_0xf094('0x15')](_0x32f64d)[_0xf094('0x16')](_0x29d688);}};}function respondWithFilteredResult(_0x13471a,_0x187460){return function(_0x51f2af){if(_0x51f2af){var _0x47ecb1=typeof _0x187460[_0xf094('0x17')]===_0xf094('0x18')&&typeof _0x187460[_0xf094('0x19')]===_0xf094('0x18');var _0x2be8d0=_0x51f2af[_0xf094('0x1a')];var _0x584e99=_0x47ecb1?0x0:_0x187460[_0xf094('0x17')];var _0x45542d=_0x47ecb1?_0x51f2af[_0xf094('0x1a')]:_0x187460['offset']+_0x187460['limit'];var _0x5ec15d;if(_0x45542d>=_0x2be8d0){_0x45542d=_0x2be8d0;_0x5ec15d=0xc8;}else{_0x5ec15d=0xce;}_0x13471a['status'](_0x5ec15d);return _0x13471a[_0xf094('0x1b')](_0xf094('0x1c'),_0x584e99+'-'+_0x45542d+'/'+_0x2be8d0)[_0xf094('0x16')](_0x51f2af);}return null;};}function patchUpdates(_0x4e601d){return function(_0x109a0f){try{jsonpatch[_0xf094('0x1d')](_0x109a0f,_0x4e601d,!![]);}catch(_0x7b77b8){return BPromise[_0xf094('0x1e')](_0x7b77b8);}return _0x109a0f['save']();};}function saveUpdates(_0x3aff2f,_0x2db49d){return function(_0x5e9de5){if(_0x5e9de5){return _0x5e9de5[_0xf094('0x1f')](_0x3aff2f)['then'](function(_0x3a9fe3){return _0x3a9fe3;});}return null;};}function removeEntity(_0x4f74af,_0x2e0c75){return function(_0xbf4029){if(_0xbf4029){return _0xbf4029[_0xf094('0x20')]()[_0xf094('0x21')](function(){_0x4f74af[_0xf094('0x15')](0xcc)[_0xf094('0x22')]();});}};}function handleEntityNotFound(_0x51f7f4,_0x5f44ff){return function(_0xaf91fa){if(!_0xaf91fa){_0x51f7f4[_0xf094('0x23')](0x194);}return _0xaf91fa;};}function handleError(_0x5621d8,_0x14016c){_0x14016c=_0x14016c||0x1f4;return function(_0xc1ff00){logger[_0xf094('0x24')](_0xc1ff00[_0xf094('0x25')]);if(_0xc1ff00[_0xf094('0x26')]){delete _0xc1ff00['name'];}_0x5621d8[_0xf094('0x15')](_0x14016c)['send'](_0xc1ff00);};}exports['index']=function(_0xfef319,_0x32f5ca){var _0x211faa={},_0x112415={},_0x5537cf={'count':0x0,'rows':[]};var _0x4a7575=_[_0xf094('0x27')](db[_0xf094('0x28')][_0xf094('0x29')],function(_0xcc5640){return{'name':_0xcc5640['fieldName'],'type':_0xcc5640[_0xf094('0x2a')]['key']};});_0x112415['model']=_[_0xf094('0x27')](_0x4a7575,_0xf094('0x26'));_0x112415['query']=_[_0xf094('0x2b')](_0xfef319[_0xf094('0x2c')]);_0x112415[_0xf094('0x2d')]=_[_0xf094('0x2e')](_0x112415[_0xf094('0x2f')],_0x112415[_0xf094('0x2c')]);_0x211faa[_0xf094('0x30')]=_[_0xf094('0x2e')](_0x112415['model'],qs[_0xf094('0x31')](_0xfef319[_0xf094('0x2c')][_0xf094('0x31')]));_0x211faa[_0xf094('0x30')]=_0x211faa['attributes'][_0xf094('0x32')]?_0x211faa['attributes']:_0x112415['model'];if(!_0xfef319[_0xf094('0x2c')]['hasOwnProperty']('nolimit')){_0x211faa[_0xf094('0x19')]=qs[_0xf094('0x19')](_0xfef319[_0xf094('0x2c')][_0xf094('0x19')]);_0x211faa[_0xf094('0x17')]=qs[_0xf094('0x17')](_0xfef319[_0xf094('0x2c')][_0xf094('0x17')]);}_0x211faa[_0xf094('0x33')]=qs[_0xf094('0x34')](_0xfef319[_0xf094('0x2c')]['sort']);_0x211faa[_0xf094('0x35')]=qs[_0xf094('0x2d')](_[_0xf094('0x36')](_0xfef319[_0xf094('0x2c')],_0x112415[_0xf094('0x2d')]),_0x4a7575);if(_0xfef319[_0xf094('0x2c')][_0xf094('0x37')]){_0x211faa['where']=_[_0xf094('0x38')](_0x211faa[_0xf094('0x35')],{'$or':_[_0xf094('0x27')](_0x4a7575,function(_0x5320d6){if(_0x5320d6[_0xf094('0x2a')]!=='VIRTUAL'){var _0x281e56={};_0x281e56[_0x5320d6[_0xf094('0x26')]]={'$like':'%'+_0xfef319['query'][_0xf094('0x37')]+'%'};return _0x281e56;}})});}_0x211faa=_[_0xf094('0x38')]({},_0x211faa,_0xfef319[_0xf094('0x39')]);var _0x46c703={'where':_0x211faa[_0xf094('0x35')]};return db[_0xf094('0x28')][_0xf094('0x1a')](_0x46c703)[_0xf094('0x21')](function(_0xb92643){_0x5537cf['count']=_0xb92643;if(_0xfef319['query'][_0xf094('0x3a')]){_0x211faa[_0xf094('0x3b')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x211faa);})[_0xf094('0x21')](function(_0x306812){_0x5537cf[_0xf094('0x3c')]=_0x306812;return _0x5537cf;})['then'](respondWithFilteredResult(_0x32f5ca,_0x211faa))[_0xf094('0x3d')](handleError(_0x32f5ca,null));};exports[_0xf094('0x3e')]=function(_0x4da2b2,_0x1ce616){var _0x1090c2={'raw':!![],'where':{'id':_0x4da2b2[_0xf094('0x3f')]['id']}},_0x237b59={};_0x237b59[_0xf094('0x2f')]=_[_0xf094('0x2b')](db['SquareMessage']['rawAttributes']);_0x237b59[_0xf094('0x2c')]=_['keys'](_0x4da2b2['query']);_0x237b59[_0xf094('0x2d')]=_[_0xf094('0x2e')](_0x237b59[_0xf094('0x2f')],_0x237b59['query']);_0x1090c2['attributes']=_[_0xf094('0x2e')](_0x237b59[_0xf094('0x2f')],qs[_0xf094('0x31')](_0x4da2b2[_0xf094('0x2c')][_0xf094('0x31')]));_0x1090c2[_0xf094('0x30')]=_0x1090c2[_0xf094('0x30')]['length']?_0x1090c2[_0xf094('0x30')]:_0x237b59['model'];if(_0x4da2b2['query'][_0xf094('0x3a')]){_0x1090c2[_0xf094('0x3b')]=[{'all':!![]}];}_0x1090c2=_[_0xf094('0x38')]({},_0x1090c2,_0x4da2b2[_0xf094('0x39')]);return db[_0xf094('0x28')][_0xf094('0x40')](_0x1090c2)[_0xf094('0x21')](handleEntityNotFound(_0x1ce616,null))[_0xf094('0x21')](respondWithResult(_0x1ce616,null))['catch'](handleError(_0x1ce616,null));};exports[_0xf094('0x41')]=function(_0x33e906,_0x32370a){return db['SquareMessage']['create'](_0x33e906[_0xf094('0x42')],{})['then'](respondWithResult(_0x32370a,0xc9))[_0xf094('0x3d')](handleError(_0x32370a,null));};exports[_0xf094('0x1f')]=function(_0x30e70d,_0x1af84e){if(_0x30e70d[_0xf094('0x42')]['id']){delete _0x30e70d[_0xf094('0x42')]['id'];}return db[_0xf094('0x28')]['find']({'where':{'id':_0x30e70d[_0xf094('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1af84e,null))[_0xf094('0x21')](saveUpdates(_0x30e70d['body'],null))[_0xf094('0x21')](respondWithResult(_0x1af84e,null))[_0xf094('0x3d')](handleError(_0x1af84e,null));};exports[_0xf094('0x20')]=function(_0x431cc2,_0x451847){return db[_0xf094('0x28')]['find']({'where':{'id':_0x431cc2[_0xf094('0x3f')]['id']}})[_0xf094('0x21')](handleEntityNotFound(_0x451847,null))['then'](removeEntity(_0x451847,null))[_0xf094('0x3d')](handleError(_0x451847,null));}; \ No newline at end of file +var _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc2c7,0x134));var _0x7c2c=function(_0x12e428,_0x3ad891){_0x12e428=_0x12e428-0x0;var _0x564df9=_0xc2c7[_0x12e428];return _0x564df9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['SquareMessage'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 93ea1c0..4017fcc 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 _0xb670=['square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x3e2896,_0x1da662){var _0x4817fe=function(_0x5b12e2){while(--_0x5b12e2){_0x3e2896['push'](_0x3e2896['shift']());}};_0x4817fe(++_0x1da662);}(_0xb670,0x105));var _0x0b67=function(_0x2be8ef,_0x329f58){_0x2be8ef=_0x2be8ef-0x0;var _0x3e6c53=_0xb670[_0x2be8ef];return _0x3e6c53;};'use strict';var _=require(_0x0b67('0x0'));var util=require(_0x0b67('0x1'));var logger=require(_0x0b67('0x2'))(_0x0b67('0x3'));var moment=require(_0x0b67('0x4'));var BPromise=require(_0x0b67('0x5'));var rp=require(_0x0b67('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b67('0x7'));var config=require(_0x0b67('0x8'));var attributes=require(_0x0b67('0x9'));module[_0x0b67('0xa')]=function(_0x233374,_0x1bf5e0){return _0x233374[_0x0b67('0xb')]('SquareMessage',attributes,{'tableName':_0x0b67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42d4=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','square_messages','lodash','util'];(function(_0x2dd2a0,_0x5d3cec){var _0x28aa5c=function(_0x38fc21){while(--_0x38fc21){_0x2dd2a0['push'](_0x2dd2a0['shift']());}};_0x28aa5c(++_0x5d3cec);}(_0x42d4,0x10c));var _0x442d=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x42d4[_0x460150];return _0x340677;};'use strict';var _=require(_0x442d('0x0'));var util=require(_0x442d('0x1'));var logger=require(_0x442d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x442d('0x3'));var rp=require(_0x442d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x442d('0x5'));var config=require(_0x442d('0x6'));var attributes=require(_0x442d('0x7'));module['exports']=function(_0x4f2217,_0x5015d5){return _0x4f2217['define']('SquareMessage',attributes,{'tableName':_0x442d('0x8'),'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 8e792a9..9b05fc9 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 _0x0e9a=['SquareMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x0e9a,0x18d));var _0xa0e9=function(_0x44b0ad,_0x2a34c7){_0x44b0ad=_0x44b0ad-0x0;var _0x4fbe13=_0x0e9a[_0x44b0ad];return _0x4fbe13;};'use strict';var _=require(_0xa0e9('0x0'));var util=require('util');var moment=require(_0xa0e9('0x1'));var BPromise=require(_0xa0e9('0x2'));var rs=require(_0xa0e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0e9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0e9('0x5'))('rpc');var config=require(_0xa0e9('0x6'));var jayson=require(_0xa0e9('0x7'));var client=jayson[_0xa0e9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4015,_0xb593e9,_0x2b0689){return new BPromise(function(_0x4930f5,_0xd1d3fe){return client[_0xa0e9('0x9')](_0x1d4015,_0x2b0689)[_0xa0e9('0xa')](function(_0x28e841){logger[_0xa0e9('0xb')](_0xa0e9('0xc'),_0xb593e9,'request\x20sent');logger[_0xa0e9('0xd')](_0xa0e9('0xe'),_0xb593e9,_0xa0e9('0xf'),JSON[_0xa0e9('0x10')](_0x28e841));if(_0x28e841['error']){if(_0x28e841[_0xa0e9('0x11')][_0xa0e9('0x12')]===0x1f4){logger[_0xa0e9('0x11')](_0xa0e9('0xc'),_0xb593e9,_0x28e841['error']['message']);return _0xd1d3fe(_0x28e841[_0xa0e9('0x11')][_0xa0e9('0x13')]);}logger[_0xa0e9('0x11')](_0xa0e9('0xc'),_0xb593e9,_0x28e841['error'][_0xa0e9('0x13')]);return _0x4930f5(_0x28e841[_0xa0e9('0x11')]['message']);}else{logger[_0xa0e9('0xb')](_0xa0e9('0xc'),_0xb593e9,_0xa0e9('0xf'));_0x4930f5(_0x28e841[_0xa0e9('0x14')][_0xa0e9('0x13')]);}})[_0xa0e9('0x15')](function(_0x15e07c){logger['error'](_0xa0e9('0xc'),_0xb593e9,_0x15e07c);_0xd1d3fe(_0x15e07c);});});}exports[_0xa0e9('0x16')]=function(_0xb3cbd8){var _0x5bfb67=this;return new Promise(function(_0x3b099b,_0x19dc4e){return db[_0xa0e9('0x17')][_0xa0e9('0x18')](_0xb3cbd8[_0xa0e9('0x19')],{'raw':_0xb3cbd8[_0xa0e9('0x1a')]?_0xb3cbd8[_0xa0e9('0x1a')][_0xa0e9('0x1b')]===undefined?!![]:![]:!![]})[_0xa0e9('0xa')](function(_0x2dc1b7){logger[_0xa0e9('0xb')](_0xa0e9('0x16'),_0xb3cbd8);logger[_0xa0e9('0xd')](_0xa0e9('0x16'),_0xb3cbd8,JSON[_0xa0e9('0x10')](_0x2dc1b7));_0x3b099b(_0x2dc1b7);})['catch'](function(_0x2f1431){logger[_0xa0e9('0x11')]('CreateSquareMessage',_0x2f1431[_0xa0e9('0x13')],_0xb3cbd8);_0x19dc4e(_0x5bfb67['error'](0x1f4,_0x2f1431[_0xa0e9('0x13')]));});});}; \ No newline at end of file +var _0x94a0=['message','result','catch','create','body','options','CreateSquareMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x94a0,0x1c7));var _0x094a=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x94a0[_0x46efd7];return _0x5637e4;};'use strict';var _=require(_0x094a('0x0'));var util=require('util');var moment=require(_0x094a('0x1'));var BPromise=require(_0x094a('0x2'));var rs=require(_0x094a('0x3'));var fs=require('fs');var Redis=require(_0x094a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x094a('0x5'));var logger=require(_0x094a('0x6'))(_0x094a('0x7'));var config=require(_0x094a('0x8'));var jayson=require(_0x094a('0x9'));var client=jayson[_0x094a('0xa')][_0x094a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x426300,_0xd6393d,_0x7a0cbf){return new BPromise(function(_0x197f72,_0x35f758){return client[_0x094a('0xc')](_0x426300,_0x7a0cbf)[_0x094a('0xd')](function(_0x4c7443){logger[_0x094a('0xe')](_0x094a('0xf'),_0xd6393d,_0x094a('0x10'));logger[_0x094a('0x11')](_0x094a('0x12'),_0xd6393d,_0x094a('0x10'),JSON[_0x094a('0x13')](_0x4c7443));if(_0x4c7443[_0x094a('0x14')]){if(_0x4c7443[_0x094a('0x14')]['code']===0x1f4){logger[_0x094a('0x14')]('SquareMessage,\x20%s,\x20%s',_0xd6393d,_0x4c7443['error'][_0x094a('0x15')]);return _0x35f758(_0x4c7443[_0x094a('0x14')][_0x094a('0x15')]);}logger[_0x094a('0x14')]('SquareMessage,\x20%s,\x20%s',_0xd6393d,_0x4c7443[_0x094a('0x14')][_0x094a('0x15')]);return _0x197f72(_0x4c7443['error'][_0x094a('0x15')]);}else{logger[_0x094a('0xe')]('SquareMessage,\x20%s,\x20%s',_0xd6393d,_0x094a('0x10'));_0x197f72(_0x4c7443[_0x094a('0x16')][_0x094a('0x15')]);}})[_0x094a('0x17')](function(_0x28b8c8){logger[_0x094a('0x14')](_0x094a('0xf'),_0xd6393d,_0x28b8c8);_0x35f758(_0x28b8c8);});});}exports['CreateSquareMessage']=function(_0x54a040){var _0x38126f=this;return new Promise(function(_0x188074,_0x544f07){return db['SquareMessage'][_0x094a('0x18')](_0x54a040[_0x094a('0x19')],{'raw':_0x54a040[_0x094a('0x1a')]?_0x54a040[_0x094a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x094a('0xd')](function(_0x27e378){logger['info'](_0x094a('0x1b'),_0x54a040);logger[_0x094a('0x11')](_0x094a('0x1b'),_0x54a040,JSON[_0x094a('0x13')](_0x27e378));_0x188074(_0x27e378);})[_0x094a('0x17')](function(_0x509d61){logger['error']('CreateSquareMessage',_0x509d61[_0x094a('0x15')],_0x54a040);_0x544f07(_0x38126f[_0x094a('0x14')](0x1f4,_0x509d61[_0x094a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 093ad56..d317b54 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 _0x21e4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','15s','test','post','put','delete','destroy','multer','util','path'];(function(_0x4a514e,_0x29f11f){var _0x3e5708=function(_0x23e5b2){while(--_0x23e5b2){_0x4a514e['push'](_0x4a514e['shift']());}};_0x3e5708(++_0x29f11f);}(_0x21e4,0x95));var _0x421e=function(_0x3de42c,_0x18d028){_0x3de42c=_0x3de42c-0x0;var _0x46ec40=_0x21e4[_0x3de42c];return _0x46ec40;};'use strict';var multer=require(_0x421e('0x0'));var util=require(_0x421e('0x1'));var path=require(_0x421e('0x2'));var timeout=require(_0x421e('0x3'));var express=require(_0x421e('0x4'));var router=express[_0x421e('0x5')]();var fs_extra=require(_0x421e('0x6'));var auth=require(_0x421e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x421e('0x8'));var controller=require('./squareOdbc.controller');router[_0x421e('0x9')]('/',auth[_0x421e('0xa')](),controller['index']);router[_0x421e('0x9')](_0x421e('0xb'),auth[_0x421e('0xa')](),controller[_0x421e('0xc')]);router[_0x421e('0x9')]('/:id/test',auth[_0x421e('0xa')](),timeout(_0x421e('0xd')),controller[_0x421e('0xe')]);router[_0x421e('0xf')]('/',auth[_0x421e('0xa')](),controller['create']);router[_0x421e('0x10')](_0x421e('0xb'),auth[_0x421e('0xa')](),controller['update']);router[_0x421e('0x11')](_0x421e('0xb'),auth['isAuthenticated'](),controller[_0x421e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8082=['exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put','update','delete'];(function(_0x30abc0,_0x397817){var _0x2b34b1=function(_0x4d433a){while(--_0x4d433a){_0x30abc0['push'](_0x30abc0['shift']());}};_0x2b34b1(++_0x397817);}(_0x8082,0x65));var _0x2808=function(_0x4f9a2b,_0x3081a8){_0x4f9a2b=_0x4f9a2b-0x0;var _0x52f18f=_0x8082[_0x4f9a2b];return _0x52f18f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2808('0x0'));var timeout=require(_0x2808('0x1'));var express=require(_0x2808('0x2'));var router=express['Router']();var fs_extra=require(_0x2808('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2808('0x4'));var config=require(_0x2808('0x5'));var controller=require(_0x2808('0x6'));router[_0x2808('0x7')]('/',auth[_0x2808('0x8')](),controller[_0x2808('0x9')]);router[_0x2808('0x7')](_0x2808('0xa'),auth[_0x2808('0x8')](),controller[_0x2808('0xb')]);router[_0x2808('0x7')](_0x2808('0xc'),auth[_0x2808('0x8')](),timeout('15s'),controller[_0x2808('0xd')]);router[_0x2808('0xe')]('/',auth[_0x2808('0x8')](),controller[_0x2808('0xf')]);router[_0x2808('0x10')]('/:id',auth[_0x2808('0x8')](),controller[_0x2808('0x11')]);router[_0x2808('0x12')](_0x2808('0xa'),auth[_0x2808('0x8')](),controller['destroy']);module[_0x2808('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5e67613..707be09 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 _0x6a94=['name','sequelize','exports'];(function(_0x5b87ce,_0x20b7f6){var _0x597aa7=function(_0x295004){while(--_0x295004){_0x5b87ce['push'](_0x5b87ce['shift']());}};_0x597aa7(++_0x20b7f6);}(_0x6a94,0xd9));var _0x46a9=function(_0x36840b,_0x28131b){_0x36840b=_0x36840b-0x0;var _0x3713bd=_0x6a94[_0x36840b];return _0x3713bd;};'use strict';var Sequelize=require(_0x46a9('0x0'));module[_0x46a9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x46a9('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc347=['STRING','name','sequelize','exports'];(function(_0x36519a,_0x264ce2){var _0x43a91e=function(_0x320b05){while(--_0x320b05){_0x36519a['push'](_0x36519a['shift']());}};_0x43a91e(++_0x264ce2);}(_0xc347,0xce));var _0x7c34=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc347[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x7c34('0x0'));module[_0x7c34('0x1')]={'name':{'type':Sequelize[_0x7c34('0x2')],'unique':_0x7c34('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7c34('0x2')]},'description':{'type':Sequelize[_0x7c34('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 1ffd3c6..cd1b973 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 _0xcfbc=['intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','SquareOdbc','findAll','rows','catch','show','params','length','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','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','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','ODBC','error','send','index','map','rawAttributes','fieldName','type','model','query','keys'];(function(_0x20dba1,_0x726a24){var _0x47203d=function(_0x1cfb2d){while(--_0x1cfb2d){_0x20dba1['push'](_0x20dba1['shift']());}};_0x47203d(++_0x726a24);}(_0xcfbc,0x127));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xccfb('0x0'));var rimraf=require(_0xccfb('0x1'));var zipdir=require(_0xccfb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccfb('0x3'));var moment=require(_0xccfb('0x4'));var BPromise=require(_0xccfb('0x5'));var Mustache=require(_0xccfb('0x6'));var util=require(_0xccfb('0x7'));var path=require(_0xccfb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xccfb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xccfb('0xa'));var squel=require(_0xccfb('0xb'));var crypto=require(_0xccfb('0xc'));var jsforce=require(_0xccfb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xccfb('0xe'));var querystring=require(_0xccfb('0xf'));var Papa=require(_0xccfb('0x10'));var Redis=require(_0xccfb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xccfb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccfb('0x13'));var logger=require(_0xccfb('0x14'))(_0xccfb('0x15'));var utils=require(_0xccfb('0x16'));var config=require(_0xccfb('0x17'));var licenseUtil=require(_0xccfb('0x18'));var db=require(_0xccfb('0x19'))['db'];function respondWithStatusCode(_0x1d1112,_0x18e32c){_0x18e32c=_0x18e32c||0xcc;return function(_0x2437f9){if(_0x2437f9){return _0x1d1112[_0xccfb('0x1a')](_0x18e32c);}return _0x1d1112[_0xccfb('0x1b')](_0x18e32c)[_0xccfb('0x1c')]();};}function respondWithResult(_0xa06d41,_0x2c9c8e){_0x2c9c8e=_0x2c9c8e||0xc8;return function(_0x5f51d0){if(_0x5f51d0){return _0xa06d41[_0xccfb('0x1b')](_0x2c9c8e)[_0xccfb('0x1d')](_0x5f51d0);}};}function respondWithFilteredResult(_0x59a78f,_0x224f6c){return function(_0x993851){if(_0x993851){var _0x2decad=typeof _0x224f6c[_0xccfb('0x1e')]==='undefined'&&typeof _0x224f6c[_0xccfb('0x1f')]===_0xccfb('0x20');var _0x53151d=_0x993851['count'];var _0x394719=_0x2decad?0x0:_0x224f6c[_0xccfb('0x1e')];var _0x59afa5=_0x2decad?_0x993851[_0xccfb('0x21')]:_0x224f6c[_0xccfb('0x1e')]+_0x224f6c[_0xccfb('0x1f')];var _0x279178;if(_0x59afa5>=_0x53151d){_0x59afa5=_0x53151d;_0x279178=0xc8;}else{_0x279178=0xce;}_0x59a78f[_0xccfb('0x1b')](_0x279178);return _0x59a78f[_0xccfb('0x22')]('Content-Range',_0x394719+'-'+_0x59afa5+'/'+_0x53151d)[_0xccfb('0x1d')](_0x993851);}return null;};}function patchUpdates(_0x32941f){return function(_0x4ce47e){try{jsonpatch[_0xccfb('0x23')](_0x4ce47e,_0x32941f,!![]);}catch(_0x51205b){return BPromise[_0xccfb('0x24')](_0x51205b);}return _0x4ce47e[_0xccfb('0x25')]();};}function saveUpdates(_0x2deb66,_0x3d1a46){return function(_0x5bcb02){if(_0x5bcb02){return _0x5bcb02[_0xccfb('0x26')](_0x2deb66)[_0xccfb('0x27')](function(_0x2bcd83){return _0x2bcd83;});}return null;};}function removeEntity(_0x2f77f0,_0x2528b2){return function(_0x5be7c8){if(_0x5be7c8){return _0x5be7c8[_0xccfb('0x28')]()['then'](function(){var _0x274f99=_0x5be7c8[_0xccfb('0x29')]({'plain':!![]});var _0x573442=_0xccfb('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x573442,'resourceId':_0x274f99['id']}})[_0xccfb('0x27')](function(){return _0x5be7c8;});})['then'](function(){_0x2f77f0['status'](0xcc)[_0xccfb('0x1c')]();});}};}function handleEntityNotFound(_0x1e5e28,_0x4a300e){return function(_0x2b6271){if(!_0x2b6271){_0x1e5e28[_0xccfb('0x1a')](0x194);}return _0x2b6271;};}function handleError(_0x2f4f4f,_0x31c838){_0x31c838=_0x31c838||0x1f4;return function(_0x260e8a){logger[_0xccfb('0x2b')](_0x260e8a['stack']);if(_0x260e8a['name']){delete _0x260e8a['name'];}_0x2f4f4f[_0xccfb('0x1b')](_0x31c838)[_0xccfb('0x2c')](_0x260e8a);};}exports[_0xccfb('0x2d')]=function(_0x1f85a0,_0x1db625){var _0x2bbab8={},_0x59cf1f={},_0x3cd575={'count':0x0,'rows':[]};var _0x3ae588=_[_0xccfb('0x2e')](db['SquareOdbc'][_0xccfb('0x2f')],function(_0x4e289e){return{'name':_0x4e289e[_0xccfb('0x30')],'type':_0x4e289e[_0xccfb('0x31')]['key']};});_0x59cf1f[_0xccfb('0x32')]=_[_0xccfb('0x2e')](_0x3ae588,'name');_0x59cf1f[_0xccfb('0x33')]=_[_0xccfb('0x34')](_0x1f85a0[_0xccfb('0x33')]);_0x59cf1f['filters']=_[_0xccfb('0x35')](_0x59cf1f[_0xccfb('0x32')],_0x59cf1f[_0xccfb('0x33')]);_0x2bbab8['attributes']=_['intersection'](_0x59cf1f[_0xccfb('0x32')],qs[_0xccfb('0x36')](_0x1f85a0[_0xccfb('0x33')][_0xccfb('0x36')]));_0x2bbab8[_0xccfb('0x37')]=_0x2bbab8['attributes']['length']?_0x2bbab8[_0xccfb('0x37')]:_0x59cf1f[_0xccfb('0x32')];if(!_0x1f85a0['query'][_0xccfb('0x38')](_0xccfb('0x39'))){_0x2bbab8[_0xccfb('0x1f')]=qs[_0xccfb('0x1f')](_0x1f85a0['query'][_0xccfb('0x1f')]);_0x2bbab8[_0xccfb('0x1e')]=qs[_0xccfb('0x1e')](_0x1f85a0[_0xccfb('0x33')]['offset']);}_0x2bbab8[_0xccfb('0x3a')]=qs['sort'](_0x1f85a0['query']['sort']);_0x2bbab8[_0xccfb('0x3b')]=qs[_0xccfb('0x3c')](_[_0xccfb('0x3d')](_0x1f85a0[_0xccfb('0x33')],_0x59cf1f[_0xccfb('0x3c')]),_0x3ae588);if(_0x1f85a0[_0xccfb('0x33')][_0xccfb('0x3e')]){_0x2bbab8[_0xccfb('0x3b')]=_[_0xccfb('0x3f')](_0x2bbab8[_0xccfb('0x3b')],{'$or':_[_0xccfb('0x2e')](_0x3ae588,function(_0xa38dfd){if(_0xa38dfd[_0xccfb('0x31')]!==_0xccfb('0x40')){var _0x133d59={};_0x133d59[_0xa38dfd['name']]={'$like':'%'+_0x1f85a0[_0xccfb('0x33')]['filter']+'%'};return _0x133d59;}})});}_0x2bbab8=_['merge']({},_0x2bbab8,_0x1f85a0[_0xccfb('0x41')]);var _0x1b9f1f={'where':_0x2bbab8[_0xccfb('0x3b')]};return db[_0xccfb('0x42')][_0xccfb('0x21')](_0x1b9f1f)[_0xccfb('0x27')](function(_0x5a6e4d){_0x3cd575['count']=_0x5a6e4d;if(_0x1f85a0[_0xccfb('0x33')]['includeAll']){_0x2bbab8['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xccfb('0x43')](_0x2bbab8);})[_0xccfb('0x27')](function(_0x27b493){_0x3cd575[_0xccfb('0x44')]=_0x27b493;return _0x3cd575;})[_0xccfb('0x27')](respondWithFilteredResult(_0x1db625,_0x2bbab8))[_0xccfb('0x45')](handleError(_0x1db625,null));};exports[_0xccfb('0x46')]=function(_0x352314,_0x1a053c){var _0x5a6f94={'raw':!![],'where':{'id':_0x352314[_0xccfb('0x47')]['id']}},_0x2d9d18={};_0x2d9d18['model']=_[_0xccfb('0x34')](db[_0xccfb('0x42')][_0xccfb('0x2f')]);_0x2d9d18[_0xccfb('0x33')]=_[_0xccfb('0x34')](_0x352314[_0xccfb('0x33')]);_0x2d9d18[_0xccfb('0x3c')]=_[_0xccfb('0x35')](_0x2d9d18[_0xccfb('0x32')],_0x2d9d18[_0xccfb('0x33')]);_0x5a6f94[_0xccfb('0x37')]=_[_0xccfb('0x35')](_0x2d9d18['model'],qs[_0xccfb('0x36')](_0x352314[_0xccfb('0x33')][_0xccfb('0x36')]));_0x5a6f94['attributes']=_0x5a6f94[_0xccfb('0x37')][_0xccfb('0x48')]?_0x5a6f94[_0xccfb('0x37')]:_0x2d9d18[_0xccfb('0x32')];if(_0x352314[_0xccfb('0x33')]['includeAll']){_0x5a6f94[_0xccfb('0x49')]=[{'all':!![]}];}_0x5a6f94=_[_0xccfb('0x3f')]({},_0x5a6f94,_0x352314[_0xccfb('0x41')]);return db[_0xccfb('0x42')][_0xccfb('0x4a')](_0x5a6f94)['then'](handleEntityNotFound(_0x1a053c,null))[_0xccfb('0x27')](respondWithResult(_0x1a053c,null))[_0xccfb('0x45')](handleError(_0x1a053c,null));};exports['create']=function(_0x54f059,_0x186c36){return db[_0xccfb('0x42')][_0xccfb('0x4b')](_0x54f059[_0xccfb('0x4c')],{})[_0xccfb('0x27')](function(_0x3bd5f3){var _0x5ece70=_0x54f059[_0xccfb('0x4d')][_0xccfb('0x29')]({'plain':!![]});if(!_0x5ece70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ece70['role']===_0xccfb('0x4d')){var _0x4e291f=_0x3bd5f3[_0xccfb('0x29')]({'plain':!![]});var _0x17832a=_0xccfb('0x2a');return db[_0xccfb('0x4e')]['find']({'where':{'name':_0x17832a,'userProfileId':_0x5ece70[_0xccfb('0x4f')]},'raw':!![]})[_0xccfb('0x27')](function(_0x1719f2){if(_0x1719f2&&_0x1719f2[_0xccfb('0x50')]===0x0){return db['UserProfileResource'][_0xccfb('0x4b')]({'name':_0x4e291f[_0xccfb('0x51')],'resourceId':_0x4e291f['id'],'type':_0x1719f2[_0xccfb('0x51')],'sectionId':_0x1719f2['id']},{})[_0xccfb('0x27')](function(){return _0x3bd5f3;});}else{return _0x3bd5f3;}})[_0xccfb('0x45')](function(_0x5eaab0){logger[_0xccfb('0x2b')](_0xccfb('0x52'),_0x5eaab0);throw _0x5eaab0;});}return _0x3bd5f3;})[_0xccfb('0x27')](respondWithResult(_0x186c36,0xc9))[_0xccfb('0x45')](handleError(_0x186c36,null));};exports[_0xccfb('0x26')]=function(_0x4eccff,_0x3fd55c){if(_0x4eccff['body']['id']){delete _0x4eccff[_0xccfb('0x4c')]['id'];}return db[_0xccfb('0x42')][_0xccfb('0x4a')]({'where':{'id':_0x4eccff['params']['id']}})[_0xccfb('0x27')](handleEntityNotFound(_0x3fd55c,null))['then'](saveUpdates(_0x4eccff['body'],null))[_0xccfb('0x27')](respondWithResult(_0x3fd55c,null))[_0xccfb('0x45')](handleError(_0x3fd55c,null));};exports[_0xccfb('0x28')]=function(_0x1656c6,_0x497007){return db[_0xccfb('0x42')]['find']({'where':{'id':_0x1656c6[_0xccfb('0x47')]['id']}})[_0xccfb('0x27')](handleEntityNotFound(_0x497007,null))['then'](removeEntity(_0x497007,null))['catch'](handleError(_0x497007,null));};exports[_0xccfb('0x53')]=function(_0x27304a,_0x30ce4d,_0x11c67f){var _0x5981e3;return db[_0xccfb('0x42')][_0xccfb('0x4a')]({'where':{'id':_0x27304a[_0xccfb('0x47')]['id']},'attributes':['id',_0xccfb('0x54')]})['then'](handleEntityNotFound(_0x30ce4d,null))[_0xccfb('0x27')](function(_0x5cb89d){if(_0x5cb89d){var _0x51ab1f=require(_0xccfb('0x55'))();_0x51ab1f[_0xccfb('0x56')](_0x5cb89d[_0xccfb('0x54')]);_0x51ab1f['closeSync']();return _0x5cb89d;}})['then'](respondWithResult(_0x30ce4d,null))[_0xccfb('0x45')](handleError(_0x30ce4d,null));}; \ No newline at end of file +var _0xdd0e=['stack','name','send','map','SquareOdbc','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','ODBC','UserProfileResource','destroy','error'];(function(_0x172dfd,_0x869e62){var _0x248c26=function(_0x11c307){while(--_0x11c307){_0x172dfd['push'](_0x172dfd['shift']());}};_0x248c26(++_0x869e62);}(_0xdd0e,0x1d0));var _0xedd0=function(_0x59cba9,_0x1e8f27){_0x59cba9=_0x59cba9-0x0;var _0xae4206=_0xdd0e[_0x59cba9];return _0xae4206;};'use strict';var emlformat=require(_0xedd0('0x0'));var rimraf=require(_0xedd0('0x1'));var zipdir=require(_0xedd0('0x2'));var jsonpatch=require(_0xedd0('0x3'));var rp=require(_0xedd0('0x4'));var moment=require(_0xedd0('0x5'));var BPromise=require(_0xedd0('0x6'));var Mustache=require(_0xedd0('0x7'));var util=require(_0xedd0('0x8'));var path=require('path');var sox=require(_0xedd0('0x9'));var csv=require(_0xedd0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedd0('0xb'));var squel=require(_0xedd0('0xc'));var crypto=require(_0xedd0('0xd'));var jsforce=require(_0xedd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedd0('0xa'));var querystring=require(_0xedd0('0xf'));var Papa=require(_0xedd0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xedd0('0x11'));var hardwareService=require(_0xedd0('0x12'));var logger=require('../../config/logger')(_0xedd0('0x13'));var utils=require(_0xedd0('0x14'));var config=require(_0xedd0('0x15'));var licenseUtil=require(_0xedd0('0x16'));var db=require(_0xedd0('0x17'))['db'];function respondWithStatusCode(_0x20a293,_0x452ed4){_0x452ed4=_0x452ed4||0xcc;return function(_0x4e559d){if(_0x4e559d){return _0x20a293['sendStatus'](_0x452ed4);}return _0x20a293[_0xedd0('0x18')](_0x452ed4)[_0xedd0('0x19')]();};}function respondWithResult(_0x1ff09d,_0x4373bf){_0x4373bf=_0x4373bf||0xc8;return function(_0x951af8){if(_0x951af8){return _0x1ff09d[_0xedd0('0x18')](_0x4373bf)[_0xedd0('0x1a')](_0x951af8);}};}function respondWithFilteredResult(_0x2d240b,_0x3b3c94){return function(_0x52246d){if(_0x52246d){var _0x267eec=typeof _0x3b3c94[_0xedd0('0x1b')]===_0xedd0('0x1c')&&typeof _0x3b3c94[_0xedd0('0x1d')]==='undefined';var _0x24c878=_0x52246d[_0xedd0('0x1e')];var _0x41dc66=_0x267eec?0x0:_0x3b3c94[_0xedd0('0x1b')];var _0x4155b2=_0x267eec?_0x52246d['count']:_0x3b3c94[_0xedd0('0x1b')]+_0x3b3c94[_0xedd0('0x1d')];var _0x410344;if(_0x4155b2>=_0x24c878){_0x4155b2=_0x24c878;_0x410344=0xc8;}else{_0x410344=0xce;}_0x2d240b[_0xedd0('0x18')](_0x410344);return _0x2d240b[_0xedd0('0x1f')](_0xedd0('0x20'),_0x41dc66+'-'+_0x4155b2+'/'+_0x24c878)[_0xedd0('0x1a')](_0x52246d);}return null;};}function patchUpdates(_0x42df9a){return function(_0x3c2117){try{jsonpatch['apply'](_0x3c2117,_0x42df9a,!![]);}catch(_0x31a9c3){return BPromise[_0xedd0('0x21')](_0x31a9c3);}return _0x3c2117['save']();};}function saveUpdates(_0x581127,_0x55d6c9){return function(_0x159a93){if(_0x159a93){return _0x159a93['update'](_0x581127)[_0xedd0('0x22')](function(_0x53eb37){return _0x53eb37;});}return null;};}function removeEntity(_0x3d8768,_0x37dfdd){return function(_0x213f54){if(_0x213f54){return _0x213f54['destroy']()[_0xedd0('0x22')](function(){var _0x51111c=_0x213f54[_0xedd0('0x23')]({'plain':!![]});var _0x5768a5=_0xedd0('0x24');return db[_0xedd0('0x25')][_0xedd0('0x26')]({'where':{'type':_0x5768a5,'resourceId':_0x51111c['id']}})[_0xedd0('0x22')](function(){return _0x213f54;});})[_0xedd0('0x22')](function(){_0x3d8768['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x133351,_0x35a02b){return function(_0x4f2147){if(!_0x4f2147){_0x133351['sendStatus'](0x194);}return _0x4f2147;};}function handleError(_0x2e84c1,_0x1fca97){_0x1fca97=_0x1fca97||0x1f4;return function(_0x15a284){logger[_0xedd0('0x27')](_0x15a284[_0xedd0('0x28')]);if(_0x15a284['name']){delete _0x15a284[_0xedd0('0x29')];}_0x2e84c1[_0xedd0('0x18')](_0x1fca97)[_0xedd0('0x2a')](_0x15a284);};}exports['index']=function(_0xc33d61,_0x3a389f){var _0x3c362d={},_0x2926d3={},_0x2185f2={'count':0x0,'rows':[]};var _0x560c27=_[_0xedd0('0x2b')](db[_0xedd0('0x2c')]['rawAttributes'],function(_0x3eda58){return{'name':_0x3eda58[_0xedd0('0x2d')],'type':_0x3eda58[_0xedd0('0x2e')]['key']};});_0x2926d3[_0xedd0('0x2f')]=_[_0xedd0('0x2b')](_0x560c27,_0xedd0('0x29'));_0x2926d3[_0xedd0('0x30')]=_[_0xedd0('0x31')](_0xc33d61[_0xedd0('0x30')]);_0x2926d3[_0xedd0('0x32')]=_[_0xedd0('0x33')](_0x2926d3[_0xedd0('0x2f')],_0x2926d3[_0xedd0('0x30')]);_0x3c362d[_0xedd0('0x34')]=_['intersection'](_0x2926d3[_0xedd0('0x2f')],qs[_0xedd0('0x35')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x35')]));_0x3c362d['attributes']=_0x3c362d[_0xedd0('0x34')][_0xedd0('0x36')]?_0x3c362d['attributes']:_0x2926d3[_0xedd0('0x2f')];if(!_0xc33d61['query'][_0xedd0('0x37')](_0xedd0('0x38'))){_0x3c362d[_0xedd0('0x1d')]=qs[_0xedd0('0x1d')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x1d')]);_0x3c362d[_0xedd0('0x1b')]=qs[_0xedd0('0x1b')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x1b')]);}_0x3c362d['order']=qs['sort'](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x39')]);_0x3c362d[_0xedd0('0x3a')]=qs[_0xedd0('0x32')](_[_0xedd0('0x3b')](_0xc33d61[_0xedd0('0x30')],_0x2926d3[_0xedd0('0x32')]),_0x560c27);if(_0xc33d61[_0xedd0('0x30')]['filter']){_0x3c362d[_0xedd0('0x3a')]=_[_0xedd0('0x3c')](_0x3c362d[_0xedd0('0x3a')],{'$or':_['map'](_0x560c27,function(_0x3bc3a3){if(_0x3bc3a3[_0xedd0('0x2e')]!==_0xedd0('0x3d')){var _0x36d058={};_0x36d058[_0x3bc3a3['name']]={'$like':'%'+_0xc33d61['query']['filter']+'%'};return _0x36d058;}})});}_0x3c362d=_['merge']({},_0x3c362d,_0xc33d61[_0xedd0('0x3e')]);var _0x11262d={'where':_0x3c362d[_0xedd0('0x3a')]};return db[_0xedd0('0x2c')][_0xedd0('0x1e')](_0x11262d)[_0xedd0('0x22')](function(_0x2f5777){_0x2185f2[_0xedd0('0x1e')]=_0x2f5777;if(_0xc33d61['query'][_0xedd0('0x3f')]){_0x3c362d[_0xedd0('0x40')]=[{'all':!![]}];}return db[_0xedd0('0x2c')][_0xedd0('0x41')](_0x3c362d);})[_0xedd0('0x22')](function(_0x4d5764){_0x2185f2[_0xedd0('0x42')]=_0x4d5764;return _0x2185f2;})['then'](respondWithFilteredResult(_0x3a389f,_0x3c362d))[_0xedd0('0x43')](handleError(_0x3a389f,null));};exports['show']=function(_0x47b400,_0x2c6a25){var _0x56b408={'raw':!![],'where':{'id':_0x47b400[_0xedd0('0x44')]['id']}},_0x1a7d41={};_0x1a7d41['model']=_[_0xedd0('0x31')](db['SquareOdbc'][_0xedd0('0x45')]);_0x1a7d41[_0xedd0('0x30')]=_[_0xedd0('0x31')](_0x47b400[_0xedd0('0x30')]);_0x1a7d41[_0xedd0('0x32')]=_['intersection'](_0x1a7d41[_0xedd0('0x2f')],_0x1a7d41[_0xedd0('0x30')]);_0x56b408[_0xedd0('0x34')]=_[_0xedd0('0x33')](_0x1a7d41[_0xedd0('0x2f')],qs[_0xedd0('0x35')](_0x47b400['query']['fields']));_0x56b408[_0xedd0('0x34')]=_0x56b408[_0xedd0('0x34')][_0xedd0('0x36')]?_0x56b408[_0xedd0('0x34')]:_0x1a7d41[_0xedd0('0x2f')];if(_0x47b400['query']['includeAll']){_0x56b408[_0xedd0('0x40')]=[{'all':!![]}];}_0x56b408=_['merge']({},_0x56b408,_0x47b400[_0xedd0('0x3e')]);return db[_0xedd0('0x2c')][_0xedd0('0x46')](_0x56b408)[_0xedd0('0x22')](handleEntityNotFound(_0x2c6a25,null))['then'](respondWithResult(_0x2c6a25,null))[_0xedd0('0x43')](handleError(_0x2c6a25,null));};exports[_0xedd0('0x47')]=function(_0x4ad2e1,_0xcec4b6){return db[_0xedd0('0x2c')][_0xedd0('0x47')](_0x4ad2e1[_0xedd0('0x48')],{})[_0xedd0('0x22')](function(_0x3fc4aa){var _0x227083=_0x4ad2e1['user'][_0xedd0('0x23')]({'plain':!![]});if(!_0x227083)throw new Error(_0xedd0('0x49'));if(_0x227083[_0xedd0('0x4a')]==='user'){var _0x48b8cb=_0x3fc4aa[_0xedd0('0x23')]({'plain':!![]});var _0x315943=_0xedd0('0x24');return db[_0xedd0('0x4b')][_0xedd0('0x46')]({'where':{'name':_0x315943,'userProfileId':_0x227083[_0xedd0('0x4c')]},'raw':!![]})[_0xedd0('0x22')](function(_0x507ee8){if(_0x507ee8&&_0x507ee8[_0xedd0('0x4d')]===0x0){return db[_0xedd0('0x25')][_0xedd0('0x47')]({'name':_0x48b8cb[_0xedd0('0x29')],'resourceId':_0x48b8cb['id'],'type':_0x507ee8[_0xedd0('0x29')],'sectionId':_0x507ee8['id']},{})[_0xedd0('0x22')](function(){return _0x3fc4aa;});}else{return _0x3fc4aa;}})[_0xedd0('0x43')](function(_0x38a526){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38a526);throw _0x38a526;});}return _0x3fc4aa;})[_0xedd0('0x22')](respondWithResult(_0xcec4b6,0xc9))[_0xedd0('0x43')](handleError(_0xcec4b6,null));};exports[_0xedd0('0x4e')]=function(_0x1e5321,_0x4b3330){if(_0x1e5321[_0xedd0('0x48')]['id']){delete _0x1e5321['body']['id'];}return db[_0xedd0('0x2c')]['find']({'where':{'id':_0x1e5321[_0xedd0('0x44')]['id']}})[_0xedd0('0x22')](handleEntityNotFound(_0x4b3330,null))[_0xedd0('0x22')](saveUpdates(_0x1e5321[_0xedd0('0x48')],null))[_0xedd0('0x22')](respondWithResult(_0x4b3330,null))[_0xedd0('0x43')](handleError(_0x4b3330,null));};exports['destroy']=function(_0x2ec0c3,_0x3e0407){return db['SquareOdbc'][_0xedd0('0x46')]({'where':{'id':_0x2ec0c3[_0xedd0('0x44')]['id']}})[_0xedd0('0x22')](handleEntityNotFound(_0x3e0407,null))['then'](removeEntity(_0x3e0407,null))['catch'](handleError(_0x3e0407,null));};exports[_0xedd0('0x4f')]=function(_0x1fdfdc,_0x437b65,_0x4f6f97){var _0x4543f8;return db[_0xedd0('0x2c')][_0xedd0('0x46')]({'where':{'id':_0x1fdfdc[_0xedd0('0x44')]['id']},'attributes':['id',_0xedd0('0x50')]})['then'](handleEntityNotFound(_0x437b65,null))[_0xedd0('0x22')](function(_0x14028a){if(_0x14028a){var _0x2c8b75=require(_0xedd0('0x51'))();_0x2c8b75[_0xedd0('0x52')](_0x14028a['dsn']);_0x2c8b75[_0xedd0('0x53')]();return _0x14028a;}})[_0xedd0('0x22')](respondWithResult(_0x437b65,null))[_0xedd0('0x43')](handleError(_0x437b65,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 08af774..9af6f26 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 _0x6f40=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','api','moment'];(function(_0x188905,_0x398fac){var _0x2bf735=function(_0x228cf6){while(--_0x228cf6){_0x188905['push'](_0x188905['shift']());}};_0x2bf735(++_0x398fac);}(_0x6f40,0x10f));var _0x06f4=function(_0x415619,_0x337cb0){_0x415619=_0x415619-0x0;var _0x13f7c8=_0x6f40[_0x415619];return _0x13f7c8;};'use strict';var _=require(_0x06f4('0x0'));var util=require(_0x06f4('0x1'));var logger=require(_0x06f4('0x2'))(_0x06f4('0x3'));var moment=require(_0x06f4('0x4'));var BPromise=require('bluebird');var rp=require(_0x06f4('0x5'));var fs=require('fs');var path=require(_0x06f4('0x6'));var rimraf=require(_0x06f4('0x7'));var config=require(_0x06f4('0x8'));var attributes=require(_0x06f4('0x9'));module['exports']=function(_0x3bd676,_0x2925a1){return _0x3bd676[_0x06f4('0xa')]('SquareOdbc',attributes,{'tableName':_0x06f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc66=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0xdc66,0xcf));var _0x6dc6=function(_0x3e04c4,_0x48101b){_0x3e04c4=_0x3e04c4-0x0;var _0x543e0f=_0xdc66[_0x3e04c4];return _0x543e0f;};'use strict';var _=require(_0x6dc6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6dc6('0x1'));var moment=require(_0x6dc6('0x2'));var BPromise=require(_0x6dc6('0x3'));var rp=require(_0x6dc6('0x4'));var fs=require('fs');var path=require(_0x6dc6('0x5'));var rimraf=require(_0x6dc6('0x6'));var config=require(_0x6dc6('0x7'));var attributes=require(_0x6dc6('0x8'));module[_0x6dc6('0x9')]=function(_0x8b019e,_0x100f69){return _0x8b019e[_0x6dc6('0xa')](_0x6dc6('0xb'),attributes,{'tableName':_0x6dc6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 42d0b71..b5c0b00 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 _0x82c6=['options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','SquareOdbc,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','ShowSquareOdbc','SquareOdbc'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x82c6,0xd8));var _0x682c=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x82c6[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x682c('0x0'));var util=require(_0x682c('0x1'));var moment=require(_0x682c('0x2'));var BPromise=require(_0x682c('0x3'));var rs=require(_0x682c('0x4'));var fs=require('fs');var Redis=require(_0x682c('0x5'));var db=require(_0x682c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x682c('0x7'))(_0x682c('0x8'));var config=require('../../config/environment');var jayson=require(_0x682c('0x9'));var client=jayson[_0x682c('0xa')][_0x682c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d9d8e,_0x1b76da,_0x44aed1){return new BPromise(function(_0x14add6,_0x5b5646){return client['request'](_0x5d9d8e,_0x44aed1)[_0x682c('0xc')](function(_0x401e69){logger['info'](_0x682c('0xd'),_0x1b76da,'request\x20sent');logger[_0x682c('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1b76da,'request\x20sent',JSON['stringify'](_0x401e69));if(_0x401e69['error']){if(_0x401e69[_0x682c('0xf')][_0x682c('0x10')]===0x1f4){logger[_0x682c('0xf')](_0x682c('0xd'),_0x1b76da,_0x401e69[_0x682c('0xf')][_0x682c('0x11')]);return _0x5b5646(_0x401e69['error']['message']);}logger[_0x682c('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1b76da,_0x401e69[_0x682c('0xf')][_0x682c('0x11')]);return _0x14add6(_0x401e69[_0x682c('0xf')][_0x682c('0x11')]);}else{logger[_0x682c('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x1b76da,_0x682c('0x13'));_0x14add6(_0x401e69[_0x682c('0x14')][_0x682c('0x11')]);}})[_0x682c('0x15')](function(_0x560e3c){logger[_0x682c('0xf')](_0x682c('0xd'),_0x1b76da,_0x560e3c);_0x5b5646(_0x560e3c);});});}exports[_0x682c('0x16')]=function(_0xa9edd6){var _0x16d16a=this;return new Promise(function(_0x2d9542,_0x1ed65b){return db[_0x682c('0x17')]['find']({'raw':_0xa9edd6[_0x682c('0x18')]?_0xa9edd6[_0x682c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xa9edd6[_0x682c('0x18')]?_0xa9edd6[_0x682c('0x18')][_0x682c('0x19')]||null:null,'attributes':_0xa9edd6[_0x682c('0x18')]?_0xa9edd6[_0x682c('0x18')][_0x682c('0x1a')]||null:null,'include':_0xa9edd6[_0x682c('0x18')]?_0xa9edd6[_0x682c('0x18')][_0x682c('0x1b')]?_[_0x682c('0x1c')](_0xa9edd6['options'][_0x682c('0x1b')],function(_0x2d6fce){return{'model':db[_0x2d6fce[_0x682c('0x1d')]],'as':_0x2d6fce['as'],'attributes':_0x2d6fce[_0x682c('0x1a')],'include':_0x2d6fce[_0x682c('0x1b')]?_[_0x682c('0x1c')](_0x2d6fce[_0x682c('0x1b')],function(_0xed8604){return{'model':db[_0xed8604[_0x682c('0x1d')]],'as':_0xed8604['as'],'attributes':_0xed8604[_0x682c('0x1a')],'include':_0xed8604['include']?_[_0x682c('0x1c')](_0xed8604['include'],function(_0x505aec){return{'model':db[_0x505aec[_0x682c('0x1d')]],'as':_0x505aec['as'],'attributes':_0x505aec[_0x682c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x682c('0xc')](function(_0x2fcd52){logger[_0x682c('0x12')](_0x682c('0x16'),_0xa9edd6);logger[_0x682c('0xe')]('ShowSquareOdbc',_0xa9edd6,JSON['stringify'](_0x2fcd52));_0x2d9542(_0x2fcd52);})[_0x682c('0x15')](function(_0x3ae7bc){logger['error'](_0x682c('0x16'),_0x3ae7bc[_0x682c('0x11')],_0xa9edd6);_0x1ed65b(_0x16d16a['error'](0x1f4,_0x3ae7bc['message']));});});}; \ No newline at end of file +var _0xc9d2=['code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','raw','where','include','map','attributes','model','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x406cdb,_0xbb5ecb){var _0x3965a0=function(_0x503797){while(--_0x503797){_0x406cdb['push'](_0x406cdb['shift']());}};_0x3965a0(++_0xbb5ecb);}(_0xc9d2,0x1af));var _0x2c9d=function(_0xf77944,_0x3c31d2){_0xf77944=_0xf77944-0x0;var _0x386d6c=_0xc9d2[_0xf77944];return _0x386d6c;};'use strict';var _=require(_0x2c9d('0x0'));var util=require(_0x2c9d('0x1'));var moment=require(_0x2c9d('0x2'));var BPromise=require(_0x2c9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c9d('0x4'));var db=require(_0x2c9d('0x5'))['db'];var utils=require(_0x2c9d('0x6'));var logger=require(_0x2c9d('0x7'))(_0x2c9d('0x8'));var config=require('../../config/environment');var jayson=require(_0x2c9d('0x9'));var client=jayson[_0x2c9d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1864,_0x6f8fe1,_0x56be60){return new BPromise(function(_0x4fb204,_0x140bad){return client[_0x2c9d('0xb')](_0x5f1864,_0x56be60)['then'](function(_0x5befd0){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x2c9d('0xc'));logger[_0x2c9d('0xd')](_0x2c9d('0xe'),_0x6f8fe1,_0x2c9d('0xc'),JSON[_0x2c9d('0xf')](_0x5befd0));if(_0x5befd0[_0x2c9d('0x10')]){if(_0x5befd0[_0x2c9d('0x10')][_0x2c9d('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x5befd0['error'][_0x2c9d('0x12')]);return _0x140bad(_0x5befd0[_0x2c9d('0x10')]['message']);}logger[_0x2c9d('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x5befd0[_0x2c9d('0x10')]['message']);return _0x4fb204(_0x5befd0[_0x2c9d('0x10')]['message']);}else{logger['info'](_0x2c9d('0x13'),_0x6f8fe1,'request\x20sent');_0x4fb204(_0x5befd0[_0x2c9d('0x14')][_0x2c9d('0x12')]);}})[_0x2c9d('0x15')](function(_0x150e4e){logger[_0x2c9d('0x10')](_0x2c9d('0x13'),_0x6f8fe1,_0x150e4e);_0x140bad(_0x150e4e);});});}exports[_0x2c9d('0x16')]=function(_0x4d25dc){var _0x486cbb=this;return new Promise(function(_0x1c78b0,_0x3f5627){return db['SquareOdbc'][_0x2c9d('0x17')]({'raw':_0x4d25dc['options']?_0x4d25dc[_0x2c9d('0x18')][_0x2c9d('0x19')]===undefined?!![]:![]:!![],'where':_0x4d25dc['options']?_0x4d25dc['options'][_0x2c9d('0x1a')]||null:null,'attributes':_0x4d25dc[_0x2c9d('0x18')]?_0x4d25dc['options']['attributes']||null:null,'include':_0x4d25dc['options']?_0x4d25dc['options'][_0x2c9d('0x1b')]?_[_0x2c9d('0x1c')](_0x4d25dc['options'][_0x2c9d('0x1b')],function(_0x25c0e4){return{'model':db[_0x25c0e4['model']],'as':_0x25c0e4['as'],'attributes':_0x25c0e4[_0x2c9d('0x1d')],'include':_0x25c0e4['include']?_[_0x2c9d('0x1c')](_0x25c0e4[_0x2c9d('0x1b')],function(_0x4df7dc){return{'model':db[_0x4df7dc[_0x2c9d('0x1e')]],'as':_0x4df7dc['as'],'attributes':_0x4df7dc['attributes'],'include':_0x4df7dc[_0x2c9d('0x1b')]?_[_0x2c9d('0x1c')](_0x4df7dc['include'],function(_0x28a781){return{'model':db[_0x28a781[_0x2c9d('0x1e')]],'as':_0x28a781['as'],'attributes':_0x28a781[_0x2c9d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd801df){logger[_0x2c9d('0x1f')](_0x2c9d('0x16'),_0x4d25dc);logger['debug'](_0x2c9d('0x16'),_0x4d25dc,JSON[_0x2c9d('0xf')](_0xd801df));_0x1c78b0(_0xd801df);})[_0x2c9d('0x15')](function(_0x71bae6){logger['error'](_0x2c9d('0x16'),_0x71bae6[_0x2c9d('0x12')],_0x4d25dc);_0x3f5627(_0x486cbb[_0x2c9d('0x10')](0x1f4,_0x71bae6['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index fa41c27..258f158 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 _0xb86e=['index','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated'];(function(_0x31633c,_0x1f89fc){var _0x118eb7=function(_0x465d11){while(--_0x465d11){_0x31633c['push'](_0x31633c['shift']());}};_0x118eb7(++_0x1f89fc);}(_0xb86e,0x7b));var _0xeb86=function(_0x5a148f,_0x114dfa){_0x5a148f=_0x5a148f-0x0;var _0x5af2d4=_0xb86e[_0x5a148f];return _0x5af2d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeb86('0x0'));var timeout=require(_0xeb86('0x1'));var express=require(_0xeb86('0x2'));var router=express[_0xeb86('0x3')]();var fs_extra=require(_0xeb86('0x4'));var auth=require(_0xeb86('0x5'));var interaction=require(_0xeb86('0x6'));var config=require(_0xeb86('0x7'));var controller=require(_0xeb86('0x8'));router['get']('/',auth[_0xeb86('0x9')](),controller[_0xeb86('0xa')]);router['get']('/:id',auth[_0xeb86('0x9')](),controller[_0xeb86('0xb')]);router[_0xeb86('0xc')]('/',auth[_0xeb86('0x9')](),controller[_0xeb86('0xd')]);router[_0xeb86('0xe')](_0xeb86('0xf'),auth[_0xeb86('0x9')](),controller[_0xeb86('0x10')]);router['delete'](_0xeb86('0xf'),auth[_0xeb86('0x9')](),controller[_0xeb86('0x11')]);module[_0xeb86('0x12')]=router; \ No newline at end of file +var _0x168d=['/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','post','create','put'];(function(_0x5280f4,_0x3c36d0){var _0xba93e7=function(_0x14d63a){while(--_0x14d63a){_0x5280f4['push'](_0x5280f4['shift']());}};_0xba93e7(++_0x3c36d0);}(_0x168d,0x82));var _0xd168=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x168d[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xd168('0x0'));var path=require(_0xd168('0x1'));var timeout=require('connect-timeout');var express=require(_0xd168('0x2'));var router=express[_0xd168('0x3')]();var fs_extra=require(_0xd168('0x4'));var auth=require(_0xd168('0x5'));var interaction=require(_0xd168('0x6'));var config=require('../../config/environment');var controller=require(_0xd168('0x7'));router[_0xd168('0x8')]('/',auth[_0xd168('0x9')](),controller[_0xd168('0xa')]);router[_0xd168('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd168('0xb')]('/',auth[_0xd168('0x9')](),controller[_0xd168('0xc')]);router[_0xd168('0xd')](_0xd168('0xe'),auth[_0xd168('0x9')](),controller[_0xd168('0xf')]);router[_0xd168('0x10')]('/:id',auth[_0xd168('0x9')](),controller[_0xd168('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index aa70bd5..8f7a0d0 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 _0x71d5=['DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x71d5,0x109));var _0x571d=function(_0x3b5794,_0x254fa1){_0x3b5794=_0x3b5794-0x0;var _0x5ac592=_0x71d5[_0x3b5794];return _0x5ac592;};'use strict';var Sequelize=require(_0x571d('0x0'));module[_0x571d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x571d('0x2')]},'notes':{'type':Sequelize[_0x571d('0x3')]},'preproduction':{'type':Sequelize[_0x571d('0x4')](_0x571d('0x5')),'get':function(){if(this[_0x571d('0x6')](_0x571d('0x7'))){return this[_0x571d('0x6')](_0x571d('0x7'))[_0x571d('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x571d('0x4')](_0x571d('0x5')),'get':function(){if(this[_0x571d('0x6')](_0x571d('0x9'))){return this[_0x571d('0x6')](_0x571d('0x9'))[_0x571d('0x8')](_0x571d('0xa'));}}},'savedAt':{'type':Sequelize[_0x571d('0xb')]},'publishedAt':{'type':Sequelize[_0x571d('0xb')]}}; \ No newline at end of file +var _0xaf55=['exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xaf55,0x1e0));var _0x5af5=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xaf55[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0x5af5('0x0'));module[_0x5af5('0x1')]={'name':{'type':Sequelize[_0x5af5('0x2')],'unique':_0x5af5('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5af5('0x2')]},'notes':{'type':Sequelize[_0x5af5('0x4')]},'preproduction':{'type':Sequelize[_0x5af5('0x5')](_0x5af5('0x6')),'get':function(){if(this[_0x5af5('0x7')](_0x5af5('0x8'))){return this[_0x5af5('0x7')](_0x5af5('0x8'))[_0x5af5('0x9')](_0x5af5('0xa'));}}},'production':{'type':Sequelize[_0x5af5('0x5')](_0x5af5('0x6')),'get':function(){if(this[_0x5af5('0x7')](_0x5af5('0xb'))){return this[_0x5af5('0x7')](_0x5af5('0xb'))['toString'](_0x5af5('0xa'));}}},'savedAt':{'type':Sequelize[_0x5af5('0xc')]},'publishedAt':{'type':Sequelize[_0x5af5('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ccbcef4..ca6bb94 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 _0x529c=['intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','params','agi','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./squareProject.socket','status','json','undefined','count','offset','limit','Content-Range','destroy','then','SquareProjects','UserProfileResource','publish','stringify','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x25ab55,_0x3c2d1d){var _0x4e2d65=function(_0x2bb417){while(--_0x2bb417){_0x25ab55['push'](_0x25ab55['shift']());}};_0x4e2d65(++_0x3c2d1d);}(_0x529c,0x170));var _0xc529=function(_0x35640b,_0x252d0a){_0x35640b=_0x35640b-0x0;var _0x1df2ab=_0x529c[_0x35640b];return _0x1df2ab;};'use strict';var _=require(_0xc529('0x0'));var Redis=require(_0xc529('0x1'));var qs=require(_0xc529('0x2'));var logger=require(_0xc529('0x3'))(_0xc529('0x4'));var config=require(_0xc529('0x5'));var db=require(_0xc529('0x6'))['db'];config['redis']=_[_0xc529('0x7')](config[_0xc529('0x8')],{'host':_0xc529('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc529('0x8')]));require(_0xc529('0xa'))['register'](socket);function respondWithResult(_0x5eaaa7,_0x347f28){_0x347f28=_0x347f28||0xc8;return function(_0x4a1445){if(_0x4a1445){return _0x5eaaa7[_0xc529('0xb')](_0x347f28)[_0xc529('0xc')](_0x4a1445);}};}function respondWithFilteredResult(_0x1862a1,_0x13e228){return function(_0x269665){if(_0x269665){var _0x1aa7f3=typeof _0x13e228['offset']===_0xc529('0xd')&&typeof _0x13e228['limit']===_0xc529('0xd');var _0x231dc7=_0x269665[_0xc529('0xe')];var _0x5a03b2=_0x1aa7f3?0x0:_0x13e228[_0xc529('0xf')];var _0x3d2e89=_0x1aa7f3?_0x269665[_0xc529('0xe')]:_0x13e228[_0xc529('0xf')]+_0x13e228[_0xc529('0x10')];var _0x1e3f4f;if(_0x3d2e89>=_0x231dc7){_0x3d2e89=_0x231dc7;_0x1e3f4f=0xc8;}else{_0x1e3f4f=0xce;}_0x1862a1['status'](_0x1e3f4f);return _0x1862a1['set'](_0xc529('0x11'),_0x5a03b2+'-'+_0x3d2e89+'/'+_0x231dc7)['json'](_0x269665);}return null;};}function saveUpdates(_0x29613a){return function(_0x2c45f1){if(_0x2c45f1){return _0x2c45f1['update'](_0x29613a)['then'](function(_0x572eb4){return _0x572eb4;});}return null;};}function removeEntity(_0x526697){return function(_0x386943){if(_0x386943){return _0x386943[_0xc529('0x12')]()[_0xc529('0x13')](function(){var _0x46bb73=_0x386943['get']({'plain':!![]});var _0x280e94=_0xc529('0x14');return db[_0xc529('0x15')]['destroy']({'where':{'type':_0x280e94,'resourceId':_0x46bb73['id']}})['then'](function(){return _0x386943;});})[_0xc529('0x13')](function(){var _0x1a7f83=new Redis(config[_0xc529('0x8')]);_0x1a7f83[_0xc529('0x16')]('agi',JSON[_0xc529('0x17')]({'id':_0x386943['id'],'deleted':!![]}));})[_0xc529('0x13')](function(){_0x526697[_0xc529('0xb')](0xcc)[_0xc529('0x18')]();});}};}function handleEntityNotFound(_0x17e206){return function(_0x5c32fc){if(!_0x5c32fc){_0x17e206[_0xc529('0x19')](0x194);}return _0x5c32fc;};}function handleError(_0x519b62,_0x553eea){_0x553eea=_0x553eea||0x1f4;return function(_0x1a4e03){logger[_0xc529('0x1a')](_0x1a4e03[_0xc529('0x1b')]);if(_0x1a4e03[_0xc529('0x1c')]){delete _0x1a4e03['name'];}_0x519b62[_0xc529('0xb')](_0x553eea)[_0xc529('0x1d')](_0x1a4e03);};}exports[_0xc529('0x1e')]=function(_0xae0042,_0x6bbd20){var _0x5ba93c={},_0x2715e9={},_0x1db9c5={'count':0x0,'rows':[]};var _0x12335=_[_0xc529('0x1f')](db[_0xc529('0x20')][_0xc529('0x21')],function(_0x553263){return{'name':_0x553263[_0xc529('0x22')],'type':_0x553263[_0xc529('0x23')]['key']};});_0x2715e9[_0xc529('0x24')]=_[_0xc529('0x1f')](_0x12335,_0xc529('0x1c'));_0x2715e9[_0xc529('0x25')]=_[_0xc529('0x26')](_0xae0042[_0xc529('0x25')]);_0x2715e9[_0xc529('0x27')]=_[_0xc529('0x28')](_0x2715e9[_0xc529('0x24')],_0x2715e9['query']);_0x5ba93c[_0xc529('0x29')]=_[_0xc529('0x28')](_0x2715e9[_0xc529('0x24')],qs[_0xc529('0x2a')](_0xae0042[_0xc529('0x25')][_0xc529('0x2a')]));_0x5ba93c['attributes']=_0x5ba93c['attributes'][_0xc529('0x2b')]?_0x5ba93c[_0xc529('0x29')]:_0x2715e9[_0xc529('0x24')];if(!_0xae0042['query']['hasOwnProperty'](_0xc529('0x2c'))){_0x5ba93c[_0xc529('0x10')]=qs[_0xc529('0x10')](_0xae0042[_0xc529('0x25')]['limit']);_0x5ba93c['offset']=qs[_0xc529('0xf')](_0xae0042['query'][_0xc529('0xf')]);}_0x5ba93c['order']=qs[_0xc529('0x2d')](_0xae0042[_0xc529('0x25')][_0xc529('0x2d')]);_0x5ba93c[_0xc529('0x2e')]=qs[_0xc529('0x27')](_[_0xc529('0x2f')](_0xae0042[_0xc529('0x25')],_0x2715e9[_0xc529('0x27')]),_0x12335);if(_0xae0042[_0xc529('0x25')]['filter']){_0x5ba93c[_0xc529('0x2e')]=_[_0xc529('0x30')](_0x5ba93c[_0xc529('0x2e')],{'$or':_[_0xc529('0x1f')](_0x12335,function(_0x30f779){if(_0x30f779[_0xc529('0x23')]!==_0xc529('0x31')){var _0x2254e3={};_0x2254e3[_0x30f779[_0xc529('0x1c')]]={'$like':'%'+_0xae0042[_0xc529('0x25')][_0xc529('0x32')]+'%'};return _0x2254e3;}})});}_0x5ba93c=_[_0xc529('0x30')]({},_0x5ba93c,_0xae0042[_0xc529('0x33')]);var _0x548324={'where':_0x5ba93c['where']};return db['SquareProject']['count'](_0x548324)[_0xc529('0x13')](function(_0x47d3b0){_0x1db9c5['count']=_0x47d3b0;if(_0xae0042[_0xc529('0x25')][_0xc529('0x34')]){_0x5ba93c[_0xc529('0x35')]=[{'all':!![]}];}return db[_0xc529('0x20')][_0xc529('0x36')](_0x5ba93c);})[_0xc529('0x13')](function(_0x522b80){_0x1db9c5[_0xc529('0x37')]=_0x522b80;return _0x1db9c5;})['then'](respondWithFilteredResult(_0x6bbd20,_0x5ba93c))[_0xc529('0x38')](handleError(_0x6bbd20,null));};exports[_0xc529('0x39')]=function(_0xb8c15a,_0x21d8f1){var _0x546a46={'raw':![],'where':{'id':_0xb8c15a['params']['id']}},_0x589fc6={};_0x589fc6[_0xc529('0x24')]=_[_0xc529('0x26')](db['SquareProject'][_0xc529('0x21')]);_0x589fc6[_0xc529('0x25')]=_['keys'](_0xb8c15a[_0xc529('0x25')]);_0x589fc6[_0xc529('0x27')]=_[_0xc529('0x28')](_0x589fc6[_0xc529('0x24')],_0x589fc6[_0xc529('0x25')]);_0x546a46[_0xc529('0x29')]=_[_0xc529('0x28')](_0x589fc6[_0xc529('0x24')],qs['fields'](_0xb8c15a[_0xc529('0x25')][_0xc529('0x2a')]));_0x546a46[_0xc529('0x29')]=_0x546a46[_0xc529('0x29')][_0xc529('0x2b')]?_0x546a46[_0xc529('0x29')]:_0x589fc6[_0xc529('0x24')];if(_0xb8c15a[_0xc529('0x25')][_0xc529('0x34')]){_0x546a46[_0xc529('0x35')]=[{'all':!![]}];}_0x546a46=_[_0xc529('0x30')]({},_0x546a46,_0xb8c15a[_0xc529('0x33')]);return db['SquareProject'][_0xc529('0x3a')](_0x546a46)[_0xc529('0x13')](handleEntityNotFound(_0x21d8f1,null))[_0xc529('0x13')](respondWithResult(_0x21d8f1,null))[_0xc529('0x38')](handleError(_0x21d8f1,null));};exports['create']=function(_0x340c9f,_0x3ef460){return db[_0xc529('0x20')][_0xc529('0x3b')](_0x340c9f[_0xc529('0x3c')],{})[_0xc529('0x13')](function(_0x30a4c7){var _0x37af08=_0x340c9f[_0xc529('0x3d')][_0xc529('0x3e')]({'plain':!![]});if(!_0x37af08)throw new Error(_0xc529('0x3f'));if(_0x37af08['role']===_0xc529('0x3d')){var _0x3acc01=_0x30a4c7[_0xc529('0x3e')]({'plain':!![]});var _0x12c7ff='SquareProjects';return db['UserProfileSection'][_0xc529('0x3a')]({'where':{'name':_0x12c7ff,'userProfileId':_0x37af08[_0xc529('0x40')]},'raw':!![]})[_0xc529('0x13')](function(_0x4dcad7){if(_0x4dcad7&&_0x4dcad7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3acc01['name'],'resourceId':_0x3acc01['id'],'type':_0x4dcad7[_0xc529('0x1c')],'sectionId':_0x4dcad7['id']},{})[_0xc529('0x13')](function(){return _0x30a4c7;});}else{return _0x30a4c7;}})[_0xc529('0x38')](function(_0x4a3227){logger[_0xc529('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a3227);throw _0x4a3227;});}return _0x30a4c7;})['then'](respondWithResult(_0x3ef460,0xc9))['catch'](handleError(_0x3ef460,null));};exports[_0xc529('0x41')]=function(_0x2a6894,_0x1e946c){if(_0x2a6894[_0xc529('0x3c')]['id']){delete _0x2a6894['body']['id'];}return db['SquareProject'][_0xc529('0x3a')]({'where':{'id':_0x2a6894[_0xc529('0x42')]['id']}})[_0xc529('0x13')](handleEntityNotFound(_0x1e946c,null))[_0xc529('0x13')](saveUpdates(_0x2a6894[_0xc529('0x3c')],null))[_0xc529('0x13')](function(_0x37abe7){if(!_0x37abe7)return;var _0x367d07=_0x37abe7['get']({'plain':!![]});return _0x367d07;})[_0xc529('0x13')](function(_0x4eac98){var _0x1f5439=new Redis(config[_0xc529('0x8')]);_0x1f5439[_0xc529('0x16')](_0xc529('0x43'),JSON[_0xc529('0x17')](_['pick'](_0x4eac98,['id',_0xc529('0x1c'),'production'])));return _0x4eac98;})[_0xc529('0x13')](respondWithResult(_0x1e946c,null))['catch'](handleError(_0x1e946c,null));};exports['destroy']=function(_0x6d11e6,_0x508c7b){return db[_0xc529('0x20')]['find']({'where':{'id':_0x6d11e6[_0xc529('0x42')]['id']}})[_0xc529('0x13')](handleEntityNotFound(_0x508c7b,null))[_0xc529('0x13')](removeEntity(_0x508c7b,null))[_0xc529('0x38')](handleError(_0x508c7b,null));}; \ No newline at end of file +var _0xaa2e=['SquareProject','includeAll','include','findAll','params','find','catch','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','pick','production','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','SquareProjects','destroy','publish','agi','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xaa2e,0x128));var _0xeaa2=function(_0x102ad7,_0x5cbdc7){_0x102ad7=_0x102ad7-0x0;var _0x5746e8=_0xaa2e[_0x102ad7];return _0x5746e8;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xeaa2('0x0'));var logger=require(_0xeaa2('0x1'))(_0xeaa2('0x2'));var config=require(_0xeaa2('0x3'));var db=require(_0xeaa2('0x4'))['db'];config['redis']=_['defaults'](config[_0xeaa2('0x5')],{'host':_0xeaa2('0x6'),'port':0x18eb});var socket=require(_0xeaa2('0x7'))(new Redis(config[_0xeaa2('0x5')]));require(_0xeaa2('0x8'))[_0xeaa2('0x9')](socket);function respondWithResult(_0x5d8487,_0x4296f0){_0x4296f0=_0x4296f0||0xc8;return function(_0x3e5334){if(_0x3e5334){return _0x5d8487[_0xeaa2('0xa')](_0x4296f0)[_0xeaa2('0xb')](_0x3e5334);}};}function respondWithFilteredResult(_0x288c09,_0x26017f){return function(_0x29e873){if(_0x29e873){var _0x485d15=typeof _0x26017f[_0xeaa2('0xc')]===_0xeaa2('0xd')&&typeof _0x26017f[_0xeaa2('0xe')]===_0xeaa2('0xd');var _0xc20d40=_0x29e873[_0xeaa2('0xf')];var _0x48f5be=_0x485d15?0x0:_0x26017f[_0xeaa2('0xc')];var _0x3183ee=_0x485d15?_0x29e873['count']:_0x26017f[_0xeaa2('0xc')]+_0x26017f[_0xeaa2('0xe')];var _0x1ff4d5;if(_0x3183ee>=_0xc20d40){_0x3183ee=_0xc20d40;_0x1ff4d5=0xc8;}else{_0x1ff4d5=0xce;}_0x288c09[_0xeaa2('0xa')](_0x1ff4d5);return _0x288c09['set'](_0xeaa2('0x10'),_0x48f5be+'-'+_0x3183ee+'/'+_0xc20d40)[_0xeaa2('0xb')](_0x29e873);}return null;};}function saveUpdates(_0xf0b205){return function(_0x14fa3e){if(_0x14fa3e){return _0x14fa3e[_0xeaa2('0x11')](_0xf0b205)[_0xeaa2('0x12')](function(_0x461b55){return _0x461b55;});}return null;};}function removeEntity(_0x40d8ad){return function(_0xb4daef){if(_0xb4daef){return _0xb4daef['destroy']()[_0xeaa2('0x12')](function(){var _0x1afb1e=_0xb4daef['get']({'plain':!![]});var _0x4413fe=_0xeaa2('0x13');return db['UserProfileResource'][_0xeaa2('0x14')]({'where':{'type':_0x4413fe,'resourceId':_0x1afb1e['id']}})['then'](function(){return _0xb4daef;});})[_0xeaa2('0x12')](function(){var _0xec536=new Redis(config['redis']);_0xec536[_0xeaa2('0x15')](_0xeaa2('0x16'),JSON['stringify']({'id':_0xb4daef['id'],'deleted':!![]}));})[_0xeaa2('0x12')](function(){_0x40d8ad['status'](0xcc)[_0xeaa2('0x17')]();});}};}function handleEntityNotFound(_0x51c416){return function(_0x4e1b45){if(!_0x4e1b45){_0x51c416['sendStatus'](0x194);}return _0x4e1b45;};}function handleError(_0x1e2830,_0x1313ae){_0x1313ae=_0x1313ae||0x1f4;return function(_0x1eb4a5){logger[_0xeaa2('0x18')](_0x1eb4a5[_0xeaa2('0x19')]);if(_0x1eb4a5[_0xeaa2('0x1a')]){delete _0x1eb4a5[_0xeaa2('0x1a')];}_0x1e2830[_0xeaa2('0xa')](_0x1313ae)[_0xeaa2('0x1b')](_0x1eb4a5);};}exports[_0xeaa2('0x1c')]=function(_0x49e262,_0x4f6ac0){var _0x2afbf5={},_0xff51c={},_0x5ee75b={'count':0x0,'rows':[]};var _0x18964a=_[_0xeaa2('0x1d')](db['SquareProject'][_0xeaa2('0x1e')],function(_0x31729a){return{'name':_0x31729a[_0xeaa2('0x1f')],'type':_0x31729a['type']['key']};});_0xff51c[_0xeaa2('0x20')]=_['map'](_0x18964a,_0xeaa2('0x1a'));_0xff51c[_0xeaa2('0x21')]=_['keys'](_0x49e262[_0xeaa2('0x21')]);_0xff51c['filters']=_[_0xeaa2('0x22')](_0xff51c['model'],_0xff51c['query']);_0x2afbf5[_0xeaa2('0x23')]=_[_0xeaa2('0x22')](_0xff51c[_0xeaa2('0x20')],qs['fields'](_0x49e262['query'][_0xeaa2('0x24')]));_0x2afbf5[_0xeaa2('0x23')]=_0x2afbf5[_0xeaa2('0x23')][_0xeaa2('0x25')]?_0x2afbf5[_0xeaa2('0x23')]:_0xff51c[_0xeaa2('0x20')];if(!_0x49e262['query'][_0xeaa2('0x26')](_0xeaa2('0x27'))){_0x2afbf5[_0xeaa2('0xe')]=qs[_0xeaa2('0xe')](_0x49e262[_0xeaa2('0x21')]['limit']);_0x2afbf5[_0xeaa2('0xc')]=qs[_0xeaa2('0xc')](_0x49e262[_0xeaa2('0x21')][_0xeaa2('0xc')]);}_0x2afbf5[_0xeaa2('0x28')]=qs[_0xeaa2('0x29')](_0x49e262[_0xeaa2('0x21')][_0xeaa2('0x29')]);_0x2afbf5[_0xeaa2('0x2a')]=qs['filters'](_['pick'](_0x49e262['query'],_0xff51c[_0xeaa2('0x2b')]),_0x18964a);if(_0x49e262['query'][_0xeaa2('0x2c')]){_0x2afbf5[_0xeaa2('0x2a')]=_[_0xeaa2('0x2d')](_0x2afbf5[_0xeaa2('0x2a')],{'$or':_['map'](_0x18964a,function(_0x264ace){if(_0x264ace[_0xeaa2('0x2e')]!==_0xeaa2('0x2f')){var _0x14f1dd={};_0x14f1dd[_0x264ace[_0xeaa2('0x1a')]]={'$like':'%'+_0x49e262[_0xeaa2('0x21')][_0xeaa2('0x2c')]+'%'};return _0x14f1dd;}})});}_0x2afbf5=_['merge']({},_0x2afbf5,_0x49e262[_0xeaa2('0x30')]);var _0x521650={'where':_0x2afbf5['where']};return db[_0xeaa2('0x31')][_0xeaa2('0xf')](_0x521650)[_0xeaa2('0x12')](function(_0x3f1136){_0x5ee75b['count']=_0x3f1136;if(_0x49e262[_0xeaa2('0x21')][_0xeaa2('0x32')]){_0x2afbf5[_0xeaa2('0x33')]=[{'all':!![]}];}return db[_0xeaa2('0x31')][_0xeaa2('0x34')](_0x2afbf5);})[_0xeaa2('0x12')](function(_0x302537){_0x5ee75b['rows']=_0x302537;return _0x5ee75b;})['then'](respondWithFilteredResult(_0x4f6ac0,_0x2afbf5))['catch'](handleError(_0x4f6ac0,null));};exports['show']=function(_0x4f741c,_0x3623d9){var _0x59b74b={'raw':![],'where':{'id':_0x4f741c[_0xeaa2('0x35')]['id']}},_0x250520={};_0x250520[_0xeaa2('0x20')]=_['keys'](db['SquareProject']['rawAttributes']);_0x250520[_0xeaa2('0x21')]=_['keys'](_0x4f741c[_0xeaa2('0x21')]);_0x250520['filters']=_['intersection'](_0x250520['model'],_0x250520[_0xeaa2('0x21')]);_0x59b74b['attributes']=_[_0xeaa2('0x22')](_0x250520[_0xeaa2('0x20')],qs[_0xeaa2('0x24')](_0x4f741c[_0xeaa2('0x21')]['fields']));_0x59b74b[_0xeaa2('0x23')]=_0x59b74b['attributes'][_0xeaa2('0x25')]?_0x59b74b[_0xeaa2('0x23')]:_0x250520['model'];if(_0x4f741c[_0xeaa2('0x21')][_0xeaa2('0x32')]){_0x59b74b[_0xeaa2('0x33')]=[{'all':!![]}];}_0x59b74b=_[_0xeaa2('0x2d')]({},_0x59b74b,_0x4f741c[_0xeaa2('0x30')]);return db[_0xeaa2('0x31')][_0xeaa2('0x36')](_0x59b74b)['then'](handleEntityNotFound(_0x3623d9,null))[_0xeaa2('0x12')](respondWithResult(_0x3623d9,null))[_0xeaa2('0x37')](handleError(_0x3623d9,null));};exports['create']=function(_0x454e84,_0x58f07d){return db[_0xeaa2('0x31')]['create'](_0x454e84['body'],{})[_0xeaa2('0x12')](function(_0x5c2596){var _0x9cbe06=_0x454e84[_0xeaa2('0x38')][_0xeaa2('0x39')]({'plain':!![]});if(!_0x9cbe06)throw new Error(_0xeaa2('0x3a'));if(_0x9cbe06[_0xeaa2('0x3b')]===_0xeaa2('0x38')){var _0x216a7c=_0x5c2596[_0xeaa2('0x39')]({'plain':!![]});var _0x47c45a=_0xeaa2('0x13');return db[_0xeaa2('0x3c')][_0xeaa2('0x36')]({'where':{'name':_0x47c45a,'userProfileId':_0x9cbe06[_0xeaa2('0x3d')]},'raw':!![]})[_0xeaa2('0x12')](function(_0x14246e){if(_0x14246e&&_0x14246e[_0xeaa2('0x3e')]===0x0){return db[_0xeaa2('0x3f')][_0xeaa2('0x40')]({'name':_0x216a7c['name'],'resourceId':_0x216a7c['id'],'type':_0x14246e['name'],'sectionId':_0x14246e['id']},{})[_0xeaa2('0x12')](function(){return _0x5c2596;});}else{return _0x5c2596;}})['catch'](function(_0x31e2fd){logger['error'](_0xeaa2('0x41'),_0x31e2fd);throw _0x31e2fd;});}return _0x5c2596;})[_0xeaa2('0x12')](respondWithResult(_0x58f07d,0xc9))['catch'](handleError(_0x58f07d,null));};exports['update']=function(_0x1e46f2,_0x1875dc){if(_0x1e46f2[_0xeaa2('0x42')]['id']){delete _0x1e46f2[_0xeaa2('0x42')]['id'];}return db['SquareProject'][_0xeaa2('0x36')]({'where':{'id':_0x1e46f2['params']['id']}})['then'](handleEntityNotFound(_0x1875dc,null))['then'](saveUpdates(_0x1e46f2[_0xeaa2('0x42')],null))[_0xeaa2('0x12')](function(_0x5c71a4){if(!_0x5c71a4)return;var _0x203ef1=_0x5c71a4[_0xeaa2('0x39')]({'plain':!![]});return _0x203ef1;})[_0xeaa2('0x12')](function(_0x4b20bf){var _0x4f6eea=new Redis(config['redis']);_0x4f6eea[_0xeaa2('0x15')](_0xeaa2('0x16'),JSON['stringify'](_[_0xeaa2('0x43')](_0x4b20bf,['id',_0xeaa2('0x1a'),_0xeaa2('0x44')])));return _0x4b20bf;})['then'](respondWithResult(_0x1875dc,null))[_0xeaa2('0x37')](handleError(_0x1875dc,null));};exports[_0xeaa2('0x14')]=function(_0xd66fb8,_0x2aeb81){return db[_0xeaa2('0x31')][_0xeaa2('0x36')]({'where':{'id':_0xd66fb8[_0xeaa2('0x35')]['id']}})['then'](handleEntityNotFound(_0x2aeb81,null))[_0xeaa2('0x12')](removeEntity(_0x2aeb81,null))['catch'](handleError(_0x2aeb81,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 162e628..a8363f3 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 _0x3b84=['setMaxListeners','emit','hasOwnProperty','hook','events','SquareProject'];(function(_0x451ee7,_0x45c553){var _0x123ee7=function(_0x3c57d3){while(--_0x3c57d3){_0x451ee7['push'](_0x451ee7['shift']());}};_0x123ee7(++_0x45c553);}(_0x3b84,0x130));var _0x43b8=function(_0xf7344,_0x2e82b){_0xf7344=_0xf7344-0x0;var _0x330729=_0x3b84[_0xf7344];return _0x330729;};'use strict';var EventEmitter=require(_0x43b8('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x43b8('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x43b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x402b07){return function(_0x2c7466,_0x4ec7e3,_0x4b70e2){SquareProjectEvents[_0x43b8('0x3')](_0x402b07+':'+_0x2c7466['id'],_0x2c7466);SquareProjectEvents[_0x43b8('0x3')](_0x402b07,_0x2c7466);_0x4b70e2(null);};}for(var e in events){if(events[_0x43b8('0x4')](e)){var event=events[e];SquareProject[_0x43b8('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x1130=['SquareProject','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x13b6fc,_0x539ca2){var _0x5079aa=function(_0x45158f){while(--_0x45158f){_0x13b6fc['push'](_0x13b6fc['shift']());}};_0x5079aa(++_0x539ca2);}(_0x1130,0xe7));var _0x0113=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x1130[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x0113('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0113('0x1'),'afterUpdate':_0x0113('0x2'),'afterDestroy':'remove'};function emitEvent(_0x214dac){return function(_0x325d03,_0xcdf63a,_0x35d677){SquareProjectEvents[_0x0113('0x3')](_0x214dac+':'+_0x325d03['id'],_0x325d03);SquareProjectEvents[_0x0113('0x3')](_0x214dac,_0x325d03);_0x35d677(null);};}for(var e in events){if(events[_0x0113('0x4')](e)){var event=events[e];SquareProject[_0x0113('0x5')](e,emitEvent(event));}}module[_0x0113('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4540f39..937e38c 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 _0x18ca=['../../config/logger','moment','path','rimraf','../../config/environment','exports','define','SquareProject','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util'];(function(_0x3d2244,_0x2680d9){var _0x554105=function(_0x33d728){while(--_0x33d728){_0x3d2244['push'](_0x3d2244['shift']());}};_0x554105(++_0x2680d9);}(_0x18ca,0x1e9));var _0xa18c=function(_0x56954b,_0x2064cd){_0x56954b=_0x56954b-0x0;var _0x496bda=_0x18ca[_0x56954b];return _0x496bda;};'use strict';var _=require('lodash');var util=require(_0xa18c('0x0'));var logger=require(_0xa18c('0x1'))('api');var moment=require(_0xa18c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa18c('0x3'));var rimraf=require(_0xa18c('0x4'));var config=require(_0xa18c('0x5'));var attributes=require('./squareProject.attributes');module[_0xa18c('0x6')]=function(_0x195e85,_0x140a0f){return _0x195e85[_0xa18c('0x7')](_0xa18c('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x40f0dc,_0x12e8d7,_0xcbc636){if(_0x40f0dc[_0xa18c('0x9')]('preproduction')){_0x40f0dc[_0xa18c('0xa')]=moment()[_0xa18c('0xb')](_0xa18c('0xc'));}if(_0x40f0dc[_0xa18c('0x9')]('production')){_0x40f0dc[_0xa18c('0xd')]=moment()[_0xa18c('0xb')](_0xa18c('0xc'));}_0xcbc636(null,_0x40f0dc);}}});}; \ No newline at end of file +var _0x25e2=['../../config/environment','./squareProject.attributes','exports','preproduction','savedAt','changed','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1126f2,_0x2cb7c3){var _0x8a9650=function(_0x1e05e5){while(--_0x1e05e5){_0x1126f2['push'](_0x1126f2['shift']());}};_0x8a9650(++_0x2cb7c3);}(_0x25e2,0x88));var _0x225e=function(_0x25c196,_0x365afc){_0x25c196=_0x25c196-0x0;var _0x5ac8ea=_0x25e2[_0x25c196];return _0x5ac8ea;};'use strict';var _=require(_0x225e('0x0'));var util=require(_0x225e('0x1'));var logger=require(_0x225e('0x2'))(_0x225e('0x3'));var moment=require(_0x225e('0x4'));var BPromise=require(_0x225e('0x5'));var rp=require(_0x225e('0x6'));var fs=require('fs');var path=require(_0x225e('0x7'));var rimraf=require('rimraf');var config=require(_0x225e('0x8'));var attributes=require(_0x225e('0x9'));module[_0x225e('0xa')]=function(_0x131c2c,_0x376e92){return _0x131c2c['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x118511,_0x10722d,_0x54b59f){if(_0x118511['changed'](_0x225e('0xb'))){_0x118511[_0x225e('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x118511[_0x225e('0xd')](_0x225e('0xe'))){_0x118511[_0x225e('0xf')]=moment()[_0x225e('0x10')](_0x225e('0x11'));}_0x54b59f(null,_0x118511);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 53fe007..b67f945 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 _0x6f66=['model','map','then','info','GetSquareProjects','debug','stringify','error','message','find','where','ShowSquareProject','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','findAll','options','raw','attributes','limit','include'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6f66,0x150));var _0x66f6=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x6f66[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x66f6('0x0'));var Redis=require('ioredis');var db=require(_0x66f6('0x1'))['db'];var logger=require(_0x66f6('0x2'))(_0x66f6('0x3'));var config=require(_0x66f6('0x4'));config[_0x66f6('0x5')]=_[_0x66f6('0x6')](config[_0x66f6('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x66f6('0x7'))(new Redis(config[_0x66f6('0x5')]));require(_0x66f6('0x8'))['register'](socket);exports['GetSquareProjects']=function(_0x1dc761){var _0x318a8d=this;return new Promise(function(_0x2d6304,_0x45f961){return db['SquareProject'][_0x66f6('0x9')]({'raw':_0x1dc761[_0x66f6('0xa')]?_0x1dc761[_0x66f6('0xa')][_0x66f6('0xb')]===undefined?!![]:![]:!![],'where':_0x1dc761[_0x66f6('0xa')]?_0x1dc761[_0x66f6('0xa')]['where']||null:null,'attributes':_0x1dc761['options']?_0x1dc761[_0x66f6('0xa')][_0x66f6('0xc')]||null:null,'limit':_0x1dc761[_0x66f6('0xa')]?_0x1dc761[_0x66f6('0xa')][_0x66f6('0xd')]||null:null,'include':_0x1dc761[_0x66f6('0xa')]?_0x1dc761[_0x66f6('0xa')][_0x66f6('0xe')]?_['map'](_0x1dc761[_0x66f6('0xa')][_0x66f6('0xe')],function(_0x10ce40){return{'model':db[_0x10ce40[_0x66f6('0xf')]],'as':_0x10ce40['as'],'attributes':_0x10ce40['attributes'],'include':_0x10ce40['include']?_['map'](_0x10ce40[_0x66f6('0xe')],function(_0x2b72f1){return{'model':db[_0x2b72f1[_0x66f6('0xf')]],'as':_0x2b72f1['as'],'attributes':_0x2b72f1[_0x66f6('0xc')],'include':_0x2b72f1[_0x66f6('0xe')]?_[_0x66f6('0x10')](_0x2b72f1[_0x66f6('0xe')],function(_0x32216a){return{'model':db[_0x32216a[_0x66f6('0xf')]],'as':_0x32216a['as'],'attributes':_0x32216a[_0x66f6('0xc')]};}):[]};}):[]};}):[]:[]})[_0x66f6('0x11')](function(_0x2e5537){logger[_0x66f6('0x12')](_0x66f6('0x13'),_0x1dc761);logger[_0x66f6('0x14')](_0x66f6('0x13'),_0x1dc761,JSON[_0x66f6('0x15')](_0x2e5537));_0x2d6304(_0x2e5537);})['catch'](function(_0x5c04ab){logger[_0x66f6('0x16')](_0x66f6('0x13'),_0x5c04ab[_0x66f6('0x17')],_0x1dc761);_0x45f961(_0x318a8d['error'](0x1f4,_0x5c04ab[_0x66f6('0x17')]));});});};exports['ShowSquareProject']=function(_0x324b03){var _0xe2a873=this;return new Promise(function(_0x3b0154,_0x170dc7){return db['SquareProject'][_0x66f6('0x18')]({'raw':_0x324b03[_0x66f6('0xa')]?_0x324b03[_0x66f6('0xa')][_0x66f6('0xb')]===undefined?!![]:![]:!![],'where':_0x324b03[_0x66f6('0xa')]?_0x324b03['options'][_0x66f6('0x19')]||null:null,'attributes':_0x324b03['options']?_0x324b03[_0x66f6('0xa')][_0x66f6('0xc')]||null:null,'include':_0x324b03['options']?_0x324b03['options'][_0x66f6('0xe')]?_[_0x66f6('0x10')](_0x324b03[_0x66f6('0xa')][_0x66f6('0xe')],function(_0x5204d5){return{'model':db[_0x5204d5[_0x66f6('0xf')]],'as':_0x5204d5['as'],'attributes':_0x5204d5[_0x66f6('0xc')],'include':_0x5204d5[_0x66f6('0xe')]?_['map'](_0x5204d5[_0x66f6('0xe')],function(_0x2069c3){return{'model':db[_0x2069c3[_0x66f6('0xf')]],'as':_0x2069c3['as'],'attributes':_0x2069c3['attributes'],'include':_0x2069c3[_0x66f6('0xe')]?_[_0x66f6('0x10')](_0x2069c3['include'],function(_0x2c41db){return{'model':db[_0x2c41db[_0x66f6('0xf')]],'as':_0x2c41db['as'],'attributes':_0x2c41db[_0x66f6('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ec9e5){logger[_0x66f6('0x12')](_0x66f6('0x1a'),_0x324b03);logger['debug'](_0x66f6('0x1a'),_0x324b03,JSON['stringify'](_0x5ec9e5));_0x3b0154(_0x5ec9e5);})['catch'](function(_0x9fb079){logger[_0x66f6('0x16')]('ShowSquareProject',_0x9fb079[_0x66f6('0x17')],_0x324b03);_0x170dc7(_0xe2a873[_0x66f6('0x16')](0x1f4,_0x9fb079[_0x66f6('0x17')]));});});}; \ No newline at end of file +var _0x42e8=['model','attributes','then','debug','catch','error','message','find','info','ShowSquareProject','stringify','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','include','map'];(function(_0x3d5ebc,_0x354479){var _0x1a9911=function(_0x1da1ea){while(--_0x1da1ea){_0x3d5ebc['push'](_0x3d5ebc['shift']());}};_0x1a9911(++_0x354479);}(_0x42e8,0xf3));var _0x842e=function(_0x5d0eca,_0x4b7289){_0x5d0eca=_0x5d0eca-0x0;var _0x435c80=_0x42e8[_0x5d0eca];return _0x435c80;};'use strict';var _=require(_0x842e('0x0'));var Redis=require(_0x842e('0x1'));var db=require(_0x842e('0x2'))['db'];var logger=require(_0x842e('0x3'))(_0x842e('0x4'));var config=require(_0x842e('0x5'));config[_0x842e('0x6')]=_['defaults'](config[_0x842e('0x6')],{'host':_0x842e('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x842e('0x6')]));require(_0x842e('0x8'))[_0x842e('0x9')](socket);exports[_0x842e('0xa')]=function(_0x5abb4c){var _0x408b26=this;return new Promise(function(_0x1fb9b4,_0x3d9d99){return db[_0x842e('0xb')][_0x842e('0xc')]({'raw':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c['options'][_0x842e('0xe')]===undefined?!![]:![]:!![],'where':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c[_0x842e('0xd')][_0x842e('0xf')]||null:null,'attributes':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c[_0x842e('0xd')]['attributes']||null:null,'limit':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c[_0x842e('0xd')]['limit']||null:null,'include':_0x5abb4c[_0x842e('0xd')]?_0x5abb4c['options'][_0x842e('0x10')]?_[_0x842e('0x11')](_0x5abb4c['options'][_0x842e('0x10')],function(_0x37e82d){return{'model':db[_0x37e82d[_0x842e('0x12')]],'as':_0x37e82d['as'],'attributes':_0x37e82d[_0x842e('0x13')],'include':_0x37e82d[_0x842e('0x10')]?_['map'](_0x37e82d[_0x842e('0x10')],function(_0x2d4e80){return{'model':db[_0x2d4e80['model']],'as':_0x2d4e80['as'],'attributes':_0x2d4e80[_0x842e('0x13')],'include':_0x2d4e80[_0x842e('0x10')]?_[_0x842e('0x11')](_0x2d4e80['include'],function(_0x21288e){return{'model':db[_0x21288e[_0x842e('0x12')]],'as':_0x21288e['as'],'attributes':_0x21288e['attributes']};}):[]};}):[]};}):[]:[]})[_0x842e('0x14')](function(_0xf4d3e9){logger['info'](_0x842e('0xa'),_0x5abb4c);logger[_0x842e('0x15')](_0x842e('0xa'),_0x5abb4c,JSON['stringify'](_0xf4d3e9));_0x1fb9b4(_0xf4d3e9);})[_0x842e('0x16')](function(_0x5eceda){logger[_0x842e('0x17')](_0x842e('0xa'),_0x5eceda[_0x842e('0x18')],_0x5abb4c);_0x3d9d99(_0x408b26[_0x842e('0x17')](0x1f4,_0x5eceda[_0x842e('0x18')]));});});};exports['ShowSquareProject']=function(_0x36ffbc){var _0x47fd15=this;return new Promise(function(_0x2957c5,_0x348953){return db[_0x842e('0xb')][_0x842e('0x19')]({'raw':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc['options'][_0x842e('0xe')]===undefined?!![]:![]:!![],'where':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc[_0x842e('0xd')]['where']||null:null,'attributes':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc[_0x842e('0xd')][_0x842e('0x13')]||null:null,'include':_0x36ffbc[_0x842e('0xd')]?_0x36ffbc['options'][_0x842e('0x10')]?_[_0x842e('0x11')](_0x36ffbc[_0x842e('0xd')][_0x842e('0x10')],function(_0x5723cd){return{'model':db[_0x5723cd[_0x842e('0x12')]],'as':_0x5723cd['as'],'attributes':_0x5723cd[_0x842e('0x13')],'include':_0x5723cd[_0x842e('0x10')]?_[_0x842e('0x11')](_0x5723cd[_0x842e('0x10')],function(_0x488578){return{'model':db[_0x488578[_0x842e('0x12')]],'as':_0x488578['as'],'attributes':_0x488578[_0x842e('0x13')],'include':_0x488578[_0x842e('0x10')]?_['map'](_0x488578[_0x842e('0x10')],function(_0x359e88){return{'model':db[_0x359e88[_0x842e('0x12')]],'as':_0x359e88['as'],'attributes':_0x359e88['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22212e){logger[_0x842e('0x1a')](_0x842e('0x1b'),_0x36ffbc);logger[_0x842e('0x15')](_0x842e('0x1b'),_0x36ffbc,JSON[_0x842e('0x1c')](_0x22212e));_0x2957c5(_0x22212e);})[_0x842e('0x16')](function(_0x264814){logger[_0x842e('0x17')](_0x842e('0x1b'),_0x264814[_0x842e('0x18')],_0x36ffbc);_0x348953(_0x47fd15['error'](0x1f4,_0x264814[_0x842e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7a46a4e..38423cd 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 _0x005c=['squareProject:','./squareProject.events','save','remove','emit','removeListener','register','length'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x005c,0x139));var _0xc005=function(_0xd70149,_0x1daa7b){_0xd70149=_0xd70149-0x0;var _0x721074=_0x005c[_0xd70149];return _0x721074;};'use strict';var SquareProjectEvents=require(_0xc005('0x0'));var events=[_0xc005('0x1'),_0xc005('0x2'),'update'];function createListener(_0x2c7bdc,_0x50ca1b){return function(_0x38e574){_0x50ca1b[_0xc005('0x3')](_0x2c7bdc,_0x38e574);};}function removeListener(_0xf8b478,_0x3c5db7){return function(){SquareProjectEvents[_0xc005('0x4')](_0xf8b478,_0x3c5db7);};}exports[_0xc005('0x5')]=function(_0x3c453d){for(var _0xdfc7f5=0x0,_0x323797=events[_0xc005('0x6')];_0xdfc7f5<_0x323797;_0xdfc7f5++){var _0x49b9fe=events[_0xdfc7f5];var _0x26d7c1=createListener(_0xc005('0x7')+_0x49b9fe,_0x3c453d);SquareProjectEvents['on'](_0x49b9fe,_0x26d7c1);}}; \ No newline at end of file +var _0x67d0=['register','update','emit','removeListener'];(function(_0x28e28e,_0x304436){var _0x23a4ee=function(_0x4f9d5c){while(--_0x4f9d5c){_0x28e28e['push'](_0x28e28e['shift']());}};_0x23a4ee(++_0x304436);}(_0x67d0,0x191));var _0x067d=function(_0x3979e1,_0x55f307){_0x3979e1=_0x3979e1-0x0;var _0x282bc6=_0x67d0[_0x3979e1];return _0x282bc6;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x067d('0x0')];function createListener(_0x50201e,_0x3efe2f){return function(_0x3ef9a7){_0x3efe2f[_0x067d('0x1')](_0x50201e,_0x3ef9a7);};}function removeListener(_0x32e2d3,_0x262eae){return function(){SquareProjectEvents[_0x067d('0x2')](_0x32e2d3,_0x262eae);};}exports[_0x067d('0x3')]=function(_0x206301){for(var _0x1bc59e=0x0,_0x17a867=events['length'];_0x1bc59e<_0x17a867;_0x1bc59e++){var _0x151e22=events[_0x1bc59e];var _0x4f0448=createListener('squareProject:'+_0x151e22,_0x206301);SquareProjectEvents['on'](_0x151e22,_0x4f0448);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 5cb671e..5e076c6 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x204fd2,_0x1ddade){var _0x4754dc=function(_0x54cc7e){while(--_0x54cc7e){_0x204fd2['push'](_0x204fd2['shift']());}};_0x4754dc(++_0x1ddade);}(_0x5fab,0x177));var _0xb5fa=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x5fab[_0x556927];return _0x5f1235;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2f3c0c,_0x2e8488){var _0x1947b7=function(_0x1c8da1){while(--_0x1c8da1){_0x2f3c0c['push'](_0x2f3c0c['shift']());}};_0x1947b7(++_0x2e8488);}(_0x4975,0x86));var _0x5497=function(_0x181b6f,_0x5005db){_0x181b6f=_0x181b6f-0x0;var _0x1c3f61=_0x4975[_0x181b6f];return _0x1c3f61;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1d92243..49b059a 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 _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x3ec993,_0x4e1534){var _0x276dd8=function(_0x497b96){while(--_0x497b96){_0x3ec993['push'](_0x3ec993['shift']());}};_0x276dd8(++_0x4e1534);}(_0xa41a,0x6b));var _0xaa41=function(_0x54899d,_0x30b008){_0x54899d=_0x54899d-0x0;var _0x4ef5be=_0xa41a[_0x54899d];return _0x4ef5be;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file +var _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0x5075,0x73));var _0x5507=function(_0x40570e,_0x53df30){_0x40570e=_0x40570e-0x0;var _0x16336a=_0x5075[_0x40570e];return _0x16336a;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 13ca4ae..aef88e2 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 _0x8032=['fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','findAll','catch','show','params','intersection','length','includeAll','create','body','find','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','error','stack','name','index','SquareRecording','rawAttributes'];(function(_0x32454c,_0x411ba7){var _0xcc4c08=function(_0xefef7d){while(--_0xefef7d){_0x32454c['push'](_0x32454c['shift']());}};_0xcc4c08(++_0x411ba7);}(_0x8032,0x97));var _0x2803=function(_0x54d9fd,_0x3d2f76){_0x54d9fd=_0x54d9fd-0x0;var _0x5370e1=_0x8032[_0x54d9fd];return _0x5370e1;};'use strict';var emlformat=require(_0x2803('0x0'));var rimraf=require(_0x2803('0x1'));var zipdir=require(_0x2803('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2803('0x3'));var BPromise=require(_0x2803('0x4'));var Mustache=require(_0x2803('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2803('0x6'));var csv=require(_0x2803('0x7'));var ejs=require(_0x2803('0x8'));var fs=require('fs');var fs_extra=require(_0x2803('0x9'));var _=require(_0x2803('0xa'));var squel=require('squel');var crypto=require(_0x2803('0xb'));var jsforce=require(_0x2803('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2803('0x7'));var querystring=require(_0x2803('0xd'));var Papa=require(_0x2803('0xe'));var Redis=require(_0x2803('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2803('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2803('0x11'));var logger=require(_0x2803('0x12'))('api');var utils=require(_0x2803('0x13'));var config=require(_0x2803('0x14'));var licenseUtil=require(_0x2803('0x15'));var db=require(_0x2803('0x16'))['db'];function respondWithStatusCode(_0x4f6dc3,_0x47a532){_0x47a532=_0x47a532||0xcc;return function(_0x2cc502){if(_0x2cc502){return _0x4f6dc3[_0x2803('0x17')](_0x47a532);}return _0x4f6dc3[_0x2803('0x18')](_0x47a532)[_0x2803('0x19')]();};}function respondWithResult(_0x154caa,_0x2e7300){_0x2e7300=_0x2e7300||0xc8;return function(_0x2dd8e7){if(_0x2dd8e7){return _0x154caa[_0x2803('0x18')](_0x2e7300)['json'](_0x2dd8e7);}};}function respondWithFilteredResult(_0x251625,_0x23b23c){return function(_0x26dd2a){if(_0x26dd2a){var _0x4df3a0=typeof _0x23b23c[_0x2803('0x1a')]==='undefined'&&typeof _0x23b23c[_0x2803('0x1b')]===_0x2803('0x1c');var _0x87c3ff=_0x26dd2a[_0x2803('0x1d')];var _0x4ecce1=_0x4df3a0?0x0:_0x23b23c['offset'];var _0xb787f7=_0x4df3a0?_0x26dd2a[_0x2803('0x1d')]:_0x23b23c[_0x2803('0x1a')]+_0x23b23c[_0x2803('0x1b')];var _0x4a0aa5;if(_0xb787f7>=_0x87c3ff){_0xb787f7=_0x87c3ff;_0x4a0aa5=0xc8;}else{_0x4a0aa5=0xce;}_0x251625[_0x2803('0x18')](_0x4a0aa5);return _0x251625[_0x2803('0x1e')](_0x2803('0x1f'),_0x4ecce1+'-'+_0xb787f7+'/'+_0x87c3ff)[_0x2803('0x20')](_0x26dd2a);}return null;};}function patchUpdates(_0x560ea4){return function(_0xe60331){try{jsonpatch['apply'](_0xe60331,_0x560ea4,!![]);}catch(_0x224b04){return BPromise[_0x2803('0x21')](_0x224b04);}return _0xe60331[_0x2803('0x22')]();};}function saveUpdates(_0x32b48e,_0x3a23f4){return function(_0x40b742){if(_0x40b742){return _0x40b742[_0x2803('0x23')](_0x32b48e)[_0x2803('0x24')](function(_0x37399a){return _0x37399a;});}return null;};}function removeEntity(_0x2e5acf,_0x3f730b){return function(_0x5b4631){if(_0x5b4631){return _0x5b4631['destroy']()[_0x2803('0x24')](function(){_0x2e5acf[_0x2803('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3451e1,_0x5306ec){return function(_0xc8b790){if(!_0xc8b790){_0x3451e1[_0x2803('0x17')](0x194);}return _0xc8b790;};}function handleError(_0x4f7198,_0x3fb5f3){_0x3fb5f3=_0x3fb5f3||0x1f4;return function(_0xacfe6e){logger[_0x2803('0x25')](_0xacfe6e[_0x2803('0x26')]);if(_0xacfe6e['name']){delete _0xacfe6e[_0x2803('0x27')];}_0x4f7198[_0x2803('0x18')](_0x3fb5f3)['send'](_0xacfe6e);};}exports[_0x2803('0x28')]=function(_0x4e0fbb,_0x34afc5){var _0x20cb91={},_0x1285e4={},_0x75b53a={'count':0x0,'rows':[]};var _0xafab8c=_['map'](db[_0x2803('0x29')][_0x2803('0x2a')],function(_0x4eb936){return{'name':_0x4eb936[_0x2803('0x2b')],'type':_0x4eb936[_0x2803('0x2c')]['key']};});_0x1285e4[_0x2803('0x2d')]=_['map'](_0xafab8c,'name');_0x1285e4[_0x2803('0x2e')]=_[_0x2803('0x2f')](_0x4e0fbb[_0x2803('0x2e')]);_0x1285e4[_0x2803('0x30')]=_['intersection'](_0x1285e4[_0x2803('0x2d')],_0x1285e4[_0x2803('0x2e')]);_0x20cb91[_0x2803('0x31')]=_['intersection'](_0x1285e4[_0x2803('0x2d')],qs[_0x2803('0x32')](_0x4e0fbb['query'][_0x2803('0x32')]));_0x20cb91[_0x2803('0x31')]=_0x20cb91['attributes']['length']?_0x20cb91[_0x2803('0x31')]:_0x1285e4[_0x2803('0x2d')];if(!_0x4e0fbb[_0x2803('0x2e')][_0x2803('0x33')](_0x2803('0x34'))){_0x20cb91[_0x2803('0x1b')]=qs['limit'](_0x4e0fbb[_0x2803('0x2e')][_0x2803('0x1b')]);_0x20cb91[_0x2803('0x1a')]=qs[_0x2803('0x1a')](_0x4e0fbb[_0x2803('0x2e')][_0x2803('0x1a')]);}_0x20cb91[_0x2803('0x35')]=qs[_0x2803('0x36')](_0x4e0fbb[_0x2803('0x2e')][_0x2803('0x36')]);_0x20cb91[_0x2803('0x37')]=qs[_0x2803('0x30')](_[_0x2803('0x38')](_0x4e0fbb['query'],_0x1285e4[_0x2803('0x30')]),_0xafab8c);if(_0x4e0fbb[_0x2803('0x2e')][_0x2803('0x39')]){_0x20cb91['where']=_[_0x2803('0x3a')](_0x20cb91['where'],{'$or':_[_0x2803('0x3b')](_0xafab8c,function(_0x351485){if(_0x351485[_0x2803('0x2c')]!=='VIRTUAL'){var _0x3640ba={};_0x3640ba[_0x351485[_0x2803('0x27')]]={'$like':'%'+_0x4e0fbb[_0x2803('0x2e')]['filter']+'%'};return _0x3640ba;}})});}_0x20cb91=_[_0x2803('0x3a')]({},_0x20cb91,_0x4e0fbb[_0x2803('0x3c')]);var _0x4d8083={'where':_0x20cb91['where']};return db[_0x2803('0x29')][_0x2803('0x1d')](_0x4d8083)[_0x2803('0x24')](function(_0x49eba4){_0x75b53a['count']=_0x49eba4;if(_0x4e0fbb[_0x2803('0x2e')]['includeAll']){_0x20cb91['include']=[{'all':!![]}];}return db[_0x2803('0x29')][_0x2803('0x3d')](_0x20cb91);})['then'](function(_0x50db83){_0x75b53a['rows']=_0x50db83;return _0x75b53a;})[_0x2803('0x24')](respondWithFilteredResult(_0x34afc5,_0x20cb91))[_0x2803('0x3e')](handleError(_0x34afc5,null));};exports[_0x2803('0x3f')]=function(_0x538bfd,_0x540334){var _0x3291d5={'raw':!![],'where':{'id':_0x538bfd[_0x2803('0x40')]['id']}},_0x38e979={};_0x38e979[_0x2803('0x2d')]=_[_0x2803('0x2f')](db[_0x2803('0x29')][_0x2803('0x2a')]);_0x38e979[_0x2803('0x2e')]=_[_0x2803('0x2f')](_0x538bfd[_0x2803('0x2e')]);_0x38e979[_0x2803('0x30')]=_[_0x2803('0x41')](_0x38e979[_0x2803('0x2d')],_0x38e979[_0x2803('0x2e')]);_0x3291d5['attributes']=_['intersection'](_0x38e979[_0x2803('0x2d')],qs['fields'](_0x538bfd[_0x2803('0x2e')][_0x2803('0x32')]));_0x3291d5[_0x2803('0x31')]=_0x3291d5[_0x2803('0x31')][_0x2803('0x42')]?_0x3291d5['attributes']:_0x38e979[_0x2803('0x2d')];if(_0x538bfd[_0x2803('0x2e')][_0x2803('0x43')]){_0x3291d5['include']=[{'all':!![]}];}_0x3291d5=_['merge']({},_0x3291d5,_0x538bfd[_0x2803('0x3c')]);return db[_0x2803('0x29')]['find'](_0x3291d5)['then'](handleEntityNotFound(_0x540334,null))[_0x2803('0x24')](respondWithResult(_0x540334,null))[_0x2803('0x3e')](handleError(_0x540334,null));};exports[_0x2803('0x44')]=function(_0x415f17,_0x13ebb5){return db['SquareRecording'][_0x2803('0x44')](_0x415f17[_0x2803('0x45')],{})[_0x2803('0x24')](respondWithResult(_0x13ebb5,0xc9))[_0x2803('0x3e')](handleError(_0x13ebb5,null));};exports[_0x2803('0x23')]=function(_0x2d4786,_0x32b268){if(_0x2d4786[_0x2803('0x45')]['id']){delete _0x2d4786['body']['id'];}return db['SquareRecording'][_0x2803('0x46')]({'where':{'id':_0x2d4786[_0x2803('0x40')]['id']}})['then'](handleEntityNotFound(_0x32b268,null))[_0x2803('0x24')](saveUpdates(_0x2d4786['body'],null))[_0x2803('0x24')](respondWithResult(_0x32b268,null))[_0x2803('0x3e')](handleError(_0x32b268,null));};exports[_0x2803('0x47')]=function(_0x1d3a2f,_0x28873c,_0x339be6){var _0x315337=require(_0x2803('0x48'));var _0x432e3d=![];var _0x3ba83e={};if(_0x1d3a2f['query'][_0x2803('0x2c')]&&_0x1d3a2f[_0x2803('0x2e')][_0x2803('0x2c')]===_0x2803('0x49')){_0x3ba83e[_0x2803('0x49')]=_0x1d3a2f['params']['id'];}else{_0x3ba83e['id']=_0x1d3a2f[_0x2803('0x40')]['id'];}return db[_0x2803('0x29')][_0x2803('0x46')]({'where':_0x3ba83e,'attributes':['id','savePath',_0x2803('0x4a')],'raw':!![]})[_0x2803('0x24')](handleEntityNotFound(_0x28873c,null))[_0x2803('0x24')](function(_0xa0fc31){if(_0xa0fc31){var _0x2da621=_0xa0fc31[_0x2803('0x4b')];var _0x14d54e=util[_0x2803('0x4c')](_0x2803('0x4d'),_0x2da621);if(fs['existsSync'](_0x14d54e)){_0x432e3d=!![];return _0x315337[_0x2803('0x4e')](_0x14d54e,_0x2da621,config['secrets'][_0x2803('0x4f')])[_0x2803('0x24')](function(){return _0xa0fc31;});}return _0xa0fc31;}})['then'](function(_0x5e20d0){if(_0x5e20d0){var _0x18f8f4=_0x5e20d0[_0x2803('0x4b')];if(!fs[_0x2803('0x50')](_0x18f8f4)){throw new db[(_0x2803('0x51'))][(_0x2803('0x52'))](_0x2803('0x53'));}if(_0x5e20d0[_0x2803('0x4a')]){return _0x28873c[_0x2803('0x47')](_0x18f8f4,_0x5e20d0['filename']+path[_0x2803('0x54')](_0x18f8f4),function(){if(_0x432e3d){fs['unlink'](_0x18f8f4);}});}else{return _0x28873c[_0x2803('0x47')](_0x18f8f4,function(_0x14cc62){if(_0x432e3d){fs[_0x2803('0x55')](_0x18f8f4);}});}}})[_0x2803('0x3e')](function(_0xa4b257){if(_0xa4b257[_0x2803('0x56')]===_0x2803('0x53')){_0x28873c[_0x2803('0x18')](0x194)['send'](_0x2803('0x57'));}else{return handleError(_0x28873c,null);}});};exports[_0x2803('0x58')]=function(_0x44f15b,_0x4badd5){return db[_0x2803('0x29')][_0x2803('0x46')]({'where':{'id':_0x44f15b[_0x2803('0x40')]['id']}})['then'](function(_0x2e4fac){if(_[_0x2803('0x59')](_0x2e4fac)){throw new ReferenceError(_0x2803('0x5a'));}return _0x2e4fac;})[_0x2803('0x24')](function(_0x1857cf){var _0x1e1545=_0x1857cf['savePath'];logger[_0x2803('0x5b')](_0x2803('0x5c'),_0x1e1545);if(!_['isNil'](_0x1857cf[_0x2803('0x4b')])&&fs['existsSync'](_0x1e1545)){logger[_0x2803('0x5b')](_0x2803('0x5d')+_0x1e1545+_0x2803('0x5e'));fs[_0x2803('0x5f')](_0x1e1545);}_0x1e1545=_0x1e1545+_0x2803('0x60');if(!_[_0x2803('0x59')](_0x1857cf[_0x2803('0x4b')])&&fs['existsSync'](_0x1e1545)){logger['info'](_0x2803('0x5d')+_0x1e1545+_0x2803('0x5e'));fs['unlinkSync'](_0x1e1545);}return _0x1857cf;})['then'](function(_0x122e25){if(!_0x122e25)throw new InternalError();return _0x122e25['destroy']();})['then'](function(){_0x4badd5[_0x2803('0x18')](0xcc)[_0x2803('0x19')]();})[_0x2803('0x3e')](handleError(_0x4badd5,null));}; \ No newline at end of file +var _0x335c=['format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','VIRTUAL','merge','options','SquareRecording','include','findAll','rows','catch','show','params','length','find','create','update','body','download','../../components/encryptor','uniqueid','savePath','filename'];(function(_0x26fad8,_0x1d1bb0){var _0x5aecf7=function(_0x1a9021){while(--_0x1a9021){_0x26fad8['push'](_0x26fad8['shift']());}};_0x5aecf7(++_0x1d1bb0);}(_0x335c,0x129));var _0xc335=function(_0x2fe368,_0x5266a6){_0x2fe368=_0x2fe368-0x0;var _0x416ff3=_0x335c[_0x2fe368];return _0x416ff3;};'use strict';var emlformat=require(_0xc335('0x0'));var rimraf=require(_0xc335('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc335('0x2'));var rp=require(_0xc335('0x3'));var moment=require(_0xc335('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc335('0x5'));var util=require(_0xc335('0x6'));var path=require(_0xc335('0x7'));var sox=require(_0xc335('0x8'));var csv=require(_0xc335('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc335('0xa'));var _=require(_0xc335('0xb'));var squel=require(_0xc335('0xc'));var crypto=require(_0xc335('0xd'));var jsforce=require(_0xc335('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc335('0x9'));var querystring=require(_0xc335('0xf'));var Papa=require(_0xc335('0x10'));var Redis=require(_0xc335('0x11'));var authService=require(_0xc335('0x12'));var qs=require(_0xc335('0x13'));var as=require(_0xc335('0x14'));var hardwareService=require(_0xc335('0x15'));var logger=require(_0xc335('0x16'))('api');var utils=require(_0xc335('0x17'));var config=require(_0xc335('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6c0ded,_0xac5ee2){_0xac5ee2=_0xac5ee2||0xcc;return function(_0x15a5b8){if(_0x15a5b8){return _0x6c0ded[_0xc335('0x19')](_0xac5ee2);}return _0x6c0ded[_0xc335('0x1a')](_0xac5ee2)[_0xc335('0x1b')]();};}function respondWithResult(_0x472747,_0x36f5f4){_0x36f5f4=_0x36f5f4||0xc8;return function(_0x40c785){if(_0x40c785){return _0x472747[_0xc335('0x1a')](_0x36f5f4)[_0xc335('0x1c')](_0x40c785);}};}function respondWithFilteredResult(_0x50038e,_0x2c73f6){return function(_0x3845e8){if(_0x3845e8){var _0x418030=typeof _0x2c73f6['offset']==='undefined'&&typeof _0x2c73f6['limit']==='undefined';var _0x53a747=_0x3845e8[_0xc335('0x1d')];var _0x6f5965=_0x418030?0x0:_0x2c73f6[_0xc335('0x1e')];var _0x3ae4bd=_0x418030?_0x3845e8[_0xc335('0x1d')]:_0x2c73f6['offset']+_0x2c73f6[_0xc335('0x1f')];var _0x49798a;if(_0x3ae4bd>=_0x53a747){_0x3ae4bd=_0x53a747;_0x49798a=0xc8;}else{_0x49798a=0xce;}_0x50038e[_0xc335('0x1a')](_0x49798a);return _0x50038e[_0xc335('0x20')]('Content-Range',_0x6f5965+'-'+_0x3ae4bd+'/'+_0x53a747)[_0xc335('0x1c')](_0x3845e8);}return null;};}function patchUpdates(_0x16791e){return function(_0x4285a2){try{jsonpatch[_0xc335('0x21')](_0x4285a2,_0x16791e,!![]);}catch(_0x573f98){return BPromise['reject'](_0x573f98);}return _0x4285a2['save']();};}function saveUpdates(_0x2b3c6b,_0x47817f){return function(_0xc5b868){if(_0xc5b868){return _0xc5b868['update'](_0x2b3c6b)['then'](function(_0x1c4922){return _0x1c4922;});}return null;};}function removeEntity(_0x1f09d4,_0x3fbc70){return function(_0x3568c7){if(_0x3568c7){return _0x3568c7[_0xc335('0x22')]()[_0xc335('0x23')](function(){_0x1f09d4[_0xc335('0x1a')](0xcc)[_0xc335('0x1b')]();});}};}function handleEntityNotFound(_0x113288,_0x2f3ee2){return function(_0x4a09b3){if(!_0x4a09b3){_0x113288['sendStatus'](0x194);}return _0x4a09b3;};}function handleError(_0x26cc94,_0x49a5b6){_0x49a5b6=_0x49a5b6||0x1f4;return function(_0x2ef4bd){logger[_0xc335('0x24')](_0x2ef4bd[_0xc335('0x25')]);if(_0x2ef4bd[_0xc335('0x26')]){delete _0x2ef4bd['name'];}_0x26cc94[_0xc335('0x1a')](_0x49a5b6)[_0xc335('0x27')](_0x2ef4bd);};}exports['index']=function(_0x2ce8cc,_0x1d9d88){var _0x23f413={},_0x50b4de={},_0x515f68={'count':0x0,'rows':[]};var _0x231f15=_[_0xc335('0x28')](db['SquareRecording'][_0xc335('0x29')],function(_0x183a70){return{'name':_0x183a70[_0xc335('0x2a')],'type':_0x183a70[_0xc335('0x2b')]['key']};});_0x50b4de[_0xc335('0x2c')]=_[_0xc335('0x28')](_0x231f15,'name');_0x50b4de[_0xc335('0x2d')]=_[_0xc335('0x2e')](_0x2ce8cc[_0xc335('0x2d')]);_0x50b4de[_0xc335('0x2f')]=_[_0xc335('0x30')](_0x50b4de[_0xc335('0x2c')],_0x50b4de[_0xc335('0x2d')]);_0x23f413[_0xc335('0x31')]=_[_0xc335('0x30')](_0x50b4de[_0xc335('0x2c')],qs[_0xc335('0x32')](_0x2ce8cc['query'][_0xc335('0x32')]));_0x23f413['attributes']=_0x23f413[_0xc335('0x31')]['length']?_0x23f413[_0xc335('0x31')]:_0x50b4de[_0xc335('0x2c')];if(!_0x2ce8cc[_0xc335('0x2d')]['hasOwnProperty']('nolimit')){_0x23f413['limit']=qs[_0xc335('0x1f')](_0x2ce8cc[_0xc335('0x2d')][_0xc335('0x1f')]);_0x23f413['offset']=qs[_0xc335('0x1e')](_0x2ce8cc['query'][_0xc335('0x1e')]);}_0x23f413[_0xc335('0x33')]=qs[_0xc335('0x34')](_0x2ce8cc[_0xc335('0x2d')]['sort']);_0x23f413[_0xc335('0x35')]=qs[_0xc335('0x2f')](_['pick'](_0x2ce8cc[_0xc335('0x2d')],_0x50b4de['filters']),_0x231f15);if(_0x2ce8cc['query'][_0xc335('0x36')]){_0x23f413['where']=_['merge'](_0x23f413[_0xc335('0x35')],{'$or':_[_0xc335('0x28')](_0x231f15,function(_0x57472f){if(_0x57472f[_0xc335('0x2b')]!==_0xc335('0x37')){var _0x53c1cb={};_0x53c1cb[_0x57472f[_0xc335('0x26')]]={'$like':'%'+_0x2ce8cc['query'][_0xc335('0x36')]+'%'};return _0x53c1cb;}})});}_0x23f413=_[_0xc335('0x38')]({},_0x23f413,_0x2ce8cc[_0xc335('0x39')]);var _0x164d4e={'where':_0x23f413['where']};return db[_0xc335('0x3a')][_0xc335('0x1d')](_0x164d4e)[_0xc335('0x23')](function(_0x459e1b){_0x515f68[_0xc335('0x1d')]=_0x459e1b;if(_0x2ce8cc[_0xc335('0x2d')]['includeAll']){_0x23f413[_0xc335('0x3b')]=[{'all':!![]}];}return db[_0xc335('0x3a')][_0xc335('0x3c')](_0x23f413);})[_0xc335('0x23')](function(_0x123a4d){_0x515f68[_0xc335('0x3d')]=_0x123a4d;return _0x515f68;})[_0xc335('0x23')](respondWithFilteredResult(_0x1d9d88,_0x23f413))[_0xc335('0x3e')](handleError(_0x1d9d88,null));};exports[_0xc335('0x3f')]=function(_0x1cdfcd,_0x11e0c3){var _0x5402af={'raw':!![],'where':{'id':_0x1cdfcd[_0xc335('0x40')]['id']}},_0xda5c9a={};_0xda5c9a['model']=_[_0xc335('0x2e')](db[_0xc335('0x3a')][_0xc335('0x29')]);_0xda5c9a['query']=_[_0xc335('0x2e')](_0x1cdfcd['query']);_0xda5c9a[_0xc335('0x2f')]=_[_0xc335('0x30')](_0xda5c9a[_0xc335('0x2c')],_0xda5c9a['query']);_0x5402af['attributes']=_[_0xc335('0x30')](_0xda5c9a[_0xc335('0x2c')],qs[_0xc335('0x32')](_0x1cdfcd['query'][_0xc335('0x32')]));_0x5402af[_0xc335('0x31')]=_0x5402af[_0xc335('0x31')][_0xc335('0x41')]?_0x5402af['attributes']:_0xda5c9a['model'];if(_0x1cdfcd[_0xc335('0x2d')]['includeAll']){_0x5402af['include']=[{'all':!![]}];}_0x5402af=_[_0xc335('0x38')]({},_0x5402af,_0x1cdfcd[_0xc335('0x39')]);return db['SquareRecording'][_0xc335('0x42')](_0x5402af)[_0xc335('0x23')](handleEntityNotFound(_0x11e0c3,null))[_0xc335('0x23')](respondWithResult(_0x11e0c3,null))[_0xc335('0x3e')](handleError(_0x11e0c3,null));};exports[_0xc335('0x43')]=function(_0x3e9857,_0x4b3d1f){return db[_0xc335('0x3a')][_0xc335('0x43')](_0x3e9857['body'],{})[_0xc335('0x23')](respondWithResult(_0x4b3d1f,0xc9))[_0xc335('0x3e')](handleError(_0x4b3d1f,null));};exports[_0xc335('0x44')]=function(_0x13fd66,_0x21a599){if(_0x13fd66[_0xc335('0x45')]['id']){delete _0x13fd66[_0xc335('0x45')]['id'];}return db[_0xc335('0x3a')][_0xc335('0x42')]({'where':{'id':_0x13fd66[_0xc335('0x40')]['id']}})['then'](handleEntityNotFound(_0x21a599,null))[_0xc335('0x23')](saveUpdates(_0x13fd66['body'],null))['then'](respondWithResult(_0x21a599,null))[_0xc335('0x3e')](handleError(_0x21a599,null));};exports[_0xc335('0x46')]=function(_0x29d672,_0x15fb92,_0x4c18cc){var _0x1da661=require(_0xc335('0x47'));var _0x54f437=![];var _0x38df47={};if(_0x29d672[_0xc335('0x2d')][_0xc335('0x2b')]&&_0x29d672[_0xc335('0x2d')][_0xc335('0x2b')]===_0xc335('0x48')){_0x38df47[_0xc335('0x48')]=_0x29d672[_0xc335('0x40')]['id'];}else{_0x38df47['id']=_0x29d672[_0xc335('0x40')]['id'];}return db[_0xc335('0x3a')][_0xc335('0x42')]({'where':_0x38df47,'attributes':['id',_0xc335('0x49'),_0xc335('0x4a')],'raw':!![]})[_0xc335('0x23')](handleEntityNotFound(_0x15fb92,null))[_0xc335('0x23')](function(_0xd878a){if(_0xd878a){var _0x3aaf00=_0xd878a[_0xc335('0x49')];var _0x39832c=util[_0xc335('0x4b')](_0xc335('0x4c'),_0x3aaf00);if(fs[_0xc335('0x4d')](_0x39832c)){_0x54f437=!![];return _0x1da661[_0xc335('0x4e')](_0x39832c,_0x3aaf00,config[_0xc335('0x4f')][_0xc335('0x50')])[_0xc335('0x23')](function(){return _0xd878a;});}return _0xd878a;}})[_0xc335('0x23')](function(_0x507aa5){if(_0x507aa5){var _0x31dcfc=_0x507aa5[_0xc335('0x49')];if(!fs[_0xc335('0x4d')](_0x31dcfc)){throw new db[(_0xc335('0x51'))][(_0xc335('0x52'))]('SquareRecording\x20not\x20found');}if(_0x507aa5[_0xc335('0x4a')]){return _0x15fb92['download'](_0x31dcfc,_0x507aa5[_0xc335('0x4a')]+path[_0xc335('0x53')](_0x31dcfc),function(){if(_0x54f437){fs['unlink'](_0x31dcfc);}});}else{return _0x15fb92['download'](_0x31dcfc,function(_0x1324bc){if(_0x54f437){fs[_0xc335('0x54')](_0x31dcfc);}});}}})[_0xc335('0x3e')](function(_0x5d424f){if(_0x5d424f['message']==='SquareRecording\x20not\x20found'){_0x15fb92[_0xc335('0x1a')](0x194)['send'](_0xc335('0x55'));}else{return handleError(_0x15fb92,null);}});};exports[_0xc335('0x22')]=function(_0x158112,_0x1dff8f){return db[_0xc335('0x3a')][_0xc335('0x42')]({'where':{'id':_0x158112[_0xc335('0x40')]['id']}})[_0xc335('0x23')](function(_0x4393e1){if(_[_0xc335('0x56')](_0x4393e1)){throw new ReferenceError(_0xc335('0x57'));}return _0x4393e1;})[_0xc335('0x23')](function(_0x211fbf){var _0x16fe80=_0x211fbf[_0xc335('0x49')];logger[_0xc335('0x58')](_0xc335('0x59'),_0x16fe80);if(!_[_0xc335('0x56')](_0x211fbf[_0xc335('0x49')])&&fs[_0xc335('0x4d')](_0x16fe80)){logger[_0xc335('0x58')](_0xc335('0x5a')+_0x16fe80+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc335('0x5b')](_0x16fe80);}_0x16fe80=_0x16fe80+'.cypher';if(!_[_0xc335('0x56')](_0x211fbf[_0xc335('0x49')])&&fs['existsSync'](_0x16fe80)){logger[_0xc335('0x58')]('File:\x20\x22'+_0x16fe80+_0xc335('0x5c'));fs[_0xc335('0x5b')](_0x16fe80);}return _0x211fbf;})['then'](function(_0x2c50e8){if(!_0x2c50e8)throw new InternalError();return _0x2c50e8['destroy']();})['then'](function(){_0x1dff8f[_0xc335('0x1a')](0xcc)[_0xc335('0x1b')]();})[_0xc335('0x3e')](handleError(_0x1dff8f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 51046fb..160bcd2 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 _0xa786=['exports','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x5dcb3d,_0x2f2d1e){var _0x4fa1d4=function(_0x34f438){while(--_0x34f438){_0x5dcb3d['push'](_0x5dcb3d['shift']());}};_0x4fa1d4(++_0x2f2d1e);}(_0xa786,0x71));var _0x6a78=function(_0x10779b,_0x213d4e){_0x10779b=_0x10779b-0x0;var _0xa6b619=_0xa786[_0x10779b];return _0xa6b619;};'use strict';var _=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var logger=require(_0x6a78('0x2'))('api');var moment=require(_0x6a78('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a78('0x4'));var rimraf=require(_0x6a78('0x5'));var config=require(_0x6a78('0x6'));var attributes=require(_0x6a78('0x7'));module[_0x6a78('0x8')]=function(_0x112e35,_0x386861){return _0x112e35['define'](_0x6a78('0x9'),attributes,{'tableName':_0x6a78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x419f=['api','moment','bluebird','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x419f,0x176));var _0xf419=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x419f[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var logger=require(_0xf419('0x2'))(_0xf419('0x3'));var moment=require(_0xf419('0x4'));var BPromise=require(_0xf419('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf419('0x6'));var rimraf=require('rimraf');var config=require(_0xf419('0x7'));var attributes=require(_0xf419('0x8'));module[_0xf419('0x9')]=function(_0x38f2fa,_0x2d8430){return _0x38f2fa[_0xf419('0xa')](_0xf419('0xb'),attributes,{'tableName':_0xf419('0xc'),'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 2e7aa5f..143e9e1 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 _0x8baf=['jayson/promise','client','http','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SquareRecording','create','body','options','then','CreateSquareRecording','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x55e2a8,_0x3baf04){var _0x28e07a=function(_0x131abe){while(--_0x131abe){_0x55e2a8['push'](_0x55e2a8['shift']());}};_0x28e07a(++_0x3baf04);}(_0x8baf,0xd7));var _0xf8ba=function(_0x74741a,_0x18c22f){_0x74741a=_0x74741a-0x0;var _0x28d8d6=_0x8baf[_0x74741a];return _0x28d8d6;};'use strict';var _=require(_0xf8ba('0x0'));var util=require(_0xf8ba('0x1'));var moment=require(_0xf8ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8ba('0x3'));var fs=require('fs');var Redis=require(_0xf8ba('0x4'));var db=require(_0xf8ba('0x5'))['db'];var utils=require(_0xf8ba('0x6'));var logger=require(_0xf8ba('0x7'))('rpc');var config=require(_0xf8ba('0x8'));var jayson=require(_0xf8ba('0x9'));var client=jayson[_0xf8ba('0xa')][_0xf8ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34c07a,_0x492d2a,_0x323b8c){return new BPromise(function(_0x25cb04,_0x15c7ed){return client['request'](_0x34c07a,_0x323b8c)['then'](function(_0x258d3a){logger[_0xf8ba('0xc')](_0xf8ba('0xd'),_0x492d2a,_0xf8ba('0xe'));logger[_0xf8ba('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x492d2a,'request\x20sent',JSON[_0xf8ba('0x10')](_0x258d3a));if(_0x258d3a[_0xf8ba('0x11')]){if(_0x258d3a[_0xf8ba('0x11')][_0xf8ba('0x12')]===0x1f4){logger[_0xf8ba('0x11')](_0xf8ba('0xd'),_0x492d2a,_0x258d3a[_0xf8ba('0x11')]['message']);return _0x15c7ed(_0x258d3a[_0xf8ba('0x11')]['message']);}logger[_0xf8ba('0x11')](_0xf8ba('0xd'),_0x492d2a,_0x258d3a[_0xf8ba('0x11')][_0xf8ba('0x13')]);return _0x25cb04(_0x258d3a[_0xf8ba('0x11')][_0xf8ba('0x13')]);}else{logger[_0xf8ba('0xc')](_0xf8ba('0xd'),_0x492d2a,_0xf8ba('0xe'));_0x25cb04(_0x258d3a[_0xf8ba('0x14')][_0xf8ba('0x13')]);}})[_0xf8ba('0x15')](function(_0x287558){logger[_0xf8ba('0x11')](_0xf8ba('0xd'),_0x492d2a,_0x287558);_0x15c7ed(_0x287558);});});}exports['CreateSquareRecording']=function(_0x595729){var _0x315e37=this;return new Promise(function(_0x2edea8,_0x56699f){return db[_0xf8ba('0x16')][_0xf8ba('0x17')](_0x595729[_0xf8ba('0x18')],{'raw':_0x595729[_0xf8ba('0x19')]?_0x595729['options']['raw']===undefined?!![]:![]:!![]})[_0xf8ba('0x1a')](function(_0x2b650e){logger[_0xf8ba('0xc')](_0xf8ba('0x1b'),_0x595729);logger['debug'](_0xf8ba('0x1b'),_0x595729,JSON[_0xf8ba('0x10')](_0x2b650e));_0x2edea8(_0x2b650e);})['catch'](function(_0xbee9bd){logger['error'](_0xf8ba('0x1b'),_0xbee9bd['message'],_0x595729);_0x56699f(_0x315e37[_0xf8ba('0x11')](0x1f4,_0xbee9bd[_0xf8ba('0x13')]));});});}; \ No newline at end of file +var _0x7773=['ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','options','CreateSquareRecording','lodash','util','moment','bluebird'];(function(_0x3225cb,_0x178465){var _0xdb318=function(_0x3ae7b1){while(--_0x3ae7b1){_0x3225cb['push'](_0x3225cb['shift']());}};_0xdb318(++_0x178465);}(_0x7773,0x74));var _0x3777=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7773[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3777('0x0'));var util=require(_0x3777('0x1'));var moment=require(_0x3777('0x2'));var BPromise=require(_0x3777('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3777('0x4'));var db=require(_0x3777('0x5'))['db'];var utils=require(_0x3777('0x6'));var logger=require('../../config/logger')(_0x3777('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3777('0x8')][_0x3777('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1612de,_0x5e2fa4,_0x2dac02){return new BPromise(function(_0x5c19df,_0x3b6fc7){return client[_0x3777('0xa')](_0x1612de,_0x2dac02)[_0x3777('0xb')](function(_0x28e2ad){logger['info'](_0x3777('0xc'),_0x5e2fa4,_0x3777('0xd'));logger[_0x3777('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5e2fa4,_0x3777('0xd'),JSON[_0x3777('0xf')](_0x28e2ad));if(_0x28e2ad[_0x3777('0x10')]){if(_0x28e2ad[_0x3777('0x10')][_0x3777('0x11')]===0x1f4){logger['error'](_0x3777('0xc'),_0x5e2fa4,_0x28e2ad[_0x3777('0x10')][_0x3777('0x12')]);return _0x3b6fc7(_0x28e2ad[_0x3777('0x10')]['message']);}logger['error'](_0x3777('0xc'),_0x5e2fa4,_0x28e2ad[_0x3777('0x10')][_0x3777('0x12')]);return _0x5c19df(_0x28e2ad[_0x3777('0x10')][_0x3777('0x12')]);}else{logger[_0x3777('0x13')](_0x3777('0xc'),_0x5e2fa4,_0x3777('0xd'));_0x5c19df(_0x28e2ad[_0x3777('0x14')][_0x3777('0x12')]);}})[_0x3777('0x15')](function(_0x2ebfcc){logger[_0x3777('0x10')](_0x3777('0xc'),_0x5e2fa4,_0x2ebfcc);_0x3b6fc7(_0x2ebfcc);});});}exports['CreateSquareRecording']=function(_0x3c8166){var _0xf1f328=this;return new Promise(function(_0x37c3d4,_0x5898e1){return db['SquareRecording']['create'](_0x3c8166['body'],{'raw':_0x3c8166[_0x3777('0x16')]?_0x3c8166[_0x3777('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1227ed){logger[_0x3777('0x13')]('CreateSquareRecording',_0x3c8166);logger[_0x3777('0xe')](_0x3777('0x17'),_0x3c8166,JSON[_0x3777('0xf')](_0x1227ed));_0x37c3d4(_0x1227ed);})[_0x3777('0x15')](function(_0x32e4f3){logger[_0x3777('0x10')](_0x3777('0x17'),_0x32e4f3['message'],_0x3c8166);_0x5898e1(_0xf1f328[_0x3777('0x10')](0x1f4,_0x32e4f3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 5baebc3..1a6e1ed 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x426ab0,_0x13c67d){var _0x3bdb3d=function(_0x14f669){while(--_0x14f669){_0x426ab0['push'](_0x426ab0['shift']());}};_0x3bdb3d(++_0x13c67d);}(_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 5068dad..aff9c19 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 _0x3f9b=['BOOLEAN','STRING','DATE'];(function(_0x55c528,_0x33bb3e){var _0x2f36d8=function(_0xaa332f){while(--_0xaa332f){_0x55c528['push'](_0x55c528['shift']());}};_0x2f36d8(++_0x33bb3e);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x88266c,_0x1151ec){_0x88266c=_0x88266c-0x0;var _0xa76dc1=_0x3f9b[_0x88266c];return _0xa76dc1;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xb3f9('0x0')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xb3f9('0x0')]},'channel':{'type':Sequelize[_0xb3f9('0x0')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xb3f9('0x0')]},'callerid':{'type':Sequelize[_0xb3f9('0x0')]},'calleridname':{'type':Sequelize[_0xb3f9('0x0')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xb3f9('0x0')]},'callington':{'type':Sequelize[_0xb3f9('0x0')]},'callingtns':{'type':Sequelize[_0xb3f9('0x0')]},'dnid':{'type':Sequelize[_0xb3f9('0x0')]},'rdnis':{'type':Sequelize[_0xb3f9('0x0')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb3f9('0x0')]},'enhanced':{'type':Sequelize[_0xb3f9('0x0')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb3f9('0x0')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb3f9('0x1')]},'bot':{'type':Sequelize[_0xb3f9('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xcaab=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0xac6c59,_0x2f440b){var _0x197629=function(_0x66a5e5){while(--_0x66a5e5){_0xac6c59['push'](_0xac6c59['shift']());}};_0x197629(++_0x2f440b);}(_0xcaab,0x115));var _0xbcaa=function(_0x504ee1,_0x16f27f){_0x504ee1=_0x504ee1-0x0;var _0x5e230f=_0xcaab[_0x504ee1];return _0x5e230f;};'use strict';var Sequelize=require(_0xbcaa('0x0'));module[_0xbcaa('0x1')]={'network':{'type':Sequelize[_0xbcaa('0x2')]},'network_script':{'type':Sequelize[_0xbcaa('0x2')]},'request':{'type':Sequelize[_0xbcaa('0x2')]},'channel':{'type':Sequelize[_0xbcaa('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbcaa('0x2')]},'uniqueid':{'type':Sequelize[_0xbcaa('0x2')]},'version':{'type':Sequelize[_0xbcaa('0x2')]},'callerid':{'type':Sequelize[_0xbcaa('0x2')]},'calleridname':{'type':Sequelize[_0xbcaa('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xbcaa('0x2')]},'callington':{'type':Sequelize[_0xbcaa('0x2')]},'callingtns':{'type':Sequelize[_0xbcaa('0x2')]},'dnid':{'type':Sequelize[_0xbcaa('0x2')]},'rdnis':{'type':Sequelize[_0xbcaa('0x2')]},'context':{'type':Sequelize[_0xbcaa('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbcaa('0x2')]},'enhanced':{'type':Sequelize[_0xbcaa('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xbcaa('0x2')]},'project_name':{'type':Sequelize[_0xbcaa('0x2')]},'joinAt':{'type':Sequelize[_0xbcaa('0x3')]},'leaveAt':{'type':Sequelize[_0xbcaa('0x3')]},'bot':{'type':Sequelize[_0xbcaa('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 9ea4876..c2217ca 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 _0x6ec9=['limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SquareReport','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count'];(function(_0x2baddd,_0x278938){var _0x568547=function(_0x1c002f){while(--_0x1c002f){_0x2baddd['push'](_0x2baddd['shift']());}};_0x568547(++_0x278938);}(_0x6ec9,0xbb));var _0x96ec=function(_0x572690,_0x4f3410){_0x572690=_0x572690-0x0;var _0x13222c=_0x6ec9[_0x572690];return _0x13222c;};'use strict';var emlformat=require(_0x96ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x96ec('0x1'));var rp=require(_0x96ec('0x2'));var moment=require('moment');var BPromise=require(_0x96ec('0x3'));var Mustache=require(_0x96ec('0x4'));var util=require('util');var path=require(_0x96ec('0x5'));var sox=require(_0x96ec('0x6'));var csv=require(_0x96ec('0x7'));var ejs=require(_0x96ec('0x8'));var fs=require('fs');var fs_extra=require(_0x96ec('0x9'));var _=require('lodash');var squel=require(_0x96ec('0xa'));var crypto=require(_0x96ec('0xb'));var jsforce=require(_0x96ec('0xc'));var deskjs=require(_0x96ec('0xd'));var toCsv=require(_0x96ec('0x7'));var querystring=require('querystring');var Papa=require(_0x96ec('0xe'));var Redis=require('ioredis');var authService=require(_0x96ec('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x96ec('0x10'));var hardwareService=require(_0x96ec('0x11'));var logger=require(_0x96ec('0x12'))(_0x96ec('0x13'));var utils=require(_0x96ec('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x96ec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14c751,_0x146fb6){_0x146fb6=_0x146fb6||0xcc;return function(_0x571801){if(_0x571801){return _0x14c751[_0x96ec('0x16')](_0x146fb6);}return _0x14c751[_0x96ec('0x17')](_0x146fb6)[_0x96ec('0x18')]();};}function respondWithResult(_0x57a7ba,_0x193f0d){_0x193f0d=_0x193f0d||0xc8;return function(_0x8c44cb){if(_0x8c44cb){return _0x57a7ba[_0x96ec('0x17')](_0x193f0d)[_0x96ec('0x19')](_0x8c44cb);}};}function respondWithFilteredResult(_0x476cc0,_0x380885){return function(_0x526619){if(_0x526619){var _0x2e17b1=typeof _0x380885[_0x96ec('0x1a')]===_0x96ec('0x1b')&&typeof _0x380885['limit']==='undefined';var _0x14eb2c=_0x526619[_0x96ec('0x1c')];var _0x17c2e4=_0x2e17b1?0x0:_0x380885[_0x96ec('0x1a')];var _0x1da075=_0x2e17b1?_0x526619['count']:_0x380885['offset']+_0x380885[_0x96ec('0x1d')];var _0x13c759;if(_0x1da075>=_0x14eb2c){_0x1da075=_0x14eb2c;_0x13c759=0xc8;}else{_0x13c759=0xce;}_0x476cc0[_0x96ec('0x17')](_0x13c759);return _0x476cc0[_0x96ec('0x1e')](_0x96ec('0x1f'),_0x17c2e4+'-'+_0x1da075+'/'+_0x14eb2c)[_0x96ec('0x19')](_0x526619);}return null;};}function patchUpdates(_0x172394){return function(_0x5a532f){try{jsonpatch[_0x96ec('0x20')](_0x5a532f,_0x172394,!![]);}catch(_0x552f15){return BPromise['reject'](_0x552f15);}return _0x5a532f[_0x96ec('0x21')]();};}function saveUpdates(_0x239395,_0x38cdef){return function(_0x4427c2){if(_0x4427c2){return _0x4427c2[_0x96ec('0x22')](_0x239395)[_0x96ec('0x23')](function(_0x1e424e){return _0x1e424e;});}return null;};}function removeEntity(_0x164dfd,_0x10778b){return function(_0x288cbb){if(_0x288cbb){return _0x288cbb[_0x96ec('0x24')]()[_0x96ec('0x23')](function(){_0x164dfd[_0x96ec('0x17')](0xcc)[_0x96ec('0x18')]();});}};}function handleEntityNotFound(_0x25e3c9,_0x3e4099){return function(_0x1ef784){if(!_0x1ef784){_0x25e3c9[_0x96ec('0x16')](0x194);}return _0x1ef784;};}function handleError(_0xbf59fc,_0x4be2b2){_0x4be2b2=_0x4be2b2||0x1f4;return function(_0x3cfea1){logger['error'](_0x3cfea1[_0x96ec('0x25')]);if(_0x3cfea1[_0x96ec('0x26')]){delete _0x3cfea1['name'];}_0xbf59fc[_0x96ec('0x17')](_0x4be2b2)[_0x96ec('0x27')](_0x3cfea1);};}exports[_0x96ec('0x28')]=function(_0xa5c3f0,_0x4eb474){var _0x4acd23={},_0x45caf4={},_0x284317={'count':0x0,'rows':[]};var _0x3efe52=_[_0x96ec('0x29')](db[_0x96ec('0x2a')]['rawAttributes'],function(_0x4ce061){return{'name':_0x4ce061[_0x96ec('0x2b')],'type':_0x4ce061['type']['key']};});_0x45caf4[_0x96ec('0x2c')]=_[_0x96ec('0x29')](_0x3efe52,_0x96ec('0x26'));_0x45caf4[_0x96ec('0x2d')]=_[_0x96ec('0x2e')](_0xa5c3f0['query']);_0x45caf4['filters']=_['intersection'](_0x45caf4[_0x96ec('0x2c')],_0x45caf4[_0x96ec('0x2d')]);_0x4acd23['attributes']=_[_0x96ec('0x2f')](_0x45caf4['model'],qs[_0x96ec('0x30')](_0xa5c3f0[_0x96ec('0x2d')]['fields']));_0x4acd23[_0x96ec('0x31')]=_0x4acd23['attributes'][_0x96ec('0x32')]?_0x4acd23['attributes']:_0x45caf4[_0x96ec('0x2c')];if(!_0xa5c3f0['query'][_0x96ec('0x33')](_0x96ec('0x34'))){_0x4acd23[_0x96ec('0x1d')]=qs[_0x96ec('0x1d')](_0xa5c3f0[_0x96ec('0x2d')][_0x96ec('0x1d')]);_0x4acd23[_0x96ec('0x1a')]=qs[_0x96ec('0x1a')](_0xa5c3f0[_0x96ec('0x2d')][_0x96ec('0x1a')]);}_0x4acd23['order']=qs[_0x96ec('0x35')](_0xa5c3f0['query'][_0x96ec('0x35')]);_0x4acd23['where']=qs[_0x96ec('0x36')](_[_0x96ec('0x37')](_0xa5c3f0[_0x96ec('0x2d')],_0x45caf4[_0x96ec('0x36')]),_0x3efe52);if(_0xa5c3f0[_0x96ec('0x2d')][_0x96ec('0x38')]){_0x4acd23['where']=_['merge'](_0x4acd23['where'],{'$or':_['map'](_0x3efe52,function(_0x2974ee){if(_0x2974ee[_0x96ec('0x39')]!==_0x96ec('0x3a')){var _0x3be924={};_0x3be924[_0x2974ee[_0x96ec('0x26')]]={'$like':'%'+_0xa5c3f0[_0x96ec('0x2d')][_0x96ec('0x38')]+'%'};return _0x3be924;}})});}_0x4acd23=_[_0x96ec('0x3b')]({},_0x4acd23,_0xa5c3f0[_0x96ec('0x3c')]);var _0x48f89c={'where':_0x4acd23[_0x96ec('0x3d')]};return db['SquareReport']['count'](_0x48f89c)[_0x96ec('0x23')](function(_0x27b330){_0x284317[_0x96ec('0x1c')]=_0x27b330;if(_0xa5c3f0[_0x96ec('0x2d')][_0x96ec('0x3e')]){_0x4acd23[_0x96ec('0x3f')]=[{'all':!![]}];}return db[_0x96ec('0x2a')][_0x96ec('0x40')](_0x4acd23);})[_0x96ec('0x23')](function(_0x4d1f25){_0x284317['rows']=_0x4d1f25;return _0x284317;})[_0x96ec('0x23')](respondWithFilteredResult(_0x4eb474,_0x4acd23))[_0x96ec('0x41')](handleError(_0x4eb474,null));};exports[_0x96ec('0x42')]=function(_0x5f3675,_0x59b677){var _0x249c34={'raw':!![],'where':{'id':_0x5f3675[_0x96ec('0x43')]['id']}},_0x1c86f7={};_0x1c86f7[_0x96ec('0x2c')]=_[_0x96ec('0x2e')](db[_0x96ec('0x2a')]['rawAttributes']);_0x1c86f7[_0x96ec('0x2d')]=_['keys'](_0x5f3675['query']);_0x1c86f7[_0x96ec('0x36')]=_['intersection'](_0x1c86f7[_0x96ec('0x2c')],_0x1c86f7[_0x96ec('0x2d')]);_0x249c34[_0x96ec('0x31')]=_[_0x96ec('0x2f')](_0x1c86f7[_0x96ec('0x2c')],qs[_0x96ec('0x30')](_0x5f3675['query'][_0x96ec('0x30')]));_0x249c34[_0x96ec('0x31')]=_0x249c34[_0x96ec('0x31')][_0x96ec('0x32')]?_0x249c34[_0x96ec('0x31')]:_0x1c86f7[_0x96ec('0x2c')];if(_0x5f3675[_0x96ec('0x2d')]['includeAll']){_0x249c34[_0x96ec('0x3f')]=[{'all':!![]}];}_0x249c34=_[_0x96ec('0x3b')]({},_0x249c34,_0x5f3675['options']);return db[_0x96ec('0x2a')][_0x96ec('0x44')](_0x249c34)[_0x96ec('0x23')](handleEntityNotFound(_0x59b677,null))[_0x96ec('0x23')](respondWithResult(_0x59b677,null))[_0x96ec('0x41')](handleError(_0x59b677,null));};exports[_0x96ec('0x45')]=function(_0xbf735a,_0xfcb7c3){return db[_0x96ec('0x2a')][_0x96ec('0x45')](_0xbf735a[_0x96ec('0x46')],{})[_0x96ec('0x23')](respondWithResult(_0xfcb7c3,0xc9))[_0x96ec('0x41')](handleError(_0xfcb7c3,null));};exports['update']=function(_0x4510f8,_0x1902d8){if(_0x4510f8[_0x96ec('0x46')]['id']){delete _0x4510f8[_0x96ec('0x46')]['id'];}return db['SquareReport'][_0x96ec('0x44')]({'where':{'id':_0x4510f8[_0x96ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x1902d8,null))['then'](saveUpdates(_0x4510f8[_0x96ec('0x46')],null))[_0x96ec('0x23')](respondWithResult(_0x1902d8,null))['catch'](handleError(_0x1902d8,null));};exports[_0x96ec('0x24')]=function(_0x1df0d9,_0x5f24e8){return db[_0x96ec('0x2a')][_0x96ec('0x44')]({'where':{'id':_0x1df0d9['params']['id']}})[_0x96ec('0x23')](handleEntityNotFound(_0x5f24e8,null))['then'](removeEntity(_0x5f24e8,null))[_0x96ec('0x41')](handleError(_0x5f24e8,null));};exports[_0x96ec('0x47')]=function(_0x380968,_0x4dc7df){return db[_0x96ec('0x2a')][_0x96ec('0x47')]()[_0x96ec('0x23')](respondWithResult(_0x4dc7df,null))[_0x96ec('0x41')](handleError(_0x4dc7df,null));}; \ No newline at end of file +var _0x41ba=['merge','VIRTUAL','options','includeAll','rows','catch','show','include','create','body','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SquareReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0xae9e83,_0x1b6a05){var _0x3ea8ff=function(_0x31016a){while(--_0x31016a){_0xae9e83['push'](_0xae9e83['shift']());}};_0x3ea8ff(++_0x1b6a05);}(_0x41ba,0x1db));var _0xa41b=function(_0x451508,_0x1c1d59){_0x451508=_0x451508-0x0;var _0x35db65=_0x41ba[_0x451508];return _0x35db65;};'use strict';var emlformat=require(_0xa41b('0x0'));var rimraf=require(_0xa41b('0x1'));var zipdir=require(_0xa41b('0x2'));var jsonpatch=require(_0xa41b('0x3'));var rp=require('request-promise');var moment=require(_0xa41b('0x4'));var BPromise=require(_0xa41b('0x5'));var Mustache=require('mustache');var util=require(_0xa41b('0x6'));var path=require('path');var sox=require(_0xa41b('0x7'));var csv=require('to-csv');var ejs=require(_0xa41b('0x8'));var fs=require('fs');var fs_extra=require(_0xa41b('0x9'));var _=require(_0xa41b('0xa'));var squel=require(_0xa41b('0xb'));var crypto=require('crypto');var jsforce=require(_0xa41b('0xc'));var deskjs=require(_0xa41b('0xd'));var toCsv=require(_0xa41b('0xe'));var querystring=require(_0xa41b('0xf'));var Papa=require(_0xa41b('0x10'));var Redis=require(_0xa41b('0x11'));var authService=require(_0xa41b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa41b('0x13'));var hardwareService=require(_0xa41b('0x14'));var logger=require('../../config/logger')(_0xa41b('0x15'));var utils=require(_0xa41b('0x16'));var config=require(_0xa41b('0x17'));var licenseUtil=require(_0xa41b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf0c91c,_0x40b14b){_0x40b14b=_0x40b14b||0xcc;return function(_0x105c8d){if(_0x105c8d){return _0xf0c91c[_0xa41b('0x19')](_0x40b14b);}return _0xf0c91c[_0xa41b('0x1a')](_0x40b14b)[_0xa41b('0x1b')]();};}function respondWithResult(_0x3373b4,_0x2f18c9){_0x2f18c9=_0x2f18c9||0xc8;return function(_0x455166){if(_0x455166){return _0x3373b4[_0xa41b('0x1a')](_0x2f18c9)[_0xa41b('0x1c')](_0x455166);}};}function respondWithFilteredResult(_0x38689c,_0x56c075){return function(_0x5ef13c){if(_0x5ef13c){var _0x57402f=typeof _0x56c075['offset']==='undefined'&&typeof _0x56c075[_0xa41b('0x1d')]===_0xa41b('0x1e');var _0x401607=_0x5ef13c[_0xa41b('0x1f')];var _0x2a9826=_0x57402f?0x0:_0x56c075[_0xa41b('0x20')];var _0x4fd8eb=_0x57402f?_0x5ef13c[_0xa41b('0x1f')]:_0x56c075[_0xa41b('0x20')]+_0x56c075[_0xa41b('0x1d')];var _0xce004f;if(_0x4fd8eb>=_0x401607){_0x4fd8eb=_0x401607;_0xce004f=0xc8;}else{_0xce004f=0xce;}_0x38689c[_0xa41b('0x1a')](_0xce004f);return _0x38689c[_0xa41b('0x21')](_0xa41b('0x22'),_0x2a9826+'-'+_0x4fd8eb+'/'+_0x401607)[_0xa41b('0x1c')](_0x5ef13c);}return null;};}function patchUpdates(_0x169266){return function(_0x602a4e){try{jsonpatch[_0xa41b('0x23')](_0x602a4e,_0x169266,!![]);}catch(_0x1decc8){return BPromise[_0xa41b('0x24')](_0x1decc8);}return _0x602a4e[_0xa41b('0x25')]();};}function saveUpdates(_0x5be0b1,_0x178723){return function(_0x3b3019){if(_0x3b3019){return _0x3b3019[_0xa41b('0x26')](_0x5be0b1)[_0xa41b('0x27')](function(_0x44f287){return _0x44f287;});}return null;};}function removeEntity(_0x1d955d,_0x9036d2){return function(_0x2c8bc0){if(_0x2c8bc0){return _0x2c8bc0[_0xa41b('0x28')]()[_0xa41b('0x27')](function(){_0x1d955d['status'](0xcc)[_0xa41b('0x1b')]();});}};}function handleEntityNotFound(_0x2b7590,_0x4dbd27){return function(_0x2d8aae){if(!_0x2d8aae){_0x2b7590[_0xa41b('0x19')](0x194);}return _0x2d8aae;};}function handleError(_0x3cf211,_0x22c9a7){_0x22c9a7=_0x22c9a7||0x1f4;return function(_0x2d76d3){logger[_0xa41b('0x29')](_0x2d76d3[_0xa41b('0x2a')]);if(_0x2d76d3[_0xa41b('0x2b')]){delete _0x2d76d3['name'];}_0x3cf211[_0xa41b('0x1a')](_0x22c9a7)['send'](_0x2d76d3);};}exports[_0xa41b('0x2c')]=function(_0x5d2d59,_0x39a551){var _0x3cdeec={},_0xb55c67={},_0x55557a={'count':0x0,'rows':[]};var _0x4e874b=_['map'](db[_0xa41b('0x2d')][_0xa41b('0x2e')],function(_0x1cb97d){return{'name':_0x1cb97d[_0xa41b('0x2f')],'type':_0x1cb97d[_0xa41b('0x30')]['key']};});_0xb55c67[_0xa41b('0x31')]=_[_0xa41b('0x32')](_0x4e874b,_0xa41b('0x2b'));_0xb55c67[_0xa41b('0x33')]=_[_0xa41b('0x34')](_0x5d2d59[_0xa41b('0x33')]);_0xb55c67[_0xa41b('0x35')]=_[_0xa41b('0x36')](_0xb55c67[_0xa41b('0x31')],_0xb55c67['query']);_0x3cdeec[_0xa41b('0x37')]=_[_0xa41b('0x36')](_0xb55c67[_0xa41b('0x31')],qs['fields'](_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x38')]));_0x3cdeec['attributes']=_0x3cdeec[_0xa41b('0x37')][_0xa41b('0x39')]?_0x3cdeec[_0xa41b('0x37')]:_0xb55c67['model'];if(!_0x5d2d59['query'][_0xa41b('0x3a')](_0xa41b('0x3b'))){_0x3cdeec[_0xa41b('0x1d')]=qs['limit'](_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x1d')]);_0x3cdeec[_0xa41b('0x20')]=qs[_0xa41b('0x20')](_0x5d2d59['query'][_0xa41b('0x20')]);}_0x3cdeec[_0xa41b('0x3c')]=qs['sort'](_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x3d')]);_0x3cdeec[_0xa41b('0x3e')]=qs[_0xa41b('0x35')](_['pick'](_0x5d2d59[_0xa41b('0x33')],_0xb55c67['filters']),_0x4e874b);if(_0x5d2d59[_0xa41b('0x33')][_0xa41b('0x3f')]){_0x3cdeec[_0xa41b('0x3e')]=_[_0xa41b('0x40')](_0x3cdeec[_0xa41b('0x3e')],{'$or':_['map'](_0x4e874b,function(_0x538d85){if(_0x538d85[_0xa41b('0x30')]!==_0xa41b('0x41')){var _0x1a2b35={};_0x1a2b35[_0x538d85['name']]={'$like':'%'+_0x5d2d59[_0xa41b('0x33')]['filter']+'%'};return _0x1a2b35;}})});}_0x3cdeec=_[_0xa41b('0x40')]({},_0x3cdeec,_0x5d2d59[_0xa41b('0x42')]);var _0x520390={'where':_0x3cdeec[_0xa41b('0x3e')]};return db[_0xa41b('0x2d')][_0xa41b('0x1f')](_0x520390)[_0xa41b('0x27')](function(_0xcb720e){_0x55557a[_0xa41b('0x1f')]=_0xcb720e;if(_0x5d2d59['query'][_0xa41b('0x43')]){_0x3cdeec['include']=[{'all':!![]}];}return db[_0xa41b('0x2d')]['findAll'](_0x3cdeec);})['then'](function(_0x439c39){_0x55557a[_0xa41b('0x44')]=_0x439c39;return _0x55557a;})[_0xa41b('0x27')](respondWithFilteredResult(_0x39a551,_0x3cdeec))[_0xa41b('0x45')](handleError(_0x39a551,null));};exports[_0xa41b('0x46')]=function(_0x5be644,_0x58e4ce){var _0x549d52={'raw':!![],'where':{'id':_0x5be644['params']['id']}},_0x4615a9={};_0x4615a9[_0xa41b('0x31')]=_[_0xa41b('0x34')](db[_0xa41b('0x2d')][_0xa41b('0x2e')]);_0x4615a9['query']=_[_0xa41b('0x34')](_0x5be644[_0xa41b('0x33')]);_0x4615a9['filters']=_[_0xa41b('0x36')](_0x4615a9[_0xa41b('0x31')],_0x4615a9[_0xa41b('0x33')]);_0x549d52['attributes']=_[_0xa41b('0x36')](_0x4615a9[_0xa41b('0x31')],qs['fields'](_0x5be644[_0xa41b('0x33')]['fields']));_0x549d52[_0xa41b('0x37')]=_0x549d52[_0xa41b('0x37')][_0xa41b('0x39')]?_0x549d52[_0xa41b('0x37')]:_0x4615a9[_0xa41b('0x31')];if(_0x5be644['query']['includeAll']){_0x549d52[_0xa41b('0x47')]=[{'all':!![]}];}_0x549d52=_[_0xa41b('0x40')]({},_0x549d52,_0x5be644[_0xa41b('0x42')]);return db[_0xa41b('0x2d')]['find'](_0x549d52)[_0xa41b('0x27')](handleEntityNotFound(_0x58e4ce,null))['then'](respondWithResult(_0x58e4ce,null))[_0xa41b('0x45')](handleError(_0x58e4ce,null));};exports['create']=function(_0x24f465,_0x142f3e){return db[_0xa41b('0x2d')][_0xa41b('0x48')](_0x24f465['body'],{})[_0xa41b('0x27')](respondWithResult(_0x142f3e,0xc9))[_0xa41b('0x45')](handleError(_0x142f3e,null));};exports['update']=function(_0x354c44,_0x406f98){if(_0x354c44[_0xa41b('0x49')]['id']){delete _0x354c44[_0xa41b('0x49')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x354c44[_0xa41b('0x4a')]['id']}})[_0xa41b('0x27')](handleEntityNotFound(_0x406f98,null))['then'](saveUpdates(_0x354c44[_0xa41b('0x49')],null))[_0xa41b('0x27')](respondWithResult(_0x406f98,null))[_0xa41b('0x45')](handleError(_0x406f98,null));};exports[_0xa41b('0x28')]=function(_0x201adf,_0x2f23a0){return db[_0xa41b('0x2d')][_0xa41b('0x4b')]({'where':{'id':_0x201adf[_0xa41b('0x4a')]['id']}})[_0xa41b('0x27')](handleEntityNotFound(_0x2f23a0,null))['then'](removeEntity(_0x2f23a0,null))['catch'](handleError(_0x2f23a0,null));};exports['describe']=function(_0x5d20aa,_0x232077){return db['SquareReport'][_0xa41b('0x4c')]()[_0xa41b('0x27')](respondWithResult(_0x232077,null))['catch'](handleError(_0x232077,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6686aa6..bda7361 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 _0xdf6a=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash'];(function(_0x35c122,_0x468833){var _0x4940f2=function(_0x2150a2){while(--_0x2150a2){_0x35c122['push'](_0x35c122['shift']());}};_0x4940f2(++_0x468833);}(_0xdf6a,0xff));var _0xadf6=function(_0x217f80,_0x20e335){_0x217f80=_0x217f80-0x0;var _0x22a488=_0xdf6a[_0x217f80];return _0x22a488;};'use strict';var _=require(_0xadf6('0x0'));var util=require(_0xadf6('0x1'));var logger=require(_0xadf6('0x2'))(_0xadf6('0x3'));var moment=require(_0xadf6('0x4'));var BPromise=require(_0xadf6('0x5'));var rp=require(_0xadf6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadf6('0x7'));var config=require('../../config/environment');var attributes=require(_0xadf6('0x8'));module[_0xadf6('0x9')]=function(_0x2146da,_0x91b35e){return _0x2146da[_0xadf6('0xa')]('SquareReport',attributes,{'tableName':_0xadf6('0xb'),'paranoid':![],'indexes':[{'name':_0xadf6('0xc'),'fields':[_0xadf6('0xd'),_0xadf6('0xe')]},{'name':_0xadf6('0xf'),'fields':[_0xadf6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07ad=['moment','bluebird','request-promise','rimraf','exports','define','SquareReport','uid_pname','project_name','leaveAt','lodash','util','api'];(function(_0x174f70,_0x43d859){var _0xea3963=function(_0x958360){while(--_0x958360){_0x174f70['push'](_0x174f70['shift']());}};_0xea3963(++_0x43d859);}(_0x07ad,0x1eb));var _0xd07a=function(_0x53a970,_0x1acd0e){_0x53a970=_0x53a970-0x0;var _0x3214f9=_0x07ad[_0x53a970];return _0x3214f9;};'use strict';var _=require(_0xd07a('0x0'));var util=require(_0xd07a('0x1'));var logger=require('../../config/logger')(_0xd07a('0x2'));var moment=require(_0xd07a('0x3'));var BPromise=require(_0xd07a('0x4'));var rp=require(_0xd07a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd07a('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0xd07a('0x7')]=function(_0x21b7e5,_0xbfe430){return _0x21b7e5[_0xd07a('0x8')](_0xd07a('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xd07a('0xa'),'fields':['uniqueid',_0xd07a('0xb')]},{'name':'leaveAt','fields':[_0xd07a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index b7a950b..35ae78e 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 _0x480c=['CreateSquareReport','create','options','stringify','UpdateSquareReport','raw','where','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','code','error','message','info','catch'];(function(_0x593e43,_0x297d2e){var _0x403763=function(_0x13b87e){while(--_0x13b87e){_0x593e43['push'](_0x593e43['shift']());}};_0x403763(++_0x297d2e);}(_0x480c,0x8f));var _0xc480=function(_0x193d5a,_0x3ef3be){_0x193d5a=_0x193d5a-0x0;var _0x2e5fb1=_0x480c[_0x193d5a];return _0x2e5fb1;};'use strict';var _=require(_0xc480('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc480('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc480('0x2'));var db=require(_0xc480('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc480('0x4'))('rpc');var config=require(_0xc480('0x5'));var jayson=require(_0xc480('0x6'));var client=jayson[_0xc480('0x7')][_0xc480('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26fb7c,_0x46d34e,_0x38a7d3){return new BPromise(function(_0x4700fd,_0x213126){return client['request'](_0x26fb7c,_0x38a7d3)[_0xc480('0x9')](function(_0x15fa76){logger['info'](_0xc480('0xa'),_0x46d34e,_0xc480('0xb'));logger[_0xc480('0xc')](_0xc480('0xd'),_0x46d34e,_0xc480('0xb'),JSON['stringify'](_0x15fa76));if(_0x15fa76['error']){if(_0x15fa76['error'][_0xc480('0xe')]===0x1f4){logger['error'](_0xc480('0xa'),_0x46d34e,_0x15fa76[_0xc480('0xf')][_0xc480('0x10')]);return _0x213126(_0x15fa76['error']['message']);}logger[_0xc480('0xf')]('SquareReport,\x20%s,\x20%s',_0x46d34e,_0x15fa76[_0xc480('0xf')]['message']);return _0x4700fd(_0x15fa76[_0xc480('0xf')][_0xc480('0x10')]);}else{logger[_0xc480('0x11')](_0xc480('0xa'),_0x46d34e,_0xc480('0xb'));_0x4700fd(_0x15fa76['result']['message']);}})[_0xc480('0x12')](function(_0x26406a){logger[_0xc480('0xf')](_0xc480('0xa'),_0x46d34e,_0x26406a);_0x213126(_0x26406a);});});}exports[_0xc480('0x13')]=function(_0x25ea0b){var _0x3e3a1e=this;return new Promise(function(_0xa48a94,_0x56a9de){return db['SquareReport'][_0xc480('0x14')](_0x25ea0b['body'],{'raw':_0x25ea0b[_0xc480('0x15')]?_0x25ea0b[_0xc480('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3e21eb){logger[_0xc480('0x11')](_0xc480('0x13'),_0x25ea0b);logger['debug'](_0xc480('0x13'),_0x25ea0b,JSON[_0xc480('0x16')](_0x3e21eb));_0xa48a94(_0x3e21eb);})[_0xc480('0x12')](function(_0x2d27ff){logger[_0xc480('0xf')](_0xc480('0x13'),_0x2d27ff[_0xc480('0x10')],_0x25ea0b);_0x56a9de(_0x3e3a1e['error'](0x1f4,_0x2d27ff['message']));});});};exports[_0xc480('0x17')]=function(_0x46d3cb){var _0x2951ed=this;return new Promise(function(_0x4ecfa0,_0x41edfc){return db['SquareReport']['update'](_0x46d3cb['body'],{'raw':_0x46d3cb['options']?_0x46d3cb[_0xc480('0x15')][_0xc480('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46d3cb[_0xc480('0x15')]?_0x46d3cb[_0xc480('0x15')][_0xc480('0x19')]||null:null,'attributes':_0x46d3cb[_0xc480('0x15')]?_0x46d3cb[_0xc480('0x15')]['attributes']||null:null,'limit':_0x46d3cb[_0xc480('0x15')]?_0x46d3cb[_0xc480('0x15')][_0xc480('0x1a')]||null:null})[_0xc480('0x9')](function(_0x25937b){logger[_0xc480('0x11')](_0xc480('0x17'),_0x46d3cb);logger['debug']('UpdateSquareReport',_0x46d3cb,JSON[_0xc480('0x16')](_0x25937b));_0x4ecfa0(_0x25937b);})[_0xc480('0x12')](function(_0x348d2b){logger[_0xc480('0xf')]('UpdateSquareReport',_0x348d2b[_0xc480('0x10')],_0x46d3cb);_0x41edfc(_0x2951ed[_0xc480('0xf')](0x1f4,_0x348d2b[_0xc480('0x10')]));});});}; \ No newline at end of file +var _0x423d=['code','message','result','catch','CreateSquareReport','SquareReport','UpdateSquareReport','update','body','options','raw','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x423d,0xf5));var _0xd423=function(_0x13fea8,_0x117fe6){_0x13fea8=_0x13fea8-0x0;var _0x3fd0e2=_0x423d[_0x13fea8];return _0x3fd0e2;};'use strict';var _=require(_0xd423('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd423('0x1'));var rs=require(_0xd423('0x2'));var fs=require('fs');var Redis=require(_0xd423('0x3'));var db=require(_0xd423('0x4'))['db'];var utils=require(_0xd423('0x5'));var logger=require('../../config/logger')(_0xd423('0x6'));var config=require(_0xd423('0x7'));var jayson=require(_0xd423('0x8'));var client=jayson[_0xd423('0x9')][_0xd423('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34a371,_0x4260fd,_0x91df28){return new BPromise(function(_0x2bd453,_0x17c029){return client[_0xd423('0xb')](_0x34a371,_0x91df28)[_0xd423('0xc')](function(_0x12195f){logger[_0xd423('0xd')](_0xd423('0xe'),_0x4260fd,_0xd423('0xf'));logger[_0xd423('0x10')](_0xd423('0x11'),_0x4260fd,_0xd423('0xf'),JSON['stringify'](_0x12195f));if(_0x12195f[_0xd423('0x12')]){if(_0x12195f[_0xd423('0x12')][_0xd423('0x13')]===0x1f4){logger['error'](_0xd423('0xe'),_0x4260fd,_0x12195f[_0xd423('0x12')][_0xd423('0x14')]);return _0x17c029(_0x12195f[_0xd423('0x12')]['message']);}logger[_0xd423('0x12')](_0xd423('0xe'),_0x4260fd,_0x12195f[_0xd423('0x12')][_0xd423('0x14')]);return _0x2bd453(_0x12195f[_0xd423('0x12')][_0xd423('0x14')]);}else{logger['info'](_0xd423('0xe'),_0x4260fd,_0xd423('0xf'));_0x2bd453(_0x12195f[_0xd423('0x15')][_0xd423('0x14')]);}})[_0xd423('0x16')](function(_0x1256cc){logger[_0xd423('0x12')](_0xd423('0xe'),_0x4260fd,_0x1256cc);_0x17c029(_0x1256cc);});});}exports[_0xd423('0x17')]=function(_0x2754cf){var _0x571be8=this;return new Promise(function(_0x171dfc,_0x23eddf){return db[_0xd423('0x18')]['create'](_0x2754cf['body'],{'raw':_0x2754cf['options']?_0x2754cf['options']['raw']===undefined?!![]:![]:!![]})[_0xd423('0xc')](function(_0x528c9f){logger[_0xd423('0xd')](_0xd423('0x17'),_0x2754cf);logger[_0xd423('0x10')](_0xd423('0x17'),_0x2754cf,JSON['stringify'](_0x528c9f));_0x171dfc(_0x528c9f);})['catch'](function(_0x2ec991){logger[_0xd423('0x12')](_0xd423('0x17'),_0x2ec991[_0xd423('0x14')],_0x2754cf);_0x23eddf(_0x571be8[_0xd423('0x12')](0x1f4,_0x2ec991[_0xd423('0x14')]));});});};exports[_0xd423('0x19')]=function(_0x2cc804){var _0x1483cc=this;return new Promise(function(_0x583e02,_0x1dc5a6){return db[_0xd423('0x18')][_0xd423('0x1a')](_0x2cc804[_0xd423('0x1b')],{'raw':_0x2cc804[_0xd423('0x1c')]?_0x2cc804[_0xd423('0x1c')][_0xd423('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cc804['options']?_0x2cc804[_0xd423('0x1c')][_0xd423('0x1e')]||null:null,'attributes':_0x2cc804['options']?_0x2cc804[_0xd423('0x1c')][_0xd423('0x1f')]||null:null,'limit':_0x2cc804[_0xd423('0x1c')]?_0x2cc804[_0xd423('0x1c')][_0xd423('0x20')]||null:null})['then'](function(_0x510bf9){logger[_0xd423('0xd')]('UpdateSquareReport',_0x2cc804);logger[_0xd423('0x10')](_0xd423('0x19'),_0x2cc804,JSON['stringify'](_0x510bf9));_0x583e02(_0x510bf9);})[_0xd423('0x16')](function(_0x17870e){logger[_0xd423('0x12')]('UpdateSquareReport',_0x17870e[_0xd423('0x14')],_0x2cc804);_0x1dc5a6(_0x1483cc[_0xd423('0x12')](0x1f4,_0x17870e[_0xd423('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c438c5b..4885295 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 _0x6e19=['/:id','show','post','create','put','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6e19,0x181));var _0x96e1=function(_0x195ac1,_0x5e4727){_0x195ac1=_0x195ac1-0x0;var _0x1507dc=_0x6e19[_0x195ac1];return _0x1507dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96e1('0x0'));var timeout=require(_0x96e1('0x1'));var express=require(_0x96e1('0x2'));var router=express[_0x96e1('0x3')]();var fs_extra=require(_0x96e1('0x4'));var auth=require(_0x96e1('0x5'));var interaction=require(_0x96e1('0x6'));var config=require(_0x96e1('0x7'));var controller=require(_0x96e1('0x8'));router[_0x96e1('0x9')]('/',auth[_0x96e1('0xa')](),controller[_0x96e1('0xb')]);router[_0x96e1('0x9')](_0x96e1('0xc'),auth['isAuthenticated'](),controller[_0x96e1('0xd')]);router['get'](_0x96e1('0xe'),auth[_0x96e1('0xa')](),controller[_0x96e1('0xf')]);router[_0x96e1('0x10')]('/',auth['isAuthenticated'](),controller[_0x96e1('0x11')]);router[_0x96e1('0x12')]('/:id',auth[_0x96e1('0xa')](),controller[_0x96e1('0x13')]);router['delete'](_0x96e1('0xe'),auth[_0x96e1('0xa')](),controller[_0x96e1('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5730=['express','fs-extra','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x39a226,_0x3c1ef3){var _0x4c7fef=function(_0x24469c){while(--_0x24469c){_0x39a226['push'](_0x39a226['shift']());}};_0x4c7fef(++_0x3c1ef3);}(_0x5730,0x1bd));var _0x0573=function(_0x476216,_0x113819){_0x476216=_0x476216-0x0;var _0x5785d4=_0x5730[_0x476216];return _0x5785d4;};'use strict';var multer=require(_0x0573('0x0'));var util=require(_0x0573('0x1'));var path=require(_0x0573('0x2'));var timeout=require('connect-timeout');var express=require(_0x0573('0x3'));var router=express['Router']();var fs_extra=require(_0x0573('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0573('0x5'));var config=require('../../config/environment');var controller=require(_0x0573('0x6'));router['get']('/',auth[_0x0573('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x0573('0x8'),auth[_0x0573('0x7')](),controller[_0x0573('0x9')]);router['post']('/',auth[_0x0573('0x7')](),controller[_0x0573('0xa')]);router[_0x0573('0xb')](_0x0573('0x8'),auth[_0x0573('0x7')](),controller[_0x0573('0xc')]);router[_0x0573('0xd')](_0x0573('0x8'),auth[_0x0573('0x7')](),controller[_0x0573('0xe')]);module[_0x0573('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index d0677b0..6f5001c 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 _0xb7e1=['STRING','TEXT','sequelize'];(function(_0x54b366,_0x232cf1){var _0x448686=function(_0x3fabc4){while(--_0x3fabc4){_0x54b366['push'](_0x54b366['shift']());}};_0x448686(++_0x232cf1);}(_0xb7e1,0x95));var _0x1b7e=function(_0x37f4b9,_0x2f5610){_0x37f4b9=_0x37f4b9-0x0;var _0x571f0b=_0xb7e1[_0x37f4b9];return _0x571f0b;};'use strict';var Sequelize=require(_0x1b7e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x1b7e('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x1b7e('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1b7e('0x1')]}}; \ No newline at end of file +var _0x6186=['sequelize','exports','STRING','TEXT'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x6186,0x1d0));var _0x6618=function(_0x23cd34,_0xe7e8f7){_0x23cd34=_0x23cd34-0x0;var _0x1e1e48=_0x6186[_0x23cd34];return _0x1e1e48;};'use strict';var Sequelize=require(_0x6618('0x0'));module[_0x6618('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x6618('0x2')]},'application':{'type':Sequelize[_0x6618('0x2')]},'data':{'type':Sequelize[_0x6618('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6618('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 1023067..6dd5659 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 _0x5e06=['rawAttributes','options','create','body','update','find','params','destroy','describe','rimraf','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','then','stack','name','send','index','map','fieldName','type','key','query','attributes','intersection','model','fields','length','hasOwnProperty','limit','order','sort','filters','filter','where','merge','SquareDetailsReport','includeAll','include','rows','catch','show','keys'];(function(_0x21fe38,_0x3c03c9){var _0x57e204=function(_0x3bb455){while(--_0x3bb455){_0x21fe38['push'](_0x21fe38['shift']());}};_0x57e204(++_0x3c03c9);}(_0x5e06,0x131));var _0x65e0=function(_0x6e4faa,_0x563638){_0x6e4faa=_0x6e4faa-0x0;var _0x5b0aaa=_0x5e06[_0x6e4faa];return _0x5b0aaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65e0('0x1'));var moment=require('moment');var BPromise=require(_0x65e0('0x2'));var Mustache=require(_0x65e0('0x3'));var util=require(_0x65e0('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x65e0('0x5'));var fs=require('fs');var fs_extra=require(_0x65e0('0x6'));var _=require(_0x65e0('0x7'));var squel=require(_0x65e0('0x8'));var crypto=require('crypto');var jsforce=require(_0x65e0('0x9'));var deskjs=require(_0x65e0('0xa'));var toCsv=require(_0x65e0('0xb'));var querystring=require(_0x65e0('0xc'));var Papa=require(_0x65e0('0xd'));var Redis=require(_0x65e0('0xe'));var authService=require(_0x65e0('0xf'));var qs=require(_0x65e0('0x10'));var as=require(_0x65e0('0x11'));var hardwareService=require(_0x65e0('0x12'));var logger=require(_0x65e0('0x13'))(_0x65e0('0x14'));var utils=require(_0x65e0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x65e0('0x16'));var db=require(_0x65e0('0x17'))['db'];function respondWithStatusCode(_0x23a90f,_0x15b4f1){_0x15b4f1=_0x15b4f1||0xcc;return function(_0x2b7bc0){if(_0x2b7bc0){return _0x23a90f[_0x65e0('0x18')](_0x15b4f1);}return _0x23a90f[_0x65e0('0x19')](_0x15b4f1)[_0x65e0('0x1a')]();};}function respondWithResult(_0x436a03,_0x1f842e){_0x1f842e=_0x1f842e||0xc8;return function(_0x522168){if(_0x522168){return _0x436a03[_0x65e0('0x19')](_0x1f842e)[_0x65e0('0x1b')](_0x522168);}};}function respondWithFilteredResult(_0x4f3cdb,_0x2eb979){return function(_0x37618b){if(_0x37618b){var _0x1d8e94=typeof _0x2eb979[_0x65e0('0x1c')]===_0x65e0('0x1d')&&typeof _0x2eb979['limit']===_0x65e0('0x1d');var _0x1a49b5=_0x37618b['count'];var _0x58dea3=_0x1d8e94?0x0:_0x2eb979[_0x65e0('0x1c')];var _0x1772b6=_0x1d8e94?_0x37618b[_0x65e0('0x1e')]:_0x2eb979['offset']+_0x2eb979['limit'];var _0x2402a2;if(_0x1772b6>=_0x1a49b5){_0x1772b6=_0x1a49b5;_0x2402a2=0xc8;}else{_0x2402a2=0xce;}_0x4f3cdb['status'](_0x2402a2);return _0x4f3cdb[_0x65e0('0x1f')]('Content-Range',_0x58dea3+'-'+_0x1772b6+'/'+_0x1a49b5)[_0x65e0('0x1b')](_0x37618b);}return null;};}function patchUpdates(_0xac8c5a){return function(_0x22160d){try{jsonpatch[_0x65e0('0x20')](_0x22160d,_0xac8c5a,!![]);}catch(_0x342714){return BPromise[_0x65e0('0x21')](_0x342714);}return _0x22160d[_0x65e0('0x22')]();};}function saveUpdates(_0x35c12a,_0x109b50){return function(_0x17fcba){if(_0x17fcba){return _0x17fcba['update'](_0x35c12a)[_0x65e0('0x23')](function(_0x128640){return _0x128640;});}return null;};}function removeEntity(_0x319541,_0x1d5a93){return function(_0x1997d0){if(_0x1997d0){return _0x1997d0['destroy']()[_0x65e0('0x23')](function(){_0x319541[_0x65e0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x398ecb,_0x4ccc7f){return function(_0x4b69f4){if(!_0x4b69f4){_0x398ecb[_0x65e0('0x18')](0x194);}return _0x4b69f4;};}function handleError(_0x4bb213,_0x12a0d7){_0x12a0d7=_0x12a0d7||0x1f4;return function(_0x49da85){logger['error'](_0x49da85[_0x65e0('0x24')]);if(_0x49da85[_0x65e0('0x25')]){delete _0x49da85[_0x65e0('0x25')];}_0x4bb213['status'](_0x12a0d7)[_0x65e0('0x26')](_0x49da85);};}exports[_0x65e0('0x27')]=function(_0x43b588,_0x25a565){var _0x24f36e={},_0x496f80={},_0x1d8e69={'count':0x0,'rows':[]};var _0x4a69f0=_[_0x65e0('0x28')](db['SquareDetailsReport']['rawAttributes'],function(_0x1e62b3){return{'name':_0x1e62b3[_0x65e0('0x29')],'type':_0x1e62b3[_0x65e0('0x2a')][_0x65e0('0x2b')]};});_0x496f80['model']=_[_0x65e0('0x28')](_0x4a69f0,_0x65e0('0x25'));_0x496f80[_0x65e0('0x2c')]=_['keys'](_0x43b588['query']);_0x496f80['filters']=_['intersection'](_0x496f80['model'],_0x496f80[_0x65e0('0x2c')]);_0x24f36e[_0x65e0('0x2d')]=_[_0x65e0('0x2e')](_0x496f80[_0x65e0('0x2f')],qs[_0x65e0('0x30')](_0x43b588['query'][_0x65e0('0x30')]));_0x24f36e[_0x65e0('0x2d')]=_0x24f36e['attributes'][_0x65e0('0x31')]?_0x24f36e[_0x65e0('0x2d')]:_0x496f80[_0x65e0('0x2f')];if(!_0x43b588[_0x65e0('0x2c')][_0x65e0('0x32')]('nolimit')){_0x24f36e['limit']=qs[_0x65e0('0x33')](_0x43b588[_0x65e0('0x2c')][_0x65e0('0x33')]);_0x24f36e[_0x65e0('0x1c')]=qs['offset'](_0x43b588[_0x65e0('0x2c')][_0x65e0('0x1c')]);}_0x24f36e[_0x65e0('0x34')]=qs['sort'](_0x43b588['query'][_0x65e0('0x35')]);_0x24f36e['where']=qs['filters'](_['pick'](_0x43b588[_0x65e0('0x2c')],_0x496f80[_0x65e0('0x36')]),_0x4a69f0);if(_0x43b588[_0x65e0('0x2c')][_0x65e0('0x37')]){_0x24f36e[_0x65e0('0x38')]=_[_0x65e0('0x39')](_0x24f36e[_0x65e0('0x38')],{'$or':_[_0x65e0('0x28')](_0x4a69f0,function(_0x12a105){if(_0x12a105['type']!=='VIRTUAL'){var _0x4125a6={};_0x4125a6[_0x12a105[_0x65e0('0x25')]]={'$like':'%'+_0x43b588['query']['filter']+'%'};return _0x4125a6;}})});}_0x24f36e=_['merge']({},_0x24f36e,_0x43b588['options']);var _0x23c632={'where':_0x24f36e['where']};return db[_0x65e0('0x3a')][_0x65e0('0x1e')](_0x23c632)[_0x65e0('0x23')](function(_0x2dc096){_0x1d8e69[_0x65e0('0x1e')]=_0x2dc096;if(_0x43b588[_0x65e0('0x2c')][_0x65e0('0x3b')]){_0x24f36e[_0x65e0('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x24f36e);})['then'](function(_0x59abae){_0x1d8e69[_0x65e0('0x3d')]=_0x59abae;return _0x1d8e69;})[_0x65e0('0x23')](respondWithFilteredResult(_0x25a565,_0x24f36e))[_0x65e0('0x3e')](handleError(_0x25a565,null));};exports[_0x65e0('0x3f')]=function(_0x3c3992,_0x3961b6){var _0x9026b8={'raw':!![],'where':{'id':_0x3c3992['params']['id']}},_0x34167e={};_0x34167e[_0x65e0('0x2f')]=_[_0x65e0('0x40')](db['SquareDetailsReport'][_0x65e0('0x41')]);_0x34167e['query']=_[_0x65e0('0x40')](_0x3c3992[_0x65e0('0x2c')]);_0x34167e[_0x65e0('0x36')]=_[_0x65e0('0x2e')](_0x34167e['model'],_0x34167e[_0x65e0('0x2c')]);_0x9026b8['attributes']=_[_0x65e0('0x2e')](_0x34167e[_0x65e0('0x2f')],qs['fields'](_0x3c3992[_0x65e0('0x2c')][_0x65e0('0x30')]));_0x9026b8['attributes']=_0x9026b8[_0x65e0('0x2d')][_0x65e0('0x31')]?_0x9026b8['attributes']:_0x34167e['model'];if(_0x3c3992[_0x65e0('0x2c')][_0x65e0('0x3b')]){_0x9026b8[_0x65e0('0x3c')]=[{'all':!![]}];}_0x9026b8=_[_0x65e0('0x39')]({},_0x9026b8,_0x3c3992[_0x65e0('0x42')]);return db[_0x65e0('0x3a')]['find'](_0x9026b8)['then'](handleEntityNotFound(_0x3961b6,null))[_0x65e0('0x23')](respondWithResult(_0x3961b6,null))['catch'](handleError(_0x3961b6,null));};exports[_0x65e0('0x43')]=function(_0x309c19,_0x3e469c){return db[_0x65e0('0x3a')][_0x65e0('0x43')](_0x309c19[_0x65e0('0x44')],{})[_0x65e0('0x23')](respondWithResult(_0x3e469c,0xc9))[_0x65e0('0x3e')](handleError(_0x3e469c,null));};exports[_0x65e0('0x45')]=function(_0x3b8827,_0x553d72){if(_0x3b8827[_0x65e0('0x44')]['id']){delete _0x3b8827[_0x65e0('0x44')]['id'];}return db[_0x65e0('0x3a')][_0x65e0('0x46')]({'where':{'id':_0x3b8827[_0x65e0('0x47')]['id']}})[_0x65e0('0x23')](handleEntityNotFound(_0x553d72,null))[_0x65e0('0x23')](saveUpdates(_0x3b8827[_0x65e0('0x44')],null))[_0x65e0('0x23')](respondWithResult(_0x553d72,null))['catch'](handleError(_0x553d72,null));};exports[_0x65e0('0x48')]=function(_0x392ffb,_0xcc802f){return db[_0x65e0('0x3a')][_0x65e0('0x46')]({'where':{'id':_0x392ffb[_0x65e0('0x47')]['id']}})[_0x65e0('0x23')](handleEntityNotFound(_0xcc802f,null))[_0x65e0('0x23')](removeEntity(_0xcc802f,null))[_0x65e0('0x3e')](handleError(_0xcc802f,null));};exports[_0x65e0('0x49')]=function(_0xf50bc,_0x2a2809){return db[_0x65e0('0x3a')][_0x65e0('0x49')]()['then'](respondWithResult(_0x2a2809,null))[_0x65e0('0x3e')](handleError(_0x2a2809,null));}; \ No newline at end of file +var _0xbfee=['sox','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbfee,0x120));var _0xebfe=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbfee[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xebfe('0x0'));var rimraf=require(_0xebfe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebfe('0x2'));var rp=require(_0xebfe('0x3'));var moment=require('moment');var BPromise=require(_0xebfe('0x4'));var Mustache=require(_0xebfe('0x5'));var util=require(_0xebfe('0x6'));var path=require(_0xebfe('0x7'));var sox=require(_0xebfe('0x8'));var csv=require('to-csv');var ejs=require(_0xebfe('0x9'));var fs=require('fs');var fs_extra=require(_0xebfe('0xa'));var _=require('lodash');var squel=require(_0xebfe('0xb'));var crypto=require(_0xebfe('0xc'));var jsforce=require(_0xebfe('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebfe('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xebfe('0xf'));var qs=require(_0xebfe('0x10'));var as=require(_0xebfe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebfe('0x12'))(_0xebfe('0x13'));var utils=require(_0xebfe('0x14'));var config=require(_0xebfe('0x15'));var licenseUtil=require(_0xebfe('0x16'));var db=require(_0xebfe('0x17'))['db'];function respondWithStatusCode(_0x4baf14,_0x3bc656){_0x3bc656=_0x3bc656||0xcc;return function(_0x3d64b6){if(_0x3d64b6){return _0x4baf14[_0xebfe('0x18')](_0x3bc656);}return _0x4baf14[_0xebfe('0x19')](_0x3bc656)[_0xebfe('0x1a')]();};}function respondWithResult(_0x55ca18,_0x3acb62){_0x3acb62=_0x3acb62||0xc8;return function(_0x5133f6){if(_0x5133f6){return _0x55ca18[_0xebfe('0x19')](_0x3acb62)[_0xebfe('0x1b')](_0x5133f6);}};}function respondWithFilteredResult(_0x45bad6,_0x5b4ab0){return function(_0xdbf29f){if(_0xdbf29f){var _0xa1107a=typeof _0x5b4ab0[_0xebfe('0x1c')]===_0xebfe('0x1d')&&typeof _0x5b4ab0['limit']===_0xebfe('0x1d');var _0x5cf98c=_0xdbf29f['count'];var _0x109940=_0xa1107a?0x0:_0x5b4ab0[_0xebfe('0x1c')];var _0x14a222=_0xa1107a?_0xdbf29f['count']:_0x5b4ab0[_0xebfe('0x1c')]+_0x5b4ab0[_0xebfe('0x1e')];var _0x111c6c;if(_0x14a222>=_0x5cf98c){_0x14a222=_0x5cf98c;_0x111c6c=0xc8;}else{_0x111c6c=0xce;}_0x45bad6[_0xebfe('0x19')](_0x111c6c);return _0x45bad6[_0xebfe('0x1f')]('Content-Range',_0x109940+'-'+_0x14a222+'/'+_0x5cf98c)[_0xebfe('0x1b')](_0xdbf29f);}return null;};}function patchUpdates(_0x37b48f){return function(_0x39ff67){try{jsonpatch[_0xebfe('0x20')](_0x39ff67,_0x37b48f,!![]);}catch(_0x207a1c){return BPromise[_0xebfe('0x21')](_0x207a1c);}return _0x39ff67['save']();};}function saveUpdates(_0x27ac34,_0x240c0b){return function(_0x5b7c6d){if(_0x5b7c6d){return _0x5b7c6d[_0xebfe('0x22')](_0x27ac34)[_0xebfe('0x23')](function(_0x1ea617){return _0x1ea617;});}return null;};}function removeEntity(_0x11e55d,_0x427031){return function(_0x5b48f9){if(_0x5b48f9){return _0x5b48f9[_0xebfe('0x24')]()[_0xebfe('0x23')](function(){_0x11e55d[_0xebfe('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x411220,_0x163263){return function(_0x172029){if(!_0x172029){_0x411220[_0xebfe('0x18')](0x194);}return _0x172029;};}function handleError(_0x317c4f,_0x1a663f){_0x1a663f=_0x1a663f||0x1f4;return function(_0x221e95){logger['error'](_0x221e95[_0xebfe('0x25')]);if(_0x221e95[_0xebfe('0x26')]){delete _0x221e95[_0xebfe('0x26')];}_0x317c4f[_0xebfe('0x19')](_0x1a663f)[_0xebfe('0x27')](_0x221e95);};}exports[_0xebfe('0x28')]=function(_0x1db298,_0x44d4cf){var _0x76a0b7={},_0x374e10={},_0x37da70={'count':0x0,'rows':[]};var _0x10d28e=_[_0xebfe('0x29')](db['SquareDetailsReport'][_0xebfe('0x2a')],function(_0x36c09d){return{'name':_0x36c09d[_0xebfe('0x2b')],'type':_0x36c09d[_0xebfe('0x2c')][_0xebfe('0x2d')]};});_0x374e10[_0xebfe('0x2e')]=_[_0xebfe('0x29')](_0x10d28e,'name');_0x374e10[_0xebfe('0x2f')]=_[_0xebfe('0x30')](_0x1db298[_0xebfe('0x2f')]);_0x374e10['filters']=_[_0xebfe('0x31')](_0x374e10[_0xebfe('0x2e')],_0x374e10[_0xebfe('0x2f')]);_0x76a0b7[_0xebfe('0x32')]=_[_0xebfe('0x31')](_0x374e10[_0xebfe('0x2e')],qs[_0xebfe('0x33')](_0x1db298[_0xebfe('0x2f')][_0xebfe('0x33')]));_0x76a0b7[_0xebfe('0x32')]=_0x76a0b7[_0xebfe('0x32')][_0xebfe('0x34')]?_0x76a0b7[_0xebfe('0x32')]:_0x374e10[_0xebfe('0x2e')];if(!_0x1db298['query'][_0xebfe('0x35')](_0xebfe('0x36'))){_0x76a0b7[_0xebfe('0x1e')]=qs[_0xebfe('0x1e')](_0x1db298['query'][_0xebfe('0x1e')]);_0x76a0b7[_0xebfe('0x1c')]=qs[_0xebfe('0x1c')](_0x1db298[_0xebfe('0x2f')][_0xebfe('0x1c')]);}_0x76a0b7['order']=qs[_0xebfe('0x37')](_0x1db298[_0xebfe('0x2f')][_0xebfe('0x37')]);_0x76a0b7[_0xebfe('0x38')]=qs[_0xebfe('0x39')](_[_0xebfe('0x3a')](_0x1db298[_0xebfe('0x2f')],_0x374e10[_0xebfe('0x39')]),_0x10d28e);if(_0x1db298[_0xebfe('0x2f')][_0xebfe('0x3b')]){_0x76a0b7[_0xebfe('0x38')]=_[_0xebfe('0x3c')](_0x76a0b7[_0xebfe('0x38')],{'$or':_[_0xebfe('0x29')](_0x10d28e,function(_0x1824ef){if(_0x1824ef['type']!==_0xebfe('0x3d')){var _0x39c57c={};_0x39c57c[_0x1824ef[_0xebfe('0x26')]]={'$like':'%'+_0x1db298[_0xebfe('0x2f')]['filter']+'%'};return _0x39c57c;}})});}_0x76a0b7=_[_0xebfe('0x3c')]({},_0x76a0b7,_0x1db298[_0xebfe('0x3e')]);var _0x430486={'where':_0x76a0b7[_0xebfe('0x38')]};return db[_0xebfe('0x3f')]['count'](_0x430486)[_0xebfe('0x23')](function(_0x4092d2){_0x37da70['count']=_0x4092d2;if(_0x1db298[_0xebfe('0x2f')]['includeAll']){_0x76a0b7['include']=[{'all':!![]}];}return db[_0xebfe('0x3f')][_0xebfe('0x40')](_0x76a0b7);})[_0xebfe('0x23')](function(_0x515661){_0x37da70[_0xebfe('0x41')]=_0x515661;return _0x37da70;})[_0xebfe('0x23')](respondWithFilteredResult(_0x44d4cf,_0x76a0b7))[_0xebfe('0x42')](handleError(_0x44d4cf,null));};exports[_0xebfe('0x43')]=function(_0x159c76,_0x5161bc){var _0x306940={'raw':!![],'where':{'id':_0x159c76[_0xebfe('0x44')]['id']}},_0x141e50={};_0x141e50[_0xebfe('0x2e')]=_[_0xebfe('0x30')](db[_0xebfe('0x3f')][_0xebfe('0x2a')]);_0x141e50[_0xebfe('0x2f')]=_[_0xebfe('0x30')](_0x159c76[_0xebfe('0x2f')]);_0x141e50[_0xebfe('0x39')]=_[_0xebfe('0x31')](_0x141e50[_0xebfe('0x2e')],_0x141e50[_0xebfe('0x2f')]);_0x306940[_0xebfe('0x32')]=_[_0xebfe('0x31')](_0x141e50['model'],qs[_0xebfe('0x33')](_0x159c76['query'][_0xebfe('0x33')]));_0x306940['attributes']=_0x306940[_0xebfe('0x32')][_0xebfe('0x34')]?_0x306940[_0xebfe('0x32')]:_0x141e50['model'];if(_0x159c76[_0xebfe('0x2f')]['includeAll']){_0x306940[_0xebfe('0x45')]=[{'all':!![]}];}_0x306940=_['merge']({},_0x306940,_0x159c76[_0xebfe('0x3e')]);return db[_0xebfe('0x3f')][_0xebfe('0x46')](_0x306940)['then'](handleEntityNotFound(_0x5161bc,null))['then'](respondWithResult(_0x5161bc,null))[_0xebfe('0x42')](handleError(_0x5161bc,null));};exports[_0xebfe('0x47')]=function(_0x422668,_0x362f88){return db[_0xebfe('0x3f')][_0xebfe('0x47')](_0x422668['body'],{})[_0xebfe('0x23')](respondWithResult(_0x362f88,0xc9))[_0xebfe('0x42')](handleError(_0x362f88,null));};exports[_0xebfe('0x22')]=function(_0xdc68cb,_0x70f570){if(_0xdc68cb[_0xebfe('0x48')]['id']){delete _0xdc68cb['body']['id'];}return db[_0xebfe('0x3f')][_0xebfe('0x46')]({'where':{'id':_0xdc68cb[_0xebfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x70f570,null))[_0xebfe('0x23')](saveUpdates(_0xdc68cb['body'],null))[_0xebfe('0x23')](respondWithResult(_0x70f570,null))['catch'](handleError(_0x70f570,null));};exports[_0xebfe('0x24')]=function(_0x1b5468,_0x399a31){return db[_0xebfe('0x3f')][_0xebfe('0x46')]({'where':{'id':_0x1b5468[_0xebfe('0x44')]['id']}})['then'](handleEntityNotFound(_0x399a31,null))[_0xebfe('0x23')](removeEntity(_0x399a31,null))[_0xebfe('0x42')](handleError(_0x399a31,null));};exports[_0xebfe('0x49')]=function(_0x44f850,_0x42838d){return db['SquareDetailsReport'][_0xebfe('0x49')]()[_0xebfe('0x23')](respondWithResult(_0x42838d,null))[_0xebfe('0x42')](handleError(_0x42838d,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 7219cd5..c54405e 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 _0x2555=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util','api','moment','request-promise'];(function(_0x449b54,_0x3776f3){var _0x32d6b9=function(_0xbce7c4){while(--_0xbce7c4){_0x449b54['push'](_0x449b54['shift']());}};_0x32d6b9(++_0x3776f3);}(_0x2555,0x97));var _0x5255=function(_0x37adbe,_0x2be871){_0x37adbe=_0x37adbe-0x0;var _0x3a3450=_0x2555[_0x37adbe];return _0x3a3450;};'use strict';var _=require(_0x5255('0x0'));var util=require(_0x5255('0x1'));var logger=require('../../config/logger')(_0x5255('0x2'));var moment=require(_0x5255('0x3'));var BPromise=require('bluebird');var rp=require(_0x5255('0x4'));var fs=require('fs');var path=require(_0x5255('0x5'));var rimraf=require(_0x5255('0x6'));var config=require(_0x5255('0x7'));var attributes=require(_0x5255('0x8'));module[_0x5255('0x9')]=function(_0x188ad4,_0x4b1f2d){return _0x188ad4['define'](_0x5255('0xa'),attributes,{'tableName':_0x5255('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a09=['report_square_details','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport'];(function(_0x8a1b38,_0x8d53e2){var _0x97ac16=function(_0x1e55b9){while(--_0x1e55b9){_0x8a1b38['push'](_0x8a1b38['shift']());}};_0x97ac16(++_0x8d53e2);}(_0x1a09,0x12a));var _0x91a0=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1a09[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x91a0('0x0'))(_0x91a0('0x1'));var moment=require(_0x91a0('0x2'));var BPromise=require(_0x91a0('0x3'));var rp=require(_0x91a0('0x4'));var fs=require('fs');var path=require(_0x91a0('0x5'));var rimraf=require('rimraf');var config=require(_0x91a0('0x6'));var attributes=require(_0x91a0('0x7'));module[_0x91a0('0x8')]=function(_0x599f8a,_0x1d6ad8){return _0x599f8a['define'](_0x91a0('0x9'),attributes,{'tableName':_0x91a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7f87d14..27863f4 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 _0x7be1=['SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','stringify','error','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x380ef3,_0xd77861){var _0x45bb68=function(_0x84baf1){while(--_0x84baf1){_0x380ef3['push'](_0x380ef3['shift']());}};_0x45bb68(++_0xd77861);}(_0x7be1,0x165));var _0x17be=function(_0x1dfe96,_0xacd7bf){_0x1dfe96=_0x1dfe96-0x0;var _0x23bb8a=_0x7be1[_0x1dfe96];return _0x23bb8a;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require('bluebird');var rs=require(_0x17be('0x3'));var fs=require('fs');var Redis=require(_0x17be('0x4'));var db=require(_0x17be('0x5'))['db'];var utils=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17be('0x8')][_0x17be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5b0c,_0x326f4d,_0x23f19f){return new BPromise(function(_0x2c74b2,_0xfd9c5){return client[_0x17be('0xa')](_0x4f5b0c,_0x23f19f)[_0x17be('0xb')](function(_0x582848){logger[_0x17be('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x326f4d,_0x17be('0xd'));logger[_0x17be('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x326f4d,_0x17be('0xd'),JSON[_0x17be('0xf')](_0x582848));if(_0x582848[_0x17be('0x10')]){if(_0x582848[_0x17be('0x10')]['code']===0x1f4){logger[_0x17be('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x326f4d,_0x582848[_0x17be('0x10')]['message']);return _0xfd9c5(_0x582848[_0x17be('0x10')][_0x17be('0x11')]);}logger[_0x17be('0x10')](_0x17be('0x12'),_0x326f4d,_0x582848[_0x17be('0x10')]['message']);return _0x2c74b2(_0x582848[_0x17be('0x10')]['message']);}else{logger['info'](_0x17be('0x12'),_0x326f4d,'request\x20sent');_0x2c74b2(_0x582848[_0x17be('0x13')]['message']);}})[_0x17be('0x14')](function(_0x312b2e){logger['error'](_0x17be('0x12'),_0x326f4d,_0x312b2e);_0xfd9c5(_0x312b2e);});});}exports['CreateSquareDetailsReport']=function(_0x222009){var _0x4cff4b=this;return new Promise(function(_0x328e3,_0x165dfb){return db[_0x17be('0x15')][_0x17be('0x16')](_0x222009[_0x17be('0x17')],{'raw':_0x222009['options']?_0x222009[_0x17be('0x18')][_0x17be('0x19')]===undefined?!![]:![]:!![]})[_0x17be('0xb')](function(_0x19678b){logger['info'](_0x17be('0x1a'),_0x222009);logger['debug']('CreateSquareDetailsReport',_0x222009,JSON[_0x17be('0xf')](_0x19678b));_0x328e3(_0x19678b);})[_0x17be('0x14')](function(_0x19fbdb){logger[_0x17be('0x10')]('CreateSquareDetailsReport',_0x19fbdb[_0x17be('0x11')],_0x222009);_0x165dfb(_0x4cff4b[_0x17be('0x10')](0x1f4,_0x19fbdb['message']));});});}; \ No newline at end of file +var _0x8952=['jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','raw','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3307bd,_0x256dbf){var _0x2561be=function(_0x3ebf){while(--_0x3ebf){_0x3307bd['push'](_0x3307bd['shift']());}};_0x2561be(++_0x256dbf);}(_0x8952,0x17e));var _0x2895=function(_0x1f45aa,_0xdec47b){_0x1f45aa=_0x1f45aa-0x0;var _0x991025=_0x8952[_0x1f45aa];return _0x991025;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')](_0xbf8b63['body'],{'raw':_0xbf8b63['options']?_0xbf8b63['options'][_0x2895('0x18')]===undefined?!![]:![]:!![]})[_0x2895('0xc')](function(_0x3ec4da){logger['info'](_0x2895('0x15'),_0xbf8b63);logger[_0x2895('0x19')](_0x2895('0x15'),_0xbf8b63,JSON[_0x2895('0xf')](_0x3ec4da));_0x155124(_0x3ec4da);})[_0x2895('0x14')](function(_0x5dbbfe){logger[_0x2895('0x10')](_0x2895('0x15'),_0x5dbbfe['message'],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x5dbbfe[_0x2895('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4194a20..a7be072 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 _0x2451=['express','Router','../../components/auth/service','get','isAuthenticated','index','killProcess'];(function(_0x5b63a8,_0x35e8c5){var _0x110378=function(_0x2f6fa7){while(--_0x2f6fa7){_0x5b63a8['push'](_0x5b63a8['shift']());}};_0x110378(++_0x35e8c5);}(_0x2451,0xe0));var _0x1245=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x2451[_0x3da832];return _0xe602f2;};'use strict';var express=require(_0x1245('0x0'));var router=express[_0x1245('0x1')]();var auth=require(_0x1245('0x2'));var controller=require('./system.controller');router[_0x1245('0x3')]('/',auth[_0x1245('0x4')](),controller[_0x1245('0x5')]);router[_0x1245('0x3')]('/process/:pid/kill',auth[_0x1245('0x4')](),controller[_0x1245('0x6')]);module['exports']=router; \ No newline at end of file +var _0x0b3c=['/process/:pid/kill','isAuthenticated','killProcess','exports','get','index'];(function(_0x443efe,_0x48d8df){var _0x16abe8=function(_0x23c6a9){while(--_0x23c6a9){_0x443efe['push'](_0x443efe['shift']());}};_0x16abe8(++_0x48d8df);}(_0x0b3c,0x1cc));var _0xc0b3=function(_0xbf7f20,_0x3f856e){_0xbf7f20=_0xbf7f20-0x0;var _0x5dc25d=_0x0b3c[_0xbf7f20];return _0x5dc25d;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xc0b3('0x0')]('/',auth['isAuthenticated'](),controller[_0xc0b3('0x1')]);router[_0xc0b3('0x0')](_0xc0b3('0x2'),auth[_0xc0b3('0x3')](),controller[_0xc0b3('0x4')]);module[_0xc0b3('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3e0fa4e..777e0b7 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 _0x24bc=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x24bc,0x1b6));var _0xc24b=function(_0x3e054c,_0x1a61b0){_0x3e054c=_0x3e054c-0x0;var _0x404ee0=_0x24bc[_0x3e054c];return _0x404ee0;};'use strict';var info=require(_0xc24b('0x0'));var exec=require(_0xc24b('0x1'))['exec'];var logger=require(_0xc24b('0x2'))(_0xc24b('0x3'));var util=require(_0xc24b('0x4'));var BPromise=require(_0xc24b('0x5'));var _=require(_0xc24b('0x6'));function handleError(_0xe63107,_0x45cd6b,_0x15a8ac){_0x45cd6b=_0x45cd6b||0x1f4;return function(_0x4adec9){logger[_0xc24b('0x7')](_0xc24b('0x8'),_0x15a8ac,_0x45cd6b,util[_0xc24b('0x9')](_0x4adec9,{'showHidden':![],'depth':null}));delete _0x4adec9[_0xc24b('0xa')];_0xe63107[_0xc24b('0xb')](_0x45cd6b)[_0xc24b('0xc')](_0x4adec9);};}exports[_0xc24b('0xd')]=function(_0x3a911d,_0x27a655){return info[_0xc24b('0xe')]()[_0xc24b('0xf')](function(_0x3bc2ac){return _0x27a655[_0xc24b('0xb')](0xc8)[_0xc24b('0x10')](_0x3bc2ac);})[_0xc24b('0x11')](function(_0xf24567){return _0x27a655[_0xc24b('0xb')](0x1f4)[_0xc24b('0x10')](_0xf24567);});};exports['killProcess']=function(_0x1023f0,_0x4af666){var _0x864f83=[_0xc24b('0x12')];return new BPromise(function(_0x21a016,_0x4d300e){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1023f0[_0xc24b('0x13')][_0xc24b('0x14')]),function(_0x57b966,_0x50f034,_0x57d86a){if(_0x57b966){return _0x4d300e(_0x57b966);}return _0x21a016(_0x50f034);});})[_0xc24b('0xf')](function(_0x1238d6){var _0x216793=![];var _0x13cb98=_0x1238d6[_0xc24b('0x15')](/\n/);for(var _0x25c265=0x0,_0x385e94=_0x864f83['length'];_0x25c265<_0x385e94,_0x216793===![];_0x25c265+=0x1){if(_0x1238d6[_0xc24b('0x16')](_0x864f83[_0x25c265])>=0x0){_0x216793=!![];}}if(!_0x216793){throw new Error(util[_0xc24b('0x17')](_0xc24b('0x18'),_0x1023f0[_0xc24b('0x13')][_0xc24b('0x14')]));}process[_0xc24b('0x19')](_0x1023f0[_0xc24b('0x13')][_0xc24b('0x14')],_0xc24b('0x1a'));return _0x4af666['status'](0xc8)[_0xc24b('0x10')]({'message':util[_0xc24b('0x17')](_0xc24b('0x1b'),_0x1023f0['params'][_0xc24b('0x14')])});})[_0xc24b('0x11')](handleError(_0x4af666,null,_0xc24b('0x1c')));}; \ No newline at end of file +var _0x9512=['split','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then'];(function(_0x143759,_0x249c49){var _0x4582be=function(_0x5b9462){while(--_0x5b9462){_0x143759['push'](_0x143759['shift']());}};_0x4582be(++_0x249c49);}(_0x9512,0x75));var _0x2951=function(_0x4a0f62,_0x19f781){_0x4a0f62=_0x4a0f62-0x0;var _0x3ffcc1=_0x9512[_0x4a0f62];return _0x3ffcc1;};'use strict';var info=require(_0x2951('0x0'));var exec=require(_0x2951('0x1'))[_0x2951('0x2')];var logger=require(_0x2951('0x3'))(_0x2951('0x4'));var util=require(_0x2951('0x5'));var BPromise=require(_0x2951('0x6'));var _=require('lodash');function handleError(_0x216aee,_0x330cb4,_0x1931b8){_0x330cb4=_0x330cb4||0x1f4;return function(_0x26a247){logger[_0x2951('0x7')](_0x2951('0x8'),_0x1931b8,_0x330cb4,util[_0x2951('0x9')](_0x26a247,{'showHidden':![],'depth':null}));delete _0x26a247['name'];_0x216aee[_0x2951('0xa')](_0x330cb4)[_0x2951('0xb')](_0x26a247);};}exports[_0x2951('0xc')]=function(_0x181d83,_0x279d79){return info[_0x2951('0xd')]()['then'](function(_0x3e6f58){return _0x279d79[_0x2951('0xa')](0xc8)[_0x2951('0xe')](_0x3e6f58);})[_0x2951('0xf')](function(_0x540819){return _0x279d79[_0x2951('0xa')](0x1f4)[_0x2951('0xe')](_0x540819);});};exports[_0x2951('0x10')]=function(_0x13d9ea,_0x13f23b){var _0x48a757=[_0x2951('0x11')];return new BPromise(function(_0x2dc786,_0x24dece){return exec(util[_0x2951('0x12')](_0x2951('0x13'),_0x13d9ea[_0x2951('0x14')][_0x2951('0x15')]),function(_0x25d7fc,_0x4f238e,_0x454d02){if(_0x25d7fc){return _0x24dece(_0x25d7fc);}return _0x2dc786(_0x4f238e);});})[_0x2951('0x16')](function(_0x402072){var _0x3ea695=![];var _0x5750e9=_0x402072[_0x2951('0x17')](/\n/);for(var _0x26ebbc=0x0,_0x18e89d=_0x48a757[_0x2951('0x18')];_0x26ebbc<_0x18e89d,_0x3ea695===![];_0x26ebbc+=0x1){if(_0x402072[_0x2951('0x19')](_0x48a757[_0x26ebbc])>=0x0){_0x3ea695=!![];}}if(!_0x3ea695){throw new Error(util[_0x2951('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x13d9ea[_0x2951('0x14')][_0x2951('0x15')]));}process[_0x2951('0x1a')](_0x13d9ea[_0x2951('0x14')][_0x2951('0x15')],'SIGINT');return _0x13f23b['status'](0xc8)[_0x2951('0xe')]({'message':util[_0x2951('0x12')](_0x2951('0x1b'),_0x13d9ea[_0x2951('0x14')]['pid'])});})['catch'](handleError(_0x13f23b,null,_0x2951('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 493ca28..4b9da65 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 _0x2b3b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x1cc07a,_0x1a32b0){var _0x12f2d4=function(_0x5a479c){while(--_0x5a479c){_0x1cc07a['push'](_0x1cc07a['shift']());}};_0x12f2d4(++_0x1a32b0);}(_0x2b3b,0x163));var _0xb2b3=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0x2b3b[_0xd578cb];return _0x775533;};'use strict';var multer=require(_0xb2b3('0x0'));var util=require(_0xb2b3('0x1'));var path=require('path');var timeout=require(_0xb2b3('0x2'));var express=require('express');var router=express[_0xb2b3('0x3')]();var fs_extra=require(_0xb2b3('0x4'));var auth=require(_0xb2b3('0x5'));var interaction=require(_0xb2b3('0x6'));var config=require(_0xb2b3('0x7'));var controller=require(_0xb2b3('0x8'));router[_0xb2b3('0x9')]('/',auth[_0xb2b3('0xa')](),controller[_0xb2b3('0xb')]);router[_0xb2b3('0x9')](_0xb2b3('0xc'),auth[_0xb2b3('0xa')](),controller[_0xb2b3('0xd')]);router[_0xb2b3('0xe')]('/',auth[_0xb2b3('0xa')](),controller[_0xb2b3('0xf')]);router[_0xb2b3('0x10')](_0xb2b3('0xc'),auth[_0xb2b3('0xa')](),controller[_0xb2b3('0x11')]);router[_0xb2b3('0x12')](_0xb2b3('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2b3('0x13')]=router; \ No newline at end of file +var _0x18cc=['post','create','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2583a5,_0x210710){var _0x1f856a=function(_0x25baa2){while(--_0x25baa2){_0x2583a5['push'](_0x2583a5['shift']());}};_0x1f856a(++_0x210710);}(_0x18cc,0x116));var _0xc18c=function(_0x2b0e01,_0x1b7eb7){_0x2b0e01=_0x2b0e01-0x0;var _0x14ce57=_0x18cc[_0x2b0e01];return _0x14ce57;};'use strict';var multer=require(_0xc18c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc18c('0x1'));var express=require('express');var router=express[_0xc18c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc18c('0x3'));var interaction=require(_0xc18c('0x4'));var config=require(_0xc18c('0x5'));var controller=require('./tag.controller');router[_0xc18c('0x6')]('/',auth[_0xc18c('0x7')](),controller[_0xc18c('0x8')]);router['get'](_0xc18c('0x9'),auth[_0xc18c('0x7')](),controller[_0xc18c('0xa')]);router[_0xc18c('0xb')]('/',auth[_0xc18c('0x7')](),controller[_0xc18c('0xc')]);router['put'](_0xc18c('0x9'),auth['isAuthenticated'](),controller[_0xc18c('0xd')]);router[_0xc18c('0xe')](_0xc18c('0x9'),auth[_0xc18c('0x7')](),controller[_0xc18c('0xf')]);module[_0xc18c('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 981d155..4d44d79 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 _0x4af8=['#0091EA','STRING'];(function(_0x50c16a,_0x53e9d2){var _0x52fb17=function(_0x237439){while(--_0x237439){_0x50c16a['push'](_0x50c16a['shift']());}};_0x52fb17(++_0x53e9d2);}(_0x4af8,0x1ad));var _0x84af=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x4af8[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x84af('0x0')],'defaultValue':_0x84af('0x1')},'description':{'type':Sequelize[_0x84af('0x0')]}}; \ No newline at end of file +var _0x4123=['sequelize','exports','STRING','name','#0091EA'];(function(_0x3b6891,_0x29b552){var _0x14019a=function(_0x49c677){while(--_0x49c677){_0x3b6891['push'](_0x3b6891['shift']());}};_0x14019a(++_0x29b552);}(_0x4123,0x87));var _0x3412=function(_0x168e24,_0x347c8a){_0x168e24=_0x168e24-0x0;var _0x2f90de=_0x4123[_0x168e24];return _0x2f90de;};'use strict';var Sequelize=require(_0x3412('0x0'));module[_0x3412('0x1')]={'name':{'type':Sequelize[_0x3412('0x2')],'unique':_0x3412('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3412('0x2')],'defaultValue':_0x3412('0x4')},'description':{'type':Sequelize[_0x3412('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a520c05..4e082a0 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 _0x2dae=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','save','update','then','get','Tags','UserProfileResource','destroy','stack','name','map','Tag','rawAttributes','type','key','model','query','keys'];(function(_0x3eb556,_0x11e2fc){var _0x2ec0e4=function(_0x555b5d){while(--_0x555b5d){_0x3eb556['push'](_0x3eb556['shift']());}};_0x2ec0e4(++_0x11e2fc);}(_0x2dae,0xc3));var _0xe2da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2dae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe2da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2da('0x1'));var jsonpatch=require(_0xe2da('0x2'));var rp=require(_0xe2da('0x3'));var moment=require(_0xe2da('0x4'));var BPromise=require(_0xe2da('0x5'));var Mustache=require('mustache');var util=require(_0xe2da('0x6'));var path=require(_0xe2da('0x7'));var sox=require(_0xe2da('0x8'));var csv=require(_0xe2da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2da('0xa'));var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x9'));var querystring=require(_0xe2da('0x10'));var Papa=require(_0xe2da('0x11'));var Redis=require('ioredis');var authService=require(_0xe2da('0x12'));var qs=require(_0xe2da('0x13'));var as=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2da('0x1a'))['db'];function respondWithStatusCode(_0x5200b1,_0x4377c6){_0x4377c6=_0x4377c6||0xcc;return function(_0x245ad7){if(_0x245ad7){return _0x5200b1[_0xe2da('0x1b')](_0x4377c6);}return _0x5200b1[_0xe2da('0x1c')](_0x4377c6)[_0xe2da('0x1d')]();};}function respondWithResult(_0x5660b5,_0x295a86){_0x295a86=_0x295a86||0xc8;return function(_0x48584b){if(_0x48584b){return _0x5660b5[_0xe2da('0x1c')](_0x295a86)['json'](_0x48584b);}};}function respondWithFilteredResult(_0x586b27,_0x403d1c){return function(_0x3dfc52){if(_0x3dfc52){var _0x33f919=typeof _0x403d1c['offset']===_0xe2da('0x1e')&&typeof _0x403d1c[_0xe2da('0x1f')]===_0xe2da('0x1e');var _0x33568f=_0x3dfc52['count'];var _0x45bb92=_0x33f919?0x0:_0x403d1c[_0xe2da('0x20')];var _0x417363=_0x33f919?_0x3dfc52[_0xe2da('0x21')]:_0x403d1c[_0xe2da('0x20')]+_0x403d1c['limit'];var _0x56eeb1;if(_0x417363>=_0x33568f){_0x417363=_0x33568f;_0x56eeb1=0xc8;}else{_0x56eeb1=0xce;}_0x586b27[_0xe2da('0x1c')](_0x56eeb1);return _0x586b27['set'](_0xe2da('0x22'),_0x45bb92+'-'+_0x417363+'/'+_0x33568f)[_0xe2da('0x23')](_0x3dfc52);}return null;};}function patchUpdates(_0x332193){return function(_0x203d36){try{jsonpatch[_0xe2da('0x24')](_0x203d36,_0x332193,!![]);}catch(_0x3e22de){return BPromise['reject'](_0x3e22de);}return _0x203d36[_0xe2da('0x25')]();};}function saveUpdates(_0x53cc4e,_0x30efdc){return function(_0x191d38){if(_0x191d38){return _0x191d38[_0xe2da('0x26')](_0x53cc4e)[_0xe2da('0x27')](function(_0x30dea4){return _0x30dea4;});}return null;};}function removeEntity(_0x1e45e9,_0x38f2c4){return function(_0x221e98){if(_0x221e98){return _0x221e98['destroy']()[_0xe2da('0x27')](function(){var _0x357bff=_0x221e98[_0xe2da('0x28')]({'plain':!![]});var _0x14704d=_0xe2da('0x29');return db[_0xe2da('0x2a')][_0xe2da('0x2b')]({'where':{'type':_0x14704d,'resourceId':_0x357bff['id']}})['then'](function(){return _0x221e98;});})[_0xe2da('0x27')](function(){_0x1e45e9[_0xe2da('0x1c')](0xcc)[_0xe2da('0x1d')]();});}};}function handleEntityNotFound(_0x38ee5e,_0x36ca43){return function(_0x2b6c9e){if(!_0x2b6c9e){_0x38ee5e[_0xe2da('0x1b')](0x194);}return _0x2b6c9e;};}function handleError(_0x39f60e,_0x516f42){_0x516f42=_0x516f42||0x1f4;return function(_0x487a7c){logger['error'](_0x487a7c[_0xe2da('0x2c')]);if(_0x487a7c[_0xe2da('0x2d')]){delete _0x487a7c[_0xe2da('0x2d')];}_0x39f60e[_0xe2da('0x1c')](_0x516f42)['send'](_0x487a7c);};}exports['index']=function(_0x356ab4,_0x1ec8ca){var _0x262d40={},_0x39f983={},_0x7ab5ee={'count':0x0,'rows':[]};var _0x15df33=_[_0xe2da('0x2e')](db[_0xe2da('0x2f')][_0xe2da('0x30')],function(_0x499400){return{'name':_0x499400['fieldName'],'type':_0x499400[_0xe2da('0x31')][_0xe2da('0x32')]};});_0x39f983[_0xe2da('0x33')]=_[_0xe2da('0x2e')](_0x15df33,_0xe2da('0x2d'));_0x39f983[_0xe2da('0x34')]=_[_0xe2da('0x35')](_0x356ab4[_0xe2da('0x34')]);_0x39f983[_0xe2da('0x36')]=_[_0xe2da('0x37')](_0x39f983[_0xe2da('0x33')],_0x39f983[_0xe2da('0x34')]);_0x262d40[_0xe2da('0x38')]=_[_0xe2da('0x37')](_0x39f983[_0xe2da('0x33')],qs[_0xe2da('0x39')](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x39')]));_0x262d40['attributes']=_0x262d40[_0xe2da('0x38')][_0xe2da('0x3a')]?_0x262d40[_0xe2da('0x38')]:_0x39f983['model'];if(!_0x356ab4[_0xe2da('0x34')][_0xe2da('0x3b')](_0xe2da('0x3c'))){_0x262d40['limit']=qs['limit'](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x1f')]);_0x262d40['offset']=qs[_0xe2da('0x20')](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x20')]);}_0x262d40[_0xe2da('0x3d')]=qs[_0xe2da('0x3e')](_0x356ab4['query'][_0xe2da('0x3e')]);_0x262d40['where']=qs['filters'](_[_0xe2da('0x3f')](_0x356ab4['query'],_0x39f983[_0xe2da('0x36')]),_0x15df33);if(_0x356ab4[_0xe2da('0x34')]['filter']){_0x262d40[_0xe2da('0x40')]=_[_0xe2da('0x41')](_0x262d40['where'],{'$or':_['map'](_0x15df33,function(_0x55be3e){if(_0x55be3e[_0xe2da('0x31')]!==_0xe2da('0x42')){var _0x26ba99={};_0x26ba99[_0x55be3e[_0xe2da('0x2d')]]={'$like':'%'+_0x356ab4[_0xe2da('0x34')][_0xe2da('0x43')]+'%'};return _0x26ba99;}})});}_0x262d40=_[_0xe2da('0x41')]({},_0x262d40,_0x356ab4['options']);var _0x3d1fd={'where':_0x262d40[_0xe2da('0x40')]};return db[_0xe2da('0x2f')][_0xe2da('0x21')](_0x3d1fd)[_0xe2da('0x27')](function(_0x5a1550){_0x7ab5ee[_0xe2da('0x21')]=_0x5a1550;if(_0x356ab4[_0xe2da('0x34')][_0xe2da('0x44')]){_0x262d40['include']=[{'all':!![]}];}return db[_0xe2da('0x2f')][_0xe2da('0x45')](_0x262d40);})[_0xe2da('0x27')](function(_0x4096c5){_0x7ab5ee[_0xe2da('0x46')]=_0x4096c5;return _0x7ab5ee;})[_0xe2da('0x27')](respondWithFilteredResult(_0x1ec8ca,_0x262d40))[_0xe2da('0x47')](handleError(_0x1ec8ca,null));};exports[_0xe2da('0x48')]=function(_0x4aec15,_0x21cc34){var _0x472d1e={'raw':!![],'where':{'id':_0x4aec15[_0xe2da('0x49')]['id']}},_0x2113e8={};_0x2113e8[_0xe2da('0x33')]=_['keys'](db[_0xe2da('0x2f')][_0xe2da('0x30')]);_0x2113e8[_0xe2da('0x34')]=_[_0xe2da('0x35')](_0x4aec15[_0xe2da('0x34')]);_0x2113e8[_0xe2da('0x36')]=_[_0xe2da('0x37')](_0x2113e8['model'],_0x2113e8[_0xe2da('0x34')]);_0x472d1e['attributes']=_[_0xe2da('0x37')](_0x2113e8[_0xe2da('0x33')],qs[_0xe2da('0x39')](_0x4aec15['query'][_0xe2da('0x39')]));_0x472d1e[_0xe2da('0x38')]=_0x472d1e['attributes'][_0xe2da('0x3a')]?_0x472d1e[_0xe2da('0x38')]:_0x2113e8[_0xe2da('0x33')];if(_0x4aec15['query'][_0xe2da('0x44')]){_0x472d1e['include']=[{'all':!![]}];}_0x472d1e=_['merge']({},_0x472d1e,_0x4aec15[_0xe2da('0x4a')]);return db['Tag'][_0xe2da('0x4b')](_0x472d1e)[_0xe2da('0x27')](handleEntityNotFound(_0x21cc34,null))['then'](respondWithResult(_0x21cc34,null))[_0xe2da('0x47')](handleError(_0x21cc34,null));};exports[_0xe2da('0x4c')]=function(_0x482547,_0x4a6d80){return db[_0xe2da('0x2f')]['create'](_0x482547[_0xe2da('0x4d')],{})[_0xe2da('0x27')](function(_0x259546){var _0x1c17f1=_0x482547[_0xe2da('0x4e')][_0xe2da('0x28')]({'plain':!![]});if(!_0x1c17f1)throw new Error(_0xe2da('0x4f'));if(_0x1c17f1[_0xe2da('0x50')]===_0xe2da('0x4e')){var _0x515f9b=_0x259546[_0xe2da('0x28')]({'plain':!![]});var _0x157c36=_0xe2da('0x29');return db['UserProfileSection'][_0xe2da('0x4b')]({'where':{'name':_0x157c36,'userProfileId':_0x1c17f1[_0xe2da('0x51')]},'raw':!![]})[_0xe2da('0x27')](function(_0x125118){if(_0x125118&&_0x125118[_0xe2da('0x52')]===0x0){return db[_0xe2da('0x2a')][_0xe2da('0x4c')]({'name':_0x515f9b['name'],'resourceId':_0x515f9b['id'],'type':_0x125118['name'],'sectionId':_0x125118['id']},{})[_0xe2da('0x27')](function(){return _0x259546;});}else{return _0x259546;}})[_0xe2da('0x47')](function(_0x28f916){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28f916);throw _0x28f916;});}return _0x259546;})[_0xe2da('0x27')](respondWithResult(_0x4a6d80,0xc9))['catch'](handleError(_0x4a6d80,null));};exports[_0xe2da('0x26')]=function(_0x153749,_0x8e78b9){if(_0x153749[_0xe2da('0x4d')]['id']){delete _0x153749[_0xe2da('0x4d')]['id'];}return db[_0xe2da('0x2f')][_0xe2da('0x4b')]({'where':{'id':_0x153749[_0xe2da('0x49')]['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x8e78b9,null))['then'](saveUpdates(_0x153749[_0xe2da('0x4d')],null))[_0xe2da('0x27')](respondWithResult(_0x8e78b9,null))[_0xe2da('0x47')](handleError(_0x8e78b9,null));};exports[_0xe2da('0x2b')]=function(_0x51d174,_0x25b8a7){return db[_0xe2da('0x2f')][_0xe2da('0x4b')]({'where':{'id':_0x51d174['params']['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x25b8a7,null))[_0xe2da('0x27')](removeEntity(_0x25b8a7,null))[_0xe2da('0x47')](handleError(_0x25b8a7,null));}; \ No newline at end of file +var _0x04b8=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Tags','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x3d781d,_0x4847c7){var _0x1ce302=function(_0x3d6a46){while(--_0x3d6a46){_0x3d781d['push'](_0x3d781d['shift']());}};_0x1ce302(++_0x4847c7);}(_0x04b8,0x159));var _0x804b=function(_0x20c46d,_0x4da3b3){_0x20c46d=_0x20c46d-0x0;var _0x55ba19=_0x04b8[_0x20c46d];return _0x55ba19;};'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'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['Tag'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['Tag'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['Tag']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Tags';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index eb4b2b4..5e1d4ba 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 _0x58fc=['../../config/logger','api','moment','bluebird','request-promise','path','./tag.attributes','exports','Tag','lodash'];(function(_0x2cf384,_0x50ce36){var _0x5d7346=function(_0x148176){while(--_0x148176){_0x2cf384['push'](_0x2cf384['shift']());}};_0x5d7346(++_0x50ce36);}(_0x58fc,0x1ad));var _0xc58f=function(_0x55e15f,_0x23eca8){_0x55e15f=_0x55e15f-0x0;var _0x381467=_0x58fc[_0x55e15f];return _0x381467;};'use strict';var _=require(_0xc58f('0x0'));var util=require('util');var logger=require(_0xc58f('0x1'))(_0xc58f('0x2'));var moment=require(_0xc58f('0x3'));var BPromise=require(_0xc58f('0x4'));var rp=require(_0xc58f('0x5'));var fs=require('fs');var path=require(_0xc58f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc58f('0x7'));module[_0xc58f('0x8')]=function(_0xd35626,_0x2115ea){return _0xd35626['define'](_0xc58f('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2035=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','Tag','lodash','util'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x2035,0x98));var _0x5203=function(_0x295106,_0x571d51){_0x295106=_0x295106-0x0;var _0x1c1320=_0x2035[_0x295106];return _0x1c1320;};'use strict';var _=require(_0x5203('0x0'));var util=require(_0x5203('0x1'));var logger=require('../../config/logger')(_0x5203('0x2'));var moment=require(_0x5203('0x3'));var BPromise=require(_0x5203('0x4'));var rp=require(_0x5203('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5203('0x6'));var config=require(_0x5203('0x7'));var attributes=require(_0x5203('0x8'));module[_0x5203('0x9')]=function(_0x36dd7d,_0x3ef2f3){return _0x36dd7d['define'](_0x5203('0xa'),attributes,{'tableName':'tools_tags','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 7c035ed..7f52669 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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x30efde,_0x462068){var _0x5c9bc3=function(_0x3f95be){while(--_0x3f95be){_0x30efde['push'](_0x30efde['shift']());}};_0x5c9bc3(++_0x462068);}(_0x6aa7,0x178));var _0x76aa=function(_0x4d3562,_0x47900c){_0x4d3562=_0x4d3562-0x0;var _0x2599fc=_0x6aa7[_0x4d3562];return _0x2599fc;};'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);});});} \ No newline at end of file +var _0x50a6=['../../config/environment','http','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ee563,_0x190bd3){var _0x3f1c70=function(_0x1e24bf){while(--_0x1e24bf){_0x3ee563['push'](_0x3ee563['shift']());}};_0x3f1c70(++_0x190bd3);}(_0x50a6,0xa4));var _0x650a=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x50a6[_0x1ebd10];return _0x1004d3;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Tag,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Tag,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 210f4c1..968ad3f 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var 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 51a27c4..0057854 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 _0xb10b=['name','sequelize','STRING'];(function(_0x17d76d,_0xbdf03f){var _0x55b873=function(_0x41073c){while(--_0x41073c){_0x17d76d['push'](_0x17d76d['shift']());}};_0x55b873(++_0xbdf03f);}(_0xb10b,0x12a));var _0xbb10=function(_0x36f8c5,_0x173213){_0x36f8c5=_0x36f8c5-0x0;var _0x3dee1a=_0xb10b[_0x36f8c5];return _0x3dee1a;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4517fe1..8a54ae7 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 _0x6a02=['upsert','spread','removeAgents','isArray','Chat','Whatsapp','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','map','Team','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','error','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserVoiceQueue','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','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','end','send','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','order','Queues','addQueues','isValidChannel','add','ids','removeQueues','remove','addAgents','Voice','Mail','Sms','Fax','Openchannel','through','QueueId','defaults','TeamVoiceQueue','penalty','User','Queue','findOrCreate','emit','Queue:save','online','interface','isNil','format','SIP/%s','voicePause','all','UserVoicePrefix'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x6a02,0x1e6));var _0x26a0=function(_0x511f6e,_0x27f388){_0x511f6e=_0x511f6e-0x0;var _0x5aaa69=_0x6a02[_0x511f6e];return _0x5aaa69;};'use strict';var emlformat=require(_0x26a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26a0('0x1'));var jsonpatch=require(_0x26a0('0x2'));var rp=require(_0x26a0('0x3'));var moment=require(_0x26a0('0x4'));var BPromise=require(_0x26a0('0x5'));var Mustache=require(_0x26a0('0x6'));var util=require(_0x26a0('0x7'));var path=require('path');var sox=require(_0x26a0('0x8'));var csv=require('to-csv');var ejs=require(_0x26a0('0x9'));var fs=require('fs');var fs_extra=require(_0x26a0('0xa'));var _=require('lodash');var squel=require(_0x26a0('0xb'));var crypto=require(_0x26a0('0xc'));var jsforce=require(_0x26a0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x26a0('0xe'));var querystring=require(_0x26a0('0xf'));var Papa=require(_0x26a0('0x10'));var Redis=require(_0x26a0('0x11'));var authService=require(_0x26a0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x26a0('0x13'));var hardwareService=require(_0x26a0('0x14'));var logger=require(_0x26a0('0x15'))(_0x26a0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26a0('0x17'))['db'];config[_0x26a0('0x18')]=_['defaults'](config[_0x26a0('0x18')],{'host':_0x26a0('0x19'),'port':0x18eb});var socket=require(_0x26a0('0x1a'))(new Redis(config[_0x26a0('0x18')]));require(_0x26a0('0x1b'))[_0x26a0('0x1c')](socket);function respondWithStatusCode(_0x5aceb9,_0x321186){_0x321186=_0x321186||0xcc;return function(_0x53198f){if(_0x53198f){return _0x5aceb9[_0x26a0('0x1d')](_0x321186);}return _0x5aceb9[_0x26a0('0x1e')](_0x321186)['end']();};}function respondWithResult(_0xf8bfb6,_0xec264e){_0xec264e=_0xec264e||0xc8;return function(_0x3eb164){if(_0x3eb164){return _0xf8bfb6['status'](_0xec264e)[_0x26a0('0x1f')](_0x3eb164);}};}function respondWithFilteredResult(_0x2334dc,_0x347eaa){return function(_0x458e9d){if(_0x458e9d){var _0x5802c4=typeof _0x347eaa[_0x26a0('0x20')]===_0x26a0('0x21')&&typeof _0x347eaa[_0x26a0('0x22')]===_0x26a0('0x21');var _0x173928=_0x458e9d[_0x26a0('0x23')];var _0x10da7f=_0x5802c4?0x0:_0x347eaa[_0x26a0('0x20')];var _0x33c7b7=_0x5802c4?_0x458e9d['count']:_0x347eaa[_0x26a0('0x20')]+_0x347eaa[_0x26a0('0x22')];var _0x1889f8;if(_0x33c7b7>=_0x173928){_0x33c7b7=_0x173928;_0x1889f8=0xc8;}else{_0x1889f8=0xce;}_0x2334dc[_0x26a0('0x1e')](_0x1889f8);return _0x2334dc['set'](_0x26a0('0x24'),_0x10da7f+'-'+_0x33c7b7+'/'+_0x173928)['json'](_0x458e9d);}return null;};}function patchUpdates(_0x91cf3d){return function(_0x11155f){try{jsonpatch[_0x26a0('0x25')](_0x11155f,_0x91cf3d,!![]);}catch(_0x18d252){return BPromise[_0x26a0('0x26')](_0x18d252);}return _0x11155f[_0x26a0('0x27')]();};}function saveUpdates(_0x1d4a0b,_0x31f9e3){return function(_0x10eed7){if(_0x10eed7){return _0x10eed7[_0x26a0('0x28')](_0x1d4a0b)[_0x26a0('0x29')](function(_0x231841){return _0x231841;});}return null;};}function handleEntityNotFound(_0x225b27,_0x2705a2){return function(_0x23ccfb){if(!_0x23ccfb){_0x225b27['sendStatus'](0x194);}return _0x23ccfb;};}function handleError(_0x5e3150,_0x2f3743){_0x2f3743=_0x2f3743||0x1f4;return function(_0x588219){logger['error'](_0x588219[_0x26a0('0x2a')]);if(_0x588219[_0x26a0('0x2b')]){delete _0x588219[_0x26a0('0x2b')];}_0x5e3150[_0x26a0('0x1e')](_0x2f3743)['send'](_0x588219);};}exports['index']=function(_0x58e993,_0x5c6257){var _0x5df65c={},_0x197f50={},_0x1b996c={'count':0x0,'rows':[]};var _0x4894b5=_[_0x26a0('0x2c')](db[_0x26a0('0x2d')][_0x26a0('0x2e')],function(_0x1d91c2){return{'name':_0x1d91c2[_0x26a0('0x2f')],'type':_0x1d91c2[_0x26a0('0x30')][_0x26a0('0x31')]};});_0x197f50[_0x26a0('0x32')]=_[_0x26a0('0x2c')](_0x4894b5,'name');_0x197f50['query']=_[_0x26a0('0x33')](_0x58e993['query']);_0x197f50[_0x26a0('0x34')]=_[_0x26a0('0x35')](_0x197f50[_0x26a0('0x32')],_0x197f50[_0x26a0('0x36')]);_0x5df65c[_0x26a0('0x37')]=_['intersection'](_0x197f50[_0x26a0('0x32')],qs[_0x26a0('0x38')](_0x58e993[_0x26a0('0x36')][_0x26a0('0x38')]));_0x5df65c['attributes']=_0x5df65c[_0x26a0('0x37')][_0x26a0('0x39')]?_0x5df65c[_0x26a0('0x37')]:_0x197f50[_0x26a0('0x32')];if(!_0x58e993[_0x26a0('0x36')][_0x26a0('0x3a')](_0x26a0('0x3b'))){_0x5df65c['limit']=qs[_0x26a0('0x22')](_0x58e993['query']['limit']);_0x5df65c[_0x26a0('0x20')]=qs[_0x26a0('0x20')](_0x58e993[_0x26a0('0x36')][_0x26a0('0x20')]);}_0x5df65c['order']=qs['sort'](_0x58e993[_0x26a0('0x36')][_0x26a0('0x3c')]);_0x5df65c['where']=qs['filters'](_[_0x26a0('0x3d')](_0x58e993[_0x26a0('0x36')],_0x197f50[_0x26a0('0x34')]),_0x4894b5);if(_0x58e993['query'][_0x26a0('0x3e')]){_0x5df65c['where']=_['merge'](_0x5df65c[_0x26a0('0x3f')],{'$or':_[_0x26a0('0x2c')](_0x4894b5,function(_0x3799a3){if(_0x3799a3['type']!==_0x26a0('0x40')){var _0x357bef={};_0x357bef[_0x3799a3[_0x26a0('0x2b')]]={'$like':'%'+_0x58e993[_0x26a0('0x36')][_0x26a0('0x3e')]+'%'};return _0x357bef;}})});}_0x5df65c=_[_0x26a0('0x41')]({},_0x5df65c,_0x58e993[_0x26a0('0x42')]);var _0x59715f={'where':_0x5df65c[_0x26a0('0x3f')]};return db[_0x26a0('0x2d')][_0x26a0('0x23')](_0x59715f)[_0x26a0('0x29')](function(_0x15fb68){_0x1b996c[_0x26a0('0x23')]=_0x15fb68;if(_0x58e993[_0x26a0('0x36')][_0x26a0('0x43')]){_0x5df65c[_0x26a0('0x44')]=[{'all':!![]}];}return db['Team'][_0x26a0('0x45')](_0x5df65c);})[_0x26a0('0x29')](function(_0x5a2338){_0x1b996c[_0x26a0('0x46')]=_0x5a2338;return _0x1b996c;})[_0x26a0('0x29')](respondWithFilteredResult(_0x5c6257,_0x5df65c))['catch'](handleError(_0x5c6257,null));};exports[_0x26a0('0x47')]=function(_0xde2865,_0xa41622){var _0x2a37c7={'raw':![],'where':{'id':_0xde2865[_0x26a0('0x48')]['id']}},_0x20cd5={};_0x20cd5[_0x26a0('0x32')]=_[_0x26a0('0x33')](db['Team']['rawAttributes']);_0x20cd5[_0x26a0('0x36')]=_[_0x26a0('0x33')](_0xde2865[_0x26a0('0x36')]);_0x20cd5[_0x26a0('0x34')]=_[_0x26a0('0x35')](_0x20cd5[_0x26a0('0x32')],_0x20cd5[_0x26a0('0x36')]);_0x2a37c7[_0x26a0('0x37')]=_[_0x26a0('0x35')](_0x20cd5[_0x26a0('0x32')],qs[_0x26a0('0x38')](_0xde2865[_0x26a0('0x36')]['fields']));_0x2a37c7[_0x26a0('0x37')]=_0x2a37c7[_0x26a0('0x37')][_0x26a0('0x39')]?_0x2a37c7[_0x26a0('0x37')]:_0x20cd5[_0x26a0('0x32')];if(_0xde2865[_0x26a0('0x36')][_0x26a0('0x43')]){_0x2a37c7[_0x26a0('0x44')]=[{'all':!![]}];}_0x2a37c7=_['merge']({},_0x2a37c7,_0xde2865[_0x26a0('0x42')]);return db[_0x26a0('0x2d')][_0x26a0('0x49')](_0x2a37c7)[_0x26a0('0x29')](handleEntityNotFound(_0xa41622,null))[_0x26a0('0x29')](respondWithResult(_0xa41622,null))[_0x26a0('0x4a')](handleError(_0xa41622,null));};exports[_0x26a0('0x4b')]=function(_0x3796a1,_0x59b4ea){return db['Team'][_0x26a0('0x4b')](_0x3796a1[_0x26a0('0x4c')],{})[_0x26a0('0x29')](function(_0x28b06a){var _0x204d77=_0x3796a1[_0x26a0('0x4d')][_0x26a0('0x4e')]({'plain':!![]});if(!_0x204d77)throw new Error(_0x26a0('0x4f'));if(_0x204d77[_0x26a0('0x50')]===_0x26a0('0x4d')){var _0x5e8992=_0x28b06a['get']({'plain':!![]});var _0x2181a7=_0x26a0('0x51');return db[_0x26a0('0x52')]['find']({'where':{'name':_0x2181a7,'userProfileId':_0x204d77[_0x26a0('0x53')]},'raw':!![]})[_0x26a0('0x29')](function(_0x4d1f50){if(_0x4d1f50&&_0x4d1f50[_0x26a0('0x54')]===0x0){return db['UserProfileResource'][_0x26a0('0x4b')]({'name':_0x5e8992[_0x26a0('0x2b')],'resourceId':_0x5e8992['id'],'type':_0x4d1f50['name'],'sectionId':_0x4d1f50['id']},{})['then'](function(){return _0x28b06a;});}else{return _0x28b06a;}})['catch'](function(_0xe2e909){logger[_0x26a0('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe2e909);throw _0xe2e909;});}return _0x28b06a;})['then'](respondWithResult(_0x59b4ea,0xc9))[_0x26a0('0x4a')](handleError(_0x59b4ea,null));};exports['update']=function(_0x38f876,_0x169d1a){if(_0x38f876['body']['id']){delete _0x38f876[_0x26a0('0x4c')]['id'];}return db[_0x26a0('0x2d')][_0x26a0('0x49')]({'where':{'id':_0x38f876[_0x26a0('0x48')]['id']}})[_0x26a0('0x29')](handleEntityNotFound(_0x169d1a,null))[_0x26a0('0x29')](saveUpdates(_0x38f876[_0x26a0('0x4c')],null))[_0x26a0('0x29')](respondWithResult(_0x169d1a,null))['catch'](handleError(_0x169d1a,null));};exports[_0x26a0('0x56')]=function(_0x112671,_0x54a9f7){var _0x420c37=_0x112671['params']['id'];var _0x1ce38d=[];return db[_0x26a0('0x57')][_0x26a0('0x58')](function(_0x2d6a49){var _0x1d232e=_0x26a0('0x59')+_0x420c37;return db[_0x26a0('0x57')][_0x26a0('0x36')](_0x1d232e,{'type':db[_0x26a0('0x5a')][_0x26a0('0x5b')][_0x26a0('0x5c')],'raw':!![],'transaction':_0x2d6a49})[_0x26a0('0x29')](function(_0x18e19e){_0x1ce38d=_[_0x26a0('0x2c')](_0x18e19e,function(_0x2cca50){return Number(_0x2cca50['UserId']);});})[_0x26a0('0x29')](function(){var _0x4ad70d='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x420c37;return db[_0x26a0('0x57')][_0x26a0('0x36')](_0x4ad70d,{'type':db['Sequelize'][_0x26a0('0x5b')][_0x26a0('0x5c')],'raw':!![],'transaction':_0x2d6a49});})['then'](function(_0x427a80){var _0x3a1518=_[_0x26a0('0x2c')](_0x427a80,function(_0x44ea31){return Number(_0x44ea31['VoiceQueueId']);});return db[_0x26a0('0x5d')][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'VoiceQueueId':{'$in':_0x3a1518}},'transaction':_0x2d6a49});})['then'](function(){var _0x321c2a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x420c37;return db['sequelize'][_0x26a0('0x36')](_0x321c2a,{'type':db[_0x26a0('0x5a')][_0x26a0('0x5b')][_0x26a0('0x5c')],'raw':!![],'transaction':_0x2d6a49});})['then'](function(_0x182b90){var _0x14f232=_['map'](_0x182b90,function(_0x49bd93){return Number(_0x49bd93['MailQueueId']);});return db['UserMailQueue'][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'MailQueueId':{'$in':_0x14f232}},'transaction':_0x2d6a49});})['then'](function(){var _0x2e865c='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x420c37;return db['sequelize'][_0x26a0('0x36')](_0x2e865c,{'type':db['Sequelize'][_0x26a0('0x5b')]['SELECT'],'raw':!![],'transaction':_0x2d6a49});})['then'](function(_0xb2181){var _0x5471ef=_[_0x26a0('0x2c')](_0xb2181,function(_0x3a9b9c){return Number(_0x3a9b9c['SmsQueueId']);});return db[_0x26a0('0x5e')][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'SmsQueueId':{'$in':_0x5471ef}},'transaction':_0x2d6a49});})['then'](function(){var _0x5b1577=_0x26a0('0x5f')+_0x420c37;return db[_0x26a0('0x57')][_0x26a0('0x36')](_0x5b1577,{'type':db['Sequelize'][_0x26a0('0x5b')][_0x26a0('0x5c')],'raw':!![],'transaction':_0x2d6a49});})['then'](function(_0x326355){var _0x360f4b=_[_0x26a0('0x2c')](_0x326355,function(_0x561996){return Number(_0x561996[_0x26a0('0x60')]);});return db[_0x26a0('0x61')][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'ChatQueueId':{'$in':_0x360f4b}},'transaction':_0x2d6a49});})[_0x26a0('0x29')](function(){var _0x1a16be=_0x26a0('0x62')+_0x420c37;return db['sequelize'][_0x26a0('0x36')](_0x1a16be,{'type':db['Sequelize'][_0x26a0('0x5b')][_0x26a0('0x5c')],'raw':!![],'transaction':_0x2d6a49});})[_0x26a0('0x29')](function(_0x28d8b1){var _0x1b0006=_[_0x26a0('0x2c')](_0x28d8b1,function(_0x535ee6){return Number(_0x535ee6[_0x26a0('0x63')]);});return db[_0x26a0('0x64')]['destroy']({'where':{'UserId':{'$in':_0x1ce38d},'FaxQueueId':{'$in':_0x1b0006}},'transaction':_0x2d6a49});})[_0x26a0('0x29')](function(){var _0x53ff44=_0x26a0('0x65')+_0x420c37;return db['sequelize']['query'](_0x53ff44,{'type':db['Sequelize'][_0x26a0('0x5b')]['SELECT'],'raw':!![],'transaction':_0x2d6a49});})[_0x26a0('0x29')](function(_0x9af3cf){var _0x1555b1=_['map'](_0x9af3cf,function(_0x53693d){return Number(_0x53693d[_0x26a0('0x66')]);});return db[_0x26a0('0x67')][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'OpenchannelQueueId':{'$in':_0x1555b1}},'transaction':_0x2d6a49});})['then'](function(){var _0x3e3bb6=_0x26a0('0x68')+_0x420c37;return db['sequelize']['query'](_0x3e3bb6,{'type':db['Sequelize'][_0x26a0('0x5b')]['SELECT'],'raw':!![],'transaction':_0x2d6a49});})['then'](function(_0x4c9441){var _0x200015=_[_0x26a0('0x2c')](_0x4c9441,function(_0x25fb32){return Number(_0x25fb32['WhatsappQueueId']);});return db[_0x26a0('0x69')][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'WhatsappQueueId':{'$in':_0x200015}},'transaction':_0x2d6a49});})['then'](function(){return db[_0x26a0('0x6a')]['find']({'where':{'TeamId':_0x420c37}});})[_0x26a0('0x29')](function(_0x52fc18){if(_0x52fc18===null){return;}return db['UserVoicePrefix'][_0x26a0('0x56')]({'where':{'UserId':{'$in':_0x1ce38d},'VoicePrefixId':_0x52fc18[_0x26a0('0x6b')]},'transaction':_0x2d6a49});})[_0x26a0('0x29')](function(){return db[_0x26a0('0x2d')][_0x26a0('0x56')]({'where':{'id':_0x420c37},'cascade':!![],'transaction':_0x2d6a49});})[_0x26a0('0x29')](function(_0x395928){if(_0x395928===0x0){_0x54a9f7[_0x26a0('0x1d')](0x194);}else{return db[_0x26a0('0x6c')][_0x26a0('0x56')]({'where':{'type':_0x26a0('0x51'),'resourceId':_0x420c37},'cascade':!![],'transaction':_0x2d6a49})[_0x26a0('0x29')](function(){_0x54a9f7[_0x26a0('0x1e')](0xcc)[_0x26a0('0x6d')]();});}})[_0x26a0('0x4a')](function(_0x4bfdbb){_0x54a9f7[_0x26a0('0x1e')](0x1f4)[_0x26a0('0x6e')](_0x4bfdbb);});});};exports[_0x26a0('0x6f')]=function(_0x46a2c3,_0x117c8f,_0x403d1d){return db[_0x26a0('0x2d')][_0x26a0('0x70')]({'where':{'id':_0x46a2c3[_0x26a0('0x48')]['id']}})[_0x26a0('0x29')](handleEntityNotFound(_0x117c8f,null))[_0x26a0('0x29')](function(_0x445096){if(!_0x46a2c3[_0x26a0('0x36')]['channel']||!utils['isValidChannel'](_0x46a2c3['query'][_0x26a0('0x71')])){throw new db[(_0x26a0('0x5a'))][(_0x26a0('0x72'))](_0x26a0('0x73'));}var _0x64aee3={};var _0x3a914d={};_0x3a914d[_0x26a0('0x32')]=_[_0x26a0('0x33')](db[_[_0x26a0('0x74')](_0x46a2c3[_0x26a0('0x36')]['channel'][_0x26a0('0x75')]())+'Queue'][_0x26a0('0x2e')]);_0x3a914d[_0x26a0('0x36')]=_['keys'](_0x46a2c3['query']);_0x3a914d[_0x26a0('0x34')]=_[_0x26a0('0x35')](_0x3a914d[_0x26a0('0x32')],_0x3a914d[_0x26a0('0x36')]);_0x64aee3['attributes']=_['intersection'](_0x3a914d[_0x26a0('0x32')],qs[_0x26a0('0x38')](_0x46a2c3[_0x26a0('0x36')][_0x26a0('0x38')]));_0x64aee3[_0x26a0('0x37')]=_0x64aee3[_0x26a0('0x37')][_0x26a0('0x39')]?_0x64aee3[_0x26a0('0x37')]:_0x3a914d[_0x26a0('0x32')];_0x64aee3[_0x26a0('0x22')]=qs[_0x26a0('0x22')](_0x46a2c3['query'][_0x26a0('0x22')]);_0x64aee3[_0x26a0('0x20')]=qs[_0x26a0('0x20')](_0x46a2c3[_0x26a0('0x36')]['offset']);_0x64aee3[_0x26a0('0x76')]=qs['sort'](_0x46a2c3['query'][_0x26a0('0x3c')]);_0x64aee3[_0x26a0('0x3f')]=qs[_0x26a0('0x34')](_[_0x26a0('0x3d')](_0x46a2c3[_0x26a0('0x36')],_0x3a914d[_0x26a0('0x34')]));_0x64aee3=_[_0x26a0('0x41')]({},_0x64aee3,_0x46a2c3[_0x26a0('0x42')]);return _0x445096['get'+_[_0x26a0('0x74')](_0x46a2c3[_0x26a0('0x36')][_0x26a0('0x71')][_0x26a0('0x75')]())+_0x26a0('0x77')](_0x64aee3);})[_0x26a0('0x29')](respondWithResult(_0x117c8f,null))['catch'](handleError(_0x117c8f,null));};exports[_0x26a0('0x78')]=function(_0x584f2c,_0x402d5e,_0x1100ca){return db[_0x26a0('0x2d')]['findOne']({'where':{'id':_0x584f2c[_0x26a0('0x48')]['id']}})[_0x26a0('0x29')](function(_0xe8a7de){if(_0xe8a7de){if(!_0x584f2c[_0x26a0('0x4c')][_0x26a0('0x71')]||!utils[_0x26a0('0x79')](_0x584f2c[_0x26a0('0x4c')][_0x26a0('0x71')])){throw new db['Sequelize'][(_0x26a0('0x72'))](_0x26a0('0x73'));}return _0xe8a7de[_0x26a0('0x7a')+_[_0x26a0('0x74')](_0x584f2c[_0x26a0('0x4c')][_0x26a0('0x71')][_0x26a0('0x75')]())+_0x26a0('0x77')](_0x584f2c['body'][_0x26a0('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x402d5e,null))['then'](respondWithStatusCode(_0x402d5e,null))['catch'](handleError(_0x402d5e,null));};exports[_0x26a0('0x7c')]=function(_0x35c393,_0xa04908,_0x121d84){return db[_0x26a0('0x2d')][_0x26a0('0x70')]({'where':{'id':_0x35c393[_0x26a0('0x48')]['id']}})[_0x26a0('0x29')](function(_0x445e7a){if(_0x445e7a){if(!_0x35c393[_0x26a0('0x36')]['channel']||!utils['isValidChannel'](_0x35c393[_0x26a0('0x36')]['channel'])){throw new db[(_0x26a0('0x5a'))][(_0x26a0('0x72'))](_0x26a0('0x73'));}return _0x445e7a[_0x26a0('0x7d')+_['capitalize'](_0x35c393[_0x26a0('0x36')][_0x26a0('0x71')][_0x26a0('0x75')]())+'Queues'](_0x35c393['query'][_0x26a0('0x7b')]);}return null;})['then'](handleEntityNotFound(_0xa04908,null))[_0x26a0('0x29')](respondWithStatusCode(_0xa04908,null))[_0x26a0('0x4a')](handleError(_0xa04908,null));};exports[_0x26a0('0x7e')]=function(_0x555d5a,_0x32a1e7){var _0x476e2d=_['isArray'](_0x555d5a[_0x26a0('0x4c')][_0x26a0('0x7b')])?_0x555d5a[_0x26a0('0x4c')]['ids']:[_0x555d5a[_0x26a0('0x4c')][_0x26a0('0x7b')]];var _0x3d081b=_0x555d5a[_0x26a0('0x48')]['id'];return db[_0x26a0('0x2d')][_0x26a0('0x49')]({'where':{'id':_0x3d081b}})[_0x26a0('0x29')](handleEntityNotFound(_0x32a1e7,null))['then'](function(_0x586dc1){if(_0x586dc1){var _0x52b6a3=[_0x26a0('0x7f'),'Chat',_0x26a0('0x80'),_0x26a0('0x81'),_0x26a0('0x82'),_0x26a0('0x83'),'Whatsapp'];return db[_0x26a0('0x57')][_0x26a0('0x58')](function(_0xb63b35){var _0x21fd47=_[_0x26a0('0x2c')](_0x52b6a3,function(_0x413249){var _0x3055f5={'attributes':['id',_0x26a0('0x2b')]};if(_0x413249===_0x26a0('0x7f')){_0x3055f5[_0x26a0('0x84')]={'attributes':['penalty']};}return _0x586dc1[_0x26a0('0x4e')+_0x413249+'Queues'](_0x3055f5)[_0x26a0('0x29')](function(_0x3f6512){var _0x25e786=_[_0x26a0('0x2c')](_0x3f6512,function(_0x2c6ad9){var _0x274438=_[_0x26a0('0x2c')](_0x476e2d,function(_0x2795f7){var _0x4fed89={'where':{'UserId':_0x2795f7,[_0x413249+_0x26a0('0x85')]:_0x2c6ad9['id']},'transaction':_0xb63b35};if(_0x413249===_0x26a0('0x7f')){_0x4fed89[_0x26a0('0x86')]={'penalty':_0x2c6ad9[_0x26a0('0x87')][_0x26a0('0x88')]};}return db[_0x26a0('0x89')+_0x413249+_0x26a0('0x8a')][_0x26a0('0x8b')](_0x4fed89)[_0x26a0('0x29')](function(){socket[_0x26a0('0x8c')](_0x26a0('0x4d')+_0x413249+_0x26a0('0x8d'),{'UserId':_0x2795f7,[_0x413249+'QueueId']:_0x2c6ad9['id']});if(_0x413249!==_0x26a0('0x7f')){return;}return db[_0x26a0('0x89')][_0x26a0('0x45')]({'where':{'id':_0x476e2d,'online':0x1},'attributes':['id','name',_0x26a0('0x8e'),'voicePause',_0x26a0('0x8f')],'raw':!![]})['then'](function(_0x521cb5){var _0x58885e=_[_0x26a0('0x2c')](_0x521cb5,function(_0xa7e6e3){return db['UserVoiceQueueRt']['upsert']({'membername':_0xa7e6e3[_0x26a0('0x2b')],'UserId':_0xa7e6e3['id'],'queue_name':_0x2c6ad9['name'],'VoiceQueueId':_0x2c6ad9['id'],'interface':_[_0x26a0('0x90')](_0xa7e6e3[_0x26a0('0x8f')])?util[_0x26a0('0x91')](_0x26a0('0x92'),_0xa7e6e3['name']):_0xa7e6e3[_0x26a0('0x8f')],'paused':_0xa7e6e3[_0x26a0('0x93')]||![],'penalty':_0x2c6ad9['TeamVoiceQueue'][_0x26a0('0x88')]},{'transaction':_0xb63b35});});return Promise[_0x26a0('0x94')](_0x58885e);});});});return Promise[_0x26a0('0x94')](_0x274438);});return Promise[_0x26a0('0x94')](_0x25e786);})[_0x26a0('0x29')](function(){return db[_0x26a0('0x6a')][_0x26a0('0x70')]({'where':{'teamId':_0x3d081b}})[_0x26a0('0x29')](function(_0xc58038){if(_0xc58038){var _0x31659a=_[_0x26a0('0x2c')](_0x476e2d,function(_0x3d1be0){db[_0x26a0('0x95')][_0x26a0('0x96')]({'UserId':_0x3d1be0,'VoicePrefixId':_0xc58038['VoicePrefixId']});});return Promise[_0x26a0('0x94')](_0x31659a);}});});});return Promise[_0x26a0('0x94')](_0x21fd47)[_0x26a0('0x29')](function(){return _0x586dc1[_0x26a0('0x7e')](_0x476e2d,{'transaction':_0xb63b35})[_0x26a0('0x97')](function(_0xc00f0f){return _0xc00f0f;});});});}})[_0x26a0('0x29')](respondWithResult(_0x32a1e7,null))[_0x26a0('0x4a')](handleError(_0x32a1e7,null));};exports[_0x26a0('0x98')]=function(_0x3ae0e6,_0x2a18e2){var _0x5b8bac=_[_0x26a0('0x99')](_0x3ae0e6[_0x26a0('0x36')][_0x26a0('0x7b')])?_0x3ae0e6[_0x26a0('0x36')][_0x26a0('0x7b')]:[_0x3ae0e6[_0x26a0('0x36')][_0x26a0('0x7b')]];var _0x26aadf=_0x3ae0e6[_0x26a0('0x48')]['id'];return db[_0x26a0('0x2d')][_0x26a0('0x49')]({'where':{'id':_0x26aadf}})[_0x26a0('0x29')](handleEntityNotFound(_0x2a18e2,null))['then'](function(_0x23fb56){if(_0x23fb56){var _0x229dae=['Voice',_0x26a0('0x9a'),_0x26a0('0x80'),_0x26a0('0x81'),'Fax','Openchannel',_0x26a0('0x9b')];return db[_0x26a0('0x57')][_0x26a0('0x58')](function(_0x57f4ce){var _0x455b78=_[_0x26a0('0x2c')](_0x229dae,function(_0x29b953){var _0x35a034={'attributes':['id','name']};return _0x23fb56[_0x26a0('0x4e')+_0x29b953+'Queues'](_0x35a034)[_0x26a0('0x29')](function(_0x9dc162){var _0x1c38be=_[_0x26a0('0x2c')](_0x9dc162,function(_0x528222){return _0x528222[_0x26a0('0x98')](_0x5b8bac,{'transaction':_0x57f4ce})['then'](function(){var _0x5c2837=_[_0x26a0('0x2c')](_0x5b8bac,function(_0x3f725e){socket[_0x26a0('0x8c')](_0x26a0('0x4d')+_0x29b953+_0x26a0('0x9c'),{'UserId':Number(_0x3f725e),[_0x29b953+_0x26a0('0x85')]:_0x528222['id']});if(_0x29b953!==_0x26a0('0x7f')){return;}return db[_0x26a0('0x9d')][_0x26a0('0x56')]({'where':{'VoiceQueueId':_0x528222['id'],'UserId':_0x3f725e},'transaction':_0x57f4ce});});return Promise['all'](_0x5c2837);});});return Promise[_0x26a0('0x94')](_0x1c38be);});});return Promise[_0x26a0('0x94')](_0x455b78)[_0x26a0('0x29')](function(){return _0x23fb56[_0x26a0('0x98')](_0x5b8bac,{'transaction':_0x57f4ce});})[_0x26a0('0x29')](function(){return db[_0x26a0('0x6a')][_0x26a0('0x70')]({'where':{'teamId':_0x26aadf}})[_0x26a0('0x29')](function(_0x508b1f){if(_0x508b1f){var _0x46fc2f=_['map'](_0x5b8bac,function(_0x38caea){db['UserVoicePrefix'][_0x26a0('0x56')]({'where':{'UserId':_0x38caea,'VoicePrefixId':_0x508b1f['VoicePrefixId']}});});return Promise['all'](_0x46fc2f);}});});});}})['then'](respondWithStatusCode(_0x2a18e2,null))[_0x26a0('0x4a')](handleError(_0x2a18e2,null));};exports[_0x26a0('0x9e')]=function(_0x43521c,_0x190278,_0x4e8475){var _0x2fe090={};var _0x3574c4={};var _0x1cbc77;var _0x117ad9;return db[_0x26a0('0x2d')][_0x26a0('0x70')]({'where':{'id':_0x43521c[_0x26a0('0x48')]['id']}})[_0x26a0('0x29')](handleEntityNotFound(_0x190278,null))[_0x26a0('0x29')](function(_0x47b579){if(_0x47b579){_0x1cbc77=_0x47b579;_0x3574c4['model']=_[_0x26a0('0x33')](db[_0x26a0('0x89')][_0x26a0('0x2e')]);_0x3574c4[_0x26a0('0x36')]=_['keys'](_0x43521c[_0x26a0('0x36')]);_0x3574c4[_0x26a0('0x34')]=_[_0x26a0('0x35')](_0x3574c4[_0x26a0('0x32')],_0x3574c4[_0x26a0('0x36')]);_0x2fe090['attributes']=_['intersection'](_0x3574c4[_0x26a0('0x32')],qs['fields'](_0x43521c[_0x26a0('0x36')][_0x26a0('0x38')]));_0x2fe090[_0x26a0('0x37')]=_0x2fe090[_0x26a0('0x37')][_0x26a0('0x39')]?_0x2fe090['attributes']:_0x3574c4[_0x26a0('0x32')];_0x2fe090[_0x26a0('0x76')]=qs[_0x26a0('0x3c')](_0x43521c['query'][_0x26a0('0x3c')]);_0x2fe090[_0x26a0('0x3f')]=qs[_0x26a0('0x34')](_[_0x26a0('0x3d')](_0x43521c['query'],_0x3574c4[_0x26a0('0x34')]));if(_0x43521c[_0x26a0('0x36')][_0x26a0('0x3e')]){_0x2fe090[_0x26a0('0x3f')]=_[_0x26a0('0x41')](_0x2fe090['where'],{'$or':_['map'](_0x2fe090[_0x26a0('0x37')],function(_0x2ce6e7){var _0x14de0d={};_0x14de0d[_0x2ce6e7]={'$like':'%'+_0x43521c['query'][_0x26a0('0x3e')]+'%'};return _0x14de0d;})});}_0x2fe090=_[_0x26a0('0x41')]({},_0x2fe090,_0x43521c['options']);return _0x1cbc77['getAgents'](_0x2fe090);}})[_0x26a0('0x29')](function(_0xbd9d4a){if(_0xbd9d4a){_0x117ad9=_0xbd9d4a['length'];if(!_0x43521c[_0x26a0('0x36')][_0x26a0('0x3a')](_0x26a0('0x3b'))){_0x2fe090[_0x26a0('0x22')]=qs['limit'](_0x43521c[_0x26a0('0x36')][_0x26a0('0x22')]);_0x2fe090[_0x26a0('0x20')]=qs['offset'](_0x43521c[_0x26a0('0x36')][_0x26a0('0x20')]);}return _0x1cbc77[_0x26a0('0x9e')](_0x2fe090);}})['then'](function(_0x30e41b){if(_0x30e41b){return _0x30e41b?{'count':_0x117ad9,'rows':_0x30e41b}:null;}})['then'](respondWithResult(_0x190278,null))[_0x26a0('0x4a')](handleError(_0x190278,null));}; \ No newline at end of file +var _0xb317=['../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','filter','options','include','findAll','rows','show','params','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','destroy','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','channel','add','Queues','ids','removeQueues','remove','Voice','Mail','Sms','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','addAgents','spread','removeAgents','Chat','Fax','user','getAgents','findOne','hasOwnProperty','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5a4413,_0xa74e04){var _0x41c8c1=function(_0x19c4b6){while(--_0x19c4b6){_0x5a4413['push'](_0x5a4413['shift']());}};_0x41c8c1(++_0xa74e04);}(_0xb317,0x1c0));var _0x7b31=function(_0x53e1e4,_0x26e697){_0x53e1e4=_0x53e1e4-0x0;var _0x758d0e=_0xb317[_0x53e1e4];return _0x758d0e;};'use strict';var emlformat=require(_0x7b31('0x0'));var rimraf=require(_0x7b31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7b31('0x2'));var moment=require(_0x7b31('0x3'));var BPromise=require(_0x7b31('0x4'));var Mustache=require(_0x7b31('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7b31('0x6'));var csv=require(_0x7b31('0x7'));var ejs=require(_0x7b31('0x8'));var fs=require('fs');var fs_extra=require(_0x7b31('0x9'));var _=require(_0x7b31('0xa'));var squel=require(_0x7b31('0xb'));var crypto=require(_0x7b31('0xc'));var jsforce=require(_0x7b31('0xd'));var deskjs=require(_0x7b31('0xe'));var toCsv=require(_0x7b31('0x7'));var querystring=require(_0x7b31('0xf'));var Papa=require(_0x7b31('0x10'));var Redis=require(_0x7b31('0x11'));var authService=require(_0x7b31('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7b31('0x13'));var hardwareService=require(_0x7b31('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7b31('0x15'));var licenseUtil=require(_0x7b31('0x16'));var db=require(_0x7b31('0x17'))['db'];config['redis']=_[_0x7b31('0x18')](config[_0x7b31('0x19')],{'host':_0x7b31('0x1a'),'port':0x18eb});var socket=require(_0x7b31('0x1b'))(new Redis(config[_0x7b31('0x19')]));require(_0x7b31('0x1c'))[_0x7b31('0x1d')](socket);function respondWithStatusCode(_0x397655,_0x2d38c3){_0x2d38c3=_0x2d38c3||0xcc;return function(_0x22b254){if(_0x22b254){return _0x397655[_0x7b31('0x1e')](_0x2d38c3);}return _0x397655['status'](_0x2d38c3)[_0x7b31('0x1f')]();};}function respondWithResult(_0x370b8c,_0x532d40){_0x532d40=_0x532d40||0xc8;return function(_0xdfa663){if(_0xdfa663){return _0x370b8c[_0x7b31('0x20')](_0x532d40)[_0x7b31('0x21')](_0xdfa663);}};}function respondWithFilteredResult(_0x144e51,_0x316303){return function(_0x4b47ca){if(_0x4b47ca){var _0x830c2=typeof _0x316303['offset']===_0x7b31('0x22')&&typeof _0x316303[_0x7b31('0x23')]===_0x7b31('0x22');var _0x176dc1=_0x4b47ca['count'];var _0xb50f88=_0x830c2?0x0:_0x316303[_0x7b31('0x24')];var _0x43f651=_0x830c2?_0x4b47ca['count']:_0x316303[_0x7b31('0x24')]+_0x316303[_0x7b31('0x23')];var _0x5d2fce;if(_0x43f651>=_0x176dc1){_0x43f651=_0x176dc1;_0x5d2fce=0xc8;}else{_0x5d2fce=0xce;}_0x144e51[_0x7b31('0x20')](_0x5d2fce);return _0x144e51[_0x7b31('0x25')](_0x7b31('0x26'),_0xb50f88+'-'+_0x43f651+'/'+_0x176dc1)[_0x7b31('0x21')](_0x4b47ca);}return null;};}function patchUpdates(_0x550ef6){return function(_0x479cf7){try{jsonpatch[_0x7b31('0x27')](_0x479cf7,_0x550ef6,!![]);}catch(_0x53a80a){return BPromise[_0x7b31('0x28')](_0x53a80a);}return _0x479cf7[_0x7b31('0x29')]();};}function saveUpdates(_0x384be8,_0x3fb0f2){return function(_0x138251){if(_0x138251){return _0x138251[_0x7b31('0x2a')](_0x384be8)[_0x7b31('0x2b')](function(_0x5f4af3){return _0x5f4af3;});}return null;};}function handleEntityNotFound(_0x1d25ce,_0x190e5f){return function(_0x3d4e22){if(!_0x3d4e22){_0x1d25ce['sendStatus'](0x194);}return _0x3d4e22;};}function handleError(_0x206699,_0x892be){_0x892be=_0x892be||0x1f4;return function(_0xb857f2){logger[_0x7b31('0x2c')](_0xb857f2[_0x7b31('0x2d')]);if(_0xb857f2['name']){delete _0xb857f2[_0x7b31('0x2e')];}_0x206699[_0x7b31('0x20')](_0x892be)[_0x7b31('0x2f')](_0xb857f2);};}exports[_0x7b31('0x30')]=function(_0x3fb82b,_0x55e122){var _0x5974c7={},_0x33c255={},_0x54c346={'count':0x0,'rows':[]};var _0x52388b=_[_0x7b31('0x31')](db[_0x7b31('0x32')][_0x7b31('0x33')],function(_0x289167){return{'name':_0x289167[_0x7b31('0x34')],'type':_0x289167['type'][_0x7b31('0x35')]};});_0x33c255[_0x7b31('0x36')]=_['map'](_0x52388b,_0x7b31('0x2e'));_0x33c255[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x3fb82b[_0x7b31('0x37')]);_0x33c255[_0x7b31('0x39')]=_[_0x7b31('0x3a')](_0x33c255['model'],_0x33c255[_0x7b31('0x37')]);_0x5974c7[_0x7b31('0x3b')]=_[_0x7b31('0x3a')](_0x33c255[_0x7b31('0x36')],qs[_0x7b31('0x3c')](_0x3fb82b[_0x7b31('0x37')]['fields']));_0x5974c7['attributes']=_0x5974c7['attributes'][_0x7b31('0x3d')]?_0x5974c7[_0x7b31('0x3b')]:_0x33c255['model'];if(!_0x3fb82b[_0x7b31('0x37')]['hasOwnProperty'](_0x7b31('0x3e'))){_0x5974c7[_0x7b31('0x23')]=qs[_0x7b31('0x23')](_0x3fb82b[_0x7b31('0x37')][_0x7b31('0x23')]);_0x5974c7[_0x7b31('0x24')]=qs[_0x7b31('0x24')](_0x3fb82b['query']['offset']);}_0x5974c7[_0x7b31('0x3f')]=qs['sort'](_0x3fb82b[_0x7b31('0x37')][_0x7b31('0x40')]);_0x5974c7[_0x7b31('0x41')]=qs[_0x7b31('0x39')](_[_0x7b31('0x42')](_0x3fb82b['query'],_0x33c255[_0x7b31('0x39')]),_0x52388b);if(_0x3fb82b[_0x7b31('0x37')]['filter']){_0x5974c7[_0x7b31('0x41')]=_[_0x7b31('0x43')](_0x5974c7[_0x7b31('0x41')],{'$or':_[_0x7b31('0x31')](_0x52388b,function(_0x4a052a){if(_0x4a052a[_0x7b31('0x44')]!=='VIRTUAL'){var _0x42eeac={};_0x42eeac[_0x4a052a[_0x7b31('0x2e')]]={'$like':'%'+_0x3fb82b[_0x7b31('0x37')][_0x7b31('0x45')]+'%'};return _0x42eeac;}})});}_0x5974c7=_['merge']({},_0x5974c7,_0x3fb82b[_0x7b31('0x46')]);var _0x20d373={'where':_0x5974c7[_0x7b31('0x41')]};return db[_0x7b31('0x32')]['count'](_0x20d373)[_0x7b31('0x2b')](function(_0x12b2b0){_0x54c346['count']=_0x12b2b0;if(_0x3fb82b[_0x7b31('0x37')]['includeAll']){_0x5974c7[_0x7b31('0x47')]=[{'all':!![]}];}return db[_0x7b31('0x32')][_0x7b31('0x48')](_0x5974c7);})[_0x7b31('0x2b')](function(_0x3ad8d5){_0x54c346[_0x7b31('0x49')]=_0x3ad8d5;return _0x54c346;})[_0x7b31('0x2b')](respondWithFilteredResult(_0x55e122,_0x5974c7))['catch'](handleError(_0x55e122,null));};exports[_0x7b31('0x4a')]=function(_0x51959c,_0x3243bc){var _0x3116fa={'raw':![],'where':{'id':_0x51959c[_0x7b31('0x4b')]['id']}},_0xb89f3a={};_0xb89f3a[_0x7b31('0x36')]=_[_0x7b31('0x38')](db[_0x7b31('0x32')][_0x7b31('0x33')]);_0xb89f3a[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x51959c['query']);_0xb89f3a[_0x7b31('0x39')]=_[_0x7b31('0x3a')](_0xb89f3a['model'],_0xb89f3a['query']);_0x3116fa[_0x7b31('0x3b')]=_['intersection'](_0xb89f3a['model'],qs['fields'](_0x51959c[_0x7b31('0x37')][_0x7b31('0x3c')]));_0x3116fa['attributes']=_0x3116fa[_0x7b31('0x3b')][_0x7b31('0x3d')]?_0x3116fa[_0x7b31('0x3b')]:_0xb89f3a['model'];if(_0x51959c[_0x7b31('0x37')]['includeAll']){_0x3116fa[_0x7b31('0x47')]=[{'all':!![]}];}_0x3116fa=_[_0x7b31('0x43')]({},_0x3116fa,_0x51959c[_0x7b31('0x46')]);return db[_0x7b31('0x32')]['find'](_0x3116fa)['then'](handleEntityNotFound(_0x3243bc,null))[_0x7b31('0x2b')](respondWithResult(_0x3243bc,null))[_0x7b31('0x4c')](handleError(_0x3243bc,null));};exports[_0x7b31('0x4d')]=function(_0x112657,_0x243372){return db[_0x7b31('0x32')][_0x7b31('0x4d')](_0x112657[_0x7b31('0x4e')],{})[_0x7b31('0x2b')](function(_0x7110c4){var _0x5de551=_0x112657['user'][_0x7b31('0x4f')]({'plain':!![]});if(!_0x5de551)throw new Error(_0x7b31('0x50'));if(_0x5de551[_0x7b31('0x51')]==='user'){var _0x2aeafd=_0x7110c4[_0x7b31('0x4f')]({'plain':!![]});var _0x4fa289=_0x7b31('0x52');return db[_0x7b31('0x53')]['find']({'where':{'name':_0x4fa289,'userProfileId':_0x5de551[_0x7b31('0x54')]},'raw':!![]})[_0x7b31('0x2b')](function(_0x5dea4c){if(_0x5dea4c&&_0x5dea4c[_0x7b31('0x55')]===0x0){return db[_0x7b31('0x56')]['create']({'name':_0x2aeafd['name'],'resourceId':_0x2aeafd['id'],'type':_0x5dea4c[_0x7b31('0x2e')],'sectionId':_0x5dea4c['id']},{})[_0x7b31('0x2b')](function(){return _0x7110c4;});}else{return _0x7110c4;}})['catch'](function(_0x2a241b){logger['error'](_0x7b31('0x57'),_0x2a241b);throw _0x2a241b;});}return _0x7110c4;})[_0x7b31('0x2b')](respondWithResult(_0x243372,0xc9))[_0x7b31('0x4c')](handleError(_0x243372,null));};exports[_0x7b31('0x2a')]=function(_0x394aa5,_0x430523){if(_0x394aa5[_0x7b31('0x4e')]['id']){delete _0x394aa5[_0x7b31('0x4e')]['id'];}return db['Team'][_0x7b31('0x58')]({'where':{'id':_0x394aa5['params']['id']}})[_0x7b31('0x2b')](handleEntityNotFound(_0x430523,null))['then'](saveUpdates(_0x394aa5[_0x7b31('0x4e')],null))['then'](respondWithResult(_0x430523,null))[_0x7b31('0x4c')](handleError(_0x430523,null));};exports['destroy']=function(_0x5b339f,_0x34b755){var _0x31a8e8=_0x5b339f[_0x7b31('0x4b')]['id'];var _0x30d4c4=[];return db[_0x7b31('0x59')][_0x7b31('0x5a')](function(_0xad382d){var _0x1ec454='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0x1ec454,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d})['then'](function(_0x2e9c92){_0x30d4c4=_['map'](_0x2e9c92,function(_0x442b93){return Number(_0x442b93[_0x7b31('0x5e')]);});})[_0x7b31('0x2b')](function(){var _0x85ecbb=_0x7b31('0x5f')+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0x85ecbb,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x32c483){var _0x5f199f=_['map'](_0x32c483,function(_0x585416){return Number(_0x585416['VoiceQueueId']);});return db[_0x7b31('0x60')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'VoiceQueueId':{'$in':_0x5f199f}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0xadc8c4='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0xadc8c4,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')]['SELECT'],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x16deb5){var _0x5c54a9=_[_0x7b31('0x31')](_0x16deb5,function(_0xe20f2d){return Number(_0xe20f2d[_0x7b31('0x62')]);});return db[_0x7b31('0x63')]['destroy']({'where':{'UserId':{'$in':_0x30d4c4},'MailQueueId':{'$in':_0x5c54a9}},'transaction':_0xad382d});})['then'](function(){var _0x54c0d6=_0x7b31('0x64')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x54c0d6,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')]['SELECT'],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x1bc030){var _0x2a532e=_[_0x7b31('0x31')](_0x1bc030,function(_0x1f550b){return Number(_0x1f550b[_0x7b31('0x65')]);});return db[_0x7b31('0x66')]['destroy']({'where':{'UserId':{'$in':_0x30d4c4},'SmsQueueId':{'$in':_0x2a532e}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0x9d7d37=_0x7b31('0x67')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x9d7d37,{'type':db['Sequelize'][_0x7b31('0x5c')]['SELECT'],'raw':!![],'transaction':_0xad382d});})['then'](function(_0x1c4133){var _0x17616a=_['map'](_0x1c4133,function(_0x1ddca9){return Number(_0x1ddca9['ChatQueueId']);});return db['UserChatQueue'][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'ChatQueueId':{'$in':_0x17616a}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0x1f9b4c=_0x7b31('0x68')+_0x31a8e8;return db[_0x7b31('0x59')]['query'](_0x1f9b4c,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})['then'](function(_0x58194c){var _0x4085ec=_[_0x7b31('0x31')](_0x58194c,function(_0x1adfdb){return Number(_0x1adfdb['FaxQueueId']);});return db[_0x7b31('0x69')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'FaxQueueId':{'$in':_0x4085ec}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){var _0x4d8ef6=_0x7b31('0x6a')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x4d8ef6,{'type':db[_0x7b31('0x5b')][_0x7b31('0x5c')][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x1af20b){var _0x5c5b22=_['map'](_0x1af20b,function(_0x5cced8){return Number(_0x5cced8[_0x7b31('0x6b')]);});return db[_0x7b31('0x6c')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'OpenchannelQueueId':{'$in':_0x5c5b22}},'transaction':_0xad382d});})['then'](function(){var _0x553a05=_0x7b31('0x6d')+_0x31a8e8;return db[_0x7b31('0x59')][_0x7b31('0x37')](_0x553a05,{'type':db[_0x7b31('0x5b')]['QueryTypes'][_0x7b31('0x5d')],'raw':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x25c26d){var _0x2b8eda=_['map'](_0x25c26d,function(_0x4966fe){return Number(_0x4966fe[_0x7b31('0x6e')]);});return db[_0x7b31('0x6f')][_0x7b31('0x61')]({'where':{'UserId':{'$in':_0x30d4c4},'WhatsappQueueId':{'$in':_0x2b8eda}},'transaction':_0xad382d});})[_0x7b31('0x2b')](function(){return db[_0x7b31('0x70')][_0x7b31('0x58')]({'where':{'TeamId':_0x31a8e8}});})[_0x7b31('0x2b')](function(_0x301ac4){if(_0x301ac4===null){return;}return db[_0x7b31('0x71')]['destroy']({'where':{'UserId':{'$in':_0x30d4c4},'VoicePrefixId':_0x301ac4[_0x7b31('0x72')]},'transaction':_0xad382d});})['then'](function(){return db[_0x7b31('0x32')]['destroy']({'where':{'id':_0x31a8e8},'cascade':!![],'transaction':_0xad382d});})[_0x7b31('0x2b')](function(_0x308fa2){if(_0x308fa2===0x0){_0x34b755['sendStatus'](0x194);}else{return db[_0x7b31('0x56')]['destroy']({'where':{'type':_0x7b31('0x52'),'resourceId':_0x31a8e8},'cascade':!![],'transaction':_0xad382d})[_0x7b31('0x2b')](function(){_0x34b755['status'](0xcc)['end']();});}})[_0x7b31('0x4c')](function(_0x1f5041){_0x34b755[_0x7b31('0x20')](0x1f4)['send'](_0x1f5041);});});};exports['getQueues']=function(_0x17e4ef,_0x134a5d,_0x245f86){return db[_0x7b31('0x32')]['findOne']({'where':{'id':_0x17e4ef[_0x7b31('0x4b')]['id']}})[_0x7b31('0x2b')](handleEntityNotFound(_0x134a5d,null))[_0x7b31('0x2b')](function(_0x5d7ebc){if(!_0x17e4ef['query']['channel']||!utils[_0x7b31('0x73')](_0x17e4ef[_0x7b31('0x37')]['channel'])){throw new db['Sequelize'][(_0x7b31('0x74'))](_0x7b31('0x75'));}var _0x20204e={};var _0x141921={};_0x141921[_0x7b31('0x36')]=_[_0x7b31('0x38')](db[_[_0x7b31('0x76')](_0x17e4ef['query']['channel'][_0x7b31('0x77')]())+'Queue'][_0x7b31('0x33')]);_0x141921[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x17e4ef[_0x7b31('0x37')]);_0x141921[_0x7b31('0x39')]=_['intersection'](_0x141921['model'],_0x141921[_0x7b31('0x37')]);_0x20204e[_0x7b31('0x3b')]=_[_0x7b31('0x3a')](_0x141921[_0x7b31('0x36')],qs[_0x7b31('0x3c')](_0x17e4ef['query'][_0x7b31('0x3c')]));_0x20204e[_0x7b31('0x3b')]=_0x20204e[_0x7b31('0x3b')][_0x7b31('0x3d')]?_0x20204e['attributes']:_0x141921[_0x7b31('0x36')];_0x20204e['limit']=qs[_0x7b31('0x23')](_0x17e4ef[_0x7b31('0x37')][_0x7b31('0x23')]);_0x20204e[_0x7b31('0x24')]=qs['offset'](_0x17e4ef[_0x7b31('0x37')][_0x7b31('0x24')]);_0x20204e['order']=qs['sort'](_0x17e4ef['query']['sort']);_0x20204e[_0x7b31('0x41')]=qs[_0x7b31('0x39')](_[_0x7b31('0x42')](_0x17e4ef['query'],_0x141921[_0x7b31('0x39')]));_0x20204e=_[_0x7b31('0x43')]({},_0x20204e,_0x17e4ef[_0x7b31('0x46')]);return _0x5d7ebc[_0x7b31('0x4f')+_[_0x7b31('0x76')](_0x17e4ef[_0x7b31('0x37')]['channel'][_0x7b31('0x77')]())+'Queues'](_0x20204e);})[_0x7b31('0x2b')](respondWithResult(_0x134a5d,null))[_0x7b31('0x4c')](handleError(_0x134a5d,null));};exports['addQueues']=function(_0xfc1f75,_0x238d73,_0x3c08c0){return db[_0x7b31('0x32')]['findOne']({'where':{'id':_0xfc1f75[_0x7b31('0x4b')]['id']}})['then'](function(_0x139323){if(_0x139323){if(!_0xfc1f75[_0x7b31('0x4e')][_0x7b31('0x78')]||!utils[_0x7b31('0x73')](_0xfc1f75['body'][_0x7b31('0x78')])){throw new db[(_0x7b31('0x5b'))][(_0x7b31('0x74'))](_0x7b31('0x75'));}return _0x139323[_0x7b31('0x79')+_[_0x7b31('0x76')](_0xfc1f75[_0x7b31('0x4e')][_0x7b31('0x78')][_0x7b31('0x77')]())+_0x7b31('0x7a')](_0xfc1f75[_0x7b31('0x4e')][_0x7b31('0x7b')]);}return null;})[_0x7b31('0x2b')](handleEntityNotFound(_0x238d73,null))[_0x7b31('0x2b')](respondWithStatusCode(_0x238d73,null))[_0x7b31('0x4c')](handleError(_0x238d73,null));};exports[_0x7b31('0x7c')]=function(_0x312308,_0x1dd04a,_0x336bf0){return db[_0x7b31('0x32')]['findOne']({'where':{'id':_0x312308[_0x7b31('0x4b')]['id']}})[_0x7b31('0x2b')](function(_0x4a8f30){if(_0x4a8f30){if(!_0x312308['query']['channel']||!utils[_0x7b31('0x73')](_0x312308['query'][_0x7b31('0x78')])){throw new db['Sequelize'][(_0x7b31('0x74'))]('Unknown\x20channel');}return _0x4a8f30[_0x7b31('0x7d')+_['capitalize'](_0x312308['query'][_0x7b31('0x78')][_0x7b31('0x77')]())+_0x7b31('0x7a')](_0x312308[_0x7b31('0x37')]['ids']);}return null;})['then'](handleEntityNotFound(_0x1dd04a,null))[_0x7b31('0x2b')](respondWithStatusCode(_0x1dd04a,null))[_0x7b31('0x4c')](handleError(_0x1dd04a,null));};exports['addAgents']=function(_0x3edb72,_0x528e52){var _0x2e28e9=_['isArray'](_0x3edb72[_0x7b31('0x4e')]['ids'])?_0x3edb72[_0x7b31('0x4e')][_0x7b31('0x7b')]:[_0x3edb72['body']['ids']];var _0x99d056=_0x3edb72['params']['id'];return db[_0x7b31('0x32')][_0x7b31('0x58')]({'where':{'id':_0x99d056}})[_0x7b31('0x2b')](handleEntityNotFound(_0x528e52,null))[_0x7b31('0x2b')](function(_0x31bf53){if(_0x31bf53){var _0x2eaa16=[_0x7b31('0x7e'),'Chat',_0x7b31('0x7f'),_0x7b31('0x80'),'Fax',_0x7b31('0x81'),_0x7b31('0x82')];return db[_0x7b31('0x59')][_0x7b31('0x5a')](function(_0x5dc348){var _0x267d50=_[_0x7b31('0x31')](_0x2eaa16,function(_0x79e1e3){var _0x5bfb8b={'attributes':['id',_0x7b31('0x2e')]};if(_0x79e1e3===_0x7b31('0x7e')){_0x5bfb8b[_0x7b31('0x83')]={'attributes':['penalty']};}return _0x31bf53[_0x7b31('0x4f')+_0x79e1e3+_0x7b31('0x7a')](_0x5bfb8b)[_0x7b31('0x2b')](function(_0x3c6f12){var _0x2177c2=_['map'](_0x3c6f12,function(_0x51bd70){var _0x6b9647=_[_0x7b31('0x31')](_0x2e28e9,function(_0x1ca482){var _0x540cdb={'where':{'UserId':_0x1ca482,[_0x79e1e3+_0x7b31('0x84')]:_0x51bd70['id']},'transaction':_0x5dc348};if(_0x79e1e3==='Voice'){_0x540cdb['defaults']={'penalty':_0x51bd70[_0x7b31('0x85')][_0x7b31('0x86')]};}return db[_0x7b31('0x87')+_0x79e1e3+'Queue'][_0x7b31('0x88')](_0x540cdb)['then'](function(){socket[_0x7b31('0x89')]('user'+_0x79e1e3+_0x7b31('0x8a'),{'UserId':_0x1ca482,[_0x79e1e3+'QueueId']:_0x51bd70['id']});if(_0x79e1e3!==_0x7b31('0x7e')){return;}return db['User'][_0x7b31('0x48')]({'where':{'id':_0x2e28e9,'online':0x1},'attributes':['id',_0x7b31('0x2e'),_0x7b31('0x8b'),_0x7b31('0x8c'),_0x7b31('0x8d')],'raw':!![]})['then'](function(_0xc5fcde){var _0x4796f6=_[_0x7b31('0x31')](_0xc5fcde,function(_0x456a46){return db[_0x7b31('0x8e')][_0x7b31('0x8f')]({'membername':_0x456a46[_0x7b31('0x2e')],'UserId':_0x456a46['id'],'queue_name':_0x51bd70['name'],'VoiceQueueId':_0x51bd70['id'],'interface':_[_0x7b31('0x90')](_0x456a46['interface'])?util['format'](_0x7b31('0x91'),_0x456a46['name']):_0x456a46[_0x7b31('0x8d')],'paused':_0x456a46[_0x7b31('0x8c')]||![],'penalty':_0x51bd70[_0x7b31('0x85')][_0x7b31('0x86')]},{'transaction':_0x5dc348});});return Promise[_0x7b31('0x92')](_0x4796f6);});});});return Promise[_0x7b31('0x92')](_0x6b9647);});return Promise[_0x7b31('0x92')](_0x2177c2);})['then'](function(){return db[_0x7b31('0x70')]['findOne']({'where':{'teamId':_0x99d056}})[_0x7b31('0x2b')](function(_0x59ae0f){if(_0x59ae0f){var _0x2a9971=_['map'](_0x2e28e9,function(_0x524956){db[_0x7b31('0x71')][_0x7b31('0x8f')]({'UserId':_0x524956,'VoicePrefixId':_0x59ae0f[_0x7b31('0x72')]});});return Promise[_0x7b31('0x92')](_0x2a9971);}});});});return Promise['all'](_0x267d50)['then'](function(){return _0x31bf53[_0x7b31('0x93')](_0x2e28e9,{'transaction':_0x5dc348})[_0x7b31('0x94')](function(_0x4806bc){return _0x4806bc;});});});}})[_0x7b31('0x2b')](respondWithResult(_0x528e52,null))[_0x7b31('0x4c')](handleError(_0x528e52,null));};exports[_0x7b31('0x95')]=function(_0x31e197,_0x2c917b){var _0x539d51=_['isArray'](_0x31e197[_0x7b31('0x37')]['ids'])?_0x31e197[_0x7b31('0x37')][_0x7b31('0x7b')]:[_0x31e197[_0x7b31('0x37')]['ids']];var _0x13b402=_0x31e197[_0x7b31('0x4b')]['id'];return db[_0x7b31('0x32')]['find']({'where':{'id':_0x13b402}})[_0x7b31('0x2b')](handleEntityNotFound(_0x2c917b,null))[_0x7b31('0x2b')](function(_0x19943f){if(_0x19943f){var _0x432fa6=[_0x7b31('0x7e'),_0x7b31('0x96'),_0x7b31('0x7f'),_0x7b31('0x80'),_0x7b31('0x97'),_0x7b31('0x81'),'Whatsapp'];return db[_0x7b31('0x59')][_0x7b31('0x5a')](function(_0x166a4e){var _0x245f41=_[_0x7b31('0x31')](_0x432fa6,function(_0x7564f){var _0x5284d4={'attributes':['id',_0x7b31('0x2e')]};return _0x19943f[_0x7b31('0x4f')+_0x7564f+_0x7b31('0x7a')](_0x5284d4)['then'](function(_0x2991a6){var _0x5e64f4=_[_0x7b31('0x31')](_0x2991a6,function(_0x52ac17){return _0x52ac17[_0x7b31('0x95')](_0x539d51,{'transaction':_0x166a4e})[_0x7b31('0x2b')](function(){var _0x4cc219=_[_0x7b31('0x31')](_0x539d51,function(_0x245cef){socket[_0x7b31('0x89')](_0x7b31('0x98')+_0x7564f+'Queue:remove',{'UserId':Number(_0x245cef),[_0x7564f+'QueueId']:_0x52ac17['id']});if(_0x7564f!==_0x7b31('0x7e')){return;}return db[_0x7b31('0x8e')][_0x7b31('0x61')]({'where':{'VoiceQueueId':_0x52ac17['id'],'UserId':_0x245cef},'transaction':_0x166a4e});});return Promise[_0x7b31('0x92')](_0x4cc219);});});return Promise[_0x7b31('0x92')](_0x5e64f4);});});return Promise[_0x7b31('0x92')](_0x245f41)[_0x7b31('0x2b')](function(){return _0x19943f['removeAgents'](_0x539d51,{'transaction':_0x166a4e});})[_0x7b31('0x2b')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x13b402}})['then'](function(_0x1e7dee){if(_0x1e7dee){var _0x6942c8=_[_0x7b31('0x31')](_0x539d51,function(_0x3e3600){db[_0x7b31('0x71')][_0x7b31('0x61')]({'where':{'UserId':_0x3e3600,'VoicePrefixId':_0x1e7dee[_0x7b31('0x72')]}});});return Promise[_0x7b31('0x92')](_0x6942c8);}});});});}})['then'](respondWithStatusCode(_0x2c917b,null))[_0x7b31('0x4c')](handleError(_0x2c917b,null));};exports[_0x7b31('0x99')]=function(_0x35edf5,_0x610cca,_0x6d04e0){var _0x21560c={};var _0x4de048={};var _0x57b867;var _0x2f05ea;return db[_0x7b31('0x32')][_0x7b31('0x9a')]({'where':{'id':_0x35edf5[_0x7b31('0x4b')]['id']}})[_0x7b31('0x2b')](handleEntityNotFound(_0x610cca,null))[_0x7b31('0x2b')](function(_0x5e5c79){if(_0x5e5c79){_0x57b867=_0x5e5c79;_0x4de048[_0x7b31('0x36')]=_[_0x7b31('0x38')](db['User'][_0x7b31('0x33')]);_0x4de048[_0x7b31('0x37')]=_[_0x7b31('0x38')](_0x35edf5['query']);_0x4de048[_0x7b31('0x39')]=_[_0x7b31('0x3a')](_0x4de048[_0x7b31('0x36')],_0x4de048[_0x7b31('0x37')]);_0x21560c[_0x7b31('0x3b')]=_['intersection'](_0x4de048['model'],qs['fields'](_0x35edf5[_0x7b31('0x37')]['fields']));_0x21560c[_0x7b31('0x3b')]=_0x21560c[_0x7b31('0x3b')][_0x7b31('0x3d')]?_0x21560c[_0x7b31('0x3b')]:_0x4de048['model'];_0x21560c['order']=qs['sort'](_0x35edf5['query'][_0x7b31('0x40')]);_0x21560c[_0x7b31('0x41')]=qs[_0x7b31('0x39')](_[_0x7b31('0x42')](_0x35edf5[_0x7b31('0x37')],_0x4de048[_0x7b31('0x39')]));if(_0x35edf5[_0x7b31('0x37')][_0x7b31('0x45')]){_0x21560c[_0x7b31('0x41')]=_[_0x7b31('0x43')](_0x21560c[_0x7b31('0x41')],{'$or':_[_0x7b31('0x31')](_0x21560c[_0x7b31('0x3b')],function(_0x57070a){var _0x431dc4={};_0x431dc4[_0x57070a]={'$like':'%'+_0x35edf5['query']['filter']+'%'};return _0x431dc4;})});}_0x21560c=_[_0x7b31('0x43')]({},_0x21560c,_0x35edf5[_0x7b31('0x46')]);return _0x57b867[_0x7b31('0x99')](_0x21560c);}})['then'](function(_0x3583c0){if(_0x3583c0){_0x2f05ea=_0x3583c0[_0x7b31('0x3d')];if(!_0x35edf5['query'][_0x7b31('0x9b')](_0x7b31('0x3e'))){_0x21560c[_0x7b31('0x23')]=qs[_0x7b31('0x23')](_0x35edf5[_0x7b31('0x37')]['limit']);_0x21560c[_0x7b31('0x24')]=qs['offset'](_0x35edf5[_0x7b31('0x37')][_0x7b31('0x24')]);}return _0x57b867['getAgents'](_0x21560c);}})['then'](function(_0x340003){if(_0x340003){return _0x340003?{'count':_0x2f05ea,'rows':_0x340003}:null;}})[_0x7b31('0x2b')](respondWithResult(_0x610cca,null))[_0x7b31('0x4c')](handleError(_0x610cca,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 427c81d..8ff4649 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 _0xb5df=['../../mysqldb','Team','setMaxListeners','update','remove','emit','exports','events'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0xb5df,0x1cf));var _0xfb5d=function(_0xee4dc7,_0x1c87cc){_0xee4dc7=_0xee4dc7-0x0;var _0x584db4=_0xb5df[_0xee4dc7];return _0x584db4;};'use strict';var EventEmitter=require(_0xfb5d('0x0'));var Team=require(_0xfb5d('0x1'))['db'][_0xfb5d('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xfb5d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfb5d('0x4'),'afterDestroy':_0xfb5d('0x5')};function emitEvent(_0x4f93fe){return function(_0x1908d6,_0x229f14,_0x44449d){TeamEvents['emit'](_0x4f93fe+':'+_0x1908d6['id'],_0x1908d6);TeamEvents[_0xfb5d('0x6')](_0x4f93fe,_0x1908d6);_0x44449d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xfb5d('0x7')]=TeamEvents; \ No newline at end of file +var _0x3c6d=['emit','hasOwnProperty','hook','events','Team','setMaxListeners','update','remove'];(function(_0x5920c9,_0x562f1e){var _0x1781de=function(_0x33cc8b){while(--_0x33cc8b){_0x5920c9['push'](_0x5920c9['shift']());}};_0x1781de(++_0x562f1e);}(_0x3c6d,0x1b3));var _0xd3c6=function(_0x4f4d1a,_0x278e33){_0x4f4d1a=_0x4f4d1a-0x0;var _0xfca475=_0x3c6d[_0x4f4d1a];return _0xfca475;};'use strict';var EventEmitter=require(_0xd3c6('0x0'));var Team=require('../../mysqldb')['db'][_0xd3c6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xd3c6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3c6('0x3'),'afterDestroy':_0xd3c6('0x4')};function emitEvent(_0x435a28){return function(_0x25b761,_0x1096c3,_0x323798){TeamEvents[_0xd3c6('0x5')](_0x435a28+':'+_0x25b761['id'],_0x25b761);TeamEvents['emit'](_0x435a28,_0x25b761);_0x323798(null);};}for(var e in events){if(events[_0xd3c6('0x6')](e)){var event=events[e];Team[_0xd3c6('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 138a94e..583c59b 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 _0x9ff7=['define','Team','Mail','Openchannel','resolve','all','lodash','./team.attributes','get','Queues','then','map','channel','catch','exports'];(function(_0xe95cae,_0x21dd59){var _0x25beb0=function(_0x23b8b0){while(--_0x23b8b0){_0xe95cae['push'](_0xe95cae['shift']());}};_0x25beb0(++_0x21dd59);}(_0x9ff7,0x7e));var _0x79ff=function(_0x18bf86,_0xa8e65e){_0x18bf86=_0x18bf86-0x0;var _0x66a378=_0x9ff7[_0x18bf86];return _0x66a378;};'use strict';var _=require(_0x79ff('0x0'));var attributes=require(_0x79ff('0x1'));function getQueuesByChannel(_0xd0b999,_0x46034a){var _0x2f05a7=_0x79ff('0x2')+_0x46034a+_0x79ff('0x3');return _0xd0b999[_0x2f05a7]()[_0x79ff('0x4')](function(_0x187dfe){return _[_0x79ff('0x5')](_0x187dfe,function(_0x5cb703){_0x5cb703['setDataValue'](_0x79ff('0x6'),_0x46034a);return _0x5cb703;});})[_0x79ff('0x7')](function(_0x2f198a){throw _0x2f198a;});}module[_0x79ff('0x8')]=function(_0x4f9c6b){return _0x4f9c6b[_0x79ff('0x9')](_0x79ff('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2106aa=this;var _0x2da7ba=['Chat','Fax',_0x79ff('0xb'),_0x79ff('0xc'),'Sms','Voice','Whatsapp'];return Promise[_0x79ff('0xd')]()['then'](function(){var _0x56af8a=_[_0x79ff('0x5')](_0x2da7ba,function(_0x39c2b0){return getQueuesByChannel(_0x2106aa,_0x39c2b0);});return Promise[_0x79ff('0xe')](_0x56af8a);})[_0x79ff('0x7')](function(_0x38da32){throw _0x38da32;});}}});}; \ No newline at end of file +var _0x0122=['catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','resolve','then','all','lodash','./team.attributes','get','Queues','map','channel'];(function(_0x5c739f,_0x1b2ed5){var _0x5ea129=function(_0x22dda4){while(--_0x22dda4){_0x5c739f['push'](_0x5c739f['shift']());}};_0x5ea129(++_0x1b2ed5);}(_0x0122,0x1ce));var _0x2012=function(_0x8dc1a7,_0x3c2a39){_0x8dc1a7=_0x8dc1a7-0x0;var _0x4e36b9=_0x0122[_0x8dc1a7];return _0x4e36b9;};'use strict';var _=require(_0x2012('0x0'));var attributes=require(_0x2012('0x1'));function getQueuesByChannel(_0x22bf6e,_0x330454){var _0x5ab22a=_0x2012('0x2')+_0x330454+_0x2012('0x3');return _0x22bf6e[_0x5ab22a]()['then'](function(_0x16ce0e){return _[_0x2012('0x4')](_0x16ce0e,function(_0x269fe5){_0x269fe5['setDataValue'](_0x2012('0x5'),_0x330454);return _0x269fe5;});})[_0x2012('0x6')](function(_0x156975){throw _0x156975;});}module[_0x2012('0x7')]=function(_0x216f05){return _0x216f05[_0x2012('0x8')](_0x2012('0x9'),attributes,{'tableName':_0x2012('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x13ecc9=this;var _0x19e205=[_0x2012('0xb'),_0x2012('0xc'),_0x2012('0xd'),_0x2012('0xe'),'Sms','Voice','Whatsapp'];return Promise[_0x2012('0xf')]()[_0x2012('0x10')](function(){var _0x344d2c=_[_0x2012('0x4')](_0x19e205,function(_0x3eeab6){return getQueuesByChannel(_0x13ecc9,_0x3eeab6);});return Promise[_0x2012('0x11')](_0x344d2c);})['catch'](function(_0x11c3d5){throw _0x11c3d5;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 874352c..9cdb1de 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 _0xaba4=['bluebird','randomstring','ioredis','jayson/promise','http','redis','defaults','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xaba4,0xfa));var _0x4aba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaba4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4aba('0x0'));var moment=require(_0x4aba('0x1'));var BPromise=require(_0x4aba('0x2'));var rs=require(_0x4aba('0x3'));var fs=require('fs');var Redis=require(_0x4aba('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4aba('0x5'));var client=jayson['client'][_0x4aba('0x6')]({'port':0x232a});config[_0x4aba('0x7')]=_[_0x4aba('0x8')](config[_0x4aba('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4aba('0x7')]));require('./team.socket')[_0x4aba('0x9')](socket);function respondWithRpcPromise(_0x156ec5,_0x2eec25,_0x370a7c){return new BPromise(function(_0xcea161,_0x2e3124){return client[_0x4aba('0xa')](_0x156ec5,_0x370a7c)[_0x4aba('0xb')](function(_0x3b9a40){logger[_0x4aba('0xc')](_0x4aba('0xd'),_0x2eec25,_0x4aba('0xe'));logger[_0x4aba('0xf')](_0x4aba('0x10'),_0x2eec25,'request\x20sent',JSON[_0x4aba('0x11')](_0x3b9a40));if(_0x3b9a40[_0x4aba('0x12')]){if(_0x3b9a40[_0x4aba('0x12')][_0x4aba('0x13')]===0x1f4){logger[_0x4aba('0x12')](_0x4aba('0xd'),_0x2eec25,_0x3b9a40['error'][_0x4aba('0x14')]);return _0x2e3124(_0x3b9a40[_0x4aba('0x12')][_0x4aba('0x14')]);}logger[_0x4aba('0x12')](_0x4aba('0xd'),_0x2eec25,_0x3b9a40[_0x4aba('0x12')][_0x4aba('0x14')]);return _0xcea161(_0x3b9a40[_0x4aba('0x12')][_0x4aba('0x14')]);}else{logger['info'](_0x4aba('0xd'),_0x2eec25,_0x4aba('0xe'));_0xcea161(_0x3b9a40['result'][_0x4aba('0x14')]);}})['catch'](function(_0x586d2f){logger[_0x4aba('0x12')](_0x4aba('0xd'),_0x2eec25,_0x586d2f);_0x2e3124(_0x586d2f);});});} \ No newline at end of file +var _0x1d25=['Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','register','request'];(function(_0x34da94,_0x178b79){var _0x7ae05e=function(_0xa083ee){while(--_0xa083ee){_0x34da94['push'](_0x34da94['shift']());}};_0x7ae05e(++_0x178b79);}(_0x1d25,0x171));var _0x51d2=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x1d25[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var moment=require(_0x51d2('0x2'));var BPromise=require(_0x51d2('0x3'));var rs=require(_0x51d2('0x4'));var fs=require('fs');var Redis=require(_0x51d2('0x5'));var db=require(_0x51d2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x51d2('0x7'))('rpc');var config=require(_0x51d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x51d2('0x9')][_0x51d2('0xa')]({'port':0x232a});config[_0x51d2('0xb')]=_[_0x51d2('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51d2('0xb')]));require('./team.socket')[_0x51d2('0xd')](socket);function respondWithRpcPromise(_0x3f7949,_0x20ed65,_0x3ddb26){return new BPromise(function(_0x7a21a4,_0xb598f9){return client[_0x51d2('0xe')](_0x3f7949,_0x3ddb26)['then'](function(_0x525d58){logger['info'](_0x51d2('0xf'),_0x20ed65,_0x51d2('0x10'));logger['debug'](_0x51d2('0x11'),_0x20ed65,_0x51d2('0x10'),JSON[_0x51d2('0x12')](_0x525d58));if(_0x525d58[_0x51d2('0x13')]){if(_0x525d58[_0x51d2('0x13')][_0x51d2('0x14')]===0x1f4){logger[_0x51d2('0x13')](_0x51d2('0xf'),_0x20ed65,_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);return _0xb598f9(_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);}logger[_0x51d2('0x13')](_0x51d2('0xf'),_0x20ed65,_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);return _0x7a21a4(_0x525d58[_0x51d2('0x13')][_0x51d2('0x15')]);}else{logger['info'](_0x51d2('0xf'),_0x20ed65,_0x51d2('0x10'));_0x7a21a4(_0x525d58[_0x51d2('0x16')]['message']);}})[_0x51d2('0x17')](function(_0x3b9b8c){logger['error'](_0x51d2('0xf'),_0x20ed65,_0x3b9b8c);_0xb598f9(_0x3b9b8c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 04323de..b40c171 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 _0xf6e8=['removeListener','register','length','team:','save','remove','update'];(function(_0x231b0e,_0x527ff2){var _0x1b8891=function(_0x29ca0b){while(--_0x29ca0b){_0x231b0e['push'](_0x231b0e['shift']());}};_0x1b8891(++_0x527ff2);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x486c3e,_0x42e2e8){_0x486c3e=_0x486c3e-0x0;var _0x24f123=_0xf6e8[_0x486c3e];return _0x24f123;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8f6e('0x0'),_0x8f6e('0x1'),_0x8f6e('0x2')];function createListener(_0x1a5d5b,_0x3c2632){return function(_0x24d74f){_0x3c2632['emit'](_0x1a5d5b,_0x24d74f);};}function removeListener(_0xac263e,_0x55673a){return function(){TeamEvents[_0x8f6e('0x3')](_0xac263e,_0x55673a);};}exports[_0x8f6e('0x4')]=function(_0x5a5609){for(var _0x7b6df3=0x0,_0x233158=events[_0x8f6e('0x5')];_0x7b6df3<_0x233158;_0x7b6df3++){var _0x71b52c=events[_0x7b6df3];var _0x423ed4=createListener(_0x8f6e('0x6')+_0x71b52c,_0x5a5609);TeamEvents['on'](_0x71b52c,_0x423ed4);}}; \ No newline at end of file +var _0xe9ff=['length','team:','update','emit','removeListener','register'];(function(_0x2dd3fa,_0x347ce6){var _0x129a26=function(_0x1ff53){while(--_0x1ff53){_0x2dd3fa['push'](_0x2dd3fa['shift']());}};_0x129a26(++_0x347ce6);}(_0xe9ff,0x17c));var _0xfe9f=function(_0x25f534,_0xf9a7f3){_0x25f534=_0x25f534-0x0;var _0x10841a=_0xe9ff[_0x25f534];return _0x10841a;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0xfe9f('0x0')];function createListener(_0x5d9f8c,_0x3bd6ea){return function(_0xfb3bf3){_0x3bd6ea[_0xfe9f('0x1')](_0x5d9f8c,_0xfb3bf3);};}function removeListener(_0x15cd60,_0x4226ce){return function(){TeamEvents[_0xfe9f('0x2')](_0x15cd60,_0x4226ce);};}exports[_0xfe9f('0x3')]=function(_0x5f9833){for(var _0xe96c92=0x0,_0x53767c=events[_0xfe9f('0x4')];_0xe96c92<_0x53767c;_0xe96c92++){var _0x4e4857=events[_0xe96c92];var _0x4a837d=createListener(_0xfe9f('0x5')+_0x4e4857,_0x5f9833);TeamEvents['on'](_0x4e4857,_0x4a837d);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5f108ed..0213404 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 _0x3738=['INTEGER','exports'];(function(_0x5bfb8a,_0x42cd43){var _0x1a1c80=function(_0x21b1c3){while(--_0x21b1c3){_0x5bfb8a['push'](_0x5bfb8a['shift']());}};_0x1a1c80(++_0x42cd43);}(_0x3738,0x1e5));var _0x8373=function(_0x4ec0d0,_0x3eb21e){_0x4ec0d0=_0x4ec0d0-0x0;var _0x319e6d=_0x3738[_0x4ec0d0];return _0x319e6d;};'use strict';var Sequelize=require('sequelize');module[_0x8373('0x0')]={'TeamId':{'type':Sequelize[_0x8373('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8373('0x1')]}}; \ No newline at end of file +var _0x4deb=['sequelize','exports','INTEGER'];(function(_0x1fd886,_0x41155d){var _0x419f90=function(_0x5394a8){while(--_0x5394a8){_0x1fd886['push'](_0x1fd886['shift']());}};_0x419f90(++_0x41155d);}(_0x4deb,0x17a));var _0xb4de=function(_0x251170,_0x32fb45){_0x251170=_0x251170-0x0;var _0x32583d=_0x4deb[_0x251170];return _0x32583d;};'use strict';var Sequelize=require(_0xb4de('0x0'));module[_0xb4de('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb4de('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 145c096..fbfcb0d 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 _0xc901=['TeamVoicePrefix','team_has_voice_prefixes','lodash','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define'];(function(_0x845cf4,_0x510466){var _0x99bb0a=function(_0x4f593b){while(--_0x4f593b){_0x845cf4['push'](_0x845cf4['shift']());}};_0x99bb0a(++_0x510466);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c90('0x1'));var rp=require(_0x1c90('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c90('0x3'));var config=require(_0x1c90('0x4'));var attributes=require(_0x1c90('0x5'));module[_0x1c90('0x6')]=function(_0x1c9021,_0x14eb4f){return _0x1c9021[_0x1c90('0x7')](_0x1c90('0x8'),attributes,{'tableName':_0x1c90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf2f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x5ba4cf,_0x3d2919){var _0x5109e8=function(_0x4220a1){while(--_0x4220a1){_0x5ba4cf['push'](_0x5ba4cf['shift']());}};_0x5109e8(++_0x3d2919);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x1c90b3,_0x42e708){_0x1c90b3=_0x1c90b3-0x0;var _0x413867=_0xcf2f[_0x1c90b3];return _0x413867;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index e1bc2ee..90ce447 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x14070c,_0x723331){var _0x3bbbad=function(_0x4d1b23){while(--_0x4d1b23){_0x14070c['push'](_0x14070c['shift']());}};_0x3bbbad(++_0x723331);}(_0x70e0,0x17b));var _0x070e=function(_0x2ee827,_0x2d5c2f){_0x2ee827=_0x2ee827-0x0;var _0x3ace63=_0x70e0[_0x2ee827];return _0x3ace63;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x466b8c,_0x492ed0){var _0x3f461d=function(_0x1bb52c){while(--_0x1bb52c){_0x466b8c['push'](_0x466b8c['shift']());}};_0x3f461d(++_0x492ed0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c098823..88d28a8 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 _0xe87a=['sequelize','exports','INTEGER'];(function(_0x2377e1,_0x413997){var _0x336a78=function(_0x4e7bc4){while(--_0x4e7bc4){_0x2377e1['push'](_0x2377e1['shift']());}};_0x336a78(++_0x413997);}(_0xe87a,0x15f));var _0xae87=function(_0x186f58,_0xcef2c7){_0x186f58=_0x186f58-0x0;var _0x16b89c=_0xe87a[_0x186f58];return _0x16b89c;};'use strict';var Sequelize=require(_0xae87('0x0'));module[_0xae87('0x1')]={'penalty':{'type':Sequelize[_0xae87('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae7c=['exports','INTEGER','sequelize'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xae7c,0x104));var _0xcae7=function(_0x15a61f,_0x80526a){_0x15a61f=_0x15a61f-0x0;var _0x3d5af3=_0xae7c[_0x15a61f];return _0x3d5af3;};'use strict';var Sequelize=require(_0xcae7('0x0'));module[_0xcae7('0x1')]={'penalty':{'type':Sequelize[_0xcae7('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 d8b0d1b..934649d 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 _0xbc82=['path','./teamVoiceQueue.attributes','team_has_voice_queues','lodash','moment'];(function(_0x137803,_0x35680c){var _0x4ec652=function(_0x46c64e){while(--_0x46c64e){_0x137803['push'](_0x137803['shift']());}};_0x4ec652(++_0x35680c);}(_0xbc82,0x13e));var _0x2bc8=function(_0x31a783,_0x211d45){_0x31a783=_0x31a783-0x0;var _0x24ff25=_0xbc82[_0x31a783];return _0x24ff25;};'use strict';var _=require(_0x2bc8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2bc8('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bc8('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2bc8('0x3'));module['exports']=function(_0x54d303,_0x3d12fc){return _0x54d303['define']('TeamVoiceQueue',attributes,{'tableName':_0x2bc8('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61a1=['moment','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x310f74,_0x5254f7){var _0x32aca9=function(_0x388bb7){while(--_0x388bb7){_0x310f74['push'](_0x310f74['shift']());}};_0x32aca9(++_0x5254f7);}(_0x61a1,0x127));var _0x161a=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x61a1[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x161a('0x0'));var util=require(_0x161a('0x1'));var logger=require(_0x161a('0x2'))(_0x161a('0x3'));var moment=require(_0x161a('0x4'));var BPromise=require('bluebird');var rp=require(_0x161a('0x5'));var fs=require('fs');var path=require(_0x161a('0x6'));var rimraf=require('rimraf');var config=require(_0x161a('0x7'));var attributes=require(_0x161a('0x8'));module[_0x161a('0x9')]=function(_0x1442cf,_0x1bb0ac){return _0x1442cf[_0x161a('0xa')](_0x161a('0xb'),attributes,{'tableName':_0x161a('0xc'),'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 3b95bac..5a6f5e2 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 _0xd745=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','randomstring'];(function(_0x3cf7e2,_0x4cc378){var _0x489b03=function(_0x22f3aa){while(--_0x22f3aa){_0x3cf7e2['push'](_0x3cf7e2['shift']());}};_0x489b03(++_0x4cc378);}(_0xd745,0x9e));var _0x5d74=function(_0x5453d8,_0x246aeb){_0x5453d8=_0x5453d8-0x0;var _0x3ce633=_0xd745[_0x5453d8];return _0x3ce633;};'use strict';var _=require('lodash');var util=require(_0x5d74('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d74('0x1'));var fs=require('fs');var Redis=require(_0x5d74('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d74('0x3'));var logger=require('../../config/logger')(_0x5d74('0x4'));var config=require(_0x5d74('0x5'));var jayson=require(_0x5d74('0x6'));var client=jayson[_0x5d74('0x7')][_0x5d74('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49debe,_0x4a49ce,_0x399371){return new BPromise(function(_0x2567ec,_0x4b8cef){return client['request'](_0x49debe,_0x399371)[_0x5d74('0x9')](function(_0x5421dd){logger[_0x5d74('0xa')](_0x5d74('0xb'),_0x4a49ce,_0x5d74('0xc'));logger[_0x5d74('0xd')](_0x5d74('0xe'),_0x4a49ce,'request\x20sent',JSON[_0x5d74('0xf')](_0x5421dd));if(_0x5421dd['error']){if(_0x5421dd[_0x5d74('0x10')][_0x5d74('0x11')]===0x1f4){logger[_0x5d74('0x10')](_0x5d74('0xb'),_0x4a49ce,_0x5421dd[_0x5d74('0x10')]['message']);return _0x4b8cef(_0x5421dd[_0x5d74('0x10')][_0x5d74('0x12')]);}logger['error'](_0x5d74('0xb'),_0x4a49ce,_0x5421dd[_0x5d74('0x10')][_0x5d74('0x12')]);return _0x2567ec(_0x5421dd[_0x5d74('0x10')]['message']);}else{logger[_0x5d74('0xa')](_0x5d74('0xb'),_0x4a49ce,_0x5d74('0xc'));_0x2567ec(_0x5421dd[_0x5d74('0x13')][_0x5d74('0x12')]);}})['catch'](function(_0x3554c5){logger[_0x5d74('0x10')](_0x5d74('0xb'),_0x4a49ce,_0x3554c5);_0x4b8cef(_0x3554c5);});});} \ No newline at end of file +var _0x3351=['error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x3351,0x175));var _0x1335=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3351[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x1335('0x0'));var util=require(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1335('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1335('0x4'))(_0x1335('0x5'));var config=require(_0x1335('0x6'));var jayson=require(_0x1335('0x7'));var client=jayson[_0x1335('0x8')][_0x1335('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x387e44,_0x4033f0,_0x1793e6){return new BPromise(function(_0x19c13e,_0x53a9a2){return client[_0x1335('0xa')](_0x387e44,_0x1793e6)[_0x1335('0xb')](function(_0x4ef3a7){logger[_0x1335('0xc')](_0x1335('0xd'),_0x4033f0,'request\x20sent');logger[_0x1335('0xe')](_0x1335('0xf'),_0x4033f0,_0x1335('0x10'),JSON[_0x1335('0x11')](_0x4ef3a7));if(_0x4ef3a7[_0x1335('0x12')]){if(_0x4ef3a7[_0x1335('0x12')][_0x1335('0x13')]===0x1f4){logger[_0x1335('0x12')](_0x1335('0xd'),_0x4033f0,_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);return _0x53a9a2(_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);}logger[_0x1335('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4033f0,_0x4ef3a7[_0x1335('0x12')][_0x1335('0x14')]);return _0x19c13e(_0x4ef3a7[_0x1335('0x12')]['message']);}else{logger[_0x1335('0xc')](_0x1335('0xd'),_0x4033f0,_0x1335('0x10'));_0x19c13e(_0x4ef3a7[_0x1335('0x15')][_0x1335('0x14')]);}})[_0x1335('0x16')](function(_0x2c9a69){logger[_0x1335('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4033f0,_0x2c9a69);_0x53a9a2(_0x2c9a69);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 0ec594a..25b7a66 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 _0x19fb=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x207f8b,_0x42a2fc){var _0x1f23fd=function(_0x591ca7){while(--_0x591ca7){_0x207f8b['push'](_0x207f8b['shift']());}};_0x1f23fd(++_0x42a2fc);}(_0x19fb,0xdd));var _0xb19f=function(_0x140c55,_0x18e5ef){_0x140c55=_0x140c55-0x0;var _0x132b61=_0x19fb[_0x140c55];return _0x132b61;};'use strict';var multer=require(_0xb19f('0x0'));var util=require(_0xb19f('0x1'));var path=require(_0xb19f('0x2'));var timeout=require(_0xb19f('0x3'));var express=require(_0xb19f('0x4'));var router=express[_0xb19f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb19f('0x6'));var config=require(_0xb19f('0x7'));var controller=require(_0xb19f('0x8'));router[_0xb19f('0x9')]('/',auth[_0xb19f('0xa')](),controller['index']);router[_0xb19f('0x9')](_0xb19f('0xb'),auth[_0xb19f('0xa')](),controller[_0xb19f('0xc')]);router[_0xb19f('0xd')]('/',auth[_0xb19f('0xa')](),controller[_0xb19f('0xe')]);router[_0xb19f('0xf')]('/:id',auth[_0xb19f('0xa')](),controller[_0xb19f('0x10')]);router[_0xb19f('0x11')](_0xb19f('0xb'),auth[_0xb19f('0xa')](),controller[_0xb19f('0x12')]);module[_0xb19f('0x13')]=router; \ No newline at end of file +var _0x19e1=['../../components/auth/service','../../config/environment','./template.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x47cd7b,_0x5630af){var _0x3e6dbf=function(_0x2c28e1){while(--_0x2c28e1){_0x47cd7b['push'](_0x47cd7b['shift']());}};_0x3e6dbf(++_0x5630af);}(_0x19e1,0x163));var _0x119e=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0x19e1[_0x4404ff];return _0x5e7b19;};'use strict';var multer=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var path=require(_0x119e('0x2'));var timeout=require(_0x119e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x119e('0x4'));var auth=require(_0x119e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x119e('0x6'));var controller=require(_0x119e('0x7'));router['get']('/',auth[_0x119e('0x8')](),controller['index']);router[_0x119e('0x9')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0xb')]);router['post']('/',auth[_0x119e('0x8')](),controller[_0x119e('0xc')]);router[_0x119e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x119e('0xe')]);router[_0x119e('0xf')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0x10')]);module[_0x119e('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index a442619..2694afe 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 _0xb19f=['TEXT','exports','STRING'];(function(_0x5a312e,_0x160d11){var _0x4b68d2=function(_0x50f7ee){while(--_0x50f7ee){_0x5a312e['push'](_0x5a312e['shift']());}};_0x4b68d2(++_0x160d11);}(_0xb19f,0x7f));var _0xfb19=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0xb19f[_0x4b8156];return _0x4a819c;};'use strict';var Sequelize=require('sequelize');module[_0xfb19('0x0')]={'name':{'type':Sequelize[_0xfb19('0x1')]},'description':{'type':Sequelize[_0xfb19('0x1')]},'html':{'type':Sequelize[_0xfb19('0x2')]}}; \ No newline at end of file +var _0xf78d=['sequelize','exports','STRING','TEXT'];(function(_0x240af6,_0x2d7cb1){var _0x3f4584=function(_0x56b20f){while(--_0x56b20f){_0x240af6['push'](_0x240af6['shift']());}};_0x3f4584(++_0x2d7cb1);}(_0xf78d,0xf8));var _0xdf78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf78d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdf78('0x0'));module[_0xdf78('0x1')]={'name':{'type':Sequelize[_0xdf78('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xdf78('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 64fa64f..3b0c1a2 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 _0xdbf8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','stack','name','map','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','Template','includeAll','include','findAll','catch','show','find','create','body','role','user','userProfileId','autoAssociation','error','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbf8,0x92));var _0x8dbf=function(_0x396535,_0x3928ab){_0x396535=_0x396535-0x0;var _0x5241ef=_0xdbf8[_0x396535];return _0x5241ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dbf('0x0'));var zipdir=require(_0x8dbf('0x1'));var jsonpatch=require(_0x8dbf('0x2'));var rp=require(_0x8dbf('0x3'));var moment=require('moment');var BPromise=require(_0x8dbf('0x4'));var Mustache=require(_0x8dbf('0x5'));var util=require(_0x8dbf('0x6'));var path=require(_0x8dbf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8dbf('0x8'));var fs=require('fs');var fs_extra=require(_0x8dbf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8dbf('0xa'));var jsforce=require(_0x8dbf('0xb'));var deskjs=require(_0x8dbf('0xc'));var toCsv=require(_0x8dbf('0xd'));var querystring=require(_0x8dbf('0xe'));var Papa=require(_0x8dbf('0xf'));var Redis=require(_0x8dbf('0x10'));var authService=require(_0x8dbf('0x11'));var qs=require(_0x8dbf('0x12'));var as=require(_0x8dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8dbf('0x14'))('api');var utils=require(_0x8dbf('0x15'));var config=require(_0x8dbf('0x16'));var licenseUtil=require(_0x8dbf('0x17'));var db=require(_0x8dbf('0x18'))['db'];function respondWithStatusCode(_0xf76050,_0x3f51f4){_0x3f51f4=_0x3f51f4||0xcc;return function(_0x409e2d){if(_0x409e2d){return _0xf76050['sendStatus'](_0x3f51f4);}return _0xf76050['status'](_0x3f51f4)[_0x8dbf('0x19')]();};}function respondWithResult(_0x287155,_0x4a6534){_0x4a6534=_0x4a6534||0xc8;return function(_0x535656){if(_0x535656){return _0x287155[_0x8dbf('0x1a')](_0x4a6534)[_0x8dbf('0x1b')](_0x535656);}};}function respondWithFilteredResult(_0x17cb52,_0x3f38cc){return function(_0x480308){if(_0x480308){var _0x5acc7d=typeof _0x3f38cc[_0x8dbf('0x1c')]===_0x8dbf('0x1d')&&typeof _0x3f38cc['limit']===_0x8dbf('0x1d');var _0x2b3787=_0x480308[_0x8dbf('0x1e')];var _0x40df90=_0x5acc7d?0x0:_0x3f38cc[_0x8dbf('0x1c')];var _0x5860f1=_0x5acc7d?_0x480308[_0x8dbf('0x1e')]:_0x3f38cc[_0x8dbf('0x1c')]+_0x3f38cc[_0x8dbf('0x1f')];var _0x1ebc4f;if(_0x5860f1>=_0x2b3787){_0x5860f1=_0x2b3787;_0x1ebc4f=0xc8;}else{_0x1ebc4f=0xce;}_0x17cb52['status'](_0x1ebc4f);return _0x17cb52[_0x8dbf('0x20')](_0x8dbf('0x21'),_0x40df90+'-'+_0x5860f1+'/'+_0x2b3787)[_0x8dbf('0x1b')](_0x480308);}return null;};}function patchUpdates(_0x39f0cd){return function(_0x1798f7){try{jsonpatch[_0x8dbf('0x22')](_0x1798f7,_0x39f0cd,!![]);}catch(_0x9e1e9a){return BPromise[_0x8dbf('0x23')](_0x9e1e9a);}return _0x1798f7['save']();};}function saveUpdates(_0x6e318f,_0x27d5df){return function(_0x205b5d){if(_0x205b5d){return _0x205b5d[_0x8dbf('0x24')](_0x6e318f)[_0x8dbf('0x25')](function(_0x43396e){return _0x43396e;});}return null;};}function removeEntity(_0x23eeff,_0x524d57){return function(_0x5af74b){if(_0x5af74b){return _0x5af74b[_0x8dbf('0x26')]()[_0x8dbf('0x25')](function(){var _0x13e286=_0x5af74b[_0x8dbf('0x27')]({'plain':!![]});var _0x54a3d0=_0x8dbf('0x28');return db[_0x8dbf('0x29')]['destroy']({'where':{'type':_0x54a3d0,'resourceId':_0x13e286['id']}})[_0x8dbf('0x25')](function(){return _0x5af74b;});})[_0x8dbf('0x25')](function(){_0x23eeff[_0x8dbf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4593af,_0x20c6bb){return function(_0x7f6a45){if(!_0x7f6a45){_0x4593af['sendStatus'](0x194);}return _0x7f6a45;};}function handleError(_0x1238ac,_0x245e86){_0x245e86=_0x245e86||0x1f4;return function(_0x309ae2){logger['error'](_0x309ae2[_0x8dbf('0x2a')]);if(_0x309ae2[_0x8dbf('0x2b')]){delete _0x309ae2[_0x8dbf('0x2b')];}_0x1238ac['status'](_0x245e86)['send'](_0x309ae2);};}exports['index']=function(_0xbf5a,_0x1bf035){var _0x502991={},_0x626ce2={},_0x2bad8f={'count':0x0,'rows':[]};var _0x274ae6=_[_0x8dbf('0x2c')](db['Template'][_0x8dbf('0x2d')],function(_0x3de478){return{'name':_0x3de478['fieldName'],'type':_0x3de478[_0x8dbf('0x2e')][_0x8dbf('0x2f')]};});_0x626ce2['model']=_[_0x8dbf('0x2c')](_0x274ae6,_0x8dbf('0x2b'));_0x626ce2[_0x8dbf('0x30')]=_[_0x8dbf('0x31')](_0xbf5a[_0x8dbf('0x30')]);_0x626ce2['filters']=_[_0x8dbf('0x32')](_0x626ce2[_0x8dbf('0x33')],_0x626ce2[_0x8dbf('0x30')]);_0x502991['attributes']=_['intersection'](_0x626ce2[_0x8dbf('0x33')],qs[_0x8dbf('0x34')](_0xbf5a[_0x8dbf('0x30')][_0x8dbf('0x34')]));_0x502991['attributes']=_0x502991[_0x8dbf('0x35')][_0x8dbf('0x36')]?_0x502991['attributes']:_0x626ce2[_0x8dbf('0x33')];if(!_0xbf5a['query'][_0x8dbf('0x37')](_0x8dbf('0x38'))){_0x502991['limit']=qs[_0x8dbf('0x1f')](_0xbf5a[_0x8dbf('0x30')]['limit']);_0x502991[_0x8dbf('0x1c')]=qs[_0x8dbf('0x1c')](_0xbf5a[_0x8dbf('0x30')]['offset']);}_0x502991[_0x8dbf('0x39')]=qs[_0x8dbf('0x3a')](_0xbf5a[_0x8dbf('0x30')][_0x8dbf('0x3a')]);_0x502991['where']=qs[_0x8dbf('0x3b')](_[_0x8dbf('0x3c')](_0xbf5a[_0x8dbf('0x30')],_0x626ce2[_0x8dbf('0x3b')]),_0x274ae6);if(_0xbf5a[_0x8dbf('0x30')][_0x8dbf('0x3d')]){_0x502991[_0x8dbf('0x3e')]=_['merge'](_0x502991['where'],{'$or':_['map'](_0x274ae6,function(_0x5a9a41){if(_0x5a9a41[_0x8dbf('0x2e')]!=='VIRTUAL'){var _0x416089={};_0x416089[_0x5a9a41[_0x8dbf('0x2b')]]={'$like':'%'+_0xbf5a[_0x8dbf('0x30')][_0x8dbf('0x3d')]+'%'};return _0x416089;}})});}_0x502991=_[_0x8dbf('0x3f')]({},_0x502991,_0xbf5a[_0x8dbf('0x40')]);var _0x5d60a0={'where':_0x502991[_0x8dbf('0x3e')]};return db[_0x8dbf('0x41')][_0x8dbf('0x1e')](_0x5d60a0)[_0x8dbf('0x25')](function(_0x3641cf){_0x2bad8f[_0x8dbf('0x1e')]=_0x3641cf;if(_0xbf5a[_0x8dbf('0x30')][_0x8dbf('0x42')]){_0x502991[_0x8dbf('0x43')]=[{'all':!![]}];}return db[_0x8dbf('0x41')][_0x8dbf('0x44')](_0x502991);})[_0x8dbf('0x25')](function(_0x4d9733){_0x2bad8f['rows']=_0x4d9733;return _0x2bad8f;})['then'](respondWithFilteredResult(_0x1bf035,_0x502991))[_0x8dbf('0x45')](handleError(_0x1bf035,null));};exports[_0x8dbf('0x46')]=function(_0x5e6803,_0x4aa542){var _0x13157d={'raw':!![],'where':{'id':_0x5e6803['params']['id']}},_0x593184={};_0x593184[_0x8dbf('0x33')]=_[_0x8dbf('0x31')](db[_0x8dbf('0x41')][_0x8dbf('0x2d')]);_0x593184[_0x8dbf('0x30')]=_[_0x8dbf('0x31')](_0x5e6803['query']);_0x593184[_0x8dbf('0x3b')]=_[_0x8dbf('0x32')](_0x593184['model'],_0x593184[_0x8dbf('0x30')]);_0x13157d[_0x8dbf('0x35')]=_['intersection'](_0x593184[_0x8dbf('0x33')],qs['fields'](_0x5e6803[_0x8dbf('0x30')][_0x8dbf('0x34')]));_0x13157d['attributes']=_0x13157d[_0x8dbf('0x35')][_0x8dbf('0x36')]?_0x13157d[_0x8dbf('0x35')]:_0x593184[_0x8dbf('0x33')];if(_0x5e6803[_0x8dbf('0x30')][_0x8dbf('0x42')]){_0x13157d[_0x8dbf('0x43')]=[{'all':!![]}];}_0x13157d=_[_0x8dbf('0x3f')]({},_0x13157d,_0x5e6803['options']);return db[_0x8dbf('0x41')][_0x8dbf('0x47')](_0x13157d)[_0x8dbf('0x25')](handleEntityNotFound(_0x4aa542,null))[_0x8dbf('0x25')](respondWithResult(_0x4aa542,null))['catch'](handleError(_0x4aa542,null));};exports[_0x8dbf('0x48')]=function(_0x2a3fef,_0x1a3edd){return db[_0x8dbf('0x41')][_0x8dbf('0x48')](_0x2a3fef[_0x8dbf('0x49')],{})[_0x8dbf('0x25')](function(_0x562ac0){var _0x37fcd0=_0x2a3fef['user'][_0x8dbf('0x27')]({'plain':!![]});if(!_0x37fcd0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37fcd0[_0x8dbf('0x4a')]===_0x8dbf('0x4b')){var _0xd2ba9b=_0x562ac0[_0x8dbf('0x27')]({'plain':!![]});var _0x1821a7=_0x8dbf('0x28');return db['UserProfileSection'][_0x8dbf('0x47')]({'where':{'name':_0x1821a7,'userProfileId':_0x37fcd0[_0x8dbf('0x4c')]},'raw':!![]})[_0x8dbf('0x25')](function(_0x431d69){if(_0x431d69&&_0x431d69[_0x8dbf('0x4d')]===0x0){return db[_0x8dbf('0x29')][_0x8dbf('0x48')]({'name':_0xd2ba9b[_0x8dbf('0x2b')],'resourceId':_0xd2ba9b['id'],'type':_0x431d69[_0x8dbf('0x2b')],'sectionId':_0x431d69['id']},{})['then'](function(){return _0x562ac0;});}else{return _0x562ac0;}})[_0x8dbf('0x45')](function(_0x291697){logger[_0x8dbf('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x291697);throw _0x291697;});}return _0x562ac0;})['then'](respondWithResult(_0x1a3edd,0xc9))[_0x8dbf('0x45')](handleError(_0x1a3edd,null));};exports[_0x8dbf('0x24')]=function(_0x47a6f1,_0xc1bddf){if(_0x47a6f1[_0x8dbf('0x49')]['id']){delete _0x47a6f1[_0x8dbf('0x49')]['id'];}return db[_0x8dbf('0x41')][_0x8dbf('0x47')]({'where':{'id':_0x47a6f1[_0x8dbf('0x4f')]['id']}})[_0x8dbf('0x25')](handleEntityNotFound(_0xc1bddf,null))[_0x8dbf('0x25')](saveUpdates(_0x47a6f1[_0x8dbf('0x49')],null))[_0x8dbf('0x25')](respondWithResult(_0xc1bddf,null))[_0x8dbf('0x45')](handleError(_0xc1bddf,null));};exports[_0x8dbf('0x26')]=function(_0x5998a3,_0x4490e3){return db[_0x8dbf('0x41')]['find']({'where':{'id':_0x5998a3[_0x8dbf('0x4f')]['id']}})[_0x8dbf('0x25')](handleEntityNotFound(_0x4490e3,null))[_0x8dbf('0x25')](removeEntity(_0x4490e3,null))['catch'](handleError(_0x4490e3,null));}; \ No newline at end of file +var _0x05f1=['moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','update','then','destroy','get','Templates','stack','name','send','index','Template','fieldName','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2ceedb,_0x3d4af3){var _0x1eef5c=function(_0xee38c1){while(--_0xee38c1){_0x2ceedb['push'](_0x2ceedb['shift']());}};_0x1eef5c(++_0x3d4af3);}(_0x05f1,0x1ee));var _0x105f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x05f1[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x105f('0x0'));var rimraf=require(_0x105f('0x1'));var zipdir=require(_0x105f('0x2'));var jsonpatch=require(_0x105f('0x3'));var rp=require('request-promise');var moment=require(_0x105f('0x4'));var BPromise=require(_0x105f('0x5'));var Mustache=require('mustache');var util=require(_0x105f('0x6'));var path=require(_0x105f('0x7'));var sox=require(_0x105f('0x8'));var csv=require(_0x105f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x105f('0xa'));var _=require('lodash');var squel=require(_0x105f('0xb'));var crypto=require(_0x105f('0xc'));var jsforce=require(_0x105f('0xd'));var deskjs=require(_0x105f('0xe'));var toCsv=require(_0x105f('0x9'));var querystring=require('querystring');var Papa=require(_0x105f('0xf'));var Redis=require(_0x105f('0x10'));var authService=require(_0x105f('0x11'));var qs=require(_0x105f('0x12'));var as=require(_0x105f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x105f('0x14'))(_0x105f('0x15'));var utils=require(_0x105f('0x16'));var config=require(_0x105f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x105f('0x18'))['db'];function respondWithStatusCode(_0x42a5fb,_0x3bd98a){_0x3bd98a=_0x3bd98a||0xcc;return function(_0x423168){if(_0x423168){return _0x42a5fb[_0x105f('0x19')](_0x3bd98a);}return _0x42a5fb['status'](_0x3bd98a)[_0x105f('0x1a')]();};}function respondWithResult(_0x30d7eb,_0x2505bd){_0x2505bd=_0x2505bd||0xc8;return function(_0x23a4d8){if(_0x23a4d8){return _0x30d7eb['status'](_0x2505bd)[_0x105f('0x1b')](_0x23a4d8);}};}function respondWithFilteredResult(_0x79891e,_0x30549c){return function(_0x269ce1){if(_0x269ce1){var _0x148c0c=typeof _0x30549c[_0x105f('0x1c')]===_0x105f('0x1d')&&typeof _0x30549c['limit']===_0x105f('0x1d');var _0x66881f=_0x269ce1[_0x105f('0x1e')];var _0x4c8304=_0x148c0c?0x0:_0x30549c[_0x105f('0x1c')];var _0x45c7ed=_0x148c0c?_0x269ce1[_0x105f('0x1e')]:_0x30549c[_0x105f('0x1c')]+_0x30549c[_0x105f('0x1f')];var _0x46adb6;if(_0x45c7ed>=_0x66881f){_0x45c7ed=_0x66881f;_0x46adb6=0xc8;}else{_0x46adb6=0xce;}_0x79891e[_0x105f('0x20')](_0x46adb6);return _0x79891e[_0x105f('0x21')]('Content-Range',_0x4c8304+'-'+_0x45c7ed+'/'+_0x66881f)[_0x105f('0x1b')](_0x269ce1);}return null;};}function patchUpdates(_0x187bc7){return function(_0x36a955){try{jsonpatch[_0x105f('0x22')](_0x36a955,_0x187bc7,!![]);}catch(_0x124934){return BPromise[_0x105f('0x23')](_0x124934);}return _0x36a955['save']();};}function saveUpdates(_0x1f6972,_0x251aa0){return function(_0x59ce89){if(_0x59ce89){return _0x59ce89[_0x105f('0x24')](_0x1f6972)[_0x105f('0x25')](function(_0x12d7c0){return _0x12d7c0;});}return null;};}function removeEntity(_0x2d2964,_0x2073b6){return function(_0x591f4){if(_0x591f4){return _0x591f4[_0x105f('0x26')]()[_0x105f('0x25')](function(){var _0x48fb0d=_0x591f4[_0x105f('0x27')]({'plain':!![]});var _0x90d199=_0x105f('0x28');return db['UserProfileResource'][_0x105f('0x26')]({'where':{'type':_0x90d199,'resourceId':_0x48fb0d['id']}})[_0x105f('0x25')](function(){return _0x591f4;});})[_0x105f('0x25')](function(){_0x2d2964[_0x105f('0x20')](0xcc)[_0x105f('0x1a')]();});}};}function handleEntityNotFound(_0x28561f,_0x1b867f){return function(_0x4ad1eb){if(!_0x4ad1eb){_0x28561f[_0x105f('0x19')](0x194);}return _0x4ad1eb;};}function handleError(_0x4686f6,_0x35280f){_0x35280f=_0x35280f||0x1f4;return function(_0x3a8a7e){logger['error'](_0x3a8a7e[_0x105f('0x29')]);if(_0x3a8a7e[_0x105f('0x2a')]){delete _0x3a8a7e[_0x105f('0x2a')];}_0x4686f6[_0x105f('0x20')](_0x35280f)[_0x105f('0x2b')](_0x3a8a7e);};}exports[_0x105f('0x2c')]=function(_0x5827b2,_0x58f0c1){var _0x32e5b9={},_0x4c19b9={},_0x57c53b={'count':0x0,'rows':[]};var _0x54d539=_['map'](db[_0x105f('0x2d')]['rawAttributes'],function(_0x2d396a){return{'name':_0x2d396a[_0x105f('0x2e')],'type':_0x2d396a['type']['key']};});_0x4c19b9['model']=_['map'](_0x54d539,'name');_0x4c19b9[_0x105f('0x2f')]=_[_0x105f('0x30')](_0x5827b2[_0x105f('0x2f')]);_0x4c19b9['filters']=_['intersection'](_0x4c19b9['model'],_0x4c19b9[_0x105f('0x2f')]);_0x32e5b9['attributes']=_[_0x105f('0x31')](_0x4c19b9[_0x105f('0x32')],qs[_0x105f('0x33')](_0x5827b2[_0x105f('0x2f')]['fields']));_0x32e5b9[_0x105f('0x34')]=_0x32e5b9['attributes'][_0x105f('0x35')]?_0x32e5b9[_0x105f('0x34')]:_0x4c19b9[_0x105f('0x32')];if(!_0x5827b2[_0x105f('0x2f')][_0x105f('0x36')]('nolimit')){_0x32e5b9[_0x105f('0x1f')]=qs[_0x105f('0x1f')](_0x5827b2[_0x105f('0x2f')][_0x105f('0x1f')]);_0x32e5b9['offset']=qs[_0x105f('0x1c')](_0x5827b2[_0x105f('0x2f')][_0x105f('0x1c')]);}_0x32e5b9[_0x105f('0x37')]=qs[_0x105f('0x38')](_0x5827b2[_0x105f('0x2f')][_0x105f('0x38')]);_0x32e5b9[_0x105f('0x39')]=qs[_0x105f('0x3a')](_[_0x105f('0x3b')](_0x5827b2[_0x105f('0x2f')],_0x4c19b9[_0x105f('0x3a')]),_0x54d539);if(_0x5827b2[_0x105f('0x2f')]['filter']){_0x32e5b9[_0x105f('0x39')]=_[_0x105f('0x3c')](_0x32e5b9[_0x105f('0x39')],{'$or':_[_0x105f('0x3d')](_0x54d539,function(_0x3ad896){if(_0x3ad896[_0x105f('0x3e')]!==_0x105f('0x3f')){var _0x3923aa={};_0x3923aa[_0x3ad896[_0x105f('0x2a')]]={'$like':'%'+_0x5827b2[_0x105f('0x2f')]['filter']+'%'};return _0x3923aa;}})});}_0x32e5b9=_[_0x105f('0x3c')]({},_0x32e5b9,_0x5827b2['options']);var _0x194e75={'where':_0x32e5b9[_0x105f('0x39')]};return db[_0x105f('0x2d')][_0x105f('0x1e')](_0x194e75)[_0x105f('0x25')](function(_0x504795){_0x57c53b[_0x105f('0x1e')]=_0x504795;if(_0x5827b2['query'][_0x105f('0x40')]){_0x32e5b9[_0x105f('0x41')]=[{'all':!![]}];}return db['Template'][_0x105f('0x42')](_0x32e5b9);})[_0x105f('0x25')](function(_0x17b3a8){_0x57c53b[_0x105f('0x43')]=_0x17b3a8;return _0x57c53b;})[_0x105f('0x25')](respondWithFilteredResult(_0x58f0c1,_0x32e5b9))['catch'](handleError(_0x58f0c1,null));};exports[_0x105f('0x44')]=function(_0x563bb6,_0x3fdb6e){var _0x246e7f={'raw':!![],'where':{'id':_0x563bb6['params']['id']}},_0x2b1a73={};_0x2b1a73[_0x105f('0x32')]=_[_0x105f('0x30')](db[_0x105f('0x2d')][_0x105f('0x45')]);_0x2b1a73[_0x105f('0x2f')]=_[_0x105f('0x30')](_0x563bb6[_0x105f('0x2f')]);_0x2b1a73[_0x105f('0x3a')]=_[_0x105f('0x31')](_0x2b1a73['model'],_0x2b1a73[_0x105f('0x2f')]);_0x246e7f[_0x105f('0x34')]=_[_0x105f('0x31')](_0x2b1a73[_0x105f('0x32')],qs[_0x105f('0x33')](_0x563bb6[_0x105f('0x2f')][_0x105f('0x33')]));_0x246e7f[_0x105f('0x34')]=_0x246e7f['attributes'][_0x105f('0x35')]?_0x246e7f[_0x105f('0x34')]:_0x2b1a73['model'];if(_0x563bb6['query'][_0x105f('0x40')]){_0x246e7f[_0x105f('0x41')]=[{'all':!![]}];}_0x246e7f=_[_0x105f('0x3c')]({},_0x246e7f,_0x563bb6[_0x105f('0x46')]);return db[_0x105f('0x2d')][_0x105f('0x47')](_0x246e7f)['then'](handleEntityNotFound(_0x3fdb6e,null))[_0x105f('0x25')](respondWithResult(_0x3fdb6e,null))['catch'](handleError(_0x3fdb6e,null));};exports[_0x105f('0x48')]=function(_0x5ae00a,_0x59dc2e){return db[_0x105f('0x2d')][_0x105f('0x48')](_0x5ae00a[_0x105f('0x49')],{})[_0x105f('0x25')](function(_0x5e81ff){var _0x5ee792=_0x5ae00a['user'][_0x105f('0x27')]({'plain':!![]});if(!_0x5ee792)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ee792[_0x105f('0x4a')]===_0x105f('0x4b')){var _0x32c536=_0x5e81ff[_0x105f('0x27')]({'plain':!![]});var _0x403b89=_0x105f('0x28');return db[_0x105f('0x4c')]['find']({'where':{'name':_0x403b89,'userProfileId':_0x5ee792[_0x105f('0x4d')]},'raw':!![]})[_0x105f('0x25')](function(_0x56524c){if(_0x56524c&&_0x56524c[_0x105f('0x4e')]===0x0){return db[_0x105f('0x4f')][_0x105f('0x48')]({'name':_0x32c536[_0x105f('0x2a')],'resourceId':_0x32c536['id'],'type':_0x56524c[_0x105f('0x2a')],'sectionId':_0x56524c['id']},{})[_0x105f('0x25')](function(){return _0x5e81ff;});}else{return _0x5e81ff;}})[_0x105f('0x50')](function(_0x1a663b){logger['error'](_0x105f('0x51'),_0x1a663b);throw _0x1a663b;});}return _0x5e81ff;})['then'](respondWithResult(_0x59dc2e,0xc9))[_0x105f('0x50')](handleError(_0x59dc2e,null));};exports[_0x105f('0x24')]=function(_0x4deb21,_0x131a63){if(_0x4deb21[_0x105f('0x49')]['id']){delete _0x4deb21[_0x105f('0x49')]['id'];}return db[_0x105f('0x2d')][_0x105f('0x47')]({'where':{'id':_0x4deb21['params']['id']}})[_0x105f('0x25')](handleEntityNotFound(_0x131a63,null))[_0x105f('0x25')](saveUpdates(_0x4deb21['body'],null))[_0x105f('0x25')](respondWithResult(_0x131a63,null))[_0x105f('0x50')](handleError(_0x131a63,null));};exports[_0x105f('0x26')]=function(_0x5cd249,_0x4b343c){return db[_0x105f('0x2d')][_0x105f('0x47')]({'where':{'id':_0x5cd249[_0x105f('0x52')]['id']}})[_0x105f('0x25')](handleEntityNotFound(_0x4b343c,null))['then'](removeEntity(_0x4b343c,null))[_0x105f('0x50')](handleError(_0x4b343c,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c38e938..de576c6 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 _0x4869=['./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cfca5,_0x3fa3ab){var _0xcf8dac=function(_0x48e71e){while(--_0x48e71e){_0x5cfca5['push'](_0x5cfca5['shift']());}};_0xcf8dac(++_0x3fa3ab);}(_0x4869,0x17e));var _0x9486=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x4869[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x9486('0x0'));var util=require(_0x9486('0x1'));var logger=require(_0x9486('0x2'))(_0x9486('0x3'));var moment=require(_0x9486('0x4'));var BPromise=require(_0x9486('0x5'));var rp=require(_0x9486('0x6'));var fs=require('fs');var path=require(_0x9486('0x7'));var rimraf=require(_0x9486('0x8'));var config=require(_0x9486('0x9'));var attributes=require(_0x9486('0xa'));module[_0x9486('0xb')]=function(_0x4e6746,_0x88e26e){return _0x4e6746[_0x9486('0xc')]('Template',attributes,{'tableName':_0x9486('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22f1=['exports','define','tools_templates','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes'];(function(_0x17bbb2,_0x5eb2f8){var _0x2a3cea=function(_0x4ec29b){while(--_0x4ec29b){_0x17bbb2['push'](_0x17bbb2['shift']());}};_0x2a3cea(++_0x5eb2f8);}(_0x22f1,0x147));var _0x122f=function(_0x3b9772,_0x5286d6){_0x3b9772=_0x3b9772-0x0;var _0x4b1a6d=_0x22f1[_0x3b9772];return _0x4b1a6d;};'use strict';var _=require(_0x122f('0x0'));var util=require('util');var logger=require(_0x122f('0x1'))(_0x122f('0x2'));var moment=require(_0x122f('0x3'));var BPromise=require('bluebird');var rp=require(_0x122f('0x4'));var fs=require('fs');var path=require(_0x122f('0x5'));var rimraf=require(_0x122f('0x6'));var config=require(_0x122f('0x7'));var attributes=require(_0x122f('0x8'));module[_0x122f('0x9')]=function(_0x3b4502,_0x4aa0ea){return _0x3b4502[_0x122f('0xa')]('Template',attributes,{'tableName':_0x122f('0xb'),'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 ed9936c..a03c51f 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 _0xe3af=['attributes','limit','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Template,\x20%s,\x20%s','info','catch','GetTemplate','Template','findAll','options','raw','where'];(function(_0x45b1ad,_0x215b03){var _0x3d5696=function(_0x4d9e73){while(--_0x4d9e73){_0x45b1ad['push'](_0x45b1ad['shift']());}};_0x3d5696(++_0x215b03);}(_0xe3af,0xf4));var _0xfe3a=function(_0x44b346,_0xeb097d){_0x44b346=_0x44b346-0x0;var _0x1c2f2b=_0xe3af[_0x44b346];return _0x1c2f2b;};'use strict';var _=require(_0xfe3a('0x0'));var util=require(_0xfe3a('0x1'));var moment=require(_0xfe3a('0x2'));var BPromise=require(_0xfe3a('0x3'));var rs=require(_0xfe3a('0x4'));var fs=require('fs');var Redis=require(_0xfe3a('0x5'));var db=require(_0xfe3a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe3a('0x7'))(_0xfe3a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfe3a('0x9'));var client=jayson[_0xfe3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5796,_0x3adfbe,_0x10c472){return new BPromise(function(_0x11c67a,_0x4c4124){return client[_0xfe3a('0xb')](_0x3c5796,_0x10c472)[_0xfe3a('0xc')](function(_0x2a76eb){logger['info']('Template,\x20%s,\x20%s',_0x3adfbe,_0xfe3a('0xd'));logger['debug'](_0xfe3a('0xe'),_0x3adfbe,_0xfe3a('0xd'),JSON[_0xfe3a('0xf')](_0x2a76eb));if(_0x2a76eb[_0xfe3a('0x10')]){if(_0x2a76eb[_0xfe3a('0x10')][_0xfe3a('0x11')]===0x1f4){logger[_0xfe3a('0x10')]('Template,\x20%s,\x20%s',_0x3adfbe,_0x2a76eb['error'][_0xfe3a('0x12')]);return _0x4c4124(_0x2a76eb['error'][_0xfe3a('0x12')]);}logger['error'](_0xfe3a('0x13'),_0x3adfbe,_0x2a76eb[_0xfe3a('0x10')][_0xfe3a('0x12')]);return _0x11c67a(_0x2a76eb['error']['message']);}else{logger[_0xfe3a('0x14')](_0xfe3a('0x13'),_0x3adfbe,'request\x20sent');_0x11c67a(_0x2a76eb['result'][_0xfe3a('0x12')]);}})[_0xfe3a('0x15')](function(_0x501542){logger[_0xfe3a('0x10')](_0xfe3a('0x13'),_0x3adfbe,_0x501542);_0x4c4124(_0x501542);});});}exports[_0xfe3a('0x16')]=function(_0x1c40ec){var _0x55d840=this;return new Promise(function(_0x27d6ab,_0x653a18){return db[_0xfe3a('0x17')][_0xfe3a('0x18')]({'raw':_0x1c40ec[_0xfe3a('0x19')]?_0x1c40ec['options'][_0xfe3a('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c40ec[_0xfe3a('0x19')]?_0x1c40ec[_0xfe3a('0x19')][_0xfe3a('0x1b')]||null:null,'attributes':_0x1c40ec[_0xfe3a('0x19')]?_0x1c40ec['options'][_0xfe3a('0x1c')]||null:null,'limit':_0x1c40ec['options']?_0x1c40ec['options'][_0xfe3a('0x1d')]||null:null,'include':_0x1c40ec[_0xfe3a('0x19')]?_0x1c40ec['options']['include']?_['map'](_0x1c40ec['options'][_0xfe3a('0x1e')],function(_0x3fcb42){return{'model':db[_0x3fcb42[_0xfe3a('0x1f')]],'as':_0x3fcb42['as'],'attributes':_0x3fcb42[_0xfe3a('0x1c')],'include':_0x3fcb42[_0xfe3a('0x1e')]?_[_0xfe3a('0x20')](_0x3fcb42[_0xfe3a('0x1e')],function(_0x4d3835){return{'model':db[_0x4d3835[_0xfe3a('0x1f')]],'as':_0x4d3835['as'],'attributes':_0x4d3835['attributes'],'include':_0x4d3835[_0xfe3a('0x1e')]?_[_0xfe3a('0x20')](_0x4d3835['include'],function(_0x1050cb){return{'model':db[_0x1050cb[_0xfe3a('0x1f')]],'as':_0x1050cb['as'],'attributes':_0x1050cb[_0xfe3a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfe3a('0xc')](function(_0x592204){logger[_0xfe3a('0x14')]('GetTemplate',_0x1c40ec);logger[_0xfe3a('0x21')]('GetTemplate',_0x1c40ec,JSON[_0xfe3a('0xf')](_0x592204));_0x27d6ab(_0x592204);})[_0xfe3a('0x15')](function(_0x3b1da0){logger[_0xfe3a('0x10')](_0xfe3a('0x16'),_0x3b1da0[_0xfe3a('0x12')],_0x1c40ec);_0x653a18(_0x55d840[_0xfe3a('0x10')](0x1f4,_0x3b1da0[_0xfe3a('0x12')]));});});}; \ No newline at end of file +var _0xc107=['stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0x49abc4,_0x3a9ea2){var _0x59c694=function(_0x448780){while(--_0x448780){_0x49abc4['push'](_0x49abc4['shift']());}};_0x59c694(++_0x3a9ea2);}(_0xc107,0x13c));var _0x7c10=function(_0x2d5da1,_0x1a0315){_0x2d5da1=_0x2d5da1-0x0;var _0x40b7b1=_0xc107[_0x2d5da1];return _0x40b7b1;};'use strict';var _=require(_0x7c10('0x0'));var util=require(_0x7c10('0x1'));var moment=require('moment');var BPromise=require(_0x7c10('0x2'));var rs=require(_0x7c10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c10('0x4'))['db'];var utils=require(_0x7c10('0x5'));var logger=require(_0x7c10('0x6'))(_0x7c10('0x7'));var config=require(_0x7c10('0x8'));var jayson=require(_0x7c10('0x9'));var client=jayson[_0x7c10('0xa')][_0x7c10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcfd492,_0x563051,_0x16206a){return new BPromise(function(_0x1b0c7b,_0x2ceaaa){return client[_0x7c10('0xc')](_0xcfd492,_0x16206a)[_0x7c10('0xd')](function(_0x4ec00c){logger[_0x7c10('0xe')](_0x7c10('0xf'),_0x563051,_0x7c10('0x10'));logger['debug'](_0x7c10('0x11'),_0x563051,_0x7c10('0x10'),JSON['stringify'](_0x4ec00c));if(_0x4ec00c[_0x7c10('0x12')]){if(_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x13')]===0x1f4){logger[_0x7c10('0x12')](_0x7c10('0xf'),_0x563051,_0x4ec00c['error'][_0x7c10('0x14')]);return _0x2ceaaa(_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x14')]);}logger['error']('Template,\x20%s,\x20%s',_0x563051,_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x14')]);return _0x1b0c7b(_0x4ec00c[_0x7c10('0x12')][_0x7c10('0x14')]);}else{logger[_0x7c10('0xe')](_0x7c10('0xf'),_0x563051,_0x7c10('0x10'));_0x1b0c7b(_0x4ec00c[_0x7c10('0x15')]['message']);}})[_0x7c10('0x16')](function(_0x17deac){logger[_0x7c10('0x12')](_0x7c10('0xf'),_0x563051,_0x17deac);_0x2ceaaa(_0x17deac);});});}exports[_0x7c10('0x17')]=function(_0x4e2a6c){var _0x9ced4c=this;return new Promise(function(_0x3b7235,_0x5cfcd8){return db[_0x7c10('0x18')][_0x7c10('0x19')]({'raw':_0x4e2a6c[_0x7c10('0x1a')]?_0x4e2a6c['options'][_0x7c10('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e2a6c['options']?_0x4e2a6c['options'][_0x7c10('0x1c')]||null:null,'attributes':_0x4e2a6c['options']?_0x4e2a6c[_0x7c10('0x1a')][_0x7c10('0x1d')]||null:null,'limit':_0x4e2a6c[_0x7c10('0x1a')]?_0x4e2a6c['options'][_0x7c10('0x1e')]||null:null,'include':_0x4e2a6c[_0x7c10('0x1a')]?_0x4e2a6c[_0x7c10('0x1a')]['include']?_[_0x7c10('0x1f')](_0x4e2a6c[_0x7c10('0x1a')][_0x7c10('0x20')],function(_0x5cea21){return{'model':db[_0x5cea21['model']],'as':_0x5cea21['as'],'attributes':_0x5cea21[_0x7c10('0x1d')],'include':_0x5cea21[_0x7c10('0x20')]?_[_0x7c10('0x1f')](_0x5cea21[_0x7c10('0x20')],function(_0x46a4f8){return{'model':db[_0x46a4f8['model']],'as':_0x46a4f8['as'],'attributes':_0x46a4f8[_0x7c10('0x1d')],'include':_0x46a4f8[_0x7c10('0x20')]?_[_0x7c10('0x1f')](_0x46a4f8['include'],function(_0x4a880c){return{'model':db[_0x4a880c[_0x7c10('0x21')]],'as':_0x4a880c['as'],'attributes':_0x4a880c[_0x7c10('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7c10('0xd')](function(_0x247cba){logger[_0x7c10('0xe')](_0x7c10('0x17'),_0x4e2a6c);logger['debug'](_0x7c10('0x17'),_0x4e2a6c,JSON[_0x7c10('0x22')](_0x247cba));_0x3b7235(_0x247cba);})[_0x7c10('0x16')](function(_0x3c76dc){logger[_0x7c10('0x12')]('GetTemplate',_0x3c76dc[_0x7c10('0x14')],_0x4e2a6c);_0x5cfcd8(_0x9ced4c['error'](0x1f4,_0x3c76dc['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 37a483b..e37299a 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 _0x8acc=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','/:id/actions','post','addAllCondition','/:id/any_conditions','addAction','/:id','update','delete'];(function(_0x2572bd,_0x11a1b3){var _0x1da206=function(_0x4071f3){while(--_0x4071f3){_0x2572bd['push'](_0x2572bd['shift']());}};_0x1da206(++_0x11a1b3);}(_0x8acc,0x9e));var _0xc8ac=function(_0x14a15b,_0x23b3be){_0x14a15b=_0x14a15b-0x0;var _0x4e2cd7=_0x8acc[_0x14a15b];return _0x4e2cd7;};'use strict';var multer=require(_0xc8ac('0x0'));var util=require(_0xc8ac('0x1'));var path=require(_0xc8ac('0x2'));var timeout=require(_0xc8ac('0x3'));var express=require(_0xc8ac('0x4'));var router=express[_0xc8ac('0x5')]();var fs_extra=require(_0xc8ac('0x6'));var auth=require(_0xc8ac('0x7'));var interaction=require(_0xc8ac('0x8'));var config=require(_0xc8ac('0x9'));var controller=require(_0xc8ac('0xa'));router[_0xc8ac('0xb')]('/',auth[_0xc8ac('0xc')](),controller[_0xc8ac('0xd')]);router['get']('/:id',auth[_0xc8ac('0xc')](),controller[_0xc8ac('0xe')]);router[_0xc8ac('0xb')](_0xc8ac('0xf'),auth[_0xc8ac('0xc')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth['isAuthenticated'](),controller['getAnyConditions']);router[_0xc8ac('0xb')](_0xc8ac('0x10'),auth[_0xc8ac('0xc')](),controller['getActions']);router[_0xc8ac('0x11')]('/',auth[_0xc8ac('0xc')](),controller['create']);router[_0xc8ac('0x11')](_0xc8ac('0xf'),auth[_0xc8ac('0xc')](),controller[_0xc8ac('0x12')]);router[_0xc8ac('0x11')](_0xc8ac('0x13'),auth[_0xc8ac('0xc')](),controller['addAnyCondition']);router[_0xc8ac('0x11')](_0xc8ac('0x10'),auth[_0xc8ac('0xc')](),controller[_0xc8ac('0x14')]);router['put'](_0xc8ac('0x15'),auth['isAuthenticated'](),controller[_0xc8ac('0x16')]);router[_0xc8ac('0x17')](_0xc8ac('0x15'),auth[_0xc8ac('0xc')](),controller[_0xc8ac('0x18')]);module[_0xc8ac('0x19')]=router; \ No newline at end of file +var _0x4a56=['index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x4a56,0x17c));var _0x64a5=function(_0x159791,_0x5d957e){_0x159791=_0x159791-0x0;var _0x7fa5c1=_0x4a56[_0x159791];return _0x7fa5c1;};'use strict';var multer=require(_0x64a5('0x0'));var util=require(_0x64a5('0x1'));var path=require('path');var timeout=require(_0x64a5('0x2'));var express=require(_0x64a5('0x3'));var router=express[_0x64a5('0x4')]();var fs_extra=require(_0x64a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x64a5('0x6'));var config=require(_0x64a5('0x7'));var controller=require(_0x64a5('0x8'));router[_0x64a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x64a5('0xa')]);router['get'](_0x64a5('0xb'),auth[_0x64a5('0xc')](),controller[_0x64a5('0xd')]);router['get'](_0x64a5('0xe'),auth[_0x64a5('0xc')](),controller[_0x64a5('0xf')]);router[_0x64a5('0x9')](_0x64a5('0x10'),auth[_0x64a5('0xc')](),controller[_0x64a5('0x11')]);router['get'](_0x64a5('0x12'),auth[_0x64a5('0xc')](),controller[_0x64a5('0x13')]);router['post']('/',auth[_0x64a5('0xc')](),controller['create']);router[_0x64a5('0x14')](_0x64a5('0xe'),auth[_0x64a5('0xc')](),controller[_0x64a5('0x15')]);router[_0x64a5('0x14')]('/:id/any_conditions',auth[_0x64a5('0xc')](),controller[_0x64a5('0x16')]);router['post'](_0x64a5('0x12'),auth[_0x64a5('0xc')](),controller['addAction']);router[_0x64a5('0x17')](_0x64a5('0xb'),auth[_0x64a5('0xc')](),controller['update']);router[_0x64a5('0x18')]('/:id',auth[_0x64a5('0xc')](),controller[_0x64a5('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 56c82a8..9b2dce4 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 _0x8ccc=['STRING','sequelize'];(function(_0x299904,_0x404946){var _0x5d8f1c=function(_0x139fb2){while(--_0x139fb2){_0x299904['push'](_0x299904['shift']());}};_0x5d8f1c(++_0x404946);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x4e6283,_0x320204){_0x4e6283=_0x4e6283-0x0;var _0x4ffb5b=_0x8ccc[_0x4e6283];return _0x4ffb5b;};'use strict';var Sequelize=require(_0xc8cc('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc8cc('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb190=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4fa5b7,_0x42a92d){var _0x578649=function(_0x2c38b1){while(--_0x2c38b1){_0x4fa5b7['push'](_0x4fa5b7['shift']());}};_0x578649(++_0x42a92d);}(_0xb190,0xce));var _0x0b19=function(_0x3d31ec,_0x4d7752){_0x3d31ec=_0x3d31ec-0x0;var _0x395d72=_0xb190[_0x3d31ec];return _0x395d72;};'use strict';var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'name':{'type':Sequelize[_0x0b19('0x2')]},'channel':{'type':Sequelize[_0x0b19('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0b19('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 46ea16c..0d7c5ed 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 _0xd083=['intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filter','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','nolimit','getAnyConditions','Action','getActions','pick','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','Content-Range','apply','reject','destroy','then','Triggers','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x14fd3a,_0x17de86){var _0x3b9a96=function(_0x1c2198){while(--_0x1c2198){_0x14fd3a['push'](_0x14fd3a['shift']());}};_0x3b9a96(++_0x17de86);}(_0xd083,0x13a));var _0x3d08=function(_0x253476,_0x16b31a){_0x253476=_0x253476-0x0;var _0x134271=_0xd083[_0x253476];return _0x134271;};'use strict';var emlformat=require(_0x3d08('0x0'));var rimraf=require(_0x3d08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d08('0x2'));var rp=require(_0x3d08('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d08('0x4'));var util=require(_0x3d08('0x5'));var path=require(_0x3d08('0x6'));var sox=require(_0x3d08('0x7'));var csv=require(_0x3d08('0x8'));var ejs=require(_0x3d08('0x9'));var fs=require('fs');var fs_extra=require(_0x3d08('0xa'));var _=require(_0x3d08('0xb'));var squel=require(_0x3d08('0xc'));var crypto=require(_0x3d08('0xd'));var jsforce=require(_0x3d08('0xe'));var deskjs=require(_0x3d08('0xf'));var toCsv=require(_0x3d08('0x8'));var querystring=require(_0x3d08('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3d08('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3d08('0x12'));var hardwareService=require(_0x3d08('0x13'));var logger=require('../../config/logger')(_0x3d08('0x14'));var utils=require(_0x3d08('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3d08('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347c0b,_0x1a21a9){_0x1a21a9=_0x1a21a9||0xcc;return function(_0x30c5eb){if(_0x30c5eb){return _0x347c0b['sendStatus'](_0x1a21a9);}return _0x347c0b['status'](_0x1a21a9)[_0x3d08('0x17')]();};}function respondWithResult(_0x1e18b1,_0x445b9b){_0x445b9b=_0x445b9b||0xc8;return function(_0x309972){if(_0x309972){return _0x1e18b1[_0x3d08('0x18')](_0x445b9b)[_0x3d08('0x19')](_0x309972);}};}function respondWithFilteredResult(_0x2ca8ba,_0x2a9d2a){return function(_0x535c6a){if(_0x535c6a){var _0x32d85d=typeof _0x2a9d2a['offset']===_0x3d08('0x1a')&&typeof _0x2a9d2a[_0x3d08('0x1b')]===_0x3d08('0x1a');var _0x1a4526=_0x535c6a[_0x3d08('0x1c')];var _0x167ace=_0x32d85d?0x0:_0x2a9d2a['offset'];var _0x18e73b=_0x32d85d?_0x535c6a[_0x3d08('0x1c')]:_0x2a9d2a['offset']+_0x2a9d2a[_0x3d08('0x1b')];var _0x1fa17a;if(_0x18e73b>=_0x1a4526){_0x18e73b=_0x1a4526;_0x1fa17a=0xc8;}else{_0x1fa17a=0xce;}_0x2ca8ba[_0x3d08('0x18')](_0x1fa17a);return _0x2ca8ba['set'](_0x3d08('0x1d'),_0x167ace+'-'+_0x18e73b+'/'+_0x1a4526)['json'](_0x535c6a);}return null;};}function patchUpdates(_0x456235){return function(_0x16c1d5){try{jsonpatch[_0x3d08('0x1e')](_0x16c1d5,_0x456235,!![]);}catch(_0x2357fa){return BPromise[_0x3d08('0x1f')](_0x2357fa);}return _0x16c1d5['save']();};}function saveUpdates(_0x47c9f7,_0x31b4b9){return function(_0x14a082){if(_0x14a082){return _0x14a082['update'](_0x47c9f7)['then'](function(_0x1b660c){return _0x1b660c;});}return null;};}function removeEntity(_0x3f61b7,_0x3cfd84){return function(_0x5ea3eb){if(_0x5ea3eb){return _0x5ea3eb[_0x3d08('0x20')]()[_0x3d08('0x21')](function(){var _0x58e94c=_0x5ea3eb['get']({'plain':!![]});var _0x1ad4dd=_0x3d08('0x22');return db[_0x3d08('0x23')]['destroy']({'where':{'type':_0x1ad4dd,'resourceId':_0x58e94c['id']}})['then'](function(){return _0x5ea3eb;});})[_0x3d08('0x21')](function(){_0x3f61b7['status'](0xcc)[_0x3d08('0x17')]();});}};}function handleEntityNotFound(_0x5ca47a,_0x2a1f88){return function(_0x39d663){if(!_0x39d663){_0x5ca47a[_0x3d08('0x24')](0x194);}return _0x39d663;};}function handleError(_0x5ae5ef,_0x181158){_0x181158=_0x181158||0x1f4;return function(_0xd65714){logger['error'](_0xd65714[_0x3d08('0x25')]);if(_0xd65714[_0x3d08('0x26')]){delete _0xd65714[_0x3d08('0x26')];}_0x5ae5ef[_0x3d08('0x18')](_0x181158)[_0x3d08('0x27')](_0xd65714);};}exports[_0x3d08('0x28')]=function(_0x9c6252,_0xbf60fe){var _0x48fb38={},_0x2b07fb={},_0x312f7d={'count':0x0,'rows':[]};var _0xb1aab1=_[_0x3d08('0x29')](db['Trigger'][_0x3d08('0x2a')],function(_0x24ac12){return{'name':_0x24ac12[_0x3d08('0x2b')],'type':_0x24ac12[_0x3d08('0x2c')][_0x3d08('0x2d')]};});_0x2b07fb[_0x3d08('0x2e')]=_[_0x3d08('0x29')](_0xb1aab1,_0x3d08('0x26'));_0x2b07fb[_0x3d08('0x2f')]=_[_0x3d08('0x30')](_0x9c6252[_0x3d08('0x2f')]);_0x2b07fb[_0x3d08('0x31')]=_[_0x3d08('0x32')](_0x2b07fb[_0x3d08('0x2e')],_0x2b07fb['query']);_0x48fb38[_0x3d08('0x33')]=_['intersection'](_0x2b07fb[_0x3d08('0x2e')],qs['fields'](_0x9c6252['query'][_0x3d08('0x34')]));_0x48fb38[_0x3d08('0x33')]=_0x48fb38[_0x3d08('0x33')][_0x3d08('0x35')]?_0x48fb38['attributes']:_0x2b07fb[_0x3d08('0x2e')];if(!_0x9c6252['query'][_0x3d08('0x36')]('nolimit')){_0x48fb38['limit']=qs[_0x3d08('0x1b')](_0x9c6252[_0x3d08('0x2f')][_0x3d08('0x1b')]);_0x48fb38[_0x3d08('0x37')]=qs[_0x3d08('0x37')](_0x9c6252['query'][_0x3d08('0x37')]);}_0x48fb38[_0x3d08('0x38')]=qs[_0x3d08('0x39')](_0x9c6252[_0x3d08('0x2f')][_0x3d08('0x39')]);_0x48fb38[_0x3d08('0x3a')]=qs[_0x3d08('0x31')](_['pick'](_0x9c6252[_0x3d08('0x2f')],_0x2b07fb[_0x3d08('0x31')]),_0xb1aab1);if(_0x9c6252[_0x3d08('0x2f')][_0x3d08('0x3b')]){_0x48fb38[_0x3d08('0x3a')]=_[_0x3d08('0x3c')](_0x48fb38[_0x3d08('0x3a')],{'$or':_['map'](_0xb1aab1,function(_0x338f4f){if(_0x338f4f['type']!==_0x3d08('0x3d')){var _0x55abcd={};_0x55abcd[_0x338f4f[_0x3d08('0x26')]]={'$like':'%'+_0x9c6252[_0x3d08('0x2f')][_0x3d08('0x3b')]+'%'};return _0x55abcd;}})});}_0x48fb38=_[_0x3d08('0x3c')]({},_0x48fb38,_0x9c6252[_0x3d08('0x3e')]);var _0x3558f8={'where':_0x48fb38['where']};return db[_0x3d08('0x3f')][_0x3d08('0x1c')](_0x3558f8)[_0x3d08('0x21')](function(_0x895f22){_0x312f7d[_0x3d08('0x1c')]=_0x895f22;if(_0x9c6252[_0x3d08('0x2f')][_0x3d08('0x40')]){_0x48fb38[_0x3d08('0x41')]=[{'all':!![]}];}return db[_0x3d08('0x3f')][_0x3d08('0x42')](_0x48fb38);})[_0x3d08('0x21')](function(_0x80354b){_0x312f7d[_0x3d08('0x43')]=_0x80354b;return _0x312f7d;})[_0x3d08('0x21')](respondWithFilteredResult(_0xbf60fe,_0x48fb38))['catch'](handleError(_0xbf60fe,null));};exports[_0x3d08('0x44')]=function(_0x517ba7,_0x2ead29){var _0x260574={'raw':![],'where':{'id':_0x517ba7[_0x3d08('0x45')]['id']}},_0x42eacc={};_0x42eacc[_0x3d08('0x2e')]=_['keys'](db[_0x3d08('0x3f')][_0x3d08('0x2a')]);_0x42eacc[_0x3d08('0x2f')]=_['keys'](_0x517ba7[_0x3d08('0x2f')]);_0x42eacc[_0x3d08('0x31')]=_[_0x3d08('0x32')](_0x42eacc[_0x3d08('0x2e')],_0x42eacc['query']);_0x260574[_0x3d08('0x33')]=_[_0x3d08('0x32')](_0x42eacc['model'],qs['fields'](_0x517ba7[_0x3d08('0x2f')]['fields']));_0x260574['attributes']=_0x260574[_0x3d08('0x33')][_0x3d08('0x35')]?_0x260574[_0x3d08('0x33')]:_0x42eacc[_0x3d08('0x2e')];if(_0x517ba7[_0x3d08('0x2f')][_0x3d08('0x40')]){_0x260574[_0x3d08('0x41')]=[{'all':!![]}];}_0x260574=_[_0x3d08('0x3c')]({},_0x260574,_0x517ba7[_0x3d08('0x3e')]);return db['Trigger']['find'](_0x260574)[_0x3d08('0x21')](handleEntityNotFound(_0x2ead29,null))[_0x3d08('0x21')](respondWithResult(_0x2ead29,null))[_0x3d08('0x46')](handleError(_0x2ead29,null));};exports['create']=function(_0x2e21e2,_0x454fb2){return db['Trigger'][_0x3d08('0x47')](_0x2e21e2[_0x3d08('0x48')],{})[_0x3d08('0x21')](function(_0x48d927){var _0x3d6bb8=_0x2e21e2[_0x3d08('0x49')]['get']({'plain':!![]});if(!_0x3d6bb8)throw new Error(_0x3d08('0x4a'));if(_0x3d6bb8['role']===_0x3d08('0x49')){var _0x4bb5e5=_0x48d927[_0x3d08('0x4b')]({'plain':!![]});var _0x2150a3=_0x3d08('0x22');return db['UserProfileSection'][_0x3d08('0x4c')]({'where':{'name':_0x2150a3,'userProfileId':_0x3d6bb8['userProfileId']},'raw':!![]})['then'](function(_0x2f69ce){if(_0x2f69ce&&_0x2f69ce[_0x3d08('0x4d')]===0x0){return db['UserProfileResource'][_0x3d08('0x47')]({'name':_0x4bb5e5[_0x3d08('0x26')],'resourceId':_0x4bb5e5['id'],'type':_0x2f69ce[_0x3d08('0x26')],'sectionId':_0x2f69ce['id']},{})[_0x3d08('0x21')](function(){return _0x48d927;});}else{return _0x48d927;}})['catch'](function(_0x4a35be){logger['error'](_0x3d08('0x4e'),_0x4a35be);throw _0x4a35be;});}return _0x48d927;})['then'](respondWithResult(_0x454fb2,0xc9))['catch'](handleError(_0x454fb2,null));};exports['update']=function(_0x180d9f,_0x466c66){if(_0x180d9f[_0x3d08('0x48')]['id']){delete _0x180d9f[_0x3d08('0x48')]['id'];}return db['Trigger'][_0x3d08('0x4c')]({'where':{'id':_0x180d9f[_0x3d08('0x45')]['id']}})['then'](handleEntityNotFound(_0x466c66,null))[_0x3d08('0x21')](saveUpdates(_0x180d9f[_0x3d08('0x48')],null))['then'](respondWithResult(_0x466c66,null))[_0x3d08('0x46')](handleError(_0x466c66,null));};exports[_0x3d08('0x20')]=function(_0x22d1a9,_0xefd09d){return db['Trigger'][_0x3d08('0x4c')]({'where':{'id':_0x22d1a9[_0x3d08('0x45')]['id']}})['then'](handleEntityNotFound(_0xefd09d,null))[_0x3d08('0x21')](removeEntity(_0xefd09d,null))[_0x3d08('0x46')](handleError(_0xefd09d,null));};exports[_0x3d08('0x4f')]=function(_0xa25e5a,_0x363989,_0x19bb88){if(_0xa25e5a[_0x3d08('0x48')]['id']){delete _0xa25e5a[_0x3d08('0x48')]['id'];}return db[_0x3d08('0x3f')]['find']({'where':{'id':_0xa25e5a[_0x3d08('0x45')]['id']}})['then'](handleEntityNotFound(_0x363989,null))[_0x3d08('0x21')](function(_0x458336){if(_0x458336){_0xa25e5a[_0x3d08('0x48')][_0x3d08('0x50')]=_0x458336['id'];return db['Condition']['create'](_0xa25e5a[_0x3d08('0x48')]);}})[_0x3d08('0x21')](respondWithResult(_0x363989,null))['catch'](handleError(_0x363989,null));};exports[_0x3d08('0x51')]=function(_0x140fb7,_0x35c102,_0x4bd3c8){if(_0x140fb7[_0x3d08('0x48')]['id']){delete _0x140fb7[_0x3d08('0x48')]['id'];}return db[_0x3d08('0x3f')][_0x3d08('0x4c')]({'where':{'id':_0x140fb7[_0x3d08('0x45')]['id']}})[_0x3d08('0x21')](handleEntityNotFound(_0x35c102,null))[_0x3d08('0x21')](function(_0x484e72){if(_0x484e72){_0x140fb7['body'][_0x3d08('0x52')]=_0x484e72['id'];return db[_0x3d08('0x53')][_0x3d08('0x47')](_0x140fb7[_0x3d08('0x48')]);}})[_0x3d08('0x21')](respondWithResult(_0x35c102,null))['catch'](handleError(_0x35c102,null));};exports[_0x3d08('0x54')]=function(_0x55196b,_0x378659,_0x126b60){var _0x495517={};var _0x4ea549={};var _0x255538;var _0x3ff8d9;return db[_0x3d08('0x3f')][_0x3d08('0x55')]({'where':{'id':_0x55196b[_0x3d08('0x45')]['id']}})[_0x3d08('0x21')](handleEntityNotFound(_0x378659,null))[_0x3d08('0x21')](function(_0x4df1ec){if(_0x4df1ec){_0x255538=_0x4df1ec;_0x4ea549[_0x3d08('0x2e')]=_['keys'](db[_0x3d08('0x53')][_0x3d08('0x2a')]);_0x4ea549[_0x3d08('0x2f')]=_[_0x3d08('0x30')](_0x55196b[_0x3d08('0x2f')]);_0x4ea549['filters']=_[_0x3d08('0x32')](_0x4ea549[_0x3d08('0x2e')],_0x4ea549['query']);_0x495517[_0x3d08('0x33')]=_[_0x3d08('0x32')](_0x4ea549[_0x3d08('0x2e')],qs['fields'](_0x55196b[_0x3d08('0x2f')][_0x3d08('0x34')]));_0x495517[_0x3d08('0x33')]=_0x495517['attributes'][_0x3d08('0x35')]?_0x495517['attributes']:_0x4ea549['model'];_0x495517[_0x3d08('0x38')]=qs[_0x3d08('0x39')](_0x55196b[_0x3d08('0x2f')][_0x3d08('0x39')]);_0x495517[_0x3d08('0x3a')]=qs['filters'](_['pick'](_0x55196b[_0x3d08('0x2f')],_0x4ea549[_0x3d08('0x31')]));if(_0x55196b[_0x3d08('0x2f')][_0x3d08('0x3b')]){_0x495517[_0x3d08('0x3a')]=_[_0x3d08('0x3c')](_0x495517[_0x3d08('0x3a')],{'$or':_[_0x3d08('0x29')](_0x495517[_0x3d08('0x33')],function(_0x4a0ced){var _0x1b7f75={};_0x1b7f75[_0x4a0ced]={'$like':'%'+_0x55196b['query'][_0x3d08('0x3b')]+'%'};return _0x1b7f75;})});}_0x495517=_[_0x3d08('0x3c')]({},_0x495517,_0x55196b['options']);return _0x255538[_0x3d08('0x54')](_0x495517);}})[_0x3d08('0x21')](function(_0x52f869){if(_0x52f869){_0x3ff8d9=_0x52f869[_0x3d08('0x35')];if(!_0x55196b[_0x3d08('0x2f')][_0x3d08('0x36')](_0x3d08('0x56'))){_0x495517['limit']=qs['limit'](_0x55196b['query'][_0x3d08('0x1b')]);_0x495517[_0x3d08('0x37')]=qs['offset'](_0x55196b[_0x3d08('0x2f')][_0x3d08('0x37')]);}return _0x255538[_0x3d08('0x54')](_0x495517);}})[_0x3d08('0x21')](function(_0x35bf44){if(_0x35bf44){return _0x35bf44?{'count':_0x3ff8d9,'rows':_0x35bf44}:null;}})[_0x3d08('0x21')](respondWithResult(_0x378659,null))['catch'](handleError(_0x378659,null));};exports[_0x3d08('0x57')]=function(_0x38f4a2,_0x574cfe,_0x3eea86){var _0x4e1533={};var _0x52186d={};var _0x5c49db;var _0x37dea2;return db[_0x3d08('0x3f')][_0x3d08('0x55')]({'where':{'id':_0x38f4a2[_0x3d08('0x45')]['id']}})[_0x3d08('0x21')](handleEntityNotFound(_0x574cfe,null))['then'](function(_0x15a3f3){if(_0x15a3f3){_0x5c49db=_0x15a3f3;_0x52186d[_0x3d08('0x2e')]=_[_0x3d08('0x30')](db[_0x3d08('0x53')]['rawAttributes']);_0x52186d[_0x3d08('0x2f')]=_['keys'](_0x38f4a2[_0x3d08('0x2f')]);_0x52186d[_0x3d08('0x31')]=_[_0x3d08('0x32')](_0x52186d[_0x3d08('0x2e')],_0x52186d[_0x3d08('0x2f')]);_0x4e1533[_0x3d08('0x33')]=_[_0x3d08('0x32')](_0x52186d[_0x3d08('0x2e')],qs[_0x3d08('0x34')](_0x38f4a2[_0x3d08('0x2f')]['fields']));_0x4e1533[_0x3d08('0x33')]=_0x4e1533[_0x3d08('0x33')]['length']?_0x4e1533[_0x3d08('0x33')]:_0x52186d['model'];_0x4e1533['order']=qs[_0x3d08('0x39')](_0x38f4a2[_0x3d08('0x2f')][_0x3d08('0x39')]);_0x4e1533[_0x3d08('0x3a')]=qs['filters'](_['pick'](_0x38f4a2['query'],_0x52186d[_0x3d08('0x31')]));if(_0x38f4a2[_0x3d08('0x2f')][_0x3d08('0x3b')]){_0x4e1533['where']=_[_0x3d08('0x3c')](_0x4e1533[_0x3d08('0x3a')],{'$or':_[_0x3d08('0x29')](_0x4e1533[_0x3d08('0x33')],function(_0x48cd45){var _0xc7ffd7={};_0xc7ffd7[_0x48cd45]={'$like':'%'+_0x38f4a2[_0x3d08('0x2f')][_0x3d08('0x3b')]+'%'};return _0xc7ffd7;})});}_0x4e1533=_[_0x3d08('0x3c')]({},_0x4e1533,_0x38f4a2[_0x3d08('0x3e')]);return _0x5c49db[_0x3d08('0x57')](_0x4e1533);}})[_0x3d08('0x21')](function(_0x5d6598){if(_0x5d6598){_0x37dea2=_0x5d6598[_0x3d08('0x35')];if(!_0x38f4a2['query']['hasOwnProperty'](_0x3d08('0x56'))){_0x4e1533[_0x3d08('0x1b')]=qs['limit'](_0x38f4a2[_0x3d08('0x2f')][_0x3d08('0x1b')]);_0x4e1533[_0x3d08('0x37')]=qs[_0x3d08('0x37')](_0x38f4a2[_0x3d08('0x2f')][_0x3d08('0x37')]);}return _0x5c49db[_0x3d08('0x57')](_0x4e1533);}})[_0x3d08('0x21')](function(_0x2c371c){if(_0x2c371c){return _0x2c371c?{'count':_0x37dea2,'rows':_0x2c371c}:null;}})[_0x3d08('0x21')](respondWithResult(_0x574cfe,null))[_0x3d08('0x46')](handleError(_0x574cfe,null));};exports['addAction']=function(_0x434749,_0x20a171,_0x441abd){if(_0x434749[_0x3d08('0x48')]['id']){delete _0x434749[_0x3d08('0x48')]['id'];}return db[_0x3d08('0x3f')]['find']({'where':{'id':_0x434749[_0x3d08('0x45')]['id']}})[_0x3d08('0x21')](handleEntityNotFound(_0x20a171,null))['then'](function(_0x40159b){if(_0x40159b){_0x434749[_0x3d08('0x48')]['TriggerId']=_0x40159b['id'];return db[_0x3d08('0x58')][_0x3d08('0x47')](_0x434749['body']);}})[_0x3d08('0x21')](respondWithResult(_0x20a171,null))[_0x3d08('0x46')](handleError(_0x20a171,null));};exports[_0x3d08('0x59')]=function(_0x33b5c9,_0x3ca474,_0x38f3c4){var _0x40edda={};var _0x31a9ce={};var _0x327253;var _0x45c6cd;return db[_0x3d08('0x3f')][_0x3d08('0x55')]({'where':{'id':_0x33b5c9[_0x3d08('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ca474,null))[_0x3d08('0x21')](function(_0x4b22ef){if(_0x4b22ef){_0x327253=_0x4b22ef;_0x31a9ce[_0x3d08('0x2e')]=_[_0x3d08('0x30')](db['Action'][_0x3d08('0x2a')]);_0x31a9ce[_0x3d08('0x2f')]=_[_0x3d08('0x30')](_0x33b5c9[_0x3d08('0x2f')]);_0x31a9ce[_0x3d08('0x31')]=_[_0x3d08('0x32')](_0x31a9ce['model'],_0x31a9ce[_0x3d08('0x2f')]);_0x40edda[_0x3d08('0x33')]=_['intersection'](_0x31a9ce[_0x3d08('0x2e')],qs[_0x3d08('0x34')](_0x33b5c9[_0x3d08('0x2f')][_0x3d08('0x34')]));_0x40edda['attributes']=_0x40edda[_0x3d08('0x33')][_0x3d08('0x35')]?_0x40edda[_0x3d08('0x33')]:_0x31a9ce[_0x3d08('0x2e')];_0x40edda['order']=qs['sort'](_0x33b5c9[_0x3d08('0x2f')][_0x3d08('0x39')]);_0x40edda[_0x3d08('0x3a')]=qs[_0x3d08('0x31')](_[_0x3d08('0x5a')](_0x33b5c9[_0x3d08('0x2f')],_0x31a9ce['filters']));if(_0x33b5c9[_0x3d08('0x2f')][_0x3d08('0x3b')]){_0x40edda[_0x3d08('0x3a')]=_[_0x3d08('0x3c')](_0x40edda['where'],{'$or':_['map'](_0x40edda['attributes'],function(_0x45a7a3){var _0x36f544={};_0x36f544[_0x45a7a3]={'$like':'%'+_0x33b5c9[_0x3d08('0x2f')]['filter']+'%'};return _0x36f544;})});}_0x40edda=_[_0x3d08('0x3c')]({},_0x40edda,_0x33b5c9[_0x3d08('0x3e')]);return _0x327253[_0x3d08('0x59')](_0x40edda);}})[_0x3d08('0x21')](function(_0xf30dcb){if(_0xf30dcb){_0x45c6cd=_0xf30dcb['length'];if(!_0x33b5c9[_0x3d08('0x2f')]['hasOwnProperty']('nolimit')){_0x40edda['limit']=qs['limit'](_0x33b5c9[_0x3d08('0x2f')][_0x3d08('0x1b')]);_0x40edda['offset']=qs[_0x3d08('0x37')](_0x33b5c9[_0x3d08('0x2f')][_0x3d08('0x37')]);}return _0x327253[_0x3d08('0x59')](_0x40edda);}})[_0x3d08('0x21')](function(_0x2500d9){if(_0x2500d9){return _0x2500d9?{'count':_0x45c6cd,'rows':_0x2500d9}:null;}})[_0x3d08('0x21')](respondWithResult(_0x3ca474,null))[_0x3d08('0x46')](handleError(_0x3ca474,null));}; \ No newline at end of file +var _0x251a=['includeAll','include','findAll','rows','catch','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAnyId','getAllConditions','findOne','Condition','hasOwnProperty','getAnyConditions','addAction','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','end','error','stack','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trigger'];(function(_0x1829c6,_0x4d98fd){var _0x19a7a0=function(_0x1292d5){while(--_0x1292d5){_0x1829c6['push'](_0x1829c6['shift']());}};_0x19a7a0(++_0x4d98fd);}(_0x251a,0x188));var _0xa251=function(_0x3a7e42,_0x58e47d){_0x3a7e42=_0x3a7e42-0x0;var _0x7122b7=_0x251a[_0x3a7e42];return _0x7122b7;};'use strict';var emlformat=require(_0xa251('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa251('0x1'));var jsonpatch=require(_0xa251('0x2'));var rp=require(_0xa251('0x3'));var moment=require(_0xa251('0x4'));var BPromise=require(_0xa251('0x5'));var Mustache=require(_0xa251('0x6'));var util=require(_0xa251('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa251('0x8'));var fs=require('fs');var fs_extra=require(_0xa251('0x9'));var _=require(_0xa251('0xa'));var squel=require(_0xa251('0xb'));var crypto=require('crypto');var jsforce=require(_0xa251('0xc'));var deskjs=require(_0xa251('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa251('0xe'));var Redis=require(_0xa251('0xf'));var authService=require(_0xa251('0x10'));var qs=require(_0xa251('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa251('0x12'));var logger=require(_0xa251('0x13'))('api');var utils=require(_0xa251('0x14'));var config=require(_0xa251('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa251('0x16'))['db'];function respondWithStatusCode(_0x4a20ff,_0x2d8982){_0x2d8982=_0x2d8982||0xcc;return function(_0x5eb904){if(_0x5eb904){return _0x4a20ff[_0xa251('0x17')](_0x2d8982);}return _0x4a20ff[_0xa251('0x18')](_0x2d8982)['end']();};}function respondWithResult(_0x4e8e0d,_0x3c2b90){_0x3c2b90=_0x3c2b90||0xc8;return function(_0x34b5ef){if(_0x34b5ef){return _0x4e8e0d[_0xa251('0x18')](_0x3c2b90)[_0xa251('0x19')](_0x34b5ef);}};}function respondWithFilteredResult(_0x162348,_0x1a980c){return function(_0x2fe74a){if(_0x2fe74a){var _0x2413d1=typeof _0x1a980c['offset']===_0xa251('0x1a')&&typeof _0x1a980c[_0xa251('0x1b')]===_0xa251('0x1a');var _0x2eba52=_0x2fe74a['count'];var _0x44f6a4=_0x2413d1?0x0:_0x1a980c[_0xa251('0x1c')];var _0xbfa87a=_0x2413d1?_0x2fe74a[_0xa251('0x1d')]:_0x1a980c[_0xa251('0x1c')]+_0x1a980c[_0xa251('0x1b')];var _0x25185e;if(_0xbfa87a>=_0x2eba52){_0xbfa87a=_0x2eba52;_0x25185e=0xc8;}else{_0x25185e=0xce;}_0x162348[_0xa251('0x18')](_0x25185e);return _0x162348[_0xa251('0x1e')](_0xa251('0x1f'),_0x44f6a4+'-'+_0xbfa87a+'/'+_0x2eba52)[_0xa251('0x19')](_0x2fe74a);}return null;};}function patchUpdates(_0x313b04){return function(_0x13107e){try{jsonpatch[_0xa251('0x20')](_0x13107e,_0x313b04,!![]);}catch(_0x5059ce){return BPromise[_0xa251('0x21')](_0x5059ce);}return _0x13107e[_0xa251('0x22')]();};}function saveUpdates(_0x5f2f75,_0x38c764){return function(_0xf96b43){if(_0xf96b43){return _0xf96b43[_0xa251('0x23')](_0x5f2f75)[_0xa251('0x24')](function(_0x2838d9){return _0x2838d9;});}return null;};}function removeEntity(_0x3466f8,_0x24148c){return function(_0x5239a2){if(_0x5239a2){return _0x5239a2[_0xa251('0x25')]()[_0xa251('0x24')](function(){var _0x43d6fc=_0x5239a2[_0xa251('0x26')]({'plain':!![]});var _0x45cc5a=_0xa251('0x27');return db['UserProfileResource'][_0xa251('0x25')]({'where':{'type':_0x45cc5a,'resourceId':_0x43d6fc['id']}})[_0xa251('0x24')](function(){return _0x5239a2;});})[_0xa251('0x24')](function(){_0x3466f8[_0xa251('0x18')](0xcc)[_0xa251('0x28')]();});}};}function handleEntityNotFound(_0xaf879,_0x3fa5b1){return function(_0x245d08){if(!_0x245d08){_0xaf879['sendStatus'](0x194);}return _0x245d08;};}function handleError(_0x578c1f,_0x4a0f7c){_0x4a0f7c=_0x4a0f7c||0x1f4;return function(_0x83f1fb){logger[_0xa251('0x29')](_0x83f1fb[_0xa251('0x2a')]);if(_0x83f1fb[_0xa251('0x2b')]){delete _0x83f1fb[_0xa251('0x2b')];}_0x578c1f[_0xa251('0x18')](_0x4a0f7c)[_0xa251('0x2c')](_0x83f1fb);};}exports[_0xa251('0x2d')]=function(_0x1dc5dc,_0x2fa03b){var _0x14b011={},_0x5826d4={},_0x57832d={'count':0x0,'rows':[]};var _0x3dc48b=_[_0xa251('0x2e')](db['Trigger'][_0xa251('0x2f')],function(_0x187091){return{'name':_0x187091['fieldName'],'type':_0x187091['type'][_0xa251('0x30')]};});_0x5826d4[_0xa251('0x31')]=_['map'](_0x3dc48b,_0xa251('0x2b'));_0x5826d4['query']=_[_0xa251('0x32')](_0x1dc5dc['query']);_0x5826d4[_0xa251('0x33')]=_[_0xa251('0x34')](_0x5826d4['model'],_0x5826d4[_0xa251('0x35')]);_0x14b011[_0xa251('0x36')]=_[_0xa251('0x34')](_0x5826d4['model'],qs[_0xa251('0x37')](_0x1dc5dc[_0xa251('0x35')][_0xa251('0x37')]));_0x14b011[_0xa251('0x36')]=_0x14b011[_0xa251('0x36')][_0xa251('0x38')]?_0x14b011[_0xa251('0x36')]:_0x5826d4[_0xa251('0x31')];if(!_0x1dc5dc[_0xa251('0x35')]['hasOwnProperty'](_0xa251('0x39'))){_0x14b011['limit']=qs[_0xa251('0x1b')](_0x1dc5dc['query'][_0xa251('0x1b')]);_0x14b011[_0xa251('0x1c')]=qs[_0xa251('0x1c')](_0x1dc5dc[_0xa251('0x35')][_0xa251('0x1c')]);}_0x14b011[_0xa251('0x3a')]=qs[_0xa251('0x3b')](_0x1dc5dc[_0xa251('0x35')][_0xa251('0x3b')]);_0x14b011[_0xa251('0x3c')]=qs['filters'](_[_0xa251('0x3d')](_0x1dc5dc[_0xa251('0x35')],_0x5826d4[_0xa251('0x33')]),_0x3dc48b);if(_0x1dc5dc['query'][_0xa251('0x3e')]){_0x14b011[_0xa251('0x3c')]=_[_0xa251('0x3f')](_0x14b011[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x3dc48b,function(_0x5826cc){if(_0x5826cc[_0xa251('0x40')]!==_0xa251('0x41')){var _0x4a61ce={};_0x4a61ce[_0x5826cc[_0xa251('0x2b')]]={'$like':'%'+_0x1dc5dc[_0xa251('0x35')][_0xa251('0x3e')]+'%'};return _0x4a61ce;}})});}_0x14b011=_[_0xa251('0x3f')]({},_0x14b011,_0x1dc5dc[_0xa251('0x42')]);var _0x2bd0ae={'where':_0x14b011[_0xa251('0x3c')]};return db[_0xa251('0x43')]['count'](_0x2bd0ae)[_0xa251('0x24')](function(_0x4ee614){_0x57832d['count']=_0x4ee614;if(_0x1dc5dc['query'][_0xa251('0x44')]){_0x14b011[_0xa251('0x45')]=[{'all':!![]}];}return db['Trigger'][_0xa251('0x46')](_0x14b011);})['then'](function(_0x2c2a36){_0x57832d[_0xa251('0x47')]=_0x2c2a36;return _0x57832d;})[_0xa251('0x24')](respondWithFilteredResult(_0x2fa03b,_0x14b011))[_0xa251('0x48')](handleError(_0x2fa03b,null));};exports['show']=function(_0x228c04,_0x90c202){var _0xc000a4={'raw':![],'where':{'id':_0x228c04[_0xa251('0x49')]['id']}},_0x5729ba={};_0x5729ba['model']=_[_0xa251('0x32')](db[_0xa251('0x43')][_0xa251('0x2f')]);_0x5729ba['query']=_[_0xa251('0x32')](_0x228c04[_0xa251('0x35')]);_0x5729ba['filters']=_[_0xa251('0x34')](_0x5729ba['model'],_0x5729ba[_0xa251('0x35')]);_0xc000a4['attributes']=_[_0xa251('0x34')](_0x5729ba[_0xa251('0x31')],qs[_0xa251('0x37')](_0x228c04[_0xa251('0x35')]['fields']));_0xc000a4[_0xa251('0x36')]=_0xc000a4[_0xa251('0x36')][_0xa251('0x38')]?_0xc000a4['attributes']:_0x5729ba[_0xa251('0x31')];if(_0x228c04[_0xa251('0x35')][_0xa251('0x44')]){_0xc000a4['include']=[{'all':!![]}];}_0xc000a4=_[_0xa251('0x3f')]({},_0xc000a4,_0x228c04[_0xa251('0x42')]);return db[_0xa251('0x43')]['find'](_0xc000a4)[_0xa251('0x24')](handleEntityNotFound(_0x90c202,null))[_0xa251('0x24')](respondWithResult(_0x90c202,null))[_0xa251('0x48')](handleError(_0x90c202,null));};exports[_0xa251('0x4a')]=function(_0x408b24,_0x4b2036){return db[_0xa251('0x43')][_0xa251('0x4a')](_0x408b24[_0xa251('0x4b')],{})[_0xa251('0x24')](function(_0x4ee7b8){var _0x3e4861=_0x408b24[_0xa251('0x4c')][_0xa251('0x26')]({'plain':!![]});if(!_0x3e4861)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e4861[_0xa251('0x4d')]===_0xa251('0x4c')){var _0xd5736f=_0x4ee7b8[_0xa251('0x26')]({'plain':!![]});var _0xecb024='Triggers';return db[_0xa251('0x4e')][_0xa251('0x4f')]({'where':{'name':_0xecb024,'userProfileId':_0x3e4861[_0xa251('0x50')]},'raw':!![]})[_0xa251('0x24')](function(_0x3de489){if(_0x3de489&&_0x3de489[_0xa251('0x51')]===0x0){return db[_0xa251('0x52')]['create']({'name':_0xd5736f[_0xa251('0x2b')],'resourceId':_0xd5736f['id'],'type':_0x3de489[_0xa251('0x2b')],'sectionId':_0x3de489['id']},{})['then'](function(){return _0x4ee7b8;});}else{return _0x4ee7b8;}})[_0xa251('0x48')](function(_0x2bf1cf){logger['error'](_0xa251('0x53'),_0x2bf1cf);throw _0x2bf1cf;});}return _0x4ee7b8;})['then'](respondWithResult(_0x4b2036,0xc9))[_0xa251('0x48')](handleError(_0x4b2036,null));};exports[_0xa251('0x23')]=function(_0x27b677,_0x568de7){if(_0x27b677[_0xa251('0x4b')]['id']){delete _0x27b677[_0xa251('0x4b')]['id'];}return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x27b677[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x568de7,null))[_0xa251('0x24')](saveUpdates(_0x27b677[_0xa251('0x4b')],null))[_0xa251('0x24')](respondWithResult(_0x568de7,null))[_0xa251('0x48')](handleError(_0x568de7,null));};exports[_0xa251('0x25')]=function(_0x1373f7,_0x510376){return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x1373f7[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x510376,null))[_0xa251('0x24')](removeEntity(_0x510376,null))[_0xa251('0x48')](handleError(_0x510376,null));};exports['addAllCondition']=function(_0x331880,_0x39474e,_0x1fa777){if(_0x331880[_0xa251('0x4b')]['id']){delete _0x331880['body']['id'];}return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x331880[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x39474e,null))[_0xa251('0x24')](function(_0x150a76){if(_0x150a76){_0x331880[_0xa251('0x4b')]['TriggerAllId']=_0x150a76['id'];return db['Condition'][_0xa251('0x4a')](_0x331880['body']);}})[_0xa251('0x24')](respondWithResult(_0x39474e,null))[_0xa251('0x48')](handleError(_0x39474e,null));};exports['addAnyCondition']=function(_0xcd5923,_0xa9f067,_0x499e8b){if(_0xcd5923[_0xa251('0x4b')]['id']){delete _0xcd5923['body']['id'];}return db['Trigger']['find']({'where':{'id':_0xcd5923[_0xa251('0x49')]['id']}})['then'](handleEntityNotFound(_0xa9f067,null))[_0xa251('0x24')](function(_0x495841){if(_0x495841){_0xcd5923[_0xa251('0x4b')][_0xa251('0x54')]=_0x495841['id'];return db['Condition']['create'](_0xcd5923[_0xa251('0x4b')]);}})[_0xa251('0x24')](respondWithResult(_0xa9f067,null))[_0xa251('0x48')](handleError(_0xa9f067,null));};exports[_0xa251('0x55')]=function(_0x5ae67c,_0x45f824,_0x56482f){var _0x47f7fb={};var _0x2558e6={};var _0x5a6c3b;var _0x98ca3e;return db[_0xa251('0x43')][_0xa251('0x56')]({'where':{'id':_0x5ae67c[_0xa251('0x49')]['id']}})['then'](handleEntityNotFound(_0x45f824,null))[_0xa251('0x24')](function(_0x368364){if(_0x368364){_0x5a6c3b=_0x368364;_0x2558e6['model']=_[_0xa251('0x32')](db[_0xa251('0x57')][_0xa251('0x2f')]);_0x2558e6['query']=_['keys'](_0x5ae67c['query']);_0x2558e6[_0xa251('0x33')]=_['intersection'](_0x2558e6[_0xa251('0x31')],_0x2558e6['query']);_0x47f7fb['attributes']=_[_0xa251('0x34')](_0x2558e6[_0xa251('0x31')],qs[_0xa251('0x37')](_0x5ae67c[_0xa251('0x35')][_0xa251('0x37')]));_0x47f7fb[_0xa251('0x36')]=_0x47f7fb[_0xa251('0x36')][_0xa251('0x38')]?_0x47f7fb[_0xa251('0x36')]:_0x2558e6[_0xa251('0x31')];_0x47f7fb[_0xa251('0x3a')]=qs[_0xa251('0x3b')](_0x5ae67c['query'][_0xa251('0x3b')]);_0x47f7fb[_0xa251('0x3c')]=qs[_0xa251('0x33')](_['pick'](_0x5ae67c[_0xa251('0x35')],_0x2558e6[_0xa251('0x33')]));if(_0x5ae67c['query'][_0xa251('0x3e')]){_0x47f7fb['where']=_[_0xa251('0x3f')](_0x47f7fb[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x47f7fb['attributes'],function(_0x1d03bf){var _0x3d098a={};_0x3d098a[_0x1d03bf]={'$like':'%'+_0x5ae67c[_0xa251('0x35')][_0xa251('0x3e')]+'%'};return _0x3d098a;})});}_0x47f7fb=_[_0xa251('0x3f')]({},_0x47f7fb,_0x5ae67c['options']);return _0x5a6c3b['getAllConditions'](_0x47f7fb);}})['then'](function(_0x2ba8c8){if(_0x2ba8c8){_0x98ca3e=_0x2ba8c8[_0xa251('0x38')];if(!_0x5ae67c[_0xa251('0x35')][_0xa251('0x58')](_0xa251('0x39'))){_0x47f7fb[_0xa251('0x1b')]=qs[_0xa251('0x1b')](_0x5ae67c[_0xa251('0x35')][_0xa251('0x1b')]);_0x47f7fb[_0xa251('0x1c')]=qs['offset'](_0x5ae67c[_0xa251('0x35')][_0xa251('0x1c')]);}return _0x5a6c3b[_0xa251('0x55')](_0x47f7fb);}})[_0xa251('0x24')](function(_0x30b2af){if(_0x30b2af){return _0x30b2af?{'count':_0x98ca3e,'rows':_0x30b2af}:null;}})['then'](respondWithResult(_0x45f824,null))[_0xa251('0x48')](handleError(_0x45f824,null));};exports[_0xa251('0x59')]=function(_0x4fa580,_0x29a6ef,_0x1ed114){var _0x464d26={};var _0x4e4a20={};var _0x42fc9f;var _0x29d801;return db[_0xa251('0x43')][_0xa251('0x56')]({'where':{'id':_0x4fa580['params']['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x29a6ef,null))[_0xa251('0x24')](function(_0xca84b){if(_0xca84b){_0x42fc9f=_0xca84b;_0x4e4a20['model']=_[_0xa251('0x32')](db[_0xa251('0x57')][_0xa251('0x2f')]);_0x4e4a20[_0xa251('0x35')]=_[_0xa251('0x32')](_0x4fa580['query']);_0x4e4a20[_0xa251('0x33')]=_[_0xa251('0x34')](_0x4e4a20['model'],_0x4e4a20['query']);_0x464d26[_0xa251('0x36')]=_['intersection'](_0x4e4a20['model'],qs[_0xa251('0x37')](_0x4fa580['query'][_0xa251('0x37')]));_0x464d26[_0xa251('0x36')]=_0x464d26[_0xa251('0x36')]['length']?_0x464d26[_0xa251('0x36')]:_0x4e4a20[_0xa251('0x31')];_0x464d26[_0xa251('0x3a')]=qs['sort'](_0x4fa580['query'][_0xa251('0x3b')]);_0x464d26[_0xa251('0x3c')]=qs[_0xa251('0x33')](_[_0xa251('0x3d')](_0x4fa580[_0xa251('0x35')],_0x4e4a20[_0xa251('0x33')]));if(_0x4fa580[_0xa251('0x35')][_0xa251('0x3e')]){_0x464d26['where']=_[_0xa251('0x3f')](_0x464d26[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x464d26[_0xa251('0x36')],function(_0x590591){var _0x353192={};_0x353192[_0x590591]={'$like':'%'+_0x4fa580[_0xa251('0x35')][_0xa251('0x3e')]+'%'};return _0x353192;})});}_0x464d26=_['merge']({},_0x464d26,_0x4fa580[_0xa251('0x42')]);return _0x42fc9f[_0xa251('0x59')](_0x464d26);}})[_0xa251('0x24')](function(_0x506851){if(_0x506851){_0x29d801=_0x506851['length'];if(!_0x4fa580[_0xa251('0x35')][_0xa251('0x58')]('nolimit')){_0x464d26['limit']=qs[_0xa251('0x1b')](_0x4fa580[_0xa251('0x35')][_0xa251('0x1b')]);_0x464d26[_0xa251('0x1c')]=qs['offset'](_0x4fa580[_0xa251('0x35')][_0xa251('0x1c')]);}return _0x42fc9f[_0xa251('0x59')](_0x464d26);}})['then'](function(_0xf9f99){if(_0xf9f99){return _0xf9f99?{'count':_0x29d801,'rows':_0xf9f99}:null;}})[_0xa251('0x24')](respondWithResult(_0x29a6ef,null))[_0xa251('0x48')](handleError(_0x29a6ef,null));};exports[_0xa251('0x5a')]=function(_0x10cd88,_0x16ad7d,_0x401d78){if(_0x10cd88[_0xa251('0x4b')]['id']){delete _0x10cd88['body']['id'];}return db[_0xa251('0x43')][_0xa251('0x4f')]({'where':{'id':_0x10cd88[_0xa251('0x49')]['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x16ad7d,null))[_0xa251('0x24')](function(_0x9486dd){if(_0x9486dd){_0x10cd88[_0xa251('0x4b')]['TriggerId']=_0x9486dd['id'];return db['Action'][_0xa251('0x4a')](_0x10cd88[_0xa251('0x4b')]);}})[_0xa251('0x24')](respondWithResult(_0x16ad7d,null))[_0xa251('0x48')](handleError(_0x16ad7d,null));};exports['getActions']=function(_0x57a523,_0x505195,_0x24780d){var _0x3f576a={};var _0x14e9d5={};var _0x328848;var _0x427501;return db[_0xa251('0x43')][_0xa251('0x56')]({'where':{'id':_0x57a523['params']['id']}})[_0xa251('0x24')](handleEntityNotFound(_0x505195,null))[_0xa251('0x24')](function(_0x4c2835){if(_0x4c2835){_0x328848=_0x4c2835;_0x14e9d5[_0xa251('0x31')]=_[_0xa251('0x32')](db['Action'][_0xa251('0x2f')]);_0x14e9d5[_0xa251('0x35')]=_[_0xa251('0x32')](_0x57a523[_0xa251('0x35')]);_0x14e9d5['filters']=_[_0xa251('0x34')](_0x14e9d5[_0xa251('0x31')],_0x14e9d5[_0xa251('0x35')]);_0x3f576a[_0xa251('0x36')]=_[_0xa251('0x34')](_0x14e9d5[_0xa251('0x31')],qs[_0xa251('0x37')](_0x57a523[_0xa251('0x35')][_0xa251('0x37')]));_0x3f576a[_0xa251('0x36')]=_0x3f576a[_0xa251('0x36')][_0xa251('0x38')]?_0x3f576a[_0xa251('0x36')]:_0x14e9d5['model'];_0x3f576a['order']=qs[_0xa251('0x3b')](_0x57a523['query']['sort']);_0x3f576a[_0xa251('0x3c')]=qs[_0xa251('0x33')](_[_0xa251('0x3d')](_0x57a523['query'],_0x14e9d5['filters']));if(_0x57a523[_0xa251('0x35')][_0xa251('0x3e')]){_0x3f576a[_0xa251('0x3c')]=_[_0xa251('0x3f')](_0x3f576a[_0xa251('0x3c')],{'$or':_[_0xa251('0x2e')](_0x3f576a[_0xa251('0x36')],function(_0xe64b78){var _0x54fd1c={};_0x54fd1c[_0xe64b78]={'$like':'%'+_0x57a523[_0xa251('0x35')]['filter']+'%'};return _0x54fd1c;})});}_0x3f576a=_[_0xa251('0x3f')]({},_0x3f576a,_0x57a523['options']);return _0x328848[_0xa251('0x5b')](_0x3f576a);}})[_0xa251('0x24')](function(_0x4666bc){if(_0x4666bc){_0x427501=_0x4666bc[_0xa251('0x38')];if(!_0x57a523[_0xa251('0x35')][_0xa251('0x58')]('nolimit')){_0x3f576a[_0xa251('0x1b')]=qs['limit'](_0x57a523[_0xa251('0x35')][_0xa251('0x1b')]);_0x3f576a[_0xa251('0x1c')]=qs['offset'](_0x57a523[_0xa251('0x35')][_0xa251('0x1c')]);}return _0x328848[_0xa251('0x5b')](_0x3f576a);}})['then'](function(_0x529c4f){if(_0x529c4f){return _0x529c4f?{'count':_0x427501,'rows':_0x529c4f}:null;}})['then'](respondWithResult(_0x505195,null))[_0xa251('0x48')](handleError(_0x505195,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 05258ab..96f6f8f 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 _0x9221=['tools_triggers','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger'];(function(_0x5b7c76,_0x1e23a9){var _0x392bca=function(_0x891b6f){while(--_0x891b6f){_0x5b7c76['push'](_0x5b7c76['shift']());}};_0x392bca(++_0x1e23a9);}(_0x9221,0x64));var _0x1922=function(_0x4b87a3,_0x3a698c){_0x4b87a3=_0x4b87a3-0x0;var _0x334112=_0x9221[_0x4b87a3];return _0x334112;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var logger=require(_0x1922('0x1'))('api');var moment=require(_0x1922('0x2'));var BPromise=require(_0x1922('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1922('0x4'));var rimraf=require(_0x1922('0x5'));var config=require(_0x1922('0x6'));var attributes=require(_0x1922('0x7'));module[_0x1922('0x8')]=function(_0x1944a5,_0x1351a0){return _0x1944a5['define'](_0x1922('0x9'),attributes,{'tableName':_0x1922('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e69=['tools_triggers','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger'];(function(_0x32e264,_0x41cee8){var _0x1d7175=function(_0x5913d9){while(--_0x5913d9){_0x32e264['push'](_0x32e264['shift']());}};_0x1d7175(++_0x41cee8);}(_0x1e69,0x85));var _0x91e6=function(_0x349ffc,_0x5c270d){_0x349ffc=_0x349ffc-0x0;var _0x17baa8=_0x1e69[_0x349ffc];return _0x17baa8;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var logger=require(_0x91e6('0x1'))(_0x91e6('0x2'));var moment=require(_0x91e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e6('0x4'));var rimraf=require(_0x91e6('0x5'));var config=require(_0x91e6('0x6'));var attributes=require(_0x91e6('0x7'));module[_0x91e6('0x8')]=function(_0x42fe90,_0x4091b8){return _0x42fe90[_0x91e6('0x9')](_0x91e6('0xa'),attributes,{'tableName':_0x91e6('0xb'),'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 577a511..364b38d 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 _0x9259=['then','info','debug','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','options','raw','where','attributes','limit','map','model','include','find','ShowTrigger','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request'];(function(_0x37768b,_0xedcc5a){var _0x1f3c43=function(_0x292056){while(--_0x292056){_0x37768b['push'](_0x37768b['shift']());}};_0x1f3c43(++_0xedcc5a);}(_0x9259,0x137));var _0x9925=function(_0x2d69a4,_0x32935e){_0x2d69a4=_0x2d69a4-0x0;var _0xe0705b=_0x9259[_0x2d69a4];return _0xe0705b;};'use strict';var _=require(_0x9925('0x0'));var util=require(_0x9925('0x1'));var moment=require(_0x9925('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9925('0x3'));var db=require(_0x9925('0x4'))['db'];var utils=require(_0x9925('0x5'));var logger=require('../../config/logger')(_0x9925('0x6'));var config=require(_0x9925('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x187979,_0x3b38cd,_0x436969){return new BPromise(function(_0x4265dd,_0x4f9ddf){return client[_0x9925('0x8')](_0x187979,_0x436969)[_0x9925('0x9')](function(_0x572bc8){logger[_0x9925('0xa')]('Trigger,\x20%s,\x20%s',_0x3b38cd,'request\x20sent');logger[_0x9925('0xb')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3b38cd,_0x9925('0xc'),JSON[_0x9925('0xd')](_0x572bc8));if(_0x572bc8[_0x9925('0xe')]){if(_0x572bc8[_0x9925('0xe')][_0x9925('0xf')]===0x1f4){logger['error'](_0x9925('0x10'),_0x3b38cd,_0x572bc8[_0x9925('0xe')][_0x9925('0x11')]);return _0x4f9ddf(_0x572bc8[_0x9925('0xe')][_0x9925('0x11')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x3b38cd,_0x572bc8[_0x9925('0xe')][_0x9925('0x11')]);return _0x4265dd(_0x572bc8[_0x9925('0xe')]['message']);}else{logger[_0x9925('0xa')](_0x9925('0x10'),_0x3b38cd,_0x9925('0xc'));_0x4265dd(_0x572bc8[_0x9925('0x12')][_0x9925('0x11')]);}})['catch'](function(_0x4ab607){logger[_0x9925('0xe')](_0x9925('0x10'),_0x3b38cd,_0x4ab607);_0x4f9ddf(_0x4ab607);});});}exports[_0x9925('0x13')]=function(_0x4dfc68){var _0x3895bd=this;return new Promise(function(_0x2c61be,_0x5e1380){return db[_0x9925('0x14')]['findAll']({'raw':_0x4dfc68[_0x9925('0x15')]?_0x4dfc68['options'][_0x9925('0x16')]===undefined?!![]:![]:!![],'where':_0x4dfc68[_0x9925('0x15')]?_0x4dfc68['options'][_0x9925('0x17')]||null:null,'attributes':_0x4dfc68['options']?_0x4dfc68[_0x9925('0x15')][_0x9925('0x18')]||null:null,'limit':_0x4dfc68[_0x9925('0x15')]?_0x4dfc68['options'][_0x9925('0x19')]||null:null,'include':_0x4dfc68[_0x9925('0x15')]?_0x4dfc68[_0x9925('0x15')]['include']?_[_0x9925('0x1a')](_0x4dfc68['options']['include'],function(_0x41262d){return{'model':db[_0x41262d[_0x9925('0x1b')]],'as':_0x41262d['as'],'attributes':_0x41262d[_0x9925('0x18')],'include':_0x41262d[_0x9925('0x1c')]?_[_0x9925('0x1a')](_0x41262d['include'],function(_0x58540d){return{'model':db[_0x58540d['model']],'as':_0x58540d['as'],'attributes':_0x58540d['attributes'],'include':_0x58540d[_0x9925('0x1c')]?_[_0x9925('0x1a')](_0x58540d[_0x9925('0x1c')],function(_0x3bc938){return{'model':db[_0x3bc938[_0x9925('0x1b')]],'as':_0x3bc938['as'],'attributes':_0x3bc938['attributes']};}):[]};}):[]};}):[]:[]})[_0x9925('0x9')](function(_0x45940d){logger[_0x9925('0xa')](_0x9925('0x13'),_0x4dfc68);logger['debug'](_0x9925('0x13'),_0x4dfc68,JSON[_0x9925('0xd')](_0x45940d));_0x2c61be(_0x45940d);})['catch'](function(_0x306cb9){logger[_0x9925('0xe')](_0x9925('0x13'),_0x306cb9[_0x9925('0x11')],_0x4dfc68);_0x5e1380(_0x3895bd[_0x9925('0xe')](0x1f4,_0x306cb9['message']));});});};exports['ShowTrigger']=function(_0x3831ec){var _0x2d434a=this;return new Promise(function(_0x3b440f,_0x8cdbe3){return db['Trigger'][_0x9925('0x1d')]({'raw':_0x3831ec[_0x9925('0x15')]?_0x3831ec[_0x9925('0x15')][_0x9925('0x16')]===undefined?!![]:![]:!![],'where':_0x3831ec[_0x9925('0x15')]?_0x3831ec[_0x9925('0x15')][_0x9925('0x17')]||null:null,'attributes':_0x3831ec[_0x9925('0x15')]?_0x3831ec['options']['attributes']||null:null,'include':_0x3831ec[_0x9925('0x15')]?_0x3831ec[_0x9925('0x15')][_0x9925('0x1c')]?_[_0x9925('0x1a')](_0x3831ec['options'][_0x9925('0x1c')],function(_0x765d3c){return{'model':db[_0x765d3c[_0x9925('0x1b')]],'as':_0x765d3c['as'],'attributes':_0x765d3c[_0x9925('0x18')],'include':_0x765d3c[_0x9925('0x1c')]?_[_0x9925('0x1a')](_0x765d3c['include'],function(_0x3981ca){return{'model':db[_0x3981ca[_0x9925('0x1b')]],'as':_0x3981ca['as'],'attributes':_0x3981ca['attributes'],'include':_0x3981ca['include']?_[_0x9925('0x1a')](_0x3981ca[_0x9925('0x1c')],function(_0x26da74){return{'model':db[_0x26da74[_0x9925('0x1b')]],'as':_0x26da74['as'],'attributes':_0x26da74['attributes']};}):[]};}):[]};}):[]:[]})[_0x9925('0x9')](function(_0x59dd9e){logger['info']('ShowTrigger',_0x3831ec);logger[_0x9925('0xb')](_0x9925('0x1e'),_0x3831ec,JSON[_0x9925('0xd')](_0x59dd9e));_0x3b440f(_0x59dd9e);})[_0x9925('0x1f')](function(_0xf8411f){logger[_0x9925('0xe')](_0x9925('0x1e'),_0xf8411f[_0x9925('0x11')],_0x3831ec);_0x8cdbe3(_0x2d434a['error'](0x1f4,_0xf8411f['message']));});});}; \ No newline at end of file +var _0x196b=['limit','include','model','map','debug','GetTrigger','ShowTrigger','find','where','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','findAll','options','raw','attributes'];(function(_0x374f25,_0x55a0d3){var _0x25d3cc=function(_0x547311){while(--_0x547311){_0x374f25['push'](_0x374f25['shift']());}};_0x25d3cc(++_0x55a0d3);}(_0x196b,0x154));var _0xb196=function(_0x45fc52,_0x5d7015){_0x45fc52=_0x45fc52-0x0;var _0x4a2d8f=_0x196b[_0x45fc52];return _0x4a2d8f;};'use strict';var _=require(_0xb196('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb196('0x1'));var rs=require(_0xb196('0x2'));var fs=require('fs');var Redis=require(_0xb196('0x3'));var db=require(_0xb196('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb196('0x5'));var config=require(_0xb196('0x6'));var jayson=require(_0xb196('0x7'));var client=jayson[_0xb196('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ef62,_0x5444c4,_0x446522){return new BPromise(function(_0x4b81ce,_0x2641c1){return client[_0xb196('0x9')](_0x49ef62,_0x446522)['then'](function(_0x4f67e7){logger[_0xb196('0xa')]('Trigger,\x20%s,\x20%s',_0x5444c4,_0xb196('0xb'));logger['debug'](_0xb196('0xc'),_0x5444c4,_0xb196('0xb'),JSON[_0xb196('0xd')](_0x4f67e7));if(_0x4f67e7[_0xb196('0xe')]){if(_0x4f67e7[_0xb196('0xe')]['code']===0x1f4){logger[_0xb196('0xe')](_0xb196('0xf'),_0x5444c4,_0x4f67e7['error'][_0xb196('0x10')]);return _0x2641c1(_0x4f67e7[_0xb196('0xe')][_0xb196('0x10')]);}logger[_0xb196('0xe')](_0xb196('0xf'),_0x5444c4,_0x4f67e7[_0xb196('0xe')][_0xb196('0x10')]);return _0x4b81ce(_0x4f67e7[_0xb196('0xe')]['message']);}else{logger['info'](_0xb196('0xf'),_0x5444c4,_0xb196('0xb'));_0x4b81ce(_0x4f67e7[_0xb196('0x11')][_0xb196('0x10')]);}})[_0xb196('0x12')](function(_0x4aa83d){logger['error'](_0xb196('0xf'),_0x5444c4,_0x4aa83d);_0x2641c1(_0x4aa83d);});});}exports['GetTrigger']=function(_0x52e18f){var _0x5cbf34=this;return new Promise(function(_0x5f2bc1,_0x2e43c7){return db['Trigger'][_0xb196('0x13')]({'raw':_0x52e18f[_0xb196('0x14')]?_0x52e18f['options'][_0xb196('0x15')]===undefined?!![]:![]:!![],'where':_0x52e18f[_0xb196('0x14')]?_0x52e18f[_0xb196('0x14')]['where']||null:null,'attributes':_0x52e18f['options']?_0x52e18f[_0xb196('0x14')][_0xb196('0x16')]||null:null,'limit':_0x52e18f[_0xb196('0x14')]?_0x52e18f[_0xb196('0x14')][_0xb196('0x17')]||null:null,'include':_0x52e18f[_0xb196('0x14')]?_0x52e18f['options']['include']?_['map'](_0x52e18f['options'][_0xb196('0x18')],function(_0x406aca){return{'model':db[_0x406aca[_0xb196('0x19')]],'as':_0x406aca['as'],'attributes':_0x406aca[_0xb196('0x16')],'include':_0x406aca[_0xb196('0x18')]?_['map'](_0x406aca[_0xb196('0x18')],function(_0x2fa9be){return{'model':db[_0x2fa9be['model']],'as':_0x2fa9be['as'],'attributes':_0x2fa9be[_0xb196('0x16')],'include':_0x2fa9be[_0xb196('0x18')]?_[_0xb196('0x1a')](_0x2fa9be[_0xb196('0x18')],function(_0x514d69){return{'model':db[_0x514d69[_0xb196('0x19')]],'as':_0x514d69['as'],'attributes':_0x514d69[_0xb196('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c58b3){logger[_0xb196('0xa')]('GetTrigger',_0x52e18f);logger[_0xb196('0x1b')](_0xb196('0x1c'),_0x52e18f,JSON[_0xb196('0xd')](_0x1c58b3));_0x5f2bc1(_0x1c58b3);})[_0xb196('0x12')](function(_0x5f0ba2){logger[_0xb196('0xe')]('GetTrigger',_0x5f0ba2[_0xb196('0x10')],_0x52e18f);_0x2e43c7(_0x5cbf34[_0xb196('0xe')](0x1f4,_0x5f0ba2[_0xb196('0x10')]));});});};exports[_0xb196('0x1d')]=function(_0x47fd84){var _0x5e63f0=this;return new Promise(function(_0x1c08c9,_0x1c89ae){return db['Trigger'][_0xb196('0x1e')]({'raw':_0x47fd84['options']?_0x47fd84['options'][_0xb196('0x15')]===undefined?!![]:![]:!![],'where':_0x47fd84[_0xb196('0x14')]?_0x47fd84[_0xb196('0x14')][_0xb196('0x1f')]||null:null,'attributes':_0x47fd84['options']?_0x47fd84[_0xb196('0x14')][_0xb196('0x16')]||null:null,'include':_0x47fd84[_0xb196('0x14')]?_0x47fd84[_0xb196('0x14')][_0xb196('0x18')]?_[_0xb196('0x1a')](_0x47fd84[_0xb196('0x14')][_0xb196('0x18')],function(_0x5dd7a6){return{'model':db[_0x5dd7a6['model']],'as':_0x5dd7a6['as'],'attributes':_0x5dd7a6[_0xb196('0x16')],'include':_0x5dd7a6[_0xb196('0x18')]?_[_0xb196('0x1a')](_0x5dd7a6['include'],function(_0x42caa9){return{'model':db[_0x42caa9[_0xb196('0x19')]],'as':_0x42caa9['as'],'attributes':_0x42caa9[_0xb196('0x16')],'include':_0x42caa9['include']?_[_0xb196('0x1a')](_0x42caa9['include'],function(_0x28b27e){return{'model':db[_0x28b27e['model']],'as':_0x28b27e['as'],'attributes':_0x28b27e[_0xb196('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb196('0x20')](function(_0x35c7a2){logger[_0xb196('0xa')]('ShowTrigger',_0x47fd84);logger[_0xb196('0x1b')](_0xb196('0x1d'),_0x47fd84,JSON['stringify'](_0x35c7a2));_0x1c08c9(_0x35c7a2);})[_0xb196('0x12')](function(_0x5eeddd){logger[_0xb196('0xe')](_0xb196('0x1d'),_0x5eeddd[_0xb196('0x10')],_0x47fd84);_0x1c89ae(_0x5e63f0[_0xb196('0xe')](0x1f4,_0x5eeddd[_0xb196('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 179a180..171e76f 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 _0x6627=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports'];(function(_0x4e511d,_0x582685){var _0x4733e8=function(_0x129418){while(--_0x129418){_0x4e511d['push'](_0x4e511d['shift']());}};_0x4733e8(++_0x582685);}(_0x6627,0x126));var _0x7662=function(_0x38d131,_0x458258){_0x38d131=_0x38d131-0x0;var _0x300197=_0x6627[_0x38d131];return _0x300197;};'use strict';var multer=require(_0x7662('0x0'));var util=require('util');var path=require(_0x7662('0x1'));var timeout=require(_0x7662('0x2'));var express=require(_0x7662('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7662('0x4'));var interaction=require(_0x7662('0x5'));var config=require(_0x7662('0x6'));var controller=require(_0x7662('0x7'));router[_0x7662('0x8')]('/',auth[_0x7662('0x9')](),controller['index']);router[_0x7662('0x8')](_0x7662('0xa'),auth[_0x7662('0x9')](),controller[_0x7662('0xb')]);router[_0x7662('0xc')](_0x7662('0xd'),auth[_0x7662('0x9')](),controller[_0x7662('0xe')]);router[_0x7662('0xc')]('/',auth[_0x7662('0x9')](),controller[_0x7662('0xf')]);router[_0x7662('0x10')](_0x7662('0xa'),auth[_0x7662('0x9')](),controller[_0x7662('0x11')]);router[_0x7662('0x12')](_0x7662('0xa'),auth[_0x7662('0x9')](),controller[_0x7662('0x13')]);module[_0x7662('0x14')]=router; \ No newline at end of file +var _0xafac=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','post','/:id/clone','clone','create','/:id','update','delete','multer','util','path','connect-timeout'];(function(_0x661318,_0x2b5cb3){var _0x31b5ba=function(_0x2e366d){while(--_0x2e366d){_0x661318['push'](_0x661318['shift']());}};_0x31b5ba(++_0x2b5cb3);}(_0xafac,0x1d7));var _0xcafa=function(_0x3414fa,_0x30f564){_0x3414fa=_0x3414fa-0x0;var _0x2bd392=_0xafac[_0x3414fa];return _0x2bd392;};'use strict';var multer=require(_0xcafa('0x0'));var util=require(_0xcafa('0x1'));var path=require(_0xcafa('0x2'));var timeout=require(_0xcafa('0x3'));var express=require('express');var router=express[_0xcafa('0x4')]();var fs_extra=require(_0xcafa('0x5'));var auth=require(_0xcafa('0x6'));var interaction=require(_0xcafa('0x7'));var config=require(_0xcafa('0x8'));var controller=require(_0xcafa('0x9'));router[_0xcafa('0xa')]('/',auth[_0xcafa('0xb')](),controller['index']);router[_0xcafa('0xa')]('/:id',auth[_0xcafa('0xb')](),controller['show']);router[_0xcafa('0xc')](_0xcafa('0xd'),auth[_0xcafa('0xb')](),controller[_0xcafa('0xe')]);router[_0xcafa('0xc')]('/',auth[_0xcafa('0xb')](),controller[_0xcafa('0xf')]);router['put'](_0xcafa('0x10'),auth[_0xcafa('0xb')](),controller[_0xcafa('0x11')]);router[_0xcafa('0x12')]('/:id',auth[_0xcafa('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a040d3d..3dd98fb 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 _0x1f32=['insecure','never','INTEGER','always','refuse','uac','uas','fingerprint','certificate','active','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite'];(function(_0x24d0a7,_0x5b7b83){var _0x432ee0=function(_0x4c1678){while(--_0x4c1678){_0x24d0a7['push'](_0x24d0a7['shift']());}};_0x432ee0(++_0x5b7b83);}(_0x1f32,0xa9));var _0x21f3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1f32[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x21f3('0x0'));module[_0x21f3('0x1')]={'name':{'type':Sequelize[_0x21f3('0x2')],'allowNull':![],'unique':_0x21f3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x5'),_0x21f3('0x6'),_0x21f3('0x7')),'allowNull':![],'defaultValue':_0x21f3('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x21f3('0x8')},'callingpres':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x9'),_0x21f3('0xa'),_0x21f3('0xb'),'ALLOWED',_0x21f3('0xc'),_0x21f3('0xd'),_0x21f3('0xe'),_0x21f3('0xf'))},'deny':{'type':Sequelize[_0x21f3('0x2')]},'permit':{'type':Sequelize[_0x21f3('0x2')]},'secret':{'type':Sequelize[_0x21f3('0x2')]},'md5secret':{'type':Sequelize[_0x21f3('0x2')]},'remotesecret':{'type':Sequelize[_0x21f3('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x21f3('0x10'),'set':function(_0x37cbfc){this['setDataValue'](_0x21f3('0x11'),_0x37cbfc?_0x37cbfc[_0x21f3('0x12')](','):null);},'get':function(){return this[_0x21f3('0x13')](_0x21f3('0x11'))?this['getDataValue'](_0x21f3('0x11'))[_0x21f3('0x14')](','):null;},'comment':_0x21f3('0x15')},'dtmfmode':{'type':Sequelize[_0x21f3('0x4')]('rfc2833',_0x21f3('0x16'),_0x21f3('0x17'),_0x21f3('0x18'),_0x21f3('0x19')),'defaultValue':_0x21f3('0x1a')},'directmedia':{'type':Sequelize['ENUM'](_0x21f3('0x1b'),'no',_0x21f3('0x1c'),_0x21f3('0x1d'),_0x21f3('0x1e')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x21f3('0x2')]},'nat':{'type':Sequelize[_0x21f3('0x2')],'defaultValue':_0x21f3('0x1f'),'set':function(_0x528ce1){this[_0x21f3('0x20')]('nat',_0x528ce1?_0x528ce1[_0x21f3('0x12')](','):null);},'get':function(){return this[_0x21f3('0x13')]('nat')?this[_0x21f3('0x13')]('nat')[_0x21f3('0x14')](','):null;},'comment':_0x21f3('0x21')},'callgroup':{'type':Sequelize[_0x21f3('0x2')]},'namedcallgroup':{'type':Sequelize[_0x21f3('0x2')]},'pickupgroup':{'type':Sequelize[_0x21f3('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x21f3('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x21f3('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x21f3('0x2')],'defaultValue':_0x21f3('0x22')},'allow':{'type':Sequelize[_0x21f3('0x2')],'allowNull':![],'defaultValue':_0x21f3('0x23'),'set':function(_0x3fa1a8){this[_0x21f3('0x20')](_0x21f3('0x24'),_0x3fa1a8?_0x3fa1a8[_0x21f3('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x21f3('0x13')](_0x21f3('0x24'))?this[_0x21f3('0x13')](_0x21f3('0x24'))[_0x21f3('0x14')](';'):null;},'comment':_0x21f3('0x25')},'autoframing':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x21f3('0x26'),'set':function(_0xd5fbe8){this['setDataValue'](_0x21f3('0x27'),_0xd5fbe8?_0xd5fbe8['join'](','):null);},'get':function(){return this[_0x21f3('0x13')](_0x21f3('0x27'))?this['getDataValue'](_0x21f3('0x27'))[_0x21f3('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x21f3('0x4')]('yes','no',_0x21f3('0x28'))},'promiscredir':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x21f3('0x29')](0xb)},'setvar':{'type':Sequelize[_0x21f3('0x2')]},'callerid':{'type':Sequelize[_0x21f3('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x21f3('0x2')]},'callcounter':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x21f3('0x29')](0xb)},'allowoverlap':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x21f3('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x21f3('0x1b'),'no',_0x21f3('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x21f3('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x21f3('0x2')]},'session_timers':{'type':Sequelize[_0x21f3('0x4')]('accept',_0x21f3('0x2b'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x21f3('0x29')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x21f3('0x2c'),_0x21f3('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x21f3('0x2')]},'regexten':{'type':Sequelize[_0x21f3('0x2')]},'fromdomain':{'type':Sequelize[_0x21f3('0x2')]},'fromuser':{'type':Sequelize[_0x21f3('0x2')]},'port':{'type':Sequelize[_0x21f3('0x29')](0x5)},'qualify':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x21f3('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x21f3('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x21f3('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x21f3('0x29')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x21f3('0x1b'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x21f3('0x2')]},'timert1':{'type':Sequelize[_0x21f3('0x29')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x21f3('0x29')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x21f3('0x2')]},'contactacl':{'type':Sequelize[_0x21f3('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x21f3('0x2')]},'maxforwards':{'type':Sequelize[_0x21f3('0x29')](0xb)},'encryption':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x21f3('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no',_0x21f3('0x2e'),_0x21f3('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x21f3('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0x21f3('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x21f3('0x2')]},'dtlscapath':{'type':Sequelize[_0x21f3('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x21f3('0x30'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x21f3('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x21f3('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x21f3('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x21f3('0x4')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x21f3('0x2')]},'mohsuggest':{'type':Sequelize[_0x21f3('0x2')]},'parkinglot':{'type':Sequelize[_0x21f3('0x2')]},'description':{'type':Sequelize[_0x21f3('0x2')]},'host':{'type':Sequelize[_0x21f3('0x2')],'defaultValue':_0x21f3('0x31')},'canreinvite':{'type':Sequelize[_0x21f3('0x4')](_0x21f3('0x1b'),'no',_0x21f3('0x1c'),_0x21f3('0x1d'),_0x21f3('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x21f3('0x2')]},'otherFields':{'type':Sequelize[_0x21f3('0x2')]},'active':{'type':Sequelize[_0x21f3('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x6933=['rfc2833','yes','nonat','update','force_rport,comedia','setDataValue','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','uac','uas','pai','fingerprint','passive','dynamic','update,nonat','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','getDataValue','split','info','shortinfo','inband','auto'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6933,0x12c));var _0x3693=function(_0x50f9e5,_0x4f90d6){_0x50f9e5=_0x50f9e5-0x0;var _0x548d6b=_0x6933[_0x50f9e5];return _0x548d6b;};'use strict';var Sequelize=require(_0x3693('0x0'));module[_0x3693('0x1')]={'name':{'type':Sequelize[_0x3693('0x2')],'allowNull':![],'unique':_0x3693('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x5'),_0x3693('0x6'),_0x3693('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x3693('0x2')],'allowNull':![],'defaultValue':_0x3693('0x8')},'callingpres':{'type':Sequelize[_0x3693('0x4')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x3693('0x9'),_0x3693('0xa'),_0x3693('0xb'),_0x3693('0xc'),_0x3693('0xd'),_0x3693('0xe'))},'deny':{'type':Sequelize[_0x3693('0x2')]},'permit':{'type':Sequelize[_0x3693('0x2')]},'secret':{'type':Sequelize[_0x3693('0x2')]},'md5secret':{'type':Sequelize[_0x3693('0x2')]},'remotesecret':{'type':Sequelize[_0x3693('0x2')]},'transport':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'udp','set':function(_0xb27b87){this['setDataValue'](_0x3693('0xf'),_0xb27b87?_0xb27b87['join'](','):null);},'get':function(){return this['getDataValue'](_0x3693('0xf'))?this[_0x3693('0x10')]('transport')[_0x3693('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3693('0x4')]('rfc2833',_0x3693('0x12'),_0x3693('0x13'),_0x3693('0x14'),_0x3693('0x15')),'defaultValue':_0x3693('0x16')},'directmedia':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no',_0x3693('0x18'),_0x3693('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x3693('0x1a'),'set':function(_0xc0fd3a){this[_0x3693('0x1b')]('nat',_0xc0fd3a?_0xc0fd3a[_0x3693('0x1c')](','):null);},'get':function(){return this[_0x3693('0x10')](_0x3693('0x1d'))?this[_0x3693('0x10')](_0x3693('0x1d'))['split'](','):null;},'comment':_0x3693('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x3693('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3693('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x3693('0x2')],'allowNull':![],'defaultValue':_0x3693('0x1f'),'set':function(_0x1f7019){this[_0x3693('0x1b')](_0x3693('0x20'),_0x1f7019?_0x1f7019[_0x3693('0x1c')](';'):_0x3693('0x1f'));},'get':function(){return this[_0x3693('0x10')](_0x3693('0x20'))?this['getDataValue'](_0x3693('0x20'))[_0x3693('0x11')](';'):null;},'comment':_0x3693('0x21')},'autoframing':{'type':Sequelize[_0x3693('0x4')]('yes','no')},'insecure':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'port,invite','set':function(_0x52ce08){this['setDataValue'](_0x3693('0x22'),_0x52ce08?_0x52ce08['join'](','):null);},'get':function(){return this[_0x3693('0x10')](_0x3693('0x22'))?this[_0x3693('0x10')](_0x3693('0x22'))[_0x3693('0x11')](','):null;},'comment':_0x3693('0x23')},'trustrpid':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no',_0x3693('0x24'))},'promiscredir':{'type':Sequelize[_0x3693('0x4')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x3693('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3693('0x2')]},'callerid':{'type':Sequelize[_0x3693('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3693('0x2')]},'callcounter':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':_0x3693('0x17')},'busylevel':{'type':Sequelize[_0x3693('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x3693('0x2')]},'videosupport':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3693('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3693('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x3693('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x3693('0x26'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x3693('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x3693('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x27'),_0x3693('0x28')),'defaultValue':_0x3693('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3693('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3693('0x25')](0x5)},'qualify':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x3693('0x2')]},'defaultuser':{'type':Sequelize[_0x3693('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3693('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3693('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x3693('0x4')]('yes','no',_0x3693('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x3693('0x2')]},'timert1':{'type':Sequelize[_0x3693('0x25')](0xb)},'timerb':{'type':Sequelize[_0x3693('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3693('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x3693('0x2')]},'contactacl':{'type':Sequelize[_0x3693('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x3693('0x2')]},'use_q850_reason':{'type':Sequelize[_0x3693('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'force_avp':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'icesupport':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x3693('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no',_0x3693('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x3693('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x3693('0x2')]},'dtlscipher':{'type':Sequelize[_0x3693('0x2')]},'dtlscafile':{'type':Sequelize[_0x3693('0x2')]},'dtlscapath':{'type':Sequelize[_0x3693('0x2')]},'dtlssetup':{'type':Sequelize[_0x3693('0x4')]('active',_0x3693('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3693('0x2')]},'usereqphone':{'type':Sequelize[_0x3693('0x4')](_0x3693('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3693('0x2')]},'call_limit':{'type':Sequelize[_0x3693('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x3693('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x3693('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x3693('0x2')]},'parkinglot':{'type':Sequelize[_0x3693('0x2')]},'description':{'type':Sequelize[_0x3693('0x2')]},'host':{'type':Sequelize[_0x3693('0x2')],'defaultValue':_0x3693('0x2c')},'canreinvite':{'type':Sequelize[_0x3693('0x4')]('yes','no',_0x3693('0x18'),_0x3693('0x19'),_0x3693('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3693('0x2')]},'otherFields':{'type':Sequelize[_0x3693('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 6490da6..bb8cce8 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 _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x220718,_0x16003c){var _0x517391=function(_0x1e6e0e){while(--_0x1e6e0e){_0x220718['push'](_0x220718['shift']());}};_0x517391(++_0x16003c);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1364eb,_0x1b9906){_0x1364eb=_0x1364eb-0x0;var _0x5db39b=_0xd6d6[_0x1364eb];return _0x5db39b;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file +var _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x35c506,_0x18351c){var _0x4d025c=function(_0x4f8b02){while(--_0x4f8b02){_0x35c506['push'](_0x35c506['shift']());}};_0x4d025c(++_0x18351c);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index c069f6c..1d413d7 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 _0x8c8f=['bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','util','../../config/logger','api'];(function(_0xd612a9,_0x39605c){var _0x32f713=function(_0x7cb6ac){while(--_0x7cb6ac){_0xd612a9['push'](_0xd612a9['shift']());}};_0x32f713(++_0x39605c);}(_0x8c8f,0x75));var _0xf8c8=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x8c8f[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require(_0xf8c8('0x0'));var logger=require(_0xf8c8('0x1'))(_0xf8c8('0x2'));var moment=require('moment');var BPromise=require(_0xf8c8('0x3'));var rp=require(_0xf8c8('0x4'));var fs=require('fs');var path=require(_0xf8c8('0x5'));var rimraf=require(_0xf8c8('0x6'));var config=require(_0xf8c8('0x7'));var attributes=require(_0xf8c8('0x8'));module['exports']=function(_0x23ffbd,_0xe52f82){return _0x23ffbd[_0xf8c8('0x9')](_0xf8c8('0xa'),attributes,{'tableName':_0xf8c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b30=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','Trunk','tools_trunks'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8b30,0x108));var _0x08b3=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x8b30[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x08b3('0x0'));var util=require(_0x08b3('0x1'));var logger=require(_0x08b3('0x2'))(_0x08b3('0x3'));var moment=require(_0x08b3('0x4'));var BPromise=require(_0x08b3('0x5'));var rp=require(_0x08b3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x08b3('0x7'));var attributes=require('./trunk.attributes');module[_0x08b3('0x8')]=function(_0x3824b8,_0x436280){return _0x3824b8[_0x08b3('0x9')](_0x08b3('0xa'),attributes,{'tableName':_0x08b3('0xb'),'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 3aea95a..2122263 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 _0x4e45=['error','code','message','info','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include','model','map','then','debug','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0x4e45,0x144));var _0x54e4=function(_0x1fafd0,_0x15a775){_0x1fafd0=_0x1fafd0-0x0;var _0x2624d0=_0x4e45[_0x1fafd0];return _0x2624d0;};'use strict';var _=require(_0x54e4('0x0'));var util=require(_0x54e4('0x1'));var moment=require(_0x54e4('0x2'));var BPromise=require(_0x54e4('0x3'));var rs=require(_0x54e4('0x4'));var fs=require('fs');var Redis=require(_0x54e4('0x5'));var db=require(_0x54e4('0x6'))['db'];var utils=require(_0x54e4('0x7'));var logger=require(_0x54e4('0x8'))(_0x54e4('0x9'));var config=require(_0x54e4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x54e4('0xb')][_0x54e4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4559a8,_0x3fed84,_0x47e042){return new BPromise(function(_0x1fd77d,_0xbd63c9){return client[_0x54e4('0xd')](_0x4559a8,_0x47e042)['then'](function(_0x434c89){logger['info'](_0x54e4('0xe'),_0x3fed84,_0x54e4('0xf'));logger['debug'](_0x54e4('0x10'),_0x3fed84,_0x54e4('0xf'),JSON[_0x54e4('0x11')](_0x434c89));if(_0x434c89[_0x54e4('0x12')]){if(_0x434c89['error'][_0x54e4('0x13')]===0x1f4){logger[_0x54e4('0x12')](_0x54e4('0xe'),_0x3fed84,_0x434c89[_0x54e4('0x12')]['message']);return _0xbd63c9(_0x434c89[_0x54e4('0x12')][_0x54e4('0x14')]);}logger[_0x54e4('0x12')](_0x54e4('0xe'),_0x3fed84,_0x434c89[_0x54e4('0x12')][_0x54e4('0x14')]);return _0x1fd77d(_0x434c89[_0x54e4('0x12')]['message']);}else{logger[_0x54e4('0x15')](_0x54e4('0xe'),_0x3fed84,_0x54e4('0xf'));_0x1fd77d(_0x434c89[_0x54e4('0x16')][_0x54e4('0x14')]);}})[_0x54e4('0x17')](function(_0x37fb2e){logger[_0x54e4('0x12')](_0x54e4('0xe'),_0x3fed84,_0x37fb2e);_0xbd63c9(_0x37fb2e);});});}exports[_0x54e4('0x18')]=function(_0x2b6fdb){var _0x19e537=this;return new Promise(function(_0x4013c9,_0x48b7b7){return db[_0x54e4('0x19')]['findAll']({'raw':_0x2b6fdb[_0x54e4('0x1a')]?_0x2b6fdb['options'][_0x54e4('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b6fdb[_0x54e4('0x1a')]?_0x2b6fdb[_0x54e4('0x1a')][_0x54e4('0x1c')]||null:null,'attributes':_0x2b6fdb[_0x54e4('0x1a')]?_0x2b6fdb[_0x54e4('0x1a')][_0x54e4('0x1d')]||null:null,'limit':_0x2b6fdb[_0x54e4('0x1a')]?_0x2b6fdb['options'][_0x54e4('0x1e')]||null:null,'include':_0x2b6fdb[_0x54e4('0x1a')]?_0x2b6fdb[_0x54e4('0x1a')][_0x54e4('0x1f')]?_['map'](_0x2b6fdb[_0x54e4('0x1a')][_0x54e4('0x1f')],function(_0x4a0d52){return{'model':db[_0x4a0d52[_0x54e4('0x20')]],'as':_0x4a0d52['as'],'attributes':_0x4a0d52['attributes'],'include':_0x4a0d52[_0x54e4('0x1f')]?_[_0x54e4('0x21')](_0x4a0d52[_0x54e4('0x1f')],function(_0x3f88a7){return{'model':db[_0x3f88a7['model']],'as':_0x3f88a7['as'],'attributes':_0x3f88a7[_0x54e4('0x1d')],'include':_0x3f88a7[_0x54e4('0x1f')]?_[_0x54e4('0x21')](_0x3f88a7[_0x54e4('0x1f')],function(_0x3fc5dc){return{'model':db[_0x3fc5dc[_0x54e4('0x20')]],'as':_0x3fc5dc['as'],'attributes':_0x3fc5dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x54e4('0x22')](function(_0x281b33){logger[_0x54e4('0x15')](_0x54e4('0x18'),_0x2b6fdb);logger[_0x54e4('0x23')]('GetTrunk',_0x2b6fdb,JSON[_0x54e4('0x11')](_0x281b33));_0x4013c9(_0x281b33);})[_0x54e4('0x17')](function(_0x9dafae){logger[_0x54e4('0x12')]('GetTrunk',_0x9dafae[_0x54e4('0x14')],_0x2b6fdb);_0x48b7b7(_0x19e537[_0x54e4('0x12')](0x1f4,_0x9dafae[_0x54e4('0x14')]));});});};exports[_0x54e4('0x24')]=function(_0x161a72){var _0x59a5b7=this;return new Promise(function(_0x309ed6,_0x32c453){return db[_0x54e4('0x19')][_0x54e4('0x25')]({'raw':_0x161a72['options']?_0x161a72[_0x54e4('0x1a')][_0x54e4('0x1b')]===undefined?!![]:![]:!![],'where':_0x161a72['options']?_0x161a72[_0x54e4('0x1a')]['where']||null:null,'attributes':_0x161a72[_0x54e4('0x1a')]?_0x161a72[_0x54e4('0x1a')][_0x54e4('0x1d')]||null:null,'include':_0x161a72[_0x54e4('0x1a')]?_0x161a72[_0x54e4('0x1a')][_0x54e4('0x1f')]?_['map'](_0x161a72[_0x54e4('0x1a')][_0x54e4('0x1f')],function(_0x2290d2){return{'model':db[_0x2290d2[_0x54e4('0x20')]],'as':_0x2290d2['as'],'attributes':_0x2290d2[_0x54e4('0x1d')],'include':_0x2290d2[_0x54e4('0x1f')]?_['map'](_0x2290d2[_0x54e4('0x1f')],function(_0xdc71ed){return{'model':db[_0xdc71ed[_0x54e4('0x20')]],'as':_0xdc71ed['as'],'attributes':_0xdc71ed[_0x54e4('0x1d')],'include':_0xdc71ed[_0x54e4('0x1f')]?_[_0x54e4('0x21')](_0xdc71ed[_0x54e4('0x1f')],function(_0xde64f5){return{'model':db[_0xde64f5[_0x54e4('0x20')]],'as':_0xde64f5['as'],'attributes':_0xde64f5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x325076){logger[_0x54e4('0x15')](_0x54e4('0x24'),_0x161a72);logger['debug'](_0x54e4('0x24'),_0x161a72,JSON['stringify'](_0x325076));_0x309ed6(_0x325076);})[_0x54e4('0x17')](function(_0xedde0e){logger['error'](_0x54e4('0x24'),_0xedde0e[_0x54e4('0x14')],_0x161a72);_0x32c453(_0x59a5b7['error'](0x1f4,_0xedde0e[_0x54e4('0x14')]));});});}; \ No newline at end of file +var _0x6d22=['model','GetTrunk','catch','ShowTrunk','find','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','findAll','options','raw','attributes','limit','include','map'];(function(_0x1a8192,_0x3453f2){var _0x131de2=function(_0x50ab1c){while(--_0x50ab1c){_0x1a8192['push'](_0x1a8192['shift']());}};_0x131de2(++_0x3453f2);}(_0x6d22,0x11c));var _0x26d2=function(_0x3a577a,_0x592a16){_0x3a577a=_0x3a577a-0x0;var _0x493322=_0x6d22[_0x3a577a];return _0x493322;};'use strict';var _=require('lodash');var util=require(_0x26d2('0x0'));var moment=require(_0x26d2('0x1'));var BPromise=require('bluebird');var rs=require(_0x26d2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26d2('0x3'))['db'];var utils=require(_0x26d2('0x4'));var logger=require(_0x26d2('0x5'))(_0x26d2('0x6'));var config=require('../../config/environment');var jayson=require(_0x26d2('0x7'));var client=jayson['client'][_0x26d2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53d5f0,_0x5b8bf7,_0x4639a0){return new BPromise(function(_0x3db02a,_0x539b66){return client[_0x26d2('0x9')](_0x53d5f0,_0x4639a0)[_0x26d2('0xa')](function(_0x1a53fb){logger[_0x26d2('0xb')](_0x26d2('0xc'),_0x5b8bf7,'request\x20sent');logger[_0x26d2('0xd')](_0x26d2('0xe'),_0x5b8bf7,_0x26d2('0xf'),JSON[_0x26d2('0x10')](_0x1a53fb));if(_0x1a53fb['error']){if(_0x1a53fb[_0x26d2('0x11')]['code']===0x1f4){logger[_0x26d2('0x11')](_0x26d2('0xc'),_0x5b8bf7,_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);return _0x539b66(_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);}logger[_0x26d2('0x11')](_0x26d2('0xc'),_0x5b8bf7,_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);return _0x3db02a(_0x1a53fb[_0x26d2('0x11')][_0x26d2('0x12')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x5b8bf7,_0x26d2('0xf'));_0x3db02a(_0x1a53fb['result'][_0x26d2('0x12')]);}})['catch'](function(_0x49d4bf){logger[_0x26d2('0x11')]('Trunk,\x20%s,\x20%s',_0x5b8bf7,_0x49d4bf);_0x539b66(_0x49d4bf);});});}exports['GetTrunk']=function(_0x3c1f98){var _0x556771=this;return new Promise(function(_0x4102bf,_0x1d1e41){return db['Trunk'][_0x26d2('0x13')]({'raw':_0x3c1f98['options']?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x15')]===undefined?!![]:![]:!![],'where':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')]['where']||null:null,'attributes':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x16')]||null:null,'limit':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x17')]||null:null,'include':_0x3c1f98[_0x26d2('0x14')]?_0x3c1f98[_0x26d2('0x14')][_0x26d2('0x18')]?_[_0x26d2('0x19')](_0x3c1f98[_0x26d2('0x14')]['include'],function(_0x424746){return{'model':db[_0x424746['model']],'as':_0x424746['as'],'attributes':_0x424746[_0x26d2('0x16')],'include':_0x424746[_0x26d2('0x18')]?_['map'](_0x424746[_0x26d2('0x18')],function(_0x5b8fe1){return{'model':db[_0x5b8fe1['model']],'as':_0x5b8fe1['as'],'attributes':_0x5b8fe1[_0x26d2('0x16')],'include':_0x5b8fe1['include']?_['map'](_0x5b8fe1[_0x26d2('0x18')],function(_0x385778){return{'model':db[_0x385778[_0x26d2('0x1a')]],'as':_0x385778['as'],'attributes':_0x385778[_0x26d2('0x16')]};}):[]};}):[]};}):[]:[]})[_0x26d2('0xa')](function(_0x1b5444){logger[_0x26d2('0xb')](_0x26d2('0x1b'),_0x3c1f98);logger[_0x26d2('0xd')](_0x26d2('0x1b'),_0x3c1f98,JSON[_0x26d2('0x10')](_0x1b5444));_0x4102bf(_0x1b5444);})[_0x26d2('0x1c')](function(_0x13504e){logger[_0x26d2('0x11')](_0x26d2('0x1b'),_0x13504e[_0x26d2('0x12')],_0x3c1f98);_0x1d1e41(_0x556771[_0x26d2('0x11')](0x1f4,_0x13504e[_0x26d2('0x12')]));});});};exports[_0x26d2('0x1d')]=function(_0x3a8b63){var _0x2e594e=this;return new Promise(function(_0x53a971,_0x205aaf){return db['Trunk'][_0x26d2('0x1e')]({'raw':_0x3a8b63['options']?_0x3a8b63[_0x26d2('0x14')][_0x26d2('0x15')]===undefined?!![]:![]:!![],'where':_0x3a8b63[_0x26d2('0x14')]?_0x3a8b63[_0x26d2('0x14')]['where']||null:null,'attributes':_0x3a8b63['options']?_0x3a8b63[_0x26d2('0x14')][_0x26d2('0x16')]||null:null,'include':_0x3a8b63[_0x26d2('0x14')]?_0x3a8b63['options'][_0x26d2('0x18')]?_['map'](_0x3a8b63['options']['include'],function(_0x51718e){return{'model':db[_0x51718e[_0x26d2('0x1a')]],'as':_0x51718e['as'],'attributes':_0x51718e[_0x26d2('0x16')],'include':_0x51718e['include']?_[_0x26d2('0x19')](_0x51718e['include'],function(_0x5e9382){return{'model':db[_0x5e9382[_0x26d2('0x1a')]],'as':_0x5e9382['as'],'attributes':_0x5e9382['attributes'],'include':_0x5e9382[_0x26d2('0x18')]?_[_0x26d2('0x19')](_0x5e9382[_0x26d2('0x18')],function(_0x3ae599){return{'model':db[_0x3ae599[_0x26d2('0x1a')]],'as':_0x3ae599['as'],'attributes':_0x3ae599[_0x26d2('0x16')]};}):[]};}):[]};}):[]:[]})[_0x26d2('0xa')](function(_0x598fde){logger[_0x26d2('0xb')](_0x26d2('0x1d'),_0x3a8b63);logger[_0x26d2('0xd')](_0x26d2('0x1d'),_0x3a8b63,JSON[_0x26d2('0x10')](_0x598fde));_0x53a971(_0x598fde);})[_0x26d2('0x1c')](function(_0x179288){logger[_0x26d2('0x11')]('ShowTrunk',_0x179288[_0x26d2('0x12')],_0x3a8b63);_0x205aaf(_0x2e594e[_0x26d2('0x11')](0x1f4,_0x179288[_0x26d2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5eafb74..9c211e5 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 _0x3c8f=['/:id','isAuthenticated','update','exports','express','../../components/auth/service','put'];(function(_0x25ab35,_0x4aa795){var _0x3f34f0=function(_0x53a560){while(--_0x53a560){_0x25ab35['push'](_0x25ab35['shift']());}};_0x3f34f0(++_0x4aa795);}(_0x3c8f,0x15b));var _0xf3c8=function(_0x11dad2,_0x54d57b){_0x11dad2=_0x11dad2-0x0;var _0x5c9bb3=_0x3c8f[_0x11dad2];return _0x5c9bb3;};'use strict';var express=require(_0xf3c8('0x0'));var router=express['Router']();var auth=require(_0xf3c8('0x1'));var controller=require('./user-setting.controller');router[_0xf3c8('0x2')](_0xf3c8('0x3'),auth[_0xf3c8('0x4')](),controller[_0xf3c8('0x5')]);module[_0xf3c8('0x6')]=router; \ No newline at end of file +var _0x078c=['put','isAuthenticated','update','exports','Router','../../components/auth/service','./user-setting.controller'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x078c,0xa5));var _0xc078=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x078c[_0x4df6f9];return _0x4b1a73;};'use strict';var express=require('express');var router=express[_0xc078('0x0')]();var auth=require(_0xc078('0x1'));var controller=require(_0xc078('0x2'));router[_0xc078('0x3')]('/:id',auth[_0xc078('0x4')](),controller[_0xc078('0x5')]);module[_0xc078('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 0784236..29079c4 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 _0xdba3=['TEXT','DATE','INTEGER','UserId','error','warning','info','debug','exports','ENUM'];(function(_0x5e1a7c,_0x39c043){var _0x10cdbc=function(_0x12f1fb){while(--_0x12f1fb){_0x5e1a7c['push'](_0x5e1a7c['shift']());}};_0x10cdbc(++_0x39c043);}(_0xdba3,0x112));var _0x3dba=function(_0x43fb7a,_0x3807f1){_0x43fb7a=_0x43fb7a-0x0;var _0x1be693=_0xdba3[_0x43fb7a];return _0x1be693;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x3dba('0x0'),_0x3dba('0x1'),_0x3dba('0x2'),_0x3dba('0x3')];module[_0x3dba('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3dba('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3dba('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3dba('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3dba('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3dba('0x8')],'unique':_0x3dba('0x9')}}; \ No newline at end of file +var _0x32cd=['BOOLEAN','DATE','UserId','sequelize','error','warning','info','debug','exports','ENUM'];(function(_0x5d68ba,_0x33be44){var _0x17cee3=function(_0x14e9ed){while(--_0x14e9ed){_0x5d68ba['push'](_0x5d68ba['shift']());}};_0x17cee3(++_0x33be44);}(_0x32cd,0x193));var _0xd32c=function(_0x266a3b,_0x2ec7d9){_0x266a3b=_0x266a3b-0x0;var _0x3db3ed=_0x32cd[_0x266a3b];return _0x3db3ed;};'use strict';var Sequelize=require(_0xd32c('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd32c('0x1'),_0xd32c('0x2'),_0xd32c('0x3'),_0xd32c('0x4')];module[_0xd32c('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd32c('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd32c('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd32c('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd32c('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xd32c('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 6718673..edecbd6 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 _0x394e=['sendStatus','error','stack','name','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','body','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','status','json','then'];(function(_0x3afb1e,_0x43fcd9){var _0x408028=function(_0x49ed62){while(--_0x49ed62){_0x3afb1e['push'](_0x3afb1e['shift']());}};_0x408028(++_0x43fcd9);}(_0x394e,0x88));var _0xe394=function(_0x16aa10,_0xc22da3){_0x16aa10=_0x16aa10-0x0;var _0x3bc706=_0x394e[_0x16aa10];return _0x3bc706;};'use strict';var _=require(_0xe394('0x0'));var Redis=require(_0xe394('0x1'));var logger=require('../../config/logger')(_0xe394('0x2'));var config=require(_0xe394('0x3'));var db=require(_0xe394('0x4'))['db'];var socket=require(_0xe394('0x5'))(new Redis(config['redis']));require(_0xe394('0x6'))[_0xe394('0x7')](socket);config[_0xe394('0x8')]=_[_0xe394('0x9')](config[_0xe394('0x8')],{'host':_0xe394('0xa'),'port':0x18eb});function respondWithResult(_0x337bff,_0x169910){_0x169910=_0x169910||0xc8;return function(_0xad826e){if(_0xad826e){return _0x337bff[_0xe394('0xb')](_0x169910)[_0xe394('0xc')](_0xad826e);}};}function saveUpdates(_0x4c31d9){return function(_0x50c6c1){if(_0x50c6c1){return _0x50c6c1['update'](_0x4c31d9)[_0xe394('0xd')](function(_0x365100){return _0x365100;});}return null;};}function handleEntityNotFound(_0x1f61fe){return function(_0x22db8b){if(!_0x22db8b){_0x1f61fe[_0xe394('0xe')](0x194);}return _0x22db8b;};}function handleError(_0x24b778,_0x15e771){_0x15e771=_0x15e771||0x1f4;return function(_0x4706bb){logger[_0xe394('0xf')](_0x4706bb[_0xe394('0x10')]);if(_0x4706bb[_0xe394('0x11')]){delete _0x4706bb[_0xe394('0x11')];}_0x24b778['status'](_0x15e771)['send'](_0x4706bb);};}exports['update']=function(_0x227017,_0x40b7e1){if(_0x227017['user'][_0xe394('0x12')]!==_0xe394('0x13'))throw new Error(_0xe394('0x14'));if(isNaN(Number(_0x227017[_0xe394('0x15')]['id'])))throw new Error(_0xe394('0x16'));return db[_0xe394('0x17')]['find']({'where':{'id':_0x227017['params']['id']}})[_0xe394('0xd')](handleEntityNotFound(_0x40b7e1,null))[_0xe394('0xd')](saveUpdates(_0x227017[_0xe394('0x18')],null))[_0xe394('0xd')](respondWithResult(_0x40b7e1,null))['catch'](handleError(_0x40b7e1,null));}; \ No newline at end of file +var _0x37a4=['error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','register','redis','defaults','status','json','update','then','sendStatus'];(function(_0x42c18a,_0x2c2713){var _0x37b1a0=function(_0xf2af58){while(--_0xf2af58){_0x42c18a['push'](_0x42c18a['shift']());}};_0x37b1a0(++_0x2c2713);}(_0x37a4,0xcb));var _0x437a=function(_0x22ef70,_0x442377){_0x22ef70=_0x22ef70-0x0;var _0x43da47=_0x37a4[_0x22ef70];return _0x43da47;};'use strict';var _=require(_0x437a('0x0'));var Redis=require('ioredis');var logger=require(_0x437a('0x1'))('api');var config=require(_0x437a('0x2'));var db=require(_0x437a('0x3'))['db'];var socket=require(_0x437a('0x4'))(new Redis(config['redis']));require('./user-setting.socket')[_0x437a('0x5')](socket);config[_0x437a('0x6')]=_[_0x437a('0x7')](config[_0x437a('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1c567f,_0x3a4961){_0x3a4961=_0x3a4961||0xc8;return function(_0x5017ce){if(_0x5017ce){return _0x1c567f[_0x437a('0x8')](_0x3a4961)[_0x437a('0x9')](_0x5017ce);}};}function saveUpdates(_0x2fe1a5){return function(_0x24a2f4){if(_0x24a2f4){return _0x24a2f4[_0x437a('0xa')](_0x2fe1a5)[_0x437a('0xb')](function(_0x294d71){return _0x294d71;});}return null;};}function handleEntityNotFound(_0x38b90e){return function(_0x26832b){if(!_0x26832b){_0x38b90e[_0x437a('0xc')](0x194);}return _0x26832b;};}function handleError(_0xfdcfdc,_0x581d9a){_0x581d9a=_0x581d9a||0x1f4;return function(_0x23f321){logger[_0x437a('0xd')](_0x23f321[_0x437a('0xe')]);if(_0x23f321[_0x437a('0xf')]){delete _0x23f321[_0x437a('0xf')];}_0xfdcfdc['status'](_0x581d9a)[_0x437a('0x10')](_0x23f321);};}exports['update']=function(_0x9e115f,_0x1e902a){if(_0x9e115f[_0x437a('0x11')][_0x437a('0x12')]!==_0x437a('0x13'))throw new Error(_0x437a('0x14'));if(isNaN(Number(_0x9e115f[_0x437a('0x15')]['id'])))throw new Error(_0x437a('0x16'));return db[_0x437a('0x17')][_0x437a('0x18')]({'where':{'id':_0x9e115f[_0x437a('0x15')]['id']}})[_0x437a('0xb')](handleEntityNotFound(_0x1e902a,null))['then'](saveUpdates(_0x9e115f[_0x437a('0x19')],null))['then'](respondWithResult(_0x1e902a,null))[_0x437a('0x1a')](handleError(_0x1e902a,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 098f7cc..7ae6dcd 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 _0x3ecb=['save','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x92a6b4,_0x51c3a0){var _0x43e0f2=function(_0x3e6313){while(--_0x3e6313){_0x92a6b4['push'](_0x92a6b4['shift']());}};_0x43e0f2(++_0x51c3a0);}(_0x3ecb,0x1a2));var _0xb3ec=function(_0x32e7d6,_0x682bc5){_0x32e7d6=_0x32e7d6-0x0;var _0x5427cf=_0x3ecb[_0x32e7d6];return _0x5427cf;};'use strict';var EventEmitter=require(_0xb3ec('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xb3ec('0x1')](0x0);var events={'afterCreate':_0xb3ec('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a8217){return function(_0x51a220,_0x219045,_0x39861d){UserSettingEvents[_0xb3ec('0x3')](_0x4a8217+':'+_0x51a220['id'],_0x51a220);UserSettingEvents[_0xb3ec('0x3')](_0x4a8217,_0x51a220);_0x39861d(null);};}for(var e in events){if(events[_0xb3ec('0x4')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xb3ec('0x5')]=UserSettingEvents; \ No newline at end of file +var _0x18db=['emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting','setMaxListeners','update','remove'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x18db,0x16b));var _0xb18d=function(_0x489d1a,_0xe91bdd){_0x489d1a=_0x489d1a-0x0;var _0x2a9d76=_0x18db[_0x489d1a];return _0x2a9d76;};'use strict';var EventEmitter=require(_0xb18d('0x0'));var UserSetting=require(_0xb18d('0x1'))['db'][_0xb18d('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xb18d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb18d('0x4'),'afterDestroy':_0xb18d('0x5')};function emitEvent(_0x55496e){return function(_0x418ca6,_0xb3e58a,_0x13e6b4){UserSettingEvents[_0xb18d('0x6')](_0x55496e+':'+_0x418ca6['id'],_0x418ca6);UserSettingEvents[_0xb18d('0x6')](_0x55496e,_0x418ca6);_0x13e6b4(null);};}for(var e in events){if(events[_0xb18d('0x7')](e)){var event=events[e];UserSetting[_0xb18d('0x8')](e,emitEvent(event));}}module['exports']=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 637d41b..cd61694 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 _0x7462=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x7462,0x165));var _0x2746=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x7462[_0x5bfa44];return _0x43815f;};'use strict';var attributes=require(_0x2746('0x0'));module[_0x2746('0x1')]=function(_0x5666d5){return _0x5666d5['define'](_0x2746('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x497e67){if(!_0x497e67[_0x2746('0x3')])_0x497e67[_0x2746('0x4')]=null;else if(_0x497e67['clientSideLoggingEnabledSince']===null)_0x497e67[_0x2746('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x9e5e=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x2fc8d8,_0x4807c6){var _0x4f35da=function(_0x13464c){while(--_0x13464c){_0x2fc8d8['push'](_0x2fc8d8['shift']());}};_0x4f35da(++_0x4807c6);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x9e5e[_0x556927];return _0x5f1235;};'use strict';var attributes=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]=function(_0x5a229a){return _0x5a229a[_0xe9e5('0x2')](_0xe9e5('0x3'),attributes,{'tableName':_0xe9e5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c9784){if(!_0x4c9784[_0xe9e5('0x5')])_0x4c9784['clientSideLoggingEnabledSince']=null;else if(_0x4c9784[_0xe9e5('0x6')]===null)_0x4c9784[_0xe9e5('0x6')]=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 33eee37..bb23fee 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 _0xa6eb=['emit','length','user-setting:','./user-setting.events','save','update'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0xa6eb,0x10b));var _0xba6e=function(_0x161e7d,_0x3ecd3b){_0x161e7d=_0x161e7d-0x0;var _0x4277b5=_0xa6eb[_0x161e7d];return _0x4277b5;};'use strict';var UserSettingEvents=require(_0xba6e('0x0'));var events=[_0xba6e('0x1'),'remove',_0xba6e('0x2')];function createListener(_0x2396c7,_0x4d2b90){return function(_0x47febb){_0x4d2b90[_0xba6e('0x3')](_0x2396c7,_0x47febb);if(_0x2396c7==='user-setting:update'){_0x4d2b90['emit']('user-setting:update:user-'+_0x47febb['UserId'],_0x47febb);}};}exports['register']=function(_0x501c73){for(var _0x50fe9b=0x0,_0x25eef7=events[_0xba6e('0x4')];_0x50fe9b<_0x25eef7;_0x50fe9b++){var _0xdcc7a=events[_0x50fe9b];var _0x27cd84=createListener(_0xba6e('0x5')+_0xdcc7a,_0x501c73);UserSettingEvents['on'](_0xdcc7a,_0x27cd84);}}; \ No newline at end of file +var _0xb11e=['length','user-setting:','./user-setting.events','update','emit','user-setting:update:user-','UserId','register'];(function(_0x424648,_0xc47652){var _0x7f1d38=function(_0x171f18){while(--_0x171f18){_0x424648['push'](_0x424648['shift']());}};_0x7f1d38(++_0xc47652);}(_0xb11e,0x122));var _0xeb11=function(_0x235c81,_0x11a928){_0x235c81=_0x235c81-0x0;var _0x19cc3b=_0xb11e[_0x235c81];return _0x19cc3b;};'use strict';var UserSettingEvents=require(_0xeb11('0x0'));var events=['save','remove',_0xeb11('0x1')];function createListener(_0x32b619,_0x2d1c47){return function(_0x1cf078){_0x2d1c47[_0xeb11('0x2')](_0x32b619,_0x1cf078);if(_0x32b619==='user-setting:update'){_0x2d1c47[_0xeb11('0x2')](_0xeb11('0x3')+_0x1cf078[_0xeb11('0x4')],_0x1cf078);}};}exports[_0xeb11('0x5')]=function(_0x1f6ad1){for(var _0x237cbc=0x0,_0x4e481f=events[_0xeb11('0x6')];_0x237cbc<_0x4e481f;_0x237cbc++){var _0x461394=events[_0x237cbc];var _0x41f087=createListener(_0xeb11('0x7')+_0x461394,_0x1f6ad1);UserSettingEvents['on'](_0x461394,_0x41f087);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 34e15d6..20f618a 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 _0xc242=['getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','/:id/fax_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','update','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/mail_accounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/messengerSoundNotification','messengerSoundNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0xc242,0xc1));var _0x2c24=function(_0x2f6255,_0x48f322){_0x2f6255=_0x2f6255-0x0;var _0xb27892=_0xc242[_0x2f6255];return _0xb27892;};'use strict';var multer=require('multer');var util=require(_0x2c24('0x0'));var path=require(_0x2c24('0x1'));var timeout=require(_0x2c24('0x2'));var express=require(_0x2c24('0x3'));var router=express[_0x2c24('0x4')]();var fs_extra=require(_0x2c24('0x5'));var auth=require(_0x2c24('0x6'));var interaction=require(_0x2c24('0x7'));var config=require(_0x2c24('0x8'));var controller=require('./user.controller');router[_0x2c24('0x9')]('/',auth[_0x2c24('0xa')](),controller[_0x2c24('0xb')]);router[_0x2c24('0x9')]('/describe',auth[_0x2c24('0xa')](),controller[_0x2c24('0xc')]);router[_0x2c24('0x9')](_0x2c24('0xd'),auth['isAuthenticated'](),controller[_0x2c24('0xe')]);router[_0x2c24('0x9')](_0x2c24('0xf'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x10')]);router['get'](_0x2c24('0x11'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x12')]);router[_0x2c24('0x9')]('/:id/avatar',controller['getAvatar']);router[_0x2c24('0x9')](_0x2c24('0x13'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x14')]);router[_0x2c24('0x9')](_0x2c24('0x15'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x16')]);router[_0x2c24('0x9')](_0x2c24('0x17'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x18')]);router[_0x2c24('0x9')](_0x2c24('0x19'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x2c24('0x9')](_0x2c24('0x1a'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x1b')]);router[_0x2c24('0x9')](_0x2c24('0x1c'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x1d')]);router[_0x2c24('0x9')](_0x2c24('0x1e'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x1f')]);router['get'](_0x2c24('0x20'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x21')]);router['get'](_0x2c24('0x22'),auth['isAuthenticated'](),controller[_0x2c24('0x23')]);router[_0x2c24('0x9')](_0x2c24('0x24'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x25')]);router['get'](_0x2c24('0x26'),auth[_0x2c24('0xa')](),controller['getSmsInteractions']);router[_0x2c24('0x9')]('/:id/fax/interactions',auth[_0x2c24('0xa')](),controller['getFaxInteractions']);router[_0x2c24('0x9')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x2c24('0x27')]);router[_0x2c24('0x9')](_0x2c24('0x28'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x29')]);router['get'](_0x2c24('0x2a'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x2b')]);router[_0x2c24('0x9')]('/:id/agents',auth[_0x2c24('0xa')](),controller[_0x2c24('0x2c')]);router[_0x2c24('0x9')](_0x2c24('0x2d'),auth[_0x2c24('0xa')](),controller['getVoicePrefixes']);router[_0x2c24('0x9')]('/:id/fax_accounts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x2e')]);router[_0x2c24('0x9')]('/:id/mail_accounts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x2f')]);router[_0x2c24('0x9')](_0x2c24('0x30'),auth[_0x2c24('0xa')](),controller['getOpenchannelAccounts']);router[_0x2c24('0x9')](_0x2c24('0x31'),auth['isAuthenticated'](),controller[_0x2c24('0x32')]);router[_0x2c24('0x9')](_0x2c24('0x33'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x34')]);router[_0x2c24('0x9')](_0x2c24('0x35'),auth[_0x2c24('0xa')](),controller['getWhatsappAccounts']);router[_0x2c24('0x9')](_0x2c24('0x36'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x37')]);router[_0x2c24('0x9')](_0x2c24('0x38'),auth['isAuthenticated'](),controller[_0x2c24('0x39')]);router[_0x2c24('0x3a')]('/:id/contacts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x3b')]);router[_0x2c24('0x3a')]('/',auth['isAuthenticated'](),controller[_0x2c24('0x3c')]);router[_0x2c24('0x3a')]('/create_many',auth[_0x2c24('0xa')](),controller[_0x2c24('0x3d')]);router['post'](_0x2c24('0x17'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x3e')]);var upload=multer({'storage':multer[_0x2c24('0x3f')]({'destination':function(_0xf637b9,_0x371513,_0x43d2bb){_0x43d2bb(null,path[_0x2c24('0x40')](config[_0x2c24('0x41')],_0x2c24('0x42')));},'filename':function(_0x5f44b5,_0x2c7a4b,_0x1d49e2){_0x1d49e2(null,util[_0x2c24('0x43')](_0x2c24('0x44'),Date[_0x2c24('0x45')](),_0x2c7a4b['originalname']));}})});router[_0x2c24('0x3a')](_0x2c24('0x46'),upload['single'](_0x2c24('0x47')),controller[_0x2c24('0x48')]);router[_0x2c24('0x3a')](_0x2c24('0x49'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x4a')]);router['post'](_0x2c24('0x4b'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x4c')]);router[_0x2c24('0x3a')](_0x2c24('0x4d'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x4e')]);router[_0x2c24('0x3a')]('/:id/unpause',auth[_0x2c24('0xa')](),controller[_0x2c24('0x4f')]);router[_0x2c24('0x3a')](_0x2c24('0x28'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x50')]);router[_0x2c24('0x3a')]('/:id/chat_interactions',auth[_0x2c24('0xa')](),controller[_0x2c24('0x51')]);router[_0x2c24('0x3a')](_0x2c24('0x52'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x53')]);router['post'](_0x2c24('0x54'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x55')]);router[_0x2c24('0x3a')](_0x2c24('0x56'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x57')]);router[_0x2c24('0x3a')](_0x2c24('0x58'),auth[_0x2c24('0xa')](),controller['addOpenchannelInteractions']);router[_0x2c24('0x3a')](_0x2c24('0x59'),auth[_0x2c24('0xa')](),controller['addWhatsappInteractions']);router[_0x2c24('0x3a')](_0x2c24('0x5a'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x2c24('0x3a')]('/:id/mail_accounts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x5b')]);router[_0x2c24('0x3a')](_0x2c24('0x30'),auth['isAuthenticated'](),controller[_0x2c24('0x5c')]);router[_0x2c24('0x3a')](_0x2c24('0x31'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x5d')]);router[_0x2c24('0x3a')](_0x2c24('0x33'),auth[_0x2c24('0xa')](),controller['addChatWebsites']);router[_0x2c24('0x3a')]('/:id/whatsapp_accounts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x5e')]);router[_0x2c24('0x3a')]('/:id/api_key',auth[_0x2c24('0xa')](),controller['createApiKey']);router['put'](_0x2c24('0x11'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x5f')]);router['put']('/:id/password',auth[_0x2c24('0xa')](),controller[_0x2c24('0x60')]);router[_0x2c24('0x61')](_0x2c24('0x17'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x62')]);router[_0x2c24('0x61')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x2c24('0x61')](_0x2c24('0x11'),auth['isAuthenticated'](),controller[_0x2c24('0x63')]);router[_0x2c24('0x61')](_0x2c24('0x64'),auth[_0x2c24('0xa')](),controller['removeChatInteractions']);router['delete'](_0x2c24('0x52'),auth[_0x2c24('0xa')](),controller['removeMailInteractions']);router['delete'](_0x2c24('0x54'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x65')]);router[_0x2c24('0x61')](_0x2c24('0x56'),auth[_0x2c24('0xa')](),controller['removeSmsInteractions']);router[_0x2c24('0x61')](_0x2c24('0x58'),auth[_0x2c24('0xa')](),controller[_0x2c24('0x66')]);router[_0x2c24('0x61')](_0x2c24('0x59'),auth['isAuthenticated'](),controller[_0x2c24('0x67')]);router[_0x2c24('0x61')](_0x2c24('0x5a'),auth[_0x2c24('0xa')](),controller['removeFaxAccounts']);router[_0x2c24('0x61')](_0x2c24('0x68'),auth['isAuthenticated'](),controller[_0x2c24('0x69')]);router[_0x2c24('0x61')]('/:id/openchannel_accounts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x6a')]);router['delete']('/:id/sms_accounts',auth[_0x2c24('0xa')](),controller[_0x2c24('0x6b')]);router[_0x2c24('0x61')](_0x2c24('0x33'),auth['isAuthenticated'](),controller[_0x2c24('0x6c')]);router['delete'](_0x2c24('0x35'),auth[_0x2c24('0xa')](),controller['removeWhatsappAccounts']);router[_0x2c24('0x61')](_0x2c24('0x38'),auth[_0x2c24('0xa')](),controller['removeApiKey']);router[_0x2c24('0x3a')](_0x2c24('0x6d'),auth['isAuthenticated'](),controller[_0x2c24('0x6e')]);module[_0x2c24('0x6f')]=router; \ No newline at end of file +var _0x1e70=['/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x1e70,0x183));var _0x01e7=function(_0x413e19,_0x88b88f){_0x413e19=_0x413e19-0x0;var _0x4fa6e8=_0x1e70[_0x413e19];return _0x4fa6e8;};'use strict';var multer=require(_0x01e7('0x0'));var util=require(_0x01e7('0x1'));var path=require(_0x01e7('0x2'));var timeout=require(_0x01e7('0x3'));var express=require(_0x01e7('0x4'));var router=express[_0x01e7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x01e7('0x6'));var controller=require('./user.controller');router[_0x01e7('0x7')]('/',auth[_0x01e7('0x8')](),controller[_0x01e7('0x9')]);router[_0x01e7('0x7')](_0x01e7('0xa'),auth[_0x01e7('0x8')](),controller[_0x01e7('0xb')]);router[_0x01e7('0x7')](_0x01e7('0xc'),auth[_0x01e7('0x8')](),controller[_0x01e7('0xd')]);router[_0x01e7('0x7')]('/presence',auth['isAuthenticated'](),controller[_0x01e7('0xe')]);router[_0x01e7('0x7')](_0x01e7('0xf'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x10')]);router[_0x01e7('0x7')](_0x01e7('0x11'),controller['getAvatar']);router[_0x01e7('0x7')]('/:id/open_tabs',auth[_0x01e7('0x8')](),controller[_0x01e7('0x12')]);router['get'](_0x01e7('0x13'),auth[_0x01e7('0x8')](),controller['getContacts']);router[_0x01e7('0x7')](_0x01e7('0x14'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x15')]);router['get'](_0x01e7('0x16'),auth['isAuthenticated'](),controller[_0x01e7('0x17')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0x01e7('0x7')](_0x01e7('0x18'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x19')]);router['get'](_0x01e7('0x1a'),auth['isAuthenticated'](),controller[_0x01e7('0x1b')]);router[_0x01e7('0x7')](_0x01e7('0x1c'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x1d')]);router[_0x01e7('0x7')](_0x01e7('0x1e'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x01e7('0x7')](_0x01e7('0x1f'),auth['isAuthenticated'](),controller[_0x01e7('0x20')]);router[_0x01e7('0x7')](_0x01e7('0x21'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x22')]);router[_0x01e7('0x7')]('/:id/fax/interactions',auth[_0x01e7('0x8')](),controller[_0x01e7('0x23')]);router['get'](_0x01e7('0x24'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x25')]);router['get']('/:id/teams',auth[_0x01e7('0x8')](),controller[_0x01e7('0x26')]);router[_0x01e7('0x7')]('/:id/lists',auth[_0x01e7('0x8')](),controller['getLists']);router[_0x01e7('0x7')](_0x01e7('0x27'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x28')]);router[_0x01e7('0x7')](_0x01e7('0x29'),auth['isAuthenticated'](),controller[_0x01e7('0x2a')]);router[_0x01e7('0x7')]('/:id/fax_accounts',auth[_0x01e7('0x8')](),controller[_0x01e7('0x2b')]);router['get'](_0x01e7('0x2c'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x2d')]);router['get'](_0x01e7('0x2e'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x2f')]);router[_0x01e7('0x7')](_0x01e7('0x30'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x01e7('0x7')](_0x01e7('0x31'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x32')]);router[_0x01e7('0x7')](_0x01e7('0x33'),auth[_0x01e7('0x8')](),controller['getWhatsappAccounts']);router['get'](_0x01e7('0x34'),auth[_0x01e7('0x8')](),controller['getScheduledCalls']);router[_0x01e7('0x7')](_0x01e7('0x35'),auth['isAuthenticated'](),controller[_0x01e7('0x36')]);router[_0x01e7('0x37')](_0x01e7('0x13'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x38')]);router[_0x01e7('0x37')]('/',auth[_0x01e7('0x8')](),controller['create']);router[_0x01e7('0x37')]('/create_many',auth[_0x01e7('0x8')](),controller[_0x01e7('0x39')]);router[_0x01e7('0x37')](_0x01e7('0x14'),auth['isAuthenticated'](),controller[_0x01e7('0x3a')]);var upload=multer({'storage':multer[_0x01e7('0x3b')]({'destination':function(_0x56f5be,_0x514d3a,_0x5c594b){_0x5c594b(null,path[_0x01e7('0x3c')](config[_0x01e7('0x3d')],_0x01e7('0x3e')));},'filename':function(_0x524a87,_0x14300a,_0x5a3e2b){_0x5a3e2b(null,util['format']('%s-%s',Date[_0x01e7('0x3f')](),_0x14300a[_0x01e7('0x40')]));}})});router['post'](_0x01e7('0x11'),upload[_0x01e7('0x41')](_0x01e7('0x42')),controller['addAvatar']);router[_0x01e7('0x37')](_0x01e7('0x43'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x44')]);router[_0x01e7('0x37')](_0x01e7('0x45'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x46')]);router[_0x01e7('0x37')](_0x01e7('0x47'),auth['isAuthenticated'](),controller[_0x01e7('0x48')]);router[_0x01e7('0x37')](_0x01e7('0x49'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x4a')]);router[_0x01e7('0x37')](_0x01e7('0x4b'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x4c')]);router[_0x01e7('0x37')](_0x01e7('0x4d'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x4e')]);router[_0x01e7('0x37')](_0x01e7('0x4f'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x50')]);router[_0x01e7('0x37')](_0x01e7('0x51'),auth[_0x01e7('0x8')](),controller['addFaxInteractions']);router[_0x01e7('0x37')](_0x01e7('0x52'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x53')]);router[_0x01e7('0x37')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x01e7('0x54')]);router[_0x01e7('0x37')](_0x01e7('0x55'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x56')]);router[_0x01e7('0x37')](_0x01e7('0x57'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x58')]);router[_0x01e7('0x37')]('/:id/mail_accounts',auth[_0x01e7('0x8')](),controller[_0x01e7('0x59')]);router[_0x01e7('0x37')](_0x01e7('0x2e'),auth['isAuthenticated'](),controller[_0x01e7('0x5a')]);router[_0x01e7('0x37')](_0x01e7('0x30'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x5b')]);router[_0x01e7('0x37')](_0x01e7('0x31'),auth[_0x01e7('0x8')](),controller['addChatWebsites']);router['post'](_0x01e7('0x33'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x5c')]);router[_0x01e7('0x37')](_0x01e7('0x35'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x5d')]);router[_0x01e7('0x5e')](_0x01e7('0xf'),auth['isAuthenticated'](),controller[_0x01e7('0x5f')]);router[_0x01e7('0x5e')](_0x01e7('0x60'),auth[_0x01e7('0x8')](),controller['changePassword']);router[_0x01e7('0x61')](_0x01e7('0x14'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x62')]);router[_0x01e7('0x61')](_0x01e7('0x4b'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x63')]);router[_0x01e7('0x61')](_0x01e7('0xf'),auth['isAuthenticated'](),controller[_0x01e7('0x64')]);router[_0x01e7('0x61')](_0x01e7('0x4d'),auth['isAuthenticated'](),controller[_0x01e7('0x65')]);router[_0x01e7('0x61')](_0x01e7('0x4f'),auth[_0x01e7('0x8')](),controller['removeMailInteractions']);router['delete'](_0x01e7('0x51'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x01e7('0x61')](_0x01e7('0x52'),auth[_0x01e7('0x8')](),controller['removeSmsInteractions']);router['delete'](_0x01e7('0x66'),auth[_0x01e7('0x8')](),controller['removeOpenchannelInteractions']);router[_0x01e7('0x61')](_0x01e7('0x55'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x67')]);router['delete'](_0x01e7('0x57'),auth[_0x01e7('0x8')](),controller[_0x01e7('0x68')]);router[_0x01e7('0x61')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete']('/:id/openchannel_accounts',auth[_0x01e7('0x8')](),controller['removeOpenchannelAccounts']);router[_0x01e7('0x61')](_0x01e7('0x30'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete'](_0x01e7('0x31'),auth['isAuthenticated'](),controller[_0x01e7('0x69')]);router[_0x01e7('0x61')]('/:id/whatsapp_accounts',auth[_0x01e7('0x8')](),controller['removeWhatsappAccounts']);router[_0x01e7('0x61')]('/:id/api_key',auth[_0x01e7('0x8')](),controller[_0x01e7('0x6a')]);router[_0x01e7('0x37')](_0x01e7('0x6b'),auth[_0x01e7('0x8')](),controller['messengerSoundNotification']);module[_0x01e7('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index f22f15e..4d7dd8c 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 _0x89bd=['TEXT','showWebBar','get','wss','udp','encryption','avpf','force_avp','icesupport','dtlssetup','rtcp_mux','dtlsenable','dtlsverify','actpass','dtlscertfile','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','local','accountcode','callerid','format','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','refuse','originate','uac','uas','certificate','active','passive','update','update,nonat'];(function(_0x5b1df2,_0x4c749b){var _0x6fb06d=function(_0x3449bb){while(--_0x3449bb){_0x5b1df2['push'](_0x5b1df2['shift']());}};_0x6fb06d(++_0x4c749b);}(_0x89bd,0xd8));var _0xd89b=function(_0x22cb10,_0x20db4f){_0x22cb10=_0x22cb10-0x0;var _0x38a6f8=_0x89bd[_0x22cb10];return _0x38a6f8;};'use strict';var Sequelize=require(_0xd89b('0x0'));var moment=require(_0xd89b('0x1'));var util=require('util');var _=require('lodash');module[_0xd89b('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd89b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5d1ed4){this[_0xd89b('0x4')](_0xd89b('0x3'),_0x5d1ed4);this[_0xd89b('0x4')](_0xd89b('0x5'),_0x5d1ed4);},'comment':_0xd89b('0x6')},'fullname':{'type':Sequelize[_0xd89b('0x7')],'allowNull':![],'set':function(_0x39dadb){this[_0xd89b('0x4')](_0xd89b('0x8'),_0x39dadb);this[_0xd89b('0x4')]('callerid',util['format'](_0xd89b('0x9'),_0x39dadb,this['getDataValue'](_0xd89b('0xa'))));}},'alias':{'type':Sequelize[_0xd89b('0x7')]},'email':{'type':Sequelize[_0xd89b('0x7')],'allowNull':![],'unique':_0xd89b('0xb'),'validate':{'isEmail':!![]},'set':function(_0x443e76){if(_0x443e76){this[_0xd89b('0x4')](_0xd89b('0xb'),_0x443e76[_0xd89b('0xc')]());}}},'role':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0xe'),_0xd89b('0xf'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xd89b('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd89b('0x7')],'defaultValue':_0xd89b('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xd89b('0xa'),'set':function(_0x4e3c6d){this['setDataValue']('internal',_0x4e3c6d);this[_0xd89b('0x4')](_0xd89b('0x11'),_0x4e3c6d);this[_0xd89b('0x4')](_0xd89b('0x12'),util[_0xd89b('0x13')](_0xd89b('0x9'),this['getDataValue']('fullname'),_0x4e3c6d));}},'salt':{'type':Sequelize[_0xd89b('0x7')]},'phone':{'type':Sequelize[_0xd89b('0x7')]},'mobile':{'type':Sequelize[_0xd89b('0x7')]},'address':{'type':Sequelize[_0xd89b('0x7')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xd89b('0x7')]},'city':{'type':Sequelize[_0xd89b('0x7')]},'country':{'type':Sequelize[_0xd89b('0x7')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xd89b('0x14')]},'voicePause':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd89b('0x7')],'defaultValue':_0xd89b('0x16')},'lastPauseAt':{'type':Sequelize[_0xd89b('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd89b('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd89b('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![],'defaultValue':_0xd89b('0x18')},'ipaddr':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x19'),_0xd89b('0xf'),_0xd89b('0x1a')),'allowNull':!![],'defaultValue':_0xd89b('0x19')},'context':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![],'defaultValue':_0xd89b('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0xd89b('0x1c'),_0xd89b('0x1d'),'ALLOWED_FAILED_SCREEN',_0xd89b('0x1e'),_0xd89b('0x1f'),_0xd89b('0x20'),_0xd89b('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x3e363e){this['setDataValue']('transport',_0x3e363e?_0x3e363e[_0xd89b('0x22')](','):null);},'get':function(){return this['getDataValue'](_0xd89b('0x23'))?this[_0xd89b('0x24')](_0xd89b('0x23'))[_0xd89b('0x25')](','):null;},'comment':_0xd89b('0x26')},'dtmfmode':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x27'),_0xd89b('0x28'),_0xd89b('0x29'),_0xd89b('0x2a'),_0xd89b('0x2b')),'allowNull':!![],'defaultValue':_0xd89b('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0xd89b('0x2c'),'no',_0xd89b('0x2d'),'update',_0xd89b('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![],'defaultValue':_0xd89b('0x2f'),'set':function(_0x35227a){this[_0xd89b('0x4')](_0xd89b('0x30'),_0x35227a?_0x35227a[_0xd89b('0x22')](','):null);},'get':function(){return this['getDataValue'](_0xd89b('0x30'))?this[_0xd89b('0x24')](_0xd89b('0x30'))[_0xd89b('0x25')](','):null;},'comment':_0xd89b('0x31')},'callgroup':{'type':Sequelize[_0xd89b('0x7')]},'namedcallgroup':{'type':Sequelize[_0xd89b('0x7')]},'pickupgroup':{'type':Sequelize[_0xd89b('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xd89b('0x7')]},'language':{'type':Sequelize[_0xd89b('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xd89b('0x7')],'allowNull':![],'defaultValue':_0xd89b('0x32')},'allow':{'type':Sequelize[_0xd89b('0x7')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x23b426){this[_0xd89b('0x4')]('allow',_0x23b426?_0x23b426[_0xd89b('0x22')](';'):_0xd89b('0x33'));},'get':function(){return this[_0xd89b('0x24')](_0xd89b('0x34'))?this[_0xd89b('0x24')](_0xd89b('0x34'))[_0xd89b('0x25')](';'):null;},'comment':_0xd89b('0x35')},'autoframing':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x3d60bc){this[_0xd89b('0x4')](_0xd89b('0x36'),_0x3d60bc?_0x3d60bc[_0xd89b('0x22')](','):null);},'get':function(){return this[_0xd89b('0x24')]('insecure')?this[_0xd89b('0x24')](_0xd89b('0x36'))[_0xd89b('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd89b('0x37')},'amaflags':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no',_0xd89b('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd89b('0xd')]('accept',_0xd89b('0x39'),_0xd89b('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x3b'),_0xd89b('0x3c')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xd89b('0x2c')},'keepalive':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd89b('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no','fingerprint',_0xd89b('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x3e'),_0xd89b('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd89b('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd89b('0xd')](_0xd89b('0x2c'),'no',_0xd89b('0x2d'),_0xd89b('0x40'),_0xd89b('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd89b('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0xd89b('0x14')]},'passwordResetAt':{'type':Sequelize[_0xd89b('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd89b('0x42')]},'showWebBar':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0,'set':function(_0x1b7bce){this['setDataValue'](_0xd89b('0x43'),_0x1b7bce);var _0x4d1a6d=this[_0xd89b('0x44')]({'plain':!![]});switch(_0x1b7bce){case 0x0:case 0x1:var _0x2a80be=_0x4d1a6d[_0xd89b('0x23')]?_['isArray'](_0x4d1a6d['transport'])?_0x4d1a6d[_0xd89b('0x23')]['join']():_0x4d1a6d['transport']:'udp';if(_0x2a80be===_0xd89b('0x45')){_0x2a80be=_0xd89b('0x46');}this[_0xd89b('0x4')](_0xd89b('0x23'),_0x2a80be);this['setDataValue'](_0xd89b('0x47'),'no');this[_0xd89b('0x4')](_0xd89b('0x48'),null);this[_0xd89b('0x4')](_0xd89b('0x49'),null);this['setDataValue'](_0xd89b('0x4a'),null);this[_0xd89b('0x4')]('dtlsenable',null);this[_0xd89b('0x4')]('dtlsverify',null);this[_0xd89b('0x4')](_0xd89b('0x4b'),null);this['setDataValue']('dtlscertfile',null);this[_0xd89b('0x4')]('dtlsprivatekey',null);this[_0xd89b('0x4')](_0xd89b('0x4c'),'no');break;case 0x2:this[_0xd89b('0x4')]('transport',_0xd89b('0x45'));this[_0xd89b('0x4')](_0xd89b('0x47'),_0xd89b('0x2c'));this[_0xd89b('0x4')]('avpf','yes');this[_0xd89b('0x4')](_0xd89b('0x49'),'yes');this[_0xd89b('0x4')](_0xd89b('0x4a'),_0xd89b('0x2c'));this['setDataValue'](_0xd89b('0x4d'),_0xd89b('0x2c'));this[_0xd89b('0x4')](_0xd89b('0x4e'),'no');this['setDataValue'](_0xd89b('0x4b'),_0xd89b('0x4f'));this[_0xd89b('0x4')](_0xd89b('0x50'),_0x4d1a6d['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0xd89b('0x4')](_0xd89b('0x51'),_0x4d1a6d[_0xd89b('0x51')]||_0xd89b('0x52'));this[_0xd89b('0x4')](_0xd89b('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xd89b('0x42')],'set':function(_0x26fdb6){this[_0xd89b('0x4')](_0xd89b('0x53'),_0x26fdb6?_0x26fdb6['join'](','):[]);},'get':function(){return this['getDataValue'](_0xd89b('0x53'))?_[_0xd89b('0x54')](this[_0xd89b('0x24')](_0xd89b('0x53'))[_0xd89b('0x25')](','),function(_0x1d7e12){return parseInt(_0x1d7e12,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd89b('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd89b('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0xd89b('0x7')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd89b('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd89b('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd89b('0x55')],'get':function(){return this['getDataValue'](_0xd89b('0x56'))?this['getDataValue'](_0xd89b('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xd89b('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd89b('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x214116){if(typeof _0x214116===_0xd89b('0x57')){var _0x49ce5b=_0x214116==='1'?!![]:_0x214116==='0'?![]:_0x214116===_0xd89b('0x58')?!![]:_0x214116===_0xd89b('0x59')?![]:![];this[_0xd89b('0x4')](_0xd89b('0x5a'),_0x49ce5b);}else{this[_0xd89b('0x4')](_0xd89b('0x5a'),_0x214116);}}},'blocked':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![],'set':function(_0x50a458){this['setDataValue'](_0xd89b('0x5b'),_0x50a458);if(_0x50a458===!![]){this['setDataValue'](_0xd89b('0x5c'),moment());this[_0xd89b('0x4')]('loginAttempts',0x0);}else{this[_0xd89b('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xd89b('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd89b('0x17')](0x5)[_0xd89b('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xd89b('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xd89b('0x17')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8602=['The\x20name\x20of\x20the\x20user','fullname','format','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','DATE','BOOLEAN','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','encryption','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','icesupport','/etc/pki/tls/certs/motion.crt','permissions','phoneBarEnableScreenRecordingByAgent','string','screenrecording','blocked','blockedAt','loginAttempts','moment','lodash','exports','STRING','name','setDataValue'];(function(_0x1a7697,_0x469f4e){var _0x4d2dc8=function(_0x1f6849){while(--_0x1f6849){_0x1a7697['push'](_0x1a7697['shift']());}};_0x4d2dc8(++_0x469f4e);}(_0x8602,0x1a8));var _0x2860=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x8602[_0x585d81];return _0x1aca0d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2860('0x0'));var util=require('util');var _=require(_0x2860('0x1'));module[_0x2860('0x2')]={'name':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'unique':_0x2860('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x53e95a){this[_0x2860('0x5')](_0x2860('0x4'),_0x53e95a);this[_0x2860('0x5')]('defaultuser',_0x53e95a);},'comment':_0x2860('0x6')},'fullname':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'set':function(_0x14fad0){this[_0x2860('0x5')](_0x2860('0x7'),_0x14fad0);this[_0x2860('0x5')]('callerid',util[_0x2860('0x8')]('\x22%s\x22\x20<%s>',_0x14fad0,this['getDataValue'](_0x2860('0x9'))));}},'alias':{'type':Sequelize[_0x2860('0x3')]},'email':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'unique':_0x2860('0xa'),'validate':{'isEmail':!![]},'set':function(_0x122c8d){if(_0x122c8d){this[_0x2860('0x5')](_0x2860('0xa'),_0x122c8d[_0x2860('0xb')]());}}},'role':{'type':Sequelize[_0x2860('0xc')](_0x2860('0xd'),_0x2860('0xe'),_0x2860('0xf'),_0x2860('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x2860('0x11')},'internal':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':![],'unique':_0x2860('0x9'),'set':function(_0x3487a6){this[_0x2860('0x5')](_0x2860('0x9'),_0x3487a6);this[_0x2860('0x5')](_0x2860('0x13'),_0x3487a6);this[_0x2860('0x5')]('callerid',util[_0x2860('0x8')](_0x2860('0x14'),this[_0x2860('0x15')]('fullname'),_0x3487a6));}},'salt':{'type':Sequelize[_0x2860('0x3')]},'phone':{'type':Sequelize[_0x2860('0x3')]},'mobile':{'type':Sequelize[_0x2860('0x3')]},'address':{'type':Sequelize[_0x2860('0x3')]},'zipcode':{'type':Sequelize[_0x2860('0x3')]},'userpic':{'type':Sequelize[_0x2860('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2860('0x16')]},'voicePause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2860('0x3')],'defaultValue':_0x2860('0x18')},'lastPauseAt':{'type':Sequelize[_0x2860('0x16')]},'chatCapacity':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2860('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2860('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x2860('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x19'),_0x2860('0xe'),_0x2860('0x1a')),'allowNull':!![],'defaultValue':_0x2860('0x19')},'context':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':_0x2860('0x1b')},'callingpres':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x1c'),_0x2860('0x1d'),_0x2860('0x1e'),_0x2860('0x1f'),_0x2860('0x20'),_0x2860('0x21'),_0x2860('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':_0x2860('0x23'),'set':function(_0x132f86){this[_0x2860('0x5')]('transport',_0x132f86?_0x132f86[_0x2860('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x2860('0x25'))?this[_0x2860('0x15')]('transport')['split'](','):null;},'comment':_0x2860('0x26')},'dtmfmode':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x27'),_0x2860('0x28'),_0x2860('0x29'),'inband','auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x2b'),_0x2860('0x2c'),_0x2860('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':_0x2860('0x2e'),'set':function(_0x1eaa30){this[_0x2860('0x5')](_0x2860('0x2f'),_0x1eaa30?_0x1eaa30['join'](','):null);},'get':function(){return this[_0x2860('0x15')]('nat')?this[_0x2860('0x15')]('nat')['split'](','):null;},'comment':_0x2860('0x30')},'callgroup':{'type':Sequelize[_0x2860('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x2860('0x3')]},'language':{'type':Sequelize[_0x2860('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2860('0x3')]},'disallow':{'type':Sequelize[_0x2860('0x3')],'allowNull':![],'defaultValue':_0x2860('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x21a98e){this['setDataValue'](_0x2860('0x32'),_0x21a98e?_0x21a98e[_0x2860('0x24')](';'):_0x2860('0x33'));},'get':function(){return this['getDataValue'](_0x2860('0x32'))?this['getDataValue']('allow')[_0x2860('0x34')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x2860('0xc')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'set':function(_0x2cfe8c){this[_0x2860('0x5')](_0x2860('0x35'),_0x2cfe8c?_0x2cfe8c['join'](','):null);},'get':function(){return this[_0x2860('0x15')](_0x2860('0x35'))?this['getDataValue']('insecure')[_0x2860('0x34')](','):null;},'comment':_0x2860('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2860('0xc')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x2860('0x38'),'refuse',_0x2860('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x2860('0x3a'),_0x2860('0x3b')),'allowNull':!![],'defaultValue':_0x2860('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2860('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x3c'),_0x2860('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x3e'),_0x2860('0x3f'),_0x2860('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2860('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x2860('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no',_0x2860('0x2b'),_0x2860('0x2c'),_0x2860('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x2860('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2860('0x42')]},'showWebBar':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0,'set':function(_0x2b03fc){this[_0x2860('0x5')]('showWebBar',_0x2b03fc);var _0x3a510c=this[_0x2860('0x43')]({'plain':!![]});switch(_0x2b03fc){case 0x0:case 0x1:var _0x1da545=_0x3a510c[_0x2860('0x25')]?_['isArray'](_0x3a510c[_0x2860('0x25')])?_0x3a510c[_0x2860('0x25')]['join']():_0x3a510c['transport']:_0x2860('0x23');if(_0x1da545==='wss'){_0x1da545='udp';}this[_0x2860('0x5')]('transport',_0x1da545);this[_0x2860('0x5')](_0x2860('0x44'),'no');this[_0x2860('0x5')]('avpf',null);this[_0x2860('0x5')](_0x2860('0x45'),null);this['setDataValue']('icesupport',null);this[_0x2860('0x5')](_0x2860('0x46'),null);this['setDataValue'](_0x2860('0x47'),null);this[_0x2860('0x5')](_0x2860('0x48'),null);this['setDataValue'](_0x2860('0x49'),null);this[_0x2860('0x5')](_0x2860('0x4a'),null);this['setDataValue'](_0x2860('0x4b'),'no');break;case 0x2:this[_0x2860('0x5')]('transport',_0x2860('0x4c'));this[_0x2860('0x5')](_0x2860('0x44'),_0x2860('0x2a'));this[_0x2860('0x5')]('avpf',_0x2860('0x2a'));this[_0x2860('0x5')](_0x2860('0x45'),_0x2860('0x2a'));this[_0x2860('0x5')](_0x2860('0x4d'),'yes');this[_0x2860('0x5')](_0x2860('0x46'),_0x2860('0x2a'));this[_0x2860('0x5')](_0x2860('0x47'),'no');this[_0x2860('0x5')](_0x2860('0x48'),_0x2860('0x40'));this['setDataValue'](_0x2860('0x49'),_0x3a510c[_0x2860('0x49')]||_0x2860('0x4e'));this[_0x2860('0x5')](_0x2860('0x4a'),_0x3a510c[_0x2860('0x4a')]||'/etc/pki/tls/private/motion.key');this[_0x2860('0x5')]('rtcp_mux',_0x2860('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x2860('0x42')],'set':function(_0x3ff830){this[_0x2860('0x5')](_0x2860('0x4f'),_0x3ff830?_0x3ff830[_0x2860('0x24')](','):[]);},'get':function(){return this[_0x2860('0x15')](_0x2860('0x4f'))?_['map'](this[_0x2860('0x15')]('permissions')['split'](','),function(_0xa68e07){return parseInt(_0xa68e07,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2860('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2860('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2860('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2860('0xc')](_0x2860('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2860('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2860('0x15')](_0x2860('0x50'))?this[_0x2860('0x15')](_0x2860('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x2860('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2860('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![],'set':function(_0x532547){if(typeof _0x532547===_0x2860('0x51')){var _0x31432d=_0x532547==='1'?!![]:_0x532547==='0'?![]:_0x532547==='true'?!![]:_0x532547==='false'?![]:![];this[_0x2860('0x5')](_0x2860('0x52'),_0x31432d);}else{this['setDataValue'](_0x2860('0x52'),_0x532547);}}},'blocked':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![],'set':function(_0x3b7d5b){this[_0x2860('0x5')](_0x2860('0x53'),_0x3b7d5b);if(_0x3b7d5b===!![]){this[_0x2860('0x5')](_0x2860('0x54'),moment());this[_0x2860('0x5')](_0x2860('0x55'),0x0);}else{this[_0x2860('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x2860('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2860('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x2860('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x2860('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a07ea45..9b84960 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 _0xb47a=['concat','User\x20with\x20id\x20%s\x20not\x20found','List','Tag','Tags','tag','findAll','model','Queue','keys','filters','intersection','order','sort','where','pick','Unknown\x20role','hasOwnProperty','nolimit','options','getVoiceQueuesRt','getGroups','ChatGroup','fields','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','resolve','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','Team','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','getAssociatedQueues','getDataValue','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','removeAgent','VoicePrefixId','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$notILike','$contained','$any','firstName','CmContact','Contact','VoiceQueue','getApiKey','retrieveApiKey','token','generateApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','ringing','queues','inbound','getAgents','flatten','toString','lower','col','asc','desc','uniqBy','getRealtimeAgents','offline','voiceStatus','unavailable','slice','toUpperCase','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','agent','emit','userNotification:recalc:','destroy','admin','user','Agents','Telephones','telephone','filter','ignore','map','value','role','UserProfileResource','end','error','stack','name','send','User','rawAttributes','type','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','includes','getOptions','query','include','userSetting','attributes','push','rows','openTabs','true','length','chat','dataValues','sms','mail','whatsapp','all','catch','show','params','includeAll','merge','find','openchannel','fax','body','describe','addContacts','omit','ids','internal','findById','securePassword','validatePasswordPattern','max','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','109','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','passwordHistoryLimit','enforcePasswordHistory','addQueues','online','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','get','voice','format','SIP/%s','voicePause','UserVoiceQueueRt','removeQueues','channel','remove','isArray','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP'];(function(_0x1951b7,_0x4bfa73){var _0x3965a7=function(_0xed0b2){while(--_0xed0b2){_0x1951b7['push'](_0x1951b7['shift']());}};_0x3965a7(++_0x4bfa73);}(_0xb47a,0xc2));var _0xab47=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xb47a[_0x4b73a2];return _0x383c66;};'use strict';var moment=require(_0xab47('0x0'));var util=require(_0xab47('0x1'));var path=require(_0xab47('0x2'));var fs=require('fs');var _=require(_0xab47('0x3'));var squel=require(_0xab47('0x4'));var Redis=require(_0xab47('0x5'));var authService=require(_0xab47('0x6'));var contacts=require(_0xab47('0x7'));var qs=require('../../components/parsers/qs');var rta=require(_0xab47('0x8'));var logger=require(_0xab47('0x9'))(_0xab47('0xa'));var utils=require(_0xab47('0xb'));var config=require(_0xab47('0xc'));var licenseUtil=require(_0xab47('0xd'));var APIBadRequestError=require(_0xab47('0xe'))['APIBadRequestError'];var APINotFoundError=require(_0xab47('0xe'))[_0xab47('0xf')];var APIHandleError=require(_0xab47('0xe'))[_0xab47('0x10')];var db=require(_0xab47('0x11'))['db'];var socket=require(_0xab47('0x12'))(new Redis(config[_0xab47('0x13')]));require(_0xab47('0x14'))[_0xab47('0x15')](socket);config[_0xab47('0x13')]=_[_0xab47('0x16')](config[_0xab47('0x13')],{'host':_0xab47('0x17'),'port':0x18eb});var values;function respondWithStatusCode(_0x1929c4,_0x976be8){_0x976be8=_0x976be8||0xcc;return function(_0x42e65c){if(_0x42e65c){return _0x1929c4[_0xab47('0x18')](_0x976be8);}return _0x1929c4['status'](_0x976be8)['end']();};}function respondWithResult(_0x52a784,_0x20e70a){_0x20e70a=_0x20e70a||0xc8;return function(_0x4d3cf4){if(_0x4d3cf4){return _0x52a784[_0xab47('0x19')](_0x20e70a)[_0xab47('0x1a')](_0x4d3cf4);}};}function respondWithFilteredResult(_0x39dd16,_0x532149){return function(_0x4af4de){if(_0x4af4de){var _0x509ad2=typeof _0x532149[_0xab47('0x1b')]===_0xab47('0x1c')&&typeof _0x532149[_0xab47('0x1d')]===_0xab47('0x1c');var _0x1e2f57=_0x4af4de[_0xab47('0x1e')];var _0x1c1730=_0x509ad2?0x0:_0x532149[_0xab47('0x1b')];var _0x4207a5=_0x509ad2?_0x4af4de[_0xab47('0x1e')]:_0x532149['offset']+_0x532149[_0xab47('0x1d')];var _0x1a2d61;if(_0x4207a5>=_0x1e2f57){_0x4207a5=_0x1e2f57;_0x1a2d61=0xc8;}else{_0x1a2d61=0xce;}_0x39dd16[_0xab47('0x19')](_0x1a2d61);return _0x39dd16[_0xab47('0x1f')](_0xab47('0x20'),_0x1c1730+'-'+_0x4207a5+'/'+_0x1e2f57)[_0xab47('0x1a')](_0x4af4de);}return null;};}function saveUpdates(_0x4f9960){return function(_0x47ccba){if(_0x47ccba){return _0x47ccba[_0xab47('0x21')](_0x4f9960)[_0xab47('0x22')](function(_0x8d0b96){if(_0x8d0b96['role']===_0xab47('0x23')){socket[_0xab47('0x24')](_0xab47('0x25')+_0x8d0b96['id'],_0x8d0b96);}return _0x8d0b96;});}return null;};}function removeEntity(_0x11d9b8){return function(_0x1b79bd){if(_0x1b79bd){return _0x1b79bd[_0xab47('0x26')]()[_0xab47('0x22')](function(){var _0x4778fd=_0x1b79bd['get']({'plain':!![]});if(_0x4778fd['role']===_0xab47('0x27'))return;var _0x4cee92=[{'name':'Users','value':_0xab47('0x28'),'ignore':!![]},{'name':_0xab47('0x29'),'value':_0xab47('0x23'),'ignore':![]},{'name':_0xab47('0x2a'),'value':_0xab47('0x2b'),'ignore':![]}];var _0x182cc8=_(_0x4cee92)[_0xab47('0x2c')](_0xab47('0x2d'))[_0xab47('0x2e')](_0xab47('0x2f'))[_0xab47('0x2f')]();if(_['includes'](_0x182cc8,_0x4778fd[_0xab47('0x30')])){return;}var _0x9abe93=_['find'](_0x4cee92,[_0xab47('0x2f'),_0x4778fd[_0xab47('0x30')]])['name'];return db[_0xab47('0x31')]['destroy']({'where':{'type':_0x9abe93,'resourceId':_0x4778fd['id']}})['then'](function(){return _0x1b79bd;});})[_0xab47('0x22')](function(){_0x11d9b8[_0xab47('0x19')](0xcc)[_0xab47('0x32')]();});}};}function handleEntityNotFound(_0x2c23de){return function(_0xf747cc){if(!_0xf747cc){_0x2c23de[_0xab47('0x18')](0x194);}return _0xf747cc;};}function handleError(_0x12b62d,_0x33963a){_0x33963a=_0x33963a||0x1f4;return function(_0x177b39){logger[_0xab47('0x33')](_0x177b39[_0xab47('0x34')]);if(_0x177b39['name']){delete _0x177b39[_0xab47('0x35')];}_0x12b62d['status'](_0x33963a)[_0xab47('0x36')](_0x177b39);};}function getUserAttributes(){return _(db[_0xab47('0x37')][_0xab47('0x38')])['map'](function(_0x1a9d04){return{'name':_0x1a9d04['fieldName'],'type':_0x1a9d04[_0xab47('0x39')]['key']};})[_0xab47('0x2c')](function(_0x241881){return![_0xab47('0x3a'),_0xab47('0x3b'),_0xab47('0x3c'),_0xab47('0x3d'),_0xab47('0x3e'),_0xab47('0x3f')][_0xab47('0x40')](_0x241881[_0xab47('0x35')]);})[_0xab47('0x2f')]();}exports['index']=function(_0x4bef4a,_0x243a8a){var _0x49e4c9={},_0x26962e={'count':0x0,'rows':[]};var _0x20dccd=getUserAttributes();_0x49e4c9=qs[_0xab47('0x41')](_0x20dccd,_0x4bef4a);var _0x3ff6a5={'where':_0x49e4c9['where']};return db['User'][_0xab47('0x1e')](_0x3ff6a5)[_0xab47('0x22')](function(_0x592620){_0x26962e[_0xab47('0x1e')]=_0x592620;if(_0x4bef4a[_0xab47('0x42')]['includeAll']){_0x49e4c9[_0xab47('0x43')]=[{'all':!![]}];}if(_0x4bef4a['query'][_0xab47('0x44')]==='true'){_0x49e4c9[_0xab47('0x43')]=[{'model':db['UserSetting'],'as':_0xab47('0x44')}];}if(!_[_0xab47('0x40')](_0x49e4c9[_0xab47('0x45')],'id')){_0x49e4c9[_0xab47('0x45')][_0xab47('0x46')]('id');}return db[_0xab47('0x37')]['findAll'](_0x49e4c9);})[_0xab47('0x22')](function(_0x14c62f){_0x26962e[_0xab47('0x47')]=_0x14c62f;if(_0x4bef4a[_0xab47('0x42')][_0xab47('0x48')]===_0xab47('0x49')){var _0x27997c=[];for(var _0x599781=0x0;_0x599781<_0x26962e[_0xab47('0x47')][_0xab47('0x4a')];_0x599781++){_0x27997c[_0xab47('0x46')](get_open_tabs(_0xab47('0x4b'),_0x26962e['rows'][_0x599781][_0xab47('0x4c')]));_0x27997c[_0xab47('0x46')](get_open_tabs(_0xab47('0x4d'),_0x26962e[_0xab47('0x47')][_0x599781][_0xab47('0x4c')]));_0x27997c[_0xab47('0x46')](get_open_tabs('fax',_0x26962e[_0xab47('0x47')][_0x599781][_0xab47('0x4c')]));_0x27997c[_0xab47('0x46')](get_open_tabs(_0xab47('0x4e'),_0x26962e[_0xab47('0x47')][_0x599781][_0xab47('0x4c')]));_0x27997c[_0xab47('0x46')](get_open_tabs('openchannel',_0x26962e[_0xab47('0x47')][_0x599781][_0xab47('0x4c')]));_0x27997c['push'](get_open_tabs(_0xab47('0x4f'),_0x26962e['rows'][_0x599781][_0xab47('0x4c')]));}return Promise[_0xab47('0x50')](_0x27997c)[_0xab47('0x22')](function(){return _0x26962e;});}else{return _0x26962e;}})[_0xab47('0x22')](respondWithFilteredResult(_0x243a8a,_0x49e4c9))[_0xab47('0x51')](handleError(_0x243a8a,null));};exports[_0xab47('0x52')]=function(_0x2f4ee0,_0x54f499){var _0x374f28=getUserAttributes();_0x2f4ee0['query']['id']=_0x2f4ee0[_0xab47('0x53')]['id'];var _0x1ec39a=qs[_0xab47('0x41')](_0x374f28,_0x2f4ee0);if(_0x2f4ee0[_0xab47('0x42')][_0xab47('0x54')]){_0x1ec39a[_0xab47('0x43')]=[{'all':!![]}];}if(_0x2f4ee0[_0xab47('0x42')][_0xab47('0x44')]===_0xab47('0x49')){_0x1ec39a[_0xab47('0x43')]=[{'model':db['UserSetting'],'as':_0xab47('0x44')}];}_0x1ec39a=_[_0xab47('0x55')]({},_0x1ec39a,_0x2f4ee0['options']);if(!_[_0xab47('0x40')](_0x1ec39a[_0xab47('0x45')],'id')){_0x1ec39a['attributes'][_0xab47('0x46')]('id');}return db[_0xab47('0x37')][_0xab47('0x56')](_0x1ec39a)[_0xab47('0x22')](handleEntityNotFound(_0x54f499,null))[_0xab47('0x22')](function(_0x56dc2d){var _0x1db3f8=[];values=_0x56dc2d;if(_0x2f4ee0[_0xab47('0x42')][_0xab47('0x48')]===_0xab47('0x49')){_0x1db3f8[_0xab47('0x46')](get_open_tabs(_0xab47('0x4b'),_0x56dc2d['dataValues']));_0x1db3f8[_0xab47('0x46')](get_open_tabs(_0xab47('0x4d'),_0x56dc2d[_0xab47('0x4c')]));_0x1db3f8[_0xab47('0x46')](get_open_tabs(_0xab47('0x57'),_0x56dc2d[_0xab47('0x4c')]));_0x1db3f8[_0xab47('0x46')](get_open_tabs(_0xab47('0x4f'),_0x56dc2d[_0xab47('0x4c')]));_0x1db3f8[_0xab47('0x46')](get_open_tabs(_0xab47('0x58'),_0x56dc2d[_0xab47('0x4c')]));_0x1db3f8[_0xab47('0x46')](get_open_tabs(_0xab47('0x4e'),_0x56dc2d[_0xab47('0x4c')]));return Promise['all'](_0x1db3f8);}else{return values;}})[_0xab47('0x22')](function(){return values;})[_0xab47('0x22')](respondWithResult(_0x54f499,null))[_0xab47('0x51')](handleError(_0x54f499,null));};exports[_0xab47('0x21')]=function(_0x1a1e4e,_0x2b535f){if(_0x1a1e4e[_0xab47('0x59')]['id']){delete _0x1a1e4e[_0xab47('0x59')]['id'];}delete _0x1a1e4e[_0xab47('0x59')][_0xab47('0x30')];return db['User'][_0xab47('0x56')]({'where':{'id':_0x1a1e4e[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x2b535f,null))[_0xab47('0x22')](saveUpdates(_0x1a1e4e[_0xab47('0x59')],null))[_0xab47('0x22')](respondWithResult(_0x2b535f,null))[_0xab47('0x51')](handleError(_0x2b535f,null));};exports[_0xab47('0x5a')]=function(_0x35abe1,_0x541761){return db[_0xab47('0x37')]['describe']()[_0xab47('0x22')](respondWithResult(_0x541761,null))[_0xab47('0x51')](handleError(_0x541761,null));};exports['addContacts']=function(_0x5ac2be,_0x15b235){return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x5ac2be[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x15b235,null))[_0xab47('0x22')](function(_0xc5723d){if(_0xc5723d){return _0xc5723d[_0xab47('0x5b')](_0x5ac2be[_0xab47('0x59')]['ids'],_[_0xab47('0x5c')](_0x5ac2be['body'],[_0xab47('0x5d'),'id'])||{});}})[_0xab47('0x22')](respondWithResult(_0x15b235,null))[_0xab47('0x51')](handleError(_0x15b235,null));};function validateUser(_0x6ee9e){return new Promise(function(_0xec195f,_0x12ae9b){if(_0x6ee9e[_0xab47('0x5e')])return _0xec195f(_0x6ee9e);return db['Setting'][_0xab47('0x5f')](0x1)[_0xab47('0x22')](function(_0x3e2a1d){if(_0x3e2a1d[_0xab47('0x60')])authService[_0xab47('0x61')](_0x6ee9e[_0xab47('0x3a')]);db[_0xab47('0x37')][_0xab47('0x62')](_0xab47('0x5e'))[_0xab47('0x22')](function(_0x445fbe){if(_['isNil'](_0x445fbe)){_0x6ee9e[_0xab47('0x5e')]=_0x3e2a1d[_0xab47('0x63')]||0x1;return;}if(_[_0xab47('0x64')](_0x3e2a1d[_0xab47('0x63')])||_0x3e2a1d[_0xab47('0x63')]===_0x445fbe){_0x6ee9e['internal']=_0x445fbe+0x1;return;}if(_0x3e2a1d['min_internal']>_0x445fbe){_0x6ee9e['internal']=_0x3e2a1d['min_internal'];return;}return db[_0xab47('0x65')][_0xab47('0x42')](_0xab47('0x66'),{'type':db[_0xab47('0x65')][_0xab47('0x67')][_0xab47('0x68')]})[_0xab47('0x22')](function(_0x540bbb){if(_0x540bbb&&_0x540bbb['length']){for(var _0x1b476d=0x0,_0x4dc2bb=_0x540bbb[_0xab47('0x4a')];_0x1b476d<_0x4dc2bb&&_['isNil'](_0x6ee9e[_0xab47('0x5e')]);_0x1b476d++){if(_0x3e2a1d[_0xab47('0x63')]<=_0x540bbb[_0x1b476d][_0xab47('0x69')]){_0x6ee9e[_0xab47('0x5e')]=_0x540bbb[_0x1b476d][_0xab47('0x69')];}else if(_0x3e2a1d[_0xab47('0x63')]>_0x540bbb[_0x1b476d]['from']&&_0x3e2a1d[_0xab47('0x63')]<=_0x540bbb[_0x1b476d]['to']){_0x6ee9e[_0xab47('0x5e')]=_0x3e2a1d[_0xab47('0x63')];}}}if(_[_0xab47('0x64')](_0x6ee9e['internal'])){_0x6ee9e[_0xab47('0x5e')]=_0x445fbe+0x1;}return _0xec195f(_0x6ee9e);});});})[_0xab47('0x51')](function(_0x39b6ba){_0x12ae9b(_0x39b6ba);});});}function updateUser(_0x374069){return new Promise(function(_0x37c13d,_0x547fc8){try{if(_0x374069[_0xab47('0x6a')]){_0x374069[_0xab47('0x6b')]=_0x374069[_0xab47('0x5e')];_0x374069[_0xab47('0x6c')]={'mailbox':_0x374069[_0xab47('0x5e')],'password':_0x374069[_0xab47('0x3a')],'fullname':_0x374069[_0xab47('0x6d')],'email':_0x374069[_0xab47('0x6e')]};}if(_0x374069['role']===_0xab47('0x23')){if(!_0x374069[_0xab47('0x6f')])_0x374069['permissions']=[_0xab47('0x70'),_0xab47('0x71'),_0xab47('0x72'),_0xab47('0x73'),_0xab47('0x74'),_0xab47('0x75'),_0xab47('0x76'),'106','107','108',_0xab47('0x77'),_0xab47('0x78'),'111',_0xab47('0x79'),_0xab47('0x7a')];}_0x37c13d(_0x374069);}catch(_0x275793){_0x547fc8(_0x275793);}});}exports[_0xab47('0x7b')]=function(_0x11f8f7,_0x39ada5){if(_0x11f8f7['user'][_0xab47('0x30')]==='agent')throw new Error(_0xab47('0x7c'));if(_0x11f8f7['body'][_0xab47('0x30')]==='user'&&_0x11f8f7[_0xab47('0x28')][_0xab47('0x30')]!==_0xab47('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x11f8f7[_0xab47('0x59')][_0xab47('0x30')]===_0xab47('0x27')&&_0x11f8f7[_0xab47('0x28')][_0xab47('0x30')]!==_0xab47('0x27')){throw new Error(_0xab47('0x7d'));}return licenseUtil[_0xab47('0x7e')]([_0x11f8f7[_0xab47('0x59')]])[_0xab47('0x22')](function(){return validateUser(_0x11f8f7[_0xab47('0x59')]);})['then'](function(_0x414a6a){return updateUser(_0x414a6a)[_0xab47('0x22')](function(_0x4c85b4){if(_0x4c85b4[_0xab47('0x30')]===_0xab47('0x27')){_0x4c85b4['settingsEnabled']=_0x11f8f7[_0xab47('0x28')][_0xab47('0x7f')];delete _0x4c85b4[_0xab47('0x80')];}return _0x4c85b4;});})[_0xab47('0x22')](function(_0x718b21){return db[_0xab47('0x37')][_0xab47('0x7b')](_0x718b21,{'include':[{'model':db[_0xab47('0x6c')],'as':_0xab47('0x6c')}]});})['then'](function(_0x8cbdec){if(_0x11f8f7[_0xab47('0x59')][_0xab47('0x30')]===_0xab47('0x28'))return _0x8cbdec;if(_0x11f8f7[_0xab47('0x28')][_0xab47('0x30')]!==_0xab47('0x28'))return _0x8cbdec;return db[_0xab47('0x81')][_0xab47('0x56')]({'where':{'name':_0x8cbdec[_0xab47('0x30')]===_0xab47('0x23')?'Agents':_0xab47('0x2a'),'userProfileId':_0x11f8f7['user'][_0xab47('0x80')]},'raw':!![]})[_0xab47('0x22')](function(_0x1753ae){if(!_0x1753ae||_0x1753ae[_0xab47('0x82')]!=0x0)return _0x8cbdec;return db['UserProfileResource'][_0xab47('0x7b')]({'name':_0x8cbdec['name'],'resourceId':_0x8cbdec['id'],'type':_0x1753ae[_0xab47('0x35')],'sectionId':_0x1753ae['id']},{})[_0xab47('0x22')](function(){return _0x8cbdec;});})[_0xab47('0x51')](function(_0x4a49db){logger[_0xab47('0x33')](_0xab47('0x83'),_0x4a49db);throw _0x4a49db;});})[_0xab47('0x22')](respondWithResult(_0x39ada5,0xc9))[_0xab47('0x51')](handleError(_0x39ada5,null));};exports[_0xab47('0x84')]=function(_0x567313,_0x4c288e){var _0x6ce203=_0x567313['body'];var _0x388795=[];if(_0x567313[_0xab47('0x28')][_0xab47('0x30')]==='agent')throw new Error(_0xab47('0x7c'));if(_[_0xab47('0x85')](_0x6ce203,[_0xab47('0x30'),_0xab47('0x28')])&&_0x567313[_0xab47('0x28')][_0xab47('0x30')]!==_0xab47('0x27')){throw new Error(_0xab47('0x86'));}if(_[_0xab47('0x85')](_0x6ce203,['role',_0xab47('0x27')])&&_0x567313['user'][_0xab47('0x30')]!=='admin'){throw new Error(_0xab47('0x87'));}return licenseUtil[_0xab47('0x7e')](_0x6ce203)[_0xab47('0x22')](function(){return validateUser(_0x6ce203[0x0]);})[_0xab47('0x22')](function(){for(var _0x49ace6=0x1;_0x49ace6<_0x6ce203[_0xab47('0x4a')];_0x49ace6++){var _0x194133=_0x6ce203[_0x49ace6-0x1]['internal'];if(!_0x6ce203[_0x49ace6]['internal'])_0x6ce203[_0x49ace6][_0xab47('0x5e')]=_0x194133+0x1;_0x388795[_0xab47('0x46')](validateUser(_0x6ce203[_0x49ace6]));}return Promise['all'](_0x388795);})[_0xab47('0x22')](function(){_0x388795=[];for(var _0x89c24c=0x0;_0x89c24c<_0x6ce203[_0xab47('0x4a')];_0x89c24c++){_0x388795[_0xab47('0x46')](updateUser(_0x6ce203[_0x89c24c]));}return Promise[_0xab47('0x50')](_0x388795);})[_0xab47('0x22')](function(){_0x388795=_0x6ce203[_0xab47('0x2e')](function(_0x5e9b5a){return db[_0xab47('0x37')][_0xab47('0x7b')](_0x5e9b5a,{'include':[{'model':db[_0xab47('0x6c')],'as':_0xab47('0x6c')}]})['then'](function(_0x4e631f){_0x5e9b5a['id']=_0x4e631f['id'];return _0x5e9b5a;});});return Promise['all'](_0x388795);})[_0xab47('0x22')](function(_0x1c47de){if(_0x567313['body']['role']===_0xab47('0x28'))return _0x1c47de;if(_0x567313['user'][_0xab47('0x30')]!==_0xab47('0x28'))return _0x1c47de;var _0x253904=_[_0xab47('0x85')](_0x1c47de,function(_0x5da088){return _0x5da088[_0xab47('0x30')]==='agent'||_0x5da088['role']==='telephone';});if(!_0x253904)return _0x1c47de;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xab47('0x29'),_0xab47('0x2a')]},'userProfileId':_0x567313[_0xab47('0x28')][_0xab47('0x80')]},'raw':!![]})[_0xab47('0x22')](function(_0x4b6d81){if(_[_0xab47('0x88')](_0x4b6d81)||!_[_0xab47('0x85')](_0x4b6d81,[_0xab47('0x82'),0x0]))return _0x1c47de;_0x388795=[];var _0x5e637e=_(_0x4b6d81)[_0xab47('0x2e')](function(_0x1b3c2e){if(_0x1b3c2e[_0xab47('0x82')]===0x1)return;return _0x1b3c2e[_0xab47('0x35')]===_0xab47('0x29')?'agent':_0xab47('0x2b');})[_0xab47('0x89')]()[_0xab47('0x2f')]();for(var _0x2612ce=0x0;_0x2612ce<_0x1c47de[_0xab47('0x4a')];_0x2612ce++){if(!_[_0xab47('0x40')](_0x5e637e,_0x1c47de[_0x2612ce][_0xab47('0x30')]))return;var _0x24fa04=_0x1c47de[_0x2612ce][_0xab47('0x30')]===_0xab47('0x23')?_0xab47('0x29'):_0xab47('0x2a');_0x388795['push'](db[_0xab47('0x31')][_0xab47('0x7b')]({'name':_0x1c47de[_0x2612ce][_0xab47('0x35')],'resourceId':_0x1c47de[_0x2612ce]['id'],'type':_0x24fa04,'sectionId':_[_0xab47('0x56')](_0x4b6d81,[_0xab47('0x35'),_0x24fa04])['id']},{}));}return Promise['all'](_0x388795);});})[_0xab47('0x22')](respondWithResult(_0x4c288e,0xc9))[_0xab47('0x51')](handleError(_0x4c288e,null));};exports[_0xab47('0x8a')]=function(_0x25e26b,_0x3a805d){if(_0x25e26b[_0xab47('0x59')]['id']){delete _0x25e26b['body']['id'];}return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x25e26b[_0xab47('0x53')]['id']}})[_0xab47('0x22')](function(_0x2db4e4){if(!_0x2db4e4)return null;if(_0x2db4e4['id']===_0x25e26b['user']['id']){if(!_0x25e26b[_0xab47('0x59')][_0xab47('0x8b')]||!_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')]){throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0x8f'));}if(!_0x2db4e4['authenticate'](_0x25e26b['body'][_0xab47('0x8b')])){throw new db[(_0xab47('0x8d'))]['ValidationError'](_0xab47('0x90'));}if(_0x25e26b[_0xab47('0x59')][_0xab47('0x8b')]===_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')]){throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0x91'));}}else if(_0x25e26b['user']['role']===_0xab47('0x27')){if(!_0x25e26b[_0xab47('0x59')]['newPassword']){throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x25e26b[_0xab47('0x28')][_0xab47('0x30')]==='user'){if(!_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')]){throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0x92'));}if(_0x2db4e4[_0xab47('0x30')]!==_0xab47('0x23')){throw new db[(_0xab47('0x8d'))]['ValidationError'](_0xab47('0x7c'));}}else{throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))]('Unauthorized');}return _0x2db4e4;})[_0xab47('0x22')](handleEntityNotFound(_0x3a805d,null))[_0xab47('0x22')](function(_0x5299e0){return db[_0xab47('0x93')][_0xab47('0x94')]({'attributes':['id',_0xab47('0x60'),'enforcePasswordHistory',_0xab47('0x95')]})[_0xab47('0x22')](function(_0x30f522){if(_0x30f522[_0xab47('0x60')])authService[_0xab47('0x61')](_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')]);if(!_0x30f522[_0xab47('0x96')]||!_0x5299e0[_0xab47('0x3c')])return _0x5299e0;authService['validatePasswordHistory'](_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')],_0x5299e0[_0xab47('0x3c')],_0x30f522[_0xab47('0x95')]);return _0x5299e0;})[_0xab47('0x22')](saveUpdates({'password':_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')],'passwordResetAt':_0x25e26b['user']['id']==_0x25e26b['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x25e26b[_0xab47('0x59')][_0xab47('0x8c')],_0x5299e0[_0xab47('0x3c')])},null));})[_0xab47('0x22')](respondWithResult(_0x3a805d,null))[_0xab47('0x51')](handleError(_0x3a805d,null));};exports[_0xab47('0x97')]=function(_0x54a162,_0x225c12){var _0x350ae2=_0x54a162[_0xab47('0x59')]['channel'];return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x54a162[_0xab47('0x53')]['id']},'attributes':['id',_0xab47('0x35'),_0xab47('0x30'),_0xab47('0x98'),'loginInPause','voicePause',_0xab47('0x99')]})[_0xab47('0x22')](handleEntityNotFound(_0x225c12,null))['then'](function(_0x493daf){if(_0x493daf){if(!utils[_0xab47('0x9a')](_0x350ae2)){throw new db[(_0xab47('0x8d'))]['ValidationError'](_0xab47('0x9b'));}return _0x493daf[_0xab47('0x9c')+_[_0xab47('0x9d')](_0x350ae2[_0xab47('0x9e')]())+_0xab47('0x9f')](_0x54a162[_0xab47('0x59')][_0xab47('0x5d')],{'penalty':_0x54a162[_0xab47('0x59')][_0xab47('0xa0')]||0x0})[_0xab47('0xa1')](function(_0x29011b){for(var _0x2e975f=0x0;_0x2e975f<_0x54a162[_0xab47('0x59')]['ids'][_0xab47('0x4a')];_0x2e975f+=0x1){var _0x4dbc17={'UserId':Number(_0x54a162[_0xab47('0x53')]['id'])};_0x4dbc17[_['capitalize'](_0x350ae2[_0xab47('0x9e')]())+_0xab47('0xa2')]=Number(_0x54a162[_0xab47('0x59')][_0xab47('0x5d')][_0x2e975f]);socket[_0xab47('0x24')](_0xab47('0x28')+_[_0xab47('0x9d')](_0x350ae2[_0xab47('0x9e')]())+_0xab47('0xa3'),_0x4dbc17);}return _0x29011b;})[_0xab47('0x22')](function(){if(_0x350ae2==='voice'){return db['VoiceQueue']['findAll']({'where':{'id':_0x54a162[_0xab47('0x59')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x1823cd){var _0x52d956=_0x493daf[_0xab47('0xa4')]({'plain':!![]});var _0x17250d=[];if(_0x350ae2===_0xab47('0xa5')&&_0x52d956[_0xab47('0x30')]==='agent'&&_0x52d956['online']){for(let _0x2a3b18=0x0;_0x2a3b18<_0x1823cd[_0xab47('0x4a')];_0x2a3b18+=0x1){_0x17250d[_0xab47('0x46')]({'membername':_0x52d956[_0xab47('0x35')],'UserId':_0x52d956['id'],'queue_name':_0x1823cd[_0x2a3b18][_0xab47('0x35')],'VoiceQueueId':_0x1823cd[_0x2a3b18]['id'],'interface':_[_0xab47('0x64')](_0x52d956[_0xab47('0x99')])?util[_0xab47('0xa6')](_0xab47('0xa7'),_0x52d956[_0xab47('0x35')]):_0x52d956[_0xab47('0x99')],'paused':_0x52d956[_0xab47('0xa8')]||![],'penalty':_0x54a162[_0xab47('0x59')][_0xab47('0xa0')]||0x0});}return Promise['all'](_0x17250d['map'](function(_0x8bc08){return db[_0xab47('0xa9')]['upsert'](_0x8bc08);}));}return _0x493daf;});}})[_0xab47('0x22')](respondWithStatusCode(_0x225c12,null))[_0xab47('0x51')](handleError(_0x225c12,null));};exports[_0xab47('0xaa')]=function(_0x2e1bd3,_0x37e74d){var _0x4b38f6,_0x5d07cd;return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x2e1bd3['params']['id']},'attributes':['id',_0xab47('0x35'),'role']})[_0xab47('0x22')](handleEntityNotFound(_0x37e74d,null))['then'](function(_0x5cb9d7){if(_0x5cb9d7){_0x4b38f6=_0x5cb9d7;if(!_0x2e1bd3[_0xab47('0x42')][_0xab47('0xab')]||!utils['isValidChannel'](_0x2e1bd3['query'][_0xab47('0xab')])){throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0x9b'));}return _0x5cb9d7[_0xab47('0xac')+_[_0xab47('0x9d')](_0x2e1bd3[_0xab47('0x42')]['channel'][_0xab47('0x9e')]())+_0xab47('0x9f')](_0x2e1bd3[_0xab47('0x42')][_0xab47('0x5d')]);}})[_0xab47('0x22')](function(_0x4ce079){if(_[_0xab47('0xad')](_0x2e1bd3[_0xab47('0x42')]['ids'])){for(var _0x5019af=0x0;_0x5019af<_0x2e1bd3[_0xab47('0x42')]['ids'][_0xab47('0x4a')];_0x5019af+=0x1){_0x5d07cd={'UserId':Number(_0x2e1bd3['params']['id'])};_0x5d07cd[_['capitalize'](_0x2e1bd3['query']['channel'][_0xab47('0x9e')]())+_0xab47('0xa2')]=Number(_0x2e1bd3[_0xab47('0x42')][_0xab47('0x5d')][_0x5019af]);socket[_0xab47('0x24')](_0xab47('0x28')+_['capitalize'](_0x2e1bd3[_0xab47('0x42')]['channel']['toLowerCase']())+'Queue:remove',_0x5d07cd);}}else{_0x5d07cd={'UserId':Number(_0x2e1bd3[_0xab47('0x53')]['id'])};_0x5d07cd[_[_0xab47('0x9d')](_0x2e1bd3[_0xab47('0x42')]['channel']['toLowerCase']())+_0xab47('0xa2')]=Number(_0x2e1bd3['query'][_0xab47('0x5d')]);socket[_0xab47('0x24')](_0xab47('0x28')+_[_0xab47('0x9d')](_0x2e1bd3[_0xab47('0x42')][_0xab47('0xab')][_0xab47('0x9e')]())+_0xab47('0xae'),_0x5d07cd);}return _0x4ce079;})[_0xab47('0x22')](function(){if(_0x2e1bd3[_0xab47('0x42')][_0xab47('0xab')]===_0xab47('0xa5')){return db[_0xab47('0xa9')]['destroy']({'where':{'UserId':_0x2e1bd3[_0xab47('0x53')]['id'],'VoiceQueueId':_0x2e1bd3['query']['ids']},'individualHooks':!![]})[_0xab47('0x22')](function(){return _0x4b38f6;});}return _0x4b38f6;})[_0xab47('0x22')](respondWithStatusCode(_0x37e74d,null))[_0xab47('0x51')](handleError(_0x37e74d,null));};exports['addAvatar']=function(_0xa69b,_0x467aaf){_0xa69b[_0xab47('0x59')][_0xab47('0xaf')]=_0xa69b[_0xab47('0xb0')][_0xab47('0xb1')];return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0xa69b[_0xab47('0x53')]['id']}})['then'](handleEntityNotFound(_0x467aaf,null))[_0xab47('0x22')](saveUpdates(_0xa69b[_0xab47('0x59')],null))[_0xab47('0x22')](respondWithResult(_0x467aaf,null))[_0xab47('0x51')](handleError(_0x467aaf,null));};exports[_0xab47('0xb2')]=function(_0x4e6cbf,_0x475e3c){var _0x5470d9=path[_0xab47('0xb3')](config[_0xab47('0xb4')],_0xab47('0xb5'));return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x4e6cbf[_0xab47('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xab47('0x22')](handleEntityNotFound(_0x475e3c,null))[_0xab47('0x22')](function(_0x3127e2){if(_0x3127e2){if(_[_0xab47('0x64')](_0x3127e2['userpic'])){return _0x475e3c[_0xab47('0xb6')](_0x5470d9);}else{if(!fs[_0xab47('0xb7')](path['join'](config[_0xab47('0xb4')],_0xab47('0xb8'),_0x3127e2[_0xab47('0xaf')]))){return _0x475e3c['download'](_0x5470d9);}return _0x475e3c['download'](path['join'](config[_0xab47('0xb4')],_0xab47('0xb8'),_0x3127e2[_0xab47('0xaf')]));}}})[_0xab47('0x51')](handleError(_0x475e3c,null));};exports[_0xab47('0xb9')]=function(_0x3ff79f,_0xc2bbbc){return db['User'][_0xab47('0x56')]({'where':{'id':_0x3ff79f[_0xab47('0x53')]['id']},'attributes':['id']})[_0xab47('0x22')](handleEntityNotFound(_0xc2bbbc,null))[_0xab47('0x22')](function(_0x2e51ae){var _0x63d8b7=[];values=_0x2e51ae[_0xab47('0x4c')];_0x63d8b7[_0xab47('0x46')](get_open_tabs(_0xab47('0x4b'),_0x2e51ae['dataValues']));_0x63d8b7['push'](get_open_tabs(_0xab47('0x4d'),_0x2e51ae['dataValues']));_0x63d8b7['push'](get_open_tabs(_0xab47('0x57'),_0x2e51ae[_0xab47('0x4c')]));_0x63d8b7['push'](get_open_tabs(_0xab47('0x4f'),_0x2e51ae[_0xab47('0x4c')]));_0x63d8b7[_0xab47('0x46')](get_open_tabs('fax',_0x2e51ae[_0xab47('0x4c')]));_0x63d8b7[_0xab47('0x46')](get_open_tabs('mail',_0x2e51ae[_0xab47('0x4c')]));return Promise[_0xab47('0x50')](_0x63d8b7);})[_0xab47('0x22')](function(_0x167548){if(_0x167548){var _0x11339e=_[_0xab47('0x2e')](values['ChatOpenTabs'],function(_0x99d85a){return{'channel':_0xab47('0xba'),'id':_0x99d85a['id'],'createdAt':_0x99d85a[_0xab47('0xbb')]};});var _0x367af3=_[_0xab47('0x2e')](values[_0xab47('0xbc')],function(_0x375fbc){return{'channel':_0xab47('0xbd'),'id':_0x375fbc['id'],'createdAt':_0x375fbc[_0xab47('0xbb')]};});var _0x1a6853=_[_0xab47('0x2e')](values[_0xab47('0xbe')],function(_0x1b714f){return{'channel':'OPENCHANNEL','id':_0x1b714f['id'],'createdAt':_0x1b714f[_0xab47('0xbb')]};});var _0xffd85b=_['map'](values[_0xab47('0xbf')],function(_0x3dc4e8){return{'channel':'MAIL','id':_0x3dc4e8['id'],'createdAt':_0x3dc4e8[_0xab47('0xbb')]};});var _0x25a27e=_[_0xab47('0x2e')](values[_0xab47('0xc0')],function(_0x347ffd){return{'channel':_0xab47('0xc1'),'id':_0x347ffd['id'],'createdAt':_0x347ffd[_0xab47('0xbb')]};});var _0x138871=_[_0xab47('0x2e')](values[_0xab47('0xc2')],function(_0x1b635a){return{'channel':_0xab47('0xc3'),'id':_0x1b635a['id'],'createdAt':_0x1b635a[_0xab47('0xbb')]};});var _0x5ee545=_[_0xab47('0xc4')](_0x11339e,_0x367af3,_0x1a6853,_0xffd85b,_0x25a27e,_0x138871);var _0x36369b={'count':_0x5ee545[_0xab47('0x4a')],'rows':_0x5ee545};return _0x36369b;}else return null;})[_0xab47('0x22')](respondWithResult(_0xc2bbbc,null))['catch'](handleError(_0xc2bbbc,null));};exports['getContacts']=function(_0x38f09e,_0x3d3adc){var _0x3e7be1={};return db['User'][_0xab47('0x94')]({'where':{'id':_0x38f09e[_0xab47('0x53')]['id']}})[_0xab47('0x22')](function(_0xea8e08){if(!_0xea8e08){throw new APINotFoundError(util[_0xab47('0xa6')](_0xab47('0xc5'),_0x38f09e[_0xab47('0x53')]['id']));}return contacts[_0xab47('0x5a')]();})[_0xab47('0x22')](function(_0x597ecc){_0x38f09e['query'][_0xab47('0x37')]=_0x38f09e[_0xab47('0x53')]['id'];_0x3e7be1=qs[_0xab47('0x41')](_0x597ecc,_0x38f09e);if(_0x38f09e['query']['hasOwnProperty'](_0xab47('0x54'))){_0x3e7be1['include']=[{'model':db['CmList'],'as':_0xab47('0xc6'),'required':![]},{'model':db[_0xab47('0xc7')],'as':_0xab47('0xc8'),'attributes':['id',_0xab47('0x35'),'color'],'where':_0x38f09e[_0xab47('0x42')][_0xab47('0xc9')]?{'id':_0x38f09e[_0xab47('0x42')][_0xab47('0xc9')]}:undefined,'required':_0x38f09e['query'][_0xab47('0xc9')]?!![]:![]}];}return contacts[_0xab47('0xca')](_0x38f09e['query'],_0x38f09e['user'],_0x3e7be1,_0x597ecc);})[_0xab47('0x22')](respondWithFilteredResult(_0x3d3adc,_0x3e7be1))[_0xab47('0x51')](APIHandleError(_0x3d3adc));};exports['getQueues']=function(_0x4cd584,_0x3c00ec){var _0x3d0586;var _0x26b38d={};var _0x5638cc;return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x4cd584[_0xab47('0x53')]['id']},'attributes':['id','name',_0xab47('0x30')]})[_0xab47('0x22')](handleEntityNotFound(_0x3c00ec,null))[_0xab47('0x22')](function(_0x35a70c){if(!utils[_0xab47('0x9a')](_0x4cd584[_0xab47('0x42')][_0xab47('0xab')])){throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0x9b'));}_0x3d0586=_0x35a70c;var _0x4dbdb7={};_0x4dbdb7[_0xab47('0xcb')]=_['keys'](db[_[_0xab47('0x9d')](_0x4cd584['query'][_0xab47('0xab')])+_0xab47('0xcc')][_0xab47('0x38')]);_0x4dbdb7[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x4cd584[_0xab47('0x42')]);_0x4dbdb7[_0xab47('0xce')]=_[_0xab47('0xcf')](_0x4dbdb7[_0xab47('0xcb')],_0x4dbdb7['query']);_0x26b38d[_0xab47('0x45')]=_['intersection'](_0x4dbdb7[_0xab47('0xcb')],qs['fields'](_0x4cd584['query']['fields']));_0x26b38d[_0xab47('0x45')]=_0x26b38d[_0xab47('0x45')][_0xab47('0x4a')]?_0x26b38d['attributes']:_0x4dbdb7[_0xab47('0xcb')];_0x26b38d[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x4cd584[_0xab47('0x42')][_0xab47('0xd1')]);_0x26b38d[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x4cd584[_0xab47('0x42')],_0x4dbdb7[_0xab47('0xce')]));if(_0x4cd584[_0xab47('0x42')]['filter']){_0x26b38d[_0xab47('0xd2')]=_[_0xab47('0x55')](_0x26b38d[_0xab47('0xd2')],{'$or':_['map'](_0x26b38d['attributes'],function(_0x2eeebc){var _0xe2ec9a={};_0xe2ec9a[_0x2eeebc]={'$like':'%'+_0x4cd584[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0xe2ec9a;})});}_0x26b38d=_[_0xab47('0x55')]({},_0x26b38d,_0x4cd584['options']);switch(_0x3d0586[_0xab47('0x30')]){case _0xab47('0x27'):return db[_[_0xab47('0x9d')](_0x4cd584[_0xab47('0x42')][_0xab47('0xab')])+_0xab47('0xcc')]['findAll'](_0x26b38d);case _0xab47('0x28'):case _0xab47('0x23'):return _0x3d0586[_0xab47('0xa4')+_['capitalize'](_0x4cd584[_0xab47('0x42')][_0xab47('0xab')])+_0xab47('0x9f')](_0x26b38d);default:throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0xd4'));}})['then'](function(_0x515bf0){_0x5638cc=_0x515bf0[_0xab47('0x4a')];if(!_0x4cd584[_0xab47('0x42')][_0xab47('0xd5')](_0xab47('0xd6'))){_0x26b38d['limit']=qs['limit'](_0x4cd584['query']['limit']);_0x26b38d[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x4cd584['query'][_0xab47('0x1b')]);}switch(_0x3d0586['role']){case'admin':return db[_['capitalize'](_0x4cd584[_0xab47('0x42')][_0xab47('0xab')])+_0xab47('0xcc')]['findAll'](_0x26b38d);case _0xab47('0x28'):case _0xab47('0x23'):return _0x3d0586['get'+_[_0xab47('0x9d')](_0x4cd584[_0xab47('0x42')]['channel'])+_0xab47('0x9f')](_0x26b38d);}})['then'](function(_0xcdd2b8){return{'count':_0x5638cc,'rows':_0xcdd2b8};})[_0xab47('0x22')](respondWithResult(_0x3c00ec,null))[_0xab47('0x51')](handleError(_0x3c00ec,null));};exports['getVoiceQueuesRt']=function(_0x678bec,_0x13350d){var _0x2a4662={};var _0xd57485={};var _0x8712;var _0x50346f;return db[_0xab47('0x37')]['findOne']({'where':{'id':_0x678bec[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x13350d,null))[_0xab47('0x22')](function(_0x49fde3){if(_0x49fde3){_0x8712=_0x49fde3;_0xd57485['model']=_['keys'](db[_0xab47('0xa9')][_0xab47('0x38')]);_0xd57485[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x678bec[_0xab47('0x42')]);_0xd57485['filters']=_['intersection'](_0xd57485[_0xab47('0xcb')],_0xd57485[_0xab47('0x42')]);_0x2a4662[_0xab47('0x45')]=_[_0xab47('0xcf')](_0xd57485[_0xab47('0xcb')],qs['fields'](_0x678bec[_0xab47('0x42')]['fields']));_0x2a4662[_0xab47('0x45')]=_0x2a4662[_0xab47('0x45')]['length']?_0x2a4662['attributes']:_0xd57485['model'];_0x2a4662[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x678bec['query'][_0xab47('0xd1')]);_0x2a4662[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x678bec['query'],_0xd57485['filters']));if(_0x678bec[_0xab47('0x42')][_0xab47('0x2c')]){_0x2a4662['where']=_[_0xab47('0x55')](_0x2a4662[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x2a4662['attributes'],function(_0x1a18c6){var _0x51dd5d={};_0x51dd5d[_0x1a18c6]={'$like':'%'+_0x678bec['query'][_0xab47('0x2c')]+'%'};return _0x51dd5d;})});}_0x2a4662=_[_0xab47('0x55')]({},_0x2a4662,_0x678bec[_0xab47('0xd7')]);return _0x8712[_0xab47('0xd8')](_0x2a4662);}})[_0xab47('0x22')](function(_0x2183e2){if(_0x2183e2){_0x50346f=_0x2183e2[_0xab47('0x4a')];if(!_0x678bec[_0xab47('0x42')][_0xab47('0xd5')]('nolimit')){_0x2a4662['limit']=qs[_0xab47('0x1d')](_0x678bec[_0xab47('0x42')][_0xab47('0x1d')]);_0x2a4662[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x678bec[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x8712[_0xab47('0xd8')](_0x2a4662);}})['then'](function(_0x1e8a50){if(_0x1e8a50){return _0x1e8a50?{'count':_0x50346f,'rows':_0x1e8a50}:null;}})['then'](respondWithResult(_0x13350d,null))[_0xab47('0x51')](handleError(_0x13350d,null));};exports[_0xab47('0xd9')]=function(_0x5cd3e3,_0x2cb2c4){var _0xe4471c={};var _0xbda636={};var _0x3e8be9;var _0x2eb056;return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x5cd3e3[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x2cb2c4,null))['then'](function(_0x1a05c3){if(_0x1a05c3){_0x3e8be9=_0x1a05c3;_0xbda636[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0xda')][_0xab47('0x38')]);_0xbda636[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x5cd3e3[_0xab47('0x42')]);_0xbda636[_0xab47('0xce')]=_[_0xab47('0xcf')](_0xbda636[_0xab47('0xcb')],_0xbda636['query']);_0xe4471c[_0xab47('0x45')]=_['intersection'](_0xbda636[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x5cd3e3[_0xab47('0x42')]['fields']));_0xe4471c['attributes']=_0xe4471c[_0xab47('0x45')][_0xab47('0x4a')]?_0xe4471c[_0xab47('0x45')]:_0xbda636[_0xab47('0xcb')];_0xe4471c[_0xab47('0xd0')]=qs['sort'](_0x5cd3e3['query'][_0xab47('0xd1')]);_0xe4471c['where']=qs['filters'](_[_0xab47('0xd3')](_0x5cd3e3[_0xab47('0x42')],_0xbda636[_0xab47('0xce')]));if(_0x5cd3e3[_0xab47('0x42')][_0xab47('0x2c')]){_0xe4471c[_0xab47('0xd2')]=_['merge'](_0xe4471c[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0xe4471c[_0xab47('0x45')],function(_0x595949){var _0x53f835={};_0x53f835[_0x595949]={'$like':'%'+_0x5cd3e3[_0xab47('0x42')]['filter']+'%'};return _0x53f835;})});}_0xe4471c=_[_0xab47('0x55')]({},_0xe4471c,_0x5cd3e3['options']);return _0x3e8be9['getGroups'](_0xe4471c);}})[_0xab47('0x22')](function(_0x1f31b1){if(_0x1f31b1){_0x2eb056=_0x1f31b1[_0xab47('0x4a')];if(!_0x5cd3e3[_0xab47('0x42')]['hasOwnProperty'](_0xab47('0xd6'))){_0xe4471c[_0xab47('0x1d')]=qs[_0xab47('0x1d')](_0x5cd3e3['query'][_0xab47('0x1d')]);_0xe4471c[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x5cd3e3[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x3e8be9[_0xab47('0xd9')](_0xe4471c);}})['then'](function(_0x8b8fd4){if(_0x8b8fd4){return _0x8b8fd4?{'count':_0x2eb056,'rows':_0x8b8fd4}:null;}})[_0xab47('0x22')](respondWithResult(_0x2cb2c4,null))[_0xab47('0x51')](handleError(_0x2cb2c4,null));};exports[_0xab47('0xdc')]=function(_0x5bde1b,_0x23e233){var _0x5af195={'raw':!![],'where':{}};var _0x1bc71f={};var _0x20916a={'count':0x0,'rows':[]};return db['User'][_0xab47('0x94')]({'where':{'id':_0x5bde1b[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x23e233,null))[_0xab47('0x22')](function(_0x426f6a){if(_0x426f6a){_0x1bc71f[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0xdd')]['rawAttributes']);_0x1bc71f[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x5bde1b[_0xab47('0x42')]);_0x1bc71f['filters']=_['intersection'](_0x1bc71f[_0xab47('0xcb')],_0x1bc71f[_0xab47('0x42')]);_0x5af195['attributes']=_[_0xab47('0xcf')](_0x1bc71f[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x5bde1b[_0xab47('0x42')]['fields']));_0x5af195[_0xab47('0x45')]=_0x5af195[_0xab47('0x45')]['length']?_0x5af195[_0xab47('0x45')]:_0x1bc71f[_0xab47('0xcb')];if(!_0x5bde1b[_0xab47('0x42')][_0xab47('0xd5')](_0xab47('0xd6'))){_0x5af195[_0xab47('0x1d')]=qs['limit'](_0x5bde1b['query'][_0xab47('0x1d')]);_0x5af195[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x5bde1b['query'][_0xab47('0x1b')]);}_0x5af195[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x5bde1b['query'][_0xab47('0xd1')]);_0x5af195[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x5bde1b[_0xab47('0x42')],_0x1bc71f['filters']));_0x5af195[_0xab47('0xd2')][_0xab47('0xde')]=_0x426f6a['id'];if(_0x5bde1b[_0xab47('0x42')]['filter']){_0x5af195[_0xab47('0xd2')]=_['merge'](_0x5af195[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x5af195[_0xab47('0x45')],function(_0x4e2ae7){var _0x21fa70={};_0x21fa70[_0x4e2ae7]={'$like':'%'+_0x5bde1b[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0x21fa70;})});}_0x5af195=_[_0xab47('0x55')]({},_0x5af195,_0x5bde1b['options']);return db[_0xab47('0xdd')]['count']({'where':_0x5af195[_0xab47('0xd2')]})[_0xab47('0x22')](function(_0x224697){_0x20916a[_0xab47('0x1e')]=_0x224697;if(_0x5bde1b[_0xab47('0x42')][_0xab47('0x54')]){_0x5af195[_0xab47('0x43')]=[{'all':!![]}];}return db[_0xab47('0xdd')][_0xab47('0xca')](_0x5af195);})[_0xab47('0x22')](function(_0xbb70a5){_0x20916a[_0xab47('0x47')]=_0xbb70a5;return _0x20916a;});}})['then'](respondWithFilteredResult(_0x23e233,_0x5af195))[_0xab47('0x51')](handleError(_0x23e233,null));};exports[_0xab47('0xdf')]=function(_0x2a1cd6,_0x48f5f7){var _0x4c3e35={'raw':!![],'where':{}};var _0xe8f74a={};var _0x123593={'count':0x0,'rows':[]};return db['User'][_0xab47('0x94')]({'where':{'id':_0x2a1cd6[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x48f5f7,null))['then'](function(_0x2d3d82){if(_0x2d3d82){_0xe8f74a['model']=_[_0xab47('0xcd')](db[_0xab47('0xe0')][_0xab47('0x38')]);_0xe8f74a[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x2a1cd6['query']);_0xe8f74a[_0xab47('0xce')]=_[_0xab47('0xcf')](_0xe8f74a[_0xab47('0xcb')],_0xe8f74a[_0xab47('0x42')]);_0x4c3e35[_0xab47('0x45')]=_[_0xab47('0xcf')](_0xe8f74a[_0xab47('0xcb')],qs['fields'](_0x2a1cd6[_0xab47('0x42')][_0xab47('0xdb')]));_0x4c3e35[_0xab47('0x45')]=_0x4c3e35['attributes']['length']?_0x4c3e35[_0xab47('0x45')]:_0xe8f74a[_0xab47('0xcb')];if(!_0x2a1cd6[_0xab47('0x42')][_0xab47('0xd5')](_0xab47('0xd6'))){_0x4c3e35[_0xab47('0x1d')]=qs[_0xab47('0x1d')](_0x2a1cd6[_0xab47('0x42')]['limit']);_0x4c3e35[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x2a1cd6[_0xab47('0x42')]['offset']);}_0x4c3e35[_0xab47('0xd0')]=qs['sort'](_0x2a1cd6[_0xab47('0x42')][_0xab47('0xd1')]);_0x4c3e35[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x2a1cd6[_0xab47('0x42')],_0xe8f74a[_0xab47('0xce')]));_0x4c3e35[_0xab47('0xd2')]['UserId']=_0x2d3d82['id'];if(_0x2a1cd6[_0xab47('0x42')][_0xab47('0x2c')]){_0x4c3e35[_0xab47('0xd2')]=_[_0xab47('0x55')](_0x4c3e35[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x4c3e35['attributes'],function(_0x2f054b){var _0x5b2761={};_0x5b2761[_0x2f054b]={'$like':'%'+_0x2a1cd6['query']['filter']+'%'};return _0x5b2761;})});}_0x4c3e35=_[_0xab47('0x55')]({},_0x4c3e35,_0x2a1cd6[_0xab47('0xd7')]);return db[_0xab47('0xe0')][_0xab47('0x1e')]({'where':_0x4c3e35[_0xab47('0xd2')]})[_0xab47('0x22')](function(_0x2fe080){_0x123593[_0xab47('0x1e')]=_0x2fe080;if(_0x2a1cd6['query'][_0xab47('0x54')]){_0x4c3e35[_0xab47('0x43')]=[{'all':!![]}];}return db[_0xab47('0xe0')][_0xab47('0xca')](_0x4c3e35);})[_0xab47('0x22')](function(_0x3b38e3){_0x123593[_0xab47('0x47')]=_0x3b38e3;return _0x123593;});}})[_0xab47('0x22')](respondWithFilteredResult(_0x48f5f7,_0x4c3e35))[_0xab47('0x51')](handleError(_0x48f5f7,null));};exports['getChatInteractions']=function(_0xc92ac7,_0xb34267){var _0x46df25={};var _0x3e37d5={};var _0x37af3a;var _0x31388e;return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0xc92ac7['params']['id']}})[_0xab47('0x22')](handleEntityNotFound(_0xb34267,null))[_0xab47('0x22')](function(_0x28d037){if(_0x28d037){_0x37af3a=_0x28d037;_0x3e37d5[_0xab47('0xcb')]=_[_0xab47('0xcd')](db['ChatInteraction'][_0xab47('0x38')]);_0x3e37d5[_0xab47('0x42')]=_[_0xab47('0xcd')](_0xc92ac7['query']);_0x3e37d5[_0xab47('0xce')]=_[_0xab47('0xcf')](_0x3e37d5['model'],_0x3e37d5['query']);_0x46df25[_0xab47('0x45')]=_[_0xab47('0xcf')](_0x3e37d5[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0xc92ac7[_0xab47('0x42')][_0xab47('0xdb')]));_0x46df25[_0xab47('0x45')]=_0x46df25[_0xab47('0x45')][_0xab47('0x4a')]?_0x46df25[_0xab47('0x45')]:_0x3e37d5[_0xab47('0xcb')];_0x46df25[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0xc92ac7[_0xab47('0x42')][_0xab47('0xd1')]);_0x46df25['where']=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0xc92ac7[_0xab47('0x42')],_0x3e37d5[_0xab47('0xce')]));if(_0xc92ac7[_0xab47('0x42')][_0xab47('0x2c')]){_0x46df25[_0xab47('0xd2')]=_[_0xab47('0x55')](_0x46df25[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x46df25[_0xab47('0x45')],function(_0x380e53){var _0x33c176={};_0x33c176[_0x380e53]={'$like':'%'+_0xc92ac7[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0x33c176;})});}_0x46df25=_[_0xab47('0x55')]({},_0x46df25,_0xc92ac7[_0xab47('0xd7')]);return _0x37af3a[_0xab47('0xe1')](_0x46df25);}})[_0xab47('0x22')](function(_0x49efd0){if(_0x49efd0){_0x31388e=_0x49efd0['length'];if(!_0xc92ac7[_0xab47('0x42')]['hasOwnProperty'](_0xab47('0xd6'))){_0x46df25['limit']=qs['limit'](_0xc92ac7[_0xab47('0x42')][_0xab47('0x1d')]);_0x46df25[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0xc92ac7[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x37af3a['getChatInteractions'](_0x46df25);}})[_0xab47('0x22')](function(_0xb423d6){if(_0xb423d6){return _0xb423d6?{'count':_0x31388e,'rows':_0xb423d6}:null;}})[_0xab47('0x22')](respondWithResult(_0xb34267,null))[_0xab47('0x51')](handleError(_0xb34267,null));};exports[_0xab47('0xe2')]=function(_0x138d00,_0x8c40ed){var _0x17845e={};var _0x747773={};var _0x4e71b8;var _0x36951a;return db['User'][_0xab47('0x94')]({'where':{'id':_0x138d00[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x8c40ed,null))[_0xab47('0x22')](function(_0x369946){if(_0x369946){_0x4e71b8=_0x369946;_0x747773[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0xe3')][_0xab47('0x38')]);_0x747773[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x138d00['query']);_0x747773[_0xab47('0xce')]=_['intersection'](_0x747773[_0xab47('0xcb')],_0x747773[_0xab47('0x42')]);_0x17845e[_0xab47('0x45')]=_[_0xab47('0xcf')](_0x747773[_0xab47('0xcb')],qs['fields'](_0x138d00[_0xab47('0x42')][_0xab47('0xdb')]));_0x17845e[_0xab47('0x45')]=_0x17845e[_0xab47('0x45')][_0xab47('0x4a')]?_0x17845e[_0xab47('0x45')]:_0x747773[_0xab47('0xcb')];_0x17845e['order']=qs[_0xab47('0xd1')](_0x138d00[_0xab47('0x42')]['sort']);_0x17845e['where']=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x138d00[_0xab47('0x42')],_0x747773[_0xab47('0xce')]));if(_0x138d00['query'][_0xab47('0x2c')]){_0x17845e[_0xab47('0xd2')]=_[_0xab47('0x55')](_0x17845e[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x17845e['attributes'],function(_0x9766b3){var _0x357c71={};_0x357c71[_0x9766b3]={'$like':'%'+_0x138d00[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0x357c71;})});}_0x17845e=_[_0xab47('0x55')]({},_0x17845e,_0x138d00[_0xab47('0xd7')]);return _0x4e71b8[_0xab47('0xe2')](_0x17845e);}})['then'](function(_0x12dc48){if(_0x12dc48){_0x36951a=_0x12dc48['length'];if(!_0x138d00[_0xab47('0x42')][_0xab47('0xd5')](_0xab47('0xd6'))){_0x17845e[_0xab47('0x1d')]=qs[_0xab47('0x1d')](_0x138d00[_0xab47('0x42')][_0xab47('0x1d')]);_0x17845e['offset']=qs[_0xab47('0x1b')](_0x138d00[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x4e71b8[_0xab47('0xe2')](_0x17845e);}})[_0xab47('0x22')](function(_0x50f713){if(_0x50f713){return _0x50f713?{'count':_0x36951a,'rows':_0x50f713}:null;}})[_0xab47('0x22')](respondWithResult(_0x8c40ed,null))[_0xab47('0x51')](handleError(_0x8c40ed,null));};exports[_0xab47('0xe4')]=function(_0x39bc5d,_0x298b94){var _0x3071d3={'raw':!![],'where':{}};var _0x3660fa={};var _0x268e22={'count':0x0,'rows':[]};return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x39bc5d[_0xab47('0x53')]['id']}})['then'](handleEntityNotFound(_0x298b94,null))[_0xab47('0x22')](function(_0x4b2d1c){if(_0x4b2d1c){_0x3660fa['model']=_[_0xab47('0xcd')](db[_0xab47('0xe5')]['rawAttributes']);_0x3660fa[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x39bc5d[_0xab47('0x42')]);_0x3660fa['filters']=_[_0xab47('0xcf')](_0x3660fa[_0xab47('0xcb')],_0x3660fa[_0xab47('0x42')]);_0x3071d3[_0xab47('0x45')]=_['intersection'](_0x3660fa[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x39bc5d['query'][_0xab47('0xdb')]));_0x3071d3[_0xab47('0x45')]=_0x3071d3[_0xab47('0x45')]['length']?_0x3071d3[_0xab47('0x45')]:_0x3660fa[_0xab47('0xcb')];if(!_0x39bc5d['query'][_0xab47('0xd5')](_0xab47('0xd6'))){_0x3071d3[_0xab47('0x1d')]=qs[_0xab47('0x1d')](_0x39bc5d[_0xab47('0x42')][_0xab47('0x1d')]);_0x3071d3[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x39bc5d['query'][_0xab47('0x1b')]);}_0x3071d3[_0xab47('0xd0')]=qs['sort'](_0x39bc5d[_0xab47('0x42')][_0xab47('0xd1')]);_0x3071d3[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x39bc5d[_0xab47('0x42')],_0x3660fa[_0xab47('0xce')]));_0x3071d3[_0xab47('0xd2')][_0xab47('0xde')]=_0x4b2d1c['id'];if(_0x39bc5d[_0xab47('0x42')][_0xab47('0x2c')]){_0x3071d3[_0xab47('0xd2')]=_[_0xab47('0x55')](_0x3071d3[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x3071d3[_0xab47('0x45')],function(_0x1bf74a){var _0x27d79c={};_0x27d79c[_0x1bf74a]={'$like':'%'+_0x39bc5d[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0x27d79c;})});}_0x3071d3=_['merge']({},_0x3071d3,_0x39bc5d[_0xab47('0xd7')]);return db[_0xab47('0xe5')][_0xab47('0x1e')]({'where':_0x3071d3['where']})[_0xab47('0x22')](function(_0xe9d3f1){_0x268e22[_0xab47('0x1e')]=_0xe9d3f1;if(_0x39bc5d[_0xab47('0x42')][_0xab47('0x54')]){_0x3071d3[_0xab47('0x43')]=[{'all':!![]}];}return db[_0xab47('0xe5')]['findAll'](_0x3071d3);})[_0xab47('0x22')](function(_0x574278){_0x268e22[_0xab47('0x47')]=_0x574278;return _0x268e22;});}})[_0xab47('0x22')](respondWithFilteredResult(_0x298b94,_0x3071d3))['catch'](handleError(_0x298b94,null));};exports[_0xab47('0xe6')]=function(_0x23d9d1,_0x14d179){var _0x37e4a4={};var _0x217bd0={};var _0x47c646;var _0x2c8736;return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x23d9d1[_0xab47('0x53')]['id']}})['then'](handleEntityNotFound(_0x14d179,null))[_0xab47('0x22')](function(_0x231ae8){if(_0x231ae8){_0x47c646=_0x231ae8;_0x217bd0[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0xe7')]['rawAttributes']);_0x217bd0[_0xab47('0x42')]=_['keys'](_0x23d9d1['query']);_0x217bd0[_0xab47('0xce')]=_['intersection'](_0x217bd0[_0xab47('0xcb')],_0x217bd0[_0xab47('0x42')]);_0x37e4a4[_0xab47('0x45')]=_['intersection'](_0x217bd0[_0xab47('0xcb')],qs['fields'](_0x23d9d1[_0xab47('0x42')][_0xab47('0xdb')]));_0x37e4a4[_0xab47('0x45')]=_0x37e4a4[_0xab47('0x45')]['length']?_0x37e4a4[_0xab47('0x45')]:_0x217bd0[_0xab47('0xcb')];_0x37e4a4[_0xab47('0xd0')]=qs['sort'](_0x23d9d1['query'][_0xab47('0xd1')]);_0x37e4a4[_0xab47('0xd2')]=qs[_0xab47('0xce')](_['pick'](_0x23d9d1[_0xab47('0x42')],_0x217bd0['filters']));if(_0x23d9d1[_0xab47('0x42')]['filter']){_0x37e4a4[_0xab47('0xd2')]=_['merge'](_0x37e4a4[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x37e4a4[_0xab47('0x45')],function(_0x36a147){var _0x40cd12={};_0x40cd12[_0x36a147]={'$like':'%'+_0x23d9d1['query'][_0xab47('0x2c')]+'%'};return _0x40cd12;})});}_0x37e4a4=_[_0xab47('0x55')]({},_0x37e4a4,_0x23d9d1[_0xab47('0xd7')]);return _0x47c646['getSmsInteractions'](_0x37e4a4);}})[_0xab47('0x22')](function(_0x4af237){if(_0x4af237){_0x2c8736=_0x4af237[_0xab47('0x4a')];if(!_0x23d9d1[_0xab47('0x42')]['hasOwnProperty'](_0xab47('0xd6'))){_0x37e4a4[_0xab47('0x1d')]=qs[_0xab47('0x1d')](_0x23d9d1[_0xab47('0x42')]['limit']);_0x37e4a4[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x23d9d1[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x47c646[_0xab47('0xe6')](_0x37e4a4);}})['then'](function(_0x310f05){if(_0x310f05){return _0x310f05?{'count':_0x2c8736,'rows':_0x310f05}:null;}})[_0xab47('0x22')](respondWithResult(_0x14d179,null))['catch'](handleError(_0x14d179,null));};exports[_0xab47('0xe8')]=function(_0x2dc3c7,_0x1d7531){var _0x4f09ee={};var _0xf8c3ea={};var _0x6fdaf3;var _0x1aa439;return db[_0xab47('0x37')]['findOne']({'where':{'id':_0x2dc3c7['params']['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x1d7531,null))['then'](function(_0x4c5f92){if(_0x4c5f92){_0x6fdaf3=_0x4c5f92;_0xf8c3ea[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0xe9')][_0xab47('0x38')]);_0xf8c3ea[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x2dc3c7[_0xab47('0x42')]);_0xf8c3ea[_0xab47('0xce')]=_[_0xab47('0xcf')](_0xf8c3ea['model'],_0xf8c3ea[_0xab47('0x42')]);_0x4f09ee['attributes']=_[_0xab47('0xcf')](_0xf8c3ea[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x2dc3c7[_0xab47('0x42')][_0xab47('0xdb')]));_0x4f09ee[_0xab47('0x45')]=_0x4f09ee[_0xab47('0x45')]['length']?_0x4f09ee[_0xab47('0x45')]:_0xf8c3ea[_0xab47('0xcb')];_0x4f09ee[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x2dc3c7['query'][_0xab47('0xd1')]);_0x4f09ee['where']=qs['filters'](_[_0xab47('0xd3')](_0x2dc3c7['query'],_0xf8c3ea[_0xab47('0xce')]));if(_0x2dc3c7['query']['filter']){_0x4f09ee[_0xab47('0xd2')]=_['merge'](_0x4f09ee[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x4f09ee['attributes'],function(_0x1e79bf){var _0x6796e7={};_0x6796e7[_0x1e79bf]={'$like':'%'+_0x2dc3c7['query']['filter']+'%'};return _0x6796e7;})});}_0x4f09ee=_[_0xab47('0x55')]({},_0x4f09ee,_0x2dc3c7[_0xab47('0xd7')]);return _0x6fdaf3[_0xab47('0xe8')](_0x4f09ee);}})[_0xab47('0x22')](function(_0x26caee){if(_0x26caee){_0x1aa439=_0x26caee['length'];if(!_0x2dc3c7[_0xab47('0x42')][_0xab47('0xd5')](_0xab47('0xd6'))){_0x4f09ee['limit']=qs[_0xab47('0x1d')](_0x2dc3c7[_0xab47('0x42')][_0xab47('0x1d')]);_0x4f09ee[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x2dc3c7['query'][_0xab47('0x1b')]);}return _0x6fdaf3[_0xab47('0xe8')](_0x4f09ee);}})[_0xab47('0x22')](function(_0x1ef885){if(_0x1ef885){return _0x1ef885?{'count':_0x1aa439,'rows':_0x1ef885}:null;}})['then'](respondWithResult(_0x1d7531,null))[_0xab47('0x51')](handleError(_0x1d7531,null));};exports[_0xab47('0xea')]=function(_0x532254,_0x1a1a4d){var _0x58b9cc={};var _0x45a260={};var _0x1c1679;var _0x15f440;return db[_0xab47('0x37')]['findOne']({'where':{'id':_0x532254[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x1a1a4d,null))[_0xab47('0x22')](function(_0x3315e1){if(_0x3315e1){_0x1c1679=_0x3315e1;_0x45a260[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0xeb')][_0xab47('0x38')]);_0x45a260[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x532254[_0xab47('0x42')]);_0x45a260[_0xab47('0xce')]=_[_0xab47('0xcf')](_0x45a260[_0xab47('0xcb')],_0x45a260[_0xab47('0x42')]);_0x58b9cc[_0xab47('0x45')]=_[_0xab47('0xcf')](_0x45a260[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x532254['query'][_0xab47('0xdb')]));_0x58b9cc['attributes']=_0x58b9cc['attributes'][_0xab47('0x4a')]?_0x58b9cc['attributes']:_0x45a260[_0xab47('0xcb')];_0x58b9cc[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x532254[_0xab47('0x42')]['sort']);_0x58b9cc[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x532254[_0xab47('0x42')],_0x45a260[_0xab47('0xce')]));if(_0x532254[_0xab47('0x42')]['filter']){_0x58b9cc[_0xab47('0xd2')]=_[_0xab47('0x55')](_0x58b9cc[_0xab47('0xd2')],{'$or':_['map'](_0x58b9cc['attributes'],function(_0x284319){var _0x2c8b0b={};_0x2c8b0b[_0x284319]={'$like':'%'+_0x532254[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0x2c8b0b;})});}_0x58b9cc=_['merge']({},_0x58b9cc,_0x532254[_0xab47('0xd7')]);return _0x1c1679[_0xab47('0xea')](_0x58b9cc);}})['then'](function(_0x37b189){if(_0x37b189){_0x15f440=_0x37b189['length'];if(!_0x532254[_0xab47('0x42')][_0xab47('0xd5')]('nolimit')){_0x58b9cc['limit']=qs[_0xab47('0x1d')](_0x532254[_0xab47('0x42')][_0xab47('0x1d')]);_0x58b9cc['offset']=qs['offset'](_0x532254[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x1c1679[_0xab47('0xea')](_0x58b9cc);}})[_0xab47('0x22')](function(_0x517b22){if(_0x517b22){return _0x517b22?{'count':_0x15f440,'rows':_0x517b22}:null;}})[_0xab47('0x22')](respondWithResult(_0x1a1a4d,null))[_0xab47('0x51')](handleError(_0x1a1a4d,null));};exports[_0xab47('0xec')]=function(_0x59d326,_0x503420,_0x465ef4){var _0x2db004;var _0xc6ec04;var _0x413164;var _0x130e38=!_['isNil'](_0x59d326[_0xab47('0x53')]['id'])?_0x59d326['params']['id']:!_[_0xab47('0x64')](_0x59d326[_0xab47('0x28')]['id'])?_0x59d326[_0xab47('0x28')]['id']:null;return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x130e38,'role':{'$or':[_0xab47('0x27'),_0xab47('0x28'),'agent']}},'attributes':['id','name',_0xab47('0xed'),_0xab47('0xee'),_0xab47('0x30'),_0xab47('0x5e'),'loginInPause']})[_0xab47('0x22')](function(_0x9ba01c){if(_0x9ba01c){if(_0x9ba01c[_0xab47('0x30')]===_0xab47('0x23')){_0x2db004=_0x9ba01c;if(_0x59d326[_0xab47('0x59')][_0xab47('0x99')]){_0x413164=util[_0xab47('0xa6')](_0xab47('0xef'),_0x2db004[_0x59d326['body'][_0xab47('0x99')]]);}else if(_0x59d326[_0xab47('0x59')]['intrf']){_0x413164=util[_0xab47('0xa6')]('SIP/%s',_0x59d326[_0xab47('0x59')][_0xab47('0xf0')]);}else{_0x413164=util[_0xab47('0xa6')](_0xab47('0xa7'),_0x2db004[_0xab47('0x35')]);}socket['to'](util['format'](_0xab47('0xf1'),_0x2db004[_0xab47('0x35')]))['emit'](_0xab47('0xf2'),{'user':{'id':_0x2db004['id'],'name':_0x2db004[_0xab47('0x35')]},'ip':_0x59d326[_0xab47('0xf3')]['x-forwarded-for']||_0x59d326[_0xab47('0xf4')][_0xab47('0xf5')]||_0x59d326['socket'][_0xab47('0xf5')]||_0x59d326[_0xab47('0xf4')][_0xab47('0xf6')][_0xab47('0xf5')]});return db['UserVoiceQueueRt'][_0xab47('0x26')]({'where':{'membername':_0x2db004[_0xab47('0x35')]},'individualHooks':!![]});}}else{throw new db[(_0xab47('0x8d'))][(_0xab47('0x8e'))](_0xab47('0xf7'));}})[_0xab47('0x22')](function(){if(_0x2db004){return _0x2db004[_0xab47('0xf8')]({'raw':!![]});}})[_0xab47('0x22')](function(_0x3e1aec){if(_0x2db004){if(_0x3e1aec){_0xc6ec04=_0x3e1aec;if(_0xc6ec04[_0xab47('0x4a')]){var _0x417128=_0xc6ec04['map'](function(_0x3fcc98){var _0x29a544={'membername':_0x2db004[_0xab47('0x35')],'UserId':_0x2db004['id'],'queue_name':_0x3fcc98[_0xab47('0x35')],'VoiceQueueId':_0x3fcc98['id'],'interface':_0x413164,'paused':_0x2db004[_0xab47('0xf9')]||![],'penalty':_0x3fcc98[_0xab47('0xfa')]||0x0};return db[_0xab47('0xa9')]['upsert'](_0x29a544);});return Promise['all'](_0x417128);}}}})[_0xab47('0x22')](function(){if(_0x2db004){return db['MemberReport'][_0xab47('0xca')]({'where':{'membername':_0x2db004[_0xab47('0x35')],'exitAt':null}});}})['then'](function(_0x22dd9b){if(_0x2db004){var _0x209aad=[];_0x22dd9b[_0xab47('0xfb')](function(_0x4fc615){_0x209aad[_0xab47('0x46')](_0x4fc615[_0xab47('0x21')]({'exitAt':moment()[_0xab47('0xa6')](_0xab47('0xfc'))}));});return Promise[_0xab47('0x50')](_0x209aad);}})[_0xab47('0x22')](function(){if(_0x2db004){var _0x55a349=[];var _0xc068a6=[];var _0x3c1d0a=utils['getChannels']();var _0x57139e={'membername':_0x2db004['name'],'interface':_0x413164,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2db004[_0xab47('0x30')],'internal':_0x2db004[_0xab47('0x5e')]};_0x3c1d0a[_0xab47('0xfb')](function(_0x4674ac){_0x55a349[_0xab47('0x46')](_['merge']({'channel':_0x4674ac,'type':_0xab47('0xfd'),'data1':_0x59d326['body'][_0xab47('0xfe')],'data2':_0x413164},_0x57139e));if(_0x2db004[_0xab47('0xf9')]){_0xc068a6['push'](_[_0xab47('0x55')]({'channel':_0x4674ac,'type':_0xab47('0xff'),'data1':_0xab47('0x100')},_0x57139e));}});return db[_0xab47('0x101')][_0xab47('0x84')](_0x55a349['concat'](_0xc068a6),{'individualHooks':!![]});}})[_0xab47('0x22')](function(){if(_0x2db004){return _0x2db004['update']({'online':!![],'lastLoginAt':moment()[_0xab47('0xa6')](_0xab47('0xfc')),'voicePause':_0x2db004[_0xab47('0xf9')]||![],'mailPause':_0x2db004['loginInPause']||![],'chatPause':_0x2db004[_0xab47('0xf9')]||![],'faxPause':_0x2db004['loginInPause']||![],'smsPause':_0x2db004['loginInPause']||![],'openchannelPause':_0x2db004[_0xab47('0xf9')]||![],'whatsappPause':_0x2db004[_0xab47('0xf9')]||![],'pauseType':_0x2db004['loginInPause']?'LOGININPAUSE':null,'interface':_0x413164,'lastPauseAt':moment()['format'](_0xab47('0xfc'))});}})[_0xab47('0x22')](function(_0x1a5f44){if(_0x59d326['isMiddleware']){return _0x465ef4();}else{return Promise[_0xab47('0x102')](_0x1a5f44)['then'](respondWithResult(_0x503420,null));}})[_0xab47('0x51')](handleError(_0x503420,null));};exports['logout']=function(_0x1946d4,_0x1a3683){var _0x3576b4;return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x1946d4[_0xab47('0x53')]['id'],'role':_0xab47('0x23')},'attributes':['id',_0xab47('0x35'),_0xab47('0x30')]})[_0xab47('0x22')](handleEntityNotFound(_0x1a3683,null))[_0xab47('0x22')](function(_0x3646e0){if(_0x3646e0){_0x3576b4=_0x3646e0;return db[_0xab47('0xa9')]['destroy']({'where':{'membername':_0x3576b4[_0xab47('0x35')]},'individualHooks':!![]});}})['then'](function(){return db[_0xab47('0x101')][_0xab47('0xca')]({'where':{'membername':_0x3576b4[_0xab47('0x35')],'exitAt':null}});})[_0xab47('0x22')](function(_0x55d74f){var _0x2f61b3=[];_0x55d74f[_0xab47('0xfb')](function(_0x405a55){_0x2f61b3[_0xab47('0x46')](_0x405a55[_0xab47('0x21')]({'exitAt':moment()[_0xab47('0xa6')](_0xab47('0xfc'))}));});return Promise[_0xab47('0x50')](_0x2f61b3);})['then'](function(){return _0x3576b4[_0xab47('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xab47('0x22')](respondWithResult(_0x1a3683,null))[_0xab47('0x51')](handleError(_0x1a3683,null));};exports['pause']=function(_0x36815d,_0x3a994a){var _0x5d0ab0;return db[_0xab47('0xa9')]['update']({'paused':0x1},{'where':{'UserId':_0x36815d[_0xab47('0x53')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x36815d[_0xab47('0x53')]['id'],'role':_0xab47('0x23')},'attributes':['id',_0xab47('0x35'),_0xab47('0x30'),'internal',_0xab47('0x99'),_0xab47('0x98')]});})['then'](handleEntityNotFound(_0x3a994a,null))[_0xab47('0x22')](function(_0x4d093e){if(_0x4d093e){_0x5d0ab0=_0x4d093e;return db['MemberReport']['findAll']({'where':{'membername':_0x5d0ab0[_0xab47('0x35')],'type':_0xab47('0xff'),'exitAt':null}});}})[_0xab47('0x22')](function(_0x3f8b0b){if(_0x3f8b0b[_0xab47('0x4a')]){var _0x191e93=moment()[_0xab47('0xa6')](_0xab47('0xfc'));for(var _0x32fc97=0x0,_0x281b80=_0x3f8b0b[_0xab47('0x4a')];_0x32fc97<_0x281b80;_0x32fc97++){_0x3f8b0b[_0x32fc97][_0xab47('0x103')]({'exitAt':_0x191e93});}}})[_0xab47('0x22')](function(){var _0x314c61=[];var _0x45c680=utils['getChannels']();_0x45c680[_0xab47('0xfb')](function(_0x5d1786){_0x314c61['push']({'channel':_0x5d1786,'membername':_0x5d0ab0[_0xab47('0x35')],'interface':_[_0xab47('0x64')](_0x5d0ab0['interface'])?util[_0xab47('0xa6')](_0xab47('0xa7'),_0x5d0ab0['name']):_0x5d0ab0[_0xab47('0x99')],'type':'PAUSE','enterAt':moment()[_0xab47('0xa6')](_0xab47('0xfc')),'data1':_0x36815d[_0xab47('0x59')][_0xab47('0x39')]||_0xab47('0x104'),'role':_0x5d0ab0['role'],'internal':_0x5d0ab0[_0xab47('0x5e')]});});return db[_0xab47('0x101')][_0xab47('0x84')](_0x314c61,{'individualHooks':!![]});})[_0xab47('0x22')](function(){return _0x5d0ab0['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x36815d[_0xab47('0x59')][_0xab47('0x39')]||_0xab47('0x104'),'lastPauseAt':moment()[_0xab47('0xa6')](_0xab47('0xfc'))});})[_0xab47('0x22')](respondWithResult(_0x3a994a,null))[_0xab47('0x51')](handleError(_0x3a994a,null));};exports[_0xab47('0x105')]=function(_0x4c6d1c,_0x325a5d){if(_0x4c6d1c['body'][_0xab47('0xab')]&&!utils[_0xab47('0x9a')](_0x4c6d1c[_0xab47('0x59')][_0xab47('0xab')])){throw new APIBadRequestError(util[_0xab47('0xa6')](_0xab47('0x106'),_0x4c6d1c[_0xab47('0x59')][_0xab47('0xab')]));}return db[_0xab47('0x37')][_0xab47('0x56')]({'where':{'id':_0x4c6d1c[_0xab47('0x53')]['id']},'attributes':['id',_0xab47('0x35'),_0xab47('0x30'),_0xab47('0x5e'),'interface',_0xab47('0x98'),_0xab47('0xa8'),'mailPause','chatPause','faxPause',_0xab47('0x107'),_0xab47('0x108'),_0xab47('0x109'),_0xab47('0x10a'),_0xab47('0x10b')]})[_0xab47('0x22')](function(_0x179f8a){if(!_0x179f8a){throw new APINotFoundError(util[_0xab47('0xa6')](_0xab47('0xc5'),_0x4c6d1c['params']['id']));}return _0x179f8a['unpause'](_0x4c6d1c[_0xab47('0x59')][_0xab47('0xab')]);})[_0xab47('0x22')](respondWithResult(_0x325a5d,null))['catch'](APIHandleError(_0x325a5d));};exports[_0xab47('0x10c')]=function(_0x4b1fe5,_0x335707){var _0xe96d72={};var _0x8db8e8={};var _0x36cac6;var _0x1e8ad9;return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x4b1fe5[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x335707,null))['then'](function(_0x30fc79){if(_0x30fc79){_0x36cac6=_0x30fc79;_0x8db8e8[_0xab47('0xcb')]=_['keys'](db[_0xab47('0x10d')]['rawAttributes']);_0x8db8e8[_0xab47('0x42')]=_[_0xab47('0xcd')](_0x4b1fe5[_0xab47('0x42')]);_0x8db8e8[_0xab47('0xce')]=_['intersection'](_0x8db8e8[_0xab47('0xcb')],_0x8db8e8[_0xab47('0x42')]);_0xe96d72['attributes']=_[_0xab47('0xcf')](_0x8db8e8[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x4b1fe5[_0xab47('0x42')][_0xab47('0xdb')]));_0xe96d72[_0xab47('0x45')]=_0xe96d72[_0xab47('0x45')][_0xab47('0x4a')]?_0xe96d72['attributes']:_0x8db8e8[_0xab47('0xcb')];_0xe96d72[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x4b1fe5[_0xab47('0x42')][_0xab47('0xd1')]);_0xe96d72['where']=qs[_0xab47('0xce')](_['pick'](_0x4b1fe5['query'],_0x8db8e8[_0xab47('0xce')]));if(_0x4b1fe5[_0xab47('0x42')][_0xab47('0x2c')]){_0xe96d72[_0xab47('0xd2')]=_[_0xab47('0x55')](_0xe96d72[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0xe96d72['attributes'],function(_0x2989da){var _0x5609ff={};_0x5609ff[_0x2989da]={'$like':'%'+_0x4b1fe5[_0xab47('0x42')][_0xab47('0x2c')]+'%'};return _0x5609ff;})});}_0xe96d72=_[_0xab47('0x55')]({},_0xe96d72,_0x4b1fe5[_0xab47('0xd7')]);return _0x36cac6['getTeams'](_0xe96d72);}})['then'](function(_0x31a05d){if(_0x31a05d){_0x1e8ad9=_0x31a05d['length'];if(!_0x4b1fe5['query']['hasOwnProperty'](_0xab47('0xd6'))){_0xe96d72['limit']=qs[_0xab47('0x1d')](_0x4b1fe5[_0xab47('0x42')][_0xab47('0x1d')]);_0xe96d72[_0xab47('0x1b')]=qs[_0xab47('0x1b')](_0x4b1fe5[_0xab47('0x42')]['offset']);}return _0x36cac6[_0xab47('0x10c')](_0xe96d72);}})['then'](function(_0x2996f1){if(_0x2996f1){return _0x2996f1?{'count':_0x1e8ad9,'rows':_0x2996f1}:null;}})['then'](respondWithResult(_0x335707,null))[_0xab47('0x51')](handleError(_0x335707,null));};exports['addTeams']=function(_0x42a662,_0x47cb83){var _0x455852=_0x42a662['params']['id'];var _0x2fd369=_0x42a662['body']?_0x42a662['body'][_0xab47('0x5d')]:null;var _0x3be57b=[];return Promise[_0xab47('0x102')]()[_0xab47('0x22')](function(){if(!_0x2fd369)throw new APIBadRequestError(_0xab47('0x10e'));})[_0xab47('0x22')](function(){return db['User']['findOne']({'where':{'id':_0x455852}});})[_0xab47('0x22')](function(_0x3a8340){if(!_0x3a8340)throw new APINotFoundError(util[_0xab47('0xa6')](_0xab47('0xc5'),_0x42a662[_0xab47('0x53')]['id']));return db['sequelize'][_0xab47('0x10f')](function(_0x34d3da){return _0x3a8340[_0xab47('0x110')](_0x2fd369,{'transaction':_0x34d3da})[_0xab47('0x22')](function(){return db[_0xab47('0x10d')][_0xab47('0xca')]({'where':{'id':{'$in':_0x2fd369}}});})[_0xab47('0x22')](function(_0x428d5e){var _0x71f133=_[_0xab47('0x2e')](_0x428d5e,function(_0x371ceb){return _0x371ceb[_0xab47('0x111')]();});return Promise[_0xab47('0x50')](_0x71f133);})[_0xab47('0x22')](function(_0x2bb579){_0x3be57b=_['flattenDeep'](_0x2bb579);var _0x3006d9=_[_0xab47('0x2e')](_0x3be57b,function(_0xdf6732){return _0xdf6732['addAgent'](_0x3a8340['id'],{'transaction':_0x34d3da});});return Promise['all'](_0x3006d9);})[_0xab47('0x22')](function(){if(!_0x3a8340[_0xab47('0x98')])return;var _0x155416=_[_0xab47('0x2c')](_0x3be57b,function(_0x1281ab){return _0x1281ab[_0xab47('0x112')](_0xab47('0xab'))===_0xab47('0x113');});var _0x5cfd9c=_[_0xab47('0x2e')](_0x155416,function(_0x8716cf){return db[_0xab47('0xa9')][_0xab47('0x114')]({'membername':_0x3a8340[_0xab47('0x35')],'UserId':_0x3a8340['id'],'queue_name':_0x8716cf['name'],'VoiceQueueId':_0x8716cf['id'],'interface':_['isNil'](_0x3a8340[_0xab47('0x99')])?util[_0xab47('0xa6')]('SIP/%s',_0x3a8340['name']):_0x3a8340['interface'],'paused':_0x3a8340[_0xab47('0xa8')]||![],'penalty':_0x3a8340[_0xab47('0xa0')]},{'transaction':_0x34d3da});});return Promise['all'](_0x5cfd9c);})[_0xab47('0x22')](function(){return db[_0xab47('0x115')][_0xab47('0xca')]({'where':{'teamId':{'$in':_0x2fd369}}});})[_0xab47('0x22')](function(_0x4034b8){var _0x30cc88=_[_0xab47('0x2e')](_0x4034b8,function(_0x4c37d8){return db[_0xab47('0x116')][_0xab47('0x7b')]({'UserId':_0x3a8340['id'],'VoicePrefixId':_0x4c37d8['VoicePrefixId']},{'transaction':_0x34d3da});});return Promise[_0xab47('0x50')](_0x30cc88);});});})[_0xab47('0x22')](function(){for(var _0xf1724a=0x0;_0xf1724a<_0x3be57b['length'];_0xf1724a++){var _0x83b394=_0x3be57b[_0xf1724a][_0xab47('0x112')](_0xab47('0xab'));var _0x587924=_0x83b394+_0xab47('0xa2');socket[_0xab47('0x24')](_0xab47('0x28')+_0x83b394+_0xab47('0xa3'),{'UserId':_0x455852,['queueField']:_0x3be57b[_0xf1724a]['id']});}})[_0xab47('0x22')](respondWithStatusCode(_0x47cb83,null))[_0xab47('0x51')](APIHandleError(_0x47cb83));};exports[_0xab47('0x117')]=function(_0xe0d0c0,_0x51a05b){var _0x30ec5a=_0xe0d0c0['params']['id'];var _0xc77137=null;if(_0xe0d0c0[_0xab47('0x42')]['ids']){_0xc77137=_[_0xab47('0xad')](_0xe0d0c0[_0xab47('0x42')]['ids'])?_0xe0d0c0['query'][_0xab47('0x5d')]:[_0xe0d0c0[_0xab47('0x42')][_0xab47('0x5d')]];}var _0x1641d7=[];return Promise[_0xab47('0x102')]()[_0xab47('0x22')](function(){if(!_0xc77137)throw new APIBadRequestError(_0xab47('0x118'));})['then'](function(){return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x30ec5a}});})['then'](function(_0x856318){if(!_0x856318)throw new APINotFoundError(util[_0xab47('0xa6')]('User\x20with\x20id\x20%s\x20not\x20found',_0xe0d0c0['params']['id']));return db['sequelize'][_0xab47('0x10f')](function(_0x320248){return _0x856318['removeTeams'](_0xc77137,{'transaction':_0x320248})[_0xab47('0x22')](function(){return db[_0xab47('0x10d')]['findAll']({'where':{'id':{'$in':_0xc77137}}});})[_0xab47('0x22')](function(_0x5d8026){var _0xf00ad2=_[_0xab47('0x2e')](_0x5d8026,function(_0x3d04d7){return _0x3d04d7[_0xab47('0x111')]();});return Promise[_0xab47('0x50')](_0xf00ad2);})[_0xab47('0x22')](function(_0x179e52){_0x1641d7=_[_0xab47('0x119')](_0x179e52);var _0xc449ff=_[_0xab47('0x2e')](_0x1641d7,function(_0x3df884){return _0x3df884[_0xab47('0x11a')](_0x856318['id'],{'transaction':_0x320248});});return Promise[_0xab47('0x50')](_0xc449ff);})['then'](function(){if(!_0x856318[_0xab47('0x98')])return;var _0x315471=_[_0xab47('0x2c')](_0x1641d7,function(_0x5d4735){return _0x5d4735[_0xab47('0x112')](_0xab47('0xab'))===_0xab47('0x113');});var _0x4e7021=_[_0xab47('0x2e')](_0x315471,function(_0x23942b){return db[_0xab47('0xa9')][_0xab47('0x26')]({'where':{'VoiceQueueId':_0x23942b['id'],'UserId':_0x856318['id']},'transaction':_0x320248});});return Promise['all'](_0x4e7021);})[_0xab47('0x22')](function(){return db[_0xab47('0x115')][_0xab47('0xca')]({'where':{'teamId':{'$in':_0xc77137}}});})[_0xab47('0x22')](function(_0x4fb1e5){var _0x263ff8=_[_0xab47('0x2e')](_0x4fb1e5,function(_0x525a3e){return db[_0xab47('0x116')]['destroy']({'where':{'UserId':_0x856318['id'],'VoicePrefixId':_0x525a3e[_0xab47('0x11b')]}},{'transaction':_0x320248});});return Promise[_0xab47('0x50')](_0x263ff8);});});})[_0xab47('0x22')](function(){for(var _0x557fb1=0x0;_0x557fb1<_0x1641d7['length'];_0x557fb1++){var _0x677818=_0x1641d7[_0x557fb1][_0xab47('0x112')](_0xab47('0xab'));var _0x5e4137=_0x677818+_0xab47('0xa2');socket[_0xab47('0x24')](_0xab47('0x28')+_0x677818+_0xab47('0xae'),{'UserId':_0x30ec5a,['queueField']:_0x1641d7[_0x557fb1]['id']});}})['then'](respondWithStatusCode(_0x51a05b,null))[_0xab47('0x51')](APIHandleError(_0x51a05b));};exports[_0xab47('0x11c')]=function(_0x5e4117,_0x313bd4){var _0x431ec8={};var _0x3bf844={};var _0x379039;var _0x9d7db9;return db[_0xab47('0x37')]['findOne']({'where':{'id':_0x5e4117[_0xab47('0x53')]['id']}})[_0xab47('0x22')](handleEntityNotFound(_0x313bd4,null))[_0xab47('0x22')](function(_0x55ed4d){if(_0x55ed4d){_0x379039=_0x55ed4d;_0x3bf844[_0xab47('0xcb')]=_[_0xab47('0xcd')](db['CmList'][_0xab47('0x38')]);_0x3bf844['query']=_[_0xab47('0xcd')](_0x5e4117[_0xab47('0x42')]);_0x3bf844[_0xab47('0xce')]=_[_0xab47('0xcf')](_0x3bf844[_0xab47('0xcb')],_0x3bf844[_0xab47('0x42')]);_0x431ec8[_0xab47('0x45')]=_[_0xab47('0xcf')](_0x3bf844['model'],qs['fields'](_0x5e4117[_0xab47('0x42')][_0xab47('0xdb')]));_0x431ec8['attributes']=_0x431ec8[_0xab47('0x45')]['length']?_0x431ec8['attributes']:_0x3bf844[_0xab47('0xcb')];_0x431ec8[_0xab47('0xd0')]=qs[_0xab47('0xd1')](_0x5e4117['query'][_0xab47('0xd1')]);_0x431ec8[_0xab47('0xd2')]=qs[_0xab47('0xce')](_[_0xab47('0xd3')](_0x5e4117['query'],_0x3bf844['filters']));if(_0x5e4117[_0xab47('0x42')]['filter']){_0x431ec8[_0xab47('0xd2')]=_['merge'](_0x431ec8[_0xab47('0xd2')],{'$or':_[_0xab47('0x2e')](_0x431ec8[_0xab47('0x45')],function(_0x4424da){var _0x29ab35={};_0x29ab35[_0x4424da]={'$like':'%'+_0x5e4117['query'][_0xab47('0x2c')]+'%'};return _0x29ab35;})});}_0x431ec8=_[_0xab47('0x55')]({},_0x431ec8,_0x5e4117[_0xab47('0xd7')]);return _0x379039[_0xab47('0x11c')](_0x431ec8);}})[_0xab47('0x22')](function(_0x1ae966){if(_0x1ae966){_0x9d7db9=_0x1ae966[_0xab47('0x4a')];if(!_0x5e4117['query']['hasOwnProperty'](_0xab47('0xd6'))){_0x431ec8[_0xab47('0x1d')]=qs[_0xab47('0x1d')](_0x5e4117['query'][_0xab47('0x1d')]);_0x431ec8[_0xab47('0x1b')]=qs['offset'](_0x5e4117[_0xab47('0x42')][_0xab47('0x1b')]);}return _0x379039[_0xab47('0x11c')](_0x431ec8);}})[_0xab47('0x22')](function(_0x14a17e){if(_0x14a17e){return _0x14a17e?{'count':_0x9d7db9,'rows':_0x14a17e}:null;}})['then'](respondWithResult(_0x313bd4,null))['catch'](handleError(_0x313bd4,null));};exports['getAgents']=function(_0x3e64bb,_0x13b8fc){var _0x53872b={};var _0x39b871={};var _0x79ffca;return db[_0xab47('0x37')][_0xab47('0x94')]({'where':{'id':_0x3e64bb[_0xab47('0x53')]['id']}})['then'](handleEntityNotFound(_0x13b8fc,null))[_0xab47('0x22')](function(_0x4c6fe6){if(_0x4c6fe6){_0x79ffca=_0x4c6fe6;_0x39b871[_0xab47('0xcb')]=_[_0xab47('0xcd')](db[_0xab47('0x37')][_0xab47('0x38')]);_0x39b871['query']=_[_0xab47('0xcd')](_0x3e64bb[_0xab47('0x42')]);_0x39b871[_0xab47('0xce')]=_[_0xab47('0xcf')](_0x39b871[_0xab47('0xcb')],_0x39b871[_0xab47('0x42')]);_0x53872b[_0xab47('0x45')]=_[_0xab47('0xcf')](_0x39b871[_0xab47('0xcb')],qs[_0xab47('0xdb')](_0x3e64bb[_0xab47('0x42')][_0xab47('0xdb')]));_0x53872b[_0xab47('0x45')]=_0x53872b[_0xab47('0x45')][_0xab47('0x4a')]?_0x53872b[_0xab47('0x45')]:_0x39b871[_0xab47('0xcb')];_0x53872b['order']=qs['sort'](_0x3e64bb[_0xab47('0x42')][_0xab47('0xd1')]);_0x53872b[_0xab47('0xd2')]=qs[_0xab47('0xce')](_['pick'](_0x3e64bb[_0xab47('0x42')],_0x39b871['filters']));if(_0x3e64bb[_0xab47('0x42')][_0xab47('0x2c')]){_0x53872b['where']=_[_0xab47('0x55')](_0x53872b['where'],{'$or':_[_0xab47('0x2e')](_0x53872b[_0xab47('0x45')],function(_0x35cbbf){var _0x4ddfac={};_0x4ddfac[_0x35cbbf]={'$like':'%'+_0x3e64bb['query'][_0xab47('0x2c')]+'%'};return _0x4ddfac;})});}_0x53872b[_0xab47('0xcb')]=db[_0xab47('0x37')];_0x53872b['as']=_0xab47('0x29');_0x53872b=_[_0xab47('0x55')]({},_0x53872b,_0x3e64bb['options']);return _0x79ffca['getVoiceQueues']({'include':[_0x53872b]});}})[_0xab47('0x22')](function(_0x3cf3d5){if(_0x3cf3d5){var _0x4eb8a2={},_0x556f92=[];for(var _0xf43e5a=0x0;_0xf43e5a<_0x3cf3d5[_0xab47('0x4a')];_0xf43e5a+=0x1){for(var _0x435c98=0x0,_0x236f00;_0x435c98<_0x3cf3d5[_0xf43e5a][_0xab47('0x29')][_0xab47('0x4a')];_0x435c98+=0x1){_0x236f00=_0x3cf3d5[_0xf43e5a]['Agents'][_0x435c98][_0xab47('0xa4')]({'plain':!![]});_0x4eb8a2[_0x236f00['id']]=_0x236f00;}}_0x4eb8a2=_[_0xab47('0x11d')](_0x4eb8a2);for(var _0x4ea263=qs[_0xab47('0x1b')](_0x3e64bb['query'][_0xab47('0x1b')]);_0x4ea263<_0x4eb8a2[_0xab47('0x4a')]&&_0x556f92[_0xab47('0x4a')]=_0x1079e9){_0xd2f312=_0x1079e9;_0x1a52af=0xc8;}else{_0x1a52af=0xce;}_0x218c45['status'](_0x1a52af);return _0x218c45[_0xd893('0x1d')](_0xd893('0x1e'),_0x42458a+'-'+_0xd2f312+'/'+_0x1079e9)[_0xd893('0x18')](_0x53d270);}return null;};}function saveUpdates(_0x203e13){return function(_0x5f1c03){if(_0x5f1c03){return _0x5f1c03[_0xd893('0x1f')](_0x203e13)[_0xd893('0x20')](function(_0x556579){if(_0x556579['role']===_0xd893('0x21')){socket[_0xd893('0x22')](_0xd893('0x23')+_0x556579['id'],_0x556579);}return _0x556579;});}return null;};}function removeEntity(_0x1c6df9){return function(_0x5b81f8){if(_0x5b81f8){return _0x5b81f8[_0xd893('0x24')]()[_0xd893('0x20')](function(){var _0x5dc36e=_0x5b81f8[_0xd893('0x25')]({'plain':!![]});if(_0x5dc36e['role']===_0xd893('0x26'))return;var _0x45295a=[{'name':'Users','value':_0xd893('0x27'),'ignore':!![]},{'name':'Agents','value':_0xd893('0x21'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x61e883=_(_0x45295a)[_0xd893('0x28')](_0xd893('0x29'))[_0xd893('0x2a')](_0xd893('0x2b'))['value']();if(_[_0xd893('0x2c')](_0x61e883,_0x5dc36e['role'])){return;}var _0x271368=_[_0xd893('0x2d')](_0x45295a,['value',_0x5dc36e[_0xd893('0x2e')]])[_0xd893('0x2f')];return db['UserProfileResource'][_0xd893('0x24')]({'where':{'type':_0x271368,'resourceId':_0x5dc36e['id']}})['then'](function(){return _0x5b81f8;});})[_0xd893('0x20')](function(){_0x1c6df9[_0xd893('0x17')](0xcc)[_0xd893('0x16')]();});}};}function handleEntityNotFound(_0x56997c){return function(_0x229d58){if(!_0x229d58){_0x56997c[_0xd893('0x15')](0x194);}return _0x229d58;};}function handleError(_0x5be3a5,_0x2c18d4){_0x2c18d4=_0x2c18d4||0x1f4;return function(_0xb8bd4a){logger['error'](_0xb8bd4a[_0xd893('0x30')]);if(_0xb8bd4a[_0xd893('0x2f')]){delete _0xb8bd4a[_0xd893('0x2f')];}_0x5be3a5[_0xd893('0x17')](_0x2c18d4)[_0xd893('0x31')](_0xb8bd4a);};}function getUserAttributes(){return _(db[_0xd893('0x32')][_0xd893('0x33')])[_0xd893('0x2a')](function(_0xa42dc3){return{'name':_0xa42dc3[_0xd893('0x34')],'type':_0xa42dc3['type'][_0xd893('0x35')]};})[_0xd893('0x28')](function(_0x56eeb1){return![_0xd893('0x36'),_0xd893('0x37'),_0xd893('0x38'),_0xd893('0x39'),'resetPasswordExpires',_0xd893('0x3a')][_0xd893('0x2c')](_0x56eeb1[_0xd893('0x2f')]);})[_0xd893('0x2b')]();}exports[_0xd893('0x3b')]=function(_0x420fce,_0x140a76){var _0x51a90e={},_0x28be51={'count':0x0,'rows':[]};var _0x5000cb=getUserAttributes();_0x51a90e=qs['getOptions'](_0x5000cb,_0x420fce);var _0x577955={'where':_0x51a90e['where']};return db[_0xd893('0x32')][_0xd893('0x1b')](_0x577955)[_0xd893('0x20')](function(_0x2f79ce){_0x28be51[_0xd893('0x1b')]=_0x2f79ce;if(_0x420fce[_0xd893('0x3c')]['includeAll']){_0x51a90e[_0xd893('0x3d')]=[{'all':!![]}];}if(_0x420fce['query']['userSetting']===_0xd893('0x3e')){_0x51a90e[_0xd893('0x3d')]=[{'model':db[_0xd893('0x3f')],'as':_0xd893('0x40')}];}if(!_['includes'](_0x51a90e[_0xd893('0x41')],'id')){_0x51a90e['attributes'][_0xd893('0x42')]('id');}return db[_0xd893('0x32')][_0xd893('0x43')](_0x51a90e);})[_0xd893('0x20')](function(_0x41ea64){_0x28be51['rows']=_0x41ea64;if(_0x420fce[_0xd893('0x3c')][_0xd893('0x44')]===_0xd893('0x3e')){var _0x5a9e1c=[];for(var _0x410093=0x0;_0x410093<_0x28be51[_0xd893('0x45')]['length'];_0x410093++){_0x5a9e1c['push'](get_open_tabs(_0xd893('0x46'),_0x28be51[_0xd893('0x45')][_0x410093]['dataValues']));_0x5a9e1c['push'](get_open_tabs(_0xd893('0x47'),_0x28be51[_0xd893('0x45')][_0x410093][_0xd893('0x48')]));_0x5a9e1c[_0xd893('0x42')](get_open_tabs(_0xd893('0x49'),_0x28be51[_0xd893('0x45')][_0x410093][_0xd893('0x48')]));_0x5a9e1c[_0xd893('0x42')](get_open_tabs(_0xd893('0x4a'),_0x28be51[_0xd893('0x45')][_0x410093]['dataValues']));_0x5a9e1c['push'](get_open_tabs('openchannel',_0x28be51['rows'][_0x410093][_0xd893('0x48')]));_0x5a9e1c['push'](get_open_tabs(_0xd893('0x4b'),_0x28be51[_0xd893('0x45')][_0x410093][_0xd893('0x48')]));}return Promise[_0xd893('0x4c')](_0x5a9e1c)[_0xd893('0x20')](function(){return _0x28be51;});}else{return _0x28be51;}})['then'](respondWithFilteredResult(_0x140a76,_0x51a90e))[_0xd893('0x4d')](handleError(_0x140a76,null));};exports[_0xd893('0x4e')]=function(_0x5c7c12,_0xf782e8){var _0x1562c6=getUserAttributes();_0x5c7c12[_0xd893('0x3c')]['id']=_0x5c7c12[_0xd893('0x4f')]['id'];var _0x227847=qs[_0xd893('0x50')](_0x1562c6,_0x5c7c12);if(_0x5c7c12[_0xd893('0x3c')][_0xd893('0x51')]){_0x227847[_0xd893('0x3d')]=[{'all':!![]}];}if(_0x5c7c12[_0xd893('0x3c')][_0xd893('0x40')]===_0xd893('0x3e')){_0x227847[_0xd893('0x3d')]=[{'model':db[_0xd893('0x3f')],'as':_0xd893('0x40')}];}_0x227847=_[_0xd893('0x52')]({},_0x227847,_0x5c7c12[_0xd893('0x53')]);if(!_[_0xd893('0x2c')](_0x227847[_0xd893('0x41')],'id')){_0x227847[_0xd893('0x41')][_0xd893('0x42')]('id');}return db[_0xd893('0x32')]['find'](_0x227847)['then'](handleEntityNotFound(_0xf782e8,null))[_0xd893('0x20')](function(_0x123450){var _0x27a827=[];values=_0x123450;if(_0x5c7c12[_0xd893('0x3c')][_0xd893('0x44')]===_0xd893('0x3e')){_0x27a827[_0xd893('0x42')](get_open_tabs('chat',_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x47'),_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x54'),_0x123450['dataValues']));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x4b'),_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x49'),_0x123450[_0xd893('0x48')]));_0x27a827[_0xd893('0x42')](get_open_tabs(_0xd893('0x4a'),_0x123450[_0xd893('0x48')]));return Promise[_0xd893('0x4c')](_0x27a827);}else{return values;}})[_0xd893('0x20')](function(){return values;})[_0xd893('0x20')](respondWithResult(_0xf782e8,null))['catch'](handleError(_0xf782e8,null));};exports[_0xd893('0x1f')]=function(_0x5bee59,_0x15e9ab){if(_0x5bee59[_0xd893('0x55')]['id']){delete _0x5bee59[_0xd893('0x55')]['id'];}delete _0x5bee59[_0xd893('0x55')]['role'];return db['User'][_0xd893('0x2d')]({'where':{'id':_0x5bee59[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x15e9ab,null))[_0xd893('0x20')](saveUpdates(_0x5bee59[_0xd893('0x55')],null))[_0xd893('0x20')](respondWithResult(_0x15e9ab,null))['catch'](handleError(_0x15e9ab,null));};exports[_0xd893('0x56')]=function(_0x4dfe19,_0xa8213a){return db[_0xd893('0x32')][_0xd893('0x56')]()[_0xd893('0x20')](respondWithResult(_0xa8213a,null))[_0xd893('0x4d')](handleError(_0xa8213a,null));};exports[_0xd893('0x57')]=function(_0x1b7f32,_0x519ca5){return db['User'][_0xd893('0x2d')]({'where':{'id':_0x1b7f32['params']['id']}})['then'](handleEntityNotFound(_0x519ca5,null))[_0xd893('0x20')](function(_0x541e6e){if(_0x541e6e){return _0x541e6e[_0xd893('0x57')](_0x1b7f32[_0xd893('0x55')]['ids'],_[_0xd893('0x58')](_0x1b7f32[_0xd893('0x55')],['ids','id'])||{});}})[_0xd893('0x20')](respondWithResult(_0x519ca5,null))['catch'](handleError(_0x519ca5,null));};function validateUser(_0x184741){return new Promise(function(_0x159655,_0x12ef53){if(_0x184741[_0xd893('0x59')])return _0x159655(_0x184741);return db['Setting'][_0xd893('0x5a')](0x1)[_0xd893('0x20')](function(_0x59d3f9){if(_0x59d3f9[_0xd893('0x5b')])authService[_0xd893('0x5c')](_0x184741[_0xd893('0x36')]);db[_0xd893('0x32')][_0xd893('0x5d')](_0xd893('0x59'))[_0xd893('0x20')](function(_0x338e5e){if(_[_0xd893('0x5e')](_0x338e5e)){_0x184741[_0xd893('0x59')]=_0x59d3f9[_0xd893('0x5f')]||0x1;return;}if(_[_0xd893('0x5e')](_0x59d3f9[_0xd893('0x5f')])||_0x59d3f9['min_internal']===_0x338e5e){_0x184741[_0xd893('0x59')]=_0x338e5e+0x1;return;}if(_0x59d3f9[_0xd893('0x5f')]>_0x338e5e){_0x184741[_0xd893('0x59')]=_0x59d3f9[_0xd893('0x5f')];return;}return db[_0xd893('0x60')][_0xd893('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd893('0x60')][_0xd893('0x61')][_0xd893('0x62')]})['then'](function(_0x2c81c1){if(_0x2c81c1&&_0x2c81c1[_0xd893('0x63')]){for(var _0x3adfd5=0x0,_0x11f036=_0x2c81c1[_0xd893('0x63')];_0x3adfd5<_0x11f036&&_[_0xd893('0x5e')](_0x184741['internal']);_0x3adfd5++){if(_0x59d3f9[_0xd893('0x5f')]<=_0x2c81c1[_0x3adfd5][_0xd893('0x64')]){_0x184741[_0xd893('0x59')]=_0x2c81c1[_0x3adfd5]['from'];}else if(_0x59d3f9['min_internal']>_0x2c81c1[_0x3adfd5]['from']&&_0x59d3f9[_0xd893('0x5f')]<=_0x2c81c1[_0x3adfd5]['to']){_0x184741[_0xd893('0x59')]=_0x59d3f9[_0xd893('0x5f')];}}}if(_['isNil'](_0x184741[_0xd893('0x59')])){_0x184741[_0xd893('0x59')]=_0x338e5e+0x1;}return _0x159655(_0x184741);});});})['catch'](function(_0x5d9613){_0x12ef53(_0x5d9613);});});}function updateUser(_0x43d031){return new Promise(function(_0x3908ad,_0x57e5ae){try{if(_0x43d031[_0xd893('0x65')]){_0x43d031[_0xd893('0x66')]=_0x43d031[_0xd893('0x59')];_0x43d031[_0xd893('0x67')]={'mailbox':_0x43d031['internal'],'password':_0x43d031[_0xd893('0x36')],'fullname':_0x43d031['fullname'],'email':_0x43d031[_0xd893('0x68')]};}if(_0x43d031[_0xd893('0x2e')]===_0xd893('0x21')){if(!_0x43d031[_0xd893('0x69')])_0x43d031['permissions']=[_0xd893('0x6a'),'102',_0xd893('0x6b'),'113',_0xd893('0x6c'),_0xd893('0x6d'),'105',_0xd893('0x6e'),_0xd893('0x6f'),_0xd893('0x70'),_0xd893('0x71'),_0xd893('0x72'),'111',_0xd893('0x73'),'115'];}_0x3908ad(_0x43d031);}catch(_0x38a2b3){_0x57e5ae(_0x38a2b3);}});}exports[_0xd893('0x74')]=function(_0x392bef,_0x1d6e9a){if(_0x392bef[_0xd893('0x27')]['role']==='agent')throw new Error(_0xd893('0x75'));if(_0x392bef['body'][_0xd893('0x2e')]===_0xd893('0x27')&&_0x392bef[_0xd893('0x27')][_0xd893('0x2e')]!==_0xd893('0x26')){throw new Error(_0xd893('0x76'));}if(_0x392bef['body']['role']==='admin'&&_0x392bef['user'][_0xd893('0x2e')]!=='admin'){throw new Error(_0xd893('0x77'));}return licenseUtil[_0xd893('0x78')]([_0x392bef['body']])[_0xd893('0x20')](function(){return validateUser(_0x392bef[_0xd893('0x55')]);})['then'](function(_0xe1c5ef){return updateUser(_0xe1c5ef)[_0xd893('0x20')](function(_0x42521e){if(_0x42521e[_0xd893('0x2e')]==='admin'){_0x42521e[_0xd893('0x79')]=_0x392bef[_0xd893('0x27')][_0xd893('0x79')];delete _0x42521e[_0xd893('0x7a')];}return _0x42521e;});})['then'](function(_0x4dc24d){return db[_0xd893('0x32')][_0xd893('0x74')](_0x4dc24d,{'include':[{'model':db[_0xd893('0x67')],'as':_0xd893('0x67')}]});})[_0xd893('0x20')](function(_0x3b93cf){if(_0x392bef[_0xd893('0x55')][_0xd893('0x2e')]===_0xd893('0x27'))return _0x3b93cf;if(_0x392bef[_0xd893('0x27')]['role']!==_0xd893('0x27'))return _0x3b93cf;return db[_0xd893('0x7b')][_0xd893('0x2d')]({'where':{'name':_0x3b93cf[_0xd893('0x2e')]===_0xd893('0x21')?_0xd893('0x7c'):_0xd893('0x7d'),'userProfileId':_0x392bef['user']['userProfileId']},'raw':!![]})[_0xd893('0x20')](function(_0x751a0c){if(!_0x751a0c||_0x751a0c[_0xd893('0x7e')]!=0x0)return _0x3b93cf;return db[_0xd893('0x7f')]['create']({'name':_0x3b93cf[_0xd893('0x2f')],'resourceId':_0x3b93cf['id'],'type':_0x751a0c['name'],'sectionId':_0x751a0c['id']},{})['then'](function(){return _0x3b93cf;});})['catch'](function(_0x517d26){logger['error'](_0xd893('0x80'),_0x517d26);throw _0x517d26;});})[_0xd893('0x20')](respondWithResult(_0x1d6e9a,0xc9))[_0xd893('0x4d')](handleError(_0x1d6e9a,null));};exports[_0xd893('0x81')]=function(_0x2da5f3,_0x3f9ad9){var _0x1e8f89=_0x2da5f3[_0xd893('0x55')];var _0x11f933=[];if(_0x2da5f3[_0xd893('0x27')][_0xd893('0x2e')]===_0xd893('0x21'))throw new Error(_0xd893('0x75'));if(_[_0xd893('0x82')](_0x1e8f89,[_0xd893('0x2e'),_0xd893('0x27')])&&_0x2da5f3[_0xd893('0x27')]['role']!==_0xd893('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd893('0x82')](_0x1e8f89,['role','admin'])&&_0x2da5f3[_0xd893('0x27')]['role']!==_0xd893('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xd893('0x78')](_0x1e8f89)[_0xd893('0x20')](function(){return validateUser(_0x1e8f89[0x0]);})[_0xd893('0x20')](function(){for(var _0x478f8f=0x1;_0x478f8f<_0x1e8f89['length'];_0x478f8f++){var _0x310899=_0x1e8f89[_0x478f8f-0x1][_0xd893('0x59')];if(!_0x1e8f89[_0x478f8f][_0xd893('0x59')])_0x1e8f89[_0x478f8f][_0xd893('0x59')]=_0x310899+0x1;_0x11f933[_0xd893('0x42')](validateUser(_0x1e8f89[_0x478f8f]));}return Promise[_0xd893('0x4c')](_0x11f933);})[_0xd893('0x20')](function(){_0x11f933=[];for(var _0x456a70=0x0;_0x456a70<_0x1e8f89[_0xd893('0x63')];_0x456a70++){_0x11f933[_0xd893('0x42')](updateUser(_0x1e8f89[_0x456a70]));}return Promise[_0xd893('0x4c')](_0x11f933);})[_0xd893('0x20')](function(){_0x11f933=_0x1e8f89['map'](function(_0x16a7d6){return db['User'][_0xd893('0x74')](_0x16a7d6,{'include':[{'model':db[_0xd893('0x67')],'as':_0xd893('0x67')}]})[_0xd893('0x20')](function(_0x578fe6){_0x16a7d6['id']=_0x578fe6['id'];return _0x16a7d6;});});return Promise['all'](_0x11f933);})[_0xd893('0x20')](function(_0x408a2f){if(_0x2da5f3[_0xd893('0x55')]['role']===_0xd893('0x27'))return _0x408a2f;if(_0x2da5f3['user']['role']!==_0xd893('0x27'))return _0x408a2f;var _0x2602c5=_[_0xd893('0x82')](_0x408a2f,function(_0x28cf09){return _0x28cf09[_0xd893('0x2e')]===_0xd893('0x21')||_0x28cf09[_0xd893('0x2e')]===_0xd893('0x83');});if(!_0x2602c5)return _0x408a2f;return db['UserProfileSection'][_0xd893('0x43')]({'where':{'name':{'$or':['Agents',_0xd893('0x7d')]},'userProfileId':_0x2da5f3[_0xd893('0x27')][_0xd893('0x7a')]},'raw':!![]})[_0xd893('0x20')](function(_0xaea3b2){if(_[_0xd893('0x84')](_0xaea3b2)||!_[_0xd893('0x82')](_0xaea3b2,[_0xd893('0x7e'),0x0]))return _0x408a2f;_0x11f933=[];var _0x51957d=_(_0xaea3b2)[_0xd893('0x2a')](function(_0x837c8a){if(_0x837c8a['autoAssociation']===0x1)return;return _0x837c8a[_0xd893('0x2f')]===_0xd893('0x7c')?_0xd893('0x21'):_0xd893('0x83');})['compact']()[_0xd893('0x2b')]();for(var _0x26e22e=0x0;_0x26e22e<_0x408a2f[_0xd893('0x63')];_0x26e22e++){if(!_['includes'](_0x51957d,_0x408a2f[_0x26e22e][_0xd893('0x2e')]))return;var _0x3d4118=_0x408a2f[_0x26e22e][_0xd893('0x2e')]==='agent'?'Agents':_0xd893('0x7d');_0x11f933[_0xd893('0x42')](db['UserProfileResource']['create']({'name':_0x408a2f[_0x26e22e][_0xd893('0x2f')],'resourceId':_0x408a2f[_0x26e22e]['id'],'type':_0x3d4118,'sectionId':_[_0xd893('0x2d')](_0xaea3b2,[_0xd893('0x2f'),_0x3d4118])['id']},{}));}return Promise['all'](_0x11f933);});})['then'](respondWithResult(_0x3f9ad9,0xc9))['catch'](handleError(_0x3f9ad9,null));};exports['changePassword']=function(_0x52f7d2,_0x1bba39){if(_0x52f7d2[_0xd893('0x55')]['id']){delete _0x52f7d2['body']['id'];}return db['User'][_0xd893('0x2d')]({'where':{'id':_0x52f7d2[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](function(_0x2064b6){if(!_0x2064b6)return null;if(_0x2064b6['id']===_0x52f7d2[_0xd893('0x27')]['id']){if(!_0x52f7d2[_0xd893('0x55')][_0xd893('0x85')]||!_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0x89'));}if(!_0x2064b6['authenticate'](_0x52f7d2['body'][_0xd893('0x85')])){throw new db['Sequelize'][(_0xd893('0x88'))](_0xd893('0x8a'));}if(_0x52f7d2[_0xd893('0x55')][_0xd893('0x85')]===_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))]['ValidationError'](_0xd893('0x8b'));}}else if(_0x52f7d2['user'][_0xd893('0x2e')]===_0xd893('0x26')){if(!_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x52f7d2[_0xd893('0x27')][_0xd893('0x2e')]===_0xd893('0x27')){if(!_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')]){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0x8c'));}if(_0x2064b6['role']!==_0xd893('0x21')){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))]('Unauthorized');}}else{throw new db[(_0xd893('0x87'))]['ValidationError']('Unauthorized');}return _0x2064b6;})[_0xd893('0x20')](handleEntityNotFound(_0x1bba39,null))[_0xd893('0x20')](function(_0x250b83){return db[_0xd893('0x8d')]['findOne']({'attributes':['id',_0xd893('0x5b'),_0xd893('0x8e'),_0xd893('0x8f')]})['then'](function(_0xf810c1){if(_0xf810c1['securePassword'])authService[_0xd893('0x5c')](_0x52f7d2[_0xd893('0x55')]['newPassword']);if(!_0xf810c1[_0xd893('0x8e')]||!_0x250b83[_0xd893('0x38')])return _0x250b83;authService[_0xd893('0x90')](_0x52f7d2[_0xd893('0x55')]['newPassword'],_0x250b83[_0xd893('0x38')],_0xf810c1[_0xd893('0x8f')]);return _0x250b83;})[_0xd893('0x20')](saveUpdates({'password':_0x52f7d2[_0xd893('0x55')][_0xd893('0x86')],'passwordResetAt':_0x52f7d2['user']['id']==_0x52f7d2[_0xd893('0x4f')]['id']?moment():null,'previousPasswords':authService[_0xd893('0x91')](_0x52f7d2['body'][_0xd893('0x86')],_0x250b83[_0xd893('0x38')])},null));})['then'](respondWithResult(_0x1bba39,null))[_0xd893('0x4d')](handleError(_0x1bba39,null));};exports['addQueues']=function(_0x32ae12,_0x10c4b1){var _0x462def=_0x32ae12[_0xd893('0x55')][_0xd893('0x92')];return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x32ae12[_0xd893('0x4f')]['id']},'attributes':['id','name',_0xd893('0x2e'),'online',_0xd893('0x93'),_0xd893('0x94'),_0xd893('0x95')]})[_0xd893('0x20')](handleEntityNotFound(_0x10c4b1,null))[_0xd893('0x20')](function(_0xc77a33){if(_0xc77a33){if(!utils[_0xd893('0x96')](_0x462def)){throw new db[(_0xd893('0x87'))]['ValidationError']('Unknown\x20channel');}return _0xc77a33['add'+_[_0xd893('0x97')](_0x462def[_0xd893('0x98')]())+'Queues'](_0x32ae12[_0xd893('0x55')]['ids'],{'penalty':_0x32ae12[_0xd893('0x55')][_0xd893('0x99')]||0x0})[_0xd893('0x9a')](function(_0x5800ea){for(var _0x2cdee0=0x0;_0x2cdee0<_0x32ae12['body'][_0xd893('0x9b')][_0xd893('0x63')];_0x2cdee0+=0x1){var _0x5dc884={'UserId':Number(_0x32ae12[_0xd893('0x4f')]['id'])};_0x5dc884[_[_0xd893('0x97')](_0x462def[_0xd893('0x98')]())+_0xd893('0x9c')]=Number(_0x32ae12['body']['ids'][_0x2cdee0]);socket['emit'](_0xd893('0x27')+_['capitalize'](_0x462def[_0xd893('0x98')]())+'Queue:save',_0x5dc884);}return _0x5800ea;})[_0xd893('0x20')](function(){if(_0x462def===_0xd893('0x9d')){return db[_0xd893('0x9e')][_0xd893('0x43')]({'where':{'id':_0x32ae12['body']['ids']||[]},'raw':!![],'attributes':['id',_0xd893('0x2f')]});}})[_0xd893('0x20')](function(_0x4bf2a0){var _0x373953=_0xc77a33['get']({'plain':!![]});var _0x1e3f77=[];if(_0x462def===_0xd893('0x9d')&&_0x373953[_0xd893('0x2e')]===_0xd893('0x21')&&_0x373953[_0xd893('0x9f')]){for(let _0x475a97=0x0;_0x475a97<_0x4bf2a0[_0xd893('0x63')];_0x475a97+=0x1){_0x1e3f77[_0xd893('0x42')]({'membername':_0x373953[_0xd893('0x2f')],'UserId':_0x373953['id'],'queue_name':_0x4bf2a0[_0x475a97]['name'],'VoiceQueueId':_0x4bf2a0[_0x475a97]['id'],'interface':_['isNil'](_0x373953[_0xd893('0x95')])?util[_0xd893('0xa0')]('SIP/%s',_0x373953[_0xd893('0x2f')]):_0x373953[_0xd893('0x95')],'paused':_0x373953[_0xd893('0x94')]||![],'penalty':_0x32ae12[_0xd893('0x55')][_0xd893('0x99')]||0x0});}return Promise[_0xd893('0x4c')](_0x1e3f77[_0xd893('0x2a')](function(_0xc43f72){return db['UserVoiceQueueRt'][_0xd893('0xa1')](_0xc43f72);}));}return _0xc77a33;});}})[_0xd893('0x20')](respondWithStatusCode(_0x10c4b1,null))['catch'](handleError(_0x10c4b1,null));};exports[_0xd893('0xa2')]=function(_0x25379c,_0x53e81d){var _0x2227f1,_0xc2bcd8;return db[_0xd893('0x32')]['find']({'where':{'id':_0x25379c[_0xd893('0x4f')]['id']},'attributes':['id',_0xd893('0x2f'),_0xd893('0x2e')]})['then'](handleEntityNotFound(_0x53e81d,null))[_0xd893('0x20')](function(_0x30d591){if(_0x30d591){_0x2227f1=_0x30d591;if(!_0x25379c[_0xd893('0x3c')]['channel']||!utils['isValidChannel'](_0x25379c[_0xd893('0x3c')]['channel'])){throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))]('Unknown\x20channel');}return _0x30d591[_0xd893('0xa3')+_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0xa4')](_0x25379c['query']['ids']);}})[_0xd893('0x20')](function(_0xbd7e02){if(_[_0xd893('0xa5')](_0x25379c[_0xd893('0x3c')]['ids'])){for(var _0x1e630c=0x0;_0x1e630c<_0x25379c[_0xd893('0x3c')]['ids'][_0xd893('0x63')];_0x1e630c+=0x1){_0xc2bcd8={'UserId':Number(_0x25379c[_0xd893('0x4f')]['id'])};_0xc2bcd8[_['capitalize'](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0x9c')]=Number(_0x25379c[_0xd893('0x3c')][_0xd893('0x9b')][_0x1e630c]);socket['emit'](_0xd893('0x27')+_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0xa6'),_0xc2bcd8);}}else{_0xc2bcd8={'UserId':Number(_0x25379c[_0xd893('0x4f')]['id'])};_0xc2bcd8[_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')]['toLowerCase']())+_0xd893('0x9c')]=Number(_0x25379c[_0xd893('0x3c')][_0xd893('0x9b')]);socket[_0xd893('0x22')]('user'+_[_0xd893('0x97')](_0x25379c[_0xd893('0x3c')][_0xd893('0x92')][_0xd893('0x98')]())+_0xd893('0xa6'),_0xc2bcd8);}return _0xbd7e02;})['then'](function(){if(_0x25379c[_0xd893('0x3c')][_0xd893('0x92')]===_0xd893('0x9d')){return db[_0xd893('0xa7')][_0xd893('0x24')]({'where':{'UserId':_0x25379c['params']['id'],'VoiceQueueId':_0x25379c[_0xd893('0x3c')]['ids']},'individualHooks':!![]})[_0xd893('0x20')](function(){return _0x2227f1;});}return _0x2227f1;})['then'](respondWithStatusCode(_0x53e81d,null))[_0xd893('0x4d')](handleError(_0x53e81d,null));};exports[_0xd893('0xa8')]=function(_0x57a47f,_0x549f49){_0x57a47f[_0xd893('0x55')][_0xd893('0xa9')]=_0x57a47f['file'][_0xd893('0xaa')];return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x57a47f['params']['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x549f49,null))[_0xd893('0x20')](saveUpdates(_0x57a47f[_0xd893('0x55')],null))[_0xd893('0x20')](respondWithResult(_0x549f49,null))[_0xd893('0x4d')](handleError(_0x549f49,null));};exports[_0xd893('0xab')]=function(_0x2bf27a,_0x498c53){var _0x2cc17d=path[_0xd893('0xac')](config[_0xd893('0xad')],_0xd893('0xae'));return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x2bf27a[_0xd893('0x4f')]['id']},'attributes':['id',_0xd893('0xa9')],'raw':!![]})['then'](handleEntityNotFound(_0x498c53,null))['then'](function(_0x22e62e){if(_0x22e62e){if(_[_0xd893('0x5e')](_0x22e62e[_0xd893('0xa9')])){return _0x498c53[_0xd893('0xaf')](_0x2cc17d);}else{if(!fs['existsSync'](path['join'](config[_0xd893('0xad')],_0xd893('0xb0'),_0x22e62e[_0xd893('0xa9')]))){return _0x498c53[_0xd893('0xaf')](_0x2cc17d);}return _0x498c53['download'](path[_0xd893('0xac')](config[_0xd893('0xad')],_0xd893('0xb0'),_0x22e62e[_0xd893('0xa9')]));}}})[_0xd893('0x4d')](handleError(_0x498c53,null));};exports[_0xd893('0xb1')]=function(_0x749d4e,_0x295b67){return db['User'][_0xd893('0x2d')]({'where':{'id':_0x749d4e['params']['id']},'attributes':['id']})[_0xd893('0x20')](handleEntityNotFound(_0x295b67,null))['then'](function(_0x982b74){var _0x37d188=[];values=_0x982b74[_0xd893('0x48')];_0x37d188[_0xd893('0x42')](get_open_tabs(_0xd893('0x46'),_0x982b74[_0xd893('0x48')]));_0x37d188[_0xd893('0x42')](get_open_tabs('sms',_0x982b74['dataValues']));_0x37d188[_0xd893('0x42')](get_open_tabs(_0xd893('0x54'),_0x982b74[_0xd893('0x48')]));_0x37d188[_0xd893('0x42')](get_open_tabs(_0xd893('0x4b'),_0x982b74[_0xd893('0x48')]));_0x37d188[_0xd893('0x42')](get_open_tabs('fax',_0x982b74['dataValues']));_0x37d188['push'](get_open_tabs('mail',_0x982b74[_0xd893('0x48')]));return Promise[_0xd893('0x4c')](_0x37d188);})[_0xd893('0x20')](function(_0x49717a){if(_0x49717a){var _0x51c2d0=_[_0xd893('0x2a')](values[_0xd893('0xb2')],function(_0x3157f0){return{'channel':_0xd893('0xb3'),'id':_0x3157f0['id'],'createdAt':_0x3157f0[_0xd893('0xb4')]};});var _0x4eef72=_[_0xd893('0x2a')](values[_0xd893('0xb5')],function(_0x540829){return{'channel':_0xd893('0xb6'),'id':_0x540829['id'],'createdAt':_0x540829['createdAt']};});var _0x364627=_['map'](values[_0xd893('0xb7')],function(_0x49148b){return{'channel':_0xd893('0xb8'),'id':_0x49148b['id'],'createdAt':_0x49148b['createdAt']};});var _0x3c94d0=_[_0xd893('0x2a')](values[_0xd893('0xb9')],function(_0x3b8abd){return{'channel':_0xd893('0xba'),'id':_0x3b8abd['id'],'createdAt':_0x3b8abd['createdAt']};});var _0x470e9d=_[_0xd893('0x2a')](values[_0xd893('0xbb')],function(_0x24d689){return{'channel':'SMS','id':_0x24d689['id'],'createdAt':_0x24d689[_0xd893('0xb4')]};});var _0x4c30cd=_['map'](values[_0xd893('0xbc')],function(_0x56ef72){return{'channel':_0xd893('0xbd'),'id':_0x56ef72['id'],'createdAt':_0x56ef72[_0xd893('0xb4')]};});var _0x430635=_[_0xd893('0xbe')](_0x51c2d0,_0x4eef72,_0x364627,_0x3c94d0,_0x470e9d,_0x4c30cd);var _0x3f61a7={'count':_0x430635[_0xd893('0x63')],'rows':_0x430635};return _0x3f61a7;}else return null;})[_0xd893('0x20')](respondWithResult(_0x295b67,null))[_0xd893('0x4d')](handleError(_0x295b67,null));};exports[_0xd893('0xbf')]=function(_0x27960c,_0x37a4da){var _0x2a98f8={};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x27960c[_0xd893('0x4f')]['id']}})['then'](function(_0x580f3a){if(!_0x580f3a){throw new APINotFoundError(util[_0xd893('0xa0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x27960c['params']['id']));}return contacts[_0xd893('0x56')]();})[_0xd893('0x20')](function(_0x4dfe13){_0x27960c[_0xd893('0x3c')][_0xd893('0x32')]=_0x27960c[_0xd893('0x4f')]['id'];_0x2a98f8=qs[_0xd893('0x50')](_0x4dfe13,_0x27960c);if(_0x27960c[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0x51'))){_0x2a98f8['include']=[{'model':db[_0xd893('0xc2')],'as':_0xd893('0xc3'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd893('0x2f'),_0xd893('0xc4')],'where':_0x27960c[_0xd893('0x3c')][_0xd893('0xc5')]?{'id':_0x27960c[_0xd893('0x3c')][_0xd893('0xc5')]}:undefined,'required':_0x27960c[_0xd893('0x3c')]['tag']?!![]:![]}];}return contacts[_0xd893('0x43')](_0x27960c[_0xd893('0x3c')],_0x27960c[_0xd893('0x27')],_0x2a98f8,_0x4dfe13);})[_0xd893('0x20')](respondWithFilteredResult(_0x37a4da,_0x2a98f8))[_0xd893('0x4d')](APIHandleError(_0x37a4da));};exports['getQueues']=function(_0x19eaf2,_0x14ab4f){var _0x27f346;var _0x29ed90={};var _0x41b96e;return db['User']['findOne']({'where':{'id':_0x19eaf2['params']['id']},'attributes':['id',_0xd893('0x2f'),'role']})[_0xd893('0x20')](handleEntityNotFound(_0x14ab4f,null))[_0xd893('0x20')](function(_0x23987e){if(!utils[_0xd893('0x96')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x92')])){throw new db['Sequelize'][(_0xd893('0x88'))](_0xd893('0xc6'));}_0x27f346=_0x23987e;var _0x25a498={};_0x25a498[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_[_0xd893('0x97')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x92')])+_0xd893('0xc9')][_0xd893('0x33')]);_0x25a498[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x19eaf2['query']);_0x25a498[_0xd893('0xca')]=_['intersection'](_0x25a498[_0xd893('0xc7')],_0x25a498[_0xd893('0x3c')]);_0x29ed90[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x25a498['model'],qs[_0xd893('0xcc')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0xcc')]));_0x29ed90[_0xd893('0x41')]=_0x29ed90[_0xd893('0x41')][_0xd893('0x63')]?_0x29ed90[_0xd893('0x41')]:_0x25a498[_0xd893('0xc7')];_0x29ed90[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x19eaf2[_0xd893('0x3c')]['sort']);_0x29ed90[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x19eaf2['query'],_0x25a498[_0xd893('0xca')]));if(_0x19eaf2[_0xd893('0x3c')]['filter']){_0x29ed90[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x29ed90[_0xd893('0xcf')],{'$or':_['map'](_0x29ed90[_0xd893('0x41')],function(_0x22436f){var _0x3f3616={};_0x3f3616[_0x22436f]={'$like':'%'+_0x19eaf2[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x3f3616;})});}_0x29ed90=_['merge']({},_0x29ed90,_0x19eaf2[_0xd893('0x53')]);switch(_0x27f346[_0xd893('0x2e')]){case _0xd893('0x26'):return db[_['capitalize'](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x92')])+_0xd893('0xc9')][_0xd893('0x43')](_0x29ed90);case'user':case'agent':return _0x27f346[_0xd893('0x25')+_[_0xd893('0x97')](_0x19eaf2['query'][_0xd893('0x92')])+_0xd893('0xa4')](_0x29ed90);default:throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0xd1'));}})[_0xd893('0x20')](function(_0xed8c06){_0x41b96e=_0xed8c06[_0xd893('0x63')];if(!_0x19eaf2[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x29ed90['limit']=qs[_0xd893('0x1c')](_0x19eaf2[_0xd893('0x3c')][_0xd893('0x1c')]);_0x29ed90[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x19eaf2['query'][_0xd893('0x19')]);}switch(_0x27f346['role']){case _0xd893('0x26'):return db[_['capitalize'](_0x19eaf2[_0xd893('0x3c')]['channel'])+_0xd893('0xc9')][_0xd893('0x43')](_0x29ed90);case _0xd893('0x27'):case _0xd893('0x21'):return _0x27f346['get'+_['capitalize'](_0x19eaf2['query'][_0xd893('0x92')])+'Queues'](_0x29ed90);}})[_0xd893('0x20')](function(_0x285355){return{'count':_0x41b96e,'rows':_0x285355};})[_0xd893('0x20')](respondWithResult(_0x14ab4f,null))[_0xd893('0x4d')](handleError(_0x14ab4f,null));};exports[_0xd893('0xd3')]=function(_0x4c84ba,_0xaf8b11){var _0x16a146={};var _0x1eced9={};var _0x50e2c8;var _0x20cae5;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x4c84ba[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0xaf8b11,null))[_0xd893('0x20')](function(_0x9252dd){if(_0x9252dd){_0x50e2c8=_0x9252dd;_0x1eced9[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xa7')][_0xd893('0x33')]);_0x1eced9[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x4c84ba[_0xd893('0x3c')]);_0x1eced9[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x1eced9['model'],_0x1eced9[_0xd893('0x3c')]);_0x16a146['attributes']=_[_0xd893('0xcb')](_0x1eced9['model'],qs[_0xd893('0xcc')](_0x4c84ba['query'][_0xd893('0xcc')]));_0x16a146[_0xd893('0x41')]=_0x16a146[_0xd893('0x41')]['length']?_0x16a146[_0xd893('0x41')]:_0x1eced9[_0xd893('0xc7')];_0x16a146[_0xd893('0xcd')]=qs['sort'](_0x4c84ba[_0xd893('0x3c')][_0xd893('0xce')]);_0x16a146[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x4c84ba[_0xd893('0x3c')],_0x1eced9[_0xd893('0xca')]));if(_0x4c84ba[_0xd893('0x3c')][_0xd893('0x28')]){_0x16a146[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x16a146[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x16a146[_0xd893('0x41')],function(_0x452dc0){var _0x226ca9={};_0x226ca9[_0x452dc0]={'$like':'%'+_0x4c84ba[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x226ca9;})});}_0x16a146=_[_0xd893('0x52')]({},_0x16a146,_0x4c84ba[_0xd893('0x53')]);return _0x50e2c8[_0xd893('0xd3')](_0x16a146);}})['then'](function(_0x4f80b8){if(_0x4f80b8){_0x20cae5=_0x4f80b8[_0xd893('0x63')];if(!_0x4c84ba[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x16a146[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x4c84ba['query']['limit']);_0x16a146[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x4c84ba[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x50e2c8[_0xd893('0xd3')](_0x16a146);}})['then'](function(_0x4c96d5){if(_0x4c96d5){return _0x4c96d5?{'count':_0x20cae5,'rows':_0x4c96d5}:null;}})[_0xd893('0x20')](respondWithResult(_0xaf8b11,null))[_0xd893('0x4d')](handleError(_0xaf8b11,null));};exports[_0xd893('0xd4')]=function(_0x4a3724,_0x827af0){var _0x32c573={};var _0x1f94fb={};var _0x10a918;var _0x11c4da;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x4a3724[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0x827af0,null))['then'](function(_0x18f016){if(_0x18f016){_0x10a918=_0x18f016;_0x1f94fb[_0xd893('0xc7')]=_[_0xd893('0xc8')](db['ChatGroup'][_0xd893('0x33')]);_0x1f94fb['query']=_[_0xd893('0xc8')](_0x4a3724[_0xd893('0x3c')]);_0x1f94fb[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x1f94fb[_0xd893('0xc7')],_0x1f94fb[_0xd893('0x3c')]);_0x32c573['attributes']=_[_0xd893('0xcb')](_0x1f94fb['model'],qs['fields'](_0x4a3724[_0xd893('0x3c')][_0xd893('0xcc')]));_0x32c573[_0xd893('0x41')]=_0x32c573[_0xd893('0x41')]['length']?_0x32c573[_0xd893('0x41')]:_0x1f94fb[_0xd893('0xc7')];_0x32c573[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x4a3724[_0xd893('0x3c')][_0xd893('0xce')]);_0x32c573[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x4a3724['query'],_0x1f94fb[_0xd893('0xca')]));if(_0x4a3724[_0xd893('0x3c')]['filter']){_0x32c573[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x32c573['where'],{'$or':_['map'](_0x32c573[_0xd893('0x41')],function(_0x300d19){var _0x10610b={};_0x10610b[_0x300d19]={'$like':'%'+_0x4a3724['query'][_0xd893('0x28')]+'%'};return _0x10610b;})});}_0x32c573=_[_0xd893('0x52')]({},_0x32c573,_0x4a3724[_0xd893('0x53')]);return _0x10a918[_0xd893('0xd4')](_0x32c573);}})[_0xd893('0x20')](function(_0x433ac1){if(_0x433ac1){_0x11c4da=_0x433ac1['length'];if(!_0x4a3724[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x32c573['limit']=qs[_0xd893('0x1c')](_0x4a3724[_0xd893('0x3c')]['limit']);_0x32c573['offset']=qs[_0xd893('0x19')](_0x4a3724[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x10a918[_0xd893('0xd4')](_0x32c573);}})['then'](function(_0x46b974){if(_0x46b974){return _0x46b974?{'count':_0x11c4da,'rows':_0x46b974}:null;}})[_0xd893('0x20')](respondWithResult(_0x827af0,null))[_0xd893('0x4d')](handleError(_0x827af0,null));};exports[_0xd893('0xd5')]=function(_0x17d011,_0x39d61b){var _0x229c9b={'raw':!![],'where':{}};var _0x2b1c42={};var _0x3bc379={'count':0x0,'rows':[]};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x17d011[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x39d61b,null))['then'](function(_0x3ec659){if(_0x3ec659){_0x2b1c42[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xd6')][_0xd893('0x33')]);_0x2b1c42['query']=_['keys'](_0x17d011[_0xd893('0x3c')]);_0x2b1c42[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x2b1c42[_0xd893('0xc7')],_0x2b1c42[_0xd893('0x3c')]);_0x229c9b[_0xd893('0x41')]=_['intersection'](_0x2b1c42[_0xd893('0xc7')],qs['fields'](_0x17d011[_0xd893('0x3c')]['fields']));_0x229c9b[_0xd893('0x41')]=_0x229c9b['attributes'][_0xd893('0x63')]?_0x229c9b['attributes']:_0x2b1c42[_0xd893('0xc7')];if(!_0x17d011[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x229c9b['limit']=qs[_0xd893('0x1c')](_0x17d011[_0xd893('0x3c')][_0xd893('0x1c')]);_0x229c9b['offset']=qs[_0xd893('0x19')](_0x17d011[_0xd893('0x3c')][_0xd893('0x19')]);}_0x229c9b[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x17d011[_0xd893('0x3c')][_0xd893('0xce')]);_0x229c9b['where']=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x17d011[_0xd893('0x3c')],_0x2b1c42['filters']));_0x229c9b[_0xd893('0xcf')][_0xd893('0xd7')]=_0x3ec659['id'];if(_0x17d011[_0xd893('0x3c')][_0xd893('0x28')]){_0x229c9b['where']=_[_0xd893('0x52')](_0x229c9b[_0xd893('0xcf')],{'$or':_['map'](_0x229c9b[_0xd893('0x41')],function(_0x437ead){var _0x44cc8f={};_0x44cc8f[_0x437ead]={'$like':'%'+_0x17d011[_0xd893('0x3c')]['filter']+'%'};return _0x44cc8f;})});}_0x229c9b=_['merge']({},_0x229c9b,_0x17d011[_0xd893('0x53')]);return db[_0xd893('0xd6')][_0xd893('0x1b')]({'where':_0x229c9b['where']})[_0xd893('0x20')](function(_0x11c387){_0x3bc379[_0xd893('0x1b')]=_0x11c387;if(_0x17d011[_0xd893('0x3c')][_0xd893('0x51')]){_0x229c9b[_0xd893('0x3d')]=[{'all':!![]}];}return db['VoiceRecording'][_0xd893('0x43')](_0x229c9b);})[_0xd893('0x20')](function(_0x476bcf){_0x3bc379[_0xd893('0x45')]=_0x476bcf;return _0x3bc379;});}})[_0xd893('0x20')](respondWithFilteredResult(_0x39d61b,_0x229c9b))['catch'](handleError(_0x39d61b,null));};exports['getScreenRecordings']=function(_0x3723d6,_0x19325e){var _0x5cf92={'raw':!![],'where':{}};var _0x4093b7={};var _0x5d8239={'count':0x0,'rows':[]};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x3723d6[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x19325e,null))['then'](function(_0x3d9896){if(_0x3d9896){_0x4093b7[_0xd893('0xc7')]=_['keys'](db[_0xd893('0xd8')][_0xd893('0x33')]);_0x4093b7[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x3723d6['query']);_0x4093b7[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x4093b7['model'],_0x4093b7[_0xd893('0x3c')]);_0x5cf92[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x4093b7[_0xd893('0xc7')],qs['fields'](_0x3723d6[_0xd893('0x3c')][_0xd893('0xcc')]));_0x5cf92[_0xd893('0x41')]=_0x5cf92[_0xd893('0x41')][_0xd893('0x63')]?_0x5cf92[_0xd893('0x41')]:_0x4093b7[_0xd893('0xc7')];if(!_0x3723d6['query'][_0xd893('0xc1')](_0xd893('0xd2'))){_0x5cf92['limit']=qs['limit'](_0x3723d6[_0xd893('0x3c')][_0xd893('0x1c')]);_0x5cf92[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x3723d6[_0xd893('0x3c')][_0xd893('0x19')]);}_0x5cf92['order']=qs[_0xd893('0xce')](_0x3723d6['query'][_0xd893('0xce')]);_0x5cf92[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x3723d6['query'],_0x4093b7[_0xd893('0xca')]));_0x5cf92['where'][_0xd893('0xd7')]=_0x3d9896['id'];if(_0x3723d6[_0xd893('0x3c')]['filter']){_0x5cf92[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x5cf92['where'],{'$or':_['map'](_0x5cf92['attributes'],function(_0x4bbdf8){var _0x26174c={};_0x26174c[_0x4bbdf8]={'$like':'%'+_0x3723d6[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x26174c;})});}_0x5cf92=_[_0xd893('0x52')]({},_0x5cf92,_0x3723d6[_0xd893('0x53')]);return db[_0xd893('0xd8')][_0xd893('0x1b')]({'where':_0x5cf92[_0xd893('0xcf')]})[_0xd893('0x20')](function(_0x264216){_0x5d8239[_0xd893('0x1b')]=_0x264216;if(_0x3723d6[_0xd893('0x3c')][_0xd893('0x51')]){_0x5cf92[_0xd893('0x3d')]=[{'all':!![]}];}return db[_0xd893('0xd8')][_0xd893('0x43')](_0x5cf92);})[_0xd893('0x20')](function(_0x4a26db){_0x5d8239[_0xd893('0x45')]=_0x4a26db;return _0x5d8239;});}})[_0xd893('0x20')](respondWithFilteredResult(_0x19325e,_0x5cf92))['catch'](handleError(_0x19325e,null));};exports[_0xd893('0xd9')]=function(_0x590212,_0x292dac){var _0x2ecdf9={};var _0x30a496={};var _0x6ade1b;var _0x1bc5d9;return db['User'][_0xd893('0xc0')]({'where':{'id':_0x590212['params']['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x292dac,null))['then'](function(_0x20103f){if(_0x20103f){_0x6ade1b=_0x20103f;_0x30a496[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xda')][_0xd893('0x33')]);_0x30a496['query']=_[_0xd893('0xc8')](_0x590212[_0xd893('0x3c')]);_0x30a496[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x30a496[_0xd893('0xc7')],_0x30a496[_0xd893('0x3c')]);_0x2ecdf9['attributes']=_[_0xd893('0xcb')](_0x30a496[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x590212['query'][_0xd893('0xcc')]));_0x2ecdf9['attributes']=_0x2ecdf9[_0xd893('0x41')][_0xd893('0x63')]?_0x2ecdf9[_0xd893('0x41')]:_0x30a496['model'];_0x2ecdf9[_0xd893('0xcd')]=qs['sort'](_0x590212['query'][_0xd893('0xce')]);_0x2ecdf9[_0xd893('0xcf')]=qs[_0xd893('0xca')](_['pick'](_0x590212[_0xd893('0x3c')],_0x30a496[_0xd893('0xca')]));if(_0x590212[_0xd893('0x3c')]['filter']){_0x2ecdf9[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x2ecdf9['where'],{'$or':_[_0xd893('0x2a')](_0x2ecdf9[_0xd893('0x41')],function(_0x7e1ba5){var _0x124c8c={};_0x124c8c[_0x7e1ba5]={'$like':'%'+_0x590212[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x124c8c;})});}_0x2ecdf9=_[_0xd893('0x52')]({},_0x2ecdf9,_0x590212[_0xd893('0x53')]);return _0x6ade1b[_0xd893('0xd9')](_0x2ecdf9);}})[_0xd893('0x20')](function(_0x3c4c65){if(_0x3c4c65){_0x1bc5d9=_0x3c4c65[_0xd893('0x63')];if(!_0x590212['query'][_0xd893('0xc1')](_0xd893('0xd2'))){_0x2ecdf9[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x590212[_0xd893('0x3c')][_0xd893('0x1c')]);_0x2ecdf9[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x590212[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x6ade1b['getChatInteractions'](_0x2ecdf9);}})[_0xd893('0x20')](function(_0x426544){if(_0x426544){return _0x426544?{'count':_0x1bc5d9,'rows':_0x426544}:null;}})[_0xd893('0x20')](respondWithResult(_0x292dac,null))['catch'](handleError(_0x292dac,null));};exports['getOpenchannelInteractions']=function(_0x5d1f50,_0xd42a3b){var _0x32be9c={};var _0xb58e05={};var _0x151c8d;var _0x43d894;return db[_0xd893('0x32')]['findOne']({'where':{'id':_0x5d1f50[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0xd42a3b,null))[_0xd893('0x20')](function(_0x355cc2){if(_0x355cc2){_0x151c8d=_0x355cc2;_0xb58e05[_0xd893('0xc7')]=_['keys'](db[_0xd893('0xdb')][_0xd893('0x33')]);_0xb58e05[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x5d1f50[_0xd893('0x3c')]);_0xb58e05['filters']=_['intersection'](_0xb58e05[_0xd893('0xc7')],_0xb58e05['query']);_0x32be9c[_0xd893('0x41')]=_[_0xd893('0xcb')](_0xb58e05[_0xd893('0xc7')],qs['fields'](_0x5d1f50['query']['fields']));_0x32be9c[_0xd893('0x41')]=_0x32be9c[_0xd893('0x41')][_0xd893('0x63')]?_0x32be9c[_0xd893('0x41')]:_0xb58e05[_0xd893('0xc7')];_0x32be9c[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x5d1f50[_0xd893('0x3c')][_0xd893('0xce')]);_0x32be9c[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x5d1f50[_0xd893('0x3c')],_0xb58e05[_0xd893('0xca')]));if(_0x5d1f50['query']['filter']){_0x32be9c[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x32be9c['where'],{'$or':_[_0xd893('0x2a')](_0x32be9c['attributes'],function(_0x114cb7){var _0x492710={};_0x492710[_0x114cb7]={'$like':'%'+_0x5d1f50['query']['filter']+'%'};return _0x492710;})});}_0x32be9c=_[_0xd893('0x52')]({},_0x32be9c,_0x5d1f50[_0xd893('0x53')]);return _0x151c8d[_0xd893('0xdc')](_0x32be9c);}})[_0xd893('0x20')](function(_0x131c05){if(_0x131c05){_0x43d894=_0x131c05[_0xd893('0x63')];if(!_0x5d1f50[_0xd893('0x3c')][_0xd893('0xc1')]('nolimit')){_0x32be9c[_0xd893('0x1c')]=qs['limit'](_0x5d1f50[_0xd893('0x3c')][_0xd893('0x1c')]);_0x32be9c[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x5d1f50[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x151c8d[_0xd893('0xdc')](_0x32be9c);}})[_0xd893('0x20')](function(_0x442f66){if(_0x442f66){return _0x442f66?{'count':_0x43d894,'rows':_0x442f66}:null;}})[_0xd893('0x20')](respondWithResult(_0xd42a3b,null))[_0xd893('0x4d')](handleError(_0xd42a3b,null));};exports['getMailInteractions']=function(_0x3bb3f7,_0x212f61){var _0x149485={'raw':!![],'where':{}};var _0x3238f2={};var _0x19f625={'count':0x0,'rows':[]};return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x3bb3f7[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x212f61,null))[_0xd893('0x20')](function(_0x47cf84){if(_0x47cf84){_0x3238f2[_0xd893('0xc7')]=_['keys'](db[_0xd893('0xdd')][_0xd893('0x33')]);_0x3238f2['query']=_[_0xd893('0xc8')](_0x3bb3f7[_0xd893('0x3c')]);_0x3238f2[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x3238f2['model'],_0x3238f2[_0xd893('0x3c')]);_0x149485[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x3238f2['model'],qs['fields'](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0xcc')]));_0x149485[_0xd893('0x41')]=_0x149485[_0xd893('0x41')]['length']?_0x149485[_0xd893('0x41')]:_0x3238f2[_0xd893('0xc7')];if(!_0x3bb3f7[_0xd893('0x3c')]['hasOwnProperty']('nolimit')){_0x149485[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x1c')]);_0x149485[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x19')]);}_0x149485[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x3bb3f7[_0xd893('0x3c')][_0xd893('0xce')]);_0x149485[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x3bb3f7[_0xd893('0x3c')],_0x3238f2[_0xd893('0xca')]));_0x149485[_0xd893('0xcf')][_0xd893('0xd7')]=_0x47cf84['id'];if(_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x28')]){_0x149485[_0xd893('0xcf')]=_['merge'](_0x149485[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x149485[_0xd893('0x41')],function(_0x5d0022){var _0x5522d8={};_0x5522d8[_0x5d0022]={'$like':'%'+_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x5522d8;})});}_0x149485=_[_0xd893('0x52')]({},_0x149485,_0x3bb3f7[_0xd893('0x53')]);return db[_0xd893('0xdd')][_0xd893('0x1b')]({'where':_0x149485[_0xd893('0xcf')]})[_0xd893('0x20')](function(_0x161d87){_0x19f625[_0xd893('0x1b')]=_0x161d87;if(_0x3bb3f7[_0xd893('0x3c')][_0xd893('0x51')]){_0x149485[_0xd893('0x3d')]=[{'all':!![]}];}return db[_0xd893('0xdd')][_0xd893('0x43')](_0x149485);})[_0xd893('0x20')](function(_0x5044ff){_0x19f625['rows']=_0x5044ff;return _0x19f625;});}})[_0xd893('0x20')](respondWithFilteredResult(_0x212f61,_0x149485))[_0xd893('0x4d')](handleError(_0x212f61,null));};exports[_0xd893('0xde')]=function(_0x390a88,_0x3cbc5c){var _0x31dff0={};var _0x54c710={};var _0x475102;var _0x21a6d8;return db['User'][_0xd893('0xc0')]({'where':{'id':_0x390a88[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x3cbc5c,null))['then'](function(_0x2185d1){if(_0x2185d1){_0x475102=_0x2185d1;_0x54c710[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xdf')][_0xd893('0x33')]);_0x54c710['query']=_[_0xd893('0xc8')](_0x390a88[_0xd893('0x3c')]);_0x54c710['filters']=_[_0xd893('0xcb')](_0x54c710[_0xd893('0xc7')],_0x54c710[_0xd893('0x3c')]);_0x31dff0[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x54c710[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x390a88[_0xd893('0x3c')]['fields']));_0x31dff0[_0xd893('0x41')]=_0x31dff0['attributes'][_0xd893('0x63')]?_0x31dff0['attributes']:_0x54c710[_0xd893('0xc7')];_0x31dff0[_0xd893('0xcd')]=qs['sort'](_0x390a88[_0xd893('0x3c')][_0xd893('0xce')]);_0x31dff0['where']=qs['filters'](_['pick'](_0x390a88[_0xd893('0x3c')],_0x54c710[_0xd893('0xca')]));if(_0x390a88[_0xd893('0x3c')][_0xd893('0x28')]){_0x31dff0[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x31dff0[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x31dff0[_0xd893('0x41')],function(_0x5eb46b){var _0x7e1ef8={};_0x7e1ef8[_0x5eb46b]={'$like':'%'+_0x390a88[_0xd893('0x3c')]['filter']+'%'};return _0x7e1ef8;})});}_0x31dff0=_[_0xd893('0x52')]({},_0x31dff0,_0x390a88[_0xd893('0x53')]);return _0x475102[_0xd893('0xde')](_0x31dff0);}})['then'](function(_0x5c0845){if(_0x5c0845){_0x21a6d8=_0x5c0845[_0xd893('0x63')];if(!_0x390a88[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x31dff0['limit']=qs[_0xd893('0x1c')](_0x390a88[_0xd893('0x3c')]['limit']);_0x31dff0[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x390a88['query'][_0xd893('0x19')]);}return _0x475102[_0xd893('0xde')](_0x31dff0);}})[_0xd893('0x20')](function(_0x53646f){if(_0x53646f){return _0x53646f?{'count':_0x21a6d8,'rows':_0x53646f}:null;}})[_0xd893('0x20')](respondWithResult(_0x3cbc5c,null))[_0xd893('0x4d')](handleError(_0x3cbc5c,null));};exports[_0xd893('0xe0')]=function(_0x227dbd,_0x4b0910){var _0xfb277c={};var _0x4f8ac9={};var _0x2503cf;var _0x4908a3;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x227dbd[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4b0910,null))['then'](function(_0xbdd3cd){if(_0xbdd3cd){_0x2503cf=_0xbdd3cd;_0x4f8ac9[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xe1')][_0xd893('0x33')]);_0x4f8ac9[_0xd893('0x3c')]=_['keys'](_0x227dbd['query']);_0x4f8ac9[_0xd893('0xca')]=_['intersection'](_0x4f8ac9[_0xd893('0xc7')],_0x4f8ac9[_0xd893('0x3c')]);_0xfb277c[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x4f8ac9[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x227dbd[_0xd893('0x3c')][_0xd893('0xcc')]));_0xfb277c[_0xd893('0x41')]=_0xfb277c['attributes'][_0xd893('0x63')]?_0xfb277c[_0xd893('0x41')]:_0x4f8ac9[_0xd893('0xc7')];_0xfb277c[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x227dbd[_0xd893('0x3c')][_0xd893('0xce')]);_0xfb277c[_0xd893('0xcf')]=qs[_0xd893('0xca')](_['pick'](_0x227dbd[_0xd893('0x3c')],_0x4f8ac9[_0xd893('0xca')]));if(_0x227dbd[_0xd893('0x3c')][_0xd893('0x28')]){_0xfb277c['where']=_[_0xd893('0x52')](_0xfb277c['where'],{'$or':_[_0xd893('0x2a')](_0xfb277c[_0xd893('0x41')],function(_0x395485){var _0x131d7a={};_0x131d7a[_0x395485]={'$like':'%'+_0x227dbd[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x131d7a;})});}_0xfb277c=_[_0xd893('0x52')]({},_0xfb277c,_0x227dbd[_0xd893('0x53')]);return _0x2503cf[_0xd893('0xe0')](_0xfb277c);}})[_0xd893('0x20')](function(_0x507d80){if(_0x507d80){_0x4908a3=_0x507d80[_0xd893('0x63')];if(!_0x227dbd[_0xd893('0x3c')][_0xd893('0xc1')]('nolimit')){_0xfb277c[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x227dbd[_0xd893('0x3c')]['limit']);_0xfb277c[_0xd893('0x19')]=qs['offset'](_0x227dbd[_0xd893('0x3c')]['offset']);}return _0x2503cf[_0xd893('0xe0')](_0xfb277c);}})[_0xd893('0x20')](function(_0x1a53aa){if(_0x1a53aa){return _0x1a53aa?{'count':_0x4908a3,'rows':_0x1a53aa}:null;}})[_0xd893('0x20')](respondWithResult(_0x4b0910,null))[_0xd893('0x4d')](handleError(_0x4b0910,null));};exports[_0xd893('0xe2')]=function(_0x570ded,_0x2503ed){var _0x374739={};var _0x3322d7={};var _0xe2615a;var _0x1cad5f;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x570ded[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x2503ed,null))[_0xd893('0x20')](function(_0x3011e8){if(_0x3011e8){_0xe2615a=_0x3011e8;_0x3322d7[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0xe3')][_0xd893('0x33')]);_0x3322d7[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x570ded[_0xd893('0x3c')]);_0x3322d7[_0xd893('0xca')]=_['intersection'](_0x3322d7[_0xd893('0xc7')],_0x3322d7[_0xd893('0x3c')]);_0x374739[_0xd893('0x41')]=_['intersection'](_0x3322d7[_0xd893('0xc7')],qs['fields'](_0x570ded['query']['fields']));_0x374739[_0xd893('0x41')]=_0x374739[_0xd893('0x41')][_0xd893('0x63')]?_0x374739[_0xd893('0x41')]:_0x3322d7[_0xd893('0xc7')];_0x374739[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x570ded[_0xd893('0x3c')][_0xd893('0xce')]);_0x374739['where']=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x570ded[_0xd893('0x3c')],_0x3322d7[_0xd893('0xca')]));if(_0x570ded[_0xd893('0x3c')][_0xd893('0x28')]){_0x374739[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x374739[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x374739[_0xd893('0x41')],function(_0xa02819){var _0x1c2dd9={};_0x1c2dd9[_0xa02819]={'$like':'%'+_0x570ded[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x1c2dd9;})});}_0x374739=_[_0xd893('0x52')]({},_0x374739,_0x570ded[_0xd893('0x53')]);return _0xe2615a['getWhatsappInteractions'](_0x374739);}})['then'](function(_0x4e45fd){if(_0x4e45fd){_0x1cad5f=_0x4e45fd['length'];if(!_0x570ded[_0xd893('0x3c')][_0xd893('0xc1')]('nolimit')){_0x374739[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x570ded[_0xd893('0x3c')]['limit']);_0x374739[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x570ded['query'][_0xd893('0x19')]);}return _0xe2615a['getWhatsappInteractions'](_0x374739);}})[_0xd893('0x20')](function(_0x5839d9){if(_0x5839d9){return _0x5839d9?{'count':_0x1cad5f,'rows':_0x5839d9}:null;}})[_0xd893('0x20')](respondWithResult(_0x2503ed,null))['catch'](handleError(_0x2503ed,null));};exports['login']=function(_0x5423f9,_0x3a6070,_0x2718ec){var _0x4f9fa7;var _0x497fd3;var _0x459263;var _0x1e1a7b=!_[_0xd893('0x5e')](_0x5423f9[_0xd893('0x4f')]['id'])?_0x5423f9[_0xd893('0x4f')]['id']:!_[_0xd893('0x5e')](_0x5423f9[_0xd893('0x27')]['id'])?_0x5423f9[_0xd893('0x27')]['id']:null;return db['User'][_0xd893('0x2d')]({'where':{'id':_0x1e1a7b,'role':{'$or':[_0xd893('0x26'),_0xd893('0x27'),_0xd893('0x21')]}},'attributes':['id',_0xd893('0x2f'),_0xd893('0xe4'),_0xd893('0xe5'),_0xd893('0x2e'),_0xd893('0x59'),_0xd893('0x93')]})[_0xd893('0x20')](function(_0x59b4f5){if(_0x59b4f5){if(_0x59b4f5[_0xd893('0x2e')]===_0xd893('0x21')){_0x4f9fa7=_0x59b4f5;if(_0x5423f9['body'][_0xd893('0x95')]){_0x459263=util[_0xd893('0xa0')](_0xd893('0xe6'),_0x4f9fa7[_0x5423f9['body'][_0xd893('0x95')]]);}else if(_0x5423f9['body'][_0xd893('0xe7')]){_0x459263=util[_0xd893('0xa0')]('SIP/%s',_0x5423f9[_0xd893('0x55')][_0xd893('0xe7')]);}else{_0x459263=util[_0xd893('0xa0')]('SIP/%s',_0x4f9fa7[_0xd893('0x2f')]);}socket['to'](util[_0xd893('0xa0')]('user:%s',_0x4f9fa7[_0xd893('0x2f')]))['emit'](_0xd893('0xe8'),{'user':{'id':_0x4f9fa7['id'],'name':_0x4f9fa7[_0xd893('0x2f')]},'ip':_0x5423f9[_0xd893('0xe9')]['x-forwarded-for']||_0x5423f9[_0xd893('0xea')]['remoteAddress']||_0x5423f9[_0xd893('0xeb')][_0xd893('0xec')]||_0x5423f9['connection'][_0xd893('0xeb')][_0xd893('0xec')]});return db['UserVoiceQueueRt'][_0xd893('0x24')]({'where':{'membername':_0x4f9fa7[_0xd893('0x2f')]},'individualHooks':!![]});}}else{throw new db[(_0xd893('0x87'))][(_0xd893('0x88'))](_0xd893('0xed'));}})['then'](function(){if(_0x4f9fa7){return _0x4f9fa7[_0xd893('0xee')]({'raw':!![]});}})['then'](function(_0x19c08c){if(_0x4f9fa7){if(_0x19c08c){_0x497fd3=_0x19c08c;if(_0x497fd3[_0xd893('0x63')]){var _0x29f642=_0x497fd3[_0xd893('0x2a')](function(_0x584c6b){var _0x37cfd5={'membername':_0x4f9fa7[_0xd893('0x2f')],'UserId':_0x4f9fa7['id'],'queue_name':_0x584c6b['name'],'VoiceQueueId':_0x584c6b['id'],'interface':_0x459263,'paused':_0x4f9fa7[_0xd893('0x93')]||![],'penalty':_0x584c6b['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0xd893('0xa1')](_0x37cfd5);});return Promise['all'](_0x29f642);}}}})['then'](function(){if(_0x4f9fa7){return db[_0xd893('0xef')][_0xd893('0x43')]({'where':{'membername':_0x4f9fa7[_0xd893('0x2f')],'exitAt':null}});}})[_0xd893('0x20')](function(_0x373524){if(_0x4f9fa7){var _0x45d460=[];_0x373524[_0xd893('0xf0')](function(_0x446081){_0x45d460[_0xd893('0x42')](_0x446081['update']({'exitAt':moment()[_0xd893('0xa0')](_0xd893('0xf1'))}));});return Promise[_0xd893('0x4c')](_0x45d460);}})[_0xd893('0x20')](function(){if(_0x4f9fa7){var _0x51c45a=[];var _0x51a66e=[];var _0x30ca12=utils[_0xd893('0xf2')]();var _0x3c89d9={'membername':_0x4f9fa7[_0xd893('0x2f')],'interface':_0x459263,'enterAt':moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4f9fa7[_0xd893('0x2e')],'internal':_0x4f9fa7[_0xd893('0x59')]};_0x30ca12['forEach'](function(_0x1af7f2){_0x51c45a[_0xd893('0x42')](_['merge']({'channel':_0x1af7f2,'type':'LOGIN','data1':_0x5423f9['body'][_0xd893('0xf3')],'data2':_0x459263},_0x3c89d9));if(_0x4f9fa7[_0xd893('0x93')]){_0x51a66e[_0xd893('0x42')](_[_0xd893('0x52')]({'channel':_0x1af7f2,'type':_0xd893('0xf4'),'data1':'LOGININPAUSE'},_0x3c89d9));}});return db['MemberReport'][_0xd893('0x81')](_0x51c45a[_0xd893('0xbe')](_0x51a66e),{'individualHooks':!![]});}})[_0xd893('0x20')](function(){if(_0x4f9fa7){return _0x4f9fa7[_0xd893('0x1f')]({'online':!![],'lastLoginAt':moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4f9fa7[_0xd893('0x93')]||![],'mailPause':_0x4f9fa7[_0xd893('0x93')]||![],'chatPause':_0x4f9fa7[_0xd893('0x93')]||![],'faxPause':_0x4f9fa7[_0xd893('0x93')]||![],'smsPause':_0x4f9fa7[_0xd893('0x93')]||![],'openchannelPause':_0x4f9fa7['loginInPause']||![],'whatsappPause':_0x4f9fa7[_0xd893('0x93')]||![],'pauseType':_0x4f9fa7[_0xd893('0x93')]?_0xd893('0xf5'):null,'interface':_0x459263,'lastPauseAt':moment()['format'](_0xd893('0xf1'))});}})['then'](function(_0xc0ba62){if(_0x5423f9[_0xd893('0xf6')]){return _0x2718ec();}else{return Promise[_0xd893('0xf7')](_0xc0ba62)[_0xd893('0x20')](respondWithResult(_0x3a6070,null));}})['catch'](handleError(_0x3a6070,null));};exports[_0xd893('0xf8')]=function(_0x3d81c1,_0x1dc22c){var _0x314c42;return db[_0xd893('0x32')]['find']({'where':{'id':_0x3d81c1[_0xd893('0x4f')]['id'],'role':_0xd893('0x21')},'attributes':['id',_0xd893('0x2f'),_0xd893('0x2e')]})[_0xd893('0x20')](handleEntityNotFound(_0x1dc22c,null))[_0xd893('0x20')](function(_0x54e561){if(_0x54e561){_0x314c42=_0x54e561;return db[_0xd893('0xa7')][_0xd893('0x24')]({'where':{'membername':_0x314c42[_0xd893('0x2f')]},'individualHooks':!![]});}})[_0xd893('0x20')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x314c42['name'],'exitAt':null}});})[_0xd893('0x20')](function(_0x2d562f){var _0x590d31=[];_0x2d562f['forEach'](function(_0x1dc46d){_0x590d31[_0xd893('0x42')](_0x1dc46d[_0xd893('0x1f')]({'exitAt':moment()[_0xd893('0xa0')](_0xd893('0xf1'))}));});return Promise[_0xd893('0x4c')](_0x590d31);})['then'](function(){return _0x314c42[_0xd893('0x1f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd893('0x20')](respondWithResult(_0x1dc22c,null))[_0xd893('0x4d')](handleError(_0x1dc22c,null));};exports[_0xd893('0xf9')]=function(_0x5d9fe9,_0x3f17cb){var _0x386167;return db[_0xd893('0xa7')][_0xd893('0x1f')]({'paused':0x1},{'where':{'UserId':_0x5d9fe9[_0xd893('0x4f')]['id']},'individualHooks':!![]})[_0xd893('0x20')](function(){return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x5d9fe9['params']['id'],'role':_0xd893('0x21')},'attributes':['id',_0xd893('0x2f'),_0xd893('0x2e'),_0xd893('0x59'),_0xd893('0x95'),_0xd893('0x9f')]});})[_0xd893('0x20')](handleEntityNotFound(_0x3f17cb,null))['then'](function(_0xf554d9){if(_0xf554d9){_0x386167=_0xf554d9;return db[_0xd893('0xef')][_0xd893('0x43')]({'where':{'membername':_0x386167[_0xd893('0x2f')],'type':'PAUSE','exitAt':null}});}})[_0xd893('0x20')](function(_0x5779a9){if(_0x5779a9[_0xd893('0x63')]){var _0x3d119d=moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1aaa31=0x0,_0x77dc08=_0x5779a9[_0xd893('0x63')];_0x1aaa31<_0x77dc08;_0x1aaa31++){_0x5779a9[_0x1aaa31]['updateAttributes']({'exitAt':_0x3d119d});}}})[_0xd893('0x20')](function(){var _0x5fd67c=[];var _0x33ea59=utils[_0xd893('0xf2')]();_0x33ea59[_0xd893('0xf0')](function(_0x3c385c){_0x5fd67c[_0xd893('0x42')]({'channel':_0x3c385c,'membername':_0x386167[_0xd893('0x2f')],'interface':_['isNil'](_0x386167[_0xd893('0x95')])?util[_0xd893('0xa0')](_0xd893('0xfa'),_0x386167['name']):_0x386167[_0xd893('0x95')],'type':_0xd893('0xf4'),'enterAt':moment()[_0xd893('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x5d9fe9[_0xd893('0x55')][_0xd893('0xfb')]||_0xd893('0xfc'),'role':_0x386167[_0xd893('0x2e')],'internal':_0x386167[_0xd893('0x59')]});});return db[_0xd893('0xef')][_0xd893('0x81')](_0x5fd67c,{'individualHooks':!![]});})[_0xd893('0x20')](function(){return _0x386167[_0xd893('0x1f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5d9fe9[_0xd893('0x55')][_0xd893('0xfb')]||_0xd893('0xfc'),'lastPauseAt':moment()[_0xd893('0xa0')](_0xd893('0xf1'))});})[_0xd893('0x20')](respondWithResult(_0x3f17cb,null))[_0xd893('0x4d')](handleError(_0x3f17cb,null));};exports[_0xd893('0xfd')]=function(_0x2cb652,_0x87916c){if(_0x2cb652[_0xd893('0x55')][_0xd893('0x92')]&&!utils['isValidChannel'](_0x2cb652[_0xd893('0x55')]['channel'])){throw new APIBadRequestError(util[_0xd893('0xa0')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2cb652[_0xd893('0x55')][_0xd893('0x92')]));}return db[_0xd893('0x32')][_0xd893('0x2d')]({'where':{'id':_0x2cb652[_0xd893('0x4f')]['id']},'attributes':['id',_0xd893('0x2f'),'role',_0xd893('0x59'),_0xd893('0x95'),_0xd893('0x9f'),_0xd893('0x94'),_0xd893('0xfe'),'chatPause',_0xd893('0xff'),_0xd893('0x100'),'smsPause',_0xd893('0x101'),_0xd893('0x102'),_0xd893('0x103')]})[_0xd893('0x20')](function(_0x2b9589){if(!_0x2b9589){throw new APINotFoundError(util[_0xd893('0xa0')](_0xd893('0x104'),_0x2cb652[_0xd893('0x4f')]['id']));}return _0x2b9589[_0xd893('0xfd')](_0x2cb652[_0xd893('0x55')]['channel']);})['then'](respondWithResult(_0x87916c,null))[_0xd893('0x4d')](APIHandleError(_0x87916c));};exports[_0xd893('0x105')]=function(_0x13f295,_0x18084e){var _0x2f60f8={};var _0x3d1f8c={};var _0x2b8c6b;var _0x444a66;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x13f295[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x18084e,null))[_0xd893('0x20')](function(_0x20f765){if(_0x20f765){_0x2b8c6b=_0x20f765;_0x3d1f8c[_0xd893('0xc7')]=_[_0xd893('0xc8')](db[_0xd893('0x106')][_0xd893('0x33')]);_0x3d1f8c[_0xd893('0x3c')]=_['keys'](_0x13f295['query']);_0x3d1f8c[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x3d1f8c[_0xd893('0xc7')],_0x3d1f8c['query']);_0x2f60f8[_0xd893('0x41')]=_[_0xd893('0xcb')](_0x3d1f8c[_0xd893('0xc7')],qs[_0xd893('0xcc')](_0x13f295[_0xd893('0x3c')]['fields']));_0x2f60f8[_0xd893('0x41')]=_0x2f60f8[_0xd893('0x41')]['length']?_0x2f60f8[_0xd893('0x41')]:_0x3d1f8c[_0xd893('0xc7')];_0x2f60f8[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x13f295[_0xd893('0x3c')]['sort']);_0x2f60f8[_0xd893('0xcf')]=qs['filters'](_[_0xd893('0xd0')](_0x13f295['query'],_0x3d1f8c[_0xd893('0xca')]));if(_0x13f295[_0xd893('0x3c')][_0xd893('0x28')]){_0x2f60f8[_0xd893('0xcf')]=_['merge'](_0x2f60f8[_0xd893('0xcf')],{'$or':_['map'](_0x2f60f8[_0xd893('0x41')],function(_0x53d4a2){var _0x5855f8={};_0x5855f8[_0x53d4a2]={'$like':'%'+_0x13f295[_0xd893('0x3c')]['filter']+'%'};return _0x5855f8;})});}_0x2f60f8=_[_0xd893('0x52')]({},_0x2f60f8,_0x13f295[_0xd893('0x53')]);return _0x2b8c6b[_0xd893('0x105')](_0x2f60f8);}})[_0xd893('0x20')](function(_0x4aaf1b){if(_0x4aaf1b){_0x444a66=_0x4aaf1b[_0xd893('0x63')];if(!_0x13f295[_0xd893('0x3c')][_0xd893('0xc1')](_0xd893('0xd2'))){_0x2f60f8[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x13f295[_0xd893('0x3c')]['limit']);_0x2f60f8['offset']=qs['offset'](_0x13f295[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x2b8c6b[_0xd893('0x105')](_0x2f60f8);}})['then'](function(_0xc786e3){if(_0xc786e3){return _0xc786e3?{'count':_0x444a66,'rows':_0xc786e3}:null;}})[_0xd893('0x20')](respondWithResult(_0x18084e,null))[_0xd893('0x4d')](handleError(_0x18084e,null));};exports[_0xd893('0x107')]=function(_0x16ffe3,_0xaad984){var _0x500350=_0x16ffe3['params']['id'];var _0x19a4ad=_0x16ffe3[_0xd893('0x55')]?_0x16ffe3[_0xd893('0x55')][_0xd893('0x9b')]:null;var _0x41a734=[];return Promise[_0xd893('0xf7')]()[_0xd893('0x20')](function(){if(!_0x19a4ad)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x500350}});})[_0xd893('0x20')](function(_0x8310e0){if(!_0x8310e0)throw new APINotFoundError(util['format'](_0xd893('0x104'),_0x16ffe3[_0xd893('0x4f')]['id']));return db[_0xd893('0x60')][_0xd893('0x108')](function(_0x7f8697){return _0x8310e0[_0xd893('0x107')](_0x19a4ad,{'transaction':_0x7f8697})[_0xd893('0x20')](function(){return db[_0xd893('0x106')][_0xd893('0x43')]({'where':{'id':{'$in':_0x19a4ad}}});})[_0xd893('0x20')](function(_0x494e6e){var _0x160f28=_[_0xd893('0x2a')](_0x494e6e,function(_0xa34262){return _0xa34262['getAssociatedQueues']();});return Promise[_0xd893('0x4c')](_0x160f28);})[_0xd893('0x20')](function(_0x2e9649){_0x41a734=_[_0xd893('0x109')](_0x2e9649);var _0x2b2d83=_[_0xd893('0x2a')](_0x41a734,function(_0x3a4cca){return _0x3a4cca['addAgent'](_0x8310e0['id'],{'transaction':_0x7f8697});});return Promise[_0xd893('0x4c')](_0x2b2d83);})[_0xd893('0x20')](function(){if(!_0x8310e0[_0xd893('0x9f')])return;var _0x1650de=_['filter'](_0x41a734,function(_0x259b0a){return _0x259b0a['getDataValue'](_0xd893('0x92'))==='Voice';});var _0x1e3ee3=_[_0xd893('0x2a')](_0x1650de,function(_0x35fdde){return db[_0xd893('0xa7')][_0xd893('0xa1')]({'membername':_0x8310e0[_0xd893('0x2f')],'UserId':_0x8310e0['id'],'queue_name':_0x35fdde[_0xd893('0x2f')],'VoiceQueueId':_0x35fdde['id'],'interface':_[_0xd893('0x5e')](_0x8310e0[_0xd893('0x95')])?util[_0xd893('0xa0')](_0xd893('0xfa'),_0x8310e0[_0xd893('0x2f')]):_0x8310e0[_0xd893('0x95')],'paused':_0x8310e0['voicePause']||![],'penalty':_0x8310e0[_0xd893('0x99')]},{'transaction':_0x7f8697});});return Promise[_0xd893('0x4c')](_0x1e3ee3);})[_0xd893('0x20')](function(){return db[_0xd893('0x10a')][_0xd893('0x43')]({'where':{'teamId':{'$in':_0x19a4ad}}});})[_0xd893('0x20')](function(_0xe82801){var _0xf77f15=_[_0xd893('0x2a')](_0xe82801,function(_0x432c8f){return db[_0xd893('0x10b')][_0xd893('0x74')]({'UserId':_0x8310e0['id'],'VoicePrefixId':_0x432c8f[_0xd893('0x10c')]},{'transaction':_0x7f8697});});return Promise['all'](_0xf77f15);});});})[_0xd893('0x20')](function(){for(var _0x52a67c=0x0;_0x52a67c<_0x41a734[_0xd893('0x63')];_0x52a67c++){var _0xa41039=_0x41a734[_0x52a67c]['getDataValue']('channel');var _0x576b37=_0xa41039+_0xd893('0x9c');socket[_0xd893('0x22')]('user'+_0xa41039+'Queue:save',{'UserId':_0x500350,['queueField']:_0x41a734[_0x52a67c]['id']});}})[_0xd893('0x20')](respondWithStatusCode(_0xaad984,null))[_0xd893('0x4d')](APIHandleError(_0xaad984));};exports[_0xd893('0x10d')]=function(_0x4173cc,_0x1c5b6e){var _0x54499a=_0x4173cc['params']['id'];var _0x35299b=null;if(_0x4173cc[_0xd893('0x3c')][_0xd893('0x9b')]){_0x35299b=_['isArray'](_0x4173cc[_0xd893('0x3c')]['ids'])?_0x4173cc[_0xd893('0x3c')][_0xd893('0x9b')]:[_0x4173cc[_0xd893('0x3c')][_0xd893('0x9b')]];}var _0x22a4e6=[];return Promise[_0xd893('0xf7')]()[_0xd893('0x20')](function(){if(!_0x35299b)throw new APIBadRequestError(_0xd893('0x10e'));})[_0xd893('0x20')](function(){return db['User'][_0xd893('0xc0')]({'where':{'id':_0x54499a}});})[_0xd893('0x20')](function(_0x16eece){if(!_0x16eece)throw new APINotFoundError(util['format'](_0xd893('0x104'),_0x4173cc['params']['id']));return db['sequelize'][_0xd893('0x108')](function(_0x42ae64){return _0x16eece[_0xd893('0x10d')](_0x35299b,{'transaction':_0x42ae64})[_0xd893('0x20')](function(){return db['Team'][_0xd893('0x43')]({'where':{'id':{'$in':_0x35299b}}});})[_0xd893('0x20')](function(_0x36538b){var _0x5515e9=_[_0xd893('0x2a')](_0x36538b,function(_0x302fa4){return _0x302fa4[_0xd893('0x10f')]();});return Promise[_0xd893('0x4c')](_0x5515e9);})[_0xd893('0x20')](function(_0x472776){_0x22a4e6=_['flattenDeep'](_0x472776);var _0x3d52f4=_[_0xd893('0x2a')](_0x22a4e6,function(_0xc16fdf){return _0xc16fdf[_0xd893('0x110')](_0x16eece['id'],{'transaction':_0x42ae64});});return Promise['all'](_0x3d52f4);})[_0xd893('0x20')](function(){if(!_0x16eece[_0xd893('0x9f')])return;var _0x31f081=_[_0xd893('0x28')](_0x22a4e6,function(_0x353cce){return _0x353cce[_0xd893('0x111')](_0xd893('0x92'))==='Voice';});var _0x405bb2=_[_0xd893('0x2a')](_0x31f081,function(_0x2f9196){return db[_0xd893('0xa7')][_0xd893('0x24')]({'where':{'VoiceQueueId':_0x2f9196['id'],'UserId':_0x16eece['id']},'transaction':_0x42ae64});});return Promise['all'](_0x405bb2);})['then'](function(){return db[_0xd893('0x10a')][_0xd893('0x43')]({'where':{'teamId':{'$in':_0x35299b}}});})['then'](function(_0x58685c){var _0x3a54b0=_[_0xd893('0x2a')](_0x58685c,function(_0x14adb8){return db[_0xd893('0x10b')]['destroy']({'where':{'UserId':_0x16eece['id'],'VoicePrefixId':_0x14adb8[_0xd893('0x10c')]}},{'transaction':_0x42ae64});});return Promise[_0xd893('0x4c')](_0x3a54b0);});});})[_0xd893('0x20')](function(){for(var _0x53c151=0x0;_0x53c151<_0x22a4e6[_0xd893('0x63')];_0x53c151++){var _0x283689=_0x22a4e6[_0x53c151][_0xd893('0x111')]('channel');var _0xf7571a=_0x283689+_0xd893('0x9c');socket[_0xd893('0x22')]('user'+_0x283689+_0xd893('0xa6'),{'UserId':_0x54499a,['queueField']:_0x22a4e6[_0x53c151]['id']});}})[_0xd893('0x20')](respondWithStatusCode(_0x1c5b6e,null))[_0xd893('0x4d')](APIHandleError(_0x1c5b6e));};exports[_0xd893('0x112')]=function(_0x13a8cd,_0x3491e4){var _0x15ace5={};var _0x2e0182={};var _0x3f0dbb;var _0x2e88d4;return db[_0xd893('0x32')][_0xd893('0xc0')]({'where':{'id':_0x13a8cd[_0xd893('0x4f')]['id']}})[_0xd893('0x20')](handleEntityNotFound(_0x3491e4,null))[_0xd893('0x20')](function(_0x1ff035){if(_0x1ff035){_0x3f0dbb=_0x1ff035;_0x2e0182['model']=_[_0xd893('0xc8')](db[_0xd893('0xc2')]['rawAttributes']);_0x2e0182[_0xd893('0x3c')]=_[_0xd893('0xc8')](_0x13a8cd[_0xd893('0x3c')]);_0x2e0182[_0xd893('0xca')]=_[_0xd893('0xcb')](_0x2e0182['model'],_0x2e0182[_0xd893('0x3c')]);_0x15ace5[_0xd893('0x41')]=_['intersection'](_0x2e0182['model'],qs[_0xd893('0xcc')](_0x13a8cd[_0xd893('0x3c')]['fields']));_0x15ace5['attributes']=_0x15ace5[_0xd893('0x41')][_0xd893('0x63')]?_0x15ace5[_0xd893('0x41')]:_0x2e0182[_0xd893('0xc7')];_0x15ace5[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x13a8cd[_0xd893('0x3c')][_0xd893('0xce')]);_0x15ace5[_0xd893('0xcf')]=qs['filters'](_['pick'](_0x13a8cd[_0xd893('0x3c')],_0x2e0182[_0xd893('0xca')]));if(_0x13a8cd['query']['filter']){_0x15ace5[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x15ace5[_0xd893('0xcf')],{'$or':_[_0xd893('0x2a')](_0x15ace5['attributes'],function(_0x32c754){var _0x2a3dbb={};_0x2a3dbb[_0x32c754]={'$like':'%'+_0x13a8cd[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x2a3dbb;})});}_0x15ace5=_[_0xd893('0x52')]({},_0x15ace5,_0x13a8cd[_0xd893('0x53')]);return _0x3f0dbb[_0xd893('0x112')](_0x15ace5);}})[_0xd893('0x20')](function(_0x29c39f){if(_0x29c39f){_0x2e88d4=_0x29c39f['length'];if(!_0x13a8cd['query'][_0xd893('0xc1')](_0xd893('0xd2'))){_0x15ace5[_0xd893('0x1c')]=qs[_0xd893('0x1c')](_0x13a8cd['query'][_0xd893('0x1c')]);_0x15ace5[_0xd893('0x19')]=qs['offset'](_0x13a8cd[_0xd893('0x3c')][_0xd893('0x19')]);}return _0x3f0dbb[_0xd893('0x112')](_0x15ace5);}})[_0xd893('0x20')](function(_0x2e95c0){if(_0x2e95c0){return _0x2e95c0?{'count':_0x2e88d4,'rows':_0x2e95c0}:null;}})[_0xd893('0x20')](respondWithResult(_0x3491e4,null))[_0xd893('0x4d')](handleError(_0x3491e4,null));};exports[_0xd893('0x113')]=function(_0x41f5c0,_0x594d89){var _0x39d4cd={};var _0x1a63f5={};var _0xe481f0;return db[_0xd893('0x32')]['findOne']({'where':{'id':_0x41f5c0[_0xd893('0x4f')]['id']}})['then'](handleEntityNotFound(_0x594d89,null))[_0xd893('0x20')](function(_0x470337){if(_0x470337){_0xe481f0=_0x470337;_0x1a63f5[_0xd893('0xc7')]=_['keys'](db[_0xd893('0x32')][_0xd893('0x33')]);_0x1a63f5[_0xd893('0x3c')]=_['keys'](_0x41f5c0[_0xd893('0x3c')]);_0x1a63f5['filters']=_[_0xd893('0xcb')](_0x1a63f5[_0xd893('0xc7')],_0x1a63f5[_0xd893('0x3c')]);_0x39d4cd['attributes']=_['intersection'](_0x1a63f5['model'],qs[_0xd893('0xcc')](_0x41f5c0[_0xd893('0x3c')][_0xd893('0xcc')]));_0x39d4cd[_0xd893('0x41')]=_0x39d4cd[_0xd893('0x41')]['length']?_0x39d4cd[_0xd893('0x41')]:_0x1a63f5[_0xd893('0xc7')];_0x39d4cd[_0xd893('0xcd')]=qs[_0xd893('0xce')](_0x41f5c0[_0xd893('0x3c')][_0xd893('0xce')]);_0x39d4cd[_0xd893('0xcf')]=qs[_0xd893('0xca')](_[_0xd893('0xd0')](_0x41f5c0[_0xd893('0x3c')],_0x1a63f5[_0xd893('0xca')]));if(_0x41f5c0['query'][_0xd893('0x28')]){_0x39d4cd[_0xd893('0xcf')]=_[_0xd893('0x52')](_0x39d4cd['where'],{'$or':_[_0xd893('0x2a')](_0x39d4cd['attributes'],function(_0x17301a){var _0x4f535c={};_0x4f535c[_0x17301a]={'$like':'%'+_0x41f5c0[_0xd893('0x3c')][_0xd893('0x28')]+'%'};return _0x4f535c;})});}_0x39d4cd[_0xd893('0xc7')]=db['User'];_0x39d4cd['as']=_0xd893('0x7c');_0x39d4cd=_[_0xd893('0x52')]({},_0x39d4cd,_0x41f5c0[_0xd893('0x53')]);return _0xe481f0[_0xd893('0xee')]({'include':[_0x39d4cd]});}})['then'](function(_0xaf2990){if(_0xaf2990){var _0x10c6ea={},_0x32f5d2=[];for(var _0x1f20fc=0x0;_0x1f20fc<_0xaf2990[_0xd893('0x63')];_0x1f20fc+=0x1){for(var _0x5cb2c1=0x0,_0xaf0cd4;_0x5cb2c1<_0xaf2990[_0x1f20fc][_0xd893('0x7c')][_0xd893('0x63')];_0x5cb2c1+=0x1){_0xaf0cd4=_0xaf2990[_0x1f20fc][_0xd893('0x7c')][_0x5cb2c1]['get']({'plain':!![]});_0x10c6ea[_0xaf0cd4['id']]=_0xaf0cd4;}}_0x10c6ea=_[_0xd893('0x114')](_0x10c6ea);for(var _0x537f89=qs[_0xd893('0x19')](_0x41f5c0[_0xd893('0x3c')][_0xd893('0x19')]);_0x537f89<_0x10c6ea[_0xd893('0x63')]&&_0x32f5d2['length']=_0x1b2640['agents']){throw new Error(_0xb443('0x4c'));}})['then'](function(){if(_0x2ee6d7){return db[_0xb443('0x24')][_0xb443('0x42')]({'where':{'membername':_0x2ee6d7['name']},'individualHooks':!![]});}})[_0xb443('0x17')](function(){if(_0x2ee6d7){return _0x2ee6d7['getVoiceQueues']({'raw':!![]});}})[_0xb443('0x17')](function(_0x3d4bc1){if(_0x2ee6d7){if(_0x3d4bc1){var _0x413bdd=[];_0x3fb302=_0x3d4bc1;if(_0x3fb302['length']){for(var _0x2f62be=0x0;_0x2f62be<_0x3fb302[_0xb443('0x28')];_0x2f62be++){_0x413bdd[_0xb443('0x2c')](db[_0xb443('0x24')][_0xb443('0x4d')]({'membername':_0x2ee6d7[_0xb443('0x2d')],'UserId':_0x2ee6d7['id'],'queue_name':_0x3fb302[_0x2f62be]['name'],'VoiceQueueId':_0x3fb302[_0x2f62be]['id'],'interface':_0x1c47ab,'paused':_0x2ee6d7[_0xb443('0x47')]||![],'penalty':_0x3fb302[_0x2f62be]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xb443('0x43')](_0x413bdd);}}}})[_0xb443('0x17')](function(){if(_0x2ee6d7){return db[_0xb443('0x26')][_0xb443('0xe')]({'where':{'membername':_0x2ee6d7['name'],'exitAt':null}});}})[_0xb443('0x17')](function(_0x20e565){if(_0x2ee6d7){if(_0x20e565&&_0x20e565[_0xb443('0x28')]){var _0x4bfcd3=[];_0x20e565[_0xb443('0x2b')](function(_0x1c1802){_0x4bfcd3[_0xb443('0x2c')](_0x1c1802[_0xb443('0x25')]({'exitAt':moment()[_0xb443('0x22')](_0xb443('0x29'))}));});return BPromise[_0xb443('0x43')](_0x4bfcd3);}}})[_0xb443('0x17')](function(){if(_0x2ee6d7){var _0x2de23c=[];var _0x25bf31=[];var _0x3d409f=utils[_0xb443('0x4e')]();var _0x544086={'membername':_0x2ee6d7[_0xb443('0x2d')],'interface':_0x1c47ab,'enterAt':moment()[_0xb443('0x22')](_0xb443('0x29')),'role':_0x2ee6d7[_0xb443('0x32')],'internal':_0x2ee6d7[_0xb443('0x46')]};_0x3d409f['forEach'](function(_0x59a0e7){_0x2de23c[_0xb443('0x2c')](_['merge']({'channel':_0x59a0e7,'type':'LOGIN','data1':_0xb443('0x4f'),'data2':_0x1c47ab},_0x544086));if(_0x2ee6d7['loginInPause']){_0x25bf31[_0xb443('0x2c')](_[_0xb443('0x50')]({'channel':_0x59a0e7,'type':_0xb443('0x27'),'data1':'LOGININPAUSE'},_0x544086));}});return db[_0xb443('0x26')][_0xb443('0x51')](_0x2de23c[_0xb443('0x52')](_0x25bf31),{'individualHooks':!![]});}})[_0xb443('0x17')](function(){if(_0x2ee6d7){return _0x2ee6d7['update']({'online':!![],'lastLoginAt':moment()[_0xb443('0x22')](_0xb443('0x29')),'voicePause':_0x2ee6d7['loginInPause']||![],'mailPause':_0x2ee6d7[_0xb443('0x47')]||![],'chatPause':_0x2ee6d7[_0xb443('0x47')]||![],'faxPause':_0x2ee6d7[_0xb443('0x47')]||![],'smsPause':_0x2ee6d7[_0xb443('0x47')]||![],'openchannelPause':_0x2ee6d7[_0xb443('0x47')]||![],'pauseType':_0x2ee6d7[_0xb443('0x47')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0xb443('0x29')),'interface':_0x1c47ab});}})[_0xb443('0x17')](function(_0x12ab6e){_0x58b038(_0x12ab6e);})[_0xb443('0x1a')](function(_0x282a43){_0x5ca5c7(_0x49a1fa[_0xb443('0x1b')](0x1f4,_0x282a43['message']));});});}; \ No newline at end of file +var _0xfa94=['getChannels','forEach','push','isNil','PAUSE','YYYY-MM-DD\x20HH:mm:ss','type','DEFAULT\x20PAUSE','bulkCreate','body','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','openchannelPause','pauseType','lastPauseAt','params','unpause','system','LogoutUser','findOne','destroy','length','all','LoginUser','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','User','findAll','options','raw','where','attributes','limit','include','model','map','then','GetUser','debug','stringify','error','message','ShowUser','find','info','catch','PauseUser','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','name','updateAttributes'];(function(_0x23d572,_0x328311){var _0x533460=function(_0x273946){while(--_0x273946){_0x23d572['push'](_0x23d572['shift']());}};_0x533460(++_0x328311);}(_0xfa94,0x187));var _0x4fa9=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xfa94[_0xffd1b5];return _0x3176d6;};'use strict';var _=require(_0x4fa9('0x0'));var util=require('util');var moment=require(_0x4fa9('0x1'));var BPromise=require(_0x4fa9('0x2'));var Redis=require('ioredis');var db=require(_0x4fa9('0x3'))['db'];var utils=require(_0x4fa9('0x4'));var logger=require(_0x4fa9('0x5'))(_0x4fa9('0x6'));var config=require(_0x4fa9('0x7'));config[_0x4fa9('0x8')]=_[_0x4fa9('0x9')](config[_0x4fa9('0x8')],{'host':_0x4fa9('0xa'),'port':0x18eb});var socket=require(_0x4fa9('0xb'))(new Redis(config[_0x4fa9('0x8')]));require(_0x4fa9('0xc'))['register'](socket);exports['GetUser']=function(_0x5b49b2){var _0x479316=this;return new Promise(function(_0x473ce6,_0x4d3566){return db[_0x4fa9('0xd')][_0x4fa9('0xe')]({'raw':_0x5b49b2[_0x4fa9('0xf')]?_0x5b49b2[_0x4fa9('0xf')][_0x4fa9('0x10')]===undefined?!![]:![]:!![],'where':_0x5b49b2['options']?_0x5b49b2[_0x4fa9('0xf')][_0x4fa9('0x11')]||null:null,'attributes':_0x5b49b2[_0x4fa9('0xf')]?_0x5b49b2[_0x4fa9('0xf')][_0x4fa9('0x12')]||null:null,'limit':_0x5b49b2['options']?_0x5b49b2[_0x4fa9('0xf')][_0x4fa9('0x13')]||null:null,'include':_0x5b49b2['options']?_0x5b49b2[_0x4fa9('0xf')][_0x4fa9('0x14')]?_['map'](_0x5b49b2['options'][_0x4fa9('0x14')],function(_0x447be4){return{'model':db[_0x447be4[_0x4fa9('0x15')]],'as':_0x447be4['as'],'attributes':_0x447be4['attributes'],'include':_0x447be4['include']?_[_0x4fa9('0x16')](_0x447be4[_0x4fa9('0x14')],function(_0xc5c733){return{'model':db[_0xc5c733[_0x4fa9('0x15')]],'as':_0xc5c733['as'],'attributes':_0xc5c733[_0x4fa9('0x12')],'include':_0xc5c733[_0x4fa9('0x14')]?_[_0x4fa9('0x16')](_0xc5c733[_0x4fa9('0x14')],function(_0x2aa6c7){return{'model':db[_0x2aa6c7['model']],'as':_0x2aa6c7['as'],'attributes':_0x2aa6c7[_0x4fa9('0x12')]};}):[]};}):[]};}):[]:[]})[_0x4fa9('0x17')](function(_0x13d657){logger['info'](_0x4fa9('0x18'),_0x5b49b2);logger[_0x4fa9('0x19')](_0x4fa9('0x18'),_0x5b49b2,JSON[_0x4fa9('0x1a')](_0x13d657));_0x473ce6(_0x13d657);})['catch'](function(_0xf8fd7b){logger[_0x4fa9('0x1b')](_0x4fa9('0x18'),_0xf8fd7b[_0x4fa9('0x1c')],_0x5b49b2);_0x4d3566(_0x479316[_0x4fa9('0x1b')](0x1f4,_0xf8fd7b[_0x4fa9('0x1c')]));});});};exports[_0x4fa9('0x1d')]=function(_0x4e412e){var _0x3bb160=this;return new Promise(function(_0x1be019,_0x55f6b5){return db[_0x4fa9('0xd')][_0x4fa9('0x1e')]({'raw':_0x4e412e[_0x4fa9('0xf')]?_0x4e412e[_0x4fa9('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x4e412e[_0x4fa9('0xf')]?_0x4e412e[_0x4fa9('0xf')][_0x4fa9('0x11')]||null:null,'attributes':_0x4e412e[_0x4fa9('0xf')]?_0x4e412e[_0x4fa9('0xf')]['attributes']||null:null,'include':_0x4e412e[_0x4fa9('0xf')]?_0x4e412e[_0x4fa9('0xf')][_0x4fa9('0x14')]?_[_0x4fa9('0x16')](_0x4e412e['options'][_0x4fa9('0x14')],function(_0x426a9e){return{'model':db[_0x426a9e[_0x4fa9('0x15')]],'as':_0x426a9e['as'],'attributes':_0x426a9e[_0x4fa9('0x12')],'include':_0x426a9e['include']?_[_0x4fa9('0x16')](_0x426a9e[_0x4fa9('0x14')],function(_0x1ac036){return{'model':db[_0x1ac036[_0x4fa9('0x15')]],'as':_0x1ac036['as'],'attributes':_0x1ac036['attributes'],'include':_0x1ac036['include']?_['map'](_0x1ac036[_0x4fa9('0x14')],function(_0x28d46f){return{'model':db[_0x28d46f[_0x4fa9('0x15')]],'as':_0x28d46f['as'],'attributes':_0x28d46f[_0x4fa9('0x12')]};}):[]};}):[]};}):[]:[]})[_0x4fa9('0x17')](function(_0x13e68c){logger[_0x4fa9('0x1f')]('ShowUser',_0x4e412e);logger[_0x4fa9('0x19')](_0x4fa9('0x1d'),_0x4e412e,JSON[_0x4fa9('0x1a')](_0x13e68c));_0x1be019(_0x13e68c);})[_0x4fa9('0x20')](function(_0x888d92){logger[_0x4fa9('0x1b')](_0x4fa9('0x1d'),_0x888d92['message'],_0x4e412e);_0x55f6b5(_0x3bb160[_0x4fa9('0x1b')](0x1f4,_0x888d92[_0x4fa9('0x1c')]));});});};exports[_0x4fa9('0x21')]=function(_0x24398e){var _0x20d0c8;return db[_0x4fa9('0xd')][_0x4fa9('0x1e')]({'where':_0x24398e['options'][_0x4fa9('0x11')]||{},'attributes':['id','name',_0x4fa9('0x22'),_0x4fa9('0x23'),_0x4fa9('0x24')]})[_0x4fa9('0x17')](function(_0x3bbd37){if(!_0x3bbd37){throw new Error(util[_0x4fa9('0x25')](_0x4fa9('0x26'),_0x24398e['params']['id']));}_0x20d0c8=_0x3bbd37;return db[_0x4fa9('0x27')][_0x4fa9('0x28')]({'paused':0x1},{'where':{'UserId':_0x20d0c8['id']},'individualHooks':!![]});})[_0x4fa9('0x17')](function(){return db[_0x4fa9('0x29')][_0x4fa9('0xe')]({'where':{'membername':_0x20d0c8[_0x4fa9('0x2a')],'type':'PAUSE','exitAt':null}});})[_0x4fa9('0x17')](function(_0x5da7e3){if(_0x5da7e3&&_0x5da7e3['length']){var _0xebecf9=moment()[_0x4fa9('0x25')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x33ab6d=0x0,_0x1bf1ce=_0x5da7e3['length'];_0x33ab6d<_0x1bf1ce;_0x33ab6d++){_0x5da7e3[_0x33ab6d][_0x4fa9('0x2b')]({'exitAt':_0xebecf9});}}})['then'](function(){var _0x2dfa0d=[];var _0x6b774b=utils[_0x4fa9('0x2c')]();_0x6b774b[_0x4fa9('0x2d')](function(_0x12a28b){_0x2dfa0d[_0x4fa9('0x2e')]({'channel':_0x12a28b,'membername':_0x20d0c8[_0x4fa9('0x2a')],'interface':_[_0x4fa9('0x2f')](_0x20d0c8[_0x4fa9('0x24')])?util[_0x4fa9('0x25')]('SIP/%s',_0x20d0c8[_0x4fa9('0x2a')]):_0x20d0c8[_0x4fa9('0x24')],'type':_0x4fa9('0x30'),'enterAt':moment()[_0x4fa9('0x25')](_0x4fa9('0x31')),'data1':_0x24398e['body'][_0x4fa9('0x32')]||_0x4fa9('0x33'),'role':_0x20d0c8[_0x4fa9('0x22')],'internal':_0x20d0c8[_0x4fa9('0x23')],'uniqueid':_0x24398e['body']['uniqueid']||null});});return db[_0x4fa9('0x29')][_0x4fa9('0x34')](_0x2dfa0d,{'individualHooks':!![]});})[_0x4fa9('0x17')](function(){return _0x20d0c8[_0x4fa9('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x24398e[_0x4fa9('0x35')][_0x4fa9('0x32')]||_0x4fa9('0x33'),'lastPauseAt':moment()[_0x4fa9('0x25')](_0x4fa9('0x31'))});})[_0x4fa9('0x20')](function(_0x566377){throw _0x566377;});};exports['UnpauseUser']=function(_0x4f21f0){return Promise[_0x4fa9('0x36')]()[_0x4fa9('0x17')](function(){if(_0x4f21f0['body'][_0x4fa9('0x37')]&&!utils[_0x4fa9('0x38')](_0x4f21f0[_0x4fa9('0x35')]['channel'])){throw new Error(util[_0x4fa9('0x25')](_0x4fa9('0x39'),_0x4f21f0[_0x4fa9('0x35')][_0x4fa9('0x37')]));}return db[_0x4fa9('0xd')]['findOne']({'where':_0x4f21f0[_0x4fa9('0xf')]['where']||{},'attributes':['id','name','role',_0x4fa9('0x23'),_0x4fa9('0x24'),'online','voicePause',_0x4fa9('0x3a'),_0x4fa9('0x3b'),'faxPause',_0x4fa9('0x3c'),'smsPause','whatsappPause',_0x4fa9('0x3d'),_0x4fa9('0x3e')]});})['then'](function(_0x920532){if(!_0x920532){throw new Error(util['format'](_0x4fa9('0x26'),_0x4f21f0[_0x4fa9('0x3f')]['id']));}return _0x920532[_0x4fa9('0x40')](_0x4f21f0[_0x4fa9('0x35')][_0x4fa9('0x37')],_0x4fa9('0x41'));})['catch'](function(_0x1365be){throw _0x1365be;});};exports[_0x4fa9('0x42')]=function(_0x3ffbe6){var _0x37d41=this;return new Promise(function(_0x5bbc93,_0x505669){var _0x9668a1;return db[_0x4fa9('0xd')][_0x4fa9('0x43')]({'where':_0x3ffbe6[_0x4fa9('0xf')][_0x4fa9('0x11')]||{},'attributes':['id',_0x4fa9('0x2a')]})[_0x4fa9('0x17')](function(_0x9b880d){if(_0x9b880d){_0x9668a1=_0x9b880d;return db[_0x4fa9('0x27')][_0x4fa9('0x44')]({'where':{'membername':_0x9668a1['name']},'individualHooks':!![]});}})[_0x4fa9('0x17')](function(){if(_0x9668a1){return db['MemberReport'][_0x4fa9('0xe')]({'where':{'membername':_0x9668a1['name'],'exitAt':null}});}})[_0x4fa9('0x17')](function(_0x333bea){if(_0x9668a1){if(_0x333bea&&_0x333bea[_0x4fa9('0x45')]){var _0x490150=[];_0x333bea[_0x4fa9('0x2d')](function(_0x6a092d){_0x490150[_0x4fa9('0x2e')](_0x6a092d[_0x4fa9('0x28')]({'exitAt':moment()[_0x4fa9('0x25')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x4fa9('0x46')](_0x490150);}}})[_0x4fa9('0x17')](function(){if(_0x9668a1){return _0x9668a1[_0x4fa9('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4fa9('0x17')](function(_0xb1e099){_0x5bbc93(_0xb1e099);})[_0x4fa9('0x20')](function(_0x259b5d){_0x505669(_0x37d41[_0x4fa9('0x1b')](0x1f4,_0x259b5d['message']));});});};exports[_0x4fa9('0x47')]=function(_0x586464){var _0x1b676d=this;return new Promise(function(_0x186056,_0x5644df){var _0x38bed9;var _0x59fceb;var _0x3990b5;var _0x56fc63;return db[_0x4fa9('0xd')][_0x4fa9('0x43')]({'where':_0x586464['options'][_0x4fa9('0x11')]||{},'attributes':['id','name',_0x4fa9('0x22'),'mobile',_0x4fa9('0x48'),_0x4fa9('0x23'),_0x4fa9('0x49'),'interface']})[_0x4fa9('0x17')](function(_0x399340){if(_0x399340){_0x38bed9=_0x399340;_0x56fc63=_0x586464[_0x4fa9('0x35')][_0x4fa9('0x24')]?_0x586464[_0x4fa9('0x35')][_0x4fa9('0x24')]:util['format'](_0x4fa9('0x4a'),_0x38bed9['name']);return db['User'][_0x4fa9('0x4b')]({'where':{'role':_0x4fa9('0x4c'),'online':!![],'id':{'$ne':_0x38bed9['id']}}});}})[_0x4fa9('0x17')](function(_0x272034){if(_0x272034){_0x3990b5=_0x272034;return require(_0x4fa9('0x4d'))[_0x4fa9('0x4e')]();}})['then'](function(_0x1ffc1d){if(_0x1ffc1d&&_0x1ffc1d[_0x4fa9('0x4f')]&&_0x3990b5>=_0x1ffc1d[_0x4fa9('0x4f')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4fa9('0x17')](function(){if(_0x38bed9){return db[_0x4fa9('0x27')][_0x4fa9('0x44')]({'where':{'membername':_0x38bed9[_0x4fa9('0x2a')]},'individualHooks':!![]});}})[_0x4fa9('0x17')](function(){if(_0x38bed9){return _0x38bed9[_0x4fa9('0x50')]({'raw':!![]});}})[_0x4fa9('0x17')](function(_0x515a2e){if(_0x38bed9){if(_0x515a2e){var _0x4252c1=[];_0x59fceb=_0x515a2e;if(_0x59fceb[_0x4fa9('0x45')]){for(var _0x12d395=0x0;_0x12d395<_0x59fceb[_0x4fa9('0x45')];_0x12d395++){_0x4252c1[_0x4fa9('0x2e')](db[_0x4fa9('0x27')][_0x4fa9('0x51')]({'membername':_0x38bed9[_0x4fa9('0x2a')],'UserId':_0x38bed9['id'],'queue_name':_0x59fceb[_0x12d395][_0x4fa9('0x2a')],'VoiceQueueId':_0x59fceb[_0x12d395]['id'],'interface':_0x56fc63,'paused':_0x38bed9['loginInPause']||![],'penalty':_0x59fceb[_0x12d395][_0x4fa9('0x52')]||0x0}));}return BPromise[_0x4fa9('0x46')](_0x4252c1);}}}})['then'](function(){if(_0x38bed9){return db[_0x4fa9('0x29')][_0x4fa9('0xe')]({'where':{'membername':_0x38bed9[_0x4fa9('0x2a')],'exitAt':null}});}})[_0x4fa9('0x17')](function(_0xa2cdd1){if(_0x38bed9){if(_0xa2cdd1&&_0xa2cdd1['length']){var _0x4f1a99=[];_0xa2cdd1[_0x4fa9('0x2d')](function(_0x58cc20){_0x4f1a99[_0x4fa9('0x2e')](_0x58cc20[_0x4fa9('0x28')]({'exitAt':moment()['format'](_0x4fa9('0x31'))}));});return BPromise['all'](_0x4f1a99);}}})[_0x4fa9('0x17')](function(){if(_0x38bed9){var _0x5c06ef=[];var _0x795a69=[];var _0x141b42=utils[_0x4fa9('0x2c')]();var _0x2ece2f={'membername':_0x38bed9['name'],'interface':_0x56fc63,'enterAt':moment()['format'](_0x4fa9('0x31')),'role':_0x38bed9[_0x4fa9('0x22')],'internal':_0x38bed9[_0x4fa9('0x23')]};_0x141b42['forEach'](function(_0x3a1edc){_0x5c06ef['push'](_[_0x4fa9('0x53')]({'channel':_0x3a1edc,'type':_0x4fa9('0x54'),'data1':_0x4fa9('0x55'),'data2':_0x56fc63},_0x2ece2f));if(_0x38bed9['loginInPause']){_0x795a69[_0x4fa9('0x2e')](_[_0x4fa9('0x53')]({'channel':_0x3a1edc,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2ece2f));}});return db['MemberReport']['bulkCreate'](_0x5c06ef[_0x4fa9('0x56')](_0x795a69),{'individualHooks':!![]});}})[_0x4fa9('0x17')](function(){if(_0x38bed9){return _0x38bed9[_0x4fa9('0x28')]({'online':!![],'lastLoginAt':moment()[_0x4fa9('0x25')](_0x4fa9('0x31')),'voicePause':_0x38bed9[_0x4fa9('0x49')]||![],'mailPause':_0x38bed9[_0x4fa9('0x49')]||![],'chatPause':_0x38bed9[_0x4fa9('0x49')]||![],'faxPause':_0x38bed9[_0x4fa9('0x49')]||![],'smsPause':_0x38bed9['loginInPause']||![],'openchannelPause':_0x38bed9['loginInPause']||![],'pauseType':_0x38bed9[_0x4fa9('0x49')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x4fa9('0x25')](_0x4fa9('0x31')),'interface':_0x56fc63});}})['then'](function(_0x829d03){_0x186056(_0x829d03);})[_0x4fa9('0x20')](function(_0x3d2cba){_0x5644df(_0x1b676d[_0x4fa9('0x1b')](0x1f4,_0x3d2cba[_0x4fa9('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 8822e93..95fe51d 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 _0x67cd=['register','length','user:','./user.events','save','remove','update','emit','removeListener'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x67cd,0x78));var _0xd67c=function(_0x29f014,_0x508522){_0x29f014=_0x29f014-0x0;var _0x316be5=_0x67cd[_0x29f014];return _0x316be5;};'use strict';var UserEvents=require(_0xd67c('0x0'));var events=[_0xd67c('0x1'),_0xd67c('0x2'),_0xd67c('0x3')];function createListener(_0x240a19,_0x1f0bad){return function(_0x2194f9){_0x1f0bad[_0xd67c('0x4')](_0x240a19,_0x2194f9);};}function removeListener(_0xc28d00,_0xd3c901){return function(){UserEvents[_0xd67c('0x5')](_0xc28d00,_0xd3c901);};}exports[_0xd67c('0x6')]=function(_0x1a54ff){for(var _0x51665a=0x0,_0x29361d=events[_0xd67c('0x7')];_0x51665a<_0x29361d;_0x51665a++){var _0x3022fd=events[_0x51665a];var _0x3cb7e6=createListener(_0xd67c('0x8')+_0x3022fd,_0x1a54ff);UserEvents['on'](_0x3022fd,_0x3cb7e6);}}; \ No newline at end of file +var _0x3b52=['emit','removeListener','register','length','user:','./user.events','save','update'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0x3b52,0x1ed));var _0x23b5=function(_0xb0799e,_0x398076){_0xb0799e=_0xb0799e-0x0;var _0x3ddc9c=_0x3b52[_0xb0799e];return _0x3ddc9c;};'use strict';var UserEvents=require(_0x23b5('0x0'));var events=[_0x23b5('0x1'),'remove',_0x23b5('0x2')];function createListener(_0x2af166,_0xbc55ae){return function(_0xa6b32f){_0xbc55ae[_0x23b5('0x3')](_0x2af166,_0xa6b32f);};}function removeListener(_0x45b61f,_0x336503){return function(){UserEvents[_0x23b5('0x4')](_0x45b61f,_0x336503);};}exports[_0x23b5('0x5')]=function(_0xe3b853){for(var _0x371361=0x0,_0x433ab8=events[_0x23b5('0x6')];_0x371361<_0x433ab8;_0x371361++){var _0x319dd6=events[_0x371361];var _0x119f1f=createListener(_0x23b5('0x7')+_0x319dd6,_0xe3b853);UserEvents['on'](_0x319dd6,_0x119f1f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index be8edc7..c8c1da8 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x41a8df,_0x1bbcdf){var _0x4a9d49=function(_0x585976){while(--_0x585976){_0x41a8df['push'](_0x41a8df['shift']());}};_0x4a9d49(++_0x1bbcdf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1528b3,_0x411db6){var _0x5c0ffc=function(_0x487d7a){while(--_0x487d7a){_0x1528b3['push'](_0x1528b3['shift']());}};_0x5c0ffc(++_0x411db6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 80ecec4..ddab4fa 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 _0xf33d=['exports','INTEGER','sequelize'];(function(_0x1caef5,_0x210252){var _0x29e5c6=function(_0x52b4ac){while(--_0x52b4ac){_0x1caef5['push'](_0x1caef5['shift']());}};_0x29e5c6(++_0x210252);}(_0xf33d,0xc5));var _0xdf33=function(_0x53cf5a,_0x4fe8b7){_0x53cf5a=_0x53cf5a-0x0;var _0x9fbde2=_0xf33d[_0x53cf5a];return _0x9fbde2;};'use strict';var Sequelize=require(_0xdf33('0x0'));module[_0xdf33('0x1')]={'penalty':{'type':Sequelize[_0xdf33('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9520=['INTEGER','sequelize','exports'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x9520,0xfd));var _0x0952=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9520[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x0952('0x0'));module[_0x0952('0x1')]={'penalty':{'type':Sequelize[_0x0952('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 0843512..4146b74 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 _0xc204=['user_has_chat_queues','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x3fae7c,_0x20c3ce){var _0x3b15e2=function(_0x35e2c4){while(--_0x35e2c4){_0x3fae7c['push'](_0x3fae7c['shift']());}};_0x3b15e2(++_0x20c3ce);}(_0xc204,0x137));var _0x4c20=function(_0x42fc08,_0x23261a){_0x42fc08=_0x42fc08-0x0;var _0x21a189=_0xc204[_0x42fc08];return _0x21a189;};'use strict';var _=require(_0x4c20('0x0'));var util=require('util');var logger=require(_0x4c20('0x1'))(_0x4c20('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c20('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c20('0x4'));var config=require(_0x4c20('0x5'));var attributes=require(_0x4c20('0x6'));module[_0x4c20('0x7')]=function(_0x54dfa2,_0x1fa58c){return _0x54dfa2['define'](_0x4c20('0x8'),attributes,{'tableName':_0x4c20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a86=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5839cd,_0x2f2a8f){var _0x368336=function(_0x584467){while(--_0x584467){_0x5839cd['push'](_0x5839cd['shift']());}};_0x368336(++_0x2f2a8f);}(_0x4a86,0x1b2));var _0x64a8=function(_0x317bb2,_0x3212a0){_0x317bb2=_0x317bb2-0x0;var _0x29b6ec=_0x4a86[_0x317bb2];return _0x29b6ec;};'use strict';var _=require(_0x64a8('0x0'));var util=require(_0x64a8('0x1'));var logger=require(_0x64a8('0x2'))(_0x64a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64a8('0x4'));var fs=require('fs');var path=require(_0x64a8('0x5'));var rimraf=require(_0x64a8('0x6'));var config=require(_0x64a8('0x7'));var attributes=require(_0x64a8('0x8'));module[_0x64a8('0x9')]=function(_0x39453b,_0x4a51d3){return _0x39453b[_0x64a8('0xa')](_0x64a8('0xb'),attributes,{'tableName':_0x64a8('0xc'),'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 f2e5cb4..8922f75 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 _0xe2fd=['error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/environment','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x518b99,_0x4333e4){var _0x45faed=function(_0x48efa3){while(--_0x48efa3){_0x518b99['push'](_0x518b99['shift']());}};_0x45faed(++_0x4333e4);}(_0xe2fd,0x1be));var _0xde2f=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xe2fd[_0x5ad220];return _0xdec77d;};'use strict';var _=require('lodash');var util=require(_0xde2f('0x0'));var moment=require(_0xde2f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde2f('0x2'));var db=require(_0xde2f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xde2f('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xde2f('0x5')][_0xde2f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1216bb,_0x143825,_0x312182){return new BPromise(function(_0x5e6d94,_0x59b16e){return client[_0xde2f('0x7')](_0x1216bb,_0x312182)['then'](function(_0x5d4c92){logger[_0xde2f('0x8')](_0xde2f('0x9'),_0x143825,_0xde2f('0xa'));logger[_0xde2f('0xb')](_0xde2f('0xc'),_0x143825,_0xde2f('0xa'),JSON['stringify'](_0x5d4c92));if(_0x5d4c92[_0xde2f('0xd')]){if(_0x5d4c92[_0xde2f('0xd')]['code']===0x1f4){logger['error'](_0xde2f('0x9'),_0x143825,_0x5d4c92['error'][_0xde2f('0xe')]);return _0x59b16e(_0x5d4c92[_0xde2f('0xd')][_0xde2f('0xe')]);}logger[_0xde2f('0xd')](_0xde2f('0x9'),_0x143825,_0x5d4c92[_0xde2f('0xd')][_0xde2f('0xe')]);return _0x5e6d94(_0x5d4c92[_0xde2f('0xd')][_0xde2f('0xe')]);}else{logger[_0xde2f('0x8')]('UserChatQueue,\x20%s,\x20%s',_0x143825,_0xde2f('0xa'));_0x5e6d94(_0x5d4c92[_0xde2f('0xf')]['message']);}})[_0xde2f('0x10')](function(_0x4644d2){logger[_0xde2f('0xd')](_0xde2f('0x9'),_0x143825,_0x4644d2);_0x59b16e(_0x4644d2);});});} \ No newline at end of file +var _0xcf11=['UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x547524,_0x32b16b){var _0x49e72b=function(_0xa8ec0f){while(--_0xa8ec0f){_0x547524['push'](_0x547524['shift']());}};_0x49e72b(++_0x32b16b);}(_0xcf11,0x141));var _0x1cf1=function(_0x2a99e2,_0x1803e4){_0x2a99e2=_0x2a99e2-0x0;var _0x23fb5f=_0xcf11[_0x2a99e2];return _0x23fb5f;};'use strict';var _=require(_0x1cf1('0x0'));var util=require(_0x1cf1('0x1'));var moment=require('moment');var BPromise=require(_0x1cf1('0x2'));var rs=require(_0x1cf1('0x3'));var fs=require('fs');var Redis=require(_0x1cf1('0x4'));var db=require(_0x1cf1('0x5'))['db'];var utils=require(_0x1cf1('0x6'));var logger=require(_0x1cf1('0x7'))(_0x1cf1('0x8'));var config=require(_0x1cf1('0x9'));var jayson=require(_0x1cf1('0xa'));var client=jayson[_0x1cf1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x409e94,_0x326c16,_0xb28060){return new BPromise(function(_0x559408,_0x3e259a){return client[_0x1cf1('0xc')](_0x409e94,_0xb28060)[_0x1cf1('0xd')](function(_0x52d075){logger[_0x1cf1('0xe')](_0x1cf1('0xf'),_0x326c16,'request\x20sent');logger[_0x1cf1('0x10')](_0x1cf1('0x11'),_0x326c16,_0x1cf1('0x12'),JSON['stringify'](_0x52d075));if(_0x52d075['error']){if(_0x52d075[_0x1cf1('0x13')][_0x1cf1('0x14')]===0x1f4){logger[_0x1cf1('0x13')](_0x1cf1('0xf'),_0x326c16,_0x52d075[_0x1cf1('0x13')][_0x1cf1('0x15')]);return _0x3e259a(_0x52d075[_0x1cf1('0x13')]['message']);}logger[_0x1cf1('0x13')](_0x1cf1('0xf'),_0x326c16,_0x52d075[_0x1cf1('0x13')][_0x1cf1('0x15')]);return _0x559408(_0x52d075[_0x1cf1('0x13')]['message']);}else{logger[_0x1cf1('0xe')](_0x1cf1('0xf'),_0x326c16,'request\x20sent');_0x559408(_0x52d075[_0x1cf1('0x16')][_0x1cf1('0x15')]);}})[_0x1cf1('0x17')](function(_0xe7b651){logger[_0x1cf1('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x326c16,_0xe7b651);_0x3e259a(_0xe7b651);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 861c862..d71a338 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x26acd8,_0x20c2c4){var _0x478ade=function(_0x3a5b5c){while(--_0x3a5b5c){_0x26acd8['push'](_0x26acd8['shift']());}};_0x478ade(++_0x20c2c4);}(_0x70e0,0x17b));var _0x070e=function(_0x28df04,_0xd9259){_0x28df04=_0x28df04-0x0;var _0x385cc6=_0x70e0[_0x28df04];return _0x385cc6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 3ab37ff..b9554a5 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 _0x40ba=['INTEGER','STRING','sequelize','exports'];(function(_0x384ce2,_0x29e49f){var _0x2f18df=function(_0x190585){while(--_0x190585){_0x384ce2['push'](_0x384ce2['shift']());}};_0x2f18df(++_0x29e49f);}(_0x40ba,0x1da));var _0xa40b=function(_0x25a386,_0x4acd61){_0x25a386=_0x25a386-0x0;var _0x4d3d47=_0x40ba[_0x25a386];return _0x4d3d47;};'use strict';var Sequelize=require(_0xa40b('0x0'));module[_0xa40b('0x1')]={'penalty':{'type':Sequelize[_0xa40b('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa40b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa40b('0x3')]}}; \ No newline at end of file +var _0x84a1=['sequelize','exports','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84a1,0x138));var _0x184a=function(_0x21b496,_0x33a847){_0x21b496=_0x21b496-0x0;var _0xe585d9=_0x84a1[_0x21b496];return _0xe585d9;};'use strict';var Sequelize=require(_0x184a('0x0'));module[_0x184a('0x1')]={'penalty':{'type':Sequelize[_0x184a('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x184a('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 6f8c19f..a5930af 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 _0x4530=['moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4530,0xe1));var _0x0453=function(_0x4c98ba,_0x433872){_0x4c98ba=_0x4c98ba-0x0;var _0x545558=_0x4530[_0x4c98ba];return _0x545558;};'use strict';var _=require(_0x0453('0x0'));var util=require(_0x0453('0x1'));var logger=require(_0x0453('0x2'))('api');var moment=require(_0x0453('0x3'));var BPromise=require(_0x0453('0x4'));var rp=require(_0x0453('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0453('0x6'));var config=require(_0x0453('0x7'));var attributes=require(_0x0453('0x8'));module[_0x0453('0x9')]=function(_0x320963,_0x27de94){return _0x320963[_0x0453('0xa')](_0x0453('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf166=['rimraf','../../config/environment','./userFaxQueue.attributes','define','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x6e10e7,_0x3ab3f5){var _0x3308f9=function(_0x36662d){while(--_0x36662d){_0x6e10e7['push'](_0x6e10e7['shift']());}};_0x3308f9(++_0x3ab3f5);}(_0xf166,0xae));var _0x6f16=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf166[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6f16('0x0'));var util=require(_0x6f16('0x1'));var logger=require(_0x6f16('0x2'))('api');var moment=require(_0x6f16('0x3'));var BPromise=require(_0x6f16('0x4'));var rp=require(_0x6f16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f16('0x6'));var config=require(_0x6f16('0x7'));var attributes=require(_0x6f16('0x8'));module['exports']=function(_0x2adf90,_0x587f7c){return _0x2adf90[_0x6f16('0x9')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 1099435..c320673 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 _0xccbb=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x97b61c,_0x30f42c){var _0xa87f74=function(_0x2851a2){while(--_0x2851a2){_0x97b61c['push'](_0x97b61c['shift']());}};_0xa87f74(++_0x30f42c);}(_0xccbb,0x18c));var _0xbccb=function(_0x488b60,_0x2e9978){_0x488b60=_0x488b60-0x0;var _0x5c63be=_0xccbb[_0x488b60];return _0x5c63be;};'use strict';var _=require(_0xbccb('0x0'));var util=require(_0xbccb('0x1'));var moment=require(_0xbccb('0x2'));var BPromise=require(_0xbccb('0x3'));var rs=require(_0xbccb('0x4'));var fs=require('fs');var Redis=require(_0xbccb('0x5'));var db=require(_0xbccb('0x6'))['db'];var utils=require(_0xbccb('0x7'));var logger=require(_0xbccb('0x8'))(_0xbccb('0x9'));var config=require(_0xbccb('0xa'));var jayson=require(_0xbccb('0xb'));var client=jayson[_0xbccb('0xc')][_0xbccb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5c7594,_0x477f1a,_0x28a21f){return new BPromise(function(_0x5168f5,_0x341317){return client['request'](_0x5c7594,_0x28a21f)['then'](function(_0x303529){logger[_0xbccb('0xe')](_0xbccb('0xf'),_0x477f1a,_0xbccb('0x10'));logger[_0xbccb('0x11')](_0xbccb('0x12'),_0x477f1a,_0xbccb('0x10'),JSON[_0xbccb('0x13')](_0x303529));if(_0x303529[_0xbccb('0x14')]){if(_0x303529[_0xbccb('0x14')][_0xbccb('0x15')]===0x1f4){logger[_0xbccb('0x14')](_0xbccb('0xf'),_0x477f1a,_0x303529[_0xbccb('0x14')]['message']);return _0x341317(_0x303529[_0xbccb('0x14')][_0xbccb('0x16')]);}logger[_0xbccb('0x14')](_0xbccb('0xf'),_0x477f1a,_0x303529[_0xbccb('0x14')]['message']);return _0x5168f5(_0x303529[_0xbccb('0x14')]['message']);}else{logger[_0xbccb('0xe')](_0xbccb('0xf'),_0x477f1a,_0xbccb('0x10'));_0x5168f5(_0x303529['result']['message']);}})['catch'](function(_0x298d97){logger['error'](_0xbccb('0xf'),_0x477f1a,_0x298d97);_0x341317(_0x298d97);});});} \ No newline at end of file +var _0xf8e1=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x46b1c9,_0x169f87){var _0x17569c=function(_0x4b7c45){while(--_0x4b7c45){_0x46b1c9['push'](_0x46b1c9['shift']());}};_0x17569c(++_0x169f87);}(_0xf8e1,0x15c));var _0x1f8e=function(_0x1dd524,_0x22ce03){_0x1dd524=_0x1dd524-0x0;var _0x2ad2a7=_0xf8e1[_0x1dd524];return _0x2ad2a7;};'use strict';var _=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var moment=require('moment');var BPromise=require(_0x1f8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f8e('0x3'));var db=require(_0x1f8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f8e('0x5'));var config=require(_0x1f8e('0x6'));var jayson=require(_0x1f8e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bfbb3,_0x3c1185,_0x51bbcd){return new BPromise(function(_0x514a06,_0x89d62f){return client[_0x1f8e('0x8')](_0x2bfbb3,_0x51bbcd)[_0x1f8e('0x9')](function(_0x3580e8){logger[_0x1f8e('0xa')](_0x1f8e('0xb'),_0x3c1185,_0x1f8e('0xc'));logger[_0x1f8e('0xd')](_0x1f8e('0xe'),_0x3c1185,_0x1f8e('0xc'),JSON[_0x1f8e('0xf')](_0x3580e8));if(_0x3580e8[_0x1f8e('0x10')]){if(_0x3580e8['error']['code']===0x1f4){logger[_0x1f8e('0x10')](_0x1f8e('0xb'),_0x3c1185,_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);return _0x89d62f(_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);}logger[_0x1f8e('0x10')](_0x1f8e('0xb'),_0x3c1185,_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);return _0x514a06(_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);}else{logger[_0x1f8e('0xa')](_0x1f8e('0xb'),_0x3c1185,_0x1f8e('0xc'));_0x514a06(_0x3580e8['result'][_0x1f8e('0x11')]);}})[_0x1f8e('0x12')](function(_0x20a372){logger[_0x1f8e('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x3c1185,_0x20a372);_0x89d62f(_0x20a372);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index fc510eb..3955a8c 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x9b6188,_0x28cb0b){var _0x37d16d=function(_0x25b681){while(--_0x25b681){_0x9b6188['push'](_0x9b6188['shift']());}};_0x37d16d(++_0x28cb0b);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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(_0x31a610,_0x490ec7){var _0x2e15b4=function(_0x2c8280){while(--_0x2c8280){_0x31a610['push'](_0x31a610['shift']());}};_0x2e15b4(++_0x490ec7);}(_0x70e0,0x17b));var _0x070e=function(_0x5731de,_0x1de2eb){_0x5731de=_0x5731de-0x0;var _0x21a8b4=_0x70e0[_0x5731de];return _0x21a8b4;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 01478d8..3dd54d0 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 _0x0fb4=['sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0fb4,0xa4));var _0x40fb=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x0fb4[_0x17c483];return _0x112bdb;};'use strict';var Sequelize=require(_0x40fb('0x0'));module[_0x40fb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe8f7=['INTEGER','sequelize','exports'];(function(_0x40d659,_0x1352a5){var _0x1de7f5=function(_0x526e87){while(--_0x526e87){_0x40d659['push'](_0x40d659['shift']());}};_0x1de7f5(++_0x1352a5);}(_0xe8f7,0x112));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7e8f('0x0'));module[_0x7e8f('0x1')]={'penalty':{'type':Sequelize[_0x7e8f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 30f5c10..9847341 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 _0x6fdf=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x579f16,_0x83c973){var _0x13039a=function(_0x2aa7c5){while(--_0x2aa7c5){_0x579f16['push'](_0x579f16['shift']());}};_0x13039a(++_0x83c973);}(_0x6fdf,0x1be));var _0xf6fd=function(_0x155685,_0x353cf8){_0x155685=_0x155685-0x0;var _0x543bd2=_0x6fdf[_0x155685];return _0x543bd2;};'use strict';var _=require(_0xf6fd('0x0'));var util=require(_0xf6fd('0x1'));var logger=require(_0xf6fd('0x2'))('api');var moment=require(_0xf6fd('0x3'));var BPromise=require(_0xf6fd('0x4'));var rp=require(_0xf6fd('0x5'));var fs=require('fs');var path=require(_0xf6fd('0x6'));var rimraf=require(_0xf6fd('0x7'));var config=require(_0xf6fd('0x8'));var attributes=require(_0xf6fd('0x9'));module[_0xf6fd('0xa')]=function(_0x26213f,_0x174982){return _0x26213f[_0xf6fd('0xb')](_0xf6fd('0xc'),attributes,{'tableName':_0xf6fd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dc2=['../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f1d17,_0x5076aa){var _0x4b1270=function(_0x55125c){while(--_0x55125c){_0x2f1d17['push'](_0x2f1d17['shift']());}};_0x4b1270(++_0x5076aa);}(_0x8dc2,0xbb));var _0x28dc=function(_0x5f1c59,_0x3fff4c){_0x5f1c59=_0x5f1c59-0x0;var _0xbfb242=_0x8dc2[_0x5f1c59];return _0xbfb242;};'use strict';var _=require(_0x28dc('0x0'));var util=require(_0x28dc('0x1'));var logger=require(_0x28dc('0x2'))(_0x28dc('0x3'));var moment=require(_0x28dc('0x4'));var BPromise=require(_0x28dc('0x5'));var rp=require(_0x28dc('0x6'));var fs=require('fs');var path=require(_0x28dc('0x7'));var rimraf=require('rimraf');var config=require(_0x28dc('0x8'));var attributes=require(_0x28dc('0x9'));module[_0x28dc('0xa')]=function(_0x5f38eb,_0x3753ec){return _0x5f38eb[_0x28dc('0xb')]('UserMailQueue',attributes,{'tableName':_0x28dc('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 fdafea0..fb2c269 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x7217,0x19e));var _0x7721=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x7217[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x135cae,_0x53f356){var _0x210b22=function(_0x42e408){while(--_0x42e408){_0x135cae['push'](_0x135cae['shift']());}};_0x210b22(++_0x53f356);}(_0x3e74,0x175));var _0x43e7=function(_0x5d7623,_0xc97772){_0x5d7623=_0x5d7623-0x0;var _0x2be24a=_0x3e74[_0x5d7623];return _0x2be24a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 96cb8ff..a86920d 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 _0xdb4e=['post','isAuthenticated','sendUserNotification','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller'];(function(_0x5c7855,_0x48a890){var _0x4d5086=function(_0x404eb8){while(--_0x404eb8){_0x5c7855['push'](_0x5c7855['shift']());}};_0x4d5086(++_0x48a890);}(_0xdb4e,0xc7));var _0xedb4=function(_0x56c406,_0x55b370){_0x56c406=_0x56c406-0x0;var _0xf2d2b0=_0xdb4e[_0x56c406];return _0xf2d2b0;};'use strict';var multer=require(_0xedb4('0x0'));var util=require('util');var path=require(_0xedb4('0x1'));var timeout=require(_0xedb4('0x2'));var express=require(_0xedb4('0x3'));var router=express[_0xedb4('0x4')]();var fs_extra=require(_0xedb4('0x5'));var auth=require(_0xedb4('0x6'));var interaction=require(_0xedb4('0x7'));var config=require('../../config/environment');var controller=require(_0xedb4('0x8'));router[_0xedb4('0x9')]('/',auth[_0xedb4('0xa')](),controller[_0xedb4('0xb')]);module[_0xedb4('0xc')]=router; \ No newline at end of file +var _0x51a0=['util','path','express','Router','fs-extra','../../components/auth/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x46d613,_0xf6aa29){var _0x3494e1=function(_0x2b2c06){while(--_0x2b2c06){_0x46d613['push'](_0x46d613['shift']());}};_0x3494e1(++_0xf6aa29);}(_0x51a0,0x1d3));var _0x051a=function(_0x479131,_0x2828f4){_0x479131=_0x479131-0x0;var _0x28e996=_0x51a0[_0x479131];return _0x28e996;};'use strict';var multer=require(_0x051a('0x0'));var util=require(_0x051a('0x1'));var path=require(_0x051a('0x2'));var timeout=require('connect-timeout');var express=require(_0x051a('0x3'));var router=express[_0x051a('0x4')]();var fs_extra=require(_0x051a('0x5'));var auth=require(_0x051a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x051a('0x7'));router[_0x051a('0x8')]('/',auth[_0x051a('0x9')](),controller[_0x051a('0xa')]);module[_0x051a('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 68e5b45..5c60b29 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 _0x25aa=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2f8c35,_0x3cd8bd){var _0x224fd2=function(_0x39ea10){while(--_0x39ea10){_0x2f8c35['push'](_0x2f8c35['shift']());}};_0x224fd2(++_0x3cd8bd);}(_0x25aa,0x1e5));var _0xa25a=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x25aa[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0xa25a('0x0'));module[_0xa25a('0x1')]={'body':{'type':Sequelize[_0xa25a('0x2')]},'senderName':{'type':Sequelize[_0xa25a('0x3')]},'recipientsId':{'type':Sequelize[_0xa25a('0x2')]},'recipientsDescription':{'type':Sequelize[_0xa25a('0x3')]},'beep':{'type':Sequelize[_0xa25a('0x4')]}}; \ No newline at end of file +var _0x9b92=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x33f184,_0x305868){var _0x50d2ae=function(_0x493ec0){while(--_0x493ec0){_0x33f184['push'](_0x33f184['shift']());}};_0x50d2ae(++_0x305868);}(_0x9b92,0xc5));var _0x29b9=function(_0x367c07,_0x1fe766){_0x367c07=_0x367c07-0x0;var _0x12aab2=_0x9b92[_0x367c07];return _0x12aab2;};'use strict';var Sequelize=require(_0x29b9('0x0'));module[_0x29b9('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x29b9('0x2')]},'recipientsId':{'type':Sequelize[_0x29b9('0x3')]},'recipientsDescription':{'type':Sequelize[_0x29b9('0x2')]},'beep':{'type':Sequelize[_0x29b9('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 86431f8..7f788c5 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 _0x11e8=['Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','join','sequelize','transaction','UserNotification','recipient','emit','catch','text','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','forEach','startCase','model','union','ids','queue','replace','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some','toLowerCase'];(function(_0x3409ae,_0x34a098){var _0x5c736d=function(_0x4800a0){while(--_0x4800a0){_0x3409ae['push'](_0x3409ae['shift']());}};_0x5c736d(++_0x34a098);}(_0x11e8,0x129));var _0x811e=function(_0x225f4f,_0xae43e8){_0x225f4f=_0x225f4f-0x0;var _0x3d0a36=_0x11e8[_0x225f4f];return _0x3d0a36;};'use strict';var emlformat=require(_0x811e('0x0'));var rimraf=require(_0x811e('0x1'));var zipdir=require(_0x811e('0x2'));var jsonpatch=require(_0x811e('0x3'));var rp=require('request-promise');var moment=require(_0x811e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x811e('0x5'));var path=require('path');var sox=require(_0x811e('0x6'));var csv=require(_0x811e('0x7'));var ejs=require(_0x811e('0x8'));var fs=require('fs');var fs_extra=require(_0x811e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x811e('0xa'));var deskjs=require(_0x811e('0xb'));var toCsv=require(_0x811e('0x7'));var querystring=require(_0x811e('0xc'));var Papa=require(_0x811e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x811e('0xe'));var as=require(_0x811e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x811e('0x10'));var licenseUtil=require(_0x811e('0x11'));var db=require(_0x811e('0x12'))['db'];config['redis']=_[_0x811e('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x811e('0x14'))(new Redis(config[_0x811e('0x15')]));require(_0x811e('0x16'))[_0x811e('0x17')](socket);function respondWithStatusCode(_0x4696ed,_0x5d9eb2){_0x5d9eb2=_0x5d9eb2||0xcc;return function(_0x369341){if(_0x369341){return _0x4696ed[_0x811e('0x18')](_0x5d9eb2);}return _0x4696ed[_0x811e('0x19')](_0x5d9eb2)[_0x811e('0x1a')]();};}function respondWithResult(_0x310e23,_0x4b7c92){_0x4b7c92=_0x4b7c92||0xc8;return function(_0x4927c9){if(_0x4927c9){return _0x310e23[_0x811e('0x19')](_0x4b7c92)[_0x811e('0x1b')](_0x4927c9);}};}function respondWithFilteredResult(_0x2892db,_0x1440d0){return function(_0x3f1612){if(_0x3f1612){var _0x363250=typeof _0x1440d0[_0x811e('0x1c')]===_0x811e('0x1d')&&typeof _0x1440d0[_0x811e('0x1e')]===_0x811e('0x1d');var _0x49985d=_0x3f1612[_0x811e('0x1f')];var _0x4697f=_0x363250?0x0:_0x1440d0[_0x811e('0x1c')];var _0x530b62=_0x363250?_0x3f1612[_0x811e('0x1f')]:_0x1440d0['offset']+_0x1440d0[_0x811e('0x1e')];var _0x5efca5;if(_0x530b62>=_0x49985d){_0x530b62=_0x49985d;_0x5efca5=0xc8;}else{_0x5efca5=0xce;}_0x2892db[_0x811e('0x19')](_0x5efca5);return _0x2892db[_0x811e('0x20')]('Content-Range',_0x4697f+'-'+_0x530b62+'/'+_0x49985d)[_0x811e('0x1b')](_0x3f1612);}return null;};}function patchUpdates(_0x3cf79b){return function(_0x3f3c95){try{jsonpatch['apply'](_0x3f3c95,_0x3cf79b,!![]);}catch(_0xd4a2d1){return BPromise[_0x811e('0x21')](_0xd4a2d1);}return _0x3f3c95[_0x811e('0x22')]();};}function saveUpdates(_0x5b356a,_0x405d67){return function(_0x331209){if(_0x331209){return _0x331209['update'](_0x5b356a)[_0x811e('0x23')](function(_0x2b0d00){return _0x2b0d00;});}return null;};}function removeEntity(_0x2a14c0,_0x16686a){return function(_0x46eac4){if(_0x46eac4){return _0x46eac4[_0x811e('0x24')]()[_0x811e('0x23')](function(){_0x2a14c0[_0x811e('0x19')](0xcc)[_0x811e('0x1a')]();});}};}function handleEntityNotFound(_0x48b786,_0x4b9397){return function(_0x243f4f){if(!_0x243f4f){_0x48b786[_0x811e('0x18')](0x194);}return _0x243f4f;};}function handleError(_0x303ba3,_0x3c9fc1){_0x3c9fc1=_0x3c9fc1||0x1f4;return function(_0x541cb2){logger[_0x811e('0x25')](_0x541cb2[_0x811e('0x26')]);if(_0x541cb2[_0x811e('0x27')]){delete _0x541cb2[_0x811e('0x27')];}_0x303ba3[_0x811e('0x19')](_0x3c9fc1)[_0x811e('0x28')](_0x541cb2);};}exports['sendUserNotification']=function(_0x5ab6b6,_0x2cd807,_0x23653d){if(!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')]('text')&&!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')]('TemplateId')){throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))](_0x811e('0x2d'));}else{if(_0x5ab6b6['body'][_0x811e('0x2a')]('TemplateId')&&!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')](_0x811e('0x2e'))){throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))](_0x811e('0x2f'));}if(!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')](_0x811e('0x30'))){throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x81178c=JSON[_0x811e('0x31')](_0x5ab6b6[_0x811e('0x29')][_0x811e('0x30')]);}catch(_0x3bf70a){logger[_0x811e('0x25')](_0x3bf70a);throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x85002=[_0x811e('0x32'),_0x811e('0x33'),_0x811e('0x34'),'openchannelqueue',_0x811e('0x35'),_0x811e('0x36'),_0x811e('0x37'),'team',_0x811e('0x38')];if(_[_0x811e('0x39')](_0x81178c,function(_0x3a371a){return!_['includes'](_0x85002,_0x3a371a['model'][_0x811e('0x3a')]());})){throw new db['Sequelize'][(_0x811e('0x2c'))](_0x811e('0x3b'));}}}var _0x34ce21={};_0x34ce21[_0x811e('0x3c')]=_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')]('senderName')?_0x5ab6b6[_0x811e('0x29')]['senderName']:_0x5ab6b6['user'][_0x811e('0x3d')];_0x34ce21['recipientsDescription']=_[_0x811e('0x3e')](_0x5ab6b6[_0x811e('0x29')][_0x811e('0x3f')])?null:_0x5ab6b6['body']['recipientsDescription'];_0x34ce21[_0x811e('0x40')]=_0x5ab6b6[_0x811e('0x29')][_0x811e('0x40')]||![];_0x34ce21['SenderId']=_0x5ab6b6[_0x811e('0x38')]['id'];return getContent(_0x5ab6b6[_0x811e('0x29')])[_0x811e('0x23')](function(_0x2673ef){_0x34ce21[_0x811e('0x29')]=_0x2673ef;return getRecipients(_0x81178c);})[_0x811e('0x23')](function(_0x22cec6){_0x34ce21['recipientsId']=_['sortBy'](_0x22cec6)[_0x811e('0x41')](',');return db[_0x811e('0x42')][_0x811e('0x43')](function(_0x5148e2){return db[_0x811e('0x44')]['create'](_0x34ce21,{'raw':!![],'transaction':_0x5148e2})['then'](function(_0x4de75f){var _0x46b4c0={'sender':_0x34ce21[_0x811e('0x3c')],'description':_0x34ce21['recipientsDescription'],'content':_0x34ce21[_0x811e('0x29')],'beep':_0x34ce21[_0x811e('0x40')]};_0x22cec6['forEach'](function(_0x23a092){_0x46b4c0[_0x811e('0x45')]=_0x23a092;socket[_0x811e('0x46')]('userNotification:send',_0x46b4c0);});return _0x4de75f;});});})[_0x811e('0x23')](respondWithResult(_0x2cd807,0xc9))[_0x811e('0x47')](handleError(_0x2cd807,null));};function getContent(_0x89bb71){return new BPromise(function(_0x39fad5,_0x50d210){if(_0x89bb71[_0x811e('0x48')]){_0x39fad5(_0x89bb71[_0x811e('0x48')]);return;}return db['Template']['findOne']({'attributes':[_0x811e('0x49')],'where':{'id':_0x89bb71[_0x811e('0x4a')]},'raw':!![]})['then'](function(_0x3552b3){if(!_0x3552b3)throw new db['Sequelize'][(_0x811e('0x2c'))](_0x811e('0x4b'));var _0x26738a=Mustache['render'](_0x3552b3[_0x811e('0x49')],_0x89bb71['view']);_0x39fad5(_0x26738a);})[_0x811e('0x47')](function(_0x2aab38){_0x50d210(_0x2aab38);});});}function getRecipients(_0x295782){return new BPromise(function(_0xe9cf15,_0x4b6bf1){var _0x417c07=[];var _0x12e718=[];_0x295782[_0x811e('0x4c')](function(_0x2dacef){var _0x7a165d=_[_0x811e('0x4d')](_0x2dacef[_0x811e('0x4e')]['toLowerCase']());if(_0x7a165d==='User'){_0x417c07=_[_0x811e('0x4f')](_0x417c07,_0x2dacef[_0x811e('0x50')]);}else{if(_['includes'](_0x7a165d,_0x811e('0x51')))_0x7a165d=_0x7a165d[_0x811e('0x52')](_0x811e('0x51'),'Queue');_0x2dacef['ids'][_0x811e('0x4c')](function(_0x46eda8){_0x12e718[_0x811e('0x53')](getAgents(_0x7a165d,_0x46eda8));});}});return BPromise[_0x811e('0x54')](_0x12e718)[_0x811e('0x23')](function(_0x2b36b0){_0x417c07=_[_0x811e('0x4f')](_0x417c07,_[_0x811e('0x55')](_0x2b36b0));_0xe9cf15(_0x417c07);})['catch'](function(_0x107f0b){_0x4b6bf1(_0x107f0b);});});}function getAgents(_0x4eacef,_0x3a29b5){return new BPromise(function(_0x1038fd,_0x275961){return db[_0x4eacef][_0x811e('0x56')]({'where':{'id':_0x3a29b5}})[_0x811e('0x23')](function(_0x567ded){return _0x567ded[_0x811e('0x57')]({'attributes':['id'],'raw':!![]})[_0x811e('0x23')](function(_0x3663c1){var _0x577c1d=_[_0x811e('0x58')](_0x3663c1,'id');_0x1038fd(_0x577c1d);});})[_0x811e('0x47')](function(_0x16d35d){_0x275961(_0x16d35d);});});} \ No newline at end of file +var _0x0166=['forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','queue','replace','Queue','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','error','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction','UserNotification','create'];(function(_0x29e397,_0x1ec646){var _0x52426a=function(_0xd547e8){while(--_0xd547e8){_0x29e397['push'](_0x29e397['shift']());}};_0x52426a(++_0x1ec646);}(_0x0166,0x1a8));var _0x6016=function(_0x25f1d7,_0x4939ab){_0x25f1d7=_0x25f1d7-0x0;var _0xe466c6=_0x0166[_0x25f1d7];return _0xe466c6;};'use strict';var emlformat=require(_0x6016('0x0'));var rimraf=require(_0x6016('0x1'));var zipdir=require(_0x6016('0x2'));var jsonpatch=require(_0x6016('0x3'));var rp=require(_0x6016('0x4'));var moment=require(_0x6016('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6016('0x6'));var util=require(_0x6016('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6016('0x8'));var ejs=require(_0x6016('0x9'));var fs=require('fs');var fs_extra=require(_0x6016('0xa'));var _=require('lodash');var squel=require(_0x6016('0xb'));var crypto=require(_0x6016('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6016('0xd'));var toCsv=require(_0x6016('0x8'));var querystring=require('querystring');var Papa=require(_0x6016('0xe'));var Redis=require(_0x6016('0xf'));var authService=require(_0x6016('0x10'));var qs=require(_0x6016('0x11'));var as=require(_0x6016('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6016('0x13'));var utils=require(_0x6016('0x14'));var config=require(_0x6016('0x15'));var licenseUtil=require(_0x6016('0x16'));var db=require(_0x6016('0x17'))['db'];config['redis']=_[_0x6016('0x18')](config[_0x6016('0x19')],{'host':_0x6016('0x1a'),'port':0x18eb});var socket=require(_0x6016('0x1b'))(new Redis(config[_0x6016('0x19')]));require(_0x6016('0x1c'))[_0x6016('0x1d')](socket);function respondWithStatusCode(_0x33b5b2,_0x3086b3){_0x3086b3=_0x3086b3||0xcc;return function(_0x346351){if(_0x346351){return _0x33b5b2[_0x6016('0x1e')](_0x3086b3);}return _0x33b5b2[_0x6016('0x1f')](_0x3086b3)[_0x6016('0x20')]();};}function respondWithResult(_0x37f84e,_0x617a16){_0x617a16=_0x617a16||0xc8;return function(_0x5e148e){if(_0x5e148e){return _0x37f84e[_0x6016('0x1f')](_0x617a16)[_0x6016('0x21')](_0x5e148e);}};}function respondWithFilteredResult(_0x345967,_0x6808b3){return function(_0x2ed909){if(_0x2ed909){var _0x2064b0=typeof _0x6808b3[_0x6016('0x22')]===_0x6016('0x23')&&typeof _0x6808b3[_0x6016('0x24')]===_0x6016('0x23');var _0x4dbfdd=_0x2ed909['count'];var _0x5d14a4=_0x2064b0?0x0:_0x6808b3[_0x6016('0x22')];var _0x2af82d=_0x2064b0?_0x2ed909['count']:_0x6808b3['offset']+_0x6808b3['limit'];var _0x50bd15;if(_0x2af82d>=_0x4dbfdd){_0x2af82d=_0x4dbfdd;_0x50bd15=0xc8;}else{_0x50bd15=0xce;}_0x345967[_0x6016('0x1f')](_0x50bd15);return _0x345967[_0x6016('0x25')](_0x6016('0x26'),_0x5d14a4+'-'+_0x2af82d+'/'+_0x4dbfdd)[_0x6016('0x21')](_0x2ed909);}return null;};}function patchUpdates(_0x2eea02){return function(_0x2d3761){try{jsonpatch[_0x6016('0x27')](_0x2d3761,_0x2eea02,!![]);}catch(_0x2f30fd){return BPromise[_0x6016('0x28')](_0x2f30fd);}return _0x2d3761['save']();};}function saveUpdates(_0xe77056,_0x5284bf){return function(_0x137875){if(_0x137875){return _0x137875[_0x6016('0x29')](_0xe77056)['then'](function(_0x4e6815){return _0x4e6815;});}return null;};}function removeEntity(_0x5ce79f,_0x3beb2b){return function(_0x1df845){if(_0x1df845){return _0x1df845[_0x6016('0x2a')]()[_0x6016('0x2b')](function(){_0x5ce79f[_0x6016('0x1f')](0xcc)[_0x6016('0x20')]();});}};}function handleEntityNotFound(_0x52a324,_0x3eecb9){return function(_0x3cd915){if(!_0x3cd915){_0x52a324[_0x6016('0x1e')](0x194);}return _0x3cd915;};}function handleError(_0x9acf01,_0x527b32){_0x527b32=_0x527b32||0x1f4;return function(_0x547d5a){logger[_0x6016('0x2c')](_0x547d5a['stack']);if(_0x547d5a['name']){delete _0x547d5a['name'];}_0x9acf01['status'](_0x527b32)[_0x6016('0x2d')](_0x547d5a);};}exports[_0x6016('0x2e')]=function(_0x1961f7,_0x25b719,_0x528d30){if(!_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x31'))&&!_0x1961f7['body'][_0x6016('0x30')]('TemplateId')){throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x34'))&&!_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x35'))){throw new db['Sequelize'][(_0x6016('0x33'))](_0x6016('0x36'));}if(!_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x37'))){throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x38'));}else{try{var _0x545d38=JSON['parse'](_0x1961f7[_0x6016('0x2f')][_0x6016('0x37')]);}catch(_0x2303eb){logger[_0x6016('0x2c')](_0x2303eb);throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x39'));}var _0x5d187d=[_0x6016('0x3a'),'faxqueue',_0x6016('0x3b'),_0x6016('0x3c'),_0x6016('0x3d'),_0x6016('0x3e'),'whatsappqueue',_0x6016('0x3f'),_0x6016('0x40')];if(_[_0x6016('0x41')](_0x545d38,function(_0x1f8107){return!_[_0x6016('0x42')](_0x5d187d,_0x1f8107[_0x6016('0x43')][_0x6016('0x44')]());})){throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x45'));}}}var _0x30615b={};_0x30615b[_0x6016('0x46')]=_0x1961f7[_0x6016('0x2f')][_0x6016('0x30')](_0x6016('0x46'))?_0x1961f7[_0x6016('0x2f')]['senderName']:_0x1961f7[_0x6016('0x40')][_0x6016('0x47')];_0x30615b[_0x6016('0x48')]=_[_0x6016('0x49')](_0x1961f7[_0x6016('0x2f')][_0x6016('0x48')])?null:_0x1961f7[_0x6016('0x2f')]['recipientsDescription'];_0x30615b['beep']=_0x1961f7['body'][_0x6016('0x4a')]||![];_0x30615b[_0x6016('0x4b')]=_0x1961f7[_0x6016('0x40')]['id'];return getContent(_0x1961f7[_0x6016('0x2f')])[_0x6016('0x2b')](function(_0xf122fb){_0x30615b[_0x6016('0x2f')]=_0xf122fb;return getRecipients(_0x545d38);})['then'](function(_0x47e9ba){_0x30615b['recipientsId']=_['sortBy'](_0x47e9ba)[_0x6016('0x4c')](',');return db[_0x6016('0x4d')][_0x6016('0x4e')](function(_0x46d25b){return db[_0x6016('0x4f')][_0x6016('0x50')](_0x30615b,{'raw':!![],'transaction':_0x46d25b})['then'](function(_0xe9d98c){var _0x16c367={'sender':_0x30615b[_0x6016('0x46')],'description':_0x30615b[_0x6016('0x48')],'content':_0x30615b[_0x6016('0x2f')],'beep':_0x30615b[_0x6016('0x4a')]};_0x47e9ba[_0x6016('0x51')](function(_0x594de4){_0x16c367[_0x6016('0x52')]=_0x594de4;socket[_0x6016('0x53')](_0x6016('0x54'),_0x16c367);});return _0xe9d98c;});});})[_0x6016('0x2b')](respondWithResult(_0x25b719,0xc9))[_0x6016('0x55')](handleError(_0x25b719,null));};function getContent(_0x3ba159){return new BPromise(function(_0x8504b4,_0x162fd0){if(_0x3ba159[_0x6016('0x31')]){_0x8504b4(_0x3ba159['text']);return;}return db[_0x6016('0x56')][_0x6016('0x57')]({'attributes':[_0x6016('0x58')],'where':{'id':_0x3ba159[_0x6016('0x34')]},'raw':!![]})[_0x6016('0x2b')](function(_0x4ce34b){if(!_0x4ce34b)throw new db[(_0x6016('0x32'))][(_0x6016('0x33'))](_0x6016('0x59'));var _0x205402=Mustache[_0x6016('0x5a')](_0x4ce34b[_0x6016('0x58')],_0x3ba159['view']);_0x8504b4(_0x205402);})['catch'](function(_0x236fe6){_0x162fd0(_0x236fe6);});});}function getRecipients(_0x1337d2){return new BPromise(function(_0x276aff,_0x49fc60){var _0x33d4c9=[];var _0x421b1c=[];_0x1337d2[_0x6016('0x51')](function(_0x279065){var _0xd95d66=_['startCase'](_0x279065[_0x6016('0x43')][_0x6016('0x44')]());if(_0xd95d66===_0x6016('0x5b')){_0x33d4c9=_[_0x6016('0x5c')](_0x33d4c9,_0x279065[_0x6016('0x5d')]);}else{if(_[_0x6016('0x42')](_0xd95d66,_0x6016('0x5e')))_0xd95d66=_0xd95d66[_0x6016('0x5f')]('queue',_0x6016('0x60'));_0x279065[_0x6016('0x5d')][_0x6016('0x51')](function(_0x38324c){_0x421b1c['push'](getAgents(_0xd95d66,_0x38324c));});}});return BPromise[_0x6016('0x61')](_0x421b1c)['then'](function(_0x6256d6){_0x33d4c9=_['union'](_0x33d4c9,_[_0x6016('0x62')](_0x6256d6));_0x276aff(_0x33d4c9);})[_0x6016('0x55')](function(_0x5bdd25){_0x49fc60(_0x5bdd25);});});}function getAgents(_0x58d1f,_0x245772){return new BPromise(function(_0x587742,_0x275b03){return db[_0x58d1f][_0x6016('0x57')]({'where':{'id':_0x245772}})['then'](function(_0x3dfdf8){return _0x3dfdf8[_0x6016('0x63')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c3e64){var _0x449a9a=_[_0x6016('0x64')](_0x5c3e64,'id');_0x587742(_0x449a9a);});})[_0x6016('0x55')](function(_0x285e6f){_0x275b03(_0x285e6f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index cebeb98..4c24c6c 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 _0x1f29=['hook','exports','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x39a536,_0x4c7a40){var _0x12eb94=function(_0xf513eb){while(--_0xf513eb){_0x39a536['push'](_0x39a536['shift']());}};_0x12eb94(++_0x4c7a40);}(_0x1f29,0xec));var _0x91f2=function(_0x5463db,_0x292347){_0x5463db=_0x5463db-0x0;var _0x36f44c=_0x1f29[_0x5463db];return _0x36f44c;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x91f2('0x0'))['db'][_0x91f2('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x91f2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x91f2('0x3'),'afterDestroy':_0x91f2('0x4')};function emitEvent(_0x4b403c){return function(_0x130496,_0x45fa10,_0x4cc306){UserNotificationEvents[_0x91f2('0x5')](_0x4b403c+':'+_0x130496['id'],_0x130496);UserNotificationEvents[_0x91f2('0x5')](_0x4b403c,_0x130496);_0x4cc306(null);};}for(var e in events){if(events[_0x91f2('0x6')](e)){var event=events[e];UserNotification[_0x91f2('0x7')](e,emitEvent(event));}}module[_0x91f2('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x01c9=['hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x285106,_0x5ba789){var _0x1e34e3=function(_0x1b5c16){while(--_0x1b5c16){_0x285106['push'](_0x285106['shift']());}};_0x1e34e3(++_0x5ba789);}(_0x01c9,0x15a));var _0x901c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01c9[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x901c('0x0'));var UserNotification=require(_0x901c('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x901c('0x2'),'afterUpdate':_0x901c('0x3'),'afterDestroy':_0x901c('0x4')};function emitEvent(_0x9244a9){return function(_0x963f42,_0x429312,_0xf5229d){UserNotificationEvents[_0x901c('0x5')](_0x9244a9+':'+_0x963f42['id'],_0x963f42);UserNotificationEvents[_0x901c('0x5')](_0x9244a9,_0x963f42);_0xf5229d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x901c('0x6')](e,emitEvent(event));}}module[_0x901c('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index e1261db..b8cdf46 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 _0xb2a6=['../../config/environment','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x18fd0b,_0xe0f9ed){var _0x3b19a3=function(_0xde37ae){while(--_0xde37ae){_0x18fd0b['push'](_0x18fd0b['shift']());}};_0x3b19a3(++_0xe0f9ed);}(_0xb2a6,0xf0));var _0x6b2a=function(_0x1589bd,_0x2c3176){_0x1589bd=_0x1589bd-0x0;var _0x551fba=_0xb2a6[_0x1589bd];return _0x551fba;};'use strict';var _=require(_0x6b2a('0x0'));var util=require(_0x6b2a('0x1'));var logger=require('../../config/logger')(_0x6b2a('0x2'));var moment=require('moment');var BPromise=require(_0x6b2a('0x3'));var rp=require(_0x6b2a('0x4'));var fs=require('fs');var path=require(_0x6b2a('0x5'));var rimraf=require(_0x6b2a('0x6'));var config=require(_0x6b2a('0x7'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x4ba810,_0x45de57){return _0x4ba810[_0x6b2a('0x8')](_0x6b2a('0x9'),attributes,{'tableName':_0x6b2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b2a('0xb'),'collate':_0x6b2a('0xc')});}; \ No newline at end of file +var _0x8dad=['../../config/logger','api','rimraf','../../config/environment','exports','UserNotification','util'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x8dad,0xa7));var _0xd8da=function(_0x14c098,_0x316311){_0x14c098=_0x14c098-0x0;var _0x315cae=_0x8dad[_0x14c098];return _0x315cae;};'use strict';var _=require('lodash');var util=require(_0xd8da('0x0'));var logger=require(_0xd8da('0x1'))(_0xd8da('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8da('0x3'));var config=require(_0xd8da('0x4'));var attributes=require('./userNotification.attributes');module[_0xd8da('0x5')]=function(_0xbbba8a,_0x3bca92){return _0xbbba8a['define'](_0xd8da('0x6'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 5484c0c..882987e 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 _0xaf97=['UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info'];(function(_0x240e11,_0x244182){var _0x547ca6=function(_0x17b6af){while(--_0x17b6af){_0x240e11['push'](_0x240e11['shift']());}};_0x547ca6(++_0x244182);}(_0xaf97,0x198));var _0x7af9=function(_0x5997ba,_0x360bb7){_0x5997ba=_0x5997ba-0x0;var _0x5db2b0=_0xaf97[_0x5997ba];return _0x5db2b0;};'use strict';var _=require('lodash');var util=require(_0x7af9('0x0'));var moment=require(_0x7af9('0x1'));var BPromise=require(_0x7af9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7af9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7af9('0x4'));var logger=require('../../config/logger')(_0x7af9('0x5'));var config=require(_0x7af9('0x6'));var jayson=require(_0x7af9('0x7'));var client=jayson['client'][_0x7af9('0x8')]({'port':0x232a});config[_0x7af9('0x9')]=_['defaults'](config['redis'],{'host':_0x7af9('0xa'),'port':0x18eb});var socket=require(_0x7af9('0xb'))(new Redis(config[_0x7af9('0x9')]));require(_0x7af9('0xc'))[_0x7af9('0xd')](socket);function respondWithRpcPromise(_0x56b897,_0x578b0d,_0x1f54ee){return new BPromise(function(_0x49f642,_0x1a5abd){return client[_0x7af9('0xe')](_0x56b897,_0x1f54ee)[_0x7af9('0xf')](function(_0x1a064a){logger[_0x7af9('0x10')](_0x7af9('0x11'),_0x578b0d,_0x7af9('0x12'));logger[_0x7af9('0x13')](_0x7af9('0x14'),_0x578b0d,_0x7af9('0x12'),JSON['stringify'](_0x1a064a));if(_0x1a064a[_0x7af9('0x15')]){if(_0x1a064a[_0x7af9('0x15')][_0x7af9('0x16')]===0x1f4){logger[_0x7af9('0x15')](_0x7af9('0x11'),_0x578b0d,_0x1a064a[_0x7af9('0x15')][_0x7af9('0x17')]);return _0x1a5abd(_0x1a064a['error']['message']);}logger[_0x7af9('0x15')](_0x7af9('0x11'),_0x578b0d,_0x1a064a[_0x7af9('0x15')]['message']);return _0x49f642(_0x1a064a['error'][_0x7af9('0x17')]);}else{logger[_0x7af9('0x10')](_0x7af9('0x11'),_0x578b0d,_0x7af9('0x12'));_0x49f642(_0x1a064a['result'][_0x7af9('0x17')]);}})[_0x7af9('0x18')](function(_0x49a9dc){logger[_0x7af9('0x15')](_0x7af9('0x11'),_0x578b0d,_0x49a9dc);_0x1a5abd(_0x49a9dc);});});} \ No newline at end of file +var _0xe9c4=['./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis'];(function(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xe9c4,0x1cd));var _0x4e9c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe9c4[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4e9c('0x0'));var util=require('util');var moment=require(_0x4e9c('0x1'));var BPromise=require(_0x4e9c('0x2'));var rs=require(_0x4e9c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e9c('0x4'));var logger=require(_0x4e9c('0x5'))(_0x4e9c('0x6'));var config=require(_0x4e9c('0x7'));var jayson=require(_0x4e9c('0x8'));var client=jayson[_0x4e9c('0x9')][_0x4e9c('0xa')]({'port':0x232a});config['redis']=_[_0x4e9c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4e9c('0xc'))(new Redis(config[_0x4e9c('0xd')]));require(_0x4e9c('0xe'))[_0x4e9c('0xf')](socket);function respondWithRpcPromise(_0x1bce22,_0x25b12d,_0x54364e){return new BPromise(function(_0x43906c,_0x253eb1){return client[_0x4e9c('0x10')](_0x1bce22,_0x54364e)[_0x4e9c('0x11')](function(_0x1696fd){logger['info'](_0x4e9c('0x12'),_0x25b12d,_0x4e9c('0x13'));logger['debug'](_0x4e9c('0x14'),_0x25b12d,_0x4e9c('0x13'),JSON[_0x4e9c('0x15')](_0x1696fd));if(_0x1696fd[_0x4e9c('0x16')]){if(_0x1696fd[_0x4e9c('0x16')]['code']===0x1f4){logger[_0x4e9c('0x16')]('UserNotification,\x20%s,\x20%s',_0x25b12d,_0x1696fd['error'][_0x4e9c('0x17')]);return _0x253eb1(_0x1696fd[_0x4e9c('0x16')][_0x4e9c('0x17')]);}logger[_0x4e9c('0x16')]('UserNotification,\x20%s,\x20%s',_0x25b12d,_0x1696fd[_0x4e9c('0x16')][_0x4e9c('0x17')]);return _0x43906c(_0x1696fd['error'][_0x4e9c('0x17')]);}else{logger['info'](_0x4e9c('0x12'),_0x25b12d,_0x4e9c('0x13'));_0x43906c(_0x1696fd[_0x4e9c('0x18')][_0x4e9c('0x17')]);}})['catch'](function(_0xa69d7c){logger[_0x4e9c('0x16')](_0x4e9c('0x12'),_0x25b12d,_0xa69d7c);_0x253eb1(_0xa69d7c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 06d3ac1..58ad20f 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 _0xed7c=['./userNotification.events','save','remove','update','register','userNotification:'];(function(_0x17e915,_0x3ba4e0){var _0x4e91da=function(_0x3848b5){while(--_0x3848b5){_0x17e915['push'](_0x17e915['shift']());}};_0x4e91da(++_0x3ba4e0);}(_0xed7c,0x13e));var _0xced7=function(_0x436ebe,_0x53045c){_0x436ebe=_0x436ebe-0x0;var _0x3a282=_0xed7c[_0x436ebe];return _0x3a282;};'use strict';var UserNotificationEvents=require(_0xced7('0x0'));var events=[_0xced7('0x1'),_0xced7('0x2'),_0xced7('0x3')];function createListener(_0x58ef8c,_0x263211){return function(_0x1af0d0){_0x263211['emit'](_0x58ef8c,_0x1af0d0);};}function removeListener(_0x29fdfa,_0x3e51f5){return function(){UserNotificationEvents['removeListener'](_0x29fdfa,_0x3e51f5);};}exports[_0xced7('0x4')]=function(_0x1a8de1){for(var _0x52ad55=0x0,_0x3f5fc7=events['length'];_0x52ad55<_0x3f5fc7;_0x52ad55++){var _0x295623=events[_0x52ad55];var _0x42cc2e=createListener(_0xced7('0x5')+_0x295623,_0x1a8de1);UserNotificationEvents['on'](_0x295623,_0x42cc2e);}}; \ No newline at end of file +var _0xb2e0=['emit','removeListener','register','length','./userNotification.events','save','remove','update'];(function(_0x473f1d,_0x304c77){var _0x249482=function(_0x55c607){while(--_0x55c607){_0x473f1d['push'](_0x473f1d['shift']());}};_0x249482(++_0x304c77);}(_0xb2e0,0x1ac));var _0x0b2e=function(_0x1dbdc5,_0xe577fa){_0x1dbdc5=_0x1dbdc5-0x0;var _0x12dc3c=_0xb2e0[_0x1dbdc5];return _0x12dc3c;};'use strict';var UserNotificationEvents=require(_0x0b2e('0x0'));var events=[_0x0b2e('0x1'),_0x0b2e('0x2'),_0x0b2e('0x3')];function createListener(_0x128ac7,_0xc7b732){return function(_0x4f6426){_0xc7b732[_0x0b2e('0x4')](_0x128ac7,_0x4f6426);};}function removeListener(_0x447371,_0x25676e){return function(){UserNotificationEvents[_0x0b2e('0x5')](_0x447371,_0x25676e);};}exports[_0x0b2e('0x6')]=function(_0x27151e){for(var _0x4db7ee=0x0,_0x255b59=events[_0x0b2e('0x7')];_0x4db7ee<_0x255b59;_0x4db7ee++){var _0xfdbefc=events[_0x4db7ee];var _0x3b3b5e=createListener('userNotification:'+_0xfdbefc,_0x27151e);UserNotificationEvents['on'](_0xfdbefc,_0x3b3b5e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 19d50b7..fb042e8 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5a4c70,_0x6486d9){var _0x46fd0e=function(_0x330963){while(--_0x330963){_0x5a4c70['push'](_0x5a4c70['shift']());}};_0x46fd0e(++_0x6486d9);}(_0xedd9,0xfc));var _0x9edd=function(_0x481ee8,_0x5aa574){_0x481ee8=_0x481ee8-0x0;var _0x5ad55f=_0xedd9[_0x481ee8];return _0x5ad55f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x38b634,_0x4948a4){var _0x3b43dc=function(_0x2cce56){while(--_0x2cce56){_0x38b634['push'](_0x38b634['shift']());}};_0x3b43dc(++_0x4948a4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 81e0e50..d896008 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 _0x5d28=['exports','INTEGER','sequelize'];(function(_0x468bdd,_0x160748){var _0x458652=function(_0x9ba34c){while(--_0x9ba34c){_0x468bdd['push'](_0x468bdd['shift']());}};_0x458652(++_0x160748);}(_0x5d28,0xdd));var _0x85d2=function(_0x1d64b1,_0x1f80ef){_0x1d64b1=_0x1d64b1-0x0;var _0x2c91ba=_0x5d28[_0x1d64b1];return _0x2c91ba;};'use strict';var Sequelize=require(_0x85d2('0x0'));module[_0x85d2('0x1')]={'penalty':{'type':Sequelize[_0x85d2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa329=['sequelize'];(function(_0x2895f1,_0x526e76){var _0x338c7e=function(_0x44e900){while(--_0x44e900){_0x2895f1['push'](_0x2895f1['shift']());}};_0x338c7e(++_0x526e76);}(_0xa329,0x174));var _0x9a32=function(_0x587a1e,_0x2efd41){_0x587a1e=_0x587a1e-0x0;var _0x60b3e3=_0xa329[_0x587a1e];return _0x60b3e3;};'use strict';var Sequelize=require(_0x9a32('0x0'));module['exports']={'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 65b0edd..68e0213 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 _0x99d0=['define','UserOpenchannelQueue','util','../../config/logger','moment','bluebird','request-promise','./userOpenchannelQueue.attributes','exports'];(function(_0x173896,_0x29188b){var _0x572dc1=function(_0x2279a9){while(--_0x2279a9){_0x173896['push'](_0x173896['shift']());}};_0x572dc1(++_0x29188b);}(_0x99d0,0x13d));var _0x099d=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x99d0[_0x2f227c];return _0x5032bc;};'use strict';var _=require('lodash');var util=require(_0x099d('0x0'));var logger=require(_0x099d('0x1'))('api');var moment=require(_0x099d('0x2'));var BPromise=require(_0x099d('0x3'));var rp=require(_0x099d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x099d('0x5'));module[_0x099d('0x6')]=function(_0x4b7ed2,_0x1d9af7){return _0x4b7ed2[_0x099d('0x7')](_0x099d('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x301d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x301d,0x1a4));var _0xd301=function(_0x4c5c15,_0x1af5fa){_0x4c5c15=_0x4c5c15-0x0;var _0x5e7c14=_0x301d[_0x4c5c15];return _0x5e7c14;};'use strict';var _=require(_0xd301('0x0'));var util=require(_0xd301('0x1'));var logger=require(_0xd301('0x2'))(_0xd301('0x3'));var moment=require(_0xd301('0x4'));var BPromise=require(_0xd301('0x5'));var rp=require(_0xd301('0x6'));var fs=require('fs');var path=require(_0xd301('0x7'));var rimraf=require(_0xd301('0x8'));var config=require(_0xd301('0x9'));var attributes=require(_0xd301('0xa'));module[_0xd301('0xb')]=function(_0x275d27,_0xae712b){return _0x275d27[_0xd301('0xc')](_0xd301('0xd'),attributes,{'tableName':_0xd301('0xe'),'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 4fc6db3..fcdfe1e 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 _0x397d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','debug','request\x20sent','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x397d,0xec));var _0xd397=function(_0x2dafd1,_0x447831){_0x2dafd1=_0x2dafd1-0x0;var _0x2bd516=_0x397d[_0x2dafd1];return _0x2bd516;};'use strict';var _=require(_0xd397('0x0'));var util=require('util');var moment=require(_0xd397('0x1'));var BPromise=require(_0xd397('0x2'));var rs=require(_0xd397('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd397('0x4'))['db'];var utils=require(_0xd397('0x5'));var logger=require(_0xd397('0x6'))(_0xd397('0x7'));var config=require(_0xd397('0x8'));var jayson=require(_0xd397('0x9'));var client=jayson[_0xd397('0xa')][_0xd397('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d1b40,_0x2a0986,_0x41dcbb){return new BPromise(function(_0x4acaac,_0x1e94e1){return client['request'](_0x5d1b40,_0x41dcbb)['then'](function(_0x37c70c){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2a0986,'request\x20sent');logger[_0xd397('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2a0986,_0xd397('0xd'),JSON[_0xd397('0xe')](_0x37c70c));if(_0x37c70c[_0xd397('0xf')]){if(_0x37c70c[_0xd397('0xf')][_0xd397('0x10')]===0x1f4){logger[_0xd397('0xf')](_0xd397('0x11'),_0x2a0986,_0x37c70c[_0xd397('0xf')][_0xd397('0x12')]);return _0x1e94e1(_0x37c70c['error'][_0xd397('0x12')]);}logger[_0xd397('0xf')](_0xd397('0x11'),_0x2a0986,_0x37c70c[_0xd397('0xf')][_0xd397('0x12')]);return _0x4acaac(_0x37c70c['error']['message']);}else{logger[_0xd397('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2a0986,_0xd397('0xd'));_0x4acaac(_0x37c70c[_0xd397('0x14')]['message']);}})[_0xd397('0x15')](function(_0xdd260d){logger[_0xd397('0xf')](_0xd397('0x11'),_0x2a0986,_0xdd260d);_0x1e94e1(_0xdd260d);});});} \ No newline at end of file +var _0xb850=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','code','message','catch','moment','bluebird'];(function(_0x8c5b9f,_0xb1296b){var _0x42dcf2=function(_0x502540){while(--_0x502540){_0x8c5b9f['push'](_0x8c5b9f['shift']());}};_0x42dcf2(++_0xb1296b);}(_0xb850,0x9e));var _0x0b85=function(_0x2644dd,_0x39d79e){_0x2644dd=_0x2644dd-0x0;var _0x4dad81=_0xb850[_0x2644dd];return _0x4dad81;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b85('0x0'));var BPromise=require(_0x0b85('0x1'));var rs=require(_0x0b85('0x2'));var fs=require('fs');var Redis=require(_0x0b85('0x3'));var db=require(_0x0b85('0x4'))['db'];var utils=require(_0x0b85('0x5'));var logger=require('../../config/logger')(_0x0b85('0x6'));var config=require('../../config/environment');var jayson=require(_0x0b85('0x7'));var client=jayson[_0x0b85('0x8')][_0x0b85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47a428,_0x2fba0e,_0x3665a7){return new BPromise(function(_0xb68be5,_0x357612){return client[_0x0b85('0xa')](_0x47a428,_0x3665a7)[_0x0b85('0xb')](function(_0x11bb88){logger[_0x0b85('0xc')](_0x0b85('0xd'),_0x2fba0e,'request\x20sent');logger[_0x0b85('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2fba0e,'request\x20sent',JSON[_0x0b85('0xf')](_0x11bb88));if(_0x11bb88[_0x0b85('0x10')]){if(_0x11bb88['error'][_0x0b85('0x11')]===0x1f4){logger[_0x0b85('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fba0e,_0x11bb88[_0x0b85('0x10')][_0x0b85('0x12')]);return _0x357612(_0x11bb88['error'][_0x0b85('0x12')]);}logger[_0x0b85('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fba0e,_0x11bb88[_0x0b85('0x10')][_0x0b85('0x12')]);return _0xb68be5(_0x11bb88[_0x0b85('0x10')][_0x0b85('0x12')]);}else{logger[_0x0b85('0xc')](_0x0b85('0xd'),_0x2fba0e,'request\x20sent');_0xb68be5(_0x11bb88['result'][_0x0b85('0x12')]);}})[_0x0b85('0x13')](function(_0x1c7835){logger['error'](_0x0b85('0xd'),_0x2fba0e,_0x1c7835);_0x357612(_0x1c7835);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 176a31a..59c092b 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 _0xc005=['delete','destroy','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated','/:id','getSections','/:id/resources','create','/:id/clone','clone','/:id/sections','put','update'];(function(_0x424568,_0x5982f4){var _0x9aed1b=function(_0x206086){while(--_0x206086){_0x424568['push'](_0x424568['shift']());}};_0x9aed1b(++_0x5982f4);}(_0xc005,0x1f2));var _0x5c00=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0xc005[_0x2e655a];return _0x26f13b;};'use strict';var multer=require(_0x5c00('0x0'));var util=require(_0x5c00('0x1'));var path=require(_0x5c00('0x2'));var timeout=require(_0x5c00('0x3'));var express=require(_0x5c00('0x4'));var router=express[_0x5c00('0x5')]();var fs_extra=require(_0x5c00('0x6'));var auth=require(_0x5c00('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5c00('0x8'));var controller=require(_0x5c00('0x9'));router[_0x5c00('0xa')]('/',auth['isAuthenticated'](),controller[_0x5c00('0xb')]);router[_0x5c00('0xa')]('/describe',auth[_0x5c00('0xc')](),controller['describe']);router['get'](_0x5c00('0xd'),auth[_0x5c00('0xc')](),controller['show']);router[_0x5c00('0xa')]('/:id/sections',auth[_0x5c00('0xc')](),controller[_0x5c00('0xe')]);router[_0x5c00('0xa')](_0x5c00('0xf'),auth[_0x5c00('0xc')](),controller['getResources']);router['post']('/',auth[_0x5c00('0xc')](),controller[_0x5c00('0x10')]);router['post'](_0x5c00('0x11'),auth[_0x5c00('0xc')](),controller[_0x5c00('0x12')]);router['post'](_0x5c00('0x13'),auth[_0x5c00('0xc')](),controller['addSections']);router['post']('/:id/resources',auth[_0x5c00('0xc')](),controller['addResources']);router[_0x5c00('0x14')](_0x5c00('0xd'),auth['isAuthenticated'](),controller[_0x5c00('0x15')]);router[_0x5c00('0x16')](_0x5c00('0xd'),auth[_0x5c00('0xc')](),controller[_0x5c00('0x17')]);router[_0x5c00('0x16')](_0x5c00('0x13'),auth[_0x5c00('0xc')](),controller[_0x5c00('0x18')]);router[_0x5c00('0x16')](_0x5c00('0xf'),auth[_0x5c00('0xc')](),controller[_0x5c00('0x19')]);module['exports']=router; \ No newline at end of file +var _0x4a78=['../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x10fe7f,_0x2aa210){var _0x33f6cf=function(_0x470a4b){while(--_0x470a4b){_0x10fe7f['push'](_0x10fe7f['shift']());}};_0x33f6cf(++_0x2aa210);}(_0x4a78,0x18c));var _0x84a7=function(_0x5ab6a1,_0x4ecd56){_0x5ab6a1=_0x5ab6a1-0x0;var _0x1e9992=_0x4a78[_0x5ab6a1];return _0x1e9992;};'use strict';var multer=require(_0x84a7('0x0'));var util=require(_0x84a7('0x1'));var path=require(_0x84a7('0x2'));var timeout=require(_0x84a7('0x3'));var express=require(_0x84a7('0x4'));var router=express[_0x84a7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x84a7('0x6'));var interaction=require(_0x84a7('0x7'));var config=require(_0x84a7('0x8'));var controller=require(_0x84a7('0x9'));router[_0x84a7('0xa')]('/',auth[_0x84a7('0xb')](),controller[_0x84a7('0xc')]);router[_0x84a7('0xa')](_0x84a7('0xd'),auth[_0x84a7('0xb')](),controller[_0x84a7('0xe')]);router['get'](_0x84a7('0xf'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x10')]);router['get'](_0x84a7('0x11'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x12')]);router['get'](_0x84a7('0x13'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x14')]);router[_0x84a7('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x84a7('0x15')]('/:id/clone',auth[_0x84a7('0xb')](),controller[_0x84a7('0x16')]);router[_0x84a7('0x15')](_0x84a7('0x11'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x17')]);router[_0x84a7('0x15')](_0x84a7('0x13'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x18')]);router[_0x84a7('0x19')](_0x84a7('0xf'),auth[_0x84a7('0xb')](),controller['update']);router[_0x84a7('0x1a')](_0x84a7('0xf'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x1b')]);router[_0x84a7('0x1a')](_0x84a7('0x11'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x1c')]);router[_0x84a7('0x1a')](_0x84a7('0x13'),auth[_0x84a7('0xb')](),controller[_0x84a7('0x1d')]);module[_0x84a7('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a6edabd..4a582d0 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 _0xa4ec=['join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x100b37,_0x57fc07){var _0x1afe08=function(_0x477fc3){while(--_0x477fc3){_0x100b37['push'](_0x100b37['shift']());}};_0x1afe08(++_0x57fc07);}(_0xa4ec,0x16d));var _0xca4e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa4ec[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0xca4e('0x0'));module[_0xca4e('0x1')]={'name':{'type':Sequelize[_0xca4e('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xca4e('0x2')],'set':function(_0x56761e){this[_0xca4e('0x3')]('crudPermissions',_0x56761e?_0x56761e[_0xca4e('0x4')](''):[]);},'get':function(){return this[_0xca4e('0x5')](_0xca4e('0x6'))?this[_0xca4e('0x5')]('crudPermissions')[_0xca4e('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xca4e('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xca4e('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x63a8=['name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x1c5b34,_0x4c97dc){var _0x3510fd=function(_0x3bc604){while(--_0x3bc604){_0x1c5b34['push'](_0x1c5b34['shift']());}};_0x3510fd(++_0x4c97dc);}(_0x63a8,0x1a6));var _0x863a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x63a8[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x863a('0x0'));module['exports']={'name':{'type':Sequelize[_0x863a('0x1')],'allowNull':![],'unique':_0x863a('0x2')},'crudPermissions':{'type':Sequelize[_0x863a('0x1')],'set':function(_0x53daac){this[_0x863a('0x3')](_0x863a('0x4'),_0x53daac?_0x53daac['join'](''):[]);},'get':function(){return this['getDataValue'](_0x863a('0x4'))?this[_0x863a('0x5')]('crudPermissions')[_0x863a('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x863a('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x863a('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x863a('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x863a('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 a00069a..baaab6f 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 _0xba98=['./userProfile.socket','register','sendStatus','end','status','json','offset','count','Content-Range','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','VIRTUAL','filter','options','where','include','catch','params','includeAll','find','create','body','clone','get','omit','crudPermissions','createdAt','updatedAt','transaction','UserProfileSection','findAll','each','autoAssociation','sectionId','Resources','UserProfileResource','destroy','describe','addSections','sequelize','userProfileId','push','ids','getSections','includes','subsections','enabled','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','defaults','redis','localhost','socket.io-emitter'];(function(_0x48f011,_0x4f4a87){var _0x47824e=function(_0x1a6233){while(--_0x1a6233){_0x48f011['push'](_0x48f011['shift']());}};_0x47824e(++_0x4f4a87);}(_0xba98,0x129));var _0x8ba9=function(_0x4cc4b8,_0x794133){_0x4cc4b8=_0x4cc4b8-0x0;var _0x4d6852=_0xba98[_0x4cc4b8];return _0x4d6852;};'use strict';var emlformat=require(_0x8ba9('0x0'));var rimraf=require(_0x8ba9('0x1'));var zipdir=require(_0x8ba9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ba9('0x3'));var moment=require('moment');var BPromise=require(_0x8ba9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8ba9('0x5'));var sox=require(_0x8ba9('0x6'));var csv=require(_0x8ba9('0x7'));var ejs=require(_0x8ba9('0x8'));var fs=require('fs');var fs_extra=require(_0x8ba9('0x9'));var _=require(_0x8ba9('0xa'));var squel=require('squel');var crypto=require(_0x8ba9('0xb'));var jsforce=require(_0x8ba9('0xc'));var deskjs=require(_0x8ba9('0xd'));var toCsv=require(_0x8ba9('0x7'));var querystring=require(_0x8ba9('0xe'));var Papa=require(_0x8ba9('0xf'));var Redis=require(_0x8ba9('0x10'));var authService=require(_0x8ba9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8ba9('0x12'));var hardwareService=require(_0x8ba9('0x13'));var logger=require(_0x8ba9('0x14'))(_0x8ba9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8ba9('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8ba9('0x17')](config[_0x8ba9('0x18')],{'host':_0x8ba9('0x19'),'port':0x18eb});var socket=require(_0x8ba9('0x1a'))(new Redis(config['redis']));require(_0x8ba9('0x1b'))[_0x8ba9('0x1c')](socket);function respondWithStatusCode(_0x17932b,_0x5edec6){_0x5edec6=_0x5edec6||0xcc;return function(_0x16abb9){if(_0x16abb9){return _0x17932b[_0x8ba9('0x1d')](_0x5edec6);}return _0x17932b['status'](_0x5edec6)[_0x8ba9('0x1e')]();};}function respondWithResult(_0xf86f92,_0x332961){_0x332961=_0x332961||0xc8;return function(_0x30405a){if(_0x30405a){return _0xf86f92[_0x8ba9('0x1f')](_0x332961)[_0x8ba9('0x20')](_0x30405a);}};}function respondWithFilteredResult(_0x1bbd39,_0x47ed29){return function(_0x4df433){if(_0x4df433){var _0x56df14=typeof _0x47ed29[_0x8ba9('0x21')]==='undefined'&&typeof _0x47ed29['limit']==='undefined';var _0x1c9eb9=_0x4df433[_0x8ba9('0x22')];var _0x408ce9=_0x56df14?0x0:_0x47ed29[_0x8ba9('0x21')];var _0x40c43a=_0x56df14?_0x4df433[_0x8ba9('0x22')]:_0x47ed29[_0x8ba9('0x21')]+_0x47ed29['limit'];var _0x58e3e7;if(_0x40c43a>=_0x1c9eb9){_0x40c43a=_0x1c9eb9;_0x58e3e7=0xc8;}else{_0x58e3e7=0xce;}_0x1bbd39[_0x8ba9('0x1f')](_0x58e3e7);return _0x1bbd39['set'](_0x8ba9('0x23'),_0x408ce9+'-'+_0x40c43a+'/'+_0x1c9eb9)[_0x8ba9('0x20')](_0x4df433);}return null;};}function patchUpdates(_0x31f7ff){return function(_0x1b3f98){try{jsonpatch['apply'](_0x1b3f98,_0x31f7ff,!![]);}catch(_0x2192a9){return BPromise['reject'](_0x2192a9);}return _0x1b3f98['save']();};}function saveUpdates(_0x1c8d4c,_0x49ff87){return function(_0x201aa9){if(_0x201aa9){return _0x201aa9[_0x8ba9('0x24')](_0x1c8d4c)[_0x8ba9('0x25')](function(_0x46c638){return _0x46c638;});}return null;};}function removeEntity(_0xbfb016,_0x17ce5e){return function(_0x161456){if(_0x161456){return _0x161456['destroy']()[_0x8ba9('0x25')](function(){_0xbfb016[_0x8ba9('0x1f')](0xcc)[_0x8ba9('0x1e')]();});}};}function handleEntityNotFound(_0x2f5999,_0x3a6071){return function(_0x54a203){if(!_0x54a203){_0x2f5999['sendStatus'](0x194);}return _0x54a203;};}function handleError(_0x37a900,_0x3f58dc){_0x3f58dc=_0x3f58dc||0x1f4;return function(_0x1597b8){logger[_0x8ba9('0x26')](_0x1597b8[_0x8ba9('0x27')]);if(_0x1597b8['name']){delete _0x1597b8[_0x8ba9('0x28')];}_0x37a900[_0x8ba9('0x1f')](_0x3f58dc)[_0x8ba9('0x29')](_0x1597b8);};}exports[_0x8ba9('0x2a')]=function(_0x2e0303,_0x457be8){var _0x28c8d4={},_0x4f2545={},_0x28a56c={'count':0x0,'rows':[]};var _0x2eec7c=_[_0x8ba9('0x2b')](db[_0x8ba9('0x2c')][_0x8ba9('0x2d')],function(_0x4a7766){return{'name':_0x4a7766[_0x8ba9('0x2e')],'type':_0x4a7766[_0x8ba9('0x2f')][_0x8ba9('0x30')]};});_0x4f2545[_0x8ba9('0x31')]=_['map'](_0x2eec7c,_0x8ba9('0x28'));_0x4f2545['query']=_[_0x8ba9('0x32')](_0x2e0303[_0x8ba9('0x33')]);_0x4f2545[_0x8ba9('0x34')]=_[_0x8ba9('0x35')](_0x4f2545[_0x8ba9('0x31')],_0x4f2545[_0x8ba9('0x33')]);_0x28c8d4['attributes']=_[_0x8ba9('0x35')](_0x4f2545[_0x8ba9('0x31')],qs[_0x8ba9('0x36')](_0x2e0303[_0x8ba9('0x33')]['fields']));_0x28c8d4[_0x8ba9('0x37')]=_0x28c8d4[_0x8ba9('0x37')][_0x8ba9('0x38')]?_0x28c8d4[_0x8ba9('0x37')]:_0x4f2545['model'];if(!_0x2e0303[_0x8ba9('0x33')][_0x8ba9('0x39')](_0x8ba9('0x3a'))){_0x28c8d4[_0x8ba9('0x3b')]=qs[_0x8ba9('0x3b')](_0x2e0303[_0x8ba9('0x33')][_0x8ba9('0x3b')]);_0x28c8d4[_0x8ba9('0x21')]=qs['offset'](_0x2e0303[_0x8ba9('0x33')]['offset']);}_0x28c8d4[_0x8ba9('0x3c')]=qs['sort'](_0x2e0303[_0x8ba9('0x33')][_0x8ba9('0x3d')]);_0x28c8d4['where']=qs['filters'](_[_0x8ba9('0x3e')](_0x2e0303[_0x8ba9('0x33')],_0x4f2545['filters']),_0x2eec7c);if(_0x2e0303[_0x8ba9('0x33')]['filter']){_0x28c8d4['where']=_[_0x8ba9('0x3f')](_0x28c8d4['where'],{'$or':_[_0x8ba9('0x2b')](_0x2eec7c,function(_0x11b363){if(_0x11b363['type']!==_0x8ba9('0x40')){var _0x196efb={};_0x196efb[_0x11b363[_0x8ba9('0x28')]]={'$like':'%'+_0x2e0303[_0x8ba9('0x33')][_0x8ba9('0x41')]+'%'};return _0x196efb;}})});}_0x28c8d4=_[_0x8ba9('0x3f')]({},_0x28c8d4,_0x2e0303[_0x8ba9('0x42')]);var _0x3e1980={'where':_0x28c8d4[_0x8ba9('0x43')]};return db[_0x8ba9('0x2c')][_0x8ba9('0x22')](_0x3e1980)['then'](function(_0x3dad8e){_0x28a56c['count']=_0x3dad8e;if(_0x2e0303[_0x8ba9('0x33')]['includeAll']){_0x28c8d4[_0x8ba9('0x44')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x28c8d4);})[_0x8ba9('0x25')](function(_0x530bab){_0x28a56c['rows']=_0x530bab;return _0x28a56c;})[_0x8ba9('0x25')](respondWithFilteredResult(_0x457be8,_0x28c8d4))[_0x8ba9('0x45')](handleError(_0x457be8,null));};exports['show']=function(_0x522b23,_0x58c7f6){var _0x2c9c9f={'raw':![],'where':{'id':_0x522b23[_0x8ba9('0x46')]['id']}},_0x46bcfb={};_0x46bcfb[_0x8ba9('0x31')]=_[_0x8ba9('0x32')](db[_0x8ba9('0x2c')][_0x8ba9('0x2d')]);_0x46bcfb[_0x8ba9('0x33')]=_[_0x8ba9('0x32')](_0x522b23[_0x8ba9('0x33')]);_0x46bcfb[_0x8ba9('0x34')]=_[_0x8ba9('0x35')](_0x46bcfb[_0x8ba9('0x31')],_0x46bcfb[_0x8ba9('0x33')]);_0x2c9c9f[_0x8ba9('0x37')]=_[_0x8ba9('0x35')](_0x46bcfb[_0x8ba9('0x31')],qs[_0x8ba9('0x36')](_0x522b23[_0x8ba9('0x33')][_0x8ba9('0x36')]));_0x2c9c9f['attributes']=_0x2c9c9f[_0x8ba9('0x37')]['length']?_0x2c9c9f[_0x8ba9('0x37')]:_0x46bcfb[_0x8ba9('0x31')];if(_0x522b23[_0x8ba9('0x33')][_0x8ba9('0x47')]){_0x2c9c9f[_0x8ba9('0x44')]=[{'all':!![]}];}_0x2c9c9f=_[_0x8ba9('0x3f')]({},_0x2c9c9f,_0x522b23['options']);return db['UserProfile'][_0x8ba9('0x48')](_0x2c9c9f)[_0x8ba9('0x25')](handleEntityNotFound(_0x58c7f6,null))[_0x8ba9('0x25')](respondWithResult(_0x58c7f6,null))[_0x8ba9('0x45')](handleError(_0x58c7f6,null));};exports[_0x8ba9('0x49')]=function(_0x2e642e,_0x264380){return db[_0x8ba9('0x2c')][_0x8ba9('0x49')](_0x2e642e[_0x8ba9('0x4a')],{})[_0x8ba9('0x25')](respondWithResult(_0x264380,0xc9))[_0x8ba9('0x45')](handleError(_0x264380,null));};exports[_0x8ba9('0x4b')]=function(_0x22a2db,_0x5b9442){var _0x3b263b={'where':{'id':_0x22a2db[_0x8ba9('0x46')]['id']}},_0x14d1da={};_0x14d1da[_0x8ba9('0x31')]=_['keys'](db['UserProfile'][_0x8ba9('0x2d')]);_0x3b263b['attributes']=_[_0x8ba9('0x35')](_0x14d1da[_0x8ba9('0x31')],qs[_0x8ba9('0x36')](_0x22a2db['query'][_0x8ba9('0x36')]));_0x3b263b['attributes']=_0x3b263b[_0x8ba9('0x37')]['length']?_0x3b263b[_0x8ba9('0x37')]:_0x14d1da[_0x8ba9('0x31')];if(_0x22a2db[_0x8ba9('0x33')]['includeAll']){_0x3b263b[_0x8ba9('0x44')]=[{'all':!![]}];}_0x3b263b=_[_0x8ba9('0x3f')]({},_0x3b263b,_0x22a2db[_0x8ba9('0x42')]);return db[_0x8ba9('0x2c')][_0x8ba9('0x48')](_0x3b263b)['then'](handleEntityNotFound(_0x5b9442,null))[_0x8ba9('0x25')](function(_0x318630){if(_0x318630){var _0x247e22=_0x318630[_0x8ba9('0x4c')]({'plain':!![]});_0x247e22=qs[_0x8ba9('0x4d')](_0x247e22,['id','createdAt','updatedAt',_0x8ba9('0x4e')]);_0x22a2db[_0x8ba9('0x4a')]=_['omit'](_0x22a2db[_0x8ba9('0x4a')],['id',_0x8ba9('0x4f'),_0x8ba9('0x50')]);return db['sequelize'][_0x8ba9('0x51')](function(_0x404619){return db['UserProfile'][_0x8ba9('0x49')](_[_0x8ba9('0x3f')](_0x247e22,_0x22a2db[_0x8ba9('0x4a')]),{'include':_0x22a2db[_0x8ba9('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x404619})['then'](function(_0x56f251){var _0x177fc3=_0x56f251[_0x8ba9('0x4c')]({'plain':!![]});return db[_0x8ba9('0x52')][_0x8ba9('0x53')]({'where':{'userProfileId':_0x22a2db[_0x8ba9('0x46')]['id']},'raw':!![]})[_0x8ba9('0x25')](function(_0x323a16){if(_0x323a16){return BPromise[_0x8ba9('0x54')](_0x323a16,function(_0x136401){return new BPromise(function(_0x26a125,_0x13fb4f){if(_0x136401[_0x8ba9('0x55')]===null||_0x136401['autoAssociation']===0x1)_0x26a125(null);return db['UserProfileResource'][_0x8ba9('0x53')]({'where':{'sectionId':_0x136401['id']},'raw':!![]})['then'](function(_0x2d64d4){var _0x38d3de=_[_0x8ba9('0x2b')](_0x2d64d4,function(_0x4d5b1b){return qs[_0x8ba9('0x4d')](_0x4d5b1b,['id','createdAt','updatedAt',_0x8ba9('0x56')]);});_0x26a125(_0x38d3de);})[_0x8ba9('0x45')](function(_0x727a79){_0x13fb4f(_0x727a79);});})['then'](function(_0x29ab23){var _0x262ee9=qs[_0x8ba9('0x4d')](_0x136401,['id',_0x8ba9('0x4f'),_0x8ba9('0x50')]);_0x262ee9['userProfileId']=_0x177fc3['id'];if(_0x29ab23)_0x262ee9[_0x8ba9('0x57')]=_0x29ab23;return _0x262ee9;})['then'](function(_0xff538d){return db['UserProfileSection'][_0x8ba9('0x49')](_0xff538d,{'include':[{'model':db[_0x8ba9('0x58')],'as':_0x8ba9('0x57')}],'raw':!![],'transaction':_0x404619});});})[_0x8ba9('0x25')](function(){return _0x177fc3;});}});});});}})['then'](respondWithResult(_0x5b9442,0xc9))[_0x8ba9('0x45')](handleError(_0x5b9442,null));};exports[_0x8ba9('0x24')]=function(_0x109209,_0x10bcd7){if(_0x109209[_0x8ba9('0x4a')]['id']){delete _0x109209[_0x8ba9('0x4a')]['id'];}return db[_0x8ba9('0x2c')][_0x8ba9('0x48')]({'where':{'id':_0x109209[_0x8ba9('0x46')]['id']}})[_0x8ba9('0x25')](handleEntityNotFound(_0x10bcd7,null))[_0x8ba9('0x25')](saveUpdates(_0x109209[_0x8ba9('0x4a')],null))[_0x8ba9('0x25')](respondWithResult(_0x10bcd7,null))[_0x8ba9('0x45')](handleError(_0x10bcd7,null));};exports[_0x8ba9('0x59')]=function(_0x3ebad9,_0x5036d0){return db[_0x8ba9('0x2c')][_0x8ba9('0x48')]({'where':{'id':_0x3ebad9[_0x8ba9('0x46')]['id']}})[_0x8ba9('0x25')](handleEntityNotFound(_0x5036d0,null))['then'](removeEntity(_0x5036d0,null))[_0x8ba9('0x45')](handleError(_0x5036d0,null));};exports['describe']=function(_0x5e2f78,_0x496b5c){return db[_0x8ba9('0x2c')][_0x8ba9('0x5a')]()[_0x8ba9('0x25')](respondWithResult(_0x496b5c,null))['catch'](handleError(_0x496b5c,null));};exports[_0x8ba9('0x5b')]=function(_0x328c54,_0x25525c){var _0x1dc1d9=_0x328c54[_0x8ba9('0x4a')];return db[_0x8ba9('0x2c')]['find']({'where':{'id':_0x328c54[_0x8ba9('0x46')]['id']}})['then'](handleEntityNotFound(_0x25525c,null))[_0x8ba9('0x25')](function(_0x766ad5){if(_0x766ad5){return db[_0x8ba9('0x5c')][_0x8ba9('0x51')](function(_0x5da43d){return db['UserProfileSection'][_0x8ba9('0x59')]({'where':{'userProfileId':_0x328c54['params']['id'],'sectionId':_[_0x8ba9('0x2b')](_0x1dc1d9,function(_0x101412){return _0x101412[_0x8ba9('0x56')];})},'transaction':_0x5da43d})[_0x8ba9('0x25')](function(){var _0xeff73b=_['map'](_0x1dc1d9,function(_0x52caf3){_0x52caf3[_0x8ba9('0x5d')]=_0x328c54[_0x8ba9('0x46')]['id'];return _0x52caf3;});var _0x46fab1=[];return BPromise[_0x8ba9('0x54')](_0xeff73b,function(_0x2be2e6){return db[_0x8ba9('0x52')][_0x8ba9('0x49')](_0x2be2e6,{'include':[{'model':db[_0x8ba9('0x58')],'as':_0x8ba9('0x57')}],'raw':!![],'transaction':_0x5da43d})[_0x8ba9('0x25')](function(_0x5083dd){_0x46fab1[_0x8ba9('0x5e')](_0x5083dd[_0x8ba9('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x46fab1;});});});}})['then'](function(_0x1a349e){return _0x1a349e;})[_0x8ba9('0x25')](respondWithResult(_0x25525c,null))[_0x8ba9('0x45')](handleError(_0x25525c,null));};exports['removeSections']=function(_0x30fc6c,_0x1fa014){var _0xd7e9d7;return db['UserProfile']['find']({'where':{'id':_0x30fc6c[_0x8ba9('0x46')]['id']},'attributes':['id',_0x8ba9('0x28')]})[_0x8ba9('0x25')](handleEntityNotFound(_0x1fa014,null))[_0x8ba9('0x25')](function(_0x372662){if(_0x372662){_0xd7e9d7=_0x372662;return db[_0x8ba9('0x52')][_0x8ba9('0x59')]({'where':{'userProfileId':_0x30fc6c['params']['id'],'sectionId':_0x30fc6c[_0x8ba9('0x33')][_0x8ba9('0x5f')]}});}})[_0x8ba9('0x25')](function(){return _0xd7e9d7;})[_0x8ba9('0x25')](respondWithStatusCode(_0x1fa014,null))[_0x8ba9('0x45')](handleError(_0x1fa014,null));};exports[_0x8ba9('0x60')]=function(_0xa72a1f,_0x3c9963){var _0x5cea00=[];var _0x196d32=[];return db['UserProfileSection'][_0x8ba9('0x53')]({'where':{'userProfileId':_0xa72a1f['params']['id']},'raw':!![]})['then'](function(_0x8fbdb1){_0x5cea00=_[_0x8ba9('0x41')](_0x8fbdb1,function(_0x1a7cbb){return _0x1a7cbb['enabled']===0x1||_[_0x8ba9('0x61')]([0x3eb,0x709],_0x1a7cbb['sectionId']);});if(!_['isEmpty'](_0x5cea00)){return _[_0x8ba9('0x2b')](_0x5cea00,function(_0x4d5a3d){return _0x4d5a3d[_0x8ba9('0x56')];});}else{return;}})[_0x8ba9('0x25')](function(_0x59fcf4){if(_0x59fcf4)_0x196d32=_0x59fcf4;if(_['includes'](_0x196d32,0x64)){var _0x320af1=_[_0x8ba9('0x48')](_0x5cea00,{'sectionId':0x64});return hasDefaultDashboard(_0x320af1)[_0x8ba9('0x25')](function(_0x487cb6){return _[_0x8ba9('0x2b')](_0x5cea00,function(_0x517df2){if(_0x517df2[_0x8ba9('0x56')]===0x64){_0x517df2[_0x8ba9('0x62')]=_0x487cb6;}return _0x517df2;});});}else{return;}})[_0x8ba9('0x25')](function(_0x17a558){if(_0x17a558)_0x5cea00=_0x17a558;if(_[_0x8ba9('0x61')](_0x196d32,0x3eb)){var _0x58f90f=_[_0x8ba9('0x48')](_0x5cea00,{'sectionId':0x3eb});return getCustomDashboards(_0x58f90f)[_0x8ba9('0x25')](function(_0xee26e8){return _[_0x8ba9('0x2b')](_0x5cea00,function(_0x4f83cf){if(_0x58f90f[_0x8ba9('0x63')]){if(_0x4f83cf['sectionId']===0x3eb){_0x4f83cf[_0x8ba9('0x62')]=_0xee26e8;}}else{if(_0x4f83cf[_0x8ba9('0x56')]===0x64){if(!_0x4f83cf['subsections']){_0x4f83cf[_0x8ba9('0x62')]=[];}_0x4f83cf[_0x8ba9('0x62')]=_0x4f83cf[_0x8ba9('0x62')]['concat'](_0xee26e8);}}return _0x4f83cf;});});}else{return;}})[_0x8ba9('0x25')](function(_0x5ad1d2){if(_0x5ad1d2)_0x5cea00=_0x5ad1d2;if(_[_0x8ba9('0x61')](_0x196d32,0x709)){var _0x2066d0=_['find'](_0x5cea00,{'sectionId':0x709});return getPlugins(_0x2066d0)[_0x8ba9('0x25')](function(_0x1ee67f){if(_0x2066d0['enabled']){return _[_0x8ba9('0x2b')](_0x5cea00,function(_0x4f5668){if(_0x4f5668['sectionId']===0x709){_0x4f5668['subsections']=_0x1ee67f;}return _0x4f5668;});}else{var _0x250043={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1ee67f};var _0x4fa55e=_['map'](_0x5cea00);_0x4fa55e['push'](_0x250043);return _0x4fa55e;}});}else{return;}})[_0x8ba9('0x25')](function(_0x2ca055){if(_0x2ca055)_0x5cea00=_0x2ca055;return _['filter'](_0x5cea00,['enabled',0x1]);})[_0x8ba9('0x25')](respondWithResult(_0x3c9963,null))[_0x8ba9('0x45')](handleError(_0x3c9963,null));};function hasDefaultDashboard(_0x2cd8fd){var _0x141545=[0x65];return new BPromise(function(_0x4779b2,_0x4cde37){try{if(_0x2cd8fd[_0x8ba9('0x55')]){_0x4779b2(_0x141545);}else{return db[_0x8ba9('0x58')]['findOne']({'where':{'sectionId':_0x2cd8fd['id']},'raw':!![]})[_0x8ba9('0x25')](function(_0x49b3b7){_0x49b3b7?_0x4779b2(_0x141545):_0x4779b2();});}}catch(_0x9d344e){_0x4cde37(_0x9d344e);}});}function getCustomDashboards(_0x46706f){var _0x514b5a=[];return new BPromise(function(_0x283ff8,_0xf92a10){try{if(_0x46706f['autoAssociation']){return db['Dashboard'][_0x8ba9('0x53')]({'raw':!![]})[_0x8ba9('0x25')](function(_0xbf9d29){_0xbf9d29[_0x8ba9('0x64')](function(_0x11a2eb){_0x514b5a['push'](_0x11a2eb['id']+0x1869f);});_0x283ff8(_0x514b5a);});}else{return db[_0x8ba9('0x58')][_0x8ba9('0x53')]({'where':{'sectionId':_0x46706f['id']},'raw':!![]})['then'](function(_0x3818d3){_0x3818d3['forEach'](function(_0x5625ec){_0x514b5a['push'](_0x5625ec[_0x8ba9('0x65')]+0x1869f);});_0x283ff8(_0x514b5a);});}}catch(_0x581d7c){_0xf92a10(_0x581d7c);}});}function getPlugins(_0x5cc8c1){var _0x56c60c=[];return new BPromise(function(_0x560a0b,_0xdbd057){try{if(_0x5cc8c1[_0x8ba9('0x55')]){return db[_0x8ba9('0x66')][_0x8ba9('0x53')]({'raw':!![]})[_0x8ba9('0x25')](function(_0x5bf124){_0x5bf124['forEach'](function(_0x2e223e){_0x56c60c[_0x8ba9('0x5e')](_0x2e223e['id']+0x15b38);});_0x560a0b(_0x56c60c);});}else{return db[_0x8ba9('0x58')][_0x8ba9('0x53')]({'where':{'sectionId':_0x5cc8c1['id']},'raw':!![]})['then'](function(_0x1f9802){_0x1f9802[_0x8ba9('0x64')](function(_0x57517a){_0x56c60c['push'](_0x57517a[_0x8ba9('0x65')]+0x15b38);});_0x560a0b(_0x56c60c);});}}catch(_0x4a3c9a){_0xdbd057(_0x4a3c9a);}});}exports[_0x8ba9('0x67')]=function(_0x31174e,_0x5ad706){return db[_0x8ba9('0x2c')][_0x8ba9('0x48')]({'where':{'id':_0x31174e['params']['id']}})[_0x8ba9('0x25')](handleEntityNotFound(_0x5ad706,null))[_0x8ba9('0x25')](function(_0x270652){if(_0x270652){return db[_0x8ba9('0x5c')][_0x8ba9('0x51')](function(_0x1a6d9a){return db[_0x8ba9('0x52')][_0x8ba9('0x53')]({'where':{'userProfileId':_0x31174e['params']['id']},'attributes':['id'],'raw':!![]})[_0x8ba9('0x25')](function(_0x5529b2){if(_0x5529b2){return db[_0x8ba9('0x52')][_0x8ba9('0x59')]({'where':{'userProfileId':_0x31174e[_0x8ba9('0x46')]['id'],'id':_[_0x8ba9('0x2b')](_0x5529b2,function(_0x3691db){return _0x3691db['id'];})},'transaction':_0x1a6d9a});}})[_0x8ba9('0x25')](function(_0x2ba884){var _0x234a2d=_['map'](_0x31174e[_0x8ba9('0x4a')],function(_0x1283e3){_0x1283e3[_0x8ba9('0x5d')]=_0x31174e[_0x8ba9('0x46')]['id'];return _0x1283e3;});return db[_0x8ba9('0x52')][_0x8ba9('0x68')](_0x234a2d,{'raw':!![],'transaction':_0x1a6d9a});})[_0x8ba9('0x25')](function(_0x2b0cad){var _0x7d05b9=_[_0x8ba9('0x41')](_['map'](_0x2b0cad,function(_0x471e87){return _0x471e87['get']({'plain':!![]});}),{'includeAll':![]});if(_0x7d05b9){return db[_0x8ba9('0x52')][_0x8ba9('0x53')]({'where':{'userProfileId':_0x31174e[_0x8ba9('0x46')]['id'],'sectionId':_['map'](_0x7d05b9,function(_0x3a087d){return _0x3a087d[_0x8ba9('0x56')];})},'attributes':['id',_0x8ba9('0x56')],'raw':!![]})[_0x8ba9('0x25')](function(_0x503406){var _0x228bcc=_['map'](_0x31174e['body'],function(_0x477ab2){_0x477ab2[_0x8ba9('0x5d')]=_0x31174e[_0x8ba9('0x46')]['id'];return _0x477ab2;});return db[_0x8ba9('0x58')][_0x8ba9('0x68')](_0x228bcc,{'raw':!![],'transaction':_0x1a6d9a});});}})[_0x8ba9('0x45')](handleError(_0x5ad706,null));});}})['then'](function(_0x49d338){var _0x50fa1c=_[_0x8ba9('0x2b')](_0x49d338,function(_0x330745){return _0x330745[_0x8ba9('0x4c')]({'plain':!![]});});})[_0x8ba9('0x25')](respondWithResult(_0x5ad706,null))[_0x8ba9('0x45')](handleError(_0x5ad706,null));};exports[_0x8ba9('0x69')]=function(_0x1fdd12,_0x171f55,_0x986689){return db['UserProfile'][_0x8ba9('0x48')]({'where':{'id':_0x1fdd12[_0x8ba9('0x46')]['id']}})[_0x8ba9('0x25')](handleEntityNotFound(_0x171f55,null))[_0x8ba9('0x25')](function(_0x442b8c){if(_0x442b8c){return _0x442b8c[_0x8ba9('0x69')](_0x1fdd12[_0x8ba9('0x33')]['ids']);}})[_0x8ba9('0x25')](respondWithStatusCode(_0x171f55,null))['catch'](handleError(_0x171f55,null));};exports[_0x8ba9('0x6a')]=function(_0xfb125d,_0x3bf92b){var _0x2aa8f2={};if(!_0xfb125d[_0x8ba9('0x33')]['section'])throw new Error(_0x8ba9('0x6b'));if(!_0xfb125d[_0x8ba9('0x33')]['hasOwnProperty'](_0x8ba9('0x3a'))){_0x2aa8f2[_0x8ba9('0x3b')]=qs[_0x8ba9('0x3b')](_0xfb125d[_0x8ba9('0x33')][_0x8ba9('0x3b')]);_0x2aa8f2['offset']=qs['offset'](_0xfb125d[_0x8ba9('0x33')][_0x8ba9('0x21')]);}return db['UserProfile'][_0x8ba9('0x48')]({'where':{'id':_0xfb125d[_0x8ba9('0x46')]['id']}})[_0x8ba9('0x25')](function(_0x54085f){if(!_0x54085f)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0xfb125d[_0x8ba9('0x46')]['id']);return db[_0x8ba9('0x2c')]['getResources'](_0xfb125d);})[_0x8ba9('0x25')](respondWithFilteredResult(_0x3bf92b,_0x2aa8f2))[_0x8ba9('0x45')](handleError(_0x3bf92b,null));}; \ No newline at end of file +var _0x9bb7=['bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','params','fields','get','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','omit','userProfileId','Resources','update','describe','push','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources'];(function(_0x10aafa,_0x4663e9){var _0x2e0cc6=function(_0x4f39c7){while(--_0x4f39c7){_0x10aafa['push'](_0x10aafa['shift']());}};_0x2e0cc6(++_0x4663e9);}(_0x9bb7,0x70));var _0x79bb=function(_0x4b13f0,_0x1273df){_0x4b13f0=_0x4b13f0-0x0;var _0x2a1955=_0x9bb7[_0x4b13f0];return _0x2a1955;};'use strict';var emlformat=require(_0x79bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79bb('0x1'));var jsonpatch=require(_0x79bb('0x2'));var rp=require(_0x79bb('0x3'));var moment=require(_0x79bb('0x4'));var BPromise=require(_0x79bb('0x5'));var Mustache=require('mustache');var util=require(_0x79bb('0x6'));var path=require(_0x79bb('0x7'));var sox=require(_0x79bb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79bb('0x9'));var _=require(_0x79bb('0xa'));var squel=require(_0x79bb('0xb'));var crypto=require('crypto');var jsforce=require(_0x79bb('0xc'));var deskjs=require(_0x79bb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x79bb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x79bb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x79bb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x79bb('0x11'));var utils=require('../../config/utils');var config=require(_0x79bb('0x12'));var licenseUtil=require(_0x79bb('0x13'));var db=require(_0x79bb('0x14'))['db'];config[_0x79bb('0x15')]=_['defaults'](config['redis'],{'host':_0x79bb('0x16'),'port':0x18eb});var socket=require(_0x79bb('0x17'))(new Redis(config['redis']));require(_0x79bb('0x18'))[_0x79bb('0x19')](socket);function respondWithStatusCode(_0x270286,_0x35e2aa){_0x35e2aa=_0x35e2aa||0xcc;return function(_0x28a6cc){if(_0x28a6cc){return _0x270286[_0x79bb('0x1a')](_0x35e2aa);}return _0x270286[_0x79bb('0x1b')](_0x35e2aa)[_0x79bb('0x1c')]();};}function respondWithResult(_0x366597,_0x38a535){_0x38a535=_0x38a535||0xc8;return function(_0x5c7926){if(_0x5c7926){return _0x366597['status'](_0x38a535)['json'](_0x5c7926);}};}function respondWithFilteredResult(_0xdbf398,_0x16500e){return function(_0x3e89c0){if(_0x3e89c0){var _0x21b56f=typeof _0x16500e[_0x79bb('0x1d')]===_0x79bb('0x1e')&&typeof _0x16500e[_0x79bb('0x1f')]==='undefined';var _0x231404=_0x3e89c0[_0x79bb('0x20')];var _0xf72bd4=_0x21b56f?0x0:_0x16500e[_0x79bb('0x1d')];var _0x42dd15=_0x21b56f?_0x3e89c0[_0x79bb('0x20')]:_0x16500e['offset']+_0x16500e[_0x79bb('0x1f')];var _0x4e5ce1;if(_0x42dd15>=_0x231404){_0x42dd15=_0x231404;_0x4e5ce1=0xc8;}else{_0x4e5ce1=0xce;}_0xdbf398['status'](_0x4e5ce1);return _0xdbf398[_0x79bb('0x21')](_0x79bb('0x22'),_0xf72bd4+'-'+_0x42dd15+'/'+_0x231404)['json'](_0x3e89c0);}return null;};}function patchUpdates(_0x136e37){return function(_0x96f24c){try{jsonpatch[_0x79bb('0x23')](_0x96f24c,_0x136e37,!![]);}catch(_0x56fe2b){return BPromise[_0x79bb('0x24')](_0x56fe2b);}return _0x96f24c['save']();};}function saveUpdates(_0x2e287b,_0x3fc3fc){return function(_0x84ed4b){if(_0x84ed4b){return _0x84ed4b['update'](_0x2e287b)[_0x79bb('0x25')](function(_0x2f7d17){return _0x2f7d17;});}return null;};}function removeEntity(_0x47af95,_0xe6ea0c){return function(_0x5923e2){if(_0x5923e2){return _0x5923e2[_0x79bb('0x26')]()[_0x79bb('0x25')](function(){_0x47af95['status'](0xcc)[_0x79bb('0x1c')]();});}};}function handleEntityNotFound(_0x339bf6,_0x13f4a4){return function(_0x2c204b){if(!_0x2c204b){_0x339bf6['sendStatus'](0x194);}return _0x2c204b;};}function handleError(_0x5d8b8a,_0x26ec76){_0x26ec76=_0x26ec76||0x1f4;return function(_0x16c3a4){logger[_0x79bb('0x27')](_0x16c3a4[_0x79bb('0x28')]);if(_0x16c3a4[_0x79bb('0x29')]){delete _0x16c3a4[_0x79bb('0x29')];}_0x5d8b8a[_0x79bb('0x1b')](_0x26ec76)[_0x79bb('0x2a')](_0x16c3a4);};}exports[_0x79bb('0x2b')]=function(_0x2f5610,_0x4577c6){var _0xe2a411={},_0x4be1a0={},_0x5e0910={'count':0x0,'rows':[]};var _0x137cfd=_[_0x79bb('0x2c')](db[_0x79bb('0x2d')]['rawAttributes'],function(_0x1a4aa7){return{'name':_0x1a4aa7[_0x79bb('0x2e')],'type':_0x1a4aa7[_0x79bb('0x2f')][_0x79bb('0x30')]};});_0x4be1a0[_0x79bb('0x31')]=_[_0x79bb('0x2c')](_0x137cfd,'name');_0x4be1a0[_0x79bb('0x32')]=_[_0x79bb('0x33')](_0x2f5610[_0x79bb('0x32')]);_0x4be1a0[_0x79bb('0x34')]=_['intersection'](_0x4be1a0[_0x79bb('0x31')],_0x4be1a0[_0x79bb('0x32')]);_0xe2a411[_0x79bb('0x35')]=_[_0x79bb('0x36')](_0x4be1a0['model'],qs['fields'](_0x2f5610[_0x79bb('0x32')]['fields']));_0xe2a411['attributes']=_0xe2a411['attributes'][_0x79bb('0x37')]?_0xe2a411[_0x79bb('0x35')]:_0x4be1a0[_0x79bb('0x31')];if(!_0x2f5610[_0x79bb('0x32')][_0x79bb('0x38')](_0x79bb('0x39'))){_0xe2a411['limit']=qs[_0x79bb('0x1f')](_0x2f5610[_0x79bb('0x32')][_0x79bb('0x1f')]);_0xe2a411['offset']=qs['offset'](_0x2f5610[_0x79bb('0x32')]['offset']);}_0xe2a411[_0x79bb('0x3a')]=qs[_0x79bb('0x3b')](_0x2f5610['query'][_0x79bb('0x3b')]);_0xe2a411['where']=qs[_0x79bb('0x34')](_[_0x79bb('0x3c')](_0x2f5610[_0x79bb('0x32')],_0x4be1a0['filters']),_0x137cfd);if(_0x2f5610[_0x79bb('0x32')][_0x79bb('0x3d')]){_0xe2a411['where']=_[_0x79bb('0x3e')](_0xe2a411[_0x79bb('0x3f')],{'$or':_[_0x79bb('0x2c')](_0x137cfd,function(_0x388663){if(_0x388663[_0x79bb('0x2f')]!=='VIRTUAL'){var _0x4a3aa7={};_0x4a3aa7[_0x388663[_0x79bb('0x29')]]={'$like':'%'+_0x2f5610[_0x79bb('0x32')][_0x79bb('0x3d')]+'%'};return _0x4a3aa7;}})});}_0xe2a411=_[_0x79bb('0x3e')]({},_0xe2a411,_0x2f5610[_0x79bb('0x40')]);var _0xd167bd={'where':_0xe2a411['where']};return db[_0x79bb('0x2d')][_0x79bb('0x20')](_0xd167bd)['then'](function(_0x3f48d0){_0x5e0910[_0x79bb('0x20')]=_0x3f48d0;if(_0x2f5610['query'][_0x79bb('0x41')]){_0xe2a411['include']=[{'all':!![]}];}return db[_0x79bb('0x2d')][_0x79bb('0x42')](_0xe2a411);})[_0x79bb('0x25')](function(_0x451d06){_0x5e0910[_0x79bb('0x43')]=_0x451d06;return _0x5e0910;})[_0x79bb('0x25')](respondWithFilteredResult(_0x4577c6,_0xe2a411))[_0x79bb('0x44')](handleError(_0x4577c6,null));};exports['show']=function(_0x4936db,_0x2084ed){var _0x41f2df={'raw':![],'where':{'id':_0x4936db['params']['id']}},_0x292365={};_0x292365[_0x79bb('0x31')]=_[_0x79bb('0x33')](db[_0x79bb('0x2d')][_0x79bb('0x45')]);_0x292365[_0x79bb('0x32')]=_[_0x79bb('0x33')](_0x4936db[_0x79bb('0x32')]);_0x292365[_0x79bb('0x34')]=_[_0x79bb('0x36')](_0x292365[_0x79bb('0x31')],_0x292365[_0x79bb('0x32')]);_0x41f2df['attributes']=_['intersection'](_0x292365[_0x79bb('0x31')],qs['fields'](_0x4936db['query']['fields']));_0x41f2df[_0x79bb('0x35')]=_0x41f2df[_0x79bb('0x35')][_0x79bb('0x37')]?_0x41f2df[_0x79bb('0x35')]:_0x292365['model'];if(_0x4936db['query']['includeAll']){_0x41f2df[_0x79bb('0x46')]=[{'all':!![]}];}_0x41f2df=_[_0x79bb('0x3e')]({},_0x41f2df,_0x4936db[_0x79bb('0x40')]);return db[_0x79bb('0x2d')][_0x79bb('0x47')](_0x41f2df)[_0x79bb('0x25')](handleEntityNotFound(_0x2084ed,null))[_0x79bb('0x25')](respondWithResult(_0x2084ed,null))[_0x79bb('0x44')](handleError(_0x2084ed,null));};exports[_0x79bb('0x48')]=function(_0x54a2ca,_0x572016){return db[_0x79bb('0x2d')]['create'](_0x54a2ca[_0x79bb('0x49')],{})[_0x79bb('0x25')](respondWithResult(_0x572016,0xc9))[_0x79bb('0x44')](handleError(_0x572016,null));};exports['clone']=function(_0x4efd90,_0x14b6fe){var _0x12b75e={'where':{'id':_0x4efd90[_0x79bb('0x4a')]['id']}},_0x5b3c0a={};_0x5b3c0a[_0x79bb('0x31')]=_[_0x79bb('0x33')](db[_0x79bb('0x2d')][_0x79bb('0x45')]);_0x12b75e['attributes']=_[_0x79bb('0x36')](_0x5b3c0a[_0x79bb('0x31')],qs[_0x79bb('0x4b')](_0x4efd90[_0x79bb('0x32')]['fields']));_0x12b75e[_0x79bb('0x35')]=_0x12b75e['attributes'][_0x79bb('0x37')]?_0x12b75e[_0x79bb('0x35')]:_0x5b3c0a[_0x79bb('0x31')];if(_0x4efd90['query'][_0x79bb('0x41')]){_0x12b75e['include']=[{'all':!![]}];}_0x12b75e=_['merge']({},_0x12b75e,_0x4efd90[_0x79bb('0x40')]);return db[_0x79bb('0x2d')][_0x79bb('0x47')](_0x12b75e)[_0x79bb('0x25')](handleEntityNotFound(_0x14b6fe,null))[_0x79bb('0x25')](function(_0x1fd7d6){if(_0x1fd7d6){var _0x254c20=_0x1fd7d6[_0x79bb('0x4c')]({'plain':!![]});_0x254c20=qs['omit'](_0x254c20,['id',_0x79bb('0x4d'),_0x79bb('0x4e'),_0x79bb('0x4f')]);_0x4efd90[_0x79bb('0x49')]=_['omit'](_0x4efd90[_0x79bb('0x49')],['id',_0x79bb('0x4d'),'updatedAt']);return db[_0x79bb('0x50')][_0x79bb('0x51')](function(_0x139f24){return db[_0x79bb('0x2d')][_0x79bb('0x48')](_[_0x79bb('0x3e')](_0x254c20,_0x4efd90[_0x79bb('0x49')]),{'include':_0x4efd90[_0x79bb('0x32')][_0x79bb('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x139f24})[_0x79bb('0x25')](function(_0x1c8419){var _0x5346f7=_0x1c8419['get']({'plain':!![]});return db[_0x79bb('0x52')]['findAll']({'where':{'userProfileId':_0x4efd90[_0x79bb('0x4a')]['id']},'raw':!![]})['then'](function(_0x3cbfa3){if(_0x3cbfa3){return BPromise[_0x79bb('0x53')](_0x3cbfa3,function(_0x5ca7ab){return new BPromise(function(_0x305b0c,_0x25fa11){if(_0x5ca7ab['autoAssociation']===null||_0x5ca7ab[_0x79bb('0x54')]===0x1)_0x305b0c(null);return db[_0x79bb('0x55')][_0x79bb('0x42')]({'where':{'sectionId':_0x5ca7ab['id']},'raw':!![]})[_0x79bb('0x25')](function(_0x12c4a1){var _0x67a73=_[_0x79bb('0x2c')](_0x12c4a1,function(_0x5af10f){return qs['omit'](_0x5af10f,['id','createdAt','updatedAt',_0x79bb('0x56')]);});_0x305b0c(_0x67a73);})['catch'](function(_0x643183){_0x25fa11(_0x643183);});})[_0x79bb('0x25')](function(_0x12c0e1){var _0x4c2792=qs[_0x79bb('0x57')](_0x5ca7ab,['id',_0x79bb('0x4d'),_0x79bb('0x4e')]);_0x4c2792[_0x79bb('0x58')]=_0x5346f7['id'];if(_0x12c0e1)_0x4c2792['Resources']=_0x12c0e1;return _0x4c2792;})[_0x79bb('0x25')](function(_0xca7959){return db['UserProfileSection'][_0x79bb('0x48')](_0xca7959,{'include':[{'model':db['UserProfileResource'],'as':_0x79bb('0x59')}],'raw':!![],'transaction':_0x139f24});});})[_0x79bb('0x25')](function(){return _0x5346f7;});}});});});}})[_0x79bb('0x25')](respondWithResult(_0x14b6fe,0xc9))[_0x79bb('0x44')](handleError(_0x14b6fe,null));};exports[_0x79bb('0x5a')]=function(_0x10b52a,_0x242d37){if(_0x10b52a[_0x79bb('0x49')]['id']){delete _0x10b52a[_0x79bb('0x49')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x10b52a[_0x79bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x242d37,null))[_0x79bb('0x25')](saveUpdates(_0x10b52a[_0x79bb('0x49')],null))[_0x79bb('0x25')](respondWithResult(_0x242d37,null))[_0x79bb('0x44')](handleError(_0x242d37,null));};exports['destroy']=function(_0x20cbbf,_0x5d7441){return db[_0x79bb('0x2d')]['find']({'where':{'id':_0x20cbbf[_0x79bb('0x4a')]['id']}})[_0x79bb('0x25')](handleEntityNotFound(_0x5d7441,null))['then'](removeEntity(_0x5d7441,null))[_0x79bb('0x44')](handleError(_0x5d7441,null));};exports[_0x79bb('0x5b')]=function(_0x54768a,_0x4ef8d3){return db[_0x79bb('0x2d')]['describe']()['then'](respondWithResult(_0x4ef8d3,null))[_0x79bb('0x44')](handleError(_0x4ef8d3,null));};exports['addSections']=function(_0x13e33d,_0xc4ef4b){var _0x5a454d=_0x13e33d[_0x79bb('0x49')];return db[_0x79bb('0x2d')][_0x79bb('0x47')]({'where':{'id':_0x13e33d['params']['id']}})[_0x79bb('0x25')](handleEntityNotFound(_0xc4ef4b,null))[_0x79bb('0x25')](function(_0x2303c9){if(_0x2303c9){return db[_0x79bb('0x50')][_0x79bb('0x51')](function(_0x850c71){return db[_0x79bb('0x52')]['destroy']({'where':{'userProfileId':_0x13e33d[_0x79bb('0x4a')]['id'],'sectionId':_['map'](_0x5a454d,function(_0x58a755){return _0x58a755[_0x79bb('0x56')];})},'transaction':_0x850c71})['then'](function(){var _0x230a94=_[_0x79bb('0x2c')](_0x5a454d,function(_0x11e789){_0x11e789['userProfileId']=_0x13e33d[_0x79bb('0x4a')]['id'];return _0x11e789;});var _0x148a35=[];return BPromise[_0x79bb('0x53')](_0x230a94,function(_0xf2f89c){return db[_0x79bb('0x52')][_0x79bb('0x48')](_0xf2f89c,{'include':[{'model':db[_0x79bb('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x850c71})[_0x79bb('0x25')](function(_0x3e03ce){_0x148a35[_0x79bb('0x5c')](_0x3e03ce[_0x79bb('0x4c')]({'plain':!![]}));});})[_0x79bb('0x25')](function(){return _0x148a35;});});});}})['then'](function(_0xc8c6cd){return _0xc8c6cd;})[_0x79bb('0x25')](respondWithResult(_0xc4ef4b,null))['catch'](handleError(_0xc4ef4b,null));};exports['removeSections']=function(_0x15035d,_0x1f94e0){var _0xbe2351;return db['UserProfile'][_0x79bb('0x47')]({'where':{'id':_0x15035d[_0x79bb('0x4a')]['id']},'attributes':['id','name']})[_0x79bb('0x25')](handleEntityNotFound(_0x1f94e0,null))[_0x79bb('0x25')](function(_0x39a513){if(_0x39a513){_0xbe2351=_0x39a513;return db[_0x79bb('0x52')][_0x79bb('0x26')]({'where':{'userProfileId':_0x15035d['params']['id'],'sectionId':_0x15035d[_0x79bb('0x32')][_0x79bb('0x5d')]}});}})[_0x79bb('0x25')](function(){return _0xbe2351;})[_0x79bb('0x25')](respondWithStatusCode(_0x1f94e0,null))[_0x79bb('0x44')](handleError(_0x1f94e0,null));};exports['getSections']=function(_0x148770,_0x2964a8){var _0x577c2a=[];var _0x2b4b6c=[];return db[_0x79bb('0x52')]['findAll']({'where':{'userProfileId':_0x148770[_0x79bb('0x4a')]['id']},'raw':!![]})['then'](function(_0x801666){_0x577c2a=_[_0x79bb('0x3d')](_0x801666,function(_0x184e07){return _0x184e07[_0x79bb('0x5e')]===0x1||_['includes']([0x3eb,0x709],_0x184e07[_0x79bb('0x56')]);});if(!_['isEmpty'](_0x577c2a)){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x53a822){return _0x53a822[_0x79bb('0x56')];});}else{return;}})[_0x79bb('0x25')](function(_0x18601b){if(_0x18601b)_0x2b4b6c=_0x18601b;if(_[_0x79bb('0x5f')](_0x2b4b6c,0x64)){var _0x3eeda3=_[_0x79bb('0x47')](_0x577c2a,{'sectionId':0x64});return hasDefaultDashboard(_0x3eeda3)[_0x79bb('0x25')](function(_0x29ec7e){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x21b8c3){if(_0x21b8c3[_0x79bb('0x56')]===0x64){_0x21b8c3[_0x79bb('0x60')]=_0x29ec7e;}return _0x21b8c3;});});}else{return;}})[_0x79bb('0x25')](function(_0x5a3e84){if(_0x5a3e84)_0x577c2a=_0x5a3e84;if(_[_0x79bb('0x5f')](_0x2b4b6c,0x3eb)){var _0x132ee1=_[_0x79bb('0x47')](_0x577c2a,{'sectionId':0x3eb});return getCustomDashboards(_0x132ee1)['then'](function(_0x322c22){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x4e88f){if(_0x132ee1[_0x79bb('0x5e')]){if(_0x4e88f[_0x79bb('0x56')]===0x3eb){_0x4e88f['subsections']=_0x322c22;}}else{if(_0x4e88f[_0x79bb('0x56')]===0x64){if(!_0x4e88f[_0x79bb('0x60')]){_0x4e88f[_0x79bb('0x60')]=[];}_0x4e88f[_0x79bb('0x60')]=_0x4e88f[_0x79bb('0x60')]['concat'](_0x322c22);}}return _0x4e88f;});});}else{return;}})['then'](function(_0x30b04d){if(_0x30b04d)_0x577c2a=_0x30b04d;if(_['includes'](_0x2b4b6c,0x709)){var _0x1dd7ae=_['find'](_0x577c2a,{'sectionId':0x709});return getPlugins(_0x1dd7ae)[_0x79bb('0x25')](function(_0x4e16eb){if(_0x1dd7ae['enabled']){return _[_0x79bb('0x2c')](_0x577c2a,function(_0x4ab968){if(_0x4ab968[_0x79bb('0x56')]===0x709){_0x4ab968[_0x79bb('0x60')]=_0x4e16eb;}return _0x4ab968;});}else{var _0x401c9e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4e16eb};var _0x545e32=_['map'](_0x577c2a);_0x545e32[_0x79bb('0x5c')](_0x401c9e);return _0x545e32;}});}else{return;}})[_0x79bb('0x25')](function(_0x34a50f){if(_0x34a50f)_0x577c2a=_0x34a50f;return _[_0x79bb('0x3d')](_0x577c2a,[_0x79bb('0x5e'),0x1]);})['then'](respondWithResult(_0x2964a8,null))['catch'](handleError(_0x2964a8,null));};function hasDefaultDashboard(_0x539d49){var _0xb74728=[0x65];return new BPromise(function(_0x299521,_0x1e1fd9){try{if(_0x539d49['autoAssociation']){_0x299521(_0xb74728);}else{return db[_0x79bb('0x55')][_0x79bb('0x61')]({'where':{'sectionId':_0x539d49['id']},'raw':!![]})['then'](function(_0x2104f0){_0x2104f0?_0x299521(_0xb74728):_0x299521();});}}catch(_0x59fc96){_0x1e1fd9(_0x59fc96);}});}function getCustomDashboards(_0xd8683a){var _0x1a72dc=[];return new BPromise(function(_0x5614df,_0x396515){try{if(_0xd8683a[_0x79bb('0x54')]){return db[_0x79bb('0x62')][_0x79bb('0x42')]({'raw':!![]})[_0x79bb('0x25')](function(_0x8c80f3){_0x8c80f3[_0x79bb('0x63')](function(_0x393abe){_0x1a72dc[_0x79bb('0x5c')](_0x393abe['id']+0x1869f);});_0x5614df(_0x1a72dc);});}else{return db[_0x79bb('0x55')]['findAll']({'where':{'sectionId':_0xd8683a['id']},'raw':!![]})[_0x79bb('0x25')](function(_0x3640b8){_0x3640b8['forEach'](function(_0x3bdbc2){_0x1a72dc[_0x79bb('0x5c')](_0x3bdbc2[_0x79bb('0x64')]+0x1869f);});_0x5614df(_0x1a72dc);});}}catch(_0x3d0802){_0x396515(_0x3d0802);}});}function getPlugins(_0x47059b){var _0x5099f1=[];return new BPromise(function(_0x2ab54f,_0x3e9406){try{if(_0x47059b['autoAssociation']){return db['Plugin'][_0x79bb('0x42')]({'raw':!![]})[_0x79bb('0x25')](function(_0x3fbb58){_0x3fbb58[_0x79bb('0x63')](function(_0x9cbabf){_0x5099f1[_0x79bb('0x5c')](_0x9cbabf['id']+0x15b38);});_0x2ab54f(_0x5099f1);});}else{return db['UserProfileResource'][_0x79bb('0x42')]({'where':{'sectionId':_0x47059b['id']},'raw':!![]})[_0x79bb('0x25')](function(_0x973baa){_0x973baa[_0x79bb('0x63')](function(_0x1cdeb1){_0x5099f1['push'](_0x1cdeb1['resourceId']+0x15b38);});_0x2ab54f(_0x5099f1);});}}catch(_0x4717d9){_0x3e9406(_0x4717d9);}});}exports[_0x79bb('0x65')]=function(_0x4b009a,_0xbeea18){return db[_0x79bb('0x2d')][_0x79bb('0x47')]({'where':{'id':_0x4b009a[_0x79bb('0x4a')]['id']}})[_0x79bb('0x25')](handleEntityNotFound(_0xbeea18,null))[_0x79bb('0x25')](function(_0x179145){if(_0x179145){return db[_0x79bb('0x50')][_0x79bb('0x51')](function(_0x3c2290){return db[_0x79bb('0x52')][_0x79bb('0x42')]({'where':{'userProfileId':_0x4b009a[_0x79bb('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x79bb('0x25')](function(_0x5a22ed){if(_0x5a22ed){return db[_0x79bb('0x52')][_0x79bb('0x26')]({'where':{'userProfileId':_0x4b009a[_0x79bb('0x4a')]['id'],'id':_['map'](_0x5a22ed,function(_0x1860e4){return _0x1860e4['id'];})},'transaction':_0x3c2290});}})[_0x79bb('0x25')](function(_0x3b8ccd){var _0xb0e3c3=_['map'](_0x4b009a[_0x79bb('0x49')],function(_0xd673d2){_0xd673d2[_0x79bb('0x58')]=_0x4b009a[_0x79bb('0x4a')]['id'];return _0xd673d2;});return db[_0x79bb('0x52')]['bulkCreate'](_0xb0e3c3,{'raw':!![],'transaction':_0x3c2290});})[_0x79bb('0x25')](function(_0x41c1ad){var _0x4dad81=_[_0x79bb('0x3d')](_[_0x79bb('0x2c')](_0x41c1ad,function(_0x56e1a5){return _0x56e1a5['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4dad81){return db[_0x79bb('0x52')][_0x79bb('0x42')]({'where':{'userProfileId':_0x4b009a['params']['id'],'sectionId':_['map'](_0x4dad81,function(_0x2b448b){return _0x2b448b[_0x79bb('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x79bb('0x25')](function(_0x5bba1f){var _0x46cc53=_['map'](_0x4b009a[_0x79bb('0x49')],function(_0x40dc52){_0x40dc52[_0x79bb('0x58')]=_0x4b009a[_0x79bb('0x4a')]['id'];return _0x40dc52;});return db[_0x79bb('0x55')][_0x79bb('0x66')](_0x46cc53,{'raw':!![],'transaction':_0x3c2290});});}})[_0x79bb('0x44')](handleError(_0xbeea18,null));});}})[_0x79bb('0x25')](function(_0x5d5042){var _0x5007e4=_[_0x79bb('0x2c')](_0x5d5042,function(_0x544bc6){return _0x544bc6[_0x79bb('0x4c')]({'plain':!![]});});})[_0x79bb('0x25')](respondWithResult(_0xbeea18,null))['catch'](handleError(_0xbeea18,null));};exports[_0x79bb('0x67')]=function(_0x3c14ce,_0x9ecfec,_0x34f6be){return db['UserProfile'][_0x79bb('0x47')]({'where':{'id':_0x3c14ce[_0x79bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9ecfec,null))[_0x79bb('0x25')](function(_0x296d1b){if(_0x296d1b){return _0x296d1b[_0x79bb('0x67')](_0x3c14ce[_0x79bb('0x32')]['ids']);}})[_0x79bb('0x25')](respondWithStatusCode(_0x9ecfec,null))[_0x79bb('0x44')](handleError(_0x9ecfec,null));};exports[_0x79bb('0x68')]=function(_0x467f49,_0x56a616){var _0x465417={};if(!_0x467f49[_0x79bb('0x32')][_0x79bb('0x69')])throw new Error('Missing\x20section\x20parameter');if(!_0x467f49['query']['hasOwnProperty'](_0x79bb('0x39'))){_0x465417[_0x79bb('0x1f')]=qs['limit'](_0x467f49[_0x79bb('0x32')]['limit']);_0x465417[_0x79bb('0x1d')]=qs[_0x79bb('0x1d')](_0x467f49[_0x79bb('0x32')][_0x79bb('0x1d')]);}return db['UserProfile'][_0x79bb('0x47')]({'where':{'id':_0x467f49[_0x79bb('0x4a')]['id']}})[_0x79bb('0x25')](function(_0x3b7123){if(!_0x3b7123)throw new Error(_0x79bb('0x6a')+_0x467f49[_0x79bb('0x4a')]['id']);return db['UserProfile'][_0x79bb('0x68')](_0x467f49);})['then'](respondWithFilteredResult(_0x56a616,_0x465417))[_0x79bb('0x44')](handleError(_0x56a616,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5590196..d58bad2 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 _0x49fe=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x3c0f33,_0x1fe57b){var _0x45eac9=function(_0x475548){while(--_0x475548){_0x3c0f33['push'](_0x3c0f33['shift']());}};_0x45eac9(++_0x1fe57b);}(_0x49fe,0x75));var _0xe49f=function(_0x58a24f,_0x5314a2){_0x58a24f=_0x58a24f-0x0;var _0x571dcd=_0x49fe[_0x58a24f];return _0x571dcd;};'use strict';var EventEmitter=require(_0xe49f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe49f('0x1'),'afterUpdate':_0xe49f('0x2'),'afterDestroy':_0xe49f('0x3')};function emitEvent(_0xb99c7){return function(_0x1cac40,_0x2db0ec,_0x1235f4){UserProfileEvents[_0xe49f('0x4')](_0xb99c7+':'+_0x1cac40['id'],_0x1cac40);UserProfileEvents[_0xe49f('0x4')](_0xb99c7,_0x1cac40);_0x1235f4(null);};}for(var e in events){if(events[_0xe49f('0x5')](e)){var event=events[e];UserProfile[_0xe49f('0x6')](e,emitEvent(event));}}module[_0xe49f('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x5d58=['hook','update','remove','emit','hasOwnProperty'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5d58,0x187));var _0x85d5=function(_0x5eaa2f,_0x125e1e){_0x5eaa2f=_0x5eaa2f-0x0;var _0x460d1b=_0x5d58[_0x5eaa2f];return _0x460d1b;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85d5('0x0'),'afterDestroy':_0x85d5('0x1')};function emitEvent(_0x53ca58){return function(_0x1469fc,_0x30bfe8,_0x54207b){UserProfileEvents[_0x85d5('0x2')](_0x53ca58+':'+_0x1469fc['id'],_0x1469fc);UserProfileEvents[_0x85d5('0x2')](_0x53ca58,_0x1469fc);_0x54207b(null);};}for(var e in events){if(events[_0x85d5('0x3')](e)){var event=events[e];UserProfile[_0x85d5('0x4')](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 86018b8..6a985f1 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 _0x0a58=['outbound','musiconholds','VoiceMusicOnHold','chanspies','mailqueues','MailQueue','mailaccounts','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','telephones','admin','user','Telephones','zendeskaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','_interactions','where','ui.UserId\x20=\x20?','define','UserProfile','user_profiles','../../components/parsers/qs','query','raw','section','mergeResources','Invalid\x20section\x20\x27','push','all','ignore','isEmpty','union','find','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','forEach','reportType','default','custom','CustomReports','count','ids','customSorting','extraQueryConditions','CmContact','include','Tags','color','tag','ThroughTags','openTabs','chat','rows','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','field','findAll','map','catch','value','then','associatedResources','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','parentSections','name','projects','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','agent','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0a58,0x13a));var _0x80a5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a58[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80a5('0x0'));var attributes=require(_0x80a5('0x1'));var squel=require(_0x80a5('0x2'));module[_0x80a5('0x3')]=function(_0x30997e){var _0x378a94=_0x30997e['models'];function _0x45881a(_0x3b938a,_0x562bb8){return new Promise(function(_0x26e219,_0x155196){if(!_0x562bb8)return _0x26e219(null);var _0x1d7677=_0x562bb8['filter']?{[_0x562bb8[_0x80a5('0x4')][_0x80a5('0x5')]]:_0x562bb8[_0x80a5('0x4')]['value']}:undefined;return _0x378a94[_0x3b938a][_0x80a5('0x6')]({'where':_0x1d7677,'raw':!![]})['then'](function(_0x44a1c0){_0x562bb8['associatedResources']=_[_0x80a5('0x7')](_0x44a1c0,'id');_0x26e219(_0x562bb8);})[_0x80a5('0x8')](function(_0x5f23a9){_0x155196(_0x5f23a9);});});}function _0x59dd1a(_0x287cd9,_0xfce651){return new Promise(function(_0x3427d8,_0x24165f){var _0x2772f2=_0x287cd9['filter']?{[_0x287cd9['filter']['field']]:_0x287cd9[_0x80a5('0x4')][_0x80a5('0x9')]}:undefined;return _0x378a94[_0x287cd9['model']]['findAll']({'where':_0x2772f2,'raw':!![]})[_0x80a5('0xa')](function(_0x275264){_0xfce651[_0x80a5('0xb')]=_['map'](_0x275264,function(_0x1d8cef){return _0x1d8cef['name'];});_0x3427d8(_0xfce651);})[_0x80a5('0x8')](function(_0x425b69){_0x24165f(_0x425b69);});});}function _0x514afd(_0x1ac740,_0x42be15,_0x31fa52){if(!_0x42be15)return Promise[_0x80a5('0xc')](null);return new Promise(function(_0x56af53,_0x2f31b9){return _0x378a94[_0x80a5('0xd')][_0x80a5('0x6')]({'where':{'sectionId':_0x42be15['id']},'raw':!![]})[_0x80a5('0xa')](function(_0x199f7e){if(_0x1ac740[_0x80a5('0x5')]&&_0x1ac740[_0x80a5('0x5')]!=='id'){_0x42be15[_0x80a5('0xb')]=_[_0x80a5('0x7')](_0x199f7e,function(_0x574038){return _0x574038[_0x1ac740['field']];});}else{if(_0x31fa52===_0x80a5('0xe')){_0x42be15['associatedResources']=_[_0x80a5('0x7')](_0x199f7e,function(_0x54e613){return{'id':_0x54e613[_0x80a5('0xf')],'type':_0x54e613['type']};});}else{_0x42be15[_0x80a5('0xb')]=_[_0x80a5('0x7')](_0x199f7e,function(_0x29036d){return _0x29036d[_0x80a5('0xf')];});}}_0x56af53(_0x42be15);})[_0x80a5('0x8')](function(_0x1246db){_0x2f31b9(_0x1246db);});});}function _0x8c64c8(_0x1ee4ce,_0x1314ce){var _0x43989b={'parentSections':[]};switch(_0x1ee4ce[_0x80a5('0x10')]()){case _0x80a5('0x11'):_0x43989b[_0x80a5('0x12')]='SquareProject';break;case _0x80a5('0x13'):_0x43989b['childModel']=_0x80a5('0x14');break;case'squarerecordings':_0x43989b[_0x80a5('0x12')]='SquareRecording';_0x43989b[_0x80a5('0x15')]=[{'name':'SquareProjects','field':_0x80a5('0x16'),'foreignKey':'projectName'}];break;case _0x80a5('0x17'):_0x43989b[_0x80a5('0x12')]='JscriptyProject';break;case'contacts':_0x43989b[_0x80a5('0x12')]='CmContact';_0x43989b['parentSections']=[{'name':_0x80a5('0x18'),'field':'id','foreignKey':_0x80a5('0x19')}];break;case _0x80a5('0x1a'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x1b');break;case _0x80a5('0x1c'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x1d');break;case _0x80a5('0x1e'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x1f');break;case _0x80a5('0x20'):_0x43989b['childModel']='ChatQueue';break;case _0x80a5('0x21'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x22');break;case _0x80a5('0x23'):_0x43989b['childModel']=_0x80a5('0x24');break;case _0x80a5('0x25'):_0x43989b[_0x80a5('0x12')]='FaxAccount';break;case'inboundroutes':case _0x80a5('0x26'):case _0x80a5('0x27'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x28');break;case _0x80a5('0x29'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x2a');break;case _0x80a5('0x2b'):_0x43989b['childModel']='VoiceMail';break;case _0x80a5('0x2c'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x2d');_0x43989b[_0x80a5('0x15')]=[{'name':_0x80a5('0x2e'),'field':'name','foreignKey':_0x80a5('0x2f'),'model':_0x80a5('0x30'),'filter':{'field':'role','value':[_0x80a5('0x31')]}},{'name':'Telephones','field':_0x80a5('0x16'),'foreignKey':_0x80a5('0x2f'),'model':'User','filter':{'field':_0x80a5('0x32'),'value':[_0x80a5('0x33')]}},{'name':_0x80a5('0x34'),'field':'name','foreignKey':_0x80a5('0x35'),'model':_0x80a5('0x36'),'filter':{'field':_0x80a5('0x37'),'value':[_0x80a5('0x38')]}},{'name':_0x80a5('0x39'),'field':_0x80a5('0x16'),'foreignKey':_0x80a5('0x35'),'model':_0x80a5('0x36'),'filter':{'field':_0x80a5('0x37'),'value':[_0x80a5('0x3a')]}}];break;case _0x80a5('0x3b'):_0x43989b['childModel']=_0x80a5('0x3c');break;case _0x80a5('0x3d'):_0x43989b[_0x80a5('0x12')]='VoiceChanSpy';break;case'voiceprefixes':_0x43989b['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x43989b[_0x80a5('0x12')]='Campaign';break;case _0x80a5('0x3e'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x3f');break;case _0x80a5('0x40'):_0x43989b[_0x80a5('0x12')]='MailAccount';break;case'mailsubstatuses':_0x43989b[_0x80a5('0x12')]=_0x80a5('0x41');break;case _0x80a5('0x42'):_0x43989b[_0x80a5('0x12')]='OpenchannelQueue';break;case _0x80a5('0x43'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x44');break;case _0x80a5('0x45'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x46');break;case _0x80a5('0x47'):_0x43989b[_0x80a5('0x12')]='SmsAccount';break;case _0x80a5('0x48'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x49');break;case'whatsappaccounts':_0x43989b['childModel']='WhatsappAccount';break;case _0x80a5('0x4a'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x4b');break;case _0x80a5('0x4c'):case _0x80a5('0x4d'):_0x43989b[_0x80a5('0x12')]='VoiceQueue';if(_0x1314ce){_0x43989b[_0x80a5('0x15')]=[{'name':_0x80a5('0x34')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0x80a5('0x4e'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x30');if(_0x1314ce){_0x43989b['parentSections']=[{'name':'Users','filter':{'field':_0x80a5('0x32'),'value':[_0x80a5('0x4f'),_0x80a5('0x50')]},'ignore':!![]},{'name':_0x80a5('0x2e')},{'name':_0x80a5('0x51')}];}break;case _0x80a5('0x52'):_0x43989b[_0x80a5('0x12')]='ZendeskAccount';break;case'salesforceaccounts':_0x43989b[_0x80a5('0x12')]='SalesforceAccount';break;case _0x80a5('0x53'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x54');break;case _0x80a5('0x55'):_0x43989b['childModel']=_0x80a5('0x56');break;case'deskaccounts':_0x43989b[_0x80a5('0x12')]=_0x80a5('0x57');break;case _0x80a5('0x58'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x59');break;case _0x80a5('0x5a'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x30');break;case _0x80a5('0x5b'):_0x43989b['childModel']=_0x80a5('0x5c');break;case _0x80a5('0x5d'):_0x43989b['childModel']=_0x80a5('0x5e');break;case'customdashboards':_0x43989b[_0x80a5('0x12')]=_0x80a5('0x5f');break;case _0x80a5('0x60'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x61');break;case _0x80a5('0x62'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x63');break;case'scheduler':_0x43989b['childModel']=_0x80a5('0x64');break;case'sounds':_0x43989b[_0x80a5('0x12')]=_0x80a5('0x65');break;case _0x80a5('0x66'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x67');break;case _0x80a5('0x68'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x69');break;case _0x80a5('0x6a'):_0x43989b['childModel']=_0x80a5('0x6b');break;case'trunks':_0x43989b[_0x80a5('0x12')]=_0x80a5('0x6c');break;case _0x80a5('0x6d'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x6e');break;case _0x80a5('0x6f'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x70');break;case _0x80a5('0x71'):_0x43989b['childModel']=_0x80a5('0xe');_0x43989b[_0x80a5('0x15')]=[{'name':'Reports','field':'id','foreignKey':_0x80a5('0x72')}];break;case _0x80a5('0x73'):_0x43989b[_0x80a5('0x12')]=_0x80a5('0x74');break;}return _0x43989b;}function _0x2f99d0(_0x3aab16,_0x3e81ab){var _0x37b85f=_0x3aab16[_0x80a5('0x75')](0x0)['toUpperCase']()+_0x3aab16[_0x80a5('0x76')](0x1);var _0x2ff266={'type':_0x378a94[_0x80a5('0x77')][_0x80a5('0x78')][_0x80a5('0x79')],'raw':!![]};return new Promise(function(_0xf86fa,_0x4f0ddc){var _0x12ebeb=squel[_0x80a5('0x7a')]()['field']('ui.'+_0x37b85f+_0x80a5('0x7b'),'id')[_0x80a5('0x5')]('ui.createdAt')['from']('user_has_'+_0x3aab16+_0x80a5('0x7c'),'ui')[_0x80a5('0x7d')](_0x80a5('0x7e'),_0x3e81ab['id']);return _0x378a94['sequelize']['query'](_0x12ebeb['toString'](),_0x2ff266)[_0x80a5('0xa')](function(_0x5b9d16){_0x3e81ab[_0x37b85f+'OpenTabs']=_0x5b9d16;_0xf86fa(_0x5b9d16);})[_0x80a5('0x8')](function(_0x1548af){_0x4f0ddc(_0x1548af);});});}return _0x30997e[_0x80a5('0x7f')](_0x80a5('0x80'),attributes,{'tableName':_0x80a5('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x486f71){var _0xdc41f=require(_0x80a5('0x82'));var _0x2a650a={'raw':_0x486f71[_0x80a5('0x83')][_0x80a5('0x84')],'where':{}};var _0x1ea4b3={};var _0x453826={'count':0x0,'rows':[]};var _0x5ea4d9=_0x486f71[_0x80a5('0x83')][_0x80a5('0x85')];var _0x50b48a=_0x486f71[_0x80a5('0x83')][_0x80a5('0x86')]||![];var _0x5e1ffe=_0x8c64c8(_0x5ea4d9,_0x50b48a);if(!_0x5e1ffe[_0x80a5('0x12')])throw new Error(_0x80a5('0x87')+_0x5ea4d9+'\x27');var _0x4d7e4b=[{'name':_0x5ea4d9}];if(!_['isEmpty'](_0x5e1ffe[_0x80a5('0x15')]))_0x4d7e4b=_0x5e1ffe[_0x80a5('0x15')];var _0x2b49f2=[];for(var _0x4b0dc4=0x0;_0x4b0dc4<_0x4d7e4b['length'];_0x4b0dc4++){_0x2b49f2[_0x80a5('0x88')](_0x378a94['UserProfileSection']['find']({'where':{'userProfileId':_0x486f71['params']['id'],'name':_0x4d7e4b[_0x4b0dc4][_0x80a5('0x16')]},'raw':!![]}));}return Promise[_0x80a5('0x89')](_0x2b49f2)[_0x80a5('0xa')](function(_0x13d73c){var _0x34bc66=_[_0x80a5('0x4')](_0x13d73c,function(_0x3cd5f0){return _0x3cd5f0?_0x3cd5f0:undefined;});var _0x7aeb3f=_['filter'](_0x4d7e4b,[_0x80a5('0x8a'),!![]]);var _0x38fcd1=_[_0x80a5('0x8b')](_0x34bc66)&&_[_0x80a5('0x8b')](_0x7aeb3f)?null:_[_0x80a5('0x8c')](_0x7aeb3f,_0x34bc66);if(!_0x38fcd1)return null;var _0x10c0ae=[];for(var _0x43e173=0x0;_0x43e173<_0x38fcd1['length'];_0x43e173++){var _0x549ef3=_[_0x80a5('0x8d')](_0x4d7e4b,function(_0x4d0c7c){return _0x38fcd1[_0x43e173]?_0x4d0c7c[_0x80a5('0x16')]===_0x38fcd1[_0x43e173][_0x80a5('0x16')]:null;});if(_0x549ef3){if(_0x38fcd1[_0x43e173][_0x80a5('0x8a')]){_0x10c0ae[_0x80a5('0x88')](_0x45881a(_0x5e1ffe[_0x80a5('0x12')],_0x38fcd1[_0x43e173]));}else{if(!_0x38fcd1[_0x43e173][_0x80a5('0x8e')]){_0x10c0ae[_0x80a5('0x88')](_0x514afd(_0x549ef3,_0x38fcd1[_0x43e173],_0x5e1ffe[_0x80a5('0x12')]));}else{if(_0x549ef3[_0x80a5('0x8f')]){_0x10c0ae[_0x80a5('0x88')](_0x59dd1a(_0x549ef3,_0x38fcd1[_0x43e173]));}}}}}return Promise[_0x80a5('0x89')](_0x10c0ae);})[_0x80a5('0xa')](function(_0x107258){var _0x167b49=_0x107258;var _0x5859e3=null;if(_0x167b49){_0x5859e3=_0x167b49['length']===0x1?_0x167b49[0x0]:null;}if(!_0x5859e3&&!_0x167b49)return _0x453826;var _0x196f11=_0x378a94[_0x5e1ffe[_0x80a5('0x12')]][_0x80a5('0x90')];_0x1ea4b3[_0x80a5('0x8f')]=_[_0x80a5('0x91')](_0x196f11);_0x1ea4b3[_0x80a5('0x83')]=_['keys'](_0x486f71[_0x80a5('0x83')]);_0x1ea4b3[_0x80a5('0x92')]=_[_0x80a5('0x93')](_0x1ea4b3[_0x80a5('0x8f')],_0x1ea4b3['query']);_0x2a650a[_0x80a5('0x94')]=_[_0x80a5('0x93')](_0x1ea4b3[_0x80a5('0x8f')],_0xdc41f[_0x80a5('0x95')](_0x486f71['query'][_0x80a5('0x95')]));_0x2a650a[_0x80a5('0x94')]=_0x2a650a[_0x80a5('0x94')][_0x80a5('0x96')]?_0x2a650a[_0x80a5('0x94')]:_0x1ea4b3['model'];if(!_0x486f71['query'][_0x80a5('0x97')](_0x80a5('0x98'))){_0x2a650a['limit']=_0xdc41f[_0x80a5('0x99')](_0x486f71[_0x80a5('0x83')]['limit']);_0x2a650a[_0x80a5('0x9a')]=_0xdc41f[_0x80a5('0x9a')](_0x486f71[_0x80a5('0x83')]['offset']);}_0x2a650a[_0x80a5('0x9b')]=_0xdc41f['sort'](_0x486f71[_0x80a5('0x83')][_0x80a5('0x9c')]);_0x2a650a[_0x80a5('0x7d')]=_0xdc41f[_0x80a5('0x92')](_[_0x80a5('0x9d')](_0x486f71[_0x80a5('0x83')],_0x1ea4b3[_0x80a5('0x92')]));if(_0x486f71[_0x80a5('0x83')]['filter']){_0x2a650a[_0x80a5('0x7d')]=_[_0x80a5('0x9e')](_0x2a650a[_0x80a5('0x7d')],{'$or':_[_0x80a5('0x7')](_0x196f11,function(_0x1015dc){if(_0x1015dc[_0x80a5('0x37')][_0x80a5('0x9f')]!==_0x80a5('0xa0')){var _0x195fc0={};_0x195fc0[_0x1015dc[_0x80a5('0x5')]]={'$like':'%'+_0x486f71[_0x80a5('0x83')][_0x80a5('0x4')]+'%'};return _0x195fc0;}})});}var _0x1084ef=[];var _0x4c73b2=null;var _0x27c1a8={};if(_0x5859e3){_0x4c73b2=_['find'](_0x4d7e4b,[_0x80a5('0x16'),_0x5859e3[_0x80a5('0x16')]]);if(_0x4c73b2['field']){_0x27c1a8={};if(_0x5e1ffe[_0x80a5('0x12')]===_0x80a5('0xe')){_0x27c1a8[_0x4c73b2['foreignKey']]=_[_0x80a5('0x7')](_0x5859e3[_0x80a5('0xb')],'id');}else{_0x27c1a8[_0x4c73b2['foreignKey']]=_0x5859e3[_0x80a5('0xb')];}_0x1084ef[_0x80a5('0x88')](_0x27c1a8);}else{_0x2a650a[_0x80a5('0x7d')]['id']=_0x5859e3[_0x80a5('0xb')];}}else{for(var _0x1e1b26=0x0;_0x1e1b26<_0x167b49['length'];_0x1e1b26++){_0x4c73b2=_['find'](_0x4d7e4b,['name',_0x167b49[_0x1e1b26][_0x80a5('0x16')]]);if(_0x4c73b2[_0x80a5('0x5')]){_0x27c1a8={};_0x27c1a8[_0x4c73b2[_0x80a5('0xa1')]]=_0x167b49[_0x1e1b26]['associatedResources'];_0x1084ef['push'](_0x27c1a8);}else{if(!_0x2a650a[_0x80a5('0x7d')]['id'])_0x2a650a['where']['id']=[];_0x167b49[_0x1e1b26][_0x80a5('0xb')]['forEach'](function(_0x5d7972){_0x2a650a[_0x80a5('0x7d')]['id'][_0x80a5('0x88')](_0x5d7972);});}}}if(!_['isEmpty'](_0x1084ef)){_0x2a650a[_0x80a5('0x7d')]=_['merge'](_0x2a650a[_0x80a5('0x7d')],{'$and':{'$or':_0x1084ef}});}_0x2a650a=_[_0x80a5('0x9e')]({},_0x2a650a,_0x486f71[_0x80a5('0xa2')]);if(_0x5859e3&&!_0x5859e3[_0x80a5('0x8e')]&&_0x5e1ffe[_0x80a5('0x12')]==='AnalyticExtractedReport'){if(_0x486f71[_0x80a5('0x83')][_0x80a5('0xa3')]){_0x2a650a['include']=[{'all':!![]}];}return _0x378a94[_0x5e1ffe[_0x80a5('0x12')]]['findAll'](_0x2a650a)['then'](function(_0x23b341){var _0x2889f4=[];_0x23b341[_0x80a5('0xa4')](function(_0x129f4b){var _0x353da3;switch(_0x129f4b[_0x80a5('0xa5')]){case _0x80a5('0xa6'):_0x353da3=_[_0x80a5('0x8d')](_0x5859e3[_0x80a5('0xb')],function(_0x591783){return _0x591783['id']===_0x129f4b[_0x80a5('0x72')]&&_0x591783[_0x80a5('0x37')]==='DefaultReports';});break;case _0x80a5('0xa7'):_0x353da3=_[_0x80a5('0x8d')](_0x5859e3['associatedResources'],function(_0x217dc9){return _0x217dc9['id']===_0x129f4b[_0x80a5('0x72')]&&_0x217dc9[_0x80a5('0x37')]===_0x80a5('0xa8');});break;}if(_0x353da3)_0x2889f4[_0x80a5('0x88')](_0x129f4b);});_0x453826[_0x80a5('0xa9')]=_0x2889f4[_0x80a5('0x96')];_0x453826['rows']=_0x2889f4;return _0x453826;});}else{if(!_[_0x80a5('0x8b')](_0x486f71['query']['ids'])){_0x2a650a[_0x80a5('0x7d')]['id']=_0x2a650a[_0x80a5('0x7d')]['id']?_[_0x80a5('0x93')](_0x2a650a[_0x80a5('0x7d')]['id'],_0x486f71[_0x80a5('0x83')][_0x80a5('0xaa')]):_0x486f71['query'][_0x80a5('0xaa')];if(_0x486f71[_0x80a5('0x83')][_0x80a5('0xab')]){_0x2a650a[_0x80a5('0x9b')]=_0x486f71['query'][_0x80a5('0xab')];}}if(_0x486f71[_0x80a5('0x83')][_0x80a5('0xac')]){_0x2a650a[_0x80a5('0x7d')]=_['merge'](_0x2a650a[_0x80a5('0x7d')],{'$and':_0x486f71['query'][_0x80a5('0xac')]});}return _0x378a94[_0x5e1ffe['childModel']][_0x80a5('0xa9')]({'where':_0x2a650a[_0x80a5('0x7d')]})[_0x80a5('0xa')](function(_0xc87783){_0x453826[_0x80a5('0xa9')]=_0xc87783;if(_0x486f71['query'][_0x80a5('0xa3')]){if(_0x5e1ffe[_0x80a5('0x12')]===_0x80a5('0xad')){_0x2a650a[_0x80a5('0xae')]=[{'model':_0x378a94['Tag'],'as':_0x80a5('0xaf'),'attributes':['id',_0x80a5('0x16'),_0x80a5('0xb0')],'required':_0x486f71[_0x80a5('0x83')][_0x80a5('0xb1')]?!![]:![]},{'model':_0x378a94['Tag'],'as':_0x80a5('0xb2'),'attributes':['id','name','color'],'through':_0x486f71[_0x80a5('0x83')][_0x80a5('0xb1')]?{'attributes':[],'where':{'TagId':_0x486f71[_0x80a5('0x83')][_0x80a5('0xb1')]||undefined}}:{},'required':_0x486f71[_0x80a5('0x83')][_0x80a5('0xb1')]?!![]:![]}];}else{_0x2a650a[_0x80a5('0xae')]=[{'all':!![]}];}}return _0x378a94[_0x5e1ffe[_0x80a5('0x12')]][_0x80a5('0x6')](_0x2a650a);})[_0x80a5('0xa')](function(_0x5d5cf8){_0x453826['rows']=_0x5d5cf8;if(_0x5ea4d9===_0x80a5('0x2e')&&_0x486f71[_0x80a5('0x83')][_0x80a5('0xb3')]==='true'){var _0x581b91=[];for(var _0x47c9e0=0x0;_0x47c9e0<_0x453826['rows']['length'];_0x47c9e0++){_0x581b91[_0x80a5('0x88')](_0x2f99d0(_0x80a5('0xb4'),_0x453826[_0x80a5('0xb5')][_0x47c9e0][_0x80a5('0xb6')]));_0x581b91['push'](_0x2f99d0(_0x80a5('0xb7'),_0x453826[_0x80a5('0xb5')][_0x47c9e0][_0x80a5('0xb6')]));_0x581b91[_0x80a5('0x88')](_0x2f99d0('fax',_0x453826['rows'][_0x47c9e0][_0x80a5('0xb6')]));_0x581b91[_0x80a5('0x88')](_0x2f99d0(_0x80a5('0xb8'),_0x453826['rows'][_0x47c9e0][_0x80a5('0xb6')]));_0x581b91[_0x80a5('0x88')](_0x2f99d0('openchannel',_0x453826[_0x80a5('0xb5')][_0x47c9e0][_0x80a5('0xb6')]));_0x581b91[_0x80a5('0x88')](_0x2f99d0(_0x80a5('0xb9'),_0x453826[_0x80a5('0xb5')][_0x47c9e0][_0x80a5('0xb6')]));}return Promise['all'](_0x581b91)['then'](function(){return _0x453826;});}return _0x453826;});}});}}});}; \ No newline at end of file +var _0xbc0a=['forEach','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','color','tag','include','openTabs','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','models','field','filter','value','findAll','then','associatedResources','map','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','catch','childModel','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','contacts','CmContact','Lists','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','tags','Tag','templates','Template','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','AnalyticMetric','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','options','autoAssociation','includeAll'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xbc0a,0xd4));var _0xabc0=function(_0x5a9d13,_0x174908){_0x5a9d13=_0x5a9d13-0x0;var _0x2b971d=_0xbc0a[_0x5a9d13];return _0x2b971d;};'use strict';var _=require(_0xabc0('0x0'));var attributes=require(_0xabc0('0x1'));var squel=require('squel');module['exports']=function(_0xe5e0f){var _0x4d1cf0=_0xe5e0f[_0xabc0('0x2')];function _0x53cd28(_0x3d6332,_0x61f577){return new Promise(function(_0x2230d6,_0x200aaf){if(!_0x61f577)return _0x2230d6(null);var _0x81c60b=_0x61f577['filter']?{[_0x61f577['filter'][_0xabc0('0x3')]]:_0x61f577[_0xabc0('0x4')][_0xabc0('0x5')]}:undefined;return _0x4d1cf0[_0x3d6332][_0xabc0('0x6')]({'where':_0x81c60b,'raw':!![]})[_0xabc0('0x7')](function(_0xbc095c){_0x61f577[_0xabc0('0x8')]=_[_0xabc0('0x9')](_0xbc095c,'id');_0x2230d6(_0x61f577);})['catch'](function(_0x3c0f60){_0x200aaf(_0x3c0f60);});});}function _0x3016a8(_0x17fb56,_0x3e41b1){return new Promise(function(_0x2addcf,_0x17ca49){var _0x262784=_0x17fb56['filter']?{[_0x17fb56[_0xabc0('0x4')][_0xabc0('0x3')]]:_0x17fb56[_0xabc0('0x4')][_0xabc0('0x5')]}:undefined;return _0x4d1cf0[_0x17fb56[_0xabc0('0xa')]][_0xabc0('0x6')]({'where':_0x262784,'raw':!![]})[_0xabc0('0x7')](function(_0x4f3791){_0x3e41b1['associatedResources']=_[_0xabc0('0x9')](_0x4f3791,function(_0x4a3560){return _0x4a3560[_0xabc0('0xb')];});_0x2addcf(_0x3e41b1);})['catch'](function(_0x553d9d){_0x17ca49(_0x553d9d);});});}function _0x3d9343(_0xe4e9a0,_0x387821,_0x19147c){if(!_0x387821)return Promise[_0xabc0('0xc')](null);return new Promise(function(_0x4b5739,_0x2ecb06){return _0x4d1cf0[_0xabc0('0xd')][_0xabc0('0x6')]({'where':{'sectionId':_0x387821['id']},'raw':!![]})[_0xabc0('0x7')](function(_0x38d029){if(_0xe4e9a0['field']&&_0xe4e9a0[_0xabc0('0x3')]!=='id'){_0x387821[_0xabc0('0x8')]=_['map'](_0x38d029,function(_0x3e4ea1){return _0x3e4ea1[_0xe4e9a0['field']];});}else{if(_0x19147c===_0xabc0('0xe')){_0x387821[_0xabc0('0x8')]=_[_0xabc0('0x9')](_0x38d029,function(_0x2aadeb){return{'id':_0x2aadeb[_0xabc0('0xf')],'type':_0x2aadeb['type']};});}else{_0x387821[_0xabc0('0x8')]=_[_0xabc0('0x9')](_0x38d029,function(_0xc1cff1){return _0xc1cff1[_0xabc0('0xf')];});}}_0x4b5739(_0x387821);})[_0xabc0('0x10')](function(_0x4cc152){_0x2ecb06(_0x4cc152);});});}function _0x38df1d(_0x2318b4,_0x929c71){var _0x55812e={'parentSections':[]};switch(_0x2318b4['toLowerCase']()){case'squareprojects':_0x55812e[_0xabc0('0x11')]='SquareProject';break;case _0xabc0('0x12'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x13');break;case _0xabc0('0x14'):_0x55812e[_0xabc0('0x11')]='SquareRecording';_0x55812e[_0xabc0('0x15')]=[{'name':_0xabc0('0x16'),'field':_0xabc0('0xb'),'foreignKey':_0xabc0('0x17')}];break;case _0xabc0('0x18'):_0x55812e['childModel']='JscriptyProject';break;case _0xabc0('0x19'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x1a');_0x55812e[_0xabc0('0x15')]=[{'name':_0xabc0('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0xabc0('0x1c'):_0x55812e['childModel']=_0xabc0('0x1d');break;case'companies':_0x55812e[_0xabc0('0x11')]='CmCompany';break;case _0xabc0('0x1e'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x1f');break;case _0xabc0('0x20'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x21');break;case _0xabc0('0x22'):_0x55812e[_0xabc0('0x11')]='ChatWebsite';break;case'faxqueues':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x23');break;case _0xabc0('0x24'):_0x55812e[_0xabc0('0x11')]='FaxAccount';break;case _0xabc0('0x25'):case _0xabc0('0x26'):case _0xabc0('0x27'):_0x55812e['childModel']=_0xabc0('0x28');break;case _0xabc0('0x29'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x2a');break;case _0xabc0('0x2b'):_0x55812e[_0xabc0('0x11')]='VoiceMail';break;case _0xabc0('0x2c'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x2d');_0x55812e['parentSections']=[{'name':_0xabc0('0x2e'),'field':'name','foreignKey':_0xabc0('0x2f'),'model':_0xabc0('0x30'),'filter':{'field':_0xabc0('0x31'),'value':['agent']}},{'name':'Telephones','field':_0xabc0('0xb'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xabc0('0x32')]}},{'name':_0xabc0('0x33'),'field':_0xabc0('0xb'),'foreignKey':_0xabc0('0x34'),'model':_0xabc0('0x35'),'filter':{'field':_0xabc0('0x36'),'value':[_0xabc0('0x37')]}},{'name':_0xabc0('0x38'),'field':_0xabc0('0xb'),'foreignKey':_0xabc0('0x34'),'model':_0xabc0('0x35'),'filter':{'field':_0xabc0('0x36'),'value':[_0xabc0('0x39')]}}];break;case _0xabc0('0x3a'):_0x55812e[_0xabc0('0x11')]='VoiceMusicOnHold';break;case _0xabc0('0x3b'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x3c');break;case'voiceprefixes':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x3d');break;case'ivrcampaigns':_0x55812e['childModel']=_0xabc0('0x3e');break;case _0xabc0('0x3f'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x40');break;case _0xabc0('0x41'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x42');break;case _0xabc0('0x43'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x44');break;case _0xabc0('0x45'):_0x55812e[_0xabc0('0x11')]='OpenchannelQueue';break;case _0xabc0('0x46'):_0x55812e['childModel']=_0xabc0('0x47');break;case _0xabc0('0x48'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x49');break;case _0xabc0('0x4a'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x4b');break;case'whatsappqueues':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x4c');break;case _0xabc0('0x4d'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x4e');break;case _0xabc0('0x4f'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x50');break;case _0xabc0('0x51'):case _0xabc0('0x52'):_0x55812e['childModel']=_0xabc0('0x35');if(_0x929c71){_0x55812e[_0xabc0('0x15')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xabc0('0x53'):case _0xabc0('0x54'):case _0xabc0('0x55'):_0x55812e['childModel']=_0xabc0('0x30');if(_0x929c71){_0x55812e[_0xabc0('0x15')]=[{'name':_0xabc0('0x56'),'filter':{'field':_0xabc0('0x31'),'value':[_0xabc0('0x57'),_0xabc0('0x58')]},'ignore':!![]},{'name':_0xabc0('0x2e')},{'name':'Telephones'}];}break;case _0xabc0('0x59'):_0x55812e['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x55812e['childModel']=_0xabc0('0x5a');break;case _0xabc0('0x5b'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x5c');break;case'sugarcrmaccounts':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x5d');break;case _0xabc0('0x5e'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x5f');break;case _0xabc0('0x60'):_0x55812e['childModel']=_0xabc0('0x61');break;case _0xabc0('0x62'):_0x55812e['childModel']=_0xabc0('0x30');break;case _0xabc0('0x63'):_0x55812e[_0xabc0('0x11')]='CannedAnswer';break;case _0xabc0('0x64'):_0x55812e[_0xabc0('0x11')]='Disposition';break;case _0xabc0('0x65'):_0x55812e['childModel']=_0xabc0('0x66');break;case _0xabc0('0x67'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x68');break;case'pauses':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x69');break;case _0xabc0('0x6a'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x6b');break;case _0xabc0('0x6c'):_0x55812e[_0xabc0('0x11')]='Sound';break;case _0xabc0('0x6d'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x6e');break;case _0xabc0('0x6f'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x70');break;case'triggers':_0x55812e['childModel']='Trigger';break;case'trunks':_0x55812e[_0xabc0('0x11')]=_0xabc0('0x71');break;case _0xabc0('0x72'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x73');break;case _0xabc0('0x74'):_0x55812e[_0xabc0('0x11')]=_0xabc0('0x75');break;case _0xabc0('0x76'):_0x55812e['childModel']=_0xabc0('0xe');_0x55812e[_0xabc0('0x15')]=[{'name':'Reports','field':'id','foreignKey':_0xabc0('0x77')}];break;case'metrics':_0x55812e['childModel']=_0xabc0('0x78');break;}return _0x55812e;}function _0x2ec5cd(_0x58fa77,_0x27b045){var _0x45a2f0=_0x58fa77['charAt'](0x0)['toUpperCase']()+_0x58fa77['slice'](0x1);var _0x482345={'type':_0x4d1cf0[_0xabc0('0x79')][_0xabc0('0x7a')]['SELECT'],'raw':!![]};return new Promise(function(_0x1252be,_0x335729){var _0x5b848f=squel[_0xabc0('0x7b')]()[_0xabc0('0x3')](_0xabc0('0x7c')+_0x45a2f0+_0xabc0('0x7d'),'id')[_0xabc0('0x3')](_0xabc0('0x7e'))[_0xabc0('0x7f')]('user_has_'+_0x58fa77+'_interactions','ui')[_0xabc0('0x80')](_0xabc0('0x81'),_0x27b045['id']);return _0x4d1cf0[_0xabc0('0x82')][_0xabc0('0x83')](_0x5b848f[_0xabc0('0x84')](),_0x482345)['then'](function(_0x4347a5){_0x27b045[_0x45a2f0+_0xabc0('0x85')]=_0x4347a5;_0x1252be(_0x4347a5);})['catch'](function(_0x14afc6){_0x335729(_0x14afc6);});});}return _0xe5e0f[_0xabc0('0x86')](_0xabc0('0x87'),attributes,{'tableName':_0xabc0('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x45c5a4){var _0xa6863c=require(_0xabc0('0x89'));var _0x583c20={'raw':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x8a')],'where':{}};var _0x532777={};var _0x4391b0={'count':0x0,'rows':[]};var _0x5de4f3=_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x8b')];var _0x4745ce=_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x8c')]||![];var _0x2ffc2a=_0x38df1d(_0x5de4f3,_0x4745ce);if(!_0x2ffc2a[_0xabc0('0x11')])throw new Error(_0xabc0('0x8d')+_0x5de4f3+'\x27');var _0x111857=[{'name':_0x5de4f3}];if(!_[_0xabc0('0x8e')](_0x2ffc2a['parentSections']))_0x111857=_0x2ffc2a['parentSections'];var _0x4953ad=[];for(var _0xfdb9aa=0x0;_0xfdb9aa<_0x111857[_0xabc0('0x8f')];_0xfdb9aa++){_0x4953ad[_0xabc0('0x90')](_0x4d1cf0[_0xabc0('0x91')][_0xabc0('0x92')]({'where':{'userProfileId':_0x45c5a4[_0xabc0('0x93')]['id'],'name':_0x111857[_0xfdb9aa][_0xabc0('0xb')]},'raw':!![]}));}return Promise[_0xabc0('0x94')](_0x4953ad)[_0xabc0('0x7')](function(_0x2a19e0){var _0x2efbb0=_[_0xabc0('0x4')](_0x2a19e0,function(_0x3843e2){return _0x3843e2?_0x3843e2:undefined;});var _0x36caf2=_[_0xabc0('0x4')](_0x111857,[_0xabc0('0x95'),!![]]);var _0x229cf1=_[_0xabc0('0x8e')](_0x2efbb0)&&_[_0xabc0('0x8e')](_0x36caf2)?null:_[_0xabc0('0x96')](_0x36caf2,_0x2efbb0);if(!_0x229cf1)return null;var _0x261412=[];for(var _0x121228=0x0;_0x121228<_0x229cf1[_0xabc0('0x8f')];_0x121228++){var _0x52be55=_['find'](_0x111857,function(_0x182dec){return _0x229cf1[_0x121228]?_0x182dec[_0xabc0('0xb')]===_0x229cf1[_0x121228][_0xabc0('0xb')]:null;});if(_0x52be55){if(_0x229cf1[_0x121228][_0xabc0('0x95')]){_0x261412['push'](_0x53cd28(_0x2ffc2a['childModel'],_0x229cf1[_0x121228]));}else{if(!_0x229cf1[_0x121228]['autoAssociation']){_0x261412[_0xabc0('0x90')](_0x3d9343(_0x52be55,_0x229cf1[_0x121228],_0x2ffc2a[_0xabc0('0x11')]));}else{if(_0x52be55['model']){_0x261412[_0xabc0('0x90')](_0x3016a8(_0x52be55,_0x229cf1[_0x121228]));}}}}}return Promise[_0xabc0('0x94')](_0x261412);})['then'](function(_0x2ca6d4){var _0x3cc544=_0x2ca6d4;var _0xcf6a4d=null;if(_0x3cc544){_0xcf6a4d=_0x3cc544['length']===0x1?_0x3cc544[0x0]:null;}if(!_0xcf6a4d&&!_0x3cc544)return _0x4391b0;var _0x32d696=_0x4d1cf0[_0x2ffc2a['childModel']][_0xabc0('0x97')];_0x532777[_0xabc0('0xa')]=_['keys'](_0x32d696);_0x532777['query']=_[_0xabc0('0x98')](_0x45c5a4[_0xabc0('0x83')]);_0x532777[_0xabc0('0x99')]=_[_0xabc0('0x9a')](_0x532777['model'],_0x532777[_0xabc0('0x83')]);_0x583c20['attributes']=_['intersection'](_0x532777['model'],_0xa6863c['fields'](_0x45c5a4['query'][_0xabc0('0x9b')]));_0x583c20[_0xabc0('0x9c')]=_0x583c20[_0xabc0('0x9c')][_0xabc0('0x8f')]?_0x583c20[_0xabc0('0x9c')]:_0x532777[_0xabc0('0xa')];if(!_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x9d')](_0xabc0('0x9e'))){_0x583c20['limit']=_0xa6863c['limit'](_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x9f')]);_0x583c20['offset']=_0xa6863c[_0xabc0('0xa0')](_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xa0')]);}_0x583c20[_0xabc0('0xa1')]=_0xa6863c[_0xabc0('0xa2')](_0x45c5a4['query']['sort']);_0x583c20[_0xabc0('0x80')]=_0xa6863c[_0xabc0('0x99')](_[_0xabc0('0xa3')](_0x45c5a4[_0xabc0('0x83')],_0x532777[_0xabc0('0x99')]));if(_0x45c5a4['query'][_0xabc0('0x4')]){_0x583c20['where']=_[_0xabc0('0xa4')](_0x583c20[_0xabc0('0x80')],{'$or':_[_0xabc0('0x9')](_0x32d696,function(_0x242720){if(_0x242720[_0xabc0('0x36')][_0xabc0('0xa5')]!=='VIRTUAL'){var _0x4d70c4={};_0x4d70c4[_0x242720[_0xabc0('0x3')]]={'$like':'%'+_0x45c5a4[_0xabc0('0x83')][_0xabc0('0x4')]+'%'};return _0x4d70c4;}})});}var _0x47c3ef=[];var _0x5735af=null;var _0x9e7665={};if(_0xcf6a4d){_0x5735af=_['find'](_0x111857,[_0xabc0('0xb'),_0xcf6a4d[_0xabc0('0xb')]]);if(_0x5735af[_0xabc0('0x3')]){_0x9e7665={};if(_0x2ffc2a[_0xabc0('0x11')]===_0xabc0('0xe')){_0x9e7665[_0x5735af[_0xabc0('0xa6')]]=_[_0xabc0('0x9')](_0xcf6a4d[_0xabc0('0x8')],'id');}else{_0x9e7665[_0x5735af['foreignKey']]=_0xcf6a4d[_0xabc0('0x8')];}_0x47c3ef[_0xabc0('0x90')](_0x9e7665);}else{_0x583c20['where']['id']=_0xcf6a4d[_0xabc0('0x8')];}}else{for(var _0x66c53d=0x0;_0x66c53d<_0x3cc544[_0xabc0('0x8f')];_0x66c53d++){_0x5735af=_[_0xabc0('0x92')](_0x111857,[_0xabc0('0xb'),_0x3cc544[_0x66c53d]['name']]);if(_0x5735af[_0xabc0('0x3')]){_0x9e7665={};_0x9e7665[_0x5735af[_0xabc0('0xa6')]]=_0x3cc544[_0x66c53d]['associatedResources'];_0x47c3ef['push'](_0x9e7665);}else{if(!_0x583c20['where']['id'])_0x583c20[_0xabc0('0x80')]['id']=[];_0x3cc544[_0x66c53d][_0xabc0('0x8')]['forEach'](function(_0x2c647b){_0x583c20['where']['id']['push'](_0x2c647b);});}}}if(!_[_0xabc0('0x8e')](_0x47c3ef)){_0x583c20[_0xabc0('0x80')]=_['merge'](_0x583c20['where'],{'$and':{'$or':_0x47c3ef}});}_0x583c20=_[_0xabc0('0xa4')]({},_0x583c20,_0x45c5a4[_0xabc0('0xa7')]);if(_0xcf6a4d&&!_0xcf6a4d[_0xabc0('0xa8')]&&_0x2ffc2a['childModel']===_0xabc0('0xe')){if(_0x45c5a4['query'][_0xabc0('0xa9')]){_0x583c20['include']=[{'all':!![]}];}return _0x4d1cf0[_0x2ffc2a['childModel']]['findAll'](_0x583c20)[_0xabc0('0x7')](function(_0xe5b937){var _0x546721=[];_0xe5b937[_0xabc0('0xaa')](function(_0x1160c6){var _0x597cdc;switch(_0x1160c6['reportType']){case _0xabc0('0xab'):_0x597cdc=_['find'](_0xcf6a4d[_0xabc0('0x8')],function(_0x2ac5dd){return _0x2ac5dd['id']===_0x1160c6[_0xabc0('0x77')]&&_0x2ac5dd[_0xabc0('0x36')]===_0xabc0('0xac');});break;case _0xabc0('0xad'):_0x597cdc=_[_0xabc0('0x92')](_0xcf6a4d['associatedResources'],function(_0x37f42b){return _0x37f42b['id']===_0x1160c6['reportId']&&_0x37f42b[_0xabc0('0x36')]===_0xabc0('0xae');});break;}if(_0x597cdc)_0x546721[_0xabc0('0x90')](_0x1160c6);});_0x4391b0['count']=_0x546721[_0xabc0('0x8f')];_0x4391b0[_0xabc0('0xaf')]=_0x546721;return _0x4391b0;});}else{if(!_[_0xabc0('0x8e')](_0x45c5a4['query']['ids'])){_0x583c20[_0xabc0('0x80')]['id']=_0x583c20[_0xabc0('0x80')]['id']?_[_0xabc0('0x9a')](_0x583c20[_0xabc0('0x80')]['id'],_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb0')]):_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb0')];if(_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb1')]){_0x583c20[_0xabc0('0xa1')]=_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb1')];}}if(_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb2')]){_0x583c20[_0xabc0('0x80')]=_['merge'](_0x583c20[_0xabc0('0x80')],{'$and':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb2')]});}return _0x4d1cf0[_0x2ffc2a['childModel']][_0xabc0('0xb3')]({'where':_0x583c20['where']})[_0xabc0('0x7')](function(_0x3cb430){_0x4391b0[_0xabc0('0xb3')]=_0x3cb430;if(_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xa9')]){if(_0x2ffc2a['childModel']===_0xabc0('0x1a')){_0x583c20['include']=[{'model':_0x4d1cf0['Tag'],'as':'Tags','attributes':['id','name',_0xabc0('0xb4')],'required':_0x45c5a4[_0xabc0('0x83')]['tag']?!![]:![]},{'model':_0x4d1cf0[_0xabc0('0x6e')],'as':'ThroughTags','attributes':['id','name',_0xabc0('0xb4')],'through':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb5')]?{'attributes':[],'where':{'TagId':_0x45c5a4[_0xabc0('0x83')][_0xabc0('0xb5')]||undefined}}:{},'required':_0x45c5a4[_0xabc0('0x83')]['tag']?!![]:![]}];}else{_0x583c20[_0xabc0('0xb6')]=[{'all':!![]}];}}return _0x4d1cf0[_0x2ffc2a[_0xabc0('0x11')]][_0xabc0('0x6')](_0x583c20);})['then'](function(_0x419086){_0x4391b0[_0xabc0('0xaf')]=_0x419086;if(_0x5de4f3===_0xabc0('0x2e')&&_0x45c5a4['query'][_0xabc0('0xb7')]==='true'){var _0x25adad=[];for(var _0x16530a=0x0;_0x16530a<_0x4391b0['rows'][_0xabc0('0x8f')];_0x16530a++){_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xb8'),_0x4391b0['rows'][_0x16530a][_0xabc0('0xb9')]));_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xba'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));_0x25adad['push'](_0x2ec5cd(_0xabc0('0xbb'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xbc'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));_0x25adad[_0xabc0('0x90')](_0x2ec5cd(_0xabc0('0xbd'),_0x4391b0['rows'][_0x16530a][_0xabc0('0xb9')]));_0x25adad['push'](_0x2ec5cd(_0xabc0('0xbe'),_0x4391b0[_0xabc0('0xaf')][_0x16530a][_0xabc0('0xb9')]));}return Promise[_0xabc0('0x94')](_0x25adad)['then'](function(){return _0x4391b0;});}return _0x4391b0;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 45be788..81e3252 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 _0xd86a=['error','message','result','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd86a,0xf3));var _0xad86=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xd86a[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0xad86('0x0'));var util=require(_0xad86('0x1'));var moment=require(_0xad86('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad86('0x3'));var db=require(_0xad86('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad86('0x5'));var config=require(_0xad86('0x6'));var jayson=require(_0xad86('0x7'));var client=jayson[_0xad86('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xad86('0x9')],{'host':_0xad86('0xa'),'port':0x18eb});var socket=require(_0xad86('0xb'))(new Redis(config[_0xad86('0x9')]));require(_0xad86('0xc'))[_0xad86('0xd')](socket);function respondWithRpcPromise(_0x3ff5c2,_0x58a7cc,_0x2f446f){return new BPromise(function(_0x382632,_0x378249){return client[_0xad86('0xe')](_0x3ff5c2,_0x2f446f)[_0xad86('0xf')](function(_0x5c87b4){logger[_0xad86('0x10')](_0xad86('0x11'),_0x58a7cc,'request\x20sent');logger[_0xad86('0x12')](_0xad86('0x13'),_0x58a7cc,'request\x20sent',JSON[_0xad86('0x14')](_0x5c87b4));if(_0x5c87b4['error']){if(_0x5c87b4[_0xad86('0x15')]['code']===0x1f4){logger[_0xad86('0x15')](_0xad86('0x11'),_0x58a7cc,_0x5c87b4['error'][_0xad86('0x16')]);return _0x378249(_0x5c87b4[_0xad86('0x15')]['message']);}logger[_0xad86('0x15')](_0xad86('0x11'),_0x58a7cc,_0x5c87b4[_0xad86('0x15')][_0xad86('0x16')]);return _0x382632(_0x5c87b4[_0xad86('0x15')][_0xad86('0x16')]);}else{logger[_0xad86('0x10')](_0xad86('0x11'),_0x58a7cc,'request\x20sent');_0x382632(_0x5c87b4[_0xad86('0x17')][_0xad86('0x16')]);}})['catch'](function(_0xe55083){logger['error']('UserProfile,\x20%s,\x20%s',_0x58a7cc,_0xe55083);_0x378249(_0xe55083);});});} \ No newline at end of file +var _0xc9c3=['socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost'];(function(_0x58dfe4,_0x42f5dd){var _0x2012a8=function(_0x234e52){while(--_0x234e52){_0x58dfe4['push'](_0x58dfe4['shift']());}};_0x2012a8(++_0x42f5dd);}(_0xc9c3,0x96));var _0x3c9c=function(_0x407b6e,_0x3992c5){_0x407b6e=_0x407b6e-0x0;var _0x4d3f84=_0xc9c3[_0x407b6e];return _0x4d3f84;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c9c('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c9c('0x1'));var fs=require('fs');var Redis=require(_0x3c9c('0x2'));var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var config=require(_0x3c9c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x3c9c('0x8')]=_[_0x3c9c('0x9')](config[_0x3c9c('0x8')],{'host':_0x3c9c('0xa'),'port':0x18eb});var socket=require(_0x3c9c('0xb'))(new Redis(config[_0x3c9c('0x8')]));require(_0x3c9c('0xc'))[_0x3c9c('0xd')](socket);function respondWithRpcPromise(_0x2be851,_0x28a59f,_0x50bdd1){return new BPromise(function(_0x20ed5c,_0xc45f8b){return client['request'](_0x2be851,_0x50bdd1)[_0x3c9c('0xe')](function(_0x4c6969){logger[_0x3c9c('0xf')](_0x3c9c('0x10'),_0x28a59f,_0x3c9c('0x11'));logger[_0x3c9c('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x28a59f,'request\x20sent',JSON['stringify'](_0x4c6969));if(_0x4c6969[_0x3c9c('0x13')]){if(_0x4c6969['error']['code']===0x1f4){logger['error'](_0x3c9c('0x10'),_0x28a59f,_0x4c6969['error'][_0x3c9c('0x14')]);return _0xc45f8b(_0x4c6969[_0x3c9c('0x13')][_0x3c9c('0x14')]);}logger[_0x3c9c('0x13')]('UserProfile,\x20%s,\x20%s',_0x28a59f,_0x4c6969[_0x3c9c('0x13')]['message']);return _0x20ed5c(_0x4c6969['error']['message']);}else{logger[_0x3c9c('0xf')](_0x3c9c('0x10'),_0x28a59f,_0x3c9c('0x11'));_0x20ed5c(_0x4c6969[_0x3c9c('0x15')][_0x3c9c('0x14')]);}})[_0x3c9c('0x16')](function(_0x319f19){logger['error'](_0x3c9c('0x10'),_0x28a59f,_0x319f19);_0xc45f8b(_0x319f19);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 2968b89..ead9ae3 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 _0x9f15=['emit','register','length','userProfile:','save','remove','update'];(function(_0x29ee0e,_0x1c4708){var _0x515090=function(_0x1a9ad9){while(--_0x1a9ad9){_0x29ee0e['push'](_0x29ee0e['shift']());}};_0x515090(++_0x1c4708);}(_0x9f15,0x138));var _0x59f1=function(_0x1c4c1a,_0x1e4d6b){_0x1c4c1a=_0x1c4c1a-0x0;var _0x434002=_0x9f15[_0x1c4c1a];return _0x434002;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x59f1('0x0'),_0x59f1('0x1'),_0x59f1('0x2')];function createListener(_0x25c386,_0x3014cb){return function(_0x3512f8){_0x3014cb[_0x59f1('0x3')](_0x25c386,_0x3512f8);};}function removeListener(_0x4a757b,_0x2bae8a){return function(){UserProfileEvents['removeListener'](_0x4a757b,_0x2bae8a);};}exports[_0x59f1('0x4')]=function(_0x44d6a9){for(var _0x5308a7=0x0,_0x1fe5ac=events[_0x59f1('0x5')];_0x5308a7<_0x1fe5ac;_0x5308a7++){var _0x1e3b78=events[_0x5308a7];var _0x4cd13b=createListener(_0x59f1('0x6')+_0x1e3b78,_0x44d6a9);UserProfileEvents['on'](_0x1e3b78,_0x4cd13b);}}; \ No newline at end of file +var _0x34e9=['./userProfile.events','save','remove','length','userProfile:'];(function(_0x360739,_0x2ec1b2){var _0x3e23a1=function(_0x105b37){while(--_0x105b37){_0x360739['push'](_0x360739['shift']());}};_0x3e23a1(++_0x2ec1b2);}(_0x34e9,0x1c7));var _0x934e=function(_0x1e2e85,_0x2a7d81){_0x1e2e85=_0x1e2e85-0x0;var _0x213858=_0x34e9[_0x1e2e85];return _0x213858;};'use strict';var UserProfileEvents=require(_0x934e('0x0'));var events=[_0x934e('0x1'),_0x934e('0x2'),'update'];function createListener(_0x874af9,_0x2abbce){return function(_0x3c46aa){_0x2abbce['emit'](_0x874af9,_0x3c46aa);};}function removeListener(_0x365ab5,_0x2b7235){return function(){UserProfileEvents['removeListener'](_0x365ab5,_0x2b7235);};}exports['register']=function(_0x2ea6ad){for(var _0x5cedd2=0x0,_0x47b981=events[_0x934e('0x3')];_0x5cedd2<_0x47b981;_0x5cedd2++){var _0x3afb0c=events[_0x5cedd2];var _0x2cdb2d=createListener(_0x934e('0x4')+_0x3afb0c,_0x2ea6ad);UserProfileEvents['on'](_0x3afb0c,_0x2cdb2d);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index aed9256..77f323f 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 _0x3bce=['./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31c6b9,_0x184dbd){var _0x2f25f5=function(_0x3b2d23){while(--_0x3b2d23){_0x31c6b9['push'](_0x31c6b9['shift']());}};_0x2f25f5(++_0x184dbd);}(_0x3bce,0x1c7));var _0xe3bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3bce[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xe3bc('0x0'));var util=require(_0xe3bc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe3bc('0x2'));var router=express['Router']();var fs_extra=require(_0xe3bc('0x3'));var auth=require(_0xe3bc('0x4'));var interaction=require(_0xe3bc('0x5'));var config=require(_0xe3bc('0x6'));var controller=require(_0xe3bc('0x7'));router[_0xe3bc('0x8')]('/',auth[_0xe3bc('0x9')](),controller[_0xe3bc('0xa')]);router[_0xe3bc('0x8')](_0xe3bc('0xb'),auth[_0xe3bc('0x9')](),controller[_0xe3bc('0xc')]);router[_0xe3bc('0x8')](_0xe3bc('0xd'),auth[_0xe3bc('0x9')](),controller[_0xe3bc('0xe')]);router[_0xe3bc('0xf')]('/',auth['isAuthenticated'](),controller[_0xe3bc('0x10')]);router[_0xe3bc('0x11')]('/:id',auth[_0xe3bc('0x9')](),controller[_0xe3bc('0x12')]);router['delete'](_0xe3bc('0xd'),auth['isAuthenticated'](),controller[_0xe3bc('0x13')]);module[_0xe3bc('0x14')]=router; \ No newline at end of file +var _0xdc52=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','Router'];(function(_0x5499ce,_0x3908fe){var _0xb9a0c2=function(_0x261d0b){while(--_0x261d0b){_0x5499ce['push'](_0x5499ce['shift']());}};_0xb9a0c2(++_0x3908fe);}(_0xdc52,0x13f));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dc5('0x0'));var util=require(_0x2dc5('0x1'));var path=require('path');var timeout=require(_0x2dc5('0x2'));var express=require('express');var router=express[_0x2dc5('0x3')]();var fs_extra=require(_0x2dc5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2dc5('0x5'));var config=require(_0x2dc5('0x6'));var controller=require(_0x2dc5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2dc5('0x8')]);router['get']('/describe',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0xa')]);router[_0x2dc5('0xb')](_0x2dc5('0xc'),auth['isAuthenticated'](),controller[_0x2dc5('0xd')]);router[_0x2dc5('0xe')]('/',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0xf')]);router[_0x2dc5('0x10')]('/:id',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0x11')]);router[_0x2dc5('0x12')](_0x2dc5('0xc'),auth[_0x2dc5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d1f672e..b89c31c 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 _0xfe56=['INTEGER','STRING'];(function(_0x5196bf,_0x343c22){var _0x5ba1dd=function(_0xdb7756){while(--_0xdb7756){_0x5196bf['push'](_0x5196bf['shift']());}};_0x5ba1dd(++_0x343c22);}(_0xfe56,0xf7));var _0x6fe5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe56[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6fe5('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6fe5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6fe5('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x258f=['INTEGER','STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x258f,0x1aa));var _0xf258=function(_0x3018f0,_0x3c0ef1){_0x3018f0=_0x3018f0-0x0;var _0x2c77b0=_0x258f[_0x3018f0];return _0x2c77b0;};'use strict';var Sequelize=require(_0xf258('0x0'));module[_0xf258('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf258('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf258('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6f02d2f..4a09802 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 _0x5fab=['../../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','UserProfileResource','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','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5fab,0x177));var _0xb5fa=function(_0x45262e,_0x1d9c0b){_0x45262e=_0x45262e-0x0;var _0x3b7f60=_0x5fab[_0x45262e];return _0x3b7f60;};'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['UserProfileResource'][_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['UserProfileResource'][_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));};exports[_0xb5fa('0x4e')]=function(_0x130a0d,_0x4dea87){return db['UserProfileResource'][_0xb5fa('0x4e')]()[_0xb5fa('0x43')](respondWithResult(_0x4dea87,null))[_0xb5fa('0x4b')](handleError(_0x4dea87,null));}; \ No newline at end of file +var _0x6d38=['findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','describe','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','UserProfileResource','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'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['UserProfileResource'][_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')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));};exports['describe']=function(_0x5bedc6,_0x159253){return db[_0x86d3('0x26')][_0x86d3('0x44')]()[_0x86d3('0x20')](respondWithResult(_0x159253,null))[_0x86d3('0x40')](handleError(_0x159253,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 5997005..f51e1dd 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 _0x3511=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','api'];(function(_0x304080,_0x227ad3){var _0x50adaf=function(_0x5f0150){while(--_0x5f0150){_0x304080['push'](_0x304080['shift']());}};_0x50adaf(++_0x227ad3);}(_0x3511,0x1cf));var _0x1351=function(_0x41094d,_0x4ca21d){_0x41094d=_0x41094d-0x0;var _0x503ee1=_0x3511[_0x41094d];return _0x503ee1;};'use strict';var _=require('lodash');var util=require(_0x1351('0x0'));var logger=require('../../config/logger')(_0x1351('0x1'));var moment=require('moment');var BPromise=require(_0x1351('0x2'));var rp=require(_0x1351('0x3'));var fs=require('fs');var path=require(_0x1351('0x4'));var rimraf=require(_0x1351('0x5'));var config=require(_0x1351('0x6'));var attributes=require(_0x1351('0x7'));module[_0x1351('0x8')]=function(_0x365375,_0xf26911){return _0x365375[_0x1351('0x9')](_0x1351('0xa'),attributes,{'tableName':_0x1351('0xb'),'paranoid':![],'indexes':[{'name':_0x1351('0xc'),'fields':[_0x1351('0xd'),_0x1351('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bef=['../../config/logger','api','bluebird','request-promise','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util'];(function(_0x278883,_0x18bfdb){var _0x271154=function(_0x28cbe){while(--_0x28cbe){_0x278883['push'](_0x278883['shift']());}};_0x271154(++_0x18bfdb);}(_0x5bef,0xa6));var _0xf5be=function(_0x3b9983,_0x3207d7){_0x3b9983=_0x3b9983-0x0;var _0x127661=_0x5bef[_0x3b9983];return _0x127661;};'use strict';var _=require(_0xf5be('0x0'));var util=require(_0xf5be('0x1'));var logger=require(_0xf5be('0x2'))(_0xf5be('0x3'));var moment=require('moment');var BPromise=require(_0xf5be('0x4'));var rp=require(_0xf5be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5be('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5be('0x7'));module[_0xf5be('0x8')]=function(_0x3a0dd3,_0x2478d7){return _0x3a0dd3[_0xf5be('0x9')](_0xf5be('0xa'),attributes,{'tableName':_0xf5be('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf5be('0xc'),_0xf5be('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 09f1108..938d993 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 _0x7d3c=['info','request\x20sent','stringify','error','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then'];(function(_0x2e9ec2,_0x4fed4c){var _0x293502=function(_0x43e2ac){while(--_0x43e2ac){_0x2e9ec2['push'](_0x2e9ec2['shift']());}};_0x293502(++_0x4fed4c);}(_0x7d3c,0xa0));var _0xc7d3=function(_0x2a648e,_0x4b4d03){_0x2a648e=_0x2a648e-0x0;var _0x4dbd5e=_0x7d3c[_0x2a648e];return _0x4dbd5e;};'use strict';var _=require(_0xc7d3('0x0'));var util=require('util');var moment=require(_0xc7d3('0x1'));var BPromise=require(_0xc7d3('0x2'));var rs=require(_0xc7d3('0x3'));var fs=require('fs');var Redis=require(_0xc7d3('0x4'));var db=require(_0xc7d3('0x5'))['db'];var utils=require(_0xc7d3('0x6'));var logger=require(_0xc7d3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc7d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dd7bf,_0x523bab,_0x137c21){return new BPromise(function(_0x5b768a,_0x4001e7){return client[_0xc7d3('0x9')](_0x4dd7bf,_0x137c21)[_0xc7d3('0xa')](function(_0x38b146){logger[_0xc7d3('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x523bab,_0xc7d3('0xc'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x523bab,'request\x20sent',JSON[_0xc7d3('0xd')](_0x38b146));if(_0x38b146['error']){if(_0x38b146[_0xc7d3('0xe')]['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x523bab,_0x38b146['error'][_0xc7d3('0xf')]);return _0x4001e7(_0x38b146[_0xc7d3('0xe')][_0xc7d3('0xf')]);}logger[_0xc7d3('0xe')](_0xc7d3('0x10'),_0x523bab,_0x38b146[_0xc7d3('0xe')][_0xc7d3('0xf')]);return _0x5b768a(_0x38b146[_0xc7d3('0xe')][_0xc7d3('0xf')]);}else{logger[_0xc7d3('0xb')](_0xc7d3('0x10'),_0x523bab,_0xc7d3('0xc'));_0x5b768a(_0x38b146[_0xc7d3('0x11')][_0xc7d3('0xf')]);}})[_0xc7d3('0x12')](function(_0x18f29e){logger[_0xc7d3('0xe')](_0xc7d3('0x10'),_0x523bab,_0x18f29e);_0x4001e7(_0x18f29e);});});} \ No newline at end of file +var _0xc1f2=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x1e01e9,_0x27e242){var _0x3b9ccc=function(_0x2fb6db){while(--_0x2fb6db){_0x1e01e9['push'](_0x1e01e9['shift']());}};_0x3b9ccc(++_0x27e242);}(_0xc1f2,0x151));var _0x2c1f=function(_0x146c70,_0x35ead0){_0x146c70=_0x146c70-0x0;var _0xf38687=_0xc1f2[_0x146c70];return _0xf38687;};'use strict';var _=require(_0x2c1f('0x0'));var util=require(_0x2c1f('0x1'));var moment=require(_0x2c1f('0x2'));var BPromise=require(_0x2c1f('0x3'));var rs=require(_0x2c1f('0x4'));var fs=require('fs');var Redis=require(_0x2c1f('0x5'));var db=require(_0x2c1f('0x6'))['db'];var utils=require(_0x2c1f('0x7'));var logger=require(_0x2c1f('0x8'))('rpc');var config=require(_0x2c1f('0x9'));var jayson=require(_0x2c1f('0xa'));var client=jayson['client'][_0x2c1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e6c1d,_0x28d933,_0x13a419){return new BPromise(function(_0x4d669d,_0x18eb9d){return client[_0x2c1f('0xc')](_0x5e6c1d,_0x13a419)[_0x2c1f('0xd')](function(_0x2b608e){logger[_0x2c1f('0xe')](_0x2c1f('0xf'),_0x28d933,_0x2c1f('0x10'));logger[_0x2c1f('0x11')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x28d933,'request\x20sent',JSON['stringify'](_0x2b608e));if(_0x2b608e[_0x2c1f('0x12')]){if(_0x2b608e[_0x2c1f('0x12')][_0x2c1f('0x13')]===0x1f4){logger[_0x2c1f('0x12')](_0x2c1f('0xf'),_0x28d933,_0x2b608e[_0x2c1f('0x12')][_0x2c1f('0x14')]);return _0x18eb9d(_0x2b608e[_0x2c1f('0x12')]['message']);}logger[_0x2c1f('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x28d933,_0x2b608e[_0x2c1f('0x12')][_0x2c1f('0x14')]);return _0x4d669d(_0x2b608e[_0x2c1f('0x12')]['message']);}else{logger[_0x2c1f('0xe')](_0x2c1f('0xf'),_0x28d933,'request\x20sent');_0x4d669d(_0x2b608e['result'][_0x2c1f('0x14')]);}})['catch'](function(_0x104ed4){logger[_0x2c1f('0x12')](_0x2c1f('0xf'),_0x28d933,_0x104ed4);_0x18eb9d(_0x104ed4);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 339ed5c..1570af9 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 _0x553d=['isAuthenticated','create','put','update','destroy','multer','util','path','express','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','describe','/:id','show'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x553d,0x6b));var _0xd553=function(_0x43446e,_0x459ab0){_0x43446e=_0x43446e-0x0;var _0x2d0f30=_0x553d[_0x43446e];return _0x2d0f30;};'use strict';var multer=require(_0xd553('0x0'));var util=require(_0xd553('0x1'));var path=require(_0xd553('0x2'));var timeout=require('connect-timeout');var express=require(_0xd553('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd553('0x4'));var config=require(_0xd553('0x5'));var controller=require(_0xd553('0x6'));router[_0xd553('0x7')]('/',auth['isAuthenticated'](),controller[_0xd553('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd553('0x9')]);router[_0xd553('0x7')](_0xd553('0xa'),auth['isAuthenticated'](),controller[_0xd553('0xb')]);router['post']('/',auth[_0xd553('0xc')](),controller[_0xd553('0xd')]);router[_0xd553('0xe')](_0xd553('0xa'),auth[_0xd553('0xc')](),controller[_0xd553('0xf')]);router['delete']('/:id',auth[_0xd553('0xc')](),controller[_0xd553('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2205=['post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','show'];(function(_0x3e1599,_0x128519){var _0x3a079b=function(_0x123f85){while(--_0x123f85){_0x3e1599['push'](_0x3e1599['shift']());}};_0x3a079b(++_0x128519);}(_0x2205,0x193));var _0x5220=function(_0x5e4cae,_0x232c74){_0x5e4cae=_0x5e4cae-0x0;var _0x364835=_0x2205[_0x5e4cae];return _0x364835;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5220('0x0'));var timeout=require(_0x5220('0x1'));var express=require(_0x5220('0x2'));var router=express[_0x5220('0x3')]();var fs_extra=require(_0x5220('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5220('0x5'));var config=require(_0x5220('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x5220('0x7')](),controller[_0x5220('0x8')]);router['get']('/describe',auth[_0x5220('0x7')](),controller[_0x5220('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5220('0xa')]);router[_0x5220('0xb')]('/',auth[_0x5220('0x7')](),controller['create']);router[_0x5220('0xc')](_0x5220('0xd'),auth[_0x5220('0x7')](),controller[_0x5220('0xe')]);router[_0x5220('0xf')](_0x5220('0xd'),auth['isAuthenticated'](),controller[_0x5220('0x10')]);module[_0x5220('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 89d439f..5ce9ac0 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(_0x480c3a,_0xb806e3){var _0x2678bf=function(_0x53a7fc){while(--_0x53a7fc){_0x480c3a['push'](_0x480c3a['shift']());}};_0x2678bf(++_0xb806e3);}(_0xeb74,0xe3));var _0x4eb7=function(_0x5a1352,_0x4b4ede){_0x5a1352=_0x5a1352-0x0;var _0x105548=_0xeb74[_0x5a1352];return _0x105548;};'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 _0x351d=['sequelize','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x153a54,_0x30a7cd){var _0x564261=function(_0x1b2ec1){while(--_0x1b2ec1){_0x153a54['push'](_0x153a54['shift']());}};_0x564261(++_0x30a7cd);}(_0x351d,0x90));var _0xd351=function(_0x59562b,_0x417d03){_0x59562b=_0x59562b-0x0;var _0x29427b=_0x351d[_0x59562b];return _0x29427b;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'name':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd351('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd351('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41d16d){this[_0xd351('0x4')]('crudPermissions',_0x41d16d?_0x41d16d[_0xd351('0x5')](''):[]);},'get':function(){return this[_0xd351('0x6')](_0xd351('0x7'))?this['getDataValue'](_0xd351('0x7'))[_0xd351('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6469751..ef271dc 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 _0x8588=['where','merge','options','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','name','index','map','UserProfileSection','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x4b7ca8,_0x47eb40){var _0x1a3c96=function(_0x352486){while(--_0x352486){_0x4b7ca8['push'](_0x4b7ca8['shift']());}};_0x1a3c96(++_0x47eb40);}(_0x8588,0x134));var _0x8858=function(_0x2a5c15,_0x32104f){_0x2a5c15=_0x2a5c15-0x0;var _0xbdf9b7=_0x8588[_0x2a5c15];return _0xbdf9b7;};'use strict';var emlformat=require(_0x8858('0x0'));var rimraf=require(_0x8858('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8858('0x2'));var rp=require(_0x8858('0x3'));var moment=require('moment');var BPromise=require(_0x8858('0x4'));var Mustache=require(_0x8858('0x5'));var util=require(_0x8858('0x6'));var path=require(_0x8858('0x7'));var sox=require(_0x8858('0x8'));var csv=require('to-csv');var ejs=require(_0x8858('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8858('0xa'));var squel=require(_0x8858('0xb'));var crypto=require('crypto');var jsforce=require(_0x8858('0xc'));var deskjs=require(_0x8858('0xd'));var toCsv=require(_0x8858('0xe'));var querystring=require(_0x8858('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8858('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8858('0x11'));var logger=require(_0x8858('0x12'))(_0x8858('0x13'));var utils=require(_0x8858('0x14'));var config=require(_0x8858('0x15'));var licenseUtil=require(_0x8858('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x204bbc,_0x1ac1e4){_0x1ac1e4=_0x1ac1e4||0xcc;return function(_0x293be3){if(_0x293be3){return _0x204bbc[_0x8858('0x17')](_0x1ac1e4);}return _0x204bbc[_0x8858('0x18')](_0x1ac1e4)[_0x8858('0x19')]();};}function respondWithResult(_0x271c38,_0x2f7f27){_0x2f7f27=_0x2f7f27||0xc8;return function(_0x42c5e9){if(_0x42c5e9){return _0x271c38[_0x8858('0x18')](_0x2f7f27)[_0x8858('0x1a')](_0x42c5e9);}};}function respondWithFilteredResult(_0x52a28f,_0x5b8b34){return function(_0x48f885){if(_0x48f885){var _0x543c62=typeof _0x5b8b34['offset']==='undefined'&&typeof _0x5b8b34[_0x8858('0x1b')]===_0x8858('0x1c');var _0x98432f=_0x48f885['count'];var _0x4760b7=_0x543c62?0x0:_0x5b8b34[_0x8858('0x1d')];var _0x5bbdb7=_0x543c62?_0x48f885[_0x8858('0x1e')]:_0x5b8b34[_0x8858('0x1d')]+_0x5b8b34['limit'];var _0x184923;if(_0x5bbdb7>=_0x98432f){_0x5bbdb7=_0x98432f;_0x184923=0xc8;}else{_0x184923=0xce;}_0x52a28f[_0x8858('0x18')](_0x184923);return _0x52a28f[_0x8858('0x1f')](_0x8858('0x20'),_0x4760b7+'-'+_0x5bbdb7+'/'+_0x98432f)['json'](_0x48f885);}return null;};}function patchUpdates(_0x14d537){return function(_0x13c71c){try{jsonpatch[_0x8858('0x21')](_0x13c71c,_0x14d537,!![]);}catch(_0x4ac771){return BPromise[_0x8858('0x22')](_0x4ac771);}return _0x13c71c[_0x8858('0x23')]();};}function saveUpdates(_0x392ea5,_0x3dec79){return function(_0x54a323){if(_0x54a323){return _0x54a323[_0x8858('0x24')](_0x392ea5)['then'](function(_0x33977d){return _0x33977d;});}return null;};}function removeEntity(_0x5b9ccb,_0x1e4e23){return function(_0x29b506){if(_0x29b506){return _0x29b506['destroy']()['then'](function(){_0x5b9ccb[_0x8858('0x18')](0xcc)[_0x8858('0x19')]();});}};}function handleEntityNotFound(_0x316205,_0x5363da){return function(_0x4d8a0a){if(!_0x4d8a0a){_0x316205[_0x8858('0x17')](0x194);}return _0x4d8a0a;};}function handleError(_0x355491,_0x45571c){_0x45571c=_0x45571c||0x1f4;return function(_0x1e98fb){logger['error'](_0x1e98fb['stack']);if(_0x1e98fb[_0x8858('0x25')]){delete _0x1e98fb[_0x8858('0x25')];}_0x355491[_0x8858('0x18')](_0x45571c)['send'](_0x1e98fb);};}exports[_0x8858('0x26')]=function(_0x231b81,_0x57e9d4){var _0x3e07fe={},_0x1bbdce={},_0x108561={'count':0x0,'rows':[]};var _0x3dd937=_[_0x8858('0x27')](db[_0x8858('0x28')]['rawAttributes'],function(_0x2d7258){return{'name':_0x2d7258[_0x8858('0x29')],'type':_0x2d7258[_0x8858('0x2a')][_0x8858('0x2b')]};});_0x1bbdce[_0x8858('0x2c')]=_[_0x8858('0x27')](_0x3dd937,_0x8858('0x25'));_0x1bbdce[_0x8858('0x2d')]=_[_0x8858('0x2e')](_0x231b81[_0x8858('0x2d')]);_0x1bbdce['filters']=_[_0x8858('0x2f')](_0x1bbdce['model'],_0x1bbdce[_0x8858('0x2d')]);_0x3e07fe[_0x8858('0x30')]=_[_0x8858('0x2f')](_0x1bbdce[_0x8858('0x2c')],qs['fields'](_0x231b81[_0x8858('0x2d')][_0x8858('0x31')]));_0x3e07fe[_0x8858('0x30')]=_0x3e07fe['attributes'][_0x8858('0x32')]?_0x3e07fe[_0x8858('0x30')]:_0x1bbdce[_0x8858('0x2c')];if(!_0x231b81[_0x8858('0x2d')][_0x8858('0x33')](_0x8858('0x34'))){_0x3e07fe[_0x8858('0x1b')]=qs['limit'](_0x231b81[_0x8858('0x2d')][_0x8858('0x1b')]);_0x3e07fe['offset']=qs[_0x8858('0x1d')](_0x231b81[_0x8858('0x2d')][_0x8858('0x1d')]);}_0x3e07fe[_0x8858('0x35')]=qs[_0x8858('0x36')](_0x231b81[_0x8858('0x2d')][_0x8858('0x36')]);_0x3e07fe['where']=qs[_0x8858('0x37')](_[_0x8858('0x38')](_0x231b81[_0x8858('0x2d')],_0x1bbdce[_0x8858('0x37')]),_0x3dd937);if(_0x231b81[_0x8858('0x2d')]['filter']){_0x3e07fe[_0x8858('0x39')]=_[_0x8858('0x3a')](_0x3e07fe[_0x8858('0x39')],{'$or':_[_0x8858('0x27')](_0x3dd937,function(_0x2bf1ee){if(_0x2bf1ee[_0x8858('0x2a')]!=='VIRTUAL'){var _0x2e5415={};_0x2e5415[_0x2bf1ee[_0x8858('0x25')]]={'$like':'%'+_0x231b81[_0x8858('0x2d')]['filter']+'%'};return _0x2e5415;}})});}_0x3e07fe=_[_0x8858('0x3a')]({},_0x3e07fe,_0x231b81[_0x8858('0x3b')]);var _0x299292={'where':_0x3e07fe[_0x8858('0x39')]};return db[_0x8858('0x28')][_0x8858('0x1e')](_0x299292)[_0x8858('0x3c')](function(_0x953de0){_0x108561['count']=_0x953de0;if(_0x231b81[_0x8858('0x2d')]['includeAll']){_0x3e07fe[_0x8858('0x3d')]=[{'all':!![]}];}return db[_0x8858('0x28')][_0x8858('0x3e')](_0x3e07fe);})[_0x8858('0x3c')](function(_0x76551f){_0x108561[_0x8858('0x3f')]=_0x76551f;return _0x108561;})[_0x8858('0x3c')](respondWithFilteredResult(_0x57e9d4,_0x3e07fe))[_0x8858('0x40')](handleError(_0x57e9d4,null));};exports[_0x8858('0x41')]=function(_0x20cfde,_0x4838da){var _0x46c73e={'raw':![],'where':{'id':_0x20cfde[_0x8858('0x42')]['id']}},_0x8c9b2b={};_0x8c9b2b[_0x8858('0x2c')]=_[_0x8858('0x2e')](db['UserProfileSection'][_0x8858('0x43')]);_0x8c9b2b[_0x8858('0x2d')]=_[_0x8858('0x2e')](_0x20cfde[_0x8858('0x2d')]);_0x8c9b2b[_0x8858('0x37')]=_[_0x8858('0x2f')](_0x8c9b2b[_0x8858('0x2c')],_0x8c9b2b[_0x8858('0x2d')]);_0x46c73e['attributes']=_['intersection'](_0x8c9b2b[_0x8858('0x2c')],qs[_0x8858('0x31')](_0x20cfde[_0x8858('0x2d')]['fields']));_0x46c73e['attributes']=_0x46c73e[_0x8858('0x30')][_0x8858('0x32')]?_0x46c73e[_0x8858('0x30')]:_0x8c9b2b[_0x8858('0x2c')];if(_0x20cfde[_0x8858('0x2d')][_0x8858('0x44')]){_0x46c73e[_0x8858('0x3d')]=[{'all':!![]}];}_0x46c73e=_[_0x8858('0x3a')]({},_0x46c73e,_0x20cfde[_0x8858('0x3b')]);return db[_0x8858('0x28')][_0x8858('0x45')](_0x46c73e)[_0x8858('0x3c')](handleEntityNotFound(_0x4838da,null))[_0x8858('0x3c')](respondWithResult(_0x4838da,null))[_0x8858('0x40')](handleError(_0x4838da,null));};exports[_0x8858('0x46')]=function(_0x4bcb11,_0x2d61d4){return db[_0x8858('0x28')][_0x8858('0x46')](_0x4bcb11[_0x8858('0x47')],{})[_0x8858('0x3c')](respondWithResult(_0x2d61d4,0xc9))[_0x8858('0x40')](handleError(_0x2d61d4,null));};exports['update']=function(_0x23379f,_0x26f0a6){if(_0x23379f['body']['id']){delete _0x23379f['body']['id'];}return db[_0x8858('0x28')][_0x8858('0x45')]({'where':{'id':_0x23379f[_0x8858('0x42')]['id']}})['then'](handleEntityNotFound(_0x26f0a6,null))[_0x8858('0x3c')](saveUpdates(_0x23379f[_0x8858('0x47')],null))[_0x8858('0x3c')](respondWithResult(_0x26f0a6,null))['catch'](handleError(_0x26f0a6,null));};exports['destroy']=function(_0x2cd09a,_0x45d6ad){return db[_0x8858('0x28')][_0x8858('0x45')]({'where':{'id':_0x2cd09a['params']['id']}})[_0x8858('0x3c')](handleEntityNotFound(_0x45d6ad,null))[_0x8858('0x3c')](removeEntity(_0x45d6ad,null))[_0x8858('0x40')](handleError(_0x45d6ad,null));};exports[_0x8858('0x48')]=function(_0x3dd64b,_0x344e2e){return db['UserProfileSection']['describe']()[_0x8858('0x3c')](respondWithResult(_0x344e2e,null))[_0x8858('0x40')](handleError(_0x344e2e,null));}; \ No newline at end of file +var _0x2c6a=['ejs','fs-extra','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','apply','reject','save','update','then','destroy','error','name','send','UserProfileSection','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv'];(function(_0x3485f8,_0x1b66cf){var _0x1fbba7=function(_0x135b73){while(--_0x135b73){_0x3485f8['push'](_0x3485f8['shift']());}};_0x1fbba7(++_0x1b66cf);}(_0x2c6a,0x19d));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2c6('0x0'));var rp=require(_0xa2c6('0x1'));var moment=require(_0xa2c6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa2c6('0x3'));var util=require('util');var path=require(_0xa2c6('0x4'));var sox=require(_0xa2c6('0x5'));var csv=require(_0xa2c6('0x6'));var ejs=require(_0xa2c6('0x7'));var fs=require('fs');var fs_extra=require(_0xa2c6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2c6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xa2c6('0xa'));var toCsv=require(_0xa2c6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa2c6('0xb'));var authService=require(_0xa2c6('0xc'));var qs=require(_0xa2c6('0xd'));var as=require(_0xa2c6('0xe'));var hardwareService=require(_0xa2c6('0xf'));var logger=require(_0xa2c6('0x10'))(_0xa2c6('0x11'));var utils=require(_0xa2c6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa2c6('0x13'));var db=require(_0xa2c6('0x14'))['db'];function respondWithStatusCode(_0x15b22b,_0x53bcdf){_0x53bcdf=_0x53bcdf||0xcc;return function(_0x568650){if(_0x568650){return _0x15b22b[_0xa2c6('0x15')](_0x53bcdf);}return _0x15b22b[_0xa2c6('0x16')](_0x53bcdf)[_0xa2c6('0x17')]();};}function respondWithResult(_0x537669,_0x2bcbbc){_0x2bcbbc=_0x2bcbbc||0xc8;return function(_0x6f0194){if(_0x6f0194){return _0x537669[_0xa2c6('0x16')](_0x2bcbbc)['json'](_0x6f0194);}};}function respondWithFilteredResult(_0x2a57ba,_0x980819){return function(_0x250247){if(_0x250247){var _0x21977d=typeof _0x980819[_0xa2c6('0x18')]==='undefined'&&typeof _0x980819[_0xa2c6('0x19')]===_0xa2c6('0x1a');var _0x4bf326=_0x250247[_0xa2c6('0x1b')];var _0x38aa52=_0x21977d?0x0:_0x980819['offset'];var _0x36a31f=_0x21977d?_0x250247[_0xa2c6('0x1b')]:_0x980819['offset']+_0x980819['limit'];var _0x5d24f0;if(_0x36a31f>=_0x4bf326){_0x36a31f=_0x4bf326;_0x5d24f0=0xc8;}else{_0x5d24f0=0xce;}_0x2a57ba['status'](_0x5d24f0);return _0x2a57ba['set']('Content-Range',_0x38aa52+'-'+_0x36a31f+'/'+_0x4bf326)['json'](_0x250247);}return null;};}function patchUpdates(_0x4f40a4){return function(_0x422e3e){try{jsonpatch[_0xa2c6('0x1c')](_0x422e3e,_0x4f40a4,!![]);}catch(_0x4e8572){return BPromise[_0xa2c6('0x1d')](_0x4e8572);}return _0x422e3e[_0xa2c6('0x1e')]();};}function saveUpdates(_0x840a9d,_0x32115d){return function(_0x2eb185){if(_0x2eb185){return _0x2eb185[_0xa2c6('0x1f')](_0x840a9d)[_0xa2c6('0x20')](function(_0x14f511){return _0x14f511;});}return null;};}function removeEntity(_0x30a90e,_0x3dc44b){return function(_0x6b8281){if(_0x6b8281){return _0x6b8281[_0xa2c6('0x21')]()[_0xa2c6('0x20')](function(){_0x30a90e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe2c4,_0x3eb4c7){return function(_0x4ea0b7){if(!_0x4ea0b7){_0x4fe2c4[_0xa2c6('0x15')](0x194);}return _0x4ea0b7;};}function handleError(_0x51cc74,_0x2c89cd){_0x2c89cd=_0x2c89cd||0x1f4;return function(_0x92ddde){logger[_0xa2c6('0x22')](_0x92ddde['stack']);if(_0x92ddde[_0xa2c6('0x23')]){delete _0x92ddde[_0xa2c6('0x23')];}_0x51cc74[_0xa2c6('0x16')](_0x2c89cd)[_0xa2c6('0x24')](_0x92ddde);};}exports['index']=function(_0x358e83,_0x5a59fe){var _0x38ca2a={},_0x5388f7={},_0x216c27={'count':0x0,'rows':[]};var _0x5b3301=_['map'](db[_0xa2c6('0x25')][_0xa2c6('0x26')],function(_0xb2e2c8){return{'name':_0xb2e2c8[_0xa2c6('0x27')],'type':_0xb2e2c8['type'][_0xa2c6('0x28')]};});_0x5388f7[_0xa2c6('0x29')]=_[_0xa2c6('0x2a')](_0x5b3301,_0xa2c6('0x23'));_0x5388f7[_0xa2c6('0x2b')]=_[_0xa2c6('0x2c')](_0x358e83['query']);_0x5388f7['filters']=_[_0xa2c6('0x2d')](_0x5388f7[_0xa2c6('0x29')],_0x5388f7[_0xa2c6('0x2b')]);_0x38ca2a['attributes']=_['intersection'](_0x5388f7[_0xa2c6('0x29')],qs[_0xa2c6('0x2e')](_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x2e')]));_0x38ca2a[_0xa2c6('0x2f')]=_0x38ca2a['attributes'][_0xa2c6('0x30')]?_0x38ca2a[_0xa2c6('0x2f')]:_0x5388f7[_0xa2c6('0x29')];if(!_0x358e83['query'][_0xa2c6('0x31')]('nolimit')){_0x38ca2a[_0xa2c6('0x19')]=qs['limit'](_0x358e83['query'][_0xa2c6('0x19')]);_0x38ca2a['offset']=qs[_0xa2c6('0x18')](_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x18')]);}_0x38ca2a[_0xa2c6('0x32')]=qs[_0xa2c6('0x33')](_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x33')]);_0x38ca2a[_0xa2c6('0x34')]=qs[_0xa2c6('0x35')](_[_0xa2c6('0x36')](_0x358e83[_0xa2c6('0x2b')],_0x5388f7[_0xa2c6('0x35')]),_0x5b3301);if(_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x37')]){_0x38ca2a['where']=_['merge'](_0x38ca2a[_0xa2c6('0x34')],{'$or':_[_0xa2c6('0x2a')](_0x5b3301,function(_0x3d4e8c){if(_0x3d4e8c[_0xa2c6('0x38')]!==_0xa2c6('0x39')){var _0x302b7f={};_0x302b7f[_0x3d4e8c[_0xa2c6('0x23')]]={'$like':'%'+_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x37')]+'%'};return _0x302b7f;}})});}_0x38ca2a=_[_0xa2c6('0x3a')]({},_0x38ca2a,_0x358e83['options']);var _0x158688={'where':_0x38ca2a[_0xa2c6('0x34')]};return db['UserProfileSection'][_0xa2c6('0x1b')](_0x158688)['then'](function(_0x2d9c7a){_0x216c27[_0xa2c6('0x1b')]=_0x2d9c7a;if(_0x358e83[_0xa2c6('0x2b')][_0xa2c6('0x3b')]){_0x38ca2a[_0xa2c6('0x3c')]=[{'all':!![]}];}return db[_0xa2c6('0x25')][_0xa2c6('0x3d')](_0x38ca2a);})['then'](function(_0x536b54){_0x216c27[_0xa2c6('0x3e')]=_0x536b54;return _0x216c27;})['then'](respondWithFilteredResult(_0x5a59fe,_0x38ca2a))[_0xa2c6('0x3f')](handleError(_0x5a59fe,null));};exports[_0xa2c6('0x40')]=function(_0x4427a9,_0x2d53ad){var _0x85ba54={'raw':![],'where':{'id':_0x4427a9[_0xa2c6('0x41')]['id']}},_0x2f88ac={};_0x2f88ac[_0xa2c6('0x29')]=_['keys'](db[_0xa2c6('0x25')][_0xa2c6('0x26')]);_0x2f88ac[_0xa2c6('0x2b')]=_['keys'](_0x4427a9[_0xa2c6('0x2b')]);_0x2f88ac[_0xa2c6('0x35')]=_['intersection'](_0x2f88ac[_0xa2c6('0x29')],_0x2f88ac[_0xa2c6('0x2b')]);_0x85ba54[_0xa2c6('0x2f')]=_[_0xa2c6('0x2d')](_0x2f88ac[_0xa2c6('0x29')],qs[_0xa2c6('0x2e')](_0x4427a9[_0xa2c6('0x2b')][_0xa2c6('0x2e')]));_0x85ba54[_0xa2c6('0x2f')]=_0x85ba54[_0xa2c6('0x2f')][_0xa2c6('0x30')]?_0x85ba54[_0xa2c6('0x2f')]:_0x2f88ac[_0xa2c6('0x29')];if(_0x4427a9[_0xa2c6('0x2b')][_0xa2c6('0x3b')]){_0x85ba54[_0xa2c6('0x3c')]=[{'all':!![]}];}_0x85ba54=_[_0xa2c6('0x3a')]({},_0x85ba54,_0x4427a9['options']);return db['UserProfileSection']['find'](_0x85ba54)[_0xa2c6('0x20')](handleEntityNotFound(_0x2d53ad,null))['then'](respondWithResult(_0x2d53ad,null))[_0xa2c6('0x3f')](handleError(_0x2d53ad,null));};exports[_0xa2c6('0x42')]=function(_0x42dcbe,_0x4280e3){return db[_0xa2c6('0x25')][_0xa2c6('0x42')](_0x42dcbe[_0xa2c6('0x43')],{})[_0xa2c6('0x20')](respondWithResult(_0x4280e3,0xc9))[_0xa2c6('0x3f')](handleError(_0x4280e3,null));};exports['update']=function(_0x283dd9,_0xcb8377){if(_0x283dd9[_0xa2c6('0x43')]['id']){delete _0x283dd9[_0xa2c6('0x43')]['id'];}return db[_0xa2c6('0x25')][_0xa2c6('0x44')]({'where':{'id':_0x283dd9[_0xa2c6('0x41')]['id']}})[_0xa2c6('0x20')](handleEntityNotFound(_0xcb8377,null))['then'](saveUpdates(_0x283dd9[_0xa2c6('0x43')],null))[_0xa2c6('0x20')](respondWithResult(_0xcb8377,null))[_0xa2c6('0x3f')](handleError(_0xcb8377,null));};exports[_0xa2c6('0x21')]=function(_0x208bef,_0x1a39c7){return db[_0xa2c6('0x25')][_0xa2c6('0x44')]({'where':{'id':_0x208bef[_0xa2c6('0x41')]['id']}})[_0xa2c6('0x20')](handleEntityNotFound(_0x1a39c7,null))[_0xa2c6('0x20')](removeEntity(_0x1a39c7,null))['catch'](handleError(_0x1a39c7,null));};exports[_0xa2c6('0x45')]=function(_0x5dbb57,_0x2bfda6){return db[_0xa2c6('0x25')][_0xa2c6('0x45')]()['then'](respondWithResult(_0x2bfda6,null))[_0xa2c6('0x3f')](handleError(_0x2bfda6,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index bfd5cee..5a424ce 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 _0x1e40=['compositeIndex','sectionId','userProfileId','lodash','util','moment','request-promise','../../config/environment','./userProfileSection.attributes','define','user_profile_has_sections'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e40,0xdf));var _0x01e4=function(_0x3aec30,_0x2b509d){_0x3aec30=_0x3aec30-0x0;var _0xb5c4a0=_0x1e40[_0x3aec30];return _0xb5c4a0;};'use strict';var _=require(_0x01e4('0x0'));var util=require(_0x01e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x01e4('0x2'));var BPromise=require('bluebird');var rp=require(_0x01e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01e4('0x4'));var attributes=require(_0x01e4('0x5'));module['exports']=function(_0x2382b3,_0x4f2b53){return _0x2382b3[_0x01e4('0x6')]('UserProfileSection',attributes,{'tableName':_0x01e4('0x7'),'paranoid':![],'indexes':[{'name':_0x01e4('0x8'),'fields':[_0x01e4('0x9'),_0x01e4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2d7=['UserProfileSection','user_profile_has_sections','sectionId','lodash','util','api','moment','bluebird','path','rimraf','exports','define'];(function(_0xe8273e,_0x2c4b77){var _0x2e6a8b=function(_0x1db8dc){while(--_0x1db8dc){_0xe8273e['push'](_0xe8273e['shift']());}};_0x2e6a8b(++_0x2c4b77);}(_0xe2d7,0x7b));var _0x7e2d=function(_0x4fda8b,_0x234433){_0x4fda8b=_0x4fda8b-0x0;var _0x52cd9d=_0xe2d7[_0x4fda8b];return _0x52cd9d;};'use strict';var _=require(_0x7e2d('0x0'));var util=require(_0x7e2d('0x1'));var logger=require('../../config/logger')(_0x7e2d('0x2'));var moment=require(_0x7e2d('0x3'));var BPromise=require(_0x7e2d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e2d('0x5'));var rimraf=require(_0x7e2d('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x7e2d('0x7')]=function(_0x2798ed,_0x34306f){return _0x2798ed[_0x7e2d('0x8')](_0x7e2d('0x9'),attributes,{'tableName':_0x7e2d('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7e2d('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 93cf727..97a31b4 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 _0xb2f1=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xb2f1,0xee));var _0x1b2f=function(_0x58cc87,_0x1f8228){_0x58cc87=_0x58cc87-0x0;var _0x57e9e7=_0xb2f1[_0x58cc87];return _0x57e9e7;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require('moment');var BPromise=require(_0x1b2f('0x2'));var rs=require(_0x1b2f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x4'))['db'];var utils=require(_0x1b2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b2f('0x6'));var jayson=require(_0x1b2f('0x7'));var client=jayson[_0x1b2f('0x8')][_0x1b2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57eed1,_0x532834,_0x12a0bf){return new BPromise(function(_0x28a081,_0x5627d3){return client[_0x1b2f('0xa')](_0x57eed1,_0x12a0bf)[_0x1b2f('0xb')](function(_0x5acb30){logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,_0x1b2f('0xe'));logger[_0x1b2f('0xf')](_0x1b2f('0x10'),_0x532834,_0x1b2f('0xe'),JSON[_0x1b2f('0x11')](_0x5acb30));if(_0x5acb30['error']){if(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x13')]===0x1f4){logger[_0x1b2f('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x5627d3(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}logger[_0x1b2f('0x12')](_0x1b2f('0xd'),_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x28a081(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}else{logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,'request\x20sent');_0x28a081(_0x5acb30['result'][_0x1b2f('0x14')]);}})['catch'](function(_0x4cdc0d){logger['error'](_0x1b2f('0xd'),_0x532834,_0x4cdc0d);_0x5627d3(_0x4cdc0d);});});} \ No newline at end of file +var _0x08c3=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x08c3,0x11f));var _0x308c=function(_0x49a4e3,_0x1cc52e){_0x49a4e3=_0x49a4e3-0x0;var _0x1e96be=_0x08c3[_0x49a4e3];return _0x1e96be;};'use strict';var _=require(_0x308c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x308c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x308c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x308c('0x3'));var logger=require(_0x308c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x308c('0x5'));var client=jayson[_0x308c('0x6')][_0x308c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a2c40,_0x20961a,_0x4b1955){return new BPromise(function(_0x4f9899,_0x6927ed){return client[_0x308c('0x8')](_0x4a2c40,_0x4b1955)[_0x308c('0x9')](function(_0x587848){logger[_0x308c('0xa')](_0x308c('0xb'),_0x20961a,'request\x20sent');logger[_0x308c('0xc')](_0x308c('0xd'),_0x20961a,_0x308c('0xe'),JSON[_0x308c('0xf')](_0x587848));if(_0x587848[_0x308c('0x10')]){if(_0x587848[_0x308c('0x10')][_0x308c('0x11')]===0x1f4){logger[_0x308c('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x20961a,_0x587848[_0x308c('0x10')][_0x308c('0x12')]);return _0x6927ed(_0x587848[_0x308c('0x10')]['message']);}logger['error'](_0x308c('0xb'),_0x20961a,_0x587848[_0x308c('0x10')]['message']);return _0x4f9899(_0x587848[_0x308c('0x10')][_0x308c('0x12')]);}else{logger[_0x308c('0xa')](_0x308c('0xb'),_0x20961a,_0x308c('0xe'));_0x4f9899(_0x587848[_0x308c('0x13')][_0x308c('0x12')]);}})[_0x308c('0x14')](function(_0x10daac){logger[_0x308c('0x10')](_0x308c('0xb'),_0x20961a,_0x10daac);_0x6927ed(_0x10daac);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 998667c..a495f74 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4bd8e1,_0x5e9388){var _0x286282=function(_0x26485f){while(--_0x26485f){_0x4bd8e1['push'](_0x4bd8e1['shift']());}};_0x286282(++_0x5e9388);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xb3b35b,_0x29e645){var _0x5279be=function(_0xb1b37b){while(--_0xb1b37b){_0xb3b35b['push'](_0xb3b35b['shift']());}};_0x5279be(++_0x29e645);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 86791d4..23ffbf6 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 _0x5cf0=['sequelize','exports','INTEGER'];(function(_0x53bce0,_0x3587a7){var _0x19f6e0=function(_0x351eef){while(--_0x351eef){_0x53bce0['push'](_0x53bce0['shift']());}};_0x19f6e0(++_0x3587a7);}(_0x5cf0,0x114));var _0x05cf=function(_0x51c8f8,_0x47fe37){_0x51c8f8=_0x51c8f8-0x0;var _0x44d082=_0x5cf0[_0x51c8f8];return _0x44d082;};'use strict';var Sequelize=require(_0x05cf('0x0'));module[_0x05cf('0x1')]={'penalty':{'type':Sequelize[_0x05cf('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd114=['sequelize','exports'];(function(_0x3da001,_0x256e26){var _0x2947e9=function(_0x4afdc0){while(--_0x4afdc0){_0x3da001['push'](_0x3da001['shift']());}};_0x2947e9(++_0x256e26);}(_0xd114,0x10c));var _0x4d11=function(_0x48d1ba,_0x41d36c){_0x48d1ba=_0x48d1ba-0x0;var _0x1e205a=_0xd114[_0x48d1ba];return _0x1e205a;};'use strict';var Sequelize=require(_0x4d11('0x0'));module[_0x4d11('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 0e65cac..27c4223 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 _0x9505=['request-promise','path','./userSmsQueue.attributes','exports','user_has_sms_queues','lodash','util','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9505,0x1e5));var _0x5950=function(_0xf1303d,_0xc4a961){_0xf1303d=_0xf1303d-0x0;var _0x387445=_0x9505[_0xf1303d];return _0x387445;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var logger=require('../../config/logger')(_0x5950('0x2'));var moment=require(_0x5950('0x3'));var BPromise=require(_0x5950('0x4'));var rp=require(_0x5950('0x5'));var fs=require('fs');var path=require(_0x5950('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5950('0x7'));module[_0x5950('0x8')]=function(_0x3ac153,_0x3a5973){return _0x3ac153['define']('UserSmsQueue',attributes,{'tableName':_0x5950('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffd6=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xffd6,0x97));var _0x6ffd=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0xffd6[_0x15fc3c];return _0x94c5c8;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var logger=require(_0x6ffd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ffd('0x3'));var rp=require(_0x6ffd('0x4'));var fs=require('fs');var path=require(_0x6ffd('0x5'));var rimraf=require('rimraf');var config=require(_0x6ffd('0x6'));var attributes=require(_0x6ffd('0x7'));module[_0x6ffd('0x8')]=function(_0x2949a4,_0x561055){return _0x2949a4[_0x6ffd('0x9')](_0x6ffd('0xa'),attributes,{'tableName':_0x6ffd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 773b23a..b95d4a4 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 _0x7aeb=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserSmsQueue,\x20%s,\x20%s','lodash','util','moment'];(function(_0x652fa4,_0xdd3095){var _0x27b0df=function(_0x416b85){while(--_0x416b85){_0x652fa4['push'](_0x652fa4['shift']());}};_0x27b0df(++_0xdd3095);}(_0x7aeb,0x115));var _0xb7ae=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x7aeb[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0xb7ae('0x0'));var util=require(_0xb7ae('0x1'));var moment=require(_0xb7ae('0x2'));var BPromise=require(_0xb7ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7ae('0x5'))(_0xb7ae('0x6'));var config=require(_0xb7ae('0x7'));var jayson=require(_0xb7ae('0x8'));var client=jayson[_0xb7ae('0x9')][_0xb7ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d6c08,_0x10dc83,_0x307514){return new BPromise(function(_0x11d420,_0xc7c4e7){return client[_0xb7ae('0xb')](_0x1d6c08,_0x307514)['then'](function(_0x3f3961){logger[_0xb7ae('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x10dc83,_0xb7ae('0xd'));logger[_0xb7ae('0xe')](_0xb7ae('0xf'),_0x10dc83,_0xb7ae('0xd'),JSON['stringify'](_0x3f3961));if(_0x3f3961[_0xb7ae('0x10')]){if(_0x3f3961[_0xb7ae('0x10')][_0xb7ae('0x11')]===0x1f4){logger[_0xb7ae('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x10dc83,_0x3f3961[_0xb7ae('0x10')][_0xb7ae('0x12')]);return _0xc7c4e7(_0x3f3961[_0xb7ae('0x10')][_0xb7ae('0x12')]);}logger[_0xb7ae('0x10')](_0xb7ae('0x13'),_0x10dc83,_0x3f3961[_0xb7ae('0x10')][_0xb7ae('0x12')]);return _0x11d420(_0x3f3961[_0xb7ae('0x10')][_0xb7ae('0x12')]);}else{logger['info'](_0xb7ae('0x13'),_0x10dc83,_0xb7ae('0xd'));_0x11d420(_0x3f3961['result'][_0xb7ae('0x12')]);}})['catch'](function(_0x4185c6){logger[_0xb7ae('0x10')](_0xb7ae('0x13'),_0x10dc83,_0x4185c6);_0xc7c4e7(_0x4185c6);});});} \ No newline at end of file +var _0xeeb4=['../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x50d02a,_0x39e491){var _0x1953ce=function(_0x20671c){while(--_0x20671c){_0x50d02a['push'](_0x50d02a['shift']());}};_0x1953ce(++_0x39e491);}(_0xeeb4,0x1f1));var _0x4eeb=function(_0x4ede8b,_0x25b7a7){_0x4ede8b=_0x4ede8b-0x0;var _0x2c1011=_0xeeb4[_0x4ede8b];return _0x2c1011;};'use strict';var _=require(_0x4eeb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4eeb('0x1'));var rs=require(_0x4eeb('0x2'));var fs=require('fs');var Redis=require(_0x4eeb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4eeb('0x4'));var logger=require(_0x4eeb('0x5'))(_0x4eeb('0x6'));var config=require(_0x4eeb('0x7'));var jayson=require(_0x4eeb('0x8'));var client=jayson[_0x4eeb('0x9')][_0x4eeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5be0fe,_0x326f94,_0x365b58){return new BPromise(function(_0x37ee5,_0x41a7a4){return client[_0x4eeb('0xb')](_0x5be0fe,_0x365b58)[_0x4eeb('0xc')](function(_0x18ea05){logger[_0x4eeb('0xd')](_0x4eeb('0xe'),_0x326f94,_0x4eeb('0xf'));logger[_0x4eeb('0x10')](_0x4eeb('0x11'),_0x326f94,_0x4eeb('0xf'),JSON[_0x4eeb('0x12')](_0x18ea05));if(_0x18ea05['error']){if(_0x18ea05[_0x4eeb('0x13')][_0x4eeb('0x14')]===0x1f4){logger[_0x4eeb('0x13')](_0x4eeb('0xe'),_0x326f94,_0x18ea05['error'][_0x4eeb('0x15')]);return _0x41a7a4(_0x18ea05[_0x4eeb('0x13')][_0x4eeb('0x15')]);}logger[_0x4eeb('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x326f94,_0x18ea05['error'][_0x4eeb('0x15')]);return _0x37ee5(_0x18ea05[_0x4eeb('0x13')][_0x4eeb('0x15')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x326f94,_0x4eeb('0xf'));_0x37ee5(_0x18ea05[_0x4eeb('0x16')][_0x4eeb('0x15')]);}})[_0x4eeb('0x17')](function(_0x2159fb){logger[_0x4eeb('0x13')](_0x4eeb('0xe'),_0x326f94,_0x2159fb);_0x41a7a4(_0x2159fb);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 26aed03..f4b6028 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 _0x23c2=['INTEGER','sequelize'];(function(_0x2cecd4,_0x10cee8){var _0x4385db=function(_0xcf02cd){while(--_0xcf02cd){_0x2cecd4['push'](_0x2cecd4['shift']());}};_0x4385db(++_0x10cee8);}(_0x23c2,0x127));var _0x223c=function(_0xd746ed,_0x81920c){_0xd746ed=_0xd746ed-0x0;var _0x5ef2a6=_0x23c2[_0xd746ed];return _0x5ef2a6;};'use strict';var Sequelize=require(_0x223c('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x223c('0x1')]}}; \ No newline at end of file +var _0xe1c3=['sequelize','INTEGER'];(function(_0x2e21f9,_0x5efe33){var _0x30597d=function(_0x2f72aa){while(--_0x2f72aa){_0x2e21f9['push'](_0x2e21f9['shift']());}};_0x30597d(++_0x5efe33);}(_0xe1c3,0xf0));var _0x3e1c=function(_0xaeedca,_0x170237){_0xaeedca=_0xaeedca-0x0;var _0x562b76=_0xe1c3[_0xaeedca];return _0x562b76;};'use strict';var Sequelize=require(_0x3e1c('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x3e1c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x3e1c('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 215e6bb..329ce91 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(_0x1c1dbb,_0x447cb1){var _0x408348=function(_0x2901d0){while(--_0x2901d0){_0x1c1dbb['push'](_0x1c1dbb['shift']());}};_0x408348(++_0x447cb1);}(_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':'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(_0x214111,_0x461bd9){var _0x4df7c8=function(_0x2bb4f2){while(--_0x2bb4f2){_0x214111['push'](_0x214111['shift']());}};_0x4df7c8(++_0x461bd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 ffe90c9..4a16ef6 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xe269e5,_0xad869a){var _0x25d1b7=function(_0x5ee4ad){while(--_0x5ee4ad){_0xe269e5['push'](_0xe269e5['shift']());}};_0x25d1b7(++_0xad869a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0xcb91[_0x4eaa4c];return _0x15aec6;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x18b8c4,_0x16c16a){var _0x552000=function(_0x378da5){while(--_0x378da5){_0x18b8c4['push'](_0x18b8c4['shift']());}};_0x552000(++_0x16c16a);}(_0xedd9,0xfc));var _0x9edd=function(_0x35430b,_0x6d611b){_0x35430b=_0x35430b-0x0;var _0x53fe3a=_0xedd9[_0x35430b];return _0x53fe3a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9b4f1c6..d8084d6 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 _0x3cb4=['INTEGER','sequelize','exports'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0x3cb4,0xc7));var _0x43cb=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x3cb4[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x43cb('0x0'));module[_0x43cb('0x1')]={'penalty':{'type':Sequelize[_0x43cb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x75b4=['exports','INTEGER'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x75b4,0xc2));var _0x475b=function(_0x5da61a,_0x5745cc){_0x5da61a=_0x5da61a-0x0;var _0x1ceaa5=_0x75b4[_0x5da61a];return _0x1ceaa5;};'use strict';var Sequelize=require('sequelize');module[_0x475b('0x0')]={'penalty':{'type':Sequelize[_0x475b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 49ab3dc..4d23a99 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 _0xbfe0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','user_has_voice_queues','lodash'];(function(_0x343801,_0x3e4437){var _0x3425b0=function(_0x550477){while(--_0x550477){_0x343801['push'](_0x343801['shift']());}};_0x3425b0(++_0x3e4437);}(_0xbfe0,0x6d));var _0x0bfe=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0xbfe0[_0x4e4f0e];return _0x1a7219;};'use strict';var _=require(_0x0bfe('0x0'));var util=require('util');var logger=require(_0x0bfe('0x1'))(_0x0bfe('0x2'));var moment=require('moment');var BPromise=require(_0x0bfe('0x3'));var rp=require(_0x0bfe('0x4'));var fs=require('fs');var path=require(_0x0bfe('0x5'));var rimraf=require(_0x0bfe('0x6'));var config=require(_0x0bfe('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x0bfe('0x8')]=function(_0x191e1a,_0x4ade80){return _0x191e1a['define']('UserVoiceQueue',attributes,{'tableName':_0x0bfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78b3=['user_has_voice_queues','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue'];(function(_0x20c893,_0xbef2b4){var _0xc705e8=function(_0x449739){while(--_0x449739){_0x20c893['push'](_0x20c893['shift']());}};_0xc705e8(++_0xbef2b4);}(_0x78b3,0x18d));var _0x378b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x78b3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x378b('0x0'));var util=require(_0x378b('0x1'));var logger=require(_0x378b('0x2'))(_0x378b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x378b('0x4'));var rimraf=require(_0x378b('0x5'));var config=require(_0x378b('0x6'));var attributes=require(_0x378b('0x7'));module[_0x378b('0x8')]=function(_0x300005,_0x37de13){return _0x300005['define'](_0x378b('0x9'),attributes,{'tableName':_0x378b('0xa'),'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 acba17b..f6144c7 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 _0xac75=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x1b5d5f,_0x5ed766){var _0x3c9347=function(_0x21afdd){while(--_0x21afdd){_0x1b5d5f['push'](_0x1b5d5f['shift']());}};_0x3c9347(++_0x5ed766);}(_0xac75,0x69));var _0x5ac7=function(_0x490b92,_0x134190){_0x490b92=_0x490b92-0x0;var _0x4b9700=_0xac75[_0x490b92];return _0x4b9700;};'use strict';var _=require(_0x5ac7('0x0'));var util=require(_0x5ac7('0x1'));var moment=require(_0x5ac7('0x2'));var BPromise=require(_0x5ac7('0x3'));var rs=require(_0x5ac7('0x4'));var fs=require('fs');var Redis=require(_0x5ac7('0x5'));var db=require(_0x5ac7('0x6'))['db'];var utils=require(_0x5ac7('0x7'));var logger=require('../../config/logger')(_0x5ac7('0x8'));var config=require(_0x5ac7('0x9'));var jayson=require(_0x5ac7('0xa'));var client=jayson[_0x5ac7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b40ba,_0x176cbf,_0x225efe){return new BPromise(function(_0x1033c3,_0x16a2f4){return client[_0x5ac7('0xc')](_0x5b40ba,_0x225efe)[_0x5ac7('0xd')](function(_0x3db725){logger[_0x5ac7('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x176cbf,_0x5ac7('0xf'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x176cbf,_0x5ac7('0xf'),JSON[_0x5ac7('0x10')](_0x3db725));if(_0x3db725['error']){if(_0x3db725['error']['code']===0x1f4){logger[_0x5ac7('0x11')](_0x5ac7('0x12'),_0x176cbf,_0x3db725[_0x5ac7('0x11')][_0x5ac7('0x13')]);return _0x16a2f4(_0x3db725[_0x5ac7('0x11')]['message']);}logger[_0x5ac7('0x11')](_0x5ac7('0x12'),_0x176cbf,_0x3db725[_0x5ac7('0x11')][_0x5ac7('0x13')]);return _0x1033c3(_0x3db725[_0x5ac7('0x11')]['message']);}else{logger[_0x5ac7('0xe')](_0x5ac7('0x12'),_0x176cbf,_0x5ac7('0xf'));_0x1033c3(_0x3db725[_0x5ac7('0x14')]['message']);}})['catch'](function(_0x3c59fc){logger['error'](_0x5ac7('0x12'),_0x176cbf,_0x3c59fc);_0x16a2f4(_0x3c59fc);});});} \ No newline at end of file +var _0x8aca=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3dc5c1,_0x503e9c){var _0x57fdc5=function(_0x40f2db){while(--_0x40f2db){_0x3dc5c1['push'](_0x3dc5c1['shift']());}};_0x57fdc5(++_0x503e9c);}(_0x8aca,0x13a));var _0xa8ac=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x8aca[_0x58db4e];return _0x40139a;};'use strict';var _=require(_0xa8ac('0x0'));var util=require(_0xa8ac('0x1'));var moment=require('moment');var BPromise=require(_0xa8ac('0x2'));var rs=require(_0xa8ac('0x3'));var fs=require('fs');var Redis=require(_0xa8ac('0x4'));var db=require(_0xa8ac('0x5'))['db'];var utils=require(_0xa8ac('0x6'));var logger=require('../../config/logger')(_0xa8ac('0x7'));var config=require(_0xa8ac('0x8'));var jayson=require(_0xa8ac('0x9'));var client=jayson[_0xa8ac('0xa')][_0xa8ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31eaed,_0x38a9e1,_0x51245b){return new BPromise(function(_0x2b6c71,_0x507244){return client[_0xa8ac('0xc')](_0x31eaed,_0x51245b)['then'](function(_0x5406c1){logger[_0xa8ac('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x38a9e1,_0xa8ac('0xe'));logger[_0xa8ac('0xf')](_0xa8ac('0x10'),_0x38a9e1,_0xa8ac('0xe'),JSON['stringify'](_0x5406c1));if(_0x5406c1[_0xa8ac('0x11')]){if(_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x12')]===0x1f4){logger[_0xa8ac('0x11')](_0xa8ac('0x13'),_0x38a9e1,_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);return _0x507244(_0x5406c1[_0xa8ac('0x11')]['message']);}logger[_0xa8ac('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x38a9e1,_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);return _0x2b6c71(_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);}else{logger[_0xa8ac('0xd')](_0xa8ac('0x13'),_0x38a9e1,_0xa8ac('0xe'));_0x2b6c71(_0x5406c1[_0xa8ac('0x15')][_0xa8ac('0x14')]);}})[_0xa8ac('0x16')](function(_0x147ab2){logger[_0xa8ac('0x11')](_0xa8ac('0x13'),_0x38a9e1,_0x147ab2);_0x507244(_0x147ab2);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 073939c..9d42b7b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x130703,_0x42e344){var _0x210064=function(_0x42304c){while(--_0x42304c){_0x130703['push'](_0x130703['shift']());}};_0x210064(++_0x42e344);}(_0xedd9,0xfc));var _0x9edd=function(_0x757eda,_0x5c6fb3){_0x757eda=_0x757eda-0x0;var _0x32ad71=_0xedd9[_0x757eda];return _0x32ad71;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x44cd97,_0x12a1c9){var _0x59694b=function(_0x3742e2){while(--_0x3742e2){_0x44cd97['push'](_0x44cd97['shift']());}};_0x59694b(++_0x12a1c9);}(_0xe706,0xa3));var _0x6e70=function(_0x749c48,_0x336468){_0x749c48=_0x749c48-0x0;var _0x2f419c=_0xe706[_0x749c48];return _0x2f419c;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5851511..df3b457 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 _0x2aa2=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x4ce20c,_0xd0bb85){var _0x5b8da9=function(_0x19e46e){while(--_0x19e46e){_0x4ce20c['push'](_0x4ce20c['shift']());}};_0x5b8da9(++_0xd0bb85);}(_0x2aa2,0xab));var _0x22aa=function(_0x4af561,_0x3c8193){_0x4af561=_0x4af561-0x0;var _0x53b587=_0x2aa2[_0x4af561];return _0x53b587;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x22aa('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x22aa('0x1')},'membername':{'type':Sequelize[_0x22aa('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x22aa('0x3'),'comment':_0x22aa('0x1')},'VoiceQueueId':{'type':Sequelize[_0x22aa('0x0')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x22aa('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x22aa('0x1')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x22aa('0x1')}}; \ No newline at end of file +var _0xc89f=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x57172c,_0x1df512){var _0x38e8a4=function(_0x1bc9a5){while(--_0x1bc9a5){_0x57172c['push'](_0x57172c['shift']());}};_0x38e8a4(++_0x1df512);}(_0xc89f,0x1c2));var _0xfc89=function(_0x42f58d,_0x44a5a3){_0x42f58d=_0x42f58d-0x0;var _0x3207f5=_0xc89f[_0x42f58d];return _0x3207f5;};'use strict';var Sequelize=require(_0xfc89('0x0'));module[_0xfc89('0x1')]={'uniqueid':{'type':Sequelize[_0xfc89('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xfc89('0x3')},'membername':{'type':Sequelize[_0xfc89('0x4')],'allowNull':![],'comment':_0xfc89('0x3')},'UserId':{'type':Sequelize[_0xfc89('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfc89('0x4')],'allowNull':![],'unique':_0xfc89('0x5'),'comment':_0xfc89('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xfc89('0x4')],'allowNull':![],'unique':_0xfc89('0x5'),'comment':_0xfc89('0x3')},'penalty':{'type':Sequelize[_0xfc89('0x2')](0xb),'defaultValue':0x0,'comment':_0xfc89('0x3')},'paused':{'type':Sequelize[_0xfc89('0x2')](0xb),'defaultValue':0x0,'comment':_0xfc89('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index cb01a38..2643128 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 _0xbbe8=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x2d21f3,_0x3daa4e){var _0x12b4dd=function(_0x2cf48f){while(--_0x2cf48f){_0x2d21f3['push'](_0x2d21f3['shift']());}};_0x12b4dd(++_0x3daa4e);}(_0xbbe8,0x1b4));var _0x8bbe=function(_0x164951,_0x4c2c5d){_0x164951=_0x164951-0x0;var _0x448187=_0xbbe8[_0x164951];return _0x448187;};'use strict';var EventEmitter=require(_0x8bbe('0x0'));var UserVoiceQueueRt=require(_0x8bbe('0x1'))['db'][_0x8bbe('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8bbe('0x3')](0x0);var events={'afterCreate':_0x8bbe('0x4'),'afterUpdate':'update','afterDestroy':_0x8bbe('0x5')};function emitEvent(_0x3f1e7c){return function(_0x575406,_0x4d50b8,_0xbef189){UserVoiceQueueRtEvents[_0x8bbe('0x6')](_0x3f1e7c+':'+_0x575406['id'],_0x575406);UserVoiceQueueRtEvents['emit'](_0x3f1e7c,_0x575406);_0xbef189(null);};}for(var e in events){if(events[_0x8bbe('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x8bbe('0x8')](e,emitEvent(event));}}module[_0x8bbe('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0e35=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x509195,_0x100287){var _0x195357=function(_0x33b2a8){while(--_0x33b2a8){_0x509195['push'](_0x509195['shift']());}};_0x195357(++_0x100287);}(_0x0e35,0x1e8));var _0x50e3=function(_0x2cc0a5,_0x10a20e){_0x2cc0a5=_0x2cc0a5-0x0;var _0x5aca1e=_0x0e35[_0x2cc0a5];return _0x5aca1e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x50e3('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50e3('0x1'),'afterUpdate':_0x50e3('0x2'),'afterDestroy':_0x50e3('0x3')};function emitEvent(_0xe8feac){return function(_0x2e99cf,_0x4ac2ad,_0x5ad0c3){UserVoiceQueueRtEvents[_0x50e3('0x4')](_0xe8feac+':'+_0x2e99cf['id'],_0x2e99cf);UserVoiceQueueRtEvents[_0x50e3('0x4')](_0xe8feac,_0x2e99cf);_0x5ad0c3(null);};}for(var e in events){if(events[_0x50e3('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x50e3('0x6')](e,emitEvent(event));}}module[_0x50e3('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 1a92708..5bd103f 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 _0x8f72=['api','moment','bluebird','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8f72,0x1cc));var _0x28f7=function(_0x40a991,_0x342255){_0x40a991=_0x40a991-0x0;var _0x4b5769=_0x8f72[_0x40a991];return _0x4b5769;};'use strict';var _=require('lodash');var util=require(_0x28f7('0x0'));var logger=require(_0x28f7('0x1'))(_0x28f7('0x2'));var moment=require(_0x28f7('0x3'));var BPromise=require(_0x28f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x28f7('0x5'));var attributes=require(_0x28f7('0x6'));module[_0x28f7('0x7')]=function(_0x593057,_0x24af60){return _0x593057[_0x28f7('0x8')](_0x28f7('0x9'),attributes,{'tableName':_0x28f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x076d=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util'];(function(_0x461264,_0x8daed2){var _0x547105=function(_0x385785){while(--_0x385785){_0x461264['push'](_0x461264['shift']());}};_0x547105(++_0x8daed2);}(_0x076d,0x1c6));var _0xd076=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x076d[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xd076('0x0'));var util=require(_0xd076('0x1'));var logger=require(_0xd076('0x2'))('api');var moment=require(_0xd076('0x3'));var BPromise=require('bluebird');var rp=require(_0xd076('0x4'));var fs=require('fs');var path=require(_0xd076('0x5'));var rimraf=require(_0xd076('0x6'));var config=require(_0xd076('0x7'));var attributes=require(_0xd076('0x8'));module[_0xd076('0x9')]=function(_0x5333f0,_0x2c2732){return _0x5333f0[_0xd076('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0xd076('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 d5483d5..9b2f014 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 _0xc8a6=['redis','defaults','localhost','./userVoiceQueueRt.socket','request','then','info','debug','stringify','error','message','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0xc8a6,0xc1));var _0x6c8a=function(_0x53feb9,_0x3f0e79){_0x53feb9=_0x53feb9-0x0;var _0x4f3707=_0xc8a6[_0x53feb9];return _0x4f3707;};'use strict';var _=require(_0x6c8a('0x0'));var util=require(_0x6c8a('0x1'));var moment=require(_0x6c8a('0x2'));var BPromise=require(_0x6c8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c8a('0x4'));var db=require(_0x6c8a('0x5'))['db'];var utils=require(_0x6c8a('0x6'));var logger=require(_0x6c8a('0x7'))(_0x6c8a('0x8'));var config=require(_0x6c8a('0x9'));var jayson=require(_0x6c8a('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x6c8a('0xb')]=_[_0x6c8a('0xc')](config[_0x6c8a('0xb')],{'host':_0x6c8a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6c8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x17c4d2,_0x1cf9b1,_0x4f36ad){return new BPromise(function(_0xc54e2d,_0x39e413){return client[_0x6c8a('0xf')](_0x17c4d2,_0x4f36ad)[_0x6c8a('0x10')](function(_0x264c58){logger[_0x6c8a('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1cf9b1,'request\x20sent');logger[_0x6c8a('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1cf9b1,'request\x20sent',JSON[_0x6c8a('0x13')](_0x264c58));if(_0x264c58[_0x6c8a('0x14')]){if(_0x264c58[_0x6c8a('0x14')]['code']===0x1f4){logger[_0x6c8a('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1cf9b1,_0x264c58[_0x6c8a('0x14')][_0x6c8a('0x15')]);return _0x39e413(_0x264c58['error']['message']);}logger['error'](_0x6c8a('0x16'),_0x1cf9b1,_0x264c58[_0x6c8a('0x14')][_0x6c8a('0x15')]);return _0xc54e2d(_0x264c58['error'][_0x6c8a('0x15')]);}else{logger[_0x6c8a('0x11')](_0x6c8a('0x16'),_0x1cf9b1,_0x6c8a('0x17'));_0xc54e2d(_0x264c58['result'][_0x6c8a('0x15')]);}})['catch'](function(_0x1ec573){logger[_0x6c8a('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1cf9b1,_0x1ec573);_0x39e413(_0x1ec573);});});}exports[_0x6c8a('0x18')]=function(_0x5ab67f){var _0x26b94b=this;return new Promise(function(_0x3d6d1f,_0xca1082){return db[_0x6c8a('0x19')][_0x6c8a('0x1a')]({'raw':_0x5ab67f[_0x6c8a('0x1b')]?_0x5ab67f[_0x6c8a('0x1b')][_0x6c8a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ab67f[_0x6c8a('0x1b')]?_0x5ab67f[_0x6c8a('0x1b')][_0x6c8a('0x1d')]||null:null,'attributes':[[db[_0x6c8a('0x1e')]['fn'](_0x6c8a('0x1f'),db[_0x6c8a('0x1e')]['fn']('IF',db['sequelize'][_0x6c8a('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x6c8a('0x10')](function(_0x338db2){logger['info']('GetVoiceQueueRtPauses',_0x5ab67f);logger[_0x6c8a('0x12')](_0x6c8a('0x18'),_0x5ab67f,JSON[_0x6c8a('0x13')](_0x338db2));_0x3d6d1f(_0x338db2);})[_0x6c8a('0x21')](function(_0x276e1c){logger[_0x6c8a('0x14')](_0x6c8a('0x18'),_0x276e1c['message'],_0x5ab67f);_0xca1082(_0x26b94b['error'](0x1f4,_0x276e1c['message']));});});}; \ No newline at end of file +var _0x5c46=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','outboundQueuePauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x2ffab6,_0x4fa24a){var _0x3ed205=function(_0x13a320){while(--_0x13a320){_0x2ffab6['push'](_0x2ffab6['shift']());}};_0x3ed205(++_0x4fa24a);}(_0x5c46,0x166));var _0x65c4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5c46[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x65c4('0x0'));var util=require(_0x65c4('0x1'));var moment=require(_0x65c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x65c4('0x3'));var fs=require('fs');var Redis=require(_0x65c4('0x4'));var db=require(_0x65c4('0x5'))['db'];var utils=require(_0x65c4('0x6'));var logger=require(_0x65c4('0x7'))(_0x65c4('0x8'));var config=require(_0x65c4('0x9'));var jayson=require(_0x65c4('0xa'));var client=jayson['client'][_0x65c4('0xb')]({'port':0x232a});config[_0x65c4('0xc')]=_[_0x65c4('0xd')](config[_0x65c4('0xc')],{'host':_0x65c4('0xe'),'port':0x18eb});var socket=require(_0x65c4('0xf'))(new Redis(config[_0x65c4('0xc')]));require(_0x65c4('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e7025,_0x57f69d,_0x4b73ef){return new BPromise(function(_0x18c4ac,_0x287a83){return client[_0x65c4('0x11')](_0x3e7025,_0x4b73ef)[_0x65c4('0x12')](function(_0x43f055){logger[_0x65c4('0x13')](_0x65c4('0x14'),_0x57f69d,_0x65c4('0x15'));logger[_0x65c4('0x16')](_0x65c4('0x17'),_0x57f69d,_0x65c4('0x15'),JSON['stringify'](_0x43f055));if(_0x43f055[_0x65c4('0x18')]){if(_0x43f055['error'][_0x65c4('0x19')]===0x1f4){logger[_0x65c4('0x18')](_0x65c4('0x14'),_0x57f69d,_0x43f055[_0x65c4('0x18')][_0x65c4('0x1a')]);return _0x287a83(_0x43f055[_0x65c4('0x18')][_0x65c4('0x1a')]);}logger[_0x65c4('0x18')](_0x65c4('0x14'),_0x57f69d,_0x43f055[_0x65c4('0x18')][_0x65c4('0x1a')]);return _0x18c4ac(_0x43f055['error'][_0x65c4('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x57f69d,_0x65c4('0x15'));_0x18c4ac(_0x43f055[_0x65c4('0x1b')]['message']);}})[_0x65c4('0x1c')](function(_0x37abe3){logger[_0x65c4('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x57f69d,_0x37abe3);_0x287a83(_0x37abe3);});});}exports[_0x65c4('0x1d')]=function(_0xdc86ac){var _0x309702=this;return new Promise(function(_0x4e2723,_0x25125e){return db[_0x65c4('0x1e')][_0x65c4('0x1f')]({'raw':_0xdc86ac['options']?_0xdc86ac[_0x65c4('0x20')][_0x65c4('0x21')]===undefined?!![]:![]:!![],'where':_0xdc86ac[_0x65c4('0x20')]?_0xdc86ac['options'][_0x65c4('0x22')]||null:null,'attributes':[[db[_0x65c4('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x65c4('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),_0x65c4('0x25')]]})[_0x65c4('0x12')](function(_0x304e9e){logger[_0x65c4('0x13')](_0x65c4('0x1d'),_0xdc86ac);logger['debug'](_0x65c4('0x1d'),_0xdc86ac,JSON['stringify'](_0x304e9e));_0x4e2723(_0x304e9e);})[_0x65c4('0x1c')](function(_0x361007){logger[_0x65c4('0x18')](_0x65c4('0x1d'),_0x361007['message'],_0xdc86ac);_0x25125e(_0x309702[_0x65c4('0x18')](0x1f4,_0x361007[_0x65c4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 002d7f5..c7c5c48 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 _0x644f=['emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x3ae1c8,_0x4f1c21){var _0x5a2621=function(_0x4d9dec){while(--_0x4d9dec){_0x3ae1c8['push'](_0x3ae1c8['shift']());}};_0x5a2621(++_0x4f1c21);}(_0x644f,0xc2));var _0xf644=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x644f[_0x5280f4];return _0xba93e7;};'use strict';var UserVoiceQueueRtEvents=require(_0xf644('0x0'));var events=[_0xf644('0x1'),'remove','update'];function createListener(_0x19242f,_0xc5044c){return function(_0x240500){_0xc5044c[_0xf644('0x2')](_0x19242f,_0x240500);};}function removeListener(_0x372b63,_0x3759da){return function(){UserVoiceQueueRtEvents[_0xf644('0x3')](_0x372b63,_0x3759da);};}exports[_0xf644('0x4')]=function(_0x9938ed){for(var _0x1a6cbb=0x0,_0x2c7aaf=events[_0xf644('0x5')];_0x1a6cbb<_0x2c7aaf;_0x1a6cbb++){var _0x50362e=events[_0x1a6cbb];var _0x2c2868=createListener(_0xf644('0x6')+_0x50362e,_0x9938ed);UserVoiceQueueRtEvents['on'](_0x50362e,_0x2c2868);}}; \ No newline at end of file +var _0xbb67=['removeListener','register','userVoiceQueueRt:','save','remove','update','emit'];(function(_0x309d31,_0x6a4e9c){var _0x55a4bf=function(_0x5cb736){while(--_0x5cb736){_0x309d31['push'](_0x309d31['shift']());}};_0x55a4bf(++_0x6a4e9c);}(_0xbb67,0x161));var _0x7bb6=function(_0x427582,_0x266a66){_0x427582=_0x427582-0x0;var _0x32ebe3=_0xbb67[_0x427582];return _0x32ebe3;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7bb6('0x0'),_0x7bb6('0x1'),_0x7bb6('0x2')];function createListener(_0x35c9ba,_0x2a1dcb){return function(_0x5b8771){_0x2a1dcb[_0x7bb6('0x3')](_0x35c9ba,_0x5b8771);};}function removeListener(_0x2c1ddb,_0x1f527c){return function(){UserVoiceQueueRtEvents[_0x7bb6('0x4')](_0x2c1ddb,_0x1f527c);};}exports[_0x7bb6('0x5')]=function(_0x139b0e){for(var _0x4b5232=0x0,_0x2a059b=events['length'];_0x4b5232<_0x2a059b;_0x4b5232++){var _0x45441a=events[_0x4b5232];var _0x15fb32=createListener(_0x7bb6('0x6')+_0x45441a,_0x139b0e);UserVoiceQueueRtEvents['on'](_0x45441a,_0x15fb32);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 9a52560..b721a67 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x370be6,_0x17c8c8){var _0xb512b2=function(_0x32b1a6){while(--_0x32b1a6){_0x370be6['push'](_0x370be6['shift']());}};_0xb512b2(++_0x17c8c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x33ea96,_0x31c832){var _0x25eab5=function(_0x10cb40){while(--_0x10cb40){_0x33ea96['push'](_0x33ea96['shift']());}};_0x25eab5(++_0x31c832);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 48b2676..42fab83 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 _0x9d73=['sequelize','exports','INTEGER'];(function(_0x5862ac,_0x33d115){var _0x20f43d=function(_0x58552a){while(--_0x58552a){_0x5862ac['push'](_0x5862ac['shift']());}};_0x20f43d(++_0x33d115);}(_0x9d73,0x1ef));var _0x39d7=function(_0x5e0d88,_0x364241){_0x5e0d88=_0x5e0d88-0x0;var _0x215a5e=_0x9d73[_0x5e0d88];return _0x215a5e;};'use strict';var Sequelize=require(_0x39d7('0x0'));module[_0x39d7('0x1')]={'penalty':{'type':Sequelize[_0x39d7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7f22=['INTEGER','sequelize'];(function(_0xa4e518,_0x17186f){var _0x10f521=function(_0x28c4ef){while(--_0x28c4ef){_0xa4e518['push'](_0xa4e518['shift']());}};_0x10f521(++_0x17186f);}(_0x7f22,0x1e5));var _0x27f2=function(_0x558e01,_0x120170){_0x558e01=_0x558e01-0x0;var _0x566d27=_0x7f22[_0x558e01];return _0x566d27;};'use strict';var Sequelize=require(_0x27f2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x27f2('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 39c406f..18d52fd 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 _0x6594=['./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0x6594,0x117));var _0x4659=function(_0x47fb54,_0x28698c){_0x47fb54=_0x47fb54-0x0;var _0x1139a7=_0x6594[_0x47fb54];return _0x1139a7;};'use strict';var _=require(_0x4659('0x0'));var util=require(_0x4659('0x1'));var logger=require('../../config/logger')(_0x4659('0x2'));var moment=require(_0x4659('0x3'));var BPromise=require(_0x4659('0x4'));var rp=require(_0x4659('0x5'));var fs=require('fs');var path=require(_0x4659('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4659('0x7'));module[_0x4659('0x8')]=function(_0x2368b5,_0x4250b9){return _0x2368b5['define'](_0x4659('0x9'),attributes,{'tableName':_0x4659('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f8a=['user_has_whatsapp_queues','lodash','../../config/logger','api','moment','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x106ae5,_0x42fe77){var _0x3c68d8=function(_0x1e91ae){while(--_0x1e91ae){_0x106ae5['push'](_0x106ae5['shift']());}};_0x3c68d8(++_0x42fe77);}(_0x6f8a,0x109));var _0xa6f8=function(_0x40afbd,_0x37f47a){_0x40afbd=_0x40afbd-0x0;var _0x21b2ed=_0x6f8a[_0x40afbd];return _0x21b2ed;};'use strict';var _=require(_0xa6f8('0x0'));var util=require('util');var logger=require(_0xa6f8('0x1'))(_0xa6f8('0x2'));var moment=require(_0xa6f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f8('0x4'));var rimraf=require(_0xa6f8('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6f8('0x6'));module[_0xa6f8('0x7')]=function(_0x4fe464,_0x53a23d){return _0x4fe464[_0xa6f8('0x8')](_0xa6f8('0x9'),attributes,{'tableName':_0xa6f8('0xa'),'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 461df33..7a12260 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 _0x9762=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird'];(function(_0x1ed8a6,_0x1df5e2){var _0x2b1750=function(_0x2219dc){while(--_0x2219dc){_0x1ed8a6['push'](_0x1ed8a6['shift']());}};_0x2b1750(++_0x1df5e2);}(_0x9762,0x115));var _0x2976=function(_0x17660d,_0x233288){_0x17660d=_0x17660d-0x0;var _0xce3b14=_0x9762[_0x17660d];return _0xce3b14;};'use strict';var _=require(_0x2976('0x0'));var util=require('util');var moment=require(_0x2976('0x1'));var BPromise=require(_0x2976('0x2'));var rs=require(_0x2976('0x3'));var fs=require('fs');var Redis=require(_0x2976('0x4'));var db=require(_0x2976('0x5'))['db'];var utils=require(_0x2976('0x6'));var logger=require(_0x2976('0x7'))(_0x2976('0x8'));var config=require(_0x2976('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2976('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47155d,_0x51204e,_0xfaf6ef){return new BPromise(function(_0x41f220,_0x1a8436){return client[_0x2976('0xb')](_0x47155d,_0xfaf6ef)[_0x2976('0xc')](function(_0x65243a){logger[_0x2976('0xd')](_0x2976('0xe'),_0x51204e,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x51204e,_0x2976('0xf'),JSON[_0x2976('0x10')](_0x65243a));if(_0x65243a[_0x2976('0x11')]){if(_0x65243a[_0x2976('0x11')]['code']===0x1f4){logger[_0x2976('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x51204e,_0x65243a['error']['message']);return _0x1a8436(_0x65243a[_0x2976('0x11')]['message']);}logger[_0x2976('0x11')](_0x2976('0xe'),_0x51204e,_0x65243a[_0x2976('0x11')][_0x2976('0x12')]);return _0x41f220(_0x65243a['error'][_0x2976('0x12')]);}else{logger['info'](_0x2976('0xe'),_0x51204e,_0x2976('0xf'));_0x41f220(_0x65243a['result'][_0x2976('0x12')]);}})[_0x2976('0x13')](function(_0x1c691f){logger[_0x2976('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x51204e,_0x1c691f);_0x1a8436(_0x1c691f);});});} \ No newline at end of file +var _0x9189=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2d93d4,_0x149172){var _0x44df30=function(_0x22e8d8){while(--_0x22e8d8){_0x2d93d4['push'](_0x2d93d4['shift']());}};_0x44df30(++_0x149172);}(_0x9189,0x141));var _0x9918=function(_0x19a33d,_0x11905d){_0x19a33d=_0x19a33d-0x0;var _0x4ab832=_0x9189[_0x19a33d];return _0x4ab832;};'use strict';var _=require(_0x9918('0x0'));var util=require(_0x9918('0x1'));var moment=require('moment');var BPromise=require(_0x9918('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9918('0x3'));var db=require(_0x9918('0x4'))['db'];var utils=require(_0x9918('0x5'));var logger=require(_0x9918('0x6'))(_0x9918('0x7'));var config=require(_0x9918('0x8'));var jayson=require(_0x9918('0x9'));var client=jayson[_0x9918('0xa')][_0x9918('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f8c8,_0x1af793,_0x32957d){return new BPromise(function(_0x2d92ec,_0x371e8d){return client[_0x9918('0xc')](_0x16f8c8,_0x32957d)[_0x9918('0xd')](function(_0x247446){logger[_0x9918('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1af793,_0x9918('0xf'));logger['debug'](_0x9918('0x10'),_0x1af793,_0x9918('0xf'),JSON[_0x9918('0x11')](_0x247446));if(_0x247446[_0x9918('0x12')]){if(_0x247446[_0x9918('0x12')]['code']===0x1f4){logger[_0x9918('0x12')](_0x9918('0x13'),_0x1af793,_0x247446[_0x9918('0x12')][_0x9918('0x14')]);return _0x371e8d(_0x247446[_0x9918('0x12')][_0x9918('0x14')]);}logger[_0x9918('0x12')](_0x9918('0x13'),_0x1af793,_0x247446['error']['message']);return _0x2d92ec(_0x247446[_0x9918('0x12')][_0x9918('0x14')]);}else{logger[_0x9918('0xe')](_0x9918('0x13'),_0x1af793,_0x9918('0xf'));_0x2d92ec(_0x247446[_0x9918('0x15')][_0x9918('0x14')]);}})[_0x9918('0x16')](function(_0x3f3984){logger[_0x9918('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1af793,_0x3f3984);_0x371e8d(_0x3f3984);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index c73a9d8..9e64f2f 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 _0x41f2=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x323bf6,_0x19aed6){var _0x18da88=function(_0x1111da){while(--_0x1111da){_0x323bf6['push'](_0x323bf6['shift']());}};_0x18da88(++_0x19aed6);}(_0x41f2,0x14f));var _0x241f=function(_0x38a4dd,_0x3f5e61){_0x38a4dd=_0x38a4dd-0x0;var _0x503559=_0x41f2[_0x38a4dd];return _0x503559;};'use strict';var multer=require(_0x241f('0x0'));var util=require(_0x241f('0x1'));var path=require('path');var timeout=require(_0x241f('0x2'));var express=require(_0x241f('0x3'));var router=express[_0x241f('0x4')]();var fs_extra=require(_0x241f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x241f('0x6'));var config=require(_0x241f('0x7'));var controller=require('./variable.controller');router[_0x241f('0x8')]('/',auth[_0x241f('0x9')](),controller[_0x241f('0xa')]);router[_0x241f('0x8')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xc')]);router[_0x241f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xe')]);router[_0x241f('0xf')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3308=['../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','connect-timeout','express','Router','fs-extra'];(function(_0x32a35e,_0x719f5f){var _0x2a2e31=function(_0x188c7a){while(--_0x188c7a){_0x32a35e['push'](_0x32a35e['shift']());}};_0x2a2e31(++_0x719f5f);}(_0x3308,0x12e));var _0x8330=function(_0x5cdcb7,_0x405fe6){_0x5cdcb7=_0x5cdcb7-0x0;var _0x17e730=_0x3308[_0x5cdcb7];return _0x17e730;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8330('0x0'));var express=require(_0x8330('0x1'));var router=express[_0x8330('0x2')]();var fs_extra=require(_0x8330('0x3'));var auth=require(_0x8330('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8330('0x5'));var controller=require(_0x8330('0x6'));router[_0x8330('0x7')]('/',auth[_0x8330('0x8')](),controller[_0x8330('0x9')]);router[_0x8330('0x7')]('/:id',auth[_0x8330('0x8')](),controller[_0x8330('0xa')]);router[_0x8330('0xb')]('/',auth['isAuthenticated'](),controller[_0x8330('0xc')]);router[_0x8330('0xd')]('/:id',auth[_0x8330('0x8')](),controller['update']);router[_0x8330('0xe')](_0x8330('0xf'),auth['isAuthenticated'](),controller[_0x8330('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index c0ea63f..90e4024 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 _0xe73c=['exports','STRING','name','sequelize'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xe73c,0x167));var _0xce73=function(_0x58543a,_0x4aa69a){_0x58543a=_0x58543a-0x0;var _0xc27be0=_0xe73c[_0x58543a];return _0xc27be0;};'use strict';var Sequelize=require(_0xce73('0x0'));module[_0xce73('0x1')]={'name':{'type':Sequelize[_0xce73('0x2')],'unique':_0xce73('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xce73('0x2')]}}; \ No newline at end of file +var _0x15f8=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15f8,0x149));var _0x815f=function(_0x49b3f7,_0x2c77be){_0x49b3f7=_0x49b3f7-0x0;var _0x376642=_0x15f8[_0x49b3f7];return _0x376642;};'use strict';var Sequelize=require(_0x815f('0x0'));module['exports']={'name':{'type':Sequelize[_0x815f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x815f('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index f6c75f3..eb51560 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 _0xc176=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','get','Variables','UserProfileResource','stack','name','send','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2fcf72,_0x426591){var _0x4a19e0=function(_0x380251){while(--_0x380251){_0x2fcf72['push'](_0x2fcf72['shift']());}};_0x4a19e0(++_0x426591);}(_0xc176,0x19d));var _0x6c17=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0xc176[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0x6c17('0x0'));var rimraf=require(_0x6c17('0x1'));var zipdir=require(_0x6c17('0x2'));var jsonpatch=require(_0x6c17('0x3'));var rp=require(_0x6c17('0x4'));var moment=require(_0x6c17('0x5'));var BPromise=require(_0x6c17('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6c17('0x7'));var sox=require(_0x6c17('0x8'));var csv=require(_0x6c17('0x9'));var ejs=require(_0x6c17('0xa'));var fs=require('fs');var fs_extra=require(_0x6c17('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6c17('0xc'));var jsforce=require(_0x6c17('0xd'));var deskjs=require(_0x6c17('0xe'));var toCsv=require(_0x6c17('0x9'));var querystring=require(_0x6c17('0xf'));var Papa=require(_0x6c17('0x10'));var Redis=require(_0x6c17('0x11'));var authService=require(_0x6c17('0x12'));var qs=require(_0x6c17('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c17('0x14'));var logger=require('../../config/logger')(_0x6c17('0x15'));var utils=require(_0x6c17('0x16'));var config=require(_0x6c17('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c17('0x18'))['db'];function respondWithStatusCode(_0x58fab4,_0x197dab){_0x197dab=_0x197dab||0xcc;return function(_0x59af11){if(_0x59af11){return _0x58fab4[_0x6c17('0x19')](_0x197dab);}return _0x58fab4[_0x6c17('0x1a')](_0x197dab)[_0x6c17('0x1b')]();};}function respondWithResult(_0x2dc881,_0x493ce4){_0x493ce4=_0x493ce4||0xc8;return function(_0x49ba59){if(_0x49ba59){return _0x2dc881[_0x6c17('0x1a')](_0x493ce4)[_0x6c17('0x1c')](_0x49ba59);}};}function respondWithFilteredResult(_0x5e827b,_0x8df1d7){return function(_0x5df8b8){if(_0x5df8b8){var _0x330769=typeof _0x8df1d7['offset']===_0x6c17('0x1d')&&typeof _0x8df1d7[_0x6c17('0x1e')]===_0x6c17('0x1d');var _0x2d5d21=_0x5df8b8[_0x6c17('0x1f')];var _0x599f6b=_0x330769?0x0:_0x8df1d7['offset'];var _0x4165b1=_0x330769?_0x5df8b8[_0x6c17('0x1f')]:_0x8df1d7[_0x6c17('0x20')]+_0x8df1d7[_0x6c17('0x1e')];var _0xdf82e6;if(_0x4165b1>=_0x2d5d21){_0x4165b1=_0x2d5d21;_0xdf82e6=0xc8;}else{_0xdf82e6=0xce;}_0x5e827b[_0x6c17('0x1a')](_0xdf82e6);return _0x5e827b[_0x6c17('0x21')](_0x6c17('0x22'),_0x599f6b+'-'+_0x4165b1+'/'+_0x2d5d21)[_0x6c17('0x1c')](_0x5df8b8);}return null;};}function patchUpdates(_0x9a562b){return function(_0x4d349b){try{jsonpatch[_0x6c17('0x23')](_0x4d349b,_0x9a562b,!![]);}catch(_0x1e72fb){return BPromise['reject'](_0x1e72fb);}return _0x4d349b[_0x6c17('0x24')]();};}function saveUpdates(_0x37e44c,_0x55ecd2){return function(_0x5c1392){if(_0x5c1392){return _0x5c1392[_0x6c17('0x25')](_0x37e44c)['then'](function(_0x3c83bb){return _0x3c83bb;});}return null;};}function removeEntity(_0xa89f12,_0x1b2154){return function(_0x11772e){if(_0x11772e){return _0x11772e[_0x6c17('0x26')]()[_0x6c17('0x27')](function(){var _0x3b7c33=_0x11772e[_0x6c17('0x28')]({'plain':!![]});var _0x2ec3ea=_0x6c17('0x29');return db[_0x6c17('0x2a')]['destroy']({'where':{'type':_0x2ec3ea,'resourceId':_0x3b7c33['id']}})[_0x6c17('0x27')](function(){return _0x11772e;});})[_0x6c17('0x27')](function(){_0xa89f12[_0x6c17('0x1a')](0xcc)[_0x6c17('0x1b')]();});}};}function handleEntityNotFound(_0x4091e9,_0x3f9505){return function(_0x1bfd9f){if(!_0x1bfd9f){_0x4091e9['sendStatus'](0x194);}return _0x1bfd9f;};}function handleError(_0x367064,_0x8b13e7){_0x8b13e7=_0x8b13e7||0x1f4;return function(_0xf54804){logger['error'](_0xf54804[_0x6c17('0x2b')]);if(_0xf54804[_0x6c17('0x2c')]){delete _0xf54804['name'];}_0x367064['status'](_0x8b13e7)[_0x6c17('0x2d')](_0xf54804);};}exports['index']=function(_0x4d8114,_0x5d6ae7){var _0x341421={},_0x3660cd={},_0x4b4a5c={'count':0x0,'rows':[]};var _0x29cba2=_[_0x6c17('0x2e')](db[_0x6c17('0x2f')]['rawAttributes'],function(_0x457d1){return{'name':_0x457d1[_0x6c17('0x30')],'type':_0x457d1[_0x6c17('0x31')][_0x6c17('0x32')]};});_0x3660cd[_0x6c17('0x33')]=_[_0x6c17('0x2e')](_0x29cba2,'name');_0x3660cd[_0x6c17('0x34')]=_[_0x6c17('0x35')](_0x4d8114[_0x6c17('0x34')]);_0x3660cd[_0x6c17('0x36')]=_[_0x6c17('0x37')](_0x3660cd[_0x6c17('0x33')],_0x3660cd['query']);_0x341421[_0x6c17('0x38')]=_[_0x6c17('0x37')](_0x3660cd['model'],qs[_0x6c17('0x39')](_0x4d8114[_0x6c17('0x34')][_0x6c17('0x39')]));_0x341421[_0x6c17('0x38')]=_0x341421['attributes'][_0x6c17('0x3a')]?_0x341421[_0x6c17('0x38')]:_0x3660cd[_0x6c17('0x33')];if(!_0x4d8114['query'][_0x6c17('0x3b')](_0x6c17('0x3c'))){_0x341421[_0x6c17('0x1e')]=qs[_0x6c17('0x1e')](_0x4d8114[_0x6c17('0x34')][_0x6c17('0x1e')]);_0x341421[_0x6c17('0x20')]=qs[_0x6c17('0x20')](_0x4d8114[_0x6c17('0x34')]['offset']);}_0x341421[_0x6c17('0x3d')]=qs[_0x6c17('0x3e')](_0x4d8114[_0x6c17('0x34')][_0x6c17('0x3e')]);_0x341421['where']=qs[_0x6c17('0x36')](_[_0x6c17('0x3f')](_0x4d8114[_0x6c17('0x34')],_0x3660cd[_0x6c17('0x36')]),_0x29cba2);if(_0x4d8114['query']['filter']){_0x341421['where']=_[_0x6c17('0x40')](_0x341421['where'],{'$or':_['map'](_0x29cba2,function(_0xa0fa12){if(_0xa0fa12['type']!==_0x6c17('0x41')){var _0x195e87={};_0x195e87[_0xa0fa12[_0x6c17('0x2c')]]={'$like':'%'+_0x4d8114[_0x6c17('0x34')]['filter']+'%'};return _0x195e87;}})});}_0x341421=_[_0x6c17('0x40')]({},_0x341421,_0x4d8114['options']);var _0x27cdfe={'where':_0x341421['where']};return db['Variable'][_0x6c17('0x1f')](_0x27cdfe)[_0x6c17('0x27')](function(_0x2df06b){_0x4b4a5c[_0x6c17('0x1f')]=_0x2df06b;if(_0x4d8114['query'][_0x6c17('0x42')]){_0x341421[_0x6c17('0x43')]=[{'all':!![]}];}return db[_0x6c17('0x2f')][_0x6c17('0x44')](_0x341421);})[_0x6c17('0x27')](function(_0x91e525){_0x4b4a5c[_0x6c17('0x45')]=_0x91e525;return _0x4b4a5c;})['then'](respondWithFilteredResult(_0x5d6ae7,_0x341421))['catch'](handleError(_0x5d6ae7,null));};exports[_0x6c17('0x46')]=function(_0x382697,_0x5cb542){var _0x4a8390={'raw':!![],'where':{'id':_0x382697[_0x6c17('0x47')]['id']}},_0x10e5cf={};_0x10e5cf[_0x6c17('0x33')]=_[_0x6c17('0x35')](db[_0x6c17('0x2f')][_0x6c17('0x48')]);_0x10e5cf[_0x6c17('0x34')]=_[_0x6c17('0x35')](_0x382697[_0x6c17('0x34')]);_0x10e5cf['filters']=_[_0x6c17('0x37')](_0x10e5cf[_0x6c17('0x33')],_0x10e5cf[_0x6c17('0x34')]);_0x4a8390['attributes']=_[_0x6c17('0x37')](_0x10e5cf[_0x6c17('0x33')],qs['fields'](_0x382697[_0x6c17('0x34')][_0x6c17('0x39')]));_0x4a8390[_0x6c17('0x38')]=_0x4a8390[_0x6c17('0x38')][_0x6c17('0x3a')]?_0x4a8390[_0x6c17('0x38')]:_0x10e5cf[_0x6c17('0x33')];if(_0x382697[_0x6c17('0x34')]['includeAll']){_0x4a8390[_0x6c17('0x43')]=[{'all':!![]}];}_0x4a8390=_['merge']({},_0x4a8390,_0x382697[_0x6c17('0x49')]);return db[_0x6c17('0x2f')][_0x6c17('0x4a')](_0x4a8390)[_0x6c17('0x27')](handleEntityNotFound(_0x5cb542,null))[_0x6c17('0x27')](respondWithResult(_0x5cb542,null))[_0x6c17('0x4b')](handleError(_0x5cb542,null));};exports[_0x6c17('0x4c')]=function(_0x126aba,_0x2126e1){return db[_0x6c17('0x2f')][_0x6c17('0x4c')](_0x126aba['body'],{})[_0x6c17('0x27')](function(_0x535b31){var _0x5b133e=_0x126aba[_0x6c17('0x4d')][_0x6c17('0x28')]({'plain':!![]});if(!_0x5b133e)throw new Error(_0x6c17('0x4e'));if(_0x5b133e[_0x6c17('0x4f')]===_0x6c17('0x4d')){var _0x32702b=_0x535b31[_0x6c17('0x28')]({'plain':!![]});var _0x5c0e79='Variables';return db[_0x6c17('0x50')]['find']({'where':{'name':_0x5c0e79,'userProfileId':_0x5b133e[_0x6c17('0x51')]},'raw':!![]})[_0x6c17('0x27')](function(_0x4b428f){if(_0x4b428f&&_0x4b428f[_0x6c17('0x52')]===0x0){return db['UserProfileResource'][_0x6c17('0x4c')]({'name':_0x32702b['name'],'resourceId':_0x32702b['id'],'type':_0x4b428f[_0x6c17('0x2c')],'sectionId':_0x4b428f['id']},{})[_0x6c17('0x27')](function(){return _0x535b31;});}else{return _0x535b31;}})[_0x6c17('0x4b')](function(_0x2915c7){logger[_0x6c17('0x53')](_0x6c17('0x54'),_0x2915c7);throw _0x2915c7;});}return _0x535b31;})['then'](respondWithResult(_0x2126e1,0xc9))[_0x6c17('0x4b')](handleError(_0x2126e1,null));};exports[_0x6c17('0x25')]=function(_0x1f292d,_0x199b64){if(_0x1f292d[_0x6c17('0x55')]['id']){delete _0x1f292d[_0x6c17('0x55')]['id'];}return db['Variable']['find']({'where':{'id':_0x1f292d[_0x6c17('0x47')]['id']}})['then'](handleEntityNotFound(_0x199b64,null))[_0x6c17('0x27')](saveUpdates(_0x1f292d[_0x6c17('0x55')],null))[_0x6c17('0x27')](respondWithResult(_0x199b64,null))[_0x6c17('0x4b')](handleError(_0x199b64,null));};exports[_0x6c17('0x26')]=function(_0x1a81b1,_0x2eded8){return db[_0x6c17('0x2f')][_0x6c17('0x4a')]({'where':{'id':_0x1a81b1[_0x6c17('0x47')]['id']}})[_0x6c17('0x27')](handleEntityNotFound(_0x2eded8,null))[_0x6c17('0x27')](removeEntity(_0x2eded8,null))[_0x6c17('0x4b')](handleError(_0x2eded8,null));}; \ No newline at end of file +var _0x2257=['fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','name','options','Variable','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','end','error','stack','send','index','rawAttributes'];(function(_0x3950a8,_0x9a9ea8){var _0x41ebd0=function(_0x3eaeda){while(--_0x3eaeda){_0x3950a8['push'](_0x3950a8['shift']());}};_0x41ebd0(++_0x9a9ea8);}(_0x2257,0xc8));var _0x7225=function(_0x202cf5,_0x5c6374){_0x202cf5=_0x202cf5-0x0;var _0x36eea5=_0x2257[_0x202cf5];return _0x36eea5;};'use strict';var emlformat=require(_0x7225('0x0'));var rimraf=require(_0x7225('0x1'));var zipdir=require(_0x7225('0x2'));var jsonpatch=require(_0x7225('0x3'));var rp=require(_0x7225('0x4'));var moment=require(_0x7225('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7225('0x6'));var util=require(_0x7225('0x7'));var path=require(_0x7225('0x8'));var sox=require(_0x7225('0x9'));var csv=require(_0x7225('0xa'));var ejs=require(_0x7225('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7225('0xc'));var squel=require(_0x7225('0xd'));var crypto=require(_0x7225('0xe'));var jsforce=require(_0x7225('0xf'));var deskjs=require(_0x7225('0x10'));var toCsv=require(_0x7225('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7225('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7225('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7225('0x13'))(_0x7225('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7225('0x15'));var db=require(_0x7225('0x16'))['db'];function respondWithStatusCode(_0x2965a5,_0xf09fba){_0xf09fba=_0xf09fba||0xcc;return function(_0x2c42f8){if(_0x2c42f8){return _0x2965a5['sendStatus'](_0xf09fba);}return _0x2965a5[_0x7225('0x17')](_0xf09fba)['end']();};}function respondWithResult(_0x3b765b,_0x3b338a){_0x3b338a=_0x3b338a||0xc8;return function(_0x3add31){if(_0x3add31){return _0x3b765b['status'](_0x3b338a)[_0x7225('0x18')](_0x3add31);}};}function respondWithFilteredResult(_0x2f46c4,_0x12fe87){return function(_0x23d64f){if(_0x23d64f){var _0x341b0f=typeof _0x12fe87[_0x7225('0x19')]===_0x7225('0x1a')&&typeof _0x12fe87[_0x7225('0x1b')]===_0x7225('0x1a');var _0x35abad=_0x23d64f[_0x7225('0x1c')];var _0x3ba7ac=_0x341b0f?0x0:_0x12fe87[_0x7225('0x19')];var _0x3ff049=_0x341b0f?_0x23d64f[_0x7225('0x1c')]:_0x12fe87[_0x7225('0x19')]+_0x12fe87[_0x7225('0x1b')];var _0x2ec14e;if(_0x3ff049>=_0x35abad){_0x3ff049=_0x35abad;_0x2ec14e=0xc8;}else{_0x2ec14e=0xce;}_0x2f46c4[_0x7225('0x17')](_0x2ec14e);return _0x2f46c4[_0x7225('0x1d')](_0x7225('0x1e'),_0x3ba7ac+'-'+_0x3ff049+'/'+_0x35abad)['json'](_0x23d64f);}return null;};}function patchUpdates(_0x50cf12){return function(_0x5607a9){try{jsonpatch['apply'](_0x5607a9,_0x50cf12,!![]);}catch(_0x5d9dc4){return BPromise[_0x7225('0x1f')](_0x5d9dc4);}return _0x5607a9[_0x7225('0x20')]();};}function saveUpdates(_0x11e1e7,_0x2526c8){return function(_0x35e555){if(_0x35e555){return _0x35e555[_0x7225('0x21')](_0x11e1e7)[_0x7225('0x22')](function(_0x248596){return _0x248596;});}return null;};}function removeEntity(_0x2d899c,_0x2d79d8){return function(_0x564c31){if(_0x564c31){return _0x564c31[_0x7225('0x23')]()['then'](function(){var _0x18b82b=_0x564c31[_0x7225('0x24')]({'plain':!![]});var _0x259049='Variables';return db['UserProfileResource']['destroy']({'where':{'type':_0x259049,'resourceId':_0x18b82b['id']}})[_0x7225('0x22')](function(){return _0x564c31;});})['then'](function(){_0x2d899c[_0x7225('0x17')](0xcc)[_0x7225('0x25')]();});}};}function handleEntityNotFound(_0x353a18,_0x2a7dbe){return function(_0x3c494a){if(!_0x3c494a){_0x353a18['sendStatus'](0x194);}return _0x3c494a;};}function handleError(_0x42d72f,_0x1e7533){_0x1e7533=_0x1e7533||0x1f4;return function(_0x154dfd){logger[_0x7225('0x26')](_0x154dfd[_0x7225('0x27')]);if(_0x154dfd['name']){delete _0x154dfd['name'];}_0x42d72f[_0x7225('0x17')](_0x1e7533)[_0x7225('0x28')](_0x154dfd);};}exports[_0x7225('0x29')]=function(_0x3f92c5,_0x346950){var _0x22b8c1={},_0x311436={},_0x37b2a9={'count':0x0,'rows':[]};var _0x3c9d63=_['map'](db['Variable'][_0x7225('0x2a')],function(_0x4ae216){return{'name':_0x4ae216[_0x7225('0x2b')],'type':_0x4ae216[_0x7225('0x2c')]['key']};});_0x311436[_0x7225('0x2d')]=_[_0x7225('0x2e')](_0x3c9d63,'name');_0x311436[_0x7225('0x2f')]=_[_0x7225('0x30')](_0x3f92c5[_0x7225('0x2f')]);_0x311436[_0x7225('0x31')]=_['intersection'](_0x311436[_0x7225('0x2d')],_0x311436[_0x7225('0x2f')]);_0x22b8c1[_0x7225('0x32')]=_[_0x7225('0x33')](_0x311436[_0x7225('0x2d')],qs[_0x7225('0x34')](_0x3f92c5[_0x7225('0x2f')][_0x7225('0x34')]));_0x22b8c1['attributes']=_0x22b8c1[_0x7225('0x32')][_0x7225('0x35')]?_0x22b8c1[_0x7225('0x32')]:_0x311436[_0x7225('0x2d')];if(!_0x3f92c5[_0x7225('0x2f')][_0x7225('0x36')](_0x7225('0x37'))){_0x22b8c1[_0x7225('0x1b')]=qs[_0x7225('0x1b')](_0x3f92c5[_0x7225('0x2f')][_0x7225('0x1b')]);_0x22b8c1[_0x7225('0x19')]=qs[_0x7225('0x19')](_0x3f92c5['query']['offset']);}_0x22b8c1[_0x7225('0x38')]=qs['sort'](_0x3f92c5[_0x7225('0x2f')]['sort']);_0x22b8c1['where']=qs[_0x7225('0x31')](_[_0x7225('0x39')](_0x3f92c5['query'],_0x311436['filters']),_0x3c9d63);if(_0x3f92c5[_0x7225('0x2f')][_0x7225('0x3a')]){_0x22b8c1[_0x7225('0x3b')]=_[_0x7225('0x3c')](_0x22b8c1[_0x7225('0x3b')],{'$or':_[_0x7225('0x2e')](_0x3c9d63,function(_0x42b4f8){if(_0x42b4f8[_0x7225('0x2c')]!==_0x7225('0x3d')){var _0x29bcf0={};_0x29bcf0[_0x42b4f8[_0x7225('0x3e')]]={'$like':'%'+_0x3f92c5['query'][_0x7225('0x3a')]+'%'};return _0x29bcf0;}})});}_0x22b8c1=_[_0x7225('0x3c')]({},_0x22b8c1,_0x3f92c5[_0x7225('0x3f')]);var _0x34cdd4={'where':_0x22b8c1['where']};return db[_0x7225('0x40')][_0x7225('0x1c')](_0x34cdd4)['then'](function(_0x3bbadb){_0x37b2a9[_0x7225('0x1c')]=_0x3bbadb;if(_0x3f92c5[_0x7225('0x2f')]['includeAll']){_0x22b8c1[_0x7225('0x41')]=[{'all':!![]}];}return db[_0x7225('0x40')][_0x7225('0x42')](_0x22b8c1);})[_0x7225('0x22')](function(_0x300b5f){_0x37b2a9[_0x7225('0x43')]=_0x300b5f;return _0x37b2a9;})[_0x7225('0x22')](respondWithFilteredResult(_0x346950,_0x22b8c1))[_0x7225('0x44')](handleError(_0x346950,null));};exports[_0x7225('0x45')]=function(_0x2bd624,_0x3ccea1){var _0x43aa30={'raw':!![],'where':{'id':_0x2bd624[_0x7225('0x46')]['id']}},_0x187e25={};_0x187e25['model']=_['keys'](db[_0x7225('0x40')][_0x7225('0x2a')]);_0x187e25[_0x7225('0x2f')]=_['keys'](_0x2bd624[_0x7225('0x2f')]);_0x187e25[_0x7225('0x31')]=_[_0x7225('0x33')](_0x187e25[_0x7225('0x2d')],_0x187e25['query']);_0x43aa30[_0x7225('0x32')]=_['intersection'](_0x187e25[_0x7225('0x2d')],qs[_0x7225('0x34')](_0x2bd624[_0x7225('0x2f')]['fields']));_0x43aa30[_0x7225('0x32')]=_0x43aa30[_0x7225('0x32')][_0x7225('0x35')]?_0x43aa30[_0x7225('0x32')]:_0x187e25['model'];if(_0x2bd624[_0x7225('0x2f')]['includeAll']){_0x43aa30[_0x7225('0x41')]=[{'all':!![]}];}_0x43aa30=_['merge']({},_0x43aa30,_0x2bd624[_0x7225('0x3f')]);return db[_0x7225('0x40')][_0x7225('0x47')](_0x43aa30)['then'](handleEntityNotFound(_0x3ccea1,null))['then'](respondWithResult(_0x3ccea1,null))[_0x7225('0x44')](handleError(_0x3ccea1,null));};exports[_0x7225('0x48')]=function(_0x1b58f1,_0x177306){return db[_0x7225('0x40')][_0x7225('0x48')](_0x1b58f1['body'],{})[_0x7225('0x22')](function(_0x98958d){var _0xb3f8dd=_0x1b58f1[_0x7225('0x49')]['get']({'plain':!![]});if(!_0xb3f8dd)throw new Error(_0x7225('0x4a'));if(_0xb3f8dd['role']===_0x7225('0x49')){var _0x4c4938=_0x98958d[_0x7225('0x24')]({'plain':!![]});var _0x284a24=_0x7225('0x4b');return db[_0x7225('0x4c')][_0x7225('0x47')]({'where':{'name':_0x284a24,'userProfileId':_0xb3f8dd[_0x7225('0x4d')]},'raw':!![]})['then'](function(_0x55aa66){if(_0x55aa66&&_0x55aa66[_0x7225('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c4938['name'],'resourceId':_0x4c4938['id'],'type':_0x55aa66[_0x7225('0x3e')],'sectionId':_0x55aa66['id']},{})[_0x7225('0x22')](function(){return _0x98958d;});}else{return _0x98958d;}})['catch'](function(_0x4dfb08){logger[_0x7225('0x26')](_0x7225('0x4f'),_0x4dfb08);throw _0x4dfb08;});}return _0x98958d;})[_0x7225('0x22')](respondWithResult(_0x177306,0xc9))[_0x7225('0x44')](handleError(_0x177306,null));};exports[_0x7225('0x21')]=function(_0x24893a,_0x2cb967){if(_0x24893a[_0x7225('0x50')]['id']){delete _0x24893a[_0x7225('0x50')]['id'];}return db['Variable'][_0x7225('0x47')]({'where':{'id':_0x24893a[_0x7225('0x46')]['id']}})[_0x7225('0x22')](handleEntityNotFound(_0x2cb967,null))['then'](saveUpdates(_0x24893a[_0x7225('0x50')],null))[_0x7225('0x22')](respondWithResult(_0x2cb967,null))[_0x7225('0x44')](handleError(_0x2cb967,null));};exports[_0x7225('0x23')]=function(_0xd587d4,_0x505d3b){return db['Variable']['find']({'where':{'id':_0xd587d4[_0x7225('0x46')]['id']}})[_0x7225('0x22')](handleEntityNotFound(_0x505d3b,null))[_0x7225('0x22')](removeEntity(_0x505d3b,null))[_0x7225('0x44')](handleError(_0x505d3b,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a59d7a1..6d1b733 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 _0x2d5b=['Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./variable.attributes','exports','define'];(function(_0x5d4bb9,_0x5f4985){var _0x4d4848=function(_0x1b15a4){while(--_0x1b15a4){_0x5d4bb9['push'](_0x5d4bb9['shift']());}};_0x4d4848(++_0x5f4985);}(_0x2d5b,0x91));var _0xb2d5=function(_0x5ab238,_0x4ddda9){_0x5ab238=_0x5ab238-0x0;var _0x236db6=_0x2d5b[_0x5ab238];return _0x236db6;};'use strict';var _=require(_0xb2d5('0x0'));var util=require(_0xb2d5('0x1'));var logger=require(_0xb2d5('0x2'))(_0xb2d5('0x3'));var moment=require(_0xb2d5('0x4'));var BPromise=require(_0xb2d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2d5('0x6'));var rimraf=require('rimraf');var config=require(_0xb2d5('0x7'));var attributes=require(_0xb2d5('0x8'));module[_0xb2d5('0x9')]=function(_0x529096,_0x31c9d2){return _0x529096[_0xb2d5('0xa')](_0xb2d5('0xb'),attributes,{'tableName':_0xb2d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa94b=['lodash','../../config/logger','moment','request-promise','../../config/environment','./variable.attributes','exports','define','tools_variables'];(function(_0x11caab,_0x5c9ae7){var _0x17cdde=function(_0x423ff4){while(--_0x423ff4){_0x11caab['push'](_0x11caab['shift']());}};_0x17cdde(++_0x5c9ae7);}(_0xa94b,0x90));var _0xba94=function(_0x18e9a5,_0x2f941b){_0x18e9a5=_0x18e9a5-0x0;var _0x279bd8=_0xa94b[_0x18e9a5];return _0x279bd8;};'use strict';var _=require(_0xba94('0x0'));var util=require('util');var logger=require(_0xba94('0x1'))('api');var moment=require(_0xba94('0x2'));var BPromise=require('bluebird');var rp=require(_0xba94('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba94('0x4'));var attributes=require(_0xba94('0x5'));module[_0xba94('0x6')]=function(_0x19c6dd,_0x2c308e){return _0x19c6dd[_0xba94('0x7')]('Variable',attributes,{'tableName':_0xba94('0x8'),'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 777d13a..0493742 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x5bf3dc,_0x588d22){var _0x5759b6=function(_0x58c29e){while(--_0x58c29e){_0x5bf3dc['push'](_0x5bf3dc['shift']());}};_0x5759b6(++_0x588d22);}(_0xf494,0x1c6));var _0x4f49=function(_0x287805,_0x4ac114){_0x287805=_0x287805-0x0;var _0x5ce53e=_0xf494[_0x287805];return _0x5ce53e;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x186b0e,_0x57b796){var _0x1f69b1=function(_0x184936){while(--_0x184936){_0x186b0e['push'](_0x186b0e['shift']());}};_0x1f69b1(++_0x57b796);}(_0xe14b,0x93));var _0xbe14=function(_0x8a48b4,_0x542906){_0x8a48b4=_0x8a48b4-0x0;var _0x5e95ac=_0xe14b[_0x8a48b4];return _0x5e95ac;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a1dffa8..8060edf 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 _0x7460=['get','isAuthenticated','canUpdate','/reset','reset','/pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller'];(function(_0x1ad0c7,_0x25e4e8){var _0x4056b0=function(_0x4bc732){while(--_0x4bc732){_0x1ad0c7['push'](_0x1ad0c7['shift']());}};_0x4056b0(++_0x25e4e8);}(_0x7460,0x1e6));var _0x0746=function(_0x27af80,_0x396b70){_0x27af80=_0x27af80-0x0;var _0x855bc7=_0x7460[_0x27af80];return _0x855bc7;};'use strict';var express=require(_0x0746('0x0'));var router=express[_0x0746('0x1')]();var auth=require(_0x0746('0x2'));var controller=require(_0x0746('0x3'));router['get']('/',controller['index']);router[_0x0746('0x4')]('/fetch',auth[_0x0746('0x5')](),auth[_0x0746('0x6')](),controller['fetch']);router[_0x0746('0x4')](_0x0746('0x7'),auth[_0x0746('0x5')](),auth[_0x0746('0x6')](),controller[_0x0746('0x8')]);router[_0x0746('0x4')](_0x0746('0x9'),auth[_0x0746('0x5')](),auth['canUpdate'](),controller['pull']);router['get']('/restart',auth['isAuthenticated'](),controller[_0x0746('0xa')]);router[_0x0746('0x4')](_0x0746('0xb'),controller[_0x0746('0xc')]);module[_0x0746('0xd')]=router; \ No newline at end of file +var _0xc0c9=['reset','/pull','/restart','restart','/migrations','migrations','express','Router','./version.controller','index','get','/fetch','isAuthenticated','fetch','/reset','canUpdate'];(function(_0x1e191a,_0x547422){var _0xdd2950=function(_0x15731a){while(--_0x15731a){_0x1e191a['push'](_0x1e191a['shift']());}};_0xdd2950(++_0x547422);}(_0xc0c9,0x66));var _0x9c0c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xc0c9[_0x297fd3];return _0x2af381;};'use strict';var express=require(_0x9c0c('0x0'));var router=express[_0x9c0c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9c0c('0x2'));router['get']('/',controller[_0x9c0c('0x3')]);router[_0x9c0c('0x4')](_0x9c0c('0x5'),auth[_0x9c0c('0x6')](),auth['canUpdate'](),controller[_0x9c0c('0x7')]);router['get'](_0x9c0c('0x8'),auth[_0x9c0c('0x6')](),auth[_0x9c0c('0x9')](),controller[_0x9c0c('0xa')]);router['get'](_0x9c0c('0xb'),auth[_0x9c0c('0x6')](),auth[_0x9c0c('0x9')](),controller['pull']);router[_0x9c0c('0x4')](_0x9c0c('0xc'),auth['isAuthenticated'](),controller[_0x9c0c('0xd')]);router[_0x9c0c('0x4')](_0x9c0c('0xe'),controller[_0x9c0c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e65ae5e..6dbc4a6 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 _0x164f=['server','replace','.js','push','length','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','index','version','query','latest','fetch','exports','2.0.0','json','status','origin','master','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root'];(function(_0x454697,_0x2e5871){var _0x4ef0aa=function(_0x5b7a8a){while(--_0x5b7a8a){_0x454697['push'](_0x454697['shift']());}};_0x4ef0aa(++_0x2e5871);}(_0x164f,0x19b));var _0xf164=function(_0x28f09a,_0x1f0ca0){_0x28f09a=_0x28f09a-0x0;var _0xdf030f=_0x164f[_0x28f09a];return _0xdf030f;};'use strict';var Umzug=require('umzug');var path=require(_0xf164('0x0'));var fs=require('fs');var _=require(_0xf164('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xf164('0x2'));var exec=require(_0xf164('0x3'))[_0xf164('0x4')];var db=require(_0xf164('0x5'))['db'];var config=require(_0xf164('0x6'));var pm2=require(_0xf164('0x7'));var logger=require('../../config/logger')(_0xf164('0x8'));var git=require(_0xf164('0x9'))(config['root']);exports[_0xf164('0xa')]=function(_0x2710ed,_0x4a1c69){var _0x50a604={'current':module['exports'][_0xf164('0xb')],'phonebar':0x2};if(_0x2710ed[_0xf164('0xc')]&&_0x2710ed[_0xf164('0xc')][_0xf164('0xd')]){return git[_0xf164('0xe')]()['tags'](function(_0x144832,_0x33e7b7){_0x50a604[_0xf164('0xd')]=(_0x144832?module[_0xf164('0xf')]['version']:_0x33e7b7[_0xf164('0xd')])||_0xf164('0x10');return _0x4a1c69['status'](0xc8)[_0xf164('0x11')](_0x50a604);});}else{return _0x4a1c69[_0xf164('0x12')](0xc8)['json'](_0x50a604);}};exports[_0xf164('0xe')]=function(_0xdbd516,_0x2a38ae){return git[_0xf164('0xe')]([_0xf164('0x13'),_0xf164('0x14')],function(_0x3903d9){if(_0x3903d9){logger[_0xf164('0x15')](_0x3903d9);return _0x2a38ae[_0xf164('0x12')](0x1f4)['json'](_0x3903d9);}logger['info'](_0xf164('0x16'));return _0x2a38ae['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xf164('0x17')]=function(_0x15b92a,_0x3ef174){return git[_0xf164('0x17')]([_0xf164('0x18'),_0xf164('0x19')],function(_0xfca789){if(_0xfca789){logger[_0xf164('0x15')](_0xfca789);return _0x3ef174[_0xf164('0x12')](0x1f4)[_0xf164('0x11')](_0xfca789);}logger[_0xf164('0x1a')](_0xf164('0x1b'));return _0x3ef174[_0xf164('0x12')](0xc8)[_0xf164('0x11')]({'output':_0xf164('0x1c')});});};exports[_0xf164('0x1d')]=function(_0x50f4a2,_0x133eba){exec('npm\x20install\x20--production',function(_0x4e0538,_0x5674fb,_0x4c41dc){logger[_0xf164('0x1a')](_0x5674fb);logger['info'](_0x4c41dc);if(_0x4e0538){logger[_0xf164('0x15')](_0x4e0538);return _0x133eba[_0xf164('0x12')](0x1f4)[_0xf164('0x11')](_0x4e0538);}return _0x133eba[_0xf164('0x12')](0xc8)[_0xf164('0x11')]({'output':_0x5674fb});});};exports[_0xf164('0x1e')]=function(_0x3117fd,_0x5a3f51){return pm2[_0xf164('0x1e')](_0xf164('0x1f'))[_0xf164('0x20')](function(_0xc76d4c){logger[_0xf164('0x1a')]('pm2\x20restart\x20motion\x20%s',_0xc76d4c);return _0x5a3f51['status'](0xc8)[_0xf164('0x11')]({'output':_0xf164('0x21')});})[_0xf164('0x22')](function(_0x3d495d){logger[_0xf164('0x15')](_0x3d495d);return _0x5a3f51['status'](0x1f4)['json'](_0x3d495d);});};exports[_0xf164('0x23')]=function(_0x532403,_0x451239){var _0x2d8533=fs[_0xf164('0x24')](path[_0xf164('0x25')](config[_0xf164('0x26')],_0xf164('0x27'),'migrations'));var _0x2b2f51=[];for(var _0x38d6c2=0x0;_0x38d6c2<_0x2d8533['length'];_0x38d6c2++){var _0x2c25d2=_0x2d8533[_0x38d6c2][_0xf164('0x28')](_0xf164('0x29'),'');if(compareVersions(module['exports'][_0xf164('0xb')],_0x2c25d2)===-0x1){_0x2b2f51[_0xf164('0x2a')](_0x2c25d2);}}if(_0x2b2f51[_0xf164('0x2b')]){var _0x44cba5=_0x2b2f51['sort'](compareVersions);var _0x58e073=new Umzug({'storage':_0xf164('0x2c'),'storageOptions':{'model':db[_0xf164('0x2d')],'modelName':_0xf164('0x2d'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0xf164('0x2e')](),db[_0xf164('0x2c')]['constructor'],function(){throw new Error(_0xf164('0x2f'));}],'path':path[_0xf164('0x25')](config[_0xf164('0x26')],_0xf164('0x27'),_0xf164('0x23')),'pattern':/\.js$/}});_0x58e073['up']({'migrations':_['map'](_0x44cba5,function(_0x3fb9e7){return _0x3fb9e7+_0xf164('0x29');})})[_0xf164('0x20')](function(){return _0x451239['status'](0xc8)[_0xf164('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf164('0xf')]['version']+'\x20to\x20'+_['last'](_0x44cba5),'migrations':_['join'](_0x44cba5)});})[_0xf164('0x22')](function(_0x6ca1b4){if(_0x6ca1b4 instanceof db['sequelize'][_0xf164('0x30')]){return _0x451239[_0xf164('0x12')](0xc8)['json']({'output':_0xf164('0x31')});}else{return _0x451239['status'](0x1f4)[_0xf164('0x11')](_0x6ca1b4);}});}else{return _0x451239[_0xf164('0x12')](0xc8)[_0xf164('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xf539=['error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','catch','migrations','readdirSync','join','server','length','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','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','origin','master'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf539,0x19a));var _0x9f53=function(_0x53cd26,_0x2da83d){_0x53cd26=_0x53cd26-0x0;var _0x1069cb=_0xf539[_0x53cd26];return _0x1069cb;};'use strict';var Umzug=require(_0x9f53('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x9f53('0x1'));var pkginfo=require(_0x9f53('0x2'))(module,_0x9f53('0x3'));var compareVersions=require(_0x9f53('0x4'));var exec=require(_0x9f53('0x5'))[_0x9f53('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x9f53('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x9f53('0x8'))(_0x9f53('0x9'));var git=require(_0x9f53('0xa'))(config[_0x9f53('0xb')]);exports[_0x9f53('0xc')]=function(_0x21f959,_0x59c4d0){var _0x1ce952={'current':module[_0x9f53('0xd')][_0x9f53('0x3')],'phonebar':0x2};if(_0x21f959[_0x9f53('0xe')]&&_0x21f959[_0x9f53('0xe')][_0x9f53('0xf')]){return git[_0x9f53('0x10')]()[_0x9f53('0x11')](function(_0x3017f9,_0x263918){_0x1ce952[_0x9f53('0xf')]=(_0x3017f9?module['exports'][_0x9f53('0x3')]:_0x263918[_0x9f53('0xf')])||_0x9f53('0x12');return _0x59c4d0[_0x9f53('0x13')](0xc8)['json'](_0x1ce952);});}else{return _0x59c4d0[_0x9f53('0x13')](0xc8)['json'](_0x1ce952);}};exports[_0x9f53('0x10')]=function(_0x86819f,_0x30aa5d){return git[_0x9f53('0x10')]([_0x9f53('0x14'),_0x9f53('0x15')],function(_0x5010b9){if(_0x5010b9){logger[_0x9f53('0x16')](_0x5010b9);return _0x30aa5d[_0x9f53('0x13')](0x1f4)[_0x9f53('0x17')](_0x5010b9);}logger[_0x9f53('0x18')](_0x9f53('0x19'));return _0x30aa5d[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x1a')});});};exports['reset']=function(_0x5325a1,_0x1dd23a){return git[_0x9f53('0x1b')]([_0x9f53('0x1c'),_0x9f53('0x1d')],function(_0x340bd2){if(_0x340bd2){logger[_0x9f53('0x16')](_0x340bd2);return _0x1dd23a['status'](0x1f4)[_0x9f53('0x17')](_0x340bd2);}logger[_0x9f53('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1dd23a[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x1e')});});};exports[_0x9f53('0x1f')]=function(_0x80b107,_0x31787f){exec(_0x9f53('0x20'),function(_0x1b64ad,_0x1bd5e8,_0x2fb6ab){logger[_0x9f53('0x18')](_0x1bd5e8);logger[_0x9f53('0x18')](_0x2fb6ab);if(_0x1b64ad){logger['error'](_0x1b64ad);return _0x31787f[_0x9f53('0x13')](0x1f4)[_0x9f53('0x17')](_0x1b64ad);}return _0x31787f['status'](0xc8)['json']({'output':_0x1bd5e8});});};exports[_0x9f53('0x21')]=function(_0x5ba388,_0x4cff03){return pm2[_0x9f53('0x21')](_0x9f53('0x22'))[_0x9f53('0x23')](function(_0x3bc65e){logger[_0x9f53('0x18')]('pm2\x20restart\x20motion\x20%s',_0x3bc65e);return _0x4cff03[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9f53('0x24')](function(_0x3c24f1){logger[_0x9f53('0x16')](_0x3c24f1);return _0x4cff03[_0x9f53('0x13')](0x1f4)[_0x9f53('0x17')](_0x3c24f1);});};exports[_0x9f53('0x25')]=function(_0x5d8da9,_0x54e2a7){var _0x33446f=fs[_0x9f53('0x26')](path[_0x9f53('0x27')](config['root'],_0x9f53('0x28'),_0x9f53('0x25')));var _0x4486ff=[];for(var _0x34ee08=0x0;_0x34ee08<_0x33446f[_0x9f53('0x29')];_0x34ee08++){var _0x49661c=_0x33446f[_0x34ee08]['replace']('.js','');if(compareVersions(module['exports'][_0x9f53('0x3')],_0x49661c)===-0x1){_0x4486ff['push'](_0x49661c);}}if(_0x4486ff[_0x9f53('0x29')]){var _0x2d647c=_0x4486ff['sort'](compareVersions);var _0x56e594=new Umzug({'storage':_0x9f53('0x2a'),'storageOptions':{'model':db[_0x9f53('0x2b')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x9f53('0x2a')][_0x9f53('0x2c')](),db[_0x9f53('0x2a')][_0x9f53('0x2d')],function(){throw new Error(_0x9f53('0x2e'));}],'path':path[_0x9f53('0x27')](config['root'],_0x9f53('0x28'),_0x9f53('0x25')),'pattern':/\.js$/}});_0x56e594['up']({'migrations':_[_0x9f53('0x2f')](_0x2d647c,function(_0x4ac718){return _0x4ac718+_0x9f53('0x30');})})[_0x9f53('0x23')](function(){return _0x54e2a7[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x31')+module[_0x9f53('0xd')][_0x9f53('0x3')]+_0x9f53('0x32')+_[_0x9f53('0x33')](_0x2d647c),'migrations':_[_0x9f53('0x27')](_0x2d647c)});})[_0x9f53('0x24')](function(_0x1dd8a9){if(_0x1dd8a9 instanceof db[_0x9f53('0x2a')][_0x9f53('0x34')]){return _0x54e2a7['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x54e2a7['status'](0x1f4)[_0x9f53('0x17')](_0x1dd8a9);}});}else{return _0x54e2a7[_0x9f53('0x13')](0xc8)[_0x9f53('0x17')]({'output':_0x9f53('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index bb131fc..3025bf9 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 _0xb62e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x3aec7f,_0x53ca7b){var _0x2ecd6f=function(_0x44f81){while(--_0x44f81){_0x3aec7f['push'](_0x3aec7f['shift']());}};_0x2ecd6f(++_0x53ca7b);}(_0xb62e,0x1de));var _0xeb62=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb62e[_0x618414];return _0x21c19a;};'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')]('/describe',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xeb62('0xf')]('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x13')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),controller['destroy']);module[_0xeb62('0x14')]=router; \ No newline at end of file +var _0x1f43=['update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','show','post','create','put','/:id'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0x1f43,0x9a));var _0x31f4=function(_0x2b304b,_0x586e14){_0x2b304b=_0x2b304b-0x0;var _0x11e542=_0x1f43[_0x2b304b];return _0x11e542;};'use strict';var multer=require(_0x31f4('0x0'));var util=require('util');var path=require(_0x31f4('0x1'));var timeout=require(_0x31f4('0x2'));var express=require(_0x31f4('0x3'));var router=express['Router']();var fs_extra=require(_0x31f4('0x4'));var auth=require(_0x31f4('0x5'));var interaction=require(_0x31f4('0x6'));var config=require(_0x31f4('0x7'));var controller=require(_0x31f4('0x8'));router[_0x31f4('0x9')]('/',auth['isAuthenticated'](),controller[_0x31f4('0xa')]);router['get']('/describe',auth[_0x31f4('0xb')](),controller['describe']);router[_0x31f4('0x9')]('/:id',auth[_0x31f4('0xb')](),controller[_0x31f4('0xc')]);router[_0x31f4('0xd')]('/',auth[_0x31f4('0xb')](),controller[_0x31f4('0xe')]);router[_0x31f4('0xf')](_0x31f4('0x10'),auth['isAuthenticated'](),controller[_0x31f4('0x11')]);router[_0x31f4('0x12')]('/:id',auth[_0x31f4('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index cf8ab99..9a7f649 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 _0x3f72=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4505b8,_0x4ac0d7){var _0x4b3368=function(_0x2fd5cf){while(--_0x2fd5cf){_0x4505b8['push'](_0x4505b8['shift']());}};_0x4b3368(++_0x4ac0d7);}(_0x3f72,0xaf));var _0x23f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3f72[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x23f7('0x0'));module[_0x23f7('0x1')]={'type':{'type':Sequelize[_0x23f7('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x23f7('0x2')]},'queue':{'type':Sequelize[_0x23f7('0x2')]},'interface':{'type':Sequelize[_0x23f7('0x2')]},'membername':{'type':Sequelize[_0x23f7('0x2')]},'agentcalledAt':{'type':Sequelize[_0x23f7('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x23f7('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x23f7('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x23f7('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x23f7('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x23f7('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x23f7('0x5')]},'agentacw':{'type':Sequelize[_0x23f7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x23f7('0x5')]},'reason':{'type':Sequelize[_0x23f7('0x2')]},'lastevent':{'type':Sequelize[_0x23f7('0x2')]},'channel':{'type':Sequelize[_0x23f7('0x2')]},'channelstate':{'type':Sequelize[_0x23f7('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x23f7('0x2')]},'connectedlinename':{'type':Sequelize[_0x23f7('0x2')]},'language':{'type':Sequelize[_0x23f7('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x23f7('0x2')]},'priority':{'type':Sequelize[_0x23f7('0x2')]},'destchannel':{'type':Sequelize[_0x23f7('0x2')]},'destchannelstate':{'type':Sequelize[_0x23f7('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x23f7('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x23f7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x23f7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x23f7('0x2')]},'destlanguage':{'type':Sequelize[_0x23f7('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x23f7('0x2')]},'destexten':{'type':Sequelize[_0x23f7('0x2')]},'destpriority':{'type':Sequelize[_0x23f7('0x2')]},'destuniqueid':{'type':Sequelize[_0x23f7('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x23f7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x23f7('0x2')]},'transfer':{'type':Sequelize[_0x23f7('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x23f7('0x6')},'transferexten':{'type':Sequelize[_0x23f7('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0570=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING'];(function(_0x42a6,_0x560591){var _0x20f00d=function(_0x4232a3){while(--_0x4232a3){_0x42a6['push'](_0x42a6['shift']());}};_0x20f00d(++_0x560591);}(_0x0570,0x172));var _0x0057=function(_0x55da2d,_0x202953){_0x55da2d=_0x55da2d-0x0;var _0x15282a=_0x0570[_0x55da2d];return _0x15282a;};'use strict';var Sequelize=require('sequelize');module[_0x0057('0x0')]={'type':{'type':Sequelize[_0x0057('0x1')]},'uniqueid':{'type':Sequelize[_0x0057('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0057('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x0057('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x0057('0x2')]},'agentconnectAt':{'type':Sequelize[_0x0057('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x0057('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x0057('0x2')]},'agentdumpAt':{'type':Sequelize[_0x0057('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0057('0x4')]},'agentacw':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0057('0x4')]},'reason':{'type':Sequelize[_0x0057('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0057('0x1')]},'channelstate':{'type':Sequelize[_0x0057('0x4')]},'channelstatedesc':{'type':Sequelize[_0x0057('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x0057('0x1')]},'language':{'type':Sequelize[_0x0057('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0057('0x1')]},'priority':{'type':Sequelize[_0x0057('0x1')]},'destchannel':{'type':Sequelize[_0x0057('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x0057('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0057('0x1')]},'destcalleridname':{'type':Sequelize[_0x0057('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x0057('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0057('0x1')]},'destaccountcode':{'type':Sequelize[_0x0057('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x0057('0x1')]},'destpriority':{'type':Sequelize[_0x0057('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0057('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0057('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x0057('0x5')},'transferexten':{'type':Sequelize[_0x0057('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index f3c1cdc..c1efa6b 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 e21efcf..ca8fe03 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 _0x394e=['destuniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x359db,_0x399a39){var _0x361dc4=function(_0x4255fa){while(--_0x4255fa){_0x359db['push'](_0x359db['shift']());}};_0x361dc4(++_0x399a39);}(_0x394e,0x88));var _0xe394=function(_0x3a47aa,_0x19d90e){_0x3a47aa=_0x3a47aa-0x0;var _0x146448=_0x394e[_0x3a47aa];return _0x146448;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var logger=require('../../config/logger')(_0xe394('0x2'));var moment=require(_0xe394('0x3'));var BPromise=require(_0xe394('0x4'));var rp=require(_0xe394('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var attributes=require(_0xe394('0x8'));module[_0xe394('0x9')]=function(_0x2a4db6,_0x272c30){return _0x2a4db6[_0xe394('0xa')](_0xe394('0xb'),attributes,{'tableName':_0xe394('0xc'),'paranoid':![],'indexes':[{'fields':[_0xe394('0xd'),_0xe394('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7676=['define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','path','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x3027b0,_0x5dd103){var _0x14bac4=function(_0x6c5ad1){while(--_0x6c5ad1){_0x3027b0['push'](_0x3027b0['shift']());}};_0x14bac4(++_0x5dd103);}(_0x7676,0xb8));var _0x6767=function(_0x49874a,_0x495e1a){_0x49874a=_0x49874a-0x0;var _0x226400=_0x7676[_0x49874a];return _0x226400;};'use strict';var _=require(_0x6767('0x0'));var util=require(_0x6767('0x1'));var logger=require(_0x6767('0x2'))('api');var moment=require(_0x6767('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6767('0x4'));var rimraf=require('rimraf');var config=require(_0x6767('0x5'));var attributes=require(_0x6767('0x6'));module[_0x6767('0x7')]=function(_0x4d0c08,_0x24d747){return _0x4d0c08[_0x6767('0x8')](_0x6767('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x6767('0xa'),_0x6767('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3b1c92e..17c1605 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 _0x2827=['then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateVoiceAgentReport','create','options','raw','info','catch','VoiceAgentReport','update','where','attributes','limit','UpdateVoiceAgentReport','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4f05c1,_0x16f2c7){var _0x3066df=function(_0x660645){while(--_0x660645){_0x4f05c1['push'](_0x4f05c1['shift']());}};_0x3066df(++_0x16f2c7);}(_0x2827,0xfd));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7282('0x0'));var moment=require(_0x7282('0x1'));var BPromise=require(_0x7282('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7282('0x3'))['db'];var utils=require(_0x7282('0x4'));var logger=require(_0x7282('0x5'))(_0x7282('0x6'));var config=require(_0x7282('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7282('0x8')][_0x7282('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425b04,_0x2e9da2,_0x7643eb){return new BPromise(function(_0x133d5c,_0x116364){return client[_0x7282('0xa')](_0x425b04,_0x7643eb)[_0x7282('0xb')](function(_0x1cb79f){logger['info'](_0x7282('0xc'),_0x2e9da2,_0x7282('0xd'));logger[_0x7282('0xe')](_0x7282('0xf'),_0x2e9da2,_0x7282('0xd'),JSON[_0x7282('0x10')](_0x1cb79f));if(_0x1cb79f['error']){if(_0x1cb79f['error'][_0x7282('0x11')]===0x1f4){logger[_0x7282('0x12')](_0x7282('0xc'),_0x2e9da2,_0x1cb79f[_0x7282('0x12')][_0x7282('0x13')]);return _0x116364(_0x1cb79f[_0x7282('0x12')]['message']);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x2e9da2,_0x1cb79f[_0x7282('0x12')][_0x7282('0x13')]);return _0x133d5c(_0x1cb79f[_0x7282('0x12')][_0x7282('0x13')]);}else{logger['info'](_0x7282('0xc'),_0x2e9da2,_0x7282('0xd'));_0x133d5c(_0x1cb79f[_0x7282('0x14')]['message']);}})['catch'](function(_0x528a7c){logger[_0x7282('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e9da2,_0x528a7c);_0x116364(_0x528a7c);});});}exports[_0x7282('0x15')]=function(_0x3598ee){var _0x129ab0=this;return new Promise(function(_0x21e1d9,_0x241969){return db['VoiceAgentReport'][_0x7282('0x16')](_0x3598ee['body'],{'raw':_0x3598ee[_0x7282('0x17')]?_0x3598ee[_0x7282('0x17')][_0x7282('0x18')]===undefined?!![]:![]:!![]})[_0x7282('0xb')](function(_0x293f10){logger[_0x7282('0x19')](_0x7282('0x15'),_0x3598ee);logger[_0x7282('0xe')](_0x7282('0x15'),_0x3598ee,JSON[_0x7282('0x10')](_0x293f10));_0x21e1d9(_0x293f10);})[_0x7282('0x1a')](function(_0x39552a){logger[_0x7282('0x12')](_0x7282('0x15'),_0x39552a['message'],_0x3598ee);_0x241969(_0x129ab0[_0x7282('0x12')](0x1f4,_0x39552a[_0x7282('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x19216f){var _0x3b4f21=this;return new Promise(function(_0x3f3dc2,_0x3b52e0){return db[_0x7282('0x1b')][_0x7282('0x1c')](_0x19216f['body'],{'raw':_0x19216f[_0x7282('0x17')]?_0x19216f['options'][_0x7282('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19216f[_0x7282('0x17')]?_0x19216f[_0x7282('0x17')][_0x7282('0x1d')]||null:null,'attributes':_0x19216f[_0x7282('0x17')]?_0x19216f[_0x7282('0x17')][_0x7282('0x1e')]||null:null,'limit':_0x19216f[_0x7282('0x17')]?_0x19216f[_0x7282('0x17')][_0x7282('0x1f')]||null:null})['then'](function(_0x2459e9){logger[_0x7282('0x19')](_0x7282('0x20'),_0x19216f);logger[_0x7282('0xe')](_0x7282('0x20'),_0x19216f,JSON[_0x7282('0x10')](_0x2459e9));_0x3f3dc2(_0x2459e9);})[_0x7282('0x1a')](function(_0x4af377){logger[_0x7282('0x12')]('UpdateVoiceAgentReport',_0x4af377[_0x7282('0x13')],_0x19216f);_0x3b52e0(_0x3b4f21['error'](0x1f4,_0x4af377[_0x7282('0x13')]));});});}; \ No newline at end of file +var _0xd57f=['create','options','CreateVoiceAgentReport','UpdateVoiceAgentReport','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceAgentReport'];(function(_0x511dfa,_0x3311e9){var _0x3d31d4=function(_0x4a6cd8){while(--_0x4a6cd8){_0x511dfa['push'](_0x511dfa['shift']());}};_0x3d31d4(++_0x3311e9);}(_0xd57f,0x108));var _0xfd57=function(_0x2cf415,_0x403b51){_0x2cf415=_0x2cf415-0x0;var _0x4f05df=_0xd57f[_0x2cf415];return _0x4f05df;};'use strict';var _=require('lodash');var util=require(_0xfd57('0x0'));var moment=require(_0xfd57('0x1'));var BPromise=require(_0xfd57('0x2'));var rs=require(_0xfd57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd57('0x4'))['db'];var utils=require(_0xfd57('0x5'));var logger=require(_0xfd57('0x6'))(_0xfd57('0x7'));var config=require('../../config/environment');var jayson=require(_0xfd57('0x8'));var client=jayson[_0xfd57('0x9')][_0xfd57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa52798,_0xac883b,_0x192286){return new BPromise(function(_0x1f8f73,_0x318163){return client['request'](_0xa52798,_0x192286)[_0xfd57('0xb')](function(_0x4c23fb){logger[_0xfd57('0xc')](_0xfd57('0xd'),_0xac883b,'request\x20sent');logger[_0xfd57('0xe')](_0xfd57('0xf'),_0xac883b,_0xfd57('0x10'),JSON[_0xfd57('0x11')](_0x4c23fb));if(_0x4c23fb[_0xfd57('0x12')]){if(_0x4c23fb['error'][_0xfd57('0x13')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xac883b,_0x4c23fb['error']['message']);return _0x318163(_0x4c23fb[_0xfd57('0x12')][_0xfd57('0x14')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xac883b,_0x4c23fb[_0xfd57('0x12')][_0xfd57('0x14')]);return _0x1f8f73(_0x4c23fb[_0xfd57('0x12')]['message']);}else{logger[_0xfd57('0xc')](_0xfd57('0xd'),_0xac883b,_0xfd57('0x10'));_0x1f8f73(_0x4c23fb[_0xfd57('0x15')][_0xfd57('0x14')]);}})[_0xfd57('0x16')](function(_0x20f5ab){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xac883b,_0x20f5ab);_0x318163(_0x20f5ab);});});}exports['CreateVoiceAgentReport']=function(_0x3d169c){var _0x5cff99=this;return new Promise(function(_0x128430,_0x447016){return db[_0xfd57('0x17')][_0xfd57('0x18')](_0x3d169c['body'],{'raw':_0x3d169c[_0xfd57('0x19')]?_0x3d169c['options']['raw']===undefined?!![]:![]:!![]})[_0xfd57('0xb')](function(_0x266e7e){logger[_0xfd57('0xc')](_0xfd57('0x1a'),_0x3d169c);logger[_0xfd57('0xe')](_0xfd57('0x1a'),_0x3d169c,JSON[_0xfd57('0x11')](_0x266e7e));_0x128430(_0x266e7e);})[_0xfd57('0x16')](function(_0x2aeddd){logger[_0xfd57('0x12')]('CreateVoiceAgentReport',_0x2aeddd['message'],_0x3d169c);_0x447016(_0x5cff99['error'](0x1f4,_0x2aeddd[_0xfd57('0x14')]));});});};exports[_0xfd57('0x1b')]=function(_0x12e05f){var _0x5e0424=this;return new Promise(function(_0x2614e9,_0xcf39e9){return db[_0xfd57('0x17')]['update'](_0x12e05f['body'],{'raw':_0x12e05f[_0xfd57('0x19')]?_0x12e05f[_0xfd57('0x19')][_0xfd57('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e05f['options']?_0x12e05f[_0xfd57('0x19')][_0xfd57('0x1d')]||null:null,'attributes':_0x12e05f[_0xfd57('0x19')]?_0x12e05f[_0xfd57('0x19')][_0xfd57('0x1e')]||null:null,'limit':_0x12e05f['options']?_0x12e05f['options'][_0xfd57('0x1f')]||null:null})['then'](function(_0x3a2070){logger['info'](_0xfd57('0x1b'),_0x12e05f);logger[_0xfd57('0xe')](_0xfd57('0x1b'),_0x12e05f,JSON['stringify'](_0x3a2070));_0x2614e9(_0x3a2070);})['catch'](function(_0x191da4){logger[_0xfd57('0x12')]('UpdateVoiceAgentReport',_0x191da4[_0xfd57('0x14')],_0x12e05f);_0xcf39e9(_0x5e0424[_0xfd57('0x12')](0x1f4,_0x191da4[_0xfd57('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 1ef3206..d667ca3 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 _0x8958=['index','get','/describe','/:id','show','post','create','put','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated'];(function(_0xd04f20,_0x1812d5){var _0x8c90b8=function(_0x5ab2f4){while(--_0x5ab2f4){_0xd04f20['push'](_0xd04f20['shift']());}};_0x8c90b8(++_0x1812d5);}(_0x8958,0x93));var _0x8895=function(_0x561f36,_0x164a8b){_0x561f36=_0x561f36-0x0;var _0x526261=_0x8958[_0x561f36];return _0x526261;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get']('/',auth[_0x8895('0x5')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')](_0x8895('0x8'),auth[_0x8895('0x5')](),controller['describe']);router[_0x8895('0x7')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')]('/',auth[_0x8895('0x5')](),controller[_0x8895('0xc')]);router[_0x8895('0xd')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller['update']);router[_0x8895('0xe')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xf')]);module[_0x8895('0x10')]=router; \ No newline at end of file +var _0x4c4e=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x185180,_0x145d70){var _0x2d9d42=function(_0xc2be06){while(--_0xc2be06){_0x185180['push'](_0x185180['shift']());}};_0x2d9d42(++_0x145d70);}(_0x4c4e,0x152));var _0xe4c4=function(_0x821411,_0x127409){_0x821411=_0x821411-0x0;var _0x4856aa=_0x4c4e[_0x821411];return _0x4856aa;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xe')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0x10')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['update']);router[_0xe4c4('0x11')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x12')]);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 8fdbeed..79425fa 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 _0x720f=['STRING','TEXT','DATE','INTEGER','sequelize','inbound','internal','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x441dd4,_0x582db9){var _0x54ea8b=function(_0x308f42){while(--_0x308f42){_0x441dd4['push'](_0x441dd4['shift']());}};_0x54ea8b(++_0x582db9);}(_0x720f,0x185));var _0xf720=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x720f[_0x515afd];return _0x536d53;};'use strict';var Sequelize=require(_0xf720('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xf720('0x1'),_0xf720('0x2'),_0xf720('0x3'),_0xf720('0x4'),_0xf720('0x5'),_0xf720('0x6'))},'tag':{'type':Sequelize[_0xf720('0x7')]},'accountcode':{'type':Sequelize[_0xf720('0x7')]},'source':{'type':Sequelize[_0xf720('0x7')]},'destination':{'type':Sequelize[_0xf720('0x7')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf720('0x7')]},'channel':{'type':Sequelize[_0xf720('0x7')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf720('0x8')]},'starttime':{'type':Sequelize[_0xf720('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf720('0x9')]},'endtime':{'type':Sequelize[_0xf720('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xf720('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xf720('0x7')]},'userSecondDisposition':{'type':Sequelize[_0xf720('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf720('0x7')]},'prefix':{'type':Sequelize[_0xf720('0x7')]},'routeid':{'type':Sequelize[_0xf720('0xa')]},'sipcallid':{'type':Sequelize[_0xf720('0x7')]}}; \ No newline at end of file +var _0x3df4=['DATE','INTEGER','sequelize','STRING','ENUM','inbound','outbound','outbound-fax','dialer'];(function(_0x3076f9,_0x379308){var _0x552d12=function(_0x58627e){while(--_0x58627e){_0x3076f9['push'](_0x3076f9['shift']());}};_0x552d12(++_0x379308);}(_0x3df4,0x12b));var _0x43df=function(_0x5d9be4,_0x5df4b6){_0x5d9be4=_0x5d9be4-0x0;var _0x44650b=_0x3df4[_0x5d9be4];return _0x44650b;};'use strict';var Sequelize=require(_0x43df('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x43df('0x1')]},'type':{'type':Sequelize[_0x43df('0x2')](_0x43df('0x3'),'internal',_0x43df('0x4'),'inbound-fax',_0x43df('0x5'),_0x43df('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x43df('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x43df('0x1')]},'channel':{'type':Sequelize[_0x43df('0x1')]},'destinationchannel':{'type':Sequelize[_0x43df('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x43df('0x7')]},'systemanswertime':{'type':Sequelize[_0x43df('0x7')]},'answertime':{'type':Sequelize[_0x43df('0x7')]},'endtime':{'type':Sequelize[_0x43df('0x7')]},'duration':{'type':Sequelize[_0x43df('0x8')]},'billableseconds':{'type':Sequelize[_0x43df('0x8')]},'mohtime':{'type':Sequelize[_0x43df('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x43df('0x1')]},'userfield':{'type':Sequelize[_0x43df('0x1')]},'userDisposition':{'type':Sequelize[_0x43df('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x43df('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x43df('0x1')]},'routeid':{'type':Sequelize[_0x43df('0x8')]},'sipcallid':{'type':Sequelize[_0x43df('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 377eb4e..1336bf0 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x25e4ff,_0x5b0df0){var _0x536356=function(_0x4df86f){while(--_0x4df86f){_0x25e4ff['push'](_0x25e4ff['shift']());}};_0x536356(++_0x5b0df0);}(_0xdb28,0x106));var _0x8db2=function(_0x4dbd15,_0x22f81c){_0x4dbd15=_0x4dbd15-0x0;var _0x49d487=_0xdb28[_0x4dbd15];return _0x49d487;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d8da4,_0x4e2662){_0x4d8da4=_0x4d8da4-0x0;var _0x2a5f97=_0x2ef3[_0x4d8da4];return _0x2a5f97;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a8cc463..68dd5e9 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 _0x42d4=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','report_call','uniqueid','lodash','util'];(function(_0x4600ed,_0x322c17){var _0x54e933=function(_0x16f2d7){while(--_0x16f2d7){_0x4600ed['push'](_0x4600ed['shift']());}};_0x54e933(++_0x322c17);}(_0x42d4,0x10c));var _0x442d=function(_0x408f18,_0x10d01d){_0x408f18=_0x408f18-0x0;var _0x502c80=_0x42d4[_0x408f18];return _0x502c80;};'use strict';var _=require(_0x442d('0x0'));var util=require(_0x442d('0x1'));var logger=require(_0x442d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x442d('0x3'));var rp=require(_0x442d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x442d('0x5'));var config=require(_0x442d('0x6'));var attributes=require(_0x442d('0x7'));module['exports']=function(_0x4f2217,_0x5015d5){return _0x4f2217['define']('VoiceCallReport',attributes,{'tableName':_0x442d('0x8'),'paranoid':![],'indexes':[{'fields':[_0x442d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ccc=['bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','report_call','../../config/logger'];(function(_0x15b3fa,_0x5d12fe){var _0x406232=function(_0x20676a){while(--_0x20676a){_0x15b3fa['push'](_0x15b3fa['shift']());}};_0x406232(++_0x5d12fe);}(_0x4ccc,0x137));var _0xc4cc=function(_0x37ffc6,_0x251b7f){_0x37ffc6=_0x37ffc6-0x0;var _0x47faac=_0x4ccc[_0x37ffc6];return _0x47faac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc4cc('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc4cc('0x1'));var rp=require(_0xc4cc('0x2'));var fs=require('fs');var path=require(_0xc4cc('0x3'));var rimraf=require('rimraf');var config=require(_0xc4cc('0x4'));var attributes=require(_0xc4cc('0x5'));module[_0xc4cc('0x6')]=function(_0x492e3c,_0x3cd283){return _0x492e3c['define']('VoiceCallReport',attributes,{'tableName':_0xc4cc('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 2a4673e..9ce50cb 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 _0x77d0=['raw','where','attributes','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','stringify','UpdateVoiceCallReport','update','body','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceCallReport','findAll','options'];(function(_0x4265b5,_0x1f3e74){var _0x2d5b63=function(_0x2050e1){while(--_0x2050e1){_0x4265b5['push'](_0x4265b5['shift']());}};_0x2d5b63(++_0x1f3e74);}(_0x77d0,0x1bb));var _0x077d=function(_0x874c2b,_0x1dfc00){_0x874c2b=_0x874c2b-0x0;var _0x2359ea=_0x77d0[_0x874c2b];return _0x2359ea;};'use strict';var _=require(_0x077d('0x0'));var util=require(_0x077d('0x1'));var moment=require(_0x077d('0x2'));var BPromise=require('bluebird');var rs=require(_0x077d('0x3'));var fs=require('fs');var Redis=require(_0x077d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x077d('0x5'));var logger=require(_0x077d('0x6'))(_0x077d('0x7'));var config=require(_0x077d('0x8'));var jayson=require(_0x077d('0x9'));var client=jayson[_0x077d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365191,_0x423ca8,_0x5cc2a5){return new BPromise(function(_0x4c9845,_0xbe4107){return client['request'](_0x365191,_0x5cc2a5)[_0x077d('0xb')](function(_0x9a8f0f){logger[_0x077d('0xc')](_0x077d('0xd'),_0x423ca8,_0x077d('0xe'));logger[_0x077d('0xf')](_0x077d('0x10'),_0x423ca8,_0x077d('0xe'),JSON['stringify'](_0x9a8f0f));if(_0x9a8f0f['error']){if(_0x9a8f0f[_0x077d('0x11')][_0x077d('0x12')]===0x1f4){logger['error'](_0x077d('0xd'),_0x423ca8,_0x9a8f0f[_0x077d('0x11')][_0x077d('0x13')]);return _0xbe4107(_0x9a8f0f[_0x077d('0x11')][_0x077d('0x13')]);}logger[_0x077d('0x11')](_0x077d('0xd'),_0x423ca8,_0x9a8f0f[_0x077d('0x11')]['message']);return _0x4c9845(_0x9a8f0f['error'][_0x077d('0x13')]);}else{logger[_0x077d('0xc')](_0x077d('0xd'),_0x423ca8,'request\x20sent');_0x4c9845(_0x9a8f0f[_0x077d('0x14')][_0x077d('0x13')]);}})[_0x077d('0x15')](function(_0x9470d5){logger[_0x077d('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x423ca8,_0x9470d5);_0xbe4107(_0x9470d5);});});}exports['GetVoiceCallReport']=function(_0x292797){var _0x1992d9=this;return new Promise(function(_0x3c0448,_0x557a8b){return db[_0x077d('0x16')][_0x077d('0x17')]({'raw':_0x292797[_0x077d('0x18')]?_0x292797[_0x077d('0x18')][_0x077d('0x19')]===undefined?!![]:![]:!![],'where':_0x292797['options']?_0x292797['options'][_0x077d('0x1a')]||null:null,'attributes':_0x292797[_0x077d('0x18')]?_0x292797[_0x077d('0x18')][_0x077d('0x1b')]||null:null,'limit':_0x292797[_0x077d('0x18')]?_0x292797[_0x077d('0x18')]['limit']||null:null,'include':_0x292797[_0x077d('0x18')]?_0x292797[_0x077d('0x18')][_0x077d('0x1c')]?_[_0x077d('0x1d')](_0x292797[_0x077d('0x18')][_0x077d('0x1c')],function(_0x29c294){return{'model':db[_0x29c294[_0x077d('0x1e')]],'as':_0x29c294['as'],'attributes':_0x29c294[_0x077d('0x1b')],'include':_0x29c294['include']?_[_0x077d('0x1d')](_0x29c294[_0x077d('0x1c')],function(_0x337d5f){return{'model':db[_0x337d5f[_0x077d('0x1e')]],'as':_0x337d5f['as'],'attributes':_0x337d5f[_0x077d('0x1b')],'include':_0x337d5f[_0x077d('0x1c')]?_[_0x077d('0x1d')](_0x337d5f[_0x077d('0x1c')],function(_0x231daa){return{'model':db[_0x231daa[_0x077d('0x1e')]],'as':_0x231daa['as'],'attributes':_0x231daa[_0x077d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ffda){logger['info'](_0x077d('0x1f'),_0x292797);logger[_0x077d('0xf')](_0x077d('0x1f'),_0x292797,JSON['stringify'](_0x51ffda));_0x3c0448(_0x51ffda);})[_0x077d('0x15')](function(_0x46926b){logger['error'](_0x077d('0x1f'),_0x46926b[_0x077d('0x13')],_0x292797);_0x557a8b(_0x1992d9[_0x077d('0x11')](0x1f4,_0x46926b[_0x077d('0x13')]));});});};exports[_0x077d('0x20')]=function(_0x27cc14){var _0x222130=this;return new Promise(function(_0x588328,_0x2a9c61){return db['VoiceCallReport'][_0x077d('0x21')](_0x27cc14['body'],{'raw':_0x27cc14[_0x077d('0x18')]?_0x27cc14['options'][_0x077d('0x19')]===undefined?!![]:![]:!![]})[_0x077d('0xb')](function(_0x5c3386){logger[_0x077d('0xc')](_0x077d('0x20'),_0x27cc14);logger['debug']('CreateVoiceCallReport',_0x27cc14,JSON[_0x077d('0x22')](_0x5c3386));_0x588328(_0x5c3386);})[_0x077d('0x15')](function(_0x33dc24){logger[_0x077d('0x11')]('CreateVoiceCallReport',_0x33dc24[_0x077d('0x13')],_0x27cc14);_0x2a9c61(_0x222130['error'](0x1f4,_0x33dc24[_0x077d('0x13')]));});});};exports[_0x077d('0x23')]=function(_0x5476a1){var _0x83d139=this;return new Promise(function(_0x1ca5f4,_0x370c96){return db[_0x077d('0x16')][_0x077d('0x24')](_0x5476a1[_0x077d('0x25')],{'raw':_0x5476a1[_0x077d('0x18')]?_0x5476a1[_0x077d('0x18')][_0x077d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5476a1['options']?_0x5476a1[_0x077d('0x18')][_0x077d('0x1a')]||null:null,'attributes':_0x5476a1[_0x077d('0x18')]?_0x5476a1['options'][_0x077d('0x1b')]||null:null,'limit':_0x5476a1['options']?_0x5476a1[_0x077d('0x18')][_0x077d('0x26')]||null:null})[_0x077d('0xb')](function(_0x56c71){logger['info'](_0x077d('0x23'),_0x5476a1);logger[_0x077d('0xf')](_0x077d('0x23'),_0x5476a1,JSON[_0x077d('0x22')](_0x56c71));_0x1ca5f4(_0x56c71);})[_0x077d('0x15')](function(_0x591b15){logger[_0x077d('0x11')](_0x077d('0x23'),_0x591b15['message'],_0x5476a1);_0x370c96(_0x83d139[_0x077d('0x11')](0x1f4,_0x591b15[_0x077d('0x13')]));});});}; \ No newline at end of file +var _0x7169=['client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceCallReport','options','attributes','limit','include','map','GetVoiceCallReport','stringify','CreateVoiceCallReport','create','body','debug','UpdateVoiceCallReport','update','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f4081,_0x550e6d){var _0x5649b6=function(_0x5b19cf){while(--_0x5b19cf){_0x4f4081['push'](_0x4f4081['shift']());}};_0x5649b6(++_0x550e6d);}(_0x7169,0x100));var _0x9716=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x7169[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x9716('0x0'));var util=require(_0x9716('0x1'));var moment=require(_0x9716('0x2'));var BPromise=require('bluebird');var rs=require(_0x9716('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9716('0x4'))['db'];var utils=require(_0x9716('0x5'));var logger=require(_0x9716('0x6'))(_0x9716('0x7'));var config=require(_0x9716('0x8'));var jayson=require(_0x9716('0x9'));var client=jayson[_0x9716('0xa')][_0x9716('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5041,_0x50c026,_0x1f8e77){return new BPromise(function(_0x20a137,_0x244a3f){return client['request'](_0x3c5041,_0x1f8e77)[_0x9716('0xc')](function(_0x569ea1){logger[_0x9716('0xd')](_0x9716('0xe'),_0x50c026,_0x9716('0xf'));logger['debug'](_0x9716('0x10'),_0x50c026,_0x9716('0xf'),JSON['stringify'](_0x569ea1));if(_0x569ea1[_0x9716('0x11')]){if(_0x569ea1[_0x9716('0x11')][_0x9716('0x12')]===0x1f4){logger[_0x9716('0x11')](_0x9716('0xe'),_0x50c026,_0x569ea1[_0x9716('0x11')][_0x9716('0x13')]);return _0x244a3f(_0x569ea1[_0x9716('0x11')][_0x9716('0x13')]);}logger[_0x9716('0x11')](_0x9716('0xe'),_0x50c026,_0x569ea1[_0x9716('0x11')][_0x9716('0x13')]);return _0x20a137(_0x569ea1[_0x9716('0x11')]['message']);}else{logger['info'](_0x9716('0xe'),_0x50c026,_0x9716('0xf'));_0x20a137(_0x569ea1[_0x9716('0x14')][_0x9716('0x13')]);}})[_0x9716('0x15')](function(_0x2a7f79){logger[_0x9716('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x50c026,_0x2a7f79);_0x244a3f(_0x2a7f79);});});}exports['GetVoiceCallReport']=function(_0x1f0346){var _0x43ae94=this;return new Promise(function(_0x7d5804,_0x325301){return db[_0x9716('0x16')]['findAll']({'raw':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')]['where']||null:null,'attributes':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')][_0x9716('0x18')]||null:null,'limit':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')][_0x9716('0x19')]||null:null,'include':_0x1f0346[_0x9716('0x17')]?_0x1f0346[_0x9716('0x17')][_0x9716('0x1a')]?_[_0x9716('0x1b')](_0x1f0346[_0x9716('0x17')][_0x9716('0x1a')],function(_0x210563){return{'model':db[_0x210563['model']],'as':_0x210563['as'],'attributes':_0x210563[_0x9716('0x18')],'include':_0x210563[_0x9716('0x1a')]?_[_0x9716('0x1b')](_0x210563['include'],function(_0x698872){return{'model':db[_0x698872['model']],'as':_0x698872['as'],'attributes':_0x698872[_0x9716('0x18')],'include':_0x698872[_0x9716('0x1a')]?_[_0x9716('0x1b')](_0x698872[_0x9716('0x1a')],function(_0x1264ce){return{'model':db[_0x1264ce['model']],'as':_0x1264ce['as'],'attributes':_0x1264ce[_0x9716('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9716('0xc')](function(_0x39145f){logger[_0x9716('0xd')]('GetVoiceCallReport',_0x1f0346);logger['debug'](_0x9716('0x1c'),_0x1f0346,JSON[_0x9716('0x1d')](_0x39145f));_0x7d5804(_0x39145f);})[_0x9716('0x15')](function(_0x1a5279){logger[_0x9716('0x11')](_0x9716('0x1c'),_0x1a5279[_0x9716('0x13')],_0x1f0346);_0x325301(_0x43ae94[_0x9716('0x11')](0x1f4,_0x1a5279[_0x9716('0x13')]));});});};exports[_0x9716('0x1e')]=function(_0x57e1fe){var _0x3dbc37=this;return new Promise(function(_0x15e119,_0x18df91){return db[_0x9716('0x16')][_0x9716('0x1f')](_0x57e1fe[_0x9716('0x20')],{'raw':_0x57e1fe[_0x9716('0x17')]?_0x57e1fe[_0x9716('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9716('0xc')](function(_0x2ff1f7){logger['info'](_0x9716('0x1e'),_0x57e1fe);logger[_0x9716('0x21')](_0x9716('0x1e'),_0x57e1fe,JSON[_0x9716('0x1d')](_0x2ff1f7));_0x15e119(_0x2ff1f7);})['catch'](function(_0x1dc441){logger[_0x9716('0x11')]('CreateVoiceCallReport',_0x1dc441[_0x9716('0x13')],_0x57e1fe);_0x18df91(_0x3dbc37[_0x9716('0x11')](0x1f4,_0x1dc441[_0x9716('0x13')]));});});};exports[_0x9716('0x22')]=function(_0x152495){var _0x40ee4f=this;return new Promise(function(_0x28ae07,_0x16f1be){return db[_0x9716('0x16')][_0x9716('0x23')](_0x152495[_0x9716('0x20')],{'raw':_0x152495[_0x9716('0x17')]?_0x152495[_0x9716('0x17')][_0x9716('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152495[_0x9716('0x17')]?_0x152495['options'][_0x9716('0x25')]||null:null,'attributes':_0x152495[_0x9716('0x17')]?_0x152495['options']['attributes']||null:null,'limit':_0x152495[_0x9716('0x17')]?_0x152495[_0x9716('0x17')][_0x9716('0x19')]||null:null})['then'](function(_0x5f1947){logger[_0x9716('0xd')](_0x9716('0x22'),_0x152495);logger['debug']('UpdateVoiceCallReport',_0x152495,JSON[_0x9716('0x1d')](_0x5f1947));_0x28ae07(_0x5f1947);})['catch'](function(_0x539dae){logger['error'](_0x9716('0x22'),_0x539dae[_0x9716('0x13')],_0x152495);_0x16f1be(_0x40ee4f[_0x9716('0x11')](0x1f4,_0x539dae['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 05703c4..1393bad 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 _0x22a5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x22a5,0x181));var _0x522a=function(_0x41e226,_0x5b6d61){_0x41e226=_0x41e226-0x0;var _0x87089d=_0x22a5[_0x41e226];return _0x87089d;};'use strict';var multer=require(_0x522a('0x0'));var util=require(_0x522a('0x1'));var path=require(_0x522a('0x2'));var timeout=require(_0x522a('0x3'));var express=require(_0x522a('0x4'));var router=express['Router']();var fs_extra=require(_0x522a('0x5'));var auth=require(_0x522a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x522a('0x7'));var controller=require(_0x522a('0x8'));router[_0x522a('0x9')]('/',auth[_0x522a('0xa')](),controller[_0x522a('0xb')]);router['get'](_0x522a('0xc'),auth[_0x522a('0xa')](),controller[_0x522a('0xd')]);router['post']('/',auth[_0x522a('0xa')](),controller[_0x522a('0xe')]);router[_0x522a('0xf')](_0x522a('0xc'),auth[_0x522a('0xa')](),controller[_0x522a('0x10')]);router[_0x522a('0x11')](_0x522a('0xc'),auth[_0x522a('0xa')](),controller[_0x522a('0x12')]);module[_0x522a('0x13')]=router; \ No newline at end of file +var _0x4cac=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x52a2be,_0x4bd252){var _0x246f1d=function(_0x410395){while(--_0x410395){_0x52a2be['push'](_0x52a2be['shift']());}};_0x246f1d(++_0x4bd252);}(_0x4cac,0x89));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc4ca('0x0'));var util=require('util');var path=require(_0xc4ca('0x1'));var timeout=require(_0xc4ca('0x2'));var express=require(_0xc4ca('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc4ca('0x4'));var config=require(_0xc4ca('0x5'));var controller=require(_0xc4ca('0x6'));router[_0xc4ca('0x7')]('/',auth[_0xc4ca('0x8')](),controller[_0xc4ca('0x9')]);router[_0xc4ca('0x7')](_0xc4ca('0xa'),auth['isAuthenticated'](),controller[_0xc4ca('0xb')]);router[_0xc4ca('0xc')]('/',auth[_0xc4ca('0x8')](),controller[_0xc4ca('0xd')]);router[_0xc4ca('0xe')](_0xc4ca('0xa'),auth['isAuthenticated'](),controller[_0xc4ca('0xf')]);router[_0xc4ca('0x10')](_0xc4ca('0xa'),auth[_0xc4ca('0x8')](),controller[_0xc4ca('0x11')]);module[_0xc4ca('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8335b43..82df51f 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 _0xb479=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join'];(function(_0x75f783,_0xa95d9){var _0x3e2b42=function(_0xfa6203){while(--_0xfa6203){_0x75f783['push'](_0x75f783['shift']());}};_0x3e2b42(++_0xa95d9);}(_0xb479,0xad));var _0x9b47=function(_0x268734,_0x47723b){_0x268734=_0x268734-0x0;var _0x37174a=_0xb479[_0x268734];return _0x37174a;};'use strict';var Sequelize=require(_0x9b47('0x0'));module[_0x9b47('0x1')]={'name':{'type':Sequelize[_0x9b47('0x2')]},'prefix':{'type':Sequelize[_0x9b47('0x2')],'unique':_0x9b47('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x9b47('0x2')],'set':function(_0xcb450f){this[_0x9b47('0x4')](_0x9b47('0x5'),_0xcb450f?_0xcb450f[_0x9b47('0x6')](''):[]);},'get':function(){return this[_0x9b47('0x7')](_0x9b47('0x5'))?this[_0x9b47('0x7')](_0x9b47('0x5'))[_0x9b47('0x8')](''):[];}},'auth':{'type':Sequelize[_0x9b47('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x9b47('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9b47('0x2')]}}; \ No newline at end of file +var _0x835c=['BOOLEAN','sequelize','STRING','name','setDataValue','getDataValue','options'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x835c,0x182));var _0xc835=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x835c[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xc835('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc835('0x1')],'unique':_0xc835('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xc835('0x1')],'set':function(_0x44f51b){this[_0xc835('0x3')]('options',_0x44f51b?_0x44f51b['join'](''):[]);},'get':function(){return this[_0xc835('0x4')](_0xc835('0x5'))?this['getDataValue'](_0xc835('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc835('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xc835('0x1')]},'record':{'type':Sequelize[_0xc835('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc835('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 47f17f2..8c7dce9 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 _0x9649=['set','json','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','params','intersection','find','create','user','role','UserProfileSection','autoAssociation','error','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit'];(function(_0x5b18db,_0x55941d){var _0x4e6cb2=function(_0x24e20c){while(--_0x24e20c){_0x5b18db['push'](_0x5b18db['shift']());}};_0x4e6cb2(++_0x55941d);}(_0x9649,0x118));var _0x9964=function(_0x7c6267,_0x499f2f){_0x7c6267=_0x7c6267-0x0;var _0x388b31=_0x9649[_0x7c6267];return _0x388b31;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9964('0x2'));var rp=require(_0x9964('0x3'));var moment=require(_0x9964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9964('0x5'));var util=require(_0x9964('0x6'));var path=require(_0x9964('0x7'));var sox=require(_0x9964('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9964('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9964('0x12'))(_0x9964('0x13'));var utils=require('../../config/utils');var config=require(_0x9964('0x14'));var licenseUtil=require(_0x9964('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd6ff,_0x4ef5c5){_0x4ef5c5=_0x4ef5c5||0xcc;return function(_0x1b8afa){if(_0x1b8afa){return _0x2bd6ff[_0x9964('0x16')](_0x4ef5c5);}return _0x2bd6ff[_0x9964('0x17')](_0x4ef5c5)[_0x9964('0x18')]();};}function respondWithResult(_0x22f5ce,_0x360a02){_0x360a02=_0x360a02||0xc8;return function(_0x44ce20){if(_0x44ce20){return _0x22f5ce['status'](_0x360a02)['json'](_0x44ce20);}};}function respondWithFilteredResult(_0x37f137,_0x2be683){return function(_0x561571){if(_0x561571){var _0x416340=typeof _0x2be683[_0x9964('0x19')]===_0x9964('0x1a')&&typeof _0x2be683[_0x9964('0x1b')]===_0x9964('0x1a');var _0x2c12f8=_0x561571['count'];var _0x2a7a61=_0x416340?0x0:_0x2be683[_0x9964('0x19')];var _0x58f157=_0x416340?_0x561571['count']:_0x2be683['offset']+_0x2be683[_0x9964('0x1b')];var _0xc4c0fe;if(_0x58f157>=_0x2c12f8){_0x58f157=_0x2c12f8;_0xc4c0fe=0xc8;}else{_0xc4c0fe=0xce;}_0x37f137[_0x9964('0x17')](_0xc4c0fe);return _0x37f137[_0x9964('0x1c')]('Content-Range',_0x2a7a61+'-'+_0x58f157+'/'+_0x2c12f8)[_0x9964('0x1d')](_0x561571);}return null;};}function patchUpdates(_0x5f2bbd){return function(_0x470a8d){try{jsonpatch[_0x9964('0x1e')](_0x470a8d,_0x5f2bbd,!![]);}catch(_0x209929){return BPromise[_0x9964('0x1f')](_0x209929);}return _0x470a8d[_0x9964('0x20')]();};}function saveUpdates(_0xea9fc2,_0x4053ad){return function(_0x341c56){if(_0x341c56){return _0x341c56['update'](_0xea9fc2)[_0x9964('0x21')](function(_0x3069d7){return _0x3069d7;});}return null;};}function removeEntity(_0x1629f9,_0x30ccf7){return function(_0x5b2689){if(_0x5b2689){return _0x5b2689[_0x9964('0x22')]()[_0x9964('0x21')](function(){var _0x3b3793=_0x5b2689[_0x9964('0x23')]({'plain':!![]});var _0x4be822=_0x9964('0x24');return db[_0x9964('0x25')][_0x9964('0x22')]({'where':{'type':_0x4be822,'resourceId':_0x3b3793['id']}})[_0x9964('0x21')](function(){return _0x5b2689;});})[_0x9964('0x21')](function(){_0x1629f9[_0x9964('0x17')](0xcc)[_0x9964('0x18')]();});}};}function handleEntityNotFound(_0x33be7b,_0x4f9a8b){return function(_0x524564){if(!_0x524564){_0x33be7b[_0x9964('0x16')](0x194);}return _0x524564;};}function handleError(_0x2c1fad,_0x108c0a){_0x108c0a=_0x108c0a||0x1f4;return function(_0x16ec83){logger['error'](_0x16ec83[_0x9964('0x26')]);if(_0x16ec83[_0x9964('0x27')]){delete _0x16ec83[_0x9964('0x27')];}_0x2c1fad[_0x9964('0x17')](_0x108c0a)[_0x9964('0x28')](_0x16ec83);};}exports['index']=function(_0x4c04ce,_0x2f013f){var _0x34ae09={},_0x52dbd4={},_0x48ac65={'count':0x0,'rows':[]};var _0x4ff4c9=_[_0x9964('0x29')](db[_0x9964('0x2a')][_0x9964('0x2b')],function(_0x4cc9a1){return{'name':_0x4cc9a1[_0x9964('0x2c')],'type':_0x4cc9a1[_0x9964('0x2d')][_0x9964('0x2e')]};});_0x52dbd4[_0x9964('0x2f')]=_[_0x9964('0x29')](_0x4ff4c9,_0x9964('0x27'));_0x52dbd4['query']=_[_0x9964('0x30')](_0x4c04ce[_0x9964('0x31')]);_0x52dbd4[_0x9964('0x32')]=_['intersection'](_0x52dbd4[_0x9964('0x2f')],_0x52dbd4[_0x9964('0x31')]);_0x34ae09[_0x9964('0x33')]=_['intersection'](_0x52dbd4[_0x9964('0x2f')],qs[_0x9964('0x34')](_0x4c04ce[_0x9964('0x31')][_0x9964('0x34')]));_0x34ae09[_0x9964('0x33')]=_0x34ae09[_0x9964('0x33')][_0x9964('0x35')]?_0x34ae09[_0x9964('0x33')]:_0x52dbd4[_0x9964('0x2f')];if(!_0x4c04ce[_0x9964('0x31')][_0x9964('0x36')](_0x9964('0x37'))){_0x34ae09[_0x9964('0x1b')]=qs[_0x9964('0x1b')](_0x4c04ce[_0x9964('0x31')][_0x9964('0x1b')]);_0x34ae09[_0x9964('0x19')]=qs[_0x9964('0x19')](_0x4c04ce['query'][_0x9964('0x19')]);}_0x34ae09['order']=qs[_0x9964('0x38')](_0x4c04ce[_0x9964('0x31')]['sort']);_0x34ae09[_0x9964('0x39')]=qs['filters'](_[_0x9964('0x3a')](_0x4c04ce[_0x9964('0x31')],_0x52dbd4[_0x9964('0x32')]),_0x4ff4c9);if(_0x4c04ce[_0x9964('0x31')][_0x9964('0x3b')]){_0x34ae09[_0x9964('0x39')]=_['merge'](_0x34ae09[_0x9964('0x39')],{'$or':_[_0x9964('0x29')](_0x4ff4c9,function(_0xcf49d2){if(_0xcf49d2[_0x9964('0x2d')]!=='VIRTUAL'){var _0x1b3cbe={};_0x1b3cbe[_0xcf49d2['name']]={'$like':'%'+_0x4c04ce[_0x9964('0x31')][_0x9964('0x3b')]+'%'};return _0x1b3cbe;}})});}_0x34ae09=_[_0x9964('0x3c')]({},_0x34ae09,_0x4c04ce[_0x9964('0x3d')]);var _0x3a82d3={'where':_0x34ae09[_0x9964('0x39')]};return db[_0x9964('0x2a')][_0x9964('0x3e')](_0x3a82d3)[_0x9964('0x21')](function(_0x47227d){_0x48ac65[_0x9964('0x3e')]=_0x47227d;if(_0x4c04ce['query'][_0x9964('0x3f')]){_0x34ae09[_0x9964('0x40')]=[{'all':!![]}];}return db[_0x9964('0x2a')][_0x9964('0x41')](_0x34ae09);})['then'](function(_0x138a3a){_0x48ac65['rows']=_0x138a3a;return _0x48ac65;})['then'](respondWithFilteredResult(_0x2f013f,_0x34ae09))[_0x9964('0x42')](handleError(_0x2f013f,null));};exports['show']=function(_0x77191f,_0x5949b4){var _0x12cd80={'raw':![],'where':{'id':_0x77191f[_0x9964('0x43')]['id']}},_0x246fab={};_0x246fab['model']=_['keys'](db['VoiceChanSpy'][_0x9964('0x2b')]);_0x246fab[_0x9964('0x31')]=_['keys'](_0x77191f[_0x9964('0x31')]);_0x246fab[_0x9964('0x32')]=_[_0x9964('0x44')](_0x246fab['model'],_0x246fab[_0x9964('0x31')]);_0x12cd80[_0x9964('0x33')]=_[_0x9964('0x44')](_0x246fab[_0x9964('0x2f')],qs['fields'](_0x77191f[_0x9964('0x31')][_0x9964('0x34')]));_0x12cd80[_0x9964('0x33')]=_0x12cd80[_0x9964('0x33')][_0x9964('0x35')]?_0x12cd80['attributes']:_0x246fab[_0x9964('0x2f')];if(_0x77191f[_0x9964('0x31')]['includeAll']){_0x12cd80[_0x9964('0x40')]=[{'all':!![]}];}_0x12cd80=_[_0x9964('0x3c')]({},_0x12cd80,_0x77191f[_0x9964('0x3d')]);return db['VoiceChanSpy'][_0x9964('0x45')](_0x12cd80)[_0x9964('0x21')](handleEntityNotFound(_0x5949b4,null))[_0x9964('0x21')](respondWithResult(_0x5949b4,null))[_0x9964('0x42')](handleError(_0x5949b4,null));};exports['create']=function(_0x14d611,_0x139a9e){return db[_0x9964('0x2a')][_0x9964('0x46')](_0x14d611['body'],{})[_0x9964('0x21')](function(_0x17aa8f){var _0x276bd=_0x14d611[_0x9964('0x47')][_0x9964('0x23')]({'plain':!![]});if(!_0x276bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x276bd[_0x9964('0x48')]===_0x9964('0x47')){var _0x2eadb4=_0x17aa8f[_0x9964('0x23')]({'plain':!![]});var _0x9e5962=_0x9964('0x24');return db[_0x9964('0x49')][_0x9964('0x45')]({'where':{'name':_0x9e5962,'userProfileId':_0x276bd['userProfileId']},'raw':!![]})[_0x9964('0x21')](function(_0x307d44){if(_0x307d44&&_0x307d44[_0x9964('0x4a')]===0x0){return db[_0x9964('0x25')][_0x9964('0x46')]({'name':_0x2eadb4[_0x9964('0x27')],'resourceId':_0x2eadb4['id'],'type':_0x307d44[_0x9964('0x27')],'sectionId':_0x307d44['id']},{})[_0x9964('0x21')](function(){return _0x17aa8f;});}else{return _0x17aa8f;}})['catch'](function(_0x25faa5){logger[_0x9964('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25faa5);throw _0x25faa5;});}return _0x17aa8f;})[_0x9964('0x21')](respondWithResult(_0x139a9e,0xc9))[_0x9964('0x42')](handleError(_0x139a9e,null));};exports['update']=function(_0x2b2535,_0x49fcd4){if(_0x2b2535['body']['id']){delete _0x2b2535[_0x9964('0x4c')]['id'];}return db[_0x9964('0x2a')][_0x9964('0x45')]({'where':{'id':_0x2b2535[_0x9964('0x43')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x49fcd4,null))[_0x9964('0x21')](saveUpdates(_0x2b2535[_0x9964('0x4c')],null))[_0x9964('0x21')](respondWithResult(_0x49fcd4,null))[_0x9964('0x42')](handleError(_0x49fcd4,null));};exports['destroy']=function(_0x2ca871,_0xe67a50){return db[_0x9964('0x2a')][_0x9964('0x45')]({'where':{'id':_0x2ca871[_0x9964('0x43')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0xe67a50,null))['then'](removeEntity(_0xe67a50,null))[_0x9964('0x42')](handleError(_0xe67a50,null));}; \ No newline at end of file +var _0x05b0=['body','params','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','VoiceChanSpy','fieldName','type','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','model','keys','rawAttributes','create','user','role','ChanSpies','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x34abc5,_0x364e73){var _0x44ac0c=function(_0x1c9004){while(--_0x1c9004){_0x34abc5['push'](_0x34abc5['shift']());}};_0x44ac0c(++_0x364e73);}(_0x05b0,0x188));var _0x005b=function(_0x320783,_0x4efca3){_0x320783=_0x320783-0x0;var _0x415c0e=_0x05b0[_0x320783];return _0x415c0e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];function respondWithStatusCode(_0x10f9bb,_0xce7212){_0xce7212=_0xce7212||0xcc;return function(_0xe2674e){if(_0xe2674e){return _0x10f9bb[_0x005b('0x14')](_0xce7212);}return _0x10f9bb['status'](_0xce7212)['end']();};}function respondWithResult(_0x52ad9c,_0x309c8f){_0x309c8f=_0x309c8f||0xc8;return function(_0x50b7ce){if(_0x50b7ce){return _0x52ad9c[_0x005b('0x15')](_0x309c8f)['json'](_0x50b7ce);}};}function respondWithFilteredResult(_0x1c8eed,_0x1f7743){return function(_0x2ce01e){if(_0x2ce01e){var _0x1991e8=typeof _0x1f7743[_0x005b('0x16')]==='undefined'&&typeof _0x1f7743[_0x005b('0x17')]===_0x005b('0x18');var _0xf3cf84=_0x2ce01e['count'];var _0x206c0a=_0x1991e8?0x0:_0x1f7743[_0x005b('0x16')];var _0x50a6eb=_0x1991e8?_0x2ce01e[_0x005b('0x19')]:_0x1f7743[_0x005b('0x16')]+_0x1f7743[_0x005b('0x17')];var _0x434874;if(_0x50a6eb>=_0xf3cf84){_0x50a6eb=_0xf3cf84;_0x434874=0xc8;}else{_0x434874=0xce;}_0x1c8eed[_0x005b('0x15')](_0x434874);return _0x1c8eed['set'](_0x005b('0x1a'),_0x206c0a+'-'+_0x50a6eb+'/'+_0xf3cf84)[_0x005b('0x1b')](_0x2ce01e);}return null;};}function patchUpdates(_0x4ae164){return function(_0x24637d){try{jsonpatch[_0x005b('0x1c')](_0x24637d,_0x4ae164,!![]);}catch(_0xd97375){return BPromise['reject'](_0xd97375);}return _0x24637d[_0x005b('0x1d')]();};}function saveUpdates(_0x145c36,_0x319981){return function(_0x3521c9){if(_0x3521c9){return _0x3521c9[_0x005b('0x1e')](_0x145c36)[_0x005b('0x1f')](function(_0x4f632f){return _0x4f632f;});}return null;};}function removeEntity(_0x322229,_0x169428){return function(_0x1fef26){if(_0x1fef26){return _0x1fef26['destroy']()[_0x005b('0x1f')](function(){var _0x516a95=_0x1fef26[_0x005b('0x20')]({'plain':!![]});var _0x527294='ChanSpies';return db[_0x005b('0x21')][_0x005b('0x22')]({'where':{'type':_0x527294,'resourceId':_0x516a95['id']}})[_0x005b('0x1f')](function(){return _0x1fef26;});})[_0x005b('0x1f')](function(){_0x322229[_0x005b('0x15')](0xcc)[_0x005b('0x23')]();});}};}function handleEntityNotFound(_0x3d4a1c,_0x2a7266){return function(_0x4e9072){if(!_0x4e9072){_0x3d4a1c[_0x005b('0x14')](0x194);}return _0x4e9072;};}function handleError(_0x288733,_0x185889){_0x185889=_0x185889||0x1f4;return function(_0x13e834){logger[_0x005b('0x24')](_0x13e834[_0x005b('0x25')]);if(_0x13e834[_0x005b('0x26')]){delete _0x13e834['name'];}_0x288733[_0x005b('0x15')](_0x185889)[_0x005b('0x27')](_0x13e834);};}exports[_0x005b('0x28')]=function(_0x3b7524,_0x545a2b){var _0x4ee224={},_0x3699b6={},_0x1c580f={'count':0x0,'rows':[]};var _0x59be70=_['map'](db[_0x005b('0x29')]['rawAttributes'],function(_0x1e5a5c){return{'name':_0x1e5a5c[_0x005b('0x2a')],'type':_0x1e5a5c[_0x005b('0x2b')]['key']};});_0x3699b6['model']=_[_0x005b('0x2c')](_0x59be70,_0x005b('0x26'));_0x3699b6[_0x005b('0x2d')]=_['keys'](_0x3b7524['query']);_0x3699b6[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x3699b6['model'],_0x3699b6[_0x005b('0x2d')]);_0x4ee224['attributes']=_[_0x005b('0x2f')](_0x3699b6['model'],qs['fields'](_0x3b7524[_0x005b('0x2d')][_0x005b('0x30')]));_0x4ee224[_0x005b('0x31')]=_0x4ee224[_0x005b('0x31')][_0x005b('0x32')]?_0x4ee224['attributes']:_0x3699b6['model'];if(!_0x3b7524[_0x005b('0x2d')][_0x005b('0x33')](_0x005b('0x34'))){_0x4ee224[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x3b7524[_0x005b('0x2d')]['limit']);_0x4ee224[_0x005b('0x16')]=qs[_0x005b('0x16')](_0x3b7524[_0x005b('0x2d')]['offset']);}_0x4ee224[_0x005b('0x35')]=qs[_0x005b('0x36')](_0x3b7524[_0x005b('0x2d')][_0x005b('0x36')]);_0x4ee224[_0x005b('0x37')]=qs[_0x005b('0x2e')](_[_0x005b('0x38')](_0x3b7524[_0x005b('0x2d')],_0x3699b6[_0x005b('0x2e')]),_0x59be70);if(_0x3b7524[_0x005b('0x2d')]['filter']){_0x4ee224[_0x005b('0x37')]=_[_0x005b('0x39')](_0x4ee224['where'],{'$or':_[_0x005b('0x2c')](_0x59be70,function(_0x3dca3a){if(_0x3dca3a[_0x005b('0x2b')]!==_0x005b('0x3a')){var _0x4ec11c={};_0x4ec11c[_0x3dca3a[_0x005b('0x26')]]={'$like':'%'+_0x3b7524[_0x005b('0x2d')]['filter']+'%'};return _0x4ec11c;}})});}_0x4ee224=_[_0x005b('0x39')]({},_0x4ee224,_0x3b7524[_0x005b('0x3b')]);var _0x1ea2fe={'where':_0x4ee224[_0x005b('0x37')]};return db[_0x005b('0x29')]['count'](_0x1ea2fe)['then'](function(_0x1dfe28){_0x1c580f[_0x005b('0x19')]=_0x1dfe28;if(_0x3b7524[_0x005b('0x2d')][_0x005b('0x3c')]){_0x4ee224[_0x005b('0x3d')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x005b('0x3e')](_0x4ee224);})[_0x005b('0x1f')](function(_0x2bbb8a){_0x1c580f[_0x005b('0x3f')]=_0x2bbb8a;return _0x1c580f;})[_0x005b('0x1f')](respondWithFilteredResult(_0x545a2b,_0x4ee224))[_0x005b('0x40')](handleError(_0x545a2b,null));};exports['show']=function(_0x319b3b,_0x5f5b71){var _0x32d6fd={'raw':![],'where':{'id':_0x319b3b['params']['id']}},_0x26375b={};_0x26375b[_0x005b('0x41')]=_[_0x005b('0x42')](db[_0x005b('0x29')][_0x005b('0x43')]);_0x26375b['query']=_[_0x005b('0x42')](_0x319b3b[_0x005b('0x2d')]);_0x26375b[_0x005b('0x2e')]=_[_0x005b('0x2f')](_0x26375b[_0x005b('0x41')],_0x26375b[_0x005b('0x2d')]);_0x32d6fd[_0x005b('0x31')]=_[_0x005b('0x2f')](_0x26375b[_0x005b('0x41')],qs['fields'](_0x319b3b[_0x005b('0x2d')][_0x005b('0x30')]));_0x32d6fd[_0x005b('0x31')]=_0x32d6fd[_0x005b('0x31')][_0x005b('0x32')]?_0x32d6fd['attributes']:_0x26375b[_0x005b('0x41')];if(_0x319b3b[_0x005b('0x2d')][_0x005b('0x3c')]){_0x32d6fd['include']=[{'all':!![]}];}_0x32d6fd=_[_0x005b('0x39')]({},_0x32d6fd,_0x319b3b['options']);return db['VoiceChanSpy']['find'](_0x32d6fd)['then'](handleEntityNotFound(_0x5f5b71,null))[_0x005b('0x1f')](respondWithResult(_0x5f5b71,null))[_0x005b('0x40')](handleError(_0x5f5b71,null));};exports[_0x005b('0x44')]=function(_0xb1898,_0x4e19cd){return db[_0x005b('0x29')][_0x005b('0x44')](_0xb1898['body'],{})[_0x005b('0x1f')](function(_0x223c9c){var _0x15c675=_0xb1898[_0x005b('0x45')][_0x005b('0x20')]({'plain':!![]});if(!_0x15c675)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c675[_0x005b('0x46')]===_0x005b('0x45')){var _0x2aebe9=_0x223c9c[_0x005b('0x20')]({'plain':!![]});var _0x19ca85=_0x005b('0x47');return db['UserProfileSection'][_0x005b('0x48')]({'where':{'name':_0x19ca85,'userProfileId':_0x15c675[_0x005b('0x49')]},'raw':!![]})[_0x005b('0x1f')](function(_0x3fe1cd){if(_0x3fe1cd&&_0x3fe1cd[_0x005b('0x4a')]===0x0){return db[_0x005b('0x21')]['create']({'name':_0x2aebe9[_0x005b('0x26')],'resourceId':_0x2aebe9['id'],'type':_0x3fe1cd[_0x005b('0x26')],'sectionId':_0x3fe1cd['id']},{})['then'](function(){return _0x223c9c;});}else{return _0x223c9c;}})['catch'](function(_0x22bf46){logger[_0x005b('0x24')](_0x005b('0x4b'),_0x22bf46);throw _0x22bf46;});}return _0x223c9c;})[_0x005b('0x1f')](respondWithResult(_0x4e19cd,0xc9))[_0x005b('0x40')](handleError(_0x4e19cd,null));};exports[_0x005b('0x1e')]=function(_0x91c265,_0x4ffd69){if(_0x91c265[_0x005b('0x4c')]['id']){delete _0x91c265['body']['id'];}return db['VoiceChanSpy'][_0x005b('0x48')]({'where':{'id':_0x91c265[_0x005b('0x4d')]['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4ffd69,null))['then'](saveUpdates(_0x91c265[_0x005b('0x4c')],null))[_0x005b('0x1f')](respondWithResult(_0x4ffd69,null))[_0x005b('0x40')](handleError(_0x4ffd69,null));};exports['destroy']=function(_0x17018b,_0x4f4130){return db[_0x005b('0x29')][_0x005b('0x48')]({'where':{'id':_0x17018b['params']['id']}})[_0x005b('0x1f')](handleEntityNotFound(_0x4f4130,null))[_0x005b('0x1f')](removeEntity(_0x4f4130,null))[_0x005b('0x40')](handleError(_0x4f4130,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 5fb17a1..d52bfd3 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 _0xd0db=['MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','name','options','StopMixMonitor','length','concat','internal','findAll','agent','catch','models','define','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record'];(function(_0x246465,_0x2cf11c){var _0x41e03c=function(_0x1c50b3){while(--_0x1c50b3){_0x246465['push'](_0x246465['shift']());}};_0x41e03c(++_0x2cf11c);}(_0xd0db,0x1d2));var _0xbd0d=function(_0x188bfb,_0x28a7c5){_0x188bfb=_0x188bfb-0x0;var _0x2614fb=_0xd0db[_0x188bfb];return _0x2614fb;};'use strict';var _=require(_0xbd0d('0x0'));var util=require(_0xbd0d('0x1'));var BPromise=require('bluebird');var attributes=require(_0xbd0d('0x2'));var getUserApplications=function(_0x1ce006,_0x3e6b40,_0x4c8dbf){var _0x359577=0x1;var _0x4ddc5a=[];var _0x3c2295={'context':_0x3e6b40[_0xbd0d('0x3')]||_0xbd0d('0x4'),'exten':util[_0xbd0d('0x5')](_0xbd0d('0x6'),_0x1ce006[_0xbd0d('0x7')],_0x4c8dbf),'type':_0xbd0d('0x8'),'isApp':![],'ChanSpyId':_0x1ce006['id'],'UserId':_0x3e6b40['id']};_0x4ddc5a[_0xbd0d('0x9')](_[_0xbd0d('0xa')]({'app':_0xbd0d('0xb'),'appdata':util[_0xbd0d('0x5')](_0xbd0d('0xc'),_0xbd0d('0xd')),'priority':_0x359577++},_0x3c2295));if(_0x1ce006[_0xbd0d('0xe')]){_0x4ddc5a[_0xbd0d('0x9')](_[_0xbd0d('0xa')]({'app':_0xbd0d('0xf'),'appdata':util[_0xbd0d('0x5')](_0xbd0d('0x10'),_0x1ce006[_0xbd0d('0x11')]),'priority':_0x359577++},_0x3c2295));}if(_0x1ce006[_0xbd0d('0x12')]){_0x4ddc5a['push'](_[_0xbd0d('0xa')]({'app':'Authenticate','appdata':_0x1ce006[_0xbd0d('0x13')],'priority':_0x359577++},_0x3c2295));}_0x4ddc5a[_0xbd0d('0x9')](_[_0xbd0d('0xa')]({'app':_0xbd0d('0x14'),'appdata':util[_0xbd0d('0x5')]('SIP/%s,%s',_0x3e6b40[_0xbd0d('0x15')],_0x1ce006[_0xbd0d('0x16')]?_0x1ce006[_0xbd0d('0x16')]['join'](''):''),'priority':_0x359577++},_0x3c2295));if(_0x1ce006[_0xbd0d('0xe')]){_0x4ddc5a[_0xbd0d('0x9')](_[_0xbd0d('0xa')]({'app':_0xbd0d('0x17'),'priority':_0x359577++},_0x3c2295));}return _0x4ddc5a;};var getChanSpyApplications=function(_0x1240e7,_0x4841f9){var _0xfee2b9=[];for(var _0x29d2c9=0x0,_0xce1cc=0x1;_0x29d2c9<_0x4841f9[_0xbd0d('0x18')];_0x29d2c9++,_0xce1cc=0x1){_0xfee2b9=_0xfee2b9[_0xbd0d('0x19')](getUserApplications(_0x1240e7,_0x4841f9[_0x29d2c9],_0x4841f9[_0x29d2c9][_0xbd0d('0x1a')]));if(_0x4841f9[_0x29d2c9][_0xbd0d('0x1a')]!=_0x4841f9[_0x29d2c9][_0xbd0d('0x15')]){_0xfee2b9=_0xfee2b9[_0xbd0d('0x19')](getUserApplications(_0x1240e7,_0x4841f9[_0x29d2c9],_0x4841f9[_0x29d2c9][_0xbd0d('0x15')]));}}return _0xfee2b9;};var getChanSpyPromise=function(_0x90ace2,_0x41c08c){return new BPromise(function(_0x1f6992,_0x36bc17){return _0x90ace2['User'][_0xbd0d('0x1b')]({'attributes':['id',_0xbd0d('0x15'),_0xbd0d('0x1a')],'where':{'role':_0xbd0d('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x256bd2){if(_0x256bd2){return _0x1f6992(getChanSpyApplications(_0x41c08c,_0x256bd2));}return _0x1f6992([]);})[_0xbd0d('0x1d')](function(_0x5e4b42){_0x36bc17(_0x5e4b42);});});};module['exports']=function(_0x1eafe0,_0x3d9263){var _0x56b6aa=_0x1eafe0[_0xbd0d('0x1e')];return _0x1eafe0[_0xbd0d('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0xbd0d('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a0bac,_0x456b22,_0x22a90f){return getChanSpyPromise(_0x56b6aa,_0x2a0bac)[_0xbd0d('0x21')](function(_0x398654){if(_0x398654&&_0x398654[_0xbd0d('0x18')]){return _0x56b6aa[_0xbd0d('0x22')][_0xbd0d('0x23')](_0x398654);}})[_0xbd0d('0x21')](function(){_0x22a90f();})[_0xbd0d('0x1d')](function(_0x2e474a){_0x22a90f(_0x2e474a);});},'afterUpdate':function(_0x2776c4,_0x380e75,_0x5cf11f){return _0x56b6aa[_0xbd0d('0x22')][_0xbd0d('0x24')]({'where':{'ChanSpyId':_0x2776c4['id']}})[_0xbd0d('0x21')](function(){return getChanSpyPromise(_0x56b6aa,_0x2776c4);})['then'](function(_0x32e55c){if(_0x32e55c&&_0x32e55c[_0xbd0d('0x18')]){return _0x56b6aa[_0xbd0d('0x22')][_0xbd0d('0x23')](_0x32e55c);}})[_0xbd0d('0x21')](function(){_0x5cf11f();})[_0xbd0d('0x1d')](function(_0x535a23){_0x5cf11f(_0x535a23);});},'afterDestroy':function(_0x1dd369,_0x352971,_0x21ef1a){return _0x56b6aa[_0xbd0d('0x22')]['destroy']({'where':{'ChanSpyId':_0x1dd369['id']}})['then'](function(){_0x21ef1a();})[_0xbd0d('0x1d')](function(_0x3bc97e){_0x21ef1a(_0x3bc97e);});}}});}; \ No newline at end of file +var _0x5477=['Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','push','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','internal','concat','User','agent','then','exports','define','VoiceChanSpy','voice_chanspy','bulkCreate','catch','destroy','VoiceExtension','lodash','util','from-sip','format','%s%s','system','merge'];(function(_0x1f4c83,_0x2ab1dc){var _0xa8b4e7=function(_0x1150d5){while(--_0x1150d5){_0x1f4c83['push'](_0x1f4c83['shift']());}};_0xa8b4e7(++_0x2ab1dc);}(_0x5477,0x1a9));var _0x7547=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x5477[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x7547('0x0'));var util=require(_0x7547('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x419cbd,_0x314fbe,_0x5335ff){var _0x34e191=0x1;var _0x22b436=[];var _0x2db489={'context':_0x314fbe['context']||_0x7547('0x2'),'exten':util[_0x7547('0x3')](_0x7547('0x4'),_0x419cbd['prefix'],_0x5335ff),'type':_0x7547('0x5'),'isApp':![],'ChanSpyId':_0x419cbd['id'],'UserId':_0x314fbe['id']};_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0x7'),'appdata':util[_0x7547('0x3')](_0x7547('0x8'),_0x7547('0x9')),'priority':_0x34e191++},_0x2db489));if(_0x419cbd[_0x7547('0xa')]){_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0xb'),'appdata':util[_0x7547('0x3')]('${UNIQUEID}.%s,a',_0x419cbd[_0x7547('0xc')]),'priority':_0x34e191++},_0x2db489));}if(_0x419cbd[_0x7547('0xd')]){_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0xe'),'appdata':_0x419cbd[_0x7547('0xf')],'priority':_0x34e191++},_0x2db489));}_0x22b436[_0x7547('0x10')](_['merge']({'app':_0x7547('0x11'),'appdata':util['format'](_0x7547('0x12'),_0x314fbe[_0x7547('0x13')],_0x419cbd[_0x7547('0x14')]?_0x419cbd[_0x7547('0x14')]['join'](''):''),'priority':_0x34e191++},_0x2db489));if(_0x419cbd[_0x7547('0xa')]){_0x22b436['push'](_[_0x7547('0x6')]({'app':_0x7547('0x15'),'priority':_0x34e191++},_0x2db489));}return _0x22b436;};var getChanSpyApplications=function(_0x26f4fb,_0x228f40){var _0x327e24=[];for(var _0x488cb4=0x0,_0x1ffb8f=0x1;_0x488cb4<_0x228f40[_0x7547('0x16')];_0x488cb4++,_0x1ffb8f=0x1){_0x327e24=_0x327e24['concat'](getUserApplications(_0x26f4fb,_0x228f40[_0x488cb4],_0x228f40[_0x488cb4][_0x7547('0x17')]));if(_0x228f40[_0x488cb4][_0x7547('0x17')]!=_0x228f40[_0x488cb4][_0x7547('0x13')]){_0x327e24=_0x327e24[_0x7547('0x18')](getUserApplications(_0x26f4fb,_0x228f40[_0x488cb4],_0x228f40[_0x488cb4][_0x7547('0x13')]));}}return _0x327e24;};var getChanSpyPromise=function(_0x4d6b84,_0x3b44a5){return new BPromise(function(_0x15c9d6,_0x24eca5){return _0x4d6b84[_0x7547('0x19')]['findAll']({'attributes':['id',_0x7547('0x13'),_0x7547('0x17')],'where':{'role':_0x7547('0x1a'),'chanspy':!![]},'raw':!![]})[_0x7547('0x1b')](function(_0x409c51){if(_0x409c51){return _0x15c9d6(getChanSpyApplications(_0x3b44a5,_0x409c51));}return _0x15c9d6([]);})['catch'](function(_0x273f4a){_0x24eca5(_0x273f4a);});});};module[_0x7547('0x1c')]=function(_0x2fd78c,_0x32f7a5){var _0x3881da=_0x2fd78c['models'];return _0x2fd78c[_0x7547('0x1d')](_0x7547('0x1e'),attributes,{'tableName':_0x7547('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49425b,_0x54c88e,_0x4ad4fe){return getChanSpyPromise(_0x3881da,_0x49425b)[_0x7547('0x1b')](function(_0x1971d2){if(_0x1971d2&&_0x1971d2[_0x7547('0x16')]){return _0x3881da['VoiceExtension'][_0x7547('0x20')](_0x1971d2);}})[_0x7547('0x1b')](function(){_0x4ad4fe();})[_0x7547('0x21')](function(_0x2cfac6){_0x4ad4fe(_0x2cfac6);});},'afterUpdate':function(_0x4d0d78,_0x1339cc,_0x4ad06e){return _0x3881da['VoiceExtension'][_0x7547('0x22')]({'where':{'ChanSpyId':_0x4d0d78['id']}})[_0x7547('0x1b')](function(){return getChanSpyPromise(_0x3881da,_0x4d0d78);})[_0x7547('0x1b')](function(_0x1ab25e){if(_0x1ab25e&&_0x1ab25e['length']){return _0x3881da[_0x7547('0x23')][_0x7547('0x20')](_0x1ab25e);}})[_0x7547('0x1b')](function(){_0x4ad06e();})[_0x7547('0x21')](function(_0x4bf176){_0x4ad06e(_0x4bf176);});},'afterDestroy':function(_0x1570ee,_0x15544b,_0x285e38){return _0x3881da[_0x7547('0x23')][_0x7547('0x22')]({'where':{'ChanSpyId':_0x1570ee['id']}})[_0x7547('0x1b')](function(){_0x285e38();})[_0x7547('0x21')](function(_0x242b70){_0x285e38(_0x242b70);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 902c121..e6341e5 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 _0xd87e=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x19aee6,_0xcb2918){var _0x511975=function(_0x4fbb42){while(--_0x4fbb42){_0x19aee6['push'](_0x19aee6['shift']());}};_0x511975(++_0xcb2918);}(_0xd87e,0x1bf));var _0xed87=function(_0x41a4ab,_0x16a662){_0x41a4ab=_0x41a4ab-0x0;var _0x143681=_0xd87e[_0x41a4ab];return _0x143681;};'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')]('VoiceChanSpy,\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);});});} \ No newline at end of file +var _0x750a=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x1d82a8,_0x32a744){var _0x368fcc=function(_0x78bf67){while(--_0x78bf67){_0x1d82a8['push'](_0x1d82a8['shift']());}};_0x368fcc(++_0x32a744);}(_0x750a,0x140));var _0xa750=function(_0x5a18ed,_0x9936d2){_0x5a18ed=_0x5a18ed-0x0;var _0x12d357=_0x750a[_0x5a18ed];return _0x12d357;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 602a5e8..4974707 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 _0x01dc=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','show'];(function(_0x412e90,_0x3acfb2){var _0x4d6694=function(_0xa86735){while(--_0xa86735){_0x412e90['push'](_0x412e90['shift']());}};_0x4d6694(++_0x3acfb2);}(_0x01dc,0x1ce));var _0xc01d=function(_0x4bb1fc,_0x1f57fc){_0x4bb1fc=_0x4bb1fc-0x0;var _0x27c426=_0x01dc[_0x4bb1fc];return _0x27c426;};'use strict';var multer=require(_0xc01d('0x0'));var util=require(_0xc01d('0x1'));var path=require(_0xc01d('0x2'));var timeout=require(_0xc01d('0x3'));var express=require(_0xc01d('0x4'));var router=express[_0xc01d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc01d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc01d('0x7'));var controller=require(_0xc01d('0x8'));router['get']('/',auth[_0xc01d('0x9')](),controller[_0xc01d('0xa')]);router['get'](_0xc01d('0xb'),auth['isAuthenticated'](),controller[_0xc01d('0xc')]);router[_0xc01d('0xd')]('/',auth[_0xc01d('0x9')](),controller[_0xc01d('0xe')]);router[_0xc01d('0xf')](_0xc01d('0xb'),auth[_0xc01d('0x9')](),controller[_0xc01d('0x10')]);router[_0xc01d('0x11')](_0xc01d('0xb'),auth[_0xc01d('0x9')](),controller[_0xc01d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x45e9=['express','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x294023,_0x162f34){var _0x42df52=function(_0x3de868){while(--_0x3de868){_0x294023['push'](_0x294023['shift']());}};_0x42df52(++_0x162f34);}(_0x45e9,0x1f0));var _0x945e=function(_0x290176,_0x3ba2da){_0x290176=_0x290176-0x0;var _0x32eb68=_0x45e9[_0x290176];return _0x32eb68;};'use strict';var multer=require(_0x945e('0x0'));var util=require(_0x945e('0x1'));var path=require(_0x945e('0x2'));var timeout=require(_0x945e('0x3'));var express=require(_0x945e('0x4'));var router=express['Router']();var fs_extra=require(_0x945e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x945e('0x6'));var config=require(_0x945e('0x7'));var controller=require(_0x945e('0x8'));router[_0x945e('0x9')]('/',auth[_0x945e('0xa')](),controller[_0x945e('0xb')]);router[_0x945e('0x9')](_0x945e('0xc'),auth[_0x945e('0xa')](),controller[_0x945e('0xd')]);router[_0x945e('0xe')]('/',auth[_0x945e('0xa')](),controller[_0x945e('0xf')]);router['put'](_0x945e('0xc'),auth['isAuthenticated'](),controller[_0x945e('0x10')]);router[_0x945e('0x11')](_0x945e('0xc'),auth[_0x945e('0xa')](),controller[_0x945e('0x12')]);module[_0x945e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 964962f..f73b4a5 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 _0x9d00=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0x9d00,0x140));var _0x09d0=function(_0x12a294,_0x159577){_0x12a294=_0x12a294-0x0;var _0x4edd8f=_0x9d00[_0x12a294];return _0x4edd8f;};'use strict';var Sequelize=require(_0x09d0('0x0'));module[_0x09d0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x09d0('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x09d0('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2817=['STRING','sequelize'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2817,0x183));var _0x7281=function(_0x19a412,_0x1864d2){_0x19a412=_0x19a412-0x0;var _0x4b79d1=_0x2817[_0x19a412];return _0x4b79d1;};'use strict';var Sequelize=require(_0x7281('0x0'));module['exports']={'name':{'type':Sequelize[_0x7281('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x7281('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 9a84851..88a796d 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 _0xbcf0=['client','http','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Contexts','UserProfileResource','stack','name','index','VoiceContext','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','show','params','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise'];(function(_0x38ded6,_0x260e8c){var _0x404a50=function(_0x316b34){while(--_0x316b34){_0x38ded6['push'](_0x38ded6['shift']());}};_0x404a50(++_0x260e8c);}(_0xbcf0,0xb7));var _0x0bcf=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xbcf0[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0x0bcf('0x0'));var rimraf=require(_0x0bcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bcf('0x2'));var moment=require(_0x0bcf('0x3'));var BPromise=require(_0x0bcf('0x4'));var Mustache=require(_0x0bcf('0x5'));var util=require(_0x0bcf('0x6'));var path=require(_0x0bcf('0x7'));var sox=require(_0x0bcf('0x8'));var csv=require('to-csv');var ejs=require(_0x0bcf('0x9'));var fs=require('fs');var fs_extra=require(_0x0bcf('0xa'));var _=require(_0x0bcf('0xb'));var squel=require(_0x0bcf('0xc'));var crypto=require(_0x0bcf('0xd'));var jsforce=require(_0x0bcf('0xe'));var deskjs=require(_0x0bcf('0xf'));var toCsv=require(_0x0bcf('0x10'));var querystring=require(_0x0bcf('0x11'));var Papa=require('papaparse');var Redis=require(_0x0bcf('0x12'));var authService=require(_0x0bcf('0x13'));var qs=require(_0x0bcf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bcf('0x15'));var logger=require(_0x0bcf('0x16'))(_0x0bcf('0x17'));var utils=require(_0x0bcf('0x18'));var config=require(_0x0bcf('0x19'));var licenseUtil=require(_0x0bcf('0x1a'));var db=require(_0x0bcf('0x1b'))['db'];var jayson=require(_0x0bcf('0x1c'));var client=jayson[_0x0bcf('0x1d')][_0x0bcf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x376ba4,_0x1d2795,_0x2d0f65,_0x1e3221){return new BPromise(function(_0x2cbaae,_0x1c3210){var _0x4ca8ea=_0x1e3221||client;return _0x4ca8ea['request'](_0x376ba4,_0x2d0f65)['then'](function(_0x39363f){logger[_0x0bcf('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x1d2795,_0x0bcf('0x20'));logger[_0x0bcf('0x21')](_0x0bcf('0x22'),_0x1d2795,_0x0bcf('0x20'),JSON['stringify'](_0x39363f));if(_0x39363f['error']){if(_0x39363f[_0x0bcf('0x23')][_0x0bcf('0x24')]===0x1f4){logger[_0x0bcf('0x23')](_0x0bcf('0x25'),_0x1d2795,_0x39363f[_0x0bcf('0x23')][_0x0bcf('0x26')]);return _0x1c3210(_0x39363f[_0x0bcf('0x23')][_0x0bcf('0x26')]);}logger[_0x0bcf('0x23')]('VoiceContext,\x20%s,\x20%s',_0x1d2795,_0x39363f['error']['message']);return _0x2cbaae(_0x39363f['error'][_0x0bcf('0x26')]);}else{logger[_0x0bcf('0x1f')](_0x0bcf('0x25'),_0x1d2795,'request\x20sent');_0x2cbaae(_0x39363f[_0x0bcf('0x27')][_0x0bcf('0x26')]);}})[_0x0bcf('0x28')](function(_0x2fc280){logger['error'](_0x0bcf('0x25'),_0x1d2795,_0x2fc280);_0x1c3210(_0x2fc280);});});}function respondWithStatusCode(_0x4f1ec9,_0x45b98e){_0x45b98e=_0x45b98e||0xcc;return function(_0x3f97ce){if(_0x3f97ce){return _0x4f1ec9[_0x0bcf('0x29')](_0x45b98e);}return _0x4f1ec9[_0x0bcf('0x2a')](_0x45b98e)[_0x0bcf('0x2b')]();};}function respondWithResult(_0x48bb85,_0x3a527d){_0x3a527d=_0x3a527d||0xc8;return function(_0xf8cdcd){if(_0xf8cdcd){return _0x48bb85['status'](_0x3a527d)['json'](_0xf8cdcd);}};}function respondWithFilteredResult(_0x380f86,_0x5a2b97){return function(_0x2ccc6f){if(_0x2ccc6f){var _0x3fd9c0=typeof _0x5a2b97['offset']==='undefined'&&typeof _0x5a2b97['limit']==='undefined';var _0xc18cc7=_0x2ccc6f[_0x0bcf('0x2c')];var _0x8ff78b=_0x3fd9c0?0x0:_0x5a2b97[_0x0bcf('0x2d')];var _0x8a95c1=_0x3fd9c0?_0x2ccc6f[_0x0bcf('0x2c')]:_0x5a2b97['offset']+_0x5a2b97[_0x0bcf('0x2e')];var _0xea2870;if(_0x8a95c1>=_0xc18cc7){_0x8a95c1=_0xc18cc7;_0xea2870=0xc8;}else{_0xea2870=0xce;}_0x380f86[_0x0bcf('0x2a')](_0xea2870);return _0x380f86['set'](_0x0bcf('0x2f'),_0x8ff78b+'-'+_0x8a95c1+'/'+_0xc18cc7)['json'](_0x2ccc6f);}return null;};}function patchUpdates(_0x3a603f){return function(_0x2464b1){try{jsonpatch[_0x0bcf('0x30')](_0x2464b1,_0x3a603f,!![]);}catch(_0x14a8f0){return BPromise[_0x0bcf('0x31')](_0x14a8f0);}return _0x2464b1['save']();};}function saveUpdates(_0x10bf15,_0x3dac6f){return function(_0x6e3a93){if(_0x6e3a93){return _0x6e3a93[_0x0bcf('0x32')](_0x10bf15)[_0x0bcf('0x33')](function(_0x5ad303){return _0x5ad303;});}return null;};}function removeEntity(_0xb8543e,_0x5f21e2){return function(_0x1a29a2){if(_0x1a29a2){return _0x1a29a2[_0x0bcf('0x34')]()['then'](function(){var _0x190c49=_0x1a29a2[_0x0bcf('0x35')]({'plain':!![]});var _0x417d8d=_0x0bcf('0x36');return db[_0x0bcf('0x37')][_0x0bcf('0x34')]({'where':{'type':_0x417d8d,'resourceId':_0x190c49['id']}})[_0x0bcf('0x33')](function(){return _0x1a29a2;});})[_0x0bcf('0x33')](function(){_0xb8543e[_0x0bcf('0x2a')](0xcc)[_0x0bcf('0x2b')]();});}};}function handleEntityNotFound(_0x1597b3,_0x376072){return function(_0x41290c){if(!_0x41290c){_0x1597b3[_0x0bcf('0x29')](0x194);}return _0x41290c;};}function handleError(_0x46fdf5,_0x459865){_0x459865=_0x459865||0x1f4;return function(_0x38251b){logger[_0x0bcf('0x23')](_0x38251b[_0x0bcf('0x38')]);if(_0x38251b[_0x0bcf('0x39')]){delete _0x38251b['name'];}_0x46fdf5[_0x0bcf('0x2a')](_0x459865)['send'](_0x38251b);};}exports[_0x0bcf('0x3a')]=function(_0x118e02,_0x5e26ee){var _0x72ec5c={},_0x51ed19={},_0x253c59={'count':0x0,'rows':[]};var _0x115d27=_['map'](db[_0x0bcf('0x3b')][_0x0bcf('0x3c')],function(_0x24ee28){return{'name':_0x24ee28[_0x0bcf('0x3d')],'type':_0x24ee28['type'][_0x0bcf('0x3e')]};});_0x51ed19[_0x0bcf('0x3f')]=_[_0x0bcf('0x40')](_0x115d27,'name');_0x51ed19['query']=_[_0x0bcf('0x41')](_0x118e02[_0x0bcf('0x42')]);_0x51ed19[_0x0bcf('0x43')]=_['intersection'](_0x51ed19[_0x0bcf('0x3f')],_0x51ed19['query']);_0x72ec5c[_0x0bcf('0x44')]=_[_0x0bcf('0x45')](_0x51ed19['model'],qs[_0x0bcf('0x46')](_0x118e02[_0x0bcf('0x42')][_0x0bcf('0x46')]));_0x72ec5c[_0x0bcf('0x44')]=_0x72ec5c['attributes'][_0x0bcf('0x47')]?_0x72ec5c[_0x0bcf('0x44')]:_0x51ed19[_0x0bcf('0x3f')];if(!_0x118e02[_0x0bcf('0x42')][_0x0bcf('0x48')](_0x0bcf('0x49'))){_0x72ec5c[_0x0bcf('0x2e')]=qs[_0x0bcf('0x2e')](_0x118e02[_0x0bcf('0x42')][_0x0bcf('0x2e')]);_0x72ec5c[_0x0bcf('0x2d')]=qs['offset'](_0x118e02[_0x0bcf('0x42')][_0x0bcf('0x2d')]);}_0x72ec5c[_0x0bcf('0x4a')]=qs[_0x0bcf('0x4b')](_0x118e02[_0x0bcf('0x42')]['sort']);_0x72ec5c[_0x0bcf('0x4c')]=qs['filters'](_[_0x0bcf('0x4d')](_0x118e02[_0x0bcf('0x42')],_0x51ed19[_0x0bcf('0x43')]),_0x115d27);if(_0x118e02['query']['filter']){_0x72ec5c[_0x0bcf('0x4c')]=_[_0x0bcf('0x4e')](_0x72ec5c[_0x0bcf('0x4c')],{'$or':_['map'](_0x115d27,function(_0x1efa28){if(_0x1efa28[_0x0bcf('0x4f')]!=='VIRTUAL'){var _0x3e3f14={};_0x3e3f14[_0x1efa28['name']]={'$like':'%'+_0x118e02[_0x0bcf('0x42')][_0x0bcf('0x50')]+'%'};return _0x3e3f14;}})});}_0x72ec5c=_['merge']({},_0x72ec5c,_0x118e02[_0x0bcf('0x51')]);var _0x4245c0={'where':_0x72ec5c[_0x0bcf('0x4c')]};return db[_0x0bcf('0x3b')][_0x0bcf('0x2c')](_0x4245c0)['then'](function(_0x58d89d){_0x253c59[_0x0bcf('0x2c')]=_0x58d89d;if(_0x118e02['query'][_0x0bcf('0x52')]){_0x72ec5c[_0x0bcf('0x53')]=[{'all':!![]}];}return db['VoiceContext'][_0x0bcf('0x54')](_0x72ec5c);})['then'](function(_0xd59162){_0x253c59[_0x0bcf('0x55')]=_0xd59162;return _0x253c59;})['then'](respondWithFilteredResult(_0x5e26ee,_0x72ec5c))[_0x0bcf('0x28')](handleError(_0x5e26ee,null));};exports[_0x0bcf('0x56')]=function(_0x75609b,_0x42f768){var _0xb6109b={'raw':![],'where':{'id':_0x75609b[_0x0bcf('0x57')]['id']}},_0x5cf517={};_0x5cf517[_0x0bcf('0x3f')]=_[_0x0bcf('0x41')](db['VoiceContext'][_0x0bcf('0x3c')]);_0x5cf517[_0x0bcf('0x42')]=_['keys'](_0x75609b[_0x0bcf('0x42')]);_0x5cf517['filters']=_[_0x0bcf('0x45')](_0x5cf517['model'],_0x5cf517[_0x0bcf('0x42')]);_0xb6109b['attributes']=_[_0x0bcf('0x45')](_0x5cf517[_0x0bcf('0x3f')],qs[_0x0bcf('0x46')](_0x75609b['query'][_0x0bcf('0x46')]));_0xb6109b[_0x0bcf('0x44')]=_0xb6109b[_0x0bcf('0x44')]['length']?_0xb6109b[_0x0bcf('0x44')]:_0x5cf517['model'];if(_0x75609b['query'][_0x0bcf('0x52')]){_0xb6109b[_0x0bcf('0x53')]=[{'all':!![]}];}_0xb6109b=_[_0x0bcf('0x4e')]({},_0xb6109b,_0x75609b[_0x0bcf('0x51')]);return db['VoiceContext'][_0x0bcf('0x58')](_0xb6109b)[_0x0bcf('0x33')](handleEntityNotFound(_0x42f768,null))[_0x0bcf('0x33')](respondWithResult(_0x42f768,null))[_0x0bcf('0x28')](handleError(_0x42f768,null));};exports[_0x0bcf('0x59')]=function(_0x485754,_0x1bf0dd,_0x329e1f){var _0x21d1e2;return db['VoiceContext'][_0x0bcf('0x59')](_0x485754['body'],{'raw':!![]})[_0x0bcf('0x33')](function(_0x9f7fd8){_0x21d1e2=_0x9f7fd8;return db['VoiceContext'][_0x0bcf('0x54')]({'raw':!![]});})[_0x0bcf('0x33')](function(_0xf31bb){var _0x6e5bbc=fs[_0x0bcf('0x5a')](path[_0x0bcf('0x5b')](config[_0x0bcf('0x5c')],_0x0bcf('0x5d')),_0x0bcf('0x5e'));var _0x55c3cb=ejs[_0x0bcf('0x5f')](_0x6e5bbc,{'contexts':_0xf31bb||[]});fs[_0x0bcf('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x55c3cb);})[_0x0bcf('0x33')](function(){return respondWithRpcPromise(_0x0bcf('0x61'),'create',{'module':'chan_sip.so'});})[_0x0bcf('0x33')](function(){var _0x3609dd=_0x485754['user'][_0x0bcf('0x35')]({'plain':!![]});if(!_0x3609dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3609dd[_0x0bcf('0x62')]==='user'){var _0x2aeed8=_0x21d1e2[_0x0bcf('0x35')]({'plain':!![]});return db[_0x0bcf('0x63')]['find']({'where':{'name':_0x0bcf('0x36'),'userProfileId':_0x3609dd[_0x0bcf('0x64')]},'raw':!![]})[_0x0bcf('0x33')](function(_0x1a7f6b){if(_0x1a7f6b&&_0x1a7f6b[_0x0bcf('0x65')]===0x0){return db['UserProfileResource'][_0x0bcf('0x59')]({'name':_0x2aeed8[_0x0bcf('0x39')],'resourceId':_0x2aeed8['id'],'type':_0x1a7f6b['name'],'sectionId':_0x1a7f6b['id']},{})[_0x0bcf('0x33')](function(){return _0x21d1e2;});}else{return _0x21d1e2;}})[_0x0bcf('0x28')](function(_0x48321f){logger[_0x0bcf('0x23')](_0x0bcf('0x66'),_0x48321f);throw _0x48321f;});}return _0x21d1e2;})[_0x0bcf('0x33')](respondWithResult(_0x1bf0dd,0xc9))['catch'](handleError(_0x1bf0dd,null));};exports[_0x0bcf('0x32')]=function(_0x107755,_0xbe4bc1,_0x5a0c99){var _0x35c6e1;return db['VoiceContext'][_0x0bcf('0x58')]({'where':{'id':_0x107755[_0x0bcf('0x57')]['id']}})[_0x0bcf('0x33')](handleEntityNotFound(_0xbe4bc1,null))[_0x0bcf('0x33')](saveUpdates(_0x107755[_0x0bcf('0x67')],null))[_0x0bcf('0x33')](function(_0x1a56ca){if(_0x1a56ca){_0x35c6e1=_0x1a56ca;return db[_0x0bcf('0x3b')][_0x0bcf('0x54')]({'raw':!![]});}})['then'](function(_0xef4981){var _0x3c68f9=fs[_0x0bcf('0x5a')](path[_0x0bcf('0x5b')](config[_0x0bcf('0x5c')],_0x0bcf('0x5d')),_0x0bcf('0x5e'));var _0x230eac=ejs[_0x0bcf('0x5f')](_0x3c68f9,{'contexts':_0xef4981||[]});fs[_0x0bcf('0x60')](_0x0bcf('0x68'),_0x230eac);})['then'](function(){return respondWithRpcPromise(_0x0bcf('0x61'),_0x0bcf('0x32'),{'module':_0x0bcf('0x69')});})[_0x0bcf('0x33')](function(){return _0x35c6e1;})[_0x0bcf('0x33')](respondWithResult(_0xbe4bc1,null))[_0x0bcf('0x28')](handleError(_0xbe4bc1,null));};exports['destroy']=function(_0x5da3d6,_0x35d579,_0x51ea28){var _0x7778ce;return db[_0x0bcf('0x3b')]['find']({'where':{'id':_0x5da3d6['params']['id']}})[_0x0bcf('0x33')](handleEntityNotFound(_0x35d579,null))[_0x0bcf('0x33')](removeEntity(_0x35d579,null))[_0x0bcf('0x33')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x0bcf('0x33')](function(_0x326274){var _0x33f1be=fs[_0x0bcf('0x5a')](path[_0x0bcf('0x5b')](config[_0x0bcf('0x5c')],_0x0bcf('0x5d')),_0x0bcf('0x5e'));var _0x19ce08=ejs[_0x0bcf('0x5f')](_0x33f1be,{'contexts':_0x326274});fs['writeFileSync'](_0x0bcf('0x68'),_0x19ce08);return respondWithRpcPromise('Reload','destroy',{'module':_0x0bcf('0x69')});})[_0x0bcf('0x28')](handleError(_0x35d579,null));}; \ No newline at end of file +var _0x0bf9=['root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','name','send','index','VoiceContext','rawAttributes','type','key','model','map','query','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','include','findAll','rows','show','keys','length','includeAll','find','create','body','readFileSync','join'];(function(_0xafde4a,_0x14e260){var _0x4199fb=function(_0xc5db4d){while(--_0xc5db4d){_0xafde4a['push'](_0xafde4a['shift']());}};_0x4199fb(++_0x14e260);}(_0x0bf9,0xe3));var _0x90bf=function(_0x7abf43,_0x2efe0c){_0x7abf43=_0x7abf43-0x0;var _0x365cb5=_0x0bf9[_0x7abf43];return _0x365cb5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x90bf('0x0'));var rp=require(_0x90bf('0x1'));var moment=require(_0x90bf('0x2'));var BPromise=require(_0x90bf('0x3'));var Mustache=require(_0x90bf('0x4'));var util=require(_0x90bf('0x5'));var path=require(_0x90bf('0x6'));var sox=require(_0x90bf('0x7'));var csv=require(_0x90bf('0x8'));var ejs=require(_0x90bf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90bf('0xa'));var squel=require(_0x90bf('0xb'));var crypto=require(_0x90bf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x90bf('0xd'));var toCsv=require(_0x90bf('0x8'));var querystring=require(_0x90bf('0xe'));var Papa=require('papaparse');var Redis=require(_0x90bf('0xf'));var authService=require(_0x90bf('0x10'));var qs=require(_0x90bf('0x11'));var as=require(_0x90bf('0x12'));var hardwareService=require(_0x90bf('0x13'));var logger=require(_0x90bf('0x14'))(_0x90bf('0x15'));var utils=require(_0x90bf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90bf('0x17'));var db=require(_0x90bf('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x90bf('0x19')][_0x90bf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x36ee85,_0x2c077d,_0x2004b0,_0x56c671){return new BPromise(function(_0x1fd823,_0x23d1c0){var _0x31d6c9=_0x56c671||client;return _0x31d6c9[_0x90bf('0x1b')](_0x36ee85,_0x2004b0)[_0x90bf('0x1c')](function(_0x4c1f0e){logger[_0x90bf('0x1d')](_0x90bf('0x1e'),_0x2c077d,_0x90bf('0x1f'));logger[_0x90bf('0x20')](_0x90bf('0x21'),_0x2c077d,_0x90bf('0x1f'),JSON[_0x90bf('0x22')](_0x4c1f0e));if(_0x4c1f0e[_0x90bf('0x23')]){if(_0x4c1f0e['error'][_0x90bf('0x24')]===0x1f4){logger[_0x90bf('0x23')](_0x90bf('0x1e'),_0x2c077d,_0x4c1f0e[_0x90bf('0x23')][_0x90bf('0x25')]);return _0x23d1c0(_0x4c1f0e[_0x90bf('0x23')]['message']);}logger[_0x90bf('0x23')](_0x90bf('0x1e'),_0x2c077d,_0x4c1f0e[_0x90bf('0x23')][_0x90bf('0x25')]);return _0x1fd823(_0x4c1f0e[_0x90bf('0x23')][_0x90bf('0x25')]);}else{logger[_0x90bf('0x1d')](_0x90bf('0x1e'),_0x2c077d,'request\x20sent');_0x1fd823(_0x4c1f0e[_0x90bf('0x26')][_0x90bf('0x25')]);}})[_0x90bf('0x27')](function(_0x28a02a){logger[_0x90bf('0x23')](_0x90bf('0x1e'),_0x2c077d,_0x28a02a);_0x23d1c0(_0x28a02a);});});}function respondWithStatusCode(_0x158d27,_0x5a4d2f){_0x5a4d2f=_0x5a4d2f||0xcc;return function(_0x52b51f){if(_0x52b51f){return _0x158d27[_0x90bf('0x28')](_0x5a4d2f);}return _0x158d27[_0x90bf('0x29')](_0x5a4d2f)[_0x90bf('0x2a')]();};}function respondWithResult(_0x58e40d,_0x22fe18){_0x22fe18=_0x22fe18||0xc8;return function(_0x477c77){if(_0x477c77){return _0x58e40d[_0x90bf('0x29')](_0x22fe18)[_0x90bf('0x2b')](_0x477c77);}};}function respondWithFilteredResult(_0x2f77ef,_0x4060c9){return function(_0x2aa241){if(_0x2aa241){var _0x580592=typeof _0x4060c9[_0x90bf('0x2c')]===_0x90bf('0x2d')&&typeof _0x4060c9[_0x90bf('0x2e')]===_0x90bf('0x2d');var _0x51b52b=_0x2aa241[_0x90bf('0x2f')];var _0x37fd8a=_0x580592?0x0:_0x4060c9[_0x90bf('0x2c')];var _0xce4e28=_0x580592?_0x2aa241[_0x90bf('0x2f')]:_0x4060c9['offset']+_0x4060c9[_0x90bf('0x2e')];var _0x10b1e3;if(_0xce4e28>=_0x51b52b){_0xce4e28=_0x51b52b;_0x10b1e3=0xc8;}else{_0x10b1e3=0xce;}_0x2f77ef[_0x90bf('0x29')](_0x10b1e3);return _0x2f77ef[_0x90bf('0x30')](_0x90bf('0x31'),_0x37fd8a+'-'+_0xce4e28+'/'+_0x51b52b)[_0x90bf('0x2b')](_0x2aa241);}return null;};}function patchUpdates(_0x196bd2){return function(_0x23517c){try{jsonpatch['apply'](_0x23517c,_0x196bd2,!![]);}catch(_0x5316d6){return BPromise[_0x90bf('0x32')](_0x5316d6);}return _0x23517c[_0x90bf('0x33')]();};}function saveUpdates(_0x3d39c8,_0x210b09){return function(_0x1b4748){if(_0x1b4748){return _0x1b4748[_0x90bf('0x34')](_0x3d39c8)[_0x90bf('0x1c')](function(_0xa72b7a){return _0xa72b7a;});}return null;};}function removeEntity(_0x490b58,_0x3ee594){return function(_0xc43c62){if(_0xc43c62){return _0xc43c62[_0x90bf('0x35')]()[_0x90bf('0x1c')](function(){var _0x441c86=_0xc43c62[_0x90bf('0x36')]({'plain':!![]});var _0x24b6da='Contexts';return db['UserProfileResource'][_0x90bf('0x35')]({'where':{'type':_0x24b6da,'resourceId':_0x441c86['id']}})[_0x90bf('0x1c')](function(){return _0xc43c62;});})[_0x90bf('0x1c')](function(){_0x490b58[_0x90bf('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b089,_0x30b801){return function(_0x3cdf9d){if(!_0x3cdf9d){_0x53b089[_0x90bf('0x28')](0x194);}return _0x3cdf9d;};}function handleError(_0x3a3a5b,_0x2d513b){_0x2d513b=_0x2d513b||0x1f4;return function(_0x4c2358){logger[_0x90bf('0x23')](_0x4c2358['stack']);if(_0x4c2358[_0x90bf('0x37')]){delete _0x4c2358[_0x90bf('0x37')];}_0x3a3a5b[_0x90bf('0x29')](_0x2d513b)[_0x90bf('0x38')](_0x4c2358);};}exports[_0x90bf('0x39')]=function(_0x21e15f,_0x5d2a91){var _0xb1eeb9={},_0x2f678a={},_0x4c5899={'count':0x0,'rows':[]};var _0x50be25=_['map'](db[_0x90bf('0x3a')][_0x90bf('0x3b')],function(_0x15b14c){return{'name':_0x15b14c['fieldName'],'type':_0x15b14c[_0x90bf('0x3c')][_0x90bf('0x3d')]};});_0x2f678a[_0x90bf('0x3e')]=_[_0x90bf('0x3f')](_0x50be25,_0x90bf('0x37'));_0x2f678a[_0x90bf('0x40')]=_['keys'](_0x21e15f[_0x90bf('0x40')]);_0x2f678a['filters']=_[_0x90bf('0x41')](_0x2f678a[_0x90bf('0x3e')],_0x2f678a['query']);_0xb1eeb9['attributes']=_[_0x90bf('0x41')](_0x2f678a[_0x90bf('0x3e')],qs['fields'](_0x21e15f[_0x90bf('0x40')][_0x90bf('0x42')]));_0xb1eeb9[_0x90bf('0x43')]=_0xb1eeb9['attributes']['length']?_0xb1eeb9[_0x90bf('0x43')]:_0x2f678a['model'];if(!_0x21e15f[_0x90bf('0x40')][_0x90bf('0x44')]('nolimit')){_0xb1eeb9[_0x90bf('0x2e')]=qs[_0x90bf('0x2e')](_0x21e15f[_0x90bf('0x40')]['limit']);_0xb1eeb9[_0x90bf('0x2c')]=qs[_0x90bf('0x2c')](_0x21e15f[_0x90bf('0x40')][_0x90bf('0x2c')]);}_0xb1eeb9[_0x90bf('0x45')]=qs[_0x90bf('0x46')](_0x21e15f[_0x90bf('0x40')][_0x90bf('0x46')]);_0xb1eeb9['where']=qs[_0x90bf('0x47')](_[_0x90bf('0x48')](_0x21e15f[_0x90bf('0x40')],_0x2f678a[_0x90bf('0x47')]),_0x50be25);if(_0x21e15f['query']['filter']){_0xb1eeb9[_0x90bf('0x49')]=_[_0x90bf('0x4a')](_0xb1eeb9[_0x90bf('0x49')],{'$or':_[_0x90bf('0x3f')](_0x50be25,function(_0x39d34f){if(_0x39d34f[_0x90bf('0x3c')]!==_0x90bf('0x4b')){var _0x135016={};_0x135016[_0x39d34f['name']]={'$like':'%'+_0x21e15f[_0x90bf('0x40')]['filter']+'%'};return _0x135016;}})});}_0xb1eeb9=_['merge']({},_0xb1eeb9,_0x21e15f['options']);var _0x43d538={'where':_0xb1eeb9[_0x90bf('0x49')]};return db[_0x90bf('0x3a')][_0x90bf('0x2f')](_0x43d538)[_0x90bf('0x1c')](function(_0x2a50f2){_0x4c5899[_0x90bf('0x2f')]=_0x2a50f2;if(_0x21e15f['query']['includeAll']){_0xb1eeb9[_0x90bf('0x4c')]=[{'all':!![]}];}return db[_0x90bf('0x3a')][_0x90bf('0x4d')](_0xb1eeb9);})[_0x90bf('0x1c')](function(_0x4cc6d3){_0x4c5899[_0x90bf('0x4e')]=_0x4cc6d3;return _0x4c5899;})[_0x90bf('0x1c')](respondWithFilteredResult(_0x5d2a91,_0xb1eeb9))[_0x90bf('0x27')](handleError(_0x5d2a91,null));};exports[_0x90bf('0x4f')]=function(_0x453a07,_0x162ca0){var _0x35c43b={'raw':![],'where':{'id':_0x453a07['params']['id']}},_0x2536c2={};_0x2536c2['model']=_[_0x90bf('0x50')](db['VoiceContext'][_0x90bf('0x3b')]);_0x2536c2[_0x90bf('0x40')]=_[_0x90bf('0x50')](_0x453a07['query']);_0x2536c2['filters']=_[_0x90bf('0x41')](_0x2536c2[_0x90bf('0x3e')],_0x2536c2[_0x90bf('0x40')]);_0x35c43b['attributes']=_['intersection'](_0x2536c2['model'],qs[_0x90bf('0x42')](_0x453a07['query'][_0x90bf('0x42')]));_0x35c43b[_0x90bf('0x43')]=_0x35c43b['attributes'][_0x90bf('0x51')]?_0x35c43b['attributes']:_0x2536c2[_0x90bf('0x3e')];if(_0x453a07[_0x90bf('0x40')][_0x90bf('0x52')]){_0x35c43b[_0x90bf('0x4c')]=[{'all':!![]}];}_0x35c43b=_[_0x90bf('0x4a')]({},_0x35c43b,_0x453a07['options']);return db[_0x90bf('0x3a')][_0x90bf('0x53')](_0x35c43b)['then'](handleEntityNotFound(_0x162ca0,null))[_0x90bf('0x1c')](respondWithResult(_0x162ca0,null))[_0x90bf('0x27')](handleError(_0x162ca0,null));};exports[_0x90bf('0x54')]=function(_0x256475,_0x4107f6,_0x4367d1){var _0x388546;return db[_0x90bf('0x3a')][_0x90bf('0x54')](_0x256475[_0x90bf('0x55')],{'raw':!![]})[_0x90bf('0x1c')](function(_0x3e89ab){_0x388546=_0x3e89ab;return db['VoiceContext'][_0x90bf('0x4d')]({'raw':!![]});})[_0x90bf('0x1c')](function(_0x3309c5){var _0x4a205b=fs[_0x90bf('0x56')](path[_0x90bf('0x57')](config[_0x90bf('0x58')],_0x90bf('0x59')),_0x90bf('0x5a'));var _0x7b605d=ejs['render'](_0x4a205b,{'contexts':_0x3309c5||[]});fs[_0x90bf('0x5b')](_0x90bf('0x5c'),_0x7b605d);})['then'](function(){return respondWithRpcPromise(_0x90bf('0x5d'),_0x90bf('0x54'),{'module':_0x90bf('0x5e')});})[_0x90bf('0x1c')](function(){var _0x55d3a0=_0x256475[_0x90bf('0x5f')][_0x90bf('0x36')]({'plain':!![]});if(!_0x55d3a0)throw new Error(_0x90bf('0x60'));if(_0x55d3a0[_0x90bf('0x61')]===_0x90bf('0x5f')){var _0x55fd5d=_0x388546[_0x90bf('0x36')]({'plain':!![]});return db[_0x90bf('0x62')]['find']({'where':{'name':'Contexts','userProfileId':_0x55d3a0[_0x90bf('0x63')]},'raw':!![]})[_0x90bf('0x1c')](function(_0x3aa314){if(_0x3aa314&&_0x3aa314[_0x90bf('0x64')]===0x0){return db[_0x90bf('0x65')][_0x90bf('0x54')]({'name':_0x55fd5d['name'],'resourceId':_0x55fd5d['id'],'type':_0x3aa314[_0x90bf('0x37')],'sectionId':_0x3aa314['id']},{})[_0x90bf('0x1c')](function(){return _0x388546;});}else{return _0x388546;}})[_0x90bf('0x27')](function(_0x1707d1){logger[_0x90bf('0x23')](_0x90bf('0x66'),_0x1707d1);throw _0x1707d1;});}return _0x388546;})[_0x90bf('0x1c')](respondWithResult(_0x4107f6,0xc9))['catch'](handleError(_0x4107f6,null));};exports[_0x90bf('0x34')]=function(_0x81b4ab,_0x2f9329,_0x257c50){var _0x588a82;return db[_0x90bf('0x3a')]['find']({'where':{'id':_0x81b4ab['params']['id']}})['then'](handleEntityNotFound(_0x2f9329,null))[_0x90bf('0x1c')](saveUpdates(_0x81b4ab[_0x90bf('0x55')],null))[_0x90bf('0x1c')](function(_0x41815a){if(_0x41815a){_0x588a82=_0x41815a;return db[_0x90bf('0x3a')][_0x90bf('0x4d')]({'raw':!![]});}})[_0x90bf('0x1c')](function(_0x267b75){var _0x5c02f1=fs[_0x90bf('0x56')](path[_0x90bf('0x57')](config[_0x90bf('0x58')],_0x90bf('0x59')),_0x90bf('0x5a'));var _0x230a68=ejs[_0x90bf('0x67')](_0x5c02f1,{'contexts':_0x267b75||[]});fs[_0x90bf('0x5b')](_0x90bf('0x5c'),_0x230a68);})[_0x90bf('0x1c')](function(){return respondWithRpcPromise(_0x90bf('0x5d'),'update',{'module':'chan_sip.so'});})['then'](function(){return _0x588a82;})[_0x90bf('0x1c')](respondWithResult(_0x2f9329,null))['catch'](handleError(_0x2f9329,null));};exports['destroy']=function(_0x2fe228,_0x187d4b,_0x5ca4e4){var _0x3d66ab;return db[_0x90bf('0x3a')][_0x90bf('0x53')]({'where':{'id':_0x2fe228[_0x90bf('0x68')]['id']}})[_0x90bf('0x1c')](handleEntityNotFound(_0x187d4b,null))[_0x90bf('0x1c')](removeEntity(_0x187d4b,null))[_0x90bf('0x1c')](function(){return db[_0x90bf('0x3a')]['findAll']({'raw':!![]});})[_0x90bf('0x1c')](function(_0x48f7a3){var _0xb92580=fs[_0x90bf('0x56')](path[_0x90bf('0x57')](config[_0x90bf('0x58')],_0x90bf('0x59')),'utf8');var _0x31088c=ejs[_0x90bf('0x67')](_0xb92580,{'contexts':_0x48f7a3});fs[_0x90bf('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x31088c);return respondWithRpcPromise(_0x90bf('0x5d'),_0x90bf('0x35'),{'module':_0x90bf('0x5e')});})[_0x90bf('0x27')](handleError(_0x187d4b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e26ab5a..facc919 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 _0xbf83=['VoiceContext','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbf83,0xf9));var _0x3bf8=function(_0x514a85,_0x433bf6){_0x514a85=_0x514a85-0x0;var _0x4ece5c=_0xbf83[_0x514a85];return _0x4ece5c;};'use strict';var _=require(_0x3bf8('0x0'));var util=require(_0x3bf8('0x1'));var logger=require(_0x3bf8('0x2'))(_0x3bf8('0x3'));var moment=require('moment');var BPromise=require(_0x3bf8('0x4'));var rp=require(_0x3bf8('0x5'));var fs=require('fs');var path=require(_0x3bf8('0x6'));var rimraf=require('rimraf');var config=require(_0x3bf8('0x7'));var attributes=require(_0x3bf8('0x8'));module[_0x3bf8('0x9')]=function(_0x2f8bc5,_0x11389b){return _0x2f8bc5[_0x3bf8('0xa')](_0x3bf8('0xb'),attributes,{'tableName':_0x3bf8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x564d=['define','VoiceContext','util','../../config/logger','moment','bluebird','path','../../config/environment','./voiceContext.attributes','exports'];(function(_0x559c7b,_0x4119cf){var _0x2c1677=function(_0x5c6d3d){while(--_0x5c6d3d){_0x559c7b['push'](_0x559c7b['shift']());}};_0x2c1677(++_0x4119cf);}(_0x564d,0x66));var _0xd564=function(_0x12e306,_0x2f0806){_0x12e306=_0x12e306-0x0;var _0x4c8b1e=_0x564d[_0x12e306];return _0x4c8b1e;};'use strict';var _=require('lodash');var util=require(_0xd564('0x0'));var logger=require(_0xd564('0x1'))('api');var moment=require(_0xd564('0x2'));var BPromise=require(_0xd564('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd564('0x4'));var rimraf=require('rimraf');var config=require(_0xd564('0x5'));var attributes=require(_0xd564('0x6'));module[_0xd564('0x7')]=function(_0x15592f,_0x460fb3){return _0x15592f[_0xd564('0x8')](_0xd564('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 410d810..34af640 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 _0x3d5d=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x26e3c1,_0x4b5c43){var _0x4a8f4d=function(_0x503739){while(--_0x503739){_0x26e3c1['push'](_0x26e3c1['shift']());}};_0x4a8f4d(++_0x4b5c43);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x3d5d[_0x1f71d8];return _0x10b045;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var moment=require(_0xd3d5('0x1'));var BPromise=require(_0xd3d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d5('0x3'))['db'];var utils=require(_0xd3d5('0x4'));var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a449d,_0x155a2e,_0x40ae47){return new BPromise(function(_0x2b4892,_0x9e67b4){return client['request'](_0x1a449d,_0x40ae47)[_0xd3d5('0xa')](function(_0x48c5fd){logger[_0xd3d5('0xb')](_0xd3d5('0xc'),_0x155a2e,'request\x20sent');logger[_0xd3d5('0xd')](_0xd3d5('0xe'),_0x155a2e,'request\x20sent',JSON[_0xd3d5('0xf')](_0x48c5fd));if(_0x48c5fd[_0xd3d5('0x10')]){if(_0x48c5fd[_0xd3d5('0x10')]['code']===0x1f4){logger['error'](_0xd3d5('0xc'),_0x155a2e,_0x48c5fd[_0xd3d5('0x10')]['message']);return _0x9e67b4(_0x48c5fd[_0xd3d5('0x10')]['message']);}logger[_0xd3d5('0x10')](_0xd3d5('0xc'),_0x155a2e,_0x48c5fd[_0xd3d5('0x10')]['message']);return _0x2b4892(_0x48c5fd['error'][_0xd3d5('0x11')]);}else{logger[_0xd3d5('0xb')]('VoiceContext,\x20%s,\x20%s',_0x155a2e,_0xd3d5('0x12'));_0x2b4892(_0x48c5fd['result'][_0xd3d5('0x11')]);}})[_0xd3d5('0x13')](function(_0x2bb7b9){logger['error'](_0xd3d5('0xc'),_0x155a2e,_0x2bb7b9);_0x9e67b4(_0x2bb7b9);});});} \ No newline at end of file +var _0x7497=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird'];(function(_0x57c0d9,_0x348735){var _0x5bbde9=function(_0x153e7b){while(--_0x153e7b){_0x57c0d9['push'](_0x57c0d9['shift']());}};_0x5bbde9(++_0x348735);}(_0x7497,0x13c));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var moment=require(_0x7749('0x2'));var BPromise=require(_0x7749('0x3'));var rs=require(_0x7749('0x4'));var fs=require('fs');var Redis=require(_0x7749('0x5'));var db=require(_0x7749('0x6'))['db'];var utils=require(_0x7749('0x7'));var logger=require(_0x7749('0x8'))(_0x7749('0x9'));var config=require(_0x7749('0xa'));var jayson=require(_0x7749('0xb'));var client=jayson[_0x7749('0xc')][_0x7749('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xef965f,_0x5882e7,_0x544812){return new BPromise(function(_0x2a6ae8,_0x1bd19b){return client['request'](_0xef965f,_0x544812)['then'](function(_0x3e20c9){logger[_0x7749('0xe')](_0x7749('0xf'),_0x5882e7,_0x7749('0x10'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5882e7,_0x7749('0x10'),JSON['stringify'](_0x3e20c9));if(_0x3e20c9[_0x7749('0x11')]){if(_0x3e20c9['error']['code']===0x1f4){logger[_0x7749('0x11')](_0x7749('0xf'),_0x5882e7,_0x3e20c9[_0x7749('0x11')]['message']);return _0x1bd19b(_0x3e20c9['error'][_0x7749('0x12')]);}logger[_0x7749('0x11')](_0x7749('0xf'),_0x5882e7,_0x3e20c9[_0x7749('0x11')][_0x7749('0x12')]);return _0x2a6ae8(_0x3e20c9['error'][_0x7749('0x12')]);}else{logger[_0x7749('0xe')](_0x7749('0xf'),_0x5882e7,_0x7749('0x10'));_0x2a6ae8(_0x3e20c9['result'][_0x7749('0x12')]);}})[_0x7749('0x13')](function(_0x23da49){logger[_0x7749('0x11')]('VoiceContext,\x20%s,\x20%s',_0x5882e7,_0x23da49);_0x1bd19b(_0x23da49);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 82b9f71..5207e72 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 _0x92e9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0x92e9,0x104));var _0x992e=function(_0x27227c,_0x44d5f9){_0x27227c=_0x27227c-0x0;var _0x52baab=_0x92e9[_0x27227c];return _0x52baab;};'use strict';var multer=require(_0x992e('0x0'));var util=require(_0x992e('0x1'));var path=require(_0x992e('0x2'));var timeout=require(_0x992e('0x3'));var express=require('express');var router=express[_0x992e('0x4')]();var fs_extra=require(_0x992e('0x5'));var auth=require(_0x992e('0x6'));var interaction=require(_0x992e('0x7'));var config=require(_0x992e('0x8'));var controller=require(_0x992e('0x9'));router[_0x992e('0xa')]('/',auth[_0x992e('0xb')](),controller['index']);router[_0x992e('0xa')](_0x992e('0xc'),auth['isAuthenticated'](),controller[_0x992e('0xd')]);router[_0x992e('0xa')]('/:id',auth[_0x992e('0xb')](),controller[_0x992e('0xe')]);router[_0x992e('0xf')]('/',auth['isAuthenticated'](),controller[_0x992e('0x10')]);router[_0x992e('0x11')](_0x992e('0x12'),auth[_0x992e('0xb')](),controller[_0x992e('0x13')]);router['delete'](_0x992e('0x12'),auth['isAuthenticated'](),controller[_0x992e('0x14')]);module[_0x992e('0x15')]=router; \ No newline at end of file +var _0xd899=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','describe','/:id','post','create','put'];(function(_0x54f01a,_0x12e01c){var _0x4787f1=function(_0x89ae1b){while(--_0x89ae1b){_0x54f01a['push'](_0x54f01a['shift']());}};_0x4787f1(++_0x12e01c);}(_0xd899,0x1b3));var _0x9d89=function(_0x2fedad,_0xb91393){_0x2fedad=_0x2fedad-0x0;var _0x2d9a06=_0xd899[_0x2fedad];return _0x2d9a06;};'use strict';var multer=require(_0x9d89('0x0'));var util=require(_0x9d89('0x1'));var path=require('path');var timeout=require(_0x9d89('0x2'));var express=require('express');var router=express[_0x9d89('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9d89('0x4'));var interaction=require(_0x9d89('0x5'));var config=require(_0x9d89('0x6'));var controller=require(_0x9d89('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9d89('0x8')]('/describe',auth[_0x9d89('0x9')](),controller[_0x9d89('0xa')]);router['get'](_0x9d89('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9d89('0xc')]('/',auth[_0x9d89('0x9')](),controller[_0x9d89('0xd')]);router[_0x9d89('0xe')](_0x9d89('0xb'),auth[_0x9d89('0x9')](),controller[_0x9d89('0xf')]);router[_0x9d89('0x10')](_0x9d89('0xb'),auth['isAuthenticated'](),controller[_0x9d89('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index b78944c..11687f8 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 _0x4b84=['INTEGER','STRING','DATE','called,connect,complete','sequelize','exports'];(function(_0x2ea3c3,_0x13e26b){var _0x15ea17=function(_0x3a1ce7){while(--_0x3a1ce7){_0x2ea3c3['push'](_0x2ea3c3['shift']());}};_0x15ea17(++_0x13e26b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x4b84[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x44b8('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinename':{'type':Sequelize[_0x44b8('0x3')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x44b8('0x3')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x44b8('0x3')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x44b8('0x3')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x44b8('0x3')]},'destcalleridname':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x44b8('0x3')]},'destaccountcode':{'type':Sequelize[_0x44b8('0x3')]},'destcontext':{'type':Sequelize[_0x44b8('0x3')]},'destexten':{'type':Sequelize[_0x44b8('0x3')]},'destpriority':{'type':Sequelize[_0x44b8('0x2')]},'destuniqueid':{'type':Sequelize[_0x44b8('0x3')]},'destlinkedid':{'type':Sequelize[_0x44b8('0x3')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x44b8('0x3')]},'starttime':{'type':Sequelize[_0x44b8('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x44b8('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x44b8('0x5')},'routeId':{'type':Sequelize[_0x44b8('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x44b8('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x58eae1,_0x8b501c){var _0x1722ae=function(_0x55f5cf){while(--_0x55f5cf){_0x58eae1['push'](_0x58eae1['shift']());}};_0x1722ae(++_0x8b501c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6f5a73,_0x2ec184){_0x6f5a73=_0x6f5a73-0x0;var _0x517173=_0x8d0e[_0x6f5a73];return _0x517173;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f1757cf..158de95 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 _0x9b36=['attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','fields','options','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x1a100d,_0x42be1f){var _0x117998=function(_0x3b406d){while(--_0x3b406d){_0x1a100d['push'](_0x1a100d['shift']());}};_0x117998(++_0x42be1f);}(_0x9b36,0xac));var _0x69b3=function(_0x64d1fc,_0x218513){_0x64d1fc=_0x64d1fc-0x0;var _0x270ebc=_0x9b36[_0x64d1fc];return _0x270ebc;};'use strict';var emlformat=require(_0x69b3('0x0'));var rimraf=require(_0x69b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69b3('0x2'));var moment=require(_0x69b3('0x3'));var BPromise=require(_0x69b3('0x4'));var Mustache=require('mustache');var util=require(_0x69b3('0x5'));var path=require(_0x69b3('0x6'));var sox=require(_0x69b3('0x7'));var csv=require(_0x69b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69b3('0x9'));var _=require('lodash');var squel=require(_0x69b3('0xa'));var crypto=require('crypto');var jsforce=require(_0x69b3('0xb'));var deskjs=require(_0x69b3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x69b3('0xd'));var Papa=require(_0x69b3('0xe'));var Redis=require(_0x69b3('0xf'));var authService=require(_0x69b3('0x10'));var qs=require(_0x69b3('0x11'));var as=require(_0x69b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69b3('0x13'))(_0x69b3('0x14'));var utils=require(_0x69b3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x69b3('0x16'));var db=require(_0x69b3('0x17'))['db'];function respondWithStatusCode(_0xb3276e,_0x4762b9){_0x4762b9=_0x4762b9||0xcc;return function(_0x26cb67){if(_0x26cb67){return _0xb3276e[_0x69b3('0x18')](_0x4762b9);}return _0xb3276e[_0x69b3('0x19')](_0x4762b9)[_0x69b3('0x1a')]();};}function respondWithResult(_0x5c6d55,_0x54b4b7){_0x54b4b7=_0x54b4b7||0xc8;return function(_0xbf4fb1){if(_0xbf4fb1){return _0x5c6d55['status'](_0x54b4b7)[_0x69b3('0x1b')](_0xbf4fb1);}};}function respondWithFilteredResult(_0x3b6e0c,_0x1b5365){return function(_0x308e54){if(_0x308e54){var _0x52fcea=typeof _0x1b5365['offset']===_0x69b3('0x1c')&&typeof _0x1b5365[_0x69b3('0x1d')]===_0x69b3('0x1c');var _0x355abc=_0x308e54[_0x69b3('0x1e')];var _0x2ee261=_0x52fcea?0x0:_0x1b5365[_0x69b3('0x1f')];var _0x4e1a70=_0x52fcea?_0x308e54[_0x69b3('0x1e')]:_0x1b5365['offset']+_0x1b5365[_0x69b3('0x1d')];var _0xe3a7b8;if(_0x4e1a70>=_0x355abc){_0x4e1a70=_0x355abc;_0xe3a7b8=0xc8;}else{_0xe3a7b8=0xce;}_0x3b6e0c[_0x69b3('0x19')](_0xe3a7b8);return _0x3b6e0c['set'](_0x69b3('0x20'),_0x2ee261+'-'+_0x4e1a70+'/'+_0x355abc)[_0x69b3('0x1b')](_0x308e54);}return null;};}function patchUpdates(_0x4a7bbe){return function(_0x3717a5){try{jsonpatch[_0x69b3('0x21')](_0x3717a5,_0x4a7bbe,!![]);}catch(_0x30456a){return BPromise[_0x69b3('0x22')](_0x30456a);}return _0x3717a5[_0x69b3('0x23')]();};}function saveUpdates(_0x66043e,_0x1e62ed){return function(_0x203993){if(_0x203993){return _0x203993['update'](_0x66043e)[_0x69b3('0x24')](function(_0x273b96){return _0x273b96;});}return null;};}function removeEntity(_0x430762,_0x2d3cae){return function(_0x3a1f1a){if(_0x3a1f1a){return _0x3a1f1a['destroy']()['then'](function(){_0x430762[_0x69b3('0x19')](0xcc)[_0x69b3('0x1a')]();});}};}function handleEntityNotFound(_0x1e60d6,_0x2cd0f1){return function(_0x371f27){if(!_0x371f27){_0x1e60d6['sendStatus'](0x194);}return _0x371f27;};}function handleError(_0x48c6b2,_0x52cecb){_0x52cecb=_0x52cecb||0x1f4;return function(_0xc1739){logger[_0x69b3('0x25')](_0xc1739['stack']);if(_0xc1739[_0x69b3('0x26')]){delete _0xc1739[_0x69b3('0x26')];}_0x48c6b2[_0x69b3('0x19')](_0x52cecb)[_0x69b3('0x27')](_0xc1739);};}exports[_0x69b3('0x28')]=function(_0x3af894,_0x5b7316){var _0x3ee01e={},_0x15b263={},_0x4f78e6={'count':0x0,'rows':[]};var _0x7df094=_[_0x69b3('0x29')](db[_0x69b3('0x2a')][_0x69b3('0x2b')],function(_0x7a354c){return{'name':_0x7a354c[_0x69b3('0x2c')],'type':_0x7a354c['type'][_0x69b3('0x2d')]};});_0x15b263[_0x69b3('0x2e')]=_['map'](_0x7df094,_0x69b3('0x26'));_0x15b263[_0x69b3('0x2f')]=_['keys'](_0x3af894[_0x69b3('0x2f')]);_0x15b263[_0x69b3('0x30')]=_[_0x69b3('0x31')](_0x15b263[_0x69b3('0x2e')],_0x15b263[_0x69b3('0x2f')]);_0x3ee01e[_0x69b3('0x32')]=_[_0x69b3('0x31')](_0x15b263['model'],qs['fields'](_0x3af894['query']['fields']));_0x3ee01e['attributes']=_0x3ee01e[_0x69b3('0x32')][_0x69b3('0x33')]?_0x3ee01e[_0x69b3('0x32')]:_0x15b263[_0x69b3('0x2e')];if(!_0x3af894[_0x69b3('0x2f')]['hasOwnProperty'](_0x69b3('0x34'))){_0x3ee01e['limit']=qs[_0x69b3('0x1d')](_0x3af894[_0x69b3('0x2f')]['limit']);_0x3ee01e['offset']=qs[_0x69b3('0x1f')](_0x3af894[_0x69b3('0x2f')][_0x69b3('0x1f')]);}_0x3ee01e[_0x69b3('0x35')]=qs[_0x69b3('0x36')](_0x3af894[_0x69b3('0x2f')][_0x69b3('0x36')]);_0x3ee01e[_0x69b3('0x37')]=qs[_0x69b3('0x30')](_[_0x69b3('0x38')](_0x3af894[_0x69b3('0x2f')],_0x15b263['filters']),_0x7df094);if(_0x3af894['query'][_0x69b3('0x39')]){_0x3ee01e['where']=_[_0x69b3('0x3a')](_0x3ee01e[_0x69b3('0x37')],{'$or':_[_0x69b3('0x29')](_0x7df094,function(_0xa627d5){if(_0xa627d5[_0x69b3('0x3b')]!==_0x69b3('0x3c')){var _0x2a3e85={};_0x2a3e85[_0xa627d5[_0x69b3('0x26')]]={'$like':'%'+_0x3af894[_0x69b3('0x2f')][_0x69b3('0x39')]+'%'};return _0x2a3e85;}})});}_0x3ee01e=_[_0x69b3('0x3a')]({},_0x3ee01e,_0x3af894['options']);var _0x53c381={'where':_0x3ee01e[_0x69b3('0x37')]};return db[_0x69b3('0x2a')][_0x69b3('0x1e')](_0x53c381)['then'](function(_0x16581c){_0x4f78e6['count']=_0x16581c;if(_0x3af894[_0x69b3('0x2f')][_0x69b3('0x3d')]){_0x3ee01e[_0x69b3('0x3e')]=[{'all':!![]}];}return db[_0x69b3('0x2a')][_0x69b3('0x3f')](_0x3ee01e);})[_0x69b3('0x24')](function(_0x599432){_0x4f78e6[_0x69b3('0x40')]=_0x599432;return _0x4f78e6;})[_0x69b3('0x24')](respondWithFilteredResult(_0x5b7316,_0x3ee01e))[_0x69b3('0x41')](handleError(_0x5b7316,null));};exports['show']=function(_0x80fa22,_0x147c74){var _0x4974b6={'raw':!![],'where':{'id':_0x80fa22[_0x69b3('0x42')]['id']}},_0x42a80f={};_0x42a80f[_0x69b3('0x2e')]=_['keys'](db[_0x69b3('0x2a')][_0x69b3('0x2b')]);_0x42a80f[_0x69b3('0x2f')]=_['keys'](_0x80fa22[_0x69b3('0x2f')]);_0x42a80f[_0x69b3('0x30')]=_['intersection'](_0x42a80f['model'],_0x42a80f[_0x69b3('0x2f')]);_0x4974b6['attributes']=_[_0x69b3('0x31')](_0x42a80f['model'],qs[_0x69b3('0x43')](_0x80fa22[_0x69b3('0x2f')][_0x69b3('0x43')]));_0x4974b6[_0x69b3('0x32')]=_0x4974b6[_0x69b3('0x32')]['length']?_0x4974b6[_0x69b3('0x32')]:_0x42a80f['model'];if(_0x80fa22[_0x69b3('0x2f')][_0x69b3('0x3d')]){_0x4974b6[_0x69b3('0x3e')]=[{'all':!![]}];}_0x4974b6=_[_0x69b3('0x3a')]({},_0x4974b6,_0x80fa22[_0x69b3('0x44')]);return db[_0x69b3('0x2a')][_0x69b3('0x45')](_0x4974b6)[_0x69b3('0x24')](handleEntityNotFound(_0x147c74,null))[_0x69b3('0x24')](respondWithResult(_0x147c74,null))[_0x69b3('0x41')](handleError(_0x147c74,null));};exports['create']=function(_0x53b3e6,_0x379719){return db[_0x69b3('0x2a')][_0x69b3('0x46')](_0x53b3e6['body'],{})[_0x69b3('0x24')](respondWithResult(_0x379719,0xc9))[_0x69b3('0x41')](handleError(_0x379719,null));};exports['update']=function(_0x3cacc2,_0x2361e5){if(_0x3cacc2[_0x69b3('0x47')]['id']){delete _0x3cacc2[_0x69b3('0x47')]['id'];}return db[_0x69b3('0x2a')][_0x69b3('0x45')]({'where':{'id':_0x3cacc2['params']['id']}})['then'](handleEntityNotFound(_0x2361e5,null))[_0x69b3('0x24')](saveUpdates(_0x3cacc2[_0x69b3('0x47')],null))['then'](respondWithResult(_0x2361e5,null))['catch'](handleError(_0x2361e5,null));};exports[_0x69b3('0x48')]=function(_0x1e344a,_0x126dd2){return db[_0x69b3('0x2a')][_0x69b3('0x45')]({'where':{'id':_0x1e344a[_0x69b3('0x42')]['id']}})[_0x69b3('0x24')](handleEntityNotFound(_0x126dd2,null))[_0x69b3('0x24')](removeEntity(_0x126dd2,null))[_0x69b3('0x41')](handleError(_0x126dd2,null));};exports[_0x69b3('0x49')]=function(_0x3361aa,_0x27d33e){return db[_0x69b3('0x2a')][_0x69b3('0x49')]()['then'](respondWithResult(_0x27d33e,null))[_0x69b3('0x41')](handleError(_0x27d33e,null));}; \ No newline at end of file +var _0x0195=['api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','count','offset','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x23833f,_0x46191f){var _0x231f17=function(_0x5df010){while(--_0x5df010){_0x23833f['push'](_0x23833f['shift']());}};_0x231f17(++_0x46191f);}(_0x0195,0xd4));var _0x5019=function(_0x2e761a,_0x5ca762){_0x2e761a=_0x2e761a-0x0;var _0x11bdc1=_0x0195[_0x2e761a];return _0x11bdc1;};'use strict';var emlformat=require(_0x5019('0x0'));var rimraf=require(_0x5019('0x1'));var zipdir=require(_0x5019('0x2'));var jsonpatch=require(_0x5019('0x3'));var rp=require(_0x5019('0x4'));var moment=require(_0x5019('0x5'));var BPromise=require(_0x5019('0x6'));var Mustache=require(_0x5019('0x7'));var util=require(_0x5019('0x8'));var path=require(_0x5019('0x9'));var sox=require(_0x5019('0xa'));var csv=require(_0x5019('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5019('0xc'));var _=require('lodash');var squel=require(_0x5019('0xd'));var crypto=require(_0x5019('0xe'));var jsforce=require(_0x5019('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5019('0x10'));var Papa=require(_0x5019('0x11'));var Redis=require(_0x5019('0x12'));var authService=require(_0x5019('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5019('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5019('0x15'))(_0x5019('0x16'));var utils=require(_0x5019('0x17'));var config=require(_0x5019('0x18'));var licenseUtil=require(_0x5019('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1037db,_0x68d7c8){_0x68d7c8=_0x68d7c8||0xcc;return function(_0x5c4ad8){if(_0x5c4ad8){return _0x1037db['sendStatus'](_0x68d7c8);}return _0x1037db[_0x5019('0x1a')](_0x68d7c8)['end']();};}function respondWithResult(_0x43776a,_0x17d57a){_0x17d57a=_0x17d57a||0xc8;return function(_0x1012e6){if(_0x1012e6){return _0x43776a[_0x5019('0x1a')](_0x17d57a)[_0x5019('0x1b')](_0x1012e6);}};}function respondWithFilteredResult(_0x571521,_0x5ed537){return function(_0x1407dd){if(_0x1407dd){var _0x2fe2f7=typeof _0x5ed537['offset']===_0x5019('0x1c')&&typeof _0x5ed537['limit']===_0x5019('0x1c');var _0x5058d7=_0x1407dd[_0x5019('0x1d')];var _0xcd5e20=_0x2fe2f7?0x0:_0x5ed537[_0x5019('0x1e')];var _0xbbe5d3=_0x2fe2f7?_0x1407dd[_0x5019('0x1d')]:_0x5ed537['offset']+_0x5ed537['limit'];var _0x1fc2e2;if(_0xbbe5d3>=_0x5058d7){_0xbbe5d3=_0x5058d7;_0x1fc2e2=0xc8;}else{_0x1fc2e2=0xce;}_0x571521[_0x5019('0x1a')](_0x1fc2e2);return _0x571521['set'](_0x5019('0x1f'),_0xcd5e20+'-'+_0xbbe5d3+'/'+_0x5058d7)['json'](_0x1407dd);}return null;};}function patchUpdates(_0x53008d){return function(_0x4039a9){try{jsonpatch['apply'](_0x4039a9,_0x53008d,!![]);}catch(_0x43114d){return BPromise[_0x5019('0x20')](_0x43114d);}return _0x4039a9[_0x5019('0x21')]();};}function saveUpdates(_0x1196d6,_0x45c39c){return function(_0x4cf4b1){if(_0x4cf4b1){return _0x4cf4b1[_0x5019('0x22')](_0x1196d6)['then'](function(_0x3a4833){return _0x3a4833;});}return null;};}function removeEntity(_0x33cf31,_0x51ca08){return function(_0x1821d0){if(_0x1821d0){return _0x1821d0[_0x5019('0x23')]()[_0x5019('0x24')](function(){_0x33cf31[_0x5019('0x1a')](0xcc)[_0x5019('0x25')]();});}};}function handleEntityNotFound(_0x2960b1,_0x935ccb){return function(_0x4a6d85){if(!_0x4a6d85){_0x2960b1[_0x5019('0x26')](0x194);}return _0x4a6d85;};}function handleError(_0x515ef7,_0x32a9ad){_0x32a9ad=_0x32a9ad||0x1f4;return function(_0x47fb15){logger[_0x5019('0x27')](_0x47fb15[_0x5019('0x28')]);if(_0x47fb15[_0x5019('0x29')]){delete _0x47fb15[_0x5019('0x29')];}_0x515ef7[_0x5019('0x1a')](_0x32a9ad)[_0x5019('0x2a')](_0x47fb15);};}exports[_0x5019('0x2b')]=function(_0x4d6f31,_0x2cc40a){var _0x3d7d6f={},_0x435a79={},_0x434276={'count':0x0,'rows':[]};var _0xcb6279=_[_0x5019('0x2c')](db[_0x5019('0x2d')][_0x5019('0x2e')],function(_0x1842ea){return{'name':_0x1842ea[_0x5019('0x2f')],'type':_0x1842ea[_0x5019('0x30')][_0x5019('0x31')]};});_0x435a79[_0x5019('0x32')]=_[_0x5019('0x2c')](_0xcb6279,_0x5019('0x29'));_0x435a79[_0x5019('0x33')]=_[_0x5019('0x34')](_0x4d6f31[_0x5019('0x33')]);_0x435a79[_0x5019('0x35')]=_['intersection'](_0x435a79[_0x5019('0x32')],_0x435a79['query']);_0x3d7d6f[_0x5019('0x36')]=_[_0x5019('0x37')](_0x435a79['model'],qs[_0x5019('0x38')](_0x4d6f31[_0x5019('0x33')][_0x5019('0x38')]));_0x3d7d6f[_0x5019('0x36')]=_0x3d7d6f['attributes'][_0x5019('0x39')]?_0x3d7d6f[_0x5019('0x36')]:_0x435a79['model'];if(!_0x4d6f31['query'][_0x5019('0x3a')](_0x5019('0x3b'))){_0x3d7d6f[_0x5019('0x3c')]=qs[_0x5019('0x3c')](_0x4d6f31[_0x5019('0x33')]['limit']);_0x3d7d6f[_0x5019('0x1e')]=qs[_0x5019('0x1e')](_0x4d6f31['query'][_0x5019('0x1e')]);}_0x3d7d6f[_0x5019('0x3d')]=qs[_0x5019('0x3e')](_0x4d6f31['query'][_0x5019('0x3e')]);_0x3d7d6f[_0x5019('0x3f')]=qs[_0x5019('0x35')](_[_0x5019('0x40')](_0x4d6f31[_0x5019('0x33')],_0x435a79[_0x5019('0x35')]),_0xcb6279);if(_0x4d6f31[_0x5019('0x33')]['filter']){_0x3d7d6f['where']=_[_0x5019('0x41')](_0x3d7d6f[_0x5019('0x3f')],{'$or':_['map'](_0xcb6279,function(_0x3de4be){if(_0x3de4be[_0x5019('0x30')]!=='VIRTUAL'){var _0x4781e1={};_0x4781e1[_0x3de4be[_0x5019('0x29')]]={'$like':'%'+_0x4d6f31[_0x5019('0x33')][_0x5019('0x42')]+'%'};return _0x4781e1;}})});}_0x3d7d6f=_[_0x5019('0x41')]({},_0x3d7d6f,_0x4d6f31[_0x5019('0x43')]);var _0x4abeca={'where':_0x3d7d6f['where']};return db[_0x5019('0x2d')]['count'](_0x4abeca)[_0x5019('0x24')](function(_0x14f534){_0x434276[_0x5019('0x1d')]=_0x14f534;if(_0x4d6f31[_0x5019('0x33')][_0x5019('0x44')]){_0x3d7d6f['include']=[{'all':!![]}];}return db[_0x5019('0x2d')][_0x5019('0x45')](_0x3d7d6f);})['then'](function(_0x42422e){_0x434276[_0x5019('0x46')]=_0x42422e;return _0x434276;})[_0x5019('0x24')](respondWithFilteredResult(_0x2cc40a,_0x3d7d6f))[_0x5019('0x47')](handleError(_0x2cc40a,null));};exports[_0x5019('0x48')]=function(_0xc82013,_0x44f732){var _0x584d81={'raw':!![],'where':{'id':_0xc82013['params']['id']}},_0x5307a7={};_0x5307a7[_0x5019('0x32')]=_[_0x5019('0x34')](db[_0x5019('0x2d')][_0x5019('0x2e')]);_0x5307a7[_0x5019('0x33')]=_['keys'](_0xc82013[_0x5019('0x33')]);_0x5307a7[_0x5019('0x35')]=_[_0x5019('0x37')](_0x5307a7['model'],_0x5307a7['query']);_0x584d81['attributes']=_[_0x5019('0x37')](_0x5307a7[_0x5019('0x32')],qs[_0x5019('0x38')](_0xc82013['query'][_0x5019('0x38')]));_0x584d81[_0x5019('0x36')]=_0x584d81[_0x5019('0x36')][_0x5019('0x39')]?_0x584d81['attributes']:_0x5307a7[_0x5019('0x32')];if(_0xc82013['query'][_0x5019('0x44')]){_0x584d81['include']=[{'all':!![]}];}_0x584d81=_[_0x5019('0x41')]({},_0x584d81,_0xc82013[_0x5019('0x43')]);return db['VoiceDialReport'][_0x5019('0x49')](_0x584d81)[_0x5019('0x24')](handleEntityNotFound(_0x44f732,null))[_0x5019('0x24')](respondWithResult(_0x44f732,null))['catch'](handleError(_0x44f732,null));};exports[_0x5019('0x4a')]=function(_0x326b94,_0x44ebc9){return db[_0x5019('0x2d')][_0x5019('0x4a')](_0x326b94['body'],{})[_0x5019('0x24')](respondWithResult(_0x44ebc9,0xc9))['catch'](handleError(_0x44ebc9,null));};exports[_0x5019('0x22')]=function(_0xed3eef,_0x55ff82){if(_0xed3eef['body']['id']){delete _0xed3eef[_0x5019('0x4b')]['id'];}return db[_0x5019('0x2d')][_0x5019('0x49')]({'where':{'id':_0xed3eef['params']['id']}})[_0x5019('0x24')](handleEntityNotFound(_0x55ff82,null))[_0x5019('0x24')](saveUpdates(_0xed3eef[_0x5019('0x4b')],null))[_0x5019('0x24')](respondWithResult(_0x55ff82,null))[_0x5019('0x47')](handleError(_0x55ff82,null));};exports['destroy']=function(_0x1504f6,_0x517097){return db['VoiceDialReport'][_0x5019('0x49')]({'where':{'id':_0x1504f6[_0x5019('0x4c')]['id']}})[_0x5019('0x24')](handleEntityNotFound(_0x517097,null))['then'](removeEntity(_0x517097,null))['catch'](handleError(_0x517097,null));};exports[_0x5019('0x4d')]=function(_0x3047b1,_0x365f04){return db[_0x5019('0x2d')][_0x5019('0x4d')]()[_0x5019('0x24')](respondWithResult(_0x365f04,null))[_0x5019('0x47')](handleError(_0x365f04,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 7523597..9a95afe 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 _0x2551=['VoiceDialReport','report_dial','uniqueid','lodash','util','api','bluebird','path','rimraf','./voiceDialReport.attributes','exports'];(function(_0x30060f,_0x364743){var _0x69db02=function(_0x5d0e8a){while(--_0x5d0e8a){_0x30060f['push'](_0x30060f['shift']());}};_0x69db02(++_0x364743);}(_0x2551,0x9d));var _0x1255=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x2551[_0x3124f8];return _0x5bab5f;};'use strict';var _=require(_0x1255('0x0'));var util=require(_0x1255('0x1'));var logger=require('../../config/logger')(_0x1255('0x2'));var moment=require('moment');var BPromise=require(_0x1255('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1255('0x4'));var rimraf=require(_0x1255('0x5'));var config=require('../../config/environment');var attributes=require(_0x1255('0x6'));module[_0x1255('0x7')]=function(_0x175ea5,_0x352934){return _0x175ea5['define'](_0x1255('0x8'),attributes,{'tableName':_0x1255('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1255('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5109=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport'];(function(_0x97abb1,_0x448866){var _0x375d57=function(_0x391f8f){while(--_0x391f8f){_0x97abb1['push'](_0x97abb1['shift']());}};_0x375d57(++_0x448866);}(_0x5109,0xb8));var _0x9510=function(_0x2892f8,_0x16077b){_0x2892f8=_0x2892f8-0x0;var _0x1a3fa9=_0x5109[_0x2892f8];return _0x1a3fa9;};'use strict';var _=require(_0x9510('0x0'));var util=require(_0x9510('0x1'));var logger=require(_0x9510('0x2'))(_0x9510('0x3'));var moment=require(_0x9510('0x4'));var BPromise=require('bluebird');var rp=require(_0x9510('0x5'));var fs=require('fs');var path=require(_0x9510('0x6'));var rimraf=require(_0x9510('0x7'));var config=require(_0x9510('0x8'));var attributes=require(_0x9510('0x9'));module[_0x9510('0xa')]=function(_0x240d1a,_0x156535){return _0x240d1a['define'](_0x9510('0xb'),attributes,{'tableName':_0x9510('0xc'),'paranoid':![],'indexes':[{'fields':[_0x9510('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2764f4b..680a34f 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 _0x94a5=['code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','then','body','attributes','limit','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x205e5b,_0x3d9293){var _0x2e60db=function(_0x2e2620){while(--_0x2e2620){_0x205e5b['push'](_0x205e5b['shift']());}};_0x2e60db(++_0x3d9293);}(_0x94a5,0x1ef));var _0x594a=function(_0x9a3c82,_0x39b592){_0x9a3c82=_0x9a3c82-0x0;var _0x52a746=_0x94a5[_0x9a3c82];return _0x52a746;};'use strict';var _=require(_0x594a('0x0'));var util=require(_0x594a('0x1'));var moment=require('moment');var BPromise=require(_0x594a('0x2'));var rs=require(_0x594a('0x3'));var fs=require('fs');var Redis=require(_0x594a('0x4'));var db=require(_0x594a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x594a('0x6'));var config=require(_0x594a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x594a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f450,_0x3e7410,_0x3bde48){return new BPromise(function(_0x314c89,_0x2433c0){return client[_0x594a('0x9')](_0x35f450,_0x3bde48)['then'](function(_0xc6009c){logger['info'](_0x594a('0xa'),_0x3e7410,_0x594a('0xb'));logger[_0x594a('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3e7410,_0x594a('0xb'),JSON[_0x594a('0xd')](_0xc6009c));if(_0xc6009c[_0x594a('0xe')]){if(_0xc6009c[_0x594a('0xe')][_0x594a('0xf')]===0x1f4){logger['error'](_0x594a('0xa'),_0x3e7410,_0xc6009c[_0x594a('0xe')][_0x594a('0x10')]);return _0x2433c0(_0xc6009c['error'][_0x594a('0x10')]);}logger[_0x594a('0xe')](_0x594a('0xa'),_0x3e7410,_0xc6009c[_0x594a('0xe')][_0x594a('0x10')]);return _0x314c89(_0xc6009c[_0x594a('0xe')][_0x594a('0x10')]);}else{logger[_0x594a('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x3e7410,'request\x20sent');_0x314c89(_0xc6009c[_0x594a('0x12')]['message']);}})[_0x594a('0x13')](function(_0x3766ea){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x3e7410,_0x3766ea);_0x2433c0(_0x3766ea);});});}exports[_0x594a('0x14')]=function(_0x2a591e){var _0x5d9d67=this;return new Promise(function(_0x45a23c,_0x506a3f){return db[_0x594a('0x15')][_0x594a('0x16')](_0x2a591e['body'],{'raw':_0x2a591e[_0x594a('0x17')]?_0x2a591e['options'][_0x594a('0x18')]===undefined?!![]:![]:!![]})[_0x594a('0x19')](function(_0x48411a){logger[_0x594a('0x11')](_0x594a('0x14'),_0x2a591e);logger['debug'](_0x594a('0x14'),_0x2a591e,JSON[_0x594a('0xd')](_0x48411a));_0x45a23c(_0x48411a);})[_0x594a('0x13')](function(_0x59b4db){logger[_0x594a('0xe')](_0x594a('0x14'),_0x59b4db['message'],_0x2a591e);_0x506a3f(_0x5d9d67[_0x594a('0xe')](0x1f4,_0x59b4db[_0x594a('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x448f00){var _0x46f3f1=this;return new Promise(function(_0x40436b,_0x1819d0){return db['VoiceDialReport']['update'](_0x448f00[_0x594a('0x1a')],{'raw':_0x448f00[_0x594a('0x17')]?_0x448f00[_0x594a('0x17')][_0x594a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x448f00[_0x594a('0x17')]?_0x448f00[_0x594a('0x17')]['where']||null:null,'attributes':_0x448f00[_0x594a('0x17')]?_0x448f00[_0x594a('0x17')][_0x594a('0x1b')]||null:null,'limit':_0x448f00[_0x594a('0x17')]?_0x448f00[_0x594a('0x17')][_0x594a('0x1c')]||null:null})[_0x594a('0x19')](function(_0x413e23){logger[_0x594a('0x11')](_0x594a('0x1d'),_0x448f00);logger[_0x594a('0xc')](_0x594a('0x1d'),_0x448f00,JSON[_0x594a('0xd')](_0x413e23));_0x40436b(_0x413e23);})[_0x594a('0x13')](function(_0x5a0cf4){logger[_0x594a('0xe')](_0x594a('0x1d'),_0x5a0cf4[_0x594a('0x10')],_0x448f00);_0x1819d0(_0x46f3f1[_0x594a('0xe')](0x1f4,_0x5a0cf4[_0x594a('0x10')]));});});}; \ No newline at end of file +var _0x35bf=['jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','VoiceDialReport','update','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x19ffee,_0x5abed3){var _0x424a76=function(_0x3b33f0){while(--_0x3b33f0){_0x19ffee['push'](_0x19ffee['shift']());}};_0x424a76(++_0x5abed3);}(_0x35bf,0xa2));var _0xf35b=function(_0x103c7c,_0x1b3d9c){_0x103c7c=_0x103c7c-0x0;var _0x2f343f=_0x35bf[_0x103c7c];return _0x2f343f;};'use strict';var _=require(_0xf35b('0x0'));var util=require(_0xf35b('0x1'));var moment=require(_0xf35b('0x2'));var BPromise=require(_0xf35b('0x3'));var rs=require(_0xf35b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf35b('0x5'))(_0xf35b('0x6'));var config=require(_0xf35b('0x7'));var jayson=require(_0xf35b('0x8'));var client=jayson[_0xf35b('0x9')][_0xf35b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f308f,_0x13c6cc,_0x29b48d){return new BPromise(function(_0x3c5c20,_0x365172){return client[_0xf35b('0xb')](_0x2f308f,_0x29b48d)[_0xf35b('0xc')](function(_0x5aa51c){logger[_0xf35b('0xd')](_0xf35b('0xe'),_0x13c6cc,_0xf35b('0xf'));logger['debug'](_0xf35b('0x10'),_0x13c6cc,_0xf35b('0xf'),JSON[_0xf35b('0x11')](_0x5aa51c));if(_0x5aa51c[_0xf35b('0x12')]){if(_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x13')]===0x1f4){logger[_0xf35b('0x12')](_0xf35b('0xe'),_0x13c6cc,_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x14')]);return _0x365172(_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x14')]);}logger[_0xf35b('0x12')](_0xf35b('0xe'),_0x13c6cc,_0x5aa51c[_0xf35b('0x12')][_0xf35b('0x14')]);return _0x3c5c20(_0x5aa51c[_0xf35b('0x12')]['message']);}else{logger[_0xf35b('0xd')](_0xf35b('0xe'),_0x13c6cc,_0xf35b('0xf'));_0x3c5c20(_0x5aa51c[_0xf35b('0x15')][_0xf35b('0x14')]);}})[_0xf35b('0x16')](function(_0x2c4e1d){logger[_0xf35b('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x13c6cc,_0x2c4e1d);_0x365172(_0x2c4e1d);});});}exports[_0xf35b('0x17')]=function(_0x3f33a3){var _0x3d50c1=this;return new Promise(function(_0x2410dd,_0x32250f){return db['VoiceDialReport'][_0xf35b('0x18')](_0x3f33a3[_0xf35b('0x19')],{'raw':_0x3f33a3['options']?_0x3f33a3[_0xf35b('0x1a')][_0xf35b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xa9e711){logger[_0xf35b('0xd')](_0xf35b('0x17'),_0x3f33a3);logger['debug'](_0xf35b('0x17'),_0x3f33a3,JSON[_0xf35b('0x11')](_0xa9e711));_0x2410dd(_0xa9e711);})[_0xf35b('0x16')](function(_0x26f6d9){logger['error'](_0xf35b('0x17'),_0x26f6d9[_0xf35b('0x14')],_0x3f33a3);_0x32250f(_0x3d50c1[_0xf35b('0x12')](0x1f4,_0x26f6d9['message']));});});};exports[_0xf35b('0x1c')]=function(_0x2617bb){var _0x4e3f0a=this;return new Promise(function(_0x4a3a82,_0x3c6155){return db[_0xf35b('0x1d')][_0xf35b('0x1e')](_0x2617bb[_0xf35b('0x19')],{'raw':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb['options'][_0xf35b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb['options']['where']||null:null,'attributes':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb['options'][_0xf35b('0x1f')]||null:null,'limit':_0x2617bb[_0xf35b('0x1a')]?_0x2617bb[_0xf35b('0x1a')][_0xf35b('0x20')]||null:null})[_0xf35b('0xc')](function(_0x1f5cc4){logger[_0xf35b('0xd')](_0xf35b('0x1c'),_0x2617bb);logger[_0xf35b('0x21')](_0xf35b('0x1c'),_0x2617bb,JSON[_0xf35b('0x11')](_0x1f5cc4));_0x4a3a82(_0x1f5cc4);})[_0xf35b('0x16')](function(_0x2fb744){logger[_0xf35b('0x12')](_0xf35b('0x1c'),_0x2fb744['message'],_0x2617bb);_0x3c6155(_0x4e3f0a[_0xf35b('0x12')](0x1f4,_0x2fb744[_0xf35b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 6fbf702..70ffcf4 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 _0xc7f0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','create','/:id/applications','addApplications','put','/:id','update','delete','util','express','Router'];(function(_0x3f2845,_0x3bc9c0){var _0x3221af=function(_0x515d71){while(--_0x515d71){_0x3f2845['push'](_0x3f2845['shift']());}};_0x3221af(++_0x3bc9c0);}(_0xc7f0,0x15d));var _0x0c7f=function(_0x23cf3d,_0x2195b7){_0x23cf3d=_0x23cf3d-0x0;var _0x220fab=_0xc7f0[_0x23cf3d];return _0x220fab;};'use strict';var multer=require('multer');var util=require(_0x0c7f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c7f('0x1'));var router=express[_0x0c7f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0c7f('0x3'));var interaction=require(_0x0c7f('0x4'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x0c7f('0x5')]('/',auth[_0x0c7f('0x6')](),controller[_0x0c7f('0x7')]);router[_0x0c7f('0x5')]('/:id',auth[_0x0c7f('0x6')](),controller[_0x0c7f('0x8')]);router['post']('/',auth[_0x0c7f('0x6')](),controller[_0x0c7f('0x9')]);router['post'](_0x0c7f('0xa'),auth['isAuthenticated'](),controller[_0x0c7f('0xb')]);router[_0x0c7f('0xc')](_0x0c7f('0xd'),auth['isAuthenticated'](),controller[_0x0c7f('0xe')]);router[_0x0c7f('0xf')](_0x0c7f('0xd'),auth[_0x0c7f('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4403=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','exports','multer','util'];(function(_0x2eaa66,_0x2062c0){var _0x3b1dd3=function(_0x2ef28a){while(--_0x2ef28a){_0x2eaa66['push'](_0x2eaa66['shift']());}};_0x3b1dd3(++_0x2062c0);}(_0x4403,0x96));var _0x3440=function(_0x590198,_0x50b486){_0x590198=_0x590198-0x0;var _0x537ded=_0x4403[_0x590198];return _0x537ded;};'use strict';var multer=require(_0x3440('0x0'));var util=require(_0x3440('0x1'));var path=require(_0x3440('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3440('0x3')]();var fs_extra=require(_0x3440('0x4'));var auth=require(_0x3440('0x5'));var interaction=require(_0x3440('0x6'));var config=require(_0x3440('0x7'));var controller=require(_0x3440('0x8'));router[_0x3440('0x9')]('/',auth[_0x3440('0xa')](),controller[_0x3440('0xb')]);router['get'](_0x3440('0xc'),auth['isAuthenticated'](),controller[_0x3440('0xd')]);router[_0x3440('0xe')]('/',auth['isAuthenticated'](),controller[_0x3440('0xf')]);router['post'](_0x3440('0x10'),auth[_0x3440('0xa')](),controller[_0x3440('0x11')]);router['put'](_0x3440('0xc'),auth[_0x3440('0xa')](),controller['update']);router['delete'](_0x3440('0xc'),auth[_0x3440('0xa')](),controller['destroy']);module[_0x3440('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index aa5fac4..fe220de 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 _0x3ebc=['NoOp','ENUM','inbound','outbound','internal','any','BOOLEAN','INTEGER','wav','sequelize','STRING','compositeIndex'];(function(_0x5b74de,_0x1fe768){var _0x6f2fa7=function(_0x3cd954){while(--_0x3cd954){_0x5b74de['push'](_0x5b74de['shift']());}};_0x6f2fa7(++_0x1fe768);}(_0x3ebc,0xf9));var _0xc3eb=function(_0x1b64c8,_0xa622b6){_0x1b64c8=_0x1b64c8-0x0;var _0x3953ec=_0x3ebc[_0x1b64c8];return _0x3953ec;};'use strict';var Sequelize=require(_0xc3eb('0x0'));module['exports']={'context':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':![],'unique':_0xc3eb('0x2')},'priority':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xc3eb('0x2')},'tag':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':![],'defaultValue':_0xc3eb('0x3')},'appdata':{'type':Sequelize[_0xc3eb('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc3eb('0x4')](_0xc3eb('0x5'),_0xc3eb('0x6'),_0xc3eb('0x7'),'inbound-fax','outbound-fax','system',_0xc3eb('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xc3eb('0x1')]},'interval':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xc3eb('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc3eb('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xc3eb('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc3eb('0xa')]},'recordingFormat':{'type':Sequelize[_0xc3eb('0x1')],'defaultValue':_0xc3eb('0xb')},'answer':{'type':Sequelize[_0xc3eb('0x9')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x51d402){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xc3eb('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x30ed=['exten','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x30ed,0xa1));var _0xd30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd30e('0x0')]={'context':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'unique':_0xd30e('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xd30e('0x2')},'tag':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'defaultValue':_0xd30e('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd30e('0x4')](_0xd30e('0x5'),_0xd30e('0x6'),_0xd30e('0x7'),_0xd30e('0x8'),'outbound-fax',_0xd30e('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xd30e('0x1')]},'interval':{'type':Sequelize[_0xd30e('0x1')],'allowNull':![],'defaultValue':_0xd30e('0xa')},'IntervalId':{'type':Sequelize[_0xd30e('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd30e('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd30e('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xd30e('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd30e('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xd30e('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xd30e('0xe')],'get':function(_0x2d0cbf){return this['getDataValue'](_0xd30e('0xf'));}},'alias':{'type':Sequelize[_0xd30e('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e6f5986..3f26344 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 _0x9756=['./voiceExtension.socket','register','sendStatus','status','offset','undefined','count','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','exten','concat','user','role','InboundRoutes','UserProfileSection','userProfileId','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','createRouting','bulkCreate','finally','json','lodash','ioredis','../../config/environment','../../mysqldb','redis','localhost'];(function(_0x3e009c,_0x45170c){var _0x97fd2c=function(_0x5b3b0b){while(--_0x5b3b0b){_0x3e009c['push'](_0x3e009c['shift']());}};_0x97fd2c(++_0x45170c);}(_0x9756,0x1b2));var _0x6975=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x9756[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x6975('0x0'));var Redis=require(_0x6975('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x6975('0x2'));var db=require(_0x6975('0x3'))['db'];config[_0x6975('0x4')]=_['defaults'](config[_0x6975('0x4')],{'host':_0x6975('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6975('0x4')]));require(_0x6975('0x6'))[_0x6975('0x7')](socket);function respondWithStatusCode(_0x593633,_0x9820a4){_0x9820a4=_0x9820a4||0xcc;return function(_0xeff41d){if(_0xeff41d){return _0x593633[_0x6975('0x8')](_0x9820a4);}return _0x593633[_0x6975('0x9')](_0x9820a4)['end']();};}function respondWithResult(_0x5d3720,_0x141dc9){_0x141dc9=_0x141dc9||0xc8;return function(_0x42d817){if(_0x42d817){return _0x5d3720[_0x6975('0x9')](_0x141dc9)['json'](_0x42d817);}};}function respondWithFilteredResult(_0x156e88,_0x4f91bb){return function(_0x436fa5){if(_0x436fa5){var _0x4d7bed=typeof _0x4f91bb[_0x6975('0xa')]===_0x6975('0xb')&&typeof _0x4f91bb['limit']===_0x6975('0xb');var _0x13c8ae=_0x436fa5[_0x6975('0xc')];var _0x415401=_0x4d7bed?0x0:_0x4f91bb[_0x6975('0xa')];var _0x319b6c=_0x4d7bed?_0x436fa5[_0x6975('0xc')]:_0x4f91bb['offset']+_0x4f91bb['limit'];var _0x475823;if(_0x319b6c>=_0x13c8ae){_0x319b6c=_0x13c8ae;_0x475823=0xc8;}else{_0x475823=0xce;}_0x156e88[_0x6975('0x9')](_0x475823);return _0x156e88['set']('Content-Range',_0x415401+'-'+_0x319b6c+'/'+_0x13c8ae)['json'](_0x436fa5);}return null;};}function removeEntity(_0x22bc51){return function(_0x261d04){if(_0x261d04){return _0x261d04[_0x6975('0xd')]()[_0x6975('0xe')](function(){var _0x33f237=_0x261d04[_0x6975('0xf')]({'plain':!![]});var _0x207fb8=[{'name':'InboundRoutes','value':_0x6975('0x10'),'ignore':![]},{'name':_0x6975('0x11'),'value':_0x6975('0x12'),'ignore':![]},{'name':_0x6975('0x13'),'value':_0x6975('0x14'),'ignore':![]}];var _0xb7fce4=_(_0x207fb8)[_0x6975('0x15')](_0x6975('0x16'))[_0x6975('0x17')](_0x6975('0x18'))[_0x6975('0x18')]();if(_[_0x6975('0x19')](_0xb7fce4,_0x33f237[_0x6975('0x1a')])){return;}var _0x308fe5=_[_0x6975('0x1b')](_0x207fb8,[_0x6975('0x18'),_0x33f237['type']])[_0x6975('0x1c')];return db[_0x6975('0x1d')][_0x6975('0xd')]({'where':{'type':_0x308fe5,'resourceId':_0x33f237['id']}})['then'](function(){return _0x261d04;});})[_0x6975('0xe')](function(){_0x22bc51['status'](0xcc)[_0x6975('0x1e')]();});}};}function handleEntityNotFound(_0x129171){return function(_0xb49e1a){if(!_0xb49e1a){_0x129171[_0x6975('0x8')](0x194);}return _0xb49e1a;};}function handleError(_0x164944,_0x52627b){_0x52627b=_0x52627b||0x1f4;return function(_0xd17561){logger[_0x6975('0x1f')](_0xd17561[_0x6975('0x20')]);if(_0xd17561[_0x6975('0x1c')]){delete _0xd17561['name'];}_0x164944[_0x6975('0x9')](_0x52627b)[_0x6975('0x21')](_0xd17561);};}exports[_0x6975('0x22')]=function(_0x38d409,_0x1e8eb6){var _0x45b89e={},_0x74df4f={},_0x346ee6={'count':0x0,'rows':[]};var _0x3858a2=_['map'](db[_0x6975('0x23')][_0x6975('0x24')],function(_0x5ee38e){return{'name':_0x5ee38e[_0x6975('0x25')],'type':_0x5ee38e['type'][_0x6975('0x26')]};});_0x74df4f['model']=_[_0x6975('0x17')](_0x3858a2,_0x6975('0x1c'));_0x74df4f[_0x6975('0x27')]=_[_0x6975('0x28')](_0x38d409[_0x6975('0x27')]);_0x74df4f[_0x6975('0x29')]=_[_0x6975('0x2a')](_0x74df4f[_0x6975('0x2b')],_0x74df4f['query']);_0x45b89e[_0x6975('0x2c')]=_[_0x6975('0x2a')](_0x74df4f['model'],qs[_0x6975('0x2d')](_0x38d409['query'][_0x6975('0x2d')]));_0x45b89e[_0x6975('0x2c')]=_0x45b89e[_0x6975('0x2c')]['length']?_0x45b89e['attributes']:_0x74df4f['model'];if(!_0x38d409[_0x6975('0x27')][_0x6975('0x2e')](_0x6975('0x2f'))){_0x45b89e[_0x6975('0x30')]=qs[_0x6975('0x30')](_0x38d409[_0x6975('0x27')]['limit']);_0x45b89e[_0x6975('0xa')]=qs[_0x6975('0xa')](_0x38d409['query'][_0x6975('0xa')]);}_0x45b89e[_0x6975('0x31')]=qs[_0x6975('0x32')](_0x38d409[_0x6975('0x27')][_0x6975('0x32')]);_0x45b89e['where']=qs['filters'](_[_0x6975('0x33')](_0x38d409[_0x6975('0x27')],_0x74df4f['filters']),_0x3858a2);if(_0x38d409[_0x6975('0x27')][_0x6975('0x15')]){_0x45b89e[_0x6975('0x34')]=_[_0x6975('0x35')](_0x45b89e['where'],{'$or':_[_0x6975('0x17')](_0x3858a2,function(_0x305bc4){if(_0x305bc4[_0x6975('0x1a')]!==_0x6975('0x36')){var _0x3be54f={};_0x3be54f[_0x305bc4[_0x6975('0x1c')]]={'$like':'%'+_0x38d409[_0x6975('0x27')]['filter']+'%'};return _0x3be54f;}})});}_0x45b89e=_[_0x6975('0x35')]({},_0x45b89e,_0x38d409[_0x6975('0x37')]);var _0x594a08={'where':_0x45b89e[_0x6975('0x34')]};return db[_0x6975('0x23')]['count'](_0x594a08)[_0x6975('0xe')](function(_0x63e476){_0x346ee6[_0x6975('0xc')]=_0x63e476;if(_0x38d409[_0x6975('0x27')][_0x6975('0x38')]){_0x45b89e[_0x6975('0x39')]=[{'all':!![]}];}return db[_0x6975('0x23')][_0x6975('0x3a')](_0x45b89e);})['then'](function(_0x3a30ff){_0x346ee6[_0x6975('0x3b')]=_0x3a30ff;return _0x346ee6;})[_0x6975('0xe')](respondWithFilteredResult(_0x1e8eb6,_0x45b89e))[_0x6975('0x3c')](handleError(_0x1e8eb6,null));};exports[_0x6975('0x3d')]=function(_0x231029,_0x4ee5c5){var _0xed46f1={'raw':![],'where':{'id':_0x231029[_0x6975('0x3e')]['id']}},_0x4c93ba={};_0x4c93ba[_0x6975('0x2b')]=_['keys'](db[_0x6975('0x23')][_0x6975('0x24')]);_0x4c93ba['query']=_[_0x6975('0x28')](_0x231029[_0x6975('0x27')]);_0x4c93ba[_0x6975('0x29')]=_[_0x6975('0x2a')](_0x4c93ba['model'],_0x4c93ba[_0x6975('0x27')]);_0xed46f1[_0x6975('0x2c')]=_[_0x6975('0x2a')](_0x4c93ba[_0x6975('0x2b')],qs[_0x6975('0x2d')](_0x231029[_0x6975('0x27')][_0x6975('0x2d')]));_0xed46f1[_0x6975('0x2c')]=_0xed46f1[_0x6975('0x2c')][_0x6975('0x3f')]?_0xed46f1[_0x6975('0x2c')]:_0x4c93ba[_0x6975('0x2b')];if(_0x231029[_0x6975('0x27')][_0x6975('0x38')]){_0xed46f1[_0x6975('0x39')]=[{'all':!![]}];}_0xed46f1=_['merge']({},_0xed46f1,_0x231029[_0x6975('0x37')]);return db[_0x6975('0x23')][_0x6975('0x1b')](_0xed46f1)['then'](handleEntityNotFound(_0x4ee5c5,null))[_0x6975('0xe')](respondWithResult(_0x4ee5c5,null))[_0x6975('0x3c')](handleError(_0x4ee5c5,null));};exports['destroy']=function(_0x2affe0,_0x4dea06){return db[_0x6975('0x23')][_0x6975('0x1b')]({'where':{'id':_0x2affe0[_0x6975('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4dea06,null))[_0x6975('0xe')](removeEntity(_0x4dea06,null))[_0x6975('0x3c')](handleError(_0x4dea06,null));};exports[_0x6975('0x40')]=function(_0x163d5f,_0x15b611){if(_0x163d5f['body'][_0x6975('0x1a')]===_0x6975('0x12')&&!_['startsWith'](_0x163d5f[_0x6975('0x41')][_0x6975('0x42')],'_')){_0x163d5f[_0x6975('0x41')][_0x6975('0x42')]='_'[_0x6975('0x43')](_0x163d5f['body'][_0x6975('0x42')]);}return db[_0x6975('0x23')]['create'](_0x163d5f['body'],{'raw':![]})['then'](function(_0x2663db){var _0x16364d=_0x163d5f[_0x6975('0x44')]['get']({'plain':!![]});if(!_0x16364d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16364d[_0x6975('0x45')]===_0x6975('0x44')){var _0x541ddc=_0x2663db['get']({'plain':!![]});var _0x2b0620=[{'name':_0x6975('0x46'),'value':_0x6975('0x10')},{'name':_0x6975('0x11'),'value':'outbound'},{'name':_0x6975('0x13'),'value':_0x6975('0x14')}];var _0xdb08ef=_[_0x6975('0x1b')](_0x2b0620,[_0x6975('0x18'),_0x541ddc['type']])[_0x6975('0x1c')];return db[_0x6975('0x47')][_0x6975('0x1b')]({'where':{'name':_0xdb08ef,'userProfileId':_0x16364d[_0x6975('0x48')]},'raw':!![]})['then'](function(_0x5dd966){if(_0x5dd966&&_0x5dd966['autoAssociation']===0x0){return db[_0x6975('0x1d')][_0x6975('0x40')]({'name':_0x541ddc[_0x6975('0x1c')],'resourceId':_0x541ddc['id'],'type':_0x5dd966[_0x6975('0x1c')],'sectionId':_0x5dd966['id']},{})['then'](function(){return _0x2663db;});}else{return _0x2663db;}})[_0x6975('0x3c')](function(_0x4338e8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4338e8);throw _0x4338e8;});}return _0x2663db;})[_0x6975('0xe')](respondWithResult(_0x15b611,0xc9))[_0x6975('0x3c')](handleError(_0x15b611,null));};exports[_0x6975('0x49')]=function(_0x39fa29,_0x1ef517){if(_0x39fa29['body']['id']){delete _0x39fa29[_0x6975('0x41')]['id'];}return db[_0x6975('0x23')][_0x6975('0x1b')]({'where':{'id':_0x39fa29['params']['id']}})[_0x6975('0xe')](handleEntityNotFound(_0x1ef517,null))[_0x6975('0xe')](function(_0x45f1be){if(_0x45f1be){return db['VoiceExtension'][_0x6975('0x49')](_[_0x6975('0x33')](_0x39fa29[_0x6975('0x41')],[_0x6975('0x42'),'context',_0x6975('0x4a'),_0x6975('0x4b'),_0x6975('0x4c'),_0x6975('0x4d'),_0x6975('0x4e')]),{'where':{'context':_0x45f1be['context'],'exten':_0x45f1be[_0x6975('0x42')]},'individualHooks':!![]})[_0x6975('0xe')](function(_0x1c9567){return _0x1c9567;});}return null;})['then'](respondWithStatusCode(_0x1ef517,null))[_0x6975('0x3c')](handleError(_0x1ef517,null));};exports['addApplications']=function(_0x58d434,_0x35cc37){var _0x30ff41=_0x58d434[_0x6975('0x3e')]['id'];var _0x4e9ceb=_0x58d434['body'];var _0x27cfce=0xc8;var _0x119d65=null;return db['sequelize'][_0x6975('0x4f')]({'isolationLevel':db['sequelize'][_0x6975('0x50')][_0x6975('0x51')][_0x6975('0x52')]},function(_0x180417){return db[_0x6975('0x23')]['findOne']({'where':{'id':_0x30ff41},'transaction':_0x180417})['then'](function(_0x1d1b89){if(_0x1d1b89){return db[_0x6975('0x23')][_0x6975('0xd')]({'where':{'VoiceExtensionId':_0x30ff41},'transaction':_0x180417})['then'](function(){var _0x29da59=_[_0x6975('0x17')](_0x4e9ceb,function(_0x38f5ec){_0x38f5ec['VoiceExtensionId']=_0x30ff41;_0x38f5ec[_0x6975('0x53')]=!![];return _0x38f5ec;});return _0x1d1b89[_0x6975('0x54')](_0x29da59);})[_0x6975('0xe')](function(_0x404d0d){return db['VoiceExtension'][_0x6975('0x55')](_0x404d0d,{'transaction':_0x180417});});}else{_0x27cfce=0x194;_0x119d65=[];}});})[_0x6975('0xe')](function(){if(_0x27cfce!==0x194){return db[_0x6975('0x23')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x30ff41},'order':'cast(priority\x20as\x20unsigned)'})[_0x6975('0xe')](function(_0x42f384){_0x119d65=_0x42f384;});}})[_0x6975('0x3c')](function(_0x5222f8){_0x27cfce=0x1f4;logger[_0x6975('0x1f')](_0x5222f8['stack']);if(_0x5222f8['name']){delete _0x5222f8[_0x6975('0x1c')];}_0x119d65=_0x5222f8;})[_0x6975('0x56')](function(){if(_0x119d65===null){_0x35cc37['sendStatus'](_0x27cfce);}else{if(_0x27cfce===0x1f4){_0x35cc37[_0x6975('0x9')](_0x27cfce)[_0x6975('0x21')](_0x119d65);}else{_0x35cc37['status'](_0x27cfce)[_0x6975('0x57')](_0x119d65);}}});}; \ No newline at end of file +var _0x3844=['rows','catch','show','params','rawAttributes','options','create','body','startsWith','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','addApplications','sequelize','transaction','Transaction','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','inbound','outbound','InternalRoutes','internal','map','value','includes','type','find','name','UserProfileResource','then','end','error','stack','send','index','VoiceExtension','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll'];(function(_0x5db974,_0x45126b){var _0x32b019=function(_0x49ddd7){while(--_0x49ddd7){_0x5db974['push'](_0x5db974['shift']());}};_0x32b019(++_0x45126b);}(_0x3844,0x83));var _0x4384=function(_0x4e8c09,_0x38eae6){_0x4e8c09=_0x4e8c09-0x0;var _0x5aca42=_0x3844[_0x4e8c09];return _0x5aca42;};'use strict';var _=require(_0x4384('0x0'));var Redis=require('ioredis');var qs=require(_0x4384('0x1'));var logger=require(_0x4384('0x2'))('api');var config=require('../../config/environment');var db=require(_0x4384('0x3'))['db'];config[_0x4384('0x4')]=_[_0x4384('0x5')](config[_0x4384('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x4384('0x6'))(new Redis(config[_0x4384('0x4')]));require(_0x4384('0x7'))[_0x4384('0x8')](socket);function respondWithStatusCode(_0x3bf52e,_0x967cdf){_0x967cdf=_0x967cdf||0xcc;return function(_0x4dd03f){if(_0x4dd03f){return _0x3bf52e[_0x4384('0x9')](_0x967cdf);}return _0x3bf52e[_0x4384('0xa')](_0x967cdf)['end']();};}function respondWithResult(_0x4ebb0c,_0x502b16){_0x502b16=_0x502b16||0xc8;return function(_0x3369a6){if(_0x3369a6){return _0x4ebb0c['status'](_0x502b16)[_0x4384('0xb')](_0x3369a6);}};}function respondWithFilteredResult(_0xf3f1af,_0x82b305){return function(_0x21deaa){if(_0x21deaa){var _0xcfa3ee=typeof _0x82b305[_0x4384('0xc')]===_0x4384('0xd')&&typeof _0x82b305[_0x4384('0xe')]==='undefined';var _0x83181=_0x21deaa[_0x4384('0xf')];var _0x48f453=_0xcfa3ee?0x0:_0x82b305[_0x4384('0xc')];var _0x8aa6da=_0xcfa3ee?_0x21deaa[_0x4384('0xf')]:_0x82b305[_0x4384('0xc')]+_0x82b305[_0x4384('0xe')];var _0x44c091;if(_0x8aa6da>=_0x83181){_0x8aa6da=_0x83181;_0x44c091=0xc8;}else{_0x44c091=0xce;}_0xf3f1af[_0x4384('0xa')](_0x44c091);return _0xf3f1af[_0x4384('0x10')](_0x4384('0x11'),_0x48f453+'-'+_0x8aa6da+'/'+_0x83181)['json'](_0x21deaa);}return null;};}function removeEntity(_0x50279d){return function(_0x4785e5){if(_0x4785e5){return _0x4785e5[_0x4384('0x12')]()['then'](function(){var _0x2edf33=_0x4785e5['get']({'plain':!![]});var _0x454bab=[{'name':'InboundRoutes','value':_0x4384('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':_0x4384('0x14'),'ignore':![]},{'name':_0x4384('0x15'),'value':_0x4384('0x16'),'ignore':![]}];var _0x372a50=_(_0x454bab)['filter']('ignore')[_0x4384('0x17')](_0x4384('0x18'))[_0x4384('0x18')]();if(_[_0x4384('0x19')](_0x372a50,_0x2edf33[_0x4384('0x1a')])){return;}var _0x4cc7cb=_[_0x4384('0x1b')](_0x454bab,[_0x4384('0x18'),_0x2edf33['type']])[_0x4384('0x1c')];return db[_0x4384('0x1d')][_0x4384('0x12')]({'where':{'type':_0x4cc7cb,'resourceId':_0x2edf33['id']}})[_0x4384('0x1e')](function(){return _0x4785e5;});})[_0x4384('0x1e')](function(){_0x50279d[_0x4384('0xa')](0xcc)[_0x4384('0x1f')]();});}};}function handleEntityNotFound(_0x22f750){return function(_0x4cfce9){if(!_0x4cfce9){_0x22f750[_0x4384('0x9')](0x194);}return _0x4cfce9;};}function handleError(_0x3ce101,_0x1fa40e){_0x1fa40e=_0x1fa40e||0x1f4;return function(_0x234824){logger[_0x4384('0x20')](_0x234824[_0x4384('0x21')]);if(_0x234824[_0x4384('0x1c')]){delete _0x234824[_0x4384('0x1c')];}_0x3ce101[_0x4384('0xa')](_0x1fa40e)[_0x4384('0x22')](_0x234824);};}exports[_0x4384('0x23')]=function(_0x2835b9,_0x3bd58b){var _0x4351fc={},_0x28f295={},_0x4c2eee={'count':0x0,'rows':[]};var _0x2ec64a=_[_0x4384('0x17')](db[_0x4384('0x24')]['rawAttributes'],function(_0x5614bc){return{'name':_0x5614bc[_0x4384('0x25')],'type':_0x5614bc['type'][_0x4384('0x26')]};});_0x28f295[_0x4384('0x27')]=_[_0x4384('0x17')](_0x2ec64a,_0x4384('0x1c'));_0x28f295['query']=_[_0x4384('0x28')](_0x2835b9[_0x4384('0x29')]);_0x28f295[_0x4384('0x2a')]=_[_0x4384('0x2b')](_0x28f295['model'],_0x28f295[_0x4384('0x29')]);_0x4351fc['attributes']=_[_0x4384('0x2b')](_0x28f295[_0x4384('0x27')],qs[_0x4384('0x2c')](_0x2835b9[_0x4384('0x29')]['fields']));_0x4351fc[_0x4384('0x2d')]=_0x4351fc['attributes'][_0x4384('0x2e')]?_0x4351fc[_0x4384('0x2d')]:_0x28f295['model'];if(!_0x2835b9[_0x4384('0x29')]['hasOwnProperty'](_0x4384('0x2f'))){_0x4351fc[_0x4384('0xe')]=qs[_0x4384('0xe')](_0x2835b9[_0x4384('0x29')]['limit']);_0x4351fc[_0x4384('0xc')]=qs[_0x4384('0xc')](_0x2835b9[_0x4384('0x29')][_0x4384('0xc')]);}_0x4351fc[_0x4384('0x30')]=qs[_0x4384('0x31')](_0x2835b9[_0x4384('0x29')][_0x4384('0x31')]);_0x4351fc[_0x4384('0x32')]=qs[_0x4384('0x2a')](_['pick'](_0x2835b9[_0x4384('0x29')],_0x28f295['filters']),_0x2ec64a);if(_0x2835b9['query'][_0x4384('0x33')]){_0x4351fc[_0x4384('0x32')]=_[_0x4384('0x34')](_0x4351fc[_0x4384('0x32')],{'$or':_['map'](_0x2ec64a,function(_0x2dd033){if(_0x2dd033[_0x4384('0x1a')]!==_0x4384('0x35')){var _0x4a32d0={};_0x4a32d0[_0x2dd033['name']]={'$like':'%'+_0x2835b9[_0x4384('0x29')][_0x4384('0x33')]+'%'};return _0x4a32d0;}})});}_0x4351fc=_['merge']({},_0x4351fc,_0x2835b9['options']);var _0x5b97b4={'where':_0x4351fc[_0x4384('0x32')]};return db[_0x4384('0x24')]['count'](_0x5b97b4)['then'](function(_0x2a8eba){_0x4c2eee['count']=_0x2a8eba;if(_0x2835b9[_0x4384('0x29')]['includeAll']){_0x4351fc['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x4384('0x36')](_0x4351fc);})[_0x4384('0x1e')](function(_0x5a4659){_0x4c2eee[_0x4384('0x37')]=_0x5a4659;return _0x4c2eee;})[_0x4384('0x1e')](respondWithFilteredResult(_0x3bd58b,_0x4351fc))[_0x4384('0x38')](handleError(_0x3bd58b,null));};exports[_0x4384('0x39')]=function(_0x2a156e,_0x5d7df1){var _0x5c9bde={'raw':![],'where':{'id':_0x2a156e[_0x4384('0x3a')]['id']}},_0x3c04f8={};_0x3c04f8[_0x4384('0x27')]=_['keys'](db[_0x4384('0x24')][_0x4384('0x3b')]);_0x3c04f8[_0x4384('0x29')]=_[_0x4384('0x28')](_0x2a156e['query']);_0x3c04f8['filters']=_[_0x4384('0x2b')](_0x3c04f8[_0x4384('0x27')],_0x3c04f8[_0x4384('0x29')]);_0x5c9bde[_0x4384('0x2d')]=_[_0x4384('0x2b')](_0x3c04f8[_0x4384('0x27')],qs[_0x4384('0x2c')](_0x2a156e[_0x4384('0x29')][_0x4384('0x2c')]));_0x5c9bde[_0x4384('0x2d')]=_0x5c9bde[_0x4384('0x2d')][_0x4384('0x2e')]?_0x5c9bde['attributes']:_0x3c04f8[_0x4384('0x27')];if(_0x2a156e['query']['includeAll']){_0x5c9bde['include']=[{'all':!![]}];}_0x5c9bde=_[_0x4384('0x34')]({},_0x5c9bde,_0x2a156e[_0x4384('0x3c')]);return db[_0x4384('0x24')]['find'](_0x5c9bde)[_0x4384('0x1e')](handleEntityNotFound(_0x5d7df1,null))[_0x4384('0x1e')](respondWithResult(_0x5d7df1,null))['catch'](handleError(_0x5d7df1,null));};exports[_0x4384('0x12')]=function(_0x21be65,_0x4672f5){return db['VoiceExtension'][_0x4384('0x1b')]({'where':{'id':_0x21be65['params']['id']}})[_0x4384('0x1e')](handleEntityNotFound(_0x4672f5,null))[_0x4384('0x1e')](removeEntity(_0x4672f5,null))[_0x4384('0x38')](handleError(_0x4672f5,null));};exports[_0x4384('0x3d')]=function(_0x5b7a31,_0x159750){if(_0x5b7a31[_0x4384('0x3e')][_0x4384('0x1a')]===_0x4384('0x14')&&!_[_0x4384('0x3f')](_0x5b7a31[_0x4384('0x3e')][_0x4384('0x40')],'_')){_0x5b7a31[_0x4384('0x3e')][_0x4384('0x40')]='_'[_0x4384('0x41')](_0x5b7a31[_0x4384('0x3e')][_0x4384('0x40')]);}return db[_0x4384('0x24')][_0x4384('0x3d')](_0x5b7a31[_0x4384('0x3e')],{'raw':![]})['then'](function(_0x2eba53){var _0x509ac5=_0x5b7a31['user'][_0x4384('0x42')]({'plain':!![]});if(!_0x509ac5)throw new Error(_0x4384('0x43'));if(_0x509ac5[_0x4384('0x44')]===_0x4384('0x45')){var _0x28352a=_0x2eba53[_0x4384('0x42')]({'plain':!![]});var _0x5249c6=[{'name':_0x4384('0x46'),'value':_0x4384('0x13')},{'name':_0x4384('0x47'),'value':_0x4384('0x14')},{'name':_0x4384('0x15'),'value':_0x4384('0x16')}];var _0x4083c2=_['find'](_0x5249c6,[_0x4384('0x18'),_0x28352a['type']])[_0x4384('0x1c')];return db[_0x4384('0x48')][_0x4384('0x1b')]({'where':{'name':_0x4083c2,'userProfileId':_0x509ac5[_0x4384('0x49')]},'raw':!![]})[_0x4384('0x1e')](function(_0x39f750){if(_0x39f750&&_0x39f750[_0x4384('0x4a')]===0x0){return db['UserProfileResource'][_0x4384('0x3d')]({'name':_0x28352a[_0x4384('0x1c')],'resourceId':_0x28352a['id'],'type':_0x39f750['name'],'sectionId':_0x39f750['id']},{})[_0x4384('0x1e')](function(){return _0x2eba53;});}else{return _0x2eba53;}})[_0x4384('0x38')](function(_0x2c0e53){logger[_0x4384('0x20')](_0x4384('0x4b'),_0x2c0e53);throw _0x2c0e53;});}return _0x2eba53;})[_0x4384('0x1e')](respondWithResult(_0x159750,0xc9))[_0x4384('0x38')](handleError(_0x159750,null));};exports[_0x4384('0x4c')]=function(_0x487f87,_0x7b46ad){if(_0x487f87[_0x4384('0x3e')]['id']){delete _0x487f87[_0x4384('0x3e')]['id'];}return db['VoiceExtension'][_0x4384('0x1b')]({'where':{'id':_0x487f87['params']['id']}})['then'](handleEntityNotFound(_0x7b46ad,null))['then'](function(_0x514391){if(_0x514391){return db['VoiceExtension'][_0x4384('0x4c')](_[_0x4384('0x4d')](_0x487f87[_0x4384('0x3e')],['exten',_0x4384('0x4e'),_0x4384('0x4f'),_0x4384('0x50'),_0x4384('0x51'),'mandatoryDisposition','alias']),{'where':{'context':_0x514391['context'],'exten':_0x514391[_0x4384('0x40')]},'individualHooks':!![]})[_0x4384('0x1e')](function(_0x4a91f0){return _0x4a91f0;});}return null;})[_0x4384('0x1e')](respondWithStatusCode(_0x7b46ad,null))[_0x4384('0x38')](handleError(_0x7b46ad,null));};exports[_0x4384('0x52')]=function(_0x493aa4,_0x353205){var _0x1ed6c0=_0x493aa4['params']['id'];var _0x1f6c7a=_0x493aa4[_0x4384('0x3e')];var _0x5f42d4=0xc8;var _0x2fc282=null;return db[_0x4384('0x53')][_0x4384('0x54')]({'isolationLevel':db[_0x4384('0x53')][_0x4384('0x55')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3832ba){return db[_0x4384('0x24')][_0x4384('0x56')]({'where':{'id':_0x1ed6c0},'transaction':_0x3832ba})[_0x4384('0x1e')](function(_0x34cced){if(_0x34cced){return db[_0x4384('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x1ed6c0},'transaction':_0x3832ba})['then'](function(){var _0x446ba0=_['map'](_0x1f6c7a,function(_0x271685){_0x271685[_0x4384('0x57')]=_0x1ed6c0;_0x271685[_0x4384('0x58')]=!![];return _0x271685;});return _0x34cced['createRouting'](_0x446ba0);})[_0x4384('0x1e')](function(_0x49d5c9){return db[_0x4384('0x24')][_0x4384('0x59')](_0x49d5c9,{'transaction':_0x3832ba});});}else{_0x5f42d4=0x194;_0x2fc282=[];}});})[_0x4384('0x1e')](function(){if(_0x5f42d4!==0x194){return db[_0x4384('0x24')][_0x4384('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1ed6c0},'order':_0x4384('0x5b')})[_0x4384('0x1e')](function(_0x1aac24){_0x2fc282=_0x1aac24;});}})['catch'](function(_0x3141ad){_0x5f42d4=0x1f4;logger['error'](_0x3141ad['stack']);if(_0x3141ad[_0x4384('0x1c')]){delete _0x3141ad[_0x4384('0x1c')];}_0x2fc282=_0x3141ad;})[_0x4384('0x5c')](function(){if(_0x2fc282===null){_0x353205[_0x4384('0x9')](_0x5f42d4);}else{if(_0x5f42d4===0x1f4){_0x353205[_0x4384('0xa')](_0x5f42d4)['send'](_0x2fc282);}else{_0x353205[_0x4384('0xa')](_0x5f42d4)['json'](_0x2fc282);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 02cee52..ee14f69 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 _0x3583=['../../mysqldb','VoiceExtension','setMaxListeners','save','emit','hasOwnProperty','events'];(function(_0x2b8592,_0x6c97a3){var _0x46b04d=function(_0x561246){while(--_0x561246){_0x2b8592['push'](_0x2b8592['shift']());}};_0x46b04d(++_0x6c97a3);}(_0x3583,0x12c));var _0x3358=function(_0x45cce0,_0x48030d){_0x45cce0=_0x45cce0-0x0;var _0x28452e=_0x3583[_0x45cce0];return _0x28452e;};'use strict';var EventEmitter=require(_0x3358('0x0'));var VoiceExtension=require(_0x3358('0x1'))['db'][_0x3358('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3358('0x3')](0x0);var events={'afterCreate':_0x3358('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4927da){return function(_0x13f7ff,_0xeb5ed6,_0x2b0bea){VoiceExtensionEvents[_0x3358('0x5')](_0x4927da+':'+_0x13f7ff['id'],_0x13f7ff);VoiceExtensionEvents['emit'](_0x4927da,_0x13f7ff);_0x2b0bea(null);};}for(var e in events){if(events[_0x3358('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xa029=['VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2e80d5,_0x16512c){var _0xf3e966=function(_0x381704){while(--_0x381704){_0x2e80d5['push'](_0x2e80d5['shift']());}};_0xf3e966(++_0x16512c);}(_0xa029,0x130));var _0x9a02=function(_0x303775,_0x51539c){_0x303775=_0x303775-0x0;var _0x1c8a3f=_0xa029[_0x303775];return _0x1c8a3f;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x9a02('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9a02('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a02('0x2'),'afterDestroy':_0x9a02('0x3')};function emitEvent(_0x3d7a2f){return function(_0x3c7ceb,_0xd9709b,_0x49ef61){VoiceExtensionEvents['emit'](_0x3d7a2f+':'+_0x3c7ceb['id'],_0x3c7ceb);VoiceExtensionEvents[_0x9a02('0x4')](_0x3d7a2f,_0x3c7ceb);_0x49ef61(null);};}for(var e in events){if(events[_0x9a02('0x5')](e)){var event=events[e];VoiceExtension[_0x9a02('0x6')](e,emitEvent(event));}}module[_0x9a02('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2564c39..fd55a80 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 _0x3b2b=['queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','url','split','length','name','param','phone','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','then','intervals','map','filter','IntervalId','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x3b2b,0x64));var _0xb3b2=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x3b2b[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xb3b2('0x0'));var attributes=require(_0xb3b2('0x1'));module['exports']=function(_0xf70a0d){var _0x342f90=_0xf70a0d[_0xb3b2('0x2')];function _0x218282(_0x83ffbd){var _0x2f382f=0x2;var _0x1aaf04=[{'type':_0x83ffbd[_0xb3b2('0x3')],'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x5')+_0x83ffbd[_0xb3b2('0x3')],'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']},{'type':_0x83ffbd[_0xb3b2('0x3')],'app':_0x83ffbd[_0xb3b2('0x8')]?_0xb3b2('0x4'):'NoOp','appdata':_0x83ffbd[_0xb3b2('0x8')]?_0xb3b2('0x9')+_0x83ffbd[_0xb3b2('0x8')]:_0xb3b2('0xa'),'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd['exten'],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']}];if(_0x83ffbd[_0xb3b2('0x3')]===_0xb3b2('0xb')){_0x1aaf04[_0xb3b2('0xc')]({'type':'inbound','app':'Set','appdata':_0xb3b2('0xd')+_0x83ffbd['id'],'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']});}_0x1aaf04['push']({'type':_0x83ffbd['type'],'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0xe'),'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']},{'type':_0x83ffbd[_0xb3b2('0x3')],'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0xf'),'context':_0x83ffbd['context'],'exten':_0x83ffbd['exten'],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']},{'type':_0x83ffbd[_0xb3b2('0x3')],'app':'Set','appdata':_0xb3b2('0x10'),'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']});return _0x1aaf04;}function _0x11396a(_0x80fd16){var _0x2f0e7f=0x2;var _0x57ee49=[{'type':'outbound','app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x11'),'context':_0x80fd16['context'],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0x80fd16[_0xb3b2('0x8')]?_0xb3b2('0x4'):_0xb3b2('0x13'),'appdata':_0x80fd16['alias']?'CDR(routeAlias)='+_0x80fd16['alias']:_0xb3b2('0xa'),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':'Set','appdata':_0xb3b2('0x14')+(_0x80fd16['cutdigits']?_0xb3b2('0x15')+_0x80fd16[_0xb3b2('0x16')]+'}':_0xb3b2('0x17')),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0xd')+_0x80fd16['id'],'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':'outbound','app':'ExecIf','appdata':_0xb3b2('0x18')+(_0x2f0e7f+0x2)+'):Goto('+(_0x2f0e7f+0x1)+')','context':_0x80fd16['context'],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':'outbound','app':_0xb3b2('0x4'),'appdata':_0x80fd16[_0xb3b2('0x16')]?'CDR(prefix)=${EXTEN:0:'+_0x80fd16[_0xb3b2('0x16')]+'}':'CDR(prefix)=noprefix','context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':'Set','appdata':_0xb3b2('0xf'),'context':_0x80fd16['context'],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x10'),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x19')+_0x80fd16['id'],'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']}];if(_0x80fd16[_0xb3b2('0x1a')](_0xb3b2('0x1b'))&&_0x80fd16[_0xb3b2('0x1b')]!==_0xb3b2('0x1c')){_0x57ee49[_0xb3b2('0xc')]({'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x1d'),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x80fd16[_0xb3b2('0x1b')]||'wav','context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']});}return _0x57ee49;}function _0x23331f(_0x478c85,_0x3aa8c4){var _0x3763ea=[{'name':_0xb3b2('0x1e'),'param':0x0},{'name':_0xb3b2('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0xb3b2('0x20'),'param':0x3}];var _0x22c137={};var _0x579293=_0x3aa8c4[_0xb3b2('0x21')](',');var _0xabed40=[];for(var _0xbbeff9=0x0;_0xbbeff9<_0x3763ea[_0xb3b2('0x22')];_0xbbeff9++){switch(_0x3763ea[_0xbbeff9][_0xb3b2('0x23')]){case _0xb3b2('0x1e'):_0x22c137[_0xb3b2('0x1e')]=_0x579293[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]][_0xb3b2('0x21')]('/')[0x1];_0x22c137[_0xb3b2('0x25')]=_0x579293[_0x3763ea[_0xbbeff9]['param']][_0xb3b2('0x21')]('/')[0x2];_0x22c137['prefix']=_0x22c137[_0xb3b2('0x25')]?_0x22c137[_0xb3b2('0x25')][_0xb3b2('0x21')]('$')[0x0]:undefined;_0x22c137[_0xb3b2('0x25')]=_0x478c85[_0xb3b2('0x16')]?(_0x22c137[_0xb3b2('0x26')]||'')+_0xb3b2('0x15')+_0x478c85[_0xb3b2('0x16')]+'}':(_0x22c137[_0xb3b2('0x26')]||'')+_0xb3b2('0x17');_0xabed40[_0x3763ea[_0xbbeff9]['param']]=['SIP',_0x22c137[_0xb3b2('0x1e')],_0x22c137[_0xb3b2('0x25')]][_0xb3b2('0x27')]('/');break;case _0xb3b2('0x28'):_0x22c137[_0xb3b2('0x28')]=_0x579293[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]];if(_0x478c85[_0xb3b2('0x1b')]!=='none'){if(_0x22c137[_0xb3b2('0x28')][_0xb3b2('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x22c137['options']+=_0xb3b2('0x2a');}}else{_0x22c137[_0xb3b2('0x28')]=_0x22c137[_0xb3b2('0x28')]['replace'](_0xb3b2('0x2a'),'');}_0xabed40[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]]=_0x22c137[_0xb3b2('0x28')];break;default:_0xabed40[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]]=_0x579293[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]];}}return _0xabed40['join'](',');}function _0x4215e2(_0xbb2bdb,_0x7f126b,_0x970872){return new Promise(function(_0x588514,_0x4e1225){var _0x8446e3=[];if(_[_0xb3b2('0x2b')](_0x7f126b))return _0x588514(_0x8446e3);_0x342f90['Interval'][_0xb3b2('0x2c')]({'attributes':['id',_0xb3b2('0x2d'),'IntervalId'],'raw':!![]})[_0xb3b2('0x2e')](function(_0x17d715){for(var _0x1eedb7=0x0,_0x5e12d0=0x0;_0x1eedb7<_0x7f126b[_0xb3b2('0x22')];_0x1eedb7++,_0x5e12d0=0x0){var _0x161173=_0x7f126b[_0x1eedb7];var _0x2b9a5b=[];var _0x482073=[];delete _0x161173['id'];if(_0x161173[_0xb3b2('0x2d')]!=='*,*,*,*'){_0x161173[_0xb3b2('0x2f')]=[_0x161173[_0xb3b2('0x2d')]];}else{_0x161173[_0xb3b2('0x2f')]=_0x161173['IntervalId']?_[_0xb3b2('0x30')](_[_0xb3b2('0x31')](_0x17d715,{'IntervalId':_0x161173[_0xb3b2('0x32')]}),'interval'):[];}_0x161173[_0xb3b2('0x6')]=_0xbb2bdb[_0xb3b2('0x6')];_0x161173[_0xb3b2('0x7')]=_0xbb2bdb[_0xb3b2('0x7')];if(_0x161173['type'])_0x161173['type']=_0x161173['type'][_0xb3b2('0x33')]();if(_0xbb2bdb[_0xb3b2('0x3')]===_0xb3b2('0x12')){if(_0x161173['hasOwnProperty'](_0xb3b2('0x34'))&&_0x161173[_0xb3b2('0x34')]&&_0x161173[_0xb3b2('0x34')]!=='--'){_0x2b9a5b['push']({'type':_0x161173['type'][_0xb3b2('0x33')](),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x35')+_0x161173[_0xb3b2('0x34')],'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')]['length']+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':_0xb3b2('0x36'),'appdata':_0xb3b2('0x37')+(_0x161173[_0xb3b2('0x38')]?_0xb3b2('0x39')+_0x161173[_0xb3b2('0x38')]+')':_0xb3b2('0x3a')),'context':_0xbb2bdb['context'],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}else{if(_0x161173[_0xb3b2('0x1a')](_0xb3b2('0x3b'))){if([_0xb3b2('0x3c'),_0xb3b2('0x3d')][_0xb3b2('0x3e')](_0x161173[_0xb3b2('0x3f')]['toLowerCase']())&&_0x161173[_0xb3b2('0x40')]!==_0xb3b2('0x41')){if(_0x161173[_0xb3b2('0x3b')]){_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173['type'][_0xb3b2('0x33')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x42'),'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}else{_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173['type'][_0xb3b2('0x33')](),'app':_0xb3b2('0x36'),'appdata':_0xb3b2('0x43'),'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':_0xb3b2('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xbb2bdb['context'],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}}}}for(var _0x438a40=0x0;_0x438a40<_0x161173[_0xb3b2('0x2f')]['length'];_0x438a40++){var _0x4eca42=_0x970872+_0x161173[_0xb3b2('0x2f')]['length'];var _0x42d2ca=_0x438a40===_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]-0x1?_0x970872+_0x2b9a5b['length']+_0x482073[_0xb3b2('0x22')]+0x2:_0x970872+_0x438a40+0x1;_0x2b9a5b[_0xb3b2('0x44')](_0x438a40,0x0,{'type':_0xbb2bdb[_0xb3b2('0x3')],'app':_0xb3b2('0x45'),'appdata':_0x161173[_0xb3b2('0x2f')][_0x438a40]+'?'+_0xbb2bdb[_0xb3b2('0x6')]+_0xb3b2('0x46')+_0x4eca42+':'+_0xbb2bdb[_0xb3b2('0x6')]+_0xb3b2('0x46')+_0x42d2ca,'exten':_0xbb2bdb[_0xb3b2('0x7')],'context':_0xbb2bdb[_0xb3b2('0x6')],'priority':_0x970872+_0x438a40,'VoiceExtensionId':_0xbb2bdb['id']});}if(_0x161173['appType']==='outboundDial'){_0x161173['appdata']=_0x23331f(_0xbb2bdb,_0x161173[_0xb3b2('0x47')]);}if(_0x161173[_0xb3b2('0x40')]==='agi'){_0x2b9a5b['push']({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':'Set','appdata':_0xb3b2('0x48'),'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}_0x161173[_0xb3b2('0x49')]=_0x2b9a5b[_0xb3b2('0x22')]?_['last'](_0x2b9a5b)[_0xb3b2('0x49')]+0x1:_0x970872;_0x8446e3=_['concat'](_0x8446e3,_0x2b9a5b,[_0x161173],_0x482073);_0x970872=_[_0xb3b2('0x4a')](_0x8446e3)['priority']+0x1;}return _0x588514(_0x8446e3);})[_0xb3b2('0x4b')](function(_0x4203ec){_0x4e1225(_0x4203ec);});});}return _0xf70a0d['define'](_0xb3b2('0x4c'),attributes,{'tableName':_0xb3b2('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x177a9c){var _0x246855=this[_0xb3b2('0x4e')]({'plain':!![]});var _0x201b48=_0x246855[_0xb3b2('0x3')]==='outbound'?_0x11396a(_0x246855):_0x218282(_0x246855);return _0x4215e2(_0x246855,_0x177a9c,_[_0xb3b2('0x4a')](_0x201b48)[_0xb3b2('0x49')]+0x1)[_0xb3b2('0x2e')](function(_0x1a931f){var _0x4a394b=_['concat'](_0x201b48,_0x1a931f);_0x4a394b[_0xb3b2('0xc')]({'type':_0x246855[_0xb3b2('0x3')],'app':_0xb3b2('0x4f'),'exten':_0x246855[_0xb3b2('0x7')],'context':_0x246855[_0xb3b2('0x6')],'priority':_[_0xb3b2('0x4a')](_0x4a394b)['priority']+0x1,'VoiceExtensionId':_0x246855['id']});return _0x4a394b;});}}});}; \ No newline at end of file +var _0x25d5=['CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','hasOwnProperty','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','answer','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','define','voice_extensions','get','then','Hangup','last','lodash','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto('];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x25d5,0x91));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x525d('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x525d('0x1')]=function(_0x5d7994){var _0xa822eb=_0x5d7994[_0x525d('0x2')];function _0x315f4e(_0x586cbf){var _0x189c28=0x2;var _0x29e86f=[{'type':_0x586cbf[_0x525d('0x3')],'app':_0x525d('0x4'),'appdata':'CDR(type)='+_0x586cbf[_0x525d('0x3')],'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']},{'type':_0x586cbf[_0x525d('0x3')],'app':_0x586cbf[_0x525d('0x7')]?_0x525d('0x4'):_0x525d('0x8'),'appdata':_0x586cbf[_0x525d('0x7')]?_0x525d('0x9')+_0x586cbf['alias']:_0x525d('0xa'),'context':_0x586cbf['context'],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']}];if(_0x586cbf['type']==='inbound'){_0x29e86f['push']({'type':_0x525d('0xb'),'app':_0x525d('0x4'),'appdata':'CDR(routeid)='+_0x586cbf['id'],'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']});}_0x29e86f[_0x525d('0xc')]({'type':_0x586cbf['type'],'app':_0x525d('0x4'),'appdata':_0x525d('0xd'),'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']},{'type':_0x586cbf['type'],'app':_0x525d('0x4'),'appdata':_0x525d('0xe'),'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf[_0x525d('0x6')],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']},{'type':_0x586cbf[_0x525d('0x3')],'app':_0x525d('0x4'),'appdata':_0x525d('0xf'),'context':_0x586cbf[_0x525d('0x5')],'exten':_0x586cbf['exten'],'priority':_0x189c28++,'VoiceExtensionId':_0x586cbf['id']});return _0x29e86f;}function _0x51dfca(_0x38750c){var _0x389565=0x2;var _0x121eab=[{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x525d('0x11'),'context':_0x38750c['context'],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x38750c[_0x525d('0x7')]?_0x525d('0x4'):_0x525d('0x8'),'appdata':_0x38750c[_0x525d('0x7')]?'CDR(routeAlias)='+_0x38750c[_0x525d('0x7')]:'No\x20alias\x20set','context':_0x38750c['context'],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':'Set','appdata':_0x525d('0x12')+(_0x38750c[_0x525d('0x13')]?_0x525d('0x14')+_0x38750c[_0x525d('0x13')]+'}':_0x525d('0x15')),'context':_0x38750c['context'],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':'Set','appdata':_0x525d('0x16')+_0x38750c['id'],'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':_0x525d('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x389565+0x2)+_0x525d('0x18')+(_0x389565+0x1)+')','context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x38750c[_0x525d('0x13')]?_0x525d('0x19')+_0x38750c['cutdigits']+'}':_0x525d('0x1a'),'context':_0x38750c['context'],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x525d('0xe'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c['exten'],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':_0x525d('0x4'),'appdata':_0x525d('0xf'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':_0x525d('0x10'),'app':_0x525d('0x4'),'appdata':_0x525d('0x1b')+_0x38750c['id'],'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']}];if(_0x38750c['hasOwnProperty'](_0x525d('0x1c'))&&_0x38750c['recordingFormat']!==_0x525d('0x1d')){_0x121eab['push']({'type':_0x525d('0x10'),'app':'Set','appdata':_0x525d('0x1e'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']},{'type':'outbound','app':'Set','appdata':_0x525d('0x1f')+_0x38750c[_0x525d('0x1c')]||_0x525d('0x20'),'context':_0x38750c[_0x525d('0x5')],'exten':_0x38750c[_0x525d('0x6')],'priority':_0x389565++,'VoiceExtensionId':_0x38750c['id']});}return _0x121eab;}function _0x218b6a(_0x4d5050,_0x21afd1){var _0x27762f=[{'name':_0x525d('0x21'),'param':0x0},{'name':_0x525d('0x22'),'param':0x1},{'name':_0x525d('0x23'),'param':0x2},{'name':_0x525d('0x24'),'param':0x3}];var _0x1a2dd8={};var _0x2522ab=_0x21afd1[_0x525d('0x25')](',');var _0x252d46=[];for(var _0x58377f=0x0;_0x58377f<_0x27762f[_0x525d('0x26')];_0x58377f++){switch(_0x27762f[_0x58377f][_0x525d('0x27')]){case _0x525d('0x21'):_0x1a2dd8[_0x525d('0x21')]=_0x2522ab[_0x27762f[_0x58377f][_0x525d('0x28')]][_0x525d('0x25')]('/')[0x1];_0x1a2dd8[_0x525d('0x29')]=_0x2522ab[_0x27762f[_0x58377f]['param']][_0x525d('0x25')]('/')[0x2];_0x1a2dd8[_0x525d('0x2a')]=_0x1a2dd8[_0x525d('0x29')]?_0x1a2dd8[_0x525d('0x29')][_0x525d('0x25')]('$')[0x0]:undefined;_0x1a2dd8[_0x525d('0x29')]=_0x4d5050[_0x525d('0x13')]?(_0x1a2dd8[_0x525d('0x2a')]||'')+_0x525d('0x14')+_0x4d5050[_0x525d('0x13')]+'}':(_0x1a2dd8[_0x525d('0x2a')]||'')+'${EXTEN}';_0x252d46[_0x27762f[_0x58377f][_0x525d('0x28')]]=[_0x525d('0x2b'),_0x1a2dd8['trunk'],_0x1a2dd8[_0x525d('0x29')]][_0x525d('0x2c')]('/');break;case _0x525d('0x23'):_0x1a2dd8[_0x525d('0x23')]=_0x2522ab[_0x27762f[_0x58377f]['param']];if(_0x4d5050['recordingFormat']!==_0x525d('0x1d')){if(_0x1a2dd8[_0x525d('0x23')]['indexOf'](_0x525d('0x2d'))<0x0){_0x1a2dd8[_0x525d('0x23')]+=_0x525d('0x2d');}}else{_0x1a2dd8[_0x525d('0x23')]=_0x1a2dd8['options'][_0x525d('0x2e')](_0x525d('0x2d'),'');}_0x252d46[_0x27762f[_0x58377f][_0x525d('0x28')]]=_0x1a2dd8['options'];break;default:_0x252d46[_0x27762f[_0x58377f]['param']]=_0x2522ab[_0x27762f[_0x58377f]['param']];}}return _0x252d46['join'](',');}function _0x3c7a2d(_0x3e6091,_0x27def6,_0x2c9550){return new Promise(function(_0x13e6a7,_0x317b3b){var _0x5bc4e2=[];if(_[_0x525d('0x2f')](_0x27def6))return _0x13e6a7(_0x5bc4e2);_0xa822eb[_0x525d('0x30')][_0x525d('0x31')]({'attributes':['id',_0x525d('0x32'),_0x525d('0x33')],'raw':!![]})['then'](function(_0x15c0c1){for(var _0x5cd85f=0x0,_0x458c94=0x0;_0x5cd85f<_0x27def6[_0x525d('0x26')];_0x5cd85f++,_0x458c94=0x0){var _0x3cf843=_0x27def6[_0x5cd85f];var _0x4c975f=[];var _0x3a006e=[];delete _0x3cf843['id'];if(_0x3cf843['interval']!==_0x525d('0x34')){_0x3cf843['intervals']=[_0x3cf843[_0x525d('0x32')]];}else{_0x3cf843[_0x525d('0x35')]=_0x3cf843[_0x525d('0x33')]?_[_0x525d('0x36')](_['filter'](_0x15c0c1,{'IntervalId':_0x3cf843['IntervalId']}),'interval'):[];}_0x3cf843[_0x525d('0x5')]=_0x3e6091[_0x525d('0x5')];_0x3cf843[_0x525d('0x6')]=_0x3e6091[_0x525d('0x6')];if(_0x3cf843[_0x525d('0x3')])_0x3cf843[_0x525d('0x3')]=_0x3cf843[_0x525d('0x3')]['toLowerCase']();if(_0x3e6091['type']===_0x525d('0x10')){if(_0x3cf843[_0x525d('0x37')]('tag')&&_0x3cf843['tag']&&_0x3cf843[_0x525d('0x38')]!=='--'){_0x4c975f['push']({'type':_0x3cf843['type'][_0x525d('0x39')](),'app':_0x525d('0x4'),'appdata':_0x525d('0x3a')+_0x3cf843[_0x525d('0x38')],'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}_0x4c975f['push']({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':_0x525d('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3cf843[_0x525d('0x3b')]?_0x525d('0x3c')+_0x3cf843[_0x525d('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091['exten'],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}else{if(_0x3cf843[_0x525d('0x37')](_0x525d('0x3d'))){if(['queue',_0x525d('0x3e')][_0x525d('0x3f')](_0x3cf843[_0x525d('0x40')][_0x525d('0x39')]())&&_0x3cf843['appType']!==_0x525d('0x41')){if(_0x3cf843[_0x525d('0x3d')]){_0x4c975f[_0x525d('0xc')]({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':_0x525d('0x17'),'appdata':_0x525d('0x42'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091['exten'],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});_0x4c975f['push']({'type':_0x3cf843['type'][_0x525d('0x39')](),'app':'Set','appdata':_0x525d('0x43'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843['intervals']['length']+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}else{_0x4c975f[_0x525d('0xc')]({'type':_0x3cf843['type'][_0x525d('0x39')](),'app':_0x525d('0x17'),'appdata':_0x525d('0x44'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843['intervals'][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});_0x4c975f[_0x525d('0xc')]({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':'Set','appdata':_0x525d('0x45'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843['intervals'][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}}}}for(var _0x51ef08=0x0;_0x51ef08<_0x3cf843[_0x525d('0x35')][_0x525d('0x26')];_0x51ef08++){var _0x3dde2c=_0x2c9550+_0x3cf843[_0x525d('0x35')][_0x525d('0x26')];var _0x31b525=_0x51ef08===_0x3cf843[_0x525d('0x35')]['length']-0x1?_0x2c9550+_0x4c975f[_0x525d('0x26')]+_0x3a006e[_0x525d('0x26')]+0x2:_0x2c9550+_0x51ef08+0x1;_0x4c975f[_0x525d('0x46')](_0x51ef08,0x0,{'type':_0x3e6091['type'],'app':_0x525d('0x47'),'appdata':_0x3cf843[_0x525d('0x35')][_0x51ef08]+'?'+_0x3e6091[_0x525d('0x5')]+',${EXTEN},'+_0x3dde2c+':'+_0x3e6091['context']+_0x525d('0x48')+_0x31b525,'exten':_0x3e6091[_0x525d('0x6')],'context':_0x3e6091[_0x525d('0x5')],'priority':_0x2c9550+_0x51ef08,'VoiceExtensionId':_0x3e6091['id']});}if(_0x3cf843[_0x525d('0x49')]==='outboundDial'){_0x3cf843[_0x525d('0x4a')]=_0x218b6a(_0x3e6091,_0x3cf843['appdata']);}if(_0x3cf843[_0x525d('0x49')]===_0x525d('0x4b')){_0x4c975f['push']({'type':_0x3cf843[_0x525d('0x3')][_0x525d('0x39')](),'app':_0x525d('0x4'),'appdata':_0x525d('0x4c'),'context':_0x3e6091[_0x525d('0x5')],'exten':_0x3e6091[_0x525d('0x6')],'priority':_0x3cf843[_0x525d('0x35')][_0x525d('0x26')]+_0x2c9550+_0x458c94++,'VoiceExtensionId':_0x3e6091['id']});}_0x3cf843['priority']=_0x4c975f['length']?_['last'](_0x4c975f)[_0x525d('0x4d')]+0x1:_0x2c9550;_0x5bc4e2=_[_0x525d('0x4e')](_0x5bc4e2,_0x4c975f,[_0x3cf843],_0x3a006e);_0x2c9550=_['last'](_0x5bc4e2)[_0x525d('0x4d')]+0x1;}return _0x13e6a7(_0x5bc4e2);})['catch'](function(_0x98c1ef){_0x317b3b(_0x98c1ef);});});}return _0x5d7994[_0x525d('0x4f')]('VoiceExtension',attributes,{'tableName':_0x525d('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x387663){var _0x5a864f=this[_0x525d('0x51')]({'plain':!![]});var _0x492210=_0x5a864f[_0x525d('0x3')]===_0x525d('0x10')?_0x51dfca(_0x5a864f):_0x315f4e(_0x5a864f);return _0x3c7a2d(_0x5a864f,_0x387663,_['last'](_0x492210)[_0x525d('0x4d')]+0x1)[_0x525d('0x52')](function(_0xe75317){var _0x53295d=_['concat'](_0x492210,_0xe75317);_0x53295d[_0x525d('0xc')]({'type':_0x5a864f[_0x525d('0x3')],'app':_0x525d('0x53'),'exten':_0x5a864f[_0x525d('0x6')],'context':_0x5a864f[_0x525d('0x5')],'priority':_[_0x525d('0x54')](_0x53295d)[_0x525d('0x4d')]+0x1,'VoiceExtensionId':_0x5a864f['id']});return _0x53295d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3b79808..52b200b 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 _0x5e0c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceExtension','options','where','attributes','limit','include','model','stringify','util','moment','bluebird','randomstring','ioredis'];(function(_0x2e65ee,_0x29dad9){var _0x4c712a=function(_0xca593f){while(--_0xca593f){_0x2e65ee['push'](_0x2e65ee['shift']());}};_0x4c712a(++_0x29dad9);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x3217d3,_0xf66fcf){_0x3217d3=_0x3217d3-0x0;var _0x260f43=_0x5e0c[_0x3217d3];return _0x260f43;};'use strict';var _=require('lodash');var util=require(_0xc5e0('0x0'));var moment=require(_0xc5e0('0x1'));var BPromise=require(_0xc5e0('0x2'));var rs=require(_0xc5e0('0x3'));var fs=require('fs');var Redis=require(_0xc5e0('0x4'));var db=require(_0xc5e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5e0('0x6'))(_0xc5e0('0x7'));var config=require(_0xc5e0('0x8'));var jayson=require(_0xc5e0('0x9'));var client=jayson[_0xc5e0('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc5e0('0xb')](config['redis'],{'host':_0xc5e0('0xc'),'port':0x18eb});var socket=require(_0xc5e0('0xd'))(new Redis(config[_0xc5e0('0xe')]));require(_0xc5e0('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c12b8,_0x558bbd,_0x37627e){return new BPromise(function(_0x33d821,_0x1d3618){return client[_0xc5e0('0x10')](_0x2c12b8,_0x37627e)[_0xc5e0('0x11')](function(_0x44980b){logger['info'](_0xc5e0('0x12'),_0x558bbd,_0xc5e0('0x13'));logger[_0xc5e0('0x14')](_0xc5e0('0x15'),_0x558bbd,_0xc5e0('0x13'),JSON['stringify'](_0x44980b));if(_0x44980b[_0xc5e0('0x16')]){if(_0x44980b[_0xc5e0('0x16')]['code']===0x1f4){logger['error'](_0xc5e0('0x12'),_0x558bbd,_0x44980b['error']['message']);return _0x1d3618(_0x44980b[_0xc5e0('0x16')][_0xc5e0('0x17')]);}logger[_0xc5e0('0x16')](_0xc5e0('0x12'),_0x558bbd,_0x44980b[_0xc5e0('0x16')][_0xc5e0('0x17')]);return _0x33d821(_0x44980b[_0xc5e0('0x16')][_0xc5e0('0x17')]);}else{logger[_0xc5e0('0x18')](_0xc5e0('0x12'),_0x558bbd,_0xc5e0('0x13'));_0x33d821(_0x44980b[_0xc5e0('0x19')][_0xc5e0('0x17')]);}})[_0xc5e0('0x1a')](function(_0x5c534d){logger['error'](_0xc5e0('0x12'),_0x558bbd,_0x5c534d);_0x1d3618(_0x5c534d);});});}exports[_0xc5e0('0x1b')]=function(_0x3d7981){var _0x2dba3d=this;return new Promise(function(_0x4214b0,_0x106819){return db['VoiceExtension']['findAll']({'raw':_0x3d7981['options']?_0x3d7981[_0xc5e0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3d7981[_0xc5e0('0x1c')]?_0x3d7981[_0xc5e0('0x1c')][_0xc5e0('0x1d')]||null:null,'attributes':_0x3d7981[_0xc5e0('0x1c')]?_0x3d7981[_0xc5e0('0x1c')][_0xc5e0('0x1e')]||null:null,'limit':_0x3d7981[_0xc5e0('0x1c')]?_0x3d7981['options'][_0xc5e0('0x1f')]||null:null,'include':_0x3d7981['options']?_0x3d7981[_0xc5e0('0x1c')][_0xc5e0('0x20')]?_['map'](_0x3d7981['options']['include'],function(_0x30f734){return{'model':db[_0x30f734['model']],'as':_0x30f734['as'],'attributes':_0x30f734[_0xc5e0('0x1e')],'include':_0x30f734[_0xc5e0('0x20')]?_['map'](_0x30f734[_0xc5e0('0x20')],function(_0x331e07){return{'model':db[_0x331e07[_0xc5e0('0x21')]],'as':_0x331e07['as'],'attributes':_0x331e07[_0xc5e0('0x1e')],'include':_0x331e07['include']?_['map'](_0x331e07['include'],function(_0x4b30d9){return{'model':db[_0x4b30d9[_0xc5e0('0x21')]],'as':_0x4b30d9['as'],'attributes':_0x4b30d9['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5e0('0x11')](function(_0x19f77a){logger[_0xc5e0('0x18')](_0xc5e0('0x1b'),_0x3d7981);logger['debug'](_0xc5e0('0x1b'),_0x3d7981,JSON[_0xc5e0('0x22')](_0x19f77a));_0x4214b0(_0x19f77a);})['catch'](function(_0x40b717){logger[_0xc5e0('0x16')](_0xc5e0('0x1b'),_0x40b717[_0xc5e0('0x17')],_0x3d7981);_0x106819(_0x2dba3d[_0xc5e0('0x16')](0x1f4,_0x40b717[_0xc5e0('0x17')]));});});}; \ No newline at end of file +var _0xae30=['localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','request\x20sent','result','catch','findAll','options','where','limit','include','map','model','attributes','GetVoiceExtension','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xae30,0x10a));var _0x0ae3=function(_0x151ecd,_0x18ecb1){_0x151ecd=_0x151ecd-0x0;var _0x4c2325=_0xae30[_0x151ecd];return _0x4c2325;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var moment=require(_0x0ae3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae3('0x3'));var fs=require('fs');var Redis=require(_0x0ae3('0x4'));var db=require(_0x0ae3('0x5'))['db'];var utils=require(_0x0ae3('0x6'));var logger=require('../../config/logger')(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var jayson=require(_0x0ae3('0x9'));var client=jayson[_0x0ae3('0xa')][_0x0ae3('0xb')]({'port':0x232a});config[_0x0ae3('0xc')]=_[_0x0ae3('0xd')](config[_0x0ae3('0xc')],{'host':_0x0ae3('0xe'),'port':0x18eb});var socket=require(_0x0ae3('0xf'))(new Redis(config[_0x0ae3('0xc')]));require(_0x0ae3('0x10'))[_0x0ae3('0x11')](socket);function respondWithRpcPromise(_0x49e0a5,_0x98ab46,_0xee8a4c){return new BPromise(function(_0x5b70dd,_0x4a012d){return client[_0x0ae3('0x12')](_0x49e0a5,_0xee8a4c)[_0x0ae3('0x13')](function(_0xeca9e6){logger[_0x0ae3('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x98ab46,'request\x20sent');logger[_0x0ae3('0x15')](_0x0ae3('0x16'),_0x98ab46,'request\x20sent',JSON['stringify'](_0xeca9e6));if(_0xeca9e6[_0x0ae3('0x17')]){if(_0xeca9e6['error'][_0x0ae3('0x18')]===0x1f4){logger[_0x0ae3('0x17')](_0x0ae3('0x19'),_0x98ab46,_0xeca9e6[_0x0ae3('0x17')][_0x0ae3('0x1a')]);return _0x4a012d(_0xeca9e6[_0x0ae3('0x17')][_0x0ae3('0x1a')]);}logger['error'](_0x0ae3('0x19'),_0x98ab46,_0xeca9e6['error'][_0x0ae3('0x1a')]);return _0x5b70dd(_0xeca9e6[_0x0ae3('0x17')][_0x0ae3('0x1a')]);}else{logger[_0x0ae3('0x14')](_0x0ae3('0x19'),_0x98ab46,_0x0ae3('0x1b'));_0x5b70dd(_0xeca9e6[_0x0ae3('0x1c')][_0x0ae3('0x1a')]);}})[_0x0ae3('0x1d')](function(_0x5f15eb){logger[_0x0ae3('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x98ab46,_0x5f15eb);_0x4a012d(_0x5f15eb);});});}exports['GetVoiceExtension']=function(_0x571135){var _0x4ac074=this;return new Promise(function(_0x54ff97,_0x4e8135){return db['VoiceExtension'][_0x0ae3('0x1e')]({'raw':_0x571135[_0x0ae3('0x1f')]?_0x571135[_0x0ae3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x571135[_0x0ae3('0x1f')]?_0x571135['options'][_0x0ae3('0x20')]||null:null,'attributes':_0x571135['options']?_0x571135['options']['attributes']||null:null,'limit':_0x571135[_0x0ae3('0x1f')]?_0x571135[_0x0ae3('0x1f')][_0x0ae3('0x21')]||null:null,'include':_0x571135['options']?_0x571135['options'][_0x0ae3('0x22')]?_[_0x0ae3('0x23')](_0x571135['options'][_0x0ae3('0x22')],function(_0x1613c3){return{'model':db[_0x1613c3[_0x0ae3('0x24')]],'as':_0x1613c3['as'],'attributes':_0x1613c3['attributes'],'include':_0x1613c3[_0x0ae3('0x22')]?_[_0x0ae3('0x23')](_0x1613c3[_0x0ae3('0x22')],function(_0x5303f6){return{'model':db[_0x5303f6[_0x0ae3('0x24')]],'as':_0x5303f6['as'],'attributes':_0x5303f6[_0x0ae3('0x25')],'include':_0x5303f6[_0x0ae3('0x22')]?_['map'](_0x5303f6[_0x0ae3('0x22')],function(_0x247623){return{'model':db[_0x247623[_0x0ae3('0x24')]],'as':_0x247623['as'],'attributes':_0x247623[_0x0ae3('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0ae3('0x13')](function(_0x10a7bd){logger[_0x0ae3('0x14')](_0x0ae3('0x26'),_0x571135);logger[_0x0ae3('0x15')](_0x0ae3('0x26'),_0x571135,JSON[_0x0ae3('0x27')](_0x10a7bd));_0x54ff97(_0x10a7bd);})[_0x0ae3('0x1d')](function(_0x23f213){logger[_0x0ae3('0x17')](_0x0ae3('0x26'),_0x23f213['message'],_0x571135);_0x4e8135(_0x4ac074[_0x0ae3('0x17')](0x1f4,_0x23f213[_0x0ae3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 5eca97f..1b581ce 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x2eb82f,_0x410483){var _0xe395be=function(_0x78ddd7){while(--_0x78ddd7){_0x2eb82f['push'](_0x2eb82f['shift']());}};_0xe395be(++_0x410483);}(_0xe14b,0x93));var _0xbe14=function(_0x40d198,_0x389271){_0x40d198=_0x40d198-0x0;var _0x5c2dc3=_0xe14b[_0x40d198];return _0x5c2dc3;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x3cf175,_0x39ab6f){var _0x52a067=function(_0x27a4ee){while(--_0x27a4ee){_0x3cf175['push'](_0x3cf175['shift']());}};_0x52a067(++_0x39ab6f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 3485ff1..1be28fa 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 _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','getMessages','post','create','put','delete','exports'];(function(_0x2ec94a,_0x211406){var _0x5e4c25=function(_0x193d44){while(--_0x193d44){_0x2ec94a['push'](_0x2ec94a['shift']());}};_0x5e4c25(++_0x211406);}(_0x326f,0xd1));var _0xf326=function(_0x1879ff,_0x23cc02){_0x1879ff=_0x1879ff-0x0;var _0x467cd0=_0x326f[_0x1879ff];return _0x467cd0;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x583c=['fs-extra','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','getMessages','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x1c101f,_0x52141d){var _0xe02ee4=function(_0x1d9034){while(--_0x1d9034){_0x1c101f['push'](_0x1c101f['shift']());}};_0xe02ee4(++_0x52141d);}(_0x583c,0x12b));var _0xc583=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x583c[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var fs_extra=require(_0xc583('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc583('0x6'));var controller=require(_0xc583('0x7'));router['get']('/',auth[_0xc583('0x8')](),controller[_0xc583('0x9')]);router[_0xc583('0xa')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xa')]('/:id/messages',auth[_0xc583('0x8')](),controller[_0xc583('0xd')]);router[_0xc583('0xe')]('/',auth[_0xc583('0x8')](),controller[_0xc583('0xf')]);router['put'](_0xc583('0xb'),auth[_0xc583('0x8')](),controller['update']);router[_0xc583('0x10')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0x11')]);module[_0xc583('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 489b637..62ff431 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 _0x8994=['yes','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM'];(function(_0x1b0383,_0x3d6079){var _0x5bfc57=function(_0x5b0843){while(--_0x5b0843){_0x1b0383['push'](_0x1b0383['shift']());}};_0x5bfc57(++_0x3d6079);}(_0x8994,0x1b9));var _0x4899=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x8994[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0x4899('0x0'));module[_0x4899('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4899('0x2')],'defaultValue':_0x4899('0x3'),'unique':_0x4899('0x4')},'mailbox':{'type':Sequelize[_0x4899('0x2')],'defaultValue':'','allowNull':![],'unique':_0x4899('0x4')},'password':{'type':Sequelize[_0x4899('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4899('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2de59a){this['setDataValue'](_0x4899('0x5'),typeof _0x2de59a==='string'&&_0x2de59a[_0x4899('0x6')]()?_0x2de59a['trim']():null);}},'pager':{'type':Sequelize[_0x4899('0x2')]},'tz':{'type':Sequelize[_0x4899('0x2')],'defaultValue':_0x4899('0x7')},'attach':{'type':Sequelize[_0x4899('0x8')]('yes','no'),'defaultValue':_0x4899('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4899('0x8')](_0x4899('0x9'),'no'),'defaultValue':_0x4899('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4899('0x2')]},'callback':{'type':Sequelize[_0x4899('0x2')]},'review':{'type':Sequelize[_0x4899('0x8')](_0x4899('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x4899('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4899('0x8')](_0x4899('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4899('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4899('0x8')](_0x4899('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4899('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4899('0x8')](_0x4899('0x9'),'no'),'defaultValue':_0x4899('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4899('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4899('0x8')](_0x4899('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4899('0x8')]('yes','no'),'defaultValue':_0x4899('0x9'),'allowNull':![]},'stamp':{'type':_0x4899('0xa')},'emailsubject':{'type':Sequelize[_0x4899('0x2')]},'emailbody':{'type':Sequelize[_0x4899('0x2')]},'maxsecs':{'type':Sequelize[_0x4899('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4899('0xc')],'get':function(){return this['getDataValue']('fullname')+_0x4899('0xd')+this['getDataValue'](_0x4899('0xe'));}}}; \ No newline at end of file +var _0x4717=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x49da91,_0x423bda){var _0xd6a44e=function(_0x4d2020){while(--_0x4d2020){_0x49da91['push'](_0x49da91['shift']());}};_0xd6a44e(++_0x423bda);}(_0x4717,0x183));var _0x7471=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4717[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7471('0x0'));module[_0x7471('0x1')]={'customer_id':{'type':Sequelize[_0x7471('0x2')]},'context':{'type':Sequelize[_0x7471('0x2')],'defaultValue':_0x7471('0x3'),'unique':_0x7471('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x7471('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x7471('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1ddf5e){this[_0x7471('0x5')](_0x7471('0x6'),typeof _0x1ddf5e===_0x7471('0x7')&&_0x1ddf5e['trim']()?_0x1ddf5e[_0x7471('0x8')]():null);}},'pager':{'type':Sequelize[_0x7471('0x2')]},'tz':{'type':Sequelize[_0x7471('0x2')],'defaultValue':_0x7471('0x9')},'attach':{'type':Sequelize['ENUM'](_0x7471('0xa'),'no'),'defaultValue':_0x7471('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7471('0xb')](_0x7471('0xa'),'no'),'defaultValue':_0x7471('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7471('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x7471('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7471('0xb')](_0x7471('0xa'),'no'),'defaultValue':_0x7471('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x7471('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7471('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7471('0xb')](_0x7471('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x7471('0xd')},'emailsubject':{'type':Sequelize[_0x7471('0x2')]},'emailbody':{'type':Sequelize[_0x7471('0x2')]},'maxsecs':{'type':Sequelize[_0x7471('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7471('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7471('0xf')],'get':function(){return this[_0x7471('0x10')](_0x7471('0x11'))+_0x7471('0x12')+this['getDataValue'](_0x7471('0x13'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 29c055b..8ae2f6e 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 _0xbdb7=['map','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','fields','include','find','create','body','role','user','get','Voicemails','UserProfileSection','userProfileId','autoAssociation','destroy','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName'];(function(_0x1b88e7,_0xfa5647){var _0x941987=function(_0x28abd4){while(--_0x28abd4){_0x1b88e7['push'](_0x1b88e7['shift']());}};_0x941987(++_0xfa5647);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x27c7b2,_0x3c8adc){_0x27c7b2=_0x27c7b2-0x0;var _0x33829e=_0xbdb7[_0x27c7b2];return _0x33829e;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){var _0x3c423f=_0x3a456f['get']({'plain':!![]});var _0x47abaf='Voicemails';return db[_0x7bdb('0x23')]['destroy']({'where':{'type':_0x47abaf,'resourceId':_0x3c423f['id']}})[_0x7bdb('0x24')](function(){return _0x3a456f;});})[_0x7bdb('0x24')](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)[_0x7bdb('0x17')]();});}};}function handleEntityNotFound(_0x2a494e,_0x523869){return function(_0x10e818){if(!_0x10e818){_0x2a494e[_0x7bdb('0x25')](0x194);}return _0x10e818;};}function handleError(_0x399b62,_0xe1141d){_0xe1141d=_0xe1141d||0x1f4;return function(_0x371e8a){logger[_0x7bdb('0x26')](_0x371e8a[_0x7bdb('0x27')]);if(_0x371e8a[_0x7bdb('0x28')]){delete _0x371e8a[_0x7bdb('0x28')];}_0x399b62[_0x7bdb('0x1d')](_0xe1141d)[_0x7bdb('0x29')](_0x371e8a);};}exports[_0x7bdb('0x2a')]=function(_0x5b386d,_0x388a45){var _0x23fc3a={},_0x8f7672={},_0x9f5c1={'count':0x0,'rows':[]};var _0x29eac5=_['map'](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')],function(_0x9ac56){return{'name':_0x9ac56[_0x7bdb('0x2d')],'type':_0x9ac56['type']['key']};});_0x8f7672['model']=_[_0x7bdb('0x2e')](_0x29eac5,'name');_0x8f7672[_0x7bdb('0x2f')]=_['keys'](_0x5b386d[_0x7bdb('0x2f')]);_0x8f7672[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x8f7672['model'],_0x8f7672[_0x7bdb('0x2f')]);_0x23fc3a['attributes']=_['intersection'](_0x8f7672[_0x7bdb('0x32')],qs['fields'](_0x5b386d[_0x7bdb('0x2f')]['fields']));_0x23fc3a['attributes']=_0x23fc3a[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x23fc3a[_0x7bdb('0x33')]:_0x8f7672[_0x7bdb('0x32')];if(!_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x35')]('nolimit')){_0x23fc3a[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);_0x23fc3a[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x19')]);}_0x23fc3a[_0x7bdb('0x36')]=qs['sort'](_0x5b386d['query'][_0x7bdb('0x37')]);_0x23fc3a[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x5b386d[_0x7bdb('0x2f')],_0x8f7672['filters']),_0x29eac5);if(_0x5b386d['query'][_0x7bdb('0x3a')]){_0x23fc3a['where']=_[_0x7bdb('0x3b')](_0x23fc3a['where'],{'$or':_[_0x7bdb('0x2e')](_0x29eac5,function(_0x5d1826){if(_0x5d1826['type']!==_0x7bdb('0x3c')){var _0x2d578e={};_0x2d578e[_0x5d1826[_0x7bdb('0x28')]]={'$like':'%'+_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x2d578e;}})});}_0x23fc3a=_[_0x7bdb('0x3b')]({},_0x23fc3a,_0x5b386d[_0x7bdb('0x3d')]);var _0x501aff={'where':_0x23fc3a['where']};return db[_0x7bdb('0x2b')][_0x7bdb('0x1c')](_0x501aff)[_0x7bdb('0x24')](function(_0x3509e4){_0x9f5c1[_0x7bdb('0x1c')]=_0x3509e4;if(_0x5b386d[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x23fc3a['include']=[{'all':!![]}];}return db['VoiceMail'][_0x7bdb('0x3f')](_0x23fc3a);})[_0x7bdb('0x24')](function(_0x4636f8){_0x9f5c1[_0x7bdb('0x40')]=_0x4636f8;return _0x9f5c1;})['then'](respondWithFilteredResult(_0x388a45,_0x23fc3a))[_0x7bdb('0x41')](handleError(_0x388a45,null));};exports['show']=function(_0x37029b,_0x27de25){var _0x218361={'raw':!![],'where':{'id':_0x37029b[_0x7bdb('0x42')]['id']}},_0x264f3a={};_0x264f3a[_0x7bdb('0x32')]=_[_0x7bdb('0x43')](db[_0x7bdb('0x2b')][_0x7bdb('0x2c')]);_0x264f3a['query']=_[_0x7bdb('0x43')](_0x37029b[_0x7bdb('0x2f')]);_0x264f3a['filters']=_[_0x7bdb('0x31')](_0x264f3a['model'],_0x264f3a[_0x7bdb('0x2f')]);_0x218361[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x264f3a[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x37029b['query'][_0x7bdb('0x44')]));_0x218361[_0x7bdb('0x33')]=_0x218361[_0x7bdb('0x33')][_0x7bdb('0x34')]?_0x218361[_0x7bdb('0x33')]:_0x264f3a['model'];if(_0x37029b[_0x7bdb('0x2f')][_0x7bdb('0x3e')]){_0x218361[_0x7bdb('0x45')]=[{'all':!![]}];}_0x218361=_[_0x7bdb('0x3b')]({},_0x218361,_0x37029b[_0x7bdb('0x3d')]);return db[_0x7bdb('0x2b')][_0x7bdb('0x46')](_0x218361)[_0x7bdb('0x24')](handleEntityNotFound(_0x27de25,null))[_0x7bdb('0x24')](respondWithResult(_0x27de25,null))[_0x7bdb('0x41')](handleError(_0x27de25,null));};exports['create']=function(_0x189cf8,_0x58c4bc){return db['VoiceMail'][_0x7bdb('0x47')](_0x189cf8[_0x7bdb('0x48')],{})['then'](function(_0x37780a){var _0x186809=_0x189cf8['user']['get']({'plain':!![]});if(!_0x186809)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x186809[_0x7bdb('0x49')]===_0x7bdb('0x4a')){var _0x2fab74=_0x37780a[_0x7bdb('0x4b')]({'plain':!![]});var _0x33687b=_0x7bdb('0x4c');return db[_0x7bdb('0x4d')][_0x7bdb('0x46')]({'where':{'name':_0x33687b,'userProfileId':_0x186809[_0x7bdb('0x4e')]},'raw':!![]})[_0x7bdb('0x24')](function(_0x5a8d4a){if(_0x5a8d4a&&_0x5a8d4a[_0x7bdb('0x4f')]===0x0){return db['UserProfileResource'][_0x7bdb('0x47')]({'name':_0x2fab74[_0x7bdb('0x28')],'resourceId':_0x2fab74['id'],'type':_0x5a8d4a[_0x7bdb('0x28')],'sectionId':_0x5a8d4a['id']},{})[_0x7bdb('0x24')](function(){return _0x37780a;});}else{return _0x37780a;}})['catch'](function(_0x258f29){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258f29);throw _0x258f29;});}return _0x37780a;})[_0x7bdb('0x24')](respondWithResult(_0x58c4bc,0xc9))[_0x7bdb('0x41')](handleError(_0x58c4bc,null));};exports['update']=function(_0x4e17f3,_0x49bb3f){if(_0x4e17f3[_0x7bdb('0x48')]['id']){delete _0x4e17f3['body']['id'];}return db['VoiceMail'][_0x7bdb('0x46')]({'where':{'id':_0x4e17f3[_0x7bdb('0x42')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x49bb3f,null))[_0x7bdb('0x24')](saveUpdates(_0x4e17f3['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x49bb3f,null))['catch'](handleError(_0x49bb3f,null));};exports[_0x7bdb('0x50')]=function(_0x7f2d89,_0x82f990){return db[_0x7bdb('0x2b')][_0x7bdb('0x46')]({'where':{'id':_0x7f2d89[_0x7bdb('0x42')]['id']}})['then'](handleEntityNotFound(_0x82f990,null))[_0x7bdb('0x24')](removeEntity(_0x82f990,null))[_0x7bdb('0x41')](handleError(_0x82f990,null));};exports[_0x7bdb('0x51')]=function(_0x58658e,_0x2b5493,_0x1d9927){return db['VoiceMail'][_0x7bdb('0x52')]({'where':{'id':_0x58658e['params']['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2b5493,null))[_0x7bdb('0x24')](function(_0x4f3f8c){var _0x478bbd;var _0x21a54f={},_0x2a6c5b={};_0x2a6c5b['model']=_[_0x7bdb('0x43')](db['VoiceMailMessage'][_0x7bdb('0x2c')]);_0x2a6c5b['query']=_['keys'](_0x58658e[_0x7bdb('0x2f')]);_0x2a6c5b[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x2a6c5b[_0x7bdb('0x32')],_0x2a6c5b[_0x7bdb('0x2f')]);_0x21a54f[_0x7bdb('0x33')]=_[_0x7bdb('0x31')](_0x2a6c5b[_0x7bdb('0x32')],qs[_0x7bdb('0x44')](_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x44')]));_0x21a54f[_0x7bdb('0x33')]=_0x21a54f['attributes'][_0x7bdb('0x34')]?_0x21a54f[_0x7bdb('0x33')]:_0x2a6c5b['model'];if(!_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x35')](_0x7bdb('0x53'))){_0x21a54f[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x58658e['query'][_0x7bdb('0x1b')]);_0x21a54f[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x58658e['query'][_0x7bdb('0x19')]);}_0x21a54f[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x37')]);_0x21a54f[_0x7bdb('0x38')]=qs[_0x7bdb('0x30')](_[_0x7bdb('0x39')](_0x58658e[_0x7bdb('0x2f')],_0x2a6c5b['filters']));if(_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x3a')]){_0x21a54f[_0x7bdb('0x38')]=_[_0x7bdb('0x3b')](_0x21a54f[_0x7bdb('0x38')],{'$or':_[_0x7bdb('0x2e')](_0x21a54f[_0x7bdb('0x33')],function(_0x86c6ed){var _0x4565c2={};_0x4565c2[_0x86c6ed]={'$like':'%'+_0x58658e[_0x7bdb('0x2f')][_0x7bdb('0x3a')]+'%'};return _0x4565c2;})});}_0x21a54f[_0x7bdb('0x38')]=_[_0x7bdb('0x3b')](_0x21a54f['where'],{'mailboxuser':_0x4f3f8c[_0x7bdb('0x54')]});_0x21a54f=_['merge']({},_0x21a54f,_0x58658e[_0x7bdb('0x3d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x56')](_0x21a54f)['then'](respondWithFilteredResult(_0x2b5493,_0x21a54f));})[_0x7bdb('0x41')](handleError(_0x2b5493,null));}; \ No newline at end of file +var _0x7072=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields'];(function(_0x3b5fb7,_0x3a7e43){var _0x4db635=function(_0x5c5a42){while(--_0x5c5a42){_0x3b5fb7['push'](_0x3b5fb7['shift']());}};_0x4db635(++_0x3a7e43);}(_0x7072,0x138));var _0x2707=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x7072[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){var _0x4831ed=_0x369e3a[_0x2707('0x2a')]({'plain':!![]});var _0x3f6976=_0x2707('0x2b');return db[_0x2707('0x2c')][_0x2707('0x28')]({'where':{'type':_0x3f6976,'resourceId':_0x4831ed['id']}})['then'](function(){return _0x369e3a;});})[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x34dc4e,_0x2aa3fe){return function(_0x57da26){if(!_0x57da26){_0x34dc4e[_0x2707('0x1a')](0x194);}return _0x57da26;};}function handleError(_0x14daf8,_0x2c7047){_0x2c7047=_0x2c7047||0x1f4;return function(_0x529be8){logger[_0x2707('0x2d')](_0x529be8[_0x2707('0x2e')]);if(_0x529be8['name']){delete _0x529be8[_0x2707('0x2f')];}_0x14daf8['status'](_0x2c7047)['send'](_0x529be8);};}exports[_0x2707('0x30')]=function(_0x4e0c93,_0x2a0d24){var _0x3f153d={},_0x417a97={},_0x36b2e9={'count':0x0,'rows':[]};var _0x48832b=_[_0x2707('0x31')](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x154799){return{'name':_0x154799[_0x2707('0x34')],'type':_0x154799[_0x2707('0x35')][_0x2707('0x36')]};});_0x417a97[_0x2707('0x37')]=_[_0x2707('0x31')](_0x48832b,'name');_0x417a97[_0x2707('0x38')]=_[_0x2707('0x39')](_0x4e0c93['query']);_0x417a97['filters']=_['intersection'](_0x417a97['model'],_0x417a97['query']);_0x3f153d[_0x2707('0x3a')]=_['intersection'](_0x417a97['model'],qs[_0x2707('0x3b')](_0x4e0c93[_0x2707('0x38')]['fields']));_0x3f153d[_0x2707('0x3a')]=_0x3f153d[_0x2707('0x3a')]['length']?_0x3f153d['attributes']:_0x417a97[_0x2707('0x37')];if(!_0x4e0c93[_0x2707('0x38')]['hasOwnProperty']('nolimit')){_0x3f153d[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x4e0c93['query'][_0x2707('0x1f')]);_0x3f153d[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x4e0c93[_0x2707('0x38')][_0x2707('0x1d')]);}_0x3f153d[_0x2707('0x3c')]=qs['sort'](_0x4e0c93[_0x2707('0x38')][_0x2707('0x3d')]);_0x3f153d[_0x2707('0x3e')]=qs[_0x2707('0x3f')](_[_0x2707('0x40')](_0x4e0c93[_0x2707('0x38')],_0x417a97[_0x2707('0x3f')]),_0x48832b);if(_0x4e0c93['query'][_0x2707('0x41')]){_0x3f153d[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x3f153d[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x48832b,function(_0xc7119d){if(_0xc7119d[_0x2707('0x35')]!==_0x2707('0x43')){var _0x2f06f8={};_0x2f06f8[_0xc7119d[_0x2707('0x2f')]]={'$like':'%'+_0x4e0c93[_0x2707('0x38')][_0x2707('0x41')]+'%'};return _0x2f06f8;}})});}_0x3f153d=_[_0x2707('0x42')]({},_0x3f153d,_0x4e0c93[_0x2707('0x44')]);var _0x36c8ab={'where':_0x3f153d[_0x2707('0x3e')]};return db['VoiceMail'][_0x2707('0x20')](_0x36c8ab)[_0x2707('0x29')](function(_0x5053ba){_0x36b2e9[_0x2707('0x20')]=_0x5053ba;if(_0x4e0c93['query'][_0x2707('0x45')]){_0x3f153d[_0x2707('0x46')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x47')](_0x3f153d);})[_0x2707('0x29')](function(_0xdeec24){_0x36b2e9[_0x2707('0x48')]=_0xdeec24;return _0x36b2e9;})['then'](respondWithFilteredResult(_0x2a0d24,_0x3f153d))[_0x2707('0x49')](handleError(_0x2a0d24,null));};exports[_0x2707('0x4a')]=function(_0x4c8dbf,_0x3d25ea){var _0x6defc2={'raw':!![],'where':{'id':_0x4c8dbf['params']['id']}},_0x3b38d7={};_0x3b38d7['model']=_[_0x2707('0x39')](db[_0x2707('0x32')]['rawAttributes']);_0x3b38d7[_0x2707('0x38')]=_['keys'](_0x4c8dbf[_0x2707('0x38')]);_0x3b38d7[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],_0x3b38d7['query']);_0x6defc2[_0x2707('0x3a')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x4c8dbf[_0x2707('0x38')][_0x2707('0x3b')]));_0x6defc2[_0x2707('0x3a')]=_0x6defc2['attributes'][_0x2707('0x4c')]?_0x6defc2[_0x2707('0x3a')]:_0x3b38d7[_0x2707('0x37')];if(_0x4c8dbf[_0x2707('0x38')][_0x2707('0x45')]){_0x6defc2['include']=[{'all':!![]}];}_0x6defc2=_[_0x2707('0x42')]({},_0x6defc2,_0x4c8dbf['options']);return db[_0x2707('0x32')][_0x2707('0x4d')](_0x6defc2)['then'](handleEntityNotFound(_0x3d25ea,null))[_0x2707('0x29')](respondWithResult(_0x3d25ea,null))[_0x2707('0x49')](handleError(_0x3d25ea,null));};exports[_0x2707('0x4e')]=function(_0x4ae196,_0x1a8034){return db['VoiceMail'][_0x2707('0x4e')](_0x4ae196[_0x2707('0x4f')],{})['then'](function(_0x2b1746){var _0xffe740=_0x4ae196[_0x2707('0x50')]['get']({'plain':!![]});if(!_0xffe740)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffe740[_0x2707('0x51')]===_0x2707('0x50')){var _0x292b44=_0x2b1746[_0x2707('0x2a')]({'plain':!![]});var _0x463bf='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x463bf,'userProfileId':_0xffe740[_0x2707('0x52')]},'raw':!![]})[_0x2707('0x29')](function(_0x2e11fc){if(_0x2e11fc&&_0x2e11fc[_0x2707('0x53')]===0x0){return db[_0x2707('0x2c')]['create']({'name':_0x292b44[_0x2707('0x2f')],'resourceId':_0x292b44['id'],'type':_0x2e11fc[_0x2707('0x2f')],'sectionId':_0x2e11fc['id']},{})['then'](function(){return _0x2b1746;});}else{return _0x2b1746;}})['catch'](function(_0x3b41b2){logger[_0x2707('0x2d')](_0x2707('0x54'),_0x3b41b2);throw _0x3b41b2;});}return _0x2b1746;})['then'](respondWithResult(_0x1a8034,0xc9))[_0x2707('0x49')](handleError(_0x1a8034,null));};exports[_0x2707('0x27')]=function(_0x2a2a71,_0x29a453){if(_0x2a2a71['body']['id']){delete _0x2a2a71[_0x2707('0x4f')]['id'];}return db[_0x2707('0x32')][_0x2707('0x4d')]({'where':{'id':_0x2a2a71[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x29a453,null))[_0x2707('0x29')](saveUpdates(_0x2a2a71[_0x2707('0x4f')],null))[_0x2707('0x29')](respondWithResult(_0x29a453,null))[_0x2707('0x49')](handleError(_0x29a453,null));};exports[_0x2707('0x28')]=function(_0x4f2b54,_0x38acdd){return db['VoiceMail']['find']({'where':{'id':_0x4f2b54[_0x2707('0x55')]['id']}})['then'](handleEntityNotFound(_0x38acdd,null))['then'](removeEntity(_0x38acdd,null))[_0x2707('0x49')](handleError(_0x38acdd,null));};exports[_0x2707('0x56')]=function(_0x185bd3,_0x154e26,_0x3f82de){return db[_0x2707('0x32')][_0x2707('0x57')]({'where':{'id':_0x185bd3[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x154e26,null))[_0x2707('0x29')](function(_0x40c333){var _0x5852bd;var _0x4c4568={},_0x4a3a35={};_0x4a3a35[_0x2707('0x37')]=_[_0x2707('0x39')](db[_0x2707('0x58')]['rawAttributes']);_0x4a3a35['query']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x38')]);_0x4a3a35[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],_0x4a3a35['query']);_0x4c4568['attributes']=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x185bd3[_0x2707('0x38')][_0x2707('0x3b')]));_0x4c4568[_0x2707('0x3a')]=_0x4c4568[_0x2707('0x3a')][_0x2707('0x4c')]?_0x4c4568[_0x2707('0x3a')]:_0x4a3a35['model'];if(!_0x185bd3[_0x2707('0x38')][_0x2707('0x59')](_0x2707('0x5a'))){_0x4c4568[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x185bd3[_0x2707('0x38')]['limit']);_0x4c4568['offset']=qs[_0x2707('0x1d')](_0x185bd3[_0x2707('0x38')]['offset']);}_0x4c4568['order']=qs['sort'](_0x185bd3['query'][_0x2707('0x3d')]);_0x4c4568[_0x2707('0x3e')]=qs['filters'](_[_0x2707('0x40')](_0x185bd3[_0x2707('0x38')],_0x4a3a35[_0x2707('0x3f')]));if(_0x185bd3['query']['filter']){_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x4c4568[_0x2707('0x3a')],function(_0xdb1de0){var _0x3973a0={};_0x3973a0[_0xdb1de0]={'$like':'%'+_0x185bd3['query'][_0x2707('0x41')]+'%'};return _0x3973a0;})});}_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'mailboxuser':_0x40c333[_0x2707('0x5b')]});_0x4c4568=_[_0x2707('0x42')]({},_0x4c4568,_0x185bd3['options']);return db[_0x2707('0x58')][_0x2707('0x5c')](_0x4c4568)[_0x2707('0x29')](respondWithFilteredResult(_0x154e26,_0x4c4568));})[_0x2707('0x49')](handleError(_0x154e26,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c6c86da..3cd8fa2 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 _0x930e=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','api'];(function(_0x43f09a,_0x450cd8){var _0x899278=function(_0x3b0576){while(--_0x3b0576){_0x43f09a['push'](_0x43f09a['shift']());}};_0x899278(++_0x450cd8);}(_0x930e,0xfd));var _0xe930=function(_0x1dd3f8,_0x1a4be7){_0x1dd3f8=_0x1dd3f8-0x0;var _0x1b1bce=_0x930e[_0x1dd3f8];return _0x1b1bce;};'use strict';var _=require(_0xe930('0x0'));var util=require('util');var logger=require(_0xe930('0x1'))(_0xe930('0x2'));var moment=require(_0xe930('0x3'));var BPromise=require(_0xe930('0x4'));var rp=require(_0xe930('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe930('0x6'));var config=require(_0xe930('0x7'));var attributes=require(_0xe930('0x8'));module[_0xe930('0x9')]=function(_0x5e4be0,_0x198dbd){return _0x5e4be0[_0xe930('0xa')](_0xe930('0xb'),attributes,{'tableName':_0xe930('0xc'),'paranoid':![],'indexes':[{'name':_0xe930('0xd'),'fields':[_0xe930('0xe'),_0xe930('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf0d2=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash'];(function(_0x326dfd,_0x2e0ac3){var _0x4e06eb=function(_0x5a59f8){while(--_0x5a59f8){_0x326dfd['push'](_0x326dfd['shift']());}};_0x4e06eb(++_0x2e0ac3);}(_0xf0d2,0x8f));var _0x2f0d=function(_0x45e79b,_0x88488a){_0x45e79b=_0x45e79b-0x0;var _0x5635c6=_0xf0d2[_0x45e79b];return _0x5635c6;};'use strict';var _=require(_0x2f0d('0x0'));var util=require(_0x2f0d('0x1'));var logger=require(_0x2f0d('0x2'))(_0x2f0d('0x3'));var moment=require(_0x2f0d('0x4'));var BPromise=require('bluebird');var rp=require(_0x2f0d('0x5'));var fs=require('fs');var path=require(_0x2f0d('0x6'));var rimraf=require(_0x2f0d('0x7'));var config=require(_0x2f0d('0x8'));var attributes=require(_0x2f0d('0x9'));module[_0x2f0d('0xa')]=function(_0x35d534,_0x415ca2){return _0x35d534[_0x2f0d('0xb')](_0x2f0d('0xc'),attributes,{'tableName':_0x2f0d('0xd'),'paranoid':![],'indexes':[{'name':_0x2f0d('0xe'),'fields':['mailbox',_0x2f0d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b02f023..6330088 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 _0x2212=['info','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x482943,_0x122def){var _0x963d41=function(_0x231b08){while(--_0x231b08){_0x482943['push'](_0x482943['shift']());}};_0x963d41(++_0x122def);}(_0x2212,0xc8));var _0x2221=function(_0x34cd1f,_0x70083f){_0x34cd1f=_0x34cd1f-0x0;var _0x4b0c61=_0x2212[_0x34cd1f];return _0x4b0c61;};'use strict';var _=require('lodash');var util=require(_0x2221('0x0'));var moment=require(_0x2221('0x1'));var BPromise=require('bluebird');var rs=require(_0x2221('0x2'));var fs=require('fs');var Redis=require(_0x2221('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2221('0x4'));var logger=require(_0x2221('0x5'))(_0x2221('0x6'));var config=require(_0x2221('0x7'));var jayson=require(_0x2221('0x8'));var client=jayson['client'][_0x2221('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x394d9d,_0x3a119d,_0xfb5325){return new BPromise(function(_0x20845a,_0x2676d1){return client['request'](_0x394d9d,_0xfb5325)[_0x2221('0xa')](function(_0x144403){logger['info'](_0x2221('0xb'),_0x3a119d,_0x2221('0xc'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3a119d,_0x2221('0xc'),JSON[_0x2221('0xd')](_0x144403));if(_0x144403[_0x2221('0xe')]){if(_0x144403['error']['code']===0x1f4){logger[_0x2221('0xe')](_0x2221('0xb'),_0x3a119d,_0x144403['error'][_0x2221('0xf')]);return _0x2676d1(_0x144403[_0x2221('0xe')][_0x2221('0xf')]);}logger[_0x2221('0xe')]('VoiceMail,\x20%s,\x20%s',_0x3a119d,_0x144403[_0x2221('0xe')]['message']);return _0x20845a(_0x144403['error'][_0x2221('0xf')]);}else{logger[_0x2221('0x10')]('VoiceMail,\x20%s,\x20%s',_0x3a119d,'request\x20sent');_0x20845a(_0x144403['result'][_0x2221('0xf')]);}})[_0x2221('0x11')](function(_0xeb224c){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3a119d,_0xeb224c);_0x2676d1(_0xeb224c);});});} \ No newline at end of file +var _0xbde6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x122b89,_0x2fca71){var _0x2069f9=function(_0x9b4ce3){while(--_0x9b4ce3){_0x122b89['push'](_0x122b89['shift']());}};_0x2069f9(++_0x2fca71);}(_0xbde6,0xca));var _0x6bde=function(_0x523977,_0x1e0fe5){_0x523977=_0x523977-0x0;var _0xd4b2c6=_0xbde6[_0x523977];return _0xd4b2c6;};'use strict';var _=require(_0x6bde('0x0'));var util=require(_0x6bde('0x1'));var moment=require(_0x6bde('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bde('0x3'));var fs=require('fs');var Redis=require(_0x6bde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bde('0x5'));var logger=require(_0x6bde('0x6'))(_0x6bde('0x7'));var config=require(_0x6bde('0x8'));var jayson=require(_0x6bde('0x9'));var client=jayson['client'][_0x6bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d1492,_0x464605,_0x1a0f8d){return new BPromise(function(_0x25e2e3,_0x3aaf7a){return client[_0x6bde('0xb')](_0x1d1492,_0x1a0f8d)['then'](function(_0x309b36){logger[_0x6bde('0xc')](_0x6bde('0xd'),_0x464605,_0x6bde('0xe'));logger[_0x6bde('0xf')](_0x6bde('0x10'),_0x464605,_0x6bde('0xe'),JSON[_0x6bde('0x11')](_0x309b36));if(_0x309b36['error']){if(_0x309b36[_0x6bde('0x12')][_0x6bde('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x464605,_0x309b36[_0x6bde('0x12')][_0x6bde('0x14')]);return _0x3aaf7a(_0x309b36['error'][_0x6bde('0x14')]);}logger[_0x6bde('0x12')](_0x6bde('0xd'),_0x464605,_0x309b36[_0x6bde('0x12')][_0x6bde('0x14')]);return _0x25e2e3(_0x309b36[_0x6bde('0x12')][_0x6bde('0x14')]);}else{logger[_0x6bde('0xc')](_0x6bde('0xd'),_0x464605,_0x6bde('0xe'));_0x25e2e3(_0x309b36[_0x6bde('0x15')][_0x6bde('0x14')]);}})[_0x6bde('0x16')](function(_0x1b54e9){logger[_0x6bde('0x12')]('VoiceMail,\x20%s,\x20%s',_0x464605,_0x1b54e9);_0x3aaf7a(_0x1b54e9);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 60378d9..22ca3f3 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 _0x4341=['delete','exports','util','path','express','Router','fs-extra','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create','put'];(function(_0x3ed1c1,_0x45fe0a){var _0x11797d=function(_0x26bad3){while(--_0x26bad3){_0x3ed1c1['push'](_0x3ed1c1['shift']());}};_0x11797d(++_0x45fe0a);}(_0x4341,0x1d6));var _0x1434=function(_0x514a57,_0x3f68f0){_0x514a57=_0x514a57-0x0;var _0x5814ac=_0x4341[_0x514a57];return _0x5814ac;};'use strict';var multer=require('multer');var util=require(_0x1434('0x0'));var path=require(_0x1434('0x1'));var timeout=require('connect-timeout');var express=require(_0x1434('0x2'));var router=express[_0x1434('0x3')]();var fs_extra=require(_0x1434('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1434('0x5'));var controller=require(_0x1434('0x6'));router[_0x1434('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1434('0x7')](_0x1434('0x8'),auth[_0x1434('0x9')](),controller[_0x1434('0xa')]);router[_0x1434('0x7')](_0x1434('0xb'),auth[_0x1434('0x9')](),controller[_0x1434('0xc')]);router[_0x1434('0xd')]('/',auth[_0x1434('0x9')](),controller[_0x1434('0xe')]);router[_0x1434('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1434('0x10')](_0x1434('0x8'),auth[_0x1434('0x9')](),controller['destroy']);module[_0x1434('0x11')]=router; \ No newline at end of file +var _0x4772=['get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4772,0x15c));var _0x2477=function(_0xf247e7,_0x1260cc){_0xf247e7=_0xf247e7-0x0;var _0x38517b=_0x4772[_0xf247e7];return _0x38517b;};'use strict';var multer=require(_0x2477('0x0'));var util=require(_0x2477('0x1'));var path=require('path');var timeout=require(_0x2477('0x2'));var express=require(_0x2477('0x3'));var router=express[_0x2477('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2477('0x5'));var interaction=require(_0x2477('0x6'));var config=require(_0x2477('0x7'));var controller=require(_0x2477('0x8'));router[_0x2477('0x9')]('/',auth[_0x2477('0xa')](),controller['index']);router['get'](_0x2477('0xb'),auth[_0x2477('0xa')](),controller[_0x2477('0xc')]);router['get'](_0x2477('0xd'),auth[_0x2477('0xa')](),controller[_0x2477('0xe')]);router[_0x2477('0xf')]('/',auth['isAuthenticated'](),controller[_0x2477('0x10')]);router[_0x2477('0x11')]('/:id',auth[_0x2477('0xa')](),controller[_0x2477('0x12')]);router[_0x2477('0x13')](_0x2477('0xb'),auth[_0x2477('0xa')](),controller[_0x2477('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index bee2084..7c5cb9f 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 _0x8246=['long','TIMESTAMP','literal','sequelize','exports','INTEGER','STRING','BLOB'];(function(_0x39e362,_0x4db9ea){var _0x302c45=function(_0x22811a){while(--_0x22811a){_0x39e362['push'](_0x39e362['shift']());}};_0x302c45(++_0x4db9ea);}(_0x8246,0x1cb));var _0x6824=function(_0x5bd510,_0x8c536d){_0x5bd510=_0x5bd510-0x0;var _0x3772b7=_0x8246[_0x5bd510];return _0x3772b7;};'use strict';var Sequelize=require(_0x6824('0x0'));module[_0x6824('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x182a5e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x6824('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x6824('0x4')](_0x6824('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6824('0x3')],'defaultValue':''},'stamp':{'type':_0x6824('0x6'),'defaultValue':Sequelize[_0x6824('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x9052=['sequelize','exports','VIRTUAL','getDataValue','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x5048b1,_0x5cf2e6){var _0x1edd3c=function(_0x3dfd7c){while(--_0x3dfd7c){_0x5048b1['push'](_0x5048b1['shift']());}};_0x1edd3c(++_0x5cf2e6);}(_0x9052,0x17a));var _0x2905=function(_0x19f4bd,_0x5671fa){_0x19f4bd=_0x19f4bd-0x0;var _0x3e7744=_0x9052[_0x19f4bd];return _0x3e7744;};'use strict';var Sequelize=require(_0x2905('0x0'));module[_0x2905('0x1')]={'name':{'type':Sequelize[_0x2905('0x2')],'get':function(_0x3245f4){return this[_0x2905('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x2905('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2905('0x4')],'defaultValue':''},'stamp':{'type':_0x2905('0x6'),'defaultValue':Sequelize[_0x2905('0x7')](_0x2905('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ca2385e..a4ddd58 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 _0xa134=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','length','options','find','create','body','recording','msg_id','audio/wav','attachment','attachment;\x20filename=\x22','set','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x17df91,_0x39d30e){var _0x41c6bf=function(_0x460b4){while(--_0x460b4){_0x17df91['push'](_0x17df91['shift']());}};_0x41c6bf(++_0x39d30e);}(_0xa134,0x8b));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4a13('0x0'));var jsonpatch=require(_0x4a13('0x1'));var rp=require(_0x4a13('0x2'));var moment=require('moment');var BPromise=require(_0x4a13('0x3'));var Mustache=require(_0x4a13('0x4'));var util=require(_0x4a13('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a13('0x6'));var fs=require('fs');var fs_extra=require(_0x4a13('0x7'));var _=require('lodash');var squel=require(_0x4a13('0x8'));var crypto=require('crypto');var jsforce=require(_0x4a13('0x9'));var deskjs=require(_0x4a13('0xa'));var toCsv=require(_0x4a13('0xb'));var querystring=require(_0x4a13('0xc'));var Papa=require(_0x4a13('0xd'));var Redis=require(_0x4a13('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4a13('0xf'));var as=require(_0x4a13('0x10'));var hardwareService=require(_0x4a13('0x11'));var logger=require('../../config/logger')(_0x4a13('0x12'));var utils=require(_0x4a13('0x13'));var config=require(_0x4a13('0x14'));var licenseUtil=require(_0x4a13('0x15'));var db=require(_0x4a13('0x16'))['db'];function respondWithStatusCode(_0x3c21e3,_0x213557){_0x213557=_0x213557||0xcc;return function(_0x5a46f2){if(_0x5a46f2){return _0x3c21e3[_0x4a13('0x17')](_0x213557);}return _0x3c21e3[_0x4a13('0x18')](_0x213557)['end']();};}function respondWithResult(_0x57eac0,_0x2be5ad){_0x2be5ad=_0x2be5ad||0xc8;return function(_0x2d27ca){if(_0x2d27ca){return _0x57eac0[_0x4a13('0x18')](_0x2be5ad)['json'](_0x2d27ca);}};}function respondWithFilteredResult(_0x55465c,_0x32eaa5){return function(_0x2edefd){if(_0x2edefd){var _0x22c49e=typeof _0x32eaa5[_0x4a13('0x19')]===_0x4a13('0x1a')&&typeof _0x32eaa5[_0x4a13('0x1b')]==='undefined';var _0x584289=_0x2edefd[_0x4a13('0x1c')];var _0x28a319=_0x22c49e?0x0:_0x32eaa5['offset'];var _0x407890=_0x22c49e?_0x2edefd[_0x4a13('0x1c')]:_0x32eaa5[_0x4a13('0x19')]+_0x32eaa5[_0x4a13('0x1b')];var _0x5b970e;if(_0x407890>=_0x584289){_0x407890=_0x584289;_0x5b970e=0xc8;}else{_0x5b970e=0xce;}_0x55465c[_0x4a13('0x18')](_0x5b970e);return _0x55465c['set'](_0x4a13('0x1d'),_0x28a319+'-'+_0x407890+'/'+_0x584289)[_0x4a13('0x1e')](_0x2edefd);}return null;};}function patchUpdates(_0x498bcc){return function(_0x1fd7f2){try{jsonpatch[_0x4a13('0x1f')](_0x1fd7f2,_0x498bcc,!![]);}catch(_0x2c0ab4){return BPromise[_0x4a13('0x20')](_0x2c0ab4);}return _0x1fd7f2[_0x4a13('0x21')]();};}function saveUpdates(_0x11bd5e,_0x2f2b57){return function(_0x32f433){if(_0x32f433){return _0x32f433[_0x4a13('0x22')](_0x11bd5e)[_0x4a13('0x23')](function(_0x1d0530){return _0x1d0530;});}return null;};}function removeEntity(_0xb76e68,_0xe0a610){return function(_0x148e8f){if(_0x148e8f){return _0x148e8f[_0x4a13('0x24')]()[_0x4a13('0x23')](function(){_0xb76e68[_0x4a13('0x18')](0xcc)[_0x4a13('0x25')]();});}};}function handleEntityNotFound(_0x48dbe2,_0x357265){return function(_0x1826dd){if(!_0x1826dd){_0x48dbe2[_0x4a13('0x17')](0x194);}return _0x1826dd;};}function handleError(_0x4fb782,_0x47bbbc){_0x47bbbc=_0x47bbbc||0x1f4;return function(_0x250bcb){logger[_0x4a13('0x26')](_0x250bcb[_0x4a13('0x27')]);if(_0x250bcb['name']){delete _0x250bcb[_0x4a13('0x28')];}_0x4fb782[_0x4a13('0x18')](_0x47bbbc)['send'](_0x250bcb);};}exports['index']=function(_0xa8c0d0,_0x402932){var _0x1f3eed={},_0x2339b5={},_0x1591bf={'count':0x0,'rows':[]};var _0x43cf88=_[_0x4a13('0x29')](db[_0x4a13('0x2a')][_0x4a13('0x2b')],function(_0x343457){return{'name':_0x343457[_0x4a13('0x2c')],'type':_0x343457['type']['key']};});_0x2339b5[_0x4a13('0x2d')]=_[_0x4a13('0x2e')](_['map'](_0x43cf88,_0x4a13('0x28')),[_0x4a13('0x28')]);_0x2339b5[_0x4a13('0x2f')]=_[_0x4a13('0x30')](_0xa8c0d0[_0x4a13('0x2f')]);_0x2339b5['filters']=_[_0x4a13('0x31')](_0x2339b5[_0x4a13('0x2d')],_0x2339b5[_0x4a13('0x2f')]);_0x1f3eed[_0x4a13('0x32')]=_[_0x4a13('0x31')](_0x2339b5[_0x4a13('0x2d')],qs[_0x4a13('0x33')](_0xa8c0d0[_0x4a13('0x2f')]['fields']));_0x1f3eed[_0x4a13('0x32')]=_0x1f3eed[_0x4a13('0x32')]['length']?_0x1f3eed[_0x4a13('0x32')]:_0x2339b5['model'];if(!_0xa8c0d0[_0x4a13('0x2f')][_0x4a13('0x34')](_0x4a13('0x35'))){_0x1f3eed['limit']=qs['limit'](_0xa8c0d0['query'][_0x4a13('0x1b')]);_0x1f3eed[_0x4a13('0x19')]=qs[_0x4a13('0x19')](_0xa8c0d0[_0x4a13('0x2f')][_0x4a13('0x19')]);}_0x1f3eed[_0x4a13('0x36')]=qs[_0x4a13('0x37')](_0xa8c0d0[_0x4a13('0x2f')][_0x4a13('0x37')]);_0x1f3eed[_0x4a13('0x38')]=qs[_0x4a13('0x39')](_[_0x4a13('0x3a')](_0xa8c0d0[_0x4a13('0x2f')],_0x2339b5[_0x4a13('0x39')]),_0x43cf88);if(_0xa8c0d0['query'][_0x4a13('0x3b')]){_0x1f3eed[_0x4a13('0x38')]=_[_0x4a13('0x3c')](_0x1f3eed[_0x4a13('0x38')],{'$or':_[_0x4a13('0x29')](_0x43cf88,function(_0x273d03){if(_0x273d03[_0x4a13('0x3d')]!==_0x4a13('0x3e')){var _0x19eee5={};_0x19eee5[_0x273d03[_0x4a13('0x28')]]={'$like':'%'+_0xa8c0d0[_0x4a13('0x2f')]['filter']+'%'};return _0x19eee5;}})});}_0x1f3eed=_['merge']({},_0x1f3eed,_0xa8c0d0['options']);var _0x15ee74={'where':_0x1f3eed['where']};return db[_0x4a13('0x2a')][_0x4a13('0x1c')](_0x15ee74)[_0x4a13('0x23')](function(_0x1f3766){_0x1591bf[_0x4a13('0x1c')]=_0x1f3766;if(_0xa8c0d0[_0x4a13('0x2f')][_0x4a13('0x3f')]){_0x1f3eed[_0x4a13('0x40')]=[{'all':!![]}];}return db[_0x4a13('0x2a')]['findAll'](_0x1f3eed);})[_0x4a13('0x23')](function(_0x5c0563){_0x1591bf['rows']=_0x5c0563;return _0x1591bf;})['then'](respondWithFilteredResult(_0x402932,_0x1f3eed))[_0x4a13('0x41')](handleError(_0x402932,null));};exports[_0x4a13('0x42')]=function(_0x26fcd1,_0xb96f20){var _0x50a93f={'raw':!![],'where':{'id':_0x26fcd1[_0x4a13('0x43')]['id']}},_0xee5d42={};_0xee5d42['model']=_[_0x4a13('0x30')](db[_0x4a13('0x2a')]['rawAttributes']);_0xee5d42[_0x4a13('0x2f')]=_[_0x4a13('0x30')](_0x26fcd1['query']);_0xee5d42['filters']=_[_0x4a13('0x31')](_0xee5d42[_0x4a13('0x2d')],_0xee5d42[_0x4a13('0x2f')]);_0x50a93f[_0x4a13('0x32')]=_[_0x4a13('0x31')](_0xee5d42['model'],qs['fields'](_0x26fcd1[_0x4a13('0x2f')][_0x4a13('0x33')]));_0x50a93f[_0x4a13('0x32')]=_0x50a93f[_0x4a13('0x32')][_0x4a13('0x44')]?_0x50a93f[_0x4a13('0x32')]:_0xee5d42[_0x4a13('0x2d')];if(_0x26fcd1[_0x4a13('0x2f')]['includeAll']){_0x50a93f[_0x4a13('0x40')]=[{'all':!![]}];}_0x50a93f=_[_0x4a13('0x3c')]({},_0x50a93f,_0x26fcd1[_0x4a13('0x45')]);return db['VoiceMailMessage'][_0x4a13('0x46')](_0x50a93f)['then'](handleEntityNotFound(_0xb96f20,null))[_0x4a13('0x23')](respondWithResult(_0xb96f20,null))[_0x4a13('0x41')](handleError(_0xb96f20,null));};exports[_0x4a13('0x47')]=function(_0xa5c022,_0x203c3c){return db[_0x4a13('0x2a')][_0x4a13('0x47')](_0xa5c022[_0x4a13('0x48')],{})[_0x4a13('0x23')](respondWithResult(_0x203c3c,0xc9))[_0x4a13('0x41')](handleError(_0x203c3c,null));};exports[_0x4a13('0x22')]=function(_0x5a482,_0x3af3e1){if(_0x5a482[_0x4a13('0x48')]['id']){delete _0x5a482['body']['id'];}return db[_0x4a13('0x2a')][_0x4a13('0x46')]({'where':{'id':_0x5a482[_0x4a13('0x43')]['id']}})[_0x4a13('0x23')](handleEntityNotFound(_0x3af3e1,null))[_0x4a13('0x23')](saveUpdates(_0x5a482[_0x4a13('0x48')],null))['then'](respondWithResult(_0x3af3e1,null))[_0x4a13('0x41')](handleError(_0x3af3e1,null));};exports[_0x4a13('0x24')]=function(_0x5c8b69,_0x100c54){return db[_0x4a13('0x2a')][_0x4a13('0x46')]({'where':{'id':_0x5c8b69[_0x4a13('0x43')]['id']}})[_0x4a13('0x23')](handleEntityNotFound(_0x100c54,null))['then'](removeEntity(_0x100c54,null))[_0x4a13('0x41')](handleError(_0x100c54,null));};exports['download']=function(_0xb9d0c1,_0x38d307,_0x4f08e3){return db['VoiceMailMessage'][_0x4a13('0x46')]({'where':{'id':_0xb9d0c1[_0x4a13('0x43')]['id']},'attributes':['id',_0x4a13('0x49'),_0x4a13('0x4a')]})[_0x4a13('0x23')](handleEntityNotFound(_0x38d307,null))['then'](function(_0x40e448){if(_0x40e448){if(!_0x40e448[_0x4a13('0x49')]){throw new db['Sequelize']['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x211658={'Content-Type':_0x4a13('0x4b'),'Content-Disposition':_0x4a13('0x4c')};if(_0x40e448[_0x4a13('0x4a')]){_0x211658['Content-Disposition']=_0x4a13('0x4d')+_0x40e448[_0x4a13('0x4a')]+'.wav\x22';}_0x38d307[_0x4a13('0x4e')](_0x211658);return _0x38d307['send'](new Buffer(_0x40e448[_0x4a13('0x49')]));}})['catch'](handleError(_0x38d307,null));}; \ No newline at end of file +var _0xa258=['ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','keys','attributes','intersection','fields','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','download','recording','Sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa258,0x146));var _0x8a25=function(_0xe8b463,_0x129158){_0xe8b463=_0xe8b463-0x0;var _0x24141b=_0xa258[_0xe8b463];return _0x24141b;};'use strict';var emlformat=require(_0x8a25('0x0'));var rimraf=require(_0x8a25('0x1'));var zipdir=require(_0x8a25('0x2'));var jsonpatch=require(_0x8a25('0x3'));var rp=require(_0x8a25('0x4'));var moment=require(_0x8a25('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a25('0x6'));var util=require(_0x8a25('0x7'));var path=require('path');var sox=require(_0x8a25('0x8'));var csv=require('to-csv');var ejs=require(_0x8a25('0x9'));var fs=require('fs');var fs_extra=require(_0x8a25('0xa'));var _=require(_0x8a25('0xb'));var squel=require('squel');var crypto=require(_0x8a25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a25('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a25('0xe'));var Redis=require('ioredis');var authService=require(_0x8a25('0xf'));var qs=require(_0x8a25('0x10'));var as=require(_0x8a25('0x11'));var hardwareService=require(_0x8a25('0x12'));var logger=require('../../config/logger')(_0x8a25('0x13'));var utils=require(_0x8a25('0x14'));var config=require(_0x8a25('0x15'));var licenseUtil=require(_0x8a25('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499495,_0x74d796){_0x74d796=_0x74d796||0xcc;return function(_0x558ffa){if(_0x558ffa){return _0x499495[_0x8a25('0x17')](_0x74d796);}return _0x499495[_0x8a25('0x18')](_0x74d796)[_0x8a25('0x19')]();};}function respondWithResult(_0x561a3d,_0x11403f){_0x11403f=_0x11403f||0xc8;return function(_0xef5fd1){if(_0xef5fd1){return _0x561a3d[_0x8a25('0x18')](_0x11403f)[_0x8a25('0x1a')](_0xef5fd1);}};}function respondWithFilteredResult(_0x3d60b8,_0x48bf73){return function(_0x53c2dd){if(_0x53c2dd){var _0x353de7=typeof _0x48bf73['offset']==='undefined'&&typeof _0x48bf73[_0x8a25('0x1b')]==='undefined';var _0x3bc440=_0x53c2dd[_0x8a25('0x1c')];var _0x29e956=_0x353de7?0x0:_0x48bf73[_0x8a25('0x1d')];var _0x343bc4=_0x353de7?_0x53c2dd[_0x8a25('0x1c')]:_0x48bf73[_0x8a25('0x1d')]+_0x48bf73[_0x8a25('0x1b')];var _0x29db74;if(_0x343bc4>=_0x3bc440){_0x343bc4=_0x3bc440;_0x29db74=0xc8;}else{_0x29db74=0xce;}_0x3d60b8[_0x8a25('0x18')](_0x29db74);return _0x3d60b8[_0x8a25('0x1e')](_0x8a25('0x1f'),_0x29e956+'-'+_0x343bc4+'/'+_0x3bc440)[_0x8a25('0x1a')](_0x53c2dd);}return null;};}function patchUpdates(_0x21b992){return function(_0x3914c0){try{jsonpatch[_0x8a25('0x20')](_0x3914c0,_0x21b992,!![]);}catch(_0x2bdbad){return BPromise[_0x8a25('0x21')](_0x2bdbad);}return _0x3914c0['save']();};}function saveUpdates(_0x26f161,_0x492910){return function(_0x15857a){if(_0x15857a){return _0x15857a[_0x8a25('0x22')](_0x26f161)['then'](function(_0x3b1b45){return _0x3b1b45;});}return null;};}function removeEntity(_0x1ce857,_0x3dc48e){return function(_0x4cfaea){if(_0x4cfaea){return _0x4cfaea[_0x8a25('0x23')]()[_0x8a25('0x24')](function(){_0x1ce857[_0x8a25('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5efe23,_0x86e851){return function(_0xf6c985){if(!_0xf6c985){_0x5efe23[_0x8a25('0x17')](0x194);}return _0xf6c985;};}function handleError(_0xebf26,_0xb26098){_0xb26098=_0xb26098||0x1f4;return function(_0x226be2){logger[_0x8a25('0x25')](_0x226be2[_0x8a25('0x26')]);if(_0x226be2['name']){delete _0x226be2[_0x8a25('0x27')];}_0xebf26[_0x8a25('0x18')](_0xb26098)['send'](_0x226be2);};}exports['index']=function(_0x204ba5,_0x53b56a){var _0x4f4e23={},_0x38019e={},_0x2514e3={'count':0x0,'rows':[]};var _0x64876b=_[_0x8a25('0x28')](db[_0x8a25('0x29')][_0x8a25('0x2a')],function(_0x51b369){return{'name':_0x51b369[_0x8a25('0x2b')],'type':_0x51b369[_0x8a25('0x2c')]['key']};});_0x38019e[_0x8a25('0x2d')]=_[_0x8a25('0x2e')](_[_0x8a25('0x28')](_0x64876b,_0x8a25('0x27')),[_0x8a25('0x27')]);_0x38019e[_0x8a25('0x2f')]=_[_0x8a25('0x30')](_0x204ba5[_0x8a25('0x2f')]);_0x38019e['filters']=_['intersection'](_0x38019e['model'],_0x38019e['query']);_0x4f4e23[_0x8a25('0x31')]=_[_0x8a25('0x32')](_0x38019e[_0x8a25('0x2d')],qs[_0x8a25('0x33')](_0x204ba5[_0x8a25('0x2f')]['fields']));_0x4f4e23['attributes']=_0x4f4e23[_0x8a25('0x31')]['length']?_0x4f4e23[_0x8a25('0x31')]:_0x38019e[_0x8a25('0x2d')];if(!_0x204ba5[_0x8a25('0x2f')]['hasOwnProperty'](_0x8a25('0x34'))){_0x4f4e23[_0x8a25('0x1b')]=qs['limit'](_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x1b')]);_0x4f4e23[_0x8a25('0x1d')]=qs[_0x8a25('0x1d')](_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x1d')]);}_0x4f4e23['order']=qs['sort'](_0x204ba5['query'][_0x8a25('0x35')]);_0x4f4e23[_0x8a25('0x36')]=qs['filters'](_[_0x8a25('0x37')](_0x204ba5[_0x8a25('0x2f')],_0x38019e[_0x8a25('0x38')]),_0x64876b);if(_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x39')]){_0x4f4e23['where']=_[_0x8a25('0x3a')](_0x4f4e23[_0x8a25('0x36')],{'$or':_[_0x8a25('0x28')](_0x64876b,function(_0x53f6d1){if(_0x53f6d1[_0x8a25('0x2c')]!==_0x8a25('0x3b')){var _0x5363bb={};_0x5363bb[_0x53f6d1[_0x8a25('0x27')]]={'$like':'%'+_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x39')]+'%'};return _0x5363bb;}})});}_0x4f4e23=_['merge']({},_0x4f4e23,_0x204ba5[_0x8a25('0x3c')]);var _0x377873={'where':_0x4f4e23[_0x8a25('0x36')]};return db[_0x8a25('0x29')][_0x8a25('0x1c')](_0x377873)[_0x8a25('0x24')](function(_0x38b4fa){_0x2514e3['count']=_0x38b4fa;if(_0x204ba5[_0x8a25('0x2f')][_0x8a25('0x3d')]){_0x4f4e23[_0x8a25('0x3e')]=[{'all':!![]}];}return db[_0x8a25('0x29')][_0x8a25('0x3f')](_0x4f4e23);})[_0x8a25('0x24')](function(_0x1b21fa){_0x2514e3[_0x8a25('0x40')]=_0x1b21fa;return _0x2514e3;})[_0x8a25('0x24')](respondWithFilteredResult(_0x53b56a,_0x4f4e23))[_0x8a25('0x41')](handleError(_0x53b56a,null));};exports[_0x8a25('0x42')]=function(_0xe49f28,_0x594f0e){var _0x1017d1={'raw':!![],'where':{'id':_0xe49f28[_0x8a25('0x43')]['id']}},_0x50c7a4={};_0x50c7a4['model']=_['keys'](db[_0x8a25('0x29')][_0x8a25('0x2a')]);_0x50c7a4['query']=_[_0x8a25('0x30')](_0xe49f28[_0x8a25('0x2f')]);_0x50c7a4['filters']=_[_0x8a25('0x32')](_0x50c7a4['model'],_0x50c7a4[_0x8a25('0x2f')]);_0x1017d1[_0x8a25('0x31')]=_[_0x8a25('0x32')](_0x50c7a4[_0x8a25('0x2d')],qs[_0x8a25('0x33')](_0xe49f28[_0x8a25('0x2f')][_0x8a25('0x33')]));_0x1017d1[_0x8a25('0x31')]=_0x1017d1[_0x8a25('0x31')]['length']?_0x1017d1[_0x8a25('0x31')]:_0x50c7a4[_0x8a25('0x2d')];if(_0xe49f28['query']['includeAll']){_0x1017d1[_0x8a25('0x3e')]=[{'all':!![]}];}_0x1017d1=_[_0x8a25('0x3a')]({},_0x1017d1,_0xe49f28['options']);return db['VoiceMailMessage']['find'](_0x1017d1)[_0x8a25('0x24')](handleEntityNotFound(_0x594f0e,null))[_0x8a25('0x24')](respondWithResult(_0x594f0e,null))['catch'](handleError(_0x594f0e,null));};exports['create']=function(_0x25eb0a,_0x2fba66){return db[_0x8a25('0x29')][_0x8a25('0x44')](_0x25eb0a[_0x8a25('0x45')],{})[_0x8a25('0x24')](respondWithResult(_0x2fba66,0xc9))[_0x8a25('0x41')](handleError(_0x2fba66,null));};exports[_0x8a25('0x22')]=function(_0x702bba,_0x3b04c4){if(_0x702bba[_0x8a25('0x45')]['id']){delete _0x702bba[_0x8a25('0x45')]['id'];}return db['VoiceMailMessage'][_0x8a25('0x46')]({'where':{'id':_0x702bba['params']['id']}})[_0x8a25('0x24')](handleEntityNotFound(_0x3b04c4,null))[_0x8a25('0x24')](saveUpdates(_0x702bba[_0x8a25('0x45')],null))[_0x8a25('0x24')](respondWithResult(_0x3b04c4,null))['catch'](handleError(_0x3b04c4,null));};exports['destroy']=function(_0x4b63cc,_0x4fad62){return db[_0x8a25('0x29')][_0x8a25('0x46')]({'where':{'id':_0x4b63cc['params']['id']}})[_0x8a25('0x24')](handleEntityNotFound(_0x4fad62,null))[_0x8a25('0x24')](removeEntity(_0x4fad62,null))[_0x8a25('0x41')](handleError(_0x4fad62,null));};exports[_0x8a25('0x47')]=function(_0x9c8508,_0x4bc220,_0x14ea7a){return db[_0x8a25('0x29')][_0x8a25('0x46')]({'where':{'id':_0x9c8508[_0x8a25('0x43')]['id']},'attributes':['id',_0x8a25('0x48'),'msg_id']})[_0x8a25('0x24')](handleEntityNotFound(_0x4bc220,null))[_0x8a25('0x24')](function(_0x272339){if(_0x272339){if(!_0x272339['recording']){throw new db[(_0x8a25('0x49'))][(_0x8a25('0x4a'))](_0x8a25('0x4b'));}var _0x1ea8b3={'Content-Type':'audio/wav','Content-Disposition':_0x8a25('0x4c')};if(_0x272339[_0x8a25('0x4d')]){_0x1ea8b3[_0x8a25('0x4e')]=_0x8a25('0x4f')+_0x272339[_0x8a25('0x4d')]+'.wav\x22';}_0x4bc220[_0x8a25('0x1e')](_0x1ea8b3);return _0x4bc220['send'](new Buffer(_0x272339[_0x8a25('0x48')]));}})[_0x8a25('0x41')](handleError(_0x4bc220,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 1dcfbec..4dadda5 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 _0x147e=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x147e,0x14a));var _0xe147=function(_0x100d02,_0x31add2){_0x100d02=_0x100d02-0x0;var _0x404b37=_0x147e[_0x100d02];return _0x404b37;};'use strict';var _=require('lodash');var util=require(_0xe147('0x0'));var logger=require(_0xe147('0x1'))(_0xe147('0x2'));var moment=require(_0xe147('0x3'));var BPromise=require(_0xe147('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe147('0x5'));var rimraf=require(_0xe147('0x6'));var config=require(_0xe147('0x7'));var attributes=require(_0xe147('0x8'));module[_0xe147('0x9')]=function(_0x4b9684,_0x4e692e){return _0x4b9684[_0xe147('0xa')](_0xe147('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xe147('0xc'),'fields':[_0xe147('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa009=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x5a957c,_0x315720){var _0x3629b6=function(_0x4326b4){while(--_0x4326b4){_0x5a957c['push'](_0x5a957c['shift']());}};_0x3629b6(++_0x315720);}(_0xa009,0x1b5));var _0x9a00=function(_0x6b6b99,_0x254b9d){_0x6b6b99=_0x6b6b99-0x0;var _0x15fb7e=_0xa009[_0x6b6b99];return _0x15fb7e;};'use strict';var _=require(_0x9a00('0x0'));var util=require(_0x9a00('0x1'));var logger=require(_0x9a00('0x2'))(_0x9a00('0x3'));var moment=require(_0x9a00('0x4'));var BPromise=require(_0x9a00('0x5'));var rp=require(_0x9a00('0x6'));var fs=require('fs');var path=require(_0x9a00('0x7'));var rimraf=require(_0x9a00('0x8'));var config=require(_0x9a00('0x9'));var attributes=require(_0x9a00('0xa'));module[_0x9a00('0xb')]=function(_0x55d78b,_0x1025e5){return _0x55d78b[_0x9a00('0xc')](_0x9a00('0xd'),attributes,{'tableName':_0x9a00('0xe'),'paranoid':![],'indexes':[{'name':_0x9a00('0xf'),'fields':[_0x9a00('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2847b87..c96b196 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 _0xaa90=['client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x220ab5,_0x5c0ae6){var _0xe89604=function(_0xb2f107){while(--_0xb2f107){_0x220ab5['push'](_0x220ab5['shift']());}};_0xe89604(++_0x5c0ae6);}(_0xaa90,0x9f));var _0x0aa9=function(_0x33e68c,_0x346aa8){_0x33e68c=_0x33e68c-0x0;var _0x46ebc5=_0xaa90[_0x33e68c];return _0x46ebc5;};'use strict';var _=require(_0x0aa9('0x0'));var util=require(_0x0aa9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0aa9('0x2'));var fs=require('fs');var Redis=require(_0x0aa9('0x3'));var db=require(_0x0aa9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0aa9('0x5'))(_0x0aa9('0x6'));var config=require(_0x0aa9('0x7'));var jayson=require(_0x0aa9('0x8'));var client=jayson[_0x0aa9('0x9')][_0x0aa9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ae67a,_0x28b866,_0x33b479){return new BPromise(function(_0x15ee4b,_0x8d73f0){return client[_0x0aa9('0xb')](_0x4ae67a,_0x33b479)['then'](function(_0x34d485){logger[_0x0aa9('0xc')](_0x0aa9('0xd'),_0x28b866,_0x0aa9('0xe'));logger[_0x0aa9('0xf')](_0x0aa9('0x10'),_0x28b866,'request\x20sent',JSON['stringify'](_0x34d485));if(_0x34d485['error']){if(_0x34d485['error']['code']===0x1f4){logger[_0x0aa9('0x11')](_0x0aa9('0xd'),_0x28b866,_0x34d485[_0x0aa9('0x11')]['message']);return _0x8d73f0(_0x34d485[_0x0aa9('0x11')][_0x0aa9('0x12')]);}logger[_0x0aa9('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x28b866,_0x34d485[_0x0aa9('0x11')][_0x0aa9('0x12')]);return _0x15ee4b(_0x34d485[_0x0aa9('0x11')][_0x0aa9('0x12')]);}else{logger['info'](_0x0aa9('0xd'),_0x28b866,_0x0aa9('0xe'));_0x15ee4b(_0x34d485[_0x0aa9('0x13')][_0x0aa9('0x12')]);}})[_0x0aa9('0x14')](function(_0x566753){logger[_0x0aa9('0x11')](_0x0aa9('0xd'),_0x28b866,_0x566753);_0x8d73f0(_0x566753);});});} \ No newline at end of file +var _0x9207=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','message','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0x9207,0x1ba));var _0x7920=function(_0x562f67,_0x22b5d6){_0x562f67=_0x562f67-0x0;var _0x4ede70=_0x9207[_0x562f67];return _0x4ede70;};'use strict';var _=require('lodash');var util=require(_0x7920('0x0'));var moment=require(_0x7920('0x1'));var BPromise=require(_0x7920('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7920('0x3'));var db=require(_0x7920('0x4'))['db'];var utils=require(_0x7920('0x5'));var logger=require(_0x7920('0x6'))(_0x7920('0x7'));var config=require(_0x7920('0x8'));var jayson=require(_0x7920('0x9'));var client=jayson[_0x7920('0xa')][_0x7920('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2655f1,_0x614781,_0x9fc1a8){return new BPromise(function(_0x43248c,_0x415679){return client['request'](_0x2655f1,_0x9fc1a8)[_0x7920('0xc')](function(_0x5e0f45){logger[_0x7920('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x614781,_0x7920('0xe'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x614781,_0x7920('0xe'),JSON[_0x7920('0xf')](_0x5e0f45));if(_0x5e0f45[_0x7920('0x10')]){if(_0x5e0f45[_0x7920('0x10')][_0x7920('0x11')]===0x1f4){logger[_0x7920('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x614781,_0x5e0f45[_0x7920('0x10')]['message']);return _0x415679(_0x5e0f45[_0x7920('0x10')][_0x7920('0x12')]);}logger[_0x7920('0x10')](_0x7920('0x13'),_0x614781,_0x5e0f45[_0x7920('0x10')][_0x7920('0x12')]);return _0x43248c(_0x5e0f45[_0x7920('0x10')][_0x7920('0x12')]);}else{logger[_0x7920('0xd')](_0x7920('0x13'),_0x614781,_0x7920('0xe'));_0x43248c(_0x5e0f45['result'][_0x7920('0x12')]);}})[_0x7920('0x14')](function(_0x54361c){logger[_0x7920('0x10')](_0x7920('0x13'),_0x614781,_0x54361c);_0x415679(_0x54361c);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index ce505d9..9f11503 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 _0x302a=['isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x17e6f8,_0x4aab85){var _0x4ce0cb=function(_0x4da570){while(--_0x4da570){_0x17e6f8['push'](_0x17e6f8['shift']());}};_0x4ce0cb(++_0x4aab85);}(_0x302a,0x1e9));var _0xa302=function(_0xb26309,_0x35d461){_0xb26309=_0xb26309-0x0;var _0x5287d3=_0x302a[_0xb26309];return _0x5287d3;};'use strict';var multer=require(_0xa302('0x0'));var util=require(_0xa302('0x1'));var path=require(_0xa302('0x2'));var timeout=require(_0xa302('0x3'));var express=require(_0xa302('0x4'));var router=express[_0xa302('0x5')]();var fs_extra=require(_0xa302('0x6'));var auth=require(_0xa302('0x7'));var interaction=require(_0xa302('0x8'));var config=require(_0xa302('0x9'));var controller=require('./voiceMusicOnHold.controller');router[_0xa302('0xa')]('/',auth[_0xa302('0xb')](),controller[_0xa302('0xc')]);router[_0xa302('0xa')](_0xa302('0xd'),auth[_0xa302('0xb')](),controller['show']);router[_0xa302('0xa')](_0xa302('0xe'),auth['isAuthenticated'](),controller[_0xa302('0xf')]);router[_0xa302('0x10')]('/',auth[_0xa302('0xb')](),controller[_0xa302('0x11')]);router[_0xa302('0x10')](_0xa302('0xe'),auth[_0xa302('0xb')](),controller[_0xa302('0x12')]);router[_0xa302('0x13')](_0xa302('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa302('0x14')](_0xa302('0xd'),auth[_0xa302('0xb')](),controller[_0xa302('0x15')]);router[_0xa302('0x14')](_0xa302('0x16'),auth[_0xa302('0xb')](),controller[_0xa302('0x17')]);module[_0xa302('0x18')]=router; \ No newline at end of file +var _0x90bc=['/:id','show','/:id/sounds','post','create','addSound','delete','destroy','/:id/sounds/:id2','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','get'];(function(_0x3cbf99,_0x9cb33a){var _0x5f1cba=function(_0x2bfa17){while(--_0x2bfa17){_0x3cbf99['push'](_0x3cbf99['shift']());}};_0x5f1cba(++_0x9cb33a);}(_0x90bc,0x82));var _0xc90b=function(_0x202c99,_0x121caf){_0x202c99=_0x202c99-0x0;var _0x256a0f=_0x90bc[_0x202c99];return _0x256a0f;};'use strict';var multer=require(_0xc90b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc90b('0x1'));var express=require(_0xc90b('0x2'));var router=express[_0xc90b('0x3')]();var fs_extra=require(_0xc90b('0x4'));var auth=require(_0xc90b('0x5'));var interaction=require(_0xc90b('0x6'));var config=require('../../config/environment');var controller=require(_0xc90b('0x7'));router['get']('/',auth[_0xc90b('0x8')](),controller['index']);router[_0xc90b('0x9')](_0xc90b('0xa'),auth[_0xc90b('0x8')](),controller[_0xc90b('0xb')]);router[_0xc90b('0x9')](_0xc90b('0xc'),auth[_0xc90b('0x8')](),controller['getSounds']);router[_0xc90b('0xd')]('/',auth[_0xc90b('0x8')](),controller[_0xc90b('0xe')]);router[_0xc90b('0xd')](_0xc90b('0xc'),auth[_0xc90b('0x8')](),controller[_0xc90b('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc90b('0x10')]('/:id',auth[_0xc90b('0x8')](),controller[_0xc90b('0x11')]);router[_0xc90b('0x10')](_0xc90b('0x12'),auth[_0xc90b('0x8')](),controller['removeSound']);module[_0xc90b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a056390..18f98eb 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 _0x0df0=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','mp3nb','quietmp3nb','files','alpha'];(function(_0x42440f,_0x1d8224){var _0xe71007=function(_0x3e3e02){while(--_0x3e3e02){_0x42440f['push'](_0x42440f['shift']());}};_0xe71007(++_0x1d8224);}(_0x0df0,0xbd));var _0x00df=function(_0xb68695,_0x1881a4){_0xb68695=_0xb68695-0x0;var _0x15a817=_0x0df0[_0xb68695];return _0x15a817;};'use strict';var Sequelize=require(_0x00df('0x0'));module[_0x00df('0x1')]={'name':{'type':Sequelize[_0x00df('0x2')],'allowNull':![],'unique':_0x00df('0x3')},'mode':{'type':Sequelize[_0x00df('0x4')]('custom','files',_0x00df('0x5'),_0x00df('0x6'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x00df('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x00df('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x00df('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x00df('0x8')},'format':{'type':Sequelize[_0x00df('0x2')],'allowNull':!![]},'stamp':{'type':_0x00df('0x9')},'defaultEntry':{'type':Sequelize[_0x00df('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbe44=['ENUM','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING'];(function(_0xe284a6,_0x221d2b){var _0x8f96be=function(_0x3957f1){while(--_0x3957f1){_0xe284a6['push'](_0xe284a6['shift']());}};_0x8f96be(++_0x221d2b);}(_0xbe44,0xd0));var _0x4be4=function(_0x8720df,_0x3f41ea){_0x8720df=_0x8720df-0x0;var _0x44b435=_0xbe44[_0x8720df];return _0x44b435;};'use strict';var Sequelize=require(_0x4be4('0x0'));module['exports']={'name':{'type':Sequelize[_0x4be4('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x4be4('0x2')]('custom',_0x4be4('0x3'),_0x4be4('0x4'),_0x4be4('0x5'),'quietmp3',_0x4be4('0x6')),'allowNull':!![],'defaultValue':_0x4be4('0x3')},'directory':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![],'defaultValue':_0x4be4('0x7')},'format':{'type':Sequelize[_0x4be4('0x1')],'allowNull':!![]},'stamp':{'type':_0x4be4('0x8')},'defaultEntry':{'type':Sequelize[_0x4be4('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 585c6f1..3557707 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 _0x3864=['find','create','sequelize','transaction','files','directory','join','server/files/moh','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','autoAssociation','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','message','removeSound','id2','converted_format','Sequelize','getSounds','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','include','catch','body'];(function(_0x41cd0d,_0x4770f3){var _0x15dd9e=function(_0x322811){while(--_0x322811){_0x41cd0d['push'](_0x41cd0d['shift']());}};_0x15dd9e(++_0x4770f3);}(_0x3864,0x97));var _0x4386=function(_0x769fc6,_0x2c3c31){_0x769fc6=_0x769fc6-0x0;var _0x396fce=_0x3864[_0x769fc6];return _0x396fce;};'use strict';var emlformat=require(_0x4386('0x0'));var rimraf=require(_0x4386('0x1'));var zipdir=require(_0x4386('0x2'));var jsonpatch=require(_0x4386('0x3'));var rp=require(_0x4386('0x4'));var moment=require(_0x4386('0x5'));var BPromise=require(_0x4386('0x6'));var Mustache=require(_0x4386('0x7'));var util=require(_0x4386('0x8'));var path=require(_0x4386('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4386('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4386('0xb'));var crypto=require(_0x4386('0xc'));var jsforce=require(_0x4386('0xd'));var deskjs=require(_0x4386('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4386('0xf'));var authService=require(_0x4386('0x10'));var qs=require(_0x4386('0x11'));var as=require(_0x4386('0x12'));var hardwareService=require(_0x4386('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4386('0x14'));var licenseUtil=require(_0x4386('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe0c270,_0x37d427){_0x37d427=_0x37d427||0xcc;return function(_0xaf282d){if(_0xaf282d){return _0xe0c270[_0x4386('0x16')](_0x37d427);}return _0xe0c270[_0x4386('0x17')](_0x37d427)[_0x4386('0x18')]();};}function respondWithResult(_0x1637fd,_0x270954){_0x270954=_0x270954||0xc8;return function(_0x1a8cdc){if(_0x1a8cdc){return _0x1637fd[_0x4386('0x17')](_0x270954)[_0x4386('0x19')](_0x1a8cdc);}};}function respondWithFilteredResult(_0x35246f,_0x2f0bec){return function(_0x51d7f0){if(_0x51d7f0){var _0x3a4596=typeof _0x2f0bec[_0x4386('0x1a')]===_0x4386('0x1b')&&typeof _0x2f0bec['limit']===_0x4386('0x1b');var _0x1bebc5=_0x51d7f0['count'];var _0x29a611=_0x3a4596?0x0:_0x2f0bec[_0x4386('0x1a')];var _0xa4493b=_0x3a4596?_0x51d7f0[_0x4386('0x1c')]:_0x2f0bec[_0x4386('0x1a')]+_0x2f0bec[_0x4386('0x1d')];var _0x70185c;if(_0xa4493b>=_0x1bebc5){_0xa4493b=_0x1bebc5;_0x70185c=0xc8;}else{_0x70185c=0xce;}_0x35246f[_0x4386('0x17')](_0x70185c);return _0x35246f[_0x4386('0x1e')](_0x4386('0x1f'),_0x29a611+'-'+_0xa4493b+'/'+_0x1bebc5)['json'](_0x51d7f0);}return null;};}function patchUpdates(_0x7a98f1){return function(_0x5ccda8){try{jsonpatch[_0x4386('0x20')](_0x5ccda8,_0x7a98f1,!![]);}catch(_0x58c563){return BPromise[_0x4386('0x21')](_0x58c563);}return _0x5ccda8[_0x4386('0x22')]();};}function saveUpdates(_0x47d6d1,_0x2cf960){return function(_0x141d8c){if(_0x141d8c){return _0x141d8c[_0x4386('0x23')](_0x47d6d1)[_0x4386('0x24')](function(_0x133d40){return _0x133d40;});}return null;};}function removeEntity(_0x2f4c12,_0x3f3d53){return function(_0x468c24){if(_0x468c24){return _0x468c24[_0x4386('0x25')]()[_0x4386('0x24')](function(){var _0x2920e3=_0x468c24[_0x4386('0x26')]({'plain':!![]});var _0x1d6e0c='MusicOnHolds';return db[_0x4386('0x27')]['destroy']({'where':{'type':_0x1d6e0c,'resourceId':_0x2920e3['id']}})[_0x4386('0x24')](function(){return _0x468c24;});})['then'](function(){_0x2f4c12[_0x4386('0x17')](0xcc)[_0x4386('0x18')]();});}};}function handleEntityNotFound(_0x1911fc,_0x5a5281){return function(_0x238cb1){if(!_0x238cb1){_0x1911fc[_0x4386('0x16')](0x194);}return _0x238cb1;};}function handleError(_0x41c994,_0x461665){_0x461665=_0x461665||0x1f4;return function(_0x35507c){logger[_0x4386('0x28')](_0x35507c[_0x4386('0x29')]);if(_0x35507c[_0x4386('0x2a')]){delete _0x35507c[_0x4386('0x2a')];}_0x41c994[_0x4386('0x17')](_0x461665)[_0x4386('0x2b')](_0x35507c);};}exports[_0x4386('0x2c')]=function(_0x2ee7e0,_0x4a85a2){var _0x12439f={},_0x42d181={},_0xcd0ad7={'count':0x0,'rows':[]};var _0x50db59=_[_0x4386('0x2d')](db[_0x4386('0x2e')]['rawAttributes'],function(_0x349036){return{'name':_0x349036[_0x4386('0x2f')],'type':_0x349036[_0x4386('0x30')][_0x4386('0x31')]};});_0x42d181['model']=_[_0x4386('0x2d')](_0x50db59,'name');_0x42d181['query']=_[_0x4386('0x32')](_0x2ee7e0[_0x4386('0x33')]);_0x42d181[_0x4386('0x34')]=_[_0x4386('0x35')](_0x42d181['model'],_0x42d181['query']);_0x12439f[_0x4386('0x36')]=_[_0x4386('0x35')](_0x42d181[_0x4386('0x37')],qs[_0x4386('0x38')](_0x2ee7e0[_0x4386('0x33')][_0x4386('0x38')]));_0x12439f[_0x4386('0x36')]=_0x12439f['attributes'][_0x4386('0x39')]?_0x12439f['attributes']:_0x42d181[_0x4386('0x37')];if(!_0x2ee7e0[_0x4386('0x33')][_0x4386('0x3a')](_0x4386('0x3b'))){_0x12439f[_0x4386('0x1d')]=qs[_0x4386('0x1d')](_0x2ee7e0[_0x4386('0x33')][_0x4386('0x1d')]);_0x12439f['offset']=qs[_0x4386('0x1a')](_0x2ee7e0[_0x4386('0x33')]['offset']);}_0x12439f[_0x4386('0x3c')]=qs[_0x4386('0x3d')](_0x2ee7e0[_0x4386('0x33')][_0x4386('0x3d')]);delete _0x2ee7e0[_0x4386('0x33')][_0x4386('0x3d')];_0x12439f[_0x4386('0x3e')]=qs[_0x4386('0x34')](_[_0x4386('0x3f')](_0x2ee7e0['query'],_0x42d181[_0x4386('0x34')]),_0x50db59);if(_0x2ee7e0[_0x4386('0x33')]['filter']){_0x12439f[_0x4386('0x3e')]=_[_0x4386('0x40')](_0x12439f['where'],{'$or':_['map'](_0x50db59,function(_0x5f3005){if(_0x5f3005['type']!==_0x4386('0x41')){var _0x5c7e4a={};_0x5c7e4a[_0x5f3005['name']]={'$like':'%'+_0x2ee7e0[_0x4386('0x33')]['filter']+'%'};return _0x5c7e4a;}})});}_0x12439f=_[_0x4386('0x40')]({},_0x12439f,_0x2ee7e0[_0x4386('0x42')]);var _0x586c63={'where':_0x12439f[_0x4386('0x3e')]};return db[_0x4386('0x2e')]['count'](_0x586c63)[_0x4386('0x24')](function(_0x108e1c){_0xcd0ad7[_0x4386('0x1c')]=_0x108e1c;if(_0x2ee7e0['query'][_0x4386('0x43')]){_0x12439f['include']=[{'all':!![]}];}return db[_0x4386('0x2e')][_0x4386('0x44')](_0x12439f);})[_0x4386('0x24')](function(_0x29ae36){_0xcd0ad7[_0x4386('0x45')]=_0x29ae36;return _0xcd0ad7;})[_0x4386('0x24')](respondWithFilteredResult(_0x4a85a2,_0x12439f))['catch'](handleError(_0x4a85a2,null));};exports['show']=function(_0x1be0f3,_0x54f8d6){var _0x11f833={'raw':![],'where':{'id':_0x1be0f3[_0x4386('0x46')]['id']}},_0x571910={};_0x571910[_0x4386('0x37')]=_[_0x4386('0x32')](db[_0x4386('0x2e')][_0x4386('0x47')]);_0x571910[_0x4386('0x33')]=_[_0x4386('0x32')](_0x1be0f3['query']);_0x571910[_0x4386('0x34')]=_['intersection'](_0x571910[_0x4386('0x37')],_0x571910[_0x4386('0x33')]);_0x11f833[_0x4386('0x36')]=_[_0x4386('0x35')](_0x571910[_0x4386('0x37')],qs[_0x4386('0x38')](_0x1be0f3[_0x4386('0x33')][_0x4386('0x38')]));_0x11f833[_0x4386('0x36')]=_0x11f833[_0x4386('0x36')][_0x4386('0x39')]?_0x11f833[_0x4386('0x36')]:_0x571910[_0x4386('0x37')];if(_0x1be0f3[_0x4386('0x33')][_0x4386('0x43')]){_0x11f833[_0x4386('0x48')]=[{'all':!![]}];}_0x11f833=_[_0x4386('0x40')]({},_0x11f833,_0x1be0f3[_0x4386('0x42')]);return db[_0x4386('0x2e')]['find'](_0x11f833)[_0x4386('0x24')](handleEntityNotFound(_0x54f8d6,null))[_0x4386('0x24')](respondWithResult(_0x54f8d6,null))[_0x4386('0x49')](handleError(_0x54f8d6,null));};exports[_0x4386('0x23')]=function(_0x1798e7,_0x4ddced){if(_0x1798e7[_0x4386('0x4a')]['id']){delete _0x1798e7[_0x4386('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x4386('0x4b')]({'where':{'id':_0x1798e7[_0x4386('0x46')]['id']}})[_0x4386('0x24')](handleEntityNotFound(_0x4ddced,null))[_0x4386('0x24')](saveUpdates(_0x1798e7[_0x4386('0x4a')],null))['then'](respondWithResult(_0x4ddced,null))['catch'](handleError(_0x4ddced,null));};exports[_0x4386('0x4c')]=function(_0x44a779,_0x268e59,_0x16f17e){return db[_0x4386('0x4d')][_0x4386('0x4e')](function(_0x398460){if(_0x44a779['body']['mode']===_0x4386('0x4f')){_0x44a779[_0x4386('0x4a')][_0x4386('0x50')]=path[_0x4386('0x51')](config['root'],_0x4386('0x52'),_0x44a779[_0x4386('0x4a')][_0x4386('0x2a')]);}return db['VoiceMusicOnHold'][_0x4386('0x4c')](_0x44a779[_0x4386('0x4a')],{'transaction':_0x398460})[_0x4386('0x24')](function(_0x3a88d9){if(_0x44a779[_0x4386('0x4a')][_0x4386('0x53')]===_0x4386('0x4f')){fs[_0x4386('0x54')](_0x3a88d9[_0x4386('0x50')],parseInt(_0x4386('0x55'),0x8));}var _0x2190bd=_0x44a779[_0x4386('0x56')][_0x4386('0x26')]({'plain':!![]});if(!_0x2190bd)throw new Error(_0x4386('0x57'));if(_0x2190bd[_0x4386('0x58')]===_0x4386('0x56')){var _0x342857=_0x3a88d9[_0x4386('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4386('0x59'),'userProfileId':_0x2190bd['userProfileId']},'raw':!![]})[_0x4386('0x24')](function(_0x7c828d){if(_0x7c828d&&_0x7c828d[_0x4386('0x5a')]===0x0){return db[_0x4386('0x27')][_0x4386('0x4c')]({'name':_0x342857['name'],'resourceId':_0x342857['id'],'type':_0x7c828d[_0x4386('0x2a')],'sectionId':_0x7c828d['id']},{})[_0x4386('0x24')](function(){return _0x3a88d9;});}else{return _0x3a88d9;}})[_0x4386('0x49')](function(_0x2c83a9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c83a9);});}return _0x3a88d9;});})[_0x4386('0x24')](respondWithResult(_0x268e59,0xc9))[_0x4386('0x49')](handleError(_0x268e59,null));};exports[_0x4386('0x25')]=function(_0x184376,_0x4c85a1,_0xeed951){var _0x22403e;return db[_0x4386('0x2e')][_0x4386('0x4b')]({'where':{'id':_0x184376['params']['id']}})[_0x4386('0x24')](function(_0x212093){if(_0x212093){return db[_0x4386('0x4d')][_0x4386('0x4e')](function(_0x10d720){return _0x212093['destroy']({'transaction':_0x10d720,'raw':!![]})[_0x4386('0x24')](function(_0x24ce14){if(_0x24ce14[_0x4386('0x50')]){fs[_0x4386('0x5b')](_0x24ce14[_0x4386('0x50')])[_0x4386('0x5c')](function(_0x4b6a17){fs[_0x4386('0x5d')](path['join'](_0x24ce14[_0x4386('0x50')],_0x4b6a17));});fs[_0x4386('0x5e')](_0x24ce14['directory']);}return _0x24ce14;});})[_0x4386('0x49')](function(_0x21bc23){throw new db['Sequelize'][(_0x4386('0x5f'))](_0x21bc23['message']);});}})[_0x4386('0x24')](handleEntityNotFound(_0x4c85a1,null))[_0x4386('0x24')](removeEntity(_0x4c85a1,null))['catch'](handleError(_0x4c85a1,null));};exports[_0x4386('0x60')]=function(_0x3eff80,_0x83dedb,_0x1928f7){return db[_0x4386('0x4d')][_0x4386('0x4e')](function(_0x108357){var _0x352c96;return db[_0x4386('0x2e')][_0x4386('0x4b')]({'where':{'id':_0x3eff80['params']['id']}})['then'](function(_0x1b66f0){if(_0x1b66f0){_0x352c96=_0x1b66f0;return _0x1b66f0[_0x4386('0x60')](_0x3eff80[_0x4386('0x4a')]['id'],{'transaction':_0x108357});}})[_0x4386('0x24')](function(_0x3d1b3a){if(_0x3d1b3a){return db[_0x4386('0x61')][_0x4386('0x62')]({'where':{'id':_0x3eff80['body']['id']},'attributes':['id',_0x4386('0x2a'),_0x4386('0x63'),'converted_format',_0x4386('0x64')],'raw':!![]});}})['then'](function(_0x1bccc4){if(_0x1bccc4){var _0x2dbcd4=path[_0x4386('0x51')](config['root'],_0x4386('0x65'),util[_0x4386('0x66')](_0x4386('0x67'),path['basename'](_0x1bccc4[_0x4386('0x63')],path[_0x4386('0x68')](_0x1bccc4[_0x4386('0x63')])),_0x1bccc4['converted_format']));var _0x2b0a7d=path[_0x4386('0x51')](config['root'],'server/files/moh',_0x352c96['name'],util[_0x4386('0x66')](_0x4386('0x67'),_0x1bccc4[_0x4386('0x2a')],_0x1bccc4['converted_format']));fs[_0x4386('0x69')](_0x2dbcd4,_0x2b0a7d);return _0x1bccc4;}})[_0x4386('0x49')](function(_0x56e91e){throw new db['Sequelize'][(_0x4386('0x5f'))](_0x56e91e[_0x4386('0x6a')]);});})[_0x4386('0x24')](handleEntityNotFound(_0x83dedb,null))[_0x4386('0x24')](respondWithResult(_0x83dedb,0xc9))['catch'](handleError(_0x83dedb,null));};exports['removeSound']=function(_0x4b396f,_0x5beb9d,_0x1877a5){return db[_0x4386('0x4d')][_0x4386('0x4e')](function(_0x7d41cb){var _0x59a94b;return db[_0x4386('0x2e')]['findOne']({'where':{'id':_0x4b396f[_0x4386('0x46')]['id']}})[_0x4386('0x24')](handleEntityNotFound(_0x5beb9d,null))['then'](function(_0x19b9c4){if(_0x19b9c4){_0x59a94b=_0x19b9c4;return _0x19b9c4[_0x4386('0x6b')](_0x4b396f['params']['id2']);}})[_0x4386('0x24')](function(_0x221845){if(_0x221845){return db[_0x4386('0x61')][_0x4386('0x62')]({'where':{'id':_0x4b396f['params'][_0x4386('0x6c')]},'attributes':['id',_0x4386('0x2a'),_0x4386('0x63'),_0x4386('0x6d'),'createdAt'],'raw':!![]});}})[_0x4386('0x24')](function(_0xc1a010){if(_0xc1a010){fs['unlinkSync'](path[_0x4386('0x51')](_0x59a94b[_0x4386('0x50')],util[_0x4386('0x66')](_0x4386('0x67'),_0xc1a010['name'],_0xc1a010[_0x4386('0x6d')])));return _0xc1a010;}})[_0x4386('0x49')](function(_0x622d88){throw new db[(_0x4386('0x6e'))]['ValidationError'](_0x622d88['message']);});})[_0x4386('0x24')](handleEntityNotFound(_0x5beb9d,null))[_0x4386('0x24')](respondWithStatusCode(_0x5beb9d,0xcc))[_0x4386('0x49')](handleError(_0x5beb9d,null));};exports[_0x4386('0x6f')]=function(_0x3cbdba,_0x5d65d7,_0x127d7b){var _0x253f9a={};var _0x4e78b1={};var _0x49cdda;var _0x2ddb4d;return db[_0x4386('0x2e')][_0x4386('0x62')]({'where':{'id':_0x3cbdba[_0x4386('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d65d7,null))[_0x4386('0x24')](function(_0x31605b){if(_0x31605b){_0x49cdda=_0x31605b;_0x4e78b1['model']=_[_0x4386('0x32')](db[_0x4386('0x61')][_0x4386('0x47')]);_0x4e78b1['query']=_[_0x4386('0x32')](_0x3cbdba[_0x4386('0x33')]);_0x4e78b1['filters']=_[_0x4386('0x35')](_0x4e78b1[_0x4386('0x37')],_0x4e78b1[_0x4386('0x33')]);_0x253f9a[_0x4386('0x36')]=_['intersection'](_0x4e78b1[_0x4386('0x37')],qs['fields'](_0x3cbdba['query'][_0x4386('0x38')]));_0x253f9a[_0x4386('0x36')]=_0x253f9a[_0x4386('0x36')][_0x4386('0x39')]?_0x253f9a[_0x4386('0x36')]:_0x4e78b1[_0x4386('0x37')];_0x253f9a[_0x4386('0x3c')]=qs[_0x4386('0x3d')](_0x3cbdba[_0x4386('0x33')][_0x4386('0x3d')]);_0x253f9a['where']=qs[_0x4386('0x34')](_[_0x4386('0x3f')](_0x3cbdba[_0x4386('0x33')],_0x4e78b1['filters']));if(_0x3cbdba[_0x4386('0x33')][_0x4386('0x70')]){_0x253f9a[_0x4386('0x3e')]=_[_0x4386('0x40')](_0x253f9a[_0x4386('0x3e')],{'$or':_[_0x4386('0x2d')](_0x253f9a['attributes'],function(_0x1c7f4c){var _0x2ba494={};_0x2ba494[_0x1c7f4c]={'$like':'%'+_0x3cbdba[_0x4386('0x33')][_0x4386('0x70')]+'%'};return _0x2ba494;})});}_0x253f9a=_[_0x4386('0x40')]({},_0x253f9a,_0x3cbdba['options']);return _0x49cdda[_0x4386('0x6f')](_0x253f9a);}})[_0x4386('0x24')](function(_0x2c7b93){if(_0x2c7b93){_0x2ddb4d=_0x2c7b93['length'];if(!_0x3cbdba[_0x4386('0x33')][_0x4386('0x3a')]('nolimit')){_0x253f9a['limit']=qs[_0x4386('0x1d')](_0x3cbdba[_0x4386('0x33')]['limit']);_0x253f9a[_0x4386('0x1a')]=qs[_0x4386('0x1a')](_0x3cbdba[_0x4386('0x33')][_0x4386('0x1a')]);}return _0x49cdda[_0x4386('0x6f')](_0x253f9a);}})[_0x4386('0x24')](function(_0x38dcca){if(_0x38dcca){return _0x38dcca?{'count':_0x2ddb4d,'rows':_0x38dcca}:null;}})[_0x4386('0x24')](respondWithResult(_0x5d65d7,null))['catch'](handleError(_0x5d65d7,null));}; \ No newline at end of file +var _0xe90d=['sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','length','find','body','create','sequelize','files','directory','join','server/files/moh','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','ValidationError','message','addSound','Sound','save_name','createdAt','root','server/files/sounds/converted','%s.%s','basename','extname','converted_format','format','symlinkSync','Sequelize','removeSound','id2','findOne','unlinkSync','getSounds','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0xe86415,_0x4fe3ab){var _0x4dc900=function(_0xc4dd21){while(--_0xc4dd21){_0xe86415['push'](_0xe86415['shift']());}};_0x4dc900(++_0x4fe3ab);}(_0xe90d,0x123));var _0xde90=function(_0x1c80c,_0x20f7ce){_0x1c80c=_0x1c80c-0x0;var _0x347317=_0xe90d[_0x1c80c];return _0x347317;};'use strict';var emlformat=require(_0xde90('0x0'));var rimraf=require(_0xde90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde90('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xde90('0x3'));var Mustache=require(_0xde90('0x4'));var util=require(_0xde90('0x5'));var path=require(_0xde90('0x6'));var sox=require('sox');var csv=require(_0xde90('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde90('0x8'));var _=require(_0xde90('0x9'));var squel=require(_0xde90('0xa'));var crypto=require(_0xde90('0xb'));var jsforce=require(_0xde90('0xc'));var deskjs=require(_0xde90('0xd'));var toCsv=require(_0xde90('0x7'));var querystring=require('querystring');var Papa=require(_0xde90('0xe'));var Redis=require('ioredis');var authService=require(_0xde90('0xf'));var qs=require(_0xde90('0x10'));var as=require(_0xde90('0x11'));var hardwareService=require(_0xde90('0x12'));var logger=require(_0xde90('0x13'))(_0xde90('0x14'));var utils=require(_0xde90('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde90('0x16'));var db=require(_0xde90('0x17'))['db'];function respondWithStatusCode(_0xc6fbaf,_0x8258dc){_0x8258dc=_0x8258dc||0xcc;return function(_0x63ed0e){if(_0x63ed0e){return _0xc6fbaf['sendStatus'](_0x8258dc);}return _0xc6fbaf[_0xde90('0x18')](_0x8258dc)[_0xde90('0x19')]();};}function respondWithResult(_0x317c18,_0x261853){_0x261853=_0x261853||0xc8;return function(_0x30220b){if(_0x30220b){return _0x317c18[_0xde90('0x18')](_0x261853)[_0xde90('0x1a')](_0x30220b);}};}function respondWithFilteredResult(_0x22633f,_0x27e426){return function(_0x547ef8){if(_0x547ef8){var _0x246383=typeof _0x27e426[_0xde90('0x1b')]===_0xde90('0x1c')&&typeof _0x27e426[_0xde90('0x1d')]==='undefined';var _0x893881=_0x547ef8[_0xde90('0x1e')];var _0x263899=_0x246383?0x0:_0x27e426[_0xde90('0x1b')];var _0x5b4865=_0x246383?_0x547ef8[_0xde90('0x1e')]:_0x27e426['offset']+_0x27e426[_0xde90('0x1d')];var _0x24817b;if(_0x5b4865>=_0x893881){_0x5b4865=_0x893881;_0x24817b=0xc8;}else{_0x24817b=0xce;}_0x22633f[_0xde90('0x18')](_0x24817b);return _0x22633f['set'](_0xde90('0x1f'),_0x263899+'-'+_0x5b4865+'/'+_0x893881)['json'](_0x547ef8);}return null;};}function patchUpdates(_0x250598){return function(_0x119545){try{jsonpatch[_0xde90('0x20')](_0x119545,_0x250598,!![]);}catch(_0x5317d6){return BPromise[_0xde90('0x21')](_0x5317d6);}return _0x119545[_0xde90('0x22')]();};}function saveUpdates(_0x1070bc,_0x523cba){return function(_0x375596){if(_0x375596){return _0x375596[_0xde90('0x23')](_0x1070bc)[_0xde90('0x24')](function(_0x3bc6c1){return _0x3bc6c1;});}return null;};}function removeEntity(_0x485759,_0x51f095){return function(_0x313eff){if(_0x313eff){return _0x313eff['destroy']()[_0xde90('0x24')](function(){var _0x18d10a=_0x313eff[_0xde90('0x25')]({'plain':!![]});var _0x29f064=_0xde90('0x26');return db[_0xde90('0x27')][_0xde90('0x28')]({'where':{'type':_0x29f064,'resourceId':_0x18d10a['id']}})[_0xde90('0x24')](function(){return _0x313eff;});})['then'](function(){_0x485759[_0xde90('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0ff2,_0x210944){return function(_0x10f041){if(!_0x10f041){_0x2c0ff2[_0xde90('0x29')](0x194);}return _0x10f041;};}function handleError(_0xbf56c6,_0x55f859){_0x55f859=_0x55f859||0x1f4;return function(_0x2bb5c3){logger[_0xde90('0x2a')](_0x2bb5c3[_0xde90('0x2b')]);if(_0x2bb5c3[_0xde90('0x2c')]){delete _0x2bb5c3['name'];}_0xbf56c6[_0xde90('0x18')](_0x55f859)['send'](_0x2bb5c3);};}exports[_0xde90('0x2d')]=function(_0x5d812d,_0x5df18c){var _0x2c99a5={},_0x2301e7={},_0x3f0d84={'count':0x0,'rows':[]};var _0x360c89=_[_0xde90('0x2e')](db[_0xde90('0x2f')]['rawAttributes'],function(_0x48cb93){return{'name':_0x48cb93[_0xde90('0x30')],'type':_0x48cb93[_0xde90('0x31')][_0xde90('0x32')]};});_0x2301e7[_0xde90('0x33')]=_['map'](_0x360c89,_0xde90('0x2c'));_0x2301e7[_0xde90('0x34')]=_[_0xde90('0x35')](_0x5d812d['query']);_0x2301e7['filters']=_[_0xde90('0x36')](_0x2301e7['model'],_0x2301e7[_0xde90('0x34')]);_0x2c99a5[_0xde90('0x37')]=_[_0xde90('0x36')](_0x2301e7[_0xde90('0x33')],qs[_0xde90('0x38')](_0x5d812d['query']['fields']));_0x2c99a5['attributes']=_0x2c99a5[_0xde90('0x37')]['length']?_0x2c99a5[_0xde90('0x37')]:_0x2301e7['model'];if(!_0x5d812d['query'][_0xde90('0x39')](_0xde90('0x3a'))){_0x2c99a5['limit']=qs[_0xde90('0x1d')](_0x5d812d['query'][_0xde90('0x1d')]);_0x2c99a5[_0xde90('0x1b')]=qs[_0xde90('0x1b')](_0x5d812d[_0xde90('0x34')][_0xde90('0x1b')]);}_0x2c99a5[_0xde90('0x3b')]=qs['sort'](_0x5d812d[_0xde90('0x34')][_0xde90('0x3c')]);delete _0x5d812d['query'][_0xde90('0x3c')];_0x2c99a5['where']=qs['filters'](_[_0xde90('0x3d')](_0x5d812d[_0xde90('0x34')],_0x2301e7['filters']),_0x360c89);if(_0x5d812d['query'][_0xde90('0x3e')]){_0x2c99a5[_0xde90('0x3f')]=_[_0xde90('0x40')](_0x2c99a5['where'],{'$or':_[_0xde90('0x2e')](_0x360c89,function(_0x38b8ed){if(_0x38b8ed[_0xde90('0x31')]!=='VIRTUAL'){var _0x115f93={};_0x115f93[_0x38b8ed[_0xde90('0x2c')]]={'$like':'%'+_0x5d812d[_0xde90('0x34')][_0xde90('0x3e')]+'%'};return _0x115f93;}})});}_0x2c99a5=_[_0xde90('0x40')]({},_0x2c99a5,_0x5d812d[_0xde90('0x41')]);var _0xfc77c5={'where':_0x2c99a5[_0xde90('0x3f')]};return db['VoiceMusicOnHold'][_0xde90('0x1e')](_0xfc77c5)[_0xde90('0x24')](function(_0x14e99d){_0x3f0d84[_0xde90('0x1e')]=_0x14e99d;if(_0x5d812d['query'][_0xde90('0x42')]){_0x2c99a5[_0xde90('0x43')]=[{'all':!![]}];}return db[_0xde90('0x2f')][_0xde90('0x44')](_0x2c99a5);})[_0xde90('0x24')](function(_0x3eb0d5){_0x3f0d84[_0xde90('0x45')]=_0x3eb0d5;return _0x3f0d84;})[_0xde90('0x24')](respondWithFilteredResult(_0x5df18c,_0x2c99a5))[_0xde90('0x46')](handleError(_0x5df18c,null));};exports[_0xde90('0x47')]=function(_0x423932,_0x1018ad){var _0x117c5e={'raw':![],'where':{'id':_0x423932[_0xde90('0x48')]['id']}},_0x45789d={};_0x45789d[_0xde90('0x33')]=_[_0xde90('0x35')](db[_0xde90('0x2f')][_0xde90('0x49')]);_0x45789d[_0xde90('0x34')]=_[_0xde90('0x35')](_0x423932[_0xde90('0x34')]);_0x45789d[_0xde90('0x4a')]=_[_0xde90('0x36')](_0x45789d[_0xde90('0x33')],_0x45789d['query']);_0x117c5e[_0xde90('0x37')]=_['intersection'](_0x45789d[_0xde90('0x33')],qs[_0xde90('0x38')](_0x423932[_0xde90('0x34')][_0xde90('0x38')]));_0x117c5e[_0xde90('0x37')]=_0x117c5e[_0xde90('0x37')][_0xde90('0x4b')]?_0x117c5e[_0xde90('0x37')]:_0x45789d[_0xde90('0x33')];if(_0x423932[_0xde90('0x34')]['includeAll']){_0x117c5e[_0xde90('0x43')]=[{'all':!![]}];}_0x117c5e=_[_0xde90('0x40')]({},_0x117c5e,_0x423932[_0xde90('0x41')]);return db[_0xde90('0x2f')][_0xde90('0x4c')](_0x117c5e)[_0xde90('0x24')](handleEntityNotFound(_0x1018ad,null))[_0xde90('0x24')](respondWithResult(_0x1018ad,null))[_0xde90('0x46')](handleError(_0x1018ad,null));};exports[_0xde90('0x23')]=function(_0x4c6673,_0x35cdb8){if(_0x4c6673[_0xde90('0x4d')]['id']){delete _0x4c6673[_0xde90('0x4d')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4c6673[_0xde90('0x48')]['id']}})[_0xde90('0x24')](handleEntityNotFound(_0x35cdb8,null))[_0xde90('0x24')](saveUpdates(_0x4c6673[_0xde90('0x4d')],null))['then'](respondWithResult(_0x35cdb8,null))[_0xde90('0x46')](handleError(_0x35cdb8,null));};exports[_0xde90('0x4e')]=function(_0x487236,_0x22308d,_0x1dcb1d){return db[_0xde90('0x4f')]['transaction'](function(_0xd84282){if(_0x487236[_0xde90('0x4d')]['mode']===_0xde90('0x50')){_0x487236['body'][_0xde90('0x51')]=path[_0xde90('0x52')](config['root'],_0xde90('0x53'),_0x487236[_0xde90('0x4d')][_0xde90('0x2c')]);}return db[_0xde90('0x2f')][_0xde90('0x4e')](_0x487236[_0xde90('0x4d')],{'transaction':_0xd84282})[_0xde90('0x24')](function(_0x27fe46){if(_0x487236[_0xde90('0x4d')][_0xde90('0x54')]===_0xde90('0x50')){fs[_0xde90('0x55')](_0x27fe46[_0xde90('0x51')],parseInt(_0xde90('0x56'),0x8));}var _0x3206dd=_0x487236['user'][_0xde90('0x25')]({'plain':!![]});if(!_0x3206dd)throw new Error(_0xde90('0x57'));if(_0x3206dd['role']===_0xde90('0x58')){var _0x2d48e1=_0x27fe46[_0xde90('0x25')]({'plain':!![]});return db[_0xde90('0x59')][_0xde90('0x4c')]({'where':{'name':_0xde90('0x26'),'userProfileId':_0x3206dd[_0xde90('0x5a')]},'raw':!![]})['then'](function(_0x1af60c){if(_0x1af60c&&_0x1af60c[_0xde90('0x5b')]===0x0){return db[_0xde90('0x27')][_0xde90('0x4e')]({'name':_0x2d48e1[_0xde90('0x2c')],'resourceId':_0x2d48e1['id'],'type':_0x1af60c[_0xde90('0x2c')],'sectionId':_0x1af60c['id']},{})[_0xde90('0x24')](function(){return _0x27fe46;});}else{return _0x27fe46;}})[_0xde90('0x46')](function(_0x20358c){logger['error'](_0xde90('0x5c'),_0x20358c);});}return _0x27fe46;});})[_0xde90('0x24')](respondWithResult(_0x22308d,0xc9))[_0xde90('0x46')](handleError(_0x22308d,null));};exports[_0xde90('0x28')]=function(_0x15f08b,_0x35dc97,_0x4bc371){var _0x1cc323;return db['VoiceMusicOnHold'][_0xde90('0x4c')]({'where':{'id':_0x15f08b[_0xde90('0x48')]['id']}})[_0xde90('0x24')](function(_0x59d858){if(_0x59d858){return db[_0xde90('0x4f')][_0xde90('0x5d')](function(_0x142a36){return _0x59d858['destroy']({'transaction':_0x142a36,'raw':!![]})['then'](function(_0x10fbc5){if(_0x10fbc5[_0xde90('0x51')]){fs[_0xde90('0x5e')](_0x10fbc5[_0xde90('0x51')])[_0xde90('0x5f')](function(_0x4f512b){fs['unlinkSync'](path['join'](_0x10fbc5[_0xde90('0x51')],_0x4f512b));});fs[_0xde90('0x60')](_0x10fbc5[_0xde90('0x51')]);}return _0x10fbc5;});})[_0xde90('0x46')](function(_0x76d5f7){throw new db['Sequelize'][(_0xde90('0x61'))](_0x76d5f7[_0xde90('0x62')]);});}})['then'](handleEntityNotFound(_0x35dc97,null))[_0xde90('0x24')](removeEntity(_0x35dc97,null))[_0xde90('0x46')](handleError(_0x35dc97,null));};exports[_0xde90('0x63')]=function(_0x3ec1a5,_0x181b45,_0x1f7c70){return db[_0xde90('0x4f')]['transaction'](function(_0x199242){var _0x1a4691;return db[_0xde90('0x2f')]['find']({'where':{'id':_0x3ec1a5['params']['id']}})[_0xde90('0x24')](function(_0x5a6128){if(_0x5a6128){_0x1a4691=_0x5a6128;return _0x5a6128['addSound'](_0x3ec1a5[_0xde90('0x4d')]['id'],{'transaction':_0x199242});}})['then'](function(_0x571b41){if(_0x571b41){return db[_0xde90('0x64')]['findOne']({'where':{'id':_0x3ec1a5[_0xde90('0x4d')]['id']},'attributes':['id',_0xde90('0x2c'),_0xde90('0x65'),'converted_format',_0xde90('0x66')],'raw':!![]});}})[_0xde90('0x24')](function(_0x444182){if(_0x444182){var _0xe5df77=path[_0xde90('0x52')](config[_0xde90('0x67')],_0xde90('0x68'),util['format'](_0xde90('0x69'),path[_0xde90('0x6a')](_0x444182[_0xde90('0x65')],path[_0xde90('0x6b')](_0x444182['save_name'])),_0x444182[_0xde90('0x6c')]));var _0x34e7f8=path[_0xde90('0x52')](config[_0xde90('0x67')],'server/files/moh',_0x1a4691[_0xde90('0x2c')],util[_0xde90('0x6d')](_0xde90('0x69'),_0x444182['name'],_0x444182['converted_format']));fs[_0xde90('0x6e')](_0xe5df77,_0x34e7f8);return _0x444182;}})[_0xde90('0x46')](function(_0x30453f){throw new db[(_0xde90('0x6f'))][(_0xde90('0x61'))](_0x30453f[_0xde90('0x62')]);});})['then'](handleEntityNotFound(_0x181b45,null))[_0xde90('0x24')](respondWithResult(_0x181b45,0xc9))[_0xde90('0x46')](handleError(_0x181b45,null));};exports[_0xde90('0x70')]=function(_0x429fde,_0x2e4cdf,_0x127ee0){return db[_0xde90('0x4f')][_0xde90('0x5d')](function(_0x973343){var _0x47b756;return db[_0xde90('0x2f')]['findOne']({'where':{'id':_0x429fde[_0xde90('0x48')]['id']}})[_0xde90('0x24')](handleEntityNotFound(_0x2e4cdf,null))['then'](function(_0x369488){if(_0x369488){_0x47b756=_0x369488;return _0x369488[_0xde90('0x70')](_0x429fde[_0xde90('0x48')][_0xde90('0x71')]);}})[_0xde90('0x24')](function(_0x56f1e0){if(_0x56f1e0){return db[_0xde90('0x64')][_0xde90('0x72')]({'where':{'id':_0x429fde[_0xde90('0x48')]['id2']},'attributes':['id',_0xde90('0x2c'),_0xde90('0x65'),_0xde90('0x6c'),_0xde90('0x66')],'raw':!![]});}})[_0xde90('0x24')](function(_0x194400){if(_0x194400){fs[_0xde90('0x73')](path[_0xde90('0x52')](_0x47b756[_0xde90('0x51')],util[_0xde90('0x6d')]('%s.%s',_0x194400['name'],_0x194400[_0xde90('0x6c')])));return _0x194400;}})[_0xde90('0x46')](function(_0x7d0d5c){throw new db[(_0xde90('0x6f'))][(_0xde90('0x61'))](_0x7d0d5c[_0xde90('0x62')]);});})[_0xde90('0x24')](handleEntityNotFound(_0x2e4cdf,null))[_0xde90('0x24')](respondWithStatusCode(_0x2e4cdf,0xcc))[_0xde90('0x46')](handleError(_0x2e4cdf,null));};exports[_0xde90('0x74')]=function(_0x20b774,_0x1f0c9c,_0xd19342){var _0x4579b7={};var _0x2dcaed={};var _0x245cda;var _0x28b395;return db[_0xde90('0x2f')]['findOne']({'where':{'id':_0x20b774[_0xde90('0x48')]['id']}})[_0xde90('0x24')](handleEntityNotFound(_0x1f0c9c,null))[_0xde90('0x24')](function(_0x128041){if(_0x128041){_0x245cda=_0x128041;_0x2dcaed[_0xde90('0x33')]=_[_0xde90('0x35')](db[_0xde90('0x64')][_0xde90('0x49')]);_0x2dcaed[_0xde90('0x34')]=_[_0xde90('0x35')](_0x20b774[_0xde90('0x34')]);_0x2dcaed['filters']=_[_0xde90('0x36')](_0x2dcaed[_0xde90('0x33')],_0x2dcaed[_0xde90('0x34')]);_0x4579b7['attributes']=_[_0xde90('0x36')](_0x2dcaed[_0xde90('0x33')],qs[_0xde90('0x38')](_0x20b774[_0xde90('0x34')][_0xde90('0x38')]));_0x4579b7[_0xde90('0x37')]=_0x4579b7['attributes']['length']?_0x4579b7['attributes']:_0x2dcaed['model'];_0x4579b7['order']=qs['sort'](_0x20b774[_0xde90('0x34')][_0xde90('0x3c')]);_0x4579b7[_0xde90('0x3f')]=qs['filters'](_[_0xde90('0x3d')](_0x20b774[_0xde90('0x34')],_0x2dcaed[_0xde90('0x4a')]));if(_0x20b774[_0xde90('0x34')][_0xde90('0x3e')]){_0x4579b7[_0xde90('0x3f')]=_[_0xde90('0x40')](_0x4579b7[_0xde90('0x3f')],{'$or':_['map'](_0x4579b7[_0xde90('0x37')],function(_0x2574e9){var _0x39f8bd={};_0x39f8bd[_0x2574e9]={'$like':'%'+_0x20b774[_0xde90('0x34')][_0xde90('0x3e')]+'%'};return _0x39f8bd;})});}_0x4579b7=_[_0xde90('0x40')]({},_0x4579b7,_0x20b774[_0xde90('0x41')]);return _0x245cda['getSounds'](_0x4579b7);}})[_0xde90('0x24')](function(_0x562848){if(_0x562848){_0x28b395=_0x562848['length'];if(!_0x20b774[_0xde90('0x34')]['hasOwnProperty']('nolimit')){_0x4579b7[_0xde90('0x1d')]=qs['limit'](_0x20b774['query'][_0xde90('0x1d')]);_0x4579b7['offset']=qs[_0xde90('0x1b')](_0x20b774[_0xde90('0x34')]['offset']);}return _0x245cda[_0xde90('0x74')](_0x4579b7);}})[_0xde90('0x24')](function(_0x5ee773){if(_0x5ee773){return _0x5ee773?{'count':_0x28b395,'rows':_0x5ee773}:null;}})[_0xde90('0x24')](respondWithResult(_0x1f0c9c,null))['catch'](handleError(_0x1f0c9c,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 257642b..7bc4402 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 _0xbef2=['api','bluebird','request-promise','rimraf','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','util','../../config/logger'];(function(_0x30afed,_0x2c2538){var _0x91f9fa=function(_0xc75e75){while(--_0xc75e75){_0x30afed['push'](_0x30afed['shift']());}};_0x91f9fa(++_0x2c2538);}(_0xbef2,0xa7));var _0x2bef=function(_0x514d2f,_0x3a2994){_0x514d2f=_0x514d2f-0x0;var _0x441389=_0xbef2[_0x514d2f];return _0x441389;};'use strict';var _=require(_0x2bef('0x0'));var util=require(_0x2bef('0x1'));var logger=require(_0x2bef('0x2'))(_0x2bef('0x3'));var moment=require('moment');var BPromise=require(_0x2bef('0x4'));var rp=require(_0x2bef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2bef('0x6'));var config=require('../../config/environment');var attributes=require(_0x2bef('0x7'));module[_0x2bef('0x8')]=function(_0x23d90c,_0x4b098c){return _0x23d90c['define'](_0x2bef('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aed=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api'];(function(_0x3f5963,_0x3739dd){var _0xcecb22=function(_0x3ee523){while(--_0x3ee523){_0x3f5963['push'](_0x3f5963['shift']());}};_0xcecb22(++_0x3739dd);}(_0x8aed,0x190));var _0xd8ae=function(_0x47eedb,_0x118339){_0x47eedb=_0x47eedb-0x0;var _0x1c07be=_0x8aed[_0x47eedb];return _0x1c07be;};'use strict';var _=require(_0xd8ae('0x0'));var util=require('util');var logger=require(_0xd8ae('0x1'))(_0xd8ae('0x2'));var moment=require(_0xd8ae('0x3'));var BPromise=require(_0xd8ae('0x4'));var rp=require(_0xd8ae('0x5'));var fs=require('fs');var path=require(_0xd8ae('0x6'));var rimraf=require(_0xd8ae('0x7'));var config=require(_0xd8ae('0x8'));var attributes=require(_0xd8ae('0x9'));module['exports']=function(_0x2b8021,_0x12364a){return _0x2b8021[_0xd8ae('0xa')](_0xd8ae('0xb'),attributes,{'tableName':_0xd8ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index fd01774..3ec5d2b 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(_0x2c65cf,_0x139780){var _0x365984=function(_0x503c83){while(--_0x503c83){_0x2c65cf['push'](_0x2c65cf['shift']());}};_0x365984(++_0x139780);}(_0x70e0,0x17b));var _0x070e=function(_0x2058be,_0x4e9806){_0x2058be=_0x2058be-0x0;var _0x296eef=_0x70e0[_0x2058be];return _0x296eef;};'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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x589636,_0x6d87fd){var _0x57cfa0=function(_0x53d1ae){while(--_0x53d1ae){_0x589636['push'](_0x589636['shift']());}};_0x57cfa0(++_0x6d87fd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 77d6ab9..a674572 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 _0x1f75=['../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','getTeams','post','addAgents','/:id/teams','put','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a8d9d,_0x1258b9){var _0x5c1c28=function(_0x38f8e0){while(--_0x38f8e0){_0x2a8d9d['push'](_0x2a8d9d['shift']());}};_0x5c1c28(++_0x1258b9);}(_0x1f75,0x12c));var _0x51f7=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x1f75[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x51f7('0x0'));var util=require(_0x51f7('0x1'));var path=require(_0x51f7('0x2'));var timeout=require('connect-timeout');var express=require(_0x51f7('0x3'));var router=express[_0x51f7('0x4')]();var fs_extra=require(_0x51f7('0x5'));var auth=require(_0x51f7('0x6'));var interaction=require(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var controller=require(_0x51f7('0x9'));router[_0x51f7('0xa')]('/',auth[_0x51f7('0xb')](),controller[_0x51f7('0xc')]);router[_0x51f7('0xa')](_0x51f7('0xd'),auth['isAuthenticated'](),controller[_0x51f7('0xe')]);router[_0x51f7('0xa')](_0x51f7('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x51f7('0xa')](_0x51f7('0x10'),auth['isAuthenticated'](),controller[_0x51f7('0x11')]);router[_0x51f7('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0x51f7('0x12')]);router[_0x51f7('0x13')]('/',auth[_0x51f7('0xb')](),controller['create']);router[_0x51f7('0x13')](_0x51f7('0x10'),auth['isAuthenticated'](),controller[_0x51f7('0x14')]);router[_0x51f7('0x13')](_0x51f7('0x15'),auth['isAuthenticated'](),controller['addTeams']);router[_0x51f7('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x51f7('0x17')](_0x51f7('0xf'),auth[_0x51f7('0xb')](),controller[_0x51f7('0x18')]);router['delete'](_0x51f7('0x10'),auth[_0x51f7('0xb')](),controller[_0x51f7('0x19')]);router[_0x51f7('0x17')](_0x51f7('0x15'),auth[_0x51f7('0xb')](),controller[_0x51f7('0x1a')]);module[_0x51f7('0x1b')]=router; \ No newline at end of file +var _0xbcc7=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','/:id','update','delete','destroy','removeAgents','multer','util','connect-timeout','fs-extra'];(function(_0x22d581,_0x331408){var _0x5ac3b4=function(_0x4b035a){while(--_0x4b035a){_0x22d581['push'](_0x22d581['shift']());}};_0x5ac3b4(++_0x331408);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x5ecdde,_0x55bf08){_0x5ecdde=_0x5ecdde-0x0;var _0x593585=_0xbcc7[_0x5ecdde];return _0x593585;};'use strict';var multer=require(_0x7bcc('0x0'));var util=require(_0x7bcc('0x1'));var path=require('path');var timeout=require(_0x7bcc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7bcc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7bcc('0x4'));var config=require(_0x7bcc('0x5'));var controller=require('./voicePrefix.controller');router[_0x7bcc('0x6')]('/',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x8')]);router[_0x7bcc('0x6')](_0x7bcc('0x9'),auth[_0x7bcc('0x7')](),controller['describe']);router[_0x7bcc('0x6')]('/:id',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0xa')]);router['get'](_0x7bcc('0xb'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x7bcc('0xc'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0xd')]);router[_0x7bcc('0xe')]('/',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0xf')]);router[_0x7bcc('0xe')]('/:id/users',auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x10')]);router[_0x7bcc('0xe')](_0x7bcc('0xc'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x11')]);router['put'](_0x7bcc('0x12'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x13')]);router[_0x7bcc('0x14')](_0x7bcc('0x12'),auth[_0x7bcc('0x7')](),controller[_0x7bcc('0x15')]);router['delete'](_0x7bcc('0xb'),auth['isAuthenticated'](),controller[_0x7bcc('0x16')]);router[_0x7bcc('0x14')](_0x7bcc('0xc'),auth[_0x7bcc('0x7')](),controller['removeTeams']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 424181c..73794a2 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 _0x0e12=['INTEGER','exports','STRING','name','system-','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e12,0x1c3));var _0x20e1=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x0e12[_0x216d45];return _0xbaac0b;};'use strict';var Sequelize=require('sequelize');module[_0x20e1('0x0')]={'name':{'type':Sequelize[_0x20e1('0x1')],'allowNull':![],'unique':_0x20e1('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x346c45){return _0x20e1('0x3')+this[_0x20e1('0x4')](_0x20e1('0x2'))+'-';}},'description':{'type':Sequelize[_0x20e1('0x1')]},'callerIdAll':{'type':Sequelize[_0x20e1('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x20e1('0x5')]}}; \ No newline at end of file +var _0x7704=['VIRTUAL','system-','INTEGER','exports','STRING','name'];(function(_0xf6615a,_0x1d6e2c){var _0x362f2e=function(_0xbbe4f3){while(--_0xbbe4f3){_0xf6615a['push'](_0xf6615a['shift']());}};_0x362f2e(++_0x1d6e2c);}(_0x7704,0xe1));var _0x4770=function(_0x159b50,_0x4316ee){_0x159b50=_0x159b50-0x0;var _0x3ac3e7=_0x7704[_0x159b50];return _0x3ac3e7;};'use strict';var Sequelize=require('sequelize');module[_0x4770('0x0')]={'name':{'type':Sequelize[_0x4770('0x1')],'allowNull':![],'unique':_0x4770('0x2')},'prefix':{'type':Sequelize[_0x4770('0x3')],'get':function(_0x373341){return _0x4770('0x4')+this['getDataValue'](_0x4770('0x2'))+'-';}},'description':{'type':Sequelize[_0x4770('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x4770('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2d5c88f..caaed30 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 _0x4213=['limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','name','index','map','VoicePrefix','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','find','catch','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','CDR(prefix)=','callerIdAll','Set','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','nolimit','Team','order','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','offset','undefined'];(function(_0x3dd3ee,_0x3dbf50){var _0x59b7a9=function(_0x16df3b){while(--_0x16df3b){_0x3dd3ee['push'](_0x3dd3ee['shift']());}};_0x59b7a9(++_0x3dbf50);}(_0x4213,0x77));var _0x3421=function(_0x3ffb65,_0xb02c87){_0x3ffb65=_0x3ffb65-0x0;var _0x1fce79=_0x4213[_0x3ffb65];return _0x1fce79;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3421('0x12'));var logger=require(_0x3421('0x13'))(_0x3421('0x14'));var utils=require(_0x3421('0x15'));var config=require(_0x3421('0x16'));var licenseUtil=require(_0x3421('0x17'));var db=require(_0x3421('0x18'))['db'];config['redis']=_[_0x3421('0x19')](config[_0x3421('0x1a')],{'host':_0x3421('0x1b'),'port':0x18eb});var socket=require(_0x3421('0x1c'))(new Redis(config[_0x3421('0x1a')]));require(_0x3421('0x1d'))[_0x3421('0x1e')](socket);function respondWithStatusCode(_0x59ea4a,_0xafd9e0){_0xafd9e0=_0xafd9e0||0xcc;return function(_0x4b5f43){if(_0x4b5f43){return _0x59ea4a[_0x3421('0x1f')](_0xafd9e0);}return _0x59ea4a[_0x3421('0x20')](_0xafd9e0)['end']();};}function respondWithResult(_0x1e33ab,_0x4c6f7b){_0x4c6f7b=_0x4c6f7b||0xc8;return function(_0x16bc8f){if(_0x16bc8f){return _0x1e33ab[_0x3421('0x20')](_0x4c6f7b)['json'](_0x16bc8f);}};}function respondWithFilteredResult(_0x3584d6,_0x3dec08){return function(_0x130d3c){if(_0x130d3c){var _0x104cc5=typeof _0x3dec08[_0x3421('0x21')]===_0x3421('0x22')&&typeof _0x3dec08[_0x3421('0x23')]===_0x3421('0x22');var _0x197b83=_0x130d3c[_0x3421('0x24')];var _0x538a8b=_0x104cc5?0x0:_0x3dec08['offset'];var _0x420114=_0x104cc5?_0x130d3c['count']:_0x3dec08['offset']+_0x3dec08['limit'];var _0x33155b;if(_0x420114>=_0x197b83){_0x420114=_0x197b83;_0x33155b=0xc8;}else{_0x33155b=0xce;}_0x3584d6[_0x3421('0x20')](_0x33155b);return _0x3584d6[_0x3421('0x25')](_0x3421('0x26'),_0x538a8b+'-'+_0x420114+'/'+_0x197b83)[_0x3421('0x27')](_0x130d3c);}return null;};}function patchUpdates(_0x39bed4){return function(_0x3df305){try{jsonpatch[_0x3421('0x28')](_0x3df305,_0x39bed4,!![]);}catch(_0xb9af5f){return BPromise[_0x3421('0x29')](_0xb9af5f);}return _0x3df305['save']();};}function saveUpdates(_0x57a4af,_0x494423){return function(_0x3fef90){if(_0x3fef90){return _0x3fef90[_0x3421('0x2a')](_0x57a4af)[_0x3421('0x2b')](function(_0x5bc28a){return _0x5bc28a;});}return null;};}function removeEntity(_0x506af4,_0x1b65d0){return function(_0x5b53b6){if(_0x5b53b6){return _0x5b53b6[_0x3421('0x2c')]()['then'](function(){var _0x15e73c=_0x5b53b6[_0x3421('0x2d')]({'plain':!![]});var _0x36d75f=_0x3421('0x2e');return db[_0x3421('0x2f')]['destroy']({'where':{'type':_0x36d75f,'resourceId':_0x15e73c['id']}})[_0x3421('0x2b')](function(){return _0x5b53b6;});})['then'](function(){_0x506af4['status'](0xcc)[_0x3421('0x30')]();});}};}function handleEntityNotFound(_0x5aa96b,_0x5074a2){return function(_0xb4eaf4){if(!_0xb4eaf4){_0x5aa96b['sendStatus'](0x194);}return _0xb4eaf4;};}function handleError(_0x20abc7,_0x5bcd19){_0x5bcd19=_0x5bcd19||0x1f4;return function(_0xc7f9fb){logger[_0x3421('0x31')](_0xc7f9fb['stack']);if(_0xc7f9fb[_0x3421('0x32')]){delete _0xc7f9fb[_0x3421('0x32')];}_0x20abc7[_0x3421('0x20')](_0x5bcd19)['send'](_0xc7f9fb);};}exports[_0x3421('0x33')]=function(_0x50d61b,_0x2b5af4){var _0xf0039={},_0x1045ab={},_0x841e08={'count':0x0,'rows':[]};var _0x3875c6=_[_0x3421('0x34')](db[_0x3421('0x35')][_0x3421('0x36')],function(_0x94559a){return{'name':_0x94559a[_0x3421('0x37')],'type':_0x94559a['type']['key']};});_0x1045ab[_0x3421('0x38')]=_[_0x3421('0x34')](_0x3875c6,'name');_0x1045ab[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x50d61b[_0x3421('0x39')]);_0x1045ab[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x1045ab['model'],_0x1045ab[_0x3421('0x39')]);_0xf0039[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x1045ab['model'],qs[_0x3421('0x3e')](_0x50d61b['query'][_0x3421('0x3e')]));_0xf0039[_0x3421('0x3d')]=_0xf0039[_0x3421('0x3d')][_0x3421('0x3f')]?_0xf0039[_0x3421('0x3d')]:_0x1045ab[_0x3421('0x38')];if(!_0x50d61b[_0x3421('0x39')]['hasOwnProperty']('nolimit')){_0xf0039['limit']=qs[_0x3421('0x23')](_0x50d61b['query']['limit']);_0xf0039[_0x3421('0x21')]=qs['offset'](_0x50d61b[_0x3421('0x39')][_0x3421('0x21')]);}_0xf0039['order']=qs[_0x3421('0x40')](_0x50d61b[_0x3421('0x39')][_0x3421('0x40')]);_0xf0039[_0x3421('0x41')]=qs['filters'](_[_0x3421('0x42')](_0x50d61b[_0x3421('0x39')],_0x1045ab[_0x3421('0x3b')]),_0x3875c6);if(_0x50d61b[_0x3421('0x39')][_0x3421('0x43')]){_0xf0039['where']=_[_0x3421('0x44')](_0xf0039[_0x3421('0x41')],{'$or':_['map'](_0x3875c6,function(_0x15551c){if(_0x15551c['type']!=='VIRTUAL'){var _0x486ce8={};_0x486ce8[_0x15551c[_0x3421('0x32')]]={'$like':'%'+_0x50d61b[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x486ce8;}})});}_0xf0039=_[_0x3421('0x44')]({},_0xf0039,_0x50d61b[_0x3421('0x45')]);var _0x417d6e={'where':_0xf0039[_0x3421('0x41')]};return db[_0x3421('0x35')][_0x3421('0x24')](_0x417d6e)[_0x3421('0x2b')](function(_0x3b9d15){_0x841e08[_0x3421('0x24')]=_0x3b9d15;if(_0x50d61b[_0x3421('0x39')][_0x3421('0x46')]){_0xf0039['include']=[{'all':!![]}];}return db[_0x3421('0x35')][_0x3421('0x47')](_0xf0039);})[_0x3421('0x2b')](function(_0x4466be){_0x841e08['rows']=_0x4466be;return _0x841e08;})[_0x3421('0x2b')](respondWithFilteredResult(_0x2b5af4,_0xf0039))['catch'](handleError(_0x2b5af4,null));};exports[_0x3421('0x48')]=function(_0x248f84,_0x669cfd){var _0x176aef={'raw':![],'where':{'id':_0x248f84[_0x3421('0x49')]['id']}},_0x2f9a84={};_0x2f9a84[_0x3421('0x38')]=_[_0x3421('0x3a')](db[_0x3421('0x35')][_0x3421('0x36')]);_0x2f9a84[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x248f84[_0x3421('0x39')]);_0x2f9a84['filters']=_[_0x3421('0x3c')](_0x2f9a84['model'],_0x2f9a84[_0x3421('0x39')]);_0x176aef[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x2f9a84[_0x3421('0x38')],qs[_0x3421('0x3e')](_0x248f84[_0x3421('0x39')][_0x3421('0x3e')]));_0x176aef[_0x3421('0x3d')]=_0x176aef[_0x3421('0x3d')][_0x3421('0x3f')]?_0x176aef['attributes']:_0x2f9a84[_0x3421('0x38')];if(_0x248f84[_0x3421('0x39')][_0x3421('0x46')]){_0x176aef['include']=[{'all':!![]}];}_0x176aef=_['merge']({},_0x176aef,_0x248f84[_0x3421('0x45')]);return db[_0x3421('0x35')][_0x3421('0x4a')](_0x176aef)['then'](handleEntityNotFound(_0x669cfd,null))[_0x3421('0x2b')](respondWithResult(_0x669cfd,null))[_0x3421('0x4b')](handleError(_0x669cfd,null));};exports[_0x3421('0x2c')]=function(_0x356376,_0x57554a){return db[_0x3421('0x35')][_0x3421('0x4a')]({'where':{'id':_0x356376[_0x3421('0x49')]['id']}})['then'](handleEntityNotFound(_0x57554a,null))['then'](removeEntity(_0x57554a,null))['catch'](handleError(_0x57554a,null));};exports[_0x3421('0x4c')]=function(_0x1021f8,_0x5a9ccf){return db['VoicePrefix'][_0x3421('0x4c')]()[_0x3421('0x2b')](respondWithResult(_0x5a9ccf,null))[_0x3421('0x4b')](handleError(_0x5a9ccf,null));};exports[_0x3421('0x4d')]=function(_0x127835,_0x4987e3){var _0x27d284;return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x2f9ce1){return db['VoicePrefix'][_0x3421('0x4d')](_0x127835[_0x3421('0x50')],{'transaction':_0x2f9ce1})[_0x3421('0x2b')](function(_0x48a967){_0x27d284=_0x48a967[_0x3421('0x2d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x27d284[_0x3421('0x51')]},'raw':!![]})['then'](function(_0x4e33a0){return createVoicePrefixExtensions(_0x27d284,_0x4e33a0,_0x2f9ce1);});});})[_0x3421('0x2b')](function(){var _0x12bd9a=_0x127835['user'][_0x3421('0x2d')]({'plain':!![]});if(!_0x12bd9a)throw new Error(_0x3421('0x52'));if(_0x12bd9a[_0x3421('0x53')]===_0x3421('0x54')){var _0x1c73b9=_0x27d284;return db[_0x3421('0x55')][_0x3421('0x4a')]({'where':{'name':_0x3421('0x2e'),'userProfileId':_0x12bd9a[_0x3421('0x56')]},'raw':!![]})['then'](function(_0x1e4add){if(_0x1e4add&&_0x1e4add[_0x3421('0x57')]===0x0){return db['UserProfileResource'][_0x3421('0x4d')]({'name':_0x1c73b9[_0x3421('0x32')],'resourceId':_0x1c73b9['id'],'type':_0x1e4add[_0x3421('0x32')],'sectionId':_0x1e4add['id']},{})['then'](function(){return _0x27d284;});}else{return _0x27d284;}})[_0x3421('0x4b')](function(_0x27085d){logger[_0x3421('0x31')](_0x3421('0x58'),_0x27085d);throw _0x27085d;});}return _0x27d284;})[_0x3421('0x2b')](respondWithResult(_0x4987e3,null))[_0x3421('0x4b')](handleError(_0x4987e3,null));};function Extension(_0x333b86,_0x3254aa,_0x31fd9b,_0x279b44){this[_0x3421('0x59')]=_0x3421('0x5a');this[_0x3421('0x5b')]=_0x333b86;this[_0x3421('0x5c')]=_0x31fd9b;this[_0x3421('0x5d')]='system';this[_0x3421('0x5e')]=_0x3421('0x5f');this[_0x3421('0x60')]=_0x3254aa;this[_0x3421('0x61')]=_0x279b44;}function createVoicePrefixExtensions(_0x1813c9,_0x25a641,_0x32c9a7){return new BPromise(function(_0x374a6a,_0x5d6488){var _0x379673=new Extension(formatPrefixName(_0x1813c9['prefix']),0x1,_0x3421('0x62'),_0x3421('0x63'));_0x379673[_0x3421('0x64')]=_0x1813c9['id'];return db[_0x3421('0x65')]['create'](_0x379673,{'transaction':_0x32c9a7})[_0x3421('0x2b')](function(_0x21e11b){var _0x9def45=_0x21e11b[_0x3421('0x2d')]({'plain':!![]});var _0x9e649=_[_0x3421('0x34')](addVoicePrefixExtensions(_0x1813c9,_0x25a641),function(_0x5e6c4d){_0x5e6c4d[_0x3421('0x51')]=_0x9def45['id'];_0x5e6c4d[_0x3421('0x64')]=_0x1813c9['id'];return _0x5e6c4d;});return db[_0x3421('0x65')][_0x3421('0x66')](_0x9e649,{'transaction':_0x32c9a7})[_0x3421('0x2b')](function(_0x1ba5e1){if(!_0x1ba5e1){return _0x5d6488(_0x3421('0x67'));}else{return _0x374a6a(_0x1ba5e1);}})[_0x3421('0x4b')](function(_0x4edb4e){return _0x5d6488(_0x4edb4e);});});;});};function addVoicePrefixExtensions(_0xfbdb57,_0x46717b){var _0x200958=[];var _0x40ae83=formatPrefixName(_0xfbdb57[_0x3421('0x68')]);_0x200958['push'](new Extension(_0x40ae83,0x2,'Set',_0x3421('0x69')+_0xfbdb57[_0x3421('0x32')]));if(_0xfbdb57[_0x3421('0x6a')]){_0x200958['push'](new Extension(_0x40ae83,0x3,_0x3421('0x6b'),'PREFIX-CALLERIDALL='+_0xfbdb57[_0x3421('0x6a')]));}else{_0x200958['push'](new Extension(_0x40ae83,0x3,'NoOp','No\x20callerid\x20available'));}_0x200958['push'](new Extension(_0x40ae83,0x4,'goto',_0x46717b[_0x3421('0x59')]+','+_0x3421('0x6c')+(0x8+_0xfbdb57[_0x3421('0x32')][_0x3421('0x3f')])+'}'+','+0x1));return _0x200958;}function formatPrefixName(_0xa05828){var _0x3ccb08='_';for(var _0x231067=0x0;_0x231067<_0xa05828[_0x3421('0x3f')];_0x231067++){if(_0xa05828[_0x3421('0x6d')](_0x231067)=='-'){_0x3ccb08+=_0xa05828[_0x3421('0x6d')](_0x231067);}else{_0x3ccb08+='['+_0xa05828['charAt'](_0x231067)+']';}}_0x3ccb08+='.';return _0x3ccb08;}exports[_0x3421('0x2a')]=function(_0x4dce60,_0x252b28,_0x41e5f8){var _0x40e0a6=_0x4dce60[_0x3421('0x50')];_0x40e0a6[_0x3421('0x68')]=_0x3421('0x6e')+_0x40e0a6[_0x3421('0x32')]+'-';return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x5c74a8){return db[_0x3421('0x35')][_0x3421('0x2a')](_0x40e0a6,{'where':{'id':_0x40e0a6['id']},'transaction':_0x5c74a8})[_0x3421('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x40e0a6['id']},'transaction':_0x5c74a8})['then'](function(){return db['VoiceExtension'][_0x3421('0x4a')]({'where':{'id':_0x40e0a6['VoiceExtensionId']},'raw':!![]})[_0x3421('0x2b')](function(_0x8aee05){return createVoicePrefixExtensions(_0x40e0a6,_0x8aee05,_0x5c74a8);});});});})[_0x3421('0x2b')](function(){return db[_0x3421('0x35')]['findById'](_0x40e0a6['id']);})[_0x3421('0x2b')](respondWithResult(_0x252b28,null))[_0x3421('0x4b')](handleError(_0x252b28,null));};exports[_0x3421('0x6f')]=function(_0xfb8c60,_0x151eaf,_0x4177cc){return db['VoicePrefix'][_0x3421('0x4a')]({'where':{'id':_0xfb8c60[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x151eaf,null))[_0x3421('0x2b')](function(_0x37e6d8){if(_0x37e6d8){return _0x37e6d8[_0x3421('0x6f')](_0xfb8c60[_0x3421('0x50')]['ids'],_['omit'](_0xfb8c60[_0x3421('0x50')],[_0x3421('0x70'),'id'])||{})[_0x3421('0x71')](function(_0x5d04c6){for(var _0x2dac40=0x0;_0x2dac40<_0xfb8c60['body'][_0x3421('0x70')]['length'];_0x2dac40+=0x1){socket[_0x3421('0x72')](_0x3421('0x73'),{'UserId':Number(_0xfb8c60[_0x3421('0x50')][_0x3421('0x70')][_0x2dac40]),'VoicePrefixId':Number(_0xfb8c60[_0x3421('0x49')]['id'])});}return _0x5d04c6;});}})[_0x3421('0x2b')](respondWithResult(_0x151eaf,null))[_0x3421('0x4b')](handleError(_0x151eaf,null));};exports[_0x3421('0x74')]=function(_0x3f1df5,_0x37ca80,_0x427013){return db[_0x3421('0x35')]['find']({'where':{'id':_0x3f1df5[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x37ca80,null))[_0x3421('0x2b')](function(_0x387d09){if(_0x387d09){return _0x387d09[_0x3421('0x74')](_0x3f1df5[_0x3421('0x39')][_0x3421('0x70')])[_0x3421('0x2b')](function(){if(_['isArray'](_0x3f1df5[_0x3421('0x39')]['ids'])){for(var _0x4d92ed=0x0;_0x4d92ed<_0x3f1df5['query'][_0x3421('0x70')][_0x3421('0x3f')];_0x4d92ed+=0x1){socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':Number(_0x3f1df5['query'][_0x3421('0x70')][_0x4d92ed]),'VoicePrefixId':Number(_0x3f1df5[_0x3421('0x49')]['id'])});}}else{socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':Number(_0x3f1df5[_0x3421('0x39')][_0x3421('0x70')]),'VoicePrefixId':Number(_0x3f1df5[_0x3421('0x49')]['id'])});}});}})[_0x3421('0x2b')](respondWithStatusCode(_0x37ca80,null))[_0x3421('0x4b')](handleError(_0x37ca80,null));};exports[_0x3421('0x76')]=function(_0x19e35d,_0x414218,_0x1d65ba){var _0x170340={};var _0x456644={};var _0x355f47;var _0x826d7c;return db['VoicePrefix']['findOne']({'where':{'id':_0x19e35d[_0x3421('0x49')]['id']}})['then'](handleEntityNotFound(_0x414218,null))[_0x3421('0x2b')](function(_0x2fd442){if(_0x2fd442){_0x355f47=_0x2fd442;_0x456644['model']=_[_0x3421('0x3a')](db[_0x3421('0x77')][_0x3421('0x36')]);_0x456644[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x19e35d[_0x3421('0x39')]);_0x456644[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x456644[_0x3421('0x38')],_0x456644[_0x3421('0x39')]);_0x170340[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x456644[_0x3421('0x38')],qs['fields'](_0x19e35d[_0x3421('0x39')]['fields']));_0x170340[_0x3421('0x3d')]=_0x170340[_0x3421('0x3d')]['length']?_0x170340[_0x3421('0x3d')]:_0x456644['model'];_0x170340['order']=qs[_0x3421('0x40')](_0x19e35d[_0x3421('0x39')][_0x3421('0x40')]);_0x170340['where']=qs[_0x3421('0x3b')](_[_0x3421('0x42')](_0x19e35d[_0x3421('0x39')],_0x456644['filters']));if(_0x19e35d['query'][_0x3421('0x43')]){_0x170340[_0x3421('0x41')]=_[_0x3421('0x44')](_0x170340[_0x3421('0x41')],{'$or':_['map'](_0x170340[_0x3421('0x3d')],function(_0x1fcd4b){var _0x298afc={};_0x298afc[_0x1fcd4b]={'$like':'%'+_0x19e35d[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x298afc;})});}_0x170340=_[_0x3421('0x44')]({},_0x170340,_0x19e35d[_0x3421('0x45')]);return _0x355f47[_0x3421('0x76')](_0x170340);}})['then'](function(_0x27967d){if(_0x27967d){_0x826d7c=_0x27967d[_0x3421('0x3f')];if(!_0x19e35d['query']['hasOwnProperty'](_0x3421('0x78'))){_0x170340[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x19e35d[_0x3421('0x39')][_0x3421('0x23')]);_0x170340['offset']=qs['offset'](_0x19e35d[_0x3421('0x39')]['offset']);}return _0x355f47['getAgents'](_0x170340);}})[_0x3421('0x2b')](function(_0x1a5b7c){if(_0x1a5b7c){return _0x1a5b7c?{'count':_0x826d7c,'rows':_0x1a5b7c}:null;}})[_0x3421('0x2b')](respondWithResult(_0x414218,null))[_0x3421('0x4b')](handleError(_0x414218,null));};exports['getTeams']=function(_0x595f0a,_0x335331,_0x5a922d){var _0x5af9c9={};var _0x1fb48f={};var _0x3fc2b6;var _0x4289f3;return db['VoicePrefix']['findOne']({'where':{'id':_0x595f0a['params']['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x335331,null))[_0x3421('0x2b')](function(_0x176b12){if(_0x176b12){_0x3fc2b6=_0x176b12;_0x1fb48f[_0x3421('0x38')]=_[_0x3421('0x3a')](db[_0x3421('0x79')][_0x3421('0x36')]);_0x1fb48f['query']=_[_0x3421('0x3a')](_0x595f0a[_0x3421('0x39')]);_0x1fb48f[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x1fb48f[_0x3421('0x38')],_0x1fb48f[_0x3421('0x39')]);_0x5af9c9[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x1fb48f[_0x3421('0x38')],qs['fields'](_0x595f0a['query'][_0x3421('0x3e')]));_0x5af9c9['attributes']=_0x5af9c9[_0x3421('0x3d')]['length']?_0x5af9c9[_0x3421('0x3d')]:_0x1fb48f[_0x3421('0x38')];_0x5af9c9[_0x3421('0x7a')]=qs[_0x3421('0x40')](_0x595f0a[_0x3421('0x39')]['sort']);_0x5af9c9['where']=qs[_0x3421('0x3b')](_[_0x3421('0x42')](_0x595f0a[_0x3421('0x39')],_0x1fb48f[_0x3421('0x3b')]));if(_0x595f0a['query'][_0x3421('0x43')]){_0x5af9c9[_0x3421('0x41')]=_[_0x3421('0x44')](_0x5af9c9[_0x3421('0x41')],{'$or':_[_0x3421('0x34')](_0x5af9c9[_0x3421('0x3d')],function(_0x31095c){var _0x4c3058={};_0x4c3058[_0x31095c]={'$like':'%'+_0x595f0a[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x4c3058;})});}_0x5af9c9=_['merge']({},_0x5af9c9,_0x595f0a[_0x3421('0x45')]);return _0x3fc2b6[_0x3421('0x7b')](_0x5af9c9);}})[_0x3421('0x2b')](function(_0x58b3e4){if(_0x58b3e4){_0x4289f3=_0x58b3e4[_0x3421('0x3f')];if(!_0x595f0a[_0x3421('0x39')]['hasOwnProperty'](_0x3421('0x78'))){_0x5af9c9[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x595f0a[_0x3421('0x39')][_0x3421('0x23')]);_0x5af9c9[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x595f0a[_0x3421('0x39')]['offset']);}return _0x3fc2b6[_0x3421('0x7b')](_0x5af9c9);}})['then'](function(_0x5aaa8a){if(_0x5aaa8a){return _0x5aaa8a?{'count':_0x4289f3,'rows':_0x5aaa8a}:null;}})[_0x3421('0x2b')](respondWithResult(_0x335331,null))[_0x3421('0x4b')](handleError(_0x335331,null));};exports[_0x3421('0x7c')]=function(_0x2c62d7,_0x5cbf21,_0x25c6a0){var _0x44e166=_0x2c62d7[_0x3421('0x50')][_0x3421('0x70')];var _0x13b03f;return db[_0x3421('0x79')][_0x3421('0x47')]({'where':{'id':_0x44e166},'attributes':['id'],'include':[{'model':db[_0x3421('0x77')],'as':_0x3421('0x7d'),'attributes':['id',_0x3421('0x32'),_0x3421('0x7e'),_0x3421('0x7f'),_0x3421('0x80')],'raw':!![]}]})[_0x3421('0x2b')](function(_0x1cde5f){if(_0x1cde5f){_0x13b03f=_0x1cde5f;var _0x1ddc33=_[_0x3421('0x81')](_0x1cde5f,function(_0x34f980){var _0x7d7398=_0x34f980[_0x3421('0x2d')]({'plain':!![]});return _0x7d7398[_0x3421('0x7d')];});return db['VoicePrefix']['find']({'where':{'id':_0x2c62d7[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](function(_0x1a7038){return db[_0x3421('0x4e')]['transaction'](function(_0x18f27a){return _0x1a7038[_0x3421('0x7c')](_0x44e166,{'transaction':_0x18f27a})['then'](function(){return BPromise[_0x3421('0x82')](_0x13b03f,function(_0x2eb3f4){return db[_0x3421('0x83')]['upsert']({'TeamId':_0x2eb3f4['id'],'VoicePrefixId':_0x2c62d7[_0x3421('0x49')]['id']},{'transaction':_0x18f27a});});})['then'](function(){return BPromise[_0x3421('0x82')](_0x1ddc33,function(_0x3f6f2c){return db[_0x3421('0x84')][_0x3421('0x85')]({'where':{'UserId':_0x3f6f2c['id'],'VoicePrefixId':_0x2c62d7[_0x3421('0x49')]['id']},'transaction':_0x18f27a});});})[_0x3421('0x2b')](function(){_0x1ddc33[_0x3421('0x86')](function(_0x50607f){socket[_0x3421('0x72')]('userVoicePrefix:save',{'UserId':_0x50607f['id'],'VoicePrefixId':_0x1a7038['id']});});});});});}})['then'](respondWithStatusCode(_0x5cbf21,null))[_0x3421('0x4b')](handleError(_0x5cbf21,null));};exports[_0x3421('0x87')]=function(_0x4a85d1,_0x1b48e1,_0x4c357e){return db[_0x3421('0x79')][_0x3421('0x47')]({'where':{'id':_0x4a85d1[_0x3421('0x39')][_0x3421('0x70')]},'attributes':['id'],'include':[{'model':db[_0x3421('0x77')],'as':_0x3421('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x3421('0x2b')](handleEntityNotFound(_0x1b48e1,null))[_0x3421('0x2b')](function(_0x2f38ec){var _0x11f294=_[_0x3421('0x34')](_0x2f38ec,'id');var _0x2d7330=[];var _0x5bf9a4=[];var _0x36868f=squel['select']();_0x36868f['field'](_0x3421('0x88'))[_0x3421('0x89')](_0x3421('0x8a'),'tq')[_0x3421('0x8b')]('user_has_teams','ut',_0x3421('0x8c'))[_0x3421('0x41')]('VoicePrefixId\x20=\x20?',_0x4a85d1[_0x3421('0x49')]['id']);for(var _0x4a933a=0x0;_0x4a933a<_0x2f38ec[_0x3421('0x3f')];_0x4a933a+=0x1){let _0x2defcb=_0x2f38ec[_0x4a933a];for(var _0x16735e=0x0;_0x16735e<_0x2defcb['Agents'][_0x3421('0x3f')];_0x16735e+=0x1){let _0x303df7=_0x2defcb[_0x3421('0x7d')][_0x16735e];var _0x1d8163=_0x36868f[_0x3421('0x8d')]();_0x1d8163[_0x3421('0x41')](_0x3421('0x8e'),_0x303df7['id']);_0x5bf9a4[_0x3421('0x8f')](db['sequelize'][_0x3421('0x39')](_0x1d8163[_0x3421('0x90')](),{'type':db[_0x3421('0x4e')][_0x3421('0x91')][_0x3421('0x92')]})[_0x3421('0x2b')](function(_0x3a5346){if(_0x3a5346['length']===0x1){return _0x303df7['id'];}else{var _0x3f64d0=_[_0x3421('0x93')](_['map'](_0x3a5346,'TeamId'),function(_0x4aa261){return _[_0x3421('0x94')](_0x11f294,_0x4aa261);});if(_0x3f64d0){return _0x303df7['id'];}}}));}}return BPromise[_0x3421('0x95')](_0x5bf9a4)['then'](function(_0x256976){_0x2d7330=_(_0x2d7330)[_0x3421('0x96')](_0x256976)[_0x3421('0x97')]()[_0x3421('0x98')]();return db[_0x3421('0x35')][_0x3421('0x4a')]({'where':{'id':_0x4a85d1[_0x3421('0x49')]['id']}})['then'](function(_0x224e26){return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x1e2a67){return _0x224e26[_0x3421('0x87')](_0x4a85d1[_0x3421('0x39')]['ids'],{'transaction':_0x1e2a67})[_0x3421('0x2b')](function(){if(!_[_0x3421('0x99')](_0x2d7330)){return _0x224e26['removeAgents'](_0x2d7330,{'transaction':_0x1e2a67});}})[_0x3421('0x2b')](function(){_0x2d7330[_0x3421('0x86')](function(_0x25cc13){socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':_0x25cc13,'VoicePrefixId':_0x224e26['id']});});});});});});})[_0x3421('0x2b')](respondWithStatusCode(_0x1b48e1,null))[_0x3421('0x4b')](handleError(_0x1b48e1,null));}; \ No newline at end of file +var _0xdd4f=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','describe','create','transaction','body','VoiceExtension','find','VoiceExtensionId','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','system-','sequelize','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','rawAttributes','order','getTeams','Team','nolimit','findAll','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','userVoicePrefix:remove','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x12aeae,_0x9d7453){var _0x1867e0=function(_0x25dd27){while(--_0x25dd27){_0x12aeae['push'](_0x12aeae['shift']());}};_0x1867e0(++_0x9d7453);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2b1b72,_0x3b6a38){_0x2b1b72=_0x2b1b72-0x0;var _0x352cb4=_0xdd4f[_0x2b1b72];return _0x352cb4;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];config[_0xfdd4('0x17')]=_[_0xfdd4('0x18')](config[_0xfdd4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd4('0x19'))(new Redis(config[_0xfdd4('0x17')]));require(_0xfdd4('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b7da1,_0x4aaeee){_0x4aaeee=_0x4aaeee||0xcc;return function(_0x467824){if(_0x467824){return _0x1b7da1[_0xfdd4('0x1b')](_0x4aaeee);}return _0x1b7da1[_0xfdd4('0x1c')](_0x4aaeee)[_0xfdd4('0x1d')]();};}function respondWithResult(_0x37b05f,_0x52cf2c){_0x52cf2c=_0x52cf2c||0xc8;return function(_0x47ed1d){if(_0x47ed1d){return _0x37b05f['status'](_0x52cf2c)[_0xfdd4('0x1e')](_0x47ed1d);}};}function respondWithFilteredResult(_0x216c7e,_0x2eb174){return function(_0x2ccc88){if(_0x2ccc88){var _0x32b5f7=typeof _0x2eb174[_0xfdd4('0x1f')]===_0xfdd4('0x20')&&typeof _0x2eb174[_0xfdd4('0x21')]===_0xfdd4('0x20');var _0x52ce34=_0x2ccc88[_0xfdd4('0x22')];var _0x3e8eac=_0x32b5f7?0x0:_0x2eb174[_0xfdd4('0x1f')];var _0x36e611=_0x32b5f7?_0x2ccc88[_0xfdd4('0x22')]:_0x2eb174[_0xfdd4('0x1f')]+_0x2eb174[_0xfdd4('0x21')];var _0x34dfa8;if(_0x36e611>=_0x52ce34){_0x36e611=_0x52ce34;_0x34dfa8=0xc8;}else{_0x34dfa8=0xce;}_0x216c7e['status'](_0x34dfa8);return _0x216c7e[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x3e8eac+'-'+_0x36e611+'/'+_0x52ce34)[_0xfdd4('0x1e')](_0x2ccc88);}return null;};}function patchUpdates(_0x16e81b){return function(_0xb7856d){try{jsonpatch[_0xfdd4('0x25')](_0xb7856d,_0x16e81b,!![]);}catch(_0x451767){return BPromise[_0xfdd4('0x26')](_0x451767);}return _0xb7856d['save']();};}function saveUpdates(_0x1e14da,_0x1112e8){return function(_0x4397a3){if(_0x4397a3){return _0x4397a3['update'](_0x1e14da)[_0xfdd4('0x27')](function(_0x39b712){return _0x39b712;});}return null;};}function removeEntity(_0xf9c346,_0x2f8268){return function(_0x1ade42){if(_0x1ade42){return _0x1ade42['destroy']()[_0xfdd4('0x27')](function(){var _0x2c88ad=_0x1ade42[_0xfdd4('0x28')]({'plain':!![]});var _0x31e053=_0xfdd4('0x29');return db[_0xfdd4('0x2a')][_0xfdd4('0x2b')]({'where':{'type':_0x31e053,'resourceId':_0x2c88ad['id']}})[_0xfdd4('0x27')](function(){return _0x1ade42;});})['then'](function(){_0xf9c346[_0xfdd4('0x1c')](0xcc)[_0xfdd4('0x1d')]();});}};}function handleEntityNotFound(_0x385a68,_0xef012e){return function(_0x2207ae){if(!_0x2207ae){_0x385a68['sendStatus'](0x194);}return _0x2207ae;};}function handleError(_0xd127b1,_0x3372d2){_0x3372d2=_0x3372d2||0x1f4;return function(_0xbf38b4){logger[_0xfdd4('0x2c')](_0xbf38b4[_0xfdd4('0x2d')]);if(_0xbf38b4['name']){delete _0xbf38b4[_0xfdd4('0x2e')];}_0xd127b1[_0xfdd4('0x1c')](_0x3372d2)[_0xfdd4('0x2f')](_0xbf38b4);};}exports['index']=function(_0x3fd07a,_0x502776){var _0x2a65c8={},_0x2b22f9={},_0x4aa4f2={'count':0x0,'rows':[]};var _0x50b748=_[_0xfdd4('0x30')](db[_0xfdd4('0x31')]['rawAttributes'],function(_0x557d7b){return{'name':_0x557d7b[_0xfdd4('0x32')],'type':_0x557d7b[_0xfdd4('0x33')][_0xfdd4('0x34')]};});_0x2b22f9[_0xfdd4('0x35')]=_[_0xfdd4('0x30')](_0x50b748,_0xfdd4('0x2e'));_0x2b22f9[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x3fd07a[_0xfdd4('0x36')]);_0x2b22f9[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],_0x2b22f9[_0xfdd4('0x36')]);_0x2a65c8[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x2a65c8[_0xfdd4('0x3a')]=_0x2a65c8[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x2a65c8[_0xfdd4('0x3a')]:_0x2b22f9[_0xfdd4('0x35')];if(!_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x2a65c8[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x2a65c8[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x3fd07a['query'][_0xfdd4('0x1f')]);}_0x2a65c8['order']=qs[_0xfdd4('0x3e')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3e')]);_0x2a65c8[_0xfdd4('0x3f')]=qs['filters'](_[_0xfdd4('0x40')](_0x3fd07a[_0xfdd4('0x36')],_0x2b22f9[_0xfdd4('0x38')]),_0x50b748);if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x2a65c8[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x2a65c8[_0xfdd4('0x3f')],{'$or':_[_0xfdd4('0x30')](_0x50b748,function(_0x83673d){if(_0x83673d['type']!==_0xfdd4('0x43')){var _0x2196f={};_0x2196f[_0x83673d[_0xfdd4('0x2e')]]={'$like':'%'+_0x3fd07a[_0xfdd4('0x36')]['filter']+'%'};return _0x2196f;}})});}_0x2a65c8=_[_0xfdd4('0x42')]({},_0x2a65c8,_0x3fd07a[_0xfdd4('0x44')]);var _0x30524f={'where':_0x2a65c8[_0xfdd4('0x3f')]};return db[_0xfdd4('0x31')]['count'](_0x30524f)[_0xfdd4('0x27')](function(_0x23af2a){_0x4aa4f2[_0xfdd4('0x22')]=_0x23af2a;if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x2a65c8[_0xfdd4('0x46')]=[{'all':!![]}];}return db[_0xfdd4('0x31')]['findAll'](_0x2a65c8);})[_0xfdd4('0x27')](function(_0x586713){_0x4aa4f2[_0xfdd4('0x47')]=_0x586713;return _0x4aa4f2;})[_0xfdd4('0x27')](respondWithFilteredResult(_0x502776,_0x2a65c8))[_0xfdd4('0x48')](handleError(_0x502776,null));};exports[_0xfdd4('0x49')]=function(_0x5367aa,_0x419578){var _0x11e90a={'raw':![],'where':{'id':_0x5367aa[_0xfdd4('0x4a')]['id']}},_0x4d1dfe={};_0x4d1dfe[_0xfdd4('0x35')]=_['keys'](db[_0xfdd4('0x31')]['rawAttributes']);_0x4d1dfe['query']=_['keys'](_0x5367aa[_0xfdd4('0x36')]);_0x4d1dfe[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x4d1dfe['model'],_0x4d1dfe[_0xfdd4('0x36')]);_0x11e90a[_0xfdd4('0x3a')]=_['intersection'](_0x4d1dfe[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x11e90a[_0xfdd4('0x3a')]=_0x11e90a[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x11e90a[_0xfdd4('0x3a')]:_0x4d1dfe[_0xfdd4('0x35')];if(_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x11e90a[_0xfdd4('0x46')]=[{'all':!![]}];}_0x11e90a=_[_0xfdd4('0x42')]({},_0x11e90a,_0x5367aa[_0xfdd4('0x44')]);return db['VoicePrefix']['find'](_0x11e90a)[_0xfdd4('0x27')](handleEntityNotFound(_0x419578,null))[_0xfdd4('0x27')](respondWithResult(_0x419578,null))[_0xfdd4('0x48')](handleError(_0x419578,null));};exports[_0xfdd4('0x2b')]=function(_0x507bf5,_0x3c6828){return db[_0xfdd4('0x31')]['find']({'where':{'id':_0x507bf5['params']['id']}})['then'](handleEntityNotFound(_0x3c6828,null))['then'](removeEntity(_0x3c6828,null))['catch'](handleError(_0x3c6828,null));};exports[_0xfdd4('0x4b')]=function(_0x88e9ef,_0x3a4202){return db[_0xfdd4('0x31')][_0xfdd4('0x4b')]()[_0xfdd4('0x27')](respondWithResult(_0x3a4202,null))['catch'](handleError(_0x3a4202,null));};exports[_0xfdd4('0x4c')]=function(_0x1f521a,_0x1dd417){var _0x2355b5;return db['sequelize'][_0xfdd4('0x4d')](function(_0x8aa0ea){return db['VoicePrefix'][_0xfdd4('0x4c')](_0x1f521a[_0xfdd4('0x4e')],{'transaction':_0x8aa0ea})['then'](function(_0x5467d1){_0x2355b5=_0x5467d1[_0xfdd4('0x28')]({'plain':!![]});return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x2355b5[_0xfdd4('0x51')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x1b9979){return createVoicePrefixExtensions(_0x2355b5,_0x1b9979,_0x8aa0ea);});});})[_0xfdd4('0x27')](function(){var _0x3de4fd=_0x1f521a['user'][_0xfdd4('0x28')]({'plain':!![]});if(!_0x3de4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3de4fd['role']===_0xfdd4('0x52')){var _0x1d9a8d=_0x2355b5;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3de4fd[_0xfdd4('0x53')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x4dc113){if(_0x4dc113&&_0x4dc113[_0xfdd4('0x54')]===0x0){return db[_0xfdd4('0x2a')][_0xfdd4('0x4c')]({'name':_0x1d9a8d[_0xfdd4('0x2e')],'resourceId':_0x1d9a8d['id'],'type':_0x4dc113[_0xfdd4('0x2e')],'sectionId':_0x4dc113['id']},{})['then'](function(){return _0x2355b5;});}else{return _0x2355b5;}})['catch'](function(_0x483942){logger['error'](_0xfdd4('0x55'),_0x483942);throw _0x483942;});}return _0x2355b5;})[_0xfdd4('0x27')](respondWithResult(_0x1dd417,null))['catch'](handleError(_0x1dd417,null));};function Extension(_0x1eee3d,_0x2abe50,_0x4d4304,_0x45dcc8){this[_0xfdd4('0x56')]='from-sip';this[_0xfdd4('0x57')]=_0x1eee3d;this[_0xfdd4('0x58')]=_0x4d4304;this[_0xfdd4('0x33')]='system';this[_0xfdd4('0x59')]=_0xfdd4('0x5a');this[_0xfdd4('0x5b')]=_0x2abe50;this[_0xfdd4('0x5c')]=_0x45dcc8;}function createVoicePrefixExtensions(_0x5c7be,_0x562417,_0x2cc3e2){return new BPromise(function(_0x2ee4b6,_0x3be4d5){var _0x202124=new Extension(formatPrefixName(_0x5c7be[_0xfdd4('0x5d')]),0x1,_0xfdd4('0x5e'),_0xfdd4('0x5f'));_0x202124[_0xfdd4('0x60')]=_0x5c7be['id'];return db[_0xfdd4('0x4f')]['create'](_0x202124,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x2799b2){var _0x4483e1=_0x2799b2[_0xfdd4('0x28')]({'plain':!![]});var _0x3096fa=_['map'](addVoicePrefixExtensions(_0x5c7be,_0x562417),function(_0x46e7eb){_0x46e7eb[_0xfdd4('0x51')]=_0x4483e1['id'];_0x46e7eb[_0xfdd4('0x60')]=_0x5c7be['id'];return _0x46e7eb;});return db[_0xfdd4('0x4f')][_0xfdd4('0x61')](_0x3096fa,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x180ad9){if(!_0x180ad9){return _0x3be4d5(_0xfdd4('0x62'));}else{return _0x2ee4b6(_0x180ad9);}})[_0xfdd4('0x48')](function(_0x2a0dd8){return _0x3be4d5(_0x2a0dd8);});});;});};function addVoicePrefixExtensions(_0x2fff30,_0x2792c4){var _0x1205b8=[];var _0x527068=formatPrefixName(_0x2fff30[_0xfdd4('0x5d')]);_0x1205b8['push'](new Extension(_0x527068,0x2,_0xfdd4('0x63'),_0xfdd4('0x64')+_0x2fff30[_0xfdd4('0x2e')]));if(_0x2fff30[_0xfdd4('0x65')]){_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x63'),_0xfdd4('0x67')+_0x2fff30[_0xfdd4('0x65')]));}else{_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x5e'),_0xfdd4('0x68')));}_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x4,'goto',_0x2792c4['context']+','+'${EXTEN:'+(0x8+_0x2fff30[_0xfdd4('0x2e')][_0xfdd4('0x3c')])+'}'+','+0x1));return _0x1205b8;}function formatPrefixName(_0x4bb18b){var _0x3a367c='_';for(var _0x3f027b=0x0;_0x3f027b<_0x4bb18b[_0xfdd4('0x3c')];_0x3f027b++){if(_0x4bb18b[_0xfdd4('0x69')](_0x3f027b)=='-'){_0x3a367c+=_0x4bb18b[_0xfdd4('0x69')](_0x3f027b);}else{_0x3a367c+='['+_0x4bb18b['charAt'](_0x3f027b)+']';}}_0x3a367c+='.';return _0x3a367c;}exports[_0xfdd4('0x6a')]=function(_0x297432,_0x3958cd,_0x523085){var _0x366f1c=_0x297432['body'];_0x366f1c[_0xfdd4('0x5d')]=_0xfdd4('0x6b')+_0x366f1c[_0xfdd4('0x2e')]+'-';return db[_0xfdd4('0x6c')]['transaction'](function(_0x2351b6){return db[_0xfdd4('0x31')]['update'](_0x366f1c,{'where':{'id':_0x366f1c['id']},'transaction':_0x2351b6})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x2b')]({'where':{'VoicePrefixId':_0x366f1c['id']},'transaction':_0x2351b6})['then'](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x366f1c[_0xfdd4('0x51')]},'raw':!![]})['then'](function(_0x3f4337){return createVoicePrefixExtensions(_0x366f1c,_0x3f4337,_0x2351b6);});});});})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x31')][_0xfdd4('0x6d')](_0x366f1c['id']);})[_0xfdd4('0x27')](respondWithResult(_0x3958cd,null))[_0xfdd4('0x48')](handleError(_0x3958cd,null));};exports[_0xfdd4('0x6e')]=function(_0x539d3b,_0x147d54,_0x36b615){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x539d3b[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x147d54,null))[_0xfdd4('0x27')](function(_0x4987d6){if(_0x4987d6){return _0x4987d6['addAgents'](_0x539d3b[_0xfdd4('0x4e')]['ids'],_['omit'](_0x539d3b[_0xfdd4('0x4e')],['ids','id'])||{})[_0xfdd4('0x6f')](function(_0x51711a){for(var _0x4576ce=0x0;_0x4576ce<_0x539d3b[_0xfdd4('0x4e')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0x4576ce+=0x1){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':Number(_0x539d3b[_0xfdd4('0x4e')]['ids'][_0x4576ce]),'VoicePrefixId':Number(_0x539d3b['params']['id'])});}return _0x51711a;});}})[_0xfdd4('0x27')](respondWithResult(_0x147d54,null))['catch'](handleError(_0x147d54,null));};exports[_0xfdd4('0x73')]=function(_0x1a82ee,_0x3b205f,_0x1d57f8){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x1a82ee[_0xfdd4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b205f,null))['then'](function(_0x37a342){if(_0x37a342){return _0x37a342[_0xfdd4('0x73')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])[_0xfdd4('0x27')](function(){if(_[_0xfdd4('0x74')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])){for(var _0xf78c69=0x0;_0xf78c69<_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0xf78c69+=0x1){socket[_0xfdd4('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee['query'][_0xfdd4('0x70')][_0xf78c69]),'VoicePrefixId':Number(_0x1a82ee[_0xfdd4('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')]),'VoicePrefixId':Number(_0x1a82ee['params']['id'])});}});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x3b205f,null))[_0xfdd4('0x48')](handleError(_0x3b205f,null));};exports[_0xfdd4('0x75')]=function(_0x11db43,_0x5ec62b,_0x25c078){var _0x5d356c={};var _0x3924c7={};var _0x2f65d7;var _0x4783b9;return db[_0xfdd4('0x31')][_0xfdd4('0x76')]({'where':{'id':_0x11db43[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x5ec62b,null))[_0xfdd4('0x27')](function(_0x575bc2){if(_0x575bc2){_0x2f65d7=_0x575bc2;_0x3924c7['model']=_[_0xfdd4('0x37')](db['User'][_0xfdd4('0x77')]);_0x3924c7[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x11db43[_0xfdd4('0x36')]);_0x3924c7[_0xfdd4('0x38')]=_['intersection'](_0x3924c7['model'],_0x3924c7[_0xfdd4('0x36')]);_0x5d356c['attributes']=_[_0xfdd4('0x39')](_0x3924c7['model'],qs[_0xfdd4('0x3b')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x5d356c[_0xfdd4('0x3a')]=_0x5d356c[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x5d356c[_0xfdd4('0x3a')]:_0x3924c7[_0xfdd4('0x35')];_0x5d356c[_0xfdd4('0x78')]=qs[_0xfdd4('0x3e')](_0x11db43[_0xfdd4('0x36')]['sort']);_0x5d356c[_0xfdd4('0x3f')]=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x11db43[_0xfdd4('0x36')],_0x3924c7[_0xfdd4('0x38')]));if(_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x5d356c[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x5d356c['where'],{'$or':_['map'](_0x5d356c[_0xfdd4('0x3a')],function(_0x244d6d){var _0x30bd32={};_0x30bd32[_0x244d6d]={'$like':'%'+_0x11db43['query'][_0xfdd4('0x41')]+'%'};return _0x30bd32;})});}_0x5d356c=_[_0xfdd4('0x42')]({},_0x5d356c,_0x11db43[_0xfdd4('0x44')]);return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})['then'](function(_0x5868e6){if(_0x5868e6){_0x4783b9=_0x5868e6[_0xfdd4('0x3c')];if(!_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x5d356c[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x5d356c[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x11db43['query']['offset']);}return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})[_0xfdd4('0x27')](function(_0x6a1410){if(_0x6a1410){return _0x6a1410?{'count':_0x4783b9,'rows':_0x6a1410}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x5ec62b,null))[_0xfdd4('0x48')](handleError(_0x5ec62b,null));};exports[_0xfdd4('0x79')]=function(_0x46edc9,_0x2a4366,_0x5d1a3f){var _0x218d83={};var _0x547c4c={};var _0x464eb0;var _0x1871d6;return db['VoicePrefix'][_0xfdd4('0x76')]({'where':{'id':_0x46edc9[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x2a4366,null))[_0xfdd4('0x27')](function(_0x3cd7ae){if(_0x3cd7ae){_0x464eb0=_0x3cd7ae;_0x547c4c[_0xfdd4('0x35')]=_[_0xfdd4('0x37')](db[_0xfdd4('0x7a')][_0xfdd4('0x77')]);_0x547c4c['query']=_[_0xfdd4('0x37')](_0x46edc9['query']);_0x547c4c[_0xfdd4('0x38')]=_['intersection'](_0x547c4c['model'],_0x547c4c[_0xfdd4('0x36')]);_0x218d83[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x547c4c[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x46edc9['query'][_0xfdd4('0x3b')]));_0x218d83[_0xfdd4('0x3a')]=_0x218d83[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x218d83[_0xfdd4('0x3a')]:_0x547c4c[_0xfdd4('0x35')];_0x218d83['order']=qs[_0xfdd4('0x3e')](_0x46edc9[_0xfdd4('0x36')]['sort']);_0x218d83['where']=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x46edc9[_0xfdd4('0x36')],_0x547c4c['filters']));if(_0x46edc9['query'][_0xfdd4('0x41')]){_0x218d83[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x218d83['where'],{'$or':_['map'](_0x218d83[_0xfdd4('0x3a')],function(_0xd6eb47){var _0x1927ed={};_0x1927ed[_0xd6eb47]={'$like':'%'+_0x46edc9['query'][_0xfdd4('0x41')]+'%'};return _0x1927ed;})});}_0x218d83=_['merge']({},_0x218d83,_0x46edc9[_0xfdd4('0x44')]);return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x4e1dbc){if(_0x4e1dbc){_0x1871d6=_0x4e1dbc[_0xfdd4('0x3c')];if(!_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x3d')](_0xfdd4('0x7b'))){_0x218d83[_0xfdd4('0x21')]=qs['limit'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x218d83[_0xfdd4('0x1f')]=qs['offset'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x1f')]);}return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3?{'count':_0x1871d6,'rows':_0x56e5d3}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x2a4366,null))['catch'](handleError(_0x2a4366,null));};exports['addTeams']=function(_0x528004,_0x206a59,_0x545475){var _0x5e5362=_0x528004['body'][_0xfdd4('0x70')];var _0x728e25;return db[_0xfdd4('0x7a')][_0xfdd4('0x7c')]({'where':{'id':_0x5e5362},'attributes':['id'],'include':[{'model':db[_0xfdd4('0x7d')],'as':_0xfdd4('0x7e'),'attributes':['id',_0xfdd4('0x2e'),_0xfdd4('0x7f'),_0xfdd4('0x80'),_0xfdd4('0x81')],'raw':!![]}]})[_0xfdd4('0x27')](function(_0x2911ca){if(_0x2911ca){_0x728e25=_0x2911ca;var _0x31303f=_[_0xfdd4('0x82')](_0x2911ca,function(_0x46b927){var _0x450c67=_0x46b927[_0xfdd4('0x28')]({'plain':!![]});return _0x450c67[_0xfdd4('0x7e')];});return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x528004[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](function(_0x189baf){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x22f93b){return _0x189baf['addTeams'](_0x5e5362,{'transaction':_0x22f93b})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x728e25,function(_0xaef5e2){return db[_0xfdd4('0x84')][_0xfdd4('0x85')]({'TeamId':_0xaef5e2['id'],'VoicePrefixId':_0x528004['params']['id']},{'transaction':_0x22f93b});});})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x31303f,function(_0x19b679){return db[_0xfdd4('0x86')][_0xfdd4('0x87')]({'where':{'UserId':_0x19b679['id'],'VoicePrefixId':_0x528004[_0xfdd4('0x4a')]['id']},'transaction':_0x22f93b});});})['then'](function(){_0x31303f[_0xfdd4('0x88')](function(_0x1a9e62){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':_0x1a9e62['id'],'VoicePrefixId':_0x189baf['id']});});});});});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x206a59,null))[_0xfdd4('0x48')](handleError(_0x206a59,null));};exports['removeTeams']=function(_0x2a6a0d,_0x3d82d1,_0x17d272){return db['Team'][_0xfdd4('0x7c')]({'where':{'id':_0x2a6a0d[_0xfdd4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfdd4('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xfdd4('0x27')](handleEntityNotFound(_0x3d82d1,null))[_0xfdd4('0x27')](function(_0xd07645){var _0x5a3249=_[_0xfdd4('0x30')](_0xd07645,'id');var _0x5b22b1=[];var _0xc9955e=[];var _0x42204a=squel[_0xfdd4('0x89')]();_0x42204a[_0xfdd4('0x8a')](_0xfdd4('0x8b'))[_0xfdd4('0x8c')](_0xfdd4('0x8d'),'tq')[_0xfdd4('0x8e')](_0xfdd4('0x8f'),'ut',_0xfdd4('0x90'))[_0xfdd4('0x3f')]('VoicePrefixId\x20=\x20?',_0x2a6a0d[_0xfdd4('0x4a')]['id']);for(var _0x42a3dc=0x0;_0x42a3dc<_0xd07645[_0xfdd4('0x3c')];_0x42a3dc+=0x1){let _0x26316c=_0xd07645[_0x42a3dc];for(var _0x1e7bbb=0x0;_0x1e7bbb<_0x26316c[_0xfdd4('0x7e')]['length'];_0x1e7bbb+=0x1){let _0xfd0c1=_0x26316c[_0xfdd4('0x7e')][_0x1e7bbb];var _0x2ae92=_0x42204a[_0xfdd4('0x91')]();_0x2ae92['where'](_0xfdd4('0x92'),_0xfd0c1['id']);_0xc9955e[_0xfdd4('0x66')](db['sequelize'][_0xfdd4('0x36')](_0x2ae92[_0xfdd4('0x93')](),{'type':db[_0xfdd4('0x6c')][_0xfdd4('0x94')][_0xfdd4('0x95')]})[_0xfdd4('0x27')](function(_0x191ab6){if(_0x191ab6[_0xfdd4('0x3c')]===0x1){return _0xfd0c1['id'];}else{var _0x1d460f=_[_0xfdd4('0x96')](_[_0xfdd4('0x30')](_0x191ab6,_0xfdd4('0x97')),function(_0x25c508){return _[_0xfdd4('0x98')](_0x5a3249,_0x25c508);});if(_0x1d460f){return _0xfd0c1['id'];}}}));}}return BPromise['all'](_0xc9955e)[_0xfdd4('0x27')](function(_0x349fc6){_0x5b22b1=_(_0x5b22b1)[_0xfdd4('0x99')](_0x349fc6)[_0xfdd4('0x9a')]()['value']();return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x2a6a0d['params']['id']}})[_0xfdd4('0x27')](function(_0x401681){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x5a7c85){return _0x401681[_0xfdd4('0x9b')](_0x2a6a0d['query'][_0xfdd4('0x70')],{'transaction':_0x5a7c85})[_0xfdd4('0x27')](function(){if(!_['isEmpty'](_0x5b22b1)){return _0x401681[_0xfdd4('0x73')](_0x5b22b1,{'transaction':_0x5a7c85});}})['then'](function(){_0x5b22b1['forEach'](function(_0x10a396){socket[_0xfdd4('0x71')](_0xfdd4('0x9c'),{'UserId':_0x10a396,'VoicePrefixId':_0x401681['id']});});});});});});})[_0xfdd4('0x27')](respondWithStatusCode(_0x3d82d1,null))['catch'](handleError(_0x3d82d1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index e4517b9..b14bd9b 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 _0xf921=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0xf921,0x128));var _0x1f92=function(_0x9e575,_0x5894d4){_0x9e575=_0x9e575-0x0;var _0x522277=_0xf921[_0x9e575];return _0x522277;};'use strict';var EventEmitter=require(_0x1f92('0x0'));var VoicePrefix=require(_0x1f92('0x1'))['db'][_0x1f92('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1f92('0x3')](0x0);var events={'afterCreate':_0x1f92('0x4'),'afterUpdate':_0x1f92('0x5'),'afterDestroy':_0x1f92('0x6')};function emitEvent(_0x183a43){return function(_0x5e59be,_0xb3fbb9,_0x399f2e){VoicePrefixEvents[_0x1f92('0x7')](_0x183a43+':'+_0x5e59be['id'],_0x5e59be);VoicePrefixEvents['emit'](_0x183a43,_0x5e59be);_0x399f2e(null);};}for(var e in events){if(events[_0x1f92('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xca34=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x3ddbc6,_0x137eac){var _0x478f4b=function(_0x46fa2e){while(--_0x46fa2e){_0x3ddbc6['push'](_0x3ddbc6['shift']());}};_0x478f4b(++_0x137eac);}(_0xca34,0x123));var _0x4ca3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xca34[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x4ca3('0x0'));var VoicePrefix=require(_0x4ca3('0x1'))['db'][_0x4ca3('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4ca3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4ca3('0x4'),'afterDestroy':_0x4ca3('0x5')};function emitEvent(_0x40a52e){return function(_0x4d26f7,_0x30bae1,_0x1e306b){VoicePrefixEvents[_0x4ca3('0x6')](_0x40a52e+':'+_0x4d26f7['id'],_0x4d26f7);VoicePrefixEvents[_0x4ca3('0x6')](_0x40a52e,_0x4d26f7);_0x1e306b(null);};}for(var e in events){if(events[_0x4ca3('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x4ca3('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 77268bc..75d2ef0 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 _0xff62=['path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff62,0x69));var _0x2ff6=function(_0x4e3a57,_0x60f709){_0x4e3a57=_0x4e3a57-0x0;var _0x118775=_0xff62[_0x4e3a57];return _0x118775;};'use strict';var _=require(_0x2ff6('0x0'));var util=require(_0x2ff6('0x1'));var logger=require(_0x2ff6('0x2'))(_0x2ff6('0x3'));var moment=require(_0x2ff6('0x4'));var BPromise=require(_0x2ff6('0x5'));var rp=require(_0x2ff6('0x6'));var fs=require('fs');var path=require(_0x2ff6('0x7'));var rimraf=require(_0x2ff6('0x8'));var config=require(_0x2ff6('0x9'));var attributes=require(_0x2ff6('0xa'));module[_0x2ff6('0xb')]=function(_0x38a9e0,_0x4a8553){return _0x38a9e0['define'](_0x2ff6('0xc'),attributes,{'tableName':_0x2ff6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d5=['path','rimraf','../../config/environment','exports','VoicePrefix','lodash','util','api','request-promise'];(function(_0x1fc170,_0x17a5a9){var _0x289550=function(_0x4eaa19){while(--_0x4eaa19){_0x1fc170['push'](_0x1fc170['shift']());}};_0x289550(++_0x17a5a9);}(_0x69d5,0x7a));var _0x569d=function(_0x597cee,_0x118341){_0x597cee=_0x597cee-0x0;var _0x4f47bb=_0x69d5[_0x597cee];return _0x4f47bb;};'use strict';var _=require(_0x569d('0x0'));var util=require(_0x569d('0x1'));var logger=require('../../config/logger')(_0x569d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x569d('0x3'));var fs=require('fs');var path=require(_0x569d('0x4'));var rimraf=require(_0x569d('0x5'));var config=require(_0x569d('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x569d('0x7')]=function(_0x3f492f,_0x197486){return _0x3f492f['define'](_0x569d('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 63757ca..ea60fcd 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 _0xd916=['../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5b19ae,_0x2fef9e){var _0x367f6a=function(_0x1bcbf1){while(--_0x1bcbf1){_0x5b19ae['push'](_0x5b19ae['shift']());}};_0x367f6a(++_0x2fef9e);}(_0xd916,0x18a));var _0x6d91=function(_0x389c9f,_0x554ddd){_0x389c9f=_0x389c9f-0x0;var _0x22e663=_0xd916[_0x389c9f];return _0x22e663;};'use strict';var _=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var moment=require(_0x6d91('0x2'));var BPromise=require(_0x6d91('0x3'));var rs=require(_0x6d91('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d91('0x5'))['db'];var utils=require(_0x6d91('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d91('0x7'));var jayson=require(_0x6d91('0x8'));var client=jayson['client'][_0x6d91('0x9')]({'port':0x232a});config[_0x6d91('0xa')]=_[_0x6d91('0xb')](config[_0x6d91('0xa')],{'host':_0x6d91('0xc'),'port':0x18eb});var socket=require(_0x6d91('0xd'))(new Redis(config[_0x6d91('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x598756,_0x5ae90d,_0xab3051){return new BPromise(function(_0xae0aa1,_0x2e2cdd){return client[_0x6d91('0xe')](_0x598756,_0xab3051)[_0x6d91('0xf')](function(_0x540ddd){logger[_0x6d91('0x10')](_0x6d91('0x11'),_0x5ae90d,_0x6d91('0x12'));logger[_0x6d91('0x13')](_0x6d91('0x14'),_0x5ae90d,_0x6d91('0x12'),JSON[_0x6d91('0x15')](_0x540ddd));if(_0x540ddd[_0x6d91('0x16')]){if(_0x540ddd[_0x6d91('0x16')][_0x6d91('0x17')]===0x1f4){logger[_0x6d91('0x16')](_0x6d91('0x11'),_0x5ae90d,_0x540ddd[_0x6d91('0x16')][_0x6d91('0x18')]);return _0x2e2cdd(_0x540ddd[_0x6d91('0x16')]['message']);}logger[_0x6d91('0x16')](_0x6d91('0x11'),_0x5ae90d,_0x540ddd[_0x6d91('0x16')][_0x6d91('0x18')]);return _0xae0aa1(_0x540ddd[_0x6d91('0x16')][_0x6d91('0x18')]);}else{logger['info'](_0x6d91('0x11'),_0x5ae90d,'request\x20sent');_0xae0aa1(_0x540ddd['result'][_0x6d91('0x18')]);}})['catch'](function(_0xa8cc9){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x5ae90d,_0xa8cc9);_0x2e2cdd(_0xa8cc9);});});} \ No newline at end of file +var _0x082a=['message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28c0cb,_0x4b54f3){var _0x9d54f7=function(_0x293e00){while(--_0x293e00){_0x28c0cb['push'](_0x28c0cb['shift']());}};_0x9d54f7(++_0x4b54f3);}(_0x082a,0x154));var _0xa082=function(_0x5351fb,_0x39aa75){_0x5351fb=_0x5351fb-0x0;var _0x1275f8=_0x082a[_0x5351fb];return _0x1275f8;};'use strict';var _=require('lodash');var util=require(_0xa082('0x0'));var moment=require(_0xa082('0x1'));var BPromise=require(_0xa082('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa082('0x3'));var db=require(_0xa082('0x4'))['db'];var utils=require(_0xa082('0x5'));var logger=require(_0xa082('0x6'))(_0xa082('0x7'));var config=require('../../config/environment');var jayson=require(_0xa082('0x8'));var client=jayson['client'][_0xa082('0x9')]({'port':0x232a});config[_0xa082('0xa')]=_['defaults'](config[_0xa082('0xa')],{'host':_0xa082('0xb'),'port':0x18eb});var socket=require(_0xa082('0xc'))(new Redis(config['redis']));require(_0xa082('0xd'))[_0xa082('0xe')](socket);function respondWithRpcPromise(_0xd359ef,_0x46b66d,_0x7c826c){return new BPromise(function(_0x494ef6,_0x1fcf69){return client[_0xa082('0xf')](_0xd359ef,_0x7c826c)[_0xa082('0x10')](function(_0x5798dc){logger['info'](_0xa082('0x11'),_0x46b66d,_0xa082('0x12'));logger[_0xa082('0x13')](_0xa082('0x14'),_0x46b66d,'request\x20sent',JSON[_0xa082('0x15')](_0x5798dc));if(_0x5798dc[_0xa082('0x16')]){if(_0x5798dc[_0xa082('0x16')][_0xa082('0x17')]===0x1f4){logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x5798dc['error'][_0xa082('0x18')]);return _0x1fcf69(_0x5798dc[_0xa082('0x16')]['message']);}logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x5798dc[_0xa082('0x16')][_0xa082('0x18')]);return _0x494ef6(_0x5798dc['error']['message']);}else{logger[_0xa082('0x19')](_0xa082('0x11'),_0x46b66d,'request\x20sent');_0x494ef6(_0x5798dc[_0xa082('0x1a')]['message']);}})[_0xa082('0x1b')](function(_0x284376){logger[_0xa082('0x16')](_0xa082('0x11'),_0x46b66d,_0x284376);_0x1fcf69(_0x284376);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 3d07658..379522f 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 _0x702d=['remove','update','emit','register','length','./voicePrefix.events','save'];(function(_0x2c9782,_0x21b6cb){var _0x2e3906=function(_0x34fbcf){while(--_0x34fbcf){_0x2c9782['push'](_0x2c9782['shift']());}};_0x2e3906(++_0x21b6cb);}(_0x702d,0x147));var _0xd702=function(_0x28b87e,_0x15d4b8){_0x28b87e=_0x28b87e-0x0;var _0x1b26aa=_0x702d[_0x28b87e];return _0x1b26aa;};'use strict';var VoicePrefixEvents=require(_0xd702('0x0'));var events=[_0xd702('0x1'),_0xd702('0x2'),_0xd702('0x3')];function createListener(_0x37ed5c,_0x5c2b9e){return function(_0x20c11a){_0x5c2b9e[_0xd702('0x4')](_0x37ed5c,_0x20c11a);};}function removeListener(_0x27b260,_0x1c5a32){return function(){VoicePrefixEvents['removeListener'](_0x27b260,_0x1c5a32);};}exports[_0xd702('0x5')]=function(_0x544e94){for(var _0x1aecfc=0x0,_0x3a2c03=events[_0xd702('0x6')];_0x1aecfc<_0x3a2c03;_0x1aecfc++){var _0x5af246=events[_0x1aecfc];var _0x12bb75=createListener('voicePrefix:'+_0x5af246,_0x544e94);VoicePrefixEvents['on'](_0x5af246,_0x12bb75);}}; \ No newline at end of file +var _0x4ffe=['remove','removeListener','register','length','./voicePrefix.events','save'];(function(_0x2aaf86,_0x375b59){var _0x289a37=function(_0x2ccc0d){while(--_0x2ccc0d){_0x2aaf86['push'](_0x2aaf86['shift']());}};_0x289a37(++_0x375b59);}(_0x4ffe,0x172));var _0xe4ff=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x4ffe[_0x2ddd52];return _0x4bb4ec;};'use strict';var VoicePrefixEvents=require(_0xe4ff('0x0'));var events=[_0xe4ff('0x1'),_0xe4ff('0x2'),'update'];function createListener(_0x43b348,_0x13bb2f){return function(_0x1ede19){_0x13bb2f['emit'](_0x43b348,_0x1ede19);};}function removeListener(_0x45c5e9,_0x2621fc){return function(){VoicePrefixEvents[_0xe4ff('0x3')](_0x45c5e9,_0x2621fc);};}exports[_0xe4ff('0x4')]=function(_0x68c0c7){for(var _0x50250d=0x0,_0x5eed52=events[_0xe4ff('0x5')];_0x50250d<_0x5eed52;_0x50250d++){var _0x227be1=events[_0x50250d];var _0x2aa67c=createListener('voicePrefix:'+_0x227be1,_0x68c0c7);VoicePrefixEvents['on'](_0x227be1,_0x2aa67c);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6b651bc..47cc249 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x13a8cc,_0x45b4fc){var _0x31b53c=function(_0x3ea73b){while(--_0x3ea73b){_0x13a8cc['push'](_0x13a8cc['shift']());}};_0x31b53c(++_0x45b4fc);}(_0xb10b,0x12a));var _0xbb10=function(_0x3572cb,_0x4149d3){_0x3572cb=_0x3572cb-0x0;var _0x33a398=_0xb10b[_0x3572cb];return _0x33a398;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x3517d9,_0x1e6703){var _0x29a2f4=function(_0x29efb9){while(--_0x29efb9){_0x3517d9['push'](_0x3517d9['shift']());}};_0x29a2f4(++_0x1e6703);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 4ed912d..4c46b2b 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 _0x1069=['preview','roundrobin','includes','setDataValue','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','strategy','getDataValue','dialMethod','outbound'];(function(_0x2f67bc,_0xdb9f24){var _0x3c796b=function(_0x1d8956){while(--_0x1d8956){_0x2f67bc['push'](_0x2f67bc['shift']());}};_0x3c796b(++_0xdb9f24);}(_0x1069,0x92));var _0x9106=function(_0x3711b4,_0x1801fa){_0x3711b4=_0x3711b4-0x0;var _0x4ca68a=_0x1069[_0x3711b4];return _0x4ca68a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9106('0x0')],'allowNull':![],'unique':_0x9106('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x9106('0x3')},'musiconhold':{'type':Sequelize[_0x9106('0x0')],'defaultValue':_0x9106('0x4')},'announce':{'type':Sequelize[_0x9106('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9106('0x2')]('rr',_0x9106('0x5'),_0x9106('0x6'),_0x9106('0x7'),_0x9106('0x8'),_0x9106('0x9'),_0x9106('0xa'),'wrandom',_0x9106('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x830d5e){this['setDataValue'](_0x9106('0xc'),_0x830d5e?_0x830d5e:_0x9106('0x9'));},'get':function(){var _0x14fb1f=this[_0x9106('0xd')]('type');var _0x210a61=this[_0x9106('0xd')](_0x9106('0xe'));var _0x29ad4a=this['getDataValue'](_0x9106('0xc'));if(_0x14fb1f===_0x9106('0xf')){if(_0x210a61===_0x9106('0x10')){return null;}if(_0x210a61==='booked'&&!['rrmemory',_0x9106('0x11')][_0x9106('0x12')](_0x29ad4a)){this[_0x9106('0x13')](_0x9106('0xc'),_0x9106('0x9'));}}return _0x29ad4a;}},'servicelevel':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9106('0x0')]},'weight':{'type':Sequelize[_0x9106('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x9106('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9106('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9106('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9106('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defaultValue':_0x9106('0x15')},'announce_holdtime':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no',_0x9106('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9106('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x9106('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9106('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9106('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9106('0x0')]},'queue_youarenext':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9106('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9106('0x0')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x9106('0x0')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x9106('0x0')]},'periodic_announce':{'type':Sequelize[_0x9106('0x17')],'set':function(_0x39d741){this['setDataValue'](_0x9106('0x18'),_0x39d741?_0x39d741[_0x9106('0x19')](','):[]);},'get':function(){return this[_0x9106('0xd')]('periodic_announce')?this[_0x9106('0xd')]('periodic_announce')[_0x9106('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x9106('0x0')],'defaultValue':'yes','set':function(_0x55ad5c){this[_0x9106('0x13')](_0x9106('0x1b'),_0x55ad5c?_0x55ad5c[_0x9106('0x19')](','):undefined);},'get':function(){return this[_0x9106('0xd')]('joinempty')?this['getDataValue'](_0x9106('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9106('0x0')],'defaultValue':'no','set':function(_0x236220){this[_0x9106('0x13')](_0x9106('0x1c'),_0x236220?_0x236220[_0x9106('0x19')](','):undefined);},'get':function(){return this[_0x9106('0xd')](_0x9106('0x1c'))?this[_0x9106('0xd')](_0x9106('0x1c'))[_0x9106('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9106('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9106('0x0')]},'description':{'type':Sequelize[_0x9106('0x0')]},'acw':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':0x0,'set':function(_0xf67b85){this[_0x9106('0x13')](_0x9106('0x1e'),_0xf67b85);if(_0xf67b85){if(this[_0x9106('0xd')](_0x9106('0x1f'))<0x2){this['setDataValue'](_0x9106('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9106('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':0x0,'comment':_0x9106('0x20')},'dialMethod':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x10'),_0x9106('0x21'),_0x9106('0x22'),_0x9106('0x23'),_0x9106('0x24')),'defaultValue':_0x9106('0x21'),'comment':_0x9106('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x9106('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9106('0x27')},'dialLimitQueue':{'type':Sequelize[_0x9106('0x14')](0x4)[_0x9106('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9106('0x28')},'dialPowerLevel':{'type':Sequelize[_0x9106('0x29')](0x2)[_0x9106('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9106('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x9106('0x2')](_0x9106('0x2b'),_0x9106('0x2c')),'defaultValue':_0x9106('0x2c'),'comment':_0x9106('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9106('0x29')](0x2)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9106('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x9106('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9106('0x30'),'comment':_0x9106('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x32')},'dialQueueProject':{'type':Sequelize[_0x9106('0x0')],'comment':_0x9106('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9106('0x39')},'dialTimezone':{'type':Sequelize[_0x9106('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9106('0x3a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9106('0x2')]('always','never',_0x9106('0x3b')),'defaultValue':_0x9106('0x3c')},'dialAMDActive':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':0x0,'comment':_0x9106('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9106('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9106('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x9106('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9106('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9106('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9106('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9106('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0x9106('0x14')](0x9)[_0x9106('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9106('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9106('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9106('0x14')](0x9)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9106('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9106('0x14')](0x9)[_0x9106('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9106('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x9106('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9106('0x2')]('DESC','ASC'),'defaultValue':_0x9106('0x45')},'dialQueueProject2':{'type':Sequelize[_0x9106('0x0')],'comment':_0x9106('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x9106('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9106('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9106('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9106('0x14')](0x5)[_0x9106('0x26')],'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['BOOLEAN'],'defaultValue':![],'comment':_0x9106('0x4e'),'set':function(_0x43e760){if(!_0x43e760)this[_0x9106('0x13')](_0x9106('0x4f'),null);this[_0x9106('0x13')](_0x9106('0x50'),_0x43e760);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9106('0x14')](0x3)[_0x9106('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9106('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9106('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0x2c26=['type','dialMethod','outbound','preview','booked','roundrobin','INTEGER','yes','all','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','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,)','#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\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)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2c26,0x131));var _0x62c2=function(_0x154ecd,_0x152847){_0x154ecd=_0x154ecd-0x0;var _0x3b2edf=_0x2c26[_0x154ecd];return _0x3b2edf;};'use strict';var Sequelize=require('sequelize');module[_0x62c2('0x0')]={'name':{'type':Sequelize[_0x62c2('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x62c2('0x3')},'musiconhold':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':_0x62c2('0x4')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x62c2('0x2')]('rr',_0x62c2('0x5'),_0x62c2('0x6'),_0x62c2('0x7'),_0x62c2('0x8'),_0x62c2('0x9'),'linear',_0x62c2('0xa'),_0x62c2('0xb')),'allowNull':![],'defaultValue':_0x62c2('0x5'),'set':function(_0x2a54fe){this[_0x62c2('0xc')](_0x62c2('0xd'),_0x2a54fe?_0x2a54fe:_0x62c2('0x9'));},'get':function(){var _0x410d7b=this[_0x62c2('0xe')](_0x62c2('0xf'));var _0x1a52a3=this['getDataValue'](_0x62c2('0x10'));var _0x1714c6=this[_0x62c2('0xe')](_0x62c2('0xd'));if(_0x410d7b===_0x62c2('0x11')){if(_0x1a52a3===_0x62c2('0x12')){return null;}if(_0x1a52a3===_0x62c2('0x13')&&![_0x62c2('0x9'),_0x62c2('0x14')]['includes'](_0x1714c6)){this[_0x62c2('0xc')](_0x62c2('0xd'),_0x62c2('0x9'));}}return _0x1714c6;}},'servicelevel':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x62c2('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x62c2('0x1')]},'weight':{'type':Sequelize[_0x62c2('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no',_0x62c2('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x62c2('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x62c2('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x62c2('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x62c2('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x62c2('0x2')]('yes','no'),'defaultValue':_0x62c2('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x62c2('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x62c2('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x62c2('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x62c2('0x1')]},'queue_youarenext':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x62c2('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x62c2('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x62c2('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x62c2('0x1')]},'periodic_announce':{'type':Sequelize[_0x62c2('0x18')],'set':function(_0x5e1374){this[_0x62c2('0xc')](_0x62c2('0x19'),_0x5e1374?_0x5e1374[_0x62c2('0x1a')](','):[]);},'get':function(){return this[_0x62c2('0xe')](_0x62c2('0x19'))?this[_0x62c2('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':_0x62c2('0x16'),'set':function(_0x509a45){this[_0x62c2('0xc')](_0x62c2('0x1b'),_0x509a45?_0x509a45[_0x62c2('0x1a')](','):undefined);},'get':function(){return this[_0x62c2('0xe')](_0x62c2('0x1b'))?this[_0x62c2('0xe')](_0x62c2('0x1b'))[_0x62c2('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':'no','set':function(_0x269baa){this[_0x62c2('0xc')](_0x62c2('0x1d'),_0x269baa?_0x269baa[_0x62c2('0x1a')](','):undefined);},'get':function(){return this[_0x62c2('0xe')](_0x62c2('0x1d'))?this['getDataValue'](_0x62c2('0x1d'))[_0x62c2('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x62c2('0x1')]},'description':{'type':Sequelize[_0x62c2('0x1')]},'acw':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':0x0,'set':function(_0x12ca7a){this[_0x62c2('0xc')](_0x62c2('0x1f'),_0x12ca7a);if(_0x12ca7a){if(this[_0x62c2('0xe')](_0x62c2('0x20'))<0x2){this[_0x62c2('0xc')](_0x62c2('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x62c2('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x12'),'progressive',_0x62c2('0x21'),_0x62c2('0x22'),'booked'),'defaultValue':_0x62c2('0x23'),'comment':_0x62c2('0x24')},'dialLimitChannel':{'type':Sequelize[_0x62c2('0x15')](0x4)[_0x62c2('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x62c2('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x62c2('0x26')},'dialPowerLevel':{'type':Sequelize[_0x62c2('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x62c2('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x62c2('0x2')]('agentBusyFactor',_0x62c2('0x29')),'defaultValue':_0x62c2('0x29'),'comment':_0x62c2('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x62c2('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x62c2('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x62c2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x62c2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':_0x62c2('0x2e'),'comment':_0x62c2('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x30')},'dialQueueProject':{'type':Sequelize[_0x62c2('0x1')],'comment':_0x62c2('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x62c2('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'comment':_0x62c2('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x62c2('0x35')},'dialTimezone':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x62c2('0x36')},'dialPrefix':{'type':Sequelize[_0x62c2('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x37'),_0x62c2('0x38'),_0x62c2('0x39')),'defaultValue':_0x62c2('0x37')},'dialAMDActive':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x62c2('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x62c2('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x62c2('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x62c2('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x62c2('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x62c2('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x62c2('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x62c2('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x62c2('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x62c2('0x15')](0x9)[_0x62c2('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x62c2('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x62c2('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x62c2('0x2')](_0x62c2('0x43'),_0x62c2('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x62c2('0x1')],'comment':_0x62c2('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x62c2('0x45')},'dialCutDigit':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x62c2('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x62c2('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x62c2('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x62c2('0x15')](0x5)[_0x62c2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x62c2('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x62c2('0x15')],'allowNull':!![],'comment':_0x62c2('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1bda1c){if(!_0x1bda1c)this['setDataValue'](_0x62c2('0x4e'),null);this['setDataValue'](_0x62c2('0x4f'),_0x1bda1c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x62c2('0x15')](0x3)[_0x62c2('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x62c2('0x15')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x62c2('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index af96a07..6435dbc 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 _0x1cb9=['VoiceQueues','inbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','count','include','query','rows','catch','params','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','find','create','body','user','get','role','QueueCampaigns','outbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','getHoppers','CmHopper','nolimit','order','sort','pick','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','options','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','spread','emit','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','phone','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','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','scheduledAt','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','offset','Content-Range','update','then','destroy'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4c1164,_0x2dde6e){_0x4c1164=_0x4c1164-0x0;var _0x399fbc=_0x1cb9[_0x4c1164];return _0x399fbc;};'use strict';var moment=require(_0x91cb('0x0'));var BPromise=require('bluebird');var util=require(_0x91cb('0x1'));var _=require(_0x91cb('0x2'));var squel=require(_0x91cb('0x3'));var Redis=require(_0x91cb('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x91cb('0x5'))(_0x91cb('0x6'));var config=require('../../config/environment');var db=require(_0x91cb('0x7'))['db'];config[_0x91cb('0x8')]=_[_0x91cb('0x9')](config[_0x91cb('0x8')],{'host':_0x91cb('0xa'),'port':0x18eb});var socket=require(_0x91cb('0xb'))(new Redis(config['redis']));require(_0x91cb('0xc'))['register'](socket);function respondWithStatusCode(_0x2fdfce,_0x4cf9ed){_0x4cf9ed=_0x4cf9ed||0xcc;return function(_0xa43e7a){if(_0xa43e7a){return _0x2fdfce[_0x91cb('0xd')](_0x4cf9ed);}return _0x2fdfce[_0x91cb('0xe')](_0x4cf9ed)[_0x91cb('0xf')]();};}function respondWithResult(_0x429928,_0x23ba9a){_0x23ba9a=_0x23ba9a||0xc8;return function(_0x21a0a5){if(_0x21a0a5){return _0x429928[_0x91cb('0xe')](_0x23ba9a)[_0x91cb('0x10')](_0x21a0a5);}};}function respondWithFilteredResult(_0x8c0097,_0x530d92){return function(_0x3c1f56){if(_0x3c1f56){var _0x366f09=typeof _0x530d92['offset']===_0x91cb('0x11')&&typeof _0x530d92[_0x91cb('0x12')]===_0x91cb('0x11');var _0x2c7d40=_0x3c1f56['count'];var _0x4cc6ef=_0x366f09?0x0:_0x530d92[_0x91cb('0x13')];var _0x3d22b7=_0x366f09?_0x3c1f56['count']:_0x530d92['offset']+_0x530d92[_0x91cb('0x12')];var _0xc3629e;if(_0x3d22b7>=_0x2c7d40){_0x3d22b7=_0x2c7d40;_0xc3629e=0xc8;}else{_0xc3629e=0xce;}_0x8c0097[_0x91cb('0xe')](_0xc3629e);return _0x8c0097['set'](_0x91cb('0x14'),_0x4cc6ef+'-'+_0x3d22b7+'/'+_0x2c7d40)[_0x91cb('0x10')](_0x3c1f56);}return null;};}function saveUpdates(_0x4f1554){return function(_0xc594e3){if(_0xc594e3){return _0xc594e3[_0x91cb('0x15')](_0x4f1554)[_0x91cb('0x16')](function(_0xcd1a78){return _0xcd1a78;});}return null;};}function removeEntity(_0x5cc1c3){return function(_0x3fba4f){if(_0x3fba4f){return _0x3fba4f[_0x91cb('0x17')]()['then'](function(){var _0x123847=_0x3fba4f['get']({'plain':!![]});var _0x55042a=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5b385a=_(_0x55042a)[_0x91cb('0x1a')](_0x91cb('0x1b'))[_0x91cb('0x1c')](_0x91cb('0x1d'))['value']();if(_[_0x91cb('0x1e')](_0x5b385a,_0x123847[_0x91cb('0x1f')])){return;}var _0x1fa837=_['find'](_0x55042a,[_0x91cb('0x1d'),_0x123847[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x21')][_0x91cb('0x17')]({'where':{'type':_0x1fa837,'resourceId':_0x123847['id']}})[_0x91cb('0x16')](function(){return _0x3fba4f;});})[_0x91cb('0x16')](function(){_0x5cc1c3[_0x91cb('0xe')](0xcc)[_0x91cb('0xf')]();});}};}function handleEntityNotFound(_0x4c8438){return function(_0x59bf3a){if(!_0x59bf3a){_0x4c8438[_0x91cb('0xd')](0x194);}return _0x59bf3a;};}function handleError(_0x554350,_0x1c67d2){_0x1c67d2=_0x1c67d2||0x1f4;return function(_0x34d372){logger[_0x91cb('0x22')](_0x34d372['stack']);if(_0x34d372[_0x91cb('0x20')]){delete _0x34d372['name'];}_0x554350[_0x91cb('0xe')](_0x1c67d2)[_0x91cb('0x23')](_0x34d372);};}exports[_0x91cb('0x24')]=function(_0x2fb473,_0x468908){var _0x504275={};var _0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x1c')](db[_0x91cb('0x25')][_0x91cb('0x26')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x27')],'type':_0x4944bd[_0x91cb('0x1f')][_0x91cb('0x28')]};});_0x504275=qs[_0x91cb('0x29')](_0x52670a,_0x2fb473);var _0xf296bc={'where':_0x504275[_0x91cb('0x2a')]};return db[_0x91cb('0x25')][_0x91cb('0x2b')](_0xf296bc)[_0x91cb('0x16')](function(_0x5e6ed3){_0x2f04a3[_0x91cb('0x2b')]=_0x5e6ed3;_0x504275[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x2fb473[_0x91cb('0x2d')]);return db[_0x91cb('0x25')]['findAll'](_0x504275);})[_0x91cb('0x16')](function(_0x74b443){_0x2f04a3[_0x91cb('0x2e')]=_0x74b443;return _0x2f04a3;})[_0x91cb('0x16')](respondWithFilteredResult(_0x468908,_0x504275))[_0x91cb('0x2f')](handleError(_0x468908,null));};exports['show']=function(_0x121c37,_0x5927cb){var _0x47fc17={'raw':![],'where':{'id':_0x121c37[_0x91cb('0x30')]['id']}},_0x479968={};_0x479968['model']=_[_0x91cb('0x31')](db['VoiceQueue']['rawAttributes']);_0x479968[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x121c37[_0x91cb('0x2d')]);_0x479968[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x479968['model'],_0x479968[_0x91cb('0x2d')]);_0x47fc17[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x479968[_0x91cb('0x35')],qs['fields'](_0x121c37['query'][_0x91cb('0x36')]));_0x47fc17[_0x91cb('0x34')]=_0x47fc17['attributes'][_0x91cb('0x37')]?_0x47fc17[_0x91cb('0x34')]:_0x479968['model'];if(_0x121c37[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x47fc17['include']=[{'all':!![]}];}_0x47fc17=_[_0x91cb('0x39')]({},_0x47fc17,_0x121c37['options']);return db[_0x91cb('0x25')][_0x91cb('0x3a')](_0x47fc17)[_0x91cb('0x16')](handleEntityNotFound(_0x5927cb,null))[_0x91cb('0x16')](respondWithResult(_0x5927cb,null))[_0x91cb('0x2f')](handleError(_0x5927cb,null));};exports[_0x91cb('0x3b')]=function(_0x5d0e37,_0xa90111){return db[_0x91cb('0x25')]['create'](_0x5d0e37[_0x91cb('0x3c')],{})['then'](function(_0x2c6102){var _0x2eac87=_0x5d0e37[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x2eac87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eac87[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0x2cf27e=_0x2c6102[_0x91cb('0x3e')]({'plain':!![]});var _0x42a7f3=[{'name':_0x91cb('0x18'),'value':_0x91cb('0x19')},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x3cc4c1=_['find'](_0x42a7f3,[_0x91cb('0x1d'),_0x2cf27e['type']])[_0x91cb('0x20')];return db['UserProfileSection'][_0x91cb('0x3a')]({'where':{'name':_0x3cc4c1,'userProfileId':_0x2eac87['userProfileId']},'raw':!![]})[_0x91cb('0x16')](function(_0x477131){if(_0x477131&&_0x477131[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0x2cf27e[_0x91cb('0x20')],'resourceId':_0x2cf27e['id'],'type':_0x477131[_0x91cb('0x20')],'sectionId':_0x477131['id']},{})['then'](function(){return _0x2c6102;});}else{return _0x2c6102;}})[_0x91cb('0x2f')](function(_0x2f1749){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x2f1749);throw _0x2f1749;});}return _0x2c6102;})[_0x91cb('0x16')](respondWithResult(_0xa90111,0xc9))[_0x91cb('0x2f')](handleError(_0xa90111,null));};exports[_0x91cb('0x44')]=function(_0x29d5a1,_0x396b81){var _0x4b26f6={'where':{'id':_0x29d5a1[_0x91cb('0x30')]['id']}},_0x7c22b3={};_0x7c22b3[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x25')][_0x91cb('0x26')]);_0x4b26f6[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x7c22b3['model'],qs[_0x91cb('0x36')](_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4b26f6[_0x91cb('0x34')]=_0x4b26f6['attributes'][_0x91cb('0x37')]?_0x4b26f6[_0x91cb('0x34')]:_0x7c22b3['model'];if(_0x29d5a1[_0x91cb('0x2d')]['includeAll']){_0x4b26f6[_0x91cb('0x2c')]=[{'all':!![]}];}_0x4b26f6=_['merge']({},_0x4b26f6,_0x29d5a1['options']);return db['VoiceQueue'][_0x91cb('0x3a')](_0x4b26f6)[_0x91cb('0x16')](handleEntityNotFound(_0x396b81,null))[_0x91cb('0x16')](function(_0x2f8384){if(_0x2f8384){var _0x333814=_0x2f8384['get']({'plain':!![]});_0x333814=qs['omit'](_0x333814,['id',_0x91cb('0x45'),_0x91cb('0x46')]);_0x29d5a1[_0x91cb('0x3c')]=_[_0x91cb('0x47')](_0x29d5a1['body'],['id','createdAt','updatedAt']);return db[_0x91cb('0x25')]['create'](_[_0x91cb('0x39')](_0x333814,_0x29d5a1['body']),{'include':_0x29d5a1[_0x91cb('0x2d')][_0x91cb('0x38')]?[{'all':!![]}]:undefined})[_0x91cb('0x16')](function(_0x649976){var _0x1884bc=_0x29d5a1[_0x91cb('0x3d')][_0x91cb('0x3e')]({'plain':!![]});if(!_0x1884bc)throw new Error(_0x91cb('0x48'));if(_0x1884bc[_0x91cb('0x3f')]===_0x91cb('0x3d')){var _0xd8f7c2=_0x649976['get']({'plain':!![]});var _0x1e445a=[{'name':_0x91cb('0x18'),'value':'inbound'},{'name':_0x91cb('0x40'),'value':_0x91cb('0x41')}];var _0x4bab7d=_[_0x91cb('0x3a')](_0x1e445a,[_0x91cb('0x1d'),_0xd8f7c2[_0x91cb('0x1f')]])[_0x91cb('0x20')];return db[_0x91cb('0x49')][_0x91cb('0x3a')]({'where':{'name':_0x4bab7d,'userProfileId':_0x1884bc[_0x91cb('0x4a')]},'raw':!![]})[_0x91cb('0x16')](function(_0x3320bd){if(_0x3320bd&&_0x3320bd[_0x91cb('0x42')]===0x0){return db[_0x91cb('0x21')]['create']({'name':_0xd8f7c2[_0x91cb('0x20')],'resourceId':_0xd8f7c2['id'],'type':_0x3320bd['name'],'sectionId':_0x3320bd['id']},{})[_0x91cb('0x16')](function(){return _0x649976;});}else{return _0x649976;}})['catch'](function(_0x3dfff9){logger[_0x91cb('0x22')](_0x91cb('0x43'),_0x3dfff9);throw _0x3dfff9;});}return _0x649976;});}})['then'](respondWithResult(_0x396b81,0xc9))[_0x91cb('0x2f')](handleError(_0x396b81,null));};exports[_0x91cb('0x15')]=function(_0x48dcf7,_0xef4754){if(_0x48dcf7[_0x91cb('0x3c')]['id']){delete _0x48dcf7[_0x91cb('0x3c')]['id'];}return db[_0x91cb('0x25')]['find']({'where':{'id':_0x48dcf7[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0xef4754,null))[_0x91cb('0x16')](saveUpdates(_0x48dcf7[_0x91cb('0x3c')],null))['then'](respondWithResult(_0xef4754,null))[_0x91cb('0x2f')](handleError(_0xef4754,null));};exports[_0x91cb('0x17')]=function(_0x5c2c01,_0x492b09){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x5c2c01[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x492b09,null))['then'](removeEntity(_0x492b09,null))['catch'](handleError(_0x492b09,null));};exports[_0x91cb('0x4b')]=function(_0x5c468a,_0x1b69ce){var _0x961ebf={'raw':![],'where':{}};var _0x33de58={};var _0x551836={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x5c468a[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1b69ce,null))[_0x91cb('0x16')](function(_0x2c1911){if(_0x2c1911){_0x33de58['model']=_[_0x91cb('0x31')](db[_0x91cb('0x4c')][_0x91cb('0x26')]);_0x33de58[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x5c468a[_0x91cb('0x2d')]);_0x33de58[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x33de58[_0x91cb('0x35')],_0x33de58[_0x91cb('0x2d')]);_0x961ebf[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x33de58['model'],qs[_0x91cb('0x36')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x961ebf[_0x91cb('0x34')]=_0x961ebf[_0x91cb('0x34')][_0x91cb('0x37')]?_0x961ebf[_0x91cb('0x34')]:_0x33de58['model'];if(!_0x5c468a[_0x91cb('0x2d')]['hasOwnProperty'](_0x91cb('0x4d'))){_0x961ebf[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x5c468a[_0x91cb('0x2d')]['limit']);_0x961ebf[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x961ebf[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x5c468a['query'][_0x91cb('0x4f')]);_0x961ebf[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x5c468a[_0x91cb('0x2d')],_0x33de58[_0x91cb('0x32')]));_0x961ebf[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x2c1911['id'];if(_0x5c468a[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x961ebf[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x961ebf[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x961ebf[_0x91cb('0x34')],function(_0x2605c3){var _0x1d9ded={};_0x1d9ded[_0x2605c3]={'$like':'%'+_0x5c468a['query'][_0x91cb('0x1a')]+'%'};return _0x1d9ded;})});}_0x961ebf=_[_0x91cb('0x39')]({},_0x961ebf,_0x5c468a['options']);return db[_0x91cb('0x4c')][_0x91cb('0x2b')]({'where':_0x961ebf[_0x91cb('0x2a')]})['then'](function(_0x45e26b){_0x551836[_0x91cb('0x2b')]=_0x45e26b;if(_0x5c468a['query']['includeAll']){_0x961ebf[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopper'][_0x91cb('0x52')](_0x961ebf);})[_0x91cb('0x16')](function(_0x4e11e3){_0x551836[_0x91cb('0x2e')]=_0x4e11e3;return _0x551836;});}})['then'](respondWithFilteredResult(_0x1b69ce,_0x961ebf))[_0x91cb('0x2f')](handleError(_0x1b69ce,null));};exports[_0x91cb('0x53')]=function(_0x4f827e,_0x5d8a7e){var _0x16a21f={'raw':!![],'where':{}};var _0x43be3e={};var _0x37666a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x91cb('0x54')]({'where':{'id':_0x4f827e[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x5d8a7e,null))[_0x91cb('0x16')](function(_0x570f6b){if(_0x570f6b){_0x43be3e[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x55')][_0x91cb('0x26')]);_0x43be3e[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x4f827e['query']);_0x43be3e['filters']=_[_0x91cb('0x33')](_0x43be3e['model'],_0x43be3e[_0x91cb('0x2d')]);_0x16a21f[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x43be3e[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x16a21f['attributes']=_0x16a21f[_0x91cb('0x34')][_0x91cb('0x37')]?_0x16a21f['attributes']:_0x43be3e[_0x91cb('0x35')];if(!_0x4f827e['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x16a21f[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x16a21f[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x16a21f[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x16a21f[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x4f827e[_0x91cb('0x2d')],_0x43be3e['filters']));_0x16a21f[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x570f6b['id'];if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x16a21f[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x16a21f[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x16a21f['attributes'],function(_0xb5c264){var _0xdee7f={};_0xdee7f[_0xb5c264]={'$like':'%'+_0x4f827e['query']['filter']+'%'};return _0xdee7f;})});}_0x16a21f=_[_0x91cb('0x39')]({},_0x16a21f,_0x4f827e['options']);return db['CmHopperHistory'][_0x91cb('0x2b')]({'where':_0x16a21f['where']})[_0x91cb('0x16')](function(_0x498382){_0x37666a[_0x91cb('0x2b')]=_0x498382;if(_0x4f827e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x16a21f[_0x91cb('0x2c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x91cb('0x52')](_0x16a21f);})[_0x91cb('0x16')](function(_0x42d07b){_0x37666a[_0x91cb('0x2e')]=_0x42d07b;return _0x37666a;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x5d8a7e,_0x16a21f))[_0x91cb('0x2f')](handleError(_0x5d8a7e,null));};exports[_0x91cb('0x57')]=function(_0x3cf8c5,_0x21dfd3){var _0x24facc={'raw':!![],'where':{}};var _0xafda63={};var _0x32704d={'count':0x0,'rows':[]};return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x3cf8c5[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x21dfd3,null))[_0x91cb('0x16')](function(_0x39fce4){if(_0x39fce4){_0xafda63[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x58')][_0x91cb('0x26')]);_0xafda63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3cf8c5[_0x91cb('0x2d')]);_0xafda63['filters']=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],_0xafda63[_0x91cb('0x2d')]);_0x24facc[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0xafda63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x24facc[_0x91cb('0x34')]=_0x24facc[_0x91cb('0x34')]['length']?_0x24facc[_0x91cb('0x34')]:_0xafda63['model'];if(!_0x3cf8c5['query'][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x24facc[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x24facc[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x24facc['order']=qs[_0x91cb('0x4f')](_0x3cf8c5[_0x91cb('0x2d')]['sort']);_0x24facc[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3cf8c5[_0x91cb('0x2d')],_0xafda63[_0x91cb('0x32')]));_0x24facc[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x39fce4['id'];if(_0x3cf8c5[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x24facc[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x24facc[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x24facc[_0x91cb('0x34')],function(_0x378cd0){var _0x538a8c={};_0x538a8c[_0x378cd0]={'$like':'%'+_0x3cf8c5['query'][_0x91cb('0x1a')]+'%'};return _0x538a8c;})});}_0x24facc=_[_0x91cb('0x39')]({},_0x24facc,_0x3cf8c5[_0x91cb('0x59')]);return db[_0x91cb('0x58')][_0x91cb('0x2b')]({'where':_0x24facc[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x5ac5cc){_0x32704d[_0x91cb('0x2b')]=_0x5ac5cc;if(_0x3cf8c5['query'][_0x91cb('0x38')]){_0x24facc[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x58')][_0x91cb('0x52')](_0x24facc);})[_0x91cb('0x16')](function(_0x4ac4dd){_0x32704d[_0x91cb('0x2e')]=_0x4ac4dd;return _0x32704d;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x21dfd3,_0x24facc))[_0x91cb('0x2f')](handleError(_0x21dfd3,null));};exports[_0x91cb('0x5a')]=function(_0x3a213e,_0x4e4003){var _0x4003c9={'raw':!![],'where':{}};var _0x9cff8f={};var _0x25a779={'count':0x0,'rows':[]};return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a213e['params']['id']}})['then'](handleEntityNotFound(_0x4e4003,null))[_0x91cb('0x16')](function(_0x182aa5){if(_0x182aa5){_0x9cff8f[_0x91cb('0x35')]=_[_0x91cb('0x31')](db['CmHopperBlack'][_0x91cb('0x26')]);_0x9cff8f[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x3a213e[_0x91cb('0x2d')]);_0x9cff8f['filters']=_['intersection'](_0x9cff8f[_0x91cb('0x35')],_0x9cff8f[_0x91cb('0x2d')]);_0x4003c9[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9cff8f[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x4003c9[_0x91cb('0x34')]=_0x4003c9[_0x91cb('0x34')][_0x91cb('0x37')]?_0x4003c9[_0x91cb('0x34')]:_0x9cff8f[_0x91cb('0x35')];if(!_0x3a213e['query']['hasOwnProperty'](_0x91cb('0x4d'))){_0x4003c9['limit']=qs[_0x91cb('0x12')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x4003c9[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x13')]);}_0x4003c9[_0x91cb('0x4e')]=qs['sort'](_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x4003c9[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x3a213e['query'],_0x9cff8f[_0x91cb('0x32')]));_0x4003c9[_0x91cb('0x2a')][_0x91cb('0x51')]=_0x182aa5['id'];if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x4003c9['where']=_[_0x91cb('0x39')](_0x4003c9[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x4003c9[_0x91cb('0x34')],function(_0x440ef4){var _0x2c2ed8={};_0x2c2ed8[_0x440ef4]={'$like':'%'+_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x2c2ed8;})});}_0x4003c9=_[_0x91cb('0x39')]({},_0x4003c9,_0x3a213e[_0x91cb('0x59')]);return db[_0x91cb('0x5b')][_0x91cb('0x2b')]({'where':_0x4003c9[_0x91cb('0x2a')]})[_0x91cb('0x16')](function(_0x7c84fc){_0x25a779[_0x91cb('0x2b')]=_0x7c84fc;if(_0x3a213e[_0x91cb('0x2d')][_0x91cb('0x38')]){_0x4003c9[_0x91cb('0x2c')]=[{'all':!![]}];}return db[_0x91cb('0x5b')][_0x91cb('0x52')](_0x4003c9);})[_0x91cb('0x16')](function(_0x275c80){_0x25a779[_0x91cb('0x2e')]=_0x275c80;return _0x25a779;});}})[_0x91cb('0x16')](respondWithFilteredResult(_0x4e4003,_0x4003c9))[_0x91cb('0x2f')](handleError(_0x4e4003,null));};exports['getTeams']=function(_0x16cf02,_0x2b8634){var _0x1eb46e={};var _0x261a3a={};var _0x16f334;var _0x5ca377;return db['VoiceQueue']['findOne']({'where':{'id':_0x16cf02['params']['id']}})['then'](handleEntityNotFound(_0x2b8634,null))[_0x91cb('0x16')](function(_0x46a6cc){if(_0x46a6cc){_0x16f334=_0x46a6cc;_0x261a3a[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x5c')][_0x91cb('0x26')]);_0x261a3a[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x16cf02[_0x91cb('0x2d')]);_0x261a3a[_0x91cb('0x32')]=_['intersection'](_0x261a3a[_0x91cb('0x35')],_0x261a3a[_0x91cb('0x2d')]);_0x1eb46e['attributes']=_[_0x91cb('0x33')](_0x261a3a[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x1eb46e[_0x91cb('0x34')]=_0x1eb46e[_0x91cb('0x34')]['length']?_0x1eb46e[_0x91cb('0x34')]:_0x261a3a[_0x91cb('0x35')];_0x1eb46e[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x1eb46e[_0x91cb('0x2a')]=qs['filters'](_[_0x91cb('0x50')](_0x16cf02['query'],_0x261a3a[_0x91cb('0x32')]));if(_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x1eb46e[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x1eb46e[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x1eb46e[_0x91cb('0x34')],function(_0x1c7c10){var _0x570cf0={};_0x570cf0[_0x1c7c10]={'$like':'%'+_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x570cf0;})});}_0x1eb46e=_[_0x91cb('0x39')]({},_0x1eb46e,_0x16cf02[_0x91cb('0x59')]);return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x189a87){if(_0x189a87){_0x5ca377=_0x189a87[_0x91cb('0x37')];if(!_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x1eb46e[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x16cf02['query'][_0x91cb('0x12')]);_0x1eb46e['offset']=qs[_0x91cb('0x13')](_0x16cf02[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x16f334[_0x91cb('0x5d')](_0x1eb46e);}})[_0x91cb('0x16')](function(_0x12da14){if(_0x12da14){return _0x12da14?{'count':_0x5ca377,'rows':_0x12da14}:null;}})[_0x91cb('0x16')](respondWithResult(_0x2b8634,null))[_0x91cb('0x2f')](handleError(_0x2b8634,null));};exports['addTeams']=function(_0x3353bf,_0x5b3658){var _0x3c1703=_0x3353bf[_0x91cb('0x3c')][_0x91cb('0x5e')];var _0x598663=_[_0x91cb('0x1c')](_0x3c1703,'id');return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x598663},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]}]})['then'](function(_0x469e62){if(_0x469e62){var _0x1e9441=_[_0x91cb('0x62')](_0x469e62,function(_0x1bb2de){var _0x129ea0=_0x1bb2de[_0x91cb('0x3e')]({'plain':!![]});_0x129ea0[_0x91cb('0x63')][_0x91cb('0x64')](function(_0x50b8d6){_0x50b8d6[_0x91cb('0x65')]=_[_0x91cb('0x3a')](_0x3c1703,{'id':_0x129ea0['id']})[_0x91cb('0x65')];});return _0x129ea0[_0x91cb('0x63')];});return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3353bf['params']['id']}})[_0x91cb('0x16')](function(_0x43b620){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x3b0bd5){return _0x43b620['addTeams'](_0x598663,{'transaction':_0x3b0bd5})[_0x91cb('0x16')](function(){return BPromise['each'](_0x3c1703,function(_0x58608e){return db[_0x91cb('0x68')][_0x91cb('0x69')]({'TeamId':_0x58608e['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id'],'penalty':_0x58608e[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise[_0x91cb('0x6a')](_0x1e9441,function(_0x20ef3d){return db[_0x91cb('0x6b')]['findOrCreate']({'where':{'UserId':_0x20ef3d['id'],'VoiceQueueId':_0x3353bf[_0x91cb('0x30')]['id']},'defaults':{'penalty':_0x20ef3d[_0x91cb('0x65')]},'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){return BPromise['each'](_['filter'](_0x1e9441,{'online':!![]}),function(_0x530565){return db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x530565[_0x91cb('0x20')],'UserId':_0x530565['id'],'queue_name':_0x43b620['name'],'VoiceQueueId':_0x43b620['id'],'interface':_[_0x91cb('0x6d')](_0x530565[_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x530565['name']):_0x530565[_0x91cb('0x61')],'paused':_0x530565[_0x91cb('0x60')]||![],'penalty':_0x530565[_0x91cb('0x65')]},{'transaction':_0x3b0bd5});});})[_0x91cb('0x16')](function(){_0x1e9441[_0x91cb('0x64')](function(_0x3c788e){socket['emit'](_0x91cb('0x70'),{'UserId':_0x3c788e['id'],'VoiceQueueId':_0x43b620['id']});});});});});}})[_0x91cb('0x16')](respondWithStatusCode(_0x5b3658,null))[_0x91cb('0x2f')](handleError(_0x5b3658,null));};exports[_0x91cb('0x71')]=function(_0x3782cd,_0x4b290e){return db[_0x91cb('0x5c')][_0x91cb('0x52')]({'where':{'id':_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')]},'attributes':['id'],'include':[{'model':db[_0x91cb('0x73')],'as':_0x91cb('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b290e,null))[_0x91cb('0x16')](function(_0x2bafae){var _0x27472a=_['map'](_0x2bafae,'id');var _0x59cb69=[];var _0x5d0f96=[];var _0x174325=squel[_0x91cb('0x74')]();_0x174325[_0x91cb('0x75')](_0x91cb('0x76'))['from'](_0x91cb('0x77'),'tq')[_0x91cb('0x78')](_0x91cb('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x91cb('0x2a')]('VoiceQueueId\x20=\x20?',_0x3782cd[_0x91cb('0x30')]['id']);for(var _0x43b2e7=0x0;_0x43b2e7<_0x2bafae['length'];_0x43b2e7+=0x1){let _0x1b47fe=_0x2bafae[_0x43b2e7];for(var _0x1853de=0x0;_0x1853de<_0x1b47fe[_0x91cb('0x63')][_0x91cb('0x37')];_0x1853de+=0x1){let _0x376426=_0x1b47fe['Agents'][_0x1853de];var _0x22a6e6=_0x174325[_0x91cb('0x44')]();_0x22a6e6[_0x91cb('0x2a')](_0x91cb('0x7a'),_0x376426['id']);_0x5d0f96['push'](db[_0x91cb('0x66')]['query'](_0x22a6e6['toString'](),{'type':db['sequelize'][_0x91cb('0x7b')][_0x91cb('0x7c')]})[_0x91cb('0x16')](function(_0x4972c3){if(_0x4972c3[_0x91cb('0x37')]===0x1){return _0x376426['id'];}else{var _0x53dbb2=_[_0x91cb('0x7d')](_[_0x91cb('0x1c')](_0x4972c3,_0x91cb('0x7e')),function(_0x2a2a71){return _[_0x91cb('0x1e')](_0x27472a,_0x2a2a71);});if(_0x53dbb2){return _0x376426['id'];}}}));}}return BPromise[_0x91cb('0x7f')](_0x5d0f96)['then'](function(_0x5bfd2c){_0x59cb69=_(_0x59cb69)[_0x91cb('0x80')](_0x5bfd2c)['compact']()[_0x91cb('0x1d')]();return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x3782cd[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(_0x51d431){return db[_0x91cb('0x66')][_0x91cb('0x67')](function(_0x18ec67){return _0x51d431['removeTeams'](_0x3782cd[_0x91cb('0x2d')][_0x91cb('0x72')],{'transaction':_0x18ec67})['then'](function(){if(!_[_0x91cb('0x81')](_0x59cb69)){return _0x51d431[_0x91cb('0x82')](_0x59cb69,{'transaction':_0x18ec67})[_0x91cb('0x16')](function(){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0x3782cd[_0x91cb('0x30')]['id'],'UserId':_0x59cb69},'transaction':_0x18ec67});});}})['then'](function(){_0x59cb69[_0x91cb('0x64')](function(_0x5da781){socket['emit']('userVoiceQueue:remove',{'UserId':_0x5da781,'VoiceQueueId':_0x51d431['id']});});});});});});})[_0x91cb('0x16')](respondWithStatusCode(_0x4b290e,null))['catch'](handleError(_0x4b290e,null));};exports['addAgents']=function(_0x3c0211,_0x3710e9){var _0x395e21,_0x52b9af;return db['VoiceQueue'][_0x91cb('0x3a')]({'where':{'id':_0x3c0211[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x3710e9,null))[_0x91cb('0x16')](function(_0x3280a5){if(_0x3280a5){_0x52b9af=_0x3280a5;return _0x3280a5[_0x91cb('0x83')](_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x3c0211['body'],[_0x91cb('0x72'),'id'])||{})[_0x91cb('0x84')](function(_0x547b4d){for(var _0x1aef0b=0x0;_0x1aef0b<_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x91cb('0x37')];_0x1aef0b+=0x1){socket[_0x91cb('0x85')]('userVoiceQueue:save',{'UserId':Number(_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')][_0x1aef0b]),'VoiceQueueId':Number(_0x3c0211[_0x91cb('0x30')]['id'])});}return _0x547b4d;});}})['then'](function(_0x4ba088){_0x395e21=_0x4ba088||[];if(_0x52b9af){return db[_0x91cb('0x73')][_0x91cb('0x52')]({'where':{'id':_0x3c0211[_0x91cb('0x3c')][_0x91cb('0x72')]},'attributes':['id',_0x91cb('0x20'),_0x91cb('0x5f'),_0x91cb('0x60'),_0x91cb('0x61')],'raw':!![]});}})['then'](function(_0x33b7a7){if(!_[_0x91cb('0x81')](_0x33b7a7)){var _0x4ac7b9=[];for(var _0x41c3ff=0x0;_0x41c3ff<_0x33b7a7[_0x91cb('0x37')];_0x41c3ff++){if(_0x33b7a7[_0x41c3ff]['online']){_0x4ac7b9[_0x91cb('0x86')](db[_0x91cb('0x6c')][_0x91cb('0x69')]({'membername':_0x33b7a7[_0x41c3ff][_0x91cb('0x20')],'UserId':_0x33b7a7[_0x41c3ff]['id'],'queue_name':_0x52b9af[_0x91cb('0x20')],'VoiceQueueId':_0x52b9af['id'],'interface':_['isNil'](_0x33b7a7[_0x41c3ff][_0x91cb('0x61')])?util[_0x91cb('0x6e')](_0x91cb('0x6f'),_0x33b7a7[_0x41c3ff][_0x91cb('0x20')]):_0x33b7a7[_0x41c3ff]['interface'],'paused':_0x33b7a7[_0x41c3ff][_0x91cb('0x60')]||![],'penalty':_0x3c0211['body'][_0x91cb('0x65')]||0x0}));}}return BPromise[_0x91cb('0x7f')](_0x4ac7b9);}})[_0x91cb('0x16')](function(){return _0x395e21;})[_0x91cb('0x16')](respondWithResult(_0x3710e9,null))[_0x91cb('0x2f')](handleError(_0x3710e9,null));};exports[_0x91cb('0x82')]=function(_0xd572bc,_0x1e7a48){return db[_0x91cb('0x25')]['find']({'where':{'id':_0xd572bc[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x1e7a48,null))[_0x91cb('0x16')](function(_0x51ef1c){if(_0x51ef1c){return _0x51ef1c[_0x91cb('0x82')](_0xd572bc['query'][_0x91cb('0x72')])['then'](function(){if(_[_0x91cb('0x87')](_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')])){for(var _0x10fe63=0x0;_0x10fe63<_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x91cb('0x37')];_0x10fe63+=0x1){socket['emit'](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')][_0x91cb('0x72')][_0x10fe63]),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}}else{socket[_0x91cb('0x85')](_0x91cb('0x88'),{'UserId':Number(_0xd572bc[_0x91cb('0x2d')]['ids']),'VoiceQueueId':Number(_0xd572bc[_0x91cb('0x30')]['id'])});}});}})[_0x91cb('0x16')](function(_0x219b5f){return db[_0x91cb('0x6c')][_0x91cb('0x17')]({'where':{'VoiceQueueId':_0xd572bc['params']['id'],'UserId':_0xd572bc['query']['ids']}})[_0x91cb('0x16')](function(){return _0x219b5f;});})[_0x91cb('0x16')](respondWithStatusCode(_0x1e7a48,null))['catch'](handleError(_0x1e7a48,null));};exports['getAgents']=function(_0x471c17,_0x6549a7){var _0x13564d={};var _0x3c1e63={};var _0x1f2d72;var _0x376adc;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x471c17['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x6549a7,null))[_0x91cb('0x16')](function(_0xf15400){if(_0xf15400){_0x1f2d72=_0xf15400;_0x3c1e63['model']=_[_0x91cb('0x31')](db[_0x91cb('0x73')][_0x91cb('0x26')]);_0x3c1e63[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x471c17[_0x91cb('0x2d')]);_0x3c1e63[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x3c1e63['model'],_0x3c1e63['query']);_0x13564d[_0x91cb('0x34')]=_['intersection'](_0x3c1e63[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x13564d['attributes']=_0x13564d[_0x91cb('0x34')][_0x91cb('0x37')]?_0x13564d[_0x91cb('0x34')]:_0x3c1e63[_0x91cb('0x35')];_0x13564d[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x13564d['where']=qs[_0x91cb('0x32')](_['pick'](_0x471c17[_0x91cb('0x2d')],_0x3c1e63[_0x91cb('0x32')]));if(_0x471c17['query'][_0x91cb('0x1a')]){_0x13564d[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x13564d[_0x91cb('0x2a')],{'$or':_['map'](_0x13564d[_0x91cb('0x34')],function(_0x1bef2b){var _0x5a38f7={};_0x5a38f7[_0x1bef2b]={'$like':'%'+_0x471c17[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x5a38f7;})});}_0x13564d=_[_0x91cb('0x39')]({},_0x13564d,_0x471c17[_0x91cb('0x59')]);return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x2f42ef){if(_0x2f42ef){_0x376adc=_0x2f42ef[_0x91cb('0x37')];if(!_0x471c17[_0x91cb('0x2d')][_0x91cb('0x56')]('nolimit')){_0x13564d[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x13564d[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x471c17[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1f2d72[_0x91cb('0x89')](_0x13564d);}})[_0x91cb('0x16')](function(_0x31cf76){if(_0x31cf76){return _0x31cf76?{'count':_0x376adc,'rows':_0x31cf76}:null;}})['then'](respondWithResult(_0x6549a7,null))[_0x91cb('0x2f')](handleError(_0x6549a7,null));};exports['getMembers']=function(_0x3a5022,_0x17141e){var _0x3e2c58={};var _0x11c67c={};var _0xf4b4ab;var _0x2fa5e3;return db[_0x91cb('0x25')]['findOne']({'where':{'id':_0x3a5022[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x17141e,null))[_0x91cb('0x16')](function(_0x4483fb){if(_0x4483fb){_0xf4b4ab=_0x4483fb;_0x11c67c['model']=_['keys'](db['UserVoiceQueueRt'][_0x91cb('0x26')]);_0x11c67c[_0x91cb('0x2d')]=_['keys'](_0x3a5022['query']);_0x11c67c['filters']=_[_0x91cb('0x33')](_0x11c67c[_0x91cb('0x35')],_0x11c67c['query']);_0x3e2c58['attributes']=_['intersection'](_0x11c67c[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x3a5022['query'][_0x91cb('0x36')]));_0x3e2c58[_0x91cb('0x34')]=_0x3e2c58['attributes']['length']?_0x3e2c58[_0x91cb('0x34')]:_0x11c67c[_0x91cb('0x35')];_0x3e2c58[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x3a5022[_0x91cb('0x2d')]['sort']);_0x3e2c58[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x3a5022[_0x91cb('0x2d')],_0x11c67c[_0x91cb('0x32')]));if(_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x3e2c58[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x3e2c58[_0x91cb('0x2a')],{'$or':_[_0x91cb('0x1c')](_0x3e2c58[_0x91cb('0x34')],function(_0x1ea132){var _0x3b1d97={};_0x3b1d97[_0x1ea132]={'$like':'%'+_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x3b1d97;})});}_0x3e2c58=_[_0x91cb('0x39')]({},_0x3e2c58,_0x3a5022[_0x91cb('0x59')]);return _0xf4b4ab[_0x91cb('0x8a')](_0x3e2c58);}})[_0x91cb('0x16')](function(_0x5cf6df){if(_0x5cf6df){_0x2fa5e3=_0x5cf6df['length'];if(!_0x3a5022['query'][_0x91cb('0x56')]('nolimit')){_0x3e2c58[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x12')]);_0x3e2c58[_0x91cb('0x13')]=qs[_0x91cb('0x13')](_0x3a5022[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0xf4b4ab['getMembers'](_0x3e2c58);}})['then'](function(_0x5f2de0){return _0x5f2de0?{'count':_0x2fa5e3,'rows':_0x5f2de0}:null;})[_0x91cb('0x16')](respondWithResult(_0x17141e,null))[_0x91cb('0x2f')](handleError(_0x17141e,null));};exports[_0x91cb('0x8b')]=function(_0x2b4e25,_0x4c044d){var _0x54c194={};var _0x3cfdcb={};var _0x1624b3;var _0x1e2acd;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2b4e25['params']['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x4c044d,null))['then'](function(_0x1e979e){if(_0x1e979e){_0x1624b3=_0x1e979e;_0x3cfdcb[_0x91cb('0x35')]=_['keys'](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x3cfdcb[_0x91cb('0x2d')]=_[_0x91cb('0x31')](_0x2b4e25[_0x91cb('0x2d')]);_0x3cfdcb['filters']=_[_0x91cb('0x33')](_0x3cfdcb[_0x91cb('0x35')],_0x3cfdcb[_0x91cb('0x2d')]);_0x54c194[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x3cfdcb['model'],qs[_0x91cb('0x36')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x54c194['attributes']=_0x54c194['attributes'][_0x91cb('0x37')]?_0x54c194['attributes']:_0x3cfdcb[_0x91cb('0x35')];_0x54c194[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2b4e25[_0x91cb('0x2d')]['sort']);_0x54c194[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_['pick'](_0x2b4e25[_0x91cb('0x2d')],_0x3cfdcb[_0x91cb('0x32')]));if(_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x54c194[_0x91cb('0x2a')]=_[_0x91cb('0x39')](_0x54c194['where'],{'$or':_[_0x91cb('0x1c')](_0x54c194['attributes'],function(_0x283743){var _0x44ffde={};_0x44ffde[_0x283743]={'$like':'%'+_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x1a')]+'%'};return _0x44ffde;})});}_0x54c194=_['merge']({},_0x54c194,_0x2b4e25[_0x91cb('0x59')]);return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})[_0x91cb('0x16')](function(_0x5e629){if(_0x5e629){_0x1e2acd=_0x5e629[_0x91cb('0x37')];if(!_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x54c194[_0x91cb('0x12')]=qs[_0x91cb('0x12')](_0x2b4e25['query'][_0x91cb('0x12')]);_0x54c194['offset']=qs[_0x91cb('0x13')](_0x2b4e25[_0x91cb('0x2d')][_0x91cb('0x13')]);}return _0x1624b3[_0x91cb('0x8b')](_0x54c194);}})['then'](function(_0x87f382){if(_0x87f382){return _0x87f382?{'count':_0x1e2acd,'rows':_0x87f382}:null;}})[_0x91cb('0x16')](respondWithResult(_0x4c044d,null))[_0x91cb('0x2f')](handleError(_0x4c044d,null));};exports['addLists']=function(_0x330123,_0x23bc13){var _0x175d85=moment()[_0x91cb('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x97ba8,_0x4bc382;return db[_0x91cb('0x25')]['find']({'where':{'id':_0x330123[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x23bc13,null))[_0x91cb('0x16')](function(_0x399012){if(_0x399012){_0x4bc382=_0x399012;return _0x399012[_0x91cb('0x8d')](_0x330123['body']['ids'],_[_0x91cb('0x47')](_0x330123[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x571a6f){var _0x19596b;_0x97ba8=_0x571a6f||[];var _0x5b4849=[];if(_0x571a6f){for(var _0x39a183=0x0;_0x39a183<_0x571a6f[_0x91cb('0x37')];_0x39a183+=0x1){var _0x693690=_0x571a6f[_0x39a183][_0x91cb('0x3e')]({'plain':!![]});_0x4bc382[_0x91cb('0x8e')]=_0x330123[_0x91cb('0x3c')][_0x91cb('0x8e')]?_0x330123[_0x91cb('0x3c')]['dialCheckDuplicateType']:_0x4bc382['dialCheckDuplicateType'];switch(_0x4bc382['dialCheckDuplicateType']){case'always':_0x19596b=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')](['phone','scheduledAt',_0x91cb('0x93'),'ListId',_0x91cb('0x51'),_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27','scheduledAt')[_0x91cb('0x75')]('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690[_0x91cb('0x95')]['toString'](),'ListId')['field'](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x9d'))[_0x91cb('0x97')](_0x91cb('0x9e'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id']['toString']()))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa0'))['from'](_0x91cb('0x91'))[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))['toString']();break;case _0x91cb('0xa1'):_0x19596b=squel[_0x91cb('0x8f')]()['into'](_0x91cb('0x91'))['fromQuery']([_0x91cb('0x94'),'scheduledAt',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0x94'),_0x91cb('0x94'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))[_0x91cb('0x75')]('id',_0x91cb('0x93'))['field'](_0x693690[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))['field']('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))[_0x91cb('0x2a')](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())[_0x91cb('0x2a')](_0x91cb('0x9b'))[_0x91cb('0x2a')](_0x91cb('0x9c'),squel[_0x91cb('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0x91cb('0x97')]('cm_hopper')[_0x91cb('0x2a')](_0x91cb('0x9f'),_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')]())))[_0x91cb('0x96')]();break;default:_0x19596b=squel['insert']()[_0x91cb('0x90')](_0x91cb('0x91'))[_0x91cb('0x92')]([_0x91cb('0x94'),_0x91cb('0xa3'),_0x91cb('0x93'),_0x91cb('0xa2'),'VoiceQueueId',_0x91cb('0x45'),_0x91cb('0x46')],squel[_0x91cb('0x74')]()['field'](_0x91cb('0x94'),'phone')['field']('\x27'+_0x175d85+'\x27',_0x91cb('0xa3'))['field']('id',_0x91cb('0x93'))[_0x91cb('0x75')](_0x693690['CmListId'][_0x91cb('0x96')](),_0x91cb('0xa2'))[_0x91cb('0x75')](_0x330123[_0x91cb('0x30')]['id'][_0x91cb('0x96')](),_0x91cb('0x51'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))[_0x91cb('0x97')](_0x91cb('0x98'))['where'](_0x91cb('0x99'))[_0x91cb('0x2a')](_0x91cb('0x9a'),_0x693690[_0x91cb('0x95')][_0x91cb('0x96')]())['where'](_0x91cb('0x9b')))[_0x91cb('0x96')]();}_0x5b4849['push'](db[_0x91cb('0x66')]['query'](_0x19596b));}return BPromise[_0x91cb('0x7f')](_0x5b4849);}})['then'](function(){var _0x739447=[];var _0x2deed1=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xa4'))['fromQuery']([_0x91cb('0xa5'),_0x91cb('0x94'),'OrderBy','createdAt',_0x91cb('0x46')],squel[_0x91cb('0x74')]()[_0x91cb('0x75')](_0x91cb('0xa6'))['field'](_0x91cb('0xa7'))[_0x91cb('0x75')](_0x91cb('0xa8'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x45'))[_0x91cb('0x75')]('\x27'+_0x175d85+'\x27',_0x91cb('0x46'))['from'](_0x91cb('0xa9'),'ci')[_0x91cb('0x78')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x91cb('0x2a')](_0x91cb('0xaa'),_0x175d85)[_0x91cb('0x2a')](_0x91cb('0xab'),_0x91cb('0xac')))[_0x91cb('0x96')]();_0x739447[_0x91cb('0x86')](db[_0x91cb('0x66')]['query'](_0x2deed1));return BPromise[_0x91cb('0x7f')](_0x739447);})[_0x91cb('0x16')](function(){return _0x97ba8;})[_0x91cb('0x16')](respondWithResult(_0x23bc13,null))[_0x91cb('0x2f')](handleError(_0x23bc13,null));};exports[_0x91cb('0xad')]=function(_0x554923,_0x2fe556){return db[_0x91cb('0x25')]['find']({'where':{'id':_0x554923[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x2fe556,null))[_0x91cb('0x16')](function(_0x43958a){if(_0x43958a){return _0x43958a[_0x91cb('0xad')](_0x554923['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0x409a36){if(_0x409a36){return db[_0x91cb('0x4c')][_0x91cb('0x17')]({'where':{'ListId':_0x554923[_0x91cb('0x2d')][_0x91cb('0x72')],'VoiceQueueId':_0x554923[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](function(){return _0x409a36;});}})[_0x91cb('0x16')](respondWithStatusCode(_0x2fe556,null))['catch'](handleError(_0x2fe556,null));};exports[_0x91cb('0xae')]=function(_0x2d870d,_0x173761){var _0x2cf0d8={};var _0x9d63ff={};var _0x720de;var _0x80f0ba;return db[_0x91cb('0x25')][_0x91cb('0x54')]({'where':{'id':_0x2d870d[_0x91cb('0x30')]['id']}})['then'](handleEntityNotFound(_0x173761,null))[_0x91cb('0x16')](function(_0x800860){if(_0x800860){_0x720de=_0x800860;_0x9d63ff[_0x91cb('0x35')]=_[_0x91cb('0x31')](db[_0x91cb('0x8c')][_0x91cb('0x26')]);_0x9d63ff['query']=_['keys'](_0x2d870d[_0x91cb('0x2d')]);_0x9d63ff[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x9d63ff['model'],_0x9d63ff[_0x91cb('0x2d')]);_0x2cf0d8[_0x91cb('0x34')]=_[_0x91cb('0x33')](_0x9d63ff[_0x91cb('0x35')],qs[_0x91cb('0x36')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x36')]));_0x2cf0d8[_0x91cb('0x34')]=_0x2cf0d8[_0x91cb('0x34')][_0x91cb('0x37')]?_0x2cf0d8[_0x91cb('0x34')]:_0x9d63ff[_0x91cb('0x35')];_0x2cf0d8[_0x91cb('0x4e')]=qs[_0x91cb('0x4f')](_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x4f')]);_0x2cf0d8[_0x91cb('0x2a')]=qs[_0x91cb('0x32')](_[_0x91cb('0x50')](_0x2d870d['query'],_0x9d63ff[_0x91cb('0x32')]));if(_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x1a')]){_0x2cf0d8['where']=_['merge'](_0x2cf0d8['where'],{'$or':_[_0x91cb('0x1c')](_0x2cf0d8[_0x91cb('0x34')],function(_0x4370f6){var _0x5bc712={};_0x5bc712[_0x4370f6]={'$like':'%'+_0x2d870d['query'][_0x91cb('0x1a')]+'%'};return _0x5bc712;})});}_0x2cf0d8=_[_0x91cb('0x39')]({},_0x2cf0d8,_0x2d870d[_0x91cb('0x59')]);return _0x720de[_0x91cb('0xae')](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x182f2c){if(_0x182f2c){_0x80f0ba=_0x182f2c[_0x91cb('0x37')];if(!_0x2d870d[_0x91cb('0x2d')][_0x91cb('0x56')](_0x91cb('0x4d'))){_0x2cf0d8['limit']=qs['limit'](_0x2d870d[_0x91cb('0x2d')]['limit']);_0x2cf0d8[_0x91cb('0x13')]=qs['offset'](_0x2d870d['query'][_0x91cb('0x13')]);}return _0x720de['getBlackLists'](_0x2cf0d8);}})[_0x91cb('0x16')](function(_0x2ac9df){if(_0x2ac9df){return _0x2ac9df?{'count':_0x80f0ba,'rows':_0x2ac9df}:null;}})['then'](respondWithResult(_0x173761,null))[_0x91cb('0x2f')](handleError(_0x173761,null));};exports[_0x91cb('0xaf')]=function(_0x331381,_0x52ce8c){var _0x534968;return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x331381['params']['id']}})['then'](handleEntityNotFound(_0x52ce8c,null))['then'](function(_0x397397){if(_0x397397){return _0x397397[_0x91cb('0xaf')](_0x331381[_0x91cb('0x3c')][_0x91cb('0x72')],_['omit'](_0x331381[_0x91cb('0x3c')],[_0x91cb('0x72'),'id'])||{});}return null;})[_0x91cb('0x84')](function(_0x2a0c3c){var _0x30ef98;_0x534968=_0x2a0c3c||[];var _0x27d0ab=[];if(_0x2a0c3c){for(var _0x547db7=0x0;_0x547db7<_0x2a0c3c['length'];_0x547db7+=0x1){var _0x38d608=_0x2a0c3c[_0x547db7][_0x91cb('0x3e')]({'plain':!![]});_0x30ef98=squel[_0x91cb('0x8f')]()[_0x91cb('0x90')](_0x91cb('0xb0'))[_0x91cb('0x92')](['phone',_0x91cb('0x93'),_0x91cb('0xa2'),_0x91cb('0x51'),'createdAt',_0x91cb('0x46')],squel['select']()[_0x91cb('0x75')](_0x91cb('0x94'),'phone')[_0x91cb('0x75')]('id','ContactId')[_0x91cb('0x75')](_0x38d608[_0x91cb('0x95')][_0x91cb('0x96')](),_0x91cb('0xa2'))['field'](_0x331381[_0x91cb('0x30')]['id']['toString'](),_0x91cb('0x51'))['field']('NOW()',_0x91cb('0x45'))[_0x91cb('0x75')](_0x91cb('0xb1'),_0x91cb('0x46'))[_0x91cb('0x97')]('cm_contacts')['where'](_0x91cb('0x99'))['where'](_0x91cb('0x9a'),_0x38d608['CmListId'][_0x91cb('0x96')]())[_0x91cb('0x2a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x27d0ab[_0x91cb('0x86')](db['sequelize'][_0x91cb('0x2d')](_0x30ef98));}return BPromise['all'](_0x27d0ab);}})['then'](function(){return _0x534968;})[_0x91cb('0x16')](respondWithResult(_0x52ce8c,null))[_0x91cb('0x2f')](handleError(_0x52ce8c,null));};exports[_0x91cb('0xb2')]=function(_0x4ef95b,_0x2f0269){return db[_0x91cb('0x25')][_0x91cb('0x3a')]({'where':{'id':_0x4ef95b[_0x91cb('0x30')]['id']}})[_0x91cb('0x16')](handleEntityNotFound(_0x2f0269,null))['then'](function(_0x5e1b97){if(_0x5e1b97){return _0x5e1b97[_0x91cb('0xb2')](_0x4ef95b['query'][_0x91cb('0x72')]);}})[_0x91cb('0x16')](function(_0xcb3114){if(_0xcb3114){return db[_0x91cb('0x5b')][_0x91cb('0x17')]({'where':{'ListId':_0x4ef95b['query'][_0x91cb('0x72')],'VoiceQueueId':_0x4ef95b['params']['id']}})[_0x91cb('0x16')](function(){return _0xcb3114;});}})['then'](respondWithStatusCode(_0x2f0269,null))[_0x91cb('0x2f')](handleError(_0x2f0269,null));}; \ No newline at end of file +var _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x6aa7,0x178));var _0x76aa=function(_0x55579c,_0x1bc809){_0x55579c=_0x55579c-0x0;var _0x3b421a=_0x6aa7[_0x55579c];return _0x3b421a;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0df5e4c..5609984 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 _0x7dae=['hook','exports','../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7dae,0x159));var _0xe7da=function(_0x3646b5,_0x2b7475){_0x3646b5=_0x3646b5-0x0;var _0xcc7b94=_0x7dae[_0x3646b5];return _0xcc7b94;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xe7da('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7da('0x1'),'afterUpdate':_0xe7da('0x2'),'afterDestroy':'remove'};function emitEvent(_0x392550){return function(_0x21c209,_0x595ea1,_0x5e4772){VoiceQueueEvents[_0xe7da('0x3')](_0x392550+':'+_0x21c209['id'],_0x21c209);VoiceQueueEvents[_0xe7da('0x3')](_0x392550,_0x21c209);_0x5e4772(null);};}for(var e in events){if(events[_0xe7da('0x4')](e)){var event=events[e];VoiceQueue[_0xe7da('0x5')](e,emitEvent(event));}}module[_0xe7da('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xf431=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x1eb21a,_0x40a3a7){var _0x58f8f8=function(_0x3c0e9a){while(--_0x3c0e9a){_0x1eb21a['push'](_0x1eb21a['shift']());}};_0x58f8f8(++_0x40a3a7);}(_0xf431,0x1b2));var _0x1f43=function(_0x18e875,_0x54fff7){_0x18e875=_0x18e875-0x0;var _0x1643c6=_0xf431[_0x18e875];return _0x1643c6;};'use strict';var EventEmitter=require(_0x1f43('0x0'));var VoiceQueue=require(_0x1f43('0x1'))['db'][_0x1f43('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1f43('0x3')](0x0);var events={'afterCreate':_0x1f43('0x4'),'afterUpdate':'update','afterDestroy':_0x1f43('0x5')};function emitEvent(_0x84f11d){return function(_0x13ce10,_0x37ebb7,_0x376339){VoiceQueueEvents['emit'](_0x84f11d+':'+_0x13ce10['id'],_0x13ce10);VoiceQueueEvents[_0x1f43('0x6')](_0x84f11d,_0x13ce10);_0x376339(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1f43('0x7')](e,emitEvent(event));}}module[_0x1f43('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index aa10d10..5f39e7b 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x19cce8,_0x23a814){var _0x575f93=function(_0x515f8b){while(--_0x515f8b){_0x19cce8['push'](_0x19cce8['shift']());}};_0x575f93(++_0x23a814);}(_0x3e74,0x175));var _0x43e7=function(_0x60aeb2,_0x424784){_0x60aeb2=_0x60aeb2-0x0;var _0x5537f4=_0x3e74[_0x60aeb2];return _0x5537f4;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x132844,_0x98bc49){var _0x13c26f=function(_0xf5c16f){while(--_0xf5c16f){_0x132844['push'](_0x132844['shift']());}};_0x13c26f(++_0x98bc49);}(_0x70e0,0x17b));var _0x070e=function(_0xfb36ba,_0x81ca8b){_0xfb36ba=_0xfb36ba-0x0;var _0x187737=_0x70e0[_0xfb36ba];return _0x187737;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 43a3fe8..71037b0 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 _0x23fc=['ShowVoiceQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x2fb526,_0xace76b){var _0x7a7a50=function(_0x344538){while(--_0x344538){_0x2fb526['push'](_0x2fb526['shift']());}};_0x7a7a50(++_0xace76b);}(_0x23fc,0x1ca));var _0xc23f=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x23fc[_0xf34b0a];return _0x5021e1;};'use strict';var _=require('lodash');var util=require(_0xc23f('0x0'));var moment=require('moment');var BPromise=require(_0xc23f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc23f('0x2'));var db=require(_0xc23f('0x3'))['db'];var utils=require(_0xc23f('0x4'));var logger=require(_0xc23f('0x5'))('rpc');var config=require(_0xc23f('0x6'));var jayson=require(_0xc23f('0x7'));var client=jayson[_0xc23f('0x8')]['http']({'port':0x232a});config[_0xc23f('0x9')]=_['defaults'](config[_0xc23f('0x9')],{'host':_0xc23f('0xa'),'port':0x18eb});var socket=require(_0xc23f('0xb'))(new Redis(config[_0xc23f('0x9')]));require(_0xc23f('0xc'))['register'](socket);function respondWithRpcPromise(_0x634e95,_0x294e24,_0x1b8fc1){return new BPromise(function(_0x49057f,_0x1915be){return client[_0xc23f('0xd')](_0x634e95,_0x1b8fc1)['then'](function(_0x3e42dc){logger[_0xc23f('0xe')](_0xc23f('0xf'),_0x294e24,_0xc23f('0x10'));logger[_0xc23f('0x11')](_0xc23f('0x12'),_0x294e24,_0xc23f('0x10'),JSON[_0xc23f('0x13')](_0x3e42dc));if(_0x3e42dc[_0xc23f('0x14')]){if(_0x3e42dc[_0xc23f('0x14')][_0xc23f('0x15')]===0x1f4){logger['error'](_0xc23f('0xf'),_0x294e24,_0x3e42dc[_0xc23f('0x14')]['message']);return _0x1915be(_0x3e42dc['error'][_0xc23f('0x16')]);}logger['error'](_0xc23f('0xf'),_0x294e24,_0x3e42dc[_0xc23f('0x14')][_0xc23f('0x16')]);return _0x49057f(_0x3e42dc[_0xc23f('0x14')][_0xc23f('0x16')]);}else{logger['info'](_0xc23f('0xf'),_0x294e24,'request\x20sent');_0x49057f(_0x3e42dc['result']['message']);}})[_0xc23f('0x17')](function(_0x1332c9){logger['error'](_0xc23f('0xf'),_0x294e24,_0x1332c9);_0x1915be(_0x1332c9);});});}exports[_0xc23f('0x18')]=function(_0x26d9e4){var _0x1a8944=this;return new Promise(function(_0x6ae00f,_0x4af840){return db[_0xc23f('0x19')][_0xc23f('0x1a')]({'raw':_0x26d9e4['options']?_0x26d9e4[_0xc23f('0x1b')][_0xc23f('0x1c')]===undefined?!![]:![]:!![],'where':_0x26d9e4[_0xc23f('0x1b')]?_0x26d9e4['options'][_0xc23f('0x1d')]||null:null,'attributes':_0x26d9e4[_0xc23f('0x1b')]?_0x26d9e4[_0xc23f('0x1b')][_0xc23f('0x1e')]||null:null,'limit':_0x26d9e4[_0xc23f('0x1b')]?_0x26d9e4['options'][_0xc23f('0x1f')]||null:null,'include':_0x26d9e4[_0xc23f('0x1b')]?_0x26d9e4[_0xc23f('0x1b')][_0xc23f('0x20')]?_['map'](_0x26d9e4[_0xc23f('0x1b')][_0xc23f('0x20')],function(_0x91c49b){return{'model':db[_0x91c49b['model']],'as':_0x91c49b['as'],'attributes':_0x91c49b['attributes'],'include':_0x91c49b[_0xc23f('0x20')]?_[_0xc23f('0x21')](_0x91c49b['include'],function(_0x4faac0){return{'model':db[_0x4faac0[_0xc23f('0x22')]],'as':_0x4faac0['as'],'attributes':_0x4faac0[_0xc23f('0x1e')],'include':_0x4faac0[_0xc23f('0x20')]?_[_0xc23f('0x21')](_0x4faac0[_0xc23f('0x20')],function(_0x8dbf7d){return{'model':db[_0x8dbf7d['model']],'as':_0x8dbf7d['as'],'attributes':_0x8dbf7d['attributes']};}):[]};}):[]};}):[]:[]})[_0xc23f('0x23')](function(_0x1bd37e){logger[_0xc23f('0xe')](_0xc23f('0x18'),_0x26d9e4);logger[_0xc23f('0x11')]('GetVoiceQueue',_0x26d9e4,JSON[_0xc23f('0x13')](_0x1bd37e));_0x6ae00f(_0x1bd37e);})[_0xc23f('0x17')](function(_0x4da417){logger[_0xc23f('0x14')](_0xc23f('0x18'),_0x4da417[_0xc23f('0x16')],_0x26d9e4);_0x4af840(_0x1a8944[_0xc23f('0x14')](0x1f4,_0x4da417[_0xc23f('0x16')]));});});};exports[_0xc23f('0x24')]=function(_0x3900b4){var _0x59a116=this;return new Promise(function(_0x5b6d8d,_0x27e533){return db[_0xc23f('0x19')][_0xc23f('0x25')]({'raw':_0x3900b4[_0xc23f('0x1b')]?_0x3900b4[_0xc23f('0x1b')][_0xc23f('0x1c')]===undefined?!![]:![]:!![],'where':_0x3900b4[_0xc23f('0x1b')]?_0x3900b4['options'][_0xc23f('0x1d')]||null:null,'attributes':_0x3900b4[_0xc23f('0x1b')]?_0x3900b4['options'][_0xc23f('0x1e')]||null:null,'include':_0x3900b4[_0xc23f('0x1b')]?_0x3900b4[_0xc23f('0x1b')]['include']?_[_0xc23f('0x21')](_0x3900b4['options'][_0xc23f('0x20')],function(_0x3d4663){return{'model':db[_0x3d4663[_0xc23f('0x22')]],'as':_0x3d4663['as'],'attributes':_0x3d4663[_0xc23f('0x1e')],'include':_0x3d4663[_0xc23f('0x20')]?_[_0xc23f('0x21')](_0x3d4663[_0xc23f('0x20')],function(_0x216114){return{'model':db[_0x216114['model']],'as':_0x216114['as'],'attributes':_0x216114['attributes'],'include':_0x216114['include']?_['map'](_0x216114['include'],function(_0x3c95b4){return{'model':db[_0x3c95b4[_0xc23f('0x22')]],'as':_0x3c95b4['as'],'attributes':_0x3c95b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc23f('0x23')](function(_0x37182e){logger[_0xc23f('0xe')](_0xc23f('0x24'),_0x3900b4);logger[_0xc23f('0x11')](_0xc23f('0x24'),_0x3900b4,JSON[_0xc23f('0x13')](_0x37182e));_0x5b6d8d(_0x37182e);})['catch'](function(_0x4217c8){logger['error'](_0xc23f('0x24'),_0x4217c8[_0xc23f('0x16')],_0x3900b4);_0x27e533(_0x59a116[_0xc23f('0x14')](0x1f4,_0x4217c8[_0xc23f('0x16')]));});});}; \ No newline at end of file +var _0xbe6a=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVoiceQueue','findAll','options','raw','where','limit','include','attributes','map','model','VoiceQueue','find','ShowVoiceQueue'];(function(_0x52e06f,_0xef68a0){var _0x416550=function(_0x4f654c){while(--_0x4f654c){_0x52e06f['push'](_0x52e06f['shift']());}};_0x416550(++_0xef68a0);}(_0xbe6a,0x78));var _0xabe6=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0xbe6a[_0x20845e];return _0x28cf2b;};'use strict';var _=require('lodash');var util=require(_0xabe6('0x0'));var moment=require(_0xabe6('0x1'));var BPromise=require('bluebird');var rs=require(_0xabe6('0x2'));var fs=require('fs');var Redis=require(_0xabe6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xabe6('0x4'));var logger=require(_0xabe6('0x5'))(_0xabe6('0x6'));var config=require(_0xabe6('0x7'));var jayson=require(_0xabe6('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xabe6('0x9')]=_[_0xabe6('0xa')](config['redis'],{'host':_0xabe6('0xb'),'port':0x18eb});var socket=require(_0xabe6('0xc'))(new Redis(config[_0xabe6('0x9')]));require(_0xabe6('0xd'))[_0xabe6('0xe')](socket);function respondWithRpcPromise(_0x1b6bc5,_0xa6065c,_0x572ad2){return new BPromise(function(_0x16a9ff,_0x28eaed){return client[_0xabe6('0xf')](_0x1b6bc5,_0x572ad2)[_0xabe6('0x10')](function(_0x53224a){logger[_0xabe6('0x11')](_0xabe6('0x12'),_0xa6065c,'request\x20sent');logger[_0xabe6('0x13')](_0xabe6('0x14'),_0xa6065c,'request\x20sent',JSON[_0xabe6('0x15')](_0x53224a));if(_0x53224a['error']){if(_0x53224a['error']['code']===0x1f4){logger[_0xabe6('0x16')](_0xabe6('0x12'),_0xa6065c,_0x53224a['error']['message']);return _0x28eaed(_0x53224a['error'][_0xabe6('0x17')]);}logger[_0xabe6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0xa6065c,_0x53224a[_0xabe6('0x16')][_0xabe6('0x17')]);return _0x16a9ff(_0x53224a[_0xabe6('0x16')][_0xabe6('0x17')]);}else{logger[_0xabe6('0x11')](_0xabe6('0x12'),_0xa6065c,_0xabe6('0x18'));_0x16a9ff(_0x53224a[_0xabe6('0x19')][_0xabe6('0x17')]);}})[_0xabe6('0x1a')](function(_0x5bb47c){logger[_0xabe6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0xa6065c,_0x5bb47c);_0x28eaed(_0x5bb47c);});});}exports[_0xabe6('0x1b')]=function(_0x42f0b7){var _0x35e560=this;return new Promise(function(_0x92a95e,_0x3c61b2){return db['VoiceQueue'][_0xabe6('0x1c')]({'raw':_0x42f0b7['options']?_0x42f0b7[_0xabe6('0x1d')][_0xabe6('0x1e')]===undefined?!![]:![]:!![],'where':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7[_0xabe6('0x1d')][_0xabe6('0x1f')]||null:null,'attributes':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7[_0xabe6('0x1d')]['attributes']||null:null,'limit':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7['options'][_0xabe6('0x20')]||null:null,'include':_0x42f0b7[_0xabe6('0x1d')]?_0x42f0b7[_0xabe6('0x1d')]['include']?_['map'](_0x42f0b7[_0xabe6('0x1d')][_0xabe6('0x21')],function(_0x38f901){return{'model':db[_0x38f901['model']],'as':_0x38f901['as'],'attributes':_0x38f901[_0xabe6('0x22')],'include':_0x38f901[_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x38f901[_0xabe6('0x21')],function(_0x5b56ba){return{'model':db[_0x5b56ba[_0xabe6('0x24')]],'as':_0x5b56ba['as'],'attributes':_0x5b56ba['attributes'],'include':_0x5b56ba[_0xabe6('0x21')]?_['map'](_0x5b56ba['include'],function(_0x24f7d1){return{'model':db[_0x24f7d1[_0xabe6('0x24')]],'as':_0x24f7d1['as'],'attributes':_0x24f7d1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x727491){logger[_0xabe6('0x11')](_0xabe6('0x1b'),_0x42f0b7);logger[_0xabe6('0x13')](_0xabe6('0x1b'),_0x42f0b7,JSON[_0xabe6('0x15')](_0x727491));_0x92a95e(_0x727491);})[_0xabe6('0x1a')](function(_0x14ac0b){logger[_0xabe6('0x16')](_0xabe6('0x1b'),_0x14ac0b[_0xabe6('0x17')],_0x42f0b7);_0x3c61b2(_0x35e560[_0xabe6('0x16')](0x1f4,_0x14ac0b[_0xabe6('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x923b7b){var _0x22e8e5=this;return new Promise(function(_0x1e0d81,_0xf4f283){return db[_0xabe6('0x25')][_0xabe6('0x26')]({'raw':_0x923b7b['options']?_0x923b7b[_0xabe6('0x1d')][_0xabe6('0x1e')]===undefined?!![]:![]:!![],'where':_0x923b7b[_0xabe6('0x1d')]?_0x923b7b['options'][_0xabe6('0x1f')]||null:null,'attributes':_0x923b7b[_0xabe6('0x1d')]?_0x923b7b['options'][_0xabe6('0x22')]||null:null,'include':_0x923b7b[_0xabe6('0x1d')]?_0x923b7b[_0xabe6('0x1d')][_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x923b7b[_0xabe6('0x1d')]['include'],function(_0x6a49ee){return{'model':db[_0x6a49ee[_0xabe6('0x24')]],'as':_0x6a49ee['as'],'attributes':_0x6a49ee[_0xabe6('0x22')],'include':_0x6a49ee[_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x6a49ee['include'],function(_0x39e20b){return{'model':db[_0x39e20b[_0xabe6('0x24')]],'as':_0x39e20b['as'],'attributes':_0x39e20b['attributes'],'include':_0x39e20b[_0xabe6('0x21')]?_[_0xabe6('0x23')](_0x39e20b[_0xabe6('0x21')],function(_0x591810){return{'model':db[_0x591810[_0xabe6('0x24')]],'as':_0x591810['as'],'attributes':_0x591810[_0xabe6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xabe6('0x10')](function(_0x3b654b){logger['info'](_0xabe6('0x27'),_0x923b7b);logger['debug']('ShowVoiceQueue',_0x923b7b,JSON[_0xabe6('0x15')](_0x3b654b));_0x1e0d81(_0x3b654b);})[_0xabe6('0x1a')](function(_0x48a9ba){logger[_0xabe6('0x16')]('ShowVoiceQueue',_0x48a9ba[_0xabe6('0x17')],_0x923b7b);_0xf4f283(_0x22e8e5[_0xabe6('0x16')](0x1f4,_0x48a9ba['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 65763a0..6cd2976 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 _0x28f6=['update','register','length','voiceQueue:'];(function(_0x26e0eb,_0x5b1184){var _0x36c6ae=function(_0x77e638){while(--_0x77e638){_0x26e0eb['push'](_0x26e0eb['shift']());}};_0x36c6ae(++_0x5b1184);}(_0x28f6,0x184));var _0x628f=function(_0x5517a8,_0x1f2ba4){_0x5517a8=_0x5517a8-0x0;var _0x1409b4=_0x28f6[_0x5517a8];return _0x1409b4;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save','remove',_0x628f('0x0')];function createListener(_0x57f940,_0x3440ad){return function(_0x11340a){_0x3440ad['emit'](_0x57f940,_0x11340a);};}function removeListener(_0x332a36,_0x5785a6){return function(){VoiceQueueEvents['removeListener'](_0x332a36,_0x5785a6);};}exports[_0x628f('0x1')]=function(_0x29a53a){for(var _0x3c23a4=0x0,_0x51baef=events[_0x628f('0x2')];_0x3c23a4<_0x51baef;_0x3c23a4++){var _0x5b08c6=events[_0x3c23a4];var _0xb6d141=createListener(_0x628f('0x3')+_0x5b08c6,_0x29a53a);VoiceQueueEvents['on'](_0x5b08c6,_0xb6d141);}}; \ No newline at end of file +var _0x3a96=['remove','emit','removeListener','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x3e94f0,_0x382afe){var _0x5ddbb2=function(_0x45f8a4){while(--_0x45f8a4){_0x3e94f0['push'](_0x3e94f0['shift']());}};_0x5ddbb2(++_0x382afe);}(_0x3a96,0x8a));var _0x63a9=function(_0x360c42,_0x427772){_0x360c42=_0x360c42-0x0;var _0x23b630=_0x3a96[_0x360c42];return _0x23b630;};'use strict';var VoiceQueueEvents=require(_0x63a9('0x0'));var events=[_0x63a9('0x1'),_0x63a9('0x2'),'update'];function createListener(_0x137d16,_0x37eddf){return function(_0x37b8a9){_0x37eddf[_0x63a9('0x3')](_0x137d16,_0x37b8a9);};}function removeListener(_0x2390e4,_0x21f2c8){return function(){VoiceQueueEvents[_0x63a9('0x4')](_0x2390e4,_0x21f2c8);};}exports['register']=function(_0x11e857){for(var _0x463b95=0x0,_0x304419=events[_0x63a9('0x5')];_0x463b95<_0x304419;_0x463b95++){var _0x3e2cc3=events[_0x463b95];var _0x56b0ab=createListener(_0x63a9('0x6')+_0x3e2cc3,_0x11e857);VoiceQueueEvents['on'](_0x3e2cc3,_0x56b0ab);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b04b155..c40a66b 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 _0x7e18=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','index','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete'];(function(_0xd5cbd1,_0x47c599){var _0x4213c3=function(_0x6331c7){while(--_0x6331c7){_0xd5cbd1['push'](_0xd5cbd1['shift']());}};_0x4213c3(++_0x47c599);}(_0x7e18,0x116));var _0x87e1=function(_0x37fa9d,_0x4260d4){_0x37fa9d=_0x37fa9d-0x0;var _0x30636f=_0x7e18[_0x37fa9d];return _0x30636f;};'use strict';var multer=require(_0x87e1('0x0'));var util=require(_0x87e1('0x1'));var path=require(_0x87e1('0x2'));var timeout=require(_0x87e1('0x3'));var express=require(_0x87e1('0x4'));var router=express[_0x87e1('0x5')]();var fs_extra=require(_0x87e1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x87e1('0x7')]('/',auth['isAuthenticated'](),controller[_0x87e1('0x8')]);router[_0x87e1('0x7')](_0x87e1('0x9'),auth[_0x87e1('0xa')](),controller[_0x87e1('0xb')]);router['get'](_0x87e1('0xc'),auth[_0x87e1('0xa')](),controller[_0x87e1('0xd')]);router[_0x87e1('0x7')](_0x87e1('0xe'),auth[_0x87e1('0xa')](),controller[_0x87e1('0xf')]);router[_0x87e1('0x10')]('/',auth[_0x87e1('0xa')](),controller[_0x87e1('0x11')]);router[_0x87e1('0x12')](_0x87e1('0xe'),auth[_0x87e1('0xa')](),controller[_0x87e1('0x13')]);router[_0x87e1('0x14')](_0x87e1('0xe'),auth['isAuthenticated'](),controller[_0x87e1('0x15')]);module[_0x87e1('0x16')]=router; \ No newline at end of file +var _0x3081=['/describe','describe','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get'];(function(_0x4a6d29,_0x33bd68){var _0x168c5d=function(_0x31e923){while(--_0x31e923){_0x4a6d29['push'](_0x4a6d29['shift']());}};_0x168c5d(++_0x33bd68);}(_0x3081,0x131));var _0x1308=function(_0x36785f,_0x3e631d){_0x36785f=_0x36785f-0x0;var _0x226396=_0x3081[_0x36785f];return _0x226396;};'use strict';var multer=require(_0x1308('0x0'));var util=require(_0x1308('0x1'));var path=require(_0x1308('0x2'));var timeout=require('connect-timeout');var express=require(_0x1308('0x3'));var router=express[_0x1308('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1308('0x5'));var config=require(_0x1308('0x6'));var controller=require(_0x1308('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1308('0x8')]);router[_0x1308('0x9')](_0x1308('0xa'),auth['isAuthenticated'](),controller[_0x1308('0xb')]);router['get']('/index',auth[_0x1308('0xc')](),controller[_0x1308('0xd')]);router[_0x1308('0x9')](_0x1308('0xe'),auth[_0x1308('0xc')](),controller[_0x1308('0xf')]);router[_0x1308('0x10')]('/',auth[_0x1308('0xc')](),controller[_0x1308('0x11')]);router[_0x1308('0x12')](_0x1308('0xe'),auth[_0x1308('0xc')](),controller['update']);router['delete'](_0x1308('0xe'),auth[_0x1308('0xc')](),controller[_0x1308('0x13')]);module[_0x1308('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8163f66..7f0dc58 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 _0xbfbd=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xbfbd,0x191));var _0xdbfb=function(_0x3af5f0,_0x18d316){_0x3af5f0=_0x3af5f0-0x0;var _0x169817=_0xbfbd[_0x3af5f0];return _0x169817;};'use strict';var Sequelize=require(_0xdbfb('0x0'));var moment=require(_0xdbfb('0x1'));module[_0xdbfb('0x2')]={'type':{'type':Sequelize[_0xdbfb('0x3')]},'uniqueid':{'type':Sequelize[_0xdbfb('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdbfb('0x3')]},'queue':{'type':Sequelize[_0xdbfb('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xdbfb('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x4ac529){var _0x282d24=moment(_0x4ac529);var _0x57101c=moment(this[_0xdbfb('0x5')]('queuecallerjoinAt'))[_0xdbfb('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4899ea=_0x282d24[_0xdbfb('0x7')](_0x57101c,_0xdbfb('0x8'));this[_0xdbfb('0x9')](_0xdbfb('0xa'),_0x4ac529);this[_0xdbfb('0x9')](_0xdbfb('0xb'),_0x4899ea||null);}},'position':{'type':Sequelize[_0xdbfb('0xc')]},'count':{'type':Sequelize[_0xdbfb('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xdbfb('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xdbfb('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xdbfb('0x4')]},'queuecallerexit':{'type':Sequelize[_0xdbfb('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xdbfb('0xe')},'originalposition':{'type':Sequelize[_0xdbfb('0xc')]},'channel':{'type':Sequelize[_0xdbfb('0x3')]},'connectedlinenum':{'type':Sequelize[_0xdbfb('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xdbfb('0x3')]},'exten':{'type':Sequelize[_0xdbfb('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xdbfb('0xc')]},'mohtime':{'type':Sequelize[_0xdbfb('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdbfb('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xdbfb('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdbfb('0x3')],'comment':_0xdbfb('0xf')},'transferexten':{'type':Sequelize[_0xdbfb('0x3')]},'transferuniqueid':{'type':Sequelize[_0xdbfb('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdbfb('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xdbfb('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xdbfb('0x3')]}}; \ No newline at end of file +var _0xd20a=['queuecallerjoinAt','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','exports','STRING','DATE'];(function(_0xf7aa86,_0x171456){var _0x5eb1ed=function(_0x47175f){while(--_0x47175f){_0xf7aa86['push'](_0xf7aa86['shift']());}};_0x5eb1ed(++_0x171456);}(_0xd20a,0xe1));var _0xad20=function(_0x5304c5,_0x5787bb){_0x5304c5=_0x5304c5-0x0;var _0x3131fa=_0xd20a[_0x5304c5];return _0x3131fa;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xad20('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xad20('0x1')]},'calleridnum':{'type':Sequelize[_0xad20('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xad20('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xad20('0x2')],'set':function(_0x36184e){var _0x1b1d8d=moment(_0x36184e);var _0x4fbf3d=moment(this['getDataValue'](_0xad20('0x3')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x20298a=_0x1b1d8d[_0xad20('0x4')](_0x4fbf3d,_0xad20('0x5'));this[_0xad20('0x6')](_0xad20('0x7'),_0x36184e);this[_0xad20('0x6')](_0xad20('0x8'),_0x20298a||null);}},'position':{'type':Sequelize[_0xad20('0x9')]},'count':{'type':Sequelize[_0xad20('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallerexit':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xad20('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xad20('0xb')},'originalposition':{'type':Sequelize[_0xad20('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xad20('0x1')]},'context':{'type':Sequelize[_0xad20('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xad20('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xad20('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xad20('0x1')]},'transfer':{'type':Sequelize[_0xad20('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xad20('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xad20('0x1')]},'disposition':{'type':Sequelize[_0xad20('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xad20('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xad20('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0xad20('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index da1655b..3ac19aa 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 _0xba4f=['create','body','update','catch','describe','getVoiceQueuesReport','hasOwnProperty','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','json','apply','save','then','destroy','end','stack','name','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','find'];(function(_0x525290,_0x493c29){var _0x1231ca=function(_0x2aaded){while(--_0x2aaded){_0x525290['push'](_0x525290['shift']());}};_0x1231ca(++_0x493c29);}(_0xba4f,0xf2));var _0xfba4=function(_0x418893,_0x557eb2){_0x418893=_0x418893-0x0;var _0x3b8cf0=_0xba4f[_0x418893];return _0x3b8cf0;};'use strict';var emlformat=require(_0xfba4('0x0'));var rimraf=require(_0xfba4('0x1'));var zipdir=require(_0xfba4('0x2'));var jsonpatch=require(_0xfba4('0x3'));var rp=require(_0xfba4('0x4'));var moment=require(_0xfba4('0x5'));var BPromise=require(_0xfba4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfba4('0x7'));var sox=require(_0xfba4('0x8'));var csv=require(_0xfba4('0x9'));var ejs=require(_0xfba4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfba4('0xb'));var crypto=require(_0xfba4('0xc'));var jsforce=require(_0xfba4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfba4('0x9'));var querystring=require('querystring');var Papa=require(_0xfba4('0xe'));var Redis=require('ioredis');var authService=require(_0xfba4('0xf'));var qs=require(_0xfba4('0x10'));var as=require(_0xfba4('0x11'));var hardwareService=require(_0xfba4('0x12'));var logger=require(_0xfba4('0x13'))(_0xfba4('0x14'));var utils=require(_0xfba4('0x15'));var config=require(_0xfba4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfba4('0x17'))['db'];config[_0xfba4('0x18')]=_[_0xfba4('0x19')](config['redis'],{'host':_0xfba4('0x1a'),'port':0x18eb});var socket=require(_0xfba4('0x1b'))(new Redis(config[_0xfba4('0x18')]));require('./voiceQueueReport.socket')[_0xfba4('0x1c')](socket);function respondWithStatusCode(_0x2f77aa,_0x3b597a){_0x3b597a=_0x3b597a||0xcc;return function(_0x27d4b5){if(_0x27d4b5){return _0x2f77aa[_0xfba4('0x1d')](_0x3b597a);}return _0x2f77aa[_0xfba4('0x1e')](_0x3b597a)['end']();};}function respondWithResult(_0x5eb9ec,_0x2cc6d5){_0x2cc6d5=_0x2cc6d5||0xc8;return function(_0x4d1755){if(_0x4d1755){return _0x5eb9ec['status'](_0x2cc6d5)['json'](_0x4d1755);}};}function respondWithFilteredResult(_0x2d737a,_0x4fab32){return function(_0x10f2f3){if(_0x10f2f3){var _0x448091=typeof _0x4fab32[_0xfba4('0x1f')]===_0xfba4('0x20')&&typeof _0x4fab32[_0xfba4('0x21')]===_0xfba4('0x20');var _0x3b27d9=_0x10f2f3[_0xfba4('0x22')];var _0x104174=_0x448091?0x0:_0x4fab32[_0xfba4('0x1f')];var _0x6f9527=_0x448091?_0x10f2f3[_0xfba4('0x22')]:_0x4fab32[_0xfba4('0x1f')]+_0x4fab32['limit'];var _0x58d249;if(_0x6f9527>=_0x3b27d9){_0x6f9527=_0x3b27d9;_0x58d249=0xc8;}else{_0x58d249=0xce;}_0x2d737a[_0xfba4('0x1e')](_0x58d249);return _0x2d737a['set']('Content-Range',_0x104174+'-'+_0x6f9527+'/'+_0x3b27d9)[_0xfba4('0x23')](_0x10f2f3);}return null;};}function patchUpdates(_0x393ca3){return function(_0x442735){try{jsonpatch[_0xfba4('0x24')](_0x442735,_0x393ca3,!![]);}catch(_0x25bb9c){return BPromise['reject'](_0x25bb9c);}return _0x442735[_0xfba4('0x25')]();};}function saveUpdates(_0x2ac06e,_0x3968a3){return function(_0x189ca0){if(_0x189ca0){return _0x189ca0['update'](_0x2ac06e)[_0xfba4('0x26')](function(_0x4434fd){return _0x4434fd;});}return null;};}function removeEntity(_0x211e0a,_0x4e116d){return function(_0x3c43be){if(_0x3c43be){return _0x3c43be[_0xfba4('0x27')]()[_0xfba4('0x26')](function(){_0x211e0a[_0xfba4('0x1e')](0xcc)[_0xfba4('0x28')]();});}};}function handleEntityNotFound(_0x4232e2,_0xa73753){return function(_0x2988ef){if(!_0x2988ef){_0x4232e2[_0xfba4('0x1d')](0x194);}return _0x2988ef;};}function handleError(_0x49d158,_0x33e05a){_0x33e05a=_0x33e05a||0x1f4;return function(_0x182f28){logger['error'](_0x182f28[_0xfba4('0x29')]);if(_0x182f28[_0xfba4('0x2a')]){delete _0x182f28[_0xfba4('0x2a')];}_0x49d158['status'](_0x33e05a)['send'](_0x182f28);};}exports['index']=function(_0x21e93b,_0x1ac530){var _0x189298={},_0x7de437={},_0x3e6ea6={'count':0x0,'rows':[]};var _0x384204=_[_0xfba4('0x2b')](db[_0xfba4('0x2c')][_0xfba4('0x2d')],function(_0x4a7bcd){return{'name':_0x4a7bcd[_0xfba4('0x2e')],'type':_0x4a7bcd[_0xfba4('0x2f')][_0xfba4('0x30')]};});_0x7de437[_0xfba4('0x31')]=_[_0xfba4('0x2b')](_0x384204,'name');_0x7de437['query']=_[_0xfba4('0x32')](_0x21e93b['query']);_0x7de437[_0xfba4('0x33')]=_[_0xfba4('0x34')](_0x7de437['model'],_0x7de437[_0xfba4('0x35')]);_0x189298['attributes']=_['intersection'](_0x7de437[_0xfba4('0x31')],qs[_0xfba4('0x36')](_0x21e93b[_0xfba4('0x35')]['fields']));_0x189298['attributes']=_0x189298['attributes'][_0xfba4('0x37')]?_0x189298[_0xfba4('0x38')]:_0x7de437['model'];if(!_0x21e93b[_0xfba4('0x35')]['hasOwnProperty'](_0xfba4('0x39'))){_0x189298[_0xfba4('0x21')]=qs[_0xfba4('0x21')](_0x21e93b[_0xfba4('0x35')][_0xfba4('0x21')]);_0x189298[_0xfba4('0x1f')]=qs[_0xfba4('0x1f')](_0x21e93b[_0xfba4('0x35')][_0xfba4('0x1f')]);}_0x189298[_0xfba4('0x3a')]=qs[_0xfba4('0x3b')](_0x21e93b[_0xfba4('0x35')][_0xfba4('0x3b')]);_0x189298[_0xfba4('0x3c')]=qs[_0xfba4('0x33')](_[_0xfba4('0x3d')](_0x21e93b[_0xfba4('0x35')],_0x7de437[_0xfba4('0x33')]),_0x384204);if(_0x21e93b[_0xfba4('0x35')][_0xfba4('0x3e')]){_0x189298[_0xfba4('0x3c')]=_[_0xfba4('0x3f')](_0x189298[_0xfba4('0x3c')],{'$or':_[_0xfba4('0x2b')](_0x384204,function(_0x2d1972){if(_0x2d1972[_0xfba4('0x2f')]!=='VIRTUAL'){var _0x571e21={};_0x571e21[_0x2d1972[_0xfba4('0x2a')]]={'$like':'%'+_0x21e93b[_0xfba4('0x35')][_0xfba4('0x3e')]+'%'};return _0x571e21;}})});}_0x189298=_[_0xfba4('0x3f')]({},_0x189298,_0x21e93b[_0xfba4('0x40')]);var _0x3aefab={'where':_0x189298[_0xfba4('0x3c')]};return db[_0xfba4('0x2c')][_0xfba4('0x22')](_0x3aefab)[_0xfba4('0x26')](function(_0x17fd35){_0x3e6ea6[_0xfba4('0x22')]=_0x17fd35;if(_0x21e93b[_0xfba4('0x35')][_0xfba4('0x41')]){_0x189298['include']=[{'all':!![]}];}return db[_0xfba4('0x2c')][_0xfba4('0x42')](_0x189298);})['then'](function(_0x1892e9){_0x3e6ea6['rows']=_0x1892e9;return _0x3e6ea6;})[_0xfba4('0x26')](respondWithFilteredResult(_0x1ac530,_0x189298))['catch'](handleError(_0x1ac530,null));};exports[_0xfba4('0x43')]=function(_0x224df5,_0x39e295){var _0x53ccb3={'raw':![],'where':{'id':_0x224df5[_0xfba4('0x44')]['id']}},_0x2fb29e={};_0x2fb29e[_0xfba4('0x31')]=_[_0xfba4('0x32')](db[_0xfba4('0x2c')][_0xfba4('0x2d')]);_0x2fb29e[_0xfba4('0x35')]=_['keys'](_0x224df5[_0xfba4('0x35')]);_0x2fb29e['filters']=_[_0xfba4('0x34')](_0x2fb29e['model'],_0x2fb29e[_0xfba4('0x35')]);_0x53ccb3[_0xfba4('0x38')]=_[_0xfba4('0x34')](_0x2fb29e[_0xfba4('0x31')],qs[_0xfba4('0x36')](_0x224df5[_0xfba4('0x35')][_0xfba4('0x36')]));_0x53ccb3[_0xfba4('0x38')]=_0x53ccb3[_0xfba4('0x38')]['length']?_0x53ccb3['attributes']:_0x2fb29e[_0xfba4('0x31')];if(_0x224df5[_0xfba4('0x35')][_0xfba4('0x41')]){_0x53ccb3['include']=[{'all':!![]}];}_0x53ccb3=_[_0xfba4('0x3f')]({},_0x53ccb3,_0x224df5['options']);return db[_0xfba4('0x2c')][_0xfba4('0x45')](_0x53ccb3)['then'](handleEntityNotFound(_0x39e295,null))['then'](respondWithResult(_0x39e295,null))['catch'](handleError(_0x39e295,null));};exports[_0xfba4('0x46')]=function(_0x548f54,_0x50b2c2){return db[_0xfba4('0x2c')][_0xfba4('0x46')](_0x548f54[_0xfba4('0x47')],{})[_0xfba4('0x26')](respondWithResult(_0x50b2c2,0xc9))['catch'](handleError(_0x50b2c2,null));};exports[_0xfba4('0x48')]=function(_0x5ab533,_0x311cf2){if(_0x5ab533[_0xfba4('0x47')]['id']){delete _0x5ab533[_0xfba4('0x47')]['id'];}return db[_0xfba4('0x2c')][_0xfba4('0x45')]({'where':{'id':_0x5ab533[_0xfba4('0x44')]['id']}})[_0xfba4('0x26')](handleEntityNotFound(_0x311cf2,null))[_0xfba4('0x26')](saveUpdates(_0x5ab533['body'],null))['then'](respondWithResult(_0x311cf2,null))[_0xfba4('0x49')](handleError(_0x311cf2,null));};exports['destroy']=function(_0x5aa40e,_0x45a255){return db[_0xfba4('0x2c')]['find']({'where':{'id':_0x5aa40e[_0xfba4('0x44')]['id']}})['then'](handleEntityNotFound(_0x45a255,null))[_0xfba4('0x26')](removeEntity(_0x45a255,null))['catch'](handleError(_0x45a255,null));};exports[_0xfba4('0x4a')]=function(_0x215ad5,_0x31fde6){return db[_0xfba4('0x2c')]['describe']()['then'](respondWithResult(_0x31fde6,null))['catch'](handleError(_0x31fde6,null));};exports[_0xfba4('0x4b')]=function(_0x7d55d4,_0x449791){var _0x2f179b={},_0x20a889={},_0x4ddfdc={'count':0x0,'rows':[]};_0x20a889[_0xfba4('0x31')]=_[_0xfba4('0x32')](db[_0xfba4('0x2c')]['rawAttributes']);_0x20a889[_0xfba4('0x35')]=_[_0xfba4('0x32')](_0x7d55d4[_0xfba4('0x35')]);_0x20a889['filters']=_[_0xfba4('0x34')](_0x20a889['model'],_0x20a889['query']);_0x2f179b[_0xfba4('0x38')]=_[_0xfba4('0x34')](_0x20a889[_0xfba4('0x31')],qs[_0xfba4('0x36')](_0x7d55d4['query']['fields']));_0x2f179b[_0xfba4('0x38')]=_0x2f179b[_0xfba4('0x38')][_0xfba4('0x37')]?_0x2f179b[_0xfba4('0x38')]:_0x20a889[_0xfba4('0x31')];if(!_0x7d55d4['query'][_0xfba4('0x4c')](_0xfba4('0x39'))){_0x2f179b['limit']=qs[_0xfba4('0x21')](_0x7d55d4['query'][_0xfba4('0x21')]);_0x2f179b[_0xfba4('0x1f')]=qs[_0xfba4('0x1f')](_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x1f')]);}_0x2f179b[_0xfba4('0x3a')]=qs[_0xfba4('0x3b')](_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x3b')]);_0x2f179b['where']=qs[_0xfba4('0x33')](_[_0xfba4('0x3d')](_0x7d55d4[_0xfba4('0x35')],_0x20a889[_0xfba4('0x33')]));if(_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x3e')]){_0x2f179b[_0xfba4('0x3c')]=_[_0xfba4('0x3f')](_0x2f179b[_0xfba4('0x3c')],{'$or':_[_0xfba4('0x2b')](_0x2f179b[_0xfba4('0x38')],function(_0x119dcf){var _0xbd26f2={};_0xbd26f2[_0x119dcf]={'$like':'%'+_0x7d55d4['query'][_0xfba4('0x3e')]+'%'};return _0xbd26f2;})});}_0x2f179b=_[_0xfba4('0x3f')]({},_0x2f179b,_0x7d55d4['options']);var _0x4656a9={'where':_0x2f179b[_0xfba4('0x3c')]};return db[_0xfba4('0x2c')][_0xfba4('0x22')](_0x4656a9)[_0xfba4('0x26')](function(_0x1e25cd){_0x4ddfdc[_0xfba4('0x22')]=_0x1e25cd;if(_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x41')]){_0x2f179b['include']=[{'all':!![]}];}return db[_0xfba4('0x2c')]['findAll'](_0x2f179b);})['then'](function(_0x55aac8){_0x4ddfdc[_0xfba4('0x4d')]=_0x55aac8;return _0x4ddfdc;})[_0xfba4('0x26')](respondWithFilteredResult(_0x449791,_0x2f179b,_0xfba4('0x4b')))['catch'](handleError(_0x449791,null,_0xfba4('0x4b')));}; \ No newline at end of file +var _0x8191=['register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','sort','pick','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x24ed5b,_0x49db60){var _0x23479a=function(_0x1bddf3){while(--_0x1bddf3){_0x24ed5b['push'](_0x24ed5b['shift']());}};_0x23479a(++_0x49db60);}(_0x8191,0xe3));var _0x1819=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x8191[_0x5c2c7c];return _0xea7ffe;};'use strict';var emlformat=require(_0x1819('0x0'));var rimraf=require(_0x1819('0x1'));var zipdir=require(_0x1819('0x2'));var jsonpatch=require(_0x1819('0x3'));var rp=require('request-promise');var moment=require(_0x1819('0x4'));var BPromise=require(_0x1819('0x5'));var Mustache=require('mustache');var util=require(_0x1819('0x6'));var path=require(_0x1819('0x7'));var sox=require('sox');var csv=require(_0x1819('0x8'));var ejs=require(_0x1819('0x9'));var fs=require('fs');var fs_extra=require(_0x1819('0xa'));var _=require(_0x1819('0xb'));var squel=require(_0x1819('0xc'));var crypto=require('crypto');var jsforce=require(_0x1819('0xd'));var deskjs=require(_0x1819('0xe'));var toCsv=require(_0x1819('0x8'));var querystring=require(_0x1819('0xf'));var Papa=require(_0x1819('0x10'));var Redis=require('ioredis');var authService=require(_0x1819('0x11'));var qs=require(_0x1819('0x12'));var as=require(_0x1819('0x13'));var hardwareService=require(_0x1819('0x14'));var logger=require(_0x1819('0x15'))('api');var utils=require(_0x1819('0x16'));var config=require(_0x1819('0x17'));var licenseUtil=require(_0x1819('0x18'));var db=require(_0x1819('0x19'))['db'];config[_0x1819('0x1a')]=_[_0x1819('0x1b')](config['redis'],{'host':_0x1819('0x1c'),'port':0x18eb});var socket=require(_0x1819('0x1d'))(new Redis(config['redis']));require(_0x1819('0x1e'))[_0x1819('0x1f')](socket);function respondWithStatusCode(_0x44e186,_0x3972da){_0x3972da=_0x3972da||0xcc;return function(_0x5e396b){if(_0x5e396b){return _0x44e186[_0x1819('0x20')](_0x3972da);}return _0x44e186[_0x1819('0x21')](_0x3972da)[_0x1819('0x22')]();};}function respondWithResult(_0x59c689,_0x3b3b53){_0x3b3b53=_0x3b3b53||0xc8;return function(_0x5460ba){if(_0x5460ba){return _0x59c689[_0x1819('0x21')](_0x3b3b53)['json'](_0x5460ba);}};}function respondWithFilteredResult(_0x3874c2,_0x2f1dfc){return function(_0x19b99f){if(_0x19b99f){var _0x17e102=typeof _0x2f1dfc['offset']===_0x1819('0x23')&&typeof _0x2f1dfc[_0x1819('0x24')]===_0x1819('0x23');var _0x20a415=_0x19b99f[_0x1819('0x25')];var _0x4f1388=_0x17e102?0x0:_0x2f1dfc['offset'];var _0x3e2c57=_0x17e102?_0x19b99f[_0x1819('0x25')]:_0x2f1dfc[_0x1819('0x26')]+_0x2f1dfc[_0x1819('0x24')];var _0x5d80ab;if(_0x3e2c57>=_0x20a415){_0x3e2c57=_0x20a415;_0x5d80ab=0xc8;}else{_0x5d80ab=0xce;}_0x3874c2['status'](_0x5d80ab);return _0x3874c2[_0x1819('0x27')](_0x1819('0x28'),_0x4f1388+'-'+_0x3e2c57+'/'+_0x20a415)['json'](_0x19b99f);}return null;};}function patchUpdates(_0x52aea9){return function(_0x337449){try{jsonpatch['apply'](_0x337449,_0x52aea9,!![]);}catch(_0x369032){return BPromise[_0x1819('0x29')](_0x369032);}return _0x337449['save']();};}function saveUpdates(_0xbf4540,_0x13d08d){return function(_0x23c669){if(_0x23c669){return _0x23c669[_0x1819('0x2a')](_0xbf4540)[_0x1819('0x2b')](function(_0x579d8d){return _0x579d8d;});}return null;};}function removeEntity(_0x3fd256,_0x4e78ed){return function(_0x59e0d7){if(_0x59e0d7){return _0x59e0d7[_0x1819('0x2c')]()['then'](function(){_0x3fd256[_0x1819('0x21')](0xcc)[_0x1819('0x22')]();});}};}function handleEntityNotFound(_0x2ca200,_0x5b0b95){return function(_0x50dd71){if(!_0x50dd71){_0x2ca200[_0x1819('0x20')](0x194);}return _0x50dd71;};}function handleError(_0x3e0956,_0x4cf4da){_0x4cf4da=_0x4cf4da||0x1f4;return function(_0x4fd2cb){logger[_0x1819('0x2d')](_0x4fd2cb[_0x1819('0x2e')]);if(_0x4fd2cb[_0x1819('0x2f')]){delete _0x4fd2cb[_0x1819('0x2f')];}_0x3e0956[_0x1819('0x21')](_0x4cf4da)[_0x1819('0x30')](_0x4fd2cb);};}exports[_0x1819('0x31')]=function(_0x55c187,_0x619897){var _0x4fc900={},_0x2fe3ca={},_0x391255={'count':0x0,'rows':[]};var _0x3866c1=_[_0x1819('0x32')](db[_0x1819('0x33')]['rawAttributes'],function(_0x4fcd1b){return{'name':_0x4fcd1b[_0x1819('0x34')],'type':_0x4fcd1b['type'][_0x1819('0x35')]};});_0x2fe3ca[_0x1819('0x36')]=_[_0x1819('0x32')](_0x3866c1,_0x1819('0x2f'));_0x2fe3ca[_0x1819('0x37')]=_[_0x1819('0x38')](_0x55c187['query']);_0x2fe3ca[_0x1819('0x39')]=_[_0x1819('0x3a')](_0x2fe3ca[_0x1819('0x36')],_0x2fe3ca[_0x1819('0x37')]);_0x4fc900['attributes']=_[_0x1819('0x3a')](_0x2fe3ca[_0x1819('0x36')],qs[_0x1819('0x3b')](_0x55c187[_0x1819('0x37')]['fields']));_0x4fc900[_0x1819('0x3c')]=_0x4fc900[_0x1819('0x3c')][_0x1819('0x3d')]?_0x4fc900[_0x1819('0x3c')]:_0x2fe3ca[_0x1819('0x36')];if(!_0x55c187[_0x1819('0x37')][_0x1819('0x3e')](_0x1819('0x3f'))){_0x4fc900['limit']=qs[_0x1819('0x24')](_0x55c187['query'][_0x1819('0x24')]);_0x4fc900[_0x1819('0x26')]=qs[_0x1819('0x26')](_0x55c187['query'][_0x1819('0x26')]);}_0x4fc900[_0x1819('0x40')]=qs['sort'](_0x55c187[_0x1819('0x37')]['sort']);_0x4fc900[_0x1819('0x41')]=qs['filters'](_['pick'](_0x55c187[_0x1819('0x37')],_0x2fe3ca[_0x1819('0x39')]),_0x3866c1);if(_0x55c187[_0x1819('0x37')][_0x1819('0x42')]){_0x4fc900['where']=_[_0x1819('0x43')](_0x4fc900[_0x1819('0x41')],{'$or':_[_0x1819('0x32')](_0x3866c1,function(_0x2c6766){if(_0x2c6766[_0x1819('0x44')]!==_0x1819('0x45')){var _0x5e317a={};_0x5e317a[_0x2c6766[_0x1819('0x2f')]]={'$like':'%'+_0x55c187[_0x1819('0x37')]['filter']+'%'};return _0x5e317a;}})});}_0x4fc900=_['merge']({},_0x4fc900,_0x55c187[_0x1819('0x46')]);var _0x49e283={'where':_0x4fc900['where']};return db['VoiceQueueReport']['count'](_0x49e283)[_0x1819('0x2b')](function(_0x4ddcf1){_0x391255['count']=_0x4ddcf1;if(_0x55c187[_0x1819('0x37')][_0x1819('0x47')]){_0x4fc900[_0x1819('0x48')]=[{'all':!![]}];}return db[_0x1819('0x33')]['findAll'](_0x4fc900);})[_0x1819('0x2b')](function(_0x3f0134){_0x391255[_0x1819('0x49')]=_0x3f0134;return _0x391255;})[_0x1819('0x2b')](respondWithFilteredResult(_0x619897,_0x4fc900))[_0x1819('0x4a')](handleError(_0x619897,null));};exports[_0x1819('0x4b')]=function(_0x317778,_0xd1575f){var _0x5cb8e3={'raw':![],'where':{'id':_0x317778[_0x1819('0x4c')]['id']}},_0x384190={};_0x384190[_0x1819('0x36')]=_[_0x1819('0x38')](db[_0x1819('0x33')][_0x1819('0x4d')]);_0x384190['query']=_[_0x1819('0x38')](_0x317778[_0x1819('0x37')]);_0x384190['filters']=_[_0x1819('0x3a')](_0x384190[_0x1819('0x36')],_0x384190[_0x1819('0x37')]);_0x5cb8e3[_0x1819('0x3c')]=_[_0x1819('0x3a')](_0x384190[_0x1819('0x36')],qs['fields'](_0x317778[_0x1819('0x37')][_0x1819('0x3b')]));_0x5cb8e3[_0x1819('0x3c')]=_0x5cb8e3[_0x1819('0x3c')][_0x1819('0x3d')]?_0x5cb8e3[_0x1819('0x3c')]:_0x384190[_0x1819('0x36')];if(_0x317778[_0x1819('0x37')][_0x1819('0x47')]){_0x5cb8e3['include']=[{'all':!![]}];}_0x5cb8e3=_[_0x1819('0x43')]({},_0x5cb8e3,_0x317778['options']);return db['VoiceQueueReport'][_0x1819('0x4e')](_0x5cb8e3)[_0x1819('0x2b')](handleEntityNotFound(_0xd1575f,null))[_0x1819('0x2b')](respondWithResult(_0xd1575f,null))[_0x1819('0x4a')](handleError(_0xd1575f,null));};exports[_0x1819('0x4f')]=function(_0x350e34,_0x5e6b78){return db[_0x1819('0x33')]['create'](_0x350e34[_0x1819('0x50')],{})['then'](respondWithResult(_0x5e6b78,0xc9))[_0x1819('0x4a')](handleError(_0x5e6b78,null));};exports['update']=function(_0x4ce206,_0xdb56ab){if(_0x4ce206[_0x1819('0x50')]['id']){delete _0x4ce206['body']['id'];}return db[_0x1819('0x33')][_0x1819('0x4e')]({'where':{'id':_0x4ce206[_0x1819('0x4c')]['id']}})[_0x1819('0x2b')](handleEntityNotFound(_0xdb56ab,null))['then'](saveUpdates(_0x4ce206['body'],null))[_0x1819('0x2b')](respondWithResult(_0xdb56ab,null))[_0x1819('0x4a')](handleError(_0xdb56ab,null));};exports[_0x1819('0x2c')]=function(_0x4a205d,_0x5dc4df){return db[_0x1819('0x33')][_0x1819('0x4e')]({'where':{'id':_0x4a205d[_0x1819('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dc4df,null))['then'](removeEntity(_0x5dc4df,null))[_0x1819('0x4a')](handleError(_0x5dc4df,null));};exports[_0x1819('0x51')]=function(_0x487133,_0x4865ff){return db['VoiceQueueReport']['describe']()[_0x1819('0x2b')](respondWithResult(_0x4865ff,null))[_0x1819('0x4a')](handleError(_0x4865ff,null));};exports['getVoiceQueuesReport']=function(_0x28f941,_0x106275){var _0x168a8a={},_0x4d6025={},_0x4ef6a9={'count':0x0,'rows':[]};_0x4d6025[_0x1819('0x36')]=_[_0x1819('0x38')](db[_0x1819('0x33')]['rawAttributes']);_0x4d6025[_0x1819('0x37')]=_[_0x1819('0x38')](_0x28f941['query']);_0x4d6025[_0x1819('0x39')]=_['intersection'](_0x4d6025['model'],_0x4d6025[_0x1819('0x37')]);_0x168a8a[_0x1819('0x3c')]=_[_0x1819('0x3a')](_0x4d6025[_0x1819('0x36')],qs[_0x1819('0x3b')](_0x28f941[_0x1819('0x37')][_0x1819('0x3b')]));_0x168a8a['attributes']=_0x168a8a[_0x1819('0x3c')][_0x1819('0x3d')]?_0x168a8a[_0x1819('0x3c')]:_0x4d6025['model'];if(!_0x28f941[_0x1819('0x37')][_0x1819('0x3e')](_0x1819('0x3f'))){_0x168a8a[_0x1819('0x24')]=qs[_0x1819('0x24')](_0x28f941[_0x1819('0x37')][_0x1819('0x24')]);_0x168a8a[_0x1819('0x26')]=qs[_0x1819('0x26')](_0x28f941['query'][_0x1819('0x26')]);}_0x168a8a[_0x1819('0x40')]=qs[_0x1819('0x52')](_0x28f941['query'][_0x1819('0x52')]);_0x168a8a[_0x1819('0x41')]=qs[_0x1819('0x39')](_[_0x1819('0x53')](_0x28f941[_0x1819('0x37')],_0x4d6025[_0x1819('0x39')]));if(_0x28f941[_0x1819('0x37')]['filter']){_0x168a8a[_0x1819('0x41')]=_[_0x1819('0x43')](_0x168a8a[_0x1819('0x41')],{'$or':_[_0x1819('0x32')](_0x168a8a[_0x1819('0x3c')],function(_0x149436){var _0x3c680d={};_0x3c680d[_0x149436]={'$like':'%'+_0x28f941[_0x1819('0x37')][_0x1819('0x42')]+'%'};return _0x3c680d;})});}_0x168a8a=_[_0x1819('0x43')]({},_0x168a8a,_0x28f941[_0x1819('0x46')]);var _0x1775eb={'where':_0x168a8a['where']};return db[_0x1819('0x33')]['count'](_0x1775eb)['then'](function(_0x452e6b){_0x4ef6a9['count']=_0x452e6b;if(_0x28f941[_0x1819('0x37')][_0x1819('0x47')]){_0x168a8a[_0x1819('0x48')]=[{'all':!![]}];}return db[_0x1819('0x33')][_0x1819('0x54')](_0x168a8a);})[_0x1819('0x2b')](function(_0xe1378c){_0x4ef6a9[_0x1819('0x49')]=_0xe1378c;return _0x4ef6a9;})[_0x1819('0x2b')](respondWithFilteredResult(_0x106275,_0x168a8a,_0x1819('0x55')))[_0x1819('0x4a')](handleError(_0x106275,null,_0x1819('0x55')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1ace0ae..3f05a16 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 _0x5a2c=['remove','emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update'];(function(_0x719e1e,_0x59f681){var _0x580f0b=function(_0x451583){while(--_0x451583){_0x719e1e['push'](_0x719e1e['shift']());}};_0x580f0b(++_0x59f681);}(_0x5a2c,0xf7));var _0xc5a2=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x5a2c[_0x5f5cce];return _0x705ecf;};'use strict';var EventEmitter=require(_0xc5a2('0x0'));var VoiceQueueReport=require(_0xc5a2('0x1'))['db'][_0xc5a2('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc5a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc5a2('0x4'),'afterDestroy':_0xc5a2('0x5')};function emitEvent(_0x256985){return function(_0x32566a,_0x3c3c47,_0x509a1d){VoiceQueueReportEvents[_0xc5a2('0x6')](_0x256985+':'+_0x32566a['id'],_0x32566a);VoiceQueueReportEvents[_0xc5a2('0x6')](_0x256985,_0x32566a);_0x509a1d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xc5a2('0x7')](e,emitEvent(event));}}module[_0xc5a2('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4d92=['VoiceQueueReport','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x4d92,0x1ee));var _0x24d9=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x4d92[_0xc4001c];return _0x49f7bc;};'use strict';var EventEmitter=require(_0x24d9('0x0'));var VoiceQueueReport=require(_0x24d9('0x1'))['db'][_0x24d9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x24d9('0x3')](0x0);var events={'afterCreate':_0x24d9('0x4'),'afterUpdate':_0x24d9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b2066){return function(_0x1103f1,_0x2e8423,_0x1ae8dc){VoiceQueueReportEvents[_0x24d9('0x6')](_0x5b2066+':'+_0x1103f1['id'],_0x1103f1);VoiceQueueReportEvents['emit'](_0x5b2066,_0x1103f1);_0x1ae8dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x24d9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0902de6..71706fe 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 _0xa2f8=['uniqueid','util','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue'];(function(_0x32d21e,_0x2c451f){var _0x14dd81=function(_0x19802c){while(--_0x19802c){_0x32d21e['push'](_0x32d21e['shift']());}};_0x14dd81(++_0x2c451f);}(_0xa2f8,0x18d));var _0x8a2f=function(_0x3be454,_0xb37612){_0x3be454=_0x3be454-0x0;var _0xcead50=_0xa2f8[_0x3be454];return _0xcead50;};'use strict';var _=require('lodash');var util=require(_0x8a2f('0x0'));var logger=require('../../config/logger')(_0x8a2f('0x1'));var moment=require(_0x8a2f('0x2'));var BPromise=require(_0x8a2f('0x3'));var rp=require(_0x8a2f('0x4'));var fs=require('fs');var path=require(_0x8a2f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a2f('0x6'));module[_0x8a2f('0x7')]=function(_0x212788,_0x390107){return _0x212788['define'](_0x8a2f('0x8'),attributes,{'tableName':_0x8a2f('0x9'),'paranoid':![],'indexes':[{'fields':[_0x8a2f('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1332=['rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x1332,0x157));var _0x2133=function(_0x89c2bd,_0x42013d){_0x89c2bd=_0x89c2bd-0x0;var _0x3a216f=_0x1332[_0x89c2bd];return _0x3a216f;};'use strict';var _=require(_0x2133('0x0'));var util=require(_0x2133('0x1'));var logger=require(_0x2133('0x2'))('api');var moment=require(_0x2133('0x3'));var BPromise=require(_0x2133('0x4'));var rp=require(_0x2133('0x5'));var fs=require('fs');var path=require(_0x2133('0x6'));var rimraf=require(_0x2133('0x7'));var config=require(_0x2133('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x2133('0x9')]=function(_0xbb3f7,_0xb170a){return _0xbb3f7[_0x2133('0xa')](_0x2133('0xb'),attributes,{'tableName':_0x2133('0xc'),'paranoid':![],'indexes':[{'fields':[_0x2133('0xd')]},{'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 7ef6e7c..2e09c03 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 _0xd9ff=['then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','GetVoiceQueueReport','findAll','options','where','attributes','include','map','model','info','debug','catch','CreateVoiceQueueReport','VoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','limit','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd9ff,0xb6));var _0xfd9f=function(_0xb394aa,_0x405315){_0xb394aa=_0xb394aa-0x0;var _0x1840ae=_0xd9ff[_0xb394aa];return _0x1840ae;};'use strict';var _=require(_0xfd9f('0x0'));var util=require('util');var moment=require(_0xfd9f('0x1'));var BPromise=require(_0xfd9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd9f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfd9f('0x4'))('rpc');var config=require(_0xfd9f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfd9f('0x6')][_0xfd9f('0x7')]({'port':0x232a});config[_0xfd9f('0x8')]=_[_0xfd9f('0x9')](config[_0xfd9f('0x8')],{'host':_0xfd9f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd9f('0x8')]));require(_0xfd9f('0xb'))[_0xfd9f('0xc')](socket);function respondWithRpcPromise(_0x1d0271,_0x563ea0,_0x26e751){return new BPromise(function(_0x1b6cfe,_0x8368e3){return client['request'](_0x1d0271,_0x26e751)[_0xfd9f('0xd')](function(_0x50c363){logger['info'](_0xfd9f('0xe'),_0x563ea0,_0xfd9f('0xf'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x563ea0,_0xfd9f('0xf'),JSON[_0xfd9f('0x10')](_0x50c363));if(_0x50c363[_0xfd9f('0x11')]){if(_0x50c363[_0xfd9f('0x11')][_0xfd9f('0x12')]===0x1f4){logger[_0xfd9f('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x563ea0,_0x50c363['error']['message']);return _0x8368e3(_0x50c363[_0xfd9f('0x11')]['message']);}logger[_0xfd9f('0x11')](_0xfd9f('0xe'),_0x563ea0,_0x50c363[_0xfd9f('0x11')]['message']);return _0x1b6cfe(_0x50c363['error']['message']);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x563ea0,'request\x20sent');_0x1b6cfe(_0x50c363[_0xfd9f('0x13')][_0xfd9f('0x14')]);}})['catch'](function(_0x431483){logger[_0xfd9f('0x11')](_0xfd9f('0xe'),_0x563ea0,_0x431483);_0x8368e3(_0x431483);});});}exports[_0xfd9f('0x15')]=function(_0x526768){var _0x2bd790=this;return new Promise(function(_0x517f5c,_0x2bb0cc){return db['VoiceQueueReport'][_0xfd9f('0x16')]({'raw':_0x526768[_0xfd9f('0x17')]?_0x526768[_0xfd9f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x526768[_0xfd9f('0x17')]?_0x526768[_0xfd9f('0x17')][_0xfd9f('0x18')]||null:null,'attributes':_0x526768[_0xfd9f('0x17')]?_0x526768[_0xfd9f('0x17')][_0xfd9f('0x19')]||null:null,'limit':_0x526768[_0xfd9f('0x17')]?_0x526768[_0xfd9f('0x17')]['limit']||null:null,'include':_0x526768[_0xfd9f('0x17')]?_0x526768[_0xfd9f('0x17')][_0xfd9f('0x1a')]?_[_0xfd9f('0x1b')](_0x526768[_0xfd9f('0x17')][_0xfd9f('0x1a')],function(_0x291eff){return{'model':db[_0x291eff[_0xfd9f('0x1c')]],'as':_0x291eff['as'],'attributes':_0x291eff['attributes'],'include':_0x291eff[_0xfd9f('0x1a')]?_[_0xfd9f('0x1b')](_0x291eff['include'],function(_0x188ab0){return{'model':db[_0x188ab0[_0xfd9f('0x1c')]],'as':_0x188ab0['as'],'attributes':_0x188ab0['attributes'],'include':_0x188ab0[_0xfd9f('0x1a')]?_[_0xfd9f('0x1b')](_0x188ab0['include'],function(_0x42f127){return{'model':db[_0x42f127['model']],'as':_0x42f127['as'],'attributes':_0x42f127['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd9f('0xd')](function(_0x26d83b){logger[_0xfd9f('0x1d')](_0xfd9f('0x15'),_0x526768);logger[_0xfd9f('0x1e')](_0xfd9f('0x15'),_0x526768,JSON[_0xfd9f('0x10')](_0x26d83b));_0x517f5c(_0x26d83b);})[_0xfd9f('0x1f')](function(_0x23fc26){logger[_0xfd9f('0x11')](_0xfd9f('0x15'),_0x23fc26[_0xfd9f('0x14')],_0x526768);_0x2bb0cc(_0x2bd790[_0xfd9f('0x11')](0x1f4,_0x23fc26['message']));});});};exports[_0xfd9f('0x20')]=function(_0xa7a45){var _0x3ec3b4=this;return new Promise(function(_0x418e26,_0x35739b){return db[_0xfd9f('0x21')]['create'](_0xa7a45[_0xfd9f('0x22')],{'raw':_0xa7a45['options']?_0xa7a45['options'][_0xfd9f('0x23')]===undefined?!![]:![]:!![]})[_0xfd9f('0xd')](function(_0x1e25b2){logger[_0xfd9f('0x1d')](_0xfd9f('0x20'),_0xa7a45);logger[_0xfd9f('0x1e')]('CreateVoiceQueueReport',_0xa7a45,JSON[_0xfd9f('0x10')](_0x1e25b2));_0x418e26(_0x1e25b2);})['catch'](function(_0x437186){logger['error'](_0xfd9f('0x20'),_0x437186['message'],_0xa7a45);_0x35739b(_0x3ec3b4[_0xfd9f('0x11')](0x1f4,_0x437186['message']));});});};exports[_0xfd9f('0x24')]=function(_0x511fb9){var _0x2d9a1b=this;return new Promise(function(_0x153ae2,_0x5a2c7d){return db[_0xfd9f('0x21')][_0xfd9f('0x25')](_0x511fb9[_0xfd9f('0x22')],{'raw':_0x511fb9[_0xfd9f('0x17')]?_0x511fb9[_0xfd9f('0x17')][_0xfd9f('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x511fb9[_0xfd9f('0x17')]?_0x511fb9[_0xfd9f('0x17')]['where']||null:null,'attributes':_0x511fb9[_0xfd9f('0x17')]?_0x511fb9['options']['attributes']||null:null,'limit':_0x511fb9[_0xfd9f('0x17')]?_0x511fb9[_0xfd9f('0x17')][_0xfd9f('0x26')]||null:null})['then'](function(_0x116ccf){logger['info']('UpdateVoiceQueueReport',_0x511fb9);logger[_0xfd9f('0x1e')]('UpdateVoiceQueueReport',_0x511fb9,JSON[_0xfd9f('0x10')](_0x116ccf));_0x153ae2(_0x116ccf);})['catch'](function(_0x59424d){logger[_0xfd9f('0x11')](_0xfd9f('0x24'),_0x59424d['message'],_0x511fb9);_0x5a2c7d(_0x2d9a1b['error'](0x1f4,_0x59424d[_0xfd9f('0x14')]));});});}; \ No newline at end of file +var _0xbecb=['GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','VoiceQueueReport','findAll','options','raw','include','map','attributes','model'];(function(_0x427611,_0x180ae8){var _0x97539e=function(_0x564f09){while(--_0x564f09){_0x427611['push'](_0x427611['shift']());}};_0x97539e(++_0x180ae8);}(_0xbecb,0xb0));var _0xbbec=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbecb[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0xbbec('0x0'));var moment=require(_0xbbec('0x1'));var BPromise=require(_0xbbec('0x2'));var rs=require(_0xbbec('0x3'));var fs=require('fs');var Redis=require(_0xbbec('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbec('0x5'))(_0xbbec('0x6'));var config=require('../../config/environment');var jayson=require(_0xbbec('0x7'));var client=jayson[_0xbbec('0x8')]['http']({'port':0x232a});config[_0xbbec('0x9')]=_[_0xbbec('0xa')](config[_0xbbec('0x9')],{'host':_0xbbec('0xb'),'port':0x18eb});var socket=require(_0xbbec('0xc'))(new Redis(config[_0xbbec('0x9')]));require('./voiceQueueReport.socket')[_0xbbec('0xd')](socket);function respondWithRpcPromise(_0x59b7e9,_0x1db36d,_0x4c0906){return new BPromise(function(_0x3ce4a1,_0x52392d){return client[_0xbbec('0xe')](_0x59b7e9,_0x4c0906)[_0xbbec('0xf')](function(_0x437040){logger[_0xbbec('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1db36d,_0xbbec('0x11'));logger[_0xbbec('0x12')](_0xbbec('0x13'),_0x1db36d,_0xbbec('0x11'),JSON[_0xbbec('0x14')](_0x437040));if(_0x437040[_0xbbec('0x15')]){if(_0x437040['error'][_0xbbec('0x16')]===0x1f4){logger[_0xbbec('0x15')](_0xbbec('0x17'),_0x1db36d,_0x437040[_0xbbec('0x15')][_0xbbec('0x18')]);return _0x52392d(_0x437040['error'][_0xbbec('0x18')]);}logger[_0xbbec('0x15')](_0xbbec('0x17'),_0x1db36d,_0x437040[_0xbbec('0x15')][_0xbbec('0x18')]);return _0x3ce4a1(_0x437040[_0xbbec('0x15')][_0xbbec('0x18')]);}else{logger['info'](_0xbbec('0x17'),_0x1db36d,_0xbbec('0x11'));_0x3ce4a1(_0x437040[_0xbbec('0x19')]['message']);}})['catch'](function(_0x47a377){logger['error'](_0xbbec('0x17'),_0x1db36d,_0x47a377);_0x52392d(_0x47a377);});});}exports['GetVoiceQueueReport']=function(_0x4a26c8){var _0x53ecda=this;return new Promise(function(_0x1c669d,_0x4a9358){return db[_0xbbec('0x1a')][_0xbbec('0x1b')]({'raw':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')][_0xbbec('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')]['where']||null:null,'attributes':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')]['attributes']||null:null,'limit':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')]['limit']||null:null,'include':_0x4a26c8[_0xbbec('0x1c')]?_0x4a26c8[_0xbbec('0x1c')][_0xbbec('0x1e')]?_[_0xbbec('0x1f')](_0x4a26c8[_0xbbec('0x1c')][_0xbbec('0x1e')],function(_0x4a300a){return{'model':db[_0x4a300a['model']],'as':_0x4a300a['as'],'attributes':_0x4a300a[_0xbbec('0x20')],'include':_0x4a300a[_0xbbec('0x1e')]?_['map'](_0x4a300a['include'],function(_0x194a62){return{'model':db[_0x194a62['model']],'as':_0x194a62['as'],'attributes':_0x194a62[_0xbbec('0x20')],'include':_0x194a62['include']?_['map'](_0x194a62[_0xbbec('0x1e')],function(_0x6d9cc9){return{'model':db[_0x6d9cc9[_0xbbec('0x21')]],'as':_0x6d9cc9['as'],'attributes':_0x6d9cc9[_0xbbec('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x690e7f){logger[_0xbbec('0x10')](_0xbbec('0x22'),_0x4a26c8);logger[_0xbbec('0x12')]('GetVoiceQueueReport',_0x4a26c8,JSON[_0xbbec('0x14')](_0x690e7f));_0x1c669d(_0x690e7f);})[_0xbbec('0x23')](function(_0x318ac2){logger[_0xbbec('0x15')](_0xbbec('0x22'),_0x318ac2[_0xbbec('0x18')],_0x4a26c8);_0x4a9358(_0x53ecda['error'](0x1f4,_0x318ac2[_0xbbec('0x18')]));});});};exports[_0xbbec('0x24')]=function(_0x3a61d7){var _0x430422=this;return new Promise(function(_0x4ffa8f,_0x34c2ac){return db['VoiceQueueReport'][_0xbbec('0x25')](_0x3a61d7['body'],{'raw':_0x3a61d7['options']?_0x3a61d7['options'][_0xbbec('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1274a4){logger[_0xbbec('0x10')](_0xbbec('0x24'),_0x3a61d7);logger[_0xbbec('0x12')](_0xbbec('0x24'),_0x3a61d7,JSON[_0xbbec('0x14')](_0x1274a4));_0x4ffa8f(_0x1274a4);})['catch'](function(_0xde80b0){logger['error'](_0xbbec('0x24'),_0xde80b0[_0xbbec('0x18')],_0x3a61d7);_0x34c2ac(_0x430422[_0xbbec('0x15')](0x1f4,_0xde80b0[_0xbbec('0x18')]));});});};exports[_0xbbec('0x26')]=function(_0x53a4f0){var _0x3ecda0=this;return new Promise(function(_0x55ed08,_0x185254){return db[_0xbbec('0x1a')][_0xbbec('0x27')](_0x53a4f0[_0xbbec('0x28')],{'raw':_0x53a4f0[_0xbbec('0x1c')]?_0x53a4f0['options'][_0xbbec('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53a4f0[_0xbbec('0x1c')]?_0x53a4f0[_0xbbec('0x1c')]['where']||null:null,'attributes':_0x53a4f0[_0xbbec('0x1c')]?_0x53a4f0[_0xbbec('0x1c')][_0xbbec('0x20')]||null:null,'limit':_0x53a4f0['options']?_0x53a4f0[_0xbbec('0x1c')][_0xbbec('0x29')]||null:null})[_0xbbec('0xf')](function(_0x7d45ef){logger[_0xbbec('0x10')](_0xbbec('0x26'),_0x53a4f0);logger[_0xbbec('0x12')](_0xbbec('0x26'),_0x53a4f0,JSON[_0xbbec('0x14')](_0x7d45ef));_0x55ed08(_0x7d45ef);})[_0xbbec('0x23')](function(_0x40cab0){logger[_0xbbec('0x15')](_0xbbec('0x26'),_0x40cab0[_0xbbec('0x18')],_0x53a4f0);_0x185254(_0x3ecda0[_0xbbec('0x15')](0x1f4,_0x40cab0['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7c28613..087b117 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 _0xa87e=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length','voiceQueueReport:'];(function(_0x1b13a6,_0x4dd6b4){var _0x62bc5f=function(_0x5d108b){while(--_0x5d108b){_0x1b13a6['push'](_0x1b13a6['shift']());}};_0x62bc5f(++_0x4dd6b4);}(_0xa87e,0x1c2));var _0xea87=function(_0x3d5fcf,_0xadd43f){_0x3d5fcf=_0x3d5fcf-0x0;var _0x334d8e=_0xa87e[_0x3d5fcf];return _0x334d8e;};'use strict';var VoiceQueueReportEvents=require(_0xea87('0x0'));var events=[_0xea87('0x1'),_0xea87('0x2'),_0xea87('0x3')];function createListener(_0x5a5a20,_0x37eddb){return function(_0x434a5a){_0x37eddb[_0xea87('0x4')](_0x5a5a20,_0x434a5a);};}function removeListener(_0x55c9af,_0x43d37e){return function(){VoiceQueueReportEvents[_0xea87('0x5')](_0x55c9af,_0x43d37e);};}exports[_0xea87('0x6')]=function(_0x33f15b){for(var _0x5ea863=0x0,_0xa4b0bc=events[_0xea87('0x7')];_0x5ea863<_0xa4b0bc;_0x5ea863++){var _0x284019=events[_0x5ea863];var _0x415772=createListener(_0xea87('0x8')+_0x284019,_0x33f15b);VoiceQueueReportEvents['on'](_0x284019,_0x415772);}}; \ No newline at end of file +var _0x6b1d=['length','save','update','emit','register'];(function(_0x30567e,_0xa860af){var _0x48161d=function(_0x1f61cd){while(--_0x1f61cd){_0x30567e['push'](_0x30567e['shift']());}};_0x48161d(++_0xa860af);}(_0x6b1d,0xc9));var _0xd6b1=function(_0x6c40ba,_0x5e39fa){_0x6c40ba=_0x6c40ba-0x0;var _0x7a54dd=_0x6b1d[_0x6c40ba];return _0x7a54dd;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xd6b1('0x0'),'remove',_0xd6b1('0x1')];function createListener(_0x15351b,_0x409fc9){return function(_0x372042){_0x409fc9[_0xd6b1('0x2')](_0x15351b,_0x372042);};}function removeListener(_0x5f3de9,_0x75f22b){return function(){VoiceQueueReportEvents['removeListener'](_0x5f3de9,_0x75f22b);};}exports[_0xd6b1('0x3')]=function(_0x37345b){for(var _0x106639=0x0,_0x29b0f7=events[_0xd6b1('0x4')];_0x106639<_0x29b0f7;_0x106639++){var _0x34bdd6=events[_0x106639];var _0x1adddd=createListener('voiceQueueReport:'+_0x34bdd6,_0x37345b);VoiceQueueReportEvents['on'](_0x34bdd6,_0x1adddd);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 3c08223..c2324f0 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 _0xaa85=['util','path','connect-timeout','express','fs-extra','./voiceQueuesLog.controller','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports'];(function(_0x5ac188,_0x163bcf){var _0x32fa2f=function(_0x2331c0){while(--_0x2331c0){_0x5ac188['push'](_0x5ac188['shift']());}};_0x32fa2f(++_0x163bcf);}(_0xaa85,0x186));var _0x5aa8=function(_0x22ee02,_0x5bac79){_0x22ee02=_0x22ee02-0x0;var _0x3fda86=_0xaa85[_0x22ee02];return _0x3fda86;};'use strict';var multer=require('multer');var util=require(_0x5aa8('0x0'));var path=require(_0x5aa8('0x1'));var timeout=require(_0x5aa8('0x2'));var express=require(_0x5aa8('0x3'));var router=express['Router']();var fs_extra=require(_0x5aa8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5aa8('0x5'));router['get']('/',auth[_0x5aa8('0x6')](),controller[_0x5aa8('0x7')]);router['get'](_0x5aa8('0x8'),auth[_0x5aa8('0x6')](),controller[_0x5aa8('0x9')]);router[_0x5aa8('0xa')]('/',auth[_0x5aa8('0x6')](),controller['create']);router['put'](_0x5aa8('0x8'),auth[_0x5aa8('0x6')](),controller[_0x5aa8('0xb')]);router[_0x5aa8('0xc')](_0x5aa8('0x8'),auth[_0x5aa8('0x6')](),controller[_0x5aa8('0xd')]);module[_0x5aa8('0xe')]=router; \ No newline at end of file +var _0x3b18=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','/:id'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x3b18,0x1d4));var _0x83b1=function(_0x3de5f0,_0x7a560b){_0x3de5f0=_0x3de5f0-0x0;var _0x31a522=_0x3b18[_0x3de5f0];return _0x31a522;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x83b1('0x0'));var express=require(_0x83b1('0x1'));var router=express[_0x83b1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x83b1('0x3'));var interaction=require(_0x83b1('0x4'));var config=require('../../config/environment');var controller=require(_0x83b1('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x83b1('0x6')](_0x83b1('0x7'),auth[_0x83b1('0x8')](),controller[_0x83b1('0x9')]);router[_0x83b1('0xa')]('/',auth[_0x83b1('0x8')](),controller[_0x83b1('0xb')]);router[_0x83b1('0xc')](_0x83b1('0x7'),auth[_0x83b1('0x8')](),controller[_0x83b1('0xd')]);router[_0x83b1('0xe')]('/:id',auth[_0x83b1('0x8')](),controller[_0x83b1('0xf')]);module[_0x83b1('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 26446ce..e8f2e84 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 _0x3857=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3857,0x1a6));var _0x7385=function(_0x49a32e,_0xfafd88){_0x49a32e=_0x49a32e-0x0;var _0x587fa2=_0x3857[_0x49a32e];return _0x587fa2;};'use strict';var Sequelize=require(_0x7385('0x0'));var moment=require(_0x7385('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7385('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7385('0x3')](_0x7385('0x4'))}}; \ No newline at end of file +var _0x1950=['sequelize','moment','exports','STRING','DATE'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x1950,0x1e5));var _0x0195=function(_0x3fc29c,_0x1184f3){_0x3fc29c=_0x3fc29c-0x0;var _0x1cd07e=_0x1950[_0x3fc29c];return _0x1cd07e;};'use strict';var Sequelize=require(_0x0195('0x0'));var moment=require(_0x0195('0x1'));module[_0x0195('0x2')]={'time':{'type':Sequelize[_0x0195('0x3')]},'callid':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0195('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0195('0x4')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 71a89d3..09d4519 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 _0xc381=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv'];(function(_0xff585a,_0x4f524d){var _0x53c99f=function(_0x1bac6f){while(--_0x1bac6f){_0xff585a['push'](_0xff585a['shift']());}};_0x53c99f(++_0x4f524d);}(_0xc381,0x1b9));var _0x1c38=function(_0x3d188f,_0x27aeab){_0x3d188f=_0x3d188f-0x0;var _0x5f2f58=_0xc381[_0x3d188f];return _0x5f2f58;};'use strict';var emlformat=require(_0x1c38('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c38('0x1'));var jsonpatch=require(_0x1c38('0x2'));var rp=require(_0x1c38('0x3'));var moment=require(_0x1c38('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c38('0x5'));var util=require(_0x1c38('0x6'));var path=require('path');var sox=require(_0x1c38('0x7'));var csv=require(_0x1c38('0x8'));var ejs=require(_0x1c38('0x9'));var fs=require('fs');var fs_extra=require(_0x1c38('0xa'));var _=require(_0x1c38('0xb'));var squel=require(_0x1c38('0xc'));var crypto=require(_0x1c38('0xd'));var jsforce=require(_0x1c38('0xe'));var deskjs=require(_0x1c38('0xf'));var toCsv=require(_0x1c38('0x8'));var querystring=require('querystring');var Papa=require(_0x1c38('0x10'));var Redis=require(_0x1c38('0x11'));var authService=require(_0x1c38('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1c38('0x13'));var hardwareService=require(_0x1c38('0x14'));var logger=require('../../config/logger')(_0x1c38('0x15'));var utils=require(_0x1c38('0x16'));var config=require(_0x1c38('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bbf03,_0x4be53d){_0x4be53d=_0x4be53d||0xcc;return function(_0x3ad3af){if(_0x3ad3af){return _0x1bbf03[_0x1c38('0x18')](_0x4be53d);}return _0x1bbf03['status'](_0x4be53d)[_0x1c38('0x19')]();};}function respondWithResult(_0x329982,_0x21ed7e){_0x21ed7e=_0x21ed7e||0xc8;return function(_0x10460d){if(_0x10460d){return _0x329982[_0x1c38('0x1a')](_0x21ed7e)[_0x1c38('0x1b')](_0x10460d);}};}function respondWithFilteredResult(_0x28b75a,_0xa230a0){return function(_0x24802e){if(_0x24802e){var _0x200444=typeof _0xa230a0[_0x1c38('0x1c')]===_0x1c38('0x1d')&&typeof _0xa230a0[_0x1c38('0x1e')]===_0x1c38('0x1d');var _0x26756e=_0x24802e['count'];var _0x32ff4c=_0x200444?0x0:_0xa230a0[_0x1c38('0x1c')];var _0x52626f=_0x200444?_0x24802e[_0x1c38('0x1f')]:_0xa230a0[_0x1c38('0x1c')]+_0xa230a0[_0x1c38('0x1e')];var _0x4adf9c;if(_0x52626f>=_0x26756e){_0x52626f=_0x26756e;_0x4adf9c=0xc8;}else{_0x4adf9c=0xce;}_0x28b75a[_0x1c38('0x1a')](_0x4adf9c);return _0x28b75a[_0x1c38('0x20')]('Content-Range',_0x32ff4c+'-'+_0x52626f+'/'+_0x26756e)[_0x1c38('0x1b')](_0x24802e);}return null;};}function patchUpdates(_0x9b6709){return function(_0x1e68bc){try{jsonpatch[_0x1c38('0x21')](_0x1e68bc,_0x9b6709,!![]);}catch(_0x595f43){return BPromise[_0x1c38('0x22')](_0x595f43);}return _0x1e68bc[_0x1c38('0x23')]();};}function saveUpdates(_0x36abd9,_0x2ba333){return function(_0x3fb925){if(_0x3fb925){return _0x3fb925['update'](_0x36abd9)[_0x1c38('0x24')](function(_0x174dac){return _0x174dac;});}return null;};}function removeEntity(_0x2ee8dd,_0x104fd2){return function(_0x4e52c5){if(_0x4e52c5){return _0x4e52c5[_0x1c38('0x25')]()[_0x1c38('0x24')](function(){_0x2ee8dd['status'](0xcc)[_0x1c38('0x19')]();});}};}function handleEntityNotFound(_0x27326e,_0x4956ee){return function(_0x3211b5){if(!_0x3211b5){_0x27326e[_0x1c38('0x18')](0x194);}return _0x3211b5;};}function handleError(_0x3b30ec,_0x50334c){_0x50334c=_0x50334c||0x1f4;return function(_0x43c514){logger[_0x1c38('0x26')](_0x43c514[_0x1c38('0x27')]);if(_0x43c514[_0x1c38('0x28')]){delete _0x43c514[_0x1c38('0x28')];}_0x3b30ec['status'](_0x50334c)['send'](_0x43c514);};}exports[_0x1c38('0x29')]=function(_0x419048,_0x4bea2d){var _0x2d0bc2={},_0x125162={},_0x3abb88={'count':0x0,'rows':[]};var _0x42315a=_['map'](db[_0x1c38('0x2a')][_0x1c38('0x2b')],function(_0x24a1c5){return{'name':_0x24a1c5[_0x1c38('0x2c')],'type':_0x24a1c5[_0x1c38('0x2d')][_0x1c38('0x2e')]};});_0x125162[_0x1c38('0x2f')]=_[_0x1c38('0x30')](_0x42315a,_0x1c38('0x28'));_0x125162[_0x1c38('0x31')]=_[_0x1c38('0x32')](_0x419048[_0x1c38('0x31')]);_0x125162[_0x1c38('0x33')]=_[_0x1c38('0x34')](_0x125162[_0x1c38('0x2f')],_0x125162[_0x1c38('0x31')]);_0x2d0bc2[_0x1c38('0x35')]=_[_0x1c38('0x34')](_0x125162['model'],qs[_0x1c38('0x36')](_0x419048[_0x1c38('0x31')][_0x1c38('0x36')]));_0x2d0bc2['attributes']=_0x2d0bc2['attributes'][_0x1c38('0x37')]?_0x2d0bc2['attributes']:_0x125162[_0x1c38('0x2f')];if(!_0x419048[_0x1c38('0x31')][_0x1c38('0x38')](_0x1c38('0x39'))){_0x2d0bc2[_0x1c38('0x1e')]=qs[_0x1c38('0x1e')](_0x419048['query'][_0x1c38('0x1e')]);_0x2d0bc2[_0x1c38('0x1c')]=qs[_0x1c38('0x1c')](_0x419048[_0x1c38('0x31')][_0x1c38('0x1c')]);}_0x2d0bc2[_0x1c38('0x3a')]=qs[_0x1c38('0x3b')](_0x419048[_0x1c38('0x31')][_0x1c38('0x3b')]);_0x2d0bc2[_0x1c38('0x3c')]=qs['filters'](_[_0x1c38('0x3d')](_0x419048['query'],_0x125162[_0x1c38('0x33')]),_0x42315a);if(_0x419048[_0x1c38('0x31')]['filter']){_0x2d0bc2[_0x1c38('0x3c')]=_[_0x1c38('0x3e')](_0x2d0bc2[_0x1c38('0x3c')],{'$or':_['map'](_0x42315a,function(_0x265b0c){if(_0x265b0c[_0x1c38('0x2d')]!==_0x1c38('0x3f')){var _0x224fd={};_0x224fd[_0x265b0c[_0x1c38('0x28')]]={'$like':'%'+_0x419048['query']['filter']+'%'};return _0x224fd;}})});}_0x2d0bc2=_[_0x1c38('0x3e')]({},_0x2d0bc2,_0x419048[_0x1c38('0x40')]);var _0x4b9563={'where':_0x2d0bc2[_0x1c38('0x3c')]};return db[_0x1c38('0x2a')]['count'](_0x4b9563)['then'](function(_0x356111){_0x3abb88[_0x1c38('0x1f')]=_0x356111;if(_0x419048[_0x1c38('0x31')][_0x1c38('0x41')]){_0x2d0bc2[_0x1c38('0x42')]=[{'all':!![]}];}return db[_0x1c38('0x2a')][_0x1c38('0x43')](_0x2d0bc2);})[_0x1c38('0x24')](function(_0x7f6445){_0x3abb88['rows']=_0x7f6445;return _0x3abb88;})[_0x1c38('0x24')](respondWithFilteredResult(_0x4bea2d,_0x2d0bc2))[_0x1c38('0x44')](handleError(_0x4bea2d,null));};exports[_0x1c38('0x45')]=function(_0x4bf165,_0x54ed86){var _0x23e467={'raw':!![],'where':{'id':_0x4bf165[_0x1c38('0x46')]['id']}},_0x5f1142={};_0x5f1142[_0x1c38('0x2f')]=_[_0x1c38('0x32')](db['VoiceQueuesLog'][_0x1c38('0x2b')]);_0x5f1142[_0x1c38('0x31')]=_['keys'](_0x4bf165[_0x1c38('0x31')]);_0x5f1142[_0x1c38('0x33')]=_['intersection'](_0x5f1142[_0x1c38('0x2f')],_0x5f1142[_0x1c38('0x31')]);_0x23e467[_0x1c38('0x35')]=_[_0x1c38('0x34')](_0x5f1142[_0x1c38('0x2f')],qs[_0x1c38('0x36')](_0x4bf165[_0x1c38('0x31')][_0x1c38('0x36')]));_0x23e467[_0x1c38('0x35')]=_0x23e467[_0x1c38('0x35')][_0x1c38('0x37')]?_0x23e467['attributes']:_0x5f1142[_0x1c38('0x2f')];if(_0x4bf165[_0x1c38('0x31')][_0x1c38('0x41')]){_0x23e467[_0x1c38('0x42')]=[{'all':!![]}];}_0x23e467=_[_0x1c38('0x3e')]({},_0x23e467,_0x4bf165[_0x1c38('0x40')]);return db['VoiceQueuesLog'][_0x1c38('0x47')](_0x23e467)[_0x1c38('0x24')](handleEntityNotFound(_0x54ed86,null))[_0x1c38('0x24')](respondWithResult(_0x54ed86,null))['catch'](handleError(_0x54ed86,null));};exports[_0x1c38('0x48')]=function(_0x7e141d,_0xdefa59){return db[_0x1c38('0x2a')][_0x1c38('0x48')](_0x7e141d[_0x1c38('0x49')],{})['then'](respondWithResult(_0xdefa59,0xc9))[_0x1c38('0x44')](handleError(_0xdefa59,null));};exports[_0x1c38('0x4a')]=function(_0x1da805,_0x42b95b){if(_0x1da805[_0x1c38('0x49')]['id']){delete _0x1da805['body']['id'];}return db['VoiceQueuesLog'][_0x1c38('0x47')]({'where':{'id':_0x1da805[_0x1c38('0x46')]['id']}})['then'](handleEntityNotFound(_0x42b95b,null))['then'](saveUpdates(_0x1da805['body'],null))[_0x1c38('0x24')](respondWithResult(_0x42b95b,null))[_0x1c38('0x44')](handleError(_0x42b95b,null));};exports[_0x1c38('0x25')]=function(_0x56a224,_0x5c95cb){return db['VoiceQueuesLog'][_0x1c38('0x47')]({'where':{'id':_0x56a224[_0x1c38('0x46')]['id']}})[_0x1c38('0x24')](handleEntityNotFound(_0x5c95cb,null))[_0x1c38('0x24')](removeEntity(_0x5c95cb,null))[_0x1c38('0x44')](handleError(_0x5c95cb,null));}; \ No newline at end of file +var _0xedc2=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','VoiceQueuesLog','includeAll','rows','catch','show','params','attributes','length','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x52a266,_0x57d5ca){var _0x2c4b3b=function(_0x3e0f71){while(--_0x3e0f71){_0x52a266['push'](_0x52a266['shift']());}};_0x2c4b3b(++_0x57d5ca);}(_0xedc2,0x1bf));var _0x2edc=function(_0x4b7ebd,_0x3fcc28){_0x4b7ebd=_0x4b7ebd-0x0;var _0x38a81b=_0xedc2[_0x4b7ebd];return _0x38a81b;};'use strict';var emlformat=require(_0x2edc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2edc('0x1'));var jsonpatch=require(_0x2edc('0x2'));var rp=require(_0x2edc('0x3'));var moment=require(_0x2edc('0x4'));var BPromise=require(_0x2edc('0x5'));var Mustache=require('mustache');var util=require(_0x2edc('0x6'));var path=require(_0x2edc('0x7'));var sox=require(_0x2edc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2edc('0x9'));var _=require(_0x2edc('0xa'));var squel=require(_0x2edc('0xb'));var crypto=require(_0x2edc('0xc'));var jsforce=require(_0x2edc('0xd'));var deskjs=require(_0x2edc('0xe'));var toCsv=require(_0x2edc('0xf'));var querystring=require(_0x2edc('0x10'));var Papa=require(_0x2edc('0x11'));var Redis=require(_0x2edc('0x12'));var authService=require(_0x2edc('0x13'));var qs=require(_0x2edc('0x14'));var as=require(_0x2edc('0x15'));var hardwareService=require(_0x2edc('0x16'));var logger=require(_0x2edc('0x17'))(_0x2edc('0x18'));var utils=require(_0x2edc('0x19'));var config=require(_0x2edc('0x1a'));var licenseUtil=require(_0x2edc('0x1b'));var db=require(_0x2edc('0x1c'))['db'];function respondWithStatusCode(_0x1c40e0,_0x1f125b){_0x1f125b=_0x1f125b||0xcc;return function(_0x3aae16){if(_0x3aae16){return _0x1c40e0[_0x2edc('0x1d')](_0x1f125b);}return _0x1c40e0['status'](_0x1f125b)[_0x2edc('0x1e')]();};}function respondWithResult(_0x14f36d,_0x1be5ee){_0x1be5ee=_0x1be5ee||0xc8;return function(_0x56c90e){if(_0x56c90e){return _0x14f36d[_0x2edc('0x1f')](_0x1be5ee)[_0x2edc('0x20')](_0x56c90e);}};}function respondWithFilteredResult(_0x1905fc,_0x15c13b){return function(_0x3dcc08){if(_0x3dcc08){var _0x1f446b=typeof _0x15c13b['offset']===_0x2edc('0x21')&&typeof _0x15c13b[_0x2edc('0x22')]===_0x2edc('0x21');var _0xa37a41=_0x3dcc08[_0x2edc('0x23')];var _0x3f5985=_0x1f446b?0x0:_0x15c13b[_0x2edc('0x24')];var _0x437f35=_0x1f446b?_0x3dcc08['count']:_0x15c13b['offset']+_0x15c13b[_0x2edc('0x22')];var _0x4fa44c;if(_0x437f35>=_0xa37a41){_0x437f35=_0xa37a41;_0x4fa44c=0xc8;}else{_0x4fa44c=0xce;}_0x1905fc['status'](_0x4fa44c);return _0x1905fc[_0x2edc('0x25')](_0x2edc('0x26'),_0x3f5985+'-'+_0x437f35+'/'+_0xa37a41)['json'](_0x3dcc08);}return null;};}function patchUpdates(_0x4cdee7){return function(_0xd2d89d){try{jsonpatch['apply'](_0xd2d89d,_0x4cdee7,!![]);}catch(_0x2fa1d5){return BPromise[_0x2edc('0x27')](_0x2fa1d5);}return _0xd2d89d['save']();};}function saveUpdates(_0x18f892,_0x383630){return function(_0xd7be7b){if(_0xd7be7b){return _0xd7be7b[_0x2edc('0x28')](_0x18f892)[_0x2edc('0x29')](function(_0x2f6a70){return _0x2f6a70;});}return null;};}function removeEntity(_0x4a1da0,_0x2fac62){return function(_0x649471){if(_0x649471){return _0x649471[_0x2edc('0x2a')]()['then'](function(){_0x4a1da0[_0x2edc('0x1f')](0xcc)[_0x2edc('0x1e')]();});}};}function handleEntityNotFound(_0x46e563,_0x3eed82){return function(_0x51604e){if(!_0x51604e){_0x46e563[_0x2edc('0x1d')](0x194);}return _0x51604e;};}function handleError(_0x2ee101,_0x9d3d27){_0x9d3d27=_0x9d3d27||0x1f4;return function(_0x8ce343){logger[_0x2edc('0x2b')](_0x8ce343[_0x2edc('0x2c')]);if(_0x8ce343[_0x2edc('0x2d')]){delete _0x8ce343[_0x2edc('0x2d')];}_0x2ee101[_0x2edc('0x1f')](_0x9d3d27)[_0x2edc('0x2e')](_0x8ce343);};}exports[_0x2edc('0x2f')]=function(_0x2ccf1b,_0x338ef4){var _0x39ffee={},_0x9c1a1f={},_0x4b0d63={'count':0x0,'rows':[]};var _0x1d46aa=_[_0x2edc('0x30')](db['VoiceQueuesLog'][_0x2edc('0x31')],function(_0x5a034a){return{'name':_0x5a034a[_0x2edc('0x32')],'type':_0x5a034a[_0x2edc('0x33')][_0x2edc('0x34')]};});_0x9c1a1f[_0x2edc('0x35')]=_['map'](_0x1d46aa,_0x2edc('0x2d'));_0x9c1a1f['query']=_[_0x2edc('0x36')](_0x2ccf1b[_0x2edc('0x37')]);_0x9c1a1f[_0x2edc('0x38')]=_[_0x2edc('0x39')](_0x9c1a1f[_0x2edc('0x35')],_0x9c1a1f[_0x2edc('0x37')]);_0x39ffee['attributes']=_[_0x2edc('0x39')](_0x9c1a1f[_0x2edc('0x35')],qs[_0x2edc('0x3a')](_0x2ccf1b[_0x2edc('0x37')]['fields']));_0x39ffee['attributes']=_0x39ffee['attributes']['length']?_0x39ffee['attributes']:_0x9c1a1f['model'];if(!_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x3b')](_0x2edc('0x3c'))){_0x39ffee[_0x2edc('0x22')]=qs[_0x2edc('0x22')](_0x2ccf1b[_0x2edc('0x37')]['limit']);_0x39ffee[_0x2edc('0x24')]=qs[_0x2edc('0x24')](_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x24')]);}_0x39ffee[_0x2edc('0x3d')]=qs['sort'](_0x2ccf1b['query'][_0x2edc('0x3e')]);_0x39ffee['where']=qs[_0x2edc('0x38')](_['pick'](_0x2ccf1b[_0x2edc('0x37')],_0x9c1a1f['filters']),_0x1d46aa);if(_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x3f')]){_0x39ffee[_0x2edc('0x40')]=_[_0x2edc('0x41')](_0x39ffee[_0x2edc('0x40')],{'$or':_['map'](_0x1d46aa,function(_0x28184d){if(_0x28184d[_0x2edc('0x33')]!==_0x2edc('0x42')){var _0x5d9eb1={};_0x5d9eb1[_0x28184d[_0x2edc('0x2d')]]={'$like':'%'+_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x3f')]+'%'};return _0x5d9eb1;}})});}_0x39ffee=_[_0x2edc('0x41')]({},_0x39ffee,_0x2ccf1b['options']);var _0x1d95c5={'where':_0x39ffee[_0x2edc('0x40')]};return db[_0x2edc('0x43')]['count'](_0x1d95c5)[_0x2edc('0x29')](function(_0x549215){_0x4b0d63[_0x2edc('0x23')]=_0x549215;if(_0x2ccf1b[_0x2edc('0x37')][_0x2edc('0x44')]){_0x39ffee['include']=[{'all':!![]}];}return db[_0x2edc('0x43')]['findAll'](_0x39ffee);})['then'](function(_0x3695af){_0x4b0d63[_0x2edc('0x45')]=_0x3695af;return _0x4b0d63;})[_0x2edc('0x29')](respondWithFilteredResult(_0x338ef4,_0x39ffee))[_0x2edc('0x46')](handleError(_0x338ef4,null));};exports[_0x2edc('0x47')]=function(_0x55c945,_0x577799){var _0x5a3264={'raw':!![],'where':{'id':_0x55c945[_0x2edc('0x48')]['id']}},_0x2b9f2a={};_0x2b9f2a[_0x2edc('0x35')]=_[_0x2edc('0x36')](db[_0x2edc('0x43')][_0x2edc('0x31')]);_0x2b9f2a['query']=_[_0x2edc('0x36')](_0x55c945[_0x2edc('0x37')]);_0x2b9f2a[_0x2edc('0x38')]=_[_0x2edc('0x39')](_0x2b9f2a[_0x2edc('0x35')],_0x2b9f2a[_0x2edc('0x37')]);_0x5a3264[_0x2edc('0x49')]=_[_0x2edc('0x39')](_0x2b9f2a[_0x2edc('0x35')],qs[_0x2edc('0x3a')](_0x55c945['query']['fields']));_0x5a3264[_0x2edc('0x49')]=_0x5a3264[_0x2edc('0x49')][_0x2edc('0x4a')]?_0x5a3264['attributes']:_0x2b9f2a[_0x2edc('0x35')];if(_0x55c945['query'][_0x2edc('0x44')]){_0x5a3264['include']=[{'all':!![]}];}_0x5a3264=_['merge']({},_0x5a3264,_0x55c945[_0x2edc('0x4b')]);return db[_0x2edc('0x43')][_0x2edc('0x4c')](_0x5a3264)['then'](handleEntityNotFound(_0x577799,null))[_0x2edc('0x29')](respondWithResult(_0x577799,null))[_0x2edc('0x46')](handleError(_0x577799,null));};exports[_0x2edc('0x4d')]=function(_0x8b1683,_0x3ac6da){return db['VoiceQueuesLog'][_0x2edc('0x4d')](_0x8b1683[_0x2edc('0x4e')],{})[_0x2edc('0x29')](respondWithResult(_0x3ac6da,0xc9))['catch'](handleError(_0x3ac6da,null));};exports[_0x2edc('0x28')]=function(_0x1aabd7,_0x188270){if(_0x1aabd7[_0x2edc('0x4e')]['id']){delete _0x1aabd7[_0x2edc('0x4e')]['id'];}return db[_0x2edc('0x43')][_0x2edc('0x4c')]({'where':{'id':_0x1aabd7[_0x2edc('0x48')]['id']}})['then'](handleEntityNotFound(_0x188270,null))[_0x2edc('0x29')](saveUpdates(_0x1aabd7[_0x2edc('0x4e')],null))['then'](respondWithResult(_0x188270,null))[_0x2edc('0x46')](handleError(_0x188270,null));};exports[_0x2edc('0x2a')]=function(_0x3e2c19,_0x134160){return db[_0x2edc('0x43')]['find']({'where':{'id':_0x3e2c19['params']['id']}})[_0x2edc('0x29')](handleEntityNotFound(_0x134160,null))[_0x2edc('0x29')](removeEntity(_0x134160,null))[_0x2edc('0x46')](handleError(_0x134160,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index afb90b9..8cdfd45 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 _0x2efa=['path','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','moment','bluebird'];(function(_0x3b1bba,_0x220536){var _0x4ca374=function(_0xaec05b){while(--_0xaec05b){_0x3b1bba['push'](_0x3b1bba['shift']());}};_0x4ca374(++_0x220536);}(_0x2efa,0x141));var _0xa2ef=function(_0x2b3512,_0x4c739a){_0x2b3512=_0x2b3512-0x0;var _0x29cf1d=_0x2efa[_0x2b3512];return _0x29cf1d;};'use strict';var _=require(_0xa2ef('0x0'));var util=require('util');var logger=require(_0xa2ef('0x1'))('api');var moment=require(_0xa2ef('0x2'));var BPromise=require(_0xa2ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2ef('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa2ef('0x5'));module[_0xa2ef('0x6')]=function(_0x315d81,_0x3e53a6){return _0x315d81[_0xa2ef('0x7')](_0xa2ef('0x8'),attributes,{'tableName':_0xa2ef('0x9'),'paranoid':![],'indexes':[{'name':_0xa2ef('0xa'),'fields':[_0xa2ef('0xb'),_0xa2ef('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xfc1e=['event','dtm','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x49d52e,_0x9dcd95){var _0x187bc1=function(_0x1d2e8c){while(--_0x1d2e8c){_0x49d52e['push'](_0x49d52e['shift']());}};_0x187bc1(++_0x9dcd95);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xfc1e[_0x4f431d];return _0x4f31e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xefc1('0x0'));var moment=require(_0xefc1('0x1'));var BPromise=require(_0xefc1('0x2'));var rp=require(_0xefc1('0x3'));var fs=require('fs');var path=require(_0xefc1('0x4'));var rimraf=require('rimraf');var config=require(_0xefc1('0x5'));var attributes=require(_0xefc1('0x6'));module['exports']=function(_0x4fc84b,_0x32de5b){return _0x4fc84b[_0xefc1('0x7')](_0xefc1('0x8'),attributes,{'tableName':_0xefc1('0x9'),'paranoid':![],'indexes':[{'name':_0xefc1('0xa'),'fields':[_0xefc1('0xb'),_0xefc1('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 93e3dfc..8c8ef33 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 _0xf4a5=['code','message','result','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5228e2,_0x232eeb){var _0x1c7aec=function(_0x3dee85){while(--_0x3dee85){_0x5228e2['push'](_0x5228e2['shift']());}};_0x1c7aec(++_0x232eeb);}(_0xf4a5,0x143));var _0x5f4a=function(_0x306866,_0x458846){_0x306866=_0x306866-0x0;var _0xa84353=_0xf4a5[_0x306866];return _0xa84353;};'use strict';var _=require(_0x5f4a('0x0'));var util=require(_0x5f4a('0x1'));var moment=require('moment');var BPromise=require(_0x5f4a('0x2'));var rs=require(_0x5f4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f4a('0x4'));var logger=require('../../config/logger')(_0x5f4a('0x5'));var config=require('../../config/environment');var jayson=require(_0x5f4a('0x6'));var client=jayson['client'][_0x5f4a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc0907d,_0x5115ae,_0xd42b36){return new BPromise(function(_0x54b651,_0x3c5912){return client[_0x5f4a('0x8')](_0xc0907d,_0xd42b36)[_0x5f4a('0x9')](function(_0x48e735){logger[_0x5f4a('0xa')](_0x5f4a('0xb'),_0x5115ae,_0x5f4a('0xc'));logger[_0x5f4a('0xd')](_0x5f4a('0xe'),_0x5115ae,_0x5f4a('0xc'),JSON[_0x5f4a('0xf')](_0x48e735));if(_0x48e735[_0x5f4a('0x10')]){if(_0x48e735['error'][_0x5f4a('0x11')]===0x1f4){logger['error'](_0x5f4a('0xb'),_0x5115ae,_0x48e735[_0x5f4a('0x10')][_0x5f4a('0x12')]);return _0x3c5912(_0x48e735[_0x5f4a('0x10')][_0x5f4a('0x12')]);}logger[_0x5f4a('0x10')](_0x5f4a('0xb'),_0x5115ae,_0x48e735[_0x5f4a('0x10')][_0x5f4a('0x12')]);return _0x54b651(_0x48e735[_0x5f4a('0x10')][_0x5f4a('0x12')]);}else{logger[_0x5f4a('0xa')](_0x5f4a('0xb'),_0x5115ae,_0x5f4a('0xc'));_0x54b651(_0x48e735[_0x5f4a('0x13')]['message']);}})['catch'](function(_0x411897){logger[_0x5f4a('0x10')](_0x5f4a('0xb'),_0x5115ae,_0x411897);_0x3c5912(_0x411897);});});} \ No newline at end of file +var _0x5ec6=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug'];(function(_0x508426,_0x4ade28){var _0x4469f6=function(_0x4412c2){while(--_0x4412c2){_0x508426['push'](_0x508426['shift']());}};_0x4469f6(++_0x4ade28);}(_0x5ec6,0x7f));var _0x65ec=function(_0x4f880b,_0x21fa3d){_0x4f880b=_0x4f880b-0x0;var _0x422222=_0x5ec6[_0x4f880b];return _0x422222;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index dec8550..eb017d8 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 _0x37ff=['isAuthenticated','index','/describe','describe','get','/:id','/:id/download','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37ff,0x1ca));var _0xf37f=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x37ff[_0x38987f];return _0x4cb697;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf37f('0x0')]();var fs_extra=require(_0xf37f('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xf37f('0x2'));var config=require('../../config/environment');var controller=require(_0xf37f('0x3'));router['get']('/',auth[_0xf37f('0x4')](),controller[_0xf37f('0x5')]);router['get'](_0xf37f('0x6'),auth['isAuthenticated'](),controller[_0xf37f('0x7')]);router[_0xf37f('0x8')](_0xf37f('0x9'),auth[_0xf37f('0x4')](),controller['show']);router[_0xf37f('0x8')](_0xf37f('0xa'),auth[_0xf37f('0x4')](),controller['download']);router[_0xf37f('0x8')]('/:id/downloads',controller[_0xf37f('0xb')]);router[_0xf37f('0x8')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xf37f('0xc')]);router[_0xf37f('0xd')]('/',auth[_0xf37f('0x4')](),controller[_0xf37f('0xe')]);router[_0xf37f('0xd')](_0xf37f('0xf'),auth[_0xf37f('0x4')](),controller[_0xf37f('0x10')]);router[_0xf37f('0x11')](_0xf37f('0x9'),auth['isAuthenticated'](),controller[_0xf37f('0x12')]);router[_0xf37f('0x13')](_0xf37f('0x9'),auth[_0xf37f('0x4')](),controller['destroy']);module[_0xf37f('0x14')]=router; \ No newline at end of file +var _0x268e=['isAuthenticated','index','/describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x23b4d2,_0xa0d574){var _0x178075=function(_0x9f1520){while(--_0x9f1520){_0x23b4d2['push'](_0x23b4d2['shift']());}};_0x178075(++_0xa0d574);}(_0x268e,0x1d0));var _0xe268=function(_0x136b44,_0x4589c8){_0x136b44=_0x136b44-0x0;var _0x574ddd=_0x268e[_0x136b44];return _0x574ddd;};'use strict';var multer=require(_0xe268('0x0'));var util=require(_0xe268('0x1'));var path=require(_0xe268('0x2'));var timeout=require(_0xe268('0x3'));var express=require(_0xe268('0x4'));var router=express[_0xe268('0x5')]();var fs_extra=require(_0xe268('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe268('0x7'));var config=require(_0xe268('0x8'));var controller=require(_0xe268('0x9'));router[_0xe268('0xa')]('/',auth[_0xe268('0xb')](),controller[_0xe268('0xc')]);router['get'](_0xe268('0xd'),auth[_0xe268('0xb')](),controller['describe']);router['get']('/:id',auth[_0xe268('0xb')](),controller[_0xe268('0xe')]);router[_0xe268('0xa')](_0xe268('0xf'),auth['isAuthenticated'](),controller[_0xe268('0x10')]);router['get'](_0xe268('0x11'),controller[_0xe268('0x12')]);router[_0xe268('0xa')](_0xe268('0x13'),auth[_0xe268('0xb')](),controller['downloadTranscribe']);router[_0xe268('0x14')]('/',auth[_0xe268('0xb')](),controller['create']);router[_0xe268('0x14')](_0xe268('0x13'),auth[_0xe268('0xb')](),controller[_0xe268('0x15')]);router['put']('/:id',auth[_0xe268('0xb')](),controller[_0xe268('0x16')]);router[_0xe268('0x17')]('/:id',auth[_0xe268('0xb')](),controller[_0xe268('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 9869119..4ef47b6 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 b5833cd..811e496 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 _0x27c6=['nolimit','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','intersection','find','create','params','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','secrets','recording','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','data1','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','error','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','name','format','query','keys','filters','attributes','fields','length','hasOwnProperty'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x27c6,0x188));var _0x627c=function(_0x1cfb67,_0x1be621){_0x1cfb67=_0x1cfb67-0x0;var _0x5b28b0=_0x27c6[_0x1cfb67];return _0x5b28b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x627c('0x0'));var zipdir=require(_0x627c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x627c('0x2'));var moment=require(_0x627c('0x3'));var BPromise=require(_0x627c('0x4'));var Mustache=require(_0x627c('0x5'));var util=require(_0x627c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x627c('0x7'));var fs=require('fs');var fs_extra=require(_0x627c('0x8'));var _=require(_0x627c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x627c('0xa'));var deskjs=require(_0x627c('0xb'));var toCsv=require(_0x627c('0xc'));var querystring=require(_0x627c('0xd'));var Papa=require(_0x627c('0xe'));var AWS=require(_0x627c('0xf'));var uuidv4=require(_0x627c('0x10'));var Redis=require(_0x627c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x627c('0x12'));var as=require(_0x627c('0x13'));var hardwareService=require(_0x627c('0x14'));var logger=require(_0x627c('0x15'))(_0x627c('0x16'));var utils=require('../../config/utils');var config=require(_0x627c('0x17'));var licenseUtil=require(_0x627c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1deb36,_0x643f66){_0x643f66=_0x643f66||0xcc;return function(_0x4d5c2c){if(_0x4d5c2c){return _0x1deb36['sendStatus'](_0x643f66);}return _0x1deb36[_0x627c('0x19')](_0x643f66)[_0x627c('0x1a')]();};}function respondWithResult(_0x16b183,_0x5dbe2f){_0x5dbe2f=_0x5dbe2f||0xc8;return function(_0x42fc1e){if(_0x42fc1e){return _0x16b183['status'](_0x5dbe2f)[_0x627c('0x1b')](_0x42fc1e);}};}function respondWithFilteredResult(_0x249534,_0x21d293){return function(_0x154fc5){if(_0x154fc5){var _0x560189=typeof _0x21d293['offset']===_0x627c('0x1c')&&typeof _0x21d293['limit']===_0x627c('0x1c');var _0x3a76ec=_0x154fc5[_0x627c('0x1d')];var _0x3f7008=_0x560189?0x0:_0x21d293[_0x627c('0x1e')];var _0x390ca7=_0x560189?_0x154fc5['count']:_0x21d293[_0x627c('0x1e')]+_0x21d293[_0x627c('0x1f')];var _0x40e519;if(_0x390ca7>=_0x3a76ec){_0x390ca7=_0x3a76ec;_0x40e519=0xc8;}else{_0x40e519=0xce;}_0x249534[_0x627c('0x19')](_0x40e519);return _0x249534['set'](_0x627c('0x20'),_0x3f7008+'-'+_0x390ca7+'/'+_0x3a76ec)['json'](_0x154fc5);}return null;};}function patchUpdates(_0x83615f){return function(_0x42acda){try{jsonpatch[_0x627c('0x21')](_0x42acda,_0x83615f,!![]);}catch(_0x491e06){return BPromise[_0x627c('0x22')](_0x491e06);}return _0x42acda[_0x627c('0x23')]();};}function saveUpdates(_0x48679d,_0x15770c){return function(_0x463b56){if(_0x463b56){return _0x463b56[_0x627c('0x24')](_0x48679d)['then'](function(_0x43b0d0){return _0x43b0d0;});}return null;};}function removeEntity(_0x40b64f,_0x70e3b4){return function(_0x132ce4){if(_0x132ce4){return _0x132ce4[_0x627c('0x25')]()['then'](function(){_0x40b64f[_0x627c('0x19')](0xcc)[_0x627c('0x1a')]();});}};}function handleEntityNotFound(_0x348b8c,_0x2b5114){return function(_0x2f66bf){if(!_0x2f66bf){_0x348b8c['sendStatus'](0x194);}return _0x2f66bf;};}function handleError(_0x5dc2fc,_0x4b00b0){_0x4b00b0=_0x4b00b0||0x1f4;return function(_0xa1acd4){logger[_0x627c('0x26')](_0xa1acd4['stack']);if(_0xa1acd4['name']){delete _0xa1acd4['name'];}_0x5dc2fc[_0x627c('0x19')](_0x4b00b0)[_0x627c('0x27')](_0xa1acd4);};}exports[_0x627c('0x28')]=function(_0x538338,_0x597fa7){var _0xfa63f0={},_0x246328={},_0x5bea1f={'count':0x0,'rows':[]};var _0x2b9a76=_[_0x627c('0x29')](db[_0x627c('0x2a')][_0x627c('0x2b')],function(_0x4a2213){return{'name':_0x4a2213[_0x627c('0x2c')],'type':_0x4a2213[_0x627c('0x2d')][_0x627c('0x2e')]};});_0x246328[_0x627c('0x2f')]=_[_0x627c('0x30')](_['map'](_0x2b9a76,_0x627c('0x31')),[_0x627c('0x32')]);_0x246328[_0x627c('0x33')]=_[_0x627c('0x34')](_0x538338['query']);_0x246328[_0x627c('0x35')]=_['intersection'](_0x246328[_0x627c('0x2f')],_0x246328[_0x627c('0x33')]);_0xfa63f0[_0x627c('0x36')]=_['intersection'](_0x246328[_0x627c('0x2f')],qs[_0x627c('0x37')](_0x538338['query'][_0x627c('0x37')]));_0xfa63f0[_0x627c('0x36')]=_0xfa63f0[_0x627c('0x36')][_0x627c('0x38')]?_0xfa63f0[_0x627c('0x36')]:_0x246328['model'];if(!_0x538338['query'][_0x627c('0x39')](_0x627c('0x3a'))){_0xfa63f0[_0x627c('0x1f')]=qs['limit'](_0x538338[_0x627c('0x33')]['limit']);_0xfa63f0[_0x627c('0x1e')]=qs['offset'](_0x538338[_0x627c('0x33')][_0x627c('0x1e')]);}_0xfa63f0['order']=qs['sort'](_0x538338[_0x627c('0x33')]['sort']);_0xfa63f0[_0x627c('0x3b')]=qs['filters'](_['pick'](_0x538338[_0x627c('0x33')],_0x246328[_0x627c('0x35')]),_0x2b9a76);if(_0x538338[_0x627c('0x33')][_0x627c('0x3c')]){_0xfa63f0['where']=_[_0x627c('0x3d')](_0xfa63f0[_0x627c('0x3b')],{'$or':_[_0x627c('0x29')](_0x2b9a76,function(_0x309d2b){if(_0x309d2b['type']!==_0x627c('0x3e')){var _0x285ca0={};_0x285ca0[_0x309d2b['name']]={'$like':'%'+_0x538338[_0x627c('0x33')][_0x627c('0x3c')]+'%'};return _0x285ca0;}})});}_0xfa63f0=_[_0x627c('0x3d')]({},_0xfa63f0,_0x538338[_0x627c('0x3f')]);var _0x2de666={'where':_0xfa63f0['where']};return db[_0x627c('0x2a')][_0x627c('0x1d')](_0x2de666)[_0x627c('0x40')](function(_0x582554){_0x5bea1f[_0x627c('0x1d')]=_0x582554;if(_0x538338[_0x627c('0x33')][_0x627c('0x41')]){_0xfa63f0[_0x627c('0x42')]=[{'all':!![]}];}return db[_0x627c('0x2a')][_0x627c('0x43')](_0xfa63f0);})[_0x627c('0x40')](function(_0x3b48d9){_0x5bea1f[_0x627c('0x44')]=_0x3b48d9;return _0x5bea1f;})[_0x627c('0x40')](respondWithFilteredResult(_0x597fa7,_0xfa63f0))[_0x627c('0x45')](handleError(_0x597fa7,null));};exports[_0x627c('0x46')]=function(_0x545cfe,_0x4774d3){var _0x5aa622={'raw':![],'where':{'id':_0x545cfe['params']['id']}},_0x712214={};_0x712214['model']=_[_0x627c('0x34')](db['VoiceRecording'][_0x627c('0x2b')]);_0x712214[_0x627c('0x33')]=_['keys'](_0x545cfe[_0x627c('0x33')]);_0x712214[_0x627c('0x35')]=_[_0x627c('0x47')](_0x712214[_0x627c('0x2f')],_0x712214['query']);_0x5aa622[_0x627c('0x36')]=_[_0x627c('0x47')](_0x712214[_0x627c('0x2f')],qs[_0x627c('0x37')](_0x545cfe['query'][_0x627c('0x37')]));_0x5aa622[_0x627c('0x36')]=_0x5aa622[_0x627c('0x36')][_0x627c('0x38')]?_0x5aa622[_0x627c('0x36')]:_0x712214['model'];if(_0x545cfe[_0x627c('0x33')][_0x627c('0x41')]){_0x5aa622[_0x627c('0x42')]=[{'all':!![]}];}_0x5aa622=_['merge']({},_0x5aa622,_0x545cfe[_0x627c('0x3f')]);return db[_0x627c('0x2a')][_0x627c('0x48')](_0x5aa622)[_0x627c('0x40')](handleEntityNotFound(_0x4774d3,null))['then'](respondWithResult(_0x4774d3,null))[_0x627c('0x45')](handleError(_0x4774d3,null));};exports[_0x627c('0x49')]=function(_0x3cff16,_0x22ffa8){return db[_0x627c('0x2a')]['create'](_0x3cff16['body'],{})['then'](respondWithResult(_0x22ffa8,0xc9))[_0x627c('0x45')](handleError(_0x22ffa8,null));};exports[_0x627c('0x24')]=function(_0xf95411,_0xa41e5e){if(_0xf95411['body']['id']){delete _0xf95411['body']['id'];}return db[_0x627c('0x2a')]['find']({'where':{'id':_0xf95411[_0x627c('0x4a')]['id']}})[_0x627c('0x40')](handleEntityNotFound(_0xa41e5e,null))[_0x627c('0x40')](saveUpdates(_0xf95411[_0x627c('0x4b')],null))[_0x627c('0x40')](respondWithResult(_0xa41e5e,null))[_0x627c('0x45')](handleError(_0xa41e5e,null));};exports[_0x627c('0x4c')]=function(_0x5ae9f8,_0x458c6a){return db[_0x627c('0x2a')]['describe']()[_0x627c('0x40')](respondWithResult(_0x458c6a,null))[_0x627c('0x45')](handleError(_0x458c6a,null));};exports[_0x627c('0x4d')]=function(_0x545807,_0x6e6fe1,_0x146776){var _0x424dce=require(_0x627c('0x4e'));var _0xceef9d=![];var _0x4ab88b={};if(_0x545807['query'][_0x627c('0x2d')]&&_0x545807[_0x627c('0x33')]['type']===_0x627c('0x4f')){_0x4ab88b[_0x627c('0x4f')]=_0x545807['params']['id'];}else{_0x4ab88b['id']=_0x545807['params']['id'];}return db[_0x627c('0x2a')][_0x627c('0x48')]({'where':_0x4ab88b,'attributes':['id',_0x627c('0x50')],'raw':!![]})[_0x627c('0x40')](handleEntityNotFound(_0x6e6fe1,null))[_0x627c('0x40')](function(_0x20048c){if(_0x20048c){var _0x283112=_0x20048c[_0x627c('0x50')];var _0x2250b1=util['format'](_0x627c('0x51'),_0x283112);if(fs[_0x627c('0x52')](_0x2250b1)){_0xceef9d=!![];return _0x424dce['decryptFile'](_0x2250b1,_0x283112,config['secrets']['recording'])['then'](function(){return _0x20048c;});}return _0x20048c;}})[_0x627c('0x40')](function(_0x3137e7){if(_0x3137e7){var _0x337fa1=_0x3137e7[_0x627c('0x50')];if(!fs['existsSync'](_0x337fa1)){throw new db['Sequelize'][(_0x627c('0x53'))](_0x627c('0x54'));}if(_0x3137e7[_0x627c('0x55')]){return _0x6e6fe1[_0x627c('0x4d')](_0x337fa1,_0x3137e7[_0x627c('0x55')]+path[_0x627c('0x56')](_0x337fa1),function(){if(_0xceef9d){fs[_0x627c('0x57')](_0x337fa1);}});}else{return _0x6e6fe1['download'](_0x337fa1,function(_0x7224be){if(_0xceef9d){fs[_0x627c('0x57')](_0x337fa1);}});}}})[_0x627c('0x45')](function(_0x2a6a44){if(_0x2a6a44[_0x627c('0x58')]==='VoiceRecording\x20not\x20found'){_0x6e6fe1[_0x627c('0x19')](0x194)[_0x627c('0x27')](_0x627c('0x59'));}else{return handleError(_0x6e6fe1,null);}});};exports[_0x627c('0x5a')]=function(_0xf63461,_0x4e56fd,_0x26702b){var _0x5c40d8=require(_0x627c('0x4e'));var _0x5c4196=![];var _0x12b5ac={'$and':[db['sequelize'][_0x627c('0x3b')](db[_0x627c('0x5b')]['fn'](_0x627c('0x5c'),db['sequelize'][_0x627c('0x5d')](_0x627c('0x4f'))),_0xf63461[_0x627c('0x33')][_0x627c('0x5e')])]};if(_0xf63461[_0x627c('0x33')][_0x627c('0x2d')]&&_0xf63461[_0x627c('0x33')][_0x627c('0x2d')]===_0x627c('0x4f')){_0x12b5ac['$and']['push']({'uniqueid':_0xf63461[_0x627c('0x4a')]['id']});}else{_0x12b5ac[_0x627c('0x5f')][_0x627c('0x60')]({'id':_0xf63461['params']['id']});}return db[_0x627c('0x2a')][_0x627c('0x48')]({'where':_0x12b5ac,'attributes':['id',_0x627c('0x50')],'raw':!![]})[_0x627c('0x40')](handleEntityNotFound(_0x4e56fd,null))[_0x627c('0x40')](function(_0x559949){if(_0x559949){var _0x5b073c=util[_0x627c('0x32')](_0x627c('0x51'),_0x559949[_0x627c('0x50')]);if(fs[_0x627c('0x52')](_0x5b073c)){_0x5c4196=!![];return _0x5c40d8[_0x627c('0x61')](_0x5b073c,_0x559949[_0x627c('0x50')],config[_0x627c('0x62')][_0x627c('0x63')])[_0x627c('0x40')](function(){return _0x559949;});}return _0x559949;}})[_0x627c('0x40')](function(_0x363e9f){if(_0x363e9f){if(!fs[_0x627c('0x52')](_0x363e9f[_0x627c('0x50')])){throw new db[(_0x627c('0x64'))][(_0x627c('0x53'))](_0x627c('0x54'));}if(_0x363e9f['filename']){return _0x4e56fd[_0x627c('0x4d')](_0x363e9f['value'],_0x363e9f[_0x627c('0x55')]+path['extname'](_0x363e9f[_0x627c('0x50')]),function(){if(_0x5c4196){fs[_0x627c('0x57')](_0x363e9f[_0x627c('0x50')]);}});}else{return _0x4e56fd[_0x627c('0x4d')](_0x363e9f[_0x627c('0x50')],function(_0x1db8a9){if(_0x5c4196){fs['unlink'](_0x363e9f[_0x627c('0x50')]);}});}}})['catch'](handleError(_0x4e56fd,null));};exports[_0x627c('0x25')]=function(_0x18737c,_0x5d8222){return db[_0x627c('0x2a')][_0x627c('0x48')]({'where':{'id':_0x18737c[_0x627c('0x4a')]['id']}})['then'](function(_0x3d82e9){if(_[_0x627c('0x65')](_0x3d82e9)){throw new ReferenceError(_0x627c('0x66'));}return _0x3d82e9;})[_0x627c('0x40')](function(_0x578065){var _0x47cd2d=_0x578065[_0x627c('0x50')];logger[_0x627c('0x67')](_0x627c('0x68'),_0x47cd2d);if(!_['isNil'](_0x578065[_0x627c('0x50')])&&fs[_0x627c('0x52')](_0x47cd2d)){logger[_0x627c('0x67')]('File:\x20\x22'+_0x47cd2d+_0x627c('0x69'));fs[_0x627c('0x6a')](_0x47cd2d);}_0x47cd2d=_0x47cd2d+_0x627c('0x6b');if(!_[_0x627c('0x65')](_0x578065['value'])&&fs[_0x627c('0x52')](_0x47cd2d)){logger[_0x627c('0x67')](_0x627c('0x6c')+_0x47cd2d+_0x627c('0x69'));fs[_0x627c('0x6a')](_0x47cd2d);}return _0x578065;})[_0x627c('0x40')](function(_0x2cb30c){if(!_0x2cb30c)throw new InternalError();return _0x2cb30c[_0x627c('0x25')]();})[_0x627c('0x40')](function(){_0x5d8222[_0x627c('0x19')](0xcc)['end']();})[_0x627c('0x45')](handleError(_0x5d8222,null));};function getBucketslist(_0x4b5186,_0x4e8b2f,_0x4638e6){return new Promise(function(_0xbdb977,_0x5c805a){var _0xdf9a9f=new AWS['S3']({'accessKeyId':_0x4e8b2f,'secretAccessKey':_0x4b5186,'region':_0x4638e6});_0xdf9a9f['listBuckets']({},function(_0x122f16,_0x26f12f){if(_0x122f16){return _0x5c805a(_0x122f16);}else{return _0xbdb977(_0x26f12f);}});});}function createBucket(_0x4f7362,_0x1430bb,_0x575e7e,_0x53c25e){return new Promise(function(_0x22eac6,_0x388fc5){var _0x3d2c0b=new AWS['S3']({'accessKeyId':_0x1430bb,'secretAccessKey':_0x4f7362,'region':_0x575e7e});_0x3d2c0b[_0x627c('0x6d')]({'Bucket':_0x53c25e},function(_0xbc3ddb,_0x57d225){if(_0xbc3ddb){return _0x388fc5(_0xbc3ddb);}else{return _0x22eac6(_0x57d225);}});});}function uploadFile(_0x46a513,_0x176439,_0x50443c,_0x2f700b,_0x2a3830,_0x183745){return new Promise(function(_0x4ea61e,_0x89aad8){var _0x423e40=new AWS['S3']({'accessKeyId':_0x176439,'secretAccessKey':_0x46a513,'region':_0x50443c});_0x423e40[_0x627c('0x6e')]({'Bucket':_0x2f700b,'Key':_0x2a3830,'Body':_0x183745},function(_0x27b5b5,_0x90135){if(_0x27b5b5){return _0x89aad8(_0x27b5b5);}else{return _0x4ea61e(_0x90135);}});});}function startTranscribe(_0x2ed836,_0x4bc90d,_0x3f518a,_0x87bf0a,_0x1fb6af,_0x31f2f8){return new Promise(function(_0x378381,_0x31130d){var _0x38c43a=new AWS[(_0x627c('0x6f'))]({'accessKeyId':_0x4bc90d,'secretAccessKey':_0x2ed836,'region':_0x3f518a});_0x38c43a[_0x627c('0x70')]({'TranscriptionJobName':_0x87bf0a,'LanguageCode':_0x1fb6af,'Media':{'MediaFileUri':_0x31f2f8}},function(_0x41965b,_0x2817b8){if(_0x41965b){return _0x31130d(_0x41965b);}else{return _0x378381(_0x2817b8);}});});}function transcribe(_0x444c64,_0x1f7e6f,_0x149605,_0xc81a8e,_0x4de469,_0x472000,_0xb49e2d){return new Promise(function(_0x3cee26,_0x1c5e91){var _0x46d30d={};logger[_0x627c('0x67')](util[_0x627c('0x32')](_0x627c('0x71'),_0x444c64,_0x4de469));return uploadFile(_0x1f7e6f,_0x149605,_0xc81a8e,_0x4de469,path['basename'](_0x472000),fs[_0x627c('0x72')](_0x472000))['then'](function(_0x5ba242){logger[_0x627c('0x67')](util[_0x627c('0x32')](_0x627c('0x73'),_0x444c64,_0x4de469,_0x5ba242[_0x627c('0x74')]));_0x46d30d['bucket']=_0x5ba242[_0x627c('0x75')];_0x46d30d[_0x627c('0x76')]=_0x5ba242[_0x627c('0x74')];logger[_0x627c('0x67')](util[_0x627c('0x32')](_0x627c('0x77'),_0x444c64));return startTranscribe(_0x1f7e6f,_0x149605,_0xc81a8e,uuidv4(),_0xb49e2d,_0x5ba242[_0x627c('0x74')]);})['then'](function(_0x1dbfee){logger[_0x627c('0x67')](util[_0x627c('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x444c64,_0x1dbfee['TranscriptionJob'][_0x627c('0x78')]));_0x46d30d[_0x627c('0x79')]=_0x1dbfee[_0x627c('0x7a')][_0x627c('0x78')];_0x46d30d[_0x627c('0x7b')]=_0x1dbfee[_0x627c('0x7a')]['TranscriptionJobStatus'];return _0x3cee26(_0x46d30d);})[_0x627c('0x45')](function(_0x4d93c7){return _0x1c5e91(_0x4d93c7);});});}exports[_0x627c('0x7c')]=function(_0x217977,_0x22e3d5,_0x175c7b){var _0x1deb54;var _0x372dbf;var _0x4a9924;var _0x169059=require(_0x627c('0x4e'));return db[_0x627c('0x2a')]['findOne']({'where':{'id':_0x217977[_0x627c('0x4a')]['id']}})['then'](function(_0x4a8f48){if(_0x4a8f48){var _0x3dfc6f=util['format'](_0x627c('0x51'),_0x4a8f48[_0x627c('0x50')]);if(fs[_0x627c('0x52')](_0x3dfc6f)){cypher=!![];return _0x169059[_0x627c('0x61')](_0x3dfc6f,_0x4a8f48[_0x627c('0x50')],config[_0x627c('0x62')]['recording'])['then'](function(){return _0x4a8f48;});}return _0x4a8f48;}})[_0x627c('0x40')](function(_0x29eaae){if(!_0x29eaae){throw new db['Sequelize'][(_0x627c('0x53'))](_0x627c('0x7d'));}_0x372dbf=_0x29eaae;return db['Setting'][_0x627c('0x7e')]({'where':{'id':0x1}});})[_0x627c('0x40')](handleEntityNotFound(_0x22e3d5,null))['then'](function(_0xb7866){if(_0xb7866){_0x1deb54=_0xb7866;if(!_0x1deb54['transcribe']||!_0x1deb54[_0x627c('0x7f')]||!_0x1deb54[_0x627c('0x80')]||!_0x1deb54['language']||!_0x1deb54['bucket']){throw new db[(_0x627c('0x64'))]['ValidationError'](_0x627c('0x81'));}if(_0x217977[_0x627c('0x4b')][_0x627c('0x82')]&&(!_0x1deb54[_0x627c('0x83')]||!_0x1deb54[_0x627c('0x84')]||!_0x1deb54[_0x627c('0x85')]||!_0x1deb54['language']||!_0x1deb54[_0x627c('0x86')])){throw new db[(_0x627c('0x64'))][(_0x627c('0x53'))](_0x627c('0x87'));}return db['CloudProvider'][_0x627c('0x7e')]({'where':{'id':_0x1deb54[_0x627c('0x7f')]}});}})[_0x627c('0x40')](function(_0x18dc63){if(!_0x18dc63){throw new db['Sequelize'][(_0x627c('0x53'))](_0x627c('0x88'));}if(!_0x18dc63['data1']||!_0x18dc63[_0x627c('0x89')]){throw new db[(_0x627c('0x64'))]['ValidationError'](_0x627c('0x8a'));}_0x4a9924=_0x18dc63;return getBucketslist(_0x4a9924['data1'],_0x4a9924[_0x627c('0x89')],_0x1deb54[_0x627c('0x80')]);})[_0x627c('0x40')](function(_0x4e2808){if(_0x4e2808&&_0x4e2808['Buckets']){var _0x24edab=_[_0x627c('0x48')](_0x4e2808[_0x627c('0x8b')],function(_0x2b157a){return _0x2b157a['Name']===_0x1deb54[_0x627c('0x86')];});if(!_0x24edab){logger[_0x627c('0x67')](util[_0x627c('0x32')](_0x627c('0x8c'),_0x217977[_0x627c('0x4a')]['id'],_0x1deb54[_0x627c('0x86')]));return createBucket(_0x4a9924['data1'],_0x4a9924[_0x627c('0x89')],_0x1deb54[_0x627c('0x80')],_0x1deb54[_0x627c('0x86')]);}logger['info'](util['format'](_0x627c('0x8d'),_0x217977['params']['id'],_0x1deb54['bucket']));return;}})['then'](function(_0x4b0023){if(_0x372dbf[_0x627c('0x7b')]===_0x627c('0x8e')){return transcribe(_0x217977['params']['id'],_0x4a9924[_0x627c('0x8f')],_0x4a9924['data2'],_0x1deb54[_0x627c('0x80')],_0x1deb54[_0x627c('0x86')],_0x372dbf[_0x627c('0x50')],_0x1deb54['language']);}else{logger['info'](util[_0x627c('0x32')](_0x627c('0x90'),_0x217977[_0x627c('0x4a')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x627c('0x40')](function(_0x34989a){if(_0x34989a){_0x34989a['tempSentiment']=_0x217977['body'][_0x627c('0x82')];return _0x372dbf['updateAttributes'](_0x34989a);}})[_0x627c('0x40')](respondWithResult(_0x22e3d5,null))['catch'](handleError(_0x22e3d5,null));};function writeFile(_0x124e8c,_0x259c24){return new Promise(function(_0x2b0206,_0x5761f0){fs['writeFile'](_0x259c24,_0x124e8c,function(_0x1fde5b,_0xd0a6d7){if(_0x1fde5b){return _0x5761f0(_0x1fde5b);}else{return _0x2b0206(_0xd0a6d7);}});});}exports[_0x627c('0x91')]=function(_0x33a9e0,_0x532689,_0x1eed44){return db[_0x627c('0x2a')]['findOne']({'where':{'id':_0x33a9e0[_0x627c('0x4a')]['id']}})[_0x627c('0x40')](handleEntityNotFound(_0x532689))[_0x627c('0x40')](function(_0x32aab9){if(_0x32aab9&&_0x32aab9[_0x627c('0x92')]){var _0x1ba28d=_0x32aab9['fileText'];var _0x448818=config[_0x627c('0x93')]+'/server/files/transcribes/transcribe_'+_0x32aab9['id']+_0x627c('0x94');if(fs[_0x627c('0x52')](_0x448818)){return _0x448818;}return writeFile(_0x1ba28d,_0x448818)[_0x627c('0x40')](function(){return _0x448818;});}else{throw new db[(_0x627c('0x64'))][(_0x627c('0x53'))](_0x627c('0x95'));}})[_0x627c('0x40')](function(_0xc5da90){return _0x532689[_0x627c('0x4d')](_0xc5da90);})[_0x627c('0x45')](handleError(_0x532689));}; \ No newline at end of file +var _0x967b=['[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','query','filters','model','attributes','fields','length','hasOwnProperty','sort','pick','where','VIRTUAL','filter','options','include','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','format','ValidationError','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location'];(function(_0x331c1e,_0x337bc7){var _0x11feea=function(_0x27c013){while(--_0x27c013){_0x331c1e['push'](_0x331c1e['shift']());}};_0x11feea(++_0x337bc7);}(_0x967b,0xb4));var _0xb967=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x967b[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb967('0x0'));var zipdir=require(_0xb967('0x1'));var jsonpatch=require(_0xb967('0x2'));var rp=require(_0xb967('0x3'));var moment=require(_0xb967('0x4'));var BPromise=require(_0xb967('0x5'));var Mustache=require(_0xb967('0x6'));var util=require(_0xb967('0x7'));var path=require(_0xb967('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb967('0x9'));var _=require(_0xb967('0xa'));var squel=require(_0xb967('0xb'));var crypto=require(_0xb967('0xc'));var jsforce=require(_0xb967('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb967('0xe'));var Papa=require(_0xb967('0xf'));var AWS=require(_0xb967('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xb967('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb967('0x12'));var logger=require(_0xb967('0x13'))(_0xb967('0x14'));var utils=require(_0xb967('0x15'));var config=require(_0xb967('0x16'));var licenseUtil=require(_0xb967('0x17'));var db=require(_0xb967('0x18'))['db'];function respondWithStatusCode(_0x22db59,_0x58fe27){_0x58fe27=_0x58fe27||0xcc;return function(_0x2fcd4f){if(_0x2fcd4f){return _0x22db59[_0xb967('0x19')](_0x58fe27);}return _0x22db59[_0xb967('0x1a')](_0x58fe27)[_0xb967('0x1b')]();};}function respondWithResult(_0x1c093d,_0x2e5692){_0x2e5692=_0x2e5692||0xc8;return function(_0x508bbe){if(_0x508bbe){return _0x1c093d[_0xb967('0x1a')](_0x2e5692)[_0xb967('0x1c')](_0x508bbe);}};}function respondWithFilteredResult(_0x19938b,_0x58b2f4){return function(_0xed7d9d){if(_0xed7d9d){var _0xbeea4c=typeof _0x58b2f4[_0xb967('0x1d')]===_0xb967('0x1e')&&typeof _0x58b2f4[_0xb967('0x1f')]===_0xb967('0x1e');var _0x18f4b3=_0xed7d9d[_0xb967('0x20')];var _0xb391a0=_0xbeea4c?0x0:_0x58b2f4['offset'];var _0x519550=_0xbeea4c?_0xed7d9d[_0xb967('0x20')]:_0x58b2f4[_0xb967('0x1d')]+_0x58b2f4[_0xb967('0x1f')];var _0xb1d3ca;if(_0x519550>=_0x18f4b3){_0x519550=_0x18f4b3;_0xb1d3ca=0xc8;}else{_0xb1d3ca=0xce;}_0x19938b[_0xb967('0x1a')](_0xb1d3ca);return _0x19938b[_0xb967('0x21')](_0xb967('0x22'),_0xb391a0+'-'+_0x519550+'/'+_0x18f4b3)[_0xb967('0x1c')](_0xed7d9d);}return null;};}function patchUpdates(_0x5d2f42){return function(_0x56ab03){try{jsonpatch[_0xb967('0x23')](_0x56ab03,_0x5d2f42,!![]);}catch(_0x579ae4){return BPromise['reject'](_0x579ae4);}return _0x56ab03[_0xb967('0x24')]();};}function saveUpdates(_0x4d6a5f,_0x8c8205){return function(_0x29c53b){if(_0x29c53b){return _0x29c53b[_0xb967('0x25')](_0x4d6a5f)[_0xb967('0x26')](function(_0x179ca4){return _0x179ca4;});}return null;};}function removeEntity(_0x347883,_0x45f28e){return function(_0x5eb7bf){if(_0x5eb7bf){return _0x5eb7bf['destroy']()[_0xb967('0x26')](function(){_0x347883['status'](0xcc)[_0xb967('0x1b')]();});}};}function handleEntityNotFound(_0x409835,_0x337122){return function(_0x2e852c){if(!_0x2e852c){_0x409835[_0xb967('0x19')](0x194);}return _0x2e852c;};}function handleError(_0x5f1dce,_0x554e82){_0x554e82=_0x554e82||0x1f4;return function(_0x1c605b){logger['error'](_0x1c605b[_0xb967('0x27')]);if(_0x1c605b['name']){delete _0x1c605b[_0xb967('0x28')];}_0x5f1dce['status'](_0x554e82)[_0xb967('0x29')](_0x1c605b);};}exports[_0xb967('0x2a')]=function(_0x422950,_0x1034cd){var _0x2cc0e7={},_0xd0c518={},_0x4f6b2f={'count':0x0,'rows':[]};var _0x500bb1=_[_0xb967('0x2b')](db[_0xb967('0x2c')][_0xb967('0x2d')],function(_0x2d4034){return{'name':_0x2d4034['fieldName'],'type':_0x2d4034[_0xb967('0x2e')][_0xb967('0x2f')]};});_0xd0c518['model']=_[_0xb967('0x30')](_[_0xb967('0x2b')](_0x500bb1,'name'),['format']);_0xd0c518[_0xb967('0x31')]=_['keys'](_0x422950[_0xb967('0x31')]);_0xd0c518[_0xb967('0x32')]=_['intersection'](_0xd0c518[_0xb967('0x33')],_0xd0c518[_0xb967('0x31')]);_0x2cc0e7[_0xb967('0x34')]=_['intersection'](_0xd0c518[_0xb967('0x33')],qs[_0xb967('0x35')](_0x422950[_0xb967('0x31')][_0xb967('0x35')]));_0x2cc0e7[_0xb967('0x34')]=_0x2cc0e7[_0xb967('0x34')][_0xb967('0x36')]?_0x2cc0e7[_0xb967('0x34')]:_0xd0c518[_0xb967('0x33')];if(!_0x422950[_0xb967('0x31')][_0xb967('0x37')]('nolimit')){_0x2cc0e7['limit']=qs[_0xb967('0x1f')](_0x422950['query'][_0xb967('0x1f')]);_0x2cc0e7[_0xb967('0x1d')]=qs['offset'](_0x422950['query'][_0xb967('0x1d')]);}_0x2cc0e7['order']=qs['sort'](_0x422950[_0xb967('0x31')][_0xb967('0x38')]);_0x2cc0e7['where']=qs[_0xb967('0x32')](_[_0xb967('0x39')](_0x422950[_0xb967('0x31')],_0xd0c518[_0xb967('0x32')]),_0x500bb1);if(_0x422950[_0xb967('0x31')]['filter']){_0x2cc0e7[_0xb967('0x3a')]=_['merge'](_0x2cc0e7[_0xb967('0x3a')],{'$or':_[_0xb967('0x2b')](_0x500bb1,function(_0x107781){if(_0x107781['type']!==_0xb967('0x3b')){var _0x560d86={};_0x560d86[_0x107781[_0xb967('0x28')]]={'$like':'%'+_0x422950[_0xb967('0x31')][_0xb967('0x3c')]+'%'};return _0x560d86;}})});}_0x2cc0e7=_['merge']({},_0x2cc0e7,_0x422950[_0xb967('0x3d')]);var _0x4825db={'where':_0x2cc0e7[_0xb967('0x3a')]};return db[_0xb967('0x2c')][_0xb967('0x20')](_0x4825db)[_0xb967('0x26')](function(_0x4d2a38){_0x4f6b2f[_0xb967('0x20')]=_0x4d2a38;if(_0x422950[_0xb967('0x31')]['includeAll']){_0x2cc0e7[_0xb967('0x3e')]=[{'all':!![]}];}return db[_0xb967('0x2c')]['findAll'](_0x2cc0e7);})[_0xb967('0x26')](function(_0x298172){_0x4f6b2f[_0xb967('0x3f')]=_0x298172;return _0x4f6b2f;})[_0xb967('0x26')](respondWithFilteredResult(_0x1034cd,_0x2cc0e7))[_0xb967('0x40')](handleError(_0x1034cd,null));};exports[_0xb967('0x41')]=function(_0x5580a5,_0x262db9){var _0xab8cde={'raw':![],'where':{'id':_0x5580a5[_0xb967('0x42')]['id']}},_0x4697bc={};_0x4697bc[_0xb967('0x33')]=_[_0xb967('0x43')](db[_0xb967('0x2c')][_0xb967('0x2d')]);_0x4697bc[_0xb967('0x31')]=_['keys'](_0x5580a5[_0xb967('0x31')]);_0x4697bc['filters']=_['intersection'](_0x4697bc['model'],_0x4697bc[_0xb967('0x31')]);_0xab8cde[_0xb967('0x34')]=_['intersection'](_0x4697bc[_0xb967('0x33')],qs['fields'](_0x5580a5[_0xb967('0x31')]['fields']));_0xab8cde['attributes']=_0xab8cde[_0xb967('0x34')][_0xb967('0x36')]?_0xab8cde[_0xb967('0x34')]:_0x4697bc['model'];if(_0x5580a5[_0xb967('0x31')][_0xb967('0x44')]){_0xab8cde[_0xb967('0x3e')]=[{'all':!![]}];}_0xab8cde=_[_0xb967('0x45')]({},_0xab8cde,_0x5580a5[_0xb967('0x3d')]);return db['VoiceRecording']['find'](_0xab8cde)[_0xb967('0x26')](handleEntityNotFound(_0x262db9,null))[_0xb967('0x26')](respondWithResult(_0x262db9,null))[_0xb967('0x40')](handleError(_0x262db9,null));};exports['create']=function(_0x136a94,_0x5d7095){return db[_0xb967('0x2c')][_0xb967('0x46')](_0x136a94[_0xb967('0x47')],{})[_0xb967('0x26')](respondWithResult(_0x5d7095,0xc9))[_0xb967('0x40')](handleError(_0x5d7095,null));};exports[_0xb967('0x25')]=function(_0x1cf40f,_0x22f7ed){if(_0x1cf40f[_0xb967('0x47')]['id']){delete _0x1cf40f[_0xb967('0x47')]['id'];}return db['VoiceRecording'][_0xb967('0x48')]({'where':{'id':_0x1cf40f['params']['id']}})['then'](handleEntityNotFound(_0x22f7ed,null))[_0xb967('0x26')](saveUpdates(_0x1cf40f[_0xb967('0x47')],null))['then'](respondWithResult(_0x22f7ed,null))[_0xb967('0x40')](handleError(_0x22f7ed,null));};exports[_0xb967('0x49')]=function(_0x399ddb,_0x57d603){return db[_0xb967('0x2c')][_0xb967('0x49')]()['then'](respondWithResult(_0x57d603,null))[_0xb967('0x40')](handleError(_0x57d603,null));};exports[_0xb967('0x4a')]=function(_0x38f27d,_0x208a1e,_0x1170c9){var _0x52b2a6=require(_0xb967('0x4b'));var _0x2a2d4a=![];var _0x11551f={};if(_0x38f27d['query'][_0xb967('0x2e')]&&_0x38f27d[_0xb967('0x31')][_0xb967('0x2e')]===_0xb967('0x4c')){_0x11551f[_0xb967('0x4c')]=_0x38f27d[_0xb967('0x42')]['id'];}else{_0x11551f['id']=_0x38f27d[_0xb967('0x42')]['id'];}return db['VoiceRecording']['find']({'where':_0x11551f,'attributes':['id',_0xb967('0x4d')],'raw':!![]})[_0xb967('0x26')](handleEntityNotFound(_0x208a1e,null))[_0xb967('0x26')](function(_0x16b39a){if(_0x16b39a){var _0x575223=_0x16b39a[_0xb967('0x4d')];var _0x4694cd=util['format'](_0xb967('0x4e'),_0x575223);if(fs[_0xb967('0x4f')](_0x4694cd)){_0x2a2d4a=!![];return _0x52b2a6[_0xb967('0x50')](_0x4694cd,_0x575223,config[_0xb967('0x51')][_0xb967('0x52')])[_0xb967('0x26')](function(){return _0x16b39a;});}return _0x16b39a;}})[_0xb967('0x26')](function(_0x40ad68){if(_0x40ad68){var _0x11e5f5=_0x40ad68[_0xb967('0x4d')];if(!fs['existsSync'](_0x11e5f5)){throw new db[(_0xb967('0x53'))]['ValidationError'](_0xb967('0x54'));}if(_0x40ad68['filename']){return _0x208a1e['download'](_0x11e5f5,_0x40ad68[_0xb967('0x55')]+path[_0xb967('0x56')](_0x11e5f5),function(){if(_0x2a2d4a){fs[_0xb967('0x57')](_0x11e5f5);}});}else{return _0x208a1e['download'](_0x11e5f5,function(_0x511b41){if(_0x2a2d4a){fs[_0xb967('0x57')](_0x11e5f5);}});}}})[_0xb967('0x40')](function(_0x24099d){if(_0x24099d[_0xb967('0x58')]===_0xb967('0x54')){_0x208a1e[_0xb967('0x1a')](0x194)[_0xb967('0x29')](_0xb967('0x59'));}else{return handleError(_0x208a1e,null);}});};exports[_0xb967('0x5a')]=function(_0x3f7b9,_0x51f63e,_0x318c81){var _0x5e3e2e=require(_0xb967('0x4b'));var _0x2dd4e7=![];var _0x3ebeb2={'$and':[db[_0xb967('0x5b')]['where'](db[_0xb967('0x5b')]['fn'](_0xb967('0x5c'),db['sequelize']['col']('uniqueid')),_0x3f7b9[_0xb967('0x31')][_0xb967('0x5d')])]};if(_0x3f7b9['query'][_0xb967('0x2e')]&&_0x3f7b9[_0xb967('0x31')][_0xb967('0x2e')]===_0xb967('0x4c')){_0x3ebeb2[_0xb967('0x5e')][_0xb967('0x5f')]({'uniqueid':_0x3f7b9['params']['id']});}else{_0x3ebeb2[_0xb967('0x5e')][_0xb967('0x5f')]({'id':_0x3f7b9[_0xb967('0x42')]['id']});}return db[_0xb967('0x2c')][_0xb967('0x48')]({'where':_0x3ebeb2,'attributes':['id',_0xb967('0x4d')],'raw':!![]})[_0xb967('0x26')](handleEntityNotFound(_0x51f63e,null))[_0xb967('0x26')](function(_0x3f236d){if(_0x3f236d){var _0x3398e1=util[_0xb967('0x60')](_0xb967('0x4e'),_0x3f236d[_0xb967('0x4d')]);if(fs[_0xb967('0x4f')](_0x3398e1)){_0x2dd4e7=!![];return _0x5e3e2e[_0xb967('0x50')](_0x3398e1,_0x3f236d[_0xb967('0x4d')],config[_0xb967('0x51')][_0xb967('0x52')])[_0xb967('0x26')](function(){return _0x3f236d;});}return _0x3f236d;}})[_0xb967('0x26')](function(_0x5ee055){if(_0x5ee055){if(!fs['existsSync'](_0x5ee055[_0xb967('0x4d')])){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x54'));}if(_0x5ee055[_0xb967('0x55')]){return _0x51f63e['download'](_0x5ee055[_0xb967('0x4d')],_0x5ee055[_0xb967('0x55')]+path[_0xb967('0x56')](_0x5ee055[_0xb967('0x4d')]),function(){if(_0x2dd4e7){fs[_0xb967('0x57')](_0x5ee055[_0xb967('0x4d')]);}});}else{return _0x51f63e[_0xb967('0x4a')](_0x5ee055[_0xb967('0x4d')],function(_0x3e5362){if(_0x2dd4e7){fs[_0xb967('0x57')](_0x5ee055[_0xb967('0x4d')]);}});}}})['catch'](handleError(_0x51f63e,null));};exports[_0xb967('0x62')]=function(_0x5a61c3,_0x587410){return db[_0xb967('0x2c')][_0xb967('0x48')]({'where':{'id':_0x5a61c3[_0xb967('0x42')]['id']}})[_0xb967('0x26')](function(_0x3a8a4b){if(_[_0xb967('0x63')](_0x3a8a4b)){throw new ReferenceError(_0xb967('0x64'));}return _0x3a8a4b;})[_0xb967('0x26')](function(_0x20cd9d){var _0x123360=_0x20cd9d[_0xb967('0x4d')];logger[_0xb967('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x123360);if(!_[_0xb967('0x63')](_0x20cd9d[_0xb967('0x4d')])&&fs[_0xb967('0x4f')](_0x123360)){logger['info'](_0xb967('0x66')+_0x123360+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb967('0x67')](_0x123360);}_0x123360=_0x123360+_0xb967('0x68');if(!_['isNil'](_0x20cd9d['value'])&&fs[_0xb967('0x4f')](_0x123360)){logger[_0xb967('0x65')]('File:\x20\x22'+_0x123360+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x123360);}return _0x20cd9d;})[_0xb967('0x26')](function(_0x32f895){if(!_0x32f895)throw new InternalError();return _0x32f895[_0xb967('0x62')]();})[_0xb967('0x26')](function(){_0x587410[_0xb967('0x1a')](0xcc)[_0xb967('0x1b')]();})['catch'](handleError(_0x587410,null));};function getBucketslist(_0x17dbcd,_0x5b704b,_0x11971e){return new Promise(function(_0x51ea1d,_0x1afb7c){var _0x2100f6=new AWS['S3']({'accessKeyId':_0x5b704b,'secretAccessKey':_0x17dbcd,'region':_0x11971e});_0x2100f6[_0xb967('0x69')]({},function(_0x240619,_0x310933){if(_0x240619){return _0x1afb7c(_0x240619);}else{return _0x51ea1d(_0x310933);}});});}function createBucket(_0x5118fa,_0x1bd914,_0xfcc2fc,_0x3d544f){return new Promise(function(_0x2c51a4,_0x36801f){var _0x437596=new AWS['S3']({'accessKeyId':_0x1bd914,'secretAccessKey':_0x5118fa,'region':_0xfcc2fc});_0x437596[_0xb967('0x6a')]({'Bucket':_0x3d544f},function(_0x4c89d4,_0x24344e){if(_0x4c89d4){return _0x36801f(_0x4c89d4);}else{return _0x2c51a4(_0x24344e);}});});}function uploadFile(_0x3ccee9,_0x41857f,_0x3cab2e,_0x1677b8,_0x1112b0,_0x4b1d9a){return new Promise(function(_0x2b01e0,_0x18b9b9){var _0x29061f=new AWS['S3']({'accessKeyId':_0x41857f,'secretAccessKey':_0x3ccee9,'region':_0x3cab2e});_0x29061f[_0xb967('0x6b')]({'Bucket':_0x1677b8,'Key':_0x1112b0,'Body':_0x4b1d9a},function(_0x8f405,_0x269d62){if(_0x8f405){return _0x18b9b9(_0x8f405);}else{return _0x2b01e0(_0x269d62);}});});}function startTranscribe(_0xb00276,_0xd872cb,_0x3bb3f7,_0x17a5ba,_0x237d01,_0x1c9dc7){return new Promise(function(_0x1e99e0,_0x41b99a){var _0x44b62c=new AWS[(_0xb967('0x6c'))]({'accessKeyId':_0xd872cb,'secretAccessKey':_0xb00276,'region':_0x3bb3f7});_0x44b62c['startTranscriptionJob']({'TranscriptionJobName':_0x17a5ba,'LanguageCode':_0x237d01,'Media':{'MediaFileUri':_0x1c9dc7}},function(_0x46b4fd,_0x157e11){if(_0x46b4fd){return _0x41b99a(_0x46b4fd);}else{return _0x1e99e0(_0x157e11);}});});}function transcribe(_0x481d89,_0x16431d,_0x3be720,_0x245c38,_0x337f45,_0x2271f0,_0x2e0ae5){return new Promise(function(_0x5a6a4a,_0x556b5b){var _0x2f2056={};logger['info'](util[_0xb967('0x60')](_0xb967('0x6d'),_0x481d89,_0x337f45));return uploadFile(_0x16431d,_0x3be720,_0x245c38,_0x337f45,path[_0xb967('0x6e')](_0x2271f0),fs['readFileSync'](_0x2271f0))[_0xb967('0x26')](function(_0x39d468){logger['info'](util[_0xb967('0x60')](_0xb967('0x6f'),_0x481d89,_0x337f45,_0x39d468[_0xb967('0x70')]));_0x2f2056[_0xb967('0x71')]=_0x39d468[_0xb967('0x72')];_0x2f2056[_0xb967('0x73')]=_0x39d468[_0xb967('0x70')];logger[_0xb967('0x65')](util[_0xb967('0x60')](_0xb967('0x74'),_0x481d89));return startTranscribe(_0x16431d,_0x3be720,_0x245c38,uuidv4(),_0x2e0ae5,_0x39d468[_0xb967('0x70')]);})['then'](function(_0x3190e7){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x481d89,_0x3190e7['TranscriptionJob'][_0xb967('0x75')]));_0x2f2056['transcribeName']=_0x3190e7[_0xb967('0x76')][_0xb967('0x75')];_0x2f2056[_0xb967('0x77')]=_0x3190e7[_0xb967('0x76')][_0xb967('0x78')];return _0x5a6a4a(_0x2f2056);})[_0xb967('0x40')](function(_0x3897a5){return _0x556b5b(_0x3897a5);});});}exports[_0xb967('0x79')]=function(_0x54e026,_0x49742a,_0x36fde5){var _0x1ca9c2;var _0x35cb5b;var _0x5384aa;var _0x42f59f=require('../../components/encryptor');return db[_0xb967('0x2c')][_0xb967('0x7a')]({'where':{'id':_0x54e026['params']['id']}})['then'](function(_0x3040d5){if(_0x3040d5){var _0x2629c7=util[_0xb967('0x60')](_0xb967('0x4e'),_0x3040d5[_0xb967('0x4d')]);if(fs[_0xb967('0x4f')](_0x2629c7)){cypher=!![];return _0x42f59f[_0xb967('0x50')](_0x2629c7,_0x3040d5['value'],config['secrets']['recording'])[_0xb967('0x26')](function(){return _0x3040d5;});}return _0x3040d5;}})[_0xb967('0x26')](function(_0x131251){if(!_0x131251){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x7b'));}_0x35cb5b=_0x131251;return db[_0xb967('0x7c')][_0xb967('0x7a')]({'where':{'id':0x1}});})[_0xb967('0x26')](handleEntityNotFound(_0x49742a,null))[_0xb967('0x26')](function(_0x3eb9dd){if(_0x3eb9dd){_0x1ca9c2=_0x3eb9dd;if(!_0x1ca9c2['transcribe']||!_0x1ca9c2[_0xb967('0x7d')]||!_0x1ca9c2[_0xb967('0x7e')]||!_0x1ca9c2[_0xb967('0x7f')]||!_0x1ca9c2[_0xb967('0x71')]){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))]('Transcribe\x20not\x20configured');}if(_0x54e026['body'][_0xb967('0x80')]&&(!_0x1ca9c2[_0xb967('0x81')]||!_0x1ca9c2['sentimentAccountId']||!_0x1ca9c2[_0xb967('0x82')]||!_0x1ca9c2['language']||!_0x1ca9c2[_0xb967('0x71')])){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x83'));}return db[_0xb967('0x84')][_0xb967('0x7a')]({'where':{'id':_0x1ca9c2['transcribeAccountId']}});}})[_0xb967('0x26')](function(_0x8cb66d){if(!_0x8cb66d){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))](_0xb967('0x85'));}if(!_0x8cb66d['data1']||!_0x8cb66d[_0xb967('0x86')]){throw new db[(_0xb967('0x53'))][(_0xb967('0x61'))]('Cloud\x20Provider\x20not\x20configured');}_0x5384aa=_0x8cb66d;return getBucketslist(_0x5384aa[_0xb967('0x87')],_0x5384aa[_0xb967('0x86')],_0x1ca9c2[_0xb967('0x7e')]);})[_0xb967('0x26')](function(_0x5df14a){if(_0x5df14a&&_0x5df14a['Buckets']){var _0x3a30a7=_[_0xb967('0x48')](_0x5df14a[_0xb967('0x88')],function(_0x1cb46e){return _0x1cb46e['Name']===_0x1ca9c2[_0xb967('0x71')];});if(!_0x3a30a7){logger[_0xb967('0x65')](util[_0xb967('0x60')](_0xb967('0x89'),_0x54e026[_0xb967('0x42')]['id'],_0x1ca9c2[_0xb967('0x71')]));return createBucket(_0x5384aa['data1'],_0x5384aa[_0xb967('0x86')],_0x1ca9c2[_0xb967('0x7e')],_0x1ca9c2[_0xb967('0x71')]);}logger[_0xb967('0x65')](util[_0xb967('0x60')](_0xb967('0x8a'),_0x54e026[_0xb967('0x42')]['id'],_0x1ca9c2[_0xb967('0x71')]));return;}})[_0xb967('0x26')](function(_0x58f898){if(_0x35cb5b[_0xb967('0x77')]===_0xb967('0x8b')){return transcribe(_0x54e026[_0xb967('0x42')]['id'],_0x5384aa['data1'],_0x5384aa[_0xb967('0x86')],_0x1ca9c2[_0xb967('0x7e')],_0x1ca9c2['bucket'],_0x35cb5b[_0xb967('0x4d')],_0x1ca9c2['language']);}else{logger[_0xb967('0x65')](util[_0xb967('0x60')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x54e026[_0xb967('0x42')]['id']));return{'transcribeStatus':_0xb967('0x8c')};}})[_0xb967('0x26')](function(_0x3a780b){if(_0x3a780b){_0x3a780b[_0xb967('0x8d')]=_0x54e026[_0xb967('0x47')][_0xb967('0x80')];return _0x35cb5b['updateAttributes'](_0x3a780b);}})['then'](respondWithResult(_0x49742a,null))[_0xb967('0x40')](handleError(_0x49742a,null));};function writeFile(_0x292688,_0x28dc09){return new Promise(function(_0x65ec0c,_0x69827e){fs[_0xb967('0x8e')](_0x28dc09,_0x292688,function(_0x5b34b7,_0x40e249){if(_0x5b34b7){return _0x69827e(_0x5b34b7);}else{return _0x65ec0c(_0x40e249);}});});}exports[_0xb967('0x8f')]=function(_0x34af77,_0x524aaf,_0x3b0298){return db[_0xb967('0x2c')][_0xb967('0x7a')]({'where':{'id':_0x34af77[_0xb967('0x42')]['id']}})[_0xb967('0x26')](handleEntityNotFound(_0x524aaf))[_0xb967('0x26')](function(_0x513f87){if(_0x513f87&&_0x513f87[_0xb967('0x90')]){var _0xdee939=_0x513f87[_0xb967('0x90')];var _0xcf225e=config[_0xb967('0x91')]+_0xb967('0x92')+_0x513f87['id']+_0xb967('0x93');if(fs[_0xb967('0x4f')](_0xcf225e)){return _0xcf225e;}return writeFile(_0xdee939,_0xcf225e)[_0xb967('0x26')](function(){return _0xcf225e;});}else{throw new db['Sequelize'][(_0xb967('0x61'))]('Transcript\x20not\x20available');}})['then'](function(_0x2be47a){return _0x524aaf[_0xb967('0x4a')](_0x2be47a);})['catch'](handleError(_0x524aaf));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 39209ee..19a8f94 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 _0x63eb=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63eb,0x90));var _0xb63e=function(_0x55cfed,_0x33462a){_0x55cfed=_0x55cfed-0x0;var _0x1a918c=_0x63eb[_0x55cfed];return _0x1a918c;};'use strict';var attributes=require(_0xb63e('0x0'));module[_0xb63e('0x1')]=function(_0x310731,_0x121675){return _0x310731[_0xb63e('0x2')](_0xb63e('0x3'),attributes,{'tableName':_0xb63e('0x4'),'paranoid':![],'indexes':[{'name':_0xb63e('0x5'),'fields':[_0xb63e('0x5')]},{'name':_0xb63e('0x6'),'fields':[_0xb63e('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f37=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x1a08cf,_0x186382){var _0x4174b7=function(_0x263861){while(--_0x263861){_0x1a08cf['push'](_0x1a08cf['shift']());}};_0x4174b7(++_0x186382);}(_0x8f37,0x190));var _0x78f3=function(_0x1a452f,_0xb35879){_0x1a452f=_0x1a452f-0x0;var _0x4b2a52=_0x8f37[_0x1a452f];return _0x4b2a52;};'use strict';var attributes=require(_0x78f3('0x0'));module[_0x78f3('0x1')]=function(_0x351c4f,_0x5c221b){return _0x351c4f['define'](_0x78f3('0x2'),attributes,{'tableName':_0x78f3('0x3'),'paranoid':![],'indexes':[{'name':_0x78f3('0x4'),'fields':['uniqueid']},{'name':_0x78f3('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 36dac70..9c260c4 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 _0x5f2f=['UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0xd4dbb0,_0x2f0176){var _0x410320=function(_0x14aae8){while(--_0x14aae8){_0xd4dbb0['push'](_0xd4dbb0['shift']());}};_0x410320(++_0x2f0176);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7b2b13,_0x2aa556){_0x7b2b13=_0x7b2b13-0x0;var _0x32b12f=_0x5f2f[_0x7b2b13];return _0x32b12f;};'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')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x21')]=function(_0x13a3be){var _0x281ec8=this;return new Promise(function(_0x294414,_0x4ab014){var _0xaa2602=require(_0xf5f2('0x22'));var _0x375ca8;return db[_0xf5f2('0x23')][_0xf5f2('0x24')]({'attributes':['id',_0xf5f2('0x25')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x53cb96){_0x375ca8=_0x53cb96;return db[_0xf5f2('0x18')][_0xf5f2('0x26')](_0x13a3be[_0xf5f2('0x1a')]);})['then'](function(_0x5a2c7e){if(_0x375ca8[_0xf5f2('0x25')]&&fs[_0xf5f2('0x27')](_0x5a2c7e[_0xf5f2('0x28')])){var _0x153924=util[_0xf5f2('0x29')]('%s.cypher',_0x5a2c7e['value']);return _0xaa2602[_0xf5f2('0x2a')](_0x5a2c7e['value'],_0x153924,config[_0xf5f2('0x2b')]['recording'])[_0xf5f2('0x20')](function(){fs[_0xf5f2('0x2c')](_0x5a2c7e[_0xf5f2('0x28')]);logger[_0xf5f2('0xd')](_0xf5f2('0x2d'));return _0x5a2c7e;});}return _0x5a2c7e;})[_0xf5f2('0x20')](function(_0x2ac089){logger[_0xf5f2('0xd')]('CreateVoiceRecording',_0x13a3be);logger[_0xf5f2('0xf')](_0xf5f2('0x21'),_0x13a3be,JSON[_0xf5f2('0x10')](_0x2ac089));_0x294414(_0x2ac089);})[_0xf5f2('0x16')](function(_0x1408b9){logger[_0xf5f2('0x11')](_0xf5f2('0x21'),_0x1408b9['message'],_0x13a3be);_0x4ab014(_0x281ec8[_0xf5f2('0x11')](0x1f4,_0x1408b9[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0xfb11=['update','body','options','where','attributes','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xfb11[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}exports[_0x1fb1('0x14')]=function(_0x24d4df){var _0x34076b=this;return new Promise(function(_0x33c6b6,_0x27d71f){return db[_0x1fb1('0x15')][_0x1fb1('0x16')](_0x24d4df[_0x1fb1('0x17')],{'raw':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d4df['options']?_0x24d4df[_0x1fb1('0x18')][_0x1fb1('0x19')]||null:null,'attributes':_0x24d4df[_0x1fb1('0x18')]?_0x24d4df['options'][_0x1fb1('0x1a')]||null:null,'limit':_0x24d4df['options']?_0x24d4df['options']['limit']||null:null})[_0x1fb1('0xa')](function(_0x1f8e5a){logger[_0x1fb1('0xb')](_0x1fb1('0x14'),_0x24d4df);logger[_0x1fb1('0x1b')]('UpdateVoiceRecording',_0x24d4df,JSON[_0x1fb1('0xf')](_0x1f8e5a));_0x33c6b6(_0x1f8e5a);})[_0x1fb1('0x13')](function(_0x1dc03f){logger[_0x1fb1('0x10')](_0x1fb1('0x14'),_0x1dc03f[_0x1fb1('0x12')],_0x24d4df);_0x27d71f(_0x34076b[_0x1fb1('0x10')](0x1f4,_0x1dc03f[_0x1fb1('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x1b25b3){var _0x1aac7d=this;return new Promise(function(_0x46ff60,_0xc5188b){var _0x1898e7=require(_0x1fb1('0x1c'));var _0x1a74c4;return db[_0x1fb1('0x1d')][_0x1fb1('0x1e')]({'attributes':['id',_0x1fb1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x1fb1('0xa')](function(_0x497017){_0x1a74c4=_0x497017;return db[_0x1fb1('0x15')][_0x1fb1('0x20')](_0x1b25b3[_0x1fb1('0x17')]);})['then'](function(_0x106134){if(_0x1a74c4[_0x1fb1('0x1f')]&&fs[_0x1fb1('0x21')](_0x106134[_0x1fb1('0x22')])){var _0x5402e9=util[_0x1fb1('0x23')](_0x1fb1('0x24'),_0x106134['value']);return _0x1898e7[_0x1fb1('0x25')](_0x106134['value'],_0x5402e9,config['secrets'][_0x1fb1('0x26')])[_0x1fb1('0xa')](function(){fs['unlink'](_0x106134[_0x1fb1('0x22')]);logger[_0x1fb1('0xb')](_0x1fb1('0x27'));return _0x106134;});}return _0x106134;})[_0x1fb1('0xa')](function(_0x32d797){logger['info'](_0x1fb1('0x28'),_0x1b25b3);logger[_0x1fb1('0x1b')](_0x1fb1('0x28'),_0x1b25b3,JSON[_0x1fb1('0xf')](_0x32d797));_0x46ff60(_0x32d797);})[_0x1fb1('0x13')](function(_0x307700){logger[_0x1fb1('0x10')](_0x1fb1('0x28'),_0x307700[_0x1fb1('0x12')],_0x1b25b3);_0xc5188b(_0x1aac7d['error'](0x1f4,_0x307700[_0x1fb1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 7ff7f21..21793ed 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 _0xd9cc=['show','create','update','delete','/:id','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe'];(function(_0x4b00b3,_0x52db6c){var _0x59f23c=function(_0x5d1de3){while(--_0x5d1de3){_0x4b00b3['push'](_0x4b00b3['shift']());}};_0x59f23c(++_0x52db6c);}(_0xd9cc,0xcc));var _0xcd9c=function(_0x2c1b56,_0x10892b){_0x2c1b56=_0x2c1b56-0x0;var _0x5ba388=_0xd9cc[_0x2c1b56];return _0x5ba388;};'use strict';var multer=require(_0xcd9c('0x0'));var util=require('util');var path=require(_0xcd9c('0x1'));var timeout=require(_0xcd9c('0x2'));var express=require(_0xcd9c('0x3'));var router=express['Router']();var fs_extra=require(_0xcd9c('0x4'));var auth=require(_0xcd9c('0x5'));var interaction=require(_0xcd9c('0x6'));var config=require(_0xcd9c('0x7'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0xcd9c('0x8')](),controller[_0xcd9c('0x9')]);router[_0xcd9c('0xa')]('/describe',auth[_0xcd9c('0x8')](),controller[_0xcd9c('0xb')]);router[_0xcd9c('0xa')]('/:id',auth[_0xcd9c('0x8')](),controller[_0xcd9c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcd9c('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcd9c('0xe')]);router[_0xcd9c('0xf')](_0xcd9c('0x10'),auth[_0xcd9c('0x8')](),controller['destroy']);module[_0xcd9c('0x11')]=router; \ No newline at end of file +var _0x8b38=['describe','/:id','show','post','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x48942f,_0x15d22d){var _0x59049f=function(_0x1e0eae){while(--_0x1e0eae){_0x48942f['push'](_0x48942f['shift']());}};_0x59049f(++_0x15d22d);}(_0x8b38,0x174));var _0x88b3=function(_0x48e921,_0x20cf98){_0x48e921=_0x48e921-0x0;var _0x4986fe=_0x8b38[_0x48e921];return _0x4986fe;};'use strict';var multer=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var path=require(_0x88b3('0x2'));var timeout=require(_0x88b3('0x3'));var express=require(_0x88b3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x88b3('0x5'));var interaction=require(_0x88b3('0x6'));var config=require('../../config/environment');var controller=require(_0x88b3('0x7'));router[_0x88b3('0x8')]('/',auth[_0x88b3('0x9')](),controller[_0x88b3('0xa')]);router[_0x88b3('0x8')](_0x88b3('0xb'),auth[_0x88b3('0x9')](),controller[_0x88b3('0xc')]);router[_0x88b3('0x8')](_0x88b3('0xd'),auth['isAuthenticated'](),controller[_0x88b3('0xe')]);router[_0x88b3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x88b3('0x9')](),controller['update']);router['delete'](_0x88b3('0xd'),auth[_0x88b3('0x9')](),controller['destroy']);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 93483b3..f5265c6 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 _0xe172=['STRING','moment','exports','ENUM','attended'];(function(_0x43711a,_0x3b9cd4){var _0x665af6=function(_0x58a19a){while(--_0x58a19a){_0x43711a['push'](_0x43711a['shift']());}};_0x665af6(++_0x3b9cd4);}(_0xe172,0x146));var _0x2e17=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xe172[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2e17('0x0'));module[_0x2e17('0x1')]={'type':{'type':Sequelize[_0x2e17('0x2')]('blind',_0x2e17('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x2e17('0x4')]},'transferercalleridname':{'type':Sequelize[_0x2e17('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2e17('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x2e17('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x2e17('0x4')]},'transferercontext':{'type':Sequelize[_0x2e17('0x4')]},'transfererexten':{'type':Sequelize[_0x2e17('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x2e17('0x4')]},'transfereechannel':{'type':Sequelize[_0x2e17('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x2e17('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x2e17('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x2e17('0x4')]},'transfereeexten':{'type':Sequelize[_0x2e17('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x2e17('0x4')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x2e17('0x4')]}}; \ No newline at end of file +var _0x1024=['sequelize','moment','exports','ENUM','STRING','Yes'];(function(_0x55d9d9,_0x134208){var _0x1559da=function(_0x17ec52){while(--_0x17ec52){_0x55d9d9['push'](_0x55d9d9['shift']());}};_0x1559da(++_0x134208);}(_0x1024,0x1aa));var _0x4102=function(_0x426b11,_0xea4be1){_0x426b11=_0x426b11-0x0;var _0x438be2=_0x1024[_0x426b11];return _0x438be2;};'use strict';var Sequelize=require(_0x4102('0x0'));var moment=require(_0x4102('0x1'));module[_0x4102('0x2')]={'type':{'type':Sequelize[_0x4102('0x3')]('blind','attended')},'result':{'type':Sequelize[_0x4102('0x4')]},'transfererchannel':{'type':Sequelize[_0x4102('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x4102('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x4102('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x4102('0x4')]},'transfereechannel':{'type':Sequelize[_0x4102('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x4102('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x4102('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x4102('0x4')]},'transfereecontext':{'type':Sequelize[_0x4102('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x4102('0x4')]},'isexternal':{'type':Sequelize[_0x4102('0x3')](_0x4102('0x5'),'No')},'context':{'type':Sequelize[_0x4102('0x4')]},'extension':{'type':Sequelize[_0x4102('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index d22a8f4..3ef5ab9 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 _0x2e3f=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js'];(function(_0x2c774d,_0x1cf4c3){var _0x41d3fd=function(_0xde29ba){while(--_0xde29ba){_0x2c774d['push'](_0x2c774d['shift']());}};_0x41d3fd(++_0x1cf4c3);}(_0x2e3f,0x7f));var _0xf2e3=function(_0x266951,_0x34be2a){_0x266951=_0x266951-0x0;var _0x2f6bfd=_0x2e3f[_0x266951];return _0x2f6bfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2e3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2e3('0x1'));var rp=require('request-promise');var moment=require(_0xf2e3('0x2'));var BPromise=require(_0xf2e3('0x3'));var Mustache=require(_0xf2e3('0x4'));var util=require(_0xf2e3('0x5'));var path=require(_0xf2e3('0x6'));var sox=require(_0xf2e3('0x7'));var csv=require('to-csv');var ejs=require(_0xf2e3('0x8'));var fs=require('fs');var fs_extra=require(_0xf2e3('0x9'));var _=require(_0xf2e3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf2e3('0xb'));var deskjs=require(_0xf2e3('0xc'));var toCsv=require(_0xf2e3('0xd'));var querystring=require(_0xf2e3('0xe'));var Papa=require(_0xf2e3('0xf'));var Redis=require(_0xf2e3('0x10'));var authService=require(_0xf2e3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf2e3('0x12'));var hardwareService=require(_0xf2e3('0x13'));var logger=require('../../config/logger')(_0xf2e3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f3825,_0x4a4e16){_0x4a4e16=_0x4a4e16||0xcc;return function(_0x4bddc9){if(_0x4bddc9){return _0x5f3825[_0xf2e3('0x15')](_0x4a4e16);}return _0x5f3825[_0xf2e3('0x16')](_0x4a4e16)[_0xf2e3('0x17')]();};}function respondWithResult(_0x321c3e,_0x18a87c){_0x18a87c=_0x18a87c||0xc8;return function(_0x446383){if(_0x446383){return _0x321c3e[_0xf2e3('0x16')](_0x18a87c)[_0xf2e3('0x18')](_0x446383);}};}function respondWithFilteredResult(_0x5547ea,_0x4f051c){return function(_0x1bed9a){if(_0x1bed9a){var _0x11b238=typeof _0x4f051c['offset']==='undefined'&&typeof _0x4f051c[_0xf2e3('0x19')]===_0xf2e3('0x1a');var _0x56bd9a=_0x1bed9a[_0xf2e3('0x1b')];var _0x359114=_0x11b238?0x0:_0x4f051c[_0xf2e3('0x1c')];var _0x1dbf8a=_0x11b238?_0x1bed9a[_0xf2e3('0x1b')]:_0x4f051c[_0xf2e3('0x1c')]+_0x4f051c[_0xf2e3('0x19')];var _0x36053f;if(_0x1dbf8a>=_0x56bd9a){_0x1dbf8a=_0x56bd9a;_0x36053f=0xc8;}else{_0x36053f=0xce;}_0x5547ea[_0xf2e3('0x16')](_0x36053f);return _0x5547ea[_0xf2e3('0x1d')](_0xf2e3('0x1e'),_0x359114+'-'+_0x1dbf8a+'/'+_0x56bd9a)[_0xf2e3('0x18')](_0x1bed9a);}return null;};}function patchUpdates(_0x52183b){return function(_0x238530){try{jsonpatch[_0xf2e3('0x1f')](_0x238530,_0x52183b,!![]);}catch(_0x40f3fe){return BPromise[_0xf2e3('0x20')](_0x40f3fe);}return _0x238530['save']();};}function saveUpdates(_0x3870b4,_0xb33938){return function(_0x43f679){if(_0x43f679){return _0x43f679[_0xf2e3('0x21')](_0x3870b4)[_0xf2e3('0x22')](function(_0x1530d){return _0x1530d;});}return null;};}function removeEntity(_0x2ebce0,_0x475cf2){return function(_0x5dca45){if(_0x5dca45){return _0x5dca45[_0xf2e3('0x23')]()['then'](function(){_0x2ebce0[_0xf2e3('0x16')](0xcc)[_0xf2e3('0x17')]();});}};}function handleEntityNotFound(_0x28c7f2,_0x3347ff){return function(_0x45df52){if(!_0x45df52){_0x28c7f2[_0xf2e3('0x15')](0x194);}return _0x45df52;};}function handleError(_0x2d5169,_0x5d32e3){_0x5d32e3=_0x5d32e3||0x1f4;return function(_0x4d518a){logger['error'](_0x4d518a[_0xf2e3('0x24')]);if(_0x4d518a[_0xf2e3('0x25')]){delete _0x4d518a['name'];}_0x2d5169[_0xf2e3('0x16')](_0x5d32e3)['send'](_0x4d518a);};}exports[_0xf2e3('0x26')]=function(_0x172498,_0xe4ebac){var _0x565290={},_0x343eb6={},_0x5d1da2={'count':0x0,'rows':[]};var _0x548c55=_[_0xf2e3('0x27')](db[_0xf2e3('0x28')][_0xf2e3('0x29')],function(_0x520b33){return{'name':_0x520b33[_0xf2e3('0x2a')],'type':_0x520b33[_0xf2e3('0x2b')][_0xf2e3('0x2c')]};});_0x343eb6[_0xf2e3('0x2d')]=_[_0xf2e3('0x27')](_0x548c55,'name');_0x343eb6[_0xf2e3('0x2e')]=_['keys'](_0x172498[_0xf2e3('0x2e')]);_0x343eb6[_0xf2e3('0x2f')]=_[_0xf2e3('0x30')](_0x343eb6[_0xf2e3('0x2d')],_0x343eb6[_0xf2e3('0x2e')]);_0x565290[_0xf2e3('0x31')]=_[_0xf2e3('0x30')](_0x343eb6['model'],qs[_0xf2e3('0x32')](_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x32')]));_0x565290[_0xf2e3('0x31')]=_0x565290['attributes'][_0xf2e3('0x33')]?_0x565290['attributes']:_0x343eb6[_0xf2e3('0x2d')];if(!_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x34')]('nolimit')){_0x565290[_0xf2e3('0x19')]=qs[_0xf2e3('0x19')](_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x19')]);_0x565290[_0xf2e3('0x1c')]=qs[_0xf2e3('0x1c')](_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x1c')]);}_0x565290['order']=qs[_0xf2e3('0x35')](_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x35')]);_0x565290[_0xf2e3('0x36')]=qs[_0xf2e3('0x2f')](_['pick'](_0x172498['query'],_0x343eb6['filters']),_0x548c55);if(_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x37')]){_0x565290['where']=_[_0xf2e3('0x38')](_0x565290[_0xf2e3('0x36')],{'$or':_[_0xf2e3('0x27')](_0x548c55,function(_0x135a8e){if(_0x135a8e[_0xf2e3('0x2b')]!==_0xf2e3('0x39')){var _0xc613be={};_0xc613be[_0x135a8e[_0xf2e3('0x25')]]={'$like':'%'+_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x37')]+'%'};return _0xc613be;}})});}_0x565290=_[_0xf2e3('0x38')]({},_0x565290,_0x172498[_0xf2e3('0x3a')]);var _0x22379c={'where':_0x565290['where']};return db[_0xf2e3('0x28')][_0xf2e3('0x1b')](_0x22379c)[_0xf2e3('0x22')](function(_0x38873f){_0x5d1da2[_0xf2e3('0x1b')]=_0x38873f;if(_0x172498[_0xf2e3('0x2e')][_0xf2e3('0x3b')]){_0x565290[_0xf2e3('0x3c')]=[{'all':!![]}];}return db[_0xf2e3('0x28')][_0xf2e3('0x3d')](_0x565290);})[_0xf2e3('0x22')](function(_0x3cb8c6){_0x5d1da2[_0xf2e3('0x3e')]=_0x3cb8c6;return _0x5d1da2;})[_0xf2e3('0x22')](respondWithFilteredResult(_0xe4ebac,_0x565290))[_0xf2e3('0x3f')](handleError(_0xe4ebac,null));};exports['show']=function(_0x4fdc19,_0x1c6ee4){var _0x5e611c={'raw':!![],'where':{'id':_0x4fdc19[_0xf2e3('0x40')]['id']}},_0x547329={};_0x547329[_0xf2e3('0x2d')]=_[_0xf2e3('0x41')](db[_0xf2e3('0x28')][_0xf2e3('0x29')]);_0x547329[_0xf2e3('0x2e')]=_[_0xf2e3('0x41')](_0x4fdc19[_0xf2e3('0x2e')]);_0x547329[_0xf2e3('0x2f')]=_['intersection'](_0x547329['model'],_0x547329['query']);_0x5e611c['attributes']=_[_0xf2e3('0x30')](_0x547329['model'],qs[_0xf2e3('0x32')](_0x4fdc19['query'][_0xf2e3('0x32')]));_0x5e611c[_0xf2e3('0x31')]=_0x5e611c[_0xf2e3('0x31')][_0xf2e3('0x33')]?_0x5e611c[_0xf2e3('0x31')]:_0x547329[_0xf2e3('0x2d')];if(_0x4fdc19[_0xf2e3('0x2e')]['includeAll']){_0x5e611c['include']=[{'all':!![]}];}_0x5e611c=_[_0xf2e3('0x38')]({},_0x5e611c,_0x4fdc19[_0xf2e3('0x3a')]);return db[_0xf2e3('0x28')][_0xf2e3('0x42')](_0x5e611c)[_0xf2e3('0x22')](handleEntityNotFound(_0x1c6ee4,null))[_0xf2e3('0x22')](respondWithResult(_0x1c6ee4,null))[_0xf2e3('0x3f')](handleError(_0x1c6ee4,null));};exports[_0xf2e3('0x43')]=function(_0x5c7036,_0x27904a){return db['VoiceTransferReport']['create'](_0x5c7036['body'],{})[_0xf2e3('0x22')](respondWithResult(_0x27904a,0xc9))[_0xf2e3('0x3f')](handleError(_0x27904a,null));};exports['update']=function(_0x48e51d,_0x367fa9){if(_0x48e51d[_0xf2e3('0x44')]['id']){delete _0x48e51d[_0xf2e3('0x44')]['id'];}return db[_0xf2e3('0x28')][_0xf2e3('0x42')]({'where':{'id':_0x48e51d[_0xf2e3('0x40')]['id']}})[_0xf2e3('0x22')](handleEntityNotFound(_0x367fa9,null))[_0xf2e3('0x22')](saveUpdates(_0x48e51d[_0xf2e3('0x44')],null))['then'](respondWithResult(_0x367fa9,null))[_0xf2e3('0x3f')](handleError(_0x367fa9,null));};exports[_0xf2e3('0x23')]=function(_0x2afefb,_0x222486){return db[_0xf2e3('0x28')][_0xf2e3('0x42')]({'where':{'id':_0x2afefb['params']['id']}})[_0xf2e3('0x22')](handleEntityNotFound(_0x222486,null))[_0xf2e3('0x22')](removeEntity(_0x222486,null))[_0xf2e3('0x3f')](handleError(_0x222486,null));};exports['describe']=function(_0x2872cc,_0x34d5e2){return db[_0xf2e3('0x28')][_0xf2e3('0x45')]()[_0xf2e3('0x22')](respondWithResult(_0x34d5e2,null))[_0xf2e3('0x3f')](handleError(_0x34d5e2,null));}; \ No newline at end of file +var _0xae11=['findAll','catch','show','params','includeAll','find','create','body','describe','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','filters','pick','where','VIRTUAL','filter','merge','options','include'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0xae11,0xde));var _0x1ae1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xae11[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ae1('0x0'));var rp=require('request-promise');var moment=require(_0x1ae1('0x1'));var BPromise=require(_0x1ae1('0x2'));var Mustache=require(_0x1ae1('0x3'));var util=require('util');var path=require(_0x1ae1('0x4'));var sox=require(_0x1ae1('0x5'));var csv=require(_0x1ae1('0x6'));var ejs=require(_0x1ae1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ae1('0x8'));var squel=require(_0x1ae1('0x9'));var crypto=require('crypto');var jsforce=require(_0x1ae1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1ae1('0x6'));var querystring=require(_0x1ae1('0xb'));var Papa=require(_0x1ae1('0xc'));var Redis=require(_0x1ae1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1ae1('0xe'));var as=require(_0x1ae1('0xf'));var hardwareService=require(_0x1ae1('0x10'));var logger=require(_0x1ae1('0x11'))(_0x1ae1('0x12'));var utils=require(_0x1ae1('0x13'));var config=require(_0x1ae1('0x14'));var licenseUtil=require(_0x1ae1('0x15'));var db=require(_0x1ae1('0x16'))['db'];function respondWithStatusCode(_0x53049a,_0x12aa2d){_0x12aa2d=_0x12aa2d||0xcc;return function(_0x41de37){if(_0x41de37){return _0x53049a['sendStatus'](_0x12aa2d);}return _0x53049a[_0x1ae1('0x17')](_0x12aa2d)[_0x1ae1('0x18')]();};}function respondWithResult(_0x49ec0c,_0x53c5e7){_0x53c5e7=_0x53c5e7||0xc8;return function(_0x2b8feb){if(_0x2b8feb){return _0x49ec0c[_0x1ae1('0x17')](_0x53c5e7)[_0x1ae1('0x19')](_0x2b8feb);}};}function respondWithFilteredResult(_0x3c39af,_0x520db7){return function(_0x231358){if(_0x231358){var _0x54bb02=typeof _0x520db7[_0x1ae1('0x1a')]===_0x1ae1('0x1b')&&typeof _0x520db7[_0x1ae1('0x1c')]===_0x1ae1('0x1b');var _0x1d2216=_0x231358[_0x1ae1('0x1d')];var _0x3cf27d=_0x54bb02?0x0:_0x520db7[_0x1ae1('0x1a')];var _0x4335f0=_0x54bb02?_0x231358[_0x1ae1('0x1d')]:_0x520db7[_0x1ae1('0x1a')]+_0x520db7[_0x1ae1('0x1c')];var _0x208b33;if(_0x4335f0>=_0x1d2216){_0x4335f0=_0x1d2216;_0x208b33=0xc8;}else{_0x208b33=0xce;}_0x3c39af[_0x1ae1('0x17')](_0x208b33);return _0x3c39af[_0x1ae1('0x1e')](_0x1ae1('0x1f'),_0x3cf27d+'-'+_0x4335f0+'/'+_0x1d2216)['json'](_0x231358);}return null;};}function patchUpdates(_0x1a05b2){return function(_0x33dda9){try{jsonpatch[_0x1ae1('0x20')](_0x33dda9,_0x1a05b2,!![]);}catch(_0x14744e){return BPromise['reject'](_0x14744e);}return _0x33dda9[_0x1ae1('0x21')]();};}function saveUpdates(_0x45140e,_0x49b8cb){return function(_0x24c2b0){if(_0x24c2b0){return _0x24c2b0[_0x1ae1('0x22')](_0x45140e)[_0x1ae1('0x23')](function(_0x3cffa8){return _0x3cffa8;});}return null;};}function removeEntity(_0x703fb7,_0x651992){return function(_0x289786){if(_0x289786){return _0x289786[_0x1ae1('0x24')]()[_0x1ae1('0x23')](function(){_0x703fb7[_0x1ae1('0x17')](0xcc)[_0x1ae1('0x18')]();});}};}function handleEntityNotFound(_0x2daded,_0x3c0e12){return function(_0x140e34){if(!_0x140e34){_0x2daded[_0x1ae1('0x25')](0x194);}return _0x140e34;};}function handleError(_0x55136c,_0x583a0d){_0x583a0d=_0x583a0d||0x1f4;return function(_0x4fdf60){logger['error'](_0x4fdf60[_0x1ae1('0x26')]);if(_0x4fdf60['name']){delete _0x4fdf60['name'];}_0x55136c[_0x1ae1('0x17')](_0x583a0d)['send'](_0x4fdf60);};}exports[_0x1ae1('0x27')]=function(_0x4782c8,_0x3181ac){var _0x136a4a={},_0x329e43={},_0x5f14ec={'count':0x0,'rows':[]};var _0xbb7ef6=_[_0x1ae1('0x28')](db[_0x1ae1('0x29')][_0x1ae1('0x2a')],function(_0x32a207){return{'name':_0x32a207[_0x1ae1('0x2b')],'type':_0x32a207[_0x1ae1('0x2c')][_0x1ae1('0x2d')]};});_0x329e43[_0x1ae1('0x2e')]=_[_0x1ae1('0x28')](_0xbb7ef6,_0x1ae1('0x2f'));_0x329e43[_0x1ae1('0x30')]=_[_0x1ae1('0x31')](_0x4782c8[_0x1ae1('0x30')]);_0x329e43['filters']=_[_0x1ae1('0x32')](_0x329e43['model'],_0x329e43[_0x1ae1('0x30')]);_0x136a4a[_0x1ae1('0x33')]=_[_0x1ae1('0x32')](_0x329e43[_0x1ae1('0x2e')],qs[_0x1ae1('0x34')](_0x4782c8['query'][_0x1ae1('0x34')]));_0x136a4a['attributes']=_0x136a4a[_0x1ae1('0x33')][_0x1ae1('0x35')]?_0x136a4a[_0x1ae1('0x33')]:_0x329e43[_0x1ae1('0x2e')];if(!_0x4782c8['query']['hasOwnProperty']('nolimit')){_0x136a4a[_0x1ae1('0x1c')]=qs['limit'](_0x4782c8['query'][_0x1ae1('0x1c')]);_0x136a4a[_0x1ae1('0x1a')]=qs[_0x1ae1('0x1a')](_0x4782c8[_0x1ae1('0x30')]['offset']);}_0x136a4a['order']=qs['sort'](_0x4782c8[_0x1ae1('0x30')]['sort']);_0x136a4a['where']=qs[_0x1ae1('0x36')](_[_0x1ae1('0x37')](_0x4782c8[_0x1ae1('0x30')],_0x329e43[_0x1ae1('0x36')]),_0xbb7ef6);if(_0x4782c8[_0x1ae1('0x30')]['filter']){_0x136a4a[_0x1ae1('0x38')]=_['merge'](_0x136a4a[_0x1ae1('0x38')],{'$or':_['map'](_0xbb7ef6,function(_0x3a32c5){if(_0x3a32c5[_0x1ae1('0x2c')]!==_0x1ae1('0x39')){var _0x2a60d1={};_0x2a60d1[_0x3a32c5[_0x1ae1('0x2f')]]={'$like':'%'+_0x4782c8[_0x1ae1('0x30')][_0x1ae1('0x3a')]+'%'};return _0x2a60d1;}})});}_0x136a4a=_[_0x1ae1('0x3b')]({},_0x136a4a,_0x4782c8[_0x1ae1('0x3c')]);var _0x4ccd77={'where':_0x136a4a['where']};return db[_0x1ae1('0x29')][_0x1ae1('0x1d')](_0x4ccd77)['then'](function(_0xbff45a){_0x5f14ec[_0x1ae1('0x1d')]=_0xbff45a;if(_0x4782c8[_0x1ae1('0x30')]['includeAll']){_0x136a4a[_0x1ae1('0x3d')]=[{'all':!![]}];}return db[_0x1ae1('0x29')][_0x1ae1('0x3e')](_0x136a4a);})[_0x1ae1('0x23')](function(_0x2c2ee7){_0x5f14ec['rows']=_0x2c2ee7;return _0x5f14ec;})[_0x1ae1('0x23')](respondWithFilteredResult(_0x3181ac,_0x136a4a))[_0x1ae1('0x3f')](handleError(_0x3181ac,null));};exports[_0x1ae1('0x40')]=function(_0x3d8862,_0x462b36){var _0x376143={'raw':!![],'where':{'id':_0x3d8862[_0x1ae1('0x41')]['id']}},_0x1ab810={};_0x1ab810[_0x1ae1('0x2e')]=_[_0x1ae1('0x31')](db[_0x1ae1('0x29')]['rawAttributes']);_0x1ab810[_0x1ae1('0x30')]=_['keys'](_0x3d8862[_0x1ae1('0x30')]);_0x1ab810['filters']=_[_0x1ae1('0x32')](_0x1ab810['model'],_0x1ab810[_0x1ae1('0x30')]);_0x376143[_0x1ae1('0x33')]=_[_0x1ae1('0x32')](_0x1ab810[_0x1ae1('0x2e')],qs[_0x1ae1('0x34')](_0x3d8862[_0x1ae1('0x30')][_0x1ae1('0x34')]));_0x376143[_0x1ae1('0x33')]=_0x376143[_0x1ae1('0x33')][_0x1ae1('0x35')]?_0x376143[_0x1ae1('0x33')]:_0x1ab810[_0x1ae1('0x2e')];if(_0x3d8862[_0x1ae1('0x30')][_0x1ae1('0x42')]){_0x376143[_0x1ae1('0x3d')]=[{'all':!![]}];}_0x376143=_[_0x1ae1('0x3b')]({},_0x376143,_0x3d8862[_0x1ae1('0x3c')]);return db[_0x1ae1('0x29')][_0x1ae1('0x43')](_0x376143)[_0x1ae1('0x23')](handleEntityNotFound(_0x462b36,null))[_0x1ae1('0x23')](respondWithResult(_0x462b36,null))[_0x1ae1('0x3f')](handleError(_0x462b36,null));};exports['create']=function(_0x16a91e,_0xba5e26){return db[_0x1ae1('0x29')][_0x1ae1('0x44')](_0x16a91e[_0x1ae1('0x45')],{})[_0x1ae1('0x23')](respondWithResult(_0xba5e26,0xc9))[_0x1ae1('0x3f')](handleError(_0xba5e26,null));};exports[_0x1ae1('0x22')]=function(_0x1f4402,_0x5690a4){if(_0x1f4402['body']['id']){delete _0x1f4402[_0x1ae1('0x45')]['id'];}return db[_0x1ae1('0x29')][_0x1ae1('0x43')]({'where':{'id':_0x1f4402[_0x1ae1('0x41')]['id']}})[_0x1ae1('0x23')](handleEntityNotFound(_0x5690a4,null))['then'](saveUpdates(_0x1f4402[_0x1ae1('0x45')],null))[_0x1ae1('0x23')](respondWithResult(_0x5690a4,null))[_0x1ae1('0x3f')](handleError(_0x5690a4,null));};exports['destroy']=function(_0x511c32,_0x70c833){return db[_0x1ae1('0x29')]['find']({'where':{'id':_0x511c32['params']['id']}})[_0x1ae1('0x23')](handleEntityNotFound(_0x70c833,null))[_0x1ae1('0x23')](removeEntity(_0x70c833,null))['catch'](handleError(_0x70c833,null));};exports[_0x1ae1('0x46')]=function(_0x38e4e6,_0x408256){return db['VoiceTransferReport'][_0x1ae1('0x46')]()[_0x1ae1('0x23')](respondWithResult(_0x408256,null))['catch'](handleError(_0x408256,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 31d5fff..b9e16c2 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 _0xbca3=['lodash','util','api','request-promise','path','rimraf','exports','define','VoiceTransferReport'];(function(_0x1927dc,_0x235225){var _0x4882dc=function(_0x419205){while(--_0x419205){_0x1927dc['push'](_0x1927dc['shift']());}};_0x4882dc(++_0x235225);}(_0xbca3,0xd8));var _0x3bca=function(_0x3f6475,_0x4a907f){_0x3f6475=_0x3f6475-0x0;var _0x10f510=_0xbca3[_0x3f6475];return _0x10f510;};'use strict';var _=require(_0x3bca('0x0'));var util=require(_0x3bca('0x1'));var logger=require('../../config/logger')(_0x3bca('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3bca('0x3'));var fs=require('fs');var path=require(_0x3bca('0x4'));var rimraf=require(_0x3bca('0x5'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x3bca('0x6')]=function(_0x2edf24,_0x3258cd){return _0x2edf24[_0x3bca('0x7')](_0x3bca('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae3f=['define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','bluebird','request-promise','path','exports'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xae3f,0x1ed));var _0xfae3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xae3f[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xfae3('0x0'));var logger=require(_0xfae3('0x1'))(_0xfae3('0x2'));var moment=require('moment');var BPromise=require(_0xfae3('0x3'));var rp=require(_0xfae3('0x4'));var fs=require('fs');var path=require(_0xfae3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xfae3('0x6')]=function(_0x3a4ada,_0x281248){return _0x3a4ada[_0xfae3('0x7')](_0xfae3('0x8'),attributes,{'tableName':_0xfae3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 802d6f2..7dc3aa7 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 _0xc98e=['info','request\x20sent','debug','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1c443f,_0x51319d){var _0x4a4a71=function(_0x355b73){while(--_0x355b73){_0x1c443f['push'](_0x1c443f['shift']());}};_0x4a4a71(++_0x51319d);}(_0xc98e,0x188));var _0xec98=function(_0x51910a,_0x102135){_0x51910a=_0x51910a-0x0;var _0x468384=_0xc98e[_0x51910a];return _0x468384;};'use strict';var _=require(_0xec98('0x0'));var util=require(_0xec98('0x1'));var moment=require(_0xec98('0x2'));var BPromise=require(_0xec98('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec98('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec98('0x5'));var logger=require(_0xec98('0x6'))(_0xec98('0x7'));var config=require(_0xec98('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xec98('0x9')][_0xec98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4801f1,_0x10f508,_0x15eb55){return new BPromise(function(_0x2b4f8a,_0x3c0afc){return client[_0xec98('0xb')](_0x4801f1,_0x15eb55)[_0xec98('0xc')](function(_0x423579){logger[_0xec98('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f508,_0xec98('0xe'));logger[_0xec98('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x10f508,_0xec98('0xe'),JSON['stringify'](_0x423579));if(_0x423579[_0xec98('0x10')]){if(_0x423579[_0xec98('0x10')][_0xec98('0x11')]===0x1f4){logger[_0xec98('0x10')](_0xec98('0x12'),_0x10f508,_0x423579[_0xec98('0x10')]['message']);return _0x3c0afc(_0x423579[_0xec98('0x10')][_0xec98('0x13')]);}logger[_0xec98('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f508,_0x423579['error'][_0xec98('0x13')]);return _0x2b4f8a(_0x423579[_0xec98('0x10')][_0xec98('0x13')]);}else{logger[_0xec98('0xd')](_0xec98('0x12'),_0x10f508,_0xec98('0xe'));_0x2b4f8a(_0x423579[_0xec98('0x14')]['message']);}})['catch'](function(_0x590738){logger[_0xec98('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x10f508,_0x590738);_0x3c0afc(_0x590738);});});}exports[_0xec98('0x15')]=function(_0x4f8a2c){var _0x453374=this;return new Promise(function(_0x411a47,_0x2aa138){return db['VoiceTransferReport'][_0xec98('0x16')](_0x4f8a2c[_0xec98('0x17')],{'raw':_0x4f8a2c['options']?_0x4f8a2c[_0xec98('0x18')][_0xec98('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1903a8){logger[_0xec98('0xd')](_0xec98('0x15'),_0x4f8a2c);logger['debug'](_0xec98('0x15'),_0x4f8a2c,JSON['stringify'](_0x1903a8));_0x411a47(_0x1903a8);})[_0xec98('0x1a')](function(_0x51e47e){logger[_0xec98('0x10')](_0xec98('0x15'),_0x51e47e[_0xec98('0x13')],_0x4f8a2c);_0x2aa138(_0x453374[_0xec98('0x10')](0x1f4,_0x51e47e['message']));});});}; \ No newline at end of file +var _0xb780=['VoiceTransferReport,\x20%s,\x20%s','message','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','info','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x32e94b,_0x38c7a7){var _0x3b1567=function(_0x282670){while(--_0x282670){_0x32e94b['push'](_0x32e94b['shift']());}};_0x3b1567(++_0x38c7a7);}(_0xb780,0x1a8));var _0x0b78=function(_0x36107f,_0x354b5a){_0x36107f=_0x36107f-0x0;var _0x4a2900=_0xb780[_0x36107f];return _0x4a2900;};'use strict';var _=require(_0x0b78('0x0'));var util=require(_0x0b78('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b78('0x2'));var db=require(_0x0b78('0x3'))['db'];var utils=require(_0x0b78('0x4'));var logger=require(_0x0b78('0x5'))(_0x0b78('0x6'));var config=require(_0x0b78('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b78('0x8')][_0x0b78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x552bd0,_0x4ec611,_0x43eb93){return new BPromise(function(_0x18e6d7,_0x33fe3c){return client[_0x0b78('0xa')](_0x552bd0,_0x43eb93)[_0x0b78('0xb')](function(_0x5d7cc5){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x4ec611,'request\x20sent');logger[_0x0b78('0xc')](_0x0b78('0xd'),_0x4ec611,_0x0b78('0xe'),JSON[_0x0b78('0xf')](_0x5d7cc5));if(_0x5d7cc5[_0x0b78('0x10')]){if(_0x5d7cc5[_0x0b78('0x10')][_0x0b78('0x11')]===0x1f4){logger[_0x0b78('0x10')](_0x0b78('0x12'),_0x4ec611,_0x5d7cc5[_0x0b78('0x10')][_0x0b78('0x13')]);return _0x33fe3c(_0x5d7cc5[_0x0b78('0x10')][_0x0b78('0x13')]);}logger['error'](_0x0b78('0x12'),_0x4ec611,_0x5d7cc5['error']['message']);return _0x18e6d7(_0x5d7cc5['error'][_0x0b78('0x13')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x4ec611,_0x0b78('0xe'));_0x18e6d7(_0x5d7cc5['result'][_0x0b78('0x13')]);}})[_0x0b78('0x14')](function(_0x59c441){logger[_0x0b78('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ec611,_0x59c441);_0x33fe3c(_0x59c441);});});}exports[_0x0b78('0x15')]=function(_0x3e535a){var _0x1b998b=this;return new Promise(function(_0x175333,_0x1d44dc){return db[_0x0b78('0x16')]['create'](_0x3e535a[_0x0b78('0x17')],{'raw':_0x3e535a['options']?_0x3e535a[_0x0b78('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0b78('0xb')](function(_0xab99e0){logger[_0x0b78('0x19')](_0x0b78('0x15'),_0x3e535a);logger[_0x0b78('0xc')]('CreateVoiceTransferReport',_0x3e535a,JSON['stringify'](_0xab99e0));_0x175333(_0xab99e0);})[_0x0b78('0x14')](function(_0x305863){logger['error']('CreateVoiceTransferReport',_0x305863[_0x0b78('0x13')],_0x3e535a);_0x1d44dc(_0x1b998b[_0x0b78('0x10')](0x1f4,_0x305863[_0x0b78('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index e4a2e46..ee584c5 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x142f9b,_0x904a81){var _0x57eba6=function(_0xcfe723){while(--_0xcfe723){_0x142f9b['push'](_0x142f9b['shift']());}};_0x57eba6(++_0x904a81);}(_0xe5b3,0x133));var _0x3e5b=function(_0x40244d,_0x54cfeb){_0x40244d=_0x40244d-0x0;var _0x28917f=_0xe5b3[_0x40244d];return _0x28917f;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x47d393,_0x4833d8){var _0x420486=function(_0x470d66){while(--_0x470d66){_0x47d393['push'](_0x47d393['shift']());}};_0x420486(++_0x4833d8);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xb4e6[_0x4d8a8f];return _0xfc4adc;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 2aa3f5f..9cf59fd 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 _0x0e9f=['answer\x20executed!','hold','hold\x20fired:','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','path','lodash','util','client','webbarapi','ioredis','defaults','localhost','socket.io-emitter','redis','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required','info','stringify','log','handleError:','name','status','request','error','code','message','result','catch','User','then','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','body','validate','length','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:'];(function(_0x32f489,_0x2bf8c5){var _0x2cac33=function(_0x3aaccd){while(--_0x3aaccd){_0x32f489['push'](_0x32f489['shift']());}};_0x2cac33(++_0x2bf8c5);}(_0x0e9f,0x116));var _0xf0e9=function(_0x1f0172,_0x5b2b8e){_0x1f0172=_0x1f0172-0x0;var _0x580f60=_0x0e9f[_0x1f0172];return _0x580f60;};'use strict';var path=require(_0xf0e9('0x0'));var fs=require('fs');var _=require(_0xf0e9('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xf0e9('0x2'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0xf0e9('0x3')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0xf0e9('0x4'));var Redis=require(_0xf0e9('0x5'));config['redis']=_[_0xf0e9('0x6')](config['redis'],{'host':_0xf0e9('0x7'),'port':0x18eb});var io=require(_0xf0e9('0x8'))(new Redis(config[_0xf0e9('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf0e9('0xa')]},'callNumber':{'type':_0xf0e9('0xb'),'required':[!![],_0xf0e9('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xf0e9('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':_0xf0e9('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf0e9('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xf0e9('0xb'),'required':[!![],_0xf0e9('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':_0xf0e9('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]},'sessionId':{'type':_0xf0e9('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xf0e9('0xd'),'required':[!![],_0xf0e9('0xa')]}});function emit(_0x4f37b5,_0x320a29,_0xcf4be0){logger[_0xf0e9('0xf')](_0x4f37b5,_0x320a29,JSON[_0xf0e9('0x10')](_0xcf4be0));io['to'](_0x4f37b5)['emit'](_0x320a29,_0xcf4be0);}function handleError(_0x45a4fb){return function(_0x2f4ee3){console[_0xf0e9('0x11')](_0xf0e9('0x12'),_0x2f4ee3,_0x2f4ee3 instanceof RangeError);logger['error'](_0x2f4ee3['stack']);if(_0x2f4ee3 instanceof RangeError){if(_0x2f4ee3[_0xf0e9('0x13')]){delete _0x2f4ee3[_0xf0e9('0x13')];}_0x45a4fb[_0xf0e9('0x14')](0x194)['send'](_0x2f4ee3);}else{if(_0x2f4ee3['name']){delete _0x2f4ee3[_0xf0e9('0x13')];}_0x45a4fb[_0xf0e9('0x14')](0x1f4)['send'](_0x2f4ee3);}};}function checkError(){return function(_0x3d6c12){if(!_0x3d6c12){throw new RangeError('NotFound');}return _0x3d6c12;};}function respondWithRpcPromise(_0x3916aa,_0x1c956d){return new BPromise(function(_0x4afcff,_0x5dd652){var _0x186fa5=amiClient;return _0x186fa5[_0xf0e9('0x15')](_0x3916aa,_0x1c956d)['then'](function(_0x1cd143){if(_0x1cd143[_0xf0e9('0x16')]){if(_0x1cd143['error'][_0xf0e9('0x17')]===0x1f4){return _0x5dd652(_0x1cd143[_0xf0e9('0x16')]['message']);}return _0x4afcff(_0x1cd143[_0xf0e9('0x16')][_0xf0e9('0x18')]);}else{_0x4afcff(_0x1cd143[_0xf0e9('0x19')]);}})[_0xf0e9('0x1a')](function(_0x33048a){_0x5dd652(_0x33048a);});});}function getAgent(_0x25eacb){return db[_0xf0e9('0x1b')]['findOne']({'where':{'id':_0x25eacb,'role':'agent'}})[_0xf0e9('0x1c')](checkError());}function getAgentCheckSession(_0x4f9e96,_0x553788){return new BPromise(function(_0x5aac7f,_0x8b5167){var _0x8fd443=respondWithRpcPromise('VoiceChannels');var _0x258927=getAgent(_0x4f9e96);Promise[_0xf0e9('0x1d')]([_0x8fd443,_0x258927])[_0xf0e9('0x1c')](function(_0x480b7d){var _0x2fa5e9=_0x480b7d[0x0];var _0x337a59=_0x480b7d[0x1];var _0x439072=_[_0xf0e9('0x1e')](_0x2fa5e9[_0xf0e9('0x1f')],function(_0xf90eea){return _0xf90eea[_0xf0e9('0x20')]==_0x337a59['id']&&_0xf90eea[_0xf0e9('0x21')]==_0x553788;});if(_0x439072['length']==0x1){_0x5aac7f(_0x337a59);}else{_0x8b5167(new RangeError(_0xf0e9('0x22')+_0x553788+_0xf0e9('0x23')));}});});}exports['originate']=function(_0x4822c9,_0x25452f){logger[_0xf0e9('0xf')]('originate\x20fired:',_0x4822c9[_0xf0e9('0x24')]);var _0x10ae6c=originateValidation[_0xf0e9('0x25')](_0x4822c9[_0xf0e9('0x24')]);if(_0x10ae6c[_0xf0e9('0x26')]>0x0){return _0x25452f[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x10ae6c);}var _0x11812e=_0x4822c9['body'][_0xf0e9('0x28')];var _0x2dc765=_0x4822c9['body'][_0xf0e9('0x29')];var _0x4a8c60=_0x4822c9[_0xf0e9('0x24')]['callerId'];var _0x592402=_0x4822c9[_0xf0e9('0x24')][_0xf0e9('0x2a')];return getAgent(_0x11812e)[_0xf0e9('0x1c')](function(_0x4661bc){logger[_0xf0e9('0xf')](_0xf0e9('0x2b'),_0x4661bc['name']);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x4661bc[_0xf0e9('0x13')]),'webbar:originate',{'callNumber':_0x2dc765,'callerId':_0x4a8c60,'callbackUrl':_0x592402});return _0x25452f[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':_0xf0e9('0x2e')});})[_0xf0e9('0x1a')](handleError(_0x25452f));};exports[_0xf0e9('0x2f')]=function(_0x3ab157,_0xd20a18){logger[_0xf0e9('0xf')](_0xf0e9('0x30'),_0x3ab157[_0xf0e9('0x24')]);var _0x48040c=hangupValidation[_0xf0e9('0x25')](_0x3ab157[_0xf0e9('0x24')]);if(_0x48040c['length']>0x0){return _0xd20a18[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x48040c);}var _0x390f75=_0x3ab157[_0xf0e9('0x24')][_0xf0e9('0x28')];var _0x4ef477=_0x3ab157[_0xf0e9('0x24')][_0xf0e9('0x21')];return getAgent(_0x390f75)['then'](function(_0x27173f){logger['info'](_0xf0e9('0x2b'),_0x27173f['name']);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x27173f['name']),_0xf0e9('0x31'),{'sessionId':_0x4ef477});return _0xd20a18['status'](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0xf0e9('0x1a')](handleError(_0xd20a18));};exports[_0xf0e9('0x32')]=function(_0x13975e,_0x405bf3){logger['info'](_0xf0e9('0x33'),_0x13975e[_0xf0e9('0x24')]);var _0x50fc1b=answerValidation['validate'](_0x13975e[_0xf0e9('0x24')]);if(_0x50fc1b[_0xf0e9('0x26')]>0x0){return _0x405bf3[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x50fc1b);}var _0x1e9c7e=_0x13975e['body'][_0xf0e9('0x28')];var _0x75c120=_0x13975e[_0xf0e9('0x24')][_0xf0e9('0x21')];return getAgent(_0x1e9c7e)[_0xf0e9('0x1c')](function(_0x33a3b5){logger[_0xf0e9('0xf')]('entityFound:',_0x33a3b5[_0xf0e9('0x13')]);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x33a3b5[_0xf0e9('0x13')]),'webbar:answer',{'sessionId':_0x75c120});return _0x405bf3[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':_0xf0e9('0x34')});})['catch'](handleError(_0x405bf3));};exports[_0xf0e9('0x35')]=function(_0x33f702,_0x176871){logger[_0xf0e9('0xf')](_0xf0e9('0x36'),_0x33f702[_0xf0e9('0x24')]);var _0x25f741=holdValidation[_0xf0e9('0x25')](_0x33f702[_0xf0e9('0x24')]);if(_0x25f741[_0xf0e9('0x26')]>0x0){return _0x176871[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x25f741);}var _0x317419=_0x33f702[_0xf0e9('0x24')][_0xf0e9('0x28')];var _0x44967c=_0x33f702[_0xf0e9('0x24')][_0xf0e9('0x21')];return getAgent(_0x317419)[_0xf0e9('0x1c')](function(_0x39def0){logger[_0xf0e9('0xf')](_0xf0e9('0x2b'),_0x39def0[_0xf0e9('0x13')]);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x39def0[_0xf0e9('0x13')]),'webbar:hold',{'sessionId':_0x44967c});return _0x176871[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':'hold\x20executed!'});})[_0xf0e9('0x1a')](handleError(_0x176871));};exports[_0xf0e9('0x37')]=function(_0x26789c,_0x19419e){logger[_0xf0e9('0xf')]('unhold\x20fired:',_0x26789c[_0xf0e9('0x24')]);var _0x5ea49e=unholdValidation[_0xf0e9('0x25')](_0x26789c['body']);if(_0x5ea49e[_0xf0e9('0x26')]>0x0){return _0x19419e[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x5ea49e);}var _0xc7c4fa=_0x26789c['body']['userId'];var _0x2eaceb=_0x26789c['body'][_0xf0e9('0x21')];return getAgent(_0xc7c4fa)[_0xf0e9('0x1c')](function(_0x58f225){logger[_0xf0e9('0xf')]('entityFound:',_0x58f225[_0xf0e9('0x13')]);emit(util['format'](_0xf0e9('0x2d'),_0x58f225['name']),_0xf0e9('0x38'),{'sessionId':_0x2eaceb});return _0x19419e[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'error':![],'message':_0xf0e9('0x39')});})['catch'](handleError(_0x19419e));};exports[_0xf0e9('0x3a')]=function(_0x5ee5fb,_0xabea45){logger['info'](_0xf0e9('0x3b'),_0xabea45[_0xf0e9('0x24')]);var _0x43fdc5=callsValidation[_0xf0e9('0x25')](_0x5ee5fb['body']);if(_0x43fdc5[_0xf0e9('0x26')]>0x0){return _0xabea45['status'](0x190)[_0xf0e9('0x27')](_0x43fdc5);}var _0x573349=_0x5ee5fb[_0xf0e9('0x24')][_0xf0e9('0x28')];var _0x6f08d9=respondWithRpcPromise(_0xf0e9('0x3c'));var _0x54a911=getAgent(_0x573349);return Promise['all']([_0x6f08d9,_0x54a911])[_0xf0e9('0x1c')](function(_0xc9dcf2){var _0xaa2ec8=_0xc9dcf2[0x0];var _0x356a71=_0xc9dcf2[0x1];var _0x20333d=_[_0xf0e9('0x1e')](_0xaa2ec8[_0xf0e9('0x1f')],function(_0xe36788){return _0xe36788[_0xf0e9('0x20')]==_0x356a71['id'];});return _0xabea45[_0xf0e9('0x14')](0xc8)[_0xf0e9('0x27')]({'count':_0x20333d[_0xf0e9('0x26')],'rows':_0x20333d});})[_0xf0e9('0x1a')](handleError(_0xabea45));};exports[_0xf0e9('0x3d')]=function(_0x5d9ebb,_0x56c259){logger[_0xf0e9('0xf')]('conference\x20fired:',_0x5d9ebb[_0xf0e9('0x24')]);var _0x42189e=conferenceValidation['validate'](_0x5d9ebb[_0xf0e9('0x24')]);if(_0x42189e[_0xf0e9('0x26')]>0x0){return _0x56c259[_0xf0e9('0x14')](0x190)[_0xf0e9('0x27')](_0x42189e);}var _0x393d6b=_0x5d9ebb[_0xf0e9('0x24')][_0xf0e9('0x28')];return getAgent(_0x393d6b)[_0xf0e9('0x1c')](function(_0x3550ea){logger[_0xf0e9('0xf')]('entityFound:',_0x3550ea[_0xf0e9('0x13')]);emit(util['format']('user:%s',_0x3550ea[_0xf0e9('0x13')]),_0xf0e9('0x3e'));return _0x56c259[_0xf0e9('0x14')](0xc8)['json']({'error':![],'message':_0xf0e9('0x3f')});})[_0xf0e9('0x1a')](handleError(_0x56c259));};exports['transfer']=function(_0x4b64d5,_0x75a07b){logger[_0xf0e9('0xf')](_0xf0e9('0x40'),_0x4b64d5[_0xf0e9('0x24')]);var _0x2e8ef8=transferValidation['validate'](_0x4b64d5[_0xf0e9('0x24')]);if(_0x2e8ef8[_0xf0e9('0x26')]>0x0){return _0x75a07b[_0xf0e9('0x14')](0x190)['json'](_0x2e8ef8);}var _0x2669e6=_0x4b64d5['body'][_0xf0e9('0x28')];var _0x19061d=_0x4b64d5['body'][_0xf0e9('0x21')];var _0x20a111=_0x4b64d5[_0xf0e9('0x24')][_0xf0e9('0x41')];return getAgent(_0x2669e6)[_0xf0e9('0x1c')](function(_0x11a77a){logger[_0xf0e9('0xf')](_0xf0e9('0x2b'),_0x11a77a[_0xf0e9('0x13')]);emit(util[_0xf0e9('0x2c')](_0xf0e9('0x2d'),_0x11a77a[_0xf0e9('0x13')]),'webbar:transfer',{'sessionId':_0x19061d,'transferNumber':_0x20a111});return _0x75a07b[_0xf0e9('0x14')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x75a07b));}; \ No newline at end of file +var _0x87ae=['sessionId','length','sessionId\x20','\x20not\x20found!','body','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer\x20executed!','catch','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','../../mysqldb','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','localhost','validate','userId\x20is\x20required','string','number','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','name','send','status','NotFound','request','then','result','User','findOne','agent','filter','UserId'];(function(_0x35fd05,_0x1c8af7){var _0x103cf6=function(_0x364ae1){while(--_0x364ae1){_0x35fd05['push'](_0x35fd05['shift']());}};_0x103cf6(++_0x1c8af7);}(_0x87ae,0xf5));var _0xe87a=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x87ae[_0xf48cce];return _0x2a5c38;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xe87a('0x0'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xe87a('0x1'));var jayson=require(_0xe87a('0x2'));var amiClient=jayson[_0xe87a('0x3')]['http']({'port':0x232a});var logger=require(_0xe87a('0x4'))(_0xe87a('0x5'));var Redis=require(_0xe87a('0x6'));config['redis']=_['defaults'](config[_0xe87a('0x7')],{'host':_0xe87a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe87a('0x7')]));var Schema=require(_0xe87a('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe87a('0xa')]},'callNumber':{'type':_0xe87a('0xb'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xe87a('0xb')},'callbackUrl':{'type':_0xe87a('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],_0xe87a('0xa')]},'sessionId':{'type':_0xe87a('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],_0xe87a('0xa')]},'sessionId':{'type':_0xe87a('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xe87a('0xb'),'required':[!![],_0xe87a('0xd')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe87a('0xa')]},'sessionId':{'type':_0xe87a('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xe87a('0xc'),'required':[!![],_0xe87a('0xa')]}});function emit(_0xd2ca53,_0x175626,_0x4d66ce){logger[_0xe87a('0xe')](_0xd2ca53,_0x175626,JSON[_0xe87a('0xf')](_0x4d66ce));io['to'](_0xd2ca53)['emit'](_0x175626,_0x4d66ce);}function handleError(_0x5f31e3){return function(_0x4160e2){console['log'](_0xe87a('0x10'),_0x4160e2,_0x4160e2 instanceof RangeError);logger[_0xe87a('0x11')](_0x4160e2[_0xe87a('0x12')]);if(_0x4160e2 instanceof RangeError){if(_0x4160e2['name']){delete _0x4160e2[_0xe87a('0x13')];}_0x5f31e3['status'](0x194)[_0xe87a('0x14')](_0x4160e2);}else{if(_0x4160e2[_0xe87a('0x13')]){delete _0x4160e2[_0xe87a('0x13')];}_0x5f31e3[_0xe87a('0x15')](0x1f4)[_0xe87a('0x14')](_0x4160e2);}};}function checkError(){return function(_0x5be8f6){if(!_0x5be8f6){throw new RangeError(_0xe87a('0x16'));}return _0x5be8f6;};}function respondWithRpcPromise(_0x46e943,_0x5dd73f){return new BPromise(function(_0x59c17c,_0x42ba03){var _0x363c6a=amiClient;return _0x363c6a[_0xe87a('0x17')](_0x46e943,_0x5dd73f)[_0xe87a('0x18')](function(_0x15ced2){if(_0x15ced2[_0xe87a('0x11')]){if(_0x15ced2['error']['code']===0x1f4){return _0x42ba03(_0x15ced2['error']['message']);}return _0x59c17c(_0x15ced2[_0xe87a('0x11')]['message']);}else{_0x59c17c(_0x15ced2[_0xe87a('0x19')]);}})['catch'](function(_0x19f21e){_0x42ba03(_0x19f21e);});});}function getAgent(_0xfb831e){return db[_0xe87a('0x1a')][_0xe87a('0x1b')]({'where':{'id':_0xfb831e,'role':_0xe87a('0x1c')}})[_0xe87a('0x18')](checkError());}function getAgentCheckSession(_0x4fe080,_0x3fc24e){return new BPromise(function(_0x5b984f,_0x58f10a){var _0x39ec27=respondWithRpcPromise('VoiceChannels');var _0x537b52=getAgent(_0x4fe080);Promise['all']([_0x39ec27,_0x537b52])[_0xe87a('0x18')](function(_0x6feaf6){var _0x36d4cc=_0x6feaf6[0x0];var _0x4eae3f=_0x6feaf6[0x1];var _0x565d01=_[_0xe87a('0x1d')](_0x36d4cc['rows'],function(_0x4f61f7){return _0x4f61f7[_0xe87a('0x1e')]==_0x4eae3f['id']&&_0x4f61f7[_0xe87a('0x1f')]==_0x3fc24e;});if(_0x565d01[_0xe87a('0x20')]==0x1){_0x5b984f(_0x4eae3f);}else{_0x58f10a(new RangeError(_0xe87a('0x21')+_0x3fc24e+_0xe87a('0x22')));}});});}exports['originate']=function(_0x218510,_0x4b80df){logger[_0xe87a('0xe')]('originate\x20fired:',_0x218510[_0xe87a('0x23')]);var _0x238141=originateValidation[_0xe87a('0x9')](_0x218510[_0xe87a('0x23')]);if(_0x238141[_0xe87a('0x20')]>0x0){return _0x4b80df[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x238141);}var _0x19825f=_0x218510[_0xe87a('0x23')][_0xe87a('0x25')];var _0x4d4824=_0x218510['body']['callNumber'];var _0x2b07fe=_0x218510['body'][_0xe87a('0x26')];var _0x919558=_0x218510['body'][_0xe87a('0x27')];return getAgent(_0x19825f)['then'](function(_0x53a351){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0x53a351[_0xe87a('0x13')]);emit(util[_0xe87a('0x29')]('user:%s',_0x53a351[_0xe87a('0x13')]),_0xe87a('0x2a'),{'callNumber':_0x4d4824,'callerId':_0x2b07fe,'callbackUrl':_0x919558});return _0x4b80df['status'](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x2b')});})['catch'](handleError(_0x4b80df));};exports[_0xe87a('0x2c')]=function(_0x211e37,_0x436eb0){logger[_0xe87a('0xe')](_0xe87a('0x2d'),_0x211e37['body']);var _0x27909a=hangupValidation['validate'](_0x211e37[_0xe87a('0x23')]);if(_0x27909a['length']>0x0){return _0x436eb0['status'](0x190)[_0xe87a('0x24')](_0x27909a);}var _0x31963a=_0x211e37[_0xe87a('0x23')][_0xe87a('0x25')];var _0x374153=_0x211e37[_0xe87a('0x23')][_0xe87a('0x1f')];return getAgent(_0x31963a)[_0xe87a('0x18')](function(_0xda1ce1){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0xda1ce1[_0xe87a('0x13')]);emit(util[_0xe87a('0x29')](_0xe87a('0x2e'),_0xda1ce1['name']),_0xe87a('0x2f'),{'sessionId':_0x374153});return _0x436eb0[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x30')});})['catch'](handleError(_0x436eb0));};exports['answer']=function(_0x4f92e0,_0x196d1b){logger['info']('answer\x20fired:',_0x4f92e0[_0xe87a('0x23')]);var _0x5eb62e=answerValidation['validate'](_0x4f92e0[_0xe87a('0x23')]);if(_0x5eb62e[_0xe87a('0x20')]>0x0){return _0x196d1b['status'](0x190)[_0xe87a('0x24')](_0x5eb62e);}var _0x4e8f4c=_0x4f92e0['body']['userId'];var _0x3aba9c=_0x4f92e0[_0xe87a('0x23')]['sessionId'];return getAgent(_0x4e8f4c)[_0xe87a('0x18')](function(_0x4684d0){logger[_0xe87a('0xe')]('entityFound:',_0x4684d0['name']);emit(util['format']('user:%s',_0x4684d0[_0xe87a('0x13')]),'webbar:answer',{'sessionId':_0x3aba9c});return _0x196d1b[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x31')});})[_0xe87a('0x32')](handleError(_0x196d1b));};exports['hold']=function(_0x3920cf,_0x3e12b1){logger['info'](_0xe87a('0x33'),_0x3920cf[_0xe87a('0x23')]);var _0x40bf40=holdValidation[_0xe87a('0x9')](_0x3920cf[_0xe87a('0x23')]);if(_0x40bf40[_0xe87a('0x20')]>0x0){return _0x3e12b1[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x40bf40);}var _0x2aa508=_0x3920cf['body'][_0xe87a('0x25')];var _0x13a590=_0x3920cf[_0xe87a('0x23')][_0xe87a('0x1f')];return getAgent(_0x2aa508)['then'](function(_0x6ddec4){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0x6ddec4[_0xe87a('0x13')]);emit(util[_0xe87a('0x29')](_0xe87a('0x2e'),_0x6ddec4[_0xe87a('0x13')]),_0xe87a('0x34'),{'sessionId':_0x13a590});return _0x3e12b1['status'](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x35')});})[_0xe87a('0x32')](handleError(_0x3e12b1));};exports['unhold']=function(_0x19d380,_0xc43c4a){logger[_0xe87a('0xe')](_0xe87a('0x36'),_0x19d380[_0xe87a('0x23')]);var _0x25418e=unholdValidation[_0xe87a('0x9')](_0x19d380[_0xe87a('0x23')]);if(_0x25418e[_0xe87a('0x20')]>0x0){return _0xc43c4a[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x25418e);}var _0x1f4272=_0x19d380['body'][_0xe87a('0x25')];var _0x9c063a=_0x19d380[_0xe87a('0x23')][_0xe87a('0x1f')];return getAgent(_0x1f4272)[_0xe87a('0x18')](function(_0x1f0d67){logger[_0xe87a('0xe')](_0xe87a('0x28'),_0x1f0d67[_0xe87a('0x13')]);emit(util['format']('user:%s',_0x1f0d67[_0xe87a('0x13')]),_0xe87a('0x37'),{'sessionId':_0x9c063a});return _0xc43c4a['status'](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x38')});})['catch'](handleError(_0xc43c4a));};exports[_0xe87a('0x39')]=function(_0x429955,_0x4d86f2){logger[_0xe87a('0xe')](_0xe87a('0x3a'),_0x4d86f2[_0xe87a('0x23')]);var _0xe84a3a=callsValidation['validate'](_0x429955['body']);if(_0xe84a3a[_0xe87a('0x20')]>0x0){return _0x4d86f2[_0xe87a('0x15')](0x190)['json'](_0xe84a3a);}var _0x2cc13d=_0x429955['body'][_0xe87a('0x25')];var _0x491199=respondWithRpcPromise(_0xe87a('0x3b'));var _0x5aec5e=getAgent(_0x2cc13d);return Promise[_0xe87a('0x3c')]([_0x491199,_0x5aec5e])['then'](function(_0x1d0f89){var _0x27910e=_0x1d0f89[0x0];var _0x45cb80=_0x1d0f89[0x1];var _0x1dc705=_[_0xe87a('0x1d')](_0x27910e[_0xe87a('0x3d')],function(_0x25c361){return _0x25c361[_0xe87a('0x1e')]==_0x45cb80['id'];});return _0x4d86f2[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'count':_0x1dc705[_0xe87a('0x20')],'rows':_0x1dc705});})['catch'](handleError(_0x4d86f2));};exports[_0xe87a('0x3e')]=function(_0xf14c4f,_0x2fdd5e){logger[_0xe87a('0xe')](_0xe87a('0x3f'),_0xf14c4f[_0xe87a('0x23')]);var _0x3efe6c=conferenceValidation[_0xe87a('0x9')](_0xf14c4f[_0xe87a('0x23')]);if(_0x3efe6c[_0xe87a('0x20')]>0x0){return _0x2fdd5e[_0xe87a('0x15')](0x190)[_0xe87a('0x24')](_0x3efe6c);}var _0x1c4f16=_0xf14c4f[_0xe87a('0x23')][_0xe87a('0x25')];return getAgent(_0x1c4f16)[_0xe87a('0x18')](function(_0x4d7f67){logger[_0xe87a('0xe')]('entityFound:',_0x4d7f67[_0xe87a('0x13')]);emit(util['format'](_0xe87a('0x2e'),_0x4d7f67['name']),_0xe87a('0x40'));return _0x2fdd5e[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':_0xe87a('0x41')});})['catch'](handleError(_0x2fdd5e));};exports[_0xe87a('0x42')]=function(_0x18779,_0x30fb49){logger[_0xe87a('0xe')](_0xe87a('0x43'),_0x18779['body']);var _0x2dc0db=transferValidation[_0xe87a('0x9')](_0x18779[_0xe87a('0x23')]);if(_0x2dc0db[_0xe87a('0x20')]>0x0){return _0x30fb49[_0xe87a('0x15')](0x190)['json'](_0x2dc0db);}var _0x333ad9=_0x18779[_0xe87a('0x23')][_0xe87a('0x25')];var _0x1fe45e=_0x18779[_0xe87a('0x23')][_0xe87a('0x1f')];var _0x25bcd1=_0x18779[_0xe87a('0x23')]['transferNumber'];return getAgent(_0x333ad9)[_0xe87a('0x18')](function(_0x825cc7){logger['info'](_0xe87a('0x28'),_0x825cc7[_0xe87a('0x13')]);emit(util['format']('user:%s',_0x825cc7[_0xe87a('0x13')]),_0xe87a('0x44'),{'sessionId':_0x1fe45e,'transferNumber':_0x25bcd1});return _0x30fb49[_0xe87a('0x15')](0xc8)[_0xe87a('0x24')]({'error':![],'message':'transfer\x20executed!'});})[_0xe87a('0x32')](handleError(_0x30fb49));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index e81bffa..e2ffcf2 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 _0xfc48=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','destroy','removeDispositions','delete','removeAnswers','removeAgents'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xfc48,0x160));var _0x8fc4=function(_0x3a0728,_0x20d678){_0x3a0728=_0x3a0728-0x0;var _0x2efe07=_0xfc48[_0x3a0728];return _0x2efe07;};'use strict';var multer=require(_0x8fc4('0x0'));var util=require(_0x8fc4('0x1'));var path=require(_0x8fc4('0x2'));var timeout=require('connect-timeout');var express=require(_0x8fc4('0x3'));var router=express[_0x8fc4('0x4')]();var fs_extra=require(_0x8fc4('0x5'));var auth=require(_0x8fc4('0x6'));var interaction=require(_0x8fc4('0x7'));var config=require(_0x8fc4('0x8'));var controller=require('./whatsappAccount.controller');router[_0x8fc4('0x9')]('/',auth['isAuthenticated'](),controller[_0x8fc4('0xa')]);router[_0x8fc4('0x9')](_0x8fc4('0xb'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0xd')]);router[_0x8fc4('0x9')](_0x8fc4('0xe'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0xf')]);router['get'](_0x8fc4('0x10'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x11')]);router[_0x8fc4('0x9')](_0x8fc4('0x12'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x13')]);router['get'](_0x8fc4('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8fc4('0x9')](_0x8fc4('0x15'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8fc4('0x16')]('/',auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x17')]);router['post'](_0x8fc4('0x10'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x18')]);router[_0x8fc4('0x16')](_0x8fc4('0x12'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x19')]);router[_0x8fc4('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x8fc4('0x1a')]);router[_0x8fc4('0x16')](_0x8fc4('0x15'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x1b')]);router[_0x8fc4('0x16')](_0x8fc4('0x1c'),controller[_0x8fc4('0x1d')]);router[_0x8fc4('0x16')](_0x8fc4('0x1e'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x1f')]);router[_0x8fc4('0x20')](_0x8fc4('0xe'),auth[_0x8fc4('0xc')](),controller['update']);router['delete'](_0x8fc4('0xe'),auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x21')]);router['delete']('/:id/dispositions',auth[_0x8fc4('0xc')](),controller[_0x8fc4('0x22')]);router[_0x8fc4('0x23')](_0x8fc4('0x12'),auth['isAuthenticated'](),controller[_0x8fc4('0x24')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x8fc4('0x25')]);module[_0x8fc4('0x26')]=router; \ No newline at end of file +var _0x3330=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','post','create','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','put','update','/:id','removeDispositions','delete','removeAnswers','removeAgents','exports'];(function(_0x577384,_0x8a7d2d){var _0x45ed11=function(_0x33f006){while(--_0x33f006){_0x577384['push'](_0x577384['shift']());}};_0x45ed11(++_0x8a7d2d);}(_0x3330,0x132));var _0x0333=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3330[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0333('0x0'));var util=require('util');var path=require(_0x0333('0x1'));var timeout=require('connect-timeout');var express=require(_0x0333('0x2'));var router=express[_0x0333('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0333('0x4'));var interaction=require(_0x0333('0x5'));var config=require(_0x0333('0x6'));var controller=require(_0x0333('0x7'));router[_0x0333('0x8')]('/',auth['isAuthenticated'](),controller[_0x0333('0x9')]);router[_0x0333('0x8')](_0x0333('0xa'),auth[_0x0333('0xb')](),controller[_0x0333('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0333('0xd')]);router[_0x0333('0x8')](_0x0333('0xe'),auth[_0x0333('0xb')](),controller['getDispositions']);router[_0x0333('0x8')](_0x0333('0xf'),auth[_0x0333('0xb')](),controller['getAnswers']);router[_0x0333('0x8')](_0x0333('0x10'),auth[_0x0333('0xb')](),controller['getAgents']);router[_0x0333('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x0333('0x11')]('/',auth[_0x0333('0xb')](),controller[_0x0333('0x12')]);router[_0x0333('0x11')](_0x0333('0xe'),auth[_0x0333('0xb')](),controller['addDisposition']);router['post'](_0x0333('0xf'),auth[_0x0333('0xb')](),controller[_0x0333('0x13')]);router[_0x0333('0x11')](_0x0333('0x10'),auth[_0x0333('0xb')](),controller[_0x0333('0x14')]);router[_0x0333('0x11')](_0x0333('0x15'),auth[_0x0333('0xb')](),controller[_0x0333('0x16')]);router['post'](_0x0333('0x17'),controller[_0x0333('0x18')]);router[_0x0333('0x11')](_0x0333('0x19'),auth[_0x0333('0xb')](),controller['send']);router[_0x0333('0x1a')]('/:id',auth[_0x0333('0xb')](),controller[_0x0333('0x1b')]);router['delete'](_0x0333('0x1c'),auth[_0x0333('0xb')](),controller['destroy']);router['delete'](_0x0333('0xe'),auth['isAuthenticated'](),controller[_0x0333('0x1d')]);router[_0x0333('0x1e')](_0x0333('0xf'),auth['isAuthenticated'](),controller[_0x0333('0x1f')]);router[_0x0333('0x1e')](_0x0333('0x10'),auth[_0x0333('0xb')](),controller[_0x0333('0x20')]);module[_0x0333('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 0525a66..d8509c6 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 _0x7d6a=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x4ca691,_0x1df482){var _0x129e66=function(_0x17ec0b){while(--_0x17ec0b){_0x4ca691['push'](_0x4ca691['shift']());}};_0x129e66(++_0x1df482);}(_0x7d6a,0xf6));var _0xa7d6=function(_0x1ae393,_0x5bb9e2){_0x1ae393=_0x1ae393-0x0;var _0x3eadad=_0x7d6a[_0x1ae393];return _0x3eadad;};'use strict';var Sequelize=require(_0xa7d6('0x0'));var rs=require(_0xa7d6('0x1'));module[_0xa7d6('0x2')]={'name':{'type':Sequelize[_0xa7d6('0x3')],'unique':_0xa7d6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xa7d6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa7d6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa7d6('0x3')],'defaultValue':function(){return rs[_0xa7d6('0x5')]();}},'phone':{'type':Sequelize[_0xa7d6('0x3')]},'type':{'type':Sequelize[_0xa7d6('0x6')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0xa7d6('0x3')]},'baseUrl':{'type':Sequelize[_0xa7d6('0x3')]},'authToken':{'type':Sequelize[_0xa7d6('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa7d6('0x7')],'defaultValue':function(){return _0xa7d6('0x8');}},'notificationSound':{'type':Sequelize[_0xa7d6('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa7d6('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa7d6('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa7d6('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa7d6('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa7d6('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa7d6('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa7d6('0xa')],'comment':_0xa7d6('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xa7d6('0x9')],'defaultValue':![],'comment':_0xa7d6('0xc'),'set':function(_0xeb40d5){if(!_0xeb40d5){this[_0xa7d6('0xd')](_0xa7d6('0xe'),null);}this[_0xa7d6('0xd')]('mandatoryDisposition',_0xeb40d5);}},'description':{'type':Sequelize[_0xa7d6('0x3')]}}; \ No newline at end of file +var _0xc00e=['BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xc00e,0x1e1));var _0xec00=function(_0x38400d,_0x1344d9){_0x38400d=_0x38400d-0x0;var _0x1422d6=_0xc00e[_0x38400d];return _0x1422d6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xec00('0x0'));module[_0xec00('0x1')]={'name':{'type':Sequelize[_0xec00('0x2')],'unique':_0xec00('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xec00('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xec00('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xec00('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xec00('0x2')]},'type':{'type':Sequelize[_0xec00('0x4')](_0xec00('0x5'),_0xec00('0x6'))},'accountSid':{'type':Sequelize[_0xec00('0x2')]},'baseUrl':{'type':Sequelize[_0xec00('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xec00('0x7')],'defaultValue':function(){return _0xec00('0x8');}},'notificationSound':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xec00('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec00('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xec00('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec00('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xec00('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1d30d0){if(!_0x1d30d0){this[_0xec00('0xb')](_0xec00('0xc'),null);}this['setDataValue'](_0xec00('0xd'),_0x1d30d0);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 84eeff5..c2c6775 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 _0xbc1d=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','close','*,*,*,*','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','entity\x20found','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','zip-dir','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./whatsappAccount.socket','client','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','get','WhatsappAccounts','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','order','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','statuses','state','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','MessageSid','sinch','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x16fe3d,_0x49dc87){var _0x1e354f=function(_0x31db83){while(--_0x31db83){_0x16fe3d['push'](_0x16fe3d['shift']());}};_0x1e354f(++_0x49dc87);}(_0xbc1d,0x19e));var _0xdbc1=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xbc1d[_0x403115];return _0x596ef3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbc1('0x0'));var zipdir=require(_0xdbc1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdbc1('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdbc1('0x3'));var sox=require(_0xdbc1('0x4'));var csv=require(_0xdbc1('0x5'));var ejs=require(_0xdbc1('0x6'));var fs=require('fs');var fs_extra=require(_0xdbc1('0x7'));var _=require(_0xdbc1('0x8'));var squel=require(_0xdbc1('0x9'));var crypto=require(_0xdbc1('0xa'));var jsforce=require(_0xdbc1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdbc1('0xc'));var Papa=require('papaparse');var Redis=require(_0xdbc1('0xd'));var authService=require(_0xdbc1('0xe'));var qs=require(_0xdbc1('0xf'));var as=require(_0xdbc1('0x10'));var hardwareService=require(_0xdbc1('0x11'));var logger=require('../../config/logger')(_0xdbc1('0x12'));var utils=require('../../config/utils');var config=require(_0xdbc1('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbc1('0x14'))['db'];config['redis']=_[_0xdbc1('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdbc1('0x16'))(new Redis(config[_0xdbc1('0x17')]));require(_0xdbc1('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdbc1('0x19')][_0xdbc1('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x383b60,_0x53b14e,_0x452c33,_0x27d025){return new BPromise(function(_0x1236d7,_0x46a936){var _0x154d2a=_0x27d025||client;return _0x154d2a[_0xdbc1('0x1b')](_0x383b60,_0x452c33)[_0xdbc1('0x1c')](function(_0x129e33){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x53b14e,_0xdbc1('0x1d'));logger[_0xdbc1('0x1e')](_0xdbc1('0x1f'),_0x53b14e,_0xdbc1('0x1d'),JSON[_0xdbc1('0x20')](_0x129e33));if(_0x129e33[_0xdbc1('0x21')]){if(_0x129e33[_0xdbc1('0x21')][_0xdbc1('0x22')]===0x1f4){logger['error'](_0xdbc1('0x23'),_0x53b14e,_0x129e33[_0xdbc1('0x21')][_0xdbc1('0x24')]);return _0x46a936(_0x129e33[_0xdbc1('0x21')][_0xdbc1('0x24')]);}logger['error'](_0xdbc1('0x23'),_0x53b14e,_0x129e33[_0xdbc1('0x21')]['message']);return _0x1236d7(_0x129e33[_0xdbc1('0x21')][_0xdbc1('0x24')]);}else{logger[_0xdbc1('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x53b14e,'request\x20sent');_0x1236d7(_0x129e33['result'][_0xdbc1('0x24')]);}})[_0xdbc1('0x26')](function(_0x564f30){logger[_0xdbc1('0x21')](_0xdbc1('0x23'),_0x53b14e,_0x564f30);_0x46a936(_0x564f30);});});}function respondWithStatusCode(_0x3462dc,_0x4b357e){_0x4b357e=_0x4b357e||0xcc;return function(_0x3ee545){if(_0x3ee545){return _0x3462dc[_0xdbc1('0x27')](_0x4b357e);}return _0x3462dc['status'](_0x4b357e)['end']();};}function respondWithResult(_0x54acfe,_0x4a07b7){_0x4a07b7=_0x4a07b7||0xc8;return function(_0x1860cf){if(_0x1860cf){return _0x54acfe[_0xdbc1('0x28')](_0x4a07b7)[_0xdbc1('0x29')](_0x1860cf);}};}function respondWithFilteredResult(_0x41f87c,_0x491640){return function(_0x48a154){if(_0x48a154){var _0x2b55e9=typeof _0x491640[_0xdbc1('0x2a')]==='undefined'&&typeof _0x491640[_0xdbc1('0x2b')]===_0xdbc1('0x2c');var _0x4f4a3e=_0x48a154[_0xdbc1('0x2d')];var _0x53b16a=_0x2b55e9?0x0:_0x491640[_0xdbc1('0x2a')];var _0x368f48=_0x2b55e9?_0x48a154[_0xdbc1('0x2d')]:_0x491640[_0xdbc1('0x2a')]+_0x491640[_0xdbc1('0x2b')];var _0x4a4a3f;if(_0x368f48>=_0x4f4a3e){_0x368f48=_0x4f4a3e;_0x4a4a3f=0xc8;}else{_0x4a4a3f=0xce;}_0x41f87c[_0xdbc1('0x28')](_0x4a4a3f);return _0x41f87c[_0xdbc1('0x2e')]('Content-Range',_0x53b16a+'-'+_0x368f48+'/'+_0x4f4a3e)[_0xdbc1('0x29')](_0x48a154);}return null;};}function patchUpdates(_0x216b54){return function(_0x4db115){try{jsonpatch['apply'](_0x4db115,_0x216b54,!![]);}catch(_0xf4ca87){return BPromise[_0xdbc1('0x2f')](_0xf4ca87);}return _0x4db115[_0xdbc1('0x30')]();};}function saveUpdates(_0x1aa09e,_0x22494c){return function(_0x4df041){if(_0x4df041){return _0x4df041[_0xdbc1('0x31')](_0x1aa09e)[_0xdbc1('0x1c')](function(_0x291d4e){return _0x291d4e;});}return null;};}function removeEntity(_0x5b9751,_0x4fee27){return function(_0x4db2ee){if(_0x4db2ee){return _0x4db2ee['destroy']()[_0xdbc1('0x1c')](function(){var _0x3c7448=_0x4db2ee[_0xdbc1('0x32')]({'plain':!![]});var _0x5b1f46=_0xdbc1('0x33');return db['UserProfileResource'][_0xdbc1('0x34')]({'where':{'type':_0x5b1f46,'resourceId':_0x3c7448['id']}})['then'](function(){return _0x4db2ee;});})[_0xdbc1('0x1c')](function(){_0x5b9751['status'](0xcc)[_0xdbc1('0x35')]();});}};}function handleEntityNotFound(_0x437222,_0x4b673d){return function(_0x4592de){if(!_0x4592de){_0x437222['sendStatus'](0x194);}return _0x4592de;};}function handleError(_0x2226d9,_0x227cde){_0x227cde=_0x227cde||0x1f4;return function(_0x1ae5d7){logger['error'](_0x1ae5d7[_0xdbc1('0x36')]);if(_0x1ae5d7[_0xdbc1('0x37')]){delete _0x1ae5d7['name'];}_0x2226d9['status'](_0x227cde)[_0xdbc1('0x38')](_0x1ae5d7);};}exports[_0xdbc1('0x39')]=function(_0x310ffa,_0x1cc12b){var _0x384c29={'include':[{'model':db[_0xdbc1('0x3a')],'as':_0xdbc1('0x3b')}]},_0x40dc34={},_0x3c9f12={'count':0x0,'rows':[]};var _0x3ef79f=_[_0xdbc1('0x3c')](db[_0xdbc1('0x3d')][_0xdbc1('0x3e')],function(_0x568b99){return{'name':_0x568b99[_0xdbc1('0x3f')],'type':_0x568b99['type'][_0xdbc1('0x40')]};});_0x40dc34[_0xdbc1('0x41')]=_['map'](_0x3ef79f,_0xdbc1('0x37'));_0x40dc34[_0xdbc1('0x42')]=_[_0xdbc1('0x43')](_0x310ffa[_0xdbc1('0x42')]);_0x40dc34['filters']=_['intersection'](_0x40dc34[_0xdbc1('0x41')],_0x40dc34[_0xdbc1('0x42')]);_0x384c29[_0xdbc1('0x44')]=_[_0xdbc1('0x45')](_0x40dc34[_0xdbc1('0x41')],qs[_0xdbc1('0x46')](_0x310ffa[_0xdbc1('0x42')][_0xdbc1('0x46')]));_0x384c29[_0xdbc1('0x44')]=_0x384c29[_0xdbc1('0x44')]['length']?_0x384c29[_0xdbc1('0x44')]:_0x40dc34[_0xdbc1('0x41')];if(!_0x310ffa[_0xdbc1('0x42')]['hasOwnProperty'](_0xdbc1('0x47'))){_0x384c29[_0xdbc1('0x2b')]=qs[_0xdbc1('0x2b')](_0x310ffa[_0xdbc1('0x42')][_0xdbc1('0x2b')]);_0x384c29[_0xdbc1('0x2a')]=qs[_0xdbc1('0x2a')](_0x310ffa[_0xdbc1('0x42')]['offset']);}_0x384c29['order']=qs[_0xdbc1('0x48')](_0x310ffa[_0xdbc1('0x42')][_0xdbc1('0x48')]);_0x384c29[_0xdbc1('0x49')]=qs[_0xdbc1('0x4a')](_[_0xdbc1('0x4b')](_0x310ffa['query'],_0x40dc34[_0xdbc1('0x4a')]),_0x3ef79f);if(_0x310ffa['query'][_0xdbc1('0x4c')]){_0x384c29['where']=_['merge'](_0x384c29[_0xdbc1('0x49')],{'$or':_[_0xdbc1('0x3c')](_0x3ef79f,function(_0x16430e){if(_0x16430e[_0xdbc1('0x4d')]!==_0xdbc1('0x4e')){var _0x5bd68f={};_0x5bd68f[_0x16430e[_0xdbc1('0x37')]]={'$like':'%'+_0x310ffa[_0xdbc1('0x42')][_0xdbc1('0x4c')]+'%'};return _0x5bd68f;}})});}_0x384c29=_['merge']({},_0x384c29,_0x310ffa[_0xdbc1('0x4f')]);var _0x4d7344={'where':_0x384c29['where']};return db[_0xdbc1('0x3d')][_0xdbc1('0x2d')](_0x4d7344)[_0xdbc1('0x1c')](function(_0x49b8b2){_0x3c9f12[_0xdbc1('0x2d')]=_0x49b8b2;if(_0x310ffa[_0xdbc1('0x42')][_0xdbc1('0x50')]){_0x384c29[_0xdbc1('0x51')]=[{'all':!![]}];}return db[_0xdbc1('0x3d')][_0xdbc1('0x52')](_0x384c29);})[_0xdbc1('0x1c')](function(_0x263628){_0x3c9f12[_0xdbc1('0x53')]=_0x263628;return _0x3c9f12;})['then'](respondWithFilteredResult(_0x1cc12b,_0x384c29))[_0xdbc1('0x26')](handleError(_0x1cc12b,null));};exports[_0xdbc1('0x54')]=function(_0x179adb,_0x3d8349){var _0x2fe2b0={'raw':![],'where':{'id':_0x179adb['params']['id']},'include':[{'model':db[_0xdbc1('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2368d2={};_0x2368d2[_0xdbc1('0x41')]=_['keys'](db[_0xdbc1('0x3d')][_0xdbc1('0x3e')]);_0x2368d2[_0xdbc1('0x42')]=_[_0xdbc1('0x43')](_0x179adb[_0xdbc1('0x42')]);_0x2368d2['filters']=_[_0xdbc1('0x45')](_0x2368d2[_0xdbc1('0x41')],_0x2368d2[_0xdbc1('0x42')]);_0x2fe2b0[_0xdbc1('0x44')]=_[_0xdbc1('0x45')](_0x2368d2[_0xdbc1('0x41')],qs[_0xdbc1('0x46')](_0x179adb[_0xdbc1('0x42')][_0xdbc1('0x46')]));_0x2fe2b0[_0xdbc1('0x44')]=_0x2fe2b0[_0xdbc1('0x44')][_0xdbc1('0x55')]?_0x2fe2b0[_0xdbc1('0x44')]:_0x2368d2['model'];if(_0x179adb[_0xdbc1('0x42')][_0xdbc1('0x50')]){_0x2fe2b0[_0xdbc1('0x51')]=[{'all':!![]}];}_0x2fe2b0=_[_0xdbc1('0x56')]({},_0x2fe2b0,_0x179adb[_0xdbc1('0x4f')]);return db[_0xdbc1('0x3d')]['find'](_0x2fe2b0)['then'](handleEntityNotFound(_0x3d8349,null))[_0xdbc1('0x1c')](respondWithResult(_0x3d8349,null))[_0xdbc1('0x26')](handleError(_0x3d8349,null));};exports[_0xdbc1('0x57')]=function(_0xb2d934,_0x44cab9){return db[_0xdbc1('0x3d')]['create'](_0xb2d934[_0xdbc1('0x58')],{})[_0xdbc1('0x1c')](function(_0xe8c4e4){var _0x2a1cc8=_0xb2d934['user'][_0xdbc1('0x32')]({'plain':!![]});if(!_0x2a1cc8)throw new Error(_0xdbc1('0x59'));if(_0x2a1cc8[_0xdbc1('0x5a')]===_0xdbc1('0x5b')){var _0x415cd9=_0xe8c4e4[_0xdbc1('0x32')]({'plain':!![]});var _0xfa7679=_0xdbc1('0x33');return db['UserProfileSection'][_0xdbc1('0x5c')]({'where':{'name':_0xfa7679,'userProfileId':_0x2a1cc8[_0xdbc1('0x5d')]},'raw':!![]})['then'](function(_0x13e16c){if(_0x13e16c&&_0x13e16c[_0xdbc1('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x415cd9[_0xdbc1('0x37')],'resourceId':_0x415cd9['id'],'type':_0x13e16c[_0xdbc1('0x37')],'sectionId':_0x13e16c['id']},{})[_0xdbc1('0x1c')](function(){return _0xe8c4e4;});}else{return _0xe8c4e4;}})[_0xdbc1('0x26')](function(_0x4ff282){logger[_0xdbc1('0x21')](_0xdbc1('0x5f'),_0x4ff282);throw _0x4ff282;});}return _0xe8c4e4;})[_0xdbc1('0x1c')](respondWithResult(_0x44cab9,0xc9))[_0xdbc1('0x26')](handleError(_0x44cab9,null));};exports['update']=function(_0x409220,_0x27d387){if(_0x409220['body']['id']){delete _0x409220['body']['id'];}return db[_0xdbc1('0x3d')][_0xdbc1('0x5c')]({'where':{'id':_0x409220[_0xdbc1('0x60')]['id']},'include':[{'model':db[_0xdbc1('0x3a')],'as':_0xdbc1('0x3b')}]})[_0xdbc1('0x1c')](handleEntityNotFound(_0x27d387,null))['then'](saveUpdates(_0x409220[_0xdbc1('0x58')],null))[_0xdbc1('0x1c')](respondWithResult(_0x27d387,null))[_0xdbc1('0x26')](handleError(_0x27d387,null));};exports['destroy']=function(_0x4bcdd2,_0x563a48){return db[_0xdbc1('0x3d')][_0xdbc1('0x5c')]({'where':{'id':_0x4bcdd2['params']['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x563a48,null))[_0xdbc1('0x1c')](removeEntity(_0x563a48,null))[_0xdbc1('0x26')](handleError(_0x563a48,null));};exports[_0xdbc1('0x61')]=function(_0x3ab29a,_0x5b6f89){return db[_0xdbc1('0x3d')][_0xdbc1('0x61')]()[_0xdbc1('0x1c')](respondWithResult(_0x5b6f89,null))[_0xdbc1('0x26')](handleError(_0x5b6f89,null));};exports[_0xdbc1('0x62')]=function(_0xdcec06,_0x41ac2b,_0x2d4a1e){if(_0xdcec06[_0xdbc1('0x58')]['id']){delete _0xdcec06['body']['id'];}return db[_0xdbc1('0x3d')][_0xdbc1('0x5c')]({'where':{'id':_0xdcec06['params']['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x41ac2b,null))[_0xdbc1('0x1c')](function(_0xad85b9){if(_0xad85b9){_0xdcec06['body']['WhatsappAccountId']=_0xad85b9['id'];return db[_0xdbc1('0x63')]['create'](_0xdcec06[_0xdbc1('0x58')]);}})[_0xdbc1('0x1c')](respondWithResult(_0x41ac2b,null))[_0xdbc1('0x26')](handleError(_0x41ac2b,null));};exports[_0xdbc1('0x64')]=function(_0x58b72a,_0x28f969,_0x54db59){var _0x2fbcd4={'raw':![],'where':{}};var _0x3d63c2={};var _0x35e5cf={'count':0x0,'rows':[]};return db[_0xdbc1('0x3d')][_0xdbc1('0x65')]({'where':{'id':_0x58b72a[_0xdbc1('0x60')]['id']}})['then'](handleEntityNotFound(_0x28f969,null))['then'](function(_0x12bbec){if(_0x12bbec){_0x3d63c2[_0xdbc1('0x41')]=_[_0xdbc1('0x43')](db['Disposition'][_0xdbc1('0x3e')]);_0x3d63c2[_0xdbc1('0x42')]=_[_0xdbc1('0x43')](_0x58b72a[_0xdbc1('0x42')]);_0x3d63c2['filters']=_[_0xdbc1('0x45')](_0x3d63c2[_0xdbc1('0x41')],_0x3d63c2[_0xdbc1('0x42')]);_0x2fbcd4[_0xdbc1('0x44')]=_[_0xdbc1('0x45')](_0x3d63c2[_0xdbc1('0x41')],qs['fields'](_0x58b72a[_0xdbc1('0x42')][_0xdbc1('0x46')]));_0x2fbcd4[_0xdbc1('0x44')]=_0x2fbcd4[_0xdbc1('0x44')][_0xdbc1('0x55')]?_0x2fbcd4[_0xdbc1('0x44')]:_0x3d63c2[_0xdbc1('0x41')];if(!_0x58b72a[_0xdbc1('0x42')][_0xdbc1('0x66')](_0xdbc1('0x47'))){_0x2fbcd4[_0xdbc1('0x2b')]=qs[_0xdbc1('0x2b')](_0x58b72a[_0xdbc1('0x42')][_0xdbc1('0x2b')]);_0x2fbcd4[_0xdbc1('0x2a')]=qs[_0xdbc1('0x2a')](_0x58b72a[_0xdbc1('0x42')][_0xdbc1('0x2a')]);}_0x2fbcd4[_0xdbc1('0x67')]=qs[_0xdbc1('0x48')](_0x58b72a[_0xdbc1('0x42')][_0xdbc1('0x48')]);_0x2fbcd4[_0xdbc1('0x49')]=qs[_0xdbc1('0x4a')](_[_0xdbc1('0x4b')](_0x58b72a['query'],_0x3d63c2[_0xdbc1('0x4a')]));_0x2fbcd4[_0xdbc1('0x49')][_0xdbc1('0x68')]=_0x12bbec['id'];if(_0x58b72a['query']['filter']){_0x2fbcd4[_0xdbc1('0x49')]=_[_0xdbc1('0x56')](_0x2fbcd4['where'],{'$or':_['map'](_0x2fbcd4[_0xdbc1('0x44')],function(_0x2945b2){var _0xd61a95={};_0xd61a95[_0x2945b2]={'$like':'%'+_0x58b72a[_0xdbc1('0x42')][_0xdbc1('0x4c')]+'%'};return _0xd61a95;})});}_0x2fbcd4=_[_0xdbc1('0x56')]({},_0x2fbcd4,_0x58b72a[_0xdbc1('0x4f')]);return db['Disposition'][_0xdbc1('0x2d')]({'where':_0x2fbcd4[_0xdbc1('0x49')]})['then'](function(_0x116be9){_0x35e5cf[_0xdbc1('0x2d')]=_0x116be9;if(_0x58b72a['query'][_0xdbc1('0x50')]){_0x2fbcd4[_0xdbc1('0x51')]=[{'all':!![]}];}return db[_0xdbc1('0x63')][_0xdbc1('0x52')](_0x2fbcd4);})[_0xdbc1('0x1c')](function(_0x36790a){_0x35e5cf[_0xdbc1('0x53')]=_0x36790a;return _0x35e5cf;});}})[_0xdbc1('0x1c')](respondWithFilteredResult(_0x28f969,_0x2fbcd4))['catch'](handleError(_0x28f969,null));};exports['removeDispositions']=function(_0x4b4b6e,_0x2454e5,_0x1531f2){return db['WhatsappAccount'][_0xdbc1('0x5c')]({'where':{'id':_0x4b4b6e['params']['id']}})['then'](handleEntityNotFound(_0x2454e5,null))[_0xdbc1('0x1c')](function(_0x1ac83f){if(_0x1ac83f){return _0x1ac83f[_0xdbc1('0x69')](_0x4b4b6e[_0xdbc1('0x42')][_0xdbc1('0x6a')]);}})[_0xdbc1('0x1c')](respondWithStatusCode(_0x2454e5,null))[_0xdbc1('0x26')](handleError(_0x2454e5,null));};exports[_0xdbc1('0x6b')]=function(_0x2668f5,_0x249243,_0x11628f){if(_0x2668f5['body']['id']){delete _0x2668f5[_0xdbc1('0x58')]['id'];}return db[_0xdbc1('0x3d')][_0xdbc1('0x5c')]({'where':{'id':_0x2668f5[_0xdbc1('0x60')]['id']}})['then'](handleEntityNotFound(_0x249243,null))[_0xdbc1('0x1c')](function(_0x30c910){if(_0x30c910){_0x2668f5[_0xdbc1('0x58')][_0xdbc1('0x68')]=_0x30c910['id'];return db[_0xdbc1('0x6c')]['create'](_0x2668f5[_0xdbc1('0x58')]);}})[_0xdbc1('0x1c')](respondWithResult(_0x249243,null))[_0xdbc1('0x26')](handleError(_0x249243,null));};exports['getAnswers']=function(_0xf6b1da,_0x104767,_0x31665a){var _0x5a49a1={'raw':![],'where':{}};var _0x37d358={};var _0x650451={'count':0x0,'rows':[]};return db[_0xdbc1('0x3d')][_0xdbc1('0x65')]({'where':{'id':_0xf6b1da[_0xdbc1('0x60')]['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x104767,null))['then'](function(_0x549452){if(_0x549452){_0x37d358[_0xdbc1('0x41')]=_[_0xdbc1('0x43')](db[_0xdbc1('0x6c')]['rawAttributes']);_0x37d358['query']=_[_0xdbc1('0x43')](_0xf6b1da[_0xdbc1('0x42')]);_0x37d358[_0xdbc1('0x4a')]=_[_0xdbc1('0x45')](_0x37d358[_0xdbc1('0x41')],_0x37d358[_0xdbc1('0x42')]);_0x5a49a1[_0xdbc1('0x44')]=_['intersection'](_0x37d358[_0xdbc1('0x41')],qs[_0xdbc1('0x46')](_0xf6b1da['query'][_0xdbc1('0x46')]));_0x5a49a1['attributes']=_0x5a49a1[_0xdbc1('0x44')][_0xdbc1('0x55')]?_0x5a49a1[_0xdbc1('0x44')]:_0x37d358[_0xdbc1('0x41')];if(!_0xf6b1da[_0xdbc1('0x42')][_0xdbc1('0x66')](_0xdbc1('0x47'))){_0x5a49a1['limit']=qs['limit'](_0xf6b1da[_0xdbc1('0x42')][_0xdbc1('0x2b')]);_0x5a49a1[_0xdbc1('0x2a')]=qs[_0xdbc1('0x2a')](_0xf6b1da['query']['offset']);}_0x5a49a1[_0xdbc1('0x67')]=qs[_0xdbc1('0x48')](_0xf6b1da[_0xdbc1('0x42')]['sort']);_0x5a49a1[_0xdbc1('0x49')]=qs[_0xdbc1('0x4a')](_[_0xdbc1('0x4b')](_0xf6b1da[_0xdbc1('0x42')],_0x37d358[_0xdbc1('0x4a')]));_0x5a49a1[_0xdbc1('0x49')]['WhatsappAccountId']=_0x549452['id'];if(_0xf6b1da[_0xdbc1('0x42')]['filter']){_0x5a49a1['where']=_[_0xdbc1('0x56')](_0x5a49a1['where'],{'$or':_['map'](_0x5a49a1[_0xdbc1('0x44')],function(_0x2bc863){var _0x26417d={};_0x26417d[_0x2bc863]={'$like':'%'+_0xf6b1da[_0xdbc1('0x42')][_0xdbc1('0x4c')]+'%'};return _0x26417d;})});}_0x5a49a1=_[_0xdbc1('0x56')]({},_0x5a49a1,_0xf6b1da['options']);return db[_0xdbc1('0x6c')]['count']({'where':_0x5a49a1[_0xdbc1('0x49')]})[_0xdbc1('0x1c')](function(_0x48fa26){_0x650451[_0xdbc1('0x2d')]=_0x48fa26;if(_0xf6b1da[_0xdbc1('0x42')][_0xdbc1('0x50')]){_0x5a49a1['include']=[{'all':!![]}];}return db[_0xdbc1('0x6c')][_0xdbc1('0x52')](_0x5a49a1);})[_0xdbc1('0x1c')](function(_0x23d720){_0x650451[_0xdbc1('0x53')]=_0x23d720;return _0x650451;});}})['then'](respondWithFilteredResult(_0x104767,_0x5a49a1))[_0xdbc1('0x26')](handleError(_0x104767,null));};exports['removeAnswers']=function(_0x11e2b7,_0x1cf6c2,_0x18541c){return db[_0xdbc1('0x3d')][_0xdbc1('0x5c')]({'where':{'id':_0x11e2b7[_0xdbc1('0x60')]['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x1cf6c2,null))[_0xdbc1('0x1c')](function(_0x3828f8){if(_0x3828f8){return _0x3828f8[_0xdbc1('0x6d')](_0x11e2b7[_0xdbc1('0x42')][_0xdbc1('0x6a')]);}})[_0xdbc1('0x1c')](respondWithStatusCode(_0x1cf6c2,null))[_0xdbc1('0x26')](handleError(_0x1cf6c2,null));};exports[_0xdbc1('0x6e')]=function(_0x1db09f,_0xed41d0,_0x13a5c3){return db[_0xdbc1('0x3d')]['find']({'where':{'id':_0x1db09f[_0xdbc1('0x60')]['id']}})['then'](handleEntityNotFound(_0xed41d0,null))[_0xdbc1('0x1c')](function(_0x8eace5){if(_0x8eace5){return _0x8eace5[_0xdbc1('0x6e')](_0x1db09f[_0xdbc1('0x58')]['ids'],_[_0xdbc1('0x6f')](_0x1db09f['body'],['ids','id'])||{})[_0xdbc1('0x70')](function(_0x2593ab){for(var _0x186f3c=0x0;_0x186f3c<_0x1db09f['body']['ids']['length'];_0x186f3c+=0x1){socket[_0xdbc1('0x71')](_0xdbc1('0x72'),{'UserId':Number(_0x1db09f[_0xdbc1('0x58')][_0xdbc1('0x6a')][_0x186f3c]),'WhatsappAccountId':Number(_0x1db09f[_0xdbc1('0x60')]['id'])});}return _0x2593ab;});}})[_0xdbc1('0x1c')](respondWithResult(_0xed41d0,null))[_0xdbc1('0x26')](handleError(_0xed41d0,null));};exports[_0xdbc1('0x73')]=function(_0x40c0d0,_0x150bf9,_0x4deb8b){return db[_0xdbc1('0x3d')]['find']({'where':{'id':_0x40c0d0[_0xdbc1('0x60')]['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x150bf9,null))[_0xdbc1('0x1c')](function(_0x1adfce){if(_0x1adfce){return _0x1adfce[_0xdbc1('0x73')](_0x40c0d0['query']['ids'])[_0xdbc1('0x1c')](function(){if(_['isArray'](_0x40c0d0[_0xdbc1('0x42')][_0xdbc1('0x6a')])){for(var _0x31d9a3=0x0;_0x31d9a3<_0x40c0d0[_0xdbc1('0x42')][_0xdbc1('0x6a')][_0xdbc1('0x55')];_0x31d9a3+=0x1){socket['emit'](_0xdbc1('0x74'),{'UserId':Number(_0x40c0d0['query'][_0xdbc1('0x6a')][_0x31d9a3]),'WhatsappAccountId':Number(_0x40c0d0[_0xdbc1('0x60')]['id'])});}}else{socket[_0xdbc1('0x71')](_0xdbc1('0x74'),{'UserId':Number(_0x40c0d0['query'][_0xdbc1('0x6a')]),'WhatsappAccountId':Number(_0x40c0d0[_0xdbc1('0x60')]['id'])});}});}})[_0xdbc1('0x1c')](respondWithStatusCode(_0x150bf9,null))['catch'](handleError(_0x150bf9,null));};exports[_0xdbc1('0x75')]=function(_0x52abfa,_0x3747e2,_0x52d736){var _0x44922e={};var _0x264d0f={};var _0x3c1f3b;var _0x252a09;return db['WhatsappAccount'][_0xdbc1('0x65')]({'where':{'id':_0x52abfa[_0xdbc1('0x60')]['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x3747e2,null))[_0xdbc1('0x1c')](function(_0x574777){if(_0x574777){_0x3c1f3b=_0x574777;_0x264d0f['model']=_[_0xdbc1('0x43')](db['User'][_0xdbc1('0x3e')]);_0x264d0f[_0xdbc1('0x42')]=_[_0xdbc1('0x43')](_0x52abfa[_0xdbc1('0x42')]);_0x264d0f[_0xdbc1('0x4a')]=_[_0xdbc1('0x45')](_0x264d0f['model'],_0x264d0f[_0xdbc1('0x42')]);_0x44922e[_0xdbc1('0x44')]=_['intersection'](_0x264d0f[_0xdbc1('0x41')],qs[_0xdbc1('0x46')](_0x52abfa['query'][_0xdbc1('0x46')]));_0x44922e[_0xdbc1('0x44')]=_0x44922e[_0xdbc1('0x44')][_0xdbc1('0x55')]?_0x44922e['attributes']:_0x264d0f[_0xdbc1('0x41')];_0x44922e[_0xdbc1('0x67')]=qs['sort'](_0x52abfa[_0xdbc1('0x42')][_0xdbc1('0x48')]);_0x44922e[_0xdbc1('0x49')]=qs[_0xdbc1('0x4a')](_['pick'](_0x52abfa[_0xdbc1('0x42')],_0x264d0f[_0xdbc1('0x4a')]));if(_0x52abfa[_0xdbc1('0x42')][_0xdbc1('0x4c')]){_0x44922e[_0xdbc1('0x49')]=_['merge'](_0x44922e['where'],{'$or':_['map'](_0x44922e[_0xdbc1('0x44')],function(_0x30d87f){var _0xdcde64={};_0xdcde64[_0x30d87f]={'$like':'%'+_0x52abfa[_0xdbc1('0x42')]['filter']+'%'};return _0xdcde64;})});}_0x44922e=_[_0xdbc1('0x56')]({},_0x44922e,_0x52abfa[_0xdbc1('0x4f')]);return _0x3c1f3b[_0xdbc1('0x75')](_0x44922e);}})[_0xdbc1('0x1c')](function(_0x4edc0e){if(_0x4edc0e){_0x252a09=_0x4edc0e[_0xdbc1('0x55')];if(!_0x52abfa[_0xdbc1('0x42')][_0xdbc1('0x66')](_0xdbc1('0x47'))){_0x44922e[_0xdbc1('0x2b')]=qs[_0xdbc1('0x2b')](_0x52abfa[_0xdbc1('0x42')][_0xdbc1('0x2b')]);_0x44922e[_0xdbc1('0x2a')]=qs[_0xdbc1('0x2a')](_0x52abfa[_0xdbc1('0x42')]['offset']);}return _0x3c1f3b[_0xdbc1('0x75')](_0x44922e);}})['then'](function(_0x1ab966){if(_0x1ab966){return _0x1ab966?{'count':_0x252a09,'rows':_0x1ab966}:null;}})[_0xdbc1('0x1c')](respondWithResult(_0x3747e2,null))[_0xdbc1('0x26')](handleError(_0x3747e2,null));};exports[_0xdbc1('0x76')]=function(_0x3693f5,_0x5432c8){var _0x12a719=_0x3693f5[_0xdbc1('0x60')]['id'];var _0xce8ab=_0x3693f5[_0xdbc1('0x58')];var _0x438157=0xc8;var _0x261578=null;return db[_0xdbc1('0x77')]['transaction']({'isolationLevel':db[_0xdbc1('0x77')][_0xdbc1('0x78')][_0xdbc1('0x79')][_0xdbc1('0x7a')]},function(_0x50cde7){return db[_0xdbc1('0x3d')][_0xdbc1('0x65')]({'where':{'id':_0x12a719},'transaction':_0x50cde7})['then'](function(_0x268282){if(_0x268282){return db[_0xdbc1('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x12a719},'transaction':_0x50cde7})['then'](function(){var _0x43c019=_[_0xdbc1('0x3c')](_0xce8ab,function(_0x245f5e){_0x245f5e[_0xdbc1('0x68')]=_0x12a719;return _0x245f5e;});return db[_0xdbc1('0x7b')][_0xdbc1('0x7c')](_0x43c019,{'transaction':_0x50cde7});});}else{_0x438157=0x194;_0x261578=[];}});})[_0xdbc1('0x1c')](function(){if(_0x438157!==0x194){return db[_0xdbc1('0x7b')][_0xdbc1('0x7d')]({'where':{'WhatsappAccountId':_0x12a719},'order':_0xdbc1('0x7e')})[_0xdbc1('0x1c')](function(_0x256559){_0x261578=_0x256559;});}})['catch'](function(_0x4b7901){_0x438157=0x1f4;logger['error'](_0x4b7901['stack']);if(_0x4b7901[_0xdbc1('0x37')]){delete _0x4b7901[_0xdbc1('0x37')];}_0x261578=_0x4b7901;})['finally'](function(){if(_0x261578===null){_0x5432c8[_0xdbc1('0x27')](_0x438157);}else{if(_0x438157===0x1f4){_0x5432c8[_0xdbc1('0x28')](_0x438157)[_0xdbc1('0x38')](_0x261578);}else{_0x5432c8[_0xdbc1('0x28')](_0x438157)[_0xdbc1('0x29')](_0x261578);}}});};exports[_0xdbc1('0x7f')]=function(_0x2e2693,_0x3593c8,_0x4694c9){var _0x118aab={};var _0x145980={};var _0x3f0143;var _0x4a6255;return db['WhatsappAccount']['findOne']({'where':{'id':_0x2e2693[_0xdbc1('0x60')]['id']}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x3593c8,null))[_0xdbc1('0x1c')](function(_0x15579d){if(_0x15579d){_0x3f0143=_0x15579d;_0x145980[_0xdbc1('0x41')]=_[_0xdbc1('0x43')](db[_0xdbc1('0x7b')]['rawAttributes']);_0x145980[_0xdbc1('0x42')]=_[_0xdbc1('0x43')](_0x2e2693[_0xdbc1('0x42')]);_0x145980[_0xdbc1('0x4a')]=_[_0xdbc1('0x45')](_0x145980[_0xdbc1('0x41')],_0x145980['query']);_0x118aab[_0xdbc1('0x44')]=_[_0xdbc1('0x45')](_0x145980[_0xdbc1('0x41')],qs['fields'](_0x2e2693[_0xdbc1('0x42')][_0xdbc1('0x46')]));_0x118aab[_0xdbc1('0x44')]=_0x118aab[_0xdbc1('0x44')][_0xdbc1('0x55')]?_0x118aab[_0xdbc1('0x44')]:_0x145980['model'];_0x118aab['order']=qs[_0xdbc1('0x48')](_0x2e2693[_0xdbc1('0x42')][_0xdbc1('0x48')]);_0x118aab['where']=qs[_0xdbc1('0x4a')](_[_0xdbc1('0x4b')](_0x2e2693[_0xdbc1('0x42')],_0x145980[_0xdbc1('0x4a')]));if(_0x2e2693[_0xdbc1('0x42')][_0xdbc1('0x4c')]){_0x118aab['where']=_[_0xdbc1('0x56')](_0x118aab[_0xdbc1('0x49')],{'$or':_[_0xdbc1('0x3c')](_0x118aab[_0xdbc1('0x44')],function(_0x2c8e59){var _0x4361ab={};_0x4361ab[_0x2c8e59]={'$like':'%'+_0x2e2693[_0xdbc1('0x42')][_0xdbc1('0x4c')]+'%'};return _0x4361ab;})});}_0x118aab=_[_0xdbc1('0x56')]({},_0x118aab,_0x2e2693['options']);return _0x3f0143[_0xdbc1('0x7f')](_0x118aab);}})[_0xdbc1('0x1c')](function(_0x156209){if(_0x156209){_0x4a6255=_0x156209[_0xdbc1('0x55')];if(!_0x2e2693[_0xdbc1('0x42')]['hasOwnProperty']('nolimit')){_0x118aab[_0xdbc1('0x2b')]=qs[_0xdbc1('0x2b')](_0x2e2693['query']['limit']);_0x118aab[_0xdbc1('0x2a')]=qs['offset'](_0x2e2693[_0xdbc1('0x42')][_0xdbc1('0x2a')]);}return _0x3f0143[_0xdbc1('0x7f')](_0x118aab);}})[_0xdbc1('0x1c')](function(_0x385ac4){if(_0x385ac4){return _0x385ac4?{'count':_0x4a6255,'rows':_0x385ac4}:null;}})[_0xdbc1('0x1c')](respondWithResult(_0x3593c8,null))['catch'](handleError(_0x3593c8,null));};exports[_0xdbc1('0x80')]=function(_0x112f56,_0x1a535c,_0x2ea6fa){var _0x4d7aaa={'channel':_0xdbc1('0x81')};var _0x55b175=[];var _0x42a8ea=[];var _0x8793fb={};return db[_0xdbc1('0x3d')]['find']({'where':{'id':_0x112f56[_0xdbc1('0x60')]['id']},'include':[{'model':db[_0xdbc1('0x7b')],'as':_0xdbc1('0x82')}]})[_0xdbc1('0x1c')](handleEntityNotFound(_0x1a535c,null))[_0xdbc1('0x1c')](function(_0x490041){_0x4d7aaa[_0xdbc1('0x83')]=_0x490041;if(_0x4d7aaa[_0xdbc1('0x83')]&&_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0x4d')]==='sinch'&&_0x112f56[_0xdbc1('0x58')][_0xdbc1('0x84')]){if(_0x112f56['body'][_0xdbc1('0x84')][_0xdbc1('0x55')]===0x0)return;if(_0x112f56[_0xdbc1('0x58')][_0xdbc1('0x84')][0x0][_0xdbc1('0x85')]!=='read')return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x112f56['body']['statuses'][0x0][_0xdbc1('0x86')]},{'where':{'messageId':_0x112f56['body']['statuses'][0x0][_0xdbc1('0x87')]},'individualHooks':!![]})[_0xdbc1('0x1c')](function(_0x232c5d){return _0x1a535c[_0xdbc1('0x28')](0xc8)[_0xdbc1('0x29')](_0x232c5d);});}_0x4d7aaa[_0xdbc1('0x88')]=_[_0xdbc1('0x89')](_0x490041[_0xdbc1('0x82')],[_0xdbc1('0x7e')],[_0xdbc1('0x8a')]);if(_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0x82')]){delete _0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0x82')];}return db[_0xdbc1('0x8b')][_0xdbc1('0x61')]()[_0xdbc1('0x1c')](function(_0x276b77){if(!_0x276b77){throw new db[(_0xdbc1('0x8c'))][(_0xdbc1('0x8d'))](_0xdbc1('0x8e'));}_0x55b175=_[_0xdbc1('0x8f')](_[_0xdbc1('0x43')](_0x276b77),[_0xdbc1('0x90'),'updatedAt']);_0x42a8ea=_[_0xdbc1('0x8f')](_[_0xdbc1('0x43')](_0x276b77),[_0xdbc1('0x90'),_0xdbc1('0x91'),_0xdbc1('0x92'),_0xdbc1('0x93')]);_0x4d7aaa[_0xdbc1('0x58')]={'mapKey':_0xdbc1('0x94')};if(_0x4d7aaa[_0xdbc1('0x83')]&&_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0x4d')]===_0xdbc1('0x95')){_0x4d7aaa['body'][_0xdbc1('0x96')]=_0x112f56['body'][_0xdbc1('0x97')]['replace'](_0xdbc1('0x98'),'');_0x4d7aaa[_0xdbc1('0x58')]['body']=_0x112f56[_0xdbc1('0x58')]['Body'];_0x4d7aaa[_0xdbc1('0x58')]['messageId']=_0x112f56[_0xdbc1('0x58')][_0xdbc1('0x99')];}if(_0x4d7aaa[_0xdbc1('0x83')]&&_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0x4d')]===_0xdbc1('0x9a')){_0x4d7aaa[_0xdbc1('0x58')]['from']=_0x112f56[_0xdbc1('0x58')]['notifications'][0x0][_0xdbc1('0x96')];_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x58')]=_0x112f56['body']['notifications'][0x0]['message'][_0xdbc1('0x58')];_0x4d7aaa[_0xdbc1('0x58')]['messageId']=_0x112f56[_0xdbc1('0x58')]['notifications'][0x0][_0xdbc1('0x87')];}if(_0x4d7aaa[_0xdbc1('0x58')]['id']){delete _0x4d7aaa['body']['id'];}if(_[_0xdbc1('0x9b')](_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x96')])){throw new db[(_0xdbc1('0x8c'))][(_0xdbc1('0x8d'))](_0xdbc1('0x9c'));}if(_[_0xdbc1('0x9b')](_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x58')])||_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x58')]===''){throw new db[(_0xdbc1('0x8c'))][(_0xdbc1('0x8d'))](_0xdbc1('0x9d'));}if(_[_0xdbc1('0x9b')](_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x9e')])){throw new db[(_0xdbc1('0x8c'))][(_0xdbc1('0x8d'))](_0xdbc1('0x9f')+_0x42a8ea);}if(!_[_0xdbc1('0xa0')](_0x42a8ea,_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x9e')])){throw new db[(_0xdbc1('0x8c'))][(_0xdbc1('0x8d'))](_0xdbc1('0xa1')+_0x42a8ea);}_0x8793fb[_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x9e')]]=_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x96')];return db[_0xdbc1('0xa2')][_0xdbc1('0x5c')]({'where':{'id':_0x4d7aaa['account']['ListId']},'include':[{'model':db[_0xdbc1('0x8b')],'as':'Contacts','where':_0x8793fb,'limit':0x1,'order':[[_0xdbc1('0x91'),_0xdbc1('0xa3')]]}]});})[_0xdbc1('0x1c')](handleEntityNotFound(_0x1a535c,null))[_0xdbc1('0x1c')](function(_0x2fea95){if(_0x2fea95){_0x4d7aaa[_0xdbc1('0xa4')]=_[_0xdbc1('0x6f')](_0x2fea95,['Contacts']);if(_0x2fea95[_0xdbc1('0xa5')]['length']){return _0x2fea95[_0xdbc1('0xa5')][0x0];}var _0x463dac=_[_0xdbc1('0x15')](_0x4d7aaa[_0xdbc1('0x58')],{'firstName':_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x96')],'ListId':_0x2fea95['id']});_0x463dac[_0x4d7aaa['body']['mapKey']]=_0x4d7aaa['body']['from'];return db[_0xdbc1('0x8b')][_0xdbc1('0x57')](_0x463dac,{'fields':_0x55b175,'raw':!![]});}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x1a535c,null))[_0xdbc1('0x1c')](function(_0x25ced1){if(_0x25ced1){_0x4d7aaa[_0xdbc1('0xa6')]=_0x25ced1;var _0x5ea611={'ContactId':_0x25ced1['id'],'phone':_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x96')],'WhatsappAccountId':_0x112f56['params']['id']};var _0xfaef7d={'ContactId':_0x25ced1['id'],'WhatsappAccountId':_0x112f56[_0xdbc1('0x60')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0xfaef7d})[_0xdbc1('0x1c')](function(_0x3f72a7){if(_0x3f72a7){return[_0x3f72a7,![]];}return db[_0xdbc1('0xa7')][_0xdbc1('0x57')](_0x5ea611)[_0xdbc1('0x1c')](function(_0x122605){return[_0x122605,!![]];});});}})['spread'](function(_0xfec29e,_0x302791){_0x4d7aaa[_0xdbc1('0xa8')]=_0xfec29e[_0xdbc1('0x32')]({'plain':!![]});_0x4d7aaa[_0xdbc1('0xa8')][_0xdbc1('0xa9')]=![];if(_0x302791){if(_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0xaa')]){_0x4d7aaa['applications']['push']({'id':0x0,'priority':_0x4d7aaa[_0xdbc1('0x88')][_0xdbc1('0x55')]+0x1,'app':_0xdbc1('0xab'),'appdata':'unmanaged','interval':_0xdbc1('0xac')});}_0x4d7aaa[_0xdbc1('0xa8')]['created']=!![];}return db[_0xdbc1('0xad')][_0xdbc1('0x57')]({'phone':_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x96')],'messageId':_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0xae')],'body':_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0x58')],'WhatsappAccountId':_0x112f56['params']['id'],'WhatsappInteractionId':_0xfec29e['id'],'direction':'in','ContactId':_0xfec29e[_0xdbc1('0xaf')],'AttachmentId':_0x4d7aaa[_0xdbc1('0x58')][_0xdbc1('0xb0')]});})[_0xdbc1('0x1c')](function(_0x4d5da9){_0x4d7aaa[_0xdbc1('0x24')]=_0x4d5da9;if(!_0x4d7aaa[_0xdbc1('0xa8')]['UserId'])return;return db['User'][_0xdbc1('0x5c')]({'attributes':['id','name'],'where':{'id':_0x4d7aaa['interaction'][_0xdbc1('0xb1')]}});})[_0xdbc1('0x1c')](function(_0x16c14c){if(_0x16c14c){_0x4d7aaa[_0xdbc1('0x88')][_0xdbc1('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x16c14c['name']+','+(_0x4d7aaa[_0xdbc1('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0xdbc1('0xac')});}if(!_0x4d7aaa['interaction'][_0xdbc1('0xb3')])return;return db[_0xdbc1('0xb4')][_0xdbc1('0x5c')]({'attributes':['id',_0xdbc1('0x37')],'where':{'id':_0x4d7aaa[_0xdbc1('0xa8')][_0xdbc1('0xb3')]}});})[_0xdbc1('0x1c')](function(_0xa20ed5){if(_0xa20ed5){_0x4d7aaa['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0xdbc1('0xb5'),'appdata':_0xa20ed5[_0xdbc1('0x37')]+','+(_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0xb6')]||0x12c),'interval':_0xdbc1('0xac')});}return respondWithRpcPromise(_0xdbc1('0xb7'),'startRouting',_0x4d7aaa);})[_0xdbc1('0x1c')](function(_0x9f374a){if(_0x9f374a){var _0x96e0e5=0xc8;var _0x1f0c18=_0xdbc1('0xb8');logger[_0xdbc1('0x25')](_0xdbc1('0x1f'),_0x1f0c18,_0x96e0e5,_0xdbc1('0xb9'));logger[_0xdbc1('0x1e')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1f0c18,_0x96e0e5,'entity\x20found',JSON[_0xdbc1('0x20')](_0x9f374a));if(_0x4d7aaa[_0xdbc1('0x83')][_0xdbc1('0x4d')]===_0xdbc1('0x95')){return _0x1a535c[_0xdbc1('0x28')](_0x96e0e5)[_0xdbc1('0x2e')]('Content-Type','text/xml')[_0xdbc1('0x38')]('\x0a');}else{return _0x1a535c[_0xdbc1('0x28')](_0x96e0e5)['json'](_0x9f374a);}}});})[_0xdbc1('0x26')](handleError(_0x1a535c,null));};exports[_0xdbc1('0x38')]=function(_0x1953bc,_0x47204a,_0x2e7326){var _0x14e489,_0x34f97e,_0x571946;if(_[_0xdbc1('0x9b')](_0x1953bc[_0xdbc1('0x58')][_0xdbc1('0x58')])||_0x1953bc[_0xdbc1('0x58')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xdbc1('0x9d'));}if(_[_0xdbc1('0x9b')](_0x1953bc[_0xdbc1('0x58')]['to'])){throw new db['Sequelize']['ValidationError'](_0xdbc1('0xba'));}_0x14e489=_0x1953bc[_0xdbc1('0x58')]['to'];return db['WhatsappAccount'][_0xdbc1('0x5c')]({'where':{'id':_0x1953bc[_0xdbc1('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xdbc1('0xbb'),'include':[{'model':db[_0xdbc1('0x8b')],'as':'Contacts','where':{'mobile':_0x14e489},'limit':0x1,'order':[[_0xdbc1('0x91'),_0xdbc1('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x47204a,null))['then'](function(_0x5cf470){if(_0x5cf470&&_0x5cf470[_0xdbc1('0xbb')]){_0x34f97e=_0x5cf470[_0xdbc1('0x32')]({'plain':!![]});if(_0x34f97e[_0xdbc1('0xbb')]&&_0x34f97e[_0xdbc1('0xbb')]['Contacts'][_0xdbc1('0x55')]){return _0x34f97e['List'][_0xdbc1('0xa5')][0x0];}return db['CmContact'][_0xdbc1('0x57')](_[_0xdbc1('0x15')](_0x1953bc[_0xdbc1('0x58')],{'firstName':_0x14e489,'mobile':_0x14e489,'phone':_0x14e489,'ListId':_0x34f97e['ListId']}));}})[_0xdbc1('0x1c')](handleEntityNotFound(_0x47204a,null))[_0xdbc1('0x1c')](function(_0x437887){if(_0x437887){_0x571946=_0x437887;return db[_0xdbc1('0xa7')][_0xdbc1('0x5c')]({'where':{'ContactId':_0x571946['id'],'closed':![],'WhatsappAccountId':_0x34f97e['id']}})[_0xdbc1('0x1c')](function(_0x350a62){if(_0x350a62){return[_0x350a62,![]];}return db[_0xdbc1('0xa7')]['create']({'UserId':_0x1953bc['user']['id'],'ContactId':_0x571946['id'],'WhatsappAccountId':_0x34f97e['id'],'phone':_0x14e489,'firstMsgDirection':_0xdbc1('0xbc'),'Messages':[_[_0xdbc1('0x56')](_0x1953bc[_0xdbc1('0x58')],{'read':![],'body':_0x1953bc[_0xdbc1('0x58')][_0xdbc1('0x58')],'phone':_0x14e489,'WhatsappAccountId':_0x34f97e['id'],'UserId':_0x1953bc[_0xdbc1('0x5b')]['id'],'ContactId':_0x571946['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xdbc1('0xbd')}]})[_0xdbc1('0x1c')](function(_0x20399d){return[_0x20399d,!![]];});});}})[_0xdbc1('0x70')](function(_0x499e9d,_0x2f7a30){if(_0x2f7a30){return _0x499e9d;}return db[_0xdbc1('0xad')][_0xdbc1('0x57')](_[_0xdbc1('0x56')](_0x1953bc['body'],{'read':![],'body':_0x1953bc[_0xdbc1('0x58')][_0xdbc1('0x58')],'phone':_0x14e489,'WhatsappAccountId':_0x34f97e['id'],'WhatsappInteractionId':_0x499e9d['id'],'UserId':_0x1953bc[_0xdbc1('0x5b')]['id'],'ContactId':_0x571946['id']}))['then'](function(_0x49d2bc){_0x499e9d[_0xdbc1('0xbe')][_0xdbc1('0xbd')]=[];_0x499e9d[_0xdbc1('0xbe')][_0xdbc1('0xbd')]['push'](_0x49d2bc[_0xdbc1('0xbe')]);return _0x499e9d;});})[_0xdbc1('0x1c')](respondWithResult(_0x47204a,null))['catch'](handleError(_0x47204a,null));}; \ No newline at end of file +var _0xf19d=['userWhatsappAccount:remove','getAgents','findOne','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','account','statuses','state','timestamp','message_id','orderBy','Applications','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','From','whatsapp:','messageId','MessageSid','sinch','from','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','list','WhatsappInteraction','interaction','autoclose','applications','push','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','agent','queueId','WhatsappQueue','unshift','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','List','DESC','out','Messages','dataValues','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','request','then','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','WhatsappAccount','includeAll','findAll','rows','show','rawAttributes','include','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','Disposition','getDispositions','WhatsappAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray'];(function(_0x21fc68,_0x459828){var _0x3561e1=function(_0x3dea77){while(--_0x3dea77){_0x21fc68['push'](_0x21fc68['shift']());}};_0x3561e1(++_0x459828);}(_0xf19d,0x110));var _0xdf19=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xf19d[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0xdf19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf19('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf19('0x3'));var path=require(_0xdf19('0x4'));var sox=require(_0xdf19('0x5'));var csv=require(_0xdf19('0x6'));var ejs=require(_0xdf19('0x7'));var fs=require('fs');var fs_extra=require(_0xdf19('0x8'));var _=require(_0xdf19('0x9'));var squel=require(_0xdf19('0xa'));var crypto=require(_0xdf19('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdf19('0xc'));var toCsv=require(_0xdf19('0x6'));var querystring=require(_0xdf19('0xd'));var Papa=require(_0xdf19('0xe'));var Redis=require(_0xdf19('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdf19('0x10'));var as=require(_0xdf19('0x11'));var hardwareService=require(_0xdf19('0x12'));var logger=require(_0xdf19('0x13'))(_0xdf19('0x14'));var utils=require('../../config/utils');var config=require(_0xdf19('0x15'));var licenseUtil=require(_0xdf19('0x16'));var db=require('../../mysqldb')['db'];config[_0xdf19('0x17')]=_[_0xdf19('0x18')](config[_0xdf19('0x17')],{'host':_0xdf19('0x19'),'port':0x18eb});var socket=require(_0xdf19('0x1a'))(new Redis(config[_0xdf19('0x17')]));require(_0xdf19('0x1b'))['register'](socket);var jayson=require(_0xdf19('0x1c'));var client=jayson['client'][_0xdf19('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x150fcf,_0x121a9d,_0x3b7050,_0x260207){return new BPromise(function(_0x57e167,_0x5ecc3a){var _0x43c3c8=_0x260207||client;return _0x43c3c8[_0xdf19('0x1e')](_0x150fcf,_0x3b7050)[_0xdf19('0x1f')](function(_0x42da2b){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x121a9d,_0xdf19('0x20'));logger[_0xdf19('0x21')](_0xdf19('0x22'),_0x121a9d,_0xdf19('0x20'),JSON[_0xdf19('0x23')](_0x42da2b));if(_0x42da2b['error']){if(_0x42da2b['error'][_0xdf19('0x24')]===0x1f4){logger[_0xdf19('0x25')](_0xdf19('0x26'),_0x121a9d,_0x42da2b[_0xdf19('0x25')][_0xdf19('0x27')]);return _0x5ecc3a(_0x42da2b[_0xdf19('0x25')][_0xdf19('0x27')]);}logger['error'](_0xdf19('0x26'),_0x121a9d,_0x42da2b[_0xdf19('0x25')][_0xdf19('0x27')]);return _0x57e167(_0x42da2b['error'][_0xdf19('0x27')]);}else{logger[_0xdf19('0x28')](_0xdf19('0x26'),_0x121a9d,_0xdf19('0x20'));_0x57e167(_0x42da2b[_0xdf19('0x29')][_0xdf19('0x27')]);}})[_0xdf19('0x2a')](function(_0x39cdd6){logger[_0xdf19('0x25')](_0xdf19('0x26'),_0x121a9d,_0x39cdd6);_0x5ecc3a(_0x39cdd6);});});}function respondWithStatusCode(_0xe533a2,_0xccf53f){_0xccf53f=_0xccf53f||0xcc;return function(_0x4fbca3){if(_0x4fbca3){return _0xe533a2[_0xdf19('0x2b')](_0xccf53f);}return _0xe533a2[_0xdf19('0x2c')](_0xccf53f)[_0xdf19('0x2d')]();};}function respondWithResult(_0x1672d5,_0x2fdc0c){_0x2fdc0c=_0x2fdc0c||0xc8;return function(_0x1424f5){if(_0x1424f5){return _0x1672d5['status'](_0x2fdc0c)[_0xdf19('0x2e')](_0x1424f5);}};}function respondWithFilteredResult(_0x403227,_0x425140){return function(_0x2810de){if(_0x2810de){var _0xd2f46f=typeof _0x425140[_0xdf19('0x2f')]===_0xdf19('0x30')&&typeof _0x425140[_0xdf19('0x31')]==='undefined';var _0x3f1beb=_0x2810de[_0xdf19('0x32')];var _0x576152=_0xd2f46f?0x0:_0x425140[_0xdf19('0x2f')];var _0x317ecc=_0xd2f46f?_0x2810de[_0xdf19('0x32')]:_0x425140[_0xdf19('0x2f')]+_0x425140[_0xdf19('0x31')];var _0x1948da;if(_0x317ecc>=_0x3f1beb){_0x317ecc=_0x3f1beb;_0x1948da=0xc8;}else{_0x1948da=0xce;}_0x403227[_0xdf19('0x2c')](_0x1948da);return _0x403227[_0xdf19('0x33')](_0xdf19('0x34'),_0x576152+'-'+_0x317ecc+'/'+_0x3f1beb)[_0xdf19('0x2e')](_0x2810de);}return null;};}function patchUpdates(_0x324bc4){return function(_0x3d668f){try{jsonpatch['apply'](_0x3d668f,_0x324bc4,!![]);}catch(_0x1a431f){return BPromise[_0xdf19('0x35')](_0x1a431f);}return _0x3d668f['save']();};}function saveUpdates(_0x4879af,_0x301258){return function(_0x591ecf){if(_0x591ecf){return _0x591ecf[_0xdf19('0x36')](_0x4879af)[_0xdf19('0x1f')](function(_0x5f4761){return _0x5f4761;});}return null;};}function removeEntity(_0x4392fd,_0x43237f){return function(_0x208405){if(_0x208405){return _0x208405[_0xdf19('0x37')]()[_0xdf19('0x1f')](function(){var _0x2ad049=_0x208405[_0xdf19('0x38')]({'plain':!![]});var _0x4b68a1=_0xdf19('0x39');return db[_0xdf19('0x3a')]['destroy']({'where':{'type':_0x4b68a1,'resourceId':_0x2ad049['id']}})[_0xdf19('0x1f')](function(){return _0x208405;});})['then'](function(){_0x4392fd[_0xdf19('0x2c')](0xcc)[_0xdf19('0x2d')]();});}};}function handleEntityNotFound(_0x1ad4e5,_0x4a9ff8){return function(_0x573fb5){if(!_0x573fb5){_0x1ad4e5[_0xdf19('0x2b')](0x194);}return _0x573fb5;};}function handleError(_0x5ee8b4,_0x459e96){_0x459e96=_0x459e96||0x1f4;return function(_0x3bd37a){logger[_0xdf19('0x25')](_0x3bd37a['stack']);if(_0x3bd37a['name']){delete _0x3bd37a[_0xdf19('0x3b')];}_0x5ee8b4['status'](_0x459e96)[_0xdf19('0x3c')](_0x3bd37a);};}exports[_0xdf19('0x3d')]=function(_0x195e6e,_0x2c627e){var _0x9998cc={'include':[{'model':db[_0xdf19('0x3e')],'as':_0xdf19('0x3f')}]},_0x1ebd55={},_0xa74acd={'count':0x0,'rows':[]};var _0x36a22d=_[_0xdf19('0x40')](db['WhatsappAccount']['rawAttributes'],function(_0x9bd963){return{'name':_0x9bd963[_0xdf19('0x41')],'type':_0x9bd963[_0xdf19('0x42')]['key']};});_0x1ebd55[_0xdf19('0x43')]=_['map'](_0x36a22d,_0xdf19('0x3b'));_0x1ebd55[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x195e6e[_0xdf19('0x44')]);_0x1ebd55[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x1ebd55[_0xdf19('0x43')],_0x1ebd55['query']);_0x9998cc[_0xdf19('0x48')]=_[_0xdf19('0x47')](_0x1ebd55[_0xdf19('0x43')],qs['fields'](_0x195e6e[_0xdf19('0x44')][_0xdf19('0x49')]));_0x9998cc['attributes']=_0x9998cc['attributes'][_0xdf19('0x4a')]?_0x9998cc[_0xdf19('0x48')]:_0x1ebd55[_0xdf19('0x43')];if(!_0x195e6e[_0xdf19('0x44')][_0xdf19('0x4b')](_0xdf19('0x4c'))){_0x9998cc[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0x195e6e[_0xdf19('0x44')][_0xdf19('0x31')]);_0x9998cc['offset']=qs[_0xdf19('0x2f')](_0x195e6e[_0xdf19('0x44')][_0xdf19('0x2f')]);}_0x9998cc[_0xdf19('0x4d')]=qs[_0xdf19('0x4e')](_0x195e6e['query'][_0xdf19('0x4e')]);_0x9998cc[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_[_0xdf19('0x50')](_0x195e6e[_0xdf19('0x44')],_0x1ebd55['filters']),_0x36a22d);if(_0x195e6e[_0xdf19('0x44')][_0xdf19('0x51')]){_0x9998cc[_0xdf19('0x4f')]=_[_0xdf19('0x52')](_0x9998cc[_0xdf19('0x4f')],{'$or':_[_0xdf19('0x40')](_0x36a22d,function(_0x43a0a6){if(_0x43a0a6[_0xdf19('0x42')]!=='VIRTUAL'){var _0x3bdbfa={};_0x3bdbfa[_0x43a0a6['name']]={'$like':'%'+_0x195e6e['query'][_0xdf19('0x51')]+'%'};return _0x3bdbfa;}})});}_0x9998cc=_['merge']({},_0x9998cc,_0x195e6e['options']);var _0x5a183e={'where':_0x9998cc[_0xdf19('0x4f')]};return db[_0xdf19('0x53')]['count'](_0x5a183e)[_0xdf19('0x1f')](function(_0x2eb61a){_0xa74acd[_0xdf19('0x32')]=_0x2eb61a;if(_0x195e6e[_0xdf19('0x44')][_0xdf19('0x54')]){_0x9998cc['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xdf19('0x55')](_0x9998cc);})['then'](function(_0x180247){_0xa74acd[_0xdf19('0x56')]=_0x180247;return _0xa74acd;})[_0xdf19('0x1f')](respondWithFilteredResult(_0x2c627e,_0x9998cc))[_0xdf19('0x2a')](handleError(_0x2c627e,null));};exports[_0xdf19('0x57')]=function(_0x4a5a45,_0x356048){var _0x1dc75a={'raw':![],'where':{'id':_0x4a5a45['params']['id']},'include':[{'model':db[_0xdf19('0x3e')],'as':_0xdf19('0x3f')}]},_0x3b4741={};_0x3b4741[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x53')][_0xdf19('0x58')]);_0x3b4741[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x4a5a45[_0xdf19('0x44')]);_0x3b4741[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x3b4741[_0xdf19('0x43')],_0x3b4741[_0xdf19('0x44')]);_0x1dc75a['attributes']=_[_0xdf19('0x47')](_0x3b4741[_0xdf19('0x43')],qs[_0xdf19('0x49')](_0x4a5a45[_0xdf19('0x44')]['fields']));_0x1dc75a['attributes']=_0x1dc75a[_0xdf19('0x48')]['length']?_0x1dc75a['attributes']:_0x3b4741[_0xdf19('0x43')];if(_0x4a5a45[_0xdf19('0x44')][_0xdf19('0x54')]){_0x1dc75a[_0xdf19('0x59')]=[{'all':!![]}];}_0x1dc75a=_[_0xdf19('0x52')]({},_0x1dc75a,_0x4a5a45[_0xdf19('0x5a')]);return db[_0xdf19('0x53')][_0xdf19('0x5b')](_0x1dc75a)[_0xdf19('0x1f')](handleEntityNotFound(_0x356048,null))[_0xdf19('0x1f')](respondWithResult(_0x356048,null))[_0xdf19('0x2a')](handleError(_0x356048,null));};exports[_0xdf19('0x5c')]=function(_0x39614d,_0x229685){return db[_0xdf19('0x53')][_0xdf19('0x5c')](_0x39614d['body'],{})[_0xdf19('0x1f')](function(_0x178ee3){var _0x56d58c=_0x39614d[_0xdf19('0x5d')][_0xdf19('0x38')]({'plain':!![]});if(!_0x56d58c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56d58c[_0xdf19('0x5e')]==='user'){var _0x3e71e6=_0x178ee3['get']({'plain':!![]});var _0x496d71='WhatsappAccounts';return db[_0xdf19('0x5f')]['find']({'where':{'name':_0x496d71,'userProfileId':_0x56d58c[_0xdf19('0x60')]},'raw':!![]})[_0xdf19('0x1f')](function(_0x69fb4){if(_0x69fb4&&_0x69fb4[_0xdf19('0x61')]===0x0){return db[_0xdf19('0x3a')][_0xdf19('0x5c')]({'name':_0x3e71e6['name'],'resourceId':_0x3e71e6['id'],'type':_0x69fb4[_0xdf19('0x3b')],'sectionId':_0x69fb4['id']},{})[_0xdf19('0x1f')](function(){return _0x178ee3;});}else{return _0x178ee3;}})[_0xdf19('0x2a')](function(_0x59200d){logger['error'](_0xdf19('0x62'),_0x59200d);throw _0x59200d;});}return _0x178ee3;})['then'](respondWithResult(_0x229685,0xc9))[_0xdf19('0x2a')](handleError(_0x229685,null));};exports['update']=function(_0x4db447,_0x81d924){if(_0x4db447[_0xdf19('0x63')]['id']){delete _0x4db447[_0xdf19('0x63')]['id'];}return db[_0xdf19('0x53')]['find']({'where':{'id':_0x4db447[_0xdf19('0x64')]['id']},'include':[{'model':db[_0xdf19('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xdf19('0x1f')](handleEntityNotFound(_0x81d924,null))[_0xdf19('0x1f')](saveUpdates(_0x4db447[_0xdf19('0x63')],null))['then'](respondWithResult(_0x81d924,null))['catch'](handleError(_0x81d924,null));};exports[_0xdf19('0x37')]=function(_0x546066,_0x311f5d){return db[_0xdf19('0x53')]['find']({'where':{'id':_0x546066[_0xdf19('0x64')]['id']}})['then'](handleEntityNotFound(_0x311f5d,null))[_0xdf19('0x1f')](removeEntity(_0x311f5d,null))[_0xdf19('0x2a')](handleError(_0x311f5d,null));};exports[_0xdf19('0x65')]=function(_0x14c5ba,_0x1fae30){return db['WhatsappAccount'][_0xdf19('0x65')]()[_0xdf19('0x1f')](respondWithResult(_0x1fae30,null))[_0xdf19('0x2a')](handleError(_0x1fae30,null));};exports['addDisposition']=function(_0x3e9300,_0x228498,_0x53e9c7){if(_0x3e9300[_0xdf19('0x63')]['id']){delete _0x3e9300['body']['id'];}return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x3e9300['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x228498,null))[_0xdf19('0x1f')](function(_0x5f4939){if(_0x5f4939){_0x3e9300['body']['WhatsappAccountId']=_0x5f4939['id'];return db[_0xdf19('0x66')][_0xdf19('0x5c')](_0x3e9300[_0xdf19('0x63')]);}})[_0xdf19('0x1f')](respondWithResult(_0x228498,null))[_0xdf19('0x2a')](handleError(_0x228498,null));};exports[_0xdf19('0x67')]=function(_0x4e1c8d,_0x538e17,_0x1b8010){var _0x2983a7={'raw':![],'where':{}};var _0x59a5c2={};var _0x4814de={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4e1c8d[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x538e17,null))[_0xdf19('0x1f')](function(_0x58ce12){if(_0x58ce12){_0x59a5c2[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x66')][_0xdf19('0x58')]);_0x59a5c2[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x4e1c8d[_0xdf19('0x44')]);_0x59a5c2[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x59a5c2[_0xdf19('0x43')],_0x59a5c2['query']);_0x2983a7['attributes']=_[_0xdf19('0x47')](_0x59a5c2['model'],qs[_0xdf19('0x49')](_0x4e1c8d['query'][_0xdf19('0x49')]));_0x2983a7['attributes']=_0x2983a7[_0xdf19('0x48')][_0xdf19('0x4a')]?_0x2983a7[_0xdf19('0x48')]:_0x59a5c2[_0xdf19('0x43')];if(!_0x4e1c8d[_0xdf19('0x44')][_0xdf19('0x4b')](_0xdf19('0x4c'))){_0x2983a7[_0xdf19('0x31')]=qs['limit'](_0x4e1c8d['query'][_0xdf19('0x31')]);_0x2983a7[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0x4e1c8d['query']['offset']);}_0x2983a7[_0xdf19('0x4d')]=qs[_0xdf19('0x4e')](_0x4e1c8d[_0xdf19('0x44')]['sort']);_0x2983a7[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_['pick'](_0x4e1c8d[_0xdf19('0x44')],_0x59a5c2[_0xdf19('0x46')]));_0x2983a7[_0xdf19('0x4f')][_0xdf19('0x68')]=_0x58ce12['id'];if(_0x4e1c8d[_0xdf19('0x44')][_0xdf19('0x51')]){_0x2983a7[_0xdf19('0x4f')]=_['merge'](_0x2983a7[_0xdf19('0x4f')],{'$or':_['map'](_0x2983a7[_0xdf19('0x48')],function(_0x14d6ad){var _0x5b0ea5={};_0x5b0ea5[_0x14d6ad]={'$like':'%'+_0x4e1c8d[_0xdf19('0x44')]['filter']+'%'};return _0x5b0ea5;})});}_0x2983a7=_['merge']({},_0x2983a7,_0x4e1c8d[_0xdf19('0x5a')]);return db[_0xdf19('0x66')][_0xdf19('0x32')]({'where':_0x2983a7[_0xdf19('0x4f')]})[_0xdf19('0x1f')](function(_0x3ae6b6){_0x4814de[_0xdf19('0x32')]=_0x3ae6b6;if(_0x4e1c8d[_0xdf19('0x44')][_0xdf19('0x54')]){_0x2983a7['include']=[{'all':!![]}];}return db[_0xdf19('0x66')][_0xdf19('0x55')](_0x2983a7);})[_0xdf19('0x1f')](function(_0x3414fe){_0x4814de['rows']=_0x3414fe;return _0x4814de;});}})[_0xdf19('0x1f')](respondWithFilteredResult(_0x538e17,_0x2983a7))['catch'](handleError(_0x538e17,null));};exports[_0xdf19('0x69')]=function(_0x4ec52f,_0x44c871,_0x1af150){return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x4ec52f['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x44c871,null))[_0xdf19('0x1f')](function(_0x2b3a6b){if(_0x2b3a6b){return _0x2b3a6b[_0xdf19('0x69')](_0x4ec52f[_0xdf19('0x44')]['ids']);}})[_0xdf19('0x1f')](respondWithStatusCode(_0x44c871,null))[_0xdf19('0x2a')](handleError(_0x44c871,null));};exports[_0xdf19('0x6a')]=function(_0x45698a,_0x52b31f,_0xc4e56c){if(_0x45698a[_0xdf19('0x63')]['id']){delete _0x45698a[_0xdf19('0x63')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x45698a[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x52b31f,null))[_0xdf19('0x1f')](function(_0x264df6){if(_0x264df6){_0x45698a[_0xdf19('0x63')][_0xdf19('0x68')]=_0x264df6['id'];return db[_0xdf19('0x6b')][_0xdf19('0x5c')](_0x45698a[_0xdf19('0x63')]);}})[_0xdf19('0x1f')](respondWithResult(_0x52b31f,null))[_0xdf19('0x2a')](handleError(_0x52b31f,null));};exports['getAnswers']=function(_0xa4f180,_0x410ea7,_0x5e152d){var _0x10c5a7={'raw':![],'where':{}};var _0x3cdbda={};var _0x3c1e2c={'count':0x0,'rows':[]};return db[_0xdf19('0x53')]['findOne']({'where':{'id':_0xa4f180[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x410ea7,null))[_0xdf19('0x1f')](function(_0x1d177a){if(_0x1d177a){_0x3cdbda[_0xdf19('0x43')]=_[_0xdf19('0x45')](db['CannedAnswer'][_0xdf19('0x58')]);_0x3cdbda[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0xa4f180[_0xdf19('0x44')]);_0x3cdbda[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x3cdbda[_0xdf19('0x43')],_0x3cdbda[_0xdf19('0x44')]);_0x10c5a7['attributes']=_['intersection'](_0x3cdbda['model'],qs[_0xdf19('0x49')](_0xa4f180[_0xdf19('0x44')][_0xdf19('0x49')]));_0x10c5a7[_0xdf19('0x48')]=_0x10c5a7[_0xdf19('0x48')]['length']?_0x10c5a7[_0xdf19('0x48')]:_0x3cdbda[_0xdf19('0x43')];if(!_0xa4f180[_0xdf19('0x44')][_0xdf19('0x4b')]('nolimit')){_0x10c5a7[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0xa4f180[_0xdf19('0x44')][_0xdf19('0x31')]);_0x10c5a7[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0xa4f180['query'][_0xdf19('0x2f')]);}_0x10c5a7['order']=qs[_0xdf19('0x4e')](_0xa4f180[_0xdf19('0x44')][_0xdf19('0x4e')]);_0x10c5a7[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_[_0xdf19('0x50')](_0xa4f180[_0xdf19('0x44')],_0x3cdbda[_0xdf19('0x46')]));_0x10c5a7[_0xdf19('0x4f')][_0xdf19('0x68')]=_0x1d177a['id'];if(_0xa4f180[_0xdf19('0x44')][_0xdf19('0x51')]){_0x10c5a7[_0xdf19('0x4f')]=_['merge'](_0x10c5a7[_0xdf19('0x4f')],{'$or':_['map'](_0x10c5a7[_0xdf19('0x48')],function(_0x2c8728){var _0x328e0a={};_0x328e0a[_0x2c8728]={'$like':'%'+_0xa4f180[_0xdf19('0x44')][_0xdf19('0x51')]+'%'};return _0x328e0a;})});}_0x10c5a7=_[_0xdf19('0x52')]({},_0x10c5a7,_0xa4f180[_0xdf19('0x5a')]);return db[_0xdf19('0x6b')]['count']({'where':_0x10c5a7[_0xdf19('0x4f')]})[_0xdf19('0x1f')](function(_0x4c8780){_0x3c1e2c[_0xdf19('0x32')]=_0x4c8780;if(_0xa4f180[_0xdf19('0x44')][_0xdf19('0x54')]){_0x10c5a7[_0xdf19('0x59')]=[{'all':!![]}];}return db[_0xdf19('0x6b')][_0xdf19('0x55')](_0x10c5a7);})[_0xdf19('0x1f')](function(_0x4fe10f){_0x3c1e2c[_0xdf19('0x56')]=_0x4fe10f;return _0x3c1e2c;});}})['then'](respondWithFilteredResult(_0x410ea7,_0x10c5a7))[_0xdf19('0x2a')](handleError(_0x410ea7,null));};exports[_0xdf19('0x6c')]=function(_0x476811,_0x53bbda,_0x3d02c6){return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x476811['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x53bbda,null))[_0xdf19('0x1f')](function(_0x550b0d){if(_0x550b0d){return _0x550b0d[_0xdf19('0x6c')](_0x476811[_0xdf19('0x44')][_0xdf19('0x6d')]);}})[_0xdf19('0x1f')](respondWithStatusCode(_0x53bbda,null))['catch'](handleError(_0x53bbda,null));};exports['addAgents']=function(_0x37e46c,_0x4a88bc,_0x5e38a1){return db['WhatsappAccount'][_0xdf19('0x5b')]({'where':{'id':_0x37e46c['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x4a88bc,null))[_0xdf19('0x1f')](function(_0x5c30bc){if(_0x5c30bc){return _0x5c30bc['addAgents'](_0x37e46c[_0xdf19('0x63')]['ids'],_[_0xdf19('0x6e')](_0x37e46c[_0xdf19('0x63')],['ids','id'])||{})[_0xdf19('0x6f')](function(_0x4c7176){for(var _0x1ba9c5=0x0;_0x1ba9c5<_0x37e46c[_0xdf19('0x63')]['ids'][_0xdf19('0x4a')];_0x1ba9c5+=0x1){socket[_0xdf19('0x70')](_0xdf19('0x71'),{'UserId':Number(_0x37e46c[_0xdf19('0x63')][_0xdf19('0x6d')][_0x1ba9c5]),'WhatsappAccountId':Number(_0x37e46c[_0xdf19('0x64')]['id'])});}return _0x4c7176;});}})[_0xdf19('0x1f')](respondWithResult(_0x4a88bc,null))[_0xdf19('0x2a')](handleError(_0x4a88bc,null));};exports[_0xdf19('0x72')]=function(_0x34f0f7,_0x1f6711,_0x11459e){return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x34f0f7[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x1f6711,null))['then'](function(_0x48918b){if(_0x48918b){return _0x48918b[_0xdf19('0x72')](_0x34f0f7[_0xdf19('0x44')]['ids'])[_0xdf19('0x1f')](function(){if(_[_0xdf19('0x73')](_0x34f0f7[_0xdf19('0x44')][_0xdf19('0x6d')])){for(var _0x3b1c80=0x0;_0x3b1c80<_0x34f0f7[_0xdf19('0x44')][_0xdf19('0x6d')][_0xdf19('0x4a')];_0x3b1c80+=0x1){socket[_0xdf19('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x34f0f7[_0xdf19('0x44')][_0xdf19('0x6d')][_0x3b1c80]),'WhatsappAccountId':Number(_0x34f0f7['params']['id'])});}}else{socket['emit'](_0xdf19('0x74'),{'UserId':Number(_0x34f0f7['query'][_0xdf19('0x6d')]),'WhatsappAccountId':Number(_0x34f0f7['params']['id'])});}});}})[_0xdf19('0x1f')](respondWithStatusCode(_0x1f6711,null))[_0xdf19('0x2a')](handleError(_0x1f6711,null));};exports[_0xdf19('0x75')]=function(_0x2af021,_0x5cf884,_0x26041a){var _0x534c8b={};var _0x32b4d0={};var _0x426ebd;var _0x528842;return db[_0xdf19('0x53')][_0xdf19('0x76')]({'where':{'id':_0x2af021['params']['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x5cf884,null))[_0xdf19('0x1f')](function(_0x3b1957){if(_0x3b1957){_0x426ebd=_0x3b1957;_0x32b4d0[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x77')][_0xdf19('0x58')]);_0x32b4d0[_0xdf19('0x44')]=_[_0xdf19('0x45')](_0x2af021['query']);_0x32b4d0['filters']=_[_0xdf19('0x47')](_0x32b4d0[_0xdf19('0x43')],_0x32b4d0[_0xdf19('0x44')]);_0x534c8b[_0xdf19('0x48')]=_['intersection'](_0x32b4d0[_0xdf19('0x43')],qs[_0xdf19('0x49')](_0x2af021[_0xdf19('0x44')][_0xdf19('0x49')]));_0x534c8b[_0xdf19('0x48')]=_0x534c8b[_0xdf19('0x48')][_0xdf19('0x4a')]?_0x534c8b[_0xdf19('0x48')]:_0x32b4d0[_0xdf19('0x43')];_0x534c8b['order']=qs['sort'](_0x2af021['query'][_0xdf19('0x4e')]);_0x534c8b[_0xdf19('0x4f')]=qs[_0xdf19('0x46')](_[_0xdf19('0x50')](_0x2af021[_0xdf19('0x44')],_0x32b4d0['filters']));if(_0x2af021['query'][_0xdf19('0x51')]){_0x534c8b[_0xdf19('0x4f')]=_['merge'](_0x534c8b[_0xdf19('0x4f')],{'$or':_[_0xdf19('0x40')](_0x534c8b[_0xdf19('0x48')],function(_0x5e967f){var _0x4657db={};_0x4657db[_0x5e967f]={'$like':'%'+_0x2af021[_0xdf19('0x44')][_0xdf19('0x51')]+'%'};return _0x4657db;})});}_0x534c8b=_[_0xdf19('0x52')]({},_0x534c8b,_0x2af021[_0xdf19('0x5a')]);return _0x426ebd['getAgents'](_0x534c8b);}})[_0xdf19('0x1f')](function(_0x5adc3e){if(_0x5adc3e){_0x528842=_0x5adc3e[_0xdf19('0x4a')];if(!_0x2af021[_0xdf19('0x44')]['hasOwnProperty'](_0xdf19('0x4c'))){_0x534c8b[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0x2af021[_0xdf19('0x44')][_0xdf19('0x31')]);_0x534c8b[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0x2af021['query'][_0xdf19('0x2f')]);}return _0x426ebd[_0xdf19('0x75')](_0x534c8b);}})[_0xdf19('0x1f')](function(_0x53b984){if(_0x53b984){return _0x53b984?{'count':_0x528842,'rows':_0x53b984}:null;}})[_0xdf19('0x1f')](respondWithResult(_0x5cf884,null))[_0xdf19('0x2a')](handleError(_0x5cf884,null));};exports[_0xdf19('0x78')]=function(_0x2bd4c9,_0x50e27e){var _0x7039c5=_0x2bd4c9[_0xdf19('0x64')]['id'];var _0x1b004c=_0x2bd4c9[_0xdf19('0x63')];var _0x3bf593=0xc8;var _0x4af1cc=null;return db[_0xdf19('0x79')][_0xdf19('0x7a')]({'isolationLevel':db[_0xdf19('0x79')][_0xdf19('0x7b')][_0xdf19('0x7c')][_0xdf19('0x7d')]},function(_0xfb4f35){return db[_0xdf19('0x53')][_0xdf19('0x76')]({'where':{'id':_0x7039c5},'transaction':_0xfb4f35})[_0xdf19('0x1f')](function(_0x3c625c){if(_0x3c625c){return db[_0xdf19('0x7e')]['destroy']({'where':{'WhatsappAccountId':_0x7039c5},'transaction':_0xfb4f35})[_0xdf19('0x1f')](function(){var _0x9785c=_['map'](_0x1b004c,function(_0x65b66d){_0x65b66d[_0xdf19('0x68')]=_0x7039c5;return _0x65b66d;});return db['WhatsappApplication'][_0xdf19('0x7f')](_0x9785c,{'transaction':_0xfb4f35});});}else{_0x3bf593=0x194;_0x4af1cc=[];}});})[_0xdf19('0x1f')](function(){if(_0x3bf593!==0x194){return db[_0xdf19('0x7e')][_0xdf19('0x80')]({'where':{'WhatsappAccountId':_0x7039c5},'order':_0xdf19('0x81')})[_0xdf19('0x1f')](function(_0x47b82b){_0x4af1cc=_0x47b82b;});}})['catch'](function(_0x38a7b8){_0x3bf593=0x1f4;logger[_0xdf19('0x25')](_0x38a7b8[_0xdf19('0x82')]);if(_0x38a7b8[_0xdf19('0x3b')]){delete _0x38a7b8[_0xdf19('0x3b')];}_0x4af1cc=_0x38a7b8;})[_0xdf19('0x83')](function(){if(_0x4af1cc===null){_0x50e27e['sendStatus'](_0x3bf593);}else{if(_0x3bf593===0x1f4){_0x50e27e[_0xdf19('0x2c')](_0x3bf593)[_0xdf19('0x3c')](_0x4af1cc);}else{_0x50e27e[_0xdf19('0x2c')](_0x3bf593)[_0xdf19('0x2e')](_0x4af1cc);}}});};exports[_0xdf19('0x84')]=function(_0x5dda72,_0x1fbc58,_0x1cff83){var _0x57f1d8={};var _0x23f9d2={};var _0x4c85f8;var _0x4dafaa;return db[_0xdf19('0x53')]['findOne']({'where':{'id':_0x5dda72[_0xdf19('0x64')]['id']}})[_0xdf19('0x1f')](handleEntityNotFound(_0x1fbc58,null))[_0xdf19('0x1f')](function(_0x3fa959){if(_0x3fa959){_0x4c85f8=_0x3fa959;_0x23f9d2[_0xdf19('0x43')]=_[_0xdf19('0x45')](db[_0xdf19('0x7e')]['rawAttributes']);_0x23f9d2['query']=_[_0xdf19('0x45')](_0x5dda72[_0xdf19('0x44')]);_0x23f9d2[_0xdf19('0x46')]=_[_0xdf19('0x47')](_0x23f9d2[_0xdf19('0x43')],_0x23f9d2[_0xdf19('0x44')]);_0x57f1d8[_0xdf19('0x48')]=_[_0xdf19('0x47')](_0x23f9d2[_0xdf19('0x43')],qs[_0xdf19('0x49')](_0x5dda72['query']['fields']));_0x57f1d8['attributes']=_0x57f1d8[_0xdf19('0x48')][_0xdf19('0x4a')]?_0x57f1d8['attributes']:_0x23f9d2[_0xdf19('0x43')];_0x57f1d8['order']=qs[_0xdf19('0x4e')](_0x5dda72[_0xdf19('0x44')][_0xdf19('0x4e')]);_0x57f1d8[_0xdf19('0x4f')]=qs['filters'](_[_0xdf19('0x50')](_0x5dda72[_0xdf19('0x44')],_0x23f9d2[_0xdf19('0x46')]));if(_0x5dda72[_0xdf19('0x44')][_0xdf19('0x51')]){_0x57f1d8[_0xdf19('0x4f')]=_[_0xdf19('0x52')](_0x57f1d8[_0xdf19('0x4f')],{'$or':_['map'](_0x57f1d8[_0xdf19('0x48')],function(_0x5abcdf){var _0xd3fea5={};_0xd3fea5[_0x5abcdf]={'$like':'%'+_0x5dda72['query'][_0xdf19('0x51')]+'%'};return _0xd3fea5;})});}_0x57f1d8=_[_0xdf19('0x52')]({},_0x57f1d8,_0x5dda72[_0xdf19('0x5a')]);return _0x4c85f8[_0xdf19('0x84')](_0x57f1d8);}})[_0xdf19('0x1f')](function(_0x423099){if(_0x423099){_0x4dafaa=_0x423099[_0xdf19('0x4a')];if(!_0x5dda72['query'][_0xdf19('0x4b')](_0xdf19('0x4c'))){_0x57f1d8[_0xdf19('0x31')]=qs[_0xdf19('0x31')](_0x5dda72['query'][_0xdf19('0x31')]);_0x57f1d8[_0xdf19('0x2f')]=qs[_0xdf19('0x2f')](_0x5dda72['query'][_0xdf19('0x2f')]);}return _0x4c85f8[_0xdf19('0x84')](_0x57f1d8);}})['then'](function(_0x8861a3){if(_0x8861a3){return _0x8861a3?{'count':_0x4dafaa,'rows':_0x8861a3}:null;}})[_0xdf19('0x1f')](respondWithResult(_0x1fbc58,null))['catch'](handleError(_0x1fbc58,null));};exports['notify']=function(_0x2ff510,_0x23757a,_0x2d3ba1){var _0x3fddc7={'channel':'whatsapp'};var _0x522eb0=[];var _0x47262d=[];var _0x5013ee={};return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0x2ff510[_0xdf19('0x64')]['id']},'include':[{'model':db[_0xdf19('0x7e')],'as':'Applications'}]})[_0xdf19('0x1f')](handleEntityNotFound(_0x23757a,null))[_0xdf19('0x1f')](function(_0xd6cf23){_0x3fddc7['account']=_0xd6cf23;if(_0x3fddc7['account']&&_0x3fddc7[_0xdf19('0x85')]['type']==='sinch'&&_0x2ff510['body'][_0xdf19('0x86')]){if(_0x2ff510['body'][_0xdf19('0x86')][_0xdf19('0x4a')]===0x0)return;if(_0x2ff510['body']['statuses'][0x0][_0xdf19('0x87')]!=='read')return;return db['WhatsappMessage'][_0xdf19('0x36')]({'read':!![],'readAt':_0x2ff510[_0xdf19('0x63')]['statuses'][0x0][_0xdf19('0x88')]},{'where':{'messageId':_0x2ff510[_0xdf19('0x63')][_0xdf19('0x86')][0x0][_0xdf19('0x89')]},'individualHooks':!![]})['then'](function(_0x484cf0){return _0x23757a[_0xdf19('0x2c')](0xc8)[_0xdf19('0x2e')](_0x484cf0);});}_0x3fddc7['applications']=_[_0xdf19('0x8a')](_0xd6cf23[_0xdf19('0x8b')],[_0xdf19('0x81')],[_0xdf19('0x8c')]);if(_0x3fddc7[_0xdf19('0x85')]['Applications']){delete _0x3fddc7[_0xdf19('0x85')][_0xdf19('0x8b')];}return db['CmContact']['describe']()[_0xdf19('0x1f')](function(_0x24cb67){if(!_0x24cb67){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))]('no\x20available\x20attributes');}_0x522eb0=_[_0xdf19('0x8f')](_[_0xdf19('0x45')](_0x24cb67),[_0xdf19('0x90'),_0xdf19('0x91')]);_0x47262d=_[_0xdf19('0x8f')](_['keys'](_0x24cb67),[_0xdf19('0x90'),_0xdf19('0x91'),_0xdf19('0x92'),_0xdf19('0x93')]);_0x3fddc7[_0xdf19('0x63')]={'mapKey':'mobile'};if(_0x3fddc7['account']&&_0x3fddc7['account'][_0xdf19('0x42')]==='twilio'){_0x3fddc7['body']['from']=_0x2ff510['body'][_0xdf19('0x94')]['replace'](_0xdf19('0x95'),'');_0x3fddc7['body']['body']=_0x2ff510[_0xdf19('0x63')]['Body'];_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x96')]=_0x2ff510[_0xdf19('0x63')][_0xdf19('0x97')];}if(_0x3fddc7['account']&&_0x3fddc7[_0xdf19('0x85')][_0xdf19('0x42')]===_0xdf19('0x98')){_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')]=_0x2ff510[_0xdf19('0x63')][_0xdf19('0x9a')][0x0][_0xdf19('0x99')];_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x63')]=_0x2ff510['body'][_0xdf19('0x9a')][0x0][_0xdf19('0x27')][_0xdf19('0x63')];_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x96')]=_0x2ff510[_0xdf19('0x63')][_0xdf19('0x9a')][0x0][_0xdf19('0x89')];}if(_0x3fddc7['body']['id']){delete _0x3fddc7['body']['id'];}if(_['isNil'](_0x3fddc7['body'][_0xdf19('0x99')])){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))](_0xdf19('0x9b'));}if(_[_0xdf19('0x9c')](_0x3fddc7['body']['body'])||_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x63')]===''){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))](_0xdf19('0x9d'));}if(_[_0xdf19('0x9c')](_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x9e')])){throw new db[(_0xdf19('0x8d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47262d);}if(!_[_0xdf19('0x9f')](_0x47262d,_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x9e')])){throw new db[(_0xdf19('0x8d'))][(_0xdf19('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47262d);}_0x5013ee[_0x3fddc7['body'][_0xdf19('0x9e')]]=_0x3fddc7[_0xdf19('0x63')]['from'];return db[_0xdf19('0xa0')][_0xdf19('0x5b')]({'where':{'id':_0x3fddc7[_0xdf19('0x85')][_0xdf19('0x93')]},'include':[{'model':db[_0xdf19('0xa1')],'as':_0xdf19('0xa2'),'where':_0x5013ee,'limit':0x1,'order':[[_0xdf19('0x91'),'DESC']]}]});})[_0xdf19('0x1f')](handleEntityNotFound(_0x23757a,null))[_0xdf19('0x1f')](function(_0x9f27a1){if(_0x9f27a1){_0x3fddc7[_0xdf19('0xa3')]=_[_0xdf19('0x6e')](_0x9f27a1,[_0xdf19('0xa2')]);if(_0x9f27a1['Contacts'][_0xdf19('0x4a')]){return _0x9f27a1[_0xdf19('0xa2')][0x0];}var _0x57b921=_[_0xdf19('0x18')](_0x3fddc7[_0xdf19('0x63')],{'firstName':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')],'ListId':_0x9f27a1['id']});_0x57b921[_0x3fddc7['body']['mapKey']]=_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')];return db['CmContact']['create'](_0x57b921,{'fields':_0x522eb0,'raw':!![]});}})[_0xdf19('0x1f')](handleEntityNotFound(_0x23757a,null))['then'](function(_0x5e21d7){if(_0x5e21d7){_0x3fddc7['contact']=_0x5e21d7;var _0x347ba3={'ContactId':_0x5e21d7['id'],'phone':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')],'WhatsappAccountId':_0x2ff510['params']['id']};var _0x50c863={'ContactId':_0x5e21d7['id'],'WhatsappAccountId':_0x2ff510[_0xdf19('0x64')]['id'],'closed':![]};return db[_0xdf19('0xa4')][_0xdf19('0x5b')]({'where':_0x50c863})[_0xdf19('0x1f')](function(_0x96682a){if(_0x96682a){return[_0x96682a,![]];}return db[_0xdf19('0xa4')]['create'](_0x347ba3)[_0xdf19('0x1f')](function(_0x3ffad2){return[_0x3ffad2,!![]];});});}})['spread'](function(_0x25aa9f,_0x1c0fa1){_0x3fddc7[_0xdf19('0xa5')]=_0x25aa9f[_0xdf19('0x38')]({'plain':!![]});_0x3fddc7[_0xdf19('0xa5')]['created']=![];if(_0x1c0fa1){if(_0x3fddc7['account'][_0xdf19('0xa6')]){_0x3fddc7[_0xdf19('0xa7')][_0xdf19('0xa8')]({'id':0x0,'priority':_0x3fddc7[_0xdf19('0xa7')]['length']+0x1,'app':'close','appdata':_0xdf19('0xa9'),'interval':'*,*,*,*'});}_0x3fddc7[_0xdf19('0xa5')]['created']=!![];}return db[_0xdf19('0xaa')]['create']({'phone':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0x99')],'messageId':_0x3fddc7['body'][_0xdf19('0x96')],'body':_0x3fddc7[_0xdf19('0x63')]['body'],'WhatsappAccountId':_0x2ff510[_0xdf19('0x64')]['id'],'WhatsappInteractionId':_0x25aa9f['id'],'direction':'in','ContactId':_0x25aa9f[_0xdf19('0xab')],'AttachmentId':_0x3fddc7[_0xdf19('0x63')][_0xdf19('0xac')]});})[_0xdf19('0x1f')](function(_0x3ea6ed){_0x3fddc7[_0xdf19('0x27')]=_0x3ea6ed;if(!_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xad')])return;return db[_0xdf19('0x77')][_0xdf19('0x5b')]({'attributes':['id','name'],'where':{'id':_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xad')]}});})[_0xdf19('0x1f')](function(_0x211e1f){if(_0x211e1f){_0x3fddc7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xdf19('0xae'),'appdata':_0x211e1f[_0xdf19('0x3b')]+','+(_0x3fddc7[_0xdf19('0x85')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xaf')])return;return db[_0xdf19('0xb0')]['find']({'attributes':['id',_0xdf19('0x3b')],'where':{'id':_0x3fddc7[_0xdf19('0xa5')][_0xdf19('0xaf')]}});})[_0xdf19('0x1f')](function(_0x597415){if(_0x597415){_0x3fddc7['applications'][_0xdf19('0xb1')]({'id':0x0,'priority':0x1,'app':_0xdf19('0xb2'),'appdata':_0x597415[_0xdf19('0x3b')]+','+(_0x3fddc7[_0xdf19('0x85')][_0xdf19('0xb3')]||0x12c),'interval':_0xdf19('0xb4')});}return respondWithRpcPromise(_0xdf19('0xb5'),_0xdf19('0xb6'),_0x3fddc7);})[_0xdf19('0x1f')](function(_0x503188){if(_0x503188){var _0x4712c5=0xc8;var _0xadf206='receiveMessage';logger[_0xdf19('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xadf206,_0x4712c5,_0xdf19('0xb7'));logger['debug'](_0xdf19('0xb8'),_0xadf206,_0x4712c5,'entity\x20found',JSON['stringify'](_0x503188));if(_0x3fddc7[_0xdf19('0x85')]['type']===_0xdf19('0xb9')){return _0x23757a[_0xdf19('0x2c')](_0x4712c5)[_0xdf19('0x33')](_0xdf19('0xba'),_0xdf19('0xbb'))[_0xdf19('0x3c')](_0xdf19('0xbc'));}else{return _0x23757a[_0xdf19('0x2c')](_0x4712c5)['json'](_0x503188);}}});})[_0xdf19('0x2a')](handleError(_0x23757a,null));};exports[_0xdf19('0x3c')]=function(_0xb6799e,_0xd96729,_0x5322a0){var _0x279d3e,_0x1976b6,_0x111517;if(_['isNil'](_0xb6799e['body'][_0xdf19('0x63')])||_0xb6799e['body'][_0xdf19('0x63')]===''){throw new db['Sequelize'][(_0xdf19('0x8e'))](_0xdf19('0x9d'));}if(_[_0xdf19('0x9c')](_0xb6799e['body']['to'])){throw new db['Sequelize'][(_0xdf19('0x8e'))]('to\x20is\x20mandatory');}_0x279d3e=_0xb6799e['body']['to'];return db[_0xdf19('0x53')][_0xdf19('0x5b')]({'where':{'id':_0xb6799e[_0xdf19('0x64')]['id']},'include':[{'model':db[_0xdf19('0xa0')],'as':_0xdf19('0xbd'),'include':[{'model':db[_0xdf19('0xa1')],'as':'Contacts','where':{'mobile':_0x279d3e},'limit':0x1,'order':[[_0xdf19('0x91'),_0xdf19('0xbe')]]}]}]})[_0xdf19('0x1f')](handleEntityNotFound(_0xd96729,null))[_0xdf19('0x1f')](function(_0x207a0d){if(_0x207a0d&&_0x207a0d[_0xdf19('0xbd')]){_0x1976b6=_0x207a0d[_0xdf19('0x38')]({'plain':!![]});if(_0x1976b6['List']&&_0x1976b6[_0xdf19('0xbd')][_0xdf19('0xa2')][_0xdf19('0x4a')]){return _0x1976b6['List']['Contacts'][0x0];}return db['CmContact'][_0xdf19('0x5c')](_[_0xdf19('0x18')](_0xb6799e[_0xdf19('0x63')],{'firstName':_0x279d3e,'mobile':_0x279d3e,'phone':_0x279d3e,'ListId':_0x1976b6['ListId']}));}})['then'](handleEntityNotFound(_0xd96729,null))[_0xdf19('0x1f')](function(_0x212075){if(_0x212075){_0x111517=_0x212075;return db[_0xdf19('0xa4')][_0xdf19('0x5b')]({'where':{'ContactId':_0x111517['id'],'closed':![],'WhatsappAccountId':_0x1976b6['id']}})[_0xdf19('0x1f')](function(_0xf5d429){if(_0xf5d429){return[_0xf5d429,![]];}return db['WhatsappInteraction'][_0xdf19('0x5c')]({'UserId':_0xb6799e[_0xdf19('0x5d')]['id'],'ContactId':_0x111517['id'],'WhatsappAccountId':_0x1976b6['id'],'phone':_0x279d3e,'firstMsgDirection':_0xdf19('0xbf'),'Messages':[_['merge'](_0xb6799e[_0xdf19('0x63')],{'read':![],'body':_0xb6799e[_0xdf19('0x63')][_0xdf19('0x63')],'phone':_0x279d3e,'WhatsappAccountId':_0x1976b6['id'],'UserId':_0xb6799e[_0xdf19('0x5d')]['id'],'ContactId':_0x111517['id']})]},{'include':[{'model':db[_0xdf19('0xaa')],'as':_0xdf19('0xc0')}]})[_0xdf19('0x1f')](function(_0x3668f1){return[_0x3668f1,!![]];});});}})[_0xdf19('0x6f')](function(_0x2530e4,_0x33775c){if(_0x33775c){return _0x2530e4;}return db[_0xdf19('0xaa')][_0xdf19('0x5c')](_['merge'](_0xb6799e[_0xdf19('0x63')],{'read':![],'body':_0xb6799e[_0xdf19('0x63')][_0xdf19('0x63')],'phone':_0x279d3e,'WhatsappAccountId':_0x1976b6['id'],'WhatsappInteractionId':_0x2530e4['id'],'UserId':_0xb6799e['user']['id'],'ContactId':_0x111517['id']}))['then'](function(_0x5d4bdb){_0x2530e4[_0xdf19('0xc1')][_0xdf19('0xc0')]=[];_0x2530e4['dataValues']['Messages'][_0xdf19('0xa8')](_0x5d4bdb[_0xdf19('0xc1')]);return _0x2530e4;});})[_0xdf19('0x1f')](respondWithResult(_0xd96729,null))[_0xdf19('0x2a')](handleError(_0xd96729,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 503683b..7842759 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 _0x7206=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0x7206,0x66));var _0x6720=function(_0x49b6eb,_0x2308fc){_0x49b6eb=_0x49b6eb-0x0;var _0x21411a=_0x7206[_0x49b6eb];return _0x21411a;};'use strict';var EventEmitter=require(_0x6720('0x0'));var WhatsappAccount=require(_0x6720('0x1'))['db'][_0x6720('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6720('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6720('0x4'),'afterDestroy':_0x6720('0x5')};function emitEvent(_0x206281){return function(_0x14784e,_0x2e0454,_0x10e7d7){WhatsappAccountEvents[_0x6720('0x6')](_0x206281+':'+_0x14784e['id'],_0x14784e);WhatsappAccountEvents['emit'](_0x206281,_0x14784e);_0x10e7d7(null);};}for(var e in events){if(events[_0x6720('0x7')](e)){var event=events[e];WhatsappAccount[_0x6720('0x8')](e,emitEvent(event));}}module[_0x6720('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x9e94=['update','remove','emit','hasOwnProperty','events','WhatsappAccount','setMaxListeners'];(function(_0xccc579,_0x3def9a){var _0x33d5ae=function(_0x43bbd6){while(--_0x43bbd6){_0xccc579['push'](_0xccc579['shift']());}};_0x33d5ae(++_0x3def9a);}(_0x9e94,0x14d));var _0x49e9=function(_0x1d6d63,_0x4e4976){_0x1d6d63=_0x1d6d63-0x0;var _0x471552=_0x9e94[_0x1d6d63];return _0x471552;};'use strict';var EventEmitter=require(_0x49e9('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x49e9('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x49e9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x49e9('0x3'),'afterDestroy':_0x49e9('0x4')};function emitEvent(_0x2c9182){return function(_0x466276,_0x47a9d8,_0x3f08a1){WhatsappAccountEvents[_0x49e9('0x5')](_0x2c9182+':'+_0x466276['id'],_0x466276);WhatsappAccountEvents['emit'](_0x2c9182,_0x466276);_0x3f08a1(null);};}for(var e in events){if(events[_0x49e9('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 08957ee..6062264 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 _0x3672=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappAccount','whatsapp_accounts'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x3672,0x1c8));var _0x2367=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0x3672[_0x44fef1];return _0x3c3a04;};'use strict';var _=require(_0x2367('0x0'));var util=require(_0x2367('0x1'));var logger=require('../../config/logger')(_0x2367('0x2'));var moment=require(_0x2367('0x3'));var BPromise=require(_0x2367('0x4'));var rp=require(_0x2367('0x5'));var fs=require('fs');var path=require(_0x2367('0x6'));var rimraf=require(_0x2367('0x7'));var config=require(_0x2367('0x8'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0xa559fc,_0x3463f5){return _0xa559fc[_0x2367('0x9')](_0x2367('0xa'),attributes,{'tableName':_0x2367('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4ea=['../../config/environment','./whatsappAccount.attributes','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5630db,_0x176962){var _0x2c40a6=function(_0x3c6fe4){while(--_0x3c6fe4){_0x5630db['push'](_0x5630db['shift']());}};_0x2c40a6(++_0x176962);}(_0xe4ea,0x19c));var _0xae4e=function(_0x4694b3,_0x5c3bde){_0x4694b3=_0x4694b3-0x0;var _0x106f69=_0xe4ea[_0x4694b3];return _0x106f69;};'use strict';var _=require(_0xae4e('0x0'));var util=require(_0xae4e('0x1'));var logger=require(_0xae4e('0x2'))(_0xae4e('0x3'));var moment=require(_0xae4e('0x4'));var BPromise=require(_0xae4e('0x5'));var rp=require(_0xae4e('0x6'));var fs=require('fs');var path=require(_0xae4e('0x7'));var rimraf=require('rimraf');var config=require(_0xae4e('0x8'));var attributes=require(_0xae4e('0x9'));module['exports']=function(_0x52084a,_0x208ed9){return _0x52084a[_0xae4e('0xa')]('WhatsappAccount',attributes,{'tableName':_0xae4e('0xb'),'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 3aab3ba..aa61b3f 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 _0x698d=['WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then'];(function(_0x5e8c35,_0x158b3a){var _0x546803=function(_0x5cdbb6){while(--_0x5cdbb6){_0x5e8c35['push'](_0x5e8c35['shift']());}};_0x546803(++_0x158b3a);}(_0x698d,0x156));var _0xd698=function(_0x3ce6e9,_0x884c9d){_0x3ce6e9=_0x3ce6e9-0x0;var _0x2213d7=_0x698d[_0x3ce6e9];return _0x2213d7;};'use strict';var _=require(_0xd698('0x0'));var util=require(_0xd698('0x1'));var moment=require(_0xd698('0x2'));var BPromise=require(_0xd698('0x3'));var rs=require(_0xd698('0x4'));var fs=require('fs');var Redis=require(_0xd698('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd698('0x6'));var logger=require(_0xd698('0x7'))(_0xd698('0x8'));var config=require(_0xd698('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd698('0xa')]({'port':0x232a});config[_0xd698('0xb')]=_[_0xd698('0xc')](config[_0xd698('0xb')],{'host':_0xd698('0xd'),'port':0x18eb});var socket=require(_0xd698('0xe'))(new Redis(config[_0xd698('0xb')]));require(_0xd698('0xf'))[_0xd698('0x10')](socket);function respondWithRpcPromise(_0x93de42,_0xa1b7b,_0x49c17a){return new BPromise(function(_0x2dd8de,_0x5eff28){return client['request'](_0x93de42,_0x49c17a)[_0xd698('0x11')](function(_0x6d20cd){logger['info'](_0xd698('0x12'),_0xa1b7b,'request\x20sent');logger[_0xd698('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xa1b7b,_0xd698('0x14'),JSON[_0xd698('0x15')](_0x6d20cd));if(_0x6d20cd[_0xd698('0x16')]){if(_0x6d20cd[_0xd698('0x16')]['code']===0x1f4){logger[_0xd698('0x16')](_0xd698('0x12'),_0xa1b7b,_0x6d20cd[_0xd698('0x16')][_0xd698('0x17')]);return _0x5eff28(_0x6d20cd[_0xd698('0x16')][_0xd698('0x17')]);}logger[_0xd698('0x16')](_0xd698('0x12'),_0xa1b7b,_0x6d20cd['error']['message']);return _0x2dd8de(_0x6d20cd[_0xd698('0x16')][_0xd698('0x17')]);}else{logger[_0xd698('0x18')](_0xd698('0x12'),_0xa1b7b,'request\x20sent');_0x2dd8de(_0x6d20cd[_0xd698('0x19')][_0xd698('0x17')]);}})[_0xd698('0x1a')](function(_0x300675){logger[_0xd698('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0xa1b7b,_0x300675);_0x5eff28(_0x300675);});});}exports[_0xd698('0x1b')]=function(_0x38926b){var _0x5a5fe0=this;return new Promise(function(_0x432331,_0x44d05d){return db[_0xd698('0x1c')][_0xd698('0x1d')]({'raw':_0x38926b['options']?_0x38926b['options']['raw']===undefined?!![]:![]:!![],'where':_0x38926b[_0xd698('0x1e')]?_0x38926b[_0xd698('0x1e')][_0xd698('0x1f')]||null:null,'attributes':_0x38926b[_0xd698('0x1e')]?_0x38926b[_0xd698('0x1e')][_0xd698('0x20')]||null:null,'include':_0x38926b['options']?_0x38926b[_0xd698('0x1e')][_0xd698('0x21')]?_['map'](_0x38926b['options'][_0xd698('0x21')],function(_0x251ec3){return{'model':db[_0x251ec3[_0xd698('0x22')]],'as':_0x251ec3['as'],'attributes':_0x251ec3['attributes'],'include':_0x251ec3[_0xd698('0x21')]?_[_0xd698('0x23')](_0x251ec3[_0xd698('0x21')],function(_0xffecb8){return{'model':db[_0xffecb8['model']],'as':_0xffecb8['as'],'attributes':_0xffecb8['attributes'],'include':_0xffecb8[_0xd698('0x21')]?_['map'](_0xffecb8[_0xd698('0x21')],function(_0x445dac){return{'model':db[_0x445dac[_0xd698('0x22')]],'as':_0x445dac['as'],'attributes':_0x445dac[_0xd698('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd698('0x11')](function(_0x413a90){logger[_0xd698('0x18')]('ShowWhatsappAccount',_0x38926b);logger[_0xd698('0x13')](_0xd698('0x1b'),_0x38926b,JSON[_0xd698('0x15')](_0x413a90));_0x432331(_0x413a90);})['catch'](function(_0x3343f5){logger[_0xd698('0x16')](_0xd698('0x1b'),_0x3343f5['message'],_0x38926b);_0x44d05d(_0x5a5fe0[_0xd698('0x16')](0x1f4,_0x3343f5[_0xd698('0x17')]));});});}; \ No newline at end of file +var _0xacb5=['client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','map','model','attributes','include','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x45cbd6,_0x3548d9){var _0x186a7d=function(_0x1033b1){while(--_0x1033b1){_0x45cbd6['push'](_0x45cbd6['shift']());}};_0x186a7d(++_0x3548d9);}(_0xacb5,0xe0));var _0x5acb=function(_0x49282b,_0x4e2125){_0x49282b=_0x49282b-0x0;var _0xcb542e=_0xacb5[_0x49282b];return _0xcb542e;};'use strict';var _=require(_0x5acb('0x0'));var util=require('util');var moment=require(_0x5acb('0x1'));var BPromise=require(_0x5acb('0x2'));var rs=require(_0x5acb('0x3'));var fs=require('fs');var Redis=require(_0x5acb('0x4'));var db=require(_0x5acb('0x5'))['db'];var utils=require(_0x5acb('0x6'));var logger=require('../../config/logger')(_0x5acb('0x7'));var config=require(_0x5acb('0x8'));var jayson=require(_0x5acb('0x9'));var client=jayson[_0x5acb('0xa')][_0x5acb('0xb')]({'port':0x232a});config[_0x5acb('0xc')]=_['defaults'](config[_0x5acb('0xc')],{'host':_0x5acb('0xd'),'port':0x18eb});var socket=require(_0x5acb('0xe'))(new Redis(config['redis']));require(_0x5acb('0xf'))[_0x5acb('0x10')](socket);function respondWithRpcPromise(_0x42b294,_0x439e23,_0x2c582c){return new BPromise(function(_0x42dde6,_0x12780a){return client[_0x5acb('0x11')](_0x42b294,_0x2c582c)[_0x5acb('0x12')](function(_0x22059d){logger[_0x5acb('0x13')](_0x5acb('0x14'),_0x439e23,_0x5acb('0x15'));logger['debug'](_0x5acb('0x16'),_0x439e23,_0x5acb('0x15'),JSON[_0x5acb('0x17')](_0x22059d));if(_0x22059d[_0x5acb('0x18')]){if(_0x22059d[_0x5acb('0x18')][_0x5acb('0x19')]===0x1f4){logger[_0x5acb('0x18')](_0x5acb('0x14'),_0x439e23,_0x22059d[_0x5acb('0x18')][_0x5acb('0x1a')]);return _0x12780a(_0x22059d[_0x5acb('0x18')][_0x5acb('0x1a')]);}logger['error'](_0x5acb('0x14'),_0x439e23,_0x22059d['error'][_0x5acb('0x1a')]);return _0x42dde6(_0x22059d[_0x5acb('0x18')]['message']);}else{logger['info'](_0x5acb('0x14'),_0x439e23,_0x5acb('0x15'));_0x42dde6(_0x22059d['result'][_0x5acb('0x1a')]);}})[_0x5acb('0x1b')](function(_0x48c845){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x439e23,_0x48c845);_0x12780a(_0x48c845);});});}exports[_0x5acb('0x1c')]=function(_0x3d07b8){var _0x10edff=this;return new Promise(function(_0x399e20,_0x2fb334){return db[_0x5acb('0x1d')][_0x5acb('0x1e')]({'raw':_0x3d07b8['options']?_0x3d07b8[_0x5acb('0x1f')][_0x5acb('0x20')]===undefined?!![]:![]:!![],'where':_0x3d07b8[_0x5acb('0x1f')]?_0x3d07b8[_0x5acb('0x1f')][_0x5acb('0x21')]||null:null,'attributes':_0x3d07b8[_0x5acb('0x1f')]?_0x3d07b8[_0x5acb('0x1f')]['attributes']||null:null,'include':_0x3d07b8[_0x5acb('0x1f')]?_0x3d07b8[_0x5acb('0x1f')]['include']?_[_0x5acb('0x22')](_0x3d07b8[_0x5acb('0x1f')]['include'],function(_0x40978a){return{'model':db[_0x40978a[_0x5acb('0x23')]],'as':_0x40978a['as'],'attributes':_0x40978a[_0x5acb('0x24')],'include':_0x40978a[_0x5acb('0x25')]?_['map'](_0x40978a['include'],function(_0x23d11c){return{'model':db[_0x23d11c[_0x5acb('0x23')]],'as':_0x23d11c['as'],'attributes':_0x23d11c[_0x5acb('0x24')],'include':_0x23d11c['include']?_[_0x5acb('0x22')](_0x23d11c['include'],function(_0x3e48a0){return{'model':db[_0x3e48a0[_0x5acb('0x23')]],'as':_0x3e48a0['as'],'attributes':_0x3e48a0[_0x5acb('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5acb('0x12')](function(_0x12f63f){logger[_0x5acb('0x13')](_0x5acb('0x1c'),_0x3d07b8);logger[_0x5acb('0x26')]('ShowWhatsappAccount',_0x3d07b8,JSON['stringify'](_0x12f63f));_0x399e20(_0x12f63f);})[_0x5acb('0x1b')](function(_0x48608f){logger[_0x5acb('0x18')](_0x5acb('0x1c'),_0x48608f[_0x5acb('0x1a')],_0x3d07b8);_0x2fb334(_0x10edff[_0x5acb('0x18')](0x1f4,_0x48608f[_0x5acb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 6b82fe5..49ec411 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 _0x0b7a=['update','removeListener','register','length','save','remove'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x0b7a,0x14e));var _0xa0b7=function(_0xbadc5d,_0x4e930b){_0xbadc5d=_0xbadc5d-0x0;var _0x38dbc1=_0x0b7a[_0xbadc5d];return _0x38dbc1;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xa0b7('0x0'),_0xa0b7('0x1'),_0xa0b7('0x2')];function createListener(_0x370e22,_0x384d09){return function(_0x1d9a80){_0x384d09['emit'](_0x370e22,_0x1d9a80);};}function removeListener(_0x3d3036,_0x4f48c0){return function(){WhatsappAccountEvents[_0xa0b7('0x3')](_0x3d3036,_0x4f48c0);};}exports[_0xa0b7('0x4')]=function(_0x1075bd){for(var _0x155747=0x0,_0x443d7d=events[_0xa0b7('0x5')];_0x155747<_0x443d7d;_0x155747++){var _0x3e7051=events[_0x155747];var _0x49dd2b=createListener('whatsappAccount:'+_0x3e7051,_0x1075bd);WhatsappAccountEvents['on'](_0x3e7051,_0x49dd2b);}}; \ No newline at end of file +var _0x2320=['removeListener','whatsappAccount:','save','remove','update'];(function(_0x172206,_0x13a362){var _0x5738da=function(_0xa4e490){while(--_0xa4e490){_0x172206['push'](_0x172206['shift']());}};_0x5738da(++_0x13a362);}(_0x2320,0x101));var _0x0232=function(_0xdee5b3,_0x3e7500){_0xdee5b3=_0xdee5b3-0x0;var _0x30ed5f=_0x2320[_0xdee5b3];return _0x30ed5f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x0232('0x0'),_0x0232('0x1'),_0x0232('0x2')];function createListener(_0xf120f0,_0x4db79c){return function(_0x51cda5){_0x4db79c['emit'](_0xf120f0,_0x51cda5);};}function removeListener(_0x144f36,_0x13bc50){return function(){WhatsappAccountEvents[_0x0232('0x3')](_0x144f36,_0x13bc50);};}exports['register']=function(_0x355936){for(var _0x136212=0x0,_0x5eb7f4=events['length'];_0x136212<_0x5eb7f4;_0x136212++){var _0x571d4f=events[_0x136212];var _0x48cc52=createListener(_0x0232('0x4')+_0x571d4f,_0x355936);WhatsappAccountEvents['on'](_0x571d4f,_0x48cc52);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e25f656..71e6f03 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 _0x2712=['../../config/environment','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0x2712,0xac));var _0x2271=function(_0x401e43,_0x253a5a){_0x401e43=_0x401e43-0x0;var _0x2e5212=_0x2712[_0x401e43];return _0x2e5212;};'use strict';var multer=require(_0x2271('0x0'));var util=require(_0x2271('0x1'));var path=require(_0x2271('0x2'));var timeout=require('connect-timeout');var express=require(_0x2271('0x3'));var router=express[_0x2271('0x4')]();var fs_extra=require(_0x2271('0x5'));var auth=require(_0x2271('0x6'));var interaction=require(_0x2271('0x7'));var config=require(_0x2271('0x8'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x2271('0x9')](),controller[_0x2271('0xa')]);router[_0x2271('0xb')]('/:id',auth[_0x2271('0x9')](),controller[_0x2271('0xc')]);router[_0x2271('0xd')]('/',auth[_0x2271('0x9')](),controller['create']);router[_0x2271('0xe')](_0x2271('0xf'),auth[_0x2271('0x9')](),controller[_0x2271('0x10')]);router[_0x2271('0x11')](_0x2271('0xf'),auth[_0x2271('0x9')](),controller[_0x2271('0x12')]);module[_0x2271('0x13')]=router; \ No newline at end of file +var _0xff3b=['index','/:id','show','post','create','put','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff3b,0x1c9));var _0xbff3=function(_0x592ecb,_0x4be9cc){_0x592ecb=_0x592ecb-0x0;var _0x35e231=_0xff3b[_0x592ecb];return _0x35e231;};'use strict';var multer=require(_0xbff3('0x0'));var util=require('util');var path=require(_0xbff3('0x1'));var timeout=require(_0xbff3('0x2'));var express=require(_0xbff3('0x3'));var router=express['Router']();var fs_extra=require(_0xbff3('0x4'));var auth=require(_0xbff3('0x5'));var interaction=require(_0xbff3('0x6'));var config=require(_0xbff3('0x7'));var controller=require(_0xbff3('0x8'));router[_0xbff3('0x9')]('/',auth[_0xbff3('0xa')](),controller[_0xbff3('0xb')]);router[_0xbff3('0x9')](_0xbff3('0xc'),auth[_0xbff3('0xa')](),controller[_0xbff3('0xd')]);router[_0xbff3('0xe')]('/',auth[_0xbff3('0xa')](),controller[_0xbff3('0xf')]);router[_0xbff3('0x10')]('/:id',auth[_0xbff3('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbff3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d997994..3658383 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 _0x2eb8=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0x2eb8,0x7c));var _0x82eb=function(_0x470b44,_0x3d6ddd){_0x470b44=_0x470b44-0x0;var _0x2bc2af=_0x2eb8[_0x470b44];return _0x2bc2af;};'use strict';var Sequelize=require(_0x82eb('0x0'));module[_0x82eb('0x1')]={'priority':{'type':Sequelize[_0x82eb('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82eb('0x3')},'appdata':{'type':Sequelize[_0x82eb('0x4')]()},'description':{'type':Sequelize[_0x82eb('0x5')]},'interval':{'type':Sequelize[_0x82eb('0x5')],'defaultValue':_0x82eb('0x6')}}; \ No newline at end of file +var _0x475c=['STRING','*,*,*,*','sequelize','INTEGER','noop'];(function(_0x33e5f5,_0x2b0ff4){var _0x42eba8=function(_0x4c5f49){while(--_0x4c5f49){_0x33e5f5['push'](_0x33e5f5['shift']());}};_0x42eba8(++_0x2b0ff4);}(_0x475c,0x93));var _0xc475=function(_0x59f88b,_0x466d0a){_0x59f88b=_0x59f88b-0x0;var _0x2d151c=_0x475c[_0x59f88b];return _0x2d151c;};'use strict';var Sequelize=require(_0xc475('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc475('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc475('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc475('0x3')]},'interval':{'type':Sequelize[_0xc475('0x3')],'defaultValue':_0xc475('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 6d61b59..b584220 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 _0x9805=['hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length'];(function(_0x45d587,_0x4e2e93){var _0x56e957=function(_0x19abe9){while(--_0x19abe9){_0x45d587['push'](_0x45d587['shift']());}};_0x56e957(++_0x4e2e93);}(_0x9805,0x18f));var _0x5980=function(_0x2cbb74,_0x241c10){_0x2cbb74=_0x2cbb74-0x0;var _0xa6d18=_0x9805[_0x2cbb74];return _0xa6d18;};'use strict';var emlformat=require(_0x5980('0x0'));var rimraf=require(_0x5980('0x1'));var zipdir=require(_0x5980('0x2'));var jsonpatch=require(_0x5980('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5980('0x4'));var Mustache=require(_0x5980('0x5'));var util=require(_0x5980('0x6'));var path=require(_0x5980('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5980('0x8'));var fs=require('fs');var fs_extra=require(_0x5980('0x9'));var _=require(_0x5980('0xa'));var squel=require(_0x5980('0xb'));var crypto=require(_0x5980('0xc'));var jsforce=require(_0x5980('0xd'));var deskjs=require(_0x5980('0xe'));var toCsv=require(_0x5980('0xf'));var querystring=require(_0x5980('0x10'));var Papa=require(_0x5980('0x11'));var Redis=require(_0x5980('0x12'));var authService=require(_0x5980('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5980('0x14'));var logger=require(_0x5980('0x15'))(_0x5980('0x16'));var utils=require(_0x5980('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5980('0x18'));var db=require(_0x5980('0x19'))['db'];function respondWithStatusCode(_0x59f545,_0x4feb61){_0x4feb61=_0x4feb61||0xcc;return function(_0x1892d4){if(_0x1892d4){return _0x59f545[_0x5980('0x1a')](_0x4feb61);}return _0x59f545[_0x5980('0x1b')](_0x4feb61)[_0x5980('0x1c')]();};}function respondWithResult(_0x9e7cee,_0x3cce48){_0x3cce48=_0x3cce48||0xc8;return function(_0x15fd1a){if(_0x15fd1a){return _0x9e7cee[_0x5980('0x1b')](_0x3cce48)['json'](_0x15fd1a);}};}function respondWithFilteredResult(_0x247cb8,_0x53af6e){return function(_0x46cf94){if(_0x46cf94){var _0x2fcdf2=typeof _0x53af6e[_0x5980('0x1d')]===_0x5980('0x1e')&&typeof _0x53af6e[_0x5980('0x1f')]==='undefined';var _0x278a57=_0x46cf94[_0x5980('0x20')];var _0x462408=_0x2fcdf2?0x0:_0x53af6e[_0x5980('0x1d')];var _0x336ad3=_0x2fcdf2?_0x46cf94[_0x5980('0x20')]:_0x53af6e[_0x5980('0x1d')]+_0x53af6e[_0x5980('0x1f')];var _0x1d1050;if(_0x336ad3>=_0x278a57){_0x336ad3=_0x278a57;_0x1d1050=0xc8;}else{_0x1d1050=0xce;}_0x247cb8[_0x5980('0x1b')](_0x1d1050);return _0x247cb8[_0x5980('0x21')]('Content-Range',_0x462408+'-'+_0x336ad3+'/'+_0x278a57)['json'](_0x46cf94);}return null;};}function patchUpdates(_0x4f5300){return function(_0x216f4a){try{jsonpatch['apply'](_0x216f4a,_0x4f5300,!![]);}catch(_0x47af1d){return BPromise[_0x5980('0x22')](_0x47af1d);}return _0x216f4a[_0x5980('0x23')]();};}function saveUpdates(_0x329cbf,_0x3fa8fe){return function(_0x453aeb){if(_0x453aeb){return _0x453aeb[_0x5980('0x24')](_0x329cbf)[_0x5980('0x25')](function(_0x34a943){return _0x34a943;});}return null;};}function removeEntity(_0x300259,_0x509100){return function(_0x5826d3){if(_0x5826d3){return _0x5826d3[_0x5980('0x26')]()[_0x5980('0x25')](function(){_0x300259[_0x5980('0x1b')](0xcc)[_0x5980('0x1c')]();});}};}function handleEntityNotFound(_0x50c929,_0x5d36f6){return function(_0x5b428e){if(!_0x5b428e){_0x50c929[_0x5980('0x1a')](0x194);}return _0x5b428e;};}function handleError(_0x481cb1,_0x3443a8){_0x3443a8=_0x3443a8||0x1f4;return function(_0x3c84da){logger[_0x5980('0x27')](_0x3c84da[_0x5980('0x28')]);if(_0x3c84da[_0x5980('0x29')]){delete _0x3c84da['name'];}_0x481cb1[_0x5980('0x1b')](_0x3443a8)[_0x5980('0x2a')](_0x3c84da);};}exports[_0x5980('0x2b')]=function(_0x2b436d,_0x13a134){var _0x55e6f6={},_0x55dd71={},_0x4d7e02={'count':0x0,'rows':[]};var _0x34066c=_[_0x5980('0x2c')](db[_0x5980('0x2d')][_0x5980('0x2e')],function(_0x5c97c5){return{'name':_0x5c97c5[_0x5980('0x2f')],'type':_0x5c97c5['type'][_0x5980('0x30')]};});_0x55dd71['model']=_[_0x5980('0x2c')](_0x34066c,'name');_0x55dd71[_0x5980('0x31')]=_[_0x5980('0x32')](_0x2b436d['query']);_0x55dd71[_0x5980('0x33')]=_[_0x5980('0x34')](_0x55dd71[_0x5980('0x35')],_0x55dd71[_0x5980('0x31')]);_0x55e6f6['attributes']=_[_0x5980('0x34')](_0x55dd71[_0x5980('0x35')],qs[_0x5980('0x36')](_0x2b436d[_0x5980('0x31')][_0x5980('0x36')]));_0x55e6f6[_0x5980('0x37')]=_0x55e6f6[_0x5980('0x37')][_0x5980('0x38')]?_0x55e6f6[_0x5980('0x37')]:_0x55dd71[_0x5980('0x35')];if(!_0x2b436d[_0x5980('0x31')][_0x5980('0x39')](_0x5980('0x3a'))){_0x55e6f6[_0x5980('0x1f')]=qs['limit'](_0x2b436d['query'][_0x5980('0x1f')]);_0x55e6f6['offset']=qs['offset'](_0x2b436d[_0x5980('0x31')]['offset']);}_0x55e6f6[_0x5980('0x3b')]=qs['sort'](_0x2b436d[_0x5980('0x31')][_0x5980('0x3c')]);_0x55e6f6[_0x5980('0x3d')]=qs[_0x5980('0x33')](_[_0x5980('0x3e')](_0x2b436d['query'],_0x55dd71[_0x5980('0x33')]),_0x34066c);if(_0x2b436d[_0x5980('0x31')]['filter']){_0x55e6f6[_0x5980('0x3d')]=_[_0x5980('0x3f')](_0x55e6f6[_0x5980('0x3d')],{'$or':_[_0x5980('0x2c')](_0x34066c,function(_0x350169){if(_0x350169[_0x5980('0x40')]!==_0x5980('0x41')){var _0x2f99ab={};_0x2f99ab[_0x350169[_0x5980('0x29')]]={'$like':'%'+_0x2b436d['query']['filter']+'%'};return _0x2f99ab;}})});}_0x55e6f6=_['merge']({},_0x55e6f6,_0x2b436d[_0x5980('0x42')]);var _0x4f152e={'where':_0x55e6f6[_0x5980('0x3d')]};return db['WhatsappApplication'][_0x5980('0x20')](_0x4f152e)['then'](function(_0x35ce10){_0x4d7e02['count']=_0x35ce10;if(_0x2b436d[_0x5980('0x31')][_0x5980('0x43')]){_0x55e6f6[_0x5980('0x44')]=[{'all':!![]}];}return db[_0x5980('0x2d')][_0x5980('0x45')](_0x55e6f6);})[_0x5980('0x25')](function(_0xb14c6f){_0x4d7e02['rows']=_0xb14c6f;return _0x4d7e02;})[_0x5980('0x25')](respondWithFilteredResult(_0x13a134,_0x55e6f6))[_0x5980('0x46')](handleError(_0x13a134,null));};exports[_0x5980('0x47')]=function(_0x251d07,_0x111708){var _0x54ace1={'raw':!![],'where':{'id':_0x251d07[_0x5980('0x48')]['id']}},_0x22d838={};_0x22d838[_0x5980('0x35')]=_[_0x5980('0x32')](db[_0x5980('0x2d')]['rawAttributes']);_0x22d838[_0x5980('0x31')]=_[_0x5980('0x32')](_0x251d07[_0x5980('0x31')]);_0x22d838[_0x5980('0x33')]=_[_0x5980('0x34')](_0x22d838[_0x5980('0x35')],_0x22d838['query']);_0x54ace1[_0x5980('0x37')]=_[_0x5980('0x34')](_0x22d838[_0x5980('0x35')],qs['fields'](_0x251d07[_0x5980('0x31')][_0x5980('0x36')]));_0x54ace1[_0x5980('0x37')]=_0x54ace1[_0x5980('0x37')][_0x5980('0x38')]?_0x54ace1[_0x5980('0x37')]:_0x22d838[_0x5980('0x35')];if(_0x251d07['query'][_0x5980('0x43')]){_0x54ace1[_0x5980('0x44')]=[{'all':!![]}];}_0x54ace1=_[_0x5980('0x3f')]({},_0x54ace1,_0x251d07[_0x5980('0x42')]);return db[_0x5980('0x2d')]['find'](_0x54ace1)[_0x5980('0x25')](handleEntityNotFound(_0x111708,null))['then'](respondWithResult(_0x111708,null))[_0x5980('0x46')](handleError(_0x111708,null));};exports[_0x5980('0x49')]=function(_0x48967a,_0x52f87a){return db[_0x5980('0x2d')]['create'](_0x48967a[_0x5980('0x4a')],{})['then'](respondWithResult(_0x52f87a,0xc9))[_0x5980('0x46')](handleError(_0x52f87a,null));};exports[_0x5980('0x24')]=function(_0x48a5fe,_0x54f017){if(_0x48a5fe[_0x5980('0x4a')]['id']){delete _0x48a5fe[_0x5980('0x4a')]['id'];}return db[_0x5980('0x2d')][_0x5980('0x4b')]({'where':{'id':_0x48a5fe['params']['id']}})[_0x5980('0x25')](handleEntityNotFound(_0x54f017,null))[_0x5980('0x25')](saveUpdates(_0x48a5fe['body'],null))[_0x5980('0x25')](respondWithResult(_0x54f017,null))[_0x5980('0x46')](handleError(_0x54f017,null));};exports[_0x5980('0x26')]=function(_0x4c35ac,_0x8863f1){return db['WhatsappApplication']['find']({'where':{'id':_0x4c35ac['params']['id']}})[_0x5980('0x25')](handleEntityNotFound(_0x8863f1,null))[_0x5980('0x25')](removeEntity(_0x8863f1,null))[_0x5980('0x46')](handleError(_0x8863f1,null));}; \ No newline at end of file +var _0x8b52=['../../config/license/util','sendStatus','end','status','offset','limit','count','Content-Range','json','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xfe3bc5,_0x2c8bad){var _0x46686a=function(_0x36338f){while(--_0x36338f){_0xfe3bc5['push'](_0xfe3bc5['shift']());}};_0x46686a(++_0x2c8bad);}(_0x8b52,0x151));var _0x28b5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8b52[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x28b5('0x0'));var rimraf=require(_0x28b5('0x1'));var zipdir=require(_0x28b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28b5('0x3'));var moment=require(_0x28b5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28b5('0x5'));var util=require(_0x28b5('0x6'));var path=require(_0x28b5('0x7'));var sox=require(_0x28b5('0x8'));var csv=require(_0x28b5('0x9'));var ejs=require(_0x28b5('0xa'));var fs=require('fs');var fs_extra=require(_0x28b5('0xb'));var _=require(_0x28b5('0xc'));var squel=require(_0x28b5('0xd'));var crypto=require('crypto');var jsforce=require(_0x28b5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28b5('0xf'));var Papa=require(_0x28b5('0x10'));var Redis=require('ioredis');var authService=require(_0x28b5('0x11'));var qs=require(_0x28b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28b5('0x13'));var logger=require(_0x28b5('0x14'))(_0x28b5('0x15'));var utils=require(_0x28b5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28b5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc18108,_0x3bd9f3){_0x3bd9f3=_0x3bd9f3||0xcc;return function(_0x5f41b6){if(_0x5f41b6){return _0xc18108[_0x28b5('0x18')](_0x3bd9f3);}return _0xc18108['status'](_0x3bd9f3)[_0x28b5('0x19')]();};}function respondWithResult(_0x4a684e,_0x58f350){_0x58f350=_0x58f350||0xc8;return function(_0xff943a){if(_0xff943a){return _0x4a684e[_0x28b5('0x1a')](_0x58f350)['json'](_0xff943a);}};}function respondWithFilteredResult(_0x2c17c7,_0x26213c){return function(_0x1e4a10){if(_0x1e4a10){var _0x16c115=typeof _0x26213c[_0x28b5('0x1b')]==='undefined'&&typeof _0x26213c[_0x28b5('0x1c')]==='undefined';var _0x7b6900=_0x1e4a10[_0x28b5('0x1d')];var _0xfea919=_0x16c115?0x0:_0x26213c[_0x28b5('0x1b')];var _0x540933=_0x16c115?_0x1e4a10[_0x28b5('0x1d')]:_0x26213c[_0x28b5('0x1b')]+_0x26213c[_0x28b5('0x1c')];var _0x534136;if(_0x540933>=_0x7b6900){_0x540933=_0x7b6900;_0x534136=0xc8;}else{_0x534136=0xce;}_0x2c17c7[_0x28b5('0x1a')](_0x534136);return _0x2c17c7['set'](_0x28b5('0x1e'),_0xfea919+'-'+_0x540933+'/'+_0x7b6900)[_0x28b5('0x1f')](_0x1e4a10);}return null;};}function patchUpdates(_0x2c4cae){return function(_0x386494){try{jsonpatch['apply'](_0x386494,_0x2c4cae,!![]);}catch(_0x3ebe9e){return BPromise[_0x28b5('0x20')](_0x3ebe9e);}return _0x386494[_0x28b5('0x21')]();};}function saveUpdates(_0x32c819,_0x5c453a){return function(_0x4a8893){if(_0x4a8893){return _0x4a8893['update'](_0x32c819)[_0x28b5('0x22')](function(_0x1bf044){return _0x1bf044;});}return null;};}function removeEntity(_0x395feb,_0x740562){return function(_0x8fa4b9){if(_0x8fa4b9){return _0x8fa4b9[_0x28b5('0x23')]()['then'](function(){_0x395feb['status'](0xcc)[_0x28b5('0x19')]();});}};}function handleEntityNotFound(_0x528993,_0x304f72){return function(_0x25fd54){if(!_0x25fd54){_0x528993[_0x28b5('0x18')](0x194);}return _0x25fd54;};}function handleError(_0x18176c,_0x127ab0){_0x127ab0=_0x127ab0||0x1f4;return function(_0x5ae41d){logger['error'](_0x5ae41d[_0x28b5('0x24')]);if(_0x5ae41d[_0x28b5('0x25')]){delete _0x5ae41d[_0x28b5('0x25')];}_0x18176c[_0x28b5('0x1a')](_0x127ab0)[_0x28b5('0x26')](_0x5ae41d);};}exports[_0x28b5('0x27')]=function(_0x2db6f1,_0x1bbe54){var _0x139524={},_0x2a182a={},_0x491b72={'count':0x0,'rows':[]};var _0x2b46f7=_[_0x28b5('0x28')](db['WhatsappApplication'][_0x28b5('0x29')],function(_0x330767){return{'name':_0x330767[_0x28b5('0x2a')],'type':_0x330767[_0x28b5('0x2b')][_0x28b5('0x2c')]};});_0x2a182a[_0x28b5('0x2d')]=_[_0x28b5('0x28')](_0x2b46f7,'name');_0x2a182a[_0x28b5('0x2e')]=_['keys'](_0x2db6f1[_0x28b5('0x2e')]);_0x2a182a[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],_0x2a182a[_0x28b5('0x2e')]);_0x139524[_0x28b5('0x31')]=_[_0x28b5('0x30')](_0x2a182a[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x139524[_0x28b5('0x31')]=_0x139524[_0x28b5('0x31')][_0x28b5('0x33')]?_0x139524[_0x28b5('0x31')]:_0x2a182a[_0x28b5('0x2d')];if(!_0x2db6f1['query'][_0x28b5('0x34')]('nolimit')){_0x139524[_0x28b5('0x1c')]=qs[_0x28b5('0x1c')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1c')]);_0x139524['offset']=qs[_0x28b5('0x1b')](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x1b')]);}_0x139524['order']=qs['sort'](_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x35')]);_0x139524[_0x28b5('0x36')]=qs[_0x28b5('0x2f')](_['pick'](_0x2db6f1[_0x28b5('0x2e')],_0x2a182a[_0x28b5('0x2f')]),_0x2b46f7);if(_0x2db6f1[_0x28b5('0x2e')][_0x28b5('0x37')]){_0x139524[_0x28b5('0x36')]=_[_0x28b5('0x38')](_0x139524[_0x28b5('0x36')],{'$or':_[_0x28b5('0x28')](_0x2b46f7,function(_0x4cc88a){if(_0x4cc88a[_0x28b5('0x2b')]!==_0x28b5('0x39')){var _0x4d3d09={};_0x4d3d09[_0x4cc88a[_0x28b5('0x25')]]={'$like':'%'+_0x2db6f1['query'][_0x28b5('0x37')]+'%'};return _0x4d3d09;}})});}_0x139524=_[_0x28b5('0x38')]({},_0x139524,_0x2db6f1[_0x28b5('0x3a')]);var _0x5e1fb2={'where':_0x139524[_0x28b5('0x36')]};return db[_0x28b5('0x3b')][_0x28b5('0x1d')](_0x5e1fb2)[_0x28b5('0x22')](function(_0x31f620){_0x491b72[_0x28b5('0x1d')]=_0x31f620;if(_0x2db6f1['query'][_0x28b5('0x3c')]){_0x139524[_0x28b5('0x3d')]=[{'all':!![]}];}return db[_0x28b5('0x3b')][_0x28b5('0x3e')](_0x139524);})[_0x28b5('0x22')](function(_0x5c237f){_0x491b72[_0x28b5('0x3f')]=_0x5c237f;return _0x491b72;})[_0x28b5('0x22')](respondWithFilteredResult(_0x1bbe54,_0x139524))[_0x28b5('0x40')](handleError(_0x1bbe54,null));};exports[_0x28b5('0x41')]=function(_0x45bd3c,_0x4bd2e3){var _0x2ac508={'raw':!![],'where':{'id':_0x45bd3c[_0x28b5('0x42')]['id']}},_0x5bee77={};_0x5bee77[_0x28b5('0x2d')]=_[_0x28b5('0x43')](db[_0x28b5('0x3b')]['rawAttributes']);_0x5bee77['query']=_[_0x28b5('0x43')](_0x45bd3c[_0x28b5('0x2e')]);_0x5bee77[_0x28b5('0x2f')]=_[_0x28b5('0x30')](_0x5bee77[_0x28b5('0x2d')],_0x5bee77['query']);_0x2ac508[_0x28b5('0x31')]=_['intersection'](_0x5bee77[_0x28b5('0x2d')],qs[_0x28b5('0x32')](_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x32')]));_0x2ac508[_0x28b5('0x31')]=_0x2ac508[_0x28b5('0x31')][_0x28b5('0x33')]?_0x2ac508['attributes']:_0x5bee77[_0x28b5('0x2d')];if(_0x45bd3c[_0x28b5('0x2e')][_0x28b5('0x3c')]){_0x2ac508[_0x28b5('0x3d')]=[{'all':!![]}];}_0x2ac508=_[_0x28b5('0x38')]({},_0x2ac508,_0x45bd3c[_0x28b5('0x3a')]);return db[_0x28b5('0x3b')][_0x28b5('0x44')](_0x2ac508)[_0x28b5('0x22')](handleEntityNotFound(_0x4bd2e3,null))['then'](respondWithResult(_0x4bd2e3,null))[_0x28b5('0x40')](handleError(_0x4bd2e3,null));};exports[_0x28b5('0x45')]=function(_0xe46b0a,_0x141f9a){return db['WhatsappApplication'][_0x28b5('0x45')](_0xe46b0a[_0x28b5('0x46')],{})[_0x28b5('0x22')](respondWithResult(_0x141f9a,0xc9))[_0x28b5('0x40')](handleError(_0x141f9a,null));};exports[_0x28b5('0x47')]=function(_0xaf449d,_0x3d7fdd){if(_0xaf449d[_0x28b5('0x46')]['id']){delete _0xaf449d[_0x28b5('0x46')]['id'];}return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0xaf449d[_0x28b5('0x42')]['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x3d7fdd,null))[_0x28b5('0x22')](saveUpdates(_0xaf449d['body'],null))['then'](respondWithResult(_0x3d7fdd,null))['catch'](handleError(_0x3d7fdd,null));};exports[_0x28b5('0x23')]=function(_0x97af32,_0x5aaef3){return db[_0x28b5('0x3b')][_0x28b5('0x44')]({'where':{'id':_0x97af32['params']['id']}})[_0x28b5('0x22')](handleEntityNotFound(_0x5aaef3,null))[_0x28b5('0x22')](removeEntity(_0x5aaef3,null))[_0x28b5('0x40')](handleError(_0x5aaef3,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index d42c0f5..45e6644 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 _0xe015=['path','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x75336d,_0x1a487a){var _0x565eaa=function(_0xba53e6){while(--_0xba53e6){_0x75336d['push'](_0x75336d['shift']());}};_0x565eaa(++_0x1a487a);}(_0xe015,0x13b));var _0x5e01=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe015[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('WhatsappApplication',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e01('0x9'),'collate':_0x5e01('0xa')});}; \ No newline at end of file +var _0x1159=['define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x1d8432,_0x3776ea){var _0x5bde82=function(_0x1e5c67){while(--_0x1e5c67){_0x1d8432['push'](_0x1d8432['shift']());}};_0x5bde82(++_0x3776ea);}(_0x1159,0xf3));var _0x9115=function(_0x3df8df,_0x218f71){_0x3df8df=_0x3df8df-0x0;var _0x48578c=_0x1159[_0x3df8df];return _0x48578c;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9115('0xc'),'collate':_0x9115('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 6b3f1e1..f8bc124 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 _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x31dbea,_0x4d9e49){var _0xbe3cfe=function(_0x3a627f){while(--_0x3a627f){_0x31dbea['push'](_0x31dbea['shift']());}};_0xbe3cfe(++_0x4d9e49);}(_0x70e0,0x17b));var _0x070e=function(_0x519ef2,_0x4a1a51){_0x519ef2=_0x519ef2-0x0;var _0x786871=_0x70e0[_0x519ef2];return _0x786871;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\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 _0x0a9a=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1644f2,_0x2884e8){var _0x1fcb31=function(_0x41773c){while(--_0x41773c){_0x1644f2['push'](_0x1644f2['shift']());}};_0x1fcb31(++_0x2884e8);}(_0x0a9a,0x183));var _0xa0a9=function(_0x1ba18e,_0x335775){_0x1ba18e=_0x1ba18e-0x0;var _0xf31a91=_0x0a9a[_0x1ba18e];return _0xf31a91;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 52845ad..7858551 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 _0x187d=['whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','tracked','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags'];(function(_0x3fe833,_0x58ae75){var _0x491c9d=function(_0x353385){while(--_0x353385){_0x3fe833['push'](_0x3fe833['shift']());}};_0x491c9d(++_0x58ae75);}(_0x187d,0x93));var _0xd187=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x187d[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0xb')](_0xd187('0x10'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0xb')]('/:id/download',auth[_0xd187('0x9')](),controller[_0xd187('0x12')]);router[_0xd187('0x13')]('/',auth['isAuthenticated'](),controller[_0xd187('0x14')]);router[_0xd187('0x13')](_0xd187('0x10'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);router[_0xd187('0x13')](_0xd187('0x16'),auth[_0xd187('0x9')](),interaction['tracked'](_0xd187('0x17'),_0xd187('0x18')),controller[_0xd187('0x19')]);router[_0xd187('0x1a')]('/:id',auth[_0xd187('0x9')](),interaction['tracked']('whatsapp',_0xd187('0x1b')),controller['update']);router['delete'](_0xd187('0xe'),auth[_0xd187('0x9')](),interaction[_0xd187('0x1c')](_0xd187('0x17'),_0xd187('0x1d')),controller[_0xd187('0x1e')]);router[_0xd187('0x1f')](_0xd187('0x16'),auth[_0xd187('0x9')](),controller[_0xd187('0x20')]);module[_0xd187('0x21')]=router; \ No newline at end of file +var _0x5d17=['whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','getMessages','download','post','create','addMessage','/:id/tags','whatsappinteraction:addtags','addTags','put','tracked'];(function(_0x4eb863,_0x4dfda9){var _0x456061=function(_0x41b406){while(--_0x41b406){_0x4eb863['push'](_0x4eb863['shift']());}};_0x456061(++_0x4dfda9);}(_0x5d17,0x114));var _0x75d1=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x5d17[_0x4d2993];return _0x427374;};'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')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x75d1('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x75d1('0xe')]);router[_0x75d1('0x8')]('/:id/download',auth[_0x75d1('0xb')](),controller[_0x75d1('0xf')]);router[_0x75d1('0x10')]('/',auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);router[_0x75d1('0x10')]('/:id/messages',auth[_0x75d1('0xb')](),controller[_0x75d1('0x12')]);router[_0x75d1('0x10')](_0x75d1('0x13'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x75d1('0x14')),controller[_0x75d1('0x15')]);router[_0x75d1('0x16')]('/:id',auth[_0x75d1('0xb')](),interaction[_0x75d1('0x17')](_0x75d1('0x18'),_0x75d1('0x19')),controller[_0x75d1('0x1a')]);router[_0x75d1('0x1b')](_0x75d1('0xd'),auth[_0x75d1('0xb')](),interaction[_0x75d1('0x17')](_0x75d1('0x18'),_0x75d1('0x1c')),controller['destroy']);router['delete'](_0x75d1('0x13'),auth[_0x75d1('0xb')](),controller['removeTags']);module[_0x75d1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index e87cc8c..2aa8943 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 _0x02ce=['STRING','ENUM','out','INTEGER','sequelize','moment','exports','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x02ce,0x1ac));var _0xe02c=function(_0x49a96b,_0x51f3dc){_0x49a96b=_0x49a96b-0x0;var _0x388601=_0x02ce[_0x49a96b];return _0x388601;};'use strict';var Sequelize=require(_0xe02c('0x0'));var moment=require(_0xe02c('0x1'));module[_0xe02c('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe02c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe02c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe02c('0x4')]},'note':{'type':Sequelize[_0xe02c('0x4')]},'phone':{'type':Sequelize[_0xe02c('0x4')]},'read1stAt':{'type':Sequelize[_0xe02c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe02c('0x5')]('in',_0xe02c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe02c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe02c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe02c('0x7')]}}; \ No newline at end of file +var _0xd3c8=['out','INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x9972af,_0x451342){var _0x5eed3c=function(_0x4b83b1){while(--_0x4b83b1){_0x9972af['push'](_0x9972af['shift']());}};_0x5eed3c(++_0x451342);}(_0xd3c8,0x161));var _0x8d3c=function(_0x246c8a,_0x436e0a){_0x246c8a=_0x246c8a-0x0;var _0xec552d=_0xd3c8[_0x246c8a];return _0xec552d;};'use strict';var Sequelize=require(_0x8d3c('0x0'));var moment=require(_0x8d3c('0x1'));module[_0x8d3c('0x2')]={'closed':{'type':Sequelize[_0x8d3c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8d3c('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8d3c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x8d3c('0x5')]},'note':{'type':Sequelize[_0x8d3c('0x5')]},'phone':{'type':Sequelize[_0x8d3c('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x8d3c('0x6')]('in',_0x8d3c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8d3c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8d3c('0x6')]('in',_0x8d3c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8d3c('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8d3c('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 1466a99..889f181 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 _0xcaab=['merge','WhatsappInteraction','find','create','body','destroy','describe','WhatsappMessage','ids','omit','findOne','order','sort','where','WhatsappInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','setTags','spread','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','push','User','fullname','Contact','firstName','Attachment','Messages','secret','read','Account','Owner','get','Whatsapp','N.A.','createdAt','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','direction','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','./whatsappInteraction.socket','register','end','json','offset','undefined','limit','count','status','set','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','findAll','user','catch','show','params','keys','query','filters','attributes','intersection','model','fields','length','include'];(function(_0xf5eaa0,_0x5bfa29){var _0x47039e=function(_0x4b47a6){while(--_0x4b47a6){_0xf5eaa0['push'](_0xf5eaa0['shift']());}};_0x47039e(++_0x5bfa29);}(_0xcaab,0x1a7));var _0xbcaa=function(_0x435f69,_0x3c6f0a){_0x435f69=_0x435f69-0x0;var _0x23e3b8=_0xcaab[_0x435f69];return _0x23e3b8;};'use strict';var rimraf=require(_0xbcaa('0x0'));var zipdir=require(_0xbcaa('0x1'));var moment=require(_0xbcaa('0x2'));var BPromise=require(_0xbcaa('0x3'));var util=require('util');var path=require('path');var ejs=require(_0xbcaa('0x4'));var fs=require('fs');var _=require(_0xbcaa('0x5'));var Redis=require(_0xbcaa('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xbcaa('0x7'));var logger=require(_0xbcaa('0x8'))(_0xbcaa('0x9'));var config=require('../../config/environment');var db=require(_0xbcaa('0xa'))['db'];config[_0xbcaa('0xb')]=_[_0xbcaa('0xc')](config[_0xbcaa('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcaa('0xb')]));require(_0xbcaa('0xd'))[_0xbcaa('0xe')](socket);function respondWithStatusCode(_0x22d161,_0xac74a3){_0xac74a3=_0xac74a3||0xcc;return function(_0x636c08){if(_0x636c08){return _0x22d161['sendStatus'](_0xac74a3);}return _0x22d161['status'](_0xac74a3)[_0xbcaa('0xf')]();};}function respondWithResult(_0x205f9,_0x1cbf4f){_0x1cbf4f=_0x1cbf4f||0xc8;return function(_0x1bbf17){if(_0x1bbf17){return _0x205f9['status'](_0x1cbf4f)[_0xbcaa('0x10')](_0x1bbf17);}};}function respondWithFilteredResult(_0x9813fc,_0xe96b7){return function(_0x5b9b0a){if(_0x5b9b0a){var _0xdb25af=typeof _0xe96b7[_0xbcaa('0x11')]===_0xbcaa('0x12')&&typeof _0xe96b7[_0xbcaa('0x13')]===_0xbcaa('0x12');var _0x2d29c7=_0x5b9b0a[_0xbcaa('0x14')];var _0x108f7f=_0xdb25af?0x0:_0xe96b7['offset'];var _0x7ded0e=_0xdb25af?_0x5b9b0a['count']:_0xe96b7[_0xbcaa('0x11')]+_0xe96b7[_0xbcaa('0x13')];var _0x5f40c1;if(_0x7ded0e>=_0x2d29c7){_0x7ded0e=_0x2d29c7;_0x5f40c1=0xc8;}else{_0x5f40c1=0xce;}_0x9813fc[_0xbcaa('0x15')](_0x5f40c1);return _0x9813fc[_0xbcaa('0x16')]('Content-Range',_0x108f7f+'-'+_0x7ded0e+'/'+_0x2d29c7)['json'](_0x5b9b0a);}return null;};}function saveUpdates(_0x580102){return function(_0x3619ea){if(_0x3619ea){return _0x3619ea[_0xbcaa('0x17')](_0x580102)[_0xbcaa('0x18')](function(_0xd86169){return _0xd86169;});}return null;};}function removeEntity(_0x10449a){return function(_0xa2c005){if(_0xa2c005){return _0xa2c005['destroy']()[_0xbcaa('0x18')](function(){_0x10449a[_0xbcaa('0x15')](0xcc)[_0xbcaa('0xf')]();});}};}function handleEntityNotFound(_0x249160){return function(_0x14a1a0){if(!_0x14a1a0){_0x249160[_0xbcaa('0x19')](0x194);}return _0x14a1a0;};}function handleError(_0x430c39,_0x3e987a){_0x3e987a=_0x3e987a||0x1f4;return function(_0x52c051){logger[_0xbcaa('0x1a')](_0x52c051[_0xbcaa('0x1b')]);if(_0x52c051['name']){delete _0x52c051[_0xbcaa('0x1c')];}_0x430c39[_0xbcaa('0x15')](_0x3e987a)[_0xbcaa('0x1d')](_0x52c051);};}exports[_0xbcaa('0x1e')]=function(_0x2b77d2,_0x296a7b){var _0x2b22e9={};var _0x28784f=_[_0xbcaa('0x1f')](db['WhatsappInteraction'][_0xbcaa('0x20')],function(_0x13d6c9){return{'name':_0x13d6c9['fieldName'],'type':_0x13d6c9[_0xbcaa('0x21')][_0xbcaa('0x22')]};});_0x2b22e9=qs['getOptions'](_0x28784f,_0x2b77d2);return interaction[_0xbcaa('0x23')]('whatsapp',_0x2b77d2['query'],_0x2b77d2[_0xbcaa('0x24')],_0x2b22e9,_0x28784f)[_0xbcaa('0x18')](respondWithFilteredResult(_0x296a7b,_0x2b22e9))[_0xbcaa('0x25')](handleError(_0x296a7b,null));};exports[_0xbcaa('0x26')]=function(_0x3e26ac,_0x1f5830){var _0x2ac7f9={'raw':![],'where':{'id':_0x3e26ac[_0xbcaa('0x27')]['id']}},_0x1ec4d4={};_0x1ec4d4['model']=_[_0xbcaa('0x28')](db['WhatsappInteraction'][_0xbcaa('0x20')]);_0x1ec4d4[_0xbcaa('0x29')]=_[_0xbcaa('0x28')](_0x3e26ac[_0xbcaa('0x29')]);_0x1ec4d4[_0xbcaa('0x2a')]=_['intersection'](_0x1ec4d4['model'],_0x1ec4d4[_0xbcaa('0x29')]);_0x2ac7f9[_0xbcaa('0x2b')]=_[_0xbcaa('0x2c')](_0x1ec4d4[_0xbcaa('0x2d')],qs[_0xbcaa('0x2e')](_0x3e26ac[_0xbcaa('0x29')][_0xbcaa('0x2e')]));_0x2ac7f9['attributes']=_0x2ac7f9[_0xbcaa('0x2b')][_0xbcaa('0x2f')]?_0x2ac7f9[_0xbcaa('0x2b')]:_0x1ec4d4[_0xbcaa('0x2d')];if(_0x3e26ac[_0xbcaa('0x29')]['includeAll']){_0x2ac7f9[_0xbcaa('0x30')]=[{'all':!![]}];}_0x2ac7f9=_[_0xbcaa('0x31')]({},_0x2ac7f9,_0x3e26ac['options']);return db[_0xbcaa('0x32')][_0xbcaa('0x33')](_0x2ac7f9)[_0xbcaa('0x18')](handleEntityNotFound(_0x1f5830,null))[_0xbcaa('0x18')](respondWithResult(_0x1f5830,null))[_0xbcaa('0x25')](handleError(_0x1f5830,null));};exports[_0xbcaa('0x34')]=function(_0x4330a1,_0xf4b412){return db[_0xbcaa('0x32')][_0xbcaa('0x34')](_0x4330a1['body'],{})[_0xbcaa('0x18')](respondWithResult(_0xf4b412,0xc9))[_0xbcaa('0x25')](handleError(_0xf4b412,null));};exports['update']=function(_0x1eecd7,_0x44af6d){if(_0x1eecd7[_0xbcaa('0x35')]['id']){delete _0x1eecd7[_0xbcaa('0x35')]['id'];}return db['WhatsappInteraction'][_0xbcaa('0x33')]({'where':{'id':_0x1eecd7[_0xbcaa('0x27')]['id']}})[_0xbcaa('0x18')](handleEntityNotFound(_0x44af6d,null))[_0xbcaa('0x18')](saveUpdates(_0x1eecd7[_0xbcaa('0x35')],null))['then'](respondWithResult(_0x44af6d,null))[_0xbcaa('0x25')](handleError(_0x44af6d,null));};exports[_0xbcaa('0x36')]=function(_0x10133c,_0x3b3d7b){return db[_0xbcaa('0x32')][_0xbcaa('0x33')]({'where':{'id':_0x10133c[_0xbcaa('0x27')]['id']}})[_0xbcaa('0x18')](handleEntityNotFound(_0x3b3d7b,null))[_0xbcaa('0x18')](removeEntity(_0x3b3d7b,null))['catch'](handleError(_0x3b3d7b,null));};exports[_0xbcaa('0x37')]=function(_0x19e983,_0x47129e){return db[_0xbcaa('0x32')]['describe']()[_0xbcaa('0x18')](respondWithResult(_0x47129e,null))[_0xbcaa('0x25')](handleError(_0x47129e,null));};exports['addMessage']=function(_0x1a5ae9,_0x4ae3ae){return db[_0xbcaa('0x38')]['find']({'where':{'id':_0x1a5ae9[_0xbcaa('0x27')]['id']}})[_0xbcaa('0x18')](handleEntityNotFound(_0x4ae3ae,null))['then'](function(_0x535d02){if(_0x535d02){return _0x535d02['addMessage'](_0x1a5ae9['body'][_0xbcaa('0x39')],_[_0xbcaa('0x3a')](_0x1a5ae9[_0xbcaa('0x35')],[_0xbcaa('0x39'),'id'])||{});}})[_0xbcaa('0x18')](respondWithResult(_0x4ae3ae,null))[_0xbcaa('0x25')](handleError(_0x4ae3ae,null));};exports['getMessages']=function(_0x256376,_0x56f3b0){var _0x3be171={'raw':![],'where':{}};var _0x598d6b={};var _0x3a2021={'count':0x0,'rows':[]};return db[_0xbcaa('0x32')][_0xbcaa('0x3b')]({'where':{'id':_0x256376[_0xbcaa('0x27')]['id']}})[_0xbcaa('0x18')](handleEntityNotFound(_0x56f3b0,null))[_0xbcaa('0x18')](function(_0x11acde){if(_0x11acde){_0x598d6b[_0xbcaa('0x2d')]=_[_0xbcaa('0x28')](db['WhatsappMessage'][_0xbcaa('0x20')]);_0x598d6b[_0xbcaa('0x29')]=_[_0xbcaa('0x28')](_0x256376[_0xbcaa('0x29')]);_0x598d6b[_0xbcaa('0x2a')]=_[_0xbcaa('0x2c')](_0x598d6b[_0xbcaa('0x2d')],_0x598d6b[_0xbcaa('0x29')]);_0x3be171[_0xbcaa('0x2b')]=_[_0xbcaa('0x2c')](_0x598d6b[_0xbcaa('0x2d')],qs[_0xbcaa('0x2e')](_0x256376[_0xbcaa('0x29')]['fields']));_0x3be171[_0xbcaa('0x2b')]=_0x3be171[_0xbcaa('0x2b')][_0xbcaa('0x2f')]?_0x3be171[_0xbcaa('0x2b')]:_0x598d6b[_0xbcaa('0x2d')];if(!_0x256376[_0xbcaa('0x29')]['hasOwnProperty']('nolimit')){_0x3be171['limit']=qs[_0xbcaa('0x13')](_0x256376[_0xbcaa('0x29')][_0xbcaa('0x13')]);_0x3be171[_0xbcaa('0x11')]=qs['offset'](_0x256376[_0xbcaa('0x29')]['offset']);}_0x3be171[_0xbcaa('0x3c')]=qs[_0xbcaa('0x3d')](_0x256376[_0xbcaa('0x29')][_0xbcaa('0x3d')]);_0x3be171[_0xbcaa('0x3e')]=qs[_0xbcaa('0x2a')](_['pick'](_0x256376['query'],_0x598d6b['filters']));_0x3be171[_0xbcaa('0x3e')][_0xbcaa('0x3f')]=_0x11acde['id'];if(_0x256376[_0xbcaa('0x29')]['filter']){_0x3be171[_0xbcaa('0x3e')]=_[_0xbcaa('0x31')](_0x3be171[_0xbcaa('0x3e')],{'$or':_[_0xbcaa('0x1f')](_0x3be171[_0xbcaa('0x2b')],function(_0x12aad9){var _0x43b2a0={};_0x43b2a0[_0x12aad9]={'$like':'%'+_0x256376[_0xbcaa('0x29')][_0xbcaa('0x40')]+'%'};return _0x43b2a0;})});}if(_0x256376[_0xbcaa('0x29')][_0xbcaa('0x41')]){var _0x2ae9b9=_0x256376['query']['$gte'][_0xbcaa('0x42')](',');var _0x3e30b5={};_0x3e30b5[_0x2ae9b9[0x0]]={'$gte':moment(_0x2ae9b9[0x1])['format'](_0xbcaa('0x43'))};_0x3be171[_0xbcaa('0x3e')]=_['merge'](_0x3be171[_0xbcaa('0x3e')],_0x3e30b5);}_0x3be171=_[_0xbcaa('0x31')]({},_0x3be171,_0x256376[_0xbcaa('0x44')]);return db[_0xbcaa('0x38')][_0xbcaa('0x14')]({'where':_0x3be171[_0xbcaa('0x3e')]})[_0xbcaa('0x18')](function(_0x434935){_0x3a2021[_0xbcaa('0x14')]=_0x434935;if(_0x256376['query'][_0xbcaa('0x45')]){_0x3be171[_0xbcaa('0x30')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xbcaa('0x23')](_0x3be171);})[_0xbcaa('0x18')](function(_0x194e8b){_0x3a2021['rows']=_0x194e8b;return _0x3a2021;});}})[_0xbcaa('0x18')](respondWithFilteredResult(_0x56f3b0,_0x3be171))[_0xbcaa('0x25')](handleError(_0x56f3b0,null));};exports['addTags']=function(_0x227f03,_0x6105e){return db[_0xbcaa('0x32')][_0xbcaa('0x33')]({'where':{'id':_0x227f03[_0xbcaa('0x27')]['id']}})[_0xbcaa('0x18')](handleEntityNotFound(_0x6105e,null))[_0xbcaa('0x18')](function(_0xfa8563){if(_0xfa8563){return _0xfa8563[_0xbcaa('0x46')](_0x227f03[_0xbcaa('0x35')][_0xbcaa('0x39')],_[_0xbcaa('0x3a')](_0x227f03[_0xbcaa('0x35')],[_0xbcaa('0x39'),'id'])||{})[_0xbcaa('0x47')](function(){return db['Tag'][_0xbcaa('0x23')]({'attributes':['id',_0xbcaa('0x1c'),_0xbcaa('0x48')],'where':{'id':_0x227f03[_0xbcaa('0x35')][_0xbcaa('0x39')]}});})[_0xbcaa('0x18')](function(_0x2e748f){socket[_0xbcaa('0x49')]('whatsappInteractionTags:save',{'id':Number(_0x227f03['params']['id']),'tags':_0x2e748f||[]});return{'id':Number(_0x227f03[_0xbcaa('0x27')]['id']),'tags':_0x2e748f||[]};});}})['then'](respondWithResult(_0x6105e,null))[_0xbcaa('0x25')](handleError(_0x6105e,null));};exports[_0xbcaa('0x4a')]=function(_0x520bd0,_0x20427f){return db[_0xbcaa('0x32')][_0xbcaa('0x33')]({'where':{'id':_0x520bd0[_0xbcaa('0x27')]['id']}})[_0xbcaa('0x18')](handleEntityNotFound(_0x20427f,null))['then'](function(_0x169790){if(_0x169790){return _0x169790[_0xbcaa('0x4a')](_0x520bd0['query'][_0xbcaa('0x39')]);}})['then'](respondWithStatusCode(_0x20427f,null))['catch'](handleError(_0x20427f,null));};exports[_0xbcaa('0x4b')]=function(_0x2b4d52,_0x13c01b){var _0xaea202=moment()[_0xbcaa('0x4c')]()[_0xbcaa('0x4d')]();var _0x970857=path[_0xbcaa('0x4e')](config[_0xbcaa('0x4f')],_0xbcaa('0x50'),_0xbcaa('0x51'),_0xbcaa('0x52'));var _0x591ab8=path['join'](config[_0xbcaa('0x4f')],_0xbcaa('0x50'),'files',_0xbcaa('0x53'));var _0x575e48=path[_0xbcaa('0x4e')](_0x970857,_0xaea202);var _0x45d0c7=util[_0xbcaa('0x54')]('transcript-%d-%s.zip',_0x2b4d52[_0xbcaa('0x27')]['id'],_0xaea202);var _0x1b1f78=path[_0xbcaa('0x4e')](_0x970857,_0x45d0c7);var _0x4242c8=[];_0x4242c8[_0xbcaa('0x55')]({'model':db['User'],'as':_0xbcaa('0x56'),'attributes':['id',_0xbcaa('0x57')],'raw':!![]});_0x4242c8['push']({'model':db['CmContact'],'as':_0xbcaa('0x58'),'attributes':['id',_0xbcaa('0x59'),'lastName'],'raw':!![]});if(_0x2b4d52['query'][_0xbcaa('0x53')]){_0x4242c8['push']({'model':db[_0xbcaa('0x5a')],'as':_0xbcaa('0x5a'),'raw':!![]});}var _0x2f2ea7=[{'model':db['WhatsappMessage'],'as':_0xbcaa('0x5b'),'attributes':['id',_0xbcaa('0x35'),'createdAt','direction',_0xbcaa('0x5c'),_0xbcaa('0x5d')],'include':_0x4242c8}];_0x2f2ea7[_0xbcaa('0x55')]({'model':db['WhatsappAccount'],'as':_0xbcaa('0x5e'),'attributes':['id',_0xbcaa('0x1c')]});_0x2f2ea7[_0xbcaa('0x55')]({'model':db['User'],'as':_0xbcaa('0x5f'),'attributes':['id',_0xbcaa('0x57')]});return db[_0xbcaa('0x32')][_0xbcaa('0x33')]({'where':{'id':_0x2b4d52['params']['id']},'include':_0x2f2ea7})[_0xbcaa('0x18')](handleEntityNotFound(_0x13c01b,null))[_0xbcaa('0x18')](function(_0x3a4f9f){if(_0x3a4f9f){var _0x5a470b=_0x3a4f9f[_0xbcaa('0x60')]({'plain':!![]});fs['mkdirSync'](_0x575e48);var _0x3ea5eb={'channel':_0xbcaa('0x61'),'account':_0x5a470b[_0xbcaa('0x5e')][_0xbcaa('0x1c')],'agent':_0x5a470b[_0xbcaa('0x5f')]?_0x5a470b[_0xbcaa('0x5f')][_0xbcaa('0x57')]:_0xbcaa('0x62'),'createdAt':moment(_0x5a470b[_0xbcaa('0x63')])[_0xbcaa('0x54')](_0xbcaa('0x43'))['toString'](),'closedAt':_0x5a470b[_0xbcaa('0x64')]?moment(_0x5a470b[_0xbcaa('0x65')])[_0xbcaa('0x54')](_0xbcaa('0x43'))['toString']():'','disposition':_0x5a470b[_0xbcaa('0x66')],'messages':_(_0x5a470b[_0xbcaa('0x5b')])[_0xbcaa('0x40')]({'secret':![]})['map'](function(_0x33561d){if(_0x33561d[_0xbcaa('0x5a')]){var _0x42a4ea=path[_0xbcaa('0x4e')](_0x591ab8,_0x33561d[_0xbcaa('0x5a')][_0xbcaa('0x67')]);if(fs['existsSync'](_0x42a4ea)){fs[_0xbcaa('0x68')](_0x42a4ea)[_0xbcaa('0x69')](fs[_0xbcaa('0x6a')](path[_0xbcaa('0x4e')](_0x575e48,_0x33561d[_0xbcaa('0x5a')][_0xbcaa('0x67')])));}}return{'date':moment(_0x33561d[_0xbcaa('0x63')])[_0xbcaa('0x54')](_0xbcaa('0x43'))[_0xbcaa('0x4d')](),'sender':_0x33561d[_0xbcaa('0x6b')]===_0xbcaa('0x6c')?_0x33561d[_0xbcaa('0x56')]?_0x33561d[_0xbcaa('0x56')][_0xbcaa('0x57')]:_0xbcaa('0x6d'):_0x33561d[_0xbcaa('0x58')][_0xbcaa('0x59')]+(_0x33561d['Contact'][_0xbcaa('0x6e')]?'\x20'+_0x33561d[_0xbcaa('0x58')]['lastName']:''),'body':_0x33561d['Attachment']?_0x33561d[_0xbcaa('0x5a')][_0xbcaa('0x67')]:_0x33561d[_0xbcaa('0x35')],'direction':_0x33561d[_0xbcaa('0x6b')]==='out'?'A':'C','secret':_0x33561d[_0xbcaa('0x5c')],'read':_0x33561d['read'],'attachment':_0x33561d[_0xbcaa('0x5a')]};})['value']()};return ejs[_0xbcaa('0x6f')](path[_0xbcaa('0x4e')](config['root'],'server',_0xbcaa('0x70'),_0xbcaa('0x71')),{'interaction':_0x3ea5eb})[_0xbcaa('0x18')](function(_0x2a170a){var _0x5bd126=path['join'](_0x575e48,_0xbcaa('0x72')+_0x5a470b['id']+'-'+_0xaea202+'.pdf');var _0x5eb95b={'path':_0x5bd126,'channel':_0xbcaa('0x61'),'interactionId':_0x5a470b['id']};return pdf[_0xbcaa('0x73')](_0x2a170a,_0x5eb95b);})['then'](function(){return new BPromise(function(_0x17a00e,_0x5d1698){zipdir(_0x575e48,{'saveTo':_0x1b1f78},function(_0x4c24c8,_0x5f2284){if(_0x4c24c8)return _0x5d1698(_0x4c24c8);return _0x17a00e(_0x5f2284);});})[_0xbcaa('0x18')](function(){return new BPromise(function(_0x3a94cd,_0x4682a1){rimraf(_0x575e48,function(_0x4d95f1){if(_0x4d95f1)_0x4682a1(_0x4d95f1);return _0x3a94cd();});});})[_0xbcaa('0x18')](function(){return _0x13c01b[_0xbcaa('0x4b')](_0x1b1f78,_0x45d0c7,function(_0x3c24a2){if(_0x3c24a2){console[_0xbcaa('0x74')](_0xbcaa('0x75'),_0x3c24a2);}else{fs['unlinkSync'](_0x1b1f78);}});});});}else{return _0x13c01b[_0xbcaa('0x19')](0xc8);}})[_0xbcaa('0x25')](handleError(_0x13c01b,null));}; \ No newline at end of file +var _0x934b=['set','Content-Range','destroy','then','error','stack','name','send','index','type','key','getOptions','findAll','query','user','catch','show','model','WhatsappInteraction','rawAttributes','keys','filters','attributes','intersection','fields','length','include','merge','options','find','create','body','update','params','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','sort','where','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','get','mkdirSync','Owner','fullname','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','value','renderFile','views','downloadInteraction.ejs','Whatsapp','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x934b,0xe4));var _0xb934=function(_0x36f5cb,_0x2a720f){_0x36f5cb=_0x36f5cb-0x0;var _0x58d6ce=_0x934b[_0x36f5cb];return _0x58d6ce;};'use strict';var rimraf=require(_0xb934('0x0'));var zipdir=require(_0xb934('0x1'));var moment=require(_0xb934('0x2'));var BPromise=require(_0xb934('0x3'));var util=require('util');var path=require(_0xb934('0x4'));var ejs=require(_0xb934('0x5'));var fs=require('fs');var _=require(_0xb934('0x6'));var Redis=require(_0xb934('0x7'));var interaction=require(_0xb934('0x8'));var qs=require(_0xb934('0x9'));var pdf=require(_0xb934('0xa'));var logger=require(_0xb934('0xb'))('api');var config=require(_0xb934('0xc'));var db=require('../../mysqldb')['db'];config[_0xb934('0xd')]=_['defaults'](config[_0xb934('0xd')],{'host':_0xb934('0xe'),'port':0x18eb});var socket=require(_0xb934('0xf'))(new Redis(config[_0xb934('0xd')]));require(_0xb934('0x10'))[_0xb934('0x11')](socket);function respondWithStatusCode(_0x275c3f,_0x552155){_0x552155=_0x552155||0xcc;return function(_0x4ab59d){if(_0x4ab59d){return _0x275c3f[_0xb934('0x12')](_0x552155);}return _0x275c3f[_0xb934('0x13')](_0x552155)[_0xb934('0x14')]();};}function respondWithResult(_0x1c7234,_0x4b1bab){_0x4b1bab=_0x4b1bab||0xc8;return function(_0x431934){if(_0x431934){return _0x1c7234[_0xb934('0x13')](_0x4b1bab)[_0xb934('0x15')](_0x431934);}};}function respondWithFilteredResult(_0xd5fab4,_0x516d6a){return function(_0x3590d9){if(_0x3590d9){var _0x24ce2f=typeof _0x516d6a[_0xb934('0x16')]===_0xb934('0x17')&&typeof _0x516d6a[_0xb934('0x18')]===_0xb934('0x17');var _0x512642=_0x3590d9[_0xb934('0x19')];var _0x1ea202=_0x24ce2f?0x0:_0x516d6a[_0xb934('0x16')];var _0x15f749=_0x24ce2f?_0x3590d9[_0xb934('0x19')]:_0x516d6a[_0xb934('0x16')]+_0x516d6a[_0xb934('0x18')];var _0x122b4a;if(_0x15f749>=_0x512642){_0x15f749=_0x512642;_0x122b4a=0xc8;}else{_0x122b4a=0xce;}_0xd5fab4['status'](_0x122b4a);return _0xd5fab4[_0xb934('0x1a')](_0xb934('0x1b'),_0x1ea202+'-'+_0x15f749+'/'+_0x512642)[_0xb934('0x15')](_0x3590d9);}return null;};}function saveUpdates(_0x4d2de5){return function(_0x474d89){if(_0x474d89){return _0x474d89['update'](_0x4d2de5)['then'](function(_0xde2c30){return _0xde2c30;});}return null;};}function removeEntity(_0xf0c0d){return function(_0x2cfdc4){if(_0x2cfdc4){return _0x2cfdc4[_0xb934('0x1c')]()[_0xb934('0x1d')](function(){_0xf0c0d[_0xb934('0x13')](0xcc)[_0xb934('0x14')]();});}};}function handleEntityNotFound(_0x2db191){return function(_0x46ff39){if(!_0x46ff39){_0x2db191[_0xb934('0x12')](0x194);}return _0x46ff39;};}function handleError(_0x8b21f6,_0x269644){_0x269644=_0x269644||0x1f4;return function(_0x36416c){logger[_0xb934('0x1e')](_0x36416c[_0xb934('0x1f')]);if(_0x36416c[_0xb934('0x20')]){delete _0x36416c['name'];}_0x8b21f6[_0xb934('0x13')](_0x269644)[_0xb934('0x21')](_0x36416c);};}exports[_0xb934('0x22')]=function(_0x3a8ed3,_0x103329){var _0x1c8078={};var _0x4517e0=_['map'](db['WhatsappInteraction']['rawAttributes'],function(_0x214c23){return{'name':_0x214c23['fieldName'],'type':_0x214c23[_0xb934('0x23')][_0xb934('0x24')]};});_0x1c8078=qs[_0xb934('0x25')](_0x4517e0,_0x3a8ed3);return interaction[_0xb934('0x26')]('whatsapp',_0x3a8ed3[_0xb934('0x27')],_0x3a8ed3[_0xb934('0x28')],_0x1c8078,_0x4517e0)[_0xb934('0x1d')](respondWithFilteredResult(_0x103329,_0x1c8078))[_0xb934('0x29')](handleError(_0x103329,null));};exports[_0xb934('0x2a')]=function(_0xf30b02,_0x402e3f){var _0x50e0f5={'raw':![],'where':{'id':_0xf30b02['params']['id']}},_0x26c32b={};_0x26c32b[_0xb934('0x2b')]=_['keys'](db[_0xb934('0x2c')][_0xb934('0x2d')]);_0x26c32b['query']=_[_0xb934('0x2e')](_0xf30b02[_0xb934('0x27')]);_0x26c32b[_0xb934('0x2f')]=_['intersection'](_0x26c32b[_0xb934('0x2b')],_0x26c32b[_0xb934('0x27')]);_0x50e0f5[_0xb934('0x30')]=_[_0xb934('0x31')](_0x26c32b[_0xb934('0x2b')],qs[_0xb934('0x32')](_0xf30b02[_0xb934('0x27')][_0xb934('0x32')]));_0x50e0f5[_0xb934('0x30')]=_0x50e0f5[_0xb934('0x30')][_0xb934('0x33')]?_0x50e0f5[_0xb934('0x30')]:_0x26c32b[_0xb934('0x2b')];if(_0xf30b02[_0xb934('0x27')]['includeAll']){_0x50e0f5[_0xb934('0x34')]=[{'all':!![]}];}_0x50e0f5=_[_0xb934('0x35')]({},_0x50e0f5,_0xf30b02[_0xb934('0x36')]);return db['WhatsappInteraction'][_0xb934('0x37')](_0x50e0f5)[_0xb934('0x1d')](handleEntityNotFound(_0x402e3f,null))[_0xb934('0x1d')](respondWithResult(_0x402e3f,null))[_0xb934('0x29')](handleError(_0x402e3f,null));};exports[_0xb934('0x38')]=function(_0x26a08e,_0x43f6a5){return db[_0xb934('0x2c')]['create'](_0x26a08e[_0xb934('0x39')],{})[_0xb934('0x1d')](respondWithResult(_0x43f6a5,0xc9))[_0xb934('0x29')](handleError(_0x43f6a5,null));};exports[_0xb934('0x3a')]=function(_0x76fbf5,_0x1db6d2){if(_0x76fbf5[_0xb934('0x39')]['id']){delete _0x76fbf5['body']['id'];}return db[_0xb934('0x2c')]['find']({'where':{'id':_0x76fbf5[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x1db6d2,null))[_0xb934('0x1d')](saveUpdates(_0x76fbf5[_0xb934('0x39')],null))[_0xb934('0x1d')](respondWithResult(_0x1db6d2,null))[_0xb934('0x29')](handleError(_0x1db6d2,null));};exports[_0xb934('0x1c')]=function(_0x41fb3e,_0x3203aa){return db[_0xb934('0x2c')]['find']({'where':{'id':_0x41fb3e[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x3203aa,null))[_0xb934('0x1d')](removeEntity(_0x3203aa,null))[_0xb934('0x29')](handleError(_0x3203aa,null));};exports[_0xb934('0x3c')]=function(_0xcffc90,_0x2d3265){return db['WhatsappInteraction']['describe']()[_0xb934('0x1d')](respondWithResult(_0x2d3265,null))[_0xb934('0x29')](handleError(_0x2d3265,null));};exports[_0xb934('0x3d')]=function(_0x28b3af,_0x4f9054){return db[_0xb934('0x3e')]['find']({'where':{'id':_0x28b3af[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x4f9054,null))[_0xb934('0x1d')](function(_0x2cb12d){if(_0x2cb12d){return _0x2cb12d['addMessage'](_0x28b3af[_0xb934('0x39')]['ids'],_[_0xb934('0x3f')](_0x28b3af[_0xb934('0x39')],[_0xb934('0x40'),'id'])||{});}})[_0xb934('0x1d')](respondWithResult(_0x4f9054,null))[_0xb934('0x29')](handleError(_0x4f9054,null));};exports[_0xb934('0x41')]=function(_0x567ed8,_0x4119a6){var _0xb65684={'raw':![],'where':{}};var _0x2d8070={};var _0x5f41ee={'count':0x0,'rows':[]};return db[_0xb934('0x2c')][_0xb934('0x42')]({'where':{'id':_0x567ed8[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x4119a6,null))[_0xb934('0x1d')](function(_0x470a2e){if(_0x470a2e){_0x2d8070[_0xb934('0x2b')]=_[_0xb934('0x2e')](db[_0xb934('0x3e')]['rawAttributes']);_0x2d8070[_0xb934('0x27')]=_[_0xb934('0x2e')](_0x567ed8[_0xb934('0x27')]);_0x2d8070[_0xb934('0x2f')]=_[_0xb934('0x31')](_0x2d8070['model'],_0x2d8070[_0xb934('0x27')]);_0xb65684['attributes']=_[_0xb934('0x31')](_0x2d8070['model'],qs[_0xb934('0x32')](_0x567ed8['query']['fields']));_0xb65684[_0xb934('0x30')]=_0xb65684[_0xb934('0x30')][_0xb934('0x33')]?_0xb65684[_0xb934('0x30')]:_0x2d8070[_0xb934('0x2b')];if(!_0x567ed8[_0xb934('0x27')]['hasOwnProperty']('nolimit')){_0xb65684[_0xb934('0x18')]=qs[_0xb934('0x18')](_0x567ed8['query'][_0xb934('0x18')]);_0xb65684['offset']=qs[_0xb934('0x16')](_0x567ed8[_0xb934('0x27')]['offset']);}_0xb65684['order']=qs[_0xb934('0x43')](_0x567ed8[_0xb934('0x27')][_0xb934('0x43')]);_0xb65684[_0xb934('0x44')]=qs[_0xb934('0x2f')](_[_0xb934('0x45')](_0x567ed8[_0xb934('0x27')],_0x2d8070[_0xb934('0x2f')]));_0xb65684[_0xb934('0x44')]['WhatsappInteractionId']=_0x470a2e['id'];if(_0x567ed8[_0xb934('0x27')]['filter']){_0xb65684[_0xb934('0x44')]=_[_0xb934('0x35')](_0xb65684[_0xb934('0x44')],{'$or':_['map'](_0xb65684[_0xb934('0x30')],function(_0x48ae08){var _0xcfef17={};_0xcfef17[_0x48ae08]={'$like':'%'+_0x567ed8[_0xb934('0x27')]['filter']+'%'};return _0xcfef17;})});}if(_0x567ed8['query'][_0xb934('0x46')]){var _0x509247=_0x567ed8[_0xb934('0x27')][_0xb934('0x46')]['split'](',');var _0x5ae47c={};_0x5ae47c[_0x509247[0x0]]={'$gte':moment(_0x509247[0x1])[_0xb934('0x47')](_0xb934('0x48'))};_0xb65684[_0xb934('0x44')]=_[_0xb934('0x35')](_0xb65684[_0xb934('0x44')],_0x5ae47c);}_0xb65684=_[_0xb934('0x35')]({},_0xb65684,_0x567ed8['options']);return db['WhatsappMessage']['count']({'where':_0xb65684[_0xb934('0x44')]})[_0xb934('0x1d')](function(_0x18c4d0){_0x5f41ee['count']=_0x18c4d0;if(_0x567ed8[_0xb934('0x27')][_0xb934('0x49')]){_0xb65684[_0xb934('0x34')]=[{'all':!![]}];}return db[_0xb934('0x3e')][_0xb934('0x26')](_0xb65684);})[_0xb934('0x1d')](function(_0x2ccd57){_0x5f41ee[_0xb934('0x4a')]=_0x2ccd57;return _0x5f41ee;});}})['then'](respondWithFilteredResult(_0x4119a6,_0xb65684))['catch'](handleError(_0x4119a6,null));};exports[_0xb934('0x4b')]=function(_0x571297,_0x24f179){return db[_0xb934('0x2c')]['find']({'where':{'id':_0x571297[_0xb934('0x3b')]['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x24f179,null))[_0xb934('0x1d')](function(_0x55a508){if(_0x55a508){return _0x55a508[_0xb934('0x4c')](_0x571297['body'][_0xb934('0x40')],_[_0xb934('0x3f')](_0x571297[_0xb934('0x39')],[_0xb934('0x40'),'id'])||{})[_0xb934('0x4d')](function(){return db[_0xb934('0x4e')][_0xb934('0x26')]({'attributes':['id',_0xb934('0x20'),_0xb934('0x4f')],'where':{'id':_0x571297[_0xb934('0x39')][_0xb934('0x40')]}});})[_0xb934('0x1d')](function(_0x4976c2){socket[_0xb934('0x50')](_0xb934('0x51'),{'id':Number(_0x571297['params']['id']),'tags':_0x4976c2||[]});return{'id':Number(_0x571297[_0xb934('0x3b')]['id']),'tags':_0x4976c2||[]};});}})[_0xb934('0x1d')](respondWithResult(_0x24f179,null))[_0xb934('0x29')](handleError(_0x24f179,null));};exports['removeTags']=function(_0x9cee34,_0x2584fd){return db['WhatsappInteraction'][_0xb934('0x37')]({'where':{'id':_0x9cee34['params']['id']}})[_0xb934('0x1d')](handleEntityNotFound(_0x2584fd,null))[_0xb934('0x1d')](function(_0x170f87){if(_0x170f87){return _0x170f87[_0xb934('0x52')](_0x9cee34['query'][_0xb934('0x40')]);}})['then'](respondWithStatusCode(_0x2584fd,null))['catch'](handleError(_0x2584fd,null));};exports[_0xb934('0x53')]=function(_0x25064e,_0x1feef5){var _0x3ed5e2=moment()[_0xb934('0x54')]()[_0xb934('0x55')]();var _0x17a0ad=path[_0xb934('0x56')](config[_0xb934('0x57')],_0xb934('0x58'),_0xb934('0x59'),_0xb934('0x5a'));var _0x281a14=path['join'](config[_0xb934('0x57')],_0xb934('0x58'),_0xb934('0x59'),_0xb934('0x5b'));var _0xb0eb06=path[_0xb934('0x56')](_0x17a0ad,_0x3ed5e2);var _0x154c39=util[_0xb934('0x47')](_0xb934('0x5c'),_0x25064e[_0xb934('0x3b')]['id'],_0x3ed5e2);var _0x3c11fd=path['join'](_0x17a0ad,_0x154c39);var _0x2467bc=[];_0x2467bc[_0xb934('0x5d')]({'model':db[_0xb934('0x5e')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2467bc[_0xb934('0x5d')]({'model':db['CmContact'],'as':_0xb934('0x5f'),'attributes':['id',_0xb934('0x60'),_0xb934('0x61')],'raw':!![]});if(_0x25064e[_0xb934('0x27')][_0xb934('0x5b')]){_0x2467bc[_0xb934('0x5d')]({'model':db[_0xb934('0x62')],'as':_0xb934('0x62'),'raw':!![]});}var _0x3efa21=[{'model':db['WhatsappMessage'],'as':_0xb934('0x63'),'attributes':['id',_0xb934('0x39'),_0xb934('0x64'),_0xb934('0x65'),'secret',_0xb934('0x66')],'include':_0x2467bc}];_0x3efa21[_0xb934('0x5d')]({'model':db[_0xb934('0x67')],'as':_0xb934('0x68'),'attributes':['id',_0xb934('0x20')]});_0x3efa21[_0xb934('0x5d')]({'model':db[_0xb934('0x5e')],'as':'Owner','attributes':['id','fullname']});return db[_0xb934('0x2c')][_0xb934('0x37')]({'where':{'id':_0x25064e[_0xb934('0x3b')]['id']},'include':_0x3efa21})['then'](handleEntityNotFound(_0x1feef5,null))[_0xb934('0x1d')](function(_0x346aeb){if(_0x346aeb){var _0x3c7eba=_0x346aeb[_0xb934('0x69')]({'plain':!![]});fs[_0xb934('0x6a')](_0xb0eb06);var _0x18ad00={'channel':'Whatsapp','account':_0x3c7eba[_0xb934('0x68')]['name'],'agent':_0x3c7eba[_0xb934('0x6b')]?_0x3c7eba['Owner'][_0xb934('0x6c')]:'N.A.','createdAt':moment(_0x3c7eba['createdAt'])[_0xb934('0x47')](_0xb934('0x48'))[_0xb934('0x55')](),'closedAt':_0x3c7eba[_0xb934('0x6d')]?moment(_0x3c7eba[_0xb934('0x6e')])[_0xb934('0x47')](_0xb934('0x48'))[_0xb934('0x55')]():'','disposition':_0x3c7eba['disposition'],'messages':_(_0x3c7eba[_0xb934('0x63')])['filter']({'secret':![]})['map'](function(_0x682c88){if(_0x682c88[_0xb934('0x62')]){var _0x2f99ce=path[_0xb934('0x56')](_0x281a14,_0x682c88[_0xb934('0x62')][_0xb934('0x6f')]);if(fs[_0xb934('0x70')](_0x2f99ce)){fs[_0xb934('0x71')](_0x2f99ce)[_0xb934('0x72')](fs[_0xb934('0x73')](path[_0xb934('0x56')](_0xb0eb06,_0x682c88[_0xb934('0x62')][_0xb934('0x6f')])));}}return{'date':moment(_0x682c88[_0xb934('0x64')])[_0xb934('0x47')](_0xb934('0x48'))['toString'](),'sender':_0x682c88[_0xb934('0x65')]===_0xb934('0x74')?_0x682c88['User']?_0x682c88[_0xb934('0x5e')][_0xb934('0x6c')]:_0xb934('0x75'):_0x682c88['Contact'][_0xb934('0x60')]+(_0x682c88['Contact']['lastName']?'\x20'+_0x682c88[_0xb934('0x5f')]['lastName']:''),'body':_0x682c88[_0xb934('0x62')]?_0x682c88[_0xb934('0x62')][_0xb934('0x6f')]:_0x682c88[_0xb934('0x39')],'direction':_0x682c88[_0xb934('0x65')]===_0xb934('0x74')?'A':'C','secret':_0x682c88[_0xb934('0x76')],'read':_0x682c88[_0xb934('0x66')],'attachment':_0x682c88[_0xb934('0x62')]};})[_0xb934('0x77')]()};return ejs[_0xb934('0x78')](path[_0xb934('0x56')](config[_0xb934('0x57')],_0xb934('0x58'),_0xb934('0x79'),_0xb934('0x7a')),{'interaction':_0x18ad00})[_0xb934('0x1d')](function(_0x251d4e){var _0x355610=path[_0xb934('0x56')](_0xb0eb06,'transcript-'+_0x3c7eba['id']+'-'+_0x3ed5e2+'.pdf');var _0x195fa5={'path':_0x355610,'channel':_0xb934('0x7b'),'interactionId':_0x3c7eba['id']};return pdf[_0xb934('0x7c')](_0x251d4e,_0x195fa5);})[_0xb934('0x1d')](function(){return new BPromise(function(_0x2a622d,_0x519545){zipdir(_0xb0eb06,{'saveTo':_0x3c11fd},function(_0x40cede,_0x622182){if(_0x40cede)return _0x519545(_0x40cede);return _0x2a622d(_0x622182);});})[_0xb934('0x1d')](function(){return new BPromise(function(_0x382072,_0x36b155){rimraf(_0xb0eb06,function(_0x50bb81){if(_0x50bb81)_0x36b155(_0x50bb81);return _0x382072();});});})[_0xb934('0x1d')](function(){return _0x1feef5[_0xb934('0x53')](_0x3c11fd,_0x154c39,function(_0x337fe4){if(_0x337fe4){console[_0xb934('0x7d')](_0xb934('0x7e'),_0x337fe4);}else{fs['unlinkSync'](_0x3c11fd);}});});});}else{return _0x1feef5[_0xb934('0x12')](0xc8);}})[_0xb934('0x29')](handleError(_0x1feef5,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 1cc4ba6..aff353e 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 _0x41bb=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','setDataValue','Users','findAll','then','unreadMessages'];(function(_0x5f4d29,_0x57d339){var _0x1dbaf5=function(_0xa9b6c){while(--_0xa9b6c){_0x5f4d29['push'](_0x5f4d29['shift']());}};_0x1dbaf5(++_0x57d339);}(_0x41bb,0xc5));var _0xb41b=function(_0x59470f,_0x1a649b){_0x59470f=_0x59470f-0x0;var _0x47e0e0=_0x41bb[_0x59470f];return _0x47e0e0;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var WhatsappInteraction=require(_0xb41b('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xb41b('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':_0xb41b('0x3'),'afterUpdate':_0xb41b('0x4'),'afterDestroy':_0xb41b('0x5')};function emitEvent(_0x4ee21b){return function(_0x12cea3,_0x2c9f9e,_0x2dbaa3){_0x12cea3['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x497242){_0x12cea3[_0xb41b('0x6')](_0xb41b('0x7'),_0x497242['map'](function(_0x13d44e){return{'id':_0x13d44e['id']};}));return WhatsappMessage[_0xb41b('0x8')]({'where':{'WhatsappInteractionId':_0x12cea3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb41b('0x9')](function(_0xa2aa66){_0x12cea3[_0xb41b('0x6')](_0xb41b('0xa'),_0xa2aa66[_0xb41b('0xb')]);WhatsappInteractionEvents['emit'](_0x4ee21b+':'+_0x12cea3['id'],_0x12cea3);WhatsappInteractionEvents[_0xb41b('0xc')](_0x4ee21b,_0x12cea3);_0x2dbaa3(null);})['catch'](_0x2dbaa3(null));};}for(var e in events){if(events[_0xb41b('0xd')](e)){var event=events[e];WhatsappInteraction[_0xb41b('0xe')](e,emitEvent(event));}}module[_0xb41b('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x823c=['hook','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','getUsers','setDataValue','findAll','emit','catch','hasOwnProperty'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x823c,0x143));var _0xc823=function(_0x3d2405,_0x1e397f){_0x3d2405=_0x3d2405-0x0;var _0x5ddd8d=_0x823c[_0x3d2405];return _0x5ddd8d;};'use strict';var EventEmitter=require(_0xc823('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xc823('0x1')];var WhatsappMessage=require(_0xc823('0x2'))['db'][_0xc823('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc823('0x4')](0x0);var events={'afterCreate':_0xc823('0x5'),'afterUpdate':_0xc823('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3309cc){return function(_0x35dedf,_0x122228,_0x42e0c0){_0x35dedf[_0xc823('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xba407e){_0x35dedf[_0xc823('0x8')]('Users',_0xba407e['map'](function(_0x4478fc){return{'id':_0x4478fc['id']};}));return WhatsappMessage[_0xc823('0x9')]({'where':{'WhatsappInteractionId':_0x35dedf['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43bbd8){_0x35dedf[_0xc823('0x8')]('unreadMessages',_0x43bbd8['length']);WhatsappInteractionEvents[_0xc823('0xa')](_0x3309cc+':'+_0x35dedf['id'],_0x35dedf);WhatsappInteractionEvents[_0xc823('0xa')](_0x3309cc,_0x35dedf);_0x42e0c0(null);})[_0xc823('0xb')](_0x42e0c0(null));};}for(var e in events){if(events[_0xc823('0xc')](e)){var event=events[e];WhatsappInteraction[_0xc823('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 22cf3af..d1059c1 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 _0x64eb=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment'];(function(_0x4faf9a,_0x3af773){var _0x30780e=function(_0x520669){while(--_0x520669){_0x4faf9a['push'](_0x4faf9a['shift']());}};_0x30780e(++_0x3af773);}(_0x64eb,0x109));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb64e('0x0'));var util=require(_0xb64e('0x1'));var logger=require(_0xb64e('0x2'))(_0xb64e('0x3'));var moment=require(_0xb64e('0x4'));var BPromise=require(_0xb64e('0x5'));var rp=require(_0xb64e('0x6'));var fs=require('fs');var path=require(_0xb64e('0x7'));var rimraf=require(_0xb64e('0x8'));var config=require(_0xb64e('0x9'));var attributes=require(_0xb64e('0xa'));module[_0xb64e('0xb')]=function(_0x178dff,_0x496b53){return _0x178dff[_0xb64e('0xc')](_0xb64e('0xd'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1db4dd,_0x91bc34,_0x3b0b03){if(_0x1db4dd[_0xb64e('0xe')](_0xb64e('0xf'))){_0x1db4dd[_0xb64e('0x10')]=moment()[_0xb64e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3b0b03(null,_0x1db4dd);}}});}; \ No newline at end of file +var _0xaa23=['./whatsappInteraction.attributes','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xaa23,0x158));var _0x3aa2=function(_0x2bc09e,_0x1ae747){_0x2bc09e=_0x2bc09e-0x0;var _0x3f7c75=_0xaa23[_0x2bc09e];return _0x3f7c75;};'use strict';var _=require(_0x3aa2('0x0'));var util=require(_0x3aa2('0x1'));var logger=require(_0x3aa2('0x2'))(_0x3aa2('0x3'));var moment=require(_0x3aa2('0x4'));var BPromise=require(_0x3aa2('0x5'));var rp=require(_0x3aa2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa2('0x7'));var config=require('../../config/environment');var attributes=require(_0x3aa2('0x8'));module[_0x3aa2('0x9')]=function(_0x349da4,_0x36e8e1){return _0x349da4[_0x3aa2('0xa')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd5053b,_0x3a09d3,_0x53934b){if(_0xd5053b[_0x3aa2('0xb')](_0x3aa2('0xc'))){_0xd5053b[_0x3aa2('0xd')]=moment()[_0x3aa2('0xe')](_0x3aa2('0xf'));}_0x53934b(null,_0xd5053b);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ea574ff..474b1de 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 _0xc4c1=['AddTags','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','attributes','limit','debug','find','addTags','body','omit','ids','spread'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc4c1,0x1b9));var _0x1c4c=function(_0x4f9644,_0x2c1768){_0x4f9644=_0x4f9644-0x0;var _0x152048=_0xc4c1[_0x4f9644];return _0x152048;};'use strict';var _=require(_0x1c4c('0x0'));var util=require('util');var moment=require(_0x1c4c('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c4c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1c4c('0x3'));var logger=require(_0x1c4c('0x4'))('rpc');var config=require(_0x1c4c('0x5'));var jayson=require(_0x1c4c('0x6'));var client=jayson[_0x1c4c('0x7')][_0x1c4c('0x8')]({'port':0x232a});config[_0x1c4c('0x9')]=_['defaults'](config[_0x1c4c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c4c('0xa'))(new Redis(config['redis']));require(_0x1c4c('0xb'))[_0x1c4c('0xc')](socket);function respondWithRpcPromise(_0x5041cd,_0x159711,_0x3d0754){return new BPromise(function(_0x1d5e09,_0x16c946){return client[_0x1c4c('0xd')](_0x5041cd,_0x3d0754)[_0x1c4c('0xe')](function(_0x252d27){logger[_0x1c4c('0xf')](_0x1c4c('0x10'),_0x159711,_0x1c4c('0x11'));logger['debug'](_0x1c4c('0x12'),_0x159711,_0x1c4c('0x11'),JSON[_0x1c4c('0x13')](_0x252d27));if(_0x252d27[_0x1c4c('0x14')]){if(_0x252d27[_0x1c4c('0x14')][_0x1c4c('0x15')]===0x1f4){logger[_0x1c4c('0x14')](_0x1c4c('0x10'),_0x159711,_0x252d27[_0x1c4c('0x14')]['message']);return _0x16c946(_0x252d27['error'][_0x1c4c('0x16')]);}logger[_0x1c4c('0x14')](_0x1c4c('0x10'),_0x159711,_0x252d27[_0x1c4c('0x14')]['message']);return _0x1d5e09(_0x252d27[_0x1c4c('0x14')][_0x1c4c('0x16')]);}else{logger[_0x1c4c('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x159711,_0x1c4c('0x11'));_0x1d5e09(_0x252d27[_0x1c4c('0x17')]['message']);}})[_0x1c4c('0x18')](function(_0x55a455){logger['error'](_0x1c4c('0x10'),_0x159711,_0x55a455);_0x16c946(_0x55a455);});});}exports[_0x1c4c('0x19')]=function(_0x35fbb3){var _0x588ddf=this;return new Promise(function(_0x49b974,_0x1d3c4a){return db[_0x1c4c('0x1a')]['update'](_0x35fbb3['body'],{'raw':_0x35fbb3[_0x1c4c('0x1b')]?_0x35fbb3['options'][_0x1c4c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35fbb3['options']?_0x35fbb3['options'][_0x1c4c('0x1d')]||null:null,'attributes':_0x35fbb3[_0x1c4c('0x1b')]?_0x35fbb3['options'][_0x1c4c('0x1e')]||null:null,'limit':_0x35fbb3['options']?_0x35fbb3[_0x1c4c('0x1b')][_0x1c4c('0x1f')]||null:null})[_0x1c4c('0xe')](function(_0x4d90e3){logger[_0x1c4c('0xf')]('UpdateWhatsappInteraction',_0x35fbb3);logger[_0x1c4c('0x20')](_0x1c4c('0x19'),_0x35fbb3,JSON[_0x1c4c('0x13')](_0x4d90e3));_0x49b974(_0x4d90e3);})['catch'](function(_0x1008bd){logger[_0x1c4c('0x14')](_0x1c4c('0x19'),_0x1008bd[_0x1c4c('0x16')],_0x35fbb3);_0x1d3c4a(_0x588ddf[_0x1c4c('0x14')](0x1f4,_0x1008bd[_0x1c4c('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x378a89){return new Promise(function(_0x424333,_0x322568){return db[_0x1c4c('0x1a')][_0x1c4c('0x21')]({'where':_0x378a89[_0x1c4c('0x1b')]?_0x378a89[_0x1c4c('0x1b')][_0x1c4c('0x1d')]||null:null})[_0x1c4c('0xe')](function(_0x5eeed3){if(_0x5eeed3){return _0x5eeed3[_0x1c4c('0x22')](_0x378a89[_0x1c4c('0x23')]['ids'],_[_0x1c4c('0x24')](_0x378a89[_0x1c4c('0x23')],[_0x1c4c('0x25'),'id'])||{});}})[_0x1c4c('0x26')](function(_0x287759){logger['info'](_0x1c4c('0x27'),_0x378a89);logger[_0x1c4c('0x20')](_0x1c4c('0x27'),_0x378a89,JSON[_0x1c4c('0x13')](_0x287759));_0x424333(_0x287759);})[_0x1c4c('0x18')](function(_0x1f5ef8){logger[_0x1c4c('0x14')](_0x1c4c('0x27'),_0x1f5ef8[_0x1c4c('0x16')],_0x378a89);_0x322568(_this[_0x1c4c('0x14')](0x1f4,_0x1f5ef8[_0x1c4c('0x16')]));});});}; \ No newline at end of file +var _0x0368=['catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4c15ee,_0x7d6508){var _0x57327b=function(_0x5845a9){while(--_0x5845a9){_0x4c15ee['push'](_0x4c15ee['shift']());}};_0x57327b(++_0x7d6508);}(_0x0368,0xdc));var _0x8036=function(_0x56f935,_0xbb3e13){_0x56f935=_0x56f935-0x0;var _0x25ff2f=_0x0368[_0x56f935];return _0x25ff2f;};'use strict';var _=require(_0x8036('0x0'));var util=require(_0x8036('0x1'));var moment=require(_0x8036('0x2'));var BPromise=require(_0x8036('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8036('0x4'));var db=require(_0x8036('0x5'))['db'];var utils=require(_0x8036('0x6'));var logger=require(_0x8036('0x7'))(_0x8036('0x8'));var config=require(_0x8036('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8036('0xa')]({'port':0x232a});config[_0x8036('0xb')]=_[_0x8036('0xc')](config[_0x8036('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8036('0xd'))[_0x8036('0xe')](socket);function respondWithRpcPromise(_0x36bb94,_0xdd7ae5,_0x2015e1){return new BPromise(function(_0x122fad,_0x523635){return client[_0x8036('0xf')](_0x36bb94,_0x2015e1)[_0x8036('0x10')](function(_0x3052c2){logger[_0x8036('0x11')](_0x8036('0x12'),_0xdd7ae5,_0x8036('0x13'));logger[_0x8036('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xdd7ae5,'request\x20sent',JSON[_0x8036('0x15')](_0x3052c2));if(_0x3052c2[_0x8036('0x16')]){if(_0x3052c2[_0x8036('0x16')][_0x8036('0x17')]===0x1f4){logger[_0x8036('0x16')](_0x8036('0x12'),_0xdd7ae5,_0x3052c2[_0x8036('0x16')][_0x8036('0x18')]);return _0x523635(_0x3052c2['error'][_0x8036('0x18')]);}logger['error'](_0x8036('0x12'),_0xdd7ae5,_0x3052c2[_0x8036('0x16')]['message']);return _0x122fad(_0x3052c2[_0x8036('0x16')][_0x8036('0x18')]);}else{logger[_0x8036('0x11')](_0x8036('0x12'),_0xdd7ae5,'request\x20sent');_0x122fad(_0x3052c2[_0x8036('0x19')]['message']);}})[_0x8036('0x1a')](function(_0x1332d3){logger[_0x8036('0x16')](_0x8036('0x12'),_0xdd7ae5,_0x1332d3);_0x523635(_0x1332d3);});});}exports[_0x8036('0x1b')]=function(_0x36d38b){var _0x5e982d=this;return new Promise(function(_0x281e18,_0x31e063){return db[_0x8036('0x1c')][_0x8036('0x1d')](_0x36d38b[_0x8036('0x1e')],{'raw':_0x36d38b[_0x8036('0x1f')]?_0x36d38b['options'][_0x8036('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36d38b['options']?_0x36d38b[_0x8036('0x1f')][_0x8036('0x21')]||null:null,'attributes':_0x36d38b[_0x8036('0x1f')]?_0x36d38b[_0x8036('0x1f')][_0x8036('0x22')]||null:null,'limit':_0x36d38b[_0x8036('0x1f')]?_0x36d38b[_0x8036('0x1f')][_0x8036('0x23')]||null:null})[_0x8036('0x10')](function(_0x40e5d9){logger['info']('UpdateWhatsappInteraction',_0x36d38b);logger[_0x8036('0x14')](_0x8036('0x1b'),_0x36d38b,JSON[_0x8036('0x15')](_0x40e5d9));_0x281e18(_0x40e5d9);})[_0x8036('0x1a')](function(_0x1c579e){logger[_0x8036('0x16')](_0x8036('0x1b'),_0x1c579e[_0x8036('0x18')],_0x36d38b);_0x31e063(_0x5e982d['error'](0x1f4,_0x1c579e[_0x8036('0x18')]));});});};exports[_0x8036('0x24')]=function(_0x5e3879){return new Promise(function(_0x54035d,_0x10bdb6){return db[_0x8036('0x1c')][_0x8036('0x25')]({'where':_0x5e3879[_0x8036('0x1f')]?_0x5e3879[_0x8036('0x1f')][_0x8036('0x21')]||null:null})[_0x8036('0x10')](function(_0xcf6e21){if(_0xcf6e21){return _0xcf6e21['addTags'](_0x5e3879[_0x8036('0x1e')]['ids'],_[_0x8036('0x26')](_0x5e3879['body'],['ids','id'])||{});}})[_0x8036('0x27')](function(_0x484b2c){logger['info'](_0x8036('0x28'),_0x5e3879);logger[_0x8036('0x14')](_0x8036('0x28'),_0x5e3879,JSON[_0x8036('0x15')](_0x484b2c));_0x54035d(_0x484b2c);})[_0x8036('0x1a')](function(_0x421720){logger[_0x8036('0x16')](_0x8036('0x28'),_0x421720['message'],_0x5e3879);_0x10bdb6(_this[_0x8036('0x16')](0x1f4,_0x421720[_0x8036('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 657779a..6b8f651 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 _0x285e=['removeListener','register','length','./whatsappInteraction.events','save','update','emit'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x285e,0x130));var _0xe285=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x285e[_0x55821d];return _0x58ea8a;};'use strict';var WhatsappInteractionEvents=require(_0xe285('0x0'));var events=[_0xe285('0x1'),'remove',_0xe285('0x2')];function createListener(_0x97a37f,_0x24e9d3){return function(_0x44c842){_0x24e9d3[_0xe285('0x3')](_0x97a37f,_0x44c842);};}function removeListener(_0x2fd7da,_0x1ed95f){return function(){WhatsappInteractionEvents[_0xe285('0x4')](_0x2fd7da,_0x1ed95f);};}exports[_0xe285('0x5')]=function(_0x2a25ac){for(var _0x3fe725=0x0,_0x3af8b4=events[_0xe285('0x6')];_0x3fe725<_0x3af8b4;_0x3fe725++){var _0x449290=events[_0x3fe725];var _0x4a2af0=createListener('whatsappInteraction:'+_0x449290,_0x2a25ac);WhatsappInteractionEvents['on'](_0x449290,_0x4a2af0);}}; \ No newline at end of file +var _0x315d=['remove','removeListener','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x315d,0x13f));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require(_0xd315('0x0'));var events=['save',_0xd315('0x1'),'update'];function createListener(_0x19e3fb,_0x41b033){return function(_0x18d144){_0x41b033['emit'](_0x19e3fb,_0x18d144);};}function removeListener(_0x5e6a1a,_0x1da5fd){return function(){WhatsappInteractionEvents[_0xd315('0x2')](_0x5e6a1a,_0x1da5fd);};}exports[_0xd315('0x3')]=function(_0x229c12){for(var _0x55a62=0x0,_0x389cb2=events['length'];_0x55a62<_0x389cb2;_0x55a62++){var _0xe86b73=events[_0x55a62];var _0x5054bc=createListener(_0xd315('0x4')+_0xe86b73,_0x229c12);WhatsappInteractionEvents['on'](_0xe86b73,_0x5054bc);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 2d1a059..a19d0f0 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 _0x73aa=['path','express','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','get','show','post','whatsapp','create','status','put','/:id/accept','/:id/reject','delete','destroy','exports','multer','util'];(function(_0x1892f9,_0x2cb4ab){var _0x5a765f=function(_0x258a23){while(--_0x258a23){_0x1892f9['push'](_0x1892f9['shift']());}};_0x5a765f(++_0x2cb4ab);}(_0x73aa,0x1b3));var _0xa73a=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x73aa[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0xa73a('0x0'));var util=require(_0xa73a('0x1'));var path=require(_0xa73a('0x2'));var timeout=require('connect-timeout');var express=require(_0xa73a('0x3'));var router=express[_0xa73a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa73a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa73a('0x6'));var controller=require(_0xa73a('0x7'));router['get']('/',auth[_0xa73a('0x8')](),controller[_0xa73a('0x9')]);router['get'](_0xa73a('0xa'),auth[_0xa73a('0x8')](),controller['describe']);router[_0xa73a('0xb')]('/:id',auth[_0xa73a('0x8')](),controller[_0xa73a('0xc')]);router[_0xa73a('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xa73a('0xe'),'whatsappmessage:create'),controller[_0xa73a('0xf')]);router['post']('/:id/status',controller[_0xa73a('0x10')]);router[_0xa73a('0x11')]('/:id',auth[_0xa73a('0x8')](),controller['update']);router[_0xa73a('0x11')](_0xa73a('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0xa73a('0x11')](_0xa73a('0x13'),auth[_0xa73a('0x8')](),controller['reject']);router[_0xa73a('0x14')]('/:id',auth[_0xa73a('0x8')](),controller[_0xa73a('0x15')]);module[_0xa73a('0x16')]=router; \ No newline at end of file +var _0x68b8=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','multer'];(function(_0x5d83f5,_0x11a1d5){var _0x3dc53d=function(_0x49369d){while(--_0x49369d){_0x5d83f5['push'](_0x5d83f5['shift']());}};_0x3dc53d(++_0x11a1d5);}(_0x68b8,0x1ca));var _0x868b=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0x68b8[_0x580d0e];return _0xb51111;};'use strict';var multer=require(_0x868b('0x0'));var util=require(_0x868b('0x1'));var path=require('path');var timeout=require(_0x868b('0x2'));var express=require(_0x868b('0x3'));var router=express[_0x868b('0x4')]();var fs_extra=require(_0x868b('0x5'));var auth=require(_0x868b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x868b('0x7'));var controller=require(_0x868b('0x8'));router[_0x868b('0x9')]('/',auth[_0x868b('0xa')](),controller['index']);router[_0x868b('0x9')]('/describe',auth[_0x868b('0xa')](),controller[_0x868b('0xb')]);router[_0x868b('0x9')]('/:id',auth[_0x868b('0xa')](),controller[_0x868b('0xc')]);router[_0x868b('0xd')]('/',auth[_0x868b('0xa')](),interaction[_0x868b('0xe')](_0x868b('0xf'),_0x868b('0x10')),controller[_0x868b('0x11')]);router['post'](_0x868b('0x12'),controller[_0x868b('0x13')]);router[_0x868b('0x14')](_0x868b('0x15'),auth[_0x868b('0xa')](),controller[_0x868b('0x16')]);router['put'](_0x868b('0x17'),auth['isAuthenticated'](),controller[_0x868b('0x18')]);router[_0x868b('0x14')](_0x868b('0x19'),auth[_0x868b('0xa')](),controller[_0x868b('0x1a')]);router['delete'](_0x868b('0x15'),auth[_0x868b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 4fcf3da..5d25261 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 _0xfa24=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x5eed78,_0xeb54d8){var _0x4bf61b=function(_0x401f1a){while(--_0x401f1a){_0x5eed78['push'](_0x5eed78['shift']());}};_0x4bf61b(++_0xeb54d8);}(_0xfa24,0x17c));var _0x4fa2=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xfa24[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0x4fa2('0x0'));module[_0x4fa2('0x1')]={'body':{'type':Sequelize[_0x4fa2('0x2')](_0x4fa2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4fa2('0x4')]('in',_0x4fa2('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x4fa2('0x6')]},'readAt':{'type':Sequelize[_0x4fa2('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4fa2('0x6')]},'providerResponse':{'type':Sequelize[_0x4fa2('0x2')]}}; \ No newline at end of file +var _0xf87a=['medium','out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xf87a,0xf6));var _0xaf87=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf87a[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xaf87('0x0'));module[_0xaf87('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaf87('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaf87('0x3')),'defaultValue':_0xaf87('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaf87('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xaf87('0x5')]},'secret':{'type':Sequelize[_0xaf87('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaf87('0x4')]},'providerResponse':{'type':Sequelize[_0xaf87('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 2bbad8a..474b5b4 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 _0x086d=['pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','WhatsappInteraction','isNil','read1stAt','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','WhatsappInteractionId','info','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','rejectMessage','ContactId','SELECT','contact','User','fullname','email','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x50ee83,_0x2ca3bc){var _0x30a4f1=function(_0x3b7d0c){while(--_0x3b7d0c){_0x50ee83['push'](_0x50ee83['shift']());}};_0x30a4f1(++_0x2ca3bc);}(_0x086d,0x1eb));var _0xd086=function(_0x3df5a0,_0x3044e0){_0x3df5a0=_0x3df5a0-0x0;var _0x3e8363=_0x086d[_0x3df5a0];return _0x3e8363;};'use strict';var emlformat=require(_0xd086('0x0'));var rimraf=require(_0xd086('0x1'));var zipdir=require(_0xd086('0x2'));var jsonpatch=require(_0xd086('0x3'));var rp=require(_0xd086('0x4'));var moment=require(_0xd086('0x5'));var BPromise=require(_0xd086('0x6'));var Mustache=require(_0xd086('0x7'));var util=require(_0xd086('0x8'));var path=require('path');var sox=require(_0xd086('0x9'));var csv=require(_0xd086('0xa'));var ejs=require(_0xd086('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd086('0xc'));var squel=require(_0xd086('0xd'));var crypto=require('crypto');var jsforce=require(_0xd086('0xe'));var deskjs=require(_0xd086('0xf'));var toCsv=require(_0xd086('0xa'));var querystring=require(_0xd086('0x10'));var Papa=require('papaparse');var Redis=require(_0xd086('0x11'));var authService=require(_0xd086('0x12'));var qs=require(_0xd086('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd086('0x14'))(_0xd086('0x15'));var utils=require(_0xd086('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd086('0x17'));var db=require(_0xd086('0x18'))['db'];config[_0xd086('0x19')]=_['defaults'](config[_0xd086('0x19')],{'host':_0xd086('0x1a'),'port':0x18eb});var socket=require(_0xd086('0x1b'))(new Redis(config[_0xd086('0x19')]));require('./whatsappMessage.socket')[_0xd086('0x1c')](socket);var jayson=require(_0xd086('0x1d'));var client=jayson[_0xd086('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xd086('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1ff780,_0x2455c3,_0x42d689,_0x1393a1){return new BPromise(function(_0x407ccb,_0x4b2a12){var _0x10ca0c=_0x1393a1||client;return _0x10ca0c[_0xd086('0x20')](_0x1ff780,_0x42d689)[_0xd086('0x21')](function(_0x2aa3a9){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x2455c3,_0xd086('0x22'));logger['debug'](_0xd086('0x23'),_0x2455c3,'request\x20sent',JSON[_0xd086('0x24')](_0x2aa3a9));if(_0x2aa3a9[_0xd086('0x25')]){if(_0x2aa3a9['error'][_0xd086('0x26')]===0x1f4){logger[_0xd086('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2455c3,_0x2aa3a9[_0xd086('0x25')]['message']);return _0x4b2a12(_0x2aa3a9[_0xd086('0x25')][_0xd086('0x27')]);}logger[_0xd086('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2455c3,_0x2aa3a9[_0xd086('0x25')][_0xd086('0x27')]);return _0x407ccb(_0x2aa3a9[_0xd086('0x25')][_0xd086('0x27')]);}else{logger['info'](_0xd086('0x28'),_0x2455c3,_0xd086('0x22'));_0x407ccb(_0x2aa3a9[_0xd086('0x29')][_0xd086('0x27')]);}})[_0xd086('0x2a')](function(_0x101ab4){logger[_0xd086('0x25')](_0xd086('0x28'),_0x2455c3,_0x101ab4);_0x4b2a12(_0x101ab4);});});}function respondWithStatusCode(_0x47f2d3,_0x3e0319){_0x3e0319=_0x3e0319||0xcc;return function(_0x48569f){if(_0x48569f){return _0x47f2d3[_0xd086('0x2b')](_0x3e0319);}return _0x47f2d3[_0xd086('0x2c')](_0x3e0319)[_0xd086('0x2d')]();};}function respondWithResult(_0x15ff0e,_0x2ddd0c){_0x2ddd0c=_0x2ddd0c||0xc8;return function(_0x4e47c8){if(_0x4e47c8){return _0x15ff0e['status'](_0x2ddd0c)[_0xd086('0x2e')](_0x4e47c8);}};}function respondWithFilteredResult(_0x63c93b,_0x37b483){return function(_0x54c4c5){if(_0x54c4c5){var _0x8062fc=typeof _0x37b483['offset']===_0xd086('0x2f')&&typeof _0x37b483[_0xd086('0x30')]===_0xd086('0x2f');var _0x5a8003=_0x54c4c5['count'];var _0x31dd6c=_0x8062fc?0x0:_0x37b483[_0xd086('0x31')];var _0x30f267=_0x8062fc?_0x54c4c5[_0xd086('0x32')]:_0x37b483['offset']+_0x37b483[_0xd086('0x30')];var _0x7c0bb4;if(_0x30f267>=_0x5a8003){_0x30f267=_0x5a8003;_0x7c0bb4=0xc8;}else{_0x7c0bb4=0xce;}_0x63c93b[_0xd086('0x2c')](_0x7c0bb4);return _0x63c93b[_0xd086('0x33')]('Content-Range',_0x31dd6c+'-'+_0x30f267+'/'+_0x5a8003)[_0xd086('0x2e')](_0x54c4c5);}return null;};}function patchUpdates(_0x3ac5d0){return function(_0x4e1213){try{jsonpatch[_0xd086('0x34')](_0x4e1213,_0x3ac5d0,!![]);}catch(_0x114c03){return BPromise[_0xd086('0x35')](_0x114c03);}return _0x4e1213[_0xd086('0x36')]();};}function saveUpdates(_0x30207b,_0x443ec3){return function(_0x1c3d31){if(_0x1c3d31){return _0x1c3d31['update'](_0x30207b)[_0xd086('0x21')](function(_0x30bef1){return _0x30bef1;});}return null;};}function removeEntity(_0x1f9724,_0x1355a6){return function(_0x479217){if(_0x479217){return _0x479217[_0xd086('0x37')]()[_0xd086('0x21')](function(){_0x1f9724[_0xd086('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad52e,_0x254a59){return function(_0x2f0557){if(!_0x2f0557){_0x2ad52e[_0xd086('0x2b')](0x194);}return _0x2f0557;};}function handleError(_0x4526a5,_0x44ba08){_0x44ba08=_0x44ba08||0x1f4;return function(_0x2bdf89){logger[_0xd086('0x25')](_0x2bdf89[_0xd086('0x38')]);if(_0x2bdf89[_0xd086('0x39')]){delete _0x2bdf89[_0xd086('0x39')];}_0x4526a5['status'](_0x44ba08)[_0xd086('0x3a')](_0x2bdf89);};}exports[_0xd086('0x3b')]=function(_0x9837df,_0x3e2b0a){var _0x1e4034={},_0x1baa5d={},_0x5cbeb8={'count':0x0,'rows':[]};var _0x2bec82=_['map'](db[_0xd086('0x3c')][_0xd086('0x3d')],function(_0x5bc28a){return{'name':_0x5bc28a['fieldName'],'type':_0x5bc28a['type']['key']};});_0x1baa5d['model']=_['map'](_0x2bec82,'name');_0x1baa5d[_0xd086('0x3e')]=_[_0xd086('0x3f')](_0x9837df[_0xd086('0x3e')]);_0x1baa5d[_0xd086('0x40')]=_[_0xd086('0x41')](_0x1baa5d['model'],_0x1baa5d[_0xd086('0x3e')]);_0x1e4034['attributes']=_[_0xd086('0x41')](_0x1baa5d[_0xd086('0x42')],qs[_0xd086('0x43')](_0x9837df[_0xd086('0x3e')]['fields']));_0x1e4034[_0xd086('0x44')]=_0x1e4034[_0xd086('0x44')]['length']?_0x1e4034[_0xd086('0x44')]:_0x1baa5d['model'];if(!_0x9837df[_0xd086('0x3e')][_0xd086('0x45')](_0xd086('0x46'))){_0x1e4034['limit']=qs[_0xd086('0x30')](_0x9837df[_0xd086('0x3e')][_0xd086('0x30')]);_0x1e4034[_0xd086('0x31')]=qs[_0xd086('0x31')](_0x9837df['query']['offset']);}_0x1e4034[_0xd086('0x47')]=qs[_0xd086('0x48')](_0x9837df['query']['sort']);_0x1e4034['where']=qs[_0xd086('0x40')](_[_0xd086('0x49')](_0x9837df[_0xd086('0x3e')],_0x1baa5d['filters']),_0x2bec82);if(_0x9837df[_0xd086('0x3e')]['filter']){_0x1e4034[_0xd086('0x4a')]=_[_0xd086('0x4b')](_0x1e4034['where'],{'$or':_['map'](_0x2bec82,function(_0x1290e8){if(_0x1290e8[_0xd086('0x4c')]!==_0xd086('0x4d')){var _0x1a34d0={};_0x1a34d0[_0x1290e8[_0xd086('0x39')]]={'$like':'%'+_0x9837df[_0xd086('0x3e')][_0xd086('0x4e')]+'%'};return _0x1a34d0;}})});}_0x1e4034=_[_0xd086('0x4b')]({},_0x1e4034,_0x9837df['options']);var _0x4292d2={'where':_0x1e4034[_0xd086('0x4a')]};return db[_0xd086('0x3c')][_0xd086('0x32')](_0x4292d2)[_0xd086('0x21')](function(_0x3a243d){_0x5cbeb8[_0xd086('0x32')]=_0x3a243d;if(_0x9837df[_0xd086('0x3e')][_0xd086('0x4f')]){_0x1e4034[_0xd086('0x50')]=[{'all':!![]}];}return db[_0xd086('0x3c')][_0xd086('0x51')](_0x1e4034);})['then'](function(_0x57c1c1){_0x5cbeb8[_0xd086('0x52')]=_0x57c1c1;return _0x5cbeb8;})[_0xd086('0x21')](respondWithFilteredResult(_0x3e2b0a,_0x1e4034))[_0xd086('0x2a')](handleError(_0x3e2b0a,null));};exports[_0xd086('0x53')]=function(_0x53cd9a,_0x279f7c){var _0x4f65eb={'raw':!![],'where':{'id':_0x53cd9a[_0xd086('0x54')]['id']}},_0x2569fd={};_0x2569fd[_0xd086('0x42')]=_[_0xd086('0x3f')](db[_0xd086('0x3c')][_0xd086('0x3d')]);_0x2569fd['query']=_[_0xd086('0x3f')](_0x53cd9a[_0xd086('0x3e')]);_0x2569fd['filters']=_[_0xd086('0x41')](_0x2569fd[_0xd086('0x42')],_0x2569fd[_0xd086('0x3e')]);_0x4f65eb[_0xd086('0x44')]=_[_0xd086('0x41')](_0x2569fd[_0xd086('0x42')],qs[_0xd086('0x43')](_0x53cd9a[_0xd086('0x3e')][_0xd086('0x43')]));_0x4f65eb[_0xd086('0x44')]=_0x4f65eb[_0xd086('0x44')][_0xd086('0x55')]?_0x4f65eb['attributes']:_0x2569fd[_0xd086('0x42')];if(_0x53cd9a[_0xd086('0x3e')][_0xd086('0x4f')]){_0x4f65eb[_0xd086('0x50')]=[{'all':!![]}];}_0x4f65eb=_['merge']({},_0x4f65eb,_0x53cd9a['options']);return db[_0xd086('0x3c')][_0xd086('0x56')](_0x4f65eb)['then'](handleEntityNotFound(_0x279f7c,null))[_0xd086('0x21')](respondWithResult(_0x279f7c,null))[_0xd086('0x2a')](handleError(_0x279f7c,null));};exports[_0xd086('0x57')]=function(_0x2dbdcf,_0x975676){return db['WhatsappMessage'][_0xd086('0x57')](_0x2dbdcf[_0xd086('0x58')],{})['then'](respondWithResult(_0x975676,0xc9))[_0xd086('0x2a')](handleError(_0x975676,null));};exports[_0xd086('0x59')]=function(_0x2b9a28,_0x4a52ce){if(_0x2b9a28['body']['id']){delete _0x2b9a28[_0xd086('0x58')]['id'];}return db[_0xd086('0x3c')]['find']({'where':{'id':_0x2b9a28[_0xd086('0x54')]['id']}})[_0xd086('0x21')](handleEntityNotFound(_0x4a52ce,null))['then'](saveUpdates(_0x2b9a28[_0xd086('0x58')],null))[_0xd086('0x21')](respondWithResult(_0x4a52ce,null))[_0xd086('0x2a')](handleError(_0x4a52ce,null));};exports['destroy']=function(_0x4f6e49,_0x5f12e7){return db[_0xd086('0x3c')][_0xd086('0x56')]({'where':{'id':_0x4f6e49[_0xd086('0x54')]['id']}})[_0xd086('0x21')](handleEntityNotFound(_0x5f12e7,null))[_0xd086('0x21')](removeEntity(_0x5f12e7,null))[_0xd086('0x2a')](handleError(_0x5f12e7,null));};exports[_0xd086('0x5a')]=function(_0x340a74,_0x36ad54){return db[_0xd086('0x3c')]['describe']()['then'](respondWithResult(_0x36ad54,null))[_0xd086('0x2a')](handleError(_0x36ad54,null));};var interaction_log=require('../../config/logger')(_0xd086('0x5b'));exports[_0xd086('0x5c')]=function(_0x1eedb8,_0x431b20,_0x173a76){var _0x5c43f0={'agent':{},'channel':_0xd086('0x5d')};if(_0x1eedb8[_0xd086('0x58')]['id']){delete _0x1eedb8[_0xd086('0x58')]['id'];}_0x1eedb8['body']['read']=!![];_0x1eedb8['body'][_0xd086('0x5e')]=moment()[_0xd086('0x5f')](_0xd086('0x60'));_0x1eedb8['body']['UserId']=_0x1eedb8[_0xd086('0x58')]['UserId']||_0x1eedb8[_0xd086('0x61')]['id'];_0x5c43f0[_0xd086('0x62')]['id']=_0x1eedb8['body'][_0xd086('0x63')];return db[_0xd086('0x3c')][_0xd086('0x56')]({'where':{'id':_0x1eedb8[_0xd086('0x54')]['id'],'UserId':null}})[_0xd086('0x21')](handleEntityNotFound(_0x431b20,null))[_0xd086('0x21')](saveUpdates(_0x1eedb8['body'],null))[_0xd086('0x21')](function(_0x454046){if(_0x454046){_0x5c43f0['message']=_0x454046[_0xd086('0x64')]({'plain':!![]});return db[_0xd086('0x65')][_0xd086('0x56')]({'where':{'id':_0x454046['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x431b20,null))[_0xd086('0x21')](function(_0x1fb945){if(_0x1fb945){return _0x1fb945[_0xd086('0x59')]({'UserId':_0x1eedb8[_0xd086('0x58')][_0xd086('0x63')],'read1stAt':_[_0xd086('0x66')](_0x1fb945[_0xd086('0x67')])?moment()[_0xd086('0x5f')](_0xd086('0x60')):undefined});}return null;})[_0xd086('0x21')](function(_0xb6f48a){if(_0xb6f48a){_0x5c43f0['interaction']=_0xb6f48a[_0xd086('0x64')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1eedb8[_0xd086('0x61')]['id'],_0x1eedb8['user'][_0xd086('0x39')],_0x1eedb8[_0xd086('0x61')][_0xd086('0x68')],_0x5c43f0['interaction']['id'],_0x1eedb8['body']?JSON['stringify'](_0x1eedb8[_0xd086('0x58')]):_0xd086('0x69'));return respondWithRpcPromise('AcceptMessage',_0xd086('0x6a'),_0x5c43f0);}return null;})[_0xd086('0x21')](function(_0x121305){var _0x257cb3=_0xd086('0x6b')+_0x121305[_0xd086('0x27')]['ContactId'];return db[_0xd086('0x6c')]['query'](_0x257cb3,{'type':db[_0xd086('0x6d')][_0xd086('0x6e')]['SELECT'],'raw':!![]})[_0xd086('0x21')](function(_0x37051f){return _0x37051f;});})['then'](function(_0x229f2b){if(_0x229f2b){_0x5c43f0['message']['contact']=_0x229f2b[0x0];if(!_0x1eedb8[_0xd086('0x58')][_0xd086('0x63')])return;return db['User'][_0xd086('0x56')]({'where':{'id':_0x1eedb8[_0xd086('0x58')][_0xd086('0x63')],'role':_0xd086('0x62')},'attributes':['id',_0xd086('0x39'),'fullname','email',_0xd086('0x6f')],'raw':!![]});}return null;})[_0xd086('0x21')](function(_0x333c0d){if(!_0x333c0d)return null;_0x5c43f0['message'][_0xd086('0x62')]=_0x333c0d;return _0x5c43f0;})[_0xd086('0x21')](function(_0x57df59){if(_0x57df59){if(_0x1eedb8[_0xd086('0x58')][_0xd086('0x70')]){_0x5c43f0['message'][_0xd086('0x71')]=util[_0xd086('0x5f')](_0xd086('0x72'),_0x1eedb8[_0xd086('0x61')]['name']);_0x5c43f0['message'][_0xd086('0x73')]=_0x5c43f0['channel'];_0x5c43f0[_0xd086('0x27')][_0xd086('0x74')]=_0x5c43f0[_0xd086('0x73')];_0x5c43f0[_0xd086('0x27')][_0xd086('0x75')]=_0xd086('0x5c');return respondWithRpcPromise('EventManager',_0xd086('0x76'),{'event':'acceptmessage','message':_0x5c43f0[_0xd086('0x27')]},client9002)[_0xd086('0x21')](function(){return _0x5c43f0;});}return _0x5c43f0;}return null;})[_0xd086('0x21')](respondWithResult(_0x431b20,null))[_0xd086('0x2a')](handleError(_0x431b20,null));};var interaction_log=require(_0xd086('0x14'))('whatsapp-interactions');exports[_0xd086('0x35')]=function(_0x43239b,_0x883df1,_0x303252){var _0x43eded={'agent':{},'channel':'whatsapp'};if(_0x43239b[_0xd086('0x58')]['id']){delete _0x43239b[_0xd086('0x58')]['id'];}_0x43239b[_0xd086('0x58')][_0xd086('0x63')]=_0x43239b['body'][_0xd086('0x63')]||_0x43239b['user']['id'];_0x43eded['agent']['id']=_0x43239b[_0xd086('0x58')][_0xd086('0x63')];return db[_0xd086('0x3c')]['find']({'where':{'id':_0x43239b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x883df1,null))['then'](function(_0x167117){if(_0x167117){_0x43eded[_0xd086('0x27')]=_0x167117['get']({'plain':!![]});return db[_0xd086('0x65')][_0xd086('0x56')]({'where':{'id':_0x167117[_0xd086('0x77')]}});}return null;})[_0xd086('0x21')](handleEntityNotFound(_0x883df1,null))['then'](function(_0x3d0c28){if(_0x3d0c28){_0x43eded['interaction']=_0x3d0c28[_0xd086('0x64')]({'plain':!![]});interaction_log[_0xd086('0x78')](_0xd086('0x79'),_0x43239b[_0xd086('0x61')]['id'],_0x43239b[_0xd086('0x61')][_0xd086('0x39')],_0x43239b['user'][_0xd086('0x68')],_0x43eded[_0xd086('0x7a')]['id'],_0x43239b[_0xd086('0x58')]?JSON[_0xd086('0x24')](_0x43239b[_0xd086('0x58')]):_0xd086('0x69'));return respondWithRpcPromise('RejectMessage',_0xd086('0x7b'),_0x43eded);}return null;})[_0xd086('0x21')](function(_0x13cc05){var _0xace5e1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13cc05['message'][_0xd086('0x7c')];return db[_0xd086('0x6c')][_0xd086('0x3e')](_0xace5e1,{'type':db['Sequelize'][_0xd086('0x6e')][_0xd086('0x7d')],'raw':!![]})[_0xd086('0x21')](function(_0x4c7c3e){return _0x4c7c3e;});})[_0xd086('0x21')](function(_0x3d7a77){if(_0x3d7a77){_0x43eded['message'][_0xd086('0x7e')]=_0x3d7a77[0x0];if(!_0x43239b[_0xd086('0x58')][_0xd086('0x63')])return;return db[_0xd086('0x7f')][_0xd086('0x56')]({'where':{'id':_0x43239b[_0xd086('0x58')][_0xd086('0x63')],'role':'agent'},'attributes':['id',_0xd086('0x39'),_0xd086('0x80'),_0xd086('0x81'),_0xd086('0x6f')],'raw':!![]});}return null;})['then'](function(_0x438163){if(!_0x438163)return null;_0x43eded[_0xd086('0x27')][_0xd086('0x62')]=_0x438163;return _0x43eded;})['then'](function(_0x2c6309){if(_0x2c6309){_0x2c6309[_0xd086('0x27')][_0xd086('0x71')]=util['format'](_0xd086('0x72'),_0x43239b['user'][_0xd086('0x39')]);_0x2c6309['message']['channel']=_0x43eded[_0xd086('0x73')];_0x2c6309[_0xd086('0x27')]['motionChannel']=_0x43eded['channel'];_0x2c6309[_0xd086('0x27')][_0xd086('0x75')]=_0xd086('0x35');respondWithRpcPromise(_0xd086('0x76'),'EventManager',{'event':_0xd086('0x82'),'message':_0x2c6309[_0xd086('0x27')]},client9002);return _0x43eded;}return null;})[_0xd086('0x21')](respondWithResult(_0x883df1,null))[_0xd086('0x2a')](handleError(_0x883df1,null));};exports[_0xd086('0x2c')]=function(_0x1e90a5,_0x7642ed,_0x654575){if(_0x1e90a5[_0xd086('0x58')]['id']){delete _0x1e90a5[_0xd086('0x58')]['id'];}var _0xf62306;return db['WhatsappMessage'][_0xd086('0x56')]({'where':{'id':_0x1e90a5['params']['id']}})[_0xd086('0x21')](handleEntityNotFound(_0x7642ed,null))[_0xd086('0x21')](function(_0x252f1d){if(_0x252f1d){_0xf62306=_0x252f1d;return db[_0xd086('0x83')][_0xd086('0x56')]({'where':{'id':_0x252f1d['WhatsappAccountId']}});}})[_0xd086('0x21')](handleEntityNotFound(_0x7642ed,null))[_0xd086('0x21')](function(_0x37ab40){if(_0x37ab40){logger['debug'](_0xd086('0x84'),_0xd086('0x2c'),_0xd086('0x85'),_0x37ab40[_0xd086('0x4c')],util[_0xd086('0x86')](_0x1e90a5['body'],{'showHidden':![],'depth':null}));switch(_0x37ab40[_0xd086('0x4c')]){case _0xd086('0x87'):if(_0x1e90a5[_0xd086('0x58')]['MessageSid']&&_0x1e90a5[_0xd086('0x58')][_0xd086('0x88')]===_0xf62306[_0xd086('0x89')]&&_0x1e90a5[_0xd086('0x58')][_0xd086('0x8a')]&&_0x1e90a5['body']['MessageStatus']===_0xd086('0x8b')){return _0xf62306[_0xd086('0x59')]({'read':!![]});}else{logger[_0xd086('0x25')](_0xd086('0x8c'),_0xd086('0x2c'),'twilio',util[_0xd086('0x86')](_0x1e90a5[_0xd086('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xf62306;}})[_0xd086('0x21')](respondWithResult(_0x7642ed,null))[_0xd086('0x2a')](handleError(_0x7642ed,null));}; \ No newline at end of file +var _0x790f=['User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','WhatsappInteraction','RejectMessage','rejectMessage','format','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','whatsapp-interactions','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','interaction','get','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x790f,0x1bf));var _0xf790=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x790f[_0x48c615];return _0x3d9e22;};'use strict';var emlformat=require(_0xf790('0x0'));var rimraf=require(_0xf790('0x1'));var zipdir=require(_0xf790('0x2'));var jsonpatch=require(_0xf790('0x3'));var rp=require(_0xf790('0x4'));var moment=require(_0xf790('0x5'));var BPromise=require(_0xf790('0x6'));var Mustache=require(_0xf790('0x7'));var util=require(_0xf790('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf790('0x9'));var ejs=require(_0xf790('0xa'));var fs=require('fs');var fs_extra=require(_0xf790('0xb'));var _=require(_0xf790('0xc'));var squel=require(_0xf790('0xd'));var crypto=require(_0xf790('0xe'));var jsforce=require(_0xf790('0xf'));var deskjs=require(_0xf790('0x10'));var toCsv=require(_0xf790('0x9'));var querystring=require(_0xf790('0x11'));var Papa=require(_0xf790('0x12'));var Redis=require(_0xf790('0x13'));var authService=require(_0xf790('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf790('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf790('0x16'))(_0xf790('0x17'));var utils=require(_0xf790('0x18'));var config=require(_0xf790('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf790('0x1a'))['db'];config[_0xf790('0x1b')]=_['defaults'](config[_0xf790('0x1b')],{'host':_0xf790('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf790('0x1b')]));require(_0xf790('0x1d'))[_0xf790('0x1e')](socket);var jayson=require(_0xf790('0x1f'));var client=jayson[_0xf790('0x20')]['http']({'port':0x232c});var client9002=jayson[_0xf790('0x20')][_0xf790('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x47ead1,_0x2a8719,_0x49ed6a,_0x247ef8){return new BPromise(function(_0x59b38a,_0x5d8686){var _0x3c4b14=_0x247ef8||client;return _0x3c4b14[_0xf790('0x22')](_0x47ead1,_0x49ed6a)[_0xf790('0x23')](function(_0x397994){logger[_0xf790('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x2a8719,_0xf790('0x25'));logger[_0xf790('0x26')](_0xf790('0x27'),_0x2a8719,_0xf790('0x25'),JSON[_0xf790('0x28')](_0x397994));if(_0x397994[_0xf790('0x29')]){if(_0x397994[_0xf790('0x29')][_0xf790('0x2a')]===0x1f4){logger['error'](_0xf790('0x2b'),_0x2a8719,_0x397994[_0xf790('0x29')][_0xf790('0x2c')]);return _0x5d8686(_0x397994[_0xf790('0x29')][_0xf790('0x2c')]);}logger['error'](_0xf790('0x2b'),_0x2a8719,_0x397994[_0xf790('0x29')]['message']);return _0x59b38a(_0x397994[_0xf790('0x29')][_0xf790('0x2c')]);}else{logger[_0xf790('0x24')](_0xf790('0x2b'),_0x2a8719,_0xf790('0x25'));_0x59b38a(_0x397994[_0xf790('0x2d')][_0xf790('0x2c')]);}})[_0xf790('0x2e')](function(_0x156c3b){logger['error'](_0xf790('0x2b'),_0x2a8719,_0x156c3b);_0x5d8686(_0x156c3b);});});}function respondWithStatusCode(_0x212298,_0x40edf2){_0x40edf2=_0x40edf2||0xcc;return function(_0x2a1983){if(_0x2a1983){return _0x212298[_0xf790('0x2f')](_0x40edf2);}return _0x212298[_0xf790('0x30')](_0x40edf2)['end']();};}function respondWithResult(_0x21d530,_0x35f2cb){_0x35f2cb=_0x35f2cb||0xc8;return function(_0x142f0c){if(_0x142f0c){return _0x21d530[_0xf790('0x30')](_0x35f2cb)[_0xf790('0x31')](_0x142f0c);}};}function respondWithFilteredResult(_0x3f825d,_0x5e989c){return function(_0x22b6f8){if(_0x22b6f8){var _0x1194c9=typeof _0x5e989c[_0xf790('0x32')]===_0xf790('0x33')&&typeof _0x5e989c['limit']===_0xf790('0x33');var _0x58ec32=_0x22b6f8['count'];var _0x46a914=_0x1194c9?0x0:_0x5e989c['offset'];var _0xcb1ff9=_0x1194c9?_0x22b6f8[_0xf790('0x34')]:_0x5e989c[_0xf790('0x32')]+_0x5e989c['limit'];var _0x55826b;if(_0xcb1ff9>=_0x58ec32){_0xcb1ff9=_0x58ec32;_0x55826b=0xc8;}else{_0x55826b=0xce;}_0x3f825d[_0xf790('0x30')](_0x55826b);return _0x3f825d['set'](_0xf790('0x35'),_0x46a914+'-'+_0xcb1ff9+'/'+_0x58ec32)[_0xf790('0x31')](_0x22b6f8);}return null;};}function patchUpdates(_0x24e1ad){return function(_0x53cd81){try{jsonpatch[_0xf790('0x36')](_0x53cd81,_0x24e1ad,!![]);}catch(_0x2aee3f){return BPromise[_0xf790('0x37')](_0x2aee3f);}return _0x53cd81[_0xf790('0x38')]();};}function saveUpdates(_0x64ce2c,_0x43f37c){return function(_0x3b3bee){if(_0x3b3bee){return _0x3b3bee[_0xf790('0x39')](_0x64ce2c)[_0xf790('0x23')](function(_0x1a9394){return _0x1a9394;});}return null;};}function removeEntity(_0x40074b,_0x3d4374){return function(_0x4d450c){if(_0x4d450c){return _0x4d450c[_0xf790('0x3a')]()['then'](function(){_0x40074b[_0xf790('0x30')](0xcc)[_0xf790('0x3b')]();});}};}function handleEntityNotFound(_0x1b74be,_0x5519ae){return function(_0x4e82a7){if(!_0x4e82a7){_0x1b74be[_0xf790('0x2f')](0x194);}return _0x4e82a7;};}function handleError(_0x3fe50c,_0x419e23){_0x419e23=_0x419e23||0x1f4;return function(_0x542cbc){logger[_0xf790('0x29')](_0x542cbc[_0xf790('0x3c')]);if(_0x542cbc[_0xf790('0x3d')]){delete _0x542cbc[_0xf790('0x3d')];}_0x3fe50c['status'](_0x419e23)[_0xf790('0x3e')](_0x542cbc);};}exports[_0xf790('0x3f')]=function(_0x14588e,_0x44cdf0){var _0x56e7d5={},_0x3e602d={},_0x50a1d1={'count':0x0,'rows':[]};var _0x193469=_[_0xf790('0x40')](db[_0xf790('0x41')]['rawAttributes'],function(_0x441369){return{'name':_0x441369[_0xf790('0x42')],'type':_0x441369[_0xf790('0x43')][_0xf790('0x44')]};});_0x3e602d[_0xf790('0x45')]=_[_0xf790('0x40')](_0x193469,_0xf790('0x3d'));_0x3e602d[_0xf790('0x46')]=_[_0xf790('0x47')](_0x14588e[_0xf790('0x46')]);_0x3e602d[_0xf790('0x48')]=_[_0xf790('0x49')](_0x3e602d['model'],_0x3e602d[_0xf790('0x46')]);_0x56e7d5[_0xf790('0x4a')]=_[_0xf790('0x49')](_0x3e602d[_0xf790('0x45')],qs['fields'](_0x14588e[_0xf790('0x46')][_0xf790('0x4b')]));_0x56e7d5[_0xf790('0x4a')]=_0x56e7d5[_0xf790('0x4a')][_0xf790('0x4c')]?_0x56e7d5['attributes']:_0x3e602d[_0xf790('0x45')];if(!_0x14588e[_0xf790('0x46')]['hasOwnProperty'](_0xf790('0x4d'))){_0x56e7d5[_0xf790('0x4e')]=qs['limit'](_0x14588e['query'][_0xf790('0x4e')]);_0x56e7d5[_0xf790('0x32')]=qs[_0xf790('0x32')](_0x14588e['query'][_0xf790('0x32')]);}_0x56e7d5[_0xf790('0x4f')]=qs['sort'](_0x14588e[_0xf790('0x46')][_0xf790('0x50')]);_0x56e7d5[_0xf790('0x51')]=qs[_0xf790('0x48')](_[_0xf790('0x52')](_0x14588e[_0xf790('0x46')],_0x3e602d[_0xf790('0x48')]),_0x193469);if(_0x14588e[_0xf790('0x46')][_0xf790('0x53')]){_0x56e7d5[_0xf790('0x51')]=_[_0xf790('0x54')](_0x56e7d5[_0xf790('0x51')],{'$or':_[_0xf790('0x40')](_0x193469,function(_0x11d341){if(_0x11d341[_0xf790('0x43')]!==_0xf790('0x55')){var _0x2618f4={};_0x2618f4[_0x11d341[_0xf790('0x3d')]]={'$like':'%'+_0x14588e['query'][_0xf790('0x53')]+'%'};return _0x2618f4;}})});}_0x56e7d5=_[_0xf790('0x54')]({},_0x56e7d5,_0x14588e['options']);var _0x569fde={'where':_0x56e7d5['where']};return db[_0xf790('0x41')][_0xf790('0x34')](_0x569fde)[_0xf790('0x23')](function(_0x38cdc2){_0x50a1d1[_0xf790('0x34')]=_0x38cdc2;if(_0x14588e[_0xf790('0x46')][_0xf790('0x56')]){_0x56e7d5[_0xf790('0x57')]=[{'all':!![]}];}return db[_0xf790('0x41')][_0xf790('0x58')](_0x56e7d5);})[_0xf790('0x23')](function(_0x2bb6a1){_0x50a1d1[_0xf790('0x59')]=_0x2bb6a1;return _0x50a1d1;})[_0xf790('0x23')](respondWithFilteredResult(_0x44cdf0,_0x56e7d5))['catch'](handleError(_0x44cdf0,null));};exports[_0xf790('0x5a')]=function(_0x13a1d4,_0x4ae3b2){var _0x54fa2b={'raw':!![],'where':{'id':_0x13a1d4[_0xf790('0x5b')]['id']}},_0x5823ae={};_0x5823ae[_0xf790('0x45')]=_['keys'](db[_0xf790('0x41')][_0xf790('0x5c')]);_0x5823ae[_0xf790('0x46')]=_[_0xf790('0x47')](_0x13a1d4[_0xf790('0x46')]);_0x5823ae[_0xf790('0x48')]=_[_0xf790('0x49')](_0x5823ae['model'],_0x5823ae['query']);_0x54fa2b[_0xf790('0x4a')]=_[_0xf790('0x49')](_0x5823ae['model'],qs[_0xf790('0x4b')](_0x13a1d4[_0xf790('0x46')][_0xf790('0x4b')]));_0x54fa2b[_0xf790('0x4a')]=_0x54fa2b[_0xf790('0x4a')][_0xf790('0x4c')]?_0x54fa2b[_0xf790('0x4a')]:_0x5823ae[_0xf790('0x45')];if(_0x13a1d4[_0xf790('0x46')][_0xf790('0x56')]){_0x54fa2b[_0xf790('0x57')]=[{'all':!![]}];}_0x54fa2b=_['merge']({},_0x54fa2b,_0x13a1d4[_0xf790('0x5d')]);return db[_0xf790('0x41')][_0xf790('0x5e')](_0x54fa2b)[_0xf790('0x23')](handleEntityNotFound(_0x4ae3b2,null))[_0xf790('0x23')](respondWithResult(_0x4ae3b2,null))[_0xf790('0x2e')](handleError(_0x4ae3b2,null));};exports['create']=function(_0x22b6b6,_0x282313){return db[_0xf790('0x41')][_0xf790('0x5f')](_0x22b6b6['body'],{})['then'](respondWithResult(_0x282313,0xc9))[_0xf790('0x2e')](handleError(_0x282313,null));};exports[_0xf790('0x39')]=function(_0x29c40c,_0x33cf1c){if(_0x29c40c[_0xf790('0x60')]['id']){delete _0x29c40c[_0xf790('0x60')]['id'];}return db[_0xf790('0x41')]['find']({'where':{'id':_0x29c40c[_0xf790('0x5b')]['id']}})[_0xf790('0x23')](handleEntityNotFound(_0x33cf1c,null))[_0xf790('0x23')](saveUpdates(_0x29c40c[_0xf790('0x60')],null))['then'](respondWithResult(_0x33cf1c,null))[_0xf790('0x2e')](handleError(_0x33cf1c,null));};exports[_0xf790('0x3a')]=function(_0xc07a26,_0x3ac93f){return db['WhatsappMessage']['find']({'where':{'id':_0xc07a26[_0xf790('0x5b')]['id']}})[_0xf790('0x23')](handleEntityNotFound(_0x3ac93f,null))[_0xf790('0x23')](removeEntity(_0x3ac93f,null))[_0xf790('0x2e')](handleError(_0x3ac93f,null));};exports[_0xf790('0x61')]=function(_0x375fd6,_0x10eb51){return db[_0xf790('0x41')][_0xf790('0x61')]()[_0xf790('0x23')](respondWithResult(_0x10eb51,null))[_0xf790('0x2e')](handleError(_0x10eb51,null));};var interaction_log=require(_0xf790('0x16'))(_0xf790('0x62'));exports['accept']=function(_0x5e1f9c,_0x24d0cc,_0x45c156){var _0x36b7b4={'agent':{},'channel':_0xf790('0x63')};if(_0x5e1f9c[_0xf790('0x60')]['id']){delete _0x5e1f9c[_0xf790('0x60')]['id'];}_0x5e1f9c['body']['read']=!![];_0x5e1f9c[_0xf790('0x60')][_0xf790('0x64')]=moment()['format'](_0xf790('0x65'));_0x5e1f9c['body'][_0xf790('0x66')]=_0x5e1f9c['body']['UserId']||_0x5e1f9c[_0xf790('0x67')]['id'];_0x36b7b4[_0xf790('0x68')]['id']=_0x5e1f9c[_0xf790('0x60')][_0xf790('0x66')];return db[_0xf790('0x41')][_0xf790('0x5e')]({'where':{'id':_0x5e1f9c[_0xf790('0x5b')]['id'],'UserId':null}})[_0xf790('0x23')](handleEntityNotFound(_0x24d0cc,null))[_0xf790('0x23')](saveUpdates(_0x5e1f9c[_0xf790('0x60')],null))[_0xf790('0x23')](function(_0xe3c26e){if(_0xe3c26e){_0x36b7b4[_0xf790('0x2c')]=_0xe3c26e['get']({'plain':!![]});return db['WhatsappInteraction'][_0xf790('0x5e')]({'where':{'id':_0xe3c26e[_0xf790('0x69')]}});}return null;})[_0xf790('0x23')](handleEntityNotFound(_0x24d0cc,null))[_0xf790('0x23')](function(_0x352388){if(_0x352388){return _0x352388['update']({'UserId':_0x5e1f9c[_0xf790('0x60')][_0xf790('0x66')],'read1stAt':_[_0xf790('0x6a')](_0x352388['read1stAt'])?moment()['format'](_0xf790('0x65')):undefined});}return null;})[_0xf790('0x23')](function(_0x3d3258){if(_0x3d3258){_0x36b7b4[_0xf790('0x6b')]=_0x3d3258[_0xf790('0x6c')]({'plain':!![]});interaction_log[_0xf790('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e1f9c[_0xf790('0x67')]['id'],_0x5e1f9c[_0xf790('0x67')]['name'],_0x5e1f9c[_0xf790('0x67')][_0xf790('0x6d')],_0x36b7b4[_0xf790('0x6b')]['id'],_0x5e1f9c[_0xf790('0x60')]?JSON[_0xf790('0x28')](_0x5e1f9c['body']):_0xf790('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xf790('0x6f'),_0x36b7b4);}return null;})[_0xf790('0x23')](function(_0x1678aa){var _0x3f1bc7=_0xf790('0x70')+_0x1678aa[_0xf790('0x2c')][_0xf790('0x71')];return db['sequelize']['query'](_0x3f1bc7,{'type':db[_0xf790('0x72')]['QueryTypes'][_0xf790('0x73')],'raw':!![]})['then'](function(_0x1ed9b2){return _0x1ed9b2;});})[_0xf790('0x23')](function(_0x2d14f6){if(_0x2d14f6){_0x36b7b4[_0xf790('0x2c')][_0xf790('0x74')]=_0x2d14f6[0x0];if(!_0x5e1f9c['body'][_0xf790('0x66')])return;return db[_0xf790('0x75')][_0xf790('0x5e')]({'where':{'id':_0x5e1f9c['body'][_0xf790('0x66')],'role':_0xf790('0x68')},'attributes':['id',_0xf790('0x3d'),_0xf790('0x76'),'email',_0xf790('0x77')],'raw':!![]});}return null;})['then'](function(_0x114058){if(!_0x114058)return null;_0x36b7b4[_0xf790('0x2c')]['agent']=_0x114058;return _0x36b7b4;})[_0xf790('0x23')](function(_0x3aad50){if(_0x3aad50){if(_0x5e1f9c['body']['manual']){_0x36b7b4[_0xf790('0x2c')][_0xf790('0x78')]=util['format'](_0xf790('0x79'),_0x5e1f9c['user'][_0xf790('0x3d')]);_0x36b7b4[_0xf790('0x2c')]['channel']=_0x36b7b4[_0xf790('0x7a')];_0x36b7b4[_0xf790('0x2c')][_0xf790('0x7b')]=_0x36b7b4['channel'];_0x36b7b4[_0xf790('0x2c')][_0xf790('0x7c')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x36b7b4[_0xf790('0x2c')]},client9002)[_0xf790('0x23')](function(){return _0x36b7b4;});}return _0x36b7b4;}return null;})[_0xf790('0x23')](respondWithResult(_0x24d0cc,null))[_0xf790('0x2e')](handleError(_0x24d0cc,null));};var interaction_log=require(_0xf790('0x16'))(_0xf790('0x62'));exports[_0xf790('0x37')]=function(_0x2aad10,_0x2f6975,_0xfcf7ab){var _0x851daa={'agent':{},'channel':_0xf790('0x63')};if(_0x2aad10['body']['id']){delete _0x2aad10['body']['id'];}_0x2aad10['body'][_0xf790('0x66')]=_0x2aad10[_0xf790('0x60')]['UserId']||_0x2aad10[_0xf790('0x67')]['id'];_0x851daa[_0xf790('0x68')]['id']=_0x2aad10[_0xf790('0x60')]['UserId'];return db['WhatsappMessage'][_0xf790('0x5e')]({'where':{'id':_0x2aad10['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f6975,null))[_0xf790('0x23')](function(_0x59f7b5){if(_0x59f7b5){_0x851daa['message']=_0x59f7b5[_0xf790('0x6c')]({'plain':!![]});return db[_0xf790('0x7d')][_0xf790('0x5e')]({'where':{'id':_0x59f7b5['WhatsappInteractionId']}});}return null;})[_0xf790('0x23')](handleEntityNotFound(_0x2f6975,null))['then'](function(_0x21588b){if(_0x21588b){_0x851daa['interaction']=_0x21588b['get']({'plain':!![]});interaction_log[_0xf790('0x24')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2aad10['user']['id'],_0x2aad10[_0xf790('0x67')][_0xf790('0x3d')],_0x2aad10[_0xf790('0x67')][_0xf790('0x6d')],_0x851daa['interaction']['id'],_0x2aad10[_0xf790('0x60')]?JSON[_0xf790('0x28')](_0x2aad10[_0xf790('0x60')]):_0xf790('0x6e'));return respondWithRpcPromise(_0xf790('0x7e'),_0xf790('0x7f'),_0x851daa);}return null;})[_0xf790('0x23')](function(_0x3000b4){var _0x4118bf=_0xf790('0x70')+_0x3000b4[_0xf790('0x2c')][_0xf790('0x71')];return db['sequelize'][_0xf790('0x46')](_0x4118bf,{'type':db['Sequelize']['QueryTypes'][_0xf790('0x73')],'raw':!![]})[_0xf790('0x23')](function(_0x5071fe){return _0x5071fe;});})[_0xf790('0x23')](function(_0x2f2ef2){if(_0x2f2ef2){_0x851daa['message']['contact']=_0x2f2ef2[0x0];if(!_0x2aad10[_0xf790('0x60')][_0xf790('0x66')])return;return db['User']['find']({'where':{'id':_0x2aad10[_0xf790('0x60')][_0xf790('0x66')],'role':_0xf790('0x68')},'attributes':['id','name',_0xf790('0x76'),'email',_0xf790('0x77')],'raw':!![]});}return null;})[_0xf790('0x23')](function(_0x34d77a){if(!_0x34d77a)return null;_0x851daa[_0xf790('0x2c')][_0xf790('0x68')]=_0x34d77a;return _0x851daa;})[_0xf790('0x23')](function(_0xadff39){if(_0xadff39){_0xadff39[_0xf790('0x2c')][_0xf790('0x78')]=util[_0xf790('0x80')](_0xf790('0x79'),_0x2aad10[_0xf790('0x67')]['name']);_0xadff39[_0xf790('0x2c')][_0xf790('0x7a')]=_0x851daa[_0xf790('0x7a')];_0xadff39[_0xf790('0x2c')][_0xf790('0x7b')]=_0x851daa[_0xf790('0x7a')];_0xadff39['message']['event']=_0xf790('0x37');respondWithRpcPromise(_0xf790('0x81'),_0xf790('0x81'),{'event':_0xf790('0x82'),'message':_0xadff39[_0xf790('0x2c')]},client9002);return _0x851daa;}return null;})[_0xf790('0x23')](respondWithResult(_0x2f6975,null))[_0xf790('0x2e')](handleError(_0x2f6975,null));};exports[_0xf790('0x30')]=function(_0x12ca47,_0x1be934,_0x11c11e){if(_0x12ca47[_0xf790('0x60')]['id']){delete _0x12ca47['body']['id'];}var _0x5e06af;return db[_0xf790('0x41')][_0xf790('0x5e')]({'where':{'id':_0x12ca47[_0xf790('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1be934,null))[_0xf790('0x23')](function(_0x5dcdb9){if(_0x5dcdb9){_0x5e06af=_0x5dcdb9;return db[_0xf790('0x83')]['find']({'where':{'id':_0x5dcdb9[_0xf790('0x84')]}});}})[_0xf790('0x23')](handleEntityNotFound(_0x1be934,null))['then'](function(_0x253600){if(_0x253600){logger[_0xf790('0x26')](_0xf790('0x85'),'status',_0xf790('0x86'),_0x253600[_0xf790('0x43')],util[_0xf790('0x87')](_0x12ca47['body'],{'showHidden':![],'depth':null}));switch(_0x253600[_0xf790('0x43')]){case _0xf790('0x88'):if(_0x12ca47[_0xf790('0x60')][_0xf790('0x89')]&&_0x12ca47[_0xf790('0x60')][_0xf790('0x89')]===_0x5e06af['messageId']&&_0x12ca47['body']['MessageStatus']&&_0x12ca47[_0xf790('0x60')][_0xf790('0x8a')]===_0xf790('0x8b')){return _0x5e06af[_0xf790('0x39')]({'read':!![]});}else{logger['error'](_0xf790('0x8c'),'status',_0xf790('0x88'),util['inspect'](_0x12ca47[_0xf790('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5e06af;}})[_0xf790('0x23')](respondWithResult(_0x1be934,null))[_0xf790('0x2e')](handleError(_0x1be934,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 31e128d..8f89629 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 _0x4483=['../../mysqldb','WhatsappMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4483,0x1a3));var _0x3448=function(_0x357fd2,_0x1e32cb){_0x357fd2=_0x357fd2-0x0;var _0x2de95d=_0x4483[_0x357fd2];return _0x2de95d;};'use strict';var EventEmitter=require(_0x3448('0x0'));var WhatsappMessage=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){WhatsappMessageEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);WhatsappMessageEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];WhatsappMessage[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7894=['WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7894,0x170));var _0x4789=function(_0x34e9ca,_0x3ebd44){_0x34e9ca=_0x34e9ca-0x0;var _0x1e0445=_0x7894[_0x34e9ca];return _0x1e0445;};'use strict';var EventEmitter=require(_0x4789('0x0'));var WhatsappMessage=require(_0x4789('0x1'))['db'][_0x4789('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4789('0x3')](0x0);var events={'afterCreate':_0x4789('0x4'),'afterUpdate':_0x4789('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4bd76){return function(_0x2b2dd3,_0x4e2393,_0x3394f6){WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76+':'+_0x2b2dd3['id'],_0x2b2dd3);WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76,_0x2b2dd3);_0x3394f6(null);};}for(var e in events){if(events[_0x4789('0x7')](e)){var event=events[e];WhatsappMessage[_0x4789('0x8')](e,emitEvent(event));}}module[_0x4789('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index e1d4aeb..94e144c 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 _0xba0f=['node-fetch','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','out','WhatsappAccount','find','type','twilio','authToken','phone','accountSid','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x295f72,_0x5bcfcf){var _0x261db7=function(_0x2f9719){while(--_0x2f9719){_0x295f72['push'](_0x295f72['shift']());}};_0x261db7(++_0x5bcfcf);}(_0xba0f,0x1b3));var _0xfba0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xba0f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xfba0('0x0'));var util=require(_0xfba0('0x1'));var logger=require(_0xfba0('0x2'))(_0xfba0('0x3'));var moment=require('moment');var BPromise=require(_0xfba0('0x4'));var rp=require(_0xfba0('0x5'));var fetch=require(_0xfba0('0x6'));var fs=require('fs');var path=require(_0xfba0('0x7'));var rimraf=require(_0xfba0('0x8'));var config=require(_0xfba0('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0xfba0('0xa')]=function(_0x10f1ff,_0x1a665b){return _0x10f1ff[_0xfba0('0xb')](_0xfba0('0xc'),attributes,{'tableName':_0xfba0('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xfba0('0xe'),'fields':['body'],'type':_0xfba0('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3587b1,_0x18d00e,_0x56e9e0){var _0x182821=_0x10f1ff[_0xfba0('0x10')];var _0x5b30ae=_0x3587b1[_0xfba0('0x11')]({'plain':!![]});if(_0x5b30ae['direction'][_0xfba0('0x12')]()==='in'||_0x5b30ae[_0xfba0('0x13')][_0xfba0('0x12')]()==='out'&&!_0x5b30ae[_0xfba0('0x14')]&&!_[_0xfba0('0x15')](_0x5b30ae[_0xfba0('0x16')])){_0x182821[_0xfba0('0x17')][_0xfba0('0x18')]({'where':{'id':_0x5b30ae[_0xfba0('0x19')]}})[_0xfba0('0x1a')](function(_0x216354){if(_0x216354){_0x216354[_0xfba0('0x1b')]({'lastMsgAt':_0x5b30ae[_0xfba0('0x1c')],'lastMsgDirection':_0x5b30ae[_0xfba0('0x13')]['toLowerCase']()});}})[_0xfba0('0x1d')](function(_0x39d3c7){console[_0xfba0('0x1e')](_0x39d3c7);});}if(_0x5b30ae[_0xfba0('0x13')]===_0xfba0('0x1f')&&!_0x5b30ae['secret']){var _0x25fa6a;_0x182821[_0xfba0('0x20')][_0xfba0('0x21')]({'where':{'id':_0x5b30ae['WhatsappAccountId']},'raw':!![]})[_0xfba0('0x1a')](function(_0xa52035){_0x25fa6a=_0xa52035;if(_0x25fa6a&&_0x25fa6a[_0xfba0('0x22')]){switch(_0x25fa6a[_0xfba0('0x22')]){case _0xfba0('0x23'):var _0x1c9a29=require(_0xfba0('0x23'));if(_0x25fa6a['accountSid']&&_0x25fa6a[_0xfba0('0x24')]&&_0x25fa6a[_0xfba0('0x25')]){var _0x430f83=new _0x1c9a29(_0x25fa6a[_0xfba0('0x26')],_0x25fa6a[_0xfba0('0x24')]);_0x430f83[_0xfba0('0x27')][_0xfba0('0x28')]({'body':_0x5b30ae[_0xfba0('0x29')],'to':'whatsapp:'+_0x5b30ae[_0xfba0('0x25')],'from':_0xfba0('0x2a')+_0x25fa6a[_0xfba0('0x25')],'statusCallback':_0x25fa6a[_0xfba0('0x2b')]+_0xfba0('0x2c')+_0x5b30ae['id']+_0xfba0('0x2d')+_0x25fa6a['token']})[_0xfba0('0x1a')](function(_0xb26651){if(_0xb26651[_0xfba0('0x2e')]){return _0x3587b1[_0xfba0('0x1b')]({'messageId':_0xb26651[_0xfba0('0x2e')]});}})[_0xfba0('0x1d')](function(_0x35ab50){logger[_0xfba0('0x1e')](_0xfba0('0x2f'),_0xfba0('0x30'),'twilio',util[_0xfba0('0x31')](_0x35ab50,{'showHidden':![],'depth':null}));});}else{logger[_0xfba0('0x1e')](_0xfba0('0x2f'),_0xfba0('0x30'),_0xfba0('0x23'),_0xfba0('0x32'));}break;case _0xfba0('0x33'):var _0x5ab5af=_0x25fa6a[_0xfba0('0x26')];var _0x4bd59c=_0x25fa6a['authToken'];var _0x125e68=_0x25fa6a['baseUrl']+_0xfba0('0x34')+_0x5ab5af+_0xfba0('0x35');var _0x550b62={'to':[_0x5b30ae['phone']],'message':{'type':_0xfba0('0x36'),'text':_0x5b30ae[_0xfba0('0x29')]}};var _0x251726={'method':_0xfba0('0x37'),'uri':_0x125e68,'headers':{'Authorization':_0xfba0('0x38')+_0x4bd59c,'Content-Type':_0xfba0('0x39')},'body':_0x550b62,'json':!![]};rp(_0x251726)['then'](function(_0x39b686){if(_0x39b686[_0xfba0('0x3a')][0x0][_0xfba0('0x3b')]){return _0x3587b1['update']({'messageId':_0x39b686[_0xfba0('0x3a')][0x0]['message_id']});}})[_0xfba0('0x1d')](function(_0x4fc848){logger[_0xfba0('0x3c')]('WhatsappMessage,\x20%s',_0x4fc848);});break;}}})[_0xfba0('0x3d')](function(){_0x56e9e0();});}else{_0x56e9e0();}}},'charset':'utf8mb4','collate':_0xfba0('0x3e')});}; \ No newline at end of file +var _0x3228=['application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3228,0x181));var _0x8322=function(_0x1a5433,_0x4b01ff){_0x1a5433=_0x1a5433-0x0;var _0x4fec8c=_0x3228[_0x1a5433];return _0x4fec8c;};'use strict';var _=require(_0x8322('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8322('0x1'));var moment=require(_0x8322('0x2'));var BPromise=require(_0x8322('0x3'));var rp=require(_0x8322('0x4'));var fetch=require(_0x8322('0x5'));var fs=require('fs');var path=require(_0x8322('0x6'));var rimraf=require(_0x8322('0x7'));var config=require(_0x8322('0x8'));var attributes=require(_0x8322('0x9'));module['exports']=function(_0x2d3f72,_0x1d7870){return _0x2d3f72['define'](_0x8322('0xa'),attributes,{'tableName':_0x8322('0xb'),'paranoid':![],'indexes':[{'name':_0x8322('0xc'),'fields':[_0x8322('0xc')]},{'name':_0x8322('0xd'),'fields':[_0x8322('0xe')],'type':_0x8322('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15c187,_0x35a94a,_0x2a3369){var _0xa58401=_0x2d3f72['models'];var _0x5a159f=_0x15c187[_0x8322('0x10')]({'plain':!![]});if(_0x5a159f[_0x8322('0x11')][_0x8322('0x12')]()==='in'||_0x5a159f[_0x8322('0x11')][_0x8322('0x12')]()===_0x8322('0x13')&&!_0x5a159f[_0x8322('0x14')]&&!_[_0x8322('0x15')](_0x5a159f[_0x8322('0x16')])){_0xa58401[_0x8322('0x17')][_0x8322('0x18')]({'where':{'id':_0x5a159f[_0x8322('0x19')]}})[_0x8322('0x1a')](function(_0x250164){if(_0x250164){_0x250164[_0x8322('0x1b')]({'lastMsgAt':_0x5a159f[_0x8322('0x1c')],'lastMsgDirection':_0x5a159f[_0x8322('0x11')][_0x8322('0x12')]()});}})[_0x8322('0x1d')](function(_0x54950c){console[_0x8322('0x1e')](_0x54950c);});}if(_0x5a159f['direction']===_0x8322('0x13')&&!_0x5a159f[_0x8322('0x14')]){var _0xebace9;_0xa58401[_0x8322('0x1f')][_0x8322('0x20')]({'where':{'id':_0x5a159f[_0x8322('0x21')]},'raw':!![]})[_0x8322('0x1a')](function(_0xab35b3){_0xebace9=_0xab35b3;if(_0xebace9&&_0xebace9['type']){switch(_0xebace9[_0x8322('0x22')]){case _0x8322('0x23'):var _0xc6020=require(_0x8322('0x23'));if(_0xebace9[_0x8322('0x24')]&&_0xebace9[_0x8322('0x25')]&&_0xebace9[_0x8322('0x26')]){var _0x4f5285=new _0xc6020(_0xebace9['accountSid'],_0xebace9['authToken']);_0x4f5285[_0x8322('0x27')][_0x8322('0x28')]({'body':_0x5a159f[_0x8322('0xe')],'to':_0x8322('0x29')+_0x5a159f[_0x8322('0x26')],'from':_0x8322('0x29')+_0xebace9[_0x8322('0x26')],'statusCallback':_0xebace9[_0x8322('0x2a')]+_0x8322('0x2b')+_0x5a159f['id']+_0x8322('0x2c')+_0xebace9[_0x8322('0x2d')]})[_0x8322('0x1a')](function(_0x3cbd64){if(_0x3cbd64[_0x8322('0x2e')]){return _0x15c187['update']({'messageId':_0x3cbd64[_0x8322('0x2e')]});}})[_0x8322('0x1d')](function(_0x1d6c94){logger[_0x8322('0x1e')](_0x8322('0x2f'),_0x8322('0x30'),_0x8322('0x23'),util[_0x8322('0x31')](_0x1d6c94,{'showHidden':![],'depth':null}));});}else{logger[_0x8322('0x1e')](_0x8322('0x2f'),_0x8322('0x30'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8322('0x32'):var _0x4d3b67=_0xebace9[_0x8322('0x24')];var _0x516e85=_0xebace9[_0x8322('0x25')];var _0x2f8ded=_0xebace9['baseUrl']+_0x8322('0x33')+_0x4d3b67+_0x8322('0x34');var _0xe6d895={'to':[_0x5a159f[_0x8322('0x26')]],'message':{'type':_0x8322('0x35'),'text':_0x5a159f[_0x8322('0xe')]}};var _0xae1974={'method':_0x8322('0x36'),'uri':_0x2f8ded,'headers':{'Authorization':_0x8322('0x37')+_0x516e85,'Content-Type':_0x8322('0x38')},'body':_0xe6d895,'json':!![]};rp(_0xae1974)[_0x8322('0x1a')](function(_0x338359){if(_0x338359[_0x8322('0x39')][0x0][_0x8322('0x3a')]){return _0x15c187[_0x8322('0x1b')]({'messageId':_0x338359[_0x8322('0x39')][0x0]['message_id']});}})[_0x8322('0x1d')](function(_0x503faa){logger[_0x8322('0x3b')](_0x8322('0x3c'),_0x503faa);});break;}}})['finally'](function(){_0x2a3369();});}else{_0x2a3369();}}},'charset':_0x8322('0x3d'),'collate':_0x8322('0x3e')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index a5396d5..582c0c0 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 _0x6a40=['debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappMessage','create','body','options','CreateWhatsappMessage','lodash','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x21a757,_0x140d70){var _0x2da773=function(_0x4a2a22){while(--_0x4a2a22){_0x21a757['push'](_0x21a757['shift']());}};_0x2da773(++_0x140d70);}(_0x6a40,0xc2));var _0x06a4=function(_0x20ea53,_0xde3e0a){_0x20ea53=_0x20ea53-0x0;var _0x4ddf4e=_0x6a40[_0x20ea53];return _0x4ddf4e;};'use strict';var _=require(_0x06a4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06a4('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x06a4('0x2'));var config=require(_0x06a4('0x3'));var jayson=require(_0x06a4('0x4'));var client=jayson[_0x06a4('0x5')][_0x06a4('0x6')]({'port':0x232a});config[_0x06a4('0x7')]=_[_0x06a4('0x8')](config[_0x06a4('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x06a4('0x9'))(new Redis(config['redis']));require(_0x06a4('0xa'))[_0x06a4('0xb')](socket);function respondWithRpcPromise(_0x55ef90,_0x17e484,_0x24e78b){return new BPromise(function(_0x1084e1,_0x508c91){return client[_0x06a4('0xc')](_0x55ef90,_0x24e78b)[_0x06a4('0xd')](function(_0x29479c){logger[_0x06a4('0xe')](_0x06a4('0xf'),_0x17e484,'request\x20sent');logger[_0x06a4('0x10')](_0x06a4('0x11'),_0x17e484,_0x06a4('0x12'),JSON[_0x06a4('0x13')](_0x29479c));if(_0x29479c[_0x06a4('0x14')]){if(_0x29479c[_0x06a4('0x14')][_0x06a4('0x15')]===0x1f4){logger[_0x06a4('0x14')](_0x06a4('0xf'),_0x17e484,_0x29479c['error'][_0x06a4('0x16')]);return _0x508c91(_0x29479c[_0x06a4('0x14')][_0x06a4('0x16')]);}logger[_0x06a4('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x17e484,_0x29479c[_0x06a4('0x14')][_0x06a4('0x16')]);return _0x1084e1(_0x29479c[_0x06a4('0x14')][_0x06a4('0x16')]);}else{logger[_0x06a4('0xe')](_0x06a4('0xf'),_0x17e484,_0x06a4('0x12'));_0x1084e1(_0x29479c[_0x06a4('0x17')][_0x06a4('0x16')]);}})[_0x06a4('0x18')](function(_0x4acfe8){logger[_0x06a4('0x14')](_0x06a4('0xf'),_0x17e484,_0x4acfe8);_0x508c91(_0x4acfe8);});});}exports['CreateWhatsappMessage']=function(_0x5f756f){var _0xd163ae=this;return new Promise(function(_0x28ddd7,_0x46a5fc){return db[_0x06a4('0x19')][_0x06a4('0x1a')](_0x5f756f[_0x06a4('0x1b')],{'raw':_0x5f756f[_0x06a4('0x1c')]?_0x5f756f[_0x06a4('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x06a4('0xd')](function(_0xfa3bd3){logger[_0x06a4('0xe')](_0x06a4('0x1d'),_0x5f756f);logger['debug']('CreateWhatsappMessage',_0x5f756f,JSON[_0x06a4('0x13')](_0xfa3bd3));_0x28ddd7(_0xfa3bd3);})[_0x06a4('0x18')](function(_0x344ef6){logger[_0x06a4('0x14')](_0x06a4('0x1d'),_0x344ef6['message'],_0x5f756f);_0x46a5fc(_0xd163ae[_0x06a4('0x14')](0x1f4,_0x344ef6[_0x06a4('0x16')]));});});}; \ No newline at end of file +var _0x9f09=['create','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','WhatsappMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9f09,0x67));var _0x99f0=function(_0x36a6e6,_0x572048){_0x36a6e6=_0x36a6e6-0x0;var _0x4fd5f5=_0x9f09[_0x36a6e6];return _0x4fd5f5;};'use strict';var _=require(_0x99f0('0x0'));var util=require(_0x99f0('0x1'));var moment=require(_0x99f0('0x2'));var BPromise=require(_0x99f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99f0('0x4'));var db=require(_0x99f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x99f0('0x6'));var jayson=require(_0x99f0('0x7'));var client=jayson[_0x99f0('0x8')][_0x99f0('0x9')]({'port':0x232a});config[_0x99f0('0xa')]=_[_0x99f0('0xb')](config[_0x99f0('0xa')],{'host':_0x99f0('0xc'),'port':0x18eb});var socket=require(_0x99f0('0xd'))(new Redis(config[_0x99f0('0xa')]));require(_0x99f0('0xe'))[_0x99f0('0xf')](socket);function respondWithRpcPromise(_0x275b13,_0x52ce5a,_0x1a000b){return new BPromise(function(_0x49725e,_0x20dd56){return client[_0x99f0('0x10')](_0x275b13,_0x1a000b)[_0x99f0('0x11')](function(_0x31e02b){logger[_0x99f0('0x12')](_0x99f0('0x13'),_0x52ce5a,'request\x20sent');logger[_0x99f0('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x52ce5a,_0x99f0('0x15'),JSON[_0x99f0('0x16')](_0x31e02b));if(_0x31e02b['error']){if(_0x31e02b['error'][_0x99f0('0x17')]===0x1f4){logger[_0x99f0('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x52ce5a,_0x31e02b[_0x99f0('0x18')][_0x99f0('0x19')]);return _0x20dd56(_0x31e02b[_0x99f0('0x18')]['message']);}logger[_0x99f0('0x18')](_0x99f0('0x13'),_0x52ce5a,_0x31e02b[_0x99f0('0x18')][_0x99f0('0x19')]);return _0x49725e(_0x31e02b[_0x99f0('0x18')]['message']);}else{logger[_0x99f0('0x12')](_0x99f0('0x13'),_0x52ce5a,_0x99f0('0x15'));_0x49725e(_0x31e02b[_0x99f0('0x1a')][_0x99f0('0x19')]);}})[_0x99f0('0x1b')](function(_0x37eb7d){logger[_0x99f0('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x52ce5a,_0x37eb7d);_0x20dd56(_0x37eb7d);});});}exports['CreateWhatsappMessage']=function(_0x24b4ca){var _0x53310c=this;return new Promise(function(_0x2742b3,_0x33c990){return db[_0x99f0('0x1c')][_0x99f0('0x1d')](_0x24b4ca['body'],{'raw':_0x24b4ca[_0x99f0('0x1e')]?_0x24b4ca[_0x99f0('0x1e')][_0x99f0('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xf0ce4c){logger[_0x99f0('0x12')](_0x99f0('0x20'),_0x24b4ca);logger[_0x99f0('0x14')]('CreateWhatsappMessage',_0x24b4ca,JSON[_0x99f0('0x16')](_0xf0ce4c));_0x2742b3(_0xf0ce4c);})[_0x99f0('0x1b')](function(_0x4f15ca){logger[_0x99f0('0x18')](_0x99f0('0x20'),_0x4f15ca['message'],_0x24b4ca);_0x33c990(_0x53310c[_0x99f0('0x18')](0x1f4,_0x4f15ca[_0x99f0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index b92df11..8385d3e 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 _0xd258=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','register','length'];(function(_0x19e6f0,_0x3131b8){var _0x272ca8=function(_0x5f407d){while(--_0x5f407d){_0x19e6f0['push'](_0x19e6f0['shift']());}};_0x272ca8(++_0x3131b8);}(_0xd258,0x1c9));var _0x8d25=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd258[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require(_0x8d25('0x0'));var events=[_0x8d25('0x1'),_0x8d25('0x2'),_0x8d25('0x3')];function createListener(_0x166f8e,_0x154bc2){return function(_0x437a6a){_0x154bc2[_0x8d25('0x4')](_0x166f8e,_0x437a6a);};}function removeListener(_0x3368db,_0xa86170){return function(){WhatsappMessageEvents['removeListener'](_0x3368db,_0xa86170);};}exports[_0x8d25('0x5')]=function(_0x415649){for(var _0xe2d006=0x0,_0x1a2065=events[_0x8d25('0x6')];_0xe2d006<_0x1a2065;_0xe2d006++){var _0x2bf137=events[_0xe2d006];var _0x3c3cc0=createListener(_0x8d25('0x7')+_0x2bf137,_0x415649);WhatsappMessageEvents['on'](_0x2bf137,_0x3c3cc0);}}; \ No newline at end of file +var _0x181d=['remove','update','emit','removeListener','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x181d,0x148));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require(_0xd181('0x0'));var events=['save',_0xd181('0x1'),_0xd181('0x2')];function createListener(_0x2fd164,_0x20ecbf){return function(_0x52df5f){_0x20ecbf[_0xd181('0x3')](_0x2fd164,_0x52df5f);};}function removeListener(_0x2d044f,_0x5024c9){return function(){WhatsappMessageEvents[_0xd181('0x4')](_0x2d044f,_0x5024c9);};}exports['register']=function(_0x4a67eb){for(var _0x4728c8=0x0,_0x1828d0=events[_0xd181('0x5')];_0x4728c8<_0x1828d0;_0x4728c8++){var _0x3aae27=events[_0x4728c8];var _0x5be048=createListener(_0xd181('0x6')+_0x3aae27,_0x4a67eb);WhatsappMessageEvents['on'](_0x3aae27,_0x5be048);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index cf63c39..bbf053e 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 _0x0434=['index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','destroy','delete','removeTeams','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated'];(function(_0x50eca0,_0x430259){var _0x5b075e=function(_0x296d61){while(--_0x296d61){_0x50eca0['push'](_0x50eca0['shift']());}};_0x5b075e(++_0x430259);}(_0x0434,0xa4));var _0x4043=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x0434[_0x5b5cde];return _0x364ad2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4043('0x0'));var timeout=require(_0x4043('0x1'));var express=require('express');var router=express[_0x4043('0x2')]();var fs_extra=require(_0x4043('0x3'));var auth=require(_0x4043('0x4'));var interaction=require(_0x4043('0x5'));var config=require(_0x4043('0x6'));var controller=require(_0x4043('0x7'));router[_0x4043('0x8')]('/',auth[_0x4043('0x9')](),controller[_0x4043('0xa')]);router['get']('/describe',auth[_0x4043('0x9')](),controller[_0x4043('0xb')]);router[_0x4043('0x8')](_0x4043('0xc'),auth[_0x4043('0x9')](),controller[_0x4043('0xd')]);router[_0x4043('0x8')](_0x4043('0xe'),auth['isAuthenticated'](),controller[_0x4043('0xf')]);router[_0x4043('0x8')](_0x4043('0x10'),auth[_0x4043('0x9')](),controller[_0x4043('0x11')]);router[_0x4043('0x8')](_0x4043('0x12'),auth[_0x4043('0x9')](),controller[_0x4043('0x13')]);router[_0x4043('0x14')]('/',auth[_0x4043('0x9')](),controller[_0x4043('0x15')]);router[_0x4043('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4043('0x16')]);router[_0x4043('0x14')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x4043('0x17')](_0x4043('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4043('0x18')]);router[_0x4043('0x19')](_0x4043('0x10'),auth['isAuthenticated'](),controller[_0x4043('0x1a')]);router[_0x4043('0x19')](_0x4043('0x12'),auth[_0x4043('0x9')](),controller[_0x4043('0x1b')]);module[_0x4043('0x1c')]=router; \ No newline at end of file +var _0x07cb=['/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x07cb,0x149));var _0xb07c=function(_0x330ff0,_0x146528){_0x330ff0=_0x330ff0-0x0;var _0x215472=_0x07cb[_0x330ff0];return _0x215472;};'use strict';var multer=require(_0xb07c('0x0'));var util=require(_0xb07c('0x1'));var path=require('path');var timeout=require(_0xb07c('0x2'));var express=require(_0xb07c('0x3'));var router=express[_0xb07c('0x4')]();var fs_extra=require(_0xb07c('0x5'));var auth=require(_0xb07c('0x6'));var interaction=require(_0xb07c('0x7'));var config=require(_0xb07c('0x8'));var controller=require(_0xb07c('0x9'));router[_0xb07c('0xa')]('/',auth['isAuthenticated'](),controller[_0xb07c('0xb')]);router['get'](_0xb07c('0xc'),auth[_0xb07c('0xd')](),controller[_0xb07c('0xe')]);router['get'](_0xb07c('0xf'),auth[_0xb07c('0xd')](),controller['show']);router[_0xb07c('0xa')](_0xb07c('0x10'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x11')]);router[_0xb07c('0xa')](_0xb07c('0x12'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x13')]);router['get']('/:id/users',auth[_0xb07c('0xd')](),controller[_0xb07c('0x14')]);router[_0xb07c('0x15')]('/',auth[_0xb07c('0xd')](),controller[_0xb07c('0x16')]);router['post'](_0xb07c('0x12'),auth['isAuthenticated'](),controller[_0xb07c('0x17')]);router[_0xb07c('0x15')](_0xb07c('0x18'),auth['isAuthenticated'](),controller[_0xb07c('0x19')]);router[_0xb07c('0x1a')](_0xb07c('0xf'),auth[_0xb07c('0xd')](),controller['update']);router[_0xb07c('0x1b')](_0xb07c('0xf'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x1c')]);router[_0xb07c('0x1b')](_0xb07c('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xb07c('0x1b')](_0xb07c('0x18'),auth[_0xb07c('0xd')](),controller[_0xb07c('0x1d')]);module[_0xb07c('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 3984273..cf28154 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 _0xe600=['STRING','exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x23d3eb,_0x3f42da){var _0x45a1b7=function(_0x4fd8d7){while(--_0x4fd8d7){_0x23d3eb['push'](_0x23d3eb['shift']());}};_0x45a1b7(++_0x3f42da);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x0e60('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0e60('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0e60('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e60('0x3')](_0x0e60('0x4'),_0x0e60('0x5'),_0x0e60('0x6'))},'description':{'type':Sequelize[_0x0e60('0x7')]}}; \ No newline at end of file +var _0x342b=['sequelize','STRING','name','INTEGER'];(function(_0x12a62c,_0xc9c41a){var _0x268a58=function(_0x100ca9){while(--_0x100ca9){_0x12a62c['push'](_0x12a62c['shift']());}};_0x268a58(++_0xc9c41a);}(_0x342b,0xbc));var _0xb342=function(_0x4bb413,_0x1adc8d){_0x4bb413=_0x4bb413-0x0;var _0x2528d3=_0x342b[_0x4bb413];return _0x2528d3;};'use strict';var Sequelize=require(_0xb342('0x0'));module['exports']={'name':{'type':Sequelize[_0xb342('0x1')],'unique':_0xb342('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb342('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')},'description':{'type':Sequelize[_0xb342('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4aa7dbc..d6f12b5 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 _0x32ce=['Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','ids','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','redis','localhost','socket.io-emitter','register','sendStatus','status','end','limit','count','offset','set','json','update','then','destroy','get','WhatsappQueues','error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','where','WhatsappQueue','include','findAll','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','options','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','create','body','find','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','order','sort','pick','WhatsappQueueId','filter','merge','User','findAndCountAll','UserId','whatsappPause','createdAt','rows','format','%s/%s','SIP','getTeams','Team','nolimit'];(function(_0x1d6570,_0x36279b){var _0x549160=function(_0x3ce7fb){while(--_0x3ce7fb){_0x1d6570['push'](_0x1d6570['shift']());}};_0x549160(++_0x36279b);}(_0x32ce,0x18c));var _0xe32c=function(_0x1bf44a,_0x1e484a){_0x1bf44a=_0x1bf44a-0x0;var _0x40a303=_0x32ce[_0x1bf44a];return _0x40a303;};'use strict';var BPromise=require('bluebird');var util=require(_0xe32c('0x0'));var _=require('lodash');var squel=require(_0xe32c('0x1'));var Redis=require(_0xe32c('0x2'));var qs=require(_0xe32c('0x3'));var logger=require(_0xe32c('0x4'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xe32c('0x5')],{'host':_0xe32c('0x6'),'port':0x18eb});var socket=require(_0xe32c('0x7'))(new Redis(config[_0xe32c('0x5')]));require('./whatsappQueue.socket')[_0xe32c('0x8')](socket);function respondWithStatusCode(_0x16a110,_0x197862){_0x197862=_0x197862||0xcc;return function(_0x49efc9){if(_0x49efc9){return _0x16a110[_0xe32c('0x9')](_0x197862);}return _0x16a110[_0xe32c('0xa')](_0x197862)[_0xe32c('0xb')]();};}function respondWithResult(_0x410d36,_0x4364b0){_0x4364b0=_0x4364b0||0xc8;return function(_0x13f61f){if(_0x13f61f){return _0x410d36[_0xe32c('0xa')](_0x4364b0)['json'](_0x13f61f);}};}function respondWithFilteredResult(_0x544c2e,_0x897d1b){return function(_0x48c9e0){if(_0x48c9e0){var _0x329f5d=typeof _0x897d1b['offset']==='undefined'&&typeof _0x897d1b[_0xe32c('0xc')]==='undefined';var _0xfd43f4=_0x48c9e0[_0xe32c('0xd')];var _0x1fcea4=_0x329f5d?0x0:_0x897d1b[_0xe32c('0xe')];var _0x3e6fb7=_0x329f5d?_0x48c9e0[_0xe32c('0xd')]:_0x897d1b[_0xe32c('0xe')]+_0x897d1b[_0xe32c('0xc')];var _0x284904;if(_0x3e6fb7>=_0xfd43f4){_0x3e6fb7=_0xfd43f4;_0x284904=0xc8;}else{_0x284904=0xce;}_0x544c2e[_0xe32c('0xa')](_0x284904);return _0x544c2e[_0xe32c('0xf')]('Content-Range',_0x1fcea4+'-'+_0x3e6fb7+'/'+_0xfd43f4)[_0xe32c('0x10')](_0x48c9e0);}return null;};}function saveUpdates(_0x5119f4){return function(_0x5555b3){if(_0x5555b3){return _0x5555b3[_0xe32c('0x11')](_0x5119f4)[_0xe32c('0x12')](function(_0x19c4ee){return _0x19c4ee;});}return null;};}function removeEntity(_0x3fafa3){return function(_0x5bf6f3){if(_0x5bf6f3){return _0x5bf6f3[_0xe32c('0x13')]()[_0xe32c('0x12')](function(){var _0x563508=_0x5bf6f3[_0xe32c('0x14')]({'plain':!![]});var _0x5b6207=_0xe32c('0x15');return db['UserProfileResource'][_0xe32c('0x13')]({'where':{'type':_0x5b6207,'resourceId':_0x563508['id']}})[_0xe32c('0x12')](function(){return _0x5bf6f3;});})['then'](function(){_0x3fafa3[_0xe32c('0xa')](0xcc)[_0xe32c('0xb')]();});}};}function handleEntityNotFound(_0x3330be){return function(_0x592e45){if(!_0x592e45){_0x3330be[_0xe32c('0x9')](0x194);}return _0x592e45;};}function handleError(_0x400d77,_0x227792){_0x227792=_0x227792||0x1f4;return function(_0x2c876c){logger[_0xe32c('0x16')](_0x2c876c[_0xe32c('0x17')]);if(_0x2c876c[_0xe32c('0x18')]){delete _0x2c876c[_0xe32c('0x18')];}_0x400d77[_0xe32c('0xa')](_0x227792)['send'](_0x2c876c);};}exports[_0xe32c('0x19')]=function(_0x394327,_0x429dff){var _0xb01ab9={};var _0x514223={'count':0x0,'rows':[]};var _0x210586=_[_0xe32c('0x1a')](db['WhatsappQueue'][_0xe32c('0x1b')],function(_0x3b7143){return{'name':_0x3b7143[_0xe32c('0x1c')],'type':_0x3b7143[_0xe32c('0x1d')][_0xe32c('0x1e')]};});_0xb01ab9=qs[_0xe32c('0x1f')](_0x210586,_0x394327);var _0x5d8a4e={'where':_0xb01ab9[_0xe32c('0x20')]};return db[_0xe32c('0x21')][_0xe32c('0xd')](_0x5d8a4e)[_0xe32c('0x12')](function(_0x13d482){_0x514223[_0xe32c('0xd')]=_0x13d482;_0xb01ab9[_0xe32c('0x22')]=qs[_0xe32c('0x22')](_0x394327['query']);return db[_0xe32c('0x21')][_0xe32c('0x23')](_0xb01ab9);})['then'](function(_0x5c7c3c){_0x514223['rows']=_0x5c7c3c;return _0x514223;})[_0xe32c('0x12')](respondWithFilteredResult(_0x429dff,_0xb01ab9))['catch'](handleError(_0x429dff,null));};exports[_0xe32c('0x24')]=function(_0x458e46,_0x232c93){var _0x23d1d4={'raw':!![],'where':{'id':_0x458e46[_0xe32c('0x25')]['id']}},_0x25eb5b={};_0x25eb5b[_0xe32c('0x26')]=_[_0xe32c('0x27')](db[_0xe32c('0x21')][_0xe32c('0x1b')]);_0x25eb5b['query']=_[_0xe32c('0x27')](_0x458e46[_0xe32c('0x28')]);_0x25eb5b[_0xe32c('0x29')]=_[_0xe32c('0x2a')](_0x25eb5b[_0xe32c('0x26')],_0x25eb5b[_0xe32c('0x28')]);_0x23d1d4[_0xe32c('0x2b')]=_[_0xe32c('0x2a')](_0x25eb5b[_0xe32c('0x26')],qs[_0xe32c('0x2c')](_0x458e46[_0xe32c('0x28')][_0xe32c('0x2c')]));_0x23d1d4[_0xe32c('0x2b')]=_0x23d1d4[_0xe32c('0x2b')][_0xe32c('0x2d')]?_0x23d1d4[_0xe32c('0x2b')]:_0x25eb5b[_0xe32c('0x26')];if(_0x458e46[_0xe32c('0x28')][_0xe32c('0x2e')]){_0x23d1d4[_0xe32c('0x22')]=[{'all':!![]}];}_0x23d1d4=_['merge']({},_0x23d1d4,_0x458e46[_0xe32c('0x2f')]);return db[_0xe32c('0x21')]['find'](_0x23d1d4)[_0xe32c('0x12')](handleEntityNotFound(_0x232c93,null))[_0xe32c('0x12')](respondWithResult(_0x232c93,null))[_0xe32c('0x30')](handleError(_0x232c93,null));};exports['create']=function(_0x3e5674,_0x2ae7ef){return db[_0xe32c('0x21')]['create'](_0x3e5674['body'],{})['then'](function(_0x9ef102){var _0x152e7c=_0x3e5674[_0xe32c('0x31')][_0xe32c('0x14')]({'plain':!![]});if(!_0x152e7c)throw new Error(_0xe32c('0x32'));if(_0x152e7c['role']===_0xe32c('0x31')){var _0x336b87=_0x9ef102[_0xe32c('0x14')]({'plain':!![]});var _0x4fcd4c=_0xe32c('0x15');return db[_0xe32c('0x33')]['find']({'where':{'name':_0x4fcd4c,'userProfileId':_0x152e7c['userProfileId']},'raw':!![]})[_0xe32c('0x12')](function(_0x1be36a){if(_0x1be36a&&_0x1be36a[_0xe32c('0x34')]===0x0){return db[_0xe32c('0x35')][_0xe32c('0x36')]({'name':_0x336b87['name'],'resourceId':_0x336b87['id'],'type':_0x1be36a[_0xe32c('0x18')],'sectionId':_0x1be36a['id']},{})[_0xe32c('0x12')](function(){return _0x9ef102;});}else{return _0x9ef102;}})[_0xe32c('0x30')](function(_0x1e6323){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e6323);throw _0x1e6323;});}return _0x9ef102;})[_0xe32c('0x12')](respondWithResult(_0x2ae7ef,0xc9))[_0xe32c('0x30')](handleError(_0x2ae7ef,null));};exports[_0xe32c('0x11')]=function(_0x3969f6,_0x226bee){if(_0x3969f6[_0xe32c('0x37')]['id']){delete _0x3969f6[_0xe32c('0x37')]['id'];}return db[_0xe32c('0x21')][_0xe32c('0x38')]({'where':{'id':_0x3969f6[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0x226bee,null))[_0xe32c('0x12')](saveUpdates(_0x3969f6[_0xe32c('0x37')],null))[_0xe32c('0x12')](respondWithResult(_0x226bee,null))[_0xe32c('0x30')](handleError(_0x226bee,null));};exports[_0xe32c('0x13')]=function(_0xb25afd,_0x527883){return db['WhatsappQueue']['find']({'where':{'id':_0xb25afd[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0x527883,null))[_0xe32c('0x12')](removeEntity(_0x527883,null))[_0xe32c('0x30')](handleError(_0x527883,null));};exports[_0xe32c('0x39')]=function(_0x254d75,_0x416d9a){return db[_0xe32c('0x21')][_0xe32c('0x39')]()['then'](respondWithResult(_0x416d9a,null))[_0xe32c('0x30')](handleError(_0x416d9a,null));};exports[_0xe32c('0x3a')]=function(_0x32a583,_0x24c495){var _0x1445d5={'raw':!![],'where':{}},_0x4a0641={},_0x5830dc;return db['WhatsappQueue'][_0xe32c('0x3b')]({'where':{'id':_0x32a583[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0x24c495,null))[_0xe32c('0x12')](function(_0xc75f5e){if(_0xc75f5e){_0x5830dc=_0xc75f5e[_0xe32c('0x14')]({'plain':!![]});_0x4a0641[_0xe32c('0x26')]=_[_0xe32c('0x27')](db[_0xe32c('0x3c')][_0xe32c('0x1b')]);_0x4a0641[_0xe32c('0x28')]=_[_0xe32c('0x27')](_0x32a583['query']);_0x4a0641[_0xe32c('0x29')]=_[_0xe32c('0x2a')](_0x4a0641[_0xe32c('0x26')],_0x4a0641[_0xe32c('0x28')]);_0x1445d5[_0xe32c('0x2b')]=_[_0xe32c('0x2a')](_0x4a0641[_0xe32c('0x26')],qs['fields'](_0x32a583[_0xe32c('0x28')][_0xe32c('0x2c')]));_0x1445d5['attributes']=_0x1445d5['attributes']['length']?_0x1445d5['attributes']:_0x4a0641[_0xe32c('0x26')];if(!_0x32a583['query'][_0xe32c('0x3d')]('nolimit')){_0x1445d5[_0xe32c('0xc')]=qs[_0xe32c('0xc')](_0x32a583[_0xe32c('0x28')]['limit']);_0x1445d5[_0xe32c('0xe')]=qs[_0xe32c('0xe')](_0x32a583[_0xe32c('0x28')][_0xe32c('0xe')]);}_0x1445d5[_0xe32c('0x3e')]=qs[_0xe32c('0x3f')](_0x32a583[_0xe32c('0x28')]['sort']);_0x1445d5[_0xe32c('0x20')]=qs[_0xe32c('0x29')](_[_0xe32c('0x40')](_0x32a583[_0xe32c('0x28')],_0x4a0641['filters']));_0x1445d5[_0xe32c('0x20')][_0xe32c('0x41')]=_0xc75f5e['id'];if(_0x32a583[_0xe32c('0x28')][_0xe32c('0x42')]){_0x1445d5[_0xe32c('0x20')]=_['merge'](_0x1445d5[_0xe32c('0x20')],{'$or':_[_0xe32c('0x1a')](_0x1445d5[_0xe32c('0x2b')],function(_0x3a6a71){var _0x1dce68={};_0x1dce68[_0x3a6a71]={'$like':'%'+_0x32a583[_0xe32c('0x28')]['filter']+'%'};return _0x1dce68;})});}_0x1445d5=_[_0xe32c('0x43')]({},_0x1445d5,_0x32a583[_0xe32c('0x2f')]);return db[_0xe32c('0x3c')]['findAll'](_0x1445d5);}})[_0xe32c('0x12')](function(_0x3caf55){if(_0x3caf55){return db[_0xe32c('0x44')][_0xe32c('0x45')]({'where':{'id':_[_0xe32c('0x1a')](_0x3caf55,_0xe32c('0x46')),'role':'agent'},'attributes':['id',_0xe32c('0x18'),_0xe32c('0x47'),'updatedAt',_0xe32c('0x48')]});}})['then'](function(_0x41f2b7){if(_0x41f2b7){return{'count':_0x41f2b7[_0xe32c('0xd')],'rows':_[_0xe32c('0x1a')](_0x41f2b7[_0xe32c('0x49')],function(_0x753ae5){return{'membername':_0x753ae5[_0xe32c('0x18')],'UserId':_0x753ae5['id'],'queue_name':_0x5830dc[_0xe32c('0x18')],'WhatsappQueueId':_0x5830dc['id'],'interface':util[_0xe32c('0x4a')](_0xe32c('0x4b'),_0xe32c('0x4c'),_0x753ae5[_0xe32c('0x18')]),'penalty':0x0,'paused':_0x753ae5[_0xe32c('0x47')],'createdAt':_0x753ae5[_0xe32c('0x48')],'updatedAt':_0x753ae5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe32c('0x12')](respondWithFilteredResult(_0x24c495,_0x1445d5))[_0xe32c('0x30')](handleError(_0x24c495,null));};exports[_0xe32c('0x4d')]=function(_0x366256,_0x4cbf8c){var _0x256c71={};var _0x3cf16d={};var _0x19bb6f;var _0x404086;return db[_0xe32c('0x21')]['findOne']({'where':{'id':_0x366256[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0x4cbf8c,null))[_0xe32c('0x12')](function(_0x3420af){if(_0x3420af){_0x19bb6f=_0x3420af;_0x3cf16d[_0xe32c('0x26')]=_[_0xe32c('0x27')](db[_0xe32c('0x4e')][_0xe32c('0x1b')]);_0x3cf16d[_0xe32c('0x28')]=_[_0xe32c('0x27')](_0x366256[_0xe32c('0x28')]);_0x3cf16d[_0xe32c('0x29')]=_['intersection'](_0x3cf16d[_0xe32c('0x26')],_0x3cf16d[_0xe32c('0x28')]);_0x256c71[_0xe32c('0x2b')]=_['intersection'](_0x3cf16d[_0xe32c('0x26')],qs[_0xe32c('0x2c')](_0x366256[_0xe32c('0x28')]['fields']));_0x256c71[_0xe32c('0x2b')]=_0x256c71['attributes'][_0xe32c('0x2d')]?_0x256c71['attributes']:_0x3cf16d[_0xe32c('0x26')];_0x256c71['order']=qs[_0xe32c('0x3f')](_0x366256[_0xe32c('0x28')][_0xe32c('0x3f')]);_0x256c71[_0xe32c('0x20')]=qs['filters'](_[_0xe32c('0x40')](_0x366256[_0xe32c('0x28')],_0x3cf16d['filters']));if(_0x366256[_0xe32c('0x28')]['filter']){_0x256c71[_0xe32c('0x20')]=_[_0xe32c('0x43')](_0x256c71[_0xe32c('0x20')],{'$or':_[_0xe32c('0x1a')](_0x256c71[_0xe32c('0x2b')],function(_0x4f511d){var _0x5c1257={};_0x5c1257[_0x4f511d]={'$like':'%'+_0x366256[_0xe32c('0x28')]['filter']+'%'};return _0x5c1257;})});}_0x256c71=_[_0xe32c('0x43')]({},_0x256c71,_0x366256[_0xe32c('0x2f')]);return _0x19bb6f[_0xe32c('0x4d')](_0x256c71);}})[_0xe32c('0x12')](function(_0x203684){if(_0x203684){_0x404086=_0x203684['length'];if(!_0x366256[_0xe32c('0x28')][_0xe32c('0x3d')](_0xe32c('0x4f'))){_0x256c71[_0xe32c('0xc')]=qs[_0xe32c('0xc')](_0x366256[_0xe32c('0x28')][_0xe32c('0xc')]);_0x256c71['offset']=qs['offset'](_0x366256[_0xe32c('0x28')][_0xe32c('0xe')]);}return _0x19bb6f[_0xe32c('0x4d')](_0x256c71);}})[_0xe32c('0x12')](function(_0x32c509){if(_0x32c509){return _0x32c509?{'count':_0x404086,'rows':_0x32c509}:null;}})[_0xe32c('0x12')](respondWithResult(_0x4cbf8c,null))[_0xe32c('0x30')](handleError(_0x4cbf8c,null));};exports['addTeams']=function(_0x3bc10a,_0x4ae7d6){var _0x9ee1fa=_0x3bc10a[_0xe32c('0x37')]['ids'];return db[_0xe32c('0x4e')]['findAll']({'where':{'id':_0x9ee1fa},'attributes':['id'],'include':[{'model':db[_0xe32c('0x44')],'as':_0xe32c('0x50'),'attributes':['id',_0xe32c('0x18'),_0xe32c('0x51'),_0xe32c('0x52'),_0xe32c('0x53')],'raw':!![]}]})[_0xe32c('0x12')](function(_0x1a0a41){if(_0x1a0a41){var _0x46e41f=_[_0xe32c('0x54')](_0x1a0a41,function(_0x26e9bd){var _0x14e846=_0x26e9bd[_0xe32c('0x14')]({'plain':!![]});return _0x14e846['Agents'];});return db[_0xe32c('0x21')][_0xe32c('0x38')]({'where':{'id':_0x3bc10a[_0xe32c('0x25')]['id']}})['then'](function(_0x32e050){return db[_0xe32c('0x55')]['transaction'](function(_0x45206e){return _0x32e050['addTeams'](_0x9ee1fa,{'transaction':_0x45206e})['then'](function(){return BPromise[_0xe32c('0x56')](_0x46e41f,function(_0x2cc21d){return db[_0xe32c('0x3c')][_0xe32c('0x57')]({'where':{'UserId':_0x2cc21d['id'],'WhatsappQueueId':_0x3bc10a[_0xe32c('0x25')]['id']},'transaction':_0x45206e});});})['then'](function(){_0x46e41f[_0xe32c('0x58')](function(_0x5b5fb4){socket['emit'](_0xe32c('0x59'),{'UserId':_0x5b5fb4['id'],'WhatsappQueueId':_0x32e050['id']});});});});});}})[_0xe32c('0x12')](respondWithStatusCode(_0x4ae7d6,null))[_0xe32c('0x30')](handleError(_0x4ae7d6,null));};exports[_0xe32c('0x5a')]=function(_0x216747,_0x22f3ae){return db['Team'][_0xe32c('0x23')]({'where':{'id':_0x216747[_0xe32c('0x28')][_0xe32c('0x5b')]},'attributes':['id'],'include':[{'model':db[_0xe32c('0x44')],'as':_0xe32c('0x50'),'attributes':['id'],'raw':!![]}]})[_0xe32c('0x12')](handleEntityNotFound(_0x22f3ae,null))[_0xe32c('0x12')](function(_0xe311cd){var _0x2a2546=_[_0xe32c('0x1a')](_0xe311cd,'id');var _0x31b8f9=[];var _0x3db307=[];var _0x171d68=squel['select']();_0x171d68['field'](_0xe32c('0x5c'))[_0xe32c('0x5d')](_0xe32c('0x5e'),'tq')[_0xe32c('0x5f')](_0xe32c('0x60'),'ut',_0xe32c('0x61'))[_0xe32c('0x20')](_0xe32c('0x62'),_0x216747[_0xe32c('0x25')]['id']);for(var _0x12777b=0x0;_0x12777b<_0xe311cd['length'];_0x12777b+=0x1){let _0x32e0bc=_0xe311cd[_0x12777b];for(var _0x4b471b=0x0;_0x4b471b<_0x32e0bc[_0xe32c('0x50')]['length'];_0x4b471b+=0x1){let _0x3069c8=_0x32e0bc[_0xe32c('0x50')][_0x4b471b];var _0x248575=_0x171d68['clone']();_0x248575[_0xe32c('0x20')](_0xe32c('0x63'),_0x3069c8['id']);_0x3db307[_0xe32c('0x64')](db[_0xe32c('0x55')][_0xe32c('0x28')](_0x248575[_0xe32c('0x65')](),{'type':db[_0xe32c('0x55')]['QueryTypes']['SELECT']})['then'](function(_0x2f71c5){if(_0x2f71c5['length']===0x1){return _0x3069c8['id'];}else{var _0x26f2d3=_[_0xe32c('0x66')](_[_0xe32c('0x1a')](_0x2f71c5,_0xe32c('0x67')),function(_0x181eaa){return _[_0xe32c('0x68')](_0x2a2546,_0x181eaa);});if(_0x26f2d3){return _0x3069c8['id'];}}}));}}return BPromise[_0xe32c('0x69')](_0x3db307)[_0xe32c('0x12')](function(_0x1bcef4){_0x31b8f9=_(_0x31b8f9)[_0xe32c('0x6a')](_0x1bcef4)[_0xe32c('0x6b')]()[_0xe32c('0x6c')]();return db['WhatsappQueue']['find']({'where':{'id':_0x216747[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](function(_0x2098d4){return db[_0xe32c('0x55')][_0xe32c('0x6d')](function(_0x499417){return _0x2098d4[_0xe32c('0x5a')](_0x216747[_0xe32c('0x28')][_0xe32c('0x5b')],{'transaction':_0x499417})[_0xe32c('0x12')](function(){if(!_[_0xe32c('0x6e')](_0x31b8f9)){return _0x2098d4[_0xe32c('0x6f')](_0x31b8f9,{'transaction':_0x499417});}})[_0xe32c('0x12')](function(){_0x31b8f9[_0xe32c('0x58')](function(_0x5a561a){socket[_0xe32c('0x70')](_0xe32c('0x71'),{'UserId':_0x5a561a,'WhatsappQueueId':_0x2098d4['id']});});});});});});})[_0xe32c('0x12')](respondWithStatusCode(_0x22f3ae,null))[_0xe32c('0x30')](handleError(_0x22f3ae,null));};exports[_0xe32c('0x72')]=function(_0x14b747,_0x7ccac9){return db[_0xe32c('0x21')]['find']({'where':{'id':_0x14b747['params']['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0x7ccac9,null))[_0xe32c('0x12')](function(_0x385e1e){if(_0x385e1e){return _0x385e1e[_0xe32c('0x72')](_0x14b747['body'][_0xe32c('0x5b')],_[_0xe32c('0x73')](_0x14b747[_0xe32c('0x37')],[_0xe32c('0x5b'),'id'])||{})[_0xe32c('0x74')](function(_0xf0c61){for(var _0x3eadde=0x0;_0x3eadde<_0x14b747[_0xe32c('0x37')]['ids'][_0xe32c('0x2d')];_0x3eadde+=0x1){socket['emit'](_0xe32c('0x59'),{'UserId':Number(_0x14b747[_0xe32c('0x37')][_0xe32c('0x5b')][_0x3eadde]),'WhatsappQueueId':Number(_0x14b747[_0xe32c('0x25')]['id'])});}return _0xf0c61;});}})[_0xe32c('0x12')](respondWithResult(_0x7ccac9,null))[_0xe32c('0x30')](handleError(_0x7ccac9,null));};exports[_0xe32c('0x6f')]=function(_0x30b21a,_0x28f5c7){return db['WhatsappQueue'][_0xe32c('0x38')]({'where':{'id':_0x30b21a[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0x28f5c7,null))[_0xe32c('0x12')](function(_0x2ba867){if(_0x2ba867){return _0x2ba867[_0xe32c('0x6f')](_0x30b21a[_0xe32c('0x28')][_0xe32c('0x5b')])['then'](function(){if(_[_0xe32c('0x75')](_0x30b21a[_0xe32c('0x28')][_0xe32c('0x5b')])){for(var _0x2997fa=0x0;_0x2997fa<_0x30b21a[_0xe32c('0x28')]['ids'][_0xe32c('0x2d')];_0x2997fa+=0x1){socket[_0xe32c('0x70')](_0xe32c('0x71'),{'UserId':Number(_0x30b21a[_0xe32c('0x28')][_0xe32c('0x5b')][_0x2997fa]),'WhatsappQueueId':Number(_0x30b21a[_0xe32c('0x25')]['id'])});}}else{socket[_0xe32c('0x70')](_0xe32c('0x71'),{'UserId':Number(_0x30b21a[_0xe32c('0x28')][_0xe32c('0x5b')]),'WhatsappQueueId':Number(_0x30b21a[_0xe32c('0x25')]['id'])});}});}})[_0xe32c('0x12')](respondWithStatusCode(_0x28f5c7,null))[_0xe32c('0x30')](handleError(_0x28f5c7,null));};exports[_0xe32c('0x76')]=function(_0x14ee87,_0xe59bc4){var _0x38b705={};var _0x20e4f8={};var _0x4ec186;var _0x2683e0;return db[_0xe32c('0x21')][_0xe32c('0x3b')]({'where':{'id':_0x14ee87[_0xe32c('0x25')]['id']}})[_0xe32c('0x12')](handleEntityNotFound(_0xe59bc4,null))[_0xe32c('0x12')](function(_0x33b462){if(_0x33b462){_0x4ec186=_0x33b462;_0x20e4f8['model']=_[_0xe32c('0x27')](db[_0xe32c('0x44')][_0xe32c('0x1b')]);_0x20e4f8['query']=_[_0xe32c('0x27')](_0x14ee87['query']);_0x20e4f8[_0xe32c('0x29')]=_[_0xe32c('0x2a')](_0x20e4f8[_0xe32c('0x26')],_0x20e4f8[_0xe32c('0x28')]);_0x38b705[_0xe32c('0x2b')]=_['intersection'](_0x20e4f8[_0xe32c('0x26')],qs[_0xe32c('0x2c')](_0x14ee87[_0xe32c('0x28')]['fields']));_0x38b705[_0xe32c('0x2b')]=_0x38b705['attributes'][_0xe32c('0x2d')]?_0x38b705['attributes']:_0x20e4f8['model'];_0x38b705['order']=qs[_0xe32c('0x3f')](_0x14ee87['query']['sort']);_0x38b705[_0xe32c('0x20')]=qs[_0xe32c('0x29')](_[_0xe32c('0x40')](_0x14ee87[_0xe32c('0x28')],_0x20e4f8['filters']));if(_0x14ee87['query'][_0xe32c('0x42')]){_0x38b705[_0xe32c('0x20')]=_[_0xe32c('0x43')](_0x38b705[_0xe32c('0x20')],{'$or':_[_0xe32c('0x1a')](_0x38b705[_0xe32c('0x2b')],function(_0xc384e0){var _0x23fe27={};_0x23fe27[_0xc384e0]={'$like':'%'+_0x14ee87[_0xe32c('0x28')][_0xe32c('0x42')]+'%'};return _0x23fe27;})});}_0x38b705=_[_0xe32c('0x43')]({},_0x38b705,_0x14ee87['options']);return _0x4ec186[_0xe32c('0x76')](_0x38b705);}})[_0xe32c('0x12')](function(_0x5e705e){if(_0x5e705e){_0x2683e0=_0x5e705e[_0xe32c('0x2d')];if(!_0x14ee87[_0xe32c('0x28')][_0xe32c('0x3d')](_0xe32c('0x4f'))){_0x38b705['limit']=qs['limit'](_0x14ee87[_0xe32c('0x28')][_0xe32c('0xc')]);_0x38b705['offset']=qs[_0xe32c('0xe')](_0x14ee87[_0xe32c('0x28')][_0xe32c('0xe')]);}return _0x4ec186[_0xe32c('0x76')](_0x38b705);}})['then'](function(_0x54818a){if(_0x54818a){return _0x54818a?{'count':_0x2683e0,'rows':_0x54818a}:null;}})['then'](respondWithResult(_0xe59bc4,null))['catch'](handleError(_0xe59bc4,null));}; \ No newline at end of file +var _0xf1c9=['show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','getMembers','findOne','hasOwnProperty','order','sort','WhatsappQueueId','filter','UserWhatsappQueue','findAll','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','SIP','createdAt','Team','pick','options','getTeams','nolimit','addTeams','User','Agents','online','voicePause','flatMap','sequelize','each','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','where','include','query','rows','catch'];(function(_0x3db453,_0x18a04f){var _0x25e68e=function(_0x559f48){while(--_0x559f48){_0x3db453['push'](_0x3db453['shift']());}};_0x25e68e(++_0x18a04f);}(_0xf1c9,0x1c9));var _0x9f1c=function(_0x44ec36,_0x296ad2){_0x44ec36=_0x44ec36-0x0;var _0x22976e=_0xf1c9[_0x44ec36];return _0x22976e;};'use strict';var BPromise=require(_0x9f1c('0x0'));var util=require(_0x9f1c('0x1'));var _=require(_0x9f1c('0x2'));var squel=require(_0x9f1c('0x3'));var Redis=require(_0x9f1c('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x9f1c('0x5'))(_0x9f1c('0x6'));var config=require(_0x9f1c('0x7'));var db=require(_0x9f1c('0x8'))['db'];config[_0x9f1c('0x9')]=_[_0x9f1c('0xa')](config[_0x9f1c('0x9')],{'host':_0x9f1c('0xb'),'port':0x18eb});var socket=require(_0x9f1c('0xc'))(new Redis(config[_0x9f1c('0x9')]));require(_0x9f1c('0xd'))[_0x9f1c('0xe')](socket);function respondWithStatusCode(_0x388848,_0x155a00){_0x155a00=_0x155a00||0xcc;return function(_0x3af1b1){if(_0x3af1b1){return _0x388848[_0x9f1c('0xf')](_0x155a00);}return _0x388848[_0x9f1c('0x10')](_0x155a00)[_0x9f1c('0x11')]();};}function respondWithResult(_0xf9dc3d,_0x4f24fc){_0x4f24fc=_0x4f24fc||0xc8;return function(_0x126a43){if(_0x126a43){return _0xf9dc3d[_0x9f1c('0x10')](_0x4f24fc)[_0x9f1c('0x12')](_0x126a43);}};}function respondWithFilteredResult(_0x2daf78,_0x2a9669){return function(_0x2a3ad0){if(_0x2a3ad0){var _0x5653a1=typeof _0x2a9669[_0x9f1c('0x13')]===_0x9f1c('0x14')&&typeof _0x2a9669['limit']===_0x9f1c('0x14');var _0x47aab9=_0x2a3ad0[_0x9f1c('0x15')];var _0x556662=_0x5653a1?0x0:_0x2a9669['offset'];var _0x17357b=_0x5653a1?_0x2a3ad0[_0x9f1c('0x15')]:_0x2a9669[_0x9f1c('0x13')]+_0x2a9669[_0x9f1c('0x16')];var _0x618160;if(_0x17357b>=_0x47aab9){_0x17357b=_0x47aab9;_0x618160=0xc8;}else{_0x618160=0xce;}_0x2daf78[_0x9f1c('0x10')](_0x618160);return _0x2daf78[_0x9f1c('0x17')](_0x9f1c('0x18'),_0x556662+'-'+_0x17357b+'/'+_0x47aab9)[_0x9f1c('0x12')](_0x2a3ad0);}return null;};}function saveUpdates(_0x24af19){return function(_0x4528a9){if(_0x4528a9){return _0x4528a9[_0x9f1c('0x19')](_0x24af19)[_0x9f1c('0x1a')](function(_0x383be8){return _0x383be8;});}return null;};}function removeEntity(_0x3dfc53){return function(_0x1f367c){if(_0x1f367c){return _0x1f367c['destroy']()[_0x9f1c('0x1a')](function(){var _0x695c7d=_0x1f367c[_0x9f1c('0x1b')]({'plain':!![]});var _0x2ce630=_0x9f1c('0x1c');return db[_0x9f1c('0x1d')][_0x9f1c('0x1e')]({'where':{'type':_0x2ce630,'resourceId':_0x695c7d['id']}})[_0x9f1c('0x1a')](function(){return _0x1f367c;});})[_0x9f1c('0x1a')](function(){_0x3dfc53[_0x9f1c('0x10')](0xcc)[_0x9f1c('0x11')]();});}};}function handleEntityNotFound(_0x26b871){return function(_0x74e786){if(!_0x74e786){_0x26b871[_0x9f1c('0xf')](0x194);}return _0x74e786;};}function handleError(_0x54bc51,_0x53ccf2){_0x53ccf2=_0x53ccf2||0x1f4;return function(_0x4d6759){logger[_0x9f1c('0x1f')](_0x4d6759[_0x9f1c('0x20')]);if(_0x4d6759[_0x9f1c('0x21')]){delete _0x4d6759[_0x9f1c('0x21')];}_0x54bc51[_0x9f1c('0x10')](_0x53ccf2)[_0x9f1c('0x22')](_0x4d6759);};}exports[_0x9f1c('0x23')]=function(_0x375b28,_0x46c3b2){var _0xa13bdf={};var _0xbc341b={'count':0x0,'rows':[]};var _0x49197d=_[_0x9f1c('0x24')](db[_0x9f1c('0x25')][_0x9f1c('0x26')],function(_0x3a4592){return{'name':_0x3a4592[_0x9f1c('0x27')],'type':_0x3a4592[_0x9f1c('0x28')][_0x9f1c('0x29')]};});_0xa13bdf=qs['getOptions'](_0x49197d,_0x375b28);var _0x358fe9={'where':_0xa13bdf[_0x9f1c('0x2a')]};return db['WhatsappQueue'][_0x9f1c('0x15')](_0x358fe9)[_0x9f1c('0x1a')](function(_0x2f96f5){_0xbc341b[_0x9f1c('0x15')]=_0x2f96f5;_0xa13bdf[_0x9f1c('0x2b')]=qs[_0x9f1c('0x2b')](_0x375b28[_0x9f1c('0x2c')]);return db['WhatsappQueue']['findAll'](_0xa13bdf);})[_0x9f1c('0x1a')](function(_0x194383){_0xbc341b[_0x9f1c('0x2d')]=_0x194383;return _0xbc341b;})[_0x9f1c('0x1a')](respondWithFilteredResult(_0x46c3b2,_0xa13bdf))[_0x9f1c('0x2e')](handleError(_0x46c3b2,null));};exports[_0x9f1c('0x2f')]=function(_0x51e47b,_0x299de0){var _0x525816={'raw':!![],'where':{'id':_0x51e47b[_0x9f1c('0x30')]['id']}},_0x4dec34={};_0x4dec34[_0x9f1c('0x31')]=_[_0x9f1c('0x32')](db['WhatsappQueue'][_0x9f1c('0x26')]);_0x4dec34[_0x9f1c('0x2c')]=_[_0x9f1c('0x32')](_0x51e47b[_0x9f1c('0x2c')]);_0x4dec34[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0x4dec34[_0x9f1c('0x31')],_0x4dec34['query']);_0x525816[_0x9f1c('0x35')]=_['intersection'](_0x4dec34['model'],qs['fields'](_0x51e47b['query'][_0x9f1c('0x36')]));_0x525816['attributes']=_0x525816[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x525816['attributes']:_0x4dec34[_0x9f1c('0x31')];if(_0x51e47b['query'][_0x9f1c('0x38')]){_0x525816['include']=[{'all':!![]}];}_0x525816=_[_0x9f1c('0x39')]({},_0x525816,_0x51e47b['options']);return db[_0x9f1c('0x25')][_0x9f1c('0x3a')](_0x525816)[_0x9f1c('0x1a')](handleEntityNotFound(_0x299de0,null))[_0x9f1c('0x1a')](respondWithResult(_0x299de0,null))[_0x9f1c('0x2e')](handleError(_0x299de0,null));};exports['create']=function(_0x292dfb,_0xda3056){return db[_0x9f1c('0x25')][_0x9f1c('0x3b')](_0x292dfb[_0x9f1c('0x3c')],{})[_0x9f1c('0x1a')](function(_0x4fc81b){var _0x50ec1f=_0x292dfb[_0x9f1c('0x3d')]['get']({'plain':!![]});if(!_0x50ec1f)throw new Error(_0x9f1c('0x3e'));if(_0x50ec1f['role']===_0x9f1c('0x3d')){var _0x229eed=_0x4fc81b['get']({'plain':!![]});var _0x2b2a67=_0x9f1c('0x1c');return db[_0x9f1c('0x3f')][_0x9f1c('0x3a')]({'where':{'name':_0x2b2a67,'userProfileId':_0x50ec1f[_0x9f1c('0x40')]},'raw':!![]})[_0x9f1c('0x1a')](function(_0x181270){if(_0x181270&&_0x181270['autoAssociation']===0x0){return db['UserProfileResource'][_0x9f1c('0x3b')]({'name':_0x229eed[_0x9f1c('0x21')],'resourceId':_0x229eed['id'],'type':_0x181270[_0x9f1c('0x21')],'sectionId':_0x181270['id']},{})[_0x9f1c('0x1a')](function(){return _0x4fc81b;});}else{return _0x4fc81b;}})[_0x9f1c('0x2e')](function(_0x14b3be){logger[_0x9f1c('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14b3be);throw _0x14b3be;});}return _0x4fc81b;})[_0x9f1c('0x1a')](respondWithResult(_0xda3056,0xc9))['catch'](handleError(_0xda3056,null));};exports[_0x9f1c('0x19')]=function(_0x20636e,_0x4c6bf6){if(_0x20636e[_0x9f1c('0x3c')]['id']){delete _0x20636e['body']['id'];}return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x20636e['params']['id']}})['then'](handleEntityNotFound(_0x4c6bf6,null))['then'](saveUpdates(_0x20636e['body'],null))['then'](respondWithResult(_0x4c6bf6,null))[_0x9f1c('0x2e')](handleError(_0x4c6bf6,null));};exports['destroy']=function(_0x45260f,_0x590e0e){return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x45260f[_0x9f1c('0x30')]['id']}})['then'](handleEntityNotFound(_0x590e0e,null))[_0x9f1c('0x1a')](removeEntity(_0x590e0e,null))[_0x9f1c('0x2e')](handleError(_0x590e0e,null));};exports[_0x9f1c('0x41')]=function(_0x3c1b44,_0x2dafa4){return db['WhatsappQueue']['describe']()[_0x9f1c('0x1a')](respondWithResult(_0x2dafa4,null))[_0x9f1c('0x2e')](handleError(_0x2dafa4,null));};exports[_0x9f1c('0x42')]=function(_0x18bfde,_0x2354e2){var _0x473065={'raw':!![],'where':{}},_0x39b0aa={},_0x8ac4ae;return db['WhatsappQueue'][_0x9f1c('0x43')]({'where':{'id':_0x18bfde[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x2354e2,null))[_0x9f1c('0x1a')](function(_0x309bf9){if(_0x309bf9){_0x8ac4ae=_0x309bf9[_0x9f1c('0x1b')]({'plain':!![]});_0x39b0aa[_0x9f1c('0x31')]=_[_0x9f1c('0x32')](db['UserWhatsappQueue'][_0x9f1c('0x26')]);_0x39b0aa['query']=_['keys'](_0x18bfde[_0x9f1c('0x2c')]);_0x39b0aa[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0x39b0aa[_0x9f1c('0x31')],_0x39b0aa[_0x9f1c('0x2c')]);_0x473065['attributes']=_['intersection'](_0x39b0aa[_0x9f1c('0x31')],qs['fields'](_0x18bfde['query'][_0x9f1c('0x36')]));_0x473065[_0x9f1c('0x35')]=_0x473065[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x473065[_0x9f1c('0x35')]:_0x39b0aa[_0x9f1c('0x31')];if(!_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x44')]('nolimit')){_0x473065[_0x9f1c('0x16')]=qs[_0x9f1c('0x16')](_0x18bfde[_0x9f1c('0x2c')]['limit']);_0x473065[_0x9f1c('0x13')]=qs[_0x9f1c('0x13')](_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x13')]);}_0x473065[_0x9f1c('0x45')]=qs['sort'](_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x46')]);_0x473065[_0x9f1c('0x2a')]=qs['filters'](_['pick'](_0x18bfde[_0x9f1c('0x2c')],_0x39b0aa[_0x9f1c('0x33')]));_0x473065[_0x9f1c('0x2a')][_0x9f1c('0x47')]=_0x309bf9['id'];if(_0x18bfde[_0x9f1c('0x2c')]['filter']){_0x473065['where']=_[_0x9f1c('0x39')](_0x473065[_0x9f1c('0x2a')],{'$or':_[_0x9f1c('0x24')](_0x473065[_0x9f1c('0x35')],function(_0x175ec9){var _0xf9587={};_0xf9587[_0x175ec9]={'$like':'%'+_0x18bfde[_0x9f1c('0x2c')][_0x9f1c('0x48')]+'%'};return _0xf9587;})});}_0x473065=_['merge']({},_0x473065,_0x18bfde['options']);return db[_0x9f1c('0x49')][_0x9f1c('0x4a')](_0x473065);}})[_0x9f1c('0x1a')](function(_0x1d7e7e){if(_0x1d7e7e){return db['User'][_0x9f1c('0x4b')]({'where':{'id':_[_0x9f1c('0x24')](_0x1d7e7e,_0x9f1c('0x4c')),'role':_0x9f1c('0x4d')},'attributes':['id','name',_0x9f1c('0x4e'),_0x9f1c('0x4f'),'createdAt']});}})[_0x9f1c('0x1a')](function(_0x32dbc2){if(_0x32dbc2){return{'count':_0x32dbc2[_0x9f1c('0x15')],'rows':_[_0x9f1c('0x24')](_0x32dbc2[_0x9f1c('0x2d')],function(_0x3d82cf){return{'membername':_0x3d82cf[_0x9f1c('0x21')],'UserId':_0x3d82cf['id'],'queue_name':_0x8ac4ae[_0x9f1c('0x21')],'WhatsappQueueId':_0x8ac4ae['id'],'interface':util[_0x9f1c('0x50')]('%s/%s',_0x9f1c('0x51'),_0x3d82cf[_0x9f1c('0x21')]),'penalty':0x0,'paused':_0x3d82cf[_0x9f1c('0x4e')],'createdAt':_0x3d82cf[_0x9f1c('0x52')],'updatedAt':_0x3d82cf[_0x9f1c('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f1c('0x1a')](respondWithFilteredResult(_0x2354e2,_0x473065))[_0x9f1c('0x2e')](handleError(_0x2354e2,null));};exports['getTeams']=function(_0x4eecca,_0x2a7ed5){var _0x51ba88={};var _0xb92ad4={};var _0x18b2f7;var _0x3d34d7;return db[_0x9f1c('0x25')][_0x9f1c('0x43')]({'where':{'id':_0x4eecca[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x2a7ed5,null))[_0x9f1c('0x1a')](function(_0x312615){if(_0x312615){_0x18b2f7=_0x312615;_0xb92ad4['model']=_['keys'](db[_0x9f1c('0x53')][_0x9f1c('0x26')]);_0xb92ad4['query']=_['keys'](_0x4eecca['query']);_0xb92ad4[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0xb92ad4['model'],_0xb92ad4['query']);_0x51ba88[_0x9f1c('0x35')]=_[_0x9f1c('0x34')](_0xb92ad4['model'],qs['fields'](_0x4eecca[_0x9f1c('0x2c')][_0x9f1c('0x36')]));_0x51ba88['attributes']=_0x51ba88[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x51ba88[_0x9f1c('0x35')]:_0xb92ad4[_0x9f1c('0x31')];_0x51ba88[_0x9f1c('0x45')]=qs[_0x9f1c('0x46')](_0x4eecca['query'][_0x9f1c('0x46')]);_0x51ba88[_0x9f1c('0x2a')]=qs[_0x9f1c('0x33')](_[_0x9f1c('0x54')](_0x4eecca[_0x9f1c('0x2c')],_0xb92ad4['filters']));if(_0x4eecca[_0x9f1c('0x2c')][_0x9f1c('0x48')]){_0x51ba88[_0x9f1c('0x2a')]=_['merge'](_0x51ba88[_0x9f1c('0x2a')],{'$or':_[_0x9f1c('0x24')](_0x51ba88[_0x9f1c('0x35')],function(_0x25cdc0){var _0xeef153={};_0xeef153[_0x25cdc0]={'$like':'%'+_0x4eecca[_0x9f1c('0x2c')]['filter']+'%'};return _0xeef153;})});}_0x51ba88=_[_0x9f1c('0x39')]({},_0x51ba88,_0x4eecca[_0x9f1c('0x55')]);return _0x18b2f7[_0x9f1c('0x56')](_0x51ba88);}})[_0x9f1c('0x1a')](function(_0xe5b409){if(_0xe5b409){_0x3d34d7=_0xe5b409[_0x9f1c('0x37')];if(!_0x4eecca[_0x9f1c('0x2c')]['hasOwnProperty'](_0x9f1c('0x57'))){_0x51ba88[_0x9f1c('0x16')]=qs[_0x9f1c('0x16')](_0x4eecca[_0x9f1c('0x2c')][_0x9f1c('0x16')]);_0x51ba88[_0x9f1c('0x13')]=qs[_0x9f1c('0x13')](_0x4eecca['query'][_0x9f1c('0x13')]);}return _0x18b2f7[_0x9f1c('0x56')](_0x51ba88);}})[_0x9f1c('0x1a')](function(_0x4cb04a){if(_0x4cb04a){return _0x4cb04a?{'count':_0x3d34d7,'rows':_0x4cb04a}:null;}})['then'](respondWithResult(_0x2a7ed5,null))[_0x9f1c('0x2e')](handleError(_0x2a7ed5,null));};exports[_0x9f1c('0x58')]=function(_0x4f6fca,_0x35a0bd){var _0x3062d3=_0x4f6fca[_0x9f1c('0x3c')]['ids'];return db[_0x9f1c('0x53')]['findAll']({'where':{'id':_0x3062d3},'attributes':['id'],'include':[{'model':db[_0x9f1c('0x59')],'as':_0x9f1c('0x5a'),'attributes':['id',_0x9f1c('0x21'),_0x9f1c('0x5b'),_0x9f1c('0x5c'),'interface'],'raw':!![]}]})[_0x9f1c('0x1a')](function(_0x35a1f8){if(_0x35a1f8){var _0x4d2855=_[_0x9f1c('0x5d')](_0x35a1f8,function(_0xbf8e1a){var _0x28abf5=_0xbf8e1a[_0x9f1c('0x1b')]({'plain':!![]});return _0x28abf5[_0x9f1c('0x5a')];});return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x4f6fca[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](function(_0x207692){return db[_0x9f1c('0x5e')]['transaction'](function(_0x3d3ac5){return _0x207692[_0x9f1c('0x58')](_0x3062d3,{'transaction':_0x3d3ac5})[_0x9f1c('0x1a')](function(){return BPromise[_0x9f1c('0x5f')](_0x4d2855,function(_0x44fcff){return db[_0x9f1c('0x49')]['findOrCreate']({'where':{'UserId':_0x44fcff['id'],'WhatsappQueueId':_0x4f6fca[_0x9f1c('0x30')]['id']},'transaction':_0x3d3ac5});});})[_0x9f1c('0x1a')](function(){_0x4d2855[_0x9f1c('0x60')](function(_0x59a6b8){socket[_0x9f1c('0x61')]('userWhatsappQueue:save',{'UserId':_0x59a6b8['id'],'WhatsappQueueId':_0x207692['id']});});});});});}})['then'](respondWithStatusCode(_0x35a0bd,null))['catch'](handleError(_0x35a0bd,null));};exports[_0x9f1c('0x62')]=function(_0x21885c,_0x3f75bd){return db['Team'][_0x9f1c('0x4a')]({'where':{'id':_0x21885c[_0x9f1c('0x2c')][_0x9f1c('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9f1c('0x1a')](handleEntityNotFound(_0x3f75bd,null))[_0x9f1c('0x1a')](function(_0x5a98e2){var _0x4185a4=_[_0x9f1c('0x24')](_0x5a98e2,'id');var _0x37be96=[];var _0x26e75f=[];var _0x99d8f2=squel[_0x9f1c('0x64')]();_0x99d8f2['field'](_0x9f1c('0x65'))[_0x9f1c('0x66')](_0x9f1c('0x67'),'tq')[_0x9f1c('0x68')]('user_has_teams','ut',_0x9f1c('0x69'))[_0x9f1c('0x2a')](_0x9f1c('0x6a'),_0x21885c[_0x9f1c('0x30')]['id']);for(var _0x1d7a1b=0x0;_0x1d7a1b<_0x5a98e2[_0x9f1c('0x37')];_0x1d7a1b+=0x1){let _0x2403c4=_0x5a98e2[_0x1d7a1b];for(var _0x443734=0x0;_0x443734<_0x2403c4['Agents'][_0x9f1c('0x37')];_0x443734+=0x1){let _0x517859=_0x2403c4['Agents'][_0x443734];var _0x3739db=_0x99d8f2['clone']();_0x3739db[_0x9f1c('0x2a')]('ut.UserId\x20=\x20?',_0x517859['id']);_0x26e75f['push'](db[_0x9f1c('0x5e')][_0x9f1c('0x2c')](_0x3739db[_0x9f1c('0x6b')](),{'type':db['sequelize'][_0x9f1c('0x6c')][_0x9f1c('0x6d')]})[_0x9f1c('0x1a')](function(_0x111107){if(_0x111107[_0x9f1c('0x37')]===0x1){return _0x517859['id'];}else{var _0x113cda=_[_0x9f1c('0x6e')](_['map'](_0x111107,_0x9f1c('0x6f')),function(_0x18dcac){return _[_0x9f1c('0x70')](_0x4185a4,_0x18dcac);});if(_0x113cda){return _0x517859['id'];}}}));}}return BPromise[_0x9f1c('0x71')](_0x26e75f)['then'](function(_0x374394){_0x37be96=_(_0x37be96)[_0x9f1c('0x72')](_0x374394)[_0x9f1c('0x73')]()[_0x9f1c('0x74')]();return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x21885c[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](function(_0x5a9e53){return db[_0x9f1c('0x5e')][_0x9f1c('0x75')](function(_0x14ce39){return _0x5a9e53[_0x9f1c('0x62')](_0x21885c[_0x9f1c('0x2c')][_0x9f1c('0x63')],{'transaction':_0x14ce39})[_0x9f1c('0x1a')](function(){if(!_[_0x9f1c('0x76')](_0x37be96)){return _0x5a9e53[_0x9f1c('0x77')](_0x37be96,{'transaction':_0x14ce39});}})[_0x9f1c('0x1a')](function(){_0x37be96[_0x9f1c('0x60')](function(_0x3063d1){socket[_0x9f1c('0x61')](_0x9f1c('0x78'),{'UserId':_0x3063d1,'WhatsappQueueId':_0x5a9e53['id']});});});});});});})['then'](respondWithStatusCode(_0x3f75bd,null))[_0x9f1c('0x2e')](handleError(_0x3f75bd,null));};exports[_0x9f1c('0x79')]=function(_0x2d0ca7,_0x527211){return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x2d0ca7[_0x9f1c('0x30')]['id']}})['then'](handleEntityNotFound(_0x527211,null))[_0x9f1c('0x1a')](function(_0x52563c){if(_0x52563c){return _0x52563c[_0x9f1c('0x79')](_0x2d0ca7[_0x9f1c('0x3c')][_0x9f1c('0x63')],_[_0x9f1c('0x7a')](_0x2d0ca7['body'],[_0x9f1c('0x63'),'id'])||{})[_0x9f1c('0x7b')](function(_0x2e25da){for(var _0x22b6ad=0x0;_0x22b6ad<_0x2d0ca7[_0x9f1c('0x3c')][_0x9f1c('0x63')][_0x9f1c('0x37')];_0x22b6ad+=0x1){socket[_0x9f1c('0x61')](_0x9f1c('0x7c'),{'UserId':Number(_0x2d0ca7[_0x9f1c('0x3c')][_0x9f1c('0x63')][_0x22b6ad]),'WhatsappQueueId':Number(_0x2d0ca7[_0x9f1c('0x30')]['id'])});}return _0x2e25da;});}})[_0x9f1c('0x1a')](respondWithResult(_0x527211,null))[_0x9f1c('0x2e')](handleError(_0x527211,null));};exports[_0x9f1c('0x77')]=function(_0x15aa3b,_0x50a9a1){return db[_0x9f1c('0x25')][_0x9f1c('0x3a')]({'where':{'id':_0x15aa3b[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x50a9a1,null))[_0x9f1c('0x1a')](function(_0x1ce741){if(_0x1ce741){return _0x1ce741[_0x9f1c('0x77')](_0x15aa3b[_0x9f1c('0x2c')][_0x9f1c('0x63')])['then'](function(){if(_[_0x9f1c('0x7d')](_0x15aa3b['query']['ids'])){for(var _0x43f24a=0x0;_0x43f24a<_0x15aa3b[_0x9f1c('0x2c')]['ids'][_0x9f1c('0x37')];_0x43f24a+=0x1){socket[_0x9f1c('0x61')](_0x9f1c('0x78'),{'UserId':Number(_0x15aa3b['query']['ids'][_0x43f24a]),'WhatsappQueueId':Number(_0x15aa3b[_0x9f1c('0x30')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x15aa3b[_0x9f1c('0x2c')][_0x9f1c('0x63')]),'WhatsappQueueId':Number(_0x15aa3b[_0x9f1c('0x30')]['id'])});}});}})['then'](respondWithStatusCode(_0x50a9a1,null))[_0x9f1c('0x2e')](handleError(_0x50a9a1,null));};exports['getAgents']=function(_0x2d5d69,_0x1acffb){var _0x5d29dc={};var _0x57ea09={};var _0x12e0c6;var _0x206691;return db[_0x9f1c('0x25')][_0x9f1c('0x43')]({'where':{'id':_0x2d5d69[_0x9f1c('0x30')]['id']}})[_0x9f1c('0x1a')](handleEntityNotFound(_0x1acffb,null))[_0x9f1c('0x1a')](function(_0x45b694){if(_0x45b694){_0x12e0c6=_0x45b694;_0x57ea09[_0x9f1c('0x31')]=_[_0x9f1c('0x32')](db[_0x9f1c('0x59')][_0x9f1c('0x26')]);_0x57ea09[_0x9f1c('0x2c')]=_[_0x9f1c('0x32')](_0x2d5d69[_0x9f1c('0x2c')]);_0x57ea09[_0x9f1c('0x33')]=_[_0x9f1c('0x34')](_0x57ea09[_0x9f1c('0x31')],_0x57ea09[_0x9f1c('0x2c')]);_0x5d29dc[_0x9f1c('0x35')]=_[_0x9f1c('0x34')](_0x57ea09['model'],qs[_0x9f1c('0x36')](_0x2d5d69[_0x9f1c('0x2c')][_0x9f1c('0x36')]));_0x5d29dc[_0x9f1c('0x35')]=_0x5d29dc[_0x9f1c('0x35')][_0x9f1c('0x37')]?_0x5d29dc[_0x9f1c('0x35')]:_0x57ea09[_0x9f1c('0x31')];_0x5d29dc[_0x9f1c('0x45')]=qs['sort'](_0x2d5d69[_0x9f1c('0x2c')][_0x9f1c('0x46')]);_0x5d29dc['where']=qs['filters'](_['pick'](_0x2d5d69[_0x9f1c('0x2c')],_0x57ea09[_0x9f1c('0x33')]));if(_0x2d5d69[_0x9f1c('0x2c')]['filter']){_0x5d29dc[_0x9f1c('0x2a')]=_[_0x9f1c('0x39')](_0x5d29dc[_0x9f1c('0x2a')],{'$or':_[_0x9f1c('0x24')](_0x5d29dc['attributes'],function(_0x158b19){var _0x514d5e={};_0x514d5e[_0x158b19]={'$like':'%'+_0x2d5d69[_0x9f1c('0x2c')][_0x9f1c('0x48')]+'%'};return _0x514d5e;})});}_0x5d29dc=_['merge']({},_0x5d29dc,_0x2d5d69[_0x9f1c('0x55')]);return _0x12e0c6['getAgents'](_0x5d29dc);}})[_0x9f1c('0x1a')](function(_0x4ae993){if(_0x4ae993){_0x206691=_0x4ae993[_0x9f1c('0x37')];if(!_0x2d5d69[_0x9f1c('0x2c')]['hasOwnProperty'](_0x9f1c('0x57'))){_0x5d29dc[_0x9f1c('0x16')]=qs['limit'](_0x2d5d69[_0x9f1c('0x2c')]['limit']);_0x5d29dc['offset']=qs['offset'](_0x2d5d69['query'][_0x9f1c('0x13')]);}return _0x12e0c6['getAgents'](_0x5d29dc);}})[_0x9f1c('0x1a')](function(_0x5c08af){if(_0x5c08af){return _0x5c08af?{'count':_0x206691,'rows':_0x5c08af}:null;}})['then'](respondWithResult(_0x1acffb,null))['catch'](handleError(_0x1acffb,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index bb21ce0..fb11b69 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 _0x4060=['../../mysqldb','save','update','remove','emit','hook','exports','events'];(function(_0x1e1336,_0x9df15b){var _0x17eb3d=function(_0x45ec7e){while(--_0x45ec7e){_0x1e1336['push'](_0x1e1336['shift']());}};_0x17eb3d(++_0x9df15b);}(_0x4060,0xe7));var _0x0406=function(_0x18b1d5,_0x23473c){_0x18b1d5=_0x18b1d5-0x0;var _0x38881e=_0x4060[_0x18b1d5];return _0x38881e;};'use strict';var EventEmitter=require(_0x0406('0x0'));var WhatsappQueue=require(_0x0406('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0406('0x2'),'afterUpdate':_0x0406('0x3'),'afterDestroy':_0x0406('0x4')};function emitEvent(_0x41d4fa){return function(_0x1fcefa,_0x2f1b94,_0x23ff12){WhatsappQueueEvents[_0x0406('0x5')](_0x41d4fa+':'+_0x1fcefa['id'],_0x1fcefa);WhatsappQueueEvents[_0x0406('0x5')](_0x41d4fa,_0x1fcefa);_0x23ff12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x0406('0x6')](e,emitEvent(event));}}module[_0x0406('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x497f=['events','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x497f,0xf3));var _0xf497=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x497f[_0x456bd2];return _0x2218c1;};'use strict';var EventEmitter=require(_0xf497('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xf497('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf497('0x2')](0x0);var events={'afterCreate':_0xf497('0x3'),'afterUpdate':_0xf497('0x4'),'afterDestroy':_0xf497('0x5')};function emitEvent(_0x89a19d){return function(_0x431f34,_0x4400cb,_0x19576c){WhatsappQueueEvents[_0xf497('0x6')](_0x89a19d+':'+_0x431f34['id'],_0x431f34);WhatsappQueueEvents[_0xf497('0x6')](_0x89a19d,_0x431f34);_0x19576c(null);};}for(var e in events){if(events[_0xf497('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xf497('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 76247f3..5d29060 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 _0xc9f4=['exports','define','whatsapp_queues','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x50bcee,_0x597d0b){var _0xf65db3=function(_0x106e5a){while(--_0x106e5a){_0x50bcee['push'](_0x50bcee['shift']());}};_0xf65db3(++_0x597d0b);}(_0xc9f4,0x116));var _0x4c9f=function(_0xdf14a2,_0x546150){_0xdf14a2=_0xdf14a2-0x0;var _0xa96409=_0xc9f4[_0xdf14a2];return _0xa96409;};'use strict';var _=require(_0x4c9f('0x0'));var util=require(_0x4c9f('0x1'));var logger=require(_0x4c9f('0x2'))('api');var moment=require(_0x4c9f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c9f('0x4'));var rimraf=require(_0x4c9f('0x5'));var config=require(_0x4c9f('0x6'));var attributes=require(_0x4c9f('0x7'));module[_0x4c9f('0x8')]=function(_0xbc96d1,_0x32deeb){return _0xbc96d1[_0x4c9f('0x9')]('WhatsappQueue',attributes,{'tableName':_0x4c9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ac1=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x3ac1,0x1e7));var _0x13ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x13ac('0x0'));var logger=require(_0x13ac('0x1'))(_0x13ac('0x2'));var moment=require(_0x13ac('0x3'));var BPromise=require(_0x13ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13ac('0x5'));var rimraf=require(_0x13ac('0x6'));var config=require(_0x13ac('0x7'));var attributes=require(_0x13ac('0x8'));module[_0x13ac('0x9')]=function(_0x509875,_0x3d1c05){return _0x509875['define'](_0x13ac('0xa'),attributes,{'tableName':_0x13ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 683e9b9..b656638 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 _0x2535=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','error','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowWhatsappQueue','find'];(function(_0x3cdf98,_0xda80f7){var _0xc3464b=function(_0x418fc4){while(--_0x418fc4){_0x3cdf98['push'](_0x3cdf98['shift']());}};_0xc3464b(++_0xda80f7);}(_0x2535,0xea));var _0x5253=function(_0x553ccc,_0x48c69c){_0x553ccc=_0x553ccc-0x0;var _0x372475=_0x2535[_0x553ccc];return _0x372475;};'use strict';var _=require(_0x5253('0x0'));var util=require(_0x5253('0x1'));var moment=require(_0x5253('0x2'));var BPromise=require(_0x5253('0x3'));var rs=require(_0x5253('0x4'));var fs=require('fs');var Redis=require(_0x5253('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5253('0x6'));var logger=require(_0x5253('0x7'))(_0x5253('0x8'));var config=require('../../config/environment');var jayson=require(_0x5253('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x5253('0xa')](config[_0x5253('0xb')],{'host':_0x5253('0xc'),'port':0x18eb});var socket=require(_0x5253('0xd'))(new Redis(config[_0x5253('0xb')]));require(_0x5253('0xe'))[_0x5253('0xf')](socket);function respondWithRpcPromise(_0x2614e9,_0x40a9b5,_0x29b35d){return new BPromise(function(_0x2305c9,_0x16b070){return client[_0x5253('0x10')](_0x2614e9,_0x29b35d)[_0x5253('0x11')](function(_0x311b05){logger[_0x5253('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x40a9b5,_0x5253('0x13'));logger[_0x5253('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x40a9b5,_0x5253('0x13'),JSON['stringify'](_0x311b05));if(_0x311b05[_0x5253('0x15')]){if(_0x311b05[_0x5253('0x15')]['code']===0x1f4){logger[_0x5253('0x15')](_0x5253('0x16'),_0x40a9b5,_0x311b05[_0x5253('0x15')][_0x5253('0x17')]);return _0x16b070(_0x311b05[_0x5253('0x15')][_0x5253('0x17')]);}logger[_0x5253('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x40a9b5,_0x311b05['error'][_0x5253('0x17')]);return _0x2305c9(_0x311b05[_0x5253('0x15')][_0x5253('0x17')]);}else{logger[_0x5253('0x12')](_0x5253('0x16'),_0x40a9b5,'request\x20sent');_0x2305c9(_0x311b05[_0x5253('0x18')][_0x5253('0x17')]);}})[_0x5253('0x19')](function(_0x7f39b6){logger[_0x5253('0x15')](_0x5253('0x16'),_0x40a9b5,_0x7f39b6);_0x16b070(_0x7f39b6);});});}exports[_0x5253('0x1a')]=function(_0x5c654e){var _0x5ee47d=this;return new Promise(function(_0xb77d65,_0x9f3105){return db[_0x5253('0x1b')]['findAll']({'raw':_0x5c654e[_0x5253('0x1c')]?_0x5c654e['options'][_0x5253('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c654e['options']?_0x5c654e[_0x5253('0x1c')][_0x5253('0x1e')]||null:null,'attributes':_0x5c654e[_0x5253('0x1c')]?_0x5c654e[_0x5253('0x1c')][_0x5253('0x1f')]||null:null,'limit':_0x5c654e[_0x5253('0x1c')]?_0x5c654e[_0x5253('0x1c')][_0x5253('0x20')]||null:null,'include':_0x5c654e[_0x5253('0x1c')]?_0x5c654e[_0x5253('0x1c')][_0x5253('0x21')]?_[_0x5253('0x22')](_0x5c654e['options'][_0x5253('0x21')],function(_0xa72a2d){return{'model':db[_0xa72a2d[_0x5253('0x23')]],'as':_0xa72a2d['as'],'attributes':_0xa72a2d[_0x5253('0x1f')],'include':_0xa72a2d[_0x5253('0x21')]?_[_0x5253('0x22')](_0xa72a2d['include'],function(_0x51108e){return{'model':db[_0x51108e[_0x5253('0x23')]],'as':_0x51108e['as'],'attributes':_0x51108e[_0x5253('0x1f')],'include':_0x51108e[_0x5253('0x21')]?_[_0x5253('0x22')](_0x51108e[_0x5253('0x21')],function(_0x4c835b){return{'model':db[_0x4c835b[_0x5253('0x23')]],'as':_0x4c835b['as'],'attributes':_0x4c835b[_0x5253('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x287643){logger['info'](_0x5253('0x1a'),_0x5c654e);logger['debug'](_0x5253('0x1a'),_0x5c654e,JSON[_0x5253('0x24')](_0x287643));_0xb77d65(_0x287643);})[_0x5253('0x19')](function(_0x234070){logger[_0x5253('0x15')](_0x5253('0x1a'),_0x234070[_0x5253('0x17')],_0x5c654e);_0x9f3105(_0x5ee47d['error'](0x1f4,_0x234070['message']));});});};exports[_0x5253('0x25')]=function(_0xe47342){var _0x941d55=this;return new Promise(function(_0x430dbb,_0x1f2c96){return db['WhatsappQueue'][_0x5253('0x26')]({'raw':_0xe47342[_0x5253('0x1c')]?_0xe47342[_0x5253('0x1c')][_0x5253('0x1d')]===undefined?!![]:![]:!![],'where':_0xe47342[_0x5253('0x1c')]?_0xe47342[_0x5253('0x1c')][_0x5253('0x1e')]||null:null,'attributes':_0xe47342[_0x5253('0x1c')]?_0xe47342[_0x5253('0x1c')][_0x5253('0x1f')]||null:null,'include':_0xe47342[_0x5253('0x1c')]?_0xe47342[_0x5253('0x1c')][_0x5253('0x21')]?_[_0x5253('0x22')](_0xe47342['options']['include'],function(_0x17aaa7){return{'model':db[_0x17aaa7[_0x5253('0x23')]],'as':_0x17aaa7['as'],'attributes':_0x17aaa7[_0x5253('0x1f')],'include':_0x17aaa7[_0x5253('0x21')]?_[_0x5253('0x22')](_0x17aaa7[_0x5253('0x21')],function(_0x482edc){return{'model':db[_0x482edc[_0x5253('0x23')]],'as':_0x482edc['as'],'attributes':_0x482edc['attributes'],'include':_0x482edc[_0x5253('0x21')]?_['map'](_0x482edc[_0x5253('0x21')],function(_0x90d8d4){return{'model':db[_0x90d8d4[_0x5253('0x23')]],'as':_0x90d8d4['as'],'attributes':_0x90d8d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bfaf1){logger[_0x5253('0x12')](_0x5253('0x25'),_0xe47342);logger[_0x5253('0x14')]('ShowWhatsappQueue',_0xe47342,JSON[_0x5253('0x24')](_0x2bfaf1));_0x430dbb(_0x2bfaf1);})[_0x5253('0x19')](function(_0x107363){logger['error']('ShowWhatsappQueue',_0x107363[_0x5253('0x17')],_0xe47342);_0x1f2c96(_0x941d55['error'](0x1f4,_0x107363['message']));});});}; \ No newline at end of file +var _0x73bb=['options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappQueue'];(function(_0x4f9178,_0x387005){var _0x59eeee=function(_0x3f4321){while(--_0x3f4321){_0x4f9178['push'](_0x4f9178['shift']());}};_0x59eeee(++_0x387005);}(_0x73bb,0xa6));var _0xb73b=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x73bb[_0x1dd82f];return _0x353ca4;};'use strict';var _=require(_0xb73b('0x0'));var util=require(_0xb73b('0x1'));var moment=require(_0xb73b('0x2'));var BPromise=require(_0xb73b('0x3'));var rs=require(_0xb73b('0x4'));var fs=require('fs');var Redis=require(_0xb73b('0x5'));var db=require(_0xb73b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb73b('0x7'))(_0xb73b('0x8'));var config=require(_0xb73b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb73b('0xa')][_0xb73b('0xb')]({'port':0x232a});config[_0xb73b('0xc')]=_['defaults'](config[_0xb73b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb73b('0xd'))[_0xb73b('0xe')](socket);function respondWithRpcPromise(_0x1370c6,_0x8af756,_0x440629){return new BPromise(function(_0x5a746a,_0xcedaa7){return client[_0xb73b('0xf')](_0x1370c6,_0x440629)[_0xb73b('0x10')](function(_0x435862){logger[_0xb73b('0x11')](_0xb73b('0x12'),_0x8af756,'request\x20sent');logger[_0xb73b('0x13')](_0xb73b('0x14'),_0x8af756,_0xb73b('0x15'),JSON[_0xb73b('0x16')](_0x435862));if(_0x435862[_0xb73b('0x17')]){if(_0x435862[_0xb73b('0x17')][_0xb73b('0x18')]===0x1f4){logger[_0xb73b('0x17')](_0xb73b('0x12'),_0x8af756,_0x435862[_0xb73b('0x17')][_0xb73b('0x19')]);return _0xcedaa7(_0x435862[_0xb73b('0x17')][_0xb73b('0x19')]);}logger[_0xb73b('0x17')](_0xb73b('0x12'),_0x8af756,_0x435862['error'][_0xb73b('0x19')]);return _0x5a746a(_0x435862[_0xb73b('0x17')][_0xb73b('0x19')]);}else{logger[_0xb73b('0x11')](_0xb73b('0x12'),_0x8af756,_0xb73b('0x15'));_0x5a746a(_0x435862[_0xb73b('0x1a')][_0xb73b('0x19')]);}})[_0xb73b('0x1b')](function(_0x256c15){logger[_0xb73b('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x8af756,_0x256c15);_0xcedaa7(_0x256c15);});});}exports['GetWhatsappQueue']=function(_0x30968e){var _0x256b35=this;return new Promise(function(_0x1774b3,_0x2b567b){return db[_0xb73b('0x1c')]['findAll']({'raw':_0x30968e['options']?_0x30968e[_0xb73b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x30968e['options']?_0x30968e['options'][_0xb73b('0x1e')]||null:null,'attributes':_0x30968e[_0xb73b('0x1d')]?_0x30968e[_0xb73b('0x1d')][_0xb73b('0x1f')]||null:null,'limit':_0x30968e[_0xb73b('0x1d')]?_0x30968e[_0xb73b('0x1d')][_0xb73b('0x20')]||null:null,'include':_0x30968e[_0xb73b('0x1d')]?_0x30968e[_0xb73b('0x1d')][_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x30968e[_0xb73b('0x1d')][_0xb73b('0x21')],function(_0x3ea142){return{'model':db[_0x3ea142[_0xb73b('0x23')]],'as':_0x3ea142['as'],'attributes':_0x3ea142[_0xb73b('0x1f')],'include':_0x3ea142[_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x3ea142[_0xb73b('0x21')],function(_0x244e45){return{'model':db[_0x244e45[_0xb73b('0x23')]],'as':_0x244e45['as'],'attributes':_0x244e45[_0xb73b('0x1f')],'include':_0x244e45[_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x244e45[_0xb73b('0x21')],function(_0x124e68){return{'model':db[_0x124e68['model']],'as':_0x124e68['as'],'attributes':_0x124e68[_0xb73b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb73b('0x10')](function(_0xcdc14e){logger[_0xb73b('0x11')](_0xb73b('0x24'),_0x30968e);logger[_0xb73b('0x13')](_0xb73b('0x24'),_0x30968e,JSON[_0xb73b('0x16')](_0xcdc14e));_0x1774b3(_0xcdc14e);})[_0xb73b('0x1b')](function(_0x37daae){logger['error'](_0xb73b('0x24'),_0x37daae['message'],_0x30968e);_0x2b567b(_0x256b35[_0xb73b('0x17')](0x1f4,_0x37daae[_0xb73b('0x19')]));});});};exports[_0xb73b('0x25')]=function(_0x5bbfb9){var _0x745cb0=this;return new Promise(function(_0x210a65,_0x4e8fce){return db[_0xb73b('0x1c')][_0xb73b('0x26')]({'raw':_0x5bbfb9['options']?_0x5bbfb9[_0xb73b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5bbfb9[_0xb73b('0x1d')]?_0x5bbfb9[_0xb73b('0x1d')][_0xb73b('0x1e')]||null:null,'attributes':_0x5bbfb9[_0xb73b('0x1d')]?_0x5bbfb9[_0xb73b('0x1d')][_0xb73b('0x1f')]||null:null,'include':_0x5bbfb9[_0xb73b('0x1d')]?_0x5bbfb9['options'][_0xb73b('0x21')]?_['map'](_0x5bbfb9[_0xb73b('0x1d')][_0xb73b('0x21')],function(_0x45d6da){return{'model':db[_0x45d6da['model']],'as':_0x45d6da['as'],'attributes':_0x45d6da[_0xb73b('0x1f')],'include':_0x45d6da[_0xb73b('0x21')]?_['map'](_0x45d6da[_0xb73b('0x21')],function(_0x344094){return{'model':db[_0x344094[_0xb73b('0x23')]],'as':_0x344094['as'],'attributes':_0x344094[_0xb73b('0x1f')],'include':_0x344094[_0xb73b('0x21')]?_[_0xb73b('0x22')](_0x344094[_0xb73b('0x21')],function(_0x35bdb0){return{'model':db[_0x35bdb0[_0xb73b('0x23')]],'as':_0x35bdb0['as'],'attributes':_0x35bdb0[_0xb73b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dd38){logger['info']('ShowWhatsappQueue',_0x5bbfb9);logger[_0xb73b('0x13')](_0xb73b('0x25'),_0x5bbfb9,JSON[_0xb73b('0x16')](_0x24dd38));_0x210a65(_0x24dd38);})[_0xb73b('0x1b')](function(_0x1d607a){logger[_0xb73b('0x17')](_0xb73b('0x25'),_0x1d607a[_0xb73b('0x19')],_0x5bbfb9);_0x4e8fce(_0x745cb0['error'](0x1f4,_0x1d607a[_0xb73b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 25ffe25..a02ed74 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 _0x0fcf=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','remove'];(function(_0x472642,_0x229afa){var _0x3e97b8=function(_0x4d372f){while(--_0x4d372f){_0x472642['push'](_0x472642['shift']());}};_0x3e97b8(++_0x229afa);}(_0x0fcf,0x82));var _0xf0fc=function(_0x12c3e9,_0x58ed2c){_0x12c3e9=_0x12c3e9-0x0;var _0x158a1c=_0x0fcf[_0x12c3e9];return _0x158a1c;};'use strict';var WhatsappQueueEvents=require(_0xf0fc('0x0'));var events=['save',_0xf0fc('0x1'),'update'];function createListener(_0xd48d5c,_0x47e2cc){return function(_0x21b90e){_0x47e2cc['emit'](_0xd48d5c,_0x21b90e);};}function removeListener(_0x530265,_0x4d0c05){return function(){WhatsappQueueEvents[_0xf0fc('0x2')](_0x530265,_0x4d0c05);};}exports[_0xf0fc('0x3')]=function(_0x45c215){for(var _0x3ead00=0x0,_0x22d191=events[_0xf0fc('0x4')];_0x3ead00<_0x22d191;_0x3ead00++){var _0x4334fb=events[_0x3ead00];var _0x4e6218=createListener(_0xf0fc('0x5')+_0x4334fb,_0x45c215);WhatsappQueueEvents['on'](_0x4334fb,_0x4e6218);}}; \ No newline at end of file +var _0x0584=['removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0584,0xab));var _0x4058=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0584[_0x484e36];return _0xafc85d;};'use strict';var WhatsappQueueEvents=require(_0x4058('0x0'));var events=[_0x4058('0x1'),_0x4058('0x2'),'update'];function createListener(_0x15e200,_0x4f940e){return function(_0xb62fac){_0x4f940e[_0x4058('0x3')](_0x15e200,_0xb62fac);};}function removeListener(_0x5aab88,_0x69c25c){return function(){WhatsappQueueEvents[_0x4058('0x4')](_0x5aab88,_0x69c25c);};}exports['register']=function(_0x26602c){for(var _0x753de6=0x0,_0x5d8dcf=events[_0x4058('0x5')];_0x753de6<_0x5d8dcf;_0x753de6++){var _0x2ef4bc=events[_0x753de6];var _0x581e91=createListener(_0x4058('0x6')+_0x2ef4bc,_0x26602c);WhatsappQueueEvents['on'](_0x2ef4bc,_0x581e91);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index e15da7c..677a763 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 _0xbef1=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','express'];(function(_0x44f524,_0x503be8){var _0x2500e1=function(_0x342119){while(--_0x342119){_0x44f524['push'](_0x44f524['shift']());}};_0x2500e1(++_0x503be8);}(_0xbef1,0xcd));var _0x1bef=function(_0x41203b,_0x55d2ef){_0x41203b=_0x41203b-0x0;var _0x86496e=_0xbef1[_0x41203b];return _0x86496e;};'use strict';var multer=require('multer');var util=require(_0x1bef('0x0'));var path=require(_0x1bef('0x1'));var timeout=require(_0x1bef('0x2'));var express=require(_0x1bef('0x3'));var router=express[_0x1bef('0x4')]();var fs_extra=require(_0x1bef('0x5'));var auth=require(_0x1bef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1bef('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x1bef('0x8')]('/',auth[_0x1bef('0x9')](),controller[_0x1bef('0xa')]);router[_0x1bef('0x8')]('/describe',auth[_0x1bef('0x9')](),controller[_0x1bef('0xb')]);router[_0x1bef('0x8')](_0x1bef('0xc'),auth[_0x1bef('0x9')](),controller[_0x1bef('0xd')]);router['post']('/',auth[_0x1bef('0x9')](),controller[_0x1bef('0xe')]);router[_0x1bef('0xf')](_0x1bef('0xc'),auth[_0x1bef('0x9')](),controller[_0x1bef('0x10')]);router[_0x1bef('0x11')](_0x1bef('0xc'),auth[_0x1bef('0x9')](),controller['destroy']);module[_0x1bef('0x12')]=router; \ No newline at end of file +var _0xb8cd=['post','create','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x1e5871,_0x2fb6b4){var _0xf51f32=function(_0x1719d3){while(--_0x1719d3){_0x1e5871['push'](_0x1e5871['shift']());}};_0xf51f32(++_0x2fb6b4);}(_0xb8cd,0x130));var _0xdb8c=function(_0x4d752d,_0x10f3fb){_0x4d752d=_0x4d752d-0x0;var _0x56773c=_0xb8cd[_0x4d752d];return _0x56773c;};'use strict';var multer=require(_0xdb8c('0x0'));var util=require(_0xdb8c('0x1'));var path=require('path');var timeout=require(_0xdb8c('0x2'));var express=require(_0xdb8c('0x3'));var router=express[_0xdb8c('0x4')]();var fs_extra=require(_0xdb8c('0x5'));var auth=require(_0xdb8c('0x6'));var interaction=require(_0xdb8c('0x7'));var config=require(_0xdb8c('0x8'));var controller=require(_0xdb8c('0x9'));router[_0xdb8c('0xa')]('/',auth[_0xdb8c('0xb')](),controller[_0xdb8c('0xc')]);router[_0xdb8c('0xa')](_0xdb8c('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xdb8c('0xe'),auth[_0xdb8c('0xb')](),controller[_0xdb8c('0xf')]);router[_0xdb8c('0x10')]('/',auth[_0xdb8c('0xb')](),controller[_0xdb8c('0x11')]);router['put']('/:id',auth[_0xdb8c('0xb')](),controller['update']);router[_0xdb8c('0x12')](_0xdb8c('0xe'),auth[_0xdb8c('0xb')](),controller[_0xdb8c('0x13')]);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 0309f2e..d5fe4f4 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(_0x491f53,_0x54ac68){var _0x38e140=function(_0x3e2715){while(--_0x3e2715){_0x491f53['push'](_0x491f53['shift']());}};_0x38e140(++_0x54ac68);}(_0x7a54,0x106));var _0x47a5=function(_0x5e3540,_0x3595cc){_0x5e3540=_0x5e3540-0x0;var _0x4a33d5=_0x7a54[_0x5e3540];return _0x4a33d5;};'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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x46256e,_0x5a97e6){var _0x1bb72a=function(_0x4e5b9d){while(--_0x4e5b9d){_0x46256e['push'](_0x46256e['shift']());}};_0x1bb72a(++_0x5a97e6);}(_0x7a54,0x106));var _0x47a5=function(_0x2dc532,_0x722cd6){_0x2dc532=_0x2dc532-0x0;var _0x47cd0c=_0x7a54[_0x2dc532];return _0x47cd0c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index b5d5914..4e683c1 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 _0x2e54=['catch','show','params','find','create','body','update','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x461794,_0x5f3c10){var _0xec2833=function(_0x48ac23){while(--_0x48ac23){_0x461794['push'](_0x461794['shift']());}};_0xec2833(++_0x5f3c10);}(_0x2e54,0x1dd));var _0x42e5=function(_0x264dfb,_0x1fc437){_0x264dfb=_0x264dfb-0x0;var _0x5dd7cf=_0x2e54[_0x264dfb];return _0x5dd7cf;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){_0x37d10e[_0x42e5('0x19')](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x275c80,_0x4638bc){return function(_0x4f52b2){if(!_0x4f52b2){_0x275c80['sendStatus'](0x194);}return _0x4f52b2;};}function handleError(_0x3115e4,_0x534a26){_0x534a26=_0x534a26||0x1f4;return function(_0x56f812){logger[_0x42e5('0x25')](_0x56f812['stack']);if(_0x56f812[_0x42e5('0x26')]){delete _0x56f812[_0x42e5('0x26')];}_0x3115e4[_0x42e5('0x19')](_0x534a26)[_0x42e5('0x27')](_0x56f812);};}exports[_0x42e5('0x28')]=function(_0x2f1edc,_0x59a46b){var _0x3e2ea5={},_0x201d9e={},_0x39f763={'count':0x0,'rows':[]};var _0x2c53d4=_[_0x42e5('0x29')](db[_0x42e5('0x2a')][_0x42e5('0x2b')],function(_0x282cbf){return{'name':_0x282cbf[_0x42e5('0x2c')],'type':_0x282cbf[_0x42e5('0x2d')][_0x42e5('0x2e')]};});_0x201d9e[_0x42e5('0x2f')]=_[_0x42e5('0x29')](_0x2c53d4,'name');_0x201d9e[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2f1edc[_0x42e5('0x30')]);_0x201d9e[_0x42e5('0x32')]=_['intersection'](_0x201d9e['model'],_0x201d9e[_0x42e5('0x30')]);_0x3e2ea5['attributes']=_[_0x42e5('0x33')](_0x201d9e['model'],qs[_0x42e5('0x34')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x34')]));_0x3e2ea5['attributes']=_0x3e2ea5[_0x42e5('0x35')][_0x42e5('0x36')]?_0x3e2ea5['attributes']:_0x201d9e[_0x42e5('0x2f')];if(!_0x2f1edc['query'][_0x42e5('0x37')](_0x42e5('0x38'))){_0x3e2ea5[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x1e')]);_0x3e2ea5[_0x42e5('0x1c')]=qs['offset'](_0x2f1edc['query'][_0x42e5('0x1c')]);}_0x3e2ea5[_0x42e5('0x39')]=qs[_0x42e5('0x3a')](_0x2f1edc['query']['sort']);_0x3e2ea5['where']=qs['filters'](_[_0x42e5('0x3b')](_0x2f1edc[_0x42e5('0x30')],_0x201d9e[_0x42e5('0x32')]),_0x2c53d4);if(_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]){_0x3e2ea5[_0x42e5('0x3d')]=_[_0x42e5('0x3e')](_0x3e2ea5[_0x42e5('0x3d')],{'$or':_['map'](_0x2c53d4,function(_0x260413){if(_0x260413['type']!==_0x42e5('0x3f')){var _0x343363={};_0x343363[_0x260413[_0x42e5('0x26')]]={'$like':'%'+_0x2f1edc[_0x42e5('0x30')][_0x42e5('0x3c')]+'%'};return _0x343363;}})});}_0x3e2ea5=_[_0x42e5('0x3e')]({},_0x3e2ea5,_0x2f1edc[_0x42e5('0x40')]);var _0x5ab9b8={'where':_0x3e2ea5[_0x42e5('0x3d')]};return db[_0x42e5('0x2a')]['count'](_0x5ab9b8)[_0x42e5('0x24')](function(_0x5e8f96){_0x39f763['count']=_0x5e8f96;if(_0x2f1edc['query'][_0x42e5('0x41')]){_0x3e2ea5[_0x42e5('0x42')]=[{'all':!![]}];}return db[_0x42e5('0x2a')][_0x42e5('0x43')](_0x3e2ea5);})[_0x42e5('0x24')](function(_0x77aa22){_0x39f763[_0x42e5('0x44')]=_0x77aa22;return _0x39f763;})['then'](respondWithFilteredResult(_0x59a46b,_0x3e2ea5))[_0x42e5('0x45')](handleError(_0x59a46b,null));};exports[_0x42e5('0x46')]=function(_0x5bec97,_0x398b73){var _0x1c697a={'raw':!![],'where':{'id':_0x5bec97[_0x42e5('0x47')]['id']}},_0x5db771={};_0x5db771[_0x42e5('0x2f')]=_[_0x42e5('0x31')](db[_0x42e5('0x2a')][_0x42e5('0x2b')]);_0x5db771['query']=_[_0x42e5('0x31')](_0x5bec97[_0x42e5('0x30')]);_0x5db771[_0x42e5('0x32')]=_[_0x42e5('0x33')](_0x5db771['model'],_0x5db771[_0x42e5('0x30')]);_0x1c697a[_0x42e5('0x35')]=_[_0x42e5('0x33')](_0x5db771[_0x42e5('0x2f')],qs[_0x42e5('0x34')](_0x5bec97[_0x42e5('0x30')][_0x42e5('0x34')]));_0x1c697a[_0x42e5('0x35')]=_0x1c697a['attributes'][_0x42e5('0x36')]?_0x1c697a['attributes']:_0x5db771['model'];if(_0x5bec97[_0x42e5('0x30')][_0x42e5('0x41')]){_0x1c697a[_0x42e5('0x42')]=[{'all':!![]}];}_0x1c697a=_[_0x42e5('0x3e')]({},_0x1c697a,_0x5bec97[_0x42e5('0x40')]);return db[_0x42e5('0x2a')][_0x42e5('0x48')](_0x1c697a)['then'](handleEntityNotFound(_0x398b73,null))[_0x42e5('0x24')](respondWithResult(_0x398b73,null))[_0x42e5('0x45')](handleError(_0x398b73,null));};exports[_0x42e5('0x49')]=function(_0x21a047,_0x1086b2){return db[_0x42e5('0x2a')][_0x42e5('0x49')](_0x21a047[_0x42e5('0x4a')],{})['then'](respondWithResult(_0x1086b2,0xc9))[_0x42e5('0x45')](handleError(_0x1086b2,null));};exports[_0x42e5('0x4b')]=function(_0x3616f4,_0x48757e){if(_0x3616f4[_0x42e5('0x4a')]['id']){delete _0x3616f4[_0x42e5('0x4a')]['id'];}return db[_0x42e5('0x2a')][_0x42e5('0x48')]({'where':{'id':_0x3616f4[_0x42e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x48757e,null))[_0x42e5('0x24')](saveUpdates(_0x3616f4['body'],null))[_0x42e5('0x24')](respondWithResult(_0x48757e,null))[_0x42e5('0x45')](handleError(_0x48757e,null));};exports[_0x42e5('0x4c')]=function(_0x48b63b,_0x50f59c){return db['WhatsappQueueReport'][_0x42e5('0x48')]({'where':{'id':_0x48b63b[_0x42e5('0x47')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x50f59c,null))[_0x42e5('0x24')](removeEntity(_0x50f59c,null))['catch'](handleError(_0x50f59c,null));};exports[_0x42e5('0x4d')]=function(_0x26782e,_0x18cedc){return db['WhatsappQueueReport'][_0x42e5('0x4d')]()['then'](respondWithResult(_0x18cedc,null))[_0x42e5('0x45')](handleError(_0x18cedc,null));}; \ No newline at end of file +var _0x0713=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','keys','find','catch','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0xe4cec8,_0x38f597){var _0x5af255=function(_0x5cc6e1){while(--_0x5cc6e1){_0xe4cec8['push'](_0xe4cec8['shift']());}};_0x5af255(++_0x38f597);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=_['map'](db[_0x3071('0x2d')][_0x3071('0x2e')],function(_0x6ddf96){return{'name':_0x6ddf96[_0x3071('0x2f')],'type':_0x6ddf96[_0x3071('0x30')][_0x3071('0x31')]};});_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x5aba96,'name');_0x292205['query']=_['keys'](_0x177b5f[_0x3071('0x34')]);_0x292205[_0x3071('0x35')]=_['intersection'](_0x292205[_0x3071('0x32')],_0x292205[_0x3071('0x34')]);_0x32f1b4[_0x3071('0x36')]=_[_0x3071('0x37')](_0x292205['model'],qs[_0x3071('0x38')](_0x177b5f[_0x3071('0x34')][_0x3071('0x38')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x39')]?_0x32f1b4[_0x3071('0x36')]:_0x292205[_0x3071('0x32')];if(!_0x177b5f['query'][_0x3071('0x3a')]('nolimit')){_0x32f1b4['limit']=qs[_0x3071('0x20')](_0x177b5f[_0x3071('0x34')]['limit']);_0x32f1b4[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x177b5f[_0x3071('0x34')][_0x3071('0x1e')]);}_0x32f1b4[_0x3071('0x3b')]=qs[_0x3071('0x3c')](_0x177b5f['query'][_0x3071('0x3c')]);_0x32f1b4[_0x3071('0x3d')]=qs['filters'](_[_0x3071('0x3e')](_0x177b5f['query'],_0x292205[_0x3071('0x35')]),_0x5aba96);if(_0x177b5f[_0x3071('0x34')]['filter']){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4[_0x3071('0x3d')],{'$or':_[_0x3071('0x33')](_0x5aba96,function(_0x55afa6){if(_0x55afa6[_0x3071('0x30')]!=='VIRTUAL'){var _0x1ac90a={};_0x1ac90a[_0x55afa6['name']]={'$like':'%'+_0x177b5f[_0x3071('0x34')][_0x3071('0x40')]+'%'};return _0x1ac90a;}})});}_0x32f1b4=_[_0x3071('0x3f')]({},_0x32f1b4,_0x177b5f[_0x3071('0x41')]);var _0x30ab68={'where':_0x32f1b4['where']};return db['WhatsappQueueReport'][_0x3071('0x21')](_0x30ab68)[_0x3071('0x27')](function(_0x1455be){_0x254fc8[_0x3071('0x21')]=_0x1455be;if(_0x177b5f['query'][_0x3071('0x42')]){_0x32f1b4[_0x3071('0x43')]=[{'all':!![]}];}return db[_0x3071('0x2d')][_0x3071('0x44')](_0x32f1b4);})[_0x3071('0x27')](function(_0xb9a4b8){_0x254fc8['rows']=_0xb9a4b8;return _0x254fc8;})[_0x3071('0x27')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))['catch'](handleError(_0x3921a1,null));};exports['show']=function(_0x4dc9d1,_0x47ceaf){var _0x2992e6={'raw':!![],'where':{'id':_0x4dc9d1[_0x3071('0x45')]['id']}},_0x1be8b6={};_0x1be8b6[_0x3071('0x32')]=_[_0x3071('0x46')](db[_0x3071('0x2d')][_0x3071('0x2e')]);_0x1be8b6[_0x3071('0x34')]=_['keys'](_0x4dc9d1[_0x3071('0x34')]);_0x1be8b6[_0x3071('0x35')]=_[_0x3071('0x37')](_0x1be8b6[_0x3071('0x32')],_0x1be8b6[_0x3071('0x34')]);_0x2992e6['attributes']=_['intersection'](_0x1be8b6[_0x3071('0x32')],qs[_0x3071('0x38')](_0x4dc9d1[_0x3071('0x34')][_0x3071('0x38')]));_0x2992e6[_0x3071('0x36')]=_0x2992e6['attributes'][_0x3071('0x39')]?_0x2992e6['attributes']:_0x1be8b6[_0x3071('0x32')];if(_0x4dc9d1['query']['includeAll']){_0x2992e6[_0x3071('0x43')]=[{'all':!![]}];}_0x2992e6=_['merge']({},_0x2992e6,_0x4dc9d1[_0x3071('0x41')]);return db['WhatsappQueueReport'][_0x3071('0x47')](_0x2992e6)[_0x3071('0x27')](handleEntityNotFound(_0x47ceaf,null))[_0x3071('0x27')](respondWithResult(_0x47ceaf,null))[_0x3071('0x48')](handleError(_0x47ceaf,null));};exports['create']=function(_0x2d70bf,_0x575c12){return db[_0x3071('0x2d')]['create'](_0x2d70bf[_0x3071('0x49')],{})[_0x3071('0x27')](respondWithResult(_0x575c12,0xc9))['catch'](handleError(_0x575c12,null));};exports[_0x3071('0x26')]=function(_0x117e73,_0x224a70){if(_0x117e73[_0x3071('0x49')]['id']){delete _0x117e73[_0x3071('0x49')]['id'];}return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x117e73['params']['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x224a70,null))[_0x3071('0x27')](saveUpdates(_0x117e73[_0x3071('0x49')],null))[_0x3071('0x27')](respondWithResult(_0x224a70,null))['catch'](handleError(_0x224a70,null));};exports[_0x3071('0x28')]=function(_0x2aea37,_0x1b832e){return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x2aea37[_0x3071('0x45')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1b832e,null))[_0x3071('0x27')](removeEntity(_0x1b832e,null))[_0x3071('0x48')](handleError(_0x1b832e,null));};exports[_0x3071('0x4a')]=function(_0x4371e7,_0x111115){return db[_0x3071('0x2d')][_0x3071('0x4a')]()[_0x3071('0x27')](respondWithResult(_0x111115,null))[_0x3071('0x48')](handleError(_0x111115,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 14f246d..5570b8d 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 _0x4725=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4725,0x17c));var _0x5472=function(_0x448595,_0x3f3e66){_0x448595=_0x448595-0x0;var _0x1f3770=_0x4725[_0x448595];return _0x1f3770;};'use strict';var _=require(_0x5472('0x0'));var util=require(_0x5472('0x1'));var logger=require(_0x5472('0x2'))(_0x5472('0x3'));var moment=require(_0x5472('0x4'));var BPromise=require('bluebird');var rp=require(_0x5472('0x5'));var fs=require('fs');var path=require(_0x5472('0x6'));var rimraf=require(_0x5472('0x7'));var config=require(_0x5472('0x8'));var attributes=require(_0x5472('0x9'));module[_0x5472('0xa')]=function(_0x22132e,_0x4d636a){return _0x22132e[_0x5472('0xb')](_0x5472('0xc'),attributes,{'tableName':_0x5472('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5472('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc02f=['util','../../config/logger','api','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x3e2e2c,_0x36c7d5){var _0x75f42=function(_0x5a5380){while(--_0x5a5380){_0x3e2e2c['push'](_0x3e2e2c['shift']());}};_0x75f42(++_0x36c7d5);}(_0xc02f,0xa7));var _0xfc02=function(_0x4052c7,_0x30a10d){_0x4052c7=_0x4052c7-0x0;var _0x3134c7=_0xc02f[_0x4052c7];return _0x3134c7;};'use strict';var _=require(_0xfc02('0x0'));var util=require(_0xfc02('0x1'));var logger=require(_0xfc02('0x2'))(_0xfc02('0x3'));var moment=require('moment');var BPromise=require(_0xfc02('0x4'));var rp=require(_0xfc02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc02('0x6'));var config=require('../../config/environment');var attributes=require(_0xfc02('0x7'));module[_0xfc02('0x8')]=function(_0xa2953f,_0xd9627b){return _0xa2953f['define'](_0xfc02('0x9'),attributes,{'tableName':_0xfc02('0xa'),'paranoid':![],'indexes':[{'name':_0xfc02('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 71b81fe..0c990c6 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 _0x16f3=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','WhatsappQueueReport','create','body','options','then','CreateWhatsappQueueReport','debug','catch','update','where','attributes','UpdateWhatsappQueueReport','lodash','moment'];(function(_0x5b70c7,_0x36448d){var _0x574120=function(_0x7c02b6){while(--_0x7c02b6){_0x5b70c7['push'](_0x5b70c7['shift']());}};_0x574120(++_0x36448d);}(_0x16f3,0x191));var _0x316f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16f3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x316f('0x0'));var util=require('util');var moment=require(_0x316f('0x1'));var BPromise=require(_0x316f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x316f('0x3'));var db=require(_0x316f('0x4'))['db'];var utils=require(_0x316f('0x5'));var logger=require('../../config/logger')(_0x316f('0x6'));var config=require(_0x316f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x316f('0x8')][_0x316f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d48b5,_0x22df63,_0x2669e7){return new BPromise(function(_0x2f2fb9,_0x4d05c0){return client['request'](_0x3d48b5,_0x2669e7)['then'](function(_0x5212d7){logger[_0x316f('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22df63,'request\x20sent');logger['debug'](_0x316f('0xb'),_0x22df63,_0x316f('0xc'),JSON[_0x316f('0xd')](_0x5212d7));if(_0x5212d7[_0x316f('0xe')]){if(_0x5212d7[_0x316f('0xe')][_0x316f('0xf')]===0x1f4){logger[_0x316f('0xe')](_0x316f('0x10'),_0x22df63,_0x5212d7[_0x316f('0xe')]['message']);return _0x4d05c0(_0x5212d7['error'][_0x316f('0x11')]);}logger[_0x316f('0xe')](_0x316f('0x10'),_0x22df63,_0x5212d7[_0x316f('0xe')]['message']);return _0x2f2fb9(_0x5212d7[_0x316f('0xe')][_0x316f('0x11')]);}else{logger[_0x316f('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22df63,_0x316f('0xc'));_0x2f2fb9(_0x5212d7[_0x316f('0x12')][_0x316f('0x11')]);}})['catch'](function(_0xcccaae){logger[_0x316f('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x22df63,_0xcccaae);_0x4d05c0(_0xcccaae);});});}exports['CreateWhatsappQueueReport']=function(_0x1ecbcc){var _0x1e6537=this;return new Promise(function(_0x59b9cc,_0x5ad706){return db[_0x316f('0x13')][_0x316f('0x14')](_0x1ecbcc[_0x316f('0x15')],{'raw':_0x1ecbcc[_0x316f('0x16')]?_0x1ecbcc[_0x316f('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x316f('0x17')](function(_0x2d6da2){logger[_0x316f('0xa')](_0x316f('0x18'),_0x1ecbcc);logger[_0x316f('0x19')](_0x316f('0x18'),_0x1ecbcc,JSON[_0x316f('0xd')](_0x2d6da2));_0x59b9cc(_0x2d6da2);})[_0x316f('0x1a')](function(_0x17b854){logger[_0x316f('0xe')](_0x316f('0x18'),_0x17b854[_0x316f('0x11')],_0x1ecbcc);_0x5ad706(_0x1e6537['error'](0x1f4,_0x17b854[_0x316f('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1c222b){var _0x1dfdcd=this;return new Promise(function(_0x20483c,_0x3b3213){return db[_0x316f('0x13')][_0x316f('0x1b')](_0x1c222b[_0x316f('0x15')],{'raw':_0x1c222b[_0x316f('0x16')]?_0x1c222b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c222b[_0x316f('0x16')]?_0x1c222b[_0x316f('0x16')][_0x316f('0x1c')]||null:null,'attributes':_0x1c222b[_0x316f('0x16')]?_0x1c222b['options'][_0x316f('0x1d')]||null:null,'limit':_0x1c222b[_0x316f('0x16')]?_0x1c222b['options']['limit']||null:null})['then'](function(_0x2e878b){logger[_0x316f('0xa')](_0x316f('0x1e'),_0x1c222b);logger['debug'](_0x316f('0x1e'),_0x1c222b,JSON[_0x316f('0xd')](_0x2e878b));_0x20483c(_0x2e878b);})[_0x316f('0x1a')](function(_0x275d0b){logger['error'](_0x316f('0x1e'),_0x275d0b['message'],_0x1c222b);_0x3b3213(_0x1dfdcd[_0x316f('0xe')](0x1f4,_0x275d0b[_0x316f('0x11')]));});});}; \ No newline at end of file +var _0xa9fc=['error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c024f,_0x938921){var _0x4a44c7=function(_0x27ee42){while(--_0x27ee42){_0x5c024f['push'](_0x5c024f['shift']());}};_0x4a44c7(++_0x938921);}(_0xa9fc,0x9b));var _0xca9f=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xa9fc[_0x4af01e];return _0x178c11;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xca9f('0x3'));var fs=require('fs');var Redis=require(_0xca9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca9f('0x5'));var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require(_0xca9f('0x8'));var jayson=require(_0xca9f('0x9'));var client=jayson[_0xca9f('0xa')][_0xca9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdc21ab,_0x12764a,_0x1aa12c){return new BPromise(function(_0xb475ae,_0x14b88a){return client[_0xca9f('0xc')](_0xdc21ab,_0x1aa12c)[_0xca9f('0xd')](function(_0x4d688d){logger[_0xca9f('0xe')](_0xca9f('0xf'),_0x12764a,_0xca9f('0x10'));logger[_0xca9f('0x11')](_0xca9f('0x12'),_0x12764a,_0xca9f('0x10'),JSON[_0xca9f('0x13')](_0x4d688d));if(_0x4d688d[_0xca9f('0x14')]){if(_0x4d688d[_0xca9f('0x14')][_0xca9f('0x15')]===0x1f4){logger[_0xca9f('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x12764a,_0x4d688d[_0xca9f('0x14')][_0xca9f('0x16')]);return _0x14b88a(_0x4d688d['error']['message']);}logger['error'](_0xca9f('0xf'),_0x12764a,_0x4d688d[_0xca9f('0x14')][_0xca9f('0x16')]);return _0xb475ae(_0x4d688d[_0xca9f('0x14')][_0xca9f('0x16')]);}else{logger['info'](_0xca9f('0xf'),_0x12764a,_0xca9f('0x10'));_0xb475ae(_0x4d688d[_0xca9f('0x17')][_0xca9f('0x16')]);}})[_0xca9f('0x18')](function(_0x4dde23){logger[_0xca9f('0x14')](_0xca9f('0xf'),_0x12764a,_0x4dde23);_0x14b88a(_0x4dde23);});});}exports[_0xca9f('0x19')]=function(_0x1eb78d){var _0x3ed1c8=this;return new Promise(function(_0x2bf587,_0x93d788){return db[_0xca9f('0x1a')][_0xca9f('0x1b')](_0x1eb78d[_0xca9f('0x1c')],{'raw':_0x1eb78d[_0xca9f('0x1d')]?_0x1eb78d[_0xca9f('0x1d')][_0xca9f('0x1e')]===undefined?!![]:![]:!![]})[_0xca9f('0xd')](function(_0x34f4cd){logger[_0xca9f('0xe')]('CreateWhatsappQueueReport',_0x1eb78d);logger['debug'](_0xca9f('0x19'),_0x1eb78d,JSON[_0xca9f('0x13')](_0x34f4cd));_0x2bf587(_0x34f4cd);})[_0xca9f('0x18')](function(_0xc1f108){logger[_0xca9f('0x14')](_0xca9f('0x19'),_0xc1f108[_0xca9f('0x16')],_0x1eb78d);_0x93d788(_0x3ed1c8[_0xca9f('0x14')](0x1f4,_0xc1f108[_0xca9f('0x16')]));});});};exports[_0xca9f('0x1f')]=function(_0x2c3a31){var _0xa4ad2e=this;return new Promise(function(_0xe11fe8,_0x632ce1){return db['WhatsappQueueReport']['update'](_0x2c3a31[_0xca9f('0x1c')],{'raw':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31[_0xca9f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31[_0xca9f('0x1d')][_0xca9f('0x20')]||null:null,'attributes':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31['options'][_0xca9f('0x21')]||null:null,'limit':_0x2c3a31[_0xca9f('0x1d')]?_0x2c3a31[_0xca9f('0x1d')][_0xca9f('0x22')]||null:null})[_0xca9f('0xd')](function(_0x3d53e6){logger[_0xca9f('0xe')](_0xca9f('0x1f'),_0x2c3a31);logger[_0xca9f('0x11')]('UpdateWhatsappQueueReport',_0x2c3a31,JSON['stringify'](_0x3d53e6));_0xe11fe8(_0x3d53e6);})[_0xca9f('0x18')](function(_0x46dd07){logger[_0xca9f('0x14')](_0xca9f('0x1f'),_0x46dd07[_0xca9f('0x16')],_0x2c3a31);_0x632ce1(_0xa4ad2e[_0xca9f('0x14')](0x1f4,_0x46dd07[_0xca9f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f89aa8a..46b79c2 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 _0x12ab=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','show'];(function(_0x2e5c07,_0x5c29e0){var _0x4fa341=function(_0x3782c6){while(--_0x3782c6){_0x2e5c07['push'](_0x2e5c07['shift']());}};_0x4fa341(++_0x5c29e0);}(_0x12ab,0x1ac));var _0xb12a=function(_0x45ded3,_0x2e8a3f){_0x45ded3=_0x45ded3-0x0;var _0x4fc818=_0x12ab[_0x45ded3];return _0x4fc818;};'use strict';var multer=require(_0xb12a('0x0'));var util=require(_0xb12a('0x1'));var path=require(_0xb12a('0x2'));var timeout=require('connect-timeout');var express=require(_0xb12a('0x3'));var router=express['Router']();var fs_extra=require(_0xb12a('0x4'));var auth=require(_0xb12a('0x5'));var interaction=require(_0xb12a('0x6'));var config=require(_0xb12a('0x7'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb12a('0x8')]);router[_0xb12a('0x9')](_0xb12a('0xa'),auth[_0xb12a('0xb')](),controller['describe']);router['get']('/:id',auth[_0xb12a('0xb')](),controller[_0xb12a('0xc')]);router[_0xb12a('0xd')]('/',auth[_0xb12a('0xb')](),controller[_0xb12a('0xe')]);router[_0xb12a('0xf')](_0xb12a('0x10'),auth[_0xb12a('0xb')](),controller[_0xb12a('0x11')]);router[_0xb12a('0x12')](_0xb12a('0x10'),auth[_0xb12a('0xb')](),controller[_0xb12a('0x13')]);module[_0xb12a('0x14')]=router; \ No newline at end of file +var _0xdc02=['./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','put','update','exports','util','path','Router','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc02,0xce));var _0x2dc0=function(_0x459b3e,_0x5a0c7a){_0x459b3e=_0x459b3e-0x0;var _0xaf15e4=_0xdc02[_0x459b3e];return _0xaf15e4;};'use strict';var multer=require('multer');var util=require(_0x2dc0('0x0'));var path=require(_0x2dc0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2dc0('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2dc0('0x3'));var config=require('../../config/environment');var controller=require(_0x2dc0('0x4'));router['get']('/',auth[_0x2dc0('0x5')](),controller[_0x2dc0('0x6')]);router[_0x2dc0('0x7')](_0x2dc0('0x8'),auth[_0x2dc0('0x5')](),controller['describe']);router[_0x2dc0('0x7')](_0x2dc0('0x9'),auth[_0x2dc0('0x5')](),controller[_0x2dc0('0xa')]);router['post']('/',auth[_0x2dc0('0x5')](),controller['create']);router[_0x2dc0('0xb')](_0x2dc0('0x9'),auth[_0x2dc0('0x5')](),controller[_0x2dc0('0xc')]);router['delete']('/:id',auth[_0x2dc0('0x5')](),controller['destroy']);module[_0x2dc0('0xd')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 9292b64..023071e 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 _0xd844=['exports','ENUM','account','DATE','sequelize'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xd844,0x6d));var _0x4d84=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd844[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x4d84('0x0'));module[_0x4d84('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4d84('0x2')](_0x4d84('0x3'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4d84('0x4')]}}; \ No newline at end of file +var _0x99cd=['agent','queue','DATE','sequelize','STRING','ENUM','account'];(function(_0x31b813,_0x2f842d){var _0x2870fa=function(_0xc86546){while(--_0xc86546){_0x31b813['push'](_0x31b813['shift']());}};_0x2870fa(++_0x2f842d);}(_0x99cd,0x1df));var _0xd99c=function(_0x16d26c,_0xffdee0){_0x16d26c=_0x16d26c-0x0;var _0x1742a2=_0x99cd[_0x16d26c];return _0x1742a2;};'use strict';var Sequelize=require(_0xd99c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd99c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd99c('0x2')](_0xd99c('0x3'),_0xd99c('0x4'),_0xd99c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd99c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f3024c6..74b506f 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 _0x2f2d=['filters','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','index','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x35a59c,_0x3c08ef){var _0x11bf0e=function(_0x154cec){while(--_0x154cec){_0x35a59c['push'](_0x35a59c['shift']());}};_0x11bf0e(++_0x3c08ef);}(_0x2f2d,0x17f));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2f2('0x0'));var zipdir=require(_0xd2f2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2f2('0x2'));var moment=require(_0xd2f2('0x3'));var BPromise=require(_0xd2f2('0x4'));var Mustache=require(_0xd2f2('0x5'));var util=require('util');var path=require(_0xd2f2('0x6'));var sox=require('sox');var csv=require(_0xd2f2('0x7'));var ejs=require(_0xd2f2('0x8'));var fs=require('fs');var fs_extra=require(_0xd2f2('0x9'));var _=require(_0xd2f2('0xa'));var squel=require(_0xd2f2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd2f2('0xc'));var toCsv=require(_0xd2f2('0x7'));var querystring=require(_0xd2f2('0xd'));var Papa=require(_0xd2f2('0xe'));var Redis=require('ioredis');var authService=require(_0xd2f2('0xf'));var qs=require(_0xd2f2('0x10'));var as=require(_0xd2f2('0x11'));var hardwareService=require(_0xd2f2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd2f2('0x13'));var config=require(_0xd2f2('0x14'));var licenseUtil=require(_0xd2f2('0x15'));var db=require(_0xd2f2('0x16'))['db'];function respondWithStatusCode(_0x3a7bd4,_0x5e248d){_0x5e248d=_0x5e248d||0xcc;return function(_0x353c19){if(_0x353c19){return _0x3a7bd4['sendStatus'](_0x5e248d);}return _0x3a7bd4[_0xd2f2('0x17')](_0x5e248d)[_0xd2f2('0x18')]();};}function respondWithResult(_0x5ca71b,_0x3cbf36){_0x3cbf36=_0x3cbf36||0xc8;return function(_0x4fe883){if(_0x4fe883){return _0x5ca71b[_0xd2f2('0x17')](_0x3cbf36)[_0xd2f2('0x19')](_0x4fe883);}};}function respondWithFilteredResult(_0x8c478c,_0xd33cea){return function(_0x54b247){if(_0x54b247){var _0x5b91eb=typeof _0xd33cea[_0xd2f2('0x1a')]===_0xd2f2('0x1b')&&typeof _0xd33cea['limit']===_0xd2f2('0x1b');var _0x2cdfe2=_0x54b247[_0xd2f2('0x1c')];var _0x3ce71e=_0x5b91eb?0x0:_0xd33cea['offset'];var _0x26c3d4=_0x5b91eb?_0x54b247[_0xd2f2('0x1c')]:_0xd33cea[_0xd2f2('0x1a')]+_0xd33cea[_0xd2f2('0x1d')];var _0x213654;if(_0x26c3d4>=_0x2cdfe2){_0x26c3d4=_0x2cdfe2;_0x213654=0xc8;}else{_0x213654=0xce;}_0x8c478c[_0xd2f2('0x17')](_0x213654);return _0x8c478c[_0xd2f2('0x1e')](_0xd2f2('0x1f'),_0x3ce71e+'-'+_0x26c3d4+'/'+_0x2cdfe2)[_0xd2f2('0x19')](_0x54b247);}return null;};}function patchUpdates(_0x15bd02){return function(_0x53e9b0){try{jsonpatch['apply'](_0x53e9b0,_0x15bd02,!![]);}catch(_0x12ce0b){return BPromise['reject'](_0x12ce0b);}return _0x53e9b0[_0xd2f2('0x20')]();};}function saveUpdates(_0x91a3a8,_0x3057dd){return function(_0x197501){if(_0x197501){return _0x197501[_0xd2f2('0x21')](_0x91a3a8)[_0xd2f2('0x22')](function(_0x50aeea){return _0x50aeea;});}return null;};}function removeEntity(_0x1572a8,_0x4398a2){return function(_0x299688){if(_0x299688){return _0x299688[_0xd2f2('0x23')]()[_0xd2f2('0x22')](function(){_0x1572a8[_0xd2f2('0x17')](0xcc)[_0xd2f2('0x18')]();});}};}function handleEntityNotFound(_0x589696,_0x226a6a){return function(_0x1a428d){if(!_0x1a428d){_0x589696[_0xd2f2('0x24')](0x194);}return _0x1a428d;};}function handleError(_0x24b240,_0x58e36c){_0x58e36c=_0x58e36c||0x1f4;return function(_0x47b9d4){logger[_0xd2f2('0x25')](_0x47b9d4[_0xd2f2('0x26')]);if(_0x47b9d4[_0xd2f2('0x27')]){delete _0x47b9d4[_0xd2f2('0x27')];}_0x24b240[_0xd2f2('0x17')](_0x58e36c)['send'](_0x47b9d4);};}exports[_0xd2f2('0x28')]=function(_0x11cbb6,_0x594223){var _0x2a6566={},_0x26fbb9={},_0xf99f92={'count':0x0,'rows':[]};var _0x172230=_['map'](db[_0xd2f2('0x29')][_0xd2f2('0x2a')],function(_0x340833){return{'name':_0x340833[_0xd2f2('0x2b')],'type':_0x340833[_0xd2f2('0x2c')]['key']};});_0x26fbb9[_0xd2f2('0x2d')]=_['map'](_0x172230,_0xd2f2('0x27'));_0x26fbb9[_0xd2f2('0x2e')]=_['keys'](_0x11cbb6['query']);_0x26fbb9['filters']=_[_0xd2f2('0x2f')](_0x26fbb9['model'],_0x26fbb9[_0xd2f2('0x2e')]);_0x2a6566[_0xd2f2('0x30')]=_['intersection'](_0x26fbb9[_0xd2f2('0x2d')],qs['fields'](_0x11cbb6['query'][_0xd2f2('0x31')]));_0x2a6566['attributes']=_0x2a6566[_0xd2f2('0x30')]['length']?_0x2a6566['attributes']:_0x26fbb9[_0xd2f2('0x2d')];if(!_0x11cbb6[_0xd2f2('0x2e')][_0xd2f2('0x32')](_0xd2f2('0x33'))){_0x2a6566[_0xd2f2('0x1d')]=qs[_0xd2f2('0x1d')](_0x11cbb6[_0xd2f2('0x2e')][_0xd2f2('0x1d')]);_0x2a6566[_0xd2f2('0x1a')]=qs[_0xd2f2('0x1a')](_0x11cbb6[_0xd2f2('0x2e')][_0xd2f2('0x1a')]);}_0x2a6566[_0xd2f2('0x34')]=qs[_0xd2f2('0x35')](_0x11cbb6[_0xd2f2('0x2e')][_0xd2f2('0x35')]);_0x2a6566[_0xd2f2('0x36')]=qs[_0xd2f2('0x37')](_['pick'](_0x11cbb6[_0xd2f2('0x2e')],_0x26fbb9['filters']),_0x172230);if(_0x11cbb6['query'][_0xd2f2('0x38')]){_0x2a6566['where']=_[_0xd2f2('0x39')](_0x2a6566[_0xd2f2('0x36')],{'$or':_[_0xd2f2('0x3a')](_0x172230,function(_0x131371){if(_0x131371['type']!==_0xd2f2('0x3b')){var _0x5d8eed={};_0x5d8eed[_0x131371['name']]={'$like':'%'+_0x11cbb6[_0xd2f2('0x2e')]['filter']+'%'};return _0x5d8eed;}})});}_0x2a6566=_['merge']({},_0x2a6566,_0x11cbb6[_0xd2f2('0x3c')]);var _0x3843cc={'where':_0x2a6566['where']};return db[_0xd2f2('0x29')][_0xd2f2('0x1c')](_0x3843cc)[_0xd2f2('0x22')](function(_0x2d2920){_0xf99f92[_0xd2f2('0x1c')]=_0x2d2920;if(_0x11cbb6[_0xd2f2('0x2e')]['includeAll']){_0x2a6566[_0xd2f2('0x3d')]=[{'all':!![]}];}return db[_0xd2f2('0x29')][_0xd2f2('0x3e')](_0x2a6566);})['then'](function(_0x1fb94b){_0xf99f92[_0xd2f2('0x3f')]=_0x1fb94b;return _0xf99f92;})[_0xd2f2('0x22')](respondWithFilteredResult(_0x594223,_0x2a6566))[_0xd2f2('0x40')](handleError(_0x594223,null));};exports[_0xd2f2('0x41')]=function(_0x137f18,_0x28ada7){var _0x41747b={'raw':!![],'where':{'id':_0x137f18[_0xd2f2('0x42')]['id']}},_0x1e2681={};_0x1e2681[_0xd2f2('0x2d')]=_['keys'](db[_0xd2f2('0x29')][_0xd2f2('0x2a')]);_0x1e2681[_0xd2f2('0x2e')]=_[_0xd2f2('0x43')](_0x137f18['query']);_0x1e2681[_0xd2f2('0x37')]=_[_0xd2f2('0x2f')](_0x1e2681[_0xd2f2('0x2d')],_0x1e2681[_0xd2f2('0x2e')]);_0x41747b['attributes']=_['intersection'](_0x1e2681[_0xd2f2('0x2d')],qs[_0xd2f2('0x31')](_0x137f18[_0xd2f2('0x2e')][_0xd2f2('0x31')]));_0x41747b[_0xd2f2('0x30')]=_0x41747b[_0xd2f2('0x30')]['length']?_0x41747b['attributes']:_0x1e2681[_0xd2f2('0x2d')];if(_0x137f18[_0xd2f2('0x2e')][_0xd2f2('0x44')]){_0x41747b[_0xd2f2('0x3d')]=[{'all':!![]}];}_0x41747b=_[_0xd2f2('0x39')]({},_0x41747b,_0x137f18[_0xd2f2('0x3c')]);return db[_0xd2f2('0x29')][_0xd2f2('0x45')](_0x41747b)[_0xd2f2('0x22')](handleEntityNotFound(_0x28ada7,null))[_0xd2f2('0x22')](respondWithResult(_0x28ada7,null))[_0xd2f2('0x40')](handleError(_0x28ada7,null));};exports['create']=function(_0x526f6f,_0x11b927){return db['WhatsappTransferReport'][_0xd2f2('0x46')](_0x526f6f[_0xd2f2('0x47')],{})[_0xd2f2('0x22')](respondWithResult(_0x11b927,0xc9))['catch'](handleError(_0x11b927,null));};exports[_0xd2f2('0x21')]=function(_0x48de52,_0x362643){if(_0x48de52['body']['id']){delete _0x48de52[_0xd2f2('0x47')]['id'];}return db[_0xd2f2('0x29')][_0xd2f2('0x45')]({'where':{'id':_0x48de52[_0xd2f2('0x42')]['id']}})['then'](handleEntityNotFound(_0x362643,null))['then'](saveUpdates(_0x48de52[_0xd2f2('0x47')],null))['then'](respondWithResult(_0x362643,null))[_0xd2f2('0x40')](handleError(_0x362643,null));};exports['destroy']=function(_0x4c4939,_0x2ca5ec){return db[_0xd2f2('0x29')]['find']({'where':{'id':_0x4c4939['params']['id']}})[_0xd2f2('0x22')](handleEntityNotFound(_0x2ca5ec,null))['then'](removeEntity(_0x2ca5ec,null))['catch'](handleError(_0x2ca5ec,null));};exports[_0xd2f2('0x48')]=function(_0x295976,_0x364223){return db[_0xd2f2('0x29')][_0xd2f2('0x48')]()[_0xd2f2('0x22')](respondWithResult(_0x364223,null))[_0xd2f2('0x40')](handleError(_0x364223,null));}; \ No newline at end of file +var _0x52a7=['request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','findAll','catch','show','params','find','create','body','destroy','zip-dir','fast-json-patch'];(function(_0xbc9261,_0x42ba9d){var _0x2c0487=function(_0x47e243){while(--_0x47e243){_0xbc9261['push'](_0xbc9261['shift']());}};_0x2c0487(++_0x42ba9d);}(_0x52a7,0x16b));var _0x752a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x52a7[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x752a('0x0'));var jsonpatch=require(_0x752a('0x1'));var rp=require(_0x752a('0x2'));var moment=require(_0x752a('0x3'));var BPromise=require(_0x752a('0x4'));var Mustache=require(_0x752a('0x5'));var util=require(_0x752a('0x6'));var path=require('path');var sox=require(_0x752a('0x7'));var csv=require(_0x752a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x752a('0x9'));var _=require('lodash');var squel=require(_0x752a('0xa'));var crypto=require(_0x752a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x752a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x752a('0xd'));var Papa=require(_0x752a('0xe'));var Redis=require(_0x752a('0xf'));var authService=require(_0x752a('0x10'));var qs=require(_0x752a('0x11'));var as=require(_0x752a('0x12'));var hardwareService=require(_0x752a('0x13'));var logger=require('../../config/logger')(_0x752a('0x14'));var utils=require(_0x752a('0x15'));var config=require(_0x752a('0x16'));var licenseUtil=require(_0x752a('0x17'));var db=require(_0x752a('0x18'))['db'];function respondWithStatusCode(_0x1fd312,_0x387cf4){_0x387cf4=_0x387cf4||0xcc;return function(_0x5bdad1){if(_0x5bdad1){return _0x1fd312[_0x752a('0x19')](_0x387cf4);}return _0x1fd312[_0x752a('0x1a')](_0x387cf4)['end']();};}function respondWithResult(_0x12aefd,_0x47d693){_0x47d693=_0x47d693||0xc8;return function(_0x9ea6e0){if(_0x9ea6e0){return _0x12aefd[_0x752a('0x1a')](_0x47d693)[_0x752a('0x1b')](_0x9ea6e0);}};}function respondWithFilteredResult(_0x1091e5,_0x2ad947){return function(_0x1d967a){if(_0x1d967a){var _0x4e2b56=typeof _0x2ad947[_0x752a('0x1c')]===_0x752a('0x1d')&&typeof _0x2ad947[_0x752a('0x1e')]===_0x752a('0x1d');var _0x52f175=_0x1d967a[_0x752a('0x1f')];var _0x4973ef=_0x4e2b56?0x0:_0x2ad947[_0x752a('0x1c')];var _0x3db53d=_0x4e2b56?_0x1d967a[_0x752a('0x1f')]:_0x2ad947[_0x752a('0x1c')]+_0x2ad947[_0x752a('0x1e')];var _0x5248c2;if(_0x3db53d>=_0x52f175){_0x3db53d=_0x52f175;_0x5248c2=0xc8;}else{_0x5248c2=0xce;}_0x1091e5[_0x752a('0x1a')](_0x5248c2);return _0x1091e5[_0x752a('0x20')](_0x752a('0x21'),_0x4973ef+'-'+_0x3db53d+'/'+_0x52f175)[_0x752a('0x1b')](_0x1d967a);}return null;};}function patchUpdates(_0x9056a5){return function(_0x4d276d){try{jsonpatch['apply'](_0x4d276d,_0x9056a5,!![]);}catch(_0x30cb6c){return BPromise[_0x752a('0x22')](_0x30cb6c);}return _0x4d276d[_0x752a('0x23')]();};}function saveUpdates(_0x24c10c,_0x58f48b){return function(_0xb71478){if(_0xb71478){return _0xb71478[_0x752a('0x24')](_0x24c10c)[_0x752a('0x25')](function(_0x2cf269){return _0x2cf269;});}return null;};}function removeEntity(_0x2f0d04,_0x54cdbf){return function(_0x3ba924){if(_0x3ba924){return _0x3ba924['destroy']()[_0x752a('0x25')](function(){_0x2f0d04[_0x752a('0x1a')](0xcc)[_0x752a('0x26')]();});}};}function handleEntityNotFound(_0x3ca500,_0xf1ff32){return function(_0x5b1f1a){if(!_0x5b1f1a){_0x3ca500['sendStatus'](0x194);}return _0x5b1f1a;};}function handleError(_0xd6ba41,_0x50fb40){_0x50fb40=_0x50fb40||0x1f4;return function(_0xf7e979){logger['error'](_0xf7e979[_0x752a('0x27')]);if(_0xf7e979[_0x752a('0x28')]){delete _0xf7e979[_0x752a('0x28')];}_0xd6ba41['status'](_0x50fb40)['send'](_0xf7e979);};}exports['index']=function(_0x455e3a,_0x38d78f){var _0x2f5059={},_0x4db606={},_0x520183={'count':0x0,'rows':[]};var _0x17495f=_[_0x752a('0x29')](db['WhatsappTransferReport'][_0x752a('0x2a')],function(_0x43c946){return{'name':_0x43c946[_0x752a('0x2b')],'type':_0x43c946[_0x752a('0x2c')]['key']};});_0x4db606[_0x752a('0x2d')]=_['map'](_0x17495f,_0x752a('0x28'));_0x4db606[_0x752a('0x2e')]=_[_0x752a('0x2f')](_0x455e3a[_0x752a('0x2e')]);_0x4db606[_0x752a('0x30')]=_[_0x752a('0x31')](_0x4db606[_0x752a('0x2d')],_0x4db606[_0x752a('0x2e')]);_0x2f5059['attributes']=_[_0x752a('0x31')](_0x4db606[_0x752a('0x2d')],qs[_0x752a('0x32')](_0x455e3a[_0x752a('0x2e')]['fields']));_0x2f5059['attributes']=_0x2f5059[_0x752a('0x33')][_0x752a('0x34')]?_0x2f5059[_0x752a('0x33')]:_0x4db606[_0x752a('0x2d')];if(!_0x455e3a['query'][_0x752a('0x35')](_0x752a('0x36'))){_0x2f5059[_0x752a('0x1e')]=qs[_0x752a('0x1e')](_0x455e3a['query'][_0x752a('0x1e')]);_0x2f5059[_0x752a('0x1c')]=qs[_0x752a('0x1c')](_0x455e3a[_0x752a('0x2e')][_0x752a('0x1c')]);}_0x2f5059[_0x752a('0x37')]=qs[_0x752a('0x38')](_0x455e3a[_0x752a('0x2e')][_0x752a('0x38')]);_0x2f5059['where']=qs[_0x752a('0x30')](_[_0x752a('0x39')](_0x455e3a[_0x752a('0x2e')],_0x4db606[_0x752a('0x30')]),_0x17495f);if(_0x455e3a['query'][_0x752a('0x3a')]){_0x2f5059[_0x752a('0x3b')]=_[_0x752a('0x3c')](_0x2f5059[_0x752a('0x3b')],{'$or':_['map'](_0x17495f,function(_0x4563be){if(_0x4563be['type']!==_0x752a('0x3d')){var _0x585bf3={};_0x585bf3[_0x4563be[_0x752a('0x28')]]={'$like':'%'+_0x455e3a[_0x752a('0x2e')]['filter']+'%'};return _0x585bf3;}})});}_0x2f5059=_['merge']({},_0x2f5059,_0x455e3a[_0x752a('0x3e')]);var _0x13a128={'where':_0x2f5059[_0x752a('0x3b')]};return db[_0x752a('0x3f')]['count'](_0x13a128)['then'](function(_0x25f24e){_0x520183['count']=_0x25f24e;if(_0x455e3a[_0x752a('0x2e')][_0x752a('0x40')]){_0x2f5059['include']=[{'all':!![]}];}return db[_0x752a('0x3f')][_0x752a('0x41')](_0x2f5059);})[_0x752a('0x25')](function(_0x2c8a36){_0x520183['rows']=_0x2c8a36;return _0x520183;})[_0x752a('0x25')](respondWithFilteredResult(_0x38d78f,_0x2f5059))[_0x752a('0x42')](handleError(_0x38d78f,null));};exports[_0x752a('0x43')]=function(_0x89fe1f,_0x3f44b6){var _0x45f4a8={'raw':!![],'where':{'id':_0x89fe1f[_0x752a('0x44')]['id']}},_0x4fc67f={};_0x4fc67f['model']=_[_0x752a('0x2f')](db[_0x752a('0x3f')][_0x752a('0x2a')]);_0x4fc67f[_0x752a('0x2e')]=_[_0x752a('0x2f')](_0x89fe1f[_0x752a('0x2e')]);_0x4fc67f[_0x752a('0x30')]=_[_0x752a('0x31')](_0x4fc67f[_0x752a('0x2d')],_0x4fc67f[_0x752a('0x2e')]);_0x45f4a8[_0x752a('0x33')]=_[_0x752a('0x31')](_0x4fc67f['model'],qs[_0x752a('0x32')](_0x89fe1f['query'][_0x752a('0x32')]));_0x45f4a8[_0x752a('0x33')]=_0x45f4a8[_0x752a('0x33')][_0x752a('0x34')]?_0x45f4a8[_0x752a('0x33')]:_0x4fc67f['model'];if(_0x89fe1f['query'][_0x752a('0x40')]){_0x45f4a8['include']=[{'all':!![]}];}_0x45f4a8=_[_0x752a('0x3c')]({},_0x45f4a8,_0x89fe1f['options']);return db[_0x752a('0x3f')][_0x752a('0x45')](_0x45f4a8)[_0x752a('0x25')](handleEntityNotFound(_0x3f44b6,null))['then'](respondWithResult(_0x3f44b6,null))[_0x752a('0x42')](handleError(_0x3f44b6,null));};exports['create']=function(_0x320ce8,_0x407214){return db['WhatsappTransferReport'][_0x752a('0x46')](_0x320ce8['body'],{})[_0x752a('0x25')](respondWithResult(_0x407214,0xc9))['catch'](handleError(_0x407214,null));};exports[_0x752a('0x24')]=function(_0x35be0c,_0x16b5ba){if(_0x35be0c[_0x752a('0x47')]['id']){delete _0x35be0c['body']['id'];}return db[_0x752a('0x3f')][_0x752a('0x45')]({'where':{'id':_0x35be0c[_0x752a('0x44')]['id']}})[_0x752a('0x25')](handleEntityNotFound(_0x16b5ba,null))[_0x752a('0x25')](saveUpdates(_0x35be0c[_0x752a('0x47')],null))['then'](respondWithResult(_0x16b5ba,null))[_0x752a('0x42')](handleError(_0x16b5ba,null));};exports[_0x752a('0x48')]=function(_0xc4413c,_0x53b2fe){return db['WhatsappTransferReport'][_0x752a('0x45')]({'where':{'id':_0xc4413c['params']['id']}})[_0x752a('0x25')](handleEntityNotFound(_0x53b2fe,null))[_0x752a('0x25')](removeEntity(_0x53b2fe,null))[_0x752a('0x42')](handleError(_0x53b2fe,null));};exports['describe']=function(_0x19a999,_0x57b656){return db['WhatsappTransferReport']['describe']()[_0x752a('0x25')](respondWithResult(_0x57b656,null))['catch'](handleError(_0x57b656,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a64ef5f..0369256 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 _0xd208=['report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','WhatsappTransferReport'];(function(_0x2036e9,_0x47ef77){var _0x432d66=function(_0x27356d){while(--_0x27356d){_0x2036e9['push'](_0x2036e9['shift']());}};_0x432d66(++_0x47ef77);}(_0xd208,0x16d));var _0x8d20=function(_0x4def53,_0x3a522a){_0x4def53=_0x4def53-0x0;var _0x1f22c6=_0xd208[_0x4def53];return _0x1f22c6;};'use strict';var _=require(_0x8d20('0x0'));var util=require('util');var logger=require(_0x8d20('0x1'))(_0x8d20('0x2'));var moment=require(_0x8d20('0x3'));var BPromise=require(_0x8d20('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d20('0x5'));var rimraf=require(_0x8d20('0x6'));var config=require(_0x8d20('0x7'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x438dcc,_0x1ac71e){return _0x438dcc['define'](_0x8d20('0x8'),attributes,{'tableName':_0x8d20('0x9'),'paranoid':![],'indexes':[{'name':_0x8d20('0xa'),'fields':[_0x8d20('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7053=['exports','define','WhatsappTransferReport','uniqueid','util','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes'];(function(_0x532f19,_0x51cd09){var _0x4270e8=function(_0x1f0af8){while(--_0x1f0af8){_0x532f19['push'](_0x532f19['shift']());}};_0x4270e8(++_0x51cd09);}(_0x7053,0x1a6));var _0x3705=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x7053[_0x2405bc];return _0x5272d4;};'use strict';var _=require('lodash');var util=require(_0x3705('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3705('0x1'));var BPromise=require(_0x3705('0x2'));var rp=require(_0x3705('0x3'));var fs=require('fs');var path=require(_0x3705('0x4'));var rimraf=require(_0x3705('0x5'));var config=require('../../config/environment');var attributes=require(_0x3705('0x6'));module[_0x3705('0x7')]=function(_0x14c1d5,_0x413035){return _0x14c1d5[_0x3705('0x8')](_0x3705('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x3705('0xa'),'fields':[_0x3705('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index a57ada4..e8f3370 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 _0xdd5e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17c1d5,_0x150c20){var _0x1c9e4c=function(_0xca9c17){while(--_0xca9c17){_0x17c1d5['push'](_0x17c1d5['shift']());}};_0x1c9e4c(++_0x150c20);}(_0xdd5e,0x127));var _0xedd5=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xdd5e[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0xedd5('0x0'));var moment=require(_0xedd5('0x1'));var BPromise=require(_0xedd5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedd5('0x3'));var db=require(_0xedd5('0x4'))['db'];var utils=require(_0xedd5('0x5'));var logger=require('../../config/logger')(_0xedd5('0x6'));var config=require(_0xedd5('0x7'));var jayson=require(_0xedd5('0x8'));var client=jayson[_0xedd5('0x9')][_0xedd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dc43c,_0x4d7607,_0x13f3c3){return new BPromise(function(_0x202832,_0x217992){return client['request'](_0x1dc43c,_0x13f3c3)[_0xedd5('0xb')](function(_0x54c662){logger[_0xedd5('0xc')](_0xedd5('0xd'),_0x4d7607,_0xedd5('0xe'));logger[_0xedd5('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x4d7607,_0xedd5('0xe'),JSON[_0xedd5('0x10')](_0x54c662));if(_0x54c662['error']){if(_0x54c662['error'][_0xedd5('0x11')]===0x1f4){logger[_0xedd5('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4d7607,_0x54c662[_0xedd5('0x12')]['message']);return _0x217992(_0x54c662[_0xedd5('0x12')][_0xedd5('0x13')]);}logger[_0xedd5('0x12')](_0xedd5('0xd'),_0x4d7607,_0x54c662[_0xedd5('0x12')][_0xedd5('0x13')]);return _0x202832(_0x54c662[_0xedd5('0x12')][_0xedd5('0x13')]);}else{logger[_0xedd5('0xc')](_0xedd5('0xd'),_0x4d7607,_0xedd5('0xe'));_0x202832(_0x54c662['result'][_0xedd5('0x13')]);}})['catch'](function(_0x5ec79d){logger[_0xedd5('0x12')](_0xedd5('0xd'),_0x4d7607,_0x5ec79d);_0x217992(_0x5ec79d);});});} \ No newline at end of file +var _0x07e8=['jayson/promise','client','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x29cb61,_0x494484){var _0x21d3e0=function(_0x3e0ac4){while(--_0x3e0ac4){_0x29cb61['push'](_0x29cb61['shift']());}};_0x21d3e0(++_0x494484);}(_0x07e8,0xa0));var _0x807e=function(_0x57f59d,_0x493f90){_0x57f59d=_0x57f59d-0x0;var _0x11c40d=_0x07e8[_0x57f59d];return _0x11c40d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x807e('0x0'));var BPromise=require(_0x807e('0x1'));var rs=require(_0x807e('0x2'));var fs=require('fs');var Redis=require(_0x807e('0x3'));var db=require(_0x807e('0x4'))['db'];var utils=require(_0x807e('0x5'));var logger=require(_0x807e('0x6'))(_0x807e('0x7'));var config=require('../../config/environment');var jayson=require(_0x807e('0x8'));var client=jayson[_0x807e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d6e43,_0x4db50b,_0x45d205){return new BPromise(function(_0x5bba6f,_0x3769fc){return client['request'](_0x3d6e43,_0x45d205)[_0x807e('0xa')](function(_0x153b12){logger['info'](_0x807e('0xb'),_0x4db50b,'request\x20sent');logger[_0x807e('0xc')](_0x807e('0xd'),_0x4db50b,_0x807e('0xe'),JSON[_0x807e('0xf')](_0x153b12));if(_0x153b12[_0x807e('0x10')]){if(_0x153b12['error'][_0x807e('0x11')]===0x1f4){logger['error'](_0x807e('0xb'),_0x4db50b,_0x153b12['error'][_0x807e('0x12')]);return _0x3769fc(_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);}logger[_0x807e('0x10')](_0x807e('0xb'),_0x4db50b,_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);return _0x5bba6f(_0x153b12[_0x807e('0x10')][_0x807e('0x12')]);}else{logger[_0x807e('0x13')](_0x807e('0xb'),_0x4db50b,'request\x20sent');_0x5bba6f(_0x153b12['result']['message']);}})[_0x807e('0x14')](function(_0x14606a){logger[_0x807e('0x10')](_0x807e('0xb'),_0x4db50b,_0x14606a);_0x3769fc(_0x14606a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index fad3c3f..2d1c53c 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a6b=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','filter','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x21ba8d,_0xc0373d){var _0x50374b=function(_0x51b03e){while(--_0x51b03e){_0x21ba8d['push'](_0x21ba8d['shift']());}};_0x50374b(++_0xc0373d);}(_0x9a6b,0x77));var _0xb9a6=function(_0x5f26ab,_0x1c61d3){_0x5f26ab=_0x5f26ab-0x0;var _0x504dc6=_0x9a6b[_0x5f26ab];return _0x504dc6;};'use strict';var _=require(_0xb9a6('0x0'));var db=require(_0xb9a6('0x1'))['db'];var seedDb=require(_0xb9a6('0x2'));var checkLicense=require(_0xb9a6('0x3'));var rpc=require(_0xb9a6('0x4'));var config=require(_0xb9a6('0x5'));var logger=require('./config/logger')(_0xb9a6('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0xb9a6('0x7'));var schedule=require(_0xb9a6('0x8'));var chat=require(_0xb9a6('0x9'));var whatsapp=require(_0xb9a6('0xa'));var transcribe=require(_0xb9a6('0xb'));var provider=require(_0xb9a6('0xc'));function main(){return db[_0xb9a6('0xd')][_0xb9a6('0xe')]()[_0xb9a6('0xf')](function(){if(config[_0xb9a6('0x10')]){return seedDb['default']();}})[_0xb9a6('0xf')](function(){return checkLicense[_0xb9a6('0x11')]();})['then'](function(){return rpc[_0xb9a6('0x12')]();})[_0xb9a6('0xf')](function(_0x296a91){logger[_0xb9a6('0x13')](_0x296a91);return chat['start']();})['then'](function(){return whatsapp['start']();})[_0xb9a6('0xf')](function(){return schedule['start']();})[_0xb9a6('0xf')](function(){return transcribe['start']();})[_0xb9a6('0xf')](function(){return provider[_0xb9a6('0x14')]();})[_0xb9a6('0xf')](function(_0x220d2f){logger[_0xb9a6('0x13')](_0x220d2f);return pm2[_0xb9a6('0x14')](pm2Config);})[_0xb9a6('0xf')](function(_0x158d6c){var _0x243086=_0x158d6c['filter'](function(_0x463f33){return typeof _0x463f33[_0xb9a6('0x15')]===_0xb9a6('0x16')&&_0x463f33[_0xb9a6('0x15')]>=0x0;});if(_0x243086['length']>0x0){throw new Error(_0x243086[_0xb9a6('0x17')]+_0xb9a6('0x18')+_[_0xb9a6('0x19')](_0x243086,function(_0x5b3395){return'\x22'+_0x5b3395[_0xb9a6('0x1a')][_0xb9a6('0x1b')]+'\x22';}));}logger[_0xb9a6('0x13')](_0xb9a6('0x1c'),_[_0xb9a6('0x19')](_['filter'](_0x158d6c,{'status':_0xb9a6('0x1d')}),_0xb9a6('0x1b'))[_0xb9a6('0x1e')]());logger[_0xb9a6('0x13')]('Offline\x20apps:',_['map'](_[_0xb9a6('0x1f')](_0x158d6c,function(_0x449b39){return _0x449b39[_0xb9a6('0x20')]!=='online';}),_0xb9a6('0x1b'))['join']()||_0xb9a6('0x21'));console[_0xb9a6('0x22')]('App\x20Ready!');})[_0xb9a6('0x23')](function(_0x4dfc8c){console['log'](_0xb9a6('0x24'),_0x4dfc8c);logger[_0xb9a6('0x25')](_0xb9a6('0x26'),_0x4dfc8c);process[_0xb9a6('0x27')](0x1);});}main(); \ No newline at end of file +var _0x102b=['\x20processes\x20failed\x20at\x20startup:\x20','map','Online\x20apps:','join','Offline\x20apps:','status','online','name','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','start','info','filter','exitCode','length'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x102b,0x1be));var _0xb102=function(_0xaf487e,_0x33f4bb){_0xaf487e=_0xaf487e-0x0;var _0x14a391=_0x102b[_0xaf487e];return _0x14a391;};'use strict';var _=require('lodash');var db=require(_0xb102('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xb102('0x1'));var rpc=require(_0xb102('0x2'));var config=require(_0xb102('0x3'));var logger=require(_0xb102('0x4'))(_0xb102('0x5'));var pm2=require(_0xb102('0x6'));var pm2Config=require(_0xb102('0x7'));var schedule=require(_0xb102('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xb102('0x9'));var transcribe=require(_0xb102('0xa'));var provider=require(_0xb102('0xb'));function main(){return db[_0xb102('0xc')][_0xb102('0xd')]()['then'](function(){if(config[_0xb102('0xe')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xb102('0xf')]();})['then'](function(){return rpc['listen']();})[_0xb102('0x10')](function(_0x19f257){logger['info'](_0x19f257);return chat[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return whatsapp[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return schedule[_0xb102('0x11')]();})[_0xb102('0x10')](function(){return transcribe[_0xb102('0x11')]();})['then'](function(){return provider[_0xb102('0x11')]();})['then'](function(_0x2327ee){logger[_0xb102('0x12')](_0x2327ee);return pm2['start'](pm2Config);})[_0xb102('0x10')](function(_0x38db8c){var _0x5ab722=_0x38db8c[_0xb102('0x13')](function(_0x2925fb){return typeof _0x2925fb[_0xb102('0x14')]==='number'&&_0x2925fb['exitCode']>=0x0;});if(_0x5ab722['length']>0x0){throw new Error(_0x5ab722[_0xb102('0x15')]+_0xb102('0x16')+_[_0xb102('0x17')](_0x5ab722,function(_0xc80615){return'\x22'+_0xc80615['pm2_env']['name']+'\x22';}));}logger[_0xb102('0x12')](_0xb102('0x18'),_[_0xb102('0x17')](_[_0xb102('0x13')](_0x38db8c,{'status':'online'}),'name')[_0xb102('0x19')]());logger[_0xb102('0x12')](_0xb102('0x1a'),_[_0xb102('0x17')](_['filter'](_0x38db8c,function(_0xd2206b){return _0xd2206b[_0xb102('0x1b')]!==_0xb102('0x1c');}),_0xb102('0x1d'))['join']()||'None');console[_0xb102('0x1e')](_0xb102('0x1f'));})['catch'](function(_0x1752f1){console['log'](_0xb102('0x20'),_0x1752f1);logger[_0xb102('0x21')](_0xb102('0x22'),_0x1752f1);process[_0xb102('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 22b3cf5..f93cea6 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 _0x80ed=['unshift','join','promisify','sign','secret','payload','options','verify','secrets','randomBytes','floor','now','toString','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','json','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','User\x20object\x20not\x20found.','canUpdate','Forbidden','getLicense','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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.','Sequelize','length','splice'];(function(_0x343c76,_0x1cac3a){var _0x1bb83=function(_0x23874a){while(--_0x23874a){_0x343c76['push'](_0x343c76['shift']());}};_0x1bb83(++_0x1cac3a);}(_0x80ed,0x11c));var _0xd80e=function(_0x995a5d,_0x44b1c1){_0x995a5d=_0x995a5d-0x0;var _0x3b6320=_0x80ed[_0x995a5d];return _0x3b6320;};'use strict';var db=require(_0xd80e('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xd80e('0x1'));var licenseUtil=require(_0xd80e('0x2'));var encryptor=require(_0xd80e('0x3'));var _=require('lodash');var jwt=require(_0xd80e('0x4'));var expressJwt=require(_0xd80e('0x5'));var compose=require(_0xd80e('0x6'));var basicAuth=require(_0xd80e('0x7'));var crypto=require('crypto');var BPromise=require(_0xd80e('0x8'));var util=require(_0xd80e('0x9'));var moment=require(_0xd80e('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0xd80e('0xb')]});var userAttributes=['id',_0xd80e('0xc'),_0xd80e('0xd'),_0xd80e('0xe'),_0xd80e('0xf'),_0xd80e('0x10'),_0xd80e('0x11'),_0xd80e('0x12'),_0xd80e('0x13'),_0xd80e('0x14'),'chatPause',_0xd80e('0x15'),_0xd80e('0x16'),_0xd80e('0x17'),_0xd80e('0x18'),_0xd80e('0x19'),_0xd80e('0x1a'),_0xd80e('0x1b'),_0xd80e('0x1c'),_0xd80e('0x1d'),'allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer',_0xd80e('0x1e'),_0xd80e('0x1f'),_0xd80e('0x20'),_0xd80e('0x21'),_0xd80e('0x22'),'phoneBarExpires',_0xd80e('0x23'),_0xd80e('0x24'),_0xd80e('0x25'),_0xd80e('0x26'),_0xd80e('0x27'),_0xd80e('0x28'),_0xd80e('0x29'),_0xd80e('0x2a'),'wssPort',_0xd80e('0x2b'),_0xd80e('0x2c'),_0xd80e('0x2d'),_0xd80e('0x2e'),'selectRecallMeCampaign',_0xd80e('0x2f'),_0xd80e('0x30'),_0xd80e('0x31'),'emailAutoanswerDelay',_0xd80e('0x32'),_0xd80e('0x33'),_0xd80e('0x34'),_0xd80e('0x35'),_0xd80e('0x36'),'faxAutoanswerDelay','whatsappAutoanswer',_0xd80e('0x37'),_0xd80e('0x38')];exports[_0xd80e('0x39')]=function(){return this[_0xd80e('0x3a')](!![])[_0xd80e('0x3b')](function(_0x326d66,_0x43152c,_0x5430b6){if(_0x326d66[_0xd80e('0x3c')]){_0x5430b6();}else{return db[_0xd80e('0x3d')][_0xd80e('0x3e')]({'where':{'id':_0x326d66['params']['id']},'attributes':['id',_0xd80e('0x3f'),_0xd80e('0x40')],'raw':!![]})[_0xd80e('0x41')](function(_0x482779){if(_0x482779&&_0x482779['closed']){return _0x43152c['status'](_0x482779[_0xd80e('0x40')]==='unmanaged'?0x195:0x193)[_0xd80e('0x42')]({'message':_0x482779[_0xd80e('0x40')]==='unmanaged'?_0xd80e('0x43'):_0xd80e('0x44')});}else{_0x5430b6();}})[_0xd80e('0x45')](function(_0x46c05d){_0x5430b6(_0x46c05d);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15f317){return compose()[_0xd80e('0x3b')](function(_0x845451,_0x39088b,_0x2b1aaf){var _0x361946;if(_0x845451[_0xd80e('0x46')][_0xd80e('0x47')]){if(_['startsWith'](_0x845451['headers'][_0xd80e('0x47')],_0xd80e('0x48'))){var _0x400220=basicAuth(_0x845451);db[_0xd80e('0x49')][_0xd80e('0x4a')]({'where':{'name':_0x400220[_0xd80e('0xe')]}})['then'](function(_0x568d82){if(!_0x568d82||!_0x568d82[_0xd80e('0x4b')](_0x400220[_0xd80e('0x4c')])){return _0x39088b[_0xd80e('0x4d')](0x191)[_0xd80e('0x42')]({'message':_0xd80e('0x4e')});}_0x845451[_0xd80e('0x3c')]={'id':_0x568d82['id']};_0x2b1aaf();})[_0xd80e('0x45')](function(_0x1a0dfe){_0x2b1aaf(_0x1a0dfe);});}else if(_['startsWith'](_0x845451['headers'][_0xd80e('0x47')],_0xd80e('0x4f'))){validateJwt(_0x845451,_0x39088b,_0x2b1aaf);}else{if(_0x15f317){_0x2b1aaf();}else{return _0x39088b[_0xd80e('0x4d')](0x193)[_0xd80e('0x42')]({'message':_0xd80e('0x50')});}}}else if(_0x845451[_0xd80e('0x51')][_0xd80e('0x52')]){try{var _0x3cb956={'audience':hardwareConf[_0xd80e('0x53')](),'issuer':hardwareConf[_0xd80e('0x53')]()};verifyJwt(_0x845451['query'][_0xd80e('0x52')],_0x3cb956)['then'](function(_0x22d371){return db[_0xd80e('0x49')][_0xd80e('0x4a')]({'where':{'id':_0x22d371[_0xd80e('0x54')]}})['then'](function(_0x3e44d7){_0x361946=_0x3e44d7;return db['Setting'][_0xd80e('0x3e')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd80e('0x55')],'raw':!![]});})[_0xd80e('0x41')](function(_0x4b7f32){if(!_0x361946||!_[_0xd80e('0x56')](_0x361946[_0xd80e('0x57')],_0x22d371[_0xd80e('0x58')])){return _0x39088b['status'](0x191)[_0xd80e('0x42')]({'message':_0xd80e('0x59')});}if(_0x361946[_0xd80e('0x5a')]){return _0x39088b[_0xd80e('0x4d')](0x191)[_0xd80e('0x42')]({'message':_0xd80e('0x5b')});}if(_0x361946[_0xd80e('0x5c')]){if(_0x4b7f32[_0xd80e('0x55')]>0x0){if(moment(_0x361946[_0xd80e('0x5d')])['add'](_0x4b7f32['blockDuration'],'minutes')>moment()){return _0x39088b[_0xd80e('0x4d')](0x191)[_0xd80e('0x42')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x39088b[_0xd80e('0x4d')](0x191)['json']({'message':_0xd80e('0x5b')});}}_0x845451['user']={'id':_0x361946['id']};_0x2b1aaf();});})[_0xd80e('0x45')](function(){return _0x39088b[_0xd80e('0x4d')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x44a736){_0x2b1aaf(_0x44a736);}}else if(_0x15f317){_0x2b1aaf();}else{return _0x39088b[_0xd80e('0x4d')](0x193)[_0xd80e('0x42')]({'message':_0xd80e('0x50')});}})[_0xd80e('0x3b')](function(_0x19de99,_0x20cbff,_0x439ba7){if(_0x19de99[_0xd80e('0x3c')]){db[_0xd80e('0x49')][_0xd80e('0x4a')]({'where':{'id':_0x19de99[_0xd80e('0x3c')]['id']},'attributes':userAttributes})[_0xd80e('0x41')](function(_0x11463c){if(!_0x11463c){return _0x20cbff[_0xd80e('0x4d')](0x194)[_0xd80e('0x42')]({'message':'User\x20not\x20found.'});}_0x19de99['user']=_0x11463c;_0x439ba7();})['catch'](function(_0x10dc30){_0x439ba7(_0x10dc30);});}else if(_0x15f317){_0x439ba7();}else{return _0x20cbff['status'](0x194)[_0xd80e('0x42')]({'message':_0xd80e('0x5e')});}});};exports[_0xd80e('0x5f')]=function canUpdate(){return compose()[_0xd80e('0x3b')](function(_0x2612e7,_0x7c394f,_0x506fd0){return licenseUtil['getLicense']()['then'](function(_0x2ea201){if(_0x2ea201['update']){_0x506fd0();}else{return _0x7c394f[_0xd80e('0x4d')](0x193)[_0xd80e('0x42')]({'message':_0xd80e('0x60')});}})[_0xd80e('0x45')](function(_0x28fda8){_0x506fd0(_0x28fda8);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xd80e('0x3b')](function(_0x4353f2,_0x3217c7,_0x5ba71d){return licenseUtil[_0xd80e('0x61')]()[_0xd80e('0x41')](function(_0x1b9ee5){if(_0x1b9ee5['webrtc']){_0x5ba71d();}else{return _0x3217c7[_0xd80e('0x4d')](0x193)[_0xd80e('0x42')]({'message':_0xd80e('0x60')});}})[_0xd80e('0x45')](function(_0x4144f5){_0x5ba71d(_0x4144f5);});});};exports[_0xd80e('0x62')]=function(_0x56ba81,_0x5aad1b,_0x275985){_0x56ba81[_0xd80e('0x62')]=!![];return _0x275985();};exports[_0xd80e('0x63')]=function signToken(_0x5dec55){return signJwt(_0x5dec55);};exports['setTokenCookie']=function(_0x1762a8,_0xff0980){if(!_0x1762a8[_0xd80e('0x3c')]){return _0xff0980[_0xd80e('0x4d')](0x194)[_0xd80e('0x42')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4237fe={'payload':{'id':_0x1762a8['user']['id'],'role':_0x1762a8[_0xd80e('0x3c')][_0xd80e('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4237fe)['then'](function(_0x29af86){_0xff0980[_0xd80e('0x64')](_0xd80e('0x65'),_0x29af86);_0xff0980[_0xd80e('0x66')](_0xd80e('0x67'));})[_0xd80e('0x45')](function(_0x18dbb0){return _0xff0980['status'](0x1f4)[_0xd80e('0x68')](_0x18dbb0);});};exports[_0xd80e('0x69')]=function(_0x419df7){if(_['isNil'](_0x419df7['apiKeyNonce'])||_[_0xd80e('0x6a')](_0x419df7[_0xd80e('0x6b')])){return null;}else{return createJwt(_0x419df7);}};exports[_0xd80e('0x6c')]=function(_0x23a40c){_0x23a40c[_0xd80e('0x57')]=generateNonce();_0x23a40c[_0xd80e('0x6b')]=generateIssuedAt();return createJwt(_0x23a40c);};exports[_0xd80e('0x6d')]=function(_0x3984fe,_0x5205c4){var _0x340311=_0x3984fe['query'][_0xd80e('0x52')];if(_0x340311){var _0x3c184c={'nonce':_0x5205c4[_0xd80e('0x57')],'iat':_0x5205c4[_0xd80e('0x6b')],'audience':hardwareConf[_0xd80e('0x53')](),'issuer':hardwareConf[_0xd80e('0x53')]()};return verifyJwt(_0x340311,_0x3c184c)['then'](function(){return generateApiKey(_0x5205c4);});}else{throw{'message':_0xd80e('0x6e')};}};exports['validatePasswordPattern']=function(_0x389413){var _0x6e506=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x6e506['test'](_0x389413))throw new db['Sequelize'][(_0xd80e('0x6f'))](_0xd80e('0x70'));return;};exports[_0xd80e('0x71')]=function(_0x570a02,_0x568770,_0x1ba0ed){var _0x387561=encryptor['decryptString'](_0x568770)[_0xd80e('0x72')](',');for(var _0x19e264=0x0;_0x19e264<_0x1ba0ed;_0x19e264++){if(!_0x387561[_0x19e264])break;if(_0x570a02[_0xd80e('0x73')]()===_0x387561[_0x19e264]['toLowerCase']()){var _0x41dda0=util['format'](_0xd80e('0x74'),_0x1ba0ed);if(_0x1ba0ed===0x1){_0x41dda0=_0xd80e('0x75');}throw new db[(_0xd80e('0x76'))][(_0xd80e('0x6f'))](_0x41dda0);}}return;};exports['updatePasswordsHistory']=function(_0x2df79e,_0x564475){var _0x53b784=_0x564475?encryptor['decryptString'](_0x564475)[_0xd80e('0x72')](','):[];if(_0x53b784[_0xd80e('0x77')]===0x5){_0x53b784[_0xd80e('0x78')](-0x1,0x1);}_0x53b784[_0xd80e('0x79')](_0x2df79e);return encryptor['encryptString'](_0x53b784[_0xd80e('0x7a')](','));};function signJwt(_0x280798){var _0x5d775f=BPromise[_0xd80e('0x7b')](jwt[_0xd80e('0x7c')],{'context':jwt});var _0x2c92b9=_0x280798[_0xd80e('0x7d')]||config['secrets'][_0xd80e('0xb')];return new BPromise(function(_0x1c2ba2,_0x57e904){_0x5d775f(_0x280798[_0xd80e('0x7e')],_0x2c92b9,_0x280798[_0xd80e('0x7f')])[_0xd80e('0x41')](function(_0x4abc70){_0x1c2ba2(_0x4abc70);})['catch'](function(_0x4c9383){_0x57e904(_0x4c9383);});});}function verifyJwt(_0x5f241c,_0x6edb7,_0x4f283c){var _0x3c8ad1=BPromise[_0xd80e('0x7b')](jwt[_0xd80e('0x80')],{'context':jwt});var _0x4e1b08=_0x4f283c||config[_0xd80e('0x81')][_0xd80e('0xb')];return new BPromise(function(_0x2b3ad6,_0x1a351b){_0x3c8ad1(_0x5f241c,_0x4e1b08,_0x6edb7)[_0xd80e('0x41')](function(_0x2a34cd){_0x2b3ad6(_0x2a34cd);})[_0xd80e('0x45')](function(_0x18cb0e){_0x1a351b(_0x18cb0e);});});}function generateNonce(){return crypto[_0xd80e('0x82')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xd80e('0x83')](Date[_0xd80e('0x84')]()/0x3e8)[_0xd80e('0x85')]();}function createJwt(_0x34b493){var _0x50df62={'payload':{'iat':_0x34b493[_0xd80e('0x6b')],'nonce':_0x34b493[_0xd80e('0x57')]},'options':{'algorithm':_0xd80e('0x86'),'subject':_0x34b493['id'][_0xd80e('0x85')](),'issuer':hardwareConf[_0xd80e('0x53')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x50df62)[_0xd80e('0x41')](function(_0x1e44f7){return{'iat':_0x34b493[_0xd80e('0x6b')],'nonce':_0x34b493[_0xd80e('0x57')],'token':_0x1e44f7};});} \ No newline at end of file +var _0xb03e=['disposition','then','status','json','unmanaged','Unmanaged.','headers','authorization','authenticate','pass','catch','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','Setting','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','blockedAt','minutes','Invalid\x20API\x20access\x20key','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','encryptString','join','promisify','sign','secret','payload','options','randomBytes','floor','now','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','name','internal','userpic','permissions','md5secret','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','findOne','params','closed'];(function(_0x3dbd93,_0x1ea5bb){var _0x28a67b=function(_0x3ba8a8){while(--_0x3ba8a8){_0x3dbd93['push'](_0x3dbd93['shift']());}};_0x28a67b(++_0x1ea5bb);}(_0xb03e,0x1eb));var _0xeb03=function(_0x361964,_0x18c5b1){_0x361964=_0x361964-0x0;var _0x329c5f=_0xb03e[_0x361964];return _0x329c5f;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xeb03('0x0'));var hardwareConf=require(_0xeb03('0x1'));var licenseUtil=require(_0xeb03('0x2'));var encryptor=require(_0xeb03('0x3'));var _=require(_0xeb03('0x4'));var jwt=require(_0xeb03('0x5'));var expressJwt=require(_0xeb03('0x6'));var compose=require(_0xeb03('0x7'));var basicAuth=require(_0xeb03('0x8'));var crypto=require(_0xeb03('0x9'));var BPromise=require(_0xeb03('0xa'));var util=require(_0xeb03('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xeb03('0xc')][_0xeb03('0xd')]});var userAttributes=['id',_0xeb03('0xe'),_0xeb03('0xf'),_0xeb03('0x10'),_0xeb03('0x11'),'email',_0xeb03('0x12'),_0xeb03('0x13'),_0xeb03('0x14'),'voicePause',_0xeb03('0x15'),'mailPause',_0xeb03('0x16'),_0xeb03('0x17'),_0xeb03('0x18'),_0xeb03('0x19'),_0xeb03('0x1a'),_0xeb03('0x1b'),_0xeb03('0x1c'),_0xeb03('0x1d'),_0xeb03('0x1e'),_0xeb03('0x1f'),_0xeb03('0x20'),_0xeb03('0x21'),'phoneBarAutoAnswerDelay',_0xeb03('0x22'),_0xeb03('0x23'),_0xeb03('0x24'),_0xeb03('0x25'),'phoneBarExpires',_0xeb03('0x26'),_0xeb03('0x27'),_0xeb03('0x28'),'hotdesk',_0xeb03('0x29'),_0xeb03('0x2a'),_0xeb03('0x2b'),_0xeb03('0x2c'),_0xeb03('0x2d'),_0xeb03('0x2e'),_0xeb03('0x2f'),_0xeb03('0x30'),_0xeb03('0x31'),_0xeb03('0x32'),_0xeb03('0x33'),_0xeb03('0x34'),_0xeb03('0x35'),_0xeb03('0x36'),'smsAutoanswer',_0xeb03('0x37'),_0xeb03('0x38'),_0xeb03('0x39'),_0xeb03('0x3a'),_0xeb03('0x3b'),_0xeb03('0x3c'),_0xeb03('0x3d'),_0xeb03('0x3e')];exports[_0xeb03('0x3f')]=function(){return this['isAuthenticated'](!![])[_0xeb03('0x40')](function(_0x1707ec,_0x11ea85,_0x300dc0){if(_0x1707ec[_0xeb03('0x41')]){_0x300dc0();}else{return db['ChatInteraction'][_0xeb03('0x42')]({'where':{'id':_0x1707ec[_0xeb03('0x43')]['id']},'attributes':['id',_0xeb03('0x44'),_0xeb03('0x45')],'raw':!![]})[_0xeb03('0x46')](function(_0x119697){if(_0x119697&&_0x119697[_0xeb03('0x44')]){return _0x11ea85[_0xeb03('0x47')](_0x119697[_0xeb03('0x45')]==='unmanaged'?0x195:0x193)[_0xeb03('0x48')]({'message':_0x119697[_0xeb03('0x45')]===_0xeb03('0x49')?_0xeb03('0x4a'):'Forbidden.'});}else{_0x300dc0();}})['catch'](function(_0x1064a5){_0x300dc0(_0x1064a5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x31a622){return compose()[_0xeb03('0x40')](function(_0x160a37,_0x5db8bb,_0xd4c8ec){var _0x5de53a;if(_0x160a37['headers']['authorization']){if(_['startsWith'](_0x160a37[_0xeb03('0x4b')][_0xeb03('0x4c')],'Basic')){var _0x528479=basicAuth(_0x160a37);db['User']['find']({'where':{'name':_0x528479[_0xeb03('0x10')]}})[_0xeb03('0x46')](function(_0x32aff7){if(!_0x32aff7||!_0x32aff7[_0xeb03('0x4d')](_0x528479[_0xeb03('0x4e')])){return _0x5db8bb['status'](0x191)[_0xeb03('0x48')]({'message':'Wrong\x20credentials.'});}_0x160a37[_0xeb03('0x41')]={'id':_0x32aff7['id']};_0xd4c8ec();})[_0xeb03('0x4f')](function(_0x19ceae){_0xd4c8ec(_0x19ceae);});}else if(_[_0xeb03('0x50')](_0x160a37[_0xeb03('0x4b')][_0xeb03('0x4c')],_0xeb03('0x51'))){validateJwt(_0x160a37,_0x5db8bb,_0xd4c8ec);}else{if(_0x31a622){_0xd4c8ec();}else{return _0x5db8bb[_0xeb03('0x47')](0x193)['json']({'message':_0xeb03('0x52')});}}}else if(_0x160a37['query'][_0xeb03('0x53')]){try{var _0xe3c81a={'audience':hardwareConf[_0xeb03('0x54')](),'issuer':hardwareConf[_0xeb03('0x54')]()};verifyJwt(_0x160a37[_0xeb03('0x55')][_0xeb03('0x53')],_0xe3c81a)['then'](function(_0x155b53){return db['User']['find']({'where':{'id':_0x155b53['sub']}})[_0xeb03('0x46')](function(_0x452868){_0x5de53a=_0x452868;return db[_0xeb03('0x56')][_0xeb03('0x42')]({'where':{'id':0x1},'attributes':[_0xeb03('0x57'),'blockDuration'],'raw':!![]});})[_0xeb03('0x46')](function(_0x166562){if(!_0x5de53a||!_[_0xeb03('0x58')](_0x5de53a['apiKeyNonce'],_0x155b53['nonce'])){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x59')});}if(_0x5de53a['disabled']){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5de53a['blocked']){if(_0x166562[_0xeb03('0x5a')]>0x0){if(moment(_0x5de53a[_0xeb03('0x5b')])['add'](_0x166562[_0xeb03('0x5a')],_0xeb03('0x5c'))>moment()){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x5d')});}}else{return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x5d')});}}_0x160a37[_0xeb03('0x41')]={'id':_0x5de53a['id']};_0xd4c8ec();});})[_0xeb03('0x4f')](function(){return _0x5db8bb[_0xeb03('0x47')](0x191)[_0xeb03('0x48')]({'message':_0xeb03('0x5d')});});}catch(_0x33414d){_0xd4c8ec(_0x33414d);}}else if(_0x31a622){_0xd4c8ec();}else{return _0x5db8bb[_0xeb03('0x47')](0x193)[_0xeb03('0x48')]({'message':_0xeb03('0x52')});}})[_0xeb03('0x40')](function(_0x35e53d,_0x138d13,_0x43e530){if(_0x35e53d[_0xeb03('0x41')]){db[_0xeb03('0x5e')]['find']({'where':{'id':_0x35e53d['user']['id']},'attributes':userAttributes})[_0xeb03('0x46')](function(_0x2262b7){if(!_0x2262b7){return _0x138d13[_0xeb03('0x47')](0x194)[_0xeb03('0x48')]({'message':_0xeb03('0x5f')});}_0x35e53d[_0xeb03('0x41')]=_0x2262b7;_0x43e530();})[_0xeb03('0x4f')](function(_0xcd049b){_0x43e530(_0xcd049b);});}else if(_0x31a622){_0x43e530();}else{return _0x138d13['status'](0x194)[_0xeb03('0x48')]({'message':_0xeb03('0x60')});}});};exports[_0xeb03('0x61')]=function canUpdate(){return compose()[_0xeb03('0x40')](function(_0x528c0f,_0x57f59e,_0x4ef29c){return licenseUtil[_0xeb03('0x62')]()['then'](function(_0x5bcc30){if(_0x5bcc30['update']){_0x4ef29c();}else{return _0x57f59e[_0xeb03('0x47')](0x193)[_0xeb03('0x48')]({'message':_0xeb03('0x63')});}})[_0xeb03('0x4f')](function(_0xb321da){_0x4ef29c(_0xb321da);});});};exports[_0xeb03('0x64')]=function isWebrtcLicence(){return compose()['use'](function(_0x35279d,_0x4bf739,_0x5c4fac){return licenseUtil[_0xeb03('0x62')]()[_0xeb03('0x46')](function(_0x205fa3){if(_0x205fa3['webrtc']){_0x5c4fac();}else{return _0x4bf739[_0xeb03('0x47')](0x193)[_0xeb03('0x48')]({'message':_0xeb03('0x63')});}})[_0xeb03('0x4f')](function(_0x3c8293){_0x5c4fac(_0x3c8293);});});};exports['isMiddleware']=function(_0x21a121,_0x4dc1f6,_0x13c295){_0x21a121[_0xeb03('0x65')]=!![];return _0x13c295();};exports[_0xeb03('0x66')]=function signToken(_0xa90a33){return signJwt(_0xa90a33);};exports[_0xeb03('0x67')]=function(_0x46f4a7,_0x42e73f){if(!_0x46f4a7[_0xeb03('0x41')]){return _0x42e73f[_0xeb03('0x47')](0x194)[_0xeb03('0x48')]({'message':_0xeb03('0x68')});}var _0x10ef7d={'payload':{'id':_0x46f4a7[_0xeb03('0x41')]['id'],'role':_0x46f4a7[_0xeb03('0x41')][_0xeb03('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x10ef7d)[_0xeb03('0x46')](function(_0xf5c1ab){_0x42e73f[_0xeb03('0x69')](_0xeb03('0x6a'),_0xf5c1ab);_0x42e73f[_0xeb03('0x6b')](_0xeb03('0x6c'));})[_0xeb03('0x4f')](function(_0x1761ab){return _0x42e73f[_0xeb03('0x47')](0x1f4)['send'](_0x1761ab);});};exports[_0xeb03('0x6d')]=function(_0x17bf76){if(_[_0xeb03('0x6e')](_0x17bf76['apiKeyNonce'])||_[_0xeb03('0x6e')](_0x17bf76[_0xeb03('0x6f')])){return null;}else{return createJwt(_0x17bf76);}};exports[_0xeb03('0x70')]=function(_0xf7e2b){_0xf7e2b[_0xeb03('0x71')]=generateNonce();_0xf7e2b[_0xeb03('0x6f')]=generateIssuedAt();return createJwt(_0xf7e2b);};exports[_0xeb03('0x72')]=function(_0x36f18e,_0x1fe50a){var _0x3bd612=_0x36f18e[_0xeb03('0x55')][_0xeb03('0x53')];if(_0x3bd612){var _0xf9beaf={'nonce':_0x1fe50a[_0xeb03('0x71')],'iat':_0x1fe50a['apiKeyIat'],'audience':hardwareConf[_0xeb03('0x54')](),'issuer':hardwareConf[_0xeb03('0x54')]()};return verifyJwt(_0x3bd612,_0xf9beaf)[_0xeb03('0x46')](function(){return generateApiKey(_0x1fe50a);});}else{throw{'message':_0xeb03('0x73')};}};exports[_0xeb03('0x74')]=function(_0x39e2c7){var _0x4320f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4320f7[_0xeb03('0x75')](_0x39e2c7))throw new db[(_0xeb03('0x76'))][(_0xeb03('0x77'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xeb03('0x78')]=function(_0x3a1cd2,_0x2bb0be,_0x62105a){var _0x58c096=encryptor[_0xeb03('0x79')](_0x2bb0be)[_0xeb03('0x7a')](',');for(var _0x2130c2=0x0;_0x2130c2<_0x62105a;_0x2130c2++){if(!_0x58c096[_0x2130c2])break;if(_0x3a1cd2[_0xeb03('0x7b')]()===_0x58c096[_0x2130c2][_0xeb03('0x7b')]()){var _0x4aa96e=util[_0xeb03('0x7c')](_0xeb03('0x7d'),_0x62105a);if(_0x62105a===0x1){_0x4aa96e=_0xeb03('0x7e');}throw new db['Sequelize'][(_0xeb03('0x77'))](_0x4aa96e);}}return;};exports[_0xeb03('0x7f')]=function(_0x4d9cfc,_0x1f6117){var _0x3102e3=_0x1f6117?encryptor[_0xeb03('0x79')](_0x1f6117)['split'](','):[];if(_0x3102e3[_0xeb03('0x80')]===0x5){_0x3102e3[_0xeb03('0x81')](-0x1,0x1);}_0x3102e3['unshift'](_0x4d9cfc);return encryptor[_0xeb03('0x82')](_0x3102e3[_0xeb03('0x83')](','));};function signJwt(_0x1972fb){var _0x3ac2de=BPromise[_0xeb03('0x84')](jwt[_0xeb03('0x85')],{'context':jwt});var _0x218ea5=_0x1972fb[_0xeb03('0x86')]||config['secrets'][_0xeb03('0xd')];return new BPromise(function(_0x50489b,_0xbcc043){_0x3ac2de(_0x1972fb[_0xeb03('0x87')],_0x218ea5,_0x1972fb[_0xeb03('0x88')])['then'](function(_0x1bd1b3){_0x50489b(_0x1bd1b3);})[_0xeb03('0x4f')](function(_0x14866f){_0xbcc043(_0x14866f);});});}function verifyJwt(_0x467a9d,_0x47c389,_0x3fe855){var _0x1cdf8e=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x583518=_0x3fe855||config[_0xeb03('0xc')][_0xeb03('0xd')];return new BPromise(function(_0x9148a6,_0x16ad3a){_0x1cdf8e(_0x467a9d,_0x583518,_0x47c389)[_0xeb03('0x46')](function(_0x461777){_0x9148a6(_0x461777);})[_0xeb03('0x4f')](function(_0x240178){_0x16ad3a(_0x240178);});});}function generateNonce(){return crypto[_0xeb03('0x89')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xeb03('0x8a')](Date[_0xeb03('0x8b')]()/0x3e8)['toString']();}function createJwt(_0x1c9851){var _0x3e003d={'payload':{'iat':_0x1c9851[_0xeb03('0x6f')],'nonce':_0x1c9851[_0xeb03('0x71')]},'options':{'algorithm':'HS512','subject':_0x1c9851['id']['toString'](),'issuer':hardwareConf[_0xeb03('0x54')](),'audience':hardwareConf[_0xeb03('0x54')]()}};return signJwt(_0x3e003d)[_0xeb03('0x46')](function(_0x50c482){return{'iat':_0x1c9851[_0xeb03('0x6f')],'nonce':_0x1c9851[_0xeb03('0x71')],'token':_0x50c482};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index be6b615..5c37a3f 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 _0x48f3=['catch','describe','CmContact','startsWith','cf_','CmCustomField','findOne','slice','all','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','parseQueryParameters','then','where','default','fields','filter','user','skip','checkListsRestrictions','search','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x48f3,0x180));var _0x348f=function(_0x16ec4a,_0x259794){_0x16ec4a=_0x16ec4a-0x0;var _0x197e0b=_0x48f3[_0x16ec4a];return _0x197e0b;};'use strict';var _=require(_0x348f('0x0'));var sqlUtils=require(_0x348f('0x1'));var db=require(_0x348f('0x2'))['db'];exports[_0x348f('0x3')]=function(_0x2cffba,_0x4f55e1,_0x4cbd02,_0x51b29d){var _0x3b4ddc={'count':0x0,'rows':[]};var _0x42fb45=sqlUtils[_0x348f('0x4')](_0x4f55e1,_0x2cffba);if(_0x42fb45){return Promise[_0x348f('0x5')](_0x3b4ddc);}var _0x14fcd6=sqlUtils[_0x348f('0x6')]();var _0x5bd483={};var _0xa761e2=![];var _0x249621=![];return Promise['resolve']()['then'](function(){if(_0x2cffba['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x2cffba['search'],_0x51b29d);}else{return sqlUtils[_0x348f('0x7')](_0x2cffba,_0x51b29d);}})[_0x348f('0x8')](function(_0x15526c){_0x14fcd6[_0x348f('0x9')](_0x15526c[_0x348f('0xa')]);_0x14fcd6[_0x348f('0x9')](_0x15526c[_0x348f('0xb')]);_0x14fcd6['where'](_0x15526c[_0x348f('0xc')]);_0x14fcd6['where'](_0x15526c[_0x348f('0xd')]['clause']);_0x5bd483=_0x15526c['tags'];_0x249621=_0x15526c[_0x348f('0xd')][_0x348f('0xe')];return sqlUtils[_0x348f('0xf')](_0x4f55e1,_0x2cffba,_0x249621);})['then'](function(_0x2947d9){_0x14fcd6[_0x348f('0x9')](_0x2947d9);var _0x16eb81=_0x2cffba[_0x348f('0x10')]?_0x5bd483['ids']:_0x2cffba[_0x348f('0x11')];_0xa761e2=_0x16eb81?!![]:![];return sqlUtils[_0x348f('0x12')](_0x14fcd6,_0x16eb81);})[_0x348f('0x8')](function(_0x135932){_0x3b4ddc[_0x348f('0x13')]=_0x135932;if(_0x3b4ddc[_0x348f('0x13')]===0x0){return;}if(_0x2cffba[_0x348f('0x14')]){_0x249621=!![];}return sqlUtils[_0x348f('0x15')](_0x14fcd6,_0x2cffba[_0x348f('0xb')],_0x4cbd02,_0xa761e2,_0x5bd483['clause'],_0x249621);})[_0x348f('0x8')](function(_0x317433){if(!_0x317433){return[];}return sqlUtils[_0x348f('0x16')](_0x317433,_0x2cffba,_0x4cbd02);})['then'](function(_0x1f800e){_0x3b4ddc[_0x348f('0x17')]=_0x1f800e;return _0x3b4ddc;})[_0x348f('0x18')](function(_0xa95b4a){throw _0xa95b4a;});};exports[_0x348f('0x19')]=function(){var _0x2213e4={};var _0x5419fb=[];return db[_0x348f('0x1a')]['describe']()[_0x348f('0x8')](function(_0x24d1d1){_0x2213e4=_0x24d1d1;var _0x37f450=Object['keys'](_0x2213e4)[_0x348f('0xc')](function(_0x38026c){return _[_0x348f('0x1b')](_0x38026c,_0x348f('0x1c'))?_0x38026c:undefined;});var _0xda154c=_0x37f450['map'](function(_0x4604dc){return db[_0x348f('0x1d')][_0x348f('0x1e')]({'where':{'id':_0x4604dc[_0x348f('0x1f')](0x3)},'raw':!![]});});return Promise[_0x348f('0x20')](_0xda154c);})[_0x348f('0x8')](function(_0x49e423){for(var _0x55a1da=0x0;_0x55a1da<_0x49e423['length'];_0x55a1da++){if(_0x49e423[_0x55a1da]){var _0x21a429='cf_'+_0x49e423[_0x55a1da]['id'];_0x2213e4[_0x21a429]['fieldType']=_0x49e423[_0x55a1da][_0x348f('0x21')];}}_0x5419fb=_['map'](Object['keys'](_0x2213e4),function(_0x599d19){return{'name':_0x599d19,'type':_0x2213e4[_0x599d19][_0x348f('0x21')]};});return _0x5419fb;})[_0x348f('0x18')](function(_0x2b9152){throw _0x2b9152;});}; \ No newline at end of file +var _0xd478=['user','skip','tag','countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','rows','describe','CmContact','cf_','map','CmCustomField','slice','all','length','type','catch','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','filter','tags'];(function(_0x89bb8e,_0x2a429f){var _0x11df0d=function(_0x44dc52){while(--_0x44dc52){_0x89bb8e['push'](_0x89bb8e['shift']());}};_0x11df0d(++_0x2a429f);}(_0xd478,0x9c));var _0x8d47=function(_0x1eac9b,_0x24bf2f){_0x1eac9b=_0x1eac9b-0x0;var _0x33dfd6=_0xd478[_0x1eac9b];return _0x33dfd6;};'use strict';var _=require(_0x8d47('0x0'));var sqlUtils=require(_0x8d47('0x1'));var db=require(_0x8d47('0x2'))['db'];exports[_0x8d47('0x3')]=function(_0x414dde,_0x4f15ca,_0x2b7f87,_0xb41367){var _0x71ae3d={'count':0x0,'rows':[]};var _0x5cbb10=sqlUtils[_0x8d47('0x4')](_0x4f15ca,_0x414dde);if(_0x5cbb10){return Promise[_0x8d47('0x5')](_0x71ae3d);}var _0x3b37d4=sqlUtils[_0x8d47('0x6')]();var _0x511bae={};var _0x3cfe2f=![];var _0x5a6b3d=![];return Promise[_0x8d47('0x5')]()[_0x8d47('0x7')](function(){if(_0x414dde[_0x8d47('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x414dde[_0x8d47('0x8')],_0xb41367);}else{return sqlUtils[_0x8d47('0x9')](_0x414dde,_0xb41367);}})[_0x8d47('0x7')](function(_0x2db3a7){_0x3b37d4[_0x8d47('0xa')](_0x2db3a7[_0x8d47('0xb')]);_0x3b37d4[_0x8d47('0xa')](_0x2db3a7['fields']);_0x3b37d4[_0x8d47('0xa')](_0x2db3a7[_0x8d47('0xc')]);_0x3b37d4[_0x8d47('0xa')](_0x2db3a7['user']['clause']);_0x511bae=_0x2db3a7[_0x8d47('0xd')];_0x5a6b3d=_0x2db3a7[_0x8d47('0xe')][_0x8d47('0xf')];return sqlUtils['checkListsRestrictions'](_0x4f15ca,_0x414dde,_0x5a6b3d);})[_0x8d47('0x7')](function(_0x500975){_0x3b37d4['where'](_0x500975);var _0x901ea5=_0x414dde[_0x8d47('0x8')]?_0x511bae['ids']:_0x414dde[_0x8d47('0x10')];_0x3cfe2f=_0x901ea5?!![]:![];return sqlUtils[_0x8d47('0x11')](_0x3b37d4,_0x901ea5);})[_0x8d47('0x7')](function(_0x365fd9){_0x71ae3d[_0x8d47('0x12')]=_0x365fd9;if(_0x71ae3d[_0x8d47('0x12')]===0x0){return;}if(_0x414dde[_0x8d47('0x13')]){_0x5a6b3d=!![];}return sqlUtils[_0x8d47('0x14')](_0x3b37d4,_0x414dde[_0x8d47('0x15')],_0x2b7f87,_0x3cfe2f,_0x511bae['clause'],_0x5a6b3d);})[_0x8d47('0x7')](function(_0x5ab229){if(!_0x5ab229){return[];}return sqlUtils[_0x8d47('0x16')](_0x5ab229,_0x414dde,_0x2b7f87);})[_0x8d47('0x7')](function(_0x5cecfc){_0x71ae3d[_0x8d47('0x17')]=_0x5cecfc;return _0x71ae3d;})['catch'](function(_0x275922){throw _0x275922;});};exports[_0x8d47('0x18')]=function(){var _0x387eb4={};var _0x4eb74a=[];return db[_0x8d47('0x19')][_0x8d47('0x18')]()[_0x8d47('0x7')](function(_0x30f4ef){_0x387eb4=_0x30f4ef;var _0x58df71=Object['keys'](_0x387eb4)[_0x8d47('0xc')](function(_0x2b14f9){return _['startsWith'](_0x2b14f9,_0x8d47('0x1a'))?_0x2b14f9:undefined;});var _0x1e5907=_0x58df71[_0x8d47('0x1b')](function(_0x366c07){return db[_0x8d47('0x1c')]['findOne']({'where':{'id':_0x366c07[_0x8d47('0x1d')](0x3)},'raw':!![]});});return Promise[_0x8d47('0x1e')](_0x1e5907);})[_0x8d47('0x7')](function(_0x10554d){for(var _0x3ed8e9=0x0;_0x3ed8e9<_0x10554d[_0x8d47('0x1f')];_0x3ed8e9++){if(_0x10554d[_0x3ed8e9]){var _0x386220='cf_'+_0x10554d[_0x3ed8e9]['id'];_0x387eb4[_0x386220]['fieldType']=_0x10554d[_0x3ed8e9][_0x8d47('0x20')];}}_0x4eb74a=_[_0x8d47('0x1b')](Object['keys'](_0x387eb4),function(_0x295765){return{'name':_0x295765,'type':_0x387eb4[_0x295765][_0x8d47('0x20')]};});return _0x4eb74a;})[_0x8d47('0x21')](function(_0xa391e6){throw _0xa391e6;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 5293a30..44cd819 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 _0xbe2f=['ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','value','end','Tag','map','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','tag','filter','getLists','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','keyBy','QueryTypes','SELECT','CmContact','sequelize','query','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','.id','left_join'];(function(_0x5aefa0,_0x387b10){var _0x34b6e8=function(_0x44285c){while(--_0x44285c){_0x5aefa0['push'](_0x5aefa0['shift']());}};_0x34b6e8(++_0x387b10);}(_0xbe2f,0x182));var _0xfbe2=function(_0x11da2c,_0xb84b59){_0x11da2c=_0x11da2c-0x0;var _0x27c614=_0xbe2f[_0x11da2c];return _0x27c614;};'use strict';var _=require(_0xfbe2('0x0'));var squel=require('squel');var as=require(_0xfbe2('0x1'));var qs=require(_0xfbe2('0x2'));var utils=require(_0xfbe2('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x1fbb7f,_0x3e710b){var _0x15c6c5=![];if(_0x1fbb7f[_0xfbe2('0x4')]===_0xfbe2('0x5')&&!_0x3e710b[_0xfbe2('0x6')]&&!_0x3e710b[_0xfbe2('0x7')]&&_0x3e710b[_0xfbe2('0x8')]!==_0xfbe2('0x9')){_0x15c6c5=!![];}return _0x15c6c5;}function getContactsSubquery(){return squel[_0xfbe2('0xa')]()[_0xfbe2('0xb')](_0xfbe2('0xc'),'c')[_0xfbe2('0xd')](_0xfbe2('0xe'));}function applyJoinClauses(_0x54bc8a,_0x5bc358){var _0x33b88c=_0x5bc358?'c':_0xfbe2('0xf');_0x54bc8a['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x33b88c+_0xfbe2('0x10'))[_0xfbe2('0x11')]('cm_contact_has_tags','ct',_0xfbe2('0x12')+_0x33b88c+'.id')[_0xfbe2('0x11')](_0xfbe2('0x13'),'t',_0xfbe2('0x14'));return _0x54bc8a;}function addFieldsToQuery(_0x1c84a6,_0x5bb13d,_0x5e9f08,_0x38dbbd,_0x3ff5a6){var _0x20dbe0=_0x3ff5a6?'c':_0xfbe2('0xf');if(!_0x5bb13d){_0x5bb13d=['id',_0xfbe2('0x15'),_0xfbe2('0x16'),'phone',_0xfbe2('0x17'),_0xfbe2('0x18'),'email',_0xfbe2('0x7'),_0xfbe2('0x19'),_0xfbe2('0x1a'),_0xfbe2('0x1b'),_0xfbe2('0x1c'),_0xfbe2('0x1d')];}else if(!_0x5bb13d[_0xfbe2('0x1e')]('id')){_0x5bb13d[_0xfbe2('0x1f')]('id');}var _0x520ea6=_0x5e9f08&&_0x3ff5a6||!_0x5e9f08&&!_0x3ff5a6;if(_0x38dbbd){_0x520ea6=_0x38dbbd&&_0x3ff5a6||!_0x38dbbd&&!_0x3ff5a6;}_0x5bb13d[_0xfbe2('0x20')](function(_0x391149){if(_0x391149==='TagIds'){if(_0x520ea6){_0x1c84a6[_0xfbe2('0x21')](_0xfbe2('0x22'),_0x391149);}else if(_0x5e9f08||_0x38dbbd){_0x1c84a6['field'](_0x20dbe0+'.'+_0x391149);}}else{_0x1c84a6[_0xfbe2('0x21')](_0x20dbe0+'.'+_0x391149);}});return _0x1c84a6;}function getSqlClauses(){var _0x5a7673={'default':squel[_0xfbe2('0x23')](),'fields':squel[_0xfbe2('0x23')](),'filter':squel[_0xfbe2('0x23')](),'tags':{'clause':squel[_0xfbe2('0x23')](),'ids':null},'user':{'clause':squel[_0xfbe2('0x23')](),'skip':![]}};return _0x5a7673;}function parseTagParameter(_0x8b0d53){var _0x4b902a=squel[_0xfbe2('0x23')]();if(_0x8b0d53){var _0x29a9a9=utils[_0xfbe2('0x24')](_0x8b0d53);_0x29a9a9[_0xfbe2('0x20')](function(_0x33ef0a){_0x4b902a['or'](_0xfbe2('0x25'),'%,'+_0x33ef0a+',%');});}return _0x4b902a;}function parseSearchFilter(_0x44b037){var _0x8c7067=squel[_0xfbe2('0x23')]();if(_0x44b037){var _0xb25abc=_0x44b037[_0xfbe2('0x26')]('\x5c','\x5c\x5c')[_0xfbe2('0x26')](/'/g,'\x27\x27');if(_0xb25abc[_0xfbe2('0x27')]('\x20')[_0xfbe2('0x28')]>0x1){_0x8c7067['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfbe2('0x29')](_0xb25abc,!![]),null);}else{if(qs['isNumeric'](_0xb25abc)){_0x8c7067['or']('c.id\x20LIKE\x20?',_0xb25abc+'%');_0x8c7067['or'](_0xfbe2('0x2a'),_0xb25abc+'%');_0x8c7067['or'](_0xfbe2('0x2b'),_0xb25abc+'%');_0x8c7067['or'](_0xfbe2('0x2c'),_0xb25abc+'%');}else if(qs[_0xfbe2('0x2d')](_0xb25abc)){_0x8c7067['or'](_0xfbe2('0x2e'),_0xb25abc+'%');}else{_0x8c7067['or']('c.firstName\x20LIKE\x20?','%'+_0xb25abc+'%');_0x8c7067['or'](_0xfbe2('0x2f'),'%'+_0xb25abc+'%');_0x8c7067['or'](_0xfbe2('0x2e'),'%'+_0xb25abc+'%');}}}return _0x8c7067;}function parseAdvancedSearchFilter(_0x191716,_0x2e7e60){var _0x136694=getSqlClauses();var _0x32790c=as[_0xfbe2('0x30')](_0x191716);var _0x2c7fb3=_0x32790c[_0xfbe2('0x31')];for(var _0x48598b=0x0;_0x48598b<_0x32790c[_0xfbe2('0x32')][_0xfbe2('0x28')];_0x48598b++){var _0x2d120e=_0x32790c[_0xfbe2('0x32')][_0x48598b];var _0x247d25='c';var _0x31874c=_['find'](_0x2e7e60,[_0xfbe2('0x33'),_0x2d120e['field']]);if(_0x31874c){if(_0x2d120e['field']===_0xfbe2('0x34')||_0x31874c[_0xfbe2('0x35')]===_0xfbe2('0x36')){_0x2d120e[_0xfbe2('0x37')]='DATE';}var _0x37bcf5=as[_0xfbe2('0x38')](_0x247d25,_0x31874c['type'],_0x2d120e);_0x136694['default'][_0x2c7fb3](_0x37bcf5['text'],_0x37bcf5[_0xfbe2('0x39')]['start'],_0x37bcf5[_0xfbe2('0x39')][_0xfbe2('0x3a')]);}else{if(_0x2d120e[_0xfbe2('0x21')]===_0xfbe2('0x3b')){var _0xd1ad11=_0x2d120e['value'][_0xfbe2('0x27')](',')[_0xfbe2('0x3c')](function(_0x5439aa){return Number(_0x5439aa);});var _0x889e34=parseTagParameter(_0xd1ad11);_0x136694[_0xfbe2('0x3d')]['clause'][_0xfbe2('0x3e')](_0x889e34);_0x136694[_0xfbe2('0x3d')][_0xfbe2('0x3f')]=_0xd1ad11;}else if(_0x2d120e[_0xfbe2('0x21')]===_0xfbe2('0x40')){_0x136694[_0xfbe2('0x41')][_0xfbe2('0x42')][_0xfbe2('0x3e')](_0xfbe2('0x43'),_0x2d120e[_0xfbe2('0x39')]);_0x136694[_0xfbe2('0x41')][_0xfbe2('0x44')]=!![];}}}return _0x136694;}function parseModelFields(_0x4223bc,_0x1c893f){var _0x31237b=squel['expr']();var _0x47cbde=_(_0x4223bc)[_0xfbe2('0x45')]()['map'](function(_0x35a89d){return _[_0xfbe2('0x46')](_0x1c893f,[_0xfbe2('0x33'),_0x35a89d])?_0x35a89d:undefined;})['compact']()[_0xfbe2('0x39')]();if(_0x4223bc[_0xfbe2('0x47')]){_0x47cbde['push'](_0xfbe2('0x47'));}if(_0x4223bc['User']){_0x47cbde[_0xfbe2('0x1f')](_0xfbe2('0x40'));}if(_0x47cbde[_0xfbe2('0x28')]>0x0){_0x47cbde['forEach'](function(_0x48389e){if(_0x48389e==='ListId'){_0x31237b[_0xfbe2('0x3e')](_0xfbe2('0x48'),[][_0xfbe2('0x49')](_0x4223bc[_0x48389e]));}else if(_0x48389e===_0xfbe2('0x47')){var _0x344d87='%'+_0x4223bc[_0x48389e]+'%';_0x31237b[_0xfbe2('0x3e')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x344d87);}else if(_0x48389e==='User'){_0x31237b[_0xfbe2('0x3e')]('uc.UserId\x20=\x20?',_0x4223bc[_0x48389e]);}else{_0x31237b[_0xfbe2('0x3e')]('c.'+_0x48389e+_0xfbe2('0x4a'),_0x4223bc[_0x48389e]);}});}return _0x31237b;}function parseQueryParameters(_0x7a0563,_0x48a22a){var _0x5b9770=getSqlClauses();return Promise[_0xfbe2('0x4b')]()['then'](function(){return parseModelFields(_0x7a0563,_0x48a22a);})[_0xfbe2('0x4c')](function(_0x406a99){_0x5b9770['fields'][_0xfbe2('0x3e')](_0x406a99);return parseTagParameter(_0x7a0563[_0xfbe2('0x4d')]);})[_0xfbe2('0x4c')](function(_0x48d064){_0x5b9770['tags'][_0xfbe2('0x42')][_0xfbe2('0x3e')](_0x48d064);return parseSearchFilter(_0x7a0563['filter']);})[_0xfbe2('0x4c')](function(_0x48b090){_0x5b9770[_0xfbe2('0x4e')]=_0x48b090;return _0x5b9770;});}function checkListsRestrictions(_0x130fa3,_0x3c7330,_0x3f8e13){var _0xa3885b=squel[_0xfbe2('0x23')]();return Promise[_0xfbe2('0x4b')]()[_0xfbe2('0x4c')](function(){if(_0x3c7330[_0xfbe2('0x6')]&&_0x130fa3[_0xfbe2('0x4')]==='agent'&&!_0x3f8e13){return _0x130fa3[_0xfbe2('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0xfbe2('0x4c')](function(_0x15fa4d){if(_0x15fa4d){if(_0x15fa4d[_0xfbe2('0x28')]===0x0){_0xa3885b['and']('c.ListId\x20IS\x20NULL');}else{_0xa3885b[_0xfbe2('0x3e')](_0xfbe2('0x48'),_['map'](_0x15fa4d,'id'));}}})[_0xfbe2('0x4c')](function(){return _0xa3885b;});}function buildContactsQuery(_0xe30a68,_0x57f853,_0x56171b,_0x3ac7ee,_0x3d5613,_0x1407f4){if(_0x57f853){_0x57f853=_0x56171b['attributes'];}_0xe30a68=addFieldsToQuery(_0xe30a68,_0x57f853,_0x3ac7ee,_0x1407f4,!![]);var _0x5109aa=squel[_0xfbe2('0xa')]();_0x5109aa=addFieldsToQuery(_0x5109aa,_0x57f853,_0x3ac7ee,_0x1407f4,![]);if(_0x3ac7ee||_0x1407f4){_0xe30a68=applyJoinClauses(_0xe30a68,!![]);_0xe30a68[_0xfbe2('0x50')](_0xfbe2('0x51'));if(_0x56171b[_0xfbe2('0x52')]){_0x5109aa[_0xfbe2('0x52')](_0x56171b['limit']);}if(_0x56171b[_0xfbe2('0x53')]){_0x5109aa[_0xfbe2('0x53')](_0x56171b[_0xfbe2('0x53')]);}}else{_0x5109aa=applyJoinClauses(_0x5109aa,![]);_0x5109aa[_0xfbe2('0x50')](_0xfbe2('0x54'));if(_0x56171b[_0xfbe2('0x52')]){_0xe30a68[_0xfbe2('0x52')](_0x56171b[_0xfbe2('0x52')]);}if(_0x56171b['offset']){_0xe30a68[_0xfbe2('0x53')](_0x56171b[_0xfbe2('0x53')]);}}_0x5109aa[_0xfbe2('0x55')](_0x3d5613);if(_0x56171b[_0xfbe2('0x56')]){_0x56171b['order'][_0xfbe2('0x20')](function(_0x4bd1df){_0xe30a68[_0xfbe2('0x56')]('c.'+_0x4bd1df[0x0],_0x4bd1df[0x1]===_0xfbe2('0x57')?![]:!![]);_0x5109aa[_0xfbe2('0x56')](_0xfbe2('0x58')+_0x4bd1df[0x0],_0x4bd1df[0x1]===_0xfbe2('0x57')?![]:!![]);});}_0x5109aa[_0xfbe2('0xb')](_0xe30a68,_0xfbe2('0xf'));return _0x5109aa;}function getFilteredContacts(_0xc611be){var _0x3a8f2b=[];return db[_0xfbe2('0x3b')]['findAll']({'attributes':['id',_0xfbe2('0x33'),'color'],'raw':!![]})[_0xfbe2('0x4c')](function(_0x2a91c6){_0x3a8f2b=_[_0xfbe2('0x59')](_0x2a91c6,'id');var _0x1af787={'type':db['Sequelize'][_0xfbe2('0x5a')][_0xfbe2('0x5b')],'model':db[_0xfbe2('0x5c')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xfbe2('0x5d')][_0xfbe2('0x5e')](_0xc611be['toString'](),_0x1af787);})['then'](function(_0x4a06cc){_0x4a06cc['forEach'](function(_0x52011f){if(_0x52011f[_0xfbe2('0x1d')]){_0x52011f['Tags']=[];_0x52011f[_0xfbe2('0x1d')][_0xfbe2('0x27')](',')[_0xfbe2('0x20')](function(_0x4a1a05){_0x52011f[_0xfbe2('0x5f')][_0xfbe2('0x1f')](_0x3a8f2b[_0x4a1a05]);});}delete _0x52011f[_0xfbe2('0x1d')];});return _0x4a06cc;});}function countFilteredContacts(_0x49f4ac,_0x3d1a15){var _0x4783ce=_0x49f4ac[_0xfbe2('0x60')]();_0x4783ce[_0xfbe2('0x21')](_0xfbe2('0x61'));_0x4783ce=applyJoinClauses(_0x4783ce,!![]);_0x49f4ac[_0xfbe2('0x50')]('c.id');var _0x1ab670=utils[_0xfbe2('0x24')](_0x3d1a15);if(!_[_0xfbe2('0x62')](_0x1ab670)){_0x4783ce['where'](_0xfbe2('0x63'),_0x1ab670);}var _0x563d79={'type':db['Sequelize'][_0xfbe2('0x5a')][_0xfbe2('0x5b')],'raw':!![]};return db[_0xfbe2('0x5d')]['query'](_0x4783ce['toString'](),_0x563d79)[_0xfbe2('0x4c')](function(_0x523f39){return _0x523f39[0x0]['COUNT(*)'];});}module[_0xfbe2('0x64')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x4797=['SELECT','CmContact','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','autocomplete','true','select','from','cm_contacts','where','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','name','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','Tag','split','clause','and','tags','user','uc.UserId\x20=\x20?','keys','map','some','compact','User','ListId','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','fields','tag','filter','then','getLists','c.ListId\x20IN\x20?','c.id','limit','offset','group','subqry.id','having','order','subqry.','DESC','findAll','color','keyBy','Sequelize'];(function(_0x3731ce,_0x1c97c1){var _0x4b120c=function(_0x2c7df1){while(--_0x2c7df1){_0x3731ce['push'](_0x3731ce['shift']());}};_0x4b120c(++_0x1c97c1);}(_0x4797,0x157));var _0x7479=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4797[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7479('0x0'));var squel=require('squel');var as=require(_0x7479('0x1'));var qs=require(_0x7479('0x2'));var utils=require(_0x7479('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x23bd92,_0x131709){var _0x1cf9d0=![];if(_0x23bd92[_0x7479('0x4')]===_0x7479('0x5')&&!_0x131709[_0x7479('0x6')]&&!_0x131709['ListId']&&_0x131709[_0x7479('0x7')]!==_0x7479('0x8')){_0x1cf9d0=!![];}return _0x1cf9d0;}function getContactsSubquery(){return squel[_0x7479('0x9')]()[_0x7479('0xa')](_0x7479('0xb'),'c')[_0x7479('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x1dc29a,_0x5ab66e){var _0x646ee9=_0x5ab66e?'c':'subqry';_0x1dc29a[_0x7479('0xd')](_0x7479('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x646ee9+'.id')[_0x7479('0xd')](_0x7479('0xf'),'ct',_0x7479('0x10')+_0x646ee9+_0x7479('0x11'))['left_join'](_0x7479('0x12'),'t',_0x7479('0x13'));return _0x1dc29a;}function addFieldsToQuery(_0x345565,_0x5e3c21,_0x5aefdb,_0x14afc3,_0xa8bbc7){var _0x2194cc=_0xa8bbc7?'c':_0x7479('0x14');if(!_0x5e3c21){_0x5e3c21=['id',_0x7479('0x15'),_0x7479('0x16'),_0x7479('0x17'),'mobile',_0x7479('0x18'),_0x7479('0x19'),'ListId',_0x7479('0x1a'),_0x7479('0x1b'),_0x7479('0x1c'),_0x7479('0x1d'),_0x7479('0x1e')];}else if(!_0x5e3c21[_0x7479('0x1f')]('id')){_0x5e3c21[_0x7479('0x20')]('id');}var _0x2b27d3=_0x5aefdb&&_0xa8bbc7||!_0x5aefdb&&!_0xa8bbc7;if(_0x14afc3){_0x2b27d3=_0x14afc3&&_0xa8bbc7||!_0x14afc3&&!_0xa8bbc7;}_0x5e3c21[_0x7479('0x21')](function(_0x50c4df){if(_0x50c4df===_0x7479('0x1e')){if(_0x2b27d3){_0x345565[_0x7479('0x22')](_0x7479('0x23'),_0x50c4df);}else if(_0x5aefdb||_0x14afc3){_0x345565[_0x7479('0x22')](_0x2194cc+'.'+_0x50c4df);}}else{_0x345565[_0x7479('0x22')](_0x2194cc+'.'+_0x50c4df);}});return _0x345565;}function getSqlClauses(){var _0xc1b5ac={'default':squel[_0x7479('0x24')](),'fields':squel[_0x7479('0x24')](),'filter':squel[_0x7479('0x24')](),'tags':{'clause':squel[_0x7479('0x24')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0xc1b5ac;}function parseTagParameter(_0x5d31a9){var _0x12ff5e=squel[_0x7479('0x24')]();if(_0x5d31a9){var _0x5b2fa2=utils[_0x7479('0x25')](_0x5d31a9);_0x5b2fa2[_0x7479('0x21')](function(_0x2d33d9){_0x12ff5e['or'](_0x7479('0x26'),'%,'+_0x2d33d9+',%');});}return _0x12ff5e;}function parseSearchFilter(_0x35d83e){var _0x540081=squel[_0x7479('0x24')]();if(_0x35d83e){var _0x450359=_0x35d83e[_0x7479('0x27')]('\x5c','\x5c\x5c')[_0x7479('0x27')](/'/g,'\x27\x27');if(_0x450359['split']('\x20')[_0x7479('0x28')]>0x1){_0x540081['or'](_0x7479('0x29'),qs[_0x7479('0x2a')](_0x450359,!![]),null);}else{if(qs[_0x7479('0x2b')](_0x450359)){_0x540081['or'](_0x7479('0x2c'),_0x450359+'%');_0x540081['or'](_0x7479('0x2d'),_0x450359+'%');_0x540081['or']('c.mobile\x20LIKE\x20?',_0x450359+'%');_0x540081['or'](_0x7479('0x2e'),_0x450359+'%');}else if(qs[_0x7479('0x2f')](_0x450359)){_0x540081['or']('c.email\x20LIKE\x20?',_0x450359+'%');}else{_0x540081['or'](_0x7479('0x30'),'%'+_0x450359+'%');_0x540081['or'](_0x7479('0x31'),'%'+_0x450359+'%');_0x540081['or'](_0x7479('0x32'),'%'+_0x450359+'%');}}}return _0x540081;}function parseAdvancedSearchFilter(_0x134f90,_0x247015){var _0xafe0f2=getSqlClauses();var _0x12c0de=as['parseSearch'](_0x134f90);var _0x5ccedc=_0x12c0de[_0x7479('0x33')];for(var _0x56a43f=0x0;_0x56a43f<_0x12c0de[_0x7479('0x34')][_0x7479('0x28')];_0x56a43f++){var _0x502589=_0x12c0de[_0x7479('0x34')][_0x56a43f];var _0x1c0723='c';var _0x42125e=_[_0x7479('0x35')](_0x247015,[_0x7479('0x36'),_0x502589[_0x7479('0x22')]]);if(_0x42125e){if(_0x502589['field']==='dateOfBirth'||_0x42125e[_0x7479('0x37')]===_0x7479('0x38')){_0x502589[_0x7479('0x39')]=_0x7479('0x3a');}var _0x19a9d3=as[_0x7479('0x3b')](_0x1c0723,_0x42125e[_0x7479('0x3c')],_0x502589);_0xafe0f2[_0x7479('0x3d')][_0x5ccedc](_0x19a9d3[_0x7479('0x3e')],_0x19a9d3[_0x7479('0x3f')][_0x7479('0x40')],_0x19a9d3[_0x7479('0x3f')]['end']);}else{if(_0x502589['field']===_0x7479('0x41')){var _0x34dcab=_0x502589['value'][_0x7479('0x42')](',')['map'](function(_0x7a2fa7){return Number(_0x7a2fa7);});var _0x3cb9dc=parseTagParameter(_0x34dcab);_0xafe0f2['tags'][_0x7479('0x43')][_0x7479('0x44')](_0x3cb9dc);_0xafe0f2[_0x7479('0x45')]['ids']=_0x34dcab;}else if(_0x502589[_0x7479('0x22')]==='User'){_0xafe0f2[_0x7479('0x46')][_0x7479('0x43')][_0x7479('0x44')](_0x7479('0x47'),_0x502589['value']);_0xafe0f2[_0x7479('0x46')]['skip']=!![];}}}return _0xafe0f2;}function parseModelFields(_0x531706,_0x2db0b4){var _0x399936=squel[_0x7479('0x24')]();var _0x559f07=_(_0x531706)[_0x7479('0x48')]()[_0x7479('0x49')](function(_0x5d076e){return _[_0x7479('0x4a')](_0x2db0b4,['name',_0x5d076e])?_0x5d076e:undefined;})[_0x7479('0x4b')]()[_0x7479('0x3f')]();if(_0x531706['Contact']){_0x559f07['push']('Contact');}if(_0x531706[_0x7479('0x4c')]){_0x559f07['push']('User');}if(_0x559f07[_0x7479('0x28')]>0x0){_0x559f07['forEach'](function(_0x2d06a4){if(_0x2d06a4===_0x7479('0x4d')){_0x399936['and']('c.ListId\x20IN\x20?',[][_0x7479('0x4e')](_0x531706[_0x2d06a4]));}else if(_0x2d06a4===_0x7479('0x4f')){var _0x3da812='%'+_0x531706[_0x2d06a4]+'%';_0x399936[_0x7479('0x44')](_0x7479('0x50'),_0x3da812);}else if(_0x2d06a4==='User'){_0x399936['and']('uc.UserId\x20=\x20?',_0x531706[_0x2d06a4]);}else{_0x399936[_0x7479('0x44')]('c.'+_0x2d06a4+'\x20=\x20?',_0x531706[_0x2d06a4]);}});}return _0x399936;}function parseQueryParameters(_0x43f99a,_0x27e81a){var _0x10f6bb=getSqlClauses();return Promise[_0x7479('0x51')]()['then'](function(){return parseModelFields(_0x43f99a,_0x27e81a);})['then'](function(_0x56b0c8){_0x10f6bb[_0x7479('0x52')][_0x7479('0x44')](_0x56b0c8);return parseTagParameter(_0x43f99a[_0x7479('0x53')]);})['then'](function(_0x1d02a1){_0x10f6bb[_0x7479('0x45')]['clause'][_0x7479('0x44')](_0x1d02a1);return parseSearchFilter(_0x43f99a[_0x7479('0x54')]);})[_0x7479('0x55')](function(_0x61afa3){_0x10f6bb['filter']=_0x61afa3;return _0x10f6bb;});}function checkListsRestrictions(_0x5acc3b,_0x4e5f7e,_0x61673a){var _0x406754=squel[_0x7479('0x24')]();return Promise[_0x7479('0x51')]()[_0x7479('0x55')](function(){if(_0x4e5f7e['search']&&_0x5acc3b[_0x7479('0x4')]==='agent'&&!_0x61673a){return _0x5acc3b[_0x7479('0x56')]({'attributes':['id'],'raw':!![]});}})[_0x7479('0x55')](function(_0x2121cf){if(_0x2121cf){if(_0x2121cf[_0x7479('0x28')]===0x0){_0x406754['and']('c.ListId\x20IS\x20NULL');}else{_0x406754[_0x7479('0x44')](_0x7479('0x57'),_[_0x7479('0x49')](_0x2121cf,'id'));}}})[_0x7479('0x55')](function(){return _0x406754;});}function buildContactsQuery(_0x1615bc,_0x52cd6,_0x54efa6,_0x1519ae,_0x5bd234,_0x10c13a){if(_0x52cd6){_0x52cd6=_0x54efa6['attributes'];}_0x1615bc=addFieldsToQuery(_0x1615bc,_0x52cd6,_0x1519ae,_0x10c13a,!![]);var _0x21e1c5=squel[_0x7479('0x9')]();_0x21e1c5=addFieldsToQuery(_0x21e1c5,_0x52cd6,_0x1519ae,_0x10c13a,![]);if(_0x1519ae||_0x10c13a){_0x1615bc=applyJoinClauses(_0x1615bc,!![]);_0x1615bc['group'](_0x7479('0x58'));if(_0x54efa6[_0x7479('0x59')]){_0x21e1c5[_0x7479('0x59')](_0x54efa6[_0x7479('0x59')]);}if(_0x54efa6['offset']){_0x21e1c5[_0x7479('0x5a')](_0x54efa6[_0x7479('0x5a')]);}}else{_0x21e1c5=applyJoinClauses(_0x21e1c5,![]);_0x21e1c5[_0x7479('0x5b')](_0x7479('0x5c'));if(_0x54efa6['limit']){_0x1615bc[_0x7479('0x59')](_0x54efa6['limit']);}if(_0x54efa6['offset']){_0x1615bc['offset'](_0x54efa6['offset']);}}_0x21e1c5[_0x7479('0x5d')](_0x5bd234);if(_0x54efa6[_0x7479('0x5e')]){_0x54efa6[_0x7479('0x5e')]['forEach'](function(_0x3ebfbc){_0x1615bc['order']('c.'+_0x3ebfbc[0x0],_0x3ebfbc[0x1]==='DESC'?![]:!![]);_0x21e1c5['order'](_0x7479('0x5f')+_0x3ebfbc[0x0],_0x3ebfbc[0x1]===_0x7479('0x60')?![]:!![]);});}_0x21e1c5[_0x7479('0xa')](_0x1615bc,'subqry');return _0x21e1c5;}function getFilteredContacts(_0x4f7c8f){var _0x26bdb5=[];return db[_0x7479('0x41')][_0x7479('0x61')]({'attributes':['id',_0x7479('0x36'),_0x7479('0x62')],'raw':!![]})[_0x7479('0x55')](function(_0x45bda6){_0x26bdb5=_[_0x7479('0x63')](_0x45bda6,'id');var _0x57ddad={'type':db[_0x7479('0x64')]['QueryTypes'][_0x7479('0x65')],'model':db[_0x7479('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x7479('0x67')](_0x4f7c8f[_0x7479('0x68')](),_0x57ddad);})['then'](function(_0x5a29dc){_0x5a29dc[_0x7479('0x21')](function(_0x19e71d){if(_0x19e71d[_0x7479('0x1e')]){_0x19e71d[_0x7479('0x69')]=[];_0x19e71d[_0x7479('0x1e')]['split'](',')['forEach'](function(_0x200b03){_0x19e71d['Tags'][_0x7479('0x20')](_0x26bdb5[_0x200b03]);});}delete _0x19e71d[_0x7479('0x1e')];});return _0x5a29dc;});}function countFilteredContacts(_0x1389a4,_0x2c3be2){var _0x50a632=_0x1389a4['clone']();_0x50a632[_0x7479('0x22')](_0x7479('0x6a'));_0x50a632=applyJoinClauses(_0x50a632,!![]);_0x1389a4[_0x7479('0x5b')](_0x7479('0x58'));var _0x56e5a1=utils[_0x7479('0x25')](_0x2c3be2);if(!_[_0x7479('0x6b')](_0x56e5a1)){_0x50a632[_0x7479('0xc')](_0x7479('0x6c'),_0x56e5a1);}var _0x318b37={'type':db['Sequelize'][_0x7479('0x6d')][_0x7479('0x65')],'raw':!![]};return db['sequelize'][_0x7479('0x67')](_0x50a632['toString'](),_0x318b37)[_0x7479('0x55')](function(_0x44533d){return _0x44533d[0x0][_0x7479('0x6a')];});}module[_0x7479('0x6e')]={'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 3b3a44d..11a16a5 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 _0x9c38=['data','update','binary','write','close','unlink','decryptFile','createReadStream','createDecipher','end','encryptString','secret','utf8','final','decryptString','base64','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher'];(function(_0x325abf,_0x42ee54){var _0xe95e47=function(_0x3e2b70){while(--_0x3e2b70){_0x325abf['push'](_0x325abf['shift']());}};_0xe95e47(++_0x42ee54);}(_0x9c38,0xe8));var _0x89c3=function(_0x358981,_0x5ec73e){_0x358981=_0x358981-0x0;var _0x401f07=_0x9c38[_0x358981];return _0x401f07;};'use strict';var crypto=require(_0x89c3('0x0'));var fs=require('fs');var BPromise=require(_0x89c3('0x1'));var _=require(_0x89c3('0x2'));var config=require(_0x89c3('0x3'));var logger=require('../../config/logger')(_0x89c3('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x89c3('0x5')][_0x89c3('0x6')],'algorithm':_0x89c3('0x7')};const fileOptions={'algorithm':_0x89c3('0x8')};if(config[_0x89c3('0x9')]&&config[_0x89c3('0x9')][_0x89c3('0xa')]){var isSupported=isAlgorithmSupported(config[_0x89c3('0x9')][_0x89c3('0xa')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x89c3('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x89c3('0xb')](',\x20');logger[_0x89c3('0xc')](config[_0x89c3('0x9')][_0x89c3('0xa')],_0x89c3('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x3ff481){return AES_SUPPORTED_RX['test'](_0x3ff481);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x89c3('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x5d46c5){return getSupportedCiphers()[_0x89c3('0xf')](_0x5d46c5)>-0x1;}function combineOptions(_0x5284f6){var _0x2178b2={};for(var _0xe85867 in fileOptions){if(fileOptions[_0x89c3('0x10')](_0xe85867)){_0x2178b2[_0xe85867]=fileOptions[_0xe85867];}}if(_0x5284f6){for(var _0x7a9dce in _0x5284f6){if(_0x5284f6[_0x89c3('0x10')](_0x7a9dce)){_0x2178b2[_0x7a9dce]=_0x5284f6[_0x7a9dce];}}}return _0x2178b2;}exports[_0x89c3('0x11')]=function(_0x3c4140,_0x232db0,_0x58eaac,_0x480f62){return new BPromise(function(_0x2e50e6,_0x236ccb){_0x480f62=combineOptions(_0x480f62);var _0x18c214=new Buffer(_0x58eaac);var _0x198dde=fs['createReadStream'](_0x3c4140);var _0x1c4509=fs[_0x89c3('0x12')](_0x232db0);var _0x12935c=crypto[_0x89c3('0x13')](_0x480f62[_0x89c3('0xa')],_0x18c214);_0x198dde['on'](_0x89c3('0x14'),function(_0x178774){var _0x15b8fd=new Buffer(_0x12935c[_0x89c3('0x15')](_0x178774),_0x89c3('0x16'));_0x1c4509[_0x89c3('0x17')](_0x15b8fd);});_0x198dde['on']('end',function(){try{var _0x3be70b=new Buffer(_0x12935c['final'](_0x89c3('0x16')),'binary');_0x1c4509[_0x89c3('0x17')](_0x3be70b);_0x1c4509['end']();_0x1c4509['on'](_0x89c3('0x18'),function(){return _0x2e50e6(_0x232db0);});}catch(_0x239979){fs[_0x89c3('0x19')](_0x232db0);return _0x236ccb(_0x239979);}});});};exports[_0x89c3('0x1a')]=function(_0x5144cc,_0x2abc82,_0x4de838,_0x2249f4){return new BPromise(function(_0x2cec2e,_0x79b9dc){_0x2249f4=combineOptions(_0x2249f4);var _0x1f4b2e=new Buffer(_0x4de838);var _0x5dbcc1=fs[_0x89c3('0x1b')](_0x5144cc);var _0x3540f5=fs[_0x89c3('0x12')](_0x2abc82);var _0x113a90=crypto[_0x89c3('0x1c')](_0x2249f4[_0x89c3('0xa')],_0x1f4b2e);_0x5dbcc1['on'](_0x89c3('0x14'),function(_0x161668){var _0x561ddd=new Buffer(_0x113a90[_0x89c3('0x15')](_0x161668),'binary');_0x3540f5[_0x89c3('0x17')](_0x561ddd);});_0x5dbcc1['on'](_0x89c3('0x1d'),function(){try{var _0xada8f1=new Buffer(_0x113a90['final'](_0x89c3('0x16')),_0x89c3('0x16'));_0x3540f5['write'](_0xada8f1);_0x3540f5[_0x89c3('0x1d')]();_0x3540f5['on'](_0x89c3('0x18'),function(){return _0x2cec2e(_0x2abc82);});}catch(_0x3aef1e){fs[_0x89c3('0x19')](_0x2abc82);return _0x79b9dc(_0x3aef1e);}});});};exports[_0x89c3('0x1e')]=function(_0x110714,_0x1e84be,_0x48b6b5){var _0x3327f2=_0x48b6b5||stringOptions[_0x89c3('0xa')];var _0x1cf4ba=_0x1e84be||stringOptions[_0x89c3('0x1f')];var _0x5484d6=crypto[_0x89c3('0x13')](_0x3327f2,_0x1cf4ba);var _0x155be7=_0x5484d6[_0x89c3('0x15')](_0x110714,_0x89c3('0x20'),'base64');_0x155be7+=_0x5484d6[_0x89c3('0x21')]('base64');return _0x155be7;};exports[_0x89c3('0x22')]=function(_0x1f46d8,_0x30156d,_0x5bb6f5){var _0x3c03a2=_0x5bb6f5||stringOptions[_0x89c3('0xa')];var _0x3e55f5=_0x30156d||stringOptions[_0x89c3('0x1f')];var _0x48e85a=crypto[_0x89c3('0x1c')](_0x3c03a2,_0x3e55f5);var _0x3e1d2f=_0x48e85a[_0x89c3('0x15')](_0x1f46d8,_0x89c3('0x23'),'utf8');_0x3e1d2f+=_0x48e85a[_0x89c3('0x21')](_0x89c3('0x20'));return _0x3e1d2f;}; \ No newline at end of file +var _0x3a04=['data','update','write','end','final','binary','close','unlink','decryptFile','createWriteStream','createDecipher','encryptString','secret','base64','utf8','crypto','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a04,0x1ef));var _0x43a0=function(_0x3245f7,_0x26bfad){_0x3245f7=_0x3245f7-0x0;var _0x472f77=_0x3a04[_0x3245f7];return _0x472f77;};'use strict';var crypto=require(_0x43a0('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x43a0('0x1'));var logger=require(_0x43a0('0x2'))(_0x43a0('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x43a0('0x4')],'algorithm':_0x43a0('0x5')};const fileOptions={'algorithm':_0x43a0('0x6')};if(config[_0x43a0('0x7')]&&config['encrypt'][_0x43a0('0x8')]){var isSupported=isAlgorithmSupported(config[_0x43a0('0x7')][_0x43a0('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0x43a0('0x7')][_0x43a0('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x43a0('0x9')](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4c8318){return AES_SUPPORTED_RX[_0x43a0('0xa')](_0x4c8318);}function getSupportedCiphers(){return crypto[_0x43a0('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x51d0f6){return getSupportedCiphers()[_0x43a0('0xc')](_0x51d0f6)>-0x1;}function combineOptions(_0x5a8cd1){var _0x331b18={};for(var _0x343423 in fileOptions){if(fileOptions[_0x43a0('0xd')](_0x343423)){_0x331b18[_0x343423]=fileOptions[_0x343423];}}if(_0x5a8cd1){for(var _0x6f976 in _0x5a8cd1){if(_0x5a8cd1[_0x43a0('0xd')](_0x6f976)){_0x331b18[_0x6f976]=_0x5a8cd1[_0x6f976];}}}return _0x331b18;}exports[_0x43a0('0xe')]=function(_0x36647e,_0x20641c,_0x561d2d,_0x587985){return new BPromise(function(_0x1efa7e,_0x3eb88e){_0x587985=combineOptions(_0x587985);var _0x5d9d99=new Buffer(_0x561d2d);var _0x18299d=fs[_0x43a0('0xf')](_0x36647e);var _0x1ab880=fs['createWriteStream'](_0x20641c);var _0x18019f=crypto[_0x43a0('0x10')](_0x587985[_0x43a0('0x8')],_0x5d9d99);_0x18299d['on'](_0x43a0('0x11'),function(_0x28cb54){var _0x15cc99=new Buffer(_0x18019f[_0x43a0('0x12')](_0x28cb54),'binary');_0x1ab880[_0x43a0('0x13')](_0x15cc99);});_0x18299d['on'](_0x43a0('0x14'),function(){try{var _0x25c3b8=new Buffer(_0x18019f[_0x43a0('0x15')](_0x43a0('0x16')),_0x43a0('0x16'));_0x1ab880['write'](_0x25c3b8);_0x1ab880[_0x43a0('0x14')]();_0x1ab880['on'](_0x43a0('0x17'),function(){return _0x1efa7e(_0x20641c);});}catch(_0x556cdd){fs[_0x43a0('0x18')](_0x20641c);return _0x3eb88e(_0x556cdd);}});});};exports[_0x43a0('0x19')]=function(_0x37fd53,_0x1418f5,_0xdd4ae8,_0x19c016){return new BPromise(function(_0x53717e,_0x2ca089){_0x19c016=combineOptions(_0x19c016);var _0x5e0b23=new Buffer(_0xdd4ae8);var _0x17b3f0=fs[_0x43a0('0xf')](_0x37fd53);var _0x44b6f0=fs[_0x43a0('0x1a')](_0x1418f5);var _0x4b88bf=crypto[_0x43a0('0x1b')](_0x19c016[_0x43a0('0x8')],_0x5e0b23);_0x17b3f0['on'](_0x43a0('0x11'),function(_0x473dd9){var _0x709801=new Buffer(_0x4b88bf['update'](_0x473dd9),_0x43a0('0x16'));_0x44b6f0[_0x43a0('0x13')](_0x709801);});_0x17b3f0['on'](_0x43a0('0x14'),function(){try{var _0x2c1f55=new Buffer(_0x4b88bf['final'](_0x43a0('0x16')),_0x43a0('0x16'));_0x44b6f0[_0x43a0('0x13')](_0x2c1f55);_0x44b6f0[_0x43a0('0x14')]();_0x44b6f0['on'](_0x43a0('0x17'),function(){return _0x53717e(_0x1418f5);});}catch(_0xd955f2){fs[_0x43a0('0x18')](_0x1418f5);return _0x2ca089(_0xd955f2);}});});};exports[_0x43a0('0x1c')]=function(_0x90abe9,_0xd83f54,_0x3db095){var _0x3297f1=_0x3db095||stringOptions['algorithm'];var _0x22f4da=_0xd83f54||stringOptions[_0x43a0('0x1d')];var _0x3443f4=crypto[_0x43a0('0x10')](_0x3297f1,_0x22f4da);var _0x8087f8=_0x3443f4[_0x43a0('0x12')](_0x90abe9,'utf8','base64');_0x8087f8+=_0x3443f4[_0x43a0('0x15')](_0x43a0('0x1e'));return _0x8087f8;};exports['decryptString']=function(_0x29f071,_0x43a023,_0x155411){var _0x371aff=_0x155411||stringOptions[_0x43a0('0x8')];var _0x4e71eb=_0x43a023||stringOptions[_0x43a0('0x1d')];var _0x44406f=crypto['createDecipher'](_0x371aff,_0x4e71eb);var _0xa08331=_0x44406f['update'](_0x29f071,'base64','utf8');_0xa08331+=_0x44406f[_0x43a0('0x15')](_0x43a0('0x1f'));return _0xa08331;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4587e14..4776fde 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 _0xa867=['SELECT','length','range','isInteger','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','split','join','mkdirSync','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','util','path','to-csv','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes'];(function(_0x164387,_0x578d67){var _0x1328d0=function(_0x57c86b){while(--_0x57c86b){_0x164387['push'](_0x164387['shift']());}};_0x1328d0(++_0x578d67);}(_0xa867,0x19a));var _0x7a86=function(_0x508132,_0x22a4b6){_0x508132=_0x508132-0x0;var _0x467bfd=_0xa867[_0x508132];return _0x467bfd;};'use strict';var util=require(_0x7a86('0x0'));var path=require(_0x7a86('0x1'));var _=require('lodash');var csv=require(_0x7a86('0x2'));var fs=require('fs');var BPromise=require(_0x7a86('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x7a86('0x4'));var db=require(_0x7a86('0x5'))['db'];var dbH=require('../../mysqldb')[_0x7a86('0x6')];var logger=require('../../config/logger')(_0x7a86('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x7a86('0x8')][0x2]);var QUERY=process[_0x7a86('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x453008,_0x1cde38){var _0x250db3={'status':_0x453008};var _0x44eb9f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1cde38){_0x250db3[_0x7a86('0x9')]=_0x1cde38;}return db['AnalyticExtractedReport'][_0x7a86('0xa')](_0x250db3,_0x44eb9f);}function main(){var _0x72c03f=0x1388;var _0x40bca1;logger['info'](util[_0x7a86('0xb')](_0x7a86('0xc'),EXTRACTED_REPORT_ID,_0x7a86('0xd')));return db[_0x7a86('0xe')][_0x7a86('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x7a86('0x10')](function(_0x12bdc9){if(_0x12bdc9){_0x40bca1=_0x12bdc9;_0x72c03f=_0x40bca1[_0x7a86('0x11')]||0x1388;}})[_0x7a86('0x10')](function(){return dbH[_0x7a86('0x12')][_0x7a86('0x13')](util[_0x7a86('0xb')](_0x7a86('0x14'),QUERY),{'type':dbH[_0x7a86('0x12')][_0x7a86('0x15')][_0x7a86('0x16')]});})[_0x7a86('0x10')](function(_0x3d1f31){if(!_0x3d1f31[0x0]['num']){return analyticExtractedReport('Empty');}var _0x54f932=[];var _0x447f58=0x0;if(_0x40bca1['split']){if(_0x3d1f31&&_0x3d1f31[_0x7a86('0x17')]){var _0x45d8be=_[_0x7a86('0x18')](_0x3d1f31[0x0]['num']/_0x72c03f);var _0x596660=Number[_0x7a86('0x19')](_0x3d1f31[0x0][_0x7a86('0x1a')]/_0x72c03f)?_0x3d1f31[0x0][_0x7a86('0x1a')]%_0x72c03f:0x0;_0x45d8be[_0x7a86('0x1b')](function(_0x28d8ef){if(_0x28d8ef>0x0){_0x447f58+=_0x72c03f;}_0x54f932['push'](dbH[_0x7a86('0x12')][_0x7a86('0x13')](util[_0x7a86('0xb')](_0x7a86('0x1c'),QUERY,_0x72c03f,_0x447f58),{'type':dbH['sequelize']['QueryTypes'][_0x7a86('0x16')]}));});if(_0x596660>0x0){_0x447f58+=_0x72c03f;_0x54f932['push'](dbH[_0x7a86('0x12')][_0x7a86('0x13')](util['format'](_0x7a86('0x1c'),QUERY,_0x596660,_0x447f58),{'type':dbH[_0x7a86('0x12')]['QueryTypes'][_0x7a86('0x16')]}));}}}else{_0x54f932[_0x7a86('0x1d')](dbH[_0x7a86('0x12')][_0x7a86('0x13')](QUERY,{'type':dbH[_0x7a86('0x12')][_0x7a86('0x15')][_0x7a86('0x16')]}));}var _0x29722c=path[_0x7a86('0x1e')](PATH);var _0x4c1336=path[_0x7a86('0x1f')](PATH,_0x7a86('0x20'));var _0x2f6236=_0x40bca1[_0x7a86('0x21')]&&_0x54f932['length']>0x1;var _0x1aff34=[];if(!fs['existsSync'](path[_0x7a86('0x22')](_0x29722c,_0x4c1336))&&_0x2f6236){fs[_0x7a86('0x23')](path['join'](_0x29722c,_0x4c1336));}return BPromise['each'](_0x54f932,function(_0x2a7c2b){_0x1aff34[_0x7a86('0x1d')](_0x2a7c2b);})[_0x7a86('0x10')](function(){for(var _0x5e4f7a=0x0;_0x5e4f7a<_0x1aff34[_0x7a86('0x17')];_0x5e4f7a+=0x1){var _0x55a1df;var _0x1e9a66=_0x1aff34[_0x5e4f7a];if(_0x2f6236){_0x55a1df=path[_0x7a86('0x22')](_0x29722c,_0x4c1336,util['format'](_0x7a86('0x24'),_0x4c1336,_0x5e4f7a,_0x7a86('0x25')));}else{_0x55a1df=path[_0x7a86('0x22')](_0x29722c,util['format'](_0x7a86('0x26'),_0x4c1336,_0x7a86('0x25')));}fs['writeFileSync'](_0x55a1df,csv(_0x1e9a66));}})[_0x7a86('0x10')](function(){if(_0x2f6236){return new Promise(function(_0x1c126c){zipdir(path[_0x7a86('0x22')](_0x29722c,_0x4c1336),{'saveTo':path[_0x7a86('0x22')](_0x29722c,util[_0x7a86('0xb')]('%s.%s',_0x4c1336,_0x7a86('0x27')))},function(_0x358a09,_0x4d1a73){rimraf(path[_0x7a86('0x22')](_0x29722c,_0x4c1336),function(){});_0x1c126c(_0x7a86('0x28'));});});}})[_0x7a86('0x10')](function(){logger[_0x7a86('0x29')](util[_0x7a86('0xb')](_0x7a86('0x2a'),EXTRACTED_REPORT_ID,_0x7a86('0xd')));return analyticExtractedReport(_0x7a86('0x2b'),_0x2f6236?util[_0x7a86('0xb')](_0x7a86('0x26'),_0x4c1336,_0x2f6236?'zip':_0x7a86('0x25')):null);});})[_0x7a86('0x2c')](function(_0x138e37){logger[_0x7a86('0x29')](util['format'](_0x7a86('0x2d'),EXTRACTED_REPORT_ID,_0x7a86('0xd')),util[_0x7a86('0x2e')](_0x138e37,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x7a86('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x08f8=['Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','length','range','num','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x43df64,_0x269872){var _0x2efeea=function(_0x1522b5){while(--_0x1522b5){_0x43df64['push'](_0x43df64['shift']());}};_0x2efeea(++_0x269872);}(_0x08f8,0x1a0));var _0x808f=function(_0x14be38,_0x3b44a8){_0x14be38=_0x14be38-0x0;var _0x2a5890=_0x08f8[_0x14be38];return _0x2a5890;};'use strict';var util=require(_0x808f('0x0'));var path=require(_0x808f('0x1'));var _=require(_0x808f('0x2'));var csv=require(_0x808f('0x3'));var fs=require('fs');var BPromise=require(_0x808f('0x4'));var zipdir=require(_0x808f('0x5'));var rimraf=require(_0x808f('0x6'));var db=require(_0x808f('0x7'))['db'];var dbH=require(_0x808f('0x7'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x808f('0x8')][0x2]);var QUERY=process[_0x808f('0x8')][0x3];var PATH=process[_0x808f('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xc0870d,_0x34e921){var _0x5ed9e2={'status':_0xc0870d};var _0x4a5884={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34e921){_0x5ed9e2[_0x808f('0x9')]=_0x34e921;}return db[_0x808f('0xa')][_0x808f('0xb')](_0x5ed9e2,_0x4a5884);}function main(){var _0x6e688c=0x1388;var _0x59e0cd;logger[_0x808f('0xc')](util[_0x808f('0xd')](_0x808f('0xe'),EXTRACTED_REPORT_ID,_0x808f('0xf')));return db[_0x808f('0x10')][_0x808f('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x808f('0x12'),_0x808f('0x13')]})[_0x808f('0x14')](function(_0x388e40){if(_0x388e40){_0x59e0cd=_0x388e40;_0x6e688c=_0x59e0cd[_0x808f('0x13')]||0x1388;}})[_0x808f('0x14')](function(){return dbH['sequelize']['query'](util[_0x808f('0xd')](_0x808f('0x15'),QUERY),{'type':dbH[_0x808f('0x16')][_0x808f('0x17')][_0x808f('0x18')]});})[_0x808f('0x14')](function(_0x13653b){if(!_0x13653b[0x0]['num']){return analyticExtractedReport(_0x808f('0x19'));}var _0x17cdee=[];var _0x4737e5=0x0;if(_0x59e0cd[_0x808f('0x12')]){if(_0x13653b&&_0x13653b[_0x808f('0x1a')]){var _0x2dbcf6=_[_0x808f('0x1b')](_0x13653b[0x0][_0x808f('0x1c')]/_0x6e688c);var _0x4b04c7=Number['isInteger'](_0x13653b[0x0][_0x808f('0x1c')]/_0x6e688c)?_0x13653b[0x0][_0x808f('0x1c')]%_0x6e688c:0x0;_0x2dbcf6[_0x808f('0x1d')](function(_0x5d10fb){if(_0x5d10fb>0x0){_0x4737e5+=_0x6e688c;}_0x17cdee['push'](dbH[_0x808f('0x16')][_0x808f('0x1e')](util[_0x808f('0xd')](_0x808f('0x1f'),QUERY,_0x6e688c,_0x4737e5),{'type':dbH['sequelize'][_0x808f('0x17')][_0x808f('0x18')]}));});if(_0x4b04c7>0x0){_0x4737e5+=_0x6e688c;_0x17cdee[_0x808f('0x20')](dbH['sequelize'][_0x808f('0x1e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4b04c7,_0x4737e5),{'type':dbH['sequelize'][_0x808f('0x17')]['SELECT']}));}}}else{_0x17cdee[_0x808f('0x20')](dbH[_0x808f('0x16')]['query'](QUERY,{'type':dbH[_0x808f('0x16')][_0x808f('0x17')][_0x808f('0x18')]}));}var _0x300a7b=path[_0x808f('0x21')](PATH);var _0x3e2e26=path[_0x808f('0x22')](PATH,_0x808f('0x23'));var _0x5ccd92=_0x59e0cd[_0x808f('0x12')]&&_0x17cdee[_0x808f('0x1a')]>0x1;var _0x2d3086=[];if(!fs['existsSync'](path[_0x808f('0x24')](_0x300a7b,_0x3e2e26))&&_0x5ccd92){fs['mkdirSync'](path[_0x808f('0x24')](_0x300a7b,_0x3e2e26));}return BPromise[_0x808f('0x25')](_0x17cdee,function(_0x129f84){_0x2d3086[_0x808f('0x20')](_0x129f84);})[_0x808f('0x14')](function(){for(var _0xea83fd=0x0;_0xea83fd<_0x2d3086[_0x808f('0x1a')];_0xea83fd+=0x1){var _0x271657;var _0x44150d=_0x2d3086[_0xea83fd];if(_0x5ccd92){_0x271657=path[_0x808f('0x24')](_0x300a7b,_0x3e2e26,util['format'](_0x808f('0x26'),_0x3e2e26,_0xea83fd,_0x808f('0x27')));}else{_0x271657=path[_0x808f('0x24')](_0x300a7b,util[_0x808f('0xd')]('%s.%s',_0x3e2e26,_0x808f('0x27')));}fs[_0x808f('0x28')](_0x271657,csv(_0x44150d));}})[_0x808f('0x14')](function(){if(_0x5ccd92){return new Promise(function(_0x13c00a){zipdir(path[_0x808f('0x24')](_0x300a7b,_0x3e2e26),{'saveTo':path[_0x808f('0x24')](_0x300a7b,util[_0x808f('0xd')](_0x808f('0x29'),_0x3e2e26,_0x808f('0x2a')))},function(_0x6a6098,_0x4a7ea2){rimraf(path[_0x808f('0x24')](_0x300a7b,_0x3e2e26),function(){});_0x13c00a(_0x808f('0x2b'));});});}})[_0x808f('0x14')](function(){logger['info'](util[_0x808f('0xd')](_0x808f('0x2c'),EXTRACTED_REPORT_ID,_0x808f('0xf')));return analyticExtractedReport(_0x808f('0x2d'),_0x5ccd92?util[_0x808f('0xd')]('%s.%s',_0x3e2e26,_0x5ccd92?_0x808f('0x2a'):_0x808f('0x27')):null);});})[_0x808f('0x2e')](function(_0x47b722){logger[_0x808f('0xc')](util[_0x808f('0xd')](_0x808f('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x47b722,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2b6e786..c3923d4 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 _0x91d6=['Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','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','path','moment','pdfmake/src/printer','zip-dir','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','length','header','pageBreak','before','landscape','footer','Arial','black','right','num','Empty','split','splitSizePdf','then','range','isInteger','sequelize','query','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x286e68,_0x311af1){var _0x1582ad=function(_0x2d670a){while(--_0x2d670a){_0x286e68['push'](_0x286e68['shift']());}};_0x1582ad(++_0x311af1);}(_0x91d6,0x12a));var _0x691d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x91d6[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x691d('0x0'));var moment=require(_0x691d('0x1'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x691d('0x2'));var zipdir=require(_0x691d('0x3'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x691d('0x4')];var window=new JSDOM('')[_0x691d('0x5')];var BPromise=require(_0x691d('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x691d('0x7'))[_0x691d('0x8')];var logger=require(_0x691d('0x9'))(_0x691d('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x691d('0xb')][0x3];var PATH=process[_0x691d('0xb')][0x4];var NAME=process[_0x691d('0xb')][0x5];var FORMAT=_0x691d('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x6c9599,_0xd4664){var _0x47e024={'status':_0x6c9599};var _0x2bcbc5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd4664){_0x47e024[_0x691d('0xd')]=_0xd4664;}return db[_0x691d('0xe')][_0x691d('0xf')](_0x47e024,_0x2bcbc5);}function getHeaders(_0x4ee606){return _[_0x691d('0x10')](_0x4ee606,function(_0x50bf1a){return{'text':_0x50bf1a,'style':_0x691d('0x11')};});}function getRows(_0x57cd8f,_0x710317){return _[_0x691d('0x10')](_0x710317,function(_0x3bf59b){return _(_0x3bf59b)['pick'](_0x57cd8f)[_0x691d('0x10')](function(_0x4178d7){return _0x4178d7?_[_0x691d('0x12')](_0x4178d7):'';})[_0x691d('0x13')]();});}function createTable(_0x5a9edf,_0x322bcc){var _0x12bbd6={'widths':_['fill'](Array(_0x5a9edf['length']),0x91),'heights':function(_0x40729c){return _0x40729c===0x0?_0x691d('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xb85e48=getHeaders(_0x5a9edf);_0x12bbd6[_0x691d('0x15')][_0x691d('0x16')](_0xb85e48);var _0x5c036d=getRows(_0x5a9edf,_0x322bcc);_0x12bbd6[_0x691d('0x15')]=_0x12bbd6[_0x691d('0x15')][_0x691d('0x17')](_0x5c036d);return _0x12bbd6;}function createTables(_0x497656){var _0x3e5afa=[];var _0x4b923d=_[_0x691d('0x18')](Object[_0x691d('0x19')](_0x497656[0x0]),0x5);_0x4b923d[_0x691d('0x1a')](function(_0x32f09b){_0x3e5afa['push'](createTable(_0x32f09b,_0x497656));});return _0x3e5afa;}function getPDFDocDefinition(_0x26817d){var _0x1bd2f6=util[_0x691d('0x1b')](_0x691d('0x1c'),NAME,EXTRACTED_REPORT[_0x691d('0x1d')],moment(EXTRACTED_REPORT[_0x691d('0x1e')])[_0x691d('0x1b')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x691d('0x1b')](FORMAT));var _0xf2d770=[];for(var _0x59a69b=0x0;_0x59a69b<_0x26817d[_0x691d('0x1f')];_0x59a69b++){var _0x2665a0=[];if(_0x59a69b===0x0){_0x2665a0[_0x691d('0x16')]({'text':_0x1bd2f6,'style':_0x691d('0x20')});}var _0x4e1b9c={'table':_0x26817d[_0x59a69b]};if(_0x59a69b>0x0){_0x4e1b9c[_0x691d('0x21')]=_0x691d('0x22');_0x4e1b9c['margin']=[0x0,0x46,0x0,0x0];}_0x2665a0[_0x691d('0x16')](_0x4e1b9c);_0xf2d770['push'](_0x2665a0);}return{'pageSize':'A4','pageOrientation':_0x691d('0x23'),'content':_0xf2d770,'footer':function(_0x541ff4,_0x590199){return{'text':_0x541ff4[_0x691d('0x12')]()+'\x20/\x20'+_0x590199,'style':_0x691d('0x24')};},'defaultStyle':{'font':_0x691d('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x691d('0x26')},'footer':{'alignment':_0x691d('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x43c2ec){var _0x445f45=0x1388;var _0x2cae6e;if(!_0x43c2ec[0x0][_0x691d('0x28')]){return analyticExtractedReport(_0x691d('0x29'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x691d('0x2a'),_0x691d('0x2b')]})[_0x691d('0x2c')](function(_0x4a1ccc){if(_0x4a1ccc){_0x2cae6e=_0x4a1ccc;_0x445f45=_0x2cae6e[_0x691d('0x2b')]||0x3e8;}})['then'](function(){var _0x7013d=[];var _0x31dfc5=0x0;if(_0x2cae6e['split']){if(_0x43c2ec&&_0x43c2ec['length']){var _0x31c9ef=_[_0x691d('0x2d')](_0x43c2ec[0x0][_0x691d('0x28')]/_0x445f45);var _0xc1be4a=Number[_0x691d('0x2e')](_0x43c2ec[0x0]['num']/_0x445f45)?_0x43c2ec[0x0]['num']%_0x445f45:0x0;_0x31c9ef[_0x691d('0x1a')](function(_0x370521){if(_0x370521>0x0){_0x31dfc5+=_0x445f45;}_0x7013d[_0x691d('0x16')](dbH[_0x691d('0x2f')][_0x691d('0x30')](util[_0x691d('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x445f45,_0x31dfc5),{'type':dbH[_0x691d('0x2f')]['QueryTypes'][_0x691d('0x31')]}));});if(_0xc1be4a>0x0){_0x31dfc5+=_0x445f45;_0x7013d[_0x691d('0x16')](dbH[_0x691d('0x2f')][_0x691d('0x30')](util[_0x691d('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xc1be4a,_0x31dfc5),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x7013d[_0x691d('0x16')](dbH[_0x691d('0x2f')][_0x691d('0x30')](QUERY,{'type':dbH[_0x691d('0x2f')][_0x691d('0x32')][_0x691d('0x31')]}));}var _0x59dd38=path[_0x691d('0x33')](PATH);var _0x201e6f=path[_0x691d('0x34')](PATH,_0x691d('0x35'));var _0x5e34a9=_0x2cae6e['split']&&_0x7013d[_0x691d('0x1f')]>0x1;var _0x397667=[];if(!fs[_0x691d('0x36')](path[_0x691d('0x37')](_0x59dd38,_0x201e6f))&&_0x5e34a9){fs['mkdirSync'](path[_0x691d('0x37')](_0x59dd38,_0x201e6f));}return BPromise[_0x691d('0x38')](_0x7013d,function(_0x56ed30){_0x397667[_0x691d('0x16')](_0x56ed30);})[_0x691d('0x2c')](function(){var _0x404129=[];for(var _0x400c68=0x0;_0x400c68<_0x397667[_0x691d('0x1f')];_0x400c68+=0x1){var _0x5d2d4e=_0x397667[_0x400c68];var _0x50f5fe=createTables(_[_0x691d('0x39')](_0x5d2d4e));var _0x5532a7;var _0xe5e65=getPDFDocDefinition(_0x50f5fe);var _0x417609=getPDFPrinter();var _0x570729=_0x417609[_0x691d('0x3a')](_0xe5e65);if(_0x5e34a9){_0x5532a7=path[_0x691d('0x37')](_0x59dd38,_0x201e6f,util['format'](_0x691d('0x3b'),_0x201e6f,_0x400c68,_0x691d('0x3c')));}else{_0x5532a7=path['join'](_0x59dd38,util[_0x691d('0x1b')]('%s.%s',_0x201e6f,_0x691d('0x3c')));}_0x404129['push'](writePDFDocument(_0x570729,_0x5532a7));}return Promise[_0x691d('0x3d')](_0x404129);})[_0x691d('0x2c')](function(){if(_0x5e34a9){return new Promise(function(_0x4d0d25){zipdir(path['join'](_0x59dd38,_0x201e6f),{'saveTo':path[_0x691d('0x37')](_0x59dd38,util['format'](_0x691d('0x3e'),_0x201e6f,'zip'))},function(){rimraf(path[_0x691d('0x37')](_0x59dd38,_0x201e6f),function(){});_0x4d0d25(_0x691d('0x3f'));});});}})[_0x691d('0x2c')](function(){if(!_0x5e34a9)return;rimraf(path[_0x691d('0x37')](_0x59dd38,_0x201e6f),function(){});})[_0x691d('0x2c')](function(){logger[_0x691d('0x40')](util[_0x691d('0x1b')](_0x691d('0x41'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x691d('0x42'),_0x5e34a9?util[_0x691d('0x1b')](_0x691d('0x3e'),_0x201e6f,_0x5e34a9?_0x691d('0x43'):_0x691d('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x691d('0x1b')](_0x691d('0x44'),EXTRACTED_REPORT_ID,_0x691d('0x45')));return db[_0x691d('0xe')][_0x691d('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x691d('0x2c')](function(_0x1d7499){EXTRACTED_REPORT=_0x1d7499;return dbH[_0x691d('0x2f')]['query'](util[_0x691d('0x1b')](_0x691d('0x47'),QUERY),{'type':dbH['sequelize'][_0x691d('0x32')]['SELECT']});})[_0x691d('0x2c')](extractReport)[_0x691d('0x48')](function(_0x36effa){logger[_0x691d('0x40')](util[_0x691d('0x1b')](_0x691d('0x49'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x36effa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x691d('0x4a'));})[_0x691d('0x4b')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2121a7=new PdfPrinter({'Arial':{'normal':__dirname+_0x691d('0x4c'),'bold':__dirname+_0x691d('0x4d'),'italics':__dirname+_0x691d('0x4e'),'bolditalics':__dirname+_0x691d('0x4f')}});return _0x2121a7;}function getPDFDocDefinitionFromHTML(_0x150476,_0x2fda3a){var _0x1bd8aa=util['format'](_0x691d('0x50'),_0x2fda3a['channel'],_0x2fda3a[_0x691d('0x51')]);var _0x10f0ad=moment()[_0x691d('0x1b')]('YYYY-MM-DD')['toString']();var _0x4d991c=htmlToPdfmake(_0x150476,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4d991c],'defaultStyle':{'font':_0x691d('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x691d('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x691d('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x691d('0x52')}},'header':function(){return[{'text':_0x691d('0x53'),'style':_0x691d('0x20')}];},'footer':function(_0x34f9a4,_0x2157ca){return[{'text':util[_0x691d('0x1b')](_0x691d('0x54'),_0x1bd8aa,_0x34f9a4,_0x2157ca,_0x10f0ad),'style':'footer'}];}};}function writePDFDocument(_0x312983,_0x155a0c){return new Promise(function(_0x4aaff4,_0x1b9adc){var _0x8e45f3=_0x312983[_0x691d('0x55')](fs[_0x691d('0x56')](_0x155a0c));_0x8e45f3['on']('finish',function(){_0x4aaff4(_0x691d('0x57'));});_0x8e45f3['on'](_0x691d('0x58'),function(_0x1a2877){_0x1b9adc(_0x1a2877);});_0x312983[_0x691d('0x59')]();});}exports[_0x691d('0x5a')]=function(_0x39b0ae,_0xf16c2b){var _0x591ca2=getPDFPrinter();var _0x10f0ff=getPDFDocDefinitionFromHTML(_0x39b0ae,_0xf16c2b);var _0x147849=_0x591ca2['createPdfKitDocument'](_0x10f0ff);return writePDFDocument(_0x147849,_0xf16c2b[_0x691d('0x0')])[_0x691d('0x48')](function(_0x1ed380){throw _0x1ed380;});}; \ No newline at end of file +var _0x64d6=['center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','length','body','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','format','endDate','push','header','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','then','split','isInteger','forEach','sequelize','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','PDF','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64d6,0x10a));var _0x664d=function(_0x34e85b,_0x4602a5){_0x34e85b=_0x34e85b-0x0;var _0x309665=_0x64d6[_0x34e85b];return _0x309665;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x664d('0x0'));var path=require(_0x664d('0x1'));var moment=require(_0x664d('0x2'));var htmlToPdfmake=require(_0x664d('0x3'));var PdfPrinter=require(_0x664d('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x664d('0x5'))[_0x664d('0x6')];var window=new JSDOM('')[_0x664d('0x7')];var BPromise=require(_0x664d('0x8'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x664d('0x9')];var logger=require(_0x664d('0xa'))(_0x664d('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x664d('0xc')][0x3];var PATH=process[_0x664d('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x664d('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x206e54,_0xd7ec79){var _0x5b2138={'status':_0x206e54};var _0x5b4ded={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd7ec79){_0x5b2138[_0x664d('0xe')]=_0xd7ec79;}return db[_0x664d('0xf')]['update'](_0x5b2138,_0x5b4ded);}function getHeaders(_0x551401){return _[_0x664d('0x10')](_0x551401,function(_0x24895a){return{'text':_0x24895a,'style':_0x664d('0x11')};});}function getRows(_0x388158,_0x174c21){return _[_0x664d('0x10')](_0x174c21,function(_0x15cdc7){return _(_0x15cdc7)[_0x664d('0x12')](_0x388158)['map'](function(_0x287f2a){return _0x287f2a?_[_0x664d('0x13')](_0x287f2a):'';})['value']();});}function createTable(_0x33b6ee,_0x21a16b){var _0x2b4617={'widths':_['fill'](Array(_0x33b6ee[_0x664d('0x14')]),0x91),'heights':function(_0x3d2c10){return _0x3d2c10===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x31c290=getHeaders(_0x33b6ee);_0x2b4617[_0x664d('0x15')]['push'](_0x31c290);var _0x1bd214=getRows(_0x33b6ee,_0x21a16b);_0x2b4617[_0x664d('0x15')]=_0x2b4617[_0x664d('0x15')]['concat'](_0x1bd214);return _0x2b4617;}function createTables(_0x60c1c2){var _0x2758c2=[];var _0x277961=_[_0x664d('0x16')](Object[_0x664d('0x17')](_0x60c1c2[0x0]),0x5);_0x277961['forEach'](function(_0x6166ad){_0x2758c2['push'](createTable(_0x6166ad,_0x60c1c2));});return _0x2758c2;}function getPDFDocDefinition(_0x47d046){var _0x4eb38d=util['format'](_0x664d('0x18'),NAME,EXTRACTED_REPORT[_0x664d('0x19')],moment(EXTRACTED_REPORT['startDate'])[_0x664d('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x664d('0x1b')])[_0x664d('0x1a')](FORMAT));var _0xd403db=[];for(var _0x183aa1=0x0;_0x183aa1<_0x47d046[_0x664d('0x14')];_0x183aa1++){var _0x676306=[];if(_0x183aa1===0x0){_0x676306[_0x664d('0x1c')]({'text':_0x4eb38d,'style':_0x664d('0x1d')});}var _0xf53c87={'table':_0x47d046[_0x183aa1]};if(_0x183aa1>0x0){_0xf53c87['pageBreak']=_0x664d('0x1e');_0xf53c87[_0x664d('0x1f')]=[0x0,0x46,0x0,0x0];}_0x676306[_0x664d('0x1c')](_0xf53c87);_0xd403db[_0x664d('0x1c')](_0x676306);}return{'pageSize':'A4','pageOrientation':_0x664d('0x20'),'content':_0xd403db,'footer':function(_0x1257d9,_0x405c0f){return{'text':_0x1257d9[_0x664d('0x13')]()+_0x664d('0x21')+_0x405c0f,'style':_0x664d('0x22')};},'defaultStyle':{'font':_0x664d('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x664d('0x24')},'footer':{'alignment':_0x664d('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3d20d9){var _0x2fef9b=0x1388;var _0x527d4d;if(!_0x3d20d9[0x0][_0x664d('0x26')]){return analyticExtractedReport(_0x664d('0x27'));}return db[_0x664d('0x28')][_0x664d('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x664d('0x2a')](function(_0x1be9df){if(_0x1be9df){_0x527d4d=_0x1be9df;_0x2fef9b=_0x527d4d['splitSizePdf']||0x3e8;}})[_0x664d('0x2a')](function(){var _0x5ebe79=[];var _0x14ea49=0x0;if(_0x527d4d[_0x664d('0x2b')]){if(_0x3d20d9&&_0x3d20d9[_0x664d('0x14')]){var _0x12da25=_['range'](_0x3d20d9[0x0]['num']/_0x2fef9b);var _0x23504a=Number[_0x664d('0x2c')](_0x3d20d9[0x0][_0x664d('0x26')]/_0x2fef9b)?_0x3d20d9[0x0]['num']%_0x2fef9b:0x0;_0x12da25[_0x664d('0x2d')](function(_0x2a6857){if(_0x2a6857>0x0){_0x14ea49+=_0x2fef9b;}_0x5ebe79[_0x664d('0x1c')](dbH[_0x664d('0x2e')]['query'](util[_0x664d('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2fef9b,_0x14ea49),{'type':dbH[_0x664d('0x2e')][_0x664d('0x2f')][_0x664d('0x30')]}));});if(_0x23504a>0x0){_0x14ea49+=_0x2fef9b;_0x5ebe79[_0x664d('0x1c')](dbH[_0x664d('0x2e')][_0x664d('0x31')](util[_0x664d('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x23504a,_0x14ea49),{'type':dbH['sequelize']['QueryTypes'][_0x664d('0x30')]}));}}}else{_0x5ebe79[_0x664d('0x1c')](dbH['sequelize'][_0x664d('0x31')](QUERY,{'type':dbH['sequelize'][_0x664d('0x2f')][_0x664d('0x30')]}));}var _0x57aedc=path[_0x664d('0x32')](PATH);var _0x41406d=path[_0x664d('0x33')](PATH,_0x664d('0x34'));var _0x32b3fa=_0x527d4d[_0x664d('0x2b')]&&_0x5ebe79['length']>0x1;var _0x4668cd=[];if(!fs[_0x664d('0x35')](path[_0x664d('0x36')](_0x57aedc,_0x41406d))&&_0x32b3fa){fs[_0x664d('0x37')](path[_0x664d('0x36')](_0x57aedc,_0x41406d));}return BPromise[_0x664d('0x38')](_0x5ebe79,function(_0x49d26b){_0x4668cd['push'](_0x49d26b);})[_0x664d('0x2a')](function(){var _0x32a7d8=[];for(var _0x3395a0=0x0;_0x3395a0<_0x4668cd['length'];_0x3395a0+=0x1){var _0x96c35a=_0x4668cd[_0x3395a0];var _0x599872=createTables(_['flatten'](_0x96c35a));var _0x47e151;var _0x3e8142=getPDFDocDefinition(_0x599872);var _0x2ddd81=getPDFPrinter();var _0x42b031=_0x2ddd81[_0x664d('0x39')](_0x3e8142);if(_0x32b3fa){_0x47e151=path['join'](_0x57aedc,_0x41406d,util['format'](_0x664d('0x3a'),_0x41406d,_0x3395a0,_0x664d('0x3b')));}else{_0x47e151=path['join'](_0x57aedc,util[_0x664d('0x1a')](_0x664d('0x3c'),_0x41406d,_0x664d('0x3b')));}_0x32a7d8['push'](writePDFDocument(_0x42b031,_0x47e151));}return Promise['all'](_0x32a7d8);})['then'](function(){if(_0x32b3fa){return new Promise(function(_0x446685){zipdir(path[_0x664d('0x36')](_0x57aedc,_0x41406d),{'saveTo':path[_0x664d('0x36')](_0x57aedc,util[_0x664d('0x1a')]('%s.%s',_0x41406d,'zip'))},function(){rimraf(path[_0x664d('0x36')](_0x57aedc,_0x41406d),function(){});_0x446685(_0x664d('0x3d'));});});}})[_0x664d('0x2a')](function(){if(!_0x32b3fa)return;rimraf(path['join'](_0x57aedc,_0x41406d),function(){});})['then'](function(){logger[_0x664d('0x3e')](util[_0x664d('0x1a')](_0x664d('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x664d('0x40'),_0x32b3fa?util['format']('%s.%s',_0x41406d,_0x32b3fa?'zip':_0x664d('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x664d('0x3e')](util[_0x664d('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x664d('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x664d('0x2a')](function(_0x571aa6){EXTRACTED_REPORT=_0x571aa6;return dbH['sequelize']['query'](util[_0x664d('0x1a')](_0x664d('0x42'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x664d('0x30')]});})[_0x664d('0x2a')](extractReport)[_0x664d('0x43')](function(_0xe0ae8f){logger['info'](util[_0x664d('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x664d('0x44')),util[_0x664d('0x45')](_0xe0ae8f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x664d('0x46')](function(){process[_0x664d('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x578f9e=new PdfPrinter({'Arial':{'normal':__dirname+_0x664d('0x48'),'bold':__dirname+_0x664d('0x49'),'italics':__dirname+_0x664d('0x4a'),'bolditalics':__dirname+_0x664d('0x4b')}});return _0x578f9e;}function getPDFDocDefinitionFromHTML(_0x3aa6bb,_0x3aac3a){var _0x4c8526=util[_0x664d('0x1a')]('%s\x20#%d',_0x3aac3a[_0x664d('0x4c')],_0x3aac3a[_0x664d('0x4d')]);var _0x4c3f6c=moment()[_0x664d('0x1a')]('YYYY-MM-DD')[_0x664d('0x13')]();var _0x15fb64=htmlToPdfmake(_0x3aa6bb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x15fb64],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x664d('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x664d('0x4f'),'style':_0x664d('0x1d')}];},'footer':function(_0x502371,_0x543ba0){return[{'text':util['format'](_0x664d('0x50'),_0x4c8526,_0x502371,_0x543ba0,_0x4c3f6c),'style':_0x664d('0x22')}];}};}function writePDFDocument(_0x5cbd58,_0x173a15){return new Promise(function(_0x2c38a2,_0x3095c4){var _0x2119fa=_0x5cbd58[_0x664d('0x51')](fs[_0x664d('0x52')](_0x173a15));_0x2119fa['on']('finish',function(){_0x2c38a2(_0x664d('0x53'));});_0x2119fa['on'](_0x664d('0x54'),function(_0x2d39b5){_0x3095c4(_0x2d39b5);});_0x5cbd58['end']();});}exports[_0x664d('0x55')]=function(_0x5bc528,_0x1d0736){var _0x593642=getPDFPrinter();var _0x3278b0=getPDFDocDefinitionFromHTML(_0x5bc528,_0x1d0736);var _0x3162de=_0x593642['createPdfKitDocument'](_0x3278b0);return writePDFDocument(_0x3162de,_0x1d0736[_0x664d('0x1')])[_0x664d('0x43')](function(_0x27901a){throw _0x27901a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 91472f5..42b477f 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 _0x6e9c=['Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','update','info','format','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','split','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','length','%s.%s','xlsx','zip\x20finished','XLSX','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6e9c,0x153));var _0xc6e9=function(_0x28f667,_0x287bf8){_0x28f667=_0x28f667-0x0;var _0x4859d4=_0x6e9c[_0x28f667];return _0x4859d4;};'use strict';var util=require(_0xc6e9('0x0'));var path=require(_0xc6e9('0x1'));var _=require(_0xc6e9('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xc6e9('0x3'));var zipdir=require(_0xc6e9('0x4'));var rimraf=require(_0xc6e9('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc6e9('0x6'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc6e9('0x7')][0x2]);var QUERY=process[_0xc6e9('0x7')][0x3];var PATH=process[_0xc6e9('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe0c9b0,_0x5a2a8c){var _0x160b7d={'status':_0xe0c9b0};var _0x453385={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a2a8c){_0x160b7d[_0xc6e9('0x8')]=_0x5a2a8c;}return db[_0xc6e9('0x9')][_0xc6e9('0xa')](_0x160b7d,_0x453385);}function main(){var _0x2125ef=0x1388;var _0x2e0c69;logger[_0xc6e9('0xb')](util[_0xc6e9('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xc6e9('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xc6e9('0xe')]})[_0xc6e9('0xf')](function(_0x37f2ac){if(_0x37f2ac){_0x2e0c69=_0x37f2ac;_0x2125ef=_0x2e0c69[_0xc6e9('0xe')]||0x1388;}})[_0xc6e9('0xf')](function(){return dbH[_0xc6e9('0x10')][_0xc6e9('0x11')](util['format'](_0xc6e9('0x12'),QUERY),{'type':dbH['sequelize'][_0xc6e9('0x13')][_0xc6e9('0x14')]});})[_0xc6e9('0xf')](function(_0x4939da){if(!_0x4939da[0x0]['num']){return analyticExtractedReport('Empty');}var _0xf615e5=[];var _0x44eb58=0x0;if(_0x2e0c69[_0xc6e9('0x15')]){if(_0x4939da&&_0x4939da['length']){var _0x4d7f6b=_[_0xc6e9('0x16')](_0x4939da[0x0][_0xc6e9('0x17')]/_0x2125ef);var _0x321c99=Number[_0xc6e9('0x18')](_0x4939da[0x0][_0xc6e9('0x17')]/_0x2125ef)?_0x4939da[0x0]['num']%_0x2125ef:0x0;_0x4d7f6b[_0xc6e9('0x19')](function(_0x28d935){if(_0x28d935>0x0){_0x44eb58+=_0x2125ef;}_0xf615e5['push'](dbH['sequelize'][_0xc6e9('0x11')](util['format'](_0xc6e9('0x1a'),QUERY,_0x2125ef,_0x44eb58),{'type':dbH[_0xc6e9('0x10')]['QueryTypes'][_0xc6e9('0x14')]}));});if(_0x321c99>0x0){_0x44eb58+=_0x2125ef;_0xf615e5[_0xc6e9('0x1b')](dbH[_0xc6e9('0x10')][_0xc6e9('0x11')](util[_0xc6e9('0xc')](_0xc6e9('0x1a'),QUERY,_0x321c99,_0x44eb58),{'type':dbH[_0xc6e9('0x10')][_0xc6e9('0x13')][_0xc6e9('0x14')]}));}}}else{_0xf615e5[_0xc6e9('0x1b')](dbH['sequelize'][_0xc6e9('0x11')](QUERY,{'type':dbH[_0xc6e9('0x10')][_0xc6e9('0x13')]['SELECT']}));}var _0x5257cc=path[_0xc6e9('0x1c')](PATH);var _0x56ec8a=path[_0xc6e9('0x1d')](PATH,_0xc6e9('0x1e'));var _0x87928e=_0x2e0c69[_0xc6e9('0x15')]&&_0xf615e5['length']>0x1;var _0x12e2be=[];if(!fs[_0xc6e9('0x1f')](path[_0xc6e9('0x20')](_0x5257cc,_0x56ec8a))&&_0x87928e){fs[_0xc6e9('0x21')](path[_0xc6e9('0x20')](_0x5257cc,_0x56ec8a));}return BPromise[_0xc6e9('0x22')](_0xf615e5,function(_0x2ccead){_0x12e2be['push'](_0x2ccead);})['then'](function(){for(var _0x26cbc5=0x0;_0x26cbc5<_0x12e2be[_0xc6e9('0x23')];_0x26cbc5+=0x1){var _0xae31bb;var _0x54890c=_0x12e2be[_0x26cbc5];if(_0x87928e){_0xae31bb=path[_0xc6e9('0x20')](_0x5257cc,_0x56ec8a,util[_0xc6e9('0xc')]('%s%d.%s',_0x56ec8a,_0x26cbc5,'xlsx'));}else{_0xae31bb=path[_0xc6e9('0x20')](_0x5257cc,util[_0xc6e9('0xc')](_0xc6e9('0x24'),_0x56ec8a,_0xc6e9('0x25')));}fs['writeFileSync'](_0xae31bb,json2xls(_0x54890c),'binary');}})[_0xc6e9('0xf')](function(){if(_0x87928e){return new Promise(function(_0x961a70){zipdir(path[_0xc6e9('0x20')](_0x5257cc,_0x56ec8a),{'saveTo':path[_0xc6e9('0x20')](_0x5257cc,util['format']('%s.%s',_0x56ec8a,'zip'))},function(_0x31669a,_0x47733a){rimraf(path['join'](_0x5257cc,_0x56ec8a),function(){});_0x961a70(_0xc6e9('0x26'));});});}})[_0xc6e9('0xf')](function(){logger[_0xc6e9('0xb')](util[_0xc6e9('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc6e9('0x27')));return analyticExtractedReport(_0xc6e9('0x28'),_0x87928e?util[_0xc6e9('0xc')](_0xc6e9('0x24'),_0x56ec8a,_0x87928e?_0xc6e9('0x29'):'xlsx'):null);});})[_0xc6e9('0x2a')](function(_0x43a715){logger[_0xc6e9('0xb')](util[_0xc6e9('0xc')](_0xc6e9('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xc6e9('0x2c')](_0x43a715,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc6e9('0x2d'));})[_0xc6e9('0x2e')](function(){process[_0xc6e9('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8d02=['analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','existsSync','mkdirSync','each','join','%s%d.%s','%s.%s','binary','zip','zip\x20finished','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','exit','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d02,0x134));var _0x28d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d02[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x28d0('0x0'));var path=require(_0x28d0('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x28d0('0x2'));var BPromise=require(_0x28d0('0x3'));var zipdir=require(_0x28d0('0x4'));var rimraf=require(_0x28d0('0x5'));var db=require(_0x28d0('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x28d0('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x28d0('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4bc63e,_0x58f343){var _0x3ef5fb={'status':_0x4bc63e};var _0x58d8d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x58f343){_0x3ef5fb['savename']=_0x58f343;}return db[_0x28d0('0x9')]['update'](_0x3ef5fb,_0x58d8d2);}function main(){var _0x57f8ac=0x1388;var _0xee9c43;logger[_0x28d0('0xa')](util[_0x28d0('0xb')](_0x28d0('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x28d0('0xd')][_0x28d0('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x28d0('0xf'),_0x28d0('0x10')]})['then'](function(_0x2aa7ac){if(_0x2aa7ac){_0xee9c43=_0x2aa7ac;_0x57f8ac=_0xee9c43[_0x28d0('0x10')]||0x1388;}})[_0x28d0('0x11')](function(){return dbH[_0x28d0('0x12')][_0x28d0('0x13')](util[_0x28d0('0xb')](_0x28d0('0x14'),QUERY),{'type':dbH['sequelize'][_0x28d0('0x15')][_0x28d0('0x16')]});})[_0x28d0('0x11')](function(_0x29532a){if(!_0x29532a[0x0]['num']){return analyticExtractedReport('Empty');}var _0x121527=[];var _0x37342d=0x0;if(_0xee9c43[_0x28d0('0xf')]){if(_0x29532a&&_0x29532a[_0x28d0('0x17')]){var _0x56fd84=_['range'](_0x29532a[0x0][_0x28d0('0x18')]/_0x57f8ac);var _0x3ac280=Number[_0x28d0('0x19')](_0x29532a[0x0][_0x28d0('0x18')]/_0x57f8ac)?_0x29532a[0x0][_0x28d0('0x18')]%_0x57f8ac:0x0;_0x56fd84[_0x28d0('0x1a')](function(_0x87b79f){if(_0x87b79f>0x0){_0x37342d+=_0x57f8ac;}_0x121527[_0x28d0('0x1b')](dbH[_0x28d0('0x12')][_0x28d0('0x13')](util[_0x28d0('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x57f8ac,_0x37342d),{'type':dbH[_0x28d0('0x12')][_0x28d0('0x15')][_0x28d0('0x16')]}));});if(_0x3ac280>0x0){_0x37342d+=_0x57f8ac;_0x121527[_0x28d0('0x1b')](dbH[_0x28d0('0x12')][_0x28d0('0x13')](util['format'](_0x28d0('0x1c'),QUERY,_0x3ac280,_0x37342d),{'type':dbH[_0x28d0('0x12')][_0x28d0('0x15')][_0x28d0('0x16')]}));}}}else{_0x121527[_0x28d0('0x1b')](dbH[_0x28d0('0x12')][_0x28d0('0x13')](QUERY,{'type':dbH[_0x28d0('0x12')]['QueryTypes'][_0x28d0('0x16')]}));}var _0x355bfd=path['dirname'](PATH);var _0x3e71d3=path['basename'](PATH,'.xlsx');var _0x857290=_0xee9c43[_0x28d0('0xf')]&&_0x121527[_0x28d0('0x17')]>0x1;var _0x431278=[];if(!fs[_0x28d0('0x1d')](path['join'](_0x355bfd,_0x3e71d3))&&_0x857290){fs[_0x28d0('0x1e')](path['join'](_0x355bfd,_0x3e71d3));}return BPromise[_0x28d0('0x1f')](_0x121527,function(_0x5e1801){_0x431278[_0x28d0('0x1b')](_0x5e1801);})[_0x28d0('0x11')](function(){for(var _0x48e4bc=0x0;_0x48e4bc<_0x431278[_0x28d0('0x17')];_0x48e4bc+=0x1){var _0x35a250;var _0x44f50b=_0x431278[_0x48e4bc];if(_0x857290){_0x35a250=path[_0x28d0('0x20')](_0x355bfd,_0x3e71d3,util[_0x28d0('0xb')](_0x28d0('0x21'),_0x3e71d3,_0x48e4bc,'xlsx'));}else{_0x35a250=path[_0x28d0('0x20')](_0x355bfd,util[_0x28d0('0xb')](_0x28d0('0x22'),_0x3e71d3,'xlsx'));}fs['writeFileSync'](_0x35a250,json2xls(_0x44f50b),_0x28d0('0x23'));}})['then'](function(){if(_0x857290){return new Promise(function(_0x1c948d){zipdir(path[_0x28d0('0x20')](_0x355bfd,_0x3e71d3),{'saveTo':path[_0x28d0('0x20')](_0x355bfd,util[_0x28d0('0xb')](_0x28d0('0x22'),_0x3e71d3,_0x28d0('0x24')))},function(_0x4e4557,_0x4157ef){rimraf(path['join'](_0x355bfd,_0x3e71d3),function(){});_0x1c948d(_0x28d0('0x25'));});});}})[_0x28d0('0x11')](function(){logger[_0x28d0('0xa')](util[_0x28d0('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x28d0('0x26'),_0x857290?util[_0x28d0('0xb')]('%s.%s',_0x3e71d3,_0x857290?_0x28d0('0x24'):_0x28d0('0x27')):null);});})['catch'](function(_0x5800b8){logger[_0x28d0('0xa')](util[_0x28d0('0xb')](_0x28d0('0x28'),EXTRACTED_REPORT_ID,_0x28d0('0x29')),util[_0x28d0('0x2a')](_0x5800b8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x28d0('0x2b'));})['finally'](function(){process[_0x28d0('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 055f606..87079df 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 _0x3c77=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','error','rewrite','models','findAll','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extensions','find','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','CDR(destination)=','extension','cutdigits','${EXTEN}'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c77,0xfe));var _0x73c7=function(_0x257004,_0x23d40e){_0x257004=_0x257004-0x0;var _0x2f94c4=_0x3c77[_0x257004];return _0x2f94c4;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x405405,_0x2b0b63){var _0x386a34=this;return _0x405405[_0x73c7('0x0')]['Interval'][_0x73c7('0x1')]({'raw':!![]})['then'](function(_0xd1d92c){_0x386a34['intervals']=_0xd1d92c;return _0x405405['models'][_0x73c7('0x2')]['findAll']({'where':{'IntervalId':_0x2b0b63[_0x73c7('0x3')]},'raw':!![]});})[_0x73c7('0x4')](function(_0xadee3e){return _0x405405[_0x73c7('0x0')][_0x73c7('0x2')]['findAll']({'where':{'exten':{'$in':_[_0x73c7('0x5')](_[_0x73c7('0x6')](_0xadee3e,_0x73c7('0x7')))}},'order':[{'raw':_0x73c7('0x8')}],'raw':!![]});})[_0x73c7('0x4')](function(_0x58487){var _0x44a0bd=_[_0x73c7('0x9')](_0x58487,{'priority':'1'});var _0x1d6e47=_['filter'](_0x58487,{'isApp':0x1});var _0x50c21c=_[_0x73c7('0xa')](_0x1d6e47,_0x73c7('0x7'));var _0x47a24c=[_0x73c7('0xb'),'playback'];var _0x13c8c4=[];var _0x12319b=[];for(var _0x3ab1f9 in _0x50c21c){if(_0x50c21c[_0x73c7('0xc')](_0x3ab1f9)){_0x386a34[_0x73c7('0xd')]=0x2;_0x386a34[_0x73c7('0xe')]=[];_0x386a34['extension']=_[_0x73c7('0xf')](_0x44a0bd,{'exten':_0x50c21c[_0x3ab1f9][0x0]['exten']});_0x386a34[_0x73c7('0xe')]['push']({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':util[_0x73c7('0x12')](_0x73c7('0x13'),_0x50c21c[_0x3ab1f9][0x0]['type']),'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});if(_0x50c21c[_0x3ab1f9][0x0]['type']===_0x73c7('0x16')){_0x386a34[_0x73c7('0xe')][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x18')+_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId'],'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0]['exten'],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});}else if(_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')]===_0x73c7('0x19')){if(_0x386a34['extension']){_0x386a34['extensions'][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x1a')+(_0x386a34[_0x73c7('0x1b')]['cutdigits']?'${EXTEN:'+_0x386a34[_0x73c7('0x1b')][_0x73c7('0x1c')]+'}':_0x73c7('0x1d')),'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0]['exten'],'priority':_0x386a34['priority']++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId']});}_0x386a34['extensions'][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':'Set','appdata':'CDR(routeid)='+_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId'],'context':_0x50c21c[_0x3ab1f9][0x0]['context'],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x386a34['priority']++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});var _0x4088b0=_0x386a34['priority']++;_0x386a34[_0x73c7('0xe')]['push']({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x1e'),'appdata':_0x73c7('0x1f')+(_0x4088b0+0x2)+_0x73c7('0x20')+(_0x4088b0+0x1)+')','context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x4088b0,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});if(_0x386a34[_0x73c7('0x1b')]){_0x386a34[_0x73c7('0xe')]['push']({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':_0x386a34['extension'][_0x73c7('0x1c')]?_0x73c7('0x21')+_0x386a34[_0x73c7('0x1b')][_0x73c7('0x1c')]+'}':_0x73c7('0x22'),'context':_0x50c21c[_0x3ab1f9][0x0]['context'],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});}_0x386a34[_0x73c7('0xe')][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':'outboundrouteid='+_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')],'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x386a34['priority']++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});if(_0x386a34[_0x73c7('0x1b')]&&_0x386a34[_0x73c7('0x1b')][_0x73c7('0xc')]('recordingFormat')&&_0x386a34['extension'][_0x73c7('0x23')]!=='none'){_0x386a34['extensions']['push']({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':'Set','appdata':_0x73c7('0x24'),'context':_0x50c21c[_0x3ab1f9][0x0]['context'],'exten':_0x50c21c[_0x3ab1f9][0x0]['exten'],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});_0x386a34[_0x73c7('0xe')]['push']({'type':_0x50c21c[_0x3ab1f9][0x0]['type'],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x25')+_0x386a34[_0x73c7('0x1b')]['recordingFormat']||_0x73c7('0x26'),'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x386a34['priority']++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId']});}}_0x386a34[_0x73c7('0xe')][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0]['type'],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x27'),'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0]['exten'],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]});_0x386a34['extensions']['push']({'type':_0x50c21c[_0x3ab1f9][0x0]['type'],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x28'),'context':_0x50c21c[_0x3ab1f9][0x0]['context'],'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId']});_0x386a34[_0x73c7('0xe')][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x29'),'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'exten':_0x50c21c[_0x3ab1f9][0x0]['exten'],'priority':_0x386a34[_0x73c7('0xd')]++,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId']});for(var _0x5d63a9=0x0,_0x15ce68=0x0;_0x5d63a9<_0x50c21c[_0x3ab1f9][_0x73c7('0x2a')];_0x5d63a9+=0x1,_0x15ce68=0x0){var _0x45b733=_0x50c21c[_0x3ab1f9][_0x5d63a9];if(_0x45b733['type']){_0x45b733[_0x73c7('0x10')]=_0x45b733[_0x73c7('0x10')][_0x73c7('0x2b')]();}var _0x50beee=[];var _0x5a8984=[];delete _0x45b733['id'];delete _0x45b733['createdAt'];delete _0x45b733[_0x73c7('0x2c')];var _0x4087a5=_0x45b733[_0x73c7('0x2d')]!==_0x73c7('0x2e')?[_0x45b733[_0x73c7('0x2d')]]:_0x45b733[_0x73c7('0x3')]?_['map'](_[_0x73c7('0x9')](_0x386a34[_0x73c7('0x2f')],{'IntervalId':_0x45b733[_0x73c7('0x3')]}),_0x73c7('0x2d')):[];if(_0x45b733[_0x73c7('0xc')](_0x73c7('0x30'))){if(_0x45b733[_0x73c7('0x30')]&&_0x45b733[_0x73c7('0x30')]!=='--'){_0x50beee[_0x73c7('0x17')]({'type':_0x45b733[_0x73c7('0x10')],'app':'Set','appdata':_0x73c7('0x31')+_0x45b733[_0x73c7('0x30')],'context':_0x45b733[_0x73c7('0x14')],'exten':_0x45b733['exten'],'priority':_0x4087a5['length']+_0x386a34[_0x73c7('0xd')]+_0x15ce68++,'VoiceExtensionId':_0x45b733['VoiceExtensionId']});}}if(_0x45b733[_0x73c7('0x10')]===_0x73c7('0x19')&&_0x45b733['hasOwnProperty'](_0x73c7('0x32'))){if(_0x45b733[_0x73c7('0x32')]){_0x50beee[_0x73c7('0x17')]({'type':_0x45b733['type'],'app':_0x73c7('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x45b733[_0x73c7('0x32')]+')','context':_0x45b733[_0x73c7('0x14')],'exten':_0x45b733[_0x73c7('0x7')],'priority':_0x4087a5[_0x73c7('0x2a')]+_0x386a34[_0x73c7('0xd')]+_0x15ce68++,'VoiceExtensionId':_0x45b733[_0x73c7('0x15')]});}else{_0x50beee[_0x73c7('0x17')]({'type':_0x45b733[_0x73c7('0x10')],'app':'ExecIf','appdata':_0x73c7('0x33'),'context':_0x45b733[_0x73c7('0x14')],'exten':_0x45b733[_0x73c7('0x7')],'priority':_0x4087a5[_0x73c7('0x2a')]+_0x386a34[_0x73c7('0xd')]+_0x15ce68++,'VoiceExtensionId':_0x45b733[_0x73c7('0x15')]});}}if(_0x45b733[_0x73c7('0xc')](_0x73c7('0x34'))){if(_0x47a24c[_0x73c7('0x35')](_0x45b733[_0x73c7('0x36')]['toLowerCase']())>=0x0&&_0x45b733[_0x73c7('0x37')]!=='custom'){if(_0x45b733[_0x73c7('0x34')]){_0x50beee[_0x73c7('0x17')]({'type':_0x45b733[_0x73c7('0x10')],'app':'ExecIf','appdata':_0x73c7('0x38'),'context':_0x45b733[_0x73c7('0x14')],'exten':_0x45b733[_0x73c7('0x7')],'priority':_0x4087a5[_0x73c7('0x2a')]+_0x386a34[_0x73c7('0xd')]+_0x15ce68++,'VoiceExtensionId':_0x45b733[_0x73c7('0x15')]});_0x50beee[_0x73c7('0x17')]({'type':_0x45b733[_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x39'),'context':_0x45b733['context'],'exten':_0x45b733[_0x73c7('0x7')],'priority':_0x4087a5[_0x73c7('0x2a')]+_0x386a34[_0x73c7('0xd')]+_0x15ce68++,'VoiceExtensionId':_0x45b733[_0x73c7('0x15')]});}else{_0x50beee[_0x73c7('0x17')]({'type':_0x45b733[_0x73c7('0x10')],'app':'ExecIf','appdata':_0x73c7('0x3a'),'context':_0x45b733['context'],'exten':_0x45b733['exten'],'priority':_0x4087a5['length']+_0x386a34[_0x73c7('0xd')]+_0x15ce68++,'VoiceExtensionId':_0x45b733['VoiceExtensionId']});_0x50beee[_0x73c7('0x17')]({'type':_0x45b733[_0x73c7('0x10')],'app':_0x73c7('0x11'),'appdata':_0x73c7('0x3b'),'context':_0x45b733[_0x73c7('0x14')],'exten':_0x45b733[_0x73c7('0x7')],'priority':_0x4087a5[_0x73c7('0x2a')]+_0x386a34['priority']+_0x15ce68++,'VoiceExtensionId':_0x45b733[_0x73c7('0x15')]});}}}for(var _0x404768=0x0;_0x404768<_0x4087a5[_0x73c7('0x2a')];_0x404768+=0x1){var _0x519872=_0x386a34['priority']+_0x4087a5[_0x73c7('0x2a')];var _0x720de2=_0x404768===_0x4087a5[_0x73c7('0x2a')]-0x1?_0x386a34['priority']+_0x50beee['length']+_0x5a8984[_0x73c7('0x2a')]+0x2:_0x386a34[_0x73c7('0xd')]+_0x404768+0x1;_0x50beee[_0x73c7('0x3c')](_0x404768,0x0,{'type':_0x45b733['type'],'app':_0x73c7('0x3d'),'appdata':_0x4087a5[_0x404768]+'?'+_0x45b733['context']+_0x73c7('0x3e')+_0x519872+':'+_0x45b733[_0x73c7('0x14')]+',${EXTEN},'+_0x720de2,'exten':_0x45b733[_0x73c7('0x7')],'context':_0x45b733['context'],'priority':_0x386a34[_0x73c7('0xd')]+_0x404768,'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId']});}_0x45b733[_0x73c7('0xd')]=_0x50beee['length']?_[_0x73c7('0x3f')](_0x50beee)['priority']+0x1:_0x386a34['priority'];_0x386a34['priority']=(_0x5a8984[_0x73c7('0x2a')]?_[_0x73c7('0x3f')](_0x5a8984)['priority']:_0x45b733[_0x73c7('0xd')])+0x1;_0x386a34[_0x73c7('0xe')]=_[_0x73c7('0x40')](_0x386a34[_0x73c7('0xe')],_0x50beee,[_0x45b733],_0x5a8984);}_0x386a34['extensions'][_0x73c7('0x17')]({'type':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x10')],'app':_0x73c7('0x41'),'exten':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x7')],'context':_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x14')],'priority':_0x386a34[_0x73c7('0xd')],'VoiceExtensionId':_0x50c21c[_0x3ab1f9][0x0]['VoiceExtensionId']});_0x13c8c4[_0x73c7('0x17')](_0x50c21c[_0x3ab1f9][0x0][_0x73c7('0x15')]);_0x12319b=_['concat'](_0x12319b,_0x386a34[_0x73c7('0xe')]);}}return _0x405405['transaction'](function(_0x8d923a){return _0x405405[_0x73c7('0x0')][_0x73c7('0x2')][_0x73c7('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x13c8c4}},'transaction':_0x8d923a})[_0x73c7('0x4')](function(_0x31e347){return _0x405405[_0x73c7('0x0')][_0x73c7('0x2')]['bulkCreate'](_[_0x73c7('0x43')](_0x12319b,_0x73c7('0xd')),{'transaction':_0x8d923a});});});})[_0x73c7('0x44')](function(_0x45d1f7){console[_0x73c7('0x45')](_0x45d1f7);});}exports[_0x73c7('0x46')]=rewrite; \ No newline at end of file +var _0x556c=['XCALLY-MOTION-ANSWER=1','splice','GotoIfTime','last','concat','transaction','bulkCreate','catch','error','rewrite','models','Interval','findAll','intervals','IntervalId','VoiceExtension','uniq','map','then','filter','groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','find','type','CDR(type)=%s','context','priority','VoiceExtensionId','push','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=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)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer'];(function(_0x4f02e,_0x4ac328){var _0x5a09cd=function(_0x358155){while(--_0x358155){_0x4f02e['push'](_0x4f02e['shift']());}};_0x5a09cd(++_0x4ac328);}(_0x556c,0x1df));var _0xc556=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x556c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x5aae13,_0x384f03){var _0x5addd6=this;return _0x5aae13[_0xc556('0x0')][_0xc556('0x1')][_0xc556('0x2')]({'raw':!![]})['then'](function(_0x1be160){_0x5addd6[_0xc556('0x3')]=_0x1be160;return _0x5aae13[_0xc556('0x0')]['VoiceExtension'][_0xc556('0x2')]({'where':{'IntervalId':_0x384f03[_0xc556('0x4')]},'raw':!![]});})['then'](function(_0x239dc8){return _0x5aae13[_0xc556('0x0')][_0xc556('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xc556('0x6')](_[_0xc556('0x7')](_0x239dc8,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xc556('0x8')](function(_0x1d3b99){var _0x4dcaff=_[_0xc556('0x9')](_0x1d3b99,{'priority':'1'});var _0x390a46=_[_0xc556('0x9')](_0x1d3b99,{'isApp':0x1});var _0x34e24e=_[_0xc556('0xa')](_0x390a46,_0xc556('0xb'));var _0x2387e8=[_0xc556('0xc'),_0xc556('0xd')];var _0x38324f=[];var _0x3615d6=[];for(var _0x37655c in _0x34e24e){if(_0x34e24e[_0xc556('0xe')](_0x37655c)){_0x5addd6['priority']=0x2;_0x5addd6[_0xc556('0xf')]=[];_0x5addd6[_0xc556('0x10')]=_[_0xc556('0x11')](_0x4dcaff,{'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')]});_0x5addd6['extensions']['push']({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':'Set','appdata':util['format'](_0xc556('0x13'),_0x34e24e[_0x37655c][0x0]['type']),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});if(_0x34e24e[_0x37655c][0x0][_0xc556('0x12')]==='inbound'){_0x5addd6['extensions'][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x19')+_0x34e24e[_0x37655c][0x0]['VoiceExtensionId'],'context':_0x34e24e[_0x37655c][0x0]['context'],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});}else if(_0x34e24e[_0x37655c][0x0][_0xc556('0x12')]===_0xc556('0x1a')){if(_0x5addd6[_0xc556('0x10')]){_0x5addd6['extensions'][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'CDR(destination)='+(_0x5addd6['extension'][_0xc556('0x1b')]?_0xc556('0x1c')+_0x5addd6[_0xc556('0x10')][_0xc556('0x1b')]+'}':_0xc556('0x1d')),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});}_0x5addd6[_0xc556('0xf')]['push']({'type':_0x34e24e[_0x37655c][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x34e24e[_0x37655c][0x0][_0xc556('0x16')],'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0]['exten'],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});var _0xa0245d=_0x5addd6[_0xc556('0x15')]++;_0x5addd6[_0xc556('0xf')]['push']({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x1e'),'appdata':_0xc556('0x1f')+(_0xa0245d+0x2)+_0xc556('0x20')+(_0xa0245d+0x1)+')','context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0xa0245d,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});if(_0x5addd6['extension']){_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0x5addd6[_0xc556('0x10')][_0xc556('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x5addd6[_0xc556('0x10')][_0xc556('0x1b')]+'}':_0xc556('0x21'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6['priority']++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});}_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x22')+_0x34e24e[_0x37655c][0x0]['VoiceExtensionId'],'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});if(_0x5addd6[_0xc556('0x10')]&&_0x5addd6[_0xc556('0x10')][_0xc556('0xe')](_0xc556('0x23'))&&_0x5addd6[_0xc556('0x10')][_0xc556('0x23')]!==_0xc556('0x24')){_0x5addd6['extensions'][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0]['exten'],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x25')+_0x5addd6[_0xc556('0x10')][_0xc556('0x23')]||_0xc556('0x26'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});}}_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x27'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x34e24e[_0x37655c][0x0]['context'],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x5addd6[_0xc556('0xf')]['push']({'type':_0x34e24e[_0x37655c][0x0]['type'],'app':_0xc556('0x18'),'appdata':_0xc556('0x28'),'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'priority':_0x5addd6[_0xc556('0x15')]++,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0]['VoiceExtensionId']});for(var _0x23aab4=0x0,_0x3d4050=0x0;_0x23aab4<_0x34e24e[_0x37655c][_0xc556('0x29')];_0x23aab4+=0x1,_0x3d4050=0x0){var _0x54c7a1=_0x34e24e[_0x37655c][_0x23aab4];if(_0x54c7a1[_0xc556('0x12')]){_0x54c7a1[_0xc556('0x12')]=_0x54c7a1[_0xc556('0x12')][_0xc556('0x2a')]();}var _0x19e6aa=[];var _0x1b32f4=[];delete _0x54c7a1['id'];delete _0x54c7a1[_0xc556('0x2b')];delete _0x54c7a1[_0xc556('0x2c')];var _0x5a86c0=_0x54c7a1[_0xc556('0x2d')]!==_0xc556('0x2e')?[_0x54c7a1[_0xc556('0x2d')]]:_0x54c7a1[_0xc556('0x4')]?_['map'](_[_0xc556('0x9')](_0x5addd6['intervals'],{'IntervalId':_0x54c7a1[_0xc556('0x4')]}),'interval'):[];if(_0x54c7a1['hasOwnProperty'](_0xc556('0x2f'))){if(_0x54c7a1[_0xc556('0x2f')]&&_0x54c7a1[_0xc556('0x2f')]!=='--'){_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1['type'],'app':_0xc556('0x18'),'appdata':_0xc556('0x30')+_0x54c7a1['tag'],'context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1['VoiceExtensionId']});}}if(_0x54c7a1[_0xc556('0x12')]===_0xc556('0x1a')&&_0x54c7a1[_0xc556('0xe')](_0xc556('0x31'))){if(_0x54c7a1[_0xc556('0x31')]){_0x19e6aa['push']({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x1e'),'appdata':_0xc556('0x32')+_0x54c7a1[_0xc556('0x31')]+')','context':_0x54c7a1['context'],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6['priority']+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});}else{_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x1e'),'appdata':_0xc556('0x33'),'context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1['VoiceExtensionId']});}}if(_0x54c7a1[_0xc556('0xe')](_0xc556('0x34'))){if(_0x2387e8[_0xc556('0x35')](_0x54c7a1['app'][_0xc556('0x2a')]())>=0x0&&_0x54c7a1[_0xc556('0x36')]!==_0xc556('0x37')){if(_0x54c7a1['answer']){_0x19e6aa['push']({'type':_0x54c7a1['type'],'app':_0xc556('0x1e'),'appdata':_0xc556('0x38'),'context':_0x54c7a1['context'],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6['priority']+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});_0x19e6aa['push']({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':_0xc556('0x39'),'context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});}else{_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1[_0xc556('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});_0x19e6aa[_0xc556('0x17')]({'type':_0x54c7a1[_0xc556('0x12')],'app':_0xc556('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x54c7a1[_0xc556('0x14')],'exten':_0x54c7a1[_0xc556('0xb')],'priority':_0x5a86c0[_0xc556('0x29')]+_0x5addd6[_0xc556('0x15')]+_0x3d4050++,'VoiceExtensionId':_0x54c7a1[_0xc556('0x16')]});}}}for(var _0x444e00=0x0;_0x444e00<_0x5a86c0[_0xc556('0x29')];_0x444e00+=0x1){var _0x1fbb36=_0x5addd6[_0xc556('0x15')]+_0x5a86c0[_0xc556('0x29')];var _0x1e0fe7=_0x444e00===_0x5a86c0[_0xc556('0x29')]-0x1?_0x5addd6[_0xc556('0x15')]+_0x19e6aa[_0xc556('0x29')]+_0x1b32f4[_0xc556('0x29')]+0x2:_0x5addd6[_0xc556('0x15')]+_0x444e00+0x1;_0x19e6aa[_0xc556('0x3a')](_0x444e00,0x0,{'type':_0x54c7a1['type'],'app':_0xc556('0x3b'),'appdata':_0x5a86c0[_0x444e00]+'?'+_0x54c7a1['context']+',${EXTEN},'+_0x1fbb36+':'+_0x54c7a1[_0xc556('0x14')]+',${EXTEN},'+_0x1e0fe7,'exten':_0x54c7a1['exten'],'context':_0x54c7a1[_0xc556('0x14')],'priority':_0x5addd6[_0xc556('0x15')]+_0x444e00,'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});}_0x54c7a1[_0xc556('0x15')]=_0x19e6aa[_0xc556('0x29')]?_[_0xc556('0x3c')](_0x19e6aa)[_0xc556('0x15')]+0x1:_0x5addd6[_0xc556('0x15')];_0x5addd6[_0xc556('0x15')]=(_0x1b32f4[_0xc556('0x29')]?_['last'](_0x1b32f4)[_0xc556('0x15')]:_0x54c7a1[_0xc556('0x15')])+0x1;_0x5addd6[_0xc556('0xf')]=_[_0xc556('0x3d')](_0x5addd6['extensions'],_0x19e6aa,[_0x54c7a1],_0x1b32f4);}_0x5addd6[_0xc556('0xf')][_0xc556('0x17')]({'type':_0x34e24e[_0x37655c][0x0][_0xc556('0x12')],'app':'Hangup','exten':_0x34e24e[_0x37655c][0x0][_0xc556('0xb')],'context':_0x34e24e[_0x37655c][0x0][_0xc556('0x14')],'priority':_0x5addd6[_0xc556('0x15')],'VoiceExtensionId':_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]});_0x38324f[_0xc556('0x17')](_0x34e24e[_0x37655c][0x0][_0xc556('0x16')]);_0x3615d6=_[_0xc556('0x3d')](_0x3615d6,_0x5addd6[_0xc556('0xf')]);}}return _0x5aae13[_0xc556('0x3e')](function(_0x34aa43){return _0x5aae13[_0xc556('0x0')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x38324f}},'transaction':_0x34aa43})[_0xc556('0x8')](function(_0x6772ab){return _0x5aae13[_0xc556('0x0')]['VoiceExtension'][_0xc556('0x3f')](_['sortBy'](_0x3615d6,_0xc556('0x15')),{'transaction':_0x34aa43});});});})[_0xc556('0x40')](function(_0x4c6fb5){console[_0xc556('0x41')](_0x4c6fb5);});}exports[_0xc556('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 30fee7c..d6b2e29 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 _0x1e62=['phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','NOW()','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','findAll','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','length','find','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','phone','field','toString','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x1e62,0x98));var _0x21e6=function(_0x2baf85,_0x74639b){_0x2baf85=_0x2baf85-0x0;var _0x57fd18=_0x1e62[_0x2baf85];return _0x57fd18;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x21e6('0x0'));var Papa=require(_0x21e6('0x1'));var Redis=require(_0x21e6('0x2'));var db=require(_0x21e6('0x3'))['db'];var config=require(_0x21e6('0x4'));var logger=require(_0x21e6('0x5'))(_0x21e6('0x6'));config[_0x21e6('0x7')]=_['defaults'](config[_0x21e6('0x7')],{'host':_0x21e6('0x8'),'port':0x18eb});var socket=require(_0x21e6('0x9'))(new Redis(config[_0x21e6('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0x21e6('0xa')](socket);try{if(!process[_0x21e6('0xb')][0x2]||process[_0x21e6('0xb')][0x2]===_0x21e6('0xc')||process['argv'][0x2]===_0x21e6('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x21e6('0xb')][0x2];if(!process[_0x21e6('0xb')][0x3]||process[_0x21e6('0xb')][0x3]===_0x21e6('0xc')||process[_0x21e6('0xb')][0x3]===_0x21e6('0xd')||!process[_0x21e6('0xb')][0x4]||process[_0x21e6('0xb')][0x4]===_0x21e6('0xc')||process[_0x21e6('0xb')][0x4]===_0x21e6('0xd')){throw new Error(_0x21e6('0xe'));}var FIELDS=_[_0x21e6('0xf')](process[_0x21e6('0xb')][0x3][_0x21e6('0x10')](','),process[_0x21e6('0xb')][0x4][_0x21e6('0x10')](','));if(!process[_0x21e6('0xb')][0x5]||process[_0x21e6('0xb')][0x5]===_0x21e6('0xc')||process['argv'][0x5]===_0x21e6('0xd')){throw new Error(_0x21e6('0x11'));}var LISTID=process[_0x21e6('0xb')][0x5];var COMPANYID=process[_0x21e6('0xb')][0x6]&&process[_0x21e6('0xb')][0x6]!=='undefined'&&process[_0x21e6('0xb')][0x6]!==_0x21e6('0xd')?process[_0x21e6('0xb')][0x6]:null;var DUPLICATES=process[_0x21e6('0xb')][0x7]&&process['argv'][0x7]!=='undefined'&&process['argv'][0x7]!==_0x21e6('0xd')?process[_0x21e6('0xb')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]==='undefined'||process[_0x21e6('0xb')][0x8]===_0x21e6('0xd')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x21e6('0xb')][0x8];}catch(_0x56a789){logger[_0x21e6('0x12')](_0x56a789);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(_0x4c0b15,_0x565e49,_0x52a5c3,_0x49f8ff){var _0x32bf96={'message':_0x565e49};_0x32bf96[_0x4c0b15]=!![];if(_0x52a5c3){_0x32bf96[_0x21e6('0x13')]=_0x52a5c3;}if(_0x49f8ff){_0x32bf96[_0x21e6('0x14')]=_0x49f8ff;}return _0x32bf96;}function isEmail(_0x4f8b5b){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'](_0x4f8b5b);}function checkRow(_0x1e0d23,_0x100631,_0x255f3a){return new BPromise(function(_0x1929f9,_0x5b789a){if(_[_0x21e6('0x15')](_0x1e0d23)){return _0x5b789a(handleCheckRowError(_0x21e6('0x12'),_0x21e6('0x16'),null,_0x255f3a));}if(_0x1e0d23['errors']&&_0x1e0d23[_0x21e6('0x17')]['length']){var _0xb75363=_[_0x21e6('0x18')](_0x1e0d23['errors'],_0x21e6('0x19'))[_0x21e6('0x1a')](';');return _0x5b789a(handleCheckRowError('error',_0xb75363,null,_0x255f3a));}var _0x3438e4={};for(var _0x3c39a3 in FIELDS){if(FIELDS[_0x21e6('0x1b')](_0x3c39a3)&&FIELDS[_0x3c39a3]){_0x3438e4[_0x3c39a3]=_0x1e0d23[_0x21e6('0x1c')][0x0][FIELDS[_0x3c39a3]]||_0x1e0d23['data'][0x0]['\ufeff'+FIELDS[_0x3c39a3]];}}if(!_0x3438e4[_0x21e6('0x1d')]){return _0x5b789a(handleCheckRowError(_0x21e6('0x12'),_0x21e6('0x1e'),null,_0x255f3a));}if(!_0x3438e4['phone']){return _0x5b789a(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x255f3a));}if(_0x3438e4[_0x21e6('0x1f')]){var _0x194ae9=moment(_0x3438e4[_0x21e6('0x1f')],_0x21e6('0x20'));if(!_0x194ae9['isValid']()){return _0x5b789a(handleCheckRowError(_0x21e6('0x12'),_0x21e6('0x21'),null,_0x255f3a));}}if(_0x3438e4['email']){if(!isEmail(_0x3438e4[_0x21e6('0x22')])){return _0x5b789a(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x255f3a));}}_0x3438e4[_0x21e6('0x23')]=LISTID;_0x3438e4['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x100631){var _0x413e8a={};for(var _0x2881bc=0x0,_0x17c506=DUPLICATES[_0x21e6('0x24')];_0x2881bc<_0x17c506;_0x2881bc+=0x1){_0x413e8a[DUPLICATES[_0x2881bc]]=_0x3438e4[DUPLICATES[_0x2881bc]];}var _0x56219a=_[_0x21e6('0x25')](_0x100631,_0x413e8a);if(_0x56219a){return _0x5b789a(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x56219a,_0x255f3a));}}return db[_0x21e6('0x26')][_0x21e6('0x27')](_0x3438e4,{'raw':!![],'hooks':![],'fields':_[_0x21e6('0x28')](_0x3438e4)})[_0x21e6('0x29')](function(_0x444a9a){if(DUPLICATES&&DUPLICATES[_0x21e6('0x24')]&&_0x100631){_0x100631[_0x21e6('0x2a')](_[_0x21e6('0x2b')](_0x3438e4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x444a9a['id'];return _0x1929f9();})['catch'](function(_0x3c4baa){return _0x5b789a(handleCheckRowError(_0x21e6('0x12'),_0x21e6('0x2c')+(_0x3c4baa[_0x21e6('0x19')]||JSON[_0x21e6('0x2d')](_0x3c4baa)),null,_0x255f3a));});});}function checkHopper(){function _0x3239ac(){return function(_0x6da5d5){logger['error']('cmContact',_0x21e6('0x2e'),util[_0x21e6('0x2f')](_0x6da5d5,{'showHidden':![],'depth':null}));};}var _0x3a9918=function(_0x2e9350,_0xa82f0b){var _0x36b4ac=squel[_0x21e6('0x30')]()[_0x21e6('0x31')]('cm_hopper')[_0x21e6('0x32')](['phone',_0x21e6('0x33'),_0x21e6('0x34'),_0x21e6('0x23'),_0xa82f0b,_0x21e6('0x35'),_0x21e6('0x36')],squel[_0x21e6('0x37')]()['field'](_0x21e6('0x38'),_0x21e6('0x38'))['field']('NOW()','scheduledAt')[_0x21e6('0x39')]('id',_0x21e6('0x34'))[_0x21e6('0x39')](LISTID[_0x21e6('0x3a')](),_0x21e6('0x23'))[_0x21e6('0x39')](_0x2e9350['id']['toString'](),_0xa82f0b)['field']('NOW()','createdAt')[_0x21e6('0x39')]('NOW()',_0x21e6('0x36'))['from']('cm_contacts')[_0x21e6('0x3b')](_0x21e6('0x3c'))[_0x21e6('0x3b')](_0x21e6('0x3d'),LISTID['toString']())[_0x21e6('0x3b')](_0x21e6('0x3e'))[_0x21e6('0x3b')](_0x21e6('0x3f'),squel[_0x21e6('0x37')]()[_0x21e6('0x39')](_0x21e6('0x38'))[_0x21e6('0x40')](_0x21e6('0x41'))[_0x21e6('0x3b')](_0xa82f0b+_0x21e6('0x42'),_0x2e9350['id'][_0x21e6('0x3a')]())))[_0x21e6('0x3a')]();return _0x36b4ac;};var _0x2441b9=function(_0x17e72d,_0x589e1f){var _0x486903=squel['insert']()[_0x21e6('0x31')](_0x21e6('0x41'))['fromQuery'](['phone',_0x21e6('0x33'),'ContactId',_0x21e6('0x23'),_0x589e1f,_0x21e6('0x35'),_0x21e6('0x36')],squel[_0x21e6('0x37')]()[_0x21e6('0x39')](_0x21e6('0x38'),'phone')[_0x21e6('0x39')](_0x21e6('0x43'),_0x21e6('0x33'))[_0x21e6('0x39')]('id','ContactId')[_0x21e6('0x39')](LISTID[_0x21e6('0x3a')](),_0x21e6('0x23'))[_0x21e6('0x39')](_0x17e72d['id'][_0x21e6('0x3a')](),_0x589e1f)['field'](_0x21e6('0x43'),_0x21e6('0x35'))[_0x21e6('0x39')](_0x21e6('0x43'),_0x21e6('0x36'))[_0x21e6('0x40')]('cm_contacts')[_0x21e6('0x3b')](_0x21e6('0x3c'))[_0x21e6('0x3b')](_0x21e6('0x3d'),LISTID[_0x21e6('0x3a')]())[_0x21e6('0x3b')](_0x21e6('0x44'),squel[_0x21e6('0x45')](hopperContacts))[_0x21e6('0x3b')](_0x21e6('0x3e'))[_0x21e6('0x3b')](_0x21e6('0x3f'),squel[_0x21e6('0x37')]()[_0x21e6('0x39')](_0x21e6('0x46'))[_0x21e6('0x40')](_0x21e6('0x47'))[_0x21e6('0x3b')](_0x589e1f+_0x21e6('0x42'),_0x17e72d['id'][_0x21e6('0x3a')]()))['where'](_0x21e6('0x3f'),squel[_0x21e6('0x37')]()[_0x21e6('0x39')](_0x21e6('0x38'))[_0x21e6('0x40')](_0x21e6('0x41'))['where'](_0x589e1f+_0x21e6('0x42'),_0x17e72d['id']['toString']())))[_0x21e6('0x3a')]();return _0x486903;};function _0xe79625(_0x2d51c8,_0x489e3c){var _0x1a8564=squel[_0x21e6('0x30')]()['into'](_0x21e6('0x41'))[_0x21e6('0x32')](['phone',_0x21e6('0x33'),_0x21e6('0x34'),_0x21e6('0x23'),_0x489e3c,_0x21e6('0x35'),_0x21e6('0x36')],squel[_0x21e6('0x37')]()[_0x21e6('0x39')](_0x21e6('0x38'),'phone')[_0x21e6('0x39')](_0x21e6('0x43'),_0x21e6('0x33'))[_0x21e6('0x39')]('id','ContactId')[_0x21e6('0x39')](LISTID[_0x21e6('0x3a')](),_0x21e6('0x23'))[_0x21e6('0x39')](_0x2d51c8['id'][_0x21e6('0x3a')](),_0x489e3c)['field'](_0x21e6('0x43'),_0x21e6('0x35'))['field'](_0x21e6('0x43'),_0x21e6('0x36'))['from']('cm_contacts')[_0x21e6('0x3b')](_0x21e6('0x3c'))[_0x21e6('0x3b')](_0x21e6('0x3d'),LISTID['toString']())[_0x21e6('0x3b')](_0x21e6('0x44'),squel[_0x21e6('0x45')](hopperContacts))[_0x21e6('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x1a8564;}function _0x299215(_0x9494b6,_0x2b62fc){var _0x91cfc7=squel[_0x21e6('0x30')]()[_0x21e6('0x31')](_0x21e6('0x48'))[_0x21e6('0x32')]([_0x21e6('0x38'),_0x21e6('0x34'),_0x21e6('0x23'),_0x2b62fc,_0x21e6('0x35'),_0x21e6('0x36')],squel['select']()[_0x21e6('0x39')](_0x21e6('0x38'),_0x21e6('0x38'))[_0x21e6('0x39')]('id',_0x21e6('0x34'))['field'](LISTID['toString'](),_0x21e6('0x23'))[_0x21e6('0x39')](_0x9494b6['id'][_0x21e6('0x3a')](),_0x2b62fc)['field'](_0x21e6('0x43'),_0x21e6('0x35'))[_0x21e6('0x39')](_0x21e6('0x43'),'updatedAt')[_0x21e6('0x40')](_0x21e6('0x49'))[_0x21e6('0x3b')](_0x21e6('0x3c'))['where'](_0x21e6('0x3d'),LISTID[_0x21e6('0x3a')]())[_0x21e6('0x3b')](_0x21e6('0x44'),squel[_0x21e6('0x45')](hopperContacts))[_0x21e6('0x3b')](_0x21e6('0x3e')))[_0x21e6('0x3a')]();return _0x91cfc7;}return db[_0x21e6('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x21e6('0x4b')],'as':_0x21e6('0x4c'),'where':{'id':LISTID}}]})[_0x21e6('0x29')](function(_0x17f65d){var _0x211516=[];if(_0x17f65d){var _0x5d9e51;for(var _0x34b3b5=0x0,_0x278a20;_0x34b3b5<_0x17f65d['length'];_0x34b3b5+=0x1){_0x278a20=_0x17f65d[_0x34b3b5][_0x21e6('0x4d')]({'plain':!![]});switch(_0x278a20[_0x21e6('0x4e')]){case _0x21e6('0x4f'):_0x211516[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0x2441b9(_0x278a20,_0x21e6('0x52')))[_0x21e6('0x29')](function(){})[_0x21e6('0x53')](_0x3239ac()));break;case _0x21e6('0x54'):_0x211516[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0x3a9918(_0x278a20,_0x21e6('0x52')))[_0x21e6('0x29')](function(){})['catch'](_0x3239ac()));break;default:_0x211516[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0xe79625(_0x278a20,'VoiceQueueId'))[_0x21e6('0x29')](function(){})[_0x21e6('0x53')](_0x3239ac()));}}}return _0x211516;})['all']()['then'](function(){return db['VoiceQueue'][_0x21e6('0x55')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x21e6('0x4b')],'as':_0x21e6('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x9c233d){var _0x5d49ad=[];if(_0x9c233d){var _0x5634dc;for(var _0x1a8bd6=0x0,_0x53bef5;_0x1a8bd6<_0x9c233d[_0x21e6('0x24')];_0x1a8bd6+=0x1){_0x53bef5=_0x9c233d[_0x1a8bd6][_0x21e6('0x4d')]({'plain':!![]});_0x5d49ad[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0x299215(_0x53bef5,_0x21e6('0x52')))['then'](function(){})[_0x21e6('0x53')](_0x3239ac()));}}return _0x5d49ad;})[_0x21e6('0x57')]();})[_0x21e6('0x29')](function(){return db[_0x21e6('0x58')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x21e6('0x4c'),'where':{'id':LISTID}}]})[_0x21e6('0x29')](function(_0x32b08d){var _0x3eb01a=[];if(_0x32b08d){for(var _0x517326=0x0,_0x4a9527;_0x517326<_0x32b08d[_0x21e6('0x24')];_0x517326+=0x1){_0x4a9527=_0x32b08d[_0x517326][_0x21e6('0x4d')]({'plain':!![]});switch(_0x4a9527['dialCheckDuplicateType']){case'always':_0x3eb01a[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0x2441b9(_0x4a9527,'CampaignId'))[_0x21e6('0x29')](function(){})[_0x21e6('0x53')](_0x3239ac()));break;case _0x21e6('0x54'):_0x3eb01a[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0x3a9918(_0x4a9527,_0x21e6('0x59')))['then'](function(){})[_0x21e6('0x53')](_0x3239ac()));break;default:_0x3eb01a[_0x21e6('0x2a')](db[_0x21e6('0x50')]['query'](_0xe79625(_0x4a9527,_0x21e6('0x59')))[_0x21e6('0x29')](function(){})[_0x21e6('0x53')](_0x3239ac()));}}}return _0x3eb01a;})['all']();})[_0x21e6('0x29')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x21e6('0x4b')],'as':_0x21e6('0x56'),'where':{'id':LISTID}}]})[_0x21e6('0x29')](function(_0xbc4f69){var _0x3fb1de=[];if(_0xbc4f69){for(var _0x1088d7=0x0,_0xb1d0d;_0x1088d7<_0xbc4f69[_0x21e6('0x24')];_0x1088d7+=0x1){_0xb1d0d=_0xbc4f69[_0x1088d7]['get']({'plain':!![]});_0x3fb1de[_0x21e6('0x2a')](db[_0x21e6('0x50')][_0x21e6('0x51')](_0x299215(_0xb1d0d,_0x21e6('0x59')))[_0x21e6('0x29')](function(){})[_0x21e6('0x53')](_0x3239ac()));}}return _0x3fb1de;})[_0x21e6('0x57')]();})['catch'](function(_0x3052b3){logger['error'](_0x21e6('0x5a'),_0x21e6('0x5b'),_0x3052b3[_0x21e6('0x19')]);});}var processPromises=function(_0xdc9f00){return BPromise[_0x21e6('0x57')](promises)['then'](function(_0x1137ea){})[_0x21e6('0x53')](function(_0x19ad12){logger['error'](_0x21e6('0x5c'),JSON[_0x21e6('0x2d')](_0x19ad12));})[_0x21e6('0x5d')](function(){socket[_0x21e6('0x5e')](_0x21e6('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xdc9f00){return _0xdc9f00[_0x21e6('0x60')]();}});};var endCsv=function(){return BPromise[_0x21e6('0x61')]()[_0x21e6('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x21e6('0x29')](function(){socket[_0x21e6('0x5e')](_0x21e6('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x21e6('0x62')](FILEPATH);}catch(_0x239984){logger[_0x21e6('0x12')](_0x21e6('0x63'),JSON[_0x21e6('0x2d')](_0x239984));}finally{process['exit'](0x0);}});};process['on'](_0x21e6('0x64'),function(){logger[_0x21e6('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x21e6('0x61')]()[_0x21e6('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x21e6('0x10')](',');return db[_0x21e6('0x26')][_0x21e6('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x21e6('0x29')](function(_0x43d44d){var _0x19223a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x21e6('0x66')](_0x19223a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x33bf0b,_0x3b2f03){total+=0x1;var _0x2e5754=total;promises[_0x21e6('0x2a')](checkRow(_0x33bf0b,_0x43d44d,_0x2e5754)[_0x21e6('0x29')](function(){success+=0x1;})[_0x21e6('0x53')](function(_0xc7003e){if(_0xc7003e[_0x21e6('0x12')]){errors+=0x1;delete _0xc7003e['error'];}else if(_0xc7003e[_0x21e6('0x67')]){duplicates+=0x1;delete _0xc7003e[_0x21e6('0x67')];}rows[_0x21e6('0x2a')](_0xc7003e);}));if(total%0xc8===0x0){_0x3b2f03[_0x21e6('0x68')]();return processPromises(_0x3b2f03);}},'complete':function(){return processPromises()['then'](function(){logger[_0x21e6('0x65')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x538fc7,_0x395b52){logger[_0x21e6('0x65')](_0x21e6('0x69'),JSON[_0x21e6('0x2d')](_0x538fc7));endCsv();}});})['catch'](function(_0x460018){logger['error'](_0x21e6('0x6a'),JSON[_0x21e6('0x2d')](_0x460018));});}main(); \ No newline at end of file +var _0x6ed3=['cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','findAll','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','resolve','createReadStream','parse','pause','info','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','\x20=\x20?','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum'];(function(_0x5f2fc9,_0x3eff8f){var _0x1dd418=function(_0x5818f7){while(--_0x5818f7){_0x5f2fc9['push'](_0x5f2fc9['shift']());}};_0x1dd418(++_0x3eff8f);}(_0x6ed3,0x16c));var _0x36ed=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x6ed3[_0x39bfb6];return _0x23fef9;};'use strict';var BPromise=require(_0x36ed('0x0'));var util=require(_0x36ed('0x1'));var _=require(_0x36ed('0x2'));var fs=require('fs');var squel=require(_0x36ed('0x3'));var Papa=require(_0x36ed('0x4'));var Redis=require(_0x36ed('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x36ed('0x6'));var logger=require('../../../config/logger')(_0x36ed('0x7'));config['redis']=_[_0x36ed('0x8')](config[_0x36ed('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x36ed('0xa'))(new Redis(config[_0x36ed('0x9')]));require(_0x36ed('0xb'))[_0x36ed('0xc')](socket);try{if(!process[_0x36ed('0xd')][0x2]||process[_0x36ed('0xd')][0x2]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x36ed('0xd')][0x2];if(!process[_0x36ed('0xd')][0x3]||process[_0x36ed('0xd')][0x3]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x3]===_0x36ed('0xf')||!process['argv'][0x4]||process[_0x36ed('0xd')][0x4]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x4]==='null'){throw new Error(_0x36ed('0x10'));}var FIELDS=_[_0x36ed('0x11')](process['argv'][0x3][_0x36ed('0x12')](','),process[_0x36ed('0xd')][0x4][_0x36ed('0x12')](','));if(!process[_0x36ed('0xd')][0x5]||process[_0x36ed('0xd')][0x5]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x5]===_0x36ed('0xf')){throw new Error(_0x36ed('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x36ed('0xd')][0x6]&&process[_0x36ed('0xd')][0x6]!==_0x36ed('0xe')&&process['argv'][0x6]!==_0x36ed('0xf')?process[_0x36ed('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x36ed('0xd')][0x7]!==_0x36ed('0xe')&&process[_0x36ed('0xd')][0x7]!==_0x36ed('0xf')?process['argv'][0x7]:null;if(!process[_0x36ed('0xd')][0x8]||process[_0x36ed('0xd')][0x8]===_0x36ed('0xe')||process[_0x36ed('0xd')][0x8]===_0x36ed('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x30a01d){logger[_0x36ed('0x14')](_0x30a01d);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(_0x431bcc,_0x408016,_0x2f4c0d,_0xe88159){var _0x142e4c={'message':_0x408016};_0x142e4c[_0x431bcc]=!![];if(_0x2f4c0d){_0x142e4c['contact']=_0x2f4c0d;}if(_0xe88159){_0x142e4c[_0x36ed('0x15')]=_0xe88159;}return _0x142e4c;}function isEmail(_0x273bb2){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'](_0x273bb2);}function checkRow(_0x3708cb,_0x204cc4,_0x346837){return new BPromise(function(_0x2129a6,_0x19409a){if(_[_0x36ed('0x16')](_0x3708cb)){return _0x19409a(handleCheckRowError('error',_0x36ed('0x17'),null,_0x346837));}if(_0x3708cb['errors']&&_0x3708cb['errors'][_0x36ed('0x18')]){var _0x46659e=_[_0x36ed('0x19')](_0x3708cb['errors'],_0x36ed('0x1a'))[_0x36ed('0x1b')](';');return _0x19409a(handleCheckRowError(_0x36ed('0x14'),_0x46659e,null,_0x346837));}var _0x181b34={};for(var _0x308ce0 in FIELDS){if(FIELDS[_0x36ed('0x1c')](_0x308ce0)&&FIELDS[_0x308ce0]){_0x181b34[_0x308ce0]=_0x3708cb[_0x36ed('0x1d')][0x0][FIELDS[_0x308ce0]]||_0x3708cb['data'][0x0]['\ufeff'+FIELDS[_0x308ce0]];}}if(!_0x181b34[_0x36ed('0x1e')]){return _0x19409a(handleCheckRowError('error',_0x36ed('0x1f'),null,_0x346837));}if(!_0x181b34[_0x36ed('0x20')]){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),'phone\x20not\x20specified!',null,_0x346837));}if(_0x181b34[_0x36ed('0x21')]){var _0x25cf83=moment(_0x181b34[_0x36ed('0x21')],_0x36ed('0x22'));if(!_0x25cf83['isValid']()){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),_0x36ed('0x23'),null,_0x346837));}}if(_0x181b34[_0x36ed('0x24')]){if(!isEmail(_0x181b34[_0x36ed('0x24')])){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),_0x36ed('0x25'),null,_0x346837));}}_0x181b34[_0x36ed('0x26')]=LISTID;_0x181b34[_0x36ed('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x204cc4){var _0x3fcc49={};for(var _0x5e5db5=0x0,_0x45d453=DUPLICATES[_0x36ed('0x18')];_0x5e5db5<_0x45d453;_0x5e5db5+=0x1){_0x3fcc49[DUPLICATES[_0x5e5db5]]=_0x181b34[DUPLICATES[_0x5e5db5]];}var _0xb20cbf=_[_0x36ed('0x28')](_0x204cc4,_0x3fcc49);if(_0xb20cbf){return _0x19409a(handleCheckRowError(_0x36ed('0x29'),_0x36ed('0x2a'),_0xb20cbf,_0x346837));}}return db[_0x36ed('0x2b')]['create'](_0x181b34,{'raw':!![],'hooks':![],'fields':_[_0x36ed('0x2c')](_0x181b34)})[_0x36ed('0x2d')](function(_0x5c769b){if(DUPLICATES&&DUPLICATES['length']&&_0x204cc4){_0x204cc4['push'](_['pick'](_0x181b34,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5c769b['id'];return _0x2129a6();})[_0x36ed('0x2e')](function(_0x552111){return _0x19409a(handleCheckRowError(_0x36ed('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x552111['message']||JSON[_0x36ed('0x2f')](_0x552111)),null,_0x346837));});});}function checkHopper(){function _0x4f4cb8(){return function(_0x137f17){logger[_0x36ed('0x14')](_0x36ed('0x30'),_0x36ed('0x31'),util[_0x36ed('0x32')](_0x137f17,{'showHidden':![],'depth':null}));};}var _0x430741=function(_0x3a3e31,_0x3f4339){var _0x145429=squel[_0x36ed('0x33')]()['into'](_0x36ed('0x34'))[_0x36ed('0x35')]([_0x36ed('0x20'),_0x36ed('0x36'),'ContactId','ListId',_0x3f4339,_0x36ed('0x37'),_0x36ed('0x38')],squel[_0x36ed('0x39')]()[_0x36ed('0x3a')](_0x36ed('0x20'),_0x36ed('0x20'))[_0x36ed('0x3a')](_0x36ed('0x3b'),'scheduledAt')[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID[_0x36ed('0x3d')](),'ListId')[_0x36ed('0x3a')](_0x3a3e31['id'][_0x36ed('0x3d')](),_0x3f4339)['field'](_0x36ed('0x3b'),'createdAt')[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x38'))[_0x36ed('0x3e')](_0x36ed('0x3f'))[_0x36ed('0x40')](_0x36ed('0x41'))[_0x36ed('0x40')](_0x36ed('0x42'),LISTID['toString']())[_0x36ed('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x36ed('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x36ed('0x39')]()[_0x36ed('0x3a')](_0x36ed('0x20'))[_0x36ed('0x3e')](_0x36ed('0x34'))[_0x36ed('0x40')](_0x3f4339+_0x36ed('0x43'),_0x3a3e31['id'][_0x36ed('0x3d')]())))['toString']();return _0x145429;};var _0x580e5c=function(_0x33a55b,_0x3c47a9){var _0x1506ac=squel[_0x36ed('0x33')]()['into']('cm_hopper')['fromQuery']([_0x36ed('0x20'),_0x36ed('0x36'),_0x36ed('0x3c'),_0x36ed('0x26'),_0x3c47a9,_0x36ed('0x37'),_0x36ed('0x38')],squel['select']()[_0x36ed('0x3a')](_0x36ed('0x20'),_0x36ed('0x20'))[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x36'))[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID[_0x36ed('0x3d')](),'ListId')[_0x36ed('0x3a')](_0x33a55b['id'][_0x36ed('0x3d')](),_0x3c47a9)['field'](_0x36ed('0x3b'),_0x36ed('0x37'))[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x38'))['from'](_0x36ed('0x3f'))[_0x36ed('0x40')](_0x36ed('0x41'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x36ed('0x40')]('id\x20IN\x20?',squel[_0x36ed('0x44')](hopperContacts))[_0x36ed('0x40')](_0x36ed('0x45'))[_0x36ed('0x40')](_0x36ed('0x46'),squel[_0x36ed('0x39')]()['field'](_0x36ed('0x47'))[_0x36ed('0x3e')](_0x36ed('0x48'))[_0x36ed('0x40')](_0x3c47a9+_0x36ed('0x43'),_0x33a55b['id'][_0x36ed('0x3d')]()))['where'](_0x36ed('0x46'),squel[_0x36ed('0x39')]()['field'](_0x36ed('0x20'))[_0x36ed('0x3e')](_0x36ed('0x34'))[_0x36ed('0x40')](_0x3c47a9+_0x36ed('0x43'),_0x33a55b['id'][_0x36ed('0x3d')]())))['toString']();return _0x1506ac;};function _0x2fdaf4(_0x13059c,_0x1ebd85){var _0x1f7fb1=squel[_0x36ed('0x33')]()['into'](_0x36ed('0x34'))[_0x36ed('0x35')]([_0x36ed('0x20'),_0x36ed('0x36'),_0x36ed('0x3c'),_0x36ed('0x26'),_0x1ebd85,_0x36ed('0x37'),_0x36ed('0x38')],squel[_0x36ed('0x39')]()[_0x36ed('0x3a')]('phone','phone')['field'](_0x36ed('0x3b'),_0x36ed('0x36'))[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID['toString'](),_0x36ed('0x26'))[_0x36ed('0x3a')](_0x13059c['id'][_0x36ed('0x3d')](),_0x1ebd85)['field'](_0x36ed('0x3b'),_0x36ed('0x37'))[_0x36ed('0x3a')](_0x36ed('0x3b'),_0x36ed('0x38'))[_0x36ed('0x3e')]('cm_contacts')[_0x36ed('0x40')](_0x36ed('0x41'))[_0x36ed('0x40')](_0x36ed('0x42'),LISTID[_0x36ed('0x3d')]())[_0x36ed('0x40')](_0x36ed('0x49'),squel[_0x36ed('0x44')](hopperContacts))[_0x36ed('0x40')](_0x36ed('0x45')))[_0x36ed('0x3d')]();return _0x1f7fb1;}function _0x5bb765(_0x4932b7,_0x5c5eca){var _0x533ab5=squel[_0x36ed('0x33')]()['into'](_0x36ed('0x4a'))[_0x36ed('0x35')](['phone',_0x36ed('0x3c'),'ListId',_0x5c5eca,'createdAt',_0x36ed('0x38')],squel[_0x36ed('0x39')]()[_0x36ed('0x3a')]('phone',_0x36ed('0x20'))[_0x36ed('0x3a')]('id',_0x36ed('0x3c'))[_0x36ed('0x3a')](LISTID[_0x36ed('0x3d')](),_0x36ed('0x26'))[_0x36ed('0x3a')](_0x4932b7['id']['toString'](),_0x5c5eca)['field'](_0x36ed('0x3b'),'createdAt')[_0x36ed('0x3a')](_0x36ed('0x3b'),'updatedAt')[_0x36ed('0x3e')](_0x36ed('0x3f'))[_0x36ed('0x40')](_0x36ed('0x41'))[_0x36ed('0x40')](_0x36ed('0x42'),LISTID[_0x36ed('0x3d')]())[_0x36ed('0x40')](_0x36ed('0x49'),squel['str'](hopperContacts))[_0x36ed('0x40')](_0x36ed('0x45')))['toString']();return _0x533ab5;}return db[_0x36ed('0x4b')]['findAll']({'where':{'type':_0x36ed('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x36ed('0x4d')],'as':_0x36ed('0x4e'),'where':{'id':LISTID}}]})[_0x36ed('0x2d')](function(_0x50c8e7){var _0x3ebee1=[];if(_0x50c8e7){var _0x548776;for(var _0xb0093e=0x0,_0x67ff1f;_0xb0093e<_0x50c8e7[_0x36ed('0x18')];_0xb0093e+=0x1){_0x67ff1f=_0x50c8e7[_0xb0093e][_0x36ed('0x4f')]({'plain':!![]});switch(_0x67ff1f[_0x36ed('0x50')]){case _0x36ed('0x51'):_0x3ebee1[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x580e5c(_0x67ff1f,'VoiceQueueId'))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));break;case _0x36ed('0x55'):_0x3ebee1[_0x36ed('0x52')](db['sequelize'][_0x36ed('0x54')](_0x430741(_0x67ff1f,_0x36ed('0x56')))[_0x36ed('0x2d')](function(){})['catch'](_0x4f4cb8()));break;default:_0x3ebee1['push'](db['sequelize'][_0x36ed('0x54')](_0x2fdaf4(_0x67ff1f,_0x36ed('0x56')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}}return _0x3ebee1;})[_0x36ed('0x57')]()[_0x36ed('0x2d')](function(){return db[_0x36ed('0x4b')][_0x36ed('0x58')]({'where':{'type':_0x36ed('0x4c')},'attributes':['id'],'include':[{'model':db[_0x36ed('0x4d')],'as':_0x36ed('0x59'),'where':{'id':LISTID}}]})[_0x36ed('0x2d')](function(_0x3892ad){var _0x325303=[];if(_0x3892ad){var _0x5b8fde;for(var _0x450e00=0x0,_0x4a7cde;_0x450e00<_0x3892ad[_0x36ed('0x18')];_0x450e00+=0x1){_0x4a7cde=_0x3892ad[_0x450e00][_0x36ed('0x4f')]({'plain':!![]});_0x325303[_0x36ed('0x52')](db[_0x36ed('0x53')]['query'](_0x5bb765(_0x4a7cde,_0x36ed('0x56')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}return _0x325303;})['all']();})[_0x36ed('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x36ed('0x50')],'include':[{'model':db[_0x36ed('0x4d')],'as':'Lists','where':{'id':LISTID}}]})[_0x36ed('0x2d')](function(_0x8ef8a8){var _0x2289a8=[];if(_0x8ef8a8){for(var _0x4d1019=0x0,_0x61d945;_0x4d1019<_0x8ef8a8[_0x36ed('0x18')];_0x4d1019+=0x1){_0x61d945=_0x8ef8a8[_0x4d1019]['get']({'plain':!![]});switch(_0x61d945['dialCheckDuplicateType']){case _0x36ed('0x51'):_0x2289a8[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x580e5c(_0x61d945,_0x36ed('0x5a')))['then'](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));break;case _0x36ed('0x55'):_0x2289a8[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x430741(_0x61d945,_0x36ed('0x5a')))['then'](function(){})['catch'](_0x4f4cb8()));break;default:_0x2289a8[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x2fdaf4(_0x61d945,_0x36ed('0x5a')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}}return _0x2289a8;})['all']();})['then'](function(){return db[_0x36ed('0x5b')][_0x36ed('0x58')]({'attributes':['id'],'include':[{'model':db[_0x36ed('0x4d')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x121983){var _0xc4708f=[];if(_0x121983){for(var _0x357459=0x0,_0x203668;_0x357459<_0x121983['length'];_0x357459+=0x1){_0x203668=_0x121983[_0x357459]['get']({'plain':!![]});_0xc4708f[_0x36ed('0x52')](db[_0x36ed('0x53')][_0x36ed('0x54')](_0x5bb765(_0x203668,_0x36ed('0x5a')))[_0x36ed('0x2d')](function(){})[_0x36ed('0x2e')](_0x4f4cb8()));}}return _0xc4708f;})[_0x36ed('0x57')]();})[_0x36ed('0x2e')](function(_0x58b811){logger[_0x36ed('0x14')](_0x36ed('0x5c'),_0x36ed('0x5d'),_0x58b811[_0x36ed('0x1a')]);});}var processPromises=function(_0x20e2c0){return BPromise['all'](promises)[_0x36ed('0x2d')](function(_0xa2584){})[_0x36ed('0x2e')](function(_0x8f4560){logger[_0x36ed('0x14')](_0x36ed('0x5e'),JSON[_0x36ed('0x2f')](_0x8f4560));})[_0x36ed('0x5f')](function(){socket[_0x36ed('0x60')](_0x36ed('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x20e2c0){return _0x20e2c0[_0x36ed('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x36ed('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x36ed('0x2d')](function(){socket['emit'](_0x36ed('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x36ed('0x63')](FILEPATH);}catch(_0x4c729c){logger[_0x36ed('0x14')](_0x36ed('0x64'),JSON[_0x36ed('0x2f')](_0x4c729c));}finally{process[_0x36ed('0x65')](0x0);}});};process['on'](_0x36ed('0x66'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x36ed('0x67')]()[_0x36ed('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x36ed('0x12')](',');return db[_0x36ed('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x36ed('0x2d')](function(_0x432648){var _0x57c7a9=fs[_0x36ed('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x36ed('0x69')](_0x57c7a9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c914b,_0x1d68f7){total+=0x1;var _0x31d2fb=total;promises[_0x36ed('0x52')](checkRow(_0x3c914b,_0x432648,_0x31d2fb)[_0x36ed('0x2d')](function(){success+=0x1;})['catch'](function(_0x4418e5){if(_0x4418e5['error']){errors+=0x1;delete _0x4418e5[_0x36ed('0x14')];}else if(_0x4418e5['duplicate']){duplicates+=0x1;delete _0x4418e5['duplicate'];}rows[_0x36ed('0x52')](_0x4418e5);}));if(total%0xc8===0x0){_0x1d68f7[_0x36ed('0x6a')]();return processPromises(_0x1d68f7);}},'complete':function(){return processPromises()['then'](function(){logger[_0x36ed('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x319415,_0x6d2f2d){logger[_0x36ed('0x6b')](_0x36ed('0x6c'),JSON[_0x36ed('0x2f')](_0x319415));endCsv();}});})[_0x36ed('0x2e')](function(_0x8c221f){logger[_0x36ed('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x36ed('0x2f')](_0x8c221f));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index fd703aa..8c2d169 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 _0xf0e9=['each','contactId','contactTypeId','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','all','split','push','isNil','filter','CmContactHasItem','findOne','update','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','priority','UserId','from','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ContactId','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','insert','updatedAt','recallme','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','sequelize','query','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_has_cm_lists.CmListId=','timezones','dialTimezone','set','spread','main','send','start','binding','root','.csv','includes','name','_description','writeFileSync','createReadStream','data','rows','errors','find','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','trim','itemTypeId','description','replace','SystemRow','appendFileSync','emit','contact:import:','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()'];(function(_0x4b1d53,_0x17cc7c){var _0x3d75b6=function(_0x1a75a0){while(--_0x1a75a0){_0x4b1d53['push'](_0x4b1d53['shift']());}};_0x3d75b6(++_0x17cc7c);}(_0xf0e9,0x18e));var _0x9f0e=function(_0x208bff,_0x280a10){_0x208bff=_0x208bff-0x0;var _0x32ed5a=_0xf0e9[_0x208bff];return _0x32ed5a;};'use strict';var fs=require('fs');var path=require(_0x9f0e('0x0'));var _=require(_0x9f0e('0x1'));var Papa=require(_0x9f0e('0x2'));var util=require('util');var BPromise=require(_0x9f0e('0x3'));var moment=require('moment');var squel=require(_0x9f0e('0x4'));var Redis=require(_0x9f0e('0x5'));var db=require(_0x9f0e('0x6'))['db'];var config=require(_0x9f0e('0x7'));var shared=require(_0x9f0e('0x8'));var logger=require(_0x9f0e('0x9'))(_0x9f0e('0xa'));config['redis']=_[_0x9f0e('0xb')](config[_0x9f0e('0xc')],{'host':_0x9f0e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x9f0e('0xe')](_0x9f0e('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x9f0e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x17bc6c){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'](_0x17bc6c);}function selectNotIn(_0x52da34,_0x42ef77,_0x26dc09,_0x9f570c,_0x2c8933){return squel[_0x9f0e('0x10')]()[_0x9f0e('0x11')](_0x9f0e('0x12'))['from'](_0x9f570c)[_0x9f0e('0x13')](_0x42ef77,null,_0x42ef77+'.id\x20=\x20'+_0x9f570c+'.'+_0x26dc09)['where'](_0x9f570c+'.'+_0x26dc09+_0x9f0e('0x14')+_0x52da34+'.'+_0x26dc09)[_0x9f0e('0x15')](_0x42ef77+_0x9f0e('0x16')+_0x2c8933[_0x9f0e('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x435328,_0x53bfb5){promisesAdditionalPhones=[];return db[_0x9f0e('0x17')][_0x9f0e('0x18')]({'raw':!![],'attributes':['id',_0x9f0e('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x9f0e('0x1a')](function(_0x38b3fe){if(_0x38b3fe!==null){var _0x3ee61f=[];for(var _0x279ec9=0x0;_0x279ec9<_0x38b3fe[_0x9f0e('0x1b')];_0x279ec9++){var _0x605bc4=_0x38b3fe[_0x279ec9];_0x3ee61f['push'](insertAdditionalPhones(_0x605bc4));}}Promise[_0x9f0e('0x1c')](_0x3ee61f)[_0x9f0e('0x1a')](function(){_0x435328({'val':0x1});});});});}function insertAdditionalPhones(_0x3daae7){return new Promise(function(_0x563643,_0x93db5){var _0x3938f7=_0x3daae7['AdditionalPhones'];var _0x3dfa0c=_0x3938f7[_0x9f0e('0x1d')](';');var _0x5a1739=[];orderBy=0x0;for(var _0x1f55b7=0x0;_0x1f55b7<_0x3dfa0c[_0x9f0e('0x1b')];_0x1f55b7++){_0x5a1739[_0x9f0e('0x1e')](splitAdditionalPhone(_0x3daae7['id'],_0x3dfa0c[_0x1f55b7]));}Promise[_0x9f0e('0x1c')](_0x5a1739)['then'](function(){_0x563643({'val':_0x3dfa0c['length']});});});}function splitAdditionalPhone(_0x37a7e2,_0x5e1742){return new Promise(function(_0x51432b,_0x227130){var _0x429cc2=_0x5e1742['split'](':');var _0x262e08=_0x429cc2[0x0];var _0x4e9bf4=_0x429cc2[0x1];if(!_[_0x9f0e('0x1f')](_0x4e9bf4)){var _0x1339d4=_0x4e9bf4[_0x9f0e('0x1d')]('|');var _0x596229=[];for(var _0x3cae0c=0x0;_0x3cae0c<_0x1339d4[_0x9f0e('0x1b')];_0x3cae0c++){if(_0x1339d4[_0x3cae0c]!==''){var _0x916660=_[_0x9f0e('0x20')](promisesAdditionalPhones,{'contactId':_0x37a7e2,'phone':_0x1339d4[_0x3cae0c]});if(_0x916660[_0x9f0e('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x9f0e('0x1e')]({'contactId':_0x37a7e2,'contactTypeId':_0x262e08,'phone':_0x1339d4[_0x3cae0c],'orderBy':orderBy});}}}_0x51432b({'ok':0x1});}else _0x51432b({'res':0x0});});}function createAdditionalPhone(_0x62b5d1,_0x5ca7f2,_0x4d0529,_0xb94d8a){var _0x36b1af='';var _0x3e6751='';var _0x266d61=_0x4d0529[_0x9f0e('0x1d')]('§');_0x36b1af=_0x266d61[0x0];if(_0x266d61['length']==0x2)_0x3e6751=_0x266d61[0x1];return new Promise(function(_0x256c56,_0x5bcfcf){return db[_0x9f0e('0x21')][_0x9f0e('0x22')]({'where':{'CmContactId':_0x62b5d1,'item':_0x36b1af}})[_0x9f0e('0x1a')](function(_0x5e5ab3){if(_0x5e5ab3){return db[_0x9f0e('0x21')][_0x9f0e('0x23')]({'ItemTypeId':_0x5ca7f2,'description':_0x3e6751,'OrderBy':_0xb94d8a},{'where':{'CmContactId':_0x62b5d1,'item':_0x36b1af}})[_0x9f0e('0x1a')](function(_0x52aacd){_0x256c56({'res':'updated'});});}else{return db[_0x9f0e('0x21')][_0x9f0e('0x24')]({'CmContactId':_0x62b5d1,'item':_0x36b1af,'description':_0x3e6751,'ItemTypeId':_0x5ca7f2,'OrderBy':_0xb94d8a,'ItemClass':'PHONE'})[_0x9f0e('0x1a')](function(_0x38948f){_0x256c56({'res':_0x9f0e('0x25')});});}});});}function insertCmHopper(_0x23df41,_0x320068,_0x105afa,_0x4c58c0,_0x3425e6){var _0x30a574=[_0x9f0e('0x26'),_0x9f0e('0x27'),'cm_contacts.id',_0x9f0e('0x28'),_0x320068+'.'+_0x4c58c0,_0x9f0e('0x29'),_0x9f0e('0x2a'),_0x9f0e('0x2b'),_0x9f0e('0x2c'),'\x22'+_0x3425e6+'\x22'];return squel['insert']()[_0x9f0e('0x2d')](_0x9f0e('0x2e'))[_0x9f0e('0x2f')]([_0x9f0e('0x12'),_0x9f0e('0x30'),'ContactId',_0x9f0e('0x31'),_0x4c58c0,_0x9f0e('0x32'),'updatedAt',_0x9f0e('0x33'),_0x9f0e('0x34'),'recallme'],squel[_0x9f0e('0x10')]()['fields'](_0x30a574)[_0x9f0e('0x35')](_0x320068)[_0x9f0e('0x13')]('cm_contacts',null,_0x9f0e('0x36')+_0x320068+_0x9f0e('0x37'))[_0x9f0e('0x13')](_0x105afa,null,_0x105afa+_0x9f0e('0x38')+_0x320068+'.'+_0x4c58c0)[_0x9f0e('0x15')](_0x320068+'.CmListId\x20=\x20?',_0x23df41)[_0x9f0e('0x15')](_0x9f0e('0x39'),NOW)[_0x9f0e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x320068,_0x105afa,_0x4c58c0,'cm_hopper',[_0x9f0e('0x3a'),_0x9f0e('0x3b')]))[_0x9f0e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x320068,_0x105afa,_0x4c58c0,_0x9f0e('0x2e'),[_0x9f0e('0x3a')])))[_0x9f0e('0x3c')]();}function insertCmHopperBlack(_0x248775,_0x38c5fb,_0x58084d,_0x470002){var _0x22f94e=['cm_contacts.phone','cm_contacts.id',_0x9f0e('0x28'),_0x38c5fb+'.'+_0x470002,_0x9f0e('0x29'),'cm_contacts.updatedAt'];return squel['insert']()[_0x9f0e('0x2d')](_0x9f0e('0x3d'))[_0x9f0e('0x2f')]([_0x9f0e('0x12'),_0x9f0e('0x3e'),_0x9f0e('0x31'),_0x470002,_0x9f0e('0x32'),'updatedAt'],squel[_0x9f0e('0x10')]()[_0x9f0e('0x3f')](_0x22f94e)[_0x9f0e('0x35')](_0x38c5fb)[_0x9f0e('0x13')](_0x9f0e('0x40'),null,_0x9f0e('0x36')+_0x38c5fb+'.CmListId')[_0x9f0e('0x13')](_0x58084d,null,_0x58084d+_0x9f0e('0x38')+_0x38c5fb+'.'+_0x470002)[_0x9f0e('0x15')](_0x38c5fb+_0x9f0e('0x41'),_0x248775)['where'](_0x9f0e('0x39'),NOW)[_0x9f0e('0x15')](_0x9f0e('0x42'),squel[_0x9f0e('0x10')]()[_0x9f0e('0x11')](_0x9f0e('0x12'))[_0x9f0e('0x35')](_0x9f0e('0x3d'))[_0x9f0e('0x15')](_0x9f0e('0x43'),_0x248775)[_0x9f0e('0x15')](_0x470002+_0x9f0e('0x14')+_0x38c5fb+'.'+_0x470002)))[_0x9f0e('0x3c')]();}function insertTzCmHopper(_0x495fac,_0x605677,_0x55c6ff,_0x44635d,_0x2515b7,_0x27e634){var _0xe04a44=[_0x9f0e('0x26'),_0x9f0e('0x44')+_0x27e634+_0x9f0e('0x45'),_0x9f0e('0x46'),'cm_contacts.ListId',_0x605677+'.'+_0x44635d,_0x9f0e('0x29'),_0x9f0e('0x2a'),_0x9f0e('0x2b'),'cm_contacts.UserId','\x22'+_0x2515b7+'\x22'];var _0x25d604=squel[_0x9f0e('0x47')]()[_0x9f0e('0x2d')](_0x9f0e('0x2e'))[_0x9f0e('0x2f')]([_0x9f0e('0x12'),_0x9f0e('0x30'),_0x9f0e('0x3e'),'ListId',_0x44635d,_0x9f0e('0x32'),_0x9f0e('0x48'),_0x9f0e('0x33'),'UserId',_0x9f0e('0x49')],squel[_0x9f0e('0x10')]()[_0x9f0e('0x3f')](_0xe04a44)['from'](_0x605677)[_0x9f0e('0x13')](_0x9f0e('0x40'),null,_0x9f0e('0x36')+_0x605677+_0x9f0e('0x37'))[_0x9f0e('0x13')](_0x55c6ff,null,_0x55c6ff+'.id\x20=\x20'+_0x605677+'.'+_0x44635d)[_0x9f0e('0x13')](_0x27e634,null,_0x27e634+_0x9f0e('0x38')+_0x605677+'.'+_0x44635d)[_0x9f0e('0x15')](_0x605677+_0x9f0e('0x41'),_0x495fac)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9f0e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x605677,_0x55c6ff,_0x44635d,'cm_hopper',[_0x9f0e('0x3a'),_0x9f0e('0x3b')]))[_0x9f0e('0x15')](_0x9f0e('0x42'),selectNotIn(_0x605677,_0x55c6ff,_0x44635d,'cm_hopper',[_0x9f0e('0x3a')])))[_0x9f0e('0x3c')]();return _0x25d604;}function insertTzCmHopperBlack(_0x34799d,_0xa5e5c7,_0x64bdd6,_0x255063){var _0x4ce6ee=['cm_contacts.phone',_0x9f0e('0x46'),'cm_contacts.ListId',_0xa5e5c7+'.'+_0x255063,_0x9f0e('0x29'),'cm_contacts.updatedAt'];return squel[_0x9f0e('0x47')]()['into'](_0x9f0e('0x3d'))[_0x9f0e('0x2f')]([_0x9f0e('0x12'),_0x9f0e('0x3e'),_0x9f0e('0x31'),_0x255063,_0x9f0e('0x32'),_0x9f0e('0x48')],squel[_0x9f0e('0x10')]()[_0x9f0e('0x3f')](_0x4ce6ee)['from'](_0xa5e5c7)['join']('cm_contacts',null,_0x9f0e('0x36')+_0xa5e5c7+_0x9f0e('0x37'))[_0x9f0e('0x13')](_0x64bdd6,null,_0x64bdd6+_0x9f0e('0x38')+_0xa5e5c7+'.'+_0x255063)[_0x9f0e('0x15')](_0xa5e5c7+_0x9f0e('0x41'),_0x34799d)[_0x9f0e('0x15')](_0x9f0e('0x39'),NOW)[_0x9f0e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x9f0e('0x10')]()['field'](_0x9f0e('0x12'))[_0x9f0e('0x35')](_0x9f0e('0x3d'))[_0x9f0e('0x15')](_0x9f0e('0x43'),_0x34799d)[_0x9f0e('0x15')](_0x255063+'\x20=\x20'+_0xa5e5c7+'.'+_0x255063)))['toString']();}function insertCmHopperAdditionalPhones(_0x4836f8){var _0x17eb93=['cm_hopper.id',_0x9f0e('0x4a'),_0x9f0e('0x4b'),'cm_contact_has_items.createdAt',_0x9f0e('0x4c')];return squel[_0x9f0e('0x47')]()[_0x9f0e('0x2d')](_0x9f0e('0x4d'))[_0x9f0e('0x2f')]([_0x9f0e('0x4e'),_0x9f0e('0x12'),_0x9f0e('0x4f'),_0x9f0e('0x32'),'updatedAt'],squel[_0x9f0e('0x10')]()[_0x9f0e('0x3f')](_0x17eb93)[_0x9f0e('0x35')](_0x9f0e('0x2e'))[_0x9f0e('0x13')](_0x9f0e('0x40'),null,_0x9f0e('0x50'))[_0x9f0e('0x13')](_0x9f0e('0x51'),null,_0x9f0e('0x52'))[_0x9f0e('0x15')]('cm_hopper.ListId\x20=\x20?',_0x4836f8)['where'](_0x9f0e('0x39'),NOW))[_0x9f0e('0x3c')]();}function insertCmContact(_0x4b5de5,_0x205ed5,_0x12b149,_0x1f2ffd){var _0x21fdf9=_[_0x9f0e('0x53')](_[_0x9f0e('0x54')](_0x1f2ffd),['ListId',_0x9f0e('0x55'),_0x9f0e('0x32'),_0x9f0e('0x48'),_0x9f0e('0x56')]);return squel[_0x9f0e('0x47')]()['into'](_0x9f0e('0x40'))['fromQuery'](_0x21fdf9,squel['select']()[_0x9f0e('0x3f')](_0x21fdf9)['from'](_0x205ed5)[_0x9f0e('0x15')]('('+_0x12b149[_0x9f0e('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x9f0e('0x10')]()[_0x9f0e('0x3f')](_0x12b149)[_0x9f0e('0x35')](_0x9f0e('0x40'))[_0x9f0e('0x15')](_0x9f0e('0x43'),_0x4b5de5)[_0x9f0e('0x15')](_0x9f0e('0x57')))[_0x9f0e('0x15')](_0x9f0e('0x58'),squel['select']()[_0x9f0e('0x11')](_0x9f0e('0x59'),_0x9f0e('0x5a'))[_0x9f0e('0x35')](_0x205ed5)[_0x9f0e('0x5b')](_0x12b149[_0x9f0e('0x13')](','))))[_0x9f0e('0x3c')]();}function handleStop(){logger[_0x9f0e('0x5c')](_0x9f0e('0x5d'));stopped=!![];}function handleUncaughtException(_0x507aa6){logger[_0x9f0e('0x5e')](_0x507aa6[_0x9f0e('0x5f')]);process[_0x9f0e('0x60')](0x1);}function handleError(_0x2c12c4,_0x3574f6){stats['errors'][_0x9f0e('0x1e')]({'name':_0x3574f6['code'],'message':_0x3574f6['message'],'row':_0x2c12c4});}function handleQuery(_0x53dcfa){logger[_0x9f0e('0x5c')](_0x53dcfa);return db[_0x9f0e('0x61')][_0x9f0e('0x62')](_0x53dcfa)['spread'](function(_0x498c77){results[_0x9f0e('0x1e')](_0x498c77);})[_0x9f0e('0x63')](function(_0x4f133){logger[_0x9f0e('0x5e')](_0x4f133[_0x9f0e('0x5f')]);});}function updateTzCampaigns(_0x1e5c37){return new Promise(function(_0x334a5e,_0x11d3f6){var _0x11768e=squel['select']()['fields']([_0x9f0e('0x64'),_0x9f0e('0x65')])[_0x9f0e('0x35')](_0x9f0e('0x66'))[_0x9f0e('0x13')]('campaigns_has_cm_lists',null,_0x9f0e('0x67'))['where'](_0x9f0e('0x68')+_0x1e5c37);db[_0x9f0e('0x61')][_0x9f0e('0x62')](_0x11768e['toString']())['spread'](function(_0xee23fc){var _0x46c2e4=[];for(var _0xd4527e=0x0;_0xd4527e<_0xee23fc[_0x9f0e('0x1b')];_0xd4527e++){_0x46c2e4[_0x9f0e('0x1e')](getTimezoneData(_0xee23fc[_0xd4527e],tmp_campaigns));}BPromise[_0x9f0e('0x1c')](_0x46c2e4)[_0x9f0e('0x1a')](function(){_0x334a5e({'val':0x1});});})['catch'](function(_0x2baeeb){logger[_0x9f0e('0x5e')](_0x2baeeb[_0x9f0e('0x5f')]);_0x334a5e({'val':0x0});});});}function updateTzVoiceQueues(_0x2423cb){return new Promise(function(_0x2e2b28,_0xb5d492){var _0x4b0e57=squel[_0x9f0e('0x10')]()[_0x9f0e('0x3f')]([_0x9f0e('0x69'),_0x9f0e('0x6a')])[_0x9f0e('0x35')]('voice_queues')['join']('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x9f0e('0x15')](_0x9f0e('0x6b')+_0x2423cb);db['sequelize'][_0x9f0e('0x62')](_0x4b0e57[_0x9f0e('0x3c')]())['spread'](function(_0x57b11a){var _0x164996=[];for(var _0x54ead6=0x0;_0x54ead6<_0x57b11a[_0x9f0e('0x1b')];_0x54ead6++){_0x164996[_0x9f0e('0x1e')](getTimezoneData(_0x57b11a[_0x54ead6],tmp_voice_queues));}BPromise['all'](_0x164996)['then'](function(){_0x2e2b28({'val':0x1});});})[_0x9f0e('0x63')](function(_0x4cf1e0){logger['error'](_0x4cf1e0['message']);_0x2e2b28({'val':0x0});});});}function getTimezoneData(_0x2eaf70,_0x1180af){return new Promise(function(_0x538f08,_0x2551a0){var _0x2c01b2=shared[_0x9f0e('0x6c')];var _0x4f212b=_0x2c01b2[_0x2eaf70[_0x9f0e('0x6d')]];if(_['isNil'](_0x4f212b)){_0x538f08({'ret':0x1});}else{var _0x25b661=_0x4f212b['utcOffset'];var _0x49a3f2=squel['insert']()[_0x9f0e('0x2d')](_0x1180af)[_0x9f0e('0x6e')]('id',_0x2eaf70['id'])[_0x9f0e('0x6e')]('offset',_0x25b661)[_0x9f0e('0x6e')](_0x9f0e('0x6d'),_0x2eaf70['dialTimezone'])[_0x9f0e('0x3c')]();return db[_0x9f0e('0x61')][_0x9f0e('0x62')](_0x49a3f2)['spread'](function(_0x475ee6){_0x538f08({'ret':0x1});})['catch'](function(_0x29f7e7){logger['error'](_0x29f7e7[_0x9f0e('0x5f')]);_0x2551a0({'ret':0x1});});}});}function handleTZQuery(_0x49133f){logger[_0x9f0e('0x5c')](_0x49133f);return db[_0x9f0e('0x61')][_0x9f0e('0x62')](_0x49133f)[_0x9f0e('0x6f')](function(_0x308e32){})[_0x9f0e('0x63')](function(_0x5edb8a){logger[_0x9f0e('0x5e')](_0x5edb8a[_0x9f0e('0x5f')]);});}function main(_0x193d49,_0x589b07,_0x1b3e7a,_0x4f8838){logger[_0x9f0e('0x5c')](_0x9f0e('0x70'),_0x193d49,JSON['stringify'](_0x589b07));process[_0x9f0e('0x71')](_0x9f0e('0x72'));var _0x6ef6c9=_0x589b07[_0x9f0e('0x73')];var _0x517b5a=_['clone'](_0x6ef6c9);var _0x50c42d=_0x589b07['socket_timestamp'];var _0x50b16c=path[_0x9f0e('0x13')](config[_0x9f0e('0x74')],'server/files/tmp',_0x50c42d+_0x9f0e('0x75'));hasTZ=_[_0x9f0e('0x54')](_0x6ef6c9)[_0x9f0e('0x76')](_0x9f0e('0x6d'));var _0x42c576=_['keys'](_0x6ef6c9)[_0x9f0e('0x13')]();logger[_0x9f0e('0x5c')]('header',_0x42c576);db['ContactItemType'][_0x9f0e('0x18')]({'raw':!![],'attributes':['id',_0x9f0e('0x77')]})[_0x9f0e('0x1a')](function(_0x1ba586){for(var _0x7297c5=0x0;_0x7297c5<_0x1ba586[_0x9f0e('0x1b')];_0x7297c5++){if(_0x1ba586[_0x7297c5][_0x9f0e('0x77')]in _0x6ef6c9){contactItemTypes[_0x9f0e('0x1e')](_0x1ba586[_0x7297c5]);delete _0x517b5a[_0x1ba586[_0x7297c5][_0x9f0e('0x77')]];hasAdditionalPhones=!![];}for(var _0x36b711 in _0x6ef6c9){if(_0x1ba586[_0x7297c5][_0x9f0e('0x77')]+_0x9f0e('0x78')===_0x36b711){phoneDescriptions[_0x9f0e('0x1e')]({'itemTypeId':_0x1ba586[_0x7297c5]['id'],'description':_0x36b711});delete _0x517b5a[_0x36b711];}}}if(hasAdditionalPhones)_0x517b5a[_0x9f0e('0x19')]='';var _0x24c1c6=_[_0x9f0e('0x54')](_0x517b5a)['join']();logger[_0x9f0e('0x5c')]('header',_0x24c1c6);fs[_0x9f0e('0x79')](_0x50b16c,_0x24c1c6+'\x0a');Papa['parse'](fs[_0x9f0e('0x7a')](_0x193d49),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ad868,_0x1bf7d9){try{for(var _0x57c854=0x0,_0x4466bf=[];_0x57c854<_0x5ad868[_0x9f0e('0x7b')][_0x9f0e('0x1b')];_0x57c854++){stats[_0x9f0e('0x7c')]+=0x1;if(_0x5ad868[_0x9f0e('0x7d')][_0x57c854]){handleError(_0x5ad868[_0x9f0e('0x7b')][_0x57c854],_0x5ad868[_0x9f0e('0x7d')][_0x57c854]);}else{var _0xfbd099=[];var _0x32c54e=[];var _0x378e68={};for(var _0x2ccd97 in _0x6ef6c9){let _0x4346b1=contactItemTypes['find'](_0x275e86=>_0x275e86[_0x9f0e('0x77')]===_0x2ccd97);let _0x573c66=contactItemTypes[_0x9f0e('0x7e')](_0x53c7a8=>_0x53c7a8[_0x9f0e('0x77')]+_0x9f0e('0x78')===_0x2ccd97);if(_[_0x9f0e('0x1f')](_0x4346b1)&&_['isNil'](_0x573c66)){if(_0x6ef6c9['hasOwnProperty'](_0x2ccd97)){if(_0x5ad868[_0x9f0e('0x7b')][_0x57c854][_0x6ef6c9[_0x2ccd97]]){var _0x29204e=_['trim'](_0x5ad868[_0x9f0e('0x7b')][_0x57c854][_0x6ef6c9[_0x2ccd97]]['replace'](/"/g,'\x27'));switch(_0x2ccd97){case _0x9f0e('0x30'):var _0x295804=moment(_0x29204e,_0x9f0e('0xf'),!![]);if(_0x295804['isValid']()){_0x4466bf['push']('\x22'+_0x29204e+'\x22');}else{_0xfbd099[_0x9f0e('0x1e')](_0x9f0e('0x7f'));}break;case'priority':var _0xdab23=parseInt(_0x29204e);_0x29204e=_[_0x9f0e('0x80')](_0xdab23)||_0xdab23<0x0||_0xdab23>0x4?_0x4f8838?0x3:0x2:_0xdab23;_0x4466bf['push']('\x22'+_0x29204e+'\x22');break;case _0x9f0e('0x34'):var _0x17f3bb=parseInt(_0x29204e);if(_[_0x9f0e('0x81')](_0x17f3bb)&&_[_0x9f0e('0x76')](_0x1b3e7a,_0x17f3bb)){_0x4466bf['push']('\x22'+_0x17f3bb+'\x22');}else{_0xfbd099[_0x9f0e('0x1e')](_0x9f0e('0x82'));}break;case _0x9f0e('0x83'):if(isEmail(_0x29204e)){_0x4466bf['push']('\x22'+_0x29204e+'\x22');}else{_0xfbd099[_0x9f0e('0x1e')](_0x9f0e('0x84'));}break;case _0x9f0e('0x85'):var _0x4baf54=moment(_0x29204e,'YYYY-MM-DD',!![]);if(_0x4baf54[_0x9f0e('0x86')]()){_0x4466bf[_0x9f0e('0x1e')]('\x22'+_0x29204e+'\x22');}else{_0xfbd099[_0x9f0e('0x1e')](_0x9f0e('0x87'));}break;case _0x9f0e('0x6d'):var _0x49b85f=shared[_0x9f0e('0x6c')];var _0x367074=_0x49b85f[_0x29204e];if(!_[_0x9f0e('0x1f')](_0x367074)){var _0x518e1f=_0x367074[_0x9f0e('0x88')];_0x4466bf[_0x9f0e('0x1e')]('\x22'+_0x29204e+'\x22');_0x4466bf['push']('\x22'+_0x518e1f+'\x22');}break;default:_0x4466bf[_0x9f0e('0x1e')]('\x22'+_0x29204e+'\x22');}}else{switch(_0x2ccd97){case _0x9f0e('0x89'):case'phone':_0xfbd099[_0x9f0e('0x1e')](_0x2ccd97+_0x9f0e('0x8a'));break;default:_0x4466bf[_0x9f0e('0x1e')]('\x22\x22');}}}}else{var _0x146b8f='';if(!_['isNil'](_0x4346b1)){if(!_0x378e68['hasOwnProperty'](_0x4346b1['id'])){if(!_[_0x9f0e('0x1f')](_0x5ad868['data'][_0x57c854][_0x6ef6c9[_0x2ccd97]])){var _0x29204e=_[_0x9f0e('0x8b')](_0x5ad868[_0x9f0e('0x7b')][_0x57c854][_0x6ef6c9[_0x2ccd97]]['replace'](/"/g,'\x27'));var _0x293c55=phoneDescriptions[_0x9f0e('0x7e')](_0x368f32=>_0x368f32[_0x9f0e('0x8c')]===_0x4346b1['id']);if(!_[_0x9f0e('0x1f')](_0x293c55)){var _0x58d316=_[_0x9f0e('0x8b')](_0x5ad868[_0x9f0e('0x7b')][_0x57c854][_0x6ef6c9[_0x293c55[_0x9f0e('0x8d')]]][_0x9f0e('0x8e')](/"/g,'\x27'));if(!_[_0x9f0e('0x1f')](_0x58d316))_0x29204e=_0x29204e+'§'+_0x58d316;}if(_0x146b8f=='')_0x146b8f=_0x29204e;else _0x146b8f+='|'+_0x29204e;}_0x32c54e[_0x9f0e('0x1e')](_0x4346b1['id']+':'+_0x146b8f);_0x378e68[_0x4346b1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4466bf['push']('\x22'+_0x32c54e['join'](';')+'\x22');}if(_0xfbd099[_0x9f0e('0x1b')]){handleError(_0x5ad868[_0x9f0e('0x7b')][_0x57c854],{'code':_0x9f0e('0x8f'),'message':_0xfbd099['join']()});}else{fs[_0x9f0e('0x90')](_0x50b16c,_0x4466bf[_0x9f0e('0x13')]()+'\x0a');}_0x4466bf=[];}if(!(stats[_0x9f0e('0x7c')]%0xc8)){socket[_0x9f0e('0x91')](_0x9f0e('0x92')+_0x50c42d,stats);stats[_0x9f0e('0x7d')]=[];}}if(stopped){logger[_0x9f0e('0x5c')]('Abort\x20parser');_0x1bf7d9['abort']();}}catch(_0x1d6cf0){handleError(_0x5ad868[_0x9f0e('0x7b')][_0x57c854],{'code':'SystemError','message':_0x1d6cf0[_0x9f0e('0x5f')]});logger['error'](_0x9f0e('0x93'),_0x1d6cf0[_0x9f0e('0x5f')]);}},'complete':function(){try{var _0x13bf58=[];var _0x52bce7=[];var _0x33f17b=_0x9f0e('0x40');if(_0x589b07[_0x9f0e('0x94')]&&_0x589b07['duplicates']['length']){_0x33f17b=_0x9f0e('0x95')+_0x50c42d;_0x13bf58[_0x9f0e('0x1e')]('CREATE\x20TABLE\x20'+_0x33f17b+_0x9f0e('0x96'));}tmp_campaigns=_0x9f0e('0x97')+_0x50c42d;tmp_voice_queues='voice_queues_'+_0x50c42d;_0x52bce7['push'](_0x9f0e('0x98')+tmp_campaigns+_0x9f0e('0x99'));_0x52bce7[_0x9f0e('0x1e')](_0x9f0e('0x98')+tmp_voice_queues+_0x9f0e('0x99'));BPromise['each'](_0x52bce7,handleTZQuery)['then'](function(_0x41acde){updateTzCampaigns(_0x589b07['ListId'])['then'](function(_0x2eebd0){updateTzVoiceQueues(_0x589b07['ListId'])[_0x9f0e('0x1a')](function(_0x75e0c0){if(hasTZ)_0x24c1c6=_0x24c1c6[_0x9f0e('0x8e')]('dialTimezone',_0x9f0e('0x9a'));var _0x4114c1=util[_0x9f0e('0xe')](_0x9f0e('0x9b'),_0x50b16c,_0x33f17b,_0x24c1c6,_0x589b07[_0x9f0e('0x31')],_0x589b07[_0x9f0e('0x55')]||null,NOW,NOW);if(_[_0x9f0e('0x1f')](_0x6ef6c9[_0x9f0e('0x30')])){_0x4114c1+=_0x9f0e('0x9c');}_0x13bf58[_0x9f0e('0x1e')](_0x4114c1);if(_0x589b07[_0x9f0e('0x94')]&&_0x589b07[_0x9f0e('0x94')][_0x9f0e('0x1b')]){_0x13bf58[_0x9f0e('0x1e')](insertCmContact(_0x589b07[_0x9f0e('0x31')],_0x33f17b,_0x589b07['duplicates'],_0x6ef6c9));_0x13bf58['push']('DROP\x20TABLE\x20'+_0x33f17b+';');}BPromise[_0x9f0e('0x9d')](_0x13bf58,handleQuery)['then'](function(_0x5441ea){BPromise[_0x9f0e('0x1c')]([handleAdditionalPhones()])[_0x9f0e('0x1a')](function(){_0x13bf58=[];for(var _0x4e093f=0x0;_0x4e093f\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','then','length','all','split','push','isNil','filter','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_hopper_black','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','cm_contacts.phone','cm_contacts.UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','concat','keys','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','code','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','voice_queues.id','voice_queues.dialTimezone'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd67c,0x103));var _0xcd67=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xd67c[_0x32f7d7];return _0x133d09;};'use strict';var fs=require('fs');var path=require(_0xcd67('0x0'));var _=require(_0xcd67('0x1'));var Papa=require(_0xcd67('0x2'));var util=require(_0xcd67('0x3'));var BPromise=require(_0xcd67('0x4'));var moment=require(_0xcd67('0x5'));var squel=require(_0xcd67('0x6'));var Redis=require(_0xcd67('0x7'));var db=require(_0xcd67('0x8'))['db'];var config=require('../../../config/environment');var shared=require(_0xcd67('0x9'));var logger=require('../../../config/logger')(_0xcd67('0xa'));config[_0xcd67('0xb')]=_[_0xcd67('0xc')](config[_0xcd67('0xb')],{'host':_0xcd67('0xd'),'port':0x18eb});var socket=require(_0xcd67('0xe'))(new Redis(config[_0xcd67('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xcd67('0xf')](_0xcd67('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xcd67('0xf')](_0xcd67('0x10'));function isEmail(_0x92bd22){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))*$/[_0xcd67('0x11')](_0x92bd22);}function selectNotIn(_0x56f084,_0x3d18cc,_0x2e689e,_0x1415fb,_0x491f7b){return squel['select']()[_0xcd67('0x12')](_0xcd67('0x13'))[_0xcd67('0x14')](_0x1415fb)['join'](_0x3d18cc,null,_0x3d18cc+_0xcd67('0x15')+_0x1415fb+'.'+_0x2e689e)['where'](_0x1415fb+'.'+_0x2e689e+_0xcd67('0x16')+_0x56f084+'.'+_0x2e689e)[_0xcd67('0x17')](_0x3d18cc+_0xcd67('0x18')+_0x491f7b[_0xcd67('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x38b7f3,_0x20dd5b){promisesAdditionalPhones=[];return db[_0xcd67('0x1a')][_0xcd67('0x1b')]({'raw':!![],'attributes':['id',_0xcd67('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xcd67('0x1d')](function(_0x200ca6){if(_0x200ca6!==null){var _0x39d32d=[];for(var _0x15507f=0x0;_0x15507f<_0x200ca6[_0xcd67('0x1e')];_0x15507f++){var _0x234bf1=_0x200ca6[_0x15507f];_0x39d32d['push'](insertAdditionalPhones(_0x234bf1));}}Promise[_0xcd67('0x1f')](_0x39d32d)[_0xcd67('0x1d')](function(){_0x38b7f3({'val':0x1});});});});}function insertAdditionalPhones(_0x32cbb6){return new Promise(function(_0x219646,_0x56f03b){var _0x785644=_0x32cbb6['AdditionalPhones'];var _0x2e2ded=_0x785644[_0xcd67('0x20')](';');var _0x44a1f1=[];orderBy=0x0;for(var _0x47236a=0x0;_0x47236a<_0x2e2ded['length'];_0x47236a++){_0x44a1f1[_0xcd67('0x21')](splitAdditionalPhone(_0x32cbb6['id'],_0x2e2ded[_0x47236a]));}Promise[_0xcd67('0x1f')](_0x44a1f1)[_0xcd67('0x1d')](function(){_0x219646({'val':_0x2e2ded[_0xcd67('0x1e')]});});});}function splitAdditionalPhone(_0x48014d,_0x4c182f){return new Promise(function(_0xe97297,_0x50ea07){var _0x5f4876=_0x4c182f[_0xcd67('0x20')](':');var _0x39d981=_0x5f4876[0x0];var _0x225cbe=_0x5f4876[0x1];if(!_[_0xcd67('0x22')](_0x225cbe)){var _0xa18b49=_0x225cbe[_0xcd67('0x20')]('|');var _0x5a345c=[];for(var _0x17eba6=0x0;_0x17eba6<_0xa18b49['length'];_0x17eba6++){if(_0xa18b49[_0x17eba6]!==''){var _0x2d0046=_[_0xcd67('0x23')](promisesAdditionalPhones,{'contactId':_0x48014d,'phone':_0xa18b49[_0x17eba6]});if(_0x2d0046[_0xcd67('0x1e')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x48014d,'contactTypeId':_0x39d981,'phone':_0xa18b49[_0x17eba6],'orderBy':orderBy});}}}_0xe97297({'ok':0x1});}else _0xe97297({'res':0x0});});}function createAdditionalPhone(_0x40bb40,_0x31debe,_0x29e898,_0x5ad3cd){var _0x8c0376='';var _0xec9c0d='';var _0x538550=_0x29e898['split']('§');_0x8c0376=_0x538550[0x0];if(_0x538550['length']==0x2)_0xec9c0d=_0x538550[0x1];return new Promise(function(_0x433473,_0x26fd83){return db[_0xcd67('0x24')]['findOne']({'where':{'CmContactId':_0x40bb40,'item':_0x8c0376}})[_0xcd67('0x1d')](function(_0xe4d60){if(_0xe4d60){return db['CmContactHasItem'][_0xcd67('0x25')]({'ItemTypeId':_0x31debe,'description':_0xec9c0d,'OrderBy':_0x5ad3cd},{'where':{'CmContactId':_0x40bb40,'item':_0x8c0376}})['then'](function(_0x3755d2){_0x433473({'res':_0xcd67('0x26')});});}else{return db[_0xcd67('0x24')][_0xcd67('0x27')]({'CmContactId':_0x40bb40,'item':_0x8c0376,'description':_0xec9c0d,'ItemTypeId':_0x31debe,'OrderBy':_0x5ad3cd,'ItemClass':_0xcd67('0x28')})['then'](function(_0x39fd00){_0x433473({'res':_0xcd67('0x29')});});}});});}function insertCmHopper(_0x2a04dc,_0x3b86af,_0x110df8,_0x22c03e,_0x16df27){var _0xf3413e=['cm_contacts.phone',_0xcd67('0x2a'),_0xcd67('0x2b'),'cm_contacts.ListId',_0x3b86af+'.'+_0x22c03e,_0xcd67('0x2c'),_0xcd67('0x2d'),_0xcd67('0x2e'),'cm_contacts.UserId','\x22'+_0x16df27+'\x22'];return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')](_0xcd67('0x31'))[_0xcd67('0x32')]([_0xcd67('0x13'),_0xcd67('0x33'),_0xcd67('0x34'),_0xcd67('0x35'),_0x22c03e,_0xcd67('0x36'),_0xcd67('0x37'),_0xcd67('0x38'),_0xcd67('0x39'),_0xcd67('0x3a')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0xf3413e)[_0xcd67('0x14')](_0x3b86af)[_0xcd67('0x19')](_0xcd67('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x3b86af+_0xcd67('0x3e'))['join'](_0x110df8,null,_0x110df8+'.id\x20=\x20'+_0x3b86af+'.'+_0x22c03e)[_0xcd67('0x17')](_0x3b86af+_0xcd67('0x3f'),_0x2a04dc)[_0xcd67('0x17')](_0xcd67('0x40'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b86af,_0x110df8,_0x22c03e,_0xcd67('0x31'),[_0xcd67('0x41'),_0xcd67('0x42')]))[_0xcd67('0x17')](_0xcd67('0x43'),selectNotIn(_0x3b86af,_0x110df8,_0x22c03e,_0xcd67('0x31'),[_0xcd67('0x41')])))[_0xcd67('0x44')]();}function insertCmHopperBlack(_0x9fefbd,_0x5b9bf3,_0x43996f,_0x3356b7){var _0x489d83=['cm_contacts.phone',_0xcd67('0x2b'),_0xcd67('0x45'),_0x5b9bf3+'.'+_0x3356b7,_0xcd67('0x2c'),_0xcd67('0x2d')];return squel[_0xcd67('0x2f')]()['into'](_0xcd67('0x46'))[_0xcd67('0x32')](['phone',_0xcd67('0x34'),_0xcd67('0x35'),_0x3356b7,_0xcd67('0x36'),_0xcd67('0x37')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0x489d83)[_0xcd67('0x14')](_0x5b9bf3)[_0xcd67('0x19')]('cm_contacts',null,_0xcd67('0x47')+_0x5b9bf3+'.CmListId')[_0xcd67('0x19')](_0x43996f,null,_0x43996f+_0xcd67('0x15')+_0x5b9bf3+'.'+_0x3356b7)[_0xcd67('0x17')](_0x5b9bf3+'.CmListId\x20=\x20?',_0x9fefbd)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcd67('0x17')](_0xcd67('0x43'),squel['select']()[_0xcd67('0x12')](_0xcd67('0x13'))[_0xcd67('0x14')](_0xcd67('0x46'))[_0xcd67('0x17')](_0xcd67('0x48'),_0x9fefbd)[_0xcd67('0x17')](_0x3356b7+_0xcd67('0x16')+_0x5b9bf3+'.'+_0x3356b7)))[_0xcd67('0x44')]();}function insertTzCmHopper(_0x359cef,_0x4b89a2,_0x401849,_0x4f2485,_0x53ce85,_0x5832d6){var _0x4cde90=[_0xcd67('0x49'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x5832d6+'.offset-cm_contacts.utcOffset\x20minute)',_0xcd67('0x2b'),_0xcd67('0x45'),_0x4b89a2+'.'+_0x4f2485,_0xcd67('0x2c'),_0xcd67('0x2d'),_0xcd67('0x2e'),_0xcd67('0x4a'),'\x22'+_0x53ce85+'\x22'];var _0x59e6c0=squel[_0xcd67('0x2f')]()['into'](_0xcd67('0x31'))[_0xcd67('0x32')]([_0xcd67('0x13'),_0xcd67('0x33'),_0xcd67('0x34'),'ListId',_0x4f2485,_0xcd67('0x36'),_0xcd67('0x37'),_0xcd67('0x38'),_0xcd67('0x39'),_0xcd67('0x3a')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0x4cde90)[_0xcd67('0x14')](_0x4b89a2)['join'](_0xcd67('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x4b89a2+'.CmListId')['join'](_0x401849,null,_0x401849+'.id\x20=\x20'+_0x4b89a2+'.'+_0x4f2485)[_0xcd67('0x19')](_0x5832d6,null,_0x5832d6+_0xcd67('0x15')+_0x4b89a2+'.'+_0x4f2485)['where'](_0x4b89a2+'.CmListId\x20=\x20?',_0x359cef)[_0xcd67('0x17')](_0xcd67('0x40'),NOW)[_0xcd67('0x17')](_0xcd67('0x43'),selectNotIn(_0x4b89a2,_0x401849,_0x4f2485,_0xcd67('0x31'),[_0xcd67('0x41'),_0xcd67('0x42')]))[_0xcd67('0x17')](_0xcd67('0x43'),selectNotIn(_0x4b89a2,_0x401849,_0x4f2485,_0xcd67('0x31'),['\x22always\x22'])))['toString']();return _0x59e6c0;}function insertTzCmHopperBlack(_0x15c656,_0x30bacf,_0x1926e0,_0x4818e2){var _0x1cff17=[_0xcd67('0x49'),_0xcd67('0x2b'),_0xcd67('0x45'),_0x30bacf+'.'+_0x4818e2,_0xcd67('0x2c'),'cm_contacts.updatedAt'];return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')](_0xcd67('0x46'))['fromQuery']([_0xcd67('0x13'),'ContactId',_0xcd67('0x35'),_0x4818e2,'createdAt',_0xcd67('0x37')],squel['select']()[_0xcd67('0x3c')](_0x1cff17)['from'](_0x30bacf)[_0xcd67('0x19')](_0xcd67('0x3d'),null,_0xcd67('0x47')+_0x30bacf+_0xcd67('0x3e'))[_0xcd67('0x19')](_0x1926e0,null,_0x1926e0+'.id\x20=\x20'+_0x30bacf+'.'+_0x4818e2)[_0xcd67('0x17')](_0x30bacf+'.CmListId\x20=\x20?',_0x15c656)[_0xcd67('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xcd67('0x17')](_0xcd67('0x43'),squel[_0xcd67('0x3b')]()[_0xcd67('0x12')](_0xcd67('0x13'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x15c656)['where'](_0x4818e2+_0xcd67('0x16')+_0x30bacf+'.'+_0x4818e2)))['toString']();}function insertCmHopperAdditionalPhones(_0x5174fb){var _0x308461=[_0xcd67('0x4b'),_0xcd67('0x4c'),_0xcd67('0x4d'),'cm_contact_has_items.createdAt',_0xcd67('0x4e')];return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')](_0xcd67('0x4f'))[_0xcd67('0x32')]([_0xcd67('0x50'),_0xcd67('0x13'),_0xcd67('0x51'),_0xcd67('0x36'),_0xcd67('0x37')],squel[_0xcd67('0x3b')]()[_0xcd67('0x3c')](_0x308461)[_0xcd67('0x14')](_0xcd67('0x31'))[_0xcd67('0x19')](_0xcd67('0x3d'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0xcd67('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xcd67('0x17')]('cm_hopper.ListId\x20=\x20?',_0x5174fb)[_0xcd67('0x17')](_0xcd67('0x40'),NOW))[_0xcd67('0x44')]();}function insertCmContact(_0x310380,_0x58aadb,_0x2356a5,_0x117c2b){var _0x4e0365=_[_0xcd67('0x53')](_[_0xcd67('0x54')](_0x117c2b),[_0xcd67('0x35'),'CompanyId',_0xcd67('0x36'),_0xcd67('0x37'),'scheduledAt']);return squel[_0xcd67('0x2f')]()[_0xcd67('0x30')]('cm_contacts')['fromQuery'](_0x4e0365,squel[_0xcd67('0x3b')]()['fields'](_0x4e0365)[_0xcd67('0x14')](_0x58aadb)[_0xcd67('0x17')]('('+_0x2356a5[_0xcd67('0x19')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xcd67('0x3c')](_0x2356a5)[_0xcd67('0x14')](_0xcd67('0x3d'))['where']('ListId\x20=\x20?',_0x310380)[_0xcd67('0x17')]('deletedAt\x20IS\x20NULL'))[_0xcd67('0x17')](_0xcd67('0x55'),squel[_0xcd67('0x3b')]()['field'](_0xcd67('0x56'),'min_id')['from'](_0x58aadb)[_0xcd67('0x57')](_0x2356a5[_0xcd67('0x19')](','))))[_0xcd67('0x44')]();}function handleStop(){logger[_0xcd67('0x58')](_0xcd67('0x59'));stopped=!![];}function handleUncaughtException(_0x31852f){logger[_0xcd67('0x5a')](_0x31852f[_0xcd67('0x5b')]);process[_0xcd67('0x5c')](0x1);}function handleError(_0x4b3cd2,_0x97365a){stats[_0xcd67('0x5d')][_0xcd67('0x21')]({'name':_0x97365a[_0xcd67('0x5e')],'message':_0x97365a[_0xcd67('0x5b')],'row':_0x4b3cd2});}function handleQuery(_0x388964){logger[_0xcd67('0x58')](_0x388964);return db['sequelize']['query'](_0x388964)[_0xcd67('0x5f')](function(_0x24b17d){results[_0xcd67('0x21')](_0x24b17d);})[_0xcd67('0x60')](function(_0x21cb11){logger[_0xcd67('0x5a')](_0x21cb11[_0xcd67('0x5b')]);});}function updateTzCampaigns(_0x1a1327){return new Promise(function(_0x4f654b,_0x15c41a){var _0x3e18fe=squel[_0xcd67('0x3b')]()['fields']([_0xcd67('0x61'),_0xcd67('0x62')])[_0xcd67('0x14')]('campaigns')[_0xcd67('0x19')]('campaigns_has_cm_lists',null,_0xcd67('0x63'))['where']('campaigns_has_cm_lists.CmListId='+_0x1a1327);db[_0xcd67('0x64')]['query'](_0x3e18fe[_0xcd67('0x44')]())['spread'](function(_0x40f836){var _0x15adf5=[];for(var _0x1540da=0x0;_0x1540da<_0x40f836['length'];_0x1540da++){_0x15adf5[_0xcd67('0x21')](getTimezoneData(_0x40f836[_0x1540da],tmp_campaigns));}BPromise[_0xcd67('0x1f')](_0x15adf5)[_0xcd67('0x1d')](function(){_0x4f654b({'val':0x1});});})[_0xcd67('0x60')](function(_0x910ffa){logger[_0xcd67('0x5a')](_0x910ffa[_0xcd67('0x5b')]);_0x4f654b({'val':0x0});});});}function updateTzVoiceQueues(_0x14b550){return new Promise(function(_0x418fc4,_0x594052){var _0x175329=squel[_0xcd67('0x3b')]()['fields']([_0xcd67('0x65'),_0xcd67('0x66')])[_0xcd67('0x14')](_0xcd67('0x67'))[_0xcd67('0x19')](_0xcd67('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xcd67('0x17')](_0xcd67('0x69')+_0x14b550);db[_0xcd67('0x64')][_0xcd67('0x6a')](_0x175329['toString']())[_0xcd67('0x5f')](function(_0x4b3477){var _0x4f21de=[];for(var _0x537d87=0x0;_0x537d87<_0x4b3477[_0xcd67('0x1e')];_0x537d87++){_0x4f21de[_0xcd67('0x21')](getTimezoneData(_0x4b3477[_0x537d87],tmp_voice_queues));}BPromise['all'](_0x4f21de)[_0xcd67('0x1d')](function(){_0x418fc4({'val':0x1});});})[_0xcd67('0x60')](function(_0x2afbed){logger['error'](_0x2afbed[_0xcd67('0x5b')]);_0x418fc4({'val':0x0});});});}function getTimezoneData(_0x150d85,_0x5b37e9){return new Promise(function(_0x21e5dc,_0x3f6a2f){var _0x1b458b=shared['timezones'];var _0x2410b3=_0x1b458b[_0x150d85[_0xcd67('0x6b')]];if(_[_0xcd67('0x22')](_0x2410b3)){_0x21e5dc({'ret':0x1});}else{var _0x2c17d1=_0x2410b3['utcOffset'];var _0x347f74=squel['insert']()['into'](_0x5b37e9)[_0xcd67('0x6c')]('id',_0x150d85['id'])[_0xcd67('0x6c')](_0xcd67('0x6d'),_0x2c17d1)[_0xcd67('0x6c')](_0xcd67('0x6b'),_0x150d85[_0xcd67('0x6b')])[_0xcd67('0x44')]();return db[_0xcd67('0x64')]['query'](_0x347f74)[_0xcd67('0x5f')](function(_0x58bc1a){_0x21e5dc({'ret':0x1});})['catch'](function(_0x3f8601){logger[_0xcd67('0x5a')](_0x3f8601['message']);_0x3f6a2f({'ret':0x1});});}});}function handleTZQuery(_0x15339f){logger[_0xcd67('0x58')](_0x15339f);return db[_0xcd67('0x64')][_0xcd67('0x6a')](_0x15339f)[_0xcd67('0x5f')](function(_0x4b9961){})[_0xcd67('0x60')](function(_0x485820){logger[_0xcd67('0x5a')](_0x485820[_0xcd67('0x5b')]);});}function main(_0x5d04ac,_0x50b454,_0x2b05e7,_0x4b5155){logger[_0xcd67('0x58')](_0xcd67('0x6e'),_0x5d04ac,JSON[_0xcd67('0x6f')](_0x50b454));process['send'](_0xcd67('0x70'));var _0x26015f=_0x50b454['binding'];var _0x473ba9=_[_0xcd67('0x71')](_0x26015f);var _0x21ecd6=_0x50b454[_0xcd67('0x72')];var _0x3c3080=path[_0xcd67('0x19')](config[_0xcd67('0x73')],_0xcd67('0x74'),_0x21ecd6+'.csv');hasTZ=_[_0xcd67('0x54')](_0x26015f)[_0xcd67('0x75')](_0xcd67('0x6b'));var _0x2b3596=_[_0xcd67('0x54')](_0x26015f)[_0xcd67('0x19')]();logger[_0xcd67('0x58')](_0xcd67('0x76'),_0x2b3596);db[_0xcd67('0x77')][_0xcd67('0x1b')]({'raw':!![],'attributes':['id',_0xcd67('0x78')]})[_0xcd67('0x1d')](function(_0x500041){for(var _0x305c3e=0x0;_0x305c3e<_0x500041[_0xcd67('0x1e')];_0x305c3e++){if(_0x500041[_0x305c3e][_0xcd67('0x78')]in _0x26015f){contactItemTypes[_0xcd67('0x21')](_0x500041[_0x305c3e]);delete _0x473ba9[_0x500041[_0x305c3e][_0xcd67('0x78')]];hasAdditionalPhones=!![];}for(var _0x96469f in _0x26015f){if(_0x500041[_0x305c3e][_0xcd67('0x78')]+_0xcd67('0x79')===_0x96469f){phoneDescriptions[_0xcd67('0x21')]({'itemTypeId':_0x500041[_0x305c3e]['id'],'description':_0x96469f});delete _0x473ba9[_0x96469f];}}}if(hasAdditionalPhones)_0x473ba9[_0xcd67('0x1c')]='';var _0x367978=_[_0xcd67('0x54')](_0x473ba9)['join']();logger['info'](_0xcd67('0x76'),_0x367978);fs[_0xcd67('0x7a')](_0x3c3080,_0x367978+'\x0a');Papa[_0xcd67('0x7b')](fs[_0xcd67('0x7c')](_0x5d04ac),{'header':!![],'skipEmptyLines':!![],'step':function(_0x9e0fb1,_0x452739){try{for(var _0x4b5a74=0x0,_0x3c864f=[];_0x4b5a74<_0x9e0fb1[_0xcd67('0x7d')][_0xcd67('0x1e')];_0x4b5a74++){stats['rows']+=0x1;if(_0x9e0fb1['errors'][_0x4b5a74]){handleError(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74],_0x9e0fb1[_0xcd67('0x5d')][_0x4b5a74]);}else{var _0x3393f5=[];var _0x597e52=[];var _0x586a31={};for(var _0x2d0ead in _0x26015f){let _0x593d5c=contactItemTypes[_0xcd67('0x7e')](_0x21349f=>_0x21349f[_0xcd67('0x78')]===_0x2d0ead);let _0xe12422=contactItemTypes[_0xcd67('0x7e')](_0x4c8f7a=>_0x4c8f7a[_0xcd67('0x78')]+_0xcd67('0x79')===_0x2d0ead);if(_[_0xcd67('0x22')](_0x593d5c)&&_[_0xcd67('0x22')](_0xe12422)){if(_0x26015f[_0xcd67('0x7f')](_0x2d0ead)){if(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]]){var _0x179065=_[_0xcd67('0x80')](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]]['replace'](/"/g,'\x27'));switch(_0x2d0ead){case'scheduledat':var _0x4bb46d=moment(_0x179065,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4bb46d['isValid']()){_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}else{_0x3393f5[_0xcd67('0x21')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xcd67('0x38'):var _0x253ba8=parseInt(_0x179065);_0x179065=_[_0xcd67('0x81')](_0x253ba8)||_0x253ba8<0x0||_0x253ba8>0x4?_0x4b5155?0x3:0x2:_0x253ba8;_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');break;case _0xcd67('0x39'):var _0x2e0afb=parseInt(_0x179065);if(_[_0xcd67('0x82')](_0x2e0afb)&&_[_0xcd67('0x75')](_0x2b05e7,_0x2e0afb)){_0x3c864f['push']('\x22'+_0x2e0afb+'\x22');}else{_0x3393f5[_0xcd67('0x21')]('agent\x20not\x20exists');}break;case _0xcd67('0x83'):if(isEmail(_0x179065)){_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}else{_0x3393f5[_0xcd67('0x21')](_0xcd67('0x84'));}break;case _0xcd67('0x85'):var _0x3dc3dd=moment(_0x179065,_0xcd67('0x86'),!![]);if(_0x3dc3dd['isValid']()){_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}else{_0x3393f5[_0xcd67('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xcd67('0x6b'):var _0x3d61ec=shared['timezones'];var _0x4a0dfe=_0x3d61ec[_0x179065];if(!_[_0xcd67('0x22')](_0x4a0dfe)){var _0x3aa603=_0x4a0dfe[_0xcd67('0x87')];_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');_0x3c864f[_0xcd67('0x21')]('\x22'+_0x3aa603+'\x22');}break;default:_0x3c864f[_0xcd67('0x21')]('\x22'+_0x179065+'\x22');}}else{switch(_0x2d0ead){case _0xcd67('0x88'):case'phone':_0x3393f5[_0xcd67('0x21')](_0x2d0ead+'\x20not\x20specified');break;default:_0x3c864f[_0xcd67('0x21')]('\x22\x22');}}}}else{var _0x1235c7='';if(!_[_0xcd67('0x22')](_0x593d5c)){if(!_0x586a31[_0xcd67('0x7f')](_0x593d5c['id'])){if(!_[_0xcd67('0x22')](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]])){var _0x179065=_[_0xcd67('0x80')](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0x2d0ead]]['replace'](/"/g,'\x27'));var _0xd000fe=phoneDescriptions[_0xcd67('0x7e')](_0x31042e=>_0x31042e[_0xcd67('0x89')]===_0x593d5c['id']);if(!_['isNil'](_0xd000fe)){var _0x5edf3c=_['trim'](_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74][_0x26015f[_0xd000fe[_0xcd67('0x8a')]]]['replace'](/"/g,'\x27'));if(!_[_0xcd67('0x22')](_0x5edf3c))_0x179065=_0x179065+'§'+_0x5edf3c;}if(_0x1235c7=='')_0x1235c7=_0x179065;else _0x1235c7+='|'+_0x179065;}_0x597e52[_0xcd67('0x21')](_0x593d5c['id']+':'+_0x1235c7);_0x586a31[_0x593d5c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3c864f['push']('\x22'+_0x597e52['join'](';')+'\x22');}if(_0x3393f5[_0xcd67('0x1e')]){handleError(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74],{'code':_0xcd67('0x8b'),'message':_0x3393f5[_0xcd67('0x19')]()});}else{fs[_0xcd67('0x8c')](_0x3c3080,_0x3c864f[_0xcd67('0x19')]()+'\x0a');}_0x3c864f=[];}if(!(stats[_0xcd67('0x8d')]%0xc8)){socket[_0xcd67('0x8e')](_0xcd67('0x8f')+_0x21ecd6,stats);stats[_0xcd67('0x5d')]=[];}}if(stopped){logger[_0xcd67('0x58')](_0xcd67('0x90'));_0x452739[_0xcd67('0x91')]();}}catch(_0x2bd0fe){handleError(_0x9e0fb1[_0xcd67('0x7d')][_0x4b5a74],{'code':'SystemError','message':_0x2bd0fe[_0xcd67('0x5b')]});logger[_0xcd67('0x5a')](_0xcd67('0x92'),_0x2bd0fe[_0xcd67('0x5b')]);}},'complete':function(){try{var _0x42ef63=[];var _0x3e35ab=[];var _0x4b9452=_0xcd67('0x3d');if(_0x50b454[_0xcd67('0x93')]&&_0x50b454[_0xcd67('0x93')][_0xcd67('0x1e')]){_0x4b9452=_0xcd67('0x94')+_0x21ecd6;_0x42ef63['push'](_0xcd67('0x95')+_0x4b9452+_0xcd67('0x96'));}tmp_campaigns='campaigns_'+_0x21ecd6;tmp_voice_queues=_0xcd67('0x97')+_0x21ecd6;_0x3e35ab[_0xcd67('0x21')](_0xcd67('0x95')+tmp_campaigns+_0xcd67('0x98'));_0x3e35ab[_0xcd67('0x21')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xcd67('0x98'));BPromise[_0xcd67('0x99')](_0x3e35ab,handleTZQuery)['then'](function(_0x5deff3){updateTzCampaigns(_0x50b454['ListId'])[_0xcd67('0x1d')](function(_0x11ac12){updateTzVoiceQueues(_0x50b454[_0xcd67('0x35')])['then'](function(_0x554619){if(hasTZ)_0x367978=_0x367978[_0xcd67('0x9a')](_0xcd67('0x6b'),_0xcd67('0x9b'));var _0x4ad015=util['format'](_0xcd67('0x9c'),_0x3c3080,_0x4b9452,_0x367978,_0x50b454[_0xcd67('0x35')],_0x50b454[_0xcd67('0x9d')]||null,NOW,NOW);if(_[_0xcd67('0x22')](_0x26015f[_0xcd67('0x33')])){_0x4ad015+=_0xcd67('0x9e');}_0x42ef63[_0xcd67('0x21')](_0x4ad015);if(_0x50b454['duplicates']&&_0x50b454[_0xcd67('0x93')][_0xcd67('0x1e')]){_0x42ef63[_0xcd67('0x21')](insertCmContact(_0x50b454[_0xcd67('0x35')],_0x4b9452,_0x50b454['duplicates'],_0x26015f));_0x42ef63[_0xcd67('0x21')](_0xcd67('0x9f')+_0x4b9452+';');}BPromise[_0xcd67('0x99')](_0x42ef63,handleQuery)[_0xcd67('0x1d')](function(_0xefc358){BPromise[_0xcd67('0x1f')]([handleAdditionalPhones()])['then'](function(){_0x42ef63=[];for(var _0x3a7b82=0x0;_0x3a7b82\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','papaparse','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','sequelize','select\x20*\x20from\x20','isNil','AdditionalPhones','push','all','then','catch','error','length','split','filter','CmContactHasItem','findOne','update','updated','create','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0xb7e2,0x103));var _0x2b7e=function(_0x1bd9f3,_0x2745f8){_0x1bd9f3=_0x1bd9f3-0x0;var _0x5e2d66=_0xb7e2[_0x1bd9f3];return _0x5e2d66;};'use strict';var fs=require('fs');var path=require(_0x2b7e('0x0'));var _=require('lodash');var Papa=require(_0x2b7e('0x1'));var util=require('util');var BPromise=require(_0x2b7e('0x2'));var moment=require('moment');var squel=require(_0x2b7e('0x3'));var Redis=require('ioredis');var db=require(_0x2b7e('0x4'))['db'];var config=require(_0x2b7e('0x5'));var logger=require(_0x2b7e('0x6'))(_0x2b7e('0x7'));config[_0x2b7e('0x8')]=_[_0x2b7e('0x9')](config['redis'],{'host':_0x2b7e('0xa'),'port':0x18eb});var socket=require(_0x2b7e('0xb'))(new Redis(config[_0x2b7e('0x8')]));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()['format'](_0x2b7e('0xc'));var tempTableName=_0x2b7e('0xd')+moment()[_0x2b7e('0xe')](_0x2b7e('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3487c2){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'](_0x3487c2);}function selectNotIn(_0x48ed94,_0x1f08a3,_0x2ca5dd,_0x5e4eb4,_0x27d998){return squel[_0x2b7e('0x10')]()[_0x2b7e('0x11')](_0x2b7e('0x12'))['from'](_0x5e4eb4)[_0x2b7e('0x13')](_0x1f08a3,null,_0x1f08a3+_0x2b7e('0x14')+_0x5e4eb4+'.'+_0x2ca5dd)[_0x2b7e('0x15')](_0x5e4eb4+'.'+_0x2ca5dd+_0x2b7e('0x16')+_0x48ed94+'.'+_0x2ca5dd)['where'](_0x1f08a3+'.dialCheckDuplicateType\x20IN\x20('+_0x27d998['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x824b79,_0x5cfeca){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2b7e('0x17')]['query'](_0x2b7e('0x18')+tempTableName)['spread'](function(_0x181aec){if(_0x181aec!==null){var _0x2bd651=[];for(var _0x3f9007=0x0;_0x3f9007<_0x181aec['length'];_0x3f9007++){var _0x3d5abe=_0x181aec[_0x3f9007];if(!_[_0x2b7e('0x19')](_0x3d5abe['phone'])){if(!_[_0x2b7e('0x19')](_0x3d5abe[_0x2b7e('0x1a')]))_0x2bd651[_0x2b7e('0x1b')](insertAdditionalPhones(_0x3d5abe));promisesContact['push']({'contact':_0x3d5abe});}}}Promise[_0x2b7e('0x1c')](_0x2bd651)[_0x2b7e('0x1d')](function(){_0x824b79({'val':0x1});});})[_0x2b7e('0x1e')](function(_0x2e3e6c){logger[_0x2b7e('0x1f')](_0x2e3e6c['message']);});});}function insertAdditionalPhones(_0x3a1356){return new Promise(function(_0x4922b3,_0x522810){var _0x41c39b=_0x3a1356['AdditionalPhones'];if(_[_0x2b7e('0x19')](_0x41c39b))_0x522810({'val':0x0});else{var _0x3f2f1c=_0x41c39b['split'](';');var _0x416aba=[];orderBy=0x0;for(var _0x5988eb=0x0;_0x5988eb<_0x3f2f1c[_0x2b7e('0x20')];_0x5988eb++){_0x416aba[_0x2b7e('0x1b')](splitAdditionalPhone(_0x3a1356['id'],_0x3f2f1c[_0x5988eb]));}Promise['all'](_0x416aba)['then'](function(){_0x4922b3({'val':_0x3f2f1c[_0x2b7e('0x20')]});});}});}function splitAdditionalPhone(_0x151e97,_0x2b2863){return new Promise(function(_0x6da48a,_0x16f836){var _0x17b0f8=_0x2b2863[_0x2b7e('0x21')](':');var _0x11b76b=_0x17b0f8[0x0];var _0x43e0bd=_0x17b0f8[0x1];if(_0x43e0bd!==''){var _0x2cb021=_0x43e0bd[_0x2b7e('0x21')]('|');var _0x1d88e8=[];for(var _0x19824e=0x0;_0x19824e<_0x2cb021[_0x2b7e('0x20')];_0x19824e++){if(_0x2cb021[_0x19824e]!==''){var _0x4f1ec8=_[_0x2b7e('0x22')](promisesAdditionalPhones,{'contactId':_0x151e97,'phone':_0x2cb021[_0x19824e]});if(_0x4f1ec8[_0x2b7e('0x20')]==0x0){orderBy++;promisesAdditionalPhones[_0x2b7e('0x1b')]({'contactId':_0x151e97,'contactTypeId':_0x11b76b,'phone':_0x2cb021[_0x19824e],'orderBy':orderBy});}}}_0x6da48a({'ok':0x1});}else _0x6da48a({'res':0x0});});}function createAdditionalPhone(_0x2c68ac,_0x2c2093,_0x5d568b,_0x2e4f7f){var _0x11cfd8='';var _0x5871ac='';var _0x190438=_0x5d568b['split']('§');_0x11cfd8=_0x190438[0x0];if(_0x190438[_0x2b7e('0x20')]==0x2)_0x5871ac=_0x190438[0x1];return new Promise(function(_0x585e25,_0x958f43){return db[_0x2b7e('0x23')][_0x2b7e('0x24')]({'where':{'CmContactId':_0x2c68ac,'item':_0x11cfd8}})[_0x2b7e('0x1d')](function(_0x54adce){if(_0x54adce){return db[_0x2b7e('0x23')][_0x2b7e('0x25')]({'ItemTypeId':_0x2c2093,'description':_0x5871ac,'OrderBy':_0x2e4f7f},{'where':{'CmContactId':_0x2c68ac,'item':_0x11cfd8}})[_0x2b7e('0x1d')](function(_0x1c9ba5){_0x585e25({'res':_0x2b7e('0x26')});});}else{return db[_0x2b7e('0x23')][_0x2b7e('0x27')]({'CmContactId':_0x2c68ac,'item':_0x11cfd8,'ItemTypeId':_0x2c2093,'description':_0x5871ac,'OrderBy':_0x2e4f7f,'ItemClass':'PHONE'})[_0x2b7e('0x1d')](function(_0x105781){_0x585e25({'res':_0x2b7e('0x28')});});}});});}function updateContact(_0x575b37){return new Promise(function(_0x50c994,_0x243446){var _0x2da355=_0x575b37['id'];delete _0x575b37['id'];return db[_0x2b7e('0x29')][_0x2b7e('0x25')](_0x575b37,{'where':{'id':_0x2da355}})[_0x2b7e('0x1d')](function(_0x1ce9d4){updatedRows+=0x1;return db[_0x2b7e('0x2a')]['update']({'phone':_0x575b37[_0x2b7e('0x12')]},{'where':{'ContactId':_0x2da355}})[_0x2b7e('0x1d')](function(_0x18e42c){_0x50c994({'ret':'OK'});});});});}function insertCmHopper(_0xd97f2a,_0xdc8726,_0x55afa9,_0x26a9f4,_0x4f1574){var _0x5cc014=[_0x2b7e('0x2b'),'cm_contacts.scheduledat',_0x2b7e('0x2c'),'cm_contacts.ListId',_0xdc8726+'.'+_0x26a9f4,_0x2b7e('0x2d'),'cm_contacts.updatedAt',_0x2b7e('0x2e'),_0x2b7e('0x2f'),'\x22'+_0x4f1574+'\x22'];return squel[_0x2b7e('0x30')]()['into'](_0x2b7e('0x31'))[_0x2b7e('0x32')]([_0x2b7e('0x12'),'scheduledat','ContactId','ListId',_0x26a9f4,_0x2b7e('0x33'),'updatedAt',_0x2b7e('0x34'),_0x2b7e('0x35'),_0x2b7e('0x36')],squel['select']()[_0x2b7e('0x37')](_0x5cc014)[_0x2b7e('0x38')](_0xdc8726)[_0x2b7e('0x13')](_0x2b7e('0x39'),null,_0x2b7e('0x3a')+_0xdc8726+'.CmListId')['join'](_0x55afa9,null,_0x55afa9+_0x2b7e('0x14')+_0xdc8726+'.'+_0x26a9f4)['where'](_0xdc8726+'.CmListId\x20=\x20?',_0xd97f2a)[_0x2b7e('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2b7e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xdc8726,_0x55afa9,_0x26a9f4,_0x2b7e('0x31'),['\x22always\x22',_0x2b7e('0x3b')]))[_0x2b7e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xdc8726,_0x55afa9,_0x26a9f4,_0x2b7e('0x31'),[_0x2b7e('0x3c')])))['toString']();}function insertCmHopperBlack(_0xea0e5b,_0x4efe72,_0x2758ce,_0x383d7f){var _0x4cbaef=[_0x2b7e('0x2b'),_0x2b7e('0x2c'),'cm_contacts.ListId',_0x4efe72+'.'+_0x383d7f,_0x2b7e('0x2d'),_0x2b7e('0x3d')];return squel['insert']()[_0x2b7e('0x3e')](_0x2b7e('0x3f'))[_0x2b7e('0x32')]([_0x2b7e('0x12'),_0x2b7e('0x40'),_0x2b7e('0x41'),_0x383d7f,'createdAt',_0x2b7e('0x42')],squel[_0x2b7e('0x10')]()[_0x2b7e('0x37')](_0x4cbaef)[_0x2b7e('0x38')](_0x4efe72)['join'](_0x2b7e('0x39'),null,_0x2b7e('0x3a')+_0x4efe72+_0x2b7e('0x43'))['join'](_0x2758ce,null,_0x2758ce+_0x2b7e('0x14')+_0x4efe72+'.'+_0x383d7f)['where'](_0x4efe72+_0x2b7e('0x44'),_0xea0e5b)[_0x2b7e('0x15')](_0x2b7e('0x45'),NOW)[_0x2b7e('0x15')](_0x2b7e('0x46'),squel[_0x2b7e('0x10')]()[_0x2b7e('0x11')](_0x2b7e('0x12'))['from'](_0x2b7e('0x3f'))[_0x2b7e('0x15')](_0x2b7e('0x47'),_0xea0e5b)[_0x2b7e('0x15')](_0x383d7f+_0x2b7e('0x48'),_0x4efe72+'.'+_0x383d7f)))[_0x2b7e('0x49')]();}function insertCmHopperAdditionalPhones(_0xa405f9){var _0x42dd10=[_0x2b7e('0x4a'),_0x2b7e('0x4b'),_0x2b7e('0x4c'),_0x2b7e('0x4d'),_0x2b7e('0x4e')];return squel[_0x2b7e('0x30')]()[_0x2b7e('0x3e')](_0x2b7e('0x4f'))['fromQuery'](['CmHopperId',_0x2b7e('0x12'),_0x2b7e('0x50'),_0x2b7e('0x33'),_0x2b7e('0x42')],squel['select']()[_0x2b7e('0x37')](_0x42dd10)[_0x2b7e('0x38')]('cm_hopper')[_0x2b7e('0x13')](_0x2b7e('0x39'),null,_0x2b7e('0x51'))[_0x2b7e('0x13')](_0x2b7e('0x52'),null,_0x2b7e('0x53'))['where'](_0x2b7e('0x54'),_0xa405f9)[_0x2b7e('0x15')](_0x2b7e('0x45'),NOW))[_0x2b7e('0x49')]();}function insertCmContact(_0x2c9ca8,_0x4c34ae,_0x480454,_0x5d84b6){var _0x194fc6=_[_0x2b7e('0x55')](_[_0x2b7e('0x56')](_0x5d84b6),[_0x2b7e('0x41'),'CompanyId','createdAt',_0x2b7e('0x42')]);return squel['insert']()[_0x2b7e('0x3e')](_0x2b7e('0x39'))[_0x2b7e('0x32')](_0x194fc6,squel[_0x2b7e('0x10')]()[_0x2b7e('0x37')](_0x194fc6)[_0x2b7e('0x38')](_0x4c34ae)[_0x2b7e('0x15')]('('+_0x480454[_0x2b7e('0x13')](',')+_0x2b7e('0x57'),squel[_0x2b7e('0x10')]()[_0x2b7e('0x37')](_0x480454)[_0x2b7e('0x38')]('cm_contacts')['where'](_0x2b7e('0x47'),_0x2c9ca8))[_0x2b7e('0x15')]('id\x20IN\x20?',squel[_0x2b7e('0x10')]()[_0x2b7e('0x11')](_0x2b7e('0x58'),_0x2b7e('0x59'))[_0x2b7e('0x38')](_0x4c34ae)[_0x2b7e('0x5a')](_0x480454[_0x2b7e('0x13')](','))))[_0x2b7e('0x49')]();}function handleStop(){logger[_0x2b7e('0x5b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x46bf1b){logger[_0x2b7e('0x1f')](_0x46bf1b[_0x2b7e('0x5c')]);process[_0x2b7e('0x5d')](0x1);}function handleError(_0x3b71c9,_0x2cb8a3){stats[_0x2b7e('0x5e')][_0x2b7e('0x1b')]({'name':_0x2cb8a3[_0x2b7e('0x5f')],'message':_0x2cb8a3[_0x2b7e('0x5c')],'row':_0x3b71c9});}function handleQuery(_0x368cb3){logger['info'](_0x368cb3);return db['sequelize'][_0x2b7e('0x60')](_0x368cb3)['spread'](function(_0x21cd0a){results[_0x2b7e('0x1b')](_0x21cd0a);})[_0x2b7e('0x1e')](function(_0x51110a){logger[_0x2b7e('0x1f')](_0x51110a['message']);});}function main(_0x522be8,_0xee30f5,_0xd95de0,_0x4424db){logger[_0x2b7e('0x5b')]('main',_0x522be8,JSON['stringify'](_0xee30f5));process[_0x2b7e('0x61')](_0x2b7e('0x62'));var _0x1574c2=_0xee30f5[_0x2b7e('0x63')];var _0x4e33bb=_['clone'](_0x1574c2);var _0x8f0f70=_0xee30f5['socket_timestamp'];var _0x4cef95=path[_0x2b7e('0x13')](config[_0x2b7e('0x64')],_0x2b7e('0x65'),_0x8f0f70+'.csv');logger[_0x2b7e('0x5b')](_0x2b7e('0x66'),_0xee30f5);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x2b7e('0x67')]})[_0x2b7e('0x1d')](function(_0x39f81b){for(var _0x185247=0x0;_0x185247<_0x39f81b['length'];_0x185247++){if(_0x39f81b[_0x185247]['name']in _0x1574c2){contactItemTypes[_0x2b7e('0x1b')](_0x39f81b[_0x185247]);delete _0x4e33bb[_0x39f81b[_0x185247][_0x2b7e('0x67')]];hasAdditionalPhones=!![];}for(var _0x482e6f in _0x1574c2){if(_0x39f81b[_0x185247][_0x2b7e('0x67')]+'_description'===_0x482e6f){phoneDescriptions[_0x2b7e('0x1b')]({'itemTypeId':_0x39f81b[_0x185247]['id'],'description':_0x482e6f});delete _0x4e33bb[_0x482e6f];}}}if(hasAdditionalPhones)_0x4e33bb[_0x2b7e('0x1a')]='';var _0xebf07a=_['keys'](_0x4e33bb)['join']();logger[_0x2b7e('0x5b')](_0x2b7e('0x68'),_0xebf07a);fs['writeFileSync'](_0x4cef95,_0xebf07a+'\x0a');Papa['parse'](fs[_0x2b7e('0x69')](_0x522be8),{'header':!![],'skipEmptyLines':!![],'step':function(_0xbfe3e6,_0x2175a2){try{for(var _0x49e0a6=0x0,_0xfc9ee=[];_0x49e0a6<_0xbfe3e6[_0x2b7e('0x6a')][_0x2b7e('0x20')];_0x49e0a6++){stats[_0x2b7e('0x6b')]+=0x1;if(_0xbfe3e6['errors'][_0x49e0a6]){handleError(_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6],_0xbfe3e6[_0x2b7e('0x5e')][_0x49e0a6]);}else{var _0x5d50eb=[];var _0x371eab=[];var _0x2bd640={};for(var _0x1706fc in _0x1574c2){let _0x29f449=contactItemTypes['find'](_0xd3b8=>_0xd3b8[_0x2b7e('0x67')]===_0x1706fc);let _0x562e17=contactItemTypes[_0x2b7e('0x6c')](_0x5338e2=>_0x5338e2['name']+_0x2b7e('0x6d')===_0x1706fc);if(_[_0x2b7e('0x19')](_0x29f449)&&_[_0x2b7e('0x19')](_0x562e17)){if(_0x1574c2[_0x2b7e('0x6e')](_0x1706fc)){if(_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6][_0x1574c2[_0x1706fc]]){var _0x24463e=_['trim'](_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6][_0x1574c2[_0x1706fc]]['replace'](/"/g,'\x27'));switch(_0x1706fc){case _0x2b7e('0x6f'):var _0x4fac64=moment(_0x24463e,_0x2b7e('0xc'),!![]);if(_0x4fac64['isValid']()){_0xfc9ee[_0x2b7e('0x1b')]('\x22'+_0x24463e+'\x22');}else{_0x5d50eb[_0x2b7e('0x1b')](_0x2b7e('0x70'));}break;case _0x2b7e('0x34'):var _0x3c5bb9=parseInt(_0x24463e);_0x24463e=_[_0x2b7e('0x71')](_0x3c5bb9)||_0x3c5bb9<0x0||_0x3c5bb9>0x4?_0x4424db?0x3:0x2:_0x3c5bb9;_0xfc9ee[_0x2b7e('0x1b')]('\x22'+_0x24463e+'\x22');break;case _0x2b7e('0x35'):var _0x5537f0=parseInt(_0x24463e);if(_[_0x2b7e('0x72')](_0x5537f0)&&_[_0x2b7e('0x73')](_0xd95de0,_0x5537f0)){_0xfc9ee['push']('\x22'+_0x5537f0+'\x22');}else{_0x5d50eb[_0x2b7e('0x1b')](_0x2b7e('0x74'));}break;case _0x2b7e('0x75'):if(isEmail(_0x24463e)){_0xfc9ee[_0x2b7e('0x1b')]('\x22'+_0x24463e+'\x22');}else{_0x5d50eb[_0x2b7e('0x1b')](_0x2b7e('0x76'));}break;case'dateOfBirth':var _0x49e52f=moment(_0x24463e,'YYYY-MM-DD',!![]);if(_0x49e52f[_0x2b7e('0x77')]()){_0xfc9ee[_0x2b7e('0x1b')]('\x22'+_0x24463e+'\x22');}else{_0x5d50eb[_0x2b7e('0x1b')](_0x2b7e('0x78'));}break;default:_0xfc9ee[_0x2b7e('0x1b')]('\x22'+_0x24463e+'\x22');}}else{switch(_0x1706fc){case _0x2b7e('0x79'):case _0x2b7e('0x12'):_0x5d50eb[_0x2b7e('0x1b')](_0x1706fc+_0x2b7e('0x7a'));break;default:_0xfc9ee[_0x2b7e('0x1b')]('\x22\x22');}}}}else{var _0x113db9='';if(!_[_0x2b7e('0x19')](_0x29f449)){if(!_0x2bd640[_0x2b7e('0x6e')](_0x29f449['id'])){for(var _0x2ada7e=0x0;_0x2ada7e<_0x1574c2[_0x1706fc][_0x2b7e('0x20')];_0x2ada7e++){var _0x24463e=_['trim'](_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6][_0x1574c2[_0x1706fc][_0x2ada7e]]['replace'](/"/g,'\x27'));var _0x38c597=phoneDescriptions[_0x2b7e('0x6c')](_0x29298c=>_0x29298c[_0x2b7e('0x7b')]===_0x29f449['id']);if(!_[_0x2b7e('0x19')](_0x38c597)){var _0x53f1ab=_[_0x2b7e('0x7c')](_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6][_0x1574c2[_0x38c597[_0x2b7e('0x7d')]][0x0]][_0x2b7e('0x7e')](/"/g,'\x27'));if(!_[_0x2b7e('0x19')](_0x53f1ab))_0x24463e=_0x24463e+'§'+_0x53f1ab;}if(_0x113db9=='')_0x113db9=_0x24463e;else _0x113db9+='|'+_0x24463e;}_0x371eab[_0x2b7e('0x1b')](_0x29f449['id']+':'+_0x113db9);_0x2bd640[_0x29f449['id']]=0x1;}}}}if(hasAdditionalPhones){_0xfc9ee['push']('\x22'+_0x371eab['join'](';')+'\x22');}if(_0x5d50eb[_0x2b7e('0x20')]){handleError(_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6],{'code':_0x2b7e('0x7f'),'message':_0x5d50eb[_0x2b7e('0x13')]()});}else{fs[_0x2b7e('0x80')](_0x4cef95,_0xfc9ee['join']()+'\x0a');}_0xfc9ee=[];}if(!(stats[_0x2b7e('0x6b')]%0xc8)){socket[_0x2b7e('0x81')](_0x2b7e('0x82')+_0x8f0f70,stats);stats['errors']=[];}}if(stopped){logger[_0x2b7e('0x5b')](_0x2b7e('0x83'));_0x2175a2['abort']();}}catch(_0x5012b1){handleError(_0xbfe3e6[_0x2b7e('0x6a')][_0x49e0a6],{'code':'SystemError','message':_0x5012b1[_0x2b7e('0x5c')]});logger[_0x2b7e('0x1f')](_0x2b7e('0x84'),_0x5012b1[_0x2b7e('0x5c')]);}},'complete':function(){try{var _0x47854b=[];var _0x1f1ce4=tempTableName;_0x47854b['push'](_0x2b7e('0x85')+_0x1f1ce4+'\x20LIKE\x20cm_contacts;');logger[_0x2b7e('0x5b')](_0x2b7e('0x86'),contactItemTypes['length']);var _0x177604=util[_0x2b7e('0xe')](_0x2b7e('0x87'),_0x4cef95,_0x1f1ce4,_0xebf07a,_0xee30f5[_0x2b7e('0x41')],_0xee30f5[_0x2b7e('0x88')]||null,NOW,NOW);if(_[_0x2b7e('0x19')](_0x1574c2['scheduledat'])){_0x177604+=_0x2b7e('0x89');}_0x47854b[_0x2b7e('0x1b')](_0x177604);BPromise[_0x2b7e('0x8a')](_0x47854b,handleQuery)[_0x2b7e('0x1d')](function(_0x14998a){BPromise[_0x2b7e('0x1c')]([handleAdditionalPhones()])[_0x2b7e('0x1d')](function(){_0x47854b=[];for(var _0x54348a=0x0;_0x54348a\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.id','cm_hopper_black','createdAt'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0xa693,0xf1));var _0x3a69=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xa693[_0x43f881];return _0x365c14;};'use strict';var fs=require('fs');var path=require(_0x3a69('0x0'));var _=require(_0x3a69('0x1'));var Papa=require(_0x3a69('0x2'));var util=require(_0x3a69('0x3'));var BPromise=require(_0x3a69('0x4'));var moment=require(_0x3a69('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x3a69('0x6'));var logger=require(_0x3a69('0x7'))(_0x3a69('0x8'));config[_0x3a69('0x9')]=_[_0x3a69('0xa')](config[_0x3a69('0x9')],{'host':_0x3a69('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a69('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x3a69('0xc')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()['format'](_0x3a69('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4826b5){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))*$/[_0x3a69('0xe')](_0x4826b5);}function selectNotIn(_0x44b8b2,_0x21142a,_0x9934c2,_0x295bac,_0x59f5aa){return squel[_0x3a69('0xf')]()[_0x3a69('0x10')]('phone')[_0x3a69('0x11')](_0x295bac)[_0x3a69('0x12')](_0x21142a,null,_0x21142a+_0x3a69('0x13')+_0x295bac+'.'+_0x9934c2)[_0x3a69('0x14')](_0x295bac+'.'+_0x9934c2+_0x3a69('0x15')+_0x44b8b2+'.'+_0x9934c2)[_0x3a69('0x14')](_0x21142a+_0x3a69('0x16')+_0x59f5aa[_0x3a69('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xc26b8a,_0x1b88cc){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3a69('0x17')][_0x3a69('0x18')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x3a1adf){if(_0x3a1adf!==null){var _0x3ffd02=[];for(var _0xc7fa7c=0x0;_0xc7fa7c<_0x3a1adf[_0x3a69('0x19')];_0xc7fa7c++){var _0x17b18a=_0x3a1adf[_0xc7fa7c];if(!_[_0x3a69('0x1a')](_0x17b18a[_0x3a69('0x1b')])){if(!_[_0x3a69('0x1a')](_0x17b18a[_0x3a69('0x1c')]))_0x3ffd02[_0x3a69('0x1d')](insertAdditionalPhones(_0x17b18a));promisesContact['push']({'contact':_0x17b18a});}}}Promise[_0x3a69('0x1e')](_0x3ffd02)[_0x3a69('0x1f')](function(){_0xc26b8a({'val':0x1});});})[_0x3a69('0x20')](function(_0x4f78b7){logger[_0x3a69('0x21')](_0x4f78b7[_0x3a69('0x22')]);});});}function insertAdditionalPhones(_0x5090a8){return new Promise(function(_0x59f565,_0x4c34d9){var _0x3d365=_0x5090a8[_0x3a69('0x1c')];if(_['isNil'](_0x3d365))_0x4c34d9({'val':0x0});else{var _0x20e973=_0x3d365['split'](';');var _0x41adfc=[];orderBy=0x0;for(var _0x591bcf=0x0;_0x591bcf<_0x20e973[_0x3a69('0x19')];_0x591bcf++){_0x41adfc[_0x3a69('0x1d')](splitAdditionalPhone(_0x5090a8['id'],_0x20e973[_0x591bcf]));}Promise[_0x3a69('0x1e')](_0x41adfc)['then'](function(){_0x59f565({'val':_0x20e973[_0x3a69('0x19')]});});}});}function splitAdditionalPhone(_0x2603db,_0x12d7d3){return new Promise(function(_0x5321b0,_0x502ee8){var _0x4af991=_0x12d7d3[_0x3a69('0x23')](':');var _0xe06144=_0x4af991[0x0];var _0x525019=_0x4af991[0x1];if(_0x525019!==''){var _0x28c160=_0x525019[_0x3a69('0x23')]('|');var _0x277b5d=[];for(var _0xfa5706=0x0;_0xfa5706<_0x28c160[_0x3a69('0x19')];_0xfa5706++){if(_0x28c160[_0xfa5706]!==''){var _0x207ae1=_['filter'](promisesAdditionalPhones,{'contactId':_0x2603db,'phone':_0x28c160[_0xfa5706]});if(_0x207ae1[_0x3a69('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x3a69('0x1d')]({'contactId':_0x2603db,'contactTypeId':_0xe06144,'phone':_0x28c160[_0xfa5706],'orderBy':orderBy});}}}_0x5321b0({'ok':0x1});}else _0x5321b0({'res':0x0});});}function createAdditionalPhone(_0x191e5b,_0x3d1330,_0x2af120,_0x30a17c){var _0x439053='';var _0x4e679f='';var _0x586d3f=_0x2af120['split']('§');_0x439053=_0x586d3f[0x0];if(_0x586d3f[_0x3a69('0x19')]==0x2)_0x4e679f=_0x586d3f[0x1];return new Promise(function(_0xb3eda5,_0x44ee98){return db[_0x3a69('0x24')]['findOne']({'where':{'CmContactId':_0x191e5b,'item':_0x439053}})[_0x3a69('0x1f')](function(_0x37843b){if(_0x37843b){return db['CmContactHasItem'][_0x3a69('0x25')]({'ItemTypeId':_0x3d1330,'description':_0x4e679f,'OrderBy':_0x30a17c},{'where':{'CmContactId':_0x191e5b,'item':_0x439053}})[_0x3a69('0x1f')](function(_0xe137e6){_0xb3eda5({'res':_0x3a69('0x26')});});}else{return db[_0x3a69('0x24')][_0x3a69('0x27')]({'CmContactId':_0x191e5b,'item':_0x439053,'ItemTypeId':_0x3d1330,'description':_0x4e679f,'OrderBy':_0x30a17c,'ItemClass':_0x3a69('0x28')})[_0x3a69('0x1f')](function(_0x441a0b){_0xb3eda5({'res':_0x3a69('0x29')});});}});});}function updateContact(_0x13040c){return new Promise(function(_0x5b1594,_0x69e1c2){var _0x8ce623=_0x13040c['id'];delete _0x13040c['id'];return db[_0x3a69('0x2a')][_0x3a69('0x25')](_0x13040c,{'where':{'id':_0x8ce623}})[_0x3a69('0x1f')](function(_0x26ea78){updatedRows+=0x1;return db[_0x3a69('0x2b')][_0x3a69('0x25')]({'phone':_0x13040c[_0x3a69('0x1b')]},{'where':{'ContactId':_0x8ce623}})[_0x3a69('0x1f')](function(_0x5d0d30){_0x5b1594({'ret':'OK'});});});});}function insertCmHopper(_0x1fb38c,_0x3b7b43,_0x9552ae,_0x14f2c1,_0x245a6d){var _0x282e3f=[_0x3a69('0x2c'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x3b7b43+'.'+_0x14f2c1,_0x3a69('0x2d'),_0x3a69('0x2e'),_0x3a69('0x2f'),_0x3a69('0x30'),'\x22'+_0x245a6d+'\x22'];return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x33'))[_0x3a69('0x34')]([_0x3a69('0x1b'),_0x3a69('0x35'),_0x3a69('0x36'),_0x3a69('0x37'),_0x14f2c1,'createdAt','updatedAt','priority',_0x3a69('0x38'),_0x3a69('0x39')],squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x282e3f)[_0x3a69('0x11')](_0x3b7b43)['join'](_0x3a69('0x3b'),null,_0x3a69('0x3c')+_0x3b7b43+_0x3a69('0x3d'))['join'](_0x9552ae,null,_0x9552ae+_0x3a69('0x13')+_0x3b7b43+'.'+_0x14f2c1)[_0x3a69('0x14')](_0x3b7b43+_0x3a69('0x3e'),_0x1fb38c)[_0x3a69('0x14')](_0x3a69('0x3f'),NOW)[_0x3a69('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b7b43,_0x9552ae,_0x14f2c1,'cm_hopper',[_0x3a69('0x40'),'\x22onlyIfOpen\x22']))['where'](_0x3a69('0x41'),selectNotIn(_0x3b7b43,_0x9552ae,_0x14f2c1,_0x3a69('0x33'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x46f6dc,_0x2e2b7a,_0x231f43,_0x5a8e53){var _0x401317=['cm_contacts.phone',_0x3a69('0x42'),'cm_contacts.ListId',_0x2e2b7a+'.'+_0x5a8e53,_0x3a69('0x2d'),'cm_contacts.updatedAt'];return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x43'))[_0x3a69('0x34')]([_0x3a69('0x1b'),_0x3a69('0x36'),_0x3a69('0x37'),_0x5a8e53,_0x3a69('0x44'),_0x3a69('0x45')],squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x401317)[_0x3a69('0x11')](_0x2e2b7a)[_0x3a69('0x12')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2e2b7a+'.CmListId')[_0x3a69('0x12')](_0x231f43,null,_0x231f43+_0x3a69('0x13')+_0x2e2b7a+'.'+_0x5a8e53)['where'](_0x2e2b7a+_0x3a69('0x3e'),_0x46f6dc)[_0x3a69('0x14')](_0x3a69('0x3f'),NOW)[_0x3a69('0x14')](_0x3a69('0x41'),squel[_0x3a69('0xf')]()[_0x3a69('0x10')]('phone')[_0x3a69('0x11')]('cm_hopper_black')[_0x3a69('0x14')](_0x3a69('0x46'),_0x46f6dc)['where'](_0x5a8e53+_0x3a69('0x47'),_0x2e2b7a+'.'+_0x5a8e53)))[_0x3a69('0x48')]();}function insertCmHopperAdditionalPhones(_0x5733b8){var _0x1af3ab=[_0x3a69('0x49'),_0x3a69('0x4a'),_0x3a69('0x4b'),_0x3a69('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x4d'))['fromQuery'](['CmHopperId',_0x3a69('0x1b'),'OrderBy',_0x3a69('0x44'),'updatedAt'],squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x1af3ab)['from'](_0x3a69('0x33'))[_0x3a69('0x12')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x3a69('0x12')]('cm_contact_has_items',null,_0x3a69('0x4e'))['where']('cm_hopper.ListId\x20=\x20?',_0x5733b8)[_0x3a69('0x14')](_0x3a69('0x3f'),NOW))[_0x3a69('0x48')]();}function insertCmContact(_0x156bc5,_0x242ef1,_0x91dce2,_0xb4eb7c){var _0x473617=_['concat'](_[_0x3a69('0x4f')](_0xb4eb7c),[_0x3a69('0x37'),_0x3a69('0x50'),'createdAt',_0x3a69('0x45')]);return squel[_0x3a69('0x31')]()[_0x3a69('0x32')](_0x3a69('0x3b'))[_0x3a69('0x34')](_0x473617,squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x473617)[_0x3a69('0x11')](_0x242ef1)[_0x3a69('0x14')]('('+_0x91dce2['join'](',')+_0x3a69('0x51'),squel[_0x3a69('0xf')]()[_0x3a69('0x3a')](_0x91dce2)[_0x3a69('0x11')](_0x3a69('0x3b'))[_0x3a69('0x14')](_0x3a69('0x46'),_0x156bc5))[_0x3a69('0x14')]('id\x20IN\x20?',squel[_0x3a69('0xf')]()[_0x3a69('0x10')](_0x3a69('0x52'),_0x3a69('0x53'))[_0x3a69('0x11')](_0x242ef1)[_0x3a69('0x54')](_0x91dce2['join'](','))))[_0x3a69('0x48')]();}function handleStop(){logger[_0x3a69('0x55')](_0x3a69('0x56'));stopped=!![];}function handleUncaughtException(_0x4270f5){logger[_0x3a69('0x21')](_0x4270f5[_0x3a69('0x22')]);process[_0x3a69('0x57')](0x1);}function handleError(_0x9737d4,_0x9c5656){stats['errors']['push']({'name':_0x9c5656[_0x3a69('0x58')],'message':_0x9c5656[_0x3a69('0x22')],'row':_0x9737d4});}function handleQuery(_0xa7862d){logger[_0x3a69('0x55')](_0xa7862d);return db['sequelize'][_0x3a69('0x18')](_0xa7862d)[_0x3a69('0x59')](function(_0x3635f3){results[_0x3a69('0x1d')](_0x3635f3);})[_0x3a69('0x20')](function(_0x13a50a){logger[_0x3a69('0x21')](_0x13a50a['message']);});}function main(_0x54995d,_0x19c158,_0x36d29d,_0x593390){logger[_0x3a69('0x55')]('main',_0x54995d,JSON[_0x3a69('0x5a')](_0x19c158));process[_0x3a69('0x5b')](_0x3a69('0x5c'));var _0xa1699d=_0x19c158[_0x3a69('0x5d')];var _0x60714e=_[_0x3a69('0x5e')](_0xa1699d);var _0x4263ba=_0x19c158[_0x3a69('0x5f')];var _0xa12fc5=path[_0x3a69('0x12')](config[_0x3a69('0x60')],_0x3a69('0x61'),_0x4263ba+_0x3a69('0x62'));logger['info'](_0x3a69('0x63'),_0x19c158);db[_0x3a69('0x64')][_0x3a69('0x65')]({'raw':!![],'attributes':['id',_0x3a69('0x66')]})[_0x3a69('0x1f')](function(_0x25a4ec){for(var _0x337576=0x0;_0x337576<_0x25a4ec[_0x3a69('0x19')];_0x337576++){if(_0x25a4ec[_0x337576][_0x3a69('0x66')]in _0xa1699d){contactItemTypes[_0x3a69('0x1d')](_0x25a4ec[_0x337576]);delete _0x60714e[_0x25a4ec[_0x337576]['name']];hasAdditionalPhones=!![];}for(var _0x203616 in _0xa1699d){if(_0x25a4ec[_0x337576][_0x3a69('0x66')]+_0x3a69('0x67')===_0x203616){phoneDescriptions[_0x3a69('0x1d')]({'itemTypeId':_0x25a4ec[_0x337576]['id'],'description':_0x203616});delete _0x60714e[_0x203616];}}}if(hasAdditionalPhones)_0x60714e['AdditionalPhones']='';var _0x1ee3f9=_['keys'](_0x60714e)[_0x3a69('0x12')]();logger['info'](_0x3a69('0x68'),_0x1ee3f9);fs['writeFileSync'](_0xa12fc5,_0x1ee3f9+'\x0a');Papa[_0x3a69('0x69')](fs[_0x3a69('0x6a')](_0x54995d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f5d9e,_0x392708){try{for(var _0xf7739b=0x0,_0x567856=[];_0xf7739b<_0x2f5d9e[_0x3a69('0x6b')]['length'];_0xf7739b++){stats[_0x3a69('0x6c')]+=0x1;if(_0x2f5d9e['errors'][_0xf7739b]){handleError(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b],_0x2f5d9e[_0x3a69('0x6d')][_0xf7739b]);}else{var _0x4962a1=[];var _0x4a510b=[];var _0x84c89f={};for(var _0x157b6c in _0xa1699d){let _0x4272a8=contactItemTypes[_0x3a69('0x6e')](_0x487fd6=>_0x487fd6[_0x3a69('0x66')]===_0x157b6c);let _0x4973dd=contactItemTypes[_0x3a69('0x6e')](_0x5711e1=>_0x5711e1[_0x3a69('0x66')]+'_description'===_0x157b6c);if(_[_0x3a69('0x1a')](_0x4272a8)&&_[_0x3a69('0x1a')](_0x4973dd)){if(_0xa1699d[_0x3a69('0x6f')](_0x157b6c)){if(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x157b6c]]){var _0x4ccc06=_['trim'](_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x157b6c]][_0x3a69('0x70')](/"/g,'\x27'));switch(_0x157b6c){case'scheduledat':var _0x6b4527=moment(_0x4ccc06,_0x3a69('0x71'),!![]);if(_0x6b4527[_0x3a69('0x72')]()){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}else{_0x4962a1[_0x3a69('0x1d')](_0x3a69('0x73'));}break;case'priority':var _0x1f4dd3=parseInt(_0x4ccc06);_0x4ccc06=_[_0x3a69('0x74')](_0x1f4dd3)||_0x1f4dd3<0x0||_0x1f4dd3>0x4?_0x593390?0x3:0x2:_0x1f4dd3;_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');break;case _0x3a69('0x38'):var _0x31d838=parseInt(_0x4ccc06);if(_[_0x3a69('0x75')](_0x31d838)&&_[_0x3a69('0x76')](_0x36d29d,_0x31d838)){_0x567856[_0x3a69('0x1d')]('\x22'+_0x31d838+'\x22');}else{_0x4962a1[_0x3a69('0x1d')](_0x3a69('0x77'));}break;case _0x3a69('0x78'):if(isEmail(_0x4ccc06)){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}else{_0x4962a1['push'](_0x3a69('0x79'));}break;case _0x3a69('0x7a'):var _0xd91f4a=moment(_0x4ccc06,'YYYY-MM-DD',!![]);if(_0xd91f4a[_0x3a69('0x72')]()){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}else{_0x4962a1['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x567856[_0x3a69('0x1d')]('\x22'+_0x4ccc06+'\x22');}}else{switch(_0x157b6c){case _0x3a69('0x7b'):case _0x3a69('0x1b'):_0x4962a1[_0x3a69('0x1d')](_0x157b6c+_0x3a69('0x7c'));break;default:_0x567856['push']('\x22\x22');}}}}else{var _0x3d5829='';if(!_[_0x3a69('0x1a')](_0x4272a8)){if(!_0x84c89f[_0x3a69('0x6f')](_0x4272a8['id'])){for(var _0x348024=0x0;_0x348024<_0xa1699d[_0x157b6c][_0x3a69('0x19')];_0x348024++){var _0x4ccc06=_['trim'](_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x157b6c][_0x348024]][_0x3a69('0x70')](/"/g,'\x27'));var _0x4027b0=phoneDescriptions[_0x3a69('0x6e')](_0x421724=>_0x421724[_0x3a69('0x7d')]===_0x4272a8['id']);if(!_[_0x3a69('0x1a')](_0x4027b0)){var _0x3a32a8=_[_0x3a69('0x7e')](_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b][_0xa1699d[_0x4027b0[_0x3a69('0x7f')]][0x0]][_0x3a69('0x70')](/"/g,'\x27'));if(!_[_0x3a69('0x1a')](_0x3a32a8))_0x4ccc06=_0x4ccc06+'§'+_0x3a32a8;}if(_0x3d5829=='')_0x3d5829=_0x4ccc06;else _0x3d5829+='|'+_0x4ccc06;}_0x4a510b[_0x3a69('0x1d')](_0x4272a8['id']+':'+_0x3d5829);_0x84c89f[_0x4272a8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x567856[_0x3a69('0x1d')]('\x22'+_0x4a510b[_0x3a69('0x12')](';')+'\x22');}if(_0x4962a1[_0x3a69('0x19')]){handleError(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b],{'code':'SystemRow','message':_0x4962a1['join']()});}else{fs['appendFileSync'](_0xa12fc5,_0x567856[_0x3a69('0x12')]()+'\x0a');}_0x567856=[];}if(!(stats[_0x3a69('0x6c')]%0xc8)){socket['emit'](_0x3a69('0x80')+_0x4263ba,stats);stats['errors']=[];}}if(stopped){logger[_0x3a69('0x55')](_0x3a69('0x81'));_0x392708[_0x3a69('0x82')]();}}catch(_0x558d90){handleError(_0x2f5d9e[_0x3a69('0x6b')][_0xf7739b],{'code':_0x3a69('0x83'),'message':_0x558d90[_0x3a69('0x22')]});logger[_0x3a69('0x21')](_0x3a69('0x84'),_0x558d90[_0x3a69('0x22')]);}},'complete':function(){try{var _0x5bfde4=[];var _0x4984dd=tempTableName;_0x5bfde4[_0x3a69('0x1d')](_0x3a69('0x85')+_0x4984dd+_0x3a69('0x86'));logger['info'](_0x3a69('0x87'),contactItemTypes[_0x3a69('0x19')]);var _0x211881=util[_0x3a69('0xc')](_0x3a69('0x88'),_0xa12fc5,_0x4984dd,_0x1ee3f9,_0x19c158[_0x3a69('0x37')],_0x19c158[_0x3a69('0x50')]||null,NOW,NOW);if(_[_0x3a69('0x1a')](_0xa1699d[_0x3a69('0x35')])){_0x211881+=',\x20scheduledAt\x20=\x20NOW()';}_0x5bfde4[_0x3a69('0x1d')](_0x211881);BPromise['each'](_0x5bfde4,handleQuery)[_0x3a69('0x1f')](function(_0x389d14){BPromise[_0x3a69('0x1e')]([handleAdditionalPhones()])[_0x3a69('0x1f')](function(){_0x5bfde4=[];for(var _0x22542a=0x0;_0x22542a\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','ui.','from','left_join','users','length','\x20IN\x20?','map','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','messages','me.','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','type','default','text','value','start','end','unreadMessages','read','and','Contact'];(function(_0x2afe26,_0x2b09a0){var _0x350f68=function(_0x27ad00){while(--_0x27ad00){_0x2afe26['push'](_0x2afe26['shift']());}};_0x350f68(++_0x2b09a0);}(_0x3544,0x195));var _0x4354=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x3544[_0x48b810];return _0x23c17d;};'use strict';var _=require('lodash');var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0x4354('0x0'));var updateInteraction=require(_0x4354('0x1'))[_0x4354('0x2')];var utils=require(_0x4354('0x3'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x297ee4,_0x169ce4,_0x44e361){var _0x3f4172=![];var _0x5cf43c=utils[_0x4354('0x4')](_0x297ee4);if(_0x169ce4[_0x4354('0x5')]===_0x4354('0x6')&&!_0x44e361[_0x4354('0x7')]&&!_0x44e361[_0x5cf43c]){_0x3f4172=!![];}return _0x3f4172;}function getTagsQuery(){return squel[_0x4354('0x8')]()[_0x4354('0x9')]('id')[_0x4354('0x9')](_0x4354('0xa'))[_0x4354('0x9')](_0x4354('0xb'))['from'](_0x4354('0xc'));}function getUsersQuery(_0x18eb2d,_0x9b8cb5){var _0x192726=utils[_0x4354('0xd')](_0x18eb2d);var _0x25d7be=_0x4354('0xe')+_0x18eb2d+_0x4354('0xf');var _0x577d85=squel[_0x4354('0x8')]()[_0x4354('0x9')](_0x4354('0x10'))['field']('u.fullname')['field'](_0x4354('0x11')+_0x192726)[_0x4354('0x12')](_0x25d7be,'ui')[_0x4354('0x13')](_0x4354('0x14'),'u','u.id\x20=\x20ui.UserId');if(_0x9b8cb5[_0x4354('0x15')]>0x0){_0x577d85['where'](_0x4354('0x11')+_0x192726+_0x4354('0x16'),_[_0x4354('0x17')](_0x9b8cb5,'id'));}return _0x577d85;}function getInteractionsQuery(_0xe86ba){var _0x5f414c=utils[_0x4354('0x18')](_0xe86ba);var _0x342a2f=utils[_0x4354('0x4')](_0xe86ba);var _0x1bf6b9=utils['getInteractionFK'](_0xe86ba);return squel['select']()[_0x4354('0x12')](_0x5f414c[_0x4354('0x19')],'i')[_0x4354('0x13')]('cm_contacts','c',_0x4354('0x1a'))[_0x4354('0x13')](_0x4354('0x14'),'o',_0x4354('0x1b'))[_0x4354('0x13')](_0x5f414c[_0x4354('0x1c')],'a','a.id\x20=\x20i.'+_0x342a2f)[_0x4354('0x13')](_0x5f414c[_0x4354('0x1d')],'me',_0x4354('0x1e')+_0x1bf6b9+_0x4354('0x1f'))[_0x4354('0x13')](_0x5f414c['interactionsTags'],'it',_0x4354('0x20')+_0x1bf6b9+'\x20=\x20i.id')['left_join'](_0x4354('0xc'),'t',_0x4354('0x21'));}function getSqlClauses(){var _0x2e80f4={'body':squel[_0x4354('0x22')](),'contact':squel[_0x4354('0x22')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x2e80f4;}function parseTagParameter(_0x1c339c){var _0x16be20=squel[_0x4354('0x22')]();if(_0x1c339c){var _0x4e9176=utils[_0x4354('0x23')](_0x1c339c);_0x4e9176[_0x4354('0x24')](function(_0x54bf03){_0x16be20['or'](_0x4354('0x25'),'%,'+_0x54bf03+',%');});}return _0x16be20;}function parseReadParameter(_0x588358){var _0x2d6a45='';if(_0x588358){_0x2d6a45=_0x4354('0x26');if(_0x588358==='1'){_0x2d6a45=_0x2d6a45[_0x4354('0x27')](_0x4354('0x28'),'=');}else{_0x2d6a45=_0x2d6a45['replace'](_0x4354('0x28'),'>');}}return _0x2d6a45;}function parseSearchFilter(_0x3b523b,_0x1d3df8){var _0x3d2493=squel[_0x4354('0x22')]();if(_0x1d3df8){var _0x1fcef0=_0x1d3df8[_0x4354('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1fcef0)){_0x3d2493['or']('i.id\x20LIKE\x20?',_0x1fcef0+'%');if([_0x4354('0x29'),_0x4354('0x2a')][_0x4354('0x2b')](_0x3b523b)){_0x3d2493['or'](_0x4354('0x2c'),_0x1fcef0+'%');}else if(_0x3b523b===_0x4354('0x2d')){_0x3d2493['or']('i.fax\x20LIKE\x20?',_0x1fcef0+'%');}else if(_0x3b523b===_0x4354('0x2e')){_0x3d2493['or']('i.from\x20LIKE\x20?',_0x1fcef0+'%');}}else if(_0x3b523b===_0x4354('0x2f')&&qs[_0x4354('0x30')](_0x1fcef0)){_0x3d2493['or'](_0x4354('0x31'),_0x1fcef0+'%');}else{if(_0x3b523b===_0x4354('0x2f')){_0x3d2493['or'](_0x4354('0x32'),qs[_0x4354('0x33')](_0x1fcef0,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4354('0x33')](_0x1fcef0));}else if(_0x3b523b!==_0x4354('0x2d')){_0x3d2493['or'](_0x4354('0x34'),qs['getFullTextValue'](_0x1fcef0));}_0x3d2493['or'](_0x4354('0x35'),qs[_0x4354('0x33')](_0x1fcef0,!![]),null);}}return _0x3d2493;}function parseAdvancedSearchFilter(_0x1c4b69,_0x46cb98){var _0x2afe97=getSqlClauses();var _0x43859f=as[_0x4354('0x36')](_0x1c4b69);var _0x3171d8=_0x43859f['sqlOperator'];for(var _0x1bbe32=0x0;_0x1bbe32<_0x43859f[_0x4354('0x37')][_0x4354('0x15')];_0x1bbe32++){var _0x529b1e=_0x43859f['conditions'][_0x1bbe32];var _0x291c86='i';var _0x9d38c3=_['find'](_0x46cb98,[_0x4354('0xa'),_0x529b1e[_0x4354('0x9')]]);if(_0x9d38c3){var _0x43d524=as['buildExpression'](_0x291c86,_0x9d38c3[_0x4354('0x38')],_0x529b1e);_0x2afe97[_0x4354('0x39')][_0x3171d8](_0x43d524[_0x4354('0x3a')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3c')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3d')]);}else{switch(_0x529b1e[_0x4354('0x9')]){case _0x4354('0x3e'):var _0x5cc10d=parseReadParameter(_0x529b1e[_0x4354('0x3b')]);_0x2afe97[_0x4354('0x3f')][_0x4354('0x40')](_0x5cc10d);break;case _0x4354('0x41'):if(_0x529b1e[_0x4354('0x42')]===_0x4354('0x43')){if(_0x529b1e[_0x4354('0x3b')][_0x4354('0x44')]('\x20')['length']>0x1){_0x2afe97[_0x4354('0x45')][_0x3171d8]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x529b1e['value'],!![]),null);}else{var _0x5b4d51='%'+_0x529b1e[_0x4354('0x3b')]+'%';_0x2afe97[_0x4354('0x45')][_0x3171d8]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5b4d51,_0x5b4d51,_0x5b4d51);}}else{_0x9d38c3=_[_0x4354('0x46')](_0x46cb98,['name',_0x4354('0x47')]);_0x529b1e[_0x4354('0x9')]=_0x4354('0x47');_0x43d524=as[_0x4354('0x48')](_0x291c86,_0x9d38c3[_0x4354('0x38')],_0x529b1e);_0x2afe97[_0x4354('0x45')][_0x3171d8](_0x43d524[_0x4354('0x3a')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3c')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3d')]);}break;case'Tag':var _0x572720=_0x529b1e[_0x4354('0x3b')][_0x4354('0x44')](',')[_0x4354('0x17')](function(_0x53029c){return Number(_0x53029c);});var _0x3229e1=parseTagParameter(_0x572720);_0x2afe97[_0x4354('0x49')][_0x4354('0x4a')]['and'](_0x3229e1);_0x2afe97[_0x4354('0x49')][_0x4354('0x4b')]=_0x572720;break;case _0x4354('0x4c'):if(_0x529b1e[_0x4354('0x42')]===_0x4354('0x43')){_0x2afe97[_0x4354('0x4d')][_0x3171d8](_0x4354('0x4e'),'%'+_0x529b1e[_0x4354('0x3b')]+'%',null);}else{_0x9d38c3=_[_0x4354('0x46')](_0x46cb98,['name',_0x4354('0x4f')]);_0x529b1e[_0x4354('0x9')]=_0x4354('0x4f');_0x43d524=as[_0x4354('0x48')](_0x291c86,_0x9d38c3[_0x4354('0x38')],_0x529b1e);_0x2afe97[_0x4354('0x4d')][_0x3171d8](_0x43d524[_0x4354('0x3a')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3c')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3d')]);}break;case _0x4354('0x50'):case _0x4354('0x51'):_0x43d524=as[_0x4354('0x48')]('me',null,_0x529b1e);_0x2afe97[_0x4354('0x50')][_0x3171d8](_0x43d524[_0x4354('0x3a')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3c')],_0x43d524[_0x4354('0x3b')][_0x4354('0x3d')]);break;}}}return _0x2afe97;}function parseModelFields(_0x431558,_0x490656,_0x3e05c1){var _0x5dde1b=utils[_0x4354('0x4')](_0x431558);var _0x1c1fe5=squel[_0x4354('0x22')]();var _0x4a2830=_(_0x490656)[_0x4354('0x52')]()[_0x4354('0x17')](function(_0x2c313a){return _[_0x4354('0x53')](_0x3e05c1,[_0x4354('0xa'),_0x2c313a])?_0x2c313a:undefined;})[_0x4354('0x54')]()[_0x4354('0x3b')]();if(_0x4a2830[_0x4354('0x15')]>0x0){_0x4a2830['forEach'](function(_0x317231){if(_0x317231===_0x5dde1b){_0x1c1fe5['and']('i.'+_0x5dde1b+_0x4354('0x16'),[][_0x4354('0x55')](_0x490656[_0x317231]));}else if(_0x317231===_0x4354('0x56')){var _0x115d22=JSON['parse'](_0x490656[_0x317231])[_0x4354('0x57')];var _0x14aa6b=JSON[_0x4354('0x58')](_0x490656[_0x317231])['$lte'];_0x1c1fe5[_0x4354('0x40')](_0x4354('0x59'),_0x115d22,_0x14aa6b);}else{if(_0x490656[_0x317231]==='null'){_0x1c1fe5['and']('i.'+_0x317231+_0x4354('0x5a'));}else{_0x1c1fe5[_0x4354('0x40')]('i.'+_0x317231+'\x20=\x20?',_0x490656[_0x317231]);}}});}return _0x1c1fe5;}function parseQueryParameters(_0x30d948,_0x226957,_0x43aebd){var _0x47b3df=getSqlClauses();return Promise[_0x4354('0x5b')]()[_0x4354('0x5c')](function(){return parseModelFields(_0x30d948,_0x226957,_0x43aebd);})['then'](function(_0xca92ba){_0x47b3df[_0x4354('0x5d')][_0x4354('0x40')](_0xca92ba);return parseReadParameter(_0x226957[_0x4354('0x3f')]);})[_0x4354('0x5c')](function(_0x2858b1){_0x47b3df['read'][_0x4354('0x40')](_0x2858b1);return parseTagParameter(_0x226957[_0x4354('0x5e')]);})[_0x4354('0x5c')](function(_0x4b3670){_0x47b3df[_0x4354('0x49')][_0x4354('0x4a')]['and'](_0x4b3670);return parseSearchFilter(_0x30d948,_0x226957['filter']);})[_0x4354('0x5c')](function(_0x52cad2){_0x47b3df['filter']=_0x52cad2;return _0x47b3df;});}function checkAccountsRestrictions(_0x18b55f,_0x1a0047,_0x4d1b33){var _0x73b635=utils['getAccountFK'](_0x18b55f);var _0x3dac71='get'+_[_0x4354('0x5f')](_0x18b55f)+(_0x18b55f==='chat'?'Websites':_0x4354('0x60'));var _0x3cd226=squel[_0x4354('0x22')]();return Promise[_0x4354('0x5b')]()[_0x4354('0x5c')](function(){if(_0x4d1b33['search']&&_0x1a0047['role']===_0x4354('0x6')){return _0x1a0047[_0x3dac71]({'attributes':['id'],'raw':!![]});}})[_0x4354('0x5c')](function(_0x28748b){if(_0x28748b){if(_0x28748b[_0x4354('0x15')]===0x0){_0x3cd226['and']('i.'+_0x73b635+_0x4354('0x5a'));}else{_0x3cd226[_0x4354('0x40')]('i.'+_0x73b635+_0x4354('0x16'),_[_0x4354('0x17')](_0x28748b,'id'));}}else if(!_0x4d1b33[_0x73b635]){_0x3cd226[_0x4354('0x40')]('i.'+_0x73b635+_0x4354('0x61'));}})[_0x4354('0x5c')](function(){return _0x3cd226;});}function getClosedOrderClause(_0x2044c7,_0x54e2d2){var _0x31d376='';var _0x41381b=[_0x4354('0x62'),_0x4354('0x63'),_0x4354('0x64')];if(_0x2044c7===_0x4354('0x2f')){_0x41381b[_0x4354('0x65')]('i.substatus');}if(_0x54e2d2['closed']==='0'&&_0x2044c7===_0x4354('0x2f')){_0x31d376='i.substatus';}else{if(_0x54e2d2[_0x4354('0x66')]==='1'){_0x41381b[_0x4354('0x67')]();}_0x31d376=_0x4354('0x68')+_0x41381b[_0x4354('0x69')](',\x20')+')';}return _0x31d376;}function getFilteredInteractions(_0xc02efe,_0x10e3b7,_0x1eac6c,_0x2e9a0f){var _0x19cab6=utils[_0x4354('0xd')](_0xc02efe);var _0x3b4c13=_[_0x4354('0x5f')](_0xc02efe)+_0x4354('0x6a');var _0x51f119=[];var _0x2d75b2=getTagsQuery();var _0x328e5b={'type':db[_0x4354('0x6b')][_0x4354('0x6c')][_0x4354('0x6d')],'raw':!![]};var _0x77f366=[];var _0x29f7f3=[];return db[_0x4354('0x6e')][_0x4354('0x6f')](_0x2d75b2[_0x4354('0x70')](),_0x328e5b)[_0x4354('0x5c')](function(_0x373e19){_0x51f119=_[_0x4354('0x71')](_0x373e19,'id');_0x328e5b=_['merge'](_0x328e5b,{'model':db[_0x3b4c13],'mapToModel':!![],'nest':!![]});if(_0x1eac6c[_0x4354('0x5d')]){_0x2e9a0f[_0x4354('0x72')]['forEach'](function(_0x109ed7){_0x10e3b7[_0x4354('0x9')]('i.'+_0x109ed7);});}else{_0x10e3b7[_0x4354('0x9')](_0x4354('0x73'),_0x4354('0x3e'));_0x10e3b7[_0x4354('0x9')]('a.key','Account.key');_0x10e3b7[_0x4354('0x9')](_0x4354('0x74'),'Account.mandatoryDisposition');if(_0xc02efe===_0x4354('0x2f')){_0x10e3b7[_0x4354('0x9')](_0x4354('0x75'),_0x4354('0x76'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x77'),_0x4354('0x78'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x79'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x7a'));_0x10e3b7['field']('i.updatedAt');_0x10e3b7[_0x4354('0x9')](_0x4354('0x7b'));_0x10e3b7['field'](_0x4354('0x7c'));_0x10e3b7['field'](_0x4354('0x7d'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x7e'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x7f'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x80'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x64'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x63'));_0x10e3b7['field'](_0x4354('0x62'));_0x10e3b7[_0x4354('0x9')]('i.substatus');_0x10e3b7[_0x4354('0x9')](_0x4354('0x81'));_0x10e3b7[_0x4354('0x9')]('i.ContactId');_0x10e3b7['field'](_0x4354('0x82'));_0x10e3b7[_0x4354('0x9')]('i.UserId');}else if(_0xc02efe==='openchannel'){_0x10e3b7[_0x4354('0x9')](_0x4354('0x83'),_0x4354('0x78'));}else{_0x10e3b7['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x4354('0x78'));}if(_0xc02efe!==_0x4354('0x2f')){_0x10e3b7[_0x4354('0x9')](_0x4354('0x84'));}_0x10e3b7[_0x4354('0x9')](_0x4354('0x85'),_0x4354('0x86'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x87'),_0x4354('0x88'));_0x10e3b7['field'](_0x4354('0x89'),'Contact.email');_0x10e3b7[_0x4354('0x9')]('c.phone',_0x4354('0x8a'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x8b'),'Contact.mobile');_0x10e3b7[_0x4354('0x9')](_0x4354('0x8c'),_0x4354('0x8d'));_0x10e3b7[_0x4354('0x9')](_0x4354('0x8e'),'Owner.fullname');_0x10e3b7[_0x4354('0x9')](_0x4354('0x8f'),_0x4354('0x90'));_0x10e3b7['field'](_0x4354('0x91'),_0x4354('0x92'));}if(_0x2e9a0f[_0x4354('0x93')]){_0x10e3b7[_0x4354('0x93')](_0x2e9a0f[_0x4354('0x93')]);}if(_0x2e9a0f[_0x4354('0x94')]){_0x10e3b7[_0x4354('0x94')](_0x2e9a0f[_0x4354('0x94')]);}return db[_0x4354('0x6e')]['query'](_0x10e3b7[_0x4354('0x70')](),_0x328e5b);})[_0x4354('0x5c')](function(_0x9caa93){_0x77f366=_0x9caa93;var _0x3d57e8=getUsersQuery(_0xc02efe,_0x77f366);return db[_0x4354('0x6e')][_0x4354('0x6f')](_0x3d57e8[_0x4354('0x70')](),_0x328e5b);})[_0x4354('0x5c')](function(_0x4806bb){_0x29f7f3=_['groupBy'](_0x4806bb,_0x19cab6);if(_0xc02efe===_0x4354('0x2f')){return db[_0x4354('0x95')][_0x4354('0x96')]({'attributes':[_0x4354('0x97')],'raw':!![]});}})['then'](function(_0x3b81fa){var _0x5e96ba=_0x3b81fa?_0x3b81fa['enableEmailPreview']:undefined;var _0x412476=_0x77f366[_0x4354('0x17')](function(_0x51cde3){return updateInteraction(_0x51cde3,_0x51f119,_0x29f7f3,_0x5e96ba);});return Promise[_0x4354('0x98')](_0x412476);});}function countFilteredInteractions(_0x313f84,_0x5125f1){var _0x3778cf=_0x313f84['clone']();_0x3778cf[_0x4354('0x9')](_0x4354('0x99'));_0x3778cf[_0x4354('0x9')](_0x4354('0x73'),'unreadMessages');var _0x219dcf=utils['getSelectedTags'](_0x5125f1);if(!_[_0x4354('0x9a')](_0x219dcf)){_0x3778cf['where'](_0x4354('0x9b'),_0x219dcf);}var _0x148d62={'type':db['Sequelize'][_0x4354('0x6c')][_0x4354('0x6d')],'raw':!![]};return db[_0x4354('0x6e')][_0x4354('0x6f')](_0x3778cf['toString'](),_0x148d62);}module[_0x4354('0x9c')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x9b70=['o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','toString','groupBy','Setting','enableEmailPreview','all','clone','COUNT(*)','t.id\x20IN\x20?','QueryTypes','SELECT','exports','lodash','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','../../mysqldb','role','search','select','field','name','from','user_has_','u.id','u.fullname','ui.','users','where','\x20IN\x20?','map','getInteractionsTables','getInteractionFK','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','tools_tags','t.id\x20=\x20it.TagId','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','includes','fax','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','length','find','buildExpression','type','value','end','unreadMessages','read','operator','$substring','split','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','text','start','Tag','tags','clause','and','User','user','UserId','plainBody','body','keys','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','filter','getAccountFK','get','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','closed','capitalize','Sequelize','sequelize','keyBy','merge','forEach','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','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','contactName','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x9b70,0xb6));var _0x09b7=function(_0xb67251,_0x1f6208){_0xb67251=_0xb67251-0x0;var _0x979d96=_0x9b70[_0xb67251];return _0x979d96;};'use strict';var _=require(_0x09b7('0x0'));var squel=require(_0x09b7('0x1'));var as=require(_0x09b7('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0x09b7('0x3'))[_0x09b7('0x4')];var utils=require('./utils');var db=require(_0x09b7('0x5'))['db'];function skipInteractionsQuery(_0x45e6b6,_0x21205a,_0x2db329){var _0x45fc91=![];var _0xb8142=utils['getAccountFK'](_0x45e6b6);if(_0x21205a[_0x09b7('0x6')]==='agent'&&!_0x2db329[_0x09b7('0x7')]&&!_0x2db329[_0xb8142]){_0x45fc91=!![];}return _0x45fc91;}function getTagsQuery(){return squel[_0x09b7('0x8')]()[_0x09b7('0x9')]('id')[_0x09b7('0x9')](_0x09b7('0xa'))[_0x09b7('0x9')]('color')[_0x09b7('0xb')]('tools_tags');}function getUsersQuery(_0x3773c2,_0x460528){var _0x3da116=utils['getInteractionFK'](_0x3773c2);var _0x47ebe6=_0x09b7('0xc')+_0x3773c2+'_interactions';var _0x457b15=squel[_0x09b7('0x8')]()[_0x09b7('0x9')](_0x09b7('0xd'))[_0x09b7('0x9')](_0x09b7('0xe'))[_0x09b7('0x9')](_0x09b7('0xf')+_0x3da116)[_0x09b7('0xb')](_0x47ebe6,'ui')['left_join'](_0x09b7('0x10'),'u','u.id\x20=\x20ui.UserId');if(_0x460528['length']>0x0){_0x457b15[_0x09b7('0x11')]('ui.'+_0x3da116+_0x09b7('0x12'),_[_0x09b7('0x13')](_0x460528,'id'));}return _0x457b15;}function getInteractionsQuery(_0x20a0c7){var _0x353fcc=utils[_0x09b7('0x14')](_0x20a0c7);var _0x19f8f8=utils['getAccountFK'](_0x20a0c7);var _0x22ba8d=utils[_0x09b7('0x15')](_0x20a0c7);return squel[_0x09b7('0x8')]()[_0x09b7('0xb')](_0x353fcc[_0x09b7('0x16')],'i')[_0x09b7('0x17')](_0x09b7('0x18'),'c',_0x09b7('0x19'))[_0x09b7('0x17')](_0x09b7('0x10'),'o',_0x09b7('0x1a'))[_0x09b7('0x17')](_0x353fcc[_0x09b7('0x1b')],'a',_0x09b7('0x1c')+_0x19f8f8)[_0x09b7('0x17')](_0x353fcc[_0x09b7('0x1d')],'me',_0x09b7('0x1e')+_0x22ba8d+_0x09b7('0x1f'))[_0x09b7('0x17')](_0x353fcc[_0x09b7('0x20')],'it',_0x09b7('0x21')+_0x22ba8d+_0x09b7('0x1f'))[_0x09b7('0x17')](_0x09b7('0x22'),'t',_0x09b7('0x23'));}function getSqlClauses(){var _0x544d11={'body':squel['expr'](),'contact':squel[_0x09b7('0x24')](),'default':squel[_0x09b7('0x24')](),'fields':squel[_0x09b7('0x24')](),'filter':squel[_0x09b7('0x24')](),'read':squel[_0x09b7('0x24')](),'tags':{'clause':squel[_0x09b7('0x24')](),'ids':null},'user':squel[_0x09b7('0x24')]()};return _0x544d11;}function parseTagParameter(_0x15273d){var _0xad023d=squel['expr']();if(_0x15273d){var _0x4481d0=utils['getSelectedTags'](_0x15273d);_0x4481d0['forEach'](function(_0x3205b9){_0xad023d['or'](_0x09b7('0x25'),'%,'+_0x3205b9+',%');});}return _0xad023d;}function parseReadParameter(_0x9533d9){var _0x3fe9ba='';if(_0x9533d9){_0x3fe9ba=_0x09b7('0x26');if(_0x9533d9==='1'){_0x3fe9ba=_0x3fe9ba[_0x09b7('0x27')](_0x09b7('0x28'),'=');}else{_0x3fe9ba=_0x3fe9ba[_0x09b7('0x27')]('{OPERATOR}','>');}}return _0x3fe9ba;}function parseSearchFilter(_0x516ab3,_0x4c85e1){var _0x40b4c5=squel[_0x09b7('0x24')]();if(_0x4c85e1){var _0x4544a0=_0x4c85e1[_0x09b7('0x27')]('\x5c','\x5c\x5c')[_0x09b7('0x27')](/'/g,'\x27\x27');if(qs[_0x09b7('0x29')](_0x4544a0)){_0x40b4c5['or'](_0x09b7('0x2a'),_0x4544a0+'%');if(['sms','whatsapp'][_0x09b7('0x2b')](_0x516ab3)){_0x40b4c5['or']('i.phone\x20LIKE\x20?',_0x4544a0+'%');}else if(_0x516ab3===_0x09b7('0x2c')){_0x40b4c5['or']('i.fax\x20LIKE\x20?',_0x4544a0+'%');}else if(_0x516ab3===_0x09b7('0x2d')){_0x40b4c5['or'](_0x09b7('0x2e'),_0x4544a0+'%');}}else if(_0x516ab3===_0x09b7('0x2f')&&qs[_0x09b7('0x30')](_0x4544a0)){_0x40b4c5['or']('c.email\x20LIKE\x20?',_0x4544a0+'%');}else{if(_0x516ab3==='mail'){_0x40b4c5['or'](_0x09b7('0x31'),qs[_0x09b7('0x32')](_0x4544a0,!![]))['or'](_0x09b7('0x33'),qs[_0x09b7('0x32')](_0x4544a0));}else if(_0x516ab3!=='fax'){_0x40b4c5['or'](_0x09b7('0x34'),qs[_0x09b7('0x32')](_0x4544a0));}_0x40b4c5['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x09b7('0x32')](_0x4544a0,!![]),null);}}return _0x40b4c5;}function parseAdvancedSearchFilter(_0x52f920,_0x25287c){var _0x4cac2a=getSqlClauses();var _0x40de82=as[_0x09b7('0x35')](_0x52f920);var _0x8f18a1=_0x40de82[_0x09b7('0x36')];for(var _0x52ad3d=0x0;_0x52ad3d<_0x40de82[_0x09b7('0x37')][_0x09b7('0x38')];_0x52ad3d++){var _0x43e33d=_0x40de82['conditions'][_0x52ad3d];var _0x190db2='i';var _0x12d292=_[_0x09b7('0x39')](_0x25287c,['name',_0x43e33d['field']]);if(_0x12d292){var _0x44c628=as[_0x09b7('0x3a')](_0x190db2,_0x12d292[_0x09b7('0x3b')],_0x43e33d);_0x4cac2a['default'][_0x8f18a1](_0x44c628['text'],_0x44c628['value']['start'],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);}else{switch(_0x43e33d[_0x09b7('0x9')]){case _0x09b7('0x3e'):var _0x10b624=parseReadParameter(_0x43e33d[_0x09b7('0x3c')]);_0x4cac2a[_0x09b7('0x3f')]['and'](_0x10b624);break;case'Contact':if(_0x43e33d[_0x09b7('0x40')]===_0x09b7('0x41')){if(_0x43e33d['value'][_0x09b7('0x42')]('\x20')[_0x09b7('0x38')]>0x1){_0x4cac2a[_0x09b7('0x43')][_0x8f18a1](_0x09b7('0x44'),qs[_0x09b7('0x32')](_0x43e33d[_0x09b7('0x3c')],!![]),null);}else{var _0x32badb='%'+_0x43e33d[_0x09b7('0x3c')]+'%';_0x4cac2a[_0x09b7('0x43')][_0x8f18a1](_0x09b7('0x45'),_0x32badb,_0x32badb,_0x32badb);}}else{_0x12d292=_[_0x09b7('0x39')](_0x25287c,[_0x09b7('0xa'),_0x09b7('0x46')]);_0x43e33d[_0x09b7('0x9')]='ContactId';_0x44c628=as[_0x09b7('0x3a')](_0x190db2,_0x12d292[_0x09b7('0x3b')],_0x43e33d);_0x4cac2a[_0x09b7('0x43')][_0x8f18a1](_0x44c628[_0x09b7('0x47')],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x48')],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);}break;case _0x09b7('0x49'):var _0x3c7d71=_0x43e33d[_0x09b7('0x3c')][_0x09b7('0x42')](',')[_0x09b7('0x13')](function(_0x57d367){return Number(_0x57d367);});var _0x334abb=parseTagParameter(_0x3c7d71);_0x4cac2a[_0x09b7('0x4a')][_0x09b7('0x4b')][_0x09b7('0x4c')](_0x334abb);_0x4cac2a[_0x09b7('0x4a')]['ids']=_0x3c7d71;break;case _0x09b7('0x4d'):if(_0x43e33d[_0x09b7('0x40')]==='$substring'){_0x4cac2a[_0x09b7('0x4e')][_0x8f18a1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x43e33d[_0x09b7('0x3c')]+'%',null);}else{_0x12d292=_[_0x09b7('0x39')](_0x25287c,[_0x09b7('0xa'),_0x09b7('0x4f')]);_0x43e33d['field']=_0x09b7('0x4f');_0x44c628=as[_0x09b7('0x3a')](_0x190db2,_0x12d292[_0x09b7('0x3b')],_0x43e33d);_0x4cac2a[_0x09b7('0x4e')][_0x8f18a1](_0x44c628[_0x09b7('0x47')],_0x44c628['value']['start'],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);}break;case'body':case _0x09b7('0x50'):_0x44c628=as[_0x09b7('0x3a')]('me',null,_0x43e33d);_0x4cac2a[_0x09b7('0x51')][_0x8f18a1](_0x44c628['text'],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x48')],_0x44c628[_0x09b7('0x3c')][_0x09b7('0x3d')]);break;}}}return _0x4cac2a;}function parseModelFields(_0x3200a9,_0x58c0c5,_0x2d71cc){var _0x25d7fe=utils['getAccountFK'](_0x3200a9);var _0x41ec76=squel['expr']();var _0xf108c0=_(_0x58c0c5)[_0x09b7('0x52')]()[_0x09b7('0x13')](function(_0x2024be){return _['some'](_0x2d71cc,[_0x09b7('0xa'),_0x2024be])?_0x2024be:undefined;})[_0x09b7('0x53')]()[_0x09b7('0x3c')]();if(_0xf108c0[_0x09b7('0x38')]>0x0){_0xf108c0['forEach'](function(_0x49089a){if(_0x49089a===_0x25d7fe){_0x41ec76[_0x09b7('0x4c')]('i.'+_0x25d7fe+_0x09b7('0x12'),[][_0x09b7('0x54')](_0x58c0c5[_0x49089a]));}else if(_0x49089a===_0x09b7('0x55')){var _0x4c2db4=JSON[_0x09b7('0x56')](_0x58c0c5[_0x49089a])['$gte'];var _0xe0012=JSON['parse'](_0x58c0c5[_0x49089a])[_0x09b7('0x57')];_0x41ec76[_0x09b7('0x4c')](_0x09b7('0x58'),_0x4c2db4,_0xe0012);}else{if(_0x58c0c5[_0x49089a]===_0x09b7('0x59')){_0x41ec76[_0x09b7('0x4c')]('i.'+_0x49089a+_0x09b7('0x5a'));}else{_0x41ec76[_0x09b7('0x4c')]('i.'+_0x49089a+_0x09b7('0x5b'),_0x58c0c5[_0x49089a]);}}});}return _0x41ec76;}function parseQueryParameters(_0x1beeb7,_0x4cf033,_0x20a096){var _0x1c6e3b=getSqlClauses();return Promise[_0x09b7('0x5c')]()[_0x09b7('0x5d')](function(){return parseModelFields(_0x1beeb7,_0x4cf033,_0x20a096);})['then'](function(_0x4d3c9c){_0x1c6e3b[_0x09b7('0x5e')][_0x09b7('0x4c')](_0x4d3c9c);return parseReadParameter(_0x4cf033[_0x09b7('0x3f')]);})[_0x09b7('0x5d')](function(_0x24b685){_0x1c6e3b[_0x09b7('0x3f')]['and'](_0x24b685);return parseTagParameter(_0x4cf033[_0x09b7('0x5f')]);})[_0x09b7('0x5d')](function(_0x3cd452){_0x1c6e3b[_0x09b7('0x4a')]['clause']['and'](_0x3cd452);return parseSearchFilter(_0x1beeb7,_0x4cf033['filter']);})['then'](function(_0x191365){_0x1c6e3b[_0x09b7('0x60')]=_0x191365;return _0x1c6e3b;});}function checkAccountsRestrictions(_0x301654,_0xffa14b,_0x41a4d0){var _0x5dd0da=utils[_0x09b7('0x61')](_0x301654);var _0xdff095=_0x09b7('0x62')+_['capitalize'](_0x301654)+(_0x301654===_0x09b7('0x63')?_0x09b7('0x64'):_0x09b7('0x65'));var _0x11daf9=squel[_0x09b7('0x24')]();return Promise[_0x09b7('0x5c')]()[_0x09b7('0x5d')](function(){if(_0x41a4d0['search']&&_0xffa14b['role']==='agent'){return _0xffa14b[_0xdff095]({'attributes':['id'],'raw':!![]});}})[_0x09b7('0x5d')](function(_0x4597c0){if(_0x4597c0){if(_0x4597c0[_0x09b7('0x38')]===0x0){_0x11daf9[_0x09b7('0x4c')]('i.'+_0x5dd0da+_0x09b7('0x5a'));}else{_0x11daf9['and']('i.'+_0x5dd0da+_0x09b7('0x12'),_[_0x09b7('0x13')](_0x4597c0,'id'));}}else if(!_0x41a4d0[_0x5dd0da]){_0x11daf9[_0x09b7('0x4c')]('i.'+_0x5dd0da+_0x09b7('0x66'));}})['then'](function(){return _0x11daf9;});}function getClosedOrderClause(_0x3f9aff,_0x41dff1){var _0x50e349='';var _0x1b34a9=[_0x09b7('0x67'),_0x09b7('0x68'),_0x09b7('0x69')];if(_0x3f9aff===_0x09b7('0x2f')){_0x1b34a9['unshift'](_0x09b7('0x6a'));}if(_0x41dff1[_0x09b7('0x6b')]==='0'&&_0x3f9aff==='mail'){_0x50e349=_0x09b7('0x6a');}else{if(_0x41dff1['closed']==='1'){_0x1b34a9['shift']();}_0x50e349='CONCAT_WS(\x27\x27,\x20'+_0x1b34a9['join'](',\x20')+')';}return _0x50e349;}function getFilteredInteractions(_0x57bd29,_0x17a8fa,_0x516500,_0x6ebc08){var _0x18808d=utils[_0x09b7('0x15')](_0x57bd29);var _0x2d26dd=_[_0x09b7('0x6c')](_0x57bd29)+'Interaction';var _0x279cd6=[];var _0x18f35b=getTagsQuery();var _0x1773a5={'type':db[_0x09b7('0x6d')]['QueryTypes']['SELECT'],'raw':!![]};var _0x38526c=[];var _0x1b1db5=[];return db[_0x09b7('0x6e')]['query'](_0x18f35b['toString'](),_0x1773a5)[_0x09b7('0x5d')](function(_0x2e45aa){_0x279cd6=_[_0x09b7('0x6f')](_0x2e45aa,'id');_0x1773a5=_[_0x09b7('0x70')](_0x1773a5,{'model':db[_0x2d26dd],'mapToModel':!![],'nest':!![]});if(_0x516500['fields']){_0x6ebc08['attributes'][_0x09b7('0x71')](function(_0x5b6e7c){_0x17a8fa['field']('i.'+_0x5b6e7c);});}else{_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x72'),_0x09b7('0x3e'));_0x17a8fa[_0x09b7('0x9')]('a.key',_0x09b7('0x73'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x74'),_0x09b7('0x75'));if(_0x57bd29===_0x09b7('0x2f')){_0x17a8fa['field'](_0x09b7('0x76'),'Account.email');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x77'),'contactName');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x78'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x79'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7a'));_0x17a8fa['field'](_0x09b7('0x7b'));_0x17a8fa['field'](_0x09b7('0x7c'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7d'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7e'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x7f'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x80'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x69'));_0x17a8fa['field'](_0x09b7('0x68'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x67'));_0x17a8fa[_0x09b7('0x9')]('i.substatus');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x81'));_0x17a8fa['field'](_0x09b7('0x82'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x83'));_0x17a8fa['field'](_0x09b7('0x84'));}else if(_0x57bd29==='openchannel'){_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x85'),_0x09b7('0x86'));}else{_0x17a8fa['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x09b7('0x86'));}if(_0x57bd29!==_0x09b7('0x2f')){_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x87'));}_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x88'),'Contact.firstName');_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x89'),_0x09b7('0x8a'));_0x17a8fa[_0x09b7('0x9')]('c.email',_0x09b7('0x8b'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x8c'),'Contact.phone');_0x17a8fa[_0x09b7('0x9')]('c.mobile',_0x09b7('0x8d'));_0x17a8fa['field'](_0x09b7('0x8e'),_0x09b7('0x8f'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x90'),_0x09b7('0x91'));_0x17a8fa[_0x09b7('0x9')](_0x09b7('0x92'),_0x09b7('0x93'));_0x17a8fa[_0x09b7('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x09b7('0x94'));}if(_0x6ebc08['limit']){_0x17a8fa[_0x09b7('0x95')](_0x6ebc08['limit']);}if(_0x6ebc08[_0x09b7('0x96')]){_0x17a8fa[_0x09b7('0x96')](_0x6ebc08[_0x09b7('0x96')]);}return db['sequelize'][_0x09b7('0x97')](_0x17a8fa[_0x09b7('0x98')](),_0x1773a5);})[_0x09b7('0x5d')](function(_0x5ebb21){_0x38526c=_0x5ebb21;var _0x5705bc=getUsersQuery(_0x57bd29,_0x38526c);return db['sequelize'][_0x09b7('0x97')](_0x5705bc[_0x09b7('0x98')](),_0x1773a5);})[_0x09b7('0x5d')](function(_0x2e44df){_0x1b1db5=_[_0x09b7('0x99')](_0x2e44df,_0x18808d);if(_0x57bd29===_0x09b7('0x2f')){return db[_0x09b7('0x9a')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x09b7('0x5d')](function(_0x64a230){var _0x2da568=_0x64a230?_0x64a230[_0x09b7('0x9b')]:undefined;var _0x56d6c2=_0x38526c[_0x09b7('0x13')](function(_0x45ef57){return updateInteraction(_0x45ef57,_0x279cd6,_0x1b1db5,_0x2da568);});return Promise[_0x09b7('0x9c')](_0x56d6c2);});}function countFilteredInteractions(_0x58742a,_0x24b775){var _0x141396=_0x58742a[_0x09b7('0x9d')]();_0x141396[_0x09b7('0x9')](_0x09b7('0x9e'));_0x141396[_0x09b7('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x1b1f57=utils['getSelectedTags'](_0x24b775);if(!_['isEmpty'](_0x1b1f57)){_0x141396[_0x09b7('0x11')](_0x09b7('0x9f'),_0x1b1f57);}var _0x5a9095={'type':db[_0x09b7('0x6d')][_0x09b7('0xa0')][_0x09b7('0xa1')],'raw':!![]};return db[_0x09b7('0x6e')]['query'](_0x141396[_0x09b7('0x98')](),_0x5a9095);}module[_0x09b7('0xa2')]={'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 7f98d36..44780e0 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 _0xd392=['Tags','catch','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged','abandoned','total','disposition','answered','UserId','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','updateInteraction','Users','TagIds','then'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xd392,0x110));var _0x2d39=function(_0xd842b0,_0x3c1a6a){_0xd842b0=_0xd842b0-0x0;var _0x2e41f7=_0xd392[_0xd842b0];return _0x2e41f7;};'use strict';var _=require(_0x2d39('0x0'));var db=require(_0x2d39('0x1'))['db'];function getInteractionUsers(_0x96bc3a,_0x4a8025){return new Promise(function(_0x3c5293,_0x4f94bf){try{var _0xdac068=[];if(_0x4a8025[_0x96bc3a]){_0xdac068=_0x4a8025[_0x96bc3a][_0x2d39('0x2')](function(_0x46ad16){return{'id':_0x46ad16['id'],'fullname':_0x46ad16[_0x2d39('0x3')]};});}return _0x3c5293(_0xdac068);}catch(_0x71a1b0){_0x4f94bf(_0x71a1b0);}});}function getInteractionTags(_0xbfd386,_0x5b308d){var _0x5cb721=[];if(_0xbfd386){_0xbfd386[_0x2d39('0x4')](',')[_0x2d39('0x5')](function(_0x4b8b47){_0x5cb721[_0x2d39('0x6')](_0x5b308d[_0x4b8b47]);});}return _0x5cb721;}function updateWaitingCounter(_0x1aeeab){if(_0x1aeeab[_0x2d39('0x7')]){_0x1aeeab[_0x2d39('0x7')]-=0x1;}}function updateInteractionCounters(_0x2fd4b6){_0x2fd4b6[_0x2d39('0x7')]=0x0;_0x2fd4b6[_0x2d39('0x8')]=0x0;_0x2fd4b6['answered']=0x0;_0x2fd4b6[_0x2d39('0x9')]=0x0;_0x2fd4b6[_0x2d39('0xa')]=0x0;_0x2fd4b6[_0x2d39('0xb')]=0x0;if(_0x2fd4b6['closed']){if(_0x2fd4b6[_0x2d39('0xc')]===_0x2d39('0xa')){_0x2fd4b6[_0x2d39('0xa')]+=0x1;updateWaitingCounter(_0x2fd4b6);}if(_0x2fd4b6['UserId']){_0x2fd4b6[_0x2d39('0xd')]+=0x1;if(_0x2fd4b6[_0x2d39('0x8')]){_0x2fd4b6[_0x2d39('0x8')]-=0x1;}}else{if(_0x2fd4b6[_0x2d39('0xc')]){_0x2fd4b6['unmanaged']+=0x1;updateWaitingCounter(_0x2fd4b6);}}}else{if(!_0x2fd4b6['UserId']){_0x2fd4b6[_0x2d39('0x7')]+=0x1;}if(_0x2fd4b6[_0x2d39('0xe')]){_0x2fd4b6[_0x2d39('0x8')]+=0x1;updateWaitingCounter(_0x2fd4b6);}}_0x2fd4b6[_0x2d39('0xb')]+=0x1;return _0x2fd4b6;}function getLastMessageText(_0x2de197){return db[_0x2d39('0xf')][_0x2d39('0x10')]({'where':{'$and':[{'MailInteractionId':_0x2de197['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2d39('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2d39('0x12')],'order':'-id','raw':!![]})['then'](function(_0x49a3bd){if(_0x49a3bd&&_0x49a3bd['plainBody']){_0x2de197[_0x2d39('0x13')]=_[_0x2d39('0x14')](_0x49a3bd[_0x2d39('0x12')]);}return _0x2de197;})['catch'](function(_0x478755){throw _0x478755;});}exports[_0x2d39('0x15')]=function(_0x5cecd8,_0xf00f78,_0x252b18,_0x148591){return new Promise(function(_0x131399,_0xecd1e){return getInteractionUsers(_0x5cecd8['id'],_0x252b18)['then'](function(_0x5d12f3){_0x5cecd8[_0x2d39('0x16')]=_0x5d12f3;return getInteractionTags(_0x5cecd8[_0x2d39('0x17')],_0xf00f78);})[_0x2d39('0x18')](function(_0x30ca28){_0x5cecd8[_0x2d39('0x19')]=_0x30ca28;delete _0x5cecd8[_0x2d39('0x17')];return updateInteractionCounters(_0x5cecd8);})['then'](function(_0x1abbec){if(_0x148591){return getLastMessageText(_0x1abbec);}else{return _0x1abbec;}})['then'](function(_0xc0241f){_0x131399(_0xc0241f);})[_0x2d39('0x1a')](function(_0x1a74dd){_0xecd1e(_0x1a74dd);});});}; \ No newline at end of file +var _0x817b=['MailMessage','findOne','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','../../mysqldb','map','fullname','forEach','waiting','talking','answered','unmanaged','closed','disposition','abandoned','UserId','total'];(function(_0x52961c,_0x1c7d2f){var _0x47176c=function(_0x40ca6b){while(--_0x40ca6b){_0x52961c['push'](_0x52961c['shift']());}};_0x47176c(++_0x1c7d2f);}(_0x817b,0x89));var _0xb817=function(_0x4ba730,_0x368687){_0x4ba730=_0x4ba730-0x0;var _0x49c90b=_0x817b[_0x4ba730];return _0x49c90b;};'use strict';var _=require('lodash');var db=require(_0xb817('0x0'))['db'];function getInteractionUsers(_0x40fd8a,_0x27c742){return new Promise(function(_0x58097a,_0x1a2cae){try{var _0x5900d2=[];if(_0x27c742[_0x40fd8a]){_0x5900d2=_0x27c742[_0x40fd8a][_0xb817('0x1')](function(_0x2d7185){return{'id':_0x2d7185['id'],'fullname':_0x2d7185[_0xb817('0x2')]};});}return _0x58097a(_0x5900d2);}catch(_0x557f9d){_0x1a2cae(_0x557f9d);}});}function getInteractionTags(_0x5565e2,_0x5b7dc0){var _0x2286f9=[];if(_0x5565e2){_0x5565e2['split'](',')[_0xb817('0x3')](function(_0x1a15e2){_0x2286f9['push'](_0x5b7dc0[_0x1a15e2]);});}return _0x2286f9;}function updateWaitingCounter(_0x4c8449){if(_0x4c8449[_0xb817('0x4')]){_0x4c8449[_0xb817('0x4')]-=0x1;}}function updateInteractionCounters(_0x204d67){_0x204d67[_0xb817('0x4')]=0x0;_0x204d67[_0xb817('0x5')]=0x0;_0x204d67[_0xb817('0x6')]=0x0;_0x204d67[_0xb817('0x7')]=0x0;_0x204d67['abandoned']=0x0;_0x204d67['total']=0x0;if(_0x204d67[_0xb817('0x8')]){if(_0x204d67[_0xb817('0x9')]===_0xb817('0xa')){_0x204d67[_0xb817('0xa')]+=0x1;updateWaitingCounter(_0x204d67);}if(_0x204d67[_0xb817('0xb')]){_0x204d67['answered']+=0x1;if(_0x204d67[_0xb817('0x5')]){_0x204d67[_0xb817('0x5')]-=0x1;}}else{if(_0x204d67[_0xb817('0x9')]){_0x204d67['unmanaged']+=0x1;updateWaitingCounter(_0x204d67);}}}else{if(!_0x204d67[_0xb817('0xb')]){_0x204d67[_0xb817('0x4')]+=0x1;}if(_0x204d67[_0xb817('0xb')]){_0x204d67[_0xb817('0x5')]+=0x1;updateWaitingCounter(_0x204d67);}}_0x204d67[_0xb817('0xc')]+=0x1;return _0x204d67;}function getLastMessageText(_0x20f332){return db[_0xb817('0xd')][_0xb817('0xe')]({'where':{'$and':[{'MailInteractionId':_0x20f332['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb817('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb817('0x10')],'order':'-id','raw':!![]})[_0xb817('0x11')](function(_0x5b795c){if(_0x5b795c&&_0x5b795c[_0xb817('0x10')]){_0x20f332[_0xb817('0x12')]=_[_0xb817('0x13')](_0x5b795c[_0xb817('0x10')]);}return _0x20f332;})[_0xb817('0x14')](function(_0x1c10da){throw _0x1c10da;});}exports[_0xb817('0x15')]=function(_0x509832,_0x471fc1,_0x1298f2,_0xf13cf2){return new Promise(function(_0xd38ff8,_0x5758d8){return getInteractionUsers(_0x509832['id'],_0x1298f2)[_0xb817('0x11')](function(_0x4eec17){_0x509832[_0xb817('0x16')]=_0x4eec17;return getInteractionTags(_0x509832[_0xb817('0x17')],_0x471fc1);})['then'](function(_0x49d12d){_0x509832[_0xb817('0x18')]=_0x49d12d;delete _0x509832['TagIds'];return updateInteractionCounters(_0x509832);})[_0xb817('0x11')](function(_0x3a8180){if(_0xf13cf2){return getLastMessageText(_0x3a8180);}else{return _0x3a8180;}})[_0xb817('0x11')](function(_0x524039){_0xd38ff8(_0x524039);})[_0xb817('0x14')](function(_0x383ad4){_0x5758d8(_0x383ad4);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 417e9fe..4ffb89a 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 _0xba15=['../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','accounts','_interaction_has_tags','_messages','_interactions','isArray','toUpperCase','role','stringify','null','Interaction','findOne','then','update','info','catch','lodash','../../mysqldb'];(function(_0x342a26,_0x252831){var _0x2e2ea6=function(_0x4be522){while(--_0x4be522){_0x342a26['push'](_0x342a26['shift']());}};_0x2e2ea6(++_0x252831);}(_0xba15,0x1da));var _0x5ba1=function(_0xaf9389,_0x458ea4){_0xaf9389=_0xaf9389-0x0;var _0x4ff445=_0xba15[_0xaf9389];return _0x4ff445;};'use strict';var _=require(_0x5ba1('0x0'));var db=require(_0x5ba1('0x1'))['db'];var loggers={'openchannel':require(_0x5ba1('0x2'))(_0x5ba1('0x3')),'mail':require(_0x5ba1('0x2'))(_0x5ba1('0x4')),'fax':require(_0x5ba1('0x2'))('fax-interactions'),'sms':require(_0x5ba1('0x2'))(_0x5ba1('0x5')),'chat':require(_0x5ba1('0x2'))(_0x5ba1('0x6')),'whatsapp':require(_0x5ba1('0x2'))('whatsapp-interactions')};function getAccountFK(_0x1fe7c0){return _[_0x5ba1('0x7')](_0x1fe7c0)+(_0x1fe7c0===_0x5ba1('0x8')?_0x5ba1('0x9'):_0x5ba1('0xa'))+'Id';}function getInteractionFK(_0x267429){return _[_0x5ba1('0x7')](_0x267429)+_0x5ba1('0xb');}function getInteractionId(_0xc7cb4b,_0x5e9b56,_0x3e09e4){if(_0xc7cb4b&&_0xc7cb4b[_[_0x5ba1('0xc')](_0x3e09e4)+_0x5ba1('0xb')]){return _0xc7cb4b[_[_0x5ba1('0xc')](_0x3e09e4)+_0x5ba1('0xb')];}else if(_0xc7cb4b&&_0xc7cb4b['id']){return _0xc7cb4b['id'];}else if(_0x5e9b56&&_0x5e9b56['id']){return _0x5e9b56['id'];}else{return'unknown';}}function getInteractionsTables(_0x1cd306){return{'accounts':_0x1cd306+'_'+(_0x1cd306==='chat'?'websites':_0x5ba1('0xd')),'interactions':_0x1cd306+'_interactions','interactionsTags':_0x1cd306+_0x5ba1('0xe'),'messages':_0x1cd306+_0x5ba1('0xf'),'userInteractions':'user_has_'+_0x1cd306+_0x5ba1('0x10')};}function getSelectedTags(_0x2a4b06){var _0x3f6349=[];if(_0x2a4b06){_0x3f6349=Array[_0x5ba1('0x11')](_0x2a4b06)?_0x2a4b06:[_0x2a4b06];}return _0x3f6349;}function log(_0x244dd9,_0x4da14f,_0x567edd,_0x16a7ae,_0x34e5b3,_0x274c44){loggers[_0x34e5b3['toLowerCase']()][_0x244dd9]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x274c44[_0x5ba1('0x12')](),_0x4da14f?_0x4da14f['id']:null,_0x4da14f?_0x4da14f['name']:null,_0x4da14f?_0x4da14f[_0x5ba1('0x13')]:null,getInteractionId(_0x567edd,_0x16a7ae,_0x34e5b3),_0x567edd?JSON[_0x5ba1('0x14')](_0x567edd):_0x5ba1('0x15'));}function updateUser(_0x56294d,_0x47d03c,_0x2aecc7,_0x26dd05,_0x58377e){db[_['upperFirst'](_0x26dd05)+_0x5ba1('0x16')][_0x5ba1('0x17')]({'where':{'id':getInteractionId(_0x47d03c,_0x2aecc7,_0x26dd05)}})[_0x5ba1('0x18')](function(_0xbe5c7c){if(_0xbe5c7c){return _0xbe5c7c[_0x5ba1('0x19')]({'UserId':_0x56294d?_0x56294d['id']:null});}})[_0x5ba1('0x18')](function(_0x4b5aef){if(_0x4b5aef){log(_0x5ba1('0x1a'),_0x56294d,_0x47d03c,_0x2aecc7,_0x26dd05,_0x58377e);}})[_0x5ba1('0x1b')](function(){log('error',_0x56294d,_0x47d03c,_0x2aecc7,_0x26dd05,_0x58377e);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xe70b=['websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','error','lodash','../../mysqldb','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','InteractionId','upperFirst','unknown'];(function(_0x4e6fb2,_0x3cf23e){var _0x2f1636=function(_0x53c7eb){while(--_0x53c7eb){_0x4e6fb2['push'](_0x4e6fb2['shift']());}};_0x2f1636(++_0x3cf23e);}(_0xe70b,0xb3));var _0xbe70=function(_0x1309e0,_0x1443b7){_0x1309e0=_0x1309e0-0x0;var _0x3e9feb=_0xe70b[_0x1309e0];return _0x3e9feb;};'use strict';var _=require(_0xbe70('0x0'));var db=require(_0xbe70('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xbe70('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xbe70('0x3'))(_0xbe70('0x4')),'sms':require(_0xbe70('0x3'))(_0xbe70('0x5')),'chat':require(_0xbe70('0x3'))(_0xbe70('0x6')),'whatsapp':require(_0xbe70('0x3'))(_0xbe70('0x7'))};function getAccountFK(_0x277dc0){return _[_0xbe70('0x8')](_0x277dc0)+(_0x277dc0==='chat'?_0xbe70('0x9'):'Account')+'Id';}function getInteractionFK(_0x2488a2){return _[_0xbe70('0x8')](_0x2488a2)+_0xbe70('0xa');}function getInteractionId(_0xd2a118,_0x232aad,_0x4fb3ce){if(_0xd2a118&&_0xd2a118[_[_0xbe70('0xb')](_0x4fb3ce)+_0xbe70('0xa')]){return _0xd2a118[_['upperFirst'](_0x4fb3ce)+_0xbe70('0xa')];}else if(_0xd2a118&&_0xd2a118['id']){return _0xd2a118['id'];}else if(_0x232aad&&_0x232aad['id']){return _0x232aad['id'];}else{return _0xbe70('0xc');}}function getInteractionsTables(_0x5583ba){return{'accounts':_0x5583ba+'_'+(_0x5583ba==='chat'?_0xbe70('0xd'):_0xbe70('0xe')),'interactions':_0x5583ba+_0xbe70('0xf'),'interactionsTags':_0x5583ba+_0xbe70('0x10'),'messages':_0x5583ba+_0xbe70('0x11'),'userInteractions':_0xbe70('0x12')+_0x5583ba+_0xbe70('0xf')};}function getSelectedTags(_0x309327){var _0x499e4d=[];if(_0x309327){_0x499e4d=Array[_0xbe70('0x13')](_0x309327)?_0x309327:[_0x309327];}return _0x499e4d;}function log(_0xddbb5b,_0x55f034,_0xa15de4,_0x3f8a02,_0x4909ef,_0x13c963){loggers[_0x4909ef[_0xbe70('0x14')]()][_0xddbb5b]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x13c963[_0xbe70('0x15')](),_0x55f034?_0x55f034['id']:null,_0x55f034?_0x55f034[_0xbe70('0x16')]:null,_0x55f034?_0x55f034[_0xbe70('0x17')]:null,getInteractionId(_0xa15de4,_0x3f8a02,_0x4909ef),_0xa15de4?JSON[_0xbe70('0x18')](_0xa15de4):_0xbe70('0x19'));}function updateUser(_0x128436,_0x4d221d,_0x288ce2,_0xd444d0,_0x5b2490){db[_[_0xbe70('0xb')](_0xd444d0)+_0xbe70('0x1a')][_0xbe70('0x1b')]({'where':{'id':getInteractionId(_0x4d221d,_0x288ce2,_0xd444d0)}})[_0xbe70('0x1c')](function(_0x378920){if(_0x378920){return _0x378920[_0xbe70('0x1d')]({'UserId':_0x128436?_0x128436['id']:null});}})[_0xbe70('0x1c')](function(_0x33f1b4){if(_0x33f1b4){log(_0xbe70('0x1e'),_0x128436,_0x4d221d,_0x288ce2,_0xd444d0,_0x5b2490);}})['catch'](function(){log(_0xbe70('0x1f'),_0x128436,_0x4d221d,_0x288ce2,_0xd444d0,_0x5b2490);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 403344e..0ada25f 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 _0x4070=['composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','License','findOne','then','count','json','catch','User','user','isUserLimit','crypto'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x4070,0x12b));var _0x0407=function(_0x41853f,_0xd03e22){_0x41853f=_0x41853f-0x0;var _0x14df0d=_0x4070[_0x41853f];return _0x14df0d;};'use strict';var crypto=require(_0x0407('0x0'));var util=require('util');var compose=require(_0x0407('0x1'));var db=require(_0x0407('0x2'))['db'];var config=require(_0x0407('0x3'));function getValueFromLicense(_0x1653c2,_0x2ab142){if(_0x1653c2&&_0x2ab142){if(_0x2ab142[_0x0407('0x4')]&&_0x2ab142[_0x0407('0x5')]){var _0x5edd03=_0x2ab142['data1'];var _0xdafc47=_0x2ab142['license'];var _0x1af8e7=_0x5edd03[_0x0407('0x6')]('-')[0x4];var _0x1b72a8=_0x5edd03['split']('-')[0x0];var _0x499517=crypto[_0x0407('0x7')](_0x0407('0x8'),util[_0x0407('0x9')](_0x0407('0xa'),_0x1af8e7,_0x5edd03,_0x1b72a8));var _0x30a965=_0x499517[_0x0407('0xb')](_0xdafc47,'base64',_0x0407('0xc'));_0x30a965+=_0x499517[_0x0407('0xd')](_0x0407('0xc'));var _0x2a0c9c=JSON[_0x0407('0xe')](_0x30a965);return _0x2a0c9c[_0x0407('0xf')](_0x1653c2)?_0x2a0c9c[_0x1653c2]:null;}}return null;}function isLimit(_0x4b63f5,_0x55dde1,_0x16a4bb,_0x8a17e4){var _0x26f175=_0x55dde1;return compose()['use'](function(_0x4b28a3,_0x3941ee,_0x4d6d9e){return db[_0x0407('0x10')][_0x0407('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x0407('0x12')](function(_0x2add40){var _0x17cf5d=getValueFromLicense(_0x4b63f5,_0x2add40);return _0x17cf5d?_0x17cf5d:_0x26f175;})[_0x0407('0x12')](function(_0x2d0e8c){_0x26f175=_0x2d0e8c;return _0x16a4bb[_0x0407('0x13')](_0x8a17e4);})[_0x0407('0x12')](function(_0x434ac0){if(_0x434ac0>=_0x26f175){return _0x3941ee['status'](0x193)[_0x0407('0x14')]({'message':util[_0x0407('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4b63f5)});}_0x4d6d9e();})[_0x0407('0x15')](function(_0x5dd399){_0x4d6d9e(_0x5dd399);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0407('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x0407('0x17')}]}});}exports[_0x0407('0x18')]=isUserLimit; \ No newline at end of file +var _0x5ca5=['util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','then','count','status','catch','User','admin','user','isUserLimit','crypto'];(function(_0x2267a2,_0x453e4b){var _0x1406a7=function(_0x5a0bb0){while(--_0x5a0bb0){_0x2267a2['push'](_0x2267a2['shift']());}};_0x1406a7(++_0x453e4b);}(_0x5ca5,0x1b9));var _0x55ca=function(_0x402511,_0x2f11ec){_0x402511=_0x402511-0x0;var _0x38e8ed=_0x5ca5[_0x402511];return _0x38e8ed;};'use strict';var crypto=require(_0x55ca('0x0'));var util=require(_0x55ca('0x1'));var compose=require(_0x55ca('0x2'));var db=require(_0x55ca('0x3'))['db'];var config=require(_0x55ca('0x4'));function getValueFromLicense(_0x4dfdd6,_0x5eb00e){if(_0x4dfdd6&&_0x5eb00e){if(_0x5eb00e[_0x55ca('0x5')]&&_0x5eb00e[_0x55ca('0x6')]){var _0x3da4dd=_0x5eb00e[_0x55ca('0x5')];var _0x19cff4=_0x5eb00e[_0x55ca('0x6')];var _0x2ef3f5=_0x3da4dd[_0x55ca('0x7')]('-')[0x4];var _0x332b21=_0x3da4dd['split']('-')[0x0];var _0x4b2c60=crypto['createDecipher'](_0x55ca('0x8'),util[_0x55ca('0x9')](_0x55ca('0xa'),_0x2ef3f5,_0x3da4dd,_0x332b21));var _0x536278=_0x4b2c60[_0x55ca('0xb')](_0x19cff4,_0x55ca('0xc'),'utf8');_0x536278+=_0x4b2c60[_0x55ca('0xd')](_0x55ca('0xe'));var _0xd0dcd2=JSON[_0x55ca('0xf')](_0x536278);return _0xd0dcd2[_0x55ca('0x10')](_0x4dfdd6)?_0xd0dcd2[_0x4dfdd6]:null;}}return null;}function isLimit(_0x5204aa,_0x2a7f1b,_0x1b3302,_0x3e7dba){var _0x14d7d8=_0x2a7f1b;return compose()[_0x55ca('0x11')](function(_0x59e0d9,_0xab115b,_0x57880f){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x55ca('0x12')](function(_0x5d1712){var _0x509ff0=getValueFromLicense(_0x5204aa,_0x5d1712);return _0x509ff0?_0x509ff0:_0x14d7d8;})[_0x55ca('0x12')](function(_0x41713e){_0x14d7d8=_0x41713e;return _0x1b3302[_0x55ca('0x13')](_0x3e7dba);})[_0x55ca('0x12')](function(_0x2ad81d){if(_0x2ad81d>=_0x14d7d8){return _0xab115b[_0x55ca('0x14')](0x193)['json']({'message':util[_0x55ca('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5204aa)});}_0x57880f();})[_0x55ca('0x15')](function(_0x2ab3b4){_0x57880f(_0x2ab3b4);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x55ca('0x16')],{'where':{'$or':[{'role':_0x55ca('0x17')},{'role':_0x55ca('0x18')}]}});}exports[_0x55ca('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index aeb6672..d4e5338 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 _0xcb93=['YYYY-MM-DD','CAST(','field','\x20AS\x20','castTo','text','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$startsWith','pop','utcOffset','minutes','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','split','length','shift','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0xcb93,0x13a));var _0x3cb9=function(_0x33f11f,_0x501b30){_0x33f11f=_0x33f11f-0x0;var _0x55ef2a=_0xcb93[_0x33f11f];return _0x55ef2a;};'use strict';var _=require(_0x3cb9('0x0'));var moment=require(_0x3cb9('0x1'));exports[_0x3cb9('0x2')]=function(_0x51740e){var _0x57eab0={'conditions':[]};_0x57eab0[_0x3cb9('0x3')]=_[_0x3cb9('0x4')](_0x51740e,'[$or]')?'or':_0x3cb9('0x5');var _0x306f7e=_0x51740e[_0x3cb9('0x6')](_0x3cb9('0x7'),'')['replace']('[$or]','')[_0x3cb9('0x8')]('||');for(var _0x14cc7a=0x0;_0x14cc7a<_0x306f7e[_0x3cb9('0x9')];_0x14cc7a++){var _0x4f02f2=_0x306f7e[_0x14cc7a][_0x3cb9('0x8')](':=');var _0x397e30=_0x4f02f2[0x0];var _0xf0f223=_0x4f02f2['slice'](0x1);_0xf0f223['forEach'](function(_0x480e1f){var _0x519dfd=_0x480e1f['split']('[')[_0x3cb9('0xa')]();var _0xb11015=_0x480e1f[_0x3cb9('0xb')](/\[(.*?)\]/g);_0xb11015['forEach'](function(_0x48934a){var _0x56adfa=_0x48934a['split']('[')['filter'](function(_0x540925){return _0x540925[_0x3cb9('0xc')](']')>-0x1;})[_0x3cb9('0xd')](function(_0x3af813){return _0x3af813[_0x3cb9('0x8')](']')[0x0];})[0x0];_0x57eab0[_0x3cb9('0xe')][_0x3cb9('0xf')]({'field':_0x397e30,'operator':_0x519dfd,'value':_0x56adfa});});});}return _0x57eab0;};exports[_0x3cb9('0x10')]=function(_0x511e6d,_0x46320b,_0x5d11b9){var _0x1d6444={};if(_0x46320b===_0x3cb9('0x11')){if(_0x5d11b9[_0x3cb9('0x12')]===_0x3cb9('0x13')){_0x5d11b9[_0x3cb9('0x12')]=_0x3cb9('0x14');_0x5d11b9['value']+=','+_0x5d11b9[_0x3cb9('0x15')];}else if(_[_0x3cb9('0x16')]([_0x3cb9('0x17'),_0x3cb9('0x18')],_0x5d11b9[_0x3cb9('0x12')])){_0x5d11b9[_0x3cb9('0x15')]=moment(_0x5d11b9[_0x3cb9('0x15')])[_0x3cb9('0x19')](0x1,_0x3cb9('0x1a'))[_0x3cb9('0x1b')](_0x3cb9('0x1c'));}}if(_0x5d11b9['castTo']){_0x46320b=_0x5d11b9['castTo'];_0x1d6444['text']=_0x3cb9('0x1d')+_0x511e6d+'.'+_0x5d11b9[_0x3cb9('0x1e')]+_0x3cb9('0x1f')+_0x5d11b9[_0x3cb9('0x20')]+')\x20'+parseOperator(_0x5d11b9[_0x3cb9('0x12')]);}else{_0x1d6444[_0x3cb9('0x21')]=_0x511e6d+'.'+_0x5d11b9[_0x3cb9('0x1e')]+'\x20'+parseOperator(_0x5d11b9[_0x3cb9('0x12')]);}if(_['includes']([_0x3cb9('0x22'),'$notIn'],_0x5d11b9[_0x3cb9('0x12')]))_0x1d6444[_0x3cb9('0x21')]='('+_0x1d6444[_0x3cb9('0x21')]+_0x3cb9('0x23')+_0x511e6d+'.'+_0x5d11b9[_0x3cb9('0x1e')]+_0x3cb9('0x24');_0x1d6444[_0x3cb9('0x15')]=parseValue(_0x46320b,_0x5d11b9[_0x3cb9('0x12')],_0x5d11b9[_0x3cb9('0x15')]);return _0x1d6444;};function parseOperator(_0x34a39){var _0x337ca4;switch(_0x34a39){case _0x3cb9('0x25'):_0x337ca4=_0x3cb9('0x26');break;case'$notIn':_0x337ca4=_0x3cb9('0x27');break;case _0x3cb9('0x13'):_0x337ca4=_0x3cb9('0x28');break;case'$ne':_0x337ca4=_0x3cb9('0x29');break;case _0x3cb9('0x2a'):case'$startsWith':case _0x3cb9('0x2b'):_0x337ca4=_0x3cb9('0x2c');break;case _0x3cb9('0x2d'):_0x337ca4=_0x3cb9('0x2e');break;case _0x3cb9('0x17'):_0x337ca4=_0x3cb9('0x2f');break;case _0x3cb9('0x18'):_0x337ca4='<=\x20?';break;case _0x3cb9('0x30'):_0x337ca4=_0x3cb9('0x31');break;case _0x3cb9('0x14'):_0x337ca4=_0x3cb9('0x32');break;}return _0x337ca4;}function parseValue(_0x17b18a,_0x1dbaaa,_0x273c9f){var _0x583d27={'start':undefined,'end':undefined};switch(_0x1dbaaa){case'$in':case _0x3cb9('0x33'):_0x583d27[_0x3cb9('0x34')]=_0x273c9f[_0x3cb9('0x8')](',');break;case _0x3cb9('0x2a'):_0x583d27[_0x3cb9('0x34')]='%'+_0x273c9f+'%';break;case _0x3cb9('0x35'):_0x583d27[_0x3cb9('0x34')]=_0x273c9f+'%';break;case _0x3cb9('0x2b'):_0x583d27[_0x3cb9('0x34')]='%'+_0x273c9f;break;case _0x3cb9('0x14'):var _0x2b3986=_0x273c9f[_0x3cb9('0x8')](',');var _0x273c9f=_0x2b3986[_0x3cb9('0xa')]();var _0x3bf854=_0x2b3986[_0x3cb9('0x36')]();if(_0x17b18a==='DATE'){_0x273c9f=moment(_0x273c9f)[_0x3cb9('0x37')](0x0,!![])['format']();_0x3bf854=moment(_0x3bf854)['utcOffset'](0x0,!![])[_0x3cb9('0x19')](0x17,'hours')[_0x3cb9('0x19')](0x3b,_0x3cb9('0x38'))[_0x3cb9('0x19')](0x3b,'seconds')[_0x3cb9('0x1b')]();}_0x583d27={'start':_0x273c9f,'end':_0x3bf854};break;default:_0x583d27[_0x3cb9('0x34')]=_0x273c9f;break;}return _0x583d27;} \ No newline at end of file +var _0x50c9=['NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','$gt','>\x20?','<=\x20?','>=\x20?','start','$endsWith','pop','hours','add','seconds','moment','parseSearch','and','replace','[$and]','[$or]','split','length','forEach','shift','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?'];(function(_0x59e9ff,_0x5080c3){var _0xa71d5e=function(_0x7d1718){while(--_0x7d1718){_0x59e9ff['push'](_0x59e9ff['shift']());}};_0xa71d5e(++_0x5080c3);}(_0x50c9,0x1d2));var _0x950c=function(_0xaab643,_0x14df40){_0xaab643=_0xaab643-0x0;var _0x7bab9d=_0x50c9[_0xaab643];return _0x7bab9d;};'use strict';var _=require('lodash');var moment=require(_0x950c('0x0'));exports[_0x950c('0x1')]=function(_0x4b73db){var _0x497ba6={'conditions':[]};_0x497ba6['sqlOperator']=_['startsWith'](_0x4b73db,'[$or]')?'or':_0x950c('0x2');var _0x2ac528=_0x4b73db[_0x950c('0x3')](_0x950c('0x4'),'')['replace'](_0x950c('0x5'),'')[_0x950c('0x6')]('||');for(var _0x228dcf=0x0;_0x228dcf<_0x2ac528[_0x950c('0x7')];_0x228dcf++){var _0x14352f=_0x2ac528[_0x228dcf][_0x950c('0x6')](':=');var _0xe8b997=_0x14352f[0x0];var _0x11422e=_0x14352f['slice'](0x1);_0x11422e[_0x950c('0x8')](function(_0x4e38a1){var _0x5bfb7a=_0x4e38a1['split']('[')[_0x950c('0x9')]();var _0x3205da=_0x4e38a1['match'](/\[(.*?)\]/g);_0x3205da['forEach'](function(_0x58f793){var _0x21b46e=_0x58f793[_0x950c('0x6')]('[')['filter'](function(_0x349b82){return _0x349b82[_0x950c('0xa')](']')>-0x1;})[_0x950c('0xb')](function(_0x509475){return _0x509475[_0x950c('0x6')](']')[0x0];})[0x0];_0x497ba6['conditions'][_0x950c('0xc')]({'field':_0xe8b997,'operator':_0x5bfb7a,'value':_0x21b46e});});});}return _0x497ba6;};exports[_0x950c('0xd')]=function(_0x26a398,_0x153595,_0x3032ec){var _0xc61cce={};if(_0x153595===_0x950c('0xe')){if(_0x3032ec[_0x950c('0xf')]===_0x950c('0x10')){_0x3032ec['operator']=_0x950c('0x11');_0x3032ec[_0x950c('0x12')]+=','+_0x3032ec['value'];}else if(_[_0x950c('0x13')](['$gt',_0x950c('0x14')],_0x3032ec['operator'])){_0x3032ec[_0x950c('0x12')]=moment(_0x3032ec[_0x950c('0x12')])['add'](0x1,_0x950c('0x15'))[_0x950c('0x16')](_0x950c('0x17'));}}if(_0x3032ec[_0x950c('0x18')]){_0x153595=_0x3032ec[_0x950c('0x18')];_0xc61cce[_0x950c('0x19')]=_0x950c('0x1a')+_0x26a398+'.'+_0x3032ec[_0x950c('0x1b')]+_0x950c('0x1c')+_0x3032ec[_0x950c('0x18')]+')\x20'+parseOperator(_0x3032ec[_0x950c('0xf')]);}else{_0xc61cce[_0x950c('0x19')]=_0x26a398+'.'+_0x3032ec['field']+'\x20'+parseOperator(_0x3032ec[_0x950c('0xf')]);}if(_['includes']([_0x950c('0x1d'),_0x950c('0x1e')],_0x3032ec['operator']))_0xc61cce[_0x950c('0x19')]='('+_0xc61cce[_0x950c('0x19')]+_0x950c('0x1f')+_0x26a398+'.'+_0x3032ec[_0x950c('0x1b')]+'\x20IS\x20NULL)';_0xc61cce[_0x950c('0x12')]=parseValue(_0x153595,_0x3032ec['operator'],_0x3032ec[_0x950c('0x12')]);return _0xc61cce;};function parseOperator(_0x1bfc79){var _0x3cf29a;switch(_0x1bfc79){case _0x950c('0x20'):_0x3cf29a=_0x950c('0x21');break;case _0x950c('0x1e'):_0x3cf29a=_0x950c('0x22');break;case _0x950c('0x10'):_0x3cf29a='=\x20?';break;case _0x950c('0x1d'):_0x3cf29a=_0x950c('0x23');break;case _0x950c('0x24'):case _0x950c('0x25'):case'$endsWith':_0x3cf29a=_0x950c('0x26');break;case _0x950c('0x27'):_0x3cf29a='<\x20?';break;case _0x950c('0x28'):_0x3cf29a=_0x950c('0x29');break;case'$lte':_0x3cf29a=_0x950c('0x2a');break;case'$gte':_0x3cf29a=_0x950c('0x2b');break;case'$between':_0x3cf29a='BETWEEN\x20?\x20AND\x20?';break;}return _0x3cf29a;}function parseValue(_0x5262c7,_0x2ced36,_0x25cf61){var _0x363b5a={'start':undefined,'end':undefined};switch(_0x2ced36){case _0x950c('0x20'):case'$notIn':_0x363b5a[_0x950c('0x2c')]=_0x25cf61[_0x950c('0x6')](',');break;case _0x950c('0x24'):_0x363b5a[_0x950c('0x2c')]='%'+_0x25cf61+'%';break;case _0x950c('0x25'):_0x363b5a['start']=_0x25cf61+'%';break;case _0x950c('0x2d'):_0x363b5a[_0x950c('0x2c')]='%'+_0x25cf61;break;case _0x950c('0x11'):var _0x57a67b=_0x25cf61['split'](',');var _0x25cf61=_0x57a67b[_0x950c('0x9')]();var _0x3e0dfc=_0x57a67b[_0x950c('0x2e')]();if(_0x5262c7===_0x950c('0xe')){_0x25cf61=moment(_0x25cf61)['utcOffset'](0x0,!![])[_0x950c('0x16')]();_0x3e0dfc=moment(_0x3e0dfc)['utcOffset'](0x0,!![])['add'](0x17,_0x950c('0x2f'))[_0x950c('0x30')](0x3b,'minutes')[_0x950c('0x30')](0x3b,_0x950c('0x31'))[_0x950c('0x16')]();}_0x363b5a={'start':_0x25cf61,'end':_0x3e0dfc};break;default:_0x363b5a['start']=_0x25cf61;break;}return _0x363b5a;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 37ac479..eb9eaff 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 _0x6877=['offset','map','indexOf','cast','col','priority','substr','DESC','ASC','isArray','omit','isString','length','unset','hasOwnProperty','match','^[+]?[0-9]*$','getFullTextValue','{EXPR}','forEach','replace','getOptions','query','$id','intersection','attributes','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','lower','options','includeAll','push','include','lodash','sequelize','moment','parse','keys','includes','model','alias','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','subtract','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6877,0xa4));var _0x7687=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x6877[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require(_0x7687('0x0'));var sequelize=require(_0x7687('0x1'));var moment=require(_0x7687('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3bb9ef){var _0x4dab10=['ne'];try{var _0x397a02=JSON[_0x7687('0x3')](_0x3bb9ef);var _0x1ac744=Object[_0x7687('0x4')](_0x397a02)[0x0];return _0x4dab10[_0x7687('0x5')](_0x1ac744);}catch(_0x5d4147){return![];}}function getOperatorValue(_0x3db535){var _0x234f7b=JSON['parse'](_0x3db535);var _0x4cfc34=Object[_0x7687('0x4')](_0x234f7b)[0x0];var _0x14e385=_0x234f7b[_0x4cfc34];return{['$'+_0x4cfc34]:_0x14e385};}function parseIncludeModel(_0x5a88d4){var _0x3e1b86=JSON[_0x7687('0x3')](_0x5a88d4);return{'model':db[_0x3e1b86[_0x7687('0x6')]],'as':_0x3e1b86[_0x7687('0x7')],'attributes':_0x3e1b86[_0x7687('0x8')],'raw':_0x3e1b86['raw']};}exports[_0x7687('0x8')]=function(_0x420fb8){var _0x4d5cb1=null;if(_0x420fb8){_0x4d5cb1=_0x420fb8[_0x7687('0x9')](',');}return _0x4d5cb1;};exports[_0x7687('0xa')]=function(_0x1e0de0,_0x52cd3a){var _0x204920={};if(!_[_0x7687('0xb')](_0x1e0de0)){_[_0x7687('0xc')](_0x1e0de0,function(_0x532e7f,_0x54d4dd){try{if(_0x52cd3a){var _0x26fa2a=_['find'](_0x52cd3a,{'name':_0x54d4dd})||{};if(hasSequelizeOperator(_0x532e7f)){_0x204920[_0x54d4dd]=getOperatorValue(_0x532e7f);}else if(_0x26fa2a[_0x7687('0xd')]===_0x7687('0xe')&&_[_0x7687('0xf')](_0x532e7f)){var _0x40e990=JSON[_0x7687('0x3')](_0x532e7f);var _0x1147bf={'$gte':moment(moment(_0x40e990[_0x7687('0x10')])['format']('YYYY-MM-DD'))['utc']()[_0x7687('0x11')](),'$lte':moment(moment(_0x40e990[_0x7687('0x12')])[_0x7687('0x11')](_0x7687('0x13')))['utc']()[_0x7687('0x14')](0x1,'s')[_0x7687('0x11')]()};_0x204920[_0x54d4dd]=_0x1147bf;}else if(_0x26fa2a[_0x7687('0x15')]==='uniqueid'){_0x204920[_0x54d4dd]=_0x532e7f;}else{_0x204920[_0x54d4dd]=_['isArray'](_0x532e7f)?_0x532e7f:JSON['parse'](_0x532e7f);}}else{_0x204920[_0x54d4dd]=_['isArray'](_0x532e7f)?_0x532e7f:JSON[_0x7687('0x3')](_0x532e7f);}}catch(_0x297d15){_0x204920[_0x54d4dd]=_0x532e7f[_0x7687('0x9')](',');}});}return _0x204920;};exports['limit']=function(_0x5cbc95){_0x5cbc95=parseInt(_0x5cbc95,0xa);if(!_0x5cbc95||_0x5cbc95<0x0){_0x5cbc95=LIMIT_VALUE;}return _0x5cbc95;};exports[_0x7687('0x16')]=function(_0x5c95f5){_0x5c95f5=parseInt(_0x5c95f5,0xa);if(!_0x5c95f5||_0x5c95f5<0x0){_0x5c95f5=0x0;}return _0x5c95f5;};exports['sort']=function(_0x33d8b5){var _0x21df81,_0x58feb0=null;if(_0x33d8b5){_0x21df81=_0x33d8b5[_0x7687('0x9')](',');_0x58feb0=_[_0x7687('0x17')](_0x21df81,function(_0x4b3be9){if(_0x4b3be9[_0x7687('0x18')]('-')===0x0){return[_0x4b3be9==='priority'?sequelize[_0x7687('0x19')](sequelize[_0x7687('0x1a')](_0x7687('0x1b')),'unsigned'):_0x4b3be9[_0x7687('0x1c')](0x1),_0x7687('0x1d')];}else{return[_0x4b3be9===_0x7687('0x1b')?sequelize[_0x7687('0x19')](sequelize[_0x7687('0x1a')](_0x7687('0x1b')),'unsigned'):_0x4b3be9,_0x7687('0x1e')];}});}return _0x58feb0;};exports['omit']=function(_0x46f2c6,_0x2d3e37){if(_['isEmpty'](_0x46f2c6)){return _0x46f2c6;}if(_[_0x7687('0x1f')](_0x46f2c6)){for(var _0x2c7a0f=0x0;_0x2c7a0f<_0x46f2c6['length'];_0x2c7a0f+=0x1){_0x46f2c6[_0x2c7a0f]=this[_0x7687('0x20')](_0x46f2c6[_0x2c7a0f],_0x2d3e37);}return _0x46f2c6;}if(!_['isObject'](_0x46f2c6)){return _0x46f2c6;}if(_[_0x7687('0x21')](_0x2d3e37)){_0x2d3e37=[_0x2d3e37];}if(!_['isArray'](_0x2d3e37)){return _0x46f2c6;}for(var _0x329668=0x0;_0x329668<_0x2d3e37[_0x7687('0x22')];_0x329668+=0x1){_[_0x7687('0x23')](_0x46f2c6,_0x2d3e37[_0x329668]);}for(var _0xe18cfe in _0x46f2c6){if(_0x46f2c6[_0x7687('0x24')](_0xe18cfe)){_0x46f2c6[_0xe18cfe]=this[_0x7687('0x20')](_0x46f2c6[_0xe18cfe],_0x2d3e37);}}return _0x46f2c6;};exports['isNumeric']=function(_0x244719){return _0x244719[_0x7687('0x25')](RegExp(_0x7687('0x26')))?!![]:![];};exports['isEmail']=function(_0x3d0230){return _0x3d0230[_0x7687('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x7687('0x27')]=function(_0x5a5f1e,_0x327b5a){var _0x458a48=[];var _0x3c9a52=/[ `!@#$%^&*()_\-?~]/;var _0x3c974c=_0x327b5a?'\x22{EXPR}\x22':_0x7687('0x28');_0x5a5f1e[_0x7687('0x9')](/[ ,]+/)[_0x7687('0x29')](function(_0x1c16c4){_0x1c16c4=_0x1c16c4[_0x7687('0x2a')](/([^:]")"+/g,'$1');_0x1c16c4='+'+_0x1c16c4+'*';var _0x99462e=_0x1c16c4[_0x7687('0x25')](_0x3c9a52);if(_0x99462e){_0x1c16c4='\x22'+_0x1c16c4+'\x22';}_0x458a48['push'](_0x1c16c4);});_0x3c974c=_0x3c974c[_0x7687('0x2a')](_0x7687('0x28'),_0x458a48['join']('\x20'));return _0x3c974c;};exports[_0x7687('0x2b')]=function(_0x599317,_0x46e81c,_0x4b24f9){var _0x114380={},_0x120e64={};if(_0x46e81c['query']['$id']){_0x46e81c[_0x7687('0x2c')]['id']=_0x46e81c['query'][_0x7687('0x2d')];delete _0x46e81c['query'][_0x7687('0x2d')];}_0x114380[_0x7687('0x6')]=_[_0x7687('0x17')](_0x599317,_0x7687('0x15'));_0x114380[_0x7687('0x2c')]=_[_0x7687('0x4')](_0x46e81c['query']);_0x114380[_0x7687('0xa')]=_[_0x7687('0x2e')](_0x114380[_0x7687('0x6')],_0x114380['query']);_0x120e64[_0x7687('0x2f')]=_[_0x7687('0x2e')](_0x114380['model'],this[_0x7687('0x8')](_0x46e81c[_0x7687('0x2c')][_0x7687('0x8')]));_0x120e64['attributes']=_0x120e64['attributes'][_0x7687('0x22')]?_0x120e64[_0x7687('0x2f')]:_0x114380[_0x7687('0x6')];if(!_0x46e81c[_0x7687('0x2c')][_0x7687('0x24')](_0x7687('0x30'))){_0x120e64[_0x7687('0x31')]=this[_0x7687('0x31')](_0x46e81c[_0x7687('0x2c')][_0x7687('0x31')]);_0x120e64[_0x7687('0x16')]=this[_0x7687('0x16')](_0x46e81c[_0x7687('0x2c')]['offset']);}_0x120e64[_0x7687('0x32')]=this[_0x7687('0x33')](_0x46e81c[_0x7687('0x2c')][_0x7687('0x33')]);_0x120e64[_0x7687('0x34')]=this[_0x7687('0xa')](_[_0x7687('0x35')](_0x46e81c[_0x7687('0x2c')],_0x114380[_0x7687('0xa')]),_0x599317);if(_0x46e81c[_0x7687('0x2c')][_0x7687('0x36')]){var _0x186ec8=_0x599317;var _0x5531d9=_0x46e81c[_0x7687('0x2c')][_0x7687('0x36')];if(typeof _0x5531d9==='object'){_0x186ec8=_[_0x7687('0x36')](_0x599317,function(_0x972fc9){return _[_0x7687('0x5')](_0x5531d9['columns'],_0x972fc9[_0x7687('0x15')]);});_0x5531d9=_0x5531d9['value'];}_0x120e64[_0x7687('0x34')]=_[_0x7687('0x37')](_0x120e64['where'],{'$or':_[_0x7687('0x17')](_0x186ec8,function(_0x1e8774){if(_0x1e8774[_0x7687('0xd')]!==_0x7687('0x38')){if(_0x4b24f9){return sequelize['where'](sequelize['fn'](_0x7687('0x39'),sequelize[_0x7687('0x1a')](_0x1e8774['name'])),{'$like':sequelize['fn'](_0x7687('0x39'),'%'+_0x46e81c['query'][_0x7687('0x36')]+'%')});}else{var _0x372be7={};_0x372be7[_0x1e8774[_0x7687('0x15')]]={'$like':'%'+_0x46e81c[_0x7687('0x2c')][_0x7687('0x36')]+'%'};return _0x372be7;}}})});}_0x120e64=_[_0x7687('0x37')]({},_0x120e64,_0x46e81c[_0x7687('0x3a')]);return _0x120e64;};exports['include']=function(_0x2cb57f){var _0x452fe6=[];if(_0x2cb57f[_0x7687('0x3b')]){_0x452fe6[_0x7687('0x3c')]({'all':!![]});}else if(_0x2cb57f[_0x7687('0x3d')]){if(Array[_0x7687('0x1f')](_0x2cb57f[_0x7687('0x3d')])){_0x452fe6=Object[_0x7687('0x4')](_0x2cb57f[_0x7687('0x3d')])['map'](function(_0x1787c5){return parseIncludeModel(_0x2cb57f[_0x7687('0x3d')][_0x1787c5]);});}else{var _0x4c73a8=parseIncludeModel(_0x2cb57f[_0x7687('0x3d')]);_0x452fe6[_0x7687('0x3c')](_0x4c73a8);}}return _0x452fe6;}; \ No newline at end of file +var _0x34af=['intersection','attributes','nolimit','offset','where','pick','filter','object','includes','value','merge','VIRTUAL','lower','options','push','include','lodash','sequelize','moment','../../mysqldb','parse','keys','model','raw','fields','isEmpty','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','name','isArray','limit','sort','split','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','getOptions','query','$id','filters'];(function(_0x889daa,_0x22527c){var _0x267d0b=function(_0x33af1e){while(--_0x33af1e){_0x889daa['push'](_0x889daa['shift']());}};_0x267d0b(++_0x22527c);}(_0x34af,0x18a));var _0xf34a=function(_0x3268eb,_0x978d){_0x3268eb=_0x3268eb-0x0;var _0x5c8671=_0x34af[_0x3268eb];return _0x5c8671;};'use strict';var _=require(_0xf34a('0x0'));var sequelize=require(_0xf34a('0x1'));var moment=require(_0xf34a('0x2'));var db=require(_0xf34a('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x46faf4){var _0x2b9d0e=['ne'];try{var _0x13e438=JSON[_0xf34a('0x4')](_0x46faf4);var _0x2628dd=Object['keys'](_0x13e438)[0x0];return _0x2b9d0e['includes'](_0x2628dd);}catch(_0xe0e643){return![];}}function getOperatorValue(_0x509e73){var _0x3f72fd=JSON[_0xf34a('0x4')](_0x509e73);var _0x3431da=Object[_0xf34a('0x5')](_0x3f72fd)[0x0];var _0x29cbe8=_0x3f72fd[_0x3431da];return{['$'+_0x3431da]:_0x29cbe8};}function parseIncludeModel(_0x4d751c){var _0x1254ab=JSON[_0xf34a('0x4')](_0x4d751c);return{'model':db[_0x1254ab[_0xf34a('0x6')]],'as':_0x1254ab['alias'],'attributes':_0x1254ab['fields'],'raw':_0x1254ab[_0xf34a('0x7')]};}exports[_0xf34a('0x8')]=function(_0x20f48f){var _0x362d58=null;if(_0x20f48f){_0x362d58=_0x20f48f['split'](',');}return _0x362d58;};exports['filters']=function(_0x51d289,_0x59268e){var _0x4c3809={};if(!_[_0xf34a('0x9')](_0x51d289)){_['forOwn'](_0x51d289,function(_0x3f2bd6,_0x404eac){try{if(_0x59268e){var _0x4138a1=_['find'](_0x59268e,{'name':_0x404eac})||{};if(hasSequelizeOperator(_0x3f2bd6)){_0x4c3809[_0x404eac]=getOperatorValue(_0x3f2bd6);}else if(_0x4138a1[_0xf34a('0xa')]===_0xf34a('0xb')&&_['isPlainObject'](_0x3f2bd6)){var _0xd3c703=JSON[_0xf34a('0x4')](_0x3f2bd6);var _0xffa111={'$gte':moment(moment(_0xd3c703[_0xf34a('0xc')])[_0xf34a('0xd')](_0xf34a('0xe')))[_0xf34a('0xf')]()[_0xf34a('0xd')](),'$lte':moment(moment(_0xd3c703['$lte'])['format']('YYYY-MM-DD'))[_0xf34a('0xf')]()[_0xf34a('0x10')](0x1,'s')[_0xf34a('0xd')]()};_0x4c3809[_0x404eac]=_0xffa111;}else if(_0x4138a1[_0xf34a('0x11')]==='uniqueid'){_0x4c3809[_0x404eac]=_0x3f2bd6;}else{_0x4c3809[_0x404eac]=_[_0xf34a('0x12')](_0x3f2bd6)?_0x3f2bd6:JSON[_0xf34a('0x4')](_0x3f2bd6);}}else{_0x4c3809[_0x404eac]=_[_0xf34a('0x12')](_0x3f2bd6)?_0x3f2bd6:JSON[_0xf34a('0x4')](_0x3f2bd6);}}catch(_0x2ec3d0){_0x4c3809[_0x404eac]=_0x3f2bd6['split'](',');}});}return _0x4c3809;};exports[_0xf34a('0x13')]=function(_0x4dbbf9){_0x4dbbf9=parseInt(_0x4dbbf9,0xa);if(!_0x4dbbf9||_0x4dbbf9<0x0){_0x4dbbf9=LIMIT_VALUE;}return _0x4dbbf9;};exports['offset']=function(_0x4594d3){_0x4594d3=parseInt(_0x4594d3,0xa);if(!_0x4594d3||_0x4594d3<0x0){_0x4594d3=0x0;}return _0x4594d3;};exports[_0xf34a('0x14')]=function(_0x358edf){var _0x5ececc,_0x10e2ff=null;if(_0x358edf){_0x5ececc=_0x358edf[_0xf34a('0x15')](',');_0x10e2ff=_[_0xf34a('0x16')](_0x5ececc,function(_0xc8225a){if(_0xc8225a[_0xf34a('0x17')]('-')===0x0){return[_0xc8225a===_0xf34a('0x18')?sequelize['cast'](sequelize[_0xf34a('0x19')]('priority'),_0xf34a('0x1a')):_0xc8225a[_0xf34a('0x1b')](0x1),_0xf34a('0x1c')];}else{return[_0xc8225a===_0xf34a('0x18')?sequelize[_0xf34a('0x1d')](sequelize[_0xf34a('0x19')](_0xf34a('0x18')),'unsigned'):_0xc8225a,_0xf34a('0x1e')];}});}return _0x10e2ff;};exports['omit']=function(_0x18d936,_0xa6c0b2){if(_[_0xf34a('0x9')](_0x18d936)){return _0x18d936;}if(_[_0xf34a('0x12')](_0x18d936)){for(var _0x43ef3d=0x0;_0x43ef3d<_0x18d936[_0xf34a('0x1f')];_0x43ef3d+=0x1){_0x18d936[_0x43ef3d]=this['omit'](_0x18d936[_0x43ef3d],_0xa6c0b2);}return _0x18d936;}if(!_[_0xf34a('0x20')](_0x18d936)){return _0x18d936;}if(_[_0xf34a('0x21')](_0xa6c0b2)){_0xa6c0b2=[_0xa6c0b2];}if(!_[_0xf34a('0x12')](_0xa6c0b2)){return _0x18d936;}for(var _0x140d9a=0x0;_0x140d9a<_0xa6c0b2['length'];_0x140d9a+=0x1){_[_0xf34a('0x22')](_0x18d936,_0xa6c0b2[_0x140d9a]);}for(var _0x23465e in _0x18d936){if(_0x18d936[_0xf34a('0x23')](_0x23465e)){_0x18d936[_0x23465e]=this['omit'](_0x18d936[_0x23465e],_0xa6c0b2);}}return _0x18d936;};exports[_0xf34a('0x24')]=function(_0x5e3b35){return _0x5e3b35[_0xf34a('0x25')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xf34a('0x26')]=function(_0x1fa2a3){return _0x1fa2a3['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xf34a('0x27')]=function(_0x1c609e,_0x2b955c){var _0x4bdb13=[];var _0x24ae63=/[ `!@#$%^&*()_\-?~]/;var _0x4d056f=_0x2b955c?_0xf34a('0x28'):_0xf34a('0x29');_0x1c609e[_0xf34a('0x15')](/[ ,]+/)['forEach'](function(_0x39b377){_0x39b377=_0x39b377[_0xf34a('0x2a')](/([^:]")"+/g,'$1');_0x39b377='+'+_0x39b377+'*';var _0x3dc5ed=_0x39b377['match'](_0x24ae63);if(_0x3dc5ed){_0x39b377='\x22'+_0x39b377+'\x22';}_0x4bdb13['push'](_0x39b377);});_0x4d056f=_0x4d056f[_0xf34a('0x2a')]('{EXPR}',_0x4bdb13['join']('\x20'));return _0x4d056f;};exports[_0xf34a('0x2b')]=function(_0x821dd0,_0x1fc999,_0x1e3f44){var _0x903f64={},_0x1d20d7={};if(_0x1fc999[_0xf34a('0x2c')]['$id']){_0x1fc999[_0xf34a('0x2c')]['id']=_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x2d')];delete _0x1fc999[_0xf34a('0x2c')][_0xf34a('0x2d')];}_0x903f64[_0xf34a('0x6')]=_[_0xf34a('0x16')](_0x821dd0,_0xf34a('0x11'));_0x903f64[_0xf34a('0x2c')]=_[_0xf34a('0x5')](_0x1fc999[_0xf34a('0x2c')]);_0x903f64[_0xf34a('0x2e')]=_[_0xf34a('0x2f')](_0x903f64[_0xf34a('0x6')],_0x903f64['query']);_0x1d20d7[_0xf34a('0x30')]=_[_0xf34a('0x2f')](_0x903f64[_0xf34a('0x6')],this[_0xf34a('0x8')](_0x1fc999['query'][_0xf34a('0x8')]));_0x1d20d7[_0xf34a('0x30')]=_0x1d20d7['attributes'][_0xf34a('0x1f')]?_0x1d20d7[_0xf34a('0x30')]:_0x903f64[_0xf34a('0x6')];if(!_0x1fc999['query'][_0xf34a('0x23')](_0xf34a('0x31'))){_0x1d20d7[_0xf34a('0x13')]=this[_0xf34a('0x13')](_0x1fc999['query'][_0xf34a('0x13')]);_0x1d20d7['offset']=this['offset'](_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x32')]);}_0x1d20d7['order']=this[_0xf34a('0x14')](_0x1fc999[_0xf34a('0x2c')]['sort']);_0x1d20d7[_0xf34a('0x33')]=this[_0xf34a('0x2e')](_[_0xf34a('0x34')](_0x1fc999[_0xf34a('0x2c')],_0x903f64['filters']),_0x821dd0);if(_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')]){var _0x312cdd=_0x821dd0;var _0x28bbed=_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')];if(typeof _0x28bbed===_0xf34a('0x36')){_0x312cdd=_[_0xf34a('0x35')](_0x821dd0,function(_0x5b4010){return _[_0xf34a('0x37')](_0x28bbed['columns'],_0x5b4010[_0xf34a('0x11')]);});_0x28bbed=_0x28bbed[_0xf34a('0x38')];}_0x1d20d7[_0xf34a('0x33')]=_[_0xf34a('0x39')](_0x1d20d7[_0xf34a('0x33')],{'$or':_[_0xf34a('0x16')](_0x312cdd,function(_0x64d238){if(_0x64d238['type']!==_0xf34a('0x3a')){if(_0x1e3f44){return sequelize[_0xf34a('0x33')](sequelize['fn'](_0xf34a('0x3b'),sequelize[_0xf34a('0x19')](_0x64d238[_0xf34a('0x11')])),{'$like':sequelize['fn'](_0xf34a('0x3b'),'%'+_0x1fc999['query'][_0xf34a('0x35')]+'%')});}else{var _0x286fb7={};_0x286fb7[_0x64d238[_0xf34a('0x11')]]={'$like':'%'+_0x1fc999[_0xf34a('0x2c')][_0xf34a('0x35')]+'%'};return _0x286fb7;}}})});}_0x1d20d7=_[_0xf34a('0x39')]({},_0x1d20d7,_0x1fc999[_0xf34a('0x3c')]);return _0x1d20d7;};exports['include']=function(_0xb9d50b){var _0x1437cf=[];if(_0xb9d50b['includeAll']){_0x1437cf[_0xf34a('0x3d')]({'all':!![]});}else if(_0xb9d50b[_0xf34a('0x3e')]){if(Array['isArray'](_0xb9d50b[_0xf34a('0x3e')])){_0x1437cf=Object['keys'](_0xb9d50b[_0xf34a('0x3e')])['map'](function(_0x5cf550){return parseIncludeModel(_0xb9d50b[_0xf34a('0x3e')][_0x5cf550]);});}else{var _0x342dc9=parseIncludeModel(_0xb9d50b[_0xf34a('0x3e')]);_0x1437cf[_0xf34a('0x3d')](_0x342dc9);}}return _0x1437cf;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 45c5a67..228c762 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 _0x46ed=['map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','pauseType','find','globalStatus','split','order','startsWith','DESC','ASC','fullname,internal','fullname','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','lastLoginAt','faxStatus','mailCurrentCapacity','smsCurrentCapacity','onhold','queue','routealias','lodash','jayson/promise','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','*pause','idle','busy','isArray','startCase','Queue'];(function(_0x40c187,_0x4aa42a){var _0x2619b8=function(_0x1a0cd0){while(--_0x1a0cd0){_0x40c187['push'](_0x40c187['shift']());}};_0x2619b8(++_0x4aa42a);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd46e('0x0'));var jayson=require(_0xd46e('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd46e('0x2')][_0xd46e('0x3')]({'port':0x232a});var routingClient=jayson[_0xd46e('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x2e6b84,_0x4518b8){var _0x54ef98=[_0x2e6b84[_0xd46e('0x4')],_0x2e6b84[_0xd46e('0x5')],_0x2e6b84[_0xd46e('0x6')],_0x2e6b84[_0xd46e('0x7')],_0x2e6b84[_0xd46e('0x8')],_0x2e6b84[_0xd46e('0x9')],_0x2e6b84[_0xd46e('0xa')]];if(!_0x4518b8)return _[_0xd46e('0xb')](_0x54ef98);var _0x31259b=_[_0xd46e('0xc')](_0x54ef98);return _0x31259b[_0xd46e('0xd')]>0x0&&_0x31259b['length']<_0x54ef98[_0xd46e('0xd')]?!![]:![];}function isIdle(_0x81235b){return _0x81235b==='idle'||_0x81235b===_0xd46e('0xe')||_0x81235b===_0xd46e('0xf')||_0x81235b===_0xd46e('0x10')||_[_0xd46e('0x11')](_0x81235b);}function isAgentIdle(_0x1ad723){if(_0x1ad723[_0xd46e('0x12')]!=='idle'&&_0x1ad723[_0xd46e('0x9')]){_0x1ad723['voiceStatus']='pause';return![];}return _[_0xd46e('0xb')]([_0x1ad723[_0xd46e('0x13')],_0x1ad723['faxStatus'],_0x1ad723['mailStatus'],_0x1ad723[_0xd46e('0x14')],_0x1ad723[_0xd46e('0x15')],_0x1ad723[_0xd46e('0x12')],_0x1ad723[_0xd46e('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xd46e('0x17'),{})[_0xd46e('0x18')](function(_0x417402){if(_0x417402[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1a'));}var _0x47fa8f=_0x417402[_0xd46e('0x1b')];return routingClient[_0xd46e('0x1c')](_0xd46e('0x17'),{})['then'](function(_0x5ddd04){if(_0x5ddd04[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1d'));}var _0x488690=_0x5ddd04['result'];return _[_0xd46e('0x1e')]({},_0x47fa8f,_0x488690);});})[_0xd46e('0x1f')](function(_0x362885){throw _0x362885;});}exports[_0xd46e('0x20')]=getRealtimeAgents;function getAgentStatus(_0x409010){var _0x312d6f=_0xd46e('0xe');if(isAgentPaused(_0x409010))_0x312d6f=_0xd46e('0x21');else if(isAgentPaused(_0x409010,!![]))_0x312d6f=_0xd46e('0x22');else if(isAgentIdle(_0x409010))_0x312d6f=_0xd46e('0x23');else _0x312d6f=_0xd46e('0x24');return _0x312d6f;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x259072,_0x1c83fa){var _0x79aa51=_[_0xd46e('0x25')](_0x259072)?_0x259072:[_0x259072];var _0x128246=_[_0xd46e('0x26')](_0x1c83fa)+_0xd46e('0x27');var _0x8a1be=_[_0xd46e('0x28')](_0x79aa51,function(_0x4cf899){return db[_0x128246][_0xd46e('0x29')]({'where':{'id':_0x4cf899}})['then'](function(_0x4b8f6a){if(!_0x4b8f6a)return[];return _0x4b8f6a[_0xd46e('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd46e('0x2b')](_0x8a1be)[_0xd46e('0x18')](function(_0x42afc7){var _0x247b9f=_(_0x42afc7)[_0xd46e('0x2c')]()[_0xd46e('0x28')]('id')['uniq']()[_0xd46e('0x2d')]();return _0x247b9f;});}exports[_0xd46e('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xddbce9,_0x17db79,_0x96f15c){try{if(_0x17db79[_0xd46e('0xd')]>0x0){_0xddbce9=_0xddbce9['filter'](function(_0x465d54){return _0x17db79[_0xd46e('0x2f')](_0x465d54['id']);});}var _0x2d1afe=_0xddbce9[_0xd46e('0xc')](function(_0x106edc){var _0x423ea3=_0xd46e('0x24');if(isAgentIdle(_0x106edc)){_0x423ea3=_0xd46e('0x23');}return _0x423ea3===_0x96f15c;});return _[_0xd46e('0x28')](_0x2d1afe,'id');}catch(_0x45ea47){throw _0x45ea47;}}exports[_0xd46e('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x504324,_0x2f4a1b,_0x5ed8dc){return Promise[_0xd46e('0x31')]()[_0xd46e('0x18')](function(){if(_0x2f4a1b[_0xd46e('0xd')]>0x0){_0x504324=_0x504324[_0xd46e('0xc')](function(_0x5ef248){return _0x2f4a1b[_0xd46e('0x2f')](_0x5ef248['id']);});}return _0x504324;})[_0xd46e('0x18')](function(){return db['User'][_0xd46e('0x32')]({'attributes':['id',_0xd46e('0x33'),'fullname',_0xd46e('0x4'),_0xd46e('0x5'),_0xd46e('0x6'),'openchannelPause','smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x34')],'where':{'id':{'$in':_[_0xd46e('0x28')](_0x504324,'id')}},'raw':!![]});})[_0xd46e('0x18')](function(_0x423de9){return _0x423de9[_0xd46e('0x28')](function(_0xf8b746){var _0x527a2f=_[_0xd46e('0x35')](_0x504324,['id',_0xf8b746['id']]);var _0x1a1181=filterAgentAttributes(_0x527a2f);_[_0xd46e('0x1e')](_0xf8b746,_0x1a1181);_0xf8b746[_0xd46e('0x36')]=getAgentStatus(_0xf8b746);return _0xf8b746;});})[_0xd46e('0x18')](function(_0x1e0897){var _0x42ddde=sortAgentsByStatus(_0x1e0897,_0x5ed8dc);return _['map'](_0x42ddde,'id');})[_0xd46e('0x1f')](function(_0x357212){throw _0x357212;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x14447e){var _0x96b0f9={'fields':[],'order':null};var _0x12ccf8=_0x14447e[_0xd46e('0x37')](',');_0x96b0f9['fields']=_[_0xd46e('0xc')](_0x12ccf8,function(_0x3ecf34){if(!_0x3ecf34[_0xd46e('0x2f')](_0xd46e('0x36'))){return!![];}_0x96b0f9[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x3ecf34,'-')?_0xd46e('0x3a'):_0xd46e('0x3b');return![];});return _0x96b0f9;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x232e6f){if(!_0x232e6f){_0x232e6f=_0xd46e('0x3c');}if(_0x232e6f[_0xd46e('0x2f')](_0xd46e('0x3d'))&&!_0x232e6f[_0xd46e('0x2f')]('internal')){var _0x964c66=_0x232e6f['substring'](0x0,_0x232e6f['indexOf']('fullname'));_0x232e6f+=','+_0x964c66+'internal';}return _0x232e6f;}exports[_0xd46e('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x54949f,_0x3b76e0){var _0x40720e=_0x54949f['sort'](function(_0x462477,_0x4114e6){if(_0x462477[_0xd46e('0x36')]===_0x4114e6[_0xd46e('0x36')]){if(_0x462477[_0xd46e('0x36')]===_0xd46e('0x21')){if(_0x3b76e0===_0xd46e('0x3a')){return(_0x462477[_0xd46e('0x34')]||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()>_0x4114e6['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x462477['pauseType']||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477['fullname'][_0xd46e('0x3f')]()>_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?-0x1:0x1;}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()<_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?0x1:-0x1;}else{return _0x462477['fullname'][_0xd46e('0x3f')]()<_0x4114e6['fullname'][_0xd46e('0x3f')]()?-0x1:0x1;}}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x36')]<_0x4114e6[_0xd46e('0x36')]?0x1:-0x1;}else{return _0x462477[_0xd46e('0x36')]<_0x4114e6['globalStatus']?-0x1:0x1;}}});return _0x40720e;}exports[_0xd46e('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0xfcd7f9){var _0x2acb83=[_0xd46e('0x41'),_0xd46e('0x42'),'lastLoginAt',_0xd46e('0x43'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x44'),_0xd46e('0x45'),'chatPause',_0xd46e('0x7'),_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x46'),_0xd46e('0x47'),'mailCapacity',_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4a'),_0xd46e('0x4b'),_0xd46e('0x4c'),'mailCurrentCapacity','smsCurrentCapacity',_0xd46e('0x4d'),_0xd46e('0x4e'),_0xd46e('0x13'),'openchannelStatus','mailStatus',_0xd46e('0x15'),_0xd46e('0x16'),'faxStatus',_0xd46e('0x12'),_0xd46e('0x4f'),_0xd46e('0x50'),_0xd46e('0x51'),_0xd46e('0x52'),_0xd46e('0x53'),_0xd46e('0x54'),_0xd46e('0x55'),'queue',_0xd46e('0x56'),_0xd46e('0x57'),_0xd46e('0x58'),_0xd46e('0x59'),'routealias'];var _0x56dd9a=[_0xd46e('0x4'),'openchannelPause',_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x42')];var _0x492329=_(_0xfcd7f9)[_0xd46e('0x5a')](_0x56dd9a)[_0xd46e('0x5b')](_0x2acb83)[_0xd46e('0x2d')]();return _0x492329;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xd46e('0x33'),_0xd46e('0x3d'),_0xd46e('0x5c'),_0xd46e('0x44'),_0xd46e('0x42'),_0xd46e('0x36'),_0xd46e('0x41'),_0xd46e('0x5d'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x5'),_0xd46e('0x4'),_0xd46e('0x6'),_0xd46e('0x7'),'smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x13'),_0xd46e('0x5e'),'mailStatus',_0xd46e('0x14'),_0xd46e('0x15'),_0xd46e('0x12'),_0xd46e('0x16'),'chatStatusTime',_0xd46e('0x54'),_0xd46e('0x51'),'openchannelStatusTime','smsStatusTime',_0xd46e('0x55'),_0xd46e('0x53'),_0xd46e('0x46'),'faxCapacity','mailCapacity',_0xd46e('0x47'),_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4b'),_0xd46e('0x4e'),_0xd46e('0x5f'),_0xd46e('0x4c'),_0xd46e('0x60'),_0xd46e('0x4d'),_0xd46e('0x58'),_0xd46e('0x59'),_0xd46e('0x56'),_0xd46e('0x61'),_0xd46e('0x62'),_0xd46e('0x63'),_0xd46e('0x57')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x326f=['faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','role','chatStatusTime','whatsappStatusTime','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','destconnectedlinenum','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','filter','globalStatus','startsWith','DESC','ASC','getUpdatedSortOptions','validateSortParameter','toLowerCase','userpic','lastLoginAt','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0x56a245,_0x5e4680){var _0x405de0=function(_0x2fb47c){while(--_0x2fb47c){_0x56a245['push'](_0x56a245['shift']());}};_0x405de0(++_0x5e4680);}(_0x326f,0xd1));var _0xf326=function(_0x52ef59,_0x140a67){_0x52ef59=_0x52ef59-0x0;var _0x5015db=_0x326f[_0x52ef59];return _0x5015db;};'use strict';var _=require(_0xf326('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232a});var routingClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232c});function isAgentPaused(_0x27e8d7,_0x120a26){var _0x9445c6=[_0x27e8d7[_0xf326('0x3')],_0x27e8d7[_0xf326('0x4')],_0x27e8d7[_0xf326('0x5')],_0x27e8d7['openchannelPause'],_0x27e8d7[_0xf326('0x6')],_0x27e8d7[_0xf326('0x7')],_0x27e8d7[_0xf326('0x8')]];if(!_0x120a26)return _[_0xf326('0x9')](_0x9445c6);var _0x515bfa=_['filter'](_0x9445c6);return _0x515bfa['length']>0x0&&_0x515bfa[_0xf326('0xa')]<_0x9445c6[_0xf326('0xa')]?!![]:![];}function isIdle(_0x163416){return _0x163416===_0xf326('0xb')||_0x163416===_0xf326('0xc')||_0x163416==='unavailable'||_0x163416===_0xf326('0xd')||_['isNil'](_0x163416);}function isAgentIdle(_0x1cf441){if(_0x1cf441['voiceStatus']!==_0xf326('0xb')&&_0x1cf441['voicePause']){_0x1cf441[_0xf326('0xe')]=_0xf326('0xf');return![];}return _['every']([_0x1cf441[_0xf326('0x10')],_0x1cf441[_0xf326('0x11')],_0x1cf441[_0xf326('0x12')],_0x1cf441[_0xf326('0x13')],_0x1cf441['smsStatus'],_0x1cf441[_0xf326('0xe')],_0x1cf441['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf326('0x14'),{})[_0xf326('0x15')](function(_0x1f2e5a){if(_0x1f2e5a[_0xf326('0x16')]){throw new Error(_0xf326('0x17'));}var _0x287a2a=_0x1f2e5a[_0xf326('0x18')];return routingClient[_0xf326('0x19')]('Agents',{})[_0xf326('0x15')](function(_0x453100){if(_0x453100[_0xf326('0x16')]){throw new Error(_0xf326('0x1a'));}var _0xcef2b5=_0x453100[_0xf326('0x18')];return _['merge']({},_0x287a2a,_0xcef2b5);});})['catch'](function(_0x56ad41){throw _0x56ad41;});}exports[_0xf326('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x289f4b){var _0x484cbe='unknown';if(isAgentPaused(_0x289f4b))_0x484cbe=_0xf326('0xf');else if(isAgentPaused(_0x289f4b,!![]))_0x484cbe='*pause';else if(isAgentIdle(_0x289f4b))_0x484cbe='idle';else _0x484cbe=_0xf326('0x1c');return _0x484cbe;}exports[_0xf326('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x549b46,_0x5aa184){var _0x19b8ba=_[_0xf326('0x1e')](_0x549b46)?_0x549b46:[_0x549b46];var _0x5f21a2=_[_0xf326('0x1f')](_0x5aa184)+_0xf326('0x20');var _0x43c53e=_[_0xf326('0x21')](_0x19b8ba,function(_0x17c157){return db[_0x5f21a2][_0xf326('0x22')]({'where':{'id':_0x17c157}})['then'](function(_0x55b9f4){if(!_0x55b9f4)return[];return _0x55b9f4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf326('0x23')](_0x43c53e)[_0xf326('0x15')](function(_0x2cd45a){var _0x1ff2b5=_(_0x2cd45a)[_0xf326('0x24')]()[_0xf326('0x21')]('id')['uniq']()[_0xf326('0x25')]();return _0x1ff2b5;});}exports[_0xf326('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x212d5d,_0x581531,_0x1617d2){try{if(_0x581531['length']>0x0){_0x212d5d=_0x212d5d['filter'](function(_0x6a8e89){return _0x581531[_0xf326('0x27')](_0x6a8e89['id']);});}var _0x2fa28e=_0x212d5d['filter'](function(_0xc115d9){var _0x292500='busy';if(isAgentIdle(_0xc115d9)){_0x292500=_0xf326('0xb');}return _0x292500===_0x1617d2;});return _[_0xf326('0x21')](_0x2fa28e,'id');}catch(_0xd77aba){throw _0xd77aba;}}exports[_0xf326('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xa80156,_0x269be9,_0x161143){return Promise[_0xf326('0x29')]()[_0xf326('0x15')](function(){if(_0x269be9[_0xf326('0xa')]>0x0){_0xa80156=_0xa80156['filter'](function(_0x1035ed){return _0x269be9[_0xf326('0x27')](_0x1035ed['id']);});}return _0xa80156;})[_0xf326('0x15')](function(){return db['User'][_0xf326('0x2a')]({'attributes':['id',_0xf326('0x2b'),_0xf326('0x2c'),'chatPause','faxPause',_0xf326('0x5'),_0xf326('0x2d'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x2e')],'where':{'id':{'$in':_[_0xf326('0x21')](_0xa80156,'id')}},'raw':!![]});})[_0xf326('0x15')](function(_0x580374){return _0x580374[_0xf326('0x21')](function(_0x1981bc){var _0x51207a=_[_0xf326('0x2f')](_0xa80156,['id',_0x1981bc['id']]);var _0x4e5d7c=filterAgentAttributes(_0x51207a);_[_0xf326('0x30')](_0x1981bc,_0x4e5d7c);_0x1981bc['globalStatus']=getAgentStatus(_0x1981bc);return _0x1981bc;});})['then'](function(_0xadb020){var _0x4d8eac=sortAgentsByStatus(_0xadb020,_0x161143);return _[_0xf326('0x21')](_0x4d8eac,'id');})['catch'](function(_0x310dbb){throw _0x310dbb;});}exports[_0xf326('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2750ae){var _0x529cbb={'fields':[],'order':null};var _0x3dcc7e=_0x2750ae[_0xf326('0x32')](',');_0x529cbb['fields']=_[_0xf326('0x33')](_0x3dcc7e,function(_0xf64dd0){if(!_0xf64dd0[_0xf326('0x27')](_0xf326('0x34'))){return!![];}_0x529cbb['order']=_[_0xf326('0x35')](_0xf64dd0,'-')?_0xf326('0x36'):_0xf326('0x37');return![];});return _0x529cbb;}exports[_0xf326('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x1d88ed){if(!_0x1d88ed){_0x1d88ed='fullname,internal';}if(_0x1d88ed[_0xf326('0x27')](_0xf326('0x2c'))&&!_0x1d88ed['includes']('internal')){var _0x40564e=_0x1d88ed['substring'](0x0,_0x1d88ed['indexOf'](_0xf326('0x2c')));_0x1d88ed+=','+_0x40564e+'internal';}return _0x1d88ed;}exports[_0xf326('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x37a95b,_0x2c1e7f){var _0x39611e=_0x37a95b['sort'](function(_0x9dda89,_0x45d344){if(_0x9dda89[_0xf326('0x34')]===_0x45d344[_0xf326('0x34')]){if(_0x9dda89[_0xf326('0x34')]===_0xf326('0xf')){if(_0x2c1e7f===_0xf326('0x36')){return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344['fullname'][_0xf326('0x3a')]()?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89['globalStatus']<_0x45d344[_0xf326('0x34')]?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x34')]<_0x45d344['globalStatus']?-0x1:0x1;}}});return _0x39611e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x8e318d){var _0x269e89=[_0xf326('0x3b'),'online',_0xf326('0x3c'),_0xf326('0x3d'),_0xf326('0x2e'),_0xf326('0x3d'),_0xf326('0x3e'),_0xf326('0x3f'),_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),_0xf326('0x40'),_0xf326('0x41'),'mailCapacity',_0xf326('0x42'),_0xf326('0x43'),_0xf326('0x44'),_0xf326('0x45'),'openchannelCurrentCapacity',_0xf326('0x46'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x49'),'chatStatus',_0xf326('0x13'),_0xf326('0x12'),_0xf326('0x4a'),_0xf326('0x4b'),_0xf326('0x11'),'voiceStatus','chatStatusTime',_0xf326('0x4c'),_0xf326('0x4d'),_0xf326('0x4e'),'whatsappStatusTime',_0xf326('0x4f'),_0xf326('0x50'),_0xf326('0x51'),'destconnectedlinenum','screenrecording',_0xf326('0x52'),'phoneBarEnableAutomaticScreenRecording',_0xf326('0x53')];var _0x554277=[_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),'online'];var _0xcdaf3f=_(_0x8e318d)[_0xf326('0x54')](_0x554277)[_0xf326('0x55')](_0x269e89)['value']();return _0xcdaf3f;}exports[_0xf326('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xf326('0x2b'),_0xf326('0x2c'),_0xf326('0x57'),_0xf326('0x3e'),'online',_0xf326('0x34'),_0xf326('0x3b'),_0xf326('0x3c'),_0xf326('0x2e'),'lastPauseAt',_0xf326('0x4'),_0xf326('0x3'),_0xf326('0x5'),_0xf326('0x2d'),'smsPause','voicePause',_0xf326('0x8'),_0xf326('0x10'),'faxStatus',_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x4a'),_0xf326('0xe'),'whatsappStatus',_0xf326('0x58'),'faxStatusTime','mailStatusTime',_0xf326('0x4c'),'smsStatusTime',_0xf326('0x50'),_0xf326('0x59'),_0xf326('0x40'),'faxCapacity','mailCapacity',_0xf326('0x41'),_0xf326('0x42'),_0xf326('0x43'),'chatCurrentCapacity',_0xf326('0x49'),'mailCurrentCapacity',_0xf326('0x5a'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x52'),_0xf326('0x5b'),_0xf326('0x5c'),_0xf326('0x5d'),_0xf326('0x51'),_0xf326('0x53'),_0xf326('0x5e')];}exports[_0xf326('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index b6ec85c..7134fa9 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 _0xbcb9=['available','loggedIn','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringing','talking','unavailable','unknown','originated','message','dialMethod','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','inbound','concat','map','get','loggedInDb','outbound','pTalking','find','pick','initializeQueues','lodash','jayson/promise','util','client','http'];(function(_0x3a75fb,_0x4f7628){var _0x38b356=function(_0x59557a){while(--_0x59557a){_0x3a75fb['push'](_0x3a75fb['shift']());}};_0x38b356(++_0x4f7628);}(_0xbcb9,0x88));var _0x9bcb=function(_0x3641cd,_0x475f36){_0x3641cd=_0x3641cd-0x0;var _0x1c475=_0xbcb9[_0x3641cd];return _0x1c475;};'use strict';var _=require(_0x9bcb('0x0'));var jayson=require(_0x9bcb('0x1'));var util=require(_0x9bcb('0x2'));var amiClient=jayson[_0x9bcb('0x3')][_0x9bcb('0x4')]({'port':0x232a});var routingClient=jayson[_0x9bcb('0x3')][_0x9bcb('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x9bcb('0x5'),_0x9bcb('0x6'),_0x9bcb('0x7'),_0x9bcb('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0x9bcb('0x9'),_0x9bcb('0xa'),_0x9bcb('0xb'),'loggedInDb',_0x9bcb('0xc'),_0x9bcb('0xd'),_0x9bcb('0xe'),'ringInUse',_0x9bcb('0xf'),_0x9bcb('0x10'),_0x9bcb('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x9bcb('0x12'),_0x9bcb('0x13'),'statusMessage','dialActive',_0x9bcb('0x14'),'Trunk','startPredictive',_0x9bcb('0x15'),'erlangCalls',_0x9bcb('0x16'),_0x9bcb('0x17'),_0x9bcb('0x18'),_0x9bcb('0x19'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x9bcb('0x1a'),'predictiveIntervalAnsweredCalls',_0x9bcb('0x1b'),_0x9bcb('0x1c'),_0x9bcb('0x1d'),_0x9bcb('0x1e')];function getRealtimeQueues(_0x54301b,_0x56780c){var _0x419c8a=_0x56780c===_0x9bcb('0x1f')?amiClient:routingClient;return _0x419c8a['request'](_['startCase'](_0x56780c)+_0x9bcb('0x20'),_0x54301b)['then'](function(_0x12864b){if(_0x12864b[_0x9bcb('0x21')])throw new Error(util[_0x9bcb('0x22')](_0x9bcb('0x23'),_0x56780c));return _0x12864b[_0x9bcb('0x24')];})['catch'](function(_0x3b04a6){throw _0x3b04a6;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x1bc20b,_0x34fb7a,_0x1eacf6,_0x27b15e){var _0x3fd84a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1eacf6===_0x9bcb('0x1f')){if(_0x27b15e===_0x9bcb('0x25')){_0x3fd84a=_0x3fd84a[_0x9bcb('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x27b15e==='outbound'){_0x3fd84a=_0x3fd84a['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1bc20b[_0x9bcb('0x27')](function(_0x4c14eb){var _0xdbcf11=_0x4c14eb[_0x9bcb('0x28')]({'plain':!![]});_0xdbcf11[_0x9bcb('0x7')]=0x0;_0xdbcf11[_0x9bcb('0x29')]=0x0;_0xdbcf11[_0x9bcb('0x6')]=0x0;_0xdbcf11[_0x9bcb('0x5')]=0x0;_0xdbcf11[_0x9bcb('0x8')]=0x0;if(_0x1eacf6===_0x9bcb('0x1f')){_0xdbcf11[_0x9bcb('0xf')]=0x0;_0xdbcf11[_0x9bcb('0x9')]=0x0;if(_0x27b15e===_0x9bcb('0x2a')){_0xdbcf11[_0x9bcb('0x2b')]=0x0;_0xdbcf11[_0x9bcb('0x12')]=0x0;}}var _0x22f3bf=_[_0x9bcb('0x2c')](_0x34fb7a,['id',_0xdbcf11['id']]);if(_0x22f3bf){_['merge'](_0xdbcf11,_[_0x9bcb('0x2d')](_0x22f3bf,_0x3fd84a));}return _0xdbcf11;});}exports[_0x9bcb('0x2e')]=initializeQueues; \ No newline at end of file +var _0x5766=['get','paused','waiting','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','busy','inUse','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map'];(function(_0x5326fd,_0x2b3366){var _0x4a3b26=function(_0x263a30){while(--_0x263a30){_0x5326fd['push'](_0x5326fd['shift']());}};_0x4a3b26(++_0x2b3366);}(_0x5766,0x115));var _0x6576=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6576('0x0'));var jayson=require(_0x6576('0x1'));var util=require(_0x6576('0x2'));var amiClient=jayson[_0x6576('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x6576('0x3')][_0x6576('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6576('0x5'),_0x6576('0x6'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x6576('0x7'),_0x6576('0x8'),'invalid',_0x6576('0x9'),_0x6576('0xa'),_0x6576('0xb'),_0x6576('0xc'),_0x6576('0xd'),'talking',_0x6576('0xe'),_0x6576('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6576('0x10'),_0x6576('0x11'),_0x6576('0x12'),_0x6576('0x13'),'dialActive','dialMethod',_0x6576('0x14'),_0x6576('0x15'),_0x6576('0x16'),_0x6576('0x17'),_0x6576('0x18'),'erlangAbandonmentRate',_0x6576('0x19'),'dialPredictiveInterval',_0x6576('0x1a'),_0x6576('0x1b'),_0x6576('0x1c'),'predictiveIntervalTotalCalls',_0x6576('0x1d'),'predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0x6576('0x1e'),_0x6576('0x1f')];function getRealtimeQueues(_0x439f97,_0x3a0ffe){var _0x150bb7=_0x3a0ffe===_0x6576('0x20')?amiClient:routingClient;return _0x150bb7[_0x6576('0x21')](_[_0x6576('0x22')](_0x3a0ffe)+_0x6576('0x23'),_0x439f97)[_0x6576('0x24')](function(_0x3b6a45){if(_0x3b6a45[_0x6576('0x25')])throw new Error(util[_0x6576('0x26')](_0x6576('0x27'),_0x3a0ffe));return _0x3b6a45[_0x6576('0x28')];})[_0x6576('0x29')](function(_0x3a8b1e){throw _0x3a8b1e;});}exports[_0x6576('0x2a')]=getRealtimeQueues;function initializeQueues(_0x536dd0,_0x1ff11b,_0x197158,_0x5980a8){var _0x3dcf69=DEFAULT_QUEUE_ATTRIBUTES;if(_0x197158===_0x6576('0x20')){if(_0x5980a8===_0x6576('0x2b')){_0x3dcf69=_0x3dcf69[_0x6576('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5980a8===_0x6576('0x2d')){_0x3dcf69=_0x3dcf69[_0x6576('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x536dd0[_0x6576('0x2e')](function(_0x42b65b){var _0x419155=_0x42b65b[_0x6576('0x2f')]({'plain':!![]});_0x419155[_0x6576('0x30')]=0x0;_0x419155['loggedInDb']=0x0;_0x419155[_0x6576('0x6')]=0x0;_0x419155['available']=0x0;_0x419155[_0x6576('0x31')]=0x0;if(_0x197158===_0x6576('0x20')){_0x419155['talking']=0x0;_0x419155[_0x6576('0x7')]=0x0;if(_0x5980a8===_0x6576('0x2d')){_0x419155['pTalking']=0x0;_0x419155[_0x6576('0x11')]=0x0;}}var _0xcde9b6=_[_0x6576('0x32')](_0x1ff11b,['id',_0x419155['id']]);if(_0xcde9b6){_[_0x6576('0x33')](_0x419155,_[_0x6576('0x34')](_0xcde9b6,_0x3dcf69));}return _0x419155;});}exports[_0x6576('0x35')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 7b89c58..07b5a1f 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index cfae2f7..b34f73f 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 _0x5a94=['platform','licenseToken','test','win32','utf8','hostname','macAddress','ipAddress','update','substring','crypto','bimedia-machine-uuid','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','cpus','model','join','createHash','md5','digest','hex','getUuid'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x5a94,0x6d));var _0x45a9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5a94[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x45a9('0x0'));var machine=require(_0x45a9('0x1'));var exec=require('child_process')['execSync'];var config=require(_0x45a9('0x2'));function getInterfaces(){var _0x3bda3d=[];var _0x598b81=os[_0x45a9('0x3')]();var _0x1e0133=_[_0x45a9('0x4')](_[_0x45a9('0x5')](_0x598b81));for(var _0x428235=0x0;_0x428235<_0x1e0133[_0x45a9('0x6')];_0x428235++){var _0x648fc5=_0x598b81[_0x1e0133[_0x428235]][_0x45a9('0x7')](function(_0x15ed89){return _0x15ed89[_0x45a9('0x8')]===_0x45a9('0x9')&&_0x15ed89[_0x45a9('0xa')]===![];});_0x3bda3d=_0x3bda3d[_0x45a9('0xb')](_0x648fc5);}return _0x3bda3d;}function getFirstInterface(){var _0x442446=_['head'](getInterfaces());return{'macAddress':_0x442446&&_0x442446[_0x45a9('0xc')]?_0x442446[_0x45a9('0xc')]:_0x45a9('0xd'),'ipAddress':_0x442446&&_0x442446[_0x45a9('0xe')]?_0x442446[_0x45a9('0xe')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x24d49a=_[_0x45a9('0x4')](os[_0x45a9('0xf')]()['map'](function(_0x534cd7){return _0x534cd7[_0x45a9('0x10')];}))[_0x45a9('0x11')](':');return crypto[_0x45a9('0x12')](_0x45a9('0x13'))['update'](_0x24d49a)[_0x45a9('0x14')](_0x45a9('0x15'));}exports[_0x45a9('0x16')]=function(){var _0x239666=os[_0x45a9('0x17')]();var _0x483c0b=/[0-9a-f-]{36}/;if(config[_0x45a9('0x18')]&&_0x483c0b[_0x45a9('0x19')](config['licenseToken'])){return config['licenseToken'];}else if(_0x239666===_0x45a9('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x45a9('0x1b')})['replace']('\x0d\x0a','');}else{var _0x57a1aa=getFirstInterface();var _0x242e40=getCPUhash();var _0x47cc4a=_0x242e40+'|'+os[_0x45a9('0x1c')]()+'|'+_0x57a1aa[_0x45a9('0x1d')]+'|'+_0x57a1aa[_0x45a9('0x1e')];var _0x88a533=crypto['createHash']('md5')[_0x45a9('0x1f')](_0x47cc4a)[_0x45a9('0x14')](_0x45a9('0x15'));return _0x88a533[_0x45a9('0x20')](0x0,0x8)+'-'+_0x88a533[_0x45a9('0x20')](0x8,0xc)+'-'+_0x88a533[_0x45a9('0x20')](0xc,0x10)+'-'+_0x88a533['substring'](0x10,0x14)+'-'+_0x88a533['substring'](0x14);}}; \ No newline at end of file +var _0x97cb=['digest','hex','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','filter','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5'];(function(_0x51cc95,_0x11c31e){var _0x54fb8e=function(_0x50ea71){while(--_0x50ea71){_0x51cc95['push'](_0x51cc95['shift']());}};_0x54fb8e(++_0x11c31e);}(_0x97cb,0x11c));var _0xb97c=function(_0x11a3d9,_0x5db357){_0x11a3d9=_0x11a3d9-0x0;var _0x5c20e1=_0x97cb[_0x11a3d9];return _0x5c20e1;};'use strict';var _=require(_0xb97c('0x0'));var os=require('os');var crypto=require(_0xb97c('0x1'));var machine=require(_0xb97c('0x2'));var exec=require(_0xb97c('0x3'))[_0xb97c('0x4')];var config=require('../environment');function getInterfaces(){var _0x4e4431=[];var _0x8df631=os[_0xb97c('0x5')]();var _0x3913af=_[_0xb97c('0x6')](_['keys'](_0x8df631));for(var _0x446c2f=0x0;_0x446c2f<_0x3913af[_0xb97c('0x7')];_0x446c2f++){var _0x5945d5=_0x8df631[_0x3913af[_0x446c2f]][_0xb97c('0x8')](function(_0x1164fb){return _0x1164fb['family']===_0xb97c('0x9')&&_0x1164fb[_0xb97c('0xa')]===![];});_0x4e4431=_0x4e4431[_0xb97c('0xb')](_0x5945d5);}return _0x4e4431;}function getFirstInterface(){var _0x10e674=_[_0xb97c('0xc')](getInterfaces());return{'macAddress':_0x10e674&&_0x10e674[_0xb97c('0xd')]?_0x10e674[_0xb97c('0xd')]:'00:00:00:00:00:00','ipAddress':_0x10e674&&_0x10e674[_0xb97c('0xe')]?_0x10e674[_0xb97c('0xe')]:'127.0.0.1'};}exports[_0xb97c('0xf')]=getFirstInterface;function getCPUhash(){var _0x4af4a8=_['orderBy'](os[_0xb97c('0x10')]()[_0xb97c('0x11')](function(_0x36b785){return _0x36b785[_0xb97c('0x12')];}))[_0xb97c('0x13')](':');return crypto[_0xb97c('0x14')](_0xb97c('0x15'))['update'](_0x4af4a8)[_0xb97c('0x16')](_0xb97c('0x17'));}exports['getUuid']=function(){var _0x46ab5b=os[_0xb97c('0x18')]();var _0x4609bb=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4609bb[_0xb97c('0x19')](config['licenseToken'])){return config[_0xb97c('0x1a')];}else if(_0x46ab5b==='win32'){return exec(_0xb97c('0x1b'),{'encoding':_0xb97c('0x1c')})[_0xb97c('0x1d')]('\x0d\x0a','');}else{var _0x587677=getFirstInterface();var _0x431a9e=getCPUhash();var _0x24d0ed=_0x431a9e+'|'+os[_0xb97c('0x1e')]()+'|'+_0x587677[_0xb97c('0x1f')]+'|'+_0x587677['ipAddress'];var _0x539876=crypto[_0xb97c('0x14')](_0xb97c('0x15'))[_0xb97c('0x20')](_0x24d0ed)[_0xb97c('0x16')](_0xb97c('0x17'));return _0x539876[_0xb97c('0x21')](0x0,0x8)+'-'+_0x539876['substring'](0x8,0xc)+'-'+_0x539876[_0xb97c('0x21')](0xc,0x10)+'-'+_0x539876['substring'](0x10,0x14)+'-'+_0x539876[_0xb97c('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 8d9da6a..c507df5 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 _0xb67a=['info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xb67a,0xb5));var _0xab67=function(_0x5aa992,_0x559ebb){_0x5aa992=_0x5aa992-0x0;var _0x2e2d59=_0xb67a[_0x5aa992];return _0x2e2d59;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0xab67('0x0'));var BPromise=require(_0xab67('0x1'));var pkginfo=require(_0xab67('0x2'))(module,'version');var db=require(_0xab67('0x3'))['db'];var encryptor=require(_0xab67('0x4'));var hardware=require(_0xab67('0x5'));var logger=require('../logger')(_0xab67('0x6'));var HOST=_0xab67('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xa88e87){return new BPromise(function(_0x1ca5a8,_0xe325e8){var _0x42f1d2=util[_0xab67('0x8')](_0xab67('0x9'),HOST,_0xa88e87,module[_0xab67('0xa')][_0xab67('0xb')]);if(oldToken){_0x42f1d2=util[_0xab67('0x8')](_0xab67('0xc'),HOST,_0xa88e87,module[_0xab67('0xa')][_0xab67('0xb')],oldToken);}var _0x1ef337={'uri':_0x42f1d2,'method':_0xab67('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x1ef337)[_0xab67('0xe')](function(_0x2a4dcd){_0x1ca5a8(_0x2a4dcd);})[_0xab67('0xf')](function(_0x3f591d){_0xe325e8(_0x3f591d);});});}function manageLicense(_0x1dbaea,_0x48b92a){var _0x4b155a=_0x48b92a['get']({'plain':!![]});if(!isOldTokenSent&&_0x4b155a[_0xab67('0x10')]!==_0x1dbaea&&!_0x4b155a[_0xab67('0x11')]){oldToken=_0x4b155a[_0xab67('0x10')];}httpRequest(_0x1dbaea)[_0xab67('0xe')](function(_0x37dc4a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37dc4a['active']){isOldTokenSent=![];if(!_0x4b155a['license']&&_0x4b155a[_0xab67('0x6')]!=_0x37dc4a[_0xab67('0x6')]||_0x4b155a[_0xab67('0x6')]&&_0x4b155a[_0xab67('0x11')]){logger['info'](_0xab67('0x12'));}if(_0x4b155a[_0xab67('0x6')]&&!_0x4b155a[_0xab67('0x11')]&&_0x4b155a[_0xab67('0x6')]!=_0x37dc4a[_0xab67('0x6')]){logger[_0xab67('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x4b155a[_0xab67('0x6')]&&!_0x4b155a[_0xab67('0x11')]&&_0x4b155a[_0xab67('0x6')]==_0x37dc4a['license']){return _0x48b92a;}return _0x48b92a[_0xab67('0x14')]({'data1':_0x1dbaea,'data2':null,'license':_0x37dc4a['license']});}else{if(_0x37dc4a[_0xab67('0x6')]||_0x4b155a[_0xab67('0x6')]){if(!_0x4b155a[_0xab67('0x11')]){if(_0x4b155a[_0xab67('0x10')]==_0x1dbaea){GRAY_PERIOD_REASON=_0xab67('0x15');logger['info'](_0xab67('0x16'));}else{GRAY_PERIOD_REASON=_0xab67('0x17');logger['info'](_0xab67('0x18'),_0x4b155a[_0xab67('0x10')],_0x1dbaea);}logger[_0xab67('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xab67('0x19')](),moment()[_0xab67('0x8')](_0xab67('0x1a')));return _0x48b92a['update']({'data2':encryptor[_0xab67('0x1b')](moment()[_0xab67('0x8')](_0xab67('0x1a')))});}else{if(moment()[_0xab67('0x1c')](encryptor['decryptString'](_0x4b155a[_0xab67('0x11')]),_0xab67('0x1d'))>DAYS){logger['info'](_0xab67('0x1e'),moment()[_0xab67('0x8')](_0xab67('0x1a')));isOldTokenSent=![];return _0x48b92a[_0xab67('0x14')]({'data1':_0x1dbaea,'data2':null,'license':null});}}}else{if(_0x4b155a[_0xab67('0x10')]!=_0x1dbaea){logger[_0xab67('0x13')](_0xab67('0x18'),_0x4b155a[_0xab67('0x10')],_0x1dbaea);return _0x48b92a[_0xab67('0x14')]({'data1':_0x1dbaea,'data2':null,'license':null});}}}return _0x48b92a;})[_0xab67('0xe')](function(_0x164d1f){_0x48b92a=_0x164d1f;})[_0xab67('0xf')](function(_0x1bc000){logger[_0xab67('0x1f')](_0x1bc000[_0xab67('0x20')]);})[_0xab67('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xab67('0x22')](),_0x48b92a);},TIME);});}function defaultLicense(){var _0x5a849a=hardware[_0xab67('0x22')]();if(_0x5a849a){return db[_0xab67('0x23')][_0xab67('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x5a849a}})[_0xab67('0x25')](function(_0x28cba5,_0x12ab5d){logger['info'](_0xab67('0x26'),_0x5a849a);manageLicense(_0x5a849a,_0x28cba5);})['catch'](function(_0x701e4a){logger[_0xab67('0x1f')](_0x701e4a['message']);});}}exports[_0xab67('0x27')]=defaultLicense; \ No newline at end of file +var _0x8723=['update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','format','exports','GET','then','catch','get','data2','data1','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8723,0x1f4));var _0x3872=function(_0x1318cc,_0x4f5f65){_0x1318cc=_0x1318cc-0x0;var _0x1919d6=_0x8723[_0x1318cc];return _0x1919d6;};'use strict';var util=require(_0x3872('0x0'));var moment=require(_0x3872('0x1'));var rp=require(_0x3872('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x3872('0x3'))(module,_0x3872('0x4'));var db=require(_0x3872('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x3872('0x6'));var logger=require('../logger')('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4d4016){return new BPromise(function(_0x15031c,_0x39d2a8){var _0x2ba163=util[_0x3872('0x7')]('%s/api/servers/%s/check?version=%s',HOST,_0x4d4016,module[_0x3872('0x8')]['version']);if(oldToken){_0x2ba163=util[_0x3872('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4d4016,module['exports']['version'],oldToken);}var _0x4286ef={'uri':_0x2ba163,'method':_0x3872('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x4286ef)[_0x3872('0xa')](function(_0x3571e2){_0x15031c(_0x3571e2);})[_0x3872('0xb')](function(_0x3b3955){_0x39d2a8(_0x3b3955);});});}function manageLicense(_0x1c45e3,_0x388f0c){var _0x2846db=_0x388f0c[_0x3872('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x2846db['data1']!==_0x1c45e3&&!_0x2846db[_0x3872('0xd')]){oldToken=_0x2846db[_0x3872('0xe')];}httpRequest(_0x1c45e3)[_0x3872('0xa')](function(_0x563ea7){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x563ea7['active']){isOldTokenSent=![];if(!_0x2846db[_0x3872('0xf')]&&_0x2846db[_0x3872('0xf')]!=_0x563ea7['license']||_0x2846db[_0x3872('0xf')]&&_0x2846db[_0x3872('0xd')]){logger[_0x3872('0x10')](_0x3872('0x11'));}if(_0x2846db[_0x3872('0xf')]&&!_0x2846db[_0x3872('0xd')]&&_0x2846db[_0x3872('0xf')]!=_0x563ea7[_0x3872('0xf')]){logger[_0x3872('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2846db[_0x3872('0xf')]&&!_0x2846db[_0x3872('0xd')]&&_0x2846db[_0x3872('0xf')]==_0x563ea7[_0x3872('0xf')]){return _0x388f0c;}return _0x388f0c[_0x3872('0x12')]({'data1':_0x1c45e3,'data2':null,'license':_0x563ea7[_0x3872('0xf')]});}else{if(_0x563ea7[_0x3872('0xf')]||_0x2846db[_0x3872('0xf')]){if(!_0x2846db['data2']){if(_0x2846db[_0x3872('0xe')]==_0x1c45e3){GRAY_PERIOD_REASON=_0x3872('0x13');logger[_0x3872('0x10')](_0x3872('0x14'));}else{GRAY_PERIOD_REASON=_0x3872('0x15');logger[_0x3872('0x10')](_0x3872('0x16'),_0x2846db[_0x3872('0xe')],_0x1c45e3);}logger[_0x3872('0x10')](_0x3872('0x17'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x3872('0x7')]('YYYY-MM-DD\x20HH:mm'));return _0x388f0c[_0x3872('0x12')]({'data2':encryptor[_0x3872('0x18')](moment()[_0x3872('0x7')](_0x3872('0x19')))});}else{if(moment()[_0x3872('0x1a')](encryptor[_0x3872('0x1b')](_0x2846db[_0x3872('0xd')]),'days')>DAYS){logger[_0x3872('0x10')]('DEMO\x20START\x20AT\x20%s',moment()[_0x3872('0x7')](_0x3872('0x19')));isOldTokenSent=![];return _0x388f0c['update']({'data1':_0x1c45e3,'data2':null,'license':null});}}}else{if(_0x2846db[_0x3872('0xe')]!=_0x1c45e3){logger[_0x3872('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2846db[_0x3872('0xe')],_0x1c45e3);return _0x388f0c['update']({'data1':_0x1c45e3,'data2':null,'license':null});}}}return _0x388f0c;})[_0x3872('0xa')](function(_0x179a35){_0x388f0c=_0x179a35;})[_0x3872('0xb')](function(_0x3e21d6){logger[_0x3872('0x1c')](_0x3e21d6[_0x3872('0x1d')]);})[_0x3872('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x3872('0x1f')](),_0x388f0c);},TIME);});}function defaultLicense(){var _0x36a361=hardware[_0x3872('0x1f')]();if(_0x36a361){return db[_0x3872('0x20')][_0x3872('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x36a361}})[_0x3872('0x22')](function(_0x22e2bf,_0x4a15a6){logger[_0x3872('0x10')](_0x3872('0x23'),_0x36a361);manageLicense(_0x36a361,_0x22e2bf);})['catch'](function(_0x2b35aa){logger[_0x3872('0x1c')](_0x2b35aa[_0x3872('0x1d')]);});}}exports[_0x3872('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index fe5bd05..e0552a5 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 _0xdc29=['%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','add','days','changed','message','User','findAll','role','sequelize','col','count','admin','telephone','users','telephones','catch','pick','countBy','user','util','lodash','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','then','data1','license','isEmpty','split','format'];(function(_0x54e856,_0x313d5c){var _0x124873=function(_0x48547e){while(--_0x48547e){_0x54e856['push'](_0x54e856['shift']());}};_0x124873(++_0x313d5c);}(_0xdc29,0x138));var _0x9dc2=function(_0x27013d,_0xc982e8){_0x27013d=_0x27013d-0x0;var _0x3d653f=_0xdc29[_0x27013d];return _0x3d653f;};'use strict';var util=require(_0x9dc2('0x0'));var _=require(_0x9dc2('0x1'));var moment=require('moment');var BPromise=require(_0x9dc2('0x2'));var hardware=require('./hardware');var encryptor=require(_0x9dc2('0x3'));var db=require(_0x9dc2('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9dc2('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x9dc2('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9dc2('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9dc2('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5f4e37){return new BPromise(function(_0x452731,_0x2281d8){return db[_0x9dc2('0x8')][_0x9dc2('0x9')](_['defaults'](_0x5f4e37,{'raw':!![],'where':{'id':0x1}}))[_0x9dc2('0xa')](function(_0x334787){return checkLicense(_0x334787,null);})[_0x9dc2('0xa')](function(_0x1b8b66){_0x452731(_0x1b8b66);return;})['catch'](function(_0x17f07c){_0x2281d8(_0x17f07c);});});}function checkLicense(_0x2da9c4,_0x324af7){if(!_0x2da9c4){demoLicense['uuid']=_0x2da9c4[_0x9dc2('0xb')];return demoLicense;}try{var _0x10336c=_0x324af7||_0x2da9c4[_0x9dc2('0xc')];if(_[_0x9dc2('0xd')](_0x10336c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x4656ff=_0x2da9c4[_0x9dc2('0xb')];var _0xf91841=_0x2da9c4['data2'];var _0x2ba78d=_0x4656ff[_0x9dc2('0xe')]('-')[0x4];var _0x429fb6=_0x4656ff[_0x9dc2('0xe')]('-')[0x0];var _0x314b11=encryptor['decryptString'](_0x10336c,util[_0x9dc2('0xf')](_0x9dc2('0x10'),_0x2ba78d,_0x4656ff,_0x429fb6));var _0x8c1393=JSON[_0x9dc2('0x11')](_0x314b11);_0x8c1393[_0x9dc2('0x12')]=![];_0x8c1393[_0x9dc2('0x13')]=_0x4656ff;_0x8c1393[_0x9dc2('0x14')]=hardware[_0x9dc2('0x6')]();if(_0xf91841){var _0x2f4852=encryptor['decryptString'](_0xf91841);_0x8c1393[_0x9dc2('0x15')]=_0x2f4852;_0x8c1393[_0x9dc2('0x16')]=moment(_0x2f4852)[_0x9dc2('0x17')](0x7,_0x9dc2('0x18'))[_0x9dc2('0xf')]();_0x8c1393['grayReason']=_0x8c1393[_0x9dc2('0x13')]!=_0x8c1393[_0x9dc2('0x14')]?_0x9dc2('0x19'):'disabled';}return _0x8c1393;}catch(_0x1743fa){breakingLicense[_0x9dc2('0x13')]=_0x2da9c4[_0x9dc2('0xb')];breakingLicense[_0x9dc2('0x1a')]=_0x1743fa[_0x9dc2('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x13ecf6,_0x3e5c65){getLicense()[_0x9dc2('0xa')](function(_0x1e08fd){return db[_0x9dc2('0x1b')][_0x9dc2('0x1c')]({'attributes':[_0x9dc2('0x1d'),[db[_0x9dc2('0x1e')]['fn']('COUNT',db[_0x9dc2('0x1e')][_0x9dc2('0x1f')](_0x9dc2('0x1d'))),_0x9dc2('0x20')]],'group':_0x9dc2('0x1d'),'where':{'role':{'$or':[_0x9dc2('0x21'),'user',_0x9dc2('0x22')]}},'raw':!![]})[_0x9dc2('0xa')](function(_0x59b662){var _0x554c45={'user':_0x1e08fd[_0x9dc2('0x23')]||0x0,'telephone':_0x1e08fd[_0x9dc2('0x24')]||0x0};_0x59b662['forEach'](function(_0x2a4281){var _0x4de097=_0x2a4281[_0x9dc2('0x1d')]===_0x9dc2('0x21')?'user':_0x2a4281[_0x9dc2('0x1d')];_0x554c45[_0x4de097]-=_0x2a4281['count'];if(_0x554c45[_0x4de097]<0x0)_0x554c45[_0x4de097]=0x0;});_0x13ecf6(_0x554c45);return;});})[_0x9dc2('0x25')](function(_0x5c94fb){_0x3e5c65(_0x5c94fb);});});}function checkUserLimits(_0x132ebc){return new BPromise(function(_0x118c2b,_0x17ac2b){getLimits()[_0x9dc2('0xa')](function(_0x35df72){var _0x41f26d=_[_0x9dc2('0x26')](_[_0x9dc2('0x27')](_0x132ebc,_0x9dc2('0x1d')),['admin',_0x9dc2('0x28'),_0x9dc2('0x22')]);var _0xb9700f=(_0x41f26d[_0x9dc2('0x21')]||0x0)+(_0x41f26d[_0x9dc2('0x28')]||0x0);var _0x1bd3d4=_0x41f26d[_0x9dc2('0x22')]||0x0;if(_0xb9700f>_0x35df72[_0x9dc2('0x28')])return _0x17ac2b('License\x20limit\x20reached\x20for\x20users');if(_0x1bd3d4>_0x35df72[_0x9dc2('0x22')])return _0x17ac2b('License\x20limit\x20reached\x20for\x20telephones');return _0x118c2b();})[_0x9dc2('0x25')](function(_0x1b156e){_0x17ac2b(_0x1b156e);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xd2b3=['message','User','findAll','role','sequelize','COUNT','col','user','telephone','users','forEach','admin','count','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','uuid','changed','disabled'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xd2b3,0xa1));var _0x3d2b=function(_0x14e405,_0x387732){_0x14e405=_0x14e405-0x0;var _0x34822a=_0xd2b3[_0x14e405];return _0x34822a;};'use strict';var util=require(_0x3d2b('0x0'));var _=require(_0x3d2b('0x1'));var moment=require(_0x3d2b('0x2'));var BPromise=require('bluebird');var hardware=require(_0x3d2b('0x3'));var encryptor=require(_0x3d2b('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3d2b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3d2b('0x6'),'machineUuid':hardware[_0x3d2b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3d2b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3d2b('0x8'),'machineUuid':hardware[_0x3d2b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x214348){return new BPromise(function(_0x455be4,_0x5c0796){return db['License']['find'](_[_0x3d2b('0x9')](_0x214348,{'raw':!![],'where':{'id':0x1}}))[_0x3d2b('0xa')](function(_0x3b4e93){return checkLicense(_0x3b4e93,null);})[_0x3d2b('0xa')](function(_0x4b1d79){_0x455be4(_0x4b1d79);return;})[_0x3d2b('0xb')](function(_0x311be2){_0x5c0796(_0x311be2);});});}function checkLicense(_0x2e6fe0,_0x57864e){if(!_0x2e6fe0){demoLicense['uuid']=_0x2e6fe0[_0x3d2b('0xc')];return demoLicense;}try{var _0x4d4e8a=_0x57864e||_0x2e6fe0[_0x3d2b('0xd')];if(_[_0x3d2b('0xe')](_0x4d4e8a)){throw new Error(_0x3d2b('0xf'));}var _0x3ed2da=_0x2e6fe0[_0x3d2b('0xc')];var _0x2aae56=_0x2e6fe0[_0x3d2b('0x10')];var _0x23ad9c=_0x3ed2da[_0x3d2b('0x11')]('-')[0x4];var _0x361c23=_0x3ed2da['split']('-')[0x0];var _0x1145d7=encryptor[_0x3d2b('0x12')](_0x4d4e8a,util[_0x3d2b('0x13')](_0x3d2b('0x14'),_0x23ad9c,_0x3ed2da,_0x361c23));var _0x2f4e8f=JSON[_0x3d2b('0x15')](_0x1145d7);_0x2f4e8f[_0x3d2b('0x16')]=![];_0x2f4e8f['uuid']=_0x3ed2da;_0x2f4e8f[_0x3d2b('0x17')]=hardware[_0x3d2b('0x7')]();if(_0x2aae56){var _0x58c990=encryptor['decryptString'](_0x2aae56);_0x2f4e8f[_0x3d2b('0x18')]=_0x58c990;_0x2f4e8f[_0x3d2b('0x19')]=moment(_0x58c990)[_0x3d2b('0x1a')](0x7,_0x3d2b('0x1b'))[_0x3d2b('0x13')]();_0x2f4e8f['grayReason']=_0x2f4e8f[_0x3d2b('0x1c')]!=_0x2f4e8f[_0x3d2b('0x17')]?_0x3d2b('0x1d'):_0x3d2b('0x1e');}return _0x2f4e8f;}catch(_0x4e972d){breakingLicense[_0x3d2b('0x1c')]=_0x2e6fe0[_0x3d2b('0xc')];breakingLicense[_0x3d2b('0x1f')]=_0x4e972d[_0x3d2b('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x97bab0,_0xeb5b52){getLicense()[_0x3d2b('0xa')](function(_0x119ef4){return db[_0x3d2b('0x20')][_0x3d2b('0x21')]({'attributes':[_0x3d2b('0x22'),[db[_0x3d2b('0x23')]['fn'](_0x3d2b('0x24'),db[_0x3d2b('0x23')][_0x3d2b('0x25')](_0x3d2b('0x22'))),'count']],'group':_0x3d2b('0x22'),'where':{'role':{'$or':['admin',_0x3d2b('0x26'),_0x3d2b('0x27')]}},'raw':!![]})[_0x3d2b('0xa')](function(_0x298b56){var _0x14e630={'user':_0x119ef4[_0x3d2b('0x28')]||0x0,'telephone':_0x119ef4['telephones']||0x0};_0x298b56[_0x3d2b('0x29')](function(_0x51c79b){var _0x373306=_0x51c79b[_0x3d2b('0x22')]===_0x3d2b('0x2a')?'user':_0x51c79b[_0x3d2b('0x22')];_0x14e630[_0x373306]-=_0x51c79b[_0x3d2b('0x2b')];if(_0x14e630[_0x373306]<0x0)_0x14e630[_0x373306]=0x0;});_0x97bab0(_0x14e630);return;});})[_0x3d2b('0xb')](function(_0xd266c6){_0xeb5b52(_0xd266c6);});});}function checkUserLimits(_0xf10c1d){return new BPromise(function(_0x56efd6,_0x580b53){getLimits()[_0x3d2b('0xa')](function(_0x8ac636){var _0x3c622e=_[_0x3d2b('0x2c')](_['countBy'](_0xf10c1d,_0x3d2b('0x22')),[_0x3d2b('0x2a'),_0x3d2b('0x26'),_0x3d2b('0x27')]);var _0x1a0095=(_0x3c622e[_0x3d2b('0x2a')]||0x0)+(_0x3c622e[_0x3d2b('0x26')]||0x0);var _0x28a1d8=_0x3c622e[_0x3d2b('0x27')]||0x0;if(_0x1a0095>_0x8ac636[_0x3d2b('0x26')])return _0x580b53(_0x3d2b('0x2d'));if(_0x28a1d8>_0x8ac636[_0x3d2b('0x27')])return _0x580b53(_0x3d2b('0x2e'));return _0x56efd6();})[_0x3d2b('0xb')](function(_0x58692d){_0x580b53(_0x58692d);});});}module[_0x3d2b('0x2f')]={'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 09c2426..7932afb 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 _0x4e2e=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0xbe3b54,_0x5c9e71){_0xbe3b54=_0xbe3b54-0x0;var _0x4e1946=_0x4e2e[_0xbe3b54];return _0x4e1946;};'use strict';module['exports']={'DOMAIN':_0xe4e2('0x0'),'SESSION_SECRET':_0xe4e2('0x1'),'GOOGLE_ID':_0xe4e2('0x2'),'GOOGLE_SECRET':_0xe4e2('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x6a95=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0xa30df3,_0x54f0d3){var _0x3fbc93=function(_0x1f1faf){while(--_0x1f1faf){_0xa30df3['push'](_0xa30df3['shift']());}};_0x3fbc93(++_0x54f0d3);}(_0x6a95,0x1db));var _0x56a9=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x6a95[_0x139a3c];return _0x2b375b;};'use strict';module[_0x56a9('0x0')]={'DOMAIN':_0x56a9('0x1'),'SESSION_SECRET':_0x56a9('0x2'),'GOOGLE_ID':_0x56a9('0x3'),'GOOGLE_SECRET':_0x56a9('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 17101d6..631b83d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58c6=['../utils/loggers','fileLogger','exports'];(function(_0x41656f,_0x3fe292){var _0x2dbd2c=function(_0xb15ddb){while(--_0xb15ddb){_0x41656f['push'](_0x41656f['shift']());}};_0x2dbd2c(++_0x3fe292);}(_0x58c6,0x174));var _0x658c=function(_0x12c7e3,_0x417a84){_0x12c7e3=_0x12c7e3-0x0;var _0x348f08=_0x58c6[_0x12c7e3];return _0x348f08;};'use strict';var fileLogger=require(_0x658c('0x0'))[_0x658c('0x1')];module[_0x658c('0x2')]=fileLogger; \ No newline at end of file +var _0xd9a9=['../utils/loggers','fileLogger','exports'];(function(_0x2776ad,_0x5e26ed){var _0x378760=function(_0x10bb9f){while(--_0x10bb9f){_0x2776ad['push'](_0x2776ad['shift']());}};_0x378760(++_0x5e26ed);}(_0xd9a9,0x13b));var _0x9d9a=function(_0x4a6eda,_0x9d95f1){_0x4a6eda=_0x4a6eda-0x0;var _0x249c44=_0xd9a9[_0x4a6eda];return _0x249c44;};'use strict';var fileLogger=require(_0x9d9a('0x0'))[_0x9d9a('0x1')];module[_0x9d9a('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 8f1b14d..aa1ce0d 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 _0x29dc=['ami','../../services/ami/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','../../config/environment','resolve','join','express','../../services/express/index.js'];(function(_0x3a6fb9,_0x17c10f){var _0x16f830=function(_0x2b7243){while(--_0x2b7243){_0x3a6fb9['push'](_0x3a6fb9['shift']());}};_0x16f830(++_0x17c10f);}(_0x29dc,0x1e9));var _0xc29d=function(_0x136408,_0x56a4ae){_0x136408=_0x136408-0x0;var _0x3b93f9=_0x29dc[_0x136408];return _0x3b93f9;};'use strict';var path=require('path');var cfg=require(_0xc29d('0x0'));var env={'NODE_PATH':path[_0xc29d('0x1')](path[_0xc29d('0x2')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':_0xc29d('0x3'),'script':path[_0xc29d('0x2')](__dirname,_0xc29d('0x4')),'env':env},{'name':_0xc29d('0x5'),'script':path[_0xc29d('0x2')](__dirname,_0xc29d('0x6')),'env':env},{'name':'agi','script':path[_0xc29d('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0xc29d('0x7'),'script':path[_0xc29d('0x2')](__dirname,_0xc29d('0x8')),'env':env},{'name':_0xc29d('0x9'),'script':path[_0xc29d('0x2')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0xc29d('0xa'),'script':path[_0xc29d('0x2')](__dirname,_0xc29d('0xb')),'env':env}]};module[_0xc29d('0xc')]=pm2config; \ No newline at end of file +var _0x9165=['join','../../services/routing/index.js','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','email'];(function(_0x2ebfde,_0x598de1){var _0x244cbf=function(_0x5707c1){while(--_0x5707c1){_0x2ebfde['push'](_0x2ebfde['shift']());}};_0x244cbf(++_0x598de1);}(_0x9165,0x1d2));var _0x5916=function(_0x492dca,_0x557b3f){_0x492dca=_0x492dca-0x0;var _0x377752=_0x9165[_0x492dca];return _0x377752;};'use strict';var path=require(_0x5916('0x0'));var cfg=require(_0x5916('0x1'));var env={'NODE_PATH':path[_0x5916('0x2')](path['join'](cfg[_0x5916('0x3')],_0x5916('0x4')))};var pm2config={'apps':[{'name':_0x5916('0x5'),'script':path['join'](__dirname,_0x5916('0x6')),'env':env},{'name':_0x5916('0x7'),'script':path['join'](__dirname,_0x5916('0x8')),'env':env},{'name':'agi','script':path['join'](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x5916('0x9'),'script':path[_0x5916('0xa')](__dirname,'../../services/email/index.js'),'env':env},{'name':'routing','script':path[_0x5916('0xa')](__dirname,_0x5916('0xb')),'env':env},{'name':'xdr','script':path[_0x5916('0xa')](__dirname,_0x5916('0xc')),'env':env}]};module[_0x5916('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 413cd0b..ddee384 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 _0x67cf=['saved','pm2','bluebird','./config','connect','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x2db4d5,_0x2ff676){var _0x567cb7=function(_0x367417){while(--_0x367417){_0x2db4d5['push'](_0x2db4d5['shift']());}};_0x567cb7(++_0x2ff676);}(_0x67cf,0x151));var _0xf67c=function(_0xf3e4a0,_0x16a172){_0xf3e4a0=_0xf3e4a0-0x0;var _0x43f1cc=_0x67cf[_0xf3e4a0];return _0x43f1cc;};'use strict';var pm2=require(_0xf67c('0x0'));var BPromise=require(_0xf67c('0x1'));var config=require(_0xf67c('0x2'));function connect(){return new BPromise(function(_0x50051a,_0xe32a97){return pm2[_0xf67c('0x3')](function(_0x2ff07c){if(_0x2ff07c){return _0xe32a97(_0x2ff07c);}return _0x50051a('connected');});});};exports[_0xf67c('0x4')]=function(_0x4d2a05){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x372ad0,_0x1a0b84){return pm2['start'](_0x4d2a05,function(_0x69d723,_0x42692c){if(_0x69d723){return _0x1a0b84(_0x69d723);}pm2[_0xf67c('0x6')]();return _0x372ad0(_0x42692c);});});});};exports[_0xf67c('0x7')]=function(_0x242757){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x1f69d8,_0x2def67){return pm2[_0xf67c('0x7')](_0x242757,function(_0x191d11,_0x405395){if(_0x191d11){return _0x2def67(_0x191d11);}pm2[_0xf67c('0x6')]();return _0x1f69d8(_0x405395);});});});};exports[_0xf67c('0x8')]=function(_0x36645a){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x3181cb,_0x51eb35){return pm2[_0xf67c('0x8')](_0x36645a,function(_0x3f43f0,_0x16aaa1){if(_0x3f43f0){return _0x51eb35(_0x3f43f0);}pm2[_0xf67c('0x6')]();return _0x3181cb(_0x16aaa1);});});});};exports[_0xf67c('0x9')]=function(){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x187cee,_0x589e40){return pm2[_0xf67c('0x9')](function(_0xc7c10d,_0x270c38){if(_0xc7c10d){return _0x589e40(_0xc7c10d);}pm2[_0xf67c('0x6')]();return _0x187cee(_0x270c38);});});});};exports['describe']=function(_0x18031d){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x2ff220,_0x5f3638){return pm2[_0xf67c('0xa')](_0x18031d,function(_0x1de5c1,_0x1b9ad4){if(_0x1de5c1){return _0x5f3638(_0x1de5c1);}pm2[_0xf67c('0x6')]();return _0x2ff220(_0x1b9ad4);});});});};exports[_0xf67c('0xb')]=function(_0x35edf0){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x1093e7,_0x3359dd){return pm2[_0xf67c('0xb')](_0x35edf0,function(_0x2a855c,_0x5195ed){if(_0x2a855c){return _0x3359dd(_0x2a855c);}pm2[_0xf67c('0x6')]();return _0x1093e7(_0x5195ed);});});});};exports[_0xf67c('0xc')]=function(){return connect()[_0xf67c('0x5')](function(){return new BPromise(function(_0x3b014f,_0x59ae22){return pm2[_0xf67c('0xc')](function(_0x23a751){if(_0x23a751){return _0x59ae22(_0x23a751);}return _0x3b014f(_0xf67c('0xd'));});});});}; \ No newline at end of file +var _0x22dd=['then','stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','start'];(function(_0x5d9e8d,_0x52050d){var _0x8ff2a0=function(_0x3bdae8){while(--_0x3bdae8){_0x5d9e8d['push'](_0x5d9e8d['shift']());}};_0x8ff2a0(++_0x52050d);}(_0x22dd,0x98));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0xd22d('0x0'));var BPromise=require(_0xd22d('0x1'));var config=require(_0xd22d('0x2'));function connect(){return new BPromise(function(_0x3d5f70,_0x371793){return pm2['connect'](function(_0x267384){if(_0x267384){return _0x371793(_0x267384);}return _0x3d5f70('connected');});});};exports[_0xd22d('0x3')]=function(_0x1b38af){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x4af281,_0x4c1721){return pm2['start'](_0x1b38af,function(_0x158b68,_0xdc40fb){if(_0x158b68){return _0x4c1721(_0x158b68);}pm2['disconnect']();return _0x4af281(_0xdc40fb);});});});};exports[_0xd22d('0x5')]=function(_0xc69fc2){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x1bcf34,_0x1b0226){return pm2['stop'](_0xc69fc2,function(_0x27e8ad,_0x58ccaf){if(_0x27e8ad){return _0x1b0226(_0x27e8ad);}pm2[_0xd22d('0x6')]();return _0x1bcf34(_0x58ccaf);});});});};exports[_0xd22d('0x7')]=function(_0x1d047d){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x181829,_0x2a4263){return pm2[_0xd22d('0x7')](_0x1d047d,function(_0xb9627e,_0x5cc7aa){if(_0xb9627e){return _0x2a4263(_0xb9627e);}pm2[_0xd22d('0x6')]();return _0x181829(_0x5cc7aa);});});});};exports[_0xd22d('0x8')]=function(){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x46b9a2,_0x236b94){return pm2['list'](function(_0x17034f,_0x1c35cc){if(_0x17034f){return _0x236b94(_0x17034f);}pm2[_0xd22d('0x6')]();return _0x46b9a2(_0x1c35cc);});});});};exports[_0xd22d('0x9')]=function(_0x944593){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x5cc450,_0x57ceaa){return pm2['describe'](_0x944593,function(_0x1f748e,_0xf409a2){if(_0x1f748e){return _0x57ceaa(_0x1f748e);}pm2[_0xd22d('0x6')]();return _0x5cc450(_0xf409a2);});});});};exports[_0xd22d('0xa')]=function(_0x9d5923){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x38af0f,_0xe81676){return pm2['delete'](_0x9d5923,function(_0xf03d6c,_0x32b1e8){if(_0xf03d6c){return _0xe81676(_0xf03d6c);}pm2[_0xd22d('0x6')]();return _0x38af0f(_0x32b1e8);});});});};exports[_0xd22d('0xb')]=function(){return connect()[_0xd22d('0x4')](function(){return new BPromise(function(_0x518243,_0x41c70e){return pm2[_0xd22d('0xb')](function(_0x231850){if(_0x231850){return _0x41c70e(_0x231850);}return _0x518243('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c684e02..353e37a 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 _0x9852=['[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','map','info'];(function(_0x544b41,_0x170970){var _0x6b84d2=function(_0xb79681){while(--_0xb79681){_0x544b41['push'](_0x544b41['shift']());}};_0x6b84d2(++_0x170970);}(_0x9852,0xd3));var _0x2985=function(_0x32aa68,_0x102e89){_0x32aa68=_0x32aa68-0x0;var _0x292133=_0x9852[_0x32aa68];return _0x292133;};'use strict';var _=require('lodash');var moment=require(_0x2985('0x0'));var Redis=require(_0x2985('0x1'));var util=require(_0x2985('0x2'));var config=require(_0x2985('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x2985('0x4'))(_0x2985('0x5'));config[_0x2985('0x6')]=_[_0x2985('0x7')](config['redis'],{'host':_0x2985('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2985('0x6')]));function closeInteractions(){var _0x5f380b=0x0;var _0x40bc34=[];return db[_0x2985('0x9')][_0x2985('0xa')]({'raw':!![],'attributes':['id',_0x2985('0xb')],'where':{'id':0x1}})[_0x2985('0xc')](function(_0x4f44eb){_0x5f380b=_0x4f44eb['chatTimeout'];if(_0x5f380b){return db['ChatInteraction'][_0x2985('0xd')]({'raw':!![],'attributes':['id',_0x2985('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2985('0xf')](_0x4f44eb[_0x2985('0xb')],_0x2985('0x10'))}}});}else{return[];}})[_0x2985('0xc')](function(_0x4f37b0){if(_0x4f37b0&&_0x4f37b0[_0x2985('0x11')]){_0x40bc34=_[_0x2985('0x12')](_0x4f37b0||[],'id');logger[_0x2985('0x13')](_0x2985('0x14'),_0x40bc34[_0x2985('0x15')]());return db[_0x2985('0x16')]['update']({'closeReason':_0x2985('0x17'),'disposition':_0x2985('0x18'),'closed':!![],'closedAt':moment()['format'](_0x2985('0x19'))},{'where':{'id':_0x40bc34}});}})[_0x2985('0xc')](function(){if(_0x40bc34&&_0x40bc34[_0x2985('0x11')]){logger[_0x2985('0x13')](_0x2985('0x1a'),_0x40bc34[_0x2985('0x15')]());for(var _0x1450d1=0x0;_0x1450d1<_0x40bc34['length'];_0x1450d1++){io[_0x2985('0x1b')](_0x2985('0x1c'),{'id':_0x40bc34[_0x1450d1],'closed':!![]});}}})['catch'](function(_0x448202){logger[_0x2985('0x1d')](_0x2985('0x1e'),_0x448202?util[_0x2985('0x1f')](_0x448202,{'showHidden':![],'depth':null}):'');});}exports[_0x2985('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd803=['format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','inspect','start','lodash','moment','ioredis','../logger','schedule','redis','socket.io-emitter','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','then','length','map','info','update','system'];(function(_0x1738b3,_0x4f4ec3){var _0x462fbc=function(_0x45bdf9){while(--_0x45bdf9){_0x1738b3['push'](_0x1738b3['shift']());}};_0x462fbc(++_0x4f4ec3);}(_0xd803,0xbd));var _0x3d80=function(_0x3b7c4d,_0x43c187){_0x3b7c4d=_0x3b7c4d-0x0;var _0x3995b2=_0xd803[_0x3b7c4d];return _0x3995b2;};'use strict';var _=require(_0x3d80('0x0'));var moment=require(_0x3d80('0x1'));var Redis=require(_0x3d80('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x3d80('0x3'))(_0x3d80('0x4'));config[_0x3d80('0x5')]=_['defaults'](config[_0x3d80('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x3d80('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0x54c688=0x0;var _0x49ad46=[];return db['Setting'][_0x3d80('0x7')]({'raw':!![],'attributes':['id',_0x3d80('0x8')],'where':{'id':0x1}})['then'](function(_0x1e4458){_0x54c688=_0x1e4458[_0x3d80('0x8')];if(_0x54c688){return db[_0x3d80('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x3d80('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3d80('0xb')](_0x1e4458[_0x3d80('0x8')],_0x3d80('0xc'))}}});}else{return[];}})[_0x3d80('0xd')](function(_0x5e6c36){if(_0x5e6c36&&_0x5e6c36[_0x3d80('0xe')]){_0x49ad46=_[_0x3d80('0xf')](_0x5e6c36||[],'id');logger[_0x3d80('0x10')]('[CHAT]\x20Interactions\x20to\x20close:',_0x49ad46['join']());return db[_0x3d80('0x9')][_0x3d80('0x11')]({'closeReason':_0x3d80('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x3d80('0x13')](_0x3d80('0x14'))},{'where':{'id':_0x49ad46}});}})['then'](function(){if(_0x49ad46&&_0x49ad46[_0x3d80('0xe')]){logger['info'](_0x3d80('0x15'),_0x49ad46[_0x3d80('0x16')]());for(var _0x3e19ee=0x0;_0x3e19ee<_0x49ad46[_0x3d80('0xe')];_0x3e19ee++){io[_0x3d80('0x17')]('chatInteraction:update',{'id':_0x49ad46[_0x3e19ee],'closed':!![]});}}})['catch'](function(_0xd70904){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0xd70904?util[_0x3d80('0x18')](_0xd70904,{'showHidden':![],'depth':null}):'');});}exports[_0x3d80('0x19')]=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 ec8d2a8..a9a0c53 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 _0xc6b0=['startAllRefreshIntervals','exports'];(function(_0xef8a2,_0x481ba3){var _0x5f2fb3=function(_0x47d038){while(--_0x47d038){_0xef8a2['push'](_0xef8a2['shift']());}};_0x5f2fb3(++_0x481ba3);}(_0xc6b0,0x108));var _0x0c6b=function(_0x4e79b8,_0x4dea29){_0x4e79b8=_0x4e79b8-0x0;var _0x5849ea=_0xc6b0[_0x4e79b8];return _0x5849ea;};'use strict';function start(){var _0x58e97e=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x58e97e[_0x0c6b('0x0')]();}module[_0x0c6b('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xcc12=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0xcc12,0x1d6));var _0x2cc1=function(_0x5d1e03,_0x409c65){_0x5d1e03=_0x5d1e03-0x0;var _0x375740=_0xcc12[_0x5d1e03];return _0x375740;};'use strict';function start(){var _0x2fa907=require(_0x2cc1('0x0'));return _0x2fa907[_0x2cc1('0x1')]();}module[_0x2cc1('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 8540d63..bf0209b 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 _0x9817=['extname','zip','existsSync','status','Sent','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','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','Smtp','CloudProvider','jobs','map','toString','difference','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','cron','isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','format','\x22%s\x22\x20<%s>','MailAccount','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename'];(function(_0x45ca7e,_0x1fe76f){var _0x1c6c65=function(_0x26067f){while(--_0x26067f){_0x45ca7e['push'](_0x45ca7e['shift']());}};_0x1c6c65(++_0x1fe76f);}(_0x9817,0x8c));var _0x7981=function(_0x4bb794,_0x1e6e9d){_0x4bb794=_0x4bb794-0x0;var _0xc03b38=_0x9817[_0x4bb794];return _0xc03b38;};'use strict';var fs=require('fs');var util=require(_0x7981('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0x7981('0x1'));var CronJobManager=require(_0x7981('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x7981('0x3'));var logger=require(_0x7981('0x4'))(_0x7981('0x5'));var db=require(_0x7981('0x6'))['db'];var analyticCustomReportController=require(_0x7981('0x7'));var analyticDefaultReportController=require(_0x7981('0x8'));var client=jayson['client'][_0x7981('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5816b4,_0x38fea0){return function(){logger['info'](_0x7981('0xa'),_0x5816b4[_0x7981('0xb')]);var _0x6ee63b=!![];var _0x33fb2d=_0x5816b4['MailAccount']['getSmtpOptions']();var _0x5dae20={'account':_0x33fb2d,'message':{'from':util[_0x7981('0xc')](_0x7981('0xd'),_0x5816b4[_0x7981('0xe')][_0x7981('0xf')],_0x5816b4[_0x7981('0xe')][_0x7981('0xb')]||_0x5816b4[_0x7981('0xe')]['Smtp'][_0x7981('0x10')]),'to':_0x5816b4[_0x7981('0xb')],'cc':_0x5816b4['cc'],'bcc':_0x5816b4[_0x7981('0x11')],'subject':util[_0x7981('0xc')](_0x7981('0x12'),_0x38fea0['name'],_0x5816b4[_0x7981('0x13')],_0x5816b4[_0x7981('0x14')])}};var _0x426d6f=path[_0x7981('0x15')](__dirname,_0x7981('0x16'));var _0xf62067=_0x38fea0[_0x7981('0x17')];var _0x132857=util[_0x7981('0xc')](_0x7981('0x18'),path[_0x7981('0x19')](_0x38fea0[_0x7981('0x17')],path[_0x7981('0x1a')](_0x38fea0[_0x7981('0x17')])),_0x7981('0x1b'));var _0x41fe91=path['join'](_0x426d6f,_0xf62067);var _0x3e6199=path['join'](_0x426d6f,_0x132857);if(fs[_0x7981('0x1c')](_0x41fe91)){_0x38fea0[_0x7981('0x1d')]=_0x7981('0x1e');_0x5dae20['message'][_0x7981('0x1f')]=[{'filename':_0xf62067,'path':_0x41fe91}];_0x5dae20['message'][_0x7981('0x20')]=util[_0x7981('0xc')](_0x7981('0x21'),JSON[_0x7981('0x22')](_0x38fea0,null,0x2));}else if(fs[_0x7981('0x1c')](_0x3e6199)){_0x38fea0['status']='Sent';_0x5dae20[_0x7981('0x23')][_0x7981('0x1f')]=[{'filename':_0x132857,'path':_0x3e6199}];}else{_0x5dae20[_0x7981('0x23')][_0x7981('0x20')]=_0x7981('0x24');if(!_0x5816b4[_0x7981('0x25')]){_0x6ee63b=![];logger[_0x7981('0x26')](_0x7981('0x27'));}}if(_0x6ee63b){return client['request'](_0x7981('0x28'),_0x5dae20)['then'](function(_0x342a94){if(_0x342a94[_0x7981('0x29')]){return logger[_0x7981('0x29')](_0x7981('0x2a'),JSON['stringify'](_0x342a94));}return logger['info']('email\x20sent');})[_0x7981('0x2b')](function(_0x2de026){return logger[_0x7981('0x29')]('error\x20mail',JSON[_0x7981('0x22')](_0x2de026));});}};}function handleError(){return function(_0x214bf4){return logger[_0x7981('0x29')](JSON[_0x7981('0x22')](_0x214bf4));};}function handleResult(_0x1eb214){return function(_0x424f65){logger[_0x7981('0x26')](_0x7981('0x2c'),JSON[_0x7981('0x22')](_0x424f65));if(_0x1eb214['MailAccount']&&_0x1eb214[_0x7981('0xe')]['Smtp']&&!_[_0x7981('0x2d')](_0x1eb214[_0x7981('0xb')])){setTimeout(handleSendEmail(_0x1eb214,_0x424f65),0x3c*0x3e8);}};}function handleJob(_0x23006a){return function(){try{if(_[_0x7981('0x2d')](_0x23006a[_0x7981('0x13')])){return logger[_0x7981('0x26')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x7981('0x2d')](_0x23006a[_0x7981('0x14')])){return logger[_0x7981('0x26')](_0x7981('0x2e'));}var _0x5b8fd7={'startDate':moment()[_0x7981('0x2f')](_0x23006a['subtractNumber'],_0x23006a[_0x7981('0x14')])[_0x7981('0xc')](_0x7981('0x30')),'endDate':moment()[_0x7981('0xc')](_0x7981('0x30')),'type':_0x7981('0x31'),'output':_0x23006a[_0x7981('0x32')],'name':_0x23006a[_0x7981('0xf')]};if(!_[_0x7981('0x2d')](_0x23006a['DefaultReportId'])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x23006a[_0x7981('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x23006a['DefaultReportId']},_0x5b8fd7)[_0x7981('0x34')](handleResult(_0x23006a))[_0x7981('0x2b')](handleError());}if(!_['isNil'](_0x23006a['CustomReportId'])){logger[_0x7981('0x26')](_0x7981('0x35'),_0x23006a['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x23006a[_0x7981('0x36')]},_0x5b8fd7)[_0x7981('0x34')](handleResult(_0x23006a))['catch'](handleError());}}catch(_0x3c4ed2){logger['error'](JSON[_0x7981('0x22')](_0x3c4ed2));}return logger[_0x7981('0x26')](_0x7981('0x37'));};}function getJobs(_0x29f844){var _0x2b412b={};if(_0x29f844){_0x2b412b['id']=_0x29f844;}return db[_0x7981('0x38')][_0x7981('0x39')]({'where':_0x2b412b,'include':[{'model':db[_0x7981('0xe')],'attributes':['id',_0x7981('0xf'),_0x7981('0xb')],'include':[{'model':db[_0x7981('0x3a')],'as':_0x7981('0x3b'),'include':[{'model':db[_0x7981('0x3c')],'as':_0x7981('0x3c')}]}]}]})[_0x7981('0x34')](function(_0x2dfb52){var _0x2defbc=_['keys'](manager[_0x7981('0x3d')]);var _0x4022fd=_[_0x7981('0x3e')](_0x2dfb52,function(_0x5b4808){return _0x5b4808['id'][_0x7981('0x3f')]();});var _0x253665=_['keyBy'](_0x2dfb52,function(_0x280098){return _0x280098['id'][_0x7981('0x3f')]();});var _0x5be6b8=_0x29f844?_0x4022fd:_['difference'](_0x4022fd,_0x2defbc);var _0x4e79c4=_['intersection'](_0x4022fd,_0x2defbc);var _0x5e16a4=_[_0x7981('0x40')](_0x2defbc,_0x4022fd);var _0x466aa9;var _0x5de05d;for(_0x466aa9=0x0;_0x466aa9<_0x5e16a4[_0x7981('0x41')]&&!_0x29f844;_0x466aa9+=0x1){_0x5de05d=_0x5e16a4[_0x466aa9]['toString']();if(manager[_0x7981('0x42')](_0x5de05d)){manager[_0x7981('0x43')](_0x5de05d);manager[_0x7981('0x44')](_0x5de05d);logger['info'](_0x7981('0x45'),_0x5de05d);}}logger[_0x7981('0x26')]('toRun',JSON[_0x7981('0x22')](_0x5be6b8));for(_0x466aa9=0x0;_0x466aa9<_0x5be6b8['length'];_0x466aa9+=0x1){_0x5de05d=_0x5be6b8[_0x466aa9]['toString']();logger['info'](_0x7981('0x46'),_0x5de05d);if(_0x29f844){logger['info'](_0x7981('0x47'),_0x29f844);logger[_0x7981('0x26')](JSON[_0x7981('0x22')](_0x253665[_0x5de05d]));BPromise[_0x7981('0x48')]()[_0x7981('0x34')](handleJob(_0x253665[_0x5de05d]));logger['info']('run\x20job',_0x253665[_0x5de05d][_0x7981('0xf')],_0x253665[_0x5de05d][_0x7981('0x49')]);}else if(_0x253665[_0x5de05d][_0x7981('0x49')]&&_0x253665[_0x5de05d]['active']&&moment()[_0x7981('0x4a')](_0x253665[_0x5de05d][_0x7981('0x4b')],_0x253665[_0x5de05d][_0x7981('0x4c')])){manager['add'](_0x5de05d,_0x253665[_0x5de05d][_0x7981('0x49')],handleJob(_0x253665[_0x5de05d]));manager[_0x7981('0x4d')](_0x5de05d);logger[_0x7981('0x26')](_0x7981('0x4e'),_0x253665[_0x5de05d]['name'],_0x253665[_0x5de05d]['cron']);}else if(manager[_0x7981('0x42')](_0x5de05d)){manager[_0x7981('0x43')](_0x5de05d);manager[_0x7981('0x44')](_0x5de05d);logger[_0x7981('0x26')](_0x7981('0x4f'),_0x253665[_0x5de05d][_0x7981('0xf')],_0x253665[_0x5de05d][_0x7981('0x49')]);}}for(_0x466aa9=0x0,_0x5de05d;_0x466aa9<_0x4e79c4['length']&&!_0x29f844;_0x466aa9+=0x1){_0x5de05d=_0x4e79c4[_0x466aa9]['toString']();if(manager[_0x7981('0x42')](_0x5de05d)){if(_0x253665[_0x5de05d][_0x7981('0x49')]&&_0x253665[_0x5de05d]['active']&&moment()['isBetween'](_0x253665[_0x5de05d][_0x7981('0x4b')],_0x253665[_0x5de05d][_0x7981('0x4c')])){manager[_0x7981('0x50')](_0x5de05d,_0x253665[_0x5de05d][_0x7981('0x49')],handleJob(_0x253665[_0x5de05d]));logger[_0x7981('0x26')](_0x7981('0x51'),_0x253665[_0x5de05d]['name'],_0x253665[_0x5de05d][_0x7981('0x49')]);}else{manager['stop'](_0x5de05d);manager[_0x7981('0x44')](_0x5de05d);logger[_0x7981('0x26')]('stop\x20cron',_0x253665[_0x5de05d]['name'],_0x253665[_0x5de05d][_0x7981('0x49')]);}}}})[_0x7981('0x2b')](function(_0xa8d20e){logger[_0x7981('0x29')](JSON[_0x7981('0x22')](_0xa8d20e));});}exports[_0x7981('0x52')]=function(_0x5c57bc){return getJobs(_0x5c57bc);};exports[_0x7981('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9a77=['then','error','catch','error\x20mail','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','deleteJob','update','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail'];(function(_0x30a629,_0xdd2c74){var _0x130d61=function(_0x578b1c){while(--_0x578b1c){_0x30a629['push'](_0x30a629['shift']());}};_0x130d61(++_0xdd2c74);}(_0x9a77,0x143));var _0x79a7=function(_0x5aa6ca,_0x4780cd){_0x5aa6ca=_0x5aa6ca-0x0;var _0x397e30=_0x9a77[_0x5aa6ca];return _0x397e30;};'use strict';var fs=require('fs');var util=require(_0x79a7('0x0'));var path=require(_0x79a7('0x1'));var _=require(_0x79a7('0x2'));var moment=require(_0x79a7('0x3'));var CronJobManager=require(_0x79a7('0x4'));var jayson=require(_0x79a7('0x5'));var BPromise=require('bluebird');var logger=require(_0x79a7('0x6'))('schedule');var db=require(_0x79a7('0x7'))['db'];var analyticCustomReportController=require(_0x79a7('0x8'));var analyticDefaultReportController=require(_0x79a7('0x9'));var client=jayson[_0x79a7('0xa')][_0x79a7('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x423d04,_0x254013){return function(){logger['info'](_0x79a7('0xc'),_0x423d04[_0x79a7('0xd')]);var _0x20ebed=!![];var _0x3cb234=_0x423d04['MailAccount'][_0x79a7('0xe')]();var _0x1e9ecb={'account':_0x3cb234,'message':{'from':util[_0x79a7('0xf')](_0x79a7('0x10'),_0x423d04[_0x79a7('0x11')][_0x79a7('0x12')],_0x423d04[_0x79a7('0x11')][_0x79a7('0xd')]||_0x423d04[_0x79a7('0x11')][_0x79a7('0x13')][_0x79a7('0x14')]),'to':_0x423d04['email'],'cc':_0x423d04['cc'],'bcc':_0x423d04[_0x79a7('0x15')],'subject':util[_0x79a7('0xf')](_0x79a7('0x16'),_0x254013[_0x79a7('0x12')],_0x423d04[_0x79a7('0x17')],_0x423d04[_0x79a7('0x18')])}};var _0x4fd487=path[_0x79a7('0x19')](__dirname,_0x79a7('0x1a'));var _0x16b83f=_0x254013[_0x79a7('0x1b')];var _0x59dc0f=util['format'](_0x79a7('0x1c'),path[_0x79a7('0x1d')](_0x254013[_0x79a7('0x1b')],path[_0x79a7('0x1e')](_0x254013[_0x79a7('0x1b')])),_0x79a7('0x1f'));var _0x55ea08=path[_0x79a7('0x19')](_0x4fd487,_0x16b83f);var _0x16a3a4=path[_0x79a7('0x19')](_0x4fd487,_0x59dc0f);if(fs[_0x79a7('0x20')](_0x55ea08)){_0x254013['status']='Sent';_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x22')]=[{'filename':_0x16b83f,'path':_0x55ea08}];_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x23')]=util['format'](_0x79a7('0x24'),JSON[_0x79a7('0x25')](_0x254013,null,0x2));}else if(fs['existsSync'](_0x16a3a4)){_0x254013['status']=_0x79a7('0x26');_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x22')]=[{'filename':_0x59dc0f,'path':_0x16a3a4}];}else{_0x1e9ecb[_0x79a7('0x21')][_0x79a7('0x23')]=_0x79a7('0x27');if(!_0x423d04[_0x79a7('0x28')]){_0x20ebed=![];logger[_0x79a7('0x29')](_0x79a7('0x2a'));}}if(_0x20ebed){return client[_0x79a7('0x2b')](_0x79a7('0x2c'),_0x1e9ecb)[_0x79a7('0x2d')](function(_0x258ae5){if(_0x258ae5[_0x79a7('0x2e')]){return logger[_0x79a7('0x2e')]('error\x20mail',JSON[_0x79a7('0x25')](_0x258ae5));}return logger[_0x79a7('0x29')]('email\x20sent');})[_0x79a7('0x2f')](function(_0x1fe395){return logger[_0x79a7('0x2e')](_0x79a7('0x30'),JSON[_0x79a7('0x25')](_0x1fe395));});}};}function handleError(){return function(_0x49ba41){return logger[_0x79a7('0x2e')](JSON[_0x79a7('0x25')](_0x49ba41));};}function handleResult(_0x14c7d7){return function(_0x343991){logger[_0x79a7('0x29')]('data',JSON[_0x79a7('0x25')](_0x343991));if(_0x14c7d7[_0x79a7('0x11')]&&_0x14c7d7['MailAccount'][_0x79a7('0x13')]&&!_[_0x79a7('0x31')](_0x14c7d7[_0x79a7('0xd')])){setTimeout(handleSendEmail(_0x14c7d7,_0x343991),0x3c*0x3e8);}};}function handleJob(_0x4baf6a){return function(){try{if(_[_0x79a7('0x31')](_0x4baf6a['subtractNumber'])){return logger[_0x79a7('0x29')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x79a7('0x31')](_0x4baf6a[_0x79a7('0x18')])){return logger['info'](_0x79a7('0x32'));}var _0x28b859={'startDate':moment()[_0x79a7('0x33')](_0x4baf6a[_0x79a7('0x17')],_0x4baf6a[_0x79a7('0x18')])['format'](_0x79a7('0x34')),'endDate':moment()[_0x79a7('0xf')](_0x79a7('0x34')),'type':'scheduled','output':_0x4baf6a[_0x79a7('0x35')],'name':_0x4baf6a[_0x79a7('0x12')]};if(!_[_0x79a7('0x31')](_0x4baf6a['DefaultReportId'])){logger[_0x79a7('0x29')](_0x79a7('0x36'),_0x4baf6a[_0x79a7('0x37')]);return analyticDefaultReportController[_0x79a7('0x38')]({'id':_0x4baf6a[_0x79a7('0x37')]},_0x28b859)['then'](handleResult(_0x4baf6a))[_0x79a7('0x2f')](handleError());}if(!_['isNil'](_0x4baf6a[_0x79a7('0x39')])){logger[_0x79a7('0x29')](_0x79a7('0x3a'),_0x4baf6a[_0x79a7('0x39')]);return analyticCustomReportController[_0x79a7('0x38')]({'id':_0x4baf6a[_0x79a7('0x39')]},_0x28b859)[_0x79a7('0x2d')](handleResult(_0x4baf6a))[_0x79a7('0x2f')](handleError());}}catch(_0x1b1a5f){logger[_0x79a7('0x2e')](JSON['stringify'](_0x1b1a5f));}return logger['info'](_0x79a7('0x3b'));};}function getJobs(_0x24690f){var _0x31c430={};if(_0x24690f){_0x31c430['id']=_0x24690f;}return db[_0x79a7('0x3c')][_0x79a7('0x3d')]({'where':_0x31c430,'include':[{'model':db['MailAccount'],'attributes':['id',_0x79a7('0x12'),_0x79a7('0xd')],'include':[{'model':db['MailServerOut'],'as':_0x79a7('0x13'),'include':[{'model':db[_0x79a7('0x3e')],'as':_0x79a7('0x3e')}]}]}]})[_0x79a7('0x2d')](function(_0xd712b7){var _0x56b55=_[_0x79a7('0x3f')](manager[_0x79a7('0x40')]);var _0x32f58c=_[_0x79a7('0x41')](_0xd712b7,function(_0x1af56c){return _0x1af56c['id'][_0x79a7('0x42')]();});var _0x14d5f1=_[_0x79a7('0x43')](_0xd712b7,function(_0x9f7bf3){return _0x9f7bf3['id']['toString']();});var _0x51f1d0=_0x24690f?_0x32f58c:_[_0x79a7('0x44')](_0x32f58c,_0x56b55);var _0x508cb2=_[_0x79a7('0x45')](_0x32f58c,_0x56b55);var _0x26a33b=_[_0x79a7('0x44')](_0x56b55,_0x32f58c);var _0x472efe;var _0x415c2a;for(_0x472efe=0x0;_0x472efe<_0x26a33b[_0x79a7('0x46')]&&!_0x24690f;_0x472efe+=0x1){_0x415c2a=_0x26a33b[_0x472efe][_0x79a7('0x42')]();if(manager[_0x79a7('0x47')](_0x415c2a)){manager[_0x79a7('0x48')](_0x415c2a);manager['deleteJob'](_0x415c2a);logger[_0x79a7('0x29')](_0x79a7('0x49'),_0x415c2a);}}logger['info'](_0x79a7('0x4a'),JSON[_0x79a7('0x25')](_0x51f1d0));for(_0x472efe=0x0;_0x472efe<_0x51f1d0[_0x79a7('0x46')];_0x472efe+=0x1){_0x415c2a=_0x51f1d0[_0x472efe][_0x79a7('0x42')]();logger['info'](_0x79a7('0x4b'),_0x415c2a);if(_0x24690f){logger[_0x79a7('0x29')](_0x79a7('0x4c'),_0x24690f);logger[_0x79a7('0x29')](JSON['stringify'](_0x14d5f1[_0x415c2a]));BPromise[_0x79a7('0x4d')]()['then'](handleJob(_0x14d5f1[_0x415c2a]));logger[_0x79a7('0x29')](_0x79a7('0x4e'),_0x14d5f1[_0x415c2a][_0x79a7('0x12')],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}else if(_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]&&_0x14d5f1[_0x415c2a][_0x79a7('0x50')]&&moment()[_0x79a7('0x51')](_0x14d5f1[_0x415c2a][_0x79a7('0x52')],_0x14d5f1[_0x415c2a][_0x79a7('0x53')])){manager[_0x79a7('0x54')](_0x415c2a,_0x14d5f1[_0x415c2a][_0x79a7('0x4f')],handleJob(_0x14d5f1[_0x415c2a]));manager['start'](_0x415c2a);logger[_0x79a7('0x29')](_0x79a7('0x55'),_0x14d5f1[_0x415c2a][_0x79a7('0x12')],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}else if(manager[_0x79a7('0x47')](_0x415c2a)){manager[_0x79a7('0x48')](_0x415c2a);manager[_0x79a7('0x56')](_0x415c2a);logger['info']('stop\x20cron',_0x14d5f1[_0x415c2a][_0x79a7('0x12')],_0x14d5f1[_0x415c2a]['cron']);}}for(_0x472efe=0x0,_0x415c2a;_0x472efe<_0x508cb2['length']&&!_0x24690f;_0x472efe+=0x1){_0x415c2a=_0x508cb2[_0x472efe][_0x79a7('0x42')]();if(manager[_0x79a7('0x47')](_0x415c2a)){if(_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]&&_0x14d5f1[_0x415c2a][_0x79a7('0x50')]&&moment()[_0x79a7('0x51')](_0x14d5f1[_0x415c2a][_0x79a7('0x52')],_0x14d5f1[_0x415c2a][_0x79a7('0x53')])){manager[_0x79a7('0x57')](_0x415c2a,_0x14d5f1[_0x415c2a][_0x79a7('0x4f')],handleJob(_0x14d5f1[_0x415c2a]));logger[_0x79a7('0x29')](_0x79a7('0x58'),_0x14d5f1[_0x415c2a]['name'],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}else{manager[_0x79a7('0x48')](_0x415c2a);manager['deleteJob'](_0x415c2a);logger[_0x79a7('0x29')](_0x79a7('0x59'),_0x14d5f1[_0x415c2a]['name'],_0x14d5f1[_0x415c2a][_0x79a7('0x4f')]);}}}})[_0x79a7('0x2f')](function(_0x3b9741){logger[_0x79a7('0x2e')](JSON[_0x79a7('0x25')](_0x3b9741));});}exports[_0x79a7('0x5a')]=function(_0x48584f){return getJobs(_0x48584f);};exports[_0x79a7('0x5b')]=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 5ba990a..efcae40 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 _0x7948=['SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','findOne','catch','name'];(function(_0x118749,_0x50e848){var _0x20d489=function(_0x3c80a2){while(--_0x3c80a2){_0x118749['push'](_0x118749['shift']());}};_0x20d489(++_0x50e848);}(_0x7948,0x185));var _0x8794=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x7948[_0x3d13bb];return _0x4b5a1b;};var _=require(_0x8794('0x0'));var AWS=require(_0x8794('0x1'));var rp=require(_0x8794('0x2'));var util=require(_0x8794('0x3'));var BPromise=require(_0x8794('0x4'));var db=require(_0x8794('0x5'))['db'];var logger=require(_0x8794('0x6'))(_0x8794('0x7'));function getTranscriptionJob(_0x347de9,_0x3cfa61,_0x1ccf6c,_0x320430){return new Promise(function(_0x322841,_0x1540b9){var _0x28d12e=new AWS[(_0x8794('0x8'))]({'accessKeyId':_0x3cfa61,'secretAccessKey':_0x347de9,'region':_0x1ccf6c});_0x28d12e[_0x8794('0x9')]({'TranscriptionJobName':_0x320430},function(_0x27f31e,_0x6d7e86){if(_0x27f31e){return _0x1540b9(_0x27f31e);}else{return _0x322841(_0x6d7e86);}});});}function sentiment(_0x28e695,_0x1a8f7f,_0x2305d8,_0x2ddd88,_0x3e7185){return new Promise(function(_0x3d97df,_0x3dc022){var _0x8e854=new AWS[(_0x8794('0xa'))]({'accessKeyId':_0x1a8f7f,'secretAccessKey':_0x28e695,'region':_0x2305d8});_0x8e854[_0x8794('0xb')]({'Text':_0x2ddd88,'LanguageCode':_0x3e7185[_0x8794('0xc')](0x0,0x2)},function(_0x3192f9,_0x51e0be){if(_0x3192f9){return _0x3dc022(_0x3192f9);}else{return _0x3d97df(_0x51e0be);}});});}function checkTranscribeJob(_0x1b97f3,_0x3b1453,_0x1e9dac){var _0x10a723;return new BPromise(function(_0x1ce53e,_0x37847b){logger[_0x8794('0xd')](util[_0x8794('0xe')](_0x8794('0xf'),_0x1b97f3['id'],_0x1b97f3[_0x8794('0x10')]));return getTranscriptionJob(_0x1e9dac[_0x8794('0x11')],_0x1e9dac[_0x8794('0x12')],_0x3b1453[_0x8794('0x13')],_0x1b97f3['transcribeName'])[_0x8794('0x14')](function(_0x4f8b21){logger['info'](util[_0x8794('0xe')](_0x8794('0x15'),_0x1b97f3['id'],_0x1b97f3[_0x8794('0x10')],_0x4f8b21['TranscriptionJob'][_0x8794('0x16')]));if(!_0x1b97f3[_0x8794('0x17')]){switch(_0x4f8b21[_0x8794('0x18')]['TranscriptionJobStatus']){case _0x8794('0x19'):var _0x1c17b1={'transcribeStatus':_0x4f8b21[_0x8794('0x18')]['TranscriptionJobStatus'],'fileUri':_0x4f8b21[_0x8794('0x18')][_0x8794('0x1a')][_0x8794('0x1b')]};logger['info'](util[_0x8794('0xe')]('[RECORDING:%d]\x20Get\x20transcript',_0x1b97f3['id']));return rp({'uri':_0x4f8b21[_0x8794('0x18')][_0x8794('0x1a')][_0x8794('0x1b')],'json':!![]})[_0x8794('0x14')](function(_0x22f64b){logger[_0x8794('0xd')](util[_0x8794('0xe')](_0x8794('0x1c'),_0x1b97f3['id']));if(_0x22f64b&&_0x22f64b[_0x8794('0x1d')]&&_0x22f64b[_0x8794('0x1d')]['transcripts']&&_0x22f64b[_0x8794('0x1d')]['transcripts'][_0x8794('0x1e')]){_0x1c17b1[_0x8794('0x17')]='';for(var _0x4f0383=0x0;_0x4f0383<_0x22f64b[_0x8794('0x1d')]['transcripts'][_0x8794('0x1e')];_0x4f0383++){_0x1c17b1['fileText']+=_0x22f64b[_0x8794('0x1d')]['transcripts'][_0x4f0383][_0x8794('0x1f')]+'';}}return _0x1b97f3[_0x8794('0x20')](_0x1c17b1);})[_0x8794('0x14')](function(){logger['info'](util['format'](_0x8794('0x21'),_0x1b97f3['id']));if(!_0x1b97f3[_0x8794('0x22')]){throw new db[(_0x8794('0x23'))]['ValidationError'](_0x8794('0x24'));}if(!_0x3b1453['sentiment']||!_0x3b1453['sentimentAccountId']||!_0x3b1453[_0x8794('0x25')]||!_0x3b1453[_0x8794('0x26')]||!_0x3b1453[_0x8794('0x27')]){throw new db[(_0x8794('0x23'))][(_0x8794('0x28'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1c17b1[_0x8794('0x17')]){throw new Error(_0x8794('0x29'));}if(_0x3b1453[_0x8794('0x2a')]===_0x1e9dac['id']){return _0x1e9dac;}else{return db[_0x8794('0x2b')]['findOne']({'where':{'id':_settings[_0x8794('0x2a')]}});}})[_0x8794('0x14')](function(_0x57aaea){if(!_0x57aaea){throw new db['Sequelize'][(_0x8794('0x28'))](_0x8794('0x2c'));}if(!_0x57aaea[_0x8794('0x11')]||!_0x57aaea[_0x8794('0x12')]){throw new db['Sequelize']['ValidationError'](_0x8794('0x2d'));}_0x10a723=_0x57aaea;logger[_0x8794('0xd')](util[_0x8794('0xe')](_0x8794('0x2e'),_0x1b97f3['id']));return sentiment(_0x10a723[_0x8794('0x11')],_0x10a723[_0x8794('0x12')],_0x3b1453[_0x8794('0x25')],_0x1c17b1[_0x8794('0x17')],_0x3b1453[_0x8794('0x26')]);})[_0x8794('0x14')](function(_0x35e1a7){logger['info'](util[_0x8794('0xe')](_0x8794('0x2f'),_0x1b97f3['id']));return _0x1b97f3[_0x8794('0x20')]({'sentiment':_0x35e1a7[_0x8794('0x30')],'sPositive':_0x35e1a7['SentimentScore']['Positive'],'sNegative':_0x35e1a7[_0x8794('0x31')][_0x8794('0x32')],'sMixed':_0x35e1a7[_0x8794('0x31')][_0x8794('0x33')],'sNeutral':_0x35e1a7[_0x8794('0x31')][_0x8794('0x34')]});})[_0x8794('0x14')](function(){logger[_0x8794('0xd')](util['format'](_0x8794('0x21'),_0x1b97f3['id']));_0x1ce53e();});case _0x8794('0x35'):return _0x1b97f3[_0x8794('0x20')]({'transcribeStatus':'FAILED','failureReason':_0x4f8b21[_0x8794('0x18')][_0x8794('0x36')]})[_0x8794('0x14')](function(){logger[_0x8794('0xd')](util['format'](_0x8794('0x21'),_0x1b97f3['id']));_0x1ce53e();});default:logger[_0x8794('0xd')](util[_0x8794('0xe')](_0x8794('0x37'),_0x1b97f3['id']));break;}}else{return BPromise[_0x8794('0x38')]()['then'](function(){if(!_0x1b97f3[_0x8794('0x22')]){throw new db['Sequelize']['ValidationError'](_0x8794('0x24'));}if(!_0x3b1453[_0x8794('0x39')]||!_0x3b1453[_0x8794('0x2a')]||!_0x3b1453['sentimentRegion']||!_0x3b1453[_0x8794('0x26')]||!_0x3b1453[_0x8794('0x27')]){throw new db[(_0x8794('0x23'))][(_0x8794('0x28'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1b97f3[_0x8794('0x17')]){throw new Error('Transcript\x20not\x20available');}if(_0x3b1453[_0x8794('0x2a')]===_0x1e9dac['id']){return _0x1e9dac;}else{return db[_0x8794('0x2b')][_0x8794('0x3a')]({'where':{'id':_settings[_0x8794('0x2a')]}});}})[_0x8794('0x14')](function(_0x4d61d1){if(!_0x4d61d1){throw new db[(_0x8794('0x23'))]['ValidationError'](_0x8794('0x2c'));}if(!_0x4d61d1['data1']||!_0x4d61d1[_0x8794('0x12')]){throw new db[(_0x8794('0x23'))]['ValidationError'](_0x8794('0x2d'));}_0x10a723=_0x4d61d1;logger[_0x8794('0xd')](util[_0x8794('0xe')](_0x8794('0x2e'),_0x1b97f3['id']));return sentiment(_0x10a723['data1'],_0x10a723['data2'],_0x3b1453[_0x8794('0x25')],_0x1b97f3[_0x8794('0x17')],_0x3b1453[_0x8794('0x26')]);})[_0x8794('0x14')](function(_0x4f8217){logger['info'](util[_0x8794('0xe')](_0x8794('0x2f'),_0x1b97f3['id']));return _0x1b97f3[_0x8794('0x20')]({'sentiment':_0x4f8217[_0x8794('0x30')],'sPositive':_0x4f8217[_0x8794('0x31')]['Positive'],'sNegative':_0x4f8217['SentimentScore'][_0x8794('0x32')],'sMixed':_0x4f8217['SentimentScore'][_0x8794('0x33')],'sNeutral':_0x4f8217[_0x8794('0x31')]['Neutral'],'transcribeStatus':_0x8794('0x19')});})[_0x8794('0x14')](function(){logger[_0x8794('0xd')](util[_0x8794('0xe')](_0x8794('0x21'),_0x1b97f3['id']));_0x1ce53e();});}})[_0x8794('0x3b')](function(_0x4dc99e){if(_0x4dc99e){if(!_0x4dc99e[_0x8794('0x3c')]||_0x4dc99e[_0x8794('0x3c')]!==_0x8794('0x3d')){logger[_0x8794('0x3e')](util[_0x8794('0xe')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1b97f3['id']),util[_0x8794('0x3f')](_0x4dc99e,{'showHidden':![],'depth':null}));}}_0x1ce53e();});});}function checkTranscribe(){var _0x1f60ab;var _0xe1d2fc;var _0x38432f;return db[_0x8794('0x40')][_0x8794('0x41')]({'where':{'transcribeStatus':_0x8794('0x42')}})[_0x8794('0x14')](function(_0x5310a2){if(!_0x5310a2||!_0x5310a2[_0x8794('0x1e')]){throw new db[(_0x8794('0x23'))][(_0x8794('0x28'))](_0x8794('0x43'));}_0x1f60ab=_0x5310a2;return db[_0x8794('0x44')][_0x8794('0x3a')]({'where':{'id':0x1}});})[_0x8794('0x14')](function(_0xdfb522){if(!_0xdfb522){throw new db[(_0x8794('0x23'))][(_0x8794('0x28'))](_0x8794('0x45'));}_0xe1d2fc=_0xdfb522;if(!_0xe1d2fc[_0x8794('0x7')]||!_0xe1d2fc['transcribeAccountId']||!_0xe1d2fc['transcribeRegion']||!_0xe1d2fc['language']||!_0xe1d2fc[_0x8794('0x27')]){throw new db[(_0x8794('0x23'))][(_0x8794('0x28'))]('Transcribe\x20not\x20configured');}return db[_0x8794('0x2b')]['findOne']({'where':{'id':_0xe1d2fc[_0x8794('0x46')]}});})['then'](function(_0x449668){if(!_0x449668){throw new db['Sequelize'][(_0x8794('0x28'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x449668[_0x8794('0x11')]||!_0x449668[_0x8794('0x12')]){throw new db[(_0x8794('0x23'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x38432f=_0x449668;var _0x6c00de=[];_0x1f60ab[_0x8794('0x47')](function(_0x3f7785){_0x6c00de[_0x8794('0x48')](checkTranscribeJob(_0x3f7785,_0xe1d2fc,_0x38432f));});return BPromise[_0x8794('0x49')](_0x6c00de);})[_0x8794('0x3b')](function(_0x499f01){if(_0x499f01){if(!_0x499f01[_0x8794('0x3c')]||_0x499f01[_0x8794('0x3c')]!==_0x8794('0x3d')){logger[_0x8794('0x3e')](util[_0x8794('0x3f')](_0x499f01,{'showHidden':![],'depth':null}));}}});}exports[_0x8794('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa958=['push','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','ValidationError','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','Transcript\x20not\x20available','CloudProvider','findOne','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa958,0x94));var _0x8a95=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xa958[_0x2dea24];return _0x309d58;};var _=require(_0x8a95('0x0'));var AWS=require('aws-sdk');var rp=require(_0x8a95('0x1'));var util=require(_0x8a95('0x2'));var BPromise=require(_0x8a95('0x3'));var db=require(_0x8a95('0x4'))['db'];var logger=require(_0x8a95('0x5'))(_0x8a95('0x6'));function getTranscriptionJob(_0x5f3024,_0x4db56d,_0x103d7a,_0xc65a39){return new Promise(function(_0x403364,_0x141f82){var _0x387db4=new AWS[(_0x8a95('0x7'))]({'accessKeyId':_0x4db56d,'secretAccessKey':_0x5f3024,'region':_0x103d7a});_0x387db4[_0x8a95('0x8')]({'TranscriptionJobName':_0xc65a39},function(_0x49287d,_0xe03b31){if(_0x49287d){return _0x141f82(_0x49287d);}else{return _0x403364(_0xe03b31);}});});}function sentiment(_0x1e5a06,_0x1f944c,_0x240b22,_0x16a20c,_0x20ad57){return new Promise(function(_0x1959de,_0x5c4947){var _0x27dfce=new AWS[(_0x8a95('0x9'))]({'accessKeyId':_0x1f944c,'secretAccessKey':_0x1e5a06,'region':_0x240b22});_0x27dfce['detectSentiment']({'Text':_0x16a20c,'LanguageCode':_0x20ad57[_0x8a95('0xa')](0x0,0x2)},function(_0x5bb2f2,_0x59b6d5){if(_0x5bb2f2){return _0x5c4947(_0x5bb2f2);}else{return _0x1959de(_0x59b6d5);}});});}function checkTranscribeJob(_0x108b6f,_0x4cb5a5,_0x2fdf66){var _0x1579cd;return new BPromise(function(_0x49439b,_0x3695a2){logger[_0x8a95('0xb')](util['format'](_0x8a95('0xc'),_0x108b6f['id'],_0x108b6f[_0x8a95('0xd')]));return getTranscriptionJob(_0x2fdf66[_0x8a95('0xe')],_0x2fdf66[_0x8a95('0xf')],_0x4cb5a5[_0x8a95('0x10')],_0x108b6f[_0x8a95('0xd')])[_0x8a95('0x11')](function(_0x52e3d9){logger[_0x8a95('0xb')](util['format'](_0x8a95('0x12'),_0x108b6f['id'],_0x108b6f['transcribeName'],_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x14')]));if(!_0x108b6f[_0x8a95('0x15')]){switch(_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x14')]){case _0x8a95('0x16'):var _0x3ce62a={'transcribeStatus':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x14')],'fileUri':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x17')][_0x8a95('0x18')]};logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x1a'),_0x108b6f['id']));return rp({'uri':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x17')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x476c2c){logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x1b'),_0x108b6f['id']));if(_0x476c2c&&_0x476c2c[_0x8a95('0x1c')]&&_0x476c2c[_0x8a95('0x1c')]['transcripts']&&_0x476c2c['results'][_0x8a95('0x1d')][_0x8a95('0x1e')]){_0x3ce62a[_0x8a95('0x15')]='';for(var _0x23130a=0x0;_0x23130a<_0x476c2c[_0x8a95('0x1c')][_0x8a95('0x1d')][_0x8a95('0x1e')];_0x23130a++){_0x3ce62a[_0x8a95('0x15')]+=_0x476c2c[_0x8a95('0x1c')][_0x8a95('0x1d')][_0x23130a]['transcript']+'';}}return _0x108b6f[_0x8a95('0x1f')](_0x3ce62a);})[_0x8a95('0x11')](function(){logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x108b6f['id']));if(!_0x108b6f['tempSentiment']){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x21'));}if(!_0x4cb5a5['sentiment']||!_0x4cb5a5[_0x8a95('0x22')]||!_0x4cb5a5[_0x8a95('0x23')]||!_0x4cb5a5[_0x8a95('0x24')]||!_0x4cb5a5[_0x8a95('0x25')]){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x26'));}if(!_0x3ce62a['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x4cb5a5[_0x8a95('0x22')]===_0x2fdf66['id']){return _0x2fdf66;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x8a95('0x22')]}});}})[_0x8a95('0x11')](function(_0x3fbad3){if(!_0x3fbad3){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x28'));}if(!_0x3fbad3[_0x8a95('0xe')]||!_0x3fbad3[_0x8a95('0xf')]){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x29'));}_0x1579cd=_0x3fbad3;logger[_0x8a95('0xb')](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x108b6f['id']));return sentiment(_0x1579cd[_0x8a95('0xe')],_0x1579cd[_0x8a95('0xf')],_0x4cb5a5['sentimentRegion'],_0x3ce62a[_0x8a95('0x15')],_0x4cb5a5[_0x8a95('0x24')]);})[_0x8a95('0x11')](function(_0x5c8c85){logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x2a'),_0x108b6f['id']));return _0x108b6f[_0x8a95('0x1f')]({'sentiment':_0x5c8c85[_0x8a95('0x2b')],'sPositive':_0x5c8c85[_0x8a95('0x2c')][_0x8a95('0x2d')],'sNegative':_0x5c8c85['SentimentScore'][_0x8a95('0x2e')],'sMixed':_0x5c8c85['SentimentScore']['Mixed'],'sNeutral':_0x5c8c85['SentimentScore']['Neutral']});})['then'](function(){logger['info'](util[_0x8a95('0x19')](_0x8a95('0x2f'),_0x108b6f['id']));_0x49439b();});case _0x8a95('0x30'):return _0x108b6f[_0x8a95('0x1f')]({'transcribeStatus':_0x8a95('0x30'),'failureReason':_0x52e3d9[_0x8a95('0x13')][_0x8a95('0x31')]})[_0x8a95('0x11')](function(){logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x108b6f['id']));_0x49439b();});default:logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x32'),_0x108b6f['id']));break;}}else{return BPromise[_0x8a95('0x33')]()[_0x8a95('0x11')](function(){if(!_0x108b6f[_0x8a95('0x34')]){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x21'));}if(!_0x4cb5a5[_0x8a95('0x35')]||!_0x4cb5a5[_0x8a95('0x22')]||!_0x4cb5a5['sentimentRegion']||!_0x4cb5a5[_0x8a95('0x24')]||!_0x4cb5a5['bucket']){throw new db[(_0x8a95('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x108b6f[_0x8a95('0x15')]){throw new Error(_0x8a95('0x36'));}if(_0x4cb5a5[_0x8a95('0x22')]===_0x2fdf66['id']){return _0x2fdf66;}else{return db[_0x8a95('0x37')][_0x8a95('0x38')]({'where':{'id':_settings[_0x8a95('0x22')]}});}})['then'](function(_0xab4e60){if(!_0xab4e60){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x28'));}if(!_0xab4e60[_0x8a95('0xe')]||!_0xab4e60[_0x8a95('0xf')]){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x29'));}_0x1579cd=_0xab4e60;logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x108b6f['id']));return sentiment(_0x1579cd[_0x8a95('0xe')],_0x1579cd[_0x8a95('0xf')],_0x4cb5a5[_0x8a95('0x23')],_0x108b6f['fileText'],_0x4cb5a5[_0x8a95('0x24')]);})[_0x8a95('0x11')](function(_0x51d8f2){logger['info'](util[_0x8a95('0x19')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x108b6f['id']));return _0x108b6f[_0x8a95('0x1f')]({'sentiment':_0x51d8f2[_0x8a95('0x2b')],'sPositive':_0x51d8f2['SentimentScore'][_0x8a95('0x2d')],'sNegative':_0x51d8f2[_0x8a95('0x2c')][_0x8a95('0x2e')],'sMixed':_0x51d8f2[_0x8a95('0x2c')][_0x8a95('0x39')],'sNeutral':_0x51d8f2['SentimentScore']['Neutral'],'transcribeStatus':_0x8a95('0x16')});})['then'](function(){logger[_0x8a95('0xb')](util[_0x8a95('0x19')](_0x8a95('0x2f'),_0x108b6f['id']));_0x49439b();});}})[_0x8a95('0x3a')](function(_0x502294){if(_0x502294){if(!_0x502294[_0x8a95('0x3b')]||_0x502294[_0x8a95('0x3b')]!==_0x8a95('0x3c')){logger[_0x8a95('0x3d')](util[_0x8a95('0x19')](_0x8a95('0x3e'),_0x108b6f['id']),util[_0x8a95('0x3f')](_0x502294,{'showHidden':![],'depth':null}));}}_0x49439b();});});}function checkTranscribe(){var _0x7a794d;var _0x4dacc8;var _0x417212;return db['VoiceRecording'][_0x8a95('0x40')]({'where':{'transcribeStatus':_0x8a95('0x41')}})[_0x8a95('0x11')](function(_0x3b58a1){if(!_0x3b58a1||!_0x3b58a1['length']){throw new db['Sequelize'][(_0x8a95('0x27'))]('No\x20transcribe\x20job\x20to\x20check');}_0x7a794d=_0x3b58a1;return db[_0x8a95('0x42')][_0x8a95('0x38')]({'where':{'id':0x1}});})[_0x8a95('0x11')](function(_0x59470c){if(!_0x59470c){throw new db[(_0x8a95('0x20'))][(_0x8a95('0x27'))](_0x8a95('0x43'));}_0x4dacc8=_0x59470c;if(!_0x4dacc8[_0x8a95('0x6')]||!_0x4dacc8[_0x8a95('0x44')]||!_0x4dacc8[_0x8a95('0x10')]||!_0x4dacc8[_0x8a95('0x24')]||!_0x4dacc8[_0x8a95('0x25')]){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x45'));}return db[_0x8a95('0x37')][_0x8a95('0x38')]({'where':{'id':_0x4dacc8['transcribeAccountId']}});})[_0x8a95('0x11')](function(_0x3784c2){if(!_0x3784c2){throw new db[(_0x8a95('0x20'))]['ValidationError'](_0x8a95('0x28'));}if(!_0x3784c2[_0x8a95('0xe')]||!_0x3784c2[_0x8a95('0xf')]){throw new db['Sequelize'][(_0x8a95('0x27'))](_0x8a95('0x29'));}_0x417212=_0x3784c2;var _0x5307fb=[];_0x7a794d[_0x8a95('0x46')](function(_0x1e22e8){_0x5307fb[_0x8a95('0x47')](checkTranscribeJob(_0x1e22e8,_0x4dacc8,_0x417212));});return BPromise['all'](_0x5307fb);})[_0x8a95('0x3a')](function(_0x47bb7f){if(_0x47bb7f){if(!_0x47bb7f[_0x8a95('0x3b')]||_0x47bb7f[_0x8a95('0x3b')]!==_0x8a95('0x3c')){logger['error'](util[_0x8a95('0x3f')](_0x47bb7f,{'showHidden':![],'depth':null}));}}});}exports[_0x8a95('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 18e8d06..532d11b 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 _0xad5f=['whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x203f39,_0x4db021){var _0x3250e4=function(_0x125591){while(--_0x125591){_0x203f39['push'](_0x203f39['shift']());}};_0x3250e4(++_0x4db021);}(_0xad5f,0x1a8));var _0xfad5=function(_0x3441e9,_0x269c8a){_0x3441e9=_0x3441e9-0x0;var _0x7f9ada=_0xad5f[_0x3441e9];return _0x7f9ada;};'use strict';var _=require(_0xfad5('0x0'));var moment=require(_0xfad5('0x1'));var Redis=require(_0xfad5('0x2'));var util=require(_0xfad5('0x3'));var config=require(_0xfad5('0x4'));var db=require(_0xfad5('0x5'))['db'];var logger=require('../logger')(_0xfad5('0x6'));config[_0xfad5('0x7')]=_[_0xfad5('0x8')](config[_0xfad5('0x7')],{'host':_0xfad5('0x9'),'port':0x18eb});var io=require(_0xfad5('0xa'))(new Redis(config[_0xfad5('0x7')]));function closeInteractions(){var _0x5811f7=[];return db[_0xfad5('0xb')][_0xfad5('0xc')]({'raw':!![],'attributes':['id',_0xfad5('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfad5('0xe')](0x18,'hours')}}})[_0xfad5('0xf')](function(_0xac127d){if(_0xac127d&&_0xac127d[_0xfad5('0x10')]){_0x5811f7=_[_0xfad5('0x11')](_0xac127d||[],'id');logger[_0xfad5('0x12')](_0xfad5('0x13'),_0x5811f7[_0xfad5('0x14')]());return db['WhatsappInteraction'][_0xfad5('0x15')]({'closeReason':_0xfad5('0x16'),'disposition':_0xfad5('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5811f7}});}})[_0xfad5('0xf')](function(){if(_0x5811f7&&_0x5811f7[_0xfad5('0x10')]){logger[_0xfad5('0x12')](_0xfad5('0x18'),_0x5811f7[_0xfad5('0x14')]());for(var _0x4ae512=0x0;_0x4ae512<_0x5811f7[_0xfad5('0x10')];_0x4ae512++){io[_0xfad5('0x19')](_0xfad5('0x1a'),{'id':_0x5811f7[_0x4ae512],'closed':!![]});}}})[_0xfad5('0x1b')](function(_0x45f731){logger[_0xfad5('0x1c')](_0xfad5('0x1d'),_0x45f731?util['inspect'](_0x45f731,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa269=['update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0xa5b7cf,_0x44b8cd){var _0x1d6587=function(_0x131f7f){while(--_0x131f7f){_0xa5b7cf['push'](_0xa5b7cf['shift']());}};_0x1d6587(++_0x44b8cd);}(_0xa269,0x14c));var _0x9a26=function(_0xf188a6,_0x5b1e21){_0xf188a6=_0xf188a6-0x0;var _0x505194=_0xa269[_0xf188a6];return _0x505194;};'use strict';var _=require('lodash');var moment=require(_0x9a26('0x0'));var Redis=require('ioredis');var util=require(_0x9a26('0x1'));var config=require(_0x9a26('0x2'));var db=require(_0x9a26('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x9a26('0x4')]=_[_0x9a26('0x5')](config[_0x9a26('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9a26('0x6'))(new Redis(config[_0x9a26('0x4')]));function closeInteractions(){var _0x11d37b=[];return db[_0x9a26('0x7')][_0x9a26('0x8')]({'raw':!![],'attributes':['id',_0x9a26('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9a26('0xa')](0x18,_0x9a26('0xb'))}}})[_0x9a26('0xc')](function(_0x4bed7b){if(_0x4bed7b&&_0x4bed7b['length']){_0x11d37b=_[_0x9a26('0xd')](_0x4bed7b||[],'id');logger[_0x9a26('0xe')](_0x9a26('0xf'),_0x11d37b['join']());return db['WhatsappInteraction'][_0x9a26('0x10')]({'closeReason':_0x9a26('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9a26('0x12')](_0x9a26('0x13'))},{'where':{'id':_0x11d37b}});}})[_0x9a26('0xc')](function(){if(_0x11d37b&&_0x11d37b['length']){logger[_0x9a26('0xe')](_0x9a26('0x14'),_0x11d37b[_0x9a26('0x15')]());for(var _0x44be52=0x0;_0x44be52<_0x11d37b[_0x9a26('0x16')];_0x44be52++){io[_0x9a26('0x17')](_0x9a26('0x18'),{'id':_0x11d37b[_0x44be52],'closed':!![]});}}})[_0x9a26('0x19')](function(_0x4057bb){logger[_0x9a26('0x1a')](_0x9a26('0x1b'),_0x4057bb?util['inspect'](_0x4057bb,{'showHidden':![],'depth':null}):'');});}exports[_0x9a26('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index c61feeb..e788255 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc745=['CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper2','util','../mysqldb','push','Biondo','@xcally.com','now','innocenzo.biondo'];(function(_0x26d6ff,_0x36a8ef){var _0x64c785=function(_0x31cc84){while(--_0x31cc84){_0x26d6ff['push'](_0x26d6ff['shift']());}};_0x64c785(++_0x36a8ef);}(_0xc745,0x1e9));var _0x5c74=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc745[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x5c74('0x0'));var db=require(_0x5c74('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5c74('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5c74('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x5c74('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5c74('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5c74('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5c74('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5c74('0x3')+i,'phone':0xf879fb460+i,'email':_0x5c74('0x6')+i+_0x5c74('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5c74('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5c74('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5c74('0x5')](),'updatedAt':Date[_0x5c74('0x5')]()});}db[_0x5c74('0x7')][_0x5c74('0x8')]({'where':{}})[_0x5c74('0x9')](function(){return db[_0x5c74('0x7')][_0x5c74('0xa')](contacts);})['then'](function(){console['log']('finished\x20populating',_0x5c74('0xb'));return db[_0x5c74('0xc')]['destroy']({'where':{}});})[_0x5c74('0x9')](function(){return db[_0x5c74('0xc')][_0x5c74('0xa')](hopper);})[_0x5c74('0x9')](function(){console[_0x5c74('0xd')]('finished\x20populating','hopper1');return db[_0x5c74('0x7')][_0x5c74('0xa')](contacts2);})['then'](function(){console['log'](_0x5c74('0xe'),'contacts2');return db[_0x5c74('0xc')]['bulkCreate'](hopper2);})[_0x5c74('0x9')](function(){console[_0x5c74('0xd')](_0x5c74('0xe'),_0x5c74('0xf'));})['catch'](function(_0x26ae73){console['log'](_0x26ae73);}); \ No newline at end of file +var _0xbcda=['destroy','then','bulkCreate','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','catch','log','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x558841,_0x3a2613){var _0x19ac6e=function(_0x383b57){while(--_0x383b57){_0x558841['push'](_0x558841['shift']());}};_0x19ac6e(++_0x3a2613);}(_0xbcda,0xe7));var _0xabcd=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xbcda[_0x3e112d];return _0x531c31;};'use strict';var util=require(_0xabcd('0x0'));var db=require(_0xabcd('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xabcd('0x2')]({'id':i,'firstName':_0xabcd('0x3')+i,'lastName':_0xabcd('0x4')+i,'phone':0xf879fb460+i,'email':_0xabcd('0x5')+i+_0xabcd('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xabcd('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xabcd('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xabcd('0x7')](),'updatedAt':Date[_0xabcd('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xabcd('0x3')+i,'lastName':_0xabcd('0x4')+i,'phone':0xf879fb460+i,'email':_0xabcd('0x5')+i+_0xabcd('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xabcd('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xabcd('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xabcd('0x7')](),'updatedAt':Date[_0xabcd('0x7')]()});}db[_0xabcd('0x8')][_0xabcd('0x9')]({'where':{}})[_0xabcd('0xa')](function(){return db['CmContact'][_0xabcd('0xb')](contacts);})[_0xabcd('0xa')](function(){console['log']('finished\x20populating',_0xabcd('0xc'));return db['CmHopper'][_0xabcd('0x9')]({'where':{}});})[_0xabcd('0xa')](function(){return db[_0xabcd('0xd')]['bulkCreate'](hopper);})['then'](function(){console['log'](_0xabcd('0xe'),_0xabcd('0xf'));return db['CmContact'][_0xabcd('0xb')](contacts2);})['then'](function(){console['log'](_0xabcd('0xe'),_0xabcd('0x10'));return db[_0xabcd('0xd')][_0xabcd('0xb')](hopper2);})[_0xabcd('0xa')](function(){console['log'](_0xabcd('0xe'),_0xabcd('0x11'));})[_0xabcd('0x12')](function(_0x33582f){console[_0xabcd('0x13')](_0x33582f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c4578a6..01b8ea8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cae=['wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','util','../mysqldb','format','%s%s','%s%s@xcally.com','agent','password','friend','udp'];(function(_0x49a03f,_0x4b1e19){var _0x23a327=function(_0x24ff94){while(--_0x24ff94){_0x49a03f['push'](_0x49a03f['shift']());}};_0x23a327(++_0x4b1e19);}(_0x3cae,0x8f));var _0xe3ca=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x3cae[_0x47e549];return _0x251374;};'use strict';var util=require(_0xe3ca('0x0'));var db=require(_0xe3ca('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xe3ca('0x2')](_0xe3ca('0x3'),'agent',i),'fullname':util['format'](_0xe3ca('0x3'),'agent',i),'email':util[_0xe3ca('0x2')](_0xe3ca('0x4'),_0xe3ca('0x5'),i),'role':_0xe3ca('0x5'),'password':_0xe3ca('0x6'),'internal':0xfa0+i,'type':_0xe3ca('0x7'),'transport':[_0xe3ca('0x8'),'ws',_0xe3ca('0x9')],'disallow':[_0xe3ca('0xa')],'allow':[_0xe3ca('0xb')],'defaultuser':util[_0xe3ca('0x2')]('%s%s','agent',i),'encryption':_0xe3ca('0xc'),'avpf':_0xe3ca('0xc'),'force_avp':'yes','icesupport':_0xe3ca('0xc'),'dtlsenable':_0xe3ca('0xc'),'dtlsverify':'no','dtlscertfile':_0xe3ca('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format'](_0xe3ca('0xe'),util['format']('%s%s',_0xe3ca('0x5'),i),0xfa0+i)});}db[_0xe3ca('0xf')][_0xe3ca('0x10')](users)[_0xe3ca('0x11')](function(){console[_0xe3ca('0x12')]('add\x20user');})['catch'](function(_0x5dccd3){console[_0xe3ca('0x12')](_0x5dccd3);}); \ No newline at end of file +var _0x0aec=['format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x0aec,0x184));var _0xc0ae=function(_0x479dd8,_0x4e3ab8){_0x479dd8=_0x479dd8-0x0;var _0x1f8d28=_0x0aec[_0x479dd8];return _0x1f8d28;};'use strict';var util=require(_0xc0ae('0x0'));var db=require(_0xc0ae('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc0ae('0x2')]({'name':util[_0xc0ae('0x3')](_0xc0ae('0x4'),_0xc0ae('0x5'),i),'fullname':util['format'](_0xc0ae('0x4'),_0xc0ae('0x5'),i),'email':util[_0xc0ae('0x3')](_0xc0ae('0x6'),_0xc0ae('0x5'),i),'role':'agent','password':_0xc0ae('0x7'),'internal':0xfa0+i,'type':_0xc0ae('0x8'),'transport':[_0xc0ae('0x9'),'ws',_0xc0ae('0xa')],'disallow':[_0xc0ae('0xb')],'allow':[_0xc0ae('0xc')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0xc0ae('0xd'),'avpf':_0xc0ae('0xd'),'force_avp':_0xc0ae('0xd'),'icesupport':_0xc0ae('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xc0ae('0xe'),'dtlsprivatekey':_0xc0ae('0xf'),'dtlssetup':'actpass','callerid':util[_0xc0ae('0x3')](_0xc0ae('0x10'),util[_0xc0ae('0x3')](_0xc0ae('0x4'),_0xc0ae('0x5'),i),0xfa0+i)});}db[_0xc0ae('0x11')][_0xc0ae('0x12')](users)[_0xc0ae('0x13')](function(){console[_0xc0ae('0x14')](_0xc0ae('0x15'));})[_0xc0ae('0x16')](function(_0x5da671){console['log'](_0x5da671);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index eb82102..24fd98b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f92=['OpenchannelQueue','WhatsappQueue','Trunk','user','MailQueue','IvrCampaigns','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','request','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','Agents','User','name','role','agent','telephone','type','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','where','Campaign','ivr','format','%s:queue:%s','length','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue'];(function(_0x62d1a2,_0x3f1c5e){var _0x2cd838=function(_0x1456b0){while(--_0x1456b0){_0x62d1a2['push'](_0x62d1a2['shift']());}};_0x2cd838(++_0x3f1c5e);}(_0x1f92,0x1ad));var _0x21f9=function(_0x417fa2,_0x552204){_0x417fa2=_0x417fa2-0x0;var _0x1db643=_0x1f92[_0x417fa2];return _0x1db643;};'use strict';var _=require(_0x21f9('0x0'));var util=require('util');var BPromise=require(_0x21f9('0x1'));var db=require(_0x21f9('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x21f9('0x3'),'model':db[_0x21f9('0x4')],'attributes':['id',_0x21f9('0x5'),_0x21f9('0x6')],'raw':!![],'where':{'role':_0x21f9('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x21f9('0x5')],'where':{'role':_0x21f9('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x21f9('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x21f9('0x5')],'where':{'role':_0x21f9('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x21f9('0x5'),_0x21f9('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x43d2ab,_0x30411c,_0x345f68){return db['UserProfileSection']['findOne']({'where':{'name':_0x43d2ab,'userProfileId':_0x30411c},'raw':!![]})[_0x21f9('0xa')](function(_0x336562){if(_0x336562){if(_0x336562['autoAssociation']){switch(_0x43d2ab){case _0x21f9('0xb'):case _0x21f9('0xc'):case _0x21f9('0xd'):case _0x21f9('0xe'):case _0x21f9('0xf'):case _0x21f9('0x10'):case _0x21f9('0x11'):return db[_0x345f68][_0x21f9('0x12')](queryQueues);case _0x21f9('0x13'):return db[_0x345f68]['findAll'](queryTelephones);case'Trunks':return db[_0x345f68][_0x21f9('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x345f68][_0x21f9('0x12')](queryCampaigns);}}else{return db[_0x21f9('0x14')][_0x21f9('0x12')]({'attributes':[_0x21f9('0x15')],'where':{'sectionId':_0x336562['id']},'raw':!![]})[_0x21f9('0xa')](function(_0x292c43){if(_0x292c43){var _0x12b70c={'where':{'id':_['map'](_0x292c43,_0x21f9('0x15'))},'raw':!![]};switch(_0x345f68){case _0x21f9('0x4'):_0x12b70c[_0x21f9('0x16')][_0x21f9('0x6')]=_0x21f9('0x8');break;case _0x21f9('0x17'):_0x12b70c[_0x21f9('0x16')][_0x21f9('0x9')]=_0x21f9('0x18');break;}return db[_0x345f68][_0x21f9('0x12')](_0x12b70c);}else{return[];}});}}else{return[];}})[_0x21f9('0xa')](function(_0x1b14c2){return _0x1b14c2;});}function joinOrLeaveQueues(_0x250964,_0x119190,_0x30f650,_0x3dfb3e){_0x250964[_0x119190](util[_0x21f9('0x19')](_0x21f9('0x1a'),_0x30f650,_0x3dfb3e[_0x21f9('0x5')]));if(_0x3dfb3e['Agents']){for(var _0x4011c2=0x0;_0x4011c2<_0x3dfb3e[_0x21f9('0x3')][_0x21f9('0x1b')];_0x4011c2+=0x1){_0x250964[_0x119190](util['format']('user:%s',_0x3dfb3e[_0x21f9('0x3')][_0x4011c2][_0x21f9('0x5')]));}}}function joinOrLeave(_0x17610c,_0x5a65a7,_0x2d6992){var _0x264d0c;if(_0x17610c[_0x21f9('0x1c')]['query']['id']){db[_0x21f9('0x4')][_0x21f9('0x1d')]({'attributes':['id',_0x21f9('0x5'),_0x21f9('0x6'),_0x21f9('0x1e')],'where':{'id':_0x17610c[_0x21f9('0x1c')]['query']['id']},'include':[{'model':db[_0x21f9('0x1f')],'as':_0x21f9('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x21f9('0x21')],'as':_0x21f9('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x21f9('0x23')],'as':_0x21f9('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x21f9('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x21f9('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x21f9('0x27')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x21f9('0xa')](function(_0x4527e4){if(_0x4527e4){_0x264d0c=_0x4527e4;_0x17610c[_0x5a65a7](util[_0x21f9('0x19')](_0x21f9('0x28'),_0x4527e4[_0x21f9('0x5')]));var _0x59ccec=[];switch(_0x4527e4[_0x21f9('0x6')]){case _0x21f9('0x29'):_0x17610c[_0x5a65a7](_0x21f9('0x2a'));_0x17610c[_0x5a65a7](_0x21f9('0x2b'));if(queryQueues[_0x21f9('0x2c')](_0x21f9('0x2d'))){delete queryQueues[_0x21f9('0x2d')];}_0x59ccec[_0x21f9('0x2e')](db[_0x21f9('0x2f')][_0x21f9('0x12')](queryQueues));_0x59ccec[_0x21f9('0x2e')](db[_0x21f9('0x30')]['findAll'](queryQueues));_0x59ccec[_0x21f9('0x2e')](db[_0x21f9('0x31')][_0x21f9('0x12')](queryQueues));_0x59ccec[_0x21f9('0x2e')](db[_0x21f9('0x32')][_0x21f9('0x12')](queryQueues));_0x59ccec[_0x21f9('0x2e')](db['MailQueue'][_0x21f9('0x12')](queryQueues));_0x59ccec['push'](db[_0x21f9('0x33')][_0x21f9('0x12')](queryQueues));_0x59ccec['push'](db[_0x21f9('0x34')][_0x21f9('0x12')](queryQueues));_0x59ccec['push'](db[_0x21f9('0x4')][_0x21f9('0x12')](queryTelephones));_0x59ccec[_0x21f9('0x2e')](db[_0x21f9('0x35')][_0x21f9('0x12')](queryTrunks));_0x59ccec[_0x21f9('0x2e')](db['Campaign'][_0x21f9('0x12')](queryCampaigns));_0x59ccec['push'](db[_0x21f9('0x4')]['findAll'](queryAgents));break;case _0x21f9('0x36'):_0x17610c[_0x5a65a7]('voice:inbound');_0x17610c[_0x5a65a7](_0x21f9('0x2b'));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0xb'),_0x4527e4[_0x21f9('0x1e')],_0x21f9('0x2f')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0xc'),_0x4527e4[_0x21f9('0x1e')],_0x21f9('0x30')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0xd'),_0x4527e4['userProfileId'],_0x21f9('0x31')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0xe'),_0x4527e4['userProfileId'],_0x21f9('0x32')));_0x59ccec['push'](getAssociatedResources('MailQueues',_0x4527e4[_0x21f9('0x1e')],_0x21f9('0x37')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0x10'),_0x4527e4[_0x21f9('0x1e')],_0x21f9('0x33')));_0x59ccec['push'](getAssociatedResources(_0x21f9('0x11'),_0x4527e4['userProfileId'],_0x21f9('0x34')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0x13'),_0x4527e4['userProfileId'],_0x21f9('0x4')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources('Trunks',_0x4527e4[_0x21f9('0x1e')],_0x21f9('0x35')));_0x59ccec[_0x21f9('0x2e')](getAssociatedResources(_0x21f9('0x38'),_0x4527e4[_0x21f9('0x1e')],_0x21f9('0x17')));_0x59ccec[_0x21f9('0x2e')](db[_0x21f9('0x4')][_0x21f9('0x12')](queryAgents));break;case _0x21f9('0x7'):_0x17610c[_0x5a65a7]('voice:inbound');_0x17610c[_0x5a65a7](_0x21f9('0x2b'));_0x59ccec[_0x21f9('0x2e')](_0x4527e4['getVoiceQueues']({'attributes':['id',_0x21f9('0x5')]}));_0x59ccec['push'](_0x4527e4['getChatQueues']({'attributes':['id',_0x21f9('0x5')]}));_0x59ccec[_0x21f9('0x2e')](_0x4527e4[_0x21f9('0x39')]({'attributes':['id',_0x21f9('0x5')]}));_0x59ccec[_0x21f9('0x2e')](_0x4527e4[_0x21f9('0x3a')]({'attributes':['id',_0x21f9('0x5')]}));_0x59ccec[_0x21f9('0x2e')](_0x4527e4[_0x21f9('0x3b')]({'attributes':['id',_0x21f9('0x5')]}));_0x59ccec[_0x21f9('0x2e')](_0x4527e4[_0x21f9('0x3c')]({'attributes':['id',_0x21f9('0x5')]}));_0x59ccec[_0x21f9('0x2e')](_0x4527e4[_0x21f9('0x3d')]({'attributes':['id',_0x21f9('0x5')]}));break;}return BPromise[_0x21f9('0x3e')](_0x59ccec);}})[_0x21f9('0xa')](function(_0x53058e){if(_0x53058e&&_0x53058e[_0x21f9('0x1b')]){for(var _0x5c700b=0x0;_0x5c700b<_0x53058e[_0x21f9('0x1b')];_0x5c700b+=0x1){for(var _0x396fcb=0x0;_0x396fcb<_0x53058e[_0x5c700b][_0x21f9('0x1b')];_0x396fcb+=0x1){switch(_0x5c700b){case 0x0:joinOrLeaveQueues(_0x17610c,_0x5a65a7,'voice',_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x1:joinOrLeaveQueues(_0x17610c,_0x5a65a7,_0x21f9('0x3f'),_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x2:joinOrLeaveQueues(_0x17610c,_0x5a65a7,_0x21f9('0x40'),_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x3:joinOrLeaveQueues(_0x17610c,_0x5a65a7,_0x21f9('0x41'),_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x4:joinOrLeaveQueues(_0x17610c,_0x5a65a7,_0x21f9('0x42'),_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x5:joinOrLeaveQueues(_0x17610c,_0x5a65a7,_0x21f9('0x43'),_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x6:joinOrLeaveQueues(_0x17610c,_0x5a65a7,_0x21f9('0x44'),_0x53058e[_0x5c700b][_0x396fcb]);break;case 0x7:if(_0x264d0c[_0x21f9('0x6')]!=='agent')_0x17610c[_0x5a65a7](util[_0x21f9('0x19')]('telephone:%s',_0x53058e[_0x5c700b][_0x396fcb][_0x21f9('0x5')]));break;case 0x8:if(_0x264d0c[_0x21f9('0x6')]!=='agent')_0x17610c[_0x5a65a7](util[_0x21f9('0x19')](_0x21f9('0x45'),_0x53058e[_0x5c700b][_0x396fcb][_0x21f9('0x5')]));break;case 0x9:if(_0x264d0c[_0x21f9('0x6')]!==_0x21f9('0x7'))_0x17610c[_0x5a65a7](util[_0x21f9('0x19')]('campaign:%s:%s',_0x53058e[_0x5c700b][_0x396fcb][_0x21f9('0x9')],_0x53058e[_0x5c700b][_0x396fcb][_0x21f9('0x5')]));break;case 0xa:_0x17610c[_0x5a65a7](util[_0x21f9('0x19')](_0x21f9('0x28'),_0x53058e[_0x5c700b][_0x396fcb][_0x21f9('0x5')]));break;}}}}})['then'](function(){if(_0x5a65a7===_0x21f9('0x46')){var _0x19617c=_[_0x21f9('0x47')](_0x264d0c['ChatInteractions'],'id');return _0x264d0c[_0x21f9('0x48')](_0x19617c)[_0x21f9('0xa')](function(){for(var _0xc6e94a=0x0;_0xc6e94a<_0x19617c[_0x21f9('0x1b')];_0xc6e94a+=0x1){_0x2d6992[_0x21f9('0x49')](_0x21f9('0x4a'),{'ChatInteractionId':Number(_0x19617c[_0xc6e94a]),'UserId':Number(_0x264d0c['id'])});}});}})[_0x21f9('0xa')](function(){if(_0x5a65a7===_0x21f9('0x46')){var _0x320651=_[_0x21f9('0x47')](_0x264d0c[_0x21f9('0x22')],'id');return _0x264d0c[_0x21f9('0x4b')](_0x320651)[_0x21f9('0xa')](function(){for(var _0x2936ec=0x0;_0x2936ec<_0x320651[_0x21f9('0x1b')];_0x2936ec+=0x1){_0x2d6992['emit'](_0x21f9('0x4c'),{'MailInteractionId':Number(_0x320651[_0x2936ec]),'UserId':Number(_0x264d0c['id'])});}});}})[_0x21f9('0xa')](function(){if(_0x5a65a7===_0x21f9('0x46')){var _0x57efb8=_[_0x21f9('0x47')](_0x264d0c['FaxInteractions'],'id');return _0x264d0c[_0x21f9('0x4d')](_0x57efb8)[_0x21f9('0xa')](function(){for(var _0x471e6f=0x0;_0x471e6f<_0x57efb8[_0x21f9('0x1b')];_0x471e6f+=0x1){_0x2d6992[_0x21f9('0x49')](_0x21f9('0x4e'),{'FaxInteractionId':Number(_0x57efb8[_0x471e6f]),'UserId':Number(_0x264d0c['id'])});}});}})['then'](function(){if(_0x5a65a7===_0x21f9('0x46')){var _0x4de402=_[_0x21f9('0x47')](_0x264d0c[_0x21f9('0x4f')],'id');return _0x264d0c[_0x21f9('0x50')](_0x4de402)['then'](function(){for(var _0x4dc92c=0x0;_0x4dc92c<_0x4de402[_0x21f9('0x1b')];_0x4dc92c+=0x1){_0x2d6992[_0x21f9('0x49')](_0x21f9('0x51'),{'SmsInteractionId':Number(_0x4de402[_0x4dc92c]),'UserId':Number(_0x264d0c['id'])});}});}})[_0x21f9('0xa')](function(){if(_0x5a65a7===_0x21f9('0x46')){var _0x4d4121=_['map'](_0x264d0c['OpenchannelInteractions'],'id');return _0x264d0c['removeOpenchannelInteractions'](_0x4d4121)['then'](function(){for(var _0xaad96f=0x0;_0xaad96f<_0x4d4121['length'];_0xaad96f+=0x1){_0x2d6992[_0x21f9('0x49')](_0x21f9('0x52'),{'OpenchannelInteractionId':Number(_0x4d4121[_0xaad96f]),'UserId':Number(_0x264d0c['id'])});}});}})[_0x21f9('0xa')](function(){if(_0x5a65a7==='leave'){var _0x85848e=_['map'](_0x264d0c['WhatsappInteractions'],'id');return _0x264d0c[_0x21f9('0x53')](_0x85848e)['then'](function(){for(var _0x2cd261=0x0;_0x2cd261<_0x85848e[_0x21f9('0x1b')];_0x2cd261+=0x1){_0x2d6992[_0x21f9('0x49')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x85848e[_0x2cd261]),'UserId':Number(_0x264d0c['id'])});}});}})[_0x21f9('0x54')](function(_0x1d27ab){_0x17610c[_0x21f9('0x55')](_0x1d27ab);});}}function onDisconnect(_0x3cbc2b,_0x467007){joinOrLeave(_0x3cbc2b,_0x21f9('0x46'),_0x467007);}function onConnect(_0x5c5687){joinOrLeave(_0x5c5687,_0x21f9('0x56'));}exports[_0x21f9('0x57')]=function(_0x2eebe7){_0x2eebe7['on'](_0x21f9('0x58'),function(_0x12f2d1){_0x12f2d1['setMaxListeners'](0x0);_0x12f2d1['address']=_0x12f2d1[_0x21f9('0x59')][_0x21f9('0x58')]['remoteAddress']+':'+_0x12f2d1['request'][_0x21f9('0x58')][_0x21f9('0x5a')];_0x12f2d1[_0x21f9('0x5b')]=new Date();_0x12f2d1[_0x21f9('0x55')]=function(_0x338a2b){console['log'](_0x21f9('0x5c')+_0x12f2d1[_0x21f9('0x5d')][_0x21f9('0x5')]+'['+_0x12f2d1['address']+']',_0x338a2b);};_0x12f2d1['on']('disconnect',function(){onDisconnect(_0x12f2d1,_0x2eebe7);_0x12f2d1['log'](_0x21f9('0x5e'));});onConnect(_0x12f2d1);_0x12f2d1[_0x21f9('0x55')](_0x21f9('0x5f'));});}; \ No newline at end of file +var _0x151b=['hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','user','voice:inbound','VoiceQueues','MailQueue','WhatsappQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','FaxInteractions','emit','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','map','resourceId','where','telephone','Campaign','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound'];(function(_0x2a4a61,_0x3c3cae){var _0x308182=function(_0x5dd985){while(--_0x5dd985){_0x2a4a61['push'](_0x2a4a61['shift']());}};_0x308182(++_0x3c3cae);}(_0x151b,0x152));var _0xb151=function(_0x123b15,_0x503ac6){_0x123b15=_0x123b15-0x0;var _0x3724d3=_0x151b[_0x123b15];return _0x3724d3;};'use strict';var _=require(_0xb151('0x0'));var util=require(_0xb151('0x1'));var BPromise=require(_0xb151('0x2'));var db=require(_0xb151('0x3'))['db'];var config=require(_0xb151('0x4'));var queryQueues={'attributes':['id',_0xb151('0x5')],'include':[{'as':'Agents','model':db[_0xb151('0x6')],'attributes':['id','name',_0xb151('0x7')],'raw':!![],'where':{'role':_0xb151('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb151('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xb151('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xb151('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb151('0x5'),_0xb151('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x51e8fe,_0x2d38a3,_0x492e76){return db[_0xb151('0xa')][_0xb151('0xb')]({'where':{'name':_0x51e8fe,'userProfileId':_0x2d38a3},'raw':!![]})[_0xb151('0xc')](function(_0x2421a7){if(_0x2421a7){if(_0x2421a7[_0xb151('0xd')]){switch(_0x51e8fe){case'VoiceQueues':case _0xb151('0xe'):case _0xb151('0xf'):case _0xb151('0x10'):case _0xb151('0x11'):case _0xb151('0x12'):case'WhatsappQueues':return db[_0x492e76][_0xb151('0x13')](queryQueues);case _0xb151('0x14'):return db[_0x492e76]['findAll'](queryTelephones);case _0xb151('0x15'):return db[_0x492e76][_0xb151('0x13')](queryTrunks);case _0xb151('0x16'):return db[_0x492e76]['findAll'](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x2421a7['id']},'raw':!![]})[_0xb151('0xc')](function(_0x352834){if(_0x352834){var _0xe73c36={'where':{'id':_[_0xb151('0x17')](_0x352834,_0xb151('0x18'))},'raw':!![]};switch(_0x492e76){case'User':_0xe73c36[_0xb151('0x19')][_0xb151('0x7')]=_0xb151('0x1a');break;case _0xb151('0x1b'):_0xe73c36[_0xb151('0x19')][_0xb151('0x9')]='ivr';break;}return db[_0x492e76][_0xb151('0x13')](_0xe73c36);}else{return[];}});}}else{return[];}})[_0xb151('0xc')](function(_0x5aa911){return _0x5aa911;});}function joinOrLeaveQueues(_0x265b69,_0x2916a1,_0x49d160,_0x30beb4){_0x265b69[_0x2916a1](util[_0xb151('0x1c')](_0xb151('0x1d'),_0x49d160,_0x30beb4[_0xb151('0x5')]));if(_0x30beb4[_0xb151('0x1e')]){for(var _0x3392cb=0x0;_0x3392cb<_0x30beb4[_0xb151('0x1e')]['length'];_0x3392cb+=0x1){_0x265b69[_0x2916a1](util[_0xb151('0x1c')](_0xb151('0x1f'),_0x30beb4['Agents'][_0x3392cb]['name']));}}}function joinOrLeave(_0x1feb70,_0x2dee53,_0x47bac0){var _0x2ccf8a;if(_0x1feb70[_0xb151('0x20')][_0xb151('0x21')]['id']){db['User'][_0xb151('0x22')]({'attributes':['id',_0xb151('0x5'),_0xb151('0x7'),_0xb151('0x23')],'where':{'id':_0x1feb70[_0xb151('0x20')][_0xb151('0x21')]['id']},'include':[{'model':db[_0xb151('0x24')],'as':_0xb151('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb151('0x26')],'as':_0xb151('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb151('0x28')],'as':_0xb151('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xb151('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xb151('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xa177ba){if(_0xa177ba){_0x2ccf8a=_0xa177ba;_0x1feb70[_0x2dee53](util[_0xb151('0x1c')]('user:%s',_0xa177ba[_0xb151('0x5')]));var _0x505f6a=[];switch(_0xa177ba[_0xb151('0x7')]){case _0xb151('0x2c'):_0x1feb70[_0x2dee53]('voice:inbound');_0x1feb70[_0x2dee53](_0xb151('0x2d'));if(queryQueues[_0xb151('0x2e')](_0xb151('0x2f'))){delete queryQueues[_0xb151('0x2f')];}_0x505f6a['push'](db[_0xb151('0x30')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x32')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x33')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db['SmsQueue'][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db['MailQueue'][_0xb151('0x13')](queryQueues));_0x505f6a['push'](db[_0xb151('0x34')][_0xb151('0x13')](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x35')]['findAll'](queryQueues));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x6')]['findAll'](queryTelephones));_0x505f6a[_0xb151('0x31')](db['Trunk'][_0xb151('0x13')](queryTrunks));_0x505f6a['push'](db[_0xb151('0x1b')][_0xb151('0x13')](queryCampaigns));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x6')][_0xb151('0x13')](queryAgents));break;case _0xb151('0x36'):_0x1feb70[_0x2dee53](_0xb151('0x37'));_0x1feb70[_0x2dee53]('voice:outbound');_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x38'),_0xa177ba[_0xb151('0x23')],'VoiceQueue'));_0x505f6a[_0xb151('0x31')](getAssociatedResources('ChatQueues',_0xa177ba[_0xb151('0x23')],_0xb151('0x32')));_0x505f6a['push'](getAssociatedResources(_0xb151('0xf'),_0xa177ba[_0xb151('0x23')],_0xb151('0x33')));_0x505f6a[_0xb151('0x31')](getAssociatedResources('SmsQueues',_0xa177ba[_0xb151('0x23')],'SmsQueue'));_0x505f6a['push'](getAssociatedResources(_0xb151('0x11'),_0xa177ba[_0xb151('0x23')],_0xb151('0x39')));_0x505f6a[_0xb151('0x31')](getAssociatedResources('OpenchannelQueues',_0xa177ba[_0xb151('0x23')],_0xb151('0x34')));_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x3a'),_0xa177ba[_0xb151('0x23')],_0xb151('0x35')));_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x14'),_0xa177ba[_0xb151('0x23')],_0xb151('0x6')));_0x505f6a[_0xb151('0x31')](getAssociatedResources(_0xb151('0x15'),_0xa177ba['userProfileId'],'Trunk'));_0x505f6a['push'](getAssociatedResources(_0xb151('0x16'),_0xa177ba[_0xb151('0x23')],_0xb151('0x1b')));_0x505f6a[_0xb151('0x31')](db[_0xb151('0x6')][_0xb151('0x13')](queryAgents));break;case _0xb151('0x8'):_0x1feb70[_0x2dee53](_0xb151('0x37'));_0x1feb70[_0x2dee53](_0xb151('0x2d'));_0x505f6a[_0xb151('0x31')](_0xa177ba['getVoiceQueues']({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3b')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3c')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3d')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a['push'](_0xa177ba[_0xb151('0x3e')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba[_0xb151('0x3f')]({'attributes':['id',_0xb151('0x5')]}));_0x505f6a[_0xb151('0x31')](_0xa177ba['getWhatsappQueues']({'attributes':['id',_0xb151('0x5')]}));break;}return BPromise[_0xb151('0x40')](_0x505f6a);}})[_0xb151('0xc')](function(_0x218ecf){if(_0x218ecf&&_0x218ecf[_0xb151('0x41')]){for(var _0x4a74dd=0x0;_0x4a74dd<_0x218ecf[_0xb151('0x41')];_0x4a74dd+=0x1){for(var _0x1fef7a=0x0;_0x1fef7a<_0x218ecf[_0x4a74dd]['length'];_0x1fef7a+=0x1){switch(_0x4a74dd){case 0x0:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x42'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x1:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x43'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x2:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x44'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x3:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x45'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x4:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x46'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x5:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x47'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x6:joinOrLeaveQueues(_0x1feb70,_0x2dee53,_0xb151('0x48'),_0x218ecf[_0x4a74dd][_0x1fef7a]);break;case 0x7:if(_0x2ccf8a[_0xb151('0x7')]!==_0xb151('0x8'))_0x1feb70[_0x2dee53](util[_0xb151('0x1c')]('telephone:%s',_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;case 0x8:if(_0x2ccf8a[_0xb151('0x7')]!==_0xb151('0x8'))_0x1feb70[_0x2dee53](util[_0xb151('0x1c')](_0xb151('0x49'),_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;case 0x9:if(_0x2ccf8a[_0xb151('0x7')]!==_0xb151('0x8'))_0x1feb70[_0x2dee53](util[_0xb151('0x1c')](_0xb151('0x4a'),_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x9')],_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;case 0xa:_0x1feb70[_0x2dee53](util[_0xb151('0x1c')](_0xb151('0x1f'),_0x218ecf[_0x4a74dd][_0x1fef7a][_0xb151('0x5')]));break;}}}}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x3be19a=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x25')],'id');return _0x2ccf8a[_0xb151('0x4c')](_0x3be19a)[_0xb151('0xc')](function(){for(var _0x27abb1=0x0;_0x27abb1<_0x3be19a['length'];_0x27abb1+=0x1){_0x47bac0['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x3be19a[_0x27abb1]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x28cd10=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x27')],'id');return _0x2ccf8a['removeMailInteractions'](_0x28cd10)[_0xb151('0xc')](function(){for(var _0x5c4dd0=0x0;_0x5c4dd0<_0x28cd10[_0xb151('0x41')];_0x5c4dd0+=0x1){_0x47bac0['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x28cd10[_0x5c4dd0]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x4759bd=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x4d')],'id');return _0x2ccf8a['removeFaxInteractions'](_0x4759bd)[_0xb151('0xc')](function(){for(var _0x28e1f=0x0;_0x28e1f<_0x4759bd[_0xb151('0x41')];_0x28e1f+=0x1){_0x47bac0[_0xb151('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4759bd[_0x28e1f]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0xf8f0fe=_['map'](_0x2ccf8a[_0xb151('0x29')],'id');return _0x2ccf8a[_0xb151('0x4f')](_0xf8f0fe)[_0xb151('0xc')](function(){for(var _0x1dabd1=0x0;_0x1dabd1<_0xf8f0fe[_0xb151('0x41')];_0x1dabd1+=0x1){_0x47bac0[_0xb151('0x4e')](_0xb151('0x50'),{'SmsInteractionId':Number(_0xf8f0fe[_0x1dabd1]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53==='leave'){var _0x363120=_['map'](_0x2ccf8a['OpenchannelInteractions'],'id');return _0x2ccf8a['removeOpenchannelInteractions'](_0x363120)[_0xb151('0xc')](function(){for(var _0x4f1cb5=0x0;_0x4f1cb5<_0x363120[_0xb151('0x41')];_0x4f1cb5+=0x1){_0x47bac0[_0xb151('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x363120[_0x4f1cb5]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0xc')](function(){if(_0x2dee53===_0xb151('0x4b')){var _0x2135bf=_[_0xb151('0x17')](_0x2ccf8a[_0xb151('0x2b')],'id');return _0x2ccf8a[_0xb151('0x51')](_0x2135bf)[_0xb151('0xc')](function(){for(var _0x5e2c08=0x0;_0x5e2c08<_0x2135bf[_0xb151('0x41')];_0x5e2c08+=0x1){_0x47bac0[_0xb151('0x4e')](_0xb151('0x52'),{'WhatsappInteractionId':Number(_0x2135bf[_0x5e2c08]),'UserId':Number(_0x2ccf8a['id'])});}});}})[_0xb151('0x53')](function(_0x43fe04){_0x1feb70[_0xb151('0x54')](_0x43fe04);});}}function onDisconnect(_0x5a3bd2,_0x44b6ee){joinOrLeave(_0x5a3bd2,_0xb151('0x4b'),_0x44b6ee);}function onConnect(_0x565841){joinOrLeave(_0x565841,_0xb151('0x55'));}exports[_0xb151('0x56')]=function(_0x2c552c){_0x2c552c['on']('connection',function(_0x483487){_0x483487[_0xb151('0x57')](0x0);_0x483487[_0xb151('0x58')]=_0x483487[_0xb151('0x59')][_0xb151('0x5a')][_0xb151('0x5b')]+':'+_0x483487['request'][_0xb151('0x5a')][_0xb151('0x5c')];_0x483487[_0xb151('0x5d')]=new Date();_0x483487[_0xb151('0x54')]=function(_0x58f0a7){console['log']('SocketIO\x20'+_0x483487['nsp'][_0xb151('0x5')]+'['+_0x483487['address']+']',_0x58f0a7);};_0x483487['on'](_0xb151('0x5e'),function(){onDisconnect(_0x483487,_0x2c552c);_0x483487['log']('DISCONNECTED');});onConnect(_0x483487);_0x483487[_0xb151('0x54')](_0xb151('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index c731a4d..7014eab 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 _0x0623=['Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','name','agent','outgoingmessage','AfterCreateMessage','offlineMessage','opened','resolve','sequelize','query','SIP/%s','closed','changed','substatus','AfterUpdate','find','fullname','email','default','hasOwnProperty','model','hook','callback','toLowerCase','util','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','closedinteraction','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request','EventManager','then','info'];(function(_0x1f11d8,_0x20bd3e){var _0x972b4c=function(_0x4f9db9){while(--_0x4f9db9){_0x1f11d8['push'](_0x1f11d8['shift']());}};_0x972b4c(++_0x20bd3e);}(_0x0623,0x1e0));var _0x3062=function(_0x19a6b5,_0x215bba){_0x19a6b5=_0x19a6b5-0x0;var _0x308ccb=_0x0623[_0x19a6b5];return _0x308ccb;};'use strict';var util=require(_0x3062('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3062('0x1'));var logger=require(_0x3062('0x2'))(_0x3062('0x3'));var client=jayson[_0x3062('0x4')][_0x3062('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x3062('0x6'),'model':_0x3062('0x7'),'event':'afterUpdate','condition':_0x3062('0x8'),'callback':afterUpdate},{'channel':_0x3062('0x6'),'model':'ChatMessage','event':_0x3062('0x9'),'condition':_0x3062('0xa'),'callback':afterCreateMessage},{'channel':_0x3062('0x6'),'model':_0x3062('0xb'),'event':'afterCreate','condition':_0x3062('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0x3062('0xc'),'model':_0x3062('0xd'),'event':'afterCreate','condition':_0x3062('0xe'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x3062('0xf'),'condition':_0x3062('0x8'),'callback':afterUpdate},{'channel':'Sms','model':_0x3062('0x10'),'event':_0x3062('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x3062('0x11'),'model':_0x3062('0x12'),'event':_0x3062('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x3062('0x11'),'model':_0x3062('0x12'),'event':'afterUpdate','condition':_0x3062('0x8'),'callback':afterUpdate},{'channel':_0x3062('0x11'),'model':_0x3062('0x13'),'event':'afterCreate','condition':_0x3062('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x3062('0x14'),'event':_0x3062('0x9'),'condition':_0x3062('0xe'),'callback':afterCreate},{'channel':'Fax','model':_0x3062('0x14'),'event':_0x3062('0xf'),'condition':_0x3062('0x8'),'callback':afterUpdate},{'channel':_0x3062('0x15'),'model':_0x3062('0x16'),'event':_0x3062('0x9'),'condition':_0x3062('0xa'),'callback':afterCreateMessage},{'channel':_0x3062('0x17'),'model':_0x3062('0x18'),'event':'afterCreate','condition':_0x3062('0xe'),'callback':afterCreate},{'channel':'Mail','model':_0x3062('0x18'),'event':'afterUpdate','condition':_0x3062('0x8'),'callback':afterUpdate},{'channel':_0x3062('0x17'),'model':'MailMessage','event':_0x3062('0x9'),'condition':_0x3062('0xa'),'callback':afterCreateMessage},{'channel':_0x3062('0x19'),'model':_0x3062('0x1a'),'event':_0x3062('0x9'),'condition':_0x3062('0xe'),'callback':afterCreate},{'channel':_0x3062('0x19'),'model':_0x3062('0x1a'),'event':'afterUpdate','condition':_0x3062('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0x3062('0x9'),'condition':_0x3062('0xa'),'callback':afterCreateMessage}];function request(_0x15a6f1){return client[_0x3062('0x1b')](_0x3062('0x1c'),_0x15a6f1)[_0x3062('0x1d')](function(_0x51c91b){logger[_0x3062('0x1e')](_0x3062('0x1f'),_0x3062('0x1c'),_0x51c91b);if(_0x51c91b[_0x3062('0x20')]){if(_0x51c91b[_0x3062('0x20')][_0x3062('0x21')]===0x1f4){logger[_0x3062('0x20')](_0x3062('0x1f'),'EventManager',_0x51c91b[_0x3062('0x20')]);}}})[_0x3062('0x22')](function(_0x437560){logger['error'](_0x3062('0x1f'),_0x3062('0x1c'),_0x437560);});}function afterCreateMessage(_0x1a648f){return function(_0x5cdfdf){_0x5cdfdf=_0x5cdfdf[_0x3062('0x23')]({'plain':!![]});_0x5cdfdf[_0x3062('0x24')]=_0x1a648f;_0x5cdfdf[_0x3062('0x25')]=_0x1a648f;_0x5cdfdf[_0x3062('0x26')]=_0x5cdfdf[_0x3062('0x27')];Promise['resolve']()[_0x3062('0x1d')](function(){if(typeof _0x5cdfdf[_0x3062('0x28')]===_0x3062('0x29'))return null;var _0x1d50f3=_0x3062('0x2a')+_0x5cdfdf[_0x3062('0x28')];return db['sequelize']['query'](_0x1d50f3,{'type':db[_0x3062('0x2b')][_0x3062('0x2c')][_0x3062('0x2d')],'raw':!![]});})[_0x3062('0x1d')](function(_0x5963ef){if(_0x5963ef){_0x5cdfdf[_0x3062('0x2e')]=_0x5963ef[0x0];}if(typeof _0x5cdfdf[_0x3062('0x2f')]===_0x3062('0x29'))return;return getAgent(_0x5cdfdf[_0x3062('0x2f')]);})['then'](function(_0x377ada){if(_0x377ada){_0x5cdfdf[_0x3062('0x30')]=util[_0x3062('0x31')]('SIP/%s',_0x377ada[_0x3062('0x32')]);_0x5cdfdf[_0x3062('0x33')]=_0x377ada;_0x5cdfdf[_0x3062('0x24')]=_0x1a648f;return request({'event':'incomingmessage','message':_0x5cdfdf});}else{return request({'event':_0x3062('0x34'),'message':_0x5cdfdf});}})['catch'](function(_0x24691f){logger[_0x3062('0x20')](_0x3062('0x1f'),_0x3062('0x35'),_0x24691f);});};}function afterCreateOfflineMessage(_0x4966e4){return function(_0x42a2ee){_0x42a2ee=_0x42a2ee[_0x3062('0x23')]({'plain':!![]});_0x42a2ee[_0x3062('0x24')]=_0x4966e4;_0x42a2ee['motionChannel']=_0x4966e4;_0x42a2ee['event']=_0x3062('0x36');return request({'event':_0x42a2ee[_0x3062('0x26')],'message':_0x42a2ee});};}function afterCreate(_0x43f4e2,_0xedb42d){return function(_0x4dce31){_0x4dce31=_0x4dce31[_0x3062('0x23')]({'plain':!![]});_0x4dce31[_0x3062('0x24')]=_0x43f4e2;_0x4dce31[_0x3062('0x25')]=_0x43f4e2;_0x4dce31[_0x3062('0x26')]=_0x3062('0x37');Promise[_0x3062('0x38')]()['then'](function(){var _0x2a196e=_0x3062('0x2a')+_0x4dce31['ContactId'];return db[_0x3062('0x39')][_0x3062('0x3a')](_0x2a196e,{'type':db[_0x3062('0x2b')][_0x3062('0x2c')][_0x3062('0x2d')],'raw':!![]});})[_0x3062('0x1d')](function(_0x5ef7fe){if(_0x5ef7fe){_0x4dce31['contact']=_0x5ef7fe[0x0];}if(typeof _0x4dce31['UserId']===_0x3062('0x29'))return;return getAgent(_0x4dce31[_0x3062('0x2f')]);})[_0x3062('0x1d')](function(_0x1149b2){if(_0x1149b2){_0x4dce31['interface']=util[_0x3062('0x31')](_0x3062('0x3b'),_0x1149b2[_0x3062('0x32')]);_0x4dce31[_0x3062('0x33')]=_0x1149b2;}return request({'event':_0xedb42d,'message':_0x4dce31});})[_0x3062('0x22')](function(_0x260c12){logger[_0x3062('0x20')](_0x3062('0x1f'),'AfterCreate',_0x260c12);});};}function afterUpdate(_0x12c5f4){return function(_0x4aeebc){var _0x2f4fe7=_0x4aeebc['changed'](_0x3062('0x3c'))&&_0x4aeebc[_0x3062('0x3c')];var _0x36bec4=_0x4aeebc[_0x3062('0x3d')](_0x3062('0x3e'));if(_0x2f4fe7||_0x36bec4){var _0x2877f7=_0x2f4fe7?_0x3062('0x8'):_0x3062('0x3e');var _0x50bcef=_0x4aeebc['get']({'plain':!![]});_0x50bcef[_0x3062('0x24')]=_0x12c5f4;_0x50bcef[_0x3062('0x25')]=_0x12c5f4;_0x50bcef[_0x3062('0x26')]=_0x2f4fe7?_0x3062('0x3c'):_0x3062('0x3e');var _0xe31871=_0x3062('0x2a')+_0x50bcef[_0x3062('0x28')];return db[_0x3062('0x39')][_0x3062('0x3a')](_0xe31871,{'type':db[_0x3062('0x2b')][_0x3062('0x2c')][_0x3062('0x2d')],'raw':!![]})['then'](function(_0x5ad06b){if(_0x5ad06b){_0x50bcef['contact']=_0x5ad06b[0x0];}if(typeof _0x50bcef[_0x3062('0x2f')]===_0x3062('0x29'))return;return getAgent(_0x50bcef[_0x3062('0x2f')]);})[_0x3062('0x1d')](function(_0x2fa28c){if(_0x2fa28c){_0x50bcef[_0x3062('0x30')]=util['format'](_0x3062('0x3b'),_0x2fa28c[_0x3062('0x32')]);_0x50bcef[_0x3062('0x33')]=_0x2fa28c;}return request({'event':_0x2877f7,'message':_0x50bcef});})[_0x3062('0x22')](function(_0x74389d){logger[_0x3062('0x20')]('Trigger,\x20%s',_0x3062('0x3f'),_0x74389d);});}};}function getAgent(_0x88933e){return db['User'][_0x3062('0x40')]({'where':{'id':_0x88933e},'attributes':['id',_0x3062('0x32'),_0x3062('0x41'),_0x3062('0x42'),'internal'],'raw':!![]})[_0x3062('0x1d')](function(_0x42a830){return _0x42a830;});}exports[_0x3062('0x43')]=function(){for(var _0x529f23=0x0;_0x529f23=_0x498bac[_0x32a0('0x12')]){throw Error(_0x32a0('0x13'));}_0x1f7038(_0x1aeb70);})[_0x32a0('0x14')](function(_0x5d4276){_0x5e3092(_0x5d4276);});});}; \ No newline at end of file +var _0x12e2=['chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12e2,0xcb));var _0x212e=function(_0x5096f2,_0x428e9e){_0x5096f2=_0x5096f2-0x0;var _0x1200b4=_0x12e2[_0x5096f2];return _0x1200b4;};'use strict';var _=require(_0x212e('0x0'));var BPromise=require('bluebird');var db=require(_0x212e('0x1'))['db'];var util=require(_0x212e('0x2'));var channels=[_0x212e('0x3'),'mail',_0x212e('0x4'),_0x212e('0x5'),_0x212e('0x6'),_0x212e('0x7'),_0x212e('0x8')];exports[_0x212e('0x9')]=function(){return channels;};exports[_0x212e('0xa')]=function(_0x4a8fcc){_0x4a8fcc=_0x4a8fcc['toLowerCase']();return _[_0x212e('0xb')](channels,_0x4a8fcc);};exports[_0x212e('0xc')]=function(_0x3f184d,_0x994f9d,_0x1301f6,_0x69a5d){var _0xd1e322={'loginAttempts':_0x994f9d,'blocked':_0x1301f6};if(!_[_0x212e('0xd')](_0x69a5d)){_0xd1e322[_0x212e('0xe')]=_0x69a5d;}return _0x3f184d[_0x212e('0xf')](_0xd1e322);};exports[_0x212e('0x10')]=function(_0x1fb6f7){return new BPromise(function(_0x2e614e,_0x95fffc){var _0x4095cb=0x0;if(_0x1fb6f7[_0x212e('0x11')]!==_0x212e('0x12')){_0x2e614e(_0x1fb6f7);}db['User']['count']({'where':{'role':_0x212e('0x12'),'online':!![],'id':{'$ne':_0x1fb6f7['id']}}})['then'](function(_0x4e5741){_0x4095cb=_0x4e5741;return util[_0x212e('0x10')]();})[_0x212e('0x13')](function(_0x111f50){if(_0x111f50&&_0x111f50[_0x212e('0x14')]&&_0x4095cb>=_0x111f50[_0x212e('0x14')]){throw Error(_0x212e('0x15'));}_0x2e614e(_0x1fb6f7);})[_0x212e('0x16')](function(_0x4392cb){_0x95fffc(_0x4392cb);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 5d8c95c..cde0ab5 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0x2e2051,_0x17efa6){var _0x2a4eaf=function(_0x5cfd7a){while(--_0x5cfd7a){_0x2e2051['push'](_0x2e2051['shift']());}};_0x2a4eaf(++_0x17efa6);}(_0x7a54,0x106));var _0x47a5=function(_0xedcf9e,_0x32dcdf){_0xedcf9e=_0xedcf9e-0x0;var _0xd691ee=_0x7a54[_0xedcf9e];return _0xd691ee;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0xa12bd7,_0x26b894){var _0x594416=function(_0x8f56c2){while(--_0x8f56c2){_0xa12bd7['push'](_0xa12bd7['shift']());}};_0x594416(++_0x26b894);}(_0x7a54,0x106));var _0x47a5=function(_0x447867,_0x529ad3){_0x447867=_0x447867-0x0;var _0x5858b6=_0x7a54[_0x447867];return _0x5858b6;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e2d28fb..9c558e2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb78e=['exports','404','status'];(function(_0x1bb0bd,_0x45dd1d){var _0x37ec68=function(_0x2af780){while(--_0x2af780){_0x1bb0bd['push'](_0x1bb0bd['shift']());}};_0x37ec68(++_0x45dd1d);}(_0xb78e,0xf9));var _0xeb78=function(_0x57ef8d,_0x441a94){_0x57ef8d=_0x57ef8d-0x0;var _0x25634a=_0xb78e[_0x57ef8d];return _0x25634a;};'use strict';module[_0xeb78('0x0')][0x194]=function pageNotFound(_0x11ef40,_0xbbed4f){var _0x2484e5=_0xeb78('0x1');var _0x5aff60=0x194;var _0x3807cf={'status':_0x5aff60};_0xbbed4f['status'](_0x3807cf[_0xeb78('0x2')]);_0xbbed4f['render'](_0x2484e5,{},function(_0x3a5fa6,_0xdb58bd){if(_0x3a5fa6){return _0xbbed4f[_0xeb78('0x2')](_0x3807cf[_0xeb78('0x2')])['json'](_0x3807cf);}_0xbbed4f['send'](_0xdb58bd);});}; \ No newline at end of file +var _0x799f=['render','json','send','status'];(function(_0x2edfad,_0x54b323){var _0x2499ff=function(_0x179a90){while(--_0x179a90){_0x2edfad['push'](_0x2edfad['shift']());}};_0x2499ff(++_0x54b323);}(_0x799f,0x1cf));var _0xf799=function(_0x38f4f6,_0x6726a0){_0x38f4f6=_0x38f4f6-0x0;var _0x56cc52=_0x799f[_0x38f4f6];return _0x56cc52;};'use strict';module['exports'][0x194]=function pageNotFound(_0x4b3960,_0x168ec1){var _0x315063='404';var _0x49f6ce=0x194;var _0x20f3f3={'status':_0x49f6ce};_0x168ec1[_0xf799('0x0')](_0x20f3f3[_0xf799('0x0')]);_0x168ec1[_0xf799('0x1')](_0x315063,{},function(_0x15052a,_0x314db3){if(_0x15052a){return _0x168ec1[_0xf799('0x0')](_0x20f3f3[_0xf799('0x0')])[_0xf799('0x2')](_0x20f3f3);}_0x168ec1[_0xf799('0x3')](_0x314db3);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index f806685..c7d70e1 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 9d11ac7..f0acb99 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccdc=['/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/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/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.5.0','/plugins','/server/files/plugins','route','sendFile','resolve','get','/index.html','path','express','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/reports/queue','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xccdc,0x1c4));var _0xcccd=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xccdc[_0x28aea5];return _0x6a55f9;};'use strict';var path=require(_0xcccd('0x0'));var express=require(_0xcccd('0x1'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require(_0xcccd('0x2'))[_0xcccd('0x3')];var clientSideLogs=require(_0xcccd('0x4'));exports[_0xcccd('0x5')]=function(_0x41cab2){return setupLoggers(_0x41cab2)[_0xcccd('0x6')](function(){_0x41cab2[_0xcccd('0x7')](_0xcccd('0x8'),require(_0xcccd('0x9')));_0x41cab2[_0xcccd('0x7')]('/api/voice/chanspy',require(_0xcccd('0xa')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xb'),require(_0xcccd('0xc')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xd'),require(_0xcccd('0xe')));_0x41cab2[_0xcccd('0x7')]('/api/voice/mohs',require(_0xcccd('0xf')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x10'),require(_0xcccd('0x11')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x12'),require(_0xcccd('0x13')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x14'),require(_0xcccd('0x15')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x16'),require(_0xcccd('0x17')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x18'),require(_0xcccd('0x19')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x1a'),require('./api/voiceCallReport'));_0x41cab2['use'](_0xcccd('0x1b'),require(_0xcccd('0x1c')));_0x41cab2[_0xcccd('0x7')]('/api/voice/agents/reports',require(_0xcccd('0x1d')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x1e'),require('./api/voiceQueueReport'));_0x41cab2[_0xcccd('0x7')]('/api/members/reports',require('./api/memberReport'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x1f'),require(_0xcccd('0x20')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x21'),require(_0xcccd('0x22')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x23'),require(_0xcccd('0x24')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x25'),require(_0xcccd('0x26')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x27'),require('./api/mailQueue'));_0x41cab2['use']('/api/mail/substatuses',require(_0xcccd('0x28')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x29'),require(_0xcccd('0x2a')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x2b'),require('./api/mailMessage'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x2c'),require(_0xcccd('0x2d')));_0x41cab2['use'](_0xcccd('0x2e'),require(_0xcccd('0x2f')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x30'),require(_0xcccd('0x31')));_0x41cab2['use'](_0xcccd('0x32'),require(_0xcccd('0x33')));_0x41cab2[_0xcccd('0x7')]('/api/fax/accounts',require(_0xcccd('0x34')));_0x41cab2['use'](_0xcccd('0x35'),require('./api/faxApplication'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x36'),require(_0xcccd('0x37')));_0x41cab2['use'](_0xcccd('0x38'),require('./api/faxMessage'));_0x41cab2[_0xcccd('0x7')]('/api/fax/queues',require('./api/faxQueue'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x39'),require('./api/faxQueueReport'));_0x41cab2[_0xcccd('0x7')]('/api/sms/accounts',require(_0xcccd('0x3a')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x3b'),require(_0xcccd('0x3c')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x3d'),require(_0xcccd('0x3e')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x3f'),require(_0xcccd('0x40')));_0x41cab2[_0xcccd('0x7')]('/api/sms/queues',require(_0xcccd('0x41')));_0x41cab2[_0xcccd('0x7')]('/api/openchannel/accounts',require(_0xcccd('0x42')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x43'),require(_0xcccd('0x44')));_0x41cab2[_0xcccd('0x7')]('/api/openchannel/interactions',require(_0xcccd('0x45')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x46'),require(_0xcccd('0x47')));_0x41cab2['use']('/api/openchannel/queues',require(_0xcccd('0x48')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x49'),require(_0xcccd('0x4a')));_0x41cab2[_0xcccd('0x7')]('/api/openchannel/reports/queue',require(_0xcccd('0x4b')));_0x41cab2[_0xcccd('0x7')]('/api/chat/applications',require(_0xcccd('0x4c')));_0x41cab2['use'](_0xcccd('0x4d'),require('./api/chatInteraction'));_0x41cab2['use']('/api/chat/messages',require(_0xcccd('0x4e')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x4f'),require('./api/chatOfflineMessage'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x50'),require('./api/chatQueue'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x51'),require(_0xcccd('0x52')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x53'),require(_0xcccd('0x54')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x55'),require('./api/cmCompany'));_0x41cab2['use'](_0xcccd('0x56'),require(_0xcccd('0x57')));_0x41cab2['use'](_0xcccd('0x58'),require(_0xcccd('0x59')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x5a'),require('./api/cmHopperBlack'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x5b'),require(_0xcccd('0x5c')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x5d'),require('./api/cmHopperHistory'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x5e'),require(_0xcccd('0x5f')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x60'),require('./api/action'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x61'),require(_0xcccd('0x62')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x63'),require('./api/cannedAnswer'));_0x41cab2['use'](_0xcccd('0x64'),require(_0xcccd('0x65')));_0x41cab2[_0xcccd('0x7')]('/api/conditions',require(_0xcccd('0x66')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x67'),require(_0xcccd('0x68')));_0x41cab2[_0xcccd('0x7')]('/api/pauses',require(_0xcccd('0x69')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x6a'),require(_0xcccd('0x6b')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x6c'),require(_0xcccd('0x6d')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x6e'),require(_0xcccd('0x6f')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x70'),require(_0xcccd('0x71')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x72'),require(_0xcccd('0x73')));_0x41cab2[_0xcccd('0x7')]('/api/contact_item_types',require(_0xcccd('0x74')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x75'),require(_0xcccd('0x76')));_0x41cab2['use']('/api/cm_hopper_additional_phones',require(_0xcccd('0x77')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x78'),require(_0xcccd('0x79')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x7a'),require(_0xcccd('0x7b')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x7c'),require(_0xcccd('0x7d')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x7e'),require(_0xcccd('0x7f')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x80'),require(_0xcccd('0x81')));_0x41cab2['use'](_0xcccd('0x82'),require('./api/analyticCustomReport'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x83'),require(_0xcccd('0x84')));_0x41cab2['use'](_0xcccd('0x85'),require('./api/analyticExtractedReport'));_0x41cab2['use'](_0xcccd('0x86'),require(_0xcccd('0x87')));_0x41cab2['use'](_0xcccd('0x88'),require(_0xcccd('0x89')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x8a'),require('./api/analyticTreeReport'));_0x41cab2['use'](_0xcccd('0x8b'),require(_0xcccd('0x8c')));_0x41cab2['use']('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x8d'),require(_0xcccd('0x8e')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x8f'),require(_0xcccd('0x90')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x91'),require(_0xcccd('0x92')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x93'),require(_0xcccd('0x94')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x95'),require('./api/intDeskAccount'));_0x41cab2['use'](_0xcccd('0x96'),require(_0xcccd('0x97')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x98'),require(_0xcccd('0x99')));_0x41cab2['use'](_0xcccd('0x9a'),require(_0xcccd('0x9b')));_0x41cab2['use'](_0xcccd('0x9c'),require(_0xcccd('0x9d')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x9e'),require(_0xcccd('0x9f')));_0x41cab2['use'](_0xcccd('0xa0'),require('./api/intZendeskAccount'));_0x41cab2['use'](_0xcccd('0xa1'),require(_0xcccd('0xa2')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xa3'),require(_0xcccd('0xa4')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xa5'),require(_0xcccd('0xa6')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xa7'),require(_0xcccd('0xa8')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xa9'),require('./api/intFreshdeskField'));_0x41cab2[_0xcccd('0x7')]('/api/integrations/vtiger/accounts',require(_0xcccd('0xaa')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xab'),require('./api/intVtigerConfiguration'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xac'),require(_0xcccd('0xad')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xae'),require('./api/intServicenowAccount'));_0x41cab2[_0xcccd('0x7')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xaf'),require(_0xcccd('0xb0')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xb1'),require(_0xcccd('0xb2')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xb3'),require(_0xcccd('0xb4')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xb5'),require(_0xcccd('0xb6')));_0x41cab2['use'](_0xcccd('0xb7'),require(_0xcccd('0xb8')));_0x41cab2['use']('/api/integrations/freshsales/configurations',require(_0xcccd('0xb9')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xba'),require(_0xcccd('0xbb')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xbc'),require('./api/network'));_0x41cab2['use'](_0xcccd('0xbd'),require(_0xcccd('0xbe')));_0x41cab2['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x41cab2['use'](_0xcccd('0xbf'),require(_0xcccd('0xc0')));_0x41cab2['use'](_0xcccd('0xc1'),require('./api/jscriptyQuestionReport'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xc2'),require('./api/jscriptySessionReport'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xc3'),require(_0xcccd('0xc4')));_0x41cab2[_0xcccd('0x7')]('/api/square/reports',require(_0xcccd('0xc5')));_0x41cab2['use'](_0xcccd('0xc6'),require(_0xcccd('0xc7')));_0x41cab2[_0xcccd('0x7')]('/api/jscripty/projects',require(_0xcccd('0xc8')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xc9'),require(_0xcccd('0xca')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xcb'),require(_0xcccd('0xcc')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xcd'),require(_0xcccd('0xce')));_0x41cab2['use'](_0xcccd('0xcf'),require(_0xcccd('0xd0')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xd1'),require(_0xcccd('0xd2')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xd3'),require('./api/team'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xd4'),require(_0xcccd('0xd5')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xd6'),require('./api/campaign'));_0x41cab2['use'](_0xcccd('0xd7'),require(_0xcccd('0xd8')));_0x41cab2['use'](_0xcccd('0xd9'),require(_0xcccd('0xda')));_0x41cab2['use'](_0xcccd('0xdb'),require('./api/plugin'));_0x41cab2[_0xcccd('0x7')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xdc'),require(_0xcccd('0xdd')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xde'),require('./api/faxTransferReport'));_0x41cab2[_0xcccd('0x7')]('/api/openchannel/reports/transfer',require(_0xcccd('0xdf')));_0x41cab2[_0xcccd('0x7')]('/api/sms/reports/transfer',require(_0xcccd('0xe0')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xe1'),require(_0xcccd('0xe2')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xe3'),require('./api/voicePrefix'));_0x41cab2['use'](_0xcccd('0xe4'),require(_0xcccd('0xe5')));_0x41cab2[_0xcccd('0x7')]('/api/userProfile/sections',require(_0xcccd('0xe6')));_0x41cab2['use'](_0xcccd('0xe7'),require(_0xcccd('0xe8')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xe9'),require('./api/userNotification'));_0x41cab2['use']('/api/whatsapp/accounts',require(_0xcccd('0xea')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xeb'),require(_0xcccd('0xec')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xed'),require(_0xcccd('0xee')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xef'),require(_0xcccd('0xf0')));_0x41cab2[_0xcccd('0x7')]('/api/whatsapp/reports/queue',require(_0xcccd('0xf1')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xf2'),require(_0xcccd('0xf3')));_0x41cab2['use'](_0xcccd('0xf4'),require(_0xcccd('0xf5')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xf6'),require(_0xcccd('0xf7')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xf8'),require(_0xcccd('0xf9')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xfa'),require('./api/user-setting'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xfb'),require(_0xcccd('0xfc')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xfd'),require(_0xcccd('0xfe')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0xff'),require('./api/authActiveDirectory'));_0x41cab2['use'](_0xcccd('0x100'),require(_0xcccd('0x101')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x102'),require(_0xcccd('0x103')));_0x41cab2['use']('/api/version',require('./api/version'));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x104'),require(_0xcccd('0x105')));_0x41cab2[_0xcccd('0x7')]('/api/pm2',require(_0xcccd('0x106')));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x107'),require(_0xcccd('0x108')));_0x41cab2['use']('/api/logs',clientSideLogs);_0x41cab2[_0xcccd('0x7')](_0xcccd('0x109'),express[_0xcccd('0x10a')](path[_0xcccd('0x10b')](config[_0xcccd('0x10c')],_0xcccd('0x109'))));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x10d'),express[_0xcccd('0x10a')](path[_0xcccd('0x10b')](config[_0xcccd('0x10c')],_0xcccd('0x10d'))));_0x41cab2[_0xcccd('0x7')]('/demo',express[_0xcccd('0x10a')](path[_0xcccd('0x10b')](config['root'],_0xcccd('0x10e'))));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x10f'),express[_0xcccd('0x10a')](path[_0xcccd('0x10b')](config[_0xcccd('0x10c')],'snippet',_0xcccd('0x110'))));_0x41cab2[_0xcccd('0x7')](_0xcccd('0x111'),express['static'](path['join'](config[_0xcccd('0x10c')],_0xcccd('0x112'))));_0x41cab2[_0xcccd('0x113')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x41cab2[_0xcccd('0x113')]('/*')['get'](function(_0x275b7a,_0x514108){_0x514108[_0xcccd('0x114')](path[_0xcccd('0x115')](_0x41cab2[_0xcccd('0x116')]('appPath')+_0xcccd('0x117')));});return _0x41cab2;});}; \ No newline at end of file +var _0x4a3d=['/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/license','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/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/logs','/apidoc','static','join','root','/demo','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount'];(function(_0x1cb552,_0x549cd9){var _0x3496d3=function(_0x330b47){while(--_0x330b47){_0x1cb552['push'](_0x1cb552['shift']());}};_0x3496d3(++_0x549cd9);}(_0x4a3d,0x79));var _0xd4a3=function(_0x23173e,_0x3968f6){_0x23173e=_0x23173e-0x0;var _0x128657=_0x4a3d[_0x23173e];return _0x128657;};'use strict';var path=require(_0xd4a3('0x0'));var express=require(_0xd4a3('0x1'));var errors=require(_0xd4a3('0x2'));var config=require(_0xd4a3('0x3'));var setupLoggers=require(_0xd4a3('0x4'))[_0xd4a3('0x5')];var clientSideLogs=require(_0xd4a3('0x6'));exports[_0xd4a3('0x7')]=function(_0xcae31b){return setupLoggers(_0xcae31b)[_0xd4a3('0x8')](function(){_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xa'),require('./api/user'));_0xcae31b['use'](_0xd4a3('0xb'),require(_0xd4a3('0xc')));_0xcae31b['use']('/api/voice/contexts',require(_0xd4a3('0xd')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe'),require(_0xd4a3('0xf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x10'),require(_0xd4a3('0x11')));_0xcae31b[_0xd4a3('0x9')]('/api/voice/queues',require(_0xd4a3('0x12')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x13'),require(_0xd4a3('0x14')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x15'),require(_0xd4a3('0x16')));_0xcae31b['use'](_0xd4a3('0x17'),require(_0xd4a3('0x18')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x19'),require(_0xd4a3('0x1a')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x1b'),require(_0xd4a3('0x1c')));_0xcae31b['use']('/api/voice/dials/reports',require(_0xd4a3('0x1d')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x1e'),require(_0xd4a3('0x1f')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x20'),require('./api/voiceQueueReport'));_0xcae31b[_0xd4a3('0x9')]('/api/members/reports',require(_0xd4a3('0x21')));_0xcae31b['use'](_0xd4a3('0x22'),require('./api/trunk'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x23'),require('./api/voiceTransferReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x24'),require(_0xd4a3('0x25')));_0xcae31b['use']('/api/mail/accounts',require(_0xd4a3('0x26')));_0xcae31b['use'](_0xd4a3('0x27'),require(_0xd4a3('0x28')));_0xcae31b['use']('/api/mail/substatuses',require('./api/mailSubstatus'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x29'),require(_0xd4a3('0x2a')));_0xcae31b['use'](_0xd4a3('0x2b'),require(_0xd4a3('0x2c')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x2d'),require(_0xd4a3('0x2e')));_0xcae31b[_0xd4a3('0x9')]('/api/mail/reports/queue',require(_0xd4a3('0x2f')));_0xcae31b[_0xd4a3('0x9')]('/api/dashboards',require(_0xd4a3('0x30')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x31'),require('./api/dashboardItem'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x32'),require(_0xd4a3('0x33')));_0xcae31b['use'](_0xd4a3('0x34'),require('./api/faxApplication'));_0xcae31b[_0xd4a3('0x9')]('/api/fax/interactions',require(_0xd4a3('0x35')));_0xcae31b['use'](_0xd4a3('0x36'),require('./api/faxMessage'));_0xcae31b[_0xd4a3('0x9')]('/api/fax/queues',require(_0xd4a3('0x37')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x38'),require(_0xd4a3('0x39')));_0xcae31b[_0xd4a3('0x9')]('/api/sms/accounts',require('./api/smsAccount'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x3a'),require(_0xd4a3('0x3b')));_0xcae31b[_0xd4a3('0x9')]('/api/sms/interactions',require(_0xd4a3('0x3c')));_0xcae31b[_0xd4a3('0x9')]('/api/sms/messages',require(_0xd4a3('0x3d')));_0xcae31b['use'](_0xd4a3('0x3e'),require(_0xd4a3('0x3f')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x40'),require(_0xd4a3('0x41')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x42'),require(_0xd4a3('0x43')));_0xcae31b[_0xd4a3('0x9')]('/api/openchannel/interactions',require(_0xd4a3('0x44')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x45'),require('./api/openchannelMessage'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x46'),require(_0xd4a3('0x47')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x48'),require(_0xd4a3('0x49')));_0xcae31b[_0xd4a3('0x9')]('/api/openchannel/reports/queue',require(_0xd4a3('0x4a')));_0xcae31b['use']('/api/chat/applications',require(_0xd4a3('0x4b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x4c'),require(_0xd4a3('0x4d')));_0xcae31b['use'](_0xd4a3('0x4e'),require('./api/chatMessage'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x4f'),require(_0xd4a3('0x50')));_0xcae31b[_0xd4a3('0x9')]('/api/chat/queues',require(_0xd4a3('0x51')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x52'),require(_0xd4a3('0x53')));_0xcae31b['use']('/api/chat/proactive_actions',require(_0xd4a3('0x54')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x55'),require(_0xd4a3('0x56')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x57'),require(_0xd4a3('0x58')));_0xcae31b['use']('/api/cm/hopper',require(_0xd4a3('0x59')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x5a'),require(_0xd4a3('0x5b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x5c'),require(_0xd4a3('0x5d')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x5e'),require(_0xd4a3('0x5f')));_0xcae31b['use'](_0xd4a3('0x60'),require(_0xd4a3('0x61')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x62'),require('./api/action'));_0xcae31b[_0xd4a3('0x9')]('/api/automations',require(_0xd4a3('0x63')));_0xcae31b['use'](_0xd4a3('0x64'),require(_0xd4a3('0x65')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x66'),require(_0xd4a3('0x67')));_0xcae31b['use'](_0xd4a3('0x68'),require(_0xd4a3('0x69')));_0xcae31b[_0xd4a3('0x9')]('/api/intervals',require(_0xd4a3('0x6a')));_0xcae31b[_0xd4a3('0x9')]('/api/pauses',require(_0xd4a3('0x6b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x6c'),require(_0xd4a3('0x6d')));_0xcae31b[_0xd4a3('0x9')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x6e'),require(_0xd4a3('0x6f')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x70'),require(_0xd4a3('0x71')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x72'),require('./api/tag'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x73'),require('./api/contactItemType'));_0xcae31b['use'](_0xd4a3('0x74'),require('./api/cmContactHasItem'));_0xcae31b['use'](_0xd4a3('0x75'),require(_0xd4a3('0x76')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x77'),require(_0xd4a3('0x78')));_0xcae31b[_0xd4a3('0x9')]('/api/triggers',require('./api/trigger'));_0xcae31b['use'](_0xd4a3('0x79'),require('./api/variable'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x7a'),require(_0xd4a3('0x7b')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x7c'),require(_0xd4a3('0x7d')));_0xcae31b[_0xd4a3('0x9')]('/api/analytics/custom_reports',require(_0xd4a3('0x7e')));_0xcae31b['use'](_0xd4a3('0x7f'),require('./api/analyticDefaultReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x80'),require('./api/analyticExtractedReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x81'),require('./api/analyticMetric'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x82'),require(_0xd4a3('0x83')));_0xcae31b['use'](_0xd4a3('0x84'),require(_0xd4a3('0x85')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/salesforce/accounts',require(_0xd4a3('0x86')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/salesforce/configurations',require(_0xd4a3('0x87')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x88'),require(_0xd4a3('0x89')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8a'),require('./api/intSugarcrmAccount'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8b'),require(_0xd4a3('0x8c')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8d'),require(_0xd4a3('0x8e')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x8f'),require(_0xd4a3('0x90')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x91'),require(_0xd4a3('0x92')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x93'),require(_0xd4a3('0x94')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x95'),require(_0xd4a3('0x96')));_0xcae31b['use'](_0xd4a3('0x97'),require(_0xd4a3('0x98')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x99'),require(_0xd4a3('0x9a')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x9b'),require('./api/intZendeskAccount'));_0xcae31b['use'](_0xd4a3('0x9c'),require('./api/intZendeskConfiguration'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x9d'),require(_0xd4a3('0x9e')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x9f'),require('./api/intFreshdeskAccount'));_0xcae31b['use'](_0xd4a3('0xa0'),require(_0xd4a3('0xa1')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xa2'),require('./api/intFreshdeskField'));_0xcae31b['use'](_0xd4a3('0xa3'),require(_0xd4a3('0xa4')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0xcae31b['use'](_0xd4a3('0xa5'),require('./api/intVtigerField'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xa6'),require(_0xd4a3('0xa7')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/servicenow/configurations',require(_0xd4a3('0xa8')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/servicenow/fields',require(_0xd4a3('0xa9')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0xcae31b['use'](_0xd4a3('0xaa'),require(_0xd4a3('0xab')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xac'),require(_0xd4a3('0xad')));_0xcae31b[_0xd4a3('0x9')]('/api/integrations/freshsales/accounts',require(_0xd4a3('0xae')));_0xcae31b['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xaf'),require(_0xd4a3('0xb0')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb1'),require(_0xd4a3('0xb2')));_0xcae31b[_0xd4a3('0x9')]('/api/chat/reports/queue',require(_0xd4a3('0xb3')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb4'),require(_0xd4a3('0xb5')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb6'),require(_0xd4a3('0xb7')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xb8'),require(_0xd4a3('0xb9')));_0xcae31b['use'](_0xd4a3('0xba'),require('./api/jscriptySessionReport'));_0xcae31b[_0xd4a3('0x9')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0xcae31b['use'](_0xd4a3('0xbb'),require(_0xd4a3('0xbc')));_0xcae31b[_0xd4a3('0x9')]('/api/square/details/reports',require(_0xd4a3('0xbd')));_0xcae31b['use'](_0xd4a3('0xbe'),require(_0xd4a3('0xbf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc0'),require('./api/setting'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc1'),require(_0xd4a3('0xc2')));_0xcae31b[_0xd4a3('0x9')]('/api/square/projects',require('./api/squareProject'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc3'),require(_0xd4a3('0xc4')));_0xcae31b[_0xd4a3('0x9')]('/api/square/messages',require(_0xd4a3('0xc5')));_0xcae31b['use']('/api/teams',require(_0xd4a3('0xc6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xc7'),require(_0xd4a3('0xc8')));_0xcae31b[_0xd4a3('0x9')]('/api/campaigns',require('./api/campaign'));_0xcae31b['use'](_0xd4a3('0xc9'),require(_0xd4a3('0xca')));_0xcae31b['use'](_0xd4a3('0xcb'),require(_0xd4a3('0xcc')));_0xcae31b['use'](_0xd4a3('0xcd'),require(_0xd4a3('0xce')));_0xcae31b['use']('/api/mail/reports/transfer',require(_0xd4a3('0xcf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd0'),require('./api/chatTransferReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd1'),require(_0xd4a3('0xd2')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd3'),require(_0xd4a3('0xd4')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd5'),require(_0xd4a3('0xd6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd7'),require('./api/cmList'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd8'),require('./api/voicePrefix'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xd9'),require('./api/userProfile'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xda'),require(_0xd4a3('0xdb')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xdc'),require('./api/userProfileResource'));_0xcae31b[_0xd4a3('0x9')]('/api/userNotifications',require('./api/userNotification'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xdd'),require(_0xd4a3('0xde')));_0xcae31b['use']('/api/whatsapp/applications',require(_0xd4a3('0xdf')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe0'),require(_0xd4a3('0xe1')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe2'),require(_0xd4a3('0xe3')));_0xcae31b['use'](_0xd4a3('0xe4'),require('./api/whatsappQueueReport'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe5'),require(_0xd4a3('0xe6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe7'),require('./api/whatsappQueue'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xe8'),require(_0xd4a3('0xe9')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xea'),require(_0xd4a3('0xeb')));_0xcae31b[_0xd4a3('0x9')]('/api/user-settings',require('./api/user-setting'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xec'),require('./api/authLocal'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xed'),require(_0xd4a3('0xee')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xef'),require(_0xd4a3('0xf0')));_0xcae31b['use'](_0xd4a3('0xf1'),require(_0xd4a3('0xf2')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf3'),require(_0xd4a3('0xf4')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf5'),require('./api/version'));_0xcae31b['use']('/api/system',require(_0xd4a3('0xf6')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf7'),require(_0xd4a3('0xf8')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xf9'),require('./api/webbar'));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xfa'),clientSideLogs);_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xfb'),express[_0xd4a3('0xfc')](path[_0xd4a3('0xfd')](config[_0xd4a3('0xfe')],'/apidoc')));_0xcae31b[_0xd4a3('0x9')]('/www',express[_0xd4a3('0xfc')](path['join'](config['root'],'/www')));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0xff'),express[_0xd4a3('0xfc')](path[_0xd4a3('0xfd')](config[_0xd4a3('0xfe')],_0xd4a3('0xff'))));_0xcae31b[_0xd4a3('0x9')]('/snippet',express[_0xd4a3('0xfc')](path['join'](config[_0xd4a3('0xfe')],_0xd4a3('0x100'),_0xd4a3('0x101'))));_0xcae31b[_0xd4a3('0x9')](_0xd4a3('0x102'),express[_0xd4a3('0xfc')](path[_0xd4a3('0xfd')](config['root'],_0xd4a3('0x103'))));_0xcae31b[_0xd4a3('0x104')](_0xd4a3('0x105'))[_0xd4a3('0x106')](errors[0x194]);_0xcae31b[_0xd4a3('0x104')]('/*')[_0xd4a3('0x106')](function(_0x588edd,_0x3ea280){_0x3ea280[_0xd4a3('0x107')](path[_0xd4a3('0x108')](_0xcae31b[_0xd4a3('0x106')]('appPath')+_0xd4a3('0x109')));});return _0xcae31b;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ac129fc..12d4993 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x475d=['default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/voiceQueue/voiceQueue.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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../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/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers'];(function(_0x26c42d,_0x385e52){var _0x4d5294=function(_0x4e5cbc){while(--_0x4e5cbc){_0x26c42d['push'](_0x26c42d['shift']());}};_0x4d5294(++_0x385e52);}(_0x475d,0x188));var _0xd475=function(_0x27dd27,_0x397f9e){_0x27dd27=_0x27dd27-0x0;var _0x116fed=_0x475d[_0x27dd27];return _0x116fed;};'use strict';var jayson=require('jayson/promise');var _=require(_0xd475('0x0'));var config=require(_0xd475('0x1'));exports[_0xd475('0x2')]=function(){return new Promise(function(_0x493909,_0x198b11){var _0x3c52a2={};_0x3c52a2=_['merge'](_0x3c52a2,require('../api/user/user.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/voiceExtension/voiceExtension.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x4')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x5')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x6')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x7')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x8')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x9')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0xa')));_0x3c52a2=_['merge'](_0x3c52a2,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0xb')));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0xc')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0xd')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0xe')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0xf')));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x10')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x11')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x12')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x13')));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x14')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/faxInteraction/faxInteraction.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x15')));_0x3c52a2=_['merge'](_0x3c52a2,require('../api/faxQueue/faxQueue.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x16')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x17')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x18')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x19')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/smsQueue/smsQueue.rpc'));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x1a')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x1b')));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x1c')));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x1d')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x1e')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x1f')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/cmHopper/cmHopper.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x20')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x21')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3c52a2=_['merge'](_0x3c52a2,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x22')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x23')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/sound/sound.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x24')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x25')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x26')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x27')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x28')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x29')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x2a')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x2b')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x2c')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x2d')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x2e')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/squareReport/squareReport.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x2f')));_0x3c52a2=_['merge'](_0x3c52a2,require('../api/squareOdbc/squareOdbc.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/squareProject/squareProject.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x30')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x31')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/campaign/campaign.rpc'));_0x3c52a2=_['merge'](_0x3c52a2,require(_0xd475('0x32')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x33')));_0x3c52a2=_['merge'](_0x3c52a2,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x34')));_0x3c52a2=_['merge'](_0x3c52a2,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require(_0xd475('0x35')));_0x3c52a2=_[_0xd475('0x3')](_0x3c52a2,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x2a6931=jayson[_0xd475('0x36')](_0x3c52a2)[_0xd475('0x37')]();var _0x380b39=config[_0xd475('0x38')]['port']||config[_0xd475('0x39')]+0x1;var _0x397a32=config[_0xd475('0x38')]['ip']||_0xd475('0x3a');_0x2a6931['on'](_0xd475('0x3b'),function(_0x1351cc){return _0x198b11(_0x1351cc);});_0x2a6931[_0xd475('0x2')](_0x380b39,_0x397a32,function(){console[_0xd475('0x3c')](_0xd475('0x3d'),_0x397a32,_0x380b39);require(_0xd475('0x3e'))[_0xd475('0x3f')]();return _0x493909(_0xd475('0x40')+_0x397a32+':'+_0x380b39);});});}; \ No newline at end of file +var _0xfa00=['../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','http','port','rpc','localhost','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/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.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/squareMessage/squareMessage.rpc'];(function(_0x3c3698,_0xa0bf08){var _0x4e6637=function(_0x1fc9a4){while(--_0x1fc9a4){_0x3c3698['push'](_0x3c3698['shift']());}};_0x4e6637(++_0xa0bf08);}(_0xfa00,0x129));var _0x0fa0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfa00[_0x4565bf];return _0x5610ba;};'use strict';var jayson=require(_0x0fa0('0x0'));var _=require(_0x0fa0('0x1'));var config=require(_0x0fa0('0x2'));exports['listen']=function(){return new Promise(function(_0x5246a8,_0x9db3b7){var _0x5124fe={};_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x4')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/voiceExtension/voiceExtension.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x5')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x6')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x7')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x8')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x9')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0xa')));_0x5124fe=_['merge'](_0x5124fe,require('../api/trunk/trunk.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xb')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xc')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/mailServerIn/mailServerIn.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xd')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0xe')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0xf')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x10')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x11')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x12')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/faxAccount/faxAccount.rpc'));_0x5124fe=_['merge'](_0x5124fe,require('../api/faxApplication/faxApplication.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x13')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x14')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x15')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x16')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x17')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x18')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x19')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x1a')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1b')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x1c')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1d')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1e')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x1f')));_0x5124fe=_['merge'](_0x5124fe,require('../api/chatQueue/chatQueue.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/cmContact/cmContact.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x20')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x21')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x22')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x23')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x24')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/sound/sound.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x25')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x26')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/trigger/trigger.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x27')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x28')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x29')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x2a')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x2b')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x2c')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x2d')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x2e')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x2f')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x30')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x31')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x32')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x33')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x34')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x35')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x36')));_0x5124fe=_['merge'](_0x5124fe,require('../api/squareOdbc/squareOdbc.rpc'));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x37')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x38')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x39')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x3a')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x3b')));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x3c')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5124fe=_['merge'](_0x5124fe,require(_0x0fa0('0x3d')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require(_0x0fa0('0x3e')));_0x5124fe=_[_0x0fa0('0x3')](_0x5124fe,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5124fe=_['merge'](_0x5124fe,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x427737=jayson['server'](_0x5124fe)[_0x0fa0('0x3f')]();var _0x32f7bb=config['rpc']['port']||config[_0x0fa0('0x40')]+0x1;var _0x52afaa=config[_0x0fa0('0x41')]['ip']||_0x0fa0('0x42');_0x427737['on']('error',function(_0x574e89){return _0x9db3b7(_0x574e89);});_0x427737['listen'](_0x32f7bb,_0x52afaa,function(){console['log'](_0x0fa0('0x43'),_0x52afaa,_0x32f7bb);require(_0x0fa0('0x44'))[_0x0fa0('0x45')]();return _0x5246a8(_0x0fa0('0x46')+_0x52afaa+':'+_0x32f7bb);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c725b40..f6e827b 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 _0xe5a6=['extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','ready','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','sendRequest','command','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','prototype','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt'];(function(_0x4d8782,_0x40cb35){var _0x396f75=function(_0x255e72){while(--_0x255e72){_0x4d8782['push'](_0x4d8782['shift']());}};_0x396f75(++_0x40cb35);}(_0xe5a6,0x104));var _0x6e5a=function(_0x5b89a0,_0x315a2a){_0x5b89a0=_0x5b89a0-0x0;var _0x44d81a=_0xe5a6[_0x5b89a0];return _0x44d81a;};'use strict';var util=require(_0x6e5a('0x0'));var _=require(_0x6e5a('0x1'));var EventEmitter=require(_0x6e5a('0x2'))[_0x6e5a('0x3')];var AGIReply=require(_0x6e5a('0x4'));var AGIError=require(_0x6e5a('0x5'));function AGIChannel(_0x5a4692){var _0x3123e6=this,_0x4195c1=new AGIReply(),_0x51944b=![],_0x34a9ff={};EventEmitter[_0x6e5a('0x6')](_0x3123e6);_0x5a4692[_0x6e5a('0x7')](_0x6e5a('0x8'));_0x5a4692[_0x6e5a('0x9')](0x8*0x3c*0x3c*0x3e8);_0x4195c1[_0x6e5a('0x7')](_0x6e5a('0x8'));_0x4195c1['on'](_0x6e5a('0xa'),function(_0x4be0b3){for(var _0x5e970d in _0x4be0b3){_0x3123e6[_0x5e970d]=_0x4be0b3[_0x5e970d];}_0x3123e6['emit'](_0x6e5a('0xb'));});_0x4195c1['on']('line',function(_0x2652c2){if(_0x2652c2[_0x6e5a('0xc')]()==_0x6e5a('0xd')){_0x3123e6[_0x6e5a('0xe')]('hangup');return;}if(_0x2652c2[_0x6e5a('0xf')](0x0,0xb)==_0x6e5a('0x10')){_0x51944b=!![];}if(_0x51944b){_0x34a9ff['rx']+=_0x2652c2+'\x0a';if(_0x2652c2[_0x6e5a('0x11')](_0x6e5a('0x12'))!=-0x1){_0x51944b=![];}}else{_0x34a9ff['rx']=_0x2652c2;}if(_0x51944b){return;}if(typeof _0x34a9ff['cb']==_0x6e5a('0x13')){var _0x509381=_0x34a9ff['rx'][_0x6e5a('0xf')](0x0,0x3),_0x2f81e2=null,_0x4cfe50=null;_0x509381=parseInt(_0x509381);if(isNaN(_0x509381)){_0x34a9ff['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6e5a('0x14')});return;}if(_0x509381!=0xc8){_0x34a9ff['cb'](null,{'code':_0x509381,'result':-0x1,'extra':'KO'});return;}_0x2f81e2=_0x34a9ff['rx'][_0x6e5a('0xf')](0x4)[_0x6e5a('0x15')](_0x6e5a('0x16'),'');if(_0x2f81e2[_0x6e5a('0x17')]('\x20')!=-0x1){_0x2f81e2=_0x2f81e2[_0x6e5a('0x18')](0x0,_0x2f81e2[_0x6e5a('0x17')]('\x20'));}if(_[_0x6e5a('0x19')](_0x2f81e2,'-1')){_0x2f81e2=parseInt(_0x2f81e2);}_0x4cfe50=_0x34a9ff['rx'][_0x6e5a('0x1a')]('\x20');if(_0x4cfe50[_0x6e5a('0x1b')]==0x3){_0x4cfe50=_0x4cfe50[0x2][_0x6e5a('0xf')](0x1,_0x4cfe50[0x2][_0x6e5a('0x1b')]-0x1);}else if(_0x4cfe50[_0x6e5a('0x1b')]>0x3){var _0x232ede=/\((.+)\)/;var _0x52ceb4=_0x34a9ff['rx'][_0x6e5a('0x1c')](_0x232ede);if(_0x52ceb4){_0x4cfe50=_0x52ceb4[0x1];}else{_0x4cfe50=null;}}else{_0x4cfe50=null;}_0x34a9ff['cb'](null,{'code':_0x509381,'result':_0x2f81e2,'extra':_0x4cfe50});}});_0x5a4692['on']('error',function(_0x555d94){_0x3123e6[_0x6e5a('0xe')](_0x6e5a('0x1d'),new AGIError(_0x6e5a('0x1e'),_0x555d94[_0x6e5a('0x1f')]));});_0x5a4692['on']('close',function(){_0x3123e6['emit'](_0x6e5a('0x20'),new AGIError(_0x6e5a('0x21')));});_0x5a4692['on']('timeout',function(){_0x3123e6['emit'](_0x6e5a('0x22'),new AGIError(_0x6e5a('0x23')));_0x5a4692[_0x6e5a('0x24')]();});_0x5a4692[_0x6e5a('0x25')](_0x4195c1);this['command']=function(_0x4c3553,_0x59096d){var _0x4c3553=_0x4c3553||'',_0x59096d=typeof _0x59096d==_0x6e5a('0x13')?_0x59096d:new Function();_0x34a9ff={'tx':_0x4c3553,'rx':'','cb':_0x59096d};_0x5a4692[_0x6e5a('0x26')](_0x4c3553+'\x0a');},this[_0x6e5a('0x20')]=function(){_0x5a4692[_0x6e5a('0x24')]();};}util[_0x6e5a('0x27')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x6e5a('0x28')]=function(_0xfcd4b5){return this[_0x6e5a('0x29')][_0x6e5a('0x2a')](this,_0xfcd4b5);};AGIChannel['prototype'][_0x6e5a('0x2b')]=function(){return this['sendRequest'](_0x6e5a('0x2c'));};AGIChannel['prototype'][_0x6e5a('0x2d')]=function(_0x65b7e2,_0x3e4090,_0x12e944){_0x65b7e2=_0x65b7e2===undefined?'beep':_0x65b7e2;_0x3e4090=_0x3e4090===undefined?'5':_0x3e4090;_0x12e944=_0x12e944===undefined?'1':_0x12e944;return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')](_0x6e5a('0x2f'),_0x65b7e2,_0x3e4090*0x3e8,_0x12e944));};AGIChannel['prototype'][_0x6e5a('0x30')]=function(_0x3957d5){_0x3957d5=_0x3957d5||_0x6e5a('0x31');return this['sendRequest'](util['format']('VERBOSE\x20\x22%s\x22',_0x3957d5));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x33')]=function(_0x3d65dc,_0x21606f){if(_['isArray'](_0x21606f)){return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')](_0x6e5a('0x34'),_0x3d65dc,_0x21606f[_0x6e5a('0x35')](',')));}return this['sendRequest'](util['format'](_0x6e5a('0x34'),_0x3d65dc,_0x21606f));};AGIChannel['prototype'][_0x6e5a('0x36')]=function(_0x303250){return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')](_0x6e5a('0x37'),_0x303250));};AGIChannel['prototype'][_0x6e5a('0x38')]=function(_0x1eb200){return this[_0x6e5a('0x28')](util['format'](_0x6e5a('0x39'),_0x1eb200));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x3a')]=function(_0x2fad77){return this['sendRequest'](util[_0x6e5a('0x2e')](_0x6e5a('0x3b'),_0x2fad77));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0xd')]=function(){return this[_0x6e5a('0x28')](_0x6e5a('0x3c'));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x3d')]=function(_0x588ab7,_0x49199b){var _0x5d084f=_[_0x6e5a('0x3e')](_0x49199b)||_[_0x6e5a('0x3f')](_0x49199b)?_0x49199b['toString']():_0x49199b;return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x588ab7,_0x5d084f?_0x5d084f[_0x6e5a('0x40')]()[_0x6e5a('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x6e5a('0x41')]=function(_0x56253a,_0x5bd349){return this[_0x6e5a('0x28')](util['format'](_0x6e5a('0x42'),_0x56253a,_0x5bd349));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x43')]=function(_0x1c3fde,_0x2a0674){return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')](_0x6e5a('0x44'),_0x1c3fde,_0x2a0674));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x45')]=function(_0x5cccdd,_0x2bfe9b){return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')](_0x6e5a('0x46'),_0x5cccdd,_0x2bfe9b));};AGIChannel['prototype'][_0x6e5a('0x47')]=function(_0x5d5992,_0x569cd6,_0x5d18b6){_0x569cd6=_0x569cd6||this[_0x6e5a('0x48')];_0x5d18b6=_0x5d18b6||0x1;this[_0x6e5a('0x36')](_0x5d5992);this['setExtension'](_0x569cd6);this['setPriority'](_0x5d18b6);return this[_0x6e5a('0x30')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x5d5992,_0x569cd6,_0x5d18b6));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x49')]=function(_0x46db34){return this[_0x6e5a('0x28')](util[_0x6e5a('0x2e')](_0x6e5a('0x4a'),_0x46db34));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x4b')]=function(_0x4d4d2f,_0x3e1987,_0x35c7db,_0x145643,_0x4732f0,_0x2dabac){_0x3e1987=_0x3e1987||_0x6e5a('0x4c');_0x35c7db=_0x35c7db||'';_0x145643=_0x145643===undefined?-0x1:_0x145643==='-1'?-0x1:_0x145643*0x3e8;_0x4732f0=_0x4732f0===undefined?'':'s='+_0x4732f0;_0x2dabac=_0x2dabac?_0x6e5a('0x4d'):'';return this[_0x6e5a('0x28')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x4d4d2f,_0x3e1987,_0x35c7db,_0x145643,_0x2dabac,_0x4732f0));};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x4e')]=function(_0x13a3bc,_0x1e6111){_0x1e6111=_0x1e6111||'';return this[_0x6e5a('0x28')](util['format'](_0x6e5a('0x4f'),_0x13a3bc,_0x1e6111));};AGIChannel[_0x6e5a('0x32')]['agi']=function(_0x3bc7fd){return this['exec']('AGI',_0x3bc7fd);};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x50')]=function(_0x172ca3){return this['exec']('WAIT',_0x172ca3);};AGIChannel[_0x6e5a('0x32')][_0x6e5a('0x1d')]=function(_0x2a1855,_0x2b46d5){this[_0x6e5a('0x30')](util[_0x6e5a('0x2e')](_0x6e5a('0x51'),_0x2a1855['id'],_0x2a1855[_0x6e5a('0x52')],_0x2b46d5));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x0703=['sync','prototype','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','result=','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write','destroy','inherits','sendRequest'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x0703,0xc0));var _0x3070=function(_0x128a79,_0x19f331){_0x128a79=_0x128a79-0x0;var _0x2ff426=_0x0703[_0x128a79];return _0x2ff426;};'use strict';var util=require(_0x3070('0x0'));var _=require(_0x3070('0x1'));var EventEmitter=require(_0x3070('0x2'))[_0x3070('0x3')];var AGIReply=require(_0x3070('0x4'));var AGIError=require(_0x3070('0x5'));function AGIChannel(_0x4ab1d4){var _0x579bb1=this,_0x1736e5=new AGIReply(),_0x5f4b06=![],_0x240844={};EventEmitter[_0x3070('0x6')](_0x579bb1);_0x4ab1d4[_0x3070('0x7')](_0x3070('0x8'));_0x4ab1d4[_0x3070('0x9')](0x8*0x3c*0x3c*0x3e8);_0x1736e5[_0x3070('0x7')]('utf8');_0x1736e5['on'](_0x3070('0xa'),function(_0xf3a45f){for(var _0x2fb8bf in _0xf3a45f){_0x579bb1[_0x2fb8bf]=_0xf3a45f[_0x2fb8bf];}_0x579bb1[_0x3070('0xb')](_0x3070('0xc'));});_0x1736e5['on'](_0x3070('0xd'),function(_0x3394b1){if(_0x3394b1[_0x3070('0xe')]()==_0x3070('0xf')){_0x579bb1[_0x3070('0xb')](_0x3070('0xf'));return;}if(_0x3394b1[_0x3070('0x10')](0x0,0xb)==_0x3070('0x11')){_0x5f4b06=!![];}if(_0x5f4b06){_0x240844['rx']+=_0x3394b1+'\x0a';if(_0x3394b1['search'](_0x3070('0x12'))!=-0x1){_0x5f4b06=![];}}else{_0x240844['rx']=_0x3394b1;}if(_0x5f4b06){return;}if(typeof _0x240844['cb']=='function'){var _0x49e797=_0x240844['rx'][_0x3070('0x10')](0x0,0x3),_0x22277c=null,_0x4a80ab=null;_0x49e797=parseInt(_0x49e797);if(isNaN(_0x49e797)){_0x240844['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3070('0x13')});return;}if(_0x49e797!=0xc8){_0x240844['cb'](null,{'code':_0x49e797,'result':-0x1,'extra':'KO'});return;}_0x22277c=_0x240844['rx'][_0x3070('0x10')](0x4)[_0x3070('0x14')](_0x3070('0x15'),'');if(_0x22277c['indexOf']('\x20')!=-0x1){_0x22277c=_0x22277c[_0x3070('0x16')](0x0,_0x22277c[_0x3070('0x17')]('\x20'));}if(_['startsWith'](_0x22277c,'-1')){_0x22277c=parseInt(_0x22277c);}_0x4a80ab=_0x240844['rx']['split']('\x20');if(_0x4a80ab[_0x3070('0x18')]==0x3){_0x4a80ab=_0x4a80ab[0x2][_0x3070('0x10')](0x1,_0x4a80ab[0x2][_0x3070('0x18')]-0x1);}else if(_0x4a80ab[_0x3070('0x18')]>0x3){var _0x766377=/\((.+)\)/;var _0x3641ec=_0x240844['rx'][_0x3070('0x19')](_0x766377);if(_0x3641ec){_0x4a80ab=_0x3641ec[0x1];}else{_0x4a80ab=null;}}else{_0x4a80ab=null;}_0x240844['cb'](null,{'code':_0x49e797,'result':_0x22277c,'extra':_0x4a80ab});}});_0x4ab1d4['on'](_0x3070('0x1a'),function(_0x4564fc){_0x579bb1[_0x3070('0xb')](_0x3070('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x4564fc[_0x3070('0x1b')]));});_0x4ab1d4['on']('close',function(){_0x579bb1[_0x3070('0xb')](_0x3070('0x1c'),new AGIError(_0x3070('0x1d')));});_0x4ab1d4['on'](_0x3070('0x1e'),function(){_0x579bb1[_0x3070('0xb')](_0x3070('0x1e'),new AGIError(_0x3070('0x1f')));_0x4ab1d4['destroy']();});_0x4ab1d4[_0x3070('0x20')](_0x1736e5);this[_0x3070('0x21')]=function(_0x13452c,_0x39735d){var _0x13452c=_0x13452c||'',_0x39735d=typeof _0x39735d==_0x3070('0x22')?_0x39735d:new Function();_0x240844={'tx':_0x13452c,'rx':'','cb':_0x39735d};_0x4ab1d4[_0x3070('0x23')](_0x13452c+'\x0a');},this[_0x3070('0x1c')]=function(){_0x4ab1d4[_0x3070('0x24')]();};}util[_0x3070('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x3070('0x26')]=function(_0x530198){return this[_0x3070('0x21')][_0x3070('0x27')](this,_0x530198);};AGIChannel[_0x3070('0x28')]['answer']=function(){return this[_0x3070('0x26')](_0x3070('0x29'));};AGIChannel[_0x3070('0x28')][_0x3070('0x2a')]=function(_0x853abb,_0xe826d9,_0x2def9d){_0x853abb=_0x853abb===undefined?_0x3070('0x2b'):_0x853abb;_0xe826d9=_0xe826d9===undefined?'5':_0xe826d9;_0x2def9d=_0x2def9d===undefined?'1':_0x2def9d;return this[_0x3070('0x26')](util[_0x3070('0x2c')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x853abb,_0xe826d9*0x3e8,_0x2def9d));};AGIChannel[_0x3070('0x28')][_0x3070('0x2d')]=function(_0x1ffb6a){_0x1ffb6a=_0x1ffb6a||_0x3070('0x2e');return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x2f'),_0x1ffb6a));};AGIChannel[_0x3070('0x28')][_0x3070('0x30')]=function(_0x359ca2,_0x134709){if(_['isArray'](_0x134709)){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x31'),_0x359ca2,_0x134709[_0x3070('0x32')](',')));}return this['sendRequest'](util[_0x3070('0x2c')]('EXEC\x20%s\x20%s',_0x359ca2,_0x134709));};AGIChannel[_0x3070('0x28')][_0x3070('0x33')]=function(_0x34d973){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x34'),_0x34d973));};AGIChannel[_0x3070('0x28')]['setExtension']=function(_0xcdd8c8){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x35'),_0xcdd8c8));};AGIChannel[_0x3070('0x28')][_0x3070('0x36')]=function(_0x23e7cc){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x37'),_0x23e7cc));};AGIChannel[_0x3070('0x28')]['hangup']=function(){return this[_0x3070('0x26')]('HANGUP');};AGIChannel['prototype'][_0x3070('0x38')]=function(_0x222de6,_0x123ba6){var _0x19b4cf=_[_0x3070('0x39')](_0x123ba6)||_['isNumber'](_0x123ba6)?_0x123ba6[_0x3070('0x3a')]():_0x123ba6;return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x3b'),_0x222de6,_0x19b4cf?_0x19b4cf[_0x3070('0x3a')]()[_0x3070('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x3070('0x3c')]=function(_0x3cb314,_0x4ba627){return this[_0x3070('0x26')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x3cb314,_0x4ba627));};AGIChannel[_0x3070('0x28')]['sayDigits']=function(_0x1a31e3,_0x861e63){return this['sendRequest'](util[_0x3070('0x2c')](_0x3070('0x3d'),_0x1a31e3,_0x861e63));};AGIChannel[_0x3070('0x28')]['sayPhonetic']=function(_0x55f16c,_0x10ba8b){return this['sendRequest'](util[_0x3070('0x2c')](_0x3070('0x3e'),_0x55f16c,_0x10ba8b));};AGIChannel['prototype'][_0x3070('0x3f')]=function(_0xcf737f,_0x2944b1,_0x3155ee){_0x2944b1=_0x2944b1||this['extension'];_0x3155ee=_0x3155ee||0x1;this['setContext'](_0xcf737f);this[_0x3070('0x40')](_0x2944b1);this[_0x3070('0x36')](_0x3155ee);return this['noop'](util[_0x3070('0x2c')](_0x3070('0x41'),_0xcf737f,_0x2944b1,_0x3155ee));};AGIChannel['prototype']['getVariable']=function(_0xc49e8e){return this[_0x3070('0x26')](util[_0x3070('0x2c')](_0x3070('0x42'),_0xc49e8e));};AGIChannel[_0x3070('0x28')]['recordFile']=function(_0x3034f1,_0x241f0a,_0x5a25d7,_0x365c4e,_0x7b99fe,_0x4c590c){_0x241f0a=_0x241f0a||_0x3070('0x43');_0x5a25d7=_0x5a25d7||'';_0x365c4e=_0x365c4e===undefined?-0x1:_0x365c4e==='-1'?-0x1:_0x365c4e*0x3e8;_0x7b99fe=_0x7b99fe===undefined?'':'s='+_0x7b99fe;_0x4c590c=_0x4c590c?_0x3070('0x44'):'';return this['sendRequest'](util[_0x3070('0x2c')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3034f1,_0x241f0a,_0x5a25d7,_0x365c4e,_0x4c590c,_0x7b99fe));};AGIChannel[_0x3070('0x28')][_0x3070('0x45')]=function(_0x209ba2,_0xbf0d1e){_0xbf0d1e=_0xbf0d1e||'';return this['sendRequest'](util['format'](_0x3070('0x46'),_0x209ba2,_0xbf0d1e));};AGIChannel['prototype'][_0x3070('0x47')]=function(_0x3abee0){return this[_0x3070('0x30')](_0x3070('0x48'),_0x3abee0);};AGIChannel[_0x3070('0x28')][_0x3070('0x49')]=function(_0x3cd497){return this[_0x3070('0x30')]('WAIT',_0x3cd497);};AGIChannel['prototype'][_0x3070('0x1a')]=function(_0x1b5294,_0x28299a){this[_0x3070('0x2d')](util[_0x3070('0x2c')](_0x3070('0x4a'),_0x1b5294['id'],_0x1b5294[_0x3070('0x4b')],_0x28299a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3070('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index dd4ddb9..d43d7b5 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 _0x3061=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x2dac1f,_0x4ef562){var _0x3955fa=function(_0x41df11){while(--_0x41df11){_0x2dac1f['push'](_0x2dac1f['shift']());}};_0x3955fa(++_0x4ef562);}(_0x3061,0xaf));var _0x1306=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x3061[_0x510b98];return _0x45e775;};'use strict';var util=require(_0x1306('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x1306('0x1'),'E_AGI_SERVER_ERROR':_0x1306('0x2'),'E_AGI_SERVER_CLOSE':_0x1306('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x1306('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x1306('0x5'),'E_AGI_SOCKET_ERROR':_0x1306('0x6'),'E_AGI_SOCKET_CLOSE':_0x1306('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x1306('0x8'),'E_AGI_COMMAND_EMPTY':_0x1306('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1306('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x34693e){var _0x34693e=_0x34693e||null,_0x2fd228=_0x2fd228||[],_0x228169=0x1,_0xea8e10='';if(!error[_0x34693e]){_0x34693e='E_AGI_UNDEFINED';}_0x2fd228[_0x1306('0xb')](error[_0x34693e]);while(arguments[_0x228169]){_0x2fd228['push'](arguments[_0x228169]);_0x228169++;}_0xea8e10=util[_0x1306('0xc')][_0x1306('0xd')](util,_0x2fd228);this['message']=_0xea8e10;this['name']=_0x34693e;}module[_0x1306('0xe')]=AGIError; \ No newline at end of file +var _0xf4d5=['message','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x2535df,_0x125763){var _0x5ef9e1=function(_0x31bad7){while(--_0x31bad7){_0x2535df['push'](_0x2535df['shift']());}};_0x5ef9e1(++_0x125763);}(_0xf4d5,0xd4));var _0x5f4d=function(_0x4db006,_0x3d27c1){_0x4db006=_0x4db006-0x0;var _0x493afc=_0xf4d5[_0x4db006];return _0x493afc;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5f4d('0x0'),'E_AGI_ARGUMENT_PORT':_0x5f4d('0x1'),'E_AGI_SERVER_ERROR':_0x5f4d('0x2'),'E_AGI_SERVER_CLOSE':_0x5f4d('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x5f4d('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x5f4d('0x5'),'E_AGI_SOCKET_CLOSE':_0x5f4d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x5f4d('0x7'),'E_AGI_COMMAND_EMPTY':_0x5f4d('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3a22b4){var _0x3a22b4=_0x3a22b4||null,_0x157e05=_0x157e05||[],_0x531518=0x1,_0x5dbfb9='';if(!error[_0x3a22b4]){_0x3a22b4=_0x5f4d('0x9');}_0x157e05[_0x5f4d('0xa')](error[_0x3a22b4]);while(arguments[_0x531518]){_0x157e05[_0x5f4d('0xa')](arguments[_0x531518]);_0x531518++;}_0x5dbfb9=util[_0x5f4d('0xb')][_0x5f4d('0xc')](util,_0x157e05);this[_0x5f4d('0xd')]=_0x5dbfb9;this['name']=_0x3a22b4;}module[_0x5f4d('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index b1ab67e..766a865 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 _0x13eb=['EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','exports','lodash','events'];(function(_0x3a3464,_0x1322bf){var _0x623436=function(_0x159bed){while(--_0x159bed){_0x3a3464['push'](_0x3a3464['shift']());}};_0x623436(++_0x1322bf);}(_0x13eb,0xca));var _0xb13e=function(_0x5a43b8,_0x2e0eb2){_0x5a43b8=_0x5a43b8-0x0;var _0x26eeef=_0x13eb[_0x5a43b8];return _0x26eeef;};'use strict';var _=require(_0xb13e('0x0'));var EventEmitter=require(_0xb13e('0x1'))[_0xb13e('0x2')];var Redis=require(_0xb13e('0x3'));var AGIError=require(_0xb13e('0x4'));var config=require(_0xb13e('0x5'));config[_0xb13e('0x6')]=_[_0xb13e('0x7')](config[_0xb13e('0x6')],{'host':_0xb13e('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb13e('0x6')]);sub[_0xb13e('0x9')](_0xb13e('0xa'),function(_0xa1f7b6){if(_0xa1f7b6)return eventEmitter[_0xb13e('0xb')](_0xb13e('0xc'),new AGIError(_0xb13e('0xd'),_0xa1f7b6));});sub['on'](_0xb13e('0xe'),function(_0x2266cb,_0x368705){if(_0x2266cb!==_0xb13e('0xa'))return;try{var _0x92c96e=JSON['parse'](_0x368705);eventEmitter['emit'](_0xb13e('0xf'),_0x92c96e);}catch(_0x2d1309){eventEmitter[_0xb13e('0xb')]('error',new AGIError(_0xb13e('0xd'),_0x2d1309));}});module[_0xb13e('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x9675=['subscribe','emit','error','parse','E_AGI_SERVER_ERROR','exports','lodash','events','ioredis','../../config/environment','redis','localhost'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x9675,0x14a));var _0x5967=function(_0x53d138,_0x463ffe){_0x53d138=_0x53d138-0x0;var _0x1ef55f=_0x9675[_0x53d138];return _0x1ef55f;};'use strict';var _=require(_0x5967('0x0'));var EventEmitter=require(_0x5967('0x1'))['EventEmitter'];var Redis=require(_0x5967('0x2'));var AGIError=require('./error');var config=require(_0x5967('0x3'));config[_0x5967('0x4')]=_['defaults'](config[_0x5967('0x4')],{'host':_0x5967('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5967('0x4')]);sub[_0x5967('0x6')]('agi',function(_0x15b550){if(_0x15b550)return eventEmitter[_0x5967('0x7')](_0x5967('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x15b550));});sub['on']('message',function(_0x333ddf,_0x3b4651){if(_0x333ddf!=='agi')return;try{var _0x31e5ca=JSON[_0x5967('0x9')](_0x3b4651);eventEmitter['emit']('projectUpdate',_0x31e5ca);}catch(_0x1d9975){eventEmitter[_0x5967('0x7')](_0x5967('0x8'),new AGIError(_0x5967('0xa'),_0x1d9975));}});module[_0x5967('0xb')]={'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 8b72bba..d69071d 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 _0xe978=['agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','default','target','menu','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger'];(function(_0x15ce17,_0x13068d){var _0x4856e3=function(_0x272de5){while(--_0x272de5){_0x15ce17['push'](_0x15ce17['shift']());}};_0x4856e3(++_0x13068d);}(_0xe978,0x191));var _0x8e97=function(_0x31dbb1,_0x1e0d30){_0x31dbb1=_0x31dbb1-0x0;var _0x130f5d=_0xe978[_0x31dbb1];return _0x130f5d;};'use strict';var _=require(_0x8e97('0x0'));var logger=require(_0x8e97('0x1'))(_0x8e97('0x2'));var verticesWithRetry=['menu',_0x8e97('0x3'),_0x8e97('0x4')];var Graph=function(){this[_0x8e97('0x5')]={};this[_0x8e97('0x6')]={};this[_0x8e97('0x7')]=0x0;};Graph[_0x8e97('0x8')]['addVertex']=function(_0x3cd6a7){this[_0x8e97('0x5')][_0x3cd6a7['id']]=_0x3cd6a7;this[_0x8e97('0x6')][_0x3cd6a7['id']]=[];};Graph[_0x8e97('0x8')][_0x8e97('0x9')]=function(_0x6d0a3a,_0x5ef03b,_0x3f1fc8){this[_0x8e97('0x6')][_0x6d0a3a][_0x8e97('0xa')]({'target':_0x5ef03b,'condition':_0x3f1fc8});this['numberOfEdges']+=0x1;};Graph[_0x8e97('0x8')][_0x8e97('0xb')]=function(){return _[_0x8e97('0xb')](this[_0x8e97('0x5')]);};Graph[_0x8e97('0x8')][_0x8e97('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x8e97('0x8')][_0x8e97('0xd')]=function(_0x31c6f1){return this[_0x8e97('0x5')][_0x31c6f1];};Graph[_0x8e97('0x8')][_0x8e97('0xe')]=function(_0x46c848,_0x516d5a){if(!this[_0x8e97('0x5')][_0x46c848]){return logger[_0x8e97('0xf')]('no\x20vertex\x20found');}var _0x38ea79=_0x516d5a(this[_0x8e97('0x5')][_0x46c848]);if(!_0x38ea79){return logger[_0x8e97('0xf')](_0x8e97('0x10'));}if(this[_0x8e97('0x6')][_0x46c848][_0x8e97('0x11')]===0x0){return logger[_0x8e97('0xf')](_0x8e97('0x12'));}for(var _0x7bc6e2=0x0,_0x56bf7a=[],_0x2ac6bb=![];_0x7bc6e2\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup'];(function(_0x20c159,_0x5e151a){var _0x3b48f7=function(_0x135700){while(--_0x135700){_0x20c159['push'](_0x20c159['shift']());}};_0x3b48f7(++_0x5e151a);}(_0xb8b2,0x1ce));var _0x2b8b=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0xb8b2[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0x2b8b('0x0'));var syncho=require(_0x2b8b('0x1'));var util=require(_0x2b8b('0x2'));var config=require(_0x2b8b('0x3'));var logger=require('../../config/logger')(_0x2b8b('0x4'));var utilLicense=require(_0x2b8b('0x5'));var rpc=require('./rpc');var Project=require(_0x2b8b('0x6'));var AGIEmitter=require('./events')[_0x2b8b('0x7')];var projects=[];config[_0x2b8b('0x4')]=_[_0x2b8b('0x8')](config[_0x2b8b('0x4')],{'ip':_0x2b8b('0x9'),'port':0x11dd});AGIEmitter['on'](_0x2b8b('0xa'),projectUpdateHandler);function connectionHandler(_0x39bb0f){process[_0x2b8b('0xb')](function(){syncho(function(){try{setChannelVariables(_0x39bb0f);agiHandler(_0x39bb0f);}catch(_0xcfd64c){logger[_0x2b8b('0xc')](_0xcfd64c[_0x2b8b('0xd')]);}});});}function projectUpdateHandler(_0x5189fa){try{var _0x285878=_[_0x2b8b('0xe')](projects,['id',_0x5189fa['id']]);if(_0x285878>-0x1){if(_0x5189fa[_0x2b8b('0xf')]===!![]){projects[_0x2b8b('0x10')](_0x285878,0x1);}else{projects[_0x285878]=_0x5189fa;}}else{projects[_0x2b8b('0x11')](_0x5189fa);}}catch(_0x3b44c4){logger[_0x2b8b('0xc')](_0x3b44c4[_0x2b8b('0xd')]);}}function listeningHandler(){console[_0x2b8b('0x12')](_0x2b8b('0x13'),config[_0x2b8b('0x4')]['port']);logger[_0x2b8b('0x14')](util[_0x2b8b('0x15')](_0x2b8b('0x16'),config[_0x2b8b('0x4')]['ip'],config[_0x2b8b('0x4')][_0x2b8b('0x17')]));}function errorHandler(_0x5c36cf){if(_0x5c36cf&&_0x5c36cf[_0x2b8b('0x18')]&&_0x5c36cf[_0x2b8b('0x19')]){logger[_0x2b8b('0xc')](util[_0x2b8b('0x15')]('[%s]\x20%s',_0x5c36cf[_0x2b8b('0x18')],_0x5c36cf[_0x2b8b('0x19')]));}else{logger[_0x2b8b('0xc')](util[_0x2b8b('0x15')]('[ERROR]\x20%s',_0x5c36cf[_0x2b8b('0xd')]));}}function closeHandler(){logger[_0x2b8b('0x14')](util['format'](_0x2b8b('0x1a'),this[_0x2b8b('0x1b')],this[_0x2b8b('0x1c')],this['callerid'],this[_0x2b8b('0x1d')],this[_0x2b8b('0x1e')]));try{createSquareReport(this);}catch(_0x456c45){logger[_0x2b8b('0xc')](_0x456c45[_0x2b8b('0xd')]);}}function timeoutHandler(){logger['info'](util['format'](_0x2b8b('0x1f'),this[_0x2b8b('0x1b')],this['calleridname'],this['callerid'],this[_0x2b8b('0x1d')],this[_0x2b8b('0x1e')]));}function hangupHandler(){logger[_0x2b8b('0x14')](util[_0x2b8b('0x15')](_0x2b8b('0x20'),this[_0x2b8b('0x1b')],this[_0x2b8b('0x1c')],this['callerid'],this[_0x2b8b('0x1d')],this['uniqueid']));this[_0x2b8b('0x21')]=!![];}function createSquareReport(_0x44a6a8,_0x4c456f){rpc[_0x2b8b('0x22')](_0x44a6a8)[_0x2b8b('0x23')](function(_0x3e37be){if(_0x4c456f){_0x4c456f(null,_0x3e37be);}})['catch'](function(_0x1c6f51){if(_0x4c456f){_0x4c456f(null,_0x1c6f51);}});}function setChannelVariables(_0x1b5988){for(var _0x5ecc6f in _0x1b5988){if(_0x1b5988[_0x2b8b('0x24')](_0x5ecc6f)){if(_0x5ecc6f[_0x2b8b('0x25')](_0x2b8b('0x26'))===0x0){_0x1b5988[_0x5ecc6f[_0x2b8b('0x27')](0x4)]=_0x1b5988[_0x5ecc6f];delete _0x1b5988[_0x5ecc6f];}}}}function agiHandler(_0x5ac1af){logger[_0x2b8b('0x28')](_0x2b8b('0x29'),JSON[_0x2b8b('0x2a')](_0x5ac1af,null,0x2));logger[_0x2b8b('0x14')](util[_0x2b8b('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5ac1af[_0x2b8b('0x1b')],_0x5ac1af['calleridname'],_0x5ac1af['callerid'],_0x5ac1af[_0x2b8b('0x1d')],_0x5ac1af[_0x2b8b('0x1e')]));_0x5ac1af['on'](_0x2b8b('0xc'),errorHandler);_0x5ac1af['on'](_0x2b8b('0x2b'),closeHandler);_0x5ac1af['on'](_0x2b8b('0x2c'),timeoutHandler);_0x5ac1af[_0x2b8b('0x21')]=![];_0x5ac1af['on']('hangup',hangupHandler);var _0xa0bb42=_[_0x2b8b('0x2d')](projects,['name',_0x5ac1af[_0x2b8b('0x1b')]]);if(!_0xa0bb42)return Project[_0x2b8b('0x2e')](_0x5ac1af);if(!_0xa0bb42[_0x2b8b('0x2f')])return Project[_0x2b8b('0x30')](_0x5ac1af);return Project[_0x2b8b('0x31')](_0xa0bb42,_0x5ac1af);}function main(){var _0x3afec3;return utilLicense[_0x2b8b('0x32')]()[_0x2b8b('0x23')](function(_0x996898){if(!_0x996898)return;if(_0x996898[_0x2b8b('0x33')]){if(_0x996898[_0x2b8b('0x34')]&&_0x996898[_0x2b8b('0x34')]>0x0){logger['info'](util[_0x2b8b('0x15')](_0x2b8b('0x35'),_0x996898[_0x2b8b('0x34')]));_0x3afec3=_0x996898[_0x2b8b('0x34')];}else{logger[_0x2b8b('0x14')](_0x2b8b('0x36'));}}else{logger[_0x2b8b('0x14')](_0x2b8b('0x37'));_0x3afec3=-0x1;}})['then'](function(){return Project[_0x2b8b('0x38')]();})[_0x2b8b('0x23')](function(_0x298e2e){projects=_0x298e2e;return;})[_0x2b8b('0x39')](function(_0x238555){logger[_0x2b8b('0xc')](_0x2b8b('0x3a'),_0x238555['stack']);})[_0x2b8b('0x3b')](function(){var _0x27c8c9=require('./server')(config[_0x2b8b('0x4')]['port'],config['agi']['ip'],_0x3afec3);_0x27c8c9['on'](_0x2b8b('0xc'),errorHandler);_0x27c8c9['on'](_0x2b8b('0x3c'),listeningHandler);_0x27c8c9['on'](_0x2b8b('0x3d'),connectionHandler);_0x27c8c9['on'](_0x2b8b('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0xfb5c=['connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','stack','findIndex','deleted','push','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','indexOf','agi_','substring','debug','variables','stringify','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','catch','./server','listening'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0xfb5c,0x119));var _0xcfb5=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0xfb5c[_0x284506];return _0x1e9ee5;};'use strict';var _=require('lodash');var syncho=require(_0xcfb5('0x0'));var util=require(_0xcfb5('0x1'));var config=require(_0xcfb5('0x2'));var logger=require(_0xcfb5('0x3'))(_0xcfb5('0x4'));var utilLicense=require(_0xcfb5('0x5'));var rpc=require(_0xcfb5('0x6'));var Project=require(_0xcfb5('0x7'));var AGIEmitter=require(_0xcfb5('0x8'))[_0xcfb5('0x9')];var projects=[];config[_0xcfb5('0x4')]=_[_0xcfb5('0xa')](config[_0xcfb5('0x4')],{'ip':_0xcfb5('0xb'),'port':0x11dd});AGIEmitter['on'](_0xcfb5('0xc'),projectUpdateHandler);function connectionHandler(_0x2d5803){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2d5803);agiHandler(_0x2d5803);}catch(_0x26e7c3){logger['error'](_0x26e7c3[_0xcfb5('0xd')]);}});});}function projectUpdateHandler(_0x56ebcf){try{var _0x244d0c=_[_0xcfb5('0xe')](projects,['id',_0x56ebcf['id']]);if(_0x244d0c>-0x1){if(_0x56ebcf[_0xcfb5('0xf')]===!![]){projects['splice'](_0x244d0c,0x1);}else{projects[_0x244d0c]=_0x56ebcf;}}else{projects[_0xcfb5('0x10')](_0x56ebcf);}}catch(_0x2e03f8){logger[_0xcfb5('0x11')](_0x2e03f8['stack']);}}function listeningHandler(){console[_0xcfb5('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcfb5('0x4')][_0xcfb5('0x13')]);logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')](_0xcfb5('0x16'),config['agi']['ip'],config[_0xcfb5('0x4')][_0xcfb5('0x13')]));}function errorHandler(_0x54001d){if(_0x54001d&&_0x54001d[_0xcfb5('0x17')]&&_0x54001d[_0xcfb5('0x18')]){logger[_0xcfb5('0x11')](util['format'](_0xcfb5('0x19'),_0x54001d['name'],_0x54001d['message']));}else{logger['error'](util[_0xcfb5('0x15')](_0xcfb5('0x1a'),_0x54001d['stack']));}}function closeHandler(){logger['info'](util[_0xcfb5('0x15')](_0xcfb5('0x1b'),this[_0xcfb5('0x1c')],this[_0xcfb5('0x1d')],this[_0xcfb5('0x1e')],this['dnid'],this[_0xcfb5('0x1f')]));try{createSquareReport(this);}catch(_0x8bacdb){logger[_0xcfb5('0x11')](_0x8bacdb[_0xcfb5('0xd')]);}}function timeoutHandler(){logger[_0xcfb5('0x14')](util['format'](_0xcfb5('0x20'),this[_0xcfb5('0x1c')],this[_0xcfb5('0x1d')],this[_0xcfb5('0x1e')],this[_0xcfb5('0x21')],this[_0xcfb5('0x1f')]));}function hangupHandler(){logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')](_0xcfb5('0x22'),this[_0xcfb5('0x1c')],this['calleridname'],this['callerid'],this[_0xcfb5('0x21')],this[_0xcfb5('0x1f')]));this[_0xcfb5('0x23')]=!![];}function createSquareReport(_0x3d40db,_0x2dc980){rpc[_0xcfb5('0x24')](_0x3d40db)[_0xcfb5('0x25')](function(_0x425565){if(_0x2dc980){_0x2dc980(null,_0x425565);}})['catch'](function(_0x11af44){if(_0x2dc980){_0x2dc980(null,_0x11af44);}});}function setChannelVariables(_0x42d926){for(var _0xb116bc in _0x42d926){if(_0x42d926['hasOwnProperty'](_0xb116bc)){if(_0xb116bc[_0xcfb5('0x26')](_0xcfb5('0x27'))===0x0){_0x42d926[_0xb116bc[_0xcfb5('0x28')](0x4)]=_0x42d926[_0xb116bc];delete _0x42d926[_0xb116bc];}}}}function agiHandler(_0x13bd2f){logger[_0xcfb5('0x29')](_0xcfb5('0x2a'),JSON[_0xcfb5('0x2b')](_0x13bd2f,null,0x2));logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x13bd2f[_0xcfb5('0x1c')],_0x13bd2f['calleridname'],_0x13bd2f[_0xcfb5('0x1e')],_0x13bd2f[_0xcfb5('0x21')],_0x13bd2f[_0xcfb5('0x1f')]));_0x13bd2f['on'](_0xcfb5('0x11'),errorHandler);_0x13bd2f['on']('close',closeHandler);_0x13bd2f['on']('timeout',timeoutHandler);_0x13bd2f[_0xcfb5('0x23')]=![];_0x13bd2f['on']('hangup',hangupHandler);var _0x2b4607=_[_0xcfb5('0x2c')](projects,[_0xcfb5('0x17'),_0x13bd2f[_0xcfb5('0x1c')]]);if(!_0x2b4607)return Project[_0xcfb5('0x2d')](_0x13bd2f);if(!_0x2b4607[_0xcfb5('0x2e')])return Project[_0xcfb5('0x2f')](_0x13bd2f);return Project[_0xcfb5('0x30')](_0x2b4607,_0x13bd2f);}function main(){var _0x46f2e9;return utilLicense[_0xcfb5('0x31')]()['then'](function(_0x103692){if(!_0x103692)return;if(_0x103692[_0xcfb5('0x32')]){if(_0x103692['callysquare']&&_0x103692['callysquare']>0x0){logger[_0xcfb5('0x14')](util[_0xcfb5('0x15')]('[LICENSE]\x20CHANNELS:\x20%s',_0x103692[_0xcfb5('0x33')]));_0x46f2e9=_0x103692[_0xcfb5('0x33')];}else{logger[_0xcfb5('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xcfb5('0x14')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x46f2e9=-0x1;}})['then'](function(){return Project['getAll']();})[_0xcfb5('0x25')](function(_0x4bfeab){projects=_0x4bfeab;return;})[_0xcfb5('0x34')](function(_0x5b5f32){logger[_0xcfb5('0x11')]('[LICENSE]',_0x5b5f32[_0xcfb5('0xd')]);})['finally'](function(){var _0x589481=require(_0xcfb5('0x35'))(config[_0xcfb5('0x4')][_0xcfb5('0x13')],config[_0xcfb5('0x4')]['ip'],_0x46f2e9);_0x589481['on'](_0xcfb5('0x11'),errorHandler);_0x589481['on'](_0xcfb5('0x36'),listeningHandler);_0x589481['on'](_0xcfb5('0x37'),connectionHandler);_0x589481['on']('close',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 19d9f21..b733c22 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 _0xb7f7=['bluebird','jayson/promise','client','request','error','message','catch','sendMailMessage','SendMail'];(function(_0x58d9e0,_0x257e09){var _0x19f921=function(_0x52650f){while(--_0x52650f){_0x58d9e0['push'](_0x58d9e0['shift']());}};_0x19f921(++_0x257e09);}(_0xb7f7,0x1e6));var _0x7b7f=function(_0x1c0146,_0x3af081){_0x1c0146=_0x1c0146-0x0;var _0x4f680f=_0xb7f7[_0x1c0146];return _0x4f680f;};'use strict';var BPromise=require(_0x7b7f('0x0'));var jayson=require(_0x7b7f('0x1'));var client=jayson[_0x7b7f('0x2')]['http']({'port':0x232b});function request(_0x19b05a,_0x3760cf){return new BPromise(function(_0x3d2b8d,_0x50e5a7){return client[_0x7b7f('0x3')](_0x19b05a,_0x3760cf)['then'](function(_0x18e9a9){if(_0x18e9a9[_0x7b7f('0x4')]){return _0x50e5a7(_0x18e9a9[_0x7b7f('0x4')][_0x7b7f('0x5')]);}else{return _0x3d2b8d(_0x18e9a9['result']);}})[_0x7b7f('0x6')](function(_0x45e16d){return _0x50e5a7(_0x45e16d);});});}exports[_0x7b7f('0x7')]=function(_0x25a8cf,_0x228726){return request(_0x7b7f('0x8'),{'account':_0x25a8cf,'message':_0x228726});}; \ No newline at end of file +var _0x3a9a=['result','catch','SendMail','bluebird','jayson/promise','client','request','then','error','message'];(function(_0x1ac4af,_0x456013){var _0x53ee46=function(_0x5c2298){while(--_0x5c2298){_0x1ac4af['push'](_0x1ac4af['shift']());}};_0x53ee46(++_0x456013);}(_0x3a9a,0x139));var _0xa3a9=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x3a9a[_0x215e65];return _0xa85842;};'use strict';var BPromise=require(_0xa3a9('0x0'));var jayson=require(_0xa3a9('0x1'));var client=jayson[_0xa3a9('0x2')]['http']({'port':0x232b});function request(_0x55d21a,_0x2b0a1b){return new BPromise(function(_0x125632,_0x1dedaf){return client[_0xa3a9('0x3')](_0x55d21a,_0x2b0a1b)[_0xa3a9('0x4')](function(_0x3a4d40){if(_0x3a4d40[_0xa3a9('0x5')]){return _0x1dedaf(_0x3a4d40['error'][_0xa3a9('0x6')]);}else{return _0x125632(_0x3a4d40[_0xa3a9('0x7')]);}})[_0xa3a9('0x8')](function(_0x3ebcad){return _0x1dedaf(_0x3ebcad);});});}exports['sendMailMessage']=function(_0x3a3dd5,_0x393ea2){return request(_0xa3a9('0x9'),{'account':_0x3a3dd5,'message':_0x393ea2});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 44bbeb1..81fc638 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 _0xa76a=['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','calleridname','traverseBFS','isUndefined','[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','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','close','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','value','mxGraphModel','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','callerid','dnid','uniqueid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','toString'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xa76a,0x88));var _0xaa76=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xa76a[_0xfcbcb8];return _0x1b1f97;};'use strict';var _=require(_0xaa76('0x0'));var moment=require(_0xaa76('0x1'));var parser=require(_0xaa76('0x2'));var util=require('util');var logger=require(_0xaa76('0x3'))(_0xaa76('0x4'));var rpc=require(_0xaa76('0x5'));var mailRpc=require(_0xaa76('0x6'));var Graph=require(_0xaa76('0x7'));var Vertices=require(_0xaa76('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xaa76('0x9')]()['catch'](function(_0x415ea1){logger['error'](_0xaa76('0xa'),_0x415ea1[_0xaa76('0xb')]);return[];});}function addVertex(_0x1d559e,_0x28e679,_0x128fb9){_0x28e679[_0xaa76('0xc')]=_0x128fb9;if(_0x28e679['hasOwnProperty'](_0xaa76('0xd'))){_0x28e679[_0xaa76('0xe')]=parseInt(_0x28e679['retry'],0xa);}_0x1d559e[_0xaa76('0xf')](_[_0xaa76('0x10')](_0x28e679,_0xaa76('0x11')));}function initGraph(_0x267c87,_0x3e4d5f){var _0x54d78b=new Graph();for(var _0x8745b9 in _0x267c87){if(_0x267c87['hasOwnProperty'](_0x8745b9)){if(_['isArray'](_0x267c87[_0x8745b9])){for(var _0x2ccfe2=0x0;_0x2ccfe2<_0x267c87[_0x8745b9][_0xaa76('0x12')];_0x2ccfe2+=0x1){addVertex(_0x54d78b,_0x267c87[_0x8745b9][_0x2ccfe2],_0x8745b9);}}else{addVertex(_0x54d78b,_0x267c87[_0x8745b9],_0x8745b9);}}}for(var _0x22dbf9=0x0;_0x22dbf9<_0x3e4d5f[_0xaa76('0x12')];_0x22dbf9+=0x1){if(_0x3e4d5f[_0x22dbf9][_0xaa76('0x13')]&&_0x3e4d5f[_0x22dbf9][_0xaa76('0x14')]){_0x54d78b[_0xaa76('0x15')](_0x3e4d5f[_0x22dbf9][_0xaa76('0x13')],_0x3e4d5f[_0x22dbf9][_0xaa76('0x14')],_0x3e4d5f[_0x22dbf9][_0xaa76('0x16')]);}}return _0x54d78b;}function getRoot(_0x13be12){return parser['toJson'](_0x13be12,{'object':!![]})[_0xaa76('0x17')]['root'];}function inspect(_0x469319){return util['inspect'](_0x469319,{'showHidden':![],'depth':null});}function initialize(_0x554da8,_0x538736){var _0x533102=getRoot(_0x554da8['production']);if(!_0x533102||!_0x533102[_0xaa76('0x18')])return;var _0xac6a3,_0x53fc2a,_0x4410c4;logger[_0xaa76('0x19')]('root',JSON[_0xaa76('0x1a')](_0x533102,null,0x2));_0x538736[_0xaa76('0x1b')]=moment()[_0xaa76('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0xac6a3=initGraph(_[_0xaa76('0x10')](_0x533102,'mxCell'),_0x533102[_0xaa76('0x11')]);_0x53fc2a=new Vertices(_0x538736,rpc,mailRpc);logger[_0xaa76('0x1d')](util[_0xaa76('0x1c')](_0xaa76('0x1e'),_0x538736[_0xaa76('0x1f')],_0x538736['calleridname'],_0x538736[_0xaa76('0x20')],_0x538736[_0xaa76('0x21')],_0x538736[_0xaa76('0x22')]));_0xac6a3['traverseBFS'](_0x533102[_0xaa76('0x18')]['id'],function(_0x4848f6){try{_0x4848f6=_0x53fc2a[_0xaa76('0x23')](_0x4848f6);logger[_0xaa76('0x19')](_0xaa76('0x24'),JSON[_0xaa76('0x1a')](_0x4848f6,null,0x2));if(_0x4848f6[_0xaa76('0xc')]===_0xaa76('0x25')){logger[_0xaa76('0x1d')](_0xaa76('0x26'));_0x538736[_0xaa76('0x27')]=_0x4848f6[_0xaa76('0x27')]||_0x538736['context'];_0x538736[_0xaa76('0x28')]=_0x4848f6['extension'];_0x538736['priority']=_0x4848f6[_0xaa76('0x29')]?_0x4848f6[_0xaa76('0x29')]-0x1:0x1;return null;}else if(_0x4848f6&&_0x53fc2a[_0x4848f6[_0xaa76('0xc')]]){_0x4410c4=_0x53fc2a[_0x4848f6[_0xaa76('0xc')]](_0x4848f6);logger[_0xaa76('0x1d')]('response',JSON[_0xaa76('0x1a')](_0x4410c4,null,0x2));if(_0x4410c4&&_0x4410c4[_0xaa76('0x2a')]===AGI_CODE_SUCCESS&&_0x4410c4[_0xaa76('0x2b')]!==AGI_RESULT_ERROR&&!_0x538736[_0xaa76('0x2c')]){logger[_0xaa76('0x19')](_0xaa76('0x2d'),inspect(_0x4410c4));return _['isUndefined'](_0x4410c4[_0xaa76('0x2b')])?null:_0x4410c4[_0xaa76('0x2b')][_0xaa76('0x2e')]();}else{logger[_0xaa76('0x2f')]('response',inspect(_0x4410c4));return null;}}else{logger[_0xaa76('0x2f')](_0xaa76('0x30'));return null;}}catch(_0x2e618e){logger[_0xaa76('0x2f')](_0x2e618e[_0xaa76('0xb')]);return null;}});if(_0x533102[_0xaa76('0x31')]){logger[_0xaa76('0x1d')](util[_0xaa76('0x1c')](_0xaa76('0x32'),_0x538736[_0xaa76('0x1f')],_0x538736[_0xaa76('0x33')],_0x538736[_0xaa76('0x20')],_0x538736[_0xaa76('0x21')],_0x538736[_0xaa76('0x22')]));_0xac6a3[_0xaa76('0x34')](_0x533102[_0xaa76('0x31')]['id'],function(_0xb5ddcc){try{_0xb5ddcc=_0x53fc2a[_0xaa76('0x23')](_0xb5ddcc);logger[_0xaa76('0x19')](_0xaa76('0x24'),JSON[_0xaa76('0x1a')](_0xb5ddcc,null,0x2));if(_0xb5ddcc&&_0x53fc2a[_0xb5ddcc['agicommand']]){_0x4410c4=_0x53fc2a[_0xb5ddcc[_0xaa76('0xc')]](_0xb5ddcc);if(_0x4410c4){logger[_0xaa76('0x19')]('response',inspect(_0x4410c4));return _[_0xaa76('0x35')](_0x4410c4[_0xaa76('0x2b')])?null:_0x4410c4[_0xaa76('0x2b')][_0xaa76('0x2e')]();}else{logger[_0xaa76('0x2f')](_0xaa76('0x2d'),inspect(_0x4410c4));return null;}}else{logger[_0xaa76('0x2f')](_0xaa76('0x30'));return null;}}catch(_0x445912){logger[_0xaa76('0x2f')](_0x445912['stack']);return null;}});}logger[_0xaa76('0x1d')](util['format'](_0xaa76('0x36'),_0x538736[_0xaa76('0x1f')],_0x538736[_0xaa76('0x33')],_0x538736[_0xaa76('0x20')],_0x538736['dnid'],_0x538736[_0xaa76('0x22')]));logger[_0xaa76('0x1d')](util[_0xaa76('0x1c')](_0xaa76('0x37'),_0x538736[_0xaa76('0x27')],_0x538736[_0xaa76('0x28')],parseInt(_0x538736[_0xaa76('0x29')],0xa)+0x1));_0x538736[_0xaa76('0x38')](_0x538736[_0xaa76('0x27')],_0x538736[_0xaa76('0x28')],parseInt(_0x538736[_0xaa76('0x29')],0xa)+0x1);_0x538736['close']();}function handleNotFound(_0x583535){logger[_0xaa76('0x2f')](util[_0xaa76('0x1c')](_0xaa76('0x39'),_0x583535[_0xaa76('0x1f')]));_0x583535[_0xaa76('0x38')](_0x583535[_0xaa76('0x27')],_0x583535[_0xaa76('0x28')],parseInt(_0x583535[_0xaa76('0x29')],0xa)+0x1);_0x583535['close']();}function handleUnpublished(_0x5269e4){logger[_0xaa76('0x2f')](util[_0xaa76('0x1c')](_0xaa76('0x3a'),_0x5269e4[_0xaa76('0x1f')]));_0x5269e4[_0xaa76('0x38')](_0x5269e4[_0xaa76('0x27')],_0x5269e4[_0xaa76('0x28')],parseInt(_0x5269e4['priority'],0xa)+0x1);_0x5269e4[_0xaa76('0x3b')]();}module[_0xaa76('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xde11=['code','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','finally','callerid','dnid','traverseBFS','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','Project\x20%s\x20not\x20found','continueAt','exports','lodash','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand'];(function(_0xbdf6b4,_0x251d4e){var _0x1ba78d=function(_0x24e9f6){while(--_0x24e9f6){_0xbdf6b4['push'](_0xbdf6b4['shift']());}};_0x1ba78d(++_0x251d4e);}(_0xde11,0x1c3));var _0x1de1=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xde11[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0x1de1('0x0'));var moment=require('moment');var parser=require(_0x1de1('0x1'));var util=require(_0x1de1('0x2'));var logger=require(_0x1de1('0x3'))(_0x1de1('0x4'));var rpc=require(_0x1de1('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x1de1('0x6'));var Vertices=require(_0x1de1('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1de1('0x8')]()[_0x1de1('0x9')](function(_0x497a62){logger[_0x1de1('0xa')](_0x1de1('0xb'),_0x497a62[_0x1de1('0xc')]);return[];});}function addVertex(_0x48b4da,_0xc533de,_0x1a2caf){_0xc533de['agicommand']=_0x1a2caf;if(_0xc533de['hasOwnProperty'](_0x1de1('0xd'))){_0xc533de[_0x1de1('0xe')]=parseInt(_0xc533de['retry'],0xa);}_0x48b4da[_0x1de1('0xf')](_[_0x1de1('0x10')](_0xc533de,_0x1de1('0x11')));}function initGraph(_0x33629c,_0x484abf){var _0x202176=new Graph();for(var _0x3f723d in _0x33629c){if(_0x33629c[_0x1de1('0x12')](_0x3f723d)){if(_[_0x1de1('0x13')](_0x33629c[_0x3f723d])){for(var _0xd6f6cc=0x0;_0xd6f6cc<_0x33629c[_0x3f723d][_0x1de1('0x14')];_0xd6f6cc+=0x1){addVertex(_0x202176,_0x33629c[_0x3f723d][_0xd6f6cc],_0x3f723d);}}else{addVertex(_0x202176,_0x33629c[_0x3f723d],_0x3f723d);}}}for(var _0x185aed=0x0;_0x185aed<_0x484abf['length'];_0x185aed+=0x1){if(_0x484abf[_0x185aed][_0x1de1('0x15')]&&_0x484abf[_0x185aed][_0x1de1('0x16')]){_0x202176['addEdge'](_0x484abf[_0x185aed]['source'],_0x484abf[_0x185aed][_0x1de1('0x16')],_0x484abf[_0x185aed]['value']);}}return _0x202176;}function getRoot(_0x270e20){return parser[_0x1de1('0x17')](_0x270e20,{'object':!![]})[_0x1de1('0x18')][_0x1de1('0x19')];}function inspect(_0x70c1b){return util['inspect'](_0x70c1b,{'showHidden':![],'depth':null});}function initialize(_0x102761,_0x7bb4f3){var _0x919648=getRoot(_0x102761[_0x1de1('0x1a')]);if(!_0x919648||!_0x919648[_0x1de1('0x1b')])return;var _0x534ef4,_0xc184cf,_0x21e2f4;logger[_0x1de1('0x1c')]('root',JSON[_0x1de1('0x1d')](_0x919648,null,0x2));_0x7bb4f3[_0x1de1('0x1e')]=moment()[_0x1de1('0x1f')](_0x1de1('0x20'));_0x534ef4=initGraph(_[_0x1de1('0x10')](_0x919648,_0x1de1('0x11')),_0x919648[_0x1de1('0x11')]);_0xc184cf=new Vertices(_0x7bb4f3,rpc,mailRpc);logger[_0x1de1('0x21')](util['format'](_0x1de1('0x22'),_0x7bb4f3['arg_1'],_0x7bb4f3[_0x1de1('0x23')],_0x7bb4f3['callerid'],_0x7bb4f3['dnid'],_0x7bb4f3[_0x1de1('0x24')]));_0x534ef4['traverseBFS'](_0x919648[_0x1de1('0x1b')]['id'],function(_0x406451){try{_0x406451=_0xc184cf[_0x1de1('0x25')](_0x406451);logger[_0x1de1('0x1c')](_0x1de1('0x26'),JSON[_0x1de1('0x1d')](_0x406451,null,0x2));if(_0x406451['agicommand']===_0x1de1('0x27')){logger[_0x1de1('0x21')](_0x1de1('0x28'));_0x7bb4f3[_0x1de1('0x29')]=_0x406451[_0x1de1('0x29')]||_0x7bb4f3[_0x1de1('0x29')];_0x7bb4f3[_0x1de1('0x2a')]=_0x406451[_0x1de1('0x2a')];_0x7bb4f3[_0x1de1('0x2b')]=_0x406451['priority']?_0x406451[_0x1de1('0x2b')]-0x1:0x1;return null;}else if(_0x406451&&_0xc184cf[_0x406451[_0x1de1('0x2c')]]){_0x21e2f4=_0xc184cf[_0x406451[_0x1de1('0x2c')]](_0x406451);logger[_0x1de1('0x21')]('response',JSON[_0x1de1('0x1d')](_0x21e2f4,null,0x2));if(_0x21e2f4&&_0x21e2f4[_0x1de1('0x2d')]===AGI_CODE_SUCCESS&&_0x21e2f4[_0x1de1('0x2e')]!==AGI_RESULT_ERROR&&!_0x7bb4f3[_0x1de1('0x2f')]){logger['debug'](_0x1de1('0x30'),inspect(_0x21e2f4));return _[_0x1de1('0x31')](_0x21e2f4[_0x1de1('0x2e')])?null:_0x21e2f4['result'][_0x1de1('0x32')]();}else{logger[_0x1de1('0xa')](_0x1de1('0x30'),inspect(_0x21e2f4));return null;}}else{logger[_0x1de1('0xa')](_0x1de1('0x33'));return null;}}catch(_0x42d25f){logger[_0x1de1('0xa')](_0x42d25f[_0x1de1('0xc')]);return null;}});if(_0x919648[_0x1de1('0x34')]){logger[_0x1de1('0x21')](util[_0x1de1('0x1f')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x7bb4f3['arg_1'],_0x7bb4f3[_0x1de1('0x23')],_0x7bb4f3[_0x1de1('0x35')],_0x7bb4f3[_0x1de1('0x36')],_0x7bb4f3['uniqueid']));_0x534ef4[_0x1de1('0x37')](_0x919648[_0x1de1('0x34')]['id'],function(_0x46e4a5){try{_0x46e4a5=_0xc184cf[_0x1de1('0x25')](_0x46e4a5);logger[_0x1de1('0x1c')](_0x1de1('0x26'),JSON[_0x1de1('0x1d')](_0x46e4a5,null,0x2));if(_0x46e4a5&&_0xc184cf[_0x46e4a5[_0x1de1('0x2c')]]){_0x21e2f4=_0xc184cf[_0x46e4a5[_0x1de1('0x2c')]](_0x46e4a5);if(_0x21e2f4){logger[_0x1de1('0x1c')](_0x1de1('0x30'),inspect(_0x21e2f4));return _['isUndefined'](_0x21e2f4[_0x1de1('0x2e')])?null:_0x21e2f4['result']['toString']();}else{logger['error'](_0x1de1('0x30'),inspect(_0x21e2f4));return null;}}else{logger[_0x1de1('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x33142e){logger[_0x1de1('0xa')](_0x33142e[_0x1de1('0xc')]);return null;}});}logger['info'](util[_0x1de1('0x1f')](_0x1de1('0x38'),_0x7bb4f3[_0x1de1('0x39')],_0x7bb4f3[_0x1de1('0x23')],_0x7bb4f3['callerid'],_0x7bb4f3[_0x1de1('0x36')],_0x7bb4f3['uniqueid']));logger['info'](util[_0x1de1('0x1f')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x7bb4f3[_0x1de1('0x29')],_0x7bb4f3[_0x1de1('0x2a')],parseInt(_0x7bb4f3[_0x1de1('0x2b')],0xa)+0x1));_0x7bb4f3['continueAt'](_0x7bb4f3[_0x1de1('0x29')],_0x7bb4f3['extension'],parseInt(_0x7bb4f3[_0x1de1('0x2b')],0xa)+0x1);_0x7bb4f3[_0x1de1('0x3a')]();}function handleNotFound(_0x5d97d2){logger[_0x1de1('0xa')](util[_0x1de1('0x1f')](_0x1de1('0x3b'),_0x5d97d2['arg_1']));_0x5d97d2[_0x1de1('0x3c')](_0x5d97d2[_0x1de1('0x29')],_0x5d97d2[_0x1de1('0x2a')],parseInt(_0x5d97d2[_0x1de1('0x2b')],0xa)+0x1);_0x5d97d2[_0x1de1('0x3a')]();}function handleUnpublished(_0x22136e){logger[_0x1de1('0xa')](util[_0x1de1('0x1f')]('Project\x20%s\x20not\x20published',_0x22136e['arg_1']));_0x22136e[_0x1de1('0x3c')](_0x22136e[_0x1de1('0x29')],_0x22136e['extension'],parseInt(_0x22136e[_0x1de1('0x2b')],0xa)+0x1);_0x22136e[_0x1de1('0x3a')]();}module[_0x1de1('0x3d')]={'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 10ecdf0..3ad71b7 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 _0xcae6=['length','split','slice','trim','emit','exports','util','stream','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','_inBody','indexOf','substring'];(function(_0x131712,_0x2ed068){var _0x292b97=function(_0x106fbd){while(--_0x106fbd){_0x131712['push'](_0x131712['shift']());}};_0x292b97(++_0x2ed068);}(_0xcae6,0x146));var _0x6cae=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xcae6[_0x5e8d3e];return _0x1348c0;};'use strict';var util=require(_0x6cae('0x0'));var Transform=require(_0x6cae('0x1'))['Transform'];function AGIReply(_0x604625){Transform['call'](this,_0x604625);this['_localBuffer']='';this['_inBody']=![];}util[_0x6cae('0x2')](AGIReply,Transform);AGIReply[_0x6cae('0x3')][_0x6cae('0x4')]=function(_0x3ce41d,_0xe2f09f,_0x2b6cf3){var _0x2d8114='\x0a',_0x1ecda1=['\x0a\x0a',_0x6cae('0x5')],_0x1c0025=-0x1,_0x117b0d=-0x1,_0x467032='',_0x3c4f6b=0x0,_0x4a93be='',_0xffcfee='';this[_0x6cae('0x6')]+=_0x3ce41d['toString']();_0x4a93be=this[_0x6cae('0x6')];if(!this[_0x6cae('0x7')]){_0x3c4f6b=0x0;while(_0x1ecda1[_0x3c4f6b]){while((_0x117b0d=_0x4a93be[_0x6cae('0x8')](_0x1ecda1[_0x3c4f6b]))!=-0x1){_0x467032=_0x1ecda1[_0x3c4f6b];_0xffcfee=_0x4a93be[_0x6cae('0x9')](0x0,_0x117b0d);_0x4a93be=_0x4a93be[_0x6cae('0x9')](_0x117b0d+_0x467032[_0x6cae('0xa')]);var _0x9e6cf2=_0xffcfee[_0x6cae('0xb')](_0x2d8114),_0x21143c=0x0,_0xbd19f={},_0x572304='',_0x34e94c='',_0x16b2e0=-0x1;while(_0x9e6cf2[_0x21143c]){_0x16b2e0=_0x9e6cf2[_0x21143c][_0x6cae('0x8')](':');if(_0x16b2e0!=-0x1){_0x572304=_0x9e6cf2[_0x21143c][_0x6cae('0xc')](0x0,_0x16b2e0)[_0x6cae('0xd')]();_0x34e94c=_0x9e6cf2[_0x21143c][_0x6cae('0xc')](_0x16b2e0+0x1)[_0x6cae('0xd')]();if(_0x572304['length']>0x0){_0xbd19f[_0x572304]=_0x34e94c;}}else{}_0x21143c++;}this[_0x6cae('0xe')]('headers',_0xbd19f);this[_0x6cae('0x7')]=!![];}_0x3c4f6b++;}this[_0x6cae('0x6')]=_0x4a93be;}else{while((_0x1c0025=_0x4a93be[_0x6cae('0x8')](_0x2d8114))!=-0x1){_0xffcfee=_0x4a93be[_0x6cae('0x9')](0x0,_0x1c0025);this['emit']('line',_0xffcfee);_0x4a93be=_0x4a93be[_0x6cae('0x9')](_0x1c0025+_0x2d8114['length']);}this[_0x6cae('0x6')]=_0x4a93be;}_0x2b6cf3();};module[_0x6cae('0xf')]=AGIReply; \ No newline at end of file +var _0xc859=['trim','emit','headers','line','exports','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice'];(function(_0x1a3452,_0x30067c){var _0x2e4de5=function(_0x44411e){while(--_0x44411e){_0x1a3452['push'](_0x1a3452['shift']());}};_0x2e4de5(++_0x30067c);}(_0xc859,0x17b));var _0x9c85=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xc859[_0x54d4a8];return _0x3b321b;};'use strict';var util=require('util');var Transform=require(_0x9c85('0x0'))[_0x9c85('0x1')];function AGIReply(_0x128e24){Transform[_0x9c85('0x2')](this,_0x128e24);this[_0x9c85('0x3')]='';this[_0x9c85('0x4')]=![];}util[_0x9c85('0x5')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1947eb,_0x290ab6,_0x355518){var _0x35c7af='\x0a',_0x1925a4=['\x0a\x0a',_0x9c85('0x6')],_0x93b04c=-0x1,_0x904224=-0x1,_0x2a7105='',_0x11112b=0x0,_0x5f06f1='',_0x25866='';this[_0x9c85('0x3')]+=_0x1947eb[_0x9c85('0x7')]();_0x5f06f1=this[_0x9c85('0x3')];if(!this[_0x9c85('0x4')]){_0x11112b=0x0;while(_0x1925a4[_0x11112b]){while((_0x904224=_0x5f06f1['indexOf'](_0x1925a4[_0x11112b]))!=-0x1){_0x2a7105=_0x1925a4[_0x11112b];_0x25866=_0x5f06f1[_0x9c85('0x8')](0x0,_0x904224);_0x5f06f1=_0x5f06f1[_0x9c85('0x8')](_0x904224+_0x2a7105[_0x9c85('0x9')]);var _0x5812c9=_0x25866[_0x9c85('0xa')](_0x35c7af),_0x2ee836=0x0,_0x24fc1d={},_0xd286a='',_0x5a566f='',_0x16ec01=-0x1;while(_0x5812c9[_0x2ee836]){_0x16ec01=_0x5812c9[_0x2ee836]['indexOf'](':');if(_0x16ec01!=-0x1){_0xd286a=_0x5812c9[_0x2ee836][_0x9c85('0xb')](0x0,_0x16ec01)[_0x9c85('0xc')]();_0x5a566f=_0x5812c9[_0x2ee836][_0x9c85('0xb')](_0x16ec01+0x1)[_0x9c85('0xc')]();if(_0xd286a['length']>0x0){_0x24fc1d[_0xd286a]=_0x5a566f;}}else{}_0x2ee836++;}this[_0x9c85('0xd')](_0x9c85('0xe'),_0x24fc1d);this[_0x9c85('0x4')]=!![];}_0x11112b++;}this[_0x9c85('0x3')]=_0x5f06f1;}else{while((_0x93b04c=_0x5f06f1['indexOf'](_0x35c7af))!=-0x1){_0x25866=_0x5f06f1['substring'](0x0,_0x93b04c);this[_0x9c85('0xd')](_0x9c85('0xf'),_0x25866);_0x5f06f1=_0x5f06f1['substring'](_0x93b04c+_0x35c7af[_0x9c85('0x9')]);}this[_0x9c85('0x3')]=_0x5f06f1;}_0x355518();};module[_0x9c85('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 0dea223..bd2b1fb 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 _0x121d=['then','error','result','GetSquareProjects','name','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','phone','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request'];(function(_0x2e69fb,_0x4359e3){var _0x4d2404=function(_0x5667b5){while(--_0x5667b5){_0x2e69fb['push'](_0x2e69fb['shift']());}};_0x4d2404(++_0x4359e3);}(_0x121d,0xea));var _0xd121=function(_0x867e98,_0x2e6e6e){_0x867e98=_0x867e98-0x0;var _0x38c872=_0x121d[_0x867e98];return _0x38c872;};'use strict';var _=require(_0xd121('0x0'));var moment=require(_0xd121('0x1'));var jayson=require(_0xd121('0x2'));var client=jayson[_0xd121('0x3')][_0xd121('0x4')]({'port':0x2329});function request(_0x40e506,_0x233726){return new Promise(function(_0xff33a,_0x20a687){return client[_0xd121('0x5')](_0x40e506,_0x233726)[_0xd121('0x6')](function(_0x1b3be2){if(_0x1b3be2[_0xd121('0x7')]){return _0x20a687(_0x1b3be2[_0xd121('0x7')]['message']);}else{return _0xff33a(_0x1b3be2[_0xd121('0x8')]);}})['catch'](function(_0x1da01c){return _0x20a687(_0x1da01c);});});}exports['getSquareProjects']=function(){return request(_0xd121('0x9'),{'options':{'raw':![],'attributes':['id',_0xd121('0xa'),'production']}});};exports['getSquareProject']=function(_0x4ecadc){return request(_0xd121('0xb'),{'options':{'raw':![],'where':{'name':_0x4ecadc},'attributes':[_0xd121('0xc')]}});};exports[_0xd121('0xd')]=function(_0x3c74e8){return request(_0xd121('0xe'),{'options':{'raw':![],'where':{'id':_0x3c74e8},'include':[{'model':_0xd121('0xf'),'as':_0xd121('0x10'),'include':[{'model':'CloudProvider','as':_0xd121('0x11')}]}],'attributes':['id',_0xd121('0xa'),'email'],'smtp':!![]}});};exports[_0xd121('0x12')]=function(_0xffeaf5){return request(_0xd121('0xb'),{'options':{'where':{'id':_0xffeaf5},'attributes':[_0xd121('0xa')]}});};exports['getVoiceQueueById']=function(_0x3fcbe6){return request(_0xd121('0x13'),{'options':{'where':{'id':_0x3fcbe6},'attributes':[_0xd121('0xa')]}});};exports['getVariableById']=function(_0x1e69df){return request(_0xd121('0x14'),{'options':{'where':{'id':_0x1e69df},'attributes':['name']}});};exports[_0xd121('0x15')]=function(_0x5e68e1){return request(_0xd121('0x16'),{'options':{'where':{'id':_0x5e68e1},'attributes':[_0xd121('0x17')]}});};exports[_0xd121('0x18')]=function(_0x352806){return request('ShowUser',{'options':{'where':{'id':_0x352806},'attributes':['name']}});};exports[_0xd121('0x19')]=function(_0x31e637){return request('GetContactByPhone',{'options':{'where':{'phone':_0x31e637[_0xd121('0x1a')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4dcad8){return request('ShowTrunk',{'options':{'where':{'id':_0x4dcad8},'attributes':[_0xd121('0xa')]}});};exports[_0xd121('0x1b')]=function(_0x4e4fdc){return request(_0xd121('0x1c'),{'options':{'where':{'id':_0x4e4fdc},'attributes':[_0xd121('0x1d')]}});};exports[_0xd121('0x1e')]=function(_0x707ad5){return request(_0xd121('0x1f'),{'options':{'raw':![],'where':{'id':_0x707ad5},'include':[{'model':'Interval','as':_0xd121('0x20')}]}});};exports[_0xd121('0x21')]=function(_0x504b26){return request(_0xd121('0x22'),{'options':{'where':{'id':_0x504b26},'attributes':['id','name']}});};exports[_0xd121('0x23')]=function(_0xe7f6b9){return request(_0xd121('0x24'),{'body':_0xe7f6b9});};exports[_0xd121('0x25')]=function(_0x679fa6){return request(_0xd121('0x26'),{'body':_0x679fa6});};exports[_0xd121('0x27')]=function(_0x2adb1e){return request(_0xd121('0x28'),{'body':_[_0xd121('0x29')](_0x2adb1e,{'project_name':_0x2adb1e[_0xd121('0x2a')],'prev_project_name':_0x2adb1e['arg_2']||'','is_subproject':_0x2adb1e[_0xd121('0x2b')]?!![]:![],'leaveAt':moment()[_0xd121('0x2c')](_0xd121('0x2d'))})});};exports['createSquareRecording']=function(_0x213897){return request(_0xd121('0x2e'),{'body':_0x213897});};exports[_0xd121('0x2f')]=function(_0x32da09){return request('CreateSquareMessage',{'body':_0x32da09});};exports[_0xd121('0x30')]=function(_0x52e5d0){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x52e5d0[_0xd121('0x1a')],'ListId':_0x52e5d0[_0xd121('0x31')]}}})['then'](function(_0x33fba0){if(_0x33fba0){return _0x33fba0;}return request(_0xd121('0x32'),{'body':_0x52e5d0});});};exports[_0xd121('0x33')]=function(_0x1654a3){return request(_0xd121('0x34'),{'options':{'where':{'id':_0x1654a3},'attributes':[_0xd121('0xa')]}});};exports[_0xd121('0x35')]=function(_0x148605,_0xa6d042){return request(_0xd121('0x36'),{'body':{'interface':_0xa6d042},'options':{'where':_0x148605}});};exports['agentPause']=function(_0x373137,_0x56edf8,_0xcc896a){return request(_0xd121('0x37'),{'body':{'type':_0x56edf8,'uniqueid':_0xcc896a},'options':{'where':_0x373137}});};exports[_0xd121('0x38')]=function(_0x5e8393){return request(_0xd121('0x39'),{'body':{},'options':{'where':_0x5e8393}});};exports[_0xd121('0x3a')]=function(_0x3f05d2){return request(_0xd121('0x3b'),{'body':{},'options':{'where':_0x3f05d2}});}; \ No newline at end of file +var _0x1f38=['createSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f38,0xd7));var _0x81f3=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x1f38[_0x3bad26];return _0x42e1ff;};'use strict';var _=require(_0x81f3('0x0'));var moment=require(_0x81f3('0x1'));var jayson=require(_0x81f3('0x2'));var client=jayson[_0x81f3('0x3')][_0x81f3('0x4')]({'port':0x2329});function request(_0x3ad066,_0x5100d4){return new Promise(function(_0x3f51d,_0x58b173){return client[_0x81f3('0x5')](_0x3ad066,_0x5100d4)[_0x81f3('0x6')](function(_0x413c49){if(_0x413c49['error']){return _0x58b173(_0x413c49[_0x81f3('0x7')][_0x81f3('0x8')]);}else{return _0x3f51d(_0x413c49[_0x81f3('0x9')]);}})[_0x81f3('0xa')](function(_0x343897){return _0x58b173(_0x343897);});});}exports[_0x81f3('0xb')]=function(){return request(_0x81f3('0xc'),{'options':{'raw':![],'attributes':['id',_0x81f3('0xd'),_0x81f3('0xe')]}});};exports[_0x81f3('0xf')]=function(_0x10b956){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x10b956},'attributes':[_0x81f3('0xe')]}});};exports[_0x81f3('0x10')]=function(_0x39948f){return request(_0x81f3('0x11'),{'options':{'raw':![],'where':{'id':_0x39948f},'include':[{'model':_0x81f3('0x12'),'as':'Smtp','include':[{'model':'CloudProvider','as':_0x81f3('0x13')}]}],'attributes':['id',_0x81f3('0xd'),_0x81f3('0x14')],'smtp':!![]}});};exports[_0x81f3('0x15')]=function(_0xf71e9a){return request(_0x81f3('0x16'),{'options':{'where':{'id':_0xf71e9a},'attributes':['name']}});};exports[_0x81f3('0x17')]=function(_0x79b7b){return request(_0x81f3('0x18'),{'options':{'where':{'id':_0x79b7b},'attributes':['name']}});};exports[_0x81f3('0x19')]=function(_0x44c4e9){return request(_0x81f3('0x1a'),{'options':{'where':{'id':_0x44c4e9},'attributes':[_0x81f3('0xd')]}});};exports[_0x81f3('0x1b')]=function(_0x2cd818){return request(_0x81f3('0x1c'),{'options':{'where':{'id':_0x2cd818},'attributes':[_0x81f3('0x1d')]}});};exports[_0x81f3('0x1e')]=function(_0x2fbf4e){return request(_0x81f3('0x1f'),{'options':{'where':{'id':_0x2fbf4e},'attributes':['name']}});};exports[_0x81f3('0x20')]=function(_0x336d5c){return request(_0x81f3('0x21'),{'options':{'where':{'phone':_0x336d5c[_0x81f3('0x22')]},'attributes':['id']}});};exports[_0x81f3('0x23')]=function(_0x49181a){return request(_0x81f3('0x24'),{'options':{'where':{'id':_0x49181a},'attributes':[_0x81f3('0xd')]}});};exports['getSoundById']=function(_0x2f6fd6){return request('ShowSound',{'options':{'where':{'id':_0x2f6fd6},'attributes':[_0x81f3('0x25')]}});};exports[_0x81f3('0x26')]=function(_0x473da7){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x473da7},'include':[{'model':'Interval','as':_0x81f3('0x27')}]}});};exports[_0x81f3('0x28')]=function(_0x4aaeff){return request(_0x81f3('0x29'),{'options':{'where':{'id':_0x4aaeff},'attributes':['id',_0x81f3('0xd')]}});};exports['createSmsMessage']=function(_0x3f22a4){return request(_0x81f3('0x2a'),{'body':_0x3f22a4});};exports[_0x81f3('0x2b')]=function(_0x315b63){return request(_0x81f3('0x2c'),{'body':_0x315b63});};exports[_0x81f3('0x2d')]=function(_0x13778a){return request('CreateSquareReport',{'body':_[_0x81f3('0x2e')](_0x13778a,{'project_name':_0x13778a['arg_1'],'prev_project_name':_0x13778a['arg_2']||'','is_subproject':_0x13778a[_0x81f3('0x2f')]?!![]:![],'leaveAt':moment()[_0x81f3('0x30')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x81f3('0x31')]=function(_0x5dfcd9){return request(_0x81f3('0x32'),{'body':_0x5dfcd9});};exports[_0x81f3('0x33')]=function(_0x5f1175){return request(_0x81f3('0x34'),{'body':_0x5f1175});};exports[_0x81f3('0x35')]=function(_0x46025a){return request(_0x81f3('0x36'),{'options':{'raw':![],'where':{'phone':_0x46025a[_0x81f3('0x22')],'ListId':_0x46025a[_0x81f3('0x37')]}}})[_0x81f3('0x6')](function(_0x560adf){if(_0x560adf){return _0x560adf;}return request(_0x81f3('0x38'),{'body':_0x46025a});});};exports[_0x81f3('0x39')]=function(_0x4134aa){return request(_0x81f3('0x3a'),{'options':{'where':{'id':_0x4134aa},'attributes':[_0x81f3('0xd')]}});};exports[_0x81f3('0x3b')]=function(_0x504e2b,_0x1f85ee){return request('LoginUser',{'body':{'interface':_0x1f85ee},'options':{'where':_0x504e2b}});};exports['agentPause']=function(_0x11e255,_0x490098,_0x3b88ec){return request(_0x81f3('0x3c'),{'body':{'type':_0x490098,'uniqueid':_0x3b88ec},'options':{'where':_0x11e255}});};exports[_0x81f3('0x3d')]=function(_0x680c3c){return request(_0x81f3('0x3e'),{'body':{},'options':{'where':_0x680c3c}});};exports[_0x81f3('0x3f')]=function(_0x356f38){return request(_0x81f3('0x40'),{'body':{},'options':{'where':_0x356f38}});}; \ 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 4531cf3..10a2d17 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 _0xd86a=['./polly','./lex','exports'];(function(_0x50c254,_0x4a2400){var _0x537343=function(_0x160280){while(--_0x160280){_0x50c254['push'](_0x50c254['shift']());}};_0x537343(++_0x4a2400);}(_0xd86a,0xf3));var _0xad86=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xd86a[_0x10852d];return _0x13a8d6;};var polly=require(_0xad86('0x0'));var lex=require(_0xad86('0x1'));module[_0xad86('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd47f=['exports','./polly'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xd47f,0x1bd));var _0xfd47=function(_0x4d6d9a,_0xa022de){_0x4d6d9a=_0x4d6d9a-0x0;var _0x2029f8=_0xd47f[_0x4d6d9a];return _0x2029f8;};var polly=require(_0xfd47('0x0'));var lex=require('./lex');module[_0xfd47('0x1')]={'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 b69c9c3..e93d0aa 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 _0xdace=['./lib/api'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xdace,0xc5));var _0xedac=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xdace[_0x298ed3];return _0x5aad28;};'use strict';var lex=require(_0xedac('0x0'));module['exports']=function(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2){return lex(_0x1c76b2,_0x13adb5,_0x46eba0,_0x518516,_0x413d77,_0x36bcd2);}; \ No newline at end of file +var _0x3c81=['./lib/api','exports'];(function(_0x583988,_0x473518){var _0x435a3b=function(_0x44325e){while(--_0x44325e){_0x583988['push'](_0x583988['shift']());}};_0x435a3b(++_0x473518);}(_0x3c81,0x102));var _0x13c8=function(_0x2c0710,_0x3224fe){_0x2c0710=_0x2c0710-0x0;var _0x2bb4e8=_0x3c81[_0x2c0710];return _0x2bb4e8;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);}; \ 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 0ab7c74..0a88ecd 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(_0x540eeb,_0x1ea193){var _0x99e8eb=function(_0x474ea5){while(--_0x474ea5){_0x540eeb['push'](_0x540eeb['shift']());}};_0x99e8eb(++_0x1ea193);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x7542b9,_0x2c4121){var _0x1e3a79=function(_0x18e7e2){while(--_0x18e7e2){_0x7542b9['push'](_0x7542b9['shift']());}};_0x1e3a79(++_0x2c4121);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 d1760f6..f085f64 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 _0xea2f=['./lib/api','exports'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0xea2f,0xe6));var _0xfea2=function(_0x2a6c3e,_0x5aa684){_0x2a6c3e=_0x2a6c3e-0x0;var _0x120bed=_0xea2f[_0x2a6c3e];return _0x120bed;};'use strict';var polly=require(_0xfea2('0x0'));module[_0xfea2('0x1')]=function(_0x7a6bc4,_0x4c0685,_0x37f845,_0x3c90a6,_0x57b577,_0x5d6008,_0x43cc5c){return polly(_0x7a6bc4,_0x4c0685,_0x37f845,_0x3c90a6,_0x57b577,_0x5d6008,_0x43cc5c);}; \ No newline at end of file +var _0xe6ca=['exports'];(function(_0x22faae,_0x52f4de){var _0x5df295=function(_0x43923a){while(--_0x43923a){_0x22faae['push'](_0x22faae['shift']());}};_0x5df295(++_0x52f4de);}(_0xe6ca,0x184));var _0xae6c=function(_0x317ca6,_0x1e7446){_0x317ca6=_0x317ca6-0x0;var _0x148262=_0xe6ca[_0x317ca6];return _0x148262;};'use strict';var polly=require('./lib/api');module[_0xae6c('0x0')]=function(_0x45c4df,_0x9508a4,_0x5aa6ae,_0x4a8964,_0x2189d2,_0x42cbdb,_0x14455c){return polly(_0x45c4df,_0x9508a4,_0x5aa6ae,_0x4a8964,_0x2189d2,_0x42cbdb,_0x14455c);}; \ 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 9b6cd35..1c42c02 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 _0xe127=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x1babb2,_0x3b9919){var _0x487730=function(_0x49c606){while(--_0x49c606){_0x1babb2['push'](_0x1babb2['shift']());}};_0x487730(++_0x3b9919);}(_0xe127,0xe2));var _0x7e12=function(_0x3f594b,_0x30a2f6){_0x3f594b=_0x3f594b-0x0;var _0x3c66dc=_0xe127[_0x3f594b];return _0x3c66dc;};'use strict';var fs=require('fs');var path=require(_0x7e12('0x0'));var BPromise=require(_0x7e12('0x1'));var rs=require(_0x7e12('0x2'));var AWS=require(_0x7e12('0x3'));function pollyResult(_0x2925d5,_0x1fc86c,_0x44624f){return new BPromise(function(_0x290063,_0x54ab74){_0x2925d5[_0x7e12('0x4')](_0x1fc86c,function(_0x11d7a2,_0x463fda){if(_0x11d7a2){_0x54ab74(_0x11d7a2);}else if(_0x463fda){if(_0x463fda['AudioStream']instanceof Buffer){fs['writeFile'](_0x44624f,_0x463fda[_0x7e12('0x5')],function(_0x4fa567){if(_0x4fa567){_0x54ab74(_0x4fa567);}else{_0x290063();}});}else{_0x54ab74(new Error(_0x7e12('0x6')));}}else{_0x54ab74(new Error(_0x7e12('0x7')));}});});}module[_0x7e12('0x8')]=function(_0x141d53,_0x386ee7,_0x179673,_0x279c29,_0x167d31,_0x3e87c9,_0x4d8973){var _0x8ff08b=new AWS[(_0x7e12('0x9'))]({'accessKeyId':_0x141d53,'secretAccessKey':_0x386ee7,'region':_0x179673});var _0x5ef988={'Text':_0x167d31,'TextType':_0x3e87c9||_0x7e12('0xa'),'OutputFormat':_0x7e12('0xb'),'VoiceId':_0x279c29};return pollyResult(_0x8ff08b,_0x5ef988,_0x4d8973);}; \ No newline at end of file +var _0x67a6=['bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67a6,0x112));var _0x667a=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x67a6[_0x460150];return _0x340677;};'use strict';var fs=require('fs');var path=require(_0x667a('0x0'));var BPromise=require(_0x667a('0x1'));var rs=require(_0x667a('0x2'));var AWS=require(_0x667a('0x3'));function pollyResult(_0x3010fd,_0x461ae0,_0x58eab0){return new BPromise(function(_0xf4bf5e,_0x1708ae){_0x3010fd[_0x667a('0x4')](_0x461ae0,function(_0x4d664b,_0x252f0b){if(_0x4d664b){_0x1708ae(_0x4d664b);}else if(_0x252f0b){if(_0x252f0b['AudioStream']instanceof Buffer){fs[_0x667a('0x5')](_0x58eab0,_0x252f0b[_0x667a('0x6')],function(_0x55c87c){if(_0x55c87c){_0x1708ae(_0x55c87c);}else{_0xf4bf5e();}});}else{_0x1708ae(new Error(_0x667a('0x7')));}}else{_0x1708ae(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x5502f2,_0x176fbe,_0x2b20e4,_0x1e62d0,_0x3e54b7,_0x4ed9f5,_0x34a14b){var _0x3f6930=new AWS[(_0x667a('0x8'))]({'accessKeyId':_0x5502f2,'secretAccessKey':_0x176fbe,'region':_0x2b20e4});var _0x10aa79={'Text':_0x3e54b7,'TextType':_0x4ed9f5||_0x667a('0x9'),'OutputFormat':_0x667a('0xa'),'VoiceId':_0x1e62d0};return pollyResult(_0x3f6930,_0x10aa79,_0x34a14b);}; \ 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 d2334e3..ad67af0 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 _0xd66c=['./lib/api','exports'];(function(_0x49348a,_0x2ca546){var _0x209919=function(_0x595087){while(--_0x595087){_0x49348a['push'](_0x49348a['shift']());}};_0x209919(++_0x2ca546);}(_0xd66c,0xc0));var _0xcd66=function(_0x41eae1,_0x5049f3){_0x41eae1=_0x41eae1-0x0;var _0x376b04=_0xd66c[_0x41eae1];return _0x376b04;};'use strict';var asr=require(_0xcd66('0x0'));module[_0xcd66('0x1')]=function(_0x2c85cb,_0x34dc5b,_0x3e407d,_0x86f6e2){return asr(_0x2c85cb,_0x34dc5b,_0x3e407d);}; \ No newline at end of file +var _0xe9a9=['exports','./lib/api'];(function(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0xe9a9,0x193));var _0x9e9a=function(_0x50e1d4,_0x339fc8){_0x50e1d4=_0x50e1d4-0x0;var _0x3df41a=_0xe9a9[_0x50e1d4];return _0x3df41a;};'use strict';var asr=require(_0x9e9a('0x0'));module[_0x9e9a('0x1')]=function(_0x494a71,_0x1d434e,_0x254009,_0x2b274c){return asr(_0x494a71,_0x1d434e,_0x254009);}; \ 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 7ffb45b..766e45b 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 _0x4fef=['exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','url','bluebird'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x4fef,0x10f));var _0xf4fe=function(_0x3bf2d9,_0xceb635){_0x3bf2d9=_0x3bf2d9-0x0;var _0x5e53e6=_0x4fef[_0x3bf2d9];return _0x5e53e6;};'use strict';var url=require(_0xf4fe('0x0'));var BPromise=require(_0xf4fe('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xf4fe('0x2')]=function(_0x5a2bd0,_0x40f4b2,_0x14bf18){return new BPromise(function(_0x3c78db,_0x1e5ec2){var _0x5c5dbb;if(typeof _0x5a2bd0!==_0xf4fe('0x3')||_0x5a2bd0[_0xf4fe('0x4')]===0x0){return _0x1e5ec2(_0xf4fe('0x5'));}if(typeof _0x40f4b2!=='string'||_0x40f4b2[_0xf4fe('0x4')]===0x0){return _0x1e5ec2(_0xf4fe('0x6'));}if(typeof _0x14bf18!=='undefined'&&(typeof _0x14bf18!==_0xf4fe('0x3')||_0x14bf18[_0xf4fe('0x4')]===0x0)){return _0x1e5ec2(_0xf4fe('0x7'));}try{_0x5c5dbb=fs[_0xf4fe('0x8')](_0x5a2bd0)[_0xf4fe('0x9')](_0xf4fe('0xa'));}catch(_0x42da04){return _0x1e5ec2(_0x42da04);}return _0x3c78db({'method':_0xf4fe('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x40f4b2,'body':{'config':{'encoding':_0xf4fe('0xc'),'sampleRateHertz':'8000','languageCode':_0x14bf18},'audio':{'content':_0x5c5dbb}},'json':!![]});});}; \ No newline at end of file +var _0x5ff3=['filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','bluebird','exports','string','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2f16f5,_0x1f9a03){_0x2f16f5=_0x2f16f5-0x0;var _0x57ae15=_0x5ff3[_0x2f16f5];return _0x57ae15;};'use strict';var url=require('url');var BPromise=require(_0x35ff('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x35ff('0x1')]=function(_0x47c98d,_0x380f54,_0x1bb200){return new BPromise(function(_0x3bd66a,_0xd0846d){var _0x551514;if(typeof _0x47c98d!==_0x35ff('0x2')||_0x47c98d[_0x35ff('0x3')]===0x0){return _0xd0846d(_0x35ff('0x4'));}if(typeof _0x380f54!==_0x35ff('0x2')||_0x380f54[_0x35ff('0x3')]===0x0){return _0xd0846d('key\x20should\x20be\x20a\x20string');}if(typeof _0x1bb200!==_0x35ff('0x5')&&(typeof _0x1bb200!=='string'||_0x1bb200[_0x35ff('0x3')]===0x0)){return _0xd0846d(_0x35ff('0x6'));}try{_0x551514=fs[_0x35ff('0x7')](_0x47c98d)['toString'](_0x35ff('0x8'));}catch(_0x59ec4f){return _0xd0846d(_0x59ec4f);}return _0x3bd66a({'method':_0x35ff('0x9'),'uri':host+_0x35ff('0xa')+_0x380f54,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1bb200},'audio':{'content':_0x551514}},'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 2e2d504..c19fd84 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 _0x8d70=['exports','./asr'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x8d70,0xf9));var _0x08d7=function(_0x25fe1c,_0x15e15b){_0x25fe1c=_0x25fe1c-0x0;var _0x3e0d07=_0x8d70[_0x25fe1c];return _0x3e0d07;};var asr=require(_0x08d7('0x0'));module[_0x08d7('0x1')]={'asr':asr}; \ No newline at end of file +var _0x63ee=['./asr','exports'];(function(_0x48e6c1,_0x2c5211){var _0x1521e2=function(_0x27e789){while(--_0x27e789){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x1521e2(++_0x2c5211);}(_0x63ee,0x152));var _0xe63e=function(_0x15676f,_0x13aebf){_0x15676f=_0x15676f-0x0;var _0x5db035=_0x63ee[_0x15676f];return _0x5db035;};var asr=require(_0xe63e('0x0'));module[_0xe63e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 3684224..c0c7fcd 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 _0x9248=['https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','close','download\x20error','pipe','end','host','get','data','wav','error\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','POST','resolve','.mp3','from','unlink','info','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','transcript','alternatives','join','map','confidence','googleASR\x20confidence','[%s]\x20%s:%s','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','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','freeform=3','nda','text','channelData','CustomAction','CustomActionData','Data','audiofile','dirName','bluebird','dialogflow'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x9248,0x19c));var _0x8924=function(_0x1c4f60,_0x53f552){_0x1c4f60=_0x1c4f60-0x0;var _0x491823=_0x9248[_0x1c4f60];return _0x491823;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x8924('0x0'));var dialogflow=require(_0x8924('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x8924('0x2'));var md5=require(_0x8924('0x3'));var path=require('path');var querystring=require(_0x8924('0x4'));var rp=require(_0x8924('0x5'));var rs=require(_0x8924('0x6'));var sox=require(_0x8924('0x7'));var tts=require(_0x8924('0x8'));var urlParse=require(_0x8924('0x9'))[_0x8924('0xa')];var util=require(_0x8924('0xb'));var aws=require(_0x8924('0xc'));var google=require(_0x8924('0xd'));var sestek=require(_0x8924('0xe'));var tilde=require(_0x8924('0xf'));var logger=require(_0x8924('0x10'))(_0x8924('0x11'));var ISPEECH_API=_0x8924('0x12');function downloadFile(_0x302662,_0x4fb807){return new BPromise(function(_0x4fcaee,_0xda0ca5){var _0x25ccea=urlParse(_0x302662);var _0x124856=_0x25ccea[_0x8924('0x13')]===_0x8924('0x14')?https:http;var _0x3e2bb2={'host':_0x25ccea['host'],'path':_0x25ccea['path'],'headers':{'user-agent':_0x8924('0x15')}};_0x124856['get'](_0x3e2bb2,function(_0x56623d){if(_0x56623d[_0x8924('0x16')]!==0xc8){logger[_0x8924('0x17')](_0x8924('0x18')+_0x302662+_0x8924('0x19')+_0x56623d[_0x8924('0x16')]+'\x20('+_0x56623d[_0x8924('0x1a')]+')');_0xda0ca5(new Error('request\x20to\x20'+_0x302662+_0x8924('0x19')+_0x56623d['statusCode']+'\x20('+_0x56623d[_0x8924('0x1a')]+')'));return;}var _0xb93f32=fs['createWriteStream'](_0x4fb807);_0xb93f32['on'](_0x8924('0x1b'),function(){logger['info'](_0x8924('0x1c'));_0xb93f32[_0x8924('0x1d')](_0x4fcaee);});_0xb93f32['on']('error',function(_0x1aa981){fs['unlink'](_0x4fb807);logger[_0x8924('0x17')](_0x8924('0x1e'),_0x1aa981);_0xda0ca5(_0x1aa981);});_0x56623d[_0x8924('0x1f')](_0xb93f32);})['on'](_0x8924('0x17'),function(_0x285737){logger[_0x8924('0x17')](_0x285737);_0xda0ca5(_0x285737);})[_0x8924('0x20')]();});}function uploadFile(_0x479122){return new BPromise(function(_0x1d5423,_0x40f833){var _0x45db70=urlParse(_0x479122);var _0x3fd20f=_0x45db70[_0x8924('0x13')]===_0x8924('0x14')?https:http;var _0x51ac5c={'host':_0x45db70[_0x8924('0x21')],'path':_0x45db70['path'],'headers':{'user-agent':_0x8924('0x15')}};_0x3fd20f[_0x8924('0x22')](_0x51ac5c,function(_0x53c68a){if(_0x53c68a[_0x8924('0x16')]!==0xc8){_0x40f833(new Error(_0x8924('0x18')+_0x479122+_0x8924('0x19')+_0x53c68a['statusCode']+'\x20('+_0x53c68a[_0x8924('0x1a')]+')'));return;}var _0x266e00='';_0x53c68a['on'](_0x8924('0x23'),function(_0x3d9e9b){_0x266e00+=_0x3d9e9b;});_0x53c68a['on'](_0x8924('0x20'),function(){_0x1d5423(_0x266e00);});})['on'](_0x8924('0x17'),function(_0x2f5cc5){_0x40f833(_0x2f5cc5);})[_0x8924('0x20')]();});}function convertFile(_0x67a758,_0x1dcf59){return new BPromise(function(_0x55a994,_0x46fef5){var _0x3ef26d=sox['transcode'](_0x67a758,_0x1dcf59,{'sampleRate':0x1f40,'format':_0x8924('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ef26d['on'](_0x8924('0x17'),function(_0xf00511){logger[_0x8924('0x17')](_0x8924('0x25'),_0xf00511);_0x46fef5(_0xf00511);});_0x3ef26d['on'](_0x8924('0x20'),function(){logger['info']('finish\x20to\x20convert');_0x55a994();});_0x3ef26d[_0x8924('0x26')]();});}function base64Decode(_0x429941,_0x440521){var _0x2c3dce=path['resolve'](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+_0x8924('0x29'));fs[_0x8924('0x2a')](_0x2c3dce,_0x429941,_0x8924('0x2b'));return convertFile(_0x2c3dce,_0x440521)[_0x8924('0x2c')](function(){try{fs['unlink'](_0x2c3dce);fs[_0x8924('0x2d')](_0x440521,_0x8924('0x2e'));}catch(_0x36ec65){logger[_0x8924('0x17')](_0x36ec65);}return _0x440521['split']('.')[0x0];});}function base64Encode(_0x4959ba){var _0x4dcf82=fs[_0x8924('0x2f')](_0x4959ba);return new Buffer(_0x4dcf82)[_0x8924('0x30')](_0x8924('0x2b'));}exports['googleCloudTTS']=function(_0x1539db,_0x3c8e57,_0x26aaec,_0x4e7e9d,_0x1642cb,_0x32bde7){var _0x4b1815,_0x42f960;var _0x47b37f=_0x8924('0x31');var _0x11865a=_0x8924('0x32')+_0x1539db;var _0x2607fb={};if(_0x3c8e57===_0x8924('0x33')){_0x2607fb[_0x8924('0x34')]={'ssml':_0x26aaec};}else{_0x2607fb['input']={'text':_0x26aaec};};_0x2607fb['voice']={'languageCode':_0x4e7e9d,'ssmlGender':_0x1642cb};_0x2607fb['audioConfig']={'audioEncoding':_0x8924('0x35'),'sampleRateHertz':0x1f40};var _0x22572e={'url':_0x47b37f+'text:synthesize'+_0x11865a,'method':_0x8924('0x36'),'json':!![],'body':_0x2607fb};return rp(_0x22572e)[_0x8924('0x2c')](function(_0x4a9472){return new BPromise(function(_0x51bfa4,_0x34e83b){_0x4b1815=path[_0x8924('0x37')](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+_0x8924('0x38'));var _0x33243f=Buffer[_0x8924('0x39')](_0x4a9472['audioContent'],_0x8924('0x2b'));return fs['writeFile'](_0x4b1815,_0x33243f,function(_0x511ae5){_0x34e83b(_0x511ae5);},function(_0x3cddd1){fs[_0x8924('0x2d')](_0x4b1815,_0x8924('0x2e'));_0x51bfa4(_0x3cddd1);});});})[_0x8924('0x2c')](function(_0x37e3e3){_0x42f960=path['resolve'](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+_0x8924('0x29'));return convertFile(_0x4b1815,_0x42f960);})[_0x8924('0x2c')](function(){try{fs[_0x8924('0x3a')](_0x4b1815);fs[_0x8924('0x2d')](_0x42f960,'777');}catch(_0x4d3029){logger[_0x8924('0x17')](_0x4d3029);}logger[_0x8924('0x3b')]('googleCloudTTS\x20path',_0x42f960['split']('.')[0x0]);return _0x42f960[_0x8924('0x3c')]('.')[0x0];});};exports[_0x8924('0x3d')]=function(_0x1d9fbd,_0x2d6af5){var _0x305508=_0x8924('0x3e');var _0x1cf243,_0x474476;var _0xd739ea;var _0x2ef183={'encoding':_0x8924('0x3f'),'method':_0x8924('0x36'),'timeout':0x2710,'url':_0x305508,'headers':{'Content-Type':_0x8924('0x40')},'body':_0x8924('0x41')+encodeURIComponent(JSON['stringify']([[[_0x8924('0x42'),JSON[_0x8924('0x43')]([_0x1d9fbd,_0x2d6af5||'en',![],_0x8924('0x44')]),null,_0x8924('0x45')]]]))};return rp(_0x2ef183)[_0x8924('0x2c')](function(_0x5ab829){try{_0xd739ea=eval(_0x5ab829[_0x8924('0x46')](0x5))[0x0][0x2];}catch(_0x5762cc){throw new Error(_0x8924('0x47')+_0x5ab829['data']);}if(!_0xd739ea){if(_0x1d9fbd['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x8924('0x48')+_0x2d6af5+_0x8924('0x49'));}}try{_0xd739ea=eval(_0xd739ea)[0x0];}catch(_0x1db917){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x8924('0x23')]);}const _0x2dba7b=_0xd739ea;_0x1cf243=path[_0x8924('0x37')](__dirname,'tmp',rs[_0x8924('0x28')](0x4)+_0x8924('0x38'));fs[_0x8924('0x2a')](_0x1cf243,_0xd739ea,{'encoding':_0x8924('0x2b')});_0x474476=path['resolve'](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+'.wav');return convertFile(_0x1cf243,_0x474476);})[_0x8924('0x2c')](function(){try{fs[_0x8924('0x3a')](_0x1cf243);fs[_0x8924('0x2d')](_0x474476,_0x8924('0x2e'));}catch(_0x377611){logger['error'](_0x377611);}logger[_0x8924('0x3b')](_0x8924('0x4a'),_0x474476['split']('.')[0x0]);return _0x474476[_0x8924('0x3c')]('.')[0x0];});};exports['googleASR']=function(_0x4eb4f9,_0x1bad58,_0x1cda18){return google[_0x8924('0x4b')](_0x4eb4f9,_0x1bad58,_0x1cda18)['then'](function(_0x449954){logger[_0x8924('0x3b')](_0x449954[_0x8924('0x4c')]);return rp(_0x449954);})[_0x8924('0x2c')](function(_0x3671aa){var _0x3ac6ba='';var _0xb2bc54=0x0;try{fs[_0x8924('0x3a')](_0x4eb4f9);}catch(_0x585f68){logger[_0x8924('0x17')](_0x585f68);}if(_0x3671aa&&_0x3671aa[_0x8924('0x4d')]){_0x3ac6ba=_0x3671aa[_0x8924('0x4d')]['map'](function(_0x2e5241){return _0x2e5241&&_0x2e5241['alternatives'][0x0]&&_0x2e5241['alternatives'][0x0][_0x8924('0x4e')]?_0x2e5241[_0x8924('0x4f')][0x0][_0x8924('0x4e')]:'';})[_0x8924('0x50')]('\x0a');_0xb2bc54=_0x3671aa[_0x8924('0x4d')][_0x8924('0x51')](function(_0x14ad4f){return _0x14ad4f&&_0x14ad4f[_0x8924('0x4f')][0x0]&&_0x14ad4f[_0x8924('0x4f')][0x0][_0x8924('0x52')]?_0x14ad4f[_0x8924('0x4f')][0x0]['confidence']:0x0;})[_0x8924('0x50')]('\x0a');}logger[_0x8924('0x3b')]('googleASR\x20transcription',_0x3ac6ba);logger[_0x8924('0x3b')](_0x8924('0x53'),_0xb2bc54);return{'transcript':_0x3ac6ba,'confidence':_0xb2bc54};})['catch'](function(_0x1984b8){logger[_0x8924('0x17')](_0x8924('0x54'),_0x1984b8['statusCode'],_0x1984b8['name'],_0x1984b8['message']);});};exports['googleDialogflow']=function(_0x3232c1,_0x3e5b7b,_0x1b087e,_0x388019){var _0x5240fd=apiai(_0x3e5b7b,{'language':_0x388019||'en'});return _0x5240fd[_0x8924('0x55')](_0x1b087e,{'sessionId':md5(_0x3232c1)})[_0x8924('0x2c')](function(_0xfeb6f2){logger[_0x8924('0x3b')](JSON[_0x8924('0x43')](_0xfeb6f2));return{'source':_0xfeb6f2[_0x8924('0x56')][_0x8924('0x57')],'resolvedQuery':_0xfeb6f2[_0x8924('0x56')][_0x8924('0x58')],'action':_0xfeb6f2['result'][_0x8924('0x59')],'actionIncomplete':_0xfeb6f2['result'][_0x8924('0x5a')],'speech':_0xfeb6f2[_0x8924('0x56')][_0x8924('0x5b')][_0x8924('0x5c')],'score':_0xfeb6f2[_0x8924('0x56')][_0x8924('0x5d')],'statusCode':_0xfeb6f2[_0x8924('0x5e')][_0x8924('0x5f')],'endConversation':_0xfeb6f2[_0x8924('0x56')][_0x8924('0x60')][_0x8924('0x61')]||![],'isFallbackIntent':_0xfeb6f2['result'][_0x8924('0x60')][_0x8924('0x62')]};});};exports[_0x8924('0x63')]=function(_0x32c474,_0x147398,_0x5782fd,_0x499d1f,_0x4a9d21,_0x3e6eca){var _0x4d0d8a=_0x499d1f['replace'](/\\n/g,'\x0a');var _0x32ed01={'credentials':{'private_key':_0x4d0d8a,'client_email':_0x5782fd}};var _0x39343a=new dialogflow[(_0x8924('0x64'))](_0x32ed01);var _0x33b9a3=_0x39343a['sessionPath'](_0x147398,md5(_0x32c474));var _0x1dec67={'session':_0x33b9a3,'queryInput':{'text':{'text':_0x4a9d21,'languageCode':_0x3e6eca}}};return _0x39343a[_0x8924('0x65')](_0x1dec67)[_0x8924('0x2c')](function(_0x3501aa){if(_0x3501aa&&_0x3501aa[_0x8924('0x66')]){logger['info'](_0x8924('0x67'),JSON[_0x8924('0x43')](_0x3501aa));var _0x3167d1=_0x3501aa[0x0];if(_0x3167d1){var _0x2f884f={'action':_0x3167d1[_0x8924('0x68')][_0x8924('0x59')],'allRequiredParamsPresent':_0x3167d1[_0x8924('0x68')][_0x8924('0x69')],'endConversation':_0x3167d1[_0x8924('0x68')]['diagnosticInfo']&&_0x3167d1[_0x8924('0x68')][_0x8924('0x6a')][_0x8924('0x6b')]?_0x3167d1[_0x8924('0x68')]['diagnosticInfo']['fields']['end_conversation'][_0x8924('0x6c')]:![],'fulfillmentText':_0x3167d1[_0x8924('0x68')][_0x8924('0x6d')],'intentName':_0x3167d1[_0x8924('0x68')][_0x8924('0x6e')][_0x8924('0x6f')],'intentDisplayName':_0x3167d1['queryResult'][_0x8924('0x6e')][_0x8924('0x70')],'isFallbackIntent':_0x3167d1[_0x8924('0x68')][_0x8924('0x6e')][_0x8924('0x71')],'languageCode':_0x3167d1['queryResult'][_0x8924('0x72')],'queryText':_0x3167d1['queryResult'][_0x8924('0x73')],'responseId':_0x3167d1[_0x8924('0x74')],'score':_0x3167d1['queryResult'][_0x8924('0x75')],'speech':_0x3167d1['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x8924('0x43')](_0x3501aa)};return _0x2f884f;}}});};exports[_0x8924('0x76')]=function(_0x65792b,_0xd31076,_0x2ab213,_0x2b0bec){return tilde['asr'](_0x65792b,_0xd31076,_0x2ab213,_0x2b0bec)[_0x8924('0x2c')](function(_0xb77a56){try{fs['unlink'](_0x65792b);}catch(_0x290931){logger[_0x8924('0x17')](_0x290931);}logger[_0x8924('0x3b')](_0x8924('0x77'),_0xb77a56[_0x8924('0x4e')]);logger[_0x8924('0x3b')](_0x8924('0x78'),_0xb77a56[_0x8924('0x52')]);return _0xb77a56;});};exports[_0x8924('0x79')]=function(_0xda0261,_0x4cb5df,_0x440437,_0x16cede,_0x58f857,_0x24df7f){var _0x207a1d=path[_0x8924('0x37')](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+_0x8924('0x38'));var _0x3a08a6;return aws[_0x8924('0x7a')](_0xda0261,_0x4cb5df,_0x440437,_0x16cede,_0x58f857,_0x24df7f,_0x207a1d)[_0x8924('0x2c')](function(){_0x3a08a6=path[_0x8924('0x37')](__dirname,'tmp',rs[_0x8924('0x28')](0x4)+'.wav');return convertFile(_0x207a1d,_0x3a08a6);})[_0x8924('0x2c')](function(){try{fs[_0x8924('0x3a')](_0x207a1d);fs[_0x8924('0x2d')](_0x3a08a6,_0x8924('0x2e'));}catch(_0x523f10){logger[_0x8924('0x17')](_0x523f10);}return _0x3a08a6[_0x8924('0x3c')]('.')[0x0];});};exports['awsLex']=function(_0x5c09b5,_0x1bfb9a,_0x2ffe94,_0x3a2bf8,_0x12e52b,_0x5c1ed1){return aws[_0x8924('0x7b')](_0x5c09b5,_0x1bfb9a,_0x2ffe94,_0x3a2bf8,_0x12e52b,_0x5c1ed1)[_0x8924('0x2c')](function(_0x3f4f37){logger[_0x8924('0x3b')](JSON[_0x8924('0x43')](_0x3f4f37));return _0x3f4f37;});};exports[_0x8924('0x7c')]=function(_0x4432dd,_0x42e054,_0x155394,_0x55c4e5){var _0x59185a=util[_0x8924('0x7d')](_0x8924('0x7e'),ISPEECH_API,_0x4432dd,encodeURIComponent(_0x42e054),_0x155394,_0x55c4e5);var _0x2ae5c5=path[_0x8924('0x37')](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+_0x8924('0x38'));var _0x2bb222;return downloadFile(_0x59185a,_0x2ae5c5)[_0x8924('0x2c')](function(){_0x2bb222=path[_0x8924('0x37')](__dirname,_0x8924('0x27'),rs[_0x8924('0x28')](0x4)+'.wav');return convertFile(_0x2ae5c5,_0x2bb222);})[_0x8924('0x2c')](function(){try{fs[_0x8924('0x3a')](_0x2ae5c5);fs[_0x8924('0x2d')](_0x2bb222,_0x8924('0x2e'));}catch(_0x3dbbd2){logger['error'](_0x3dbbd2);}return _0x2bb222[_0x8924('0x3c')]('.')[0x0];});};exports[_0x8924('0x7f')]=function(_0x58a895,_0x54bbac,_0x26cd4e,_0x1e7a46){var _0x4545c5=util[_0x8924('0x7d')](_0x8924('0x80'),ISPEECH_API,_0x54bbac,_0x26cd4e,base64Encode(_0x58a895),_0x1e7a46?util[_0x8924('0x7d')]('model=%s',encodeURIComponent(_0x1e7a46)):_0x8924('0x81'));return uploadFile(_0x4545c5)[_0x8924('0x2c')](function(_0x2598db){return querystring[_0x8924('0xa')](_0x2598db);});};exports['sestekNDA']=function(_0x358dc7,_0x28c2a5){return sestek[_0x8924('0x82')](_0x358dc7,_0x28c2a5)[_0x8924('0x2c')](function(_0x1e2ec1){logger['info'](JSON['stringify'](_0x1e2ec1));var _0x4585e6={'speech':_0x1e2ec1[_0x8924('0x83')],'action':_0x1e2ec1[_0x8924('0x84')]?_0x1e2ec1['channelData'][_0x8924('0x85')]:undefined,'actiondata':_0x1e2ec1['channelData']?_0x1e2ec1['channelData'][_0x8924('0x86')]:undefined};if(_0x1e2ec1[_0x8924('0x84')]&&_0x1e2ec1[_0x8924('0x84')]['AudioFromTts']){return base64Decode(_0x1e2ec1['channelData']['AudioFromTts'][_0x8924('0x87')],path[_0x8924('0x37')](__dirname,_0x8924('0x27'),rs['generate'](0x4)+_0x8924('0x29')))['then'](function(_0x447334){_0x4585e6[_0x8924('0x88')]=_0x447334;return _0x4585e6;});}return _0x4585e6;});};exports[_0x8924('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x5c5b=['.mp3','from','info','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','stringify','generic','slice','length','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','googleASR','asr','results','map','alternatives','transcript','confidence','join','catch','[%s]\x20%s:%s','name','textRequest','result','source','resolvedQuery','action','actionIncomplete','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','pipe','end','host','WHAT_EVER','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','chmodSync','777','split','readFileSync','base64','googleCloudTTS','?key=','input','text:synthesize','then','tmp','generate'];(function(_0x2a2799,_0x5e25a8){var _0x17f761=function(_0x523b8a){while(--_0x523b8a){_0x2a2799['push'](_0x2a2799['shift']());}};_0x17f761(++_0x5e25a8);}(_0x5c5b,0xca));var _0xb5c5=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x5c5b[_0x27bcf5];return _0x4ce4cf;};'use strict';var apiai=require(_0xb5c5('0x0'));var BPromise=require(_0xb5c5('0x1'));var dialogflow=require(_0xb5c5('0x2'));var fs=require('fs');var http=require(_0xb5c5('0x3'));var https=require(_0xb5c5('0x4'));var md5=require(_0xb5c5('0x5'));var path=require(_0xb5c5('0x6'));var querystring=require(_0xb5c5('0x7'));var rp=require(_0xb5c5('0x8'));var rs=require(_0xb5c5('0x9'));var sox=require(_0xb5c5('0xa'));var tts=require('google-tts-api');var urlParse=require(_0xb5c5('0xb'))[_0xb5c5('0xc')];var util=require(_0xb5c5('0xd'));var aws=require(_0xb5c5('0xe'));var google=require(_0xb5c5('0xf'));var sestek=require(_0xb5c5('0x10'));var tilde=require(_0xb5c5('0x11'));var logger=require(_0xb5c5('0x12'))(_0xb5c5('0x13'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5af59c,_0x5f4fd1){return new BPromise(function(_0x1fe958,_0x579267){var _0x2482af=urlParse(_0x5af59c);var _0x5e9812=_0x2482af[_0xb5c5('0x14')]===_0xb5c5('0x15')?https:http;var _0x502841={'host':_0x2482af['host'],'path':_0x2482af[_0xb5c5('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x5e9812[_0xb5c5('0x16')](_0x502841,function(_0x1693ce){if(_0x1693ce[_0xb5c5('0x17')]!==0xc8){logger[_0xb5c5('0x18')](_0xb5c5('0x19')+_0x5af59c+_0xb5c5('0x1a')+_0x1693ce[_0xb5c5('0x17')]+'\x20('+_0x1693ce[_0xb5c5('0x1b')]+')');_0x579267(new Error(_0xb5c5('0x19')+_0x5af59c+_0xb5c5('0x1a')+_0x1693ce[_0xb5c5('0x17')]+'\x20('+_0x1693ce[_0xb5c5('0x1b')]+')'));return;}var _0x4fa062=fs[_0xb5c5('0x1c')](_0x5f4fd1);_0x4fa062['on'](_0xb5c5('0x1d'),function(){logger['info'](_0xb5c5('0x1e'));_0x4fa062[_0xb5c5('0x1f')](_0x1fe958);});_0x4fa062['on'](_0xb5c5('0x18'),function(_0x4cee9f){fs[_0xb5c5('0x20')](_0x5f4fd1);logger[_0xb5c5('0x18')]('download\x20error',_0x4cee9f);_0x579267(_0x4cee9f);});_0x1693ce[_0xb5c5('0x21')](_0x4fa062);})['on'](_0xb5c5('0x18'),function(_0x387ddc){logger[_0xb5c5('0x18')](_0x387ddc);_0x579267(_0x387ddc);})[_0xb5c5('0x22')]();});}function uploadFile(_0x28678b){return new BPromise(function(_0x840043,_0x1b9984){var _0x1609f2=urlParse(_0x28678b);var _0x97f4a6=_0x1609f2['protocol']==='https:'?https:http;var _0x1b9a4e={'host':_0x1609f2[_0xb5c5('0x23')],'path':_0x1609f2[_0xb5c5('0x6')],'headers':{'user-agent':_0xb5c5('0x24')}};_0x97f4a6['get'](_0x1b9a4e,function(_0x41cfd2){if(_0x41cfd2[_0xb5c5('0x17')]!==0xc8){_0x1b9984(new Error(_0xb5c5('0x19')+_0x28678b+_0xb5c5('0x1a')+_0x41cfd2[_0xb5c5('0x17')]+'\x20('+_0x41cfd2[_0xb5c5('0x1b')]+')'));return;}var _0x181b7d='';_0x41cfd2['on'](_0xb5c5('0x25'),function(_0xd2d2a){_0x181b7d+=_0xd2d2a;});_0x41cfd2['on'](_0xb5c5('0x22'),function(){_0x840043(_0x181b7d);});})['on'](_0xb5c5('0x18'),function(_0x3f09db){_0x1b9984(_0x3f09db);})[_0xb5c5('0x22')]();});}function convertFile(_0x7dda78,_0x50d596){return new BPromise(function(_0x5de121,_0x14ef88){var _0x50e8fe=sox[_0xb5c5('0x26')](_0x7dda78,_0x50d596,{'sampleRate':0x1f40,'format':_0xb5c5('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x50e8fe['on'](_0xb5c5('0x18'),function(_0x1ee5a5){logger[_0xb5c5('0x18')](_0xb5c5('0x28'),_0x1ee5a5);_0x14ef88(_0x1ee5a5);});_0x50e8fe['on']('end',function(){logger['info'](_0xb5c5('0x29'));_0x5de121();});_0x50e8fe[_0xb5c5('0x2a')]();});}function base64Decode(_0x3da9b4,_0x23ca4f){var _0x4e7f1d=path[_0xb5c5('0x2b')](__dirname,'tmp',rs['generate'](0x4)+_0xb5c5('0x2c'));fs[_0xb5c5('0x2d')](_0x4e7f1d,_0x3da9b4,'base64');return convertFile(_0x4e7f1d,_0x23ca4f)['then'](function(){try{fs['unlink'](_0x4e7f1d);fs[_0xb5c5('0x2e')](_0x23ca4f,_0xb5c5('0x2f'));}catch(_0x17a258){logger[_0xb5c5('0x18')](_0x17a258);}return _0x23ca4f[_0xb5c5('0x30')]('.')[0x0];});}function base64Encode(_0x46f35d){var _0x1cc93a=fs[_0xb5c5('0x31')](_0x46f35d);return new Buffer(_0x1cc93a)['toString'](_0xb5c5('0x32'));}exports[_0xb5c5('0x33')]=function(_0x569d26,_0x249975,_0xaa7134,_0x49a1b2,_0x23c47b,_0x88d298){var _0x50ceb7,_0x4b7ad0;var _0x39be13='https://texttospeech.googleapis.com/v1/';var _0x4119ad=_0xb5c5('0x34')+_0x569d26;var _0xb6df3a={};if(_0x249975==='ssml'){_0xb6df3a['input']={'ssml':_0xaa7134};}else{_0xb6df3a[_0xb5c5('0x35')]={'text':_0xaa7134};};_0xb6df3a['voice']={'languageCode':_0x49a1b2,'ssmlGender':_0x23c47b};_0xb6df3a['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3e669e={'url':_0x39be13+_0xb5c5('0x36')+_0x4119ad,'method':'POST','json':!![],'body':_0xb6df3a};return rp(_0x3e669e)[_0xb5c5('0x37')](function(_0x12c2b0){return new BPromise(function(_0x567b97,_0x1e556e){_0x50ceb7=path['resolve'](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x3a'));var _0x2db4ea=Buffer[_0xb5c5('0x3b')](_0x12c2b0['audioContent'],'base64');return fs['writeFile'](_0x50ceb7,_0x2db4ea,function(_0x896b62){_0x1e556e(_0x896b62);},function(_0x397dca){fs[_0xb5c5('0x2e')](_0x50ceb7,_0xb5c5('0x2f'));_0x567b97(_0x397dca);});});})['then'](function(_0x328df2){_0x4b7ad0=path['resolve'](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+'.wav');return convertFile(_0x50ceb7,_0x4b7ad0);})[_0xb5c5('0x37')](function(){try{fs[_0xb5c5('0x20')](_0x50ceb7);fs[_0xb5c5('0x2e')](_0x4b7ad0,'777');}catch(_0x2f396e){logger['error'](_0x2f396e);}logger[_0xb5c5('0x3c')](_0xb5c5('0x3d'),_0x4b7ad0['split']('.')[0x0]);return _0x4b7ad0[_0xb5c5('0x30')]('.')[0x0];});};exports[_0xb5c5('0x3e')]=function(_0x5627e7,_0xe86ce6){var _0x514e67=_0xb5c5('0x3f');var _0x511073,_0x3d52ae;var _0xc10603;var _0x599e8a={'encoding':'utf8','method':_0xb5c5('0x40'),'timeout':0x2710,'url':_0x514e67,'headers':{'Content-Type':_0xb5c5('0x41')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0xb5c5('0x42')]([_0x5627e7,_0xe86ce6||'en',![],'null']),null,_0xb5c5('0x43')]]]))};return rp(_0x599e8a)[_0xb5c5('0x37')](function(_0x168aa8){try{_0xc10603=eval(_0x168aa8[_0xb5c5('0x44')](0x5))[0x0][0x2];}catch(_0xa7d8cf){throw new Error('parse\x20response\x20failed:\x0a'+_0x168aa8[_0xb5c5('0x25')]);}if(!_0xc10603){if(_0x5627e7[_0xb5c5('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0xe86ce6+_0xb5c5('0x46'));}}try{_0xc10603=eval(_0xc10603)[0x0];}catch(_0x318570){throw new Error(_0xb5c5('0x47')+res[_0xb5c5('0x25')]);}const _0x2db886=_0xc10603;_0x511073=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x3a'));fs['writeFileSync'](_0x511073,_0xc10603,{'encoding':_0xb5c5('0x32')});_0x3d52ae=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x2c'));return convertFile(_0x511073,_0x3d52ae);})[_0xb5c5('0x37')](function(){try{fs[_0xb5c5('0x20')](_0x511073);fs[_0xb5c5('0x2e')](_0x3d52ae,_0xb5c5('0x2f'));}catch(_0x3c8a94){logger[_0xb5c5('0x18')](_0x3c8a94);}logger['info']('goggleTTS\x20path',_0x3d52ae[_0xb5c5('0x30')]('.')[0x0]);return _0x3d52ae[_0xb5c5('0x30')]('.')[0x0];});};exports[_0xb5c5('0x48')]=function(_0x55d5bd,_0x4d4f5c,_0x4962e6){return google[_0xb5c5('0x49')](_0x55d5bd,_0x4d4f5c,_0x4962e6)[_0xb5c5('0x37')](function(_0x35b7e2){logger['info'](_0x35b7e2['uri']);return rp(_0x35b7e2);})['then'](function(_0x22894b){var _0x8a4d05='';var _0x1c767d=0x0;try{fs[_0xb5c5('0x20')](_0x55d5bd);}catch(_0x20ab4c){logger[_0xb5c5('0x18')](_0x20ab4c);}if(_0x22894b&&_0x22894b[_0xb5c5('0x4a')]){_0x8a4d05=_0x22894b[_0xb5c5('0x4a')][_0xb5c5('0x4b')](function(_0x257967){return _0x257967&&_0x257967['alternatives'][0x0]&&_0x257967[_0xb5c5('0x4c')][0x0]['transcript']?_0x257967[_0xb5c5('0x4c')][0x0][_0xb5c5('0x4d')]:'';})['join']('\x0a');_0x1c767d=_0x22894b['results'][_0xb5c5('0x4b')](function(_0x4df05a){return _0x4df05a&&_0x4df05a[_0xb5c5('0x4c')][0x0]&&_0x4df05a['alternatives'][0x0]['confidence']?_0x4df05a[_0xb5c5('0x4c')][0x0][_0xb5c5('0x4e')]:0x0;})[_0xb5c5('0x4f')]('\x0a');}logger[_0xb5c5('0x3c')]('googleASR\x20transcription',_0x8a4d05);logger[_0xb5c5('0x3c')]('googleASR\x20confidence',_0x1c767d);return{'transcript':_0x8a4d05,'confidence':_0x1c767d};})[_0xb5c5('0x50')](function(_0x5f1907){logger[_0xb5c5('0x18')](_0xb5c5('0x51'),_0x5f1907['statusCode'],_0x5f1907[_0xb5c5('0x52')],_0x5f1907['message']);});};exports['googleDialogflow']=function(_0x956e83,_0x58235e,_0x1f8eaa,_0x2f1280){var _0x5dd4d4=apiai(_0x58235e,{'language':_0x2f1280||'en'});return _0x5dd4d4[_0xb5c5('0x53')](_0x1f8eaa,{'sessionId':md5(_0x956e83)})[_0xb5c5('0x37')](function(_0x371de6){logger[_0xb5c5('0x3c')](JSON[_0xb5c5('0x42')](_0x371de6));return{'source':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x55')],'resolvedQuery':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x56')],'action':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x57')],'actionIncomplete':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x58')],'speech':_0x371de6[_0xb5c5('0x54')]['fulfillment']['speech'],'score':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x59')],'statusCode':_0x371de6[_0xb5c5('0x5a')][_0xb5c5('0x5b')],'endConversation':_0x371de6[_0xb5c5('0x54')]['metadata'][_0xb5c5('0x5c')]||![],'isFallbackIntent':_0x371de6[_0xb5c5('0x54')][_0xb5c5('0x5d')][_0xb5c5('0x5e')]};});};exports[_0xb5c5('0x5f')]=function(_0x3916c5,_0x1e6593,_0x473d5a,_0x2eb2d9,_0x3fbba9,_0x19b9ee){var _0x145b9e=_0x2eb2d9[_0xb5c5('0x60')](/\\n/g,'\x0a');var _0x536cc3={'credentials':{'private_key':_0x145b9e,'client_email':_0x473d5a}};var _0x61ef34=new dialogflow['SessionsClient'](_0x536cc3);var _0x10113f=_0x61ef34['sessionPath'](_0x1e6593,md5(_0x3916c5));var _0x3b5382={'session':_0x10113f,'queryInput':{'text':{'text':_0x3fbba9,'languageCode':_0x19b9ee}}};return _0x61ef34['detectIntent'](_0x3b5382)[_0xb5c5('0x37')](function(_0x26ed75){if(_0x26ed75&&_0x26ed75[_0xb5c5('0x45')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0xb5c5('0x42')](_0x26ed75));var _0x551584=_0x26ed75[0x0];if(_0x551584){var _0x3fce0c={'action':_0x551584['queryResult'][_0xb5c5('0x57')],'allRequiredParamsPresent':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x62')],'endConversation':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x63')]&&_0x551584[_0xb5c5('0x61')][_0xb5c5('0x63')]['fields']?_0x551584[_0xb5c5('0x61')][_0xb5c5('0x63')][_0xb5c5('0x64')][_0xb5c5('0x65')][_0xb5c5('0x66')]:![],'fulfillmentText':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x67')],'intentName':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x68')]['name'],'intentDisplayName':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x68')][_0xb5c5('0x69')],'isFallbackIntent':_0x551584['queryResult']['intent'][_0xb5c5('0x6a')],'languageCode':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x6b')],'queryText':_0x551584['queryResult'][_0xb5c5('0x6c')],'responseId':_0x551584[_0xb5c5('0x6d')],'score':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x6e')],'speech':_0x551584[_0xb5c5('0x61')][_0xb5c5('0x67')],'providerResponse':JSON[_0xb5c5('0x42')](_0x26ed75)};return _0x3fce0c;}}});};exports['tildeASR']=function(_0x7d74c7,_0x9f8df6,_0x4bb458,_0x4b42bc){return tilde[_0xb5c5('0x49')](_0x7d74c7,_0x9f8df6,_0x4bb458,_0x4b42bc)['then'](function(_0x3130ca){try{fs[_0xb5c5('0x20')](_0x7d74c7);}catch(_0x400d46){logger[_0xb5c5('0x18')](_0x400d46);}logger[_0xb5c5('0x3c')](_0xb5c5('0x6f'),_0x3130ca[_0xb5c5('0x4d')]);logger[_0xb5c5('0x3c')](_0xb5c5('0x70'),_0x3130ca[_0xb5c5('0x4e')]);return _0x3130ca;});};exports['awsPolly']=function(_0x47be01,_0x5f1c36,_0x8f6bea,_0x5d8087,_0x5b5773,_0x13b2e8){var _0x5d2972=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x3a'));var _0x114ca8;return aws[_0xb5c5('0x71')](_0x47be01,_0x5f1c36,_0x8f6bea,_0x5d8087,_0x5b5773,_0x13b2e8,_0x5d2972)[_0xb5c5('0x37')](function(){_0x114ca8=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x2c'));return convertFile(_0x5d2972,_0x114ca8);})[_0xb5c5('0x37')](function(){try{fs[_0xb5c5('0x20')](_0x5d2972);fs[_0xb5c5('0x2e')](_0x114ca8,'777');}catch(_0x2d996e){logger[_0xb5c5('0x18')](_0x2d996e);}return _0x114ca8[_0xb5c5('0x30')]('.')[0x0];});};exports[_0xb5c5('0x72')]=function(_0x10a59d,_0x483ab5,_0x1b13e3,_0x56b431,_0x6ceca,_0x3ee0fb){return aws['lex'](_0x10a59d,_0x483ab5,_0x1b13e3,_0x56b431,_0x6ceca,_0x3ee0fb)[_0xb5c5('0x37')](function(_0x10baef){logger[_0xb5c5('0x3c')](JSON['stringify'](_0x10baef));return _0x10baef;});};exports[_0xb5c5('0x73')]=function(_0x4cae37,_0x38db21,_0x59fb09,_0x28f109){var _0x117675=util['format'](_0xb5c5('0x74'),ISPEECH_API,_0x4cae37,encodeURIComponent(_0x38db21),_0x59fb09,_0x28f109);var _0x395eac=path[_0xb5c5('0x2b')](__dirname,'tmp',rs['generate'](0x4)+_0xb5c5('0x3a'));var _0x1d0844;return downloadFile(_0x117675,_0x395eac)[_0xb5c5('0x37')](function(){_0x1d0844=path[_0xb5c5('0x2b')](__dirname,_0xb5c5('0x38'),rs['generate'](0x4)+'.wav');return convertFile(_0x395eac,_0x1d0844);})['then'](function(){try{fs[_0xb5c5('0x20')](_0x395eac);fs[_0xb5c5('0x2e')](_0x1d0844,_0xb5c5('0x2f'));}catch(_0x4cc1c4){logger['error'](_0x4cc1c4);}return _0x1d0844['split']('.')[0x0];});};exports['ispeechASR']=function(_0x51a96e,_0x10d231,_0x4cebf5,_0x18abef){var _0x2670c6=util[_0xb5c5('0x75')](_0xb5c5('0x76'),ISPEECH_API,_0x10d231,_0x4cebf5,base64Encode(_0x51a96e),_0x18abef?util[_0xb5c5('0x75')](_0xb5c5('0x77'),encodeURIComponent(_0x18abef)):_0xb5c5('0x78'));return uploadFile(_0x2670c6)['then'](function(_0x3d62f3){return querystring['parse'](_0x3d62f3);});};exports[_0xb5c5('0x79')]=function(_0x29edb1,_0x13af21){return sestek[_0xb5c5('0x7a')](_0x29edb1,_0x13af21)[_0xb5c5('0x37')](function(_0x4e841d){logger[_0xb5c5('0x3c')](JSON[_0xb5c5('0x42')](_0x4e841d));var _0x3d7ee7={'speech':_0x4e841d[_0xb5c5('0x7b')],'action':_0x4e841d[_0xb5c5('0x7c')]?_0x4e841d['channelData'][_0xb5c5('0x7d')]:undefined,'actiondata':_0x4e841d['channelData']?_0x4e841d[_0xb5c5('0x7c')][_0xb5c5('0x7e')]:undefined};if(_0x4e841d['channelData']&&_0x4e841d['channelData'][_0xb5c5('0x7f')]){return base64Decode(_0x4e841d[_0xb5c5('0x7c')][_0xb5c5('0x7f')]['Data'],path[_0xb5c5('0x2b')](__dirname,'tmp',rs[_0xb5c5('0x39')](0x4)+_0xb5c5('0x2c')))[_0xb5c5('0x37')](function(_0x1ebe00){_0x3d7ee7[_0xb5c5('0x80')]=_0x1ebe00;return _0x3d7ee7;});}return _0x3d7ee7;});};exports[_0xb5c5('0x81')]=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 5616f04..cda46a3 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 _0x14b4=['exports'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x14b4,0x15f));var _0x414b=function(_0x559ba1,_0x559c23){_0x559ba1=_0x559ba1-0x0;var _0x231b83=_0x14b4[_0x559ba1];return _0x231b83;};var nda=require('./nda');module[_0x414b('0x0')]={'nda':nda}; \ No newline at end of file +var _0xe667=['exports'];(function(_0xc77311,_0x321f5d){var _0xf29cd9=function(_0x1ae712){while(--_0x1ae712){_0xc77311['push'](_0xc77311['shift']());}};_0xf29cd9(++_0x321f5d);}(_0xe667,0x18a));var _0x7e66=function(_0x5524a6,_0x8aaa35){_0x5524a6=_0x5524a6-0x0;var _0x51b2a6=_0xe667[_0x5524a6];return _0x51b2a6;};var nda=require('./nda');module[_0x7e66('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 c9a8b7b..2fdc5a9 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 _0xf4dd=['Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','password','resolve','ndassistant_url','ndaactivity_type','message'];(function(_0x2d759d,_0x43509f){var _0x52e753=function(_0x3ad5f4){while(--_0x3ad5f4){_0x2d759d['push'](_0x2d759d['shift']());}};_0x52e753(++_0x43509f);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x56baac,_0x3de33a){_0x56baac=_0x56baac-0x0;var _0x5b1c1f=_0xf4dd[_0x56baac];return _0x5b1c1f;};'use strict';var rp=require(_0xdf4d('0x0'));var url=require(_0xdf4d('0x1'));var logger=require(_0xdf4d('0x2'))(_0xdf4d('0x3'));module[_0xdf4d('0x4')]=function(_0x3f6a00,_0x309103){var _0x47d568={'method':_0xdf4d('0x5'),'uri':url['resolve'](_0x309103[_0xdf4d('0x6')],'/token'),'form':{'grant_type':_0xdf4d('0x7'),'username':_0x309103['username'],'password':_0x309103[_0xdf4d('0x7')]},'json':!![]};return rp(_0x47d568)['then'](function(_0x64c256){var _0x4a3e29={'method':_0xdf4d('0x5'),'uri':url[_0xdf4d('0x8')](_0x309103[_0xdf4d('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x309103[_0xdf4d('0xa')]||_0xdf4d('0xb'),'channelId':_0xdf4d('0xc'),'conversation':{'id':_0x3f6a00[_0xdf4d('0xd')]},'from':{'id':_0x3f6a00[_0xdf4d('0xe')],'name':_0x3f6a00[_0xdf4d('0xf')]},'recipient':{'id':_0x3f6a00[_0xdf4d('0x10')],'name':_0x3f6a00[_0xdf4d('0x11')]},'text':_0x309103[_0xdf4d('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x64c256[_0xdf4d('0x13')]},'json':!![]};if(_0x309103[_0xdf4d('0x14')]){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')][_0xdf4d('0x17')]=_0x309103[_0xdf4d('0x14')];}if(_0x309103[_0xdf4d('0x18')]=='1'){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')][_0xdf4d('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xdf4d('0x1a')};}if(_0x309103[_0xdf4d('0x1b')]){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')][_0xdf4d('0x1c')]=_0x309103[_0xdf4d('0x1b')];if(_0x309103[_0xdf4d('0x1d')]){_0x4a3e29[_0xdf4d('0x15')][_0xdf4d('0x16')]['CustomActionData']=_0x309103['custom_action_data'];}}logger[_0xdf4d('0x1e')](JSON[_0xdf4d('0x1f')](_0x4a3e29));return rp(_0x4a3e29);});}; \ No newline at end of file +var _0x261b=['body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','POST','ndauth_url','password','username','then','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','Bearer\x20','access_token','project'];(function(_0x429ead,_0x4e0b10){var _0xed7d87=function(_0x59cccc){while(--_0x59cccc){_0x429ead['push'](_0x429ead['shift']());}};_0xed7d87(++_0x4e0b10);}(_0x261b,0x15a));var _0xb261=function(_0x3d10b5,_0x1a0488){_0x3d10b5=_0x3d10b5-0x0;var _0x5ca566=_0x261b[_0x3d10b5];return _0x5ca566;};'use strict';var rp=require(_0xb261('0x0'));var url=require(_0xb261('0x1'));var logger=require('../../../../../config/logger')('agi');module['exports']=function(_0x48c7f0,_0x392d5c){var _0x5a84d7={'method':_0xb261('0x2'),'uri':url['resolve'](_0x392d5c[_0xb261('0x3')],'/token'),'form':{'grant_type':_0xb261('0x4'),'username':_0x392d5c[_0xb261('0x5')],'password':_0x392d5c[_0xb261('0x4')]},'json':!![]};return rp(_0x5a84d7)[_0xb261('0x6')](function(_0x5740e1){var _0x756381={'method':_0xb261('0x2'),'uri':url[_0xb261('0x7')](_0x392d5c[_0xb261('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x392d5c[_0xb261('0x9')]||_0xb261('0xa'),'channelId':_0xb261('0xb'),'conversation':{'id':_0x48c7f0[_0xb261('0xc')]},'from':{'id':_0x48c7f0[_0xb261('0xd')],'name':_0x48c7f0[_0xb261('0xe')]},'recipient':{'id':_0x48c7f0['dnid'],'name':_0x48c7f0['extension']},'text':_0x392d5c['text'],'channelData':{}},'headers':{'Authorization':_0xb261('0xf')+_0x5740e1[_0xb261('0x10')]},'json':!![]};if(_0x392d5c[_0xb261('0x11')]){_0x756381[_0xb261('0x12')][_0xb261('0x13')][_0xb261('0x14')]=_0x392d5c['project'];}if(_0x392d5c['ndagenerate_audio']=='1'){_0x756381[_0xb261('0x12')][_0xb261('0x13')][_0xb261('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb261('0x16')};}if(_0x392d5c[_0xb261('0x17')]){_0x756381[_0xb261('0x12')][_0xb261('0x13')][_0xb261('0x18')]=_0x392d5c[_0xb261('0x17')];if(_0x392d5c[_0xb261('0x19')]){_0x756381[_0xb261('0x12')][_0xb261('0x13')]['CustomActionData']=_0x392d5c[_0xb261('0x19')];}}logger[_0xb261('0x1a')](JSON[_0xb261('0x1b')](_0x756381));return rp(_0x756381);});}; \ 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 07cf61e..55963cf 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 _0x4908=['exports','./lib/api'];(function(_0x28ee1a,_0x5e80f3){var _0x9ca99f=function(_0x4b309e){while(--_0x4b309e){_0x28ee1a['push'](_0x28ee1a['shift']());}};_0x9ca99f(++_0x5e80f3);}(_0x4908,0x125));var _0x8490=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x4908[_0x3fba9f];return _0x192cf1;};'use strict';var asr=require(_0x8490('0x0'));module[_0x8490('0x1')]=function(_0x185a54,_0x270cc5,_0x5001b2,_0x3dd971){return asr(_0x185a54,_0x270cc5,_0x5001b2,_0x3dd971);}; \ No newline at end of file +var _0xf19c=['exports','./lib/api'];(function(_0x315aca,_0x2d2896){var _0x4483b9=function(_0x6ead02){while(--_0x6ead02){_0x315aca['push'](_0x315aca['shift']());}};_0x4483b9(++_0x2d2896);}(_0xf19c,0x10b));var _0xcf19=function(_0x568e52,_0x1c1a97){_0x568e52=_0x568e52-0x0;var _0x4467da=_0xf19c[_0x568e52];return _0x4467da;};'use strict';var asr=require(_0xcf19('0x0'));module[_0xcf19('0x1')]=function(_0x42955a,_0x58b105,_0x34fc5c,_0x462df1){return asr(_0x42955a,_0x58b105,_0x34fc5c,_0x462df1);}; \ 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 dcb46a7..4234915 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 _0xe094=['moment','crypto','../../../../../../config/logger','agi','exports','info','createHash','sha1','update','digest','hex','unix','send','stringify','close','error','Tilde\x20ASR\x20send\x20error','parse','status','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','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','isObject','open','message','bluebird','lodash'];(function(_0x2fa021,_0x122a26){var _0x585f7d=function(_0x4a5f59){while(--_0x4a5f59){_0x2fa021['push'](_0x2fa021['shift']());}};_0x585f7d(++_0x122a26);}(_0xe094,0x166));var _0x4e09=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe094[_0x138adb];return _0x1b27f2;};'use strict';var BPromise=require(_0x4e09('0x0'));var _=require(_0x4e09('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4e09('0x2'));var crypto=require(_0x4e09('0x3'));var logger=require(_0x4e09('0x4'))(_0x4e09('0x5'));module[_0x4e09('0x6')]=function(_0x5f1bc8,_0xb58804,_0x5b694d,_0x11e4b8){return new BPromise(function(_0x50eb74,_0x22622d){logger[_0x4e09('0x7')]('Tilde\x20URI',_0x11e4b8||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x130cfd=new WebSocket(_0x11e4b8||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3eccba='';var _0x505f5b='0';var _0x4a1354='1';var _0x418e5c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x343aad(_0x23db61){var _0xc19409=crypto[_0x4e09('0x8')](_0x4e09('0x9'));_0xc19409[_0x4e09('0xa')](_0x23db61);return _0xc19409[_0x4e09('0xb')](_0x4e09('0xc'));}function _0x41fa3b(){try{logger[_0x4e09('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x2fd419=moment()[_0x4e09('0xd')]();var _0x2b583e=_0x343aad(_0x2fd419+_0xb58804+_0x5b694d);_0x130cfd[_0x4e09('0xe')](JSON[_0x4e09('0xf')]({'appID':_0xb58804,'timestamp':_0x2fd419,'appKey':_0x2b583e}));var _0x371474=fs['createReadStream'](_0x5f1bc8);_0x371474['on']('data',function(_0x432c5a){_0x130cfd['send'](_0x432c5a);});_0x371474['on'](_0x4e09('0x10'),function(){_0x130cfd[_0x4e09('0xe')]('EOS');});}catch(_0x5bbe9b){logger[_0x4e09('0x11')](_0x4e09('0x12'),JSON['stringify'](_0x5bbe9b));_0x130cfd['terminate']();}}function _0x18fd13(_0x39b9dd){try{if(_0x39b9dd){var _0x371275=JSON[_0x4e09('0x13')](_0x39b9dd);switch(_0x371275[_0x4e09('0x14')]){case 0x0:if(_0x371275['result']){if(_0x371275['result'][_0x4e09('0x15')]){logger[_0x4e09('0x7')](_0x4e09('0x16'),JSON[_0x4e09('0xf')](_0x371275[_0x4e09('0x17')][_0x4e09('0x18')]));_0x3eccba=_0x371275[_0x4e09('0x17')]['hypotheses'][0x0][_0x4e09('0x19')];_0x505f5b=_0x371275['result'][_0x4e09('0x18')][0x0]['likelihood'];_0x4a1354='0';_0x418e5c='Success.';_0x130cfd['terminate']();}}break;case 0x1:logger[_0x4e09('0x7')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4a1354='1';_0x418e5c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x4e09('0x7')](_0x4e09('0x1a'));_0x4a1354='2';_0x418e5c=_0x4e09('0x1a');break;case 0x9:logger[_0x4e09('0x7')](_0x4e09('0x1b'));_0x4a1354='9';_0x418e5c=_0x4e09('0x1b');break;case 0xa:logger[_0x4e09('0x7')]('Authentication\x20failed.');_0x4a1354='10';_0x418e5c=_0x4e09('0x1c');break;case 0xb:logger['info'](_0x4e09('0x1d'));_0x4a1354='11';_0x418e5c=_0x4e09('0x1d');}}}catch(_0x5f0fde){logger['error'](_0x4e09('0x1e'),JSON[_0x4e09('0xf')](_0x5f0fde));_0x130cfd[_0x4e09('0x1f')]();}}function _0x1995d5(){logger[_0x4e09('0x7')](_0x4e09('0x20'));_0x50eb74({'transcript':_0x3eccba,'confidence':_0x505f5b,'status':_0x4a1354,'status_message':_0x418e5c});}function _0x1b016f(_0x5666c2){logger[_0x4e09('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x5666c2)){logger[_0x4e09('0x11')](_[_0x4e09('0x21')](_0x5666c2)?JSON[_0x4e09('0xf')](_0x5666c2):_0x5666c2);}}_0x130cfd['on'](_0x4e09('0x22'),_0x41fa3b);_0x130cfd['on'](_0x4e09('0x23'),_0x18fd13);_0x130cfd['on'](_0x4e09('0x10'),_0x1995d5);_0x130cfd['on']('error',_0x1b016f);});}; \ No newline at end of file +var _0x0292=['data','send','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x0292,0xbc));var _0x2029=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0x0292[_0x8a7e38];return _0x228609;};'use strict';var BPromise=require(_0x2029('0x0'));var _=require(_0x2029('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2029('0x2'));var crypto=require('crypto');var logger=require(_0x2029('0x3'))(_0x2029('0x4'));module[_0x2029('0x5')]=function(_0x1b61a4,_0x1db0ac,_0x4dad74,_0x1a8359){return new BPromise(function(_0x3f74d3,_0x1aeb01){logger['info'](_0x2029('0x6'),_0x1a8359||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x62257d=new WebSocket(_0x1a8359||_0x2029('0x7'),{'perMessageDeflate':![]});var _0x843202='';var _0x11795e='0';var _0x29b260='1';var _0x2ac3ef=_0x2029('0x8');function _0x407693(_0x4c0da2){var _0x595e99=crypto[_0x2029('0x9')]('sha1');_0x595e99[_0x2029('0xa')](_0x4c0da2);return _0x595e99[_0x2029('0xb')]('hex');}function _0x599c8a(){try{logger[_0x2029('0xc')](_0x2029('0xd'));var _0x55359c=moment()[_0x2029('0xe')]();var _0x268ee0=_0x407693(_0x55359c+_0x1db0ac+_0x4dad74);_0x62257d['send'](JSON[_0x2029('0xf')]({'appID':_0x1db0ac,'timestamp':_0x55359c,'appKey':_0x268ee0}));var _0xb45278=fs[_0x2029('0x10')](_0x1b61a4);_0xb45278['on'](_0x2029('0x11'),function(_0x1a0a52){_0x62257d[_0x2029('0x12')](_0x1a0a52);});_0xb45278['on']('close',function(){_0x62257d[_0x2029('0x12')]('EOS');});}catch(_0x283efd){logger[_0x2029('0x13')](_0x2029('0x14'),JSON[_0x2029('0xf')](_0x283efd));_0x62257d['terminate']();}}function _0x4b85bc(_0xc69f5){try{if(_0xc69f5){var _0x4d8265=JSON[_0x2029('0x15')](_0xc69f5);switch(_0x4d8265[_0x2029('0x16')]){case 0x0:if(_0x4d8265[_0x2029('0x17')]){if(_0x4d8265[_0x2029('0x17')][_0x2029('0x18')]){logger[_0x2029('0xc')](_0x2029('0x19'),JSON[_0x2029('0xf')](_0x4d8265[_0x2029('0x17')][_0x2029('0x1a')]));_0x843202=_0x4d8265[_0x2029('0x17')]['hypotheses'][0x0][_0x2029('0x1b')];_0x11795e=_0x4d8265['result'][_0x2029('0x1a')][0x0]['likelihood'];_0x29b260='0';_0x2ac3ef='Success.';_0x62257d[_0x2029('0x1c')]();}}break;case 0x1:logger['info'](_0x2029('0x8'));_0x29b260='1';_0x2ac3ef='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x2029('0x1d'));_0x29b260='2';_0x2ac3ef=_0x2029('0x1d');break;case 0x9:logger[_0x2029('0xc')](_0x2029('0x1e'));_0x29b260='9';_0x2ac3ef='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x2029('0xc')](_0x2029('0x1f'));_0x29b260='10';_0x2ac3ef='Authentication\x20failed.';break;case 0xb:logger[_0x2029('0xc')](_0x2029('0x20'));_0x29b260='11';_0x2ac3ef=_0x2029('0x20');}}}catch(_0x18bb42){logger['error'](_0x2029('0x21'),JSON['stringify'](_0x18bb42));_0x62257d['terminate']();}}function _0x1d6d15(){logger['info'](_0x2029('0x22'));_0x3f74d3({'transcript':_0x843202,'confidence':_0x11795e,'status':_0x29b260,'status_message':_0x2ac3ef});}function _0x3063f7(_0x51411f){logger['error'](_0x2029('0x23'));if(!_[_0x2029('0x24')](_0x51411f)){logger[_0x2029('0x13')](_[_0x2029('0x25')](_0x51411f)?JSON['stringify'](_0x51411f):_0x51411f);}}_0x62257d['on'](_0x2029('0x26'),_0x599c8a);_0x62257d['on'](_0x2029('0x27'),_0x4b85bc);_0x62257d['on'](_0x2029('0x28'),_0x1d6d15);_0x62257d['on'](_0x2029('0x13'),_0x3063f7);});}; \ 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 0e44c62..207c8bb 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 _0x3aaf=['exports','./asr'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x3aaf,0xe3));var _0xf3aa=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x3aaf[_0x2576d7];return _0x16a08c;};var asr=require(_0xf3aa('0x0'));module[_0xf3aa('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd204=['exports','./asr'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xd204,0xe3));var _0x4d20=function(_0x3e635b,_0x2c02c6){_0x3e635b=_0x3e635b-0x0;var _0x3160eb=_0xd204[_0x3e635b];return _0x3160eb;};var asr=require(_0x4d20('0x0'));module[_0x4d20('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e445fda..c6eceaa 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x5dbdfd,_0x1aef80){var _0x3db2e9=function(_0x344f0b){while(--_0x344f0b){_0x5dbdfd['push'](_0x5dbdfd['shift']());}};_0x3db2e9(++_0x1aef80);}(_0x34e8,0x12c));var _0x834e=function(_0x13162b,_0x12ecae){_0x13162b=_0x13162b-0x0;var _0x3ff54d=_0x34e8[_0x13162b];return _0x3ff54d;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 15dfaf8..0e74825 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 _0xed1f=['pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','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','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','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','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariable','name','getVoiceQueueById','catch','prototype','getSquareProjectById','getSquareOdbc','then','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','noop','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','.wav','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','no\x20find\x20by\x20configured','success','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','output'];(function(_0x1a450a,_0x4dcb72){var _0x4f8ef4=function(_0x44c6ba){while(--_0x44c6ba){_0x1a450a['push'](_0x1a450a['shift']());}};_0x4f8ef4(++_0x4dcb72);}(_0xed1f,0x6a));var _0xfed1=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xed1f[_0x45d3f0];return _0x314b79;};'use strict';var fs=require('fs');var util=require(_0xfed1('0x0'));var _=require(_0xfed1('0x1'));var sh=require(_0xfed1('0x2'));var odbc=require(_0xfed1('0x3'))();var rs=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var Mustache=require(_0xfed1('0x6'));var rp=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var scripts=require(_0xfed1('0xb'));var FILES_PATH=_0xfed1('0xc');var recursiveMapAttributes=[_0xfed1('0xd'),_0xfed1('0xe')];var verticesWithRetry=[_0xfed1('0xf'),_0xfed1('0x10'),_0xfed1('0x11')];var AGIVertices=function(_0x568d48,_0x42dd5c,_0x305d19){this['channel']=_0x568d48;this[_0xfed1('0x12')]=_0x42dd5c;this[_0xfed1('0x13')]=_0x305d19;};AGIVertices['prototype'][_0xfed1('0x14')]=function(_0x48c338,_0x1c3f40){this[_0xfed1('0x12')]['getVariableById'](_0x48c338)['then'](function(_0x3d1891){_0x1c3f40(null,_0x3d1891?_0x3d1891[_0xfed1('0x15')]:![]);})['catch'](function(_0x17f4fe){_0x1c3f40(_0x17f4fe);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x3f6555,_0x397af9){this['rpc'][_0xfed1('0x16')](_0x3f6555)['then'](function(_0x4cd9d1){_0x397af9(null,_0x4cd9d1?_0x4cd9d1[_0xfed1('0x15')]:![]);})[_0xfed1('0x17')](function(_0x1fbb7a){_0x397af9(_0x1fbb7a);});};AGIVertices[_0xfed1('0x18')]['getSquareProject']=function(_0x1a00f6,_0x4af928){this[_0xfed1('0x12')][_0xfed1('0x19')](_0x1a00f6)['then'](function(_0x3d0517){_0x4af928(null,_0x3d0517?_0x3d0517[_0xfed1('0x15')]:![]);})['catch'](function(_0x59509b){_0x4af928(_0x59509b);});};AGIVertices['prototype'][_0xfed1('0x1a')]=function(_0x51f12a,_0x201f18){this[_0xfed1('0x12')]['getSquareOdbcById'](_0x51f12a)[_0xfed1('0x1b')](function(_0x65f14b){_0x201f18(null,_0x65f14b?_0x65f14b['dsn']:![]);})[_0xfed1('0x17')](function(_0x2ea7a8){_0x201f18(_0x2ea7a8);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1c')]=function(_0x4bac79,_0x203cec){this['rpc'][_0xfed1('0x1d')](_0x4bac79)[_0xfed1('0x1b')](function(_0x37c384){_0x203cec(null,_0x37c384?_0x37c384['name']:![]);})[_0xfed1('0x17')](function(_0x594917){_0x203cec(_0x594917);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1e')]=function(_0x1b7b22,_0x365bae){this[_0xfed1('0x12')][_0xfed1('0x1f')](_0x1b7b22)['then'](function(_0x465ce6){_0x365bae(null,_0x465ce6?_0x465ce6[_0xfed1('0x15')]:![]);})['catch'](function(_0x1d6c72){_0x365bae(_0x1d6c72);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x20')]=function(_0x1d62c5,_0x3b9122){var _0x1761d1=this;this['rpc'][_0xfed1('0x21')](_0x1d62c5)['then'](function(_0x3106ee){_0x3b9122(null,_0x3106ee?_0x1761d1['getSoundPath'](_0x3106ee['save_name']):![]);})[_0xfed1('0x17')](function(_0x42c950){_0x3b9122(_0x42c950);});};AGIVertices[_0xfed1('0x18')]['getMailAccount']=function(_0x18e4e7,_0x437a25){this[_0xfed1('0x12')][_0xfed1('0x22')](_0x18e4e7)[_0xfed1('0x1b')](function(_0x30272b){_0x437a25(null,_0x30272b?_0x30272b:![]);})['catch'](function(_0x17e1e7){_0x437a25(_0x17e1e7);});};AGIVertices[_0xfed1('0x18')]['sendMailMessage']=function(_0x47a90c,_0x28bd98,_0x2d10f5){this[_0xfed1('0x13')][_0xfed1('0x23')](_0x47a90c,_0x28bd98)[_0xfed1('0x1b')](function(){_0x2d10f5(null);})['catch'](function(_0xecd1ec){_0x2d10f5(_0xecd1ec);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x24')]=function(_0x349de1,_0xa4c53c){this['rpc'][_0xfed1('0x25')](_0x349de1)['then'](function(_0x11c5bd){if(_0x11c5bd){if(_0x11c5bd[_0xfed1('0x26')]){_0xa4c53c(null,[_0x11c5bd[_0xfed1('0x27')]]);}else{_0xa4c53c(null,_[_0xfed1('0x28')](_0x11c5bd[_0xfed1('0x29')],_0xfed1('0x27')));}}else{_0xa4c53c(null,![]);}})[_0xfed1('0x17')](function(_0x41bf2a){_0xa4c53c(_0x41bf2a);});};AGIVertices['prototype'][_0xfed1('0x2a')]=function(_0x46268a){return util[_0xfed1('0x2b')](_0xfed1('0x2c'),FILES_PATH,_0x46268a);};AGIVertices['prototype']['getQueryOdbc']=function(_0x42d5df,_0x3c026d,_0x1d06af){odbc[_0xfed1('0x2d')](_0x42d5df,function(_0x46a466){if(_0x46a466){logger[_0xfed1('0x2e')](_0xfed1('0x2f'),_0x46a466);_0x1d06af(_0x46a466);}else{logger[_0xfed1('0x30')]('ODBC\x20connection\x20successfully');odbc['query'](_0x3c026d,function(_0x23f75f,_0x2f6250){if(_0x23f75f){logger['info'](_0xfed1('0x31'),_0x3c026d);_0x1d06af(_0x23f75f);}else{logger[_0xfed1('0x30')](_0xfed1('0x32'),_0x3c026d);odbc[_0xfed1('0x33')](function(_0x2807c){if(_0x2807c){logger[_0xfed1('0x2e')](_0xfed1('0x34'),_0x2807c);}_0x1d06af(null,_0x2f6250);});}});}});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x35')]=function(_0x5f3e1f,_0x4eec55){this['rpc'][_0xfed1('0x36')](_0x5f3e1f)[_0xfed1('0x1b')](function(_0x2f8f08){_0x4eec55(null,_0x2f8f08?_0x2f8f08:![]);})['catch'](function(_0x3454e6){_0x4eec55(_0x3454e6);});};AGIVertices['prototype'][_0xfed1('0x37')]=function(_0x2cfdca,_0x2f4e0f){this['rpc'][_0xfed1('0x37')](_0x2cfdca)[_0xfed1('0x1b')](function(_0x422433){_0x2f4e0f(null,_0x422433);})['catch'](function(_0x1b53de){_0x2f4e0f(_0x1b53de);});};AGIVertices['prototype'][_0xfed1('0x38')]=function(_0xf1f739,_0x229fc7,_0x13c087){this[_0xfed1('0x12')][_0xfed1('0x38')]({'uniqueid':this[_0xfed1('0x39')][_0xfed1('0x3a')],'node':_0xf1f739[_0xfed1('0x3b')],'application':_0xf1f739['agicommand'],'data':_0x229fc7||null,'project_name':this[_0xfed1('0x39')][_0xfed1('0x3c')],'callerid':this[_0xfed1('0x39')]['callerid']})['then'](function(_0x3eae01){if(_0x13c087){_0x13c087(null,_0x3eae01);}})[_0xfed1('0x17')](function(_0x46f9d3){if(_0x13c087){_0x13c087(_0x46f9d3);}});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x3d')]=function(_0x191278,_0x2547ee,_0x24bf7a,_0x221763){this[_0xfed1('0x12')][_0xfed1('0x3d')]({'uniqueid':this[_0xfed1('0x39')]['uniqueid'],'callerid':this[_0xfed1('0x39')][_0xfed1('0x3e')],'calleridname':this[_0xfed1('0x39')][_0xfed1('0x3f')],'context':this[_0xfed1('0x39')][_0xfed1('0x40')],'extension':this['channel'][_0xfed1('0x41')],'priority':this[_0xfed1('0x39')][_0xfed1('0x42')],'accountcode':this['channel'][_0xfed1('0x43')],'dnid':this[_0xfed1('0x39')][_0xfed1('0x44')],'projectName':this[_0xfed1('0x39')]['arg_1'],'saveName':_0x2547ee,'filename':_0x191278[_0xfed1('0x45')]||_0x2547ee,'savePath':_0x24bf7a})[_0xfed1('0x1b')](function(_0x2c32af){_0x221763(null,_0x2c32af);})[_0xfed1('0x17')](function(_0x14745e){_0x221763(_0x14745e);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x46')]=function(_0x18d761,_0x2365db,_0x326f68,_0xa0515c,_0xb3a534){this[_0xfed1('0x12')][_0xfed1('0x46')]({'uniqueid':this[_0xfed1('0x39')][_0xfed1('0x3a')],'body':_0x18d761,'direction':_0x2365db,'providerName':_0x326f68,'providerResponse':_0xa0515c})[_0xfed1('0x1b')](function(_0x270321){if(_0xb3a534){_0xb3a534(null,_0x270321);}})['catch'](function(_0x589feb){if(_0xb3a534){_0xb3a534(_0x589feb);}});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x47')]=function(_0x5be0c3,_0x1358c1){this['rpc'][_0xfed1('0x47')]({'firstName':_[_0xfed1('0x48')](_0x5be0c3['name'])||_['isNil'](_0x5be0c3['name'])?_0xfed1('0x49')+Math[_0xfed1('0x4a')]():_0x5be0c3[_0xfed1('0x15')],'lastName':_[_0xfed1('0x48')](_0x5be0c3[_0xfed1('0x4b')])||_[_0xfed1('0x4c')](_0x5be0c3[_0xfed1('0x4b')])?null:_0x5be0c3[_0xfed1('0x4b')],'phone':_0x5be0c3[_0xfed1('0x4d')],'ListId':_0x5be0c3[_0xfed1('0x4e')],'scheduledat':_0x5be0c3['scheduledAt'],'callbackUniqueid':this['channel'][_0xfed1('0x3a')],'tags':_0xfed1('0x4f'),'description':_0xfed1('0x50')+_0x5be0c3[_0xfed1('0x51')][_0xfed1('0x52')](),'priority':_0x5be0c3[_0xfed1('0x53')]})[_0xfed1('0x1b')](function(_0x3754df){_0x1358c1(null,_0x3754df);})[_0xfed1('0x17')](function(_0x427fa6){_0x1358c1(_0x427fa6);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x54')]=function(_0x430d71,_0x396e54){this[_0xfed1('0x12')][_0xfed1('0x55')](_0x430d71)[_0xfed1('0x1b')](function(_0x54eb53){_0x396e54(null,_0x54eb53?_0x54eb53['name']:![]);})[_0xfed1('0x17')](function(_0x10d831){_0x396e54(_0x10d831);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x56')]=function(_0x23a4f0,_0x41a22a,_0x2ccdc3){var _0xea879f={'role':_0xfed1('0x57')};_0xea879f[_0x23a4f0]=this[_0xfed1('0x39')][_0xfed1('0x3e')];this[_0xfed1('0x12')][_0xfed1('0x56')](_0xea879f,_0x41a22a,this[_0xfed1('0x39')]['uniqueid'])[_0xfed1('0x1b')](function(_0x562c7e){_0x2ccdc3(null,_['isNil'](_0x562c7e)?![]:!![]);})[_0xfed1('0x17')](function(_0x56bc65){logger[_0xfed1('0x2e')](_0x56bc65);_0x2ccdc3(null,![]);});};AGIVertices['prototype'][_0xfed1('0x58')]=function(_0x8e29d1,_0x53f0ab){var _0x373214={'role':_0xfed1('0x57')};_0x373214[_0x8e29d1]=this['channel'][_0xfed1('0x3e')];this[_0xfed1('0x12')][_0xfed1('0x58')](_0x373214)[_0xfed1('0x1b')](function(_0x59a23a){_0x53f0ab(null,_[_0xfed1('0x4c')](_0x59a23a)?![]:!![]);})[_0xfed1('0x17')](function(_0x1e0902){logger[_0xfed1('0x2e')](_0x1e0902);_0x53f0ab(null,![]);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x59')]=function(_0x11acbf,_0x142510){var _0x5c043d={'role':_0xfed1('0x57')};_0x5c043d[_0x11acbf]=this[_0xfed1('0x39')][_0xfed1('0x3e')];this[_0xfed1('0x12')][_0xfed1('0x59')](_0x5c043d)[_0xfed1('0x1b')](function(_0x53b7ed){_0x142510(null,_['isNil'](_0x53b7ed)?![]:!![]);})['catch'](function(_0x33a479){logger[_0xfed1('0x2e')](_0x33a479);_0x142510(null,![]);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x5a')]=function(_0x4aaba6,_0x1910e5){var _0x5dfc52={'role':_0xfed1('0x57')};_0x5dfc52[_0x4aaba6]=this[_0xfed1('0x39')][_0xfed1('0x3e')];var _0x3beef3=_0x4aaba6!=_0xfed1('0x5b')?util['format'](_0xfed1('0x5c'),_0xfed1('0x5d'),this[_0xfed1('0x39')]['callerid']):undefined;this[_0xfed1('0x12')][_0xfed1('0x5a')](_0x5dfc52,_0x3beef3)[_0xfed1('0x1b')](function(_0xfc7b29){_0x1910e5(null,_['isNil'](_0xfc7b29)?![]:!![]);})[_0xfed1('0x17')](function(_0x598dfe){logger[_0xfed1('0x2e')](_0x598dfe);_0x1910e5(null,![]);});};AGIVertices[_0xfed1('0x18')]['shellCommand']=function(_0x480c52,_0x43b172){sh[_0xfed1('0x5e')](_[_0xfed1('0x5f')](_0x480c52),function(_0x2ee25f,_0x4f3a4b){var _0x320d54=_0x4f3a4b[_0xfed1('0x60')](/(\r\n|\n|\r)/gm,'');_0x43b172(null,_0x320d54);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x61')]=function(_0x6f174e,_0x1cb73e){scripts['googleCloudTTS'](_0x6f174e[_0xfed1('0x62')],_0x6f174e[_0xfed1('0x63')]||'text',_0x6f174e[_0xfed1('0x64')],_0x6f174e[_0xfed1('0x65')]||_0xfed1('0x66'),_0x6f174e[_0xfed1('0x67')]||_0xfed1('0x68'),_0x6f174e[_0xfed1('0x69')]||'MP3')['then'](function(_0x192e8a){_0x1cb73e(null,_0x192e8a);})['catch'](function(_0x3a914b){_0x1cb73e(_0x3a914b);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x6a')]=function(_0xdc237c,_0x23ee6f){scripts[_0xfed1('0x6a')](_0xdc237c[_0xfed1('0x64')],_0xdc237c[_0xfed1('0x6b')]||'en',0x1)[_0xfed1('0x1b')](function(_0x4104fe){_0x23ee6f(null,_0x4104fe);})['catch'](function(_0x20d749){_0x23ee6f(_0x20d749);});};AGIVertices[_0xfed1('0x18')]['restAPI']=function(_0x544605,_0x2d6692){var _0x51994d={'uri':_0x544605[_0xfed1('0x6c')],'method':_0x544605[_0xfed1('0x6d')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x544605[_0xfed1('0x6e')])==='number'&&parseInt(_0x544605[_0xfed1('0x6e')])>=0x1?parseInt(_0x544605[_0xfed1('0x6e')])*0x3e8:0x5*0x3e8};if(_[_0xfed1('0x6f')]([_0xfed1('0x70'),_0xfed1('0x71')],_0x51994d['method'][_0xfed1('0x72')]())){try{_0x51994d[_0xfed1('0x73')]=_0x544605[_0xfed1('0xe')]?JSON[_0xfed1('0x74')](_0x544605[_0xfed1('0xe')]):{};}catch(_0x5b1ab9){logger[_0xfed1('0x2e')](_0xfed1('0x75'),_0x5b1ab9);}}try{_0x51994d[_0xfed1('0x76')]=_0x544605[_0xfed1('0xd')]?JSON[_0xfed1('0x74')](_0x544605[_0xfed1('0xd')]):{};}catch(_0x111d0d){logger[_0xfed1('0x2e')](_0xfed1('0x77'),_0x111d0d);}if(_0x544605[_0xfed1('0x78')]){try{var _0x4cf7e8=require(_0x544605[_0xfed1('0x78')])[_0xfed1('0x79')](this,_0x51994d);_0x51994d[_0xfed1('0x7a')]=Mustache[_0xfed1('0x7b')](_0x544605[_0xfed1('0x6c')],_0x4cf7e8,{},['$$','$$']);if(_0x51994d['headers']){_0x51994d[_0xfed1('0x76')]=JSON[_0xfed1('0x74')](Mustache[_0xfed1('0x7b')](JSON[_0xfed1('0x7c')](_0x51994d[_0xfed1('0x76')]),_0x4cf7e8,{},['$$','$$']));}if(_0x51994d[_0xfed1('0x73')]){_0x51994d[_0xfed1('0x73')]=JSON[_0xfed1('0x74')](Mustache[_0xfed1('0x7b')](JSON['stringify'](_0x51994d['body']),_0x4cf7e8,{},['$$','$$']));}}catch(_0xc3b72a){logger['error'](_0xfed1('0x7d'),_0xc3b72a);}}rp(_0x51994d)[_0xfed1('0x1b')](function(_0x483b16){var _0x4b355d={'statusCode':_0x483b16['statusCode']||0xc8,'statusMessage':_0x483b16[_0xfed1('0x7e')]||'OK','headers':_0x483b16['headers']||{},'body':_0x483b16[_0xfed1('0x73')]||{}};_0x2d6692(null,_0x4b355d);})['catch'](function(_0x104735){var _0x258322={'statusCode':_0x104735[_0xfed1('0x7f')]||0x1f4,'statusMessage':_0x104735[_0xfed1('0x80')]||_0xfed1('0x81'),'headers':_0x104735['options'][_0xfed1('0x76')]||{},'body':_0x104735[_0xfed1('0x82')]['body']||{}};_0x2d6692(null,_0x258322);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x83')]=function(_0x4f879d,_0x12ce90){scripts[_0xfed1('0x83')](this[_0xfed1('0x39')]['uniqueid'],_0x4f879d[_0xfed1('0x84')],_0x4f879d[_0xfed1('0x64')],_0x4f879d['dialogflow_language']||'en')[_0xfed1('0x1b')](function(_0xc81c8f){_0x12ce90(null,_0xc81c8f);})[_0xfed1('0x17')](function(_0x4ea8bd){_0x12ce90(_0x4ea8bd);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x85')]=function(_0x49f600,_0x48172c){scripts[_0xfed1('0x85')](this[_0xfed1('0x39')][_0xfed1('0x3a')],_0x49f600[_0xfed1('0x86')],_0x49f600[_0xfed1('0x87')],_0x49f600[_0xfed1('0x88')],_0x49f600[_0xfed1('0x64')],_0x49f600[_0xfed1('0x89')]||'en')[_0xfed1('0x1b')](function(_0x36875f){_0x48172c(null,_0x36875f);})[_0xfed1('0x17')](function(_0x1cc77b){_0x48172c(_0x1cc77b);});};AGIVertices['prototype'][_0xfed1('0x8a')]=function(_0x3cac55,_0x52d9f6){scripts[_0xfed1('0x8a')](this[_0xfed1('0x39')],_0x3cac55)['then'](function(_0x3d4aee){_0x52d9f6(null,_0x3d4aee);})[_0xfed1('0x17')](function(_0x6764b1){_0x52d9f6(_0x6764b1);});};AGIVertices[_0xfed1('0x18')]['ispeechTTS']=function(_0x306b86,_0x24ab18){scripts[_0xfed1('0x8b')](_0x306b86[_0xfed1('0x84')],_0x306b86[_0xfed1('0x64')],_0x306b86[_0xfed1('0x8c')]||_0xfed1('0x66'),_0x306b86[_0xfed1('0x8d')])['then'](function(_0x4052f8){_0x24ab18(null,_0x4052f8);})[_0xfed1('0x17')](function(_0x42c7d2){_0x24ab18(_0x42c7d2);});};AGIVertices['prototype'][_0xfed1('0x8e')]=function(_0x3f2091,_0x45a677,_0x53d0fc){scripts['ispeechASR'](_0x45a677,_0x3f2091[_0xfed1('0x84')],_0x3f2091[_0xfed1('0x8f')]||_0xfed1('0x66'),this[_0xfed1('0x90')](_0x3f2091[_0xfed1('0x91')])?_0x3f2091[_0xfed1('0x91')]:undefined)[_0xfed1('0x1b')](function(_0x3fc747){_0x53d0fc(null,_0x3fc747);})[_0xfed1('0x17')](function(_0x3588d2){_0x53d0fc(_0x3588d2);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x92')]=function(_0xb0a30e,_0x18b086){scripts[_0xfed1('0x92')](_0xb0a30e[_0xfed1('0x93')],_0xb0a30e[_0xfed1('0x94')],_0xb0a30e[_0xfed1('0x95')],_0xb0a30e[_0xfed1('0x96')]||_0xfed1('0x97'),_0xb0a30e['text'],_0xb0a30e[_0xfed1('0x98')]||_0xfed1('0x64'))[_0xfed1('0x1b')](function(_0x548839){_0x18b086(null,_0x548839);})[_0xfed1('0x17')](function(_0x26a5d4){_0x18b086(_0x26a5d4);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x99')]=function(_0x253f62,_0x28d1a8){scripts[_0xfed1('0x99')](this['channel']['uniqueid'],_0x253f62[_0xfed1('0x93')],_0x253f62[_0xfed1('0x94')],_0x253f62[_0xfed1('0x9a')],_0x253f62['text'],_0x253f62[_0xfed1('0x9b')])[_0xfed1('0x1b')](function(_0x1a158b){_0x28d1a8(null,_0x1a158b);})['catch'](function(_0x313261){_0x28d1a8(_0x313261);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x9c')]=function(_0xb6c7d1,_0x3b5381,_0x4a17d5){scripts['googleASR'](_0x3b5381,_0xb6c7d1[_0xfed1('0x84')],_0xb6c7d1[_0xfed1('0x9d')]||'en-US')['then'](function(_0x17c0d0){_0x4a17d5(null,_0x17c0d0);})[_0xfed1('0x17')](function(_0xb1ec32){_0x4a17d5(_0xb1ec32);});};AGIVertices[_0xfed1('0x18')][_0xfed1('0x9e')]=function(_0x3d9838,_0x523f67,_0x16276e){scripts[_0xfed1('0x9e')](_0x523f67,_0x3d9838[_0xfed1('0x9f')],_0x3d9838[_0xfed1('0xa0')],_0x3d9838[_0xfed1('0x7a')])['then'](function(_0x2b9d5c){_0x16276e(null,_0x2b9d5c);})['catch'](function(_0xe1f7f6){_0x16276e(_0xe1f7f6);});};AGIVertices['prototype']['clear']=function(_0x5d6b5a){var _0x538112=_[_0xfed1('0x6f')](verticesWithRetry,_0x5d6b5a[_0xfed1('0xa1')])?_0x5d6b5a:_[_0xfed1('0xa2')](_0x5d6b5a);for(var _0x577159 in _0x538112){if(_0x538112[_0xfed1('0xa3')](_0x577159)){if(_0x538112[_0x577159]&&_[_0xfed1('0xa4')](_0x538112[_0x577159])){if(_[_0xfed1('0x6f')](recursiveMapAttributes,_0x577159)){_0x538112[_0x577159]=this[_0xfed1('0xa5')](_0x538112[_0x577159]);}else{_0x538112[_0x577159]=this[_0xfed1('0xa6')](_0x538112[_0x577159]);}}}}return _0x538112;};AGIVertices[_0xfed1('0x18')]['recursiveNodeIndex']=function(_0x8b9fd4){for(var _0x21518e in _0x8b9fd4){if(_0x8b9fd4[_0xfed1('0xa3')](_0x21518e)){if(_[_0xfed1('0xa7')](_0x8b9fd4[_0x21518e])){this[_0xfed1('0xa8')](_0x8b9fd4[_0x21518e]);}else if(_[_0xfed1('0xa9')](_0x8b9fd4[_0x21518e])){for(var _0x2d7458=0x0;_0x2d7458<_0x8b9fd4[_0x21518e]['length'];_0x2d7458++){this[_0xfed1('0xa8')](_0x8b9fd4[_0x21518e][_0x2d7458]);}}else if(_[_0xfed1('0xa4')](_0x8b9fd4[_0x21518e])){_0x8b9fd4[_0x21518e]=this[_0xfed1('0xa6')](_0x8b9fd4[_0x21518e]);}}}};AGIVertices[_0xfed1('0x18')][_0xfed1('0xaa')]=function(_0x5bb990,_0x25a90c){for(var _0xee50db in _0x5bb990){if(_0x5bb990[_0xfed1('0xa3')](_0xee50db)){if(_[_0xfed1('0xa7')](_0x5bb990[_0xee50db])){if(!_[_0xfed1('0x48')](_0x5bb990[_0xee50db])){this['saveRestApiResult'](_0x5bb990[_0xee50db],util[_0xfed1('0x2b')](_0xfed1('0xab'),_0x25a90c,_0xee50db));}}else if(_['isArray'](_0x5bb990[_0xee50db])){for(var _0x7d2fd2=0x0;_0x7d2fd2<_0x5bb990[_0xee50db][_0xfed1('0xac')];_0x7d2fd2++){this[_0xfed1('0xaa')](_0x5bb990[_0xee50db][_0x7d2fd2],util[_0xfed1('0x2b')](_0xfed1('0xab'),_0x25a90c,_0xee50db+'['+_0x7d2fd2+']'));}}else{if(!_['isNil'](_0x5bb990[_0xee50db])){this[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')](_0xfed1('0xab'),_0x25a90c,_0xee50db),_0x5bb990[_0xee50db]);}}}}};AGIVertices[_0xfed1('0x18')][_0xfed1('0xa5')]=function(_0xd6e3aa){try{var _0x2639f4=JSON['parse'](_0xd6e3aa);this[_0xfed1('0xa8')](_0x2639f4);return JSON[_0xfed1('0x7c')](_0x2639f4);}catch(_0x404b42){return this['replaceAllVariables'](_0xd6e3aa);}};AGIVertices[_0xfed1('0x18')][_0xfed1('0xa6')]=function(_0x1a013f){var _0x3506ad=_0x1a013f[_0xfed1('0xae')]('{');for(var _0x3c4c95=0x1;_0x3c4c95<_0x3506ad['length'];_0x3c4c95+=0x1){var _0x2eaed8=_0x3506ad[_0x3c4c95][_0xfed1('0xae')]('}');if(_0x2eaed8[_0xfed1('0xac')]>0x1){_0x1a013f=_0x1a013f[_0xfed1('0xaf')]('{'+_0x2eaed8[0x0]+'}',this[_0xfed1('0x39')][_0xfed1('0x14')](_0x2eaed8[0x0])['extra']||_0x2eaed8[0x0]);}}if(_0x3506ad[_0xfed1('0xac')]===0x1){return _0x1a013f[_0xfed1('0x52')]();}return this['replaceAllVariables'](_0x1a013f);};AGIVertices[_0xfed1('0x18')][_0xfed1('0xb0')]=function(_0x1f17d6,_0x3bc2db){var _0x4c77d2=this[_0xfed1('0x39')][_0xfed1('0x14')](_0x1f17d6);if(_0x4c77d2[_0xfed1('0xb1')]===-0x1){return _0x4c77d2;}logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xb2'),_0x3bc2db,_0x4c77d2[_0xfed1('0xb3')]));return this['channel']['setVariable'](_0x3bc2db,_0x4c77d2[_0xfed1('0xb3')]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x90')]=function(_0x5bb786){return _0x5bb786&&_0x5bb786!=='0'&&_0x5bb786!=='-1'&&_0x5bb786!=='';};AGIVertices[_0xfed1('0x18')]['maxRetry']=function(_0xa6c634){this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0xa6c634,'-');_0xa6c634[_0xfed1('0xb4')]=_0xa6c634[_0xfed1('0xb5')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xfed1('0xb6')]=function(_0x412109){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xb7'),_0x412109[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x412109['text'])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0xb8'));}var _0x481a6c='\x22'+_0x412109[_0xfed1('0x64')]+'\x22';if(this['isConfigured'](_0x412109[_0xfed1('0x82')])){_0x481a6c+=','+_0x412109[_0xfed1('0x82')];}var _0x25ecb6=this[_0xfed1('0x39')]['exec'](_0xfed1('0xb9'),_0x481a6c);if(_0x25ecb6[_0xfed1('0xb1')]===-0x1){return _0x25ecb6;}return this['channel']['noop'](util[_0xfed1('0x2b')](_0xfed1('0xba'),_0x481a6c));};AGIVertices['prototype'][_0xfed1('0xbb')]=function(_0x13a620){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xbc'),_0x13a620[_0xfed1('0x3b')]));if(!this['isConfigured'](_0x13a620[_0xfed1('0xbd')])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0xbe'));}var _0x5c0619=_0x13a620[_0xfed1('0xbd')];if(this[_0xfed1('0x90')](_0x13a620[_0xfed1('0x82')])){_0x5c0619+=','+_0x13a620[_0xfed1('0x82')];}var _0x4abcca=this[_0xfed1('0x39')][_0xfed1('0x5e')](_0xfed1('0xbf'),_0x5c0619);if(_0x4abcca[_0xfed1('0xb1')]===-0x1){return _0x4abcca;}var _0x159870=this[_0xfed1('0xb0')](_0xfed1('0xc0'),'MRCP_RECOG_CONFIDENCE');if(_0x159870[_0xfed1('0xb1')]===-0x1){return _0x159870;}var _0x15cb1c=this[_0xfed1('0xb0')](_0xfed1('0xc1'),_0xfed1('0xc2'));if(_0x15cb1c[_0xfed1('0xb1')]===-0x1){return _0x15cb1c;}var _0xe3e1bf=this['getAndSetVariable'](_0xfed1('0xc3'),_0xfed1('0xc4'));if(_0xe3e1bf[_0xfed1('0xb1')]===-0x1){return _0xe3e1bf;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5c0619));};AGIVertices[_0xfed1('0x18')]['agi']=function(_0x22bdb4){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xc6'),_0x22bdb4[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0x9')]([_0x22bdb4[_0xfed1('0xc7')],_0x22bdb4[_0xfed1('0xc8')]]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0xc9')]=function(_0x1a7c0d){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0xca'),_0x1a7c0d[_0xfed1('0x3b')]));if(this['isConfigured'](_0x1a7c0d[_0xfed1('0x6e')])){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0xcb'),_0x1a7c0d[_0xfed1('0x6e')]));var _0x54099f=this[_0xfed1('0x39')][_0xfed1('0xcc')](_0x1a7c0d[_0xfed1('0x6e')]);if(_0x54099f[_0xfed1('0xb1')]===-0x1){return _0x54099f;}}return this[_0xfed1('0x39')][_0xfed1('0xc9')]();};AGIVertices[_0xfed1('0x18')][_0xfed1('0x4f')]=function(_0x3980dd){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xcd'),_0x3980dd['label']));if(!this[_0xfed1('0x90')](_0x3980dd[_0xfed1('0x4e')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x3980dd,_0xfed1('0xce'));}_0x3980dd[_0xfed1('0x51')]=moment();if(this[_0xfed1('0x90')](_0x3980dd[_0xfed1('0xcf')])){_0x3980dd[_0xfed1('0x51')]=moment()[_0xfed1('0xd0')](_0x3980dd[_0xfed1('0xcf')],'minutes');}if(!this[_0xfed1('0x90')](_0x3980dd[_0xfed1('0x53')])){_0x3980dd[_0xfed1('0x53')]=0x2;}this[_0xfed1('0x47')]['sync'](this,_0x3980dd);return this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3980dd[_0xfed1('0x4d')],_0x3980dd[_0xfed1('0x4e')],_0x3980dd['scheduledAt']));};AGIVertices[_0xfed1('0x18')]['custom_app']=function(_0xbae02d){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xd1'),_0xbae02d[_0xfed1('0x3b')]));var _0x37d71b=this[_0xfed1('0x39')][_0xfed1('0x5e')](_0xbae02d[_0xfed1('0xd2')],_0xbae02d['options']);if(_0x37d71b[_0xfed1('0xb1')]===-0x1){return _0x37d71b;}return this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0xd3'),_0xbae02d[_0xfed1('0xd2')],_0xbae02d[_0xfed1('0x82')]));};AGIVertices[_0xfed1('0x18')][_0xfed1('0xd4')]=function(_0x598fdc){logger['info'](util['format'](_0xfed1('0xd5'),_0x598fdc[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x598fdc[_0xfed1('0x64')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0xb8'));}var _0x5350f4='\x22'+_0x598fdc[_0xfed1('0x64')]+'\x22';if(this[_0xfed1('0x90')](_0x598fdc['options'])){_0x5350f4+=','+_0x598fdc['options'];}var _0x2e091a=this[_0xfed1('0x39')][_0xfed1('0x5e')](_0xfed1('0xb9'),_0x5350f4);if(_0x2e091a[_0xfed1('0xb1')]===-0x1){return _0x2e091a;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util['format'](_0xfed1('0xba'),_0x5350f4));};AGIVertices[_0xfed1('0x18')][_0xfed1('0xd6')]=function(_0x26f405){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0xd7'),_0x26f405[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x26f405[_0xfed1('0x64')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')]('no\x20text\x20configured');}var _0x69bdea='\x22'+_0x26f405[_0xfed1('0x64')]+'\x22';if(this[_0xfed1('0x90')](_0x26f405[_0xfed1('0x82')])){_0x69bdea+=','+_0x26f405[_0xfed1('0x82')];}var _0x4a4bb8=this[_0xfed1('0x39')][_0xfed1('0x5e')]('MRCPSynth',_0x69bdea);if(_0x4a4bb8[_0xfed1('0xb1')]===-0x1){return _0x4a4bb8;}return this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xba'),_0x69bdea));};AGIVertices[_0xfed1('0x18')]['lumenvoxasr']=function(_0x2aeea5){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xd8'),_0x2aeea5[_0xfed1('0x3b')]));if(!this['isConfigured'](_0x2aeea5[_0xfed1('0xbd')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0xbe'));}var _0x3d4dee=_0x2aeea5[_0xfed1('0xbd')];if(this['isConfigured'](_0x2aeea5[_0xfed1('0x82')])){_0x3d4dee+=','+_0x2aeea5[_0xfed1('0x82')];}var _0x35e4eb=this['channel']['exec'](_0xfed1('0xbf'),_0x3d4dee);if(_0x35e4eb['result']===-0x1){return _0x35e4eb;}var _0x5714a7=this[_0xfed1('0xb0')](_0xfed1('0xc0'),_0xfed1('0xd9'));if(_0x5714a7[_0xfed1('0xb1')]===-0x1){return _0x5714a7;}var _0x43ed77=this['getAndSetVariable'](_0xfed1('0xc1'),_0xfed1('0xda'));if(_0x43ed77[_0xfed1('0xb1')]===-0x1){return _0x43ed77;}var _0x4017e7=this[_0xfed1('0xb0')](_0xfed1('0xc3'),_0xfed1('0xdb'));if(_0x4017e7[_0xfed1('0xb1')]===-0x1){return _0x4017e7;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xdc'),_0x3d4dee));};AGIVertices[_0xfed1('0x18')][_0xfed1('0xdd')]=function(_0x173582){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xde'),_0x173582[_0xfed1('0x3b')]));if(!this['isConfigured'](_0x173582[_0xfed1('0xbd')])){return this['channel']['noop'](_0xfed1('0xbe'));}var _0x323889=_0x173582['grammar'];if(this[_0xfed1('0x90')](_0x173582['options'])){_0x323889+=','+_0x173582['options'];}var _0xcf30ff=this[_0xfed1('0x39')][_0xfed1('0x5e')]('MRCPRecog',_0x323889);if(_0xcf30ff['result']===-0x1){return _0xcf30ff;}var _0x5df375=this[_0xfed1('0xb0')](_0xfed1('0xc0'),_0xfed1('0xdf'));if(_0x5df375[_0xfed1('0xb1')]===-0x1){return _0x5df375;}var _0x1a410b=this['getAndSetVariable']('RECOG_INPUT()',_0xfed1('0xe0'));if(_0x1a410b['result']===-0x1){return _0x1a410b;}var _0x5f2c3b=this[_0xfed1('0xb0')](_0xfed1('0xc3'),_0xfed1('0xe1'));if(_0x5f2c3b[_0xfed1('0xb1')]===-0x1){return _0x5f2c3b;}return this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xdc'),_0x323889));};AGIVertices['prototype'][_0xfed1('0xe2')]=function(_0x240fd4){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xe3'),_0x240fd4['label']));if(!this[_0xfed1('0x90')](_0x240fd4[_0xfed1('0xe4')])){return this['channel'][_0xfed1('0x2e')](_0x240fd4,_0xfed1('0xe5'));}var _0x44fa50=this['getSquareOdbc'][_0xfed1('0x79')](this,_0x240fd4[_0xfed1('0xe4')]);if(!_0x44fa50){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x240fd4,'no\x20odbc\x20database\x20found');}if(!this[_0xfed1('0x90')](_0x240fd4[_0xfed1('0xe6')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x240fd4,_0xfed1('0xe7'));}var _0x5c60be=_0x240fd4['query'][_0xfed1('0x60')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xe8'),_0x5c60be));var _0x4c6909=this[_0xfed1('0xe9')][_0xfed1('0x79')](this,_0x44fa50,_0x5c60be);this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x240fd4,_0x5c60be);if(!this[_0xfed1('0x90')](_0x240fd4['variable_id'])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xee7083=this[_0xfed1('0x14')]['sync'](this,_0x240fd4[_0xfed1('0xea')]);if(!_0xee7083){return this['channel'][_0xfed1('0x2e')](_0x240fd4,_0xfed1('0xeb'));}var _0x38ce93=this;_0x4c6909[_0xfed1('0xec')](function(_0x286228,_0xf1b8bf){Object[_0xfed1('0xed')](_0x286228)[_0xfed1('0xec')](function(_0x7b3bb){_0x38ce93[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')]('%s[%s][%s]',_0xee7083,_0xf1b8bf,_0x7b3bb),_0x286228[_0x7b3bb]);});});this[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')]('%s_ROWS_COUNT',_0xee7083),_0x4c6909[_0xfed1('0xac')]);return this[_0xfed1('0x39')][_0xfed1('0xc5')](util['format'](_0xfed1('0xee'),_0xee7083));};AGIVertices[_0xfed1('0x18')]['dial']=function(_0x52b4ef){logger[_0xfed1('0xef')](util[_0xfed1('0x2b')](_0xfed1('0xf0'),_0x52b4ef[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x52b4ef[_0xfed1('0xf1')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x52b4ef,_0xfed1('0xf2'));}var _0xaf69a0=this[_0xfed1('0x1c')][_0xfed1('0x79')](this,_0x52b4ef['sip_id']);if(!_0xaf69a0){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x52b4ef,_0xfed1('0xf3'));}var _0xd7b8ae=this[_0xfed1('0x39')][_0xfed1('0x5e')]('DIAL',[util['format'](_0xfed1('0xf4'),_0xaf69a0),_0x52b4ef[_0xfed1('0x6e')],_0x52b4ef[_0xfed1('0xf5')],_0x52b4ef[_0xfed1('0x6c')]]);if(_0xd7b8ae[_0xfed1('0xb1')]===-0x1){return _0xd7b8ae;}return this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xf6'),_0xfed1('0xf7')));};AGIVertices[_0xfed1('0x18')]['dialogflow']=function(_0x6ba6b9){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0xf8'),_0x6ba6b9[_0xfed1('0x3b')]));if(!this['isConfigured'](_0x6ba6b9[_0xfed1('0x84')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x6ba6b9[_0xfed1('0x64')])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0xb8'));}this[_0xfed1('0x39')][_0xfed1('0xf9')]=!![];this[_0xfed1('0x38')](_0x6ba6b9);this[_0xfed1('0x46')](_0x6ba6b9['text'],'in','','');this['channel']['noop'](util['format'](_0xfed1('0xfa'),_0x6ba6b9[_0xfed1('0x64')]));var _0x60ec06=this[_0xfed1('0x83')][_0xfed1('0x79')](this,_0x6ba6b9);if(_0x60ec06){for(var _0x3c3052 in _0x60ec06){if(_0x60ec06[_0xfed1('0xa3')](_0x3c3052)){this[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')](_0xfed1('0xfb'),_0x3c3052[_0xfed1('0x72')]()),_0x60ec06[_0x3c3052]);}}this[_0xfed1('0x46')](_0x60ec06[_0xfed1('0xfc')],_0xfed1('0xfd'),_0xfed1('0xfe'),'');return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xff'),_0x60ec06[_0xfed1('0xfc')]));}return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x6ba6b9,_0xfed1('0x100'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x101')]=function(_0x3c071d){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3c071d[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x3c071d[_0xfed1('0x86')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x102'));}if(!this[_0xfed1('0x90')](_0x3c071d[_0xfed1('0x87')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x103'));}if(!this[_0xfed1('0x90')](_0x3c071d[_0xfed1('0x88')])){return this['channel'][_0xfed1('0xc5')](_0xfed1('0x104'));}if(!this['isConfigured'](_0x3c071d['dialogflowV2_language'])){return this['channel'][_0xfed1('0xc5')]('no\x20anguage\x20configured');}if(!this[_0xfed1('0x90')](_0x3c071d[_0xfed1('0x64')])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0xb8'));}this[_0xfed1('0x39')][_0xfed1('0xf9')]=!![];this['createSquareDetailsReport'](_0x3c071d);this['createSquareMessage'](_0x3c071d[_0xfed1('0x64')],'in','','');this[_0xfed1('0x39')]['noop'](util['format'](_0xfed1('0x105'),_0x3c071d[_0xfed1('0x64')]));var _0x3a1cd1=this[_0xfed1('0x85')][_0xfed1('0x79')](this,_0x3c071d);if(_0x3a1cd1){for(var _0x117c21 in _0x3a1cd1){if(_0x3a1cd1[_0xfed1('0xa3')](_0x117c21)){if(_0x117c21!=='providerResponse'){this[_0xfed1('0x39')][_0xfed1('0xad')](util['format']('DIALOGFLOW_%s',_0x117c21['toUpperCase']()),_0x3a1cd1[_0x117c21]);}}}this[_0xfed1('0x46')](_0x3a1cd1['speech'],'out',_0xfed1('0x101'),_0x3a1cd1[_0xfed1('0x106')]);return this[_0xfed1('0x39')][_0xfed1('0xc5')](util['format']('DialogflowV2\x20Result\x20%s',_0x3a1cd1[_0xfed1('0xfc')]));}return this['channel'][_0xfed1('0x2e')](_0x3c071d,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0xfed1('0x107')]=function(_0x57b0cc){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x108'),_0x57b0cc[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x57b0cc[_0xfed1('0x109')])){return this['channel'][_0xfed1('0xc5')](_0xfed1('0x10a'));}if(!this[_0xfed1('0x90')](_0x57b0cc[_0xfed1('0x10b')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x10c'));}if(!this[_0xfed1('0x90')](_0x57b0cc[_0xfed1('0x10d')])){return this['channel'][_0xfed1('0xc5')](_0xfed1('0x10e'));}if(!this[_0xfed1('0x90')](_0x57b0cc[_0xfed1('0x10f')])){return this[_0xfed1('0x39')]['noop']('no\x20text\x20configured');}this['channel'][_0xfed1('0xf9')]=!![];this['createSquareDetailsReport'](_0x57b0cc);this[_0xfed1('0x46')](_0x57b0cc['text'],'in','','');this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x57b0cc[_0xfed1('0x64')]));var _0x5c3fe1=this['sestekNDA'][_0xfed1('0x79')](this,_0x57b0cc);if(_0x5c3fe1){for(var _0xcd07ac in _0x5c3fe1){if(_0x5c3fe1['hasOwnProperty'](_0xcd07ac)){this[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')]('SESTEK_NDA_%s',_0xcd07ac[_0xfed1('0x72')]()),_0x5c3fe1[_0xcd07ac]);}}this[_0xfed1('0x46')](_0x5c3fe1[_0xfed1('0xfc')],_0xfed1('0xfd'),_0xfed1('0x107'),'');if(_0x5c3fe1[_0xfed1('0x110')]){this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x111'),_0x5c3fe1[_0xfed1('0x110')]));var _0x1b27ec=this[_0xfed1('0x39')][_0xfed1('0x112')](_0x5c3fe1['audiofile']);try{fs[_0xfed1('0x113')](_0x5c3fe1[_0xfed1('0x110')]+'.wav');}catch(_0x42674b){logger[_0xfed1('0x2e')](_0x42674b);}return _0x1b27ec;}else{return this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x114'),_0x5c3fe1[_0xfed1('0xfc')]));}}return this['channel']['error'](_0x57b0cc,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xfed1('0x18')][_0xfed1('0x115')]=function(_0x342b61){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x116'),_0x342b61[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x115'));};AGIVertices[_0xfed1('0x18')]['ext_dial']=function(_0x4087cb){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x117'),_0x4087cb[_0xfed1('0x3b')]));var _0x178cfc='';if(_0x4087cb['trunk_id']){if(!this['isConfigured'](_0x4087cb[_0xfed1('0x118')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4087cb,_0xfed1('0x119'));}else{var _0x598d75=parseInt(_0x4087cb[_0xfed1('0x118')],0xa);if(isNaN(_0x598d75)){_0x178cfc=_0x4087cb['trunk_id'];}else{_0x178cfc=this[_0xfed1('0x1e')][_0xfed1('0x79')](this,_0x4087cb[_0xfed1('0x118')]);if(!_0x178cfc){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4087cb,_0xfed1('0x11a'));}}}}else if(_0x4087cb[_0xfed1('0x11b')]){_0x178cfc=_0x4087cb[_0xfed1('0x11b')];}else{return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4087cb,_0xfed1('0x119'));}var _0x563248=this[_0xfed1('0x39')][_0xfed1('0x5e')](_0xfed1('0xf7'),[util['format']('SIP/%s/%s',_0x178cfc,_0x4087cb['phone']),_0x4087cb['timeout'],_0x4087cb[_0xfed1('0xf5')],_0x4087cb[_0xfed1('0x6c')]]);if(_0x563248['result']===-0x1){return _0x563248;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')]('Executed\x20command\x20%s',_0xfed1('0xf7')));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x11c')]=function(_0x36f331){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x11d'),_0x36f331[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0xc5')]('finally');};AGIVertices[_0xfed1('0x18')][_0xfed1('0x10')]=function(_0x36d3c5){logger['info'](util['format'](_0xfed1('0x11e'),_0x36d3c5[_0xfed1('0x3b')]));if(_0x36d3c5['retry']===0x0){return this['maxRetry'](_0x36d3c5);}_0x36d3c5[_0xfed1('0xb4')]-=0x1;if(!this['isConfigured'](_0x36d3c5[_0xfed1('0x11f')])){return this['channel']['error'](_0x36d3c5,'no\x20file\x20audio\x20selected');}var _0x4d4b5d=this[_0xfed1('0x20')][_0xfed1('0x79')](this,_0x36d3c5['file_id']);if(!_0x4d4b5d){return this['channel'][_0xfed1('0x2e')](_0x36d3c5,_0xfed1('0x120'));}if(!this[_0xfed1('0x90')](_0x36d3c5['variable_id'])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0xfed1('0x121'));}var _0x4b07d4=this['channel'][_0xfed1('0x122')](_0x4d4b5d,_0x36d3c5[_0xfed1('0x123')],_0x36d3c5[_0xfed1('0x124')]);var _0x4f9b6a=_0x4b07d4['result']?_0x4b07d4[_0xfed1('0xb1')]['toString']():'';logger[_0xfed1('0x30')]('test',JSON[_0xfed1('0x7c')](_0x4b07d4));if(_0x4b07d4[_0xfed1('0xb1')]===-0x1){this['createSquareDetailsReport'][_0xfed1('0x79')](this,_0x36d3c5,_0x4f9b6a);return _0x4b07d4;}else if(_0x4b07d4['extra']===_0xfed1('0x6e')){_0x4b07d4[_0xfed1('0xb1')]=_0x4f9b6a[_0xfed1('0xac')]>=parseInt(_0x36d3c5['mindigit'])?'x':'i';}else{_0x4b07d4[_0xfed1('0xb1')]=_0x4f9b6a[_0xfed1('0xac')]>=parseInt(_0x36d3c5[_0xfed1('0x125')])&&_0x4f9b6a[_0xfed1('0xac')]<=parseInt(_0x36d3c5['maxdigit'])?'x':'i';}var _0x25bc7b=this[_0xfed1('0x14')][_0xfed1('0x79')](this,_0x36d3c5[_0xfed1('0xea')]);if(!_0x25bc7b){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x36d3c5,_0xfed1('0xeb'));}this[_0xfed1('0x39')][_0xfed1('0xad')](_0x25bc7b,_0x4f9b6a);if(this[_0xfed1('0x90')](_0x36d3c5['hiddendigitsnum'])){var _0x2aa913=parseInt(_0x36d3c5[_0xfed1('0x126')],0xa);var _0x243a1a=rs[_0xfed1('0x127')]({'charset':'*','length':_0x2aa913});var _0x25cf05=_0x4f9b6a[_0xfed1('0xac')];if(_0x25cf05>0x0){if(_0x25cf05>_0x2aa913){this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x36d3c5,_0x36d3c5[_0xfed1('0x128')]===_0xfed1('0x129')?_0x243a1a+_0x4f9b6a[_0xfed1('0x12a')](_0x2aa913):_0x4f9b6a['substr'](0x0,_0x25cf05-_0x2aa913)+_0x243a1a);}else{this[_0xfed1('0x38')]['sync'](this,_0x36d3c5,rs['generate']({'charset':'*','length':_0x25cf05}));}}else{this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x36d3c5,'');}}else{this[_0xfed1('0x38')]['sync'](this,_0x36d3c5,_0x4f9b6a);}return _0x4b07d4;};AGIVertices[_0xfed1('0x18')][_0xfed1('0x11')]=function(_0x4b474c){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x12b'),_0x4b474c[_0xfed1('0x3b')]));return this[_0xfed1('0x10')](_0x4b474c);};AGIVertices[_0xfed1('0x18')]['goal']=function(_0x2f1349){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x12c'),_0x2f1349['label']));this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x2f1349,_0x2f1349[_0xfed1('0x12d')]);return this['channel']['noop'](util[_0xfed1('0x2b')]('GOAL\x20%s',_0x2f1349['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x17cc14){logger['info'](util[_0xfed1('0x2b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x17cc14[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x17cc14['aws_access_key_id'])||!this['isConfigured'](_0x17cc14[_0xfed1('0x94')])){return this['channel'][_0xfed1('0xc5')](_0xfed1('0x12e'));}if(!this[_0xfed1('0x90')](_0x17cc14[_0xfed1('0x64')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0xb8'));}this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x12f'),_0x17cc14[_0xfed1('0x64')]));var _0x3664ea=this[_0xfed1('0x92')][_0xfed1('0x79')](this,_0x17cc14);if(_0x3664ea){this['channel']['noop'](util[_0xfed1('0x2b')](_0xfed1('0x130'),_0x3664ea));var _0x360a5c=this['channel'][_0xfed1('0x112')](_0x3664ea);try{fs[_0xfed1('0x113')](_0x3664ea+'.wav');}catch(_0x444f91){logger['error'](_0x444f91);}return _0x360a5c;}return this['channel'][_0xfed1('0x2e')](_0x17cc14,_0xfed1('0x131'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x132')]=function(_0xf947ce){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x133'),_0xf947ce[_0xfed1('0x3b')]));if(!this['isConfigured'](_0xf947ce[_0xfed1('0x93')])||!this[_0xfed1('0x90')](_0xf947ce[_0xfed1('0x94')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x12e'));}if(!this[_0xfed1('0x90')](_0xf947ce[_0xfed1('0x9b')])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0x134'));}if(!this['isConfigured'](_0xf947ce['text'])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0xb8'));}this[_0xfed1('0x39')][_0xfed1('0xf9')]=!![];this[_0xfed1('0x38')](_0xf947ce);this[_0xfed1('0x46')](_0xf947ce['text'],'in','','');this['channel']['noop'](util[_0xfed1('0x2b')](_0xfed1('0x135'),_0xf947ce[_0xfed1('0x64')]));var _0x4871ea=this['awsLex'][_0xfed1('0x79')](this,_0xf947ce);if(_0x4871ea){for(var _0x1d31ba in _0x4871ea){if(_0x4871ea[_0xfed1('0xa3')](_0x1d31ba)&&_[_0xfed1('0xa4')](_0x4871ea[_0x1d31ba])){this[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')](_0xfed1('0x136'),_0x1d31ba['toUpperCase']()),_0x4871ea[_0x1d31ba]);}}if(_['isNil'](_0x4871ea[_0xfed1('0x80')])){return this['channel'][_0xfed1('0xc5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xfed1('0x46')](_0x4871ea[_0xfed1('0x80')],_0xfed1('0xfd'),_0xfed1('0x137'),'');return this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x4871ea[_0xfed1('0x80')]));}}return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0xf947ce,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xfed1('0x18')][_0xfed1('0x138')]=function(_0x2dc775){logger['info'](util['format'](_0xfed1('0x139'),_0x2dc775[_0xfed1('0x3b')],_0x2dc775[_0xfed1('0x6e')]));if(!this[_0xfed1('0x90')](_0x2dc775[_0xfed1('0x84')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x13a'));}var _0x57ad9b=_0xfed1('0x13b');var _0x236512=util[_0xfed1('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0xfed1('0x127')](0x4));var _0x3878c9=util['format'](_0xfed1('0xab'),_0x236512,_0x57ad9b);var _0x16bbbc=!![];if(_0x2dc775['beep']===_0xfed1('0x13c')){_0x16bbbc=![];}var _0x3b31c9=this['channel']['recordFile'](_0x236512,_0x57ad9b,_0x2dc775[_0xfed1('0x13d')],_0x2dc775['timeout'],undefined,_0x16bbbc);if(_0x3b31c9['result']!==-0x1){this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x13e'),_0x3878c9));var _0x5d1271=this['googleASR'][_0xfed1('0x79')](this,_0x2dc775,_0x3878c9);if(_0x5d1271){for(var _0x557ebe in _0x5d1271){if(_0x5d1271[_0xfed1('0xa3')](_0x557ebe)){this[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')](_0xfed1('0x13f'),_0x557ebe[_0xfed1('0x72')]()),_0x5d1271[_0x557ebe]);}}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x140'),JSON[_0xfed1('0x7c')](_0x5d1271)));}}return _0x3b31c9;};AGIVertices[_0xfed1('0x18')][_0xfed1('0x141')]=function(_0xa4dde7){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0xa4dde7[_0xfed1('0x3b')]));if(!this['isConfigured'](_0xa4dde7['appid'])){return this['channel'][_0xfed1('0xc5')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0xa4dde7[_0xfed1('0xa0')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x142'));}var _0x4b041f=_0xfed1('0x13b');var _0x5397f3=util[_0xfed1('0x2b')](_0xfed1('0x143'),FILES_PATH,rs[_0xfed1('0x127')](0x4));var _0xf3394d=util[_0xfed1('0x2b')]('%s.%s',_0x5397f3,_0x4b041f);var _0x1c77ca=!![];if(_0xa4dde7[_0xfed1('0x144')]===_0xfed1('0x13c')){_0x1c77ca=![];}var _0x5ba052=this['channel'][_0xfed1('0x145')](_0x5397f3,_0x4b041f,_0xa4dde7['intKey'],_0xa4dde7[_0xfed1('0x6e')],undefined,_0x1c77ca);if(_0x5ba052['result']!==-0x1){this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x146'),_0xf3394d));var _0x52cb54=this[_0xfed1('0x9e')][_0xfed1('0x79')](this,_0xa4dde7,_0xf3394d);if(_0x52cb54){for(var _0x4b0d09 in _0x52cb54){if(_0x52cb54[_0xfed1('0xa3')](_0x4b0d09)){this['channel'][_0xfed1('0xad')](util[_0xfed1('0x2b')](_0xfed1('0x147'),_0x4b0d09['toUpperCase']()),_0x52cb54[_0x4b0d09]);}}return this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')]('TildeASR\x20Result\x20%s',JSON[_0xfed1('0x7c')](_0x52cb54)));}}return _0x5ba052;};AGIVertices[_0xfed1('0x18')][_0xfed1('0x148')]=function(_0x9a4f05){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x149'),_0x9a4f05[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0x14a')](_0x9a4f05[_0xfed1('0x40')],_0x9a4f05[_0xfed1('0x41')],_0x9a4f05[_0xfed1('0x42')]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x14b')]=function(_0x3d6e66){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x3d6e66[_0xfed1('0x3b')]));if(!this['isConfigured'](_0x3d6e66[_0xfed1('0x14c')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x3d6e66,_0xfed1('0x14d'));}try{var _0x5b326a=eval(_0x3d6e66[_0xfed1('0x14c')])?_0xfed1('0x14e'):_0xfed1('0x14f');this['channel']['noop'](util['format'](_0xfed1('0x150'),_0x3d6e66[_0xfed1('0x14c')],_0x5b326a));return{'code':0xc8,'result':_0x5b326a};}catch(_0x8f4ba6){return{'code':0xc8,'result':_0xfed1('0x14f')};}};AGIVertices[_0xfed1('0x18')][_0xfed1('0x151')]=function(_0x10d85c){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x152'),_0x10d85c[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x10d85c[_0xfed1('0x153')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x10d85c,_0xfed1('0x154'));}var _0x3e4ab7=this[_0xfed1('0x24')][_0xfed1('0x79')](this,_0x10d85c[_0xfed1('0x153')]);if(!_0x3e4ab7){return this[_0xfed1('0x39')]['error'](_0x10d85c,'no\x20intervals\x20found');}for(var _0x31ed65=0x0;_0x31ed65<_0x3e4ab7['length'];_0x31ed65+=0x1){var _0x131916=this[_0xfed1('0x39')][_0xfed1('0x14')](util[_0xfed1('0x2b')]('IFTIME(%s?true:false)',_0x3e4ab7[_0x31ed65]));if(_0x131916[_0xfed1('0xb1')]===-0x1){return _0x131916;}logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('IFTIME\x20%s\x20%s',_0x3e4ab7[_0x31ed65],_0x131916[_0xfed1('0xb3')]));if(_0x131916['extra']===_0xfed1('0x14e')){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x155'),_0x3e4ab7[_0x31ed65],_0xfed1('0x14e')));this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x155'),_0x3e4ab7[_0x31ed65],_0xfed1('0x14e')));return{'code':0xc8,'result':_0xfed1('0x14e')};}else{logger[_0xfed1('0x30')](util['format'](_0xfed1('0x155'),_0x3e4ab7[_0x31ed65],_0xfed1('0x14f')));this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x155'),_0x3e4ab7[_0x31ed65],_0xfed1('0x14f')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xfed1('0x18')][_0xfed1('0x156')]=function(_0x2de57b){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x157'),_0x2de57b[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0x156')]();};AGIVertices[_0xfed1('0x18')][_0xfed1('0x158')]=function(_0x5d45e3){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x159'),_0x5d45e3['label']));if(!this[_0xfed1('0x90')](_0x5d45e3['key'])){return this[_0xfed1('0x39')][_0xfed1('0xc5')]('no\x20key\x20configured');}var _0x5b30d1=_0xfed1('0x13b');var _0x24510b=util['format'](_0xfed1('0x143'),FILES_PATH,rs['generate'](0x4));var _0x576058=util['format']('%s.%s',_0x24510b,_0x5b30d1);var _0x32e8f2=!![];if(_0x5d45e3[_0xfed1('0x144')]===_0xfed1('0x13c')){_0x32e8f2=![];}var _0x550afd=this['channel'][_0xfed1('0x145')](_0x24510b,_0x5b30d1,_0x5d45e3[_0xfed1('0x13d')],_0x5d45e3[_0xfed1('0x6e')],undefined,_0x32e8f2);if(_0x550afd[_0xfed1('0xb1')]!==-0x1){this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')]('ispeech\x20%s\x20file\x20created',_0x576058));var _0x4e1630=this[_0xfed1('0x8e')]['sync'](this,_0x5d45e3,_0x576058);if(_0x4e1630){for(var _0x16be34 in _0x4e1630){if(_0x4e1630['hasOwnProperty'](_0x16be34)){this[_0xfed1('0x39')][_0xfed1('0xad')](util['format'](_0xfed1('0x15a'),_0x16be34[_0xfed1('0x72')]()),_0x4e1630[_0x16be34]);}}return this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x4e1630)));}}return _0x550afd;};AGIVertices[_0xfed1('0x18')][_0xfed1('0x15b')]=function(_0x2c17d4){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2c17d4[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x2c17d4[_0xfed1('0x84')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x2c17d4[_0xfed1('0x64')])){return this[_0xfed1('0x39')]['noop'](_0xfed1('0xb8'));}this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x15c'),_0x2c17d4[_0xfed1('0x64')]));var _0x10216e=this[_0xfed1('0x8b')]['sync'](this,_0x2c17d4);if(_0x10216e){this[_0xfed1('0x39')][_0xfed1('0xc5')](util['format'](_0xfed1('0x15d'),_0x10216e));var _0x59eb18=this[_0xfed1('0x39')]['streamFile'](_0x10216e,_0x2c17d4[_0xfed1('0x13d')]);try{fs[_0xfed1('0x113')](_0x10216e+_0xfed1('0x15e'));}catch(_0x3c913e){logger[_0xfed1('0x2e')](_0x3c913e);}return _0x59eb18;}return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x2c17d4,_0xfed1('0x15f'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x160')]=function(_0x2945c9){logger['info'](util[_0xfed1('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x2945c9['label']));if(!this['isConfigured'](_0x2945c9[_0xfed1('0x161')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x2945c9,'no\x20find\x20by\x20configured');}logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x162'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x2945c9[_0xfed1('0x161')]));var _0x138b78=this[_0xfed1('0x5a')][_0xfed1('0x79')](this,_0x2945c9[_0xfed1('0x161')]);if(_0x138b78){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x163'),this[_0xfed1('0x39')]['callerid'],_0x2945c9[_0xfed1('0x161')]));this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x163'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x2945c9[_0xfed1('0x161')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x164'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x2945c9['findBy']));this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x164'),this[_0xfed1('0x39')]['callerid'],_0x2945c9[_0xfed1('0x161')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfed1('0x18')]['logout']=function(_0x3116d7){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3116d7[_0xfed1('0x3b')]));if(!this['isConfigured'](_0x3116d7[_0xfed1('0x161')])){return this['channel'][_0xfed1('0x2e')](_0x3116d7,_0xfed1('0x165'));}logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x162'),this['channel'][_0xfed1('0x3e')],_0x3116d7[_0xfed1('0x161')]));var _0x248715=this[_0xfed1('0x59')][_0xfed1('0x79')](this,_0x3116d7[_0xfed1('0x161')]);if(_0x248715){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x163'),this['channel'][_0xfed1('0x3e')],_0x3116d7[_0xfed1('0x161')]));this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x3116d7[_0xfed1('0x161')]));return{'code':0xc8,'result':_0xfed1('0x166')};}else{logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x164'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x3116d7[_0xfed1('0x161')]));this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x164'),this['channel'][_0xfed1('0x3e')],_0x3116d7[_0xfed1('0x161')]));return{'code':0xc8,'result':_0xfed1('0x167')};}};AGIVertices['prototype']['math']=function(_0x4cccb6){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x168'),_0x4cccb6['label']));if(!this[_0xfed1('0x90')](_0x4cccb6[_0xfed1('0x169')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4cccb6,_0xfed1('0x16a'));}this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x16b'),_0x4cccb6[_0xfed1('0x169')]));var _0x2540ca=eval(_0x4cccb6[_0xfed1('0x169')]);if(!this['isConfigured'](_0x4cccb6[_0xfed1('0xea')])){return this['channel']['noop'](_0xfed1('0x121'));}var _0x3560fe=this[_0xfed1('0x14')]['sync'](this,_0x4cccb6['variable_id']);if(!_0x3560fe){return this[_0xfed1('0x39')]['error'](_0x4cccb6,_0xfed1('0xeb'));}if(_['isArray'](_0x2540ca)){var _0x549d9d=this;_0x2540ca[_0xfed1('0xec')](function(_0x1242fd,_0x224e63){_0x549d9d[_0xfed1('0x39')][_0xfed1('0xad')](util[_0xfed1('0x2b')](_0xfed1('0x16c'),_0x3560fe,_0x224e63),_0x1242fd);});return this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x16d'),_0x3560fe));}else{return this[_0xfed1('0x39')][_0xfed1('0xad')](_0x3560fe,_0x2540ca);}};AGIVertices['prototype'][_0xfed1('0xf')]=function(_0x248815){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x16e'),_0x248815['label']));if(_0x248815['retry']===0x0){return this['maxRetry'](_0x248815);}_0x248815['retry']-=0x1;if(!this[_0xfed1('0x90')](_0x248815['file_id'])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x248815,_0xfed1('0x16f'));}var _0x32900f=this[_0xfed1('0x20')]['sync'](this,_0x248815[_0xfed1('0x11f')]);if(!_0x32900f){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x248815,'no\x20file\x20audio\x20found');}var _0x163e7c=this['channel'][_0xfed1('0x122')](_0x32900f,_0x248815[_0xfed1('0x123')],_0x248815['digit']);var _0x147e7c=_0x163e7c['result'];if(_0x163e7c[_0xfed1('0xb1')]===-0x1){this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x248815,'-1');return _0x163e7c;}else if(_0x163e7c[_0xfed1('0xb3')]===_0xfed1('0x6e')){_0x163e7c['result']=_0x163e7c[_0xfed1('0xb1')][_0xfed1('0xac')]>0x0?_0x163e7c[_0xfed1('0xb1')]:'t';}else if(_['isEmpty'](_0x163e7c[_0xfed1('0xb1')])){_0x163e7c[_0xfed1('0xb1')]='#';_0x147e7c='#';}if(!this[_0xfed1('0x90')](_0x248815[_0xfed1('0xea')])){this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x121'));}else{var _0x3d9440=this[_0xfed1('0x14')][_0xfed1('0x79')](this,_0x248815[_0xfed1('0xea')]);if(!_0x3d9440){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x248815,_0xfed1('0xeb'));}this[_0xfed1('0x39')][_0xfed1('0xad')](_0x3d9440,_0x147e7c);}this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x248815,_0x147e7c);return _0x163e7c;};AGIVertices[_0xfed1('0x18')][_0xfed1('0xc5')]=function(_0x198e48){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x170'),_0x198e48['label']));return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0x198e48[_0xfed1('0x171')]||_0x198e48[_0xfed1('0x3b')]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x172')]=function(_0x4cc51d){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x173'),_0x4cc51d['label']));if(!this[_0xfed1('0x90')](_0x4cc51d[_0xfed1('0x161')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4cc51d,'no\x20find\x20by\x20configured');}logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x162'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x4cc51d[_0xfed1('0x161')]));var _0x36e7c7=this['getPause'][_0xfed1('0x79')](this,_0x4cc51d[_0xfed1('0x174')]);var _0xb911e=this[_0xfed1('0x56')][_0xfed1('0x79')](this,_0x4cc51d[_0xfed1('0x161')],_0x36e7c7);if(_0xb911e){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x4cc51d[_0xfed1('0x161')]));this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x163'),this['channel'][_0xfed1('0x3e')],_0x4cc51d[_0xfed1('0x161')]));return{'code':0xc8,'result':_0xfed1('0x166')};}else{logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x164'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x4cc51d['findBy']));this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x163'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x4cc51d[_0xfed1('0x161')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfed1('0x18')][_0xfed1('0x175')]=function(_0x49f0eb){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x176'),_0x49f0eb[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x49f0eb[_0xfed1('0x11f')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x49f0eb,_0xfed1('0x16f'));}var _0x1f12f8=this[_0xfed1('0x20')][_0xfed1('0x79')](this,_0x49f0eb[_0xfed1('0x11f')]);if(!_0x1f12f8){return this[_0xfed1('0x39')]['error'](_0x49f0eb,_0xfed1('0x120'));}var _0x51e500=this['channel']['exec']('PLAYBACK',[_0x1f12f8,_0x49f0eb[_0xfed1('0xf5')]]);if(_0x51e500[_0xfed1('0xb1')]===-0x1){return _0x51e500;}return this['channel'][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xd3'),_0xfed1('0x177'),_0x1f12f8));};AGIVertices[_0xfed1('0x18')]['queue']=function(_0x4bc2ed){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x178'),_0x4bc2ed[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x4bc2ed[_0xfed1('0x179')])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4bc2ed,'no\x20queue\x20selected');}var _0x24f539='';var _0x4e3539=parseInt(_0x4bc2ed[_0xfed1('0x179')],0xa);if(isNaN(_0x4e3539)){_0x24f539=_0x4bc2ed[_0xfed1('0x179')];}else{_0x24f539=this[_0xfed1('0x17a')][_0xfed1('0x79')](this,_0x4bc2ed[_0xfed1('0x179')]);if(!_0x24f539){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4bc2ed,_0xfed1('0x17b'));}}var _0x1b670c='';if(this['isConfigured'](_0x4bc2ed[_0xfed1('0x11f')])){var _0xc3c115=this[_0xfed1('0x20')]['sync'](this,_0x4bc2ed[_0xfed1('0x11f')]);if(_0xc3c115){_0x1b670c=_0xc3c115;}}this['createSquareDetailsReport']['sync'](this,_0x4bc2ed,_0x24f539);if(_0x4bc2ed['opts']['indexOf']('x')<0x0){_0x4bc2ed['opts']+='x';}if(_0x4bc2ed['opts'][_0xfed1('0x17c')]('X')<0x0){_0x4bc2ed['opts']+='X';}this[_0xfed1('0x39')][_0xfed1('0xad')](_0xfed1('0x17d'),_0x24f539?_0x24f539[_0xfed1('0x17e')]():'');var _0x46873e=this[_0xfed1('0x39')][_0xfed1('0x5e')](_0xfed1('0x17f'),[_0x24f539,_0x4bc2ed['opts'],_0x4bc2ed['url'],_0x1b670c,_0x4bc2ed[_0xfed1('0x6e')],_0x4bc2ed[_0xfed1('0x9')],_0x4bc2ed['macro'],_0x4bc2ed[_0xfed1('0x180')],'',_0x4bc2ed[_0xfed1('0x181')]]);if(_0x46873e[_0xfed1('0xb1')]===-0x1){return _0x46873e;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xd3'),'QUEUE',_0x24f539));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x182')]=function(_0x4b3a82){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4b3a82[_0xfed1('0x3b')]));var _0x204920=_0x4b3a82[_0xfed1('0x183')]||'wav';var _0x473e93=util[_0xfed1('0x2b')]('%s_%s',this[_0xfed1('0x39')]['uniqueid'],rs[_0xfed1('0x127')](0x5));var _0x98f07e=util[_0xfed1('0x2b')](_0xfed1('0x184'),FILES_PATH,_0x473e93,_0x204920);var _0x2b6cfd=util[_0xfed1('0x2b')](_0xfed1('0x143'),FILES_PATH,_0x473e93);this['createSquareRecording'][_0xfed1('0x79')](this,_0x4b3a82,_0x473e93,_0x98f07e);this['channel']['setVariable'](_0xfed1('0x185'),_0x473e93);logger[_0xfed1('0x30')](_0xfed1('0x186'),_0x2b6cfd,_0x204920,_0x4b3a82[_0xfed1('0x187')],_0x4b3a82[_0xfed1('0x6e')]);return this['channel'][_0xfed1('0x145')](_0x2b6cfd,_0x204920,_0x4b3a82[_0xfed1('0x187')],_0x4b3a82['timeout'],undefined,!![]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x188')]=function(_0xf830e){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xf830e['label']));if(!this[_0xfed1('0x90')](_0xf830e[_0xfed1('0x6c')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x189'));}var _0xb4df03=this['restAPI'][_0xfed1('0x79')](this,_0xf830e);logger['info'](util['format'](_0xfed1('0x18a'),util[_0xfed1('0x18b')](_0xb4df03,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0xf830e['variable_id'])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x18c'));}var _0x341ba5=this['getVariable'][_0xfed1('0x79')](this,_0xf830e[_0xfed1('0xea')]);if(!_0x341ba5){return this['channel'][_0xfed1('0x2e')](_0xf830e,'no\x20variable\x20found');}this[_0xfed1('0x39')][_0xfed1('0xad')](util['format'](_0xfed1('0x18d'),_0x341ba5),_0xb4df03[_0xfed1('0x7f')]?_0xb4df03[_0xfed1('0x7f')]:'200');this[_0xfed1('0x39')][_0xfed1('0xad')](util['format'](_0xfed1('0x18e'),_0x341ba5),_0xb4df03['statusMessage']?_0xb4df03['statusMessage']:'OK');if(_0xb4df03[_0xfed1('0x73')]){try{this['saveRestApiResult'](_0xb4df03[_0xfed1('0x73')],_0x341ba5);}catch(_0x4ba7e8){logger[_0xfed1('0x2e')](util[_0xfed1('0x2b')](_0xfed1('0x18f'),_0x341ba5));}}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util['format']('variable\x20%s\x20set',_0x341ba5));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x190')]=function(_0x524d78){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x191'),_0x524d78['label']));return this[_0xfed1('0x39')][_0xfed1('0x192')](_0x524d78[_0xfed1('0x193')]['replace'](/\s+/g,''),_0x524d78['escape_digits']);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x194')]=function(_0x5b646f){logger[_0xfed1('0x30')](util['format'](_0xfed1('0x195'),_0x5b646f[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0x196')](_0x5b646f[_0xfed1('0x197')][_0xfed1('0x60')](/\s+/g,''),_0x5b646f[_0xfed1('0x187')]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x198')]=function(_0xd0e091){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0xd0e091[_0xfed1('0x3b')]));return this['channel'][_0xfed1('0x199')](_0xd0e091[_0xfed1('0x64')],_0xd0e091[_0xfed1('0x187')]);};AGIVertices['prototype'][_0xfed1('0x19a')]=function(_0x39826c){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x19b'),_0x39826c['label']));if(!this[_0xfed1('0x90')](_0x39826c[_0xfed1('0x19c')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x19d'));}var _0x375f8a=this[_0xfed1('0x19e')][_0xfed1('0x79')](this,_0x39826c['account_id']);if(!_0x375f8a||!_0x375f8a[_0xfed1('0x19f')]){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x39826c,_0xfed1('0x1a0'));}var _0x3dec26={'from':util['format'](_0xfed1('0x1a1'),_0x375f8a[_0xfed1('0x15')],_0x375f8a[_0xfed1('0x1a2')]||_0x375f8a[_0xfed1('0x19f')]['user']),'to':_0x39826c['to']||'','cc':_0x39826c['cc']||'','bcc':_0x39826c[_0xfed1('0x1a3')]||'','subject':_0x39826c['subject'],'html':_0x39826c[_0xfed1('0x64')],'text':_0x39826c['text']};if(this[_0xfed1('0x90')](_0x39826c[_0xfed1('0x1a4')])){}logger[_0xfed1('0xef')](_0xfed1('0x1a5'),JSON['stringify'](_0x3dec26));this[_0xfed1('0x38')]['sync'](this,_0x39826c,_0x39826c[_0xfed1('0x19c')]);this['channel']['noop'](util[_0xfed1('0x2b')](_0xfed1('0x1a6'),_0x375f8a['name']));this['sendMailMessage'][_0xfed1('0x79')](this,_0x375f8a['smtpOptions'],_0x3dec26);return this['channel'][_0xfed1('0xc5')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x3cb9e0){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x1a7'),_0x3cb9e0[_0xfed1('0x3b')]));return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x1a8'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1a9')]=function(_0x35fb36){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x1aa'),_0x35fb36[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x35fb36['sms_account_id'])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x1ab'));}var _0x90e94=this['getSmsAccount'][_0xfed1('0x79')](this,_0x35fb36['sms_account_id']);if(!_0x90e94){return this['channel'][_0xfed1('0x2e')](_0x35fb36,_0xfed1('0x1ac'));}var _0x4f012c={'body':_0x35fb36[_0xfed1('0x1ad')],'phone':_0x35fb36['to']||'','SmsAccountId':_0x90e94['id']};logger['debug'](_0xfed1('0x1ae'),JSON[_0xfed1('0x7c')](_0x4f012c));this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x35fb36,_0x35fb36[_0xfed1('0x1af')]);this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x1b0'),_0x90e94[_0xfed1('0x15')]));this[_0xfed1('0x37')][_0xfed1('0x79')](this,_0x4f012c);return this[_0xfed1('0x39')][_0xfed1('0xc5')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1b1')]=function(_0x4d1e87){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1b2'),_0x4d1e87['label']));if(!this['isConfigured'](_0x4d1e87['variable_id'])){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4d1e87,_0xfed1('0x1b3'));}var _0x38d9e8=this[_0xfed1('0x14')][_0xfed1('0x79')](this,_0x4d1e87[_0xfed1('0xea')]);if(!_0x38d9e8){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x4d1e87,'no\x20variable\x20found');}return this[_0xfed1('0x39')][_0xfed1('0xad')](_0x38d9e8,_0x4d1e87[_0xfed1('0x1b4')]);};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1b5')]=function(_0x61298){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1b6'),_0x61298[_0xfed1('0x3b')]));this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0x1b7'));var _0x413158=this[_0xfed1('0x39')]['getVariable']('XMCS-UNIQUEID');if(!_[_0xfed1('0x48')](_0x413158['extra'])){this[_0xfed1('0x39')][_0xfed1('0x3a')]=_0x413158[_0xfed1('0xb3')];}if(_0x61298[_0xfed1('0xc9')]===_0xfed1('0x1b8')){this['channel']['noop']('Answer');return this[_0xfed1('0x39')]['answer']();}return this['channel'][_0xfed1('0xc5')](_0xfed1('0x1b9'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1ba')]=function(_0x13d6f3){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1bb'),_0x13d6f3['label']));if(!this[_0xfed1('0x90')](_0x13d6f3[_0xfed1('0x1bc')])){return this['channel']['error'](_0x13d6f3,'no\x20subproject\x20selected');}var _0x327035=this[_0xfed1('0x1bd')][_0xfed1('0x79')](this,_0x13d6f3[_0xfed1('0x1bc')]);if(!this['isConfigured'](_0x327035)){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x13d6f3,util[_0xfed1('0x2b')](_0xfed1('0x1be'),_0x13d6f3[_0xfed1('0x1bc')]));}if(_0x327035===this[_0xfed1('0x39')][_0xfed1('0x3c')]){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x13d6f3,_0xfed1('0x1bf'));}this[_0xfed1('0x38')][_0xfed1('0x79')](this,_0x13d6f3,_0x327035);var _0x44da87=this[_0xfed1('0x39')][_0xfed1('0x5e')](_0xfed1('0x1c0'),util['format'](_0xfed1('0x1c1'),config['agi'][_0xfed1('0x1c2')]||_0xfed1('0x1c3'),_0x327035,this[_0xfed1('0x39')][_0xfed1('0x3c')]));if(_0x44da87[_0xfed1('0xb1')]===-0x1){return _0x44da87;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xd3'),_0xfed1('0x1c0'),_0x327035));};AGIVertices['prototype'][_0xfed1('0x1c4')]=function(_0x27c117){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1c5'),_0x27c117[_0xfed1('0x3b')]));var _0x278b73=this[_0xfed1('0x1c6')][_0xfed1('0x79')](this,_0x27c117[_0xfed1('0xc7')]);this['createSquareDetailsReport'][_0xfed1('0x79')](this,_0x27c117,_0x27c117[_0xfed1('0xc7')]);if(this['isConfigured'](_0x27c117[_0xfed1('0xea')])){var _0x112b61=this['getVariable'][_0xfed1('0x79')](this,_0x27c117['variable_id']);if(_0x112b61){this[_0xfed1('0x39')][_0xfed1('0xad')](_0x112b61,_0x278b73);return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x27c117[_0xfed1('0xc7')],_0x112b61));}}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x1c7'),_0x27c117[_0xfed1('0xc7')]));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1c8')]=function(_0x45c814){logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x1c9'),_0x45c814[_0xfed1('0x3b')]));_0x45c814[_0xfed1('0x64')]=_0x45c814[_0xfed1('0x64')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfed1('0x90')](_0x45c814[_0xfed1('0x62')])){return this[_0xfed1('0x39')][_0xfed1('0xc5')]('no\x20apiKey\x20configured');}if(!this[_0xfed1('0x90')](_0x45c814[_0xfed1('0x64')])){return this['channel'][_0xfed1('0xc5')](_0xfed1('0xb8'));}this[_0xfed1('0x39')]['noop'](util[_0xfed1('0x2b')](_0xfed1('0x1ca'),_0x45c814[_0xfed1('0x64')]));var _0x41f7bb=this['googleCloudTTS']['sync'](this,_0x45c814);if(_0x41f7bb){this['channel']['noop'](util[_0xfed1('0x2b')](_0xfed1('0x1cb'),_0x41f7bb));var _0x5d5794=this[_0xfed1('0x39')]['streamFile'](_0x41f7bb);try{fs[_0xfed1('0x113')](_0x41f7bb+_0xfed1('0x15e'));}catch(_0x114930){logger[_0xfed1('0x2e')](_0x114930);}return _0x5d5794;}return this['channel'][_0xfed1('0x2e')](_0x45c814,_0xfed1('0x1cc'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1cd')]=function(_0x5c6897){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1ce'),_0x5c6897[_0xfed1('0x3b')]));_0x5c6897[_0xfed1('0x64')]=_0x5c6897['text'][_0xfed1('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfed1('0x90')](_0x5c6897['text'])){return this[_0xfed1('0x39')][_0xfed1('0xc5')](_0xfed1('0xb8'));}this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x1cf'),_0x5c6897['text']));var _0x9672c8=this['googleTTS']['sync'](this,_0x5c6897);if(_0x9672c8){this[_0xfed1('0x39')][_0xfed1('0xc5')](util['format'](_0xfed1('0x1d0'),_0x9672c8));var _0x2a1b3f=this[_0xfed1('0x39')]['streamFile'](_0x9672c8);try{fs['unlink'](_0x9672c8+_0xfed1('0x15e'));}catch(_0x597f23){logger[_0xfed1('0x2e')](_0x597f23);}return _0x2a1b3f;}return this['channel'][_0xfed1('0x2e')](_0x5c6897,_0xfed1('0x1d1'));};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1d2')]=function(_0x4b18fc){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1d3'),_0x4b18fc[_0xfed1('0x3b')]));if(!this[_0xfed1('0x90')](_0x4b18fc[_0xfed1('0x161')])){return this['channel'][_0xfed1('0x2e')](_0x4b18fc,_0xfed1('0x165'));}logger['info'](util[_0xfed1('0x2b')](_0xfed1('0x162'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x4b18fc[_0xfed1('0x161')]));var _0x10f578=this[_0xfed1('0x58')][_0xfed1('0x79')](this,_0x4b18fc['findBy']);if(_0x10f578){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x163'),this[_0xfed1('0x39')][_0xfed1('0x3e')],_0x4b18fc[_0xfed1('0x161')]));this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x163'),this[_0xfed1('0x39')]['callerid'],_0x4b18fc[_0xfed1('0x161')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xfed1('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfed1('0x39')]['callerid'],_0x4b18fc[_0xfed1('0x161')]));this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0x164'),this[_0xfed1('0x39')]['callerid'],_0x4b18fc[_0xfed1('0x161')]));return{'code':0xc8,'result':_0xfed1('0x167')};}};AGIVertices[_0xfed1('0x18')][_0xfed1('0x1d4')]=function(_0x4aa330){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1d5'),_0x4aa330[_0xfed1('0x3b')]));var _0x2f277b=this[_0xfed1('0x39')]['exec'](_0xfed1('0x1d6'),[_0x4aa330[_0xfed1('0x1d7')],_0x4aa330[_0xfed1('0x82')]]);if(_0x2f277b[_0xfed1('0xb1')]===-0x1){return _0x2f277b;}return this[_0xfed1('0x39')][_0xfed1('0xc5')](util[_0xfed1('0x2b')](_0xfed1('0xd3'),_0xfed1('0x1d6'),_0x4aa330[_0xfed1('0x1d7')]));};AGIVertices['prototype'][_0xfed1('0x1d8')]=function(_0x3c6ed4){logger[_0xfed1('0x30')](util[_0xfed1('0x2b')](_0xfed1('0x1d9'),_0x3c6ed4['label']));if(!this[_0xfed1('0x90')](_0x3c6ed4[_0xfed1('0xea')])){return this[_0xfed1('0x39')]['error'](_0x3c6ed4,'no\x20variable\x20selected');}var _0x2161b0=this[_0xfed1('0x14')][_0xfed1('0x79')](this,_0x3c6ed4['variable_id']);if(!_0x2161b0){return this[_0xfed1('0x39')][_0xfed1('0x2e')](_0x3c6ed4,_0xfed1('0xeb'));}var _0x31c36d=this[_0xfed1('0x39')][_0xfed1('0x14')](_0x2161b0);return{'code':0xc8,'result':_0x31c36d[_0xfed1('0xb3')]?_0x31c36d[_0xfed1('0xb3')]:'-'};};String[_0xfed1('0x18')][_0xfed1('0xaf')]=function(_0x4c5beb,_0xb49485){return this[_0xfed1('0xae')](_0x4c5beb)[_0xfed1('0x1da')](_0xb49485);};module[_0xfed1('0x1db')]=AGIVertices; \ No newline at end of file +var _0xee24=['getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','appsecret','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','setVariable','length','split','replaceAll','extra','getAndSetVariable','result','sync','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','private_key','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','beep','tilde\x20%s\x20file\x20created','gotoc','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','file_id','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','opts','indexOf','macro','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','escape_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','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundById','save_name'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xee24,0x1a6));var _0x4ee2=function(_0x5df9c5,_0x3b41d3){_0x5df9c5=_0x5df9c5-0x0;var _0x1a4029=_0xee24[_0x5df9c5];return _0x1a4029;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x4ee2('0x0'));var sh=require(_0x4ee2('0x1'));var odbc=require('odbc')();var rs=require(_0x4ee2('0x2'));var moment=require(_0x4ee2('0x3'));var Mustache=require(_0x4ee2('0x4'));var rp=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var scripts=require(_0x4ee2('0x8'));var FILES_PATH=_0x4ee2('0x9');var recursiveMapAttributes=['rawHeaders',_0x4ee2('0xa')];var verticesWithRetry=[_0x4ee2('0xb'),_0x4ee2('0xc'),_0x4ee2('0xd')];var AGIVertices=function(_0x8d7266,_0x15f436,_0x32c572){this[_0x4ee2('0xe')]=_0x8d7266;this['rpc']=_0x15f436;this['mailRpc']=_0x32c572;};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x10')]=function(_0x36cf51,_0x2145d5){this[_0x4ee2('0x11')]['getVariableById'](_0x36cf51)[_0x4ee2('0x12')](function(_0x41bc11){_0x2145d5(null,_0x41bc11?_0x41bc11[_0x4ee2('0x13')]:![]);})[_0x4ee2('0x14')](function(_0x51f09d){_0x2145d5(_0x51f09d);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x15')]=function(_0x665d4d,_0x23c1c9){this['rpc']['getVoiceQueueById'](_0x665d4d)[_0x4ee2('0x12')](function(_0x2bf4c2){_0x23c1c9(null,_0x2bf4c2?_0x2bf4c2['name']:![]);})[_0x4ee2('0x14')](function(_0x231d5){_0x23c1c9(_0x231d5);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x16')]=function(_0x14bc72,_0x3b742c){this['rpc'][_0x4ee2('0x17')](_0x14bc72)[_0x4ee2('0x12')](function(_0x3d0308){_0x3b742c(null,_0x3d0308?_0x3d0308['name']:![]);})[_0x4ee2('0x14')](function(_0xb8e027){_0x3b742c(_0xb8e027);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x18')]=function(_0x92caf9,_0x341ca3){this[_0x4ee2('0x11')][_0x4ee2('0x19')](_0x92caf9)['then'](function(_0x4e82e3){_0x341ca3(null,_0x4e82e3?_0x4e82e3[_0x4ee2('0x1a')]:![]);})['catch'](function(_0x34c281){_0x341ca3(_0x34c281);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1b')]=function(_0x416a78,_0x4507d6){this['rpc'][_0x4ee2('0x1c')](_0x416a78)['then'](function(_0x1feac6){_0x4507d6(null,_0x1feac6?_0x1feac6[_0x4ee2('0x13')]:![]);})[_0x4ee2('0x14')](function(_0x1f4f90){_0x4507d6(_0x1f4f90);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1d')]=function(_0x381b3c,_0x581c75){this[_0x4ee2('0x11')]['getTrunkById'](_0x381b3c)['then'](function(_0xebd95f){_0x581c75(null,_0xebd95f?_0xebd95f[_0x4ee2('0x13')]:![]);})[_0x4ee2('0x14')](function(_0x1f79af){_0x581c75(_0x1f79af);});};AGIVertices[_0x4ee2('0xf')]['getSound']=function(_0x50005e,_0x404fba){var _0x2a078f=this;this['rpc'][_0x4ee2('0x1e')](_0x50005e)['then'](function(_0x49b1be){_0x404fba(null,_0x49b1be?_0x2a078f['getSoundPath'](_0x49b1be[_0x4ee2('0x1f')]):![]);})[_0x4ee2('0x14')](function(_0x50da2d){_0x404fba(_0x50da2d);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x20')]=function(_0x52db7b,_0xc7df80){this['rpc'][_0x4ee2('0x21')](_0x52db7b)[_0x4ee2('0x12')](function(_0x1fea65){_0xc7df80(null,_0x1fea65?_0x1fea65:![]);})['catch'](function(_0x4c1617){_0xc7df80(_0x4c1617);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x22')]=function(_0x3ab2a1,_0x502465,_0x1038e8){this[_0x4ee2('0x23')][_0x4ee2('0x22')](_0x3ab2a1,_0x502465)[_0x4ee2('0x12')](function(){_0x1038e8(null);})[_0x4ee2('0x14')](function(_0x2af2c0){_0x1038e8(_0x2af2c0);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x24')]=function(_0x256bea,_0x1231db){this[_0x4ee2('0x11')][_0x4ee2('0x25')](_0x256bea)['then'](function(_0x2f419b){if(_0x2f419b){if(_0x2f419b[_0x4ee2('0x26')]){_0x1231db(null,[_0x2f419b['interval']]);}else{_0x1231db(null,_[_0x4ee2('0x27')](_0x2f419b[_0x4ee2('0x28')],_0x4ee2('0x29')));}}else{_0x1231db(null,![]);}})[_0x4ee2('0x14')](function(_0x3f8416){_0x1231db(_0x3f8416);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x2a')]=function(_0x5b1c58){return util[_0x4ee2('0x2b')](_0x4ee2('0x2c'),FILES_PATH,_0x5b1c58);};AGIVertices[_0x4ee2('0xf')]['getQueryOdbc']=function(_0x208374,_0x5639c8,_0x1079b6){odbc[_0x4ee2('0x2d')](_0x208374,function(_0x40b6ba){if(_0x40b6ba){logger[_0x4ee2('0x2e')](_0x4ee2('0x2f'),_0x40b6ba);_0x1079b6(_0x40b6ba);}else{logger[_0x4ee2('0x30')]('ODBC\x20connection\x20successfully');odbc['query'](_0x5639c8,function(_0x3542a7,_0x3f2c6a){if(_0x3542a7){logger[_0x4ee2('0x30')](_0x4ee2('0x31'),_0x5639c8);_0x1079b6(_0x3542a7);}else{logger[_0x4ee2('0x30')](_0x4ee2('0x32'),_0x5639c8);odbc[_0x4ee2('0x33')](function(_0x29c4b3){if(_0x29c4b3){logger[_0x4ee2('0x2e')](_0x4ee2('0x34'),_0x29c4b3);}_0x1079b6(null,_0x3f2c6a);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x2e12f3,_0x2b54f1){this[_0x4ee2('0x11')]['getSmsAccountById'](_0x2e12f3)[_0x4ee2('0x12')](function(_0x2dee01){_0x2b54f1(null,_0x2dee01?_0x2dee01:![]);})[_0x4ee2('0x14')](function(_0x31d798){_0x2b54f1(_0x31d798);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x35')]=function(_0x6b643f,_0x766ea5){this[_0x4ee2('0x11')][_0x4ee2('0x35')](_0x6b643f)['then'](function(_0x5d4395){_0x766ea5(null,_0x5d4395);})[_0x4ee2('0x14')](function(_0xf327be){_0x766ea5(_0xf327be);});};AGIVertices[_0x4ee2('0xf')]['createSquareDetailsReport']=function(_0x1ef1d5,_0x56fd09,_0x34a074){this['rpc'][_0x4ee2('0x36')]({'uniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'node':_0x1ef1d5['label'],'application':_0x1ef1d5[_0x4ee2('0x38')],'data':_0x56fd09||null,'project_name':this['channel'][_0x4ee2('0x39')],'callerid':this[_0x4ee2('0xe')][_0x4ee2('0x3a')]})[_0x4ee2('0x12')](function(_0x4f4687){if(_0x34a074){_0x34a074(null,_0x4f4687);}})[_0x4ee2('0x14')](function(_0x2ca3c1){if(_0x34a074){_0x34a074(_0x2ca3c1);}});};AGIVertices['prototype'][_0x4ee2('0x3b')]=function(_0x5dd440,_0x4b5061,_0x11cd7a,_0x54df9a){this[_0x4ee2('0x11')]['createSquareRecording']({'uniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'callerid':this[_0x4ee2('0xe')]['callerid'],'calleridname':this[_0x4ee2('0xe')][_0x4ee2('0x3c')],'context':this[_0x4ee2('0xe')][_0x4ee2('0x3d')],'extension':this[_0x4ee2('0xe')]['extension'],'priority':this[_0x4ee2('0xe')][_0x4ee2('0x3e')],'accountcode':this['channel']['accountcode'],'dnid':this[_0x4ee2('0xe')]['dnid'],'projectName':this[_0x4ee2('0xe')][_0x4ee2('0x39')],'saveName':_0x4b5061,'filename':_0x5dd440['file']||_0x4b5061,'savePath':_0x11cd7a})[_0x4ee2('0x12')](function(_0x2bf21a){_0x54df9a(null,_0x2bf21a);})[_0x4ee2('0x14')](function(_0x4ae648){_0x54df9a(_0x4ae648);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x3f')]=function(_0x4f3fa6,_0x5204b0,_0x4c811a,_0x5ec387,_0x2b053a){this[_0x4ee2('0x11')]['createSquareMessage']({'uniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'body':_0x4f3fa6,'direction':_0x5204b0,'providerName':_0x4c811a,'providerResponse':_0x5ec387})[_0x4ee2('0x12')](function(_0x1bd005){if(_0x2b053a){_0x2b053a(null,_0x1bd005);}})[_0x4ee2('0x14')](function(_0x152519){if(_0x2b053a){_0x2b053a(_0x152519);}});};AGIVertices[_0x4ee2('0xf')]['createCmContact']=function(_0x4498af,_0x517e9a){this[_0x4ee2('0x11')][_0x4ee2('0x40')]({'firstName':_[_0x4ee2('0x41')](_0x4498af['name'])||_[_0x4ee2('0x42')](_0x4498af[_0x4ee2('0x13')])?_0x4ee2('0x43')+Math['random']():_0x4498af['name'],'lastName':_[_0x4ee2('0x41')](_0x4498af[_0x4ee2('0x44')])||_[_0x4ee2('0x42')](_0x4498af[_0x4ee2('0x44')])?null:_0x4498af['lastName'],'phone':_0x4498af[_0x4ee2('0x45')],'ListId':_0x4498af[_0x4ee2('0x46')],'scheduledat':_0x4498af[_0x4ee2('0x47')],'callbackUniqueid':this[_0x4ee2('0xe')][_0x4ee2('0x37')],'tags':_0x4ee2('0x48'),'description':_0x4ee2('0x49')+_0x4498af[_0x4ee2('0x47')][_0x4ee2('0x4a')](),'priority':_0x4498af[_0x4ee2('0x4b')]})[_0x4ee2('0x12')](function(_0x1a1021){_0x517e9a(null,_0x1a1021);})['catch'](function(_0x59fb25){_0x517e9a(_0x59fb25);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x4c')]=function(_0x2b6465,_0x58c98d){this['rpc'][_0x4ee2('0x4d')](_0x2b6465)[_0x4ee2('0x12')](function(_0xf00660){_0x58c98d(null,_0xf00660?_0xf00660['name']:![]);})[_0x4ee2('0x14')](function(_0xc2d88f){_0x58c98d(_0xc2d88f);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x4e')]=function(_0x430dfc,_0x5a9dac,_0x55e0a4){var _0x2c7b92={'role':_0x4ee2('0x4f')};_0x2c7b92[_0x430dfc]=this['channel'][_0x4ee2('0x3a')];this[_0x4ee2('0x11')][_0x4ee2('0x4e')](_0x2c7b92,_0x5a9dac,this[_0x4ee2('0xe')][_0x4ee2('0x37')])['then'](function(_0x344e1c){_0x55e0a4(null,_['isNil'](_0x344e1c)?![]:!![]);})[_0x4ee2('0x14')](function(_0x450f98){logger['error'](_0x450f98);_0x55e0a4(null,![]);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x50')]=function(_0x3686e5,_0x1d6b21){var _0x592ce6={'role':_0x4ee2('0x4f')};_0x592ce6[_0x3686e5]=this[_0x4ee2('0xe')]['callerid'];this[_0x4ee2('0x11')][_0x4ee2('0x50')](_0x592ce6)[_0x4ee2('0x12')](function(_0x1f542a){_0x1d6b21(null,_['isNil'](_0x1f542a)?![]:!![]);})[_0x4ee2('0x14')](function(_0x3b3723){logger[_0x4ee2('0x2e')](_0x3b3723);_0x1d6b21(null,![]);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x51')]=function(_0x1b7bfc,_0x4c5988){var _0x211e6d={'role':_0x4ee2('0x4f')};_0x211e6d[_0x1b7bfc]=this[_0x4ee2('0xe')][_0x4ee2('0x3a')];this[_0x4ee2('0x11')][_0x4ee2('0x51')](_0x211e6d)[_0x4ee2('0x12')](function(_0x2136ad){_0x4c5988(null,_['isNil'](_0x2136ad)?![]:!![]);})['catch'](function(_0x5de0d2){logger[_0x4ee2('0x2e')](_0x5de0d2);_0x4c5988(null,![]);});};AGIVertices['prototype'][_0x4ee2('0x52')]=function(_0xcdf9c2,_0x355212){var _0x4c8d70={'role':'agent'};_0x4c8d70[_0xcdf9c2]=this[_0x4ee2('0xe')][_0x4ee2('0x3a')];var _0x4217f9=_0xcdf9c2!=_0x4ee2('0x53')?util[_0x4ee2('0x2b')](_0x4ee2('0x54'),'LOCAL',this[_0x4ee2('0xe')][_0x4ee2('0x3a')]):undefined;this[_0x4ee2('0x11')][_0x4ee2('0x52')](_0x4c8d70,_0x4217f9)[_0x4ee2('0x12')](function(_0x414e7d){_0x355212(null,_[_0x4ee2('0x42')](_0x414e7d)?![]:!![]);})[_0x4ee2('0x14')](function(_0x136ec5){logger['error'](_0x136ec5);_0x355212(null,![]);});};AGIVertices['prototype'][_0x4ee2('0x55')]=function(_0x4a3f7a,_0x46d1cb){sh['exec'](_['trim'](_0x4a3f7a),function(_0x342146,_0x3ef394){var _0x5671d5=_0x3ef394[_0x4ee2('0x56')](/(\r\n|\n|\r)/gm,'');_0x46d1cb(null,_0x5671d5);});};AGIVertices['prototype'][_0x4ee2('0x57')]=function(_0x3f23f1,_0x3aa69e){scripts['googleCloudTTS'](_0x3f23f1[_0x4ee2('0x58')],_0x3f23f1[_0x4ee2('0x59')]||'text',_0x3f23f1[_0x4ee2('0x5a')],_0x3f23f1[_0x4ee2('0x5b')]||_0x4ee2('0x5c'),_0x3f23f1[_0x4ee2('0x5d')]||_0x4ee2('0x5e'),_0x3f23f1[_0x4ee2('0x5f')]||_0x4ee2('0x60'))['then'](function(_0x48fbf7){_0x3aa69e(null,_0x48fbf7);})[_0x4ee2('0x14')](function(_0x15db25){_0x3aa69e(_0x15db25);});};AGIVertices[_0x4ee2('0xf')]['googleTTS']=function(_0x341b16,_0x41a850){scripts['googleTTS'](_0x341b16['text'],_0x341b16[_0x4ee2('0x61')]||'en',0x1)['then'](function(_0x23e898){_0x41a850(null,_0x23e898);})[_0x4ee2('0x14')](function(_0x479826){_0x41a850(_0x479826);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x62')]=function(_0x147353,_0x3428e0){var _0x2c3b73={'uri':_0x147353[_0x4ee2('0x63')],'method':_0x147353[_0x4ee2('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x147353[_0x4ee2('0x65')])===_0x4ee2('0x66')&&parseInt(_0x147353[_0x4ee2('0x65')])>=0x1?parseInt(_0x147353[_0x4ee2('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x4ee2('0x67')]([_0x4ee2('0x68'),_0x4ee2('0x69')],_0x2c3b73[_0x4ee2('0x64')][_0x4ee2('0x6a')]())){try{_0x2c3b73[_0x4ee2('0x6b')]=_0x147353[_0x4ee2('0xa')]?JSON[_0x4ee2('0x6c')](_0x147353[_0x4ee2('0xa')]):{};}catch(_0x3a4394){logger[_0x4ee2('0x2e')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3a4394);}}try{_0x2c3b73[_0x4ee2('0x6d')]=_0x147353[_0x4ee2('0x6e')]?JSON[_0x4ee2('0x6c')](_0x147353[_0x4ee2('0x6e')]):{};}catch(_0x2ec121){logger[_0x4ee2('0x2e')](_0x4ee2('0x6f'),_0x2ec121);}if(_0x147353[_0x4ee2('0x70')]){try{var _0x49e09e=require(_0x147353[_0x4ee2('0x70')])['sync'](this,_0x2c3b73);_0x2c3b73[_0x4ee2('0x71')]=Mustache[_0x4ee2('0x72')](_0x147353[_0x4ee2('0x63')],_0x49e09e,{},['$$','$$']);if(_0x2c3b73['headers']){_0x2c3b73[_0x4ee2('0x6d')]=JSON[_0x4ee2('0x6c')](Mustache[_0x4ee2('0x72')](JSON[_0x4ee2('0x73')](_0x2c3b73[_0x4ee2('0x6d')]),_0x49e09e,{},['$$','$$']));}if(_0x2c3b73[_0x4ee2('0x6b')]){_0x2c3b73[_0x4ee2('0x6b')]=JSON[_0x4ee2('0x6c')](Mustache[_0x4ee2('0x72')](JSON[_0x4ee2('0x73')](_0x2c3b73[_0x4ee2('0x6b')]),_0x49e09e,{},['$$','$$']));}}catch(_0x5e3e6d){logger[_0x4ee2('0x2e')](_0x4ee2('0x74'),_0x5e3e6d);}}rp(_0x2c3b73)['then'](function(_0x56c789){var _0x576440={'statusCode':_0x56c789[_0x4ee2('0x75')]||0xc8,'statusMessage':_0x56c789[_0x4ee2('0x76')]||'OK','headers':_0x56c789[_0x4ee2('0x6d')]||{},'body':_0x56c789[_0x4ee2('0x6b')]||{}};_0x3428e0(null,_0x576440);})[_0x4ee2('0x14')](function(_0x123b2f){var _0x2138c0={'statusCode':_0x123b2f[_0x4ee2('0x75')]||0x1f4,'statusMessage':_0x123b2f[_0x4ee2('0x77')]||_0x4ee2('0x78'),'headers':_0x123b2f[_0x4ee2('0x79')]['headers']||{},'body':_0x123b2f[_0x4ee2('0x79')]['body']||{}};_0x3428e0(null,_0x2138c0);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x7a')]=function(_0x6b233c,_0x2575a5){scripts[_0x4ee2('0x7a')](this[_0x4ee2('0xe')][_0x4ee2('0x37')],_0x6b233c[_0x4ee2('0x7b')],_0x6b233c[_0x4ee2('0x5a')],_0x6b233c[_0x4ee2('0x7c')]||'en')[_0x4ee2('0x12')](function(_0x1278ed){_0x2575a5(null,_0x1278ed);})[_0x4ee2('0x14')](function(_0x43d92b){_0x2575a5(_0x43d92b);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x7d')]=function(_0x43fa53,_0x5266f3){scripts[_0x4ee2('0x7d')](this[_0x4ee2('0xe')][_0x4ee2('0x37')],_0x43fa53[_0x4ee2('0x7e')],_0x43fa53[_0x4ee2('0x7f')],_0x43fa53['private_key'],_0x43fa53[_0x4ee2('0x5a')],_0x43fa53[_0x4ee2('0x80')]||'en')[_0x4ee2('0x12')](function(_0x2d91f4){_0x5266f3(null,_0x2d91f4);})['catch'](function(_0x35f757){_0x5266f3(_0x35f757);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x81')]=function(_0x4d041a,_0x26409a){scripts[_0x4ee2('0x81')](this[_0x4ee2('0xe')],_0x4d041a)[_0x4ee2('0x12')](function(_0x4b8a60){_0x26409a(null,_0x4b8a60);})[_0x4ee2('0x14')](function(_0x26632b){_0x26409a(_0x26632b);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x82')]=function(_0x242f3c,_0x1f6b62){scripts[_0x4ee2('0x82')](_0x242f3c['key'],_0x242f3c[_0x4ee2('0x5a')],_0x242f3c[_0x4ee2('0x83')]||_0x4ee2('0x5c'),_0x242f3c[_0x4ee2('0x84')])[_0x4ee2('0x12')](function(_0xa8d142){_0x1f6b62(null,_0xa8d142);})['catch'](function(_0x3769d1){_0x1f6b62(_0x3769d1);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x85')]=function(_0x36400e,_0x482e30,_0x26baa9){scripts['ispeechASR'](_0x482e30,_0x36400e['key'],_0x36400e[_0x4ee2('0x86')]||'en-US',this[_0x4ee2('0x87')](_0x36400e[_0x4ee2('0x88')])?_0x36400e['model']:undefined)[_0x4ee2('0x12')](function(_0x443c8a){_0x26baa9(null,_0x443c8a);})[_0x4ee2('0x14')](function(_0x5b8f7c){_0x26baa9(_0x5b8f7c);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x89')]=function(_0x16a3e8,_0x51ce91){scripts[_0x4ee2('0x89')](_0x16a3e8[_0x4ee2('0x8a')],_0x16a3e8['aws_secret_access_key'],_0x16a3e8[_0x4ee2('0x8b')],_0x16a3e8[_0x4ee2('0x8c')]||'Amy',_0x16a3e8[_0x4ee2('0x5a')],_0x16a3e8['aws_text_type']||_0x4ee2('0x5a'))[_0x4ee2('0x12')](function(_0x2563dc){_0x51ce91(null,_0x2563dc);})[_0x4ee2('0x14')](function(_0x3b8258){_0x51ce91(_0x3b8258);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x8d')]=function(_0x37a383,_0x51ee21){scripts[_0x4ee2('0x8d')](this[_0x4ee2('0xe')][_0x4ee2('0x37')],_0x37a383[_0x4ee2('0x8a')],_0x37a383[_0x4ee2('0x8e')],_0x37a383['aws_lex_region'],_0x37a383[_0x4ee2('0x5a')],_0x37a383[_0x4ee2('0x8f')])[_0x4ee2('0x12')](function(_0x56cecc){_0x51ee21(null,_0x56cecc);})[_0x4ee2('0x14')](function(_0x4dba92){_0x51ee21(_0x4dba92);});};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x90')]=function(_0x48f431,_0x13a431,_0x1cbe7f){scripts[_0x4ee2('0x90')](_0x13a431,_0x48f431[_0x4ee2('0x7b')],_0x48f431['google_asr_language']||_0x4ee2('0x5c'))['then'](function(_0x4561e4){_0x1cbe7f(null,_0x4561e4);})[_0x4ee2('0x14')](function(_0x404994){_0x1cbe7f(_0x404994);});};AGIVertices['prototype'][_0x4ee2('0x91')]=function(_0x522acb,_0x46f54d,_0x31e4c1){scripts[_0x4ee2('0x91')](_0x46f54d,_0x522acb[_0x4ee2('0x92')],_0x522acb[_0x4ee2('0x93')],_0x522acb[_0x4ee2('0x71')])[_0x4ee2('0x12')](function(_0x2931f0){_0x31e4c1(null,_0x2931f0);})[_0x4ee2('0x14')](function(_0x2863f5){_0x31e4c1(_0x2863f5);});};AGIVertices[_0x4ee2('0xf')]['clear']=function(_0x40facd){var _0x233bbb=_[_0x4ee2('0x67')](verticesWithRetry,_0x40facd[_0x4ee2('0x38')])?_0x40facd:_['clone'](_0x40facd);for(var _0x407229 in _0x233bbb){if(_0x233bbb[_0x4ee2('0x94')](_0x407229)){if(_0x233bbb[_0x407229]&&_[_0x4ee2('0x95')](_0x233bbb[_0x407229])){if(_[_0x4ee2('0x67')](recursiveMapAttributes,_0x407229)){_0x233bbb[_0x407229]=this[_0x4ee2('0x96')](_0x233bbb[_0x407229]);}else{_0x233bbb[_0x407229]=this[_0x4ee2('0x97')](_0x233bbb[_0x407229]);}}}}return _0x233bbb;};AGIVertices[_0x4ee2('0xf')]['recursiveNodeIndex']=function(_0x174742){for(var _0x47b089 in _0x174742){if(_0x174742[_0x4ee2('0x94')](_0x47b089)){if(_[_0x4ee2('0x98')](_0x174742[_0x47b089])){this[_0x4ee2('0x99')](_0x174742[_0x47b089]);}else if(_[_0x4ee2('0x9a')](_0x174742[_0x47b089])){for(var _0x2d4ac2=0x0;_0x2d4ac2<_0x174742[_0x47b089]['length'];_0x2d4ac2++){this[_0x4ee2('0x99')](_0x174742[_0x47b089][_0x2d4ac2]);}}else if(_[_0x4ee2('0x95')](_0x174742[_0x47b089])){_0x174742[_0x47b089]=this['replaceAllVariables'](_0x174742[_0x47b089]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x4f87ea,_0x5d25e6){for(var _0x40d990 in _0x4f87ea){if(_0x4f87ea[_0x4ee2('0x94')](_0x40d990)){if(_[_0x4ee2('0x98')](_0x4f87ea[_0x40d990])){if(!_[_0x4ee2('0x41')](_0x4f87ea[_0x40d990])){this[_0x4ee2('0x9b')](_0x4f87ea[_0x40d990],util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x5d25e6,_0x40d990));}}else if(_[_0x4ee2('0x9a')](_0x4f87ea[_0x40d990])){for(var _0x895e40=0x0;_0x895e40<_0x4f87ea[_0x40d990]['length'];_0x895e40++){this[_0x4ee2('0x9b')](_0x4f87ea[_0x40d990][_0x895e40],util[_0x4ee2('0x2b')]('%s.%s',_0x5d25e6,_0x40d990+'['+_0x895e40+']'));}}else{if(!_[_0x4ee2('0x42')](_0x4f87ea[_0x40d990])){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')]('%s.%s',_0x5d25e6,_0x40d990),_0x4f87ea[_0x40d990]);}}}}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x96')]=function(_0x43f703){try{var _0x7467dc=JSON['parse'](_0x43f703);this[_0x4ee2('0x99')](_0x7467dc);return JSON[_0x4ee2('0x73')](_0x7467dc);}catch(_0x4b1b33){return this[_0x4ee2('0x97')](_0x43f703);}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x97')]=function(_0xe5eb1e){var _0x2b38ec=_0xe5eb1e['split']('{');for(var _0x13f585=0x1;_0x13f585<_0x2b38ec[_0x4ee2('0x9e')];_0x13f585+=0x1){var _0x16eecf=_0x2b38ec[_0x13f585][_0x4ee2('0x9f')]('}');if(_0x16eecf[_0x4ee2('0x9e')]>0x1){_0xe5eb1e=_0xe5eb1e[_0x4ee2('0xa0')]('{'+_0x16eecf[0x0]+'}',this[_0x4ee2('0xe')][_0x4ee2('0x10')](_0x16eecf[0x0])[_0x4ee2('0xa1')]||_0x16eecf[0x0]);}}if(_0x2b38ec[_0x4ee2('0x9e')]===0x1){return _0xe5eb1e[_0x4ee2('0x4a')]();}return this[_0x4ee2('0x97')](_0xe5eb1e);};AGIVertices['prototype'][_0x4ee2('0xa2')]=function(_0x3c7444,_0x4b6a7e){var _0x233cb1=this[_0x4ee2('0xe')][_0x4ee2('0x10')](_0x3c7444);if(_0x233cb1[_0x4ee2('0xa3')]===-0x1){return _0x233cb1;}logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4b6a7e,_0x233cb1['extra']));return this[_0x4ee2('0xe')][_0x4ee2('0x9d')](_0x4b6a7e,_0x233cb1[_0x4ee2('0xa1')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x87')]=function(_0x2110f4){return _0x2110f4&&_0x2110f4!=='0'&&_0x2110f4!=='-1'&&_0x2110f4!=='';};AGIVertices['prototype']['maxRetry']=function(_0x7f4a3d){this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x7f4a3d,'-');_0x7f4a3d[_0x4ee2('0xa5')]=_0x7f4a3d[_0x4ee2('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x4ee2('0xa7')]=function(_0x56229e){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xa8'),_0x56229e['label']));if(!this['isConfigured'](_0x56229e['text'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}var _0x1c7f39='\x22'+_0x56229e['text']+'\x22';if(this[_0x4ee2('0x87')](_0x56229e['options'])){_0x1c7f39+=','+_0x56229e['options'];}var _0x158dcf=this[_0x4ee2('0xe')][_0x4ee2('0xab')]('MRCPSynth',_0x1c7f39);if(_0x158dcf['result']===-0x1){return _0x158dcf;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xac'),_0x1c7f39));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xad')]=function(_0x4e8af6){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0xae'),_0x4e8af6[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x4e8af6[_0x4ee2('0xb0')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xb1'));}var _0x495526=_0x4e8af6[_0x4ee2('0xb0')];if(this[_0x4ee2('0x87')](_0x4e8af6[_0x4ee2('0x79')])){_0x495526+=','+_0x4e8af6[_0x4ee2('0x79')];}var _0x3b97d1=this['channel'][_0x4ee2('0xab')]('MRCPRecog',_0x495526);if(_0x3b97d1[_0x4ee2('0xa3')]===-0x1){return _0x3b97d1;}var _0x3c673e=this[_0x4ee2('0xa2')](_0x4ee2('0xb2'),_0x4ee2('0xb3'));if(_0x3c673e['result']===-0x1){return _0x3c673e;}var _0x53ac13=this[_0x4ee2('0xa2')](_0x4ee2('0xb4'),_0x4ee2('0xb5'));if(_0x53ac13[_0x4ee2('0xa3')]===-0x1){return _0x53ac13;}var _0x4fc99f=this[_0x4ee2('0xa2')](_0x4ee2('0xb6'),_0x4ee2('0xb7'));if(_0x4fc99f[_0x4ee2('0xa3')]===-0x1){return _0x4fc99f;}return this['channel'][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xb8'),_0x495526));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x6')]=function(_0x205c95){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xb9'),_0x205c95['label']));return this[_0x4ee2('0xe')][_0x4ee2('0x6')]([_0x205c95[_0x4ee2('0xba')],_0x205c95[_0x4ee2('0xbb')]]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xbc')]=function(_0x9c83d8){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x9c83d8[_0x4ee2('0xaf')]));if(this[_0x4ee2('0x87')](_0x9c83d8[_0x4ee2('0x65')])){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xbd'),_0x9c83d8[_0x4ee2('0x65')]));var _0x5f4522=this['channel']['wait'](_0x9c83d8[_0x4ee2('0x65')]);if(_0x5f4522[_0x4ee2('0xa3')]===-0x1){return _0x5f4522;}}return this[_0x4ee2('0xe')][_0x4ee2('0xbc')]();};AGIVertices[_0x4ee2('0xf')]['callback']=function(_0x306f41){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xbe'),_0x306f41['label']));if(!this['isConfigured'](_0x306f41[_0x4ee2('0x46')])){return this['channel']['error'](_0x306f41,_0x4ee2('0xbf'));}_0x306f41[_0x4ee2('0x47')]=moment();if(this[_0x4ee2('0x87')](_0x306f41[_0x4ee2('0xc0')])){_0x306f41['scheduledAt']=moment()[_0x4ee2('0xc1')](_0x306f41[_0x4ee2('0xc0')],_0x4ee2('0xc2'));}if(!this[_0x4ee2('0x87')](_0x306f41[_0x4ee2('0x4b')])){_0x306f41['callback_priority']=0x2;}this['createCmContact']['sync'](this,_0x306f41);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x306f41[_0x4ee2('0x45')],_0x306f41[_0x4ee2('0x46')],_0x306f41['scheduledAt']));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xc3')]=function(_0x3c032f){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xc4'),_0x3c032f['label']));var _0x304ea8=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x3c032f[_0x4ee2('0xc5')],_0x3c032f['options']);if(_0x304ea8[_0x4ee2('0xa3')]===-0x1){return _0x304ea8;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xc6'),_0x3c032f['application'],_0x3c032f[_0x4ee2('0x79')]));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xc7')]=function(_0xf6c0d3){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xc8'),_0xf6c0d3[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0xf6c0d3[_0x4ee2('0x5a')])){return this['channel']['noop'](_0x4ee2('0xaa'));}var _0x77603f='\x22'+_0xf6c0d3['text']+'\x22';if(this['isConfigured'](_0xf6c0d3[_0x4ee2('0x79')])){_0x77603f+=','+_0xf6c0d3[_0x4ee2('0x79')];}var _0x3ab010=this[_0x4ee2('0xe')][_0x4ee2('0xab')]('MRCPSynth',_0x77603f);if(_0x3ab010[_0x4ee2('0xa3')]===-0x1){return _0x3ab010;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xac'),_0x77603f));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xc9')]=function(_0x34e9b4){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xca'),_0x34e9b4[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x34e9b4[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}var _0x312c00='\x22'+_0x34e9b4[_0x4ee2('0x5a')]+'\x22';if(this['isConfigured'](_0x34e9b4['options'])){_0x312c00+=','+_0x34e9b4['options'];}var _0x25e928=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0xcb'),_0x312c00);if(_0x25e928[_0x4ee2('0xa3')]===-0x1){return _0x25e928;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x312c00));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xcc')]=function(_0xc3e95d){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xcd'),_0xc3e95d[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0xc3e95d[_0x4ee2('0xb0')])){return this[_0x4ee2('0xe')]['noop']('no\x20grammar\x20configured');}var _0x4dab6d=_0xc3e95d[_0x4ee2('0xb0')];if(this[_0x4ee2('0x87')](_0xc3e95d[_0x4ee2('0x79')])){_0x4dab6d+=','+_0xc3e95d[_0x4ee2('0x79')];}var _0x1b1e00=this['channel'][_0x4ee2('0xab')](_0x4ee2('0xce'),_0x4dab6d);if(_0x1b1e00['result']===-0x1){return _0x1b1e00;}var _0x5735af=this[_0x4ee2('0xa2')](_0x4ee2('0xb2'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5735af[_0x4ee2('0xa3')]===-0x1){return _0x5735af;}var _0x57b45b=this[_0x4ee2('0xa2')]('RECOG_INPUT()',_0x4ee2('0xcf'));if(_0x57b45b[_0x4ee2('0xa3')]===-0x1){return _0x57b45b;}var _0x47d86f=this[_0x4ee2('0xa2')](_0x4ee2('0xb6'),'LUMENVOX_ASR_INSTANCE');if(_0x47d86f[_0x4ee2('0xa3')]===-0x1){return _0x47d86f;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x4dab6d));};AGIVertices[_0x4ee2('0xf')]['sestekasr']=function(_0x4f2167){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xd0'),_0x4f2167[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x4f2167[_0x4ee2('0xb0')])){return this['channel'][_0x4ee2('0xa9')]('no\x20grammar\x20configured');}var _0x5bab10=_0x4f2167[_0x4ee2('0xb0')];if(this['isConfigured'](_0x4f2167[_0x4ee2('0x79')])){_0x5bab10+=','+_0x4f2167[_0x4ee2('0x79')];}var _0x4a9e90=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0xce'),_0x5bab10);if(_0x4a9e90['result']===-0x1){return _0x4a9e90;}var _0xc4505c=this[_0x4ee2('0xa2')]('RECOG_CONFIDENCE()',_0x4ee2('0xd1'));if(_0xc4505c[_0x4ee2('0xa3')]===-0x1){return _0xc4505c;}var _0x2c206d=this['getAndSetVariable']('RECOG_INPUT()',_0x4ee2('0xd2'));if(_0x2c206d[_0x4ee2('0xa3')]===-0x1){return _0x2c206d;}var _0x16f54a=this[_0x4ee2('0xa2')](_0x4ee2('0xb6'),_0x4ee2('0xd3'));if(_0x16f54a[_0x4ee2('0xa3')]===-0x1){return _0x16f54a;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xb8'),_0x5bab10));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xd4')]=function(_0x367d0b){logger['info'](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x367d0b[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x367d0b[_0x4ee2('0xd5')])){return this['channel'][_0x4ee2('0x2e')](_0x367d0b,_0x4ee2('0xd6'));}var _0x15e343=this['getSquareOdbc'][_0x4ee2('0xa4')](this,_0x367d0b[_0x4ee2('0xd5')]);if(!_0x15e343){return this[_0x4ee2('0xe')]['error'](_0x367d0b,'no\x20odbc\x20database\x20found');}if(!this[_0x4ee2('0x87')](_0x367d0b['query'])){return this['channel'][_0x4ee2('0x2e')](_0x367d0b,_0x4ee2('0xd7'));}var _0x343867=_0x367d0b[_0x4ee2('0xd8')][_0x4ee2('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x4ee2('0xa9')](util['format']('query:\x20%s',_0x343867));var _0x561f73=this[_0x4ee2('0xd9')]['sync'](this,_0x15e343,_0x343867);this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x367d0b,_0x343867);if(!this[_0x4ee2('0x87')](_0x367d0b[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xdb'));}var _0x2f1c00=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x367d0b[_0x4ee2('0xda')]);if(!_0x2f1c00){return this[_0x4ee2('0xe')]['error'](_0x367d0b,_0x4ee2('0xdc'));}var _0x169d4b=this;_0x561f73['forEach'](function(_0x3928a6,_0x47918d){Object[_0x4ee2('0xdd')](_0x3928a6)[_0x4ee2('0xde')](function(_0x1f885b){_0x169d4b[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0xdf'),_0x2f1c00,_0x47918d,_0x1f885b),_0x3928a6[_0x1f885b]);});});this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util['format'](_0x4ee2('0xe0'),_0x2f1c00),_0x561f73['length']);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xe1'),_0x2f1c00));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xe2')]=function(_0x17c91f){logger[_0x4ee2('0xe3')](util[_0x4ee2('0x2b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x17c91f['label']));if(!this['isConfigured'](_0x17c91f[_0x4ee2('0xe4')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x17c91f,_0x4ee2('0xe5'));}var _0x25bfeb=this[_0x4ee2('0x1b')]['sync'](this,_0x17c91f['sip_id']);if(!_0x25bfeb){return this['channel'][_0x4ee2('0x2e')](_0x17c91f,_0x4ee2('0xe6'));}var _0x22338e=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0xe7'),[util[_0x4ee2('0x2b')]('SIP/%s',_0x25bfeb),_0x17c91f[_0x4ee2('0x65')],_0x17c91f['opts'],_0x17c91f[_0x4ee2('0x63')]]);if(_0x22338e['result']===-0x1){return _0x22338e;}return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xe8')]=function(_0xb51d01){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0xe9'),_0xb51d01[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0xb51d01[_0x4ee2('0x7b')])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0xea'));}if(!this['isConfigured'](_0xb51d01[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')]['noop']('no\x20text\x20configured');}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this[_0x4ee2('0x36')](_0xb51d01);this[_0x4ee2('0x3f')](_0xb51d01[_0x4ee2('0x5a')],'in','','');this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xec'),_0xb51d01['text']));var _0x3122d8=this[_0x4ee2('0x7a')]['sync'](this,_0xb51d01);if(_0x3122d8){for(var _0x226085 in _0x3122d8){if(_0x3122d8[_0x4ee2('0x94')](_0x226085)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0xed'),_0x226085['toUpperCase']()),_0x3122d8[_0x226085]);}}this[_0x4ee2('0x3f')](_0x3122d8['speech'],_0x4ee2('0xee'),'dialogflow','');return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Dialogflow\x20Result\x20%s',_0x3122d8[_0x4ee2('0xef')]));}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0xb51d01,_0x4ee2('0xf0'));};AGIVertices[_0x4ee2('0xf')]['dialogflowV2']=function(_0x1b0ae6){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0xf1'),_0x1b0ae6[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x1b0ae6[_0x4ee2('0x7e')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xf2'));}if(!this[_0x4ee2('0x87')](_0x1b0ae6['client_email'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x1b0ae6[_0x4ee2('0xf3')])){return this['channel'][_0x4ee2('0xa9')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x1b0ae6[_0x4ee2('0x80')])){return this['channel'][_0x4ee2('0xa9')]('no\x20anguage\x20configured');}if(!this[_0x4ee2('0x87')](_0x1b0ae6[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this[_0x4ee2('0x36')](_0x1b0ae6);this[_0x4ee2('0x3f')](_0x1b0ae6['text'],'in','','');this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0xf4'),_0x1b0ae6[_0x4ee2('0x5a')]));var _0x74282a=this[_0x4ee2('0x7d')]['sync'](this,_0x1b0ae6);if(_0x74282a){for(var _0x1563d0 in _0x74282a){if(_0x74282a[_0x4ee2('0x94')](_0x1563d0)){if(_0x1563d0!==_0x4ee2('0xf5')){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util['format'](_0x4ee2('0xed'),_0x1563d0[_0x4ee2('0x6a')]()),_0x74282a[_0x1563d0]);}}}this[_0x4ee2('0x3f')](_0x74282a['speech'],_0x4ee2('0xee'),_0x4ee2('0xf6'),_0x74282a['providerResponse']);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xf7'),_0x74282a['speech']));}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x1b0ae6,_0x4ee2('0xf8'));};AGIVertices['prototype'][_0x4ee2('0xf9')]=function(_0x356357){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x356357[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfa')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfb')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xfc'));}if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfd')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20password\x20configured');}if(!this[_0x4ee2('0x87')](_0x356357[_0x4ee2('0xfe')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this[_0x4ee2('0x36')](_0x356357);this['createSquareMessage'](_0x356357['text'],'in','','');this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0xff'),_0x356357[_0x4ee2('0x5a')]));var _0x2dc751=this[_0x4ee2('0x81')][_0x4ee2('0xa4')](this,_0x356357);if(_0x2dc751){for(var _0x529023 in _0x2dc751){if(_0x2dc751['hasOwnProperty'](_0x529023)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0x100'),_0x529023[_0x4ee2('0x6a')]()),_0x2dc751[_0x529023]);}}this[_0x4ee2('0x3f')](_0x2dc751[_0x4ee2('0xef')],_0x4ee2('0xee'),_0x4ee2('0xf9'),'');if(_0x2dc751[_0x4ee2('0x101')]){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x102'),_0x2dc751['audiofile']));var _0x2538c6=this['channel']['streamFile'](_0x2dc751['audiofile']);try{fs[_0x4ee2('0x103')](_0x2dc751['audiofile']+_0x4ee2('0x104'));}catch(_0xb76eb){logger[_0x4ee2('0x2e')](_0xb76eb);}return _0x2538c6;}else{return this['channel'][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x105'),_0x2dc751['speech']));}}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x356357,_0x4ee2('0x106'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x107')]=function(_0x5974f5){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5974f5[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('end');};AGIVertices[_0x4ee2('0xf')]['ext_dial']=function(_0x3204a0){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x3204a0['label']));var _0x1d8a78='';if(_0x3204a0[_0x4ee2('0x108')]){if(!this[_0x4ee2('0x87')](_0x3204a0[_0x4ee2('0x108')])){return this['channel'][_0x4ee2('0x2e')](_0x3204a0,_0x4ee2('0x109'));}else{var _0x150488=parseInt(_0x3204a0[_0x4ee2('0x108')],0xa);if(isNaN(_0x150488)){_0x1d8a78=_0x3204a0['trunk_id'];}else{_0x1d8a78=this[_0x4ee2('0x1d')][_0x4ee2('0xa4')](this,_0x3204a0[_0x4ee2('0x108')]);if(!_0x1d8a78){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3204a0,_0x4ee2('0x10a'));}}}}else if(_0x3204a0[_0x4ee2('0x10b')]){_0x1d8a78=_0x3204a0['trunk_name'];}else{return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3204a0,_0x4ee2('0x109'));}var _0x40d94a=this['channel'][_0x4ee2('0xab')](_0x4ee2('0xe7'),[util[_0x4ee2('0x2b')](_0x4ee2('0x10c'),_0x1d8a78,_0x3204a0[_0x4ee2('0x45')]),_0x3204a0[_0x4ee2('0x65')],_0x3204a0['opts'],_0x3204a0[_0x4ee2('0x63')]]);if(_0x40d94a['result']===-0x1){return _0x40d94a;}return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s',_0x4ee2('0xe7')));};AGIVertices['prototype'][_0x4ee2('0x10d')]=function(_0x467813){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x467813[_0x4ee2('0xaf')]));return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x10d'));};AGIVertices[_0x4ee2('0xf')]['getdigits']=function(_0x20e612){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x10e'),_0x20e612[_0x4ee2('0xaf')]));if(_0x20e612[_0x4ee2('0xa5')]===0x0){return this[_0x4ee2('0xa6')](_0x20e612);}_0x20e612[_0x4ee2('0xa5')]-=0x1;if(!this[_0x4ee2('0x87')](_0x20e612['file_id'])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x20e612,_0x4ee2('0x10f'));}var _0x462932=this['getSound']['sync'](this,_0x20e612['file_id']);if(!_0x462932){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x20e612,_0x4ee2('0x110'));}if(!this[_0x4ee2('0x87')](_0x20e612[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')]['error'](_0x4ee2('0xdb'));}var _0x681f22=this[_0x4ee2('0xe')]['getData'](_0x462932,_0x20e612['response'],_0x20e612[_0x4ee2('0x111')]);var _0x20f931=_0x681f22[_0x4ee2('0xa3')]?_0x681f22['result'][_0x4ee2('0x4a')]():'';logger[_0x4ee2('0x30')](_0x4ee2('0x112'),JSON[_0x4ee2('0x73')](_0x681f22));if(_0x681f22[_0x4ee2('0xa3')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x20e612,_0x20f931);return _0x681f22;}else if(_0x681f22['extra']===_0x4ee2('0x65')){_0x681f22[_0x4ee2('0xa3')]=_0x20f931[_0x4ee2('0x9e')]>=parseInt(_0x20e612[_0x4ee2('0x113')])?'x':'i';}else{_0x681f22[_0x4ee2('0xa3')]=_0x20f931['length']>=parseInt(_0x20e612['mindigit'])&&_0x20f931[_0x4ee2('0x9e')]<=parseInt(_0x20e612['maxdigit'])?'x':'i';}var _0xbd4d2a=this[_0x4ee2('0x10')]['sync'](this,_0x20e612[_0x4ee2('0xda')]);if(!_0xbd4d2a){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x20e612,_0x4ee2('0xdc'));}this['channel'][_0x4ee2('0x9d')](_0xbd4d2a,_0x20f931);if(this[_0x4ee2('0x87')](_0x20e612[_0x4ee2('0x114')])){var _0x1c94fa=parseInt(_0x20e612[_0x4ee2('0x114')],0xa);var _0x24fb84=rs[_0x4ee2('0x115')]({'charset':'*','length':_0x1c94fa});var _0x5be0ea=_0x20f931['length'];if(_0x5be0ea>0x0){if(_0x5be0ea>_0x1c94fa){this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x20e612,_0x20e612[_0x4ee2('0x116')]===_0x4ee2('0x117')?_0x24fb84+_0x20f931[_0x4ee2('0x118')](_0x1c94fa):_0x20f931[_0x4ee2('0x118')](0x0,_0x5be0ea-_0x1c94fa)+_0x24fb84);}else{this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x20e612,rs[_0x4ee2('0x115')]({'charset':'*','length':_0x5be0ea}));}}else{this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x20e612,'');}}else{this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x20e612,_0x20f931);}return _0x681f22;};AGIVertices[_0x4ee2('0xf')]['getsecretdigits']=function(_0x25433c){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x119'),_0x25433c[_0x4ee2('0xaf')]));return this[_0x4ee2('0xc')](_0x25433c);};AGIVertices[_0x4ee2('0xf')]['goal']=function(_0x4f8d55){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x11a'),_0x4f8d55[_0x4ee2('0xaf')]));this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x4f8d55,_0x4f8d55[_0x4ee2('0x11b')]);return this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x11c'),_0x4f8d55[_0x4ee2('0x11b')]));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x11d')]=function(_0x42ebb7){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x11e'),_0x42ebb7[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x42ebb7[_0x4ee2('0x8a')])||!this[_0x4ee2('0x87')](_0x42ebb7[_0x4ee2('0x8e')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x11f'));}if(!this['isConfigured'](_0x42ebb7[_0x4ee2('0x5a')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x120'),_0x42ebb7[_0x4ee2('0x5a')]));var _0x33c1bf=this[_0x4ee2('0x89')][_0x4ee2('0xa4')](this,_0x42ebb7);if(_0x33c1bf){this[_0x4ee2('0xe')]['noop'](util['format'](_0x4ee2('0x121'),_0x33c1bf));var _0x2da13f=this[_0x4ee2('0xe')]['streamFile'](_0x33c1bf);try{fs[_0x4ee2('0x103')](_0x33c1bf+'.wav');}catch(_0x58ab30){logger[_0x4ee2('0x2e')](_0x58ab30);}return _0x2da13f;}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x42ebb7,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x122')]=function(_0x5f18a0){logger[_0x4ee2('0x30')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5f18a0[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x5f18a0[_0x4ee2('0x8a')])||!this[_0x4ee2('0x87')](_0x5f18a0[_0x4ee2('0x8e')])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0x11f'));}if(!this[_0x4ee2('0x87')](_0x5f18a0['aws_bot_name'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x4ee2('0x87')](_0x5f18a0[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xeb')]=!![];this['createSquareDetailsReport'](_0x5f18a0);this[_0x4ee2('0x3f')](_0x5f18a0[_0x4ee2('0x5a')],'in','','');this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x123'),_0x5f18a0[_0x4ee2('0x5a')]));var _0x2750ab=this[_0x4ee2('0x8d')][_0x4ee2('0xa4')](this,_0x5f18a0);if(_0x2750ab){for(var _0x32c069 in _0x2750ab){if(_0x2750ab[_0x4ee2('0x94')](_0x32c069)&&_[_0x4ee2('0x95')](_0x2750ab[_0x32c069])){this[_0x4ee2('0xe')]['setVariable'](util[_0x4ee2('0x2b')](_0x4ee2('0x124'),_0x32c069[_0x4ee2('0x6a')]()),_0x2750ab[_0x32c069]);}}if(_[_0x4ee2('0x42')](_0x2750ab['message'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x4ee2('0x3f')](_0x2750ab[_0x4ee2('0x77')],_0x4ee2('0xee'),_0x4ee2('0x125'),'');return this['channel']['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x126'),_0x2750ab[_0x4ee2('0x77')]));}}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x5f18a0,_0x4ee2('0x127'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x128')]=function(_0x335d17){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x129'),_0x335d17[_0x4ee2('0xaf')],_0x335d17[_0x4ee2('0x65')]));if(!this[_0x4ee2('0x87')](_0x335d17['key'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xea'));}var _0xf5703a='wav';var _0x4c1bf1=util['format'](_0x4ee2('0x12a'),FILES_PATH,rs[_0x4ee2('0x115')](0x4));var _0x3524eb=util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x4c1bf1,_0xf5703a);var _0x4fa9fc=!![];if(_0x335d17['beep']===_0x4ee2('0x12b')){_0x4fa9fc=![];}var _0x42a88d=this[_0x4ee2('0xe')][_0x4ee2('0x12c')](_0x4c1bf1,_0xf5703a,_0x335d17[_0x4ee2('0x12d')],_0x335d17['timeout'],undefined,_0x4fa9fc);if(_0x42a88d[_0x4ee2('0xa3')]!==-0x1){this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x12e'),_0x3524eb));var _0x17c32e=this[_0x4ee2('0x90')][_0x4ee2('0xa4')](this,_0x335d17,_0x3524eb);if(_0x17c32e){for(var _0x5dfc98 in _0x17c32e){if(_0x17c32e[_0x4ee2('0x94')](_0x5dfc98)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0x12f'),_0x5dfc98[_0x4ee2('0x6a')]()),_0x17c32e[_0x5dfc98]);}}return this[_0x4ee2('0xe')]['noop'](util['format'](_0x4ee2('0x130'),JSON['stringify'](_0x17c32e)));}}return _0x42a88d;};AGIVertices['prototype'][_0x4ee2('0x131')]=function(_0x313ada){logger[_0x4ee2('0x30')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x313ada[_0x4ee2('0xaf')]));if(!this['isConfigured'](_0x313ada[_0x4ee2('0x92')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x132'));}if(!this[_0x4ee2('0x87')](_0x313ada['appsecret'])){return this[_0x4ee2('0xe')]['noop'](_0x4ee2('0x133'));}var _0x445e82=_0x4ee2('0x134');var _0x492c20=util[_0x4ee2('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x4ee2('0x115')](0x4));var _0x2f7e92=util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x492c20,_0x445e82);var _0x141327=!![];if(_0x313ada[_0x4ee2('0x135')]==='NOBEEP'){_0x141327=![];}var _0x1a4526=this['channel']['recordFile'](_0x492c20,_0x445e82,_0x313ada[_0x4ee2('0x12d')],_0x313ada['timeout'],undefined,_0x141327);if(_0x1a4526[_0x4ee2('0xa3')]!==-0x1){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x136'),_0x2f7e92));var _0x31a064=this['tildeASR'][_0x4ee2('0xa4')](this,_0x313ada,_0x2f7e92);if(_0x31a064){for(var _0x101a9d in _0x31a064){if(_0x31a064[_0x4ee2('0x94')](_0x101a9d)){this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')]('TILDE_ASR_%s',_0x101a9d[_0x4ee2('0x6a')]()),_0x31a064[_0x101a9d]);}}return this['channel']['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x4ee2('0x73')](_0x31a064)));}}return _0x1a4526;};AGIVertices['prototype'][_0x4ee2('0x137')]=function(_0x38ef9e){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x38ef9e[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0x138')](_0x38ef9e[_0x4ee2('0x3d')],_0x38ef9e[_0x4ee2('0x139')],_0x38ef9e['priority']);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x13a')]=function(_0x56c86f){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x13b'),_0x56c86f[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x56c86f[_0x4ee2('0x13c')])){return this[_0x4ee2('0xe')]['error'](_0x56c86f,_0x4ee2('0x13d'));}try{var _0x20c34f=eval(_0x56c86f[_0x4ee2('0x13c')])?'true':_0x4ee2('0x13e');this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x13f'),_0x56c86f['condition'],_0x20c34f));return{'code':0xc8,'result':_0x20c34f};}catch(_0x42a05b){return{'code':0xc8,'result':_0x4ee2('0x13e')};}};AGIVertices[_0x4ee2('0xf')]['gotoiftime']=function(_0xadb353){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x140'),_0xadb353['label']));if(!this[_0x4ee2('0x87')](_0xadb353[_0x4ee2('0x141')])){return this[_0x4ee2('0xe')]['error'](_0xadb353,_0x4ee2('0x142'));}var _0x14bde4=this['getIntervals'][_0x4ee2('0xa4')](this,_0xadb353['interval_id']);if(!_0x14bde4){return this['channel'][_0x4ee2('0x2e')](_0xadb353,_0x4ee2('0x143'));}for(var _0x112be6=0x0;_0x112be6<_0x14bde4['length'];_0x112be6+=0x1){var _0x1cd850=this['channel'][_0x4ee2('0x10')](util[_0x4ee2('0x2b')](_0x4ee2('0x144'),_0x14bde4[_0x112be6]));if(_0x1cd850[_0x4ee2('0xa3')]===-0x1){return _0x1cd850;}logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x1cd850['extra']));if(_0x1cd850[_0x4ee2('0xa1')]===_0x4ee2('0x146')){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x146')));this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x146')));return{'code':0xc8,'result':_0x4ee2('0x146')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x13e')));this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x145'),_0x14bde4[_0x112be6],_0x4ee2('0x13e')));}}return{'code':0xc8,'result':_0x4ee2('0x13e')};};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x147')]=function(_0x559f4d){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x148'),_0x559f4d[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0x147')]();};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x149')]=function(_0x1a2a1c){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x14a'),_0x1a2a1c[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x1a2a1c[_0x4ee2('0x7b')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20key\x20configured');}var _0x332569='wav';var _0x3754fd=util[_0x4ee2('0x2b')](_0x4ee2('0x12a'),FILES_PATH,rs[_0x4ee2('0x115')](0x4));var _0x4398ae=util[_0x4ee2('0x2b')](_0x4ee2('0x9c'),_0x3754fd,_0x332569);var _0x3590a3=!![];if(_0x1a2a1c[_0x4ee2('0x135')]===_0x4ee2('0x12b')){_0x3590a3=![];}var _0x46abc4=this[_0x4ee2('0xe')][_0x4ee2('0x12c')](_0x3754fd,_0x332569,_0x1a2a1c[_0x4ee2('0x12d')],_0x1a2a1c[_0x4ee2('0x65')],undefined,_0x3590a3);if(_0x46abc4[_0x4ee2('0xa3')]!==-0x1){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('ispeech\x20%s\x20file\x20created',_0x4398ae));var _0x3c3919=this[_0x4ee2('0x85')]['sync'](this,_0x1a2a1c,_0x4398ae);if(_0x3c3919){for(var _0x20ca61 in _0x3c3919){if(_0x3c3919[_0x4ee2('0x94')](_0x20ca61)){this['channel']['setVariable'](util[_0x4ee2('0x2b')](_0x4ee2('0x14b'),_0x20ca61[_0x4ee2('0x6a')]()),_0x3c3919[_0x20ca61]);}}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x14c'),JSON['stringify'](_0x3c3919)));}}return _0x46abc4;};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x14d')]=function(_0x5160ac){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x14e'),_0x5160ac[_0x4ee2('0xaf')]));if(!this['isConfigured'](_0x5160ac['key'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xea'));}if(!this[_0x4ee2('0x87')](_0x5160ac[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x5160ac['text']));var _0x1efa58=this[_0x4ee2('0x82')][_0x4ee2('0xa4')](this,_0x5160ac);if(_0x1efa58){this[_0x4ee2('0xe')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x1efa58));var _0x20fc98=this['channel'][_0x4ee2('0x14f')](_0x1efa58,_0x5160ac['intKey']);try{fs[_0x4ee2('0x103')](_0x1efa58+_0x4ee2('0x104'));}catch(_0x51dafc){logger['error'](_0x51dafc);}return _0x20fc98;}return this['channel'][_0x4ee2('0x2e')](_0x5160ac,_0x4ee2('0x150'));};AGIVertices['prototype'][_0x4ee2('0x151')]=function(_0x3b2a37){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x152'),_0x3b2a37[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x3b2a37[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3b2a37,_0x4ee2('0x154'));}logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x155'),this[_0x4ee2('0xe')]['callerid'],_0x3b2a37[_0x4ee2('0x153')]));var _0x28644d=this[_0x4ee2('0x52')][_0x4ee2('0xa4')](this,_0x3b2a37['findBy']);if(_0x28644d){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this['channel']['callerid'],_0x3b2a37[_0x4ee2('0x153')]));this['channel']['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3b2a37[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3b2a37[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3b2a37[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')]['logout']=function(_0x43752a){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x15a'),_0x43752a[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x43752a[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x43752a,_0x4ee2('0x154'));}logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x155'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a['findBy']));var _0x10acd8=this[_0x4ee2('0x51')]['sync'](this,_0x43752a['findBy']);if(_0x10acd8){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x156'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a['findBy']));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x43752a['findBy']));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x15b')]=function(_0x524842){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x15c'),_0x524842[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x524842[_0x4ee2('0x15d')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x524842,'no\x20operation\x20configured');}this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x15e'),_0x524842['operation']));var _0x1c9f09=eval(_0x524842['operation']);if(!this[_0x4ee2('0x87')](_0x524842['variable_id'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xdb'));}var _0x319a61=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x524842['variable_id']);if(!_0x319a61){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x524842,_0x4ee2('0xdc'));}if(_['isArray'](_0x1c9f09)){var _0x109bf1=this;_0x1c9f09[_0x4ee2('0xde')](function(_0x23eaaf,_0x117d13){_0x109bf1['channel'][_0x4ee2('0x9d')](util['format']('%s[%s]',_0x319a61,_0x117d13),_0x23eaaf);});return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format']('variable\x20%s[key]\x20set',_0x319a61));}else{return this[_0x4ee2('0xe')]['setVariable'](_0x319a61,_0x1c9f09);}};AGIVertices['prototype'][_0x4ee2('0xb')]=function(_0x580f07){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x15f'),_0x580f07[_0x4ee2('0xaf')]));if(_0x580f07[_0x4ee2('0xa5')]===0x0){return this[_0x4ee2('0xa6')](_0x580f07);}_0x580f07[_0x4ee2('0xa5')]-=0x1;if(!this[_0x4ee2('0x87')](_0x580f07['file_id'])){return this[_0x4ee2('0xe')]['error'](_0x580f07,_0x4ee2('0x10f'));}var _0x1d49c0=this[_0x4ee2('0x160')][_0x4ee2('0xa4')](this,_0x580f07[_0x4ee2('0x161')]);if(!_0x1d49c0){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x580f07,_0x4ee2('0x110'));}var _0x3ed628=this[_0x4ee2('0xe')][_0x4ee2('0x162')](_0x1d49c0,_0x580f07['response'],_0x580f07[_0x4ee2('0x163')]);var _0x299950=_0x3ed628['result'];if(_0x3ed628[_0x4ee2('0xa3')]===-0x1){this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x580f07,'-1');return _0x3ed628;}else if(_0x3ed628['extra']===_0x4ee2('0x65')){_0x3ed628[_0x4ee2('0xa3')]=_0x3ed628[_0x4ee2('0xa3')][_0x4ee2('0x9e')]>0x0?_0x3ed628[_0x4ee2('0xa3')]:'t';}else if(_[_0x4ee2('0x41')](_0x3ed628['result'])){_0x3ed628[_0x4ee2('0xa3')]='#';_0x299950='#';}if(!this[_0x4ee2('0x87')](_0x580f07[_0x4ee2('0xda')])){this[_0x4ee2('0xe')]['noop'](_0x4ee2('0xdb'));}else{var _0x245262=this['getVariable']['sync'](this,_0x580f07[_0x4ee2('0xda')]);if(!_0x245262){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x580f07,'no\x20variable\x20found');}this[_0x4ee2('0xe')][_0x4ee2('0x9d')](_0x245262,_0x299950);}this[_0x4ee2('0x36')]['sync'](this,_0x580f07,_0x299950);return _0x3ed628;};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0xa9')]=function(_0x581056){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x164'),_0x581056[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x581056['output']||_0x581056[_0x4ee2('0xaf')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x165')]=function(_0x298aaa){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x166'),_0x298aaa['label']));if(!this[_0x4ee2('0x87')](_0x298aaa[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x298aaa,_0x4ee2('0x154'));}logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x155'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x298aaa[_0x4ee2('0x153')]));var _0x562e33=this['getPause'][_0x4ee2('0xa4')](this,_0x298aaa['pause_id']);var _0x138af2=this[_0x4ee2('0x4e')][_0x4ee2('0xa4')](this,_0x298aaa[_0x4ee2('0x153')],_0x562e33);if(_0x138af2){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this['channel'][_0x4ee2('0x3a')],_0x298aaa['findBy']));this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')](_0x4ee2('0x156'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x298aaa['findBy']));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this['channel'][_0x4ee2('0x3a')],_0x298aaa[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x298aaa[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')]['playback']=function(_0x589456){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x589456['label']));if(!this[_0x4ee2('0x87')](_0x589456['file_id'])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x589456,_0x4ee2('0x10f'));}var _0x5c5bda=this[_0x4ee2('0x160')][_0x4ee2('0xa4')](this,_0x589456[_0x4ee2('0x161')]);if(!_0x5c5bda){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x589456,_0x4ee2('0x110'));}var _0x19c6ef=this[_0x4ee2('0xe')][_0x4ee2('0xab')](_0x4ee2('0x167'),[_0x5c5bda,_0x589456['opts']]);if(_0x19c6ef['result']===-0x1){return _0x19c6ef;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0xc6'),'PLAYBACK',_0x5c5bda));};AGIVertices[_0x4ee2('0xf')]['queue']=function(_0x198064){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x168'),_0x198064['label']));if(!this[_0x4ee2('0x87')](_0x198064[_0x4ee2('0x169')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x198064,_0x4ee2('0x16a'));}var _0x4da265='';var _0x24a1fe=parseInt(_0x198064[_0x4ee2('0x169')],0xa);if(isNaN(_0x24a1fe)){_0x4da265=_0x198064[_0x4ee2('0x169')];}else{_0x4da265=this[_0x4ee2('0x15')][_0x4ee2('0xa4')](this,_0x198064['queue_id']);if(!_0x4da265){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x198064,'no\x20queue\x20found');}}var _0x3e9b76='';if(this[_0x4ee2('0x87')](_0x198064[_0x4ee2('0x161')])){var _0x363607=this[_0x4ee2('0x160')][_0x4ee2('0xa4')](this,_0x198064[_0x4ee2('0x161')]);if(_0x363607){_0x3e9b76=_0x363607;}}this['createSquareDetailsReport'][_0x4ee2('0xa4')](this,_0x198064,_0x4da265);if(_0x198064[_0x4ee2('0x16b')]['indexOf']('x')<0x0){_0x198064[_0x4ee2('0x16b')]+='x';}if(_0x198064[_0x4ee2('0x16b')][_0x4ee2('0x16c')]('X')<0x0){_0x198064[_0x4ee2('0x16b')]+='X';}this[_0x4ee2('0xe')][_0x4ee2('0x9d')]('XMCS-QUEUE',_0x4da265?_0x4da265['toLowerCase']():'');var _0x184438=this[_0x4ee2('0xe')][_0x4ee2('0xab')]('QUEUE',[_0x4da265,_0x198064[_0x4ee2('0x16b')],_0x198064[_0x4ee2('0x63')],_0x3e9b76,_0x198064['timeout'],_0x198064[_0x4ee2('0x6')],_0x198064[_0x4ee2('0x16d')],_0x198064[_0x4ee2('0x16e')],'',_0x198064[_0x4ee2('0x16f')]]);if(_0x184438['result']===-0x1){return _0x184438;}return this[_0x4ee2('0xe')]['noop'](util['format'](_0x4ee2('0xc6'),_0x4ee2('0x170'),_0x4da265));};AGIVertices['prototype']['record']=function(_0x27eb42){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x171'),_0x27eb42[_0x4ee2('0xaf')]));var _0x4cf900=_0x27eb42[_0x4ee2('0x172')]||_0x4ee2('0x134');var _0x746a4a=util[_0x4ee2('0x2b')](_0x4ee2('0x173'),this[_0x4ee2('0xe')][_0x4ee2('0x37')],rs['generate'](0x5));var _0x31efde=util[_0x4ee2('0x2b')](_0x4ee2('0x174'),FILES_PATH,_0x746a4a,_0x4cf900);var _0xe725c6=util[_0x4ee2('0x2b')](_0x4ee2('0x12a'),FILES_PATH,_0x746a4a);this['createSquareRecording'][_0x4ee2('0xa4')](this,_0x27eb42,_0x746a4a,_0x31efde);this[_0x4ee2('0xe')]['setVariable']('RECORDING_SAVENAME',_0x746a4a);logger['info'](_0x4ee2('0x175'),_0xe725c6,_0x4cf900,_0x27eb42['escape_digits'],_0x27eb42[_0x4ee2('0x65')]);return this[_0x4ee2('0xe')][_0x4ee2('0x12c')](_0xe725c6,_0x4cf900,_0x27eb42['escape_digits'],_0x27eb42[_0x4ee2('0x65')],undefined,!![]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x176')]=function(_0x244905){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x177'),_0x244905[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x244905[_0x4ee2('0x63')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x178'));}var _0x185842=this[_0x4ee2('0x62')][_0x4ee2('0xa4')](this,_0x244905);logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')]('Response:',util[_0x4ee2('0x179')](_0x185842,{'showHidden':![],'depth':null})));if(!this[_0x4ee2('0x87')](_0x244905[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x42338b=this['getVariable'][_0x4ee2('0xa4')](this,_0x244905[_0x4ee2('0xda')]);if(!_0x42338b){return this[_0x4ee2('0xe')]['error'](_0x244905,_0x4ee2('0xdc'));}this[_0x4ee2('0xe')]['setVariable'](util[_0x4ee2('0x2b')](_0x4ee2('0x17a'),_0x42338b),_0x185842[_0x4ee2('0x75')]?_0x185842['statusCode']:_0x4ee2('0x17b'));this[_0x4ee2('0xe')][_0x4ee2('0x9d')](util[_0x4ee2('0x2b')](_0x4ee2('0x17c'),_0x42338b),_0x185842[_0x4ee2('0x76')]?_0x185842[_0x4ee2('0x76')]:'OK');if(_0x185842[_0x4ee2('0x6b')]){try{this[_0x4ee2('0x9b')](_0x185842[_0x4ee2('0x6b')],_0x42338b);}catch(_0x5b2bfb){logger[_0x4ee2('0x2e')](util['format'](_0x4ee2('0x17d'),_0x42338b));}}return this['channel']['noop'](util['format'](_0x4ee2('0xe1'),_0x42338b));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x17e')]=function(_0x336ee4){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x17f'),_0x336ee4['label']));return this[_0x4ee2('0xe')][_0x4ee2('0x180')](_0x336ee4['digits'][_0x4ee2('0x56')](/\s+/g,''),_0x336ee4[_0x4ee2('0x181')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x182')]=function(_0x228f9a){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x183'),_0x228f9a[_0x4ee2('0xaf')]));return this['channel'][_0x4ee2('0x184')](_0x228f9a['number'][_0x4ee2('0x56')](/\s+/g,''),_0x228f9a[_0x4ee2('0x181')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x185')]=function(_0x5ece2c){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x186'),_0x5ece2c[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0x187')](_0x5ece2c['text'],_0x5ece2c[_0x4ee2('0x181')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x188')]=function(_0x113a02){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x189'),_0x113a02['label']));if(!this[_0x4ee2('0x87')](_0x113a02[_0x4ee2('0x18a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x18b'));}var _0x35a380=this[_0x4ee2('0x20')]['sync'](this,_0x113a02[_0x4ee2('0x18a')]);if(!_0x35a380||!_0x35a380[_0x4ee2('0x18c')]){return this['channel'][_0x4ee2('0x2e')](_0x113a02,_0x4ee2('0x18d'));}var _0x438c53={'from':util[_0x4ee2('0x2b')](_0x4ee2('0x18e'),_0x35a380[_0x4ee2('0x13')],_0x35a380[_0x4ee2('0x18f')]||_0x35a380[_0x4ee2('0x18c')][_0x4ee2('0x190')]),'to':_0x113a02['to']||'','cc':_0x113a02['cc']||'','bcc':_0x113a02['bcc']||'','subject':_0x113a02[_0x4ee2('0x191')],'html':_0x113a02[_0x4ee2('0x5a')],'text':_0x113a02[_0x4ee2('0x5a')]};if(this['isConfigured'](_0x113a02[_0x4ee2('0x192')])){}logger[_0x4ee2('0xe3')](_0x4ee2('0x193'),JSON[_0x4ee2('0x73')](_0x438c53));this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x113a02,_0x113a02['account_id']);this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x194'),_0x35a380['name']));this[_0x4ee2('0x22')][_0x4ee2('0xa4')](this,_0x35a380[_0x4ee2('0x195')],_0x438c53);return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x196'));};AGIVertices['prototype'][_0x4ee2('0x197')]=function(_0x371d56){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x198'),_0x371d56[_0x4ee2('0xaf')]));return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x199'));};AGIVertices['prototype'][_0x4ee2('0x19a')]=function(_0x3029ea){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x19b'),_0x3029ea[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x3029ea['sms_account_id'])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0x19c'));}var _0x235095=this[_0x4ee2('0x19d')][_0x4ee2('0xa4')](this,_0x3029ea['sms_account_id']);if(!_0x235095){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3029ea,_0x4ee2('0x19e'));}var _0x2fcaf2={'body':_0x3029ea[_0x4ee2('0x19f')],'phone':_0x3029ea['to']||'','SmsAccountId':_0x235095['id']};logger[_0x4ee2('0xe3')](_0x4ee2('0x1a0'),JSON[_0x4ee2('0x73')](_0x2fcaf2));this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x3029ea,_0x3029ea['sms_account_id']);this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x1a1'),_0x235095[_0x4ee2('0x13')]));this[_0x4ee2('0x35')][_0x4ee2('0xa4')](this,_0x2fcaf2);return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x1a2'));};AGIVertices['prototype'][_0x4ee2('0x1a3')]=function(_0x27ecf2){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x1a4'),_0x27ecf2[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x27ecf2[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x27ecf2,_0x4ee2('0x1a5'));}var _0x26238e=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x27ecf2[_0x4ee2('0xda')]);if(!_0x26238e){return this['channel'][_0x4ee2('0x2e')](_0x27ecf2,_0x4ee2('0xdc'));}return this['channel'][_0x4ee2('0x9d')](_0x26238e,_0x27ecf2[_0x4ee2('0x1a6')]);};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1a7')]=function(_0x570c6e){logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x1a8'),_0x570c6e[_0x4ee2('0xaf')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')]('START\x20CALLY\x20SQUARE');var _0x14649=this[_0x4ee2('0xe')]['getVariable'](_0x4ee2('0x1a9'));if(!_[_0x4ee2('0x41')](_0x14649[_0x4ee2('0xa1')])){this[_0x4ee2('0xe')][_0x4ee2('0x37')]=_0x14649['extra'];}if(_0x570c6e[_0x4ee2('0xbc')]===_0x4ee2('0x1aa')){this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x1ab'));return this[_0x4ee2('0xe')][_0x4ee2('0xbc')]();}return this['channel'][_0x4ee2('0xa9')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x4ee2('0x1ac')]=function(_0x5b64f5){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x1ad'),_0x5b64f5[_0x4ee2('0xaf')]));if(!this['isConfigured'](_0x5b64f5[_0x4ee2('0x1ae')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x5b64f5,_0x4ee2('0x1af'));}var _0xd5e928=this['getSquareProject'][_0x4ee2('0xa4')](this,_0x5b64f5[_0x4ee2('0x1ae')]);if(!this['isConfigured'](_0xd5e928)){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x5b64f5,util[_0x4ee2('0x2b')](_0x4ee2('0x1b0'),_0x5b64f5['project_id']));}if(_0xd5e928===this[_0x4ee2('0xe')][_0x4ee2('0x39')]){return this['channel'][_0x4ee2('0x2e')](_0x5b64f5,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x5b64f5,_0xd5e928);var _0x5afcbf=this['channel'][_0x4ee2('0xab')](_0x4ee2('0x1b1'),util[_0x4ee2('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x4ee2('0x1b2')]||_0x4ee2('0x1b3'),_0xd5e928,this['channel']['arg_1']));if(_0x5afcbf[_0x4ee2('0xa3')]===-0x1){return _0x5afcbf;}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s\x20%s','AGI',_0xd5e928));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1b4')]=function(_0x1a087b){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x1b5'),_0x1a087b[_0x4ee2('0xaf')]));var _0x595ad=this['shellCommand'][_0x4ee2('0xa4')](this,_0x1a087b[_0x4ee2('0xba')]);this[_0x4ee2('0x36')][_0x4ee2('0xa4')](this,_0x1a087b,_0x1a087b[_0x4ee2('0xba')]);if(this['isConfigured'](_0x1a087b['variable_id'])){var _0x30716d=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x1a087b[_0x4ee2('0xda')]);if(_0x30716d){this['channel']['setVariable'](_0x30716d,_0x595ad);return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x1b6'),_0x1a087b['command'],_0x30716d));}}return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x1b7'),_0x1a087b[_0x4ee2('0xba')]));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1b8')]=function(_0x252ba9){logger[_0x4ee2('0x30')](util['format'](_0x4ee2('0x1b9'),_0x252ba9[_0x4ee2('0xaf')]));_0x252ba9[_0x4ee2('0x5a')]=_0x252ba9[_0x4ee2('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x252ba9['apiKey'])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0x1ba'));}if(!this[_0x4ee2('0x87')](_0x252ba9[_0x4ee2('0x5a')])){return this[_0x4ee2('0xe')][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x252ba9['text']));var _0x48ad6e=this[_0x4ee2('0x57')][_0x4ee2('0xa4')](this,_0x252ba9);if(_0x48ad6e){this[_0x4ee2('0xe')]['noop'](util[_0x4ee2('0x2b')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x48ad6e));var _0x23968e=this[_0x4ee2('0xe')][_0x4ee2('0x14f')](_0x48ad6e);try{fs[_0x4ee2('0x103')](_0x48ad6e+_0x4ee2('0x104'));}catch(_0x9be314){logger[_0x4ee2('0x2e')](_0x9be314);}return _0x23968e;}return this['channel']['error'](_0x252ba9,_0x4ee2('0x1bb'));};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1bc')]=function(_0x132681){logger['info'](util['format'](_0x4ee2('0x1bd'),_0x132681[_0x4ee2('0xaf')]));_0x132681['text']=_0x132681['text'][_0x4ee2('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x132681[_0x4ee2('0x5a')])){return this['channel'][_0x4ee2('0xa9')](_0x4ee2('0xaa'));}this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x1be'),_0x132681[_0x4ee2('0x5a')]));var _0x1c09da=this['googleTTS'][_0x4ee2('0xa4')](this,_0x132681);if(_0x1c09da){this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util['format'](_0x4ee2('0x1bf'),_0x1c09da));var _0x977acb=this[_0x4ee2('0xe')][_0x4ee2('0x14f')](_0x1c09da);try{fs[_0x4ee2('0x103')](_0x1c09da+'.wav');}catch(_0x5cf9e5){logger[_0x4ee2('0x2e')](_0x5cf9e5);}return _0x977acb;}return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x132681,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x3556a1){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x1c0'),_0x3556a1[_0x4ee2('0xaf')]));if(!this[_0x4ee2('0x87')](_0x3556a1[_0x4ee2('0x153')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x3556a1,_0x4ee2('0x154'));}logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x155'),this['channel']['callerid'],_0x3556a1[_0x4ee2('0x153')]));var _0x46c409=this[_0x4ee2('0x50')][_0x4ee2('0xa4')](this,_0x3556a1[_0x4ee2('0x153')]);if(_0x46c409){logger['info'](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x157')};}else{logger['info'](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));this[_0x4ee2('0xe')][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')](_0x4ee2('0x158'),this[_0x4ee2('0xe')][_0x4ee2('0x3a')],_0x3556a1[_0x4ee2('0x153')]));return{'code':0xc8,'result':_0x4ee2('0x159')};}};AGIVertices[_0x4ee2('0xf')][_0x4ee2('0x1c1')]=function(_0x7910a8){logger[_0x4ee2('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x7910a8[_0x4ee2('0xaf')]));var _0x400f2b=this[_0x4ee2('0xe')]['exec']('VOICEMAIL',[_0x7910a8[_0x4ee2('0x1c2')],_0x7910a8[_0x4ee2('0x79')]]);if(_0x400f2b['result']===-0x1){return _0x400f2b;}return this['channel'][_0x4ee2('0xa9')](util[_0x4ee2('0x2b')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x7910a8[_0x4ee2('0x1c2')]));};AGIVertices['prototype'][_0x4ee2('0x1c3')]=function(_0x12a744){logger[_0x4ee2('0x30')](util[_0x4ee2('0x2b')](_0x4ee2('0x1c4'),_0x12a744['label']));if(!this[_0x4ee2('0x87')](_0x12a744[_0x4ee2('0xda')])){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x12a744,_0x4ee2('0x1a5'));}var _0x53bd04=this[_0x4ee2('0x10')][_0x4ee2('0xa4')](this,_0x12a744[_0x4ee2('0xda')]);if(!_0x53bd04){return this[_0x4ee2('0xe')][_0x4ee2('0x2e')](_0x12a744,_0x4ee2('0xdc'));}var _0x5117d6=this[_0x4ee2('0xe')][_0x4ee2('0x10')](_0x53bd04);return{'code':0xc8,'result':_0x5117d6[_0x4ee2('0xa1')]?_0x5117d6[_0x4ee2('0xa1')]:'-'};};String[_0x4ee2('0xf')]['replaceAll']=function(_0x38617d,_0x2f11ff){return this['split'](_0x38617d)[_0x4ee2('0x1c5')](_0x2f11ff);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c7285d2..c5d334d 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 _0x43f5=['acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','lastPauseAt','timer','update','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','then','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','updateAcw','message','stopAcw','queue','[%s][TIMER][STOP][AGENT:%s]','pauseType','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x43f5,0x9d));var _0x543f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x43f5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x543f('0x0'));var moment=require(_0x543f('0x1'));var ami=require('../ami');var logger=require(_0x543f('0x2'))(_0x543f('0x3'));var RpcUser=require(_0x543f('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3302cb){this[_0x543f('0x5')]=_0x3302cb[_0x543f('0x5')];this[_0x543f('0x6')]=_0x3302cb[_0x543f('0x6')];this[_0x543f('0x7')]=_0x3302cb[_0x543f('0x7')];this[_0x543f('0x8')]={};ami['on']('agentconnect',this[_0x543f('0x9')][_0x543f('0xa')](this));ami['on'](_0x543f('0xb'),this[_0x543f('0xc')][_0x543f('0xa')](this));ami['on']('hangup',this[_0x543f('0xd')]['bind'](this));ami['on']('agentringnoanswer',this[_0x543f('0xe')]['bind'](this));ami['on']('attendedtransfer',this[_0x543f('0xf')][_0x543f('0xa')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0x543f('0x10'),this[_0x543f('0x11')][_0x543f('0xa')](this));}function getDiff(_0x539eaa){var _0x343a39=moment()[_0x543f('0x12')](0x0);var _0x1eb1c=moment(_0x539eaa)['milliseconds'](0x0);return _0x343a39[_0x543f('0x13')](_0x1eb1c,_0x543f('0x14'));}Acw['prototype']['updateAcw']=function(_0xe6c6d1,_0x5e879d){var _0x17b54c=this;var _0x3f85cd=getDiff(_0x17b54c[_0x543f('0x7')][_0xe6c6d1][_0x543f('0x15')]);clearTimeout(_0x17b54c['timers'][_0xe6c6d1][_0x543f('0x16')]);_0x17b54c[_0x543f('0x7')][_0xe6c6d1][_0x543f('0x16')]=![];return RpcVoiceAgentReport[_0x543f('0x17')]({'acwtime':_0x3f85cd},_0x17b54c[_0x543f('0x7')][_0xe6c6d1][_0x543f('0x18')],_0xe6c6d1)['then'](function(_0x5bde7f){logger[_0x543f('0x19')](_0x543f('0x1a'),_0x5e879d,_0x3f85cd,_0x5bde7f);})[_0x543f('0x1b')](function(_0xf2d182){logger[_0x543f('0x1c')]('[%s][UPDATE][ERRORS:%s]',_0x5e879d,_0xf2d182);})[_0x543f('0x1d')](function(){delete _0x17b54c[_0x543f('0x7')][_0xe6c6d1];});};Acw[_0x543f('0x1e')]['startAcw']=function(_0x2fd57f){try{var _0x18fbaf=this;var _0xd3a0a1=this['channels'][_0x2fd57f][_0x543f('0x1f')];var _0x5f21f5=this[_0x543f('0x8')][_0x2fd57f]['queue'];var _0x3914d3=this['voiceQueues'][_0x5f21f5];var _0x45f567=![];var _0x3866f4=_0x543f('0x20');if(_0x3914d3[_0x543f('0x21')]&&_0x3914d3[_0x543f('0x22')][_0x543f('0x23')]){_0x45f567=!![];_0x3866f4=_0x3914d3[_0x543f('0x22')][_0x543f('0x23')];}if(!_0x18fbaf[_0x543f('0x6')][_0xd3a0a1]){return Promise[_0x543f('0x24')]();}return RpcUser[_0x543f('0x25')](_0x18fbaf[_0x543f('0x6')][_0xd3a0a1]['id'])[_0x543f('0x26')](function(_0x4f7730){if(!_0x4f7730||_0x4f7730[_0x543f('0x27')]){logger[_0x543f('0x19')](_0x543f('0x28'),_0x2fd57f,_0xd3a0a1,_0x5f21f5);return;}logger[_0x543f('0x19')](_0x543f('0x29'),_0x2fd57f,_0xd3a0a1,_0x5f21f5);var _0x7f9c7b=_0x18fbaf[_0x543f('0x8')][_0x2fd57f]['attended']&&_0x18fbaf[_0x543f('0x8')][_0x2fd57f][_0x543f('0x2a')]?_0x18fbaf['channels'][_0x2fd57f][_0x543f('0x2a')]:_0x2fd57f;return RpcUser['savePause'](_0x18fbaf['agents'][_0xd3a0a1],_0x3866f4,_0x7f9c7b);})[_0x543f('0x26')](function(_0xa35162){if(_0x45f567||!_0xa35162){return;}_0x18fbaf[_0x543f('0x7')][_0xd3a0a1]={};logger['info'](_0x543f('0x2b'),_0x2fd57f,_0x18fbaf[_0x543f('0x5')][_0x5f21f5][_0x543f('0x2c')],_0xd3a0a1,_0x5f21f5);_0x18fbaf[_0x543f('0x7')][_0xd3a0a1][_0x543f('0x16')]=setTimeout(_0x18fbaf['stopAcw']['bind'](_0x18fbaf,_0xd3a0a1),_0x18fbaf[_0x543f('0x5')][_0x5f21f5]['acwTimeout']*0x3e8);_0x18fbaf[_0x543f('0x7')][_0xd3a0a1]['lastPauseAt']=moment()[_0x543f('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x18fbaf[_0x543f('0x7')][_0xd3a0a1][_0x543f('0x18')]=_0x2fd57f;_0x18fbaf[_0x543f('0x7')][_0xd3a0a1]['queue']=_0x5f21f5;_0x18fbaf[_0x543f('0x7')][_0xd3a0a1]['updateAcw']=_0x18fbaf[_0x543f('0x2e')][_0x543f('0xa')](_0x18fbaf,_0xd3a0a1,_0x2fd57f);})[_0x543f('0x1b')](function(){logger[_0x543f('0x1c')](_0x543f('0x2b'),_0x2fd57f,_0x18fbaf[_0x543f('0x5')][_0x5f21f5][_0x543f('0x2c')],_0xd3a0a1,_0x5f21f5);})[_0x543f('0x1d')](function(){delete _0x18fbaf[_0x543f('0x8')][_0x2fd57f];});}catch(_0x5cfb7e){logger[_0x543f('0x1c')]('[ACW][START]\x20%s',_0x5cfb7e[_0x543f('0x2f')]);}};Acw[_0x543f('0x1e')][_0x543f('0x30')]=function(_0x5d52c2){try{var _0x48d1d0=this;if(_0x48d1d0['timers'][_0x5d52c2]){_0x48d1d0[_0x543f('0x7')][_0x5d52c2][_0x543f('0x16')]=![];var _0xf24195=_0x48d1d0[_0x543f('0x7')][_0x5d52c2]['uniqueid'];var _0x20fc31=_0x48d1d0[_0x543f('0x7')][_0x5d52c2][_0x543f('0x31')];var _0xcbb3f2=_0x48d1d0[_0x543f('0x5')][_0x20fc31]['acwTimeout'];logger[_0x543f('0x19')](_0x543f('0x32'),_0xf24195,_0x5d52c2);RpcUser[_0x543f('0x25')](this[_0x543f('0x6')][_0x5d52c2]['id'])['then'](function(_0xe76e39){if(_0xe76e39[_0x543f('0x33')]===_0x543f('0x20')){return RpcUser['saveUnpause'](_0x48d1d0[_0x543f('0x6')][_0x5d52c2]);}});RpcVoiceAgentReport[_0x543f('0x17')]({'acwtime':_0xcbb3f2,'agentacw':!![]},_0xf24195,_0x5d52c2)[_0x543f('0x26')](function(_0x5da661){logger[_0x543f('0x19')](_0x543f('0x1a'),_0xf24195,_0xcbb3f2,_0x5da661);})[_0x543f('0x1b')](function(_0x15bad6){logger[_0x543f('0x1c')](_0x543f('0x34'),_0xf24195,_0x15bad6);});}else{logger[_0x543f('0x1c')](_0x543f('0x35'),_0x5d52c2);if(_0x48d1d0['timers']){logger[_0x543f('0x19')]('[ACW][TIMERS]',JSON[_0x543f('0x36')](_0x48d1d0[_0x543f('0x7')]));}}}catch(_0x31bf58){logger[_0x543f('0x1c')](_0x543f('0x37'),_0x31bf58[_0x543f('0x2f')]);}};Acw['prototype'][_0x543f('0x9')]=function(_0x215772){try{if(this[_0x543f('0x5')][_0x215772[_0x543f('0x31')]]&&(this[_0x543f('0x5')][_0x215772[_0x543f('0x31')]][_0x543f('0x3')]||this[_0x543f('0x5')][_0x215772[_0x543f('0x31')]][_0x543f('0x21')])){if(this[_0x543f('0x6')][_0x215772[_0x543f('0x1f')]]){this[_0x543f('0x8')][_0x215772[_0x543f('0x18')]]={'queue':_0x215772[_0x543f('0x31')],'interface':_0x215772['interface'],'destlinkedid':_0x215772[_0x543f('0x2a')]};}}}catch(_0x3a363c){logger[_0x543f('0x1c')](_0x543f('0x38'),_0x3a363c['message']);}};Acw[_0x543f('0x1e')][_0x543f('0x11')]=function(_0x4c4470){try{if(this[_0x543f('0x5')][_0x4c4470[_0x543f('0x31')]]&&(this['voiceQueues'][_0x4c4470[_0x543f('0x31')]][_0x543f('0x3')]||this[_0x543f('0x5')][_0x4c4470['queue']]['mandatoryDisposition'])){if(this[_0x543f('0x6')][_0x4c4470[_0x543f('0x1f')]]){this[_0x543f('0x8')][_0x4c4470[_0x543f('0x18')]]={'queue':_0x4c4470[_0x543f('0x31')],'interface':_0x4c4470[_0x543f('0x1f')]};}}}catch(_0xb21dd8){logger[_0x543f('0x1c')](_0x543f('0x39'),_0xb21dd8[_0x543f('0x2f')]);}};Acw[_0x543f('0x1e')][_0x543f('0xc')]=function(_0x10f80e){try{if(this['channels'][_0x10f80e[_0x543f('0x18')]]&&_[_0x543f('0x3a')](this[_0x543f('0x8')][_0x10f80e[_0x543f('0x18')]][_0x543f('0x3b')])){logger[_0x543f('0x19')]('[%s][HANGUP:UNIQUEID]',_0x10f80e['uniqueid']);this['startAcw'](_0x10f80e[_0x543f('0x18')]);}else if(this[_0x543f('0x8')][_0x10f80e[_0x543f('0x3c')]]&&_['isUndefined'](this[_0x543f('0x8')][_0x10f80e[_0x543f('0x3c')]][_0x543f('0x3b')])){logger[_0x543f('0x19')]('[%s][HANGUP:LINKEDID]',_0x10f80e[_0x543f('0x3c')]);this['startAcw'](_0x10f80e[_0x543f('0x3c')]);}}catch(_0x36decc){logger[_0x543f('0x1c')](_0x543f('0x3d'),_0x36decc[_0x543f('0x2f')]);}};Acw[_0x543f('0x1e')][_0x543f('0xd')]=function(_0x12e589){try{if(this['channels'][_0x12e589['uniqueid']]&&this[_0x543f('0x8')][_0x12e589[_0x543f('0x18')]][_0x543f('0x3b')]){logger[_0x543f('0x19')](_0x543f('0x3e'),_0x12e589[_0x543f('0x18')]);this[_0x543f('0x3f')](_0x12e589[_0x543f('0x18')]);}else if(this[_0x543f('0x8')][_0x12e589[_0x543f('0x3c')]]&&this['channels'][_0x12e589[_0x543f('0x3c')]][_0x543f('0x3b')]){logger[_0x543f('0x19')](_0x543f('0x40'),_0x12e589[_0x543f('0x3c')]);this[_0x543f('0x3f')](_0x12e589[_0x543f('0x3c')]);}}catch(_0x1ae328){logger[_0x543f('0x1c')](_0x543f('0x41'),_0x1ae328[_0x543f('0x2f')]);}};Acw[_0x543f('0x1e')][_0x543f('0xf')]=function(_0x971fdd){try{if(!_['isNil'](this[_0x543f('0x8')][_0x971fdd['transfereeuniqueid']])){this[_0x543f('0x3f')](_0x971fdd[_0x543f('0x42')]);if(this['channels'][_0x971fdd[_0x543f('0x43')]]){this[_0x543f('0x8')][_0x971fdd[_0x543f('0x43')]][_0x543f('0x3b')]=!![];this[_0x543f('0x8')][_0x971fdd[_0x543f('0x44')]]=this['channels'][_0x971fdd[_0x543f('0x43')]];delete this['channels'][_0x971fdd[_0x543f('0x43')]];}}else if(!_['isNil'](this[_0x543f('0x8')][_0x971fdd['transfertargetuniqueid']])){this[_0x543f('0x3f')](_0x971fdd['transfertargetuniqueid']);if(this[_0x543f('0x8')][_0x971fdd[_0x543f('0x45')]]){this['channels'][_0x971fdd['origtransfereruniqueid']][_0x543f('0x3b')]=!![];this[_0x543f('0x8')][_0x971fdd[_0x543f('0x42')]]=this[_0x543f('0x8')][_0x971fdd[_0x543f('0x45')]];delete this[_0x543f('0x8')][_0x971fdd[_0x543f('0x45')]];}}}catch(_0x14dc54){logger[_0x543f('0x1c')](_0x543f('0x46'),_0x14dc54[_0x543f('0x2f')]);}};Acw['prototype'][_0x543f('0x47')]=function(_0x5c2b8b){try{if(this['channels'][_0x5c2b8b['transfereruniqueid']]){logger['info'](_0x543f('0x48'),JSON[_0x543f('0x36')](_0x5c2b8b[_0x543f('0x49')]));this['startAcw'](_0x5c2b8b[_0x543f('0x49')]);}else if(this[_0x543f('0x8')][_0x5c2b8b[_0x543f('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x543f('0x36')](_0x5c2b8b['transfererlinkedid']));this[_0x543f('0x3f')](_0x5c2b8b['transfererlinkedid']);}}catch(_0x30cb75){logger[_0x543f('0x1c')](_0x543f('0x4b'),_0x30cb75[_0x543f('0x2f')]);}};Acw['prototype'][_0x543f('0xe')]=function(_0x3a3589){try{if(this[_0x543f('0x5')][_0x3a3589[_0x543f('0x31')]]&&this['voiceQueues'][_0x3a3589[_0x543f('0x31')]][_0x543f('0x4c')]==='all'){if(this['agents'][_0x3a3589[_0x543f('0x1f')]]){logger[_0x543f('0x19')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x3a3589[_0x543f('0x18')],_0x3a3589[_0x543f('0x1f')],_0x3a3589[_0x543f('0x31')]);return RpcUser[_0x543f('0x4d')](this[_0x543f('0x6')][_0x3a3589[_0x543f('0x1f')]],'Auto-Pause',_0x3a3589[_0x543f('0x18')]);}}}catch(_0x3d52c8){logger[_0x543f('0x1c')](_0x543f('0x4e'),_0x3d52c8['message']);}};module[_0x543f('0x4f')]=Acw; \ No newline at end of file +var _0x24b1=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timers','lastPauseAt','timer','update','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','uniqueid','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','pauseType','ACW','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x3c5bff,_0x3ba4d2){var _0x4789f3=function(_0x24745c){while(--_0x24745c){_0x3c5bff['push'](_0x3c5bff['shift']());}};_0x4789f3(++_0x3ba4d2);}(_0x24b1,0x11b));var _0x124b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x24b1[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var moment=require(_0x124b('0x0'));var ami=require('../ami');var logger=require(_0x124b('0x1'))(_0x124b('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x124b('0x3'));function Acw(_0x1d72c5){this[_0x124b('0x4')]=_0x1d72c5['voiceQueues'];this[_0x124b('0x5')]=_0x1d72c5['agents'];this['timers']=_0x1d72c5['timers'];this[_0x124b('0x6')]={};ami['on'](_0x124b('0x7'),this[_0x124b('0x8')][_0x124b('0x9')](this));ami['on'](_0x124b('0xa'),this[_0x124b('0xb')][_0x124b('0x9')](this));ami['on'](_0x124b('0xc'),this[_0x124b('0xd')][_0x124b('0x9')](this));ami['on'](_0x124b('0xe'),this[_0x124b('0xf')][_0x124b('0x9')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x124b('0x9')](this));ami['on'](_0x124b('0x10'),this['syncBlindTransfer'][_0x124b('0x9')](this));ami['on'](_0x124b('0x11'),this[_0x124b('0x12')][_0x124b('0x9')](this));}function getDiff(_0x49fde7){var _0x5d062a=moment()[_0x124b('0x13')](0x0);var _0x1a9273=moment(_0x49fde7)[_0x124b('0x13')](0x0);return _0x5d062a[_0x124b('0x14')](_0x1a9273,_0x124b('0x15'));}Acw[_0x124b('0x16')][_0x124b('0x17')]=function(_0x58dab8,_0x3d3e08){var _0x2dcafd=this;var _0x35f206=getDiff(_0x2dcafd[_0x124b('0x18')][_0x58dab8][_0x124b('0x19')]);clearTimeout(_0x2dcafd[_0x124b('0x18')][_0x58dab8]['timer']);_0x2dcafd[_0x124b('0x18')][_0x58dab8][_0x124b('0x1a')]=![];return RpcVoiceAgentReport[_0x124b('0x1b')]({'acwtime':_0x35f206},_0x2dcafd['timers'][_0x58dab8]['uniqueid'],_0x58dab8)[_0x124b('0x1c')](function(_0x108cd7){logger[_0x124b('0x1d')](_0x124b('0x1e'),_0x3d3e08,_0x35f206,_0x108cd7);})[_0x124b('0x1f')](function(_0x5eb047){logger[_0x124b('0x20')](_0x124b('0x21'),_0x3d3e08,_0x5eb047);})[_0x124b('0x22')](function(){delete _0x2dcafd['timers'][_0x58dab8];});};Acw[_0x124b('0x16')][_0x124b('0x23')]=function(_0x185fa2){try{var _0x4414de=this;var _0x4290f1=this['channels'][_0x185fa2][_0x124b('0x24')];var _0x1e3871=this[_0x124b('0x6')][_0x185fa2][_0x124b('0x25')];var _0x4d80a6=this[_0x124b('0x4')][_0x1e3871];var _0x3bff1d=![];var _0x15185a='ACW';if(_0x4d80a6[_0x124b('0x26')]&&_0x4d80a6[_0x124b('0x27')]['name']){_0x3bff1d=!![];_0x15185a=_0x4d80a6[_0x124b('0x27')]['name'];}if(!_0x4414de[_0x124b('0x5')][_0x4290f1]){return Promise[_0x124b('0x28')]();}return RpcUser[_0x124b('0x29')](_0x4414de[_0x124b('0x5')][_0x4290f1]['id'])[_0x124b('0x1c')](function(_0x14079b){if(!_0x14079b||_0x14079b[_0x124b('0x2a')]){logger[_0x124b('0x1d')](_0x124b('0x2b'),_0x185fa2,_0x4290f1,_0x1e3871);return;}logger[_0x124b('0x1d')](_0x124b('0x2c'),_0x185fa2,_0x4290f1,_0x1e3871);var _0x3029ac=_0x4414de['channels'][_0x185fa2][_0x124b('0x2d')]&&_0x4414de[_0x124b('0x6')][_0x185fa2]['destlinkedid']?_0x4414de[_0x124b('0x6')][_0x185fa2][_0x124b('0x2e')]:_0x185fa2;return RpcUser[_0x124b('0x2f')](_0x4414de[_0x124b('0x5')][_0x4290f1],_0x15185a,_0x3029ac)[_0x124b('0x1c')](function(_0x1bb898){_0x4414de['voiceQueues'][_0x1e3871][_0x124b('0x30')]-=0x1;_0x4414de[_0x124b('0x4')][_0x1e3871]['paused']+=0x1;return _0x1bb898;});})[_0x124b('0x1c')](function(_0x48581f){if(_0x3bff1d||!_0x48581f){return;}_0x4414de['timers'][_0x4290f1]={};logger[_0x124b('0x1d')](_0x124b('0x31'),_0x185fa2,_0x4414de[_0x124b('0x4')][_0x1e3871][_0x124b('0x32')],_0x4290f1,_0x1e3871);_0x4414de[_0x124b('0x18')][_0x4290f1][_0x124b('0x1a')]=setTimeout(_0x4414de[_0x124b('0x33')][_0x124b('0x9')](_0x4414de,_0x4290f1),_0x4414de[_0x124b('0x4')][_0x1e3871][_0x124b('0x32')]*0x3e8);_0x4414de[_0x124b('0x18')][_0x4290f1][_0x124b('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4414de['timers'][_0x4290f1][_0x124b('0x34')]=_0x185fa2;_0x4414de[_0x124b('0x18')][_0x4290f1][_0x124b('0x25')]=_0x1e3871;_0x4414de['timers'][_0x4290f1]['updateAcw']=_0x4414de[_0x124b('0x17')]['bind'](_0x4414de,_0x4290f1,_0x185fa2);})[_0x124b('0x1f')](function(){logger['error'](_0x124b('0x31'),_0x185fa2,_0x4414de[_0x124b('0x4')][_0x1e3871][_0x124b('0x32')],_0x4290f1,_0x1e3871);})[_0x124b('0x22')](function(){delete _0x4414de[_0x124b('0x6')][_0x185fa2];});}catch(_0x59e4c1){logger['error'](_0x124b('0x35'),_0x59e4c1['message']);}};Acw[_0x124b('0x16')][_0x124b('0x33')]=function(_0x3e44bb){try{var _0x5167f3=this;if(_0x5167f3[_0x124b('0x18')][_0x3e44bb]){_0x5167f3[_0x124b('0x18')][_0x3e44bb][_0x124b('0x1a')]=![];var _0x1522c5=_0x5167f3[_0x124b('0x18')][_0x3e44bb]['uniqueid'];var _0x182f04=_0x5167f3[_0x124b('0x18')][_0x3e44bb][_0x124b('0x25')];var _0xeb23e8=_0x5167f3[_0x124b('0x4')][_0x182f04]['acwTimeout'];logger[_0x124b('0x1d')](_0x124b('0x36'),_0x1522c5,_0x3e44bb);RpcUser[_0x124b('0x29')](this['agents'][_0x3e44bb]['id'])[_0x124b('0x1c')](function(_0x281fe0){if(_0x281fe0[_0x124b('0x37')]===_0x124b('0x38')){return RpcUser[_0x124b('0x39')](_0x5167f3[_0x124b('0x5')][_0x3e44bb]);}});RpcVoiceAgentReport[_0x124b('0x1b')]({'acwtime':_0xeb23e8,'agentacw':!![]},_0x1522c5,_0x3e44bb)[_0x124b('0x1c')](function(_0x30b82b){logger[_0x124b('0x1d')](_0x124b('0x1e'),_0x1522c5,_0xeb23e8,_0x30b82b);})['catch'](function(_0x47a16c){logger['error'](_0x124b('0x21'),_0x1522c5,_0x47a16c);});}else{logger['error'](_0x124b('0x3a'),_0x3e44bb);if(_0x5167f3[_0x124b('0x18')]){logger[_0x124b('0x1d')](_0x124b('0x3b'),JSON[_0x124b('0x3c')](_0x5167f3['timers']));}}}catch(_0x2e5562){logger[_0x124b('0x20')](_0x124b('0x3d'),_0x2e5562['message']);}};Acw[_0x124b('0x16')][_0x124b('0x8')]=function(_0x42b55b){try{if(this[_0x124b('0x4')][_0x42b55b[_0x124b('0x25')]]&&(this['voiceQueues'][_0x42b55b[_0x124b('0x25')]][_0x124b('0x2')]||this['voiceQueues'][_0x42b55b[_0x124b('0x25')]]['mandatoryDisposition'])){if(this[_0x124b('0x5')][_0x42b55b[_0x124b('0x24')]]){this[_0x124b('0x6')][_0x42b55b[_0x124b('0x34')]]={'queue':_0x42b55b['queue'],'interface':_0x42b55b[_0x124b('0x24')],'destlinkedid':_0x42b55b[_0x124b('0x2e')]};}}}catch(_0xf58b7a){logger[_0x124b('0x20')]('[ACW][syncAgentConnect]\x20%s',_0xf58b7a[_0x124b('0x3e')]);}};Acw[_0x124b('0x16')][_0x124b('0x12')]=function(_0x1bb9f0){try{if(this[_0x124b('0x4')][_0x1bb9f0['queue']]&&(this['voiceQueues'][_0x1bb9f0[_0x124b('0x25')]]['acw']||this[_0x124b('0x4')][_0x1bb9f0[_0x124b('0x25')]][_0x124b('0x26')])){if(this['agents'][_0x1bb9f0[_0x124b('0x24')]]){this[_0x124b('0x6')][_0x1bb9f0['uniqueid']]={'queue':_0x1bb9f0[_0x124b('0x25')],'interface':_0x1bb9f0[_0x124b('0x24')]};}}}catch(_0xef4c6e){logger[_0x124b('0x20')](_0x124b('0x3f'),_0xef4c6e[_0x124b('0x3e')]);}};Acw['prototype'][_0x124b('0xb')]=function(_0x211bf9){try{if(this['channels'][_0x211bf9[_0x124b('0x34')]]&&_['isUndefined'](this[_0x124b('0x6')][_0x211bf9['uniqueid']][_0x124b('0x2d')])){logger['info'](_0x124b('0x40'),_0x211bf9[_0x124b('0x34')]);this[_0x124b('0x23')](_0x211bf9[_0x124b('0x34')]);}else if(this[_0x124b('0x6')][_0x211bf9['linkedid']]&&_['isUndefined'](this[_0x124b('0x6')][_0x211bf9['linkedid']][_0x124b('0x2d')])){logger['info'](_0x124b('0x41'),_0x211bf9['linkedid']);this[_0x124b('0x23')](_0x211bf9[_0x124b('0x42')]);}}catch(_0x5cf5e2){logger['error'](_0x124b('0x43'),_0x5cf5e2[_0x124b('0x3e')]);}};Acw[_0x124b('0x16')][_0x124b('0xd')]=function(_0x163025){try{if(this[_0x124b('0x6')][_0x163025[_0x124b('0x34')]]&&this[_0x124b('0x6')][_0x163025[_0x124b('0x34')]][_0x124b('0x2d')]){logger[_0x124b('0x1d')](_0x124b('0x44'),_0x163025[_0x124b('0x34')]);this[_0x124b('0x23')](_0x163025[_0x124b('0x34')]);}else if(this[_0x124b('0x6')][_0x163025['linkedid']]&&this[_0x124b('0x6')][_0x163025[_0x124b('0x42')]][_0x124b('0x2d')]){logger[_0x124b('0x1d')](_0x124b('0x45'),_0x163025['linkedid']);this[_0x124b('0x23')](_0x163025[_0x124b('0x42')]);}}catch(_0x17000f){logger[_0x124b('0x20')](_0x124b('0x46'),_0x17000f[_0x124b('0x3e')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x42106e){try{if(!_[_0x124b('0x47')](this[_0x124b('0x6')][_0x42106e[_0x124b('0x48')]])){this[_0x124b('0x23')](_0x42106e[_0x124b('0x48')]);if(this[_0x124b('0x6')][_0x42106e[_0x124b('0x49')]]){this['channels'][_0x42106e[_0x124b('0x49')]][_0x124b('0x2d')]=!![];this[_0x124b('0x6')][_0x42106e[_0x124b('0x4a')]]=this[_0x124b('0x6')][_0x42106e[_0x124b('0x49')]];delete this[_0x124b('0x6')][_0x42106e[_0x124b('0x49')]];}}else if(!_[_0x124b('0x47')](this[_0x124b('0x6')][_0x42106e[_0x124b('0x4a')]])){this[_0x124b('0x23')](_0x42106e[_0x124b('0x4a')]);if(this['channels'][_0x42106e[_0x124b('0x4b')]]){this[_0x124b('0x6')][_0x42106e[_0x124b('0x4b')]][_0x124b('0x2d')]=!![];this[_0x124b('0x6')][_0x42106e[_0x124b('0x48')]]=this[_0x124b('0x6')][_0x42106e[_0x124b('0x4b')]];delete this[_0x124b('0x6')][_0x42106e[_0x124b('0x4b')]];}}}catch(_0x44d9ad){logger[_0x124b('0x20')](_0x124b('0x4c'),_0x44d9ad['message']);}};Acw['prototype'][_0x124b('0x4d')]=function(_0x3cae14){try{if(this[_0x124b('0x6')][_0x3cae14['transfereruniqueid']]){logger[_0x124b('0x1d')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x124b('0x3c')](_0x3cae14[_0x124b('0x4e')]));this[_0x124b('0x23')](_0x3cae14[_0x124b('0x4e')]);}else if(this[_0x124b('0x6')][_0x3cae14[_0x124b('0x4f')]]){logger[_0x124b('0x1d')](_0x124b('0x50'),JSON['stringify'](_0x3cae14[_0x124b('0x4f')]));this[_0x124b('0x23')](_0x3cae14[_0x124b('0x4f')]);}}catch(_0xc19d6a){logger[_0x124b('0x20')](_0x124b('0x51'),_0xc19d6a['message']);}};Acw[_0x124b('0x16')]['syncAgentRingNoAnswer']=function(_0x5c898f){try{if(this['voiceQueues'][_0x5c898f[_0x124b('0x25')]]&&this[_0x124b('0x4')][_0x5c898f[_0x124b('0x25')]][_0x124b('0x52')]===_0x124b('0x53')){if(this[_0x124b('0x5')][_0x5c898f[_0x124b('0x24')]]){logger[_0x124b('0x1d')](_0x124b('0x54'),_0x5c898f[_0x124b('0x34')],_0x5c898f[_0x124b('0x24')],_0x5c898f[_0x124b('0x25')]);return RpcUser['savePause'](this['agents'][_0x5c898f[_0x124b('0x24')]],_0x124b('0x55'),_0x5c898f[_0x124b('0x34')]);}}}catch(_0x23bc4b){logger['error'](_0x124b('0x56'),_0x23bc4b[_0x124b('0x3e')]);}};module[_0x124b('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 71a52d4..59a3c72 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 _0xf405=['keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','catch','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','port','asterisk','username','password'];(function(_0x3b7d54,_0x1a2137){var _0x14f62e=function(_0x4227b4){while(--_0x4227b4){_0x3b7d54['push'](_0x3b7d54['shift']());}};_0x14f62e(++_0x1a2137);}(_0xf405,0x6b));var _0x5f40=function(_0x592440,_0x363cbd){_0x592440=_0x592440-0x0;var _0x181f53=_0xf405[_0x592440];return _0x181f53;};'use strict';var Manager=require(_0x5f40('0x0'));var BPromise=require(_0x5f40('0x1'));var util=require(_0x5f40('0x2'));var logger=require(_0x5f40('0x3'))(_0x5f40('0x4'));var config=require(_0x5f40('0x5'));var ami=new Manager(config['asterisk'][_0x5f40('0x6')],config[_0x5f40('0x7')]['ip'],config[_0x5f40('0x7')][_0x5f40('0x8')],config[_0x5f40('0x7')][_0x5f40('0x9')],!![]);ami[_0x5f40('0xa')]();ami[_0x5f40('0xb')]=BPromise[_0x5f40('0xc')](ami[_0x5f40('0xd')]);function error(_0x204f7b){logger[_0x5f40('0xe')](util['format'](_0x5f40('0xf'),config[_0x5f40('0x7')]['username'],config[_0x5f40('0x7')]['ip'],config['asterisk'][_0x5f40('0x6')],util[_0x5f40('0x10')](_0x204f7b,![],null)));}function close(){logger[_0x5f40('0xe')](util[_0x5f40('0x11')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x5f40('0x7')][_0x5f40('0x8')],config[_0x5f40('0x7')]['ip'],config[_0x5f40('0x7')][_0x5f40('0x6')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x5f40('0xb')]({'action':_0x5f40('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x5f40('0x13')});};};ami[_0x5f40('0x14')]=function(){return function(){return ami[_0x5f40('0xb')]({'action':_0x5f40('0x15')});};};ami[_0x5f40('0x16')]=function(){return function(){return ami[_0x5f40('0xb')]({'action':_0x5f40('0x17')});};};ami[_0x5f40('0x18')]=function(){return function(){return ami[_0x5f40('0xb')]({'action':_0x5f40('0x19')});};};function connect(){logger[_0x5f40('0x1a')](util[_0x5f40('0x11')](_0x5f40('0x1b'),config['asterisk'][_0x5f40('0x8')],config[_0x5f40('0x7')]['ip'],config[_0x5f40('0x7')]['port']));ami[_0x5f40('0x1c')]('error',error);ami[_0x5f40('0x1c')](_0x5f40('0x1d'),close);}ami['on'](_0x5f40('0x1e'),connect);ami['on'](_0x5f40('0x1f'),function(_0xc9e003){logger[_0x5f40('0x1a')](util[_0x5f40('0x11')](_0x5f40('0x20'),config[_0x5f40('0x7')][_0x5f40('0x8')],config[_0x5f40('0x7')]['ip'],config[_0x5f40('0x7')][_0x5f40('0x6')],util[_0x5f40('0x10')](_0xc9e003,![],null)));});ami['on'](_0x5f40('0x21'),function(){logger[_0x5f40('0x1a')](util['format'](_0x5f40('0x22'),config[_0x5f40('0x7')]['username'],config[_0x5f40('0x7')]['ip'],config['asterisk'][_0x5f40('0x6')]));return Promise[_0x5f40('0x23')]()[_0x5f40('0x24')](ami[_0x5f40('0x25')]())['then'](ami['actionDeviceStateList']())[_0x5f40('0x24')](ami[_0x5f40('0x14')]())['then'](ami[_0x5f40('0x16')]())[_0x5f40('0x24')](ami[_0x5f40('0x18')]())[_0x5f40('0x26')](function(_0x3ea2b5){logger[_0x5f40('0xe')]('[ami.js][fullybooted]',util[_0x5f40('0x10')](_0x3ea2b5,{'showHidden':![],'depth':null}));});});ami[_0x5f40('0x1c')](_0x5f40('0xe'),error);ami[_0x5f40('0x1c')](_0x5f40('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0x68e5=['../../config/logger','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','info','inspect','fullybooted','resolve','then','catch','[ami.js][fullybooted]','close','exports','asterisk-manager','util'];(function(_0x13ea6c,_0x5a8ae8){var _0x3c0b66=function(_0x22332d){while(--_0x22332d){_0x13ea6c['push'](_0x13ea6c['shift']());}};_0x3c0b66(++_0x5a8ae8);}(_0x68e5,0x86));var _0x568e=function(_0xa4e726,_0x415201){_0xa4e726=_0xa4e726-0x0;var _0x4cfe2f=_0x68e5[_0xa4e726];return _0x4cfe2f;};'use strict';var Manager=require(_0x568e('0x0'));var BPromise=require('bluebird');var util=require(_0x568e('0x1'));var logger=require(_0x568e('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x568e('0x3')][_0x568e('0x4')],config['asterisk']['ip'],config['asterisk'][_0x568e('0x5')],config[_0x568e('0x3')][_0x568e('0x6')],!![]);ami[_0x568e('0x7')]();ami[_0x568e('0x8')]=BPromise[_0x568e('0x9')](ami[_0x568e('0xa')]);function error(_0x4668ef){logger[_0x568e('0xb')](util[_0x568e('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x568e('0x5')],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')],util['inspect'](_0x4668ef,![],null)));}function close(){logger[_0x568e('0xb')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x568e('0x3')]['username'],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x568e('0xd')});};};ami[_0x568e('0xe')]=function(){return function(){return ami[_0x568e('0x8')]({'action':_0x568e('0xf')});};};ami[_0x568e('0x10')]=function(){return function(){return ami['Action']({'action':_0x568e('0x11')});};};ami[_0x568e('0x12')]=function(){return function(){return ami['Action']({'action':_0x568e('0x13')});};};ami[_0x568e('0x14')]=function(){return function(){return ami[_0x568e('0x8')]({'action':_0x568e('0x15')});};};function connect(){logger['info'](util[_0x568e('0xc')](_0x568e('0x16'),config['asterisk']['username'],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')]));ami[_0x568e('0x17')]('error',error);ami[_0x568e('0x17')]('close',close);}ami['on'](_0x568e('0x18'),connect);ami['on']('shutdown',function(_0x175bbb){logger[_0x568e('0x19')](util[_0x568e('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x568e('0x3')][_0x568e('0x5')],config[_0x568e('0x3')]['ip'],config[_0x568e('0x3')][_0x568e('0x4')],util[_0x568e('0x1a')](_0x175bbb,![],null)));});ami['on'](_0x568e('0x1b'),function(){logger[_0x568e('0x19')](util[_0x568e('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x568e('0x3')][_0x568e('0x5')],config['asterisk']['ip'],config[_0x568e('0x3')]['port']));return Promise[_0x568e('0x1c')]()[_0x568e('0x1d')](ami['actionSipShowRegistry']())[_0x568e('0x1d')](ami[_0x568e('0xe')]())[_0x568e('0x1d')](ami['actionSipPeerStatus']())[_0x568e('0x1d')](ami[_0x568e('0x12')]())[_0x568e('0x1d')](ami[_0x568e('0x14')]())[_0x568e('0x1e')](function(_0x243c6f){logger['error'](_0x568e('0x1f'),util[_0x568e('0x1a')](_0x243c6f,{'showHidden':![],'depth':null}));});});ami[_0x568e('0x17')](_0x568e('0xb'),error);ami['once'](_0x568e('0x20'),close);module[_0x568e('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 2dc0262..bc97266 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xe706,0xa3));var _0x6e70=function(_0x46ad9e,_0x203184){_0x46ad9e=_0x46ad9e-0x0;var _0x5727cb=_0xe706[_0x46ad9e];return _0x5727cb;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xb7e7[_0x5d80de];return _0x1c7556;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 98d0d83..61b6044 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 _0xf5ef=['XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countnosuchnumberretry','dialNoAnswerMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','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','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalDroppedCallsTimeout','predictiveIntervalTotalCalls','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','getVoiceQueueRtPauses','busyFactor','check\x20failure','floor','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','maxNumberOriginate','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','getContactDialer','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','countReScheduled','checkContactBlack','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/agentComplete','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','\x20INTERVAL_IS_NULL','Interval','NULL_INTERVAL','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','length','push','Action','interval','content','true','command','iftime\x20%s,%s','indexOf','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','ivr','updateOriginated','queue','answertime','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','statedesc','Abandoned','dialAbandonedRetryFrequency','countabandonedretry','VoiceQueueId','syncNewExten','actions','channel','actionid','strategy','rrmemory','roundrobin','isNil','paused','stateinterface','locked','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','CampaignId','[unlock][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','membername','AMD','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','stateGlobal','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','syncQueueSummary','running','INACTIVE','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','pTalking','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','filter','reachable','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','moveContactManagedDialer','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting'];(function(_0x5c3107,_0x3d1516){var _0x4773b8=function(_0x508ef1){while(--_0x508ef1){_0x5c3107['push'](_0x5c3107['shift']());}};_0x4773b8(++_0x3d1516);}(_0xf5ef,0xab));var _0xff5e=function(_0x4e9609,_0x3ad51b){_0x4e9609=_0x4e9609-0x0;var _0x15542=_0xf5ef[_0x4e9609];return _0x15542;};'use strict';var util=require(_0xff5e('0x0'));var _=require(_0xff5e('0x1'));var uuid=require(_0xff5e('0x2'));var moment=require(_0xff5e('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xff5e('0x4'));var hopperUtils=require(_0xff5e('0x5'));var ut=require(_0xff5e('0x6'));var config=require(_0xff5e('0x7'));var logger=require('../../../config/logger')(_0xff5e('0x8'));var loggerBooked=require('../../../config/logger')(_0xff5e('0x9'));var loggerPredictive=require(_0xff5e('0xa'))(_0xff5e('0xb'));var loggerPredictiveCalls=require(_0xff5e('0xa'))(_0xff5e('0xc'));var loggerSyncQueueSummary=require(_0xff5e('0xa'))('syncQueueSummary');var ami=require(_0xff5e('0xd'));config[_0xff5e('0xe')]=_[_0xff5e('0xf')](config['redis'],{'host':_0xff5e('0x10'),'port':0x18eb});var io=require(_0xff5e('0x11'))(new Redis(config[_0xff5e('0xe')]));var cmHopper=require(_0xff5e('0x12'));var voiceQueueRt=require(_0xff5e('0x13'));var RpcSetting=require(_0xff5e('0x14'));var Interval=require(_0xff5e('0x15'));var Action=require('./models/action');var History=require(_0xff5e('0x16'));var Final=require(_0xff5e('0x17'));var AgentComplete=require(_0xff5e('0x18'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process[_0xff5e('0x19')][_0xff5e('0x1a')]||_0xff5e('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xff5e('0x1c')][_0xff5e('0x1d')]=function(_0x1a513f){this[_0xff5e('0x1e')]=this[_0xff5e('0x1e')]?this['tail']['finally'](_0x1a513f):_0x1a513f();};function Dialer(_0x2d1286,_0x275d41){this[_0xff5e('0x1f')]=new Sequence();this[_0xff5e('0x20')]=_0x275d41;this[_0xff5e('0x21')]=_0x2d1286[_0xff5e('0x21')];this[_0xff5e('0x22')]=_0x2d1286[_0xff5e('0x22')];this[_0xff5e('0x23')]=_0x2d1286[_0xff5e('0x23')];this['trunks']=_0x2d1286[_0xff5e('0x24')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xff5e('0x25')]={};this['actions']={};this[_0xff5e('0x26')]={};this[_0xff5e('0x27')]={};this[_0xff5e('0x28')]={};this[_0xff5e('0x29')]={};this[_0xff5e('0x2a')]={};this[_0xff5e('0x2b')]={};this[_0xff5e('0x2c')]={};this[_0xff5e('0x2d')]={};this[_0xff5e('0x2e')]={};ami['on'](_0xff5e('0x2f'),this[_0xff5e('0x30')][_0xff5e('0x31')](this));ami['on'](_0xff5e('0x32'),this[_0xff5e('0x33')][_0xff5e('0x31')](this));ami['on'](_0xff5e('0x34'),this[_0xff5e('0x35')][_0xff5e('0x31')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xff5e('0x31')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0xff5e('0x31')](this));ami['on'](_0xff5e('0x36'),this[_0xff5e('0x37')][_0xff5e('0x31')](this));ami['on']('hangup',this[_0xff5e('0x38')][_0xff5e('0x31')](this));ami['on'](_0xff5e('0x39'),this['syncNewExten'][_0xff5e('0x31')](this));ami['on']('varset',this[_0xff5e('0x3a')][_0xff5e('0x31')](this));ami['on'](_0xff5e('0x3b'),this[_0xff5e('0x3c')][_0xff5e('0x31')](this));ami['on']('queuestatuscomplete',this[_0xff5e('0x3d')][_0xff5e('0x31')](this));this['loopCampaigns']();this[_0xff5e('0x3e')]();RpcSetting[_0xff5e('0x3f')]()[_0xff5e('0x40')](function(_0xd2ce6d){previewRecallmeReminderInterval=_0xd2ce6d[_0xff5e('0x41')];});}function isNotNull(_0x2f0cd4){return _0x2f0cd4!==null&&!_[_0xff5e('0x42')](_0x2f0cd4);}function msgResponse(_0x4dca2c,_0x2f5caf,_0x56a963){return{'action':_0x4dca2c,'response':_0x2f5caf,'message':_0x56a963,'stack':_0x56a963};}function emit(_0x4304eb,_0x14b24a,_0x4f6418){io['to'](_0x4304eb)[_0xff5e('0x43')](_0x14b24a,_0x4f6418);}function emitOutboundVoiceQueueSummary(_0x4d549f){if(_0x4d549f[_0xff5e('0x44')]==='outbound'){logger['debug'](_0xff5e('0x45'),util[_0xff5e('0x46')](_0x4d549f,{'showHidden':![],'depth':null}));emit(util[_0xff5e('0x47')](_0xff5e('0x48'),_0x4d549f[_0xff5e('0x49')]),_0xff5e('0x4a'),_0x4d549f);}}function checkGetDataPredictive(_0x2f0dc3){if(isNotNull(_0x2f0dc3)&&!_[_0xff5e('0x4b')](_0x2f0dc3)){loggerPredictive['info'](_0xff5e('0x4c'));loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x4e'),_0x2f0dc3['predictiveIntervalTotalCalls']);loggerPredictive[_0xff5e('0x4d')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f0dc3[_0xff5e('0x4f')]);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x50'),_0x2f0dc3['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f0dc3[_0xff5e('0x51')]);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x52'),_0x2f0dc3[_0xff5e('0x53')]);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x54'),_0x2f0dc3[_0xff5e('0x55')]);loggerPredictive['info'](_0xff5e('0x56'));if(_0x2f0dc3['predictiveIntervalTotalCalls']>0x0){if(!_[_0xff5e('0x42')](_0x2f0dc3['predictiveIntervalAvgTalktime'])&&_0x2f0dc3[_0xff5e('0x55')]>0x0){return!![];}loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x57'));if(!_[_0xff5e('0x42')](_0x2f0dc3[_0xff5e('0x53')])&&_0x2f0dc3[_0xff5e('0x53')]>0x0){return!![];}loggerPredictive[_0xff5e('0x4d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x58'));}}else{loggerPredictive[_0xff5e('0x4d')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x550aae){return function(_0x402fdb){loggerPredictive['info'](_0xff5e('0x59'));loggerPredictive['info'](_0xff5e('0x5a'),_0x402fdb[_0xff5e('0x5b')]);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x5c'),_0x402fdb[_0xff5e('0x5d')]);loggerPredictive['info'](_0xff5e('0x5e'),_0x402fdb[_0xff5e('0x5f')]);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x60'),_0x402fdb[_0xff5e('0x61')]);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x5e'),_0x402fdb[_0xff5e('0x5f')]);loggerPredictive['info'](_0xff5e('0x56'));_[_0xff5e('0x62')](_0x550aae,_0x402fdb);};}function ifInterval(_0xad09cc,_0x418351){if(_['isUndefined'](_0x418351)){return![];}return utils[_0xff5e('0x63')](undefined,_0x418351)<_0xad09cc*0x3c;}function clearPredictiveAttributes(_0x4bf676){if(_0x4bf676['startProgressive']){_0x4bf676[_0xff5e('0x2a')]=undefined;loggerPredictive[_0xff5e('0x64')](_0x4bf676['name'],_0xff5e('0x65'));}if(_0x4bf676[_0xff5e('0x29')]){_0x4bf676['startPredictive']=undefined;loggerPredictive['debug'](_0x4bf676[_0xff5e('0x49')],_0xff5e('0x66'));}if(_0x4bf676[_0xff5e('0x67')]){clearInterval(_0x4bf676[_0xff5e('0x67')]);_0x4bf676[_0xff5e('0x67')]=undefined;loggerPredictive[_0xff5e('0x64')](_0x4bf676['name'],_0xff5e('0x68'));}}function loggerCatchPredictive(_0x207719,_0x3d0280){return function(_0x18aa8f){loggerPredictive[_0xff5e('0x69')](_0x3d0280['name'],_0x207719);loggerPredictive[_0xff5e('0x69')](_0x18aa8f[_0xff5e('0x6a')]);clearPredictiveAttributes(_0x3d0280);};}function loggerCatch(_0xd4aeef){return function(_0xbcb976){logger[_0xff5e('0x69')](_0xd4aeef,util['inspect'](_0xbcb976,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1750a3,_0x263d16,_0x714f6){return function(_0x5931b6){utils[_0xff5e('0x6b')](_0x263d16,_0x714f6,0x0);_0x263d16[_0xff5e('0x6c')]=0x0;logger[_0xff5e('0x69')](_0x1750a3,util['inspect'](_0x5931b6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3116e1){return function(_0x4a724f){if(isNotNull(_0x4a724f)&&isNotNull(_0x4a724f[0x0])){if(_0x4a724f[0x0][_0xff5e('0x6d')]>0x0){_0x3116e1[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x70')];logger[_0xff5e('0x4d')]('[getContactDialer2][ReScheduled]'+_0x3116e1[_0xff5e('0x49')],_0x4a724f[0x0][_0xff5e('0x6d')],'contacts');}else{_0x3116e1[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x71')];logger[_0xff5e('0x4d')](_0xff5e('0x72')+_0x3116e1['name']);}}};}function createObjHistory(_0x39fb34,_0x4408d4,_0xe9dbcf,_0x36a2a4,_0x567ae0){_0x39fb34[_0xff5e('0x6e')]=_0xe9dbcf;var _0x42c173=new Action(_0x39fb34,_0x4408d4);var _0x30d10a=new History(_0x42c173);_0x30d10a[_0xff5e('0x73')]=_0x36a2a4;_0x30d10a['statedesc']=_0x567ae0;_0x30d10a[_0xff5e('0x74')]=_0x42c173['starttime'];return _0x30d10a;}function unlockQueueStatus(_0x586b09,_0x1a1f76){setTimeout(function(){if(_['isUndefined'](_0x586b09['queueStatusComplete'])){loggerBooked[_0xff5e('0x69')](_0xff5e('0x75'),_0x1a1f76);}_0x586b09[_0xff5e('0x76')]=!![];loggerBooked[_0xff5e('0x4d')](_0xff5e('0x77'),_0x1a1f76,JSON[_0xff5e('0x78')](_[_0xff5e('0x79')](_0x586b09,['name',_0xff5e('0x76')])));},0x1f3);}function checkInterval(_0x7e3eed){return function(){if(!isNotNull(_0x7e3eed['Interval'])){_0x7e3eed[_0xff5e('0x6e')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x7e3eed[_0xff5e('0x49')]+_0xff5e('0x7a');}if(!isNotNull(_0x7e3eed[_0xff5e('0x7b')]['Intervals'])){_0x7e3eed[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')]['NULL_INTERVAL'];throw _0x7e3eed['name']+_0xff5e('0x7a');}if(!isNotNull(_[_0xff5e('0x4b')](_0x7e3eed[_0xff5e('0x7b')]['Intervals']))){_0x7e3eed[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x7c')];throw _0x7e3eed[_0xff5e('0x49')]+_0xff5e('0x7a');}};}function checkIsIVRCampaignActive(_0x67b2b8){return function(){if(!utils[_0xff5e('0x7d')](_0x67b2b8)){_0x67b2b8['message']=utils[_0xff5e('0x6f')]['INACTIVE'];throw _0x67b2b8[_0xff5e('0x49')]+_0xff5e('0x7e');}};}function emitCampaignSummary(_0x6a2958){if(utils[_0xff5e('0x7f')](_0x6a2958)){emit(util[_0xff5e('0x47')](_0xff5e('0x80'),_0x6a2958[_0xff5e('0x49')]),_0xff5e('0x81'),_0x6a2958);}}function loggerCatchQueueSummary(_0x713161,_0xa0f82e){return function(_0x3e3de7){clearPredictiveAttributes(_0xa0f82e);emitCampaignSummary(_0xa0f82e);loggerSyncQueueSummary[_0xff5e('0x64')](_0x713161,util[_0xff5e('0x46')](_0x3e3de7,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5dc0a4){if(_0x5dc0a4[_0xff5e('0x82')]){if(_0x5dc0a4[_0xff5e('0x83')]===0x0){_0x5dc0a4[_0xff5e('0x82')]=![];_0x5dc0a4[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')]['INACTIVE'];loggerSyncQueueSummary[_0xff5e('0x64')](_0xff5e('0x84'),_0x5dc0a4[_0xff5e('0x49')],_0xff5e('0x85'));}else{_0x5dc0a4[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')]['DISACTIVED'];loggerSyncQueueSummary[_0xff5e('0x64')](_0xff5e('0x84'),_0x5dc0a4[_0xff5e('0x49')],'is\x20disactive');}emitCampaignSummary(_0x5dc0a4);}}function myreject(_0x448065){return function(_0x54d870){return _0x448065(msgResponse(_0xff5e('0x86'),_0xff5e('0x87'),JSON[_0xff5e('0x78')](_0x54d870)));};}Dialer[_0xff5e('0x1c')][_0xff5e('0x88')]=function(_0x20b264){return!_[_0xff5e('0x42')](_0x20b264)&&_0x20b264&&!_[_0xff5e('0x42')](_0x20b264[_0xff5e('0x49')])&&!_[_0xff5e('0x42')](_0x20b264[_0xff5e('0x89')])&&_0x20b264['active']&&(this['trunks'][util[_0xff5e('0x47')](_0xff5e('0x8a'),_0x20b264['name'])][_0xff5e('0x8b')]==='reachable'||this['trunks'][util[_0xff5e('0x47')](_0xff5e('0x8a'),_0x20b264[_0xff5e('0x49')])][_0xff5e('0x8b')]===_0xff5e('0x8c'));};Dialer[_0xff5e('0x1c')][_0xff5e('0x8d')]=function(_0x48672d){var _0x9d8d2c=this;return function(){if(!_0x9d8d2c[_0xff5e('0x88')](_0x48672d[_0xff5e('0x8e')])){if(!_0x9d8d2c[_0xff5e('0x88')](_0x48672d[_0xff5e('0x8f')])){_0x48672d[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x90')];throw _0x48672d[_0xff5e('0x49')]+_0xff5e('0x91');}}};};Dialer[_0xff5e('0x1c')][_0xff5e('0x92')]=function(_0x2f2f46,_0x428f4f,_0x49f6dc,_0x2c3a6c){var _0x5634fa=this;return function(){var _0x2b1ef2=!![];return _0x5634fa['ifTimeIvr'](_0x2f2f46,_0x428f4f,_0x49f6dc,_0x2c3a6c,_0x2b1ef2);};};Dialer[_0xff5e('0x1c')][_0xff5e('0x93')]=function(_0xf8ee76,_0x1ded36,_0x336fac,_0xe52e58){var _0x55f5ae=this;return function(){var _0x59978b=![];return _0x55f5ae[_0xff5e('0x94')](_0xf8ee76['Intervals'],_0x1ded36,_0x336fac,_0xe52e58,_0x59978b);};};Dialer[_0xff5e('0x1c')][_0xff5e('0x94')]=function(_0x4ba93e,_0x496290,_0x45fa67,_0x2bc41b,_0x3bffe9){var _0x301c9f=[];return new Promise(function(_0x47e6db,_0x5a7a19){if(!isNotNull(_0x4ba93e)){_0x2bc41b[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x7c')];return _0x5a7a19(msgResponse(_0xff5e('0x95'),'Failure',_0x45fa67+_0xff5e('0x96')));}if(_['isEmpty'](_0x4ba93e)){_0x2bc41b[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x97')];return _0x5a7a19(msgResponse('ifTime',_0xff5e('0x98'),_0x45fa67+_0xff5e('0x99')));}if(_0x496290&&_[_0xff5e('0x42')](config[_0xff5e('0x9a')][_0x496290])){_0x2bc41b[_0xff5e('0x6e')]=utils['CAMPAIGN_STATUS'][_0xff5e('0x9b')];return _0x5a7a19(msgResponse(_0xff5e('0x95'),_0xff5e('0x98'),_0x45fa67+'\x20Timezone\x20unknow\x20'+_0x496290));}if(_['isArray'](_0x4ba93e)){for(var _0x4cd77b=0x0;_0x4cd77b<_0x4ba93e[_0xff5e('0x9c')];_0x4cd77b+=0x1){_0x301c9f[_0xff5e('0x9d')](ami[_0xff5e('0x9e')]({'action':'command','command':util['format']('iftime\x20%s,%s',_0x4ba93e[_0x4cd77b][_0xff5e('0x9f')],!_[_0xff5e('0x42')](config[_0xff5e('0x9a')][_0x496290])?_0x496290:'')})[_0xff5e('0x40')](function(_0x3ebe93){return _0x3ebe93[_0xff5e('0xa0')]['indexOf'](_0xff5e('0xa1'))>=0x0;})['catch'](myreject(_0x5a7a19)));}}else{_0x301c9f[_0xff5e('0x9d')](ami[_0xff5e('0x9e')]({'action':_0xff5e('0xa2'),'command':util[_0xff5e('0x47')](_0xff5e('0xa3'),_0x4ba93e,!_[_0xff5e('0x42')](config['timezones'][_0x496290])?_0x496290:'')})[_0xff5e('0x40')](function(_0xc3396c){return _0xc3396c[_0xff5e('0xa0')][_0xff5e('0xa4')](_0xff5e('0xa1'))>=0x0;})[_0xff5e('0xa5')](myreject(_0x5a7a19)));}Promise['all'](_0x301c9f)[_0xff5e('0x40')](function(_0x3aba1a){var _0x2abcdd=_[_0xff5e('0xa6')](_0x3aba1a);if(_0x2abcdd){return _0x47e6db(_0x2abcdd);}else{_0x2bc41b[_0xff5e('0x6e')]=_0x3bffe9?utils[_0xff5e('0x6f')][_0xff5e('0xa7')]:utils['CAMPAIGN_STATUS'][_0xff5e('0xa8')];return _0x5a7a19(msgResponse(_0xff5e('0xa9'),_0xff5e('0x98'),_0xff5e('0xaa')+_0x3bffe9+'\x20'+_0x45fa67+_0xff5e('0xab')+util[_0xff5e('0x46')](_0x4ba93e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x496290));}})[_0xff5e('0xa5')](function(_0x3eae64){return _0x5a7a19(msgResponse(_0xff5e('0x95'),_0xff5e('0x98'),JSON[_0xff5e('0x78')](_0x3eae64)));});});};Dialer['prototype'][_0xff5e('0xac')]=function(){var _0x3faea3=this;return cmHopper[_0xff5e('0xad')]({'active':![]},{'where':{'active':!![]}})[_0xff5e('0x40')](function(){setInterval(function(){_0x3faea3[_0xff5e('0xae')]();},0x3e8);});};Dialer[_0xff5e('0x1c')]['syncCampaigns']=function(){var _0xc44ee=this;var _0x3ab240;for(var _0x42ed64 in this[_0xff5e('0x22')]){if(typeof this[_0xff5e('0x22')][_0x42ed64]!=='undefined'){_0x3ab240=this['campaigns'][_0x42ed64];if(utils[_0xff5e('0x7f')](_0x3ab240)&&utils[_0xff5e('0x7d')](_0x3ab240)){_0x3ab240[_0xff5e('0x82')]=!![];Promise[_0xff5e('0xaf')]()[_0xff5e('0x40')](checkIsIVRCampaignActive(_0x3ab240))[_0xff5e('0x40')](checkInterval(_0x3ab240))['then'](_0xc44ee[_0xff5e('0x8d')](_0x3ab240))[_0xff5e('0x40')](_0xc44ee[_0xff5e('0x92')](_0x3ab240[_0xff5e('0xb0')],_0x3ab240[_0xff5e('0xb1')],_0x3ab240[_0xff5e('0x49')],_0x3ab240))[_0xff5e('0x40')](_0xc44ee[_0xff5e('0x93')](_0x3ab240[_0xff5e('0x7b')],_0x3ab240[_0xff5e('0xb1')],_0x3ab240[_0xff5e('0x49')],_0x3ab240))[_0xff5e('0x40')](_0xc44ee[_0xff5e('0xb2')](_0x3ab240))[_0xff5e('0xa5')](loggerCatchQueueSummary(_0xff5e('0xb3'),_0x3ab240));}else{notSendMessagesCampaign(_0x3ab240);}}}};Dialer[_0xff5e('0x1c')][_0xff5e('0xb4')]=function(_0x2cdc38){if(_0x2cdc38[_0xff5e('0xb5')]!==_0xff5e('0xb')){clearPredictiveAttributes(_0x2cdc38);}switch(_0x2cdc38[_0xff5e('0xb5')]){case'progressive':this[_0xff5e('0xb6')](_0x2cdc38,0x1);break;case _0xff5e('0xb7'):this[_0xff5e('0xb6')](_0x2cdc38,_0x2cdc38[_0xff5e('0xb8')]);break;case _0xff5e('0xb'):this[_0xff5e('0xb')](_0x2cdc38);break;case'booked':this['handlePower'](_0x2cdc38,0x1);break;default:logger['error'](_0xff5e('0xb9'),_0x2cdc38['name'],_0xff5e('0xba'));}};Dialer[_0xff5e('0x1c')][_0xff5e('0x95')]=function(_0x2647e0,_0x2174b9){var _0xb51317=_0x2647e0[_0xff5e('0xb1')];var _0x40a827=_0x2174b9?_0x2647e0['dialGlobalInterval']:_0x2647e0[_0xff5e('0x7b')]['Intervals'];logger['silly'](_0xff5e('0xbb'),_0x40a827,_0xb51317,_0x2647e0['name'],util[_0xff5e('0x47')](_0xff5e('0xbc'),_0x2647e0[_0xff5e('0x49')],_0x2647e0['id']));var _0x1e5f97=null;return Interval[_0xff5e('0xbd')](_0x40a827,_0xb51317)[_0xff5e('0x40')](function(_0x3d2e2e){if(_0x3d2e2e===!![]){return _0x3d2e2e;}else{_0x2647e0[_0xff5e('0x6e')]=_0x2174b9?utils[_0xff5e('0x6f')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xff5e('0x6f')]['OVERTIME_INTERVAL'];_0x1e5f97=msgResponse(_0xff5e('0xa9'),_0xff5e('0x98'),_0xff5e('0xaa')+_0x2174b9+'\x20'+_0x2647e0[_0xff5e('0x49')]+_0xff5e('0xab')+util[_0xff5e('0x46')](_0x40a827,{'showHidden':![],'depth':null})+_0xff5e('0xbe')+_0xb51317);}if(_0x1e5f97!==null){logger[_0xff5e('0xbf')](_0xff5e('0xc0'),_0x1e5f97);_0x1e5f97[_0xff5e('0xc1')]=_0x2174b9;throw _0x1e5f97;}})[_0xff5e('0xa5')](function(_0x16467e){logger['error'](_0xff5e('0xc2'),_0x16467e);throw msgResponse('[ifTime][Action]','Error',util[_0xff5e('0x46')](_0x16467e,{'showHidden':![],'depth':null}));});};Dialer[_0xff5e('0x1c')][_0xff5e('0x30')]=function(_0x5d84df){if(this['voiceQueues'][_0x5d84df['queue']]){if(this[_0xff5e('0x27')][_0x5d84df[_0xff5e('0xc3')]]&&this[_0xff5e('0x27')][_0x5d84df[_0xff5e('0xc3')]]['type']!==_0xff5e('0xc4')){this[_0xff5e('0xc5')](this['voiceQueues'][_0x5d84df[_0xff5e('0xc6')]]);this[_0xff5e('0x27')][_0x5d84df[_0xff5e('0xc3')]][_0xff5e('0xc7')]=moment()[_0xff5e('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xff5e('0xc8')]=function(_0x2299d2){var _0x281c7d=this[_0xff5e('0x27')][_0x2299d2[_0xff5e('0xc3')]];if(this[_0xff5e('0x21')][_0x2299d2[_0xff5e('0xc6')]]){if(_0x281c7d&&_0x281c7d['type']!==_0xff5e('0xc4')){delete this[_0xff5e('0x27')][_0x2299d2[_0xff5e('0xc3')]];this[_0xff5e('0x21')][_0x2299d2[_0xff5e('0xc6')]][_0xff5e('0xc9')]+=0x1;var _0x2cc432=new AgentComplete(_0x281c7d,_0x2299d2);if(_0x2299d2[_0xff5e('0xca')]===_0xff5e('0xcb')){_0x2cc432[_0xff5e('0xcc')]=this['voiceQueues'][_0x2299d2['queue']][_0xff5e('0xcd')]&&this['voiceQueues'][_0x2299d2['queue']]['dialAgiAfterHangupAgent']?moment()[_0xff5e('0x47')](_0xff5e('0xce')):undefined;}hopperUtils[_0xff5e('0xcf')](_0x2cc432)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0xd0')));hopperUtils['moveContactManagedDialer'](_0x2cc432)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0xd1')));}}};Dialer[_0xff5e('0x1c')][_0xff5e('0x33')]=function(_0xb4dd93){var _0x42d3bb=this['uniqueId'][_0xb4dd93['uniqueid']];var _0x271e73=this;var _0x5525f3=![];var _0x3a8e47;var _0x2ea82c;if(this[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]]){if(_0x42d3bb&&_0x42d3bb['type']!==_0xff5e('0xc4')){delete this[_0xff5e('0x27')][_0xb4dd93[_0xff5e('0xc3')]];this['updateOriginated'](this['voiceQueues'][_0xb4dd93[_0xff5e('0xc6')]]);_0x42d3bb[_0xff5e('0xd2')]=moment()[_0xff5e('0x47')](_0xff5e('0xce'));var _0x58d3c8=new QueueCallerAbandon(_0x42d3bb,_0xb4dd93);if(utils['getSeconds'](_0x42d3bb[_0xff5e('0xd2')],_0x42d3bb[_0xff5e('0xd3')])>=_0x42d3bb[_0xff5e('0xd4')]){this[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xd5')]+=0x1;this[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xd6')]+=0x1;_0x58d3c8[_0xff5e('0x73')]=0xa;_0x58d3c8['statedesc']='Drop';_0x58d3c8[_0xff5e('0xd7')]=_0xff5e('0xd8');_0x58d3c8['agiafterat']=this['voiceQueues'][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xcd')]?moment()[_0xff5e('0x47')](_0xff5e('0xce')):undefined;_0x58d3c8[_0xff5e('0xd9')]+=0x1;_0x58d3c8[_0xff5e('0xda')]+=0x1;_0x3a8e47=this[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xdb')];_0x2ea82c=this[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xdc')];hopperUtils[_0xff5e('0xdd')](_0x58d3c8,_0x58d3c8['state'],_0x42d3bb[_0xff5e('0xde')])['then'](function(_0x5b37e5){_0x5525f3=_0x5b37e5[_0xff5e('0xdf')]==0x1;if(_0x58d3c8[_0xff5e('0xd9')]>=_0x271e73[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xe0')]){_0x271e73[_0xff5e('0xe1')](_0x58d3c8,_0x5b37e5[_0xff5e('0xdf')]);}else{hopperUtils[_0xff5e('0xe2')]({'active':![],'countdropretry':_0x58d3c8[_0xff5e('0xd9')],'scheduledat':moment()[_0xff5e('0xe3')](_0x271e73[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xdb')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x42d3bb[_0xff5e('0xe5')],'ListId':_0x42d3bb[_0xff5e('0xe6')],'VoiceQueueId':_0x42d3bb['VoiceQueueId']||undefined,'CampaignId':_0x42d3bb['CampaignId']||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0xe7')));var _0x2a3dbf=new History(_0x58d3c8);_0x2a3dbf[_0xff5e('0x73')]=0xa;_0x2a3dbf['statedesc']='Drop';_0x2a3dbf[_0xff5e('0xe8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a3dbf['endtime']=_0x2a3dbf['starttime'];_0x2a3dbf[_0xff5e('0xe9')]=_0x58d3c8['calleridname'];_0x2a3dbf[_0xff5e('0xea')]=_0x58d3c8['calleridnum'];hopperUtils[_0xff5e('0xcf')](_0x2a3dbf)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0xeb')));}})[_0xff5e('0x40')](function(){if(_0x5525f3)hopperUtils[_0xff5e('0xec')](_0x58d3c8,_0x3a8e47,_0x2ea82c)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0x51')]+=0x1;this[_0xff5e('0x21')][_0xb4dd93['queue']][_0xff5e('0xed')]+=0x1;_0x58d3c8[_0xff5e('0x73')]=0xb;_0x58d3c8[_0xff5e('0xee')]=_0xff5e('0xef');_0x58d3c8[_0xff5e('0xd7')]='CALLEREXIT';_0x58d3c8['countabandonedretry']+=0x1;_0x58d3c8[_0xff5e('0xda')]+=0x1;_0x3a8e47=this[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xf0')];_0x2ea82c=this[_0xff5e('0x21')][_0xb4dd93['queue']][_0xff5e('0xdc')];hopperUtils[_0xff5e('0xdd')](_0x58d3c8,_0x58d3c8[_0xff5e('0x73')],_0x42d3bb[_0xff5e('0xde')])['then'](function(_0x4fe7c5){if(_0x58d3c8['countabandonedretry']>=_0x271e73[_0xff5e('0x21')][_0xb4dd93['queue']]['dialAbandonedMaxRetry']){_0x271e73['queueCallerAbandonCreateState'](_0x58d3c8,_0x4fe7c5[_0xff5e('0xdf')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x58d3c8[_0xff5e('0xf1')],'scheduledat':moment()[_0xff5e('0xe3')](_0x271e73[_0xff5e('0x21')][_0xb4dd93[_0xff5e('0xc6')]][_0xff5e('0xf0')],_0xff5e('0xe4'))[_0xff5e('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x42d3bb[_0xff5e('0xe5')],'ListId':_0x42d3bb['ListId'],'VoiceQueueId':_0x42d3bb[_0xff5e('0xf2')]||undefined,'CampaignId':_0x42d3bb['CampaignId']||undefined})[_0xff5e('0xa5')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x55f85d=new History(_0x58d3c8);_0x55f85d[_0xff5e('0x73')]=0xb;_0x55f85d[_0xff5e('0xee')]=_0xff5e('0xef');_0x55f85d[_0xff5e('0xe8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x55f85d['endtime']=_0x55f85d[_0xff5e('0xe8')];_0x55f85d['calleridname']=_0x58d3c8['calleridname'];_0x55f85d['calleridnum']=_0x58d3c8[_0xff5e('0xea')];hopperUtils[_0xff5e('0xcf')](_0x55f85d)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x5525f3)hopperUtils['swapAdditionalPhones'](_0x58d3c8,_0x3a8e47,_0x2ea82c)[_0xff5e('0x40')](function(){return 0x1;});});}}}};Dialer[_0xff5e('0x1c')][_0xff5e('0xf3')]=function(_0x37611c){if(this[_0xff5e('0xf4')][_0x37611c['uniqueid']]){this[_0xff5e('0xf4')][_0x37611c['uniqueid']][_0xff5e('0xf5')]=_0x37611c[_0xff5e('0xf5')];}if(this[_0xff5e('0x27')][_0x37611c['uniqueid']]){this['uniqueId'][_0x37611c[_0xff5e('0xc3')]][_0xff5e('0xf5')]=_0x37611c[_0xff5e('0xf5')];}};Dialer[_0xff5e('0x1c')]['syncQueueMember']=function(_0x484461){if(!this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]]){return;}var _0x497075=this[_0xff5e('0x21')][this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]][_0xff5e('0xc6')]][_0xff5e('0xf7')]||_0xff5e('0xf8');if(_0x497075===_0xff5e('0xf9')){if(this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]]&&_[_0xff5e('0xfa')](this['actions'][_0x484461['actionid']]['locked'])&&_0x484461['status']==='1'&&_0x484461[_0xff5e('0xfb')]==='0'){if(this[_0xff5e('0x23')][_0x484461['stateinterface']]){if(!this['agents'][_0x484461[_0xff5e('0xfc')]][_0xff5e('0xfd')]){this[_0xff5e('0x23')][_0x484461[_0xff5e('0xfc')]]['locked']=!![];this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]][_0xff5e('0xfd')]=!![];this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]][_0xff5e('0xfc')]=_0x484461[_0xff5e('0xfc')];}}}}else if(_0x497075===_0xff5e('0xf8')){if(this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]]){if(this['agents'][_0x484461['stateinterface']]){this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]]['stateinterface']=_0x484461[_0xff5e('0xfc')];if(_[_0xff5e('0xfa')](this['queueBooked'][this[_0xff5e('0xf4')][_0x484461['actionid']][_0xff5e('0xc6')]])){this[_0xff5e('0x2c')][this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]][_0xff5e('0xc6')]]=[];}this['queueBooked'][this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]][_0xff5e('0xc6')]][_0xff5e('0x9d')](_[_0xff5e('0x62')](_[_0xff5e('0x79')](this[_0xff5e('0xf4')][_0x484461[_0xff5e('0xf6')]],['idHopper','stateinterface']),{'status':_0x484461['status'],'paused':_0x484461['paused']}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x1979cd){if(!this[_0xff5e('0xf4')][_0x1979cd['actionid']]){return;}var _0xfa5345=this;var _0x2176d3=this[_0xff5e('0x21')][this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]];var _0x1e792a=_0x2176d3[_0xff5e('0xf7')]||'rrmemory';if(_0x1e792a===_0xff5e('0xf9')){if(this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]]&&this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xfc')]){this[_0xff5e('0x20')][_0xff5e('0xfe')](this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xff')],this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xfc')])[_0xff5e('0xa5')](function(_0x5901ef){logger[_0xff5e('0x69')](_0xff5e('0x100'),util[_0xff5e('0x46')](_0x5901ef,{'showHidden':![],'depth':null}));})[_0xff5e('0x101')](function(){_0xfa5345[_0xff5e('0xc5')](_0xfa5345[_0xff5e('0x21')][_0xfa5345[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]]);_0xfa5345[_0xff5e('0x23')][_0xfa5345[_0xff5e('0xf4')][_0x1979cd['actionid']][_0xff5e('0xfc')]][_0xff5e('0xfd')]=![];delete _0xfa5345[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]];unlockQueueStatus(_0x2176d3);});}else{this[_0xff5e('0xc5')](this[_0xff5e('0x21')][this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]]);hopperUtils[_0xff5e('0xe2')]({'active':![],'ContactId':this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xe5')],'ListId':this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xe6')],'VoiceQueueId':this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xf2')]||undefined,'CampaignId':this['actions'][_0x1979cd['actionid']]['CampaignId']||undefined})[_0xff5e('0xa5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xff5e('0xf4')][_0x1979cd['actionid']];unlockQueueStatus(_0x2176d3);}}else if(_0x1e792a==='rrmemory'){var _0x3a859c;if(this[_0xff5e('0xf4')][_0x1979cd['actionid']]&&!_[_0xff5e('0x4b')](this[_0xff5e('0x2c')][this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]])){if(this[_0xff5e('0x2d')][_0xfa5345[_0xff5e('0xf4')][_0x1979cd['actionid']][_0xff5e('0xc6')]]){this[_0xff5e('0x2d')][_0xfa5345[_0xff5e('0xf4')][_0x1979cd['actionid']][_0xff5e('0xc6')]]=this['queueBookedRR'][this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]]?this['queueBookedRR'][this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]]:this[_0xff5e('0x2c')][this[_0xff5e('0xf4')][_0x1979cd[_0xff5e('0xf6')]][_0xff5e('0xc6')]]?this['queueBooked'][this[_0xff5e('0xf4')][_0x1979cd['actionid']][_0xff5e('0xc6')]][_0xff5e('0x102')]||0x0:0x0;}this['queueBooked'][this[_0xff5e('0xf4')][_0x1979cd['actionid']][_0xff5e('0xc6')]][_0xff5e('0x102')]=this[_0xff5e('0x2d')][this[_0xff5e('0xf4')][_0x1979cd['actionid']][_0xff5e('0xc6')]];for(var _0x3baa4e=0x0;_0x3baa4e=_0x1e4c9f[_0xff5e('0x127')]){_0xf1fdf7['stateGlobal'](_0x5a5225,_0x11e061,_0x4cc9db,_0xff5e('0x128'));}else{if(_0x5a5225['countmachineretry']>=_0x1e4c9f[_0xff5e('0x129')]){_0xf1fdf7['createStateFinal'](_0x5a5225,_0x11e061,_0x4cc9db,_0xff5e('0x12a'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5a5225[_0xff5e('0x121')],'scheduledat':moment()[_0xff5e('0xe3')](_0x1e4c9f[_0xff5e('0x12b')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x5a5225[_0xff5e('0xe5')],'ListId':_0x5a5225[_0xff5e('0xe6')],'VoiceQueueId':_0x5a5225[_0xff5e('0xf2')]||undefined,'CampaignId':_0x5a5225[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x12c')));_0x11e061({'reschedule':0x1});}}});}if(_0x350417[_0xff5e('0x44')]===_0xff5e('0xc4')&&this[_0xff5e('0x22')][_0x350417[_0xff5e('0xc6')]][_0xff5e('0x11d')]&&_0x4eedb4[_0xff5e('0x114')]===_0xff5e('0x115')){delete this[_0xff5e('0x27')][_0x4eedb4[_0xff5e('0xc3')]];this[_0xff5e('0xc5')](this[_0xff5e('0x22')][_0x350417[_0xff5e('0xc6')]]);_0x34a712=new Hangup(_0x350417,_0x4eedb4);_0x34a712[_0xff5e('0x73')]=0x12;_0x34a712[_0xff5e('0xee')]=_0xff5e('0x117');_0x34a712[_0xff5e('0x11f')]=_0xff5e('0x120');ami[_0xff5e('0x43')](_0xff5e('0x118'),ut[_0xff5e('0x119')](_0x34a712,'amd'));this['saveInDb'](_0x34a712,_0xff5e('0x12d'),_0xff5e('0x12e'));}if(_0x350417[_0xff5e('0x44')]==='ivr'&&this[_0xff5e('0x22')][_0x350417['queue']][_0xff5e('0x11d')]&&_0x4eedb4[_0xff5e('0x114')]===_0xff5e('0x11e')){return new Promise(function(_0x1012da,_0x237213){delete _0xf1fdf7['uniqueId'][_0x4eedb4[_0xff5e('0xc3')]];_0xf1fdf7[_0xff5e('0xc5')](_0xf1fdf7[_0xff5e('0x22')][_0x350417[_0xff5e('0xc6')]]);_0xf1fdf7[_0xff5e('0x22')][_0x350417['queue']][_0xff5e('0xc9')]+=0x1;_0xf1fdf7[_0xff5e('0x22')][_0x350417[_0xff5e('0xc6')]][_0xff5e('0x116')]+=0x1;var _0x1c8229=_0xf1fdf7['campaigns'][_0x350417[_0xff5e('0xc6')]];var _0x5d11b7=new Hangup(_0x350417,_0x4eedb4);_0x5d11b7[_0xff5e('0x73')]=0x13;_0x5d11b7[_0xff5e('0xee')]='Machine';_0x5d11b7[_0xff5e('0x11f')]=_0xff5e('0x120');_0x5d11b7[_0xff5e('0x121')]+=0x1;_0x5d11b7['countglobal']+=0x1;_0x5d11b7[_0xff5e('0x122')]=!![];ami[_0xff5e('0x43')](_0xff5e('0x118'),ut[_0xff5e('0x119')](_0x5d11b7,_0xff5e('0x122')));hopperUtils[_0xff5e('0xcf')](_0x5d11b7)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x123')));if(_0x5d11b7[_0xff5e('0x124')]+_0x5d11b7[_0xff5e('0x12f')]+_0x5d11b7[_0xff5e('0x125')]+_0x5d11b7['countnosuchnumberretry']+_0x5d11b7[_0xff5e('0xd9')]+_0x5d11b7[_0xff5e('0xf1')]+_0x5d11b7[_0xff5e('0x121')]+_0x5d11b7[_0xff5e('0x126')]>=_0x1c8229['dialGlobalMaxRetry']){_0xf1fdf7[_0xff5e('0x130')](_0x5d11b7,_0x1012da,_0x237213,_0xff5e('0x128'));}else{if(_0x5d11b7[_0xff5e('0x121')]>=_0x1c8229[_0xff5e('0x129')]){_0xf1fdf7[_0xff5e('0x131')](_0x5d11b7,_0x1012da,_0x237213,_0xff5e('0x12a'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5d11b7[_0xff5e('0x121')],'scheduledat':moment()[_0xff5e('0xe3')](_0x1c8229[_0xff5e('0x12b')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x5d11b7[_0xff5e('0xe5')],'ListId':_0x5d11b7['ListId'],'VoiceQueueId':_0x5d11b7[_0xff5e('0xf2')]||undefined,'CampaignId':_0x5d11b7[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x12c')));_0x1012da({'reschedule':0x1});}}});}}};Dialer[_0xff5e('0x1c')]['syncHangup']=function(_0x1e2653){var _0x2909d4=this[_0xff5e('0x27')][_0x1e2653[_0xff5e('0xc3')]];var _0x3347d3;if(_0x2909d4&&_0x2909d4[_0xff5e('0x44')]==='ivr'){delete this['uniqueId'][_0x1e2653[_0xff5e('0xc3')]];this[_0xff5e('0xc5')](this[_0xff5e('0x22')][_0x2909d4[_0xff5e('0xc6')]]);this[_0xff5e('0x22')][_0x2909d4[_0xff5e('0xc6')]][_0xff5e('0x132')]+=0x1;_0x3347d3=new Hangup(_0x2909d4,_0x1e2653);hopperUtils[_0xff5e('0xcf')](_0x3347d3)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x133')));hopperUtils['moveContactManagedDialer'](_0x3347d3)['catch'](loggerCatch(_0xff5e('0x134')));}if(_0x2909d4&&_0x2909d4[_0xff5e('0x44')]!==_0xff5e('0xc4')&&isNotNull(this[_0xff5e('0x21')][_0x2909d4[_0xff5e('0xc6')]]['dialQueueProject'])){delete this[_0xff5e('0x27')][_0x1e2653['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x2909d4[_0xff5e('0xc6')]]);this[_0xff5e('0x21')][_0x2909d4['queue']][_0xff5e('0xc9')]+=0x1;this[_0xff5e('0x21')][_0x2909d4['queue']][_0xff5e('0x116')]+=0x1;_0x3347d3=new Hangup(_0x2909d4,_0x1e2653);_0x3347d3[_0xff5e('0x73')]=0x10;_0x3347d3[_0xff5e('0xee')]=_0xff5e('0x135');_0x3347d3[_0xff5e('0x11f')]=_0xff5e('0x136');hopperUtils[_0xff5e('0xcf')](_0x3347d3)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x133')));hopperUtils['moveContactManagedDialer'](_0x3347d3)['catch'](loggerCatch(_0xff5e('0x134')));}if(_0x2909d4&&_0x2909d4[_0xff5e('0x44')]!==_0xff5e('0xc4')&&!isNotNull(this[_0xff5e('0x21')][_0x2909d4[_0xff5e('0xc6')]][_0xff5e('0x137')])){delete this[_0xff5e('0x27')][_0x1e2653[_0xff5e('0xc3')]];this[_0xff5e('0xc5')](this['voiceQueues'][_0x2909d4[_0xff5e('0xc6')]]);this[_0xff5e('0x21')][_0x2909d4[_0xff5e('0xc6')]][_0xff5e('0x138')]+=0x1;_0x3347d3=new Hangup(_0x2909d4,_0x1e2653);_0x3347d3[_0xff5e('0x73')]=0xc;_0x3347d3[_0xff5e('0xee')]=_0x1e2653[_0xff5e('0x139')];_0x3347d3[_0xff5e('0x11f')]=_0xff5e('0x13a');hopperUtils[_0xff5e('0xcf')](_0x3347d3)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x133')));hopperUtils['moveContactManagedDialer'](_0x3347d3)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x134')));}};Dialer[_0xff5e('0x1c')][_0xff5e('0x13b')]=function(_0x3605d8){var _0x3e0352=this;if(!_0x3e0352[_0xff5e('0x2e')][_0x3605d8[_0xff5e('0x49')]]){_0x3e0352['queuesSummary'][_0x3605d8[_0xff5e('0x49')]]={'running':![]};}else if(_0x3e0352[_0xff5e('0x2e')][_0x3605d8[_0xff5e('0x49')]][_0xff5e('0x13c')]===!![]){return;}else if(_0x3e0352[_0xff5e('0x2e')][_0x3605d8[_0xff5e('0x49')]][_0xff5e('0x13c')]===![]){_0x3e0352[_0xff5e('0x2e')][_0x3605d8[_0xff5e('0x49')]][_0xff5e('0x13c')]=!![];}var _0xab8bc2=_0x3e0352[_0xff5e('0x21')][_0x3605d8[_0xff5e('0x49')]];var _0x2bd8e9=_0xab8bc2[_0xff5e('0x6e')]!==utils['CAMPAIGN_STATUS'][_0xff5e('0x13d')];var _0x5f377a=utils[_0xff5e('0x13e')](_0xab8bc2);_0xab8bc2['statusMessage']=utils[_0xff5e('0x13f')](_0xab8bc2,_0x3e0352[_0xff5e('0x24')]);Promise[_0xff5e('0xaf')]()[_0xff5e('0x40')](function(){if(_0xab8bc2[_0xff5e('0x140')]===utils[_0xff5e('0x6f')][_0xff5e('0x13d')]){if(_0x2bd8e9){clearPredictiveAttributes(_0xab8bc2);_0x3605d8['startPredictive']=undefined;_0x3605d8[_0xff5e('0x2a')]=undefined;}if(_0xab8bc2[_0xff5e('0x140')]===utils[_0xff5e('0x6f')][_0xff5e('0x13d')]){_0x3605d8[_0xff5e('0x141')]=0x0;_0x3605d8[_0xff5e('0xfb')]=0x0;_0x3605d8[_0xff5e('0x142')]=0x0;_0x3605d8[_0xff5e('0x143')]=0x0;_0x3605d8[_0xff5e('0x144')]=0x0;}}else if(_0xab8bc2[_0xff5e('0x140')]===utils[_0xff5e('0x6f')]['ACTIVE']&&!_0x5f377a){return _0x3e0352[_0xff5e('0x95')](_0xab8bc2,!![])['then'](function(){return _0x3e0352[_0xff5e('0x95')](_0xab8bc2,![]);})[_0xff5e('0x40')](function(){return _0x3e0352[_0xff5e('0xb4')](_0xab8bc2);})['catch'](function(_0x18015c){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0xff5e('0x46')](_0x18015c,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xab8bc2);});}else{clearPredictiveAttributes(_0xab8bc2);}})[_0xff5e('0x40')](function(){var _0x299498=_0x3605d8['compareToOutboundQueue'](_0xab8bc2);if(_0x299498||_0xab8bc2[_0xff5e('0x145')]){_0xab8bc2[_0xff5e('0x145')]=![];_0x3605d8[_0xff5e('0x146')](_0xab8bc2);Object[_0xff5e('0x147')](_0xab8bc2,_0x3605d8);emitOutboundVoiceQueueSummary(_0x3605d8);}_0x3e0352[_0xff5e('0x2e')][_0xab8bc2[_0xff5e('0x49')]]['running']=![];})[_0xff5e('0xa5')](function(_0x226a4a){logger[_0xff5e('0x69')](_0xff5e('0x148'),util[_0xff5e('0x46')](_0x226a4a,{'showHidden':![],'depth':null}));_0x3e0352[_0xff5e('0x2e')][_0xab8bc2[_0xff5e('0x49')]][_0xff5e('0x13c')]=![];});};Dialer['prototype'][_0xff5e('0x37')]=_['throttle'](function(){var _0x850d8d=_[_0xff5e('0x149')](this[_0xff5e('0x21')],function(_0x17f109){return _0x17f109['dialPreviewRecallmeReminder'];});var _0x2ce4df=_['filter'](this[_0xff5e('0x23')],function(_0x1cd6a1){return _0x1cd6a1['online']&&_0x1cd6a1[_0xff5e('0x8b')]===_0xff5e('0x14a');});if(_0x850d8d[_0xff5e('0x9c')]>0x0&&_0x2ce4df[_0xff5e('0x9c')]>0x0){return Promise[_0xff5e('0xaf')]()[_0xff5e('0x40')](cmHopper[_0xff5e('0x14b')](_[_0xff5e('0x14c')](_0x850d8d,'id'),previewRecallmeReminderInterval,_[_0xff5e('0x14c')](_0x2ce4df,'id')))[_0xff5e('0x40')](function(_0x5c7a2a){for(var _0x931d25=0x0;_0x931d25<_0x5c7a2a[_0xff5e('0x9c')];_0x931d25++){var _0x425da8=_0x5c7a2a[_0x931d25][_0xff5e('0x14d')][_0xff5e('0x49')];if(_0x425da8)io['to'](util[_0xff5e('0x47')](_0xff5e('0x14e'),_0x425da8))[_0xff5e('0x43')](_0xff5e('0x14f'),{'hopper':_0x5c7a2a[_0x931d25]});}})[_0xff5e('0xa5')](function(_0x21e9fe){logger['error'](_0xff5e('0x150'),_0x21e9fe);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xff5e('0x1c')][_0xff5e('0x3e')]=function(){var _0x15729d=this;setInterval(function(){_0x15729d[_0xff5e('0x151')](_0x15729d[_0xff5e('0x27')],_0xff5e('0x152'));_0x15729d[_0xff5e('0x151')](_0x15729d[_0xff5e('0xf4')],_0xff5e('0x153'));},0x32c8);};Dialer[_0xff5e('0x1c')][_0xff5e('0x151')]=function(_0x190393,_0xfaba83){var _0x5f04a9=this;for(var _0x9d2a5a in _0x190393){if(typeof _0x190393[_0x9d2a5a]!==_0xff5e('0x154')){this[_0xff5e('0x1f')][_0xff5e('0x1d')](function(){if(!_[_0xff5e('0xfa')](_0x190393[_0x9d2a5a])){return ami[_0xff5e('0x9e')]({'action':_0xff5e('0x8b'),'channel':_0x190393[_0x9d2a5a][_0xff5e('0xf5')]})[_0xff5e('0xa5')](function(_0x8d7266){if(_0x8d7266[_0xff5e('0x6e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x190393[_0x9d2a5a]&&_0x190393[_0x9d2a5a][_0xff5e('0x44')]!==_0xff5e('0xc4')){_0x5f04a9['updateOriginated'](_0x5f04a9[_0xff5e('0x21')][_0x190393[_0x9d2a5a][_0xff5e('0xc6')]]);logger[_0xff5e('0x69')](_0xff5e('0x155'),_0xfaba83,_0x9d2a5a,_0x190393[_0x9d2a5a][_0xff5e('0xc6')]);delete _0x190393[_0x9d2a5a];}if(_0x190393[_0x9d2a5a]&&_0x190393[_0x9d2a5a]['type']==='ivr'){_0x5f04a9[_0xff5e('0xc5')](_0x5f04a9['campaigns'][_0x190393[_0x9d2a5a][_0xff5e('0xc6')]]);logger[_0xff5e('0x69')](_0xff5e('0x156'),_0xfaba83,_0x9d2a5a,_0x190393[_0x9d2a5a][_0xff5e('0xc6')]);delete _0x190393[_0x9d2a5a];}},0x2328);}});}});}}};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x3168cf){return Promise[_0xff5e('0xaf')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x3168cf))[_0xff5e('0xa5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xff5e('0x1c')][_0xff5e('0xc5')]=function(_0x1c5b24){if(!_['isUndefined'](_0x1c5b24)&&_0x1c5b24!==null){if(typeof _0x1c5b24[_0xff5e('0x83')]!==_0xff5e('0x154')){if(_0x1c5b24[_0xff5e('0x83')]>0x0){_0x1c5b24[_0xff5e('0x83')]-=0x1;}else{logger[_0xff5e('0x69')](_0xff5e('0x157'));}}}else{logger[_0xff5e('0x69')](_0xff5e('0x158'));}};Dialer[_0xff5e('0x1c')][_0xff5e('0x159')]=function(_0x27b017,_0x5091e7){var _0x22a85b=this;return function(_0x4f517e){_0x22a85b[_0xff5e('0xc5')](_0x5091e7);logger[_0xff5e('0x69')](_0x27b017,util[_0xff5e('0x46')](_0x4f517e,{'showHidden':![],'depth':null}));};};Dialer[_0xff5e('0x1c')][_0xff5e('0x15a')]=function(_0x1d92ef,_0x49decc,_0x47cf65){var _0xd49317={'state':0x19,'statedesc':_0xff5e('0x15b')};this[_0xff5e('0xc5')](_0x49decc);this[_0xff5e('0x11a')](_[_0xff5e('0x62')](_0xd49317,_[_0xff5e('0x79')](_0x47cf65,[_0xff5e('0xe5'),'ListId',_0xff5e('0x15c'),_0xff5e('0xf2'),_0xff5e('0x108')])),_0xff5e('0x15d'),_0xff5e('0x15e'));logger['error'](_0x1d92ef);};Dialer[_0xff5e('0x1c')][_0xff5e('0x11a')]=function(_0x3433f9,_0x420d74,_0x397588){hopperUtils[_0xff5e('0xcf')](_0x3433f9)['catch'](loggerCatch(_0x420d74));hopperUtils[_0xff5e('0x15f')](_0x3433f9)[_0xff5e('0xa5')](loggerCatch(_0x397588));};Dialer[_0xff5e('0x1c')][_0xff5e('0xe1')]=function(_0x598cd5,_0x16aedf){hopperUtils[_0xff5e('0xcf')](_0x598cd5)['catch'](loggerCatch(_0xff5e('0xd0')));if(_0x16aedf==0x0){hopperUtils[_0xff5e('0x15f')](_0x598cd5)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x160')));}};Dialer['prototype'][_0xff5e('0x150')]=function(_0x54f767){return Promise[_0xff5e('0xaf')]()[_0xff5e('0x40')](cmHopper[_0xff5e('0x14b')](_0x54f767['id'],previewRecallmeReminderInterval))[_0xff5e('0x40')](function(_0x1053bb){for(var _0x346c5f=0x0;_0x346c5f<_0x1053bb['length'];_0x346c5f++){var _0x28929b=_0x1053bb[_0x346c5f][_0xff5e('0x14d')][_0xff5e('0x49')];if(_0x28929b)io['to'](util['format']('user:%s',_0x28929b))[_0xff5e('0x43')](_0xff5e('0x14f'),{'hopper':_0x1053bb[_0x346c5f]});}})['catch'](function(){});};Dialer[_0xff5e('0x1c')]['launchHandleIvr']=function(_0xa96201){var _0x2baccf=this;return function(){_0x2baccf[_0xff5e('0x161')](_0xa96201);};};Dialer['prototype'][_0xff5e('0x162')]=function(_0x44671d,_0x4e26af){var _0x5d320f=this;var _0x6de55f=uuid['v4']();this[_0xff5e('0xf4')][_0x6de55f]=new Action(_0x44671d,_0x4e26af,_0x6de55f);return new Promise(function(_0x366707,_0x1cf63a){if(_[_0xff5e('0x42')](_0x44671d)&&typeof _0x44671d!==_0xff5e('0x163')){return _0x1cf63a(msgResponse('originate',_0xff5e('0x98'),_0xff5e('0x164')));}if(_[_0xff5e('0x42')](_0x4e26af[_0xff5e('0x165')])||_0x4e26af[_0xff5e('0x165')]===null){return _0x1cf63a(msgResponse(_0xff5e('0x166'),'Failure',_0xff5e('0x167')));}var _0x3d3849={'XMD-CALLERID':_0x5d320f[_0xff5e('0xf4')][_0x6de55f][_0xff5e('0x168')](),'XMD-AGI':_0x44671d[_0xff5e('0x137')]?util['format'](_0xff5e('0x169'),ipAgi,_0x44671d['dialQueueProject']):_0xff5e('0x16a'),'XMD-AGIAFTER':_0x44671d['dialQueueProject2']?util[_0xff5e('0x47')]('\x22agi://%s/square,%s\x22',ipAgi,_0x44671d['dialQueueProject2']):'NONE','XMD-QUEUE':utils[_0xff5e('0x16b')](_0x44671d)?util[_0xff5e('0x47')](_0xff5e('0x16c'),_0x44671d[_0xff5e('0x49')],_0x44671d['dialQueueOptions']||'',_0x44671d[_0xff5e('0x16d')]?'c':'',_0x44671d['dialQueueTimeout']||0x3):_0xff5e('0x16a'),'XMD-CONTACTID':_0x4e26af[_0xff5e('0xe5')],'XMD-CDRTYPE':_0xff5e('0x8'),'CALLERID(all)':_0x5d320f[_0xff5e('0xf4')][_0x6de55f]['getCaller'](),'XMD-AMD':_0x44671d[_0xff5e('0x11d')]?_0xff5e('0x16e'):_0xff5e('0x16a'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x44671d[_0xff5e('0x11d')]){_0x3d3849[_0xff5e('0x16f')]=_0x44671d[_0xff5e('0x170')]||0x9c4;_0x3d3849[_0xff5e('0x171')]=_0x44671d[_0xff5e('0x172')]||0x5dc;_0x3d3849[_0xff5e('0x173')]=_0x44671d[_0xff5e('0x174')]||0x320;_0x3d3849['XMD-AMDTOTALANALYSISTIME']=_0x44671d['dialAMDTotalAnalysisTime']||0x1388;_0x3d3849['XMD-AMDMINWORDLENGTH']=_0x44671d['dialAMDMinWordLength']||0x64;_0x3d3849[_0xff5e('0x175')]=_0x44671d[_0xff5e('0x176')]||0x32;_0x3d3849['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x44671d['dialAMDMaximumNumberOfWords']||0x3;_0x3d3849[_0xff5e('0x177')]=_0x44671d['dialAMDSilenceThreshold']||0x100;_0x3d3849['XMD-AMDMAXIMUMWORDLENGTH']=_0x44671d[_0xff5e('0x178')]||0x1388;}if(utils[_0xff5e('0x16b')](_0x44671d)){_0x3d3849[_0xff5e('0x179')]=_0x4e26af[_0xff5e('0xf2')];}else{_0x3d3849['XMD-CAMPAIGNID']=_0x4e26af[_0xff5e('0x108')];}var _0x82ddb7=utils[_0xff5e('0x17a')](_0x4e26af[_0xff5e('0x17b')]);Object[_0xff5e('0x147')](_0x3d3849,_0x82ddb7);var _0x330a71=_0x5d320f[_0xff5e('0x88')](_0x44671d[_0xff5e('0x8e')])?utils[_0xff5e('0x17c')](_0x44671d[_0xff5e('0x8e')][_0xff5e('0x17d')],_0x44671d['dialOriginateCallerIdName'],_0x44671d[_0xff5e('0x17e')]>0x0?utils[_0xff5e('0x17f')](_0x44671d['dialOriginateCallerIdNumber'],_0x44671d['dialRandomLastDigitCallerIdNumber']):_0x44671d[_0xff5e('0x180')]):utils[_0xff5e('0x17c')](_[_0xff5e('0xfa')](_0x44671d[_0xff5e('0x8f')])?_0x44671d[_0xff5e('0x8e')][_0xff5e('0x17d')]:_0x44671d[_0xff5e('0x8f')][_0xff5e('0x17d')],_0x44671d['dialOriginateCallerIdName'],_0x44671d[_0xff5e('0x17e')]>0x0?utils[_0xff5e('0x17f')](_0x44671d[_0xff5e('0x180')],_0x44671d[_0xff5e('0x17e')]):_0x44671d['dialOriginateCallerIdNumber']);if(_0x330a71){_0x3d3849[_0xff5e('0x181')]=_0x5d320f[_0xff5e('0xf4')][_0x6de55f][_0xff5e('0x182')]=utils[_0xff5e('0x183')](_0x330a71);_0x3d3849[_0xff5e('0x184')]=_0x4e26af[_0xff5e('0x165')];}_0x44671d[_0xff5e('0x185')]=_0x3d3849;return ami[_0xff5e('0x9e')]({'actionid':_0x6de55f,'action':'originate','channel':_0x5d320f['isTrunkReachable'](_0x44671d['Trunk'])?util[_0xff5e('0x47')](_0xff5e('0x186'),_0x44671d['Trunk'][_0xff5e('0x49')],isNotNull(_0x44671d['dialPrefix'])?_0x44671d[_0xff5e('0x187')][_0xff5e('0x188')]()||'':'',_0x44671d['dialCutDigit']>0x0?_0x4e26af[_0xff5e('0x165')]['substring'](_0x44671d[_0xff5e('0x189')]):_0x4e26af['phone']):util[_0xff5e('0x47')](_0xff5e('0x186'),_[_0xff5e('0xfa')](_0x44671d['TrunkBackup'])?_0x44671d[_0xff5e('0x8e')]['name']:_0x44671d[_0xff5e('0x8f')]['name'],isNotNull(_0x44671d[_0xff5e('0x187')])?_0x44671d['dialPrefix']['trim']()||'':'',_0x44671d[_0xff5e('0x189')]>0x0?_0x4e26af['phone'][_0xff5e('0x18a')](_0x44671d[_0xff5e('0x189')]):_0x4e26af[_0xff5e('0x165')]),'callerid':_0x330a71,'Exten':_0xff5e('0x113'),'Context':_0xff5e('0x18b'),'Priority':'1','variable':_0x3d3849,'timeout':(_0x44671d[_0xff5e('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x6de55f})[_0xff5e('0x40')](function(_0xb94e88){return _0x366707(_0xb94e88);})[_0xff5e('0xa5')](function(_0x4cc177){_0x44671d['outboundOriginateFailureCallsDay']+=0x1;var _0x4b7335=new History(_0x5d320f['actions'][_0x6de55f]);logger['error'](util['format'](_0xff5e('0x18d'),JSON['stringify'](_0x4cc177)));_0x4b7335['state']=0xe;_0x4b7335[_0xff5e('0xee')]=_0xff5e('0x18e');_0x4b7335['starttime']=moment()[_0xff5e('0x47')](_0xff5e('0xce'));_0x4b7335[_0xff5e('0x74')]=_0x4b7335[_0xff5e('0xe8')];hopperUtils['createHistory'](_0x4b7335)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x18f')));_0x5d320f[_0xff5e('0x15f')](_0x4b7335)['catch'](loggerCatch(_0xff5e('0x18f')))[_0xff5e('0x101')](function(){delete _0x5d320f[_0xff5e('0xf4')][_0x6de55f];return _0x1cf63a(msgResponse('originate',_0xff5e('0x87'),_0xff5e('0x190')));});});});};Dialer['prototype'][_0xff5e('0x191')]=function(_0x3f9500,_0x1a2fed,_0x150c53){var _0x123ec9=new History(_0x1a2fed);if(_0x123ec9['countbusyretry']+_0x123ec9['countcongestionretry']+_0x123ec9[_0xff5e('0x125')]+_0x123ec9[_0xff5e('0x192')]+_0x123ec9[_0xff5e('0xd9')]+_0x123ec9[_0xff5e('0xf1')]+_0x123ec9[_0xff5e('0x121')]+_0x123ec9[_0xff5e('0x126')]>=_0x150c53[_0xff5e('0x127')]-0x1){return!![];}switch(_0x3f9500){case 0x3:if(_0x123ec9['countnoanswerretry']>=_0x150c53[_0xff5e('0x193')]-0x1){return!![];}hopperUtils[_0xff5e('0xe2')]({'active':![],'countnoanswerretry':_0x123ec9['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xff5e('0xe3')](_0x150c53['dialNoAnswerRetryFrequency'],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x123ec9[_0xff5e('0xe5')],'ListId':_0x123ec9[_0xff5e('0xe6')],'VoiceQueueId':_0x123ec9[_0xff5e('0xf2')]||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x123ec9[_0xff5e('0x124')]>=_0x150c53['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0xff5e('0xe2')]({'active':![],'countbusyretry':_0x123ec9[_0xff5e('0x124')]+=0x1,'scheduledat':moment()[_0xff5e('0xe3')](_0x150c53[_0xff5e('0x194')],_0xff5e('0xe4'))[_0xff5e('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x123ec9[_0xff5e('0xe5')],'ListId':_0x123ec9['ListId'],'VoiceQueueId':_0x123ec9[_0xff5e('0xf2')]||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x195')));break;case 0x8:if(_0x123ec9[_0xff5e('0x12f')]>=_0x150c53[_0xff5e('0x196')]-0x1){return!![];}hopperUtils[_0xff5e('0xe2')]({'active':![],'countcongestionretry':_0x123ec9[_0xff5e('0x12f')]+=0x1,'scheduledat':moment()['add'](_0x150c53[_0xff5e('0x197')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x123ec9[_0xff5e('0xe5')],'ListId':_0x123ec9[_0xff5e('0xe6')],'VoiceQueueId':_0x123ec9[_0xff5e('0xf2')]||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})['catch'](loggerCatch(_0xff5e('0x198')));break;case 0x0:if(_0x123ec9[_0xff5e('0x192')]>=_0x150c53[_0xff5e('0x199')]-0x1){return!![];}else{hopperUtils[_0xff5e('0xe2')]({'active':![],'countnosuchnumberretry':_0x123ec9[_0xff5e('0x192')]+=0x1,'scheduledat':moment()[_0xff5e('0xe3')](_0x150c53[_0xff5e('0x19a')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x123ec9[_0xff5e('0xe5')],'ListId':_0x123ec9[_0xff5e('0xe6')],'VoiceQueueId':_0x123ec9['VoiceQueueId']||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x19b')));}break;case 0xa:if(_0x123ec9[_0xff5e('0xd9')]>=_0x150c53['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xff5e('0xe2')]({'active':![],'countdropretry':_0x123ec9[_0xff5e('0xd9')]+=0x1,'scheduledat':moment()[_0xff5e('0xe3')](_0x150c53[_0xff5e('0xdb')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x123ec9['ContactId'],'ListId':_0x123ec9[_0xff5e('0xe6')],'VoiceQueueId':_0x123ec9[_0xff5e('0xf2')]||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0xe7')));break;case 0xb:if(_0x123ec9[_0xff5e('0xf1')]>=_0x150c53['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xff5e('0xe2')]({'active':![],'countabandonedretry':_0x123ec9[_0xff5e('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x150c53[_0xff5e('0xf0')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x123ec9[_0xff5e('0xe5')],'ListId':_0x123ec9[_0xff5e('0xe6')],'VoiceQueueId':_0x123ec9[_0xff5e('0xf2')]||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})['catch'](loggerCatch(_0xff5e('0x19c')));break;case 0x13:if(_0x123ec9[_0xff5e('0x121')]>=_0x150c53[_0xff5e('0x129')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x123ec9['countmachineretry']+=0x1,'scheduledat':moment()[_0xff5e('0xe3')](_0x150c53['dialMachineRetryFrequency'],_0xff5e('0xe4'))[_0xff5e('0x47')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x123ec9['ContactId'],'ListId':_0x123ec9['ListId'],'VoiceQueueId':_0x123ec9['VoiceQueueId']||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x12c')));break;case 0x14:if(_0x123ec9[_0xff5e('0x126')]>=_0x150c53['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xff5e('0xe2')]({'active':![],'countagentrejectretry':_0x123ec9[_0xff5e('0x126')]+=0x1,'scheduledat':moment()[_0xff5e('0xe3')](_0x150c53[_0xff5e('0x19d')],_0xff5e('0xe4'))[_0xff5e('0x47')](_0xff5e('0xce')),'ContactId':_0x123ec9[_0xff5e('0xe5')],'ListId':_0x123ec9[_0xff5e('0xe6')],'VoiceQueueId':_0x123ec9['VoiceQueueId']||undefined,'CampaignId':_0x123ec9[_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x19e')));break;default:return!![];}};Dialer['prototype'][_0xff5e('0x10e')]=function(_0x377cad,_0x1f27c1,_0x1fa913){var _0xa5929=this;var _0x185496=new History(_0x377cad);var _0x47b010=![];var _0x4ddedc;var _0x455b4b;return new Promise(function(_0x450acc,_0x5af297){if(_[_0xff5e('0x42')](_0x1f27c1)&&typeof _0x1f27c1!=='object'){return _0x5af297(msgResponse(_0xff5e('0x19f'),'Failure',_0xff5e('0x1a0')));}if(_[_0xff5e('0x42')](_0x1fa913)&&typeof _0x1fa913!==_0xff5e('0x163')){return _0x5af297(msgResponse(_0xff5e('0x19f'),_0xff5e('0x98'),_0xff5e('0x1a1')));}hopperUtils['verifyAdditionalPhones'](_0x185496,_0x1fa913[_0xff5e('0xca')],_0x1f27c1)['then'](function(_0x47c232){if(_0x47c232['additional']==0x1)_0x47b010=!![];switch(_0x1fa913['reason']){case'0':_0x1f27c1[_0xff5e('0x1a2')]+=0x1;_0x185496[_0xff5e('0x73')]=0x0;_0x185496[_0xff5e('0xee')]=_0xff5e('0x1a3');_0x185496[_0xff5e('0x192')]+=0x1;_0x185496['countglobal']+=0x1;ami[_0xff5e('0x43')](_0xff5e('0x1a4'),ut[_0xff5e('0x119')](_0x377cad,'nosuchnumber'));_0x4ddedc=_0x1f27c1[_0xff5e('0x19a')];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];hopperUtils['createHistory'](_0x185496)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x123')));if(_0xa5929['checkRetriveMax'](0x0,_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496[_0xff5e('0x192')]>=_0x1f27c1[_0xff5e('0x199')]){_0xa5929[_0xff5e('0x131')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1a5'));}else{_0xa5929[_0xff5e('0x130')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1a5'));}}break;case'3':_0x1f27c1[_0xff5e('0x1a6')]+=0x1;_0x185496[_0xff5e('0x73')]=0x3;_0x185496[_0xff5e('0xee')]=_0xff5e('0x1a7');_0x185496[_0xff5e('0x125')]+=0x1;_0x185496[_0xff5e('0xda')]+=0x1;var _0xf731ae=ut['buildNoAnswerEventPayload'](_0x377cad,_0x1f27c1);ami[_0xff5e('0x43')]('custom:agentnoanswer',_0xf731ae);_0x4ddedc=_0x1f27c1[_0xff5e('0x1a8')];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];hopperUtils[_0xff5e('0xcf')](_0x185496)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x1a9')));if(_0xa5929[_0xff5e('0x191')](0x3,_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496['countnoanswerretry']>=_0x1f27c1[_0xff5e('0x193')]){_0xa5929['createStateFinal'](_0x185496,_0x450acc,_0x5af297,'reason\x203\x20ringing\x20no\x20answer');}else{_0xa5929[_0xff5e('0x130')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1aa'));}}break;case'5':_0x1f27c1[_0xff5e('0x1ab')]+=0x1;_0x185496[_0xff5e('0x73')]=0x5;_0x185496[_0xff5e('0xee')]=_0xff5e('0x1ac');_0x185496[_0xff5e('0x124')]+=0x1;_0x185496[_0xff5e('0xda')]+=0x1;ami[_0xff5e('0x43')]('custom:agentbusy',ut[_0xff5e('0x119')](_0x377cad,_0xff5e('0x1ad')));_0x4ddedc=_0x1f27c1[_0xff5e('0x194')];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];hopperUtils['createHistory'](_0x185496)[_0xff5e('0xa5')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xa5929['checkRetriveMax'](0x5,_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496[_0xff5e('0x124')]>=_0x1f27c1[_0xff5e('0x1ae')]){_0xa5929[_0xff5e('0x131')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1af'));}else{_0xa5929[_0xff5e('0x130')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1af'));}}break;case'8':_0x1f27c1[_0xff5e('0x1b0')]+=0x1;_0x185496[_0xff5e('0x73')]=0x8;_0x185496[_0xff5e('0xee')]=_0xff5e('0x1b1');_0x185496[_0xff5e('0x12f')]+=0x1;_0x185496[_0xff5e('0xda')]+=0x1;_0x4ddedc=_0x1f27c1[_0xff5e('0x197')];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];ami[_0xff5e('0x43')](_0xff5e('0x1b2'),ut[_0xff5e('0x119')](_0x377cad,_0xff5e('0x1b3')));hopperUtils[_0xff5e('0xcf')](_0x185496)[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x1b4')));if(_0xa5929[_0xff5e('0x191')](0x8,_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496['countcongestionretry']>=_0x1f27c1['dialCongestionMaxRetry']){_0xa5929[_0xff5e('0x131')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1b5'));}else{_0xa5929[_0xff5e('0x130')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1b5'));}}break;case'11':_0x1f27c1[_0xff5e('0x1b6')]+=0x1;_0x185496[_0xff5e('0x73')]=0xb;_0x185496[_0xff5e('0xee')]=_0xff5e('0xef');_0x185496[_0xff5e('0xf1')]+=0x1;_0x185496[_0xff5e('0xda')]+=0x1;_0x4ddedc=_0x1f27c1['dialAbandonedRetryFrequency'];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];hopperUtils[_0xff5e('0xcf')](_0x185496)['catch'](loggerCatch(_0xff5e('0x1b7')));if(_0xa5929[_0xff5e('0x191')](0xb,_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496[_0xff5e('0xf1')]>=_0x1f27c1['dialAbandonedMaxRetry']){_0xa5929[_0xff5e('0x131')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1b8'));}else{_0xa5929['stateGlobal'](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1b8'));}}break;case'20':_0x1f27c1[_0xff5e('0x1b9')]+=0x1;_0x185496[_0xff5e('0x73')]=0x14;_0x185496['statedesc']=_0xff5e('0x1ba');_0x185496[_0xff5e('0x126')]+=0x1;_0x185496['countglobal']+=0x1;_0x4ddedc=_0x1f27c1[_0xff5e('0x19d')];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];ami[_0xff5e('0x43')]('custom:agentreject',ut['buildObj'](_0x377cad,_0xff5e('0x1bb')));hopperUtils[_0xff5e('0xcf')](_0x185496)['catch'](loggerCatch(_0xff5e('0x1bc')));if(_0xa5929[_0xff5e('0x191')](0x14,_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496['countagentrejectretry']>=_0x1f27c1[_0xff5e('0x1bd')]){_0xa5929['createStateFinal'](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1be'));}else{_0xa5929[_0xff5e('0x130')](_0x185496,_0x450acc,_0x5af297,_0xff5e('0x1be'));}}break;default:_0x1f27c1['outboundUnknownCallsDay']+=0x1;_0x185496['state']=0xc;_0x185496[_0xff5e('0xee')]=_0x1fa913['reason'];_0x4ddedc=_0x1f27c1[_0xff5e('0x19d')];_0x455b4b=_0x1f27c1[_0xff5e('0xdc')];hopperUtils['createHistory'](_0x185496)[_0xff5e('0xa5')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xa5929[_0xff5e('0x191')](_0x1fa913['reason'],_0x377cad,_0x1f27c1)&&!_0x47b010){if(_0x185496[_0xff5e('0x124')]+_0x185496[_0xff5e('0x12f')]+_0x185496[_0xff5e('0x125')]+_0x185496['countnosuchnumberretry']+_0x185496[_0xff5e('0xd9')]+_0x185496[_0xff5e('0xf1')]+_0x185496[_0xff5e('0x121')]+_0x185496['countagentrejectretry']>=_0x1f27c1[_0xff5e('0x127')]){_0xa5929[_0xff5e('0x130')](_0x185496,_0x450acc,_0x5af297,_0x1fa913['reason']);}else{_0xa5929[_0xff5e('0x131')](_0x185496,_0x450acc,_0x5af297,_0x1fa913[_0xff5e('0xca')]);}}}})[_0xff5e('0x40')](function(){if(_0x47b010){hopperUtils[_0xff5e('0xec')](_0x185496,_0x4ddedc,_0x455b4b)[_0xff5e('0x40')](function(){return _0x450acc(0x1);});}});});};Dialer[_0xff5e('0x1c')]['stateGlobal']=function(_0x172572,_0x438a01,_0x3f063f,_0x260539){var _0x4e2ff5=new Final(_0x172572);_0x4e2ff5['state']=0xf;_0x4e2ff5[_0xff5e('0xee')]=_0xff5e('0x1bf');this['createStateFinal'](_0x4e2ff5,_0x438a01,_0x3f063f,_0x260539);};Dialer['prototype'][_0xff5e('0x131')]=function(_0x93d2a3,_0x291eaa,_0xa5cd95,_0xe078dd){hopperUtils[_0xff5e('0x15f')](_0x93d2a3)[_0xff5e('0x40')](function(){return _0x291eaa(msgResponse(_0xff5e('0x19f'),_0xff5e('0x10d'),_0xe078dd));})[_0xff5e('0xa5')](function(){return _0xa5cd95(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer['prototype'][_0xff5e('0xb')]=function(_0x40fda2){var _0x48fdb2=_0x40fda2[_0xff5e('0x1c0')]/0x64;var _0x465050=_0x40fda2['outboundDropCallsDayTimeout']/(_0x40fda2[_0xff5e('0xd5')]+_0x40fda2['outboundAnswerCallsDay']);var _0x25f858=Math[_0xff5e('0x1c1')](_0x40fda2['predictiveIntervalAvailable']*(_0x40fda2[_0xff5e('0x1c2')]/0x64));var _0x1b66b1=Math['round'](_0x40fda2[_0xff5e('0x1c3')]*(_0x40fda2[_0xff5e('0x1c4')]/0x64));var _0x27c2b8=_0x40fda2['available']+_0x40fda2['talking'];var _0x1f995e=Math['floor'](_0x40fda2[_0xff5e('0x5b')]*_0x40fda2['erlangAbandonmentRate']*_0x40fda2[_0xff5e('0x1c5')]*_0x40fda2[_0xff5e('0x1c6')]);if(_[_0xff5e('0x42')](_0x40fda2[_0xff5e('0x2a')])){if(!_['isUndefined'](_0x40fda2['startPredictive'])){_0x40fda2[_0xff5e('0x29')]=undefined;loggerPredictive[_0xff5e('0x69')](_0xff5e('0x1c7'),_0xff5e('0x1c8'));}if(!_[_0xff5e('0x42')](_0x40fda2[_0xff5e('0x67')])){loggerPredictive[_0xff5e('0x69')](_0xff5e('0x1c7'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x40fda2[_0xff5e('0x67')]);_0x40fda2['handlePredictive']=undefined;}_0x40fda2['startProgressive']=moment()[_0xff5e('0x47')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xff5e('0x4d')](_0x40fda2['name'],'collection\x20data\x20in\x20progressive\x20at',_0x40fda2[_0xff5e('0x2a')]);this[_0xff5e('0xb6')](_0x40fda2,0x1);}else if(ifInterval(_0x40fda2[_0xff5e('0x1c9')],_0x40fda2[_0xff5e('0x2a')])){this[_0xff5e('0xb6')](_0x40fda2,0x1);loggerPredictiveCalls[_0xff5e('0x4d')](_0xff5e('0x1ca'),_0x40fda2[_0xff5e('0x2a')],_0x40fda2['name']);_0x40fda2[_0xff5e('0x5b')]=0x0;_0x40fda2[_0xff5e('0xd6')]=0x0;}else if(_0x48fdb2<_0x465050&&_0x40fda2[_0xff5e('0x1cb')]==='dropRate'){clearPredictiveAttributes(_0x40fda2);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x1cc'),_0xff5e('0x1cd'),_0x465050,_0xff5e('0x2a'),_0x40fda2[_0xff5e('0x49')]);}else if(_0x1f995e<_0x40fda2[_0xff5e('0xd6')]&&_0x40fda2[_0xff5e('0x1cb')]===_0xff5e('0x1ce')){clearPredictiveAttributes(_0x40fda2);loggerPredictive['info'](_0xff5e('0x1cf'),_0xff5e('0x1d0'),_0x1f995e,_0xff5e('0x1d1'),_0x40fda2['predictiveIntervalErlangCallsDroppedCalls'],_0xff5e('0x2a'),_0x40fda2[_0xff5e('0x49')]);}else if(!ifInterval(_0x40fda2['dialPredictiveInterval'],_0x40fda2[_0xff5e('0x2a')])&&_[_0xff5e('0x42')](_0x40fda2[_0xff5e('0x29')])&&!_['isUndefined'](_0x40fda2['startProgressive'])){_0x40fda2[_0xff5e('0x29')]=moment()[_0xff5e('0x47')](_0xff5e('0xce'));loggerPredictive[_0xff5e('0x4d')](_0x40fda2[_0xff5e('0x49')],_0xff5e('0x1d2'),_0x40fda2[_0xff5e('0x29')]);hopperUtils[_0xff5e('0x1d3')](_0x40fda2['dialPredictiveInterval'])[_0xff5e('0x40')](this[_0xff5e('0x1d4')](_0x40fda2))['then'](mergeDataErlangB(_0x40fda2))['then'](this['startMethodPredictive'](_0x40fda2))[_0xff5e('0xa5')](loggerCatchPredictive(_0xff5e('0x1d5'),_0x40fda2));}else if(!ifInterval(_0x40fda2[_0xff5e('0x1c9')],_0x40fda2[_0xff5e('0x29')])){_0x40fda2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x40fda2[_0xff5e('0x29')]=moment()['format'](_0xff5e('0xce'));loggerPredictive[_0xff5e('0x4d')](_0x40fda2[_0xff5e('0x49')],'recalculate\x20predictive\x20at',_0x40fda2['startPredictive']);clearInterval(_0x40fda2[_0xff5e('0x67')]);_0x40fda2[_0xff5e('0x67')]=undefined;hopperUtils['avgHandleTime'](_0x40fda2['dialPredictiveInterval'])[_0xff5e('0x40')](this[_0xff5e('0x1d4')](_0x40fda2))[_0xff5e('0x40')](mergeDataErlangB(_0x40fda2))['then'](this[_0xff5e('0x1d6')](_0x40fda2))[_0xff5e('0xa5')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x40fda2));}else if(_0x40fda2[_0xff5e('0x1c3')]&&_0x27c2b8<_0x40fda2['predictiveIntervalAvailable']-_0x1b66b1){clearPredictiveAttributes(_0x40fda2);loggerPredictive[_0xff5e('0x4d')](_0x40fda2[_0xff5e('0x49')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x27c2b8,')\x20are\x20less\x20than\x20threshold\x20(',_0x40fda2[_0xff5e('0x1c3')],'-',_0x1b66b1,'=',_0x40fda2[_0xff5e('0x1c3')]-_0x1b66b1,')');}else if(_0x40fda2[_0xff5e('0x1c3')]&&_0x27c2b8>_0x40fda2[_0xff5e('0x1c3')]+_0x25f858){clearPredictiveAttributes(_0x40fda2);loggerPredictive[_0xff5e('0x4d')](_0x40fda2[_0xff5e('0x49')],_0xff5e('0x1d7'),_0x27c2b8,')\x20are\x20more\x20than\x20threshold\x20(',_0x40fda2[_0xff5e('0x1c3')],'+',_0x25f858,'=',_0x40fda2[_0xff5e('0x1c3')]+_0x25f858,')');}};Dialer[_0xff5e('0x1c')][_0xff5e('0x1d4')]=function(_0x376285){var _0x47e2e6=this;return function(_0x36ce60){return new Promise(function(_0x5c6f6e,_0x44a393){_['merge'](_0x376285,_0x36ce60[0x0]);if(checkGetDataPredictive(_0x36ce60[0x0])){var _0x2e67f2=_0x376285['predictiveIntervalAvailable']=_0x376285['talking']+_0x376285[_0xff5e('0x141')];var _0x25efba=_0x376285[_0xff5e('0x1c9')]*0x3c;var _0x14efa9=_0x36ce60[0x0][_0xff5e('0x55')]+_0x36ce60[0x0]['predictiveIntervalAvgHoldtime'];var _0x1953a5=(_0x36ce60[0x0]['predictiveIntervalAnsweredCalls']+_0x36ce60[0x0][_0xff5e('0x1d8')]+_0x36ce60[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x36ce60[0x0][_0xff5e('0x1d9')];_0x376285[_0xff5e('0x1c5')]=_0x1953a5>0x0?_0x1953a5:0x1;switch(_0x376285['dialPredictiveOptimization']){case _0xff5e('0x1ce'):var _0x12658f=_0x376285[_0xff5e('0x1c0')]/0x64;return _0x47e2e6['abandonmentRate'](_0x2e67f2,_0x25efba,_0x14efa9,_0x1953a5,_0x12658f)[_0xff5e('0x40')](function(_0x117136){return _0x5c6f6e(_0x117136);});case'agentBusyFactor':var _0xef7ab3=_0x376285[_0xff5e('0x1c0')]/0x64;return _0x47e2e6['busyFactor'](_0x2e67f2,_0x25efba,_0x14efa9,_0x1953a5,_0xef7ab3)[_0xff5e('0x40')](function(_0x4fd991){return _0x5c6f6e(_0x4fd991);});default:return _0x44a393(msgResponse('[getDataPredictive]',_0xff5e('0x98'),'Unknown\x20Predictive'));}}else{return _0x44a393(msgResponse(_0xff5e('0x1da'),_0xff5e('0x98'),'check\x20failure'));}});};};Dialer[_0xff5e('0x1c')][_0xff5e('0x1db')]=function(_0x38ef54){var _0x45493b=this;return function(_0x580311){return new Promise(function(_0x1ca11a,_0x243ffa){_[_0xff5e('0x62')](_0x38ef54,_0x580311[0x0]);if(checkGetDataPredictive(_0x580311[0x0])){loggerPredictive[_0xff5e('0x4d')](JSON['stringify'](_0x580311[0x0]));if(_0x38ef54[_0xff5e('0x1cb')]===_0xff5e('0x1ce')){return _0x45493b['getVoiceQueueRtPauses'](_0x38ef54['id'])['then'](function(_0x2de317){var _0x4984c8=_0x38ef54['loggedIn']-_0x2de317[0x0][_0xff5e('0x1dc')];var _0x2896c1=_0x38ef54[_0xff5e('0x1c9')]*0x3c;var _0x4223ea=_0x580311[0x0][_0xff5e('0x55')]+_0x580311[0x0][_0xff5e('0x53')];var _0x24eec2=(_0x580311[0x0][_0xff5e('0x4f')]+_0x580311[0x0][_0xff5e('0x1d8')]+_0x580311[0x0][_0xff5e('0x51')])/_0x580311[0x0][_0xff5e('0x1d9')];var _0x264392=_0x38ef54[_0xff5e('0x1c0')]/0x64;_0x38ef54[_0xff5e('0x1dd')]=_0x2de317[0x0][_0xff5e('0x1dc')]||0x0;_0x38ef54[_0xff5e('0x1c5')]=_0x24eec2>0x0?_0x24eec2:0x1;return _0x45493b[_0xff5e('0x1de')](_0x4984c8,_0x2896c1,_0x4223ea,_0x24eec2,_0x264392);})['then'](function(_0x578446){return _0x1ca11a(_0x578446);})['catch'](function(_0x1b494f){return _0x243ffa(msgResponse(_0xff5e('0x1df'),_0xff5e('0x98'),JSON[_0xff5e('0x78')](_0x1b494f)));});}if(_0x38ef54[_0xff5e('0x1cb')]===_0xff5e('0x1e0')){return _0x45493b[_0xff5e('0x1e1')](_0x38ef54['id'])[_0xff5e('0x40')](function(_0x27ac50){var _0x54e2c8=_0x38ef54['loggedIn']-_0x27ac50[0x0][_0xff5e('0x1dc')];var _0x5ad50b=_0x38ef54[_0xff5e('0x1c9')]*0x3c;var _0x1715e6=_0x580311[0x0][_0xff5e('0x55')]+_0x580311[0x0]['predictiveIntervalAvgHoldtime'];var _0x557f3e=(_0x580311[0x0]['predictiveIntervalAnsweredCalls']+_0x580311[0x0][_0xff5e('0x1d8')]+_0x580311[0x0][_0xff5e('0x51')])/_0x580311[0x0][_0xff5e('0x1d9')];var _0x493c1f=_0x38ef54[_0xff5e('0x1c0')]/0x64;_0x38ef54[_0xff5e('0x1dd')]=_0x27ac50[0x0]['outboundQueuePauses']||0x0;_0x38ef54[_0xff5e('0x1c5')]=_0x557f3e>0x0?_0x557f3e:0x1;return _0x45493b[_0xff5e('0x1e2')](_0x54e2c8,_0x5ad50b,_0x1715e6,_0x557f3e,_0x493c1f);})['then'](function(_0x545ab3){return _0x1ca11a(_0x545ab3);})[_0xff5e('0xa5')](function(_0x4f2c60){return _0x243ffa(msgResponse(_0xff5e('0x1df'),'Failure',JSON['stringify'](_0x4f2c60)));});}}else{return _0x243ffa(msgResponse(_0xff5e('0x1da'),_0xff5e('0x98'),_0xff5e('0x1e3')));}});};};Dialer[_0xff5e('0x1c')][_0xff5e('0x1d6')]=function(_0x3e52ca){var _0x30e0c8=this;return function(){var _0x5d218b=0x0;var _0x569c53=Math[_0xff5e('0x1e4')](_0x3e52ca[_0xff5e('0x5d')]*0x3e8);if(_0x569c53>0x0){_0x569c53=_0x569c53<0x64?0x64:_0x569c53;loggerPredictive[_0xff5e('0x4d')](_0x3e52ca[_0xff5e('0x49')],_0xff5e('0x1e5'),_0x569c53,_0xff5e('0x1e6'));_0x3e52ca['handlePredictive']=setInterval(function(){_0x30e0c8[_0xff5e('0x67')](_0x3e52ca);loggerPredictiveCalls['info']('[handlePredictive]',_0x5d218b+=0x1);},_0x569c53);}else{loggerPredictive[_0xff5e('0x4d')](_0x3e52ca[_0xff5e('0x49')],_0xff5e('0x1e7'));}};};Dialer[_0xff5e('0x1c')]['checkContactBlack']=function(_0x304856,_0x4c5084){var _0x464121=this;return function(_0x4f6a79){if(_[_0xff5e('0x4b')](_0x4f6a79)){if(_[_0xff5e('0xfa')](_0x4c5084['UserId'])||!_0x4c5084[_0xff5e('0x1e8')]){if(_0x304856[_0xff5e('0xb5')]==='booked'){_0x304856[_0xff5e('0x76')]=_[_0xff5e('0x42')](_0x304856[_0xff5e('0x76')])?!![]:_0x304856[_0xff5e('0x76')];var _0x352d9b=uuid['v4']();_0x464121[_0xff5e('0xf4')][_0x352d9b]=new Action(_0x304856,_0x4c5084,_0x352d9b);loggerBooked[_0xff5e('0x4d')](_0xff5e('0x1e9'),_0x352d9b,_0xff5e('0x1ea'),JSON[_0xff5e('0x78')](_0x304856[_0xff5e('0x76')]),_0xff5e('0x1eb'),_0x304856[_0xff5e('0x49')]);if(_0x304856['queueStatusComplete']){_0x304856[_0xff5e('0x76')]=![];_0x464121['queueBooked'][_0x464121['actions'][_0x352d9b][_0xff5e('0xc6')]]=[];ami[_0xff5e('0x9e')]({'actionid':_0x352d9b,'action':_0xff5e('0x1ec'),'queue':_0x304856[_0xff5e('0x49')]})[_0xff5e('0xa5')](function(){_0x464121[_0xff5e('0xc5')](_0x304856);hopperUtils[_0xff5e('0xe2')]({'active':![],'ContactId':_0x464121[_0xff5e('0xf4')][_0x352d9b][_0xff5e('0xe5')],'ListId':_0x464121[_0xff5e('0xf4')][_0x352d9b][_0xff5e('0xe6')],'VoiceQueueId':_0x464121[_0xff5e('0xf4')][_0x352d9b][_0xff5e('0xf2')]||undefined,'CampaignId':_0x464121[_0xff5e('0xf4')][_0x352d9b][_0xff5e('0x108')]||undefined})[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x1ed')));delete _0x464121[_0xff5e('0xf4')][_0x352d9b];});}else{loggerBooked['info'](_0xff5e('0x1ee'),JSON['stringify'](_0x304856[_0xff5e('0x76')]),_0xff5e('0x1eb'),_0x304856[_0xff5e('0x49')]);_0x464121[_0xff5e('0xc5')](_0x304856);hopperUtils[_0xff5e('0xe2')]({'active':![],'ContactId':_0x464121['actions'][_0x352d9b]['ContactId'],'ListId':_0x464121[_0xff5e('0xf4')][_0x352d9b]['ListId'],'VoiceQueueId':_0x464121['actions'][_0x352d9b][_0xff5e('0xf2')]||undefined,'CampaignId':_0x464121[_0xff5e('0xf4')][_0x352d9b]['CampaignId']||undefined})[_0xff5e('0xa5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x464121[_0xff5e('0xf4')][_0x352d9b];}}else{return _0x464121['actionOriginate'](_0x304856,_0x4c5084);}}else{if(utils[_0xff5e('0x63')](undefined,_0x4c5084['scheduledat'])<_0x304856[_0xff5e('0x1ef')]*0x3c){if(_0x4c5084[_0xff5e('0x14d')]&&!_0x4c5084['Agent'][_0xff5e('0x1f0')]){_0x464121[_0xff5e('0x20')][_0xff5e('0xfe')](_0x4c5084['id'])[_0xff5e('0x101')](function(){_0x464121[_0xff5e('0xc5')](_0x304856);});}else{hopperUtils['unlockContact']({'active':![]},_0x4c5084['id'],0x1)[_0xff5e('0x101')](function(){_0x464121[_0xff5e('0xc5')](_0x304856);});}}else{_0x304856[_0xff5e('0x1f1')]+=0x1;_0x464121['updateOriginated'](_0x304856);if(_0x304856[_0xff5e('0x1f2')]){hopperUtils[_0xff5e('0xe2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c5084[_0xff5e('0xe5')],'ListId':_0x4c5084[_0xff5e('0xe6')],'VoiceQueueId':_0x4c5084[_0xff5e('0xf2')]||undefined,'CampaignId':_0x4c5084['CampaignId']||undefined})[_0xff5e('0xa5')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xff5e('0xcf')](createObjHistory(_0x304856,_0x4c5084,utils[_0xff5e('0x6f')][_0xff5e('0x1f3')],0x17,'RecallInQueue'))[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x1f4')));}else{_0x464121[_0xff5e('0x11a')](createObjHistory(_0x304856,_0x4c5084,utils['CAMPAIGN_STATUS'][_0xff5e('0x1f5')],0x16,_0xff5e('0x1f6')),_0xff5e('0x1f7'),_0xff5e('0x1f8'));}}}}else{_0x304856['outboundBlacklistCallsDay']+=0x1;_0x464121[_0xff5e('0x11a')](createObjHistory(_0x304856,_0x4c5084,utils[_0xff5e('0x6f')][_0xff5e('0x1f9')],0xd,_0xff5e('0x1fa')),'[Originate][historyBlacklist]',_0xff5e('0x1fb'));throw'inBlackList';}};};Dialer[_0xff5e('0x1c')][_0xff5e('0x161')]=function(_0x2f143d){var _0x16d49f=this;var _0x4f7314=_0x2f143d[_0xff5e('0x1fc')]-_0x2f143d[_0xff5e('0x83')];emitCampaignSummary(_0x2f143d);if(_0x4f7314>0x0&&_0x2f143d[_0xff5e('0x6c')]==0x0){if(_0x4f7314>this[_0xff5e('0x1fd')]){_0x4f7314=this[_0xff5e('0x1fd')];}_0x2f143d[_0xff5e('0x6c')]=0x1;hopperUtils['getContactDialerIvr'](_0x2f143d,_0x4f7314)[_0xff5e('0x40')](function(_0x51fd91){_0x2f143d[_0xff5e('0x6c')]=0x0;if(_0x51fd91){if(!utils[_0xff5e('0x1fe')](_0x51fd91)){_0x2f143d[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')]['NO_AVAILABLE_CONTACTS'];logger[_0xff5e('0x4d')](_0xff5e('0x1ff')+_0x2f143d[_0xff5e('0x49')]);}else{_0x2f143d[_0xff5e('0x83')]+=_0x51fd91[_0xff5e('0x9c')];_0x2f143d[_0xff5e('0x6e')]=utils[_0xff5e('0x6f')][_0xff5e('0x200')];for(var _0x360922=0x0;_0x360922<_0x51fd91[_0xff5e('0x9c')];_0x360922+=0x1){_0x2f143d[_0xff5e('0x201')]+=0x1;if(_[_0xff5e('0xfa')](_0x51fd91[_0x360922])||_['isNil'](_0x51fd91[_0x360922][_0xff5e('0x17b')])||_[_0xff5e('0xfa')](_0x51fd91[_0x360922][_0xff5e('0x165')])){_0x16d49f[_0xff5e('0x15a')](_0xff5e('0x202'),_0x2f143d,_0x51fd91[_0x360922]);}else{hopperUtils[_0xff5e('0x203')](_[_0xff5e('0x79')](_0x51fd91[_0x360922],[_0xff5e('0x108'),_0xff5e('0x165')]))[_0xff5e('0x40')](_0x16d49f['checkContactBlack'](_0x2f143d,_0x51fd91[_0x360922]))[_0xff5e('0xa5')](_0x16d49f['loggerHandler']('[actionOriginateIvr]\x20',_0x2f143d));}}}}})[_0xff5e('0xa5')](loggerGetContactDialer(_0xff5e('0x204'),_0x2f143d,_0x4f7314));}};Dialer[_0xff5e('0x1c')][_0xff5e('0xb6')]=function(_0x3b8bf9,_0x1597c5){var _0x2c860c=this;var _0x390f99=[];if(_0x1597c5<0x1||_0x3b8bf9['dialMethod']==='booked'){_0x1597c5=0x1;}var _0x372a64=Math['floor'](_0x3b8bf9[_0xff5e('0x141')]*_0x1597c5)-_0x3b8bf9[_0xff5e('0x83')];if(_0x3b8bf9['dialLimitQueue']>0x0){var _0x1ce893=_0x3b8bf9[_0xff5e('0x205')]-_0x3b8bf9[_0xff5e('0x83')]-_0x3b8bf9[_0xff5e('0x143')]-_0x3b8bf9[_0xff5e('0x144')];if(_0x372a64>_0x1ce893){_0x372a64=_0x1ce893;}}if(_0x372a64>0x0&&_0x3b8bf9[_0xff5e('0x6c')]==0x0){if(_0x3b8bf9['dialMethod']===_0xff5e('0x9')){_0x372a64=0x1;}if(_0x372a64>this[_0xff5e('0x1fd')]){_0x372a64=this['maxNumberOriginate'];}for(var _0x59db42 in this[_0xff5e('0x23')]){if(typeof this['agents'][_0x59db42]!==_0xff5e('0x154')){if(this[_0xff5e('0x23')][_0x59db42][_0xff5e('0x73')]==='not_inuse'&&this['agents'][_0x59db42][_0xff5e('0x8b')]==='reachable'){_0x390f99[_0xff5e('0x9d')](this[_0xff5e('0x23')][_0x59db42]['id']);}}}_0x3b8bf9['temp']=0x1;hopperUtils[_0xff5e('0x206')](_0x3b8bf9,_0x390f99,_0x372a64)[_0xff5e('0x40')](function(_0x2b1a53){_0x3b8bf9['temp']=0x0;if(_0x2b1a53){if(!utils['checkContactEmpty'](_0x2b1a53)){hopperUtils['countReScheduled'](_0x3b8bf9)[_0xff5e('0x40')](sendMessageReschedule(_0x3b8bf9))[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x207')));}else{_0x3b8bf9[_0xff5e('0x83')]+=_0x2b1a53[_0xff5e('0x9c')];_0x3b8bf9[_0xff5e('0x6e')]=_0x3b8bf9[_0xff5e('0xb5')]===_0xff5e('0x9')?utils[_0xff5e('0x6f')][_0xff5e('0x16e')]:utils['CAMPAIGN_STATUS'][_0xff5e('0x200')];for(var _0x5071d4=0x0;_0x5071d4<_0x2b1a53[_0xff5e('0x9c')];_0x5071d4+=0x1){if(_['isNil'](_0x2b1a53[_0x5071d4])||_[_0xff5e('0xfa')](_0x2b1a53[_0x5071d4][_0xff5e('0x17b')])||_['isNil'](_0x2b1a53[_0x5071d4][_0xff5e('0x165')])){_0x2c860c['emptyContact']('[actionOriginate]\x20',_0x3b8bf9,_0x2b1a53[_0x5071d4]);}else{hopperUtils[_0xff5e('0x208')](_[_0xff5e('0x79')](_0x2b1a53[_0x5071d4],[_0xff5e('0xf2'),'phone']))[_0xff5e('0x40')](_0x2c860c['checkContactBlack'](_0x3b8bf9,_0x2b1a53[_0x5071d4]))['catch'](_0x2c860c[_0xff5e('0x159')](_0xff5e('0x202'),_0x3b8bf9));}}}}})[_0xff5e('0xa5')](loggerGetContactDialer('[getContactDialer2]',_0x3b8bf9,_0x372a64));}};Dialer[_0xff5e('0x1c')][_0xff5e('0x67')]=function(_0x542fe5){if(_0x542fe5[_0xff5e('0x205')]>0x0){var _0x1d4f29=_0x542fe5[_0xff5e('0x205')]-_0x542fe5[_0xff5e('0x83')]-_0x542fe5[_0xff5e('0x143')];if(_0x1d4f29>0x0&&_0x542fe5[_0xff5e('0x6c')]==0x0){this[_0xff5e('0x209')](_0x542fe5);}else{loggerPredictiveCalls['info'](_0xff5e('0x20a'));}}else{this[_0xff5e('0x209')](_0x542fe5);}};Dialer[_0xff5e('0x1c')]['tryOriginatePredictive']=function(_0x1fb373){var _0x7bb70d=this;var _0x6661a1=[];_0x1fb373[_0xff5e('0x83')]+=0x1;for(var _0x298a12 in this[_0xff5e('0x23')]){if(typeof this[_0xff5e('0x23')][_0x298a12]!==_0xff5e('0x154')){if(this[_0xff5e('0x23')][_0x298a12][_0xff5e('0x73')]===_0xff5e('0x20b')&&this[_0xff5e('0x23')][_0x298a12]['status']===_0xff5e('0x14a')){_0x6661a1[_0xff5e('0x9d')](this[_0xff5e('0x23')][_0x298a12]['id']);}}}_0x1fb373[_0xff5e('0x6c')]=0x1;return this[_0xff5e('0x206')](_0x1fb373['id'],_0x6661a1,0x1,_0x1fb373['dialOrderByScheduledAt'],_0x1fb373)['then'](function(_0x3d1124){_0x1fb373[_0xff5e('0x6c')]=0x1;if(_0x3d1124){if(!utils[_0xff5e('0x1fe')](_0x3d1124)){utils[_0xff5e('0x6b')](_0x1fb373,0x1,0x0);return hopperUtils[_0xff5e('0x20c')](_0x1fb373)[_0xff5e('0x40')](sendMessageReschedule(_0x1fb373))[_0xff5e('0xa5')](loggerCatch(_0xff5e('0x207')));}else{_0x1fb373['message']=utils[_0xff5e('0x6f')]['RUNNING'];if(_[_0xff5e('0xfa')](_0x3d1124[0x0])||_[_0xff5e('0xfa')](_0x3d1124[0x0][_0xff5e('0x17b')])||_[_0xff5e('0xfa')](_0x3d1124[0x0]['phone'])){_0x7bb70d[_0xff5e('0x15a')](_0xff5e('0x202'),_0x1fb373,_0x3d1124[0x0]);}else{return hopperUtils[_0xff5e('0x208')](_['pick'](_0x3d1124[0x0],['VoiceQueueId',_0xff5e('0x165')]))[_0xff5e('0x40')](_0x7bb70d[_0xff5e('0x20d')](_0x1fb373,_0x3d1124[0x0]))[_0xff5e('0xa5')](_0x7bb70d['loggerHandler']('[actionOriginatePredictive]\x20',_0x1fb373));}}}})[_0xff5e('0xa5')](loggerGetContactDialer(_0xff5e('0x20e'),_0x1fb373,0x1));};Dialer[_0xff5e('0x1c')][_0xff5e('0x1de')]=function(_0x3d65bb,_0x50753e,_0x2df8c4,_0x223323,_0x1c0516,_0x3681a6){loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x20f'));loggerPredictive[_0xff5e('0x4d')]('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',_0x3d65bb);loggerPredictive[_0xff5e('0x4d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50753e);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x210'),_0x2df8c4);loggerPredictive['info'](_0xff5e('0x211'),_0x223323);loggerPredictive[_0xff5e('0x4d')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c0516);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x56'));return new Promise(function(_0x2de474,_0x257669){if(_0x3d65bb<=0x0||isNaN(_0x3d65bb)){return _0x257669(msgResponse('[abandonmentRate]',_0xff5e('0x87'),_0xff5e('0x212')+_0x3d65bb));}if(_0x2df8c4<=0x0||isNaN(_0x2df8c4)){return _0x257669(msgResponse('[abandonmentRate]',_0xff5e('0x87'),'Ts\x20=\x20'+_0x2df8c4));}if(_0x223323<=0x0||isNaN(_0x223323)){return _0x257669(msgResponse(_0xff5e('0x213'),_0xff5e('0x87'),_0xff5e('0x214')+_0x223323));}if(_0x50753e<=0x0||isNaN(_0x50753e)){return _0x257669(msgResponse(_0xff5e('0x213'),_0xff5e('0x87'),_0xff5e('0x215')+_0x50753e));}if(_0x1c0516<=0x0||isNaN(_0x1c0516)){return _0x257669(msgResponse('[abandonmentRate]',_0xff5e('0x87'),_0xff5e('0x216')+_0x1c0516));}_0x3681a6=_0x3681a6||0x0;var _0x176785=0x1/_0x2df8c4;var _0x3c08b7=0x0;var _0x50cc44=0x0;var _0x3e2715=0x0;var _0x90fdee=0x0;for(var _0xc49044=0x0;_0x3e2715<_0x1c0516;_0xc49044+=0x1){_0x50cc44=_0xc49044/_0x50753e;_0x3c08b7=(_0x223323*_0x50cc44+_0x3681a6)/_0x176785;_0x3e2715=utils[_0xff5e('0x217')](_0x3c08b7,_0x3d65bb);_0x90fdee=_0x3c08b7/_0x3d65bb*(0x1-utils[_0xff5e('0x217')](_0x3c08b7,_0x3d65bb));}return _0x2de474({'erlangCalls':_0xc49044,'erlangCallToSecond':_0x50753e/_0xc49044,'erlangAbandonmentRate':_0x3e2715,'erlangBusyFactor':_0x90fdee});});};Dialer[_0xff5e('0x1c')]['busyFactor']=function(_0x4f222a,_0x1d19a2,_0x12e216,_0x4c4221,_0x5792d,_0x4ddf1f){loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x218'));loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x219'),_0x4f222a);loggerPredictive[_0xff5e('0x4d')](_0xff5e('0x21a'),_0x1d19a2);loggerPredictive['info'](_0xff5e('0x210'),_0x12e216);loggerPredictive[_0xff5e('0x4d')]('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',_0x4c4221);loggerPredictive[_0xff5e('0x4d')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5792d);loggerPredictive[_0xff5e('0x4d')]('---------------------------');return new Promise(function(_0x2daa1d,_0x8be905){if(_0x4f222a<=0x0||isNaN(_0x4f222a)){return _0x8be905(msgResponse(_0xff5e('0x21b'),_0xff5e('0x87'),_0xff5e('0x212')+_0x4f222a));}if(_0x12e216<=0x0||isNaN(_0x12e216)){return _0x8be905(msgResponse(_0xff5e('0x21b'),_0xff5e('0x87'),'Ts\x20=\x20'+_0x12e216));}if(_0x4c4221<=0x0||isNaN(_0x4c4221)){return _0x8be905(msgResponse(_0xff5e('0x21b'),_0xff5e('0x87'),_0xff5e('0x214')+_0x4c4221));}if(_0x1d19a2<=0x0||isNaN(_0x1d19a2)){return _0x8be905(msgResponse(_0xff5e('0x21b'),_0xff5e('0x87'),_0xff5e('0x215')+_0x1d19a2));}if(_0x5792d<=0x0||isNaN(_0x5792d)){return _0x8be905(msgResponse(_0xff5e('0x21b'),_0xff5e('0x87'),_0xff5e('0x21c')+_0x5792d));}_0x4ddf1f=_0x4ddf1f||0x0;var _0x3caccd=0x1/_0x12e216;var _0x46a829=0x0;var _0x41a1f0=0x0;var _0x11d59b=0x0;var _0x241d3f=0x0;for(var _0x57098f=0x0;_0x241d3f<_0x5792d;_0x57098f+=0x1){_0x41a1f0=_0x57098f/_0x1d19a2;_0x46a829=(_0x4c4221*_0x41a1f0+_0x4ddf1f)/_0x3caccd;_0x11d59b=utils['erlangb'](_0x46a829,_0x4f222a);_0x241d3f=_0x46a829/_0x4f222a*(0x1-utils['erlangb'](_0x46a829,_0x4f222a));}return _0x2daa1d({'erlangCalls':_0x57098f,'erlangCallToSecond':_0x1d19a2/_0x57098f,'erlangAbandonmentRate':_0x11d59b,'erlangBusyFactor':_0x241d3f});});};module[_0xff5e('0x21d')]=Dialer; \ No newline at end of file +var _0xedc3=['SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','object','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','available','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','loggedIn','busyFactor','startMethodPredictive','floor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','not_inuse','[countReScheduled]\x20','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\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','Umin\x20=\x20','exports','util','lodash','uuid','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','predictiveIntervalDroppedCallsTimeout','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','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','CAMPAIGN_STATUS','\x20INTERVAL_IS_NULL','NULL_INTERVAL','Interval','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','stringify','isTrunkReachable','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','ifTime','Failure','\x20Timezone\x20unknow\x20','length','Action','iftime\x20%s,%s','content','indexOf','true','catch','push','command','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','campaigns','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','power','dialPowerLevel','handlePower','Queue','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Global:\x20','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','syncAgentConnect','uniqueId','uniqueid','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','isNil','locked','stateinterface','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','HangupInAMD','[syncHangupInAMDIvr][createHistory]','Machine','countagentrejectretry','stateGlobal','createStateFinal','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','moveContactManagedDialer','running','statusMessage','getQueueCampaignStatusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','handleIvr','originate','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables'];(function(_0x3cc73e,_0x169bcb){var _0x3a3cf1=function(_0x2e35fe){while(--_0x2e35fe){_0x3cc73e['push'](_0x3cc73e['shift']());}};_0x3a3cf1(++_0x169bcb);}(_0xedc3,0x99));var _0x3edc=function(_0x1d65b7,_0x4ae3e7){_0x1d65b7=_0x1d65b7-0x0;var _0x2c6afc=_0xedc3[_0x1d65b7];return _0x2c6afc;};'use strict';var util=require(_0x3edc('0x0'));var _=require(_0x3edc('0x1'));var uuid=require(_0x3edc('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3edc('0x3'));var hopperUtils=require(_0x3edc('0x4'));var ut=require(_0x3edc('0x5'));var config=require(_0x3edc('0x6'));var logger=require('../../../config/logger')(_0x3edc('0x7'));var loggerBooked=require(_0x3edc('0x8'))(_0x3edc('0x9'));var loggerPredictive=require('../../../config/logger')(_0x3edc('0xa'));var loggerPredictiveCalls=require(_0x3edc('0x8'))(_0x3edc('0xb'));var loggerSyncQueueSummary=require(_0x3edc('0x8'))(_0x3edc('0xc'));var ami=require('../ami');config['redis']=_[_0x3edc('0xd')](config[_0x3edc('0xe')],{'host':_0x3edc('0xf'),'port':0x18eb});var io=require(_0x3edc('0x10'))(new Redis(config[_0x3edc('0xe')]));var cmHopper=require(_0x3edc('0x11'));var voiceQueueRt=require(_0x3edc('0x12'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x3edc('0x13'));var Action=require(_0x3edc('0x14'));var History=require(_0x3edc('0x15'));var Final=require(_0x3edc('0x16'));var AgentComplete=require(_0x3edc('0x17'));var QueueCallerAbandon=require(_0x3edc('0x18'));var Hangup=require(_0x3edc('0x19'));var ipAgi=process[_0x3edc('0x1a')][_0x3edc('0x1b')]||_0x3edc('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3edc('0x1d')][_0x3edc('0x1e')]=function(_0x3932b1){this[_0x3edc('0x1f')]=this[_0x3edc('0x1f')]?this[_0x3edc('0x1f')]['finally'](_0x3932b1):_0x3932b1();};function Dialer(_0xef0613,_0x483708){this[_0x3edc('0x20')]=new Sequence();this[_0x3edc('0x21')]=_0x483708;this[_0x3edc('0x22')]=_0xef0613[_0x3edc('0x22')];this['campaigns']=_0xef0613['campaigns'];this['agents']=_0xef0613[_0x3edc('0x23')];this[_0x3edc('0x24')]=_0xef0613[_0x3edc('0x24')];this[_0x3edc('0x25')]=config['maxNumberOriginate']||0x2;this[_0x3edc('0x26')]={};this[_0x3edc('0x27')]={};this['contactsId']={};this['uniqueId']={};this[_0x3edc('0x28')]={};this[_0x3edc('0x29')]={};this[_0x3edc('0x2a')]={};this[_0x3edc('0x2b')]={};this[_0x3edc('0x2c')]={};this[_0x3edc('0x2d')]={};this[_0x3edc('0x2e')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x30'),this[_0x3edc('0x31')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x32'),this[_0x3edc('0x33')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x34'),this[_0x3edc('0x35')][_0x3edc('0x2f')](this));ami['on']('custom:queuesummary',this[_0x3edc('0xc')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x36'),this[_0x3edc('0x37')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x38'),this[_0x3edc('0x39')][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x3a'),this[_0x3edc('0x3b')]['bind'](this));ami['on'](_0x3edc('0x3c'),this[_0x3edc('0x3d')]['bind'](this));ami['on'](_0x3edc('0x3e'),this['syncQueueMember'][_0x3edc('0x2f')](this));ami['on'](_0x3edc('0x3f'),this[_0x3edc('0x40')]['bind'](this));this[_0x3edc('0x41')]();this[_0x3edc('0x42')]();RpcSetting[_0x3edc('0x43')]()[_0x3edc('0x44')](function(_0x159525){previewRecallmeReminderInterval=_0x159525[_0x3edc('0x45')];});}function isNotNull(_0x1b9287){return _0x1b9287!==null&&!_[_0x3edc('0x46')](_0x1b9287);}function msgResponse(_0x1c9ef0,_0x2d7142,_0x307cf5){return{'action':_0x1c9ef0,'response':_0x2d7142,'message':_0x307cf5,'stack':_0x307cf5};}function emit(_0x5796e9,_0x1b1fb9,_0x1885b0){io['to'](_0x5796e9)[_0x3edc('0x47')](_0x1b1fb9,_0x1885b0);}function emitOutboundVoiceQueueSummary(_0xb10e84){if(_0xb10e84[_0x3edc('0x48')]===_0x3edc('0x49')){logger[_0x3edc('0x4a')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x3edc('0x4b')](_0xb10e84,{'showHidden':![],'depth':null}));emit(util[_0x3edc('0x4c')](_0x3edc('0x4d'),_0xb10e84[_0x3edc('0x4e')]),_0x3edc('0x4f'),_0xb10e84);}}function checkGetDataPredictive(_0xb8a49a){if(isNotNull(_0xb8a49a)&&!_[_0x3edc('0x50')](_0xb8a49a)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3edc('0x51')](_0x3edc('0x52'),_0xb8a49a[_0x3edc('0x53')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x54'),_0xb8a49a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x55'),_0xb8a49a[_0x3edc('0x56')]);loggerPredictive[_0x3edc('0x51')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb8a49a[_0x3edc('0x57')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x58'),_0xb8a49a[_0x3edc('0x59')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5a'),_0xb8a49a[_0x3edc('0x5b')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5c'));if(_0xb8a49a[_0x3edc('0x53')]>0x0){if(!_[_0x3edc('0x46')](_0xb8a49a[_0x3edc('0x5b')])&&_0xb8a49a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5d'));if(!_[_0x3edc('0x46')](_0xb8a49a['predictiveIntervalAvgHoldtime'])&&_0xb8a49a['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5e'));}else{loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5f'));}}else{loggerPredictive['info'](_0x3edc('0x60'));}return![];}function mergeDataErlangB(_0x5a4c0b){return function(_0x4ca0fa){loggerPredictive[_0x3edc('0x51')](_0x3edc('0x61'));loggerPredictive[_0x3edc('0x51')](_0x3edc('0x62'),_0x4ca0fa[_0x3edc('0x63')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x64'),_0x4ca0fa['erlangCallToSecond']);loggerPredictive[_0x3edc('0x51')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ca0fa['erlangAbandonmentRate']);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x65'),_0x4ca0fa[_0x3edc('0x66')]);loggerPredictive['info'](_0x3edc('0x67'),_0x4ca0fa[_0x3edc('0x68')]);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5c'));_[_0x3edc('0x69')](_0x5a4c0b,_0x4ca0fa);};}function ifInterval(_0x2ceacd,_0x55ae0d){if(_[_0x3edc('0x46')](_0x55ae0d)){return![];}return utils[_0x3edc('0x6a')](undefined,_0x55ae0d)<_0x2ceacd*0x3c;}function clearPredictiveAttributes(_0x2ccfa9){if(_0x2ccfa9[_0x3edc('0x2a')]){_0x2ccfa9[_0x3edc('0x2a')]=undefined;loggerPredictive[_0x3edc('0x4a')](_0x2ccfa9['name'],_0x3edc('0x6b'));}if(_0x2ccfa9[_0x3edc('0x29')]){_0x2ccfa9[_0x3edc('0x29')]=undefined;loggerPredictive[_0x3edc('0x4a')](_0x2ccfa9[_0x3edc('0x4e')],_0x3edc('0x6c'));}if(_0x2ccfa9[_0x3edc('0x6d')]){clearInterval(_0x2ccfa9[_0x3edc('0x6d')]);_0x2ccfa9['handlePredictive']=undefined;loggerPredictive[_0x3edc('0x4a')](_0x2ccfa9[_0x3edc('0x4e')],_0x3edc('0x6e'));}}function loggerCatchPredictive(_0x5e24ae,_0x568331){return function(_0x4458df){loggerPredictive[_0x3edc('0x6f')](_0x568331[_0x3edc('0x4e')],_0x5e24ae);loggerPredictive[_0x3edc('0x6f')](_0x4458df[_0x3edc('0x70')]);clearPredictiveAttributes(_0x568331);};}function loggerCatch(_0x808278){return function(_0x284870){logger['error'](_0x808278,util[_0x3edc('0x4b')](_0x284870,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3211be,_0x5bb2d4,_0x5653d6){return function(_0xaefe66){utils[_0x3edc('0x71')](_0x5bb2d4,_0x5653d6,0x0);_0x5bb2d4[_0x3edc('0x72')]=0x0;logger[_0x3edc('0x6f')](_0x3211be,util['inspect'](_0xaefe66,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x11d404){return function(_0x565a71){if(isNotNull(_0x565a71)&&isNotNull(_0x565a71[0x0])){if(_0x565a71[0x0][_0x3edc('0x73')]>0x0){_0x11d404[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x75')];logger['info'](_0x3edc('0x76')+_0x11d404[_0x3edc('0x4e')],_0x565a71[0x0][_0x3edc('0x73')],_0x3edc('0x77'));}else{_0x11d404['message']=utils['CAMPAIGN_STATUS'][_0x3edc('0x78')];logger['info'](_0x3edc('0x79')+_0x11d404[_0x3edc('0x4e')]);}}};}function createObjHistory(_0x11544f,_0x39ee6b,_0xb5cc33,_0x22b2e6,_0x114c57){_0x11544f['message']=_0xb5cc33;var _0x4e3e78=new Action(_0x11544f,_0x39ee6b);var _0x5cc567=new History(_0x4e3e78);_0x5cc567[_0x3edc('0x7a')]=_0x22b2e6;_0x5cc567['statedesc']=_0x114c57;_0x5cc567[_0x3edc('0x7b')]=_0x4e3e78[_0x3edc('0x7c')];return _0x5cc567;}function unlockQueueStatus(_0x50a720,_0x5d0ac4){setTimeout(function(){if(_[_0x3edc('0x46')](_0x50a720[_0x3edc('0x7d')])){loggerBooked[_0x3edc('0x6f')](_0x3edc('0x7e'),_0x5d0ac4);}_0x50a720[_0x3edc('0x7d')]=!![];loggerBooked['info'](_0x3edc('0x7f'),_0x5d0ac4,JSON['stringify'](_[_0x3edc('0x80')](_0x50a720,[_0x3edc('0x4e'),_0x3edc('0x7d')])));},0x1f3);}function checkInterval(_0x446a42){return function(){if(!isNotNull(_0x446a42['Interval'])){_0x446a42[_0x3edc('0x74')]=utils[_0x3edc('0x81')]['NULL_INTERVAL'];throw _0x446a42[_0x3edc('0x4e')]+_0x3edc('0x82');}if(!isNotNull(_0x446a42['Interval']['Intervals'])){_0x446a42[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0x83')];throw _0x446a42[_0x3edc('0x4e')]+_0x3edc('0x82');}if(!isNotNull(_['isEmpty'](_0x446a42[_0x3edc('0x84')][_0x3edc('0x85')]))){_0x446a42[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0x83')];throw _0x446a42[_0x3edc('0x4e')]+_0x3edc('0x82');}};}function checkIsIVRCampaignActive(_0x47b040){return function(){if(!utils[_0x3edc('0x86')](_0x47b040)){_0x47b040[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x87')];throw _0x47b040[_0x3edc('0x4e')]+_0x3edc('0x88');}};}function emitCampaignSummary(_0xcaee53){if(utils[_0x3edc('0x89')](_0xcaee53)){emit(util[_0x3edc('0x4c')](_0x3edc('0x8a'),_0xcaee53[_0x3edc('0x4e')]),_0x3edc('0x8b'),_0xcaee53);}}function loggerCatchQueueSummary(_0x4cfcc2,_0x2ccbec){return function(_0x1cae11){clearPredictiveAttributes(_0x2ccbec);emitCampaignSummary(_0x2ccbec);loggerSyncQueueSummary[_0x3edc('0x4a')](_0x4cfcc2,util[_0x3edc('0x4b')](_0x1cae11,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4fa647){if(_0x4fa647[_0x3edc('0x8c')]){if(_0x4fa647[_0x3edc('0x8d')]===0x0){_0x4fa647['sendMessageOneNotActive']=![];_0x4fa647['message']=utils[_0x3edc('0x81')]['INACTIVE'];loggerSyncQueueSummary[_0x3edc('0x4a')](_0x3edc('0x8e'),_0x4fa647['name'],'is\x20not\x20active');}else{_0x4fa647[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4fa647[_0x3edc('0x4e')],_0x3edc('0x8f'));}emitCampaignSummary(_0x4fa647);}}function myreject(_0x4f065c){return function(_0x4d0de8){return _0x4f065c(msgResponse(_0x3edc('0x90'),'Error',JSON[_0x3edc('0x91')](_0x4d0de8)));};}Dialer['prototype'][_0x3edc('0x92')]=function(_0x190241){return!_['isUndefined'](_0x190241)&&_0x190241&&!_['isUndefined'](_0x190241[_0x3edc('0x4e')])&&!_[_0x3edc('0x46')](_0x190241['active'])&&_0x190241['active']&&(this[_0x3edc('0x24')][util['format'](_0x3edc('0x93'),_0x190241[_0x3edc('0x4e')])][_0x3edc('0x94')]===_0x3edc('0x95')||this['trunks'][util[_0x3edc('0x4c')](_0x3edc('0x93'),_0x190241[_0x3edc('0x4e')])][_0x3edc('0x94')]===_0x3edc('0x96'));};Dialer[_0x3edc('0x1d')][_0x3edc('0x97')]=function(_0x2f12a2){var _0x1d2641=this;return function(){if(!_0x1d2641[_0x3edc('0x92')](_0x2f12a2[_0x3edc('0x98')])){if(!_0x1d2641[_0x3edc('0x92')](_0x2f12a2['TrunkBackup'])){_0x2f12a2[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x99')];throw _0x2f12a2[_0x3edc('0x4e')]+_0x3edc('0x9a');}}};};Dialer[_0x3edc('0x1d')][_0x3edc('0x9b')]=function(_0x2e8cb3,_0x122867,_0xcebca,_0x307850){var _0x1c2b36=this;return function(){var _0x15eb55=!![];return _0x1c2b36[_0x3edc('0x9c')](_0x2e8cb3,_0x122867,_0xcebca,_0x307850,_0x15eb55);};};Dialer['prototype'][_0x3edc('0x9d')]=function(_0xdea0ce,_0x2c9788,_0xfe8768,_0x2cdf79){var _0xb81bec=this;return function(){var _0x3281dc=![];return _0xb81bec['ifTimeIvr'](_0xdea0ce[_0x3edc('0x85')],_0x2c9788,_0xfe8768,_0x2cdf79,_0x3281dc);};};Dialer[_0x3edc('0x1d')][_0x3edc('0x9c')]=function(_0xa4a11e,_0xe03ab,_0x1fb1f1,_0x25ffcf,_0x152557){var _0x29437c=[];return new Promise(function(_0xa4a63c,_0x2e5406){if(!isNotNull(_0xa4a11e)){_0x25ffcf['message']=utils[_0x3edc('0x81')][_0x3edc('0x83')];return _0x2e5406(msgResponse('ifTime','Failure',_0x1fb1f1+_0x3edc('0x9e')));}if(_[_0x3edc('0x50')](_0xa4a11e)){_0x25ffcf[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0x9f')];return _0x2e5406(msgResponse('ifTime','Failure',_0x1fb1f1+_0x3edc('0xa0')));}if(_0xe03ab&&_[_0x3edc('0x46')](config[_0x3edc('0xa1')][_0xe03ab])){_0x25ffcf[_0x3edc('0x74')]=utils[_0x3edc('0x81')][_0x3edc('0xa2')];return _0x2e5406(msgResponse(_0x3edc('0xa3'),_0x3edc('0xa4'),_0x1fb1f1+_0x3edc('0xa5')+_0xe03ab));}if(_['isArray'](_0xa4a11e)){for(var _0x30d4c9=0x0;_0x30d4c9<_0xa4a11e[_0x3edc('0xa6')];_0x30d4c9+=0x1){_0x29437c['push'](ami[_0x3edc('0xa7')]({'action':'command','command':util['format'](_0x3edc('0xa8'),_0xa4a11e[_0x30d4c9]['interval'],!_[_0x3edc('0x46')](config['timezones'][_0xe03ab])?_0xe03ab:'')})[_0x3edc('0x44')](function(_0x13ad3a){return _0x13ad3a[_0x3edc('0xa9')][_0x3edc('0xaa')](_0x3edc('0xab'))>=0x0;})[_0x3edc('0xac')](myreject(_0x2e5406)));}}else{_0x29437c[_0x3edc('0xad')](ami[_0x3edc('0xa7')]({'action':_0x3edc('0xae'),'command':util[_0x3edc('0x4c')](_0x3edc('0xa8'),_0xa4a11e,!_[_0x3edc('0x46')](config['timezones'][_0xe03ab])?_0xe03ab:'')})['then'](function(_0x265339){return _0x265339['content']['indexOf'](_0x3edc('0xab'))>=0x0;})[_0x3edc('0xac')](myreject(_0x2e5406)));}Promise['all'](_0x29437c)['then'](function(_0xf05b11){var _0x1c33a4=_['some'](_0xf05b11);if(_0x1c33a4){return _0xa4a63c(_0x1c33a4);}else{_0x25ffcf['message']=_0x152557?utils[_0x3edc('0x81')][_0x3edc('0xaf')]:utils[_0x3edc('0x81')][_0x3edc('0xb0')];return _0x2e5406(msgResponse(_0x3edc('0xb1'),_0x3edc('0xa4'),'Global:\x20'+_0x152557+'\x20'+_0x1fb1f1+_0x3edc('0xb2')+util[_0x3edc('0x4b')](_0xa4a11e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xe03ab));}})[_0x3edc('0xac')](function(_0x370228){return _0x2e5406(msgResponse('ifTime',_0x3edc('0xa4'),JSON[_0x3edc('0x91')](_0x370228)));});});};Dialer[_0x3edc('0x1d')][_0x3edc('0x41')]=function(){var _0x80366=this;return cmHopper[_0x3edc('0xb3')]({'active':![]},{'where':{'active':!![]}})[_0x3edc('0x44')](function(){setInterval(function(){_0x80366[_0x3edc('0xb4')]();},0x3e8);});};Dialer[_0x3edc('0x1d')][_0x3edc('0xb4')]=function(){var _0x4ff593=this;var _0x29810e;for(var _0x13566c in this[_0x3edc('0xb5')]){if(typeof this[_0x3edc('0xb5')][_0x13566c]!=='undefined'){_0x29810e=this[_0x3edc('0xb5')][_0x13566c];if(utils[_0x3edc('0x89')](_0x29810e)&&utils[_0x3edc('0x86')](_0x29810e)){_0x29810e[_0x3edc('0x8c')]=!![];Promise[_0x3edc('0xb6')]()[_0x3edc('0x44')](checkIsIVRCampaignActive(_0x29810e))[_0x3edc('0x44')](checkInterval(_0x29810e))[_0x3edc('0x44')](_0x4ff593[_0x3edc('0x97')](_0x29810e))[_0x3edc('0x44')](_0x4ff593['checkIfTime'](_0x29810e[_0x3edc('0xb7')],_0x29810e[_0x3edc('0xb8')],_0x29810e[_0x3edc('0x4e')],_0x29810e))['then'](_0x4ff593[_0x3edc('0x9d')](_0x29810e['Interval'],_0x29810e['dialTimezone'],_0x29810e[_0x3edc('0x4e')],_0x29810e))['then'](_0x4ff593[_0x3edc('0xb9')](_0x29810e))[_0x3edc('0xac')](loggerCatchQueueSummary(_0x3edc('0xba'),_0x29810e));}else{notSendMessagesCampaign(_0x29810e);}}}};Dialer[_0x3edc('0x1d')][_0x3edc('0xbb')]=function(_0x1bed57){if(_0x1bed57[_0x3edc('0xbc')]!==_0x3edc('0xa')){clearPredictiveAttributes(_0x1bed57);}switch(_0x1bed57[_0x3edc('0xbc')]){case'progressive':this['handlePower'](_0x1bed57,0x1);break;case _0x3edc('0xbd'):this['handlePower'](_0x1bed57,_0x1bed57[_0x3edc('0xbe')]);break;case _0x3edc('0xa'):this[_0x3edc('0xa')](_0x1bed57);break;case _0x3edc('0x9'):this[_0x3edc('0xbf')](_0x1bed57,0x1);break;default:logger[_0x3edc('0x6f')](_0x3edc('0xc0'),_0x1bed57['name'],'method\x20not\x20recognized');}};Dialer[_0x3edc('0x1d')][_0x3edc('0xa3')]=function(_0x5f26ac,_0x12f1b5){var _0x54f855=_0x5f26ac['dialTimezone'];var _0x1dcd52=_0x12f1b5?_0x5f26ac[_0x3edc('0xb7')]:_0x5f26ac[_0x3edc('0x84')][_0x3edc('0x85')];logger[_0x3edc('0xc1')](_0x3edc('0xc2'),_0x1dcd52,_0x54f855,_0x5f26ac[_0x3edc('0x4e')],util[_0x3edc('0x4c')](_0x3edc('0xc3'),_0x5f26ac[_0x3edc('0x4e')],_0x5f26ac['id']));var _0x461627=null;return Interval['intervalIftime'](_0x1dcd52,_0x54f855)[_0x3edc('0x44')](function(_0x5d191b){if(_0x5d191b===!![]){return _0x5d191b;}else{_0x5f26ac[_0x3edc('0x74')]=_0x12f1b5?utils[_0x3edc('0x81')][_0x3edc('0xaf')]:utils['CAMPAIGN_STATUS'][_0x3edc('0xb0')];_0x461627=msgResponse(_0x3edc('0xb1'),'Failure',_0x3edc('0xc4')+_0x12f1b5+'\x20'+_0x5f26ac['name']+_0x3edc('0xb2')+util[_0x3edc('0x4b')](_0x1dcd52,{'showHidden':![],'depth':null})+_0x3edc('0xc5')+_0x54f855);}if(_0x461627!==null){logger[_0x3edc('0xc1')](_0x3edc('0xc6'),_0x461627);_0x461627['isGlobal']=_0x12f1b5;throw _0x461627;}})[_0x3edc('0xac')](function(_0x3bdee2){logger[_0x3edc('0x6f')](_0x3edc('0xc7'),_0x3bdee2);throw msgResponse(_0x3edc('0x90'),'Error',util[_0x3edc('0x4b')](_0x3bdee2,{'showHidden':![],'depth':null}));});};Dialer[_0x3edc('0x1d')][_0x3edc('0xc8')]=function(_0x15e88a){if(this['voiceQueues'][_0x15e88a['queue']]){if(this[_0x3edc('0xc9')][_0x15e88a[_0x3edc('0xca')]]&&this[_0x3edc('0xc9')][_0x15e88a[_0x3edc('0xca')]][_0x3edc('0x48')]!==_0x3edc('0xcb')){this[_0x3edc('0xcc')](this[_0x3edc('0x22')][_0x15e88a[_0x3edc('0xcd')]]);this['uniqueId'][_0x15e88a['uniqueid']][_0x3edc('0xce')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x35')]=function(_0x3bfb91){var _0x122337=this[_0x3edc('0xc9')][_0x3bfb91[_0x3edc('0xca')]];if(this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]]){if(_0x122337&&_0x122337[_0x3edc('0x48')]!==_0x3edc('0xcb')){delete this[_0x3edc('0xc9')][_0x3bfb91[_0x3edc('0xca')]];this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]][_0x3edc('0xd0')]+=0x1;var _0x2b2178=new AgentComplete(_0x122337,_0x3bfb91);if(_0x3bfb91['reason']==='agent'){_0x2b2178[_0x3edc('0xd1')]=this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]][_0x3edc('0xd2')]&&this[_0x3edc('0x22')][_0x3bfb91[_0x3edc('0xcd')]][_0x3edc('0xd3')]?moment()[_0x3edc('0x4c')](_0x3edc('0xcf')):undefined;}hopperUtils['createHistory'](_0x2b2178)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xd4')));hopperUtils['moveContactManagedDialer'](_0x2b2178)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xd5')));}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x31')]=function(_0x42e7f5){var _0x5a276e=this[_0x3edc('0xc9')][_0x42e7f5[_0x3edc('0xca')]];var _0x26972e=this;var _0x33c703=![];var _0x2fd302;var _0x7e4202;if(this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]]){if(_0x5a276e&&_0x5a276e['type']!==_0x3edc('0xcb')){delete this[_0x3edc('0xc9')][_0x42e7f5[_0x3edc('0xca')]];this['updateOriginated'](this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]]);_0x5a276e[_0x3edc('0xd6')]=moment()[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x17215e=new QueueCallerAbandon(_0x5a276e,_0x42e7f5);if(utils[_0x3edc('0x6a')](_0x5a276e[_0x3edc('0xd6')],_0x5a276e['responsetime'])>=_0x5a276e[_0x3edc('0xd7')]){this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xd8')]+=0x1;this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xd9')]+=0x1;_0x17215e['state']=0xa;_0x17215e[_0x3edc('0xda')]=_0x3edc('0xdb');_0x17215e[_0x3edc('0xdc')]='TIMEOUT';_0x17215e[_0x3edc('0xd1')]=this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]]['dialQueueProject2']?moment()[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x17215e[_0x3edc('0xdd')]+=0x1;_0x17215e[_0x3edc('0xde')]+=0x1;_0x2fd302=this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xdf')];_0x7e4202=this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xe0')];hopperUtils[_0x3edc('0xe1')](_0x17215e,_0x17215e[_0x3edc('0x7a')],_0x5a276e[_0x3edc('0xe2')])['then'](function(_0x55e91a){_0x33c703=_0x55e91a[_0x3edc('0xe3')]==0x1;if(_0x17215e['countdropretry']>=_0x26972e['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xe4')]){_0x26972e['queueCallerAbandonCreateState'](_0x17215e,_0x55e91a[_0x3edc('0xe3')]);}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countdropretry':_0x17215e[_0x3edc('0xdd')],'scheduledat':moment()[_0x3edc('0xe6')](_0x26972e[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xdf')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x5a276e[_0x3edc('0xe8')],'ListId':_0x5a276e[_0x3edc('0xe9')],'VoiceQueueId':_0x5a276e['VoiceQueueId']||undefined,'CampaignId':_0x5a276e[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0xeb')));var _0x4af79c=new History(_0x17215e);_0x4af79c[_0x3edc('0x7a')]=0xa;_0x4af79c['statedesc']=_0x3edc('0xdb');_0x4af79c[_0x3edc('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4af79c['endtime']=_0x4af79c[_0x3edc('0x7c')];_0x4af79c[_0x3edc('0xec')]=_0x17215e['calleridname'];_0x4af79c[_0x3edc('0xed')]=_0x17215e['calleridnum'];hopperUtils[_0x3edc('0xee')](_0x4af79c)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xef')));}})[_0x3edc('0x44')](function(){if(_0x33c703)hopperUtils[_0x3edc('0xf0')](_0x17215e,_0x2fd302,_0x7e4202)[_0x3edc('0x44')](function(){return 0x1;});});}else{this[_0x3edc('0x22')][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0x57')]+=0x1;this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xf1')]+=0x1;_0x17215e[_0x3edc('0x7a')]=0xb;_0x17215e[_0x3edc('0xda')]=_0x3edc('0xf2');_0x17215e[_0x3edc('0xdc')]='CALLEREXIT';_0x17215e[_0x3edc('0xf3')]+=0x1;_0x17215e[_0x3edc('0xde')]+=0x1;_0x2fd302=this['voiceQueues'][_0x42e7f5['queue']][_0x3edc('0xf4')];_0x7e4202=this['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]][_0x3edc('0xe0')];hopperUtils['verifyAdditionalPhones'](_0x17215e,_0x17215e[_0x3edc('0x7a')],_0x5a276e[_0x3edc('0xe2')])[_0x3edc('0x44')](function(_0x148366){if(_0x17215e['countabandonedretry']>=_0x26972e[_0x3edc('0x22')][_0x42e7f5['queue']][_0x3edc('0xf5')]){_0x26972e[_0x3edc('0xf6')](_0x17215e,_0x148366['additional']);}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countabandonedretry':_0x17215e[_0x3edc('0xf3')],'scheduledat':moment()[_0x3edc('0xe6')](_0x26972e['voiceQueues'][_0x42e7f5[_0x3edc('0xcd')]]['dialAbandonedRetryFrequency'],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x5a276e['ContactId'],'ListId':_0x5a276e['ListId'],'VoiceQueueId':_0x5a276e[_0x3edc('0xf7')]||undefined,'CampaignId':_0x5a276e['CampaignId']||undefined})['catch'](loggerCatch(_0x3edc('0xf8')));var _0x446381=new History(_0x17215e);_0x446381[_0x3edc('0x7a')]=0xb;_0x446381[_0x3edc('0xda')]=_0x3edc('0xf2');_0x446381[_0x3edc('0x7c')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));_0x446381[_0x3edc('0x7b')]=_0x446381['starttime'];_0x446381[_0x3edc('0xec')]=_0x17215e[_0x3edc('0xec')];_0x446381[_0x3edc('0xed')]=_0x17215e[_0x3edc('0xed')];hopperUtils[_0x3edc('0xee')](_0x446381)['catch'](loggerCatch(_0x3edc('0xf9')));}})[_0x3edc('0x44')](function(){if(_0x33c703)hopperUtils['swapAdditionalPhones'](_0x17215e,_0x2fd302,_0x7e4202)[_0x3edc('0x44')](function(){return 0x1;});});}}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x3b')]=function(_0x3f3b32){if(this['actions'][_0x3f3b32[_0x3edc('0xca')]]){this['actions'][_0x3f3b32[_0x3edc('0xca')]][_0x3edc('0xfa')]=_0x3f3b32[_0x3edc('0xfa')];}if(this[_0x3edc('0xc9')][_0x3f3b32['uniqueid']]){this[_0x3edc('0xc9')][_0x3f3b32[_0x3edc('0xca')]][_0x3edc('0xfa')]=_0x3f3b32[_0x3edc('0xfa')];}};Dialer[_0x3edc('0x1d')]['syncQueueMember']=function(_0x4daa4e){if(!this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]){return;}var _0x2bdcd0=this[_0x3edc('0x22')][this['actions'][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xcd')]][_0x3edc('0xfc')]||_0x3edc('0xfd');if(_0x2bdcd0==='roundrobin'){if(this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]&&_[_0x3edc('0xfe')](this['actions'][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xff')])&&_0x4daa4e[_0x3edc('0x94')]==='1'&&_0x4daa4e['paused']==='0'){if(this[_0x3edc('0x23')][_0x4daa4e[_0x3edc('0x100')]]){if(!this['agents'][_0x4daa4e[_0x3edc('0x100')]][_0x3edc('0xff')]){this['agents'][_0x4daa4e[_0x3edc('0x100')]][_0x3edc('0xff')]=!![];this['actions'][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xff')]=!![];this[_0x3edc('0x27')][_0x4daa4e['actionid']][_0x3edc('0x100')]=_0x4daa4e[_0x3edc('0x100')];}}}}else if(_0x2bdcd0===_0x3edc('0xfd')){if(this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]){if(this[_0x3edc('0x23')][_0x4daa4e[_0x3edc('0x100')]]){this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]]['stateinterface']=_0x4daa4e[_0x3edc('0x100')];if(_[_0x3edc('0xfe')](this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x4daa4e['actionid']]['queue']])){this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]][_0x3edc('0xcd')]]=[];}this['queueBooked'][this['actions'][_0x4daa4e['actionid']]['queue']][_0x3edc('0xad')](_['merge'](_['pick'](this[_0x3edc('0x27')][_0x4daa4e[_0x3edc('0xfb')]],['idHopper',_0x3edc('0x100')]),{'status':_0x4daa4e[_0x3edc('0x94')],'paused':_0x4daa4e['paused']}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x442532){if(!this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]){return;}var _0x238419=this;var _0x329492=this[_0x3edc('0x22')][this['actions'][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]];var _0xc92bee=_0x329492[_0x3edc('0xfc')]||_0x3edc('0xfd');if(_0xc92bee===_0x3edc('0x101')){if(this['actions'][_0x442532['actionid']]&&this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0x100')]){this['preview'][_0x3edc('0x102')](this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0x103')],this[_0x3edc('0x27')][_0x442532['actionid']][_0x3edc('0x100')])[_0x3edc('0xac')](function(_0xc4e3a6){logger[_0x3edc('0x6f')](_0x3edc('0x104'),util[_0x3edc('0x4b')](_0xc4e3a6,{'showHidden':![],'depth':null}));})[_0x3edc('0x105')](function(){_0x238419[_0x3edc('0xcc')](_0x238419['voiceQueues'][_0x238419[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]]);_0x238419[_0x3edc('0x23')][_0x238419[_0x3edc('0x27')][_0x442532['actionid']]['stateinterface']][_0x3edc('0xff')]=![];delete _0x238419['actions'][_0x442532['actionid']];unlockQueueStatus(_0x329492);});}else{this[_0x3edc('0xcc')](this['voiceQueues'][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]]);hopperUtils[_0x3edc('0xe5')]({'active':![],'ContactId':this[_0x3edc('0x27')][_0x442532['actionid']][_0x3edc('0xe8')],'ListId':this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['ListId'],'VoiceQueueId':this[_0x3edc('0x27')][_0x442532['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]];unlockQueueStatus(_0x329492);}}else if(_0xc92bee===_0x3edc('0xfd')){var _0x27604d;if(this[_0x3edc('0x27')][_0x442532['actionid']]&&!_[_0x3edc('0x50')](this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532['actionid']]['queue']])){if(this[_0x3edc('0x2d')][_0x238419[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]]){this[_0x3edc('0x2d')][_0x238419[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['queue']]=this['queueBookedRR'][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['queue']]?this[_0x3edc('0x2d')][this[_0x3edc('0x27')][_0x442532['actionid']][_0x3edc('0xcd')]]:this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]]['queue']]?this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532['actionid']]['queue']][_0x3edc('0x106')]||0x0:0x0;}this[_0x3edc('0x2c')][this[_0x3edc('0x27')][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]][_0x3edc('0x106')]=this[_0x3edc('0x2d')][this['actions'][_0x442532[_0x3edc('0xfb')]][_0x3edc('0xcd')]];for(var _0x5c2ea3=0x0;_0x5c2ea3=_0x1f4076[_0x3edc('0x127')]){_0x34701a['stateGlobal'](_0x1ac457,_0x60d373,_0x3e87e7,_0x3edc('0x128'));}else{if(_0x1ac457['countmachineretry']>=_0x1f4076[_0x3edc('0x129')]){_0x34701a['createStateFinal'](_0x1ac457,_0x60d373,_0x3e87e7,_0x3edc('0x12a'));}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countmachineretry':_0x1ac457[_0x3edc('0x122')],'scheduledat':moment()[_0x3edc('0xe6')](_0x1f4076[_0x3edc('0x12b')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x1ac457[_0x3edc('0xe8')],'ListId':_0x1ac457[_0x3edc('0xe9')],'VoiceQueueId':_0x1ac457[_0x3edc('0xf7')]||undefined,'CampaignId':_0x1ac457[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x60d373({'reschedule':0x1});}}});}if(_0x507161[_0x3edc('0x48')]===_0x3edc('0xcb')&&this[_0x3edc('0xb5')][_0x507161['queue']][_0x3edc('0x115')]&&_0x2bdc24['value']===_0x3edc('0x116')){delete this[_0x3edc('0xc9')][_0x2bdc24[_0x3edc('0xca')]];this['updateOriginated'](this[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]]);_0x54fef4=new Hangup(_0x507161,_0x2bdc24);_0x54fef4['state']=0x12;_0x54fef4[_0x3edc('0xda')]=_0x3edc('0x12c');_0x54fef4['membername']='AMD';ami[_0x3edc('0x47')](_0x3edc('0x119'),ut[_0x3edc('0x11a')](_0x54fef4,_0x3edc('0x11b')));this[_0x3edc('0x11c')](_0x54fef4,_0x3edc('0x12d'),'[syncHangupInAMDIvr]');}if(_0x507161[_0x3edc('0x48')]==='ivr'&&this[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]]['dialAMDActive']&&_0x2bdc24[_0x3edc('0x11f')]===_0x3edc('0x120')){return new Promise(function(_0x3c62aa,_0x1d70d4){delete _0x34701a[_0x3edc('0xc9')][_0x2bdc24['uniqueid']];_0x34701a['updateOriginated'](_0x34701a[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]]);_0x34701a[_0x3edc('0xb5')][_0x507161['queue']][_0x3edc('0xd0')]+=0x1;_0x34701a[_0x3edc('0xb5')][_0x507161['queue']][_0x3edc('0x121')]+=0x1;var _0x575b49=_0x34701a[_0x3edc('0xb5')][_0x507161[_0x3edc('0xcd')]];var _0x458677=new Hangup(_0x507161,_0x2bdc24);_0x458677[_0x3edc('0x7a')]=0x13;_0x458677[_0x3edc('0xda')]=_0x3edc('0x12e');_0x458677[_0x3edc('0x117')]=_0x3edc('0x118');_0x458677[_0x3edc('0x122')]+=0x1;_0x458677['countglobal']+=0x1;_0x458677[_0x3edc('0x11b')]=!![];ami[_0x3edc('0x47')](_0x3edc('0x119'),ut[_0x3edc('0x11a')](_0x458677,_0x3edc('0x11b')));hopperUtils[_0x3edc('0xee')](_0x458677)[_0x3edc('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x458677['countbusyretry']+_0x458677[_0x3edc('0x124')]+_0x458677[_0x3edc('0x125')]+_0x458677[_0x3edc('0x126')]+_0x458677[_0x3edc('0xdd')]+_0x458677[_0x3edc('0xf3')]+_0x458677[_0x3edc('0x122')]+_0x458677[_0x3edc('0x12f')]>=_0x575b49[_0x3edc('0x127')]){_0x34701a[_0x3edc('0x130')](_0x458677,_0x3c62aa,_0x1d70d4,_0x3edc('0x128'));}else{if(_0x458677[_0x3edc('0x122')]>=_0x575b49[_0x3edc('0x129')]){_0x34701a[_0x3edc('0x131')](_0x458677,_0x3c62aa,_0x1d70d4,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x458677['countmachineretry'],'scheduledat':moment()[_0x3edc('0xe6')](_0x575b49[_0x3edc('0x12b')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x458677[_0x3edc('0xe8')],'ListId':_0x458677[_0x3edc('0xe9')],'VoiceQueueId':_0x458677[_0x3edc('0xf7')]||undefined,'CampaignId':_0x458677[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x132')));_0x3c62aa({'reschedule':0x1});}}});}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x39')]=function(_0x20ac0d){var _0x3ba6ea=this[_0x3edc('0xc9')][_0x20ac0d['uniqueid']];var _0x54e9b9;if(_0x3ba6ea&&_0x3ba6ea[_0x3edc('0x48')]===_0x3edc('0xcb')){delete this[_0x3edc('0xc9')][_0x20ac0d[_0x3edc('0xca')]];this[_0x3edc('0xcc')](this[_0x3edc('0xb5')][_0x3ba6ea[_0x3edc('0xcd')]]);this[_0x3edc('0xb5')][_0x3ba6ea['queue']][_0x3edc('0x133')]+=0x1;_0x54e9b9=new Hangup(_0x3ba6ea,_0x20ac0d);hopperUtils[_0x3edc('0xee')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x134')));hopperUtils['moveContactManagedDialer'](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x135')));}if(_0x3ba6ea&&_0x3ba6ea[_0x3edc('0x48')]!==_0x3edc('0xcb')&&isNotNull(this[_0x3edc('0x22')][_0x3ba6ea['queue']][_0x3edc('0x136')])){delete this[_0x3edc('0xc9')][_0x20ac0d[_0x3edc('0xca')]];this[_0x3edc('0xcc')](this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]]);this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]][_0x3edc('0xd0')]+=0x1;this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]][_0x3edc('0x121')]+=0x1;_0x54e9b9=new Hangup(_0x3ba6ea,_0x20ac0d);_0x54e9b9[_0x3edc('0x7a')]=0x10;_0x54e9b9[_0x3edc('0xda')]=_0x3edc('0x137');_0x54e9b9[_0x3edc('0x117')]=_0x3edc('0x138');hopperUtils[_0x3edc('0xee')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x134')));hopperUtils['moveContactManagedDialer'](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x135')));}if(_0x3ba6ea&&_0x3ba6ea[_0x3edc('0x48')]!==_0x3edc('0xcb')&&!isNotNull(this['voiceQueues'][_0x3ba6ea[_0x3edc('0xcd')]]['dialQueueProject'])){delete this[_0x3edc('0xc9')][_0x20ac0d[_0x3edc('0xca')]];this['updateOriginated'](this['voiceQueues'][_0x3ba6ea[_0x3edc('0xcd')]]);this[_0x3edc('0x22')][_0x3ba6ea[_0x3edc('0xcd')]][_0x3edc('0x139')]+=0x1;_0x54e9b9=new Hangup(_0x3ba6ea,_0x20ac0d);_0x54e9b9['state']=0xc;_0x54e9b9[_0x3edc('0xda')]=_0x20ac0d[_0x3edc('0x13a')];_0x54e9b9[_0x3edc('0x117')]=_0x3edc('0x13b');hopperUtils[_0x3edc('0xee')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x134')));hopperUtils[_0x3edc('0x13c')](_0x54e9b9)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x135')));}};Dialer[_0x3edc('0x1d')][_0x3edc('0xc')]=function(_0x5e0b20){var _0x43f5ba=this;if(!_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20[_0x3edc('0x4e')]]){_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20['name']]={'running':![]};}else if(_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20[_0x3edc('0x4e')]][_0x3edc('0x13d')]===!![]){return;}else if(_0x43f5ba[_0x3edc('0x2e')][_0x5e0b20[_0x3edc('0x4e')]][_0x3edc('0x13d')]===![]){_0x43f5ba['queuesSummary'][_0x5e0b20[_0x3edc('0x4e')]][_0x3edc('0x13d')]=!![];}var _0x3964a0=_0x43f5ba['voiceQueues'][_0x5e0b20[_0x3edc('0x4e')]];var _0x359fa6=_0x3964a0[_0x3edc('0x74')]!==utils[_0x3edc('0x81')][_0x3edc('0x87')];var _0x2ba4d2=utils['isPreviewCampaign'](_0x3964a0);_0x3964a0[_0x3edc('0x13e')]=utils[_0x3edc('0x13f')](_0x3964a0,_0x43f5ba[_0x3edc('0x24')]);Promise['resolve']()[_0x3edc('0x44')](function(){if(_0x3964a0['statusMessage']===utils['CAMPAIGN_STATUS'][_0x3edc('0x87')]){if(_0x359fa6){clearPredictiveAttributes(_0x3964a0);_0x5e0b20[_0x3edc('0x29')]=undefined;_0x5e0b20[_0x3edc('0x2a')]=undefined;}if(_0x3964a0[_0x3edc('0x13e')]===utils[_0x3edc('0x81')][_0x3edc('0x87')]){_0x5e0b20['available']=0x0;_0x5e0b20[_0x3edc('0x107')]=0x0;_0x5e0b20[_0x3edc('0x140')]=0x0;_0x5e0b20[_0x3edc('0x141')]=0x0;_0x5e0b20[_0x3edc('0x142')]=0x0;}}else if(_0x3964a0[_0x3edc('0x13e')]===utils[_0x3edc('0x81')][_0x3edc('0x143')]&&!_0x2ba4d2){return _0x43f5ba[_0x3edc('0xa3')](_0x3964a0,!![])[_0x3edc('0x44')](function(){return _0x43f5ba[_0x3edc('0xa3')](_0x3964a0,![]);})['then'](function(){return _0x43f5ba['checkDialMethod'](_0x3964a0);})['catch'](function(_0x113656){loggerSyncQueueSummary[_0x3edc('0x4a')](_0x3edc('0x144'),util[_0x3edc('0x4b')](_0x113656,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3964a0);});}else{clearPredictiveAttributes(_0x3964a0);}})[_0x3edc('0x44')](function(){var _0x1df5ea=_0x5e0b20['compareToOutboundQueue'](_0x3964a0);if(_0x1df5ea||_0x3964a0[_0x3edc('0x145')]){_0x3964a0['queueSummaryCountersUpdated']=![];_0x5e0b20[_0x3edc('0x146')](_0x3964a0);Object['assign'](_0x3964a0,_0x5e0b20);emitOutboundVoiceQueueSummary(_0x5e0b20);}_0x43f5ba[_0x3edc('0x2e')][_0x3964a0[_0x3edc('0x4e')]]['running']=![];})[_0x3edc('0xac')](function(_0x27c0f7){logger[_0x3edc('0x6f')](_0x3edc('0x144'),util['inspect'](_0x27c0f7,{'showHidden':![],'depth':null}));_0x43f5ba['queuesSummary'][_0x3964a0[_0x3edc('0x4e')]][_0x3edc('0x13d')]=![];});};Dialer[_0x3edc('0x1d')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x5e3038=_[_0x3edc('0x147')](this[_0x3edc('0x22')],function(_0x434eb8){return _0x434eb8[_0x3edc('0x148')];});var _0x3a2ea9=_[_0x3edc('0x147')](this[_0x3edc('0x23')],function(_0x4f01df){return _0x4f01df['online']&&_0x4f01df[_0x3edc('0x94')]===_0x3edc('0x95');});if(_0x5e3038[_0x3edc('0xa6')]>0x0&&_0x3a2ea9[_0x3edc('0xa6')]>0x0){return Promise[_0x3edc('0xb6')]()[_0x3edc('0x44')](cmHopper[_0x3edc('0x149')](_[_0x3edc('0x14a')](_0x5e3038,'id'),previewRecallmeReminderInterval,_['map'](_0x3a2ea9,'id')))[_0x3edc('0x44')](function(_0x1218c0){for(var _0x3ef22e=0x0;_0x3ef22e<_0x1218c0[_0x3edc('0xa6')];_0x3ef22e++){var _0x4d3943=_0x1218c0[_0x3ef22e][_0x3edc('0x14b')][_0x3edc('0x4e')];if(_0x4d3943)io['to'](util[_0x3edc('0x4c')]('user:%s',_0x4d3943))['emit'](_0x3edc('0x14c'),{'hopper':_0x1218c0[_0x3ef22e]});}})[_0x3edc('0xac')](function(_0xeb37a3){logger['error'](_0x3edc('0x14d'),_0xeb37a3);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x3edc('0x42')]=function(){var _0x3b6fa2=this;setInterval(function(){_0x3b6fa2['clearZombieChannels'](_0x3b6fa2[_0x3edc('0xc9')],_0x3edc('0x14e'));_0x3b6fa2[_0x3edc('0x14f')](_0x3b6fa2[_0x3edc('0x27')],_0x3edc('0x150'));},0x32c8);};Dialer['prototype'][_0x3edc('0x14f')]=function(_0xa6da00,_0x4d4083){var _0x23ad8b=this;for(var _0x2bcf42 in _0xa6da00){if(typeof _0xa6da00[_0x2bcf42]!==_0x3edc('0x151')){this[_0x3edc('0x20')]['enqueue'](function(){if(!_['isNil'](_0xa6da00[_0x2bcf42])){return ami[_0x3edc('0xa7')]({'action':'status','channel':_0xa6da00[_0x2bcf42]['channel']})[_0x3edc('0xac')](function(_0x55ef2e){if(_0x55ef2e[_0x3edc('0x74')]===_0x3edc('0x152')){setTimeout(function(){if(_0xa6da00[_0x2bcf42]&&_0xa6da00[_0x2bcf42][_0x3edc('0x48')]!=='ivr'){_0x23ad8b['updateOriginated'](_0x23ad8b[_0x3edc('0x22')][_0xa6da00[_0x2bcf42][_0x3edc('0xcd')]]);logger[_0x3edc('0x6f')](_0x3edc('0x153'),_0x4d4083,_0x2bcf42,_0xa6da00[_0x2bcf42]['queue']);delete _0xa6da00[_0x2bcf42];}if(_0xa6da00[_0x2bcf42]&&_0xa6da00[_0x2bcf42][_0x3edc('0x48')]===_0x3edc('0xcb')){_0x23ad8b[_0x3edc('0xcc')](_0x23ad8b[_0x3edc('0xb5')][_0xa6da00[_0x2bcf42][_0x3edc('0xcd')]]);logger[_0x3edc('0x6f')](_0x3edc('0x154'),_0x4d4083,_0x2bcf42,_0xa6da00[_0x2bcf42]['queue']);delete _0xa6da00[_0x2bcf42];}},0x2328);}});}});}}};Dialer[_0x3edc('0x1d')][_0x3edc('0x155')]=function(_0x5b6261){return Promise[_0x3edc('0xb6')]()[_0x3edc('0x44')](voiceQueueRt[_0x3edc('0x155')](_0x5b6261))[_0x3edc('0xac')](loggerCatch(_0x3edc('0x156')));};Dialer[_0x3edc('0x1d')][_0x3edc('0xcc')]=function(_0x3cdadb){if(!_[_0x3edc('0x46')](_0x3cdadb)&&_0x3cdadb!==null){if(typeof _0x3cdadb[_0x3edc('0x8d')]!==_0x3edc('0x151')){if(_0x3cdadb[_0x3edc('0x8d')]>0x0){_0x3cdadb[_0x3edc('0x8d')]-=0x1;}else{logger['error'](_0x3edc('0x157'));}}}else{logger['error'](_0x3edc('0x158'));}};Dialer[_0x3edc('0x1d')][_0x3edc('0x159')]=function(_0x22c23e,_0x5a18c3){var _0x356fd2=this;return function(_0x90ea08){_0x356fd2[_0x3edc('0xcc')](_0x5a18c3);logger['error'](_0x22c23e,util[_0x3edc('0x4b')](_0x90ea08,{'showHidden':![],'depth':null}));};};Dialer[_0x3edc('0x1d')]['emptyContact']=function(_0x5b2eae,_0x40bf86,_0x465b61){var _0x3c4862={'state':0x19,'statedesc':_0x3edc('0x15a')};this[_0x3edc('0xcc')](_0x40bf86);this[_0x3edc('0x11c')](_['merge'](_0x3c4862,_[_0x3edc('0x80')](_0x465b61,[_0x3edc('0xe8'),'ListId',_0x3edc('0x15b'),_0x3edc('0xf7'),_0x3edc('0xea')])),'[emptyContact][createHistory]',_0x3edc('0x15c'));logger[_0x3edc('0x6f')](_0x5b2eae);};Dialer[_0x3edc('0x1d')]['saveInDb']=function(_0x5904e7,_0x489415,_0x455458){hopperUtils[_0x3edc('0xee')](_0x5904e7)[_0x3edc('0xac')](loggerCatch(_0x489415));hopperUtils[_0x3edc('0x13c')](_0x5904e7)[_0x3edc('0xac')](loggerCatch(_0x455458));};Dialer[_0x3edc('0x1d')]['queueCallerAbandonCreateState']=function(_0x1e3320,_0x17ee82){hopperUtils[_0x3edc('0xee')](_0x1e3320)[_0x3edc('0xac')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x17ee82==0x0){hopperUtils['moveContactManagedDialer'](_0x1e3320)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x15d')));}};Dialer[_0x3edc('0x1d')][_0x3edc('0x14d')]=function(_0x10255f){return Promise[_0x3edc('0xb6')]()['then'](cmHopper[_0x3edc('0x149')](_0x10255f['id'],previewRecallmeReminderInterval))[_0x3edc('0x44')](function(_0x572cfa){for(var _0x1e4736=0x0;_0x1e4736<_0x572cfa[_0x3edc('0xa6')];_0x1e4736++){var _0x3cb641=_0x572cfa[_0x1e4736][_0x3edc('0x14b')][_0x3edc('0x4e')];if(_0x3cb641)io['to'](util['format'](_0x3edc('0x15e'),_0x3cb641))[_0x3edc('0x47')](_0x3edc('0x14c'),{'hopper':_0x572cfa[_0x1e4736]});}})['catch'](function(){});};Dialer['prototype'][_0x3edc('0xb9')]=function(_0x52107a){var _0x1d63dd=this;return function(){_0x1d63dd[_0x3edc('0x15f')](_0x52107a);};};Dialer[_0x3edc('0x1d')]['actionOriginate']=function(_0x4a835e,_0x2f7b02){var _0x6a6f2f=this;var _0x930fd6=uuid['v4']();this[_0x3edc('0x27')][_0x930fd6]=new Action(_0x4a835e,_0x2f7b02,_0x930fd6);return new Promise(function(_0x132e6a,_0x36232f){if(_['isUndefined'](_0x4a835e)&&typeof _0x4a835e!=='object'){return _0x36232f(msgResponse(_0x3edc('0x160'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x3edc('0x46')](_0x2f7b02[_0x3edc('0x161')])||_0x2f7b02[_0x3edc('0x161')]===null){return _0x36232f(msgResponse(_0x3edc('0x160'),_0x3edc('0xa4'),_0x3edc('0x162')));}var _0xc9cae5={'XMD-CALLERID':_0x6a6f2f[_0x3edc('0x27')][_0x930fd6]['getCaller'](),'XMD-AGI':_0x4a835e[_0x3edc('0x136')]?util[_0x3edc('0x4c')](_0x3edc('0x163'),ipAgi,_0x4a835e[_0x3edc('0x136')]):_0x3edc('0x164'),'XMD-AGIAFTER':_0x4a835e[_0x3edc('0xd2')]?util['format'](_0x3edc('0x163'),ipAgi,_0x4a835e[_0x3edc('0xd2')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x4a835e)?util['format'](_0x3edc('0x165'),_0x4a835e['name'],_0x4a835e[_0x3edc('0x166')]||'',_0x4a835e['dialAgiAfterHangupAgent']?'c':'',_0x4a835e[_0x3edc('0xd7')]||0x3):_0x3edc('0x164'),'XMD-CONTACTID':_0x2f7b02[_0x3edc('0xe8')],'XMD-CDRTYPE':_0x3edc('0x7'),'CALLERID(all)':_0x6a6f2f[_0x3edc('0x27')][_0x930fd6][_0x3edc('0x167')](),'XMD-AMD':_0x4a835e[_0x3edc('0x115')]?'ACTIVE':'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4a835e[_0x3edc('0x115')]){_0xc9cae5[_0x3edc('0x168')]=_0x4a835e[_0x3edc('0x169')]||0x9c4;_0xc9cae5[_0x3edc('0x16a')]=_0x4a835e[_0x3edc('0x16b')]||0x5dc;_0xc9cae5['XMD-AMDAFTERGREETINGSILENCE']=_0x4a835e[_0x3edc('0x16c')]||0x320;_0xc9cae5[_0x3edc('0x16d')]=_0x4a835e[_0x3edc('0x16e')]||0x1388;_0xc9cae5[_0x3edc('0x16f')]=_0x4a835e['dialAMDMinWordLength']||0x64;_0xc9cae5[_0x3edc('0x170')]=_0x4a835e[_0x3edc('0x171')]||0x32;_0xc9cae5[_0x3edc('0x172')]=_0x4a835e[_0x3edc('0x173')]||0x3;_0xc9cae5[_0x3edc('0x174')]=_0x4a835e[_0x3edc('0x175')]||0x100;_0xc9cae5[_0x3edc('0x176')]=_0x4a835e[_0x3edc('0x177')]||0x1388;}if(utils[_0x3edc('0x178')](_0x4a835e)){_0xc9cae5[_0x3edc('0x179')]=_0x2f7b02[_0x3edc('0xf7')];}else{_0xc9cae5[_0x3edc('0x17a')]=_0x2f7b02[_0x3edc('0xea')];}var _0x268196=utils[_0x3edc('0x17b')](_0x2f7b02[_0x3edc('0x17c')]);Object[_0x3edc('0x17d')](_0xc9cae5,_0x268196);var _0x3c4d45=_0x6a6f2f[_0x3edc('0x92')](_0x4a835e['Trunk'])?utils[_0x3edc('0x17e')](_0x4a835e['Trunk'][_0x3edc('0x17f')],_0x4a835e[_0x3edc('0x180')],_0x4a835e['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x3edc('0x181')](_0x4a835e[_0x3edc('0x182')],_0x4a835e['dialRandomLastDigitCallerIdNumber']):_0x4a835e[_0x3edc('0x182')]):utils[_0x3edc('0x17e')](_['isNil'](_0x4a835e[_0x3edc('0x183')])?_0x4a835e[_0x3edc('0x98')][_0x3edc('0x17f')]:_0x4a835e[_0x3edc('0x183')][_0x3edc('0x17f')],_0x4a835e[_0x3edc('0x180')],_0x4a835e[_0x3edc('0x184')]>0x0?utils['getCallerIdRandom'](_0x4a835e[_0x3edc('0x182')],_0x4a835e[_0x3edc('0x184')]):_0x4a835e[_0x3edc('0x182')]);if(_0x3c4d45){_0xc9cae5[_0x3edc('0x185')]=_0x6a6f2f[_0x3edc('0x27')][_0x930fd6]['originatecalleridname']=utils[_0x3edc('0x186')](_0x3c4d45);_0xc9cae5[_0x3edc('0x187')]=_0x2f7b02[_0x3edc('0x161')];}_0x4a835e[_0x3edc('0x188')]=_0xc9cae5;return ami[_0x3edc('0xa7')]({'actionid':_0x930fd6,'action':_0x3edc('0x160'),'channel':_0x6a6f2f[_0x3edc('0x92')](_0x4a835e['Trunk'])?util[_0x3edc('0x4c')](_0x3edc('0x189'),_0x4a835e[_0x3edc('0x98')][_0x3edc('0x4e')],isNotNull(_0x4a835e[_0x3edc('0x18a')])?_0x4a835e[_0x3edc('0x18a')]['trim']()||'':'',_0x4a835e[_0x3edc('0x18b')]>0x0?_0x2f7b02[_0x3edc('0x161')][_0x3edc('0x18c')](_0x4a835e[_0x3edc('0x18b')]):_0x2f7b02['phone']):util[_0x3edc('0x4c')](_0x3edc('0x189'),_[_0x3edc('0xfe')](_0x4a835e[_0x3edc('0x183')])?_0x4a835e[_0x3edc('0x98')]['name']:_0x4a835e['TrunkBackup'][_0x3edc('0x4e')],isNotNull(_0x4a835e[_0x3edc('0x18a')])?_0x4a835e['dialPrefix'][_0x3edc('0x18d')]()||'':'',_0x4a835e[_0x3edc('0x18b')]>0x0?_0x2f7b02[_0x3edc('0x161')][_0x3edc('0x18c')](_0x4a835e[_0x3edc('0x18b')]):_0x2f7b02[_0x3edc('0x161')]),'callerid':_0x3c4d45,'Exten':_0x3edc('0x114'),'Context':'from-sip','Priority':'1','variable':_0xc9cae5,'timeout':(_0x4a835e['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x930fd6})[_0x3edc('0x44')](function(_0x1ae3f5){return _0x132e6a(_0x1ae3f5);})[_0x3edc('0xac')](function(_0x329515){_0x4a835e['outboundOriginateFailureCallsDay']+=0x1;var _0x494996=new History(_0x6a6f2f[_0x3edc('0x27')][_0x930fd6]);logger[_0x3edc('0x6f')](util['format'](_0x3edc('0x18e'),JSON[_0x3edc('0x91')](_0x329515)));_0x494996[_0x3edc('0x7a')]=0xe;_0x494996[_0x3edc('0xda')]=_0x3edc('0x18f');_0x494996[_0x3edc('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x494996[_0x3edc('0x7b')]=_0x494996[_0x3edc('0x7c')];hopperUtils[_0x3edc('0xee')](_0x494996)['catch'](loggerCatch(_0x3edc('0x190')));_0x6a6f2f['moveContactManagedDialer'](_0x494996)[_0x3edc('0xac')](loggerCatch('[originate][error]'))[_0x3edc('0x105')](function(){delete _0x6a6f2f[_0x3edc('0x27')][_0x930fd6];return _0x36232f(msgResponse(_0x3edc('0x160'),_0x3edc('0x191'),_0x3edc('0x192')));});});});};Dialer[_0x3edc('0x1d')][_0x3edc('0x193')]=function(_0x360bed,_0x48d742,_0x4c826d){var _0x9ca4b4=new History(_0x48d742);if(_0x9ca4b4[_0x3edc('0x123')]+_0x9ca4b4[_0x3edc('0x124')]+_0x9ca4b4[_0x3edc('0x125')]+_0x9ca4b4[_0x3edc('0x126')]+_0x9ca4b4[_0x3edc('0xdd')]+_0x9ca4b4[_0x3edc('0xf3')]+_0x9ca4b4[_0x3edc('0x122')]+_0x9ca4b4[_0x3edc('0x12f')]>=_0x4c826d[_0x3edc('0x127')]-0x1){return!![];}switch(_0x360bed){case 0x3:if(_0x9ca4b4[_0x3edc('0x125')]>=_0x4c826d[_0x3edc('0x194')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countnoanswerretry':_0x9ca4b4['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x195')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4['VoiceQueueId']||undefined,'CampaignId':_0x9ca4b4['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x196')));break;case 0x5:if(_0x9ca4b4[_0x3edc('0x123')]>=_0x4c826d[_0x3edc('0x197')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countbusyretry':_0x9ca4b4[_0x3edc('0x123')]+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d['dialBusyRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4['ListId'],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x9ca4b4[_0x3edc('0x124')]>=_0x4c826d[_0x3edc('0x198')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x9ca4b4[_0x3edc('0x124')]+=0x1,'scheduledat':moment()['add'](_0x4c826d[_0x3edc('0x199')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4['ContactId'],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x19a')));break;case 0x0:if(_0x9ca4b4[_0x3edc('0x126')]>=_0x4c826d[_0x3edc('0x19b')]-0x1){return!![];}else{hopperUtils[_0x3edc('0xe5')]({'active':![],'countnosuchnumberretry':_0x9ca4b4['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x19c')],_0x3edc('0xe7'))[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9ca4b4['ContactId'],'ListId':_0x9ca4b4['ListId'],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x19d')));}break;case 0xa:if(_0x9ca4b4[_0x3edc('0xdd')]>=_0x4c826d[_0x3edc('0xe4')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countdropretry':_0x9ca4b4[_0x3edc('0xdd')]+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0xdf')],_0x3edc('0xe7'))['format'](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4['ListId'],'VoiceQueueId':_0x9ca4b4['VoiceQueueId']||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0xeb')));break;case 0xb:if(_0x9ca4b4['countabandonedretry']>=_0x4c826d[_0x3edc('0xf5')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x9ca4b4['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x4c826d[_0x3edc('0xf4')],_0x3edc('0xe7'))[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4['VoiceQueueId']||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})['catch'](loggerCatch(_0x3edc('0xf8')));break;case 0x13:if(_0x9ca4b4[_0x3edc('0x122')]>=_0x4c826d['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x9ca4b4[_0x3edc('0x122')]+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x12b')],_0x3edc('0xe7'))['format'](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x132')));break;case 0x14:if(_0x9ca4b4['countagentrejectretry']>=_0x4c826d[_0x3edc('0x19e')]-0x1){return!![];}hopperUtils[_0x3edc('0xe5')]({'active':![],'countagentrejectretry':_0x9ca4b4['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3edc('0xe6')](_0x4c826d[_0x3edc('0x19f')],'minutes')[_0x3edc('0x4c')](_0x3edc('0xcf')),'ContactId':_0x9ca4b4[_0x3edc('0xe8')],'ListId':_0x9ca4b4[_0x3edc('0xe9')],'VoiceQueueId':_0x9ca4b4[_0x3edc('0xf7')]||undefined,'CampaignId':_0x9ca4b4[_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1a0')));break;default:return!![];}};Dialer[_0x3edc('0x1d')][_0x3edc('0x110')]=function(_0x26c6bb,_0x262b50,_0x21da66){var _0x3bef26=this;var _0x4a5bd6=new History(_0x26c6bb);var _0x535a20=![];var _0x59f7ba;var _0x51e5e1;return new Promise(function(_0x5f5950,_0x47d583){if(_[_0x3edc('0x46')](_0x262b50)&&typeof _0x262b50!=='object'){return _0x47d583(msgResponse(_0x3edc('0x1a1'),_0x3edc('0xa4'),_0x3edc('0x1a2')));}if(_[_0x3edc('0x46')](_0x21da66)&&typeof _0x21da66!==_0x3edc('0x1a3')){return _0x47d583(msgResponse(_0x3edc('0x1a1'),'Failure',_0x3edc('0x1a4')));}hopperUtils['verifyAdditionalPhones'](_0x4a5bd6,_0x21da66[_0x3edc('0x1a5')],_0x262b50)[_0x3edc('0x44')](function(_0x44a5ed){if(_0x44a5ed[_0x3edc('0xe3')]==0x1)_0x535a20=!![];switch(_0x21da66['reason']){case'0':_0x262b50[_0x3edc('0x1a6')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x0;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1a7');_0x4a5bd6[_0x3edc('0x126')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;ami[_0x3edc('0x47')]('custom:agentnosuchnumber',ut[_0x3edc('0x11a')](_0x26c6bb,_0x3edc('0x1a8')));_0x59f7ba=_0x262b50[_0x3edc('0x19c')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)['catch'](loggerCatch(_0x3edc('0x1a9')));if(_0x3bef26['checkRetriveMax'](0x0,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x126')]>=_0x262b50[_0x3edc('0x19b')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1aa'));}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1aa'));}}break;case'3':_0x262b50[_0x3edc('0x1ab')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x3;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1ac');_0x4a5bd6[_0x3edc('0x125')]+=0x1;_0x4a5bd6['countglobal']+=0x1;var _0x517590=ut[_0x3edc('0x1ad')](_0x26c6bb,_0x262b50);ami['emit'](_0x3edc('0x1ae'),_0x517590);_0x59f7ba=_0x262b50[_0x3edc('0x195')];_0x51e5e1=_0x262b50['callAdditionalPhoneAfterMin'];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1af')));if(_0x3bef26[_0x3edc('0x193')](0x3,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x125')]>=_0x262b50['dialNoAnswerMaxRetry']){_0x3bef26['createStateFinal'](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b0'));}}break;case'5':_0x262b50['outboundBusyCallsDay']+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x5;_0x4a5bd6[_0x3edc('0xda')]='Busy';_0x4a5bd6[_0x3edc('0x123')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;ami[_0x3edc('0x47')]('custom:agentbusy',ut[_0x3edc('0x11a')](_0x26c6bb,'busy'));_0x59f7ba=_0x262b50[_0x3edc('0x1b1')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1b2')));if(_0x3bef26[_0x3edc('0x193')](0x5,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x123')]>=_0x262b50[_0x3edc('0x197')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b3'));}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b3'));}}break;case'8':_0x262b50[_0x3edc('0x1b4')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x8;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1b5');_0x4a5bd6[_0x3edc('0x124')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;_0x59f7ba=_0x262b50['dialCongestionRetryFrequency'];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x26c6bb,_0x3edc('0x1b6')));hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1b7')));if(_0x3bef26[_0x3edc('0x193')](0x8,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x124')]>=_0x262b50['dialCongestionMaxRetry']){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b8'));}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1b8'));}}break;case'11':_0x262b50[_0x3edc('0x1b9')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0xb;_0x4a5bd6['statedesc']='Abandoned';_0x4a5bd6[_0x3edc('0xf3')]+=0x1;_0x4a5bd6['countglobal']+=0x1;_0x59f7ba=_0x262b50[_0x3edc('0xf4')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch(_0x3edc('0xf9')));if(_0x3bef26['checkRetriveMax'](0xb,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0xf3')]>=_0x262b50[_0x3edc('0xf5')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x2011\x20abandoned');}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x3edc('0x1ba'));}}break;case'20':_0x262b50[_0x3edc('0x1bb')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0x14;_0x4a5bd6[_0x3edc('0xda')]=_0x3edc('0x1bc');_0x4a5bd6[_0x3edc('0x12f')]+=0x1;_0x4a5bd6[_0x3edc('0xde')]+=0x1;_0x59f7ba=_0x262b50[_0x3edc('0x19f')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];ami[_0x3edc('0x47')](_0x3edc('0x1bd'),ut['buildObj'](_0x26c6bb,_0x3edc('0x1be')));hopperUtils['createHistory'](_0x4a5bd6)['catch'](loggerCatch(_0x3edc('0x1bf')));if(_0x3bef26['checkRetriveMax'](0x14,_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x12f')]>=_0x262b50[_0x3edc('0x19e')]){_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x2020\x20agentreject');}else{_0x3bef26[_0x3edc('0x130')](_0x4a5bd6,_0x5f5950,_0x47d583,'reason\x2020\x20agentreject');}}break;default:_0x262b50[_0x3edc('0x139')]+=0x1;_0x4a5bd6[_0x3edc('0x7a')]=0xc;_0x4a5bd6[_0x3edc('0xda')]=_0x21da66[_0x3edc('0x1a5')];_0x59f7ba=_0x262b50[_0x3edc('0x19f')];_0x51e5e1=_0x262b50[_0x3edc('0xe0')];hopperUtils[_0x3edc('0xee')](_0x4a5bd6)[_0x3edc('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3bef26[_0x3edc('0x193')](_0x21da66[_0x3edc('0x1a5')],_0x26c6bb,_0x262b50)&&!_0x535a20){if(_0x4a5bd6[_0x3edc('0x123')]+_0x4a5bd6[_0x3edc('0x124')]+_0x4a5bd6[_0x3edc('0x125')]+_0x4a5bd6['countnosuchnumberretry']+_0x4a5bd6[_0x3edc('0xdd')]+_0x4a5bd6[_0x3edc('0xf3')]+_0x4a5bd6[_0x3edc('0x122')]+_0x4a5bd6[_0x3edc('0x12f')]>=_0x262b50['dialGlobalMaxRetry']){_0x3bef26['stateGlobal'](_0x4a5bd6,_0x5f5950,_0x47d583,_0x21da66['reason']);}else{_0x3bef26[_0x3edc('0x131')](_0x4a5bd6,_0x5f5950,_0x47d583,_0x21da66[_0x3edc('0x1a5')]);}}}})[_0x3edc('0x44')](function(){if(_0x535a20){hopperUtils[_0x3edc('0xf0')](_0x4a5bd6,_0x59f7ba,_0x51e5e1)[_0x3edc('0x44')](function(){return _0x5f5950(0x1);});}});});};Dialer['prototype'][_0x3edc('0x130')]=function(_0x3a8ada,_0xb15477,_0x170cb9,_0x22158f){var _0x3678a6=new Final(_0x3a8ada);_0x3678a6[_0x3edc('0x7a')]=0xf;_0x3678a6[_0x3edc('0xda')]=_0x3edc('0x1c0');this[_0x3edc('0x131')](_0x3678a6,_0xb15477,_0x170cb9,_0x22158f);};Dialer[_0x3edc('0x1d')]['createStateFinal']=function(_0x1d8651,_0x57d01a,_0x2321ab,_0x487638){hopperUtils[_0x3edc('0x13c')](_0x1d8651)[_0x3edc('0x44')](function(){return _0x57d01a(msgResponse(_0x3edc('0x1a1'),_0x3edc('0x10f'),_0x487638));})['catch'](function(){return _0x2321ab(msgResponse(_0x3edc('0x1c1'),'Failure',_0x3edc('0x1c2')));});};Dialer['prototype']['predictive']=function(_0x24f406){var _0x4ff43f=_0x24f406[_0x3edc('0x1c3')]/0x64;var _0x46255f=_0x24f406['outboundDropCallsDayTimeout']/(_0x24f406[_0x3edc('0xd8')]+_0x24f406['outboundAnswerCallsDay']);var _0x53f86b=Math[_0x3edc('0x1c4')](_0x24f406[_0x3edc('0x1c5')]*(_0x24f406['predictiveIntervalMaxThreshold']/0x64));var _0xdcffa4=Math[_0x3edc('0x1c4')](_0x24f406[_0x3edc('0x1c5')]*(_0x24f406['predictiveIntervalMinThreshold']/0x64));var _0x57cc29=_0x24f406[_0x3edc('0x1c6')]+_0x24f406[_0x3edc('0x141')];var _0x52b98d=Math['floor'](_0x24f406[_0x3edc('0x63')]*_0x24f406[_0x3edc('0x68')]*_0x24f406[_0x3edc('0x1c7')]*_0x24f406[_0x3edc('0x1c8')]);if(_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x2a')])){if(!_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x29')])){_0x24f406[_0x3edc('0x29')]=undefined;loggerPredictive[_0x3edc('0x6f')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x6d')])){loggerPredictive[_0x3edc('0x6f')](_0x3edc('0x1c9'),_0x3edc('0x1ca'));clearInterval(_0x24f406['handlePredictive']);_0x24f406['handlePredictive']=undefined;}_0x24f406[_0x3edc('0x2a')]=moment()[_0x3edc('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x24f406[_0x3edc('0x4e')],_0x3edc('0x1cb'),_0x24f406[_0x3edc('0x2a')]);this[_0x3edc('0xbf')](_0x24f406,0x1);}else if(ifInterval(_0x24f406[_0x3edc('0x1cc')],_0x24f406[_0x3edc('0x2a')])){this[_0x3edc('0xbf')](_0x24f406,0x1);loggerPredictiveCalls[_0x3edc('0x51')](_0x3edc('0x1cd'),_0x24f406['startProgressive'],_0x24f406['name']);_0x24f406['erlangCalls']=0x0;_0x24f406[_0x3edc('0xd9')]=0x0;}else if(_0x4ff43f<_0x46255f&&_0x24f406[_0x3edc('0x1ce')]==='dropRate'){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x1cf'),'Dropped\x20calls\x20day',_0x46255f,'startProgressive',_0x24f406[_0x3edc('0x4e')]);}else if(_0x52b98d<_0x24f406['predictiveIntervalErlangCallsDroppedCalls']&&_0x24f406[_0x3edc('0x1ce')]===_0x3edc('0x1d0')){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x1d1'),_0x3edc('0x1d2'),_0x52b98d,'Drop\x20in\x20this\x20interval',_0x24f406[_0x3edc('0xd9')],_0x3edc('0x2a'),_0x24f406[_0x3edc('0x4e')]);}else if(!ifInterval(_0x24f406[_0x3edc('0x1cc')],_0x24f406['startProgressive'])&&_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x29')])&&!_[_0x3edc('0x46')](_0x24f406[_0x3edc('0x2a')])){_0x24f406[_0x3edc('0x29')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));loggerPredictive[_0x3edc('0x51')](_0x24f406['name'],_0x3edc('0x1d3'),_0x24f406['startPredictive']);hopperUtils['avgHandleTime'](_0x24f406[_0x3edc('0x1cc')])[_0x3edc('0x44')](this[_0x3edc('0x1d4')](_0x24f406))[_0x3edc('0x44')](mergeDataErlangB(_0x24f406))[_0x3edc('0x44')](this['startMethodPredictive'](_0x24f406))[_0x3edc('0xac')](loggerCatchPredictive(_0x3edc('0x1d5'),_0x24f406));}else if(!ifInterval(_0x24f406[_0x3edc('0x1cc')],_0x24f406[_0x3edc('0x29')])){_0x24f406[_0x3edc('0xd9')]=0x0;_0x24f406[_0x3edc('0x29')]=moment()[_0x3edc('0x4c')](_0x3edc('0xcf'));loggerPredictive[_0x3edc('0x51')](_0x24f406['name'],_0x3edc('0x1d6'),_0x24f406['startPredictive']);clearInterval(_0x24f406['handlePredictive']);_0x24f406[_0x3edc('0x6d')]=undefined;hopperUtils['avgHandleTime'](_0x24f406[_0x3edc('0x1cc')])['then'](this[_0x3edc('0x1d4')](_0x24f406))['then'](mergeDataErlangB(_0x24f406))[_0x3edc('0x44')](this['startMethodPredictive'](_0x24f406))[_0x3edc('0xac')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x24f406));}else if(_0x24f406['predictiveIntervalAvailable']&&_0x57cc29<_0x24f406[_0x3edc('0x1c5')]-_0xdcffa4){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x24f406[_0x3edc('0x4e')],_0x3edc('0x1d7'),_0x57cc29,_0x3edc('0x1d8'),_0x24f406[_0x3edc('0x1c5')],'-',_0xdcffa4,'=',_0x24f406[_0x3edc('0x1c5')]-_0xdcffa4,')');}else if(_0x24f406['predictiveIntervalAvailable']&&_0x57cc29>_0x24f406[_0x3edc('0x1c5')]+_0x53f86b){clearPredictiveAttributes(_0x24f406);loggerPredictive[_0x3edc('0x51')](_0x24f406[_0x3edc('0x4e')],_0x3edc('0x1d7'),_0x57cc29,')\x20are\x20more\x20than\x20threshold\x20(',_0x24f406[_0x3edc('0x1c5')],'+',_0x53f86b,'=',_0x24f406[_0x3edc('0x1c5')]+_0x53f86b,')');}};Dialer[_0x3edc('0x1d')][_0x3edc('0x1d4')]=function(_0x42a0e4){var _0x4b3cc4=this;return function(_0x588ced){return new Promise(function(_0x5eaeb8,_0x594d60){_['merge'](_0x42a0e4,_0x588ced[0x0]);if(checkGetDataPredictive(_0x588ced[0x0])){var _0x1ccfa7=_0x42a0e4[_0x3edc('0x1c5')]=_0x42a0e4[_0x3edc('0x141')]+_0x42a0e4[_0x3edc('0x1c6')];var _0x1e2367=_0x42a0e4[_0x3edc('0x1cc')]*0x3c;var _0x3f0b33=_0x588ced[0x0][_0x3edc('0x5b')]+_0x588ced[0x0][_0x3edc('0x59')];var _0x4e26ea=(_0x588ced[0x0][_0x3edc('0x1d9')]+_0x588ced[0x0][_0x3edc('0x56')]+_0x588ced[0x0][_0x3edc('0x57')])/_0x588ced[0x0]['predictiveIntervalTotalCalls'];_0x42a0e4[_0x3edc('0x1c7')]=_0x4e26ea>0x0?_0x4e26ea:0x1;switch(_0x42a0e4[_0x3edc('0x1ce')]){case _0x3edc('0x1d0'):var _0x4b4880=_0x42a0e4[_0x3edc('0x1c3')]/0x64;return _0x4b3cc4[_0x3edc('0x1da')](_0x1ccfa7,_0x1e2367,_0x3f0b33,_0x4e26ea,_0x4b4880)[_0x3edc('0x44')](function(_0x438bf4){return _0x5eaeb8(_0x438bf4);});case _0x3edc('0x1db'):var _0x13d53c=_0x42a0e4[_0x3edc('0x1c3')]/0x64;return _0x4b3cc4['busyFactor'](_0x1ccfa7,_0x1e2367,_0x3f0b33,_0x4e26ea,_0x13d53c)[_0x3edc('0x44')](function(_0x35fdfa){return _0x5eaeb8(_0x35fdfa);});default:return _0x594d60(msgResponse('[getDataPredictive]',_0x3edc('0xa4'),_0x3edc('0x1dc')));}}else{return _0x594d60(msgResponse(_0x3edc('0x1dd'),_0x3edc('0xa4'),_0x3edc('0x1de')));}});};};Dialer[_0x3edc('0x1d')][_0x3edc('0x1df')]=function(_0x26d962){var _0x5739ae=this;return function(_0x37b351){return new Promise(function(_0x4dda4d,_0x470a60){_[_0x3edc('0x69')](_0x26d962,_0x37b351[0x0]);if(checkGetDataPredictive(_0x37b351[0x0])){loggerPredictive['info'](JSON[_0x3edc('0x91')](_0x37b351[0x0]));if(_0x26d962[_0x3edc('0x1ce')]===_0x3edc('0x1d0')){return _0x5739ae[_0x3edc('0x155')](_0x26d962['id'])[_0x3edc('0x44')](function(_0x28e218){var _0x1ab975=_0x26d962['loggedIn']-_0x28e218[0x0][_0x3edc('0x1e0')];var _0x46efcf=_0x26d962['dialPredictiveInterval']*0x3c;var _0x8b60a9=_0x37b351[0x0][_0x3edc('0x5b')]+_0x37b351[0x0][_0x3edc('0x59')];var _0x1f1391=(_0x37b351[0x0][_0x3edc('0x1d9')]+_0x37b351[0x0][_0x3edc('0x56')]+_0x37b351[0x0][_0x3edc('0x57')])/_0x37b351[0x0][_0x3edc('0x53')];var _0x4d804c=_0x26d962[_0x3edc('0x1c3')]/0x64;_0x26d962[_0x3edc('0x1e1')]=_0x28e218[0x0][_0x3edc('0x1e0')]||0x0;_0x26d962['predictiveIntervalHitRate']=_0x1f1391>0x0?_0x1f1391:0x1;return _0x5739ae['abandonmentRate'](_0x1ab975,_0x46efcf,_0x8b60a9,_0x1f1391,_0x4d804c);})[_0x3edc('0x44')](function(_0x30574e){return _0x4dda4d(_0x30574e);})['catch'](function(_0x2f3d8e){return _0x470a60(msgResponse(_0x3edc('0x1e2'),'Failure',JSON[_0x3edc('0x91')](_0x2f3d8e)));});}if(_0x26d962[_0x3edc('0x1ce')]===_0x3edc('0x1db')){return _0x5739ae[_0x3edc('0x155')](_0x26d962['id'])[_0x3edc('0x44')](function(_0x4d3965){var _0x433acc=_0x26d962[_0x3edc('0x1e3')]-_0x4d3965[0x0][_0x3edc('0x1e0')];var _0xf4b71a=_0x26d962['dialPredictiveInterval']*0x3c;var _0xd93e67=_0x37b351[0x0][_0x3edc('0x5b')]+_0x37b351[0x0]['predictiveIntervalAvgHoldtime'];var _0x5f44eb=(_0x37b351[0x0][_0x3edc('0x1d9')]+_0x37b351[0x0][_0x3edc('0x56')]+_0x37b351[0x0][_0x3edc('0x57')])/_0x37b351[0x0][_0x3edc('0x53')];var _0x5c1f91=_0x26d962[_0x3edc('0x1c3')]/0x64;_0x26d962[_0x3edc('0x1e1')]=_0x4d3965[0x0][_0x3edc('0x1e0')]||0x0;_0x26d962[_0x3edc('0x1c7')]=_0x5f44eb>0x0?_0x5f44eb:0x1;return _0x5739ae[_0x3edc('0x1e4')](_0x433acc,_0xf4b71a,_0xd93e67,_0x5f44eb,_0x5c1f91);})[_0x3edc('0x44')](function(_0x319773){return _0x4dda4d(_0x319773);})[_0x3edc('0xac')](function(_0x2f4747){return _0x470a60(msgResponse('[CatchErlangB]',_0x3edc('0xa4'),JSON[_0x3edc('0x91')](_0x2f4747)));});}}else{return _0x470a60(msgResponse('[getDataPredictive]',_0x3edc('0xa4'),_0x3edc('0x1de')));}});};};Dialer[_0x3edc('0x1d')][_0x3edc('0x1e5')]=function(_0x4ba3bb){var _0x24e336=this;return function(){var _0x15681d=0x0;var _0x89608=Math[_0x3edc('0x1e6')](_0x4ba3bb[_0x3edc('0x1e7')]*0x3e8);if(_0x89608>0x0){_0x89608=_0x89608<0x64?0x64:_0x89608;loggerPredictive[_0x3edc('0x51')](_0x4ba3bb[_0x3edc('0x4e')],_0x3edc('0x1e8'),_0x89608,_0x3edc('0x1e9'));_0x4ba3bb[_0x3edc('0x6d')]=setInterval(function(){_0x24e336[_0x3edc('0x6d')](_0x4ba3bb);loggerPredictiveCalls[_0x3edc('0x51')](_0x3edc('0x1ea'),_0x15681d+=0x1);},_0x89608);}else{loggerPredictive[_0x3edc('0x51')](_0x4ba3bb[_0x3edc('0x4e')],_0x3edc('0x1eb'));}};};Dialer[_0x3edc('0x1d')][_0x3edc('0x1ec')]=function(_0x55d13d,_0x134a46){var _0x337653=this;return function(_0x3f4970){if(_[_0x3edc('0x50')](_0x3f4970)){if(_[_0x3edc('0xfe')](_0x134a46[_0x3edc('0x15b')])||!_0x134a46[_0x3edc('0x1ed')]){if(_0x55d13d[_0x3edc('0xbc')]===_0x3edc('0x9')){_0x55d13d[_0x3edc('0x7d')]=_[_0x3edc('0x46')](_0x55d13d['queueStatusComplete'])?!![]:_0x55d13d['queueStatusComplete'];var _0x324a0e=uuid['v4']();_0x337653[_0x3edc('0x27')][_0x324a0e]=new Action(_0x55d13d,_0x134a46,_0x324a0e);loggerBooked[_0x3edc('0x51')](_0x3edc('0x1ee'),_0x324a0e,'queueStatusComplete:\x20',JSON[_0x3edc('0x91')](_0x55d13d[_0x3edc('0x7d')]),_0x3edc('0x1ef'),_0x55d13d[_0x3edc('0x4e')]);if(_0x55d13d[_0x3edc('0x7d')]){_0x55d13d[_0x3edc('0x7d')]=![];_0x337653[_0x3edc('0x2c')][_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xcd')]]=[];ami['Action']({'actionid':_0x324a0e,'action':'queuestatus','queue':_0x55d13d['name']})[_0x3edc('0xac')](function(){_0x337653[_0x3edc('0xcc')](_0x55d13d);hopperUtils[_0x3edc('0xe5')]({'active':![],'ContactId':_0x337653['actions'][_0x324a0e][_0x3edc('0xe8')],'ListId':_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xe9')],'VoiceQueueId':_0x337653['actions'][_0x324a0e][_0x3edc('0xf7')]||undefined,'CampaignId':_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xea')]||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1f0')));delete _0x337653[_0x3edc('0x27')][_0x324a0e];});}else{loggerBooked[_0x3edc('0x51')](_0x3edc('0x1f1'),JSON['stringify'](_0x55d13d[_0x3edc('0x7d')]),_0x3edc('0x1ef'),_0x55d13d[_0x3edc('0x4e')]);_0x337653[_0x3edc('0xcc')](_0x55d13d);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x337653['actions'][_0x324a0e]['ContactId'],'ListId':_0x337653[_0x3edc('0x27')][_0x324a0e]['ListId'],'VoiceQueueId':_0x337653[_0x3edc('0x27')][_0x324a0e][_0x3edc('0xf7')]||undefined,'CampaignId':_0x337653[_0x3edc('0x27')][_0x324a0e]['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1f0')));delete _0x337653[_0x3edc('0x27')][_0x324a0e];}}else{return _0x337653[_0x3edc('0x1f2')](_0x55d13d,_0x134a46);}}else{if(utils[_0x3edc('0x6a')](undefined,_0x134a46[_0x3edc('0x1f3')])<_0x55d13d['dialRecallMeTimeout']*0x3c){if(_0x134a46[_0x3edc('0x14b')]&&!_0x134a46[_0x3edc('0x14b')][_0x3edc('0x1f4')]){_0x337653['preview']['run'](_0x134a46['id'])[_0x3edc('0x105')](function(){_0x337653[_0x3edc('0xcc')](_0x55d13d);});}else{hopperUtils[_0x3edc('0x1f5')]({'active':![]},_0x134a46['id'],0x1)[_0x3edc('0x105')](function(){_0x337653[_0x3edc('0xcc')](_0x55d13d);});}}else{_0x55d13d[_0x3edc('0x1f6')]+=0x1;_0x337653['updateOriginated'](_0x55d13d);if(_0x55d13d[_0x3edc('0x1f7')]){hopperUtils[_0x3edc('0xe5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x134a46[_0x3edc('0xe8')],'ListId':_0x134a46['ListId'],'VoiceQueueId':_0x134a46[_0x3edc('0xf7')]||undefined,'CampaignId':_0x134a46['CampaignId']||undefined})[_0x3edc('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x3edc('0xee')](createObjHistory(_0x55d13d,_0x134a46,utils[_0x3edc('0x81')]['QUEUE_RECALL'],0x17,_0x3edc('0x1f8')))[_0x3edc('0xac')](loggerCatch(_0x3edc('0x1f9')));}else{_0x337653[_0x3edc('0x11c')](createObjHistory(_0x55d13d,_0x134a46,utils[_0x3edc('0x81')]['RECALL_TIMEOUT'],0x16,_0x3edc('0x1fa')),_0x3edc('0x1fb'),'[Originate][HistoryRecallClose]');}}}}else{_0x55d13d['outboundBlacklistCallsDay']+=0x1;_0x337653['saveInDb'](createObjHistory(_0x55d13d,_0x134a46,utils[_0x3edc('0x81')][_0x3edc('0x1fc')],0xd,_0x3edc('0x1fd')),_0x3edc('0x1fe'),'[Originate][MoveBlacklist]');throw _0x3edc('0x1ff');}};};Dialer['prototype']['handleIvr']=function(_0x25e671){var _0x44f5a9=this;var _0x592cfb=_0x25e671[_0x3edc('0x200')]-_0x25e671['originated'];emitCampaignSummary(_0x25e671);if(_0x592cfb>0x0&&_0x25e671[_0x3edc('0x72')]==0x0){if(_0x592cfb>this[_0x3edc('0x25')]){_0x592cfb=this[_0x3edc('0x25')];}_0x25e671[_0x3edc('0x72')]=0x1;hopperUtils[_0x3edc('0x201')](_0x25e671,_0x592cfb)[_0x3edc('0x44')](function(_0x303990){_0x25e671[_0x3edc('0x72')]=0x0;if(_0x303990){if(!utils[_0x3edc('0x202')](_0x303990)){_0x25e671['message']=utils[_0x3edc('0x81')][_0x3edc('0x78')];logger[_0x3edc('0x51')]('[getContactCampaign2][Empty]'+_0x25e671['name']);}else{_0x25e671[_0x3edc('0x8d')]+=_0x303990[_0x3edc('0xa6')];_0x25e671['message']=utils[_0x3edc('0x81')][_0x3edc('0x203')];for(var _0x167e78=0x0;_0x167e78<_0x303990['length'];_0x167e78+=0x1){_0x25e671[_0x3edc('0x204')]+=0x1;if(_[_0x3edc('0xfe')](_0x303990[_0x167e78])||_[_0x3edc('0xfe')](_0x303990[_0x167e78][_0x3edc('0x17c')])||_['isNil'](_0x303990[_0x167e78][_0x3edc('0x161')])){_0x44f5a9[_0x3edc('0x205')](_0x3edc('0x206'),_0x25e671,_0x303990[_0x167e78]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x3edc('0x80')](_0x303990[_0x167e78],[_0x3edc('0xea'),_0x3edc('0x161')]))['then'](_0x44f5a9[_0x3edc('0x1ec')](_0x25e671,_0x303990[_0x167e78]))[_0x3edc('0xac')](_0x44f5a9[_0x3edc('0x159')]('[actionOriginateIvr]\x20',_0x25e671));}}}}})[_0x3edc('0xac')](loggerGetContactDialer(_0x3edc('0x207'),_0x25e671,_0x592cfb));}};Dialer[_0x3edc('0x1d')][_0x3edc('0xbf')]=function(_0x3fc0ae,_0x5c0374){var _0x366599=this;var _0xeda835=[];if(_0x5c0374<0x1||_0x3fc0ae[_0x3edc('0xbc')]==='booked'){_0x5c0374=0x1;}var _0x25211d=Math[_0x3edc('0x1e6')](_0x3fc0ae[_0x3edc('0x1c6')]*_0x5c0374)-_0x3fc0ae[_0x3edc('0x8d')];if(_0x3fc0ae[_0x3edc('0x208')]>0x0){var _0x1f3a66=_0x3fc0ae['dialLimitQueue']-_0x3fc0ae[_0x3edc('0x8d')]-_0x3fc0ae[_0x3edc('0x141')]-_0x3fc0ae['pTalking'];if(_0x25211d>_0x1f3a66){_0x25211d=_0x1f3a66;}}if(_0x25211d>0x0&&_0x3fc0ae[_0x3edc('0x72')]==0x0){if(_0x3fc0ae[_0x3edc('0xbc')]===_0x3edc('0x9')){_0x25211d=0x1;}if(_0x25211d>this[_0x3edc('0x25')]){_0x25211d=this[_0x3edc('0x25')];}for(var _0x201b43 in this[_0x3edc('0x23')]){if(typeof this['agents'][_0x201b43]!==_0x3edc('0x151')){if(this[_0x3edc('0x23')][_0x201b43][_0x3edc('0x7a')]==='not_inuse'&&this[_0x3edc('0x23')][_0x201b43][_0x3edc('0x94')]===_0x3edc('0x95')){_0xeda835[_0x3edc('0xad')](this[_0x3edc('0x23')][_0x201b43]['id']);}}}_0x3fc0ae[_0x3edc('0x72')]=0x1;hopperUtils[_0x3edc('0x209')](_0x3fc0ae,_0xeda835,_0x25211d)['then'](function(_0x3c159b){_0x3fc0ae[_0x3edc('0x72')]=0x0;if(_0x3c159b){if(!utils[_0x3edc('0x202')](_0x3c159b)){hopperUtils[_0x3edc('0x20a')](_0x3fc0ae)['then'](sendMessageReschedule(_0x3fc0ae))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3fc0ae[_0x3edc('0x8d')]+=_0x3c159b['length'];_0x3fc0ae[_0x3edc('0x74')]=_0x3fc0ae[_0x3edc('0xbc')]===_0x3edc('0x9')?utils[_0x3edc('0x81')][_0x3edc('0x143')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x44e92f=0x0;_0x44e92f<_0x3c159b['length'];_0x44e92f+=0x1){if(_[_0x3edc('0xfe')](_0x3c159b[_0x44e92f])||_[_0x3edc('0xfe')](_0x3c159b[_0x44e92f][_0x3edc('0x17c')])||_[_0x3edc('0xfe')](_0x3c159b[_0x44e92f][_0x3edc('0x161')])){_0x366599['emptyContact'](_0x3edc('0x206'),_0x3fc0ae,_0x3c159b[_0x44e92f]);}else{hopperUtils[_0x3edc('0x20b')](_[_0x3edc('0x80')](_0x3c159b[_0x44e92f],[_0x3edc('0xf7'),_0x3edc('0x161')]))[_0x3edc('0x44')](_0x366599[_0x3edc('0x1ec')](_0x3fc0ae,_0x3c159b[_0x44e92f]))['catch'](_0x366599[_0x3edc('0x159')](_0x3edc('0x206'),_0x3fc0ae));}}}}})[_0x3edc('0xac')](loggerGetContactDialer(_0x3edc('0x20c'),_0x3fc0ae,_0x25211d));}};Dialer[_0x3edc('0x1d')][_0x3edc('0x6d')]=function(_0x18ce52){if(_0x18ce52[_0x3edc('0x208')]>0x0){var _0x146699=_0x18ce52[_0x3edc('0x208')]-_0x18ce52[_0x3edc('0x8d')]-_0x18ce52[_0x3edc('0x141')];if(_0x146699>0x0&&_0x18ce52[_0x3edc('0x72')]==0x0){this[_0x3edc('0x20d')](_0x18ce52);}else{loggerPredictiveCalls[_0x3edc('0x51')]('[handlePredictive][limitChannel]');}}else{this[_0x3edc('0x20d')](_0x18ce52);}};Dialer[_0x3edc('0x1d')][_0x3edc('0x20d')]=function(_0x3026a9){var _0x553a34=this;var _0x5d08d0=[];_0x3026a9[_0x3edc('0x8d')]+=0x1;for(var _0x4908e7 in this[_0x3edc('0x23')]){if(typeof this[_0x3edc('0x23')][_0x4908e7]!==_0x3edc('0x151')){if(this[_0x3edc('0x23')][_0x4908e7][_0x3edc('0x7a')]===_0x3edc('0x20e')&&this['agents'][_0x4908e7][_0x3edc('0x94')]===_0x3edc('0x95')){_0x5d08d0['push'](this[_0x3edc('0x23')][_0x4908e7]['id']);}}}_0x3026a9[_0x3edc('0x72')]=0x1;return this['getContactDialer'](_0x3026a9['id'],_0x5d08d0,0x1,_0x3026a9['dialOrderByScheduledAt'],_0x3026a9)[_0x3edc('0x44')](function(_0x58382e){_0x3026a9[_0x3edc('0x72')]=0x1;if(_0x58382e){if(!utils[_0x3edc('0x202')](_0x58382e)){utils[_0x3edc('0x71')](_0x3026a9,0x1,0x0);return hopperUtils['countReScheduled'](_0x3026a9)['then'](sendMessageReschedule(_0x3026a9))['catch'](loggerCatch(_0x3edc('0x20f')));}else{_0x3026a9[_0x3edc('0x74')]=utils['CAMPAIGN_STATUS'][_0x3edc('0x203')];if(_[_0x3edc('0xfe')](_0x58382e[0x0])||_[_0x3edc('0xfe')](_0x58382e[0x0][_0x3edc('0x17c')])||_['isNil'](_0x58382e[0x0][_0x3edc('0x161')])){_0x553a34[_0x3edc('0x205')](_0x3edc('0x206'),_0x3026a9,_0x58382e[0x0]);}else{return hopperUtils[_0x3edc('0x20b')](_[_0x3edc('0x80')](_0x58382e[0x0],[_0x3edc('0xf7'),_0x3edc('0x161')]))[_0x3edc('0x44')](_0x553a34[_0x3edc('0x1ec')](_0x3026a9,_0x58382e[0x0]))['catch'](_0x553a34[_0x3edc('0x159')](_0x3edc('0x210'),_0x3026a9));}}}})[_0x3edc('0xac')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3026a9,0x1));};Dialer['prototype'][_0x3edc('0x1da')]=function(_0x4df70e,_0x2d8ac3,_0x355033,_0x65baf1,_0x1806ce,_0x3d6c4){loggerPredictive['info'](_0x3edc('0x211'));loggerPredictive['info'](_0x3edc('0x212'),_0x4df70e);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x213'),_0x2d8ac3);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x214'),_0x355033);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x215'),_0x65baf1);loggerPredictive['info'](_0x3edc('0x216'),_0x1806ce);loggerPredictive['info'](_0x3edc('0x5c'));return new Promise(function(_0x578b5e,_0x3ca631){if(_0x4df70e<=0x0||isNaN(_0x4df70e)){return _0x3ca631(msgResponse(_0x3edc('0x217'),'Error','m\x20=\x20'+_0x4df70e));}if(_0x355033<=0x0||isNaN(_0x355033)){return _0x3ca631(msgResponse('[abandonmentRate]',_0x3edc('0x191'),_0x3edc('0x218')+_0x355033));}if(_0x65baf1<=0x0||isNaN(_0x65baf1)){return _0x3ca631(msgResponse(_0x3edc('0x217'),_0x3edc('0x191'),_0x3edc('0x219')+_0x65baf1));}if(_0x2d8ac3<=0x0||isNaN(_0x2d8ac3)){return _0x3ca631(msgResponse(_0x3edc('0x217'),_0x3edc('0x191'),_0x3edc('0x21a')+_0x2d8ac3));}if(_0x1806ce<=0x0||isNaN(_0x1806ce)){return _0x3ca631(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x1806ce));}_0x3d6c4=_0x3d6c4||0x0;var _0x3080f5=0x1/_0x355033;var _0x334af2=0x0;var _0x3722ae=0x0;var _0x273856=0x0;var _0x4fdc3b=0x0;for(var _0x1429df=0x0;_0x273856<_0x1806ce;_0x1429df+=0x1){_0x3722ae=_0x1429df/_0x2d8ac3;_0x334af2=(_0x65baf1*_0x3722ae+_0x3d6c4)/_0x3080f5;_0x273856=utils['erlangb'](_0x334af2,_0x4df70e);_0x4fdc3b=_0x334af2/_0x4df70e*(0x1-utils[_0x3edc('0x21b')](_0x334af2,_0x4df70e));}return _0x578b5e({'erlangCalls':_0x1429df,'erlangCallToSecond':_0x2d8ac3/_0x1429df,'erlangAbandonmentRate':_0x273856,'erlangBusyFactor':_0x4fdc3b});});};Dialer['prototype'][_0x3edc('0x1e4')]=function(_0x3625e1,_0x50fadb,_0x17e306,_0x2e3944,_0x28156c,_0x4315ec){loggerPredictive[_0x3edc('0x51')](_0x3edc('0x21c'));loggerPredictive[_0x3edc('0x51')](_0x3edc('0x212'),_0x3625e1);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x213'),_0x50fadb);loggerPredictive[_0x3edc('0x51')]('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',_0x17e306);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x215'),_0x2e3944);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x21d'),_0x28156c);loggerPredictive[_0x3edc('0x51')](_0x3edc('0x5c'));return new Promise(function(_0x1f65a5,_0x40b05e){if(_0x3625e1<=0x0||isNaN(_0x3625e1)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x21f')+_0x3625e1));}if(_0x17e306<=0x0||isNaN(_0x17e306)){return _0x40b05e(msgResponse('[busyFactor]',_0x3edc('0x191'),'Ts\x20=\x20'+_0x17e306));}if(_0x2e3944<=0x0||isNaN(_0x2e3944)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x219')+_0x2e3944));}if(_0x50fadb<=0x0||isNaN(_0x50fadb)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x21a')+_0x50fadb));}if(_0x28156c<=0x0||isNaN(_0x28156c)){return _0x40b05e(msgResponse(_0x3edc('0x21e'),_0x3edc('0x191'),_0x3edc('0x220')+_0x28156c));}_0x4315ec=_0x4315ec||0x0;var _0x2ba2e6=0x1/_0x17e306;var _0x1d82b7=0x0;var _0x116025=0x0;var _0x4b61d2=0x0;var _0x24afc0=0x0;for(var _0x1729a5=0x0;_0x24afc0<_0x28156c;_0x1729a5+=0x1){_0x116025=_0x1729a5/_0x50fadb;_0x1d82b7=(_0x2e3944*_0x116025+_0x4315ec)/_0x2ba2e6;_0x4b61d2=utils[_0x3edc('0x21b')](_0x1d82b7,_0x3625e1);_0x24afc0=_0x1d82b7/_0x3625e1*(0x1-utils[_0x3edc('0x21b')](_0x1d82b7,_0x3625e1));}return _0x1f65a5({'erlangCalls':_0x1729a5,'erlangCallToSecond':_0x50fadb/_0x1729a5,'erlangAbandonmentRate':_0x4b61d2,'erlangBusyFactor':_0x24afc0});});};module[_0x3edc('0x221')]=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 3b5c294..bad8555 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 _0x2825=['countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','voiceQueue','dialCutDigit','substring','util','lodash','moment','string','isNil','uniqueid','name','Contact','firstName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x2825,0x16d));var _0x5282=function(_0x53faed,_0x40790a){_0x53faed=_0x53faed-0x0;var _0x2ba664=_0x2825[_0x53faed];return _0x2ba664;};'use strict';var util=require(_0x5282('0x0'));var _=require(_0x5282('0x1'));var moment=require(_0x5282('0x2'));function checkNameSurname(_0x1acff2,_0x4c0bac,_0x1debe4){var _0x256ab7='';if(!_['isNil'](_0x4c0bac)&&_0x5282('0x3')===typeof _0x4c0bac){_0x256ab7+=_0x4c0bac;}if(!_[_0x5282('0x4')](_0x1debe4)&&_0x5282('0x3')===typeof _0x1debe4){_0x256ab7+='\x20'+_0x1debe4;}if(_0x256ab7!==''){return _0x256ab7;}return _0x1acff2;}function Action(_0x4475c2,_0x4272d4,_0x3370f2){this['voiceQueue']=_0x4475c2;this[_0x5282('0x5')]=_0x3370f2||undefined;this[_0x5282('0x6')]=checkNameSurname(_0x4272d4[_0x5282('0x7')]['phone'],_0x4272d4['Contact'][_0x5282('0x8')],_0x4272d4[_0x5282('0x7')]['lastName']);this[_0x5282('0x9')]=_0x4272d4[_0x5282('0xa')];this[_0x5282('0xb')]=_0x4475c2['name'];this[_0x5282('0xc')]=_0x4272d4[_0x5282('0xc')]||![];this[_0x5282('0xd')]=_0x4475c2['type'];this['dialQueueTimeout']=_0x4475c2[_0x5282('0xe')]||0x3;this[_0x5282('0xf')]=_0x4272d4[_0x5282('0xf')];this[_0x5282('0x10')]=_0x4272d4[_0x5282('0x10')];this['countcongestionretry']=_0x4272d4[_0x5282('0x11')];this[_0x5282('0x12')]=_0x4272d4[_0x5282('0x12')];this[_0x5282('0x13')]=_0x4272d4[_0x5282('0x13')];this[_0x5282('0x14')]=_0x4272d4[_0x5282('0x14')];this[_0x5282('0x15')]=_0x4272d4[_0x5282('0x15')];this[_0x5282('0x16')]=_0x4272d4[_0x5282('0x16')];this[_0x5282('0x17')]=_0x4272d4['countagentrejectretry'];this[_0x5282('0x18')]=_0x4272d4[_0x5282('0x18')];this['ListId']=_0x4272d4[_0x5282('0x19')];this['UserId']=_0x4272d4['UserId'];this[_0x5282('0x1a')]=_0x4272d4['VoiceQueueId'];this[_0x5282('0x1b')]=_0x4272d4[_0x5282('0x1b')];this[_0x5282('0x1c')]=_0x4272d4['id'];this[_0x5282('0x1d')]=_0x4272d4[_0x5282('0x7')][_0x5282('0x8')]||'';this[_0x5282('0x1e')]=moment()[_0x5282('0x1f')](_0x5282('0x20'));this[_0x5282('0x21')]=_0x4272d4[_0x5282('0x21')];this[_0x5282('0x22')]=_0x4272d4[_0x5282('0x22')];this[_0x5282('0x23')]=_0x4272d4['callbackat'];this['recallme']=_0x4272d4['recallme'];this[_0x5282('0x24')]='';this[_0x5282('0x25')]='';}Action[_0x5282('0x26')][_0x5282('0x27')]=function(){return util[_0x5282('0x1f')]('\x22%s\x22\x20<%s>',this[_0x5282('0x6')],this[_0x5282('0x28')][_0x5282('0x29')]>0x0?this[_0x5282('0x9')][_0x5282('0x2a')](this[_0x5282('0x28')][_0x5282('0x29')]):this[_0x5282('0x9')]);};Action[_0x5282('0x26')]['getQueue']=function(){return this[_0x5282('0xb')];};module['exports']=Action; \ No newline at end of file +var _0xe8d7=['idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','lodash','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x5d05c6,_0x482c6e){var _0x52403a=function(_0x256a97){while(--_0x256a97){_0x5d05c6['push'](_0x5d05c6['shift']());}};_0x52403a(++_0x482c6e);}(_0xe8d7,0x1dc));var _0x7e8d=function(_0x3bc4c9,_0x4d7cfe){_0x3bc4c9=_0x3bc4c9-0x0;var _0x29cdea=_0xe8d7[_0x3bc4c9];return _0x29cdea;};'use strict';var util=require(_0x7e8d('0x0'));var _=require(_0x7e8d('0x1'));var moment=require('moment');function checkNameSurname(_0x330879,_0xfce4d1,_0x53b955){var _0x3a316c='';if(!_[_0x7e8d('0x2')](_0xfce4d1)&&'string'===typeof _0xfce4d1){_0x3a316c+=_0xfce4d1;}if(!_[_0x7e8d('0x2')](_0x53b955)&&_0x7e8d('0x3')===typeof _0x53b955){_0x3a316c+='\x20'+_0x53b955;}if(_0x3a316c!==''){return _0x3a316c;}return _0x330879;}function Action(_0x475648,_0x11422e,_0x1efacf){this[_0x7e8d('0x4')]=_0x475648;this['uniqueid']=_0x1efacf||undefined;this[_0x7e8d('0x5')]=checkNameSurname(_0x11422e[_0x7e8d('0x6')][_0x7e8d('0x7')],_0x11422e[_0x7e8d('0x6')][_0x7e8d('0x8')],_0x11422e['Contact'][_0x7e8d('0x9')]);this[_0x7e8d('0xa')]=_0x11422e['phone'];this[_0x7e8d('0xb')]=_0x475648[_0x7e8d('0x5')];this[_0x7e8d('0xc')]=_0x11422e['active']||![];this['type']=_0x475648[_0x7e8d('0xd')];this['dialQueueTimeout']=_0x475648[_0x7e8d('0xe')]||0x3;this[_0x7e8d('0xf')]=_0x11422e[_0x7e8d('0xf')];this[_0x7e8d('0x10')]=_0x11422e[_0x7e8d('0x10')];this[_0x7e8d('0x11')]=_0x11422e[_0x7e8d('0x11')];this[_0x7e8d('0x12')]=_0x11422e[_0x7e8d('0x12')];this[_0x7e8d('0x13')]=_0x11422e[_0x7e8d('0x13')];this[_0x7e8d('0x14')]=_0x11422e[_0x7e8d('0x14')];this[_0x7e8d('0x15')]=_0x11422e[_0x7e8d('0x15')];this[_0x7e8d('0x16')]=_0x11422e[_0x7e8d('0x16')];this[_0x7e8d('0x17')]=_0x11422e[_0x7e8d('0x17')];this['ContactId']=_0x11422e['ContactId'];this[_0x7e8d('0x18')]=_0x11422e[_0x7e8d('0x18')];this['UserId']=_0x11422e[_0x7e8d('0x19')];this['VoiceQueueId']=_0x11422e[_0x7e8d('0x1a')];this[_0x7e8d('0x1b')]=_0x11422e[_0x7e8d('0x1b')];this[_0x7e8d('0x1c')]=_0x11422e['id'];this[_0x7e8d('0x1d')]=_0x11422e[_0x7e8d('0x6')]['firstName']||'';this[_0x7e8d('0x1e')]=moment()[_0x7e8d('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x11422e[_0x7e8d('0x20')];this[_0x7e8d('0x21')]=_0x11422e[_0x7e8d('0x21')];this[_0x7e8d('0x22')]=_0x11422e[_0x7e8d('0x22')];this['recallme']=_0x11422e['recallme'];this[_0x7e8d('0x23')]='';this[_0x7e8d('0x24')]='';}Action['prototype'][_0x7e8d('0x25')]=function(){return util['format'](_0x7e8d('0x26'),this['name'],this[_0x7e8d('0x4')][_0x7e8d('0x27')]>0x0?this['number']['substring'](this[_0x7e8d('0x4')]['dialCutDigit']):this[_0x7e8d('0xa')]);};Action['prototype'][_0x7e8d('0x28')]=function(){return this['queue'];};module[_0x7e8d('0x29')]=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 6aa6623..a988f87 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 _0x1d7a=['endtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime'];(function(_0x3b331a,_0x57ad96){var _0x1d0e49=function(_0xe3029a){while(--_0xe3029a){_0x3b331a['push'](_0x3b331a['shift']());}};_0x1d0e49(++_0x57ad96);}(_0x1d7a,0x149));var _0xa1d7=function(_0x3033a,_0x481c8e){_0x3033a=_0x3033a-0x0;var _0x10c4a7=_0x1d7a[_0x3033a];return _0x10c4a7;};'use strict';var moment=require(_0xa1d7('0x0'));var utils=require(_0xa1d7('0x1'));function AgentComplete(_0x2022bd,_0x1affd7){this[_0xa1d7('0x2')]=0x4;this[_0xa1d7('0x3')]=_0xa1d7('0x4');this[_0xa1d7('0x5')]=_0x2022bd[_0xa1d7('0x5')];this[_0xa1d7('0x6')]=_0x2022bd[_0xa1d7('0x6')];this[_0xa1d7('0x7')]=_0x2022bd[_0xa1d7('0x6')]===_0xa1d7('0x8')?_0xa1d7('0x9'):_0x2022bd[_0xa1d7('0x6')];this['countbusyretry']=_0x2022bd[_0xa1d7('0xa')];this['countcongestionretry']=_0x2022bd[_0xa1d7('0xb')];this['countnoanswerretry']=_0x2022bd[_0xa1d7('0xc')];this[_0xa1d7('0xd')]=_0x2022bd[_0xa1d7('0xa')]+_0x2022bd['countcongestionretry']+_0x2022bd[_0xa1d7('0xc')]+_0x2022bd[_0xa1d7('0xe')]+_0x2022bd[_0xa1d7('0xf')]+_0x2022bd['countabandonedretry']+_0x2022bd[_0xa1d7('0x10')]+_0x2022bd[_0xa1d7('0x11')];this[_0xa1d7('0xe')]=_0x2022bd[_0xa1d7('0xe')];this['countdropretry']=_0x2022bd[_0xa1d7('0xf')];this[_0xa1d7('0x12')]=_0x2022bd[_0xa1d7('0x12')];this[_0xa1d7('0x10')]=_0x2022bd[_0xa1d7('0x10')];this[_0xa1d7('0x11')]=_0x2022bd[_0xa1d7('0x11')];this[_0xa1d7('0x13')]=_0x1affd7['uniqueid'];this[_0xa1d7('0x14')]=_0x2022bd[_0xa1d7('0x15')];this['calleridnum']=_0x2022bd[_0xa1d7('0x16')];this[_0xa1d7('0x17')]=_0x2022bd['starttime'];this[_0xa1d7('0x18')]=_0x2022bd[_0xa1d7('0x18')];this[_0xa1d7('0x19')]=_0x2022bd[_0xa1d7('0x19')];this['endtime']=moment()[_0xa1d7('0x1a')](_0xa1d7('0x1b'));this[_0xa1d7('0x1c')]=utils[_0xa1d7('0x1d')](_0x2022bd['responsetime'],_0x2022bd[_0xa1d7('0x17')]);this['holdtime']=utils[_0xa1d7('0x1d')](_0x2022bd[_0xa1d7('0x19')],_0x2022bd['responsetime']);this[_0xa1d7('0x1e')]=utils[_0xa1d7('0x1d')](this[_0xa1d7('0x1f')],_0x2022bd[_0xa1d7('0x19')]);this['queue']=_0x1affd7['queue'];this[_0xa1d7('0x20')]=_0x1affd7[_0xa1d7('0x20')];this['reason']=_0x1affd7[_0xa1d7('0x21')];this[_0xa1d7('0x22')]=_0x2022bd['callback'];this[_0xa1d7('0x23')]=_0x2022bd[_0xa1d7('0x23')];this['callbackat']=_0x2022bd['callbackat'];this[_0xa1d7('0x24')]=_0x2022bd[_0xa1d7('0x24')];this[_0xa1d7('0x25')]=_0x2022bd['ContactId'];this[_0xa1d7('0x26')]=_0x2022bd[_0xa1d7('0x26')];this[_0xa1d7('0x27')]=_0x2022bd[_0xa1d7('0x27')];this['VoiceQueueId']=_0x2022bd[_0xa1d7('0x28')];this[_0xa1d7('0x29')]=_0x2022bd[_0xa1d7('0x29')];this[_0xa1d7('0x2a')]=_0x2022bd[_0xa1d7('0x2a')]||'';this[_0xa1d7('0x2b')]=_0x2022bd[_0xa1d7('0x2b')]||'';this['agiafterat']=_0x2022bd[_0xa1d7('0x2c')];}module['exports']=AgentComplete; \ No newline at end of file +var _0xabc7=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x31f2a0,_0x43dc59){var _0x593ed1=function(_0x5d3147){while(--_0x5d3147){_0x31f2a0['push'](_0x31f2a0['shift']());}};_0x593ed1(++_0x43dc59);}(_0xabc7,0x80));var _0x7abc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabc7[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require(_0x7abc('0x0'));var utils=require('../utils');function AgentComplete(_0x5bf476,_0x10b255){this[_0x7abc('0x1')]=0x4;this['statedesc']=_0x7abc('0x2');this[_0x7abc('0x3')]=_0x5bf476[_0x7abc('0x3')];this[_0x7abc('0x4')]=_0x5bf476['type'];this[_0x7abc('0x5')]=_0x5bf476['type']===_0x7abc('0x6')?_0x7abc('0x7'):_0x5bf476[_0x7abc('0x4')];this['countbusyretry']=_0x5bf476[_0x7abc('0x8')];this[_0x7abc('0x9')]=_0x5bf476[_0x7abc('0x9')];this[_0x7abc('0xa')]=_0x5bf476[_0x7abc('0xa')];this[_0x7abc('0xb')]=_0x5bf476['countbusyretry']+_0x5bf476[_0x7abc('0x9')]+_0x5bf476['countnoanswerretry']+_0x5bf476[_0x7abc('0xc')]+_0x5bf476['countdropretry']+_0x5bf476[_0x7abc('0xd')]+_0x5bf476['countmachineretry']+_0x5bf476['countagentrejectretry'];this['countnosuchnumberretry']=_0x5bf476['countnosuchnumberretry'];this[_0x7abc('0xe')]=_0x5bf476['countdropretry'];this[_0x7abc('0xd')]=_0x5bf476[_0x7abc('0xd')];this[_0x7abc('0xf')]=_0x5bf476[_0x7abc('0xf')];this[_0x7abc('0x10')]=_0x5bf476[_0x7abc('0x10')];this[_0x7abc('0x11')]=_0x10b255[_0x7abc('0x11')];this[_0x7abc('0x12')]=_0x5bf476[_0x7abc('0x13')];this['calleridnum']=_0x5bf476[_0x7abc('0x14')];this['starttime']=_0x5bf476[_0x7abc('0x15')];this[_0x7abc('0x16')]=_0x5bf476[_0x7abc('0x16')];this[_0x7abc('0x17')]=_0x5bf476[_0x7abc('0x17')];this[_0x7abc('0x18')]=moment()[_0x7abc('0x19')](_0x7abc('0x1a'));this[_0x7abc('0x1b')]=utils['getSeconds'](_0x5bf476[_0x7abc('0x16')],_0x5bf476[_0x7abc('0x15')]);this[_0x7abc('0x1c')]=utils['getSeconds'](_0x5bf476['answertime'],_0x5bf476[_0x7abc('0x16')]);this[_0x7abc('0x1d')]=utils[_0x7abc('0x1e')](this[_0x7abc('0x18')],_0x5bf476[_0x7abc('0x17')]);this[_0x7abc('0x7')]=_0x10b255[_0x7abc('0x7')];this[_0x7abc('0x1f')]=_0x10b255['membername'];this[_0x7abc('0x20')]=_0x10b255['reason'];this[_0x7abc('0x21')]=_0x5bf476[_0x7abc('0x21')];this[_0x7abc('0x22')]=_0x5bf476[_0x7abc('0x22')];this['callbackat']=_0x5bf476[_0x7abc('0x23')];this[_0x7abc('0x24')]=_0x5bf476[_0x7abc('0x24')];this[_0x7abc('0x25')]=_0x5bf476['ContactId'];this['ListId']=_0x5bf476[_0x7abc('0x26')];this[_0x7abc('0x27')]=_0x5bf476[_0x7abc('0x27')];this[_0x7abc('0x28')]=_0x5bf476['VoiceQueueId'];this['CampaignId']=_0x5bf476['CampaignId'];this['originatecalleridnum']=_0x5bf476[_0x7abc('0x29')]||'';this[_0x7abc('0x2a')]=_0x5bf476[_0x7abc('0x2a')]||'';this[_0x7abc('0x2b')]=_0x5bf476[_0x7abc('0x2b')];}module[_0x7abc('0x2c')]=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 b75ec0a..e5e8d58 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 _0xe089=['uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports'];(function(_0xb66e09,_0x4c5ca7){var _0x1cf84e=function(_0x4abfc4){while(--_0x4abfc4){_0xb66e09['push'](_0xb66e09['shift']());}};_0x1cf84e(++_0x4c5ca7);}(_0xe089,0x118));var _0x9e08=function(_0x522aef,_0x48e7ea){_0x522aef=_0x522aef-0x0;var _0x224108=_0xe089[_0x522aef];return _0x224108;};'use strict';function Final(_0x11b021){this['uniqueid']=_0x11b021[_0x9e08('0x0')];this['scheduledat']=_0x11b021[_0x9e08('0x1')];this[_0x9e08('0x2')]=_0x11b021['type'];this[_0x9e08('0x3')]=_0x11b021[_0x9e08('0x2')]===_0x9e08('0x4')?'queue':_0x11b021[_0x9e08('0x2')];this[_0x9e08('0x5')]=_0x11b021[_0x9e08('0x5')];this[_0x9e08('0x6')]=_0x11b021['countcongestionretry'];this[_0x9e08('0x7')]=_0x11b021[_0x9e08('0x7')];this[_0x9e08('0x8')]=_0x11b021[_0x9e08('0x5')]+_0x11b021[_0x9e08('0x6')]+_0x11b021['countnoanswerretry']+_0x11b021[_0x9e08('0x9')]+_0x11b021[_0x9e08('0xa')]+_0x11b021[_0x9e08('0xb')]+_0x11b021[_0x9e08('0xc')]+_0x11b021[_0x9e08('0xd')];this[_0x9e08('0x9')]=_0x11b021[_0x9e08('0x9')];this[_0x9e08('0xa')]=_0x11b021[_0x9e08('0xa')];this[_0x9e08('0xb')]=_0x11b021['countabandonedretry'];this[_0x9e08('0xc')]=_0x11b021[_0x9e08('0xc')];this[_0x9e08('0xd')]=_0x11b021[_0x9e08('0xd')];this[_0x9e08('0xe')]=_0x11b021[_0x9e08('0xe')];this[_0x9e08('0xf')]=_0x11b021['calleridname'];this[_0x9e08('0x10')]=_0x11b021[_0x9e08('0x10')];this['starttime']=_0x11b021[_0x9e08('0x11')];this[_0x9e08('0x12')]=_0x11b021[_0x9e08('0x12')];this[_0x9e08('0x13')]=_0x11b021[_0x9e08('0x12')];this['ringtime']=_0x11b021['ringtime']||0x0;this[_0x9e08('0x14')]=_0x11b021[_0x9e08('0x14')]||0x0;this[_0x9e08('0x15')]=_0x11b021[_0x9e08('0x15')]||0x0;this['callback']=_0x11b021[_0x9e08('0x16')];this[_0x9e08('0x17')]=_0x11b021[_0x9e08('0x17')];this[_0x9e08('0x18')]=_0x11b021[_0x9e08('0x18')];this[_0x9e08('0x19')]=_0x11b021['recallme'];this[_0x9e08('0x1a')]=_0x11b021[_0x9e08('0x1a')];this['ListId']=_0x11b021['ListId'];this[_0x9e08('0x1b')]=_0x11b021[_0x9e08('0x1b')];this[_0x9e08('0x1c')]=_0x11b021['VoiceQueueId'];this['CampaignId']=_0x11b021[_0x9e08('0x1d')];this[_0x9e08('0x1e')]=_0x11b021['originatecalleridnum']||'';this['originatecalleridname']=_0x11b021[_0x9e08('0x1f')]||'';this[_0x9e08('0x20')]=_0x11b021[_0x9e08('0x20')];this[_0x9e08('0x21')]=_0x11b021['statedesc'];}module[_0x9e08('0x22')]=Final; \ No newline at end of file +var _0x58ed=['countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x4b5667,_0x22f053){var _0xf737f5=function(_0x4fde0d){while(--_0x4fde0d){_0x4b5667['push'](_0x4b5667['shift']());}};_0xf737f5(++_0x22f053);}(_0x58ed,0x11c));var _0xd58e=function(_0xb5f367,_0x5bf716){_0xb5f367=_0xb5f367-0x0;var _0x8c031a=_0x58ed[_0xb5f367];return _0x8c031a;};'use strict';function Final(_0x3c6846){this[_0xd58e('0x0')]=_0x3c6846[_0xd58e('0x0')];this[_0xd58e('0x1')]=_0x3c6846[_0xd58e('0x1')];this[_0xd58e('0x2')]=_0x3c6846[_0xd58e('0x2')];this[_0xd58e('0x3')]=_0x3c6846[_0xd58e('0x2')]==='outbound'?_0xd58e('0x4'):_0x3c6846['type'];this['countbusyretry']=_0x3c6846[_0xd58e('0x5')];this[_0xd58e('0x6')]=_0x3c6846[_0xd58e('0x6')];this[_0xd58e('0x7')]=_0x3c6846[_0xd58e('0x7')];this[_0xd58e('0x8')]=_0x3c6846[_0xd58e('0x5')]+_0x3c6846[_0xd58e('0x6')]+_0x3c6846['countnoanswerretry']+_0x3c6846[_0xd58e('0x9')]+_0x3c6846[_0xd58e('0xa')]+_0x3c6846[_0xd58e('0xb')]+_0x3c6846[_0xd58e('0xc')]+_0x3c6846['countagentrejectretry'];this['countnosuchnumberretry']=_0x3c6846['countnosuchnumberretry'];this[_0xd58e('0xa')]=_0x3c6846[_0xd58e('0xa')];this[_0xd58e('0xb')]=_0x3c6846['countabandonedretry'];this[_0xd58e('0xc')]=_0x3c6846[_0xd58e('0xc')];this[_0xd58e('0xd')]=_0x3c6846['countagentrejectretry'];this[_0xd58e('0x4')]=_0x3c6846['queue'];this[_0xd58e('0xe')]=_0x3c6846['calleridname'];this[_0xd58e('0xf')]=_0x3c6846[_0xd58e('0xf')];this[_0xd58e('0x10')]=_0x3c6846[_0xd58e('0x10')];this[_0xd58e('0x11')]=_0x3c6846['responsetime'];this[_0xd58e('0x12')]=_0x3c6846[_0xd58e('0x11')];this[_0xd58e('0x13')]=_0x3c6846[_0xd58e('0x13')]||0x0;this[_0xd58e('0x14')]=_0x3c6846[_0xd58e('0x14')]||0x0;this[_0xd58e('0x15')]=_0x3c6846[_0xd58e('0x15')]||0x0;this[_0xd58e('0x16')]=_0x3c6846[_0xd58e('0x16')];this[_0xd58e('0x17')]=_0x3c6846[_0xd58e('0x17')];this[_0xd58e('0x18')]=_0x3c6846['callbackat'];this['recallme']=_0x3c6846['recallme'];this['ContactId']=_0x3c6846[_0xd58e('0x19')];this[_0xd58e('0x1a')]=_0x3c6846[_0xd58e('0x1a')];this['UserId']=_0x3c6846['UserId'];this[_0xd58e('0x1b')]=_0x3c6846[_0xd58e('0x1b')];this['CampaignId']=_0x3c6846[_0xd58e('0x1c')];this['originatecalleridnum']=_0x3c6846[_0xd58e('0x1d')]||'';this[_0xd58e('0x1e')]=_0x3c6846[_0xd58e('0x1e')]||'';this['state']=_0x3c6846['state'];this[_0xd58e('0x1f')]=_0x3c6846[_0xd58e('0x1f')];}module[_0xd58e('0x20')]=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 5ce3f13..50c3e6a 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 _0x3880=['UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x4f2aad,_0x46faac){var _0x296ac8=function(_0x559c2a){while(--_0x559c2a){_0x4f2aad['push'](_0x4f2aad['shift']());}};_0x296ac8(++_0x46faac);}(_0x3880,0x88));var _0x0388=function(_0x5d9c69,_0x4a6f2a){_0x5d9c69=_0x5d9c69-0x0;var _0x2e9358=_0x3880[_0x5d9c69];return _0x2e9358;};'use strict';var moment=require(_0x0388('0x0'));var utils=require(_0x0388('0x1'));function Hangup(_0x2d39b6,_0x49a37e){this[_0x0388('0x2')]=0x4;this[_0x0388('0x3')]=_0x0388('0x4');this[_0x0388('0x5')]=_0x2d39b6[_0x0388('0x5')];this['type']=_0x2d39b6[_0x0388('0x6')];this[_0x0388('0x7')]=_0x2d39b6[_0x0388('0x6')]===_0x0388('0x8')?_0x0388('0x9'):_0x2d39b6['type'];this[_0x0388('0xa')]=_0x2d39b6[_0x0388('0xa')]||![];this[_0x0388('0xb')]=_0x2d39b6[_0x0388('0xb')];this[_0x0388('0xc')]=_0x2d39b6[_0x0388('0xc')];this[_0x0388('0xd')]=_0x2d39b6['countnoanswerretry'];this[_0x0388('0xe')]=_0x2d39b6[_0x0388('0xb')]+_0x2d39b6['countcongestionretry']+_0x2d39b6[_0x0388('0xd')]+_0x2d39b6[_0x0388('0xf')]+_0x2d39b6[_0x0388('0x10')]+_0x2d39b6[_0x0388('0x11')]+_0x2d39b6[_0x0388('0x12')]+_0x2d39b6[_0x0388('0x13')];this[_0x0388('0xf')]=_0x2d39b6[_0x0388('0xf')];this[_0x0388('0x10')]=_0x2d39b6[_0x0388('0x10')];this[_0x0388('0x11')]=_0x2d39b6[_0x0388('0x11')];this['countmachineretry']=_0x2d39b6[_0x0388('0x12')];this[_0x0388('0x13')]=_0x2d39b6[_0x0388('0x13')];this[_0x0388('0x14')]=_0x49a37e[_0x0388('0x14')];this[_0x0388('0x15')]=_0x2d39b6['name'];this[_0x0388('0x16')]=_0x2d39b6[_0x0388('0x17')];this['starttime']=_0x2d39b6[_0x0388('0x18')];this[_0x0388('0x19')]=_0x2d39b6['responsetime'];this[_0x0388('0x1a')]=moment()[_0x0388('0x1b')](_0x0388('0x1c'));this[_0x0388('0x1d')]=utils[_0x0388('0x1e')](_0x2d39b6[_0x0388('0x19')],_0x2d39b6[_0x0388('0x18')]);this['holdtime']=0x0;this[_0x0388('0x1f')]=utils[_0x0388('0x1e')](this[_0x0388('0x1a')],_0x2d39b6[_0x0388('0x19')]);this[_0x0388('0x9')]=_0x2d39b6[_0x0388('0x9')];this[_0x0388('0x20')]='IVR';this['reason']=_0x49a37e[_0x0388('0x21')];this[_0x0388('0x22')]=_0x2d39b6[_0x0388('0x22')];this[_0x0388('0x23')]=_0x2d39b6['callbackuniqueid'];this[_0x0388('0x24')]=_0x2d39b6['callbackat'];this[_0x0388('0x25')]=_0x2d39b6['recallme'];this[_0x0388('0x26')]=_0x2d39b6[_0x0388('0x26')];this['ListId']=_0x2d39b6[_0x0388('0x27')];this[_0x0388('0x28')]=_0x2d39b6['UserId'];this[_0x0388('0x29')]=_0x2d39b6[_0x0388('0x29')];this['CampaignId']=_0x2d39b6[_0x0388('0x2a')];}module[_0x0388('0x2b')]=Hangup; \ No newline at end of file +var _0x0a13=['outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','endtime','queue','membername','IVR','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype'];(function(_0x2dc39a,_0x4ed570){var _0x599bc1=function(_0x2bda94){while(--_0x2bda94){_0x2dc39a['push'](_0x2dc39a['shift']());}};_0x599bc1(++_0x4ed570);}(_0x0a13,0x161));var _0x30a1=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x0a13[_0x32e264];return _0x1d7175;};'use strict';var moment=require(_0x30a1('0x0'));var utils=require(_0x30a1('0x1'));function Hangup(_0x20e9bf,_0x3fcfdf){this[_0x30a1('0x2')]=0x4;this['statedesc']=_0x30a1('0x3');this['scheduledat']=_0x20e9bf[_0x30a1('0x4')];this[_0x30a1('0x5')]=_0x20e9bf[_0x30a1('0x5')];this[_0x30a1('0x6')]=_0x20e9bf[_0x30a1('0x5')]===_0x30a1('0x7')?'queue':_0x20e9bf[_0x30a1('0x5')];this['amd']=_0x20e9bf[_0x30a1('0x8')]||![];this['countbusyretry']=_0x20e9bf[_0x30a1('0x9')];this[_0x30a1('0xa')]=_0x20e9bf[_0x30a1('0xa')];this['countnoanswerretry']=_0x20e9bf[_0x30a1('0xb')];this[_0x30a1('0xc')]=_0x20e9bf['countbusyretry']+_0x20e9bf[_0x30a1('0xa')]+_0x20e9bf[_0x30a1('0xb')]+_0x20e9bf[_0x30a1('0xd')]+_0x20e9bf['countdropretry']+_0x20e9bf[_0x30a1('0xe')]+_0x20e9bf['countmachineretry']+_0x20e9bf['countagentrejectretry'];this[_0x30a1('0xd')]=_0x20e9bf[_0x30a1('0xd')];this[_0x30a1('0xf')]=_0x20e9bf['countdropretry'];this['countabandonedretry']=_0x20e9bf[_0x30a1('0xe')];this[_0x30a1('0x10')]=_0x20e9bf[_0x30a1('0x10')];this[_0x30a1('0x11')]=_0x20e9bf['countagentrejectretry'];this[_0x30a1('0x12')]=_0x3fcfdf[_0x30a1('0x12')];this[_0x30a1('0x13')]=_0x20e9bf[_0x30a1('0x14')];this[_0x30a1('0x15')]=_0x20e9bf['number'];this['starttime']=_0x20e9bf[_0x30a1('0x16')];this['responsetime']=_0x20e9bf[_0x30a1('0x17')];this['endtime']=moment()[_0x30a1('0x18')](_0x30a1('0x19'));this['ringtime']=utils[_0x30a1('0x1a')](_0x20e9bf[_0x30a1('0x17')],_0x20e9bf[_0x30a1('0x16')]);this['holdtime']=0x0;this[_0x30a1('0x1b')]=utils[_0x30a1('0x1a')](this[_0x30a1('0x1c')],_0x20e9bf[_0x30a1('0x17')]);this[_0x30a1('0x1d')]=_0x20e9bf['queue'];this[_0x30a1('0x1e')]=_0x30a1('0x1f');this['reason']=_0x3fcfdf['cause-txt'];this[_0x30a1('0x20')]=_0x20e9bf[_0x30a1('0x20')];this['callbackuniqueid']=_0x20e9bf[_0x30a1('0x21')];this[_0x30a1('0x22')]=_0x20e9bf[_0x30a1('0x22')];this['recallme']=_0x20e9bf['recallme'];this[_0x30a1('0x23')]=_0x20e9bf[_0x30a1('0x23')];this[_0x30a1('0x24')]=_0x20e9bf[_0x30a1('0x24')];this[_0x30a1('0x25')]=_0x20e9bf[_0x30a1('0x25')];this[_0x30a1('0x26')]=_0x20e9bf[_0x30a1('0x26')];this['CampaignId']=_0x20e9bf['CampaignId'];}module[_0x30a1('0x27')]=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 5d6c6d6..b02f795 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 _0xb04d=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid'];(function(_0x464c8a,_0x53445a){var _0x3c9bca=function(_0x617bb){while(--_0x617bb){_0x464c8a['push'](_0x464c8a['shift']());}};_0x3c9bca(++_0x53445a);}(_0xb04d,0xee));var _0xdb04=function(_0x1ae5d0,_0x51b9a6){_0x1ae5d0=_0x1ae5d0-0x0;var _0x5f02c1=_0xb04d[_0x1ae5d0];return _0x5f02c1;};'use strict';var utils=require(_0xdb04('0x0'));function History(_0x2ede5c){this['uniqueid']=_0x2ede5c[_0xdb04('0x1')];this['scheduledat']=_0x2ede5c[_0xdb04('0x2')]||undefined;this['type']=_0x2ede5c[_0xdb04('0x3')];this[_0xdb04('0x4')]=_0x2ede5c[_0xdb04('0x3')]===_0xdb04('0x5')?_0xdb04('0x6'):_0x2ede5c[_0xdb04('0x3')];this['countbusyretry']=_0x2ede5c[_0xdb04('0x7')];this[_0xdb04('0x8')]=_0x2ede5c[_0xdb04('0x8')];this[_0xdb04('0x9')]=_0x2ede5c['countnoanswerretry'];this[_0xdb04('0xa')]=_0x2ede5c[_0xdb04('0x7')]+_0x2ede5c[_0xdb04('0x8')]+_0x2ede5c[_0xdb04('0x9')]+_0x2ede5c[_0xdb04('0xb')]+_0x2ede5c['countdropretry']+_0x2ede5c[_0xdb04('0xc')]+_0x2ede5c[_0xdb04('0xd')]+_0x2ede5c['countagentrejectretry'];this[_0xdb04('0xb')]=_0x2ede5c['countnosuchnumberretry'];this[_0xdb04('0xe')]=_0x2ede5c[_0xdb04('0xe')];this['countabandonedretry']=_0x2ede5c['countabandonedretry'];this[_0xdb04('0xd')]=_0x2ede5c['countmachineretry'];this[_0xdb04('0xf')]=_0x2ede5c[_0xdb04('0xf')];this[_0xdb04('0x6')]=_0x2ede5c[_0xdb04('0x6')];this[_0xdb04('0x10')]=_0x2ede5c[_0xdb04('0x11')];this[_0xdb04('0x12')]=_0x2ede5c[_0xdb04('0x13')];this[_0xdb04('0x14')]=_0x2ede5c[_0xdb04('0x14')];this[_0xdb04('0x15')]=_0x2ede5c[_0xdb04('0x15')];this[_0xdb04('0x16')]=_0x2ede5c[_0xdb04('0x15')];this[_0xdb04('0x17')]=utils[_0xdb04('0x18')](_0x2ede5c[_0xdb04('0x15')],_0x2ede5c[_0xdb04('0x14')]);this['holdtime']=0x0;this[_0xdb04('0x19')]=0x0;this['callback']=_0x2ede5c[_0xdb04('0x1a')];this[_0xdb04('0x1b')]=_0x2ede5c[_0xdb04('0x1b')];this[_0xdb04('0x1c')]=_0x2ede5c[_0xdb04('0x1c')];this[_0xdb04('0x1d')]=_0x2ede5c[_0xdb04('0x1d')];this[_0xdb04('0x1e')]=_0x2ede5c[_0xdb04('0x1e')];this[_0xdb04('0x1f')]=_0x2ede5c['ListId'];this[_0xdb04('0x20')]=_0x2ede5c[_0xdb04('0x20')];this[_0xdb04('0x21')]=_0x2ede5c[_0xdb04('0x21')];this[_0xdb04('0x22')]=_0x2ede5c[_0xdb04('0x22')];this[_0xdb04('0x23')]=_0x2ede5c[_0xdb04('0x23')]||'';this[_0xdb04('0x24')]=_0x2ede5c[_0xdb04('0x24')]||'';this[_0xdb04('0x25')]=_0x2ede5c[_0xdb04('0x25')];this['statedesc']=_0x2ede5c[_0xdb04('0x26')];}module[_0xdb04('0x27')]=History; \ No newline at end of file +var _0x4328=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime'];(function(_0x2ead7c,_0x19d844){var _0x3561a5=function(_0x2daff8){while(--_0x2daff8){_0x2ead7c['push'](_0x2ead7c['shift']());}};_0x3561a5(++_0x19d844);}(_0x4328,0x199));var _0x8432=function(_0x511efc,_0x46bfcb){_0x511efc=_0x511efc-0x0;var _0x4db0ce=_0x4328[_0x511efc];return _0x4db0ce;};'use strict';var utils=require(_0x8432('0x0'));function History(_0x5ec68f){this[_0x8432('0x1')]=_0x5ec68f[_0x8432('0x1')];this[_0x8432('0x2')]=_0x5ec68f[_0x8432('0x2')]||undefined;this[_0x8432('0x3')]=_0x5ec68f[_0x8432('0x3')];this[_0x8432('0x4')]=_0x5ec68f[_0x8432('0x3')]===_0x8432('0x5')?_0x8432('0x6'):_0x5ec68f[_0x8432('0x3')];this[_0x8432('0x7')]=_0x5ec68f[_0x8432('0x7')];this['countcongestionretry']=_0x5ec68f['countcongestionretry'];this['countnoanswerretry']=_0x5ec68f['countnoanswerretry'];this[_0x8432('0x8')]=_0x5ec68f[_0x8432('0x7')]+_0x5ec68f['countcongestionretry']+_0x5ec68f[_0x8432('0x9')]+_0x5ec68f[_0x8432('0xa')]+_0x5ec68f[_0x8432('0xb')]+_0x5ec68f[_0x8432('0xc')]+_0x5ec68f['countmachineretry']+_0x5ec68f[_0x8432('0xd')];this[_0x8432('0xa')]=_0x5ec68f[_0x8432('0xa')];this[_0x8432('0xb')]=_0x5ec68f[_0x8432('0xb')];this['countabandonedretry']=_0x5ec68f[_0x8432('0xc')];this[_0x8432('0xe')]=_0x5ec68f[_0x8432('0xe')];this['countagentrejectretry']=_0x5ec68f[_0x8432('0xd')];this[_0x8432('0x6')]=_0x5ec68f[_0x8432('0x6')];this[_0x8432('0xf')]=_0x5ec68f[_0x8432('0x10')];this[_0x8432('0x11')]=_0x5ec68f[_0x8432('0x12')];this[_0x8432('0x13')]=_0x5ec68f['starttime'];this['responsetime']=_0x5ec68f[_0x8432('0x14')];this[_0x8432('0x15')]=_0x5ec68f['responsetime'];this['ringtime']=utils['getSeconds'](_0x5ec68f[_0x8432('0x14')],_0x5ec68f[_0x8432('0x13')]);this[_0x8432('0x16')]=0x0;this[_0x8432('0x17')]=0x0;this[_0x8432('0x18')]=_0x5ec68f['callback'];this[_0x8432('0x19')]=_0x5ec68f[_0x8432('0x19')];this['callbackat']=_0x5ec68f[_0x8432('0x1a')];this[_0x8432('0x1b')]=_0x5ec68f[_0x8432('0x1b')];this[_0x8432('0x1c')]=_0x5ec68f[_0x8432('0x1c')];this['ListId']=_0x5ec68f['ListId'];this[_0x8432('0x1d')]=_0x5ec68f[_0x8432('0x1d')];this['VoiceQueueId']=_0x5ec68f[_0x8432('0x1e')];this[_0x8432('0x1f')]=_0x5ec68f[_0x8432('0x1f')];this['originatecalleridnum']=_0x5ec68f[_0x8432('0x20')]||'';this[_0x8432('0x21')]=_0x5ec68f[_0x8432('0x21')]||'';this[_0x8432('0x22')]=_0x5ec68f[_0x8432('0x22')];this[_0x8432('0x23')]=_0x5ec68f[_0x8432('0x23')];}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 eaef157..6e2221b 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 _0x3ba7=['originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3ba7,0x16c));var _0x73ba=function(_0x293ac8,_0x50fd52){_0x293ac8=_0x293ac8-0x0;var _0x50aad6=_0x3ba7[_0x293ac8];return _0x50aad6;};'use strict';var utils=require(_0x73ba('0x0'));function QueueCallerAbandon(_0x30dbac,_0x5a8cd1){this[_0x73ba('0x1')]=_0x30dbac[_0x73ba('0x1')];this[_0x73ba('0x2')]=_0x30dbac[_0x73ba('0x2')];this[_0x73ba('0x3')]=_0x30dbac[_0x73ba('0x2')]==='outbound'?_0x73ba('0x4'):_0x30dbac[_0x73ba('0x2')];this[_0x73ba('0x5')]=_0x30dbac[_0x73ba('0x5')];this[_0x73ba('0x6')]=_0x30dbac[_0x73ba('0x6')];this[_0x73ba('0x7')]=_0x30dbac['countnoanswerretry'];this[_0x73ba('0x8')]=_0x30dbac[_0x73ba('0x5')]+_0x30dbac[_0x73ba('0x6')]+_0x30dbac[_0x73ba('0x7')]+_0x30dbac[_0x73ba('0x9')]+_0x30dbac[_0x73ba('0xa')]+_0x30dbac['countabandonedretry']+_0x30dbac[_0x73ba('0xb')]+_0x30dbac[_0x73ba('0xc')];this[_0x73ba('0x9')]=_0x30dbac[_0x73ba('0x9')];this[_0x73ba('0xa')]=_0x30dbac[_0x73ba('0xa')];this[_0x73ba('0xd')]=_0x30dbac[_0x73ba('0xd')];this['countmachineretry']=_0x30dbac['countmachineretry'];this[_0x73ba('0xc')]=_0x30dbac['countagentrejectretry'];this[_0x73ba('0xe')]=_0x5a8cd1[_0x73ba('0xe')];this[_0x73ba('0xf')]=_0x30dbac[_0x73ba('0x10')];this[_0x73ba('0x11')]=_0x30dbac[_0x73ba('0x12')];this[_0x73ba('0x13')]=_0x30dbac[_0x73ba('0x13')];this[_0x73ba('0x14')]=_0x30dbac['responsetime'];this[_0x73ba('0x15')]=_0x30dbac[_0x73ba('0x15')];this[_0x73ba('0x16')]=_0x30dbac[_0x73ba('0x16')];this['endtime']=this[_0x73ba('0x15')];this[_0x73ba('0x17')]=utils[_0x73ba('0x18')](_0x30dbac[_0x73ba('0x14')],_0x30dbac[_0x73ba('0x13')]);this['holdtime']=utils[_0x73ba('0x18')](this[_0x73ba('0x15')],_0x30dbac[_0x73ba('0x14')]);this['talktime']=0x0;this['queue']=_0x5a8cd1['queue'];this[_0x73ba('0x19')]=_0x5a8cd1[_0x73ba('0x1a')];this[_0x73ba('0x1b')]=_0x5a8cd1['reason'];this[_0x73ba('0x1c')]=_0x30dbac[_0x73ba('0x1c')];this[_0x73ba('0x1d')]=_0x30dbac[_0x73ba('0x1d')];this[_0x73ba('0x1e')]=_0x30dbac[_0x73ba('0x1e')];this[_0x73ba('0x1f')]=_0x30dbac['recallme'];this['ContactId']=_0x30dbac['ContactId'];this['ListId']=_0x30dbac[_0x73ba('0x20')];this[_0x73ba('0x21')]=_0x30dbac[_0x73ba('0x21')];this[_0x73ba('0x22')]=_0x30dbac[_0x73ba('0x22')];this[_0x73ba('0x23')]=_0x30dbac[_0x73ba('0x23')];this['originatecalleridnum']=_0x30dbac['originatecalleridnum']||'';this[_0x73ba('0x24')]=_0x30dbac[_0x73ba('0x24')]||'';this[_0x73ba('0x25')]=_0x30dbac['agiafterat'];this[_0x73ba('0x26')]=_0x30dbac[_0x73ba('0x26')];this[_0x73ba('0x27')]=_0x30dbac[_0x73ba('0x27')];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xc869=['../utils','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','getSeconds','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','statedesc','exports'];(function(_0xa57b21,_0x417e10){var _0x424aaa=function(_0x2022ab){while(--_0x2022ab){_0xa57b21['push'](_0xa57b21['shift']());}};_0x424aaa(++_0x417e10);}(_0xc869,0x17a));var _0x9c86=function(_0x19ce05,_0x15cccb){_0x19ce05=_0x19ce05-0x0;var _0xfb5110=_0xc869[_0x19ce05];return _0xfb5110;};'use strict';var utils=require(_0x9c86('0x0'));function QueueCallerAbandon(_0x3794da,_0x4543cb){this['scheduledat']=_0x3794da['scheduledat'];this['type']=_0x3794da[_0x9c86('0x1')];this[_0x9c86('0x2')]=_0x3794da['type']===_0x9c86('0x3')?'queue':_0x3794da[_0x9c86('0x1')];this[_0x9c86('0x4')]=_0x3794da[_0x9c86('0x4')];this['countcongestionretry']=_0x3794da[_0x9c86('0x5')];this['countnoanswerretry']=_0x3794da['countnoanswerretry'];this[_0x9c86('0x6')]=_0x3794da[_0x9c86('0x4')]+_0x3794da[_0x9c86('0x5')]+_0x3794da[_0x9c86('0x7')]+_0x3794da[_0x9c86('0x8')]+_0x3794da[_0x9c86('0x9')]+_0x3794da['countabandonedretry']+_0x3794da[_0x9c86('0xa')]+_0x3794da[_0x9c86('0xb')];this[_0x9c86('0x8')]=_0x3794da[_0x9c86('0x8')];this[_0x9c86('0x9')]=_0x3794da[_0x9c86('0x9')];this['countabandonedretry']=_0x3794da[_0x9c86('0xc')];this[_0x9c86('0xa')]=_0x3794da[_0x9c86('0xa')];this[_0x9c86('0xb')]=_0x3794da[_0x9c86('0xb')];this['uniqueid']=_0x4543cb[_0x9c86('0xd')];this[_0x9c86('0xe')]=_0x3794da[_0x9c86('0xf')];this[_0x9c86('0x10')]=_0x3794da[_0x9c86('0x11')];this['starttime']=_0x3794da[_0x9c86('0x12')];this['responsetime']=_0x3794da[_0x9c86('0x13')];this[_0x9c86('0x14')]=_0x3794da[_0x9c86('0x14')];this['dropreason']=_0x3794da[_0x9c86('0x15')];this['endtime']=this[_0x9c86('0x14')];this['ringtime']=utils[_0x9c86('0x16')](_0x3794da[_0x9c86('0x13')],_0x3794da[_0x9c86('0x12')]);this[_0x9c86('0x17')]=utils['getSeconds'](this[_0x9c86('0x14')],_0x3794da[_0x9c86('0x13')]);this[_0x9c86('0x18')]=0x0;this[_0x9c86('0x19')]=_0x4543cb[_0x9c86('0x19')];this[_0x9c86('0x1a')]=_0x4543cb[_0x9c86('0x1b')];this[_0x9c86('0x1c')]=_0x4543cb[_0x9c86('0x1c')];this[_0x9c86('0x1d')]=_0x3794da[_0x9c86('0x1d')];this[_0x9c86('0x1e')]=_0x3794da[_0x9c86('0x1e')];this[_0x9c86('0x1f')]=_0x3794da['callbackat'];this[_0x9c86('0x20')]=_0x3794da[_0x9c86('0x20')];this[_0x9c86('0x21')]=_0x3794da[_0x9c86('0x21')];this['ListId']=_0x3794da['ListId'];this[_0x9c86('0x22')]=_0x3794da[_0x9c86('0x22')];this['VoiceQueueId']=_0x3794da[_0x9c86('0x23')];this['CampaignId']=_0x3794da[_0x9c86('0x24')];this[_0x9c86('0x25')]=_0x3794da[_0x9c86('0x25')]||'';this[_0x9c86('0x26')]=_0x3794da[_0x9c86('0x26')]||'';this[_0x9c86('0x27')]=_0x3794da[_0x9c86('0x27')];this['state']=_0x3794da['state'];this[_0x9c86('0x28')]=_0x3794da[_0x9c86('0x28')];}module[_0x9c86('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index cb2fa2f..2f8b1c2 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 _0xa456=['temp','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','getContactDialer','catch'];(function(_0x55f288,_0xc1d971){var _0x217263=function(_0x5bc907){while(--_0x5bc907){_0x55f288['push'](_0x55f288['shift']());}};_0x217263(++_0xc1d971);}(_0xa456,0x142));var _0x6a45=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xa456[_0x45f951];return _0x24756c;};'use strict';var util=require(_0x6a45('0x0'));var logger=require(_0x6a45('0x1'))(_0x6a45('0x2'));var cmHopper=require(_0x6a45('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x6a45('0x4'));var cmHopperHistory=require(_0x6a45('0x5'));function inspectError(_0x3f7448){return util['inspect'](_0x3f7448,{'showHidden':![],'depth':null});}function getContactDialer(_0x1f0701,_0x40acad,_0x1e5882){return cmHopper[_0x6a45('0x6')](_0x1f0701['id'],_0x40acad,_0x1e5882,_0x1f0701['dialOrderByScheduledAt'])[_0x6a45('0x7')](function(_0x26bfc0){_0x1f0701[_0x6a45('0x8')]=0x0;logger[_0x6a45('0x9')](_0x6a45('0xa'),inspectError(_0x26bfc0));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x3a5c20,_0x517040){return cmHopper[_0x6a45('0xb')](_0x3a5c20['id'],_0x517040,_0x3a5c20[_0x6a45('0xc')])[_0x6a45('0x7')](function(_0x147679){_0x3a5c20[_0x6a45('0x8')]=0x0;logger['error']('[getContactDialerIvr]',inspectError(_0x147679));});}exports[_0x6a45('0xb')]=getContactDialerIvr;function countReScheduled(_0x465b59){return cmHopper['countReScheduled'](_0x465b59)['catch'](function(_0x511b92){logger[_0x6a45('0x9')](_0x6a45('0xd'),inspectError(_0x511b92));});}exports[_0x6a45('0xe')]=countReScheduled;function rescheduleContact(_0x3f01f6){return cmHopper[_0x6a45('0xf')](_0x3f01f6)['catch'](function(_0x563c3b){logger[_0x6a45('0x9')](_0x6a45('0x10'),inspectError(_0x563c3b));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x2c20db,_0x171176,_0x3fab82){return cmHopper[_0x6a45('0x11')](_0x2c20db,_0x171176,_0x3fab82)['catch'](function(_0x54507b){logger['error'](_0x6a45('0x12'),inspectError(_0x54507b));});}exports[_0x6a45('0x11')]=unlockContact;function moveContactManagedDialer(_0x360b7f){return cmHopper['moveContactManagedDialer'](_0x360b7f)[_0x6a45('0x7')](function(_0x102981){logger[_0x6a45('0x9')]('[moveContactManagedDialer]',inspectError(_0x102981));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x573453){return cmHopperBlack[_0x6a45('0x13')](_0x573453)[_0x6a45('0x7')](function(_0x5bdaef){logger[_0x6a45('0x9')](_0x6a45('0x14'),inspectError(_0x5bdaef));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4f7110){return cmHopperBlack[_0x6a45('0x15')](_0x4f7110)[_0x6a45('0x7')](function(_0x458b99){logger[_0x6a45('0x9')]('[checkIsBlackListIvr]',inspectError(_0x458b99));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3faae5,_0x59af4b,_0x11290c){return cmHopperAdditionalPhone[_0x6a45('0x16')](_0x3faae5,_0x59af4b,_0x11290c)[_0x6a45('0x7')](function(_0x3ad898){logger[_0x6a45('0x9')](_0x6a45('0x17'),inspectError(_0x3ad898));});}exports[_0x6a45('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x18a5b8,_0x1310d7,_0x46587a){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x18a5b8,_0x1310d7,_0x46587a)[_0x6a45('0x7')](function(_0x5a0389){logger[_0x6a45('0x9')](_0x6a45('0x18'),inspectError(_0x5a0389));});}exports[_0x6a45('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x2c7315){return cmHopperHistory[_0x6a45('0x1a')](_0x2c7315)['catch'](function(_0x2b8cc8){logger[_0x6a45('0x9')](_0x6a45('0x1b'),inspectError(_0x2b8cc8));});}exports[_0x6a45('0x1a')]=avgHandleTime;function createHistory(_0x8265d9){return cmHopperHistory[_0x6a45('0x1c')](_0x8265d9)[_0x6a45('0x7')](function(_0x313c13){logger['error'](_0x6a45('0x1d'),inspectError(_0x313c13));});}exports[_0x6a45('0x1c')]=createHistory; \ No newline at end of file +var _0x430c=['[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','util','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','[getContactDialerIvr]','catch','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x4ef478,_0xb7e570){var _0x5220d5=function(_0x52a7a7){while(--_0x52a7a7){_0x4ef478['push'](_0x4ef478['shift']());}};_0x5220d5(++_0xb7e570);}(_0x430c,0x1a1));var _0xc430=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x430c[_0x374ccf];return _0x443cde;};'use strict';var util=require(_0xc430('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require(_0xc430('0x1'));var cmHopperAdditionalPhone=require(_0xc430('0x2'));var cmHopperBlack=require(_0xc430('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x4f0118){return util['inspect'](_0x4f0118,{'showHidden':![],'depth':null});}function getContactDialer(_0x47d8b9,_0x338a82,_0x2408f5){return cmHopper['getContactDialer'](_0x47d8b9['id'],_0x338a82,_0x2408f5,_0x47d8b9[_0xc430('0x4')])['catch'](function(_0x212354){_0x47d8b9[_0xc430('0x5')]=0x0;logger[_0xc430('0x6')](_0xc430('0x7'),inspectError(_0x212354));});}exports[_0xc430('0x8')]=getContactDialer;function getContactDialerIvr(_0x11f4b0,_0x861581){return cmHopper[_0xc430('0x9')](_0x11f4b0['id'],_0x861581,_0x11f4b0[_0xc430('0x4')])['catch'](function(_0x97fa5b){_0x11f4b0[_0xc430('0x5')]=0x0;logger['error'](_0xc430('0xa'),inspectError(_0x97fa5b));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x3b84bc){return cmHopper['countReScheduled'](_0x3b84bc)[_0xc430('0xb')](function(_0x8aa2e6){logger[_0xc430('0x6')](_0xc430('0xc'),inspectError(_0x8aa2e6));});}exports[_0xc430('0xd')]=countReScheduled;function rescheduleContact(_0x2777af){return cmHopper[_0xc430('0xe')](_0x2777af)['catch'](function(_0x4e9134){logger[_0xc430('0x6')](_0xc430('0xf'),inspectError(_0x4e9134));});}exports[_0xc430('0xe')]=rescheduleContact;function unlockContact(_0x2ef538,_0x31d3b7,_0x55cc6c){return cmHopper[_0xc430('0x10')](_0x2ef538,_0x31d3b7,_0x55cc6c)['catch'](function(_0x4bf91f){logger[_0xc430('0x6')](_0xc430('0x11'),inspectError(_0x4bf91f));});}exports[_0xc430('0x10')]=unlockContact;function moveContactManagedDialer(_0x5830b0){return cmHopper['moveContactManagedDialer'](_0x5830b0)[_0xc430('0xb')](function(_0x4c1937){logger[_0xc430('0x6')]('[moveContactManagedDialer]',inspectError(_0x4c1937));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x2f3203){return cmHopperBlack['checkIsBlackList'](_0x2f3203)[_0xc430('0xb')](function(_0x1eae3b){logger[_0xc430('0x6')](_0xc430('0x12'),inspectError(_0x1eae3b));});}exports[_0xc430('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5af282){return cmHopperBlack[_0xc430('0x14')](_0x5af282)['catch'](function(_0x4d2d43){logger[_0xc430('0x6')](_0xc430('0x15'),inspectError(_0x4d2d43));});}exports[_0xc430('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x56dd16,_0x3fd56b,_0x57d26e){return cmHopperAdditionalPhone[_0xc430('0x16')](_0x56dd16,_0x3fd56b,_0x57d26e)[_0xc430('0xb')](function(_0x4efecd){logger[_0xc430('0x6')](_0xc430('0x17'),inspectError(_0x4efecd));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x2f9af4,_0x59c498,_0x3aa85e){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2f9af4,_0x59c498,_0x3aa85e)[_0xc430('0xb')](function(_0x21e28a){logger['error'](_0xc430('0x18'),inspectError(_0x21e28a));});}exports[_0xc430('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x2c0422){return cmHopperHistory[_0xc430('0x1a')](_0x2c0422)[_0xc430('0xb')](function(_0x57cd72){logger[_0xc430('0x6')](_0xc430('0x1b'),inspectError(_0x57cd72));});}exports[_0xc430('0x1a')]=avgHandleTime;function createHistory(_0x1591e3){return cmHopperHistory['createHistory'](_0x1591e3)[_0xc430('0xb')](function(_0x4cf56c){logger[_0xc430('0x6')]('[createHistory]',inspectError(_0x4cf56c));});}exports[_0xc430('0x1c')]=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 99d29c8..d663b58 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 _0xbbdf=['extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','updatedAt','undefined','%s%s','toUpperCase','setXMDContactVariables','lodash','moment','util','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','talking','match'];(function(_0x21186e,_0x451caa){var _0x319939=function(_0x4d870c){while(--_0x4d870c){_0x21186e['push'](_0x21186e['shift']());}};_0x319939(++_0x451caa);}(_0xbbdf,0xc1));var _0xfbbd=function(_0x57ebf5,_0x3de518){_0x57ebf5=_0x57ebf5-0x0;var _0x2523c6=_0xbbdf[_0x57ebf5];return _0x2523c6;};'use strict';var _=require(_0xfbbd('0x0'));var moment=require(_0xfbbd('0x1'));var util=require(_0xfbbd('0x2'));var logger=require('../../../../config/logger')(_0xfbbd('0x3'));var timezones=require('../../../../config/environment/shared')[_0xfbbd('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xfbbd('0x5'),'BLACKLIST':_0xfbbd('0x6'),'CONTACTS_RESCHEDULED':_0xfbbd('0x7'),'DEACTIVATED':_0xfbbd('0x8'),'DISACTIVED':_0xfbbd('0x9'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xfbbd('0xa'),'NO_AGENTS_LOGGED':_0xfbbd('0xb'),'NO_AVAILABLE_CONTACTS':_0xfbbd('0xc'),'NULL_INTERVAL':_0xfbbd('0xd'),'OVERTIME_INTERVAL':_0xfbbd('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xfbbd('0xf'),'RECALL_TIMEOUT':_0xfbbd('0x10'),'RUNNING':_0xfbbd('0x11'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xfbbd('0x12')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1c2ce6){return _0x1c2ce6[_0xfbbd('0x13')]===_0xfbbd('0x14');}exports[_0xfbbd('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x3e5468){return _0x3e5468[_0xfbbd('0x16')]===_0xfbbd('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x200b6d){return _0x200b6d[_0xfbbd('0x16')]==='outbound';}exports[_0xfbbd('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x5cc20d){return _0x5cc20d[_0xfbbd('0x19')];}exports[_0xfbbd('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4fb71e){return _0x4fb71e[_0xfbbd('0x1b')];}exports[_0xfbbd('0x1c')]=isIVRCampaignActive;function getSeconds(_0x2856c9,_0xca01c7){var _0xa4a207=moment(_0x2856c9)[_0xfbbd('0x1d')](0x0);var _0x56c958=moment(_0xca01c7)[_0xfbbd('0x1d')](0x0);return _0xa4a207[_0xfbbd('0x1e')](_0x56c958,_0xfbbd('0x1f'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x5436a0,_0x3d4d7f){var _0x284d9b=![];var _0x159de3=_0x5436a0['dialMethod']!==_0x3d4d7f['dialMethod']||_0x5436a0[_0xfbbd('0x19')]!==_0x3d4d7f[_0xfbbd('0x19')]||_0x5436a0[_0xfbbd('0x20')]!==_0x3d4d7f[_0xfbbd('0x20')];var _0x21ce6d=_0x5436a0['available']!==_0x3d4d7f[_0xfbbd('0x21')]||_0x5436a0['loggedIn']!==_0x3d4d7f[_0xfbbd('0x22')]||_0x5436a0[_0xfbbd('0x23')]!==_0x3d4d7f[_0xfbbd('0x23')]||_0x5436a0[_0xfbbd('0x24')]!==_0x3d4d7f[_0xfbbd('0x24')]||_0x5436a0['talking']!==_0x3d4d7f['talking']||_0x5436a0[_0xfbbd('0x25')]!==_0x3d4d7f[_0xfbbd('0x25')]||_0x5436a0['waiting']!==_0x3d4d7f[_0xfbbd('0x26')]||_0x5436a0[_0xfbbd('0x27')]!==_0x3d4d7f[_0xfbbd('0x27')]||_0x5436a0[_0xfbbd('0x28')]!==_0x3d4d7f[_0xfbbd('0x28')];if(_0x5436a0[_0xfbbd('0x29')]&&_0x3d4d7f[_0xfbbd('0x29')]){_0x284d9b=_0x5436a0['Trunk'][_0xfbbd('0x2a')]!==_0x3d4d7f[_0xfbbd('0x29')][_0xfbbd('0x2a')]||_0x5436a0[_0xfbbd('0x29')][_0xfbbd('0x1b')]!==_0x3d4d7f[_0xfbbd('0x29')][_0xfbbd('0x1b')];}return _0x159de3||_0x21ce6d||_0x284d9b;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x94b78a){var _0x17d26a=null;var _0x18e976=_0x94b78a[_0xfbbd('0x2b')];if(_[_0xfbbd('0x2c')](_0x94b78a[_0xfbbd('0x2d')])||_[_0xfbbd('0x2c')](_0x94b78a['Interval'])||_[_0xfbbd('0x2c')](_0x94b78a[_0xfbbd('0x2e')][_0xfbbd('0x2f')])){_0x17d26a=CAMPAIGN_STATUS[_0xfbbd('0x30')];}else if(_[_0xfbbd('0x31')](_0x94b78a[_0xfbbd('0x2d')])||_['isEmpty'](_0x94b78a[_0xfbbd('0x2e')][_0xfbbd('0x2f')])){_0x17d26a=CAMPAIGN_STATUS[_0xfbbd('0x32')];}else if(_0x18e976&&!timezones[_0x18e976]){_0x17d26a=CAMPAIGN_STATUS[_0xfbbd('0x33')];}return _0x17d26a;}function checkAnyValidTrunk(_0x10b378,_0x55aba8){var _0x11a00a=null;var _0x5e7310=_0xfbbd('0x34');var _0x59dc6b=[_0xfbbd('0x35'),_0xfbbd('0x36')];var _0xf0383c=!![];if(_0x10b378['Trunk']&&_0x10b378['Trunk']['active']){_0x5e7310+=_0x10b378[_0xfbbd('0x29')][_0xfbbd('0x2a')];_0x11a00a=_0x55aba8[_0x5e7310];_0xf0383c=_0x59dc6b[_0xfbbd('0x37')](_0x11a00a['status']);}else if(_0x10b378['TrunkBackup']&&_0x10b378[_0xfbbd('0x38')][_0xfbbd('0x1b')]){_0x5e7310+=_0x10b378[_0xfbbd('0x38')][_0xfbbd('0x2a')];_0x11a00a=_0x55aba8[_0x5e7310];_0xf0383c=_0x59dc6b[_0xfbbd('0x37')](_0x11a00a['status']);}return _0xf0383c;}function getQueueCampaignStatusMessage(_0x2efb13,_0x55701e){var _0x164e83=CAMPAIGN_STATUS[_0xfbbd('0x5')];var _0x47cb1a=isPreviewCampaign(_0x2efb13);if(!isQueueCampaignActive(_0x2efb13)){if(_0x47cb1a){_0x164e83=CAMPAIGN_STATUS[_0xfbbd('0x39')];}else{if(_0x2efb13['originated']===0x0&&_0x2efb13['talking']===0x0&&_0x2efb13[_0xfbbd('0x26')]===0x0&&(_0x2efb13[_0xfbbd('0x25')]||0x0)===0x0){_0x164e83=CAMPAIGN_STATUS[_0xfbbd('0x39')];}else{_0x164e83=CAMPAIGN_STATUS[_0xfbbd('0x3a')];}}}else if(_0x2efb13[_0xfbbd('0x22')]===0x0){_0x164e83=CAMPAIGN_STATUS[_0xfbbd('0x3b')];}else if(!checkAnyValidTrunk(_0x2efb13,_0x55701e)){_0x164e83=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x2efb13)){var _0x1370ff=checkAnyValidQueueCampaignInterval(_0x2efb13);if(_0x1370ff){_0x164e83=_0x1370ff;}}return _0x164e83;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x519d53){var _0x2f2b58=CAMPAIGN_STATUS[_0xfbbd('0x3a')];if(_0x519d53['originated']===0x0&&_0x519d53[_0xfbbd('0x3c')]===0x0&&_0x519d53[_0xfbbd('0x26')]===0x0&&(_0x519d53[_0xfbbd('0x25')]||0x0)===0x0){_0x2f2b58=CAMPAIGN_STATUS[_0xfbbd('0x39')];}return _0x2f2b58;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x17c21c){var _0x1bcb64=_0x17c21c[_0xfbbd('0x3d')](/"(.*?)"/);return _0x1bcb64?_0x1bcb64[0x1]:_0x17c21c;}exports[_0xfbbd('0x3e')]=extractCalleridName;function getCallerId(_0x48a0dd,_0x37dcef,_0xcb25f0){if(!_[_0xfbbd('0x3f')](_0xcb25f0)&&typeof _0xcb25f0===_0xfbbd('0x40')&&!_[_0xfbbd('0x31')](_0xcb25f0)){if(!_['isUndefined'](_0x37dcef)&&typeof _0x37dcef===_0xfbbd('0x40')&&!_[_0xfbbd('0x31')](_0x37dcef)){return util[_0xfbbd('0x41')](_0xfbbd('0x42'),_0x37dcef,_0xcb25f0);}return util[_0xfbbd('0x41')](_0xfbbd('0x42'),_0xcb25f0,_0xcb25f0);}if(!_[_0xfbbd('0x3f')](_0x48a0dd)&&typeof _0x48a0dd==='string'&&!_[_0xfbbd('0x31')](_0x48a0dd)){return _0x48a0dd;}return _0xfbbd('0x43');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x419c31,_0x129576){var _0x6c18a4;var _0xaf2f55;var _0xc8a4fe;if(_0x129576<=0x0){_0x129576=0x1;}_0x6c18a4=new RegExp(_0xfbbd('0x44')+_0x129576+'}$');_0xaf2f55=Math[_0xfbbd('0x45')](0xa,_0x129576-0x1);_0xc8a4fe=Math['pow'](0xa,_0x129576)-0x1;return util[_0xfbbd('0x41')]('%s',_[_0xfbbd('0x46')](_0x419c31,_0x6c18a4,_[_0xfbbd('0x47')](_0xaf2f55,_0xc8a4fe)[_0xfbbd('0x48')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x21d5ff){if(_0x21d5ff[_0xfbbd('0x28')]&&_0x21d5ff[_0xfbbd('0x28')]>0x0){_0x21d5ff[_0xfbbd('0x28')]-=0x1;}else{logger[_0xfbbd('0x49')](_0xfbbd('0x4a'));}}exports[_0xfbbd('0x4b')]=decrementOriginate;function checkContactEmpty(_0x3b1655){return _0x3b1655&&_0x3b1655[_0xfbbd('0x4c')]>0x0;}exports[_0xfbbd('0x4d')]=checkContactEmpty;function erlangb(_0x2d5be7,_0x2cad2c){if(_0x2cad2c===0x0){return 0x0;}var _0x2d28cf=0x1;for(var _0x4ee857=0x1;_0x4ee857<=_0x2cad2c;_0x4ee857+=0x1){_0x2d28cf=0x1+_0x2d28cf*_0x4ee857/_0x2d5be7;}return 0x1/_0x2d28cf;}exports[_0xfbbd('0x4e')]=erlangb;function checkContactLowerLimitOriginate(_0x249284,_0x40c605,_0x3530d5){if(_0x40c605>_0x3530d5){for(var _0x9cc21e=0x0;_0x9cc21e<_0x40c605-_0x3530d5;_0x9cc21e+=0x1){decrementOriginate(_0x249284);}}}exports[_0xfbbd('0x4f')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4aa545){var _0x404257={};var _0x5ce769=['id','createdAt','description','tags',_0xfbbd('0x50')];if(_0x4aa545){for(var _0x18d5cc in _0x4aa545){if(typeof _0x4aa545[_0x18d5cc]!==_0xfbbd('0x51')){if(!_[_0xfbbd('0x2c')](_0x4aa545[_0x18d5cc])&&!_0x5ce769[_0xfbbd('0x37')](_0x18d5cc)){_0x404257[util['format'](_0xfbbd('0x52'),'XMD-',_0x18d5cc[_0xfbbd('0x53')]())]=_0x4aa545[_0x18d5cc];}}}}return _0x404257;}exports[_0xfbbd('0x54')]=setXMDContactVariables; \ No newline at end of file +var _0x6d24=['RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','ivr','isIVRCampaign','type','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','unmonitored','includes','TrunkBackup','status','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','undefined','XMD-','toUpperCase','setXMDContactVariables','lodash','util','../../../../config/logger','timezones','BLACKLIST'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6d24,0x1a4));var _0x46d2=function(_0x515cff,_0x27d4a5){_0x515cff=_0x515cff-0x0;var _0x419c0e=_0x6d24[_0x515cff];return _0x419c0e;};'use strict';var _=require(_0x46d2('0x0'));var moment=require('moment');var util=require(_0x46d2('0x1'));var logger=require(_0x46d2('0x2'))('dialer');var timezones=require('../../../../config/environment/shared')[_0x46d2('0x3')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x46d2('0x4'),'CONTACTS_RESCHEDULED':_0x46d2('0x5'),'DEACTIVATED':_0x46d2('0x6'),'DISACTIVED':_0x46d2('0x7'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x46d2('0x8'),'NO_AVAILABLE_CONTACTS':_0x46d2('0x9'),'NULL_INTERVAL':_0x46d2('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x46d2('0xb'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x46d2('0xc'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x46d2('0xd'),'UNREACHABLE_TRUNK':_0x46d2('0xe')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x34e6d7){return _0x34e6d7[_0x46d2('0xf')]===_0x46d2('0x10');}exports[_0x46d2('0x11')]=isPreviewCampaign;function isIVRCampaign(_0x2bcc25){return _0x2bcc25['type']===_0x46d2('0x12');}exports[_0x46d2('0x13')]=isIVRCampaign;function isOutboundQueue(_0x47c7da){return _0x47c7da[_0x46d2('0x14')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x154fc6){return _0x154fc6[_0x46d2('0x15')];}exports[_0x46d2('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1bb1b5){return _0x1bb1b5['active'];}exports[_0x46d2('0x17')]=isIVRCampaignActive;function getSeconds(_0x1c67a5,_0x169451){var _0x7cc1fd=moment(_0x1c67a5)[_0x46d2('0x18')](0x0);var _0x30bd14=moment(_0x169451)[_0x46d2('0x18')](0x0);return _0x7cc1fd[_0x46d2('0x19')](_0x30bd14,_0x46d2('0x1a'));}exports[_0x46d2('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x4a20d5,_0x38e2fe){var _0x475d5f=![];var _0xd72695=_0x4a20d5[_0x46d2('0xf')]!==_0x38e2fe[_0x46d2('0xf')]||_0x4a20d5[_0x46d2('0x15')]!==_0x38e2fe['dialActive']||_0x4a20d5[_0x46d2('0x1c')]!==_0x38e2fe[_0x46d2('0x1c')];var _0x12ab53=_0x4a20d5[_0x46d2('0x1d')]!==_0x38e2fe[_0x46d2('0x1d')]||_0x4a20d5[_0x46d2('0x1e')]!==_0x38e2fe[_0x46d2('0x1e')]||_0x4a20d5[_0x46d2('0x1f')]!==_0x38e2fe['loggedInDb']||_0x4a20d5[_0x46d2('0x20')]!==_0x38e2fe[_0x46d2('0x20')]||_0x4a20d5[_0x46d2('0x21')]!==_0x38e2fe[_0x46d2('0x21')]||_0x4a20d5[_0x46d2('0x22')]!==_0x38e2fe[_0x46d2('0x22')]||_0x4a20d5[_0x46d2('0x23')]!==_0x38e2fe[_0x46d2('0x23')]||_0x4a20d5['inUse']!==_0x38e2fe[_0x46d2('0x24')]||_0x4a20d5[_0x46d2('0x25')]!==_0x38e2fe[_0x46d2('0x25')];if(_0x4a20d5[_0x46d2('0x26')]&&_0x38e2fe[_0x46d2('0x26')]){_0x475d5f=_0x4a20d5[_0x46d2('0x26')][_0x46d2('0x27')]!==_0x38e2fe['Trunk'][_0x46d2('0x27')]||_0x4a20d5[_0x46d2('0x26')][_0x46d2('0x28')]!==_0x38e2fe[_0x46d2('0x26')]['active'];}return _0xd72695||_0x12ab53||_0x475d5f;}exports[_0x46d2('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3e8bd0){var _0x214f9f=null;var _0x46f2d2=_0x3e8bd0['dialTimezone'];if(_[_0x46d2('0x2a')](_0x3e8bd0[_0x46d2('0x2b')])||_[_0x46d2('0x2a')](_0x3e8bd0['Interval'])||_[_0x46d2('0x2a')](_0x3e8bd0[_0x46d2('0x2c')][_0x46d2('0x2d')])){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x2e')];}else if(_[_0x46d2('0x2f')](_0x3e8bd0['dialGlobalInterval'])||_[_0x46d2('0x2f')](_0x3e8bd0[_0x46d2('0x2c')][_0x46d2('0x2d')])){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x30')];}else if(_0x46f2d2&&!timezones[_0x46f2d2]){_0x214f9f=CAMPAIGN_STATUS[_0x46d2('0x31')];}return _0x214f9f;}function checkAnyValidTrunk(_0x30bf33,_0x3ebc51){var _0x1cecb4=null;var _0x828f90='SIP/';var _0x475b4d=['reachable',_0x46d2('0x32')];var _0x5969ea=!![];if(_0x30bf33['Trunk']&&_0x30bf33['Trunk'][_0x46d2('0x28')]){_0x828f90+=_0x30bf33[_0x46d2('0x26')]['name'];_0x1cecb4=_0x3ebc51[_0x828f90];_0x5969ea=_0x475b4d[_0x46d2('0x33')](_0x1cecb4['status']);}else if(_0x30bf33[_0x46d2('0x34')]&&_0x30bf33[_0x46d2('0x34')][_0x46d2('0x28')]){_0x828f90+=_0x30bf33[_0x46d2('0x34')]['name'];_0x1cecb4=_0x3ebc51[_0x828f90];_0x5969ea=_0x475b4d['includes'](_0x1cecb4[_0x46d2('0x35')]);}return _0x5969ea;}function getQueueCampaignStatusMessage(_0x38efac,_0x4d271e){var _0x43f437=CAMPAIGN_STATUS[_0x46d2('0x36')];var _0x270333=isPreviewCampaign(_0x38efac);if(!isQueueCampaignActive(_0x38efac)){if(_0x270333){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x37')];}else{if(_0x38efac['originated']===0x0&&_0x38efac[_0x46d2('0x21')]===0x0&&_0x38efac['waiting']===0x0&&(_0x38efac[_0x46d2('0x22')]||0x0)===0x0){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x37')];}else{_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x38')];}}}else if(_0x38efac[_0x46d2('0x1e')]===0x0){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x39')];}else if(!checkAnyValidTrunk(_0x38efac,_0x4d271e)){_0x43f437=CAMPAIGN_STATUS[_0x46d2('0x3a')];}else if(!isPreviewCampaign(_0x38efac)){var _0x513cea=checkAnyValidQueueCampaignInterval(_0x38efac);if(_0x513cea){_0x43f437=_0x513cea;}}return _0x43f437;}exports[_0x46d2('0x3b')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3007c3){var _0x3767ed=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3007c3[_0x46d2('0x25')]===0x0&&_0x3007c3[_0x46d2('0x21')]===0x0&&_0x3007c3[_0x46d2('0x23')]===0x0&&(_0x3007c3[_0x46d2('0x22')]||0x0)===0x0){_0x3767ed=CAMPAIGN_STATUS[_0x46d2('0x37')];}return _0x3767ed;}exports[_0x46d2('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5a248){var _0x15fa6f=_0x5a248[_0x46d2('0x3d')](/"(.*?)"/);return _0x15fa6f?_0x15fa6f[0x1]:_0x5a248;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x11d12b,_0x12b50c,_0x4e4c09){if(!_[_0x46d2('0x3e')](_0x4e4c09)&&typeof _0x4e4c09===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x4e4c09)){if(!_[_0x46d2('0x3e')](_0x12b50c)&&typeof _0x12b50c===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x12b50c)){return util[_0x46d2('0x40')](_0x46d2('0x41'),_0x12b50c,_0x4e4c09);}return util[_0x46d2('0x40')](_0x46d2('0x41'),_0x4e4c09,_0x4e4c09);}if(!_[_0x46d2('0x3e')](_0x11d12b)&&typeof _0x11d12b===_0x46d2('0x3f')&&!_[_0x46d2('0x2f')](_0x11d12b)){return _0x11d12b;}return _0x46d2('0x42');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x4c08c5,_0x3d0c62){var _0x2a64bb;var _0xa56709;var _0xdc70d0;if(_0x3d0c62<=0x0){_0x3d0c62=0x1;}_0x2a64bb=new RegExp(_0x46d2('0x43')+_0x3d0c62+'}$');_0xa56709=Math[_0x46d2('0x44')](0xa,_0x3d0c62-0x1);_0xdc70d0=Math['pow'](0xa,_0x3d0c62)-0x1;return util[_0x46d2('0x40')]('%s',_[_0x46d2('0x45')](_0x4c08c5,_0x2a64bb,_['random'](_0xa56709,_0xdc70d0)[_0x46d2('0x46')]()));}exports[_0x46d2('0x47')]=getCallerIdRandom;function decrementOriginate(_0x38a25a){if(_0x38a25a[_0x46d2('0x25')]&&_0x38a25a[_0x46d2('0x25')]>0x0){_0x38a25a[_0x46d2('0x25')]-=0x1;}else{logger[_0x46d2('0x48')](_0x46d2('0x49'));}}exports[_0x46d2('0x4a')]=decrementOriginate;function checkContactEmpty(_0x3f0fc3){return _0x3f0fc3&&_0x3f0fc3[_0x46d2('0x4b')]>0x0;}exports[_0x46d2('0x4c')]=checkContactEmpty;function erlangb(_0x5a0634,_0x4d6993){if(_0x4d6993===0x0){return 0x0;}var _0x3c3679=0x1;for(var _0x571a9b=0x1;_0x571a9b<=_0x4d6993;_0x571a9b+=0x1){_0x3c3679=0x1+_0x3c3679*_0x571a9b/_0x5a0634;}return 0x1/_0x3c3679;}exports[_0x46d2('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x5e1382,_0x367e37,_0x23f507){if(_0x367e37>_0x23f507){for(var _0x4b5ab0=0x0;_0x4b5ab0<_0x367e37-_0x23f507;_0x4b5ab0+=0x1){decrementOriginate(_0x5e1382);}}}exports[_0x46d2('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xa5b2c0){var _0x11949b={};var _0x40265d=['id',_0x46d2('0x4f'),_0x46d2('0x50'),'tags','updatedAt'];if(_0xa5b2c0){for(var _0x2ef6a9 in _0xa5b2c0){if(typeof _0xa5b2c0[_0x2ef6a9]!==_0x46d2('0x51')){if(!_['isNil'](_0xa5b2c0[_0x2ef6a9])&&!_0x40265d[_0x46d2('0x33')](_0x2ef6a9)){_0x11949b[util['format']('%s%s',_0x46d2('0x52'),_0x2ef6a9[_0x46d2('0x53')]())]=_0xa5b2c0[_0x2ef6a9];}}}}return _0x11949b;}exports[_0x46d2('0x54')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8483adb..b8f2b14 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(_0x1eca56,_0x40ae6a){var _0x479267=function(_0x3378ab){while(--_0x3378ab){_0x1eca56['push'](_0x1eca56['shift']());}};_0x479267(++_0x40ae6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x4d0225,_0x140e85){var _0x432d38=function(_0x1a9374){while(--_0x1a9374){_0x4d0225['push'](_0x4d0225['shift']());}};_0x432d38(++_0x140e85);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 3c74d79..2546602 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 _0x9550=['merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','trunks','actions','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncReceiveFax','syncHangup','originateresponse','from-voip-provider','faxAccounts','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','prototype','syncNewExten','hasOwnProperty','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse'];(function(_0x266b54,_0x18acb7){var _0xf44617=function(_0x326609){while(--_0x326609){_0x266b54['push'](_0x266b54['shift']());}};_0xf44617(++_0x18acb7);}(_0x9550,0x124));var _0x0955=function(_0x54cdaf,_0x9c9be8){_0x54cdaf=_0x54cdaf-0x0;var _0x2e2830=_0x9550[_0x54cdaf];return _0x2e2830;};'use strict';var util=require('util');var _=require(_0x0955('0x0'));var BPromise=require(_0x0955('0x1'));var uuid=require('uuid');var moment=require(_0x0955('0x2'));var path=require(_0x0955('0x3'));var tiff2pdf=require(_0x0955('0x4'));var gs=require('./util/gs');var logger=require(_0x0955('0x5'))('fax');var ami=require('../ami');var rpcDb=require(_0x0955('0x6'));var Channel=require(_0x0955('0x7'));var ut=require(_0x0955('0x8'));var Action=require(_0x0955('0x9'));var faxAccount=require(_0x0955('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x0955('0xb'));function Fax(_0x35a0bc){this[_0x0955('0xc')]={};this['faxAccounts']=_0x35a0bc['faxAccounts'];this[_0x0955('0xd')]=_0x35a0bc[_0x0955('0xd')];this[_0x0955('0xe')]={};ami['on']('newchannel',this[_0x0955('0xf')][_0x0955('0x10')](this));ami['on'](_0x0955('0x11'),this[_0x0955('0x12')]['bind'](this));ami['on']('newstate',this[_0x0955('0x13')]['bind'](this));ami['on'](_0x0955('0x14'),this['syncNewExten'][_0x0955('0x10')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on']('receivefax',this[_0x0955('0x15')]['bind'](this));ami['on']('hangup',this[_0x0955('0x16')][_0x0955('0x10')](this));ami['on'](_0x0955('0x17'),this['syncOriginateResponse'][_0x0955('0x10')](this));}Fax['prototype'][_0x0955('0xf')]=function(_0x4fbc63){if(_0x4fbc63['context']===_0x0955('0x18')){for(var _0x245a1a in this['faxAccounts']){if(this[_0x0955('0x19')]['hasOwnProperty'](_0x245a1a)){if(_0x4fbc63[_0x0955('0x1a')]===this[_0x0955('0x19')][_0x245a1a][_0x0955('0x1b')]){this['channels'][_0x4fbc63[_0x0955('0x1c')]]={};this[_0x0955('0xc')][_0x4fbc63[_0x0955('0x1c')]][_0x0955('0x1d')]=_0x4fbc63['channel'];this[_0x0955('0xc')][_0x4fbc63[_0x0955('0x1c')]]['id']=this[_0x0955('0x19')][_0x245a1a]['id'];this[_0x0955('0xc')][_0x4fbc63[_0x0955('0x1c')]][_0x0955('0x1e')]=this[_0x0955('0x19')][_0x245a1a][_0x0955('0x1e')];logger[_0x0955('0x1f')](_0x4fbc63[_0x0955('0x1c')],_0x0955('0x20'));}}}}if(this[_0x0955('0xe')][_0x4fbc63[_0x0955('0x1c')]]){this['channels'][_0x4fbc63[_0x0955('0x1c')]]={};this['channels'][_0x4fbc63[_0x0955('0x1c')]][_0x0955('0x1d')]=_0x4fbc63[_0x0955('0x1d')];logger[_0x0955('0x1f')](_0x4fbc63[_0x0955('0x1c')],_0x0955('0x20'));}};Fax['prototype'][_0x0955('0x12')]=function(_0xcaaac6){if(this[_0x0955('0xc')][_0xcaaac6[_0x0955('0x1c')]]){for(var _0x12fe8c in _0xcaaac6[_0x0955('0x21')]){if(_0xcaaac6['variable']['hasOwnProperty'](_0x12fe8c)){this[_0x0955('0xc')][_0xcaaac6[_0x0955('0x1c')]][_0x12fe8c]=_0xcaaac6[_0x0955('0x22')];}}}};Fax['prototype'][_0x0955('0x13')]=function(_0x548746){if(this[_0x0955('0xc')][_0x548746[_0x0955('0x1c')]]){this[_0x0955('0xc')][_0x548746[_0x0955('0x1c')]][_0x0955('0x23')]=_0x548746['channelstate'];this[_0x0955('0xc')][_0x548746['uniqueid']][_0x0955('0x24')]=_0x548746[_0x0955('0x24')];}};Fax[_0x0955('0x25')][_0x0955('0x26')]=function(_0x2d4245){if(this[_0x0955('0xc')][_0x2d4245[_0x0955('0x1c')]]){for(var _0x39f986 in _0x2d4245[_0x0955('0x21')]){if(_0x2d4245['variable'][_0x0955('0x27')](_0x39f986)){this['channels'][_0x2d4245[_0x0955('0x1c')]][_0x39f986]=_0x2d4245[_0x0955('0x22')];}}}};Fax[_0x0955('0x25')][_0x0955('0x28')]=function(_0x923d2){if(this['channels'][_0x923d2[_0x0955('0x1c')]]){this['channels'][_0x923d2['uniqueid']][_0x0955('0x29')]=_0x923d2[_0x0955('0x29')];this['channels'][_0x923d2['uniqueid']][_0x0955('0x2a')]=_0x923d2[_0x0955('0x2a')];this[_0x0955('0xc')][_0x923d2[_0x0955('0x1c')]][_0x0955('0x1b')]=_0x923d2['localstationid'];this[_0x0955('0xc')][_0x923d2[_0x0955('0x1c')]]['filename']=_0x923d2[_0x0955('0x2b')];logger[_0x0955('0x1f')](_0x923d2['uniqueid'],_0x0955('0x2c'));}};Fax[_0x0955('0x25')][_0x0955('0x15')]=function(_0x2c8dfb){var _0x57b8cc=this;if(this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]]){var _0x49a52d=this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]]['id'];this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x2d')]=_0x2c8dfb[_0x0955('0x2d')];this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x2e')]=_0x2c8dfb[_0x0955('0x2e')];this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x1b')]=_0x2c8dfb['localstationid'];this['channels'][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x2f')]=_0x2c8dfb[_0x0955('0x2f')];this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x30')]=_0x2c8dfb[_0x0955('0x30')];this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]]['filename']=_0x2c8dfb[_0x0955('0x2b')];this[_0x0955('0xc')][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x31')]=_0x2c8dfb[_0x0955('0x31')];if(this['channels'][_0x2c8dfb[_0x0955('0x1c')]][_0x0955('0x2e')]>0x0){tiff2pdf(_0x2c8dfb['filename'],_0x0955('0x32'),function(_0x950928){logger['info'](_0x2c8dfb[_0x0955('0x1c')],_0x0955('0x33'),_0x950928[_0x0955('0x34')]);attachment[_0x0955('0x35')]({'name':path['parse'](_0x2c8dfb[_0x0955('0x2b')])[_0x0955('0x1e')],'basename':path[_0x0955('0x36')](_0x2c8dfb[_0x0955('0x2b')])[_0x0955('0x1e')]+_0x0955('0x37'),'type':_0x0955('0x38')})[_0x0955('0x39')](function(_0x662c98){faxAccount[_0x0955('0x3a')](_0x49a52d,{'from':_0x2c8dfb[_0x0955('0x31')],'mapKey':_0x0955('0x3b'),'body':path[_0x0955('0x36')](_0x2c8dfb[_0x0955('0x2b')])[_0x0955('0x1e')]+_0x0955('0x37'),'AttachmentId':_0x662c98['id']})[_0x0955('0x3c')](function(_0x21aa93){logger['error'](_0x2c8dfb[_0x0955('0x1c')],_0x0955('0x3d'),JSON[_0x0955('0x3e')](_0x21aa93));});})[_0x0955('0x3c')](function(_0x79d407){logger['error'](_0x2c8dfb['uniqueid'],'\x20receiveFax\x20',JSON[_0x0955('0x3e')](_0x79d407));});});}logger[_0x0955('0x1f')](_0x2c8dfb['uniqueid'],_0x0955('0x3f'));}};Fax['prototype'][_0x0955('0x40')]=function(_0x41d9ec){if(this['actions'][_0x41d9ec[_0x0955('0x1c')]]){_[_0x0955('0x41')](this[_0x0955('0xc')][_0x41d9ec[_0x0955('0x1c')]],_[_0x0955('0x42')](_0x41d9ec,[_0x0955('0x43'),_0x0955('0x44')]));}};function updateStatus(_0x14ba15){if(_0x14ba15[_0x0955('0x45')]){faxMessage[_0x0955('0x46')](_0x14ba15[_0x0955('0x45')],{'failMessage':_0x0955('0x47')})[_0x0955('0x39')](function(_0x330c24){ut['logger'](_0x0955('0x48'),_0x330c24);})[_0x0955('0x3c')](function(_0x4ffa53){ut[_0x0955('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x4ffa53);});}else{ut[_0x0955('0x49')](_0x0955('0x4a'));}}Fax[_0x0955('0x25')][_0x0955('0x4b')]=function(_0x2f1502,_0x289e83,_0xe2f07a){var _0x381052=this;var _0x2d87d3={};if(_0x289e83){_0x2d87d3={'read':_0x289e83};}else{_0x2d87d3={'failMessage':_0xe2f07a};}if(this[_0x0955('0xe')][_0x2f1502][_0x0955('0x45')]){faxMessage[_0x0955('0x46')](this[_0x0955('0xe')][_0x2f1502]['AttachmentId'],_0x2d87d3)[_0x0955('0x39')](function(_0x46d65d){ut[_0x0955('0x49')](_0x0955('0x4c'),_0x46d65d);})[_0x0955('0x3c')](function(_0x28b754){ut[_0x0955('0x49')](_0x0955('0x4d'),_0x28b754);})[_0x0955('0x4e')](function(){delete _0x381052[_0x0955('0xc')][_0x2f1502];delete _0x381052[_0x0955('0xe')][_0x2f1502];});}else{ut['logger'](_0x0955('0x4f'));delete this[_0x0955('0xc')][_0x2f1502];delete this['actions'][_0x2f1502];}};Fax[_0x0955('0x25')]['syncHangup']=function(_0x57b5e6){var _0x266705=this;if(this['channels'][_0x57b5e6[_0x0955('0x1c')]]){if(this[_0x0955('0xe')][_0x57b5e6[_0x0955('0x1c')]]){this[_0x0955('0xc')][_0x57b5e6[_0x0955('0x1c')]]['id']=this[_0x0955('0xe')][_0x57b5e6[_0x0955('0x1c')]]['id'];this[_0x0955('0xc')][_0x57b5e6[_0x0955('0x1c')]][_0x0955('0x1e')]=this[_0x0955('0xe')][_0x57b5e6[_0x0955('0x1c')]][_0x0955('0x1e')];}logger['info'](_0x57b5e6[_0x0955('0x1c')],this[_0x0955('0xe')][_0x57b5e6[_0x0955('0x1c')]]?_0x0955('0x50'):_0x0955('0x51'),JSON[_0x0955('0x3e')](this[_0x0955('0xc')][_0x57b5e6[_0x0955('0x1c')]]));if(this[_0x0955('0xe')][_0x57b5e6['uniqueid']]){if(this[_0x0955('0xc')][_0x57b5e6[_0x0955('0x1c')]][_0x0955('0x52')]>0x0&&this['channels'][_0x57b5e6[_0x0955('0x1c')]]['faxstatus']===_0x0955('0x53')){this[_0x0955('0x4b')](_0x57b5e6[_0x0955('0x1c')],!![]);}else{this[_0x0955('0x4b')](_0x57b5e6[_0x0955('0x1c')],![],this['channels'][_0x57b5e6['uniqueid']][_0x0955('0x54')]?_0x0955('0x55')+this[_0x0955('0xc')][_0x57b5e6[_0x0955('0x1c')]][_0x0955('0x54')]:_0x0955('0x56'));}}}};Fax[_0x0955('0x25')][_0x0955('0x57')]=function(_0x48adb2){var _0x240dd0=this;return new BPromise(function(_0x48ef4b,_0x422d31){_0x240dd0['execOriginate'](_0x48adb2,_0x240dd0[_0x0955('0x19')][_0x48adb2[_0x0955('0x58')]])[_0x0955('0x39')](function(_0x19e3ec){ut[_0x0955('0x49')](_0x0955('0x59'),_0x19e3ec);_0x48ef4b(ut['message'](_0x0955('0x5a')));})[_0x0955('0x3c')](function(_0x484691){ut[_0x0955('0x49')](_0x0955('0x5b'),_0x484691);updateStatus(_0x48adb2);_0x422d31(ut[_0x0955('0x34')]('Fax\x20failed'));});});};Fax[_0x0955('0x25')][_0x0955('0x5c')]=function(_0x5d8e39){var _0x277706=this;return new BPromise(function(_0x3e3ff8,_0xe10678){var _0x567f69=_0x277706['checkTrunk'](_0x277706[_0x0955('0x19')][_0x5d8e39[_0x0955('0x58')]][_0x0955('0x5d')],_0x5d8e39);if(_0x567f69[_0x0955('0x5e')]){_0x3e3ff8(ut[_0x0955('0x34')](_0x0955('0x5f')));}else{_0xe10678(ut['message'](_0x567f69[_0x0955('0x34')]));}});};function originate(_0x593ddd,_0x1b54fd,_0x3863d8){return new BPromise(function(_0x4fe925,_0x379eef){if(_0x3863d8){var _0x179eef=util[_0x0955('0x60')](_0x0955('0x61'),path[_0x0955('0x36')](_0x593ddd[_0x0955('0x3')])[_0x0955('0x1e')],_0x593ddd[_0x0955('0x3')]);gs[_0x0955('0x62')](_0x179eef)[_0x0955('0x39')](function(){_0x593ddd[_0x0955('0x3')]=util[_0x0955('0x60')](_0x0955('0x63'),path[_0x0955('0x36')](_0x593ddd[_0x0955('0x3')])[_0x0955('0x64')],path[_0x0955('0x36')](_0x593ddd[_0x0955('0x3')])[_0x0955('0x1e')]);_0x1b54fd[_0x0955('0x65')]=_0x593ddd[_0x0955('0x3')];ut[_0x0955('0x49')](_0x0955('0x66'),'');ami[_0x0955('0x67')](ut[_0x0955('0x68')](_0x593ddd,_0x1b54fd))[_0x0955('0x39')](function(_0x5ddebc){_0x4fe925(_0x5ddebc);})[_0x0955('0x3c')](function(_0x24a9b3){_0x379eef(_0x24a9b3);});})[_0x0955('0x3c')](function(_0x32191a){_0x379eef(_0x32191a);});}else{ami['Action'](ut['variablesAction'](_0x593ddd,_0x1b54fd))[_0x0955('0x39')](function(_0x53d283){_0x4fe925(_0x53d283);})['catch'](function(_0x10eeea){_0x379eef(_0x10eeea);});}});}Fax['prototype']['execOriginate']=function(_0xa06ed,_0xfbb506){var _0x3e6f05=this;return new BPromise(function(_0x4765d5,_0x5cd5df){var _0x13d534=uuid['v4']();var _0x11f7f2=ut[_0x0955('0x69')](_0xa06ed,_0xfbb506);_0x3e6f05[_0x0955('0xe')][_0x13d534]=new Action(_0x13d534,_0xfbb506,_0xa06ed);var _0x25bee1=_0x3e6f05[_0x0955('0xe')][_0x13d534];if(path[_0x0955('0x36')](_0xa06ed['path'])['ext']===_0x0955('0x37')){originate(_0x25bee1,_0x11f7f2,!![])[_0x0955('0x39')](function(_0x4a335b){_0x4765d5(_0x4a335b);})[_0x0955('0x3c')](function(_0x3f3c39){_0x5cd5df(_0x3f3c39);});}else{originate(_0x25bee1,_0x11f7f2,![])[_0x0955('0x39')](function(_0x5c1ad2){_0x4765d5(_0x5c1ad2);})['catch'](function(_0x1d5df5){_0x5cd5df(_0x1d5df5);});}});};Fax[_0x0955('0x25')][_0x0955('0x6a')]=function(_0x321219){return!_[_0x0955('0x6b')](_0x321219)&&!_['isNil'](_0x321219['name'])&&!_['isNil'](_0x321219[_0x0955('0x6c')])&&_0x321219[_0x0955('0x6c')]&&!_['isNil'](this[_0x0955('0xd')][util['format'](_0x0955('0x6d'),_0x321219[_0x0955('0x1e')])])&&!_[_0x0955('0x6b')](this['trunks'][util['format'](_0x0955('0x6d'),_0x321219[_0x0955('0x1e')])]['status'])&&(this['trunks'][util['format']('SIP/%s',_0x321219[_0x0955('0x1e')])][_0x0955('0x2a')]===_0x0955('0x6e')||this['trunks'][util[_0x0955('0x60')](_0x0955('0x6d'),_0x321219[_0x0955('0x1e')])][_0x0955('0x2a')]===_0x0955('0x6f'));};Fax[_0x0955('0x25')][_0x0955('0x70')]=function(_0x34c9ad,_0x110add){if(!this['isTrunkReachable'](_0x34c9ad)){ut[_0x0955('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_['isNil'](_0x34c9ad)?'':_0x34c9ad[_0x0955('0x1e')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x0955('0x71')};}if(_[_0x0955('0x6b')](_0x110add['fax'])){ut[_0x0955('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x0955('0x3e')](_0x110add));return{'isValid':![],'message':_0x0955('0x72')};}if(_['isNil'](_0x110add[_0x0955('0x3')])){ut['logger'](_0x0955('0x73'),JSON['stringify'](_0x110add));return{'isValid':![],'message':_0x0955('0x74')};}return{'isValid':!![],'message':_0x0955('0x75')};};module[_0x0955('0x76')]=Fax; \ No newline at end of file +var _0xf71c=['Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','prototype','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','application/pdf','then','notify','parse','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','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','path','execute','%s/%s.tif','dir','XMF-PATH'];(function(_0x29b85d,_0x472608){var _0x594a39=function(_0x483d65){while(--_0x483d65){_0x29b85d['push'](_0x29b85d['shift']());}};_0x594a39(++_0x472608);}(_0xf71c,0x17d));var _0xcf71=function(_0x2e6741,_0x49e427){_0x2e6741=_0x2e6741-0x0;var _0x5c3688=_0xf71c[_0x2e6741];return _0x5c3688;};'use strict';var util=require(_0xcf71('0x0'));var _=require(_0xcf71('0x1'));var BPromise=require(_0xcf71('0x2'));var uuid=require(_0xcf71('0x3'));var moment=require(_0xcf71('0x4'));var path=require('path');var tiff2pdf=require(_0xcf71('0x5'));var gs=require(_0xcf71('0x6'));var logger=require(_0xcf71('0x7'))(_0xcf71('0x8'));var ami=require(_0xcf71('0x9'));var rpcDb=require(_0xcf71('0xa'));var Channel=require(_0xcf71('0xb'));var ut=require(_0xcf71('0xc'));var Action=require(_0xcf71('0xd'));var faxAccount=require(_0xcf71('0xe'));var attachment=require(_0xcf71('0xf'));var faxMessage=require(_0xcf71('0x10'));function Fax(_0x1daad0){this['channels']={};this[_0xcf71('0x11')]=_0x1daad0[_0xcf71('0x11')];this[_0xcf71('0x12')]=_0x1daad0['trunks'];this[_0xcf71('0x13')]={};ami['on'](_0xcf71('0x14'),this[_0xcf71('0x15')][_0xcf71('0x16')](this));ami['on']('varset',this[_0xcf71('0x17')][_0xcf71('0x16')](this));ami['on']('newstate',this[_0xcf71('0x18')]['bind'](this));ami['on'](_0xcf71('0x19'),this[_0xcf71('0x1a')]['bind'](this));ami['on'](_0xcf71('0x1b'),this[_0xcf71('0x1c')]['bind'](this));ami['on'](_0xcf71('0x1d'),this[_0xcf71('0x1e')][_0xcf71('0x16')](this));ami['on'](_0xcf71('0x1f'),this[_0xcf71('0x20')][_0xcf71('0x16')](this));ami['on'](_0xcf71('0x21'),this['syncOriginateResponse']['bind'](this));}Fax['prototype'][_0xcf71('0x15')]=function(_0x4e83e3){if(_0x4e83e3[_0xcf71('0x22')]===_0xcf71('0x23')){for(var _0x85985f in this[_0xcf71('0x11')]){if(this[_0xcf71('0x11')][_0xcf71('0x24')](_0x85985f)){if(_0x4e83e3[_0xcf71('0x25')]===this[_0xcf71('0x11')][_0x85985f]['localstationid']){this[_0xcf71('0x26')][_0x4e83e3['uniqueid']]={};this['channels'][_0x4e83e3[_0xcf71('0x27')]]['channel']=_0x4e83e3[_0xcf71('0x28')];this[_0xcf71('0x26')][_0x4e83e3[_0xcf71('0x27')]]['id']=this[_0xcf71('0x11')][_0x85985f]['id'];this[_0xcf71('0x26')][_0x4e83e3['uniqueid']][_0xcf71('0x29')]=this[_0xcf71('0x11')][_0x85985f][_0xcf71('0x29')];logger[_0xcf71('0x2a')](_0x4e83e3[_0xcf71('0x27')],_0xcf71('0x2b'));}}}}if(this[_0xcf71('0x13')][_0x4e83e3[_0xcf71('0x27')]]){this['channels'][_0x4e83e3[_0xcf71('0x27')]]={};this[_0xcf71('0x26')][_0x4e83e3[_0xcf71('0x27')]][_0xcf71('0x28')]=_0x4e83e3['channel'];logger['info'](_0x4e83e3[_0xcf71('0x27')],_0xcf71('0x2b'));}};Fax['prototype']['syncVarSet']=function(_0x5e57a5){if(this['channels'][_0x5e57a5['uniqueid']]){for(var _0x21e4f9 in _0x5e57a5['variable']){if(_0x5e57a5[_0xcf71('0x2c')][_0xcf71('0x24')](_0x21e4f9)){this[_0xcf71('0x26')][_0x5e57a5['uniqueid']][_0x21e4f9]=_0x5e57a5[_0xcf71('0x2d')];}}}};Fax['prototype'][_0xcf71('0x18')]=function(_0x5602e5){if(this[_0xcf71('0x26')][_0x5602e5[_0xcf71('0x27')]]){this['channels'][_0x5602e5['uniqueid']][_0xcf71('0x2e')]=_0x5602e5['channelstate'];this['channels'][_0x5602e5[_0xcf71('0x27')]][_0xcf71('0x2f')]=_0x5602e5[_0xcf71('0x2f')];}};Fax[_0xcf71('0x30')]['syncNewExten']=function(_0x2b0b4a){if(this['channels'][_0x2b0b4a[_0xcf71('0x27')]]){for(var _0x17e643 in _0x2b0b4a[_0xcf71('0x2c')]){if(_0x2b0b4a['variable']['hasOwnProperty'](_0x17e643)){this['channels'][_0x2b0b4a[_0xcf71('0x27')]][_0x17e643]=_0x2b0b4a[_0xcf71('0x2d')];}}}};Fax['prototype'][_0xcf71('0x1c')]=function(_0x284588){if(this['channels'][_0x284588[_0xcf71('0x27')]]){this[_0xcf71('0x26')][_0x284588[_0xcf71('0x27')]][_0xcf71('0x31')]=_0x284588[_0xcf71('0x31')];this[_0xcf71('0x26')][_0x284588['uniqueid']][_0xcf71('0x32')]=_0x284588[_0xcf71('0x32')];this[_0xcf71('0x26')][_0x284588['uniqueid']][_0xcf71('0x33')]=_0x284588[_0xcf71('0x33')];this[_0xcf71('0x26')][_0x284588[_0xcf71('0x27')]][_0xcf71('0x34')]=_0x284588['filename'];logger[_0xcf71('0x2a')](_0x284588['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xcf71('0x30')]['syncReceiveFax']=function(_0x285164){var _0x5154d3=this;if(this[_0xcf71('0x26')][_0x285164['uniqueid']]){var _0x58b501=this['channels'][_0x285164[_0xcf71('0x27')]]['id'];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x35')]=_0x285164[_0xcf71('0x35')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x36')]=_0x285164[_0xcf71('0x36')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]]['localstationid']=_0x285164[_0xcf71('0x33')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]]['resolution']=_0x285164[_0xcf71('0x37')];this[_0xcf71('0x26')][_0x285164['uniqueid']]['transferrate']=_0x285164['transferrate'];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]]['filename']=_0x285164[_0xcf71('0x34')];this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x38')]=_0x285164[_0xcf71('0x38')];if(this[_0xcf71('0x26')][_0x285164[_0xcf71('0x27')]][_0xcf71('0x36')]>0x0){tiff2pdf(_0x285164['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x3eff47){logger[_0xcf71('0x2a')](_0x285164[_0xcf71('0x27')],_0xcf71('0x39'),_0x3eff47[_0xcf71('0x3a')]);attachment[_0xcf71('0x3b')]({'name':path['parse'](_0x285164['filename'])['name'],'basename':path['parse'](_0x285164[_0xcf71('0x34')])[_0xcf71('0x29')]+'.pdf','type':_0xcf71('0x3c')})[_0xcf71('0x3d')](function(_0x330e35){faxAccount[_0xcf71('0x3e')](_0x58b501,{'from':_0x285164[_0xcf71('0x38')],'mapKey':_0xcf71('0x8'),'body':path[_0xcf71('0x3f')](_0x285164[_0xcf71('0x34')])['name']+_0xcf71('0x40'),'AttachmentId':_0x330e35['id']})[_0xcf71('0x41')](function(_0x42d3c8){logger[_0xcf71('0x42')](_0x285164[_0xcf71('0x27')],_0xcf71('0x43'),JSON['stringify'](_0x42d3c8));});})[_0xcf71('0x41')](function(_0x19b169){logger['error'](_0x285164[_0xcf71('0x27')],'\x20receiveFax\x20',JSON['stringify'](_0x19b169));});});}logger[_0xcf71('0x2a')](_0x285164[_0xcf71('0x27')],_0xcf71('0x44'));}};Fax[_0xcf71('0x30')]['syncOriginateResponse']=function(_0x481624){if(this[_0xcf71('0x13')][_0x481624[_0xcf71('0x27')]]){_['merge'](this[_0xcf71('0x26')][_0x481624[_0xcf71('0x27')]],_[_0xcf71('0x45')](_0x481624,[_0xcf71('0x46'),_0xcf71('0x47')]));}};function updateStatus(_0x2cb26b){if(_0x2cb26b[_0xcf71('0x48')]){faxMessage[_0xcf71('0x49')](_0x2cb26b[_0xcf71('0x48')],{'failMessage':_0xcf71('0x4a')})['then'](function(_0x545c53){ut[_0xcf71('0x4b')](_0xcf71('0x4c'),_0x545c53);})[_0xcf71('0x41')](function(_0x1bcf83){ut[_0xcf71('0x4b')](_0xcf71('0x4d'),_0x1bcf83);});}else{ut[_0xcf71('0x4b')](_0xcf71('0x4e'));}}Fax[_0xcf71('0x30')][_0xcf71('0x4f')]=function(_0x569ad2,_0x467716,_0x21ee8d){var _0x213965=this;var _0x3d9358={};if(_0x467716){_0x3d9358={'read':_0x467716};}else{_0x3d9358={'failMessage':_0x21ee8d};}if(this['actions'][_0x569ad2][_0xcf71('0x48')]){faxMessage[_0xcf71('0x49')](this['actions'][_0x569ad2][_0xcf71('0x48')],_0x3d9358)['then'](function(_0x3013cb){ut[_0xcf71('0x4b')](_0xcf71('0x50'),_0x3013cb);})['catch'](function(_0x31850c){ut[_0xcf71('0x4b')](_0xcf71('0x51'),_0x31850c);})[_0xcf71('0x52')](function(){delete _0x213965[_0xcf71('0x26')][_0x569ad2];delete _0x213965[_0xcf71('0x13')][_0x569ad2];});}else{ut[_0xcf71('0x4b')](_0xcf71('0x53'));delete this[_0xcf71('0x26')][_0x569ad2];delete this[_0xcf71('0x13')][_0x569ad2];}};Fax[_0xcf71('0x30')][_0xcf71('0x20')]=function(_0x2c35d5){var _0x321857=this;if(this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]]){if(this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]){this[_0xcf71('0x26')][_0x2c35d5['uniqueid']]['id']=this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]['id'];this['channels'][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x29')]=this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]['name'];}logger[_0xcf71('0x2a')](_0x2c35d5[_0xcf71('0x27')],this[_0xcf71('0x13')][_0x2c35d5['uniqueid']]?_0xcf71('0x54'):'\x20hangup\x20faxRiceive\x20',JSON[_0xcf71('0x55')](this[_0xcf71('0x26')][_0x2c35d5['uniqueid']]));if(this[_0xcf71('0x13')][_0x2c35d5[_0xcf71('0x27')]]){if(this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x56')]>0x0&&this['channels'][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x1b')]===_0xcf71('0x57')){this[_0xcf71('0x4f')](_0x2c35d5[_0xcf71('0x27')],!![]);}else{this[_0xcf71('0x4f')](_0x2c35d5['uniqueid'],![],this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x58')]?_0xcf71('0x59')+this[_0xcf71('0x26')][_0x2c35d5[_0xcf71('0x27')]][_0xcf71('0x58')]:_0xcf71('0x5a'));}}}};Fax[_0xcf71('0x30')]['send']=function(_0x1ff276){var _0xdd293c=this;return new BPromise(function(_0x3b1140,_0x55366c){_0xdd293c[_0xcf71('0x5b')](_0x1ff276,_0xdd293c[_0xcf71('0x11')][_0x1ff276[_0xcf71('0x5c')]])[_0xcf71('0x3d')](function(_0xedc0de){ut[_0xcf71('0x4b')](_0xcf71('0x5d'),_0xedc0de);_0x3b1140(ut[_0xcf71('0x3a')](_0xcf71('0x5e')));})[_0xcf71('0x41')](function(_0x269c4c){ut['logger']('[Fax][execOriginate][failure]',_0x269c4c);updateStatus(_0x1ff276);_0x55366c(ut[_0xcf71('0x3a')](_0xcf71('0x5f')));});});};Fax['prototype'][_0xcf71('0x60')]=function(_0x20f435){var _0x122143=this;return new BPromise(function(_0x19880a,_0x5be48e){var _0x4ac0f0=_0x122143[_0xcf71('0x61')](_0x122143[_0xcf71('0x11')][_0x20f435[_0xcf71('0x5c')]][_0xcf71('0x62')],_0x20f435);if(_0x4ac0f0[_0xcf71('0x63')]){_0x19880a(ut[_0xcf71('0x3a')]('Trunk\x20Reachable'));}else{_0x5be48e(ut[_0xcf71('0x3a')](_0x4ac0f0[_0xcf71('0x3a')]));}});};function originate(_0x1e4ad8,_0x24a477,_0x5464fd){return new BPromise(function(_0x16d6be,_0x566388){if(_0x5464fd){var _0xa0866c=util[_0xcf71('0x64')](_0xcf71('0x65'),path['parse'](_0x1e4ad8[_0xcf71('0x66')])[_0xcf71('0x29')],_0x1e4ad8[_0xcf71('0x66')]);gs[_0xcf71('0x67')](_0xa0866c)[_0xcf71('0x3d')](function(){_0x1e4ad8['path']=util[_0xcf71('0x64')](_0xcf71('0x68'),path[_0xcf71('0x3f')](_0x1e4ad8[_0xcf71('0x66')])[_0xcf71('0x69')],path['parse'](_0x1e4ad8['path'])[_0xcf71('0x29')]);_0x24a477[_0xcf71('0x6a')]=_0x1e4ad8[_0xcf71('0x66')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0xcf71('0x6b')](ut[_0xcf71('0x6c')](_0x1e4ad8,_0x24a477))[_0xcf71('0x3d')](function(_0x54d363){_0x16d6be(_0x54d363);})[_0xcf71('0x41')](function(_0x227925){_0x566388(_0x227925);});})[_0xcf71('0x41')](function(_0x47cb19){_0x566388(_0x47cb19);});}else{ami['Action'](ut['variablesAction'](_0x1e4ad8,_0x24a477))[_0xcf71('0x3d')](function(_0x3ab807){_0x16d6be(_0x3ab807);})[_0xcf71('0x41')](function(_0xaa839d){_0x566388(_0xaa839d);});}});}Fax[_0xcf71('0x30')][_0xcf71('0x5b')]=function(_0x1f77fc,_0x497bfe){var _0x53c9d1=this;return new BPromise(function(_0x18b20e,_0x4ab87d){var _0x35e0c9=uuid['v4']();var _0x459c5f=ut[_0xcf71('0x6d')](_0x1f77fc,_0x497bfe);_0x53c9d1[_0xcf71('0x13')][_0x35e0c9]=new Action(_0x35e0c9,_0x497bfe,_0x1f77fc);var _0x4b9a5d=_0x53c9d1[_0xcf71('0x13')][_0x35e0c9];if(path[_0xcf71('0x3f')](_0x1f77fc[_0xcf71('0x66')])[_0xcf71('0x6e')]===_0xcf71('0x40')){originate(_0x4b9a5d,_0x459c5f,!![])[_0xcf71('0x3d')](function(_0x565d3d){_0x18b20e(_0x565d3d);})['catch'](function(_0x3e72ff){_0x4ab87d(_0x3e72ff);});}else{originate(_0x4b9a5d,_0x459c5f,![])[_0xcf71('0x3d')](function(_0x5052d2){_0x18b20e(_0x5052d2);})[_0xcf71('0x41')](function(_0x19576e){_0x4ab87d(_0x19576e);});}});};Fax[_0xcf71('0x30')]['isTrunkReachable']=function(_0x30e744){return!_[_0xcf71('0x6f')](_0x30e744)&&!_[_0xcf71('0x6f')](_0x30e744[_0xcf71('0x29')])&&!_['isNil'](_0x30e744['active'])&&_0x30e744[_0xcf71('0x70')]&&!_[_0xcf71('0x6f')](this[_0xcf71('0x12')][util[_0xcf71('0x64')](_0xcf71('0x71'),_0x30e744['name'])])&&!_[_0xcf71('0x6f')](this[_0xcf71('0x12')][util[_0xcf71('0x64')](_0xcf71('0x71'),_0x30e744['name'])][_0xcf71('0x32')])&&(this[_0xcf71('0x12')][util[_0xcf71('0x64')](_0xcf71('0x71'),_0x30e744[_0xcf71('0x29')])][_0xcf71('0x32')]===_0xcf71('0x72')||this[_0xcf71('0x12')][util[_0xcf71('0x64')]('SIP/%s',_0x30e744[_0xcf71('0x29')])]['status']===_0xcf71('0x73'));};Fax[_0xcf71('0x30')][_0xcf71('0x61')]=function(_0xfcf18,_0x9ab7d9){if(!this[_0xcf71('0x74')](_0xfcf18)){ut[_0xcf71('0x4b')](_0xcf71('0x75'),_[_0xcf71('0x6f')](_0xfcf18)?'':_0xfcf18['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xcf71('0x6f')](_0x9ab7d9[_0xcf71('0x8')])){ut['logger'](_0xcf71('0x76'),JSON['stringify'](_0x9ab7d9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x9ab7d9[_0xcf71('0x66')])){ut[_0xcf71('0x4b')](_0xcf71('0x77'),JSON[_0xcf71('0x55')](_0x9ab7d9));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xcf71('0x78')};};module[_0xcf71('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e08979d..a811bd4 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 _0x8144=['resolve','catch','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x8144,0x11a));var _0x4814=function(_0x18fb80,_0x29869f){_0x18fb80=_0x18fb80-0x0;var _0x92aba1=_0x8144[_0x18fb80];return _0x92aba1;};'use strict';var util=require(_0x4814('0x0'));var BPromise=require('bluebird');var logger=require(_0x4814('0x1'))(_0x4814('0x2'));var _=require(_0x4814('0x3'));var faxAccount=require(_0x4814('0x4'));function loggerCatch(_0x2d79c3){return function(_0x1496f6){logger[_0x4814('0x5')](_0x2d79c3,util['inspect'](_0x1496f6,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xfe37b2,_0x4afff8){return BPromise[_0x4814('0x6')]()['then'](faxAccount['notify'](_0xfe37b2,_0x4afff8))[_0x4814('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xf209=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x214070,_0x38277e){var _0x358944=function(_0x582963){while(--_0x582963){_0x214070['push'](_0x214070['shift']());}};_0x358944(++_0x38277e);}(_0xf209,0xe0));var _0x9f20=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0xf209[_0x8854f2];return _0x38505d;};'use strict';var util=require(_0x9f20('0x0'));var BPromise=require(_0x9f20('0x1'));var logger=require(_0x9f20('0x2'))(_0x9f20('0x3'));var _=require(_0x9f20('0x4'));var faxAccount=require(_0x9f20('0x5'));function loggerCatch(_0x570e75){return function(_0x58fe02){logger[_0x9f20('0x6')](_0x570e75,util[_0x9f20('0x7')](_0x58fe02,{'showHidden':![],'depth':null}));};}exports[_0x9f20('0x8')]=function(_0x46f87d,_0x4809ea){return BPromise[_0x9f20('0x9')]()[_0x9f20('0xa')](faxAccount[_0x9f20('0x8')](_0x46f87d,_0x4809ea))[_0x9f20('0xb')](loggerCatch(_0x9f20('0xc')));}; \ 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 4e23245..7b5bcea 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 _0x75b8=['util','../../../../config/logger','fax','child_process','execute','info','Exec\x20gs','inspect'];(function(_0x1c97d3,_0x3a6f0a){var _0x1d58f2=function(_0x4f4dc1){while(--_0x4f4dc1){_0x1c97d3['push'](_0x1c97d3['shift']());}};_0x1d58f2(++_0x3a6f0a);}(_0x75b8,0x100));var _0x875b=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0x75b8[_0x4d08b8];return _0x70214a;};'use strict';var util=require(_0x875b('0x0'));var logger=require(_0x875b('0x1'))(_0x875b('0x2'));var BPromise=require('bluebird');var exec=require(_0x875b('0x3'))['exec'];exports[_0x875b('0x4')]=function(_0x5d0050){return new BPromise(function(_0x1ccd68,_0x402451){exec(_0x5d0050,function(_0x435d26,_0x68e379,_0x25cfa9){logger[_0x875b('0x5')]('Exec\x20gs',_0x68e379);if(_0x435d26){logger[_0x875b('0x5')](_0x875b('0x6'),'\x20Error\x20:',util[_0x875b('0x7')](_0x435d26,{'showHidden':![],'depth':null}),_0x68e379,_0x25cfa9);_0x402451(_0x435d26);}_0x1ccd68(_0x68e379);});});}; \ No newline at end of file +var _0x7fae=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x5850ae,_0x15db0b){var _0x232a73=function(_0x57820c){while(--_0x57820c){_0x5850ae['push'](_0x5850ae['shift']());}};_0x232a73(++_0x15db0b);}(_0x7fae,0xd1));var _0xe7fa=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x7fae[_0xa148b7];return _0x51efd3;};'use strict';var util=require(_0xe7fa('0x0'));var logger=require(_0xe7fa('0x1'))(_0xe7fa('0x2'));var BPromise=require(_0xe7fa('0x3'));var exec=require(_0xe7fa('0x4'))[_0xe7fa('0x5')];exports[_0xe7fa('0x6')]=function(_0x35251e){return new BPromise(function(_0x527448,_0x25d45d){exec(_0x35251e,function(_0x5ac4ef,_0x346fed,_0x2efc06){logger[_0xe7fa('0x7')](_0xe7fa('0x8'),_0x346fed);if(_0x5ac4ef){logger[_0xe7fa('0x7')](_0xe7fa('0x8'),_0xe7fa('0x9'),util[_0xe7fa('0xa')](_0x5ac4ef,{'showHidden':![],'depth':null}),_0x346fed,_0x2efc06);_0x25d45d(_0x5ac4ef);}_0x527448(_0x346fed);});});}; \ 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 269c3c2..bc6e2f2 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 _0xf335=['maxrate','format','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','util','moment','../../../../config/logger','fax','message','info','addVariables','ecm','minrate'];(function(_0x5f15c4,_0x3db215){var _0x28d1d2=function(_0x488f19){while(--_0x488f19){_0x5f15c4['push'](_0x5f15c4['shift']());}};_0x28d1d2(++_0x3db215);}(_0xf335,0x195));var _0x5f33=function(_0xc6a818,_0x2e0c14){_0xc6a818=_0xc6a818-0x0;var _0x57feef=_0xf335[_0xc6a818];return _0x57feef;};'use strict';var util=require(_0x5f33('0x0'));var _=require('lodash');var moment=require(_0x5f33('0x1'));var logger=require(_0x5f33('0x2'))(_0x5f33('0x3'));exports[_0x5f33('0x4')]=function(_0x6ba549){return{'message':_0x6ba549};};exports['logger']=function(_0x3e7cb7,_0x39b9de){logger[_0x5f33('0x5')](_0x3e7cb7,util['inspect'](_0x39b9de,{'showHidden':![],'depth':null}));};exports[_0x5f33('0x6')]=function(_0x487f43,_0xdccb27){var _0x7d0201={'XMF-ECM':_0xdccb27[_0x5f33('0x7')],'XMF-HEADERINFO':_0xdccb27['headerinfo'],'XMF-MINRATE':_0xdccb27[_0x5f33('0x8')],'XMF-MAXRATE':_0xdccb27[_0x5f33('0x9')],'XMF-MODEM':util[_0x5f33('0xa')](_0x5f33('0xb'),_0xdccb27['modem']),'XMF-GATEWAY':_0xdccb27['gateway'],'XMF-FAXDETECT':_0xdccb27[_0x5f33('0xc')],'XMF-T38TIMEOUT':_0xdccb27[_0x5f33('0xd')],'XMF-LOCALSTATIONID':_0xdccb27[_0x5f33('0xe')],'XMF-PATH':_0x487f43[_0x5f33('0xf')]};return _0x7d0201;};exports[_0x5f33('0x10')]=function(_0x36b202,_0x22029f){return{'actionid':_0x36b202['uniqueid'],'action':_0x5f33('0x11'),'channel':_0x36b202[_0x5f33('0x12')],'Exten':'xcally-motion-fax','Context':_0x5f33('0x13'),'Priority':'1','callerid':util[_0x5f33('0xa')](_0x5f33('0x14'),_0x36b202[_0x5f33('0x15')]?_0x36b202[_0x5f33('0x15')]:'',_0x36b202['localstationid']),'variable':_0x22029f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x36b202[_0x5f33('0x16')]};}; \ No newline at end of file +var _0x4e48=['addVariables','ecm','headerinfo','minrate','format','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','message','logger','info','inspect'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x4e48,0x83));var _0x84e4=function(_0x41df5b,_0x2251e0){_0x41df5b=_0x41df5b-0x0;var _0x3b503c=_0x4e48[_0x41df5b];return _0x3b503c;};'use strict';var util=require(_0x84e4('0x0'));var _=require(_0x84e4('0x1'));var moment=require(_0x84e4('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0x84e4('0x3')]=function(_0x20a8a8){return{'message':_0x20a8a8};};exports[_0x84e4('0x4')]=function(_0x4c428a,_0x3b305e){logger[_0x84e4('0x5')](_0x4c428a,util[_0x84e4('0x6')](_0x3b305e,{'showHidden':![],'depth':null}));};exports[_0x84e4('0x7')]=function(_0x26670c,_0x4e4ddc){var _0x405fa2={'XMF-ECM':_0x4e4ddc[_0x84e4('0x8')],'XMF-HEADERINFO':_0x4e4ddc[_0x84e4('0x9')],'XMF-MINRATE':_0x4e4ddc[_0x84e4('0xa')],'XMF-MAXRATE':_0x4e4ddc['maxrate'],'XMF-MODEM':util[_0x84e4('0xb')]('\x22%s\x22',_0x4e4ddc[_0x84e4('0xc')]),'XMF-GATEWAY':_0x4e4ddc[_0x84e4('0xd')],'XMF-FAXDETECT':_0x4e4ddc['faxdetect'],'XMF-T38TIMEOUT':_0x4e4ddc[_0x84e4('0xe')],'XMF-LOCALSTATIONID':_0x4e4ddc[_0x84e4('0xf')],'XMF-PATH':_0x26670c['path']};return _0x405fa2;};exports[_0x84e4('0x10')]=function(_0x201656,_0x1686f1){return{'actionid':_0x201656[_0x84e4('0x11')],'action':_0x84e4('0x12'),'channel':_0x201656[_0x84e4('0x13')],'Exten':_0x84e4('0x14'),'Context':_0x84e4('0x15'),'Priority':'1','callerid':util[_0x84e4('0xb')](_0x84e4('0x16'),_0x201656[_0x84e4('0x9')]?_0x201656[_0x84e4('0x9')]:'',_0x201656[_0x84e4('0xf')]),'variable':_0x1686f1,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x201656[_0x84e4('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 50bf9f9..c5a8623 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 _0xe8e2=['getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','resolve','then','getTelephones','initTelephones','getTrunks','initTrunks','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0xe8e2,0x98));var _0x2e8e=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xe8e2[_0x5a3cf0];return _0x5a64ee;};'use strict';var util=require(_0x2e8e('0x0'));var moment=require(_0x2e8e('0x1'));var server=require(_0x2e8e('0x2'));var Realtime=require(_0x2e8e('0x3'));var Report=require('./report');var Acw=require(_0x2e8e('0x4'));var Trigger=require(_0x2e8e('0x5'));var Dialer=require(_0x2e8e('0x6'));var Preview=require(_0x2e8e('0x7'));var Fax=require('./fax');var user=require(_0x2e8e('0x8'));var voiceQueue=require(_0x2e8e('0x9'));var voiceQueueReport=require(_0x2e8e('0xa'));var voiceCallReport=require(_0x2e8e('0xb'));var trunk=require(_0x2e8e('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x2e8e('0xd'));var cmHopperHistory=require(_0x2e8e('0xe'));var campaign=require(_0x2e8e('0xf'));var voiceExtension=require(_0x2e8e('0x10'));var faxAccount=require(_0x2e8e('0x11'));var zendesk=require(_0x2e8e('0x12'));var salesforce=require(_0x2e8e('0x13'));var sugarcrm=require(_0x2e8e('0x14'));var freshdesk=require(_0x2e8e('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x2e8e('0x16'));var vtiger=require(_0x2e8e('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x2e8e('0x18'));var dynamics365=require(_0x2e8e('0x19'));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(_0x2e8e('0x1a'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2e8e('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2e8e('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x2e8e('0x1c')]()['then'](user['getAgents']())[_0x2e8e('0x1d')](realtime['initAgents']())['then'](user[_0x2e8e('0x1e')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x1f')]())[_0x2e8e('0x1d')](trunk[_0x2e8e('0x20')]())['then'](realtime[_0x2e8e('0x21')]())[_0x2e8e('0x1d')](voiceQueue['getVoiceQueues']())[_0x2e8e('0x1d')](realtime['initVoiceQueues']())['then'](trigger[_0x2e8e('0x22')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x23')]())[_0x2e8e('0x1d')](template[_0x2e8e('0x24')]())[_0x2e8e('0x1d')](realtime['initTemplates']())[_0x2e8e('0x1d')](zendesk[_0x2e8e('0x25')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x26')]())[_0x2e8e('0x1d')](salesforce['getSalesforceAccounts']())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x27')]())[_0x2e8e('0x1d')](sugarcrm[_0x2e8e('0x28')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x29')]())['then'](freshdesk[_0x2e8e('0x2a')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x2b')]())[_0x2e8e('0x1d')](desk[_0x2e8e('0x2c')]())[_0x2e8e('0x1d')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x2d')]())[_0x2e8e('0x1d')](vtiger[_0x2e8e('0x2e')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x2f')]())[_0x2e8e('0x1d')](freshsales['getFreshsalesAccounts']())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x30')]())[_0x2e8e('0x1d')](servicenow[_0x2e8e('0x31')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x32')]())[_0x2e8e('0x1d')](dynamics365['getDynamics365Accounts']())[_0x2e8e('0x1d')](realtime['initDynamics365Accounts']())['then'](campaign[_0x2e8e('0x33')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x34')]())[_0x2e8e('0x1d')](voiceExtension[_0x2e8e('0x35')]())[_0x2e8e('0x1d')](realtime['initVoiceExtensions']())[_0x2e8e('0x1d')](faxAccount['getFaxAccounts']())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x36')]())[_0x2e8e('0x1d')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x2e8e('0x1d')](voiceQueueReport[_0x2e8e('0x37')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x38')]())[_0x2e8e('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x39')]())[_0x2e8e('0x1d')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x2e8e('0x3a')]())[_0x2e8e('0x1d')](realtime[_0x2e8e('0x3b')]())[_0x2e8e('0x3c')](function(_0x33ee79){logger[_0x2e8e('0x3d')](_0x2e8e('0x3e'),util[_0x2e8e('0x3f')](_0x33ee79,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2e8e('0x40')](realtime,preview,fax)[_0x2e8e('0x1d')](function(){return initRealtime();})[_0x2e8e('0x1d')](function(){return initParams();})[_0x2e8e('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x2e8e('0x3c')](function(_0x25e04a){logger[_0x2e8e('0x3d')](_0x2e8e('0x41'),util['inspect'](_0x25e04a,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x92a4=['./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','hour','get','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92a4,0x71));var _0x492a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x92a4[_0x138adb];return _0x1b27f2;};'use strict';var util=require('util');var moment=require('moment');var server=require(_0x492a('0x0'));var Realtime=require(_0x492a('0x1'));var Report=require(_0x492a('0x2'));var Acw=require(_0x492a('0x3'));var Trigger=require('./trigger');var Dialer=require(_0x492a('0x4'));var Preview=require(_0x492a('0x5'));var Fax=require(_0x492a('0x6'));var user=require(_0x492a('0x7'));var voiceQueue=require(_0x492a('0x8'));var voiceQueueReport=require(_0x492a('0x9'));var voiceCallReport=require(_0x492a('0xa'));var trunk=require(_0x492a('0xb'));var trigger=require(_0x492a('0xc'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x492a('0xd'));var voiceExtension=require(_0x492a('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x492a('0xf'));var salesforce=require(_0x492a('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x492a('0x11'));var desk=require(_0x492a('0x12'));var zoho=require(_0x492a('0x13'));var vtiger=require(_0x492a('0x14'));var freshsales=require(_0x492a('0x15'));var servicenow=require(_0x492a('0x16'));var dynamics365=require(_0x492a('0x17'));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(_0x492a('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x492a('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x492a('0x1a')](_0x492a('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x492a('0x1b')]()['then'](user['getAgents']())[_0x492a('0x1c')](realtime[_0x492a('0x1d')]())[_0x492a('0x1c')](user[_0x492a('0x1e')]())[_0x492a('0x1c')](realtime[_0x492a('0x1f')]())[_0x492a('0x1c')](trunk[_0x492a('0x20')]())[_0x492a('0x1c')](realtime['initTrunks']())[_0x492a('0x1c')](voiceQueue['getVoiceQueues']())[_0x492a('0x1c')](realtime[_0x492a('0x21')]())[_0x492a('0x1c')](trigger['getTriggers']())[_0x492a('0x1c')](realtime[_0x492a('0x22')]())['then'](template['getTemplates']())[_0x492a('0x1c')](realtime[_0x492a('0x23')]())[_0x492a('0x1c')](zendesk[_0x492a('0x24')]())[_0x492a('0x1c')](realtime['initZendeskAccounts']())[_0x492a('0x1c')](salesforce[_0x492a('0x25')]())[_0x492a('0x1c')](realtime[_0x492a('0x26')]())['then'](sugarcrm[_0x492a('0x27')]())[_0x492a('0x1c')](realtime[_0x492a('0x28')]())['then'](freshdesk[_0x492a('0x29')]())[_0x492a('0x1c')](realtime['initFreshdeskAccounts']())[_0x492a('0x1c')](desk[_0x492a('0x2a')]())[_0x492a('0x1c')](realtime['initDeskAccounts']())[_0x492a('0x1c')](zoho[_0x492a('0x2b')]())[_0x492a('0x1c')](realtime[_0x492a('0x2c')]())['then'](vtiger[_0x492a('0x2d')]())[_0x492a('0x1c')](realtime['initVtigerAccounts']())[_0x492a('0x1c')](freshsales['getFreshsalesAccounts']())[_0x492a('0x1c')](realtime[_0x492a('0x2e')]())[_0x492a('0x1c')](servicenow[_0x492a('0x2f')]())[_0x492a('0x1c')](realtime[_0x492a('0x30')]())[_0x492a('0x1c')](dynamics365[_0x492a('0x31')]())[_0x492a('0x1c')](realtime[_0x492a('0x32')]())[_0x492a('0x1c')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0x492a('0x1c')](voiceExtension['getVoiceExtensions']())[_0x492a('0x1c')](realtime[_0x492a('0x33')]())[_0x492a('0x1c')](faxAccount[_0x492a('0x34')]())[_0x492a('0x1c')](realtime[_0x492a('0x35')]())[_0x492a('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x492a('0x1b')]()[_0x492a('0x1c')](voiceQueueReport[_0x492a('0x36')]())[_0x492a('0x1c')](realtime[_0x492a('0x37')]())['then'](cmHopperHistory[_0x492a('0x38')]())[_0x492a('0x1c')](realtime[_0x492a('0x39')]())['then'](cmHopperHistory[_0x492a('0x3a')]())[_0x492a('0x1c')](realtime['initCampaignHopperHistory']())[_0x492a('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x492a('0x3b')]())[_0x492a('0x3c')](function(_0x27eb4b){logger[_0x492a('0x3d')](_0x492a('0x3e'),util[_0x492a('0x3f')](_0x27eb4b,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x492a('0x1c')](function(){return initRealtime();})[_0x492a('0x1c')](function(){return initParams();})[_0x492a('0x1c')](function(){report[_0x492a('0x40')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x5bb602){logger[_0x492a('0x3d')]('[index.js][main]',util[_0x492a('0x3f')](_0x5bb602,{'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 db3f1c4..32df9bb 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 _0x15d6=['omit','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','voiceStatusQueue','stringify','format','user:%s','emit','user:ami:update'];(function(_0x117d62,_0x6649c2){var _0x6719c2=function(_0x473cde){while(--_0x473cde){_0x117d62['push'](_0x117d62['shift']());}};_0x6719c2(++_0x6649c2);}(_0x15d6,0xb3));var _0x615d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15d6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x615d('0x0'));var util=require(_0x615d('0x1'));var moment=require(_0x615d('0x2'));var md5=require(_0x615d('0x3'));var Redis=require(_0x615d('0x4'));var config=require(_0x615d('0x5'));config[_0x615d('0x6')]=_[_0x615d('0x7')](config[_0x615d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x615d('0x8'))(new Redis(config[_0x615d('0x6')]));function Agent(_0x5296d4){this['id']=_0x5296d4['id']||0x0;this['name']=_0x5296d4[_0x615d('0x9')]||'';this[_0x615d('0xa')]=_0x5296d4[_0x615d('0xa')]||'';this[_0x615d('0xb')]=_0x5296d4[_0x615d('0xb')]||'';this[_0x615d('0xc')]=_0x5296d4['fullname']||'';this['state']=_0x615d('0xd');this[_0x615d('0xe')]=0x0;this[_0x615d('0xf')]=_0x615d('0xd');this[_0x615d('0x10')]='';this[_0x615d('0x11')]='';this[_0x615d('0x12')]='';this[_0x615d('0x13')]='';this[_0x615d('0x14')]=_0x5296d4[_0x615d('0x14')]||![];this[_0x615d('0x15')]='unknown';this['voiceStatusTime']=0x0;this[_0x615d('0x16')]='';this['voiceStatusQueue']='';this[_0x615d('0x17')]=![];this[_0x615d('0x18')]=![];this[_0x615d('0x3')]='';}Agent[_0x615d('0x19')][_0x615d('0x1a')]=function(_0x5e57a6){var _0x4faea6;if(_0x5e57a6&&_0x5e57a6[_0x615d('0x1b')]){_0x4faea6=_0x5e57a6[_0x615d('0x1b')][_0x615d('0x1c')]();switch(_0x4faea6){case _0x615d('0x1d'):_0x4faea6=_0x615d('0x1e');break;case _0x615d('0x1f'):_0x4faea6=_0x615d('0x20');break;}}if(_0x4faea6&&this[_0x615d('0x15')]!==_0x4faea6||_0x5e57a6[_0x615d('0x21')]){this[_0x615d('0x22')]=_['toNumber'](moment()['format']('x'));}if(_0x4faea6){this[_0x615d('0x15')]=_0x4faea6;}var _0x45ab39={'id':this['id'],'name':this[_0x615d('0x9')],'email':this[_0x615d('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x615d('0xc')],'state':this[_0x615d('0x1b')],'stateTime':this['stateTime'],'status':this[_0x615d('0xf')],'address':this[_0x615d('0x10')],'online':this['online'],'voiceStatus':this[_0x615d('0x15')],'voiceStatusTime':this[_0x615d('0x22')],'voiceStatusCallerIdNumber':this[_0x615d('0x16')],'voiceStatusQueue':this[_0x615d('0x23')],'interface':this[_0x615d('0x13')],'onhold':this['onhold']};var _0x27c173=md5(JSON[_0x615d('0x24')](_0x45ab39));if(this['md5']!==_0x27c173){this['md5']=_0x27c173;io['to'](util[_0x615d('0x25')](_0x615d('0x26'),_0x45ab39['name']))[_0x615d('0x27')](_0x615d('0x28'),_[_0x615d('0x29')](_0x45ab39,[_0x615d('0x14')]));io['emit'](_0x615d('0x2a'),_0x45ab39);}};module[_0x615d('0x2b')]=Agent; \ No newline at end of file +var _0x7397=['state','stateTime','status','address','phone','interface','online','voiceStatus','unknown','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','stringify','emit','user:ami:update','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname'];(function(_0x14a731,_0x38be9b){var _0x324e00=function(_0x334ab0){while(--_0x334ab0){_0x14a731['push'](_0x14a731['shift']());}};_0x324e00(++_0x38be9b);}(_0x7397,0xbc));var _0x7739=function(_0x3bb7d4,_0x1cc2a8){_0x3bb7d4=_0x3bb7d4-0x0;var _0x3293d4=_0x7397[_0x3bb7d4];return _0x3293d4;};'use strict';var _=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var moment=require('moment');var md5=require(_0x7739('0x2'));var Redis=require(_0x7739('0x3'));var config=require(_0x7739('0x4'));config[_0x7739('0x5')]=_[_0x7739('0x6')](config[_0x7739('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7739('0x7'))(new Redis(config[_0x7739('0x5')]));function Agent(_0xaa8c05){this['id']=_0xaa8c05['id']||0x0;this[_0x7739('0x8')]=_0xaa8c05[_0x7739('0x8')]||'';this['email']=_0xaa8c05[_0x7739('0x9')]||'';this[_0x7739('0xa')]=_0xaa8c05[_0x7739('0xa')]||'';this[_0x7739('0xb')]=_0xaa8c05[_0x7739('0xb')]||'';this[_0x7739('0xc')]='unknown';this[_0x7739('0xd')]=0x0;this[_0x7739('0xe')]='unknown';this[_0x7739('0xf')]='';this[_0x7739('0x10')]='';this['mobile']='';this[_0x7739('0x11')]='';this[_0x7739('0x12')]=_0xaa8c05['online']||![];this[_0x7739('0x13')]=_0x7739('0x14');this[_0x7739('0x15')]=0x0;this[_0x7739('0x16')]='';this[_0x7739('0x17')]='';this[_0x7739('0x18')]=![];this[_0x7739('0x19')]=![];this[_0x7739('0x2')]='';}Agent[_0x7739('0x1a')][_0x7739('0x1b')]=function(_0x3fc748){var _0x2224b7;if(_0x3fc748&&_0x3fc748['state']){_0x2224b7=_0x3fc748[_0x7739('0xc')][_0x7739('0x1c')]();switch(_0x2224b7){case _0x7739('0x1d'):_0x2224b7=_0x7739('0x1e');break;case'inuse':_0x2224b7=_0x7739('0x1f');break;}}if(_0x2224b7&&this[_0x7739('0x13')]!==_0x2224b7||_0x3fc748[_0x7739('0x20')]){this[_0x7739('0x15')]=_[_0x7739('0x21')](moment()[_0x7739('0x22')]('x'));}if(_0x2224b7){this[_0x7739('0x13')]=_0x2224b7;}var _0x53b47e={'id':this['id'],'name':this[_0x7739('0x8')],'email':this[_0x7739('0x9')],'accountcode':this[_0x7739('0xa')],'fullname':this['fullname'],'state':this[_0x7739('0xc')],'stateTime':this['stateTime'],'status':this[_0x7739('0xe')],'address':this[_0x7739('0xf')],'online':this[_0x7739('0x12')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x7739('0x15')],'voiceStatusCallerIdNumber':this[_0x7739('0x16')],'voiceStatusQueue':this[_0x7739('0x17')],'interface':this['interface'],'onhold':this[_0x7739('0x18')]};var _0x2e9b2b=md5(JSON[_0x7739('0x23')](_0x53b47e));if(this[_0x7739('0x2')]!==_0x2e9b2b){this[_0x7739('0x2')]=_0x2e9b2b;io['to'](util['format']('user:%s',_0x53b47e[_0x7739('0x8')]))[_0x7739('0x24')](_0x7739('0x25'),_['omit'](_0x53b47e,[_0x7739('0x12')]));io[_0x7739('0x24')](_0x7739('0x26'),_0x53b47e);}};module[_0x7739('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 859a4f6..71149f7 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 _0x88dd=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88dd,0x98));var _0xd88d=function(_0x36f569,_0x4c2933){_0x36f569=_0x36f569-0x0;var _0x5ba075=_0x88dd[_0x36f569];return _0x5ba075;};'use strict';function Campaign(_0x32ad99){this['id']=_0x32ad99['id']||0x0;this['name']=_0x32ad99[_0xd88d('0x0')]||'';this[_0xd88d('0x1')]=_0x32ad99['type']||_0xd88d('0x2');this[_0xd88d('0x3')]=0x0;this[_0xd88d('0x4')]=0x0;this[_0xd88d('0x5')]=0x0;this[_0xd88d('0x6')]=0x0;this['message']='';this[_0xd88d('0x7')]=!![];this[_0xd88d('0x8')]=_0x32ad99[_0xd88d('0x8')];this['limitCalls']=_0x32ad99[_0xd88d('0x9')];this[_0xd88d('0xa')]=_0x32ad99[_0xd88d('0xa')]||null;this['dialGlobalInterval']=_0x32ad99[_0xd88d('0xb')]?_0x32ad99[_0xd88d('0xb')]:null;this[_0xd88d('0xc')]=_0x32ad99[_0xd88d('0xc')];this[_0xd88d('0xd')]=_0x32ad99[_0xd88d('0xd')];this[_0xd88d('0xe')]=_0x32ad99['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x32ad99[_0xd88d('0xf')];this['dialCongestionRetryFrequency']=_0x32ad99[_0xd88d('0x10')];this['dialBusyMaxRetry']=_0x32ad99[_0xd88d('0x11')];this[_0xd88d('0x12')]=_0x32ad99[_0xd88d('0x12')];this[_0xd88d('0x13')]=_0x32ad99[_0xd88d('0x13')];this[_0xd88d('0x14')]=_0x32ad99[_0xd88d('0x14')];this[_0xd88d('0x15')]=_0x32ad99[_0xd88d('0x15')];this['dialNoSuchNumberMaxRetry']=_0x32ad99[_0xd88d('0x16')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x32ad99['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd88d('0x17')]=_0x32ad99[_0xd88d('0x17')]||0x3;this[_0xd88d('0x18')]=_0x32ad99[_0xd88d('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x32ad99[_0xd88d('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x32ad99[_0xd88d('0x1a')]||0x96;this[_0xd88d('0x1b')]=_0x32ad99[_0xd88d('0x1b')]||0x3;this[_0xd88d('0x1c')]=_0x32ad99['dialMachineRetryFrequency']||0x96;this[_0xd88d('0x1d')]=_0x32ad99[_0xd88d('0x1d')]||0x3;this[_0xd88d('0x1e')]=_0x32ad99[_0xd88d('0x1e')]||0x96;this[_0xd88d('0x1f')]=_0x32ad99[_0xd88d('0x1f')]||_0xd88d('0x20');this[_0xd88d('0x21')]=_0x32ad99[_0xd88d('0x21')]||undefined;this[_0xd88d('0x22')]=_0x32ad99[_0xd88d('0x22')]||undefined;this[_0xd88d('0x23')]=_0x32ad99[_0xd88d('0x23')]||undefined;this[_0xd88d('0x24')]=_0x32ad99['TrunkBackup']?_0x32ad99[_0xd88d('0x24')]:undefined;this[_0xd88d('0x25')]=_0x32ad99[_0xd88d('0x25')]?_0x32ad99['Trunk']:undefined;this[_0xd88d('0x26')]=_0x32ad99[_0xd88d('0x26')]?_0x32ad99[_0xd88d('0x26')]:undefined;this[_0xd88d('0x27')]=_0x32ad99['SquareProject']?_0x32ad99[_0xd88d('0x27')]:undefined;this[_0xd88d('0x28')]=_0x32ad99['SquareProject']?_0x32ad99['SquareProject']['name']:undefined;this['dialAMDActive']=_0x32ad99['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x32ad99['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x32ad99[_0xd88d('0x29')];this[_0xd88d('0x2a')]=_0x32ad99['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x32ad99[_0xd88d('0x2b')];this[_0xd88d('0x2c')]=_0x32ad99[_0xd88d('0x2c')];this[_0xd88d('0x2d')]=_0x32ad99['dialAMDBetweenWordsSilence'];this[_0xd88d('0x2e')]=_0x32ad99[_0xd88d('0x2e')];this[_0xd88d('0x2f')]=_0x32ad99[_0xd88d('0x2f')];this[_0xd88d('0x30')]=_0x32ad99[_0xd88d('0x30')];}module['exports']=Campaign; \ No newline at end of file +var _0x089e=['name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports'];(function(_0x319d24,_0x5a394a){var _0x303128=function(_0x797542){while(--_0x797542){_0x319d24['push'](_0x319d24['shift']());}};_0x303128(++_0x5a394a);}(_0x089e,0x96));var _0xe089=function(_0x5bb56e,_0xa87aec){_0x5bb56e=_0x5bb56e-0x0;var _0x13ab69=_0x089e[_0x5bb56e];return _0x13ab69;};'use strict';function Campaign(_0x5d437f){this['id']=_0x5d437f['id']||0x0;this['name']=_0x5d437f[_0xe089('0x0')]||'';this['type']=_0x5d437f[_0xe089('0x1')]||_0xe089('0x2');this[_0xe089('0x3')]=0x0;this[_0xe089('0x4')]=0x0;this[_0xe089('0x5')]=0x0;this[_0xe089('0x6')]=0x0;this[_0xe089('0x7')]='';this[_0xe089('0x8')]=!![];this[_0xe089('0x9')]=_0x5d437f['active'];this[_0xe089('0xa')]=_0x5d437f['limitCalls'];this[_0xe089('0xb')]=_0x5d437f[_0xe089('0xb')]||null;this[_0xe089('0xc')]=_0x5d437f['dialGlobalInterval']?_0x5d437f[_0xe089('0xc')]:null;this[_0xe089('0xd')]=_0x5d437f[_0xe089('0xd')];this['dialOriginateCallerIdNumber']=_0x5d437f[_0xe089('0xe')];this[_0xe089('0xf')]=_0x5d437f[_0xe089('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x5d437f[_0xe089('0x10')];this['dialCongestionRetryFrequency']=_0x5d437f['dialCongestionRetryFrequency'];this[_0xe089('0x11')]=_0x5d437f[_0xe089('0x11')];this[_0xe089('0x12')]=_0x5d437f[_0xe089('0x12')];this[_0xe089('0x13')]=_0x5d437f[_0xe089('0x13')];this[_0xe089('0x14')]=_0x5d437f['dialNoAnswerRetryFrequency'];this[_0xe089('0x15')]=_0x5d437f[_0xe089('0x15')];this['dialNoSuchNumberMaxRetry']=_0x5d437f['dialNoSuchNumberMaxRetry']||0x3;this[_0xe089('0x16')]=_0x5d437f[_0xe089('0x16')]||0x96;this[_0xe089('0x17')]=_0x5d437f[_0xe089('0x17')]||0x3;this[_0xe089('0x18')]=_0x5d437f['dialDropRetryFrequency']||0x96;this[_0xe089('0x19')]=_0x5d437f[_0xe089('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x5d437f[_0xe089('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x5d437f['dialMachineMaxRetry']||0x3;this[_0xe089('0x1b')]=_0x5d437f[_0xe089('0x1b')]||0x96;this[_0xe089('0x1c')]=_0x5d437f[_0xe089('0x1c')]||0x3;this[_0xe089('0x1d')]=_0x5d437f[_0xe089('0x1d')]||0x96;this[_0xe089('0x1e')]=_0x5d437f['dialOrderByScheduledAt']||_0xe089('0x1f');this[_0xe089('0x20')]=_0x5d437f['dialPrefix']||undefined;this[_0xe089('0x21')]=_0x5d437f[_0xe089('0x21')]||undefined;this[_0xe089('0x22')]=_0x5d437f[_0xe089('0x22')]||undefined;this[_0xe089('0x23')]=_0x5d437f[_0xe089('0x23')]?_0x5d437f['TrunkBackup']:undefined;this[_0xe089('0x24')]=_0x5d437f[_0xe089('0x24')]?_0x5d437f['Trunk']:undefined;this[_0xe089('0x25')]=_0x5d437f[_0xe089('0x25')]?_0x5d437f[_0xe089('0x25')]:undefined;this[_0xe089('0x26')]=_0x5d437f[_0xe089('0x26')]?_0x5d437f['SquareProject']:undefined;this[_0xe089('0x27')]=_0x5d437f[_0xe089('0x26')]?_0x5d437f[_0xe089('0x26')][_0xe089('0x0')]:undefined;this[_0xe089('0x28')]=_0x5d437f[_0xe089('0x28')]||![];this[_0xe089('0x29')]=_0x5d437f[_0xe089('0x29')];this[_0xe089('0x2a')]=_0x5d437f[_0xe089('0x2a')];this[_0xe089('0x2b')]=_0x5d437f[_0xe089('0x2b')];this['dialAMDTotalAnalysisTime']=_0x5d437f[_0xe089('0x2c')];this['dialAMDMinWordLength']=_0x5d437f['dialAMDMinWordLength'];this[_0xe089('0x2d')]=_0x5d437f[_0xe089('0x2d')];this[_0xe089('0x2e')]=_0x5d437f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5d437f[_0xe089('0x2f')];this[_0xe089('0x30')]=_0x5d437f[_0xe089('0x30')];}module[_0xe089('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 457c0c9..d7a6720 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 _0x6017=['answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','accountcode','uniqueid','answered'];(function(_0x970c02,_0x57a4f7){var _0x2d46e7=function(_0x53b28f){while(--_0x53b28f){_0x970c02['push'](_0x970c02['shift']());}};_0x2d46e7(++_0x57a4f7);}(_0x6017,0xae));var _0x7601=function(_0x1e664c,_0xf7a29d){_0x1e664c=_0x1e664c-0x0;var _0x13a6b4=_0x6017[_0x1e664c];return _0x13a6b4;};'use strict';function Channel(){this[_0x7601('0x0')]=null;this[_0x7601('0x1')]='';this[_0x7601('0x2')]='';this['calleridnum']=0x0;this[_0x7601('0x3')]='';this[_0x7601('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x7601('0x5')]=0x0;this['context']='';this[_0x7601('0x6')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x7601('0x7')]=![];this[_0x7601('0x8')]=null;this[_0x7601('0x9')]=null;this[_0x7601('0xa')]=![];this[_0x7601('0xb')]=![];this[_0x7601('0xc')]='';this['lastdata']='';this[_0x7601('0xd')]=0x0;this[_0x7601('0xe')]=0x0;this[_0x7601('0xf')]=0x0;this['type']=null;this[_0x7601('0x10')]=null;this[_0x7601('0x11')]=null;this[_0x7601('0x12')]=![];this['monitorFilename']=null;this[_0x7601('0x13')]=null;this[_0x7601('0x14')]=[];this[_0x7601('0x15')]=undefined;this[_0x7601('0x16')]=undefined;this[_0x7601('0x17')]=undefined;this[_0x7601('0x18')]=0x0;}module[_0x7601('0x19')]=Channel; \ No newline at end of file +var _0x9d62=['connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname'];(function(_0x3517c9,_0x165394){var _0x15b3cf=function(_0x5472a0){while(--_0x5472a0){_0x3517c9['push'](_0x3517c9['shift']());}};_0x15b3cf(++_0x165394);}(_0x9d62,0xaf));var _0x29d6=function(_0xa5f4ee,_0x391ca0){_0xa5f4ee=_0xa5f4ee-0x0;var _0x36b64c=_0x9d62[_0xa5f4ee];return _0x36b64c;};'use strict';function Channel(){this[_0x29d6('0x0')]=null;this[_0x29d6('0x1')]='';this[_0x29d6('0x2')]='';this[_0x29d6('0x3')]=0x0;this[_0x29d6('0x4')]='';this['connectedlinenum']=undefined;this[_0x29d6('0x5')]=undefined;this[_0x29d6('0x6')]=0x0;this[_0x29d6('0x7')]='';this[_0x29d6('0x8')]=0x0;this[_0x29d6('0x9')]=0x0;this['exten']=0x0;this[_0x29d6('0xa')]=![];this[_0x29d6('0xb')]=null;this[_0x29d6('0xc')]=null;this[_0x29d6('0xd')]=![];this[_0x29d6('0xe')]=![];this[_0x29d6('0xf')]='';this['lastdata']='';this[_0x29d6('0x10')]=0x0;this[_0x29d6('0x11')]=0x0;this[_0x29d6('0x12')]=0x0;this[_0x29d6('0x13')]=null;this[_0x29d6('0x14')]=null;this[_0x29d6('0x15')]=null;this[_0x29d6('0x16')]=![];this[_0x29d6('0x17')]=null;this['queue']=null;this[_0x29d6('0x18')]=[];this[_0x29d6('0x19')]=undefined;this[_0x29d6('0x1a')]=undefined;this[_0x29d6('0x1b')]=undefined;this[_0x29d6('0x1c')]=0x0;}module[_0x29d6('0x1d')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index def7e20..d4daafa 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 _0xad62=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x2be9e6,_0x1ae09b){var _0xf6e837=function(_0x4148be){while(--_0x4148be){_0x2be9e6['push'](_0x2be9e6['shift']());}};_0xf6e837(++_0x1ae09b);}(_0xad62,0x16c));var _0x2ad6=function(_0x5a01f5,_0x21803a){_0x5a01f5=_0x5a01f5-0x0;var _0x5ecf7c=_0xad62[_0x5a01f5];return _0x5ecf7c;};'use strict';function DeskAccount(_0x931499){this['id']=_0x931499['id']||0x0;this[_0x2ad6('0x0')]=_0x931499[_0x2ad6('0x0')]||'';this[_0x2ad6('0x1')]=_0x931499[_0x2ad6('0x1')]||'';this[_0x2ad6('0x2')]=_0x931499[_0x2ad6('0x2')]||'';this[_0x2ad6('0x3')]=_0x931499[_0x2ad6('0x3')]||'';this[_0x2ad6('0x4')]=_0x931499['password']||'';this[_0x2ad6('0x5')]=_0x931499['consumerKey']||'';this['consumerSecret']=_0x931499[_0x2ad6('0x6')]||'';this['token']=_0x931499[_0x2ad6('0x7')]||'';this['tokenSecret']=_0x931499['tokenSecret']||'';this[_0x2ad6('0x8')]=_0x931499[_0x2ad6('0x8')]||'';this[_0x2ad6('0x9')]=_0x931499[_0x2ad6('0x9')]||'';this[_0x2ad6('0xa')]=_0x931499[_0x2ad6('0xa')]||{};}module[_0x2ad6('0xb')]=DeskAccount; \ No newline at end of file +var _0xc295=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x69fb6a,_0x46ec8d){var _0x2faee2=function(_0x56b079){while(--_0x56b079){_0x69fb6a['push'](_0x69fb6a['shift']());}};_0x2faee2(++_0x46ec8d);}(_0xc295,0x101));var _0x5c29=function(_0x5ec565,_0x266986){_0x5ec565=_0x5ec565-0x0;var _0x1667c3=_0xc295[_0x5ec565];return _0x1667c3;};'use strict';function DeskAccount(_0x45964e){this['id']=_0x45964e['id']||0x0;this['name']=_0x45964e[_0x5c29('0x0')]||'';this[_0x5c29('0x1')]=_0x45964e['username']||'';this[_0x5c29('0x2')]=_0x45964e[_0x5c29('0x2')]||'';this[_0x5c29('0x3')]=_0x45964e[_0x5c29('0x3')]||'';this[_0x5c29('0x4')]=_0x45964e['password']||'';this[_0x5c29('0x5')]=_0x45964e[_0x5c29('0x5')]||'';this[_0x5c29('0x6')]=_0x45964e[_0x5c29('0x6')]||'';this['token']=_0x45964e[_0x5c29('0x7')]||'';this[_0x5c29('0x8')]=_0x45964e['tokenSecret']||'';this['type']=_0x45964e[_0x5c29('0x9')]||'';this[_0x5c29('0xa')]=_0x45964e['serverUrl']||'';this['Configurations']=_0x45964e[_0x5c29('0xb')]||{};}module[_0x5c29('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 4518baf..f26c1b3 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 _0x475a=['clientSecret','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x57225f,_0x4ead47){var _0x16b844=function(_0x803b1d){while(--_0x803b1d){_0x57225f['push'](_0x57225f['shift']());}};_0x16b844(++_0x4ead47);}(_0x475a,0x165));var _0xa475=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x475a[_0x122ef9];return _0x42fba0;};'use strict';function Dynamics365Account(_0x461d11){this['id']=_0x461d11['id']||0x0;this[_0xa475('0x0')]=_0x461d11[_0xa475('0x0')]||'';this['username']=_0x461d11[_0xa475('0x1')]||'';this[_0xa475('0x2')]=_0x461d11[_0xa475('0x2')]||'';this[_0xa475('0x3')]=_0x461d11['remoteUri']||'';this[_0xa475('0x4')]=_0x461d11[_0xa475('0x4')]||'';this[_0xa475('0x5')]=_0x461d11[_0xa475('0x5')]||'';this[_0xa475('0x6')]=_0x461d11[_0xa475('0x6')]||{};this['serverUrl']=_0x461d11['serverUrl']||'';this[_0xa475('0x7')]=_0x461d11['modernAuthentication']||![];this[_0xa475('0x8')]=_0x461d11['Configurations']||{};this[_0xa475('0x9')]=_0x461d11['CloudProvider']||{};}module[_0xa475('0xa')]=Dynamics365Account; \ No newline at end of file +var _0xd12e=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','CloudProvider','exports'];(function(_0x5c3406,_0xca2423){var _0x5afe5b=function(_0x2e7048){while(--_0x2e7048){_0x5c3406['push'](_0x5c3406['shift']());}};_0x5afe5b(++_0xca2423);}(_0xd12e,0x14a));var _0xed12=function(_0x2aa6e6,_0x44abb0){_0x2aa6e6=_0x2aa6e6-0x0;var _0x2cb7f0=_0xd12e[_0x2aa6e6];return _0x2cb7f0;};'use strict';function Dynamics365Account(_0x45e280){this['id']=_0x45e280['id']||0x0;this[_0xed12('0x0')]=_0x45e280['name']||'';this[_0xed12('0x1')]=_0x45e280[_0xed12('0x1')]||'';this[_0xed12('0x2')]=_0x45e280[_0xed12('0x2')]||'';this[_0xed12('0x3')]=_0x45e280[_0xed12('0x3')]||'';this[_0xed12('0x4')]=_0x45e280[_0xed12('0x4')]||'';this[_0xed12('0x5')]=_0x45e280[_0xed12('0x5')]||'';this[_0xed12('0x6')]=_0x45e280['clientSecret']||{};this[_0xed12('0x7')]=_0x45e280[_0xed12('0x7')]||'';this['modernAuthentication']=_0x45e280['modernAuthentication']||![];this['Configurations']=_0x45e280['Configurations']||{};this[_0xed12('0x8')]=_0x45e280[_0xed12('0x8')]||{};}module[_0xed12('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 5024073..6420192 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 _0x568e=['tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout'];(function(_0x384c96,_0x363897){var _0x145217=function(_0xb3b50){while(--_0xb3b50){_0x384c96['push'](_0x384c96['shift']());}};_0x145217(++_0x363897);}(_0x568e,0x121));var _0xe568=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x568e[_0x543084];return _0x306a57;};'use strict';function FaxAccount(_0x15250d){this['id']=_0x15250d['id']||0x0;this[_0xe568('0x0')]=_0x15250d['name']||'';this[_0xe568('0x1')]=_0x15250d['description'];this['ecm']=_0x15250d[_0xe568('0x2')];this['headerinfo']=_0x15250d[_0xe568('0x3')];this[_0xe568('0x4')]=_0x15250d['localstationid'];this[_0xe568('0x5')]=_0x15250d[_0xe568('0x5')]||0x960;this['maxrate']=_0x15250d[_0xe568('0x6')]||0x3840;this[_0xe568('0x7')]=_0x15250d[_0xe568('0x7')]||_0xe568('0x8');this[_0xe568('0x9')]=_0x15250d[_0xe568('0x9')]||'no';this['faxdetect']=_0x15250d['faxdetect']||'no';this['t38timeout']=_0x15250d[_0xe568('0xa')]||0x1388;this[_0xe568('0xb')]=_0x15250d['tech']||'SIP';this[_0xe568('0xc')]=_0x15250d['Trunk']?_0x15250d['Trunk']:undefined;this[_0xe568('0xd')]=_0x15250d['ListId'];this[_0xe568('0xe')]=_0x15250d[_0xe568('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x9bb2=['Trunk','ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9bb2,0xc4));var _0x29bb=function(_0x518526,_0x38d6ea){_0x518526=_0x518526-0x0;var _0x2034d9=_0x9bb2[_0x518526];return _0x2034d9;};'use strict';function FaxAccount(_0x4dc777){this['id']=_0x4dc777['id']||0x0;this['name']=_0x4dc777[_0x29bb('0x0')]||'';this[_0x29bb('0x1')]=_0x4dc777[_0x29bb('0x1')];this[_0x29bb('0x2')]=_0x4dc777[_0x29bb('0x2')];this['headerinfo']=_0x4dc777['headerinfo'];this[_0x29bb('0x3')]=_0x4dc777['localstationid'];this[_0x29bb('0x4')]=_0x4dc777[_0x29bb('0x4')]||0x960;this['maxrate']=_0x4dc777[_0x29bb('0x5')]||0x3840;this[_0x29bb('0x6')]=_0x4dc777['modem']||'v17,v27,v29';this[_0x29bb('0x7')]=_0x4dc777['gateway']||'no';this[_0x29bb('0x8')]=_0x4dc777[_0x29bb('0x8')]||'no';this[_0x29bb('0x9')]=_0x4dc777['t38timeout']||0x1388;this[_0x29bb('0xa')]=_0x4dc777[_0x29bb('0xa')]||_0x29bb('0xb');this[_0x29bb('0xc')]=_0x4dc777[_0x29bb('0xc')]?_0x4dc777[_0x29bb('0xc')]:undefined;this[_0x29bb('0xd')]=_0x4dc777[_0x29bb('0xd')];this[_0x29bb('0xe')]=_0x4dc777[_0x29bb('0xe')];}module[_0x29bb('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 a4c47ec..741f32b 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 _0x2625=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x45bc61,_0x3b5f81){var _0x50eddd=function(_0x179ad4){while(--_0x179ad4){_0x45bc61['push'](_0x45bc61['shift']());}};_0x50eddd(++_0x3b5f81);}(_0x2625,0x108));var _0x5262=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x2625[_0x710815];return _0x5b3b89;};'use strict';function FreshdeskAccount(_0x9375cf){this['id']=_0x9375cf['id']||0x0;this['name']=_0x9375cf[_0x5262('0x0')]||'';this[_0x5262('0x1')]=_0x9375cf[_0x5262('0x1')]||'';this[_0x5262('0x2')]=_0x9375cf[_0x5262('0x3')]||'';this[_0x5262('0x4')]=_0x9375cf[_0x5262('0x4')]||'';this[_0x5262('0x5')]=_0x9375cf[_0x5262('0x5')]||'';this[_0x5262('0x6')]=_0x9375cf[_0x5262('0x6')]||{};}module[_0x5262('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xa460=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x57e1ac,_0x1e0b48){var _0x274975=function(_0x1f7f56){while(--_0x1f7f56){_0x57e1ac['push'](_0x57e1ac['shift']());}};_0x274975(++_0x1e0b48);}(_0xa460,0xd9));var _0x0a46=function(_0x2d51cc,_0x2ca3e2){_0x2d51cc=_0x2d51cc-0x0;var _0x3dc46b=_0xa460[_0x2d51cc];return _0x3dc46b;};'use strict';function FreshdeskAccount(_0x30c9a6){this['id']=_0x30c9a6['id']||0x0;this[_0x0a46('0x0')]=_0x30c9a6[_0x0a46('0x0')]||'';this['username']=_0x30c9a6[_0x0a46('0x1')]||'';this[_0x0a46('0x2')]=_0x30c9a6[_0x0a46('0x3')]||'';this[_0x0a46('0x4')]=_0x30c9a6[_0x0a46('0x4')]||'';this[_0x0a46('0x5')]=_0x30c9a6[_0x0a46('0x5')]||'';this[_0x0a46('0x6')]=_0x30c9a6[_0x0a46('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 4638546..5e98927 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 _0xe0ae=['username','apiKey','remoteUri','serverUrl','exports','name'];(function(_0x168fd1,_0x4f2489){var _0x262412=function(_0x6ee57c){while(--_0x6ee57c){_0x168fd1['push'](_0x168fd1['shift']());}};_0x262412(++_0x4f2489);}(_0xe0ae,0xa1));var _0xee0a=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xe0ae[_0x43a6cd];return _0x5acb36;};'use strict';function FreshsalesAccount(_0x2a3755){this['id']=_0x2a3755['id']||0x0;this['name']=_0x2a3755[_0xee0a('0x0')]||'';this[_0xee0a('0x1')]=_0x2a3755['username']||'';this[_0xee0a('0x2')]=_0x2a3755['token']||'';this[_0xee0a('0x3')]=_0x2a3755[_0xee0a('0x3')]||'';this['serverUrl']=_0x2a3755[_0xee0a('0x4')]||'';this['Configurations']=_0x2a3755['Configurations']||{};}module[_0xee0a('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x212b=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3b92d4,_0x92961e){var _0x2fb2c3=function(_0x5baa50){while(--_0x5baa50){_0x3b92d4['push'](_0x3b92d4['shift']());}};_0x2fb2c3(++_0x92961e);}(_0x212b,0x148));var _0xb212=function(_0x166978,_0x59f928){_0x166978=_0x166978-0x0;var _0x788da7=_0x212b[_0x166978];return _0x788da7;};'use strict';function FreshsalesAccount(_0x4fab1b){this['id']=_0x4fab1b['id']||0x0;this['name']=_0x4fab1b[_0xb212('0x0')]||'';this[_0xb212('0x1')]=_0x4fab1b[_0xb212('0x1')]||'';this[_0xb212('0x2')]=_0x4fab1b['token']||'';this[_0xb212('0x3')]=_0x4fab1b[_0xb212('0x3')]||'';this[_0xb212('0x4')]=_0x4fab1b['serverUrl']||'';this[_0xb212('0x5')]=_0x4fab1b[_0xb212('0x5')]||{};}module[_0xb212('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 5978d60..6f986a9 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 _0x9cda=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','exten','holdtime','assigned','motionChannel','voice','routealias','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x1469c2,_0x582b51){var _0x593ee5=function(_0x38dd9e){while(--_0x38dd9e){_0x1469c2['push'](_0x1469c2['shift']());}};_0x593ee5(++_0x582b51);}(_0x9cda,0x102));var _0xa9cd=function(_0x14aa60,_0x29a3d7){_0x14aa60=_0x14aa60-0x0;var _0x5d6348=_0x9cda[_0x14aa60];return _0x5d6348;};'use strict';function QueueReport(){this[_0xa9cd('0x0')]=_0xa9cd('0x1');this[_0xa9cd('0x2')]='';this[_0xa9cd('0x3')]='';this[_0xa9cd('0x4')]='';this['queue']='';this[_0xa9cd('0x5')]=null;this[_0xa9cd('0x6')]=null;this[_0xa9cd('0x7')]=0x1;this[_0xa9cd('0x8')]=0x1;this[_0xa9cd('0x9')]=![];this[_0xa9cd('0xa')]=null;this[_0xa9cd('0xb')]=![];this[_0xa9cd('0xc')]=null;this[_0xa9cd('0xd')]=![];this[_0xa9cd('0xe')]=null;this[_0xa9cd('0xf')]=0x1;this[_0xa9cd('0x10')]='';this[_0xa9cd('0x11')]='';this[_0xa9cd('0x12')]='';this['accountcode']='';this['context']='';this[_0xa9cd('0x13')]='';this['priority']='';this[_0xa9cd('0x14')]=0x0;this[_0xa9cd('0x15')]=![];this['lastAssignedTo']='';this[_0xa9cd('0x16')]=_0xa9cd('0x17');this[_0xa9cd('0x18')]=null;this['mohtime']=0x0;this[_0xa9cd('0x19')]={};}module[_0xa9cd('0x1a')]=QueueReport; \ No newline at end of file +var _0x94e1=['connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','routealias','variables','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','channel'];(function(_0x1043b6,_0x356a58){var _0x3a9abe=function(_0x247057){while(--_0x247057){_0x1043b6['push'](_0x1043b6['shift']());}};_0x3a9abe(++_0x356a58);}(_0x94e1,0x106));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';function QueueReport(){this[_0x194e('0x0')]=_0x194e('0x1');this[_0x194e('0x2')]='';this[_0x194e('0x3')]='';this['calleridname']='';this['queue']='';this[_0x194e('0x4')]=null;this[_0x194e('0x5')]=null;this[_0x194e('0x6')]=0x1;this[_0x194e('0x7')]=0x1;this[_0x194e('0x8')]=![];this[_0x194e('0x9')]=null;this['queuecallercomplete']=![];this[_0x194e('0xa')]=null;this['queuecallerexit']=![];this[_0x194e('0xb')]=null;this['originalposition']=0x1;this[_0x194e('0xc')]='';this[_0x194e('0xd')]='';this[_0x194e('0xe')]='';this[_0x194e('0xf')]='';this[_0x194e('0x10')]='';this[_0x194e('0x11')]='';this[_0x194e('0x12')]='';this[_0x194e('0x13')]=0x0;this['assigned']=![];this[_0x194e('0x14')]='';this[_0x194e('0x15')]=_0x194e('0x16');this[_0x194e('0x17')]=null;this['mohtime']=0x0;this[_0x194e('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 5893b2b..4505f9e 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 _0xd929=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xd929,0x167));var _0x9d92=function(_0x5c0c44,_0x214568){_0x5c0c44=_0x5c0c44-0x0;var _0x16f543=_0xd929[_0x5c0c44];return _0x16f543;};'use strict';function SalesforceAccount(_0x44b669){this['id']=_0x44b669['id']||0x0;this['name']=_0x44b669[_0x9d92('0x0')]||'';this[_0x9d92('0x1')]=_0x44b669[_0x9d92('0x1')]||'';this[_0x9d92('0x2')]=_0x44b669[_0x9d92('0x2')]||'';this[_0x9d92('0x3')]=_0x44b669[_0x9d92('0x3')]||'';this[_0x9d92('0x4')]=_0x44b669[_0x9d92('0x4')]||'';this[_0x9d92('0x5')]=_0x44b669['clientSecret']||'';this[_0x9d92('0x6')]=_0x44b669[_0x9d92('0x6')]||'';this[_0x9d92('0x7')]=_0x44b669[_0x9d92('0x7')]||_0x9d92('0x8');this[_0x9d92('0x9')]=_0x44b669['serverUrl']||'';this['Configurations']=_0x44b669[_0x9d92('0xa')]||{};}module[_0x9d92('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x71d5=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x71d5,0x109));var _0x571d=function(_0x2c6af3,_0x3ce442){_0x2c6af3=_0x2c6af3-0x0;var _0x4895bf=_0x71d5[_0x2c6af3];return _0x4895bf;};'use strict';function SalesforceAccount(_0x502cba){this['id']=_0x502cba['id']||0x0;this[_0x571d('0x0')]=_0x502cba['name']||'';this['username']=_0x502cba[_0x571d('0x1')]||'';this[_0x571d('0x2')]=_0x502cba[_0x571d('0x2')]||'';this[_0x571d('0x3')]=_0x502cba[_0x571d('0x3')]||'';this[_0x571d('0x4')]=_0x502cba[_0x571d('0x4')]||'';this[_0x571d('0x5')]=_0x502cba[_0x571d('0x5')]||'';this['securityToken']=_0x502cba[_0x571d('0x6')]||'';this[_0x571d('0x7')]=_0x502cba[_0x571d('0x7')]||_0x571d('0x8');this[_0x571d('0x9')]=_0x502cba[_0x571d('0x9')]||'';this[_0x571d('0xa')]=_0x502cba[_0x571d('0xa')]||{};}module[_0x571d('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index b3747b0..d0b7442 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 _0xf695=['Configurations','name','username','password','remoteUri'];(function(_0x5c404f,_0x24c51a){var _0x1ac9e1=function(_0x4f305a){while(--_0x4f305a){_0x5c404f['push'](_0x5c404f['shift']());}};_0x1ac9e1(++_0x24c51a);}(_0xf695,0x1cd));var _0x5f69=function(_0xacc3ef,_0xf7feec){_0xacc3ef=_0xacc3ef-0x0;var _0x58082f=_0xf695[_0xacc3ef];return _0x58082f;};'use strict';function ServicenowAccount(_0x4b6a3e){this['id']=_0x4b6a3e['id']||0x0;this[_0x5f69('0x0')]=_0x4b6a3e[_0x5f69('0x0')]||'';this[_0x5f69('0x1')]=_0x4b6a3e[_0x5f69('0x1')]||'';this[_0x5f69('0x2')]=_0x4b6a3e[_0x5f69('0x2')]||'';this[_0x5f69('0x3')]=_0x4b6a3e['remoteUri']||'';this['serverUrl']=_0x4b6a3e['serverUrl']||'';this[_0x5f69('0x4')]=_0x4b6a3e['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x50eb=['serverUrl','Configurations','exports','name','username','password'];(function(_0x208392,_0x4328ef){var _0x479ae3=function(_0x20331d){while(--_0x20331d){_0x208392['push'](_0x208392['shift']());}};_0x479ae3(++_0x4328ef);}(_0x50eb,0x1b9));var _0xb50e=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x50eb[_0x1f36bb];return _0xaf97fa;};'use strict';function ServicenowAccount(_0x55d1fc){this['id']=_0x55d1fc['id']||0x0;this[_0xb50e('0x0')]=_0x55d1fc[_0xb50e('0x0')]||'';this[_0xb50e('0x1')]=_0x55d1fc[_0xb50e('0x1')]||'';this[_0xb50e('0x2')]=_0x55d1fc['password']||'';this['remoteUri']=_0x55d1fc['remoteUri']||'';this[_0xb50e('0x3')]=_0x55d1fc[_0xb50e('0x3')]||'';this[_0xb50e('0x4')]=_0x55d1fc[_0xb50e('0x4')]||{};}module[_0xb50e('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 5dd318f..4b767c8 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 _0x39e6=['remoteUri','serverUrl','Configurations','exports','username','password'];(function(_0x30b7b0,_0x5255cf){var _0x5024ef=function(_0x1c82d5){while(--_0x1c82d5){_0x30b7b0['push'](_0x30b7b0['shift']());}};_0x5024ef(++_0x5255cf);}(_0x39e6,0x178));var _0x639e=function(_0xe382fb,_0x579f68){_0xe382fb=_0xe382fb-0x0;var _0x580452=_0x39e6[_0xe382fb];return _0x580452;};'use strict';function SugarcrmAccount(_0x4dab30){this['id']=_0x4dab30['id']||0x0;this['name']=_0x4dab30['name']||'';this[_0x639e('0x0')]=_0x4dab30[_0x639e('0x0')]||'';this['password']=_0x4dab30[_0x639e('0x1')]||'';this[_0x639e('0x2')]=_0x4dab30['remoteUri']||'';this[_0x639e('0x3')]=_0x4dab30['serverUrl']||'';this[_0x639e('0x4')]=_0x4dab30[_0x639e('0x4')]||{};}module[_0x639e('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xee6f=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x2cb885,_0x588f87){var _0x3cbcc3=function(_0x375ae7){while(--_0x375ae7){_0x2cb885['push'](_0x2cb885['shift']());}};_0x3cbcc3(++_0x588f87);}(_0xee6f,0x137));var _0xfee6=function(_0x1cb783,_0x197145){_0x1cb783=_0x1cb783-0x0;var _0x4fae14=_0xee6f[_0x1cb783];return _0x4fae14;};'use strict';function SugarcrmAccount(_0x481587){this['id']=_0x481587['id']||0x0;this[_0xfee6('0x0')]=_0x481587[_0xfee6('0x0')]||'';this[_0xfee6('0x1')]=_0x481587[_0xfee6('0x1')]||'';this[_0xfee6('0x2')]=_0x481587['password']||'';this[_0xfee6('0x3')]=_0x481587[_0xfee6('0x3')]||'';this[_0xfee6('0x4')]=_0x481587[_0xfee6('0x4')]||'';this[_0xfee6('0x5')]=_0x481587[_0xfee6('0x5')]||{};}module[_0xfee6('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 462e0e6..568b3fc 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 _0x3a0f=['unknown','stateTime','status','address','exports','name','accountcode','state'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0x3a0f,0x75));var _0xf3a0=function(_0x499127,_0x161977){_0x499127=_0x499127-0x0;var _0x32bf4c=_0x3a0f[_0x499127];return _0x32bf4c;};'use strict';function Telephone(_0x34978e){this['id']=_0x34978e['id']||0x0;this[_0xf3a0('0x0')]=_0x34978e[_0xf3a0('0x0')]||'';this['accountcode']=_0x34978e[_0xf3a0('0x1')]||'';this[_0xf3a0('0x2')]=_0xf3a0('0x3');this[_0xf3a0('0x4')]=0x0;this[_0xf3a0('0x5')]=_0xf3a0('0x3');this[_0xf3a0('0x6')]='';}module[_0xf3a0('0x7')]=Telephone; \ No newline at end of file +var _0x65aa=['name','accountcode','state','unknown','status','address','exports'];(function(_0x50686c,_0x460e57){var _0x2b0c44=function(_0x33f7dd){while(--_0x33f7dd){_0x50686c['push'](_0x50686c['shift']());}};_0x2b0c44(++_0x460e57);}(_0x65aa,0x142));var _0xa65a=function(_0x96b4c9,_0x15f4da){_0x96b4c9=_0x96b4c9-0x0;var _0x5791df=_0x65aa[_0x96b4c9];return _0x5791df;};'use strict';function Telephone(_0x11d953){this['id']=_0x11d953['id']||0x0;this['name']=_0x11d953[_0xa65a('0x0')]||'';this['accountcode']=_0x11d953[_0xa65a('0x1')]||'';this[_0xa65a('0x2')]=_0xa65a('0x3');this['stateTime']=0x0;this[_0xa65a('0x4')]=_0xa65a('0x3');this[_0xa65a('0x5')]='';}module[_0xa65a('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 53775e6..dc0235d 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(_0x81fe57,_0x5a55ac){var _0xf5174d=function(_0x59e7c4){while(--_0x59e7c4){_0x81fe57['push'](_0x81fe57['shift']());}};_0xf5174d(++_0x5a55ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x3f42c8,_0x2d4fea){var _0x2f7e69=function(_0x165465){while(--_0x165465){_0x3f42c8['push'](_0x3f42c8['shift']());}};_0x2f7e69(++_0x2d4fea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 404c313..d8dd7f9 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x4dff31,_0x816dff){var _0x55d286=function(_0x347d17){while(--_0x347d17){_0x4dff31['push'](_0x4dff31['shift']());}};_0x55d286(++_0x816dff);}(_0x14a0,0x8e));var _0x014a=function(_0x48bcca,_0x29905e){_0x48bcca=_0x48bcca-0x0;var _0x101817=_0x14a0[_0x48bcca];return _0x101817;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 9faf04d..dd01954 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 _0xc096=['indexOf','split','host','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','stateTime','status','registry'];(function(_0x35ddcd,_0x168614){var _0x190c1e=function(_0x5ad476){while(--_0x5ad476){_0x35ddcd['push'](_0x35ddcd['shift']());}};_0x190c1e(++_0x168614);}(_0xc096,0x99));var _0x6c09=function(_0x54a24b,_0x423b2b){_0x54a24b=_0x54a24b-0x0;var _0x3c8bec=_0xc096[_0x54a24b];return _0x3c8bec;};'use strict';function Trunk(_0x56ef08){this['id']=_0x56ef08['id']||0x0;this[_0x6c09('0x0')]=_0x56ef08[_0x6c09('0x0')]||![];this['name']=_0x56ef08[_0x6c09('0x1')]||'';this[_0x6c09('0x2')]=_0x6c09('0x3');this[_0x6c09('0x4')]=0x0;this[_0x6c09('0x5')]='unknown';this[_0x6c09('0x6')]=_0x56ef08[_0x6c09('0x6')]&&_0x56ef08[_0x6c09('0x6')][_0x6c09('0x7')](':')?_0x56ef08['registry'][_0x6c09('0x8')](':')[0x0]:'';this[_0x6c09('0x9')]='';this['port']='';this[_0x6c09('0xa')]='';this[_0x6c09('0xb')]='';this[_0x6c09('0xc')]='';this[_0x6c09('0xd')]='unknown';this[_0x6c09('0xe')]='';this['address']='';this[_0x6c09('0xf')]=_0x56ef08[_0x6c09('0xf')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x14e3=['unknown','stateTime','status','registry','indexOf','split','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state'];(function(_0x574d5c,_0x50b123){var _0x1d919b=function(_0x311e20){while(--_0x311e20){_0x574d5c['push'](_0x574d5c['shift']());}};_0x1d919b(++_0x50b123);}(_0x14e3,0x15d));var _0x314e=function(_0x485859,_0x27221e){_0x485859=_0x485859-0x0;var _0x510bb8=_0x14e3[_0x485859];return _0x510bb8;};'use strict';function Trunk(_0x396210){this['id']=_0x396210['id']||0x0;this[_0x314e('0x0')]=_0x396210[_0x314e('0x0')]||![];this[_0x314e('0x1')]=_0x396210[_0x314e('0x1')]||'';this[_0x314e('0x2')]=_0x314e('0x3');this[_0x314e('0x4')]=0x0;this[_0x314e('0x5')]='unknown';this[_0x314e('0x6')]=_0x396210[_0x314e('0x6')]&&_0x396210['registry'][_0x314e('0x7')](':')?_0x396210[_0x314e('0x6')][_0x314e('0x8')](':')[0x0]:'';this['host']='';this['port']='';this[_0x314e('0x9')]='';this[_0x314e('0xa')]='';this[_0x314e('0xb')]='';this[_0x314e('0xc')]=_0x314e('0x3');this[_0x314e('0xd')]='';this['address']='';this['defaultuser']=_0x396210[_0x314e('0xe')]||'';}module[_0x314e('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 421f91c..56da323 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 _0x2e8b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x16dfcb,_0xe8b0c0){var _0x5988f0=function(_0x2ef256){while(--_0x2ef256){_0x16dfcb['push'](_0x16dfcb['shift']());}};_0x5988f0(++_0xe8b0c0);}(_0x2e8b,0x186));var _0xb2e8=function(_0x361c40,_0x19ed9a){_0x361c40=_0x361c40-0x0;var _0x3d85f5=_0x2e8b[_0x361c40];return _0x3d85f5;};'use strict';function voiceExtension(_0x45ab2c){this['id']=_0x45ab2c['id']||0x0;this[_0xb2e8('0x0')]=_0x45ab2c[_0xb2e8('0x0')]||'';this['recordingFormat']=_0x45ab2c[_0xb2e8('0x1')]||_0xb2e8('0x2');this[_0xb2e8('0x3')]=_0x45ab2c[_0xb2e8('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x0552=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x0552,0x1c2));var _0x2055=function(_0x2a86a5,_0x3f6481){_0x2a86a5=_0x2a86a5-0x0;var _0x5ede44=_0x0552[_0x2a86a5];return _0x5ede44;};'use strict';function voiceExtension(_0x2e4f85){this['id']=_0x2e4f85['id']||0x0;this[_0x2055('0x0')]=_0x2e4f85[_0x2055('0x0')]||'';this[_0x2055('0x1')]=_0x2e4f85[_0x2055('0x1')]||_0x2055('0x2');this[_0x2055('0x3')]=_0x2e4f85[_0x2055('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index f1c79d9..8b1f13f 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 _0x6dc0=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','wav','gsm','fewestcalls','leastrecent','linear','random','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','sumDuration','sumBillable','unmanaged','available','busy','inUse','invalid','notInUse','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls'];(function(_0x3dc969,_0x224fea){var _0x52725a=function(_0x49aec2){while(--_0x49aec2){_0x3dc969['push'](_0x3dc969['shift']());}};_0x52725a(++_0x224fea);}(_0x6dc0,0x18c));var _0x06dc=function(_0x44029c,_0x426690){_0x44029c=_0x44029c-0x0;var _0x547fa1=_0x6dc0[_0x44029c];return _0x547fa1;};'use strict';var monitorFormat={'wav':_0x06dc('0x0'),'wav49':'wav49','gsm':_0x06dc('0x1')};var strategy={'fewestcalls':_0x06dc('0x2'),'leastrecent':_0x06dc('0x3'),'linear':_0x06dc('0x4'),'random':_0x06dc('0x5'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0x06dc('0x6'),'rrordered':_0x06dc('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x45a093){this['id']=_0x45a093['id']||0x0;this[_0x06dc('0x8')]=_0x45a093['name']||'';this[_0x06dc('0x9')]=_0x45a093['monitor_format']||'';this[_0x06dc('0xa')]=_0x45a093[_0x06dc('0xa')]||_0x06dc('0xb');this[_0x06dc('0xc')]=0x0;this[_0x06dc('0xd')]=0x0;this['answered']=0x0;this[_0x06dc('0xe')]=0x0;this['sumHoldTime']=0x0;this[_0x06dc('0xf')]=0x0;this[_0x06dc('0x10')]=0x0;this['abandoned']=0x0;this[_0x06dc('0x11')]=0x0;this[_0x06dc('0x12')]=0x0;this[_0x06dc('0x13')]=0x0;this[_0x06dc('0x14')]=0x0;this['loggedIn']=0x0;this[_0x06dc('0x15')]=0x0;this[_0x06dc('0x16')]=0x0;this[_0x06dc('0x17')]=0x0;this[_0x06dc('0x18')]=0x0;this[_0x06dc('0x19')]=0x0;this['talking']=0x0;this[_0x06dc('0x1a')]=0x0;this[_0x06dc('0x1b')]=0x0;this[_0x06dc('0x1c')]=_0x45a093[_0x06dc('0x1c')]||![];this[_0x06dc('0x1d')]=_0x45a093[_0x06dc('0x1d')]||0xa;this[_0x06dc('0x1e')]=_0x45a093['autopause']||'no';this[_0x06dc('0x1f')]=!![];this[_0x06dc('0x20')]='';this[_0x06dc('0x21')]='';this['originated']=0x0;this[_0x06dc('0x22')]=0x0;this[_0x06dc('0x23')]=_0x45a093[_0x06dc('0x23')]||null;this[_0x06dc('0x24')]=_0x45a093[_0x06dc('0x24')]?_0x45a093[_0x06dc('0x24')]:null;this[_0x06dc('0x25')]=_0x45a093[_0x06dc('0x25')];this['dialMethod']=_0x45a093[_0x06dc('0x26')]||'progressive';this[_0x06dc('0x27')]=_0x45a093['dialLimitChannel']||0x0;this[_0x06dc('0x28')]=_0x45a093[_0x06dc('0x28')]||0x0;this[_0x06dc('0x29')]=_0x45a093[_0x06dc('0x29')]||0x1;this[_0x06dc('0x2a')]=_0x45a093['dialPredictiveOptimization']||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x45a093['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x45a093[_0x06dc('0x2b')]||0x258;this[_0x06dc('0x2c')]=_0x45a093['dialOriginateCallerIdName']||_0x06dc('0x2d');this[_0x06dc('0x2e')]=_0x45a093[_0x06dc('0x2e')]||_0x06dc('0x2d');this['dialOriginateTimeout']=_0x45a093[_0x06dc('0x2f')]||0x1e;this[_0x06dc('0x30')]=_0x45a093[_0x06dc('0x30')]||_0x06dc('0x31');this[_0x06dc('0x32')]=_0x45a093['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x45a093[_0x06dc('0x33')]||undefined;this[_0x06dc('0x34')]=_0x45a093[_0x06dc('0x34')]||0x3;this[_0x06dc('0x35')]=_0x45a093['dialCongestionRetryFrequency']||0x96;this[_0x06dc('0x36')]=_0x45a093[_0x06dc('0x36')]||0x3;this['dialBusyRetryFrequency']=_0x45a093['dialBusyRetryFrequency']||0x96;this[_0x06dc('0x37')]=_0x45a093[_0x06dc('0x37')]||0x3;this['dialNoAnswerRetryFrequency']=_0x45a093[_0x06dc('0x38')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x45a093[_0x06dc('0x39')]||0x3;this[_0x06dc('0x3a')]=_0x45a093[_0x06dc('0x3a')]||0x96;this[_0x06dc('0x3b')]=_0x45a093[_0x06dc('0x3b')]||0x3;this[_0x06dc('0x3c')]=_0x45a093[_0x06dc('0x3c')]||0x96;this[_0x06dc('0x3d')]=_0x45a093['dialAbandonedMaxRetry']||0x3;this[_0x06dc('0x3e')]=_0x45a093[_0x06dc('0x3e')]||0x96;this[_0x06dc('0x3f')]=_0x45a093[_0x06dc('0x3f')]||0x3;this[_0x06dc('0x40')]=_0x45a093[_0x06dc('0x40')]||0x96;this[_0x06dc('0x41')]=_0x45a093[_0x06dc('0x41')]||0x3;this['dialAgentRejectRetryFrequency']=_0x45a093['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x45a093[_0x06dc('0x42')]||0x3;this[_0x06dc('0x43')]=_0x45a093['dialGlobalMaxRetry']||0x4;this[_0x06dc('0x44')]=_0x45a093[_0x06dc('0x44')]?_0x45a093[_0x06dc('0x44')]:undefined;this[_0x06dc('0x45')]=_0x45a093[_0x06dc('0x45')]?_0x45a093[_0x06dc('0x45')]:undefined;this['dialPrefix']=_0x45a093[_0x06dc('0x46')]||undefined;this['Interval']=_0x45a093[_0x06dc('0x47')]?_0x45a093['Interval']:undefined;this['dialOrderByScheduledAt']=_0x45a093['dialOrderByScheduledAt']||_0x06dc('0x48');this[_0x06dc('0x49')]=_0x45a093[_0x06dc('0x49')]||undefined;this[_0x06dc('0x4a')]=_0x45a093['dialCutDigit']||undefined;this['strategy']=strategy[_0x45a093[_0x06dc('0x4b')]];this[_0x06dc('0x4c')]=!![];this['dialAMDActive']=_0x45a093[_0x06dc('0x4d')]||![];this[_0x06dc('0x4e')]=_0x45a093[_0x06dc('0x4e')];this['dialAMDGreeting']=_0x45a093[_0x06dc('0x4f')];this[_0x06dc('0x50')]=_0x45a093['dialAMDAfterGreetingSilence'];this[_0x06dc('0x51')]=_0x45a093['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x45a093[_0x06dc('0x52')];this[_0x06dc('0x53')]=_0x45a093['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x45a093[_0x06dc('0x54')];this[_0x06dc('0x55')]=_0x45a093['dialAMDSilenceThreshold'];this[_0x06dc('0x56')]=_0x45a093[_0x06dc('0x56')];this[_0x06dc('0x57')]=0x0;this[_0x06dc('0x58')]=0x0;this[_0x06dc('0x59')]=_0x45a093[_0x06dc('0x59')];this[_0x06dc('0x5a')]=0x0;this[_0x06dc('0x5b')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x06dc('0x5c')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x06dc('0x5d')]=0x0;this[_0x06dc('0x5e')]=0x0;this[_0x06dc('0x5f')]=0x0;this[_0x06dc('0x60')]=0x0;this[_0x06dc('0x61')]=0x0;this[_0x06dc('0x62')]=0x0;this[_0x06dc('0x63')]=0x0;this[_0x06dc('0x64')]=0x0;this['startProgressive']=undefined;this[_0x06dc('0x65')]=undefined;this[_0x06dc('0x66')]=undefined;this[_0x06dc('0x67')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x06dc('0x68')]=0x0;this[_0x06dc('0x69')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x06dc('0x6a')]=0x0;this[_0x06dc('0x6b')]=0x0;this[_0x06dc('0x6c')]=0x0;this[_0x06dc('0x6d')]=0x0;this[_0x06dc('0x6e')]=_0x45a093[_0x06dc('0x6f')]||0x14;this[_0x06dc('0x70')]=_0x45a093[_0x06dc('0x6f')]||0xa;this[_0x06dc('0x71')]=0x0;this[_0x06dc('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x06dc('0x73')]=0x0;this[_0x06dc('0x74')]=0x0;this[_0x06dc('0x75')]=0x0;this[_0x06dc('0x76')]=0x0;this[_0x06dc('0x77')]=_0x45a093['dialRecallMeTimeout']||0x1e;this[_0x06dc('0x78')]=_0x45a093[_0x06dc('0x78')]||![];this[_0x06dc('0x79')]=!!_0x45a093[_0x06dc('0x79')]||![];this['dialPreviewRecallmeReminder']=!!_0x45a093[_0x06dc('0x7a')]||![];this[_0x06dc('0x7b')]=_0x45a093[_0x06dc('0x7b')]||undefined;this[_0x06dc('0x7c')]=_0x45a093[_0x06dc('0x7c')]||![];this[_0x06dc('0x7d')]=_0x45a093[_0x06dc('0x7d')]||![];this[_0x06dc('0x9')]=monitorFormat[_0x45a093[_0x06dc('0x9')]]?monitorFormat[_0x45a093['monitor_format']]:undefined;this['mandatoryDisposition']=_0x45a093['mandatoryDisposition']||![];this[_0x06dc('0x7e')]=_0x45a093[_0x06dc('0x7e')]?_0x45a093[_0x06dc('0x7e')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x06dc('0x7f')]=VoiceQueue; \ No newline at end of file +var _0x4b57=['dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','linear','random','ringall','roundrobin','rrmemory','wrandom','monitor_format','type','inbound','waiting','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x729293,_0x4887e7){var _0x1ff835=function(_0xa4b3e1){while(--_0xa4b3e1){_0x729293['push'](_0x729293['shift']());}};_0x1ff835(++_0x4887e7);}(_0x4b57,0xaa));var _0x74b5=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x4b57[_0xee5d2a];return _0x346948;};'use strict';var monitorFormat={'wav':_0x74b5('0x0'),'wav49':_0x74b5('0x1'),'gsm':_0x74b5('0x2')};var strategy={'fewestcalls':_0x74b5('0x3'),'leastrecent':'leastrecent','linear':_0x74b5('0x4'),'random':_0x74b5('0x5'),'ringall':_0x74b5('0x6'),'rr':_0x74b5('0x7'),'rrmemory':_0x74b5('0x8'),'rrordered':'rrordered','wrandom':_0x74b5('0x9')};function VoiceQueue(_0xf94fa5){this['id']=_0xf94fa5['id']||0x0;this['name']=_0xf94fa5['name']||'';this[_0x74b5('0xa')]=_0xf94fa5['monitor_format']||'';this[_0x74b5('0xb')]=_0xf94fa5[_0x74b5('0xb')]||_0x74b5('0xc');this[_0x74b5('0xd')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x74b5('0xe')]=0x0;this[_0x74b5('0xf')]=0x0;this[_0x74b5('0x10')]=0x0;this[_0x74b5('0x11')]=0x0;this[_0x74b5('0x12')]=0x0;this[_0x74b5('0x13')]=0x0;this[_0x74b5('0x14')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0x74b5('0x15')]=0x0;this[_0x74b5('0x16')]=0x0;this[_0x74b5('0x17')]=0x0;this[_0x74b5('0x18')]=0x0;this[_0x74b5('0x19')]=0x0;this[_0x74b5('0x1a')]=0x0;this['talking']=0x0;this[_0x74b5('0x1b')]=0x0;this['unknown']=0x0;this['acw']=_0xf94fa5[_0x74b5('0x1c')]||![];this[_0x74b5('0x1d')]=_0xf94fa5['acwTimeout']||0xa;this['autopause']=_0xf94fa5[_0x74b5('0x1e')]||'no';this[_0x74b5('0x1f')]=!![];this[_0x74b5('0x20')]='';this[_0x74b5('0x21')]='';this[_0x74b5('0x22')]=0x0;this['temp']=0x0;this[_0x74b5('0x23')]=_0xf94fa5[_0x74b5('0x23')]||null;this[_0x74b5('0x24')]=_0xf94fa5[_0x74b5('0x24')]?_0xf94fa5[_0x74b5('0x24')]:null;this[_0x74b5('0x25')]=_0xf94fa5[_0x74b5('0x25')];this[_0x74b5('0x26')]=_0xf94fa5[_0x74b5('0x26')]||_0x74b5('0x27');this[_0x74b5('0x28')]=_0xf94fa5[_0x74b5('0x28')]||0x0;this[_0x74b5('0x29')]=_0xf94fa5[_0x74b5('0x29')]||0x0;this[_0x74b5('0x2a')]=_0xf94fa5[_0x74b5('0x2a')]||0x1;this['dialPredictiveOptimization']=_0xf94fa5[_0x74b5('0x2b')]||_0x74b5('0x2c');this['dialPredictiveOptimizationPercentage']=_0xf94fa5[_0x74b5('0x2d')]||0.03;this[_0x74b5('0x2e')]=_0xf94fa5['dialPredictiveInterval']||0x258;this[_0x74b5('0x2f')]=_0xf94fa5[_0x74b5('0x2f')]||_0x74b5('0x30');this[_0x74b5('0x31')]=_0xf94fa5[_0x74b5('0x31')]||_0x74b5('0x30');this['dialOriginateTimeout']=_0xf94fa5[_0x74b5('0x32')]||0x1e;this[_0x74b5('0x33')]=_0xf94fa5['dialQueueOptions']||_0x74b5('0x34');this[_0x74b5('0x35')]=_0xf94fa5['dialQueueTimeout']||0x3;this['dialQueueProject']=_0xf94fa5['dialQueueProject']||undefined;this[_0x74b5('0x36')]=_0xf94fa5[_0x74b5('0x36')]||0x3;this['dialCongestionRetryFrequency']=_0xf94fa5['dialCongestionRetryFrequency']||0x96;this[_0x74b5('0x37')]=_0xf94fa5['dialBusyMaxRetry']||0x3;this[_0x74b5('0x38')]=_0xf94fa5['dialBusyRetryFrequency']||0x96;this[_0x74b5('0x39')]=_0xf94fa5[_0x74b5('0x39')]||0x3;this['dialNoAnswerRetryFrequency']=_0xf94fa5[_0x74b5('0x3a')]||0x96;this[_0x74b5('0x3b')]=_0xf94fa5[_0x74b5('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xf94fa5[_0x74b5('0x3c')]||0x96;this[_0x74b5('0x3d')]=_0xf94fa5[_0x74b5('0x3d')]||0x3;this[_0x74b5('0x3e')]=_0xf94fa5['dialDropRetryFrequency']||0x96;this[_0x74b5('0x3f')]=_0xf94fa5[_0x74b5('0x3f')]||0x3;this[_0x74b5('0x40')]=_0xf94fa5[_0x74b5('0x40')]||0x96;this['dialMachineMaxRetry']=_0xf94fa5[_0x74b5('0x41')]||0x3;this[_0x74b5('0x42')]=_0xf94fa5[_0x74b5('0x42')]||0x96;this[_0x74b5('0x43')]=_0xf94fa5['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0xf94fa5[_0x74b5('0x44')]||0x96;this[_0x74b5('0x45')]=_0xf94fa5[_0x74b5('0x45')]||0x3;this[_0x74b5('0x46')]=_0xf94fa5[_0x74b5('0x46')]||0x4;this['Trunk']=_0xf94fa5[_0x74b5('0x47')]?_0xf94fa5[_0x74b5('0x47')]:undefined;this[_0x74b5('0x48')]=_0xf94fa5['TrunkBackup']?_0xf94fa5['TrunkBackup']:undefined;this[_0x74b5('0x49')]=_0xf94fa5[_0x74b5('0x49')]||undefined;this[_0x74b5('0x4a')]=_0xf94fa5[_0x74b5('0x4a')]?_0xf94fa5[_0x74b5('0x4a')]:undefined;this[_0x74b5('0x4b')]=_0xf94fa5['dialOrderByScheduledAt']||_0x74b5('0x4c');this['dialRandomLastDigitCallerIdNumber']=_0xf94fa5[_0x74b5('0x4d')]||undefined;this[_0x74b5('0x4e')]=_0xf94fa5[_0x74b5('0x4e')]||undefined;this[_0x74b5('0x4f')]=strategy[_0xf94fa5[_0x74b5('0x4f')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0xf94fa5[_0x74b5('0x50')]||![];this[_0x74b5('0x51')]=_0xf94fa5['dialAMDInitialSilence'];this[_0x74b5('0x52')]=_0xf94fa5[_0x74b5('0x52')];this[_0x74b5('0x53')]=_0xf94fa5[_0x74b5('0x53')];this[_0x74b5('0x54')]=_0xf94fa5[_0x74b5('0x54')];this[_0x74b5('0x55')]=_0xf94fa5[_0x74b5('0x55')];this[_0x74b5('0x56')]=_0xf94fa5['dialAMDBetweenWordsSilence'];this[_0x74b5('0x57')]=_0xf94fa5['dialAMDMaximumNumberOfWords'];this[_0x74b5('0x58')]=_0xf94fa5[_0x74b5('0x58')];this['dialAMDMaximumWordLength']=_0xf94fa5['dialAMDMaximumWordLength'];this[_0x74b5('0x59')]=0x0;this[_0x74b5('0x5a')]=0x0;this[_0x74b5('0x5b')]=_0xf94fa5[_0x74b5('0x5b')];this[_0x74b5('0x5c')]=0x0;this[_0x74b5('0x5d')]=0x0;this[_0x74b5('0x5e')]=0x0;this[_0x74b5('0x5f')]=0x0;this[_0x74b5('0x60')]=0x0;this[_0x74b5('0x61')]=0x0;this[_0x74b5('0x62')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x74b5('0x63')]=0x0;this[_0x74b5('0x64')]=0x0;this[_0x74b5('0x65')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x74b5('0x66')]=undefined;this[_0x74b5('0x67')]=undefined;this['handlePredictive']=undefined;this[_0x74b5('0x68')]=1.05;this[_0x74b5('0x69')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x74b5('0x6a')]=0x0;this[_0x74b5('0x6b')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x74b5('0x6c')]=0x0;this[_0x74b5('0x6d')]=0x0;this[_0x74b5('0x6e')]=_0xf94fa5[_0x74b5('0x6f')]||0x14;this[_0x74b5('0x70')]=_0xf94fa5[_0x74b5('0x6f')]||0xa;this[_0x74b5('0x71')]=0x0;this[_0x74b5('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x74b5('0x73')]=0x0;this['erlangCallToSecond']=0x0;this[_0x74b5('0x74')]=0x0;this[_0x74b5('0x75')]=0x0;this['dialRecallMeTimeout']=_0xf94fa5[_0x74b5('0x76')]||0x1e;this[_0x74b5('0x77')]=_0xf94fa5['dialRecallInQueue']||![];this[_0x74b5('0x78')]=!!_0xf94fa5[_0x74b5('0x78')]||![];this['dialPreviewRecallmeReminder']=!!_0xf94fa5[_0x74b5('0x79')]||![];this[_0x74b5('0x7a')]=_0xf94fa5[_0x74b5('0x7a')]||undefined;this[_0x74b5('0x7b')]=_0xf94fa5[_0x74b5('0x7b')]||![];this[_0x74b5('0x7c')]=_0xf94fa5[_0x74b5('0x7c')]||![];this[_0x74b5('0xa')]=monitorFormat[_0xf94fa5['monitor_format']]?monitorFormat[_0xf94fa5[_0x74b5('0xa')]]:undefined;this[_0x74b5('0x7d')]=_0xf94fa5['mandatoryDisposition']||![];this[_0x74b5('0x7e')]=_0xf94fa5[_0x74b5('0x7e')]?_0xf94fa5[_0x74b5('0x7e')]:undefined;this[_0x74b5('0x7f')]=![];}module[_0x74b5('0x80')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index a9bb4cf..c881250 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 _0x8375=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','loggedin','callers','length','SIP/','incall','includes','status','booked','keys','queue','dialer','exten','compareToInboundQueue','some','compareToOutboundQueue','preview','exports','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','name','strategy','abandoned','available','busy','invalid','onHold','notInUse','ringInUse','total','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x1e267d,_0x42a1cf){var _0x416bb4=function(_0x8326a0){while(--_0x8326a0){_0x1e267d['push'](_0x1e267d['shift']());}};_0x416bb4(++_0x42a1cf);}(_0x8375,0x132));var _0x5837=function(_0x54fdd2,_0x491940){_0x54fdd2=_0x54fdd2-0x0;var _0x5e26ba=_0x8375[_0x54fdd2];return _0x5e26ba;};'use strict';var INBOUND_COUNTERS=['available',_0x5837('0x0'),_0x5837('0x1'),_0x5837('0x2'),_0x5837('0x3'),_0x5837('0x4'),_0x5837('0x5')];var OUTBOUND_COUNTERS=['available',_0x5837('0x6'),_0x5837('0x7'),'loggedIn',_0x5837('0x1'),_0x5837('0x8'),_0x5837('0x9'),_0x5837('0xa'),'outboundBlacklistCallsDay',_0x5837('0xb'),_0x5837('0xc'),_0x5837('0xd'),_0x5837('0xe'),_0x5837('0xf'),_0x5837('0x10'),_0x5837('0x11'),_0x5837('0x2'),_0x5837('0x12'),'talking',_0x5837('0x13'),_0x5837('0x14'),'total',_0x5837('0x5')];function VoiceQueueSummary(_0x3967d7){this['id']=_0x3967d7['id'];this['name']=_0x3967d7[_0x5837('0x15')];this['strategy']=_0x3967d7[_0x5837('0x16')];this[_0x5837('0x17')]=_0x3967d7[_0x5837('0x17')]||0x0;this[_0x5837('0x6')]=_0x3967d7['answered']||0x0;this[_0x5837('0x18')]=_0x3967d7[_0x5837('0x18')]||0x0;this[_0x5837('0x19')]=_0x3967d7['busy']||0x0;this[_0x5837('0x7')]=_0x3967d7[_0x5837('0x7')]||0x0;this[_0x5837('0x1a')]=_0x3967d7[_0x5837('0x1a')]||0x0;this[_0x5837('0x0')]=_0x3967d7[_0x5837('0x0')]||0x0;this['loggedInDb']=_0x3967d7['loggedInDb']||0x0;this['onHold']=_0x3967d7[_0x5837('0x1b')]||0x0;this[_0x5837('0x1c')]=_0x3967d7[_0x5837('0x1c')]||0x0;this[_0x5837('0x2')]=_0x3967d7[_0x5837('0x2')]||0x0;this[_0x5837('0x3')]=_0x3967d7[_0x5837('0x3')]||0x0;this['ringInUse']=_0x3967d7[_0x5837('0x1d')];this[_0x5837('0x13')]=_0x3967d7[_0x5837('0x13')];this[_0x5837('0x14')]=_0x3967d7[_0x5837('0x14')];this['sumHoldTime']=_0x3967d7['sumHoldTime']||0x0;this[_0x5837('0x4')]=_0x3967d7[_0x5837('0x4')]||0x0;this[_0x5837('0x1e')]=_0x3967d7['total']||0x0;this[_0x5837('0x1f')]=_0x3967d7[_0x5837('0x1f')];this['unavailable']=_0x3967d7[_0x5837('0x20')]||0x0;this[_0x5837('0x21')]=_0x3967d7['unknown']||0x0;this[_0x5837('0x22')]=_0x3967d7[_0x5837('0x22')]||0x0;this[_0x5837('0x5')]=_0x3967d7['waiting']||0x0;if(_0x3967d7[_0x5837('0x1f')]==='outbound'){this[_0x5837('0x12')]=_0x3967d7[_0x5837('0x12')]||0x0;this[_0x5837('0x23')]=_0x3967d7[_0x5837('0x23')];this[_0x5837('0x24')]=_0x3967d7[_0x5837('0x24')];this[_0x5837('0x25')]=_0x3967d7[_0x5837('0x25')];this[_0x5837('0x26')]=_0x3967d7[_0x5837('0x26')];this[_0x5837('0x27')]=_0x3967d7[_0x5837('0x27')];this[_0x5837('0x28')]=_0x3967d7[_0x5837('0x28')];this[_0x5837('0x29')]=_0x3967d7['temp'];this[_0x5837('0x2a')]=_0x3967d7[_0x5837('0x2a')];this[_0x5837('0xa')]=_0x3967d7[_0x5837('0xa')];this[_0x5837('0x2b')]=_0x3967d7[_0x5837('0x2b')];this[_0x5837('0xb')]=_0x3967d7['outboundBusyCallsDay'];this[_0x5837('0xc')]=_0x3967d7[_0x5837('0xc')];this[_0x5837('0x2c')]=_0x3967d7[_0x5837('0x2c')];this['outboundDropCallsDayCallersExit']=_0x3967d7['outboundDropCallsDayCallersExit'];this[_0x5837('0x2d')]=_0x3967d7[_0x5837('0x2d')];this[_0x5837('0xd')]=_0x3967d7['outboundNoAnswerCallsDay'];this[_0x5837('0xe')]=_0x3967d7[_0x5837('0xe')];this[_0x5837('0x2e')]=_0x3967d7[_0x5837('0x2e')];this[_0x5837('0xf')]=_0x3967d7[_0x5837('0xf')];this['outboundRejectCallsDay']=_0x3967d7[_0x5837('0x10')];this[_0x5837('0x11')]=_0x3967d7['outboundUnknownCallsDay'];this[_0x5837('0x2f')]=_0x3967d7[_0x5837('0x2f')];this[_0x5837('0x30')]=_0x3967d7['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x3967d7['predictiveIntervalAvgTalktime'];this['predictiveIntervalDroppedCallsCallersExit']=_0x3967d7[_0x5837('0x31')];this['predictiveIntervalDroppedCallsTimeout']=_0x3967d7['predictiveIntervalDroppedCallsTimeout'];this[_0x5837('0x32')]=_0x3967d7[_0x5837('0x32')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x3967d7[_0x5837('0x33')];this['predictiveIntervalHitRate']=_0x3967d7[_0x5837('0x34')];this[_0x5837('0x35')]=_0x3967d7['predictiveIntervalMultiplicativeFactor'];this[_0x5837('0x36')]=_0x3967d7[_0x5837('0x36')];this['predictiveIntervalAvailable']=_0x3967d7[_0x5837('0x37')];this['predictiveIntervalTotalCalls']=_0x3967d7[_0x5837('0x38')];this['originated']=_0x3967d7['originated'];this[_0x5837('0x39')]=_0x3967d7[_0x5837('0x39')];this[_0x5837('0x3a')]=_0x3967d7[_0x5837('0x3a')];this[_0x5837('0x3b')]=_0x3967d7['erlangAbandonmentRate'];this[_0x5837('0x3c')]=_0x3967d7['erlangBusyFactor'];this['startPredictive']=_0x3967d7[_0x5837('0x3d')];this[_0x5837('0x3e')]=_0x3967d7['startProgressive'];this[_0x5837('0x3f')]=_0x3967d7[_0x5837('0x3f')];this[_0x5837('0x40')]=_0x3967d7[_0x5837('0x40')];}if(_0x3967d7[_0x5837('0x41')]){this[_0x5837('0x41')]={'id':_0x3967d7[_0x5837('0x41')]['id'],'name':_0x3967d7[_0x5837('0x41')][_0x5837('0x15')],'active':_0x3967d7['Trunk'][_0x5837('0x42')],'callerid':_0x3967d7['Trunk']['callerid']};}}VoiceQueueSummary[_0x5837('0x43')][_0x5837('0x44')]=function(_0x5e6916,_0x151bb1,_0x1a5784,_0x28701f){this[_0x5837('0x1')]=0x0;this['talking']=0x0;this[_0x5837('0x2')]=0x0;this[_0x5837('0x21')]=0x0;this[_0x5837('0x1c')]=0x0;this[_0x5837('0x7')]=0x0;this[_0x5837('0x19')]=0x0;this['invalid']=0x0;this[_0x5837('0x20')]=0x0;this[_0x5837('0x3')]=0x0;this[_0x5837('0x1d')]=0x0;this['onHold']=0x0;if(_0x1a5784){if(_0x1a5784[_0x5837('0x18')]){this[_0x5837('0x18')]=Number(_0x1a5784[_0x5837('0x18')]);}if(_0x1a5784[_0x5837('0x45')]){this[_0x5837('0x0')]=Number(_0x1a5784[_0x5837('0x45')]);}if(_0x1a5784[_0x5837('0x46')]){this[_0x5837('0x5')]=Number(_0x1a5784[_0x5837('0x46')]);}}for(var _0x2be601=0x0;_0x2be601<_0x5e6916[_0x5837('0x47')];_0x2be601++){var _0x4b5351=_0x151bb1[_0x5837('0x48')+_0x5e6916[_0x2be601][_0x5837('0x15')]];if(_0x4b5351&&_0x4b5351['online']){this['loggedInDb']+=0x1;}if(_0x5e6916[_0x2be601][_0x5837('0x49')]==='1'){this['talking']+=0x1;}if(_0x5e6916[_0x2be601][_0x5837('0x2')]==='1'&&!['2','7','8'][_0x5837('0x4a')](_0x5e6916[_0x2be601][_0x5837('0x4b')])){this[_0x5837('0x2')]+=0x1;}switch(_0x5e6916[_0x2be601]['status']){case'0':this[_0x5837('0x21')]+=0x1;break;case'1':this[_0x5837('0x1c')]+=0x1;break;case'2':this[_0x5837('0x7')]+=0x1;break;case'3':this[_0x5837('0x19')]+=0x1;break;case'4':this[_0x5837('0x1a')]+=0x1;break;case'5':this[_0x5837('0x20')]+=0x1;break;case'6':this[_0x5837('0x3')]+=0x1;break;case'7':this[_0x5837('0x1d')]+=0x1;break;case'8':this[_0x5837('0x1b')]+=0x1;break;}}if(this['dialMethod']===_0x5837('0x4c')){var _0x453f4b=Object[_0x5837('0x4d')](_0x28701f);for(var _0x16f12f=0x0;_0x16f12f<_0x453f4b[_0x5837('0x47')];_0x16f12f++){var _0x30a9fc=_0x453f4b[_0x16f12f];var _0x5cbf61=_0x28701f[_0x30a9fc];if(_0x5cbf61[_0x5837('0x4e')]===this[_0x5837('0x15')]&&_0x5cbf61[_0x5837('0x1f')]===_0x5837('0x4f')&&_0x5cbf61[_0x5837('0x50')]==='xcally-motion-preview'){this[_0x5837('0x4')]+=0x1;}}if(this['talking']>this[_0x5837('0x7')]){this[_0x5837('0x4')]=this[_0x5837('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x5837('0x43')][_0x5837('0x51')]=function(_0x3f29a8){var _0x34028e=![];if(_0x3f29a8){_0x34028e=INBOUND_COUNTERS[_0x5837('0x52')](function(_0x424d59){return this[_0x424d59]!==_0x3f29a8[_0x424d59];},this);}return _0x34028e;};VoiceQueueSummary[_0x5837('0x43')][_0x5837('0x53')]=function(_0x3fa101){var _0x4fb67d=![];var _0x5bed24=![];var _0x3a26c1=![];if(_0x3fa101){_0x4fb67d=this[_0x5837('0x24')]!==_0x3fa101['dialMethod']||this['dialActive']!==_0x3fa101[_0x5837('0x23')]||this[_0x5837('0x3f')]!==_0x3fa101[_0x5837('0x3f')]||this[_0x5837('0x40')]!==_0x3fa101[_0x5837('0x40')];_0x5bed24=OUTBOUND_COUNTERS['some'](function(_0x3d443d){return this[_0x3d443d]!==_0x3fa101[_0x3d443d];},this);if(this[_0x5837('0x41')]&&_0x3fa101[_0x5837('0x41')]){_0x3a26c1=this['Trunk']['name']!==_0x3fa101[_0x5837('0x41')][_0x5837('0x15')]||this[_0x5837('0x41')][_0x5837('0x42')]!==_0x3fa101['Trunk'][_0x5837('0x42')];}}return _0x4fb67d||_0x5bed24||_0x3a26c1;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x45e84b){this[_0x5837('0x6')]=_0x45e84b['answered'];this[_0x5837('0x3f')]=_0x45e84b[_0x5837('0x3f')];this[_0x5837('0x40')]=_0x45e84b['statusMessage'];this[_0x5837('0x8')]=_0x45e84b[_0x5837('0x8')];this[_0x5837('0x9')]=_0x45e84b[_0x5837('0x9')];this[_0x5837('0xa')]=_0x45e84b['outboundAnswerCallsDay'];this[_0x5837('0x2b')]=_0x45e84b[_0x5837('0x2b')];this['outboundBusyCallsDay']=_0x45e84b[_0x5837('0xb')];this[_0x5837('0xc')]=_0x45e84b['outboundCongestionCallsDay'];this[_0x5837('0xd')]=_0x45e84b['outboundNoAnswerCallsDay'];this[_0x5837('0xe')]=_0x45e84b[_0x5837('0xe')];this['outboundReCallsDay']=_0x45e84b['outboundReCallsDay'];this[_0x5837('0x10')]=_0x45e84b[_0x5837('0x10')];this['outboundUnknownCallsDay']=_0x45e84b['outboundUnknownCallsDay'];this['sumBillable']=_0x45e84b[_0x5837('0x13')];this[_0x5837('0x14')]=_0x45e84b[_0x5837('0x14')];this[_0x5837('0x1e')]=_0x45e84b[_0x5837('0x1e')];if(this['dialMethod']===_0x5837('0x54')){this[_0x5837('0x12')]=_0x45e84b[_0x5837('0x12')];}};module[_0x5837('0x55')]=VoiceQueueSummary; \ No newline at end of file +var _0xc492=['dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','loggedin','status','booked','keys','length','queue','dialer','compareToInboundQueue','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','available','loggedIn','loggedInDb','talking','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','sumDuration','waiting','name','strategy','abandoned','busy','invalid','onHold','notInUse','paused','ringing','ringInUse','sumBillable','total','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x29563a,_0x393dd5){var _0x33e493=function(_0x13ed52){while(--_0x13ed52){_0x29563a['push'](_0x29563a['shift']());}};_0x33e493(++_0x393dd5);}(_0xc492,0xd7));var _0x2c49=function(_0x3d0d6f,_0x56b492){_0x3d0d6f=_0x3d0d6f-0x0;var _0x3bc103=_0xc492[_0x3d0d6f];return _0x3bc103;};'use strict';var INBOUND_COUNTERS=[_0x2c49('0x0'),_0x2c49('0x1'),_0x2c49('0x2'),'paused','ringing',_0x2c49('0x3'),'waiting'];var OUTBOUND_COUNTERS=['available',_0x2c49('0x4'),_0x2c49('0x5'),'loggedIn',_0x2c49('0x2'),'originated',_0x2c49('0x6'),_0x2c49('0x7'),'outboundBlacklistCallsDay',_0x2c49('0x8'),_0x2c49('0x9'),_0x2c49('0xa'),_0x2c49('0xb'),_0x2c49('0xc'),'outboundRejectCallsDay',_0x2c49('0xd'),'paused','pTalking','talking','sumBillable',_0x2c49('0xe'),'total',_0x2c49('0xf')];function VoiceQueueSummary(_0x2a998e){this['id']=_0x2a998e['id'];this['name']=_0x2a998e[_0x2c49('0x10')];this[_0x2c49('0x11')]=_0x2a998e[_0x2c49('0x11')];this[_0x2c49('0x12')]=_0x2a998e[_0x2c49('0x12')]||0x0;this[_0x2c49('0x4')]=_0x2a998e['answered']||0x0;this[_0x2c49('0x0')]=_0x2a998e[_0x2c49('0x0')]||0x0;this[_0x2c49('0x13')]=_0x2a998e[_0x2c49('0x13')]||0x0;this[_0x2c49('0x5')]=_0x2a998e['inUse']||0x0;this[_0x2c49('0x14')]=_0x2a998e[_0x2c49('0x14')]||0x0;this[_0x2c49('0x1')]=_0x2a998e[_0x2c49('0x1')]||0x0;this[_0x2c49('0x2')]=_0x2a998e[_0x2c49('0x2')]||0x0;this[_0x2c49('0x15')]=_0x2a998e[_0x2c49('0x15')]||0x0;this[_0x2c49('0x16')]=_0x2a998e[_0x2c49('0x16')]||0x0;this['paused']=_0x2a998e[_0x2c49('0x17')]||0x0;this[_0x2c49('0x18')]=_0x2a998e[_0x2c49('0x18')]||0x0;this[_0x2c49('0x19')]=_0x2a998e['ringInUse'];this[_0x2c49('0x1a')]=_0x2a998e['sumBillable'];this[_0x2c49('0xe')]=_0x2a998e[_0x2c49('0xe')];this['sumHoldTime']=_0x2a998e['sumHoldTime']||0x0;this[_0x2c49('0x3')]=_0x2a998e[_0x2c49('0x3')]||0x0;this[_0x2c49('0x1b')]=_0x2a998e[_0x2c49('0x1b')]||0x0;this[_0x2c49('0x1c')]=_0x2a998e[_0x2c49('0x1c')];this[_0x2c49('0x1d')]=_0x2a998e[_0x2c49('0x1d')]||0x0;this[_0x2c49('0x1e')]=_0x2a998e['unknown']||0x0;this[_0x2c49('0x1f')]=_0x2a998e[_0x2c49('0x1f')]||0x0;this[_0x2c49('0xf')]=_0x2a998e[_0x2c49('0xf')]||0x0;if(_0x2a998e['type']===_0x2c49('0x20')){this[_0x2c49('0x21')]=_0x2a998e[_0x2c49('0x21')]||0x0;this[_0x2c49('0x22')]=_0x2a998e['dialActive'];this[_0x2c49('0x23')]=_0x2a998e[_0x2c49('0x23')];this[_0x2c49('0x24')]=_0x2a998e['dialOriginateCallerIdName'];this[_0x2c49('0x25')]=_0x2a998e[_0x2c49('0x25')];this['dialOriginateTimeout']=_0x2a998e[_0x2c49('0x26')];this['dialPrefix']=_0x2a998e['dialPrefix'];this[_0x2c49('0x27')]=_0x2a998e['temp'];this[_0x2c49('0x28')]=_0x2a998e['outboundAnswerAgiCallsDay'];this[_0x2c49('0x7')]=_0x2a998e[_0x2c49('0x7')];this[_0x2c49('0x29')]=_0x2a998e[_0x2c49('0x29')];this[_0x2c49('0x8')]=_0x2a998e[_0x2c49('0x8')];this[_0x2c49('0x9')]=_0x2a998e[_0x2c49('0x9')];this[_0x2c49('0x2a')]=_0x2a998e[_0x2c49('0x2a')];this['outboundDropCallsDayCallersExit']=_0x2a998e[_0x2c49('0x2b')];this['outboundDropCallsDayTimeout']=_0x2a998e[_0x2c49('0x2c')];this[_0x2c49('0xa')]=_0x2a998e[_0x2c49('0xa')];this[_0x2c49('0xb')]=_0x2a998e[_0x2c49('0xb')];this[_0x2c49('0x2d')]=_0x2a998e[_0x2c49('0x2d')];this[_0x2c49('0xc')]=_0x2a998e[_0x2c49('0xc')];this[_0x2c49('0x2e')]=_0x2a998e[_0x2c49('0x2e')];this[_0x2c49('0xd')]=_0x2a998e[_0x2c49('0xd')];this[_0x2c49('0x2f')]=_0x2a998e['predictiveIntervalAnsweredCalls'];this['predictiveIntervalAvgHoldtime']=_0x2a998e[_0x2c49('0x30')];this[_0x2c49('0x31')]=_0x2a998e['predictiveIntervalAvgTalktime'];this[_0x2c49('0x32')]=_0x2a998e[_0x2c49('0x32')];this[_0x2c49('0x33')]=_0x2a998e[_0x2c49('0x33')];this[_0x2c49('0x34')]=_0x2a998e[_0x2c49('0x34')];this[_0x2c49('0x35')]=_0x2a998e[_0x2c49('0x35')];this['predictiveIntervalHitRate']=_0x2a998e[_0x2c49('0x36')];this[_0x2c49('0x37')]=_0x2a998e['predictiveIntervalMultiplicativeFactor'];this[_0x2c49('0x38')]=_0x2a998e[_0x2c49('0x38')];this[_0x2c49('0x39')]=_0x2a998e['predictiveIntervalAvailable'];this[_0x2c49('0x3a')]=_0x2a998e[_0x2c49('0x3a')];this[_0x2c49('0x3b')]=_0x2a998e[_0x2c49('0x3b')];this[_0x2c49('0x3c')]=_0x2a998e[_0x2c49('0x3c')];this['erlangCallToSecond']=_0x2a998e[_0x2c49('0x3d')];this[_0x2c49('0x3e')]=_0x2a998e['erlangAbandonmentRate'];this[_0x2c49('0x3f')]=_0x2a998e[_0x2c49('0x3f')];this['startPredictive']=_0x2a998e[_0x2c49('0x40')];this['startProgressive']=_0x2a998e[_0x2c49('0x41')];this[_0x2c49('0x42')]=_0x2a998e[_0x2c49('0x42')];this['statusMessage']=_0x2a998e[_0x2c49('0x43')];}if(_0x2a998e['Trunk']){this[_0x2c49('0x44')]={'id':_0x2a998e[_0x2c49('0x44')]['id'],'name':_0x2a998e[_0x2c49('0x44')][_0x2c49('0x10')],'active':_0x2a998e[_0x2c49('0x44')]['active'],'callerid':_0x2a998e[_0x2c49('0x44')][_0x2c49('0x45')]};}}VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x47')]=function(_0x251c8d,_0x130410,_0x3c25b6,_0x40f640){this['loggedInDb']=0x0;this[_0x2c49('0x3')]=0x0;this[_0x2c49('0x17')]=0x0;this['unknown']=0x0;this[_0x2c49('0x16')]=0x0;this[_0x2c49('0x5')]=0x0;this['busy']=0x0;this[_0x2c49('0x14')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x3c25b6){if(_0x3c25b6[_0x2c49('0x0')]){this[_0x2c49('0x0')]=Number(_0x3c25b6[_0x2c49('0x0')]);}if(_0x3c25b6[_0x2c49('0x48')]){this[_0x2c49('0x1')]=Number(_0x3c25b6['loggedin']);}if(_0x3c25b6['callers']){this['waiting']=Number(_0x3c25b6['callers']);}}for(var _0x43b5ca=0x0;_0x43b5ca<_0x251c8d['length'];_0x43b5ca++){var _0x341fd6=_0x130410['SIP/'+_0x251c8d[_0x43b5ca]['name']];if(_0x341fd6&&_0x341fd6['online']){this[_0x2c49('0x2')]+=0x1;}if(_0x251c8d[_0x43b5ca]['incall']==='1'){this[_0x2c49('0x3')]+=0x1;}if(_0x251c8d[_0x43b5ca][_0x2c49('0x17')]==='1'&&!['2','7','8']['includes'](_0x251c8d[_0x43b5ca]['status'])){this[_0x2c49('0x17')]+=0x1;}switch(_0x251c8d[_0x43b5ca][_0x2c49('0x49')]){case'0':this[_0x2c49('0x1e')]+=0x1;break;case'1':this[_0x2c49('0x16')]+=0x1;break;case'2':this[_0x2c49('0x5')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x2c49('0x1d')]+=0x1;break;case'6':this[_0x2c49('0x18')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0x2c49('0x4a')){var _0x267a32=Object[_0x2c49('0x4b')](_0x40f640);for(var _0x55e4cd=0x0;_0x55e4cd<_0x267a32[_0x2c49('0x4c')];_0x55e4cd++){var _0xea11c4=_0x267a32[_0x55e4cd];var _0x43a7fd=_0x40f640[_0xea11c4];if(_0x43a7fd[_0x2c49('0x4d')]===this[_0x2c49('0x10')]&&_0x43a7fd[_0x2c49('0x1c')]===_0x2c49('0x4e')&&_0x43a7fd['exten']==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x2c49('0x3')]>this[_0x2c49('0x5')]){this['talking']=this[_0x2c49('0x5')];}this[_0x2c49('0x21')]=0x0;}return this;};VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x4f')]=function(_0x199b26){var _0x38d901=![];if(_0x199b26){_0x38d901=INBOUND_COUNTERS[_0x2c49('0x50')](function(_0x11878d){return this[_0x11878d]!==_0x199b26[_0x11878d];},this);}return _0x38d901;};VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x51')]=function(_0x56d647){var _0x46a0c6=![];var _0xe026bf=![];var _0xfcdbaf=![];if(_0x56d647){_0x46a0c6=this['dialMethod']!==_0x56d647[_0x2c49('0x23')]||this[_0x2c49('0x22')]!==_0x56d647['dialActive']||this[_0x2c49('0x42')]!==_0x56d647[_0x2c49('0x42')]||this[_0x2c49('0x43')]!==_0x56d647[_0x2c49('0x43')];_0xe026bf=OUTBOUND_COUNTERS['some'](function(_0x34e69e){return this[_0x34e69e]!==_0x56d647[_0x34e69e];},this);if(this[_0x2c49('0x44')]&&_0x56d647[_0x2c49('0x44')]){_0xfcdbaf=this[_0x2c49('0x44')]['name']!==_0x56d647[_0x2c49('0x44')][_0x2c49('0x10')]||this[_0x2c49('0x44')][_0x2c49('0x52')]!==_0x56d647[_0x2c49('0x44')][_0x2c49('0x52')];}}return _0x46a0c6||_0xe026bf||_0xfcdbaf;};VoiceQueueSummary[_0x2c49('0x46')][_0x2c49('0x53')]=function(_0x3b62ee){this['answered']=_0x3b62ee['answered'];this[_0x2c49('0x42')]=_0x3b62ee[_0x2c49('0x42')];this['statusMessage']=_0x3b62ee[_0x2c49('0x43')];this['originated']=_0x3b62ee[_0x2c49('0x3b')];this[_0x2c49('0x6')]=_0x3b62ee[_0x2c49('0x6')];this[_0x2c49('0x7')]=_0x3b62ee[_0x2c49('0x7')];this['outboundBlacklistCallsDay']=_0x3b62ee[_0x2c49('0x29')];this[_0x2c49('0x8')]=_0x3b62ee[_0x2c49('0x8')];this['outboundCongestionCallsDay']=_0x3b62ee[_0x2c49('0x9')];this[_0x2c49('0xa')]=_0x3b62ee['outboundNoAnswerCallsDay'];this[_0x2c49('0xb')]=_0x3b62ee[_0x2c49('0xb')];this['outboundReCallsDay']=_0x3b62ee[_0x2c49('0xc')];this['outboundRejectCallsDay']=_0x3b62ee[_0x2c49('0x2e')];this[_0x2c49('0xd')]=_0x3b62ee[_0x2c49('0xd')];this[_0x2c49('0x1a')]=_0x3b62ee[_0x2c49('0x1a')];this[_0x2c49('0xe')]=_0x3b62ee['sumDuration'];this[_0x2c49('0x1b')]=_0x3b62ee[_0x2c49('0x1b')];if(this[_0x2c49('0x23')]==='preview'){this[_0x2c49('0x21')]=_0x3b62ee['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d95a967..83811a1 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 _0xc8d5=['remoteUri','Configurations','name','username','accessKey'];(function(_0x590ced,_0x5aa2ee){var _0x355b36=function(_0x24fc58){while(--_0x24fc58){_0x590ced['push'](_0x590ced['shift']());}};_0x355b36(++_0x5aa2ee);}(_0xc8d5,0x1bf));var _0x5c8d=function(_0x8ad9ad,_0x4e99be){_0x8ad9ad=_0x8ad9ad-0x0;var _0x509410=_0xc8d5[_0x8ad9ad];return _0x509410;};'use strict';function VtigerAccount(_0x44d771){this['id']=_0x44d771['id']||0x0;this['name']=_0x44d771[_0x5c8d('0x0')]||'';this['username']=_0x44d771[_0x5c8d('0x1')]||'';this['accessKey']=_0x44d771[_0x5c8d('0x2')]||'';this['remoteUri']=_0x44d771[_0x5c8d('0x3')]||'';this['serverUrl']=_0x44d771['serverUrl']||'';this['Configurations']=_0x44d771[_0x5c8d('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x640e=['name','username','remoteUri','serverUrl','Configurations'];(function(_0x143f06,_0x8be769){var _0x3c33d9=function(_0x593197){while(--_0x593197){_0x143f06['push'](_0x143f06['shift']());}};_0x3c33d9(++_0x8be769);}(_0x640e,0xbe));var _0xe640=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x640e[_0x1399d6];return _0x4a9db4;};'use strict';function VtigerAccount(_0x3f6100){this['id']=_0x3f6100['id']||0x0;this[_0xe640('0x0')]=_0x3f6100[_0xe640('0x0')]||'';this[_0xe640('0x1')]=_0x3f6100[_0xe640('0x1')]||'';this['accessKey']=_0x3f6100['accessKey']||'';this['remoteUri']=_0x3f6100[_0xe640('0x2')]||'';this[_0xe640('0x3')]=_0x3f6100[_0xe640('0x3')]||'';this[_0xe640('0x4')]=_0x3f6100[_0xe640('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9e34a68..5212228 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 _0x79c0=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x79c0,0xba));var _0x079c=function(_0x329810,_0x365bcd){_0x329810=_0x329810-0x0;var _0x1a2411=_0x79c0[_0x329810];return _0x1a2411;};'use strict';function ZendeskAccount(_0x520d93){this['id']=_0x520d93['id']||0x0;this[_0x079c('0x0')]=_0x520d93[_0x079c('0x0')]||'';this['username']=_0x520d93[_0x079c('0x1')]||'';this[_0x079c('0x2')]=_0x520d93['password']||'';this[_0x079c('0x3')]=_0x520d93[_0x079c('0x3')]||'';this[_0x079c('0x4')]=_0x520d93[_0x079c('0x4')]||'';this[_0x079c('0x5')]=_0x520d93[_0x079c('0x5')]||'';this['type']=_0x520d93[_0x079c('0x6')]||_0x079c('0x7');this[_0x079c('0x8')]=_0x520d93[_0x079c('0x8')]||'';this[_0x079c('0x9')]=_0x520d93[_0x079c('0x9')]||{};}module[_0x079c('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xe085=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x2c2a20,_0x605b06){var _0x30e247=function(_0x5922f0){while(--_0x5922f0){_0x2c2a20['push'](_0x2c2a20['shift']());}};_0x30e247(++_0x605b06);}(_0xe085,0x1ef));var _0x5e08=function(_0x106193,_0x3c27cf){_0x106193=_0x106193-0x0;var _0x49ac5b=_0xe085[_0x106193];return _0x49ac5b;};'use strict';function ZendeskAccount(_0x3cf0ad){this['id']=_0x3cf0ad['id']||0x0;this[_0x5e08('0x0')]=_0x3cf0ad[_0x5e08('0x0')]||'';this[_0x5e08('0x1')]=_0x3cf0ad[_0x5e08('0x1')]||'';this[_0x5e08('0x2')]=_0x3cf0ad[_0x5e08('0x2')]||'';this[_0x5e08('0x3')]=_0x3cf0ad['token']||'';this[_0x5e08('0x4')]=_0x3cf0ad['remoteUri']||'';this[_0x5e08('0x5')]=_0x3cf0ad[_0x5e08('0x5')]||'';this[_0x5e08('0x6')]=_0x3cf0ad['type']||_0x5e08('0x7');this['serverUrl']=_0x3cf0ad[_0x5e08('0x8')]||'';this[_0x5e08('0x9')]=_0x3cf0ad[_0x5e08('0x9')]||{};}module[_0x5e08('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 3c116e4..87b1420 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 _0x4e90=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x1a6445,_0x1efe69){var _0x2d2f42=function(_0x3c997b){while(--_0x3c997b){_0x1a6445['push'](_0x1a6445['shift']());}};_0x2d2f42(++_0x1efe69);}(_0x4e90,0x1bf));var _0x04e9=function(_0x508d71,_0x2f841b){_0x508d71=_0x508d71-0x0;var _0x4099d3=_0x4e90[_0x508d71];return _0x4099d3;};'use strict';function ZohoAccount(_0xa14555){this['id']=_0xa14555['id']||0x0;this[_0x04e9('0x0')]=_0xa14555[_0x04e9('0x0')]||'';this[_0x04e9('0x1')]=_0xa14555[_0x04e9('0x1')]||'';this['host']=_0xa14555[_0x04e9('0x2')]||'';this[_0x04e9('0x3')]=_0xa14555['zone']||'';this[_0x04e9('0x4')]=_0xa14555[_0x04e9('0x4')]||'';this['clientSecret']=_0xa14555[_0x04e9('0x5')]||'';this[_0x04e9('0x6')]=_0xa14555['serverUrl']||'';this[_0x04e9('0x7')]=_0xa14555['code']||'';this[_0x04e9('0x8')]=_0xa14555[_0x04e9('0x8')]||'';this[_0x04e9('0x9')]=_0xa14555[_0x04e9('0x9')]||{};}module[_0x04e9('0xa')]=ZohoAccount; \ No newline at end of file +var _0xf31a=['name','description','host','zone','clientId','clientSecret','code','refreshToken','Configurations'];(function(_0x2efe86,_0x4b6c3f){var _0x48e01c=function(_0x5b1412){while(--_0x5b1412){_0x2efe86['push'](_0x2efe86['shift']());}};_0x48e01c(++_0x4b6c3f);}(_0xf31a,0xfc));var _0xaf31=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xf31a[_0xf50820];return _0x2a9b10;};'use strict';function ZohoAccount(_0x5e07d6){this['id']=_0x5e07d6['id']||0x0;this['name']=_0x5e07d6[_0xaf31('0x0')]||'';this[_0xaf31('0x1')]=_0x5e07d6[_0xaf31('0x1')]||'';this[_0xaf31('0x2')]=_0x5e07d6['host']||'';this[_0xaf31('0x3')]=_0x5e07d6['zone']||'';this[_0xaf31('0x4')]=_0x5e07d6[_0xaf31('0x4')]||'';this[_0xaf31('0x5')]=_0x5e07d6[_0xaf31('0x5')]||'';this['serverUrl']=_0x5e07d6['serverUrl']||'';this[_0xaf31('0x6')]=_0x5e07d6[_0xaf31('0x6')]||'';this[_0xaf31('0x7')]=_0x5e07d6[_0xaf31('0x7')]||'';this['Configurations']=_0x5e07d6[_0xaf31('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6abaecd..92d87df 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 _0x4cf8=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x4cf8[_0x59e862];return _0x1a25ee;};'use strict';var util=require(_0x84cf('0x0'));var _=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));function checkNameSurname(_0x2125ed,_0xae953,_0x28455b){var _0x36b912='';if(!_[_0x84cf('0x3')](_0xae953)&&_0x84cf('0x4')===typeof _0xae953){_0x36b912+=_0xae953;}if(!_[_0x84cf('0x3')](_0x28455b)&&_0x84cf('0x4')===typeof _0x28455b){_0x36b912+='\x20'+_0x28455b;}if(_0x36b912!==''){return _0x36b912;}return _0x2125ed;}function Action(_0x2c613d,_0x50ade2,_0x4af3f1,_0x455345,_0x56c5cc){this[_0x84cf('0x5')]=_0x4af3f1||undefined;this[_0x84cf('0x6')]=_0x2c613d['id'];this['queue']=_0x50ade2[_0x84cf('0x7')];this[_0x84cf('0x8')]=_0x50ade2['type'];this[_0x84cf('0x9')]=_0x84cf('0xa');this[_0x84cf('0xb')]=![];this[_0x84cf('0xc')]=_['isNil'](_0x2c613d[_0x84cf('0xd')])?undefined:_0x2c613d[_0x84cf('0xd')]['name'];this['channelAgent']=this[_0x84cf('0xc')]?util[_0x84cf('0xe')](_0x84cf('0xf'),this[_0x84cf('0xc')]):_0x455345||undefined;this[_0x84cf('0x10')]=checkNameSurname(_0x2c613d[_0x84cf('0x11')][_0x84cf('0x12')],_0x2c613d[_0x84cf('0x11')][_0x84cf('0x13')],_0x2c613d[_0x84cf('0x11')][_0x84cf('0x14')]);this[_0x84cf('0x15')]=_0x2c613d[_0x84cf('0x15')]||![];this[_0x84cf('0x16')]=_0x2c613d[_0x84cf('0x12')];this[_0x84cf('0x17')]=_0x2c613d[_0x84cf('0x17')];this[_0x84cf('0x18')]=_0x2c613d[_0x84cf('0x18')]||0x0;this['countcongestionretry']=_0x2c613d[_0x84cf('0x19')]||0x0;this[_0x84cf('0x1a')]=_0x2c613d[_0x84cf('0x1a')]||0x0;this[_0x84cf('0x1b')]=(_0x2c613d[_0x84cf('0x18')]||0x0)+(_0x2c613d[_0x84cf('0x19')]||0x0)+(_0x2c613d[_0x84cf('0x1a')]||0x0)+(_0x2c613d['countnosuchnumberretry']||0x0)+(_0x2c613d['countdropretry']||0x0)+(_0x2c613d[_0x84cf('0x1c')]||0x0)+(_0x2c613d[_0x84cf('0x1d')]||0x0)+(_0x2c613d[_0x84cf('0x1e')]||0x0);this[_0x84cf('0x1f')]=_0x2c613d[_0x84cf('0x1f')]||0x0;this['countdropretry']=_0x2c613d[_0x84cf('0x20')]||0x0;this[_0x84cf('0x1c')]=_0x2c613d[_0x84cf('0x1c')]||0x0;this[_0x84cf('0x1d')]=_0x2c613d[_0x84cf('0x1d')]||0x0;this['countagentrejectretry']=_0x2c613d[_0x84cf('0x1e')]||0x0;this[_0x84cf('0x21')]=_0x2c613d[_0x84cf('0x21')];this[_0x84cf('0x22')]=_0x2c613d[_0x84cf('0x22')];this[_0x84cf('0x23')]=_0x2c613d[_0x84cf('0x23')];this['recallme']=_0x2c613d[_0x84cf('0x24')];this[_0x84cf('0x25')]=_0x2c613d[_0x84cf('0x25')];this[_0x84cf('0x26')]=_0x2c613d[_0x84cf('0x26')];this[_0x84cf('0x27')]=_[_0x84cf('0x3')](_0x2c613d[_0x84cf('0xd')])?_0x2c613d[_0x84cf('0x27')]:_0x2c613d[_0x84cf('0xd')]['id'];this['VoiceQueueId']=_0x2c613d[_0x84cf('0x28')];this[_0x84cf('0x29')]='';this[_0x84cf('0x2a')]='';}Action[_0x84cf('0x2b')]['getCaller']=function(){return util[_0x84cf('0xe')]('\x22%s\x22\x20<%s>',this[_0x84cf('0x10')],this[_0x84cf('0x2c')]);};module[_0x84cf('0x2d')]=Action; \ No newline at end of file +var _0x236c=['recallme','ContactId','ListId','UserId','originatecalleridnum','prototype','calleridname','number','util','moment','string','isNil','uniqueid','type','campaigntype','queue','dialAnswer','membername','Agent','name','format','phone','Contact','firstName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat'];(function(_0x393712,_0x23fdf5){var _0x42e3c9=function(_0x39986b){while(--_0x39986b){_0x393712['push'](_0x393712['shift']());}};_0x42e3c9(++_0x23fdf5);}(_0x236c,0x155));var _0xc236=function(_0x24abb3,_0x5dfed2){_0x24abb3=_0x24abb3-0x0;var _0x336000=_0x236c[_0x24abb3];return _0x336000;};'use strict';var util=require(_0xc236('0x0'));var _=require('lodash');var moment=require(_0xc236('0x1'));function checkNameSurname(_0x404d50,_0x39c024,_0x8072){var _0x2bf2d3='';if(!_['isNil'](_0x39c024)&&_0xc236('0x2')===typeof _0x39c024){_0x2bf2d3+=_0x39c024;}if(!_[_0xc236('0x3')](_0x8072)&&_0xc236('0x2')===typeof _0x8072){_0x2bf2d3+='\x20'+_0x8072;}if(_0x2bf2d3!==''){return _0x2bf2d3;}return _0x404d50;}function Action(_0xd582f6,_0x23d3cc,_0x461c3a,_0x5abd65,_0xd612c6){this[_0xc236('0x4')]=_0x461c3a||undefined;this['idContact']=_0xd582f6['id'];this['queue']=_0x23d3cc['name'];this[_0xc236('0x5')]=_0x23d3cc['type'];this[_0xc236('0x6')]=_0xc236('0x7');this[_0xc236('0x8')]=![];this[_0xc236('0x9')]=_[_0xc236('0x3')](_0xd582f6['Agent'])?undefined:_0xd582f6[_0xc236('0xa')][_0xc236('0xb')];this['channelAgent']=this[_0xc236('0x9')]?util[_0xc236('0xc')]('SIP/%s',this[_0xc236('0x9')]):_0x5abd65||undefined;this['calleridname']=checkNameSurname(_0xd582f6['Contact'][_0xc236('0xd')],_0xd582f6[_0xc236('0xe')][_0xc236('0xf')],_0xd582f6[_0xc236('0xe')]['lastName']);this[_0xc236('0x10')]=_0xd582f6['active']||![];this['calleridnum']=_0xd582f6[_0xc236('0xd')];this[_0xc236('0x11')]=_0xd582f6[_0xc236('0x11')];this[_0xc236('0x12')]=_0xd582f6[_0xc236('0x12')]||0x0;this['countcongestionretry']=_0xd582f6['countcongestionretry']||0x0;this['countnoanswerretry']=_0xd582f6[_0xc236('0x13')]||0x0;this[_0xc236('0x14')]=(_0xd582f6[_0xc236('0x12')]||0x0)+(_0xd582f6['countcongestionretry']||0x0)+(_0xd582f6[_0xc236('0x13')]||0x0)+(_0xd582f6['countnosuchnumberretry']||0x0)+(_0xd582f6['countdropretry']||0x0)+(_0xd582f6[_0xc236('0x15')]||0x0)+(_0xd582f6[_0xc236('0x16')]||0x0)+(_0xd582f6[_0xc236('0x17')]||0x0);this[_0xc236('0x18')]=_0xd582f6[_0xc236('0x18')]||0x0;this[_0xc236('0x19')]=_0xd582f6[_0xc236('0x19')]||0x0;this[_0xc236('0x15')]=_0xd582f6[_0xc236('0x15')]||0x0;this[_0xc236('0x16')]=_0xd582f6[_0xc236('0x16')]||0x0;this['countagentrejectretry']=_0xd582f6[_0xc236('0x17')]||0x0;this[_0xc236('0x1a')]=_0xd582f6[_0xc236('0x1a')];this[_0xc236('0x1b')]=_0xd582f6[_0xc236('0x1b')];this[_0xc236('0x1c')]=_0xd582f6[_0xc236('0x1c')];this[_0xc236('0x1d')]=_0xd582f6[_0xc236('0x1d')];this[_0xc236('0x1e')]=_0xd582f6[_0xc236('0x1e')];this['ListId']=_0xd582f6[_0xc236('0x1f')];this[_0xc236('0x20')]=_[_0xc236('0x3')](_0xd582f6[_0xc236('0xa')])?_0xd582f6['UserId']:_0xd582f6[_0xc236('0xa')]['id'];this['VoiceQueueId']=_0xd582f6['VoiceQueueId'];this[_0xc236('0x21')]='';this['originatecalleridname']='';}Action[_0xc236('0x22')]['getCaller']=function(){return util[_0xc236('0xc')]('\x22%s\x22\x20<%s>',this[_0xc236('0x23')],this[_0xc236('0x24')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 922e114..ef4dc01 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 _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x19ff4d,_0x471f91){var _0x5a2432=function(_0x55f69f){while(--_0x55f69f){_0x19ff4d['push'](_0x19ff4d['shift']());}};_0x5a2432(++_0x471f91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x2c2add,_0x49691b){var _0x151afe=function(_0x52db30){while(--_0x52db30){_0x2c2add['push'](_0x2c2add['shift']());}};_0x151afe(++_0x49691b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 468d9ab..c4106fd 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 _0xdf31=['UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','then','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','resolve','catch','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact'];(function(_0x2fb422,_0x6b2a6f){var _0x1cd45c=function(_0x5ce683){while(--_0x5ce683){_0x2fb422['push'](_0x2fb422['shift']());}};_0x1cd45c(++_0x6b2a6f);}(_0xdf31,0x15f));var _0x1df3=function(_0x37ce9e,_0x4f28d3){_0x37ce9e=_0x37ce9e-0x0;var _0x4e6371=_0xdf31[_0x37ce9e];return _0x4e6371;};'use strict';var util=require(_0x1df3('0x0'));var BPromise=require(_0x1df3('0x1'));var logger=require('../../../config/logger')(_0x1df3('0x2'));var cmHopper=require(_0x1df3('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1df3('0x4'));var agentReportPreview=require(_0x1df3('0x5'));var voiceQueueReport=require(_0x1df3('0x6'));function loggerCatch(_0x37a0cd){return function(_0x4804ad){logger['error'](_0x37a0cd,util[_0x1df3('0x7')](_0x4804ad,{'showHidden':![],'depth':null}));};}function create(_0x180b8d){return cmHopperHistory[_0x1df3('0x8')](_0x180b8d)['catch'](loggerCatch(_0x1df3('0x9')));}function createAgent(_0x20f226){return BPromise[_0x1df3('0xa')]()['then'](agentReportPreview[_0x1df3('0x8')](_0x20f226))[_0x1df3('0xb')](loggerCatch(_0x1df3('0x9')));}function moveContact(_0x2c8740){return cmHopper['moveContactManagedDialer'](_0x2c8740,!![])[_0x1df3('0xb')](loggerCatch(_0x1df3('0xc')));}exports[_0x1df3('0xd')]=function(_0x20c7b9){return cmHopperBlack['checkIsBlackList'](_0x20c7b9)[_0x1df3('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x1df3('0xe')]=function(_0xcd4ec){return BPromise[_0x1df3('0xa')]()['then'](cmHopper[_0x1df3('0xe')](_0xcd4ec))[_0x1df3('0xb')](loggerCatch(_0x1df3('0xf')));};exports['createHistory']=function(_0x114aab,_0x52850c){create(_0x114aab)[_0x1df3('0xb')](loggerCatch(_0x52850c));moveContact(_0x114aab)[_0x1df3('0xb')](loggerCatch(_0x52850c));};exports[_0x1df3('0x10')]=function(_0xac10a8,_0x5d4ad5){createAgent(_0xac10a8)[_0x1df3('0xb')](loggerCatch(_0x5d4ad5));};exports[_0x1df3('0x11')]=function(_0x297921,_0x2549bd){create(_0x297921)[_0x1df3('0xb')](loggerCatch(_0x2549bd));};exports[_0x1df3('0x12')]=function(_0x1ef6bd,_0x1923cb){moveContact(_0x1ef6bd)[_0x1df3('0xb')](loggerCatch(_0x1923cb));};exports[_0x1df3('0x13')]=function(_0x2a86e3,_0x6bd1b6,_0x4f23c3){if(_0x6bd1b6){_0x2a86e3[_0x1df3('0x14')]=null;}if(_0x4f23c3){_0x2a86e3[_0x1df3('0x15')]=![];}return cmHopper['rescheduleContact'](_0x2a86e3)['catch'](loggerCatch(_0x1df3('0x16')));};exports[_0x1df3('0x17')]=function(_0x45306a){return cmHopper[_0x1df3('0x17')](_0x45306a)[_0x1df3('0xb')](loggerCatch(_0x1df3('0x18')));};exports[_0x1df3('0x19')]=function(_0x20bf68){return cmHopper['unlockContact']({'UserId':null},_0x20bf68,0x1)[_0x1df3('0xb')](loggerCatch(_0x1df3('0x1a')));};exports[_0x1df3('0x1b')]=function(_0x4a23a2){return cmHopper[_0x1df3('0x19')]({'active':![]},_0x4a23a2,0x1)['catch'](loggerCatch(_0x1df3('0x1c')));};exports['crateCustomerReportQueue']=function(_0xb69b9d){var _0x20128a={};_0x20128a['type']=_0xb69b9d['type'];_0x20128a[_0x1df3('0x1d')]=_0xb69b9d[_0x1df3('0x1d')];_0x20128a[_0x1df3('0x1e')]=_0xb69b9d[_0x1df3('0x1e')];_0x20128a[_0x1df3('0x1f')]=_0xb69b9d['calleridname'];_0x20128a[_0x1df3('0x20')]=_0xb69b9d['queue'];_0x20128a[_0x1df3('0x21')]=_0xb69b9d[_0x1df3('0x22')];_0x20128a['queuecallerleaveAt']=_0xb69b9d[_0x1df3('0x22')];_0x20128a['queuecallercomplete']=0x1;_0x20128a[_0x1df3('0x23')]=_0xb69b9d['endtime'];_0x20128a[_0x1df3('0x24')]=_0xb69b9d[_0x1df3('0x25')];_0x20128a[_0x1df3('0x26')]=_0x1df3('0x27');_0x20128a[_0x1df3('0x28')]=_0x1df3('0x29');_0x20128a[_0x1df3('0x2a')]=0x0;_0x20128a[_0x1df3('0x2b')]=0x1;_0x20128a[_0x1df3('0x2c')]=_0xb69b9d[_0x1df3('0x25')];_0x20128a[_0x1df3('0x2d')]=_0x1df3('0x2e');return BPromise[_0x1df3('0xa')]()[_0x1df3('0x2f')](voiceQueueReport[_0x1df3('0x30')](_0x20128a))['catch'](loggerCatch(_0x1df3('0x31')));};exports[_0x1df3('0x32')]=function(_0x5da58e,_0x13931c){return BPromise[_0x1df3('0xa')]()[_0x1df3('0x2f')](cmHopper[_0x1df3('0x32')](_0x5da58e,_0x13931c))[_0x1df3('0xb')](loggerCatch(_0x1df3('0x33')));};exports['rescheduleContactInQueue']=function(_0x2bb61d){return cmHopper[_0x1df3('0x13')](_0x2bb61d,!![],!![])[_0x1df3('0xb')](loggerCatch(_0x1df3('0x34')));}; \ No newline at end of file +var _0x0512=['createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueReport','error','inspect','createHistory','catch','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','[getContactPreview]\x20'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x0512,0x1d8));var _0x2051=function(_0x559391,_0x4a2699){_0x559391=_0x559391-0x0;var _0x48cf02=_0x0512[_0x559391];return _0x48cf02;};'use strict';var util=require(_0x2051('0x0'));var BPromise=require(_0x2051('0x1'));var logger=require('../../../config/logger')(_0x2051('0x2'));var cmHopper=require(_0x2051('0x3'));var cmHopperHistory=require(_0x2051('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x2051('0x5'));function loggerCatch(_0x5b5610){return function(_0x21196d){logger[_0x2051('0x6')](_0x5b5610,util[_0x2051('0x7')](_0x21196d,{'showHidden':![],'depth':null}));};}function create(_0x4f8743){return cmHopperHistory[_0x2051('0x8')](_0x4f8743)[_0x2051('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x497da1){return BPromise['resolve']()[_0x2051('0xa')](agentReportPreview[_0x2051('0x8')](_0x497da1))[_0x2051('0x9')](loggerCatch(_0x2051('0xb')));}function moveContact(_0x50a6c3){return cmHopper['moveContactManagedDialer'](_0x50a6c3,!![])[_0x2051('0x9')](loggerCatch(_0x2051('0xc')));}exports[_0x2051('0xd')]=function(_0x36d88f){return cmHopperBlack[_0x2051('0xd')](_0x36d88f)['catch'](loggerCatch(_0x2051('0xe')));};exports[_0x2051('0xf')]=function(_0x249a7f){return BPromise[_0x2051('0x10')]()['then'](cmHopper[_0x2051('0xf')](_0x249a7f))['catch'](loggerCatch(_0x2051('0x11')));};exports[_0x2051('0x8')]=function(_0x3dd236,_0x276fcb){create(_0x3dd236)[_0x2051('0x9')](loggerCatch(_0x276fcb));moveContact(_0x3dd236)['catch'](loggerCatch(_0x276fcb));};exports[_0x2051('0x12')]=function(_0x4bba4c,_0x1272d7){createAgent(_0x4bba4c)[_0x2051('0x9')](loggerCatch(_0x1272d7));};exports['createCustomerHistory']=function(_0x467266,_0x16f8b6){create(_0x467266)[_0x2051('0x9')](loggerCatch(_0x16f8b6));};exports[_0x2051('0x13')]=function(_0x24dc12,_0x5059fd){moveContact(_0x24dc12)[_0x2051('0x9')](loggerCatch(_0x5059fd));};exports[_0x2051('0x14')]=function(_0x51d42d,_0x3b6ffc,_0x496c41){if(_0x3b6ffc){_0x51d42d[_0x2051('0x15')]=null;}if(_0x496c41){_0x51d42d[_0x2051('0x16')]=![];}return cmHopper[_0x2051('0x14')](_0x51d42d)[_0x2051('0x9')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x2051('0x17')]=function(_0x284bc7){return cmHopper['countReScheduled'](_0x284bc7)[_0x2051('0x9')](loggerCatch(_0x2051('0x18')));};exports[_0x2051('0x19')]=function(_0x5c33b6){return cmHopper[_0x2051('0x19')]({'UserId':null},_0x5c33b6,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x2051('0x1a')]=function(_0x1786b8){return cmHopper['unlockContact']({'active':![]},_0x1786b8,0x1)[_0x2051('0x9')](loggerCatch(_0x2051('0x1b')));};exports['crateCustomerReportQueue']=function(_0x2d1814){var _0x2069c8={};_0x2069c8['type']=_0x2d1814[_0x2051('0x1c')];_0x2069c8[_0x2051('0x1d')]=_0x2d1814[_0x2051('0x1d')];_0x2069c8[_0x2051('0x1e')]=_0x2d1814['calleridnum'];_0x2069c8['calleridname']=_0x2d1814[_0x2051('0x1f')];_0x2069c8['queue']=_0x2d1814[_0x2051('0x20')];_0x2069c8['queuecallerjoinAt']=_0x2d1814[_0x2051('0x21')];_0x2069c8[_0x2051('0x22')]=_0x2d1814[_0x2051('0x21')];_0x2069c8[_0x2051('0x23')]=0x1;_0x2069c8[_0x2051('0x24')]=_0x2d1814['endtime'];_0x2069c8[_0x2051('0x25')]=_0x2d1814[_0x2051('0x26')];_0x2069c8['context']=_0x2051('0x27');_0x2069c8['exten']=_0x2051('0x28');_0x2069c8[_0x2051('0x29')]=0x0;_0x2069c8['assigned']=0x1;_0x2069c8[_0x2051('0x2a')]=_0x2d1814[_0x2051('0x26')];_0x2069c8[_0x2051('0x2b')]=_0x2051('0x2c');return BPromise['resolve']()[_0x2051('0xa')](voiceQueueReport[_0x2051('0x2d')](_0x2069c8))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x2051('0x2e')]=function(_0x43bfac,_0x573e1b){return BPromise[_0x2051('0x10')]()[_0x2051('0xa')](cmHopper[_0x2051('0x2e')](_0x43bfac,_0x573e1b))[_0x2051('0x9')](loggerCatch(_0x2051('0x2f')));};exports[_0x2051('0x30')]=function(_0x5cafac){return cmHopper[_0x2051('0x14')](_0x5cafac,!![],!![])[_0x2051('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 22e9221..32ff84d 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 _0xbc13=['message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','logAgent','statedesc','starttime','logLookAgent','membername','UserId','logCustomer','ringtime','getSeconds','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','not_inuse','status','reachable','push','getDiff','milliseconds','createBody','filterKey','idContact','type','campaigntype','dialAnswer','channelAgent','countglobal','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','\x5cw{0,','pow','random','match','extractCalleridNumber','noanswer','keys','variables','toLowerCase','util','lodash','preview','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','logger2'];(function(_0x3e402f,_0x78f6b4){var _0x4c5607=function(_0xa944e2){while(--_0xa944e2){_0x3e402f['push'](_0x3e402f['shift']());}};_0x4c5607(++_0x78f6b4);}(_0xbc13,0x10e));var _0x3bc1=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xbc13[_0x4a7843];return _0x2c57fe;};'use strict';var util=require(_0x3bc1('0x0'));var _=require(_0x3bc1('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x3bc1('0x2'));var ipAgi=process[_0x3bc1('0x3')][_0x3bc1('0x4')]||'127.0.0.1';var utils=require(_0x3bc1('0x5'));exports[_0x3bc1('0x6')]=function(_0x1c2efb){return function(_0x1fa67a){logger[_0x3bc1('0x7')](_0x1c2efb,util[_0x3bc1('0x8')](_0x1fa67a,{'showHidden':![],'depth':null}));};};exports[_0x3bc1('0x9')]=function(_0x42c747,_0x2db0da){logger[_0x3bc1('0xa')](_0x42c747,util[_0x3bc1('0x8')](_0x2db0da,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x580071,_0x5ea4c7){logger[_0x3bc1('0x7')](_0x580071,util['inspect'](_0x5ea4c7,{'showHidden':![],'depth':null}));};exports[_0x3bc1('0xb')]=function(_0xf19ec1){return function(_0x5b27c3){logger[_0x3bc1('0xa')](_0xf19ec1,util['inspect'](_0x5b27c3,{'showHidden':![],'depth':null}));};};exports[_0x3bc1('0xc')]=function(_0x148089,_0x4b97df,_0x438956){return{'message':_0x148089,'unlock':_0x4b97df,'active':_0x438956};};exports[_0x3bc1('0xd')]=function(_0x5b8644,_0x588986,_0xa99cc){if(!_[_0x3bc1('0xe')](_0xa99cc)&&_0x3bc1('0xf')===typeof _0xa99cc&&!_[_0x3bc1('0x10')](_0xa99cc)){if(!_[_0x3bc1('0xe')](_0x588986)&&'string'===typeof _0x588986&&!_[_0x3bc1('0x10')](_0x588986)){return util[_0x3bc1('0x11')]('\x22%s\x22\x20<%s>',_0x588986,_0xa99cc);}return util[_0x3bc1('0x11')](_0x3bc1('0x12'),_0xa99cc,_0xa99cc);}if(!_[_0x3bc1('0xe')](_0x5b8644)&&_0x3bc1('0xf')===typeof _0x5b8644&&!_['isEmpty'](_0x5b8644)){return _0x5b8644;}return _0x3bc1('0x13');};exports[_0x3bc1('0x14')]=function(_0x3fc970){if(_[_0x3bc1('0x15')](_0x3fc970)){return![];}return _0x3fc970;};exports[_0x3bc1('0x16')]=function(_0x3fe35b,_0x5330b6,_0x5a8419,_0x51aad3,_0xa704d4,_0x2b2b67){var _0x2b4bfa={'XMD-QUEUE':_0x5330b6[_0x3bc1('0x17')]?_0x5330b6[_0x3bc1('0x17')][_0x3bc1('0x18')]:'','XMD-CALLERID':_0x51aad3,'XMD-CALLERID-PREVIEW':_0x2b2b67?util[_0x3bc1('0x11')]('\x22%s\x22\x20<%s>',_0x2b2b67[_0x3bc1('0x19')],_0x2b2b67[_0x3bc1('0x1a')]):_0x51aad3,'XMD-DIALID':_0xa704d4,'XMD-CONTACTID':_0x5330b6[_0x3bc1('0x1b')],'XMD-CDRTYPE':_0x3bc1('0x1c'),'CALLERID(all)':_0x51aad3,'XMD-VOICEQUEUEID':_0x5330b6[_0x3bc1('0x1d')],'XMD-DIALCHANNEL':_0x5a8419,'XMD-DIALTIMEOUT':_0x3fe35b[_0x3bc1('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x3bc1('0x11')](_0x3bc1('0x1f'),_0x3fe35b[_0x3bc1('0x20')]?'g':'',_[_0x3bc1('0x10')](_0x3fe35b['monitor_format'])?'':_0x3bc1('0x21')),'XMD-DIALURL':_0x3fe35b[_0x3bc1('0x22')]||'','XMD-AGI':_0x3fe35b[_0x3bc1('0x23')]?util[_0x3bc1('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3fe35b[_0x3bc1('0x23')]):_0x3bc1('0x24'),'XMD-AGIAFTER':_0x3fe35b[_0x3bc1('0x20')]?util['format'](_0x3bc1('0x25'),ipAgi,_0x3fe35b[_0x3bc1('0x20')]):_0x3bc1('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2b2b67?_0x2b2b67[_0x3bc1('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x2b2b67?_0x2b2b67[_0x3bc1('0x27')]:'','XMD-DESTINATION':_0x3bc1('0x28'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x3bc1('0x10')](_0x3fe35b[_0x3bc1('0x29')])){_0x2b4bfa[util['format']('%s',_0x3bc1('0x2a'))]=_0x3fe35b['monitor_format'];_0x2b4bfa[util['format']('%s',_0x3bc1('0x2b'))]=_0xa704d4;}return _0x2b4bfa;};exports[_0x3bc1('0x2c')]=function(_0x5a7e32){var _0x45b2bf={};for(var _0x1933e8 in _0x5a7e32){if(_0x5a7e32[_0x3bc1('0x2d')](_0x1933e8)){_0x45b2bf[util[_0x3bc1('0x11')]('%s',_[_0x3bc1('0x2e')](_0x1933e8))]=_0x5a7e32[_0x1933e8];}}return{'variables':_0x45b2bf};};exports[_0x3bc1('0x2f')]=function(_0x3603bf,_0xa322d3){if(!_[_0x3bc1('0x15')](_0x3603bf)){if(_0x3603bf[_0x3bc1('0x2d')](_0x3bc1('0x30'))){if(_0x3603bf[_0x3bc1('0x30')]>0x0){_0x3603bf[_0x3bc1('0x30')]-=0x1;}else{logger[_0x3bc1('0x7')](_0x3bc1('0x31'),_0xa322d3);}}}else{logger[_0x3bc1('0x7')](_0x3bc1('0x32'),_0xa322d3);}};exports[_0x3bc1('0x33')]=function(_0x1d6adb){var _0x3d7b66=moment()[_0x3bc1('0x11')](_0x3bc1('0x34'));_0x1d6adb[_0x3bc1('0x35')]=0xd;_0x1d6adb['statedesc']=_0x3bc1('0x36');_0x1d6adb['starttime']=_0x3d7b66;_0x1d6adb[_0x3bc1('0x37')]=_0x3d7b66;_0x1d6adb[_0x3bc1('0x38')]=_0x3d7b66;};exports[_0x3bc1('0x39')]=function(_0x8ddb,_0x58d23b,_0x3111f6){var _0x5a5701=moment()[_0x3bc1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x8ddb['state']=_0x58d23b;_0x8ddb[_0x3bc1('0x3a')]=_0x3111f6;_0x8ddb['responsetime']=_0x5a5701;_0x8ddb['ringtime']=utils['getSeconds'](_0x8ddb[_0x3bc1('0x37')],_0x8ddb[_0x3bc1('0x3b')]);};exports[_0x3bc1('0x3c')]=function(_0x20e9a8,_0x369caf,_0xdef3e8){_0x20e9a8[_0x3bc1('0x3d')]=_0x369caf;_0x20e9a8[_0x3bc1('0x3e')]=_0xdef3e8;};exports[_0x3bc1('0x3f')]=function(_0x1b9dc6,_0x381399,_0x219072){var _0x2336aa=moment()[_0x3bc1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b9dc6['state']=_0x381399;_0x1b9dc6['statedesc']=_0x219072;_0x1b9dc6['responsetime']=_0x1b9dc6[_0x3bc1('0x37')]?_0x1b9dc6[_0x3bc1('0x37')]:_0x2336aa;_0x1b9dc6['endtime']=_0x1b9dc6[_0x3bc1('0x38')]?_0x1b9dc6[_0x3bc1('0x38')]:_0x2336aa;_0x1b9dc6[_0x3bc1('0x40')]=utils[_0x3bc1('0x41')](_0x1b9dc6[_0x3bc1('0x37')]||0x0,_0x1b9dc6[_0x3bc1('0x3b')]||0x0);_0x1b9dc6[_0x3bc1('0x42')]=_0x1b9dc6[_0x3bc1('0x43')]?utils[_0x3bc1('0x41')](_0x1b9dc6['endtime'],_0x1b9dc6[_0x3bc1('0x43')]):0x0;};exports[_0x3bc1('0x44')]=function(_0x473e60){return _0x473e60===_0x3bc1('0x45');};exports[_0x3bc1('0x46')]=function(_0x489a79,_0x3eb73d,_0x211b72,_0x2a2176,_0x25c5ca){var _0x4aa579=_0x2a2176?_0x3bc1('0x47'):_0x489a79[_0x3bc1('0x19')];_0x4aa579=_0x25c5ca?_0x3bc1('0x48'):_0x4aa579;return{'actionid':_0x489a79[_0x3bc1('0x49')],'action':'originate','channel':_0x489a79['channelAgent'],'callerid':util['format'](_0x3bc1('0x12'),_0x4aa579,_0x489a79[_0x3bc1('0x1a')]),'Exten':_0x3bc1('0x28'),'Context':_0x3bc1('0x4a'),'Priority':'1','variable':_0x211b72,'timeout':(_0x3eb73d[_0x3bc1('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x489a79[_0x3bc1('0x49')]};};exports[_0x3bc1('0x4c')]=function(_0x4e584d){return _0x4e584d['countbusyretry']+_0x4e584d[_0x3bc1('0x4d')]+_0x4e584d[_0x3bc1('0x4e')]+_0x4e584d[_0x3bc1('0x4f')]+_0x4e584d[_0x3bc1('0x50')];};exports[_0x3bc1('0x51')]=function(_0x2f997f){var _0x1de12b=_[_0x3bc1('0x52')](_0x2f997f);_0x1de12b[_0x3bc1('0x35')]=0xf;_0x1de12b[_0x3bc1('0x3a')]='Global';return _0x1de12b;};exports[_0x3bc1('0x53')]=function(_0x14f8fb,_0x31947e,_0x46cd30){var _0x5294a8={};_0x5294a8[_0x31947e]=_0x14f8fb[_0x31947e];_0x5294a8[_0x3bc1('0x54')]=![];_0x5294a8[_0x3bc1('0x55')]=moment()[_0x3bc1('0x56')](_0x46cd30,_0x3bc1('0x57'))[_0x3bc1('0x11')](_0x3bc1('0x34'));_0x5294a8['ContactId']=_0x14f8fb[_0x3bc1('0x1b')];_0x5294a8[_0x3bc1('0x58')]=_0x14f8fb['ListId'];_0x5294a8[_0x3bc1('0x1d')]=_0x14f8fb['VoiceQueueId']||undefined;return _0x5294a8;};exports[_0x3bc1('0x59')]=function(_0x201f61,_0x5db5d1){if(!_[_0x3bc1('0x15')](_0x201f61)){if(_0x201f61[_0x3bc1('0x5a')]>0x0){_0x201f61['pTalking']-=0x1;}else{logger['error'](_0x5db5d1,_0x3bc1('0x5b'));}}else{logger[_0x3bc1('0x7')](_0x5db5d1,_0x3bc1('0x5c'));}};exports['IsNotLoggedIn']=function(_0x1a7b7e){if(_0x1a7b7e<=0x0){return!![];}return![];};function buildObj(_0x13ce7e,_0x572d7c,_0x12a6b9){_0x13ce7e[_0x3bc1('0x5d')]=_0x572d7c;_0x13ce7e[_0x3bc1('0x18')]=_0x13ce7e[_0x3bc1('0x5e')];_0x13ce7e[_0x3bc1('0x5f')]=_0x13ce7e['channelAgent'];_0x13ce7e[_0x3bc1('0x60')]=_0x3bc1('0x61');if(_0x12a6b9){_0x13ce7e[_0x3bc1('0x62')]=_0x12a6b9[_0x3bc1('0x62')];}return _0x13ce7e;}exports['buildObj']=buildObj;exports['agentReadyId']=function(_0x578477){var _0x1cd8b9=[];for(var _0x1b2a1e in _0x578477){if(_0x578477[_0x3bc1('0x2d')](_0x1b2a1e)){if(!_[_0x3bc1('0x15')](_0x578477[_0x1b2a1e])&&_0x578477[_0x1b2a1e][_0x3bc1('0x35')]===_0x3bc1('0x63')&&_0x578477[_0x1b2a1e][_0x3bc1('0x64')]===_0x3bc1('0x65')){_0x1cd8b9[_0x3bc1('0x66')](_0x578477[_0x1b2a1e]['id']);}}}return _0x1cd8b9;};exports[_0x3bc1('0x67')]=function(_0x1f3f57){var _0xaec9f9=moment()[_0x3bc1('0x68')](0x0);var _0x40c646=moment(_0x1f3f57)[_0x3bc1('0x68')](0x0);return _0xaec9f9['diff'](_0x40c646,'seconds');};exports[_0x3bc1('0x69')]=function(_0x5e531b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e531b[_0x3bc1('0x1b')],'ListId':_0x5e531b[_0x3bc1('0x58')],'VoiceQueueId':_0x5e531b[_0x3bc1('0x1d')]||undefined,'CampaignId':_0x5e531b['CampaignId']||undefined};};exports[_0x3bc1('0x6a')]=function(_0x36956b){if(_0x36956b===_0x3bc1('0x49')||_0x36956b===_0x3bc1('0x6b')||_0x36956b===_0x3bc1('0x5e')||_0x36956b===_0x3bc1('0x6c')||_0x36956b===_0x3bc1('0x6d')||_0x36956b===_0x3bc1('0x6e')||_0x36956b===_0x3bc1('0x3d')||_0x36956b===_0x3bc1('0x6f')||_0x36956b===_0x3bc1('0x19')||_0x36956b==='active'||_0x36956b===_0x3bc1('0x1a')||_0x36956b==='scheduledat'||_0x36956b==='countbusyretry'||_0x36956b===_0x3bc1('0x4d')||_0x36956b===_0x3bc1('0x4e')||_0x36956b===_0x3bc1('0x70')||_0x36956b==='callback'||_0x36956b===_0x3bc1('0x71')||_0x36956b==='callbackat'||_0x36956b===_0x3bc1('0x72')||_0x36956b===_0x3bc1('0x1b')||_0x36956b===_0x3bc1('0x58')||_0x36956b==='UserId'||_0x36956b===_0x3bc1('0x1d')||_0x36956b===_0x3bc1('0x73')||_0x36956b==='xmd-voicequeueid'||_0x36956b===_0x3bc1('0x74')||_0x36956b===_0x3bc1('0x75')||_0x36956b===_0x3bc1('0x76')||_0x36956b==='xmd-dialurl'||_0x36956b===_0x3bc1('0x77')||_0x36956b===_0x3bc1('0x78')||_0x36956b===_0x3bc1('0x79')||_0x36956b===_0x3bc1('0x7a')||_0x36956b==='xmd-contactid'||_0x36956b==='xmd-cdrtype'||_0x36956b===_0x3bc1('0x7b')||_0x36956b==='xmd-agiafter'||_0x36956b===_0x3bc1('0x7c')||_0x36956b===_0x3bc1('0x7d')||_0x36956b===_0x3bc1('0x7e')||_0x36956b==='rtpaudioqosjitter'||_0x36956b===_0x3bc1('0x7f')||_0x36956b===_0x3bc1('0x80')||_0x36956b===_0x3bc1('0x81')||_0x36956b===_0x3bc1('0x82')||_0x36956b===_0x3bc1('0x83')||_0x36956b===_0x3bc1('0x7d')||_0x36956b===_0x3bc1('0x7e')||_0x36956b==='rtpaudioqosjitter'||_0x36956b===_0x3bc1('0x7f')||_0x36956b===_0x3bc1('0x80')||_0x36956b==='rtpaudioqoslossbridged'||_0x36956b===_0x3bc1('0x82')||_0x36956b==='rtpaudioqosrttbridged'||_0x36956b==='bridgepeer'||_0x36956b==='bridgepvtcallid'||_0x36956b===_0x3bc1('0x35')||_0x36956b==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1dd6a8,_0x345063){var _0x150650,_0x94f9d3,_0x5dae9b;if(_0x345063<=0x0){_0x345063=0x1;}_0x150650=new RegExp(_0x3bc1('0x84')+_0x345063+'}$');_0x94f9d3=Math[_0x3bc1('0x85')](0xa,_0x345063-0x1);_0x5dae9b=Math[_0x3bc1('0x85')](0xa,_0x345063)-0x1;return util['format']('%s',_['replace'](_0x1dd6a8,_0x150650,_[_0x3bc1('0x86')](_0x94f9d3,_0x5dae9b)));};exports['extractCalleridName']=function(_0x54753c){var _0x1ba479=_0x54753c[_0x3bc1('0x87')](/"(.*?)"/);return _0x1ba479?_0x1ba479[0x1]:_0x54753c;};exports[_0x3bc1('0x88')]=function(_0x2f1f6d){var _0x407cd9=_0x2f1f6d[_0x3bc1('0x87')](/<(.*?)>/);return _0x407cd9?_0x407cd9[0x1]:_0x2f1f6d;};function buildNoAnswerEventPayload(_0x2bbf35,_0x1a2783){var _0x11bac2=buildObj(_0x2bbf35,_0x3bc1('0x89'));if(!_['isEmpty'](_0x1a2783['variables'])){Object[_0x3bc1('0x8a')](_0x1a2783[_0x3bc1('0x8b')])['forEach'](function(_0x567edc){_0x11bac2[_0x567edc[_0x3bc1('0x8c')]()]=_0x1a2783[_0x3bc1('0x8b')][_0x567edc];});}return _0x11bac2;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xbcfe=['countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildObj','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','campaigntype','scheduledat','countglobal','callback','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','logger','info','error','logger2','inspect','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','getSeconds','membername','UserId','logCustomer','ringtime','answertime','isFailure','uniqueid','timeout','totalGlobal','countbusyretry'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbcfe,0xc8));var _0xebcf=function(_0xc234bf,_0x10cc1c){_0xc234bf=_0xc234bf-0x0;var _0x2e79aa=_0xbcfe[_0xc234bf];return _0x2e79aa;};'use strict';var util=require('util');var _=require(_0xebcf('0x0'));var moment=require('moment');var logger=require(_0xebcf('0x1'))(_0xebcf('0x2'));var ipAgi=process[_0xebcf('0x3')][_0xebcf('0x4')]||_0xebcf('0x5');var utils=require(_0xebcf('0x6'));exports[_0xebcf('0x7')]=function(_0x2635d1){return function(_0x339d29){logger['error'](_0x2635d1,util['inspect'](_0x339d29,{'showHidden':![],'depth':null}));};};exports[_0xebcf('0x8')]=function(_0x404df8,_0x370251){logger[_0xebcf('0x9')](_0x404df8,util['inspect'](_0x370251,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3d01e1,_0xecf7dc){logger[_0xebcf('0xa')](_0x3d01e1,util['inspect'](_0xecf7dc,{'showHidden':![],'depth':null}));};exports[_0xebcf('0xb')]=function(_0x1cc67b){return function(_0x2812e0){logger[_0xebcf('0x9')](_0x1cc67b,util[_0xebcf('0xc')](_0x2812e0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xe43a90,_0x50a26a,_0x57da7d){return{'message':_0xe43a90,'unlock':_0x50a26a,'active':_0x57da7d};};exports[_0xebcf('0xd')]=function(_0x28b583,_0x2541bb,_0x1fa326){if(!_['isUndefined'](_0x1fa326)&&_0xebcf('0xe')===typeof _0x1fa326&&!_[_0xebcf('0xf')](_0x1fa326)){if(!_[_0xebcf('0x10')](_0x2541bb)&&_0xebcf('0xe')===typeof _0x2541bb&&!_[_0xebcf('0xf')](_0x2541bb)){return util[_0xebcf('0x11')](_0xebcf('0x12'),_0x2541bb,_0x1fa326);}return util[_0xebcf('0x11')](_0xebcf('0x12'),_0x1fa326,_0x1fa326);}if(!_[_0xebcf('0x10')](_0x28b583)&&'string'===typeof _0x28b583&&!_[_0xebcf('0xf')](_0x28b583)){return _0x28b583;}return _0xebcf('0x13');};exports['isActive']=function(_0x352ab7){if(_['isNil'](_0x352ab7)){return![];}return _0x352ab7;};exports[_0xebcf('0x14')]=function(_0x125663,_0x539a63,_0x407196,_0x11c32a,_0x5847cd,_0x5d93da){var _0x92c3ac={'XMD-QUEUE':_0x539a63['Queue']?_0x539a63[_0xebcf('0x15')][_0xebcf('0x16')]:'','XMD-CALLERID':_0x11c32a,'XMD-CALLERID-PREVIEW':_0x5d93da?util[_0xebcf('0x11')](_0xebcf('0x12'),_0x5d93da[_0xebcf('0x17')],_0x5d93da[_0xebcf('0x18')]):_0x11c32a,'XMD-DIALID':_0x5847cd,'XMD-CONTACTID':_0x539a63[_0xebcf('0x19')],'XMD-CDRTYPE':_0xebcf('0x1a'),'CALLERID(all)':_0x11c32a,'XMD-VOICEQUEUEID':_0x539a63[_0xebcf('0x1b')],'XMD-DIALCHANNEL':_0x407196,'XMD-DIALTIMEOUT':_0x125663[_0xebcf('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xebcf('0x11')](_0xebcf('0x1d'),_0x125663['dialQueueProject2']?'g':'',_[_0xebcf('0xf')](_0x125663[_0xebcf('0x1e')])?'':_0xebcf('0x1f')),'XMD-DIALURL':_0x125663[_0xebcf('0x20')]||'','XMD-AGI':_0x125663['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x125663[_0xebcf('0x21')]):_0xebcf('0x22'),'XMD-AGIAFTER':_0x125663[_0xebcf('0x23')]?util[_0xebcf('0x11')](_0xebcf('0x24'),ipAgi,_0x125663['dialQueueProject2']):_0xebcf('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x5d93da?_0x5d93da[_0xebcf('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d93da?_0x5d93da[_0xebcf('0x26')]:'','XMD-DESTINATION':_0xebcf('0x27'),'SIPADDHEADER':_0xebcf('0x28')};if(!_['isEmpty'](_0x125663['monitor_format'])){_0x92c3ac[util['format']('%s',_0xebcf('0x29'))]=_0x125663[_0xebcf('0x1e')];_0x92c3ac[util[_0xebcf('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5847cd;}return _0x92c3ac;};exports[_0xebcf('0x2a')]=function(_0x5ee6e9){var _0x375945={};for(var _0xadb46e in _0x5ee6e9){if(_0x5ee6e9[_0xebcf('0x2b')](_0xadb46e)){_0x375945[util[_0xebcf('0x11')]('%s',_[_0xebcf('0x2c')](_0xadb46e))]=_0x5ee6e9[_0xadb46e];}}return{'variables':_0x375945};};exports[_0xebcf('0x2d')]=function(_0x49afad,_0x2bf46c){if(!_[_0xebcf('0x2e')](_0x49afad)){if(_0x49afad[_0xebcf('0x2b')](_0xebcf('0x2f'))){if(_0x49afad[_0xebcf('0x2f')]>0x0){_0x49afad['originated']-=0x1;}else{logger[_0xebcf('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2bf46c);}}}else{logger[_0xebcf('0xa')](_0xebcf('0x30'),_0x2bf46c);}};exports['logBlacklist']=function(_0x5e8a9a){var _0x4afd4a=moment()[_0xebcf('0x11')](_0xebcf('0x31'));_0x5e8a9a[_0xebcf('0x32')]=0xd;_0x5e8a9a[_0xebcf('0x33')]=_0xebcf('0x34');_0x5e8a9a[_0xebcf('0x35')]=_0x4afd4a;_0x5e8a9a[_0xebcf('0x36')]=_0x4afd4a;_0x5e8a9a[_0xebcf('0x37')]=_0x4afd4a;};exports[_0xebcf('0x38')]=function(_0x591964,_0x3ebac5,_0x822935){var _0xca91fc=moment()[_0xebcf('0x11')](_0xebcf('0x31'));_0x591964['state']=_0x3ebac5;_0x591964[_0xebcf('0x33')]=_0x822935;_0x591964[_0xebcf('0x36')]=_0xca91fc;_0x591964['ringtime']=utils[_0xebcf('0x39')](_0x591964[_0xebcf('0x36')],_0x591964[_0xebcf('0x35')]);};exports['logLookAgent']=function(_0x3065be,_0x2dcea9,_0x459294){_0x3065be[_0xebcf('0x3a')]=_0x2dcea9;_0x3065be[_0xebcf('0x3b')]=_0x459294;};exports[_0xebcf('0x3c')]=function(_0x8538bb,_0x5cdc1f,_0x45fdff){var _0x22147a=moment()[_0xebcf('0x11')](_0xebcf('0x31'));_0x8538bb['state']=_0x5cdc1f;_0x8538bb[_0xebcf('0x33')]=_0x45fdff;_0x8538bb[_0xebcf('0x36')]=_0x8538bb[_0xebcf('0x36')]?_0x8538bb['responsetime']:_0x22147a;_0x8538bb[_0xebcf('0x37')]=_0x8538bb[_0xebcf('0x37')]?_0x8538bb[_0xebcf('0x37')]:_0x22147a;_0x8538bb[_0xebcf('0x3d')]=utils[_0xebcf('0x39')](_0x8538bb[_0xebcf('0x36')]||0x0,_0x8538bb['starttime']||0x0);_0x8538bb['talktime']=_0x8538bb[_0xebcf('0x3e')]?utils[_0xebcf('0x39')](_0x8538bb['endtime'],_0x8538bb[_0xebcf('0x3e')]):0x0;};exports[_0xebcf('0x3f')]=function(_0x4861eb){return _0x4861eb==='Failure';};exports['variablesAction']=function(_0x4f3046,_0x1abd8d,_0x1ca286,_0x1ae8d7,_0xebead6){var _0x4728a0=_0x1ae8d7?'RECALL':_0x4f3046[_0xebcf('0x17')];_0x4728a0=_0xebead6?'BOOKED':_0x4728a0;return{'actionid':_0x4f3046[_0xebcf('0x40')],'action':'originate','channel':_0x4f3046['channelAgent'],'callerid':util[_0xebcf('0x11')]('\x22%s\x22\x20<%s>',_0x4728a0,_0x4f3046[_0xebcf('0x18')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x1ca286,'timeout':(_0x1abd8d[_0xebcf('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4f3046[_0xebcf('0x40')]};};exports[_0xebcf('0x42')]=function(_0x59a58a){return _0x59a58a[_0xebcf('0x43')]+_0x59a58a[_0xebcf('0x44')]+_0x59a58a[_0xebcf('0x45')]+_0x59a58a[_0xebcf('0x46')]+_0x59a58a[_0xebcf('0x47')];};exports[_0xebcf('0x48')]=function(_0x37099b){var _0x4cba7c=_[_0xebcf('0x49')](_0x37099b);_0x4cba7c[_0xebcf('0x32')]=0xf;_0x4cba7c[_0xebcf('0x33')]=_0xebcf('0x4a');return _0x4cba7c;};exports[_0xebcf('0x4b')]=function(_0x113118,_0x43dc47,_0x137cb6){var _0x528056={};_0x528056[_0x43dc47]=_0x113118[_0x43dc47];_0x528056[_0xebcf('0x4c')]=![];_0x528056['scheduledat']=moment()['add'](_0x137cb6,_0xebcf('0x4d'))['format'](_0xebcf('0x31'));_0x528056['ContactId']=_0x113118[_0xebcf('0x19')];_0x528056[_0xebcf('0x4e')]=_0x113118[_0xebcf('0x4e')];_0x528056[_0xebcf('0x1b')]=_0x113118['VoiceQueueId']||undefined;return _0x528056;};exports[_0xebcf('0x4f')]=function(_0x107e6e,_0x1b894a){if(!_[_0xebcf('0x2e')](_0x107e6e)){if(_0x107e6e[_0xebcf('0x50')]>0x0){_0x107e6e[_0xebcf('0x50')]-=0x1;}else{logger[_0xebcf('0xa')](_0x1b894a,_0xebcf('0x51'));}}else{logger['error'](_0x1b894a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xebcf('0x52')]=function(_0x50ba38){if(_0x50ba38<=0x0){return!![];}return![];};function buildObj(_0x24af38,_0x13513f,_0x91d6e2){_0x24af38[_0xebcf('0x53')]=_0x13513f;_0x24af38[_0xebcf('0x16')]=_0x24af38[_0xebcf('0x54')];_0x24af38[_0xebcf('0x55')]=_0x24af38[_0xebcf('0x56')];_0x24af38[_0xebcf('0x57')]='voice';if(_0x91d6e2){_0x24af38[_0xebcf('0x58')]=_0x91d6e2[_0xebcf('0x58')];}return _0x24af38;}exports[_0xebcf('0x59')]=buildObj;exports[_0xebcf('0x5a')]=function(_0x1a4cc1){var _0x3df8d4=[];for(var _0x225f55 in _0x1a4cc1){if(_0x1a4cc1[_0xebcf('0x2b')](_0x225f55)){if(!_[_0xebcf('0x2e')](_0x1a4cc1[_0x225f55])&&_0x1a4cc1[_0x225f55]['state']===_0xebcf('0x5b')&&_0x1a4cc1[_0x225f55]['status']===_0xebcf('0x5c')){_0x3df8d4[_0xebcf('0x5d')](_0x1a4cc1[_0x225f55]['id']);}}}return _0x3df8d4;};exports[_0xebcf('0x5e')]=function(_0x3e2ab5){var _0x2743f5=moment()[_0xebcf('0x5f')](0x0);var _0x5ccbac=moment(_0x3e2ab5)[_0xebcf('0x5f')](0x0);return _0x2743f5[_0xebcf('0x60')](_0x5ccbac,_0xebcf('0x61'));};exports[_0xebcf('0x62')]=function(_0x481970){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x481970[_0xebcf('0x19')],'ListId':_0x481970['ListId'],'VoiceQueueId':_0x481970['VoiceQueueId']||undefined,'CampaignId':_0x481970[_0xebcf('0x63')]||undefined};};exports[_0xebcf('0x64')]=function(_0x327142){if(_0x327142===_0xebcf('0x40')||_0x327142==='idContact'||_0x327142==='queue'||_0x327142===_0xebcf('0x65')||_0x327142===_0xebcf('0x66')||_0x327142==='dialAnswer'||_0x327142==='membername'||_0x327142===_0xebcf('0x56')||_0x327142===_0xebcf('0x17')||_0x327142==='active'||_0x327142==='calleridnum'||_0x327142===_0xebcf('0x67')||_0x327142==='countbusyretry'||_0x327142===_0xebcf('0x44')||_0x327142===_0xebcf('0x45')||_0x327142===_0xebcf('0x68')||_0x327142===_0xebcf('0x69')||_0x327142==='callbackuniqueid'||_0x327142==='callbackat'||_0x327142==='recallme'||_0x327142===_0xebcf('0x19')||_0x327142==='ListId'||_0x327142==='UserId'||_0x327142===_0xebcf('0x1b')||_0x327142==='sipcallid'||_0x327142===_0xebcf('0x6a')||_0x327142===_0xebcf('0x6b')||_0x327142==='xmd-phone'||_0x327142===_0xebcf('0x6c')||_0x327142==='xmd-dialurl'||_0x327142===_0xebcf('0x6d')||_0x327142==='xmd-dialoptions'||_0x327142===_0xebcf('0x6e')||_0x327142==='xmd-dialchannel'||_0x327142===_0xebcf('0x6f')||_0x327142===_0xebcf('0x70')||_0x327142===_0xebcf('0x71')||_0x327142==='xmd-agiafter'||_0x327142===_0xebcf('0x72')||_0x327142===_0xebcf('0x73')||_0x327142===_0xebcf('0x74')||_0x327142===_0xebcf('0x75')||_0x327142===_0xebcf('0x76')||_0x327142===_0xebcf('0x77')||_0x327142===_0xebcf('0x78')||_0x327142===_0xebcf('0x79')||_0x327142===_0xebcf('0x7a')||_0x327142==='rtpaudioqos'||_0x327142===_0xebcf('0x74')||_0x327142===_0xebcf('0x75')||_0x327142===_0xebcf('0x76')||_0x327142==='rtpaudioqosloss'||_0x327142===_0xebcf('0x78')||_0x327142===_0xebcf('0x79')||_0x327142===_0xebcf('0x7a')||_0x327142==='bridgepeer'||_0x327142===_0xebcf('0x7b')||_0x327142===_0xebcf('0x32')||_0x327142===_0xebcf('0x33')){return![];}return!![];};exports[_0xebcf('0x7c')]=function(_0x35b166,_0x15a307){var _0x322af3,_0x3772d7,_0x2ed8bd;if(_0x15a307<=0x0){_0x15a307=0x1;}_0x322af3=new RegExp(_0xebcf('0x7d')+_0x15a307+'}$');_0x3772d7=Math['pow'](0xa,_0x15a307-0x1);_0x2ed8bd=Math['pow'](0xa,_0x15a307)-0x1;return util[_0xebcf('0x11')]('%s',_[_0xebcf('0x7e')](_0x35b166,_0x322af3,_[_0xebcf('0x7f')](_0x3772d7,_0x2ed8bd)));};exports[_0xebcf('0x80')]=function(_0x2c77e3){var _0x4eb9a3=_0x2c77e3[_0xebcf('0x81')](/"(.*?)"/);return _0x4eb9a3?_0x4eb9a3[0x1]:_0x2c77e3;};exports[_0xebcf('0x82')]=function(_0x48a0df){var _0x33240b=_0x48a0df[_0xebcf('0x81')](/<(.*?)>/);return _0x33240b?_0x33240b[0x1]:_0x48a0df;};function buildNoAnswerEventPayload(_0x45a2e1,_0x21c54b){var _0x505555=buildObj(_0x45a2e1,'noanswer');if(!_['isEmpty'](_0x21c54b[_0xebcf('0x83')])){Object[_0xebcf('0x84')](_0x21c54b['variables'])[_0xebcf('0x85')](function(_0x36ec10){_0x505555[_0x36ec10['toLowerCase']()]=_0x21c54b[_0xebcf('0x83')][_0x36ec10];});}return _0x505555;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a6f3085..183ff45 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 _0x8971=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean'];(function(_0x4389e1,_0x3dbb5f){var _0x3f551b=function(_0x2cf602){while(--_0x2cf602){_0x4389e1['push'](_0x4389e1['shift']());}};_0x3f551b(++_0x3dbb5f);}(_0x8971,0x9c));var _0x1897=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x8971[_0x36884e];return _0x1cc367;};'use strict';exports[_0x1897('0x0')]={'queue':{'type':_0x1897('0x1'),'required':!![]},'interface':{'type':_0x1897('0x1'),'required':!![]},'membername':{'type':_0x1897('0x1'),'required':!![]},'penalty':{'type':_0x1897('0x2'),'required':![]},'paused':{'type':_0x1897('0x3'),'required':![]}};exports[_0x1897('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x1897('0x5')]={'interface':{'type':_0x1897('0x1'),'required':!![]},'paused':{'type':_0x1897('0x3')},'reason':{'type':_0x1897('0x1'),'required':![]}};exports[_0x1897('0x6')]={'module':{'type':_0x1897('0x1'),'required':![]}};exports[_0x1897('0x7')]={'uniqueid':{'type':_0x1897('0x1'),'required':!![]}};exports[_0x1897('0x8')]={'uniqueid':{'type':_0x1897('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x1897('0x1')},'mixmonitorid':{'type':_0x1897('0x1')}};exports[_0x1897('0x9')]={'uniqueid':{'type':_0x1897('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1897('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x8552=['boolean','queuepause','reload','voicequeuechannel','voicequeuechannelredirect','queueadd','string','number'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8552,0x65));var _0x2855=function(_0x4a8f5f,_0x7cd06b){_0x4a8f5f=_0x4a8f5f-0x0;var _0x103648=_0x8552[_0x4a8f5f];return _0x103648;};'use strict';exports[_0x2855('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x2855('0x1'),'required':!![]},'membername':{'type':_0x2855('0x1'),'required':!![]},'penalty':{'type':_0x2855('0x2'),'required':![]},'paused':{'type':_0x2855('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x2855('0x1'),'required':!![]},'interface':{'type':_0x2855('0x1'),'required':!![]}};exports[_0x2855('0x4')]={'interface':{'type':_0x2855('0x1'),'required':!![]},'paused':{'type':_0x2855('0x3')},'reason':{'type':_0x2855('0x1'),'required':![]}};exports[_0x2855('0x5')]={'module':{'type':_0x2855('0x1'),'required':![]}};exports[_0x2855('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2855('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x2855('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x2855('0x1'),'required':!![]}};exports[_0x2855('0x7')]={'uniqueid':{'type':_0x2855('0x1'),'required':!![]},'exten':{'type':_0x2855('0x1'),'required':!![]},'context':{'type':_0x2855('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0aa77eb..0c04110 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x17ebff,_0x5b5583){var _0x22d33e=function(_0x2b8012){while(--_0x2b8012){_0x17ebff['push'](_0x17ebff['shift']());}};_0x22d33e(++_0x5b5583);}(_0xb10b,0x12a));var _0xbb10=function(_0x129b52,_0x29a8f3){_0x129b52=_0x129b52-0x0;var _0x5e0266=_0xb10b[_0x129b52];return _0x5e0266;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x43f74e,_0x12fd7e){var _0x1e904e=function(_0x310861){while(--_0x310861){_0x43f74e['push'](_0x43f74e['shift']());}};_0x1e904e(++_0x12fd7e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x556481,_0x102733){_0x556481=_0x556481-0x0;var _0xc6403f=_0x5f2f[_0x556481];return _0xc6403f;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 1942442..cec5b97 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 _0xbf52=['mergeDBDataToRealtime','assign'];(function(_0x1b6057,_0x43ac7e){var _0x19ed50=function(_0x15e650){while(--_0x15e650){_0x1b6057['push'](_0x1b6057['shift']());}};_0x19ed50(++_0x43ac7e);}(_0xbf52,0x1df));var _0x2bf5=function(_0x4645bd,_0x1ad4c){_0x4645bd=_0x4645bd-0x0;var _0x59ebbb=_0xbf52[_0x4645bd];return _0x59ebbb;};'use strict';function mergeDBDataToRealtime(_0x517f17,_0x19ec57){var _0x16bf81=Object[_0x2bf5('0x0')]({},_0x517f17);for(var _0x3a4576 in _0x19ec57){if(_0x16bf81['hasOwnProperty'](_0x3a4576)){_0x16bf81[_0x3a4576]=_0x19ec57[_0x3a4576];}}return _0x16bf81;}exports[_0x2bf5('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x21c0=['hasOwnProperty'];(function(_0x499e36,_0xc35951){var _0x95bf7b=function(_0x332fe1){while(--_0x332fe1){_0x499e36['push'](_0x499e36['shift']());}};_0x95bf7b(++_0xc35951);}(_0x21c0,0x109));var _0x021c=function(_0x12ae73,_0x49975f){_0x12ae73=_0x12ae73-0x0;var _0x5ea6ea=_0x21c0[_0x12ae73];return _0x5ea6ea;};'use strict';function mergeDBDataToRealtime(_0x33f41e,_0x9c446f){var _0x3cb026=Object['assign']({},_0x33f41e);for(var _0x68cb74 in _0x9c446f){if(_0x3cb026[_0x021c('0x0')](_0x68cb74)){_0x3cb026[_0x68cb74]=_0x9c446f[_0x68cb74];}}return _0x3cb026;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8ad3698..6e109a6 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 _0x80b5=['destinationchannel','originatecalleridnum','disposition','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','moment','util','../../../config/environment','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','keys','getCallType','channel','calleridnum','outbound','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x80b5,0x12b));var _0x580b=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x80b5[_0x330414];return _0x99dbff;};'use strict';var _=require('lodash');var moment=require(_0x580b('0x0'));var util=require(_0x580b('0x1'));var config=require(_0x580b('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x580b('0x3'));var RpcMemberReport=require(_0x580b('0x4'));var RpcVoiceQueueReport=require(_0x580b('0x5'));var RpcVoiceRecording=require(_0x580b('0x6'));var RpcVoiceTransferReport=require(_0x580b('0x7'));var VoiceQueueReport=require(_0x580b('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x580b('0x9'));var VoiceDialReport=require(_0x580b('0xa'));var UserReport=require(_0x580b('0xb'));function Report(_0x5eca70){this[_0x580b('0xc')]=_0x5eca70;this[_0x580b('0xd')]=_0x5eca70[_0x580b('0xd')];this['telephones']=_0x5eca70[_0x580b('0xe')];}Report[_0x580b('0xf')][_0x580b('0x10')]=function(_0x7d6020){var _0x5114bd=new VoiceQueueReport(this[_0x580b('0xc')]);var _0x1f4d09=new VoiceAgentReport(this['realtime']);var _0x2c14dd=new VoiceDialReport(this[_0x580b('0xc')]);var _0x571090=new VoiceCallReport(this[_0x580b('0xc')]);var _0x48fff2=new UserReport(this[_0x580b('0xc')]);if(config['xdr']&&config[_0x580b('0x11')][_0x580b('0x12')]){ami['on'](_0x580b('0x13'),this[_0x580b('0x14')][_0x580b('0x15')](this));ami['on'](_0x580b('0x16'),this[_0x580b('0x17')][_0x580b('0x15')](this));ami['on'](_0x580b('0x18'),this[_0x580b('0x19')][_0x580b('0x15')](this));ami['on'](_0x580b('0x1a'),this[_0x580b('0x1b')][_0x580b('0x15')](this));ami['on'](_0x580b('0x1c'),this[_0x580b('0x1d')][_0x580b('0x15')](this));ami['on']('attendedtransfer',this[_0x580b('0x1e')][_0x580b('0x15')](this));}};Report[_0x580b('0xf')][_0x580b('0x1f')]=function(_0xe5050c){var _0x1c169d;_0x1c169d=_[_0x580b('0x20')](this['agents'],function(_0x4c13e4){return _0x4c13e4[_0x580b('0x21')]==_0xe5050c||_0x4c13e4[_0x580b('0x22')]==_0xe5050c;});if(_[_0x580b('0x23')](_0x1c169d)){var _0x4ee136=_[_0x580b('0x20')](this[_0x580b('0xe')],function(_0x2ac1c0){return _0x2ac1c0['accountcode']==_0xe5050c||_0x2ac1c0[_0x580b('0x22')]==_0xe5050c;});if(_0x4ee136){_0x1c169d=_[_0x580b('0x20')](this[_0x580b('0xd')],function(_0x33393b){return _0x33393b[_0x580b('0x24')]==util[_0x580b('0x25')](_0x580b('0x26'),_0x4ee136[_0x580b('0x22')]);});}}return _0x1c169d;};Report[_0x580b('0xf')][_0x580b('0x14')]=function(_0x2ff810){for(var _0x41e4b0=0x0;_0x41e4b0<_0x2ff810[_0x580b('0x27')];_0x41e4b0+=0x1){var _0x575032=this['findAgent'](_0x2ff810[_0x41e4b0][_0x580b('0x28')]);if(_0x575032){_0x2ff810[_0x41e4b0]['accountcode']=_0x575032[_0x580b('0x21')];_0x2ff810[_0x41e4b0][_0x580b('0x29')]=!![];_0x2ff810[_0x41e4b0][_0x580b('0x2a')]=_0x575032[_0x580b('0x22')];_0x2ff810[_0x41e4b0][_0x580b('0x24')]=_[_0x580b('0x23')](_0x575032[_0x580b('0x24')])?util[_0x580b('0x25')](_0x580b('0x26'),_0x575032['name']):_0x575032[_0x580b('0x24')];if(_0x2ff810[_0x41e4b0][_0x580b('0x2b')]){_0x2ff810[_0x41e4b0][_0x580b('0x2c')]=moment()[_0x580b('0x25')](_0x580b('0x2d'));}if(_0x2ff810[_0x41e4b0]['queuecallerexit']){_0x2ff810[_0x41e4b0]['queuecallerexitAt']=moment()[_0x580b('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x580b('0x14')](_0x2ff810[_0x41e4b0]);}RpcVoiceQueueReport[_0x580b('0x2e')](_0x2ff810[_0x41e4b0]);}};function extractCalleridNumber(_0x29582e){var _0x37d23f=_0x29582e[_0x580b('0x2f')](/<(.*?)>/);return _0x37d23f?_0x37d23f[0x1]:_0x29582e;}Report['prototype']['getAgentByInternal']=function(_0x2f69bc){for(var _0x2586d8=0x0;_0x2586d8','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','transfererlinkedid','attendedTransfer','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','findAgent','accountcode','name','isNil','find','agents','interface','length'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xc550,0x142));var _0x0c55=function(_0x1a8a79,_0x57182d){_0x1a8a79=_0x1a8a79-0x0;var _0x436f4c=_0xc550[_0x1a8a79];return _0x436f4c;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var config=require(_0x0c55('0x0'));var ami=require(_0x0c55('0x1'));var RpcVoiceAgentReport=require(_0x0c55('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x0c55('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0c55('0x4'));var RpcVoiceRecording=require(_0x0c55('0x5'));var RpcVoiceTransferReport=require(_0x0c55('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0c55('0x7'));var VoiceAgentReport=require(_0x0c55('0x8'));var VoiceDialReport=require(_0x0c55('0x9'));var UserReport=require(_0x0c55('0xa'));function Report(_0x44771e){this[_0x0c55('0xb')]=_0x44771e;this['agents']=_0x44771e['agents'];this[_0x0c55('0xc')]=_0x44771e[_0x0c55('0xc')];}Report[_0x0c55('0xd')][_0x0c55('0xe')]=function(_0x45dfe8){var _0x4f0f97=new VoiceQueueReport(this['realtime']);var _0x32893b=new VoiceAgentReport(this[_0x0c55('0xb')]);var _0x54577d=new VoiceDialReport(this['realtime']);var _0x3582b2=new VoiceCallReport(this[_0x0c55('0xb')]);var _0x16dba9=new UserReport(this['realtime']);if(config[_0x0c55('0xf')]&&config[_0x0c55('0xf')][_0x0c55('0x10')]){ami['on'](_0x0c55('0x11'),this[_0x0c55('0x12')][_0x0c55('0x13')](this));ami['on']('custom:voiceCallReport',this[_0x0c55('0x14')][_0x0c55('0x13')](this));ami['on'](_0x0c55('0x15'),this['voiceAgentReport'][_0x0c55('0x13')](this));ami['on'](_0x0c55('0x16'),this[_0x0c55('0x17')]['bind'](this));ami['on'](_0x0c55('0x18'),this['blindTransfer']['bind'](this));ami['on'](_0x0c55('0x19'),this['attendedTransfer'][_0x0c55('0x13')](this));}};Report[_0x0c55('0xd')][_0x0c55('0x1a')]=function(_0x5a5e6d){var _0x5a2791;_0x5a2791=_['find'](this['agents'],function(_0x3023e9){return _0x3023e9[_0x0c55('0x1b')]==_0x5a5e6d||_0x3023e9[_0x0c55('0x1c')]==_0x5a5e6d;});if(_[_0x0c55('0x1d')](_0x5a2791)){var _0x2c2d66=_[_0x0c55('0x1e')](this[_0x0c55('0xc')],function(_0x4c6aaa){return _0x4c6aaa[_0x0c55('0x1b')]==_0x5a5e6d||_0x4c6aaa[_0x0c55('0x1c')]==_0x5a5e6d;});if(_0x2c2d66){_0x5a2791=_[_0x0c55('0x1e')](this[_0x0c55('0x1f')],function(_0x20158d){return _0x20158d[_0x0c55('0x20')]==util['format']('SIP/%s',_0x2c2d66[_0x0c55('0x1c')]);});}}return _0x5a2791;};Report[_0x0c55('0xd')][_0x0c55('0x12')]=function(_0x425148){for(var _0x379328=0x0;_0x379328<_0x425148[_0x0c55('0x21')];_0x379328+=0x1){var _0x2685d0=this[_0x0c55('0x1a')](_0x425148[_0x379328][_0x0c55('0x22')]);if(_0x2685d0){_0x425148[_0x379328][_0x0c55('0x1b')]=_0x2685d0[_0x0c55('0x1b')];_0x425148[_0x379328][_0x0c55('0x23')]=!![];_0x425148[_0x379328][_0x0c55('0x24')]=_0x2685d0[_0x0c55('0x1c')];_0x425148[_0x379328][_0x0c55('0x20')]=_[_0x0c55('0x1d')](_0x2685d0[_0x0c55('0x20')])?util[_0x0c55('0x25')](_0x0c55('0x26'),_0x2685d0[_0x0c55('0x1c')]):_0x2685d0['interface'];if(_0x425148[_0x379328]['queuecallercomplete']){_0x425148[_0x379328][_0x0c55('0x27')]=moment()[_0x0c55('0x25')](_0x0c55('0x28'));}if(_0x425148[_0x379328][_0x0c55('0x29')]){_0x425148[_0x379328]['queuecallerexitAt']=moment()['format'](_0x0c55('0x28'));}RpcMemberReport['voiceQueueReport'](_0x425148[_0x379328]);}RpcVoiceQueueReport[_0x0c55('0x2a')](_0x425148[_0x379328]);}};function extractCalleridNumber(_0x3c7b74){var _0x7217f9=_0x3c7b74['match'](/<(.*?)>/);return _0x7217f9?_0x7217f9[0x1]:_0x3c7b74;}Report['prototype'][_0x0c55('0x2b')]=function(_0x14028e){for(var _0x42698c=0x0;_0x42698c0x0?!![]:![];if(!_0x8757d4){return this[_0x19ba('0x6d')](this[_0x19ba('0x13')][_0x19ba('0x6e')]);}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x19')]=function(_0x12d44c){var _0x4ea823=this[_0x19ba('0x13')]['id'];if(this['summary'][_0x19ba('0x61')][_0x4ea823]&&this[_0x19ba('0x13')][_0x19ba('0x61')][_0x4ea823][_0x12d44c[_0x19ba('0x5f')]]){this['summary'][_0x19ba('0x61')][_0x4ea823][_0x12d44c[_0x19ba('0x5f')]]['agents'][_0x19ba('0x6f')](_0x12d44c);}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x15')]=function(_0x39bff0){var _0x2159dd=this;try{if(this['isNotNull'](_0x39bff0)&&this[_0x19ba('0x70')](_0x39bff0[_0x19ba('0x4d')])){logger[_0x19ba('0x48')](_0x19ba('0x71'),util[_0x19ba('0x3f')](_0x39bff0,{'showHidden':![],'depth':null}));var _0x4a4dac=this[_0x19ba('0x11')][_0x39bff0[_0x19ba('0x4d')]];if(_0x4a4dac){logger['debug'](_0x19ba('0x72'),_0x4a4dac[_0x19ba('0x64')]);this['summary']['queues'][_0x4a4dac['name']]={'summaryEvent':_0x39bff0};this[_0x19ba('0x13')][_0x19ba('0x6c')]+=0x1;return ami[_0x19ba('0x5c')]({'action':_0x19ba('0x61'),'queue':_0x4a4dac['name']})[_0x19ba('0x73')](function(_0x40a244){if(!_0x2159dd['summary'][_0x19ba('0x61')][_0x39bff0[_0x19ba('0x5f')]]){_0x2159dd['summary']['queuestatus'][_0x39bff0['actionid']]={};}_0x2159dd['summary'][_0x19ba('0x61')][_0x39bff0[_0x19ba('0x5f')]][_0x40a244[_0x19ba('0x5f')]]={'queue':_0x4a4dac[_0x19ba('0x64')],'agents':[]};})[_0x19ba('0x3b')](function(_0x4618c4){throw _0x4618c4;});}}}catch(_0x127ce6){logger['error'](_0x19ba('0x62'),util[_0x19ba('0x3f')](_0x127ce6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x6d')]=function(_0x41a38c){if(this[_0x19ba('0x13')][_0x19ba('0x6c')]>0x0){this[_0x19ba('0x13')][_0x19ba('0x6e')]=_0x41a38c;return;}logger[_0x19ba('0x48')](_0x19ba('0x74'),util[_0x19ba('0x3f')](_0x41a38c,{'showHidden':![],'depth':null}));this[_0x19ba('0x13')]=initializeSummary();ami[_0x19ba('0x46')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x19ba('0x9')]['syncQueueCallerJoin']=function(_0xfbbfdf){try{if(this[_0x19ba('0x70')](_0xfbbfdf)){logger[_0x19ba('0x48')](_0x19ba('0x75'),_0xfbbfdf[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0xfbbfdf,{'showHidden':![],'depth':null}));if(_[_0x19ba('0x5a')](this[_0x19ba('0x40')][_0xfbbfdf[_0x19ba('0x4b')]])){this[_0x19ba('0x40')][_0xfbbfdf[_0x19ba('0x4b')]]=[];}if(_[_0x19ba('0x5a')](this[_0x19ba('0x10')][_0xfbbfdf[_0x19ba('0x4b')]])){this['channels'][_0xfbbfdf[_0x19ba('0x4b')]]={};}var _0x354e2e=new QueueReport();_0x354e2e[_0x19ba('0x4d')]=_0xfbbfdf[_0x19ba('0x4d')];_0x354e2e['type']=this[_0x19ba('0x11')][_0x354e2e['queue']]&&this['voiceQueues'][_0x354e2e[_0x19ba('0x4d')]][_0x19ba('0x69')]?this[_0x19ba('0x11')][_0x354e2e[_0x19ba('0x4d')]][_0x19ba('0x69')]||'inbound':'inbound';_0x354e2e[_0x19ba('0x76')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x354e2e['position']=_0xfbbfdf[_0x19ba('0x78')];_0x354e2e['count']=_0xfbbfdf[_0x19ba('0x79')];_0x354e2e[_0x19ba('0x4b')]=_0xfbbfdf[_0x19ba('0x4b')];_0x354e2e['routealias']=this[_0x19ba('0x10')][_0xfbbfdf['uniqueid']][_0x19ba('0x7a')];logger[_0x19ba('0x7b')](_0x19ba('0x7c'),_0x354e2e[_0x19ba('0x4d')],_0x354e2e[_0x19ba('0x69')]);Object[_0x19ba('0x68')](_0x354e2e,_[_0x19ba('0x7d')](_0xfbbfdf,_['keys'](_0x354e2e)));this[_0x19ba('0x40')][_0xfbbfdf[_0x19ba('0x4b')]]['push'](_0x354e2e);this[_0x19ba('0x10')][_0xfbbfdf['uniqueid']]=_0x354e2e;this['emitVoiceQueueChannelSave'](_0x354e2e,'queuecallerjoin');}}catch(_0x2c2c00){logger['error'](_0x19ba('0x75'),_0xfbbfdf[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x2c2c00,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')]['syncQueueCallerAbandon']=function(_0xfb9aed){try{if(this[_0x19ba('0x70')](_0xfb9aed)){logger[_0x19ba('0x48')](_0x19ba('0x7e'),_0xfb9aed[_0x19ba('0x4b')],util['inspect'](_0xfb9aed,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0xfb9aed[_0x19ba('0x4b')]]){var _0x4b4947=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0xfb9aed[_0x19ba('0x4b')]]);_0x4b4947[_0x19ba('0x36')]=![];_0x4b4947[_0x19ba('0x80')]=null;_0x4b4947['holdtime']=_0xfb9aed['holdtime'];_0x4b4947[_0x19ba('0x81')]=_0xfb9aed[_0x19ba('0x81')];_0x4b4947[_0x19ba('0x1e')]=!![];_0x4b4947[_0x19ba('0x82')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4b4947[_0x19ba('0x51')]=_0x19ba('0x83');_0x4b4947[_0x19ba('0x84')]=null;logger[_0x19ba('0x7b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4b4947[_0x19ba('0x4d')],_0x4b4947[_0x19ba('0x69')]);this[_0x19ba('0x10')][_0xfb9aed[_0x19ba('0x4b')]]=_0x4b4947;this['emitVoiceQueueChannelRemove'](_0x4b4947,_0x19ba('0x1e'));}}}catch(_0x503ad6){logger['error'](_0x19ba('0x7e'),_0xfb9aed['uniqueid'],util[_0x19ba('0x3f')](_0x503ad6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x85')]=function(_0x2e1834){try{if(this[_0x19ba('0x70')](_0x2e1834)){logger[_0x19ba('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x2e1834['uniqueid'],util[_0x19ba('0x3f')](_0x2e1834,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2e1834[_0x19ba('0x4b')]]){var _0x12a69b=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x2e1834['uniqueid']]);_0x12a69b[_0x19ba('0x86')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x12a69b[_0x19ba('0x87')]=_0x2e1834[_0x19ba('0x87')];_0x12a69b[_0x19ba('0x88')]=_0x2e1834[_0x19ba('0x88')];logger['info'](_0x19ba('0x89'),_0x12a69b[_0x19ba('0x4d')],_0x12a69b[_0x19ba('0x69')],_0x2e1834[_0x19ba('0x87')],_0x2e1834[_0x19ba('0x88')]);this[_0x19ba('0x10')][_0x2e1834[_0x19ba('0x4b')]]=_0x12a69b;this[_0x19ba('0x47')](_0x12a69b,_0x19ba('0x20'));}}}catch(_0x1863a5){logger[_0x19ba('0x3d')](_0x19ba('0x8a'),_0x2e1834['uniqueid'],util[_0x19ba('0x3f')](_0x1863a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')]['syncAgentConnect']=function(_0x5bb0f0){try{if(this[_0x19ba('0x70')](_0x5bb0f0)){logger['debug'](_0x19ba('0x8b'),_0x5bb0f0[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x5bb0f0,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0x5bb0f0[_0x19ba('0x4b')]]){var _0x576fb1=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x5bb0f0['uniqueid']]);_0x576fb1['queuecallercomplete']=!![];_0x576fb1['queuecallerexitreason']=_0x19ba('0x8c');logger['info'](_0x19ba('0x8d'),_0x576fb1['queue'],_0x576fb1[_0x19ba('0x69')]);}}}catch(_0x9d8746){logger[_0x19ba('0x3d')]('[%s][voiceQueueReport][agentconnect]',_0x5bb0f0[_0x19ba('0x4b')],util['inspect'](_0x9d8746,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x19ba('0x22')]=function(_0x2f7316){try{if(this[_0x19ba('0x70')](_0x2f7316)){logger[_0x19ba('0x48')](_0x19ba('0x8e'),_0x2f7316[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x2f7316,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2f7316[_0x19ba('0x4b')]]){var _0x58286b=_['last'](this[_0x19ba('0x40')][_0x2f7316['uniqueid']]);_0x58286b[_0x19ba('0x1e')]=![];_0x58286b[_0x19ba('0x82')]=null;_0x58286b['assigned']=!![];_0x58286b[_0x19ba('0x84')]=_0x2f7316[_0x19ba('0x8f')];_0x58286b['holdtime']=_0x2f7316[_0x19ba('0x90')];_0x58286b[_0x19ba('0x36')]=!![];_0x58286b[_0x19ba('0x35')]=![];_0x58286b[_0x19ba('0x91')]=null;if(!_0x58286b['transfer']){if(_0x2f7316[_0x19ba('0x92')]==_0x19ba('0x93')){_0x58286b[_0x19ba('0x51')]=_0x19ba('0x94');logger[_0x19ba('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x58286b[_0x19ba('0x4d')],_0x58286b[_0x19ba('0x69')]);}else{if(_[_0x19ba('0x95')](_0x2f7316['channel'][_0x19ba('0x96')](),_0x19ba('0x97'))){if(this[_0x19ba('0x40')][_0x2f7316[_0x19ba('0x98')]]){var _0x430759=_[_0x19ba('0x7f')](this['queueReports'][_0x2f7316[_0x19ba('0x98')]]);_0x430759[_0x19ba('0x36')]=![];_0x430759[_0x19ba('0x35')]=!![];_0x430759[_0x19ba('0x91')]=moment(_0x58286b['queuecallerjoinAt'])[_0x19ba('0x99')](_0x2f7316[_0x19ba('0x90')],_0x19ba('0x9a'))['format'](_0x19ba('0x77'));_0x430759[_0x19ba('0x51')]=_0x19ba('0x9b');_0x430759[_0x19ba('0x93')]=!![];_0x430759[_0x19ba('0x9c')]=_0x19ba('0x9d');_0x430759[_0x19ba('0x9e')]=_0x2f7316[_0x19ba('0x9f')];_0x430759[_0x19ba('0xa0')]=_0x2f7316[_0x19ba('0x4b')];logger[_0x19ba('0x7b')](_0x19ba('0xa1'),_0x430759[_0x19ba('0x4d')],_0x430759[_0x19ba('0x69')]);var _0x3a2a5a=this['queueReports'][_0x2f7316['linkedid']];this['queueReports'][_0x2f7316[_0x19ba('0x98')]]=this[_0x19ba('0x40')][_0x2f7316[_0x19ba('0x4b')]];this[_0x19ba('0x40')][_0x2f7316['uniqueid']]=_0x3a2a5a;}}else{_0x58286b[_0x19ba('0x51')]='COMPLETEDBY'+_0x2f7316[_0x19ba('0x92')]['toUpperCase']();logger[_0x19ba('0x7b')](_0x19ba('0xa2'),_0x58286b['queue'],_0x58286b[_0x19ba('0x69')],_0x58286b['queuecallerexitreason']);}}}this['channels'][_0x2f7316[_0x19ba('0x4b')]]=_0x58286b;}}}catch(_0x10dea5){logger[_0x19ba('0x3d')](_0x19ba('0x8e'),_0x2f7316[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x10dea5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x25')]=function(_0xfe7355){try{if(this['isNotNull'](_0xfe7355)){logger[_0x19ba('0x48')](_0x19ba('0xa3'),_0xfe7355[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0xfe7355,{'showHidden':![],'depth':null}));this[_0x19ba('0xa4')](_0xfe7355['uniqueid'],_['keys'](_0xfe7355[_0x19ba('0xa5')])[0x0],_0xfe7355[_0x19ba('0xa6')]);if(this['queueReports'][_0xfe7355[_0x19ba('0x4b')]]){var _0x5d01a4=_['last'](this['queueReports'][_0xfe7355[_0x19ba('0x4b')]]);if(_0x5d01a4){if(this[_0x19ba('0x70')](_0xfe7355['variable'])&&this['isNotNull'](_0xfe7355[_0x19ba('0xa5')][_0x19ba('0x61')])){switch(_0xfe7355[_0x19ba('0xa6')]){case _0x19ba('0xa7'):_0x5d01a4[_0x19ba('0x35')]=![];_0x5d01a4[_0x19ba('0x91')]=null;break;case _0x19ba('0xa8'):_0x5d01a4['lastevent']=_0x19ba('0xa9');_0x5d01a4[_0x19ba('0x35')]=!![];_0x5d01a4['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5d01a4[_0x19ba('0x86')]=moment()[_0x19ba('0x53')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x19ba('0xaa'),_0xfe7355['uniqueid'],util[_0x19ba('0x3f')](_0x5d01a4,{'showHidden':![],'depth':null}));ami['emit'](_0x19ba('0xab'),_0x5d01a4);break;default:_0x5d01a4[_0x19ba('0x35')]=!![];_0x5d01a4[_0x19ba('0x91')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x5d01a4['queuecallerleaveAt']=moment()[_0x19ba('0x53')](_0x19ba('0x77'));}_0x5d01a4['queuecallerabandon']=![];_0x5d01a4[_0x19ba('0x82')]=null;_0x5d01a4['queuecallerexitreason']=_0xfe7355[_0x19ba('0xa6')];this[_0x19ba('0x10')][_0xfe7355[_0x19ba('0x4b')]]=_0x5d01a4;this[_0x19ba('0x45')](_0x5d01a4,_0x19ba('0x24'));}else if(this[_0x19ba('0x70')](_0xfe7355[_0x19ba('0xa5')])&&this[_0x19ba('0x70')](_0xfe7355[_0x19ba('0xa5')][_0x19ba('0xac')])){if(!_0x5d01a4[_0x19ba('0x1e')]){_0x5d01a4[_0x19ba('0x35')]=!![];_0x5d01a4['queuecallerexitAt']=moment()[_0x19ba('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d01a4[_0x19ba('0x51')]=_0x19ba('0xad');_0x5d01a4[_0x19ba('0x86')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));this['channels'][_0xfe7355[_0x19ba('0x4b')]]=_0x5d01a4;}}logger['info'](_0x19ba('0xae'),_0xfe7355['uniqueid'],_0x5d01a4['queue'],_0x5d01a4['type'],_['keys'](_0xfe7355['variable'])[0x0],_0xfe7355['value']);_0x5d01a4['variables']=this[_0x19ba('0x42')][_0xfe7355[_0x19ba('0x4b')]];}}}}catch(_0x45497f){logger[_0x19ba('0x3d')](_0x19ba('0xa3'),_0xfe7355[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x45497f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0xa4')]=function(_0x17a045,_0x44a996,_0x2c985e){var _0x345939=[_0x19ba('0xaf'),_0x19ba('0xb0'),_0x19ba('0xb1'),_0x19ba('0xb2'),'rtpaudioqosloss',_0x19ba('0xb3'),_0x19ba('0xb4'),'rtpaudioqosrttbridged',_0x19ba('0xb5'),'sipuri',_0x19ba('0xb6'),_0x19ba('0xb7'),_0x19ba('0xb8'),_0x19ba('0xb9'),_0x19ba('0xba'),'memberlastcall',_0x19ba('0x8f'),'memberpenalty',_0x19ba('0xbb')];if(!_[_0x19ba('0x39')](_0x44a996)&&!_[_0x19ba('0xbc')](_0x345939,_0x44a996)){if(_[_0x19ba('0x5a')](this['variables'][_0x17a045])){this[_0x19ba('0x42')][_0x17a045]={};}this[_0x19ba('0x42')][_0x17a045][_0x44a996]=_0x2c985e;}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0xbd')]=function(_0x4dc3cf,_0x41150f,_0x2cab9a){try{var _0x1404c0={};if(this[_0x19ba('0x40')][_0x4dc3cf]){for(var _0xbb41cd=0x0;_0xbb41cd0x0?!![]:![];if(!_0x12b5cc){return this['syncQueueSummaryComplete'](this['summary']['completeEvent']);}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x16')]=function(_0x2f62a7){var _0x31529=this[_0xf6f7('0x5f')]['id'];if(this['summary'][_0xf6f7('0x63')][_0x31529]&&this['summary']['queuestatus'][_0x31529][_0x2f62a7[_0xf6f7('0x62')]]){this[_0xf6f7('0x5f')]['queuestatus'][_0x31529][_0x2f62a7['actionid']]['agents'][_0xf6f7('0x6e')](_0x2f62a7);}};VoiceQueueReport[_0xf6f7('0x38')]['syncQueueSummary']=function(_0x8727b7){var _0x11ab00=this;try{if(this[_0xf6f7('0x5a')](_0x8727b7)&&this['isNotNull'](_0x8727b7[_0xf6f7('0x4f')])){logger['debug'](_0xf6f7('0x6f'),util[_0xf6f7('0x40')](_0x8727b7,{'showHidden':![],'depth':null}));var _0x57a7ac=this['voiceQueues'][_0x8727b7[_0xf6f7('0x4f')]];if(_0x57a7ac){logger[_0xf6f7('0x49')](_0xf6f7('0x70'),_0x57a7ac['name']);this[_0xf6f7('0x5f')][_0xf6f7('0x5d')][_0x57a7ac[_0xf6f7('0x66')]]={'summaryEvent':_0x8727b7};this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]+=0x1;return ami['Action']({'action':_0xf6f7('0x63'),'queue':_0x57a7ac[_0xf6f7('0x66')]})[_0xf6f7('0x61')](function(_0x3a0ae1){if(!_0x11ab00['summary']['queuestatus'][_0x8727b7[_0xf6f7('0x62')]]){_0x11ab00['summary'][_0xf6f7('0x63')][_0x8727b7[_0xf6f7('0x62')]]={};}_0x11ab00[_0xf6f7('0x5f')][_0xf6f7('0x63')][_0x8727b7[_0xf6f7('0x62')]][_0x3a0ae1[_0xf6f7('0x62')]]={'queue':_0x57a7ac[_0xf6f7('0x66')],'agents':[]};})['catch'](function(_0x530012){throw _0x530012;});}}}catch(_0x53e6a5){logger[_0xf6f7('0x3e')](_0xf6f7('0x64'),util[_0xf6f7('0x40')](_0x53e6a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x14')]=function(_0x330358){if(this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]>0x0){this[_0xf6f7('0x5f')][_0xf6f7('0x71')]=_0x330358;return;}logger[_0xf6f7('0x49')](_0xf6f7('0x72'),util['inspect'](_0x330358,{'showHidden':![],'depth':null}));this[_0xf6f7('0x5f')]=initializeSummary();ami[_0xf6f7('0x47')](_0xf6f7('0x73'),{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x425d20){try{if(this['isNotNull'](_0x425d20)){logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][queuecallerjoin]',_0x425d20[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x425d20,{'showHidden':![],'depth':null}));if(_[_0xf6f7('0x5b')](this['queueReports'][_0x425d20[_0xf6f7('0x4c')]])){this[_0xf6f7('0xd')][_0x425d20[_0xf6f7('0x4c')]]=[];}if(_[_0xf6f7('0x5b')](this[_0xf6f7('0xf')][_0x425d20[_0xf6f7('0x4c')]])){this['channels'][_0x425d20[_0xf6f7('0x4c')]]={};}var _0x1f8c90=new QueueReport();_0x1f8c90[_0xf6f7('0x4f')]=_0x425d20[_0xf6f7('0x4f')];_0x1f8c90[_0xf6f7('0x56')]=this[_0xf6f7('0x10')][_0x1f8c90[_0xf6f7('0x4f')]]&&this['voiceQueues'][_0x1f8c90['queue']]['type']?this[_0xf6f7('0x10')][_0x1f8c90[_0xf6f7('0x4f')]][_0xf6f7('0x56')]||'inbound':_0xf6f7('0x57');_0x1f8c90['queuecallerjoinAt']=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x1f8c90[_0xf6f7('0x75')]=_0x425d20[_0xf6f7('0x75')];_0x1f8c90[_0xf6f7('0x76')]=_0x425d20[_0xf6f7('0x76')];_0x1f8c90[_0xf6f7('0x4c')]=_0x425d20['uniqueid'];_0x1f8c90[_0xf6f7('0x77')]=this[_0xf6f7('0xf')][_0x425d20['uniqueid']][_0xf6f7('0x77')];logger[_0xf6f7('0x78')](_0xf6f7('0x79'),_0x1f8c90[_0xf6f7('0x4f')],_0x1f8c90[_0xf6f7('0x56')]);Object[_0xf6f7('0x7a')](_0x1f8c90,_[_0xf6f7('0x7b')](_0x425d20,_[_0xf6f7('0x7c')](_0x1f8c90)));this[_0xf6f7('0xd')][_0x425d20[_0xf6f7('0x4c')]][_0xf6f7('0x6e')](_0x1f8c90);this[_0xf6f7('0xf')][_0x425d20[_0xf6f7('0x4c')]]=_0x1f8c90;this['emitVoiceQueueChannelSave'](_0x1f8c90,_0xf6f7('0x1a'));}}catch(_0x57ea7f){logger[_0xf6f7('0x3e')](_0xf6f7('0x7d'),_0x425d20[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x57ea7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x1c')]=function(_0x564c6a){try{if(this[_0xf6f7('0x5a')](_0x564c6a)){logger[_0xf6f7('0x49')](_0xf6f7('0x7e'),_0x564c6a[_0xf6f7('0x4c')],util['inspect'](_0x564c6a,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x564c6a[_0xf6f7('0x4c')]]){var _0x4de57e=_[_0xf6f7('0x7f')](this['queueReports'][_0x564c6a[_0xf6f7('0x4c')]]);_0x4de57e[_0xf6f7('0x37')]=![];_0x4de57e[_0xf6f7('0x80')]=null;_0x4de57e['holdtime']=_0x564c6a[_0xf6f7('0x81')];_0x4de57e[_0xf6f7('0x82')]=_0x564c6a['originalposition'];_0x4de57e[_0xf6f7('0x1b')]=!![];_0x4de57e[_0xf6f7('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4de57e['queuecallerexitreason']=_0xf6f7('0x84');_0x4de57e[_0xf6f7('0x85')]=null;logger[_0xf6f7('0x78')](_0xf6f7('0x86'),_0x4de57e[_0xf6f7('0x4f')],_0x4de57e['type']);this[_0xf6f7('0xf')][_0x564c6a[_0xf6f7('0x4c')]]=_0x4de57e;this[_0xf6f7('0x46')](_0x4de57e,'queuecallerabandon');}}}catch(_0x39205d){logger[_0xf6f7('0x3e')](_0xf6f7('0x7e'),_0x564c6a[_0xf6f7('0x4c')],util['inspect'](_0x39205d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x1e')]=function(_0x1be53d){try{if(this[_0xf6f7('0x5a')](_0x1be53d)){logger['debug'](_0xf6f7('0x87'),_0x1be53d[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x1be53d,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x1be53d['uniqueid']]){var _0xde7a6a=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x1be53d[_0xf6f7('0x4c')]]);_0xde7a6a[_0xf6f7('0x88')]=moment()['format'](_0xf6f7('0x74'));_0xde7a6a['connectedlinenum']=_0x1be53d['connectedlinenum'];_0xde7a6a['connectedlinename']=_0x1be53d[_0xf6f7('0x89')];logger[_0xf6f7('0x78')](_0xf6f7('0x8a'),_0xde7a6a[_0xf6f7('0x4f')],_0xde7a6a[_0xf6f7('0x56')],_0x1be53d[_0xf6f7('0x8b')],_0x1be53d[_0xf6f7('0x89')]);this[_0xf6f7('0xf')][_0x1be53d[_0xf6f7('0x4c')]]=_0xde7a6a;this[_0xf6f7('0x48')](_0xde7a6a,'queuecallerleave');}}}catch(_0x59e8a6){logger[_0xf6f7('0x3e')](_0xf6f7('0x87'),_0x1be53d[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x59e8a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x22')]=function(_0x2996ff){try{if(this[_0xf6f7('0x5a')](_0x2996ff)){logger[_0xf6f7('0x49')](_0xf6f7('0x8c'),_0x2996ff[_0xf6f7('0x4c')],util['inspect'](_0x2996ff,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2996ff['uniqueid']]){var _0x5bf8d5=_['last'](this[_0xf6f7('0xd')][_0x2996ff[_0xf6f7('0x4c')]]);_0x5bf8d5[_0xf6f7('0x37')]=!![];_0x5bf8d5[_0xf6f7('0x52')]=_0xf6f7('0x8d');logger[_0xf6f7('0x78')](_0xf6f7('0x8e'),_0x5bf8d5[_0xf6f7('0x4f')],_0x5bf8d5['type']);}}}catch(_0x273007){logger[_0xf6f7('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x2996ff[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x273007,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x20')]=function(_0x371565){try{if(this[_0xf6f7('0x5a')](_0x371565)){logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][agentcomplete]',_0x371565[_0xf6f7('0x4c')],util['inspect'](_0x371565,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]){var _0x5af29b=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]);_0x5af29b['queuecallerabandon']=![];_0x5af29b[_0xf6f7('0x83')]=null;_0x5af29b[_0xf6f7('0x8f')]=!![];_0x5af29b[_0xf6f7('0x85')]=_0x371565[_0xf6f7('0x90')];_0x5af29b[_0xf6f7('0x81')]=_0x371565[_0xf6f7('0x81')];_0x5af29b[_0xf6f7('0x37')]=!![];_0x5af29b[_0xf6f7('0x36')]=![];_0x5af29b[_0xf6f7('0x91')]=null;if(!_0x5af29b['transfer']){if(_0x371565['reason']==_0xf6f7('0x92')){_0x5af29b[_0xf6f7('0x52')]=_0xf6f7('0x93');logger[_0xf6f7('0x78')](_0xf6f7('0x94'),_0x5af29b[_0xf6f7('0x4f')],_0x5af29b[_0xf6f7('0x56')]);}else{if(_['startsWith'](_0x371565[_0xf6f7('0x3c')]['toLowerCase'](),_0xf6f7('0x95'))){if(this[_0xf6f7('0xd')][_0x371565['linkedid']]){var _0x25dfff=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x371565['linkedid']]);_0x25dfff[_0xf6f7('0x37')]=![];_0x25dfff['queuecallerexit']=!![];_0x25dfff[_0xf6f7('0x91')]=moment(_0x5af29b['queuecallerjoinAt'])['add'](_0x371565[_0xf6f7('0x81')],_0xf6f7('0x96'))[_0xf6f7('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x25dfff[_0xf6f7('0x52')]=_0xf6f7('0x97');_0x25dfff[_0xf6f7('0x92')]=!![];_0x25dfff[_0xf6f7('0x98')]=_0xf6f7('0x99');_0x25dfff['transferexten']=_0x371565[_0xf6f7('0x9a')];_0x25dfff[_0xf6f7('0x9b')]=_0x371565[_0xf6f7('0x4c')];logger[_0xf6f7('0x78')](_0xf6f7('0x9c'),_0x25dfff[_0xf6f7('0x4f')],_0x25dfff[_0xf6f7('0x56')]);var _0x1b2776=this[_0xf6f7('0xd')][_0x371565['linkedid']];this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x9d')]]=this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]];this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]=_0x1b2776;}}else{_0x5af29b[_0xf6f7('0x52')]=_0xf6f7('0x9e')+_0x371565[_0xf6f7('0x9f')]['toUpperCase']();logger[_0xf6f7('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5af29b[_0xf6f7('0x4f')],_0x5af29b[_0xf6f7('0x56')],_0x5af29b['queuecallerexitreason']);}}}this[_0xf6f7('0xf')][_0x371565['uniqueid']]=_0x5af29b;}}}catch(_0x8ed821){logger['error'](_0xf6f7('0xa0'),_0x371565[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x8ed821,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x23')]=function(_0x4aad8b){try{if(this[_0xf6f7('0x5a')](_0x4aad8b)){logger['debug'](_0xf6f7('0xa1'),_0x4aad8b[_0xf6f7('0x4c')],util['inspect'](_0x4aad8b,{'showHidden':![],'depth':null}));this[_0xf6f7('0xa2')](_0x4aad8b[_0xf6f7('0x4c')],_['keys'](_0x4aad8b[_0xf6f7('0xa3')])[0x0],_0x4aad8b[_0xf6f7('0xa4')]);if(this[_0xf6f7('0xd')][_0x4aad8b[_0xf6f7('0x4c')]]){var _0x13fd86=_['last'](this[_0xf6f7('0xd')][_0x4aad8b[_0xf6f7('0x4c')]]);if(_0x13fd86){if(this[_0xf6f7('0x5a')](_0x4aad8b[_0xf6f7('0xa3')])&&this[_0xf6f7('0x5a')](_0x4aad8b['variable'][_0xf6f7('0x63')])){switch(_0x4aad8b[_0xf6f7('0xa4')]){case'CONTINUE':_0x13fd86['queuecallerexit']=![];_0x13fd86[_0xf6f7('0x91')]=null;break;case _0xf6f7('0xa5'):_0x13fd86[_0xf6f7('0xa6')]=_0xf6f7('0xa7');_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x13fd86['queuecallerleaveAt']=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));logger[_0xf6f7('0x49')](_0xf6f7('0xa8'),_0x4aad8b[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x13fd86,{'showHidden':![],'depth':null}));ami[_0xf6f7('0x47')](_0xf6f7('0xa9'),_0x13fd86);break;default:_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x13fd86[_0xf6f7('0x88')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));}_0x13fd86['queuecallerabandon']=![];_0x13fd86['queuecallerabandonAt']=null;_0x13fd86['queuecallerexitreason']=_0x4aad8b[_0xf6f7('0xa4')];this[_0xf6f7('0xf')][_0x4aad8b[_0xf6f7('0x4c')]]=_0x13fd86;this[_0xf6f7('0x46')](_0x13fd86,_0xf6f7('0xaa'));}else if(this[_0xf6f7('0x5a')](_0x4aad8b[_0xf6f7('0xa3')])&&this['isNotNull'](_0x4aad8b[_0xf6f7('0xa3')][_0xf6f7('0xab')])){if(!_0x13fd86[_0xf6f7('0x1b')]){_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()['format'](_0xf6f7('0x74'));_0x13fd86[_0xf6f7('0x52')]=_0xf6f7('0xac');_0x13fd86['queuecallerleaveAt']=moment()['format'](_0xf6f7('0x74'));this['channels'][_0x4aad8b[_0xf6f7('0x4c')]]=_0x13fd86;}}logger[_0xf6f7('0x78')](_0xf6f7('0xad'),_0x4aad8b[_0xf6f7('0x4c')],_0x13fd86[_0xf6f7('0x4f')],_0x13fd86[_0xf6f7('0x56')],_[_0xf6f7('0x7c')](_0x4aad8b['variable'])[0x0],_0x4aad8b['value']);_0x13fd86[_0xf6f7('0x42')]=this[_0xf6f7('0x42')][_0x4aad8b['uniqueid']];}}}}catch(_0x44ffef){logger[_0xf6f7('0x3e')](_0xf6f7('0xa1'),_0x4aad8b[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x44ffef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')]['addVariable']=function(_0x3dbe71,_0x14463a,_0x1d4ddb){var _0x51072f=[_0xf6f7('0xae'),_0xf6f7('0xaf'),_0xf6f7('0xb0'),_0xf6f7('0xb1'),_0xf6f7('0xb2'),_0xf6f7('0xb3'),_0xf6f7('0xb4'),_0xf6f7('0xb5'),'sipcallid',_0xf6f7('0xb6'),'bridgepeer',_0xf6f7('0xb7'),_0xf6f7('0xb8'),_0xf6f7('0xb9'),_0xf6f7('0xba'),_0xf6f7('0xbb'),_0xf6f7('0x90'),_0xf6f7('0xbc'),_0xf6f7('0xbd')];if(!_[_0xf6f7('0xbe')](_0x14463a)&&!_[_0xf6f7('0xbf')](_0x51072f,_0x14463a)){if(_[_0xf6f7('0x5b')](this[_0xf6f7('0x42')][_0x3dbe71])){this[_0xf6f7('0x42')][_0x3dbe71]={};}this[_0xf6f7('0x42')][_0x3dbe71][_0x14463a]=_0x1d4ddb;}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0xc0')]=function(_0x1b0839,_0x2ec4df,_0x51001e){try{var _0x4b8fcd={};if(this['queueReports'][_0x1b0839]){for(var _0xb2616=0x0;_0xb2616=0x0?moment(_0x3d2404[_0x722c('0x14')])[_0x722c('0x15')](_0x3d2404[_0x722c('0x13')],_0x722c('0xd')):null,'data1':'outbound','data2':_0x3d2404[_0x722c('0x11')],'data3':_0x3d2404[_0x722c('0x16')],'data4':_0x3d2404[_0x722c('0x17')]||null,'role':_0x722c('0xf'),'internal':_0x3d2404['accountcode']?_[_0x722c('0x10')](_0x3d2404[_0x722c('0x11')]):undefined,'uniqueid':_0x3d2404[_0x722c('0x18')]},'log':_0x722c('0x6')});}; \ No newline at end of file +var _0xa938=['toNumber','CreateMemberReport','voice','membername','TALKING','starttime','endtime','diff','exten','dialstring','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','lastAssignedTo','isNil','interface','format','SIP/%s','seconds','inbound','calleridnum','queue','agent','accountcode'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xa938,0xce));var _0x8a93=function(_0xa3ec1,_0x3a3b34){_0xa3ec1=_0xa3ec1-0x0;var _0x1dc7a8=_0xa938[_0xa3ec1];return _0x1dc7a8;};'use strict';var moment=require('moment');var _=require(_0x8a93('0x0'));var util=require(_0x8a93('0x1'));var client=require(_0x8a93('0x2'));exports[_0x8a93('0x3')]=function(_0x4a219c){var _0x7bb93=_0x4a219c[_0x8a93('0x4')]||_0x4a219c[_0x8a93('0x5')];return client[_0x8a93('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x4a219c[_0x8a93('0x7')],'interface':_[_0x8a93('0x8')](_0x4a219c[_0x8a93('0x9')])?util[_0x8a93('0xa')](_0x8a93('0xb'),_0x4a219c[_0x8a93('0x7')]):_0x4a219c[_0x8a93('0x9')],'type':'TALKING','enterAt':_0x4a219c['queuecallerleaveAt'],'exitAt':_0x7bb93,'duration':moment(_0x7bb93)['diff'](_0x4a219c['queuecallerleaveAt'],_0x8a93('0xc')),'data1':_0x8a93('0xd'),'data2':_0x4a219c[_0x8a93('0xe')],'data3':_0x4a219c['exten'],'data4':null,'data5':_0x4a219c[_0x8a93('0xf')],'role':_0x8a93('0x10'),'internal':_0x4a219c[_0x8a93('0x11')]?_[_0x8a93('0x12')](_0x4a219c['accountcode']):undefined,'uniqueid':_0x4a219c['uniqueid']},'log':_0x8a93('0x13')});};exports['voiceDialReport']=function(_0x39f54b){return client[_0x8a93('0x6')](_0x8a93('0x13'),{'body':{'channel':_0x8a93('0x14'),'membername':_0x39f54b[_0x8a93('0x15')],'interface':_0x39f54b['interface'],'type':_0x8a93('0x16'),'enterAt':_0x39f54b[_0x8a93('0x17')],'exitAt':_0x39f54b[_0x8a93('0x18')],'duration':moment(_0x39f54b[_0x8a93('0x18')])[_0x8a93('0x19')](_0x39f54b[_0x8a93('0x17')],_0x8a93('0xc'))>=0x0?moment(_0x39f54b['endtime'])[_0x8a93('0x19')](_0x39f54b[_0x8a93('0x17')],'seconds'):null,'data1':'outbound','data2':_0x39f54b[_0x8a93('0x11')],'data3':_0x39f54b[_0x8a93('0x1a')],'data4':_0x39f54b[_0x8a93('0x1b')]||null,'role':'agent','internal':_0x39f54b[_0x8a93('0x11')]?_[_0x8a93('0x12')](_0x39f54b[_0x8a93('0x11')]):undefined,'uniqueid':_0x39f54b['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 48b72de..e334629 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 _0x56dc=['GetSettings','../client','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x21eef2,_0x1480ea){var _0x32f106=function(_0x409e7e){while(--_0x409e7e){_0x21eef2['push'](_0x21eef2['shift']());}};_0x32f106(++_0x1480ea);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc56d('0x0'));exports['getSettings']=function(){return client[_0xc56d('0x1')](_0xc56d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc56d('0x3'),_0xc56d('0x4')]},'log':_0xc56d('0x5')});}; \ No newline at end of file +var _0xe126=['GetSettings','../client','getSettings','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x2fc81f,_0x2d689d){var _0x29b312=function(_0x1a88f9){while(--_0x1a88f9){_0x2fc81f['push'](_0x2fc81f['shift']());}};_0x29b312(++_0x2d689d);}(_0xe126,0xeb));var _0x6e12=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xe126[_0x87b0ff];return _0x3bc0b2;};'use strict';var client=require(_0x6e12('0x0'));exports[_0x6e12('0x1')]=function(){return client['Request'](_0x6e12('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6e12('0x3'),_0x6e12('0x4')]},'log':_0x6e12('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 2f110a9..e691f63 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 _0x8822=['name','../client','Request','GetTemplate'];(function(_0x2b3410,_0x7ae999){var _0x3d0683=function(_0x206710){while(--_0x206710){_0x2b3410['push'](_0x2b3410['shift']());}};_0x3d0683(++_0x7ae999);}(_0x8822,0x131));var _0x2882=function(_0xf0c519,_0x27c632){_0xf0c519=_0xf0c519-0x0;var _0x2509e8=_0x8822[_0xf0c519];return _0x2509e8;};'use strict';var client=require(_0x2882('0x0'));exports['getTemplates']=function(_0x3ede27){return function(_0x3c2ec0){return client[_0x2882('0x1')](_0x2882('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2882('0x3'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x5a28=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x3986fc,_0x41fd49){var _0x514bd1=function(_0x4f038f){while(--_0x4f038f){_0x3986fc['push'](_0x3986fc['shift']());}};_0x514bd1(++_0x41fd49);}(_0x5a28,0x1c7));var _0x85a2=function(_0x1f504c,_0x319b4f){_0x1f504c=_0x1f504c-0x0;var _0x50d2e6=_0x5a28[_0x1f504c];return _0x50d2e6;};'use strict';var client=require(_0x85a2('0x0'));exports[_0x85a2('0x1')]=function(_0x1d99cf){return function(_0x779af9){return client[_0x85a2('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x85a2('0x3'),_0x85a2('0x4')]},'log':_0x85a2('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index d949b1e..c9eed71 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 _0x0464=['data2','data4','data5','data7','GetTrigger','../client','getTriggers','name','channel','status','Condition','AllConditions','field','AnyConditions','Action','Actions','action','data1'];(function(_0x185e5c,_0x4bd125){var _0x1651ee=function(_0x26a42a){while(--_0x26a42a){_0x185e5c['push'](_0x185e5c['shift']());}};_0x1651ee(++_0x4bd125);}(_0x0464,0x16d));var _0x4046=function(_0x1709e0,_0x525027){_0x1709e0=_0x1709e0-0x0;var _0x5f27e3=_0x0464[_0x1709e0];return _0x5f27e3;};'use strict';var client=require(_0x4046('0x0'));exports[_0x4046('0x1')]=function(_0x33e956){return function(_0x486ad9){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x4046('0x2'),_0x4046('0x3'),_0x4046('0x4')],'include':[{'model':_0x4046('0x5'),'as':_0x4046('0x6'),'attributes':['id',_0x4046('0x7'),'operator','value']},{'model':_0x4046('0x5'),'as':_0x4046('0x8'),'attributes':['id','field','operator','value']},{'model':_0x4046('0x9'),'as':_0x4046('0xa'),'attributes':['id',_0x4046('0xb'),_0x4046('0xc'),_0x4046('0xd'),'data3',_0x4046('0xe'),_0x4046('0xf'),'data6',_0x4046('0x10')]}]},'log':_0x4046('0x11')});};}; \ No newline at end of file +var _0xdc1b=['Condition','AllConditions','operator','value','AnyConditions','Action','Actions','action','data1','data2','data4','data5','data6','data7','../client','Request','GetTrigger','name','channel','status'];(function(_0x123935,_0x1670ba){var _0x1a8ebf=function(_0xa6933e){while(--_0xa6933e){_0x123935['push'](_0x123935['shift']());}};_0x1a8ebf(++_0x1670ba);}(_0xdc1b,0x9a));var _0xbdc1=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0xdc1b[_0x474d97];return _0x1edf25;};'use strict';var client=require(_0xbdc1('0x0'));exports['getTriggers']=function(_0x1709bf){return function(_0x55a4e9){return client[_0xbdc1('0x1')](_0xbdc1('0x2'),{'options':{'raw':![],'attributes':['id',_0xbdc1('0x3'),_0xbdc1('0x4'),_0xbdc1('0x5')],'include':[{'model':_0xbdc1('0x6'),'as':_0xbdc1('0x7'),'attributes':['id','field',_0xbdc1('0x8'),_0xbdc1('0x9')]},{'model':_0xbdc1('0x6'),'as':_0xbdc1('0xa'),'attributes':['id','field',_0xbdc1('0x8'),'value']},{'model':_0xbdc1('0xb'),'as':_0xbdc1('0xc'),'attributes':['id',_0xbdc1('0xd'),_0xbdc1('0xe'),_0xbdc1('0xf'),'data3',_0xbdc1('0x10'),_0xbdc1('0x11'),_0xbdc1('0x12'),_0xbdc1('0x13')]}]},'log':_0xbdc1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7ebafb4..7ebe2e7 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 _0x53d5=['Request','GetTrunk','name','defaultuser','../client','getTrunks'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x53d5,0x1cc));var _0x553d=function(_0xb2eb8,_0xeebbdf){_0xb2eb8=_0xb2eb8-0x0;var _0xd94a48=_0x53d5[_0xb2eb8];return _0xd94a48;};'use strict';var client=require(_0x553d('0x0'));exports[_0x553d('0x1')]=function(_0x217b81){return function(_0x619750){return client[_0x553d('0x2')](_0x553d('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x553d('0x4'),'registry',_0x553d('0x5')]},'log':_0x553d('0x3')});};}; \ No newline at end of file +var _0xdf67=['name','registry','defaultuser','../client','getTrunks','GetTrunk'];(function(_0x13e418,_0x167abb){var _0x1f31d8=function(_0x1b84e1){while(--_0x1b84e1){_0x13e418['push'](_0x13e418['shift']());}};_0x1f31d8(++_0x167abb);}(_0xdf67,0x117));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7df6('0x0'));exports[_0x7df6('0x1')]=function(_0x815a7e){return function(_0x84acd7){return client['Request'](_0x7df6('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7df6('0x3'),_0x7df6('0x4'),_0x7df6('0x5')]},'log':_0x7df6('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index e7ccff9..7d7fcbb 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(_0xf4a980,_0x38f8dd){var _0x9eaab3=function(_0x558abb){while(--_0x558abb){_0xf4a980['push'](_0xf4a980['shift']());}};_0x9eaab3(++_0x38f8dd);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x83c1dc,_0x16b447){var _0x358ff0=function(_0x506373){while(--_0x506373){_0x83c1dc['push'](_0x83c1dc['shift']());}};_0x358ff0(++_0x16b447);}(_0xedd9,0xfc));var _0x9edd=function(_0x451429,_0x5540dc){_0x451429=_0x451429-0x0;var _0x688119=_0xedd9[_0x451429];return _0x688119;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index e5f6845..b6bd9f4 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 _0xfac9=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0xfac9,0x1d2));var _0x9fac=function(_0x523f2a,_0x571003){_0x523f2a=_0x523f2a-0x0;var _0x3ff596=_0xfac9[_0x523f2a];return _0x3ff596;};'use strict';var client=require(_0x9fac('0x0'));exports[_0x9fac('0x1')]=function(_0x262784){return client[_0x9fac('0x2')](_0x9fac('0x3'),{'body':_0x262784,'log':_0x9fac('0x3')});};exports['update']=function(_0x66d1a9,_0x1290d6,_0x2dd84d){return client[_0x9fac('0x2')]('UpdateVoiceAgentReport',{'body':_0x66d1a9,'options':{'where':{'uniqueid':_0x1290d6,'interface':_0x2dd84d,'agentcomplete':!![]}},'log':_0x9fac('0x4')});}; \ No newline at end of file +var _0xa3ac=['UpdateVoiceAgentReport','../client','create','Request'];(function(_0x7f5e4,_0x21af1b){var _0x5f1035=function(_0x325cad){while(--_0x325cad){_0x7f5e4['push'](_0x7f5e4['shift']());}};_0x5f1035(++_0x21af1b);}(_0xa3ac,0xd1));var _0xca3a=function(_0x2be7d0,_0x3ed00b){_0x2be7d0=_0x2be7d0-0x0;var _0x717c96=_0xa3ac[_0x2be7d0];return _0x717c96;};'use strict';var client=require(_0xca3a('0x0'));exports[_0xca3a('0x1')]=function(_0x30a447){return client['Request']('CreateVoiceAgentReport',{'body':_0x30a447,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x5326ce,_0xc993ff,_0x95c77){return client[_0xca3a('0x2')](_0xca3a('0x3'),{'body':_0x5326ce,'options':{'where':{'uniqueid':_0xc993ff,'interface':_0x95c77,'agentcomplete':!![]}},'log':_0xca3a('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 302ccd9..6885627 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 _0xb463=['create','Request','CreateVoiceCallReport','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash'];(function(_0x1bec0f,_0x5dd7ba){var _0x7e6b5b=function(_0x262c5b){while(--_0x262c5b){_0x1bec0f['push'](_0x1bec0f['shift']());}};_0x7e6b5b(++_0x5dd7ba);}(_0xb463,0x1dd));var _0x3b46=function(_0x32ab67,_0x9da743){_0x32ab67=_0x32ab67-0x0;var _0x5cb1fa=_0xb463[_0x32ab67];return _0x5cb1fa;};'use strict';var moment=require(_0x3b46('0x0'));var util=require(_0x3b46('0x1'));var _=require(_0x3b46('0x2'));var client=require('../client');exports[_0x3b46('0x3')]=function(_0x1b0c42){return client[_0x3b46('0x4')](_0x3b46('0x5'),{'body':_['merge'](_0x1b0c42,{'source':_0x1b0c42[_0x3b46('0x6')],'destinationcontext':_0x1b0c42[_0x3b46('0x7')],'callerid':_0x1b0c42[_0x3b46('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x3b46('0x5')});};exports[_0x3b46('0x9')]=function(){return function(){return client[_0x3b46('0x4')](_0x3b46('0xa'),{'options':{'where':{'type':[_0x3b46('0xb')],'createdAt':{'$between':[moment()[_0x3b46('0xc')]('day')[_0x3b46('0xd')](_0x3b46('0xe')),moment()['endOf'](_0x3b46('0xf'))[_0x3b46('0xd')](_0x3b46('0xe'))]}},'attributes':['type',_0x3b46('0x10'),_0x3b46('0x11'),_0x3b46('0x12')]},'log':_0x3b46('0x13')});};}; \ No newline at end of file +var _0x2ad2=['endOf','day','type','disposition','duration','billableseconds','moment','util','../client','create','Request','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x712d97,_0x53bb9b){var _0x2025e6=function(_0x2b45e3){while(--_0x2b45e3){_0x712d97['push'](_0x712d97['shift']());}};_0x2025e6(++_0x53bb9b);}(_0x2ad2,0x1bb));var _0x22ad=function(_0x45b100,_0x29a4b1){_0x45b100=_0x45b100-0x0;var _0x1b41f8=_0x2ad2[_0x45b100];return _0x1b41f8;};'use strict';var moment=require(_0x22ad('0x0'));var util=require(_0x22ad('0x1'));var _=require('lodash');var client=require(_0x22ad('0x2'));exports[_0x22ad('0x3')]=function(_0x5852aa){return client[_0x22ad('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x5852aa,{'source':_0x5852aa['calleridnum'],'destinationcontext':_0x5852aa['context'],'callerid':_0x5852aa[_0x22ad('0x5')],'amaflags':_0x22ad('0x6')}),'log':_0x22ad('0x7')});};exports[_0x22ad('0x8')]=function(){return function(){return client['Request'](_0x22ad('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x22ad('0xa')]('day')[_0x22ad('0xb')](_0x22ad('0xc')),moment()[_0x22ad('0xd')](_0x22ad('0xe'))['format'](_0x22ad('0xc'))]}},'attributes':[_0x22ad('0xf'),_0x22ad('0x10'),_0x22ad('0x11'),_0x22ad('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7aed733..aaaef4c 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 _0xca73=['CreateVoiceDialReport','../client','create','Request'];(function(_0x3d564e,_0x2744e2){var _0x52e232=function(_0x1ab85f){while(--_0x1ab85f){_0x3d564e['push'](_0x3d564e['shift']());}};_0x52e232(++_0x2744e2);}(_0xca73,0x171));var _0x3ca7=function(_0x13915f,_0x3d90c6){_0x13915f=_0x13915f-0x0;var _0x373181=_0xca73[_0x13915f];return _0x373181;};'use strict';var client=require(_0x3ca7('0x0'));exports[_0x3ca7('0x1')]=function(_0x326fe7){return client[_0x3ca7('0x2')](_0x3ca7('0x3'),{'body':_0x326fe7,'log':_0x3ca7('0x3')});}; \ No newline at end of file +var _0x148d=['create','Request','CreateVoiceDialReport'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x148d,0x1d4));var _0xd148=function(_0x153a0c,_0x1c7404){_0x153a0c=_0x153a0c-0x0;var _0x37cd06=_0x148d[_0x153a0c];return _0x37cd06;};'use strict';var client=require('../client');exports[_0xd148('0x0')]=function(_0xb8230){return client[_0xd148('0x1')](_0xd148('0x2'),{'body':_0xb8230,'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 4788d86..9e0f312 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 _0x74f0=['getVoiceExtensions','exten','recordingFormat'];(function(_0x54213f,_0x5ecc06){var _0x55691b=function(_0x351d77){while(--_0x351d77){_0x54213f['push'](_0x54213f['shift']());}};_0x55691b(++_0x5ecc06);}(_0x74f0,0xf3));var _0x074f=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x74f0[_0x540dcb];return _0x49353c;};'use strict';var client=require('../client');exports[_0x074f('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x074f('0x1'),_0x074f('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x074f('0x0')});};}; \ No newline at end of file +var _0x6075=['GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x6075,0x142));var _0x5607=function(_0xb8aff7,_0x2dcc58){_0xb8aff7=_0xb8aff7-0x0;var _0x427f35=_0x6075[_0xb8aff7];return _0x427f35;};'use strict';var client=require(_0x5607('0x0'));exports[_0x5607('0x1')]=function(){return function(){return client['Request'](_0x5607('0x2'),{'options':{'raw':!![],'attributes':['id',_0x5607('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 13849c4..a0865b2 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 _0xf063=['dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','Pause','mandatoryDispositionPause','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x5b3948,_0x4eb1d3){var _0x3b4c96=function(_0x189d06){while(--_0x189d06){_0x5b3948['push'](_0x5b3948['shift']());}};_0x3b4c96(++_0x4eb1d3);}(_0xf063,0x87));var _0x3f06=function(_0x560201,_0x5c6669){_0x560201=_0x560201-0x0;var _0x5ee7ed=_0xf063[_0x560201];return _0x5ee7ed;};'use strict';var client=require('../client');exports[_0x3f06('0x0')]=function(){return function(){return client[_0x3f06('0x1')](_0x3f06('0x2'),{'options':{'raw':![],'attributes':['id',_0x3f06('0x3'),_0x3f06('0x4'),_0x3f06('0x5'),'autopause',_0x3f06('0x6'),_0x3f06('0x7'),_0x3f06('0x8'),_0x3f06('0x9'),_0x3f06('0xa'),_0x3f06('0xb'),_0x3f06('0xc'),_0x3f06('0xd'),_0x3f06('0xe'),'dialPredictiveInterval',_0x3f06('0xf'),_0x3f06('0x10'),'dialOriginateTimeout',_0x3f06('0x11'),'dialQueueTimeout',_0x3f06('0x12'),_0x3f06('0x13'),_0x3f06('0x14'),_0x3f06('0x15'),_0x3f06('0x16'),_0x3f06('0x17'),_0x3f06('0x18'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0x3f06('0x19'),_0x3f06('0x1a'),'dialAMDActive',_0x3f06('0x1b'),_0x3f06('0x1c'),_0x3f06('0x1d'),'dialAMDTotalAnalysisTime',_0x3f06('0x1e'),_0x3f06('0x1f'),_0x3f06('0x20'),_0x3f06('0x21'),_0x3f06('0x22'),_0x3f06('0x23'),'dialRecallMeTimeout',_0x3f06('0x24'),_0x3f06('0x25'),_0x3f06('0x26'),_0x3f06('0x27'),'dialQueueProject2',_0x3f06('0x6'),'strategy',_0x3f06('0x28'),_0x3f06('0x29'),_0x3f06('0x2a'),'dialNoSuchNumberRetryFrequency',_0x3f06('0x2b'),_0x3f06('0x2c'),'dialAbandonedMaxRetry',_0x3f06('0x2d'),_0x3f06('0x2e'),_0x3f06('0x2f'),'dialAgentRejectMaxRetry',_0x3f06('0x30'),_0x3f06('0x31'),_0x3f06('0x32'),_0x3f06('0x33'),_0x3f06('0x34'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x3f06('0x35'),'attributes':['id',_0x3f06('0x3'),_0x3f06('0x36'),'active']},{'model':_0x3f06('0x37'),'as':_0x3f06('0x38'),'attributes':['id','name']},{'model':_0x3f06('0x35'),'as':'TrunkBackup','attributes':['id','name',_0x3f06('0x36'),_0x3f06('0x39')]},{'model':_0x3f06('0x3a'),'as':_0x3f06('0x3a'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x3f06('0x3b'),'attributes':['id','name',_0x3f06('0x3c')]}]}]},'log':_0x3f06('0x0')});};}; \ No newline at end of file +var _0xe2ea=['dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','Pause','mandatoryDispositionPause','TrunkBackup','callerid','active','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','acwTimeout','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient'];(function(_0xc4b350,_0x244825){var _0x2e91b6=function(_0x5f46a1){while(--_0x5f46a1){_0xc4b350['push'](_0xc4b350['shift']());}};_0x2e91b6(++_0x244825);}(_0xe2ea,0x101));var _0xae2e=function(_0x28cac0,_0x3cd28b){_0x28cac0=_0x28cac0-0x0;var _0x2badcd=_0xe2ea[_0x28cac0];return _0x2badcd;};'use strict';var client=require('../client');exports[_0xae2e('0x0')]=function(){return function(){return client['Request'](_0xae2e('0x1'),{'options':{'raw':![],'attributes':['id','name','acw',_0xae2e('0x2'),'autopause',_0xae2e('0x3'),_0xae2e('0x4'),_0xae2e('0x5'),'dialMethod',_0xae2e('0x6'),_0xae2e('0x7'),_0xae2e('0x8'),_0xae2e('0x9'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xae2e('0xa'),'dialOriginateCallerIdNumber',_0xae2e('0xb'),_0xae2e('0xc'),_0xae2e('0xd'),'dialQueueProject','dialCongestionMaxRetry',_0xae2e('0xe'),_0xae2e('0xf'),_0xae2e('0x10'),_0xae2e('0x11'),_0xae2e('0x12'),'dialGlobalMaxRetry',_0xae2e('0x13'),_0xae2e('0x14'),_0xae2e('0x15'),_0xae2e('0x16'),'dialAMDActive',_0xae2e('0x17'),_0xae2e('0x18'),'dialAMDAfterGreetingSilence',_0xae2e('0x19'),'dialAMDMinWordLength',_0xae2e('0x1a'),_0xae2e('0x1b'),'dialAMDSilenceThreshold',_0xae2e('0x1c'),_0xae2e('0x1d'),_0xae2e('0x1e'),_0xae2e('0x1f'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xae2e('0x20'),_0xae2e('0x21'),_0xae2e('0x3'),_0xae2e('0x22'),_0xae2e('0x23'),_0xae2e('0x24'),_0xae2e('0x25'),_0xae2e('0x26'),_0xae2e('0x27'),'dialDropRetryFrequency',_0xae2e('0x28'),_0xae2e('0x29'),_0xae2e('0x2a'),'dialMachineRetryFrequency',_0xae2e('0x2b'),'dialAgentRejectRetryFrequency',_0xae2e('0x2c'),'dialPredictiveIntervalMaxThreshold',_0xae2e('0x2d'),_0xae2e('0x2e'),_0xae2e('0x2f')],'include':[{'model':_0xae2e('0x30'),'as':_0xae2e('0x30'),'attributes':['id',_0xae2e('0x31'),'callerid','active']},{'model':_0xae2e('0x32'),'as':_0xae2e('0x33'),'attributes':['id',_0xae2e('0x31')]},{'model':'Trunk','as':_0xae2e('0x34'),'attributes':['id',_0xae2e('0x31'),_0xae2e('0x35'),_0xae2e('0x36')]},{'model':_0xae2e('0x37'),'as':_0xae2e('0x37'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xae2e('0x38'),'attributes':['id',_0xae2e('0x31'),_0xae2e('0x39')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 171c94d..2a1a77f 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(_0x282447,_0x2e139e){var _0x137bbf=function(_0x24a584){while(--_0x24a584){_0x282447['push'](_0x282447['shift']());}};_0x137bbf(++_0x2e139e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +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(_0x212776,_0x38666e){var _0x46b217=function(_0x2f8365){while(--_0x2f8365){_0x212776['push'](_0x212776['shift']());}};_0x46b217(++_0x38666e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 8b08b9c..50479e6 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 _0x7e61=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x2bad97,_0x5bc654){var _0x55729d=function(_0x55edb0){while(--_0x55edb0){_0x2bad97['push'](_0x2bad97['shift']());}};_0x55729d(++_0x5bc654);}(_0x7e61,0x1b6));var _0x17e6=function(_0x424a7e,_0x4bbb43){_0x424a7e=_0x424a7e-0x0;var _0x50b5c3=_0x7e61[_0x424a7e];return _0x50b5c3;};'use strict';var client=require('../client');exports[_0x17e6('0x0')]=function(_0x18fa24){return function(){return client['Request'](_0x17e6('0x1'),{'options':{'where':{'VoiceQueueId':_0x18fa24,'paused':!![]},'raw':!![]},'log':_0x17e6('0x0')});};}; \ No newline at end of file +var _0x7407=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x43ae14,_0xd2cce0){var _0x51ef24=function(_0x1112f2){while(--_0x1112f2){_0x43ae14['push'](_0x43ae14['shift']());}};_0x51ef24(++_0xd2cce0);}(_0x7407,0x81));var _0x7740=function(_0xe18a43,_0x4ccd77){_0xe18a43=_0xe18a43-0x0;var _0x31cca5=_0x7407[_0xe18a43];return _0x31cca5;};'use strict';var client=require(_0x7740('0x0'));exports[_0x7740('0x1')]=function(_0x2174b9){return function(){return client[_0x7740('0x2')](_0x7740('0x3'),{'options':{'where':{'VoiceQueueId':_0x2174b9,'paused':!![]},'raw':!![]},'log':_0x7740('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 373ec50..92362c6 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(_0x585ff2,_0x70ad94){var _0x334efe=function(_0x734662){while(--_0x734662){_0x585ff2['push'](_0x585ff2['shift']());}};_0x334efe(++_0x70ad94);}(_0x7a54,0x106));var _0x47a5=function(_0x24b8e6,_0x515391){_0x24b8e6=_0x24b8e6-0x0;var _0x53c773=_0x7a54[_0x24b8e6];return _0x53c773;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0xcab034,_0x57b43b){var _0x4a8d4a=function(_0x58427c){while(--_0x58427c){_0xcab034['push'](_0xcab034['shift']());}};_0x4a8d4a(++_0x57b43b);}(_0x7a54,0x106));var _0x47a5=function(_0x1e1de6,_0x4f4cf9){_0x1e1de6=_0x1e1de6-0x0;var _0x2ff233=_0x7a54[_0x1e1de6];return _0x2ff233;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index e58247e..47d8236 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 _0x93a6=['extension','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0x93a6,0x1bf));var _0x693a=function(_0x211a02,_0x3b5362){_0x211a02=_0x211a02-0x0;var _0x13d91c=_0x93a6[_0x211a02];return _0x13d91c;};'use strict';var client=require(_0x693a('0x0'));exports[_0x693a('0x1')]={};exports[_0x693a('0x2')]=function(_0x58c8f9){return client['Request'](_0x693a('0x3'),{'body':{'result':_0x58c8f9[_0x693a('0x4')],'transfererchannel':_0x58c8f9[_0x693a('0x5')],'transferercalleridnum':_0x58c8f9[_0x693a('0x6')],'transferercalleridname':_0x58c8f9['transferercalleridname'],'transfererconnectedlinenum':_0x58c8f9['transfererconnectedlinenum'],'transfererconnectedlinename':_0x58c8f9[_0x693a('0x7')],'transfereraccountcode':_0x58c8f9[_0x693a('0x8')],'transferercontext':_0x58c8f9['transferercontext'],'transfererexten':_0x58c8f9[_0x693a('0x9')],'transfererlinkedid':_0x58c8f9[_0x693a('0xa')],'transfereechannel':_0x58c8f9[_0x693a('0xb')],'transfereecalleridnum':_0x58c8f9[_0x693a('0xc')],'transfereecalleridname':_0x58c8f9[_0x693a('0xd')],'transfereeconnectedlinenum':_0x58c8f9[_0x693a('0xe')],'transfereeconnectedlinename':_0x58c8f9['transfereeconnectedlinename'],'transfereeaccountcode':_0x58c8f9[_0x693a('0xf')],'transfereecontext':_0x58c8f9[_0x693a('0x10')],'transfereeexten':_0x58c8f9[_0x693a('0x11')],'transfereelinkedid':_0x58c8f9[_0x693a('0x12')],'isexternal':_0x58c8f9[_0x693a('0x13')],'context':_0x58c8f9[_0x693a('0x14')],'extension':_0x58c8f9[_0x693a('0x15')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x38a7e1){return client[_0x693a('0x16')](_0x693a('0x3'),{'body':{'result':_0x38a7e1[_0x693a('0x4')],'transfererchannel':_0x38a7e1[_0x693a('0x17')],'transferercalleridnum':_0x38a7e1[_0x693a('0x18')],'transferercalleridname':_0x38a7e1[_0x693a('0x19')],'transfererconnectedlinenum':_0x38a7e1[_0x693a('0x1a')],'transfererconnectedlinename':_0x38a7e1[_0x693a('0x1b')],'transfereraccountcode':_0x38a7e1[_0x693a('0x1c')],'transferercontext':_0x38a7e1['secondtransferercontext'],'transfererexten':_0x38a7e1[_0x693a('0x1d')],'transfererlinkedid':_0x38a7e1['origtransfererlinkedid'],'transfereechannel':_0x38a7e1[_0x693a('0x1e')],'transfereecalleridnum':_0x38a7e1[_0x693a('0x1f')],'transfereecalleridname':_0x38a7e1['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x38a7e1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x38a7e1[_0x693a('0x20')],'transfereeaccountcode':_0x38a7e1[_0x693a('0x21')],'transfereecontext':_0x38a7e1[_0x693a('0x22')],'transfereeexten':_0x38a7e1['transfertargetexten'],'transfereelinkedid':_0x38a7e1[_0x693a('0x23')],'isexternal':_0x38a7e1[_0x693a('0x13')],'context':_0x38a7e1[_0x693a('0x24')],'extension':_0x38a7e1[_0x693a('0x25')],'type':_0x693a('0x26')},'log':_0x693a('0x3')});}; \ No newline at end of file +var _0x2509=['transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','extension','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x2509,0x1a7));var _0x9250=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x2509[_0x3bb5b4];return _0x586c60;};'use strict';var client=require(_0x9250('0x0'));exports['transfers']={};exports[_0x9250('0x1')]=function(_0x3809d3){return client[_0x9250('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x3809d3[_0x9250('0x3')],'transfererchannel':_0x3809d3[_0x9250('0x4')],'transferercalleridnum':_0x3809d3[_0x9250('0x5')],'transferercalleridname':_0x3809d3[_0x9250('0x6')],'transfererconnectedlinenum':_0x3809d3[_0x9250('0x7')],'transfererconnectedlinename':_0x3809d3[_0x9250('0x8')],'transfereraccountcode':_0x3809d3['transfereraccountcode'],'transferercontext':_0x3809d3[_0x9250('0x9')],'transfererexten':_0x3809d3[_0x9250('0xa')],'transfererlinkedid':_0x3809d3[_0x9250('0xb')],'transfereechannel':_0x3809d3[_0x9250('0xc')],'transfereecalleridnum':_0x3809d3['transfereecalleridnum'],'transfereecalleridname':_0x3809d3[_0x9250('0xd')],'transfereeconnectedlinenum':_0x3809d3[_0x9250('0xe')],'transfereeconnectedlinename':_0x3809d3['transfereeconnectedlinename'],'transfereeaccountcode':_0x3809d3[_0x9250('0xf')],'transfereecontext':_0x3809d3['transfereecontext'],'transfereeexten':_0x3809d3[_0x9250('0x10')],'transfereelinkedid':_0x3809d3[_0x9250('0x11')],'isexternal':_0x3809d3['isexternal'],'context':_0x3809d3['context'],'extension':_0x3809d3[_0x9250('0x12')],'type':'blind'},'log':_0x9250('0x13')});};exports[_0x9250('0x14')]=function(_0x45cd4e){return client[_0x9250('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x45cd4e['result'],'transfererchannel':_0x45cd4e[_0x9250('0x15')],'transferercalleridnum':_0x45cd4e['origtransferercalleridnum'],'transferercalleridname':_0x45cd4e[_0x9250('0x16')],'transfererconnectedlinenum':_0x45cd4e[_0x9250('0x17')],'transfererconnectedlinename':_0x45cd4e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x45cd4e['origtransfereraccountcode'],'transferercontext':_0x45cd4e[_0x9250('0x18')],'transfererexten':_0x45cd4e['secondtransfererexten'],'transfererlinkedid':_0x45cd4e[_0x9250('0x19')],'transfereechannel':_0x45cd4e[_0x9250('0x1a')],'transfereecalleridnum':_0x45cd4e[_0x9250('0x1b')],'transfereecalleridname':_0x45cd4e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x45cd4e[_0x9250('0x1c')],'transfereeconnectedlinename':_0x45cd4e['transfertargetconnectedlinename'],'transfereeaccountcode':_0x45cd4e[_0x9250('0x1d')],'transfereecontext':_0x45cd4e['transfertargetcontext'],'transfereeexten':_0x45cd4e[_0x9250('0x1e')],'transfereelinkedid':_0x45cd4e[_0x9250('0x1f')],'isexternal':_0x45cd4e[_0x9250('0x20')],'context':_0x45cd4e[_0x9250('0x21')],'extension':_0x45cd4e[_0x9250('0x22')],'type':_0x9250('0x23')},'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 59415fb..81387db 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0xc59b1,_0x3adda8){var _0x3525aa=function(_0x3b0ab9){while(--_0x3b0ab9){_0xc59b1['push'](_0xc59b1['shift']());}};_0x3525aa(++_0x3adda8);}(_0x7a54,0x106));var _0x47a5=function(_0x355ab1,_0x9e7fd4){_0x355ab1=_0x355ab1-0x0;var _0x3dddc2=_0x7a54[_0x355ab1];return _0x3dddc2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x10f9bb,_0xe5cb46){var _0xc88fc5=function(_0x332233){while(--_0x332233){_0x10f9bb['push'](_0x10f9bb['shift']());}};_0xc88fc5(++_0xe5cb46);}(_0xb10b,0x12a));var _0xbb10=function(_0x388550,_0x3fd74b){_0x388550=_0x388550-0x0;var _0x735860=_0xb10b[_0x388550];return _0x735860;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 6b9f95b..2c28af3 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 _0xc4fb=['redis','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','phone','map','routeId','destcalleridnum','firstName','lastName','mobile','createdAt','updatedAt','getContacts','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','resolve','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults'];(function(_0x4ca80f,_0x72376d){var _0xa1d96c=function(_0x22713a){while(--_0x22713a){_0x4ca80f['push'](_0x4ca80f['shift']());}};_0xa1d96c(++_0x72376d);}(_0xc4fb,0x12a));var _0xbc4f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc4fb[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xbc4f('0x0'));var BPromise=require(_0xbc4f('0x1'));var Redis=require(_0xbc4f('0x2'));var util=require('util');var config=require(_0xbc4f('0x3'));var logger=require(_0xbc4f('0x4'))(_0xbc4f('0x5'));var cmContactRpc=require(_0xbc4f('0x6'));config['redis']=_[_0xbc4f('0x7')](config[_0xbc4f('0x8')],{'host':_0xbc4f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x7445ca,_0x44791a,_0x1db839,_0x1fb58e,_0x4e34cf){logger[_0xbc4f('0xa')](_0xbc4f('0xb'),_0x7445ca,_0x44791a['id'],_0x1db839,_0x1fb58e,JSON[_0xbc4f('0xc')](_0x4e34cf));io['to'](_0x1db839)[_0xbc4f('0xd')](_0x1fb58e,_0x4e34cf);}exports[_0xbc4f('0xe')]=function(_0x134833,_0x4cf39d,_0x42e585,_0x34f8f2){var _0x100a11,_0x50a311;var _0x30b20f={};var _0x340ff0;var _0x24bc53=Number(_0x42e585[_0xbc4f('0xf')]);var _0x297e7e=_0x42e585['data2']?Boolean(Number(_0x42e585[_0xbc4f('0x10')])):![];var _0x2357eb;var _0x5f43f2=![];if(!_[_0xbc4f('0x11')](_0x42e585[_0xbc4f('0x12')])){if(_0x42e585[_0xbc4f('0x12')]=='1')_0x5f43f2=!![];}if(!_0x5f43f2){if(_0x34f8f2[_0xbc4f('0x13')]){_0x30b20f['id']=_0x34f8f2[_0xbc4f('0x13')];}}if(!_0x30b20f['id']){_0x30b20f[_0xbc4f('0x14')]=_0x24bc53;_0x2357eb=_0x42e585['data3']&&_0x42e585['data3']!=='0'?_0x42e585['data3']['split'](','):[_0xbc4f('0x15')];_0x30b20f['$or']=_[_0xbc4f('0x16')](_0x2357eb,function(_0x556af2){var _0x15cc38={};_0x15cc38[_0x556af2]=_0x34f8f2[_0xbc4f('0x17')]?_0x34f8f2[_0xbc4f('0x18')]:_0x34f8f2['calleridnum'];return _0x15cc38;});_0x340ff0=_0x34f8f2[_0xbc4f('0x17')]?_0x34f8f2['destcalleridnum']:_0x34f8f2['calleridnum'];}var _0xf35928=['id',_0xbc4f('0x19'),_0xbc4f('0x1a'),'phone',_0xbc4f('0x1b'),'fax',_0xbc4f('0x14'),_0xbc4f('0x1c'),'scheduledAt',_0xbc4f('0x1d')];var _0x164e1c=_['union'](_0xf35928,_0x2357eb);BPromise['resolve']()['then'](cmContactRpc[_0xbc4f('0x1e')]({'attributes':_0x164e1c,'where':_0x30b20f,'phone':_0x340ff0}))[_0xbc4f('0x1f')](function(_0xd5d030){_0x50a311=_0xd5d030;if(!_[_0xbc4f('0x20')](_0x50a311)){if(_0x50a311[_0xbc4f('0x21')]===0x1){_0x100a11=_0x50a311[0x0];logger[_0xbc4f('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x34f8f2[_0xbc4f('0x22')],_0x4cf39d['id'],_0x100a11['id']);}else{logger['info'](_0xbc4f('0x23'),_0x34f8f2['uniqueid'],_0x4cf39d['id'],_[_0xbc4f('0x16')](_0x50a311,'id')[_0xbc4f('0x24')](','));}return;}else{logger['info'](_0xbc4f('0x25'),_0x34f8f2[_0xbc4f('0x22')],_0x4cf39d['id']);var _0x41caaa={'ListId':_0x24bc53};var _0x44ec23=_0x42e585[_0xbc4f('0x26')]&&_0x42e585['data4']!=='0'?_0x42e585[_0xbc4f('0x26')]:_0xbc4f('0x15');if(_0x297e7e){logger['info'](_0xbc4f('0x27'),_0x34f8f2['uniqueid'],_0x4cf39d['id']);_0x41caaa[_0x44ec23]=_[_0xbc4f('0x11')](_0x34f8f2[_0xbc4f('0x17')])?_0x34f8f2['calleridnum']:_0x34f8f2[_0xbc4f('0x18')];if(_[_0xbc4f('0x11')](_0x34f8f2['routeId'])){_0x41caaa[_0xbc4f('0x19')]=_0x34f8f2[_0xbc4f('0x28')]&&_0x34f8f2[_0xbc4f('0x28')]!==_0xbc4f('0x29')?_0x34f8f2['calleridname']:_0xbc4f('0x2a');}else{_0x41caaa[_0xbc4f('0x19')]=_0x34f8f2[_0xbc4f('0x2b')]&&_0x34f8f2[_0xbc4f('0x2b')]!==_0xbc4f('0x29')?_0x34f8f2[_0xbc4f('0x2b')]:'Unknown';}return BPromise[_0xbc4f('0x2c')]()[_0xbc4f('0x1f')](cmContactRpc['createContact'](_0x41caaa))[_0xbc4f('0x1f')](function(_0x2ba78a){_0x100a11=_0x2ba78a;_0x50a311[_0xbc4f('0x2d')](_0x2ba78a);if(_0x100a11){logger[_0xbc4f('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x34f8f2['uniqueid'],_0x4cf39d['id'],_0x100a11['id']);}return;});}else{logger[_0xbc4f('0xa')](_0xbc4f('0x2e'),_0x34f8f2[_0xbc4f('0x22')],_0x4cf39d['id']);_0x41caaa[_0x44ec23]=_['isNil'](_0x34f8f2['routeId'])?_0x34f8f2['calleridnum']:_0x34f8f2[_0xbc4f('0x18')];if(_[_0xbc4f('0x11')](_0x34f8f2[_0xbc4f('0x17')])){_0x41caaa[_0xbc4f('0x19')]=_0x34f8f2[_0xbc4f('0x28')]&&_0x34f8f2[_0xbc4f('0x28')]!==_0xbc4f('0x29')?_0x34f8f2[_0xbc4f('0x28')]:_0xbc4f('0x2a');}else{_0x41caaa['firstName']=_0x34f8f2[_0xbc4f('0x2b')]&&_0x34f8f2[_0xbc4f('0x2b')]!==_0xbc4f('0x29')?_0x34f8f2[_0xbc4f('0x2b')]:_0xbc4f('0x2a');}_0x100a11=_0x41caaa;_0x50a311[_0xbc4f('0x2d')](_0x41caaa);return;}}})[_0xbc4f('0x1f')](function(){if(_0x134833){emit(_0x34f8f2[_0xbc4f('0x22')],_0x4cf39d,util[_0xbc4f('0x2f')]('user:%s',_0x134833['name']),util['format'](_0xbc4f('0x30'),_0x42e585[_0xbc4f('0x31')]['toLowerCase']()),{'evt':_[_0xbc4f('0x32')](_0x34f8f2,{'autoCreate':_0x297e7e}),'contact':_0x100a11===undefined?{}:_0x100a11,'contacts':_0x50a311[_0xbc4f('0x21')]===0x0?undefined:_0x50a311});}});}; \ No newline at end of file +var _0x2067=['calleridname','','destcalleridname','Unknown','resolve','[CM][%s][%s]\x20Contact\x20created:%s','push','format','trigger:%s','toLowerCase','lodash','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','[CM][%s][%s]','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','union','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x2067,0x161));var _0x7206=function(_0x21cecb,_0x2872d2){_0x21cecb=_0x21cecb-0x0;var _0x191984=_0x2067[_0x21cecb];return _0x191984;};'use strict';var _=require(_0x7206('0x0'));var BPromise=require('bluebird');var Redis=require(_0x7206('0x1'));var util=require(_0x7206('0x2'));var config=require('../../../../config/environment');var logger=require(_0x7206('0x3'))('trigger');var cmContactRpc=require(_0x7206('0x4'));config[_0x7206('0x5')]=_[_0x7206('0x6')](config[_0x7206('0x5')],{'host':_0x7206('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x15c0c5,_0x3685f9,_0x559939,_0x2cf8da,_0x1ef65c){logger['info'](_0x7206('0x8'),_0x15c0c5,_0x3685f9['id'],_0x559939,_0x2cf8da,JSON['stringify'](_0x1ef65c));io['to'](_0x559939)['emit'](_0x2cf8da,_0x1ef65c);}exports[_0x7206('0x9')]=function(_0x164c54,_0x15eab9,_0x1b6e1f,_0xbca8b7){var _0x5c4362,_0x2e4a27;var _0x16e931={};var _0x2cfd59;var _0x277593=Number(_0x1b6e1f[_0x7206('0xa')]);var _0x2afd1a=_0x1b6e1f[_0x7206('0xb')]?Boolean(Number(_0x1b6e1f[_0x7206('0xb')])):![];var _0x55279e;var _0x2baee1=![];if(!_[_0x7206('0xc')](_0x1b6e1f['data5'])){if(_0x1b6e1f[_0x7206('0xd')]=='1')_0x2baee1=!![];}if(!_0x2baee1){if(_0xbca8b7[_0x7206('0xe')]){_0x16e931['id']=_0xbca8b7[_0x7206('0xe')];}}if(!_0x16e931['id']){_0x16e931[_0x7206('0xf')]=_0x277593;_0x55279e=_0x1b6e1f[_0x7206('0x10')]&&_0x1b6e1f[_0x7206('0x10')]!=='0'?_0x1b6e1f[_0x7206('0x10')][_0x7206('0x11')](','):[_0x7206('0x12')];_0x16e931['$or']=_[_0x7206('0x13')](_0x55279e,function(_0x2f53ea){var _0x19c547={};_0x19c547[_0x2f53ea]=_0xbca8b7[_0x7206('0x14')]?_0xbca8b7[_0x7206('0x15')]:_0xbca8b7[_0x7206('0x16')];return _0x19c547;});_0x2cfd59=_0xbca8b7[_0x7206('0x14')]?_0xbca8b7[_0x7206('0x15')]:_0xbca8b7[_0x7206('0x16')];}var _0x15432b=['id',_0x7206('0x17'),_0x7206('0x18'),'phone',_0x7206('0x19'),'fax',_0x7206('0xf'),_0x7206('0x1a'),'scheduledAt',_0x7206('0x1b')];var _0x292d53=_[_0x7206('0x1c')](_0x15432b,_0x55279e);BPromise['resolve']()[_0x7206('0x1d')](cmContactRpc['getContacts']({'attributes':_0x292d53,'where':_0x16e931,'phone':_0x2cfd59}))[_0x7206('0x1d')](function(_0x581584){_0x2e4a27=_0x581584;if(!_[_0x7206('0x1e')](_0x2e4a27)){if(_0x2e4a27[_0x7206('0x1f')]===0x1){_0x5c4362=_0x2e4a27[0x0];logger[_0x7206('0x20')](_0x7206('0x21'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id'],_0x5c4362['id']);}else{logger[_0x7206('0x20')](_0x7206('0x23'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id'],_[_0x7206('0x13')](_0x2e4a27,'id')[_0x7206('0x24')](','));}return;}else{logger[_0x7206('0x20')](_0x7206('0x25'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id']);var _0x11fa9={'ListId':_0x277593};var _0x41d5ec=_0x1b6e1f[_0x7206('0x26')]&&_0x1b6e1f[_0x7206('0x26')]!=='0'?_0x1b6e1f[_0x7206('0x26')]:_0x7206('0x12');if(_0x2afd1a){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0xbca8b7['uniqueid'],_0x15eab9['id']);_0x11fa9[_0x41d5ec]=_[_0x7206('0xc')](_0xbca8b7[_0x7206('0x14')])?_0xbca8b7['calleridnum']:_0xbca8b7[_0x7206('0x15')];if(_[_0x7206('0xc')](_0xbca8b7['routeId'])){_0x11fa9[_0x7206('0x17')]=_0xbca8b7[_0x7206('0x27')]&&_0xbca8b7[_0x7206('0x27')]!==_0x7206('0x28')?_0xbca8b7[_0x7206('0x27')]:'Unknown';}else{_0x11fa9[_0x7206('0x17')]=_0xbca8b7[_0x7206('0x29')]&&_0xbca8b7[_0x7206('0x29')]!==_0x7206('0x28')?_0xbca8b7[_0x7206('0x29')]:_0x7206('0x2a');}return BPromise[_0x7206('0x2b')]()['then'](cmContactRpc['createContact'](_0x11fa9))[_0x7206('0x1d')](function(_0x487300){_0x5c4362=_0x487300;_0x2e4a27['push'](_0x487300);if(_0x5c4362){logger[_0x7206('0x20')](_0x7206('0x2c'),_0xbca8b7[_0x7206('0x22')],_0x15eab9['id'],_0x5c4362['id']);}return;});}else{logger[_0x7206('0x20')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xbca8b7[_0x7206('0x22')],_0x15eab9['id']);_0x11fa9[_0x41d5ec]=_[_0x7206('0xc')](_0xbca8b7[_0x7206('0x14')])?_0xbca8b7[_0x7206('0x16')]:_0xbca8b7[_0x7206('0x15')];if(_['isNil'](_0xbca8b7[_0x7206('0x14')])){_0x11fa9['firstName']=_0xbca8b7[_0x7206('0x27')]&&_0xbca8b7[_0x7206('0x27')]!==_0x7206('0x28')?_0xbca8b7[_0x7206('0x27')]:'Unknown';}else{_0x11fa9[_0x7206('0x17')]=_0xbca8b7[_0x7206('0x29')]&&_0xbca8b7[_0x7206('0x29')]!==_0x7206('0x28')?_0xbca8b7['destcalleridname']:_0x7206('0x2a');}_0x5c4362=_0x11fa9;_0x2e4a27[_0x7206('0x2d')](_0x11fa9);return;}}})[_0x7206('0x1d')](function(){if(_0x164c54){emit(_0xbca8b7[_0x7206('0x22')],_0x15eab9,util[_0x7206('0x2e')]('user:%s',_0x164c54['name']),util['format'](_0x7206('0x2f'),_0x1b6e1f['action'][_0x7206('0x30')]()),{'evt':_['merge'](_0xbca8b7,{'autoCreate':_0x2afd1a}),'contact':_0x5c4362===undefined?{}:_0x5c4362,'contacts':_0x2e4a27[_0x7206('0x1f')]===0x0?undefined:_0x2e4a27});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0f3083c..c6759d2 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 _0x6030=['custom:dialend','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','undefined','voice','debug','checkTriggers','interface','status','checkTrigger','merge','variables','Actions','action','toLowerCase','motionbar','browser','data1','popup','TemplateId','html','data2','render','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','data6','600','winArguments','format','user:%s','trigger:%s:%s','jscripty','trigger:%s','name','contactmanager','integration','exec','queue','routeId','urlforward','parse','query','replace','channel','length','every','AllConditions','AnyConditions','some','checkConditions','checkTrigger:\x20trigger','inspect','field','account','ChatWebsiteId','value','AccountId','upperFirst','interaction','operator','event','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','created','equals','exports','lodash','url','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x6030,0x1d9));var _0x0603=function(_0x196389,_0x1e8d9f){_0x196389=_0x196389-0x0;var _0x56d125=_0x6030[_0x196389];return _0x56d125;};'use strict';var util=require('util');var _=require(_0x0603('0x0'));var url=require(_0x0603('0x1'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x0603('0x2'));var integration=require(_0x0603('0x3'));var cmContact=require('./cmContact');var script=require(_0x0603('0x4'));var config=require(_0x0603('0x5'));var logger=require(_0x0603('0x6'))(_0x0603('0x7'));var ami=require(_0x0603('0x8'));config[_0x0603('0x9')]=_[_0x0603('0xa')](config[_0x0603('0x9')],{'host':_0x0603('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x552388,_0x5de217){return _0x552388==_0x5de217;},'not_equals':function(_0x43b7ab,_0x345018){return _0x43b7ab!=_0x345018;}};var barAndWebActions=['popup','url','winapp'];function Trigger(_0xf636e3){this[_0x0603('0xc')]=_0xf636e3[_0x0603('0xc')];this['agents']=_0xf636e3[_0x0603('0xd')];this[_0x0603('0xe')]=_0xf636e3[_0x0603('0xe')];this[_0x0603('0xf')]=_0xf636e3[_0x0603('0xf')];this[_0x0603('0x10')]=_0xf636e3[_0x0603('0x10')];this[_0x0603('0x11')]=_0xf636e3[_0x0603('0x11')];this['freshdeskAccounts']=_0xf636e3['freshdeskAccounts'];this['salesforceAccounts']=_0xf636e3[_0x0603('0x12')];this['sugarcrmAccounts']=_0xf636e3['sugarcrmAccounts'];this['zohoAccounts']=_0xf636e3['zohoAccounts'];this[_0x0603('0x13')]=_0xf636e3[_0x0603('0x13')];this['vtigerAccounts']=_0xf636e3[_0x0603('0x14')];this[_0x0603('0x15')]=_0xf636e3[_0x0603('0x15')];this[_0x0603('0x16')]=_0xf636e3[_0x0603('0x16')];this['freshsalesAccounts']=_0xf636e3[_0x0603('0x17')];this[_0x0603('0x18')]={'zendesk':this[_0x0603('0x11')],'salesforce':this[_0x0603('0x12')],'freshdesk':this[_0x0603('0x19')],'sugarcrm':this[_0x0603('0x1a')],'zoho':this[_0x0603('0x1b')],'desk':this[_0x0603('0x13')],'vtiger':this[_0x0603('0x14')],'dynamics365':this[_0x0603('0x16')],'freshsales':this[_0x0603('0x17')],'servicenow':this['servicenowAccounts']};ami['on'](_0x0603('0x1c'),this[_0x0603('0x1d')]['bind'](this));ami['on'](_0x0603('0x1e'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on'](_0x0603('0x20'),this['syncCustomEvent'][_0x0603('0x1f')](this));ami['on'](_0x0603('0x21'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on'](_0x0603('0x22'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on'](_0x0603('0x23'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on'](_0x0603('0x24'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on']('custom:agentreject',this[_0x0603('0x1d')]['bind'](this));ami['on'](_0x0603('0x25'),this[_0x0603('0x1d')]['bind'](this));ami['on'](_0x0603('0x26'),this['syncCustomEvent'][_0x0603('0x1f')](this));ami['on'](_0x0603('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x0603('0x28'),this[_0x0603('0x29')][_0x0603('0x1f')](this));ami['on'](_0x0603('0x2a'),this['syncAgentDial'][_0x0603('0x1f')](this));ami['on'](_0x0603('0x2b'),this['syncAgentDial'][_0x0603('0x1f')](this));ami['on']('custom:newinteraction',this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on']('custom:closedinteraction',this[_0x0603('0x1d')]['bind'](this));ami['on'](_0x0603('0x2c'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x0603('0x1f')](this));ami['on'](_0x0603('0x2d'),this[_0x0603('0x1d')]['bind'](this));ami['on'](_0x0603('0x2e'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));ami['on'](_0x0603('0x2f'),this[_0x0603('0x1d')]['bind'](this));ami['on'](_0x0603('0x30'),this[_0x0603('0x1d')][_0x0603('0x1f')](this));}Trigger[_0x0603('0x31')][_0x0603('0x32')]=function(_0x4f36a1,_0x174e8d,_0x5aa155){logger[_0x0603('0x33')](_0x4f36a1,_0x174e8d,JSON[_0x0603('0x34')](_0x5aa155));io['to'](_0x4f36a1)[_0x0603('0x32')](_0x174e8d,_0x5aa155);};Trigger[_0x0603('0x31')][_0x0603('0x1d')]=function(_0x24c97b){var _0x510046=_['clone'](_0x24c97b);if(typeof _0x510046[_0x0603('0x35')]===_0x0603('0x36')){_0x510046[_0x0603('0x35')]=_0x0603('0x37');}logger[_0x0603('0x38')]('syncCustomEvent',util['inspect'](_0x510046,{'showHidden':!![],'depth':null}));this[_0x0603('0x39')](_0x510046);};Trigger[_0x0603('0x31')][_0x0603('0x29')]=function(_0x1cbd68){if(this['agents'][_0x1cbd68[_0x0603('0x3a')]]){this[_0x0603('0x1d')](_0x1cbd68);}};Trigger[_0x0603('0x31')][_0x0603('0x39')]=function(_0x23a57f){var _0x1eb00a;for(var _0x2e5099 in this['triggers']){if(this[_0x0603('0xc')]['hasOwnProperty'](_0x2e5099)){if(this[_0x0603('0xc')][_0x2e5099][_0x0603('0x3b')]){_0x1eb00a=this[_0x0603('0x3c')](this[_0x0603('0xc')][_0x2e5099],_0x23a57f);if(_0x1eb00a){_[_0x0603('0x3d')](_0x23a57f,_0x23a57f[_0x0603('0x3e')]);for(var _0x1667ce=0x0,_0x21a462,_0x52820c,_0xb1e2ff;_0x1667ce0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x2f7223,_0x37967f){var _0xc2f7e2=function(_0x56036c){while(--_0x56036c){_0x2f7223['push'](_0x2f7223['shift']());}};_0xc2f7e2(++_0x37967f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 2633fe1..dd992ff 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 _0x382d=['replace','%2b','forEach','string','picklist','type','customField','idField','indexOf','content','ticketType','incidents','assign','Subjects','Descriptions','/contacts(','queue','callDirection','phonecalls','getString','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','toLowerCase','destcalleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','outbound','calleridnum','contacts?$select='];(function(_0x4fcc1d,_0x6f4fc5){var _0x4a1957=function(_0x3e3bb9){while(--_0x3e3bb9){_0x4fcc1d['push'](_0x4fcc1d['shift']());}};_0x4a1957(++_0x6f4fc5);}(_0x382d,0x10a));var _0xd382=function(_0x5ba949,_0x43cceb){_0x5ba949=_0x5ba949-0x0;var _0xb27be0=_0x382d[_0x5ba949];return _0xb27be0;};'use strict';var _=require(_0xd382('0x0'));var rp=require(_0xd382('0x1'));var util=require(_0xd382('0x2'));var intUtil=require(_0xd382('0x3'));var md5=require(_0xd382('0x4'));var Redis=require(_0xd382('0x5'));var logger=require(_0xd382('0x6'))(_0xd382('0x7'));var config=require(_0xd382('0x8'));config['redis']=_[_0xd382('0x9')](config['redis'],{'host':_0xd382('0xa'),'port':0x18eb});var io=require(_0xd382('0xb'))(new Redis(config['redis']));function getAuthToken(_0x47856c,_0x30bc07,_0x2fb2ac){if(_0x47856c['modernAuthentication']){_0x47856c[_0xd382('0xc')]=_0x47856c[_0xd382('0xd')][_0xd382('0xe')];_0x47856c[_0xd382('0xf')]=_0x47856c['CloudProvider'][_0xd382('0x10')];return Promise[_0xd382('0x11')](_0x47856c['CloudProvider'][_0xd382('0x12')]);}var _0xe722e4={'method':_0xd382('0x13'),'uri':_0x30bc07,'form':{'client_id':_0x47856c[_0xd382('0x14')],'resource':_0x47856c[_0xd382('0xc')],'username':_0x47856c[_0xd382('0x15')],'password':_0x47856c[_0xd382('0x16')],'grant_type':_0xd382('0x16'),'client_secret':_0x47856c[_0xd382('0x17')]},'json':!![]};return rp(_0xe722e4)['then'](function(_0x5ef2d1){return _0x5ef2d1[_0xd382('0x18')];})[_0xd382('0x19')](function(_0x27ce64){logger[_0xd382('0x1a')]('['+[_0x2fb2ac[_0xd382('0x1b')]()]+_0xd382('0x1c'));return _0x27ce64[_0xd382('0x1d')];});}function getUser(_0xc4c995,_0x141e21,_0x1e80c7,_0x7ff635,_0x564366,_0x4849fb){return new Promise(function(_0xdfc9cc,_0x4c3210){return getAuthToken(_0x141e21,_0x7ff635,_0x4849fb)['then'](function(_0x253082){var _0x1db4e5={'method':_0xd382('0x1e'),'uri':_0x564366+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xd382('0x1f')+_0x253082,'OData-Version':_0xd382('0x20')},'json':!![]};return rp(_0x1db4e5);})['then'](function(_0x427d6f){var _0x1e55eb=_0x427d6f[_0xd382('0x21')];var _0x4aff2a=![];var _0x5ad4b7=null;if(!_[_0xd382('0x22')](_0x1e80c7)){if(intUtil[_0xd382('0x23')](_0x1e80c7[_0xd382('0x24')])){_0xc4c995[_0xd382('0x25')]=_0x1e80c7[_0xd382('0x24')];for(_0x5ad4b7=0x0;_0x5ad4b7<_0x1e55eb[_0xd382('0x26')];_0x5ad4b7++){if(_0x1e55eb[_0x5ad4b7][_0xd382('0x27')]===_0x1e80c7['email']&&!_0x1e55eb[_0x5ad4b7][_0xd382('0x28')]){_0x4aff2a=!![];logger[_0xd382('0x29')]('['+[_0x4849fb['toUpperCase']()]+_0xd382('0x2a')+_0x1e55eb[_0x5ad4b7][_0xd382('0x2b')]+'!');_0xc4c995[_0xd382('0x2c')]=_0x1e55eb[_0x5ad4b7][_0xd382('0x2b')];}}}}if(!_0x4aff2a){logger[_0xd382('0x29')]('['+[_0x4849fb[_0xd382('0x1b')]()]+_0xd382('0x2d'));_0xc4c995['userEmail']=_0x141e21[_0xd382('0x15')];for(_0x5ad4b7=0x0;_0x5ad4b7<_0x1e55eb[_0xd382('0x26')];_0x5ad4b7++){if(_0x1e55eb[_0x5ad4b7][_0xd382('0x27')]===_0x141e21[_0xd382('0x15')]){_0xc4c995['userId']=_0x1e55eb[_0x5ad4b7][_0xd382('0x2b')];}}}_0xdfc9cc(_0xc4c995);})[_0xd382('0x19')](function(_0xf58f42){_0x4c3210(_0xf58f42['message']);});});}function createEndUser(_0x33e5da,_0x545786,_0x2f0a32,_0x418301,_0x524117,_0x502cb1,_0x40fadb){return new Promise(function(_0x1fdf1e,_0x522573){return getAuthToken(_0x545786,_0x2f0a32,_0x502cb1)[_0xd382('0x2e')](function(_0x198565){var _0x3dafc4=_0x502cb1[_0xd382('0x2f')]()==='outbound'?_0x524117[_0xd382('0x30')]:_0x524117['calleridnum'];var _0x518ba8={'method':'POST','uri':_0x418301+_0xd382('0x31'),'body':{'fullname':_0x3dafc4,'firstname':_0x3dafc4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd382('0x32')+_0x33e5da['userId']+')'},'headers':{'Authorization':_0xd382('0x1f')+_0x198565,'OData-Version':_0xd382('0x20')},'json':!![],'resolveWithFullResponse':!![]};_0x518ba8['body'][_0x40fadb]=_0x3dafc4;return rp(_0x518ba8);})[_0xd382('0x2e')](function(_0x16bde7){var _0x1dfda9=_0x16bde7[_0xd382('0x33')]['odata-entityid'];var _0x5c0854=_0x1dfda9[_0xd382('0x34')](_0x1dfda9[_0xd382('0x35')]('(')+0x1,_0x1dfda9[_0xd382('0x35')](')'));_0x33e5da[_0xd382('0x36')]=_0x5c0854;_0x1fdf1e(_0x33e5da);})[_0xd382('0x19')](function(_0x565eb0){_0x522573(_0x565eb0[_0xd382('0x1d')]);});});}function getEndUser(_0x577dae,_0x55739e,_0xcbf34d,_0x51215a,_0x3d9ce2,_0x16bdd7,_0xeca81b,_0x566c4e){var _0x1ccee4=_0x16bdd7[_0xd382('0x2f')]()===_0xd382('0x37')?_0x3d9ce2[_0xd382('0x30')]:_0x3d9ce2[_0xd382('0x38')];return getAuthToken(_0x55739e,_0xcbf34d,_0x16bdd7)['then'](function(_0x2d3df0){_0x566c4e=_0x566c4e?_0x566c4e:'telephone1';var _0x266a4d={'method':_0xd382('0x1e'),'uri':_0x51215a+_0xd382('0x39')+_0x566c4e+'&$filter='+_0x566c4e+'\x20eq\x20\x27'+_0x1ccee4[_0xd382('0x3a')]('+',_0xd382('0x3b'))+'\x27','headers':{'Authorization':_0xd382('0x1f')+_0x2d3df0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x266a4d);})[_0xd382('0x2e')](function(_0xb412d2){var _0x52bc18=![];if(!_0xb412d2)return _0x52bc18;var _0x10139b=_0xb412d2[_0xd382('0x21')];for(var _0xae1915=0x0;_0xae1915<_0x10139b['length'];_0xae1915++){if(_0x10139b[_0xae1915][_0x566c4e]===_0x1ccee4){_0x52bc18=!![];_0x577dae[_0xd382('0x36')]=_0x10139b[_0xae1915]['contactid'];}}return _0x52bc18;})[_0xd382('0x2e')](function(_0x5d8696){if(_0x5d8696)return _0x577dae;if(_0xeca81b==='nothing'){logger['info']('['+[_0x16bdd7[_0xd382('0x1b')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x577dae;}return createEndUser(_0x577dae,_0x55739e,_0xcbf34d,_0x51215a,_0x3d9ce2,_0x16bdd7,_0x566c4e)[_0xd382('0x2e')](function(_0x1a8180){logger[_0xd382('0x29')]('['+[_0x16bdd7[_0xd382('0x1b')]()]+']\x20Enduser\x20created!',_0x1a8180[_0xd382('0x36')]);return _0x1a8180;});});}function getCustomFields(_0x4d684a,_0x27897b,_0x1a4e95){var _0x273156={};if(_0x4d684a[_0xd382('0x26')]>0x0){_[_0xd382('0x3c')](_0x4d684a,function(_0x490f11){if(_['includes']([_0xd382('0x3d'),_0xd382('0x3e')],_0x490f11[_0xd382('0x3f')])&&_0x490f11['nameField']&&!_0x490f11[_0xd382('0x40')]){var _0x2608ea=_0x490f11[_0xd382('0x41')][_0xd382('0x2f')]();var _0x58c07d=_0x2608ea[_0xd382('0x34')](0x0,_0x2608ea[_0xd382('0x42')]('_'));var _0x4fb680=_0x2608ea[_0xd382('0x34')](_0x2608ea[_0xd382('0x42')]('_')+0x1);if(_0x58c07d===_0x1a4e95){_0x273156[_0x4fb680]=_0x490f11[_0xd382('0x43')];}}});}return _0x273156;}function getTicket(_0x45b85e,_0x15c2d6,_0x4e777b,_0x1b8cec,_0x2e7893,_0x22dcf7,_0x1e4043){return new Promise(function(_0xf5e04f,_0x547968){var _0x19d5ac;return getAuthToken(_0x15c2d6,_0x4e777b,_0x1e4043)[_0xd382('0x2e')](function(_0x194bc5){if(_0x22dcf7[_0xd382('0x44')]==='incident'){_0x19d5ac={'method':'POST','uri':_0x1b8cec+_0xd382('0x45'),'body':Object[_0xd382('0x46')]({},{'title':intUtil['getString'](_0x22dcf7[_0xd382('0x47')],_0x2e7893,'\x20'),'description':intUtil['getString'](_0x22dcf7[_0xd382('0x48')],_0x2e7893,'\x0a'),'customerid_contact@odata.bind':_0x45b85e['enduserId']?_0xd382('0x49')+_0x45b85e['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x45b85e[_0xd382('0x2c')]+')','caseorigincode':'1'},getCustomFields(_0x22dcf7['Fields'],_0x2e7893,_0x22dcf7['ticketType'])),'headers':{'Authorization':_0xd382('0x1f')+_0x194bc5,'OData-Version':_0xd382('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x22dcf7[_0xd382('0x44')]==='phonecall'){var _0x45784a=_0x45b85e['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x45b85e['userId']+')','participationtypemask':_0x45b85e['callDirection']===_0xd382('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xd382('0x49')+_0x45b85e[_0xd382('0x36')]+')','participationtypemask':_0x45b85e[_0xd382('0x4b')]===_0xd382('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x45b85e['userId']+')','participationtypemask':_0x45b85e[_0xd382('0x4b')]===_0xd382('0x4a')?0x2:0x1}];_0x19d5ac={'method':_0xd382('0x13'),'uri':_0x1b8cec+_0xd382('0x4c'),'body':Object[_0xd382('0x46')]({},{'subject':intUtil[_0xd382('0x4d')](_0x22dcf7['Subjects'],_0x2e7893,'\x20'),'phonenumber':String(_0x2e7893[_0xd382('0x38')]),'description':intUtil[_0xd382('0x4d')](_0x22dcf7['Descriptions'],_0x2e7893,'\x0a'),'regardingobjectid_contact@odata.bind':_0x45b85e[_0xd382('0x36')]?'/contacts('+_0x45b85e[_0xd382('0x36')]+')':undefined,'ownerid@odata.bind':_0xd382('0x32')+_0x45b85e['userId']+')','directioncode':_0x45b85e[_0xd382('0x4b')]===_0xd382('0x4a')?![]:!![],'phonecall_activity_parties':_0x45784a},getCustomFields(_0x22dcf7[_0xd382('0x4e')],_0x2e7893,_0x22dcf7[_0xd382('0x44')])),'headers':{'Authorization':_0xd382('0x1f')+_0x194bc5,'OData-Version':_0xd382('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x19d5ac);})[_0xd382('0x2e')](function(_0x44d286){var _0x29e7b8=_0x44d286[_0xd382('0x33')][_0xd382('0x4f')];var _0x3a8c5a=_0x29e7b8[_0xd382('0x34')](_0x29e7b8['lastIndexOf']('(')+0x1,_0x29e7b8[_0xd382('0x35')](')'));_0x45b85e[_0xd382('0x50')]=_0x3a8c5a;_0xf5e04f(_0x45b85e);})[_0xd382('0x19')](function(_0x42acfb){_0x547968(_0x42acfb[_0xd382('0x1d')]);});});}function emit(_0x280677,_0x1a1c93,_0x82bc71,_0x4b1b75){var _0x31ed91={'uri':util[_0xd382('0x51')](_0xd382('0x52'),_0x280677,_0x82bc71,_0x4b1b75)};io['to'](util['format'](_0xd382('0x53'),_0x1a1c93))[_0xd382('0x54')]('trigger:browser:url',_0x31ed91);}exports['cs']=function(_0x4bb8ff,_0x3db4b7,_0x27e5da,_0x18d349,_0x5e0654,_0x5a679e,_0x4b6118,_0x389dbd){var _0x260b25={};_0x5a679e[_0xd382('0xc')]=_0x5a679e[_0xd382('0x55')]?intUtil[_0xd382('0x56')](_0x5a679e[_0xd382('0xd')][_0xd382('0xe')]):intUtil[_0xd382('0x56')](_0x5a679e[_0xd382('0xc')]);_0x5a679e[_0xd382('0x57')]=intUtil['stripTrailingSlash'](_0x5a679e['serverUrl']);_0x260b25['callDirection']=_0x389dbd===_0xd382('0x4a')||_0x389dbd===_0xd382('0x58')?_0xd382('0x4a'):_0xd382('0x37');var _0x576fde=_0x5a679e[_0xd382('0x55')]?util['format'](_0xd382('0x59'),_0x5a679e['CloudProvider'][_0xd382('0xe')]):util['format'](_0xd382('0x59'),_0x5a679e[_0xd382('0xc')]);var _0x1f3f3d=util['format'](_0xd382('0x5a'),_0x5a679e[_0xd382('0xf')]);var _0x11d43e=util[_0xd382('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a679e['serverUrl'],_0x3db4b7['uniqueid'],md5(_0x3db4b7[_0xd382('0x5b')]));if(_0x5e0654&&_0x5e0654['monitor_format']){logger[_0xd382('0x29')](_0xd382('0x5c'),_0xd382('0x5d'));_0x3db4b7[_0xd382('0x5e')]=_0x11d43e;}else if(_0x4b6118&&_0x4b6118[_0xd382('0x5f')]&&_0x4b6118['recordingFormat']!==_0xd382('0x60')){logger[_0xd382('0x29')](_0xd382('0x61'),_0xd382('0x5d'));_0x3db4b7[_0xd382('0x5e')]=_0x11d43e;}else{_0x3db4b7['recordingURL']='';}return getUser(_0x260b25,_0x5a679e,_0x18d349,_0x1f3f3d,_0x576fde,_0x389dbd)['then'](function(_0x3e059d){logger['info']('['+_0x389dbd['toUpperCase']()+_0xd382('0x62'),_0x3e059d[_0xd382('0x2c')]);logger[_0xd382('0x29')]('['+_0x389dbd[_0xd382('0x1b')]()+_0xd382('0x63'),_0x3e059d[_0xd382('0x25')]);return getEndUser(_0x3e059d,_0x5a679e,_0x1f3f3d,_0x576fde,_0x3db4b7,_0x389dbd,_0x27e5da['moduleCreate'],_0x27e5da[_0xd382('0x64')]);})['then'](function(_0x5ddb53){logger[_0xd382('0x29')]('['+_0x389dbd[_0xd382('0x1b')]()+_0xd382('0x65'),_0x5ddb53[_0xd382('0x36')]);logger[_0xd382('0x29')]('['+_0x389dbd[_0xd382('0x1b')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3db4b7[_0xd382('0x38')]);return getTicket(_0x5ddb53,_0x5a679e,_0x1f3f3d,_0x576fde,_0x3db4b7,_0x27e5da,_0x389dbd);})[_0xd382('0x2e')](function(_0x51c802){logger[_0xd382('0x29')](util[_0xd382('0x51')]('['+_0x389dbd[_0xd382('0x1b')]()+_0xd382('0x66'),_0x27e5da[_0xd382('0x44')],_0x51c802[_0xd382('0x50')]));logger[_0xd382('0x29')](util[_0xd382('0x51')]('['+_0x389dbd[_0xd382('0x1b')]()+']\x20Call\x20direction:\x20%s',_0x389dbd));if(_0x389dbd!=='unmanaged'&&_0x27e5da[_0xd382('0x67')]){logger[_0xd382('0x29')]('['+_0x389dbd['toUpperCase']()+']',_0xd382('0x68'));emit(_0x5a679e['remoteUri'],_0x18d349[_0xd382('0x69')],_0x27e5da['ticketType'],_0x51c802[_0xd382('0x50')]);}})[_0xd382('0x19')](function(_0x53c4f3){logger[_0xd382('0x1a')]('['+_0x389dbd['toUpperCase']()+_0xd382('0x6a'),_0x53c4f3[_0xd382('0x1d')]);console[_0xd382('0x1a')](_0xd382('0x6b'),_0x53c4f3);});}; \ No newline at end of file +var _0x49cb=['systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','catch','calleridnum','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','Bearer\x20','enduserId','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId','error','lodash','request-promise','util','./util','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','POST','clientId','username','password','access_token','message','then','GET'];(function(_0x251a41,_0x351dad){var _0x1c2d5c=function(_0x15984b){while(--_0x15984b){_0x251a41['push'](_0x251a41['shift']());}};_0x1c2d5c(++_0x351dad);}(_0x49cb,0xc9));var _0xb49c=function(_0x216e1e,_0x5587d0){_0x216e1e=_0x216e1e-0x0;var _0xc109a=_0x49cb[_0x216e1e];return _0xc109a;};'use strict';var _=require(_0xb49c('0x0'));var rp=require(_0xb49c('0x1'));var util=require(_0xb49c('0x2'));var intUtil=require(_0xb49c('0x3'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0xb49c('0x4'))('dynamics365');var config=require(_0xb49c('0x5'));config[_0xb49c('0x6')]=_[_0xb49c('0x7')](config['redis'],{'host':_0xb49c('0x8'),'port':0x18eb});var io=require(_0xb49c('0x9'))(new Redis(config[_0xb49c('0x6')]));function getAuthToken(_0x3203d2,_0x2a8aef,_0x4d2e6f){if(_0x3203d2[_0xb49c('0xa')]){_0x3203d2[_0xb49c('0xb')]=_0x3203d2[_0xb49c('0xc')][_0xb49c('0xd')];_0x3203d2[_0xb49c('0xe')]=_0x3203d2['CloudProvider']['data2'];return Promise['resolve'](_0x3203d2[_0xb49c('0xc')]['data5']);}var _0x2c8f7b={'method':_0xb49c('0xf'),'uri':_0x2a8aef,'form':{'client_id':_0x3203d2[_0xb49c('0x10')],'resource':_0x3203d2[_0xb49c('0xb')],'username':_0x3203d2[_0xb49c('0x11')],'password':_0x3203d2[_0xb49c('0x12')],'grant_type':_0xb49c('0x12'),'client_secret':_0x3203d2['clientSecret']},'json':!![]};return rp(_0x2c8f7b)['then'](function(_0x523937){return _0x523937[_0xb49c('0x13')];})['catch'](function(_0x1f782b){logger['error']('['+[_0x4d2e6f['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x1f782b[_0xb49c('0x14')];});}function getUser(_0x1a10cd,_0x1e227d,_0x5795c4,_0x2ff5ae,_0x5c8524,_0x21b990){return new Promise(function(_0x2b89e8,_0xf9e46a){return getAuthToken(_0x1e227d,_0x2ff5ae,_0x21b990)[_0xb49c('0x15')](function(_0x550bf8){var _0x35a694={'method':_0xb49c('0x16'),'uri':_0x5c8524+_0xb49c('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x550bf8,'OData-Version':_0xb49c('0x18')},'json':!![]};return rp(_0x35a694);})[_0xb49c('0x15')](function(_0x1f8e5d){var _0x44ea68=_0x1f8e5d['value'];var _0x3dae51=![];var _0x1b069c=null;if(!_[_0xb49c('0x19')](_0x5795c4)){if(intUtil[_0xb49c('0x1a')](_0x5795c4[_0xb49c('0x1b')])){_0x1a10cd[_0xb49c('0x1c')]=_0x5795c4['email'];for(_0x1b069c=0x0;_0x1b069c<_0x44ea68[_0xb49c('0x1d')];_0x1b069c++){if(_0x44ea68[_0x1b069c][_0xb49c('0x1e')]===_0x5795c4[_0xb49c('0x1b')]&&!_0x44ea68[_0x1b069c][_0xb49c('0x1f')]){_0x3dae51=!![];logger[_0xb49c('0x20')]('['+[_0x21b990[_0xb49c('0x21')]()]+_0xb49c('0x22')+_0x44ea68[_0x1b069c][_0xb49c('0x23')]+'!');_0x1a10cd[_0xb49c('0x24')]=_0x44ea68[_0x1b069c]['systemuserid'];}}}}if(!_0x3dae51){logger[_0xb49c('0x20')]('['+[_0x21b990[_0xb49c('0x21')]()]+_0xb49c('0x25'));_0x1a10cd[_0xb49c('0x1c')]=_0x1e227d[_0xb49c('0x11')];for(_0x1b069c=0x0;_0x1b069c<_0x44ea68[_0xb49c('0x1d')];_0x1b069c++){if(_0x44ea68[_0x1b069c][_0xb49c('0x1e')]===_0x1e227d[_0xb49c('0x11')]){_0x1a10cd[_0xb49c('0x24')]=_0x44ea68[_0x1b069c][_0xb49c('0x23')];}}}_0x2b89e8(_0x1a10cd);})['catch'](function(_0x2de711){_0xf9e46a(_0x2de711['message']);});});}function createEndUser(_0xa9eabb,_0x43a446,_0xc76de5,_0x511d3f,_0x1b55b7,_0x586ffd,_0x2b0705){return new Promise(function(_0x222504,_0x10795a){return getAuthToken(_0x43a446,_0xc76de5,_0x586ffd)[_0xb49c('0x15')](function(_0x2911e6){var _0x313a6f=_0x586ffd[_0xb49c('0x26')]()===_0xb49c('0x27')?_0x1b55b7[_0xb49c('0x28')]:_0x1b55b7['calleridnum'];var _0x212a25={'method':_0xb49c('0xf'),'uri':_0x511d3f+_0xb49c('0x29'),'body':{'fullname':_0x313a6f,'firstname':_0x313a6f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb49c('0x2a')+_0xa9eabb[_0xb49c('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2911e6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x212a25[_0xb49c('0x2b')][_0x2b0705]=_0x313a6f;return rp(_0x212a25);})[_0xb49c('0x15')](function(_0x5860bf){var _0x32afc1=_0x5860bf[_0xb49c('0x2c')][_0xb49c('0x2d')];var _0x14fe5c=_0x32afc1[_0xb49c('0x2e')](_0x32afc1[_0xb49c('0x2f')]('(')+0x1,_0x32afc1[_0xb49c('0x2f')](')'));_0xa9eabb['enduserId']=_0x14fe5c;_0x222504(_0xa9eabb);})[_0xb49c('0x30')](function(_0x580235){_0x10795a(_0x580235[_0xb49c('0x14')]);});});}function getEndUser(_0x50aec6,_0x5e81a3,_0x5052bb,_0x2929e5,_0x2c4769,_0x4de55,_0x297d58,_0x3e3b69){var _0x462256=_0x4de55[_0xb49c('0x26')]()===_0xb49c('0x27')?_0x2c4769['destcalleridnum']:_0x2c4769[_0xb49c('0x31')];return getAuthToken(_0x5e81a3,_0x5052bb,_0x4de55)[_0xb49c('0x15')](function(_0x51bcb5){_0x3e3b69=_0x3e3b69?_0x3e3b69:_0xb49c('0x32');var _0x2b0a03={'method':_0xb49c('0x16'),'uri':_0x2929e5+'contacts?$select='+_0x3e3b69+_0xb49c('0x33')+_0x3e3b69+_0xb49c('0x34')+_0x462256[_0xb49c('0x35')]('+',_0xb49c('0x36'))+'\x27','headers':{'Authorization':_0xb49c('0x37')+_0x51bcb5,'If-None-Match':null,'OData-Version':_0xb49c('0x18')},'json':!![]};return rp(_0x2b0a03);})[_0xb49c('0x15')](function(_0x36c8c7){var _0x1d0969=![];if(!_0x36c8c7)return _0x1d0969;var _0x3c52a8=_0x36c8c7['value'];for(var _0x2af077=0x0;_0x2af077<_0x3c52a8[_0xb49c('0x1d')];_0x2af077++){if(_0x3c52a8[_0x2af077][_0x3e3b69]===_0x462256){_0x1d0969=!![];_0x50aec6[_0xb49c('0x38')]=_0x3c52a8[_0x2af077][_0xb49c('0x39')];}}return _0x1d0969;})['then'](function(_0x2e5697){if(_0x2e5697)return _0x50aec6;if(_0x297d58==='nothing'){logger[_0xb49c('0x20')]('['+[_0x4de55[_0xb49c('0x21')]()]+_0xb49c('0x3a'));return _0x50aec6;}return createEndUser(_0x50aec6,_0x5e81a3,_0x5052bb,_0x2929e5,_0x2c4769,_0x4de55,_0x3e3b69)[_0xb49c('0x15')](function(_0x44979e){logger[_0xb49c('0x20')]('['+[_0x4de55['toUpperCase']()]+_0xb49c('0x3b'),_0x44979e[_0xb49c('0x38')]);return _0x44979e;});});}function getCustomFields(_0x3fc6ab,_0x41902a,_0x13c306){var _0x2f450b={};if(_0x3fc6ab[_0xb49c('0x1d')]>0x0){_[_0xb49c('0x3c')](_0x3fc6ab,function(_0x2d1d49){if(_[_0xb49c('0x3d')]([_0xb49c('0x3e'),'picklist'],_0x2d1d49[_0xb49c('0x3f')])&&_0x2d1d49[_0xb49c('0x40')]&&!_0x2d1d49[_0xb49c('0x41')]){var _0x59e127=_0x2d1d49[_0xb49c('0x42')][_0xb49c('0x26')]();var _0x3c6029=_0x59e127[_0xb49c('0x2e')](0x0,_0x59e127[_0xb49c('0x43')]('_'));var _0x4736fa=_0x59e127['substring'](_0x59e127[_0xb49c('0x43')]('_')+0x1);if(_0x3c6029===_0x13c306){_0x2f450b[_0x4736fa]=_0x2d1d49[_0xb49c('0x44')];}}});}return _0x2f450b;}function getTicket(_0x2a1bf9,_0x23291a,_0x334931,_0x1f40dc,_0x305deb,_0x75ec1f,_0x51cc64){return new Promise(function(_0x18c6f8,_0x3a5d01){var _0x2fd753;return getAuthToken(_0x23291a,_0x334931,_0x51cc64)[_0xb49c('0x15')](function(_0x5915ee){if(_0x75ec1f[_0xb49c('0x45')]===_0xb49c('0x46')){_0x2fd753={'method':'POST','uri':_0x1f40dc+_0xb49c('0x47'),'body':Object[_0xb49c('0x48')]({},{'title':intUtil[_0xb49c('0x49')](_0x75ec1f[_0xb49c('0x4a')],_0x305deb,'\x20'),'description':intUtil[_0xb49c('0x49')](_0x75ec1f[_0xb49c('0x4b')],_0x305deb,'\x0a'),'customerid_contact@odata.bind':_0x2a1bf9[_0xb49c('0x38')]?'/contacts('+_0x2a1bf9[_0xb49c('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2a1bf9['userId']+')','caseorigincode':'1'},getCustomFields(_0x75ec1f[_0xb49c('0x4c')],_0x305deb,_0x75ec1f[_0xb49c('0x45')])),'headers':{'Authorization':_0xb49c('0x37')+_0x5915ee,'OData-Version':_0xb49c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x75ec1f[_0xb49c('0x45')]===_0xb49c('0x4d')){var _0x1afa31=_0x2a1bf9[_0xb49c('0x38')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2a1bf9[_0xb49c('0x24')]+')','participationtypemask':_0x2a1bf9[_0xb49c('0x4e')]===_0xb49c('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0xb49c('0x50')+_0x2a1bf9[_0xb49c('0x38')]+')','participationtypemask':_0x2a1bf9['callDirection']===_0xb49c('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb49c('0x2a')+_0x2a1bf9[_0xb49c('0x24')]+')','participationtypemask':_0x2a1bf9[_0xb49c('0x4e')]===_0xb49c('0x4f')?0x2:0x1}];_0x2fd753={'method':_0xb49c('0xf'),'uri':_0x1f40dc+_0xb49c('0x51'),'body':Object[_0xb49c('0x48')]({},{'subject':intUtil['getString'](_0x75ec1f[_0xb49c('0x4a')],_0x305deb,'\x20'),'phonenumber':String(_0x305deb[_0xb49c('0x31')]),'description':intUtil['getString'](_0x75ec1f[_0xb49c('0x4b')],_0x305deb,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2a1bf9[_0xb49c('0x38')]?_0xb49c('0x50')+_0x2a1bf9[_0xb49c('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2a1bf9[_0xb49c('0x24')]+')','directioncode':_0x2a1bf9['callDirection']===_0xb49c('0x4f')?![]:!![],'phonecall_activity_parties':_0x1afa31},getCustomFields(_0x75ec1f[_0xb49c('0x4c')],_0x305deb,_0x75ec1f['ticketType'])),'headers':{'Authorization':_0xb49c('0x37')+_0x5915ee,'OData-Version':_0xb49c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2fd753);})['then'](function(_0x3356fb){var _0x1a029d=_0x3356fb[_0xb49c('0x2c')][_0xb49c('0x2d')];var _0x3cd8f2=_0x1a029d[_0xb49c('0x2e')](_0x1a029d[_0xb49c('0x2f')]('(')+0x1,_0x1a029d[_0xb49c('0x2f')](')'));_0x2a1bf9['ticketId']=_0x3cd8f2;_0x18c6f8(_0x2a1bf9);})['catch'](function(_0x529b6d){_0x3a5d01(_0x529b6d[_0xb49c('0x14')]);});});}function emit(_0x5706ae,_0x142342,_0x1d85d9,_0x4547d3){var _0x1e5775={'uri':util['format'](_0xb49c('0x52'),_0x5706ae,_0x1d85d9,_0x4547d3)};io['to'](util['format'](_0xb49c('0x53'),_0x142342))[_0xb49c('0x54')](_0xb49c('0x55'),_0x1e5775);}exports['cs']=function(_0xc610b5,_0x44eb3f,_0x254c46,_0x2fc07d,_0x18da17,_0x151b9d,_0x416ec3,_0x551122){var _0x5cb7ab={};_0x151b9d[_0xb49c('0xb')]=_0x151b9d[_0xb49c('0xa')]?intUtil['stripTrailingSlash'](_0x151b9d[_0xb49c('0xc')][_0xb49c('0xd')]):intUtil[_0xb49c('0x56')](_0x151b9d[_0xb49c('0xb')]);_0x151b9d[_0xb49c('0x57')]=intUtil['stripTrailingSlash'](_0x151b9d['serverUrl']);_0x5cb7ab[_0xb49c('0x4e')]=_0x551122===_0xb49c('0x4f')||_0x551122===_0xb49c('0x58')?_0xb49c('0x4f'):'outbound';var _0x1df2ec=_0x151b9d[_0xb49c('0xa')]?util[_0xb49c('0x59')]('%s/api/data/v9.0/',_0x151b9d[_0xb49c('0xc')][_0xb49c('0xd')]):util['format'](_0xb49c('0x5a'),_0x151b9d[_0xb49c('0xb')]);var _0x55e058=util['format'](_0xb49c('0x5b'),_0x151b9d['tenantId']);var _0x32f00a=util[_0xb49c('0x59')](_0xb49c('0x5c'),_0x151b9d['serverUrl'],_0x44eb3f['uniqueid'],md5(_0x44eb3f['uniqueid']));if(_0x18da17&&_0x18da17[_0xb49c('0x5d')]){logger[_0xb49c('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x44eb3f['recordingURL']=_0x32f00a;}else if(_0x416ec3&&_0x416ec3[_0xb49c('0x5e')]&&_0x416ec3[_0xb49c('0x5e')]!==_0xb49c('0x5f')){logger['info'](_0xb49c('0x60'),_0xb49c('0x61'));_0x44eb3f[_0xb49c('0x62')]=_0x32f00a;}else{_0x44eb3f['recordingURL']='';}return getUser(_0x5cb7ab,_0x151b9d,_0x2fc07d,_0x55e058,_0x1df2ec,_0x551122)[_0xb49c('0x15')](function(_0x5a1cff){logger[_0xb49c('0x20')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x63'),_0x5a1cff['userId']);logger[_0xb49c('0x20')]('['+_0x551122['toUpperCase']()+_0xb49c('0x64'),_0x5a1cff[_0xb49c('0x1c')]);return getEndUser(_0x5a1cff,_0x151b9d,_0x55e058,_0x1df2ec,_0x44eb3f,_0x551122,_0x254c46[_0xb49c('0x65')],_0x254c46[_0xb49c('0x66')]);})[_0xb49c('0x15')](function(_0x1b4e52){logger[_0xb49c('0x20')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x67'),_0x1b4e52[_0xb49c('0x38')]);logger['info']('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x68'),_0x44eb3f['calleridnum']);return getTicket(_0x1b4e52,_0x151b9d,_0x55e058,_0x1df2ec,_0x44eb3f,_0x254c46,_0x551122);})['then'](function(_0xae48bb){logger[_0xb49c('0x20')](util[_0xb49c('0x59')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x69'),_0x254c46[_0xb49c('0x45')],_0xae48bb['ticketId']));logger['info'](util[_0xb49c('0x59')]('['+_0x551122[_0xb49c('0x21')]()+_0xb49c('0x6a'),_0x551122));if(_0x551122!==_0xb49c('0x58')&&_0x254c46[_0xb49c('0x6b')]){logger[_0xb49c('0x20')]('['+_0x551122[_0xb49c('0x21')]()+']',_0xb49c('0x6c'));emit(_0x151b9d[_0xb49c('0xb')],_0x2fc07d[_0xb49c('0x6d')],_0x254c46[_0xb49c('0x45')],_0xae48bb[_0xb49c('0x6e')]);}})[_0xb49c('0x30')](function(_0x2f8c34){logger[_0xb49c('0x6f')]('['+_0x551122[_0xb49c('0x21')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2f8c34[_0xb49c('0x14')]);console[_0xb49c('0x6f')]('Error\x20running\x20Dynamics365\x20integration',_0x2f8c34);});}; \ 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 47a842d..592087e 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 _0x443c=['The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','merge','format','Caller\x20-\x20%s','calleridname','getString','Descriptions','Tags','Fields','custom_fields','mapValues','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','Agent\x20found!','contact','email','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','type','idField','push','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x443c,0xcc));var _0xc443=function(_0x362ce4,_0x5cfa56){_0x362ce4=_0x362ce4-0x0;var _0x18dcb0=_0x443c[_0x362ce4];return _0x18dcb0;};'use strict';var _=require(_0xc443('0x0'));var rp=require(_0xc443('0x1'));var md5=require(_0xc443('0x2'));var util=require(_0xc443('0x3'));var Redis=require(_0xc443('0x4'));var intUtil=require(_0xc443('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc443('0x6'))('freshdesk');config[_0xc443('0x7')]=_[_0xc443('0x8')](config[_0xc443('0x7')],{'host':_0xc443('0x9'),'port':0x18eb});var io=require(_0xc443('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xc443('0xb'),'Accept':_0xc443('0xb')};function emit(_0xd70def,_0x16dae9,_0x469d2e){io['to'](_0xd70def)['emit'](_0x16dae9,_0x469d2e);}function getTicket(_0xb07850,_0x437114,_0x39af77,_0x1f77c1,_0x43d1a5){logger[_0xc443('0xc')]('Creating\x20new\x20ticket...');var _0x15679d=_[_0xc443('0xd')]({'responder_id':_0x437114['id'],'requester_id':_0x39af77['id'],'name':util[_0xc443('0xe')](_0xc443('0xf'),_0x43d1a5[_0xc443('0x10')]),'phone':_0x43d1a5['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc443('0x11')](_0x1f77c1['Subjects'],_0x43d1a5,'\x20'),'description':intUtil[_0xc443('0x11')](_0x1f77c1[_0xc443('0x12')],_0x43d1a5,'
'),'tags':getTags(_0x1f77c1[_0xc443('0x13')],'name')},getCustomFields(_0x1f77c1[_0xc443('0x14')],_0x43d1a5));_0x15679d[_0xc443('0x15')]=_[_0xc443('0x16')](_['keyBy'](_0x15679d[_0xc443('0x15')],'id'),'value');return request({'uri':util[_0xc443('0xe')](_0xc443('0x17'),_0xb07850['remoteUri']),'method':_0xc443('0x18'),'body':_0x15679d})[_0xc443('0x19')](function(_0x38eda6){logger[_0xc443('0xc')](_0xc443('0x1a'));return _0x38eda6;});}function getUser(_0xb576c,_0x2e56d5){if(intUtil[_0xc443('0x1b')](_0x2e56d5)){return request({'uri':util['format']('%s/api/v2/agents',_0xb576c['remoteUri']),'qs':{'email':_0x2e56d5}})[_0xc443('0x19')](function(_0x2f537d){if(_0x2f537d['length']){logger[_0xc443('0xc')](_0xc443('0x1c'));return _['find'](_0x2f537d,function(_0x32b48c){return _0x32b48c[_0xc443('0x1d')][_0xc443('0x1e')]===_0x2e56d5;});}else{logger[_0xc443('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc443('0xe')](_0xc443('0x1f'),_0xb576c[_0xc443('0x20')])})[_0xc443('0x19')](function(_0x19f1ab){logger['info']('Admin\x20account\x20selected.');return _0x19f1ab;});}});}else{logger[_0xc443('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc443('0xe')](_0xc443('0x1f'),_0xb576c[_0xc443('0x20')])})[_0xc443('0x19')](function(_0x3e5d7e){logger['info'](_0xc443('0x21'));return _0x3e5d7e;});}}function getEndUser(_0x39ad1d,_0xfe7c8b,_0x50061e){logger['info'](_0xc443('0x22'),_0x50061e);return request({'uri':util[_0xc443('0xe')](_0xc443('0x23'),_0x39ad1d[_0xc443('0x20')]),'qs':{'phone':_0x50061e}})[_0xc443('0x19')](function(_0x254b78){if(_0x254b78[_0xc443('0x24')]){logger['info'](_0xc443('0x25'));return _[_0xc443('0x26')](_0x254b78,{'phone':_0x50061e});}else{logger[_0xc443('0xc')](_0xc443('0x27'));return request({'uri':util[_0xc443('0xe')](_0xc443('0x23'),_0x39ad1d[_0xc443('0x20')]),'method':_0xc443('0x18'),'body':{'name':_0xfe7c8b,'phone':_0x50061e}})['then'](function(_0x44f7c5){logger[_0xc443('0xc')](_0xc443('0x28'));return _0x44f7c5;});}});}function getAuth(_0x4c9d3d){return util['format'](_0xc443('0x29'),new Buffer(_0x4c9d3d[_0xc443('0x2a')]+':X')[_0xc443('0x2b')](_0xc443('0x2c')));}function request(_0x371803){logger[_0xc443('0x2d')](_0xc443('0x2e'),JSON[_0xc443('0x2f')](_0x371803));return rp(_[_0xc443('0x8')](_0x371803,{'method':_0xc443('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x52469d,_0x12e1ed){var _0x5b0aba=[];if(_0x52469d&&_0x52469d[_0xc443('0x24')]>0x0){_0x5b0aba=_[_0xc443('0x31')](_0x52469d,_0x12e1ed);}return _0x5b0aba;}function getCustomFields(_0x584ea5,_0x30367f){var _0x5b755f=[];var _0x375b73={'custom_fields':[]};if(_0x584ea5['length']>0x0){_[_0xc443('0x32')](_0x584ea5,function(_0x374cb8){if(_[_0xc443('0x33')]([_0xc443('0x34'),_0xc443('0x35')],_0x374cb8['type'])&&_0x374cb8[_0xc443('0x36')]&&!_0x374cb8[_0xc443('0x37')]){_0x375b73[_0x374cb8['nameField']['toLowerCase']()]=_0x374cb8['content']['toString']();}else if(_[_0xc443('0x33')](['string','picklist'],_0x374cb8[_0xc443('0x38')])&&_0x374cb8[_0xc443('0x39')]&&_0x374cb8[_0xc443('0x37')]){_0x375b73[_0xc443('0x15')][_0xc443('0x3a')]({'id':_0x374cb8[_0xc443('0x39')],'value':_0x374cb8['content'][_0xc443('0x2b')]()});}else if(_0x374cb8['type']===_0xc443('0x3b')&&_0x374cb8['variableName']&&_0x374cb8[_0xc443('0x39')]&&_0x374cb8[_0xc443('0x37')]){_0x30367f[_0x374cb8[_0xc443('0x3c')]]&&_0x375b73[_0xc443('0x15')]['push']({'id':_0x374cb8[_0xc443('0x39')],'value':_0x30367f[_0x374cb8['variableName']][_0xc443('0x2b')]()});}else if(_0x374cb8[_0xc443('0x38')]===_0xc443('0x3d')&&_0x374cb8[_0xc443('0x3e')]&&_0x374cb8['Variable'][_0xc443('0x3f')]&&_0x374cb8[_0xc443('0x39')]&&_0x374cb8['customField']){_0x30367f[_0x374cb8[_0xc443('0x3e')][_0xc443('0x3f')][_0xc443('0x40')]()]&&_0x375b73['custom_fields'][_0xc443('0x3a')]({'id':_0x374cb8[_0xc443('0x39')],'value':_0x30367f[_0x374cb8[_0xc443('0x3e')]['name'][_0xc443('0x40')]()]['toString']()});}});}return _0x375b73;}exports[_0xc443('0x41')]=function(_0x5a25de,_0x4e8cf9,_0x151f6e,_0x1a5ec4,_0x5a4ec7,_0x5c7394){var _0x21539d,_0xf37cf4;_0x5c7394[_0xc443('0x20')]=intUtil[_0xc443('0x42')](_0x5c7394[_0xc443('0x20')]);_0x5c7394[_0xc443('0x43')]=intUtil[_0xc443('0x42')](_0x5c7394['serverUrl']);if(_0x5a4ec7&&_0x5a4ec7[_0xc443('0x44')]){logger[_0xc443('0xc')](_0xc443('0x45'),_0xc443('0x46'));_0x4e8cf9[_0xc443('0x47')]=util['format'](_0xc443('0x48'),_0x5c7394[_0xc443('0x43')],_0x4e8cf9['uniqueid'],md5(_0x4e8cf9[_0xc443('0x49')]));}else{_0x4e8cf9[_0xc443('0x47')]='';}headers[_0xc443('0x4a')]=getAuth(_0x5c7394);return getUser(_0x5c7394,_0x1a5ec4[_0xc443('0x1e')])[_0xc443('0x19')](function(_0x26f189){_0x21539d=_0x26f189;logger['info'](_0xc443('0x4b'),_0x21539d['id']);return getEndUser(_0x5c7394,_0x4e8cf9[_0xc443('0x10')],_0x4e8cf9[_0xc443('0x4c')]);})[_0xc443('0x19')](function(_0x1e19ec){_0xf37cf4=_0x1e19ec;logger[_0xc443('0xc')](_0xc443('0x4d'),_0xf37cf4['id']);return getTicket(_0x5c7394,_0x21539d,_0xf37cf4,_0x151f6e,_0x4e8cf9);})[_0xc443('0x19')](function(_0x4a323b){if(_0x4a323b&&_0x4a323b['id']){logger[_0xc443('0xc')](_0xc443('0x1a'));logger[_0xc443('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4a323b['id']);logger[_0xc443('0xc')](_0xc443('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc443('0xe')](_0xc443('0x4e'),_0x1a5ec4[_0xc443('0x3f')]),_0xc443('0x4f'),{'uri':util[_0xc443('0xe')](_0xc443('0x50'),_0x5c7394[_0xc443('0x20')],_0x4a323b['id'])});}})[_0xc443('0x51')](function(_0x138a4e){logger[_0xc443('0x52')]('[QUEUE]',JSON[_0xc443('0x2f')](_0x138a4e));});};exports[_0xc443('0x53')]=function(_0x183648,_0x3ba131,_0x13e1df,_0x5e051c,_0x1f6be5,_0x204502,_0x1d719b){var _0x201a87,_0x35318a;_0x204502[_0xc443('0x20')]=intUtil['stripTrailingSlash'](_0x204502[_0xc443('0x20')]);_0x204502[_0xc443('0x43')]=intUtil[_0xc443('0x42')](_0x204502[_0xc443('0x43')]);if(_0x1d719b&&_0x1d719b['recordingFormat']&&_0x1d719b[_0xc443('0x54')]!==_0xc443('0x55')){logger[_0xc443('0xc')](_0xc443('0x56'),_0xc443('0x46'));_0x3ba131[_0xc443('0x47')]=util[_0xc443('0xe')](_0xc443('0x48'),_0x204502[_0xc443('0x43')],_0x3ba131[_0xc443('0x49')],md5(_0x3ba131[_0xc443('0x49')]));}headers[_0xc443('0x4a')]=getAuth(_0x204502);return getUser(_0x204502,_0x5e051c[_0xc443('0x1e')])[_0xc443('0x19')](function(_0xc14721){_0x201a87=_0xc14721;logger['info'](_0xc443('0x4b'),_0x201a87['id']);return getEndUser(_0x204502,_0x3ba131[_0xc443('0x57')],_0x3ba131[_0xc443('0x58')]);})[_0xc443('0x19')](function(_0xb7209){_0x35318a=_0xb7209;logger[_0xc443('0xc')](_0xc443('0x4d'),_0x35318a['id']);return getTicket(_0x204502,_0x201a87,_0x35318a,_0x13e1df,_0x3ba131);})[_0xc443('0x19')](function(_0x20c6c3){if(_0x20c6c3&&_0x20c6c3['id']){logger['info']('Ticket\x20created!');logger['info'](_0xc443('0x59'),_0x20c6c3['id']);logger[_0xc443('0xc')](_0xc443('0x56'),_0xc443('0x5a'));emit(util[_0xc443('0xe')](_0xc443('0x4e'),_0x5e051c['name']),'trigger:browser:url',{'uri':util[_0xc443('0xe')](_0xc443('0x50'),_0x204502[_0xc443('0x20')],_0x20c6c3['id'])});}})[_0xc443('0x51')](function(_0x30efaf){logger['error']('[OUTBOUND]',JSON[_0xc443('0x2f')](_0x30efaf));});};exports['unmanaged']=function(_0x5cefe1,_0xd447a0,_0x54dbe7,_0x27fcd6,_0x4db1e2,_0x534b76){var _0x17ef37,_0x32009b;_0x534b76[_0xc443('0x20')]=intUtil[_0xc443('0x42')](_0x534b76['remoteUri']);_0x534b76['serverUrl']=intUtil[_0xc443('0x42')](_0x534b76[_0xc443('0x43')]);if(_0x4db1e2&&_0x4db1e2['monitor_format']){logger[_0xc443('0xc')]('['+_0xd447a0[_0xc443('0x5b')][_0xc443('0x5c')]()+']','Recording\x20is\x20enabled!');_0xd447a0[_0xc443('0x47')]=util[_0xc443('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x534b76['serverUrl'],_0xd447a0[_0xc443('0x49')],md5(_0xd447a0[_0xc443('0x49')]));}else{_0xd447a0['recordingURL']='';}headers[_0xc443('0x4a')]=getAuth(_0x534b76);return getUser(_0x534b76,'')[_0xc443('0x19')](function(_0x568843){_0x17ef37=_0x568843;logger[_0xc443('0xc')](_0xc443('0x4b'),_0x17ef37['id']);return getEndUser(_0x534b76,_0xd447a0['calleridname'],_0xd447a0[_0xc443('0x4c')]);})[_0xc443('0x19')](function(_0x5e8cbf){_0x32009b=_0x5e8cbf;logger[_0xc443('0xc')](_0xc443('0x4d'),_0x32009b['id']);return getTicket(_0x534b76,_0x17ef37,_0x32009b,_0x54dbe7,_0xd447a0);})[_0xc443('0x19')](function(_0x27fee8){if(_0x27fee8){logger[_0xc443('0xc')](_0xc443('0x1a'));logger[_0xc443('0xc')]('The\x20Ticket\x20ID\x20is:',_0x27fee8['id']);}})[_0xc443('0x51')](function(_0x5f54e5){logger[_0xc443('0x52')]('['+_0xd447a0[_0xc443('0x5b')][_0xc443('0x5c')]()+']',JSON['stringify'](_0x5f54e5));});}; \ No newline at end of file +var _0xcca5=['user:%s','%s/helpdesk/tickets/%d','catch','error','stringify','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','base64','[HTTP]','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','toString','idField','variable','variableName','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xcca5,0x1e3));var _0x5cca=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0xcca5[_0x20118a];return _0x538b5f;};'use strict';var _=require(_0x5cca('0x0'));var rp=require('request-promise');var md5=require(_0x5cca('0x1'));var util=require('util');var Redis=require(_0x5cca('0x2'));var intUtil=require(_0x5cca('0x3'));var config=require(_0x5cca('0x4'));var logger=require(_0x5cca('0x5'))(_0x5cca('0x6'));config[_0x5cca('0x7')]=_[_0x5cca('0x8')](config[_0x5cca('0x7')],{'host':_0x5cca('0x9'),'port':0x18eb});var io=require(_0x5cca('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x5cca('0xb'),'Accept':_0x5cca('0xb')};function emit(_0xae039b,_0x40824f,_0x30bde1){io['to'](_0xae039b)[_0x5cca('0xc')](_0x40824f,_0x30bde1);}function getTicket(_0x3e630d,_0x52e856,_0x41fbb2,_0x64a1da,_0x19a805){logger[_0x5cca('0xd')]('Creating\x20new\x20ticket...');var _0x521b7e=_['merge']({'responder_id':_0x52e856['id'],'requester_id':_0x41fbb2['id'],'name':util[_0x5cca('0xe')](_0x5cca('0xf'),_0x19a805[_0x5cca('0x10')]),'phone':_0x19a805[_0x5cca('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5cca('0x12')](_0x64a1da[_0x5cca('0x13')],_0x19a805,'\x20'),'description':intUtil[_0x5cca('0x12')](_0x64a1da[_0x5cca('0x14')],_0x19a805,_0x5cca('0x15')),'tags':getTags(_0x64a1da[_0x5cca('0x16')],'name')},getCustomFields(_0x64a1da[_0x5cca('0x17')],_0x19a805));_0x521b7e[_0x5cca('0x18')]=_[_0x5cca('0x19')](_[_0x5cca('0x1a')](_0x521b7e[_0x5cca('0x18')],'id'),_0x5cca('0x1b'));return request({'uri':util['format'](_0x5cca('0x1c'),_0x3e630d[_0x5cca('0x1d')]),'method':_0x5cca('0x1e'),'body':_0x521b7e})[_0x5cca('0x1f')](function(_0x17abf3){logger[_0x5cca('0xd')](_0x5cca('0x20'));return _0x17abf3;});}function getUser(_0x5727e,_0x3bb500){if(intUtil['validateEmail'](_0x3bb500)){return request({'uri':util['format'](_0x5cca('0x21'),_0x5727e[_0x5cca('0x1d')]),'qs':{'email':_0x3bb500}})[_0x5cca('0x1f')](function(_0x41771f){if(_0x41771f[_0x5cca('0x22')]){logger[_0x5cca('0xd')](_0x5cca('0x23'));return _[_0x5cca('0x24')](_0x41771f,function(_0x4a56d4){return _0x4a56d4[_0x5cca('0x25')][_0x5cca('0x26')]===_0x3bb500;});}else{logger[_0x5cca('0xd')](_0x5cca('0x27'));return request({'uri':util[_0x5cca('0xe')](_0x5cca('0x28'),_0x5727e[_0x5cca('0x1d')])})[_0x5cca('0x1f')](function(_0x45e060){logger[_0x5cca('0xd')]('Admin\x20account\x20selected.');return _0x45e060;});}});}else{logger['info'](_0x5cca('0x29'));return request({'uri':util[_0x5cca('0xe')](_0x5cca('0x28'),_0x5727e[_0x5cca('0x1d')])})['then'](function(_0x255b0e){logger[_0x5cca('0xd')]('Admin\x20account\x20selected.');return _0x255b0e;});}}function getEndUser(_0x5d7823,_0x42cd09,_0x3de3b7){logger[_0x5cca('0xd')](_0x5cca('0x2a'),_0x3de3b7);return request({'uri':util[_0x5cca('0xe')](_0x5cca('0x2b'),_0x5d7823[_0x5cca('0x1d')]),'qs':{'phone':_0x3de3b7}})[_0x5cca('0x1f')](function(_0x31e2bd){if(_0x31e2bd[_0x5cca('0x22')]){logger[_0x5cca('0xd')](_0x5cca('0x2c'));return _[_0x5cca('0x24')](_0x31e2bd,{'phone':_0x3de3b7});}else{logger[_0x5cca('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x5cca('0x2b'),_0x5d7823[_0x5cca('0x1d')]),'method':_0x5cca('0x1e'),'body':{'name':_0x42cd09,'phone':_0x3de3b7}})[_0x5cca('0x1f')](function(_0x35a064){logger[_0x5cca('0xd')](_0x5cca('0x2d'));return _0x35a064;});}});}function getAuth(_0x45a5f2){return util[_0x5cca('0xe')](_0x5cca('0x2e'),new Buffer(_0x45a5f2[_0x5cca('0x2f')]+':X')['toString'](_0x5cca('0x30')));}function request(_0x2a5146){logger['debug'](_0x5cca('0x31'),JSON['stringify'](_0x2a5146));return rp(_['defaults'](_0x2a5146,{'method':_0x5cca('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4cc9b7,_0x22ee5e){var _0xaa0118=[];if(_0x4cc9b7&&_0x4cc9b7['length']>0x0){_0xaa0118=_[_0x5cca('0x33')](_0x4cc9b7,_0x22ee5e);}return _0xaa0118;}function getCustomFields(_0x40413c,_0x57d129){var _0x22c181=[];var _0x54d8b0={'custom_fields':[]};if(_0x40413c['length']>0x0){_[_0x5cca('0x34')](_0x40413c,function(_0xd40bae){if(_[_0x5cca('0x35')]([_0x5cca('0x36'),'picklist'],_0xd40bae[_0x5cca('0x37')])&&_0xd40bae[_0x5cca('0x38')]&&!_0xd40bae[_0x5cca('0x39')]){_0x54d8b0[_0xd40bae[_0x5cca('0x38')][_0x5cca('0x3a')]()]=_0xd40bae['content'][_0x5cca('0x3b')]();}else if(_[_0x5cca('0x35')](['string','picklist'],_0xd40bae['type'])&&_0xd40bae[_0x5cca('0x3c')]&&_0xd40bae[_0x5cca('0x39')]){_0x54d8b0['custom_fields']['push']({'id':_0xd40bae[_0x5cca('0x3c')],'value':_0xd40bae['content'][_0x5cca('0x3b')]()});}else if(_0xd40bae[_0x5cca('0x37')]===_0x5cca('0x3d')&&_0xd40bae[_0x5cca('0x3e')]&&_0xd40bae['idField']&&_0xd40bae[_0x5cca('0x39')]){_0x57d129[_0xd40bae[_0x5cca('0x3e')]]&&_0x54d8b0[_0x5cca('0x18')][_0x5cca('0x3f')]({'id':_0xd40bae[_0x5cca('0x3c')],'value':_0x57d129[_0xd40bae[_0x5cca('0x3e')]][_0x5cca('0x3b')]()});}else if(_0xd40bae[_0x5cca('0x37')]===_0x5cca('0x40')&&_0xd40bae[_0x5cca('0x41')]&&_0xd40bae[_0x5cca('0x41')][_0x5cca('0x42')]&&_0xd40bae[_0x5cca('0x3c')]&&_0xd40bae[_0x5cca('0x39')]){_0x57d129[_0xd40bae['Variable'][_0x5cca('0x42')][_0x5cca('0x3a')]()]&&_0x54d8b0['custom_fields'][_0x5cca('0x3f')]({'id':_0xd40bae[_0x5cca('0x3c')],'value':_0x57d129[_0xd40bae[_0x5cca('0x41')]['name'][_0x5cca('0x3a')]()][_0x5cca('0x3b')]()});}});}return _0x54d8b0;}exports[_0x5cca('0x43')]=function(_0x54dbc3,_0x478d01,_0x291b48,_0x4b7ad4,_0x29e974,_0x39c951){var _0x459944,_0x4ef1aa;_0x39c951['remoteUri']=intUtil[_0x5cca('0x44')](_0x39c951[_0x5cca('0x1d')]);_0x39c951['serverUrl']=intUtil[_0x5cca('0x44')](_0x39c951[_0x5cca('0x45')]);if(_0x29e974&&_0x29e974[_0x5cca('0x46')]){logger[_0x5cca('0xd')](_0x5cca('0x47'),_0x5cca('0x48'));_0x478d01[_0x5cca('0x49')]=util[_0x5cca('0xe')](_0x5cca('0x4a'),_0x39c951['serverUrl'],_0x478d01['uniqueid'],md5(_0x478d01[_0x5cca('0x4b')]));}else{_0x478d01[_0x5cca('0x49')]='';}headers[_0x5cca('0x4c')]=getAuth(_0x39c951);return getUser(_0x39c951,_0x4b7ad4[_0x5cca('0x26')])[_0x5cca('0x1f')](function(_0x1856d4){_0x459944=_0x1856d4;logger[_0x5cca('0xd')](_0x5cca('0x4d'),_0x459944['id']);return getEndUser(_0x39c951,_0x478d01['calleridname'],_0x478d01[_0x5cca('0x11')]);})[_0x5cca('0x1f')](function(_0x3ff4dc){_0x4ef1aa=_0x3ff4dc;logger[_0x5cca('0xd')](_0x5cca('0x4e'),_0x4ef1aa['id']);return getTicket(_0x39c951,_0x459944,_0x4ef1aa,_0x291b48,_0x478d01);})[_0x5cca('0x1f')](function(_0x3debc4){if(_0x3debc4&&_0x3debc4['id']){logger[_0x5cca('0xd')](_0x5cca('0x20'));logger[_0x5cca('0xd')](_0x5cca('0x4f'),_0x3debc4['id']);logger[_0x5cca('0xd')](_0x5cca('0x47'),_0x5cca('0x50'));emit(util[_0x5cca('0xe')](_0x5cca('0x51'),_0x4b7ad4[_0x5cca('0x42')]),'trigger:browser:url',{'uri':util[_0x5cca('0xe')](_0x5cca('0x52'),_0x39c951[_0x5cca('0x1d')],_0x3debc4['id'])});}})[_0x5cca('0x53')](function(_0x1a8048){logger[_0x5cca('0x54')](_0x5cca('0x47'),JSON[_0x5cca('0x55')](_0x1a8048));});};exports['outbound']=function(_0xf5107c,_0x33082f,_0x330f61,_0x44d9ea,_0x429a6c,_0x1de4ef,_0x3e3738){var _0x316ce5,_0x5a6ebb;_0x1de4ef[_0x5cca('0x1d')]=intUtil['stripTrailingSlash'](_0x1de4ef[_0x5cca('0x1d')]);_0x1de4ef[_0x5cca('0x45')]=intUtil[_0x5cca('0x44')](_0x1de4ef[_0x5cca('0x45')]);if(_0x3e3738&&_0x3e3738['recordingFormat']&&_0x3e3738[_0x5cca('0x56')]!=='none'){logger[_0x5cca('0xd')](_0x5cca('0x57'),_0x5cca('0x48'));_0x33082f['recordingURL']=util[_0x5cca('0xe')](_0x5cca('0x4a'),_0x1de4ef[_0x5cca('0x45')],_0x33082f[_0x5cca('0x4b')],md5(_0x33082f[_0x5cca('0x4b')]));}headers[_0x5cca('0x4c')]=getAuth(_0x1de4ef);return getUser(_0x1de4ef,_0x44d9ea[_0x5cca('0x26')])['then'](function(_0x5d1f61){_0x316ce5=_0x5d1f61;logger[_0x5cca('0xd')](_0x5cca('0x4d'),_0x316ce5['id']);return getEndUser(_0x1de4ef,_0x33082f[_0x5cca('0x58')],_0x33082f[_0x5cca('0x59')]);})[_0x5cca('0x1f')](function(_0x472c28){_0x5a6ebb=_0x472c28;logger[_0x5cca('0xd')](_0x5cca('0x4e'),_0x5a6ebb['id']);return getTicket(_0x1de4ef,_0x316ce5,_0x5a6ebb,_0x330f61,_0x33082f);})[_0x5cca('0x1f')](function(_0x1ed0eb){if(_0x1ed0eb&&_0x1ed0eb['id']){logger[_0x5cca('0xd')](_0x5cca('0x20'));logger[_0x5cca('0xd')](_0x5cca('0x4f'),_0x1ed0eb['id']);logger['info'](_0x5cca('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5cca('0xe')](_0x5cca('0x51'),_0x44d9ea[_0x5cca('0x42')]),_0x5cca('0x5a'),{'uri':util[_0x5cca('0xe')](_0x5cca('0x52'),_0x1de4ef[_0x5cca('0x1d')],_0x1ed0eb['id'])});}})[_0x5cca('0x53')](function(_0x1e3104){logger['error']('[OUTBOUND]',JSON[_0x5cca('0x55')](_0x1e3104));});};exports[_0x5cca('0x5b')]=function(_0x15b7d8,_0xa7c6c0,_0x5ac7d7,_0x1e6cc4,_0xf54798,_0xadd8a3){var _0x2f924f,_0x174a0a;_0xadd8a3[_0x5cca('0x1d')]=intUtil[_0x5cca('0x44')](_0xadd8a3['remoteUri']);_0xadd8a3[_0x5cca('0x45')]=intUtil[_0x5cca('0x44')](_0xadd8a3[_0x5cca('0x45')]);if(_0xf54798&&_0xf54798[_0x5cca('0x46')]){logger[_0x5cca('0xd')]('['+_0xa7c6c0[_0x5cca('0x5c')][_0x5cca('0x5d')]()+']',_0x5cca('0x48'));_0xa7c6c0[_0x5cca('0x49')]=util['format'](_0x5cca('0x4a'),_0xadd8a3[_0x5cca('0x45')],_0xa7c6c0[_0x5cca('0x4b')],md5(_0xa7c6c0[_0x5cca('0x4b')]));}else{_0xa7c6c0[_0x5cca('0x49')]='';}headers[_0x5cca('0x4c')]=getAuth(_0xadd8a3);return getUser(_0xadd8a3,'')[_0x5cca('0x1f')](function(_0x36131e){_0x2f924f=_0x36131e;logger['info'](_0x5cca('0x4d'),_0x2f924f['id']);return getEndUser(_0xadd8a3,_0xa7c6c0[_0x5cca('0x10')],_0xa7c6c0[_0x5cca('0x11')]);})['then'](function(_0x2fe97c){_0x174a0a=_0x2fe97c;logger[_0x5cca('0xd')](_0x5cca('0x4e'),_0x174a0a['id']);return getTicket(_0xadd8a3,_0x2f924f,_0x174a0a,_0x5ac7d7,_0xa7c6c0);})[_0x5cca('0x1f')](function(_0x80d503){if(_0x80d503){logger[_0x5cca('0xd')](_0x5cca('0x20'));logger['info'](_0x5cca('0x4f'),_0x80d503['id']);}})[_0x5cca('0x53')](function(_0x15a480){logger[_0x5cca('0x54')]('['+_0xa7c6c0[_0x5cca('0x5c')][_0x5cca('0x5d')]()+']',JSON[_0x5cca('0x55')](_0x15a480));});}; \ 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 e39d2da..a2795da 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 _0x1c35=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','error','Creating\x20new\x20task','POST','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged'];(function(_0x431c94,_0x535dc5){var _0x2074ce=function(_0x1d99b2){while(--_0x1d99b2){_0x431c94['push'](_0x431c94['shift']());}};_0x2074ce(++_0x535dc5);}(_0x1c35,0x1a9));var _0x51c3=function(_0x51c141,_0x40ac38){_0x51c141=_0x51c141-0x0;var _0x5769c7=_0x1c35[_0x51c141];return _0x5769c7;};'use strict';var _=require(_0x51c3('0x0'));var rp=require(_0x51c3('0x1'));var md5=require(_0x51c3('0x2'));var util=require('util');var moment=require(_0x51c3('0x3'));var Promise=require(_0x51c3('0x4'));var Redis=require(_0x51c3('0x5'));var intUtil=require(_0x51c3('0x6'));var config=require(_0x51c3('0x7'));var logger=require(_0x51c3('0x8'))(_0x51c3('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0x51c3('0xa'),'port':0x18eb});var io=require(_0x51c3('0xb'))(new Redis(config['redis']));function getAdminId(_0x3b7995,_0x25c83d,_0x536f63,_0x485816){return new Promise(function(_0xc22db7,_0x28b35c){var _0x3cb768=![];var _0x3e6b42={'method':_0x51c3('0xc'),'uri':_0x485816+_0x51c3('0xd'),'json':!![]};_0x3e6b42[_0x51c3('0xe')]=_0x536f63;logger[_0x51c3('0xf')](_0x51c3('0x10'));return rp(_0x3e6b42)[_0x51c3('0x11')](function(_0x5e5979){if(_0x5e5979){var _0x4a1a46=_0x5e5979['users'];var _0x2ccfa0=null;for(_0x2ccfa0=0x0;_0x2ccfa0<_0x4a1a46[_0x51c3('0x12')];_0x2ccfa0++){if(_0x4a1a46[_0x2ccfa0]['email']===_0x3b7995[_0x51c3('0x13')]){_0x3b7995['adminId']=_0x4a1a46[_0x2ccfa0]['id'];_0x3cb768=!![];}}if(_0x3cb768){logger[_0x51c3('0xf')]('Admin\x20found:',_0x3b7995[_0x51c3('0x14')]);_0xc22db7(_0x3b7995);}else{_0x28b35c({'statusCode':0x194,'message':_0x51c3('0x15')});}}else{_0x28b35c({'statusCode':0x194,'message':_0x51c3('0x15')});}})[_0x51c3('0x16')](function(_0x897bb){logger['error']('['+[_0x25c83d[_0x51c3('0x17')]()]+']',_0x897bb[_0x51c3('0x18')]);_0x28b35c(_0x897bb);});});}function getUser(_0x12c5dd,_0x3f3053,_0xb1d255){return function(_0x5ca5f5){return new Promise(function(_0x3e31ee,_0x2f468a){var _0x24ee59={'method':_0x51c3('0xc'),'uri':_0xb1d255+'/api/selector/owners','json':!![]};_0x24ee59[_0x51c3('0xe')]=_0x3f3053;logger[_0x51c3('0xf')](_0x51c3('0x19'));return rp(_0x24ee59)['then'](function(_0x28007f){if(_0x28007f){var _0x35b43e=_0x28007f['users'];var _0x4b24c5=![];var _0x38760f=null;if(_0x5ca5f5[_0x51c3('0x1a')]!==null){logger[_0x51c3('0xf')](_0x51c3('0x1b'),_0x5ca5f5[_0x51c3('0x1a')]);_0x5ca5f5[_0x51c3('0x1c')]=_0x5ca5f5[_0x51c3('0x1a')];for(_0x38760f=0x0;_0x38760f<_0x35b43e[_0x51c3('0x12')];_0x38760f++){if(_0x35b43e[_0x38760f][_0x51c3('0x1d')]===_0x5ca5f5['agentEmail']){_0x4b24c5=!![];_0x5ca5f5[_0x51c3('0x1e')]=_0x35b43e[_0x38760f]['id'];logger['info']('User\x20found:',_0x5ca5f5[_0x51c3('0x1e')]);}}}if(!_0x4b24c5){logger[_0x51c3('0xf')](_0x51c3('0x1f'));_0x5ca5f5[_0x51c3('0x1c')]=_0x5ca5f5[_0x51c3('0x13')];_0x5ca5f5[_0x51c3('0x1e')]=_0x5ca5f5[_0x51c3('0x14')];_0x4b24c5=!![];}if(_0x4b24c5){_0x3e31ee(_0x5ca5f5);}else{_0x2f468a({'statusCode':0x194,'message':_0x51c3('0x15')});}}else{_0x2f468a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x51c3('0x16')](function(_0x286003){logger['error']('['+[_0x12c5dd[_0x51c3('0x17')]()]+']',_0x286003[_0x51c3('0x18')]);_0x2f468a(_0x286003);});});};}function searchContact(_0x51833b,_0x16fdba,_0x42a892,_0x581b51){return new Promise(function(_0x57e151,_0x239a6e){var _0x4a13c7={'method':_0x51c3('0xc'),'headers':_0x16fdba,'uri':_0x51833b+_0x51c3('0x20')+_0x581b51+_0x51c3('0x21')+_0x42a892+_0x51c3('0x22'),'json':!![]};rp(_0x4a13c7)[_0x51c3('0x11')](function(_0xef9d44){var _0x664e63=_['find'](_0xef9d44['contacts'][_0x51c3('0x23')],[_0x42a892,_0x581b51]);_0x57e151(_0x664e63);})['catch'](function(_0x3bad25){_0x239a6e(_0x3bad25);});});}function getEndUser(_0x3f17be,_0x43a433,_0x223696){return function(_0x57b5a3){return new Promise(function(_0x1fce5f,_0x42d881){logger[_0x51c3('0xf')](util[_0x51c3('0x24')](_0x51c3('0x25'),_0x57b5a3[_0x51c3('0x26')]));searchContact(_0x223696,_0x43a433,_0x51c3('0x27'),_0x57b5a3[_0x51c3('0x26')])[_0x51c3('0x11')](function(_0x80c5fa){if(_0x80c5fa){_0x57b5a3[_0x51c3('0x28')]=_0x80c5fa['id'];logger['info'](_0x51c3('0x29'),_0x57b5a3[_0x51c3('0x28')]);return _0x1fce5f(_0x57b5a3);}searchContact(_0x223696,_0x43a433,_0x51c3('0x2a'),_0x57b5a3['contactNumber'])[_0x51c3('0x11')](function(_0x1ca710){if(_0x1ca710){_0x57b5a3[_0x51c3('0x28')]=_0x1ca710['id'];logger[_0x51c3('0xf')]('Contact\x20found\x20work_number:',_0x57b5a3[_0x51c3('0x28')]);return _0x1fce5f(_0x57b5a3);}createEndUser(_0x57b5a3,_0x3f17be,_0x43a433,_0x223696)['then'](function(_0x5b8c5f){logger[_0x51c3('0xf')](_0x51c3('0x2b'),_0x5b8c5f[_0x51c3('0x28')]);return _0x1fce5f(_0x5b8c5f);});});})['catch'](function(_0x3570eb){_0x42d881(_0x3570eb);});});};}function createEndUser(_0x48744a,_0x283367,_0x3a0e2a,_0xc13a9f){return new Promise(function(_0x5c62b1,_0x2cc0e3){var _0x545469=moment();var _0x4bc409={'method':'POST','uri':_0xc13a9f+_0x51c3('0x2c'),'body':{'contact':{'last_name':_0x48744a[_0x51c3('0x26')],'work_number':_0x48744a['contactNumber'],'mobile_number':_0x48744a[_0x51c3('0x26')],'owner_id':_0x48744a[_0x51c3('0x1e')],'created_at':_0x545469['format'](_0x51c3('0x2d'))}},'json':!![]};_0x4bc409[_0x51c3('0xe')]=_0x3a0e2a;logger['info'](_0x51c3('0x2e'));return rp(_0x4bc409)[_0x51c3('0x11')](function(_0x13347b){_0x48744a['endUserId']=_0x13347b[_0x51c3('0x2f')]['id'];_0x5c62b1(_0x48744a);})['catch'](function(_0x33e371){logger[_0x51c3('0x30')]('['+[_0x283367[_0x51c3('0x17')]()]+']',_0x33e371[_0x51c3('0x18')]);_0x2cc0e3(_0x33e371[_0x51c3('0x18')]);});});}function getTicket(_0x46fc9e,_0x2255df,_0x5d1574,_0x56c725,_0x5999b4){return function(_0x5a414e){logger[_0x51c3('0xf')](_0x51c3('0x31'));return new Promise(function(_0x9faba8,_0x2b6353){var _0x19ba82=moment();var _0x48d0ef={'method':_0x51c3('0x32'),'uri':_0x5d1574+_0x51c3('0x33'),'body':{'title':intUtil[_0x51c3('0x34')](_0x56c725['Subjects'],_0x5999b4,'\x20'),'description':intUtil[_0x51c3('0x34')](_0x56c725[_0x51c3('0x35')],_0x5999b4,'\x0a'),'owner_id':_0x5a414e[_0x51c3('0x1e')],'creater_id':_0x5a414e[_0x51c3('0x14')],'targetable_id':_0x5a414e['endUserId'],'targetable_type':_0x51c3('0x36'),'created_at':_0x19ba82[_0x51c3('0x24')](_0x51c3('0x2d')),'due_date':_0x19ba82[_0x51c3('0x37')](0x1e,'m')[_0x51c3('0x24')](_0x51c3('0x2d'))},'json':!![]};_0x48d0ef[_0x51c3('0xe')]=_0x2255df;return rp(_0x48d0ef)['then'](function(_0xefec1){_0x5a414e[_0x51c3('0x38')]=_0xefec1[_0x51c3('0x39')]['id'];logger['info']('Task\x20created:',_0x5a414e[_0x51c3('0x38')]);_0x9faba8(_0x5a414e);})[_0x51c3('0x16')](function(_0x4a3d6e){logger[_0x51c3('0x30')]('['+[_0x46fc9e['toUpperCase']()]+']',_0x4a3d6e[_0x51c3('0x18')]);_0x2b6353(_0x4a3d6e[_0x51c3('0x18')]);});});};}function emit(_0x598b7c,_0x163e48,_0x593beb){var _0x290a09={'uri':_0x598b7c+_0x51c3('0x3a')+_0x593beb};io['to'](util[_0x51c3('0x24')](_0x51c3('0x3b'),_0x163e48))[_0x51c3('0x3c')](_0x51c3('0x3d'),_0x290a09);}exports['cs']=function(_0x46cc1a,_0x9602de,_0x4ed633,_0x570fc0,_0x1732b1,_0x4e3779,_0x3af9b1,_0xa3f6f1){var _0x436b3c={};var _0x441348={'Authorization':_0x51c3('0x3e')+_0x4e3779['apiKey']};_0x4e3779[_0x51c3('0x3f')]=intUtil[_0x51c3('0x40')](_0x4e3779[_0x51c3('0x3f')]);_0x4e3779[_0x51c3('0x41')]=intUtil[_0x51c3('0x40')](_0x4e3779[_0x51c3('0x41')]);var _0x279be5=_0x4e3779['remoteUri'];_0x436b3c[_0x51c3('0x13')]=_0x4e3779['username'];_0x436b3c[_0x51c3('0x26')]=_0xa3f6f1[_0x51c3('0x42')]()===_0x51c3('0x43')?_0x9602de[_0x51c3('0x44')]:_0x9602de[_0x51c3('0x45')];_0x436b3c[_0x51c3('0x46')]=_0xa3f6f1===_0x51c3('0x47')||_0xa3f6f1===_0x51c3('0x48')?_0x51c3('0x47'):_0x51c3('0x43');if(_0x570fc0){_0x436b3c['agentEmail']=_0x570fc0['email'];}var _0x4aa29e=util[_0x51c3('0x24')](_0x51c3('0x49'),_0x4e3779['serverUrl'],_0x9602de[_0x51c3('0x4a')],md5(_0x9602de[_0x51c3('0x4a')]));if(_0x1732b1&&_0x1732b1[_0x51c3('0x4b')]){logger['info'](_0x51c3('0x4c'),_0x51c3('0x4d'));_0x9602de['recordingURL']=_0x4aa29e;}else if(_0x3af9b1&&_0x3af9b1[_0x51c3('0x4e')]&&_0x3af9b1[_0x51c3('0x4e')]!=='none'){logger[_0x51c3('0xf')](_0x51c3('0x4f'),_0x51c3('0x4d'));_0x9602de[_0x51c3('0x50')]=_0x4aa29e;}else{_0x9602de[_0x51c3('0x50')]='';}return getAdminId(_0x436b3c,_0xa3f6f1,_0x441348,_0x279be5)[_0x51c3('0x11')](getUser(_0xa3f6f1,_0x441348,_0x279be5))[_0x51c3('0x11')](getEndUser(_0xa3f6f1,_0x441348,_0x279be5))[_0x51c3('0x11')](getTicket(_0xa3f6f1,_0x441348,_0x279be5,_0x4ed633,_0x9602de))['then'](function(_0xec7171){logger[_0x51c3('0xf')](util[_0x51c3('0x24')](_0x51c3('0x51'),_0xec7171[_0x51c3('0x38')]));if(_0xa3f6f1!==_0x51c3('0x48')){logger[_0x51c3('0xf')]('['+[_0xa3f6f1[_0x51c3('0x17')]()]+']',_0x51c3('0x52'));emit(_0x279be5,_0x570fc0['name'],_0xec7171[_0x51c3('0x28')]);}})['catch'](function(_0x406ec1){logger[_0x51c3('0x30')]('['+[_0xa3f6f1['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x406ec1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x01a5=['moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util'];(function(_0x5a54a9,_0x4f08b4){var _0x3c7f83=function(_0x2c312d){while(--_0x2c312d){_0x5a54a9['push'](_0x5a54a9['shift']());}};_0x3c7f83(++_0x4f08b4);}(_0x01a5,0x148));var _0x501a=function(_0x210661,_0x2f2a83){_0x210661=_0x210661-0x0;var _0x23ece6=_0x01a5[_0x210661];return _0x23ece6;};'use strict';var _=require(_0x501a('0x0'));var rp=require(_0x501a('0x1'));var md5=require(_0x501a('0x2'));var util=require(_0x501a('0x3'));var moment=require(_0x501a('0x4'));var Promise=require(_0x501a('0x5'));var Redis=require(_0x501a('0x6'));var intUtil=require(_0x501a('0x7'));var config=require(_0x501a('0x8'));var logger=require('../../../../config/logger')(_0x501a('0x9'));config[_0x501a('0xa')]=_[_0x501a('0xb')](config[_0x501a('0xa')],{'host':_0x501a('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x501a('0xa')]));function getAdminId(_0x5d8308,_0x17c090,_0x37bf43,_0x20c7ee){return new Promise(function(_0x25d7e2,_0x44054e){var _0x2cd6f5=![];var _0x30940e={'method':'GET','uri':_0x20c7ee+_0x501a('0xd'),'json':!![]};_0x30940e[_0x501a('0xe')]=_0x37bf43;logger[_0x501a('0xf')](_0x501a('0x10'));return rp(_0x30940e)[_0x501a('0x11')](function(_0x192001){if(_0x192001){var _0x35ad09=_0x192001[_0x501a('0x12')];var _0x8f63f4=null;for(_0x8f63f4=0x0;_0x8f63f4<_0x35ad09[_0x501a('0x13')];_0x8f63f4++){if(_0x35ad09[_0x8f63f4][_0x501a('0x14')]===_0x5d8308[_0x501a('0x15')]){_0x5d8308[_0x501a('0x16')]=_0x35ad09[_0x8f63f4]['id'];_0x2cd6f5=!![];}}if(_0x2cd6f5){logger[_0x501a('0xf')](_0x501a('0x17'),_0x5d8308['adminId']);_0x25d7e2(_0x5d8308);}else{_0x44054e({'statusCode':0x194,'message':_0x501a('0x18')});}}else{_0x44054e({'statusCode':0x194,'message':_0x501a('0x18')});}})[_0x501a('0x19')](function(_0x167aa4){logger[_0x501a('0x1a')]('['+[_0x17c090[_0x501a('0x1b')]()]+']',_0x167aa4['message']);_0x44054e(_0x167aa4);});});}function getUser(_0x5c82ba,_0x21accf,_0x31d8f2){return function(_0x300315){return new Promise(function(_0x5d3799,_0x1567df){var _0x8ac009={'method':_0x501a('0x1c'),'uri':_0x31d8f2+_0x501a('0xd'),'json':!![]};_0x8ac009[_0x501a('0xe')]=_0x21accf;logger[_0x501a('0xf')](_0x501a('0x1d'));return rp(_0x8ac009)[_0x501a('0x11')](function(_0x1b3688){if(_0x1b3688){var _0x50416e=_0x1b3688[_0x501a('0x12')];var _0x32bde2=![];var _0x163d67=null;if(_0x300315[_0x501a('0x1e')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x300315[_0x501a('0x1e')]);_0x300315[_0x501a('0x1f')]=_0x300315[_0x501a('0x1e')];for(_0x163d67=0x0;_0x163d67<_0x50416e['length'];_0x163d67++){if(_0x50416e[_0x163d67]['email']===_0x300315[_0x501a('0x1e')]){_0x32bde2=!![];_0x300315[_0x501a('0x20')]=_0x50416e[_0x163d67]['id'];logger['info'](_0x501a('0x21'),_0x300315[_0x501a('0x20')]);}}}if(!_0x32bde2){logger[_0x501a('0xf')]('Admin\x20selected');_0x300315['userEmail']=_0x300315[_0x501a('0x15')];_0x300315[_0x501a('0x20')]=_0x300315[_0x501a('0x16')];_0x32bde2=!![];}if(_0x32bde2){_0x5d3799(_0x300315);}else{_0x1567df({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1567df({'statusCode':0x194,'message':_0x501a('0x18')});}})[_0x501a('0x19')](function(_0x892dfa){logger['error']('['+[_0x5c82ba[_0x501a('0x1b')]()]+']',_0x892dfa[_0x501a('0x22')]);_0x1567df(_0x892dfa);});});};}function searchContact(_0x783556,_0x802dd0,_0x16b3a8,_0x32e864){return new Promise(function(_0x2c3a81,_0x812db){var _0x36ebaf={'method':'GET','headers':_0x802dd0,'uri':_0x783556+_0x501a('0x23')+_0x32e864+_0x501a('0x24')+_0x16b3a8+_0x501a('0x25'),'json':!![]};rp(_0x36ebaf)[_0x501a('0x11')](function(_0x233387){var _0x49c2b7=_[_0x501a('0x26')](_0x233387[_0x501a('0x27')][_0x501a('0x27')],[_0x16b3a8,_0x32e864]);_0x2c3a81(_0x49c2b7);})[_0x501a('0x19')](function(_0x366c2f){_0x812db(_0x366c2f);});});}function getEndUser(_0x54d698,_0x45b410,_0x19dff6){return function(_0x1cc16e){return new Promise(function(_0x5de7a5,_0x2ae229){logger['info'](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x1cc16e[_0x501a('0x28')]));searchContact(_0x19dff6,_0x45b410,_0x501a('0x29'),_0x1cc16e[_0x501a('0x28')])[_0x501a('0x11')](function(_0x2fb3d8){if(_0x2fb3d8){_0x1cc16e[_0x501a('0x2a')]=_0x2fb3d8['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x1cc16e['endUserId']);return _0x5de7a5(_0x1cc16e);}searchContact(_0x19dff6,_0x45b410,_0x501a('0x2b'),_0x1cc16e[_0x501a('0x28')])[_0x501a('0x11')](function(_0x12a8d4){if(_0x12a8d4){_0x1cc16e[_0x501a('0x2a')]=_0x12a8d4['id'];logger['info'](_0x501a('0x2c'),_0x1cc16e['endUserId']);return _0x5de7a5(_0x1cc16e);}createEndUser(_0x1cc16e,_0x54d698,_0x45b410,_0x19dff6)[_0x501a('0x11')](function(_0x4e39b4){logger[_0x501a('0xf')](_0x501a('0x2d'),_0x4e39b4[_0x501a('0x2a')]);return _0x5de7a5(_0x4e39b4);});});})[_0x501a('0x19')](function(_0x28f6c0){_0x2ae229(_0x28f6c0);});});};}function createEndUser(_0x38850b,_0x486904,_0x45ad4c,_0x7a8287){return new Promise(function(_0x11c192,_0x28972e){var _0x299dea=moment();var _0x585f22={'method':_0x501a('0x2e'),'uri':_0x7a8287+_0x501a('0x2f'),'body':{'contact':{'last_name':_0x38850b['contactNumber'],'work_number':_0x38850b[_0x501a('0x28')],'mobile_number':_0x38850b[_0x501a('0x28')],'owner_id':_0x38850b['userId'],'created_at':_0x299dea[_0x501a('0x30')](_0x501a('0x31'))}},'json':!![]};_0x585f22['headers']=_0x45ad4c;logger[_0x501a('0xf')](_0x501a('0x32'));return rp(_0x585f22)[_0x501a('0x11')](function(_0x3a2c79){_0x38850b['endUserId']=_0x3a2c79['contact']['id'];_0x11c192(_0x38850b);})['catch'](function(_0x2c74b9){logger[_0x501a('0x1a')]('['+[_0x486904[_0x501a('0x1b')]()]+']',_0x2c74b9[_0x501a('0x22')]);_0x28972e(_0x2c74b9[_0x501a('0x22')]);});});}function getTicket(_0x530b4c,_0x5868c9,_0x251949,_0x23ad88,_0x43c4c5){return function(_0x2429ff){logger[_0x501a('0xf')](_0x501a('0x33'));return new Promise(function(_0x545445,_0x339566){var _0x2af5ed=moment();var _0x41fa12={'method':_0x501a('0x2e'),'uri':_0x251949+'/api/tasks','body':{'title':intUtil[_0x501a('0x34')](_0x23ad88[_0x501a('0x35')],_0x43c4c5,'\x20'),'description':intUtil[_0x501a('0x34')](_0x23ad88['Descriptions'],_0x43c4c5,'\x0a'),'owner_id':_0x2429ff[_0x501a('0x20')],'creater_id':_0x2429ff[_0x501a('0x16')],'targetable_id':_0x2429ff[_0x501a('0x2a')],'targetable_type':_0x501a('0x36'),'created_at':_0x2af5ed['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2af5ed[_0x501a('0x37')](0x1e,'m')[_0x501a('0x30')](_0x501a('0x31'))},'json':!![]};_0x41fa12[_0x501a('0xe')]=_0x5868c9;return rp(_0x41fa12)[_0x501a('0x11')](function(_0x49f675){_0x2429ff[_0x501a('0x38')]=_0x49f675['task']['id'];logger[_0x501a('0xf')](_0x501a('0x39'),_0x2429ff[_0x501a('0x38')]);_0x545445(_0x2429ff);})['catch'](function(_0x2f9621){logger[_0x501a('0x1a')]('['+[_0x530b4c['toUpperCase']()]+']',_0x2f9621['message']);_0x339566(_0x2f9621[_0x501a('0x22')]);});});};}function emit(_0x3c3d7e,_0x31778f,_0x27a28b){var _0x22c031={'uri':_0x3c3d7e+_0x501a('0x3a')+_0x27a28b};io['to'](util[_0x501a('0x30')](_0x501a('0x3b'),_0x31778f))['emit'](_0x501a('0x3c'),_0x22c031);}exports['cs']=function(_0x472600,_0x232539,_0x56a881,_0x567661,_0x5d09f9,_0x4a07db,_0x2ac45f,_0x204ce1){var _0x32de6c={};var _0x32404d={'Authorization':_0x501a('0x3d')+_0x4a07db['apiKey']};_0x4a07db[_0x501a('0x3e')]=intUtil[_0x501a('0x3f')](_0x4a07db[_0x501a('0x3e')]);_0x4a07db[_0x501a('0x40')]=intUtil[_0x501a('0x3f')](_0x4a07db[_0x501a('0x40')]);var _0x114df5=_0x4a07db['remoteUri'];_0x32de6c[_0x501a('0x15')]=_0x4a07db[_0x501a('0x41')];_0x32de6c['contactNumber']=_0x204ce1['toLowerCase']()===_0x501a('0x42')?_0x232539[_0x501a('0x43')]:_0x232539[_0x501a('0x44')];_0x32de6c['callDirection']=_0x204ce1===_0x501a('0x45')||_0x204ce1==='unmanaged'?_0x501a('0x45'):_0x501a('0x42');if(_0x567661){_0x32de6c[_0x501a('0x1e')]=_0x567661['email'];}var _0x43fc74=util[_0x501a('0x30')](_0x501a('0x46'),_0x4a07db['serverUrl'],_0x232539[_0x501a('0x47')],md5(_0x232539['uniqueid']));if(_0x5d09f9&&_0x5d09f9[_0x501a('0x48')]){logger[_0x501a('0xf')](_0x501a('0x49'),_0x501a('0x4a'));_0x232539['recordingURL']=_0x43fc74;}else if(_0x2ac45f&&_0x2ac45f[_0x501a('0x4b')]&&_0x2ac45f[_0x501a('0x4b')]!==_0x501a('0x4c')){logger[_0x501a('0xf')](_0x501a('0x4d'),_0x501a('0x4a'));_0x232539['recordingURL']=_0x43fc74;}else{_0x232539[_0x501a('0x4e')]='';}return getAdminId(_0x32de6c,_0x204ce1,_0x32404d,_0x114df5)[_0x501a('0x11')](getUser(_0x204ce1,_0x32404d,_0x114df5))[_0x501a('0x11')](getEndUser(_0x204ce1,_0x32404d,_0x114df5))[_0x501a('0x11')](getTicket(_0x204ce1,_0x32404d,_0x114df5,_0x56a881,_0x232539))['then'](function(_0x3287d1){logger[_0x501a('0xf')](util[_0x501a('0x30')](_0x501a('0x4f'),_0x3287d1[_0x501a('0x38')]));if(_0x204ce1!==_0x501a('0x50')){logger['info']('['+[_0x204ce1[_0x501a('0x1b')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x114df5,_0x567661['name'],_0x3287d1['endUserId']);}})[_0x501a('0x19')](function(_0x1e9e36){logger[_0x501a('0x1a')]('['+[_0x204ce1[_0x501a('0x1b')]()]+_0x501a('0x51'),util[_0x501a('0x52')](_0x1e9e36,{'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 98fbc28..20a8ab2 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 _0x5643=['salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','includes','data1','toLowerCase','find','Configurations','data3','queue','outbound','log','zendesk','zoho','servicenow','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365'];(function(_0xb81593,_0x53ffad){var _0x57bfae=function(_0x2f67d5){while(--_0x2f67d5){_0xb81593['push'](_0xb81593['shift']());}};_0x57bfae(++_0x53ffad);}(_0x5643,0xe5));var _0x3564=function(_0x1552fa,_0x40edec){_0x1552fa=_0x1552fa-0x0;var _0x173c1e=_0x5643[_0x1552fa];return _0x173c1e;};'use strict';var _=require('lodash');var util=require(_0x3564('0x0'));var zendesk=require(_0x3564('0x1'));var salesforce=require(_0x3564('0x2'));var sugarcrm=require(_0x3564('0x3'));var freshdesk=require(_0x3564('0x4'));var zoho=require(_0x3564('0x5'));var desk=require('./desk');var vtiger=require(_0x3564('0x6'));var servicenow=require(_0x3564('0x7'));var dynamics365=require(_0x3564('0x8'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x3564('0x9'),_0x3564('0xa'),_0x3564('0xb'),'zoho',_0x3564('0xc'),_0x3564('0xd'),_0x3564('0xe'),_0x3564('0xf'),'servicenow'];exports['exec']=function(_0x10ba76,_0x4dac39,_0x506be0,_0x5c7e6b,_0x2aa708,_0x5d9507){if(_0x506be0){if(_[_0x3564('0x10')](integrations,_0x10ba76['data1']['toLowerCase']())){try{var _0x2314db=null;var _0x554632='';var _0x3c40e3=_0x506be0[_0x10ba76[_0x3564('0x11')][_0x3564('0x12')]()];if(_0x3c40e3){var _0x1e17b4=_0x3c40e3[_0x10ba76['data2']];if(_0x1e17b4){var _0x5e157f=_[_0x3564('0x13')](_0x1e17b4[_0x3564('0x14')],{'id':parseInt(_0x10ba76[_0x3564('0x15')],0xa)});if(_0x5e157f){if(_0x5c7e6b){if(_0x2aa708&&_0x4dac39[_0x3564('0x16')]){_0x554632='queue';}else if(_0x4dac39['routeId']){_0x554632=_0x3564('0x17');}else{console[_0x3564('0x18')]('EVENT\x20UNKNOWN',_0x4dac39);}}else{_0x554632='unmanaged';}switch(_0x10ba76['data1'][_0x3564('0x12')]()){case _0x3564('0x19'):zendesk[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0x9'):salesforce[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0xa'):sugarcrm[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0xb'):freshdesk[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0x1a'):zoho[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0xc'):desk[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0xd'):vtiger[_0x554632](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507);break;case _0x3564('0xf'):freshsales['cs'](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507,_0x554632);break;case _0x3564('0x1b'):servicenow['cs'](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507,_0x554632);break;case'dynamics365':dynamics365['cs'](_0x10ba76,_0x4dac39,_0x5e157f,_0x5c7e6b,_0x2aa708,_0x1e17b4,_0x5d9507,_0x554632);break;default:console[_0x3564('0x18')]('unknown\x20integration');}}else{_0x2314db=require(_0x3564('0x1c'))(_0x10ba76['data1'][_0x3564('0x12')]());_0x2314db[_0x3564('0x1d')](_0x3564('0x1e'),util[_0x3564('0x1f')]('%s\x20configuration\x20#%s\x20not\x20found',_0x10ba76[_0x3564('0x11')]['toLowerCase'](),_0x10ba76[_0x3564('0x15')]));}}else{_0x2314db=require(_0x3564('0x1c'))(_0x10ba76[_0x3564('0x11')]['toLowerCase']());_0x2314db[_0x3564('0x1d')](_0x3564('0x1e'),util[_0x3564('0x1f')](_0x3564('0x20'),_0x10ba76[_0x3564('0x11')][_0x3564('0x12')](),_0x10ba76[_0x3564('0x21')]));}}else{}}catch(_0x4b2d59){console['error'](_0x4b2d59);}}}}; \ No newline at end of file +var _0xccd1=['toLowerCase','data2','find','queue','routeId','log','EVENT\x20UNKNOWN','freshsales','servicenow','unknown\x20integration','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','exec','includes','data1'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0xccd1,0x1bc));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1ccd('0x0'));var util=require('util');var zendesk=require(_0x1ccd('0x1'));var salesforce=require(_0x1ccd('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x1ccd('0x3'));var zoho=require('./zoho');var desk=require(_0x1ccd('0x4'));var vtiger=require(_0x1ccd('0x5'));var servicenow=require(_0x1ccd('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x1ccd('0x7'));var integrations=[_0x1ccd('0x8'),_0x1ccd('0x9'),'sugarcrm',_0x1ccd('0xa'),_0x1ccd('0xb'),_0x1ccd('0xc'),_0x1ccd('0xd'),_0x1ccd('0xe'),'freshsales','servicenow'];exports[_0x1ccd('0xf')]=function(_0x7793f4,_0x59953a,_0x4127d5,_0x162477,_0x31e9e4,_0x5c5851){if(_0x4127d5){if(_[_0x1ccd('0x10')](integrations,_0x7793f4[_0x1ccd('0x11')]['toLowerCase']())){try{var _0x29b416=null;var _0x4bbd8c='';var _0x591ac2=_0x4127d5[_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')]()];if(_0x591ac2){var _0x2f6f4e=_0x591ac2[_0x7793f4[_0x1ccd('0x13')]];if(_0x2f6f4e){var _0x15443d=_[_0x1ccd('0x14')](_0x2f6f4e['Configurations'],{'id':parseInt(_0x7793f4['data3'],0xa)});if(_0x15443d){if(_0x162477){if(_0x31e9e4&&_0x59953a[_0x1ccd('0x15')]){_0x4bbd8c=_0x1ccd('0x15');}else if(_0x59953a[_0x1ccd('0x16')]){_0x4bbd8c='outbound';}else{console[_0x1ccd('0x17')](_0x1ccd('0x18'),_0x59953a);}}else{_0x4bbd8c='unmanaged';}switch(_0x7793f4[_0x1ccd('0x11')]['toLowerCase']()){case _0x1ccd('0x8'):zendesk[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0x9'):salesforce[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case'sugarcrm':sugarcrm[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0xa'):freshdesk[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case'zoho':zoho[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0xc'):desk[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0xd'):vtiger[_0x4bbd8c](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851);break;case _0x1ccd('0x19'):freshsales['cs'](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851,_0x4bbd8c);break;case _0x1ccd('0x1a'):servicenow['cs'](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851,_0x4bbd8c);break;case _0x1ccd('0xe'):dynamics365['cs'](_0x7793f4,_0x59953a,_0x15443d,_0x162477,_0x31e9e4,_0x2f6f4e,_0x5c5851,_0x4bbd8c);break;default:console[_0x1ccd('0x17')](_0x1ccd('0x1b'));}}else{_0x29b416=require('../../../../config/logger')(_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')]());_0x29b416['error'](_0x1ccd('0x1c'),util[_0x1ccd('0x1d')](_0x1ccd('0x1e'),_0x7793f4['data1']['toLowerCase'](),_0x7793f4[_0x1ccd('0x1f')]));}}else{_0x29b416=require('../../../../config/logger')(_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')]());_0x29b416['error'](_0x1ccd('0x1c'),util[_0x1ccd('0x1d')](_0x1ccd('0x20'),_0x7793f4[_0x1ccd('0x11')][_0x1ccd('0x12')](),_0x7793f4[_0x1ccd('0x13')]));}}else{}}catch(_0x2ec58d){console['error'](_0x2ec58d);}}}}; \ 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 70b8414..f1f8ea1 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 _0xcd0b=['contact','lead','WhoId','account','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','execute','then','length','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','Phone','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','string','picklist','idField','content','variable','variableName','toString','type','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType'];(function(_0x25b938,_0x506d94){var _0x19057e=function(_0x5b769c){while(--_0x5b769c){_0x25b938['push'](_0x25b938['shift']());}};_0x19057e(++_0x506d94);}(_0xcd0b,0x67));var _0xbcd0=function(_0x206915,_0x5d88cf){_0x206915=_0x206915-0x0;var _0x446548=_0xcd0b[_0x206915];return _0x446548;};'use strict';var _=require(_0xbcd0('0x0'));var rp=require(_0xbcd0('0x1'));var moment=require(_0xbcd0('0x2'));var BPromise=require(_0xbcd0('0x3'));var md5=require(_0xbcd0('0x4'));var jsforce=require(_0xbcd0('0x5'));var util=require(_0xbcd0('0x6'));var Redis=require(_0xbcd0('0x7'));var intUtil=require(_0xbcd0('0x8'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xbcd0('0x9'));config[_0xbcd0('0xa')]=_[_0xbcd0('0xb')](config[_0xbcd0('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xbcd0('0xc'))(new Redis(config[_0xbcd0('0xa')]));function emit(_0x5b5bcd,_0x174d78,_0xc48afe){io['to'](_0x5b5bcd)[_0xbcd0('0xd')](_0x174d78,_0xc48afe);}function getTicket(_0x1eda37,_0x78dff9,_0x24516c,_0x10b195,_0x503b8e,_0x319030,_0x6767df,_0x55a682){var _0x2f06ea=Object[_0xbcd0('0xe')]({},{'OwnerId':_0x78dff9['id'],'Subject':intUtil[_0xbcd0('0xf')](_0x10b195[_0xbcd0('0x10')],_0x503b8e,'\x20'),'Description':intUtil['getString'](_0x10b195[_0xbcd0('0x11')],_0x503b8e,'\x0a')},getCustomFields(_0x319030,_0x503b8e));if(_0x24516c){if(_0x10b195[_0xbcd0('0x12')]===_0xbcd0('0x13')){_0x2f06ea['ActivityDate']=moment[_0xbcd0('0x14')]();_0x2f06ea[_0xbcd0('0x15')]=![];_0x2f06ea[_0xbcd0('0x16')]=![];if(_0x24516c[_0xbcd0('0x17')]===_0xbcd0('0x18')||_0x24516c[_0xbcd0('0x17')]===_0xbcd0('0x19')){_0x2f06ea[_0xbcd0('0x1a')]=_0x24516c['id'];}else if(_0x24516c[_0xbcd0('0x17')]===_0xbcd0('0x1b')){_0x2f06ea['WhatId']=_0x24516c['id'];}}else if(_0x10b195[_0xbcd0('0x12')]==='Case'){if(_0x24516c['endUserType']===_0xbcd0('0x18')){_0x2f06ea[_0xbcd0('0x1c')]=_0x24516c['id'];}else if(_0x24516c['endUserType']===_0xbcd0('0x1b')){_0x2f06ea[_0xbcd0('0x1d')]=_0x24516c['id'];}else if(_0x24516c[_0xbcd0('0x17')]===_0xbcd0('0x19')&&_0x10b195[_0xbcd0('0x1e')]){_0x2f06ea[_0x10b195[_0xbcd0('0x1e')]]=_0x24516c['id'];}else{logger[_0xbcd0('0x1f')](_0xbcd0('0x20'));}}}return _0x6767df['sobject'](_0x10b195[_0xbcd0('0x12')])[_0xbcd0('0x21')](_0x2f06ea);}function getUser(_0x4c6432,_0x164d35,_0x1233ae){if(!_[_0xbcd0('0x22')](_0x164d35)&&intUtil[_0xbcd0('0x23')](_0x164d35)){var _0xfadbcb={'Email':_0x164d35};var _0x5b7e6e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1233ae[_0xbcd0('0x24')](_0xbcd0('0x25'))[_0xbcd0('0x26')](_0xfadbcb,_0x5b7e6e)[_0xbcd0('0x27')]()[_0xbcd0('0x28')](function(_0x58e1ee){if(_0x58e1ee[_0xbcd0('0x29')]){var _0x1c4734=_[_0xbcd0('0x26')](_0x58e1ee,function(_0x296b79){return _0x296b79['Email']===_0x164d35;});if(_0x1c4734){logger[_0xbcd0('0x1f')]('Agent\x20%s\x20found.',_0x164d35);return BPromise[_0xbcd0('0x2a')]({'id':_0x1c4734['Id'],'name':_0x1c4734[_0xbcd0('0x2b')]});}}else{logger[_0xbcd0('0x1f')](_0xbcd0('0x2c'),_0x164d35);return _0x1233ae[_0xbcd0('0x2d')]()[_0xbcd0('0x28')](function(_0x51df40){return BPromise[_0xbcd0('0x2a')]({'id':_0x51df40[_0xbcd0('0x2e')],'name':_0x51df40[_0xbcd0('0x2f')]});});}});}else{logger['info'](_0xbcd0('0x2c'),_0x164d35);return _0x1233ae['identity']()[_0xbcd0('0x28')](function(_0x1d7eec){return BPromise[_0xbcd0('0x2a')]({'id':_0x1d7eec[_0xbcd0('0x2e')],'name':_0x1d7eec[_0xbcd0('0x2f')]});});}}function getEndUser(_0x215f87,_0x1b55dc,_0x1560f0,_0x4301f3,_0x31be31){var _0x894a8f={'$or':{'Phone':_0x4301f3}};var _0x3f3cb5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbcd0('0x2a')]()[_0xbcd0('0x28')](function(){logger[_0xbcd0('0x1f')](_0xbcd0('0x30'),_0x4301f3,_0x1b55dc[_0xbcd0('0x31')]);switch(_0x1b55dc[_0xbcd0('0x31')]){case _0xbcd0('0x32'):var _0x2670ca=_[_0xbcd0('0x33')](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x34')]){var _0x5773f9={};_0x5773f9[_0x1b55dc[_0xbcd0('0x34')]]=_0x4301f3;_[_0xbcd0('0x35')](_0x2670ca[_0xbcd0('0x36')],_0x5773f9);}return _0x31be31[_0xbcd0('0x24')]('Contact')[_0xbcd0('0x26')](_0x2670ca,_0x3f3cb5)[_0xbcd0('0x27')]()['then'](function(_0x4535d6){if(_0x4535d6&&_0x4535d6[_0xbcd0('0x29')]){return _0x4535d6;}else{var _0x1a8c85=_['cloneDeep'](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x37')]){var _0x21f730={};_0x21f730[_0x1b55dc[_0xbcd0('0x37')]]=_0x4301f3;_['merge'](_0x1a8c85[_0xbcd0('0x36')],_0x21f730);}return _0x31be31[_0xbcd0('0x24')](_0xbcd0('0x38'))['find'](_0x1a8c85,_0x3f3cb5);}});case _0xbcd0('0x39'):var _0x9847db=_[_0xbcd0('0x33')](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x3a')]){var _0x5773f9={};_0x5773f9[_0x1b55dc[_0xbcd0('0x3a')]]=_0x4301f3;_[_0xbcd0('0x35')](_0x9847db[_0xbcd0('0x36')],_0x5773f9);}return _0x31be31[_0xbcd0('0x24')](_0xbcd0('0x3b'))[_0xbcd0('0x26')](_0x9847db,_0x3f3cb5)[_0xbcd0('0x27')]()[_0xbcd0('0x28')](function(_0x230090){if(_0x230090&&_0x230090['length']){return _0x230090;}else{var _0x178a22=_[_0xbcd0('0x33')](_0x894a8f);if(_0x1b55dc['additionalSearchContact']){var _0x4a42d8={};_0x4a42d8[_0x1b55dc[_0xbcd0('0x34')]]=_0x4301f3;_[_0xbcd0('0x35')](_0x178a22[_0xbcd0('0x36')],_0x4a42d8);}return _0x31be31[_0xbcd0('0x24')](_0xbcd0('0x3c'))[_0xbcd0('0x26')](_0x178a22,_0x3f3cb5)[_0xbcd0('0x28')](function(_0x5cc89f){if(_0x5cc89f&&_0x5cc89f[_0xbcd0('0x29')]){return _0x5cc89f;}else{var _0x42aeb8=_[_0xbcd0('0x33')](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x37')]){var _0x3bc3e2={};_0x3bc3e2[_0x1b55dc[_0xbcd0('0x37')]]=_0x4301f3;_[_0xbcd0('0x35')](_0x42aeb8[_0xbcd0('0x36')],_0x3bc3e2);}return _0x31be31[_0xbcd0('0x24')]('Lead')[_0xbcd0('0x26')](_0x42aeb8,_0x3f3cb5);}});}});case _0xbcd0('0x18'):var _0x2670ca=_[_0xbcd0('0x33')](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x34')]){var _0x5773f9={};_0x5773f9[_0x1b55dc[_0xbcd0('0x34')]]=_0x4301f3;_[_0xbcd0('0x35')](_0x2670ca['$or'],_0x5773f9);}return _0x31be31[_0xbcd0('0x24')](_0xbcd0('0x3c'))[_0xbcd0('0x26')](_0x2670ca,_0x3f3cb5)[_0xbcd0('0x27')]();case _0xbcd0('0x19'):var _0x3132f0=_['cloneDeep'](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x37')]){var _0x5773f9={};_0x5773f9[_0x1b55dc[_0xbcd0('0x37')]]=_0x4301f3;_['merge'](_0x3132f0[_0xbcd0('0x36')],_0x5773f9);}return _0x31be31[_0xbcd0('0x24')](_0xbcd0('0x38'))[_0xbcd0('0x26')](_0x3132f0,_0x3f3cb5);case'account':var _0x9847db=_[_0xbcd0('0x33')](_0x894a8f);if(_0x1b55dc[_0xbcd0('0x3a')]){var _0x5773f9={};_0x5773f9[_0x1b55dc[_0xbcd0('0x3a')]]=_0x4301f3;_['merge'](_0x9847db[_0xbcd0('0x36')],_0x5773f9);}return _0x31be31['sobject'](_0xbcd0('0x3b'))[_0xbcd0('0x26')](_0x9847db,_0x3f3cb5);default:return null;}})['then'](function(_0x12e0f9){if(_0x12e0f9&&_0x12e0f9[_0xbcd0('0x29')]){var _0x40271d=_['first'](_0x12e0f9);if(_0x40271d){return BPromise[_0xbcd0('0x2a')]({'id':_0x40271d['Id'],'name':_0x40271d[_0xbcd0('0x2b')],'phone':_0x40271d[_0xbcd0('0x3d')],'endUserType':_0x40271d[_0xbcd0('0x3e')]['type']['toLowerCase']()});}}})[_0xbcd0('0x28')](function(_0x4d6cc4){if(_0x4d6cc4){logger[_0xbcd0('0x1f')](_0xbcd0('0x3f'),_0x4d6cc4[_0xbcd0('0x17')],_0x4301f3);return BPromise[_0xbcd0('0x2a')](_0x4d6cc4);}else{logger[_0xbcd0('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4301f3);var _0xf422e5={'Phone':_0x4301f3};if(_0x1b55dc[_0xbcd0('0x40')]){if(_0x1b55dc[_0xbcd0('0x40')]===_0xbcd0('0x18')){logger[_0xbcd0('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4301f3,_0x1b55dc[_0xbcd0('0x40')]);_0xf422e5['LastName']=_0x1560f0!==_0xbcd0('0x41')?_0x1560f0:util[_0xbcd0('0x42')](_0xbcd0('0x43'),_0x4301f3);}else if(_0x1b55dc[_0xbcd0('0x40')]===_0xbcd0('0x19')){logger[_0xbcd0('0x1f')](_0xbcd0('0x44'),_0x4301f3,_0x1b55dc[_0xbcd0('0x40')]);_0xf422e5['LastName']=_0x1560f0!==_0xbcd0('0x41')?_0x1560f0:util['format']('Caller\x20-\x20%s',_0x4301f3);_0xf422e5[_0xbcd0('0x45')]='No\x20Company';}else if(_0x1b55dc[_0xbcd0('0x40')]===_0xbcd0('0x1b')){logger[_0xbcd0('0x1f')](_0xbcd0('0x44'),_0x4301f3,_0x1b55dc[_0xbcd0('0x40')]);_0xf422e5['Name']=_0x1560f0!==_0xbcd0('0x41')?_0x1560f0:util[_0xbcd0('0x42')]('Caller\x20-\x20%s',_0x4301f3);}else{return null;}}return _0x31be31[_0xbcd0('0x24')](_[_0xbcd0('0x46')](_0x1b55dc[_0xbcd0('0x40')]))['create'](_0xf422e5)[_0xbcd0('0x28')](function(_0x2a11d3){return BPromise['resolve']({'id':_0x2a11d3['id'],'endUserType':_0x1b55dc[_0xbcd0('0x40')]});});}});}function getCustomFields(_0x2d2b5e,_0x245337){var _0x50d5d5={};if(_0x2d2b5e[_0xbcd0('0x29')]>0x0){_[_0xbcd0('0x47')](_0x2d2b5e,function(_0x3d92d8){if(_['includes']([_0xbcd0('0x48'),_0xbcd0('0x49')],_0x3d92d8['type'])&&_0x3d92d8[_0xbcd0('0x4a')]){_0x50d5d5[_0x3d92d8[_0xbcd0('0x4a')]]=_0x3d92d8[_0xbcd0('0x4b')]['toString']();}else if(_0x3d92d8['type']===_0xbcd0('0x4c')&&_0x3d92d8['variableName']&&_0x3d92d8[_0xbcd0('0x4a')]){_0x245337[_0x3d92d8[_0xbcd0('0x4d')]]&&(_0x50d5d5[_0x3d92d8[_0xbcd0('0x4a')]]=_0x245337[_0x3d92d8['variableName']][_0xbcd0('0x4e')]());}else if(_0x3d92d8[_0xbcd0('0x4f')]==='customVariable'&&_0x3d92d8[_0xbcd0('0x50')]&&_0x3d92d8[_0xbcd0('0x50')]['name']&&_0x3d92d8[_0xbcd0('0x4a')]){_0x245337[_0x3d92d8['Variable'][_0xbcd0('0x51')][_0xbcd0('0x52')]()]&&(_0x50d5d5[_0x3d92d8[_0xbcd0('0x4a')]]=_0x245337[_0x3d92d8[_0xbcd0('0x50')][_0xbcd0('0x51')][_0xbcd0('0x52')]()][_0xbcd0('0x4e')]());}});}return _0x50d5d5;}function getConnection(_0x445cc5){var _0xe58e93=_0x445cc5[_0xbcd0('0x53')][_0xbcd0('0x54')](_0x445cc5['securityToken']);var _0x21f45e=new jsforce[(_0xbcd0('0x55'))]({'oauth2':{'loginUrl':_0x445cc5[_0xbcd0('0x56')]||_0xbcd0('0x57'),'clientId':_0x445cc5[_0xbcd0('0x58')],'clientSecret':_0x445cc5[_0xbcd0('0x59')]}});return _0x21f45e[_0xbcd0('0x5a')](_0x445cc5[_0xbcd0('0x5b')],_0xe58e93)[_0xbcd0('0x28')](function(){logger[_0xbcd0('0x1f')](_0xbcd0('0x5c'));return _0x21f45e;});}exports['queue']=function(_0x24c3e9,_0x30f261,_0x44cc82,_0x25f38a,_0xd7e81d,_0x40bb07){var _0x32d65f,_0x5e06ee,_0x5cec7b,_0x3e0c09;_0x40bb07[_0xbcd0('0x5d')]=intUtil[_0xbcd0('0x5e')](_0x40bb07[_0xbcd0('0x5d')]);_0x40bb07[_0xbcd0('0x56')]=intUtil['stripTrailingSlash'](_0x40bb07['remoteUri']);if(_0xd7e81d&&_0xd7e81d['monitor_format']){logger[_0xbcd0('0x1f')](_0xbcd0('0x5f'),_0xbcd0('0x60'));_0x30f261['recordingURL']=util['format'](_0xbcd0('0x61'),_0x40bb07[_0xbcd0('0x5d')],_0x30f261[_0xbcd0('0x62')],md5(_0x30f261[_0xbcd0('0x62')]));}else{_0x30f261[_0xbcd0('0x63')]='';}return getConnection(_0x40bb07)[_0xbcd0('0x28')](function(_0x58afbc){_0x3e0c09=_0x58afbc;return getUser(_0x40bb07,_0x25f38a[_0xbcd0('0x64')],_0x3e0c09);})[_0xbcd0('0x28')](function(_0x534d24){_0x32d65f=_0x534d24;return getEndUser(_0x40bb07,_0x44cc82,_0x30f261[_0xbcd0('0x65')],_0x30f261[_0xbcd0('0x66')],_0x3e0c09);})['then'](function(_0x4e1952){_0x5e06ee=_0x4e1952;return getTicket(_0x40bb07,_0x32d65f,_0x5e06ee,_0x44cc82,_0x30f261,_0x44cc82['Fields'],_0x3e0c09,_0xbcd0('0x67'));})[_0xbcd0('0x28')](function(_0x39f891){_0x5cec7b=_0x39f891;logger['info'](_0xbcd0('0x68'),_0x5cec7b['id']);logger['info'](_0xbcd0('0x69'),_0x5cec7b['id'],_0x25f38a['name'],_0x40bb07[_0xbcd0('0x4f')]);switch(_0x40bb07[_0xbcd0('0x4f')]){case _0xbcd0('0x6a'):emit(util[_0xbcd0('0x42')](_0xbcd0('0x6b'),_0x25f38a[_0xbcd0('0x51')]),_0xbcd0('0x6c'),{'recordId':_0x5cec7b['id']});break;case'newTab':emit(util[_0xbcd0('0x42')](_0xbcd0('0x6b'),_0x25f38a[_0xbcd0('0x51')]),_0xbcd0('0x6d'),{'uri':util[_0xbcd0('0x42')](_0xbcd0('0x6e'),_0x3e0c09['instanceUrl'],_0x5cec7b['id'])});break;default:logger[_0xbcd0('0x6f')](_0xbcd0('0x70'));}})['catch'](function(_0x25a211){logger[_0xbcd0('0x6f')](_0xbcd0('0x5f'),_0x25a211);});};exports['outbound']=function(_0x43caaa,_0x7d3351,_0x594428,_0x29ecc1,_0xaecad9,_0x4d08f5,_0x518b2b){var _0x56fbf6,_0x4abadb,_0x59cbf8,_0x94cba1;_0x4d08f5['serverUrl']=intUtil[_0xbcd0('0x5e')](_0x4d08f5[_0xbcd0('0x5d')]);_0x4d08f5[_0xbcd0('0x56')]=intUtil['stripTrailingSlash'](_0x4d08f5[_0xbcd0('0x56')]);if(_0x518b2b&&_0x518b2b[_0xbcd0('0x71')]&&_0x518b2b['recordingFormat']!=='none'){logger[_0xbcd0('0x1f')](_0xbcd0('0x72'),'Recording\x20is\x20enabled!');_0x7d3351[_0xbcd0('0x63')]=util[_0xbcd0('0x42')](_0xbcd0('0x61'),_0x4d08f5[_0xbcd0('0x5d')],_0x7d3351[_0xbcd0('0x62')],md5(_0x7d3351['uniqueid']));}return getConnection(_0x4d08f5)[_0xbcd0('0x28')](function(_0x4e49b8){_0x94cba1=_0x4e49b8;return getUser(_0x4d08f5,_0x29ecc1[_0xbcd0('0x64')],_0x94cba1);})[_0xbcd0('0x28')](function(_0x4e9da1){_0x56fbf6=_0x4e9da1;return getEndUser(_0x4d08f5,_0x594428,_0x7d3351[_0xbcd0('0x73')],_0x7d3351[_0xbcd0('0x74')],_0x94cba1);})[_0xbcd0('0x28')](function(_0x4867d6){_0x4abadb=_0x4867d6;return getTicket(_0x4d08f5,_0x56fbf6,_0x4abadb,_0x594428,_0x7d3351,_0x594428['Fields'],_0x94cba1,'outbound');})['then'](function(_0x2433bd){_0x59cbf8=_0x2433bd;logger[_0xbcd0('0x1f')](_0xbcd0('0x75'),_0x59cbf8['id']);logger[_0xbcd0('0x1f')](_0xbcd0('0x76'),_0x59cbf8['id'],_0x29ecc1[_0xbcd0('0x51')],_0x4d08f5[_0xbcd0('0x4f')]);switch(_0x4d08f5[_0xbcd0('0x4f')]){case _0xbcd0('0x6a'):emit(util[_0xbcd0('0x42')](_0xbcd0('0x6b'),_0x29ecc1[_0xbcd0('0x51')]),'trigger:salesforce:display',{'recordId':_0x59cbf8['id']});break;case _0xbcd0('0x77'):emit(util[_0xbcd0('0x42')](_0xbcd0('0x6b'),_0x29ecc1[_0xbcd0('0x51')]),'trigger:browser:url',{'uri':util['format'](_0xbcd0('0x6e'),_0x94cba1[_0xbcd0('0x78')],_0x59cbf8['id'])});break;default:logger[_0xbcd0('0x6f')]('[OUTBOUND]',_0xbcd0('0x79'));}})['catch'](function(_0x577be0){logger['error']('[OUTBOUND]',_0x577be0);});};exports[_0xbcd0('0x7a')]=function(_0x151c01,_0x3148ad,_0x9624fd,_0x3afa91,_0x522dd4,_0x98fb47){var _0x11b27b,_0x402fb6,_0xbf0d29,_0x21739a;_0x98fb47['serverUrl']=intUtil[_0xbcd0('0x5e')](_0x98fb47[_0xbcd0('0x5d')]);_0x98fb47[_0xbcd0('0x56')]=intUtil[_0xbcd0('0x5e')](_0x98fb47['remoteUri']);if(_0x522dd4&&_0x522dd4[_0xbcd0('0x7b')]){logger[_0xbcd0('0x1f')]('['+_0x3148ad[_0xbcd0('0x7c')][_0xbcd0('0x7d')]()+']',_0xbcd0('0x60'));_0x3148ad['recordingURL']=util[_0xbcd0('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x98fb47['serverUrl'],_0x3148ad[_0xbcd0('0x62')],md5(_0x3148ad[_0xbcd0('0x62')]));}else{_0x3148ad[_0xbcd0('0x63')]='';}return getConnection(_0x98fb47)[_0xbcd0('0x28')](function(_0x2a943c){_0x21739a=_0x2a943c;if(!_[_0xbcd0('0x22')](_0x3afa91)){return getUser(_0x98fb47,_0x3afa91[_0xbcd0('0x51')],_0x21739a);}else{return getUser(_0x98fb47,null,_0x21739a);}})[_0xbcd0('0x28')](function(_0x59381b){_0x11b27b=_0x59381b;return getEndUser(_0x98fb47,_0x9624fd,_0x3148ad[_0xbcd0('0x65')],_0x3148ad[_0xbcd0('0x66')],_0x21739a);})[_0xbcd0('0x28')](function(_0x42a671){_0x402fb6=_0x42a671;return getTicket(_0x98fb47,_0x11b27b,_0x402fb6,_0x9624fd,_0x3148ad,_0x9624fd['Fields'],_0x21739a);})[_0xbcd0('0x28')](function(_0x2aba6c){_0xbf0d29=_0x2aba6c;logger[_0xbcd0('0x1f')]('['+_0x3148ad[_0xbcd0('0x7c')]['toUpperCase']()+_0xbcd0('0x7e'),_0xbf0d29['id']);logger[_0xbcd0('0x1f')]('['+_0x3148ad[_0xbcd0('0x7c')][_0xbcd0('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x98fb47[_0xbcd0('0x4f')]);})['catch'](function(_0x35d5e8){logger[_0xbcd0('0x6f')]('['+_0x3148ad[_0xbcd0('0x7c')]['toUpperCase']()+']',_0x35d5e8);});}; \ No newline at end of file +var _0x43a8=['variable','variableName','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','salesforce','redis','defaults','localhost','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','execute','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Contact','Lead','first','Name','Phone','attributes','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','picklist','type','idField','toString'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x43a8,0x1bc));var _0x843a=function(_0x2f2614,_0x2a0172){_0x2f2614=_0x2f2614-0x0;var _0x29cbe5=_0x43a8[_0x2f2614];return _0x29cbe5;};'use strict';var _=require(_0x843a('0x0'));var rp=require(_0x843a('0x1'));var moment=require(_0x843a('0x2'));var BPromise=require(_0x843a('0x3'));var md5=require(_0x843a('0x4'));var jsforce=require(_0x843a('0x5'));var util=require('util');var Redis=require(_0x843a('0x6'));var intUtil=require(_0x843a('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x843a('0x8'));config[_0x843a('0x9')]=_[_0x843a('0xa')](config[_0x843a('0x9')],{'host':_0x843a('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x37054a,_0x5edd0d,_0x3725e){io['to'](_0x37054a)[_0x843a('0xc')](_0x5edd0d,_0x3725e);}function getTicket(_0x502370,_0x48bf09,_0x1d8511,_0x4f3082,_0x38115e,_0x5bdf17,_0x18a350,_0x49fe51){var _0xf318fe=Object[_0x843a('0xd')]({},{'OwnerId':_0x48bf09['id'],'Subject':intUtil['getString'](_0x4f3082[_0x843a('0xe')],_0x38115e,'\x20'),'Description':intUtil[_0x843a('0xf')](_0x4f3082['Descriptions'],_0x38115e,'\x0a')},getCustomFields(_0x5bdf17,_0x38115e));if(_0x1d8511){if(_0x4f3082[_0x843a('0x10')]===_0x843a('0x11')){_0xf318fe[_0x843a('0x12')]=moment[_0x843a('0x13')]();_0xf318fe[_0x843a('0x14')]=![];_0xf318fe[_0x843a('0x15')]=![];if(_0x1d8511[_0x843a('0x16')]===_0x843a('0x17')||_0x1d8511[_0x843a('0x16')]===_0x843a('0x18')){_0xf318fe['WhoId']=_0x1d8511['id'];}else if(_0x1d8511[_0x843a('0x16')]==='account'){_0xf318fe['WhatId']=_0x1d8511['id'];}}else if(_0x4f3082[_0x843a('0x10')]===_0x843a('0x19')){if(_0x1d8511[_0x843a('0x16')]==='contact'){_0xf318fe[_0x843a('0x1a')]=_0x1d8511['id'];}else if(_0x1d8511[_0x843a('0x16')]===_0x843a('0x1b')){_0xf318fe[_0x843a('0x1c')]=_0x1d8511['id'];}else if(_0x1d8511[_0x843a('0x16')]===_0x843a('0x18')&&_0x4f3082[_0x843a('0x1d')]){_0xf318fe[_0x4f3082[_0x843a('0x1d')]]=_0x1d8511['id'];}else{logger[_0x843a('0x1e')](_0x843a('0x1f'));}}}return _0x18a350[_0x843a('0x20')](_0x4f3082[_0x843a('0x10')])[_0x843a('0x21')](_0xf318fe);}function getUser(_0x793d54,_0x264fa9,_0x1c280d){if(!_[_0x843a('0x22')](_0x264fa9)&&intUtil[_0x843a('0x23')](_0x264fa9)){var _0xf4e9de={'Email':_0x264fa9};var _0x47dde6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c280d[_0x843a('0x20')](_0x843a('0x24'))[_0x843a('0x25')](_0xf4e9de,_0x47dde6)['execute']()[_0x843a('0x26')](function(_0x36a0e7){if(_0x36a0e7[_0x843a('0x27')]){var _0x2d88e0=_[_0x843a('0x25')](_0x36a0e7,function(_0x4d52a9){return _0x4d52a9[_0x843a('0x28')]===_0x264fa9;});if(_0x2d88e0){logger[_0x843a('0x1e')](_0x843a('0x29'),_0x264fa9);return BPromise[_0x843a('0x2a')]({'id':_0x2d88e0['Id'],'name':_0x2d88e0['Name']});}}else{logger[_0x843a('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x264fa9);return _0x1c280d[_0x843a('0x2b')]()[_0x843a('0x26')](function(_0x448d3d){return BPromise[_0x843a('0x2a')]({'id':_0x448d3d[_0x843a('0x2c')],'name':_0x448d3d[_0x843a('0x2d')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x264fa9);return _0x1c280d[_0x843a('0x2b')]()[_0x843a('0x26')](function(_0x3bfb14){return BPromise['resolve']({'id':_0x3bfb14[_0x843a('0x2c')],'name':_0x3bfb14[_0x843a('0x2d')]});});}}function getEndUser(_0x398ccc,_0x55c74d,_0x31aa3d,_0x4ee0f7,_0x2d790b){var _0x16620d={'$or':{'Phone':_0x4ee0f7}};var _0x126218={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x843a('0x2a')]()[_0x843a('0x26')](function(){logger[_0x843a('0x1e')](_0x843a('0x2e'),_0x4ee0f7,_0x55c74d['moduleSearch']);switch(_0x55c74d[_0x843a('0x2f')]){case _0x843a('0x30'):var _0x31f42c=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d['additionalSearchContact']){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x32')]]=_0x4ee0f7;_['merge'](_0x31f42c[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b[_0x843a('0x20')]('Contact')[_0x843a('0x25')](_0x31f42c,_0x126218)[_0x843a('0x34')]()['then'](function(_0x4de7fb){if(_0x4de7fb&&_0x4de7fb[_0x843a('0x27')]){return _0x4de7fb;}else{var _0x12d3fa=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x35')]){var _0x14bdfc={};_0x14bdfc[_0x55c74d[_0x843a('0x35')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x12d3fa['$or'],_0x14bdfc);}return _0x2d790b[_0x843a('0x20')]('Lead')[_0x843a('0x25')](_0x12d3fa,_0x126218);}});case _0x843a('0x37'):var _0x57b6ba=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x38')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x38')]]=_0x4ee0f7;_['merge'](_0x57b6ba[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b['sobject']('Account')['find'](_0x57b6ba,_0x126218)[_0x843a('0x34')]()[_0x843a('0x26')](function(_0x54e38b){if(_0x54e38b&&_0x54e38b[_0x843a('0x27')]){return _0x54e38b;}else{var _0x2ac2f2=_['cloneDeep'](_0x16620d);if(_0x55c74d[_0x843a('0x32')]){var _0x3cec88={};_0x3cec88[_0x55c74d[_0x843a('0x32')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x2ac2f2[_0x843a('0x33')],_0x3cec88);}return _0x2d790b[_0x843a('0x20')](_0x843a('0x39'))[_0x843a('0x25')](_0x2ac2f2,_0x126218)[_0x843a('0x26')](function(_0x6251a){if(_0x6251a&&_0x6251a[_0x843a('0x27')]){return _0x6251a;}else{var _0x12e4e7=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x35')]){var _0x5485c8={};_0x5485c8[_0x55c74d[_0x843a('0x35')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x12e4e7[_0x843a('0x33')],_0x5485c8);}return _0x2d790b[_0x843a('0x20')]('Lead')[_0x843a('0x25')](_0x12e4e7,_0x126218);}});}});case _0x843a('0x17'):var _0x31f42c=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x32')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x32')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x31f42c[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b[_0x843a('0x20')](_0x843a('0x39'))[_0x843a('0x25')](_0x31f42c,_0x126218)[_0x843a('0x34')]();case _0x843a('0x18'):var _0x1eb74f=_['cloneDeep'](_0x16620d);if(_0x55c74d[_0x843a('0x35')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x35')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x1eb74f['$or'],_0x29ae0a);}return _0x2d790b['sobject'](_0x843a('0x3a'))[_0x843a('0x25')](_0x1eb74f,_0x126218);case _0x843a('0x1b'):var _0x57b6ba=_[_0x843a('0x31')](_0x16620d);if(_0x55c74d[_0x843a('0x38')]){var _0x29ae0a={};_0x29ae0a[_0x55c74d[_0x843a('0x38')]]=_0x4ee0f7;_[_0x843a('0x36')](_0x57b6ba[_0x843a('0x33')],_0x29ae0a);}return _0x2d790b[_0x843a('0x20')]('Account')['find'](_0x57b6ba,_0x126218);default:return null;}})[_0x843a('0x26')](function(_0x3c4680){if(_0x3c4680&&_0x3c4680[_0x843a('0x27')]){var _0x269243=_[_0x843a('0x3b')](_0x3c4680);if(_0x269243){return BPromise[_0x843a('0x2a')]({'id':_0x269243['Id'],'name':_0x269243[_0x843a('0x3c')],'phone':_0x269243[_0x843a('0x3d')],'endUserType':_0x269243[_0x843a('0x3e')]['type'][_0x843a('0x3f')]()});}}})['then'](function(_0x4928d2){if(_0x4928d2){logger[_0x843a('0x1e')](_0x843a('0x40'),_0x4928d2['endUserType'],_0x4ee0f7);return BPromise['resolve'](_0x4928d2);}else{logger[_0x843a('0x1e')](_0x843a('0x41'),_0x4ee0f7);var _0x3e0702={'Phone':_0x4ee0f7};if(_0x55c74d[_0x843a('0x42')]){if(_0x55c74d['moduleCreate']==='contact'){logger[_0x843a('0x1e')](_0x843a('0x43'),_0x4ee0f7,_0x55c74d['moduleCreate']);_0x3e0702[_0x843a('0x44')]=_0x31aa3d!==''?_0x31aa3d:util['format'](_0x843a('0x45'),_0x4ee0f7);}else if(_0x55c74d[_0x843a('0x42')]===_0x843a('0x18')){logger['info'](_0x843a('0x43'),_0x4ee0f7,_0x55c74d[_0x843a('0x42')]);_0x3e0702['LastName']=_0x31aa3d!==_0x843a('0x46')?_0x31aa3d:util[_0x843a('0x47')](_0x843a('0x45'),_0x4ee0f7);_0x3e0702[_0x843a('0x48')]='No\x20Company';}else if(_0x55c74d[_0x843a('0x42')]===_0x843a('0x1b')){logger[_0x843a('0x1e')](_0x843a('0x43'),_0x4ee0f7,_0x55c74d['moduleCreate']);_0x3e0702[_0x843a('0x3c')]=_0x31aa3d!==_0x843a('0x46')?_0x31aa3d:util['format'](_0x843a('0x45'),_0x4ee0f7);}else{return null;}}return _0x2d790b[_0x843a('0x20')](_[_0x843a('0x49')](_0x55c74d['moduleCreate']))['create'](_0x3e0702)[_0x843a('0x26')](function(_0x547b5e){return BPromise[_0x843a('0x2a')]({'id':_0x547b5e['id'],'endUserType':_0x55c74d[_0x843a('0x42')]});});}});}function getCustomFields(_0x30b2b9,_0x179f76){var _0x2d25f6={};if(_0x30b2b9[_0x843a('0x27')]>0x0){_[_0x843a('0x4a')](_0x30b2b9,function(_0x69abf9){if(_[_0x843a('0x4b')](['string',_0x843a('0x4c')],_0x69abf9[_0x843a('0x4d')])&&_0x69abf9[_0x843a('0x4e')]){_0x2d25f6[_0x69abf9[_0x843a('0x4e')]]=_0x69abf9['content'][_0x843a('0x4f')]();}else if(_0x69abf9[_0x843a('0x4d')]===_0x843a('0x50')&&_0x69abf9[_0x843a('0x51')]&&_0x69abf9[_0x843a('0x4e')]){_0x179f76[_0x69abf9[_0x843a('0x51')]]&&(_0x2d25f6[_0x69abf9[_0x843a('0x4e')]]=_0x179f76[_0x69abf9[_0x843a('0x51')]][_0x843a('0x4f')]());}else if(_0x69abf9[_0x843a('0x4d')]==='customVariable'&&_0x69abf9['Variable']&&_0x69abf9[_0x843a('0x52')][_0x843a('0x53')]&&_0x69abf9[_0x843a('0x4e')]){_0x179f76[_0x69abf9['Variable'][_0x843a('0x53')][_0x843a('0x3f')]()]&&(_0x2d25f6[_0x69abf9[_0x843a('0x4e')]]=_0x179f76[_0x69abf9[_0x843a('0x52')][_0x843a('0x53')]['toLowerCase']()]['toString']());}});}return _0x2d25f6;}function getConnection(_0x80ce6a){var _0x5b372e=_0x80ce6a[_0x843a('0x54')]['concat'](_0x80ce6a[_0x843a('0x55')]);var _0x18cb26=new jsforce[(_0x843a('0x56'))]({'oauth2':{'loginUrl':_0x80ce6a[_0x843a('0x57')]||_0x843a('0x58'),'clientId':_0x80ce6a[_0x843a('0x59')],'clientSecret':_0x80ce6a[_0x843a('0x5a')]}});return _0x18cb26[_0x843a('0x5b')](_0x80ce6a[_0x843a('0x5c')],_0x5b372e)[_0x843a('0x26')](function(){logger[_0x843a('0x1e')](_0x843a('0x5d'));return _0x18cb26;});}exports['queue']=function(_0xf476c6,_0x51e775,_0x2516fe,_0x5c926f,_0x336e87,_0x1343d0){var _0x566d0a,_0x751e6e,_0x37d06d,_0x5bfaa7;_0x1343d0[_0x843a('0x5e')]=intUtil[_0x843a('0x5f')](_0x1343d0[_0x843a('0x5e')]);_0x1343d0[_0x843a('0x57')]=intUtil[_0x843a('0x5f')](_0x1343d0['remoteUri']);if(_0x336e87&&_0x336e87[_0x843a('0x60')]){logger[_0x843a('0x1e')]('[QUEUE]',_0x843a('0x61'));_0x51e775['recordingURL']=util[_0x843a('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1343d0[_0x843a('0x5e')],_0x51e775['uniqueid'],md5(_0x51e775['uniqueid']));}else{_0x51e775[_0x843a('0x62')]='';}return getConnection(_0x1343d0)['then'](function(_0x3dae73){_0x5bfaa7=_0x3dae73;return getUser(_0x1343d0,_0x5c926f[_0x843a('0x63')],_0x5bfaa7);})[_0x843a('0x26')](function(_0x5e1602){_0x566d0a=_0x5e1602;return getEndUser(_0x1343d0,_0x2516fe,_0x51e775[_0x843a('0x64')],_0x51e775[_0x843a('0x65')],_0x5bfaa7);})['then'](function(_0x216636){_0x751e6e=_0x216636;return getTicket(_0x1343d0,_0x566d0a,_0x751e6e,_0x2516fe,_0x51e775,_0x2516fe['Fields'],_0x5bfaa7,_0x843a('0x66'));})['then'](function(_0x354a6e){_0x37d06d=_0x354a6e;logger[_0x843a('0x1e')](_0x843a('0x67'),_0x37d06d['id']);logger[_0x843a('0x1e')](_0x843a('0x68'),_0x37d06d['id'],_0x5c926f[_0x843a('0x53')],_0x1343d0[_0x843a('0x4d')]);switch(_0x1343d0['type']){case _0x843a('0x69'):emit(util['format'](_0x843a('0x6a'),_0x5c926f[_0x843a('0x53')]),_0x843a('0x6b'),{'recordId':_0x37d06d['id']});break;case'newTab':emit(util[_0x843a('0x47')](_0x843a('0x6a'),_0x5c926f[_0x843a('0x53')]),_0x843a('0x6c'),{'uri':util[_0x843a('0x47')](_0x843a('0x6d'),_0x5bfaa7[_0x843a('0x6e')],_0x37d06d['id'])});break;default:logger[_0x843a('0x6f')](_0x843a('0x70'));}})[_0x843a('0x71')](function(_0x23b466){logger['error'](_0x843a('0x72'),_0x23b466);});};exports[_0x843a('0x73')]=function(_0x566356,_0x122213,_0x2aba87,_0x2a06d5,_0x1e01b3,_0xeece42,_0xcc6206){var _0x3679e3,_0xf38888,_0x2c3dba,_0x4f8043;_0xeece42[_0x843a('0x5e')]=intUtil[_0x843a('0x5f')](_0xeece42[_0x843a('0x5e')]);_0xeece42[_0x843a('0x57')]=intUtil[_0x843a('0x5f')](_0xeece42['remoteUri']);if(_0xcc6206&&_0xcc6206[_0x843a('0x74')]&&_0xcc6206[_0x843a('0x74')]!==_0x843a('0x75')){logger[_0x843a('0x1e')](_0x843a('0x76'),_0x843a('0x61'));_0x122213[_0x843a('0x62')]=util[_0x843a('0x47')](_0x843a('0x77'),_0xeece42[_0x843a('0x5e')],_0x122213[_0x843a('0x78')],md5(_0x122213[_0x843a('0x78')]));}return getConnection(_0xeece42)[_0x843a('0x26')](function(_0x2ae80d){_0x4f8043=_0x2ae80d;return getUser(_0xeece42,_0x2a06d5[_0x843a('0x63')],_0x4f8043);})['then'](function(_0x8ef146){_0x3679e3=_0x8ef146;return getEndUser(_0xeece42,_0x2aba87,_0x122213['destcalleridname'],_0x122213[_0x843a('0x79')],_0x4f8043);})['then'](function(_0x49b8a9){_0xf38888=_0x49b8a9;return getTicket(_0xeece42,_0x3679e3,_0xf38888,_0x2aba87,_0x122213,_0x2aba87[_0x843a('0x7a')],_0x4f8043,_0x843a('0x73'));})['then'](function(_0x546119){_0x2c3dba=_0x546119;logger[_0x843a('0x1e')](_0x843a('0x7b'),_0x2c3dba['id']);logger[_0x843a('0x1e')](_0x843a('0x7c'),_0x2c3dba['id'],_0x2a06d5['name'],_0xeece42['type']);switch(_0xeece42[_0x843a('0x4d')]){case _0x843a('0x69'):emit(util[_0x843a('0x47')](_0x843a('0x6a'),_0x2a06d5[_0x843a('0x53')]),_0x843a('0x6b'),{'recordId':_0x2c3dba['id']});break;case'newTab':emit(util['format']('user:%s',_0x2a06d5[_0x843a('0x53')]),'trigger:browser:url',{'uri':util['format'](_0x843a('0x6d'),_0x4f8043[_0x843a('0x6e')],_0x2c3dba['id'])});break;default:logger[_0x843a('0x6f')]('[OUTBOUND]',_0x843a('0x7d'));}})['catch'](function(_0x4948fb){logger['error'](_0x843a('0x76'),_0x4948fb);});};exports[_0x843a('0x7e')]=function(_0x44f342,_0x331745,_0x114403,_0x33fa83,_0x552b19,_0x252ef5){var _0x44cf35,_0x2814c3,_0x1394cb,_0x490a49;_0x252ef5[_0x843a('0x5e')]=intUtil[_0x843a('0x5f')](_0x252ef5['serverUrl']);_0x252ef5[_0x843a('0x57')]=intUtil['stripTrailingSlash'](_0x252ef5[_0x843a('0x57')]);if(_0x552b19&&_0x552b19[_0x843a('0x60')]){logger[_0x843a('0x1e')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+']',_0x843a('0x61'));_0x331745[_0x843a('0x62')]=util[_0x843a('0x47')](_0x843a('0x77'),_0x252ef5['serverUrl'],_0x331745[_0x843a('0x78')],md5(_0x331745['uniqueid']));}else{_0x331745[_0x843a('0x62')]='';}return getConnection(_0x252ef5)[_0x843a('0x26')](function(_0x280036){_0x490a49=_0x280036;if(!_[_0x843a('0x22')](_0x33fa83)){return getUser(_0x252ef5,_0x33fa83[_0x843a('0x53')],_0x490a49);}else{return getUser(_0x252ef5,null,_0x490a49);}})[_0x843a('0x26')](function(_0x446517){_0x44cf35=_0x446517;return getEndUser(_0x252ef5,_0x114403,_0x331745[_0x843a('0x64')],_0x331745[_0x843a('0x65')],_0x490a49);})['then'](function(_0x41295a){_0x2814c3=_0x41295a;return getTicket(_0x252ef5,_0x44cf35,_0x2814c3,_0x114403,_0x331745,_0x114403[_0x843a('0x7a')],_0x490a49);})[_0x843a('0x26')](function(_0x5d5db4){_0x1394cb=_0x5d5db4;logger[_0x843a('0x1e')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+_0x843a('0x81'),_0x1394cb['id']);logger[_0x843a('0x1e')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+_0x843a('0x82'),_0x252ef5['type']);})[_0x843a('0x71')](function(_0x17e0b1){logger[_0x843a('0x6f')]('['+_0x331745[_0x843a('0x7f')][_0x843a('0x80')]()+']',_0x17e0b1);});}; \ 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 defddb9..3911c33 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 _0xb0f1=['stripTrailingSlash','serverUrl','%s/api/now/table/','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','length','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','picklist','type','customField','nameField','toString','includes','idField','toLowerCase','content','Variable','name',']\x20getTicket\x20input\x20crm','endUserId','POST','incident','assign','Subjects','getString','Descriptions','Fields','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri'];(function(_0x84eba4,_0x150755){var _0x5258bb=function(_0x2e8dad){while(--_0x2e8dad){_0x84eba4['push'](_0x84eba4['shift']());}};_0x5258bb(++_0x150755);}(_0xb0f1,0x14b));var _0x1b0f=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xb0f1[_0x2cfb58];return _0xd99951;};'use strict';var _=require('lodash');var Promise=require(_0x1b0f('0x0'));var rp=require(_0x1b0f('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0x1b0f('0x2'));var intUtil=require(_0x1b0f('0x3'));var config=require(_0x1b0f('0x4'));var logger=require(_0x1b0f('0x5'))(_0x1b0f('0x6'));config[_0x1b0f('0x7')]=_['defaults'](config['redis'],{'host':_0x1b0f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b0f('0x7')]));function getAdminUser(_0xe3a70a,_0x1705db,_0x3e31db,_0x4caa75,_0x30617c,_0x14fbaa){return new Promise(function(_0x4642b0,_0x149d35){var _0xe109e4={'method':_0x1b0f('0x9'),'uri':_0x4caa75+_0x1b0f('0xa')+'&'+_0x30617c+'&'+_0x14fbaa,'auth':_0x1705db,'json':!![]};return rp(_0xe109e4)[_0x1b0f('0xb')](function(_0x29f365){if(_0x29f365[_0x1b0f('0xc')]['length']>0x0){_0x3e31db[_0x1b0f('0xd')]=_0x29f365[_0x1b0f('0xc')][0x0][_0x1b0f('0xe')];}logger[_0x1b0f('0xf')]('['+[_0xe3a70a[_0x1b0f('0x10')]()]+'],\x20getAdminUser\x20crm',_0x3e31db);_0x4642b0(_0x3e31db);})[_0x1b0f('0x11')](function(_0x264732){logger[_0x1b0f('0x12')]('['+[_0xe3a70a[_0x1b0f('0x10')]()]+']',_0x264732[_0x1b0f('0x13')]);_0x149d35(_0x264732['message']);});});}function getUser(_0x1afce4,_0x190ed2,_0x4d1db3,_0x164c86,_0x8e9d0a){return function(_0x208061){logger['info']('['+[_0x1afce4['toUpperCase']()]+_0x1b0f('0x14'),_0x208061);return new Promise(function(_0x37106c,_0x350e9e){if(intUtil['validateEmail'](_0x208061['userEmail'])){var _0x3c52eb={'method':_0x1b0f('0x9'),'uri':_0x4d1db3+_0x1b0f('0x15')+_0x208061[_0x1b0f('0x16')]+'&'+_0x164c86+'&'+_0x8e9d0a,'auth':_0x190ed2,'json':!![]};logger[_0x1b0f('0xf')]('['+[_0x1afce4[_0x1b0f('0x10')]()]+_0x1b0f('0x17'),_0x3c52eb);return rp(_0x3c52eb)[_0x1b0f('0xb')](function(_0x49ecf1){logger[_0x1b0f('0xf')]('['+[_0x1afce4[_0x1b0f('0x10')]()]+'],\x20getUser\x20entity',_0x49ecf1);if(_0x49ecf1[_0x1b0f('0xc')][_0x1b0f('0x18')]>0x0&&String(_0x49ecf1[_0x1b0f('0xc')][0x0]['active'])===_0x1b0f('0x19')){_0x208061[_0x1b0f('0x1a')]=_0x49ecf1[_0x1b0f('0xc')][0x0]['sys_id'];}else{_0x208061['userId']=_0x208061[_0x1b0f('0xd')];_0x208061['userEmail']=_0x208061[_0x1b0f('0x1b')];}logger['info']('['+[_0x1afce4[_0x1b0f('0x10')]()]+_0x1b0f('0x1c'),_0x208061);_0x37106c(_0x208061);})[_0x1b0f('0x11')](function(_0x5cf242){logger[_0x1b0f('0x12')]('['+[_0x1afce4[_0x1b0f('0x10')]()]+']',_0x5cf242[_0x1b0f('0x13')]);_0x350e9e(_0x5cf242[_0x1b0f('0x13')]);});}else{logger[_0x1b0f('0xf')]('['+[_0x1afce4[_0x1b0f('0x10')]()]+_0x1b0f('0x1d'));_0x208061[_0x1b0f('0x1a')]=_0x208061[_0x1b0f('0xd')];_0x208061[_0x1b0f('0x16')]=_0x208061[_0x1b0f('0x1b')];_0x37106c(_0x208061);}});};}function createEndUser(_0x228d66,_0x29d4d6,_0x4578f1,_0x10debd,_0x9b6983){logger[_0x1b0f('0xf')]('['+[_0x228d66[_0x1b0f('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x4578f1);return new Promise(function(_0x504229,_0x1b012f){var _0x50e3c7={'method':'POST','uri':_0x10debd+_0x1b0f('0x1e')+_0x9b6983,'body':{'user_name':_0x4578f1[_0x1b0f('0x1f')],'roles':_0x1b0f('0x20'),'first_name':_0x4578f1[_0x1b0f('0x1f')],'active':_0x1b0f('0x19'),'date_format':_0x1b0f('0x21'),'phone':_0x4578f1[_0x1b0f('0x1f')]},'auth':_0x29d4d6,'json':!![]};return rp(_0x50e3c7)[_0x1b0f('0xb')](function(_0x474598){logger[_0x1b0f('0xf')]('['+[_0x228d66[_0x1b0f('0x10')]()]+_0x1b0f('0x22'),_0x474598[_0x1b0f('0xc')]);_0x4578f1['endUserId']=_0x474598[_0x1b0f('0xc')][_0x1b0f('0xe')];_0x504229(_0x4578f1);})['catch'](function(_0x481ba4){logger[_0x1b0f('0x12')]('['+[_0x228d66[_0x1b0f('0x10')]()]+']',_0x481ba4[_0x1b0f('0x13')]);_0x1b012f(_0x481ba4['message']);});});}function getEndUser(_0xe2b223,_0x4fb3d0,_0x4dc693,_0x22da16,_0x32ddc6){return function(_0xb0989f){logger['info']('['+[_0xe2b223[_0x1b0f('0x10')]()]+_0x1b0f('0x23'),_0xb0989f);return new Promise(function(_0x7cf5bb,_0xd07e0a){var _0x4c6edd={'method':_0x1b0f('0x9'),'uri':_0x4dc693+_0x1b0f('0x24')+_0xb0989f['endUserNumber']+'&'+_0x22da16+'&'+_0x32ddc6,'auth':_0x4fb3d0,'json':!![]};return rp(_0x4c6edd)[_0x1b0f('0xb')](function(_0x3c069d){if(_0x3c069d[_0x1b0f('0xc')]['length']>0x0){_0xb0989f['endUserId']=_0x3c069d[_0x1b0f('0xc')][0x0]['sys_id'];logger[_0x1b0f('0xf')]('['+[_0xe2b223['toUpperCase']()]+_0x1b0f('0x25'),_0xb0989f);_0x7cf5bb(_0xb0989f);}else{return createEndUser(_0xe2b223,_0x4fb3d0,_0xb0989f,_0x4dc693,_0x22da16)['then'](function(_0x58638c){logger[_0x1b0f('0xf')]('['+[_0xe2b223[_0x1b0f('0x10')]()]+'],\x20createEndUser\x20crm',_0x58638c);_0x7cf5bb(_0x58638c);});}})[_0x1b0f('0x11')](function(_0x90795){logger[_0x1b0f('0x12')]('['+[_0xe2b223['toUpperCase']()]+']',_0x90795[_0x1b0f('0x13')]);_0xd07e0a(_0x90795[_0x1b0f('0x13')]);});});};}function getCustomFields(_0x4091da,_0x12919e){var _0x21ea21={};if(_0x4091da['length']>0x0){_[_0x1b0f('0x26')](_0x4091da,function(_0x4ca378){if(_['includes'](['string',_0x1b0f('0x27')],_0x4ca378[_0x1b0f('0x28')])&&_0x4ca378['nameField']&&!_0x4ca378[_0x1b0f('0x29')]){_0x21ea21[_0x4ca378[_0x1b0f('0x2a')]['toLowerCase']()]=_0x4ca378['content'][_0x1b0f('0x2b')]();}else if(_[_0x1b0f('0x2c')](['string',_0x1b0f('0x27')],_0x4ca378[_0x1b0f('0x28')])&&_0x4ca378[_0x1b0f('0x2d')]&&_0x4ca378[_0x1b0f('0x29')]){_0x21ea21[_0x4ca378[_0x1b0f('0x2d')][_0x1b0f('0x2e')]()]=_0x4ca378[_0x1b0f('0x2f')][_0x1b0f('0x2b')]();}else if(_0x4ca378['type']==='variable'&&_0x4ca378['variableName']&&_0x4ca378[_0x1b0f('0x2d')]&&_0x4ca378['customField']){_0x21ea21[_0x4ca378[_0x1b0f('0x2d')]['toLowerCase']()]=_0x12919e[_0x4ca378['variableName']][_0x1b0f('0x2b')]();}else if(_0x4ca378[_0x1b0f('0x28')]==='customVariable'&&_0x4ca378['Variable']&&_0x4ca378[_0x1b0f('0x30')][_0x1b0f('0x31')]&&_0x4ca378[_0x1b0f('0x2d')]&&_0x4ca378[_0x1b0f('0x29')]){_0x21ea21[_0x4ca378[_0x1b0f('0x2d')][_0x1b0f('0x2e')]()]=_0x12919e[_0x4ca378[_0x1b0f('0x30')][_0x1b0f('0x31')][_0x1b0f('0x2e')]()][_0x1b0f('0x2b')]();}});}return _0x21ea21;}function getTicket(_0x143d97,_0xf9bc23,_0x4c806b,_0x2fc7ef,_0x2ae859,_0x5421f4){return function(_0x3dc7d5){logger[_0x1b0f('0xf')]('['+[_0x143d97[_0x1b0f('0x10')]()]+_0x1b0f('0x32'),_0x3dc7d5);return new Promise(function(_0x4050e4,_0x471e8a){var _0x1f93f7=_0x143d97[_0x1b0f('0x2e')]()==='outbound'?_0x3dc7d5[_0x1b0f('0x1a')]:_0x3dc7d5[_0x1b0f('0x33')];var _0x17ec83={'method':_0x1b0f('0x34'),'uri':_0x4c806b+_0x1b0f('0x35')+'?'+_0x5421f4,'body':Object[_0x1b0f('0x36')]({},{'active':_0x1b0f('0x19'),'caller_id':_0x1f93f7,'assigned_to':_0x3dc7d5[_0x1b0f('0x1a')],'short_description':intUtil['getString'](_0x2fc7ef[_0x1b0f('0x37')],_0x2ae859,'\x20'),'description':intUtil[_0x1b0f('0x38')](_0x2fc7ef[_0x1b0f('0x39')],_0x2ae859,'\x0a')},getCustomFields(_0x2fc7ef[_0x1b0f('0x3a')],_0x2ae859)),'auth':_0xf9bc23,'json':!![]};return rp(_0x17ec83)[_0x1b0f('0xb')](function(_0x4853b2){logger[_0x1b0f('0xf')]('['+[_0x143d97[_0x1b0f('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x4853b2[_0x1b0f('0xc')]);_0x3dc7d5['ticketId']=_0x4853b2[_0x1b0f('0xc')]['sys_id'];_0x3dc7d5[_0x1b0f('0x3b')]=_0x4853b2[_0x1b0f('0xc')]['number'];logger['info']('['+[_0x143d97['toUpperCase']()]+_0x1b0f('0x3c'),_0x3dc7d5);_0x4050e4(_0x3dc7d5);})[_0x1b0f('0x11')](function(_0x36dbd9){logger[_0x1b0f('0x12')]('['+[_0x143d97[_0x1b0f('0x10')]()]+']',_0x36dbd9[_0x1b0f('0x13')]);_0x471e8a(_0x36dbd9[_0x1b0f('0x13')]);});});};}function createRemoteTag(_0x27d08e,_0xcff1e5,_0x438256,_0x55de4b){return new Promise(function(_0x452d5f,_0x1876b7){var _0x5d5dc3={'method':_0x1b0f('0x34'),'uri':_0x438256+_0x1b0f('0x3d')+'?'+_0x55de4b,'body':{'short_description':_0x27d08e,'global':!![],'active':!![],'name':_0x27d08e},'auth':_0xcff1e5,'json':!![]};return rp(_0x5d5dc3)[_0x1b0f('0xb')](function(_0x1e5b46){var _0x5d20f7=_0x1e5b46[_0x1b0f('0xc')][_0x1b0f('0xe')];_0x452d5f(_0x5d20f7);});});}function getRemoteTag(_0x413be6,_0x3cedd8,_0x26995a,_0x1f540e,_0x1ece0f){return new Promise(function(_0x280fc8,_0x4b0d62){var _0x16a90b={'method':_0x1b0f('0x9'),'uri':_0x26995a+_0x1b0f('0x3d')+_0x1b0f('0x3e')+_0x413be6+'&'+_0x1f540e,'auth':_0x3cedd8,'json':!![]};return rp(_0x16a90b)[_0x1b0f('0xb')](function(_0x4de97a){if(_0x4de97a[_0x1b0f('0xc')][_0x1b0f('0x18')]>0x0){var _0x3811b8=_0x4de97a[_0x1b0f('0xc')][0x0][_0x1b0f('0xe')];_0x280fc8(_0x3811b8);}else{return createRemoteTag(_0x413be6,_0x3cedd8,_0x26995a,_0x1f540e)[_0x1b0f('0xb')](function(_0x288967){_0x280fc8(_0x288967);});}});});}function assignTagToIncident(_0x40a5e7,_0x346e2c,_0x1b52ed,_0x1853c0,_0x5cdf1b){return new Promise(function(_0x4473e2,_0x143d9a){var _0x4d60ea={'method':_0x1b0f('0x34'),'uri':_0x1b52ed+_0x1b0f('0x3f')+'?'+_0x5cdf1b,'body':{'label':_0x40a5e7,'table':_0x1b0f('0x35'),'id_type':_0x1b0f('0x40'),'table_key':_0x1853c0[_0x1b0f('0x41')],'title':_0x1b0f('0x42')+_0x1853c0['ticketNumber'],'id_display':_0x1853c0[_0x1b0f('0x3b')]},'auth':_0x346e2c,'json':!![]};return rp(_0x4d60ea)[_0x1b0f('0xb')](function(_0x539edf){_0x4473e2();})[_0x1b0f('0x11')](function(){_0x4473e2();});});}function manageTags(_0x38e89e,_0x3469b3,_0x39fe3b,_0xfaa03e,_0x1e1be4,_0x4b7b54,_0x64d19f){return new Promise(function(_0x1c9730,_0x4cac29){var _0xa20cb1=[];_0x3469b3[_0x1b0f('0x26')](function(_0x343991){_0xa20cb1[_0x1b0f('0x43')](getRemoteTag(_0x343991,_0x39fe3b,_0xfaa03e,_0x4b7b54,_0x64d19f));});return Promise[_0x1b0f('0x44')](_0xa20cb1)[_0x1b0f('0xb')](function(_0x5c309b){if(_0x5c309b[_0x1b0f('0x18')]){logger[_0x1b0f('0xf')]('['+[_0x38e89e[_0x1b0f('0x10')]()]+_0x1b0f('0x45'),_0x5c309b);var _0x2c2b86=[];_0x5c309b[_0x1b0f('0x26')](function(_0x2deeaf){_0x2c2b86['push'](assignTagToIncident(_0x2deeaf,_0x39fe3b,_0xfaa03e,_0x1e1be4,_0x4b7b54));});return Promise[_0x1b0f('0x44')](_0x2c2b86)[_0x1b0f('0xb')](function(){_0x1c9730();})[_0x1b0f('0x11')](function(){_0x1c9730();});}else{_0x1c9730();}});});}function getTags(_0x1fe0f6,_0x2cc95a,_0x572dc6,_0x2ec669,_0x4ec238,_0x27cebe){return function(_0x1a2876){return new Promise(function(_0x5a75b5,_0x23a5c5){var _0x142d03=[];var _0x154656=_0x2ec669[_0x1b0f('0x46')];if(_0x154656&&_0x154656['length']>0x0){_0x142d03=_[_0x1b0f('0x47')](_0x154656,'name');}if(_0x142d03[_0x1b0f('0x18')]>0x0){return manageTags(_0x1fe0f6,_0x142d03,_0x2cc95a,_0x572dc6,_0x1a2876,_0x4ec238,_0x27cebe)[_0x1b0f('0xb')](function(){_0x5a75b5(_0x1a2876);});}else{_0x5a75b5(_0x1a2876);}});};}function emit(_0x222857,_0x288c2e,_0x210d8d){var _0xf8bf49=_0x1b0f('0x48')+_0x1b0f('0x49')+_0x1b0f('0x4a')+'%255EORDERBYDESCnumber';var _0x4a4d6e={'uri':_0x222857+_0x1b0f('0x4b')+_0x210d8d+_0xf8bf49};io['to'](util[_0x1b0f('0x4c')](_0x1b0f('0x4d'),_0x288c2e))[_0x1b0f('0x4e')](_0x1b0f('0x4f'),_0x4a4d6e);}exports['cs']=function(_0x4c6904,_0x288791,_0xb9fa27,_0x53143c,_0x5f15f0,_0x2d66f2,_0x4f5402,_0x28a527){var _0xdcb071={};var _0x26f06b={'user':_0x2d66f2[_0x1b0f('0x50')],'pass':_0x2d66f2[_0x1b0f('0x51')]};var _0x495d01=_0x1b0f('0x52');var _0x490013=_0x1b0f('0x53');_0x2d66f2[_0x1b0f('0x54')]=intUtil[_0x1b0f('0x55')](_0x2d66f2[_0x1b0f('0x54')]);_0x2d66f2['serverUrl']=intUtil['stripTrailingSlash'](_0x2d66f2[_0x1b0f('0x56')]);var _0x2ddf66=util[_0x1b0f('0x4c')](_0x1b0f('0x57'),_0x2d66f2[_0x1b0f('0x54')]);_0xdcb071[_0x1b0f('0x16')]=!_['isNil'](_0x53143c)?_0x53143c['email']:null;_0xdcb071[_0x1b0f('0x1b')]=_0x2d66f2['email'];_0xdcb071[_0x1b0f('0x1f')]=_0x28a527[_0x1b0f('0x2e')]()===_0x1b0f('0x58')?_0x288791[_0x1b0f('0x59')]:_0x288791['calleridnum'];_0xdcb071[_0x1b0f('0x5a')]=_0x28a527===_0x1b0f('0x5b')||_0x28a527===_0x1b0f('0x5c')?_0x1b0f('0x5b'):_0x1b0f('0x58');var _0x144349=util['format'](_0x1b0f('0x5d'),_0x2d66f2[_0x1b0f('0x56')],_0x288791[_0x1b0f('0x5e')],md5(_0x288791[_0x1b0f('0x5e')]));if(_0x5f15f0&&_0x5f15f0['monitor_format']){logger['info'](_0x1b0f('0x5f'),_0x1b0f('0x60'));_0x288791[_0x1b0f('0x61')]=_0x144349;}else if(_0x4f5402&&_0x4f5402[_0x1b0f('0x62')]&&_0x4f5402['recordingFormat']!=='none'){logger[_0x1b0f('0xf')](_0x1b0f('0x63'),'Recording\x20is\x20enabled!');_0x288791[_0x1b0f('0x61')]=_0x144349;}else{_0x288791[_0x1b0f('0x61')]='';}return getAdminUser(_0x28a527,_0x26f06b,_0xdcb071,_0x2ddf66,_0x490013,_0x495d01)[_0x1b0f('0xb')](getUser(_0x28a527,_0x26f06b,_0x2ddf66,_0x490013,_0x495d01))[_0x1b0f('0xb')](getEndUser(_0x28a527,_0x26f06b,_0x2ddf66,_0x490013,_0x495d01))[_0x1b0f('0xb')](getTicket(_0x28a527,_0x26f06b,_0x2ddf66,_0xb9fa27,_0x288791,_0x490013))[_0x1b0f('0xb')](function(_0x4de014){logger[_0x1b0f('0xf')](util[_0x1b0f('0x4c')](_0x1b0f('0x64'),_0x4de014['ticketId']));logger['info'](util[_0x1b0f('0x4c')]('call\x20direction:\x20%s',_0x28a527));if(_0x28a527!=='unmanaged'){logger[_0x1b0f('0xf')]('['+[_0x28a527['toUpperCase']()]+']',_0x1b0f('0x65'));emit(_0x2d66f2[_0x1b0f('0x54')],_0x53143c['name'],_0x4de014[_0x1b0f('0x41')]);}})[_0x1b0f('0x11')](function(_0xdc9086){logger[_0x1b0f('0x12')]('['+[_0x28a527[_0x1b0f('0x10')]()]+_0x1b0f('0x66'),util[_0x1b0f('0x67')](_0xdc9086,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcc0f=['variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','outbound','destcalleridnum','queue','unmanaged','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','./util','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','message','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toString','includes','idField','toLowerCase','content','variable'];(function(_0x5c76be,_0x463757){var _0x2c0e72=function(_0x1ec5e1){while(--_0x1ec5e1){_0x5c76be['push'](_0x5c76be['shift']());}};_0x2c0e72(++_0x463757);}(_0xcc0f,0x1e4));var _0xfcc0=function(_0x58d533,_0x2bcda3){_0x58d533=_0x58d533-0x0;var _0xfb8f79=_0xcc0f[_0x58d533];return _0xfb8f79;};'use strict';var _=require('lodash');var Promise=require(_0xfcc0('0x0'));var rp=require('request-promise');var util=require(_0xfcc0('0x1'));var md5=require(_0xfcc0('0x2'));var Redis=require(_0xfcc0('0x3'));var intUtil=require(_0xfcc0('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xfcc0('0x5'));config['redis']=_[_0xfcc0('0x6')](config[_0xfcc0('0x7')],{'host':_0xfcc0('0x8'),'port':0x18eb});var io=require(_0xfcc0('0x9'))(new Redis(config[_0xfcc0('0x7')]));function getAdminUser(_0x59fdce,_0x313d13,_0x333b47,_0x4fbeb6,_0x48ff54,_0x485d92){return new Promise(function(_0x360a90,_0x4e3af4){var _0x1c9fdd={'method':_0xfcc0('0xa'),'uri':_0x4fbeb6+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x48ff54+'&'+_0x485d92,'auth':_0x313d13,'json':!![]};return rp(_0x1c9fdd)[_0xfcc0('0xb')](function(_0x48936f){if(_0x48936f[_0xfcc0('0xc')][_0xfcc0('0xd')]>0x0){_0x333b47[_0xfcc0('0xe')]=_0x48936f['result'][0x0][_0xfcc0('0xf')];}logger['info']('['+[_0x59fdce[_0xfcc0('0x10')]()]+_0xfcc0('0x11'),_0x333b47);_0x360a90(_0x333b47);})[_0xfcc0('0x12')](function(_0x18d830){logger[_0xfcc0('0x13')]('['+[_0x59fdce[_0xfcc0('0x10')]()]+']',_0x18d830['message']);_0x4e3af4(_0x18d830['message']);});});}function getUser(_0x527888,_0x2ff972,_0x6da411,_0x406172,_0x4bff8f){return function(_0x5280b5){logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+_0xfcc0('0x15'),_0x5280b5);return new Promise(function(_0xcec249,_0xc7c5e){if(intUtil[_0xfcc0('0x16')](_0x5280b5[_0xfcc0('0x17')])){var _0x278810={'method':_0xfcc0('0xa'),'uri':_0x6da411+_0xfcc0('0x18')+_0x5280b5[_0xfcc0('0x17')]+'&'+_0x406172+'&'+_0x4bff8f,'auth':_0x2ff972,'json':!![]};logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x278810);return rp(_0x278810)['then'](function(_0x25f897){logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+_0xfcc0('0x19'),_0x25f897);if(_0x25f897[_0xfcc0('0xc')]['length']>0x0&&String(_0x25f897[_0xfcc0('0xc')][0x0][_0xfcc0('0x1a')])===_0xfcc0('0x1b')){_0x5280b5['userId']=_0x25f897['result'][0x0][_0xfcc0('0xf')];}else{_0x5280b5[_0xfcc0('0x1c')]=_0x5280b5['adminId'];_0x5280b5[_0xfcc0('0x17')]=_0x5280b5[_0xfcc0('0x1d')];}logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+_0xfcc0('0x1e'),_0x5280b5);_0xcec249(_0x5280b5);})[_0xfcc0('0x12')](function(_0x156efe){logger['error']('['+[_0x527888['toUpperCase']()]+']',_0x156efe['message']);_0xc7c5e(_0x156efe[_0xfcc0('0x1f')]);});}else{logger[_0xfcc0('0x14')]('['+[_0x527888[_0xfcc0('0x10')]()]+']\x20using\x20admin\x20profile');_0x5280b5[_0xfcc0('0x1c')]=_0x5280b5[_0xfcc0('0xe')];_0x5280b5[_0xfcc0('0x17')]=_0x5280b5[_0xfcc0('0x1d')];_0xcec249(_0x5280b5);}});};}function createEndUser(_0x2aa45e,_0x1a20bf,_0x13f3d2,_0x192e46,_0x34d5ce){logger[_0xfcc0('0x14')]('['+[_0x2aa45e[_0xfcc0('0x10')]()]+_0xfcc0('0x20'),_0x13f3d2);return new Promise(function(_0x5beb3b,_0x3bafd5){var _0x5c44e2={'method':_0xfcc0('0x21'),'uri':_0x192e46+_0xfcc0('0x22')+_0x34d5ce,'body':{'user_name':_0x13f3d2[_0xfcc0('0x23')],'roles':_0xfcc0('0x24'),'first_name':_0x13f3d2['endUserNumber'],'active':'true','date_format':_0xfcc0('0x25'),'phone':_0x13f3d2['endUserNumber']},'auth':_0x1a20bf,'json':!![]};return rp(_0x5c44e2)[_0xfcc0('0xb')](function(_0x2fc7ff){logger[_0xfcc0('0x14')]('['+[_0x2aa45e['toUpperCase']()]+_0xfcc0('0x26'),_0x2fc7ff['result']);_0x13f3d2[_0xfcc0('0x27')]=_0x2fc7ff['result']['sys_id'];_0x5beb3b(_0x13f3d2);})[_0xfcc0('0x12')](function(_0x283aad){logger[_0xfcc0('0x13')]('['+[_0x2aa45e[_0xfcc0('0x10')]()]+']',_0x283aad['message']);_0x3bafd5(_0x283aad[_0xfcc0('0x1f')]);});});}function getEndUser(_0x1710f3,_0x1a6563,_0x3230ba,_0x4ae67b,_0x25fbae){return function(_0x160a28){logger[_0xfcc0('0x14')]('['+[_0x1710f3[_0xfcc0('0x10')]()]+_0xfcc0('0x28'),_0x160a28);return new Promise(function(_0xd0384e,_0x30f240){var _0x4baece={'method':_0xfcc0('0xa'),'uri':_0x3230ba+_0xfcc0('0x29')+_0x160a28[_0xfcc0('0x23')]+'&'+_0x4ae67b+'&'+_0x25fbae,'auth':_0x1a6563,'json':!![]};return rp(_0x4baece)[_0xfcc0('0xb')](function(_0x145e89){if(_0x145e89[_0xfcc0('0xc')][_0xfcc0('0xd')]>0x0){_0x160a28[_0xfcc0('0x27')]=_0x145e89[_0xfcc0('0xc')][0x0][_0xfcc0('0xf')];logger[_0xfcc0('0x14')]('['+[_0x1710f3['toUpperCase']()]+_0xfcc0('0x2a'),_0x160a28);_0xd0384e(_0x160a28);}else{return createEndUser(_0x1710f3,_0x1a6563,_0x160a28,_0x3230ba,_0x4ae67b)[_0xfcc0('0xb')](function(_0x46337c){logger[_0xfcc0('0x14')]('['+[_0x1710f3['toUpperCase']()]+_0xfcc0('0x2b'),_0x46337c);_0xd0384e(_0x46337c);});}})[_0xfcc0('0x12')](function(_0x53213a){logger[_0xfcc0('0x13')]('['+[_0x1710f3['toUpperCase']()]+']',_0x53213a[_0xfcc0('0x1f')]);_0x30f240(_0x53213a[_0xfcc0('0x1f')]);});});};}function getCustomFields(_0x561e22,_0x261c13){var _0x33fdfb={};if(_0x561e22[_0xfcc0('0xd')]>0x0){_[_0xfcc0('0x2c')](_0x561e22,function(_0xff544a){if(_['includes']([_0xfcc0('0x2d'),_0xfcc0('0x2e')],_0xff544a[_0xfcc0('0x2f')])&&_0xff544a[_0xfcc0('0x30')]&&!_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a['nameField']['toLowerCase']()]=_0xff544a['content'][_0xfcc0('0x32')]();}else if(_[_0xfcc0('0x33')](['string',_0xfcc0('0x2e')],_0xff544a[_0xfcc0('0x2f')])&&_0xff544a[_0xfcc0('0x34')]&&_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a[_0xfcc0('0x34')][_0xfcc0('0x35')]()]=_0xff544a[_0xfcc0('0x36')][_0xfcc0('0x32')]();}else if(_0xff544a[_0xfcc0('0x2f')]===_0xfcc0('0x37')&&_0xff544a[_0xfcc0('0x38')]&&_0xff544a[_0xfcc0('0x34')]&&_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a[_0xfcc0('0x34')][_0xfcc0('0x35')]()]=_0x261c13[_0xff544a['variableName']]['toString']();}else if(_0xff544a['type']===_0xfcc0('0x39')&&_0xff544a['Variable']&&_0xff544a[_0xfcc0('0x3a')]['name']&&_0xff544a[_0xfcc0('0x34')]&&_0xff544a[_0xfcc0('0x31')]){_0x33fdfb[_0xff544a[_0xfcc0('0x34')][_0xfcc0('0x35')]()]=_0x261c13[_0xff544a[_0xfcc0('0x3a')][_0xfcc0('0x3b')][_0xfcc0('0x35')]()][_0xfcc0('0x32')]();}});}return _0x33fdfb;}function getTicket(_0x2d3f9c,_0x14e8b1,_0x38d1fb,_0x2ca08d,_0x3e76c3,_0x144ded){return function(_0x2d6fc6){logger[_0xfcc0('0x14')]('['+[_0x2d3f9c['toUpperCase']()]+_0xfcc0('0x3c'),_0x2d6fc6);return new Promise(function(_0x27034f,_0x1c84ca){var _0x3a9a4b=_0x2d3f9c[_0xfcc0('0x35')]()==='outbound'?_0x2d6fc6[_0xfcc0('0x1c')]:_0x2d6fc6[_0xfcc0('0x27')];var _0x17f75e={'method':_0xfcc0('0x21'),'uri':_0x38d1fb+_0xfcc0('0x3d')+'?'+_0x144ded,'body':Object[_0xfcc0('0x3e')]({},{'active':_0xfcc0('0x1b'),'caller_id':_0x3a9a4b,'assigned_to':_0x2d6fc6['userId'],'short_description':intUtil[_0xfcc0('0x3f')](_0x2ca08d['Subjects'],_0x3e76c3,'\x20'),'description':intUtil['getString'](_0x2ca08d[_0xfcc0('0x40')],_0x3e76c3,'\x0a')},getCustomFields(_0x2ca08d[_0xfcc0('0x41')],_0x3e76c3)),'auth':_0x14e8b1,'json':!![]};return rp(_0x17f75e)[_0xfcc0('0xb')](function(_0x2c5e8b){logger[_0xfcc0('0x14')]('['+[_0x2d3f9c[_0xfcc0('0x10')]()]+_0xfcc0('0x42'),_0x2c5e8b['result']);_0x2d6fc6[_0xfcc0('0x43')]=_0x2c5e8b[_0xfcc0('0xc')][_0xfcc0('0xf')];_0x2d6fc6['ticketNumber']=_0x2c5e8b[_0xfcc0('0xc')][_0xfcc0('0x44')];logger['info']('['+[_0x2d3f9c[_0xfcc0('0x10')]()]+']\x20getTicket\x20crm',_0x2d6fc6);_0x27034f(_0x2d6fc6);})[_0xfcc0('0x12')](function(_0x1a6310){logger['error']('['+[_0x2d3f9c[_0xfcc0('0x10')]()]+']',_0x1a6310['message']);_0x1c84ca(_0x1a6310[_0xfcc0('0x1f')]);});});};}function createRemoteTag(_0x3d6d1f,_0x39eda4,_0x160bab,_0x1e4592){return new Promise(function(_0xb0c5ac,_0x4de4a6){var _0x32d6f0={'method':_0xfcc0('0x21'),'uri':_0x160bab+_0xfcc0('0x45')+'?'+_0x1e4592,'body':{'short_description':_0x3d6d1f,'global':!![],'active':!![],'name':_0x3d6d1f},'auth':_0x39eda4,'json':!![]};return rp(_0x32d6f0)[_0xfcc0('0xb')](function(_0xbda5a2){var _0xf7f4ae=_0xbda5a2[_0xfcc0('0xc')]['sys_id'];_0xb0c5ac(_0xf7f4ae);});});}function getRemoteTag(_0x5a5482,_0x25d0a4,_0x25062d,_0x58d5a4,_0x2e97da){return new Promise(function(_0x131f36,_0x4ad2d0){var _0x2a2b0b={'method':_0xfcc0('0xa'),'uri':_0x25062d+'label'+_0xfcc0('0x46')+_0x5a5482+'&'+_0x58d5a4,'auth':_0x25d0a4,'json':!![]};return rp(_0x2a2b0b)[_0xfcc0('0xb')](function(_0x299b0b){if(_0x299b0b[_0xfcc0('0xc')][_0xfcc0('0xd')]>0x0){var _0x3f3f94=_0x299b0b[_0xfcc0('0xc')][0x0][_0xfcc0('0xf')];_0x131f36(_0x3f3f94);}else{return createRemoteTag(_0x5a5482,_0x25d0a4,_0x25062d,_0x58d5a4)[_0xfcc0('0xb')](function(_0x1e8db6){_0x131f36(_0x1e8db6);});}});});}function assignTagToIncident(_0x3f98dc,_0x30cb6f,_0x1e6a49,_0x59d919,_0x550165){return new Promise(function(_0x3f32fd,_0x1b3765){var _0x2bca63={'method':_0xfcc0('0x21'),'uri':_0x1e6a49+'label_entry'+'?'+_0x550165,'body':{'label':_0x3f98dc,'table':_0xfcc0('0x3d'),'id_type':_0xfcc0('0x47'),'table_key':_0x59d919[_0xfcc0('0x43')],'title':_0xfcc0('0x48')+_0x59d919[_0xfcc0('0x49')],'id_display':_0x59d919['ticketNumber']},'auth':_0x30cb6f,'json':!![]};return rp(_0x2bca63)['then'](function(_0x376690){_0x3f32fd();})[_0xfcc0('0x12')](function(){_0x3f32fd();});});}function manageTags(_0x40fc01,_0x3aa83c,_0x375c63,_0x550e06,_0x413540,_0x4eedaf,_0x40dd60){return new Promise(function(_0x5b5fe5,_0x375a19){var _0x3acf6c=[];_0x3aa83c[_0xfcc0('0x2c')](function(_0x4bb319){_0x3acf6c['push'](getRemoteTag(_0x4bb319,_0x375c63,_0x550e06,_0x4eedaf,_0x40dd60));});return Promise['all'](_0x3acf6c)[_0xfcc0('0xb')](function(_0x2bd51b){if(_0x2bd51b[_0xfcc0('0xd')]){logger[_0xfcc0('0x14')]('['+[_0x40fc01[_0xfcc0('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2bd51b);var _0x2a0366=[];_0x2bd51b[_0xfcc0('0x2c')](function(_0x23e199){_0x2a0366[_0xfcc0('0x4a')](assignTagToIncident(_0x23e199,_0x375c63,_0x550e06,_0x413540,_0x4eedaf));});return Promise['all'](_0x2a0366)[_0xfcc0('0xb')](function(){_0x5b5fe5();})[_0xfcc0('0x12')](function(){_0x5b5fe5();});}else{_0x5b5fe5();}});});}function getTags(_0x1eabdb,_0x4f3850,_0x170030,_0x2d87be,_0x5390f1,_0x52f0ac){return function(_0x399800){return new Promise(function(_0xd94c9d,_0x4bdcc4){var _0x4b04e5=[];var _0x66e5c=_0x2d87be[_0xfcc0('0x4b')];if(_0x66e5c&&_0x66e5c[_0xfcc0('0xd')]>0x0){_0x4b04e5=_['map'](_0x66e5c,_0xfcc0('0x3b'));}if(_0x4b04e5[_0xfcc0('0xd')]>0x0){return manageTags(_0x1eabdb,_0x4b04e5,_0x4f3850,_0x170030,_0x399800,_0x5390f1,_0x52f0ac)[_0xfcc0('0xb')](function(){_0xd94c9d(_0x399800);});}else{_0xd94c9d(_0x399800);}});};}function emit(_0xb66351,_0x3f8849,_0x44cb7d){var _0x4a4094=_0xfcc0('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xfcc0('0x4d')+_0xfcc0('0x4e');var _0x91b88d={'uri':_0xb66351+_0xfcc0('0x4f')+_0x44cb7d+_0x4a4094};io['to'](util[_0xfcc0('0x50')](_0xfcc0('0x51'),_0x3f8849))[_0xfcc0('0x52')](_0xfcc0('0x53'),_0x91b88d);}exports['cs']=function(_0x30ac58,_0x40f4c8,_0x49fffa,_0x1e9bf8,_0x35c017,_0x29d599,_0x5d7da4,_0x33d186){var _0x1dcd70={};var _0x21dcb8={'user':_0x29d599[_0xfcc0('0x54')],'pass':_0x29d599[_0xfcc0('0x55')]};var _0x46883c=_0xfcc0('0x56');var _0x4a8148='sysparm_display_value=true';_0x29d599[_0xfcc0('0x57')]=intUtil[_0xfcc0('0x58')](_0x29d599[_0xfcc0('0x57')]);_0x29d599['serverUrl']=intUtil[_0xfcc0('0x58')](_0x29d599[_0xfcc0('0x59')]);var _0x547c91=util[_0xfcc0('0x50')](_0xfcc0('0x5a'),_0x29d599[_0xfcc0('0x57')]);_0x1dcd70[_0xfcc0('0x17')]=!_[_0xfcc0('0x5b')](_0x1e9bf8)?_0x1e9bf8['email']:null;_0x1dcd70[_0xfcc0('0x1d')]=_0x29d599['email'];_0x1dcd70['endUserNumber']=_0x33d186[_0xfcc0('0x35')]()===_0xfcc0('0x5c')?_0x40f4c8[_0xfcc0('0x5d')]:_0x40f4c8['calleridnum'];_0x1dcd70['callDirection']=_0x33d186===_0xfcc0('0x5e')||_0x33d186===_0xfcc0('0x5f')?_0xfcc0('0x5e'):_0xfcc0('0x5c');var _0x52a859=util[_0xfcc0('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29d599[_0xfcc0('0x59')],_0x40f4c8[_0xfcc0('0x60')],md5(_0x40f4c8[_0xfcc0('0x60')]));if(_0x35c017&&_0x35c017[_0xfcc0('0x61')]){logger[_0xfcc0('0x14')]('[QUEUE]','Recording\x20is\x20enabled!');_0x40f4c8[_0xfcc0('0x62')]=_0x52a859;}else if(_0x5d7da4&&_0x5d7da4[_0xfcc0('0x63')]&&_0x5d7da4[_0xfcc0('0x63')]!==_0xfcc0('0x64')){logger[_0xfcc0('0x14')](_0xfcc0('0x65'),_0xfcc0('0x66'));_0x40f4c8['recordingURL']=_0x52a859;}else{_0x40f4c8[_0xfcc0('0x62')]='';}return getAdminUser(_0x33d186,_0x21dcb8,_0x1dcd70,_0x547c91,_0x4a8148,_0x46883c)[_0xfcc0('0xb')](getUser(_0x33d186,_0x21dcb8,_0x547c91,_0x4a8148,_0x46883c))['then'](getEndUser(_0x33d186,_0x21dcb8,_0x547c91,_0x4a8148,_0x46883c))[_0xfcc0('0xb')](getTicket(_0x33d186,_0x21dcb8,_0x547c91,_0x49fffa,_0x40f4c8,_0x4a8148))['then'](function(_0x2fbf03){logger[_0xfcc0('0x14')](util[_0xfcc0('0x50')](_0xfcc0('0x67'),_0x2fbf03[_0xfcc0('0x43')]));logger[_0xfcc0('0x14')](util[_0xfcc0('0x50')](_0xfcc0('0x68'),_0x33d186));if(_0x33d186!==_0xfcc0('0x5f')){logger['info']('['+[_0x33d186[_0xfcc0('0x10')]()]+']',_0xfcc0('0x69'));emit(_0x29d599[_0xfcc0('0x57')],_0x1e9bf8[_0xfcc0('0x3b')],_0x2fbf03[_0xfcc0('0x43')]);}})[_0xfcc0('0x12')](function(_0x586dcc){logger[_0xfcc0('0x13')]('['+[_0x33d186[_0xfcc0('0x10')]()]+_0xfcc0('0x6a'),util[_0xfcc0('0x6b')](_0x586dcc,{'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 6c13494..35dbc20 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 _0xb8a4=['localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','created_by','Descriptions','date_start','slice','replace','duration_minutes','Contacts','parent_name','name','length','forEach','idField','set_entry','JSON','Calls','apiKey','toString','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','user_name','value','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','type','string','nameField','toLowerCase','customField','custom_fields','push','content','variable','variableName','customVariable','Variable','login','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','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','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Outbound','The\x20Ticket\x20ID\x20is:','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','calleridname','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults'];(function(_0x1ca4c3,_0x554126){var _0x4426a6=function(_0x11e9b0){while(--_0x11e9b0){_0x1ca4c3['push'](_0x1ca4c3['shift']());}};_0x4426a6(++_0x554126);}(_0xb8a4,0xde));var _0x4b8a=function(_0x18d28b,_0x7d3f5){_0x18d28b=_0x18d28b-0x0;var _0x11d4c0=_0xb8a4[_0x18d28b];return _0x11d4c0;};'use strict';var _=require(_0x4b8a('0x0'));var rp=require(_0x4b8a('0x1'));var BPromise=require(_0x4b8a('0x2'));var md5=require('md5');var util=require(_0x4b8a('0x3'));var Redis=require(_0x4b8a('0x4'));var intUtil=require(_0x4b8a('0x5'));var config=require('../../../../config/environment');var logger=require(_0x4b8a('0x6'))(_0x4b8a('0x7'));config[_0x4b8a('0x8')]=_[_0x4b8a('0x9')](config['redis'],{'host':_0x4b8a('0xa'),'port':0x18eb});var io=require(_0x4b8a('0xb'))(new Redis(config[_0x4b8a('0x8')]));var def={'method':_0x4b8a('0xc'),'json':!![]};function emit(_0x34dd3f,_0x59458e,_0x361287){io['to'](_0x34dd3f)[_0x4b8a('0xd')](_0x59458e,_0x361287);}function getTicket(_0x3f052a,_0x4cc61c,_0x31cf04,_0x130f70,_0x420862,_0x1a33af,_0x51601c,_0x115a1f){logger[_0x4b8a('0xe')](_0x4b8a('0xf'));var _0x3852ff=new Date();var _0x5bbaa4=[{'name':'name','value':intUtil[_0x4b8a('0x10')](_0x130f70['Subjects'],_0x420862,'\x20')},{'name':_0x4b8a('0x11'),'value':_0x4cc61c['id']},{'name':_0x4b8a('0x12'),'value':_0x4cc61c['id']},{'name':'description','value':intUtil[_0x4b8a('0x10')](_0x130f70[_0x4b8a('0x13')],_0x420862,'\x0a')},{'name':_0x4b8a('0x14'),'value':_0x3852ff['toISOString']()[_0x4b8a('0x15')](0x0,0x13)[_0x4b8a('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x4b8a('0x17'),'value':'15'},{'name':'parent_id','value':_0x31cf04['id']},{'name':'parent_type','value':_0x4b8a('0x18')},{'name':_0x4b8a('0x19'),'value':_0x31cf04[_0x4b8a('0x1a')]},{'name':'direction','value':_0x115a1f}];if(_0x1a33af[_0x4b8a('0x1b')]){_[_0x4b8a('0x1c')](_0x1a33af,function(_0x121d32){if(_0x420862[_0x121d32['variableName']]){_0x5bbaa4['push']({'name':_0x121d32[_0x4b8a('0x1d')],'value':_0x420862[_0x121d32['variableName']]});}});}return request({'form':{'method':_0x4b8a('0x1e'),'input_type':_0x4b8a('0x1f'),'response_type':_0x4b8a('0x1f'),'rest_data':JSON['stringify']({'session':_0x51601c['id'],'module_name':_0x4b8a('0x20'),'name_value_list':_0x5bbaa4})}});}function getAuth(_0x46ff46){return util['format']('Basic\x20%s',new Buffer(_0x46ff46[_0x4b8a('0x21')]+':X')[_0x4b8a('0x22')]('base64'));}function getServerInfo(_0x4971f5){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x4b8a('0x1f'),'rest_data':JSON[_0x4b8a('0x23')]({'session':_0x4971f5['id']})}});}function getUser(_0x1bcda2,_0x4a6e3c,_0x1ddfaa){if(!_[_0x4b8a('0x24')](_0x4a6e3c)){logger[_0x4b8a('0xe')](_0x4b8a('0x25'),_0x4a6e3c);return request({'form':{'method':_0x4b8a('0x26'),'input_type':_0x4b8a('0x1f'),'response_type':_0x4b8a('0x1f'),'rest_data':JSON[_0x4b8a('0x23')]({'session':_0x1ddfaa['id'],'module_name':_0x4b8a('0x27'),'query':util[_0x4b8a('0x28')](_0x4b8a('0x29'),_0x4a6e3c),'order_by':'','offset':'0','select_fields':['id',_0x4b8a('0x1a'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xb597e){if(_0xb597e[_0x4b8a('0x2a')]['length']){var _0x49c0fa=_[_0x4b8a('0x2b')](_0xb597e[_0x4b8a('0x2a')],function(_0x5214d2){return _0x5214d2['name_value_list'][_0x4b8a('0x2c')][_0x4b8a('0x2d')]===_0x4a6e3c;});if(_0x49c0fa){logger[_0x4b8a('0xe')]('Agent\x20found!');return BPromise['resolve']({'id':_0x49c0fa[_0x4b8a('0x2e')]['id']['value'],'name':_0x49c0fa['name_value_list'][_0x4b8a('0x1a')][_0x4b8a('0x2d')]});}}logger[_0x4b8a('0xe')](_0x4b8a('0x2f'));return BPromise[_0x4b8a('0x30')]({'id':_0x1ddfaa[_0x4b8a('0x2e')][_0x4b8a('0x31')][_0x4b8a('0x2d')],'name':_0x1ddfaa[_0x4b8a('0x2e')][_0x4b8a('0x2c')][_0x4b8a('0x2d')]});});}else{logger[_0x4b8a('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4b8a('0x30')]({'id':_0x1ddfaa[_0x4b8a('0x2e')][_0x4b8a('0x31')][_0x4b8a('0x2d')],'name':_0x1ddfaa[_0x4b8a('0x2e')][_0x4b8a('0x2c')][_0x4b8a('0x2d')]});}}function getEndUser(_0x4eceb0,_0x32f80e,_0x15d106,_0x3c6c85){logger[_0x4b8a('0xe')](_0x4b8a('0x32'),_0x15d106);return request({'form':{'method':_0x4b8a('0x26'),'input_type':_0x4b8a('0x1f'),'response_type':_0x4b8a('0x1f'),'rest_data':JSON[_0x4b8a('0x23')]({'session':_0x3c6c85['id'],'module_name':_0x4b8a('0x18'),'query':util[_0x4b8a('0x28')](_0x4b8a('0x33'),_0x15d106),'order_by':'','offset':'0','select_fields':['id',_0x4b8a('0x1a'),_0x4b8a('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4b8a('0x35')](function(_0x379232){if(_0x379232[_0x4b8a('0x2a')][_0x4b8a('0x1b')]){var _0x44e538=_[_0x4b8a('0x2b')](_0x379232[_0x4b8a('0x2a')],function(_0x58fc59){return _0x58fc59[_0x4b8a('0x2e')][_0x4b8a('0x34')]['value']===_0x15d106;});if(_0x44e538){logger[_0x4b8a('0xe')](_0x4b8a('0x36'));return BPromise[_0x4b8a('0x30')]({'id':_0x44e538[_0x4b8a('0x2e')]['id']['value'],'name':_0x44e538['name_value_list'][_0x4b8a('0x1a')][_0x4b8a('0x2d')],'phone':_0x44e538['name_value_list'][_0x4b8a('0x34')][_0x4b8a('0x2d')]});}}else{logger[_0x4b8a('0xe')](_0x4b8a('0x37'));return request({'form':{'method':_0x4b8a('0x1e'),'input_type':_0x4b8a('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3c6c85['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x32f80e!==_0x4b8a('0x38')?_0x32f80e:util[_0x4b8a('0x28')](_0x4b8a('0x39'),_0x15d106)},{'name':_0x4b8a('0x34'),'value':_0x15d106}]})}})['then'](function(_0xc43699){logger['info'](_0x4b8a('0x3a'));return BPromise[_0x4b8a('0x30')]({'id':_0xc43699['id'],'name':_0xc43699[_0x4b8a('0x2a')][_0x4b8a('0x3b')][_0x4b8a('0x2d')],'phone':_0xc43699[_0x4b8a('0x2a')][_0x4b8a('0x34')]['value']});});}});}function request(_0x58af73){logger[_0x4b8a('0x3c')](_0x4b8a('0x3d'),JSON['stringify'](_0x58af73));return rp(_[_0x4b8a('0x3e')](def,_0x58af73));}function getTags(_0xd31db8,_0x1df76c){var _0x2b4f36=[];if(_0xd31db8&&_0xd31db8[_0x4b8a('0x1b')]>0x0){_0x2b4f36=_['map'](_0xd31db8,_0x1df76c);}return _0x2b4f36;}function getCustomFields(_0x2dbb4f,_0x2c80a6){var _0x25c406=[];var _0x490f3c={'custom_fields':[]};if(_0x2dbb4f['length']>0x0){_['forEach'](_0x2dbb4f,function(_0x5dd6e3){if(_0x5dd6e3[_0x4b8a('0x3f')]===_0x4b8a('0x40')&&_0x5dd6e3[_0x4b8a('0x41')]&&!_0x5dd6e3['customField']){_0x490f3c[_0x5dd6e3[_0x4b8a('0x41')][_0x4b8a('0x42')]()]=_0x5dd6e3['content']['toString']();}else if(_0x5dd6e3[_0x4b8a('0x3f')]===_0x4b8a('0x40')&&_0x5dd6e3[_0x4b8a('0x1d')]&&_0x5dd6e3[_0x4b8a('0x43')]){_0x490f3c[_0x4b8a('0x44')][_0x4b8a('0x45')]({'id':_0x5dd6e3[_0x4b8a('0x1d')],'value':_0x5dd6e3[_0x4b8a('0x46')][_0x4b8a('0x22')]()});}else if(_0x5dd6e3[_0x4b8a('0x3f')]===_0x4b8a('0x47')&&_0x5dd6e3[_0x4b8a('0x48')]&&_0x5dd6e3[_0x4b8a('0x1d')]&&_0x5dd6e3[_0x4b8a('0x43')]){_0x2c80a6[_0x5dd6e3[_0x4b8a('0x48')]]&&_0x490f3c['custom_fields'][_0x4b8a('0x45')]({'id':_0x5dd6e3[_0x4b8a('0x1d')],'value':_0x2c80a6[_0x5dd6e3[_0x4b8a('0x48')]]['toString']()});}else if(_0x5dd6e3[_0x4b8a('0x3f')]===_0x4b8a('0x49')&&_0x5dd6e3['Variable']&&_0x5dd6e3[_0x4b8a('0x4a')][_0x4b8a('0x1a')]&&_0x5dd6e3[_0x4b8a('0x1d')]&&_0x5dd6e3[_0x4b8a('0x43')]){_0x2c80a6[_0x5dd6e3[_0x4b8a('0x4a')][_0x4b8a('0x1a')][_0x4b8a('0x42')]()]&&_0x490f3c['custom_fields'][_0x4b8a('0x45')]({'id':_0x5dd6e3['idField'],'value':_0x2c80a6[_0x5dd6e3[_0x4b8a('0x4a')][_0x4b8a('0x1a')][_0x4b8a('0x42')]()][_0x4b8a('0x22')]()});}});}return _0x490f3c;}function getConnection(_0x2b4b6e){return request({'method':_0x4b8a('0xc'),'form':{'method':_0x4b8a('0x4b'),'input_type':_0x4b8a('0x1f'),'response_type':_0x4b8a('0x1f'),'rest_data':JSON[_0x4b8a('0x23')]({'user_auth':{'user_name':_0x2b4b6e['username'],'password':_0x2b4b6e[_0x4b8a('0x4c')],'encryption':_0x4b8a('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4b8a('0x35')](function(_0x52a76b){var _0x204402=_0x52a76b;if(_0x204402['id']){def['sessionID']=_0x204402['id'];return BPromise[_0x4b8a('0x30')](_0x204402);}else{throw new Error(util[_0x4b8a('0x28')](_0x4b8a('0x4e'),_0x2b4b6e['id']));}});}function setRelationship(_0x5a0b38,_0x448dfc,_0x5ec2bf,_0x1e7087){return request({'form':{'method':'set_relationship','input_type':_0x4b8a('0x1f'),'response_type':_0x4b8a('0x1f'),'rest_data':JSON[_0x4b8a('0x23')]({'session':_0x5a0b38['id'],'module_name':_0x4b8a('0x20'),'module_id':_0x5ec2bf['id'],'link_field_name':_0x1e7087,'related_ids':[_0x448dfc['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4b8a('0x4f')]=function(_0x4d6e9b,_0x336edd,_0x107a4c,_0x178326,_0x53f715,_0x35e65c){var _0x18c4ff,_0x2bc1c1,_0x4b5d4d,_0x53678c;_0x35e65c[_0x4b8a('0x50')]=intUtil[_0x4b8a('0x51')](_0x35e65c[_0x4b8a('0x50')]);_0x35e65c['serverUrl']=intUtil['stripTrailingSlash'](_0x35e65c[_0x4b8a('0x52')]);def[_0x4b8a('0x53')]=util['format']('%s/service/v4_1/rest.php',_0x35e65c[_0x4b8a('0x50')]);if(_0x53f715&&_0x53f715['monitor_format']){logger[_0x4b8a('0xe')]('[QUEUE]',_0x4b8a('0x54'));_0x336edd[_0x4b8a('0x55')]=util[_0x4b8a('0x28')](_0x4b8a('0x56'),_0x35e65c[_0x4b8a('0x52')],_0x336edd[_0x4b8a('0x57')],md5(_0x336edd['uniqueid']));}else{_0x336edd[_0x4b8a('0x55')]='';}return getConnection(_0x35e65c)[_0x4b8a('0x35')](function(_0x3688b2){_0x53678c=_0x3688b2;return getUser(_0x35e65c,_0x178326[_0x4b8a('0x1a')],_0x53678c);})[_0x4b8a('0x35')](function(_0x167032){_0x18c4ff=_0x167032;logger[_0x4b8a('0xe')](_0x4b8a('0x58'),_0x18c4ff['id']);return getEndUser(_0x35e65c,_0x336edd['calleridname'],_0x336edd[_0x4b8a('0x59')],_0x53678c);})[_0x4b8a('0x35')](function(_0x476b51){_0x2bc1c1=_0x476b51;logger['info'](_0x4b8a('0x5a'),_0x2bc1c1['id']);return getTicket(_0x35e65c,_0x18c4ff,_0x2bc1c1,_0x107a4c,_0x336edd,_0x107a4c[_0x4b8a('0x5b')],_0x53678c,_0x4b8a('0x5c'));})[_0x4b8a('0x35')](function(_0x40b9dc){_0x4b5d4d=_0x40b9dc;logger[_0x4b8a('0xe')](_0x4b8a('0x5d'));logger[_0x4b8a('0xe')]('The\x20Ticket\x20ID\x20is:',_0x4b5d4d['id']);return setRelationship(_0x53678c,_0x18c4ff,_0x4b5d4d,_0x4b8a('0x5e'));})[_0x4b8a('0x35')](function(){return setRelationship(_0x53678c,_0x2bc1c1,_0x4b5d4d,_0x4b8a('0x5f'));})[_0x4b8a('0x35')](function(){return getServerInfo(_0x53678c);})[_0x4b8a('0x35')](function(_0x11186c){var _0x6b99bc=parseInt(_0x11186c['version'][_0x4b8a('0x60')](0x0));var _0x209803=util['format'](_0x4b8a('0x61'),_0x35e65c[_0x4b8a('0x50')],_0x4b5d4d['id']);if(_0x6b99bc>0x6){_0x209803=util[_0x4b8a('0x28')](_0x4b8a('0x62'),_0x35e65c['remoteUri'],_0x4b5d4d['id']);}logger[_0x4b8a('0xe')](_0x4b8a('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4b8a('0x28')](_0x4b8a('0x64'),_0x178326[_0x4b8a('0x1a')]),_0x4b8a('0x65'),{'uri':_0x209803});})[_0x4b8a('0x66')](function(_0x5c9e91){logger[_0x4b8a('0x67')]('[QUEUE]',JSON['stringify'](_0x5c9e91));});};exports[_0x4b8a('0x68')]=function(_0x422591,_0x592364,_0x7d3cd5,_0x46eb44,_0x59d6e2,_0x30246f,_0x4e8a90){var _0x4d64f0,_0xda1740,_0x43fd6f,_0x53a33c;_0x30246f[_0x4b8a('0x50')]=intUtil[_0x4b8a('0x51')](_0x30246f[_0x4b8a('0x50')]);_0x30246f[_0x4b8a('0x52')]=intUtil['stripTrailingSlash'](_0x30246f[_0x4b8a('0x52')]);def[_0x4b8a('0x53')]=util[_0x4b8a('0x28')](_0x4b8a('0x69'),_0x30246f[_0x4b8a('0x50')]);if(_0x4e8a90&&_0x4e8a90[_0x4b8a('0x6a')]&&_0x4e8a90[_0x4b8a('0x6a')]!==_0x4b8a('0x6b')){logger['info'](_0x4b8a('0x6c'),_0x4b8a('0x54'));_0x592364[_0x4b8a('0x55')]=util[_0x4b8a('0x28')](_0x4b8a('0x56'),_0x30246f[_0x4b8a('0x52')],_0x592364['uniqueid'],md5(_0x592364[_0x4b8a('0x57')]));}return getConnection(_0x30246f)[_0x4b8a('0x35')](function(_0x3ece6f){_0x53a33c=_0x3ece6f;return getUser(_0x30246f,_0x46eb44[_0x4b8a('0x1a')],_0x53a33c);})['then'](function(_0x539d58){_0x4d64f0=_0x539d58;logger[_0x4b8a('0xe')](_0x4b8a('0x58'),_0x4d64f0['id']);return getEndUser(_0x30246f,_0x592364['destcalleridname'],_0x592364['destcalleridnum'],_0x53a33c);})[_0x4b8a('0x35')](function(_0x772453){_0xda1740=_0x772453;logger['info'](_0x4b8a('0x5a'),_0xda1740['id']);return getTicket(_0x30246f,_0x4d64f0,_0xda1740,_0x7d3cd5,_0x592364,_0x7d3cd5['Fields'],_0x53a33c,_0x4b8a('0x6d'));})[_0x4b8a('0x35')](function(_0x483916){_0x43fd6f=_0x483916;logger[_0x4b8a('0xe')](_0x4b8a('0x5d'));logger[_0x4b8a('0xe')](_0x4b8a('0x6e'),_0x43fd6f['id']);return setRelationship(_0x53a33c,_0x4d64f0,_0x43fd6f,_0x4b8a('0x5e'));})[_0x4b8a('0x35')](function(){return setRelationship(_0x53a33c,_0xda1740,_0x43fd6f,_0x4b8a('0x5f'));})[_0x4b8a('0x35')](function(){return getServerInfo(_0x53a33c);})[_0x4b8a('0x35')](function(_0x2464c9){var _0x15b6c1=parseInt(_0x2464c9[_0x4b8a('0x6f')][_0x4b8a('0x60')](0x0));var _0x195d4f=util[_0x4b8a('0x28')](_0x4b8a('0x61'),_0x30246f[_0x4b8a('0x50')],_0x43fd6f['id']);if(_0x15b6c1>0x6){_0x195d4f=util[_0x4b8a('0x28')](_0x4b8a('0x62'),_0x30246f[_0x4b8a('0x50')],_0x43fd6f['id']);}logger[_0x4b8a('0xe')](_0x4b8a('0x6c'),_0x4b8a('0x70'));emit(util[_0x4b8a('0x28')](_0x4b8a('0x64'),_0x46eb44[_0x4b8a('0x1a')]),'trigger:browser:url',{'uri':_0x195d4f});})[_0x4b8a('0x66')](function(_0x5320aa){logger[_0x4b8a('0x67')]('[OUTBOUND]',JSON[_0x4b8a('0x23')](_0x5320aa));});};exports['unmanaged']=function(_0x4ff325,_0x45520e,_0x10d937,_0x149736,_0x5c3fe6,_0x524cf7){var _0x247ad3,_0x33b436,_0x407b7f,_0x4ed3fe;_0x524cf7[_0x4b8a('0x50')]=intUtil[_0x4b8a('0x51')](_0x524cf7[_0x4b8a('0x50')]);_0x524cf7['serverUrl']=intUtil[_0x4b8a('0x51')](_0x524cf7[_0x4b8a('0x52')]);def[_0x4b8a('0x53')]=util[_0x4b8a('0x28')](_0x4b8a('0x69'),_0x524cf7['remoteUri']);if(_0x5c3fe6&&_0x5c3fe6['monitor_format']){logger['info']('['+_0x45520e[_0x4b8a('0x71')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x45520e['recordingURL']=util[_0x4b8a('0x28')](_0x4b8a('0x56'),_0x524cf7['serverUrl'],_0x45520e[_0x4b8a('0x57')],md5(_0x45520e[_0x4b8a('0x57')]));}else{_0x45520e[_0x4b8a('0x55')]='';}return getConnection(_0x524cf7)[_0x4b8a('0x35')](function(_0x5e710f){_0x4ed3fe=_0x5e710f;if(!_[_0x4b8a('0x24')](_0x149736)){return getUser(_0x524cf7,_0x149736['name'],_0x4ed3fe);}else{return getUser(_0x524cf7,null,_0x4ed3fe);}})[_0x4b8a('0x35')](function(_0x43c942){_0x247ad3=_0x43c942;logger['info'](_0x4b8a('0x58'),_0x247ad3['id']);return getEndUser(_0x524cf7,_0x45520e[_0x4b8a('0x72')],_0x45520e['calleridnum'],_0x4ed3fe);})[_0x4b8a('0x35')](function(_0x48daac){_0x33b436=_0x48daac;logger[_0x4b8a('0xe')]('The\x20Enduser\x20ID\x20is:',_0x33b436['id']);return getTicket(_0x524cf7,_0x247ad3,_0x33b436,_0x10d937,_0x45520e,_0x10d937[_0x4b8a('0x5b')],_0x4ed3fe,'Inbound');})['then'](function(_0x22d31a){_0x407b7f=_0x22d31a;logger[_0x4b8a('0xe')](_0x4b8a('0x5d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x407b7f['id']);return setRelationship(_0x4ed3fe,_0x247ad3,_0x407b7f,_0x4b8a('0x5e'));})[_0x4b8a('0x35')](function(){return setRelationship(_0x4ed3fe,_0x33b436,_0x407b7f,'contacts');})[_0x4b8a('0x35')](function(){return getServerInfo(_0x4ed3fe);})[_0x4b8a('0x66')](function(_0x1d5e90){logger['error']('['+_0x45520e['lastevent'][_0x4b8a('0x73')]()+']',JSON[_0x4b8a('0x23')](_0x1d5e90));});}; \ No newline at end of file +var _0x134e=['none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','users','contacts','[OUTBOUND]','trigger:browser:url','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','replace','duration_hours','parent_id','Contacts','parent_name','direction','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','entry_list','length','find','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','then','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat'];(function(_0x54d36b,_0xddacb2){var _0x3e8888=function(_0x3ed64a){while(--_0x3ed64a){_0x54d36b['push'](_0x54d36b['shift']());}};_0x3e8888(++_0xddacb2);}(_0x134e,0xee));var _0xe134=function(_0x5b5883,_0x4e0955){_0x5b5883=_0x5b5883-0x0;var _0xd87444=_0x134e[_0x5b5883];return _0xd87444;};'use strict';var _=require(_0xe134('0x0'));var rp=require(_0xe134('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xe134('0x2'));var Redis=require(_0xe134('0x3'));var intUtil=require(_0xe134('0x4'));var config=require(_0xe134('0x5'));var logger=require(_0xe134('0x6'))('sugarcrm');config['redis']=_[_0xe134('0x7')](config[_0xe134('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x59ced1,_0x4941d0,_0x3dad6c){io['to'](_0x59ced1)[_0xe134('0x9')](_0x4941d0,_0x3dad6c);}function getTicket(_0xb7c282,_0xc38c7c,_0x3db1b8,_0x5ecdd4,_0x2748f9,_0x239e1b,_0x1b57fc,_0x119670){logger[_0xe134('0xa')](_0xe134('0xb'));var _0x9bf196=new Date();var _0x11ef49=[{'name':'name','value':intUtil[_0xe134('0xc')](_0x5ecdd4[_0xe134('0xd')],_0x2748f9,'\x20')},{'name':_0xe134('0xe'),'value':_0xc38c7c['id']},{'name':'created_by','value':_0xc38c7c['id']},{'name':_0xe134('0xf'),'value':intUtil[_0xe134('0xc')](_0x5ecdd4[_0xe134('0x10')],_0x2748f9,'\x0a')},{'name':_0xe134('0x11'),'value':_0x9bf196['toISOString']()['slice'](0x0,0x13)[_0xe134('0x12')]('T','\x20')},{'name':_0xe134('0x13'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xe134('0x14'),'value':_0x3db1b8['id']},{'name':'parent_type','value':_0xe134('0x15')},{'name':_0xe134('0x16'),'value':_0x3db1b8['name']},{'name':_0xe134('0x17'),'value':_0x119670}];if(_0x239e1b['length']){_[_0xe134('0x18')](_0x239e1b,function(_0x13f343){if(_0x2748f9[_0x13f343[_0xe134('0x19')]]){_0x11ef49[_0xe134('0x1a')]({'name':_0x13f343['idField'],'value':_0x2748f9[_0x13f343[_0xe134('0x19')]]});}});}return request({'form':{'method':_0xe134('0x1b'),'input_type':_0xe134('0x1c'),'response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x1b57fc['id'],'module_name':_0xe134('0x1e'),'name_value_list':_0x11ef49})}});}function getAuth(_0x2176d4){return util[_0xe134('0x1f')](_0xe134('0x20'),new Buffer(_0x2176d4['apiKey']+':X')[_0xe134('0x21')]('base64'));}function getServerInfo(_0x1478c4){return request({'form':{'method':_0xe134('0x22'),'input_type':_0xe134('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1478c4['id']})}});}function getUser(_0x28f16c,_0x54c684,_0x53eddd){if(!_[_0xe134('0x23')](_0x54c684)){logger[_0xe134('0xa')](_0xe134('0x24'),_0x54c684);return request({'form':{'method':_0xe134('0x25'),'input_type':_0xe134('0x1c'),'response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x53eddd['id'],'module_name':'Employees','query':util[_0xe134('0x1f')](_0xe134('0x26'),_0x54c684),'order_by':'','offset':'0','select_fields':['id',_0xe134('0x27'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x44aad4){if(_0x44aad4[_0xe134('0x28')][_0xe134('0x29')]){var _0x197120=_[_0xe134('0x2a')](_0x44aad4[_0xe134('0x28')],function(_0x59a87f){return _0x59a87f['name_value_list'][_0xe134('0x2b')][_0xe134('0x2c')]===_0x54c684;});if(_0x197120){logger[_0xe134('0xa')](_0xe134('0x2d'));return BPromise[_0xe134('0x2e')]({'id':_0x197120['name_value_list']['id']['value'],'name':_0x197120['name_value_list'][_0xe134('0x27')][_0xe134('0x2c')]});}}logger[_0xe134('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x53eddd[_0xe134('0x2f')]['user_id'][_0xe134('0x2c')],'name':_0x53eddd['name_value_list'][_0xe134('0x2b')][_0xe134('0x2c')]});});}else{logger[_0xe134('0xa')](_0xe134('0x30'));return BPromise[_0xe134('0x2e')]({'id':_0x53eddd[_0xe134('0x2f')]['user_id'][_0xe134('0x2c')],'name':_0x53eddd[_0xe134('0x2f')][_0xe134('0x2b')][_0xe134('0x2c')]});}}function getEndUser(_0x51bc86,_0x45559e,_0x267c39,_0x42df69){logger['info']('Searching\x20enduser\x20with\x20phone',_0x267c39);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x42df69['id'],'module_name':_0xe134('0x15'),'query':util[_0xe134('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x267c39),'order_by':'','offset':'0','select_fields':['id',_0xe134('0x27'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4cf240){if(_0x4cf240[_0xe134('0x28')][_0xe134('0x29')]){var _0x351489=_['find'](_0x4cf240['entry_list'],function(_0x1ac243){return _0x1ac243[_0xe134('0x2f')][_0xe134('0x31')][_0xe134('0x2c')]===_0x267c39;});if(_0x351489){logger['info'](_0xe134('0x32'));return BPromise[_0xe134('0x2e')]({'id':_0x351489[_0xe134('0x2f')]['id']['value'],'name':_0x351489['name_value_list']['name'][_0xe134('0x2c')],'phone':_0x351489[_0xe134('0x2f')][_0xe134('0x31')][_0xe134('0x2c')]});}}else{logger[_0xe134('0xa')](_0xe134('0x33'));return request({'form':{'method':_0xe134('0x1b'),'input_type':'JSON','response_type':_0xe134('0x1c'),'rest_data':JSON[_0xe134('0x1d')]({'session':_0x42df69['id'],'module_name':_0xe134('0x15'),'name_value_list':[{'name':_0xe134('0x34'),'value':_0x45559e!==_0xe134('0x35')?_0x45559e:util[_0xe134('0x1f')](_0xe134('0x36'),_0x267c39)},{'name':_0xe134('0x31'),'value':_0x267c39}]})}})['then'](function(_0x1577e6){logger['info'](_0xe134('0x37'));return BPromise[_0xe134('0x2e')]({'id':_0x1577e6['id'],'name':_0x1577e6[_0xe134('0x28')][_0xe134('0x34')][_0xe134('0x2c')],'phone':_0x1577e6[_0xe134('0x28')][_0xe134('0x31')][_0xe134('0x2c')]});});}});}function request(_0x13472f){logger[_0xe134('0x38')]('[HTTP]',JSON[_0xe134('0x1d')](_0x13472f));return rp(_[_0xe134('0x39')](def,_0x13472f));}function getTags(_0xd1ec5a,_0x5adabc){var _0x1c0811=[];if(_0xd1ec5a&&_0xd1ec5a[_0xe134('0x29')]>0x0){_0x1c0811=_['map'](_0xd1ec5a,_0x5adabc);}return _0x1c0811;}function getCustomFields(_0x1b13ee,_0x391b00){var _0x26b1ca=[];var _0x55e887={'custom_fields':[]};if(_0x1b13ee[_0xe134('0x29')]>0x0){_['forEach'](_0x1b13ee,function(_0x582c37){if(_0x582c37[_0xe134('0x3a')]===_0xe134('0x3b')&&_0x582c37[_0xe134('0x3c')]&&!_0x582c37['customField']){_0x55e887[_0x582c37[_0xe134('0x3c')][_0xe134('0x3d')]()]=_0x582c37[_0xe134('0x3e')][_0xe134('0x21')]();}else if(_0x582c37['type']===_0xe134('0x3b')&&_0x582c37[_0xe134('0x3f')]&&_0x582c37[_0xe134('0x40')]){_0x55e887[_0xe134('0x41')][_0xe134('0x1a')]({'id':_0x582c37[_0xe134('0x3f')],'value':_0x582c37[_0xe134('0x3e')][_0xe134('0x21')]()});}else if(_0x582c37[_0xe134('0x3a')]===_0xe134('0x42')&&_0x582c37[_0xe134('0x19')]&&_0x582c37['idField']&&_0x582c37[_0xe134('0x40')]){_0x391b00[_0x582c37['variableName']]&&_0x55e887[_0xe134('0x41')][_0xe134('0x1a')]({'id':_0x582c37['idField'],'value':_0x391b00[_0x582c37[_0xe134('0x19')]][_0xe134('0x21')]()});}else if(_0x582c37[_0xe134('0x3a')]===_0xe134('0x43')&&_0x582c37[_0xe134('0x44')]&&_0x582c37['Variable']['name']&&_0x582c37['idField']&&_0x582c37['customField']){_0x391b00[_0x582c37[_0xe134('0x44')]['name'][_0xe134('0x3d')]()]&&_0x55e887[_0xe134('0x41')]['push']({'id':_0x582c37[_0xe134('0x3f')],'value':_0x391b00[_0x582c37[_0xe134('0x44')]['name'][_0xe134('0x3d')]()]['toString']()});}});}return _0x55e887;}function getConnection(_0x2828a2){return request({'method':_0xe134('0x45'),'form':{'method':_0xe134('0x46'),'input_type':_0xe134('0x1c'),'response_type':_0xe134('0x1c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2828a2[_0xe134('0x47')],'password':_0x2828a2[_0xe134('0x48')],'encryption':_0xe134('0x49')},'application':_0xe134('0x4a')})}})[_0xe134('0x4b')](function(_0x3c9c61){var _0x569737=_0x3c9c61;if(_0x569737['id']){def['sessionID']=_0x569737['id'];return BPromise[_0xe134('0x2e')](_0x569737);}else{throw new Error(util[_0xe134('0x1f')](_0xe134('0x4c'),_0x2828a2['id']));}});}function setRelationship(_0x4af06c,_0x31a46c,_0x6f3401,_0x533b5e){return request({'form':{'method':_0xe134('0x4d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe134('0x1d')]({'session':_0x4af06c['id'],'module_name':_0xe134('0x1e'),'module_id':_0x6f3401['id'],'link_field_name':_0x533b5e,'related_ids':[_0x31a46c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe134('0x4e')]=function(_0x4a66e6,_0x6db8df,_0x222ed8,_0x7f7afa,_0x4f3878,_0x5cbc84){var _0x33596f,_0x254ff0,_0x388616,_0x58c386;_0x5cbc84[_0xe134('0x4f')]=intUtil[_0xe134('0x50')](_0x5cbc84['remoteUri']);_0x5cbc84['serverUrl']=intUtil[_0xe134('0x50')](_0x5cbc84[_0xe134('0x51')]);def[_0xe134('0x52')]=util[_0xe134('0x1f')](_0xe134('0x53'),_0x5cbc84['remoteUri']);if(_0x4f3878&&_0x4f3878[_0xe134('0x54')]){logger[_0xe134('0xa')](_0xe134('0x55'),_0xe134('0x56'));_0x6db8df[_0xe134('0x57')]=util[_0xe134('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5cbc84[_0xe134('0x51')],_0x6db8df[_0xe134('0x58')],md5(_0x6db8df[_0xe134('0x58')]));}else{_0x6db8df[_0xe134('0x57')]='';}return getConnection(_0x5cbc84)['then'](function(_0x4f61ea){_0x58c386=_0x4f61ea;return getUser(_0x5cbc84,_0x7f7afa['name'],_0x58c386);})[_0xe134('0x4b')](function(_0x974d7){_0x33596f=_0x974d7;logger[_0xe134('0xa')]('The\x20User\x20ID\x20is:',_0x33596f['id']);return getEndUser(_0x5cbc84,_0x6db8df[_0xe134('0x59')],_0x6db8df[_0xe134('0x5a')],_0x58c386);})[_0xe134('0x4b')](function(_0x9aac14){_0x254ff0=_0x9aac14;logger['info'](_0xe134('0x5b'),_0x254ff0['id']);return getTicket(_0x5cbc84,_0x33596f,_0x254ff0,_0x222ed8,_0x6db8df,_0x222ed8[_0xe134('0x5c')],_0x58c386,_0xe134('0x5d'));})['then'](function(_0x24f83d){_0x388616=_0x24f83d;logger[_0xe134('0xa')](_0xe134('0x5e'));logger[_0xe134('0xa')]('The\x20Ticket\x20ID\x20is:',_0x388616['id']);return setRelationship(_0x58c386,_0x33596f,_0x388616,'users');})[_0xe134('0x4b')](function(){return setRelationship(_0x58c386,_0x254ff0,_0x388616,'contacts');})[_0xe134('0x4b')](function(){return getServerInfo(_0x58c386);})[_0xe134('0x4b')](function(_0x2e8308){var _0x36da44=parseInt(_0x2e8308[_0xe134('0x5f')][_0xe134('0x60')](0x0));var _0x283964=util[_0xe134('0x1f')](_0xe134('0x61'),_0x5cbc84[_0xe134('0x4f')],_0x388616['id']);if(_0x36da44>0x6){_0x283964=util[_0xe134('0x1f')](_0xe134('0x62'),_0x5cbc84[_0xe134('0x4f')],_0x388616['id']);}logger[_0xe134('0xa')](_0xe134('0x55'),_0xe134('0x63'));emit(util[_0xe134('0x1f')](_0xe134('0x64'),_0x7f7afa[_0xe134('0x27')]),'trigger:browser:url',{'uri':_0x283964});})[_0xe134('0x65')](function(_0x2d1bdd){logger[_0xe134('0x66')]('[QUEUE]',JSON[_0xe134('0x1d')](_0x2d1bdd));});};exports['outbound']=function(_0x45120a,_0x1c9264,_0x373cd8,_0x47e3e0,_0x287bd9,_0x46348a,_0x126ec4){var _0x489ad4,_0x774dae,_0x46a4b4,_0x242434;_0x46348a['remoteUri']=intUtil['stripTrailingSlash'](_0x46348a[_0xe134('0x4f')]);_0x46348a[_0xe134('0x51')]=intUtil[_0xe134('0x50')](_0x46348a['serverUrl']);def[_0xe134('0x52')]=util[_0xe134('0x1f')](_0xe134('0x53'),_0x46348a[_0xe134('0x4f')]);if(_0x126ec4&&_0x126ec4[_0xe134('0x67')]&&_0x126ec4[_0xe134('0x67')]!==_0xe134('0x68')){logger[_0xe134('0xa')]('[OUTBOUND]',_0xe134('0x56'));_0x1c9264[_0xe134('0x57')]=util[_0xe134('0x1f')](_0xe134('0x69'),_0x46348a[_0xe134('0x51')],_0x1c9264[_0xe134('0x58')],md5(_0x1c9264[_0xe134('0x58')]));}return getConnection(_0x46348a)[_0xe134('0x4b')](function(_0x2b70c3){_0x242434=_0x2b70c3;return getUser(_0x46348a,_0x47e3e0[_0xe134('0x27')],_0x242434);})[_0xe134('0x4b')](function(_0x55dd56){_0x489ad4=_0x55dd56;logger['info'](_0xe134('0x6a'),_0x489ad4['id']);return getEndUser(_0x46348a,_0x1c9264['destcalleridname'],_0x1c9264['destcalleridnum'],_0x242434);})[_0xe134('0x4b')](function(_0x4125d4){_0x774dae=_0x4125d4;logger[_0xe134('0xa')]('The\x20Enduser\x20ID\x20is:',_0x774dae['id']);return getTicket(_0x46348a,_0x489ad4,_0x774dae,_0x373cd8,_0x1c9264,_0x373cd8[_0xe134('0x5c')],_0x242434,'Outbound');})[_0xe134('0x4b')](function(_0xc15da9){_0x46a4b4=_0xc15da9;logger[_0xe134('0xa')]('Ticket\x20created!');logger[_0xe134('0xa')]('The\x20Ticket\x20ID\x20is:',_0x46a4b4['id']);return setRelationship(_0x242434,_0x489ad4,_0x46a4b4,_0xe134('0x6b'));})[_0xe134('0x4b')](function(){return setRelationship(_0x242434,_0x774dae,_0x46a4b4,_0xe134('0x6c'));})['then'](function(){return getServerInfo(_0x242434);})[_0xe134('0x4b')](function(_0x4f300d){var _0xffda72=parseInt(_0x4f300d[_0xe134('0x5f')][_0xe134('0x60')](0x0));var _0x12ea78=util['format'](_0xe134('0x61'),_0x46348a['remoteUri'],_0x46a4b4['id']);if(_0xffda72>0x6){_0x12ea78=util[_0xe134('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x46348a['remoteUri'],_0x46a4b4['id']);}logger[_0xe134('0xa')](_0xe134('0x6d'),_0xe134('0x63'));emit(util[_0xe134('0x1f')](_0xe134('0x64'),_0x47e3e0[_0xe134('0x27')]),_0xe134('0x6e'),{'uri':_0x12ea78});})['catch'](function(_0x484690){logger[_0xe134('0x66')](_0xe134('0x6d'),JSON['stringify'](_0x484690));});};exports['unmanaged']=function(_0x3966f0,_0x240e1b,_0x1914c0,_0x104a15,_0x308d32,_0x3b3d93){var _0x29ba9d,_0x15ccbf,_0x313c1d,_0x2067cf;_0x3b3d93[_0xe134('0x4f')]=intUtil[_0xe134('0x50')](_0x3b3d93[_0xe134('0x4f')]);_0x3b3d93['serverUrl']=intUtil[_0xe134('0x50')](_0x3b3d93[_0xe134('0x51')]);def[_0xe134('0x52')]=util[_0xe134('0x1f')](_0xe134('0x53'),_0x3b3d93[_0xe134('0x4f')]);if(_0x308d32&&_0x308d32[_0xe134('0x54')]){logger[_0xe134('0xa')]('['+_0x240e1b[_0xe134('0x6f')][_0xe134('0x70')]()+']',_0xe134('0x56'));_0x240e1b[_0xe134('0x57')]=util[_0xe134('0x1f')](_0xe134('0x69'),_0x3b3d93['serverUrl'],_0x240e1b[_0xe134('0x58')],md5(_0x240e1b['uniqueid']));}else{_0x240e1b[_0xe134('0x57')]='';}return getConnection(_0x3b3d93)[_0xe134('0x4b')](function(_0x188ae1){_0x2067cf=_0x188ae1;if(!_['isNil'](_0x104a15)){return getUser(_0x3b3d93,_0x104a15[_0xe134('0x27')],_0x2067cf);}else{return getUser(_0x3b3d93,null,_0x2067cf);}})[_0xe134('0x4b')](function(_0x4ba69a){_0x29ba9d=_0x4ba69a;logger[_0xe134('0xa')](_0xe134('0x6a'),_0x29ba9d['id']);return getEndUser(_0x3b3d93,_0x240e1b[_0xe134('0x59')],_0x240e1b[_0xe134('0x5a')],_0x2067cf);})['then'](function(_0x5cecf6){_0x15ccbf=_0x5cecf6;logger['info'](_0xe134('0x5b'),_0x15ccbf['id']);return getTicket(_0x3b3d93,_0x29ba9d,_0x15ccbf,_0x1914c0,_0x240e1b,_0x1914c0['Fields'],_0x2067cf,_0xe134('0x5d'));})[_0xe134('0x4b')](function(_0x2f55cb){_0x313c1d=_0x2f55cb;logger[_0xe134('0xa')](_0xe134('0x5e'));logger['info'](_0xe134('0x71'),_0x313c1d['id']);return setRelationship(_0x2067cf,_0x29ba9d,_0x313c1d,_0xe134('0x6b'));})[_0xe134('0x4b')](function(){return setRelationship(_0x2067cf,_0x15ccbf,_0x313c1d,_0xe134('0x6c'));})[_0xe134('0x4b')](function(){return getServerInfo(_0x2067cf);})[_0xe134('0x65')](function(_0x185bb2){logger[_0xe134('0x66')]('['+_0x240e1b[_0xe134('0x6f')][_0xe134('0x70')]()+']',JSON['stringify'](_0x185bb2));});}; \ 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 b8ee4f9..da63d9c 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 _0x3061=['format','%s:\x20%s','keyContent','keyType','toLowerCase','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy','type','string','push','variable','variableName','customVariable','Variable','name','toString','keyValue','key'];(function(_0x1a1e04,_0x499d69){var _0x4fb20f=function(_0x1ccf87){while(--_0x1ccf87){_0x1a1e04['push'](_0x1a1e04['shift']());}};_0x4fb20f(++_0x499d69);}(_0x3061,0x109));var _0x1306=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x3061[_0x114b7c];return _0x47185f;};'use strict';var _=require('lodash');var util=require(_0x1306('0x0'));exports[_0x1306('0x1')]=function(_0x425a97,_0x48d401,_0xeadd8d){var _0x47ad36=[];if(_0x425a97[_0x1306('0x2')]>0x0){var _0xe36efb=_[_0x1306('0x3')](_0x425a97,['id']);for(var _0x21e05b=0x0;_0x21e05b<_0xe36efb[_0x1306('0x2')];_0x21e05b++){var _0x51cdfb=_0xe36efb[_0x21e05b];if(_0x51cdfb[_0x1306('0x4')]===_0x1306('0x5')){_0x47ad36[_0x1306('0x6')](_0x51cdfb['content']);}else if(_0x51cdfb[_0x1306('0x4')]===_0x1306('0x7')&&_0x51cdfb[_0x1306('0x8')]){_0x48d401[_0x51cdfb['variableName']]&&_0x47ad36[_0x1306('0x6')](_0x48d401[_0x51cdfb[_0x1306('0x8')]]['toString']());}else if(_0x51cdfb[_0x1306('0x4')]===_0x1306('0x9')&&_0x51cdfb[_0x1306('0xa')]&&_0x51cdfb[_0x1306('0xa')]['name']){_0x48d401[_0x51cdfb[_0x1306('0xa')][_0x1306('0xb')]['toLowerCase']()]&&_0x47ad36[_0x1306('0x6')](_0x48d401[_0x51cdfb[_0x1306('0xa')]['name']['toLowerCase']()][_0x1306('0xc')]());}else if(_0x51cdfb[_0x1306('0x4')]===_0x1306('0xd')){if(_0x51cdfb['keyType']===_0x1306('0x5')&&_0x51cdfb[_0x1306('0xe')]){_0x47ad36[_0x1306('0x6')](util[_0x1306('0xf')](_0x1306('0x10'),_0x51cdfb['key'],_0x51cdfb[_0x1306('0x11')]));}else if(_0x51cdfb['keyType']==='variable'&&_0x51cdfb[_0x1306('0x8')]&&_0x51cdfb[_0x1306('0xe')]){_0x48d401[_0x51cdfb[_0x1306('0x8')]]&&_0x47ad36[_0x1306('0x6')](util['format'](_0x1306('0x10'),_0x51cdfb[_0x1306('0xe')],_0x48d401[_0x51cdfb[_0x1306('0x8')]]));}else if(_0x51cdfb[_0x1306('0x12')]===_0x1306('0x9')&&_0x51cdfb[_0x1306('0xa')]&&_0x51cdfb['Variable'][_0x1306('0xb')]&&_0x51cdfb[_0x1306('0xe')]){_0x48d401[_0x51cdfb['Variable'][_0x1306('0xb')][_0x1306('0x13')]()]&&_0x47ad36[_0x1306('0x6')](util[_0x1306('0xf')](_0x1306('0x10'),_0x51cdfb[_0x1306('0xe')],_0x48d401[_0x51cdfb[_0x1306('0xa')][_0x1306('0xb')][_0x1306('0x13')]()]));}}}}return _0x47ad36[_0x1306('0x14')](_0xeadd8d);};exports[_0x1306('0x15')]=function(_0x1321b6){var _0x3728e3=_0x1321b6[_0x1306('0x16')](-0x1);if(_0x3728e3==='/'){_0x1321b6=_0x1321b6[_0x1306('0x17')](0x0,_0x1321b6[_0x1306('0x18')](_0x3728e3));}return _0x1321b6;};exports[_0x1306('0x19')]=function(_0x3324dc){if(!_[_0x1306('0x1a')](_0x3324dc)&&_0x3324dc!==''){var _0x40cbc1=/^(([^<>()\[\]\\.,;:\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 _0x40cbc1[_0x1306('0x1b')](String(_0x3324dc)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xadbe=['isNil','test','lodash','util','getString','length','type','content','variable','variableName','customVariable','Variable','name','toLowerCase','push','toString','keyValue','string','key','format','%s:\x20%s','keyContent','keyType','slice','lastIndexOf','validateEmail'];(function(_0xfba8b6,_0x154c72){var _0x386330=function(_0x2eb89c){while(--_0x2eb89c){_0xfba8b6['push'](_0xfba8b6['shift']());}};_0x386330(++_0x154c72);}(_0xadbe,0x13a));var _0xeadb=function(_0x59d438,_0x49e538){_0x59d438=_0x59d438-0x0;var _0x4cde6b=_0xadbe[_0x59d438];return _0x4cde6b;};'use strict';var _=require(_0xeadb('0x0'));var util=require(_0xeadb('0x1'));exports[_0xeadb('0x2')]=function(_0x52ff23,_0x303c28,_0x1249fc){var _0x38f129=[];if(_0x52ff23[_0xeadb('0x3')]>0x0){var _0x1109d0=_['sortBy'](_0x52ff23,['id']);for(var _0x5af1ac=0x0;_0x5af1ac<_0x1109d0[_0xeadb('0x3')];_0x5af1ac++){var _0x1bd77a=_0x1109d0[_0x5af1ac];if(_0x1bd77a[_0xeadb('0x4')]==='string'){_0x38f129['push'](_0x1bd77a[_0xeadb('0x5')]);}else if(_0x1bd77a[_0xeadb('0x4')]===_0xeadb('0x6')&&_0x1bd77a[_0xeadb('0x7')]){_0x303c28[_0x1bd77a['variableName']]&&_0x38f129['push'](_0x303c28[_0x1bd77a[_0xeadb('0x7')]]['toString']());}else if(_0x1bd77a['type']===_0xeadb('0x8')&&_0x1bd77a[_0xeadb('0x9')]&&_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')]){_0x303c28[_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')][_0xeadb('0xb')]()]&&_0x38f129[_0xeadb('0xc')](_0x303c28[_0x1bd77a['Variable']['name'][_0xeadb('0xb')]()][_0xeadb('0xd')]());}else if(_0x1bd77a[_0xeadb('0x4')]===_0xeadb('0xe')){if(_0x1bd77a['keyType']===_0xeadb('0xf')&&_0x1bd77a[_0xeadb('0x10')]){_0x38f129['push'](util[_0xeadb('0x11')](_0xeadb('0x12'),_0x1bd77a[_0xeadb('0x10')],_0x1bd77a[_0xeadb('0x13')]));}else if(_0x1bd77a[_0xeadb('0x14')]===_0xeadb('0x6')&&_0x1bd77a[_0xeadb('0x7')]&&_0x1bd77a[_0xeadb('0x10')]){_0x303c28[_0x1bd77a[_0xeadb('0x7')]]&&_0x38f129[_0xeadb('0xc')](util[_0xeadb('0x11')](_0xeadb('0x12'),_0x1bd77a[_0xeadb('0x10')],_0x303c28[_0x1bd77a['variableName']]));}else if(_0x1bd77a[_0xeadb('0x14')]===_0xeadb('0x8')&&_0x1bd77a[_0xeadb('0x9')]&&_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')]&&_0x1bd77a[_0xeadb('0x10')]){_0x303c28[_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')][_0xeadb('0xb')]()]&&_0x38f129[_0xeadb('0xc')](util[_0xeadb('0x11')](_0xeadb('0x12'),_0x1bd77a['key'],_0x303c28[_0x1bd77a[_0xeadb('0x9')][_0xeadb('0xa')]['toLowerCase']()]));}}}}return _0x38f129['join'](_0x1249fc);};exports['stripTrailingSlash']=function(_0xe1ff6c){var _0x3f28b3=_0xe1ff6c[_0xeadb('0x15')](-0x1);if(_0x3f28b3==='/'){_0xe1ff6c=_0xe1ff6c['substring'](0x0,_0xe1ff6c[_0xeadb('0x16')](_0x3f28b3));}return _0xe1ff6c;};exports[_0xeadb('0x17')]=function(_0x3ef33e){if(!_[_0xeadb('0x18')](_0x3ef33e)&&_0x3ef33e!==''){var _0x3b99da=/^(([^<>()\[\]\\.,;:\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 _0x3b99da[_0xeadb('0x19')](String(_0x3ef33e)[_0xeadb('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 4b25d07..983813f 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(_0x1317bd,_0x55bc15){var _0x256439=function(_0x1da493){while(--_0x1da493){_0x1317bd['push'](_0x1317bd['shift']());}};_0x256439(++_0x55bc15);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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(_0x12ba0c,_0x15d6e9){var _0x402cbe=function(_0x235661){while(--_0x235661){_0x12ba0c['push'](_0x12ba0c['shift']());}};_0x402cbe(++_0x15d6e9);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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 8fce17e..e3e4a8f 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 _0x6c44=['email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','unmanaged','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Ticket\x20ID\x20is:','catch','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/logger','zendesk','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','string','picklist','type','customField','nameField','toLowerCase','content','includes','idField','custom_fields','push','variable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization'];(function(_0x3f837a,_0x35f365){var _0x5f4820=function(_0x12036c){while(--_0x12036c){_0x3f837a['push'](_0x3f837a['shift']());}};_0x5f4820(++_0x35f365);}(_0x6c44,0x1da));var _0x46c4=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x6c44[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x46c4('0x0'));var rp=require(_0x46c4('0x1'));var md5=require('md5');var util=require(_0x46c4('0x2'));var Redis=require('ioredis');var intUtil=require(_0x46c4('0x3'));var config=require('../../../../config/environment');var logger=require(_0x46c4('0x4'))(_0x46c4('0x5'));config[_0x46c4('0x6')]=_['defaults'](config[_0x46c4('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x46c4('0x6')]));function emit(_0x4ee844,_0xa35a24,_0xb08305){io['to'](_0x4ee844)[_0x46c4('0x7')](_0xa35a24,_0xb08305);}var headers={'Content-Type':_0x46c4('0x8'),'Accept':'application/json'};function getTicket(_0x2d40dc,_0x41d734,_0x25e95d,_0x4e528e,_0x3c4781){logger[_0x46c4('0x9')](_0x46c4('0xa'));return request({'uri':util[_0x46c4('0xb')]('%s/tickets.json',_0x2d40dc[_0x46c4('0xc')]),'method':'POST','body':{'ticket':_[_0x46c4('0xd')]({'requester_id':_0x25e95d['id'],'submitter_id':_0x41d734?_0x41d734['id']:undefined,'assignee_id':_0x41d734?_0x41d734['id']:undefined,'tags':getTags(_0x4e528e[_0x46c4('0xe')],_0x46c4('0xf')),'subject':intUtil[_0x46c4('0x10')](_0x4e528e[_0x46c4('0x11')],_0x3c4781,'\x20'),'description':intUtil['getString'](_0x4e528e[_0x46c4('0x12')],_0x3c4781,'\x0a'),'comment':{'public':![],'body':intUtil[_0x46c4('0x10')](_0x4e528e[_0x46c4('0x12')],_0x3c4781,'\x0a')}},getCustomFields(_0x4e528e[_0x46c4('0x13')],_0x3c4781))}})[_0x46c4('0x14')](function(_0x812e25){logger['info']('Ticket\x20created!');return _0x812e25['ticket'];});}function getUser(_0x43db5f,_0x3d5d5c){if(intUtil[_0x46c4('0x15')](_0x3d5d5c)){logger[_0x46c4('0x9')](_0x46c4('0x16'),_0x3d5d5c);return request({'uri':util[_0x46c4('0xb')](_0x46c4('0x17'),_0x43db5f[_0x46c4('0xc')]),'qs':{'query':util[_0x46c4('0xb')](_0x46c4('0x18'),_0x3d5d5c)}})['then'](function(_0x50c496){if(_0x50c496[_0x46c4('0x19')]){logger[_0x46c4('0x9')](_0x46c4('0x1a'));return _[_0x46c4('0x1b')](_0x50c496[_0x46c4('0x1c')],{'email':_0x3d5d5c,'role':_0x46c4('0x1d')});}else{logger['info'](_0x46c4('0x1e'));return request({'uri':util[_0x46c4('0xb')](_0x46c4('0x1f'),_0x43db5f['remoteUri'])})[_0x46c4('0x14')](function(_0x290642){logger[_0x46c4('0x9')](_0x46c4('0x20'));return _0x290642[_0x46c4('0x21')];});}});}else{logger['info'](_0x46c4('0x1e'));return request({'uri':util[_0x46c4('0xb')](_0x46c4('0x1f'),_0x43db5f['remoteUri'])})['then'](function(_0x32d6ca){logger[_0x46c4('0x9')](_0x46c4('0x20'));return _0x32d6ca[_0x46c4('0x21')];});}}function getEndUser(_0x59d8ee,_0x3605ce,_0x886fbf){logger[_0x46c4('0x9')](_0x46c4('0x22'),_0x886fbf);return request({'uri':util['format'](_0x46c4('0x17'),_0x59d8ee[_0x46c4('0xc')]),'qs':{'query':util[_0x46c4('0xb')](_0x46c4('0x23'),_0x886fbf)}})['then'](function(_0x48d0b8){var _0x2d13a3;if(_0x48d0b8['results'][_0x46c4('0x24')]){_0x48d0b8['results']=_[_0x46c4('0x25')](_0x48d0b8[_0x46c4('0x1c')],{'suspended':![],'role':'end-user'});if(_0x48d0b8[_0x46c4('0x1c')][_0x46c4('0x24')]){_0x2d13a3=_['first'](_0x48d0b8[_0x46c4('0x1c')]);}}if(_0x2d13a3){logger[_0x46c4('0x9')](_0x46c4('0x26'));return _0x2d13a3;}else{logger[_0x46c4('0x9')](_0x46c4('0x27'));return request({'uri':util[_0x46c4('0xb')](_0x46c4('0x28'),_0x59d8ee[_0x46c4('0xc')]),'method':_0x46c4('0x29'),'body':{'user':{'role':_0x46c4('0x2a'),'name':util[_0x46c4('0xb')](_0x46c4('0x2b'),_0x3605ce||_0x886fbf),'phone':_0x886fbf}}})[_0x46c4('0x14')](function(_0xdcb085){logger[_0x46c4('0x9')](_0x46c4('0x2c'));return _0xdcb085[_0x46c4('0x21')];});}});}function getAuth(_0xc65c6b){var _0x5314e1;if(_0xc65c6b[_0x46c4('0x2d')]===_0x46c4('0x2e')){_0x5314e1=util[_0x46c4('0xb')](_0x46c4('0x2f'),_0xc65c6b[_0x46c4('0x30')],_0xc65c6b['password']);}else if(_0xc65c6b['authType']==='token'){_0x5314e1=util[_0x46c4('0xb')](_0x46c4('0x31'),_0xc65c6b[_0x46c4('0x30')],_0xc65c6b[_0x46c4('0x32')]);}return util[_0x46c4('0xb')](_0x46c4('0x33'),new Buffer(_0x5314e1)[_0x46c4('0x34')](_0x46c4('0x35')));}function request(_0x446931){logger[_0x46c4('0x36')](_0x46c4('0x37'),JSON[_0x46c4('0x38')](_0x446931));return rp(_[_0x46c4('0x39')](_0x446931,{'method':_0x46c4('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x507999,_0x32afaa){var _0x27d231=[];if(_0x507999&&_0x507999[_0x46c4('0x24')]>0x0){_0x27d231=_[_0x46c4('0x3b')](_0x507999,_0x32afaa);}return _0x27d231;}function getCustomFields(_0x294023,_0x50f896){var _0x490af3=[];var _0x1b2640={'custom_fields':[]};if(_0x294023[_0x46c4('0x24')]>0x0){_['forEach'](_0x294023,function(_0x53fa20){if(_['includes']([_0x46c4('0x3c'),_0x46c4('0x3d')],_0x53fa20[_0x46c4('0x3e')])&&_0x53fa20['nameField']&&!_0x53fa20[_0x46c4('0x3f')]){_0x1b2640[_0x53fa20[_0x46c4('0x40')][_0x46c4('0x41')]()]=_0x53fa20[_0x46c4('0x42')][_0x46c4('0x34')]();}else if(_[_0x46c4('0x43')]([_0x46c4('0x3c'),_0x46c4('0x3d')],_0x53fa20[_0x46c4('0x3e')])&&_0x53fa20[_0x46c4('0x44')]&&_0x53fa20[_0x46c4('0x3f')]){_0x1b2640[_0x46c4('0x45')][_0x46c4('0x46')]({'id':_0x53fa20[_0x46c4('0x44')],'value':_0x53fa20['content'][_0x46c4('0x34')]()});}else if(_0x53fa20['type']===_0x46c4('0x47')&&_0x53fa20['variableName']&&_0x53fa20['idField']&&_0x53fa20['customField']){_0x50f896[_0x53fa20['variableName']]&&_0x1b2640[_0x46c4('0x45')][_0x46c4('0x46')]({'id':_0x53fa20['idField'],'value':_0x50f896[_0x53fa20['variableName']][_0x46c4('0x34')]()});}else if(_0x53fa20[_0x46c4('0x3e')]==='customVariable'&&_0x53fa20[_0x46c4('0x48')]&&_0x53fa20[_0x46c4('0x48')]['name']&&_0x53fa20[_0x46c4('0x44')]&&_0x53fa20[_0x46c4('0x3f')]){_0x50f896[_0x53fa20[_0x46c4('0x48')][_0x46c4('0xf')]['toLowerCase']()]&&_0x1b2640[_0x46c4('0x45')][_0x46c4('0x46')]({'id':_0x53fa20[_0x46c4('0x44')],'value':_0x50f896[_0x53fa20['Variable'][_0x46c4('0xf')][_0x46c4('0x41')]()]['toString']()});}});}return _0x1b2640;}exports[_0x46c4('0x49')]=function(_0x5b4f52,_0x5dcbc0,_0x16a769,_0x8fa191,_0xe3982e,_0x243e0c){var _0x5d7e24,_0x4fbcdf;_0x243e0c[_0x46c4('0xc')]=intUtil[_0x46c4('0x4a')](_0x243e0c[_0x46c4('0xc')]);_0x243e0c[_0x46c4('0x4b')]=intUtil['stripTrailingSlash'](_0x243e0c['serverUrl']);if(_0xe3982e&&_0xe3982e[_0x46c4('0x4c')]){logger[_0x46c4('0x9')](_0x46c4('0x4d'),_0x46c4('0x4e'));_0x5dcbc0['recordingURL']=util[_0x46c4('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x243e0c[_0x46c4('0x4b')],_0x5dcbc0['uniqueid'],md5(_0x5dcbc0['uniqueid']));}else{_0x5dcbc0[_0x46c4('0x4f')]='';}headers[_0x46c4('0x50')]=getAuth(_0x243e0c);return getUser(_0x243e0c,_0x8fa191[_0x46c4('0x51')])['then'](function(_0x25cdde){_0x5d7e24=_0x25cdde;logger[_0x46c4('0x9')](_0x46c4('0x52'),_0x5d7e24['id']);return getEndUser(_0x243e0c,_0x5dcbc0[_0x46c4('0x53')],_0x5dcbc0[_0x46c4('0x54')]);})[_0x46c4('0x14')](function(_0x243c7c){_0x4fbcdf=_0x243c7c;logger[_0x46c4('0x9')](_0x46c4('0x55'),_0x4fbcdf['id']);return getTicket(_0x243e0c,_0x5d7e24,_0x4fbcdf,_0x16a769,_0x5dcbc0);})['then'](function(_0x48cc2d){if(_0x48cc2d){logger[_0x46c4('0x9')]('The\x20Ticket\x20ID\x20is:',_0x48cc2d['id']);switch(_0x243e0c['type']){case _0x46c4('0x56'):logger['info'](_0x46c4('0x4d'),_0x46c4('0x57'));return request({'uri':util[_0x46c4('0xb')](_0x46c4('0x58'),_0x243e0c['remoteUri'],_0x5d7e24['id'],_0x48cc2d['id']),'method':'POST'});case _0x46c4('0x59'):logger[_0x46c4('0x9')](_0x46c4('0x4d'),_0x46c4('0x5a'));emit(util[_0x46c4('0xb')](_0x46c4('0x5b'),_0x8fa191[_0x46c4('0xf')]),_0x46c4('0x5c'),{'uri':util[_0x46c4('0xb')](_0x46c4('0x5d'),_0x243e0c[_0x46c4('0xc')][_0x46c4('0x5e')](_0x46c4('0x5f'),''),_0x48cc2d['id'])});break;default:logger[_0x46c4('0x60')](_0x46c4('0x4d'),_0x46c4('0x61'));}}})['catch'](function(_0x548d47){logger[_0x46c4('0x60')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x46c4('0x62')](_0x548d47,{'showHidden':!![],'depth':null}));});};exports[_0x46c4('0x63')]=function(_0x468bbb,_0x2d22b9,_0x32c6e2,_0x4f6b5b,_0x18bb93,_0x2f9e87,_0xbeb6ab){var _0x1e2ba8,_0x36315d;_0x2f9e87['remoteUri']=intUtil['stripTrailingSlash'](_0x2f9e87[_0x46c4('0xc')]);_0x2f9e87['serverUrl']=intUtil[_0x46c4('0x4a')](_0x2f9e87[_0x46c4('0x4b')]);if(_0xbeb6ab&&_0xbeb6ab['recordingFormat']&&_0xbeb6ab['recordingFormat']!=='none'){logger['info'](_0x46c4('0x64'),_0x46c4('0x4e'));_0x2d22b9[_0x46c4('0x4f')]=util[_0x46c4('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f9e87['serverUrl'],_0x2d22b9[_0x46c4('0x65')],md5(_0x2d22b9[_0x46c4('0x65')]));}headers[_0x46c4('0x50')]=getAuth(_0x2f9e87);return getUser(_0x2f9e87,_0x4f6b5b[_0x46c4('0x51')])[_0x46c4('0x14')](function(_0x2b24d5){_0x1e2ba8=_0x2b24d5;logger['info'](_0x46c4('0x52'),_0x1e2ba8['id']);return getEndUser(_0x2f9e87,_0x2d22b9[_0x46c4('0x66')],_0x2d22b9[_0x46c4('0x67')]);})[_0x46c4('0x14')](function(_0x4f38f7){_0x36315d=_0x4f38f7;logger[_0x46c4('0x9')](_0x46c4('0x55'),_0x36315d['id']);return getTicket(_0x2f9e87,_0x1e2ba8,_0x36315d,_0x32c6e2,_0x2d22b9);})['then'](function(_0x54d481){if(_0x54d481){logger[_0x46c4('0x9')]('The\x20Ticket\x20ID\x20is:',_0x54d481['id']);switch(_0x2f9e87['type']){case _0x46c4('0x56'):logger[_0x46c4('0x9')](_0x46c4('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x46c4('0xb')](_0x46c4('0x58'),_0x2f9e87[_0x46c4('0xc')],_0x1e2ba8['id'],_0x54d481['id']),'method':_0x46c4('0x29')});case'newTab':logger[_0x46c4('0x9')]('[OUTBOUND]',_0x46c4('0x5a'));emit(util[_0x46c4('0xb')](_0x46c4('0x5b'),_0x4f6b5b[_0x46c4('0xf')]),'trigger:browser:url',{'uri':util[_0x46c4('0xb')](_0x46c4('0x5d'),_0x2f9e87[_0x46c4('0xc')][_0x46c4('0x5e')](_0x46c4('0x5f'),''),_0x54d481['id'])});break;default:logger[_0x46c4('0x60')](_0x46c4('0x64'),_0x46c4('0x61'));}}})['catch'](function(_0x317ce5){logger[_0x46c4('0x60')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x46c4('0x62')](_0x317ce5,{'showHidden':!![],'depth':null}));});};exports[_0x46c4('0x68')]=function(_0x4b6964,_0x5c6edc,_0x2d8dc9,_0x26e7aa,_0x54db3f,_0x468fc8){var _0x4448f7,_0x252795;_0x468fc8[_0x46c4('0xc')]=intUtil[_0x46c4('0x4a')](_0x468fc8[_0x46c4('0xc')]);_0x468fc8[_0x46c4('0x4b')]=intUtil['stripTrailingSlash'](_0x468fc8[_0x46c4('0x4b')]);if(_0x54db3f&&_0x54db3f[_0x46c4('0x4c')]){logger[_0x46c4('0x9')]('['+_0x5c6edc['lastevent'][_0x46c4('0x69')]()+']',_0x46c4('0x4e'));_0x5c6edc[_0x46c4('0x4f')]=util[_0x46c4('0xb')](_0x46c4('0x6a'),_0x468fc8[_0x46c4('0x4b')],_0x5c6edc[_0x46c4('0x65')],md5(_0x5c6edc[_0x46c4('0x65')]));}else{_0x5c6edc[_0x46c4('0x4f')]='';}headers['Authorization']=getAuth(_0x468fc8);return getUser(_0x468fc8)['then'](function(_0x4553d2){_0x4448f7=_0x4553d2;logger[_0x46c4('0x9')](_0x46c4('0x52'),_0x4448f7['id']);return getEndUser(_0x468fc8,_0x5c6edc[_0x46c4('0x53')],_0x5c6edc['calleridnum']);})[_0x46c4('0x14')](function(_0x3a7f61){_0x252795=_0x3a7f61;logger['info'](_0x46c4('0x55'),_0x252795['id']);return getTicket(_0x468fc8,_0x4448f7,_0x252795,_0x2d8dc9,_0x5c6edc);})['then'](function(_0x302f9a){if(_0x302f9a){logger[_0x46c4('0x9')](_0x46c4('0x6b'),_0x302f9a['id']);}})[_0x46c4('0x6c')](function(_0x28fbae){logger[_0x46c4('0x60')]('['+_0x5c6edc[_0x46c4('0x6d')]['toUpperCase']()+']'+_0x46c4('0x6e'),util[_0x46c4('0x62')](_0x28fbae,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x80cc=['uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','[OUTBOUND]','recordingURL','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','catch','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','info','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','results','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','authType','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','variableName','custom_fields','push','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x548f2f,_0x43cc68){var _0x497c2b=function(_0x2fda8b){while(--_0x2fda8b){_0x548f2f['push'](_0x548f2f['shift']());}};_0x497c2b(++_0x43cc68);}(_0x80cc,0x15a));var _0xc80c=function(_0x4d750e,_0x35fb00){_0x4d750e=_0x4d750e-0x0;var _0x1a1e3f=_0x80cc[_0x4d750e];return _0x1a1e3f;};'use strict';var _=require(_0xc80c('0x0'));var rp=require(_0xc80c('0x1'));var md5=require(_0xc80c('0x2'));var util=require(_0xc80c('0x3'));var Redis=require(_0xc80c('0x4'));var intUtil=require(_0xc80c('0x5'));var config=require(_0xc80c('0x6'));var logger=require(_0xc80c('0x7'))(_0xc80c('0x8'));config[_0xc80c('0x9')]=_[_0xc80c('0xa')](config['redis'],{'host':_0xc80c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc80c('0x9')]));function emit(_0xf4fdda,_0x543110,_0x5b6e66){io['to'](_0xf4fdda)[_0xc80c('0xc')](_0x543110,_0x5b6e66);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x2bad82,_0x5ef639,_0x2b9d73,_0x5bdfa6,_0x2447bd){logger[_0xc80c('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xc80c('0xe')](_0xc80c('0xf'),_0x2bad82[_0xc80c('0x10')]),'method':_0xc80c('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x2b9d73['id'],'submitter_id':_0x5ef639?_0x5ef639['id']:undefined,'assignee_id':_0x5ef639?_0x5ef639['id']:undefined,'tags':getTags(_0x5bdfa6[_0xc80c('0x12')],_0xc80c('0x13')),'subject':intUtil[_0xc80c('0x14')](_0x5bdfa6[_0xc80c('0x15')],_0x2447bd,'\x20'),'description':intUtil[_0xc80c('0x14')](_0x5bdfa6[_0xc80c('0x16')],_0x2447bd,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc80c('0x14')](_0x5bdfa6['Descriptions'],_0x2447bd,'\x0a')}},getCustomFields(_0x5bdfa6[_0xc80c('0x17')],_0x2447bd))}})[_0xc80c('0x18')](function(_0x73e79b){logger[_0xc80c('0xd')](_0xc80c('0x19'));return _0x73e79b[_0xc80c('0x1a')];});}function getUser(_0x2cfd7e,_0x5bb1f8){if(intUtil['validateEmail'](_0x5bb1f8)){logger[_0xc80c('0xd')]('Getting\x20agent\x20with\x20email',_0x5bb1f8);return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x1b'),_0x2cfd7e[_0xc80c('0x10')]),'qs':{'query':util[_0xc80c('0xe')](_0xc80c('0x1c'),_0x5bb1f8)}})[_0xc80c('0x18')](function(_0x3b5e0a){if(_0x3b5e0a[_0xc80c('0x1d')]){logger[_0xc80c('0xd')](_0xc80c('0x1e'));return _[_0xc80c('0x1f')](_0x3b5e0a['results'],{'email':_0x5bb1f8,'role':_0xc80c('0x20')});}else{logger[_0xc80c('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xc80c('0x21'),_0x2cfd7e['remoteUri'])})[_0xc80c('0x18')](function(_0x31da01){logger['info'](_0xc80c('0x22'));return _0x31da01[_0xc80c('0x23')];});}});}else{logger[_0xc80c('0xd')](_0xc80c('0x24'));return request({'uri':util['format'](_0xc80c('0x21'),_0x2cfd7e[_0xc80c('0x10')])})['then'](function(_0xd365fd){logger[_0xc80c('0xd')](_0xc80c('0x22'));return _0xd365fd['user'];});}}function getEndUser(_0x4b756f,_0x3db798,_0x31f4e6){logger['info']('Searching\x20enduser\x20with\x20phone',_0x31f4e6);return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x1b'),_0x4b756f['remoteUri']),'qs':{'query':util[_0xc80c('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x31f4e6)}})[_0xc80c('0x18')](function(_0x911c94){var _0xdbe585;if(_0x911c94[_0xc80c('0x25')][_0xc80c('0x26')]){_0x911c94[_0xc80c('0x25')]=_[_0xc80c('0x27')](_0x911c94[_0xc80c('0x25')],{'suspended':![],'role':'end-user'});if(_0x911c94[_0xc80c('0x25')][_0xc80c('0x26')]){_0xdbe585=_[_0xc80c('0x28')](_0x911c94[_0xc80c('0x25')]);}}if(_0xdbe585){logger[_0xc80c('0xd')](_0xc80c('0x29'));return _0xdbe585;}else{logger[_0xc80c('0xd')](_0xc80c('0x2a'));return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x2b'),_0x4b756f[_0xc80c('0x10')]),'method':_0xc80c('0x11'),'body':{'user':{'role':_0xc80c('0x2c'),'name':util[_0xc80c('0xe')]('Caller\x20-\x20%s',_0x3db798||_0x31f4e6),'phone':_0x31f4e6}}})['then'](function(_0x4eb5d){logger[_0xc80c('0xd')]('Enduser\x20created.');return _0x4eb5d[_0xc80c('0x23')];});}});}function getAuth(_0xd67a35){var _0x5b641e;if(_0xd67a35[_0xc80c('0x2d')]==='password'){_0x5b641e=util[_0xc80c('0xe')](_0xc80c('0x2e'),_0xd67a35['username'],_0xd67a35['password']);}else if(_0xd67a35[_0xc80c('0x2d')]===_0xc80c('0x2f')){_0x5b641e=util[_0xc80c('0xe')](_0xc80c('0x30'),_0xd67a35[_0xc80c('0x31')],_0xd67a35['token']);}return util[_0xc80c('0xe')](_0xc80c('0x32'),new Buffer(_0x5b641e)[_0xc80c('0x33')](_0xc80c('0x34')));}function request(_0x55bb5e){logger['debug']('[HTTP]',JSON['stringify'](_0x55bb5e));return rp(_[_0xc80c('0xa')](_0x55bb5e,{'method':_0xc80c('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x1822fc,_0xc1e9b7){var _0x2b5591=[];if(_0x1822fc&&_0x1822fc[_0xc80c('0x26')]>0x0){_0x2b5591=_[_0xc80c('0x36')](_0x1822fc,_0xc1e9b7);}return _0x2b5591;}function getCustomFields(_0x274b60,_0x5442e7){var _0x9f80a5=[];var _0x2a0e8b={'custom_fields':[]};if(_0x274b60[_0xc80c('0x26')]>0x0){_[_0xc80c('0x37')](_0x274b60,function(_0x1b0101){if(_[_0xc80c('0x38')]([_0xc80c('0x39'),'picklist'],_0x1b0101[_0xc80c('0x3a')])&&_0x1b0101[_0xc80c('0x3b')]&&!_0x1b0101[_0xc80c('0x3c')]){_0x2a0e8b[_0x1b0101[_0xc80c('0x3b')][_0xc80c('0x3d')]()]=_0x1b0101[_0xc80c('0x3e')][_0xc80c('0x33')]();}else if(_['includes']([_0xc80c('0x39'),_0xc80c('0x3f')],_0x1b0101[_0xc80c('0x3a')])&&_0x1b0101[_0xc80c('0x40')]&&_0x1b0101[_0xc80c('0x3c')]){_0x2a0e8b['custom_fields']['push']({'id':_0x1b0101['idField'],'value':_0x1b0101['content']['toString']()});}else if(_0x1b0101['type']==='variable'&&_0x1b0101[_0xc80c('0x41')]&&_0x1b0101['idField']&&_0x1b0101[_0xc80c('0x3c')]){_0x5442e7[_0x1b0101[_0xc80c('0x41')]]&&_0x2a0e8b[_0xc80c('0x42')][_0xc80c('0x43')]({'id':_0x1b0101['idField'],'value':_0x5442e7[_0x1b0101[_0xc80c('0x41')]][_0xc80c('0x33')]()});}else if(_0x1b0101[_0xc80c('0x3a')]===_0xc80c('0x44')&&_0x1b0101[_0xc80c('0x45')]&&_0x1b0101['Variable'][_0xc80c('0x13')]&&_0x1b0101[_0xc80c('0x40')]&&_0x1b0101[_0xc80c('0x3c')]){_0x5442e7[_0x1b0101[_0xc80c('0x45')]['name'][_0xc80c('0x3d')]()]&&_0x2a0e8b[_0xc80c('0x42')][_0xc80c('0x43')]({'id':_0x1b0101[_0xc80c('0x40')],'value':_0x5442e7[_0x1b0101[_0xc80c('0x45')][_0xc80c('0x13')]['toLowerCase']()][_0xc80c('0x33')]()});}});}return _0x2a0e8b;}exports['queue']=function(_0x562b41,_0x276e68,_0x15d395,_0x204a32,_0x51f484,_0x243fe9){var _0x5e30ab,_0x1706a1;_0x243fe9[_0xc80c('0x10')]=intUtil[_0xc80c('0x46')](_0x243fe9[_0xc80c('0x10')]);_0x243fe9[_0xc80c('0x47')]=intUtil[_0xc80c('0x46')](_0x243fe9[_0xc80c('0x47')]);if(_0x51f484&&_0x51f484['monitor_format']){logger[_0xc80c('0xd')](_0xc80c('0x48'),_0xc80c('0x49'));_0x276e68['recordingURL']=util[_0xc80c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x243fe9[_0xc80c('0x47')],_0x276e68[_0xc80c('0x4a')],md5(_0x276e68['uniqueid']));}else{_0x276e68['recordingURL']='';}headers[_0xc80c('0x4b')]=getAuth(_0x243fe9);return getUser(_0x243fe9,_0x204a32[_0xc80c('0x4c')])[_0xc80c('0x18')](function(_0x18b445){_0x5e30ab=_0x18b445;logger[_0xc80c('0xd')](_0xc80c('0x4d'),_0x5e30ab['id']);return getEndUser(_0x243fe9,_0x276e68[_0xc80c('0x4e')],_0x276e68[_0xc80c('0x4f')]);})['then'](function(_0x2cadc0){_0x1706a1=_0x2cadc0;logger[_0xc80c('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1706a1['id']);return getTicket(_0x243fe9,_0x5e30ab,_0x1706a1,_0x15d395,_0x276e68);})['then'](function(_0x30f0b7){if(_0x30f0b7){logger[_0xc80c('0xd')](_0xc80c('0x50'),_0x30f0b7['id']);switch(_0x243fe9[_0xc80c('0x3a')]){case _0xc80c('0x51'):logger[_0xc80c('0xd')](_0xc80c('0x48'),_0xc80c('0x52'));return request({'uri':util[_0xc80c('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x243fe9[_0xc80c('0x10')],_0x5e30ab['id'],_0x30f0b7['id']),'method':_0xc80c('0x11')});case _0xc80c('0x53'):logger[_0xc80c('0xd')]('[QUEUE]',_0xc80c('0x54'));emit(util[_0xc80c('0xe')](_0xc80c('0x55'),_0x204a32[_0xc80c('0x13')]),'trigger:browser:url',{'uri':util['format'](_0xc80c('0x56'),_0x243fe9['remoteUri'][_0xc80c('0x57')](_0xc80c('0x58'),''),_0x30f0b7['id'])});break;default:logger['error'](_0xc80c('0x48'),_0xc80c('0x59'));}}})['catch'](function(_0x162dbc){logger['error'](_0xc80c('0x5a'),util['inspect'](_0x162dbc,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4ec8a9,_0x2c77fb,_0x3e2f66,_0x5e5367,_0x27b8d4,_0x1c545b,_0xd99678){var _0xac8bb3,_0x3bc2a2;_0x1c545b['remoteUri']=intUtil['stripTrailingSlash'](_0x1c545b[_0xc80c('0x10')]);_0x1c545b[_0xc80c('0x47')]=intUtil[_0xc80c('0x46')](_0x1c545b[_0xc80c('0x47')]);if(_0xd99678&&_0xd99678[_0xc80c('0x5b')]&&_0xd99678[_0xc80c('0x5b')]!=='none'){logger[_0xc80c('0xd')](_0xc80c('0x5c'),'Recording\x20is\x20enabled!');_0x2c77fb[_0xc80c('0x5d')]=util[_0xc80c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c545b[_0xc80c('0x47')],_0x2c77fb[_0xc80c('0x4a')],md5(_0x2c77fb[_0xc80c('0x4a')]));}headers['Authorization']=getAuth(_0x1c545b);return getUser(_0x1c545b,_0x5e5367[_0xc80c('0x4c')])['then'](function(_0x2d15c4){_0xac8bb3=_0x2d15c4;logger[_0xc80c('0xd')](_0xc80c('0x4d'),_0xac8bb3['id']);return getEndUser(_0x1c545b,_0x2c77fb['destcalleridname'],_0x2c77fb['destcalleridnum']);})[_0xc80c('0x18')](function(_0x296fef){_0x3bc2a2=_0x296fef;logger[_0xc80c('0xd')](_0xc80c('0x5e'),_0x3bc2a2['id']);return getTicket(_0x1c545b,_0xac8bb3,_0x3bc2a2,_0x3e2f66,_0x2c77fb);})[_0xc80c('0x18')](function(_0xf1654){if(_0xf1654){logger[_0xc80c('0xd')](_0xc80c('0x50'),_0xf1654['id']);switch(_0x1c545b[_0xc80c('0x3a')]){case _0xc80c('0x51'):logger[_0xc80c('0xd')](_0xc80c('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc80c('0xe')](_0xc80c('0x5f'),_0x1c545b[_0xc80c('0x10')],_0xac8bb3['id'],_0xf1654['id']),'method':_0xc80c('0x11')});case _0xc80c('0x53'):logger[_0xc80c('0xd')](_0xc80c('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc80c('0xe')](_0xc80c('0x55'),_0x5e5367[_0xc80c('0x13')]),_0xc80c('0x60'),{'uri':util['format'](_0xc80c('0x56'),_0x1c545b['remoteUri']['replace'](_0xc80c('0x58'),''),_0xf1654['id'])});break;default:logger[_0xc80c('0x61')]('[OUTBOUND]',_0xc80c('0x59'));}}})['catch'](function(_0x485ea6){logger[_0xc80c('0x61')](_0xc80c('0x62'),util[_0xc80c('0x63')](_0x485ea6,{'showHidden':!![],'depth':null}));});};exports[_0xc80c('0x64')]=function(_0x47e04a,_0x2d17b1,_0x1bc557,_0x3e38bb,_0x5b906b,_0x2b7b46){var _0x747dd9,_0x533c61;_0x2b7b46[_0xc80c('0x10')]=intUtil['stripTrailingSlash'](_0x2b7b46[_0xc80c('0x10')]);_0x2b7b46[_0xc80c('0x47')]=intUtil['stripTrailingSlash'](_0x2b7b46['serverUrl']);if(_0x5b906b&&_0x5b906b['monitor_format']){logger['info']('['+_0x2d17b1['lastevent']['toUpperCase']()+']',_0xc80c('0x49'));_0x2d17b1[_0xc80c('0x5d')]=util[_0xc80c('0xe')](_0xc80c('0x65'),_0x2b7b46[_0xc80c('0x47')],_0x2d17b1[_0xc80c('0x4a')],md5(_0x2d17b1[_0xc80c('0x4a')]));}else{_0x2d17b1[_0xc80c('0x5d')]='';}headers[_0xc80c('0x4b')]=getAuth(_0x2b7b46);return getUser(_0x2b7b46)['then'](function(_0x3ecbc8){_0x747dd9=_0x3ecbc8;logger[_0xc80c('0xd')]('The\x20User\x20ID\x20is:',_0x747dd9['id']);return getEndUser(_0x2b7b46,_0x2d17b1[_0xc80c('0x4e')],_0x2d17b1[_0xc80c('0x4f')]);})[_0xc80c('0x18')](function(_0x3ceda0){_0x533c61=_0x3ceda0;logger['info'](_0xc80c('0x5e'),_0x533c61['id']);return getTicket(_0x2b7b46,_0x747dd9,_0x533c61,_0x1bc557,_0x2d17b1);})['then'](function(_0x7a9c61){if(_0x7a9c61){logger['info']('The\x20Ticket\x20ID\x20is:',_0x7a9c61['id']);}})[_0xc80c('0x66')](function(_0x364846){logger[_0xc80c('0x61')]('['+_0x2d17b1[_0xc80c('0x67')][_0xc80c('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x364846,{'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 5825e50..7cfe98e 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 _0x4274=['ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','https://www.zohoapis.','startCase','role','first_name','last_name','data','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','err','stack','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','Outbound','https://crm.','/crm/EntityInfo.do?module=Calls&id=','monitor_format','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','request-promise','md5','util','./util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4274,0x94));var _0x4427=function(_0x19a9a7,_0x3e5c8e){_0x19a9a7=_0x19a9a7-0x0;var _0x4e834f=_0x4274[_0x19a9a7];return _0x4e834f;};'use strict';var _=require('lodash');var rp=require(_0x4427('0x0'));var md5=require(_0x4427('0x1'));var util=require(_0x4427('0x2'));var intUtil=require(_0x4427('0x3'));var moment=require('moment');var Redis=require(_0x4427('0x4'));var BPromise=require('bluebird');var config=require(_0x4427('0x5'));var logger=require(_0x4427('0x6'))(_0x4427('0x7'));config[_0x4427('0x8')]=_[_0x4427('0x9')](config[_0x4427('0x8')],{'host':_0x4427('0xa'),'port':0x18eb});var io=require(_0x4427('0xb'))(new Redis(config[_0x4427('0x8')]));function emit(_0x55d6e8,_0x23b115,_0x5638db){io['to'](_0x55d6e8)[_0x4427('0xc')](_0x23b115,_0x5638db);}function request(_0x3037d5){logger[_0x4427('0xd')](_0x4427('0xe'),JSON[_0x4427('0xf')](_0x3037d5));return rp(_0x3037d5);}function getCustomFields(_0x4376e2,_0x382ada){var _0x2ab5d6={};if(_0x4376e2[_0x4427('0x10')]>0x0){_['forEach'](_0x4376e2,function(_0x1716bd){if(_[_0x4427('0x11')]([_0x4427('0x12'),_0x4427('0x13')],_0x1716bd[_0x4427('0x14')])&&_0x1716bd[_0x4427('0x15')]){_0x2ab5d6[_0x1716bd[_0x4427('0x15')]]=_0x1716bd[_0x4427('0x16')][_0x4427('0x17')]();}else if(_0x1716bd[_0x4427('0x14')]===_0x4427('0x18')&&_0x1716bd[_0x4427('0x19')]&&_0x1716bd[_0x4427('0x15')]&&_0x382ada[_0x1716bd[_0x4427('0x19')]]){_0x2ab5d6[_0x1716bd[_0x4427('0x15')]]=_0x382ada[_0x1716bd[_0x4427('0x19')]]['toString']();}else if(_0x1716bd[_0x4427('0x14')]==='customVariable'&&_0x1716bd[_0x4427('0x1a')]&&_0x1716bd[_0x4427('0x1a')][_0x4427('0x1b')]&&_0x1716bd['idField']&&_0x382ada[_0x1716bd[_0x4427('0x1a')][_0x4427('0x1b')][_0x4427('0x1c')]()]){_0x2ab5d6[_0x1716bd[_0x4427('0x15')]]=_0x382ada[_0x1716bd[_0x4427('0x1a')][_0x4427('0x1b')][_0x4427('0x1c')]()][_0x4427('0x17')]();}});}return _0x2ab5d6;}function getName(_0x567ea1){if(_0x567ea1[_0x4427('0x1d')]('\x20')>0x0){var _0x114272=_0x567ea1['split'](/ (.+)/);if(_0x114272[0x1]){return _0x114272;}}return[_0x567ea1,_0x567ea1];}var accountsTokens={};function getAccessToken(_0x36a952){return new Promise(function(_0x45ad26,_0x23a851){if(!_['isNil'](accountsTokens[_0x36a952['id']])&&!_[_0x4427('0x1e')](accountsTokens[_0x36a952['id']][_0x4427('0x1f')])){if(moment()[_0x4427('0x20')](accountsTokens[_0x36a952['id']][_0x4427('0x21')])){_0x45ad26(accountsTokens[_0x36a952['id']][_0x4427('0x1f')]);}}var _0x3a8bfb;switch(_0x36a952[_0x4427('0x22')]){case'US':_0x3a8bfb='https://accounts.zoho.com';break;case'AU':_0x3a8bfb=_0x4427('0x23');break;case'EU':_0x3a8bfb='https://accounts.zoho.eu';break;case'IN':_0x3a8bfb=_0x4427('0x24');break;case'CN':_0x3a8bfb='https://accounts.zoho.com.cn';break;default:_0x3a8bfb=_0x4427('0x25');break;}var _0x4a1345={'method':'POST','uri':_0x3a8bfb+_0x4427('0x26'),'qs':{'refresh_token':_0x36a952[_0x4427('0x27')],'client_id':_0x36a952['clientId'],'client_secret':_0x36a952['clientSecret'],'grant_type':_0x4427('0x28')},'json':!![]};return rp(_0x4a1345)[_0x4427('0x29')](function(_0x3238ed){accountsTokens[_0x36a952['id']]={'access_token':_0x3238ed[_0x4427('0x1f')],'expires_in':moment()[_0x4427('0x2a')](_0x3238ed[_0x4427('0x21')],_0x4427('0x2b'))};_0x45ad26(_0x3238ed[_0x4427('0x1f')]);})[_0x4427('0x2c')](function(_0x597b95){logger[_0x4427('0x2d')](_0x4427('0x2e'),_0x597b95['stack']);_0x23a851(_0x597b95);});});}function getUser(_0x36e916,_0xa2d5bb,_0x84d612,_0x50ff6f){logger[_0x4427('0x2f')](_0x4427('0x30'));return request({'method':_0x4427('0x31'),'uri':util['format'](_0x4427('0x32'),_0xa2d5bb),'qs':{'type':_0x4427('0x33')},'headers':{'Authorization':_0x4427('0x34')+_0x36e916},'json':!![]})[_0x4427('0x29')](function(_0x2c837f){if(_0x2c837f[_0x4427('0x35')]){var _0x3fb793=-0x1;if(_[_0x4427('0x36')](_0x2c837f[_0x4427('0x35')])){if(!_[_0x4427('0x1e')](_0x50ff6f)){_0x3fb793=_[_0x4427('0x37')](_0x2c837f[_0x4427('0x35')],function(_0x1c88c8){return _0x1c88c8[_0x4427('0x38')]===_0x50ff6f;});}if(_0x3fb793>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x4427('0x2f')](_0x4427('0x39'));_0x3fb793=_[_0x4427('0x37')](_0x2c837f[_0x4427('0x35')],function(_0xa236ec){return _0xa236ec[_0x4427('0x3a')][_0x4427('0x1b')]===_0x4427('0x3b');});}return _0x2c837f['users'][_0x3fb793];}else{if(_0x2c837f[_0x4427('0x3c')][_0x4427('0x3a')]['name']===_0x4427('0x3b')){logger[_0x4427('0x2f')](_0x4427('0x39'));user=_0x2c837f[_0x4427('0x3c')];return user;}else{logger[_0x4427('0x2d')](_0x4427('0x3d'),JSON[_0x4427('0xf')](_0x2c837f));throw new Error(_0x4427('0x3e')+JSON[_0x4427('0xf')](_0x2c837f));}}}else{logger[_0x4427('0x2d')](_0x4427('0x3d'),JSON['stringify'](_0x2c837f));throw new Error(_0x4427('0x3e')+JSON['stringify'](_0x2c837f));}})['catch'](function(_0x16e31c){console['error'](_0x16e31c);});}function getZohoUser(_0x286005,_0x5d887a){return new BPromise(function(_0x3e9762,_0x5b8f06){request(_0x286005)[_0x4427('0x29')](function(_0x4f0ac3){var _0x2fc4b0=null;if(_0x4f0ac3){_0x2fc4b0=_0x4f0ac3['data'][0x0];_0x2fc4b0[_0x4427('0x3f')]=_0x5d887a;}_0x3e9762(_0x2fc4b0);})[_0x4427('0x2c')](function(_0x670377){_0x5b8f06(_0x670377);});});}function createEndUser(_0x50e580,_0x584f76,_0x12070e,_0x4dce31,_0x3469e5,_0x5f3a2e){var _0x12070e=getName(_0x12070e);return request({'method':_0x4427('0x40'),'uri':_0x4427('0x41')+_0x584f76+'/crm/v2/'+_[_0x4427('0x42')](_0x5f3a2e['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x12070e[0x1],'First_Name':_0x12070e[0x0],'Phone':_0x4dce31,'Owner':{'name':!_[_0x4427('0x1e')](_0x3469e5[_0x4427('0x43')][_0x4427('0x1b')])?_0x3469e5[_0x4427('0x43')][_0x4427('0x1b')]:!_[_0x4427('0x1e')](_0x3469e5['first_name'])?_0x3469e5[_0x4427('0x44')]+'\x20'+_0x3469e5[_0x4427('0x45')]:_0x3469e5[_0x4427('0x45')],'id':_0x3469e5['id']}}]},'headers':{'Authorization':_0x4427('0x34')+_0x50e580},'json':!![]})[_0x4427('0x29')](function(_0x3fecf5){if(_0x3fecf5&&_0x3fecf5[_0x4427('0x46')][0x0][_0x4427('0x47')]===_0x4427('0x48')){var _0x2e82a4=_0x3fecf5[_0x4427('0x46')][0x0][_0x4427('0x49')];_0x2e82a4[_0x4427('0x3f')]=_[_0x4427('0x42')](_0x5f3a2e[_0x4427('0x4a')])+'s';return _0x2e82a4;}logger[_0x4427('0x2d')](_0x4427('0x3d'),JSON[_0x4427('0xf')](data));throw new Error(_0x4427('0x4b')+JSON['stringify'](data));})[_0x4427('0x2c')](function(_0x3a2fe0){console[_0x4427('0x4c')](_0x4427('0x4d'),_0x3a2fe0);});}function getEndUser(_0x4e11d5,_0x46460e,_0x30a508,_0x34a4f9,_0x28493f,_0x5c3468,_0x327efd){var _0x2f13bd={'method':_0x4427('0x31'),'uri':'','headers':{'Authorization':_0x4427('0x34')+_0x4e11d5},'json':!![]};switch(_0x327efd[_0x4427('0x4e')]){case'contact_lead':_0x2f13bd['uri']=_0x4427('0x41')+_0x46460e+_0x4427('0x4f')+_0x28493f+'))';return getZohoUser(_0x2f13bd,'Contacts')['then'](function(_0x210bbe){if(_0x210bbe)return _0x210bbe;_0x2f13bd[_0x4427('0x50')]=_0x4427('0x41')+_0x46460e+_0x4427('0x51')+_0x28493f+'))';return getZohoUser(_0x2f13bd,_0x4427('0x52'))['then'](function(_0x3199e7){if(_0x3199e7)return _0x3199e7;if(_0x327efd['moduleCreate']!=_0x4427('0x53')){return createEndUser(_0x4e11d5,_0x46460e,_0x34a4f9,_0x28493f,_0x5c3468,_0x327efd);}else{return{};}});});break;case _0x4427('0x54'):_0x2f13bd[_0x4427('0x50')]=_0x4427('0x41')+_0x46460e+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x28493f+'))';return getZohoUser(_0x2f13bd,_0x4427('0x55'))[_0x4427('0x29')](function(_0x285d1d){if(_0x285d1d)return _0x285d1d;if(_0x327efd[_0x4427('0x4a')]!=_0x4427('0x53')){return createEndUser(_0x4e11d5,_0x46460e,_0x34a4f9,_0x28493f,_0x5c3468,_0x327efd);}else{return{};}});break;case'lead':_0x2f13bd[_0x4427('0x50')]=_0x4427('0x41')+_0x46460e+_0x4427('0x51')+_0x28493f+'))';return getZohoUser(_0x2f13bd,_0x4427('0x52'))[_0x4427('0x29')](function(_0xa488c9){if(_0xa488c9)return _0xa488c9;if(_0x327efd[_0x4427('0x4a')]!='nothing'){return createEndUser(_0x4e11d5,_0x46460e,_0x34a4f9,_0x28493f,_0x5c3468,_0x327efd);}else{return{};}});break;}}function getCall(_0x3deb3f,_0x467149,_0x1956a7,_0x1e9c4c,_0x4c6eef,_0x407bf3,_0x3b671f,_0x4c9b0f){logger[_0x4427('0x2f')](_0x4427('0x56'));var _0x2fbb99={};_0x2fbb99[_0x4427('0x57')]={'name':!_[_0x4427('0x1e')](_0x1e9c4c[_0x4427('0x43')]['name'])&&!_[_0x4427('0x1e')](_0x1e9c4c[_0x4427('0x3a')][_0x4427('0x1b')])&&_0x1e9c4c[_0x4427('0x3a')][_0x4427('0x1b')]===_0x4427('0x58')?_0x1e9c4c[_0x4427('0x43')][_0x4427('0x1b')]:!_[_0x4427('0x1e')](_0x1e9c4c[_0x4427('0x44')])?_0x1e9c4c[_0x4427('0x44')]+'\x20'+_0x1e9c4c[_0x4427('0x45')]:_0x1e9c4c[_0x4427('0x45')],'id':_0x1e9c4c['id']};_0x2fbb99[_0x4427('0x59')]=intUtil['getString'](_0x407bf3[_0x4427('0x5a')],_0x3b671f,'\x20');_0x2fbb99[_0x4427('0x5b')]=intUtil['getString'](_0x407bf3['Descriptions'],_0x3b671f,'\x0a');if(_0x4c6eef[_0x4427('0x3f')]===_0x4427('0x55')){_0x2fbb99[_0x4427('0x5c')]={'name':!_['isNil'](_0x4c6eef[_0x4427('0x5d')])?_0x4c6eef[_0x4427('0x5d')]:!_[_0x4427('0x1e')](_0x4c6eef[_0x4427('0x5e')])?_0x4c6eef['First_Name']+'\x20'+_0x4c6eef[_0x4427('0x5f')]:_0x4c6eef[_0x4427('0x5f')],'id':_0x4c6eef['id']};}if(_0x4c6eef[_0x4427('0x3f')]===_0x4427('0x52')){_0x2fbb99[_0x4427('0x60')]={'name':!_[_0x4427('0x1e')](_0x4c6eef[_0x4427('0x5d')])?_0x4c6eef[_0x4427('0x5d')]:!_['isNil'](_0x4c6eef[_0x4427('0x5e')])?_0x4c6eef[_0x4427('0x5e')]+'\x20'+_0x4c6eef[_0x4427('0x5f')]:_0x4c6eef[_0x4427('0x5f')],'id':_0x4c6eef['id']};_0x2fbb99[_0x4427('0x61')]=_[_0x4427('0x42')](_0x4c6eef['enduserType']);}if(_0x3b671f[_0x4427('0x62')]){_0x2fbb99[_0x4427('0x63')]=moment[_0x4427('0x64')](parseInt(_0x3b671f[_0x4427('0x62')])*0x3e8)[_0x4427('0x65')]('mm:ss');}else if(_0x3b671f[_0x4427('0x66')]&&_0x3b671f['endtime']){_0x2fbb99['Call_Duration']=moment[_0x4427('0x64')](moment(_0x3b671f[_0x4427('0x67')],_0x4427('0x68'))['diff'](moment(_0x3b671f[_0x4427('0x69')],_0x4427('0x68'))))[_0x4427('0x65')]('mm:ss');}switch(_0x3b671f[_0x4427('0x6a')]){case _0x4427('0x6b'):_0x2fbb99['Call_Result']=_0x4427('0x6c');break;case _0x4427('0x6d'):case _0x4427('0x6e'):_0x2fbb99[_0x4427('0x6f')]=_0x4427('0x70');break;case _0x4427('0x71'):_0x2fbb99[_0x4427('0x6f')]=_0x4427('0x72');break;case _0x4427('0x73'):_0x2fbb99['Call_Result']=_0x4427('0x74');break;case _0x4427('0x75'):_0x2fbb99[_0x4427('0x6f')]=_0x4427('0x76');default:}_0x2fbb99['Call_Start_Time']=(_0x4c9b0f===_0x4427('0x77')?moment(_0x3b671f[_0x4427('0x69')])[_0x4427('0x65')](_0x4427('0x68')):moment(_0x3b671f[_0x4427('0x78')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x4427('0x65')]('YYYY-MM-DDTHH:mm:ss');_0x2fbb99['Call_Type']=_0x4c9b0f||_0x4427('0x79');_0x2fbb99=_[_0x4427('0x7a')](_0x2fbb99,getCustomFields(_0x407bf3[_0x4427('0x7b')],_0x3b671f));return request({'method':_0x4427('0x40'),'uri':_0x4427('0x41')+_0x467149+_0x4427('0x7c'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3deb3f},'body':{'data':[_0x2fbb99]},'json':!![]})[_0x4427('0x29')](function(_0x5c5b45){if(_0x5c5b45&&_0x5c5b45[_0x4427('0x46')][0x0][_0x4427('0x47')]==='SUCCESS'){logger[_0x4427('0x2f')]('Call\x20created!');return{'id':_0x5c5b45[_0x4427('0x46')][0x0]['details']['id']};}})[_0x4427('0x2c')](function(_0xdc2e2c){logger['info'](_0x4427('0x7d'),_0xdc2e2c[_0x4427('0x7e')]);console[_0x4427('0x4c')](_0x4427('0x7d'),_0xdc2e2c);});}exports[_0x4427('0x7f')]=function(_0x1a2a9f,_0x4d58dc,_0x4efbcd,_0x4b6d8b,_0x1d395b,_0x319098){var _0x9c677,_0x66bc56,_0x46a4e7;_0x319098['host']=intUtil[_0x4427('0x80')](_0x319098[_0x4427('0x81')]);_0x319098[_0x4427('0x82')]=intUtil[_0x4427('0x80')](_0x319098[_0x4427('0x82')]);if(_0x1d395b&&_0x1d395b['monitor_format']){logger[_0x4427('0x2f')](_0x4427('0x83'),'Recording\x20is\x20enabled!');_0x4d58dc[_0x4427('0x84')]=_0x319098['serverUrl']+_0x4427('0x85')+_0x4d58dc['uniqueid']+_0x4427('0x86')+md5(_0x4d58dc[_0x4427('0x87')]);}else{_0x4d58dc[_0x4427('0x84')]='';}var _0x222e4b=_0x319098['host']===_0x4427('0x88')?'eu':_0x4427('0x89');return getAccessToken(_0x319098)[_0x4427('0x29')](function(_0x23ee3b){_0x46a4e7=_0x23ee3b;return getUser(_0x46a4e7,_0x222e4b,_0x319098,_0x4b6d8b['email']);})[_0x4427('0x29')](function(_0x99db1c){_0x9c677=_0x99db1c;logger[_0x4427('0x2f')]('The\x20User\x20ID\x20is:',_0x9c677['id']);return getEndUser(_0x46a4e7,_0x222e4b,_0x319098,_0x4d58dc['calleridname'],_0x4d58dc[_0x4427('0x8a')],_0x9c677,_0x4efbcd);})[_0x4427('0x29')](function(_0x33d0e0){_0x66bc56=_0x33d0e0;return getCall(_0x46a4e7,_0x222e4b,_0x319098,_0x9c677,_0x66bc56,_0x4efbcd,_0x4d58dc,_0x4427('0x79'));})[_0x4427('0x29')](function(_0x16d4cd){if(_0x16d4cd){logger['info'](_0x4427('0x8b'),_0x16d4cd['id']);logger[_0x4427('0x2f')](_0x4427('0x83'),_0x4427('0x8c'));emit(util['format'](_0x4427('0x8d'),_0x4b6d8b[_0x4427('0x1b')]),_0x4427('0x8e'),{'uri':'https://crm.'+_0x319098[_0x4427('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x16d4cd['id']});}})[_0x4427('0x2c')](function(_0x4331e9){logger[_0x4427('0x2d')]('[QUEUE]',JSON[_0x4427('0xf')](_0x4331e9));});};exports[_0x4427('0x77')]=function(_0x3a82e5,_0x79803c,_0x24f9bf,_0x252997,_0xa68607,_0x2ecba3,_0x386655){var _0x110263,_0x114226,_0x1bcc96;_0x2ecba3[_0x4427('0x81')]=intUtil[_0x4427('0x80')](_0x2ecba3[_0x4427('0x81')]);_0x2ecba3[_0x4427('0x82')]=intUtil[_0x4427('0x80')](_0x2ecba3[_0x4427('0x82')]);if(_0x386655&&_0x386655[_0x4427('0x8f')]&&_0x386655[_0x4427('0x8f')]!==_0x4427('0x90')){logger[_0x4427('0x2f')](_0x4427('0x91'),'Recording\x20is\x20enabled!');_0x79803c[_0x4427('0x84')]=_0x2ecba3[_0x4427('0x82')]+_0x4427('0x85')+_0x79803c[_0x4427('0x87')]+_0x4427('0x86')+md5(_0x79803c[_0x4427('0x87')]);}var _0x5318bc=_0x2ecba3[_0x4427('0x81')]==='zoho.eu'?'eu':_0x4427('0x89');return getAccessToken(_0x2ecba3)[_0x4427('0x29')](function(_0x3ee5c3){_0x1bcc96=_0x3ee5c3;return getUser(_0x1bcc96,_0x5318bc,_0x2ecba3,_0x252997['email']);})['then'](function(_0x4e5f38){_0x110263=_0x4e5f38;logger[_0x4427('0x2f')]('The\x20User\x20ID\x20is:',_0x110263['id']);return getEndUser(_0x1bcc96,_0x5318bc,_0x2ecba3,_0x79803c['destcalleridname'],_0x79803c['destcalleridnum'],_0x110263,_0x24f9bf);})[_0x4427('0x29')](function(_0xec0273){_0x114226=_0xec0273;return getCall(_0x1bcc96,_0x5318bc,_0x2ecba3,_0x110263,_0x114226,_0x24f9bf,_0x79803c,_0x4427('0x92'));})[_0x4427('0x29')](function(_0x5009fe){if(_0x5009fe){logger['info'](_0x4427('0x8b'),_0x5009fe['id']);logger[_0x4427('0x2f')](_0x4427('0x91'),_0x4427('0x8c'));emit(util[_0x4427('0x65')]('user:%s',_0x252997[_0x4427('0x1b')]),_0x4427('0x8e'),{'uri':_0x4427('0x93')+_0x2ecba3[_0x4427('0x81')]+_0x4427('0x94')+_0x5009fe['id']});}})['catch'](function(_0x1cba6e){logger[_0x4427('0x2d')]('[OUTBOUND]',JSON[_0x4427('0xf')](_0x1cba6e));});};exports['unmanaged']=function(_0x281ebe,_0x18c3a4,_0x581426,_0x19bf2d,_0x1f4089,_0x4dc2c9){var _0x2e0e9d,_0x48b35c,_0x58a5ba;_0x4dc2c9['host']=intUtil['stripTrailingSlash'](_0x4dc2c9[_0x4427('0x81')]);_0x4dc2c9['serverUrl']=intUtil[_0x4427('0x80')](_0x4dc2c9[_0x4427('0x82')]);if(_0x1f4089&&_0x1f4089[_0x4427('0x95')]){logger[_0x4427('0x2f')]('['+_0x18c3a4['lastevent']['toUpperCase']()+']',_0x4427('0x96'));_0x18c3a4[_0x4427('0x84')]=_0x4dc2c9[_0x4427('0x82')]+_0x4427('0x85')+_0x18c3a4[_0x4427('0x87')]+_0x4427('0x86')+md5(_0x18c3a4['uniqueid']);}else{_0x18c3a4[_0x4427('0x84')]='';}var _0x152bcb=_0x4dc2c9[_0x4427('0x81')]===_0x4427('0x88')?'eu':_0x4427('0x89');return getAccessToken(_0x4dc2c9)[_0x4427('0x29')](function(_0x490cbd){_0x58a5ba=_0x490cbd;return getUser(_0x58a5ba,_0x152bcb,_0x4dc2c9);})[_0x4427('0x29')](function(_0x5c2992){_0x2e0e9d=_0x5c2992;logger[_0x4427('0x2f')](_0x4427('0x97'),_0x2e0e9d['id']);return getEndUser(_0x58a5ba,_0x152bcb,_0x4dc2c9,_0x18c3a4['calleridname'],_0x18c3a4['calleridnum'],_0x2e0e9d,_0x581426);})['then'](function(_0x3277fd){_0x48b35c=_0x3277fd;return getCall(_0x58a5ba,_0x152bcb,_0x4dc2c9,_0x2e0e9d,_0x48b35c,_0x581426,_0x18c3a4,_0x4427('0x79'));})[_0x4427('0x29')](function(_0x3e506c){if(_0x3e506c){logger[_0x4427('0x2f')]('The\x20Call\x20ID\x20is:',_0x3e506c['id']);}})['catch'](function(_0x3327aa){logger['error']('['+_0x18c3a4[_0x4427('0x6a')]['toUpperCase']()+']',JSON[_0x4427('0xf')](_0x3327aa));});}; \ No newline at end of file +var _0xcc2e=['Creating\x20new\x20call...','Owner','administrator','first_name','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','user:%s','unmanaged','toUpperCase','/downloads?type=uniqueid&token=','calleridname','lodash','request-promise','util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','stringify','length','forEach','includes','string','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','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','refresh_token','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','startCase','moduleCreate','role','last_name','data','details','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads'];(function(_0x950140,_0x2e4d36){var _0x2acd98=function(_0x3a1903){while(--_0x3a1903){_0x950140['push'](_0x950140['shift']());}};_0x2acd98(++_0x2e4d36);}(_0xcc2e,0xdd));var _0xecc2=function(_0x6395f8,_0x539b75){_0x6395f8=_0x6395f8-0x0;var _0x3d28fb=_0xcc2e[_0x6395f8];return _0x3d28fb;};'use strict';var _=require(_0xecc2('0x0'));var rp=require(_0xecc2('0x1'));var md5=require('md5');var util=require(_0xecc2('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xecc2('0x3'));var BPromise=require(_0xecc2('0x4'));var config=require(_0xecc2('0x5'));var logger=require(_0xecc2('0x6'))(_0xecc2('0x7'));config[_0xecc2('0x8')]=_['defaults'](config['redis'],{'host':_0xecc2('0x9'),'port':0x18eb});var io=require(_0xecc2('0xa'))(new Redis(config[_0xecc2('0x8')]));function emit(_0x2f1764,_0x2d66a1,_0x545668){io['to'](_0x2f1764)[_0xecc2('0xb')](_0x2d66a1,_0x545668);}function request(_0x533643){logger['debug']('[HTTP]',JSON[_0xecc2('0xc')](_0x533643));return rp(_0x533643);}function getCustomFields(_0x4635cd,_0x31788b){var _0x1121a4={};if(_0x4635cd[_0xecc2('0xd')]>0x0){_[_0xecc2('0xe')](_0x4635cd,function(_0x48b5d8){if(_[_0xecc2('0xf')]([_0xecc2('0x10'),'picklist'],_0x48b5d8[_0xecc2('0x11')])&&_0x48b5d8[_0xecc2('0x12')]){_0x1121a4[_0x48b5d8[_0xecc2('0x12')]]=_0x48b5d8['content'][_0xecc2('0x13')]();}else if(_0x48b5d8[_0xecc2('0x11')]===_0xecc2('0x14')&&_0x48b5d8[_0xecc2('0x15')]&&_0x48b5d8[_0xecc2('0x12')]&&_0x31788b[_0x48b5d8['variableName']]){_0x1121a4[_0x48b5d8[_0xecc2('0x12')]]=_0x31788b[_0x48b5d8[_0xecc2('0x15')]][_0xecc2('0x13')]();}else if(_0x48b5d8[_0xecc2('0x11')]===_0xecc2('0x16')&&_0x48b5d8[_0xecc2('0x17')]&&_0x48b5d8['Variable'][_0xecc2('0x18')]&&_0x48b5d8[_0xecc2('0x12')]&&_0x31788b[_0x48b5d8['Variable']['name']['toLowerCase']()]){_0x1121a4[_0x48b5d8[_0xecc2('0x12')]]=_0x31788b[_0x48b5d8[_0xecc2('0x17')][_0xecc2('0x18')][_0xecc2('0x19')]()][_0xecc2('0x13')]();}});}return _0x1121a4;}function getName(_0x2a569c){if(_0x2a569c['indexOf']('\x20')>0x0){var _0x40c50c=_0x2a569c[_0xecc2('0x1a')](/ (.+)/);if(_0x40c50c[0x1]){return _0x40c50c;}}return[_0x2a569c,_0x2a569c];}var accountsTokens={};function getAccessToken(_0x38c6e4){return new Promise(function(_0x9d0068,_0xc61661){if(!_[_0xecc2('0x1b')](accountsTokens[_0x38c6e4['id']])&&!_['isNil'](accountsTokens[_0x38c6e4['id']][_0xecc2('0x1c')])){if(moment()[_0xecc2('0x1d')](accountsTokens[_0x38c6e4['id']]['expires_in'])){_0x9d0068(accountsTokens[_0x38c6e4['id']]['access_token']);}}var _0x333a60;switch(_0x38c6e4[_0xecc2('0x1e')]){case'US':_0x333a60=_0xecc2('0x1f');break;case'AU':_0x333a60=_0xecc2('0x20');break;case'EU':_0x333a60=_0xecc2('0x21');break;case'IN':_0x333a60=_0xecc2('0x22');break;case'CN':_0x333a60=_0xecc2('0x23');break;default:_0x333a60=_0xecc2('0x21');break;}var _0x3e0aa3={'method':_0xecc2('0x24'),'uri':_0x333a60+_0xecc2('0x25'),'qs':{'refresh_token':_0x38c6e4['refreshToken'],'client_id':_0x38c6e4[_0xecc2('0x26')],'client_secret':_0x38c6e4['clientSecret'],'grant_type':_0xecc2('0x27')},'json':!![]};return rp(_0x3e0aa3)['then'](function(_0x33eb11){accountsTokens[_0x38c6e4['id']]={'access_token':_0x33eb11[_0xecc2('0x1c')],'expires_in':moment()[_0xecc2('0x28')](_0x33eb11[_0xecc2('0x29')],_0xecc2('0x2a'))};_0x9d0068(_0x33eb11['access_token']);})[_0xecc2('0x2b')](function(_0x11df78){logger[_0xecc2('0x2c')](_0xecc2('0x2d'),_0x11df78[_0xecc2('0x2e')]);_0xc61661(_0x11df78);});});}function getUser(_0x2b8d71,_0x2a9b46,_0xa831da,_0x5ba4ee){logger[_0xecc2('0x2f')](_0xecc2('0x30'));return request({'method':_0xecc2('0x31'),'uri':util[_0xecc2('0x32')](_0xecc2('0x33'),_0x2a9b46),'qs':{'type':_0xecc2('0x34')},'headers':{'Authorization':_0xecc2('0x35')+_0x2b8d71},'json':!![]})[_0xecc2('0x36')](function(_0x5b831c){if(_0x5b831c['users']){var _0xae01b7=-0x1;if(_['isArrayLikeObject'](_0x5b831c[_0xecc2('0x37')])){if(!_['isNil'](_0x5ba4ee)){_0xae01b7=_[_0xecc2('0x38')](_0x5b831c[_0xecc2('0x37')],function(_0x509802){return _0x509802[_0xecc2('0x39')]===_0x5ba4ee;});}if(_0xae01b7>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xecc2('0x2f')](_0xecc2('0x3a'));_0xae01b7=_[_0xecc2('0x38')](_0x5b831c['users'],function(_0x3cd4d9){return _0x3cd4d9[_0xecc2('0x3b')]['name']==='Administrator';});}return _0x5b831c['users'][_0xae01b7];}else{if(_0x5b831c[_0xecc2('0x3c')][_0xecc2('0x3b')][_0xecc2('0x18')]===_0xecc2('0x3d')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x5b831c['user'];return user;}else{logger[_0xecc2('0x2c')](_0xecc2('0x3e'),JSON['stringify'](_0x5b831c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5b831c));}}}else{logger[_0xecc2('0x2c')](_0xecc2('0x3e'),JSON[_0xecc2('0xc')](_0x5b831c));throw new Error(_0xecc2('0x3f')+JSON[_0xecc2('0xc')](_0x5b831c));}})['catch'](function(_0x418539){console[_0xecc2('0x2c')](_0x418539);});}function getZohoUser(_0x4ccef4,_0x392b32){return new BPromise(function(_0x354b13,_0x4c33f9){request(_0x4ccef4)[_0xecc2('0x36')](function(_0x408569){var _0x5238e8=null;if(_0x408569){_0x5238e8=_0x408569['data'][0x0];_0x5238e8[_0xecc2('0x40')]=_0x392b32;}_0x354b13(_0x5238e8);})[_0xecc2('0x2b')](function(_0x1a7e4e){_0x4c33f9(_0x1a7e4e);});});}function createEndUser(_0x6bbb,_0x5458c4,_0x4fd137,_0x87f1dd,_0x56839a,_0xf0bae){var _0x4fd137=getName(_0x4fd137);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x5458c4+'/crm/v2/'+_[_0xecc2('0x41')](_0xf0bae[_0xecc2('0x42')])+'s','body':{'data':[{'Last_Name':_0x4fd137[0x1],'First_Name':_0x4fd137[0x0],'Phone':_0x87f1dd,'Owner':{'name':!_[_0xecc2('0x1b')](_0x56839a[_0xecc2('0x43')][_0xecc2('0x18')])?_0x56839a[_0xecc2('0x43')][_0xecc2('0x18')]:!_[_0xecc2('0x1b')](_0x56839a['first_name'])?_0x56839a['first_name']+'\x20'+_0x56839a[_0xecc2('0x44')]:_0x56839a['last_name'],'id':_0x56839a['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x6bbb},'json':!![]})['then'](function(_0x37c704){if(_0x37c704&&_0x37c704[_0xecc2('0x45')][0x0]['code']==='SUCCESS'){var _0x11710a=_0x37c704[_0xecc2('0x45')][0x0][_0xecc2('0x46')];_0x11710a[_0xecc2('0x40')]=_[_0xecc2('0x41')](_0xf0bae[_0xecc2('0x42')])+'s';return _0x11710a;}logger['error'](_0xecc2('0x3e'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xecc2('0x2b')](function(_0x4877ab){console[_0xecc2('0x47')]('CREATE\x20ERROR',_0x4877ab);});}function getEndUser(_0x8fbbe2,_0x2199b2,_0x2aa60d,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532){var _0x5f598c={'method':_0xecc2('0x31'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x8fbbe2},'json':!![]};switch(_0x229532[_0xecc2('0x48')]){case _0xecc2('0x49'):_0x5f598c[_0xecc2('0x4a')]='https://www.zohoapis.'+_0x2199b2+_0xecc2('0x4b')+_0x724ad7+'))';return getZohoUser(_0x5f598c,_0xecc2('0x4c'))[_0xecc2('0x36')](function(_0x173f2a){if(_0x173f2a)return _0x173f2a;_0x5f598c[_0xecc2('0x4a')]=_0xecc2('0x4d')+_0x2199b2+_0xecc2('0x4e')+_0x724ad7+'))';return getZohoUser(_0x5f598c,'Leads')[_0xecc2('0x36')](function(_0x4f4a47){if(_0x4f4a47)return _0x4f4a47;if(_0x229532[_0xecc2('0x42')]!=_0xecc2('0x4f')){return createEndUser(_0x8fbbe2,_0x2199b2,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532);}else{return{};}});});break;case _0xecc2('0x50'):_0x5f598c[_0xecc2('0x4a')]=_0xecc2('0x4d')+_0x2199b2+_0xecc2('0x4b')+_0x724ad7+'))';return getZohoUser(_0x5f598c,_0xecc2('0x4c'))['then'](function(_0x3bb5c8){if(_0x3bb5c8)return _0x3bb5c8;if(_0x229532[_0xecc2('0x42')]!='nothing'){return createEndUser(_0x8fbbe2,_0x2199b2,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532);}else{return{};}});break;case _0xecc2('0x51'):_0x5f598c[_0xecc2('0x4a')]=_0xecc2('0x4d')+_0x2199b2+_0xecc2('0x4e')+_0x724ad7+'))';return getZohoUser(_0x5f598c,_0xecc2('0x52'))['then'](function(_0x16aa08){if(_0x16aa08)return _0x16aa08;if(_0x229532[_0xecc2('0x42')]!=_0xecc2('0x4f')){return createEndUser(_0x8fbbe2,_0x2199b2,_0x513d25,_0x724ad7,_0x1b6e0c,_0x229532);}else{return{};}});break;}}function getCall(_0x25d1d2,_0xfb65f6,_0x53d709,_0x2052ab,_0x55711f,_0xead6e3,_0x42a1c4,_0x2bf746){logger['info'](_0xecc2('0x53'));var _0xd14ef3={};_0xd14ef3[_0xecc2('0x54')]={'name':!_[_0xecc2('0x1b')](_0x2052ab[_0xecc2('0x43')][_0xecc2('0x18')])&&!_[_0xecc2('0x1b')](_0x2052ab[_0xecc2('0x3b')][_0xecc2('0x18')])&&_0x2052ab[_0xecc2('0x3b')]['name']===_0xecc2('0x55')?_0x2052ab[_0xecc2('0x43')][_0xecc2('0x18')]:!_[_0xecc2('0x1b')](_0x2052ab[_0xecc2('0x56')])?_0x2052ab[_0xecc2('0x56')]+'\x20'+_0x2052ab[_0xecc2('0x44')]:_0x2052ab['last_name'],'id':_0x2052ab['id']};_0xd14ef3['Subject']=intUtil[_0xecc2('0x57')](_0xead6e3[_0xecc2('0x58')],_0x42a1c4,'\x20');_0xd14ef3[_0xecc2('0x59')]=intUtil[_0xecc2('0x57')](_0xead6e3[_0xecc2('0x5a')],_0x42a1c4,'\x0a');if(_0x55711f[_0xecc2('0x40')]==='Contacts'){_0xd14ef3[_0xecc2('0x5b')]={'name':!_[_0xecc2('0x1b')](_0x55711f['Full_Name'])?_0x55711f[_0xecc2('0x5c')]:!_[_0xecc2('0x1b')](_0x55711f['First_Name'])?_0x55711f[_0xecc2('0x5d')]+'\x20'+_0x55711f['Last_Name']:_0x55711f[_0xecc2('0x5e')],'id':_0x55711f['id']};}if(_0x55711f[_0xecc2('0x40')]===_0xecc2('0x52')){_0xd14ef3['What_Id']={'name':!_[_0xecc2('0x1b')](_0x55711f[_0xecc2('0x5c')])?_0x55711f[_0xecc2('0x5c')]:!_[_0xecc2('0x1b')](_0x55711f[_0xecc2('0x5d')])?_0x55711f['First_Name']+'\x20'+_0x55711f['Last_Name']:_0x55711f[_0xecc2('0x5e')],'id':_0x55711f['id']};_0xd14ef3[_0xecc2('0x5f')]=_[_0xecc2('0x41')](_0x55711f[_0xecc2('0x40')]);}if(_0x42a1c4[_0xecc2('0x60')]){_0xd14ef3[_0xecc2('0x61')]=moment[_0xecc2('0x62')](parseInt(_0x42a1c4[_0xecc2('0x60')])*0x3e8)[_0xecc2('0x32')]('mm:ss');}else if(_0x42a1c4[_0xecc2('0x63')]&&_0x42a1c4[_0xecc2('0x64')]){_0xd14ef3['Call_Duration']=moment[_0xecc2('0x62')](moment(_0x42a1c4[_0xecc2('0x64')],_0xecc2('0x65'))['diff'](moment(_0x42a1c4[_0xecc2('0x66')],_0xecc2('0x65'))))[_0xecc2('0x32')](_0xecc2('0x67'));}switch(_0x42a1c4[_0xecc2('0x68')]){case'called':_0xd14ef3[_0xecc2('0x69')]=_0xecc2('0x6a');break;case _0xecc2('0x6b'):case'connect':_0xd14ef3[_0xecc2('0x69')]=_0xecc2('0x6c');break;case _0xecc2('0x6d'):_0xd14ef3[_0xecc2('0x69')]=_0xecc2('0x6e');break;case _0xecc2('0x6f'):_0xd14ef3['Call_Result']='Abandoned';break;case _0xecc2('0x70'):_0xd14ef3['Call_Result']=_0xecc2('0x71');default:}_0xd14ef3[_0xecc2('0x72')]=(_0x2bf746==='outbound'?moment(_0x42a1c4[_0xecc2('0x66')])[_0xecc2('0x32')](_0xecc2('0x65')):moment(_0x42a1c4[_0xecc2('0x73')])[_0xecc2('0x32')](_0xecc2('0x65')))||moment()[_0xecc2('0x32')](_0xecc2('0x65'));_0xd14ef3['Call_Type']=_0x2bf746||'Inbound';_0xd14ef3=_['merge'](_0xd14ef3,getCustomFields(_0xead6e3['Fields'],_0x42a1c4));return request({'method':_0xecc2('0x24'),'uri':_0xecc2('0x4d')+_0xfb65f6+_0xecc2('0x74'),'headers':{'Authorization':_0xecc2('0x35')+_0x25d1d2},'body':{'data':[_0xd14ef3]},'json':!![]})['then'](function(_0x7d6bcc){if(_0x7d6bcc&&_0x7d6bcc[_0xecc2('0x45')][0x0][_0xecc2('0x75')]===_0xecc2('0x76')){logger[_0xecc2('0x2f')](_0xecc2('0x77'));return{'id':_0x7d6bcc['data'][0x0]['details']['id']};}})['catch'](function(_0x297124){logger[_0xecc2('0x2f')](_0xecc2('0x78'),_0x297124[_0xecc2('0x2e')]);console[_0xecc2('0x47')](_0xecc2('0x78'),_0x297124);});}exports[_0xecc2('0x79')]=function(_0x2ba6e9,_0x528577,_0x4a7355,_0x1cd7cc,_0x48df28,_0x568b82){var _0x5228ca,_0x2e4309,_0x156f59;_0x568b82[_0xecc2('0x7a')]=intUtil[_0xecc2('0x7b')](_0x568b82[_0xecc2('0x7a')]);_0x568b82['serverUrl']=intUtil[_0xecc2('0x7b')](_0x568b82[_0xecc2('0x7c')]);if(_0x48df28&&_0x48df28['monitor_format']){logger[_0xecc2('0x2f')]('[QUEUE]',_0xecc2('0x7d'));_0x528577[_0xecc2('0x7e')]=_0x568b82['serverUrl']+_0xecc2('0x7f')+_0x528577[_0xecc2('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x528577['uniqueid']);}else{_0x528577[_0xecc2('0x7e')]='';}var _0x248ca0=_0x568b82[_0xecc2('0x7a')]===_0xecc2('0x81')?'eu':'com';return getAccessToken(_0x568b82)[_0xecc2('0x36')](function(_0x290862){_0x156f59=_0x290862;return getUser(_0x156f59,_0x248ca0,_0x568b82,_0x1cd7cc[_0xecc2('0x39')]);})[_0xecc2('0x36')](function(_0x10070f){_0x5228ca=_0x10070f;logger[_0xecc2('0x2f')](_0xecc2('0x82'),_0x5228ca['id']);return getEndUser(_0x156f59,_0x248ca0,_0x568b82,_0x528577['calleridname'],_0x528577[_0xecc2('0x83')],_0x5228ca,_0x4a7355);})[_0xecc2('0x36')](function(_0x216487){_0x2e4309=_0x216487;return getCall(_0x156f59,_0x248ca0,_0x568b82,_0x5228ca,_0x2e4309,_0x4a7355,_0x528577,_0xecc2('0x84'));})[_0xecc2('0x36')](function(_0x329feb){if(_0x329feb){logger[_0xecc2('0x2f')]('The\x20Call\x20ID\x20is:',_0x329feb['id']);logger['info']('[QUEUE]',_0xecc2('0x85'));emit(util[_0xecc2('0x32')]('user:%s',_0x1cd7cc['name']),_0xecc2('0x86'),{'uri':_0xecc2('0x87')+_0x568b82[_0xecc2('0x7a')]+_0xecc2('0x88')+_0x329feb['id']});}})[_0xecc2('0x2b')](function(_0x2f3ef5){logger[_0xecc2('0x2c')](_0xecc2('0x89'),JSON[_0xecc2('0xc')](_0x2f3ef5));});};exports[_0xecc2('0x8a')]=function(_0x4675b9,_0x110e5f,_0x292f0f,_0xf15fec,_0xdaf00c,_0x36e7cc,_0x4b38b5){var _0x5a38fa,_0x365b0d,_0x45ae36;_0x36e7cc['host']=intUtil['stripTrailingSlash'](_0x36e7cc[_0xecc2('0x7a')]);_0x36e7cc[_0xecc2('0x7c')]=intUtil[_0xecc2('0x7b')](_0x36e7cc[_0xecc2('0x7c')]);if(_0x4b38b5&&_0x4b38b5[_0xecc2('0x8b')]&&_0x4b38b5[_0xecc2('0x8b')]!==_0xecc2('0x8c')){logger[_0xecc2('0x2f')](_0xecc2('0x8d'),_0xecc2('0x7d'));_0x110e5f['recordingURL']=_0x36e7cc[_0xecc2('0x7c')]+'/api/voice/recordings/'+_0x110e5f[_0xecc2('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x110e5f[_0xecc2('0x80')]);}var _0x26be28=_0x36e7cc['host']===_0xecc2('0x81')?'eu':_0xecc2('0x8e');return getAccessToken(_0x36e7cc)[_0xecc2('0x36')](function(_0x4a79b1){_0x45ae36=_0x4a79b1;return getUser(_0x45ae36,_0x26be28,_0x36e7cc,_0xf15fec[_0xecc2('0x39')]);})[_0xecc2('0x36')](function(_0x15d3cc){_0x5a38fa=_0x15d3cc;logger[_0xecc2('0x2f')](_0xecc2('0x82'),_0x5a38fa['id']);return getEndUser(_0x45ae36,_0x26be28,_0x36e7cc,_0x110e5f[_0xecc2('0x8f')],_0x110e5f[_0xecc2('0x90')],_0x5a38fa,_0x292f0f);})[_0xecc2('0x36')](function(_0x4f7759){_0x365b0d=_0x4f7759;return getCall(_0x45ae36,_0x26be28,_0x36e7cc,_0x5a38fa,_0x365b0d,_0x292f0f,_0x110e5f,_0xecc2('0x91'));})[_0xecc2('0x36')](function(_0x40e148){if(_0x40e148){logger[_0xecc2('0x2f')](_0xecc2('0x92'),_0x40e148['id']);logger[_0xecc2('0x2f')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xecc2('0x32')](_0xecc2('0x93'),_0xf15fec[_0xecc2('0x18')]),_0xecc2('0x86'),{'uri':_0xecc2('0x87')+_0x36e7cc[_0xecc2('0x7a')]+_0xecc2('0x88')+_0x40e148['id']});}})[_0xecc2('0x2b')](function(_0x80e836){logger[_0xecc2('0x2c')]('[OUTBOUND]',JSON[_0xecc2('0xc')](_0x80e836));});};exports[_0xecc2('0x94')]=function(_0x3d4859,_0x50fff8,_0xd76047,_0x144202,_0x2a225e,_0x593f43){var _0x3676d1,_0x333ed7,_0x6f55ed;_0x593f43[_0xecc2('0x7a')]=intUtil[_0xecc2('0x7b')](_0x593f43['host']);_0x593f43[_0xecc2('0x7c')]=intUtil[_0xecc2('0x7b')](_0x593f43['serverUrl']);if(_0x2a225e&&_0x2a225e['monitor_format']){logger[_0xecc2('0x2f')]('['+_0x50fff8[_0xecc2('0x68')][_0xecc2('0x95')]()+']',_0xecc2('0x7d'));_0x50fff8['recordingURL']=_0x593f43[_0xecc2('0x7c')]+'/api/voice/recordings/'+_0x50fff8[_0xecc2('0x80')]+_0xecc2('0x96')+md5(_0x50fff8[_0xecc2('0x80')]);}else{_0x50fff8[_0xecc2('0x7e')]='';}var _0x7651d1=_0x593f43['host']==='zoho.eu'?'eu':_0xecc2('0x8e');return getAccessToken(_0x593f43)['then'](function(_0x4aa515){_0x6f55ed=_0x4aa515;return getUser(_0x6f55ed,_0x7651d1,_0x593f43);})[_0xecc2('0x36')](function(_0x20beae){_0x3676d1=_0x20beae;logger[_0xecc2('0x2f')](_0xecc2('0x82'),_0x3676d1['id']);return getEndUser(_0x6f55ed,_0x7651d1,_0x593f43,_0x50fff8[_0xecc2('0x97')],_0x50fff8[_0xecc2('0x83')],_0x3676d1,_0xd76047);})['then'](function(_0x2d2d36){_0x333ed7=_0x2d2d36;return getCall(_0x6f55ed,_0x7651d1,_0x593f43,_0x3676d1,_0x333ed7,_0xd76047,_0x50fff8,'Inbound');})[_0xecc2('0x36')](function(_0x104d63){if(_0x104d63){logger[_0xecc2('0x2f')](_0xecc2('0x92'),_0x104d63['id']);}})[_0xecc2('0x2b')](function(_0x1afdba){logger[_0xecc2('0x2c')]('['+_0x50fff8['lastevent'][_0xecc2('0x95')]()+']',JSON[_0xecc2('0xc')](_0x1afdba));});}; \ 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 6848b18..cef7e33 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 _0x333e=['render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3'];(function(_0x56a58f,_0x17841d){var _0x552049=function(_0x15c24e){while(--_0x15c24e){_0x56a58f['push'](_0x56a58f['shift']());}};_0x552049(++_0x17841d);}(_0x333e,0x19c));var _0xe333=function(_0x4fbc9f,_0x1ba070){_0x4fbc9f=_0x4fbc9f-0x0;var _0x205885=_0x333e[_0x4fbc9f];return _0x205885;};'use strict';var util=require(_0xe333('0x0'));var sh=require(_0xe333('0x1'));var Mustache=require(_0xe333('0x2'));var logger=require(_0xe333('0x3'))(_0xe333('0x4'));exports['exec']=function(_0x18368b,_0x18ec93){var _0x5ed21c=_0x18368b[_0xe333('0x5')]?_0x18368b[_0xe333('0x5')]:_0xe333('0x6');var _0x30d739=_0x18368b[_0xe333('0x7')]?Mustache[_0xe333('0x8')](_0x18368b[_0xe333('0x7')],_0x18ec93):_0x18ec93;sh[_0xe333('0x9')](_0x30d739,function(_0x1eacad,_0xabfe0c,_0x5bd409){if(_0x1eacad!==0x0){logger[_0xe333('0xa')](util[_0xe333('0xb')](_0xe333('0xc'),_0x5ed21c,_0x30d739,_0x1eacad,_0x5bd409));}else{logger[_0xe333('0xd')](util[_0xe333('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x5ed21c,_0x30d739,_0xabfe0c));}});}; \ No newline at end of file +var _0x6bd0=['error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','trigger','exec','data2','Script','render','data3'];(function(_0x153da6,_0xc9bfde){var _0xf01a0d=function(_0x409ed5){while(--_0x409ed5){_0x153da6['push'](_0x153da6['shift']());}};_0xf01a0d(++_0xc9bfde);}(_0x6bd0,0x161));var _0x06bd=function(_0x548924,_0x18acc1){_0x548924=_0x548924-0x0;var _0x36bbdc=_0x6bd0[_0x548924];return _0x36bbdc;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x06bd('0x0'));var logger=require('../../../../config/logger')(_0x06bd('0x1'));exports[_0x06bd('0x2')]=function(_0x25d35b,_0x121763){var _0x47a4d5=_0x25d35b[_0x06bd('0x3')]?_0x25d35b['data2']:_0x06bd('0x4');var _0x367489=_0x25d35b['data3']?Mustache[_0x06bd('0x5')](_0x25d35b[_0x06bd('0x6')],_0x121763):_0x121763;sh['exec'](_0x367489,function(_0x1cfbd2,_0x4c5cc0,_0x678e85){if(_0x1cfbd2!==0x0){logger[_0x06bd('0x7')](util[_0x06bd('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x47a4d5,_0x367489,_0x1cfbd2,_0x678e85));}else{logger['info'](util[_0x06bd('0x8')](_0x06bd('0x9'),_0x47a4d5,_0x367489,_0x4c5cc0));}});}; \ 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 621c1f5..46c96c6 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 _0xffc0=['stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','info','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xffc0,0x144));var _0x0ffc=function(_0x3a2d14,_0x1f4ebf){_0x3a2d14=_0x3a2d14-0x0;var _0x5b0f7e=_0xffc0[_0x3a2d14];return _0x5b0f7e;};'use strict';var rp=require(_0x0ffc('0x0'));var util=require(_0x0ffc('0x1'));var _=require(_0x0ffc('0x2'));var Mustache=require(_0x0ffc('0x3'));var logger=require(_0x0ffc('0x4'))(_0x0ffc('0x5'));exports['exec']=function(_0x2c8151,_0x23dcf8){var _0x31d8ee,_0xf9c88e;var _0x31eb05={'method':_0x2c8151[_0x0ffc('0x6')][_0x0ffc('0x7')](),'uri':Mustache[_0x0ffc('0x8')](_0x2c8151[_0x0ffc('0x9')],_0x23dcf8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2c8151[_0x0ffc('0xa')])===_0x0ffc('0xb')&&parseInt(_0x2c8151[_0x0ffc('0xa')])>=0x1&&parseInt(_0x2c8151[_0x0ffc('0xa')])<=0xa?parseInt(_0x2c8151['data5'])*0x3e8:0x5*0x3e8};try{_0x31eb05[_0x0ffc('0xc')]=_0x2c8151[_0x0ffc('0xd')]?JSON[_0x0ffc('0xe')](Mustache[_0x0ffc('0x8')](_0x2c8151[_0x0ffc('0xd')],_0x23dcf8)):{};}catch(_0x2be406){logger[_0x0ffc('0xf')](_0x2be406[_0x0ffc('0x10')]);}switch(_0x2c8151['data1'][_0x0ffc('0x7')]()){case _0x0ffc('0x11'):case'DELETE':_0x31d8ee=null;_0x31eb05['qs']=_0x23dcf8;break;case _0x0ffc('0x12'):case _0x0ffc('0x13'):if(_0x2c8151[_0x0ffc('0x14')]){try{_0x31d8ee=JSON['parse'](Mustache[_0x0ffc('0x8')](_0x2c8151['data7'],_0x23dcf8));_0x31eb05[_0x0ffc('0x15')]=_0x31d8ee;}catch(_0x3c4f48){logger[_0x0ffc('0xf')](_0x3c4f48[_0x0ffc('0x10')]);logger[_0x0ffc('0xf')](_0x0ffc('0x16'));}}else{_0x31d8ee=_0x23dcf8;_0x31eb05[_0x0ffc('0x15')]=_0x31d8ee;}break;}logger['info'](util[_0x0ffc('0x17')](_0x0ffc('0x18'),_0x2c8151[_0x0ffc('0x6')],_0x2c8151['data2'],JSON[_0x0ffc('0x19')](_0x31eb05)));rp(_0x31eb05)[_0x0ffc('0x1a')](function(_0x42f013){_0x31d8ee=!_[_0x0ffc('0x1b')](_0x31d8ee)?_0x0ffc('0x1c')+_0x31d8ee:'';_0xf9c88e=typeof _0x42f013['body']==='object'?JSON['stringify'](_0x42f013[_0x0ffc('0x15')]):_0x42f013[_0x0ffc('0x15')];logger[_0x0ffc('0x1d')](util[_0x0ffc('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2c8151['data1'],_0x2c8151[_0x0ffc('0x9')],_0x42f013[_0x0ffc('0x1e')],_0xf9c88e));})[_0x0ffc('0x1f')](function(_0x375b59){logger[_0x0ffc('0xf')](util[_0x0ffc('0x17')](_0x0ffc('0x20'),_0x2c8151[_0x0ffc('0x6')],_0x2c8151[_0x0ffc('0x9')],_0x375b59[_0x0ffc('0x1e')],_0x375b59[_0x0ffc('0x21')],_0x375b59['message']));});}; \ No newline at end of file +var _0x2dd9=['stack','data1','GET','DELETE','POST','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','body','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','exec','toUpperCase','render','data2','data5','number','headers','data6','parse','error'];(function(_0x14bb52,_0x5040a6){var _0x1a62e8=function(_0x5e41ef){while(--_0x5e41ef){_0x14bb52['push'](_0x14bb52['shift']());}};_0x1a62e8(++_0x5040a6);}(_0x2dd9,0x168));var _0x92dd=function(_0x22b022,_0x4af786){_0x22b022=_0x22b022-0x0;var _0x3d29b8=_0x2dd9[_0x22b022];return _0x3d29b8;};'use strict';var rp=require(_0x92dd('0x0'));var util=require(_0x92dd('0x1'));var _=require('lodash');var Mustache=require(_0x92dd('0x2'));var logger=require(_0x92dd('0x3'))('trigger');exports[_0x92dd('0x4')]=function(_0x5e9be8,_0x85e6ed){var _0x2e01bf,_0x3f11e7;var _0x341a48={'method':_0x5e9be8['data1'][_0x92dd('0x5')](),'uri':Mustache[_0x92dd('0x6')](_0x5e9be8[_0x92dd('0x7')],_0x85e6ed),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5e9be8[_0x92dd('0x8')])===_0x92dd('0x9')&&parseInt(_0x5e9be8[_0x92dd('0x8')])>=0x1&&parseInt(_0x5e9be8[_0x92dd('0x8')])<=0xa?parseInt(_0x5e9be8[_0x92dd('0x8')])*0x3e8:0x5*0x3e8};try{_0x341a48[_0x92dd('0xa')]=_0x5e9be8[_0x92dd('0xb')]?JSON[_0x92dd('0xc')](Mustache[_0x92dd('0x6')](_0x5e9be8[_0x92dd('0xb')],_0x85e6ed)):{};}catch(_0x314ea5){logger[_0x92dd('0xd')](_0x314ea5[_0x92dd('0xe')]);}switch(_0x5e9be8[_0x92dd('0xf')]['toUpperCase']()){case _0x92dd('0x10'):case _0x92dd('0x11'):_0x2e01bf=null;_0x341a48['qs']=_0x85e6ed;break;case _0x92dd('0x12'):case'PUT':if(_0x5e9be8['data7']){try{_0x2e01bf=JSON[_0x92dd('0xc')](Mustache[_0x92dd('0x6')](_0x5e9be8['data7'],_0x85e6ed));_0x341a48['body']=_0x2e01bf;}catch(_0x4ca055){logger['error'](_0x4ca055[_0x92dd('0xe')]);logger[_0x92dd('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2e01bf=_0x85e6ed;_0x341a48['body']=_0x2e01bf;}break;}logger['info'](util['format'](_0x92dd('0x13'),_0x5e9be8[_0x92dd('0xf')],_0x5e9be8[_0x92dd('0x7')],JSON[_0x92dd('0x14')](_0x341a48)));rp(_0x341a48)[_0x92dd('0x15')](function(_0x42c7c1){_0x2e01bf=!_[_0x92dd('0x16')](_0x2e01bf)?_0x92dd('0x17')+_0x2e01bf:'';_0x3f11e7=typeof _0x42c7c1[_0x92dd('0x18')]===_0x92dd('0x19')?JSON[_0x92dd('0x14')](_0x42c7c1['body']):_0x42c7c1[_0x92dd('0x18')];logger[_0x92dd('0x1a')](util[_0x92dd('0x1b')](_0x92dd('0x1c'),_0x5e9be8[_0x92dd('0xf')],_0x5e9be8['data2'],_0x42c7c1[_0x92dd('0x1d')],_0x3f11e7));})[_0x92dd('0x1e')](function(_0x506582){logger['error'](util['format'](_0x92dd('0x1f'),_0x5e9be8[_0x92dd('0xf')],_0x5e9be8['data2'],_0x506582[_0x92dd('0x1d')],_0x506582[_0x92dd('0x20')],_0x506582[_0x92dd('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f907f83..cd2efa9 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 _0x3e2e=['exports','../../config/logger','routing','client','http','then','rpc','error','message','result','catch'];(function(_0x5a6057,_0x19eb7f){var _0x523285=function(_0x108d76){while(--_0x108d76){_0x5a6057['push'](_0x5a6057['shift']());}};_0x523285(++_0x19eb7f);}(_0x3e2e,0x156));var _0xe3e2=function(_0x4c3cf4,_0x23a6eb){_0x4c3cf4=_0x4c3cf4-0x0;var _0x558d3b=_0x3e2e[_0x4c3cf4];return _0x558d3b;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xe3e2('0x0'))(_0xe3e2('0x1'));var client=jayson[_0xe3e2('0x2')][_0xe3e2('0x3')]({'port':0x2329});client['Request']=function(_0x50d7d2,_0x1a9e02){return new BPromise(function(_0x567590,_0x3ca35a){return client['request'](_0x50d7d2,_0x1a9e02)[_0xe3e2('0x4')](function(_0x3e6bf7){logger['debug'](_0xe3e2('0x5'),'routing',_0x50d7d2,_0x1a9e02,_0x3e6bf7);if(_0x3e6bf7['error']){logger[_0xe3e2('0x6')](_0xe3e2('0x5'),_0xe3e2('0x1'),_0x50d7d2,_0x3e6bf7[_0xe3e2('0x6')][_0xe3e2('0x7')],_0x1a9e02);return _0x3ca35a(_0x3e6bf7[_0xe3e2('0x6')][_0xe3e2('0x7')]);}else{return _0x567590(_0x3e6bf7[_0xe3e2('0x8')]);}})[_0xe3e2('0x9')](function(_0x4035bd){logger['error'](_0xe3e2('0x5'),'routing',_0x50d7d2,_0x4035bd,_0x1a9e02);return _0x3ca35a(_0x4035bd);});});};module[_0xe3e2('0xa')]=client; \ No newline at end of file +var _0xf40c=['then','rpc','error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf40c,0x18c));var _0xcf40=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf40c[_0x2a6809];return _0x11c371;};'use strict';var jayson=require(_0xcf40('0x0'));var BPromise=require(_0xcf40('0x1'));var logger=require(_0xcf40('0x2'))(_0xcf40('0x3'));var client=jayson[_0xcf40('0x4')][_0xcf40('0x5')]({'port':0x2329});client['Request']=function(_0x1bbdee,_0x480ff5){return new BPromise(function(_0x22cc9e,_0x33eb14){return client[_0xcf40('0x6')](_0x1bbdee,_0x480ff5)[_0xcf40('0x7')](function(_0x5a5d1a){logger['debug'](_0xcf40('0x8'),_0xcf40('0x3'),_0x1bbdee,_0x480ff5,_0x5a5d1a);if(_0x5a5d1a[_0xcf40('0x9')]){logger[_0xcf40('0x9')](_0xcf40('0x8'),'routing',_0x1bbdee,_0x5a5d1a[_0xcf40('0x9')]['message'],_0x480ff5);return _0x33eb14(_0x5a5d1a[_0xcf40('0x9')][_0xcf40('0xa')]);}else{return _0x22cc9e(_0x5a5d1a[_0xcf40('0xb')]);}})['catch'](function(_0x3d687e){logger['error']('rpc',_0xcf40('0x3'),_0x1bbdee,_0x3d687e,_0x480ff5);return _0x33eb14(_0x3d687e);});});};module[_0xcf40('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 447395b..15bd4b2 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 _0x4629=['error','./realtime','./lib/email','../../config/logger','email','then','getMailAccounts','refresh','mailAccounts','getSettings'];(function(_0x517fa8,_0x3adce0){var _0x5409f4=function(_0x501e80){while(--_0x501e80){_0x517fa8['push'](_0x517fa8['shift']());}};_0x5409f4(++_0x3adce0);}(_0x4629,0x15f));var _0x9462=function(_0x2762ce,_0x4505a0){_0x2762ce=_0x2762ce-0x0;var _0x444b75=_0x4629[_0x2762ce];return _0x444b75;};'use strict';var server=require('./server');var Realtime=require(_0x9462('0x0'));var EmailChannel=require(_0x9462('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0x9462('0x2'))(_0x9462('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x9462('0x4')](mailAccount[_0x9462('0x5')]())[_0x9462('0x4')](realtime['initMailAccounts']())[_0x9462('0x4')](function(){email[_0x9462('0x6')](realtime[_0x9462('0x7')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x9462('0x4')](function(){return initRealtime();})[_0x9462('0x4')](function(){return setting[_0x9462('0x8')]();})[_0x9462('0x4')](function(_0x39a9a7){return setInterval(initRealtime,_0x39a9a7['loginMailFrequency']*0x3e8);})['catch'](function(_0x3e4dac){logger[_0x9462('0x9')]('Email\x20service\x20initialization',_0x3e4dac);});}main(); \ No newline at end of file +var _0x1980=['loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','resolve','getMailAccounts','then','refresh','mailAccounts','getSettings'];(function(_0x5220f6,_0xab25f){var _0x32c0e0=function(_0x4ad714){while(--_0x4ad714){_0x5220f6['push'](_0x5220f6['shift']());}};_0x32c0e0(++_0xab25f);}(_0x1980,0x6f));var _0x0198=function(_0x370bc1,_0x123c05){_0x370bc1=_0x370bc1-0x0;var _0x10a973=_0x1980[_0x370bc1];return _0x10a973;};'use strict';var server=require(_0x0198('0x0'));var Realtime=require(_0x0198('0x1'));var EmailChannel=require(_0x0198('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0198('0x3')]()['then'](mailAccount[_0x0198('0x4')]())[_0x0198('0x5')](realtime['initMailAccounts']())[_0x0198('0x5')](function(){email[_0x0198('0x6')](realtime[_0x0198('0x7')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x0198('0x5')](function(){return initRealtime();})[_0x0198('0x5')](function(){return setting[_0x0198('0x8')]();})[_0x0198('0x5')](function(_0x50e037){return setInterval(initRealtime,_0x50e037[_0x0198('0x9')]*0x3e8);})['catch'](function(_0x4122ae){logger[_0x0198('0xa')](_0x0198('0xb'),_0x4122ae);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3e4a257..4146821 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 _0x91e7=['disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','Smtp','verified','catch','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','active','Imap','status','messageStatus','total','isNil','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','handleImapError'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x91e7,0x12f));var _0x791e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x91e7[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x791e('0x0'));var moment=require(_0x791e('0x1'));var BPromise=require(_0x791e('0x2'));var md5=require(_0x791e('0x3'));var Redis=require(_0x791e('0x4'));var config=require('../../../config/environment');var logger=require(_0x791e('0x5'))(_0x791e('0x6'));config[_0x791e('0x7')]=_['defaults'](config[_0x791e('0x7')],{'host':_0x791e('0x8'),'port':0x18eb});var io=require(_0x791e('0x9'))(new Redis(config['redis']));var EmailImap=require(_0x791e('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x791e('0xb'));var md5Accounts={};function EmailChannel(_0x2154bf){logger[_0x791e('0xc')](_0x791e('0xd'));this[_0x791e('0xe')]=_0x2154bf[_0x791e('0xe')];this[_0x791e('0xf')]={};this[_0x791e('0x10')]=new EmailSmtp();}EmailChannel[_0x791e('0x11')]['emit']=function(_0x22d116){var _0x5889d7=this[_0x791e('0xe')][_0x22d116];var _0x18e389={'id':_0x5889d7['id'],'name':_0x5889d7[_0x791e('0x12')],'key':_0x5889d7['key'],'active':_0x5889d7[_0x791e('0x13')],'Imap':{'status':_0x5889d7[_0x791e('0x14')][_0x791e('0x15')],'messageStatus':_0x5889d7['Imap'][_0x791e('0x16')],'total':_0x5889d7['Imap'][_0x791e('0x17')]}};if(_[_0x791e('0x18')](md5Accounts[_0x22d116])){md5Accounts[_0x22d116]={};}var _0x2f170f=md5(JSON['stringify'](_0x18e389));if(md5Accounts[_0x22d116][_0x791e('0x3')]!==_0x2f170f){md5Accounts[_0x22d116][_0x791e('0x3')]=_0x2f170f;io[_0x791e('0x19')](_0x791e('0x1a'),_0x18e389);}};EmailChannel['prototype'][_0x791e('0x1b')]=function(_0x28db76){for(var _0x2443ca in _0x28db76){if(_0x28db76[_0x791e('0x1c')](_0x2443ca)){if(_0x28db76[_0x2443ca][_0x791e('0x14')]&&_0x28db76[_0x2443ca][_0x791e('0x13')]){var _0x4c9602=_0x28db76[_0x2443ca][_0x791e('0x14')];if(!_0x4c9602[_0x791e('0x1d')]&&_0x28db76[_0x2443ca][_0x791e('0x1e')]!==_0x791e('0x1f'))_0x4c9602[_0x791e('0x1d')]=_0x28db76[_0x2443ca][_0x791e('0x1e')];if(!this[_0x791e('0xf')][_0x791e('0x1c')](_0x4c9602['id'])){this[_0x791e('0xf')][_0x4c9602['id']]=new EmailImap(_0x4c9602,_0x28db76[_0x2443ca][_0x791e('0x6')]);this['imapAccounts'][_0x4c9602['id']]['on'](_0x791e('0x20'),this[_0x791e('0x21')]['bind'](this,_0x2443ca));this[_0x791e('0xf')][_0x4c9602['id']]['on'](_0x791e('0x6'),this[_0x791e('0x22')][_0x791e('0x23')](this,_0x2443ca));this[_0x791e('0xf')][_0x4c9602['id']]['on'](_0x791e('0x24'),this[_0x791e('0x25')][_0x791e('0x23')](this,_0x2443ca));this[_0x791e('0xf')][_0x4c9602['id']]['on']('error',this[_0x791e('0x26')][_0x791e('0x23')](this,_0x2443ca));}}else{if(_['isNil'](this['mailAccounts'][_0x2443ca][_0x791e('0x14')])){this[_0x791e('0xe')][_0x2443ca]['Imap']={};}this[_0x791e('0xe')][_0x2443ca]['Imap']['status']=_0x791e('0x27');this[_0x791e('0xe')][_0x2443ca]['Imap'][_0x791e('0x16')]='';this[_0x791e('0x19')](_0x2443ca);}}}};EmailChannel[_0x791e('0x11')][_0x791e('0x21')]=function(_0x38acc2,_0x5a87ea){if(this[_0x791e('0xe')][_0x38acc2]){this[_0x791e('0xe')][_0x38acc2][_0x791e('0x14')][_0x791e('0x15')]=_0x791e('0x28');this['mailAccounts'][_0x38acc2]['Imap'][_0x791e('0x16')]=_0x5a87ea[_0x791e('0x12')];if(_0x5a87ea[_0x791e('0x29')]){this[_0x791e('0xe')][_0x38acc2]['Imap'][_0x791e('0x17')]=_0x5a87ea[_0x791e('0x29')]['total'];}return this[_0x791e('0x19')](_0x38acc2);}};EmailChannel['prototype'][_0x791e('0x22')]=function(_0x500f6c,_0x5afaed){logger[_0x791e('0xc')](_0x791e('0x2a'),_0x5afaed['firstName'],_0x5afaed[_0x791e('0x2b')],_0x5afaed['from'],_0x500f6c);if(this[_0x791e('0xe')][_0x500f6c]){return mailAccount[_0x791e('0x2c')](_0x500f6c,_0x5afaed)[_0x791e('0x2d')](function(_0x2c8c59){if(_0x2c8c59){logger['info'](_0x791e('0x2e'));}})['catch'](function(_0x8b42bc){logger[_0x791e('0x2f')](_0x791e('0x30'),JSON[_0x791e('0x31')](_0x8b42bc));});}};EmailChannel[_0x791e('0x11')][_0x791e('0x25')]=function(_0x360be4){if(this['mailAccounts'][_0x360be4]&&this[_0x791e('0xe')][_0x360be4][_0x791e('0x14')]){if(this['imapAccounts'][this['mailAccounts'][_0x360be4][_0x791e('0x14')]['id']]){delete this[_0x791e('0xf')][this[_0x791e('0xe')][_0x360be4][_0x791e('0x14')]['id']];}this[_0x791e('0xe')][_0x360be4]['Imap'][_0x791e('0x32')]=moment();this[_0x791e('0x19')](_0x360be4);}};EmailChannel[_0x791e('0x11')][_0x791e('0x26')]=function(_0x1ba2fd,_0x242501){if(this['mailAccounts'][_0x1ba2fd]){this[_0x791e('0xe')][_0x1ba2fd][_0x791e('0x14')][_0x791e('0x15')]=_0x791e('0x2f');this[_0x791e('0xe')][_0x1ba2fd]['Imap'][_0x791e('0x16')]=_0x242501;return this[_0x791e('0x19')](_0x1ba2fd);}};EmailChannel[_0x791e('0x11')][_0x791e('0x33')]=function(_0x1878a1,_0x49de8a){return this[_0x791e('0x10')]['send'](_0x1878a1,_0x49de8a);};EmailChannel[_0x791e('0x11')]['verifySmtp']=function(_0x37535c){var _0x43e442=this;if(this['mailAccounts'][_0x37535c['id']]){if(_['isNil'](this[_0x791e('0xe')][_0x37535c['id']][_0x791e('0x34')])){this[_0x791e('0xe')][_0x37535c['id']][_0x791e('0x34')]={};}this['mailAccounts'][_0x37535c['id']]['Smtp'][_0x791e('0x32')]=moment();return new BPromise(function(_0x19f6e5,_0x1cdbd6){return _0x43e442['smtp']['verify'](_0x37535c)['then'](function(_0x2dea58){_0x43e442[_0x791e('0xe')][_0x37535c['id']][_0x791e('0x34')][_0x791e('0x15')]=_0x791e('0x35');_0x43e442[_0x791e('0xe')][_0x37535c['id']][_0x791e('0x34')][_0x791e('0x16')]='';_0x43e442[_0x791e('0x19')](_0x37535c['id']);_0x19f6e5(_0x2dea58);})[_0x791e('0x36')](function(_0xab39d0){_0x43e442[_0x791e('0xe')][_0x37535c['id']][_0x791e('0x34')][_0x791e('0x15')]=_0x791e('0x2f');_0x43e442[_0x791e('0xe')][_0x37535c['id']][_0x791e('0x34')]['messageStatus']=_0xab39d0;_0x43e442[_0x791e('0x19')](_0x37535c['id']);_0x1cdbd6(_0xab39d0);});});}return this['smtp'][_0x791e('0x37')](_0x37535c);};module[_0x791e('0x38')]=EmailChannel; \ No newline at end of file +var _0x62e0=['moment','bluebird','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','info','mailAccounts','imapAccounts','prototype','name','key','active','Imap','status','isNil','md5','mailAccount:update','refresh','service','provider','box','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','handleImapBox','connected','messageStatus','messages','total','emit','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','smtp','send','Smtp','lastSync','verify','verified','exports','lodash'];(function(_0x9346c4,_0x36ac86){var _0x2922d4=function(_0x3659ca){while(--_0x3659ca){_0x9346c4['push'](_0x9346c4['shift']());}};_0x2922d4(++_0x36ac86);}(_0x62e0,0x6b));var _0x062e=function(_0x1e3ea1,_0x2a0e3a){_0x1e3ea1=_0x1e3ea1-0x0;var _0x51583a=_0x62e0[_0x1e3ea1];return _0x51583a;};'use strict';var _=require(_0x062e('0x0'));var moment=require(_0x062e('0x1'));var BPromise=require(_0x062e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x062e('0x3'));var logger=require(_0x062e('0x4'))(_0x062e('0x5'));config[_0x062e('0x6')]=_[_0x062e('0x7')](config[_0x062e('0x6')],{'host':_0x062e('0x8'),'port':0x18eb});var io=require(_0x062e('0x9'))(new Redis(config[_0x062e('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x062e('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x7be79e){logger[_0x062e('0xb')]('start\x20email\x20channel');this[_0x062e('0xc')]=_0x7be79e[_0x062e('0xc')];this[_0x062e('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x062e('0xe')]['emit']=function(_0xe01400){var _0x1e24d7=this['mailAccounts'][_0xe01400];var _0x46b141={'id':_0x1e24d7['id'],'name':_0x1e24d7[_0x062e('0xf')],'key':_0x1e24d7[_0x062e('0x10')],'active':_0x1e24d7[_0x062e('0x11')],'Imap':{'status':_0x1e24d7[_0x062e('0x12')][_0x062e('0x13')],'messageStatus':_0x1e24d7[_0x062e('0x12')]['messageStatus'],'total':_0x1e24d7['Imap']['total']}};if(_[_0x062e('0x14')](md5Accounts[_0xe01400])){md5Accounts[_0xe01400]={};}var _0x4af2d6=md5(JSON['stringify'](_0x46b141));if(md5Accounts[_0xe01400]['md5']!==_0x4af2d6){md5Accounts[_0xe01400][_0x062e('0x15')]=_0x4af2d6;io['emit'](_0x062e('0x16'),_0x46b141);}};EmailChannel[_0x062e('0xe')][_0x062e('0x17')]=function(_0x6cbb29){for(var _0x54f00c in _0x6cbb29){if(_0x6cbb29['hasOwnProperty'](_0x54f00c)){if(_0x6cbb29[_0x54f00c]['Imap']&&_0x6cbb29[_0x54f00c]['active']){var _0x5f1c61=_0x6cbb29[_0x54f00c]['Imap'];if(!_0x5f1c61[_0x062e('0x18')]&&_0x6cbb29[_0x54f00c][_0x062e('0x19')]!=='custom')_0x5f1c61['service']=_0x6cbb29[_0x54f00c][_0x062e('0x19')];if(!this[_0x062e('0xd')]['hasOwnProperty'](_0x5f1c61['id'])){this[_0x062e('0xd')][_0x5f1c61['id']]=new EmailImap(_0x5f1c61,_0x6cbb29[_0x54f00c][_0x062e('0x5')]);this[_0x062e('0xd')][_0x5f1c61['id']]['on'](_0x062e('0x1a'),this['handleImapBox'][_0x062e('0x1b')](this,_0x54f00c));this['imapAccounts'][_0x5f1c61['id']]['on'](_0x062e('0x5'),this[_0x062e('0x1c')][_0x062e('0x1b')](this,_0x54f00c));this[_0x062e('0xd')][_0x5f1c61['id']]['on']('end',this[_0x062e('0x1d')][_0x062e('0x1b')](this,_0x54f00c));this[_0x062e('0xd')][_0x5f1c61['id']]['on']('error',this[_0x062e('0x1e')][_0x062e('0x1b')](this,_0x54f00c));}}else{if(_['isNil'](this['mailAccounts'][_0x54f00c]['Imap'])){this[_0x062e('0xc')][_0x54f00c][_0x062e('0x12')]={};}this[_0x062e('0xc')][_0x54f00c][_0x062e('0x12')]['status']=_0x062e('0x1f');this['mailAccounts'][_0x54f00c][_0x062e('0x12')]['messageStatus']='';this['emit'](_0x54f00c);}}}};EmailChannel[_0x062e('0xe')][_0x062e('0x20')]=function(_0x107562,_0x52e131){if(this[_0x062e('0xc')][_0x107562]){this[_0x062e('0xc')][_0x107562][_0x062e('0x12')][_0x062e('0x13')]=_0x062e('0x21');this['mailAccounts'][_0x107562][_0x062e('0x12')][_0x062e('0x22')]=_0x52e131[_0x062e('0xf')];if(_0x52e131[_0x062e('0x23')]){this['mailAccounts'][_0x107562][_0x062e('0x12')][_0x062e('0x24')]=_0x52e131[_0x062e('0x23')]['total'];}return this[_0x062e('0x25')](_0x107562);}};EmailChannel[_0x062e('0xe')][_0x062e('0x1c')]=function(_0x2734d7,_0x11c4bc){logger[_0x062e('0xb')](_0x062e('0x26'),_0x11c4bc['firstName'],_0x11c4bc[_0x062e('0x27')],_0x11c4bc[_0x062e('0x28')],_0x2734d7);if(this[_0x062e('0xc')][_0x2734d7]){return mailAccount[_0x062e('0x29')](_0x2734d7,_0x11c4bc)[_0x062e('0x2a')](function(_0x15bc08){if(_0x15bc08){logger[_0x062e('0xb')](_0x062e('0x2b'));}})[_0x062e('0x2c')](function(_0x2d9b2a){logger[_0x062e('0x2d')](_0x062e('0x2e'),JSON['stringify'](_0x2d9b2a));});}};EmailChannel[_0x062e('0xe')]['handleImapEnd']=function(_0x46b9bb){if(this[_0x062e('0xc')][_0x46b9bb]&&this['mailAccounts'][_0x46b9bb][_0x062e('0x12')]){if(this['imapAccounts'][this[_0x062e('0xc')][_0x46b9bb][_0x062e('0x12')]['id']]){delete this[_0x062e('0xd')][this[_0x062e('0xc')][_0x46b9bb]['Imap']['id']];}this[_0x062e('0xc')][_0x46b9bb]['Imap']['lastSync']=moment();this[_0x062e('0x25')](_0x46b9bb);}};EmailChannel['prototype']['handleImapError']=function(_0x292796,_0x28b336){if(this[_0x062e('0xc')][_0x292796]){this[_0x062e('0xc')][_0x292796][_0x062e('0x12')]['status']=_0x062e('0x2d');this['mailAccounts'][_0x292796]['Imap']['messageStatus']=_0x28b336;return this[_0x062e('0x25')](_0x292796);}};EmailChannel['prototype']['sendMail']=function(_0xe59fd8,_0x2a8d9b){return this[_0x062e('0x2f')][_0x062e('0x30')](_0xe59fd8,_0x2a8d9b);};EmailChannel[_0x062e('0xe')]['verifySmtp']=function(_0x4ad769){var _0x467470=this;if(this[_0x062e('0xc')][_0x4ad769['id']]){if(_[_0x062e('0x14')](this[_0x062e('0xc')][_0x4ad769['id']][_0x062e('0x31')])){this[_0x062e('0xc')][_0x4ad769['id']]['Smtp']={};}this[_0x062e('0xc')][_0x4ad769['id']][_0x062e('0x31')][_0x062e('0x32')]=moment();return new BPromise(function(_0x20b402,_0x308023){return _0x467470[_0x062e('0x2f')][_0x062e('0x33')](_0x4ad769)[_0x062e('0x2a')](function(_0x3381cd){_0x467470[_0x062e('0xc')][_0x4ad769['id']]['Smtp'][_0x062e('0x13')]=_0x062e('0x34');_0x467470['mailAccounts'][_0x4ad769['id']]['Smtp'][_0x062e('0x22')]='';_0x467470[_0x062e('0x25')](_0x4ad769['id']);_0x20b402(_0x3381cd);})[_0x062e('0x2c')](function(_0x7f443a){_0x467470['mailAccounts'][_0x4ad769['id']][_0x062e('0x31')][_0x062e('0x13')]=_0x062e('0x2d');_0x467470[_0x062e('0xc')][_0x4ad769['id']][_0x062e('0x31')][_0x062e('0x22')]=_0x7f443a;_0x467470['emit'](_0x4ad769['id']);_0x308023(_0x7f443a);});});}return this[_0x062e('0x2f')][_0x062e('0x33')](_0x4ad769);};module[_0x062e('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 5fd9797..f9903ef 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 _0xbdb7=['handleError','connect','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','account','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','getAccount','once','ready','handleReady','bind','end','handleEnd'];(function(_0x44ea17,_0x422059){var _0x1d8af1=function(_0x159a75){while(--_0x159a75){_0x44ea17['push'](_0x44ea17['shift']());}};_0x1d8af1(++_0x422059);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x20dda3,_0xfcb775){_0x20dda3=_0x20dda3-0x0;var _0x547b71=_0xbdb7[_0x20dda3];return _0x547b71;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var Imap=require(_0x7bdb('0x2'));var simpleParser=require(_0x7bdb('0x3'))[_0x7bdb('0x4')];var Iconv=require(_0x7bdb('0x5'))[_0x7bdb('0x6')];var EventEmitter=require(_0x7bdb('0x7'))[_0x7bdb('0x8')];var utils=require('./utils');var logger=require(_0x7bdb('0x9'))('email');function EmailImap(_0x4b5fff,_0xffdc86){this[_0x7bdb('0xa')]=_0x4b5fff['mailbox'];this['account']=this[_0x7bdb('0xb')](_0x4b5fff,_0xffdc86);this[_0x7bdb('0x2')]=new Imap(this['account']);this['imap'][_0x7bdb('0xc')](_0x7bdb('0xd'),this[_0x7bdb('0xe')][_0x7bdb('0xf')](this));this[_0x7bdb('0x2')][_0x7bdb('0xc')](_0x7bdb('0x10'),this[_0x7bdb('0x11')]['bind'](this));this['imap']['on']('error',this[_0x7bdb('0x12')][_0x7bdb('0xf')](this));this['imap'][_0x7bdb('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x7bdb('0xb')]=function(_0x46dd4a,_0x4fd91a){var _0x50eeca={'connTimeout':_0x46dd4a['connTimeout']?_0x46dd4a[_0x7bdb('0x14')]*0x3e8:0x2710,'authTimeout':_0x46dd4a[_0x7bdb('0x15')]?_0x46dd4a[_0x7bdb('0x15')]*0x3e8:0x1388};if(_0x46dd4a[_0x7bdb('0x16')]){_0x50eeca[_0x7bdb('0x17')]=_0x46dd4a[_0x7bdb('0x17')];if(_0x46dd4a[_0x7bdb('0x18')]){_0x50eeca[_0x7bdb('0x19')]=utils['generateXOAuth2Token'](_0x46dd4a[_0x7bdb('0x1a')][_0x7bdb('0x1b')],_0x46dd4a[_0x7bdb('0x17')]);}else{_0x50eeca[_0x7bdb('0x1c')]=_0x46dd4a['password'];}}else{if(_0x46dd4a[_0x7bdb('0x1d')]){_0x50eeca[_0x7bdb('0x17')]=_0x46dd4a['user'];_0x50eeca[_0x7bdb('0x1c')]=_0x46dd4a[_0x7bdb('0x1c')];}}_0x50eeca[_0x7bdb('0x1e')]=_0x4fd91a||_0x46dd4a[_0x7bdb('0x17')]||_0x7bdb('0x1f');_0x50eeca['host']=_0x46dd4a['host'];_0x50eeca[_0x7bdb('0x20')]=_0x46dd4a[_0x7bdb('0x20')]||0x3e1;if(_0x46dd4a['tls']){_0x50eeca[_0x7bdb('0x21')]=!![];}else{_0x50eeca[_0x7bdb('0x21')]=![];_0x50eeca[_0x7bdb('0x22')]=_0x7bdb('0x23');}return _0x50eeca;};EmailImap[_0x7bdb('0x24')]['handleReady']=function(){this[_0x7bdb('0x2')][_0x7bdb('0x25')](this[_0x7bdb('0xa')],![],this[_0x7bdb('0x26')]['bind'](this));};EmailImap['prototype'][_0x7bdb('0x26')]=function(_0x5eface,_0x47abaf){if(_0x5eface){this['handleError'](_0x5eface,!![]);}else{this[_0x7bdb('0x27')]('box',_0x47abaf);this[_0x7bdb('0x28')]();}};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x29')]=function(_0x7c09cf){if(_0x7c09cf){this[_0x7bdb('0x12')](_0x7c09cf,!![]);}else{this['imap'][_0x7bdb('0x10')]();}};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x28')]=function(){this[_0x7bdb('0x2')][_0x7bdb('0x2a')]([_0x7bdb('0x2b')],this[_0x7bdb('0x2c')][_0x7bdb('0xf')](this));};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x2c')]=function(_0x9ec48d,_0x81ca6f){if(_0x9ec48d){this['handleError'](_0x9ec48d,!![]);}else{if(_0x81ca6f[_0x7bdb('0x2d')]){try{var _0x23fc3a=this[_0x7bdb('0x2')][_0x7bdb('0x2e')](_0x81ca6f,{'bodies':'','markSeen':!![]});_0x23fc3a['on'](_0x7bdb('0x2f'),this['handleFetchMessage'][_0x7bdb('0xf')](this));_0x23fc3a[_0x7bdb('0xc')](_0x7bdb('0x30'),this[_0x7bdb('0x31')]['bind'](this));_0x23fc3a['once']('end',this[_0x7bdb('0x32')]['bind'](this));}catch(_0x2058e1){logger['error'](_0x2058e1);}}else{this[_0x7bdb('0x2')][_0x7bdb('0x33')](!![],this[_0x7bdb('0x29')]['bind'](this));}}};EmailImap[_0x7bdb('0x24')]['handleFetchMessage']=function(_0x532206){_0x532206['on'](_0x7bdb('0x34'),this['handleMessageBody'][_0x7bdb('0xf')](this));_0x532206['once']('attributes',this[_0x7bdb('0x35')][_0x7bdb('0xf')](this));_0x532206[_0x7bdb('0xc')](_0x7bdb('0x10'),this[_0x7bdb('0x36')][_0x7bdb('0xf')](this));};EmailImap['prototype'][_0x7bdb('0x37')]=function(_0x464fde){simpleParser(_0x464fde,{'Iconv':Iconv},this[_0x7bdb('0x38')][_0x7bdb('0xf')](this));};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x35')]=function(){};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x36')]=function(){};EmailImap[_0x7bdb('0x24')]['handleSimpleParser']=function(_0x5024e1,_0x19c237){if(_0x5024e1){logger[_0x7bdb('0x30')](_0x5024e1);}else{var _0x2de3c1=this;utils[_0x7bdb('0x39')](this[_0x7bdb('0x3a')],_0x19c237,function(_0x509e90){_0x2de3c1['emit'](_0x7bdb('0x1e'),_0x509e90);});}};EmailImap['prototype'][_0x7bdb('0x32')]=function(){this['imap'][_0x7bdb('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x31')]=function(_0x192a2b){this[_0x7bdb('0x12')](_0x192a2b);this[_0x7bdb('0x2')][_0x7bdb('0x33')](!![],this[_0x7bdb('0x29')]['bind'](this));};EmailImap['prototype'][_0x7bdb('0x11')]=function(){this[_0x7bdb('0x27')](_0x7bdb('0x10'));};EmailImap[_0x7bdb('0x24')][_0x7bdb('0x12')]=function(_0x1824c6,_0x3f7b3b){logger['error']('handleError',this[_0x7bdb('0x3a')][_0x7bdb('0x1e')],JSON[_0x7bdb('0x3b')](_0x1824c6));var _0x72a81c='';if(_0x1824c6){if(_0x1824c6['textCode']){_0x72a81c=_0x1824c6[_0x7bdb('0x3c')];}else{for(var _0x5951cd in _0x1824c6){if(_0x1824c6[_0x7bdb('0x3d')](_0x5951cd)){_0x72a81c+=_[_0x7bdb('0x3e')](_0x5951cd)+':\x20'+_0x1824c6[_0x5951cd]+'\x0a';}}}}if(_0x3f7b3b){this[_0x7bdb('0x2')][_0x7bdb('0x10')]();}else{this[_0x7bdb('0x27')](_0x7bdb('0x30'),_0x72a81c);this[_0x7bdb('0x27')](_0x7bdb('0x10'));}};module[_0x7bdb('0x3f')]=EmailImap; \ No newline at end of file +var _0x5d15=['hasOwnProperty','upperFirst','exports','lodash','util','mailparser','iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','error','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleEnd','stringify','textCode'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5d15,0x7b));var _0x55d1=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0x5d15[_0x22bee0];return _0x2d295b;};'use strict';var _=require(_0x55d1('0x0'));var util=require(_0x55d1('0x1'));var Imap=require('imap');var simpleParser=require(_0x55d1('0x2'))['simpleParser'];var Iconv=require(_0x55d1('0x3'))['Iconv'];var EventEmitter=require(_0x55d1('0x4'))['EventEmitter'];var utils=require(_0x55d1('0x5'));var logger=require(_0x55d1('0x6'))(_0x55d1('0x7'));function EmailImap(_0x167cd9,_0x471c00){this[_0x55d1('0x8')]=_0x167cd9['mailbox'];this[_0x55d1('0x9')]=this[_0x55d1('0xa')](_0x167cd9,_0x471c00);this[_0x55d1('0xb')]=new Imap(this[_0x55d1('0x9')]);this[_0x55d1('0xb')][_0x55d1('0xc')](_0x55d1('0xd'),this[_0x55d1('0xe')][_0x55d1('0xf')](this));this['imap'][_0x55d1('0xc')](_0x55d1('0x10'),this['handleEnd']['bind'](this));this[_0x55d1('0xb')]['on'](_0x55d1('0x11'),this['handleError'][_0x55d1('0xf')](this));this[_0x55d1('0xb')]['connect']();}util[_0x55d1('0x12')](EmailImap,EventEmitter);EmailImap[_0x55d1('0x13')][_0x55d1('0xa')]=function(_0x470ed4,_0x121018){var _0xf31cfb={'connTimeout':_0x470ed4[_0x55d1('0x14')]?_0x470ed4[_0x55d1('0x14')]*0x3e8:0x2710,'authTimeout':_0x470ed4[_0x55d1('0x15')]?_0x470ed4[_0x55d1('0x15')]*0x3e8:0x1388};if(_0x470ed4['service']){_0xf31cfb[_0x55d1('0x16')]=_0x470ed4['user'];if(_0x470ed4[_0x55d1('0x17')]){_0xf31cfb['xoauth2']=utils[_0x55d1('0x18')](_0x470ed4[_0x55d1('0x19')]['data5'],_0x470ed4[_0x55d1('0x16')]);}else{_0xf31cfb[_0x55d1('0x1a')]=_0x470ed4[_0x55d1('0x1a')];}}else{if(_0x470ed4[_0x55d1('0x1b')]){_0xf31cfb[_0x55d1('0x16')]=_0x470ed4[_0x55d1('0x16')];_0xf31cfb[_0x55d1('0x1a')]=_0x470ed4['password'];}}_0xf31cfb['email']=_0x121018||_0x470ed4['user']||_0x55d1('0x1c');_0xf31cfb[_0x55d1('0x1d')]=_0x470ed4['host'];_0xf31cfb[_0x55d1('0x1e')]=_0x470ed4['port']||0x3e1;if(_0x470ed4[_0x55d1('0x1f')]){_0xf31cfb['tls']=!![];}else{_0xf31cfb[_0x55d1('0x1f')]=![];_0xf31cfb[_0x55d1('0x20')]='required';}return _0xf31cfb;};EmailImap[_0x55d1('0x13')][_0x55d1('0xe')]=function(){this[_0x55d1('0xb')][_0x55d1('0x21')](this[_0x55d1('0x8')],![],this[_0x55d1('0x22')][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x22')]=function(_0x4f24b1,_0x35d268){if(_0x4f24b1){this[_0x55d1('0x23')](_0x4f24b1,!![]);}else{this[_0x55d1('0x24')](_0x55d1('0x25'),_0x35d268);this[_0x55d1('0x26')]();}};EmailImap[_0x55d1('0x13')][_0x55d1('0x27')]=function(_0x772f32){if(_0x772f32){this[_0x55d1('0x23')](_0x772f32,!![]);}else{this[_0x55d1('0xb')][_0x55d1('0x10')]();}};EmailImap[_0x55d1('0x13')][_0x55d1('0x26')]=function(){this[_0x55d1('0xb')][_0x55d1('0x28')]([_0x55d1('0x29')],this['handleReadUnseen'][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x2a')]=function(_0x224961,_0x2c0e52){if(_0x224961){this[_0x55d1('0x23')](_0x224961,!![]);}else{if(_0x2c0e52['length']){try{var _0x118029=this[_0x55d1('0xb')][_0x55d1('0x2b')](_0x2c0e52,{'bodies':'','markSeen':!![]});_0x118029['on'](_0x55d1('0x2c'),this[_0x55d1('0x2d')][_0x55d1('0xf')](this));_0x118029[_0x55d1('0xc')](_0x55d1('0x11'),this[_0x55d1('0x2e')][_0x55d1('0xf')](this));_0x118029[_0x55d1('0xc')](_0x55d1('0x10'),this[_0x55d1('0x2f')][_0x55d1('0xf')](this));}catch(_0x30de78){logger[_0x55d1('0x11')](_0x30de78);}}else{this[_0x55d1('0xb')][_0x55d1('0x30')](!![],this[_0x55d1('0x27')][_0x55d1('0xf')](this));}}};EmailImap[_0x55d1('0x13')][_0x55d1('0x2d')]=function(_0x4a1ecf){_0x4a1ecf['on'](_0x55d1('0x31'),this[_0x55d1('0x32')][_0x55d1('0xf')](this));_0x4a1ecf[_0x55d1('0xc')]('attributes',this[_0x55d1('0x33')]['bind'](this));_0x4a1ecf[_0x55d1('0xc')](_0x55d1('0x10'),this[_0x55d1('0x34')][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x32')]=function(_0x59813f){simpleParser(_0x59813f,{'Iconv':Iconv},this['handleSimpleParser'][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x33')]=function(){};EmailImap['prototype'][_0x55d1('0x34')]=function(){};EmailImap[_0x55d1('0x13')][_0x55d1('0x35')]=function(_0x349501,_0x2b5990){if(_0x349501){logger[_0x55d1('0x11')](_0x349501);}else{var _0x418c2e=this;utils['parser'](this['account'],_0x2b5990,function(_0x1321f1){_0x418c2e[_0x55d1('0x24')](_0x55d1('0x7'),_0x1321f1);});}};EmailImap['prototype'][_0x55d1('0x2f')]=function(){this[_0x55d1('0xb')][_0x55d1('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x2e')]=function(_0x4394af){this['handleError'](_0x4394af);this[_0x55d1('0xb')]['closeBox'](!![],this[_0x55d1('0x27')][_0x55d1('0xf')](this));};EmailImap[_0x55d1('0x13')][_0x55d1('0x36')]=function(){this[_0x55d1('0x24')](_0x55d1('0x10'));};EmailImap[_0x55d1('0x13')][_0x55d1('0x23')]=function(_0x2f7b46,_0x127916){logger[_0x55d1('0x11')]('handleError',this['account'][_0x55d1('0x7')],JSON[_0x55d1('0x37')](_0x2f7b46));var _0x3ace0a='';if(_0x2f7b46){if(_0x2f7b46[_0x55d1('0x38')]){_0x3ace0a=_0x2f7b46[_0x55d1('0x38')];}else{for(var _0x43dda0 in _0x2f7b46){if(_0x2f7b46[_0x55d1('0x39')](_0x43dda0)){_0x3ace0a+=_[_0x55d1('0x3a')](_0x43dda0)+':\x20'+_0x2f7b46[_0x43dda0]+'\x0a';}}}}if(_0x127916){this[_0x55d1('0xb')][_0x55d1('0x10')]();}else{this[_0x55d1('0x24')](_0x55d1('0x11'),_0x3ace0a);this[_0x55d1('0x24')](_0x55d1('0x10'));}};module[_0x55d1('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 9396b90..20d0db1 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 _0xa017=['nodemailer-plugin-inline-base64','prototype','sendMail','verify','createTransport','toString','nodemailer'];(function(_0x9c771b,_0xf5bd99){var _0x493a66=function(_0x1421f6){while(--_0x1421f6){_0x9c771b['push'](_0x9c771b['shift']());}};_0x493a66(++_0xf5bd99);}(_0xa017,0x109));var _0x7a01=function(_0x311aad,_0x54d658){_0x311aad=_0x311aad-0x0;var _0x1779bd=_0xa017[_0x311aad];return _0x1779bd;};'use strict';var nodemailer=require(_0x7a01('0x0'));var inlineBase64=require(_0x7a01('0x1'));function EmailSmtp(){}EmailSmtp[_0x7a01('0x2')]['send']=function(_0x3db1b7,_0x5169b7){return new Promise(function(_0x48350b,_0x3950fc){var _0x47731b=nodemailer['createTransport'](_0x3db1b7);_0x47731b['use']('compile',inlineBase64());_0x47731b[_0x7a01('0x3')](_0x5169b7,function(_0x424916,_0x5bf9d3){if(_0x424916){_0x3950fc(_0x424916['toString']());}else{_0x48350b(_0x5bf9d3);}});});};EmailSmtp[_0x7a01('0x2')][_0x7a01('0x4')]=function(_0x157225){return new Promise(function(_0x465edb,_0xa1696b){var _0x2cfd84=nodemailer[_0x7a01('0x5')](_0x157225);_0x2cfd84['verify'](function(_0x30d25b,_0x48fa91){if(_0x30d25b){_0xa1696b(_0x30d25b[_0x7a01('0x6')]());}else{if(_0x48fa91){_0x465edb(_0x48fa91);}else{_0xa1696b('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xf05e=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf05e,0x1bd));var _0xef05=function(_0x63904a,_0x273d0b){_0x63904a=_0x63904a-0x0;var _0x2e8639=_0xf05e[_0x63904a];return _0x2e8639;};'use strict';var nodemailer=require(_0xef05('0x0'));var inlineBase64=require(_0xef05('0x1'));function EmailSmtp(){}EmailSmtp[_0xef05('0x2')][_0xef05('0x3')]=function(_0x2b877d,_0x52658d){return new Promise(function(_0x3cea8a,_0x2e299c){var _0x23079e=nodemailer[_0xef05('0x4')](_0x2b877d);_0x23079e['use'](_0xef05('0x5'),inlineBase64());_0x23079e[_0xef05('0x6')](_0x52658d,function(_0x28e0a2,_0x32c301){if(_0x28e0a2){_0x2e299c(_0x28e0a2[_0xef05('0x7')]());}else{_0x3cea8a(_0x32c301);}});});};EmailSmtp['prototype'][_0xef05('0x8')]=function(_0x3ce9af){return new Promise(function(_0xac011a,_0x401394){var _0x2eb3dc=nodemailer[_0xef05('0x4')](_0x3ce9af);_0x2eb3dc['verify'](function(_0x40a21c,_0x3eba1c){if(_0x40a21c){_0x401394(_0x40a21c['toString']());}else{if(_0x3eba1c){_0xac011a(_0x3eba1c);}else{_0x401394(_0xef05('0x9'));}}});});};module[_0xef05('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c474e2b..745de4a 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 _0x23fd=['headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','

Empty\x20message

','Attachments','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous','generate','name','substring','indexOf','split','length','slice','join','head','pop','isEmpty','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x11459c[_0xd23f('0x11')](0x0,-0x1)[_0xd23f('0x12')]('\x20'):_0x25b417[_0xd23f('0xc')];}return'Anonymous';}function getLastName(_0x1620a7){var _0x47e56c=_[_0xd23f('0x13')](_0x1620a7[_0xd23f('0x8')]);if(_0x47e56c&&_0x47e56c['name']){var _0x34183b=_0x47e56c['name'][_0xd23f('0xf')](/\s+/);return _0x34183b[_0xd23f('0x10')]>0x1?_0x34183b[_0xd23f('0x14')]():'';}return'';}function getMails(_0x4cba73,_0x257a28){var _0x2ad969='';for(var _0x2c829f=0x0;_0x2c829f<_0x257a28['value'][_0xd23f('0x10')];_0x2c829f+=0x1){if(_0x257a28[_0xd23f('0x8')][_0x2c829f][_0xd23f('0x9')]!==_0x4cba73){if(!_[_0xd23f('0x15')](_0x2ad969)){_0x2ad969+=',';}_0x2ad969+=_0x257a28['value'][_0x2c829f][_0xd23f('0xc')]||_0x257a28['value'][_0x2c829f]['address']||'';_0x2ad969+='\x20<';_0x2ad969+=_0x257a28['value'][_0x2c829f][_0xd23f('0x9')]?_0x257a28['value'][_0x2c829f]['address']:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x2ad969+='>';}}return _0x2ad969;}function parseEmail(_0x5da422,_0x14a077,_0x52e832){if(_0x14a077['html']){var _0x6b9105=/)<[^<]*)*<\/script>/gi;while(_0x6b9105[_0xd23f('0x16')](_0x14a077[_0xd23f('0x17')])){_0x14a077[_0xd23f('0x17')]=_0x14a077['html'][_0xd23f('0x18')](_0x6b9105,'');}if(_0x14a077[_0xd23f('0x17')][_0xd23f('0x19')](_0xd23f('0x1a'))){var _0x2f9b49=[];_0x14a077[_0xd23f('0x1b')][_0xd23f('0x1c')](_0x305079=>{_0x2f9b49['push'](_0x305079[_0xd23f('0x1d')]);});var _0x54ad7c=/]+>/g;var _0x1c365b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x580119=_0x14a077[_0xd23f('0x17')][_0xd23f('0x18')](_0x1c365b,_0xd23f('0x1e'));var _0x3f344a=_0x580119[_0xd23f('0x18')](_0x54ad7c,_0xd23f('0x1f'));for(let _0x23dad2=0x0;_0x23dad2<_0x2f9b49[_0xd23f('0x10')];_0x23dad2++){var _0x402fd8=_0x3f344a[_0xd23f('0x18')](_0xd23f('0x1f'),_0xd23f('0x20')+_0x2f9b49[_0x23dad2]+_0xd23f('0x21'));_0x3f344a=_0x402fd8;}_0x14a077[_0xd23f('0x17')]=_0x3f344a;}_0x52e832[_0xd23f('0x22')]=_0x14a077[_0xd23f('0x17')];}else{_0x52e832['body']=_0x14a077[_0xd23f('0x23')];}if(_0x52e832['body']){_0x52e832[_0xd23f('0x22')]=_0x52e832['body']['replace'](/0x0){var _0x53f52b=[_0xd23f('0x33'),'X-Auto-Response-Suppress:\x20All',_0xd23f('0x34')];for(var _0x3d7204=0x0;_0x3d7204<_0x14a077['headerLines'][_0xd23f('0x10')];_0x3d7204++){var _0xf57e05=_[_0xd23f('0xe')](_0x53f52b,_0x14a077[_0xd23f('0x32')][_0x3d7204][_0xd23f('0x35')]);if(_0xf57e05>=0x0){_0x52e832[_0xd23f('0x36')]=!![];}}}return _0x52e832;}exports[_0xd23f('0x37')]=function(_0x5f857a,_0x473445,_0x3f770c){var _0x1e78c6={'from':getAddress(_0x473445[_0xd23f('0x38')]),'firstName':getFirstName(_0x473445['from']),'lastName':getLastName(_0x473445['from']),'mapKey':_0xd23f('0x6'),'message':{'from':getMails(_0x5f857a[_0xd23f('0x6')],_0x473445['from']),'to':_0x5f857a[_0xd23f('0x6')],'cc':'','subject':_0x473445['subject']||'','messageId':_0x473445['messageId'],'inReplyTo':_0x473445['inReplyTo'],'sentAt':moment(_0x473445['date'])[_0xd23f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x473445[_0xd23f('0x17')]&&!_0x473445['textAsHtml']){var _0x5cac10=_['filter'](_0x473445[_0xd23f('0x1b')],{'contentType':_0xd23f('0x39')});if(_0x5cac10[_0xd23f('0x10')]){logger[_0xd23f('0x3a')](util['format'](_0xd23f('0x3b'),_0x473445['messageId']));tnef[_0xd23f('0x3c')](_['first'](_0x5cac10)['content'],function(_0x3be29e,_0x589ad4){if(_0x589ad4){_0x473445['html']=_0x589ad4['BodyHTML']||_0xd23f('0x3d');if(_0x589ad4[_0xd23f('0x3e')]){for(var _0x3c0ce9=0x0;_0x3c0ce9<_0x589ad4[_0xd23f('0x3e')][_0xd23f('0x10')];_0x3c0ce9++){var _0x30ba58=_0x589ad4[_0xd23f('0x3e')][_0x3c0ce9];_0x1e78c6[_0xd23f('0x25')][_0xd23f('0x1b')][_0xd23f('0x30')]({'filename':_0x30ba58['Title'],'content':Buffer[_0xd23f('0x38')](_0x30ba58['Data'])});}}}_0x3f770c(parseEmail(_0x5f857a,_0x473445,_0x1e78c6));});}else{_0x473445[_0xd23f('0x17')]=_0xd23f('0x3d');_0x3f770c(parseEmail(_0x5f857a,_0x473445,_0x1e78c6));}}else{_0x3f770c(parseEmail(_0x5f857a,_0x473445,_0x1e78c6));}};exports[_0xd23f('0x3f')]=function(_0x2586c7,_0x162549){var _0x381c24=[_0xd23f('0x40')+(_0x162549||''),_0xd23f('0x41')+_0x2586c7,'',''];return Buffer[_0xd23f('0x38')](_0x381c24['join'](''),_0xd23f('0x42'))[_0xd23f('0x43')]('base64');}; \ No newline at end of file +var _0xfd6f=['%s-%s','now','root','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','line','isAutoreply','parser','from','messageId','inReplyTo','filter','application/ms-tnef','info','parseBuffer','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','html','test','replace','includes','forEach','push','_SRC','_IMG','\x20]','body','message','originTo','originCc','isEmpty','bcc','attachments','attach','type','attachment','filename','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd6f,0x133));var _0xffd6=function(_0xfde6df,_0x3b3105){_0xfde6df=_0xfde6df-0x0;var _0x225bb2=_0xfd6f[_0xfde6df];return _0x225bb2;};'use strict';var _=require(_0xffd6('0x0'));var moment=require(_0xffd6('0x1'));var random=require(_0xffd6('0x2'));var fs=require('fs');var path=require(_0xffd6('0x3'));var util=require(_0xffd6('0x4'));var tnef=require('node-tnef');var logger=require(_0xffd6('0x5'))(_0xffd6('0x6'));var config=require(_0xffd6('0x7'));function getAddress(_0x4d9706){var _0x4abbbd=_[_0xffd6('0x8')](_0x4d9706[_0xffd6('0x9')]);return _0x4abbbd&&_0x4abbbd[_0xffd6('0xa')]?_0x4abbbd['address']:_0xffd6('0xb')+random[_0xffd6('0xc')](0x6)+_0xffd6('0xd');}function getFirstName(_0x5b5c56){var _0x10819f=_[_0xffd6('0x8')](_0x5b5c56[_0xffd6('0x9')]);if(_0x10819f&&_0x10819f[_0xffd6('0xe')]){if(_0x10819f[_0xffd6('0xe')]==_0x10819f[_0xffd6('0xa')]){return _0x10819f[_0xffd6('0xe')][_0xffd6('0xf')](0x0,_0x10819f[_0xffd6('0xe')][_0xffd6('0x10')]('@'));}var _0x20dc05=_0x10819f['name'][_0xffd6('0x11')](/\s+/);return _0x20dc05[_0xffd6('0x12')]>0x1?_0x20dc05[_0xffd6('0x13')](0x0,-0x1)[_0xffd6('0x14')]('\x20'):_0x10819f[_0xffd6('0xe')];}return'Anonymous';}function getLastName(_0x4a6bf5){var _0xc257ca=_[_0xffd6('0x8')](_0x4a6bf5[_0xffd6('0x9')]);if(_0xc257ca&&_0xc257ca[_0xffd6('0xe')]){var _0x42bd83=_0xc257ca[_0xffd6('0xe')][_0xffd6('0x11')](/\s+/);return _0x42bd83[_0xffd6('0x12')]>0x1?_0x42bd83[_0xffd6('0x15')]():'';}return'';}function getMails(_0x39d3f6,_0x10345a){var _0x4c9bf3='';for(var _0x125d71=0x0;_0x125d71<_0x10345a['value'][_0xffd6('0x12')];_0x125d71+=0x1){if(_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xa')]!==_0x39d3f6){if(!_['isEmpty'](_0x4c9bf3)){_0x4c9bf3+=',';}_0x4c9bf3+=_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xe')]||_0x10345a['value'][_0x125d71][_0xffd6('0xa')]||'';_0x4c9bf3+='\x20<';_0x4c9bf3+=_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xa')]?_0x10345a[_0xffd6('0x9')][_0x125d71][_0xffd6('0xa')]:_0xffd6('0xb')+random['generate'](0x6)+_0xffd6('0xd');_0x4c9bf3+='>';}}return _0x4c9bf3;}function parseEmail(_0x321697,_0x2e1fb7,_0x503a65){if(_0x2e1fb7[_0xffd6('0x16')]){var _0x1139c0=/)<[^<]*)*<\/script>/gi;while(_0x1139c0[_0xffd6('0x17')](_0x2e1fb7[_0xffd6('0x16')])){_0x2e1fb7[_0xffd6('0x16')]=_0x2e1fb7[_0xffd6('0x16')][_0xffd6('0x18')](_0x1139c0,'');}if(_0x2e1fb7[_0xffd6('0x16')][_0xffd6('0x19')]('{_0x549503[_0xffd6('0x1b')](_0x58f49c['filename']);});var _0x9c8f35=/]+>/g;var _0x42751d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x17360b=_0x2e1fb7[_0xffd6('0x16')]['replace'](_0x42751d,_0xffd6('0x1c'));var _0x3da0e5=_0x17360b['replace'](_0x9c8f35,_0xffd6('0x1d'));for(let _0x3da8d4=0x0;_0x3da8d4<_0x549503[_0xffd6('0x12')];_0x3da8d4++){var _0x69e60b=_0x3da0e5[_0xffd6('0x18')](_0xffd6('0x1d'),'\x20[Attachment:\x20'+_0x549503[_0x3da8d4]+_0xffd6('0x1e'));_0x3da0e5=_0x69e60b;}_0x2e1fb7['html']=_0x3da0e5;}_0x503a65[_0xffd6('0x1f')]=_0x2e1fb7[_0xffd6('0x16')];}else{_0x503a65[_0xffd6('0x1f')]=_0x2e1fb7['textAsHtml'];}if(_0x503a65[_0xffd6('0x1f')]){_0x503a65['body']=_0x503a65[_0xffd6('0x1f')]['replace'](/0x0){var _0xa63ee0=[_0xffd6('0x32'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x112a04=0x0;_0x112a04<_0x2e1fb7['headerLines']['length'];_0x112a04++){var _0x306a99=_[_0xffd6('0x10')](_0xa63ee0,_0x2e1fb7[_0xffd6('0x31')][_0x112a04][_0xffd6('0x33')]);if(_0x306a99>=0x0){_0x503a65[_0xffd6('0x34')]=!![];}}}return _0x503a65;}exports[_0xffd6('0x35')]=function(_0x342342,_0x2631c4,_0x1a5f55){var _0xf3098f={'from':getAddress(_0x2631c4['from']),'firstName':getFirstName(_0x2631c4[_0xffd6('0x36')]),'lastName':getLastName(_0x2631c4[_0xffd6('0x36')]),'mapKey':_0xffd6('0x6'),'message':{'from':getMails(_0x342342[_0xffd6('0x6')],_0x2631c4[_0xffd6('0x36')]),'to':_0x342342[_0xffd6('0x6')],'cc':'','subject':_0x2631c4['subject']||'','messageId':_0x2631c4[_0xffd6('0x37')],'inReplyTo':_0x2631c4[_0xffd6('0x38')],'sentAt':moment(_0x2631c4['date'])[_0xffd6('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2631c4[_0xffd6('0x16')]&&!_0x2631c4['textAsHtml']){var _0x405355=_[_0xffd6('0x39')](_0x2631c4[_0xffd6('0x25')],{'contentType':_0xffd6('0x3a')});if(_0x405355[_0xffd6('0x12')]){logger[_0xffd6('0x3b')](util[_0xffd6('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2631c4['messageId']));tnef[_0xffd6('0x3c')](_['first'](_0x405355)[_0xffd6('0x2f')],function(_0x35de79,_0x41224d){if(_0x41224d){_0x2631c4[_0xffd6('0x16')]=_0x41224d['BodyHTML']||_0xffd6('0x3d');if(_0x41224d[_0xffd6('0x3e')]){for(var _0x383eb0=0x0;_0x383eb0<_0x41224d[_0xffd6('0x3e')][_0xffd6('0x12')];_0x383eb0++){var _0x49e9c4=_0x41224d[_0xffd6('0x3e')][_0x383eb0];_0xf3098f['message'][_0xffd6('0x25')][_0xffd6('0x1b')]({'filename':_0x49e9c4[_0xffd6('0x3f')],'content':Buffer[_0xffd6('0x36')](_0x49e9c4[_0xffd6('0x40')])});}}}_0x1a5f55(parseEmail(_0x342342,_0x2631c4,_0xf3098f));});}else{_0x2631c4[_0xffd6('0x16')]=_0xffd6('0x3d');_0x1a5f55(parseEmail(_0x342342,_0x2631c4,_0xf3098f));}}else{_0x1a5f55(parseEmail(_0x342342,_0x2631c4,_0xf3098f));}};exports[_0xffd6('0x41')]=function(_0x4f33b1,_0x578cf9){var _0x3d3d5a=[_0xffd6('0x42')+(_0x578cf9||''),_0xffd6('0x43')+_0x4f33b1,'',''];return Buffer[_0xffd6('0x36')](_0x3d3d5a[_0xffd6('0x14')](''),_0xffd6('0x44'))['toString'](_0xffd6('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index cf9efc8..633dc5d 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 _0xfa34=['Smtp','lodash','key','SERV','active','Imap'];(function(_0x392ffa,_0x3d0057){var _0xc01b26=function(_0x5c74af){while(--_0x5c74af){_0x392ffa['push'](_0x392ffa['shift']());}};_0xc01b26(++_0x3d0057);}(_0xfa34,0xf7));var _0x4fa3=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0xfa34[_0x24cc72];return _0xd49f1e;};'use strict';var _=require(_0x4fa3('0x0'));function MailAccount(_0x2d466f){this['id']=_0x2d466f['id']||0x0;this['name']=_0x2d466f['name']||'Service';this[_0x4fa3('0x1')]=_0x2d466f[_0x4fa3('0x1')]||_0x4fa3('0x2');this[_0x4fa3('0x3')]=_0x2d466f['active']||![];this[_0x4fa3('0x4')]=_0x2d466f['Imap']||[];this[_0x4fa3('0x5')]=_0x2d466f[_0x4fa3('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xf6c0=['name','Service','key','active','Imap','Smtp','exports','lodash'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xf6c0,0x1bf));var _0x0f6c=function(_0xfa260b,_0xd2d0d){_0xfa260b=_0xfa260b-0x0;var _0x48fb84=_0xf6c0[_0xfa260b];return _0x48fb84;};'use strict';var _=require(_0x0f6c('0x0'));function MailAccount(_0x46881e){this['id']=_0x46881e['id']||0x0;this[_0x0f6c('0x1')]=_0x46881e['name']||_0x0f6c('0x2');this[_0x0f6c('0x3')]=_0x46881e[_0x0f6c('0x3')]||'SERV';this['active']=_0x46881e[_0x0f6c('0x4')]||![];this['Imap']=_0x46881e[_0x0f6c('0x5')]||[];this[_0x0f6c('0x6')]=_0x46881e['Smtp']||[];}module[_0x0f6c('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 a2de91d..1648111 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 _0x8614=['merge','lodash','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','isUndefined'];(function(_0x4350bb,_0x1fb328){var _0x469e1b=function(_0x2ba42b){while(--_0x2ba42b){_0x4350bb['push'](_0x4350bb['shift']());}};_0x469e1b(++_0x1fb328);}(_0x8614,0x12a));var _0x4861=function(_0x115b82,_0x37df4f){_0x115b82=_0x115b82-0x0;var _0x1f45bd=_0x8614[_0x115b82];return _0x1f45bd;};'use strict';var _=require(_0x4861('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x4861('0x1')]={};};function freeIsNotKey(_0xa45d1d,_0x575acc,_0x3cf335){var _0x4d49db=_[_0x4861('0x2')](_0xa45d1d,function(_0x26ff0d,_0x18a443){return _0x26ff0d[_0x3cf335];});for(var _0x27b1a8 in _0x575acc){if(_0x575acc[_0x4861('0x3')](_0x27b1a8)){if(!_0x4d49db[_0x27b1a8]){delete _0x575acc[_0x27b1a8];}}}}Realtime['prototype'][_0x4861('0x4')]=function(_0x508bc6,_0x483360){for(var _0x437b9d in _0x483360){if(_0x508bc6['hasOwnProperty'](_0x437b9d)){_0x508bc6[_0x437b9d]=_0x483360[_0x437b9d];}}};Realtime[_0x4861('0x5')]['initMailAccounts']=function(){var _0x40d653=this;return function(_0x256cb0){if(_0x256cb0){freeIsNotKey(_0x256cb0,_0x40d653[_0x4861('0x1')],'id');for(var _0x462b6a=0x0,_0x2aad12={},_0x322a29={};_0x462b6a<_0x256cb0[_0x4861('0x6')];_0x462b6a+=0x1){_0x2aad12=_0x256cb0[_0x462b6a];if(_[_0x4861('0x7')](_0x40d653['mailAccounts'][_0x2aad12['id']])){_0x40d653['mailAccounts'][_0x2aad12['id']]=new MailAccount(_0x2aad12);}else{_[_0x4861('0x8')](_0x40d653[_0x4861('0x1')][_0x2aad12['id']],_0x2aad12);}}}return _0x40d653[_0x4861('0x1')];};};module['exports']=Realtime; \ No newline at end of file +var _0x82d5=['lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x5bae77,_0x4f5e97){var _0x53d8af=function(_0x9db181){while(--_0x9db181){_0x5bae77['push'](_0x5bae77['shift']());}};_0x53d8af(++_0x4f5e97);}(_0x82d5,0x6e));var _0x582d=function(_0x5dc9ec,_0x407af4){_0x5dc9ec=_0x5dc9ec-0x0;var _0x5b4cdb=_0x82d5[_0x5dc9ec];return _0x5b4cdb;};'use strict';var _=require(_0x582d('0x0'));var MailAccount=require(_0x582d('0x1'));var Realtime=function(){this[_0x582d('0x2')]={};};function freeIsNotKey(_0x17a815,_0x4e8b7b,_0x1ece37){var _0x38f790=_[_0x582d('0x3')](_0x17a815,function(_0x289d91,_0x4dd139){return _0x289d91[_0x1ece37];});for(var _0x2fa1a2 in _0x4e8b7b){if(_0x4e8b7b['hasOwnProperty'](_0x2fa1a2)){if(!_0x38f790[_0x2fa1a2]){delete _0x4e8b7b[_0x2fa1a2];}}}}Realtime[_0x582d('0x4')][_0x582d('0x5')]=function(_0x586d3e,_0x198d73){for(var _0x2149a7 in _0x198d73){if(_0x586d3e['hasOwnProperty'](_0x2149a7)){_0x586d3e[_0x2149a7]=_0x198d73[_0x2149a7];}}};Realtime[_0x582d('0x4')][_0x582d('0x6')]=function(){var _0x1692ce=this;return function(_0x317c1b){if(_0x317c1b){freeIsNotKey(_0x317c1b,_0x1692ce[_0x582d('0x2')],'id');for(var _0x28664b=0x0,_0x34b804={},_0x1bfe13={};_0x28664b<_0x317c1b[_0x582d('0x7')];_0x28664b+=0x1){_0x34b804=_0x317c1b[_0x28664b];if(_[_0x582d('0x8')](_0x1692ce['mailAccounts'][_0x34b804['id']])){_0x1692ce[_0x582d('0x2')][_0x34b804['id']]=new MailAccount(_0x34b804);}else{_[_0x582d('0x9')](_0x1692ce[_0x582d('0x2')][_0x34b804['id']],_0x34b804);}}}return _0x1692ce[_0x582d('0x2')];};};module[_0x582d('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 6bd6ec8..a057291 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 _0x7a5b=['TemplateId','Imap','CloudProvider','type','data5','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service','active','key','ListId'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7a5b,0x1d3));var _0xb7a5=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7a5b[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0xb7a5('0x0'));exports[_0xb7a5('0x1')]=function(){return function(){return client['Request'](_0xb7a5('0x2'),{'options':{'attributes':['id',_0xb7a5('0x3'),_0xb7a5('0x4'),_0xb7a5('0x5'),'email',_0xb7a5('0x6'),_0xb7a5('0x7'),_0xb7a5('0x8'),_0xb7a5('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0xb7a5('0xa'),'include':[{'model':_0xb7a5('0xb'),'attributes':['id',_0xb7a5('0x3'),_0xb7a5('0x5'),_0xb7a5('0xc'),_0xb7a5('0xd')],'as':_0xb7a5('0xb')}]},{'model':'MailServerOut','as':_0xb7a5('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0xb7a5('0x3'),_0xb7a5('0x5'),_0xb7a5('0xc'),'data5'],'as':_0xb7a5('0xb')}]}]},'log':_0xb7a5('0xf')});};};exports['notify']=function(_0x28789f,_0xfa43a8){return client['Request'](_0xb7a5('0x10'),{'account':{'id':_0x28789f},'body':_0xfa43a8,'log':_0xb7a5('0x10')});}; \ No newline at end of file +var _0x6df0=['key','ListId','TemplateId','CloudProvider','service','type','data5','MailServerOut','Smtp','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','active'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6df0,0x15d));var _0x06df=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x6df0[_0x50007c];return _0x5c1ec7;};'use strict';var client=require(_0x06df('0x0'));exports[_0x06df('0x1')]=function(){return function(){return client[_0x06df('0x2')](_0x06df('0x3'),{'options':{'attributes':['id',_0x06df('0x4'),_0x06df('0x5'),'service',_0x06df('0x6'),_0x06df('0x7'),_0x06df('0x8'),_0x06df('0x9'),_0x06df('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x06df('0xb'),'attributes':['id',_0x06df('0x4'),_0x06df('0xc'),_0x06df('0xd'),_0x06df('0xe')],'as':_0x06df('0xb')}]},{'model':_0x06df('0xf'),'as':_0x06df('0x10'),'include':[{'model':_0x06df('0xb'),'attributes':['id','name',_0x06df('0xc'),'type',_0x06df('0xe')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x1f7afa,_0x1b722d){return client['Request']('NotifyMailAccount',{'account':{'id':_0x1f7afa},'body':_0x1b722d,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index ee7283b..d937c6e 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 _0x8808=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0xbbc0bb,_0x1ec934){var _0x47534d=function(_0x1137cc){while(--_0x1137cc){_0xbbc0bb['push'](_0xbbc0bb['shift']());}};_0x47534d(++_0x1ec934);}(_0x8808,0x1d8));var _0x8880=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8808[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x8880('0x0'));exports['getSettings']=function(){return client[_0x8880('0x1')](_0x8880('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8880('0x3')]},'log':_0x8880('0x4')});}; \ No newline at end of file +var _0xdd4e=['getSettings','Request','ShowSetting','loginMailFrequency','../client'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdd4e,0xae));var _0xedd4=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0xdd4e[_0xbc4659];return _0x5831f9;};'use strict';var client=require(_0xedd4('0x0'));exports[_0xedd4('0x1')]=function(){return client[_0xedd4('0x2')](_0xedd4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xedd4('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a6c916e..56c216e 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 bf1e77c..8b4a02f 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 _0x2a40=['adapter','socket.io-redis','../../config/triggers','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','sticky-session','ioredis','../../config/environment','createServer','listen','websocket','polling','redis','defaults','localhost'];(function(_0x41a073,_0x3ea9e2){var _0x4b2c53=function(_0xa609ae){while(--_0xa609ae){_0x41a073['push'](_0x41a073['shift']());}};_0x4b2c53(++_0x3ea9e2);}(_0x2a40,0x15a));var _0x02a4=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x2a40[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require(_0x02a4('0x0'));var http=require('http');var express=require('express');var sticky=require(_0x02a4('0x1'));var Redis=require(_0x02a4('0x2'));var config=require(_0x02a4('0x3'));var app=express();var server=http[_0x02a4('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x02a4('0x5')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x02a4('0x6'),_0x02a4('0x7')]});config[_0x02a4('0x8')]=_[_0x02a4('0x9')](config[_0x02a4('0x8')],{'host':_0x02a4('0xa'),'port':0x18eb});socketio[_0x02a4('0xb')](require(_0x02a4('0xc'))({'pubClient':new Redis(config[_0x02a4('0x8')]),'subClient':new Redis(config[_0x02a4('0x8')])}));require(_0x02a4('0xd'))['default']();require('../../config/socketio')[_0x02a4('0xe')](socketio);require('../../config/express')[_0x02a4('0xe')](app);require(_0x02a4('0xf'))[_0x02a4('0xe')](app);}else{server[_0x02a4('0x10')](_0x02a4('0x11'),function(){console[_0x02a4('0x12')](_0x02a4('0x13'),config[_0x02a4('0x14')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xbeff=['polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','../../config/environment','createServer','timeout','listen','port','socket.io','websocket'];(function(_0x4bb2ef,_0x138615){var _0x468378=function(_0x126632){while(--_0x126632){_0x4bb2ef['push'](_0x4bb2ef['shift']());}};_0x468378(++_0x138615);}(_0xbeff,0xca));var _0xfbef=function(_0xaca81c,_0x2df861){_0xaca81c=_0xaca81c-0x0;var _0x3b0001=_0xbeff[_0xaca81c];return _0x3b0001;};'use strict';var _=require('lodash');var http=require('http');var express=require('express');var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xfbef('0x0'));var app=express();var server=http[_0xfbef('0x1')](app);server[_0xfbef('0x2')]=0xdbba0;if(sticky[_0xfbef('0x3')](server,config[_0xfbef('0x4')])){var socketio=require(_0xfbef('0x5'))(server,{'transports':[_0xfbef('0x6'),_0xfbef('0x7')]});config[_0xfbef('0x8')]=_[_0xfbef('0x9')](config[_0xfbef('0x8')],{'host':_0xfbef('0xa'),'port':0x18eb});socketio[_0xfbef('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0xfbef('0x8')]),'subClient':new Redis(config[_0xfbef('0x8')])}));require(_0xfbef('0xc'))[_0xfbef('0xd')]();require(_0xfbef('0xe'))[_0xfbef('0xd')](socketio);require('../../config/express')[_0xfbef('0xd')](app);require('../../routes')[_0xfbef('0xd')](app);}else{server[_0xfbef('0xf')]('listening',function(){console[_0xfbef('0x10')](_0xfbef('0x11'),config['port']);});}exports=module[_0xfbef('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 1b3447b..594a7a3 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 _0x544b=['bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','error','message','routing','exports','jayson/promise'];(function(_0x51542e,_0x5350cd){var _0x1170a9=function(_0x39b80d){while(--_0x39b80d){_0x51542e['push'](_0x51542e['shift']());}};_0x1170a9(++_0x5350cd);}(_0x544b,0x133));var _0xb544=function(_0x3c385e,_0x4d6ccb){_0x3c385e=_0x3c385e-0x0;var _0x512a37=_0x544b[_0x3c385e];return _0x512a37;};'use strict';var jayson=require(_0xb544('0x0'));var BPromise=require(_0xb544('0x1'));var logger=require(_0xb544('0x2'))('routing');var client=jayson[_0xb544('0x3')][_0xb544('0x4')]({'port':0x2329});client[_0xb544('0x5')]=function(_0x3b21b4,_0x4c7138){return new BPromise(function(_0x596334,_0x40a03f){return client[_0xb544('0x6')](_0x3b21b4,_0x4c7138)[_0xb544('0x7')](function(_0x37d2df){logger[_0xb544('0x8')](_0xb544('0x9'),'routing',_0x3b21b4,_0x4c7138,_0x37d2df);if(_0x37d2df[_0xb544('0xa')]){logger[_0xb544('0xa')](_0xb544('0x9'),'routing',_0x3b21b4,_0x37d2df['error'][_0xb544('0xb')],_0x4c7138);return _0x40a03f(_0x37d2df[_0xb544('0xa')][_0xb544('0xb')]);}else{return _0x596334(_0x37d2df['result']);}})['catch'](function(_0x823c9e){logger['error']('rpc',_0xb544('0xc'),_0x3b21b4,_0x823c9e,_0x4c7138);return _0x40a03f(_0x823c9e);});});};module[_0xb544('0xd')]=client; \ No newline at end of file +var _0x7be1=['then','debug','rpc','error','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x2fad8a,_0x26de69){var _0x494d7d=function(_0x52fe59){while(--_0x52fe59){_0x2fad8a['push'](_0x2fad8a['shift']());}};_0x494d7d(++_0x26de69);}(_0x7be1,0x9d));var _0x17be=function(_0x4251a4,_0x17292f){_0x4251a4=_0x4251a4-0x0;var _0x27d2f1=_0x7be1[_0x4251a4];return _0x27d2f1;};'use strict';var jayson=require(_0x17be('0x0'));var BPromise=require(_0x17be('0x1'));var logger=require(_0x17be('0x2'))(_0x17be('0x3'));var client=jayson[_0x17be('0x4')][_0x17be('0x5')]({'port':0x2329});client[_0x17be('0x6')]=function(_0x1ee3fe,_0x4012f0){return new BPromise(function(_0x4a666d,_0x28544c){return client[_0x17be('0x7')](_0x1ee3fe,_0x4012f0)[_0x17be('0x8')](function(_0x33f3a6){logger[_0x17be('0x9')](_0x17be('0xa'),'routing',_0x1ee3fe,_0x4012f0,_0x33f3a6);if(_0x33f3a6[_0x17be('0xb')]){logger[_0x17be('0xb')]('rpc',_0x17be('0x3'),_0x1ee3fe,_0x33f3a6[_0x17be('0xb')]['message'],_0x4012f0);return _0x28544c(_0x33f3a6[_0x17be('0xb')]['message']);}else{return _0x4a666d(_0x33f3a6[_0x17be('0xc')]);}})[_0x17be('0xd')](function(_0x37fa0b){logger[_0x17be('0xb')](_0x17be('0xa'),'routing',_0x1ee3fe,_0x37fa0b,_0x4012f0);return _0x28544c(_0x37fa0b);});});};module[_0x17be('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 24cd530..8e7e3ff 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 _0x5f0f=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents'];(function(_0x1a8916,_0x206c40){var _0x6ba712=function(_0x49a7b5){while(--_0x49a7b5){_0x1a8916['push'](_0x1a8916['shift']());}};_0x6ba712(++_0x206c40);}(_0x5f0f,0x12b));var _0xf5f0=function(_0x25dd3b,_0x27e043){_0x25dd3b=_0x25dd3b-0x0;var _0x3084aa=_0x5f0f[_0x25dd3b];return _0x3084aa;};'use strict';var BPromise=require(_0xf5f0('0x0'));var server=require(_0xf5f0('0x1'));var Realtime=require(_0xf5f0('0x2'));var user=require(_0xf5f0('0x3'));var interval=require(_0xf5f0('0x4'));var openchannelQueue=require(_0xf5f0('0x5'));var chatQueue=require(_0xf5f0('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xf5f0('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf5f0('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf5f0('0x9')]()[_0xf5f0('0xa')](user[_0xf5f0('0xb')]())['then'](realtime[_0xf5f0('0xc')]())['then'](interval[_0xf5f0('0xd')]())[_0xf5f0('0xa')](realtime[_0xf5f0('0xe')]())[_0xf5f0('0xa')](openchannelQueue[_0xf5f0('0xf')]())[_0xf5f0('0xa')](realtime[_0xf5f0('0x10')]())[_0xf5f0('0xa')](chatQueue[_0xf5f0('0x11')]())[_0xf5f0('0xa')](realtime[_0xf5f0('0x12')]())[_0xf5f0('0xa')](smsQueue['getSmsQueues']())[_0xf5f0('0xa')](realtime[_0xf5f0('0x13')]())[_0xf5f0('0xa')](mailQueue[_0xf5f0('0x14')]())[_0xf5f0('0xa')](realtime[_0xf5f0('0x15')]())[_0xf5f0('0xa')](faxQueue['getFaxQueues']())[_0xf5f0('0xa')](realtime['initFaxQueues']())[_0xf5f0('0xa')](whatsappQueue[_0xf5f0('0x16')]())['then'](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0xf5f0('0x17')](realtime)[_0xf5f0('0xa')](function(_0x4b9e35){return initRealtime();})[_0xf5f0('0xa')](function(_0x4c360d){return setInterval(initRealtime,0x1388);})[_0xf5f0('0x18')](function(_0x53ae79){console[_0xf5f0('0x19')](_0x53ae79);});}main(); \ No newline at end of file +var _0x732f=['./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime'];(function(_0x55aa06,_0x2e288f){var _0x267d72=function(_0x1a58f0){while(--_0x1a58f0){_0x55aa06['push'](_0x55aa06['shift']());}};_0x267d72(++_0x2e288f);}(_0x732f,0xce));var _0xf732=function(_0x155bd1,_0x1fce0d){_0x155bd1=_0x155bd1-0x0;var _0x932f67=_0x732f[_0x155bd1];return _0x932f67;};'use strict';var BPromise=require('bluebird');var server=require(_0xf732('0x0'));var Realtime=require(_0xf732('0x1'));var user=require(_0xf732('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xf732('0x3'));var smsQueue=require(_0xf732('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf732('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf732('0x6')]()[_0xf732('0x7')](user[_0xf732('0x8')]())[_0xf732('0x7')](realtime[_0xf732('0x9')]())[_0xf732('0x7')](interval[_0xf732('0xa')]())[_0xf732('0x7')](realtime[_0xf732('0xb')]())[_0xf732('0x7')](openchannelQueue['getOpenchannelQueues']())[_0xf732('0x7')](realtime[_0xf732('0xc')]())[_0xf732('0x7')](chatQueue[_0xf732('0xd')]())[_0xf732('0x7')](realtime[_0xf732('0xe')]())[_0xf732('0x7')](smsQueue[_0xf732('0xf')]())[_0xf732('0x7')](realtime[_0xf732('0x10')]())[_0xf732('0x7')](mailQueue[_0xf732('0x11')]())['then'](realtime[_0xf732('0x12')]())[_0xf732('0x7')](faxQueue[_0xf732('0x13')]())['then'](realtime[_0xf732('0x14')]())['then'](whatsappQueue[_0xf732('0x15')]())['then'](realtime[_0xf732('0x16')]())[_0xf732('0x7')](function(){return realtime;});}function main(){return server[_0xf732('0x17')](realtime)[_0xf732('0x7')](function(_0x4094a4){return initRealtime();})[_0xf732('0x7')](function(_0xa7b1d5){return setInterval(initRealtime,0x1388);})[_0xf732('0x18')](function(_0x27a722){console[_0xf732('0x19')](_0x27a722);});}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 8937b83..f46f945 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x52d1e0,_0x418a6a){var _0x27c69e=function(_0x3a3ed0){while(--_0x3a3ed0){_0x52d1e0['push'](_0x52d1e0['shift']());}};_0x27c69e(++_0x418a6a);}(_0x2ef3,0xba));var _0x32ef=function(_0x22b808,_0x316eb1){_0x22b808=_0x22b808-0x0;var _0x4e2b45=_0x2ef3[_0x22b808];return _0x4e2b45;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x189106,_0x4e40fe){var _0x14cc2a=function(_0x2c1022){while(--_0x2c1022){_0x189106['push'](_0x189106['shift']());}};_0x14cc2a(++_0x4e40fe);}(_0xe14b,0x93));var _0xbe14=function(_0x456956,_0x7343d3){_0x456956=_0x456956-0x0;var _0xa25d0e=_0xe14b[_0x456956];return _0xa25d0e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1d271d5..4b0d3c3 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 _0xb8ce=['catch','SendMail','jayson/promise','http','request','then','error','message','result'];(function(_0x2ed8c9,_0x529013){var _0x49930e=function(_0x2f7740){while(--_0x2f7740){_0x2ed8c9['push'](_0x2ed8c9['shift']());}};_0x49930e(++_0x529013);}(_0xb8ce,0x13d));var _0xeb8c=function(_0x12ca3b,_0x3e1ef5){_0x12ca3b=_0x12ca3b-0x0;var _0x3372d8=_0xb8ce[_0x12ca3b];return _0x3372d8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xeb8c('0x0'));var client=jayson['client'][_0xeb8c('0x1')]({'port':0x232b});function request(_0xf793be,_0x1d7d91){return new BPromise(function(_0x122061,_0x55d3ca){return client[_0xeb8c('0x2')](_0xf793be,_0x1d7d91)[_0xeb8c('0x3')](function(_0x11c5b7){if(_0x11c5b7['error']){return _0x55d3ca(_0x11c5b7[_0xeb8c('0x4')][_0xeb8c('0x5')]);}else{return _0x122061(_0x11c5b7[_0xeb8c('0x6')]);}})[_0xeb8c('0x7')](function(_0x161099){return _0x55d3ca(_0x161099);});});}exports['sendMailMessage']=function(_0x3ba01c,_0x3615dc){return request(_0xeb8c('0x8'),{'account':_0x3ba01c,'message':_0x3615dc});}; \ No newline at end of file +var _0x237c=['http','request','then','error','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x237c,0xbe));var _0xc237=function(_0x446a13,_0x223117){_0x446a13=_0x446a13-0x0;var _0x28b7c8=_0x237c[_0x446a13];return _0x28b7c8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xc237('0x0'));var client=jayson[_0xc237('0x1')][_0xc237('0x2')]({'port':0x232b});function request(_0x1edb6c,_0x2a834f){return new BPromise(function(_0x37cb92,_0x1daebb){return client[_0xc237('0x3')](_0x1edb6c,_0x2a834f)[_0xc237('0x4')](function(_0x2c016c){if(_0x2c016c[_0xc237('0x5')]){return _0x1daebb(_0x2c016c[_0xc237('0x5')]['message']);}else{return _0x37cb92(_0x2c016c['result']);}})['catch'](function(_0xbb8132){return _0x1daebb(_0xbb8132);});});}exports[_0xc237('0x6')]=function(_0x45c3c2,_0x56dc74){return request(_0xc237('0x7'),{'account':_0x45c3c2,'message':_0x56dc74});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 1e8e0e4..10e3c45 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 _0x7880=['whatsapp','length','Status','StatusTime','chatStatus','mailStatusTime','openchannelCurrentCapacity','busyQueue','smsWaitingInteractions','user:routing:update','omit','exports','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','chat','openchannel','sms'];(function(_0x464872,_0x3a5a5f){var _0x2a369a=function(_0x5eb7){while(--_0x5eb7){_0x464872['push'](_0x464872['shift']());}};_0x2a369a(++_0x3a5a5f);}(_0x7880,0x1f4));var _0x0788=function(_0x260859,_0x3cfcff){_0x260859=_0x260859-0x0;var _0x4b77f8=_0x7880[_0x260859];return _0x4b77f8;};'use strict';var _=require('lodash');var md5=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var Redis=require(_0x0788('0x2'));var config=require(_0x0788('0x3'));config[_0x0788('0x4')]=_[_0x0788('0x5')](config['redis'],{'host':_0x0788('0x6'),'port':0x18eb});var io=require(_0x0788('0x7'))(new Redis(config[_0x0788('0x4')]));function Agent(_0xd53e7d){this['id']=_0xd53e7d['id']||0x0;this[_0x0788('0x8')]=_0xd53e7d[_0x0788('0x8')]||'';this[_0x0788('0x9')]=_0xd53e7d[_0x0788('0x9')]||!![];this[_0x0788('0xa')]=_0xd53e7d[_0x0788('0xa')]||![];this['chatPause']=_0xd53e7d[_0x0788('0xb')]||![];this['mailPause']=_0xd53e7d[_0x0788('0xc')]||![];this['faxPause']=_0xd53e7d[_0x0788('0xd')]||![];this[_0x0788('0xe')]=_0xd53e7d[_0x0788('0xe')]||![];this[_0x0788('0xf')]=_0xd53e7d[_0x0788('0xf')]||![];this['chatStatus']=_0x0788('0x10');this[_0x0788('0x11')]=0x0;this[_0x0788('0x12')]=_0xd53e7d[_0x0788('0x12')]||0x0;this[_0x0788('0x13')]=0x0;this[_0x0788('0x14')]=_0x0788('0x10');this['mailStatusTime']=0x0;this[_0x0788('0x15')]=_0xd53e7d[_0x0788('0x15')]||0x0;this[_0x0788('0x16')]=0x0;this[_0x0788('0x17')]='unknown';this[_0x0788('0x18')]=0x0;this['faxCapacity']=_0xd53e7d[_0x0788('0x19')]||0x0;this[_0x0788('0x1a')]=0x0;this[_0x0788('0x1b')]=_0x0788('0x10');this[_0x0788('0x1c')]=0x0;this[_0x0788('0x1d')]=_0xd53e7d['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x0788('0x1e')]=_0x0788('0x10');this['whatsappStatusTime']=0x0;this[_0x0788('0x1f')]=_0xd53e7d[_0x0788('0x1f')]||0x0;this[_0x0788('0x20')]=0x0;this['openchannelStatus']=_0x0788('0x10');this[_0x0788('0x21')]=0x0;this['openchannelCapacity']=_0xd53e7d[_0x0788('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x0788('0x23')]=![];this['busyQueue']=undefined;this[_0x0788('0x0')]='';this[_0x0788('0x24')]={};this[_0x0788('0x25')]={};this[_0x0788('0x26')]={};this[_0x0788('0x27')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0x0788('0x28')]();}Agent[_0x0788('0x29')][_0x0788('0x2a')]=function(_0x7a99a1){if(this[_0x7a99a1+'CurrentCapacity']>0x0){if(this[_0x7a99a1+'Capacity']>0x0&&this[_0x7a99a1+_0x0788('0x2b')]>=this[_0x7a99a1+_0x0788('0x2c')]){return _0x0788('0x2d');}else{return'working';}}else{return'idle';}};Agent[_0x0788('0x29')][_0x0788('0x28')]=function(){var _0x5f2dda=['mail',_0x0788('0x2e'),_0x0788('0x2f'),'fax',_0x0788('0x30'),_0x0788('0x31')];for(var _0x467d52=0x0;_0x467d52<_0x5f2dda[_0x0788('0x32')];_0x467d52+=0x1){var _0xf9ba32=this[_0x0788('0x2a')](_0x5f2dda[_0x467d52]);if(this[_0x5f2dda[_0x467d52]+_0x0788('0x33')]!==_0xf9ba32){this[_0x5f2dda[_0x467d52]+_0x0788('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0x5f2dda[_0x467d52]+_0x0788('0x33')]=_0xf9ba32;}var _0x40d345={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x0788('0xa')],'chatPause':this[_0x0788('0xb')],'mailPause':this[_0x0788('0xc')],'smsPause':this[_0x0788('0xe')],'faxPause':this[_0x0788('0xd')],'openchannelPause':this[_0x0788('0xf')],'chatStatus':this[_0x0788('0x35')],'chatStatusTime':this[_0x0788('0x11')],'chatCapacity':this[_0x0788('0x12')],'chatCurrentCapacity':this[_0x0788('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x0788('0x36')],'mailCapacity':this[_0x0788('0x15')],'mailCurrentCapacity':this[_0x0788('0x16')],'faxStatus':this[_0x0788('0x17')],'faxStatusTime':this[_0x0788('0x18')],'faxCapacity':this[_0x0788('0x19')],'faxCurrentCapacity':this[_0x0788('0x1a')],'smsStatus':this[_0x0788('0x1b')],'smsStatusTime':this[_0x0788('0x1c')],'smsCapacity':this[_0x0788('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x0788('0x21')],'openchannelCapacity':this[_0x0788('0x22')],'openchannelCurrentCapacity':this[_0x0788('0x37')],'busy':this['busy'],'busyQueue':this[_0x0788('0x38')],'chatWaitingInteractions':this[_0x0788('0x24')],'faxWaitingInteractions':this[_0x0788('0x25')],'mailWaitingInteractions':this[_0x0788('0x26')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x0788('0x39')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x322465=md5(JSON['stringify'](_0x40d345));if(this[_0x0788('0x0')]!==_0x322465){this[_0x0788('0x0')]=_0x322465;io['emit'](_0x0788('0x3a'),_[_0x0788('0x3b')](_0x40d345,['online']));}};module[_0x0788('0x3c')]=Agent; \ No newline at end of file +var _0xbbbc=['chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','sms','length','Status','StatusTime','toNumber','format','chatStatus','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','whatsappStatus','whatsappCurrentCapacity','openchannelStatus','mailWaitingInteractions','stringify','emit','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown'];(function(_0x3f8fa5,_0xa2656){var _0x42542e=function(_0x5dc8ad){while(--_0x5dc8ad){_0x3f8fa5['push'](_0x3f8fa5['shift']());}};_0x42542e(++_0xa2656);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x487f47,_0x32b30b){_0x487f47=_0x487f47-0x0;var _0x35988b=_0xbbbc[_0x487f47];return _0x35988b;};'use strict';var _=require(_0xcbbb('0x0'));var md5=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var Redis=require(_0xcbbb('0x3'));var config=require(_0xcbbb('0x4'));config[_0xcbbb('0x5')]=_[_0xcbbb('0x6')](config['redis'],{'host':_0xcbbb('0x7'),'port':0x18eb});var io=require(_0xcbbb('0x8'))(new Redis(config[_0xcbbb('0x5')]));function Agent(_0x3ccbf6){this['id']=_0x3ccbf6['id']||0x0;this[_0xcbbb('0x9')]=_0x3ccbf6['name']||'';this[_0xcbbb('0xa')]=_0x3ccbf6[_0xcbbb('0xa')]||!![];this[_0xcbbb('0xb')]=_0x3ccbf6[_0xcbbb('0xb')]||![];this[_0xcbbb('0xc')]=_0x3ccbf6[_0xcbbb('0xc')]||![];this[_0xcbbb('0xd')]=_0x3ccbf6['mailPause']||![];this[_0xcbbb('0xe')]=_0x3ccbf6['faxPause']||![];this['smsPause']=_0x3ccbf6[_0xcbbb('0xf')]||![];this['openchannelPause']=_0x3ccbf6[_0xcbbb('0x10')]||![];this['chatStatus']=_0xcbbb('0x11');this[_0xcbbb('0x12')]=0x0;this['chatCapacity']=_0x3ccbf6[_0xcbbb('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xcbbb('0x14')]='unknown';this[_0xcbbb('0x15')]=0x0;this[_0xcbbb('0x16')]=_0x3ccbf6[_0xcbbb('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xcbbb('0x17')]=_0xcbbb('0x11');this[_0xcbbb('0x18')]=0x0;this[_0xcbbb('0x19')]=_0x3ccbf6['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xcbbb('0x1a')]=_0xcbbb('0x11');this[_0xcbbb('0x1b')]=0x0;this[_0xcbbb('0x1c')]=_0x3ccbf6['smsCapacity']||0x0;this[_0xcbbb('0x1d')]=0x0;this['whatsappStatus']=_0xcbbb('0x11');this[_0xcbbb('0x1e')]=0x0;this[_0xcbbb('0x1f')]=_0x3ccbf6['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xcbbb('0x11');this[_0xcbbb('0x20')]=0x0;this[_0xcbbb('0x21')]=_0x3ccbf6[_0xcbbb('0x21')]||0x0;this[_0xcbbb('0x22')]=0x0;this[_0xcbbb('0x23')]=![];this[_0xcbbb('0x24')]=undefined;this[_0xcbbb('0x1')]='';this[_0xcbbb('0x25')]={};this[_0xcbbb('0x26')]={};this['mailWaitingInteractions']={};this[_0xcbbb('0x27')]={};this[_0xcbbb('0x28')]={};this[_0xcbbb('0x29')]={};this[_0xcbbb('0x2a')]();}Agent[_0xcbbb('0x2b')][_0xcbbb('0x2c')]=function(_0x297eae){if(this[_0x297eae+_0xcbbb('0x2d')]>0x0){if(this[_0x297eae+_0xcbbb('0x2e')]>0x0&&this[_0x297eae+'CurrentCapacity']>=this[_0x297eae+_0xcbbb('0x2e')]){return _0xcbbb('0x2f');}else{return'working';}}else{return _0xcbbb('0x30');}};Agent['prototype']['updateRealtime']=function(){var _0x575d56=[_0xcbbb('0x31'),'chat','openchannel','fax',_0xcbbb('0x32'),'whatsapp'];for(var _0x4da775=0x0;_0x4da775<_0x575d56[_0xcbbb('0x33')];_0x4da775+=0x1){var _0x2902c6=this[_0xcbbb('0x2c')](_0x575d56[_0x4da775]);if(this[_0x575d56[_0x4da775]+_0xcbbb('0x34')]!==_0x2902c6){this[_0x575d56[_0x4da775]+_0xcbbb('0x35')]=_[_0xcbbb('0x36')](moment()[_0xcbbb('0x37')]('x'));}this[_0x575d56[_0x4da775]+_0xcbbb('0x34')]=_0x2902c6;}var _0x2a023f={'id':this['id'],'name':this[_0xcbbb('0x9')],'online':this[_0xcbbb('0xa')],'voicePause':this[_0xcbbb('0xb')],'chatPause':this[_0xcbbb('0xc')],'mailPause':this[_0xcbbb('0xd')],'smsPause':this[_0xcbbb('0xf')],'faxPause':this[_0xcbbb('0xe')],'openchannelPause':this[_0xcbbb('0x10')],'chatStatus':this[_0xcbbb('0x38')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xcbbb('0x13')],'chatCurrentCapacity':this[_0xcbbb('0x39')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xcbbb('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xcbbb('0x3a')],'faxStatus':this[_0xcbbb('0x17')],'faxStatusTime':this[_0xcbbb('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xcbbb('0x3b')],'smsStatus':this[_0xcbbb('0x1a')],'smsStatusTime':this[_0xcbbb('0x1b')],'smsCapacity':this[_0xcbbb('0x1c')],'smsCurrentCapacity':this[_0xcbbb('0x1d')],'whatsappStatus':this[_0xcbbb('0x3c')],'whatsappStatusTime':this[_0xcbbb('0x1e')],'whatsappCapacity':this[_0xcbbb('0x1f')],'whatsappCurrentCapacity':this[_0xcbbb('0x3d')],'openchannelStatus':this[_0xcbbb('0x3e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xcbbb('0x24')],'chatWaitingInteractions':this[_0xcbbb('0x25')],'faxWaitingInteractions':this[_0xcbbb('0x26')],'mailWaitingInteractions':this[_0xcbbb('0x3f')],'openchannelWaitingInteractions':this[_0xcbbb('0x27')],'smsWaitingInteractions':this[_0xcbbb('0x28')],'whatsappWaitingInteractions':this[_0xcbbb('0x29')]};var _0x39a417=md5(JSON[_0xcbbb('0x40')](_0x2a023f));if(this[_0xcbbb('0x1')]!==_0x39a417){this[_0xcbbb('0x1')]=_0x39a417;io[_0xcbbb('0x41')]('user:routing:update',_['omit'](_0x2a023f,[_0xcbbb('0xa')]));}};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 f951f43..1f7e42d 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 _0x0eac=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy'];(function(_0x3b2147,_0x3ffcd9){var _0x7a0b6a=function(_0x4b01ed){while(--_0x4b01ed){_0x3b2147['push'](_0x3b2147['shift']());}};_0x7a0b6a(++_0x3ffcd9);}(_0x0eac,0x13c));var _0xc0ea=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0eac[_0x3c4dad];return _0x1a4f49;};'use strict';var _=require('lodash');var md5=require(_0xc0ea('0x0'));var util=require('util');var Redis=require(_0xc0ea('0x1'));var config=require('../../../config/environment');config[_0xc0ea('0x2')]=_[_0xc0ea('0x3')](config[_0xc0ea('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xc0ea('0x4'))(new Redis(config[_0xc0ea('0x2')]));function ChatQueue(_0x4c846a){this['id']=_0x4c846a['id']||0x0;this['name']=_0x4c846a[_0xc0ea('0x5')]||'';this[_0xc0ea('0x6')]=_0x4c846a[_0xc0ea('0x6')]||0xa;this['strategy']=_0x4c846a[_0xc0ea('0x7')]||_0xc0ea('0x8');this['Agents']=_0x4c846a[_0xc0ea('0x9')];this[_0xc0ea('0xa')]={};this[_0xc0ea('0xb')]=0x0;this['md5']='';this[_0xc0ea('0xc')]();this[_0xc0ea('0xd')]();}ChatQueue[_0xc0ea('0xe')][_0xc0ea('0xc')]=function(){var _0x43e0b9=this[_0xc0ea('0xa')]['_rr'];this['mapAgentsId']=_[_0xc0ea('0xf')](this[_0xc0ea('0x9')],'id');this[_0xc0ea('0xa')]['_rr']=_0x43e0b9;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xc0ea('0x10')]=0x0;this[_0xc0ea('0x11')]=0x0;for(var _0x4f4467=0x0;_0x4f4467=0x0?this[_0xc0ea('0x14')]:0x0;var _0xe73bfa={'id':this['id'],'available':this[_0xc0ea('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xc0ea('0x5')],'paused':this[_0xc0ea('0x11')],'waiting':this[_0xc0ea('0xb')]};var _0x5f0637=md5(JSON[_0xc0ea('0x15')](_0xe73bfa));if(this[_0xc0ea('0x0')]!==_0x5f0637){this['md5']=_0x5f0637;io['to'](util[_0xc0ea('0x16')](_0xc0ea('0x17'),_0xe73bfa['name']))[_0xc0ea('0x18')](_0xc0ea('0x19'),_0xe73bfa);}};module[_0xc0ea('0x1a')]=ChatQueue; \ No newline at end of file +var _0xe68c=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','online','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name'];(function(_0x14079c,_0x5337b4){var _0xcd69c1=function(_0x4fe8c7){while(--_0x4fe8c7){_0x14079c['push'](_0x14079c['shift']());}};_0xcd69c1(++_0x5337b4);}(_0xe68c,0x123));var _0xce68=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0xe68c[_0x403f5f];return _0x15b1cd;};'use strict';var _=require(_0xce68('0x0'));var md5=require(_0xce68('0x1'));var util=require(_0xce68('0x2'));var Redis=require(_0xce68('0x3'));var config=require(_0xce68('0x4'));config['redis']=_[_0xce68('0x5')](config['redis'],{'host':_0xce68('0x6'),'port':0x18eb});var io=require(_0xce68('0x7'))(new Redis(config['redis']));function ChatQueue(_0x54badc){this['id']=_0x54badc['id']||0x0;this['name']=_0x54badc[_0xce68('0x8')]||'';this[_0xce68('0x9')]=_0x54badc['timeout']||0xa;this[_0xce68('0xa')]=_0x54badc[_0xce68('0xa')]||_0xce68('0xb');this['Agents']=_0x54badc[_0xce68('0xc')];this['mapAgentsId']={};this[_0xce68('0xd')]=0x0;this[_0xce68('0x1')]='';this[_0xce68('0xe')]();this[_0xce68('0xf')]();}ChatQueue[_0xce68('0x10')][_0xce68('0xe')]=function(){var _0x28f0ae=this[_0xce68('0x11')][_0xce68('0x12')];this['mapAgentsId']=_[_0xce68('0x13')](this[_0xce68('0xc')],'id');this['mapAgentsId'][_0xce68('0x12')]=_0x28f0ae;};ChatQueue[_0xce68('0x10')]['updateRealtime']=function(){this[_0xce68('0x14')]=0x0;this[_0xce68('0x15')]=0x0;for(var _0x1ff6ed=0x0;_0x1ff6ed=0x0?this[_0xce68('0x18')]:0x0;var _0x11397f={'id':this['id'],'available':this[_0xce68('0x18')],'loggedIn':this[_0xce68('0x14')],'name':this[_0xce68('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x2d15d4=md5(JSON[_0xce68('0x19')](_0x11397f));if(this[_0xce68('0x1')]!==_0x2d15d4){this[_0xce68('0x1')]=_0x2d15d4;io['to'](util[_0xce68('0x1a')](_0xce68('0x1b'),_0x11397f['name']))[_0xce68('0x1c')]('chat_queue:save',_0x11397f);}};module[_0xce68('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index cd1266e..ec19378 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 _0xa22e=['exports','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','paused','length','loggedIn','faxPause','available','format','fax:queue:%s','fax_queue:save'];(function(_0x42d4e3,_0x58ad2f){var _0x1c3872=function(_0xfde55e){while(--_0xfde55e){_0x42d4e3['push'](_0x42d4e3['shift']());}};_0x1c3872(++_0x58ad2f);}(_0xa22e,0x1aa));var _0xea22=function(_0x14ffcd,_0x8bbdf4){_0x14ffcd=_0x14ffcd-0x0;var _0x32f653=_0xa22e[_0x14ffcd];return _0x32f653;};'use strict';var _=require('lodash');var md5=require(_0xea22('0x0'));var util=require(_0xea22('0x1'));var Redis=require('ioredis');var config=require(_0xea22('0x2'));config[_0xea22('0x3')]=_['defaults'](config[_0xea22('0x3')],{'host':_0xea22('0x4'),'port':0x18eb});var io=require(_0xea22('0x5'))(new Redis(config[_0xea22('0x3')]));function FaxQueue(_0x248dca){this['id']=_0x248dca['id']||0x0;this['name']=_0x248dca[_0xea22('0x6')]||'';this['timeout']=_0x248dca[_0xea22('0x7')]||0xa;this['strategy']=_0x248dca[_0xea22('0x8')]||_0xea22('0x9');this[_0xea22('0xa')]=_0x248dca[_0xea22('0xa')];this[_0xea22('0xb')]={};this['waiting']=0x0;this[_0xea22('0x0')]='';this[_0xea22('0xc')]();this['updateRealtime']();}FaxQueue[_0xea22('0xd')][_0xea22('0xc')]=function(){var _0xd9470c=this['mapAgentsId'][_0xea22('0xe')];this['mapAgentsId']=_[_0xea22('0xf')](this[_0xea22('0xa')],'id');this[_0xea22('0xb')]['_rr']=_0xd9470c;};FaxQueue[_0xea22('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xea22('0x10')]=0x0;for(var _0x1b2dd0=0x0;_0x1b2dd0=0x0?this[_0xea22('0x14')]:0x0;var _0x49ffad={'id':this['id'],'available':this[_0xea22('0x14')],'loggedIn':this[_0xea22('0x12')],'name':this[_0xea22('0x6')],'paused':this[_0xea22('0x10')],'waiting':this['waiting']};var _0x1cf781=md5(JSON['stringify'](_0x49ffad));if(this[_0xea22('0x0')]!==_0x1cf781){this[_0xea22('0x0')]=_0x1cf781;io['to'](util[_0xea22('0x15')](_0xea22('0x16'),_0x49ffad[_0xea22('0x6')]))['emit'](_0xea22('0x17'),_0x49ffad);}};module[_0xea22('0x18')]=FaxQueue; \ No newline at end of file +var _0x090a=['map','prototype','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr'];(function(_0x427572,_0x1d89f2){var _0x585590=function(_0x1699da){while(--_0x1699da){_0x427572['push'](_0x427572['shift']());}};_0x585590(++_0x1d89f2);}(_0x090a,0x98));var _0xa090=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0x090a[_0x15bbf1];return _0x5c4b47;};'use strict';var _=require(_0xa090('0x0'));var md5=require(_0xa090('0x1'));var util=require(_0xa090('0x2'));var Redis=require(_0xa090('0x3'));var config=require(_0xa090('0x4'));config[_0xa090('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa090('0x5')]));function FaxQueue(_0x37628f){this['id']=_0x37628f['id']||0x0;this['name']=_0x37628f[_0xa090('0x6')]||'';this['timeout']=_0x37628f[_0xa090('0x7')]||0xa;this[_0xa090('0x8')]=_0x37628f[_0xa090('0x8')]||_0xa090('0x9');this[_0xa090('0xa')]=_0x37628f[_0xa090('0xa')];this[_0xa090('0xb')]={};this[_0xa090('0xc')]=0x0;this[_0xa090('0x1')]='';this[_0xa090('0xd')]();this[_0xa090('0xe')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x5cb919=this[_0xa090('0xb')][_0xa090('0xf')];this[_0xa090('0xb')]=_[_0xa090('0x10')](this['Agents'],'id');this[_0xa090('0xb')][_0xa090('0xf')]=_0x5cb919;};FaxQueue[_0xa090('0x11')][_0xa090('0xe')]=function(){this[_0xa090('0x12')]=0x0;this[_0xa090('0x13')]=0x0;for(var _0x54d2c8=0x0;_0x54d2c8=0x0?this[_0xa090('0x17')]:0x0;var _0x5ada06={'id':this['id'],'available':this[_0xa090('0x17')],'loggedIn':this[_0xa090('0x12')],'name':this['name'],'paused':this[_0xa090('0x13')],'waiting':this[_0xa090('0xc')]};var _0x457d9b=md5(JSON[_0xa090('0x18')](_0x5ada06));if(this[_0xa090('0x1')]!==_0x457d9b){this[_0xa090('0x1')]=_0x457d9b;io['to'](util['format'](_0xa090('0x19'),_0x5ada06['name']))[_0xa090('0x1a')](_0xa090('0x1b'),_0x5ada06);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c77650c..98c66a1 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 _0x4470=['Intervals','exports','name'];(function(_0xfe5b01,_0x2712eb){var _0x1e46e9=function(_0x55610f){while(--_0x55610f){_0xfe5b01['push'](_0xfe5b01['shift']());}};_0x1e46e9(++_0x2712eb);}(_0x4470,0x1c1));var _0x0447=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x4470[_0x590b61];return _0x1a14dc;};'use strict';function Interval(_0x4a8c14){this['id']=_0x4a8c14['id']||0x0;this[_0x0447('0x0')]=_0x4a8c14[_0x0447('0x0')]||'';this[_0x0447('0x1')]=_0x4a8c14[_0x0447('0x1')]||{};}module[_0x0447('0x2')]=Interval; \ No newline at end of file +var _0xff95=['name','Intervals'];(function(_0x1cdf54,_0x50de61){var _0x3cfbc9=function(_0xcfbe2a){while(--_0xcfbe2a){_0x1cdf54['push'](_0x1cdf54['shift']());}};_0x3cfbc9(++_0x50de61);}(_0xff95,0x192));var _0x5ff9=function(_0x1024f5,_0x38928d){_0x1024f5=_0x1024f5-0x0;var _0x52a242=_0xff95[_0x1024f5];return _0x52a242;};'use strict';function Interval(_0x282f8c){this['id']=_0x282f8c['id']||0x0;this[_0x5ff9('0x0')]=_0x282f8c[_0x5ff9('0x0')]||'';this[_0x5ff9('0x1')]=_0x282f8c['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 60620c2..5cd1974 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 _0x1cbb=['md5','format','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','localhost','redis','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','loggedIn','paused','length','online','mailPause','available','name','stringify'];(function(_0x31f5e1,_0x5d8b29){var _0x521cfd=function(_0x2c2b1d){while(--_0x2c2b1d){_0x31f5e1['push'](_0x31f5e1['shift']());}};_0x521cfd(++_0x5d8b29);}(_0x1cbb,0x1f3));var _0xb1cb=function(_0x11f012,_0xd13229){_0x11f012=_0x11f012-0x0;var _0x4602f0=_0x1cbb[_0x11f012];return _0x4602f0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xb1cb('0x0'));var Redis=require(_0xb1cb('0x1'));var config=require(_0xb1cb('0x2'));config['redis']=_['defaults'](config['redis'],{'host':_0xb1cb('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb1cb('0x4')]));function MailQueue(_0x3e75c7){this['id']=_0x3e75c7['id']||0x0;this['name']=_0x3e75c7['name']||'';this['timeout']=_0x3e75c7[_0xb1cb('0x5')]||0xa;this['strategy']=_0x3e75c7[_0xb1cb('0x6')]||_0xb1cb('0x7');this['Agents']=_0x3e75c7['Agents'];this[_0xb1cb('0x8')]={};this[_0xb1cb('0x9')]=0x0;this['md5']='';this[_0xb1cb('0xa')]();this[_0xb1cb('0xb')]();}MailQueue[_0xb1cb('0xc')][_0xb1cb('0xa')]=function(){var _0x1f9ac9=this[_0xb1cb('0x8')]['_rr'];this['mapAgentsId']=_[_0xb1cb('0xd')](this[_0xb1cb('0xe')],'id');this[_0xb1cb('0x8')]['_rr']=_0x1f9ac9;};MailQueue[_0xb1cb('0xc')]['updateRealtime']=function(){this[_0xb1cb('0xf')]=0x0;this[_0xb1cb('0x10')]=0x0;for(var _0x58c14f=0x0;_0x58c14f=0x0?this[_0xb1cb('0x14')]:0x0;var _0x209801={'id':this['id'],'available':this[_0xb1cb('0x14')],'loggedIn':this[_0xb1cb('0xf')],'name':this[_0xb1cb('0x15')],'paused':this[_0xb1cb('0x10')],'waiting':this['waiting']};var _0x468029=md5(JSON[_0xb1cb('0x16')](_0x209801));if(this['md5']!==_0x468029){this[_0xb1cb('0x17')]=_0x468029;io['to'](util[_0xb1cb('0x18')](_0xb1cb('0x19'),_0x209801[_0xb1cb('0x15')]))[_0xb1cb('0x1a')](_0xb1cb('0x1b'),_0x209801);}};module[_0xb1cb('0x1c')]=MailQueue; \ No newline at end of file +var _0xd27a=['../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','prototype','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','exports','lodash','util'];(function(_0x22bbf5,_0xd5ba18){var _0x2c0323=function(_0xafeab4){while(--_0xafeab4){_0x22bbf5['push'](_0x22bbf5['shift']());}};_0x2c0323(++_0xd5ba18);}(_0xd27a,0x186));var _0xad27=function(_0x229c5f,_0x28e427){_0x229c5f=_0x229c5f-0x0;var _0x32b7d6=_0xd27a[_0x229c5f];return _0x32b7d6;};'use strict';var _=require(_0xad27('0x0'));var md5=require('md5');var util=require(_0xad27('0x1'));var Redis=require('ioredis');var config=require(_0xad27('0x2'));config[_0xad27('0x3')]=_[_0xad27('0x4')](config['redis'],{'host':_0xad27('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad27('0x3')]));function MailQueue(_0x468657){this['id']=_0x468657['id']||0x0;this[_0xad27('0x6')]=_0x468657['name']||'';this[_0xad27('0x7')]=_0x468657[_0xad27('0x7')]||0xa;this[_0xad27('0x8')]=_0x468657[_0xad27('0x8')]||_0xad27('0x9');this[_0xad27('0xa')]=_0x468657['Agents'];this['mapAgentsId']={};this[_0xad27('0xb')]=0x0;this[_0xad27('0xc')]='';this[_0xad27('0xd')]();this['updateRealtime']();}MailQueue[_0xad27('0xe')][_0xad27('0xd')]=function(){var _0x1cae72=this['mapAgentsId'][_0xad27('0xf')];this[_0xad27('0x10')]=_[_0xad27('0x11')](this[_0xad27('0xa')],'id');this[_0xad27('0x10')][_0xad27('0xf')]=_0x1cae72;};MailQueue[_0xad27('0xe')][_0xad27('0x12')]=function(){this[_0xad27('0x13')]=0x0;this[_0xad27('0x14')]=0x0;for(var _0x3a4a8b=0x0;_0x3a4a8b=0x0?this['available']:0x0;var _0xbe48a7={'id':this['id'],'available':this[_0xad27('0x17')],'loggedIn':this[_0xad27('0x13')],'name':this['name'],'paused':this[_0xad27('0x14')],'waiting':this['waiting']};var _0x6daeb0=md5(JSON[_0xad27('0x18')](_0xbe48a7));if(this[_0xad27('0xc')]!==_0x6daeb0){this['md5']=_0x6daeb0;io['to'](util[_0xad27('0x19')](_0xad27('0x1a'),_0xbe48a7[_0xad27('0x6')]))['emit']('mail_queue:save',_0xbe48a7);}};module[_0xad27('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index cc3e4d5..87110bf 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x7a54,0x106));var _0x47a5=function(_0x96d7f5,_0x5e1938){_0x96d7f5=_0x96d7f5-0x0;var _0x13a6bc=_0x7a54[_0x96d7f5];return _0x13a6bc;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x326f,0xd1));var _0xf326=function(_0x1f1f1f,_0x1302dc){_0x1f1f1f=_0x1f1f1f-0x0;var _0x285267=_0x326f[_0x1f1f1f];return _0x285267;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d303511..e13bbba 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 _0xadb8=['stringify','md5','format','sms:queue:%s','exports','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','prototype','updateRouting','mapAgentsId','_rr','map','Agents','paused','length','loggedIn','smsPause','available'];(function(_0x1b7df0,_0x1b4805){var _0x4d89f8=function(_0x49f725){while(--_0x49f725){_0x1b7df0['push'](_0x1b7df0['shift']());}};_0x4d89f8(++_0x1b4805);}(_0xadb8,0x1d0));var _0x8adb=function(_0x68a0b0,_0x2bba91){_0x68a0b0=_0x68a0b0-0x0;var _0x4b4ee6=_0xadb8[_0x68a0b0];return _0x4b4ee6;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x8adb('0x0'));var Redis=require('ioredis');var config=require(_0x8adb('0x1'));config[_0x8adb('0x2')]=_[_0x8adb('0x3')](config[_0x8adb('0x2')],{'host':_0x8adb('0x4'),'port':0x18eb});var io=require(_0x8adb('0x5'))(new Redis(config[_0x8adb('0x2')]));function SmsQueue(_0x5686b7){this['id']=_0x5686b7['id']||0x0;this[_0x8adb('0x6')]=_0x5686b7[_0x8adb('0x6')]||'';this[_0x8adb('0x7')]=_0x5686b7[_0x8adb('0x7')]||0xa;this[_0x8adb('0x8')]=_0x5686b7[_0x8adb('0x8')]||_0x8adb('0x9');this['Agents']=_0x5686b7['Agents'];this['mapAgentsId']={};this[_0x8adb('0xa')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x8adb('0xb')][_0x8adb('0xc')]=function(){var _0x46c6fb=this[_0x8adb('0xd')][_0x8adb('0xe')];this[_0x8adb('0xd')]=_[_0x8adb('0xf')](this[_0x8adb('0x10')],'id');this[_0x8adb('0xd')][_0x8adb('0xe')]=_0x46c6fb;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x8adb('0x11')]=0x0;for(var _0x4ff3c3=0x0;_0x4ff3c3=0x0?this['available']:0x0;var _0x5a0e22={'id':this['id'],'available':this[_0x8adb('0x15')],'loggedIn':this[_0x8adb('0x13')],'name':this[_0x8adb('0x6')],'paused':this[_0x8adb('0x11')],'waiting':this[_0x8adb('0xa')]};var _0x3c1720=md5(JSON[_0x8adb('0x16')](_0x5a0e22));if(this[_0x8adb('0x17')]!==_0x3c1720){this[_0x8adb('0x17')]=_0x3c1720;io['to'](util[_0x8adb('0x18')](_0x8adb('0x19'),_0x5a0e22[_0x8adb('0x6')]))['emit']('sms_queue:save',_0x5a0e22);}};module[_0x8adb('0x1a')]=SmsQueue; \ No newline at end of file +var _0xb2b3=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x49c351,_0x104b09){var _0x1fb07c=function(_0x3eca6a){while(--_0x3eca6a){_0x49c351['push'](_0x49c351['shift']());}};_0x1fb07c(++_0x104b09);}(_0xb2b3,0x71));var _0x3b2b=function(_0x30b29c,_0x10f252){_0x30b29c=_0x30b29c-0x0;var _0x1e05f7=_0xb2b3[_0x30b29c];return _0x1e05f7;};'use strict';var _=require(_0x3b2b('0x0'));var md5=require(_0x3b2b('0x1'));var util=require(_0x3b2b('0x2'));var Redis=require(_0x3b2b('0x3'));var config=require(_0x3b2b('0x4'));config[_0x3b2b('0x5')]=_[_0x3b2b('0x6')](config['redis'],{'host':_0x3b2b('0x7'),'port':0x18eb});var io=require(_0x3b2b('0x8'))(new Redis(config[_0x3b2b('0x5')]));function SmsQueue(_0x45e179){this['id']=_0x45e179['id']||0x0;this[_0x3b2b('0x9')]=_0x45e179[_0x3b2b('0x9')]||'';this[_0x3b2b('0xa')]=_0x45e179[_0x3b2b('0xa')]||0xa;this[_0x3b2b('0xb')]=_0x45e179[_0x3b2b('0xb')]||_0x3b2b('0xc');this[_0x3b2b('0xd')]=_0x45e179['Agents'];this[_0x3b2b('0xe')]={};this[_0x3b2b('0xf')]=0x0;this[_0x3b2b('0x1')]='';this[_0x3b2b('0x10')]();this[_0x3b2b('0x11')]();}SmsQueue[_0x3b2b('0x12')]['updateRouting']=function(){var _0x492f5f=this[_0x3b2b('0xe')][_0x3b2b('0x13')];this[_0x3b2b('0xe')]=_[_0x3b2b('0x14')](this['Agents'],'id');this[_0x3b2b('0xe')][_0x3b2b('0x13')]=_0x492f5f;};SmsQueue[_0x3b2b('0x12')][_0x3b2b('0x11')]=function(){this[_0x3b2b('0x15')]=0x0;this[_0x3b2b('0x16')]=0x0;for(var _0x52b63f=0x0;_0x52b63f=0x0?this[_0x3b2b('0x19')]:0x0;var _0x52bba5={'id':this['id'],'available':this[_0x3b2b('0x19')],'loggedIn':this[_0x3b2b('0x15')],'name':this['name'],'paused':this[_0x3b2b('0x16')],'waiting':this['waiting']};var _0x26f83=md5(JSON[_0x3b2b('0x1a')](_0x52bba5));if(this['md5']!==_0x26f83){this['md5']=_0x26f83;io['to'](util[_0x3b2b('0x1b')](_0x3b2b('0x1c'),_0x52bba5[_0x3b2b('0x9')]))[_0x3b2b('0x1d')](_0x3b2b('0x1e'),_0x52bba5);}};module[_0x3b2b('0x1f')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index f369d8f..7cabb6e 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 _0xe7e9=['ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','paused','Agents','length','online','loggedIn','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util'];(function(_0x3dff1d,_0x68ad0e){var _0x30e17a=function(_0xf82b28){while(--_0xf82b28){_0x3dff1d['push'](_0x3dff1d['shift']());}};_0x30e17a(++_0x68ad0e);}(_0xe7e9,0x1ae));var _0x9e7e=function(_0x1254c8,_0x34e836){_0x1254c8=_0x1254c8-0x0;var _0x4c2496=_0xe7e9[_0x1254c8];return _0x4c2496;};'use strict';var _=require(_0x9e7e('0x0'));var md5=require('md5');var util=require(_0x9e7e('0x1'));var Redis=require(_0x9e7e('0x2'));var config=require(_0x9e7e('0x3'));config[_0x9e7e('0x4')]=_[_0x9e7e('0x5')](config[_0x9e7e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9e7e('0x6'))(new Redis(config[_0x9e7e('0x4')]));function WhatsappQueue(_0x410122){this['id']=_0x410122['id']||0x0;this['name']=_0x410122[_0x9e7e('0x7')]||'';this[_0x9e7e('0x8')]=_0x410122[_0x9e7e('0x8')]||0xa;this[_0x9e7e('0x9')]=_0x410122[_0x9e7e('0x9')]||'beepall';this['Agents']=_0x410122['Agents'];this[_0x9e7e('0xa')]={};this[_0x9e7e('0xb')]=0x0;this[_0x9e7e('0xc')]='';this[_0x9e7e('0xd')]();this[_0x9e7e('0xe')]();}WhatsappQueue['prototype'][_0x9e7e('0xd')]=function(){var _0x3b672b=this[_0x9e7e('0xa')]['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x9e7e('0xa')]['_rr']=_0x3b672b;};WhatsappQueue[_0x9e7e('0xf')][_0x9e7e('0xe')]=function(){this['loggedIn']=0x0;this[_0x9e7e('0x10')]=0x0;for(var _0x42c760=0x0;_0x42c760=0x0?this[_0x9e7e('0x15')]:0x0;var _0x733480={'id':this['id'],'available':this[_0x9e7e('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x9e7e('0x7')],'paused':this[_0x9e7e('0x10')],'waiting':this[_0x9e7e('0xb')]};var _0x1bd48d=md5(JSON['stringify'](_0x733480));if(this['md5']!==_0x1bd48d){this['md5']=_0x1bd48d;io['to'](util[_0x9e7e('0x16')](_0x9e7e('0x17'),_0x733480['name']))[_0x9e7e('0x18')](_0x9e7e('0x19'),_0x733480);}};module[_0x9e7e('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x09c7=['localhost','socket.io-emitter','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','length','loggedIn','paused','available','name','stringify','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09c7,0xd2));var _0x709c=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x09c7[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x709c('0x0'));var md5=require(_0x709c('0x1'));var util=require(_0x709c('0x2'));var Redis=require('ioredis');var config=require(_0x709c('0x3'));config[_0x709c('0x4')]=_[_0x709c('0x5')](config[_0x709c('0x4')],{'host':_0x709c('0x6'),'port':0x18eb});var io=require(_0x709c('0x7'))(new Redis(config[_0x709c('0x4')]));function WhatsappQueue(_0x4dc74d){this['id']=_0x4dc74d['id']||0x0;this['name']=_0x4dc74d['name']||'';this['timeout']=_0x4dc74d['timeout']||0xa;this[_0x709c('0x8')]=_0x4dc74d[_0x709c('0x8')]||_0x709c('0x9');this[_0x709c('0xa')]=_0x4dc74d['Agents'];this[_0x709c('0xb')]={};this[_0x709c('0xc')]=0x0;this[_0x709c('0x1')]='';this[_0x709c('0xd')]();this[_0x709c('0xe')]();}WhatsappQueue['prototype'][_0x709c('0xd')]=function(){var _0x38ad79=this['mapAgentsId'][_0x709c('0xf')];this[_0x709c('0xb')]=_[_0x709c('0x10')](this['Agents'],'id');this[_0x709c('0xb')]['_rr']=_0x38ad79;};WhatsappQueue[_0x709c('0x11')][_0x709c('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x59a0f4=0x0;_0x59a0f4=0x0?this[_0x709c('0x15')]:0x0;var _0x35175f={'id':this['id'],'available':this[_0x709c('0x15')],'loggedIn':this[_0x709c('0x13')],'name':this[_0x709c('0x16')],'paused':this[_0x709c('0x14')],'waiting':this['waiting']};var _0x349ee3=md5(JSON[_0x709c('0x17')](_0x35175f));if(this[_0x709c('0x1')]!==_0x349ee3){this[_0x709c('0x1')]=_0x349ee3;io['to'](util['format']('whatsapp:queue:%s',_0x35175f['name']))[_0x709c('0x18')](_0x709c('0x19'),_0x35175f);}};module[_0x709c('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f31d3d3..10d27fe 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x9613c6,_0x53b76c){var _0x130cca=function(_0x40bbdb){while(--_0x40bbdb){_0x9613c6['push'](_0x9613c6['shift']());}};_0x130cca(++_0x53b76c);}(_0xb10b,0x12a));var _0xbb10=function(_0xce4604,_0x5e98ad){_0xce4604=_0xce4604-0x0;var _0x474352=_0xb10b[_0xce4604];return _0x474352;};'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 a014627..c7a888e 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 _0x4572=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3de33a,_0x4bb808){var _0x5a9e6b=function(_0x142dae){while(--_0x142dae){_0x3de33a['push'](_0x3de33a['shift']());}};_0x5a9e6b(++_0x4bb808);}(_0x4572,0x1c2));var _0x2457=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x4572[_0x37756b];return _0x46efec;};'use strict';var client=require('../client');exports[_0x2457('0x0')]=function(_0x432bb1,_0x2625ba){return client[_0x2457('0x1')](_0x2457('0x2'),{'body':_0x2625ba,'options':{'where':{'id':_0x432bb1}},'log':'updateChatInteraction'});};exports[_0x2457('0x3')]=function(_0x3ed6ba,_0x3a5c2c){return client[_0x2457('0x1')](_0x2457('0x4'),{'body':_0x3a5c2c,'options':{'where':{'id':_0x3ed6ba}},'log':_0x2457('0x5')});}; \ No newline at end of file +var _0x6ff3=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','AddTagsToChatInteraction'];(function(_0x5ddbc6,_0x49b8f4){var _0x5ca38f=function(_0x48f4be){while(--_0x48f4be){_0x5ddbc6['push'](_0x5ddbc6['shift']());}};_0x5ca38f(++_0x49b8f4);}(_0x6ff3,0x1b4));var _0x36ff=function(_0x1ca00f,_0x5ee88b){_0x1ca00f=_0x1ca00f-0x0;var _0x1d336c=_0x6ff3[_0x1ca00f];return _0x1d336c;};'use strict';var client=require(_0x36ff('0x0'));exports['update']=function(_0x47a28f,_0x312106){return client[_0x36ff('0x1')](_0x36ff('0x2'),{'body':_0x312106,'options':{'where':{'id':_0x47a28f}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x453af1,_0x5b6573){return client[_0x36ff('0x1')](_0x36ff('0x3'),{'body':_0x5b6573,'options':{'where':{'id':_0x453af1}},'log':_0x36ff('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index fe1d829..e64cf15 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 _0x0829=['../client','create','Request','createChatMessage'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0829,0x1dc));var _0x9082=function(_0xdf56be,_0x433981){_0xdf56be=_0xdf56be-0x0;var _0x8ebfcc=_0x0829[_0xdf56be];return _0x8ebfcc;};'use strict';var client=require(_0x9082('0x0'));exports[_0x9082('0x1')]=function(_0x54a873){return client[_0x9082('0x2')]('CreateChatMessage',{'body':_0x54a873,'log':_0x9082('0x3')});}; \ No newline at end of file +var _0x8b61=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0x38b396,_0x5353aa){var _0x5daa5f=function(_0x2f4fd3){while(--_0x2f4fd3){_0x38b396['push'](_0x38b396['shift']());}};_0x5daa5f(++_0x5353aa);}(_0x8b61,0x1cb));var _0x18b6=function(_0x287519,_0x19a781){_0x287519=_0x287519-0x0;var _0x3d7c20=_0x8b61[_0x287519];return _0x3d7c20;};'use strict';var client=require(_0x18b6('0x0'));exports['create']=function(_0x3d6d34){return client[_0x18b6('0x1')](_0x18b6('0x2'),{'body':_0x3d6d34,'log':_0x18b6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index fda9984..aac62f7 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 _0x5b5a=['timeout','strategy','User','Agents','online','chatPause','getChatQueues','Request','name'];(function(_0x402d67,_0xfecc59){var _0x473d0e=function(_0x511c2c){while(--_0x511c2c){_0x402d67['push'](_0x402d67['shift']());}};_0x473d0e(++_0xfecc59);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x2d061c,_0x48e86c){_0x2d061c=_0x2d061c-0x0;var _0x2f1dfd=_0x5b5a[_0x2d061c];return _0x2f1dfd;};'use strict';var client=require('../client');exports[_0xa5b5('0x0')]=function(){return function(){return client[_0xa5b5('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xa5b5('0x2'),_0xa5b5('0x3'),_0xa5b5('0x4')],'include':[{'model':_0xa5b5('0x5'),'as':_0xa5b5('0x6'),'attributes':['id',_0xa5b5('0x2'),_0xa5b5('0x7'),_0xa5b5('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xc818=['getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause','../client'];(function(_0x1ff001,_0x2286c9){var _0x312a70=function(_0x1b498b){while(--_0x1b498b){_0x1ff001['push'](_0x1ff001['shift']());}};_0x312a70(++_0x2286c9);}(_0xc818,0x1e3));var _0x8c81=function(_0x489b3c,_0x5a2f09){_0x489b3c=_0x489b3c-0x0;var _0x9366f5=_0xc818[_0x489b3c];return _0x9366f5;};'use strict';var client=require(_0x8c81('0x0'));exports[_0x8c81('0x1')]=function(){return function(){return client[_0x8c81('0x2')](_0x8c81('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8c81('0x4'),_0x8c81('0x5')],'include':[{'model':_0x8c81('0x6'),'as':_0x8c81('0x7'),'attributes':['id',_0x8c81('0x8'),_0x8c81('0x9'),_0x8c81('0xa')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a2c30f4..aaea002 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 _0x9658=['UpdateChatQueueReport','../client','Request','CreateChatQueueReport','DESC'];(function(_0x1fe2bf,_0x3c2a64){var _0x29bc0b=function(_0x4b21c3){while(--_0x4b21c3){_0x1fe2bf['push'](_0x1fe2bf['shift']());}};_0x29bc0b(++_0x3c2a64);}(_0x9658,0x6f));var _0x8965=function(_0x4d7a61,_0x3fb6e6){_0x4d7a61=_0x4d7a61-0x0;var _0x186f73=_0x9658[_0x4d7a61];return _0x186f73;};'use strict';var client=require(_0x8965('0x0'));exports['create']=function(_0x1f5bb6){return client[_0x8965('0x1')]('CreateChatQueueReport',{'body':_0x1f5bb6,'log':_0x8965('0x2')});};exports['update']=function(_0x26d5d2,_0x761b45){return client[_0x8965('0x1')]('UpdateChatQueueReport',{'body':_0x761b45,'options':{'where':{'uniqueid':_0x26d5d2},'order':[['id',_0x8965('0x3')]],'limit':0x1},'log':_0x8965('0x4')});}; \ No newline at end of file +var _0x81d5=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x81d5,0x1ab));var _0x581d=function(_0x2aca1e,_0x32799c){_0x2aca1e=_0x2aca1e-0x0;var _0x6c6c79=_0x81d5[_0x2aca1e];return _0x6c6c79;};'use strict';var client=require(_0x581d('0x0'));exports[_0x581d('0x1')]=function(_0x55fd33){return client[_0x581d('0x2')](_0x581d('0x3'),{'body':_0x55fd33,'log':_0x581d('0x3')});};exports[_0x581d('0x4')]=function(_0x477e28,_0x553617){return client['Request'](_0x581d('0x5'),{'body':_0x553617,'options':{'where':{'uniqueid':_0x477e28},'order':[['id',_0x581d('0x6')]],'limit':0x1},'log':_0x581d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 4700737..e80233e 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x7a54,0x106));var _0x47a5=function(_0x2fbb1b,_0x536762){_0x2fbb1b=_0x2fbb1b-0x0;var _0x4fd8ec=_0x7a54[_0x2fbb1b];return _0x4fd8ec;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x788de2,_0x5da66a){var _0x5bba81=function(_0x156f75){while(--_0x156f75){_0x788de2['push'](_0x788de2['shift']());}};_0x5bba81(++_0x5da66a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a97a5c1..e1c6e6c 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 _0x0303=['../client','CreateFaxMessage','createFaxMessage'];(function(_0x364437,_0x378ace){var _0x50f31a=function(_0x4e65c1){while(--_0x4e65c1){_0x364437['push'](_0x364437['shift']());}};_0x50f31a(++_0x378ace);}(_0x0303,0x1dd));var _0x3030=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x0303[_0x2e2681];return _0x368a64;};'use strict';var client=require(_0x3030('0x0'));exports['create']=function(_0x3b6def){return client['Request'](_0x3030('0x1'),{'body':_0x3b6def,'log':_0x3030('0x2')});}; \ No newline at end of file +var _0x8d9d=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x35d4d4,_0x4fa97d){var _0x145f3b=function(_0x2eeca3){while(--_0x2eeca3){_0x35d4d4['push'](_0x35d4d4['shift']());}};_0x145f3b(++_0x4fa97d);}(_0x8d9d,0x1e6));var _0xd8d9=function(_0x260f7b,_0x55199e){_0x260f7b=_0x260f7b-0x0;var _0x555862=_0x8d9d[_0x260f7b];return _0x555862;};'use strict';var client=require(_0xd8d9('0x0'));exports[_0xd8d9('0x1')]=function(_0x22208c){return client[_0xd8d9('0x2')](_0xd8d9('0x3'),{'body':_0x22208c,'log':_0xd8d9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index f6fbb35..d2e4516 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 _0xa177=['getFaxQueues','name','timeout','strategy','User','faxPause','../client'];(function(_0x1dd289,_0x1e391f){var _0x44f028=function(_0xfb6522){while(--_0xfb6522){_0x1dd289['push'](_0x1dd289['shift']());}};_0x44f028(++_0x1e391f);}(_0xa177,0x18e));var _0x7a17=function(_0x45aeaa,_0x2ac370){_0x45aeaa=_0x45aeaa-0x0;var _0x28fbe4=_0xa177[_0x45aeaa];return _0x28fbe4;};'use strict';var client=require(_0x7a17('0x0'));exports[_0x7a17('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x7a17('0x2'),_0x7a17('0x3'),_0x7a17('0x4')],'include':[{'model':_0x7a17('0x5'),'as':'Agents','attributes':['id',_0x7a17('0x2'),'online',_0x7a17('0x6')]}]},'log':_0x7a17('0x1')});};}; \ No newline at end of file +var _0x3e4a=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','User','Agents','name'];(function(_0x440c9d,_0x4ea95b){var _0x4a6c8a=function(_0x169b61){while(--_0x169b61){_0x440c9d['push'](_0x440c9d['shift']());}};_0x4a6c8a(++_0x4ea95b);}(_0x3e4a,0x91));var _0xa3e4=function(_0x34242a,_0x4e8623){_0x34242a=_0x34242a-0x0;var _0x1d4330=_0x3e4a[_0x34242a];return _0x1d4330;};'use strict';var client=require(_0xa3e4('0x0'));exports[_0xa3e4('0x1')]=function(){return function(){return client[_0xa3e4('0x2')](_0xa3e4('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xa3e4('0x4'),'as':_0xa3e4('0x5'),'attributes':['id',_0xa3e4('0x6'),'online',_0xa3e4('0x7')]}]},'log':_0xa3e4('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 1c6e355..8118a2b 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 _0x78ac=['update','UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport'];(function(_0x1a2d2f,_0x52319f){var _0x1d0459=function(_0x117ea2){while(--_0x117ea2){_0x1a2d2f['push'](_0x1a2d2f['shift']());}};_0x1d0459(++_0x52319f);}(_0x78ac,0xab));var _0xc78a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x78ac[_0x68c979];return _0x4f0001;};'use strict';var client=require(_0xc78a('0x0'));exports['create']=function(_0x12254e){return client[_0xc78a('0x1')](_0xc78a('0x2'),{'body':_0x12254e,'log':_0xc78a('0x2')});};exports[_0xc78a('0x3')]=function(_0x595ad8,_0x318844){return client[_0xc78a('0x1')](_0xc78a('0x4'),{'body':_0x318844,'options':{'where':{'uniqueid':_0x595ad8},'order':[['id',_0xc78a('0x5')]],'limit':0x1},'log':_0xc78a('0x4')});}; \ No newline at end of file +var _0x9636=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9636,0x17a));var _0x6963=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9636[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x6963('0x0'));exports[_0x6963('0x1')]=function(_0x4b622a){return client[_0x6963('0x2')](_0x6963('0x3'),{'body':_0x4b622a,'log':_0x6963('0x3')});};exports[_0x6963('0x4')]=function(_0x2929d4,_0x3c976e){return client[_0x6963('0x2')]('UpdateFaxQueueReport',{'body':_0x3c976e,'options':{'where':{'uniqueid':_0x2929d4},'order':[['id','DESC']],'limit':0x1},'log':_0x6963('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 52917bc..2d5f053 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 _0x1adc=['getIntervals','Request','GetInterval','name','Interval','Intervals','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1adc,0x1a3));var _0xc1ad=function(_0x554096,_0x1ba8fe){_0x554096=_0x554096-0x0;var _0x39a19e=_0x1adc[_0x554096];return _0x39a19e;};'use strict';var client=require(_0xc1ad('0x0'));exports[_0xc1ad('0x1')]=function(){return function(){return client[_0xc1ad('0x2')](_0xc1ad('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc1ad('0x4')],'include':[{'model':_0xc1ad('0x5'),'as':_0xc1ad('0x6'),'attributes':['id',_0xc1ad('0x4'),'interval']}]},'log':_0xc1ad('0x1')});};}; \ No newline at end of file +var _0xae71=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xae71,0x164));var _0x1ae7=function(_0x29f834,_0x3f4057){_0x29f834=_0x29f834-0x0;var _0x54e72d=_0xae71[_0x29f834];return _0x54e72d;};'use strict';var client=require(_0x1ae7('0x0'));exports[_0x1ae7('0x1')]=function(){return function(){return client[_0x1ae7('0x2')](_0x1ae7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1ae7('0x4')],'include':[{'model':_0x1ae7('0x5'),'as':_0x1ae7('0x6'),'attributes':['id','name',_0x1ae7('0x7')]}]},'log':_0x1ae7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 8656947..d84a7f2 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 _0x0120=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x7af4da,_0x524020){var _0x1dcd14=function(_0x11ac91){while(--_0x11ac91){_0x7af4da['push'](_0x7af4da['shift']());}};_0x1dcd14(++_0x524020);}(_0x0120,0x6f));var _0x0012=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0120[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x0012('0x0'));exports[_0x0012('0x1')]=function(_0x3d23e7,_0xb8d57c){return client[_0x0012('0x2')](_0x0012('0x3'),{'body':_0xb8d57c,'options':{'where':{'id':_0x3d23e7}},'log':_0x0012('0x4')});};exports[_0x0012('0x5')]=function(_0x357f77,_0x302029){return client[_0x0012('0x2')](_0x0012('0x6'),{'body':_0x302029,'options':{'where':{'id':_0x357f77}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x5f66=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x20bd63,_0x4e0a76){var _0x5ad21c=function(_0xd2e465){while(--_0xd2e465){_0x20bd63['push'](_0x20bd63['shift']());}};_0x5ad21c(++_0x4e0a76);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var client=require('../client');exports[_0x65f6('0x0')]=function(_0x4a3887,_0x2d5fd9){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'body':_0x2d5fd9,'options':{'where':{'id':_0x4a3887}},'log':_0x65f6('0x3')});};exports[_0x65f6('0x4')]=function(_0x5eb9ad,_0x3c5029){return client['Request'](_0x65f6('0x5'),{'body':_0x3c5029,'options':{'where':{'id':_0x5eb9ad}},'log':_0x65f6('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 37a7162..c6e5e5d 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 _0x212d=['../client','create','Request','CreateMailMessage'];(function(_0x5db303,_0x2d3279){var _0x37507a=function(_0x4c52e8){while(--_0x4c52e8){_0x5db303['push'](_0x5db303['shift']());}};_0x37507a(++_0x2d3279);}(_0x212d,0xdc));var _0xd212=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x212d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd212('0x0'));exports[_0xd212('0x1')]=function(_0x49b56d){return client[_0xd212('0x2')](_0xd212('0x3'),{'body':_0x49b56d,'log':'createMailMessage'});}; \ No newline at end of file +var _0x9267=['create','CreateMailMessage','createMailMessage'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x9267,0x117));var _0x7926=function(_0x48a236,_0x4256f1){_0x48a236=_0x48a236-0x0;var _0xa7c2be=_0x9267[_0x48a236];return _0xa7c2be;};'use strict';var client=require('../client');exports[_0x7926('0x0')]=function(_0x5ceda9){return client['Request'](_0x7926('0x1'),{'body':_0x5ceda9,'log':_0x7926('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 8409357..9ebd9f2 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 _0xb3ab=['mailPause','Request','strategy','User','name','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3ab,0x17b));var _0xbb3a=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xb3ab[_0x292f93];return _0x5a94b1;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xbb3a('0x0')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xbb3a('0x1')],'include':[{'model':_0xbb3a('0x2'),'as':'Agents','attributes':['id',_0xbb3a('0x3'),_0xbb3a('0x4'),_0xbb3a('0x5')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x162a=['name','strategy','User','Agents','../client','getMailQueues','Request','GetMailQueue'];(function(_0x81e6e,_0x37a805){var _0x3049c7=function(_0x25684f){while(--_0x25684f){_0x81e6e['push'](_0x81e6e['shift']());}};_0x3049c7(++_0x37a805);}(_0x162a,0x9c));var _0xa162=function(_0x3cc8ae,_0x5a5724){_0x3cc8ae=_0x3cc8ae-0x0;var _0x3d42e6=_0x162a[_0x3cc8ae];return _0x3d42e6;};'use strict';var client=require(_0xa162('0x0'));exports[_0xa162('0x1')]=function(){return function(){return client[_0xa162('0x2')](_0xa162('0x3'),{'options':{'raw':![],'attributes':['id',_0xa162('0x4'),'timeout',_0xa162('0x5')],'include':[{'model':_0xa162('0x6'),'as':_0xa162('0x7'),'attributes':['id',_0xa162('0x4'),'online','mailPause']}]},'log':_0xa162('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 427d74a..fcc095f 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 _0xe407=['update','UpdateMailQueueReport','../client','Request','CreateMailQueueReport'];(function(_0x281304,_0x2d9eb0){var _0x342983=function(_0x316d6f){while(--_0x316d6f){_0x281304['push'](_0x281304['shift']());}};_0x342983(++_0x2d9eb0);}(_0xe407,0x156));var _0x7e40=function(_0x29562a,_0x7a5241){_0x29562a=_0x29562a-0x0;var _0x2bb15f=_0xe407[_0x29562a];return _0x2bb15f;};'use strict';var client=require(_0x7e40('0x0'));exports['create']=function(_0x31ae28){return client[_0x7e40('0x1')]('CreateMailQueueReport',{'body':_0x31ae28,'log':_0x7e40('0x2')});};exports[_0x7e40('0x3')]=function(_0x5d0864,_0x1af302){return client[_0x7e40('0x1')]('UpdateMailQueueReport',{'body':_0x1af302,'options':{'where':{'uniqueid':_0x5d0864},'order':[['id','DESC']],'limit':0x1},'log':_0x7e40('0x4')});}; \ No newline at end of file +var _0xcd3c=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x485eb2,_0x309eae){var _0x4ee062=function(_0xc9dfa7){while(--_0xc9dfa7){_0x485eb2['push'](_0x485eb2['shift']());}};_0x4ee062(++_0x309eae);}(_0xcd3c,0x1a3));var _0xccd3=function(_0x452f80,_0x39b561){_0x452f80=_0x452f80-0x0;var _0x32d9b5=_0xcd3c[_0x452f80];return _0x32d9b5;};'use strict';var client=require(_0xccd3('0x0'));exports[_0xccd3('0x1')]=function(_0x21c522){return client[_0xccd3('0x2')](_0xccd3('0x3'),{'body':_0x21c522,'log':_0xccd3('0x3')});};exports[_0xccd3('0x4')]=function(_0x97dbcd,_0x1f54bd){return client['Request'](_0xccd3('0x5'),{'body':_0x1f54bd,'options':{'where':{'uniqueid':_0x97dbcd},'order':[['id',_0xccd3('0x6')]],'limit':0x1},'log':_0xccd3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 30ce46a..eab9088 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 _0x8d8c=['Request','addTags','update'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x8d8c,0x1a9));var _0xc8d8=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0x8d8c[_0x4ea413];return _0x51cf25;};'use strict';var client=require('../client');exports[_0xc8d8('0x0')]=function(_0x251897,_0x4a729c){return client[_0xc8d8('0x1')]('UpdateOpenchannelInteraction',{'body':_0x4a729c,'options':{'where':{'id':_0x251897}},'log':'updateOpenchannelInteraction'});};exports[_0xc8d8('0x2')]=function(_0x285120,_0x327cc2){return client[_0xc8d8('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x327cc2,'options':{'where':{'id':_0x285120}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xf314=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x9f373a,_0x50e482){var _0x5084f6=function(_0x5d92b0){while(--_0x5d92b0){_0x9f373a['push'](_0x9f373a['shift']());}};_0x5084f6(++_0x50e482);}(_0xf314,0x109));var _0x4f31=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xf314[_0x1d9aa0];return _0x226868;};'use strict';var client=require(_0x4f31('0x0'));exports['update']=function(_0x5078f7,_0x11f443){return client[_0x4f31('0x1')](_0x4f31('0x2'),{'body':_0x11f443,'options':{'where':{'id':_0x5078f7}},'log':'updateOpenchannelInteraction'});};exports[_0x4f31('0x3')]=function(_0x45c61f,_0x4f6aec){return client[_0x4f31('0x1')](_0x4f31('0x4'),{'body':_0x4f6aec,'options':{'where':{'id':_0x45c61f}},'log':_0x4f31('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 1c16cbc..eebd394 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 _0xea58=['Request','create'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0xea58,0x147));var _0x8ea5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea58[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x8ea5('0x0')]=function(_0x3aa126){return client[_0x8ea5('0x1')]('CreateOpenchannelMessage',{'body':_0x3aa126,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xd414=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0xd414,0x1f2));var _0x4d41=function(_0x1088b0,_0x17f2e8){_0x1088b0=_0x1088b0-0x0;var _0x4e6595=_0xd414[_0x1088b0];return _0x4e6595;};'use strict';var client=require(_0x4d41('0x0'));exports[_0x4d41('0x1')]=function(_0x507e29){return client[_0x4d41('0x2')](_0x4d41('0x3'),{'body':_0x507e29,'log':_0x4d41('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 4c1ab18..ee92c73 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 _0x97b3=['strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97b3,0x70));var _0x397b=function(_0x10ee04,_0x53b880){_0x10ee04=_0x10ee04-0x0;var _0x4f47e=_0x97b3[_0x10ee04];return _0x4f47e;};'use strict';var client=require(_0x397b('0x0'));exports[_0x397b('0x1')]=function(){return function(){return client['Request'](_0x397b('0x2'),{'options':{'raw':![],'attributes':['id',_0x397b('0x3'),_0x397b('0x4'),_0x397b('0x5')],'include':[{'model':_0x397b('0x6'),'as':_0x397b('0x7'),'attributes':['id',_0x397b('0x3'),'online',_0x397b('0x8')]}]},'log':_0x397b('0x1')});};}; \ No newline at end of file +var _0xd5d8=['name','timeout','strategy','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xd5d8,0x1a3));var _0x8d5d=function(_0x1b6ead,_0x42141c){_0x1b6ead=_0x1b6ead-0x0;var _0x4a29cc=_0xd5d8[_0x1b6ead];return _0x4a29cc;};'use strict';var client=require(_0x8d5d('0x0'));exports[_0x8d5d('0x1')]=function(){return function(){return client[_0x8d5d('0x2')](_0x8d5d('0x3'),{'options':{'raw':![],'attributes':['id',_0x8d5d('0x4'),_0x8d5d('0x5'),_0x8d5d('0x6')],'include':[{'model':'User','as':_0x8d5d('0x7'),'attributes':['id',_0x8d5d('0x4'),'online',_0x8d5d('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b0679f9..cddfa72 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 _0xa8f6=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xa8f6,0x1d3));var _0x6a8f=function(_0x565bb5,_0x236880){_0x565bb5=_0x565bb5-0x0;var _0x5bb413=_0xa8f6[_0x565bb5];return _0x5bb413;};'use strict';var client=require(_0x6a8f('0x0'));exports[_0x6a8f('0x1')]=function(_0x3024d5){return client[_0x6a8f('0x2')](_0x6a8f('0x3'),{'body':_0x3024d5,'log':_0x6a8f('0x3')});};exports[_0x6a8f('0x4')]=function(_0x526e71,_0x11cf1a){return client[_0x6a8f('0x2')](_0x6a8f('0x5'),{'body':_0x11cf1a,'options':{'where':{'uniqueid':_0x526e71},'order':[['id',_0x6a8f('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xa30e=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa30e,0x117));var _0xea30=function(_0x598408,_0x5e6f74){_0x598408=_0x598408-0x0;var _0x560720=_0xa30e[_0x598408];return _0x560720;};'use strict';var client=require(_0xea30('0x0'));exports[_0xea30('0x1')]=function(_0x411f88){return client[_0xea30('0x2')](_0xea30('0x3'),{'body':_0x411f88,'log':_0xea30('0x3')});};exports['update']=function(_0x5c10c5,_0x4e6f0c){return client[_0xea30('0x2')](_0xea30('0x4'),{'body':_0x4e6f0c,'options':{'where':{'uniqueid':_0x5c10c5},'order':[['id',_0xea30('0x5')]],'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 d431421..3d81fe6 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 _0xadec=['../client','update','Request'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0xadec,0x156));var _0xcade=function(_0x3aeae1,_0x861450){_0x3aeae1=_0x3aeae1-0x0;var _0x5b0a8f=_0xadec[_0x3aeae1];return _0x5b0a8f;};'use strict';var client=require(_0xcade('0x0'));exports[_0xcade('0x1')]=function(_0x11d900,_0x210817){return client[_0xcade('0x2')]('UpdateSmsInteraction',{'body':_0x210817,'options':{'where':{'id':_0x11d900}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x475533,_0x875b81){return client[_0xcade('0x2')]('AddTagsToSmsInteraction',{'body':_0x875b81,'options':{'where':{'id':_0x475533}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xaf9b=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x167078,_0x29aa83){var _0x3fa613=function(_0x312a3f){while(--_0x312a3f){_0x167078['push'](_0x167078['shift']());}};_0x3fa613(++_0x29aa83);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x475d75,_0x358ccb){_0x475d75=_0x475d75-0x0;var _0x172fe7=_0xaf9b[_0x475d75];return _0x172fe7;};'use strict';var client=require(_0xbaf9('0x0'));exports['update']=function(_0x2c58cf,_0x58d1a2){return client[_0xbaf9('0x1')](_0xbaf9('0x2'),{'body':_0x58d1a2,'options':{'where':{'id':_0x2c58cf}},'log':_0xbaf9('0x3')});};exports[_0xbaf9('0x4')]=function(_0x512b7c,_0x64585f){return client[_0xbaf9('0x1')](_0xbaf9('0x5'),{'body':_0x64585f,'options':{'where':{'id':_0x512b7c}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 018875e..c81b7e8 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 _0x9a19=['createSmsMessage','Request','CreateSmsMessage'];(function(_0x77c24b,_0x2938f2){var _0x36f57b=function(_0x4335a4){while(--_0x4335a4){_0x77c24b['push'](_0x77c24b['shift']());}};_0x36f57b(++_0x2938f2);}(_0x9a19,0xd9));var _0x99a1=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x9a19[_0x5a95fa];return _0x1a61b8;};'use strict';var client=require('../client');exports['create']=function(_0x280f0c){return client[_0x99a1('0x0')](_0x99a1('0x1'),{'body':_0x280f0c,'log':_0x99a1('0x2')});}; \ No newline at end of file +var _0x8825=['CreateSmsMessage','create','Request'];(function(_0x33a61a,_0x106e32){var _0x7c2dfd=function(_0x2f0acc){while(--_0x2f0acc){_0x33a61a['push'](_0x33a61a['shift']());}};_0x7c2dfd(++_0x106e32);}(_0x8825,0x121));var _0x5882=function(_0x5561d9,_0x25d12e){_0x5561d9=_0x5561d9-0x0;var _0x32d977=_0x8825[_0x5561d9];return _0x32d977;};'use strict';var client=require('../client');exports[_0x5882('0x0')]=function(_0x2476d0){return client[_0x5882('0x1')](_0x5882('0x2'),{'body':_0x2476d0,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 609275c..1abd41e 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5ac2ef,_0xf9d9f7){var _0x581d33=function(_0xdb05a1){while(--_0xdb05a1){_0x5ac2ef['push'](_0x5ac2ef['shift']());}};_0x581d33(++_0xf9d9f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d4da14e..9fb1a9d 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(_0x429adb,_0x500ab7){var _0x2cbbf7=function(_0x1573c5){while(--_0x1573c5){_0x429adb['push'](_0x429adb['shift']());}};_0x2cbbf7(++_0x500ab7);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2bcd2c,_0xd808d1){var _0x2cbac0=function(_0x1ab868){while(--_0x1ab868){_0x2bcd2c['push'](_0x2bcd2c['shift']());}};_0x2cbac0(++_0xd808d1);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8478c59..6ab2cec 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(_0x187928,_0x9317c5){var _0x15bf45=function(_0xd0593e){while(--_0xd0593e){_0x187928['push'](_0x187928['shift']());}};_0x15bf45(++_0x9317c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x18fb25,_0x24e26c){var _0xb6222d=function(_0x261541){while(--_0x261541){_0x18fb25['push'](_0x18fb25['shift']());}};_0xb6222d(++_0x24e26c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 f92b952..e74fb85 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 _0x4fb4=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request'];(function(_0x2044cb,_0x17bf63){var _0xfa55af=function(_0x20c72b){while(--_0x20c72b){_0x2044cb['push'](_0x2044cb['shift']());}};_0xfa55af(++_0x17bf63);}(_0x4fb4,0x190));var _0x44fb=function(_0x59812f,_0x1ea9ce){_0x59812f=_0x59812f-0x0;var _0x23ec66=_0x4fb4[_0x59812f];return _0x23ec66;};'use strict';var client=require('../client');exports[_0x44fb('0x0')]=function(_0x34418d,_0x343eab){return client[_0x44fb('0x1')](_0x44fb('0x2'),{'body':_0x343eab,'options':{'where':{'id':_0x34418d}},'log':_0x44fb('0x3')});};exports['addTags']=function(_0xec6dce,_0x953327){return client[_0x44fb('0x1')](_0x44fb('0x4'),{'body':_0x953327,'options':{'where':{'id':_0xec6dce}},'log':_0x44fb('0x5')});}; \ No newline at end of file +var _0x5fc3=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0x5fc3[_0x495e9f];return _0xb249d2;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(_0x5a8343,_0x253d6e){return client[_0x35fc('0x2')](_0x35fc('0x3'),{'body':_0x253d6e,'options':{'where':{'id':_0x5a8343}},'log':_0x35fc('0x4')});};exports[_0x35fc('0x5')]=function(_0x5e75e6,_0x2d1404){return client[_0x35fc('0x2')](_0x35fc('0x6'),{'body':_0x2d1404,'options':{'where':{'id':_0x5e75e6}},'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 ec598f3..4ae65bc 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 _0x72ad=['create','Request','createWhatsappMessage','../client'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x72ad,0x1df));var _0xd72a=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x72ad[_0x2053ea];return _0x2232c4;};'use strict';var client=require(_0xd72a('0x0'));exports[_0xd72a('0x1')]=function(_0x2109ac){return client[_0xd72a('0x2')]('CreateWhatsappMessage',{'body':_0x2109ac,'log':_0xd72a('0x3')});}; \ No newline at end of file +var _0xac7e=['create','CreateWhatsappMessage'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xac7e,0xa4));var _0xeac7=function(_0x2614a8,_0x1da5eb){_0x2614a8=_0x2614a8-0x0;var _0x1b3f71=_0xac7e[_0x2614a8];return _0x1b3f71;};'use strict';var client=require('../client');exports[_0xeac7('0x0')]=function(_0x1fa209){return client['Request'](_0xeac7('0x1'),{'body':_0x1fa209,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index e4b0092..4ea17ee 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 _0x2a52=['Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x8c2097,_0xb93698){var _0x46fcaf=function(_0x3be7ac){while(--_0x3be7ac){_0x8c2097['push'](_0x8c2097['shift']());}};_0x46fcaf(++_0xb93698);}(_0x2a52,0x17a));var _0x22a5=function(_0x6b484c,_0x510237){_0x6b484c=_0x6b484c-0x0;var _0x490917=_0x2a52[_0x6b484c];return _0x490917;};'use strict';var client=require(_0x22a5('0x0'));exports[_0x22a5('0x1')]=function(){return function(){return client[_0x22a5('0x2')](_0x22a5('0x3'),{'options':{'raw':![],'attributes':['id',_0x22a5('0x4'),'timeout',_0x22a5('0x5')],'include':[{'model':_0x22a5('0x6'),'as':_0x22a5('0x7'),'attributes':['id',_0x22a5('0x4'),_0x22a5('0x8'),_0x22a5('0x9')]}]},'log':_0x22a5('0x1')});};}; \ No newline at end of file +var _0x1827=['name','timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x3edfe4,_0x3301ef){var _0x44572b=function(_0x33b5a0){while(--_0x33b5a0){_0x3edfe4['push'](_0x3edfe4['shift']());}};_0x44572b(++_0x3301ef);}(_0x1827,0xcf));var _0x7182=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1827[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x7182('0x0'));exports[_0x7182('0x1')]=function(){return function(){return client['Request'](_0x7182('0x2'),{'options':{'raw':![],'attributes':['id',_0x7182('0x3'),_0x7182('0x4'),_0x7182('0x5')],'include':[{'model':_0x7182('0x6'),'as':_0x7182('0x7'),'attributes':['id',_0x7182('0x3'),_0x7182('0x8'),_0x7182('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 66109b2..8672cf9 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 _0xc2d1=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x2dca25,_0x2e8c24){var _0x299247=function(_0x1baac3){while(--_0x1baac3){_0x2dca25['push'](_0x2dca25['shift']());}};_0x299247(++_0x2e8c24);}(_0xc2d1,0x16c));var _0x1c2d=function(_0x5128f4,_0x255858){_0x5128f4=_0x5128f4-0x0;var _0x13ea68=_0xc2d1[_0x5128f4];return _0x13ea68;};'use strict';var client=require(_0x1c2d('0x0'));exports['create']=function(_0x53dd64){return client[_0x1c2d('0x1')]('CreateWhatsappQueueReport',{'body':_0x53dd64,'log':_0x1c2d('0x2')});};exports[_0x1c2d('0x3')]=function(_0x2c5b62,_0x1e03ff){return client[_0x1c2d('0x1')](_0x1c2d('0x4'),{'body':_0x1e03ff,'options':{'where':{'uniqueid':_0x2c5b62},'order':[['id',_0x1c2d('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xfa48=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x30bf6b,_0x22ca9b){var _0x6b6bed=function(_0x3b5031){while(--_0x3b5031){_0x30bf6b['push'](_0x30bf6b['shift']());}};_0x6b6bed(++_0x22ca9b);}(_0xfa48,0x146));var _0x8fa4=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xfa48[_0xf0bcac];return _0x4e4c65;};'use strict';var client=require(_0x8fa4('0x0'));exports[_0x8fa4('0x1')]=function(_0x4ecac3){return client[_0x8fa4('0x2')](_0x8fa4('0x3'),{'body':_0x4ecac3,'log':_0x8fa4('0x3')});};exports['update']=function(_0x33fc1d,_0x3308ff){return client[_0x8fa4('0x2')](_0x8fa4('0x4'),{'body':_0x3308ff,'options':{'where':{'uniqueid':_0x33fc1d},'order':[['id',_0x8fa4('0x5')]],'limit':0x1},'log':_0x8fa4('0x4')});}; \ 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 e310070..9f537b1 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 _0x8ea5=['map','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','stack','validate','lodash','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s'];(function(_0x5ab5cd,_0x44a06d){var _0x59a4ad=function(_0x5dd8a9){while(--_0x5dd8a9){_0x5ab5cd['push'](_0x5ab5cd['shift']());}};_0x59a4ad(++_0x44a06d);}(_0x8ea5,0x9a));var _0x58ea=function(_0x2ca11f,_0x12705c){_0x2ca11f=_0x2ca11f-0x0;var _0x12af9b=_0x8ea5[_0x2ca11f];return _0x12af9b;};'use strict';var schema=require(_0x58ea('0x0'));var _=require(_0x58ea('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x58ea('0x2'))(_0x58ea('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x58ea('0x4'),'required':!![],'message':_0x58ea('0x5')},'timeout':{'type':_0x58ea('0x6'),'message':_0x58ea('0x7')}});function writeLog(_0x288ef1,_0x4e4fbd,_0x2f78cf){return logger[_0x58ea('0x8')](util[_0x58ea('0x9')](_0x58ea('0xa'),_0x288ef1,_0x4e4fbd['name'],_0x2f78cf));}function handleFindAgent(_0x251e13){return function(_0xa46936){return _0xa46936[_0x58ea('0xb')][_0x58ea('0xc')]()===_0x251e13['toLowerCase']();};}exports[_0x58ea('0xd')]=function(_0x362578,_0x4fd3e0,_0x22d352,_0x151316){return function(_0xa3d90b){try{var _0x6a82a7={'name':_0x4fd3e0[0x0],'timeout':_0x4fd3e0[0x1]};var _0x7d029a=queue[_0x58ea('0x0')](_0x6a82a7,{'typecast':!![]});if(_0x7d029a['length']){logger[_0x58ea('0xe')](_0x58ea('0xf'),_0x362578,_[_0x58ea('0x10')](_0x7d029a,'message')[_0x58ea('0x11')](',\x20'));_0xa3d90b[_0x58ea('0x12')]();}else{var _0x24b99c=_[_0x58ea('0x13')](_0x22d352[_0x58ea('0x14')],handleFindAgent(_0x6a82a7[_0x58ea('0xb')]));if(_0x24b99c){var _0x2573e3=(_0x6a82a7[_0x58ea('0x15')]||0xa)*0x3e8;var _0x370e56,_0x9b4bb6;var _0x5875a5=seqqueue[_0x58ea('0x16')](_0x2573e3);_0x5875a5['id']=_0x362578;_0x5875a5[_0x58ea('0x17')]=_0x2573e3;_0x5875a5[_0x58ea('0x18')]=_0x151316[_0x58ea('0x18')];writeLog(_0x362578,_0x24b99c,util[_0x58ea('0x9')](_0x58ea('0x19'),_0x2573e3));_0x22d352[_0x58ea('0x1a')][_0x362578]['on']('end',function(){logger['info'](_0x58ea('0x1b'),_0x362578);clearTimeout(_0x9b4bb6);_0x9b4bb6=undefined;_0x5875a5[_0x58ea('0x1c')]();if(_0x22d352[_0x58ea('0x1a')][_0x362578]){delete _0x22d352[_0x58ea('0x1a')][_0x362578];}_0xa3d90b['stop']();});_0x22d352[_0x58ea('0x1a')][_0x362578]['on'](_0x58ea('0x1d'),function(){if(_0x22d352[_0x58ea('0x1a')][_0x362578]){delete _0x22d352[_0x58ea('0x1a')][_0x362578];}});_0x9b4bb6=setTimeout(function(){logger['info'](_0x58ea('0x1e'),_0x362578);clearTimeout(_0x9b4bb6);_0x5875a5[_0x58ea('0x1c')]();_0xa3d90b[_0x58ea('0x1f')]();},_0x2573e3);strategy[_0x58ea('0x20')](_0x5875a5,_0x24b99c,_0x22d352,_0x151316);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x362578,_0x6a82a7[_0x58ea('0xb')]);_0xa3d90b['stop']();}}}catch(_0x2b3dc1){console['log'](_0x2b3dc1);logger['error']('[%s][QUEUE]\x20%s',_0x362578,_0x2b3dc1[_0x58ea('0x21')]);_0xa3d90b[_0x58ea('0x12')]();}};}; \ No newline at end of file +var _0x431e=['lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','message','join','stop','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','log','validate'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x431e,0x12b));var _0xe431=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x431e[_0x2f6541];return _0x4d76d8;};'use strict';var schema=require(_0xe431('0x0'));var _=require(_0xe431('0x1'));var util=require(_0xe431('0x2'));var seqqueue=require(_0xe431('0x3'));var logger=require(_0xe431('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xe431('0x5')},'timeout':{'type':'number','message':_0xe431('0x6')}});function writeLog(_0x5ccff5,_0xb01210,_0x55c9f3){return logger['info'](util[_0xe431('0x7')](_0xe431('0x8'),_0x5ccff5,_0xb01210[_0xe431('0x9')],_0x55c9f3));}function handleFindAgent(_0x155da8){return function(_0x23a0f0){return _0x23a0f0['name'][_0xe431('0xa')]()===_0x155da8[_0xe431('0xa')]();};}exports[_0xe431('0xb')]=function(_0x3fb7b0,_0x4df4f0,_0x5af92b,_0x1e1a36){return function(_0x11d8f8){try{var _0x57b5d8={'name':_0x4df4f0[0x0],'timeout':_0x4df4f0[0x1]};var _0x217385=queue[_0xe431('0x0')](_0x57b5d8,{'typecast':!![]});if(_0x217385[_0xe431('0xc')]){logger[_0xe431('0xd')]('[%s][AGENT]\x20%s',_0x3fb7b0,_['map'](_0x217385,_0xe431('0xe'))[_0xe431('0xf')](',\x20'));_0x11d8f8[_0xe431('0x10')]();}else{var _0xb709f=_['find'](_0x5af92b['agents'],handleFindAgent(_0x57b5d8[_0xe431('0x9')]));if(_0xb709f){var _0x225af2=(_0x57b5d8['timeout']||0xa)*0x3e8;var _0x16f682,_0x2fc4e5;var _0xe1f194=seqqueue['createQueue'](_0x225af2);_0xe1f194['id']=_0x3fb7b0;_0xe1f194[_0xe431('0x11')]=_0x225af2;_0xe1f194[_0xe431('0x12')]=_0x1e1a36[_0xe431('0x12')];writeLog(_0x3fb7b0,_0xb709f,util[_0xe431('0x7')](_0xe431('0x13'),_0x225af2));_0x5af92b[_0xe431('0x14')][_0x3fb7b0]['on'](_0xe431('0x15'),function(){logger[_0xe431('0x16')](_0xe431('0x17'),_0x3fb7b0);clearTimeout(_0x2fc4e5);_0x2fc4e5=undefined;_0xe1f194['close']();if(_0x5af92b[_0xe431('0x14')][_0x3fb7b0]){delete _0x5af92b[_0xe431('0x14')][_0x3fb7b0];}_0x11d8f8[_0xe431('0x10')]();});_0x5af92b['rules'][_0x3fb7b0]['on'](_0xe431('0x18'),function(){if(_0x5af92b[_0xe431('0x14')][_0x3fb7b0]){delete _0x5af92b[_0xe431('0x14')][_0x3fb7b0];}});_0x2fc4e5=setTimeout(function(){logger[_0xe431('0x16')](_0xe431('0x19'),_0x3fb7b0);clearTimeout(_0x2fc4e5);_0xe1f194[_0xe431('0x1a')]();_0x11d8f8[_0xe431('0x1b')]();},_0x225af2);strategy[_0xe431('0x1c')](_0xe1f194,_0xb709f,_0x5af92b,_0x1e1a36);}else{logger[_0xe431('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3fb7b0,_0x57b5d8[_0xe431('0x9')]);_0x11d8f8[_0xe431('0x10')]();}}}catch(_0x198573){console[_0xe431('0x1d')](_0x198573);logger[_0xe431('0xd')]('[%s][QUEUE]\x20%s',_0x3fb7b0,_0x198573['stack']);_0x11d8f8[_0xe431('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 1ff664d..6ddf91f 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 _0xf32e=['moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','AccountId','created','isEmpty','getMustacheRender','Message','then','info','[%s][AMAZONLEX]\x20%s','catch','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','body','toString','postText','message','providerResponse','create','dialogState'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0xf32e,0xfc));var _0xef32=function(_0x4a2a98,_0x500f7e){_0x4a2a98=_0x4a2a98-0x0;var _0x4c5928=_0xf32e[_0x4a2a98];return _0x4c5928;};'use strict';var _=require('lodash');var moment=require(_0xef32('0x0'));var AWS=require('aws-sdk');var utils=require(_0xef32('0x1'));var logger=require(_0xef32('0x2'))(_0xef32('0x3'));var rpc={'chatMessage':require(_0xef32('0x4')),'openchannelMessage':require(_0xef32('0x5')),'mailMessage':require(_0xef32('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xef32('0x7')),'whatsappMessage':require(_0xef32('0x8'))};exports['consequence']=function(_0x1ff459,_0x39d806){return function(_0x57d315){try{if(!_[_0xef32('0x9')](this[_0xef32('0xa')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1ff459,_0xef32('0xb'));return _0x57d315[_0xef32('0xc')]();}var _0x3100b1={'ContactId':this['contact']['id'],'sentAt':moment()[_0xef32('0xd')](_0xef32('0xe')),'direction':_0xef32('0xf')};if(this['channel']==='sms'||this[_0xef32('0x10')]===_0xef32('0x11')){_0x3100b1['phone']=this['interaction'][_0xef32('0x12')];}var _0x15238b=this[_0xef32('0x10')];if(_0x15238b==='chat'){_0x3100b1[_0xef32('0x13')]=this[_0xef32('0x14')]['id'];}else{_0x3100b1[_['upperFirst'](_0x15238b)+_0xef32('0x15')]=this[_0xef32('0x14')]['id'];}_0x3100b1[_['upperFirst'](_0x15238b)+'InteractionId']=this[_0xef32('0xa')]['id'];if(this[_0xef32('0xa')][_0xef32('0x16')]){var _0x2f06ca=_0x39d806[0x4];if(!_[_0xef32('0x17')](_0x2f06ca)){_0x3100b1['body']=utils[_0xef32('0x18')](_0x2f06ca,this);return rpc[_0x15238b+_0xef32('0x19')]['create'](_0x3100b1)[_0xef32('0x1a')](function(_0x501279){logger[_0xef32('0x1b')](_0xef32('0x1c'),_0x1ff459,_0x3100b1['body']);})[_0xef32('0x1d')](function(_0x47a157){logger[_0xef32('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x1ff459,JSON[_0xef32('0x1f')](_0x47a157));})['finally'](function(){logger[_0xef32('0x1b')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1ff459);_0x57d315[_0xef32('0x20')]();});}else{logger[_0xef32('0x1b')](_0xef32('0x21'),_0x1ff459);_0x57d315[_0xef32('0x20')]();}}else{var _0x300ad4=this;var _0x664f85=new AWS[(_0xef32('0x22'))]({'accessKeyId':_0x39d806[0x0],'secretAccessKey':_0x39d806[0x1],'region':_0x39d806[0x2]});var _0x497cb2={'botAlias':'$LATEST','botName':_0x39d806[0x3],'inputText':this['message'][_0xef32('0x23')],'userId':this[_0xef32('0x10')]+':'+this[_0xef32('0xa')]['id'][_0xef32('0x24')]()};_0x664f85[_0xef32('0x25')](_0x497cb2,function(_0x452abb,_0x302366){if(_0x452abb){logger[_0xef32('0x1e')](_0xef32('0x1c'),_0x1ff459,_0x452abb[_0xef32('0x26')]);_0x57d315[_0xef32('0xc')]();}else if(_0x302366&&_0x302366[_0xef32('0x26')]){_0x300ad4['body']['amazonlex']=_0x302366;_0x3100b1[_0xef32('0x23')]=_0x302366[_0xef32('0x26')];_0x3100b1['providerName']='amazonlex';_0x3100b1[_0xef32('0x27')]=JSON['stringify'](_0x302366);return rpc[_0x15238b+_0xef32('0x19')][_0xef32('0x28')](_0x3100b1)[_0xef32('0x1a')](function(_0xe47a15){logger['info'](_0xef32('0x1c'),_0x1ff459,_0x3100b1['body']);if(_0x302366[_0xef32('0x29')]=='Failed'){_0x57d315['next']();}else{_0x57d315[_0xef32('0x20')]();}})[_0xef32('0x1d')](function(_0x37fd65){logger[_0xef32('0x1e')](_0xef32('0x1c'),_0x1ff459,JSON['stringify'](_0x37fd65));_0x57d315['next']();});}else{_0x57d315['next']();}});}}catch(_0x3079c7){logger[_0xef32('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x1ff459,JSON[_0xef32('0x1f')](_0x3079c7));_0x57d315['stop']();}};}; \ No newline at end of file +var _0x7c5f=['ChatWebsiteId','account','AccountId','InteractionId','isEmpty','body','create','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','next','amazonlex','providerResponse','Message','then','dialogState','Failed','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','channel','sms','whatsapp','phone','chat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c5f,0x126));var _0xf7c5=function(_0x54683e,_0x3ceff7){_0x54683e=_0x54683e-0x0;var _0x53543=_0x7c5f[_0x54683e];return _0x53543;};'use strict';var _=require('lodash');var moment=require(_0xf7c5('0x0'));var AWS=require(_0xf7c5('0x1'));var utils=require('./utils');var logger=require(_0xf7c5('0x2'))(_0xf7c5('0x3'));var rpc={'chatMessage':require(_0xf7c5('0x4')),'openchannelMessage':require(_0xf7c5('0x5')),'mailMessage':require(_0xf7c5('0x6')),'smsMessage':require(_0xf7c5('0x7')),'faxMessage':require(_0xf7c5('0x8')),'whatsappMessage':require(_0xf7c5('0x9'))};exports['consequence']=function(_0x2a1340,_0x5eaa7f){return function(_0x5b5b94){try{if(!_[_0xf7c5('0xa')](this[_0xf7c5('0xb')][_0xf7c5('0xc')])){logger[_0xf7c5('0xd')](_0xf7c5('0xe'),_0x2a1340,_0xf7c5('0xf'));return _0x5b5b94['next']();}var _0xcb15bb={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xf7c5('0x10')]===_0xf7c5('0x11')||this[_0xf7c5('0x10')]===_0xf7c5('0x12')){_0xcb15bb[_0xf7c5('0x13')]=this[_0xf7c5('0xb')][_0xf7c5('0x13')];}var _0x3db3a2=this[_0xf7c5('0x10')];if(_0x3db3a2===_0xf7c5('0x14')){_0xcb15bb[_0xf7c5('0x15')]=this[_0xf7c5('0x16')]['id'];}else{_0xcb15bb[_['upperFirst'](_0x3db3a2)+_0xf7c5('0x17')]=this[_0xf7c5('0x16')]['id'];}_0xcb15bb[_['upperFirst'](_0x3db3a2)+_0xf7c5('0x18')]=this[_0xf7c5('0xb')]['id'];if(this[_0xf7c5('0xb')]['created']){var _0x5c06d5=_0x5eaa7f[0x4];if(!_[_0xf7c5('0x19')](_0x5c06d5)){_0xcb15bb[_0xf7c5('0x1a')]=utils['getMustacheRender'](_0x5c06d5,this);return rpc[_0x3db3a2+'Message'][_0xf7c5('0x1b')](_0xcb15bb)['then'](function(_0x4478d9){logger[_0xf7c5('0xd')]('[%s][AMAZONLEX]\x20%s',_0x2a1340,_0xcb15bb[_0xf7c5('0x1a')]);})[_0xf7c5('0x1c')](function(_0x1983ce){logger[_0xf7c5('0x1d')](_0xf7c5('0xe'),_0x2a1340,JSON[_0xf7c5('0x1e')](_0x1983ce));})['finally'](function(){logger['info'](_0xf7c5('0x1f'),_0x2a1340);_0x5b5b94[_0xf7c5('0x20')]();});}else{logger[_0xf7c5('0xd')](_0xf7c5('0x21'),_0x2a1340);_0x5b5b94[_0xf7c5('0x20')]();}}else{var _0xc792ad=this;var _0x14e920=new AWS[(_0xf7c5('0x22'))]({'accessKeyId':_0x5eaa7f[0x0],'secretAccessKey':_0x5eaa7f[0x1],'region':_0x5eaa7f[0x2]});var _0x1fcbe4={'botAlias':'$LATEST','botName':_0x5eaa7f[0x3],'inputText':this[_0xf7c5('0x23')][_0xf7c5('0x1a')],'userId':this['channel']+':'+this[_0xf7c5('0xb')]['id'][_0xf7c5('0x24')]()};_0x14e920[_0xf7c5('0x25')](_0x1fcbe4,function(_0x55546b,_0x300242){if(_0x55546b){logger[_0xf7c5('0x1d')](_0xf7c5('0xe'),_0x2a1340,_0x55546b[_0xf7c5('0x23')]);_0x5b5b94[_0xf7c5('0x26')]();}else if(_0x300242&&_0x300242['message']){_0xc792ad[_0xf7c5('0x1a')][_0xf7c5('0x27')]=_0x300242;_0xcb15bb['body']=_0x300242[_0xf7c5('0x23')];_0xcb15bb['providerName']=_0xf7c5('0x27');_0xcb15bb[_0xf7c5('0x28')]=JSON[_0xf7c5('0x1e')](_0x300242);return rpc[_0x3db3a2+_0xf7c5('0x29')]['create'](_0xcb15bb)[_0xf7c5('0x2a')](function(_0x58e27c){logger[_0xf7c5('0xd')](_0xf7c5('0xe'),_0x2a1340,_0xcb15bb['body']);if(_0x300242[_0xf7c5('0x2b')]==_0xf7c5('0x2c')){_0x5b5b94[_0xf7c5('0x26')]();}else{_0x5b5b94[_0xf7c5('0x20')]();}})['catch'](function(_0x1fdce1){logger['error'](_0xf7c5('0xe'),_0x2a1340,JSON[_0xf7c5('0x1e')](_0x1fdce1));_0x5b5b94[_0xf7c5('0x26')]();});}else{_0x5b5b94[_0xf7c5('0x26')]();}});}}catch(_0x3a91af){logger[_0xf7c5('0x1d')](_0xf7c5('0xe'),_0x2a1340,JSON[_0xf7c5('0x1e')](_0x3a91af));_0x5b5b94[_0xf7c5('0x20')]();}};}; \ 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 61758f1..626b3d2 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 _0x6900=['smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','then','finally','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','from','phone','read','subject','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','inReplyTo','html','replace',''+_[_0x0690('0x2e')](_0x230908[_0x0690('0x10')],'';_0x230908[_0x0690('0x30')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x0690('0x31'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this['account'][_0x0690('0x32')],_0x230908)['then'](function(_0x14c731){logger[_0x0690('0x12')](_0x0690('0x33'),_0x14fdc6);_0x230908[_0x0690('0x34')]=_0x14c731[_0x0690('0x21')]['messageId'];return rpc[_0x44a032+_0x0690('0x35')][_0x0690('0x36')](_0x230908);})['then'](function(_0x315fbf){logger[_0x0690('0x12')](_0x0690('0x13'),_0x14fdc6,JSON['stringify'](_0x315fbf));})[_0x0690('0x37')](function(_0x55e62d){logger[_0x0690('0x38')](_0x0690('0x39'),_0x14fdc6,JSON[_0x0690('0x3a')](_0x55e62d));})['finally'](function(){Promise[_0x0690('0x3b')]()['then'](function(){if(_0x4b1365[0x0]!=='2'||_0x2f5158[_0x0690('0x1a')])return;return rpc[_0x44a032+_0x0690('0x3c')][_0x0690('0x3d')](_0x2f5158['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1a7d11){logger[_0x0690('0x12')](_0x0690('0x1b'),_0x14fdc6,JSON['stringify'](_0x1a7d11));})[_0x0690('0x37')](function(_0x1edb58){logger[_0x0690('0x38')](_0x0690('0x3e'),_0x14fdc6,JSON[_0x0690('0x3a')](_0x1edb58));});})[_0x0690('0x3f')](function(){_0x265713[_0x0690('0x15')]();});});}else{return rpc[this[_0x0690('0xe')]+_0x0690('0x35')][_0x0690('0x36')](_0x230908)['then'](function(){logger[_0x0690('0x12')](_0x0690('0x13'),_0x14fdc6,_0x230908[_0x0690('0x10')]);})[_0x0690('0x37')](function(_0x547118){logger['error'](_0x0690('0x13'),_0x14fdc6,JSON[_0x0690('0x3a')](_0x547118));})[_0x0690('0x40')](function(){Promise[_0x0690('0x3b')]()[_0x0690('0x3f')](function(){if(_0x4b1365[0x0]!=='2'||_0x2f5158[_0x0690('0x1a')])return;return rpc[_0x44a032+_0x0690('0x3c')][_0x0690('0x3d')](_0x2f5158['id'],{'autoreplyExecuted':!![]})[_0x0690('0x3f')](function(_0x7355c7){logger[_0x0690('0x12')](_0x0690('0x1b'),_0x14fdc6,JSON[_0x0690('0x3a')](_0x7355c7));})['catch'](function(_0x48241a){logger[_0x0690('0x38')](_0x0690('0x3e'),_0x14fdc6,JSON[_0x0690('0x3a')](_0x48241a));});})[_0x0690('0x3f')](function(){_0x265713[_0x0690('0x15')]();});});}}}catch(_0x1ba8ff){logger[_0x0690('0x38')](_0x0690('0x13'),_0x14fdc6,JSON[_0x0690('0x3a')](_0x1ba8ff));_0x265713[_0x0690('0x41')]();}};}; \ No newline at end of file +var _0x6ca0=['inReplyTo','messageId','','replace','','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','resolve','lodash','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','channel','mail','body','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x38bbdb,_0x3d3dd3){var _0x45f4f9=function(_0x2bc9b9){while(--_0x2bc9b9){_0x38bbdb['push'](_0x38bbdb['shift']());}};_0x45f4f9(++_0x3d3dd3);}(_0x6ca0,0x97));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x06ca('0x0'));var moment=require('moment');var utils=require(_0x06ca('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x06ca('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x06ca('0x3')),'faxMessage':require(_0x06ca('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x06ca('0x5')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x06ca('0x6')),'smsInteraction':require(_0x06ca('0x7')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x06ca('0x8'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x317519,_0x5ea692,_0x4735c3,_0x1813c3){return function(_0x386933){try{var _0x27b381=this[_0x06ca('0x9')];if(_0x27b381===_0x06ca('0xa')&&_0x1813c3[_0x06ca('0xb')]['isAutoreply']){logger[_0x06ca('0xc')]('[%s][AUTOREPLY]\x20%s',_0x317519,_0x06ca('0xd'));return _0x386933[_0x06ca('0xe')]();}if(_0x5ea692[0x0]==='1'&&(_[_0x06ca('0xf')](this[_0x06ca('0x10')][_0x06ca('0x11')])||!this[_0x06ca('0x10')][_0x06ca('0x11')])){logger[_0x06ca('0xc')](_0x06ca('0x12'),_0x317519,_0x06ca('0x13'));return _0x386933[_0x06ca('0xe')]();}if(_0x5ea692[0x0]==='2'&&this[_0x06ca('0x10')][_0x06ca('0x14')]){logger[_0x06ca('0xc')](_0x06ca('0x15'),_0x317519,_0x06ca('0x16'));return _0x386933[_0x06ca('0xe')]();}var _0x3ff120={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x06ca('0x17')),'direction':_0x06ca('0x18')};if(this[_0x06ca('0x9')]==='mail'){_0x3ff120[_0x06ca('0xb')]=utils['getMustacheRender'](_0x5ea692[0x2],this);}else{_0x3ff120[_0x06ca('0xb')]=utils[_0x06ca('0x19')](_0x5ea692[0x1],this);}if(this[_0x06ca('0x1a')]){_0x3ff120['to']=this['message']['from']||'';if(this[_0x06ca('0x9')]==='mail'&&_0x5ea692[0x1]==='1'){_0x3ff120['cc']=this[_0x06ca('0x1a')]['cc']||'';}_0x3ff120[_0x06ca('0x1b')]=this[_0x06ca('0x1a')]['to']||'';_0x3ff120['phone']=this[_0x06ca('0x1a')][_0x06ca('0x1c')]||'';_0x3ff120[_0x06ca('0x1d')]=!![];if(this[_0x06ca('0x1a')][_0x06ca('0x1e')]){_0x3ff120[_0x06ca('0x1e')]='';_0x3ff120['subject']+=_['startsWith'](this[_0x06ca('0x1a')][_0x06ca('0x1e')],'Re:')?'':_0x06ca('0x1f');_0x3ff120[_0x06ca('0x1e')]+=this[_0x06ca('0x1a')][_0x06ca('0x1e')];}}if(this[_0x06ca('0x9')]===_0x06ca('0x20')){_0x3ff120[_0x06ca('0x21')]=this[_0x06ca('0x22')]['id'];}else{_0x3ff120[_[_0x06ca('0x23')](this['channel'])+_0x06ca('0x24')]=this[_0x06ca('0x22')]['id'];}_0x3ff120[_[_0x06ca('0x23')](this[_0x06ca('0x9')])+_0x06ca('0x25')]=this[_0x06ca('0x10')]['id'];var _0x38c7c4=this[_0x06ca('0x10')];if(rpc[this[_0x06ca('0x9')]+'Message']){if(this[_0x06ca('0x9')]==='mail'){_0x3ff120[_0x06ca('0x26')]=this[_0x06ca('0x1a')][_0x06ca('0x27')];_0x3ff120['html']=_0x06ca('0x28')+_[_0x06ca('0x29')](_0x3ff120[_0x06ca('0xb')],_0x06ca('0x2a'),_0x06ca('0x2b'))+_0x06ca('0x2c');_0x3ff120['headers']={'Auto-Submitted':_0x06ca('0x2d'),'X-Auto-Response-Suppress':_0x06ca('0x2e'),'Precedence':_0x06ca('0x2f')};return mailRpc[_0x06ca('0x30')](this[_0x06ca('0x22')][_0x06ca('0x31')],_0x3ff120)[_0x06ca('0x32')](function(_0x170320){logger[_0x06ca('0xc')](_0x06ca('0x33'),_0x317519);_0x3ff120['messageId']=_0x170320[_0x06ca('0x1a')][_0x06ca('0x27')];return rpc[_0x27b381+_0x06ca('0x34')][_0x06ca('0x35')](_0x3ff120);})[_0x06ca('0x32')](function(_0x48e9af){logger[_0x06ca('0xc')](_0x06ca('0x12'),_0x317519,JSON[_0x06ca('0x36')](_0x48e9af));})[_0x06ca('0x37')](function(_0x5146e4){logger[_0x06ca('0x38')](_0x06ca('0x39'),_0x317519,JSON['stringify'](_0x5146e4));})['finally'](function(){Promise['resolve']()[_0x06ca('0x32')](function(){if(_0x5ea692[0x0]!=='2'||_0x38c7c4[_0x06ca('0x14')])return;return rpc[_0x27b381+_0x06ca('0x3a')][_0x06ca('0x3b')](_0x38c7c4['id'],{'autoreplyExecuted':!![]})[_0x06ca('0x32')](function(_0x43eb7c){logger['info'](_0x06ca('0x15'),_0x317519,JSON[_0x06ca('0x36')](_0x43eb7c));})[_0x06ca('0x37')](function(_0x14533d){logger[_0x06ca('0x38')](_0x06ca('0x3c'),_0x317519,JSON['stringify'](_0x14533d));});})[_0x06ca('0x32')](function(){_0x386933[_0x06ca('0xe')]();});});}else{return rpc[this['channel']+_0x06ca('0x34')][_0x06ca('0x35')](_0x3ff120)[_0x06ca('0x32')](function(){logger[_0x06ca('0xc')](_0x06ca('0x12'),_0x317519,_0x3ff120[_0x06ca('0xb')]);})[_0x06ca('0x37')](function(_0x30e39c){logger[_0x06ca('0x38')](_0x06ca('0x12'),_0x317519,JSON[_0x06ca('0x36')](_0x30e39c));})[_0x06ca('0x3d')](function(){Promise[_0x06ca('0x3e')]()[_0x06ca('0x32')](function(){if(_0x5ea692[0x0]!=='2'||_0x38c7c4[_0x06ca('0x14')])return;return rpc[_0x27b381+'Interaction']['update'](_0x38c7c4['id'],{'autoreplyExecuted':!![]})['then'](function(_0x376455){logger[_0x06ca('0xc')](_0x06ca('0x15'),_0x317519,JSON[_0x06ca('0x36')](_0x376455));})[_0x06ca('0x37')](function(_0x2955fe){logger[_0x06ca('0x38')](_0x06ca('0x3c'),_0x317519,JSON[_0x06ca('0x36')](_0x2955fe));});})[_0x06ca('0x32')](function(){_0x386933[_0x06ca('0xe')]();});});}}}catch(_0x307e5e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x317519,JSON[_0x06ca('0x36')](_0x307e5e));_0x386933['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 0951093..e84948f 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbca=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','finally','stop','stringify','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0x26bc36,_0x95e54){var _0x173490=function(_0xc1dacb){while(--_0xc1dacb){_0x26bc36['push'](_0x26bc36['shift']());}};_0x173490(++_0x95e54);}(_0xdbca,0x8d));var _0xadbc=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0xdbca[_0x1b8d87];return _0x182b74;};'use strict';var moment=require('moment');var logger=require(_0xadbc('0x0'))(_0xadbc('0x1'));var rpc={'chatInteraction':require(_0xadbc('0x2')),'openchannelInteraction':require(_0xadbc('0x3')),'smsInteraction':require(_0xadbc('0x4')),'mailInteraction':require(_0xadbc('0x5')),'faxInteraction':require(_0xadbc('0x6')),'whatsappInteraction':require(_0xadbc('0x7'))};exports[_0xadbc('0x8')]=function(_0xdc6a5e,_0x20e1fe,_0x4dd684,_0x292d1b){return function(_0x11bbe0){try{logger[_0xadbc('0x9')](_0xadbc('0xa'),_0xdc6a5e,_0x20e1fe[0x0]);var _0x338ac7={'closed':0x1,'closedAt':moment()[_0xadbc('0xb')](_0xadbc('0xc')),'closeReason':_0xadbc('0xd'),'disposition':_0x20e1fe[0x0]};if(rpc[_0x292d1b['channel']+'Interaction']){rpc[_0x292d1b['channel']+_0xadbc('0xe')][_0xadbc('0xf')](_0x292d1b[_0xadbc('0x10')]['id'],_0x338ac7)[_0xadbc('0x11')](function(_0x4b380f){logger['info'](_0xadbc('0x12'),_0xdc6a5e,_0x292d1b[_0xadbc('0x10')]['id']);})[_0xadbc('0x13')](function(_0x1237e5){logger[_0xadbc('0x14')]('[%s][CLOSE]\x20%s',_0xdc6a5e,JSON['stringify'](_0x1237e5));})[_0xadbc('0x15')](function(){_0x11bbe0[_0xadbc('0x16')]();});}}catch(_0x7745e3){logger[_0xadbc('0x14')]('[%s][CLOSE]\x20%s',_0xdc6a5e,JSON[_0xadbc('0x17')](_0x7745e3));_0x11bbe0[_0xadbc('0x16')]();}};}; \ No newline at end of file +var _0x00e8=['then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction'];(function(_0x20b9ed,_0x3c4ca1){var _0x4cba21=function(_0x44106c){while(--_0x44106c){_0x20b9ed['push'](_0x20b9ed['shift']());}};_0x4cba21(++_0x3c4ca1);}(_0x00e8,0xa4));var _0x800e=function(_0x98218,_0x4d3a44){_0x98218=_0x98218-0x0;var _0x15d48a=_0x00e8[_0x98218];return _0x15d48a;};'use strict';var moment=require(_0x800e('0x0'));var logger=require(_0x800e('0x1'))(_0x800e('0x2'));var rpc={'chatInteraction':require(_0x800e('0x3')),'openchannelInteraction':require(_0x800e('0x4')),'smsInteraction':require(_0x800e('0x5')),'mailInteraction':require(_0x800e('0x6')),'faxInteraction':require(_0x800e('0x7')),'whatsappInteraction':require(_0x800e('0x8'))};exports[_0x800e('0x9')]=function(_0x1dd8f3,_0x241354,_0x3f3166,_0x19650f){return function(_0x3644db){try{logger['info'](_0x800e('0xa'),_0x1dd8f3,_0x241354[0x0]);var _0x300620={'closed':0x1,'closedAt':moment()[_0x800e('0xb')](_0x800e('0xc')),'closeReason':_0x800e('0xd'),'disposition':_0x241354[0x0]};if(rpc[_0x19650f['channel']+_0x800e('0xe')]){rpc[_0x19650f[_0x800e('0xf')]+'Interaction'][_0x800e('0x10')](_0x19650f[_0x800e('0x11')]['id'],_0x300620)[_0x800e('0x12')](function(_0x52bc77){logger[_0x800e('0x13')](_0x800e('0x14'),_0x1dd8f3,_0x19650f[_0x800e('0x11')]['id']);})[_0x800e('0x15')](function(_0x127cb9){logger[_0x800e('0x16')](_0x800e('0x17'),_0x1dd8f3,JSON[_0x800e('0x18')](_0x127cb9));})['finally'](function(){_0x3644db[_0x800e('0x19')]();});}}catch(_0x4a088f){logger['error']('[%s][CLOSE]\x20%s',_0x1dd8f3,JSON['stringify'](_0x4a088f));_0x3644db[_0x800e('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index df97095..cf726e9 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0686=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','body','getMustacheRender','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','create','metadata','endConversation','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x0686,0x123));var _0x6068=function(_0x5cc439,_0x362338){_0x5cc439=_0x5cc439-0x0;var _0x37d152=_0x0686[_0x5cc439];return _0x37d152;};'use strict';var _=require(_0x6068('0x0'));var moment=require(_0x6068('0x1'));var apiai=require(_0x6068('0x2'));var md5=require(_0x6068('0x3'));var utils=require(_0x6068('0x4'));var logger=require(_0x6068('0x5'))(_0x6068('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6068('0x7')),'mailMessage':require(_0x6068('0x8')),'smsMessage':require(_0x6068('0x9')),'faxMessage':require(_0x6068('0xa')),'whatsappMessage':require(_0x6068('0xb'))};exports[_0x6068('0xc')]=function(_0x37489b,_0x171e21){return function(_0x3eb140){try{if(!_[_0x6068('0xd')](this['interaction'][_0x6068('0xe')])){logger[_0x6068('0xf')](_0x6068('0x10'),_0x37489b,_0x6068('0x11'));return _0x3eb140[_0x6068('0x12')]();}var _0x3d27cf={'ContactId':this[_0x6068('0x13')]['id'],'sentAt':moment()['format'](_0x6068('0x14')),'direction':_0x6068('0x15')};if(this[_0x6068('0x16')]===_0x6068('0x17')||this[_0x6068('0x16')]==='whatsapp'){_0x3d27cf[_0x6068('0x18')]=this[_0x6068('0x19')]['phone'];}var _0x406cab=this[_0x6068('0x16')];if(_0x406cab===_0x6068('0x1a')){_0x3d27cf[_0x6068('0x1b')]=this[_0x6068('0x1c')]['id'];}else{_0x3d27cf[_[_0x6068('0x1d')](_0x406cab)+_0x6068('0x1e')]=this[_0x6068('0x1c')]['id'];}_0x3d27cf[_[_0x6068('0x1d')](_0x406cab)+'InteractionId']=this[_0x6068('0x19')]['id'];if(this[_0x6068('0x19')]['created']){var _0x456dbb=_0x171e21[0x2];if(!_[_0x6068('0x1f')](_0x456dbb)){_0x3d27cf[_0x6068('0x20')]=utils[_0x6068('0x21')](_0x456dbb,this);return rpc[_0x406cab+'Message']['create'](_0x3d27cf)[_0x6068('0x22')](function(_0x1f0e7e){logger[_0x6068('0xf')](_0x6068('0x10'),_0x37489b,_0x3d27cf['body']);})['catch'](function(_0x1703ba){logger[_0x6068('0x23')](_0x6068('0x10'),_0x37489b,JSON[_0x6068('0x24')](_0x1703ba));})[_0x6068('0x25')](function(){logger[_0x6068('0xf')](_0x6068('0x26'),_0x37489b);_0x3eb140['stop']();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x37489b);_0x3eb140[_0x6068('0x27')]();}}else{var _0x138946=this;var _0x1b4f91=apiai(_0x171e21[0x0],{'language':_0x171e21[0x1]||'en'});return _0x1b4f91[_0x6068('0x28')](this[_0x6068('0x29')][_0x6068('0x20')],{'sessionId':md5(this[_0x6068('0x19')]['id'])})[_0x6068('0x22')](function(_0x5cf58c){_0x138946[_0x6068('0x20')][_0x6068('0x2a')]=_0x5cf58c;_0x3d27cf['body']=_0x5cf58c[_0x6068('0x2b')][_0x6068('0x2c')][_0x6068('0x2d')];_0x3d27cf[_0x6068('0x2e')]=_0x6068('0x2a');_0x3d27cf['providerResponse']=JSON[_0x6068('0x24')](_0x5cf58c);return rpc[_0x406cab+'Message'][_0x6068('0x2f')](_0x3d27cf)[_0x6068('0x22')](function(_0x256aaf){logger[_0x6068('0xf')](_0x6068('0x10'),_0x37489b,_0x3d27cf[_0x6068('0x20')]);if(_0x5cf58c[_0x6068('0x2b')][_0x6068('0x30')][_0x6068('0x31')]){_0x3eb140[_0x6068('0x12')]();}else{_0x3eb140['stop']();}})[_0x6068('0x32')](function(_0x2e6324){logger[_0x6068('0x23')](_0x6068('0x10'),_0x37489b,JSON[_0x6068('0x24')](_0x2e6324));_0x3eb140[_0x6068('0x12')]();});})[_0x6068('0x32')](function(_0x109829){logger['error'](_0x6068('0x10'),_0x37489b,_0x109829[_0x6068('0x29')]);_0x3eb140[_0x6068('0x12')]();});}}catch(_0x1ecf5d){logger[_0x6068('0x23')](_0x6068('0x10'),_0x37489b,JSON[_0x6068('0x24')](_0x1ecf5d));_0x3eb140[_0x6068('0x27')]();}};}; \ No newline at end of file +var _0x01d9=['providerResponse','stringify','metadata','catch','lodash','moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','dialogflow'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var moment=require(_0x901d('0x1'));var apiai=require(_0x901d('0x2'));var md5=require(_0x901d('0x3'));var utils=require('./utils');var logger=require(_0x901d('0x4'))(_0x901d('0x5'));var rpc={'chatMessage':require(_0x901d('0x6')),'openchannelMessage':require(_0x901d('0x7')),'mailMessage':require(_0x901d('0x8')),'smsMessage':require(_0x901d('0x9')),'faxMessage':require(_0x901d('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x901d('0xb')]=function(_0x6c9ac8,_0x21e1d7){return function(_0x12c39f){try{if(!_[_0x901d('0xc')](this[_0x901d('0xd')][_0x901d('0xe')])){logger[_0x901d('0xf')](_0x901d('0x10'),_0x6c9ac8,_0x901d('0x11'));return _0x12c39f[_0x901d('0x12')]();}var _0xd819f0={'ContactId':this[_0x901d('0x13')]['id'],'sentAt':moment()['format'](_0x901d('0x14')),'direction':'out'};if(this[_0x901d('0x15')]===_0x901d('0x16')||this[_0x901d('0x15')]===_0x901d('0x17')){_0xd819f0[_0x901d('0x18')]=this['interaction'][_0x901d('0x18')];}var _0x31cbbd=this[_0x901d('0x15')];if(_0x31cbbd===_0x901d('0x19')){_0xd819f0[_0x901d('0x1a')]=this[_0x901d('0x1b')]['id'];}else{_0xd819f0[_['upperFirst'](_0x31cbbd)+_0x901d('0x1c')]=this[_0x901d('0x1b')]['id'];}_0xd819f0[_[_0x901d('0x1d')](_0x31cbbd)+_0x901d('0x1e')]=this[_0x901d('0xd')]['id'];if(this[_0x901d('0xd')][_0x901d('0x1f')]){var _0x407215=_0x21e1d7[0x2];if(!_[_0x901d('0x20')](_0x407215)){_0xd819f0[_0x901d('0x21')]=utils[_0x901d('0x22')](_0x407215,this);return rpc[_0x31cbbd+_0x901d('0x23')][_0x901d('0x24')](_0xd819f0)[_0x901d('0x25')](function(_0x38f42b){logger[_0x901d('0xf')](_0x901d('0x10'),_0x6c9ac8,_0xd819f0[_0x901d('0x21')]);})['catch'](function(_0x430634){logger[_0x901d('0x26')]('[%s][DIALOGFLOW]\x20%s',_0x6c9ac8,JSON['stringify'](_0x430634));})['finally'](function(){logger['info'](_0x901d('0x27'),_0x6c9ac8);_0x12c39f[_0x901d('0x28')]();});}else{logger['info'](_0x901d('0x29'),_0x6c9ac8);_0x12c39f[_0x901d('0x28')]();}}else{var _0x488e24=this;var _0x20778b=apiai(_0x21e1d7[0x0],{'language':_0x21e1d7[0x1]||'en'});return _0x20778b[_0x901d('0x2a')](this[_0x901d('0x2b')][_0x901d('0x21')],{'sessionId':md5(this[_0x901d('0xd')]['id'])})[_0x901d('0x25')](function(_0x46e5c6){_0x488e24[_0x901d('0x21')]['dialogflow']=_0x46e5c6;_0xd819f0[_0x901d('0x21')]=_0x46e5c6[_0x901d('0x2c')][_0x901d('0x2d')][_0x901d('0x2e')];_0xd819f0['providerName']=_0x901d('0x2f');_0xd819f0[_0x901d('0x30')]=JSON[_0x901d('0x31')](_0x46e5c6);return rpc[_0x31cbbd+_0x901d('0x23')][_0x901d('0x24')](_0xd819f0)['then'](function(_0x21fbb9){logger[_0x901d('0xf')](_0x901d('0x10'),_0x6c9ac8,_0xd819f0[_0x901d('0x21')]);if(_0x46e5c6[_0x901d('0x2c')][_0x901d('0x32')]['endConversation']){_0x12c39f[_0x901d('0x12')]();}else{_0x12c39f['stop']();}})[_0x901d('0x33')](function(_0x389fd9){logger[_0x901d('0x26')](_0x901d('0x10'),_0x6c9ac8,JSON[_0x901d('0x31')](_0x389fd9));_0x12c39f[_0x901d('0x12')]();});})[_0x901d('0x33')](function(_0x115676){logger[_0x901d('0x26')](_0x901d('0x10'),_0x6c9ac8,_0x115676[_0x901d('0x2b')]);_0x12c39f[_0x901d('0x12')]();});}}catch(_0x47425c){logger[_0x901d('0x26')](_0x901d('0x10'),_0x6c9ac8,JSON['stringify'](_0x47425c));_0x12c39f[_0x901d('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 24f6546..5898d42 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc08e=['finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','then','length','queryResult','diagnosticInfo','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','boolValue','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','dialogflowV2','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','error'];(function(_0x1eabda,_0x5164e5){var _0x101654=function(_0x2a3a9e){while(--_0x2a3a9e){_0x1eabda['push'](_0x1eabda['shift']());}};_0x101654(++_0x5164e5);}(_0xc08e,0xb4));var _0xec08=function(_0x3d05c2,_0x2abc6e){_0x3d05c2=_0x3d05c2-0x0;var _0x2d98e4=_0xc08e[_0x3d05c2];return _0x2d98e4;};'use strict';var _=require(_0xec08('0x0'));var dialogflow=require(_0xec08('0x1'));var md5=require(_0xec08('0x2'));var moment=require('moment');var Promise=require(_0xec08('0x3'));var logger=require('../../../../config/logger')(_0xec08('0x4'));var utils=require(_0xec08('0x5'));var rpc={'chatMessage':require(_0xec08('0x6')),'openchannelMessage':require(_0xec08('0x7')),'mailMessage':require(_0xec08('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x118d80,_0x5603b1,_0x1ee390,_0x23d8d2){return new Promise(function(_0x29ce4e,_0x1cdc31){var _0x566b26=_[_0xec08('0x9')](_0x1ee390);_0x566b26[_0xec08('0xa')]=_0x23d8d2;return rpc[_0x5603b1+_0xec08('0xb')][_0xec08('0xc')](_0x566b26)['then'](function(){logger[_0xec08('0xd')](_0xec08('0xe'),_0x118d80,_0x566b26['body']);_0x29ce4e();})[_0xec08('0xf')](function(_0x474d58){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x118d80,JSON[_0xec08('0x10')](_0x474d58));_0x1cdc31(_0x474d58);});});}exports['consequence']=function(_0x4361ee,_0xbd3337){return function(_0x4e18c1){try{if(!_[_0xec08('0x11')](this[_0xec08('0x12')][_0xec08('0x13')])){logger[_0xec08('0xd')](_0xec08('0xe'),_0x4361ee,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4e18c1[_0xec08('0x14')]();}var _0x5cbc55={'ContactId':this[_0xec08('0x15')]['id'],'sentAt':moment()[_0xec08('0x16')](_0xec08('0x17')),'direction':'out'};if(this[_0xec08('0x18')]===_0xec08('0x19')||this[_0xec08('0x18')]==='whatsapp'){_0x5cbc55[_0xec08('0x1a')]=this['interaction']['phone'];}var _0x51174f=this['channel'];if(_0x51174f===_0xec08('0x1b')){_0x5cbc55[_0xec08('0x1c')]=this['account']['id'];}else{_0x5cbc55[_[_0xec08('0x1d')](_0x51174f)+_0xec08('0x1e')]=this[_0xec08('0x1f')]['id'];}_0x5cbc55[_['upperFirst'](_0x51174f)+_0xec08('0x20')]=this[_0xec08('0x12')]['id'];if(this[_0xec08('0x12')][_0xec08('0x21')]){var _0x3fea59=_0xbd3337[0x4];if(!_[_0xec08('0x22')](_0x3fea59)){_0x5cbc55[_0xec08('0xa')]=utils['getMustacheRender'](_0x3fea59,this);return rpc[_0x51174f+_0xec08('0xb')]['create'](_0x5cbc55)['then'](function(_0x296283){logger[_0xec08('0xd')](_0xec08('0xe'),_0x4361ee,_0x5cbc55[_0xec08('0xa')]);})['catch'](function(_0x24fbe9){logger[_0xec08('0x23')](_0xec08('0xe'),_0x4361ee,JSON[_0xec08('0x10')](_0x24fbe9));})[_0xec08('0x24')](function(){logger[_0xec08('0xd')](_0xec08('0x25'),_0x4361ee);_0x4e18c1[_0xec08('0x26')]();});}else{logger['info'](_0xec08('0x27'),_0x4361ee);_0x4e18c1[_0xec08('0x26')]();}}else{var _0x4562e2=this;var _0x1adb93=_0xbd3337[0x2][_0xec08('0x28')](/\\n/g,'\x0a');var _0x2d5ef5={'credentials':{'private_key':_0x1adb93,'client_email':_0xbd3337[0x1]}};var _0x93a4bf=new dialogflow[(_0xec08('0x29'))](_0x2d5ef5);var _0x23eb81=_0x93a4bf[_0xec08('0x2a')](_0xbd3337[0x0],md5(_0x4562e2[_0xec08('0x12')]['id']));var _0x570ad3={'session':_0x23eb81,'queryInput':{'text':{'text':_0x4562e2['message']['body'],'languageCode':_0xbd3337[0x3]||'en'}}};return _0x93a4bf[_0xec08('0x2b')](_0x570ad3)[_0xec08('0x2c')](function(_0x292387){if(_0x292387&&_0x292387[_0xec08('0x2d')]){_0x4562e2[_0xec08('0xa')]['dialogflowV2']=_0x292387;var _0x2e1b2b=_0x292387[0x0];var _0x4f51ed=_0x2e1b2b[_0xec08('0x2e')][_0xec08('0x2f')]&&_0x2e1b2b[_0xec08('0x2e')]['diagnosticInfo']['fields']?_0x2e1b2b[_0xec08('0x2e')][_0xec08('0x2f')]['fields'][_0xec08('0x30')]['boolValue']:![];_0x4562e2[_0xec08('0xa')][_0xec08('0x31')]=_0x2e1b2b['queryResult'][_0xec08('0x32')];_0x4562e2[_0xec08('0xa')][_0xec08('0x33')]=_0x2e1b2b[_0xec08('0x2e')][_0xec08('0x34')];_0x4562e2[_0xec08('0xa')][_0xec08('0x35')]=_0x2e1b2b['queryResult'][_0xec08('0x2f')]&&_0x2e1b2b[_0xec08('0x2e')][_0xec08('0x2f')]['fields']?_0x2e1b2b['queryResult']['diagnosticInfo'][_0xec08('0x36')]['end_conversation'][_0xec08('0x37')]:![];_0x4562e2['body'][_0xec08('0x38')]=_0x2e1b2b[_0xec08('0x2e')]['intent'][_0xec08('0x39')];_0x4562e2[_0xec08('0xa')][_0xec08('0x3a')]=_0x2e1b2b['queryResult'][_0xec08('0x3b')]['displayName'];_0x4562e2[_0xec08('0xa')][_0xec08('0x3c')]=_0x2e1b2b[_0xec08('0x2e')][_0xec08('0x3b')][_0xec08('0x3d')];_0x4562e2[_0xec08('0xa')][_0xec08('0x3e')]=_0x2e1b2b['queryResult'][_0xec08('0x3f')];_0x4562e2['body']['DIALOGFLOWV2_QUERYTEXT']=_0x2e1b2b[_0xec08('0x2e')][_0xec08('0x40')];_0x4562e2['body'][_0xec08('0x41')]=_0x2e1b2b['queryResult'][_0xec08('0x42')];_0x5cbc55['providerName']=_0xec08('0x43');_0x5cbc55[_0xec08('0x44')]=JSON[_0xec08('0x10')](_0x292387);var _0x103941=[];for(var _0x4ca712=0x0;_0x4ca712<_0x292387[_0xec08('0x2d')];_0x4ca712++){var _0x62849b=_0x292387[_0x4ca712];if(_0x62849b&&_0x62849b[_0xec08('0x2e')]&&_0x62849b[_0xec08('0x2e')][_0xec08('0x45')]){_0x103941[_0xec08('0x46')](createMessage(_0x4361ee,_0x51174f,_0x5cbc55,_0x62849b[_0xec08('0x2e')][_0xec08('0x45')]));}}return Promise[_0xec08('0x47')](_0x103941)[_0xec08('0x2c')](function(){if(_0x4f51ed){_0x4e18c1[_0xec08('0x14')]();}else{_0x4e18c1['stop']();}})[_0xec08('0xf')](function(_0x3496a8){logger[_0xec08('0x23')](_0xec08('0xe'),_0x4361ee,JSON[_0xec08('0x10')](_0x3496a8));_0x4e18c1[_0xec08('0x14')]();});}})['catch'](function(_0x56f1b4){logger[_0xec08('0x23')](_0xec08('0xe'),_0x4361ee,_0x56f1b4['message'],_0x56f1b4['stack']);_0x4e18c1[_0xec08('0x14')]();});}}catch(_0x208efb){logger[_0xec08('0x23')](_0xec08('0xe'),_0x4361ee,JSON[_0xec08('0x10')](_0x208efb));_0x4e18c1[_0xec08('0x26')]();}};}; \ No newline at end of file +var _0xeb16=['../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','length','body','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','message','stack','md5','bluebird'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0xeb16,0x11e));var _0x6eb1=function(_0x2c9703,_0x55b2c3){_0x2c9703=_0x2c9703-0x0;var _0x41ff7c=_0xeb16[_0x2c9703];return _0x41ff7c;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x6eb1('0x0'));var moment=require('moment');var Promise=require(_0x6eb1('0x1'));var logger=require(_0x6eb1('0x2'))(_0x6eb1('0x3'));var utils=require(_0x6eb1('0x4'));var rpc={'chatMessage':require(_0x6eb1('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6eb1('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6eb1('0x7')),'whatsappMessage':require(_0x6eb1('0x8'))};function createMessage(_0x401d94,_0x154872,_0x4ec4f7,_0x30ef01){return new Promise(function(_0x128ec5,_0x134513){var _0x413210=_[_0x6eb1('0x9')](_0x4ec4f7);_0x413210['body']=_0x30ef01;return rpc[_0x154872+_0x6eb1('0xa')][_0x6eb1('0xb')](_0x413210)[_0x6eb1('0xc')](function(){logger[_0x6eb1('0xd')](_0x6eb1('0xe'),_0x401d94,_0x413210['body']);_0x128ec5();})[_0x6eb1('0xf')](function(_0x184e7d){logger[_0x6eb1('0x10')](_0x6eb1('0xe'),_0x401d94,JSON['stringify'](_0x184e7d));_0x134513(_0x184e7d);});});}exports[_0x6eb1('0x11')]=function(_0x14ea99,_0x33726a){return function(_0x1d503d){try{if(!_[_0x6eb1('0x12')](this['interaction'][_0x6eb1('0x13')])){logger[_0x6eb1('0xd')](_0x6eb1('0xe'),_0x14ea99,_0x6eb1('0x14'));return _0x1d503d[_0x6eb1('0x15')]();}var _0x3f4e2d={'ContactId':this[_0x6eb1('0x16')]['id'],'sentAt':moment()['format'](_0x6eb1('0x17')),'direction':'out'};if(this[_0x6eb1('0x18')]===_0x6eb1('0x19')||this[_0x6eb1('0x18')]==='whatsapp'){_0x3f4e2d['phone']=this[_0x6eb1('0x1a')][_0x6eb1('0x1b')];}var _0x28f1a8=this[_0x6eb1('0x18')];if(_0x28f1a8===_0x6eb1('0x1c')){_0x3f4e2d[_0x6eb1('0x1d')]=this[_0x6eb1('0x1e')]['id'];}else{_0x3f4e2d[_[_0x6eb1('0x1f')](_0x28f1a8)+_0x6eb1('0x20')]=this['account']['id'];}_0x3f4e2d[_[_0x6eb1('0x1f')](_0x28f1a8)+_0x6eb1('0x21')]=this[_0x6eb1('0x1a')]['id'];if(this[_0x6eb1('0x1a')][_0x6eb1('0x22')]){var _0x1d79b5=_0x33726a[0x4];if(!_[_0x6eb1('0x23')](_0x1d79b5)){_0x3f4e2d['body']=utils[_0x6eb1('0x24')](_0x1d79b5,this);return rpc[_0x28f1a8+_0x6eb1('0xa')]['create'](_0x3f4e2d)['then'](function(_0x50ba52){logger[_0x6eb1('0xd')](_0x6eb1('0xe'),_0x14ea99,_0x3f4e2d['body']);})[_0x6eb1('0xf')](function(_0x357a6e){logger[_0x6eb1('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x14ea99,JSON[_0x6eb1('0x25')](_0x357a6e));})[_0x6eb1('0x26')](function(){logger[_0x6eb1('0xd')](_0x6eb1('0x27'),_0x14ea99);_0x1d503d['stop']();});}else{logger['info'](_0x6eb1('0x28'),_0x14ea99);_0x1d503d[_0x6eb1('0x29')]();}}else{var _0x233e26=this;var _0x423686=_0x33726a[0x2][_0x6eb1('0x2a')](/\\n/g,'\x0a');var _0x8df887={'credentials':{'private_key':_0x423686,'client_email':_0x33726a[0x1]}};var _0x18b7d3=new dialogflow[(_0x6eb1('0x2b'))](_0x8df887);var _0x3ed2d1=_0x18b7d3[_0x6eb1('0x2c')](_0x33726a[0x0],md5(_0x233e26[_0x6eb1('0x1a')]['id']));var _0x4e0e05={'session':_0x3ed2d1,'queryInput':{'text':{'text':_0x233e26['message']['body'],'languageCode':_0x33726a[0x3]||'en'}}};return _0x18b7d3['detectIntent'](_0x4e0e05)[_0x6eb1('0xc')](function(_0x2d650d){if(_0x2d650d&&_0x2d650d[_0x6eb1('0x2d')]){_0x233e26[_0x6eb1('0x2e')][_0x6eb1('0x2f')]=_0x2d650d;var _0x5931e5=_0x2d650d[0x0];var _0x2e15e5=_0x5931e5['queryResult'][_0x6eb1('0x30')]&&_0x5931e5[_0x6eb1('0x31')][_0x6eb1('0x30')]['fields']?_0x5931e5[_0x6eb1('0x31')]['diagnosticInfo'][_0x6eb1('0x32')][_0x6eb1('0x33')]['boolValue']:![];_0x233e26['body'][_0x6eb1('0x34')]=_0x5931e5[_0x6eb1('0x31')]['action'];_0x233e26[_0x6eb1('0x2e')][_0x6eb1('0x35')]=_0x5931e5[_0x6eb1('0x31')]['allRequiredParamsPresent'];_0x233e26[_0x6eb1('0x2e')][_0x6eb1('0x36')]=_0x5931e5['queryResult'][_0x6eb1('0x30')]&&_0x5931e5[_0x6eb1('0x31')]['diagnosticInfo'][_0x6eb1('0x32')]?_0x5931e5[_0x6eb1('0x31')][_0x6eb1('0x30')][_0x6eb1('0x32')][_0x6eb1('0x33')][_0x6eb1('0x37')]:![];_0x233e26[_0x6eb1('0x2e')][_0x6eb1('0x38')]=_0x5931e5[_0x6eb1('0x31')][_0x6eb1('0x39')][_0x6eb1('0x3a')];_0x233e26['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5931e5[_0x6eb1('0x31')]['intent'][_0x6eb1('0x3b')];_0x233e26['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x5931e5['queryResult']['intent'][_0x6eb1('0x3c')];_0x233e26['body'][_0x6eb1('0x3d')]=_0x5931e5[_0x6eb1('0x31')][_0x6eb1('0x3e')];_0x233e26[_0x6eb1('0x2e')][_0x6eb1('0x3f')]=_0x5931e5['queryResult'][_0x6eb1('0x40')];_0x233e26[_0x6eb1('0x2e')][_0x6eb1('0x41')]=_0x5931e5[_0x6eb1('0x31')][_0x6eb1('0x42')];_0x3f4e2d['providerName']='dialogflowV2';_0x3f4e2d[_0x6eb1('0x43')]=JSON['stringify'](_0x2d650d);var _0x5733a7=[];for(var _0x57bc51=0x0;_0x57bc51<_0x2d650d[_0x6eb1('0x2d')];_0x57bc51++){var _0xb0830b=_0x2d650d[_0x57bc51];if(_0xb0830b&&_0xb0830b['queryResult']&&_0xb0830b[_0x6eb1('0x31')][_0x6eb1('0x44')]){_0x5733a7[_0x6eb1('0x45')](createMessage(_0x14ea99,_0x28f1a8,_0x3f4e2d,_0xb0830b[_0x6eb1('0x31')][_0x6eb1('0x44')]));}}return Promise['all'](_0x5733a7)[_0x6eb1('0xc')](function(){if(_0x2e15e5){_0x1d503d[_0x6eb1('0x15')]();}else{_0x1d503d[_0x6eb1('0x29')]();}})[_0x6eb1('0xf')](function(_0x418450){logger[_0x6eb1('0x10')](_0x6eb1('0xe'),_0x14ea99,JSON[_0x6eb1('0x25')](_0x418450));_0x1d503d[_0x6eb1('0x15')]();});}})[_0x6eb1('0xf')](function(_0x5c10f2){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x14ea99,_0x5c10f2[_0x6eb1('0x46')],_0x5c10f2[_0x6eb1('0x47')]);_0x1d503d[_0x6eb1('0x15')]();});}}catch(_0x4ea21d){logger['error'](_0x6eb1('0xe'),_0x14ea99,JSON[_0x6eb1('0x25')](_0x4ea21d));_0x1d503d[_0x6eb1('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 3a13aab..3e826f9 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2248=['map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','[%s][GOTOIF]\x20%s'];(function(_0x5a5121,_0x503400){var _0x55315d=function(_0x31918c){while(--_0x31918c){_0x5a5121['push'](_0x5a5121['shift']());}};_0x55315d(++_0x503400);}(_0x2248,0xe7));var _0x8224=function(_0x384f45,_0x194342){_0x384f45=_0x384f45-0x0;var _0x32ccb7=_0x2248[_0x384f45];return _0x32ccb7;};'use strict';var schema=require(_0x8224('0x0'));var _=require('lodash');var htmlToText=require(_0x8224('0x1'));var utils=require(_0x8224('0x2'));var logger=require(_0x8224('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x8224('0x4'),'required':!![],'message':_0x8224('0x5')},'priorityTrue':{'type':_0x8224('0x6'),'message':_0x8224('0x7')},'priorityFalse':{'type':'number','message':_0x8224('0x8')}});exports[_0x8224('0x9')]=function(_0x1789a6,_0xb8e973){return function(_0x172ef8){try{var _0x4d9adf={'condition':htmlToText[_0x8224('0xa')](utils['getMustacheRender'](_0xb8e973[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xb8e973[0x1],'priorityFalse':_0xb8e973[0x2]};var _0xc8e83=gotoif[_0x8224('0x0')](_0x4d9adf,{'typecast':!![]});if(_0xc8e83['length']){logger['error'](_0x8224('0xb'),_0x1789a6,_[_0x8224('0xc')](_0xc8e83,_0x8224('0xd'))['join'](',\x20'));_0x172ef8[_0x8224('0xe')]();}else{try{var _0x39e55a=eval('('+_0x4d9adf[_0x8224('0xf')]+')');var _0x231de8=_0x39e55a?_0x4d9adf[_0x8224('0x10')]:_0x4d9adf[_0x8224('0x11')];logger[_0x8224('0x12')](_0x8224('0x13'),_0x1789a6,_0x4d9adf[_0x8224('0xf')],_0x39e55a,_0x231de8||_0x8224('0x14'));if(_0x231de8){var _0x1702fa=_[_0x8224('0x15')](_0x172ef8[_0x8224('0x16')](),{'p':_0x231de8});if(_0x1702fa>=0x0){logger[_0x8224('0x12')](_0x8224('0x17'),_0x1789a6,_0x231de8||_0x8224('0x14'),_0x1702fa);_0x172ef8[_0x8224('0x14')](_0x1702fa);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1789a6,_0x231de8||'next');_0x172ef8['stop']();}}else{_0x172ef8['next']();}}catch(_0x18255a){logger[_0x8224('0x18')](_0x8224('0x19'),_0x1789a6,_0x18255a[_0x8224('0xd')]);_0x172ef8[_0x8224('0xe')]();}}}catch(_0x5c1666){logger[_0x8224('0x18')](_0x8224('0xb'),_0x1789a6,JSON[_0x8224('0x1a')](_0x5c1666));_0x172ef8['stop']();}};}; \ No newline at end of file +var _0x9b5d=['stringify','validate','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x9b5d,0x65));var _0xd9b5=function(_0x13e288,_0xd2034b){_0x13e288=_0x13e288-0x0;var _0x3c7f65=_0x9b5d[_0x13e288];return _0x3c7f65;};'use strict';var schema=require(_0xd9b5('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xd9b5('0x1'));var logger=require('../../../../config/logger')(_0xd9b5('0x2'));var gotoif=schema({'condition':{'type':_0xd9b5('0x3'),'required':!![],'message':_0xd9b5('0x4')},'priorityTrue':{'type':'number','message':_0xd9b5('0x5')},'priorityFalse':{'type':_0xd9b5('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xd9b5('0x7')]=function(_0x3f4cf5,_0x3dee30){return function(_0x11a029){try{var _0x11e21e={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x3dee30[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3dee30[0x1],'priorityFalse':_0x3dee30[0x2]};var _0x1b3f23=gotoif[_0xd9b5('0x0')](_0x11e21e,{'typecast':!![]});if(_0x1b3f23['length']){logger[_0xd9b5('0x8')](_0xd9b5('0x9'),_0x3f4cf5,_[_0xd9b5('0xa')](_0x1b3f23,_0xd9b5('0xb'))[_0xd9b5('0xc')](',\x20'));_0x11a029[_0xd9b5('0xd')]();}else{try{var _0x1c35cf=eval('('+_0x11e21e['condition']+')');var _0x1f879d=_0x1c35cf?_0x11e21e[_0xd9b5('0xe')]:_0x11e21e[_0xd9b5('0xf')];logger['info'](_0xd9b5('0x10'),_0x3f4cf5,_0x11e21e['condition'],_0x1c35cf,_0x1f879d||_0xd9b5('0x11'));if(_0x1f879d){var _0x4b3389=_[_0xd9b5('0x12')](_0x11a029[_0xd9b5('0x13')](),{'p':_0x1f879d});if(_0x4b3389>=0x0){logger[_0xd9b5('0x14')](_0xd9b5('0x15'),_0x3f4cf5,_0x1f879d||_0xd9b5('0x11'),_0x4b3389);_0x11a029[_0xd9b5('0x11')](_0x4b3389);}else{logger[_0xd9b5('0x14')](_0xd9b5('0x16'),_0x3f4cf5,_0x1f879d||_0xd9b5('0x11'));_0x11a029[_0xd9b5('0xd')]();}}else{_0x11a029['next']();}}catch(_0x2b8be4){logger[_0xd9b5('0x8')](_0xd9b5('0x17'),_0x3f4cf5,_0x2b8be4[_0xd9b5('0xb')]);_0x11a029[_0xd9b5('0xd')]();}}}catch(_0x225461){logger[_0xd9b5('0x8')](_0xd9b5('0x9'),_0x3f4cf5,JSON[_0xd9b5('0x18')](_0x225461));_0x11a029[_0xd9b5('0xd')]();}};}; \ 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 367d135..2400274 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 _0x7a82=['consequence','length','[%s][GOTOP]\x20%s','join','stop','priority','rules','info','next','error','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x48517e,_0x7b51a){var _0x40ff95=function(_0x14d8c6){while(--_0x14d8c6){_0x48517e['push'](_0x48517e['shift']());}};_0x40ff95(++_0x7b51a);}(_0x7a82,0x118));var _0x27a8=function(_0x53c5e2,_0x5cd401){_0x53c5e2=_0x53c5e2-0x0;var _0xfc6aaf=_0x7a82[_0x53c5e2];return _0xfc6aaf;};'use strict';var schema=require(_0x27a8('0x0'));var _=require(_0x27a8('0x1'));var logger=require('../../../../config/logger')(_0x27a8('0x2'));var gotop=schema({'priority':{'type':_0x27a8('0x3'),'required':!![],'message':_0x27a8('0x4')}});exports[_0x27a8('0x5')]=function(_0x2cdc68,_0x2e2be9){return function(_0x134883){try{var _0x53fcb4={'priority':_0x2e2be9[0x0]};var _0x1e4133=gotop[_0x27a8('0x0')](_0x53fcb4,{'typecast':!![]});if(_0x1e4133[_0x27a8('0x6')]){logger['error'](_0x27a8('0x7'),_0x2cdc68,_['map'](_0x1e4133,'message')[_0x27a8('0x8')](',\x20'));_0x134883[_0x27a8('0x9')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x2cdc68,_0x53fcb4[_0x27a8('0xa')]);if(_0x53fcb4['priority']){var _0x37cd97=_['findIndex'](_0x134883[_0x27a8('0xb')](),{'p':_0x53fcb4[_0x27a8('0xa')]});if(_0x37cd97>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2cdc68,_0x53fcb4[_0x27a8('0xa')]||'next',_0x37cd97);_0x134883['next'](_0x37cd97);}else{logger[_0x27a8('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x2cdc68,_0x53fcb4[_0x27a8('0xa')]||_0x27a8('0xd'));_0x134883[_0x27a8('0x9')]();}}else{_0x134883['next']();}}}catch(_0x19c534){logger[_0x27a8('0xe')](_0x27a8('0x7'),_0x2cdc68,JSON['stringify'](_0x19c534));_0x134883[_0x27a8('0x9')]();}};}; \ No newline at end of file +var _0xc451=['stringify','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s'];(function(_0x5ebc9a,_0x405dcd){var _0x20d5ae=function(_0x43c067){while(--_0x43c067){_0x5ebc9a['push'](_0x5ebc9a['shift']());}};_0x20d5ae(++_0x405dcd);}(_0xc451,0x8d));var _0x1c45=function(_0x28da7d,_0x360718){_0x28da7d=_0x28da7d-0x0;var _0x53a718=_0xc451[_0x28da7d];return _0x53a718;};'use strict';var schema=require('validate');var _=require(_0x1c45('0x0'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x1c45('0x1'),'required':!![],'message':_0x1c45('0x2')}});exports[_0x1c45('0x3')]=function(_0x4f6eb2,_0x32b676){return function(_0x8e6904){try{var _0x1a068c={'priority':_0x32b676[0x0]};var _0x4dbc78=gotop[_0x1c45('0x4')](_0x1a068c,{'typecast':!![]});if(_0x4dbc78['length']){logger[_0x1c45('0x5')]('[%s][GOTOP]\x20%s',_0x4f6eb2,_[_0x1c45('0x6')](_0x4dbc78,_0x1c45('0x7'))[_0x1c45('0x8')](',\x20'));_0x8e6904[_0x1c45('0x9')]();}else{logger[_0x1c45('0xa')](_0x1c45('0xb'),_0x4f6eb2,_0x1a068c[_0x1c45('0xc')]);if(_0x1a068c[_0x1c45('0xc')]){var _0x5acf3e=_[_0x1c45('0xd')](_0x8e6904[_0x1c45('0xe')](),{'p':_0x1a068c[_0x1c45('0xc')]});if(_0x5acf3e>=0x0){logger[_0x1c45('0xa')](_0x1c45('0xf'),_0x4f6eb2,_0x1a068c[_0x1c45('0xc')]||_0x1c45('0x10'),_0x5acf3e);_0x8e6904[_0x1c45('0x10')](_0x5acf3e);}else{logger[_0x1c45('0xa')](_0x1c45('0x11'),_0x4f6eb2,_0x1a068c[_0x1c45('0xc')]||_0x1c45('0x10'));_0x8e6904[_0x1c45('0x9')]();}}else{_0x8e6904[_0x1c45('0x10')]();}}}catch(_0x183ffb){logger[_0x1c45('0x5')](_0x1c45('0x12'),_0x4f6eb2,JSON[_0x1c45('0x13')](_0x183ffb));_0x8e6904[_0x1c45('0x9')]();}};}; \ 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 183751e..e8ea90e 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 _0xa1e0=['AccountId','upperFirst','interaction','then','[%s][MESSAGE]\x20%s','body','next','stop','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x4c8e5c,_0x35a3e0){var _0x208ed9=function(_0x7480fa){while(--_0x7480fa){_0x4c8e5c['push'](_0x4c8e5c['shift']());}};_0x208ed9(++_0x35a3e0);}(_0xa1e0,0xb2));var _0x0a1e=function(_0x41890f,_0x458a43){_0x41890f=_0x41890f-0x0;var _0x497002=_0xa1e0[_0x41890f];return _0x497002;};'use strict';var _=require(_0x0a1e('0x0'));var utils=require(_0x0a1e('0x1'));var logger=require(_0x0a1e('0x2'))(_0x0a1e('0x3'));var rpc={'chatMessage':require(_0x0a1e('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0a1e('0x5')),'smsMessage':require(_0x0a1e('0x6')),'faxMessage':require(_0x0a1e('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x2054cf,_0x640b32){return function(_0x1e8b18){try{var _0xb5c7d7={'body':utils[_0x0a1e('0x8')](_0x640b32[0x0],this),'ContactId':this[_0x0a1e('0x9')]['id']};if(this[_0x0a1e('0xa')]===_0x0a1e('0xb')){_0xb5c7d7[_0x0a1e('0xc')]=this[_0x0a1e('0xd')]['id'];}else{_0xb5c7d7[_['upperFirst'](this[_0x0a1e('0xa')])+_0x0a1e('0xe')]=this[_0x0a1e('0xd')]['id'];}_0xb5c7d7[_[_0x0a1e('0xf')](this[_0x0a1e('0xa')])+'InteractionId']=this[_0x0a1e('0x10')]['id'];if(rpc[this[_0x0a1e('0xa')]+'Message']){return rpc[this[_0x0a1e('0xa')]+'Message']['create'](_0xb5c7d7)[_0x0a1e('0x11')](function(_0x5e1b05){logger['info'](_0x0a1e('0x12'),_0x2054cf,_0xb5c7d7[_0x0a1e('0x13')]);_0x1e8b18[_0x0a1e('0x14')]();})['catch'](function(_0xb4a1f0){logger['error'](_0x0a1e('0x12'),_0x2054cf,JSON['stringify'](_0xb4a1f0));_0x1e8b18[_0x0a1e('0x15')]();});}}catch(_0x3bed57){logger[_0x0a1e('0x16')](_0x0a1e('0x12'),_0x2054cf,JSON[_0x0a1e('0x17')](_0x3bed57));_0x1e8b18['stop']();}};}; \ No newline at end of file +var _0xfbe2=['Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','interaction'];(function(_0x18fc56,_0x4e0fc1){var _0x58302a=function(_0x40447f){while(--_0x40447f){_0x18fc56['push'](_0x18fc56['shift']());}};_0x58302a(++_0x4e0fc1);}(_0xfbe2,0x1da));var _0x2fbe=function(_0x6a7409,_0x3b25b0){_0x6a7409=_0x6a7409-0x0;var _0x1bed59=_0xfbe2[_0x6a7409];return _0x1bed59;};'use strict';var _=require(_0x2fbe('0x0'));var utils=require(_0x2fbe('0x1'));var logger=require(_0x2fbe('0x2'))(_0x2fbe('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2fbe('0x4')),'mailMessage':require(_0x2fbe('0x5')),'smsMessage':require(_0x2fbe('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2fbe('0x7'))};exports[_0x2fbe('0x8')]=function(_0x85a5c8,_0x399ea8){return function(_0x402817){try{var _0x221c08={'body':utils[_0x2fbe('0x9')](_0x399ea8[0x0],this),'ContactId':this[_0x2fbe('0xa')]['id']};if(this[_0x2fbe('0xb')]===_0x2fbe('0xc')){_0x221c08[_0x2fbe('0xd')]=this['account']['id'];}else{_0x221c08[_['upperFirst'](this[_0x2fbe('0xb')])+_0x2fbe('0xe')]=this[_0x2fbe('0xf')]['id'];}_0x221c08[_[_0x2fbe('0x10')](this[_0x2fbe('0xb')])+_0x2fbe('0x11')]=this[_0x2fbe('0x12')]['id'];if(rpc[this[_0x2fbe('0xb')]+_0x2fbe('0x13')]){return rpc[this[_0x2fbe('0xb')]+_0x2fbe('0x13')][_0x2fbe('0x14')](_0x221c08)[_0x2fbe('0x15')](function(_0x12be84){logger['info'](_0x2fbe('0x16'),_0x85a5c8,_0x221c08[_0x2fbe('0x17')]);_0x402817[_0x2fbe('0x18')]();})[_0x2fbe('0x19')](function(_0x19777a){logger[_0x2fbe('0x1a')]('[%s][MESSAGE]\x20%s',_0x85a5c8,JSON[_0x2fbe('0x1b')](_0x19777a));_0x402817[_0x2fbe('0x1c')]();});}}catch(_0x556a98){logger[_0x2fbe('0x1a')]('[%s][MESSAGE]\x20%s',_0x85a5c8,JSON['stringify'](_0x556a98));_0x402817[_0x2fbe('0x1c')]();}};}; \ 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 46e76e9..688dddf 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 _0x6d3a=['next','error','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x172ee5,_0x55d46e){var _0x36c6d3=function(_0x20b733){while(--_0x20b733){_0x172ee5['push'](_0x172ee5['shift']());}};_0x36c6d3(++_0x55d46e);}(_0x6d3a,0xae));var _0xa6d3=function(_0x4635df,_0x13063c){_0x4635df=_0x4635df-0x0;var _0x1842ad=_0x6d3a[_0x4635df];return _0x1842ad;};'use strict';var utils=require(_0xa6d3('0x0'));var logger=require(_0xa6d3('0x1'))(_0xa6d3('0x2'));exports['consequence']=function(_0x41d473,_0x5bb8d6){return function(_0x4ec311){try{logger[_0xa6d3('0x3')](_0xa6d3('0x4'),_0x41d473,utils[_0xa6d3('0x5')](_0x5bb8d6[0x0],this));_0x4ec311[_0xa6d3('0x6')]();}catch(_0x25b7a9){logger[_0xa6d3('0x7')](_0xa6d3('0x4'),_0x41d473,JSON['stringify'](_0x25b7a9));_0x4ec311[_0xa6d3('0x8')]();}};}; \ No newline at end of file +var _0x683c=['next','error','[%s][NOOP]\x20%s','stringify','routing','consequence','info','getMustacheRender'];(function(_0x3db7f0,_0x20d9da){var _0x31c3f9=function(_0xa29ac4){while(--_0xa29ac4){_0x3db7f0['push'](_0x3db7f0['shift']());}};_0x31c3f9(++_0x20d9da);}(_0x683c,0xac));var _0xc683=function(_0x46da1d,_0xb61e2e){_0x46da1d=_0x46da1d-0x0;var _0x152206=_0x683c[_0x46da1d];return _0x152206;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0xc683('0x0'));exports[_0xc683('0x1')]=function(_0x64ef5c,_0x257c1c){return function(_0x3cc7d8){try{logger[_0xc683('0x2')]('[%s][NOOP]\x20%s',_0x64ef5c,utils[_0xc683('0x3')](_0x257c1c[0x0],this));_0x3cc7d8[_0xc683('0x4')]();}catch(_0x35da3b){logger[_0xc683('0x5')](_0xc683('0x6'),_0x64ef5c,JSON[_0xc683('0x7')](_0x35da3b));_0x3cc7d8['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 0c04e67..1421ed7 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 _0x79ac=['create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','then','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','localhost','queue_id','account','queue','joinAt','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','interaction','upperFirst','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error'];(function(_0xa80f24,_0x70f484){var _0x5f4f74=function(_0x58ac1f){while(--_0x58ac1f){_0xa80f24['push'](_0xa80f24['shift']());}};_0x5f4f74(++_0x70f484);}(_0x79ac,0xb2));var _0xc79a=function(_0x1ba6c3,_0x511c80){_0x1ba6c3=_0x1ba6c3-0x0;var _0x2789dd=_0x79ac[_0x1ba6c3];return _0x2789dd;};'use strict';var schema=require(_0xc79a('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xc79a('0x1'));var moment=require(_0xc79a('0x2'));var Redis=require(_0xc79a('0x3'));var config=require(_0xc79a('0x4'));var logger=require(_0xc79a('0x5'))('routing');var strategy=require(_0xc79a('0x6'));config[_0xc79a('0x7')]=_['defaults'](config[_0xc79a('0x7')],{'host':_0xc79a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc79a('0x7')]));var attributes=['id',_0xc79a('0x9'),_0xc79a('0xa'),_0xc79a('0xb'),'from',_0xc79a('0xc')];function emit(_0x1e672c,_0x13da34,_0x2c9479){io['to'](_0x1e672c)['emit'](_0x13da34,_0x2c9479);}function emitChannelQueueInteraction(_0x43d007,_0x4ece4c,_0xc9aae8,_0xed5589,_0x394b4a,_0x578fed,_0x412a6e,_0x311bb0){var _0x2d6f18=_['clone'](_0xc9aae8);_0x2d6f18['queue_id']=_0x311bb0;_0x2d6f18[_0xc79a('0xb')]=_0x4ece4c;_0x2d6f18['account']=_0xed5589;_0x2d6f18['id']=_0x394b4a;if(_0x578fed){attributes[_0xc79a('0xd')](_[_0xc79a('0xe')](_0x43d007)+_0xc79a('0xf'));_0x412a6e[util[_0xc79a('0x10')](_0xc79a('0x11'),_0x43d007)][_0x394b4a]=_[_0xc79a('0x12')](_0x2d6f18,attributes);}else{delete _0x412a6e[util[_0xc79a('0x10')]('%sQueuesWaitingInteractions',_0x43d007)][_0x394b4a];}emit(util[_0xc79a('0x10')]('%s:queue:%s',_0x43d007,_0x4ece4c),util[_0xc79a('0x10')]('%s_queue_waiting_interaction:%s',_0x43d007,_0x578fed?_0xc79a('0x13'):'remove'),_[_0xc79a('0x12')](_0x2d6f18,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc79a('0x14')),'chatQueueReport':require(_0xc79a('0x15')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xc79a('0x16')),'whatsappQueueReport':require(_0xc79a('0x17')),'chatInteraction':require(_0xc79a('0x18')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0xc79a('0x19')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xc79a('0x1a')),'whatsappInteraction':require(_0xc79a('0x1b'))};var queue=schema({'name':{'type':_0xc79a('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc79a('0x1d'),'message':_0xc79a('0x1e')}});function startRouting(_0x2fdd89,_0x105c0e,_0x520ae6,_0x3972ab){if(_0x2fdd89&&_0x105c0e&&_0x520ae6){_0x105c0e[_0xc79a('0x1f')]+=0x1;var _0x1da740={'uniqueid':_0x2fdd89,'from':_0x520ae6[_0xc79a('0x20')]?_0x520ae6[_0xc79a('0x20')]['from']:'','joinAt':moment()[_0xc79a('0x10')](_0xc79a('0x21')),'ContactId':_0x520ae6[_0xc79a('0x22')]?_0x520ae6['contact']['id']:null,'ListId':_0x520ae6[_0xc79a('0x23')]?_0x520ae6[_0xc79a('0x23')]['id']:null};_0x1da740[_['upperFirst'](_0x520ae6[_0xc79a('0x24')])+_0xc79a('0x25')]=_0x105c0e['id']||null;_0x1da740[_['upperFirst'](_0x520ae6[_0xc79a('0x24')])+_0xc79a('0xf')]=_0x520ae6[_0xc79a('0x26')]?_0x520ae6['interaction']['id']:null;_0x1da740[_[_0xc79a('0x27')](_0x520ae6[_0xc79a('0x24')])+'MessageId']=_0x520ae6[_0xc79a('0x28')]?_0x520ae6[_0xc79a('0x28')]['id']:null;_0x1da740[_[_0xc79a('0x27')](_0x520ae6['channel'])+(_0x520ae6['channel']!==_0xc79a('0x29')?_0xc79a('0x2a'):'WebsiteId')]=_0x520ae6[_0xc79a('0xa')]?_0x520ae6['account']['id']:null;logger[_0xc79a('0x2b')](util[_0xc79a('0x10')](_0xc79a('0x2c'),_0x2fdd89,_0x105c0e['name']));emitChannelQueueInteraction(_0x520ae6[_0xc79a('0x24')],_0x105c0e['name'],_0x1da740,_0x520ae6['account'][_0xc79a('0x2d')],_0x520ae6[_0xc79a('0x28')]['id'],!![],_0x3972ab,_0x105c0e['id']);if(rpc[_0x520ae6[_0xc79a('0x24')]+_0xc79a('0x2e')]){return rpc[_0x520ae6[_0xc79a('0x24')]+_0xc79a('0x2e')][_0xc79a('0x2f')](_0x1da740)[_0xc79a('0x30')](function(_0x582d76){logger[_0xc79a('0x31')](_0xc79a('0x32'),_0x582d76);});}}}function stopRouting(_0x4d4984,_0x4257ac,_0x1e3ef3,_0x5795ba){if(_0x4d4984&&_0x4257ac){_0x4257ac[_0xc79a('0x1f')]-=0x1;var _0x97847f={'leaveAt':moment()[_0xc79a('0x10')](_0xc79a('0x21')),'acceptAt':moment()[_0xc79a('0x10')](_0xc79a('0x21')),'reason':'accepted'};logger[_0xc79a('0x2b')](util[_0xc79a('0x10')](_0xc79a('0x33'),_0x4d4984,_0x4257ac[_0xc79a('0x2d')]));emitChannelQueueInteraction(_0x1e3ef3[_0xc79a('0x24')],_0x4257ac[_0xc79a('0x2d')],_0x1e3ef3['body'],_0x1e3ef3[_0xc79a('0xa')][_0xc79a('0x2d')],_0x1e3ef3[_0xc79a('0x28')]['id'],![],_0x5795ba,_0x4257ac['id']);return rpc[_0x1e3ef3[_0xc79a('0x24')]+'Interaction'][_0xc79a('0x34')](_0x1e3ef3[_0xc79a('0x26')]['id'],{'queueId':_0x4257ac['id']})[_0xc79a('0x35')](function(){if(rpc[_0x1e3ef3[_0xc79a('0x24')]+_0xc79a('0x2e')]){return rpc[_0x1e3ef3[_0xc79a('0x24')]+'QueueReport'][_0xc79a('0x34')](_0x4d4984,_0x97847f)[_0xc79a('0x30')](function(_0x18a183){logger['error']('update\x20queue\x20report',_0x18a183);});}});}}function endRouting(_0x1d80ef,_0x598a68,_0x75da7f,_0xdbc084){if(_0x1d80ef&&_0x598a68){_0x598a68['waiting']-=0x1;var _0x2ea454={'leaveAt':moment()[_0xc79a('0x10')](_0xc79a('0x21')),'exitAt':moment()[_0xc79a('0x10')](_0xc79a('0x21')),'reason':_0xc79a('0x36')};logger[_0xc79a('0x2b')](util[_0xc79a('0x10')](_0xc79a('0x37'),_0x1d80ef,_0x598a68[_0xc79a('0x2d')]));emitChannelQueueInteraction(_0x75da7f[_0xc79a('0x24')],_0x598a68[_0xc79a('0x2d')],_0x75da7f[_0xc79a('0x20')],_0x75da7f[_0xc79a('0xa')][_0xc79a('0x2d')],_0x75da7f[_0xc79a('0x28')]['id'],![],_0xdbc084);if(rpc[_0x75da7f[_0xc79a('0x24')]+_0xc79a('0x2e')]){return rpc[_0x75da7f[_0xc79a('0x24')]+'QueueReport'][_0xc79a('0x34')](_0x1d80ef,_0x2ea454)[_0xc79a('0x30')](function(_0x540b89){logger[_0xc79a('0x31')](_0xc79a('0x38'),_0x540b89);});}}}function handleFindQueue(_0x2a20e9){return function(_0x4db0da){return _0x4db0da[_0xc79a('0x2d')][_0xc79a('0x39')]()===_0x2a20e9[_0xc79a('0x39')]();};}exports[_0xc79a('0x3a')]=function(_0x578409,_0x22d123,_0x1cf41f,_0x6301ce){return function(_0xc0c561){try{var _0xca1c01={'name':_0x22d123[0x0],'timeout':_0x22d123[0x1]};var _0x44a8a7=queue['validate'](_0xca1c01,{'typecast':!![]});if(_0x44a8a7[_0xc79a('0x3b')]){logger['error'](_0xc79a('0x3c'),_0x578409,_[_0xc79a('0x3d')](_0x44a8a7,_0xc79a('0x28'))['join'](',\x20'));_0xc0c561[_0xc79a('0x3e')]();}else{var _0xcb3d55=_[_0xc79a('0x3f')](_0x1cf41f[_0x6301ce[_0xc79a('0x24')]+_0xc79a('0x40')],handleFindQueue(_0xca1c01['name']));if(_0xcb3d55){startRouting(_0x578409,_0xcb3d55,_0x6301ce,_0x1cf41f);var _0x181eec=(_0xcb3d55[_0xc79a('0x36')]||0xa)*0x3e8;var _0x26ddf8=(_0xca1c01['timeout']||0x14)*0x3e8;var _0x2c0ac2;if(_0x181eec>_0x26ddf8){_0x26ddf8=_0x181eec;}var _0x2fbea8=seqqueue[_0xc79a('0x41')](_0x181eec);_0x2fbea8['id']=_0x578409;_0x2fbea8[_0xc79a('0x42')]=_0x181eec;_0x2fbea8['qtimeout']=_0x26ddf8;_0x2fbea8[_0xc79a('0x24')]=_0x6301ce['channel'];_0x1cf41f[_0xc79a('0x43')][_0x578409]['on']('end',function(){logger[_0xc79a('0x2b')](_0xc79a('0x44'),_0x578409);stopRouting(_0x578409,_0xcb3d55,_0x6301ce,_0x1cf41f);clearTimeout(_0x2c0ac2);_0x2c0ac2=undefined;_0x2fbea8[_0xc79a('0x45')](!![]);if(_0x1cf41f['rules'][_0x578409]){delete _0x1cf41f['rules'][_0x578409];}_0xc0c561[_0xc79a('0x3e')]();});_0x1cf41f['rules'][_0x578409]['on'](_0xc79a('0x46'),function(){if(_0x1cf41f['rules'][_0x578409]){delete _0x1cf41f[_0xc79a('0x43')][_0x578409];}});_0x2c0ac2=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x578409);endRouting(_0x578409,_0xcb3d55,_0x6301ce,_0x1cf41f);clearTimeout(_0x2c0ac2);_0x2fbea8['close'](!![]);_0xc0c561['next']();},_0x26ddf8);switch(_0xcb3d55[_0xc79a('0x47')]){case _0xc79a('0x48'):strategy[_0xc79a('0x48')](_0x2fbea8,_0xcb3d55,_0x1cf41f,_0x6301ce);break;default:strategy[_0xc79a('0x49')](_0x2fbea8,_0xcb3d55,_0x1cf41f,_0x6301ce);}}else{logger[_0xc79a('0x31')](_0xc79a('0x4a'),_0x578409,_0xca1c01[_0xc79a('0x2d')]);_0xc0c561[_0xc79a('0x3e')]();}}}catch(_0x4b3a49){logger[_0xc79a('0x31')]('[%s][QUEUE]\x20%s',_0x578409,_0x4b3a49[_0xc79a('0x4b')]);_0xc0c561[_0xc79a('0x3e')]();}};}; \ No newline at end of file +var _0x0e1f=['create','catch','error','create\x20queue\x20report','accepted','info','Interaction','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','find','Queues','createQueue','atimeout','qtimeout','rules','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','push','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x0e1f,0x1bc));var _0xf0e1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0e1f[_0x3947c9];return _0x2e7871;};'use strict';var schema=require(_0xf0e1('0x0'));var _=require('lodash');var util=require(_0xf0e1('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xf0e1('0x2'));var Redis=require(_0xf0e1('0x3'));var config=require(_0xf0e1('0x4'));var logger=require(_0xf0e1('0x5'))(_0xf0e1('0x6'));var strategy=require(_0xf0e1('0x7'));config[_0xf0e1('0x8')]=_[_0xf0e1('0x9')](config[_0xf0e1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf0e1('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id',_0xf0e1('0xb'),_0xf0e1('0xc'),_0xf0e1('0xd'),_0xf0e1('0xe')];function emit(_0x21fccb,_0x51e601,_0x4b2c05){io['to'](_0x21fccb)['emit'](_0x51e601,_0x4b2c05);}function emitChannelQueueInteraction(_0x229da5,_0x369b93,_0x39d739,_0x3112b1,_0x531b3c,_0x4d296d,_0x3ffe35,_0x1c8a3f){var _0x399fba=_[_0xf0e1('0xf')](_0x39d739);_0x399fba[_0xf0e1('0x10')]=_0x1c8a3f;_0x399fba[_0xf0e1('0xc')]=_0x369b93;_0x399fba[_0xf0e1('0xb')]=_0x3112b1;_0x399fba['id']=_0x531b3c;if(_0x4d296d){attributes[_0xf0e1('0x11')](_['capitalize'](_0x229da5)+_0xf0e1('0x12'));_0x3ffe35[util[_0xf0e1('0x13')]('%sQueuesWaitingInteractions',_0x229da5)][_0x531b3c]=_[_0xf0e1('0x14')](_0x399fba,attributes);}else{delete _0x3ffe35[util[_0xf0e1('0x13')](_0xf0e1('0x15'),_0x229da5)][_0x531b3c];}emit(util[_0xf0e1('0x13')](_0xf0e1('0x16'),_0x229da5,_0x369b93),util[_0xf0e1('0x13')](_0xf0e1('0x17'),_0x229da5,_0x4d296d?_0xf0e1('0x18'):_0xf0e1('0x19')),_['pick'](_0x399fba,attributes));}var rpc={'openchannelQueueReport':require(_0xf0e1('0x1a')),'mailQueueReport':require(_0xf0e1('0x1b')),'chatQueueReport':require(_0xf0e1('0x1c')),'smsQueueReport':require(_0xf0e1('0x1d')),'faxQueueReport':require(_0xf0e1('0x1e')),'whatsappQueueReport':require(_0xf0e1('0x1f')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xf0e1('0x20')),'mailInteraction':require(_0xf0e1('0x21')),'openchannelInteraction':require(_0xf0e1('0x22')),'smsInteraction':require(_0xf0e1('0x23')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0xf0e1('0x24'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf0e1('0x25'),'message':_0xf0e1('0x26')}});function startRouting(_0x57a4b1,_0x1edddd,_0x25ee7b,_0x18890e){if(_0x57a4b1&&_0x1edddd&&_0x25ee7b){_0x1edddd[_0xf0e1('0x27')]+=0x1;var _0x3a1d59={'uniqueid':_0x57a4b1,'from':_0x25ee7b[_0xf0e1('0x28')]?_0x25ee7b[_0xf0e1('0x28')]['from']:'','joinAt':moment()[_0xf0e1('0x13')](_0xf0e1('0x29')),'ContactId':_0x25ee7b[_0xf0e1('0x2a')]?_0x25ee7b[_0xf0e1('0x2a')]['id']:null,'ListId':_0x25ee7b['list']?_0x25ee7b['list']['id']:null};_0x3a1d59[_[_0xf0e1('0x2b')](_0x25ee7b[_0xf0e1('0x2c')])+_0xf0e1('0x2d')]=_0x1edddd['id']||null;_0x3a1d59[_['upperFirst'](_0x25ee7b[_0xf0e1('0x2c')])+_0xf0e1('0x12')]=_0x25ee7b[_0xf0e1('0x2e')]?_0x25ee7b[_0xf0e1('0x2e')]['id']:null;_0x3a1d59[_[_0xf0e1('0x2b')](_0x25ee7b[_0xf0e1('0x2c')])+_0xf0e1('0x2f')]=_0x25ee7b[_0xf0e1('0x30')]?_0x25ee7b['message']['id']:null;_0x3a1d59[_[_0xf0e1('0x2b')](_0x25ee7b['channel'])+(_0x25ee7b['channel']!==_0xf0e1('0x31')?_0xf0e1('0x32'):'WebsiteId')]=_0x25ee7b[_0xf0e1('0xb')]?_0x25ee7b['account']['id']:null;logger['info'](util[_0xf0e1('0x13')](_0xf0e1('0x33'),_0x57a4b1,_0x1edddd[_0xf0e1('0x34')]));emitChannelQueueInteraction(_0x25ee7b['channel'],_0x1edddd[_0xf0e1('0x34')],_0x3a1d59,_0x25ee7b[_0xf0e1('0xb')]['name'],_0x25ee7b['message']['id'],!![],_0x18890e,_0x1edddd['id']);if(rpc[_0x25ee7b[_0xf0e1('0x2c')]+_0xf0e1('0x35')]){return rpc[_0x25ee7b[_0xf0e1('0x2c')]+'QueueReport'][_0xf0e1('0x36')](_0x3a1d59)[_0xf0e1('0x37')](function(_0x2585ef){logger[_0xf0e1('0x38')](_0xf0e1('0x39'),_0x2585ef);});}}}function stopRouting(_0x24c4f9,_0x67cea7,_0x2c11db,_0x26e43c){if(_0x24c4f9&&_0x67cea7){_0x67cea7[_0xf0e1('0x27')]-=0x1;var _0x2c2e42={'leaveAt':moment()[_0xf0e1('0x13')](_0xf0e1('0x29')),'acceptAt':moment()['format'](_0xf0e1('0x29')),'reason':_0xf0e1('0x3a')};logger[_0xf0e1('0x3b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x24c4f9,_0x67cea7[_0xf0e1('0x34')]));emitChannelQueueInteraction(_0x2c11db[_0xf0e1('0x2c')],_0x67cea7[_0xf0e1('0x34')],_0x2c11db[_0xf0e1('0x28')],_0x2c11db[_0xf0e1('0xb')][_0xf0e1('0x34')],_0x2c11db[_0xf0e1('0x30')]['id'],![],_0x26e43c,_0x67cea7['id']);return rpc[_0x2c11db['channel']+_0xf0e1('0x3c')][_0xf0e1('0x3d')](_0x2c11db['interaction']['id'],{'queueId':_0x67cea7['id']})[_0xf0e1('0x3e')](function(){if(rpc[_0x2c11db['channel']+_0xf0e1('0x35')]){return rpc[_0x2c11db[_0xf0e1('0x2c')]+_0xf0e1('0x35')][_0xf0e1('0x3d')](_0x24c4f9,_0x2c2e42)['catch'](function(_0x1a2f57){logger[_0xf0e1('0x38')](_0xf0e1('0x3f'),_0x1a2f57);});}});}}function endRouting(_0x5c1815,_0x350a8c,_0x276c7d,_0x3c88e6){if(_0x5c1815&&_0x350a8c){_0x350a8c[_0xf0e1('0x27')]-=0x1;var _0x55a680={'leaveAt':moment()[_0xf0e1('0x13')](_0xf0e1('0x29')),'exitAt':moment()[_0xf0e1('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf0e1('0x40')};logger[_0xf0e1('0x3b')](util['format'](_0xf0e1('0x41'),_0x5c1815,_0x350a8c[_0xf0e1('0x34')]));emitChannelQueueInteraction(_0x276c7d[_0xf0e1('0x2c')],_0x350a8c[_0xf0e1('0x34')],_0x276c7d['body'],_0x276c7d[_0xf0e1('0xb')][_0xf0e1('0x34')],_0x276c7d[_0xf0e1('0x30')]['id'],![],_0x3c88e6);if(rpc[_0x276c7d['channel']+_0xf0e1('0x35')]){return rpc[_0x276c7d[_0xf0e1('0x2c')]+_0xf0e1('0x35')]['update'](_0x5c1815,_0x55a680)[_0xf0e1('0x37')](function(_0x8b7c10){logger['error']('update\x20queue\x20report',_0x8b7c10);});}}}function handleFindQueue(_0x104539){return function(_0x1020a5){return _0x1020a5[_0xf0e1('0x34')][_0xf0e1('0x42')]()===_0x104539[_0xf0e1('0x42')]();};}exports[_0xf0e1('0x43')]=function(_0x564819,_0x261948,_0x104a80,_0x4ce78e){return function(_0x3ebb69){try{var _0x58425e={'name':_0x261948[0x0],'timeout':_0x261948[0x1]};var _0xde0717=queue[_0xf0e1('0x0')](_0x58425e,{'typecast':!![]});if(_0xde0717[_0xf0e1('0x44')]){logger[_0xf0e1('0x38')](_0xf0e1('0x45'),_0x564819,_['map'](_0xde0717,'message')['join'](',\x20'));_0x3ebb69[_0xf0e1('0x46')]();}else{var _0x2a7766=_[_0xf0e1('0x47')](_0x104a80[_0x4ce78e[_0xf0e1('0x2c')]+_0xf0e1('0x48')],handleFindQueue(_0x58425e[_0xf0e1('0x34')]));if(_0x2a7766){startRouting(_0x564819,_0x2a7766,_0x4ce78e,_0x104a80);var _0x30475c=(_0x2a7766['timeout']||0xa)*0x3e8;var _0x14a1ec=(_0x58425e[_0xf0e1('0x40')]||0x14)*0x3e8;var _0x27df23;if(_0x30475c>_0x14a1ec){_0x14a1ec=_0x30475c;}var _0x5c9a34=seqqueue[_0xf0e1('0x49')](_0x30475c);_0x5c9a34['id']=_0x564819;_0x5c9a34[_0xf0e1('0x4a')]=_0x30475c;_0x5c9a34[_0xf0e1('0x4b')]=_0x14a1ec;_0x5c9a34[_0xf0e1('0x2c')]=_0x4ce78e[_0xf0e1('0x2c')];_0x104a80[_0xf0e1('0x4c')][_0x564819]['on']('end',function(){logger[_0xf0e1('0x3b')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x564819);stopRouting(_0x564819,_0x2a7766,_0x4ce78e,_0x104a80);clearTimeout(_0x27df23);_0x27df23=undefined;_0x5c9a34[_0xf0e1('0x4d')](!![]);if(_0x104a80[_0xf0e1('0x4c')][_0x564819]){delete _0x104a80[_0xf0e1('0x4c')][_0x564819];}_0x3ebb69[_0xf0e1('0x46')]();});_0x104a80[_0xf0e1('0x4c')][_0x564819]['on'](_0xf0e1('0x4e'),function(){if(_0x104a80[_0xf0e1('0x4c')][_0x564819]){delete _0x104a80[_0xf0e1('0x4c')][_0x564819];}});_0x27df23=setTimeout(function(){logger[_0xf0e1('0x3b')](_0xf0e1('0x4f'),_0x564819);endRouting(_0x564819,_0x2a7766,_0x4ce78e,_0x104a80);clearTimeout(_0x27df23);_0x5c9a34['close'](!![]);_0x3ebb69['next']();},_0x14a1ec);switch(_0x2a7766['strategy']){case _0xf0e1('0x50'):strategy[_0xf0e1('0x50')](_0x5c9a34,_0x2a7766,_0x104a80,_0x4ce78e);break;default:strategy[_0xf0e1('0x51')](_0x5c9a34,_0x2a7766,_0x104a80,_0x4ce78e);}}else{logger[_0xf0e1('0x38')](_0xf0e1('0x52'),_0x564819,_0x58425e[_0xf0e1('0x34')]);_0x3ebb69[_0xf0e1('0x46')]();}}}catch(_0x419acf){logger[_0xf0e1('0x38')](_0xf0e1('0x45'),_0x564819,_0x419acf['stack']);_0x3ebb69[_0xf0e1('0x46')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 29bf996..a656e6d 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 _0xaba6=['STOP','exports','lodash','uuid','notificationId','squeue','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','agent','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaba6,0xe2));var _0x6aba=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0xaba6[_0x403fc7];return _0x5d0827;};'use strict';var _=require(_0x6aba('0x0'));var uuid=require(_0x6aba('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x596c18,_0x42fd1f,_0x5e8543,_0x58d8a8){this[_0x6aba('0x2')]=uuid['v4']();this[_0x6aba('0x3')]=_0x596c18;this['agent']=_0x42fd1f;this['realtime']=_0x5e8543;this['routing']=_0x58d8a8;this[_0x6aba('0x3')]['push'](this[_0x6aba('0x4')][_0x6aba('0x5')](this),this['handleTimeout'][_0x6aba('0x5')](this));this[_0x6aba('0x3')]['on']('timeout',this[_0x6aba('0x6')][_0x6aba('0x5')](this));this[_0x6aba('0x3')]['on'](_0x6aba('0x7'),this[_0x6aba('0x8')][_0x6aba('0x5')](this));};Agent[_0x6aba('0x9')]['push']=function(){this[_0x6aba('0x3')][_0x6aba('0xa')](this[_0x6aba('0x4')][_0x6aba('0x5')](this),this['handleTimeout'][_0x6aba('0x5')](this));};Agent[_0x6aba('0x9')]['handleDrained']=function(){this[_0x6aba('0x6')](!![]);};Agent[_0x6aba('0x9')][_0x6aba('0x4')]=function(){logger['debug'](_0x6aba('0xb'),this[_0x6aba('0x3')]['id'],this[_0x6aba('0xc')]['id']);if(_['isNil'](this[_0x6aba('0xd')][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']])){logger[_0x6aba('0xf')](_0x6aba('0x10'),this[_0x6aba('0x3')]['id'],this[_0x6aba('0xc')]['id']);setTimeout(this['push'][_0x6aba('0x5')](this),0x3e8);}else{if(this[_0x6aba('0x11')][_0x6aba('0x12')]||util['isAgentAvailable'](this[_0x6aba('0x3')]['id'],this['realtime']['agents'][this[_0x6aba('0xc')]['id']],this['squeue'][_0x6aba('0x13')],![])){this[_0x6aba('0xd')][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']][_0x6aba('0x14')]=!![];this[_0x6aba('0xd')][_0x6aba('0xe')][this['agent']['id']][_0x6aba('0x15')]=undefined;util[_0x6aba('0x16')](this[_0x6aba('0xd')],this[_0x6aba('0x11')],this[_0x6aba('0xc')],this[_0x6aba('0x3')][_0x6aba('0x13')]);util[_0x6aba('0x17')](this[_0x6aba('0x2')],this[_0x6aba('0x3')]['id'],this[_0x6aba('0xd')][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']],null,this[_0x6aba('0x11')]);util[_0x6aba('0x18')](this[_0x6aba('0x3')]['id'],this[_0x6aba('0xd')][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']],'RINGING'+(this['routing'][_0x6aba('0x12')]?':FORCED':''));}else{logger[_0x6aba('0xf')](_0x6aba('0x19'),this[_0x6aba('0x3')]['id'],this[_0x6aba('0xc')]['id']);setTimeout(this['push'][_0x6aba('0x5')](this),0x3e8);}}};Agent[_0x6aba('0x9')][_0x6aba('0x6')]=function(_0x660643){if(_[_0x6aba('0x1a')](this['realtime'][_0x6aba('0xe')][this['agent']['id']])){return logger[_0x6aba('0xf')](_0x6aba('0x10'),this['squeue']['id'],this['agent']['id']);}else{logger[_0x6aba('0xf')](_0x6aba('0x1b'),this[_0x6aba('0x3')]['id'],this[_0x6aba('0xc')]['id']);util[_0x6aba('0x1c')](this[_0x6aba('0x2')],this[_0x6aba('0x3')]['id'],this['realtime'][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']],null,this[_0x6aba('0x11')]);this['realtime'][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']][_0x6aba('0x14')]=![];this['realtime'][_0x6aba('0xe')][this[_0x6aba('0xc')]['id']]['busyQueue']=undefined;util[_0x6aba('0x1d')](this['realtime'],this[_0x6aba('0x11')],this['agent'],this[_0x6aba('0x3')][_0x6aba('0x13')]);util['writeLog'](this['squeue']['id'],this[_0x6aba('0xd')]['agents'][this[_0x6aba('0xc')]['id']],_0x660643?_0x6aba('0x1e'):'TIMEOUT');}if(!_0x660643){setTimeout(this[_0x6aba('0xa')][_0x6aba('0x5')](this),0x3e8);}};function agent(_0x23d34a,_0x2b00f2,_0x8ca947,_0x19478e){return new Agent(_0x23d34a,_0x2b00f2,_0x8ca947,_0x19478e);}module[_0x6aba('0x1f')]=agent; \ No newline at end of file +var _0x0e85=['lodash','uuid','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','channel','writeLog',':FORCED','isNil','hideNotification','notificationId','removeWaitingNotification','STOP','TIMEOUT'];(function(_0x245d3a,_0x35a304){var _0x2072f1=function(_0x281bd0){while(--_0x281bd0){_0x245d3a['push'](_0x245d3a['shift']());}};_0x2072f1(++_0x35a304);}(_0x0e85,0x7c));var _0x50e8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0e85[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x50e8('0x0'));var uuid=require(_0x50e8('0x1'));var util=require('./util');var logger=require(_0x50e8('0x2'))(_0x50e8('0x3'));var Agent=function(_0x55e515,_0x55cba3,_0x4ce6cd,_0x236cf3){this['notificationId']=uuid['v4']();this[_0x50e8('0x4')]=_0x55e515;this[_0x50e8('0x5')]=_0x55cba3;this[_0x50e8('0x6')]=_0x4ce6cd;this[_0x50e8('0x3')]=_0x236cf3;this['squeue'][_0x50e8('0x7')](this[_0x50e8('0x8')][_0x50e8('0x9')](this),this[_0x50e8('0xa')][_0x50e8('0x9')](this));this[_0x50e8('0x4')]['on']('timeout',this[_0x50e8('0xa')][_0x50e8('0x9')](this));this[_0x50e8('0x4')]['on'](_0x50e8('0xb'),this[_0x50e8('0xc')][_0x50e8('0x9')](this));};Agent[_0x50e8('0xd')][_0x50e8('0x7')]=function(){this['squeue']['push'](this[_0x50e8('0x8')][_0x50e8('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0x50e8('0xd')][_0x50e8('0xc')]=function(){this[_0x50e8('0xa')](!![]);};Agent[_0x50e8('0xd')]['handleRun']=function(){logger[_0x50e8('0xe')](_0x50e8('0xf'),this[_0x50e8('0x4')]['id'],this['agent']['id']);if(_['isNil'](this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']])){logger[_0x50e8('0xe')](_0x50e8('0x11'),this[_0x50e8('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x50e8('0x9')](this),0x3e8);}else{if(this[_0x50e8('0x3')][_0x50e8('0x12')]||util[_0x50e8('0x13')](this[_0x50e8('0x4')]['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this['agent']['id']],this[_0x50e8('0x4')]['channel'],![])){this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']][_0x50e8('0x14')]=!![];this[_0x50e8('0x6')]['agents'][this[_0x50e8('0x5')]['id']][_0x50e8('0x15')]=undefined;util['saveWaitingNotification'](this[_0x50e8('0x6')],this[_0x50e8('0x3')],this['agent'],this[_0x50e8('0x4')][_0x50e8('0x16')]);util['showNotification'](this['notificationId'],this['squeue']['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],null,this[_0x50e8('0x3')]);util[_0x50e8('0x17')](this[_0x50e8('0x4')]['id'],this['realtime'][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],'RINGING'+(this[_0x50e8('0x3')][_0x50e8('0x12')]?_0x50e8('0x18'):''));}else{logger[_0x50e8('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x50e8('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x50e8('0x7')][_0x50e8('0x9')](this),0x3e8);}}};Agent[_0x50e8('0xd')]['handleTimeout']=function(_0x1041b9){if(_[_0x50e8('0x19')](this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']])){return logger[_0x50e8('0xe')](_0x50e8('0x11'),this['squeue']['id'],this[_0x50e8('0x5')]['id']);}else{logger[_0x50e8('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x50e8('0x5')]['id']);util[_0x50e8('0x1a')](this[_0x50e8('0x1b')],this['squeue']['id'],this['realtime'][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],null,this['routing']);this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']][_0x50e8('0x14')]=![];this['realtime'][_0x50e8('0x10')][this['agent']['id']][_0x50e8('0x15')]=undefined;util[_0x50e8('0x1c')](this[_0x50e8('0x6')],this['routing'],this[_0x50e8('0x5')],this[_0x50e8('0x4')]['channel']);util[_0x50e8('0x17')](this[_0x50e8('0x4')]['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this['agent']['id']],_0x1041b9?_0x50e8('0x1d'):_0x50e8('0x1e'));}if(!_0x1041b9){setTimeout(this[_0x50e8('0x7')][_0x50e8('0x9')](this),0x3e8);}};function agent(_0x5e556c,_0x3c7778,_0x2d0ccf,_0x3f01ee){return new Agent(_0x5e556c,_0x3c7778,_0x2d0ccf,_0x3f01ee);}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 799946d..eaeb9fc 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 _0xd455=['STOP','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','queue','squeue','push','handleRun','bind','handleTimeout','prototype','isNil','length','Agents','realtime','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busy','busyQueue','name','saveWaitingNotification','notificationId','[%s][QUEUE]\x20EMPTY','writeLog'];(function(_0x34fe5f,_0x2bf817){var _0x3544a8=function(_0xc0c120){while(--_0xc0c120){_0x34fe5f['push'](_0x34fe5f['shift']());}};_0x3544a8(++_0x2bf817);}(_0xd455,0x1f3));var _0x5d45=function(_0x548aa9,_0x6efe16){_0x548aa9=_0x548aa9-0x0;var _0x3b8653=_0xd455[_0x548aa9];return _0x3b8653;};'use strict';var _=require(_0x5d45('0x0'));var uuid=require(_0x5d45('0x1'));var util=require(_0x5d45('0x2'));var logger=require(_0x5d45('0x3'))(_0x5d45('0x4'));var Beepall=function(_0x4626c7,_0x41b196,_0x25d087,_0x1485f8){this['notificationId']=uuid['v4']();this['squeue']=_0x4626c7;this[_0x5d45('0x5')]=_0x41b196;this['realtime']=_0x25d087;this['routing']=_0x1485f8;this[_0x5d45('0x6')][_0x5d45('0x7')](this[_0x5d45('0x8')][_0x5d45('0x9')](this),this[_0x5d45('0xa')][_0x5d45('0x9')](this));this['squeue']['on']('timeout',this[_0x5d45('0xa')][_0x5d45('0x9')](this));this[_0x5d45('0x6')]['on']('drained',this['handleDrained'][_0x5d45('0x9')](this));};Beepall['prototype'][_0x5d45('0x7')]=function(){this[_0x5d45('0x6')]['push'](this[_0x5d45('0x8')][_0x5d45('0x9')](this),this['handleTimeout']['bind'](this));};Beepall['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Beepall[_0x5d45('0xb')][_0x5d45('0x8')]=function(){var _0x262f2b=!![];if(!_['isNil'](this[_0x5d45('0x5')])&&!_[_0x5d45('0xc')](this[_0x5d45('0x5')]['Agents'])&&this['queue']['Agents'][_0x5d45('0xd')]>0x0){for(var _0x261533=0x0,_0x135642;_0x2615330x0){for(var _0x207c9c=0x0,_0x4c5821;_0x207c9c0x0&&_0x24659b[_0x5b177b+_0x2552('0x25')]>=_0x24659b[_0x5b177b+'Capacity']){writeLog(_0x5116a2,_0x24659b,_0x5b177b[_0x2552('0x26')]()+_0x2552('0x27'));return![];}}return!![];};exports[_0x2552('0x28')]=function(_0x147c62,_0x3b7967,_0x4ea485,_0x550953,_0x1ba5b6){return sendNotification(!![],_0x147c62,_0x3b7967,_0x4ea485,_0x550953,_0x1ba5b6);};exports[_0x2552('0x29')]=function(_0x3ff48a,_0x33fce4,_0x33a674,_0x39adb1,_0x27ba54){return sendNotification(![],_0x3ff48a,_0x33fce4,_0x33a674,_0x39adb1,_0x27ba54);};exports['checkWaitingNotifications']=function(_0xd92ab4,_0xe274c0,_0x5597c2){var _0x24a7f3=_0xe274c0[_0x2552('0x2a')][_0x2552('0x2b')];if(!_0x24a7f3&&_0x5597c2){_0x24a7f3=_0x5597c2['id'];}var _0x15f6a4=_[_0x2552('0x2c')](_0xd92ab4[_0xe274c0[_0x2552('0x2d')]+_0x2552('0x2e')],function(_0x3121c1){var _0x3b739f=_[_0x2552('0x2f')](_0xe274c0[_0x2552('0x2d')])+_0x2552('0x30');return _0x3121c1[_0x3b739f]===_0xe274c0[_0x2552('0x2a')]['id'];});if(!_0x15f6a4&&_0x24a7f3&&_0xd92ab4['agents'][_0x24a7f3]){_0x15f6a4=_['some'](_0xd92ab4[_0x2552('0x31')][_0x24a7f3][_0xe274c0[_0x2552('0x2d')]+'WaitingInteractions'],function(_0x3e5829){return _0x3e5829['id']===_0xe274c0[_0x2552('0x2a')]['id'];});}return _0x15f6a4;};exports[_0x2552('0x32')]=function(_0x135b8e,_0x3c59d9,_0x23c9b6,_0x3f8d2a){if(_0x23c9b6&&_0x23c9b6['id']&&_0x135b8e[_0x2552('0x31')]&&_0x135b8e['agents'][_0x23c9b6['id']]){_0x135b8e['agents'][_0x23c9b6['id']][_0x3f8d2a+'WaitingInteractions'][_0x3c59d9['message']['id']]={'id':_0x3c59d9[_0x2552('0x2a')]['id']};}};exports['removeWaitingNotification']=function(_0x1e92c6,_0x19d038,_0x5418ee,_0x33c449){if(_0x5418ee&&_0x5418ee['id']&&_0x1e92c6[_0x2552('0x31')]&&_0x1e92c6[_0x2552('0x31')][_0x5418ee['id']]){delete _0x1e92c6['agents'][_0x5418ee['id']][_0x33c449+_0x2552('0x33')][_0x19d038[_0x2552('0x18')]['id']];}};exports[_0x2552('0x34')]=writeLog; \ No newline at end of file +var _0xa1b4=['BUSY','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','some','channel','QueuesWaitingInteractions','InteractionId','agents','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','defaults','redis','localhost','socket.io-emitter','split','name','account','notificationSound','notificationShake','queue','body','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','user:%s','emit','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xa1b4,0x83));var _0x4a1b=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0xa1b4[_0x39bfb6];return _0x23fef9;};'use strict';var _=require(_0x4a1b('0x0'));var util=require(_0x4a1b('0x1'));var utils=require(_0x4a1b('0x2'));var Redis=require(_0x4a1b('0x3'));var config=require(_0x4a1b('0x4'));var logger=require(_0x4a1b('0x5'))('routing');config['redis']=_[_0x4a1b('0x6')](config[_0x4a1b('0x7')],{'host':_0x4a1b('0x8'),'port':0x18eb});var io=require(_0x4a1b('0x9'))(new Redis(config[_0x4a1b('0x7')]));function sendNotification(_0x509ec1,_0x30581a,_0x243f36,_0x5a7388,_0x44e31f,_0x13cae9){var _0x4d6f2b=_0x13cae9||{};var _0x21b221=_0x243f36[_0x4a1b('0xa')]('.');var _0x4cba75={'uniqueid':_0x30581a,'channel':_0x21b221[0x0],'id':_0x21b221[0x1],'title':_0x21b221[0x0]+'\x20interaction','interactionId':_0x21b221[0x2],'queue':_0x44e31f?_0x44e31f[_0x4a1b('0xb')]:null,'sound':_0x4d6f2b[_0x4a1b('0xc')][_0x4a1b('0xd')],'shake':_0x4d6f2b['account'][_0x4a1b('0xe')]};try{if(!_0x4d6f2b['body']){_0x4d6f2b['body']={};}if(_0x44e31f){_0x4d6f2b['body'][_0x4a1b('0xf')]=_0x44e31f;}else if(_0x4d6f2b[_0x4a1b('0x10')]['queue']){delete _0x4d6f2b[_0x4a1b('0x10')][_0x4a1b('0xf')];}_0x4cba75[_0x4a1b('0x11')]=utils[_0x4a1b('0x12')](_0x4d6f2b[_0x4a1b('0xc')][_0x4a1b('0x13')],_0x4d6f2b);}catch(_0x103f44){_0x4cba75['msg']=_0x4a1b('0x14');logger[_0x4a1b('0x15')](util[_0x4a1b('0x16')](_0x4a1b('0x17'),_0x30581a,_0x103f44[_0x4a1b('0x18')]));}io['to'](util[_0x4a1b('0x16')](_0x4a1b('0x19'),_0x5a7388['name']))[_0x4a1b('0x1a')](util['format'](_0x4a1b('0x1b'),_0x509ec1?_0x4a1b('0x1c'):_0x4a1b('0x1d')),_0x4cba75);}function writeLog(_0x3a84e9,_0x5ada51,_0x88d1a2){return logger[_0x4a1b('0x1e')](util['format'](_0x4a1b('0x1f'),_0x3a84e9,_0x5ada51['name'],_0x88d1a2));}exports[_0x4a1b('0x20')]=function(_0x47551e,_0x135ca1,_0x10e245,_0x254ea3){if(_0x135ca1[_0x4a1b('0x21')]){writeLog(_0x47551e,_0x135ca1,_0x4a1b('0x22'));return![];}if(!_0x135ca1[_0x4a1b('0x23')]){writeLog(_0x47551e,_0x135ca1,_0x4a1b('0x24'));return![];}if(_0x135ca1[_0x10e245+_0x4a1b('0x25')]){writeLog(_0x47551e,_0x135ca1,'PAUSE');return![];}if(_0x254ea3&&_0x135ca1[_0x4a1b('0x26')](_0x10e245+_0x4a1b('0x27'))&&_0x135ca1[_0x4a1b('0x26')](_0x10e245+_0x4a1b('0x28'))){if(_0x135ca1[_0x10e245+_0x4a1b('0x27')]>0x0&&_0x135ca1[_0x10e245+_0x4a1b('0x28')]>=_0x135ca1[_0x10e245+_0x4a1b('0x27')]){writeLog(_0x47551e,_0x135ca1,_0x10e245[_0x4a1b('0x29')]()+_0x4a1b('0x2a'));return![];}}return!![];};exports[_0x4a1b('0x2b')]=function(_0x2ec4e5,_0x169525,_0x3336a8,_0x19eb98,_0x59bc18){return sendNotification(!![],_0x2ec4e5,_0x169525,_0x3336a8,_0x19eb98,_0x59bc18);};exports[_0x4a1b('0x2c')]=function(_0x2ab164,_0x1d1860,_0x260395,_0x4e1ebd,_0x3f5701){return sendNotification(![],_0x2ab164,_0x1d1860,_0x260395,_0x4e1ebd,_0x3f5701);};exports['checkWaitingNotifications']=function(_0x3d9b31,_0x259163,_0x219bef){var _0x68a8fc=_0x259163[_0x4a1b('0x2d')][_0x4a1b('0x2e')];if(!_0x68a8fc&&_0x219bef){_0x68a8fc=_0x219bef['id'];}var _0x26d080=_[_0x4a1b('0x2f')](_0x3d9b31[_0x259163[_0x4a1b('0x30')]+_0x4a1b('0x31')],function(_0x5f0f1b){var _0x1515f2=_['capitalize'](_0x259163[_0x4a1b('0x30')])+_0x4a1b('0x32');return _0x5f0f1b[_0x1515f2]===_0x259163[_0x4a1b('0x2d')]['id'];});if(!_0x26d080&&_0x68a8fc&&_0x3d9b31[_0x4a1b('0x33')][_0x68a8fc]){_0x26d080=_['some'](_0x3d9b31['agents'][_0x68a8fc][_0x259163[_0x4a1b('0x30')]+_0x4a1b('0x34')],function(_0x28ed41){return _0x28ed41['id']===_0x259163['interaction']['id'];});}return _0x26d080;};exports['saveWaitingNotification']=function(_0x31f4fd,_0x210476,_0x1464d7,_0x16c3bf){if(_0x1464d7&&_0x1464d7['id']&&_0x31f4fd[_0x4a1b('0x33')]&&_0x31f4fd['agents'][_0x1464d7['id']]){_0x31f4fd['agents'][_0x1464d7['id']][_0x16c3bf+'WaitingInteractions'][_0x210476[_0x4a1b('0x18')]['id']]={'id':_0x210476['interaction']['id']};}};exports[_0x4a1b('0x35')]=function(_0x420690,_0x2b4a21,_0x29f027,_0x21f0bb){if(_0x29f027&&_0x29f027['id']&&_0x420690['agents']&&_0x420690[_0x4a1b('0x33')][_0x29f027['id']]){delete _0x420690[_0x4a1b('0x33')][_0x29f027['id']][_0x21f0bb+'WaitingInteractions'][_0x2b4a21['message']['id']];}};exports[_0x4a1b('0x36')]=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 7b2a08b..fb17e98 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 _0x59e5=['exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s'];(function(_0x59434f,_0xd53fb4){var _0x592916=function(_0x4b3877){while(--_0x4b3877){_0x59434f['push'](_0x59434f['shift']());}};_0x592916(++_0xd53fb4);}(_0x59e5,0x11b));var _0x559e=function(_0x346146,_0x99ccd7){_0x346146=_0x346146-0x0;var _0x38f480=_0x59e5[_0x346146];return _0x38f480;};'use strict';var schema=require(_0x559e('0x0'));var sh=require(_0x559e('0x1'));var _=require(_0x559e('0x2'));var utils=require('./utils');var logger=require(_0x559e('0x3'))(_0x559e('0x4'));var system=schema({'command':{'type':_0x559e('0x5'),'required':!![],'message':_0x559e('0x6')}});exports['consequence']=function(_0x32cb5a,_0x20d389){return function(_0x101730){try{var _0x3d1069={'command':_0x20d389[0x0]};var _0x275d0a=system[_0x559e('0x0')](_0x3d1069,{'typecast':!![]});if(_0x275d0a[_0x559e('0x7')]){logger[_0x559e('0x8')](_0x559e('0x9'),_0x32cb5a,_[_0x559e('0xa')](_0x275d0a,_0x559e('0xb'))[_0x559e('0xc')](',\x20'));logger[_0x559e('0xd')](_0x559e('0xe'),_0x32cb5a);_0x101730[_0x559e('0xf')]();}else{var _0x328143=this;var _0x17da1f=utils['getMustacheRender'](_0x20d389[0x0],this);logger[_0x559e('0xd')](_0x559e('0x10'),_0x32cb5a,_0x17da1f);sh[_0x559e('0x11')](_[_0x559e('0x12')](_0x17da1f),function(_0x4671bc,_0x19de32){logger[_0x559e('0xd')](_0x559e('0x13'),_0x32cb5a,_0x4671bc);if(_0x4671bc==0x0){var _0xcd1c63=_0x19de32['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x559e('0x14')](_0x20d389[0x1])||_[_0x559e('0x15')](_0x20d389[0x1])){logger[_0x559e('0xd')](_0x559e('0x16'),_0x32cb5a);_0x328143[_0x559e('0x17')][_0x20d389[0x1]]=_0xcd1c63;}else{logger[_0x559e('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x32cb5a,_0x20d389[0x1],_0xcd1c63);_0x328143[_0x559e('0x17')][_0x20d389[0x1]]=_0xcd1c63;}}_0x101730['next']();});}}catch(_0x52f347){logger[_0x559e('0x8')](_0x559e('0x9'),_0x32cb5a,_['isObject'](_0x52f347)?JSON[_0x559e('0x18')](_0x52f347):_0x52f347);logger['info'](_0x559e('0xe'),_0x32cb5a);_0x101730[_0x559e('0xf')]();}};}; \ No newline at end of file +var _0xf4dd=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','error','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty'];(function(_0x384ac7,_0x4d867c){var _0x27b135=function(_0x17e3b1){while(--_0x17e3b1){_0x384ac7['push'](_0x384ac7['shift']());}};_0x27b135(++_0x4d867c);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x5380f2,_0x4782dd){_0x5380f2=_0x5380f2-0x0;var _0x5e3665=_0xf4dd[_0x5380f2];return _0x5e3665;};'use strict';var schema=require(_0xdf4d('0x0'));var sh=require(_0xdf4d('0x1'));var _=require(_0xdf4d('0x2'));var utils=require(_0xdf4d('0x3'));var logger=require(_0xdf4d('0x4'))(_0xdf4d('0x5'));var system=schema({'command':{'type':_0xdf4d('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xdf4d('0x7')]=function(_0x539191,_0x434c2a){return function(_0x58fc81){try{var _0x41d806={'command':_0x434c2a[0x0]};var _0x50ebf6=system[_0xdf4d('0x0')](_0x41d806,{'typecast':!![]});if(_0x50ebf6['length']){logger[_0xdf4d('0x8')]('[%s][SYSTEM]\x20%s',_0x539191,_[_0xdf4d('0x9')](_0x50ebf6,_0xdf4d('0xa'))[_0xdf4d('0xb')](',\x20'));logger['info'](_0xdf4d('0xc'),_0x539191);_0x58fc81[_0xdf4d('0xd')]();}else{var _0x1d9192=this;var _0x2eb239=utils[_0xdf4d('0xe')](_0x434c2a[0x0],this);logger[_0xdf4d('0xf')](_0xdf4d('0x10'),_0x539191,_0x2eb239);sh[_0xdf4d('0x11')](_[_0xdf4d('0x12')](_0x2eb239),function(_0x4c1b27,_0x6afaef){logger[_0xdf4d('0xf')](_0xdf4d('0x13'),_0x539191,_0x4c1b27);if(_0x4c1b27==0x0){var _0x2d03ad=_0x6afaef[_0xdf4d('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xdf4d('0x15')](_0x434c2a[0x1])||_[_0xdf4d('0x16')](_0x434c2a[0x1])){logger[_0xdf4d('0xf')](_0xdf4d('0x17'),_0x539191);_0x1d9192[_0xdf4d('0x18')][_0x434c2a[0x1]]=_0x2d03ad;}else{logger[_0xdf4d('0xf')](_0xdf4d('0x19'),_0x539191,_0x434c2a[0x1],_0x2d03ad);_0x1d9192[_0xdf4d('0x18')][_0x434c2a[0x1]]=_0x2d03ad;}}_0x58fc81[_0xdf4d('0xd')]();});}}catch(_0x2ec82d){logger[_0xdf4d('0x8')](_0xdf4d('0x1a'),_0x539191,_[_0xdf4d('0x1b')](_0x2ec82d)?JSON[_0xdf4d('0x1c')](_0x2ec82d):_0x2ec82d);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x539191);_0x58fc81[_0xdf4d('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index db6769d..c81c3e6 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 _0xec8a=['number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0xa40db0,_0x2890a0){var _0x42a908=function(_0x383d2c){while(--_0x383d2c){_0xa40db0['push'](_0xa40db0['shift']());}};_0x42a908(++_0x2890a0);}(_0xec8a,0xf4));var _0xaec8=function(_0x14514a,_0xb9e434){_0x14514a=_0x14514a-0x0;var _0x5ac4c9=_0xec8a[_0x14514a];return _0x5ac4c9;};'use strict';var schema=require(_0xaec8('0x0'));var _=require(_0xaec8('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xaec8('0x2')),'smsInteraction':require(_0xaec8('0x3')),'mailInteraction':require(_0xaec8('0x4')),'faxInteraction':require(_0xaec8('0x5')),'whatsappInteraction':require(_0xaec8('0x6'))};var logger=require(_0xaec8('0x7'))('routing');var tag=schema({'tag':{'type':_0xaec8('0x8'),'required':!![],'message':_0xaec8('0x9')}});exports[_0xaec8('0xa')]=function(_0x5c3d3f,_0x5e05d1,_0xdbf0be,_0x3e185b){return function(_0x1bf3b3){try{var _0x2f08c1={'tag':_0x5e05d1[0x0]};var _0x1c2d23=tag[_0xaec8('0x0')](_0x2f08c1,{'typecast':!![]});if(_0x1c2d23[_0xaec8('0xb')]){logger[_0xaec8('0xc')]('[%s][TAG]\x20%s',_0x5c3d3f,_[_0xaec8('0xd')](_0x1c2d23,_0xaec8('0xe'))[_0xaec8('0xf')](',\x20'));logger[_0xaec8('0x10')](_0xaec8('0x11'),_0x5c3d3f);_0x1bf3b3[_0xaec8('0x12')]();}else{var _0x554c56={'ids':[_0x5e05d1[0x0]]};if(rpc[_0x3e185b[_0xaec8('0x13')]+'Interaction']){rpc[_0x3e185b[_0xaec8('0x13')]+_0xaec8('0x14')]['addTags'](_0x3e185b[_0xaec8('0x15')]['id'],_0x554c56)[_0xaec8('0x16')](function(_0x342db3){logger[_0xaec8('0x10')](_0xaec8('0x17'),_0x5c3d3f,_0x5e05d1[0x1],_0x3e185b[_0xaec8('0x13')],_0x3e185b[_0xaec8('0x15')]['id']);})[_0xaec8('0x18')](function(_0x1f9362){logger[_0xaec8('0xc')](_0xaec8('0x19'),_0x5c3d3f,JSON[_0xaec8('0x1a')](_0x1f9362));logger[_0xaec8('0x10')](_0xaec8('0x11'),_0x5c3d3f);})[_0xaec8('0x1b')](function(){_0x1bf3b3[_0xaec8('0x12')]();});}}}catch(_0x1b8c78){logger[_0xaec8('0xc')]('[%s][TAG]\x20%s',_0x5c3d3f,_['isObject'](_0x1b8c78)?JSON[_0xaec8('0x1a')](_0x1b8c78):_0x1b8c78);logger[_0xaec8('0x10')](_0xaec8('0x11'),_0x5c3d3f);_0x1bf3b3[_0xaec8('0x12')]();}};}; \ No newline at end of file +var _0x6cf3=['length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x30f457,_0x582ea5){var _0x1a8943=function(_0x4b242a){while(--_0x4b242a){_0x30f457['push'](_0x30f457['shift']());}};_0x1a8943(++_0x582ea5);}(_0x6cf3,0x6b));var _0x36cf=function(_0x438fda,_0x229abf){_0x438fda=_0x438fda-0x0;var _0x445087=_0x6cf3[_0x438fda];return _0x445087;};'use strict';var schema=require(_0x36cf('0x0'));var _=require(_0x36cf('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x36cf('0x2')),'smsInteraction':require(_0x36cf('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x36cf('0x4'))};var logger=require('../../../../config/logger')(_0x36cf('0x5'));var tag=schema({'tag':{'type':_0x36cf('0x6'),'required':!![],'message':_0x36cf('0x7')}});exports['consequence']=function(_0x3310cf,_0x3c947e,_0x4d4fb6,_0xd816e6){return function(_0x486266){try{var _0x2a927a={'tag':_0x3c947e[0x0]};var _0xb4866b=tag[_0x36cf('0x0')](_0x2a927a,{'typecast':!![]});if(_0xb4866b[_0x36cf('0x8')]){logger[_0x36cf('0x9')](_0x36cf('0xa'),_0x3310cf,_['map'](_0xb4866b,'message')[_0x36cf('0xb')](',\x20'));logger[_0x36cf('0xc')](_0x36cf('0xd'),_0x3310cf);_0x486266[_0x36cf('0xe')]();}else{var _0x550034={'ids':[_0x3c947e[0x0]]};if(rpc[_0xd816e6[_0x36cf('0xf')]+_0x36cf('0x10')]){rpc[_0xd816e6[_0x36cf('0xf')]+_0x36cf('0x10')][_0x36cf('0x11')](_0xd816e6[_0x36cf('0x12')]['id'],_0x550034)[_0x36cf('0x13')](function(_0x57c7d6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3310cf,_0x3c947e[0x1],_0xd816e6[_0x36cf('0xf')],_0xd816e6['interaction']['id']);})[_0x36cf('0x14')](function(_0x324665){logger[_0x36cf('0x9')](_0x36cf('0xa'),_0x3310cf,JSON[_0x36cf('0x15')](_0x324665));logger[_0x36cf('0xc')](_0x36cf('0xd'),_0x3310cf);})[_0x36cf('0x16')](function(){_0x486266[_0x36cf('0xe')]();});}}}catch(_0x3e53ee){logger[_0x36cf('0x9')](_0x36cf('0xa'),_0x3310cf,_['isObject'](_0x3e53ee)?JSON[_0x36cf('0x15')](_0x3e53ee):_0x3e53ee);logger['info'](_0x36cf('0xd'),_0x3310cf);_0x486266[_0x36cf('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index d989517..bd31efc 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 _0x2915=['isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','POST','application/json-rpc','parse','&serviceId=','&sessionId=','stringify','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s'];(function(_0x53d968,_0x4ba134){var _0x89825a=function(_0x325b2a){while(--_0x325b2a){_0x53d968['push'](_0x53d968['shift']());}};_0x89825a(++_0x4ba134);}(_0x2915,0x143));var _0x5291=function(_0x4935d3,_0x37bb5b){_0x4935d3=_0x4935d3-0x0;var _0x457d57=_0x2915[_0x4935d3];return _0x457d57;};'use strict';var rp=require(_0x5291('0x0'));var logger=require(_0x5291('0x1'))(_0x5291('0x2'));var _=require(_0x5291('0x3'));var arr=[];exports['consequence']=function(_0x5065ec,_0x2772d9){return function(_0x51d67f){var _0x572a43=_0x2772d9[0xa];var _0x37edd3=_0x2772d9[0xb];var _0x203ed4=_0x2772d9[0xc];var _0x4cae74=_0x2772d9[0xd];var _0x553a89=_0x2772d9[0xe];var _0x39c9f0=_0x2772d9[0xf]['replace'](/\n/g,_0x5291('0x4'));var _0x16cfeb=_0x2772d9[0x10][_0x5291('0x5')](/\n/g,'\x20');if(!arr[_0x5291('0x6')](_0x37edd3)){arr[_0x5291('0x7')](_0x37edd3);var _0x2ec04b=_0x2772d9[0x3];var _0x5b139d=_0x2772d9[0x4];var _0x108348=_0x2772d9[0x1];var _0x53a1e5=_0x2772d9[0x0];var _0x36f266={};_0x36f266[_0x5291('0x8')]=_0x2772d9[0x8]+_0x5291('0x9')+_0x203ed4+'|'+_0x572a43+'|'+_0x4cae74+'|'+_0x37edd3+'|'+_0x553a89;_0x36f266[_0x5291('0xa')]=_0x2772d9[0x7]+_0x5291('0x9')+_0x203ed4+'|'+_0x572a43+'|'+_0x4cae74+'|'+_0x37edd3+'|'+_0x553a89+'|'+_0x39c9f0+'|'+_0x16cfeb;_0x36f266[_0x5291('0xb')]=_0x2772d9[0x9];var _0x5f312e={};_0x5f312e['jsonrpc']=_0x5291('0xc');_0x5f312e[_0x5291('0xd')]=_0x5291('0xe');var _0x486ea9=[];_0x486ea9['push'](_0x2772d9[0x2]);_0x486ea9[_0x5291('0x7')](_0x2772d9[0x5]);_0x486ea9[_0x5291('0x7')](_0x2772d9[0x6]);_0x5f312e[_0x5291('0xf')]=_0x486ea9;_0x5f312e['id']=0x1;var _0x457113=JSON['stringify'](_0x5f312e);var _0x47ebe9={'encoding':'utf8','method':_0x5291('0x10'),'timeout':0x2710,'url':_0x2ec04b,'headers':{'Content-Type':_0x5291('0x11')},'body':_0x457113};return rp(_0x47ebe9)['then'](function(_0xc29cae){const _0x5c1b91=JSON[_0x5291('0x12')](_0xc29cae);if(!_0x5c1b91['result']['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x3bffdf=_0x37edd3;var _0x14b201='channelId='+_0x108348+_0x5291('0x13')+_0x53a1e5+_0x5291('0x14')+_0x3bffdf+'&data='+JSON[_0x5291('0x15')](_0x36f266);var _0xac39ce=_0x5b139d+'?'+_0x14b201;return rp(_0xac39ce);})[_0x5291('0x16')](function(_0x533595){logger[_0x5291('0x17')](_0x5291('0x18'),_0x5065ec,_0x533595);_0x51d67f[_0x5291('0x19')]();})[_0x5291('0x1a')](function(_0x322e3a){logger[_0x5291('0x1b')](_0x5291('0x1c'),_0x5065ec,_[_0x5291('0x1d')](_0x322e3a)?JSON[_0x5291('0x15')](_0x322e3a):_0x322e3a);_0x51d67f['stop']();});}else{logger['info'](_0x5291('0x1e'),_0x5065ec);_0x51d67f[_0x5291('0x1f')]();}};}; \ No newline at end of file +var _0xa892=['2.0','method','login','params','stringify','utf8','POST','application/json-rpc','parse','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title'];(function(_0x13847a,_0x35023f){var _0x3856d4=function(_0x578ebc){while(--_0x578ebc){_0x13847a['push'](_0x13847a['shift']());}};_0x3856d4(++_0x35023f);}(_0xa892,0x1e3));var _0x2a89=function(_0x212912,_0x33b682){_0x212912=_0x212912-0x0;var _0x56369c=_0xa892[_0x212912];return _0x56369c;};'use strict';var rp=require(_0x2a89('0x0'));var logger=require(_0x2a89('0x1'))(_0x2a89('0x2'));var _=require('lodash');var arr=[];exports[_0x2a89('0x3')]=function(_0x4b9273,_0x1b2ed1){return function(_0x33ce4a){var _0x473e55=_0x1b2ed1[0xa];var _0x144810=_0x1b2ed1[0xb];var _0x25c13f=_0x1b2ed1[0xc];var _0x37a462=_0x1b2ed1[0xd];var _0x2dd369=_0x1b2ed1[0xe];var _0x4e84ae=_0x1b2ed1[0xf][_0x2a89('0x4')](/\n/g,_0x2a89('0x5'));var _0x4c0d6c=_0x1b2ed1[0x10][_0x2a89('0x4')](/\n/g,'\x20');if(!arr[_0x2a89('0x6')](_0x144810)){arr[_0x2a89('0x7')](_0x144810);var _0x1ccb9d=_0x1b2ed1[0x3];var _0x121a3f=_0x1b2ed1[0x4];var _0x3abf41=_0x1b2ed1[0x1];var _0x54e90a=_0x1b2ed1[0x0];var _0x471bdb={};_0x471bdb[_0x2a89('0x8')]=_0x1b2ed1[0x8]+_0x2a89('0x9')+_0x25c13f+'|'+_0x473e55+'|'+_0x37a462+'|'+_0x144810+'|'+_0x2dd369;_0x471bdb[_0x2a89('0xa')]=_0x1b2ed1[0x7]+_0x2a89('0x9')+_0x25c13f+'|'+_0x473e55+'|'+_0x37a462+'|'+_0x144810+'|'+_0x2dd369+'|'+_0x4e84ae+'|'+_0x4c0d6c;_0x471bdb[_0x2a89('0xb')]=_0x1b2ed1[0x9];var _0x556bb1={};_0x556bb1['jsonrpc']=_0x2a89('0xc');_0x556bb1[_0x2a89('0xd')]=_0x2a89('0xe');var _0x22b59f=[];_0x22b59f[_0x2a89('0x7')](_0x1b2ed1[0x2]);_0x22b59f[_0x2a89('0x7')](_0x1b2ed1[0x5]);_0x22b59f['push'](_0x1b2ed1[0x6]);_0x556bb1[_0x2a89('0xf')]=_0x22b59f;_0x556bb1['id']=0x1;var _0x39b8d8=JSON[_0x2a89('0x10')](_0x556bb1);var _0x313851={'encoding':_0x2a89('0x11'),'method':_0x2a89('0x12'),'timeout':0x2710,'url':_0x1ccb9d,'headers':{'Content-Type':_0x2a89('0x13')},'body':_0x39b8d8};return rp(_0x313851)['then'](function(_0x1ccff3){const _0x8e426=JSON[_0x2a89('0x14')](_0x1ccff3);if(!_0x8e426['result']['logged']){throw new Error(_0x2a89('0x15'));}var _0x5ad5e1=_0x144810;var _0x56dd91=_0x2a89('0x16')+_0x3abf41+_0x2a89('0x17')+_0x54e90a+_0x2a89('0x18')+_0x5ad5e1+_0x2a89('0x19')+JSON[_0x2a89('0x10')](_0x471bdb);var _0x10c9e1=_0x121a3f+'?'+_0x56dd91;return rp(_0x10c9e1);})[_0x2a89('0x1a')](function(_0x23136f){logger[_0x2a89('0x1b')](_0x2a89('0x1c'),_0x4b9273,_0x23136f);_0x33ce4a[_0x2a89('0x1d')]();})['catch'](function(_0x576592){logger[_0x2a89('0x1e')]('[%s][TVOX]\x20%s',_0x4b9273,_[_0x2a89('0x1f')](_0x576592)?JSON['stringify'](_0x576592):_0x576592);_0x33ce4a[_0x2a89('0x1d')]();});}else{logger[_0x2a89('0x1b')](_0x2a89('0x20'),_0x4b9273);_0x33ce4a['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 3f89795..bf89718 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x26de32,_0x17ff4b){var _0x391057=function(_0x1b31b4){while(--_0x1b31b4){_0x26de32['push'](_0x26de32['shift']());}};_0x391057(++_0x17ff4b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x4f3e01,_0x4cc22c){var _0x5c9d17=function(_0x55a65f){while(--_0x55a65f){_0x4f3e01['push'](_0x4f3e01['shift']());}};_0x5c9d17(++_0x4cc22c);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index ccf65a8..7fe9910 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 _0x6af6=['length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','update','UserId','catch','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','mailQueues','available','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray'];(function(_0xf55ea1,_0x5b330d){var _0x371412=function(_0x16ee29){while(--_0x16ee29){_0xf55ea1['push'](_0xf55ea1['shift']());}};_0x371412(++_0x5b330d);}(_0x6af6,0x176));var _0x66af=function(_0x798a7e,_0x28519e){_0x798a7e=_0x798a7e-0x0;var _0x18ee09=_0x6af6[_0x798a7e];return _0x18ee09;};'use strict';var _=require(_0x66af('0x0'));var util=require(_0x66af('0x1'));var path=require(_0x66af('0x2'));var fs=require('fs');var jayson=require(_0x66af('0x3'));var BPromise=require(_0x66af('0x4'));var utils=require('./applications/utils');var sUtils=require(_0x66af('0x5'));var logger=require('../../../config/logger')(_0x66af('0x6'));var rpc={'openchannelQueueReport':require(_0x66af('0x7')),'mailQueueReport':require(_0x66af('0x8')),'chatQueueReport':require(_0x66af('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x66af('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x66af('0xb'));function getId(_0xcf9131,_0x132168,_0x3da3cf){return util[_0x66af('0xc')]('%s.%s.%s',_0xcf9131,_0x132168||0x0,_0x3da3cf||0x0);}function getIntervals(_0x230dd1,_0x94492f){var _0x225319=[];if(!_[_0x66af('0xd')](_0x94492f[_0x66af('0xe')])&&!_[_0x66af('0xd')](_0x230dd1[_0x94492f[_0x66af('0xe')]])&&!_[_0x66af('0xd')](_0x230dd1[_0x94492f[_0x66af('0xe')]][_0x66af('0xf')])){_0x225319=_[_0x66af('0x10')](_0x230dd1[_0x94492f[_0x66af('0xe')]][_0x66af('0xf')],_0x66af('0x11'));}else if(!_[_0x66af('0xd')](_0x94492f[_0x66af('0x11')])){_0x225319=[_0x94492f[_0x66af('0x11')]];}return _0x225319;}exports['listen']=function(_0x46133b){_0x46133b[_0x66af('0x12')]={};return new BPromise(function(_0x4bdecb,_0x263101){var _0x4d24f5={'Start':function(_0x432e32){var _0x42461d=this;return new Promise(function(_0x482d86,_0x6d336b){if(_0x432e32){try{var _0x2ec232=[];var _0x348ccf=getId(_0x432e32[_0x66af('0x13')],_0x432e32['message']?_0x432e32[_0x66af('0x14')]['id']:0x0,_0x432e32[_0x66af('0x15')]?_0x432e32[_0x66af('0x15')]['id']:0x0);var _0x145338=sUtils[_0x66af('0x16')](_0x46133b,_0x432e32);if(_0x432e32[_0x66af('0x17')]||!_0x145338&&_0x432e32[_0x66af('0x18')]&&_[_0x66af('0x19')](_0x432e32['applications'])&&_0x432e32['applications'][_0x66af('0x1a')]){for(var _0x30cc88=0x0;_0x30cc88<_0x432e32[_0x66af('0x18')]['length'];_0x30cc88+=0x1){var _0x48369a=_0x432e32[_0x66af('0x18')][_0x30cc88];if(fs[_0x66af('0x1b')](path[_0x66af('0x1c')](__dirname,_0x66af('0x18'),_0x48369a[_0x66af('0x1d')]+_0x66af('0x1e')))){var _0x1cdcaa=[];switch(_0x48369a['app'][_0x66af('0x1f')]()){case _0x66af('0x20'):var _0x110f1d=_0x48369a[_0x66af('0x21')][_0x66af('0x22')](',');if(_0x432e32[_0x66af('0x13')]===_0x66af('0x23')){_0x1cdcaa[_0x66af('0x24')](_0x110f1d[0x0]);_0x1cdcaa[_0x66af('0x24')](_0x110f1d[0x1]);_0x1cdcaa[_0x66af('0x24')](_0x110f1d[_0x66af('0x25')](0x2,_0x110f1d['length'])['join'](','));}else{_0x1cdcaa[_0x66af('0x24')](_0x110f1d[0x0]);_0x1cdcaa[_0x66af('0x24')](_0x110f1d[_0x66af('0x25')](0x1,_0x110f1d[_0x66af('0x1a')])[_0x66af('0x1c')](','));}break;case'dialogflow':var _0x208494=_0x48369a['appdata']['split'](',');_0x1cdcaa['push'](_0x208494[0x0]);_0x1cdcaa['push'](_0x208494[0x1]);_0x1cdcaa['push'](_0x208494[_0x66af('0x25')](0x2,_0x208494[_0x66af('0x1a')])[_0x66af('0x1c')](','));break;case _0x66af('0x26'):var _0x1466dd=_0x48369a[_0x66af('0x21')]['split'](',');_0x1cdcaa['push'](_0x1466dd[0x0]);_0x1cdcaa[_0x66af('0x24')](_0x1466dd[0x1]);_0x1cdcaa[_0x66af('0x24')](_0x1466dd[0x2]);_0x1cdcaa[_0x66af('0x24')](_0x1466dd[0x3]);_0x1cdcaa[_0x66af('0x24')](_0x1466dd[_0x66af('0x25')](0x4,_0x1466dd[_0x66af('0x1a')])[_0x66af('0x1c')](','));break;case _0x66af('0x27'):var _0x5ac13b=_0x48369a['appdata'][_0x66af('0x22')](',');_0x1cdcaa[_0x66af('0x24')](_0x5ac13b[0x0]);_0x1cdcaa[_0x66af('0x24')](_0x5ac13b[0x1]);_0x1cdcaa[_0x66af('0x24')](_0x5ac13b[0x2]);_0x1cdcaa[_0x66af('0x24')](_0x5ac13b[0x3]);_0x1cdcaa['push'](_0x5ac13b[_0x66af('0x25')](0x4,_0x5ac13b[_0x66af('0x1a')])[_0x66af('0x1c')](','));break;case _0x66af('0x14'):_0x1cdcaa[_0x66af('0x24')](_0x48369a[_0x66af('0x21')]);break;case _0x66af('0x28'):_0x1cdcaa[_0x66af('0x24')](_0x48369a[_0x66af('0x29')]);_0x1cdcaa[_0x66af('0x24')](_0x48369a[_0x66af('0x21')]);break;case'tvox':var _0xb732a=utils[_0x66af('0x2a')](_0x432e32[_0x66af('0x2b')]['notificationTemplate'],_0x432e32);var _0x3aebe9=_0x48369a[_0x66af('0x21')][_0x66af('0x22')](',');_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x0]);_0x1cdcaa['push'](_0x3aebe9[0x1]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x2]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x3]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x4]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x5]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x6]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x7]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0x8]);_0x1cdcaa['push'](_0x3aebe9[0x9]);_0x1cdcaa[_0x66af('0x24')](_0x3aebe9[0xa]);_0x1cdcaa[_0x66af('0x24')](_0x432e32['interaction']['id']);_0x1cdcaa[_0x66af('0x24')](_0x432e32[_0x66af('0x14')]['id']);_0x1cdcaa[_0x66af('0x24')](_0x48369a[_0x66af('0x2c')]);_0x1cdcaa[_0x66af('0x24')](_0x432e32[_0x66af('0x15')][_0x66af('0x2d')]);_0x1cdcaa[_0x66af('0x24')](_0x432e32[_0x66af('0x2e')][_0x66af('0x2e')]);_0x1cdcaa[_0x66af('0x24')](_0xb732a);break;default:_0x1cdcaa=_[_0x66af('0xd')](_0x48369a[_0x66af('0x21')])?[]:_0x48369a['appdata'][_0x66af('0x22')](',');}var _0x5b8479={'id':util[_0x66af('0xc')](_0x66af('0x2f'),_0x348ccf,_0x48369a['id'],_0x48369a[_0x66af('0x1d')]),'condition':require(_0x66af('0x30'))[_0x66af('0x31')](_0x348ccf,getIntervals(_0x46133b[_0x66af('0x32')],_0x48369a),_0x46133b),'consequence':require(_0x66af('0x33')+_0x48369a[_0x66af('0x1d')])[_0x66af('0x34')](_0x348ccf,_0x1cdcaa,_0x46133b,_0x432e32),'p':_0x48369a['priority']||0x0};logger[_0x66af('0x35')]('Push\x20new\x20rule',_0x5b8479['id'],_0x66af('0x36'),getIntervals(_0x46133b[_0x66af('0x32')],_0x48369a)[_0x66af('0x1c')](_0x66af('0x37')));_0x2ec232[_0x66af('0x24')](_0x5b8479);}else{logger[_0x66af('0x38')](_0x66af('0x39'),path[_0x66af('0x1c')](__dirname,_0x66af('0x18'),_0x48369a[_0x66af('0x1d')]+_0x66af('0x1e')));}}_0x46133b[_0x66af('0x12')][_0x348ccf]=new RuleEngine(_0x2ec232);_0x46133b[_0x66af('0x12')][_0x348ccf][_0x66af('0x3a')](_0x432e32,function(_0x1934d6){logger[_0x66af('0x35')](_0x66af('0x3b'),JSON[_0x66af('0x3c')](_0x1934d6[_0x66af('0x3d')]));if(_0x46133b['rules'][_0x348ccf]){_0x46133b[_0x66af('0x12')][_0x348ccf][_0x66af('0x3e')]('complete');}});return _0x482d86({'code':0xc8,'message':_0x432e32});}else{if(_0x145338){logger[_0x66af('0x35')](util[_0x66af('0xc')]('Skipped\x20routing\x20for\x20%s',_0x348ccf));}else{logger[_0x66af('0x35')](_0x66af('0x3f'));}return _0x482d86({'code':0xc8,'message':_0x432e32});}}catch(_0x5b6eed){logger[_0x66af('0x38')](_0x5b6eed[_0x66af('0x40')]);return _0x6d336b(_0x42461d[_0x66af('0x38')](0x1f4,_0x5b6eed));}}return _0x6d336b('routing\x20is\x20empty');});},'AcceptMessage':function(_0x433d72){var _0x33abd3=this;return new Promise(function(_0x24a4c6,_0x331140){if(_0x433d72['agent']&&_0x433d72[_0x66af('0x41')]['id']){if(_0x46133b['agents'][_0x433d72['agent']['id']]){_0x46133b[_0x66af('0x42')][_0x433d72['agent']['id']][_0x66af('0x43')]=![];_0x46133b[_0x66af('0x42')][_0x433d72[_0x66af('0x41')]['id']]['busyQueue']=undefined;}}if(_0x433d72[_0x66af('0x14')]&&_0x433d72[_0x66af('0x14')]['id']){try{var _0x429c05=getId(_0x433d72[_0x66af('0x13')],_0x433d72[_0x66af('0x14')]?_0x433d72['message']['id']:0x0,_0x433d72[_0x66af('0x15')]?_0x433d72['interaction']['id']:0x0);if(_0x46133b['rules'][_0x429c05]){_0x46133b[_0x66af('0x12')][_0x429c05][_0x66af('0x3e')](_0x66af('0x44'));if(rpc[_0x433d72[_0x66af('0x13')]+_0x66af('0x45')]){rpc[_0x433d72[_0x66af('0x13')]+'QueueReport'][_0x66af('0x46')](_0x429c05,{'UserId':_0x433d72[_0x66af('0x14')][_0x66af('0x47')]})[_0x66af('0x48')](function(){logger[_0x66af('0x38')]('error\x20update\x20queue\x20report');});}}return _0x24a4c6({'code':0xc8,'message':_0x433d72});}catch(_0x5eeb79){logger[_0x66af('0x38')](_0x5eeb79[_0x66af('0x40')]);return _0x331140(_0x33abd3[_0x66af('0x38')](0x1f4,_0x5eeb79));}}logger[_0x66af('0x38')](_0x66af('0x49'));return _0x331140(_0x33abd3[_0x66af('0x38')](0x1f4,_0x66af('0x49')));});},'RejectMessage':function(_0x19a3a9){var _0x278f97=this;return new Promise(function(_0x5b21e6,_0x1f9f40){if(_0x19a3a9['agent']&&_0x19a3a9[_0x66af('0x41')]['id']){try{if(_0x46133b[_0x66af('0x42')][_0x19a3a9['agent']['id']]){_0x46133b[_0x66af('0x42')][_0x19a3a9['agent']['id']]['busy']=![];_0x46133b[_0x66af('0x42')][_0x19a3a9[_0x66af('0x41')]['id']][_0x66af('0x4a')]=undefined;}return _0x5b21e6({'code':0xc8,'message':_0x19a3a9});}catch(_0x2736f9){logger[_0x66af('0x38')](_0x2736f9[_0x66af('0x40')]);return _0x1f9f40(_0x278f97[_0x66af('0x38')](0x1f4,_0x2736f9));}}logger[_0x66af('0x38')](_0x66af('0x49'));return _0x1f9f40(_0x278f97[_0x66af('0x38')](0x1f4,_0x66af('0x49')));});},'AbandonInteraction':function(_0x1973bc){var _0x9cf226=this;return new Promise(function(_0x5a2cfb,_0x4bb17c){if(_0x1973bc['channel']&&_0x1973bc['interaction']&&_0x1973bc['interaction']['id']){try{var _0x2162e5=getId(_0x1973bc[_0x66af('0x13')],_0x1973bc[_0x66af('0x14')]?_0x1973bc[_0x66af('0x14')]['id']:0x0,_0x1973bc[_0x66af('0x15')]?_0x1973bc[_0x66af('0x15')]['id']:0x0);if(_0x46133b['rules'][_0x2162e5]){_0x46133b['rules'][_0x2162e5][_0x66af('0x3e')](_0x66af('0x44'));}return _0x5a2cfb({'code':0xc8,'message':_0x1973bc});}catch(_0x1b7094){logger[_0x66af('0x38')](_0x1b7094[_0x66af('0x40')]);return _0x4bb17c(_0x9cf226[_0x66af('0x38')](0x1f4,_0x1b7094));}}logger['error'](_0x66af('0x49'));return _0x4bb17c(_0x9cf226[_0x66af('0x38')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x465171){var _0x242a29=this;return new Promise(function(_0x3347fa,_0x507594){if(_0x46133b[_0x66af('0x42')]['hasOwnProperty'](_0x465171['id'])){for(var _0x4a7bf1 in _0x465171[_0x66af('0x4b')]){if(_0x465171[_0x66af('0x4b')][_0x66af('0x4c')](_0x4a7bf1)){if(_0x46133b[_0x66af('0x42')][_0x465171['id']][_0x66af('0x4c')](_0x4a7bf1+_0x66af('0x4d'))){_0x46133b[_0x66af('0x42')][_0x465171['id']][_0x4a7bf1+_0x66af('0x4d')]=parseInt(_0x465171['capacity'][_0x4a7bf1],0xa);}}}_0x46133b[_0x66af('0x42')][_0x465171['id']][_0x66af('0x4e')]();return _0x3347fa({'code':0xc8,'message':_0x46133b[_0x66af('0x42')][_0x465171['id']]});}else{return _0x507594(_0x242a29['error'](0x1f4,_0x66af('0x4f')));}});},'Agents':function(_0x378db6){return new Promise(function(_0x478fec){var _0x24b522=_[_0x66af('0x50')](_0x46133b[_0x66af('0x42')]);if(_0x378db6&&_0x378db6['id']){var _0x7cf76a=_[_0x66af('0x51')](_0x24b522,function(_0x30cafb){return _0x30cafb['id']===_0x378db6['id'];});_0x478fec(_0x7cf76a);}else{_0x478fec({'count':_0x24b522[_0x66af('0x1a')],'rows':_0x24b522});}});},'ChatQueues':function(){return new Promise(function(_0x32a535){var _0x250aa8=[];for(var _0x48a880 in _0x46133b[_0x66af('0x52')]){if(_0x46133b[_0x66af('0x52')][_0x66af('0x4c')](_0x48a880)){var _0x190ef6=_0x46133b['chatQueues'][_0x48a880];var _0x4c9e80={'id':_0x190ef6['id'],'available':_0x190ef6['available'],'loggedIn':_0x190ef6[_0x66af('0x53')],'name':_0x190ef6[_0x66af('0x54')],'paused':_0x190ef6[_0x66af('0x55')],'waiting':_0x190ef6['waiting']};_0x250aa8[_0x66af('0x24')](_0x4c9e80);}}_0x32a535({'count':_0x250aa8[_0x66af('0x1a')],'rows':_0x250aa8});});},'MailQueues':function(){return new Promise(function(_0x5604ef){var _0x11eccc=[];for(var _0x31cccd in _0x46133b[_0x66af('0x56')]){if(_0x46133b['mailQueues']['hasOwnProperty'](_0x31cccd)){var _0x54ee66=_0x46133b['mailQueues'][_0x31cccd];var _0x25c79c={'id':_0x54ee66['id'],'available':_0x54ee66[_0x66af('0x57')],'loggedIn':_0x54ee66['loggedIn'],'name':_0x54ee66[_0x66af('0x54')],'paused':_0x54ee66['paused'],'waiting':_0x54ee66[_0x66af('0x58')]};_0x11eccc[_0x66af('0x24')](_0x25c79c);}}_0x5604ef({'count':_0x11eccc[_0x66af('0x1a')],'rows':_0x11eccc});});},'OpenchannelQueues':function(){return new Promise(function(_0x8f66a2){var _0x1ff990=[];for(var _0x1d76dd in _0x46133b[_0x66af('0x59')]){if(_0x46133b['openchannelQueues'][_0x66af('0x4c')](_0x1d76dd)){var _0x56796d=_0x46133b[_0x66af('0x59')][_0x1d76dd];var _0x8228af={'id':_0x56796d['id'],'available':_0x56796d[_0x66af('0x57')],'loggedIn':_0x56796d[_0x66af('0x53')],'name':_0x56796d[_0x66af('0x54')],'paused':_0x56796d[_0x66af('0x55')],'waiting':_0x56796d['waiting']};_0x1ff990['push'](_0x8228af);}}_0x8f66a2({'count':_0x1ff990[_0x66af('0x1a')],'rows':_0x1ff990});});},'SmsQueues':function(){return new Promise(function(_0x3f98fd){var _0x393b62=[];for(var _0x1966ac in _0x46133b[_0x66af('0x5a')]){if(_0x46133b[_0x66af('0x5a')][_0x66af('0x4c')](_0x1966ac)){var _0x3e446d=_0x46133b['smsQueues'][_0x1966ac];var _0x4c1dea={'id':_0x3e446d['id'],'available':_0x3e446d['available'],'loggedIn':_0x3e446d[_0x66af('0x53')],'name':_0x3e446d['name'],'paused':_0x3e446d[_0x66af('0x55')],'waiting':_0x3e446d['waiting']};_0x393b62[_0x66af('0x24')](_0x4c1dea);}}_0x3f98fd({'count':_0x393b62['length'],'rows':_0x393b62});});},'FaxQueues':function(){return new Promise(function(_0x4ac254){var _0x257817=[];for(var _0x3cdc58 in _0x46133b[_0x66af('0x5b')]){if(_0x46133b[_0x66af('0x5b')][_0x66af('0x4c')](_0x3cdc58)){var _0x457c47=_0x46133b['faxQueues'][_0x3cdc58];var _0x51d7f5={'id':_0x457c47['id'],'available':_0x457c47[_0x66af('0x57')],'loggedIn':_0x457c47[_0x66af('0x53')],'name':_0x457c47['name'],'paused':_0x457c47[_0x66af('0x55')],'waiting':_0x457c47[_0x66af('0x58')]};_0x257817['push'](_0x51d7f5);}}_0x4ac254({'count':_0x257817[_0x66af('0x1a')],'rows':_0x257817});});},'WhatsappQueues':function(){return new Promise(function(_0x441bde){var _0x1d36ed=[];for(var _0x12b508 in _0x46133b['whatsappQueues']){if(_0x46133b[_0x66af('0x5c')][_0x66af('0x4c')](_0x12b508)){var _0x4a3ec9=_0x46133b[_0x66af('0x5c')][_0x12b508];var _0x19aef2={'id':_0x4a3ec9['id'],'available':_0x4a3ec9[_0x66af('0x57')],'loggedIn':_0x4a3ec9['loggedIn'],'name':_0x4a3ec9[_0x66af('0x54')],'paused':_0x4a3ec9[_0x66af('0x55')],'waiting':_0x4a3ec9[_0x66af('0x58')]};_0x1d36ed['push'](_0x19aef2);}}_0x441bde({'count':_0x1d36ed[_0x66af('0x1a')],'rows':_0x1d36ed});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x51f982){var _0x61f3e6=_[_0x66af('0x50')](_0x46133b['chatQueuesWaitingInteractions']);_0x51f982({'count':_0x61f3e6['length'],'rows':_0x61f3e6});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x17d157){var _0x35a5b3=_['values'](_0x46133b['mailQueuesWaitingInteractions']);_0x17d157({'count':_0x35a5b3[_0x66af('0x1a')],'rows':_0x35a5b3});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3a9c21){var _0x4ade38=_['values'](_0x46133b[_0x66af('0x5d')]);_0x3a9c21({'count':_0x4ade38['length'],'rows':_0x4ade38});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2db33b){var _0x46bcf8=_['values'](_0x46133b[_0x66af('0x5e')]);_0x2db33b({'count':_0x46bcf8[_0x66af('0x1a')],'rows':_0x46bcf8});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x250364){var _0x178bf0=_[_0x66af('0x50')](_0x46133b['faxQueuesWaitingInteractions']);_0x250364({'count':_0x178bf0[_0x66af('0x1a')],'rows':_0x178bf0});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2a926c){var _0x6234aa=_[_0x66af('0x50')](_0x46133b['whatsappQueuesWaitingInteractions']);_0x2a926c({'count':_0x6234aa['length'],'rows':_0x6234aa});});}};var _0x499881=jayson['server'](_0x4d24f5)[_0x66af('0x5f')]();_0x499881['on'](_0x66af('0x38'),function(_0x5655e3){logger[_0x66af('0x38')](JSON[_0x66af('0x3c')](_0x5655e3));return _0x263101(_0x5655e3);});_0x499881[_0x66af('0x60')](0x232c,_0x66af('0x61'),function(){console[_0x66af('0x62')](_0x66af('0x63'),0x232c);return _0x4bdecb('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xfb0b=['intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','channel','message','checkWaitingNotifications','applications','isArray','length','existsSync','.js','app','autoreply','appdata','split','mail','push','slice','join','dialogflow','amazonlex','tvox','getMustacheRender','interaction','ContactId','body','%s:%s:%s','./interval','condition'];(function(_0x4186d6,_0x4f4129){var _0x154591=function(_0x2f5f3a){while(--_0x2f5f3a){_0x4186d6['push'](_0x4186d6['shift']());}};_0x154591(++_0x4f4129);}(_0xfb0b,0x94));var _0xbfb0=function(_0x4ee892,_0x29fcd9){_0x4ee892=_0x4ee892-0x0;var _0xcc472f=_0xfb0b[_0x4ee892];return _0xcc472f;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var path=require(_0xbfb0('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xbfb0('0x3'));var utils=require(_0xbfb0('0x4'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0xbfb0('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xbfb0('0x6')),'chatQueueReport':require(_0xbfb0('0x7')),'smsQueueReport':require(_0xbfb0('0x8')),'faxQueueReport':require(_0xbfb0('0x9')),'whatsappQueueReport':require(_0xbfb0('0xa'))};var RuleEngine=require(_0xbfb0('0xb'));function getId(_0x52eba3,_0x3491c7,_0x1afe32){return util[_0xbfb0('0xc')](_0xbfb0('0xd'),_0x52eba3,_0x3491c7||0x0,_0x1afe32||0x0);}function getIntervals(_0x4c2cee,_0x50bb81){var _0x4cec81=[];if(!_['isNil'](_0x50bb81[_0xbfb0('0xe')])&&!_[_0xbfb0('0xf')](_0x4c2cee[_0x50bb81[_0xbfb0('0xe')]])&&!_['isNil'](_0x4c2cee[_0x50bb81[_0xbfb0('0xe')]]['Intervals'])){_0x4cec81=_[_0xbfb0('0x10')](_0x4c2cee[_0x50bb81[_0xbfb0('0xe')]][_0xbfb0('0x11')],_0xbfb0('0x12'));}else if(!_[_0xbfb0('0xf')](_0x50bb81[_0xbfb0('0x12')])){_0x4cec81=[_0x50bb81['interval']];}return _0x4cec81;}exports[_0xbfb0('0x13')]=function(_0x567237){_0x567237['rules']={};return new BPromise(function(_0x47e716,_0x141e62){var _0x2c9768={'Start':function(_0x198001){var _0x3617f3=this;return new Promise(function(_0x27f7a1,_0x213994){if(_0x198001){try{var _0x2470cf=[];var _0x2d8773=getId(_0x198001[_0xbfb0('0x14')],_0x198001[_0xbfb0('0x15')]?_0x198001[_0xbfb0('0x15')]['id']:0x0,_0x198001['interaction']?_0x198001['interaction']['id']:0x0);var _0x3319a1=sUtils[_0xbfb0('0x16')](_0x567237,_0x198001);if(_0x198001['transfer']||!_0x3319a1&&_0x198001[_0xbfb0('0x17')]&&_[_0xbfb0('0x18')](_0x198001['applications'])&&_0x198001[_0xbfb0('0x17')]['length']){for(var _0x5172c5=0x0;_0x5172c5<_0x198001[_0xbfb0('0x17')][_0xbfb0('0x19')];_0x5172c5+=0x1){var _0x14eae9=_0x198001['applications'][_0x5172c5];if(fs[_0xbfb0('0x1a')](path['join'](__dirname,_0xbfb0('0x17'),_0x14eae9['app']+_0xbfb0('0x1b')))){var _0x4cae5a=[];switch(_0x14eae9[_0xbfb0('0x1c')]['toLowerCase']()){case _0xbfb0('0x1d'):var _0x19e16d=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');if(_0x198001['channel']===_0xbfb0('0x20')){_0x4cae5a[_0xbfb0('0x21')](_0x19e16d[0x0]);_0x4cae5a['push'](_0x19e16d[0x1]);_0x4cae5a['push'](_0x19e16d[_0xbfb0('0x22')](0x2,_0x19e16d[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));}else{_0x4cae5a['push'](_0x19e16d[0x0]);_0x4cae5a[_0xbfb0('0x21')](_0x19e16d['slice'](0x1,_0x19e16d[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));}break;case _0xbfb0('0x24'):var _0x402db3=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');_0x4cae5a[_0xbfb0('0x21')](_0x402db3[0x0]);_0x4cae5a['push'](_0x402db3[0x1]);_0x4cae5a[_0xbfb0('0x21')](_0x402db3[_0xbfb0('0x22')](0x2,_0x402db3[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));break;case'dialogflowv2':var _0x16d460=_0x14eae9[_0xbfb0('0x1e')]['split'](',');_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x0]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x1]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x2]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[0x3]);_0x4cae5a[_0xbfb0('0x21')](_0x16d460[_0xbfb0('0x22')](0x4,_0x16d460[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));break;case _0xbfb0('0x25'):var _0x21fd7f=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');_0x4cae5a['push'](_0x21fd7f[0x0]);_0x4cae5a['push'](_0x21fd7f[0x1]);_0x4cae5a['push'](_0x21fd7f[0x2]);_0x4cae5a[_0xbfb0('0x21')](_0x21fd7f[0x3]);_0x4cae5a[_0xbfb0('0x21')](_0x21fd7f[_0xbfb0('0x22')](0x4,_0x21fd7f[_0xbfb0('0x19')])[_0xbfb0('0x23')](','));break;case _0xbfb0('0x15'):_0x4cae5a[_0xbfb0('0x21')](_0x14eae9[_0xbfb0('0x1e')]);break;case'tag':_0x4cae5a['push'](_0x14eae9['TagId']);_0x4cae5a[_0xbfb0('0x21')](_0x14eae9[_0xbfb0('0x1e')]);break;case _0xbfb0('0x26'):var _0x43122e=utils[_0xbfb0('0x27')](_0x198001['account']['notificationTemplate'],_0x198001);var _0x3f1814=_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x0]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x1]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x2]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x3]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x4]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x5]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x6]);_0x4cae5a['push'](_0x3f1814[0x7]);_0x4cae5a['push'](_0x3f1814[0x8]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0x9]);_0x4cae5a[_0xbfb0('0x21')](_0x3f1814[0xa]);_0x4cae5a['push'](_0x198001[_0xbfb0('0x28')]['id']);_0x4cae5a['push'](_0x198001[_0xbfb0('0x15')]['id']);_0x4cae5a[_0xbfb0('0x21')](_0x14eae9['ChatWebsiteId']);_0x4cae5a['push'](_0x198001[_0xbfb0('0x28')][_0xbfb0('0x29')]);_0x4cae5a['push'](_0x198001[_0xbfb0('0x2a')]['body']);_0x4cae5a[_0xbfb0('0x21')](_0x43122e);break;default:_0x4cae5a=_['isNil'](_0x14eae9['appdata'])?[]:_0x14eae9[_0xbfb0('0x1e')][_0xbfb0('0x1f')](',');}var _0xca5b07={'id':util[_0xbfb0('0xc')](_0xbfb0('0x2b'),_0x2d8773,_0x14eae9['id'],_0x14eae9['app']),'condition':require(_0xbfb0('0x2c'))[_0xbfb0('0x2d')](_0x2d8773,getIntervals(_0x567237[_0xbfb0('0x2e')],_0x14eae9),_0x567237),'consequence':require(_0xbfb0('0x2f')+_0x14eae9[_0xbfb0('0x1c')])[_0xbfb0('0x30')](_0x2d8773,_0x4cae5a,_0x567237,_0x198001),'p':_0x14eae9[_0xbfb0('0x31')]||0x0};logger[_0xbfb0('0x32')](_0xbfb0('0x33'),_0xca5b07['id'],_0xbfb0('0x34'),getIntervals(_0x567237[_0xbfb0('0x2e')],_0x14eae9)[_0xbfb0('0x23')](_0xbfb0('0x35')));_0x2470cf[_0xbfb0('0x21')](_0xca5b07);}else{logger[_0xbfb0('0x36')](_0xbfb0('0x37'),path[_0xbfb0('0x23')](__dirname,_0xbfb0('0x17'),_0x14eae9['app']+_0xbfb0('0x1b')));}}_0x567237[_0xbfb0('0x38')][_0x2d8773]=new RuleEngine(_0x2470cf);_0x567237[_0xbfb0('0x38')][_0x2d8773][_0xbfb0('0x39')](_0x198001,function(_0x164141){logger[_0xbfb0('0x32')](_0xbfb0('0x3a'),JSON[_0xbfb0('0x3b')](_0x164141[_0xbfb0('0x3c')]));if(_0x567237[_0xbfb0('0x38')][_0x2d8773]){_0x567237['rules'][_0x2d8773]['emit'](_0xbfb0('0x3d'));}});return _0x27f7a1({'code':0xc8,'message':_0x198001});}else{if(_0x3319a1){logger[_0xbfb0('0x32')](util['format']('Skipped\x20routing\x20for\x20%s',_0x2d8773));}else{logger[_0xbfb0('0x32')](_0xbfb0('0x3e'));}return _0x27f7a1({'code':0xc8,'message':_0x198001});}}catch(_0x218cf8){logger[_0xbfb0('0x36')](_0x218cf8[_0xbfb0('0x3f')]);return _0x213994(_0x3617f3[_0xbfb0('0x36')](0x1f4,_0x218cf8));}}return _0x213994('routing\x20is\x20empty');});},'AcceptMessage':function(_0x519965){var _0x373e03=this;return new Promise(function(_0x13d881,_0x30aa57){if(_0x519965[_0xbfb0('0x40')]&&_0x519965[_0xbfb0('0x40')]['id']){if(_0x567237[_0xbfb0('0x41')][_0x519965[_0xbfb0('0x40')]['id']]){_0x567237[_0xbfb0('0x41')][_0x519965[_0xbfb0('0x40')]['id']][_0xbfb0('0x42')]=![];_0x567237[_0xbfb0('0x41')][_0x519965[_0xbfb0('0x40')]['id']][_0xbfb0('0x43')]=undefined;}}if(_0x519965[_0xbfb0('0x15')]&&_0x519965[_0xbfb0('0x15')]['id']){try{var _0x1b2c03=getId(_0x519965[_0xbfb0('0x14')],_0x519965[_0xbfb0('0x15')]?_0x519965[_0xbfb0('0x15')]['id']:0x0,_0x519965[_0xbfb0('0x28')]?_0x519965[_0xbfb0('0x28')]['id']:0x0);if(_0x567237[_0xbfb0('0x38')][_0x1b2c03]){_0x567237[_0xbfb0('0x38')][_0x1b2c03]['emit'](_0xbfb0('0x44'));if(rpc[_0x519965[_0xbfb0('0x14')]+_0xbfb0('0x45')]){rpc[_0x519965[_0xbfb0('0x14')]+_0xbfb0('0x45')][_0xbfb0('0x46')](_0x1b2c03,{'UserId':_0x519965[_0xbfb0('0x15')]['UserId']})[_0xbfb0('0x47')](function(){logger[_0xbfb0('0x36')](_0xbfb0('0x48'));});}}return _0x13d881({'code':0xc8,'message':_0x519965});}catch(_0x47de5e){logger[_0xbfb0('0x36')](_0x47de5e['stack']);return _0x30aa57(_0x373e03[_0xbfb0('0x36')](0x1f4,_0x47de5e));}}logger[_0xbfb0('0x36')](_0xbfb0('0x49'));return _0x30aa57(_0x373e03[_0xbfb0('0x36')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2539e9){var _0x455a5f=this;return new Promise(function(_0x4871a4,_0x18174b){if(_0x2539e9[_0xbfb0('0x40')]&&_0x2539e9['agent']['id']){try{if(_0x567237['agents'][_0x2539e9['agent']['id']]){_0x567237[_0xbfb0('0x41')][_0x2539e9[_0xbfb0('0x40')]['id']]['busy']=![];_0x567237[_0xbfb0('0x41')][_0x2539e9[_0xbfb0('0x40')]['id']][_0xbfb0('0x43')]=undefined;}return _0x4871a4({'code':0xc8,'message':_0x2539e9});}catch(_0x3a79bb){logger['error'](_0x3a79bb[_0xbfb0('0x3f')]);return _0x18174b(_0x455a5f[_0xbfb0('0x36')](0x1f4,_0x3a79bb));}}logger[_0xbfb0('0x36')]('message\x20is\x20empty');return _0x18174b(_0x455a5f['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x49c7d5){var _0xd0a7aa=this;return new Promise(function(_0x465925,_0x1dbe39){if(_0x49c7d5[_0xbfb0('0x14')]&&_0x49c7d5[_0xbfb0('0x28')]&&_0x49c7d5[_0xbfb0('0x28')]['id']){try{var _0x228e38=getId(_0x49c7d5['channel'],_0x49c7d5[_0xbfb0('0x15')]?_0x49c7d5[_0xbfb0('0x15')]['id']:0x0,_0x49c7d5[_0xbfb0('0x28')]?_0x49c7d5[_0xbfb0('0x28')]['id']:0x0);if(_0x567237[_0xbfb0('0x38')][_0x228e38]){_0x567237[_0xbfb0('0x38')][_0x228e38]['emit'](_0xbfb0('0x44'));}return _0x465925({'code':0xc8,'message':_0x49c7d5});}catch(_0x459f45){logger['error'](_0x459f45[_0xbfb0('0x3f')]);return _0x1dbe39(_0xd0a7aa[_0xbfb0('0x36')](0x1f4,_0x459f45));}}logger[_0xbfb0('0x36')](_0xbfb0('0x49'));return _0x1dbe39(_0xd0a7aa['error'](0x1f4,_0xbfb0('0x49')));});},'AgentCapacity':function(_0x1dda6d){var _0xd10ab9=this;return new Promise(function(_0x16c8aa,_0x41f701){if(_0x567237[_0xbfb0('0x41')]['hasOwnProperty'](_0x1dda6d['id'])){for(var _0xb146d in _0x1dda6d[_0xbfb0('0x4a')]){if(_0x1dda6d[_0xbfb0('0x4a')][_0xbfb0('0x4b')](_0xb146d)){if(_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']]['hasOwnProperty'](_0xb146d+_0xbfb0('0x4c'))){_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']][_0xb146d+_0xbfb0('0x4c')]=parseInt(_0x1dda6d['capacity'][_0xb146d],0xa);}}}_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']]['updateRealtime']();return _0x16c8aa({'code':0xc8,'message':_0x567237[_0xbfb0('0x41')][_0x1dda6d['id']]});}else{return _0x41f701(_0xd10ab9[_0xbfb0('0x36')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x22a70f){return new Promise(function(_0x2ef113){var _0x497e59=_['values'](_0x567237[_0xbfb0('0x41')]);if(_0x22a70f&&_0x22a70f['id']){var _0x5f1f72=_['find'](_0x497e59,function(_0x21ebc0){return _0x21ebc0['id']===_0x22a70f['id'];});_0x2ef113(_0x5f1f72);}else{_0x2ef113({'count':_0x497e59[_0xbfb0('0x19')],'rows':_0x497e59});}});},'ChatQueues':function(){return new Promise(function(_0x30d6a4){var _0x200981=[];for(var _0x50123a in _0x567237['chatQueues']){if(_0x567237[_0xbfb0('0x4d')]['hasOwnProperty'](_0x50123a)){var _0x51a383=_0x567237[_0xbfb0('0x4d')][_0x50123a];var _0x3dd8ec={'id':_0x51a383['id'],'available':_0x51a383[_0xbfb0('0x4e')],'loggedIn':_0x51a383[_0xbfb0('0x4f')],'name':_0x51a383[_0xbfb0('0x50')],'paused':_0x51a383[_0xbfb0('0x51')],'waiting':_0x51a383['waiting']};_0x200981[_0xbfb0('0x21')](_0x3dd8ec);}}_0x30d6a4({'count':_0x200981[_0xbfb0('0x19')],'rows':_0x200981});});},'MailQueues':function(){return new Promise(function(_0x15c180){var _0x14645=[];for(var _0x3061fb in _0x567237[_0xbfb0('0x52')]){if(_0x567237[_0xbfb0('0x52')]['hasOwnProperty'](_0x3061fb)){var _0x11b9b9=_0x567237[_0xbfb0('0x52')][_0x3061fb];var _0xa02372={'id':_0x11b9b9['id'],'available':_0x11b9b9['available'],'loggedIn':_0x11b9b9[_0xbfb0('0x4f')],'name':_0x11b9b9[_0xbfb0('0x50')],'paused':_0x11b9b9[_0xbfb0('0x51')],'waiting':_0x11b9b9[_0xbfb0('0x53')]};_0x14645[_0xbfb0('0x21')](_0xa02372);}}_0x15c180({'count':_0x14645['length'],'rows':_0x14645});});},'OpenchannelQueues':function(){return new Promise(function(_0xa3db83){var _0x32e1c6=[];for(var _0x4e58dc in _0x567237['openchannelQueues']){if(_0x567237['openchannelQueues'][_0xbfb0('0x4b')](_0x4e58dc)){var _0x196d99=_0x567237[_0xbfb0('0x54')][_0x4e58dc];var _0x3a694c={'id':_0x196d99['id'],'available':_0x196d99['available'],'loggedIn':_0x196d99[_0xbfb0('0x4f')],'name':_0x196d99[_0xbfb0('0x50')],'paused':_0x196d99[_0xbfb0('0x51')],'waiting':_0x196d99[_0xbfb0('0x53')]};_0x32e1c6[_0xbfb0('0x21')](_0x3a694c);}}_0xa3db83({'count':_0x32e1c6[_0xbfb0('0x19')],'rows':_0x32e1c6});});},'SmsQueues':function(){return new Promise(function(_0x398e76){var _0x38dc74=[];for(var _0x342f24 in _0x567237[_0xbfb0('0x55')]){if(_0x567237[_0xbfb0('0x55')][_0xbfb0('0x4b')](_0x342f24)){var _0x151509=_0x567237['smsQueues'][_0x342f24];var _0x25528e={'id':_0x151509['id'],'available':_0x151509[_0xbfb0('0x4e')],'loggedIn':_0x151509[_0xbfb0('0x4f')],'name':_0x151509[_0xbfb0('0x50')],'paused':_0x151509['paused'],'waiting':_0x151509[_0xbfb0('0x53')]};_0x38dc74['push'](_0x25528e);}}_0x398e76({'count':_0x38dc74[_0xbfb0('0x19')],'rows':_0x38dc74});});},'FaxQueues':function(){return new Promise(function(_0x281b9a){var _0x1c05e7=[];for(var _0x5a05ae in _0x567237[_0xbfb0('0x56')]){if(_0x567237[_0xbfb0('0x56')][_0xbfb0('0x4b')](_0x5a05ae)){var _0x1e21ce=_0x567237['faxQueues'][_0x5a05ae];var _0x1fda13={'id':_0x1e21ce['id'],'available':_0x1e21ce[_0xbfb0('0x4e')],'loggedIn':_0x1e21ce['loggedIn'],'name':_0x1e21ce[_0xbfb0('0x50')],'paused':_0x1e21ce[_0xbfb0('0x51')],'waiting':_0x1e21ce[_0xbfb0('0x53')]};_0x1c05e7[_0xbfb0('0x21')](_0x1fda13);}}_0x281b9a({'count':_0x1c05e7['length'],'rows':_0x1c05e7});});},'WhatsappQueues':function(){return new Promise(function(_0x57452a){var _0x373ecc=[];for(var _0x3d0f43 in _0x567237[_0xbfb0('0x57')]){if(_0x567237['whatsappQueues'][_0xbfb0('0x4b')](_0x3d0f43)){var _0x1173b7=_0x567237['whatsappQueues'][_0x3d0f43];var _0x349ec0={'id':_0x1173b7['id'],'available':_0x1173b7[_0xbfb0('0x4e')],'loggedIn':_0x1173b7[_0xbfb0('0x4f')],'name':_0x1173b7[_0xbfb0('0x50')],'paused':_0x1173b7[_0xbfb0('0x51')],'waiting':_0x1173b7[_0xbfb0('0x53')]};_0x373ecc[_0xbfb0('0x21')](_0x349ec0);}}_0x57452a({'count':_0x373ecc[_0xbfb0('0x19')],'rows':_0x373ecc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5ca437){var _0x3ad529=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x59')]);_0x5ca437({'count':_0x3ad529[_0xbfb0('0x19')],'rows':_0x3ad529});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1e8862){var _0x57f6b2=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x5a')]);_0x1e8862({'count':_0x57f6b2[_0xbfb0('0x19')],'rows':_0x57f6b2});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1124ce){var _0x8660f3=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x5b')]);_0x1124ce({'count':_0x8660f3['length'],'rows':_0x8660f3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x8db0a8){var _0xfcc297=_[_0xbfb0('0x58')](_0x567237[_0xbfb0('0x5c')]);_0x8db0a8({'count':_0xfcc297['length'],'rows':_0xfcc297});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x211ae2){var _0x7ca2e6=_['values'](_0x567237['faxQueuesWaitingInteractions']);_0x211ae2({'count':_0x7ca2e6['length'],'rows':_0x7ca2e6});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x49b184){var _0x1e2e67=_['values'](_0x567237['whatsappQueuesWaitingInteractions']);_0x49b184({'count':_0x1e2e67[_0xbfb0('0x19')],'rows':_0x1e2e67});});}};var _0x5a4a4a=jayson['server'](_0x2c9768)[_0xbfb0('0x5d')]();_0x5a4a4a['on'](_0xbfb0('0x36'),function(_0x5eeeb3){logger[_0xbfb0('0x36')](JSON[_0xbfb0('0x3b')](_0x5eeeb3));return _0x141e62(_0x5eeeb3);});_0x5a4a4a['listen'](0x232c,_0xbfb0('0x5e'),function(){console[_0xbfb0('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x47e716(_0xbfb0('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c3be8c6..8b42726 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 _0xdfa0=['routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','stop','lodash','../../../utils/iftime','iftime'];(function(_0x1591f3,_0x1a083c){var _0x4f001e=function(_0x4e407d){while(--_0x4e407d){_0x1591f3['push'](_0x1591f3['shift']());}};_0x4f001e(++_0x1a083c);}(_0xdfa0,0x1a1));var _0x0dfa=function(_0x208038,_0x40b536){_0x208038=_0x208038-0x0;var _0x2a5a04=_0xdfa0[_0x208038];return _0x2a5a04;};'use strict';var _=require(_0x0dfa('0x0'));var iftime=require(_0x0dfa('0x1'))[_0x0dfa('0x2')];var logger=require('../../../config/logger')(_0x0dfa('0x3'));exports[_0x0dfa('0x4')]=function(_0x594592,_0x2044c0,_0x41a696){return function(_0x1be496){if(_0x41a696['rules']&&!_0x41a696[_0x0dfa('0x5')][_0x594592]){logger[_0x0dfa('0x6')](_0x0dfa('0x7'),_0x594592);return _0x1be496['stop']();}var _0x55ba7a=_0x2044c0['map'](function(_0x40941d){return iftime(_0x40941d);});var _0x51dd6e=_[_0x0dfa('0x8')](_0x55ba7a);if(_0x51dd6e){logger[_0x0dfa('0x6')](_0x0dfa('0x9'),_0x594592,_0x2044c0[_0x0dfa('0xa')](_0x0dfa('0xb')),_0x51dd6e);_0x1be496[_0x0dfa('0xc')](_0x51dd6e);}else{logger[_0x0dfa('0x6')]('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x594592,_0x2044c0[_0x0dfa('0xa')](_0x0dfa('0xb')));_0x1be496[_0x0dfa('0xd')]();}};}; \ No newline at end of file +var _0x98bc=['routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','join','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','iftime','../../../config/logger'];(function(_0x29f33e,_0x4c1d2a){var _0x4fcc7e=function(_0x1b76ae){while(--_0x1b76ae){_0x29f33e['push'](_0x29f33e['shift']());}};_0x4fcc7e(++_0x4c1d2a);}(_0x98bc,0x142));var _0xc98b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x98bc[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xc98b('0x0'));var iftime=require('../../../utils/iftime')[_0xc98b('0x1')];var logger=require(_0xc98b('0x2'))(_0xc98b('0x3'));exports[_0xc98b('0x4')]=function(_0x34291f,_0x3d7b2b,_0x88a2ed){return function(_0x22d54e){if(_0x88a2ed[_0xc98b('0x5')]&&!_0x88a2ed[_0xc98b('0x5')][_0x34291f]){logger[_0xc98b('0x6')](_0xc98b('0x7'),_0x34291f);return _0x22d54e[_0xc98b('0x8')]();}var _0x2548ae=_0x3d7b2b[_0xc98b('0x9')](function(_0x21a493){return iftime(_0x21a493);});var _0x51480d=_['some'](_0x2548ae);if(_0x51480d){logger[_0xc98b('0x6')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x34291f,_0x3d7b2b[_0xc98b('0xa')](_0xc98b('0xb')),_0x51480d);_0x22d54e['when'](_0x51480d);}else{logger['info'](_0xc98b('0xc'),_0x34291f,_0x3d7b2b[_0xc98b('0xa')](_0xc98b('0xb')));_0x22d54e[_0xc98b('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 58518ab..304912c 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 _0xd64b=['[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','complete','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','agentconnectAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten'];(function(_0x24f231,_0x5c549c){var _0x18a4a4=function(_0x1d0b3b){while(--_0x1d0b3b){_0x24f231['push'](_0x24f231['shift']());}};_0x18a4a4(++_0x5c549c);}(_0xd64b,0xc1));var _0xbd64=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0xd64b[_0x38de33];return _0x40f16d;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var utils=require(_0xbd64('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4bfb7c,_0x30b9b3){utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x4'),_0x4bfb7c[_0xbd64('0x5')],_0x4bfb7c['channel'],_0x4bfb7c['queue'],_0x4bfb7c['membername'],_0x4bfb7c['interface'],_0x4bfb7c[_0xbd64('0x6')],_0x4bfb7c[_0xbd64('0x7')],_0x4bfb7c[_0xbd64('0x8')]));if(_0x4bfb7c[_0xbd64('0x9')]){utils[_0xbd64('0xa')](_0x4bfb7c[_0xbd64('0x9')])[_0xbd64('0xb')](function(_0x5d32b8){if(_0x5d32b8){_0x4bfb7c['type']=_0x5d32b8[_0xbd64('0xc')];_0x4bfb7c[_0xbd64('0xd')]=_0x4bfb7c[_0xbd64('0xe')]?_0x5d32b8['acw']:![];_0x4bfb7c[_0xbd64('0xf')]=_0x4bfb7c[_0xbd64('0xd')]?_0x5d32b8[_0xbd64('0x10')]:0x0;}utils[_0xbd64('0x11')]('CreateVoiceAgentReport',_0x4bfb7c);});}else{utils[_0xbd64('0x11')]('CreateVoiceAgentReport',_0x4bfb7c);}if(_0x30b9b3){delete transfers[_0x4bfb7c[_0xbd64('0x5')]];}else{delete agents[_0x4bfb7c[_0xbd64('0x12')]];}}exports[_0xbd64('0x13')]=function(_0x2183e2){try{utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x15'),_0x2183e2[_0xbd64('0x5')]),_0x2183e2);agents[_0x2183e2[_0xbd64('0x12')]]=_0x2183e2;agents[_0x2183e2['destuniqueid']][_0xbd64('0x16')]=utils[_0xbd64('0x17')]();agents[_0x2183e2[_0xbd64('0x12')]][_0xbd64('0x8')]=_0xbd64('0x18');agents[_0x2183e2['destuniqueid']][_0xbd64('0x7')]=null;agents[_0x2183e2['destuniqueid']][_0xbd64('0x19')]=null;utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x1a'),_0x2183e2[_0xbd64('0x5')],agents[_0x2183e2[_0xbd64('0x12')]][_0xbd64('0x1b')],_0x2183e2[_0xbd64('0x12')]));}catch(_0x5d3b00){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')]('[%s][agents][agentcalled]',_0x2183e2['uniqueid']),_0x5d3b00);}};exports[_0xbd64('0x1d')]=function(_0x42b328){try{if(!_[_0xbd64('0x1e')](agents[_0x42b328[_0xbd64('0x12')]])){utils[_0xbd64('0x14')](util[_0xbd64('0x3')]('[%s][agents][agentringnoanswer]',_0x42b328['uniqueid']),_0x42b328);utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x1f'),_0x42b328[_0xbd64('0x5')],agents[_0x42b328['destuniqueid']]['membername'],_0x42b328[_0xbd64('0x12')]));agents[_0x42b328['destuniqueid']][_0xbd64('0x1d')]=!![];agents[_0x42b328['destuniqueid']][_0xbd64('0x20')]=utils[_0xbd64('0x17')]();agents[_0x42b328[_0xbd64('0x12')]][_0xbd64('0x8')]='timeout';agents[_0x42b328[_0xbd64('0x12')]][_0xbd64('0x21')]=_0xbd64('0x22');agents[_0x42b328[_0xbd64('0x12')]]['holdtime']=_0x42b328['ringtime']?parseInt(_0x42b328[_0xbd64('0x23')])/0x3e8:0x0;agents[_0x42b328['destuniqueid']]['talktime']=0x0;unanswered[_0xbd64('0x24')](_0x42b328['destuniqueid']);}}catch(_0x3cf5b7){utils['error'](util[_0xbd64('0x3')]('[%s][agents][agentringnoanswer]',_0x42b328[_0xbd64('0x5')]),_0x3cf5b7);}};exports[_0xbd64('0x25')]=function(_0x3be63a){try{_[_0xbd64('0x26')](agents,function(_0x306f19,_0x207ffc){if(_0x306f19['uniqueid']==_0x3be63a[_0xbd64('0x5')]&&!_[_0xbd64('0x27')](unanswered,_0x306f19[_0xbd64('0x12')])){utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x28'),_0x3be63a['uniqueid']),_0x3be63a);utils['info'](util[_0xbd64('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3be63a[_0xbd64('0x5')],_0x306f19[_0xbd64('0x1b')],_0x306f19['destuniqueid']));_0x306f19['agentringnoanswer']=!![];_0x306f19[_0xbd64('0x20')]=utils['now']();_0x306f19['lastevent']=_0xbd64('0x29');_0x306f19[_0xbd64('0x21')]=_0xbd64('0x29');_0x306f19['holdtime']=_0x3be63a[_0xbd64('0x2a')];_0x306f19['talktime']=0x0;writeDB(_0x306f19);}});}catch(_0x1fc9cf){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x28'),_0x3be63a[_0xbd64('0x5')]),_0x1fc9cf);}};exports[_0xbd64('0x2b')]=function(_0x513339){try{if(agents[_0x513339['destuniqueid']]){utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x2c'),_0x513339[_0xbd64('0x5')]),_0x513339);utils[_0xbd64('0x2')](util[_0xbd64('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x513339['uniqueid'],agents[_0x513339[_0xbd64('0x12')]][_0xbd64('0x1b')],_0x513339[_0xbd64('0x12')]));agents[_0x513339['destuniqueid']]['agentconnectAt']=utils[_0xbd64('0x17')]();agents[_0x513339['destuniqueid']][_0xbd64('0x7')]=_0x513339['connectedlinenum'];agents[_0x513339[_0xbd64('0x12')]][_0xbd64('0x19')]=_0x513339['connectedlinename'];agents[_0x513339[_0xbd64('0x12')]]['holdtime']=_0x513339['ringtime'];agents[_0x513339[_0xbd64('0x12')]][_0xbd64('0x8')]=_0xbd64('0x2d');_['forIn'](agents,function(_0x540e2a,_0x5d6bcf){if(_0x540e2a[_0xbd64('0x12')]!=_0x513339[_0xbd64('0x12')]&&_0x540e2a['uniqueid']==_0x513339[_0xbd64('0x5')]){_0x540e2a[_0xbd64('0x2e')]=0x0;_0x540e2a[_0xbd64('0x2a')]=_0x513339[_0xbd64('0x23')];_0x540e2a['agentringnoanswer']=!![];_0x540e2a['agentringnoanswerAt']=utils[_0xbd64('0x17')]();_0x540e2a['lastevent']='answered_elsewhere';_0x540e2a[_0xbd64('0x21')]=_0xbd64('0x2f');_0x540e2a[_0xbd64('0x30')]=_0x513339[_0xbd64('0x12')];_0x540e2a[_0xbd64('0x31')]=_0x513339[_0xbd64('0x1b')];writeDB(_0x540e2a);}});}}catch(_0x247775){utils[_0xbd64('0x1c')](util['format'](_0xbd64('0x2c'),_0x513339[_0xbd64('0x5')]),_0x247775);}};exports['agentcomplete']=function(_0x41b27a){try{if(!_[_0xbd64('0x1e')](agents[_0x41b27a[_0xbd64('0x12')]])){utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x32'),_0x41b27a[_0xbd64('0x5')]),_0x41b27a);utils['info'](util[_0xbd64('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41b27a[_0xbd64('0x5')],agents[_0x41b27a['destuniqueid']][_0xbd64('0x1b')],_0x41b27a[_0xbd64('0x12')]));agents[_0x41b27a[_0xbd64('0x12')]]['agentcomplete']=!![];agents[_0x41b27a[_0xbd64('0x12')]]['agentcompleteAt']=utils['now']();agents[_0x41b27a['destuniqueid']][_0xbd64('0x2e')]=utils[_0xbd64('0x33')](agents[_0x41b27a[_0xbd64('0x12')]][_0xbd64('0x34')],agents[_0x41b27a[_0xbd64('0x12')]][_0xbd64('0x35')]);agents[_0x41b27a[_0xbd64('0x12')]]['reason']=_0x41b27a[_0xbd64('0x21')];agents[_0x41b27a[_0xbd64('0x12')]][_0xbd64('0x8')]='complete';writeDB(agents[_0x41b27a[_0xbd64('0x12')]]);}}catch(_0x436f36){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x32'),_0x41b27a['uniqueid']),_0x436f36);}};exports[_0xbd64('0x36')]=function(_0x1a9ec8){try{if(!_[_0xbd64('0x1e')](agents[_0x1a9ec8[_0xbd64('0x37')]])){utils['debug'](util['format'](_0xbd64('0x38'),_0x1a9ec8[_0xbd64('0x5')]),_0x1a9ec8);utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x39'),_0x1a9ec8[_0xbd64('0x5')],agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x1b')],agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x5')]));agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x3a')]=!![];agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x3b')]=_0xbd64('0x3c');agents[_0x1a9ec8['transfereruniqueid']][_0xbd64('0x3d')]=_0x1a9ec8['extension'];agents[_0x1a9ec8['transfereruniqueid']]['transferuniqueid']=agents[_0x1a9ec8['transfereruniqueid']][_0xbd64('0x5')];}}catch(_0x2f56df){utils['error'](util[_0xbd64('0x3')](_0xbd64('0x38'),_0x1a9ec8[_0xbd64('0x5')]),_0x2f56df);}};exports['attendedtransfer']=function(_0x2c42fd){try{utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x3e'),_0x2c42fd[_0xbd64('0x3f')]),_0x2c42fd);if(_0x2c42fd[_0xbd64('0x3f')]==_0x2c42fd['origtransfererlinkedid']){if(!_['isNil'](agents[_0x2c42fd['secondtransfereruniqueid']])){utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x40'),_0x2c42fd[_0xbd64('0x3f')],agents[_0x2c42fd['secondtransfereruniqueid']][_0xbd64('0x1b')]));agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x3a')]=!![];agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x3b')]=_0xbd64('0x42');agents[_0x2c42fd['secondtransfereruniqueid']][_0xbd64('0x3d')]=_0x2c42fd[_0xbd64('0x43')];agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x44')]=_0x2c42fd[_0xbd64('0x3f')];}if(_0x2c42fd[_0xbd64('0x45')]&&agents[_0x2c42fd[_0xbd64('0x45')]]){agents[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x46')]=0x1;transfers[_0x2c42fd[_0xbd64('0x45')]]=_[_0xbd64('0x47')](agents[_0x2c42fd[_0xbd64('0x45')]]);transfers[_0x2c42fd['transfereeuniqueid']]['calleridnum']=agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x6')];transfers[_0x2c42fd['transfereeuniqueid']]['calleridname']=agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x48')];transfers[_0x2c42fd['transfereeuniqueid']][_0xbd64('0x16')]=utils[_0xbd64('0x17')]();transfers[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x35')]=utils[_0xbd64('0x17')]();transfers[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x2a')]=0x0;transfers[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x46')]=0x2;}}else if(_0x2c42fd['secondtransfereruniqueid']==_0x2c42fd[_0xbd64('0x49')]){if(!_[_0xbd64('0x1e')](agents[_0x2c42fd[_0xbd64('0x3f')]])){utils['info'](util[_0xbd64('0x3')](_0xbd64('0x40'),_0x2c42fd['origtransfereruniqueid'],agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x1b')]));agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x3a')]=!![];agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x3b')]='ATTENDED';agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x3d')]=_0x2c42fd[_0xbd64('0x4a')];agents[_0x2c42fd[_0xbd64('0x3f')]]['transferuniqueid']=_0x2c42fd[_0xbd64('0x41')];}if(_0x2c42fd[_0xbd64('0x4b')]&&agents[_0x2c42fd['transfertargetuniqueid']]){agents[_0x2c42fd[_0xbd64('0x4b')]]['agententerreason']=0x1;transfers[_0x2c42fd[_0xbd64('0x4b')]]=_[_0xbd64('0x47')](agents[_0x2c42fd[_0xbd64('0x4b')]]);transfers[_0x2c42fd[_0xbd64('0x4b')]]['calleridnum']=agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x6')];transfers[_0x2c42fd[_0xbd64('0x4b')]][_0xbd64('0x48')]=agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x48')];transfers[_0x2c42fd['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x2c42fd[_0xbd64('0x4b')]][_0xbd64('0x35')]=utils[_0xbd64('0x17')]();transfers[_0x2c42fd[_0xbd64('0x4b')]][_0xbd64('0x2a')]=0x0;transfers[_0x2c42fd[_0xbd64('0x4b')]]['agententerreason']=0x2;}}}catch(_0x30eddc){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x3e'),_0x2c42fd[_0xbd64('0x3f')]),_0x30eddc);}};exports[_0xbd64('0x4c')]=function(_0x2f3516){try{utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x4d'),_0x2f3516[_0xbd64('0x5')]),_0x2f3516);if(agents[_0x2f3516[_0xbd64('0x5')]]&&agents[_0x2f3516['uniqueid']]['reason']===_0xbd64('0x22')){if(_0x2f3516[_0xbd64('0x4e')]==='21'){agents[_0x2f3516[_0xbd64('0x5')]]['reason']=_0xbd64('0x4f');agents[_0x2f3516['uniqueid']][_0xbd64('0x8')]=_0xbd64('0x4f');}utils[_0xbd64('0x2')](util[_0xbd64('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2f3516[_0xbd64('0x5')],agents[_0x2f3516['uniqueid']][_0xbd64('0x1b')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]));writeDB(agents[_0x2f3516['uniqueid']]);var _0x43780f=unanswered[_0xbd64('0x50')](_0x2f3516['uniqueid']);if(_0x43780f>-0x1){unanswered[_0xbd64('0x51')](_0x43780f,0x1);}}if(transfers[_0x2f3516[_0xbd64('0x5')]]){transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0xe')]=!![];transfers[_0x2f3516['uniqueid']][_0xbd64('0x34')]=utils['now']();transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x2e')]=utils[_0xbd64('0x33')](transfers[_0x2f3516['uniqueid']]['agentcompleteAt'],transfers[_0x2f3516['uniqueid']]['agentconnectAt']);transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')]=_0xbd64('0x52');transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]='complete';utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x53'),_0x2f3516[_0xbd64('0x5')],transfers[_0x2f3516[_0xbd64('0x5')]]['membername'],transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')],transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]));writeDB(transfers[_0x2f3516['uniqueid']],!![]);}if(agents[_0x2f3516['uniqueid']]&&agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x35')]){agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0xe')]=!![];agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x34')]=utils[_0xbd64('0x17')]();agents[_0x2f3516[_0xbd64('0x5')]]['talktime']=utils[_0xbd64('0x33')](agents[_0x2f3516['uniqueid']][_0xbd64('0x34')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x35')]);agents[_0x2f3516['uniqueid']][_0xbd64('0x21')]=agents[_0x2f3516['uniqueid']]['transfer']?_0xbd64('0x3a'):_0xbd64('0x52');agents[_0x2f3516[_0xbd64('0x5')]]['lastevent']=_0xbd64('0x54');utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x53'),_0x2f3516['uniqueid'],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x1b')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]));writeDB(agents[_0x2f3516[_0xbd64('0x5')]]);}}catch(_0x439bbd){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x4d'),_0x2f3516[_0xbd64('0x5')]),_0x439bbd);}}; \ No newline at end of file +var _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%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','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x16d545,_0x52816d){var _0x78c374=function(_0x5845b7){while(--_0x5845b7){_0x16d545['push'](_0x16d545['shift']());}};_0x78c374(++_0x52816d);}(_0xb9a7,0x112));var _0x7b9a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb9a7[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7cae166..265e23f 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 _0x5599=['[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid','calleridname','calleridnum','duration','diffTime','endtime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','application','set','startsWith','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','channel','queue','membername','interface','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','debug','format','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now'];(function(_0x5b0920,_0x3da14a){var _0x53d52c=function(_0x4b86b3){while(--_0x4b86b3){_0x5b0920['push'](_0x5b0920['shift']());}};_0x53d52c(++_0x3da14a);}(_0x5599,0x117));var _0x9559=function(_0x3be309,_0x1a2e45){_0x3be309=_0x3be309-0x0;var _0x25d5db=_0x5599[_0x3be309];return _0x25d5db;};'use strict';var _=require(_0x9559('0x0'));var util=require(_0x9559('0x1'));var utils=require('./utils');var dispositions=[_0x9559('0x2'),_0x9559('0x3'),_0x9559('0x3'),_0x9559('0x2'),'NO\x20ANSWER',_0x9559('0x2'),_0x9559('0x4'),_0x9559('0x5'),_0x9559('0x3'),_0x9559('0x3'),_0x9559('0x3')];var channels={};function writeDB(_0xe3b0d6){utils[_0x9559('0x6')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xe3b0d6['uniqueid'],_0xe3b0d6[_0x9559('0x7')],_0xe3b0d6[_0x9559('0x8')],_0xe3b0d6[_0x9559('0x9')],_0xe3b0d6[_0x9559('0xa')],_0xe3b0d6['calleridnum'],_0xe3b0d6[_0x9559('0xb')],_0xe3b0d6['lastevent']));if(_0xe3b0d6[_0x9559('0xc')]){utils['getUserByInternal'](_0xe3b0d6[_0x9559('0xc')])[_0x9559('0xd')](function(_0x7ea8c0){if(_0x7ea8c0){_0xe3b0d6[_0x9559('0xe')]=_0x7ea8c0['id'];}utils[_0x9559('0xf')](_0x9559('0x10'),_0xe3b0d6);});}else{utils[_0x9559('0xf')](_0x9559('0x10'),_0xe3b0d6);}if(channels[_0xe3b0d6['uniqueid']]){delete channels[_0xe3b0d6[_0x9559('0x11')]];}}exports[_0x9559('0x12')]=function(_0x6707ac){try{utils[_0x9559('0x13')](util[_0x9559('0x14')]('[%s][calls][newchannel]',_0x6707ac[_0x9559('0x11')]),_0x6707ac);if(_0x6707ac['uniqueid']==_0x6707ac[_0x9559('0x15')]&&_0x6707ac[_0x9559('0x7')]!=_0x9559('0x16')){utils['info'](util[_0x9559('0x14')](_0x9559('0x17'),_0x6707ac[_0x9559('0x11')],_0x6707ac['context'],_0x6707ac['exten']));channels[_0x6707ac[_0x9559('0x11')]]={'uniqueid':_0x6707ac['uniqueid'],'accountcode':_0x6707ac[_0x9559('0xc')],'source':_0x6707ac['calleridnum'],'destination':_0x6707ac[_0x9559('0x18')],'destinationcontext':_0x6707ac[_0x9559('0x19')],'channel':_0x6707ac['channel'],'starttime':utils[_0x9559('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9559('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x228fba){utils['error'](util[_0x9559('0x14')](_0x9559('0x1b'),_0x6707ac[_0x9559('0x11')]),_0x228fba);}};exports['newstate']=function(_0x2707c1){try{utils[_0x9559('0x13')](util['format'](_0x9559('0x1c'),_0x2707c1['uniqueid']),_0x2707c1);if(!_[_0x9559('0x1d')](channels[_0x2707c1[_0x9559('0x11')]])&&_0x2707c1[_0x9559('0x1e')]==0x6){utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x1f'),_0x2707c1[_0x9559('0x11')],_0x2707c1['context'],_0x2707c1[_0x9559('0x7')]));if(_[_0x9559('0x1d')](channels[_0x2707c1[_0x9559('0x11')]][_0x9559('0x20')])){channels[_0x2707c1[_0x9559('0x11')]]['systemanswertime']=utils[_0x9559('0x1a')]();}}else if(!_[_0x9559('0x1d')](channels[_0x2707c1[_0x9559('0x15')]])&&_0x2707c1[_0x9559('0x1e')]==0x6&&_0x2707c1['context']!='transfer'){utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x21'),_0x2707c1[_0x9559('0x11')],_0x2707c1[_0x9559('0x15')],_0x2707c1[_0x9559('0x19')],_0x2707c1[_0x9559('0x7')]));channels[_0x2707c1[_0x9559('0x15')]]['accountcode']=_0x2707c1[_0x9559('0xc')];channels[_0x2707c1[_0x9559('0x15')]][_0x9559('0x22')]=_0x2707c1['channel'];if(_[_0x9559('0x1d')](channels[_0x2707c1[_0x9559('0x15')]][_0x9559('0x23')])){channels[_0x2707c1[_0x9559('0x15')]][_0x9559('0x23')]=utils[_0x9559('0x1a')]();}channels[_0x2707c1[_0x9559('0x15')]][_0x9559('0x24')]=dispositions[_['toNumber'](_0x2707c1[_0x9559('0x1e')])]||_0x9559('0x4');}}catch(_0x4d80ca){utils[_0x9559('0x25')](util[_0x9559('0x14')](_0x9559('0x1c'),_0x2707c1[_0x9559('0x11')]),_0x4d80ca);}};exports[_0x9559('0x26')]=function(_0x163bb0){try{if(!_[_0x9559('0x1d')](channels[_0x163bb0[_0x9559('0x11')]])){utils[_0x9559('0x13')](util[_0x9559('0x14')](_0x9559('0x27'),_0x163bb0[_0x9559('0x11')]),_0x163bb0);if(_[_0x9559('0x1d')](channels[_0x163bb0['uniqueid']][_0x9559('0x28')])){channels[_0x163bb0['uniqueid']]['callerid']=_0x163bb0[_0x9559('0x29')]+'\x20<'+_0x163bb0[_0x9559('0x2a')]+'>';}utils[_0x9559('0x6')](util[_0x9559('0x14')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x163bb0['uniqueid'],channels[_0x163bb0[_0x9559('0x11')]]['callerid'],_0x163bb0['cause-txt']));channels[_0x163bb0[_0x9559('0x11')]]['endtime']=utils[_0x9559('0x1a')]();channels[_0x163bb0[_0x9559('0x11')]][_0x9559('0x2b')]=utils[_0x9559('0x2c')](channels[_0x163bb0[_0x9559('0x11')]][_0x9559('0x2d')],channels[_0x163bb0[_0x9559('0x11')]][_0x9559('0x2e')]);channels[_0x163bb0[_0x9559('0x11')]][_0x9559('0x2f')]=channels[_0x163bb0['uniqueid']][_0x9559('0x23')]?utils['diffTime'](channels[_0x163bb0[_0x9559('0x11')]][_0x9559('0x2d')],channels[_0x163bb0[_0x9559('0x11')]][_0x9559('0x23')]):0x0;writeDB(channels[_0x163bb0[_0x9559('0x11')]]);}}catch(_0x2659c5){utils[_0x9559('0x25')](util[_0x9559('0x14')](_0x9559('0x27'),_0x163bb0[_0x9559('0x11')]),_0x2659c5);}};exports['attendedtransfer']=function(_0x1bbb7a){try{if(!_[_0x9559('0x1d')](channels[_0x1bbb7a[_0x9559('0x30')]])){utils[_0x9559('0x13')](util[_0x9559('0x14')](_0x9559('0x31'),_0x1bbb7a[_0x9559('0x32')]),_0x1bbb7a);if(channels[_0x1bbb7a[_0x9559('0x30')]]['channel']==_0x1bbb7a['transfereechannel']){utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x33'),_0x1bbb7a[_0x9559('0x32')],_0x1bbb7a[_0x9559('0x30')],_0x1bbb7a[_0x9559('0x34')]));channels[_0x1bbb7a['localtwolinkedid']][_0x9559('0x22')]=_0x1bbb7a[_0x9559('0x34')];channels[_0x1bbb7a['localtwolinkedid']][_0x9559('0x35')]='_attended';}else if(channels[_0x1bbb7a[_0x9559('0x30')]][_0x9559('0x7')]=_0x1bbb7a[_0x9559('0x36')]){utils['info'](util[_0x9559('0x14')](_0x9559('0x33'),_0x1bbb7a['origtransfereruniqueid'],_0x1bbb7a[_0x9559('0x30')],_0x1bbb7a[_0x9559('0x37')]));channels[_0x1bbb7a['localtwolinkedid']][_0x9559('0x22')]=_0x1bbb7a[_0x9559('0x37')];channels[_0x1bbb7a[_0x9559('0x30')]][_0x9559('0x35')]=_0x9559('0x38');}}}catch(_0x1b8fcb){utils[_0x9559('0x25')](util[_0x9559('0x14')]('[%s][calls][attendedtransfer]',_0x1bbb7a[_0x9559('0x32')]),_0x1b8fcb);}};exports[_0x9559('0x39')]=function(_0x4bd5a1){try{if(!_['isNil'](channels[_0x4bd5a1['uniqueid']])){utils[_0x9559('0x13')](util[_0x9559('0x14')](_0x9559('0x3a'),_0x4bd5a1[_0x9559('0x11')]),_0x4bd5a1);channels[_0x4bd5a1[_0x9559('0x11')]][_0x9559('0x3b')]=utils[_0x9559('0x1a')]();utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x3c'),_0x4bd5a1[_0x9559('0x11')],channels[_0x4bd5a1[_0x9559('0x11')]][_0x9559('0x3b')]));}}catch(_0x37ede0){utils['error'](util['format'](_0x9559('0x3a'),_0x4bd5a1[_0x9559('0x11')]),_0x37ede0);}};exports['musiconholdstop']=function(_0x15f917){try{if(!_[_0x9559('0x1d')](channels[_0x15f917[_0x9559('0x11')]])){utils[_0x9559('0x13')](util[_0x9559('0x14')]('[%s][calls][musiconholdstop]',_0x15f917['uniqueid']),_0x15f917);if(!_['isNil'](channels[_0x15f917[_0x9559('0x11')]]['musiconholdstartAt'])){channels[_0x15f917['uniqueid']][_0x9559('0x3d')]+=utils[_0x9559('0x2c')](utils[_0x9559('0x1a')](),channels[_0x15f917[_0x9559('0x11')]]['musiconholdstartAt']);utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x3e'),_0x15f917[_0x9559('0x11')],channels[_0x15f917[_0x9559('0x11')]][_0x9559('0x3d')]));delete channels[_0x15f917[_0x9559('0x11')]]['musiconholdstartAt'];}}}catch(_0x5066ca){utils[_0x9559('0x25')](util[_0x9559('0x14')]('[%s][calls][musiconholdstop]',_0x15f917[_0x9559('0x11')]),_0x5066ca);}};exports[_0x9559('0x3f')]=function(_0x1dd612){try{if(!_[_0x9559('0x1d')](channels[_0x1dd612[_0x9559('0x11')]])){utils['debug'](util['format'](_0x9559('0x40'),_0x1dd612[_0x9559('0x11')]),_0x1dd612);if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x42')])){utils[_0x9559('0x6')](util[_0x9559('0x14')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1dd612[_0x9559('0x11')],_0x1dd612[_0x9559('0x43')]));channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x44')]=_0x1dd612[_0x9559('0x43')];}if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x45')])){utils[_0x9559('0x6')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1dd612[_0x9559('0x11')],_0x1dd612['value']));channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x46')]=_0x1dd612[_0x9559('0x43')];channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x28')]='\x22'+_0x1dd612[_0x9559('0x43')]+_0x9559('0x47')+_0x1dd612[_0x9559('0x43')]+'>';}if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x48')])||!_[_0x9559('0x1d')](_0x1dd612['variable'][_0x9559('0x49')])){utils[_0x9559('0x6')](util['format'](_0x9559('0x4a'),_0x1dd612['uniqueid'],!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')]['xmd-callerid-preview'])?_0x9559('0x48'):_0x9559('0x49'),_0x1dd612[_0x9559('0x43')]));channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x28')]=_0x1dd612[_0x9559('0x43')];}if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')]['xmd-queue'])||!_[_0x9559('0x1d')](_0x1dd612['variable']['xmcs-queue'])){utils[_0x9559('0x6')](util[_0x9559('0x14')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x1dd612[_0x9559('0x11')],!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x4b')])?_0x9559('0x4b'):'xmcs-queue',_0x1dd612['value']));channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x4c')]=_0x9559('0x4d');channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x4e')]=_0x1dd612[_0x9559('0x43')];channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x8')]=!![];}if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x4f')])){utils['info'](util[_0x9559('0x14')](_0x9559('0x50'),_0x1dd612[_0x9559('0x11')],_0x1dd612[_0x9559('0x43')]));channels[_0x1dd612[_0x9559('0x11')]]['ContactId']=_0x1dd612[_0x9559('0x43')];}if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x51')])){utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x52'),_0x1dd612['uniqueid'],_0x1dd612[_0x9559('0x43')]));channels[_0x1dd612[_0x9559('0x11')]]['type']=_0x1dd612[_0x9559('0x43')];}if(!_['isNil'](_0x1dd612[_0x9559('0x41')][_0x9559('0x53')])){utils[_0x9559('0x6')](util[_0x9559('0x14')](_0x9559('0x54'),_0x1dd612['uniqueid'],_0x1dd612[_0x9559('0x43')]));channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x55')]=_0x1dd612['value'];}if(!_[_0x9559('0x1d')](_0x1dd612[_0x9559('0x41')][_0x9559('0x56')])){utils['info'](util[_0x9559('0x14')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1dd612['uniqueid'],_0x1dd612['value']));channels[_0x1dd612[_0x9559('0x11')]][_0x9559('0x56')]=_0x1dd612[_0x9559('0x43')];}}}catch(_0x2a8bfd){utils['error'](util['format']('[%s][calls][varset]',_0x1dd612[_0x9559('0x11')]),_0x2a8bfd);}};exports[_0x9559('0x57')]=function(_0x1caa98){try{if(!_[_0x9559('0x1d')](channels[_0x1caa98[_0x9559('0x11')]])){utils[_0x9559('0x13')](util[_0x9559('0x14')]('[%s][calls][newexten]',_0x1caa98[_0x9559('0x11')]),_0x1caa98);utils[_0x9559('0x6')](util[_0x9559('0x14')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x1caa98['uniqueid'],_0x1caa98[_0x9559('0x58')],_0x1caa98['appdata']));if(_0x1caa98[_0x9559('0x58')]['toLowerCase']()==_0x9559('0x59')&&_[_0x9559('0x5a')](_0x1caa98[_0x9559('0x5b')][_0x9559('0x5c')](),_0x9559('0x5d'))){var _0x173d5d=_0x1caa98['appdata'][_0x9559('0x5e')]('=');var _0x12870f=_0x173d5d[0x0][_0x9559('0x5f')](_0x173d5d[0x0][_0x9559('0x60')]('(')+0x1,_0x173d5d[0x0]['lastIndexOf'](')'));var _0x157e87=_0x173d5d[0x1];channels[_0x1caa98['uniqueid']][_0x12870f]=_0x157e87;}if(!_[_0x9559('0x61')]([_0x9559('0x26'),_0x9559('0x62'),_0x9559('0x63'),_0x9559('0x59'),_0x9559('0x64')],_0x1caa98[_0x9559('0x58')]['toLowerCase']())){channels[_0x1caa98[_0x9559('0x11')]][_0x9559('0x4c')]=_0x1caa98[_0x9559('0x58')];channels[_0x1caa98[_0x9559('0x11')]][_0x9559('0x4e')]=_0x1caa98[_0x9559('0x5b')];}}}catch(_0x2331b8){utils[_0x9559('0x25')](util['format'](_0x9559('0x65'),_0x1caa98[_0x9559('0x11')]),_0x2331b8);}}; \ No newline at end of file +var _0xb92f=['value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','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','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','lastIndexOf','includes','set','lastdata','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','linkedid','channel','context','exten','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','debug','[%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','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','now','duration','diffTime','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s'];(function(_0x885111,_0x1efb97){var _0x54b76b=function(_0xf27e26){while(--_0xf27e26){_0x885111['push'](_0x885111['shift']());}};_0x54b76b(++_0x1efb97);}(_0xb92f,0xf6));var _0xfb92=function(_0x280e65,_0xc6f90a){_0x280e65=_0x280e65-0x0;var _0x2c24e2=_0xb92f[_0x280e65];return _0x2c24e2;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfb92('0x0'));var dispositions=[_0xfb92('0x1'),_0xfb92('0x2'),_0xfb92('0x2'),_0xfb92('0x1'),'NO\x20ANSWER',_0xfb92('0x1'),'ANSWERED',_0xfb92('0x3'),_0xfb92('0x2'),_0xfb92('0x2'),'FAILED'];var channels={};function writeDB(_0x31efa1){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x6'),_0x31efa1[_0xfb92('0x7')],_0x31efa1['channel'],_0x31efa1[_0xfb92('0x8')],_0x31efa1[_0xfb92('0x9')],_0x31efa1[_0xfb92('0xa')],_0x31efa1[_0xfb92('0xb')],_0x31efa1['connectedlinenum'],_0x31efa1[_0xfb92('0xc')]));if(_0x31efa1[_0xfb92('0xd')]){utils[_0xfb92('0xe')](_0x31efa1[_0xfb92('0xd')])[_0xfb92('0xf')](function(_0x3ce563){if(_0x3ce563){_0x31efa1[_0xfb92('0x10')]=_0x3ce563['id'];}utils['request'](_0xfb92('0x11'),_0x31efa1);});}else{utils[_0xfb92('0x12')]('CreateVoiceCallReport',_0x31efa1);}if(channels[_0x31efa1[_0xfb92('0x7')]]){delete channels[_0x31efa1['uniqueid']];}}exports[_0xfb92('0x13')]=function(_0x3c5a91){try{utils['debug'](util['format']('[%s][calls][newchannel]',_0x3c5a91[_0xfb92('0x7')]),_0x3c5a91);if(_0x3c5a91['uniqueid']==_0x3c5a91[_0xfb92('0x14')]&&_0x3c5a91[_0xfb92('0x15')]!='OutgoingSpoolFailed'){utils[_0xfb92('0x4')](util[_0xfb92('0x5')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x3c5a91['uniqueid'],_0x3c5a91[_0xfb92('0x16')],_0x3c5a91[_0xfb92('0x17')]));channels[_0x3c5a91['uniqueid']]={'uniqueid':_0x3c5a91[_0xfb92('0x7')],'accountcode':_0x3c5a91[_0xfb92('0xd')],'source':_0x3c5a91['calleridnum'],'destination':_0x3c5a91[_0xfb92('0x17')],'destinationcontext':_0x3c5a91[_0xfb92('0x16')],'channel':_0x3c5a91[_0xfb92('0x15')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfb92('0x1'),'amaflags':_0xfb92('0x18')};}}catch(_0x1f959a){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x1a'),_0x3c5a91[_0xfb92('0x7')]),_0x1f959a);}};exports[_0xfb92('0x1b')]=function(_0x488fc6){try{utils[_0xfb92('0x1c')](util['format'](_0xfb92('0x1d'),_0x488fc6[_0xfb92('0x7')]),_0x488fc6);if(!_[_0xfb92('0x1e')](channels[_0x488fc6[_0xfb92('0x7')]])&&_0x488fc6[_0xfb92('0x1f')]==0x6){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x20'),_0x488fc6[_0xfb92('0x7')],_0x488fc6[_0xfb92('0x16')],_0x488fc6[_0xfb92('0x15')]));if(_[_0xfb92('0x1e')](channels[_0x488fc6[_0xfb92('0x7')]][_0xfb92('0x21')])){channels[_0x488fc6[_0xfb92('0x7')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x488fc6[_0xfb92('0x14')]])&&_0x488fc6[_0xfb92('0x1f')]==0x6&&_0x488fc6[_0xfb92('0x16')]!=_0xfb92('0x22')){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x23'),_0x488fc6[_0xfb92('0x7')],_0x488fc6[_0xfb92('0x14')],_0x488fc6[_0xfb92('0x16')],_0x488fc6[_0xfb92('0x15')]));channels[_0x488fc6['linkedid']][_0xfb92('0xd')]=_0x488fc6[_0xfb92('0xd')];channels[_0x488fc6[_0xfb92('0x14')]][_0xfb92('0x24')]=_0x488fc6[_0xfb92('0x15')];if(_[_0xfb92('0x1e')](channels[_0x488fc6[_0xfb92('0x14')]][_0xfb92('0x25')])){channels[_0x488fc6['linkedid']][_0xfb92('0x25')]=utils['now']();}channels[_0x488fc6[_0xfb92('0x14')]][_0xfb92('0x26')]=dispositions[_['toNumber'](_0x488fc6[_0xfb92('0x1f')])]||_0xfb92('0x27');}}catch(_0x566efe){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x1d'),_0x488fc6[_0xfb92('0x7')]),_0x566efe);}};exports[_0xfb92('0x28')]=function(_0x4c8d60){try{if(!_[_0xfb92('0x1e')](channels[_0x4c8d60['uniqueid']])){utils[_0xfb92('0x1c')](util['format'](_0xfb92('0x29'),_0x4c8d60[_0xfb92('0x7')]),_0x4c8d60);if(_[_0xfb92('0x1e')](channels[_0x4c8d60['uniqueid']][_0xfb92('0x2a')])){channels[_0x4c8d60[_0xfb92('0x7')]]['callerid']=_0x4c8d60[_0xfb92('0x2b')]+'\x20<'+_0x4c8d60[_0xfb92('0xb')]+'>';}utils['info'](util[_0xfb92('0x5')](_0xfb92('0x2c'),_0x4c8d60[_0xfb92('0x7')],channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x2a')],_0x4c8d60[_0xfb92('0x2d')]));channels[_0x4c8d60['uniqueid']][_0xfb92('0x2e')]=utils[_0xfb92('0x2f')]();channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x30')]=utils[_0xfb92('0x31')](channels[_0x4c8d60['uniqueid']][_0xfb92('0x2e')],channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x32')]);channels[_0x4c8d60['uniqueid']][_0xfb92('0x33')]=channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x25')]?utils[_0xfb92('0x31')](channels[_0x4c8d60[_0xfb92('0x7')]][_0xfb92('0x2e')],channels[_0x4c8d60['uniqueid']][_0xfb92('0x25')]):0x0;writeDB(channels[_0x4c8d60['uniqueid']]);}}catch(_0x391865){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x29'),_0x4c8d60[_0xfb92('0x7')]),_0x391865);}};exports[_0xfb92('0x34')]=function(_0x1e2a89){try{if(!_[_0xfb92('0x1e')](channels[_0x1e2a89['localtwolinkedid']])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x35'),_0x1e2a89['origtransfereruniqueid']),_0x1e2a89);if(channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x15')]==_0x1e2a89[_0xfb92('0x37')]){utils[_0xfb92('0x4')](util['format'](_0xfb92('0x38'),_0x1e2a89['origtransfereruniqueid'],_0x1e2a89[_0xfb92('0x36')],_0x1e2a89[_0xfb92('0x39')]));channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x24')]=_0x1e2a89['secondtransfererchannel'];channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x3a')]=_0xfb92('0x3b');}else if(channels[_0x1e2a89[_0xfb92('0x36')]][_0xfb92('0x15')]=_0x1e2a89[_0xfb92('0x3c')]){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x38'),_0x1e2a89[_0xfb92('0x3d')],_0x1e2a89[_0xfb92('0x36')],_0x1e2a89[_0xfb92('0x3e')]));channels[_0x1e2a89[_0xfb92('0x36')]]['destinationchannel']=_0x1e2a89[_0xfb92('0x3e')];channels[_0x1e2a89['localtwolinkedid']][_0xfb92('0x3a')]=_0xfb92('0x3b');}}}catch(_0x9c0bce){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x35'),_0x1e2a89['origtransfereruniqueid']),_0x9c0bce);}};exports[_0xfb92('0x3f')]=function(_0x45c8cd){try{if(!_['isNil'](channels[_0x45c8cd['uniqueid']])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x40'),_0x45c8cd['uniqueid']),_0x45c8cd);channels[_0x45c8cd[_0xfb92('0x7')]]['musiconholdstartAt']=utils[_0xfb92('0x2f')]();utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x41'),_0x45c8cd['uniqueid'],channels[_0x45c8cd[_0xfb92('0x7')]][_0xfb92('0x42')]));}}catch(_0x485e2c){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x40'),_0x45c8cd[_0xfb92('0x7')]),_0x485e2c);}};exports['musiconholdstop']=function(_0x73c946){try{if(!_[_0xfb92('0x1e')](channels[_0x73c946[_0xfb92('0x7')]])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x43'),_0x73c946[_0xfb92('0x7')]),_0x73c946);if(!_[_0xfb92('0x1e')](channels[_0x73c946[_0xfb92('0x7')]][_0xfb92('0x42')])){channels[_0x73c946[_0xfb92('0x7')]][_0xfb92('0x44')]+=utils['diffTime'](utils[_0xfb92('0x2f')](),channels[_0x73c946['uniqueid']]['musiconholdstartAt']);utils[_0xfb92('0x4')](util['format'](_0xfb92('0x45'),_0x73c946[_0xfb92('0x7')],channels[_0x73c946[_0xfb92('0x7')]][_0xfb92('0x44')]));delete channels[_0x73c946['uniqueid']][_0xfb92('0x42')];}}}catch(_0xc89728){utils[_0xfb92('0x19')](util[_0xfb92('0x5')](_0xfb92('0x43'),_0x73c946['uniqueid']),_0xc89728);}};exports[_0xfb92('0x46')]=function(_0x5e313d){try{if(!_[_0xfb92('0x1e')](channels[_0x5e313d[_0xfb92('0x7')]])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x47'),_0x5e313d[_0xfb92('0x7')]),_0x5e313d);if(!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x49')])){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x4a'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x4c')]=_0x5e313d[_0xfb92('0x4b')];}if(!_['isNil'](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x4d')])){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x4e'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d[_0xfb92('0x7')]]['destination']=_0x5e313d[_0xfb92('0x4b')];channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x2a')]='\x22'+_0x5e313d['value']+'\x22\x20<'+_0x5e313d[_0xfb92('0x4b')]+'>';}if(!_['isNil'](_0x5e313d[_0xfb92('0x48')]['xmd-callerid-preview'])||!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x4f')])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x50'),_0x5e313d[_0xfb92('0x7')],!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x51')])?'xmd-callerid-preview':'xmd-callerid',_0x5e313d['value']));channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x2a')]=_0x5e313d[_0xfb92('0x4b')];}if(!_[_0xfb92('0x1e')](_0x5e313d['variable'][_0xfb92('0x52')])||!_['isNil'](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x53')])){utils['info'](util[_0xfb92('0x5')](_0xfb92('0x50'),_0x5e313d[_0xfb92('0x7')],!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')]['xmd-queue'])?_0xfb92('0x52'):_0xfb92('0x53'),_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x54')]='Queue';channels[_0x5e313d[_0xfb92('0x7')]]['lastdata']=_0x5e313d[_0xfb92('0x4b')];channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x8')]=!![];}if(!_['isNil'](_0x5e313d[_0xfb92('0x48')][_0xfb92('0x55')])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x56'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x57')]=_0x5e313d[_0xfb92('0x4b')];}if(!_[_0xfb92('0x1e')](_0x5e313d['variable'][_0xfb92('0x58')])){utils['info'](util['format'](_0xfb92('0x59'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x5a')]=_0x5e313d['value'];}if(!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')]['outboundrouteid'])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x5b'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d['uniqueid']][_0xfb92('0x5c')]=_0x5e313d[_0xfb92('0x4b')];}if(!_[_0xfb92('0x1e')](_0x5e313d[_0xfb92('0x48')]['sipcallid'])){utils[_0xfb92('0x4')](util[_0xfb92('0x5')](_0xfb92('0x5d'),_0x5e313d[_0xfb92('0x7')],_0x5e313d[_0xfb92('0x4b')]));channels[_0x5e313d[_0xfb92('0x7')]][_0xfb92('0x5e')]=_0x5e313d[_0xfb92('0x4b')];}}}catch(_0x2d9661){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x47'),_0x5e313d[_0xfb92('0x7')]),_0x2d9661);}};exports['newexten']=function(_0x1f15fa){try{if(!_[_0xfb92('0x1e')](channels[_0x1f15fa[_0xfb92('0x7')]])){utils[_0xfb92('0x1c')](util[_0xfb92('0x5')](_0xfb92('0x5f'),_0x1f15fa[_0xfb92('0x7')]),_0x1f15fa);utils['info'](util[_0xfb92('0x5')](_0xfb92('0x60'),_0x1f15fa['uniqueid'],_0x1f15fa['application'],_0x1f15fa[_0xfb92('0x61')]));if(_0x1f15fa[_0xfb92('0x62')][_0xfb92('0x63')]()=='set'&&_[_0xfb92('0x64')](_0x1f15fa[_0xfb92('0x61')][_0xfb92('0x63')](),_0xfb92('0x65'))){var _0x2b4824=_0x1f15fa['appdata'][_0xfb92('0x66')]('=');var _0x3e2fc9=_0x2b4824[0x0]['substring'](_0x2b4824[0x0][_0xfb92('0x67')]('(')+0x1,_0x2b4824[0x0]['lastIndexOf'](')'));var _0x6746a=_0x2b4824[0x1];channels[_0x1f15fa[_0xfb92('0x7')]][_0x3e2fc9]=_0x6746a;}if(!_[_0xfb92('0x68')]([_0xfb92('0x28'),'noop','execif',_0xfb92('0x69'),'gotoif'],_0x1f15fa[_0xfb92('0x62')]['toLowerCase']())){channels[_0x1f15fa['uniqueid']]['lastapplication']=_0x1f15fa[_0xfb92('0x62')];channels[_0x1f15fa[_0xfb92('0x7')]][_0xfb92('0x6a')]=_0x1f15fa[_0xfb92('0x61')];}}}catch(_0xacf1d5){utils[_0xfb92('0x19')](util['format'](_0xfb92('0x5f'),_0x1f15fa[_0xfb92('0x7')]),_0xacf1d5);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c0de943..2de8df4 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 _0xc6a4=['close','[core]\x20close','managerevent','./utils','connect','[core]\x20connected','shutdown','info','fullybooted','error','[core]\x20error'];(function(_0x5ebf85,_0x598413){var _0x5b175a=function(_0x3b213a){while(--_0x3b213a){_0x5ebf85['push'](_0x5ebf85['shift']());}};_0x5b175a(++_0x598413);}(_0xc6a4,0x142));var _0x4c6a=function(_0x583990,_0x1b0ea1){_0x583990=_0x583990-0x0;var _0x2a39f2=_0xc6a4[_0x583990];return _0x2a39f2;};'use strict';var utils=require(_0x4c6a('0x0'));exports[_0x4c6a('0x1')]=function(){utils['info'](_0x4c6a('0x2'));};exports[_0x4c6a('0x3')]=function(){utils[_0x4c6a('0x4')]('[core]\x20shutdown');};exports[_0x4c6a('0x5')]=function(){utils[_0x4c6a('0x4')]('[core]\x20fullybooted');};exports[_0x4c6a('0x6')]=function(_0x1b0cd6){utils[_0x4c6a('0x6')](_0x4c6a('0x7'),_0x1b0cd6);};exports[_0x4c6a('0x8')]=function(){utils[_0x4c6a('0x4')](_0x4c6a('0x9'));};exports[_0x4c6a('0xa')]=function(_0x36ef93){}; \ No newline at end of file +var _0x1fb5=['[core]\x20error','close','[core]\x20close','managerevent','connect','info','shutdown','[core]\x20shutdown','fullybooted','error'];(function(_0x245cc0,_0x31b013){var _0x58ce2a=function(_0x4004f6){while(--_0x4004f6){_0x245cc0['push'](_0x245cc0['shift']());}};_0x58ce2a(++_0x31b013);}(_0x1fb5,0xae));var _0x51fb=function(_0x3cc8a9,_0x962eb6){_0x3cc8a9=_0x3cc8a9-0x0;var _0x5b667a=_0x1fb5[_0x3cc8a9];return _0x5b667a;};'use strict';var utils=require('./utils');exports[_0x51fb('0x0')]=function(){utils[_0x51fb('0x1')]('[core]\x20connected');};exports[_0x51fb('0x2')]=function(){utils[_0x51fb('0x1')](_0x51fb('0x3'));};exports[_0x51fb('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x3492b2){utils[_0x51fb('0x5')](_0x51fb('0x6'),_0x3492b2);};exports[_0x51fb('0x7')]=function(){utils[_0x51fb('0x1')](_0x51fb('0x8'));};exports[_0x51fb('0x9')]=function(_0x1242dd){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b8841c5..98f7995 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 _0x85fb=['toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','debug','[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','diffTime','billableseconds','endtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','request','CreateVoiceDialReport','uniqueid','newexten','[%s][dials][newexten]','appdata'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x85fb,0x7f));var _0xb85f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x85fb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb85f('0x0'));var util=require('util');var utils=require(_0xb85f('0x1'));var dials={};function writeDB(_0x2a342f){utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x4'),_0x2a342f['uniqueid'],_0x2a342f[_0xb85f('0x5')],_0x2a342f[_0xb85f('0x6')],_0x2a342f[_0xb85f('0x7')],_0x2a342f['connectedlinenum'],_0x2a342f['dialstatus']));utils[_0xb85f('0x8')](_0xb85f('0x9'),_0x2a342f);delete dials[_0x2a342f[_0xb85f('0xa')]];}exports[_0xb85f('0xb')]=function(_0x240574){try{utils['debug'](util[_0xb85f('0x3')](_0xb85f('0xc'),_0x240574['uniqueid']),_0x240574);utils[_0xb85f('0x2')](util[_0xb85f('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x240574['uniqueid'],_0x240574['application'],_0x240574[_0xb85f('0xd')]));if(_0x240574['application'][_0xb85f('0xe')]()==_0xb85f('0xf')&&_[_0xb85f('0x10')](_0x240574[_0xb85f('0xd')][_0xb85f('0xe')](),_0xb85f('0x11'))){var _0x17a842=_0x240574[_0xb85f('0xd')][_0xb85f('0x12')]('=');dials[_0x240574[_0xb85f('0xa')]]={'routeId':_0x17a842[0x1]};}}catch(_0x27eda8){utils['error'](util[_0xb85f('0x3')](_0xb85f('0xc'),_0x240574[_0xb85f('0xa')]),_0x27eda8);}};exports[_0xb85f('0x13')]=function(_0x1de5fb){try{utils['debug'](util[_0xb85f('0x3')](_0xb85f('0x14'),_0x1de5fb['uniqueid']),_0x1de5fb);if(!_[_0xb85f('0x15')](_0x1de5fb['variable'][_0xb85f('0x16')])){utils['info'](util[_0xb85f('0x3')](_0xb85f('0x17'),_0x1de5fb[_0xb85f('0xa')],_0x1de5fb[_0xb85f('0x18')]));dials[_0x1de5fb[_0xb85f('0xa')]]={'routeId':_0x1de5fb[_0xb85f('0x18')]};}}catch(_0x247698){utils[_0xb85f('0x19')](util[_0xb85f('0x3')]('[%s][dials][varset]',_0x1de5fb[_0xb85f('0xa')]),_0x247698);}};exports['dialbegin']=function(_0x741e4d){try{if(!_[_0xb85f('0x15')](dials[_0x741e4d[_0xb85f('0xa')]])){utils['debug'](util['format'](_0xb85f('0x1a'),_0x741e4d[_0xb85f('0xa')]),_0x741e4d);dials[_0x741e4d['uniqueid']]=_['assign'](dials[_0x741e4d['uniqueid']],_0x741e4d);dials[_0x741e4d[_0xb85f('0xa')]][_0xb85f('0x1b')]=utils[_0xb85f('0x1c')]();dials[_0x741e4d[_0xb85f('0xa')]][_0xb85f('0x1d')]=_0xb85f('0x1e');utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x1f'),_0x741e4d[_0xb85f('0xa')],dials[_0x741e4d[_0xb85f('0xa')]][_0xb85f('0x1b')]));}}catch(_0x25a9ed){utils['error'](util[_0xb85f('0x3')](_0xb85f('0x1a'),_0x741e4d[_0xb85f('0xa')]),_0x25a9ed);}};exports['dialend']=function(_0x4dea48){try{if(!_['isNil'](dials[_0x4dea48[_0xb85f('0xa')]])){utils[_0xb85f('0x20')](util['format'](_0xb85f('0x21'),_0x4dea48[_0xb85f('0xa')]),_0x4dea48);dials[_0x4dea48['uniqueid']]['dialstatus']=_0x4dea48[_0xb85f('0x22')];if(_0x4dea48['dialstatus']==_0xb85f('0x23')){dials[_0x4dea48['uniqueid']]=_[_0xb85f('0x24')](dials[_0x4dea48['uniqueid']],_0x4dea48);dials[_0x4dea48['uniqueid']][_0xb85f('0x25')]=utils['now']();dials[_0x4dea48[_0xb85f('0xa')]][_0xb85f('0x1d')]='connect';utils[_0xb85f('0x2')](util['format'](_0xb85f('0x26'),_0x4dea48[_0xb85f('0xa')],_0x4dea48[_0xb85f('0x22')],dials[_0x4dea48['uniqueid']][_0xb85f('0x25')]));}else{utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x27'),_0x4dea48[_0xb85f('0xa')],_0x4dea48[_0xb85f('0x22')]));}}}catch(_0x3a21a5){utils[_0xb85f('0x19')](util[_0xb85f('0x3')](_0xb85f('0x21'),_0x4dea48[_0xb85f('0xa')]),_0x3a21a5);}};exports[_0xb85f('0x28')]=function(_0x4ee33a){try{if(!_[_0xb85f('0x15')](dials[_0x4ee33a[_0xb85f('0xa')]])){utils['debug'](util[_0xb85f('0x3')](_0xb85f('0x29'),_0x4ee33a[_0xb85f('0xa')]),_0x4ee33a);utils[_0xb85f('0x2')](util[_0xb85f('0x3')](_0xb85f('0x2a'),_0x4ee33a[_0xb85f('0xa')],_0x4ee33a['calleridnum'],_0x4ee33a['calleridname'],_0x4ee33a['cause-txt']));dials[_0x4ee33a['uniqueid']]=_[_0xb85f('0x24')](dials[_0x4ee33a['uniqueid']],{'endtime':utils[_0xb85f('0x1c')](),'lastevent':_0xb85f('0x2b')});dials[_0x4ee33a[_0xb85f('0xa')]]['duration']=utils[_0xb85f('0x2c')](dials[_0x4ee33a[_0xb85f('0xa')]]['endtime'],dials[_0x4ee33a['uniqueid']][_0xb85f('0x1b')]);dials[_0x4ee33a[_0xb85f('0xa')]]['holdtime']=utils['diffTime'](dials[_0x4ee33a[_0xb85f('0xa')]]['answertime']||dials[_0x4ee33a[_0xb85f('0xa')]]['endtime'],dials[_0x4ee33a[_0xb85f('0xa')]]['starttime']);dials[_0x4ee33a[_0xb85f('0xa')]][_0xb85f('0x2d')]=dials[_0x4ee33a['uniqueid']][_0xb85f('0x25')]?utils[_0xb85f('0x2c')](dials[_0x4ee33a[_0xb85f('0xa')]][_0xb85f('0x2e')],dials[_0x4ee33a[_0xb85f('0xa')]]['answertime']):0x0;writeDB(dials[_0x4ee33a[_0xb85f('0xa')]]);}}catch(_0x131ba5){utils['error'](util[_0xb85f('0x3')](_0xb85f('0x29'),_0x4ee33a[_0xb85f('0xa')]),_0x131ba5);}}; \ No newline at end of file +var _0xd0e9=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','debug','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup'];(function(_0x11db7a,_0x26e377){var _0x309eb7=function(_0x56e342){while(--_0x56e342){_0x11db7a['push'](_0x11db7a['shift']());}};_0x309eb7(++_0x26e377);}(_0xd0e9,0x153));var _0x9d0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9d0e('0x0'));var utils=require(_0x9d0e('0x1'));var dials={};function writeDB(_0x9e5cfa){utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x4'),_0x9e5cfa[_0x9d0e('0x5')],_0x9e5cfa[_0x9d0e('0x6')],_0x9e5cfa[_0x9d0e('0x7')],_0x9e5cfa[_0x9d0e('0x8')],_0x9e5cfa[_0x9d0e('0x9')],_0x9e5cfa[_0x9d0e('0xa')]));utils[_0x9d0e('0xb')](_0x9d0e('0xc'),_0x9e5cfa);delete dials[_0x9e5cfa[_0x9d0e('0x5')]];}exports[_0x9d0e('0xd')]=function(_0x4d73e5){try{utils['debug'](util[_0x9d0e('0x3')](_0x9d0e('0xe'),_0x4d73e5[_0x9d0e('0x5')]),_0x4d73e5);utils['info'](util[_0x9d0e('0x3')](_0x9d0e('0xf'),_0x4d73e5[_0x9d0e('0x5')],_0x4d73e5[_0x9d0e('0x10')],_0x4d73e5[_0x9d0e('0x11')]));if(_0x4d73e5[_0x9d0e('0x10')][_0x9d0e('0x12')]()==_0x9d0e('0x13')&&_[_0x9d0e('0x14')](_0x4d73e5['appdata'][_0x9d0e('0x12')](),_0x9d0e('0x15'))){var _0x50dfbc=_0x4d73e5[_0x9d0e('0x11')]['split']('=');dials[_0x4d73e5['uniqueid']]={'routeId':_0x50dfbc[0x1]};}}catch(_0x2db554){utils[_0x9d0e('0x16')](util[_0x9d0e('0x3')](_0x9d0e('0xe'),_0x4d73e5[_0x9d0e('0x5')]),_0x2db554);}};exports[_0x9d0e('0x17')]=function(_0x3fee6a){try{utils[_0x9d0e('0x18')](util[_0x9d0e('0x3')](_0x9d0e('0x19'),_0x3fee6a[_0x9d0e('0x5')]),_0x3fee6a);if(!_['isNil'](_0x3fee6a[_0x9d0e('0x1a')][_0x9d0e('0x1b')])){utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x1c'),_0x3fee6a['uniqueid'],_0x3fee6a[_0x9d0e('0x1d')]));dials[_0x3fee6a['uniqueid']]={'routeId':_0x3fee6a[_0x9d0e('0x1d')]};}}catch(_0x2e3f69){utils[_0x9d0e('0x16')](util['format'](_0x9d0e('0x19'),_0x3fee6a['uniqueid']),_0x2e3f69);}};exports[_0x9d0e('0x1e')]=function(_0x171dcc){try{if(!_[_0x9d0e('0x1f')](dials[_0x171dcc[_0x9d0e('0x5')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x171dcc[_0x9d0e('0x5')]),_0x171dcc);dials[_0x171dcc[_0x9d0e('0x5')]]=_[_0x9d0e('0x20')](dials[_0x171dcc[_0x9d0e('0x5')]],_0x171dcc);dials[_0x171dcc[_0x9d0e('0x5')]][_0x9d0e('0x21')]=utils['now']();dials[_0x171dcc[_0x9d0e('0x5')]]['lastevent']=_0x9d0e('0x22');utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x23'),_0x171dcc['uniqueid'],dials[_0x171dcc[_0x9d0e('0x5')]][_0x9d0e('0x21')]));}}catch(_0x520011){utils[_0x9d0e('0x16')](util[_0x9d0e('0x3')](_0x9d0e('0x24'),_0x171dcc[_0x9d0e('0x5')]),_0x520011);}};exports[_0x9d0e('0x25')]=function(_0x2c769d){try{if(!_[_0x9d0e('0x1f')](dials[_0x2c769d[_0x9d0e('0x5')]])){utils[_0x9d0e('0x18')](util['format'](_0x9d0e('0x26'),_0x2c769d['uniqueid']),_0x2c769d);dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0xa')]=_0x2c769d[_0x9d0e('0xa')];if(_0x2c769d[_0x9d0e('0xa')]=='ANSWER'){dials[_0x2c769d[_0x9d0e('0x5')]]=_[_0x9d0e('0x20')](dials[_0x2c769d[_0x9d0e('0x5')]],_0x2c769d);dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0x27')]=utils[_0x9d0e('0x28')]();dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0x29')]=_0x9d0e('0x2a');utils['info'](util[_0x9d0e('0x3')](_0x9d0e('0x2b'),_0x2c769d[_0x9d0e('0x5')],_0x2c769d['dialstatus'],dials[_0x2c769d[_0x9d0e('0x5')]][_0x9d0e('0x27')]));}else{utils[_0x9d0e('0x2')](util['format'](_0x9d0e('0x2c'),_0x2c769d[_0x9d0e('0x5')],_0x2c769d['dialstatus']));}}}catch(_0x5b256c){utils['error'](util['format'](_0x9d0e('0x26'),_0x2c769d[_0x9d0e('0x5')]),_0x5b256c);}};exports[_0x9d0e('0x2d')]=function(_0x4cc8f1){try{if(!_['isNil'](dials[_0x4cc8f1[_0x9d0e('0x5')]])){utils[_0x9d0e('0x18')](util[_0x9d0e('0x3')]('[%s][dials][hangup]',_0x4cc8f1[_0x9d0e('0x5')]),_0x4cc8f1);utils[_0x9d0e('0x2')](util[_0x9d0e('0x3')](_0x9d0e('0x2e'),_0x4cc8f1[_0x9d0e('0x5')],_0x4cc8f1['calleridnum'],_0x4cc8f1[_0x9d0e('0x2f')],_0x4cc8f1[_0x9d0e('0x30')]));dials[_0x4cc8f1[_0x9d0e('0x5')]]=_['assign'](dials[_0x4cc8f1[_0x9d0e('0x5')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x31')]=utils[_0x9d0e('0x32')](dials[_0x4cc8f1['uniqueid']][_0x9d0e('0x33')],dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x21')]);dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x34')]=utils['diffTime'](dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x27')]||dials[_0x4cc8f1[_0x9d0e('0x5')]]['endtime'],dials[_0x4cc8f1[_0x9d0e('0x5')]]['starttime']);dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x35')]=dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x27')]?utils[_0x9d0e('0x32')](dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x33')],dials[_0x4cc8f1[_0x9d0e('0x5')]][_0x9d0e('0x27')]):0x0;writeDB(dials[_0x4cc8f1[_0x9d0e('0x5')]]);}}catch(_0x1f2a8e){utils[_0x9d0e('0x16')](util[_0x9d0e('0x3')](_0x9d0e('0x36'),_0x4cc8f1['uniqueid']),_0x1f2a8e);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index cb4f3e6..3efaa9f 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 _0x0b25=['queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','username','password','keepConnected','XDR\x20DISABLED','info','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]'];(function(_0x13103d,_0x5637bd){var _0x2f4f97=function(_0x3d796d){while(--_0x3d796d){_0x13103d['push'](_0x13103d['shift']());}};_0x2f4f97(++_0x5637bd);}(_0x0b25,0x1ad));var _0x50b2=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x0b25[_0xf9a6cf];return _0x59e2bc;};var AsteriskManager=require(_0x50b2('0x0'));var config=require(_0x50b2('0x1'));var utils=require(_0x50b2('0x2'));var util=require(_0x50b2('0x3'));var isXDREnabled=config['xdr']&&config['xdr']['disabled']?!config[_0x50b2('0x4')][_0x50b2('0x5')]:!![];var isProduction=config['env']===_0x50b2('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x50b2('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x50b2('0x7')]['port'],config[_0x50b2('0x7')]['ip'],config[_0x50b2('0x7')][_0x50b2('0x8')],config[_0x50b2('0x7')][_0x50b2('0x9')],!![]);ami[_0x50b2('0xa')]();if(!isXDREnabled){utils['info'](_0x50b2('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x50b2('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x50b2('0xd'));var calls=require(_0x50b2('0xe'));var queues=require('./queues.controller');var recordings=require(_0x50b2('0xf'));var members=require(_0x50b2('0x10'));var dials=require(_0x50b2('0x11'));var transfers=require(_0x50b2('0x12'));var core=require(_0x50b2('0x13'));ami['on']('connect',core[_0x50b2('0x14')]);ami['on'](_0x50b2('0x15'),core['shutdown']);ami['on'](_0x50b2('0x16'),core[_0x50b2('0x16')]);ami['on']('error',core[_0x50b2('0x17')]);ami['on'](_0x50b2('0x18'),core[_0x50b2('0x18')]);ami['on'](_0x50b2('0x19'),core[_0x50b2('0x19')]);ami['on'](_0x50b2('0x1a'),function(_0x462d3e){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')]('[%s][index][devicestatechange]',_0x462d3e[_0x50b2('0x1d')]),_0x462d3e);members[_0x50b2('0x1a')](_0x462d3e);}catch(_0x220270){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')]('[%s][index][devicestatechange]',_0x462d3e[_0x50b2('0x1d')]),_0x220270);}});ami['on']('agentcalled',function(_0xe52083){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')]('[%s][index][agentcalled]',_0xe52083['uniqueid']),_0xe52083);agents[_0x50b2('0x1e')](_0xe52083);}catch(_0x5e56d7){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x1f'),_0xe52083[_0x50b2('0x20')]),_0x5e56d7);}});ami['on'](_0x50b2('0x21'),function(_0x4b0a49){try{utils['debug'](util[_0x50b2('0x1c')]('[%s][index][agentringnoanswer]',_0x4b0a49[_0x50b2('0x20')]),_0x4b0a49);agents['agentringnoanswer'](_0x4b0a49);}catch(_0x11ac7a){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')]('[%s][index][agentringnoanswer]',_0x4b0a49[_0x50b2('0x20')]),_0x11ac7a);}});ami['on']('agentconnect',function(_0x481ed8){try{utils['debug'](util[_0x50b2('0x1c')]('[%s][index][agentconnect]',_0x481ed8[_0x50b2('0x20')]),_0x481ed8);agents[_0x50b2('0x22')](_0x481ed8);queues['agentconnect'](_0x481ed8);}catch(_0x23453e){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x23'),_0x481ed8[_0x50b2('0x20')]),_0x23453e);}});ami['on'](_0x50b2('0x24'),function(_0x124740){try{utils['debug'](util[_0x50b2('0x1c')](_0x50b2('0x25'),_0x124740[_0x50b2('0x20')]),_0x124740);agents[_0x50b2('0x24')](_0x124740);queues['agentcomplete'](_0x124740);members['agentcomplete'](_0x124740);}catch(_0x25f372){utils['error'](util[_0x50b2('0x1c')](_0x50b2('0x25'),_0x124740['uniqueid']),_0x25f372);}});ami['on'](_0x50b2('0x26'),function(_0xf29f27){try{utils[_0x50b2('0x1b')](util['format']('[%s][index][queuecallerabandon]',_0xf29f27[_0x50b2('0x20')]),_0xf29f27);agents[_0x50b2('0x26')](_0xf29f27);queues[_0x50b2('0x26')](_0xf29f27);}catch(_0x12decb){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x27'),_0xf29f27['uniqueid']),_0x12decb);}});ami['on'](_0x50b2('0x28'),function(_0x3a6c54){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x29'),_0x3a6c54[_0x50b2('0x20')]),_0x3a6c54);queues['queuecallerjoin'](_0x3a6c54);recordings[_0x50b2('0x28')](_0x3a6c54);}catch(_0xa57406){utils['error'](util[_0x50b2('0x1c')](_0x50b2('0x29'),_0x3a6c54[_0x50b2('0x20')]),_0xa57406);}});ami['on']('queuecallerleave',function(_0x468cd9){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x2a'),_0x468cd9['uniqueid']),_0x468cd9);queues['queuecallerleave'](_0x468cd9);}catch(_0x48c489){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')]('[%s][index][queuecallerleave]',_0x468cd9[_0x50b2('0x20')]),_0x48c489);}});ami['on'](_0x50b2('0x2b'),function(_0x4ded49){try{utils['debug'](util[_0x50b2('0x1c')](_0x50b2('0x2c'),_0x4ded49[_0x50b2('0x20')]),_0x4ded49);queues['musiconholdstart'](_0x4ded49);calls[_0x50b2('0x2b')](_0x4ded49);}catch(_0x2ca55e){utils[_0x50b2('0x17')](util['format'](_0x50b2('0x2c'),_0x4ded49[_0x50b2('0x20')]),_0x2ca55e);}});ami['on'](_0x50b2('0x2d'),function(_0x28692c){try{utils['debug'](util[_0x50b2('0x1c')](_0x50b2('0x2e'),_0x28692c['uniqueid']),_0x28692c);queues[_0x50b2('0x2d')](_0x28692c);calls['musiconholdstop'](_0x28692c);}catch(_0x6f26a7){utils['error'](util[_0x50b2('0x1c')](_0x50b2('0x2e'),_0x28692c['uniqueid']),_0x6f26a7);}});ami['on']('newstate',function(_0x43a856){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')]('[%s][index][newstate]',_0x43a856[_0x50b2('0x20')]),_0x43a856);calls[_0x50b2('0x2f')](_0x43a856);recordings[_0x50b2('0x2f')](_0x43a856);}catch(_0x4bcadc){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x30'),_0x43a856['uniqueid']),_0x4bcadc);}});ami['on'](_0x50b2('0x31'),function(_0x3d9c32){try{utils['debug'](util[_0x50b2('0x1c')](_0x50b2('0x32'),_0x3d9c32[_0x50b2('0x20')]),_0x3d9c32);calls[_0x50b2('0x31')](_0x3d9c32);recordings[_0x50b2('0x31')](_0x3d9c32);dials['hangup'](_0x3d9c32);agents[_0x50b2('0x31')](_0x3d9c32);queues[_0x50b2('0x31')](_0x3d9c32);}catch(_0xacda99){utils['error'](util[_0x50b2('0x1c')](_0x50b2('0x32'),_0x3d9c32[_0x50b2('0x20')]),_0xacda99);}});ami['on'](_0x50b2('0x33'),function(_0x499625){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x34'),_0x499625[_0x50b2('0x20')]),_0x499625);members['cdr'](_0x499625);}catch(_0x268d3c){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x34'),_0x499625['uniqueid']),_0x268d3c);}});ami['on'](_0x50b2('0x35'),function(_0x1de0b1){try{utils['debug'](util[_0x50b2('0x1c')]('[%s][index][blindtransfer]',_0x1de0b1[_0x50b2('0x20')]),_0x1de0b1);queues[_0x50b2('0x35')](_0x1de0b1);agents['blindtransfer'](_0x1de0b1);transfers['blindtransfer'](_0x1de0b1);}catch(_0x22fe1c){utils[_0x50b2('0x17')](util['format'](_0x50b2('0x36'),_0x1de0b1[_0x50b2('0x20')]),_0x22fe1c);}});ami['on'](_0x50b2('0x37'),function(_0x5b7cec){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x38'),_0x5b7cec[_0x50b2('0x39')]),_0x5b7cec);queues[_0x50b2('0x37')](_0x5b7cec);transfers[_0x50b2('0x37')](_0x5b7cec);agents['attendedtransfer'](_0x5b7cec);calls[_0x50b2('0x37')](_0x5b7cec);}catch(_0x5c5b46){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x38'),_0x5b7cec[_0x50b2('0x39')]),_0x5c5b46);}});ami['on'](_0x50b2('0x3a'),function(_0x1fe5b5){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x3b'),_0x1fe5b5['uniqueid']),_0x1fe5b5);queues[_0x50b2('0x3a')](_0x1fe5b5);recordings['varset'](_0x1fe5b5);calls[_0x50b2('0x3a')](_0x1fe5b5);dials[_0x50b2('0x3a')](_0x1fe5b5);}catch(_0x581272){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')]('[%s][index][varset]',_0x1fe5b5[_0x50b2('0x20')]),_0x581272);}});ami['on'](_0x50b2('0x3c'),function(_0x11c811){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x3d'),_0x11c811[_0x50b2('0x20')]),_0x11c811);calls['newexten'](_0x11c811);recordings[_0x50b2('0x3c')](_0x11c811);dials[_0x50b2('0x3c')](_0x11c811);}catch(_0x57ba44){utils[_0x50b2('0x17')](util['format']('[%s][index][newexten]',_0x11c811[_0x50b2('0x20')]),_0x57ba44);}});ami['on'](_0x50b2('0x3e'),function(_0x5d126c){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')](_0x50b2('0x3f'),_0x5d126c[_0x50b2('0x20')]),_0x5d126c);calls[_0x50b2('0x3e')](_0x5d126c);recordings['newchannel'](_0x5d126c);}catch(_0x28f2eb){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')]('[%s][index][newchannel]',_0x5d126c['uniqueid']),_0x28f2eb);}});ami['on'](_0x50b2('0x40'),function(_0x4231f2){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')]('[%s][index][dialbegin]',_0x4231f2[_0x50b2('0x20')]),_0x4231f2);dials[_0x50b2('0x40')](_0x4231f2);}catch(_0x355eb9){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')](_0x50b2('0x41'),_0x4231f2[_0x50b2('0x20')]),_0x355eb9);}});ami['on'](_0x50b2('0x42'),function(_0x557d06){try{utils[_0x50b2('0x1b')](util[_0x50b2('0x1c')]('[%s][index][dialend]',_0x557d06['uniqueid']),_0x557d06);dials[_0x50b2('0x42')](_0x557d06);}catch(_0x5dc3dd){utils[_0x50b2('0x17')](util[_0x50b2('0x1c')]('[%s][index][dialend]',_0x557d06['uniqueid']),_0x5dc3dd);}});} \ No newline at end of file +var _0x3034=['attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','asterisk','username','keepConnected','XDR\x20DISABLED','info','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]'];(function(_0x111032,_0x3a75d6){var _0x1a0a9b=function(_0x33c71f){while(--_0x33c71f){_0x111032['push'](_0x111032['shift']());}};_0x1a0a9b(++_0x3a75d6);}(_0x3034,0x107));var _0x4303=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3034[_0x2641f9];return _0x585741;};var AsteriskManager=require('asterisk-manager');var config=require(_0x4303('0x0'));var utils=require(_0x4303('0x1'));var util=require(_0x4303('0x2'));var isXDREnabled=config['xdr']&&config[_0x4303('0x3')][_0x4303('0x4')]?!config['xdr'][_0x4303('0x4')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x4303('0x3')]&&config[_0x4303('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x4303('0x5')]['port'],config[_0x4303('0x5')]['ip'],config[_0x4303('0x5')][_0x4303('0x6')],config[_0x4303('0x5')]['password'],!![]);ami[_0x4303('0x7')]();if(!isXDREnabled){utils['info'](_0x4303('0x8'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x4303('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x4303('0xa'));var recordings=require(_0x4303('0xb'));var members=require(_0x4303('0xc'));var dials=require(_0x4303('0xd'));var transfers=require(_0x4303('0xe'));var core=require('./core.controller');ami['on'](_0x4303('0xf'),core[_0x4303('0xf')]);ami['on'](_0x4303('0x10'),core[_0x4303('0x10')]);ami['on'](_0x4303('0x11'),core[_0x4303('0x11')]);ami['on'](_0x4303('0x12'),core[_0x4303('0x12')]);ami['on'](_0x4303('0x13'),core[_0x4303('0x13')]);ami['on'](_0x4303('0x14'),core[_0x4303('0x14')]);ami['on'](_0x4303('0x15'),function(_0x2df8bc){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x18'),_0x2df8bc[_0x4303('0x19')]),_0x2df8bc);members[_0x4303('0x15')](_0x2df8bc);}catch(_0x29fa7c){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][devicestatechange]',_0x2df8bc[_0x4303('0x19')]),_0x29fa7c);}});ami['on']('agentcalled',function(_0x1ba007){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x1a'),_0x1ba007[_0x4303('0x1b')]),_0x1ba007);agents[_0x4303('0x1c')](_0x1ba007);}catch(_0x528c65){utils['error'](util['format']('[%s][index][agentcalled]',_0x1ba007[_0x4303('0x1b')]),_0x528c65);}});ami['on']('agentringnoanswer',function(_0x2487d3){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x1d'),_0x2487d3['uniqueid']),_0x2487d3);agents[_0x4303('0x1e')](_0x2487d3);}catch(_0x495957){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x1d'),_0x2487d3['uniqueid']),_0x495957);}});ami['on'](_0x4303('0x1f'),function(_0x13d515){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x20'),_0x13d515['uniqueid']),_0x13d515);agents[_0x4303('0x1f')](_0x13d515);queues[_0x4303('0x1f')](_0x13d515);}catch(_0x204711){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][agentconnect]',_0x13d515[_0x4303('0x1b')]),_0x204711);}});ami['on'](_0x4303('0x21'),function(_0x110052){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x22'),_0x110052[_0x4303('0x1b')]),_0x110052);agents[_0x4303('0x21')](_0x110052);queues[_0x4303('0x21')](_0x110052);members[_0x4303('0x21')](_0x110052);}catch(_0x50db98){utils['error'](util[_0x4303('0x17')](_0x4303('0x22'),_0x110052[_0x4303('0x1b')]),_0x50db98);}});ami['on'](_0x4303('0x23'),function(_0x650c7b){try{utils['debug'](util['format'](_0x4303('0x24'),_0x650c7b[_0x4303('0x1b')]),_0x650c7b);agents[_0x4303('0x23')](_0x650c7b);queues[_0x4303('0x23')](_0x650c7b);}catch(_0x30bb83){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][queuecallerabandon]',_0x650c7b[_0x4303('0x1b')]),_0x30bb83);}});ami['on'](_0x4303('0x25'),function(_0x80c27c){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x26'),_0x80c27c['uniqueid']),_0x80c27c);queues['queuecallerjoin'](_0x80c27c);recordings['queuecallerjoin'](_0x80c27c);}catch(_0x85810){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][queuecallerjoin]',_0x80c27c[_0x4303('0x1b')]),_0x85810);}});ami['on'](_0x4303('0x27'),function(_0x3800b7){try{utils['debug'](util[_0x4303('0x17')](_0x4303('0x28'),_0x3800b7[_0x4303('0x1b')]),_0x3800b7);queues[_0x4303('0x27')](_0x3800b7);}catch(_0x33e92c){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x28'),_0x3800b7[_0x4303('0x1b')]),_0x33e92c);}});ami['on']('musiconholdstart',function(_0xe784ce){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x29'),_0xe784ce['uniqueid']),_0xe784ce);queues[_0x4303('0x2a')](_0xe784ce);calls[_0x4303('0x2a')](_0xe784ce);}catch(_0x349601){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x29'),_0xe784ce[_0x4303('0x1b')]),_0x349601);}});ami['on']('musiconholdstop',function(_0x1e7153){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x2b'),_0x1e7153[_0x4303('0x1b')]),_0x1e7153);queues['musiconholdstop'](_0x1e7153);calls['musiconholdstop'](_0x1e7153);}catch(_0x1dadc8){utils['error'](util[_0x4303('0x17')](_0x4303('0x2b'),_0x1e7153['uniqueid']),_0x1dadc8);}});ami['on']('newstate',function(_0x995c87){try{utils[_0x4303('0x16')](util[_0x4303('0x17')]('[%s][index][newstate]',_0x995c87[_0x4303('0x1b')]),_0x995c87);calls[_0x4303('0x2c')](_0x995c87);recordings[_0x4303('0x2c')](_0x995c87);}catch(_0x485fb9){utils['error'](util[_0x4303('0x17')]('[%s][index][newstate]',_0x995c87['uniqueid']),_0x485fb9);}});ami['on'](_0x4303('0x2d'),function(_0xd702de){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x2e'),_0xd702de[_0x4303('0x1b')]),_0xd702de);calls[_0x4303('0x2d')](_0xd702de);recordings[_0x4303('0x2d')](_0xd702de);dials[_0x4303('0x2d')](_0xd702de);agents[_0x4303('0x2d')](_0xd702de);queues[_0x4303('0x2d')](_0xd702de);}catch(_0x1af65e){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x2e'),_0xd702de[_0x4303('0x1b')]),_0x1af65e);}});ami['on']('cdr',function(_0x34abc1){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x2f'),_0x34abc1[_0x4303('0x1b')]),_0x34abc1);members[_0x4303('0x30')](_0x34abc1);}catch(_0x340820){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s][index][cdr]',_0x34abc1[_0x4303('0x1b')]),_0x340820);}});ami['on']('blindtransfer',function(_0x1266c5){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x31'),_0x1266c5[_0x4303('0x1b')]),_0x1266c5);queues[_0x4303('0x32')](_0x1266c5);agents[_0x4303('0x32')](_0x1266c5);transfers['blindtransfer'](_0x1266c5);}catch(_0x426480){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x31'),_0x1266c5[_0x4303('0x1b')]),_0x426480);}});ami['on']('attendedtransfer',function(_0x151a2c){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x33'),_0x151a2c['origtransfereruniqueid']),_0x151a2c);queues[_0x4303('0x34')](_0x151a2c);transfers[_0x4303('0x34')](_0x151a2c);agents['attendedtransfer'](_0x151a2c);calls['attendedtransfer'](_0x151a2c);}catch(_0x52799e){utils['error'](util[_0x4303('0x17')](_0x4303('0x33'),_0x151a2c[_0x4303('0x35')]),_0x52799e);}});ami['on'](_0x4303('0x36'),function(_0x51a451){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x37'),_0x51a451[_0x4303('0x1b')]),_0x51a451);queues[_0x4303('0x36')](_0x51a451);recordings[_0x4303('0x36')](_0x51a451);calls[_0x4303('0x36')](_0x51a451);dials[_0x4303('0x36')](_0x51a451);}catch(_0x1496c9){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x37'),_0x51a451[_0x4303('0x1b')]),_0x1496c9);}});ami['on'](_0x4303('0x38'),function(_0x22db57){try{utils[_0x4303('0x16')](util['format'](_0x4303('0x39'),_0x22db57[_0x4303('0x1b')]),_0x22db57);calls[_0x4303('0x38')](_0x22db57);recordings[_0x4303('0x38')](_0x22db57);dials['newexten'](_0x22db57);}catch(_0x45d942){utils['error'](util[_0x4303('0x17')](_0x4303('0x39'),_0x22db57[_0x4303('0x1b')]),_0x45d942);}});ami['on'](_0x4303('0x3a'),function(_0x2242a2){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x3b'),_0x2242a2[_0x4303('0x1b')]),_0x2242a2);calls[_0x4303('0x3a')](_0x2242a2);recordings[_0x4303('0x3a')](_0x2242a2);}catch(_0x16ae20){utils['error'](util[_0x4303('0x17')](_0x4303('0x3b'),_0x2242a2[_0x4303('0x1b')]),_0x16ae20);}});ami['on']('dialbegin',function(_0x4d3b6a){try{utils['debug'](util[_0x4303('0x17')](_0x4303('0x3c'),_0x4d3b6a[_0x4303('0x1b')]),_0x4d3b6a);dials['dialbegin'](_0x4d3b6a);}catch(_0x20de3a){utils[_0x4303('0x12')](util[_0x4303('0x17')]('[%s]dialbegin',_0x4d3b6a[_0x4303('0x1b')]),_0x20de3a);}});ami['on'](_0x4303('0x3d'),function(_0x4e7039){try{utils[_0x4303('0x16')](util[_0x4303('0x17')](_0x4303('0x3e'),_0x4e7039[_0x4303('0x1b')]),_0x4e7039);dials[_0x4303('0x3d')](_0x4e7039);}catch(_0x31c705){utils[_0x4303('0x12')](util[_0x4303('0x17')](_0x4303('0x3e'),_0x4e7039[_0x4303('0x1b')]),_0x31c705);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6f2b19b..b92fcb9 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 _0x792f=['[%s][members][writeDB]','some','startsWith','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','NOT_INUSE','exitAt','now','diffTime','enterAt','isNil','interface','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','[%s][members][cdr]','data1','source','data3','destinationchannel','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error'];(function(_0x7c9cdd,_0x33d2b6){var _0x3e5818=function(_0x4da8af){while(--_0x4da8af){_0x7c9cdd['push'](_0x7c9cdd['shift']());}};_0x3e5818(++_0x33d2b6);}(_0x792f,0x15d));var _0xf792=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x792f[_0x16629d];return _0x56ccee;};'use strict';var _=require(_0xf792('0x0'));var util=require(_0xf792('0x1'));var utils=require(_0xf792('0x2'));var members={};var exclude=[_0xf792('0x3'),_0xf792('0x4')];function writeDB(_0x4c9fc0){utils[_0xf792('0x5')](util['format'](_0xf792('0x6'),_0x4c9fc0[_0xf792('0x7')],_0x4c9fc0['interface'],_0x4c9fc0[_0xf792('0x8')],_0x4c9fc0[_0xf792('0x9')],_0x4c9fc0[_0xf792('0xa')],_0x4c9fc0[_0xf792('0xb')]));if(_0x4c9fc0['interface']){utils[_0xf792('0xc')](_0x4c9fc0['interface'])['then'](function(_0x171498){if(_0x171498){_0x4c9fc0[_0xf792('0xa')]=_0x171498[_0xf792('0xd')];_0x4c9fc0[_0xf792('0xe')]=_0x171498[_0xf792('0xe')];utils[_0xf792('0xf')](_0xf792('0x10'),_0x4c9fc0);}else{utils[_0xf792('0x11')](_0x4c9fc0['interface'][_0xf792('0x12')]('/')[0x1])[_0xf792('0x13')](function(_0x3f504c){if(_0x3f504c){_0x4c9fc0['membername']=_0x3f504c[_0xf792('0xd')];_0x4c9fc0[_0xf792('0xe')]=_0x3f504c[_0xf792('0xe')];utils[_0xf792('0xf')](_0xf792('0x10'),_0x4c9fc0);}});}})[_0xf792('0x14')](function(_0x6a2cf9){utils[_0xf792('0x15')](util['format'](_0xf792('0x16'),_0x4c9fc0[_0xf792('0x7')]),_0x6a2cf9);});}delete members[_0x4c9fc0['interface']];}function startsWith(_0x28021f,_0x1737d5){return _[_0xf792('0x17')](_0x28021f,function(_0x4ea40d){return _[_0xf792('0x18')](_0x1737d5,_0x4ea40d);});}exports['devicestatechange']=function(_0x30452d){try{utils['debug'](util[_0xf792('0x19')](_0xf792('0x1a'),members[_0x30452d[_0xf792('0x1b')]]?members[_0x30452d['device']][_0xf792('0x7')]:_0x30452d[_0xf792('0x1b')]),_0x30452d);utils[_0xf792('0x5')](util[_0xf792('0x19')](_0xf792('0x1c'),members[_0x30452d[_0xf792('0x1b')]]?members[_0x30452d[_0xf792('0x1b')]][_0xf792('0x7')]:_0x30452d[_0xf792('0x1b')],_0x30452d[_0xf792('0x1d')],_0x30452d[_0xf792('0x1b')]));switch(_0x30452d[_0xf792('0x1d')]){case _0xf792('0x1e'):case _0xf792('0x1f'):if(!startsWith(exclude,_0x30452d[_0xf792('0x1b')])){members[_0x30452d[_0xf792('0x1b')]]={'channel':_0xf792('0x20'),'interface':_0x30452d[_0xf792('0x1b')],'type':_0xf792('0x21'),'enterAt':utils['now'](),'role':'agent'};}break;case _0xf792('0x22'):if(!_['isNil'](members[_0x30452d[_0xf792('0x1b')]])){members[_0x30452d[_0xf792('0x1b')]][_0xf792('0x23')]=utils[_0xf792('0x24')]();members[_0x30452d['device']]['duration']=utils[_0xf792('0x25')](members[_0x30452d[_0xf792('0x1b')]][_0xf792('0x23')],members[_0x30452d[_0xf792('0x1b')]][_0xf792('0x26')]);if(members[_0x30452d[_0xf792('0x1b')]]['uniqueid']){writeDB(members[_0x30452d[_0xf792('0x1b')]]);}}break;default:break;}}catch(_0x4c0ae2){utils[_0xf792('0x15')](util[_0xf792('0x19')](_0xf792('0x1a'),members[_0x30452d[_0xf792('0x1b')]]?members[_0x30452d[_0xf792('0x1b')]][_0xf792('0x7')]:_0x30452d[_0xf792('0x1b')]),_0x4c0ae2);}};exports['agentcomplete']=function(_0x47912a){try{if(!_[_0xf792('0x27')](members[_0x47912a[_0xf792('0x28')]])){utils[_0xf792('0x29')](util['format'](_0xf792('0x2a'),_0x47912a[_0xf792('0x7')]),_0x47912a);utils[_0xf792('0x5')](util[_0xf792('0x19')](_0xf792('0x2b'),_0x47912a[_0xf792('0x7')],_0x47912a[_0xf792('0x28')],_0x47912a['queue']));members[_0x47912a[_0xf792('0x28')]]=_[_0xf792('0x2c')](members[_0x47912a['interface']],{'data4':_0x47912a['queue'],'uniqueid':_0x47912a[_0xf792('0x7')]});}}catch(_0x2a0ebc){utils['error'](util['format']('[%s][members][agentcomplete]',_0x47912a[_0xf792('0x7')]),_0x2a0ebc);}};exports[_0xf792('0x2d')]=function(_0x4dae77){try{utils['debug'](util[_0xf792('0x19')](_0xf792('0x2e'),_0x4dae77[_0xf792('0x7')]),_0x4dae77);if(_0x4dae77['channel']){var _0x44c379=_0x4dae77[_0xf792('0x8')][_0xf792('0x12')]('-')[0x0];if(!_[_0xf792('0x27')](members[_0x44c379])){members[_0x44c379]=_[_0xf792('0x2c')](members[_0x44c379],{'data1':members[_0x44c379][_0xf792('0x2f')]||_0x4dae77[_0xf792('0xb')],'data2':members[_0x44c379][_0xf792('0x9')]||_0x4dae77[_0xf792('0x30')],'data3':members[_0x44c379]['data3']||_0x4dae77['destination'],'uniqueid':members[_0x44c379][_0xf792('0x7')]||_0x4dae77[_0xf792('0x7')]});utils[_0xf792('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4dae77['uniqueid'],members[_0x44c379][_0xf792('0x2f')],members[_0x44c379][_0xf792('0x9')],members[_0x44c379][_0xf792('0x31')]));if(members[_0x44c379][_0xf792('0x23')]){writeDB(members[_0x44c379]);}}}if(_0x4dae77[_0xf792('0x32')]){var _0x4c6e5d=_0x4dae77['destinationchannel']['split']('-')[0x0];if(!_[_0xf792('0x27')](members[_0x4c6e5d])){members[_0x4c6e5d]=_[_0xf792('0x2c')](members[_0x4c6e5d],{'data1':members[_0x4c6e5d][_0xf792('0x2f')]||_0x4dae77[_0xf792('0xb')],'data2':members[_0x4c6e5d][_0xf792('0x9')]||_0x4dae77[_0xf792('0x30')],'data3':members[_0x4c6e5d]['data3']||_0x4dae77[_0xf792('0x33')],'uniqueid':members[_0x4c6e5d][_0xf792('0x7')]||_0x4dae77[_0xf792('0x7')]});utils[_0xf792('0x5')](util[_0xf792('0x19')](_0xf792('0x34'),_0x4dae77[_0xf792('0x7')],members[_0x4c6e5d][_0xf792('0x2f')],members[_0x4c6e5d][_0xf792('0x9')],members[_0x4c6e5d][_0xf792('0x31')]));if(members[_0x4c6e5d]['exitAt']){writeDB(members[_0x4c6e5d]);}}}}catch(_0x2a0707){utils[_0xf792('0x15')](util['format']('[%s][members][cdr]',_0x4dae77[_0xf792('0x7')]),_0x2a0707);}}; \ No newline at end of file +var _0x38c3=['exitAt','duration','diffTime','agentcomplete','debug','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','channel','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x38c3,0x13d));var _0x338c=function(_0x188905,_0x398fac){_0x188905=_0x188905-0x0;var _0x2bf735=_0x38c3[_0x188905];return _0x2bf735;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var utils=require('./utils');var members={};var exclude=[_0x338c('0x2'),_0x338c('0x3')];function writeDB(_0x36a187){utils[_0x338c('0x4')](util[_0x338c('0x5')](_0x338c('0x6'),_0x36a187['uniqueid'],_0x36a187[_0x338c('0x7')],_0x36a187['channel'],_0x36a187[_0x338c('0x8')],_0x36a187[_0x338c('0x9')],_0x36a187['type']));if(_0x36a187[_0x338c('0x7')]){utils[_0x338c('0xa')](_0x36a187[_0x338c('0x7')])['then'](function(_0x2f3652){if(_0x2f3652){_0x36a187[_0x338c('0x9')]=_0x2f3652[_0x338c('0xb')];_0x36a187[_0x338c('0xc')]=_0x2f3652[_0x338c('0xc')];utils[_0x338c('0xd')](_0x338c('0xe'),_0x36a187);}else{utils['getUserByName'](_0x36a187[_0x338c('0x7')][_0x338c('0xf')]('/')[0x1])['then'](function(_0x2e17b8){if(_0x2e17b8){_0x36a187['membername']=_0x2e17b8[_0x338c('0xb')];_0x36a187[_0x338c('0xc')]=_0x2e17b8['internal'];utils[_0x338c('0xd')](_0x338c('0xe'),_0x36a187);}});}})[_0x338c('0x10')](function(_0x3f3c08){utils[_0x338c('0x11')](util[_0x338c('0x5')](_0x338c('0x12'),_0x36a187[_0x338c('0x13')]),_0x3f3c08);});}delete members[_0x36a187[_0x338c('0x7')]];}function startsWith(_0x127cd1,_0x512b38){return _['some'](_0x127cd1,function(_0x26a6dd){return _[_0x338c('0x14')](_0x512b38,_0x26a6dd);});}exports[_0x338c('0x15')]=function(_0x21cbd4){try{utils['debug'](util[_0x338c('0x5')](_0x338c('0x16'),members[_0x21cbd4[_0x338c('0x17')]]?members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]:_0x21cbd4[_0x338c('0x17')]),_0x21cbd4);utils[_0x338c('0x4')](util[_0x338c('0x5')](_0x338c('0x18'),members[_0x21cbd4[_0x338c('0x17')]]?members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]:_0x21cbd4[_0x338c('0x17')],_0x21cbd4['state'],_0x21cbd4['device']));switch(_0x21cbd4[_0x338c('0x19')]){case _0x338c('0x1a'):case _0x338c('0x1b'):if(!startsWith(exclude,_0x21cbd4[_0x338c('0x17')])){members[_0x21cbd4['device']]={'channel':_0x338c('0x1c'),'interface':_0x21cbd4['device'],'type':_0x338c('0x1d'),'enterAt':utils[_0x338c('0x1e')](),'role':'agent'};}break;case _0x338c('0x1f'):if(!_[_0x338c('0x20')](members[_0x21cbd4['device']])){members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x21')]=utils[_0x338c('0x1e')]();members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x22')]=utils[_0x338c('0x23')](members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x21')],members[_0x21cbd4[_0x338c('0x17')]]['enterAt']);if(members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]){writeDB(members[_0x21cbd4[_0x338c('0x17')]]);}}break;default:break;}}catch(_0x4d78a5){utils[_0x338c('0x11')](util[_0x338c('0x5')]('[%s][members][devicestatechange]',members[_0x21cbd4[_0x338c('0x17')]]?members[_0x21cbd4[_0x338c('0x17')]][_0x338c('0x13')]:_0x21cbd4[_0x338c('0x17')]),_0x4d78a5);}};exports[_0x338c('0x24')]=function(_0x2ae332){try{if(!_['isNil'](members[_0x2ae332['interface']])){utils[_0x338c('0x25')](util[_0x338c('0x5')](_0x338c('0x26'),_0x2ae332[_0x338c('0x13')]),_0x2ae332);utils[_0x338c('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2ae332[_0x338c('0x13')],_0x2ae332['interface'],_0x2ae332[_0x338c('0x27')]));members[_0x2ae332[_0x338c('0x7')]]=_[_0x338c('0x28')](members[_0x2ae332[_0x338c('0x7')]],{'data4':_0x2ae332[_0x338c('0x27')],'uniqueid':_0x2ae332[_0x338c('0x13')]});}}catch(_0x4a148e){utils['error'](util['format'](_0x338c('0x26'),_0x2ae332[_0x338c('0x13')]),_0x4a148e);}};exports['cdr']=function(_0x1656c6){try{utils[_0x338c('0x25')](util[_0x338c('0x5')](_0x338c('0x29'),_0x1656c6[_0x338c('0x13')]),_0x1656c6);if(_0x1656c6[_0x338c('0x2a')]){var _0x579073=_0x1656c6[_0x338c('0x2a')][_0x338c('0xf')]('-')[0x0];if(!_[_0x338c('0x20')](members[_0x579073])){members[_0x579073]=_['assign'](members[_0x579073],{'data1':members[_0x579073][_0x338c('0x2b')]||_0x1656c6[_0x338c('0x2c')],'data2':members[_0x579073][_0x338c('0x8')]||_0x1656c6[_0x338c('0x2d')],'data3':members[_0x579073][_0x338c('0x2e')]||_0x1656c6[_0x338c('0x2f')],'uniqueid':members[_0x579073][_0x338c('0x13')]||_0x1656c6[_0x338c('0x13')]});utils['info'](util[_0x338c('0x5')](_0x338c('0x30'),_0x1656c6[_0x338c('0x13')],members[_0x579073][_0x338c('0x2b')],members[_0x579073]['data2'],members[_0x579073][_0x338c('0x2e')]));if(members[_0x579073][_0x338c('0x21')]){writeDB(members[_0x579073]);}}}if(_0x1656c6[_0x338c('0x31')]){var _0x314015=_0x1656c6['destinationchannel'][_0x338c('0xf')]('-')[0x0];if(!_[_0x338c('0x20')](members[_0x314015])){members[_0x314015]=_[_0x338c('0x28')](members[_0x314015],{'data1':members[_0x314015][_0x338c('0x2b')]||_0x1656c6[_0x338c('0x2c')],'data2':members[_0x314015][_0x338c('0x8')]||_0x1656c6[_0x338c('0x2d')],'data3':members[_0x314015][_0x338c('0x2e')]||_0x1656c6[_0x338c('0x2f')],'uniqueid':members[_0x314015][_0x338c('0x13')]||_0x1656c6[_0x338c('0x13')]});utils[_0x338c('0x4')](util[_0x338c('0x5')](_0x338c('0x30'),_0x1656c6[_0x338c('0x13')],members[_0x314015][_0x338c('0x2b')],members[_0x314015][_0x338c('0x8')],members[_0x314015][_0x338c('0x2e')]));if(members[_0x314015][_0x338c('0x21')]){writeDB(members[_0x314015]);}}}}catch(_0x17f520){utils[_0x338c('0x11')](util[_0x338c('0x5')](_0x338c('0x29'),_0x1656c6[_0x338c('0x13')]),_0x17f520);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3517012..2491187 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 _0x9aa4=['type','request','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexit','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','holdtime','diffTime','queuecallerleaveAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','membername','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','origtransfererexten','secondtransfererlinkedid','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x9aa4,0x125));var _0x49aa=function(_0x16c06f,_0x179c07){_0x16c06f=_0x16c06f-0x0;var _0x13bc62=_0x9aa4[_0x16c06f];return _0x13bc62;};'use strict';var _=require(_0x49aa('0x0'));var util=require(_0x49aa('0x1'));var utils=require(_0x49aa('0x2'));var queues={};function writeDB(_0x20ccad){utils[_0x49aa('0x3')](util['format'](_0x49aa('0x4'),_0x20ccad[_0x49aa('0x5')],_0x20ccad['channel'],_0x20ccad[_0x49aa('0x6')],_0x20ccad[_0x49aa('0x7')],_0x20ccad[_0x49aa('0x8')],_0x20ccad[_0x49aa('0x9')],_0x20ccad[_0x49aa('0xa')]));if(_0x20ccad[_0x49aa('0x6')]){utils[_0x49aa('0xb')](_0x20ccad[_0x49aa('0x6')])[_0x49aa('0xc')](function(_0x30b90d){if(_0x30b90d){_0x20ccad['type']=_0x30b90d[_0x49aa('0xd')];}utils[_0x49aa('0xe')]('CreateVoiceQueueReport',_0x20ccad);});}else{utils[_0x49aa('0xe')](_0x49aa('0xf'),_0x20ccad);}if(_0x20ccad[_0x49aa('0x10')]){delete queues[_0x20ccad[_0x49aa('0x10')]];}else{delete queues[_0x20ccad[_0x49aa('0x5')]];}}exports['queuecallerjoin']=function(_0x3ef509){try{utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x13'),_0x3ef509[_0x49aa('0x5')]),_0x3ef509);utils['info'](util[_0x49aa('0x12')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x3ef509['uniqueid'],_0x3ef509[_0x49aa('0x6')],_0x3ef509[_0x49aa('0x14')]));queues[_0x3ef509[_0x49aa('0x5')]]=_[_0x49aa('0x15')](_0x3ef509,{'originalposition':_0x3ef509['position'],'queuecallerjoinAt':utils[_0x49aa('0x16')](),'mohtime':0x0});}catch(_0x3c4737){utils[_0x49aa('0x17')](util[_0x49aa('0x12')](_0x49aa('0x13'),_0x3ef509[_0x49aa('0x5')]),_0x3c4737);}};exports[_0x49aa('0x18')]=function(_0x31db22){try{if(!_[_0x49aa('0x19')](queues[_0x31db22[_0x49aa('0x5')]])){utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x1a'),_0x31db22[_0x49aa('0x5')]),_0x31db22);if(queues[_0x31db22[_0x49aa('0x5')]]['queuecallerleaveAt']){if(!queues[_0x31db22['uniqueid']][_0x49aa('0x1b')]&&!queues[_0x31db22['uniqueid']]['queuecallerexit']){queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0x1c')]=!![];queues[_0x31db22[_0x49aa('0x5')]]['queuecallercompleteAt']=utils[_0x49aa('0x16')]();queues[_0x31db22[_0x49aa('0x5')]]['queuecallerexitreason']=_0x49aa('0x1d');}utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x1e'),_0x31db22[_0x49aa('0x5')],queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0x1f')],queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0xa')]));writeDB(queues[_0x31db22[_0x49aa('0x5')]]);}else if(queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0x10')]){utils[_0x49aa('0x3')](util['format'](_0x49aa('0x20'),_0x31db22['uniqueid'],queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0x1f')],queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0x10')]));queues[queues[_0x31db22['uniqueid']]['transfereduniqueid']]=queues[_0x31db22[_0x49aa('0x5')]];queues[queues[_0x31db22[_0x49aa('0x5')]][_0x49aa('0x10')]][_0x49aa('0x21')]=0x2;delete queues[_0x31db22['uniqueid']];}}}catch(_0x5d4aff){utils[_0x49aa('0x17')](util[_0x49aa('0x12')]('[%s][queues][hangup]',_0x31db22[_0x49aa('0x5')]),_0x5d4aff);}};exports[_0x49aa('0x22')]=function(_0x39051e){try{utils[_0x49aa('0x11')](util[_0x49aa('0x12')]('[%s][queues][varset]',_0x39051e[_0x49aa('0x5')]),_0x39051e);if(!_[_0x49aa('0x19')](_0x39051e[_0x49aa('0x23')][_0x49aa('0x24')])&&_0x39051e[_0x49aa('0x25')]['toUpperCase']()!==_0x49aa('0x26')){if(!_[_0x49aa('0x19')](queues[_0x39051e[_0x49aa('0x5')]])){queues[_0x39051e['uniqueid']]['queuecallerabandon']=![];queues[_0x39051e['uniqueid']][_0x49aa('0x27')]=null;queues[_0x39051e[_0x49aa('0x5')]]['queuecallerexit']=!![];queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0x28')]=utils[_0x49aa('0x16')]();queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0xa')]=_0x39051e[_0x49aa('0x25')][_0x49aa('0x29')]();utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x2a'),_0x39051e[_0x49aa('0x5')],queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0x1f')],_0x39051e[_0x49aa('0x25')],queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0xa')]));writeDB(queues[_0x39051e[_0x49aa('0x5')]]);}}else if(!_['isNil'](_0x39051e[_0x49aa('0x23')]['queueposition'])){if(!_[_0x49aa('0x19')](queues[_0x39051e[_0x49aa('0x5')]])&&!queues[_0x39051e[_0x49aa('0x5')]]['queuecallerabandon']){queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0x1b')]=![];queues[_0x39051e['uniqueid']][_0x49aa('0x27')]=null;queues[_0x39051e[_0x49aa('0x5')]]['queuecallerexit']=!![];queues[_0x39051e[_0x49aa('0x5')]]['queuecallerexitAt']=utils[_0x49aa('0x16')]();queues[_0x39051e['uniqueid']][_0x49aa('0xa')]=_0x49aa('0x2b');utils['info'](util[_0x49aa('0x12')](_0x49aa('0x2c'),_0x39051e[_0x49aa('0x5')],queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0x1f')],_0x39051e['value'],queues[_0x39051e[_0x49aa('0x5')]][_0x49aa('0xa')]));}}}catch(_0x531fde){utils[_0x49aa('0x17')](util[_0x49aa('0x12')]('[%s][queues][varset]',_0x39051e[_0x49aa('0x5')]),_0x531fde);}};exports[_0x49aa('0x1b')]=function(_0xdc9e92){try{if(!_['isNil'](queues[_0xdc9e92[_0x49aa('0x5')]])){utils[_0x49aa('0x11')](util['format'](_0x49aa('0x2d'),_0xdc9e92[_0x49aa('0x5')]),_0xdc9e92);queues[_0xdc9e92[_0x49aa('0x5')]][_0x49aa('0x2e')]=![];queues[_0xdc9e92[_0x49aa('0x5')]][_0x49aa('0x28')]=null;queues[_0xdc9e92[_0x49aa('0x5')]]['queuecallerabandon']=!![];queues[_0xdc9e92[_0x49aa('0x5')]][_0x49aa('0x27')]=utils['now']();queues[_0xdc9e92[_0x49aa('0x5')]][_0x49aa('0xa')]='ABANDONED';utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x2f'),_0xdc9e92[_0x49aa('0x5')],queues[_0xdc9e92['uniqueid']][_0x49aa('0x1f')],queues[_0xdc9e92[_0x49aa('0x5')]][_0x49aa('0xa')]));}}catch(_0x44795a){utils[_0x49aa('0x17')](util[_0x49aa('0x12')](_0x49aa('0x2d'),_0xdc9e92[_0x49aa('0x5')]),_0x44795a);}};exports[_0x49aa('0x30')]=function(_0xa94271){try{if(!_[_0x49aa('0x19')](queues[_0xa94271[_0x49aa('0x5')]])){utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x31'),_0xa94271[_0x49aa('0x5')]),_0xa94271);utils[_0x49aa('0x3')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xa94271[_0x49aa('0x5')],queues[_0xa94271[_0x49aa('0x5')]][_0x49aa('0x1f')],_0xa94271['connectedlinenum'],_0xa94271['connectedlinename']));queues[_0xa94271[_0x49aa('0x5')]][_0x49aa('0x30')]=!![];queues[_0xa94271[_0x49aa('0x5')]]['queuecallerleaveAt']=utils[_0x49aa('0x16')]();queues[_0xa94271['uniqueid']][_0x49aa('0x32')]=utils[_0x49aa('0x33')](queues[_0xa94271[_0x49aa('0x5')]][_0x49aa('0x34')],queues[_0xa94271[_0x49aa('0x5')]]['queuecallerjoinAt']);queues[_0xa94271[_0x49aa('0x5')]]['position']=_0xa94271[_0x49aa('0x14')];queues[_0xa94271[_0x49aa('0x5')]][_0x49aa('0x35')]=_0xa94271[_0x49aa('0x35')];queues[_0xa94271[_0x49aa('0x5')]]['connectedlinenum']=_0xa94271[_0x49aa('0x36')];queues[_0xa94271[_0x49aa('0x5')]][_0x49aa('0x37')]=_0xa94271[_0x49aa('0x37')];}}catch(_0x2ec8db){utils['error'](util[_0x49aa('0x12')](_0x49aa('0x31'),_0xa94271[_0x49aa('0x5')]),_0x2ec8db);}};exports[_0x49aa('0x38')]=function(_0x2f2f8e){try{if(!_[_0x49aa('0x19')](queues[_0x2f2f8e[_0x49aa('0x5')]])){utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x39'),_0x2f2f8e['uniqueid']),_0x2f2f8e);utils[_0x49aa('0x3')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2f2f8e[_0x49aa('0x5')],queues[_0x2f2f8e[_0x49aa('0x5')]][_0x49aa('0x1f')],_0x2f2f8e['membername'],_0x2f2f8e[_0x49aa('0x3a')]));queues[_0x2f2f8e['uniqueid']]['queuecallerabandon']=![];queues[_0x2f2f8e['uniqueid']][_0x49aa('0x1b')]=![];queues[_0x2f2f8e[_0x49aa('0x5')]][_0x49aa('0x27')]=null;queues[_0x2f2f8e[_0x49aa('0x5')]]['queuecallerexit']=![];queues[_0x2f2f8e[_0x49aa('0x5')]][_0x49aa('0xa')]=null;queues[_0x2f2f8e[_0x49aa('0x5')]]['queuecallerexitAt']=null;queues[_0x2f2f8e[_0x49aa('0x5')]][_0x49aa('0x3b')]=!![];queues[_0x2f2f8e['uniqueid']][_0x49aa('0x9')]=_0x2f2f8e['destaccountcode'];queues[_0x2f2f8e[_0x49aa('0x5')]][_0x49aa('0x7')]=_0x2f2f8e['membername'];}}catch(_0xc3c1d4){utils[_0x49aa('0x17')](util['format']('[%s][queues][agentconnect]',_0x2f2f8e['uniqueid']),_0xc3c1d4);}};exports[_0x49aa('0x3c')]=function(_0x24788e){try{if(!_['isNil'](queues[_0x24788e[_0x49aa('0x5')]])){if(queues[_0x24788e[_0x49aa('0x5')]]['queuecallerleaveAt']){utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x3d'),_0x24788e['uniqueid']),_0x24788e);queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x1b')]=![];queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x1b')]=![];queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x27')]=null;queues[_0x24788e['uniqueid']][_0x49aa('0x2e')]=![];queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x28')]=null;queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x3b')]=!![];queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x7')]=_0x24788e[_0x49aa('0x3e')];queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x1c')]=!![];queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x3f')]=utils[_0x49aa('0x16')]();if(_0x24788e[_0x49aa('0x40')]==_0x49aa('0x41')){if(!queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x41')]){queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0xa')]=_0x49aa('0x42');}}else{queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0xa')]='COMPLETEDBY'+_0x24788e[_0x49aa('0x40')][_0x49aa('0x29')]();}utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x43'),_0x24788e[_0x49aa('0x5')],queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0x1f')],_0x24788e[_0x49aa('0x3e')],queues[_0x24788e[_0x49aa('0x5')]][_0x49aa('0xa')]));writeDB(queues[_0x24788e[_0x49aa('0x5')]]);}}}catch(_0x3f924f){utils[_0x49aa('0x17')](util[_0x49aa('0x12')](_0x49aa('0x3d'),_0x24788e[_0x49aa('0x5')]),_0x3f924f);}};exports['blindtransfer']=function(_0x597aa5){try{if(!_['isNil'](queues[_0x597aa5[_0x49aa('0x44')]])){utils[_0x49aa('0x11')](util['format'](_0x49aa('0x45'),_0x597aa5[_0x49aa('0x5')]),_0x597aa5);queues[_0x597aa5[_0x49aa('0x44')]]['transfer']=!![];queues[_0x597aa5[_0x49aa('0x44')]][_0x49aa('0x46')]=_0x49aa('0x47');queues[_0x597aa5[_0x49aa('0x44')]]['transferexten']=_0x597aa5[_0x49aa('0x48')];queues[_0x597aa5[_0x49aa('0x44')]][_0x49aa('0x49')]=_0x597aa5[_0x49aa('0x44')];queues[_0x597aa5[_0x49aa('0x44')]][_0x49aa('0xa')]=_0x49aa('0x4a');utils['info'](util[_0x49aa('0x12')](_0x49aa('0x4b'),_0x597aa5[_0x49aa('0x5')],queues[_0x597aa5[_0x49aa('0x44')]]['name'],_0x597aa5[_0x49aa('0x44')],_0x597aa5[_0x49aa('0x48')]));}}catch(_0x3f3e4e){utils[_0x49aa('0x17')](util[_0x49aa('0x12')](_0x49aa('0x45'),_0x597aa5[_0x49aa('0x5')]),_0x3f3e4e);}};exports[_0x49aa('0x4c')]=function(_0x2c0f98){try{utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x4d'),_0x2c0f98[_0x49aa('0x4e')]),_0x2c0f98);if(_0x2c0f98[_0x49aa('0x4e')]==_0x2c0f98[_0x49aa('0x4f')]){if(!_[_0x49aa('0x19')](queues[_0x2c0f98['secondtransfererlinkedid']])){utils[_0x49aa('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2c0f98[_0x49aa('0x4e')],queues[_0x2c0f98['secondtransfererlinkedid']]['name'],_0x2c0f98[_0x49aa('0x50')]));queues[_0x2c0f98[_0x49aa('0x51')]]['transfer']=!![];queues[_0x2c0f98[_0x49aa('0x51')]]['transfertype']=_0x49aa('0x52');queues[_0x2c0f98[_0x49aa('0x51')]]['transferexten']=_0x2c0f98['origtransfererexten'];queues[_0x2c0f98[_0x49aa('0x51')]][_0x49aa('0x49')]=_0x2c0f98[_0x49aa('0x4e')];queues[_0x2c0f98['secondtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x2c0f98[_0x49aa('0x4f')]])){if(_0x2c0f98[_0x49aa('0x53')]&&queues[_0x2c0f98[_0x49aa('0x53')]]){queues[_0x2c0f98[_0x49aa('0x53')]][_0x49aa('0x21')]=0x1;queues[_0x2c0f98['transfereeuniqueid']]=_[_0x49aa('0x54')](queues[_0x2c0f98[_0x49aa('0x53')]]);queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x10')]=_0x2c0f98[_0x49aa('0x55')];queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x21')]=0x2;queues[_0x2c0f98[_0x49aa('0x44')]]['calleridnum']=queues[_0x2c0f98[_0x49aa('0x51')]][_0x49aa('0x8')];queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x56')]=queues[_0x2c0f98['secondtransfererlinkedid']][_0x49aa('0x56')];queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x57')]=utils[_0x49aa('0x16')]();queues[_0x2c0f98[_0x49aa('0x44')]]['queuecallerleaveAt']=utils[_0x49aa('0x16')]();queues[_0x2c0f98['transfereeuniqueid']][_0x49aa('0x32')]=0x0;queues[_0x2c0f98[_0x49aa('0x44')]]['mohtime']=0x0;utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x58'),_0x2c0f98['origtransfereruniqueid'],queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x1f')],queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x8')],queues[_0x2c0f98[_0x49aa('0x44')]][_0x49aa('0x56')]));}else{utils['info'](util[_0x49aa('0x12')](_0x49aa('0x59'),_0x2c0f98[_0x49aa('0x4e')],queues[_0x2c0f98[_0x49aa('0x4f')]][_0x49aa('0x1f')],_0x2c0f98[_0x49aa('0x51')]));queues[_0x2c0f98[_0x49aa('0x4f')]]['transfereduniqueid']=_0x2c0f98[_0x49aa('0x51')];}}}else if(_0x2c0f98['secondtransfereruniqueid']==_0x2c0f98[_0x49aa('0x51')]){if(!_[_0x49aa('0x19')](queues[_0x2c0f98[_0x49aa('0x4f')]])){utils['info'](util[_0x49aa('0x12')](_0x49aa('0x5a'),_0x2c0f98['origtransfereruniqueid'],queues[_0x2c0f98[_0x49aa('0x4f')]][_0x49aa('0x1f')],_0x2c0f98['secondtransfereruniqueid'],_0x2c0f98['secondtransfererexten']));queues[_0x2c0f98[_0x49aa('0x4f')]][_0x49aa('0x41')]=!![];queues[_0x2c0f98['origtransfererlinkedid']][_0x49aa('0x46')]='ATTENDED';queues[_0x2c0f98[_0x49aa('0x4f')]][_0x49aa('0x5b')]=_0x2c0f98[_0x49aa('0x5c')];queues[_0x2c0f98[_0x49aa('0x4f')]]['transferuniqueid']=_0x2c0f98[_0x49aa('0x5d')];queues[_0x2c0f98[_0x49aa('0x4f')]][_0x49aa('0xa')]=_0x49aa('0x5e');}if(!_[_0x49aa('0x19')](queues[_0x2c0f98['secondtransfererlinkedid']])){if(_0x2c0f98[_0x49aa('0x5f')]&&queues[_0x2c0f98[_0x49aa('0x5f')]]){queues[_0x2c0f98[_0x49aa('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x2c0f98[_0x49aa('0x55')]]=_[_0x49aa('0x54')](queues[_0x2c0f98[_0x49aa('0x5f')]]);queues[_0x2c0f98[_0x49aa('0x55')]]['transfereduniqueid']=_0x2c0f98[_0x49aa('0x55')];queues[_0x2c0f98['transfertargetuniqueid']][_0x49aa('0x21')]=0x2;queues[_0x2c0f98['transfertargetuniqueid']][_0x49aa('0x8')]=queues[_0x2c0f98[_0x49aa('0x4f')]]['calleridnum'];queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x56')]=queues[_0x2c0f98['origtransfererlinkedid']][_0x49aa('0x56')];queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x57')]=utils[_0x49aa('0x16')]();queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x34')]=utils[_0x49aa('0x16')]();queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x32')]=0x0;queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x60')]=0x0;utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x61'),_0x2c0f98[_0x49aa('0x4e')],queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x1f')],queues[_0x2c0f98[_0x49aa('0x55')]]['transfereduniqueid'],queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x8')],queues[_0x2c0f98[_0x49aa('0x55')]][_0x49aa('0x56')]));}else{utils[_0x49aa('0x3')](util[_0x49aa('0x12')](_0x49aa('0x59'),_0x2c0f98[_0x49aa('0x4e')],queues[_0x2c0f98['secondtransfererlinkedid']][_0x49aa('0x1f')],_0x2c0f98[_0x49aa('0x4f')]));queues[_0x2c0f98[_0x49aa('0x51')]][_0x49aa('0x10')]=_0x2c0f98[_0x49aa('0x4f')];}}}}catch(_0x4f8c01){utils[_0x49aa('0x17')](util[_0x49aa('0x12')](_0x49aa('0x4d'),_0x2c0f98[_0x49aa('0x4e')]),_0x4f8c01);}};exports['musiconholdstart']=function(_0x3de816){try{if(!_[_0x49aa('0x19')](queues[_0x3de816['uniqueid']])){utils[_0x49aa('0x11')](util[_0x49aa('0x12')]('[%s][queues][musiconholdstart]',_0x3de816['uniqueid']),_0x3de816);queues[_0x3de816[_0x49aa('0x5')]][_0x49aa('0x62')]=utils['now']();utils['info'](util[_0x49aa('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3de816[_0x49aa('0x5')],queues[_0x3de816[_0x49aa('0x5')]][_0x49aa('0x1f')],queues[_0x3de816[_0x49aa('0x5')]][_0x49aa('0x62')]));}}catch(_0x5eac1d){utils[_0x49aa('0x17')](util['format']('[%s][queues][musiconholdstart]',_0x3de816[_0x49aa('0x5')]),_0x5eac1d);}};exports[_0x49aa('0x63')]=function(_0x12cfd6){try{if(!_[_0x49aa('0x19')](queues[_0x12cfd6['uniqueid']])){if(!_[_0x49aa('0x19')](queues[_0x12cfd6[_0x49aa('0x5')]]['musiconholdstartAt'])){utils[_0x49aa('0x11')](util[_0x49aa('0x12')](_0x49aa('0x64'),_0x12cfd6[_0x49aa('0x5')]),_0x12cfd6);queues[_0x12cfd6[_0x49aa('0x5')]][_0x49aa('0x60')]+=utils[_0x49aa('0x33')](utils['now'](),queues[_0x12cfd6['uniqueid']][_0x49aa('0x62')]);utils[_0x49aa('0x3')](util['format'](_0x49aa('0x65'),_0x12cfd6[_0x49aa('0x5')],queues[_0x12cfd6[_0x49aa('0x5')]]['name'],queues[_0x12cfd6[_0x49aa('0x5')]][_0x49aa('0x60')]));delete queues[_0x12cfd6[_0x49aa('0x5')]][_0x49aa('0x62')];}}}catch(_0x200c55){utils[_0x49aa('0x17')](util[_0x49aa('0x12')](_0x49aa('0x64'),_0x12cfd6['uniqueid']),_0x200c55);}}; \ No newline at end of file +var _0x30fa=['connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerabandon','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum'];(function(_0x3c3c49,_0x48b860){var _0x4d13e0=function(_0xeeda09){while(--_0xeeda09){_0x3c3c49['push'](_0x3c3c49['shift']());}};_0x4d13e0(++_0x48b860);}(_0x30fa,0x1d9));var _0xa30f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x30fa[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xa30f('0x0'));var utils=require(_0xa30f('0x1'));var queues={};function writeDB(_0x4423e7){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x4'),_0x4423e7[_0xa30f('0x5')],_0x4423e7[_0xa30f('0x6')],_0x4423e7[_0xa30f('0x7')],_0x4423e7[_0xa30f('0x8')],_0x4423e7[_0xa30f('0x9')],_0x4423e7[_0xa30f('0xa')],_0x4423e7[_0xa30f('0xb')]));if(_0x4423e7[_0xa30f('0x7')]){utils[_0xa30f('0xc')](_0x4423e7[_0xa30f('0x7')])[_0xa30f('0xd')](function(_0x22aef3){if(_0x22aef3){_0x4423e7['type']=_0x22aef3[_0xa30f('0xe')];}utils[_0xa30f('0xf')]('CreateVoiceQueueReport',_0x4423e7);});}else{utils['request'](_0xa30f('0x10'),_0x4423e7);}if(_0x4423e7[_0xa30f('0x11')]){delete queues[_0x4423e7[_0xa30f('0x11')]];}else{delete queues[_0x4423e7[_0xa30f('0x5')]];}}exports[_0xa30f('0x12')]=function(_0xa8756b){try{utils[_0xa30f('0x13')](util['format']('[%s][queues][queuecallerjoin]',_0xa8756b[_0xa30f('0x5')]),_0xa8756b);utils[_0xa30f('0x2')](util['format'](_0xa30f('0x14'),_0xa8756b['uniqueid'],_0xa8756b['queue'],_0xa8756b[_0xa30f('0x15')]));queues[_0xa8756b[_0xa30f('0x5')]]=_['assign'](_0xa8756b,{'originalposition':_0xa8756b[_0xa30f('0x15')],'queuecallerjoinAt':utils[_0xa30f('0x16')](),'mohtime':0x0});}catch(_0x226be7){utils[_0xa30f('0x17')](util['format'](_0xa30f('0x18'),_0xa8756b[_0xa30f('0x5')]),_0x226be7);}};exports[_0xa30f('0x19')]=function(_0x3413fe){try{if(!_[_0xa30f('0x1a')](queues[_0x3413fe['uniqueid']])){utils[_0xa30f('0x13')](util[_0xa30f('0x3')](_0xa30f('0x1b'),_0x3413fe['uniqueid']),_0x3413fe);if(queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1c')]){if(!queues[_0x3413fe[_0xa30f('0x5')]]['queuecallerabandon']&&!queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1d')]){queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1e')]=!![];queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x1f')]=utils[_0xa30f('0x16')]();queues[_0x3413fe['uniqueid']][_0xa30f('0xb')]=_0xa30f('0x20');}utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x21'),_0x3413fe[_0xa30f('0x5')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0xb')]));writeDB(queues[_0x3413fe[_0xa30f('0x5')]]);}else if(queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x11')]){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x23'),_0x3413fe[_0xa30f('0x5')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x11')]));queues[queues[_0x3413fe[_0xa30f('0x5')]][_0xa30f('0x11')]]=queues[_0x3413fe[_0xa30f('0x5')]];queues[queues[_0x3413fe['uniqueid']][_0xa30f('0x11')]][_0xa30f('0x24')]=0x2;delete queues[_0x3413fe[_0xa30f('0x5')]];}}}catch(_0x3b6f10){utils[_0xa30f('0x17')](util[_0xa30f('0x3')]('[%s][queues][hangup]',_0x3413fe[_0xa30f('0x5')]),_0x3b6f10);}};exports[_0xa30f('0x25')]=function(_0xf96522){try{utils[_0xa30f('0x13')](util['format'](_0xa30f('0x26'),_0xf96522[_0xa30f('0x5')]),_0xf96522);if(!_['isNil'](_0xf96522[_0xa30f('0x27')][_0xa30f('0x28')])&&_0xf96522[_0xa30f('0x29')][_0xa30f('0x2a')]()!==_0xa30f('0x2b')){if(!_[_0xa30f('0x1a')](queues[_0xf96522['uniqueid']])){queues[_0xf96522[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0xf96522['uniqueid']][_0xa30f('0x2c')]=null;queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x1d')]=!![];queues[_0xf96522[_0xa30f('0x5')]]['queuecallerexitAt']=utils[_0xa30f('0x16')]();queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0xb')]=_0xf96522[_0xa30f('0x29')]['toUpperCase']();utils['info'](util[_0xa30f('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xf96522[_0xa30f('0x5')],queues[_0xf96522['uniqueid']]['name'],_0xf96522[_0xa30f('0x29')],queues[_0xf96522[_0xa30f('0x5')]]['queuecallerexitreason']));writeDB(queues[_0xf96522['uniqueid']]);}}else if(!_[_0xa30f('0x1a')](_0xf96522['variable']['queueposition'])){if(!_[_0xa30f('0x1a')](queues[_0xf96522['uniqueid']])&&!queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x2d')]){queues[_0xf96522['uniqueid']][_0xa30f('0x2d')]=![];queues[_0xf96522[_0xa30f('0x5')]]['queuecallerabandonAt']=null;queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x1d')]=!![];queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x2e')]=utils[_0xa30f('0x16')]();queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0xb')]='EXITWITHKEY';utils[_0xa30f('0x2')](util[_0xa30f('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xf96522['uniqueid'],queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0x22')],_0xf96522[_0xa30f('0x29')],queues[_0xf96522[_0xa30f('0x5')]][_0xa30f('0xb')]));}}}catch(_0x1b6498){utils[_0xa30f('0x17')](util['format'](_0xa30f('0x26'),_0xf96522[_0xa30f('0x5')]),_0x1b6498);}};exports['queuecallerabandon']=function(_0x44adf2){try{if(!_['isNil'](queues[_0x44adf2[_0xa30f('0x5')]])){utils[_0xa30f('0x13')](util['format']('[%s][queues][queuecallerabandon]',_0x44adf2[_0xa30f('0x5')]),_0x44adf2);queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x1d')]=![];queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x2e')]=null;queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x2d')]=!![];queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x2c')]=utils['now']();queues[_0x44adf2['uniqueid']]['queuecallerexitreason']=_0xa30f('0x2f');utils['info'](util['format'](_0xa30f('0x30'),_0x44adf2[_0xa30f('0x5')],queues[_0x44adf2[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x44adf2[_0xa30f('0x5')]]['queuecallerexitreason']));}}catch(_0x505e1d){utils[_0xa30f('0x17')](util['format']('[%s][queues][queuecallerabandon]',_0x44adf2[_0xa30f('0x5')]),_0x505e1d);}};exports['queuecallerleave']=function(_0x3177cb){try{if(!_[_0xa30f('0x1a')](queues[_0x3177cb[_0xa30f('0x5')]])){utils[_0xa30f('0x13')](util[_0xa30f('0x3')](_0xa30f('0x31'),_0x3177cb[_0xa30f('0x5')]),_0x3177cb);utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x32'),_0x3177cb[_0xa30f('0x5')],queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x22')],_0x3177cb[_0xa30f('0x33')],_0x3177cb[_0xa30f('0x34')]));queues[_0x3177cb['uniqueid']][_0xa30f('0x35')]=!![];queues[_0x3177cb[_0xa30f('0x5')]]['queuecallerleaveAt']=utils[_0xa30f('0x16')]();queues[_0x3177cb['uniqueid']]['holdtime']=utils[_0xa30f('0x36')](queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x1c')],queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x37')]);queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x15')]=_0x3177cb[_0xa30f('0x15')];queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x38')]=_0x3177cb[_0xa30f('0x38')];queues[_0x3177cb['uniqueid']]['connectedlinenum']=_0x3177cb['connectedlinenum'];queues[_0x3177cb[_0xa30f('0x5')]][_0xa30f('0x34')]=_0x3177cb['connectedlinename'];}}catch(_0x29e48b){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x31'),_0x3177cb[_0xa30f('0x5')]),_0x29e48b);}};exports[_0xa30f('0x39')]=function(_0x8b86d1){try{if(!_[_0xa30f('0x1a')](queues[_0x8b86d1[_0xa30f('0x5')]])){utils['debug'](util[_0xa30f('0x3')]('[%s][queues][agentconnect]',_0x8b86d1[_0xa30f('0x5')]),_0x8b86d1);utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x3a'),_0x8b86d1[_0xa30f('0x5')],queues[_0x8b86d1['uniqueid']][_0xa30f('0x22')],_0x8b86d1[_0xa30f('0x3b')],_0x8b86d1[_0xa30f('0x3c')]));queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerabandonAt']=null;queues[_0x8b86d1[_0xa30f('0x5')]]['queuecallerexit']=![];queues[_0x8b86d1['uniqueid']][_0xa30f('0xb')]=null;queues[_0x8b86d1[_0xa30f('0x5')]][_0xa30f('0x2e')]=null;queues[_0x8b86d1['uniqueid']][_0xa30f('0x3d')]=!![];queues[_0x8b86d1['uniqueid']][_0xa30f('0xa')]=_0x8b86d1[_0xa30f('0x3c')];queues[_0x8b86d1[_0xa30f('0x5')]][_0xa30f('0x8')]=_0x8b86d1[_0xa30f('0x3b')];}}catch(_0x499041){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x3e'),_0x8b86d1[_0xa30f('0x5')]),_0x499041);}};exports[_0xa30f('0x3f')]=function(_0x1a3417){try{if(!_[_0xa30f('0x1a')](queues[_0x1a3417[_0xa30f('0x5')]])){if(queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x1c')]){utils[_0xa30f('0x13')](util[_0xa30f('0x3')](_0xa30f('0x40'),_0x1a3417[_0xa30f('0x5')]),_0x1a3417);queues[_0x1a3417['uniqueid']][_0xa30f('0x2d')]=![];queues[_0x1a3417[_0xa30f('0x5')]]['queuecallerabandon']=![];queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x2c')]=null;queues[_0x1a3417[_0xa30f('0x5')]]['queuecallerexit']=![];queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x2e')]=null;queues[_0x1a3417['uniqueid']][_0xa30f('0x3d')]=!![];queues[_0x1a3417['uniqueid']][_0xa30f('0x8')]=_0x1a3417[_0xa30f('0x3b')];queues[_0x1a3417[_0xa30f('0x5')]]['queuecallercomplete']=!![];queues[_0x1a3417['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x1a3417['reason']==_0xa30f('0x41')){if(!queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x41')]){queues[_0x1a3417[_0xa30f('0x5')]]['queuecallerexitreason']=_0xa30f('0x42');}}else{queues[_0x1a3417['uniqueid']][_0xa30f('0xb')]=_0xa30f('0x43')+_0x1a3417[_0xa30f('0x44')][_0xa30f('0x2a')]();}utils[_0xa30f('0x2')](util[_0xa30f('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1a3417[_0xa30f('0x5')],queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0x22')],_0x1a3417[_0xa30f('0x3b')],queues[_0x1a3417[_0xa30f('0x5')]][_0xa30f('0xb')]));writeDB(queues[_0x1a3417[_0xa30f('0x5')]]);}}}catch(_0x1ce5d6){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x40'),_0x1a3417[_0xa30f('0x5')]),_0x1ce5d6);}};exports[_0xa30f('0x45')]=function(_0x2577c8){try{if(!_['isNil'](queues[_0x2577c8[_0xa30f('0x46')]])){utils[_0xa30f('0x13')](util['format']('[%s][queues][blindtransfer]',_0x2577c8[_0xa30f('0x5')]),_0x2577c8);queues[_0x2577c8[_0xa30f('0x46')]]['transfer']=!![];queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0x47')]=_0xa30f('0x48');queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0x49')]=_0x2577c8[_0xa30f('0x4a')];queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0x4b')]=_0x2577c8[_0xa30f('0x46')];queues[_0x2577c8[_0xa30f('0x46')]][_0xa30f('0xb')]=_0xa30f('0x4c');utils[_0xa30f('0x2')](util['format'](_0xa30f('0x4d'),_0x2577c8[_0xa30f('0x5')],queues[_0x2577c8['transfereeuniqueid']][_0xa30f('0x22')],_0x2577c8['transfereeuniqueid'],_0x2577c8[_0xa30f('0x4a')]));}}catch(_0x1f611f){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x4e'),_0x2577c8['uniqueid']),_0x1f611f);}};exports[_0xa30f('0x4f')]=function(_0x53b382){try{utils[_0xa30f('0x13')](util['format'](_0xa30f('0x50'),_0x53b382['origtransfereruniqueid']),_0x53b382);if(_0x53b382[_0xa30f('0x51')]==_0x53b382[_0xa30f('0x52')]){if(!_[_0xa30f('0x1a')](queues[_0x53b382[_0xa30f('0x53')]])){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x54'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x22')],_0x53b382['origtransfererexten']));queues[_0x53b382['secondtransfererlinkedid']]['transfer']=!![];queues[_0x53b382['secondtransfererlinkedid']][_0xa30f('0x47')]=_0xa30f('0x55');queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x49')]=_0x53b382[_0xa30f('0x56')];queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x4b')]=_0x53b382[_0xa30f('0x51')];queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0xb')]=_0xa30f('0x57');}if(!_[_0xa30f('0x1a')](queues[_0x53b382[_0xa30f('0x52')]])){if(_0x53b382[_0xa30f('0x58')]&&queues[_0x53b382[_0xa30f('0x58')]]){queues[_0x53b382['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x53b382[_0xa30f('0x46')]]=_[_0xa30f('0x59')](queues[_0x53b382[_0xa30f('0x58')]]);queues[_0x53b382[_0xa30f('0x46')]]['transfereduniqueid']=_0x53b382[_0xa30f('0x5a')];queues[_0x53b382[_0xa30f('0x46')]]['queuecallerenterreason']=0x2;queues[_0x53b382[_0xa30f('0x46')]]['calleridnum']=queues[_0x53b382[_0xa30f('0x53')]]['calleridnum'];queues[_0x53b382[_0xa30f('0x46')]]['calleridname']=queues[_0x53b382['secondtransfererlinkedid']][_0xa30f('0x5b')];queues[_0x53b382['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0xa30f('0x16')]();queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x1c')]=utils[_0xa30f('0x16')]();queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x5c')]=0x0;queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x5d')]=0x0;utils['info'](util[_0xa30f('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x22')],queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x9')],queues[_0x53b382[_0xa30f('0x46')]][_0xa30f('0x5b')]));}else{utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x5e'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x22')],_0x53b382['secondtransfererlinkedid']));queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x11')]=_0x53b382[_0xa30f('0x53')];}}}else if(_0x53b382[_0xa30f('0x5f')]==_0x53b382[_0xa30f('0x53')]){if(!_[_0xa30f('0x1a')](queues[_0x53b382['origtransfererlinkedid']])){utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x60'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x22')],_0x53b382[_0xa30f('0x5f')],_0x53b382[_0xa30f('0x61')]));queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x41')]=!![];queues[_0x53b382[_0xa30f('0x52')]][_0xa30f('0x47')]=_0xa30f('0x55');queues[_0x53b382[_0xa30f('0x52')]]['transferexten']=_0x53b382[_0xa30f('0x61')];queues[_0x53b382['origtransfererlinkedid']][_0xa30f('0x4b')]=_0x53b382['secondtransfereruniqueid'];queues[_0x53b382[_0xa30f('0x52')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x53b382[_0xa30f('0x53')]])){if(_0x53b382['transfertargetlinkedid']&&queues[_0x53b382['transfertargetlinkedid']]){queues[_0x53b382[_0xa30f('0x62')]][_0xa30f('0x24')]=0x1;queues[_0x53b382['transfertargetuniqueid']]=_[_0xa30f('0x59')](queues[_0x53b382['transfertargetlinkedid']]);queues[_0x53b382[_0xa30f('0x5a')]]['transfereduniqueid']=_0x53b382['transfertargetuniqueid'];queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x24')]=0x2;queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x9')]=queues[_0x53b382['origtransfererlinkedid']][_0xa30f('0x9')];queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x5b')]=queues[_0x53b382[_0xa30f('0x52')]]['calleridname'];queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x37')]=utils[_0xa30f('0x16')]();queues[_0x53b382['transfertargetuniqueid']][_0xa30f('0x1c')]=utils[_0xa30f('0x16')]();queues[_0x53b382[_0xa30f('0x5a')]]['holdtime']=0x0;queues[_0x53b382['transfertargetuniqueid']][_0xa30f('0x5d')]=0x0;utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x63'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382['transfertargetuniqueid']][_0xa30f('0x22')],queues[_0x53b382[_0xa30f('0x5a')]][_0xa30f('0x11')],queues[_0x53b382[_0xa30f('0x5a')]]['calleridnum'],queues[_0x53b382[_0xa30f('0x5a')]]['calleridname']));}else{utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x5e'),_0x53b382[_0xa30f('0x51')],queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x22')],_0x53b382[_0xa30f('0x52')]));queues[_0x53b382[_0xa30f('0x53')]][_0xa30f('0x11')]=_0x53b382[_0xa30f('0x52')];}}}}catch(_0x23908a){utils['error'](util[_0xa30f('0x3')](_0xa30f('0x50'),_0x53b382[_0xa30f('0x51')]),_0x23908a);}};exports[_0xa30f('0x64')]=function(_0x3fbff4){try{if(!_[_0xa30f('0x1a')](queues[_0x3fbff4[_0xa30f('0x5')]])){utils['debug'](util[_0xa30f('0x3')](_0xa30f('0x65'),_0x3fbff4[_0xa30f('0x5')]),_0x3fbff4);queues[_0x3fbff4[_0xa30f('0x5')]][_0xa30f('0x66')]=utils[_0xa30f('0x16')]();utils[_0xa30f('0x2')](util[_0xa30f('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3fbff4['uniqueid'],queues[_0x3fbff4[_0xa30f('0x5')]][_0xa30f('0x22')],queues[_0x3fbff4[_0xa30f('0x5')]][_0xa30f('0x66')]));}}catch(_0x3e6723){utils[_0xa30f('0x17')](util[_0xa30f('0x3')]('[%s][queues][musiconholdstart]',_0x3fbff4[_0xa30f('0x5')]),_0x3e6723);}};exports['musiconholdstop']=function(_0x4d2181){try{if(!_['isNil'](queues[_0x4d2181['uniqueid']])){if(!_['isNil'](queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x66')])){utils['debug'](util[_0xa30f('0x3')](_0xa30f('0x67'),_0x4d2181[_0xa30f('0x5')]),_0x4d2181);queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x5d')]+=utils[_0xa30f('0x36')](utils[_0xa30f('0x16')](),queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x66')]);utils[_0xa30f('0x2')](util[_0xa30f('0x3')](_0xa30f('0x68'),_0x4d2181[_0xa30f('0x5')],queues[_0x4d2181['uniqueid']][_0xa30f('0x22')],queues[_0x4d2181[_0xa30f('0x5')]][_0xa30f('0x5d')]));delete queues[_0x4d2181[_0xa30f('0x5')]]['musiconholdstartAt'];}}}catch(_0x5e0f8a){utils[_0xa30f('0x17')](util[_0xa30f('0x3')](_0xa30f('0x67'),_0x4d2181['uniqueid']),_0x5e0f8a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index da72589..7a6c4af 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 _0xa7a9=['linkedid','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','outbound','connectedlinenum','forEach','[%s][recordings][newexten]','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa7a9,0x1df));var _0x9a7a=function(_0x2f9bd4,_0x1bd5fb){_0x2f9bd4=_0x2f9bd4-0x0;var _0x533ea2=_0xa7a9[_0x2f9bd4];return _0x533ea2;};'use strict';var _=require(_0x9a7a('0x0'));var util=require(_0x9a7a('0x1'));var utils=require(_0x9a7a('0x2'));var recordings={};function writeDB(_0x3a4971){utils[_0x9a7a('0x3')](util[_0x9a7a('0x4')](_0x9a7a('0x5'),_0x3a4971[_0x9a7a('0x6')]));if(_0x3a4971[_0x9a7a('0x7')]){utils['getUserByInternal'](_0x3a4971['accountcode'])[_0x9a7a('0x8')](function(_0x343121){if(_0x343121){_0x3a4971[_0x9a7a('0x9')]=_0x343121['name'];_0x3a4971[_0x9a7a('0xa')]=_0x343121['id'];}utils[_0x9a7a('0xb')](_0x9a7a('0xc'),_0x3a4971);});}else{utils['request']('CreateVoiceRecording',_0x3a4971);}}exports[_0x9a7a('0xd')]=function(_0x3ab00b){try{utils[_0x9a7a('0xe')](util[_0x9a7a('0x4')](_0x9a7a('0xf'),_0x3ab00b['uniqueid']),_0x3ab00b);if(_0x3ab00b[_0x9a7a('0x6')]==_0x3ab00b[_0x9a7a('0x10')]){utils['info'](util[_0x9a7a('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3ab00b['uniqueid'],_0x3ab00b[_0x9a7a('0x11')],_0x3ab00b['exten']));recordings[_0x3ab00b['uniqueid']]={'uniqueid':_0x3ab00b[_0x9a7a('0x6')],'accountcode':_0x3ab00b[_0x9a7a('0x7')],'exten':_0x3ab00b['exten'],'context':_0x3ab00b[_0x9a7a('0x11')],'channel':_0x3ab00b[_0x9a7a('0x12')],'monitors':[]};}}catch(_0x181900){utils[_0x9a7a('0x13')](util[_0x9a7a('0x4')]('[%s][recordings][newchannel]',_0x3ab00b[_0x9a7a('0x6')]),_0x181900);}};exports[_0x9a7a('0x14')]=function(_0x59ff9f){try{utils['debug'](util[_0x9a7a('0x4')](_0x9a7a('0x15'),_0x59ff9f[_0x9a7a('0x6')]),_0x59ff9f);if(!_[_0x9a7a('0x16')](recordings[_0x59ff9f[_0x9a7a('0x6')]])&&_0x59ff9f[_0x9a7a('0x17')]==0x6){utils[_0x9a7a('0x3')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x59ff9f['uniqueid'],_0x59ff9f[_0x9a7a('0x11')],_0x59ff9f['channel']));}else if(!_[_0x9a7a('0x16')](recordings[_0x59ff9f[_0x9a7a('0x10')]])&&_0x59ff9f[_0x9a7a('0x17')]==0x6&&_0x59ff9f[_0x9a7a('0x11')]!=_0x9a7a('0x18')){utils[_0x9a7a('0x3')](util[_0x9a7a('0x4')](_0x9a7a('0x19'),_0x59ff9f['uniqueid'],_0x59ff9f[_0x9a7a('0x10')],_0x59ff9f[_0x9a7a('0x11')],_0x59ff9f[_0x9a7a('0x12')]));recordings[_0x59ff9f[_0x9a7a('0x10')]][_0x9a7a('0x7')]=_0x59ff9f['accountcode'];}}catch(_0x3b40cc){utils[_0x9a7a('0x13')](util[_0x9a7a('0x4')](_0x9a7a('0x15'),_0x59ff9f[_0x9a7a('0x6')]),_0x3b40cc);}};exports[_0x9a7a('0x1a')]=function(_0x12acd9){try{if(!_[_0x9a7a('0x16')](_0x12acd9[_0x9a7a('0x1b')])&&!_[_0x9a7a('0x16')](_0x12acd9[_0x9a7a('0x1b')][_0x9a7a('0x1c')])){utils[_0x9a7a('0xe')](util[_0x9a7a('0x4')](_0x9a7a('0x1d'),_0x12acd9[_0x9a7a('0x6')]),_0x12acd9);utils['info'](util[_0x9a7a('0x4')](_0x9a7a('0x1e'),_0x12acd9[_0x9a7a('0x6')],_0x12acd9[_0x9a7a('0x1b')],_0x12acd9[_0x9a7a('0x1f')]));if(_[_0x9a7a('0x20')](_0x12acd9['value'],_0x9a7a('0x21'))){_0x12acd9[_0x9a7a('0x1f')]=_0x12acd9['value']['replace']('.wav49',_0x9a7a('0x22'));}if(recordings[_0x12acd9[_0x9a7a('0x10')]]){var _0x154616=_['find'](recordings[_0x12acd9[_0x9a7a('0x10')]][_0x9a7a('0x23')],{'value':_0x12acd9[_0x9a7a('0x1f')]});if(_['isNil'](_0x154616)){recordings[_0x12acd9[_0x9a7a('0x10')]][_0x9a7a('0x23')]['push']({'value':_0x12acd9[_0x9a7a('0x1f')]});}}}}catch(_0x21d0b5){utils[_0x9a7a('0x13')](util['format'](_0x9a7a('0x1d'),_0x12acd9[_0x9a7a('0x6')]),_0x21d0b5);}};exports[_0x9a7a('0x24')]=function(_0x4379b4){try{if(!_['isNil'](recordings[_0x4379b4[_0x9a7a('0x6')]])){utils[_0x9a7a('0xe')](util[_0x9a7a('0x4')](_0x9a7a('0x25'),_0x4379b4[_0x9a7a('0x6')]),_0x4379b4);utils['info'](util[_0x9a7a('0x4')](_0x9a7a('0x26'),_0x4379b4[_0x9a7a('0x6')],_0x4379b4[_0x9a7a('0x27')],_0x4379b4[_0x9a7a('0x28')],_0x4379b4[_0x9a7a('0x29')]));recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x27')]=_0x4379b4['calleridnum'];recordings[_0x4379b4['uniqueid']][_0x9a7a('0x28')]=_0x4379b4[_0x9a7a('0x28')];recordings[_0x4379b4[_0x9a7a('0x6')]]['connectedlinenum']=_0x4379b4['connectedlinenum'];recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x2a')]=_0x4379b4['connectedlinename'];if(recordings[_0x4379b4[_0x9a7a('0x6')]]['type']==_0x9a7a('0x2b')&&recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x7')]){recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x2c')]=recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x7')];recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x2a')]='';}recordings[_0x4379b4[_0x9a7a('0x6')]][_0x9a7a('0x23')][_0x9a7a('0x2d')](function(_0x34ccf7){var _0x269fc4=_['clone'](recordings[_0x4379b4[_0x9a7a('0x6')]]);_0x269fc4[_0x9a7a('0x1f')]=_0x34ccf7['value'];writeDB(_0x269fc4);});delete recordings[_0x4379b4[_0x9a7a('0x6')]];}}catch(_0x1defaf){utils['error'](util[_0x9a7a('0x4')]('[%s][recordings][hangup]',_0x4379b4[_0x9a7a('0x6')]),_0x1defaf);}};exports['newexten']=function(_0x39f877){try{if(!_[_0x9a7a('0x16')](recordings[_0x39f877[_0x9a7a('0x6')]])){utils[_0x9a7a('0xe')](util['format'](_0x9a7a('0x2e'),_0x39f877[_0x9a7a('0x6')]),_0x39f877);utils[_0x9a7a('0x3')](util[_0x9a7a('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x39f877[_0x9a7a('0x6')],_0x39f877['application'],_0x39f877[_0x9a7a('0x2f')]));if(_0x39f877['application']['toLowerCase']()=='set'&&_['startsWith'](_0x39f877[_0x9a7a('0x2f')]['toLowerCase'](),_0x9a7a('0x30'))){var _0xc93bb5=_0x39f877[_0x9a7a('0x2f')][_0x9a7a('0x31')]('=');var _0x38f781=_0xc93bb5[0x0][_0x9a7a('0x32')](_0xc93bb5[0x0]['lastIndexOf']('(')+0x1,_0xc93bb5[0x0][_0x9a7a('0x33')](')'));var _0x157897=_0xc93bb5[0x1];recordings[_0x39f877[_0x9a7a('0x6')]][_0x38f781]=_0x157897;}}}catch(_0x4b3143){utils['error'](util[_0x9a7a('0x4')](_0x9a7a('0x2e'),_0x39f877['uniqueid']),_0x4b3143);}};exports[_0x9a7a('0x34')]=function(_0x46f4f4){try{if(!_['isNil'](recordings[_0x46f4f4[_0x9a7a('0x6')]])){utils[_0x9a7a('0xe')](util['format']('[%s][recordings][queuecallerjoin]',_0x46f4f4[_0x9a7a('0x6')]),_0x46f4f4);utils[_0x9a7a('0x3')](util[_0x9a7a('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x46f4f4[_0x9a7a('0x6')],_0x46f4f4[_0x9a7a('0x35')]));recordings[_0x46f4f4[_0x9a7a('0x6')]][_0x9a7a('0x35')]=_0x46f4f4['queue'];}}catch(_0x2ecb47){utils[_0x9a7a('0x13')](util['format'](_0x9a7a('0x36'),_0x46f4f4[_0x9a7a('0x6')]),_0x2ecb47);}}; \ No newline at end of file +var _0x3797=['transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','accountcode','then','name','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate'];(function(_0x6f45dc,_0x379e7e){var _0x6d01d7=function(_0x59597a){while(--_0x59597a){_0x6f45dc['push'](_0x6f45dc['shift']());}};_0x6d01d7(++_0x379e7e);}(_0x3797,0x1df));var _0x7379=function(_0x485584,_0x588a02){_0x485584=_0x485584-0x0;var _0x20c9f5=_0x3797[_0x485584];return _0x20c9f5;};'use strict';var _=require(_0x7379('0x0'));var util=require(_0x7379('0x1'));var utils=require(_0x7379('0x2'));var recordings={};function writeDB(_0x2995ea){utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x5'),_0x2995ea['uniqueid']));if(_0x2995ea[_0x7379('0x6')]){utils['getUserByInternal'](_0x2995ea[_0x7379('0x6')])[_0x7379('0x7')](function(_0x3f602f){if(_0x3f602f){_0x2995ea['membername']=_0x3f602f[_0x7379('0x8')];_0x2995ea[_0x7379('0x9')]=_0x3f602f['id'];}utils['request'](_0x7379('0xa'),_0x2995ea);});}else{utils['request']('CreateVoiceRecording',_0x2995ea);}}exports[_0x7379('0xb')]=function(_0x325e43){try{utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0xd'),_0x325e43[_0x7379('0xe')]),_0x325e43);if(_0x325e43[_0x7379('0xe')]==_0x325e43[_0x7379('0xf')]){utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x10'),_0x325e43[_0x7379('0xe')],_0x325e43[_0x7379('0x11')],_0x325e43[_0x7379('0x12')]));recordings[_0x325e43['uniqueid']]={'uniqueid':_0x325e43[_0x7379('0xe')],'accountcode':_0x325e43[_0x7379('0x6')],'exten':_0x325e43[_0x7379('0x12')],'context':_0x325e43['context'],'channel':_0x325e43[_0x7379('0x13')],'monitors':[]};}}catch(_0x39493e){utils[_0x7379('0x14')](util[_0x7379('0x4')](_0x7379('0xd'),_0x325e43['uniqueid']),_0x39493e);}};exports['newstate']=function(_0x364dd8){try{utils[_0x7379('0xc')](util['format'](_0x7379('0x15'),_0x364dd8[_0x7379('0xe')]),_0x364dd8);if(!_[_0x7379('0x16')](recordings[_0x364dd8['uniqueid']])&&_0x364dd8['channelstate']==0x6){utils[_0x7379('0x3')](util['format'](_0x7379('0x17'),_0x364dd8['uniqueid'],_0x364dd8[_0x7379('0x11')],_0x364dd8[_0x7379('0x13')]));}else if(!_[_0x7379('0x16')](recordings[_0x364dd8[_0x7379('0xf')]])&&_0x364dd8[_0x7379('0x18')]==0x6&&_0x364dd8['context']!=_0x7379('0x19')){utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x1a'),_0x364dd8[_0x7379('0xe')],_0x364dd8[_0x7379('0xf')],_0x364dd8[_0x7379('0x11')],_0x364dd8[_0x7379('0x13')]));recordings[_0x364dd8[_0x7379('0xf')]][_0x7379('0x6')]=_0x364dd8['accountcode'];}}catch(_0x5b828a){utils[_0x7379('0x14')](util[_0x7379('0x4')](_0x7379('0x15'),_0x364dd8[_0x7379('0xe')]),_0x5b828a);}};exports[_0x7379('0x1b')]=function(_0x23866c){try{if(!_[_0x7379('0x16')](_0x23866c[_0x7379('0x1c')])&&!_['isNil'](_0x23866c[_0x7379('0x1c')][_0x7379('0x1d')])){utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0x1e'),_0x23866c[_0x7379('0xe')]),_0x23866c);utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x1f'),_0x23866c['uniqueid'],_0x23866c[_0x7379('0x1c')],_0x23866c['value']));if(_[_0x7379('0x20')](_0x23866c[_0x7379('0x21')],'.wav49')){_0x23866c[_0x7379('0x21')]=_0x23866c[_0x7379('0x21')][_0x7379('0x22')](_0x7379('0x23'),_0x7379('0x24'));}if(recordings[_0x23866c[_0x7379('0xf')]]){var _0x53c0e6=_[_0x7379('0x25')](recordings[_0x23866c[_0x7379('0xf')]][_0x7379('0x26')],{'value':_0x23866c[_0x7379('0x21')]});if(_[_0x7379('0x16')](_0x53c0e6)){recordings[_0x23866c['linkedid']][_0x7379('0x26')][_0x7379('0x27')]({'value':_0x23866c[_0x7379('0x21')]});}}}}catch(_0x5bb45a){utils[_0x7379('0x14')](util['format'](_0x7379('0x1e'),_0x23866c['uniqueid']),_0x5bb45a);}};exports[_0x7379('0x28')]=function(_0x5085be){try{if(!_[_0x7379('0x16')](recordings[_0x5085be[_0x7379('0xe')]])){utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0x29'),_0x5085be[_0x7379('0xe')]),_0x5085be);utils[_0x7379('0x3')](util[_0x7379('0x4')](_0x7379('0x2a'),_0x5085be[_0x7379('0xe')],_0x5085be[_0x7379('0x2b')],_0x5085be[_0x7379('0x2c')],_0x5085be['cause-txt']));recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2b')]=_0x5085be[_0x7379('0x2b')];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2c')]=_0x5085be['calleridname'];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2d')]=_0x5085be[_0x7379('0x2d')];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2e')]=_0x5085be[_0x7379('0x2e')];if(recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2f')]=='outbound'&&recordings[_0x5085be[_0x7379('0xe')]]['accountcode']){recordings[_0x5085be['uniqueid']]['connectedlinenum']=recordings[_0x5085be[_0x7379('0xe')]]['accountcode'];recordings[_0x5085be[_0x7379('0xe')]][_0x7379('0x2e')]='';}recordings[_0x5085be['uniqueid']][_0x7379('0x26')][_0x7379('0x30')](function(_0x4ac468){var _0x25a83d=_[_0x7379('0x31')](recordings[_0x5085be[_0x7379('0xe')]]);_0x25a83d['value']=_0x4ac468[_0x7379('0x21')];writeDB(_0x25a83d);});delete recordings[_0x5085be['uniqueid']];}}catch(_0x555120){utils[_0x7379('0x14')](util[_0x7379('0x4')]('[%s][recordings][hangup]',_0x5085be[_0x7379('0xe')]),_0x555120);}};exports[_0x7379('0x32')]=function(_0x269544){try{if(!_[_0x7379('0x16')](recordings[_0x269544[_0x7379('0xe')]])){utils[_0x7379('0xc')](util[_0x7379('0x4')](_0x7379('0x33'),_0x269544[_0x7379('0xe')]),_0x269544);utils['info'](util[_0x7379('0x4')](_0x7379('0x34'),_0x269544[_0x7379('0xe')],_0x269544['application'],_0x269544['appdata']));if(_0x269544[_0x7379('0x35')][_0x7379('0x36')]()=='set'&&_[_0x7379('0x37')](_0x269544[_0x7379('0x38')][_0x7379('0x36')](),_0x7379('0x39'))){var _0x40f4bc=_0x269544['appdata'][_0x7379('0x3a')]('=');var _0x455eb9=_0x40f4bc[0x0]['substring'](_0x40f4bc[0x0][_0x7379('0x3b')]('(')+0x1,_0x40f4bc[0x0]['lastIndexOf'](')'));var _0x4f1eaf=_0x40f4bc[0x1];recordings[_0x269544['uniqueid']][_0x455eb9]=_0x4f1eaf;}}}catch(_0x405036){utils[_0x7379('0x14')](util['format'](_0x7379('0x33'),_0x269544[_0x7379('0xe')]),_0x405036);}};exports['queuecallerjoin']=function(_0x49058a){try{if(!_[_0x7379('0x16')](recordings[_0x49058a[_0x7379('0xe')]])){utils['debug'](util['format'](_0x7379('0x3c'),_0x49058a['uniqueid']),_0x49058a);utils[_0x7379('0x3')](util['format'](_0x7379('0x3d'),_0x49058a[_0x7379('0xe')],_0x49058a['queue']));recordings[_0x49058a['uniqueid']]['queue']=_0x49058a[_0x7379('0x3e')];}}catch(_0x360fb4){utils['error'](util[_0x7379('0x4')](_0x7379('0x3c'),_0x49058a['uniqueid']),_0x360fb4);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 9fab515..a63b369 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 _0x2e73=['uniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid'];(function(_0xdab40b,_0x353ba3){var _0x22e57a=function(_0x5ab55b){while(--_0x5ab55b){_0xdab40b['push'](_0xdab40b['shift']());}};_0x22e57a(++_0x353ba3);}(_0x2e73,0xae));var _0x32e7=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x2e73[_0x270a54];return _0x4d07d0;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');function writeDB(_0x25cc19){utils[_0x32e7('0x0')](util[_0x32e7('0x1')](_0x32e7('0x2'),_0x25cc19[_0x32e7('0x3')]===_0x32e7('0x4')?_0x25cc19[_0x32e7('0x5')]:_0x25cc19[_0x32e7('0x6')],_0x25cc19[_0x32e7('0x3')]));utils['request'](_0x32e7('0x7'),_0x25cc19);}exports[_0x32e7('0x8')]=function(_0x50cfcd){try{utils[_0x32e7('0x9')](util[_0x32e7('0x1')](_0x32e7('0xa'),_0x50cfcd[_0x32e7('0x6')]),_0x50cfcd);utils[_0x32e7('0x0')](util[_0x32e7('0x1')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x50cfcd[_0x32e7('0x6')],_0x50cfcd['transferercalleridnum'],_0x50cfcd[_0x32e7('0xb')],_0x50cfcd[_0x32e7('0xc')],_0x50cfcd[_0x32e7('0xd')]));_0x50cfcd['type']=_0x32e7('0xe');writeDB(_0x50cfcd);}catch(_0x5e2cee){utils[_0x32e7('0xf')](util[_0x32e7('0x1')](_0x32e7('0xa'),_0x50cfcd[_0x32e7('0x6')]),_0x5e2cee);}};exports[_0x32e7('0x10')]=function(_0x309dbc){try{utils['debug'](util[_0x32e7('0x1')](_0x32e7('0x11'),_0x309dbc[_0x32e7('0x5')]),_0x309dbc);utils[_0x32e7('0x0')](util[_0x32e7('0x1')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x309dbc[_0x32e7('0x5')],_0x309dbc[_0x32e7('0x12')],_0x309dbc[_0x32e7('0x13')],_0x309dbc[_0x32e7('0x14')],_0x309dbc[_0x32e7('0x15')]));_0x309dbc=_[_0x32e7('0x16')](_0x309dbc,{'transfererchannel':_0x309dbc[_0x32e7('0x17')],'transferercalleridnum':_0x309dbc[_0x32e7('0x12')],'transferercalleridname':_0x309dbc[_0x32e7('0x13')],'transfererconnectedlinenum':_0x309dbc['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x309dbc[_0x32e7('0x18')],'transfereraccountcode':_0x309dbc[_0x32e7('0x19')],'transferercontext':_0x309dbc[_0x32e7('0x1a')],'transfererexten':_0x309dbc['secondtransfererexten'],'transfererlinkedid':_0x309dbc['origtransfererlinkedid'],'context':_0x309dbc[_0x32e7('0x1b')],'extension':_0x309dbc[_0x32e7('0x1c')],'type':'attended'});if(_['isNil'](_0x309dbc[_0x32e7('0x1d')])){_0x309dbc=_[_0x32e7('0x16')](_0x309dbc,{'transfereechannel':_0x309dbc[_0x32e7('0x1e')],'transfereecalleridnum':_0x309dbc['transfertargetcalleridnum'],'transfereecalleridname':_0x309dbc[_0x32e7('0x15')],'transfereeconnectedlinenum':_0x309dbc[_0x32e7('0x1f')],'transfereeconnectedlinename':_0x309dbc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x309dbc[_0x32e7('0x20')],'transfereecontext':_0x309dbc[_0x32e7('0x21')],'transfereeexten':_0x309dbc[_0x32e7('0x22')],'transfereelinkedid':_0x309dbc[_0x32e7('0x23')]});}writeDB(_0x309dbc);}catch(_0xbf03c9){utils[_0x32e7('0xf')](util['format'](_0x32e7('0x11'),_0x309dbc[_0x32e7('0x5')]),_0xbf03c9);}}; \ No newline at end of file +var _0x8be4=['transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8be4,0xc2));var _0x48be=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x8be4[_0x55ff79];return _0x579067;};'use strict';var _=require(_0x48be('0x0'));var util=require(_0x48be('0x1'));var utils=require(_0x48be('0x2'));function writeDB(_0x382410){utils[_0x48be('0x3')](util['format'](_0x48be('0x4'),_0x382410['type']===_0x48be('0x5')?_0x382410[_0x48be('0x6')]:_0x382410[_0x48be('0x7')],_0x382410[_0x48be('0x8')]));utils[_0x48be('0x9')](_0x48be('0xa'),_0x382410);}exports[_0x48be('0xb')]=function(_0x478943){try{utils[_0x48be('0xc')](util[_0x48be('0xd')](_0x48be('0xe'),_0x478943[_0x48be('0x7')]),_0x478943);utils[_0x48be('0x3')](util['format'](_0x48be('0xf'),_0x478943[_0x48be('0x7')],_0x478943['transferercalleridnum'],_0x478943[_0x48be('0x10')],_0x478943[_0x48be('0x11')],_0x478943[_0x48be('0x12')]));_0x478943[_0x48be('0x8')]=_0x48be('0x13');writeDB(_0x478943);}catch(_0x4406d7){utils[_0x48be('0x14')](util[_0x48be('0xd')](_0x48be('0xe'),_0x478943[_0x48be('0x7')]),_0x4406d7);}};exports[_0x48be('0x15')]=function(_0x451a05){try{utils['debug'](util[_0x48be('0xd')](_0x48be('0x16'),_0x451a05['origtransfereruniqueid']),_0x451a05);utils[_0x48be('0x3')](util[_0x48be('0xd')](_0x48be('0x17'),_0x451a05[_0x48be('0x6')],_0x451a05[_0x48be('0x18')],_0x451a05[_0x48be('0x19')],_0x451a05[_0x48be('0x1a')],_0x451a05[_0x48be('0x1b')]));_0x451a05=_[_0x48be('0x1c')](_0x451a05,{'transfererchannel':_0x451a05[_0x48be('0x1d')],'transferercalleridnum':_0x451a05[_0x48be('0x18')],'transferercalleridname':_0x451a05['origtransferercalleridname'],'transfererconnectedlinenum':_0x451a05[_0x48be('0x1e')],'transfererconnectedlinename':_0x451a05[_0x48be('0x1f')],'transfereraccountcode':_0x451a05[_0x48be('0x20')],'transferercontext':_0x451a05[_0x48be('0x21')],'transfererexten':_0x451a05[_0x48be('0x22')],'transfererlinkedid':_0x451a05['origtransfererlinkedid'],'context':_0x451a05[_0x48be('0x23')],'extension':_0x451a05[_0x48be('0x24')],'type':_0x48be('0x5')});if(_[_0x48be('0x25')](_0x451a05[_0x48be('0x26')])){_0x451a05=_['assign'](_0x451a05,{'transfereechannel':_0x451a05[_0x48be('0x27')],'transfereecalleridnum':_0x451a05[_0x48be('0x1a')],'transfereecalleridname':_0x451a05['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x451a05[_0x48be('0x28')],'transfereeconnectedlinename':_0x451a05[_0x48be('0x29')],'transfereeaccountcode':_0x451a05[_0x48be('0x2a')],'transfereecontext':_0x451a05['transfertargetcontext'],'transfereeexten':_0x451a05[_0x48be('0x2b')],'transfereelinkedid':_0x451a05['transfertargetlinkedid']});}writeDB(_0x451a05);}catch(_0x323e05){utils['error'](util['format'](_0x48be('0x16'),_0x451a05[_0x48be('0x6')]),_0x323e05);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 6f6aa35..f270734 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 _0x9d5b=['inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','then','[utils][getUser]\x20where:%s','stringify','result','[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','getVoiceQueueByName','GetVoiceQueue','name','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diffTime','diff','isBefore','jayson/promise','moment','util','client','http','xdr','info'];(function(_0x3e0b86,_0x338bfa){var _0x2e4a7b=function(_0x291c21){while(--_0x291c21){_0x3e0b86['push'](_0x3e0b86['shift']());}};_0x2e4a7b(++_0x338bfa);}(_0x9d5b,0x12d));var _0xb9d5=function(_0x565358,_0x295e18){_0x565358=_0x565358-0x0;var _0x165992=_0x9d5b[_0x565358];return _0x165992;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb9d5('0x0'));var moment=require(_0xb9d5('0x1'));var util=require(_0xb9d5('0x2'));var client=jayson[_0xb9d5('0x3')][_0xb9d5('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xb9d5('0x5'));exports[_0xb9d5('0x6')]=function(_0x23fda1,_0x57a363){logger[_0xb9d5('0x6')](_0x23fda1,_0x57a363?util[_0xb9d5('0x7')](_0x57a363,{'showHidden':![],'depth':null}):'');};exports[_0xb9d5('0x8')]=function(_0x19aa3f,_0x3b4630){logger['debug'](_0x19aa3f,_0x3b4630?util[_0xb9d5('0x7')](_0x3b4630,{'showHidden':![],'depth':null}):'');};exports[_0xb9d5('0x9')]=function(_0x2ed8e5,_0x3a6c02){logger['error'](_0x2ed8e5,_0x3a6c02?util['inspect'](_0x3a6c02,{'showHidden':![],'depth':null}):'');};exports[_0xb9d5('0xa')]=function(_0x528602,_0x5908cf){return client['request'](_0x528602,{'body':_0x5908cf})['then'](function(_0x492eec){logger[_0xb9d5('0x8')](_0xb9d5('0xb'),_0x528602,_0x492eec?util['inspect'](_0x492eec,{'showHidden':![],'depth':null}):'');})[_0xb9d5('0xc')](function(_0x1fc87e){logger['error'](_0xb9d5('0xb'),_0x528602,_0x1fc87e?util[_0xb9d5('0x7')](_0x1fc87e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x27dd93){return client[_0xb9d5('0xa')](_0xb9d5('0xd'),{'options':{'raw':!![],'attributes':['id','internal','name','interface'],'where':_0x27dd93,'limit':0x1}})[_0xb9d5('0xe')](function(_0x4edb34){logger[_0xb9d5('0x8')](_0xb9d5('0xf'),JSON[_0xb9d5('0x10')](_0x27dd93),_0x4edb34?util[_0xb9d5('0x7')](_0x4edb34,{'showHidden':![],'depth':null}):'');return _0x4edb34[_0xb9d5('0x11')]['length']?_0x4edb34[_0xb9d5('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x1fb8af){return new BPromise(function(_0x16e0a5,_0x1272ce){if(_0x1fb8af){return getUser({'internal':_0x1fb8af})['then'](function(_0x45290b){logger[_0xb9d5('0x6')](_0xb9d5('0x12'),_0x1fb8af,_0x45290b?_0xb9d5('0x13'):_0xb9d5('0x14'));return _0x16e0a5(_0x45290b);})[_0xb9d5('0xc')](function(_0x20342c){logger['error'](_0xb9d5('0x15'),_0x20342c?util[_0xb9d5('0x7')](_0x20342c,{'showHidden':![],'depth':null}):'');return _0x16e0a5(null);});}return _0x16e0a5(null);});};exports[_0xb9d5('0x16')]=function(_0x51e5c7){return new BPromise(function(_0x21373c,_0x490fd0){if(_0x51e5c7){return getUser({'interface':_0x51e5c7})['then'](function(_0x551c79){logger[_0xb9d5('0x6')](_0xb9d5('0x17'),_0x51e5c7,_0x551c79?'found':_0xb9d5('0x14'));return _0x21373c(_0x551c79);})['catch'](function(_0x1a31c8){logger[_0xb9d5('0x9')](_0xb9d5('0x18'),_0x1a31c8?util[_0xb9d5('0x7')](_0x1a31c8,{'showHidden':![],'depth':null}):'');return _0x21373c(null);});}return _0x21373c(null);});};exports[_0xb9d5('0x19')]=function(_0x11e7b9){return new BPromise(function(_0x4ce1f8,_0x537a60){if(_0x11e7b9){return getUser({'name':_0x11e7b9})[_0xb9d5('0xe')](function(_0x371ef2){logger[_0xb9d5('0x6')](_0xb9d5('0x1a'),_0x11e7b9,_0x371ef2?_0xb9d5('0x13'):_0xb9d5('0x14'));return _0x4ce1f8(_0x371ef2);})[_0xb9d5('0xc')](function(_0x146010){logger['error']('[utils][getUserByName]',_0x146010?util['inspect'](_0x146010,{'showHidden':![],'depth':null}):'');return _0x4ce1f8(null);});}return _0x4ce1f8(null);});};exports[_0xb9d5('0x1b')]=function(_0x483c0a){return new BPromise(function(_0x5b5e4d,_0x33f181){if(_0x483c0a){return client[_0xb9d5('0xa')](_0xb9d5('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xb9d5('0x1d'),'type',_0xb9d5('0x1e'),'acwTimeout'],'where':{'name':_0x483c0a},'limit':0x1}})[_0xb9d5('0xe')](function(_0x406daa){logger['debug'](_0xb9d5('0x1f'),_0x483c0a,_0x406daa?util[_0xb9d5('0x7')](_0x406daa,{'showHidden':![],'depth':null}):'');logger['info'](_0xb9d5('0x20'),_0x483c0a,_0x406daa?_0xb9d5('0x13'):_0xb9d5('0x14'));return _0x5b5e4d(_0x406daa['result'][_0xb9d5('0x21')]?_0x406daa[_0xb9d5('0x11')][0x0]:null);})[_0xb9d5('0xc')](function(_0x1556c5){logger[_0xb9d5('0x9')](_0xb9d5('0x22'),_0x1556c5?util['inspect'](_0x1556c5,{'showHidden':![],'depth':null}):'');return _0x5b5e4d(null);});}return _0x5b5e4d(null);});};exports[_0xb9d5('0x23')]=function(_0x4c82b3,_0x5ec250){return moment(_0x4c82b3)[_0xb9d5('0x24')](_0x5ec250,_0xb9d5('0x25'))['format'](_0xb9d5('0x26'));};exports['subtractTime']=function(_0x5bb604,_0x47c16d){return moment(_0x5bb604)[_0xb9d5('0x27')](_0x47c16d,_0xb9d5('0x25'))[_0xb9d5('0x28')](_0xb9d5('0x26'));};exports[_0xb9d5('0x29')]=function(_0x323aa6,_0x137149){return moment(_0x323aa6)[_0xb9d5('0x2a')](moment(_0x137149),_0xb9d5('0x25'));};exports['sumTime']=function(_0x1c8592,_0x3a13b4){return parseInt(_0x1c8592,0xa)+parseInt(_0x3a13b4,0xa);};exports['now']=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x18da40,_0x57cd03){if(_0x57cd03){return moment(_0x18da40)['isAfter'](_0x57cd03);}return!![];};exports[_0xb9d5('0x2b')]=function(_0x5cec4b,_0x598bfd){if(_0x598bfd){return moment(_0x5cec4b)[_0xb9d5('0x2b')](_0x598bfd);}else if(_0x5cec4b){return!![];}return![];}; \ No newline at end of file +var _0x015e=['error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','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','diff','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect'];(function(_0x414579,_0x23a19c){var _0x18653d=function(_0xe08c48){while(--_0xe08c48){_0x414579['push'](_0x414579['shift']());}};_0x18653d(++_0x23a19c);}(_0x015e,0x138));var _0xe015=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x015e[_0x8c43de];return _0xa6591b;};'use strict';var BPromise=require(_0xe015('0x0'));var jayson=require(_0xe015('0x1'));var moment=require(_0xe015('0x2'));var util=require(_0xe015('0x3'));var client=jayson['client'][_0xe015('0x4')]({'port':0x2329});var logger=require(_0xe015('0x5'))(_0xe015('0x6'));exports[_0xe015('0x7')]=function(_0x37b0b2,_0x299420){logger['info'](_0x37b0b2,_0x299420?util['inspect'](_0x299420,{'showHidden':![],'depth':null}):'');};exports[_0xe015('0x8')]=function(_0x78558e,_0x1f4006){logger[_0xe015('0x8')](_0x78558e,_0x1f4006?util[_0xe015('0x9')](_0x1f4006,{'showHidden':![],'depth':null}):'');};exports[_0xe015('0xa')]=function(_0x308041,_0x4e202e){logger[_0xe015('0xa')](_0x308041,_0x4e202e?util[_0xe015('0x9')](_0x4e202e,{'showHidden':![],'depth':null}):'');};exports[_0xe015('0xb')]=function(_0x1f7dbb,_0x3fd412){return client['request'](_0x1f7dbb,{'body':_0x3fd412})[_0xe015('0xc')](function(_0x23f861){logger[_0xe015('0x8')](_0xe015('0xd'),_0x1f7dbb,_0x23f861?util[_0xe015('0x9')](_0x23f861,{'showHidden':![],'depth':null}):'');})[_0xe015('0xe')](function(_0x24df8e){logger[_0xe015('0xa')](_0xe015('0xd'),_0x1f7dbb,_0x24df8e?util[_0xe015('0x9')](_0x24df8e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x52cddf){return client[_0xe015('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xe015('0xf'),_0xe015('0x10'),_0xe015('0x11')],'where':_0x52cddf,'limit':0x1}})[_0xe015('0xc')](function(_0x496fbe){logger[_0xe015('0x8')](_0xe015('0x12'),JSON[_0xe015('0x13')](_0x52cddf),_0x496fbe?util[_0xe015('0x9')](_0x496fbe,{'showHidden':![],'depth':null}):'');return _0x496fbe[_0xe015('0x14')][_0xe015('0x15')]?_0x496fbe[_0xe015('0x14')][0x0]:null;});}exports[_0xe015('0x16')]=function(_0x3c3d25){return new BPromise(function(_0x1f2ab8,_0x2ad4b8){if(_0x3c3d25){return getUser({'internal':_0x3c3d25})[_0xe015('0xc')](function(_0x25676f){logger[_0xe015('0x7')](_0xe015('0x17'),_0x3c3d25,_0x25676f?_0xe015('0x18'):_0xe015('0x19'));return _0x1f2ab8(_0x25676f);})[_0xe015('0xe')](function(_0x59e675){logger['error']('[utils][getUserByInternal]',_0x59e675?util[_0xe015('0x9')](_0x59e675,{'showHidden':![],'depth':null}):'');return _0x1f2ab8(null);});}return _0x1f2ab8(null);});};exports[_0xe015('0x1a')]=function(_0x4c8350){return new BPromise(function(_0x475700,_0x344b48){if(_0x4c8350){return getUser({'interface':_0x4c8350})['then'](function(_0xb8b644){logger[_0xe015('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4c8350,_0xb8b644?'found':_0xe015('0x19'));return _0x475700(_0xb8b644);})[_0xe015('0xe')](function(_0x265867){logger['error'](_0xe015('0x1b'),_0x265867?util[_0xe015('0x9')](_0x265867,{'showHidden':![],'depth':null}):'');return _0x475700(null);});}return _0x475700(null);});};exports[_0xe015('0x1c')]=function(_0x37a9b6){return new BPromise(function(_0x3344ba,_0x1d8562){if(_0x37a9b6){return getUser({'name':_0x37a9b6})[_0xe015('0xc')](function(_0x1ef4d2){logger[_0xe015('0x7')](_0xe015('0x1d'),_0x37a9b6,_0x1ef4d2?_0xe015('0x18'):_0xe015('0x19'));return _0x3344ba(_0x1ef4d2);})[_0xe015('0xe')](function(_0x36178d){logger[_0xe015('0xa')]('[utils][getUserByName]',_0x36178d?util['inspect'](_0x36178d,{'showHidden':![],'depth':null}):'');return _0x3344ba(null);});}return _0x3344ba(null);});};exports[_0xe015('0x1e')]=function(_0x5d10df){return new BPromise(function(_0x739050,_0x2446d9){if(_0x5d10df){return client[_0xe015('0xb')](_0xe015('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xe015('0x10'),_0xe015('0x20'),'acw',_0xe015('0x21')],'where':{'name':_0x5d10df},'limit':0x1}})[_0xe015('0xc')](function(_0x452926){logger[_0xe015('0x8')](_0xe015('0x22'),_0x5d10df,_0x452926?util[_0xe015('0x9')](_0x452926,{'showHidden':![],'depth':null}):'');logger[_0xe015('0x7')](_0xe015('0x23'),_0x5d10df,_0x452926?_0xe015('0x18'):_0xe015('0x19'));return _0x739050(_0x452926[_0xe015('0x14')][_0xe015('0x15')]?_0x452926[_0xe015('0x14')][0x0]:null);})[_0xe015('0xe')](function(_0x4cf903){logger[_0xe015('0xa')]('[utils][getVoiceQueueByName]',_0x4cf903?util['inspect'](_0x4cf903,{'showHidden':![],'depth':null}):'');return _0x739050(null);});}return _0x739050(null);});};exports[_0xe015('0x24')]=function(_0x54e424,_0x3cffd8){return moment(_0x54e424)[_0xe015('0x25')](_0x3cffd8,_0xe015('0x26'))[_0xe015('0x27')](_0xe015('0x28'));};exports[_0xe015('0x29')]=function(_0xc304db,_0x15f433){return moment(_0xc304db)[_0xe015('0x2a')](_0x15f433,'seconds')[_0xe015('0x27')](_0xe015('0x28'));};exports['diffTime']=function(_0x1c25ba,_0x33f38f){return moment(_0x1c25ba)[_0xe015('0x2b')](moment(_0x33f38f),'seconds');};exports['sumTime']=function(_0x4a4166,_0x3c232b){return parseInt(_0x4a4166,0xa)+parseInt(_0x3c232b,0xa);};exports['now']=function(){return moment()['format'](_0xe015('0x28'));};exports[_0xe015('0x2c')]=function(_0xca7b1a,_0x35e27f){if(_0x35e27f){return moment(_0xca7b1a)['isAfter'](_0x35e27f);}return!![];};exports[_0xe015('0x2d')]=function(_0x4380d5,_0x505931){if(_0x505931){return moment(_0x4380d5)[_0xe015('0x2d')](_0x505931);}else if(_0x4380d5){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 bac7869..b0a5689 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 _0x7789=['./mask-sensitive-data','maskSensitiveData','join','client','role','then','catch','log','user','no-user','data','timestamp','error','auth','set','client-side-logger','logger','isEmpty','body','method','headers','x-forwarded-for','connection','url','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)','format','remoteAddress','statusCode','other','agent_name','test','setupLoggers','fs-extra','lodash','util','./loggers','fileLogger','./safe-template','safeTemplate'];(function(_0x4e4afc,_0x2da1ac){var _0x3de051=function(_0x7760f0){while(--_0x7760f0){_0x4e4afc['push'](_0x4e4afc['shift']());}};_0x3de051(++_0x2da1ac);}(_0x7789,0x197));var _0x9778=function(_0x101ba7,_0x45fca8){_0x101ba7=_0x101ba7-0x0;var _0x54c751=_0x7789[_0x101ba7];return _0x54c751;};var fs=require(_0x9778('0x0'));var _=require(_0x9778('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x9778('0x2'));var fileLogger=require(_0x9778('0x3'))[_0x9778('0x4')];var safeTemplate=require(_0x9778('0x5'))[_0x9778('0x6')];var maskSensitiveData=require(_0x9778('0x7'))[_0x9778('0x8')];function ClientSideLogger(){function _0xe7997d(_0x2b0148){var _0x3c2672=path['join']('/var','log','xcally');var _0x4a5b02=path[_0x9778('0x9')](_0x9778('0xa'),_0x2b0148[_0x9778('0xb')]+'-'+_0x2b0148['name']);return fs['ensureDir'](path[_0x9778('0x9')](_0x3c2672,_0x4a5b02))[_0x9778('0xc')](function(){var _0x4a842b=fileLogger(_0x9778('0xa'),path[_0x9778('0x9')](_0x3c2672,_0x4a5b02));return _0x4a842b;})[_0x9778('0xd')](function(_0x4a5927){throw _0x4a5927;});}this[_0x9778('0xe')]=function(_0x430cbe,_0x489eca,_0x367d50,_0x4a68e1){return _0xe7997d(_0x430cbe['user'])['then'](function(_0x3d9bc6){var _0x390c92=_0x3d9bc6[_0x489eca];return _0x390c92;})[_0x9778('0xc')](function(_0x446cb6){var _0x4a8165=_0x430cbe['user']?_0x430cbe[_0x9778('0xf')]['id']:_0x9778('0x10');var _0x4f8fa1=_0x4a68e1[_0x9778('0x11')];var _0x4379ee=_0x4a68e1[_0x9778('0x12')];var _0x593b0=new Date(Number(_0x4379ee));return _0x446cb6(_0x4a8165,_0x593b0,_0x367d50,_0x4f8fa1);})['catch'](function(_0x59e61d){fileLogger(_0x9778('0xa'))[_0x9778('0x13')](_0x59e61d);});};}function setupLoggers(_0x55fd62){return new Promise(function(_0x50cd95){var _0x5a29ab=new ClientSideLogger();var _0x3c5c8e=fileLogger('api');var _0x1fc9f2=fileLogger(_0x9778('0x14'));_0x55fd62[_0x9778('0x15')](_0x9778('0x16'),_0x5a29ab);_0x55fd62['use'](ewinston[_0x9778('0x17')]({'winstonInstance':_0x3c5c8e,'meta':![],'statusLevels':!![],'msg':function(_0x33e0c9,_0x233be1){var _0x125705='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x9778('0x18')](_0x33e0c9[_0x9778('0x19')])){_0x125705+='\x20body=%s';var _0x182c2c=_0x33e0c9[_0x9778('0x19')];maskSensitiveData(_0x182c2c);}return safeTemplate(util['format'](_0x125705,_0x33e0c9[_0x9778('0x1a')],_0x33e0c9[_0x9778('0x1b')]['x-forwarded-for']?_0x33e0c9[_0x9778('0x1b')][_0x9778('0x1c')]:_0x33e0c9[_0x9778('0x1d')]['remoteAddress']||_0x33e0c9['ip'],_0x33e0c9[_0x9778('0x1e')],_0x233be1['statusCode'],_0x233be1[_0x9778('0x1f')],_0x33e0c9[_0x9778('0xf')]?_0x33e0c9[_0x9778('0xf')]['id']:null,_0x33e0c9[_0x9778('0xf')]?_0x33e0c9[_0x9778('0xf')][_0x9778('0x20')]:null,_0x33e0c9[_0x9778('0xf')]?_0x33e0c9['user'][_0x9778('0xb')]:null,_0x182c2c?util[_0x9778('0x21')](_0x182c2c,![],null):''));}}));_0x55fd62[_0x9778('0x22')](ewinston['logger']({'winstonInstance':_0x1fc9f2,'meta':![],'statusLevels':!![],'msg':function(_0x1ce5cc,_0x25c172){var _0x2a3450=_0x9778('0x23');if(_0x1ce5cc['body']&&_0x1ce5cc[_0x9778('0x19')][_0x9778('0x24')]&&_0x1ce5cc['body'][_0x9778('0x25')]){_0x2a3450=_0x9778('0x26');}return util[_0x9778('0x27')](_0x2a3450,_0x1ce5cc[_0x9778('0x1a')],_0x1ce5cc[_0x9778('0x1b')]['x-forwarded-for']?_0x1ce5cc[_0x9778('0x1b')]['x-forwarded-for']:_0x1ce5cc[_0x9778('0x1d')][_0x9778('0x28')]||_0x1ce5cc['ip'],_0x1ce5cc[_0x9778('0x1e')],_0x25c172[_0x9778('0x29')],_0x25c172[_0x9778('0x1f')],_0x1ce5cc[_0x9778('0xf')]?_0x1ce5cc[_0x9778('0xf')]['id']:null,_0x1ce5cc[_0x9778('0xf')]?_0x1ce5cc[_0x9778('0xf')]['name']:null,_0x1ce5cc['user']?_0x1ce5cc['user'][_0x9778('0xb')]:null,_0x1ce5cc[_0x9778('0x19')]&&_0x1ce5cc['body'][_0x9778('0x24')]?_0x1ce5cc[_0x9778('0x19')]['device']:_0x9778('0x2a'),_0x1ce5cc['body']&&_0x1ce5cc[_0x9778('0x19')][_0x9778('0x25')]?_0x1ce5cc[_0x9778('0x19')]['agent_id']:'',_0x1ce5cc['body']&&_0x1ce5cc['body'][_0x9778('0x2b')]?_0x1ce5cc[_0x9778('0x19')][_0x9778('0x2b')]:'');},'ignoreRoute':function(_0x379fd1){var _0x1921cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1921cc[_0x9778('0x2c')](_0x379fd1[_0x9778('0x1e')]);}}));return _0x50cd95();});}exports[_0x9778('0x2d')]=setupLoggers; \ No newline at end of file +var _0x37a6=['remoteAddress','url','statusCode','responseTime','use','logger','%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)','method','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','role','name','ensureDir','user','no-user','data','timestamp','catch','error','api','auth','set','client-side-logger','body','\x20body=%s','format','headers','x-forwarded-for','connection'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x37a6,0xfa));var _0x637a=function(_0x4b3637,_0x3657ea){_0x4b3637=_0x4b3637-0x0;var _0x2fcb89=_0x37a6[_0x4b3637];return _0x2fcb89;};var fs=require(_0x637a('0x0'));var _=require(_0x637a('0x1'));var ewinston=require(_0x637a('0x2'));var path=require('path');var util=require(_0x637a('0x3'));var fileLogger=require(_0x637a('0x4'))['fileLogger'];var safeTemplate=require(_0x637a('0x5'))[_0x637a('0x6')];var maskSensitiveData=require(_0x637a('0x7'))[_0x637a('0x8')];function ClientSideLogger(){function _0x470508(_0x4ee53c){var _0x47d4aa=path[_0x637a('0x9')](_0x637a('0xa'),_0x637a('0xb'),'xcally');var _0x2ec776=path[_0x637a('0x9')](_0x637a('0xc'),_0x4ee53c[_0x637a('0xd')]+'-'+_0x4ee53c[_0x637a('0xe')]);return fs[_0x637a('0xf')](path[_0x637a('0x9')](_0x47d4aa,_0x2ec776))['then'](function(){var _0x5d5f23=fileLogger(_0x637a('0xc'),path[_0x637a('0x9')](_0x47d4aa,_0x2ec776));return _0x5d5f23;})['catch'](function(_0x2c1622){throw _0x2c1622;});}this[_0x637a('0xb')]=function(_0x4bb919,_0x4ecffc,_0x5bf12e,_0x5e1430){return _0x470508(_0x4bb919[_0x637a('0x10')])['then'](function(_0x81c71d){var _0x1b1211=_0x81c71d[_0x4ecffc];return _0x1b1211;})['then'](function(_0x373ce0){var _0x42fa9a=_0x4bb919[_0x637a('0x10')]?_0x4bb919[_0x637a('0x10')]['id']:_0x637a('0x11');var _0x2ca626=_0x5e1430[_0x637a('0x12')];var _0x46ac18=_0x5e1430[_0x637a('0x13')];var _0x5cfcb4=new Date(Number(_0x46ac18));return _0x373ce0(_0x42fa9a,_0x5cfcb4,_0x5bf12e,_0x2ca626);})[_0x637a('0x14')](function(_0x3ac7af){fileLogger(_0x637a('0xc'))[_0x637a('0x15')](_0x3ac7af);});};}function setupLoggers(_0x3fb7b2){return new Promise(function(_0x2c2e3c){var _0x309b0a=new ClientSideLogger();var _0x3ed6a7=fileLogger(_0x637a('0x16'));var _0x5d81f=fileLogger(_0x637a('0x17'));_0x3fb7b2[_0x637a('0x18')](_0x637a('0x19'),_0x309b0a);_0x3fb7b2['use'](ewinston['logger']({'winstonInstance':_0x3ed6a7,'meta':![],'statusLevels':!![],'msg':function(_0xc55cc2,_0x2e927d){var _0x22efec='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0xc55cc2[_0x637a('0x1a')])){_0x22efec+=_0x637a('0x1b');var _0x3cacef=_0xc55cc2[_0x637a('0x1a')];maskSensitiveData(_0x3cacef);}return safeTemplate(util[_0x637a('0x1c')](_0x22efec,_0xc55cc2['method'],_0xc55cc2[_0x637a('0x1d')]['x-forwarded-for']?_0xc55cc2[_0x637a('0x1d')][_0x637a('0x1e')]:_0xc55cc2[_0x637a('0x1f')][_0x637a('0x20')]||_0xc55cc2['ip'],_0xc55cc2[_0x637a('0x21')],_0x2e927d[_0x637a('0x22')],_0x2e927d[_0x637a('0x23')],_0xc55cc2[_0x637a('0x10')]?_0xc55cc2[_0x637a('0x10')]['id']:null,_0xc55cc2[_0x637a('0x10')]?_0xc55cc2['user'][_0x637a('0xe')]:null,_0xc55cc2['user']?_0xc55cc2[_0x637a('0x10')][_0x637a('0xd')]:null,_0x3cacef?util['inspect'](_0x3cacef,![],null):''));}}));_0x3fb7b2[_0x637a('0x24')](ewinston[_0x637a('0x25')]({'winstonInstance':_0x5d81f,'meta':![],'statusLevels':!![],'msg':function(_0x3e147f,_0x5ca078){var _0x322970=_0x637a('0x26');if(_0x3e147f[_0x637a('0x1a')]&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x27')]&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x28')]){_0x322970=_0x637a('0x29');}return util[_0x637a('0x1c')](_0x322970,_0x3e147f[_0x637a('0x2a')],_0x3e147f['headers']['x-forwarded-for']?_0x3e147f['headers'][_0x637a('0x1e')]:_0x3e147f[_0x637a('0x1f')][_0x637a('0x20')]||_0x3e147f['ip'],_0x3e147f[_0x637a('0x21')],_0x5ca078[_0x637a('0x22')],_0x5ca078[_0x637a('0x23')],_0x3e147f['user']?_0x3e147f[_0x637a('0x10')]['id']:null,_0x3e147f['user']?_0x3e147f[_0x637a('0x10')][_0x637a('0xe')]:null,_0x3e147f[_0x637a('0x10')]?_0x3e147f[_0x637a('0x10')]['role']:null,_0x3e147f['body']&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x27')]?_0x3e147f[_0x637a('0x1a')]['device']:_0x637a('0x2b'),_0x3e147f['body']&&_0x3e147f['body'][_0x637a('0x28')]?_0x3e147f['body'][_0x637a('0x28')]:'',_0x3e147f[_0x637a('0x1a')]&&_0x3e147f[_0x637a('0x1a')][_0x637a('0x2c')]?_0x3e147f['body'][_0x637a('0x2c')]:'');},'ignoreRoute':function(_0xabde1){var _0xca5f37=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xca5f37[_0x637a('0x2d')](_0xabde1['url']);}}));return _0x2c2e3c();});}exports[_0x637a('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 5e15bc4..1513b16 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1ff=['iftime','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','hours','clone','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','MMM','isMoment','padStart','length'];(function(_0x739f93,_0x1d62c9){var _0x3331e9=function(_0xba84d2){while(--_0xba84d2){_0x739f93['push'](_0x739f93['shift']());}};_0x3331e9(++_0x1d62c9);}(_0xb1ff,0x198));var _0xfb1f=function(_0x30e4c0,_0x58fed1){_0x30e4c0=_0x30e4c0-0x0;var _0x30b6d0=_0xb1ff[_0x30e4c0];return _0x30b6d0;};var _=require('lodash');var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xfb1f('0x0')](function(_0x44c57){return _0x44c57[_0xfb1f('0x1')];})[_0xfb1f('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xfb1f('0x3');var EINVALID_DATE=_0xfb1f('0x4');function throwIfDateNotValid(_0x7fa8b0){if(!_0x7fa8b0[_0xfb1f('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x58dae3){var _0x161e04=_0x58dae3[_0xfb1f('0x6')](':')[_0xfb1f('0x0')](function(_0x35e3f7){return parseInt(_0x35e3f7,0xa);});var _0x4a1367=_0x161e04[0x0];var _0x36e4a6=_0x161e04[0x1];if(_0x4a1367<0x0||_0x4a1367>0x17||_0x36e4a6<0x0||_0x36e4a6>0x3b){throw new Error(EINVALID_DATE);}return[_0x4a1367,_0x36e4a6];}function circularDoWInterval(_0x47e8c9,_0x5e4637){if(_0x47e8c9===_0x5e4637){return[_0x47e8c9];}else{var _0x596bcc=moment['locale']();moment[_0xfb1f('0x7')]('en');var _0x43a474=moment[_0xfb1f('0x8')]()[_0xfb1f('0x0')](function(_0x324141){return _0x324141[_0xfb1f('0x9')]();});moment['locale'](_0x596bcc);var _0x4d8eab=_0x43a474[_0xfb1f('0xa')](_0x47e8c9);var _0x4b0b24=_0x43a474[_0xfb1f('0xa')](_0x5e4637);if(_0x4b0b24>_0x4d8eab){return _0x43a474[_0xfb1f('0xb')](_0x4d8eab,_0x4b0b24+0x1);}else{var _0x456cb8=_0x43a474[_0xfb1f('0xb')](0x0,_0x4b0b24+0x1);var _0x5638f7=_0x43a474[_0xfb1f('0xb')](_0x4d8eab);return _0x5638f7[_0xfb1f('0xc')](_0x456cb8);}}}module[_0xfb1f('0xd')][_0xfb1f('0xe')]=circularDoWInterval;function circularMonthInterval(_0xe5a7eb,_0x5f0277){if(_0xe5a7eb===_0x5f0277){return[_0xe5a7eb];}else{var _0x1a01e9=moment[_0xfb1f('0x7')]();moment[_0xfb1f('0x7')]('en');var _0xe690d9=moment['monthsShort']()['map'](function(_0x2c23c9){return _0x2c23c9[_0xfb1f('0x9')]();});moment[_0xfb1f('0x7')](_0x1a01e9);var _0x395497=_0xe690d9['indexOf'](_0xe5a7eb);var _0x5c6a0d=_0xe690d9[_0xfb1f('0xa')](_0x5f0277);if(_0x5c6a0d>_0x395497){return _0xe690d9[_0xfb1f('0xb')](_0x395497,_0x5c6a0d+0x1);}else{var _0x3a4a3a=_0xe690d9[_0xfb1f('0xb')](0x0,_0x5c6a0d+0x1);var _0x261030=_0xe690d9[_0xfb1f('0xb')](_0x395497);return _0x261030['concat'](_0x3a4a3a);}}}module[_0xfb1f('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x5b041e){var _0x4b9403=parseInt(_0x5b041e,0xa);if(_0x4b9403<0x1||_0x4b9403>0x1f){throw new Error(EINVALID_DATE);}return _0x4b9403;}function timeCompare(_0x84556c,_0x421858,_0x5cc3d7){var _0x2684b9=_0x84556c['clone']();var _0x5f6f21=extractTime(_0x421858);var _0x276ba5=_0x5f6f21[0x0];var _0x1645e2=_0x5f6f21[0x1];var _0x9c1ccc=_0x84556c['clone']()[_0xfb1f('0xf')](_0x276ba5)['minutes'](_0x1645e2);throwIfDateNotValid(_0x9c1ccc);var _0x51445c=extractTime(_0x5cc3d7);var _0x3aa16e=_0x51445c[0x0];var _0x5ad114=_0x51445c[0x1];var _0x703dbf=_0x84556c[_0xfb1f('0x10')]()[_0xfb1f('0xf')](_0x3aa16e)[_0xfb1f('0x11')](_0x5ad114);throwIfDateNotValid(_0x703dbf);if(_0x703dbf[_0xfb1f('0x12')](_0x9c1ccc)){var _0x45e600=_0x2684b9['clone']()[_0xfb1f('0x13')](_0xfb1f('0x14'));var _0x4c3f75=_0x2684b9[_0xfb1f('0x10')]()[_0xfb1f('0x15')]('day');return _0x2684b9['isBetween'](_0x9c1ccc,_0x4c3f75,undefined,'[]')||_0x2684b9['isBetween'](_0x45e600,_0x703dbf,undefined,'[]');}else{return _0x2684b9[_0xfb1f('0x16')](_0x9c1ccc,_0x703dbf,undefined,'[]');}}module[_0xfb1f('0xd')][_0xfb1f('0x17')]=timeCompare;function dowCompare(_0x226cee,_0x33dfe8,_0x488dc7){var _0x26b4fe=_0x226cee[_0xfb1f('0x7')]('en')[_0xfb1f('0x18')](_0xfb1f('0x19'))[_0xfb1f('0x9')]();return circularDoWInterval(_0x33dfe8,_0x488dc7)[_0xfb1f('0x1a')](_0x26b4fe);}module['exports'][_0xfb1f('0x1b')]=dowCompare;function domCompare(_0x2d96eb,_0x172421,_0x10d1d3){var _0x3908ae=_0x2d96eb[_0xfb1f('0x1c')]();if(_0x172421===_0x10d1d3){return _0x3908ae===_0x172421;}else{var _0x1a8c59=_0x2d96eb[_0xfb1f('0x1d')]();var _0x147cdd=_0x172421<_0x10d1d3;let _0x279dc4=![];var _0x51e68b=0x0;var _0x5c0eb0=0x0;if(_0x147cdd){_0x51e68b=Math[_0xfb1f('0x1e')](0x1,_0x172421);_0x5c0eb0=Math[_0xfb1f('0x1f')](_0x10d1d3,_0x1a8c59);_0x279dc4=_0x3908ae>=_0x51e68b&&_0x3908ae<=_0x5c0eb0;}else{_0x51e68b=Math['min'](_0x172421,_0x1a8c59);_0x5c0eb0=Math[_0xfb1f('0x1e')](0x1,_0x10d1d3);_0x279dc4=_0x3908ae>=_0x51e68b||_0x3908ae<=_0x5c0eb0;}return _0x279dc4;}}module[_0xfb1f('0xd')]['domCompare']=domCompare;function monthCompare(_0x7b1f99,_0x563e3a,_0x7bc450){var _0x3f93a4=_0x7b1f99[_0xfb1f('0x7')]('en')['format'](_0xfb1f('0x20'))[_0xfb1f('0x9')]();return circularMonthInterval(_0x563e3a,_0x7bc450)[_0xfb1f('0x1a')](_0x3f93a4);}module[_0xfb1f('0xd')]['monthCompare']=monthCompare;function iftime(_0x4e18c3,_0x33a676=moment['tz']['guess'](),_0xf6acf3=moment()){if(!validateRx['test'](_0x4e18c3)){throw new Error(EINVALID_STRING);}else{var _0x471c54=(moment[_0xfb1f('0x21')](_0xf6acf3)?_0xf6acf3['clone']():moment(_0xf6acf3))['tz'](_0x33a676)[_0xfb1f('0x7')]('en');throwIfDateNotValid(_0x471c54);var _0x114e13=_0x4e18c3[_0xfb1f('0x6')](',');var _0x2e927c=_0x114e13[0x0];var _0x2b7970=_0x114e13[0x1];var _0x3880ba=_0x114e13[0x2];var _0x20e19e=_0x114e13[0x3];let _0x31789c=!![];if(_0x2e927c!=='*'){var _0x21bf55=_0x2e927c['split']('-');var _0x1631c6=_[_0xfb1f('0x22')](_0x21bf55[0x0],0x5,'0');var _0x51f647=_0x21bf55[_0xfb1f('0x23')]===0x2?_[_0xfb1f('0x22')](_0x21bf55[0x1],0x5,'0'):_0x1631c6;_0x31789c=timeCompare(_0x471c54,_0x1631c6,_0x51f647);}let _0x302826=!![];if(_0x2b7970!=='*'){var _0x4eb393=_0x2b7970[_0xfb1f('0x6')]('-');var _0x18c8dc=_0x4eb393[0x0];var _0x43edfb=_0x4eb393[_0xfb1f('0x23')]===0x2?_0x4eb393[0x1]:_0x18c8dc;_0x302826=dowCompare(_0x471c54,_0x18c8dc,_0x43edfb);}let _0x28dbcd=!![];if(_0x3880ba!=='*'){var _0x52c857=_0x3880ba['split']('-');var _0x50a293=parseDom(_0x52c857[0x0]);var _0x344494=_0x52c857[_0xfb1f('0x23')]===0x2?parseDom(_0x52c857[0x1]):_0x50a293;_0x28dbcd=domCompare(_0x471c54,_0x50a293,_0x344494);}let _0x4dc8bd=!![];if(_0x20e19e!=='*'){var _0x3586a4=_0x20e19e['split']('-');var _0x3e2d65=_0x3586a4[0x0];var _0x25854c=_0x3586a4[_0xfb1f('0x23')]===0x2?_0x3586a4[0x1]:_0x3586a4[0x0];_0x4dc8bd=monthCompare(_0x471c54,_0x3e2d65,_0x25854c);}return _0x31789c&&_0x302826&&_0x28dbcd&&_0x4dc8bd;}}module[_0xfb1f('0xd')][_0xfb1f('0x24')]=iftime; \ No newline at end of file +var _0x9bad=['circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','MMM','monthCompare','test','isMoment','split','length','padStart','iftime','lodash','map','source','join','Date\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval'];(function(_0x5c92c7,_0x2bae59){var _0x1f64c0=function(_0x5c783d){while(--_0x5c783d){_0x5c92c7['push'](_0x5c92c7['shift']());}};_0x1f64c0(++_0x2bae59);}(_0x9bad,0x179));var _0xd9ba=function(_0x27341a,_0x218385){_0x27341a=_0x27341a-0x0;var _0x1a4bc1=_0x9bad[_0x27341a];return _0x1a4bc1;};var _=require(_0xd9ba('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xd9ba('0x1')](function(_0x3d2f00){return _0x3d2f00[_0xd9ba('0x2')];})[_0xd9ba('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xd9ba('0x4');function throwIfDateNotValid(_0x439beb){if(!_0x439beb['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2ea3d2){var _0x262ecb=_0x2ea3d2['split'](':')[_0xd9ba('0x1')](function(_0xb00b04){return parseInt(_0xb00b04,0xa);});var _0x573429=_0x262ecb[0x0];var _0x29d7a6=_0x262ecb[0x1];if(_0x573429<0x0||_0x573429>0x17||_0x29d7a6<0x0||_0x29d7a6>0x3b){throw new Error(EINVALID_DATE);}return[_0x573429,_0x29d7a6];}function circularDoWInterval(_0x5d9464,_0x4d49a8){if(_0x5d9464===_0x4d49a8){return[_0x5d9464];}else{var _0x5301cb=moment[_0xd9ba('0x5')]();moment['locale']('en');var _0x29fc2e=moment[_0xd9ba('0x6')]()[_0xd9ba('0x1')](function(_0x1cd4f3){return _0x1cd4f3[_0xd9ba('0x7')]();});moment['locale'](_0x5301cb);var _0x4e5ac7=_0x29fc2e[_0xd9ba('0x8')](_0x5d9464);var _0x230922=_0x29fc2e[_0xd9ba('0x8')](_0x4d49a8);if(_0x230922>_0x4e5ac7){return _0x29fc2e[_0xd9ba('0x9')](_0x4e5ac7,_0x230922+0x1);}else{var _0xf41652=_0x29fc2e[_0xd9ba('0x9')](0x0,_0x230922+0x1);var _0x508fc9=_0x29fc2e[_0xd9ba('0x9')](_0x4e5ac7);return _0x508fc9[_0xd9ba('0xa')](_0xf41652);}}}module[_0xd9ba('0xb')][_0xd9ba('0xc')]=circularDoWInterval;function circularMonthInterval(_0x5b0ce1,_0x5187be){if(_0x5b0ce1===_0x5187be){return[_0x5b0ce1];}else{var _0x56c5f8=moment[_0xd9ba('0x5')]();moment[_0xd9ba('0x5')]('en');var _0x4fd43a=moment['monthsShort']()['map'](function(_0x7f645c){return _0x7f645c[_0xd9ba('0x7')]();});moment[_0xd9ba('0x5')](_0x56c5f8);var _0x39c47e=_0x4fd43a['indexOf'](_0x5b0ce1);var _0x4d9c00=_0x4fd43a[_0xd9ba('0x8')](_0x5187be);if(_0x4d9c00>_0x39c47e){return _0x4fd43a[_0xd9ba('0x9')](_0x39c47e,_0x4d9c00+0x1);}else{var _0x17fa17=_0x4fd43a[_0xd9ba('0x9')](0x0,_0x4d9c00+0x1);var _0x26e15d=_0x4fd43a[_0xd9ba('0x9')](_0x39c47e);return _0x26e15d[_0xd9ba('0xa')](_0x17fa17);}}}module[_0xd9ba('0xb')][_0xd9ba('0xd')]=circularMonthInterval;function parseDom(_0x1d0974){var _0x36285e=parseInt(_0x1d0974,0xa);if(_0x36285e<0x1||_0x36285e>0x1f){throw new Error(EINVALID_DATE);}return _0x36285e;}function timeCompare(_0x2ec068,_0x437f9d,_0x3035fc){var _0x2bc74d=_0x2ec068[_0xd9ba('0xe')]();var _0x29361e=extractTime(_0x437f9d);var _0x36fc32=_0x29361e[0x0];var _0x52506f=_0x29361e[0x1];var _0xdb35c7=_0x2ec068['clone']()[_0xd9ba('0xf')](_0x36fc32)['minutes'](_0x52506f);throwIfDateNotValid(_0xdb35c7);var _0x531d9c=extractTime(_0x3035fc);var _0x5dad79=_0x531d9c[0x0];var _0x481ec1=_0x531d9c[0x1];var _0x596f63=_0x2ec068[_0xd9ba('0xe')]()[_0xd9ba('0xf')](_0x5dad79)[_0xd9ba('0x10')](_0x481ec1);throwIfDateNotValid(_0x596f63);if(_0x596f63[_0xd9ba('0x11')](_0xdb35c7)){var _0x239f50=_0x2bc74d[_0xd9ba('0xe')]()[_0xd9ba('0x12')](_0xd9ba('0x13'));var _0x9b1624=_0x2bc74d[_0xd9ba('0xe')]()[_0xd9ba('0x14')]('day');return _0x2bc74d[_0xd9ba('0x15')](_0xdb35c7,_0x9b1624,undefined,'[]')||_0x2bc74d[_0xd9ba('0x15')](_0x239f50,_0x596f63,undefined,'[]');}else{return _0x2bc74d[_0xd9ba('0x15')](_0xdb35c7,_0x596f63,undefined,'[]');}}module['exports'][_0xd9ba('0x16')]=timeCompare;function dowCompare(_0x268872,_0x196738,_0x38d45d){var _0x313dc2=_0x268872[_0xd9ba('0x5')]('en')[_0xd9ba('0x17')](_0xd9ba('0x18'))['toLowerCase']();return circularDoWInterval(_0x196738,_0x38d45d)[_0xd9ba('0x19')](_0x313dc2);}module[_0xd9ba('0xb')][_0xd9ba('0x1a')]=dowCompare;function domCompare(_0x1d01af,_0x46a48e,_0x3c80d6){var _0x5661ab=_0x1d01af[_0xd9ba('0x1b')]();if(_0x46a48e===_0x3c80d6){return _0x5661ab===_0x46a48e;}else{var _0x1c97de=_0x1d01af[_0xd9ba('0x1c')]();var _0x2bafe8=_0x46a48e<_0x3c80d6;let _0x1e8884=![];var _0x2ee410=0x0;var _0x3ff1e9=0x0;if(_0x2bafe8){_0x2ee410=Math[_0xd9ba('0x1d')](0x1,_0x46a48e);_0x3ff1e9=Math[_0xd9ba('0x1e')](_0x3c80d6,_0x1c97de);_0x1e8884=_0x5661ab>=_0x2ee410&&_0x5661ab<=_0x3ff1e9;}else{_0x2ee410=Math[_0xd9ba('0x1e')](_0x46a48e,_0x1c97de);_0x3ff1e9=Math['max'](0x1,_0x3c80d6);_0x1e8884=_0x5661ab>=_0x2ee410||_0x5661ab<=_0x3ff1e9;}return _0x1e8884;}}module[_0xd9ba('0xb')]['domCompare']=domCompare;function monthCompare(_0x1b7caa,_0x2a1dfd,_0x1f039c){var _0x5f456f=_0x1b7caa['locale']('en')['format'](_0xd9ba('0x1f'))[_0xd9ba('0x7')]();return circularMonthInterval(_0x2a1dfd,_0x1f039c)['includes'](_0x5f456f);}module[_0xd9ba('0xb')][_0xd9ba('0x20')]=monthCompare;function iftime(_0x144948,_0x88edcf=moment['tz']['guess'](),_0x35089c=moment()){if(!validateRx[_0xd9ba('0x21')](_0x144948)){throw new Error(EINVALID_STRING);}else{var _0x4ea1ed=(moment[_0xd9ba('0x22')](_0x35089c)?_0x35089c['clone']():moment(_0x35089c))['tz'](_0x88edcf)[_0xd9ba('0x5')]('en');throwIfDateNotValid(_0x4ea1ed);var _0x247798=_0x144948[_0xd9ba('0x23')](',');var _0x396d42=_0x247798[0x0];var _0x2c887c=_0x247798[0x1];var _0x29c2ac=_0x247798[0x2];var _0x509356=_0x247798[0x3];let _0x234d15=!![];if(_0x396d42!=='*'){var _0x159f2a=_0x396d42[_0xd9ba('0x23')]('-');var _0x347a7a=_['padStart'](_0x159f2a[0x0],0x5,'0');var _0x5af719=_0x159f2a[_0xd9ba('0x24')]===0x2?_[_0xd9ba('0x25')](_0x159f2a[0x1],0x5,'0'):_0x347a7a;_0x234d15=timeCompare(_0x4ea1ed,_0x347a7a,_0x5af719);}let _0x4eeda3=!![];if(_0x2c887c!=='*'){var _0x1ce23d=_0x2c887c['split']('-');var _0x396c86=_0x1ce23d[0x0];var _0xa11384=_0x1ce23d[_0xd9ba('0x24')]===0x2?_0x1ce23d[0x1]:_0x396c86;_0x4eeda3=dowCompare(_0x4ea1ed,_0x396c86,_0xa11384);}let _0x517ad5=!![];if(_0x29c2ac!=='*'){var _0x37968c=_0x29c2ac[_0xd9ba('0x23')]('-');var _0x5775bf=parseDom(_0x37968c[0x0]);var _0x4d9f56=_0x37968c['length']===0x2?parseDom(_0x37968c[0x1]):_0x5775bf;_0x517ad5=domCompare(_0x4ea1ed,_0x5775bf,_0x4d9f56);}let _0x3b8e83=!![];if(_0x509356!=='*'){var _0x7dfa3=_0x509356['split']('-');var _0x17ba75=_0x7dfa3[0x0];var _0x1713ba=_0x7dfa3[_0xd9ba('0x24')]===0x2?_0x7dfa3[0x1]:_0x7dfa3[0x0];_0x3b8e83=monthCompare(_0x4ea1ed,_0x17ba75,_0x1713ba);}return _0x234d15&&_0x4eeda3&&_0x517ad5&&_0x3b8e83;}}module[_0xd9ba('0xb')][_0xd9ba('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 9770afd..c5a4032 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x560b=['join','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','keys','length','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally'];(function(_0x25bd99,_0x112161){var _0x2676b5=function(_0x52d9a7){while(--_0x52d9a7){_0x25bd99['push'](_0x25bd99['shift']());}};_0x2676b5(++_0x112161);}(_0x560b,0x1d2));var _0xb560=function(_0x2d8ba0,_0x1d02b5){_0x2d8ba0=_0x2d8ba0-0x0;var _0x3097d6=_0x560b[_0x2d8ba0];return _0x3097d6;};'use strict';var path=require('path');var util=require('util');var moment=require('moment');var winston=require(_0xb560('0x0'));var config=require(_0xb560('0x1'));var debugLevel=config[_0xb560('0x2')]?config[_0xb560('0x2')][_0xb560('0x3')]():_0xb560('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':_0xb560('0x5'),'error':_0xb560('0x6'),'warn':_0xb560('0x7'),'info':_0xb560('0x8'),'print':_0xb560('0x9'),'success':'bold\x20green','http':_0xb560('0xa'),'verbose':_0xb560('0xb'),'debug':'bold\x20blue','silly':_0xb560('0xc')};winston[_0xb560('0xd')](XC_LOG_COLORS);function getLogFileName(_0xf08fa2,_0x1847d1,_0x314ae3){var _0x1ab45a=_0xf08fa2||_0xb560('0xe');return path[_0xb560('0xf')](_0x1ab45a,util['format'](_0xb560('0x10'),_0x1847d1,_0x314ae3));}function formatter(_0x1ba8fa,_0x203d1c){_0x203d1c[_0xb560('0x11')]=_0x203d1c[_0xb560('0x11')]['replace'](/@@{/g,_0xb560('0x12'))['replace'](/}@@/g,'}}}')[_0xb560('0x13')](/@{/g,'{{')[_0xb560('0x13')](/}@/g,'}}');return util['format'](_0xb560('0x14'),moment()[_0xb560('0x15')](_0xb560('0x16')),_0x203d1c[_0xb560('0x17')][_0xb560('0x18')](),_0x1ba8fa,_0x203d1c[_0xb560('0x11')]);}function fileFormat(_0x36ef59,_0x382cfc){_0x382cfc[_0xb560('0x11')]=_0x382cfc[_0xb560('0x11')]['replace'](/@@{/g,_0xb560('0x12'))[_0xb560('0x13')](/}@@/g,_0xb560('0x19'))[_0xb560('0x13')](/@{/g,'{{')[_0xb560('0x13')](/}@/g,'}}');var _0xc495b0=_0x382cfc[_0xb560('0x1a')]&&Object[_0xb560('0x1b')](_0x382cfc[_0xb560('0x1a')])[_0xb560('0x1c')]?'\x0a\x09'+JSON['stringify'](_0x382cfc['meta']):'';return util[_0xb560('0x15')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xb560('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),_0x382cfc['level'][_0xb560('0x18')](),_0x36ef59,_0x382cfc[_0xb560('0x11')],_0xc495b0);}function consoleLogger(){var _0x430d2b=new winston[(_0xb560('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb560('0x1e'))][(_0xb560('0x1f'))]({'level':_0xb560('0x20'),'json':![],'formatter':function(_0x34b641){return formatter('',_0x34b641);}})]});return _0x430d2b;}function fileLogger(_0x30e199,_0xaa0bc3){var _0x255597=new winston[(_0xb560('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xb560('0x21'))]({'name':util['format'](_0xb560('0x22'),_0x30e199,'error'),'filename':getLogFileName(_0xaa0bc3,_0x30e199,'error'),'level':_0xb560('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x563919){return fileFormat(_0x30e199,_0x563919);}}),new winston[(_0xb560('0x1e'))][(_0xb560('0x21'))]({'name':util[_0xb560('0x15')](_0xb560('0x22'),_0x30e199,debugLevel),'filename':getLogFileName(_0xaa0bc3,_0x30e199,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2d2389){return fileFormat(_0x30e199,_0x2d2389);}}),new winston[(_0xb560('0x1e'))][(_0xb560('0x1f'))]({'level':_0xb560('0x20'),'json':![],'formatter':function(_0x12a1dd){return fileFormat(_0x30e199,_0x12a1dd);}})]});return _0x255597;}exports[_0xb560('0x24')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x5b7d=['redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','addColors','/var/log/xcally','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','{{{','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','warn','error','File','%s-%s','fileLogger','moment','winston','../config/environment','debugLevel','toLowerCase','info'];(function(_0x371f8d,_0x2d7355){var _0x3ed5fc=function(_0x1809ae){while(--_0x1809ae){_0x371f8d['push'](_0x371f8d['shift']());}};_0x3ed5fc(++_0x2d7355);}(_0x5b7d,0x8a));var _0xd5b7=function(_0x42f226,_0x54d9a4){_0x42f226=_0x42f226-0x0;var _0x385118=_0x5b7d[_0x42f226];return _0x385118;};'use strict';var path=require('path');var util=require('util');var moment=require(_0xd5b7('0x0'));var winston=require(_0xd5b7('0x1'));var config=require(_0xd5b7('0x2'));var debugLevel=config[_0xd5b7('0x3')]?config[_0xd5b7('0x3')][_0xd5b7('0x4')]():_0xd5b7('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':_0xd5b7('0x6'),'error':_0xd5b7('0x7'),'warn':_0xd5b7('0x8'),'info':_0xd5b7('0x9'),'print':_0xd5b7('0xa'),'success':_0xd5b7('0xb'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0xd5b7('0xc')](XC_LOG_COLORS);function getLogFileName(_0x443cde,_0x3f1e0b,_0x4cbfce){var _0x326ef9=_0x443cde||_0xd5b7('0xd');return path['join'](_0x326ef9,util[_0xd5b7('0xe')](_0xd5b7('0xf'),_0x3f1e0b,_0x4cbfce));}function formatter(_0xe20b48,_0x3469aa){_0x3469aa[_0xd5b7('0x10')]=_0x3469aa[_0xd5b7('0x10')]['replace'](/@@{/g,'{{{')[_0xd5b7('0x11')](/}@@/g,_0xd5b7('0x12'))[_0xd5b7('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xd5b7('0xe')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xd5b7('0xe')](_0xd5b7('0x13')),_0x3469aa[_0xd5b7('0x14')]['toUpperCase'](),_0xe20b48,_0x3469aa[_0xd5b7('0x10')]);}function fileFormat(_0x3862a2,_0x159b97){_0x159b97[_0xd5b7('0x10')]=_0x159b97['message'][_0xd5b7('0x11')](/@@{/g,_0xd5b7('0x15'))['replace'](/}@@/g,_0xd5b7('0x12'))['replace'](/@{/g,'{{')[_0xd5b7('0x11')](/}@/g,'}}');var _0x593208=_0x159b97[_0xd5b7('0x16')]&&Object[_0xd5b7('0x17')](_0x159b97[_0xd5b7('0x16')])[_0xd5b7('0x18')]?'\x0a\x09'+JSON[_0xd5b7('0x19')](_0x159b97[_0xd5b7('0x16')]):'';return util[_0xd5b7('0xe')](_0xd5b7('0x1a'),moment()[_0xd5b7('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),_0x159b97[_0xd5b7('0x14')][_0xd5b7('0x1b')](),_0x3862a2,_0x159b97[_0xd5b7('0x10')],_0x593208);}function consoleLogger(){var _0xbf6b62=new winston[(_0xd5b7('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd5b7('0x1d'))][(_0xd5b7('0x1e'))]({'level':_0xd5b7('0x1f'),'json':![],'formatter':function(_0x473157){return formatter('',_0x473157);}})]});return _0xbf6b62;}function fileLogger(_0x6cf844,_0x3fe743){var _0x10c1b8=new winston[(_0xd5b7('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd5b7('0x1d'))]['File']({'name':util['format']('%s-%s',_0x6cf844,_0xd5b7('0x20')),'filename':getLogFileName(_0x3fe743,_0x6cf844,_0xd5b7('0x20')),'level':_0xd5b7('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e7536){return fileFormat(_0x6cf844,_0x2e7536);}}),new winston[(_0xd5b7('0x1d'))][(_0xd5b7('0x21'))]({'name':util['format'](_0xd5b7('0x22'),_0x6cf844,debugLevel),'filename':getLogFileName(_0x3fe743,_0x6cf844,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x317583){return fileFormat(_0x6cf844,_0x317583);}}),new winston[(_0xd5b7('0x1d'))][(_0xd5b7('0x1e'))]({'level':_0xd5b7('0x1f'),'json':![],'formatter':function(_0x4961a7){return fileFormat(_0x6cf844,_0x4961a7);}})]});return _0x10c1b8;}exports['consoleLogger']=consoleLogger;exports[_0xd5b7('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 8ea5b5b..305a6d8 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 _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x56b104,_0x2bd54e){var _0x5f2000=function(_0x31ba2c){while(--_0x31ba2c){_0x56b104['push'](_0x56b104['shift']());}};_0x5f2000(++_0x2bd54e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x516ccc,_0x12deb7){_0x516ccc=_0x516ccc-0x0;var _0x527923=_0x5f2f[_0x516ccc];return _0x527923;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb28,0x106));var _0x8db2=function(_0x3060c2,_0x1e0763){_0x3060c2=_0x3060c2-0x0;var _0x54c601=_0xdb28[_0x3060c2];return _0x54c601;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index ffd2881..3397d50 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 _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0xfd42fa,_0x1ede6e){var _0x450569=function(_0x317d38){while(--_0x317d38){_0xfd42fa['push'](_0xfd42fa['shift']());}};_0x450569(++_0x1ede6e);}(_0x8f4c,0x113));var _0xc8f4=function(_0x584f66,_0x39a037){_0x584f66=_0x584f66-0x0;var _0x3908b4=_0x8f4c[_0x584f66];return _0x3908b4;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('0x7')]=safeTemplate; \ No newline at end of file +var _0x8e3f=['reduce','exports','safeTemplate','lodash','{\x20{\x20','string','isArray','map','isPlainObject','keys'];(function(_0xcbbd0e,_0x2ce77d){var _0x75e716=function(_0x477525){while(--_0x477525){_0xcbbd0e['push'](_0xcbbd0e['shift']());}};_0x75e716(++_0x2ce77d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};var _=require(_0xf8e3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42db69){return _0x42db69==='{{'?_0xf8e3('0x1'):'\x20}\x20}';}function safeTemplate(_0x3f3440){var _0x292de5=_0x3f3440;if(typeof _0x3f3440===_0xf8e3('0x2')){_0x292de5=_0x3f3440['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf8e3('0x3')](_0x3f3440)){_0x292de5=_0x3f3440[_0xf8e3('0x4')](function(_0x4dab56){return safeTemplate(_0x4dab56);});}else if(_[_0xf8e3('0x5')](_0x3f3440)){_0x292de5=Object[_0xf8e3('0x6')](_0x3f3440)[_0xf8e3('0x7')](function(_0x1ee9f3,_0x4e9e57){_0x1ee9f3[_0x4e9e57]=safeTemplate(_0x3f3440[_0x4e9e57]);return _0x1ee9f3;},{});}return _0x292de5;}module[_0xf8e3('0x8')][_0xf8e3('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 0028f8a..aae7ef4 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 _0xbd2a=['env','NODE_PATH','string','then','readJSON','info','writeJSON','exports','fs-extra','root','resolve','apps','findIndex','name','motion2'];(function(_0x545311,_0x5d1958){var _0x4aa442=function(_0x295ac9){while(--_0x295ac9){_0x545311['push'](_0x545311['shift']());}};_0x4aa442(++_0x5d1958);}(_0xbd2a,0x18e));var _0xabd2=function(_0x4f5bcb,_0x108b5e){_0x4f5bcb=_0x4f5bcb-0x0;var _0x5dbb7e=_0xbd2a[_0x4f5bcb];return _0x5dbb7e;};var fs=require(_0xabd2('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0xabd2('0x1')];var APP_JSON_PATH=path[_0xabd2('0x2')](root,'server/app.json');var NODEPATH=path[_0xabd2('0x2')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x9378d2){let _0x23e663=![];if(Array['isArray'](_0x9378d2[_0xabd2('0x3')])){var _0x48b844=_0x9378d2[_0xabd2('0x3')][_0xabd2('0x4')](function(_0x163279){return _0x163279[_0xabd2('0x5')]===_0xabd2('0x6');});if(_0x48b844>-0x1){var _0x5e2924=_0x9378d2[_0xabd2('0x3')][_0x48b844];if(typeof _0x5e2924[_0xabd2('0x7')][_0xabd2('0x8')]!==_0xabd2('0x9')){_0x5e2924[_0xabd2('0x7')][_0xabd2('0x8')]=NODEPATH;_0x23e663=!![];}}return{'appConfig':_0x9378d2,'updated':_0x23e663};}}function updateAppConfig(_0x3c3501){return fs['pathExists'](APP_JSON_PATH)[_0xabd2('0xa')](function(_0x524a49){if(_0x524a49){return fs[_0xabd2('0xb')](APP_JSON_PATH)[_0xabd2('0xa')](function(_0x4a8304){var _0x198288=setLegacyLibsNodeEnvPath(_0x4a8304);if(_0x198288['updated']){_0x3c3501[_0xabd2('0xc')]('Updating\x20app.json');return fs[_0xabd2('0xd')](APP_JSON_PATH,_0x4a8304,{'spaces':0x2});}else{return Promise[_0xabd2('0x2')]();}});}else{return Promise[_0xabd2('0x2')]();}});}module[_0xabd2('0xe')]=updateAppConfig; \ No newline at end of file +var _0x3ebb=['string','pathExists','then','readJSON','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH'];(function(_0xf8ca1a,_0xcd834a){var _0x5ac343=function(_0x2d15e6){while(--_0x2d15e6){_0xf8ca1a['push'](_0xf8ca1a['shift']());}};_0x5ac343(++_0xcd834a);}(_0x3ebb,0x86));var _0xb3eb=function(_0x372c49,_0x878312){_0x372c49=_0x372c49-0x0;var _0x5c6161=_0x3ebb[_0x372c49];return _0x5c6161;};var fs=require(_0xb3eb('0x0'));var path=require(_0xb3eb('0x1'));var config=require(_0xb3eb('0x2'));var root=config[_0xb3eb('0x3')];var APP_JSON_PATH=path[_0xb3eb('0x4')](root,'server/app.json');var NODEPATH=path[_0xb3eb('0x4')](root,_0xb3eb('0x5'));function setLegacyLibsNodeEnvPath(_0x44decb){let _0x20f313=![];if(Array[_0xb3eb('0x6')](_0x44decb['apps'])){var _0x4a4bfa=_0x44decb[_0xb3eb('0x7')][_0xb3eb('0x8')](function(_0x1639a3){return _0x1639a3[_0xb3eb('0x9')]===_0xb3eb('0xa');});if(_0x4a4bfa>-0x1){var _0x110e10=_0x44decb[_0xb3eb('0x7')][_0x4a4bfa];if(typeof _0x110e10[_0xb3eb('0xb')][_0xb3eb('0xc')]!==_0xb3eb('0xd')){_0x110e10['env'][_0xb3eb('0xc')]=NODEPATH;_0x20f313=!![];}}return{'appConfig':_0x44decb,'updated':_0x20f313};}}function updateAppConfig(_0x4a1639){return fs[_0xb3eb('0xe')](APP_JSON_PATH)[_0xb3eb('0xf')](function(_0x52d00a){if(_0x52d00a){return fs[_0xb3eb('0x10')](APP_JSON_PATH)['then'](function(_0x25a682){var _0x545bc3=setLegacyLibsNodeEnvPath(_0x25a682);if(_0x545bc3['updated']){_0x4a1639[_0xb3eb('0x11')](_0xb3eb('0x12'));return fs[_0xb3eb('0x13')](APP_JSON_PATH,_0x25a682,{'spaces':0x2});}else{return Promise[_0xb3eb('0x4')]();}});}else{return Promise[_0xb3eb('0x4')]();}});}module[_0xb3eb('0x14')]=updateAppConfig; \ No newline at end of file